summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTanya Lattner <tonic@nondot.org>2008-06-10 05:49:47 +0000
committerTanya Lattner <tonic@nondot.org>2008-06-10 05:49:47 +0000
commite5cad3c9a883f7a3c2860a60f1adc2e251e4e0b3 (patch)
tree60360e9b7a22fd5a8f416c98729ad41048c8a46b
parentfaa3d21403920698f0e09c5e2d0db5ddcbb1aafd (diff)
parent2d7fa80cf2db3455b8cdb2a21498b8e46e9a188a (diff)
downloadllvm-svn-tags/RELEASE_23.tar.gz
Retagging release branchsvn-tags/RELEASE_23
git-svn-id: https://llvm.org/svn/llvm-project/llvm/tags/RELEASE_23@52171 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--docs/CommandGuide/Makefile6
-rw-r--r--release_23/CREDITS.TXT268
-rw-r--r--release_23/LICENSE.TXT71
-rw-r--r--release_23/Makefile163
-rw-r--r--release_23/Makefile.common70
-rw-r--r--release_23/Makefile.config.in276
-rw-r--r--release_23/Makefile.rules1791
-rw-r--r--release_23/ModuleInfo.txt4
-rw-r--r--release_23/README.txt13
-rw-r--r--release_23/Xcode/LLVM.xcodeproj/project.pbxproj3368
-rw-r--r--release_23/Xcode/README.txt1
-rwxr-xr-xrelease_23/autoconf/AutoRegen.sh48
-rw-r--r--release_23/autoconf/LICENSE.TXT24
-rw-r--r--release_23/autoconf/README.TXT49
-rwxr-xr-xrelease_23/autoconf/config.guess1447
-rwxr-xr-xrelease_23/autoconf/config.sub1555
-rw-r--r--release_23/autoconf/configure.ac1012
-rwxr-xr-xrelease_23/autoconf/depcomp522
-rw-r--r--release_23/autoconf/install-sh322
-rw-r--r--release_23/autoconf/ltmain.sh6863
-rw-r--r--release_23/autoconf/m4/bison.m415
-rw-r--r--release_23/autoconf/m4/build_exeext.m442
-rw-r--r--release_23/autoconf/m4/c_printf_a.m431
-rw-r--r--release_23/autoconf/m4/check_gnu_make.m426
-rw-r--r--release_23/autoconf/m4/config_makefile.m49
-rw-r--r--release_23/autoconf/m4/config_project.m414
-rw-r--r--release_23/autoconf/m4/cxx_bidi_iterator.m422
-rw-r--r--release_23/autoconf/m4/cxx_fwd_iterator.m422
-rw-r--r--release_23/autoconf/m4/cxx_hash_map.m459
-rw-r--r--release_23/autoconf/m4/cxx_hash_set.m460
-rw-r--r--release_23/autoconf/m4/cxx_namespaces.m419
-rw-r--r--release_23/autoconf/m4/cxx_std_iterator.m426
-rw-r--r--release_23/autoconf/m4/find_std_program.m4118
-rw-r--r--release_23/autoconf/m4/flex.m417
-rw-r--r--release_23/autoconf/m4/func_isinf.m436
-rw-r--r--release_23/autoconf/m4/func_isnan.m427
-rw-r--r--release_23/autoconf/m4/func_mmap_file.m426
-rw-r--r--release_23/autoconf/m4/header_mmap_anonymous.m421
-rw-r--r--release_23/autoconf/m4/huge_val.m418
-rw-r--r--release_23/autoconf/m4/libtool.m46389
-rw-r--r--release_23/autoconf/m4/link_use_r.m419
-rw-r--r--release_23/autoconf/m4/ltdl.m4418
-rw-r--r--release_23/autoconf/m4/need_dev_zero_for_mmap.m417
-rw-r--r--release_23/autoconf/m4/path_perl.m416
-rw-r--r--release_23/autoconf/m4/path_tclsh.m439
-rw-r--r--release_23/autoconf/m4/rand48.m412
-rw-r--r--release_23/autoconf/m4/sanity_check.m431
-rw-r--r--release_23/autoconf/m4/single_cxx_check.m410
-rwxr-xr-xrelease_23/autoconf/missing353
-rwxr-xr-xrelease_23/autoconf/mkinstalldirs150
-rw-r--r--release_23/bindings/Makefile16
-rw-r--r--release_23/bindings/README.txt3
-rw-r--r--release_23/bindings/ocaml/Makefile19
-rw-r--r--release_23/bindings/ocaml/Makefile.ocaml338
-rw-r--r--release_23/bindings/ocaml/analysis/Makefile20
-rw-r--r--release_23/bindings/ocaml/analysis/analysis_ocaml.c72
-rw-r--r--release_23/bindings/ocaml/analysis/llvm_analysis.ml22
-rw-r--r--release_23/bindings/ocaml/analysis/llvm_analysis.mli46
-rw-r--r--release_23/bindings/ocaml/bitreader/Makefile20
-rw-r--r--release_23/bindings/ocaml/bitreader/bitreader_ocaml.c72
-rw-r--r--release_23/bindings/ocaml/bitreader/llvm_bitreader.ml19
-rw-r--r--release_23/bindings/ocaml/bitreader/llvm_bitreader.mli29
-rw-r--r--release_23/bindings/ocaml/bitwriter/Makefile20
-rw-r--r--release_23/bindings/ocaml/bitwriter/bitwriter_ocaml.c30
-rw-r--r--release_23/bindings/ocaml/bitwriter/llvm_bitwriter.ml18
-rw-r--r--release_23/bindings/ocaml/bitwriter/llvm_bitwriter.mli18
-rw-r--r--release_23/bindings/ocaml/executionengine/Makefile20
-rw-r--r--release_23/bindings/ocaml/executionengine/executionengine_ocaml.c313
-rw-r--r--release_23/bindings/ocaml/executionengine/llvm_executionengine.ml109
-rw-r--r--release_23/bindings/ocaml/executionengine/llvm_executionengine.mli154
-rw-r--r--release_23/bindings/ocaml/llvm/Makefile20
-rw-r--r--release_23/bindings/ocaml/llvm/llvm.ml806
-rw-r--r--release_23/bindings/ocaml/llvm/llvm.mli1665
-rw-r--r--release_23/bindings/ocaml/llvm/llvm_ocaml.c1270
-rw-r--r--release_23/bindings/ocaml/target/Makefile20
-rw-r--r--release_23/bindings/ocaml/target/llvm_target.ml44
-rw-r--r--release_23/bindings/ocaml/target/llvm_target.mli102
-rw-r--r--release_23/bindings/ocaml/target/target_ocaml.c109
-rw-r--r--release_23/bindings/ocaml/transforms/Makefile18
-rw-r--r--release_23/bindings/ocaml/transforms/scalar/Makefile20
-rw-r--r--release_23/bindings/ocaml/transforms/scalar/llvm_scalar_opts.ml32
-rw-r--r--release_23/bindings/ocaml/transforms/scalar/llvm_scalar_opts.mli50
-rw-r--r--release_23/bindings/ocaml/transforms/scalar/scalar_opts_ocaml.c62
-rwxr-xr-xrelease_23/build-for-llvm-top.sh58
-rwxr-xr-xrelease_23/configure35814
-rw-r--r--release_23/docs/AliasAnalysis.html984
-rw-r--r--release_23/docs/BitCodeFormat.html653
-rw-r--r--release_23/docs/Bugpoint.html244
-rw-r--r--release_23/docs/CFEBuildInstrs.html29
-rw-r--r--release_23/docs/CodeGenerator.html2006
-rw-r--r--release_23/docs/CodingStandards.html767
-rw-r--r--release_23/docs/CommandGuide/Makefile97
-rw-r--r--release_23/docs/CommandGuide/bugpoint.pod134
-rw-r--r--release_23/docs/CommandGuide/html/manpage.css256
-rw-r--r--release_23/docs/CommandGuide/index.html152
-rw-r--r--release_23/docs/CommandGuide/llc.pod191
-rw-r--r--release_23/docs/CommandGuide/lli.pod216
-rw-r--r--release_23/docs/CommandGuide/llvm-ar.pod406
-rw-r--r--release_23/docs/CommandGuide/llvm-as.pod77
-rw-r--r--release_23/docs/CommandGuide/llvm-bcanalyzer.pod315
-rw-r--r--release_23/docs/CommandGuide/llvm-config.pod131
-rw-r--r--release_23/docs/CommandGuide/llvm-db.pod16
-rw-r--r--release_23/docs/CommandGuide/llvm-dis.pod60
-rw-r--r--release_23/docs/CommandGuide/llvm-extract.pod63
-rw-r--r--release_23/docs/CommandGuide/llvm-ld.pod269
-rw-r--r--release_23/docs/CommandGuide/llvm-link.pod74
-rw-r--r--release_23/docs/CommandGuide/llvm-nm.pod122
-rw-r--r--release_23/docs/CommandGuide/llvm-prof.pod57
-rw-r--r--release_23/docs/CommandGuide/llvm-ranlib.pod52
-rw-r--r--release_23/docs/CommandGuide/llvmgcc.pod85
-rw-r--r--release_23/docs/CommandGuide/llvmgxx.pod85
-rw-r--r--release_23/docs/CommandGuide/manpage.css256
-rw-r--r--release_23/docs/CommandGuide/opt.pod138
-rw-r--r--release_23/docs/CommandGuide/stkrc.pod96
-rw-r--r--release_23/docs/CommandGuide/tblgen.pod115
-rw-r--r--release_23/docs/CommandLine.html1970
-rw-r--r--release_23/docs/CompilerDriver.html420
-rw-r--r--release_23/docs/CompilerWriterInfo.html261
-rw-r--r--release_23/docs/DeveloperPolicy.html555
-rw-r--r--release_23/docs/ExceptionHandling.html478
-rw-r--r--release_23/docs/ExtendingLLVM.html391
-rw-r--r--release_23/docs/FAQ.html737
-rw-r--r--release_23/docs/GCCFEBuildInstrs.html284
-rw-r--r--release_23/docs/GarbageCollection.html1419
-rw-r--r--release_23/docs/GetElementPtr.html370
-rw-r--r--release_23/docs/GettingStarted.html1649
-rw-r--r--release_23/docs/GettingStartedVS.html380
-rw-r--r--release_23/docs/HistoricalNotes/2000-11-18-EarlyDesignIdeas.txt74
-rw-r--r--release_23/docs/HistoricalNotes/2000-11-18-EarlyDesignIdeasResp.txt199
-rw-r--r--release_23/docs/HistoricalNotes/2000-12-06-EncodingIdea.txt30
-rw-r--r--release_23/docs/HistoricalNotes/2000-12-06-MeetingSummary.txt83
-rw-r--r--release_23/docs/HistoricalNotes/2001-01-31-UniversalIRIdea.txt39
-rw-r--r--release_23/docs/HistoricalNotes/2001-02-06-TypeNotationDebate.txt67
-rw-r--r--release_23/docs/HistoricalNotes/2001-02-06-TypeNotationDebateResp1.txt75
-rw-r--r--release_23/docs/HistoricalNotes/2001-02-06-TypeNotationDebateResp2.txt53
-rw-r--r--release_23/docs/HistoricalNotes/2001-02-06-TypeNotationDebateResp4.txt89
-rw-r--r--release_23/docs/HistoricalNotes/2001-02-09-AdveComments.txt120
-rw-r--r--release_23/docs/HistoricalNotes/2001-02-09-AdveCommentsResponse.txt245
-rw-r--r--release_23/docs/HistoricalNotes/2001-02-13-Reference-Memory.txt39
-rw-r--r--release_23/docs/HistoricalNotes/2001-02-13-Reference-MemoryResponse.txt47
-rw-r--r--release_23/docs/HistoricalNotes/2001-04-16-DynamicCompilation.txt49
-rw-r--r--release_23/docs/HistoricalNotes/2001-05-18-ExceptionHandling.txt202
-rw-r--r--release_23/docs/HistoricalNotes/2001-05-19-ExceptionResponse.txt45
-rw-r--r--release_23/docs/HistoricalNotes/2001-06-01-GCCOptimizations.txt63
-rw-r--r--release_23/docs/HistoricalNotes/2001-06-01-GCCOptimizations2.txt71
-rw-r--r--release_23/docs/HistoricalNotes/2001-06-20-.NET-Differences.txt30
-rw-r--r--release_23/docs/HistoricalNotes/2001-07-06-LoweringIRForCodeGen.txt31
-rw-r--r--release_23/docs/HistoricalNotes/2001-07-08-InstructionSelection.txt51
-rw-r--r--release_23/docs/HistoricalNotes/2001-07-08-InstructionSelection2.txt25
-rw-r--r--release_23/docs/HistoricalNotes/2001-09-18-OptimizeExceptions.txt56
-rw-r--r--release_23/docs/HistoricalNotes/2002-05-12-InstListChange.txt55
-rw-r--r--release_23/docs/HistoricalNotes/2002-06-25-MegaPatchInfo.txt72
-rw-r--r--release_23/docs/HistoricalNotes/2003-01-23-CygwinNotes.txt28
-rw-r--r--release_23/docs/HistoricalNotes/2003-06-25-Reoptimizer1.txt137
-rw-r--r--release_23/docs/HistoricalNotes/2003-06-26-Reoptimizer2.txt110
-rw-r--r--release_23/docs/HowToReleaseLLVM.html608
-rw-r--r--release_23/docs/HowToSubmitABug.html355
-rw-r--r--release_23/docs/LangRef.html5745
-rw-r--r--release_23/docs/Lexicon.html254
-rw-r--r--release_23/docs/LinkTimeOptimization.html356
-rw-r--r--release_23/docs/Makefile125
-rw-r--r--release_23/docs/MakefileGuide.html1041
-rw-r--r--release_23/docs/Passes.html1952
-rw-r--r--release_23/docs/ProgrammersManual.html3195
-rw-r--r--release_23/docs/Projects.html460
-rw-r--r--release_23/docs/ReleaseNotes.html842
-rw-r--r--release_23/docs/SourceLevelDebugging.html1785
-rw-r--r--release_23/docs/Stacker.html1428
-rw-r--r--release_23/docs/SystemLibrary.html344
-rw-r--r--release_23/docs/TableGenFundamentals.html753
-rw-r--r--release_23/docs/TestingGuide.html894
-rw-r--r--release_23/docs/UsingLibraries.html449
-rw-r--r--release_23/docs/WritingAnLLVMBackend.html260
-rw-r--r--release_23/docs/WritingAnLLVMPass.html1825
-rw-r--r--release_23/docs/doxygen.cfg.in1230
-rw-r--r--release_23/docs/doxygen.css378
-rw-r--r--release_23/docs/doxygen.footer13
-rw-r--r--release_23/docs/doxygen.header9
-rw-r--r--release_23/docs/doxygen.intro18
-rw-r--r--release_23/docs/img/Debugging.gifbin20390 -> 0 bytes
-rw-r--r--release_23/docs/img/libdeps.gifbin52679 -> 0 bytes
-rw-r--r--release_23/docs/img/lines.gifbin91 -> 0 bytes
-rw-r--r--release_23/docs/img/objdeps.gifbin16201 -> 0 bytes
-rw-r--r--release_23/docs/img/venusflytrap.jpgbin56606 -> 0 bytes
-rw-r--r--release_23/docs/index.html279
-rw-r--r--release_23/docs/llvm.css84
-rw-r--r--release_23/docs/tutorial/JITTutorial1.html196
-rw-r--r--release_23/docs/tutorial/JITTutorial2-1.pngbin59107 -> 0 bytes
-rw-r--r--release_23/docs/tutorial/JITTutorial2.html190
-rw-r--r--release_23/docs/tutorial/LangImpl1.html348
-rw-r--r--release_23/docs/tutorial/LangImpl2.html1230
-rw-r--r--release_23/docs/tutorial/LangImpl3.html1250
-rw-r--r--release_23/docs/tutorial/LangImpl4.html1126
-rw-r--r--release_23/docs/tutorial/LangImpl5-cfg.pngbin38586 -> 0 bytes
-rw-r--r--release_23/docs/tutorial/LangImpl5.html1764
-rw-r--r--release_23/docs/tutorial/LangImpl6.html1803
-rw-r--r--release_23/docs/tutorial/LangImpl7.html2159
-rw-r--r--release_23/docs/tutorial/LangImpl8.html365
-rw-r--r--release_23/docs/tutorial/Makefile28
-rw-r--r--release_23/docs/tutorial/OCamlLangImpl1.html365
-rw-r--r--release_23/docs/tutorial/OCamlLangImpl2.html1045
-rw-r--r--release_23/docs/tutorial/OCamlLangImpl3.html1090
-rw-r--r--release_23/docs/tutorial/OCamlLangImpl4.html1036
-rw-r--r--release_23/docs/tutorial/OCamlLangImpl5.html1564
-rw-r--r--release_23/docs/tutorial/OCamlLangImpl6.html1569
-rw-r--r--release_23/docs/tutorial/OCamlLangImpl7.html1902
-rw-r--r--release_23/docs/tutorial/index.html58
-rw-r--r--release_23/examples/BrainF/BrainF.cpp455
-rw-r--r--release_23/examples/BrainF/BrainF.h91
-rw-r--r--release_23/examples/BrainF/BrainFDriver.cpp156
-rw-r--r--release_23/examples/BrainF/Makefile15
-rw-r--r--release_23/examples/Fibonacci/Makefile17
-rw-r--r--release_23/examples/Fibonacci/fibonacci.cpp121
-rw-r--r--release_23/examples/HowToUseJIT/HowToUseJIT.cpp112
-rw-r--r--release_23/examples/HowToUseJIT/Makefile15
-rw-r--r--release_23/examples/Makefile19
-rw-r--r--release_23/examples/ModuleMaker/Makefile14
-rw-r--r--release_23/examples/ModuleMaker/ModuleMaker.cpp61
-rw-r--r--release_23/examples/ModuleMaker/README.txt8
-rw-r--r--release_23/examples/ParallelJIT/Makefile17
-rw-r--r--release_23/examples/ParallelJIT/ParallelJIT.cpp298
-rw-r--r--release_23/include/llvm-c/Analysis.h55
-rw-r--r--release_23/include/llvm-c/BitReader.h47
-rw-r--r--release_23/include/llvm-c/BitWriter.h43
-rw-r--r--release_23/include/llvm-c/Core.h756
-rw-r--r--release_23/include/llvm-c/ExecutionEngine.h118
-rw-r--r--release_23/include/llvm-c/LinkTimeOptimizer.h58
-rw-r--r--release_23/include/llvm-c/Target.h131
-rw-r--r--release_23/include/llvm-c/Transforms/Scalar.h53
-rw-r--r--release_23/include/llvm-c/lto.h235
-rw-r--r--release_23/include/llvm/ADT/APFloat.h345
-rw-r--r--release_23/include/llvm/ADT/APInt.h1432
-rw-r--r--release_23/include/llvm/ADT/APSInt.h237
-rw-r--r--release_23/include/llvm/ADT/BitVector.h409
-rw-r--r--release_23/include/llvm/ADT/DenseMap.h458
-rw-r--r--release_23/include/llvm/ADT/DenseSet.h97
-rw-r--r--release_23/include/llvm/ADT/DepthFirstIterator.h236
-rw-r--r--release_23/include/llvm/ADT/EquivalenceClasses.h279
-rw-r--r--release_23/include/llvm/ADT/FoldingSet.h435
-rw-r--r--release_23/include/llvm/ADT/GraphTraits.h103
-rw-r--r--release_23/include/llvm/ADT/HashExtras.h41
-rw-r--r--release_23/include/llvm/ADT/ImmutableMap.h225
-rw-r--r--release_23/include/llvm/ADT/ImmutableSet.h1057
-rw-r--r--release_23/include/llvm/ADT/IndexedMap.h75
-rw-r--r--release_23/include/llvm/ADT/IntrusiveRefCntPtr.h230
-rw-r--r--release_23/include/llvm/ADT/OwningPtr.h134
-rw-r--r--release_23/include/llvm/ADT/PostOrderIterator.h230
-rw-r--r--release_23/include/llvm/ADT/SCCIterator.h199
-rw-r--r--release_23/include/llvm/ADT/STLExtras.h223
-rw-r--r--release_23/include/llvm/ADT/SetOperations.h71
-rw-r--r--release_23/include/llvm/ADT/SetVector.h168
-rw-r--r--release_23/include/llvm/ADT/SmallPtrSet.h272
-rw-r--r--release_23/include/llvm/ADT/SmallSet.h112
-rw-r--r--release_23/include/llvm/ADT/SmallString.h104
-rw-r--r--release_23/include/llvm/ADT/SmallVector.h522
-rw-r--r--release_23/include/llvm/ADT/SparseBitVector.h890
-rw-r--r--release_23/include/llvm/ADT/Statistic.h75
-rw-r--r--release_23/include/llvm/ADT/StringExtras.h197
-rw-r--r--release_23/include/llvm/ADT/StringMap.h451
-rw-r--r--release_23/include/llvm/ADT/Tree.h62
-rw-r--r--release_23/include/llvm/ADT/Trie.h331
-rw-r--r--release_23/include/llvm/ADT/UniqueVector.h89
-rw-r--r--release_23/include/llvm/ADT/VectorExtras.h41
-rw-r--r--release_23/include/llvm/ADT/hash_map.in150
-rw-r--r--release_23/include/llvm/ADT/hash_set.in111
-rw-r--r--release_23/include/llvm/ADT/ilist634
-rw-r--r--release_23/include/llvm/ADT/iterator.in76
-rw-r--r--release_23/include/llvm/AbstractTypeUser.h179
-rw-r--r--release_23/include/llvm/Analysis/AliasAnalysis.h357
-rw-r--r--release_23/include/llvm/Analysis/AliasSetTracker.h396
-rw-r--r--release_23/include/llvm/Analysis/CFGPrinter.h24
-rw-r--r--release_23/include/llvm/Analysis/CallGraph.h320
-rw-r--r--release_23/include/llvm/Analysis/ConstantFolding.h67
-rw-r--r--release_23/include/llvm/Analysis/ConstantsScanner.h94
-rw-r--r--release_23/include/llvm/Analysis/DominatorInternals.h363
-rw-r--r--release_23/include/llvm/Analysis/Dominators.h966
-rw-r--r--release_23/include/llvm/Analysis/FindUsedTypes.h64
-rw-r--r--release_23/include/llvm/Analysis/Interval.h154
-rw-r--r--release_23/include/llvm/Analysis/IntervalIterator.h258
-rw-r--r--release_23/include/llvm/Analysis/IntervalPartition.h115
-rw-r--r--release_23/include/llvm/Analysis/LibCallSemantics.h166
-rw-r--r--release_23/include/llvm/Analysis/LoadValueNumbering.h35
-rw-r--r--release_23/include/llvm/Analysis/LoopInfo.h1016
-rw-r--r--release_23/include/llvm/Analysis/LoopPass.h157
-rw-r--r--release_23/include/llvm/Analysis/MemoryDependenceAnalysis.h117
-rw-r--r--release_23/include/llvm/Analysis/Passes.h126
-rw-r--r--release_23/include/llvm/Analysis/PostDominators.h95
-rw-r--r--release_23/include/llvm/Analysis/ProfileInfo.h67
-rw-r--r--release_23/include/llvm/Analysis/ProfileInfoLoader.h89
-rw-r--r--release_23/include/llvm/Analysis/ProfileInfoTypes.h28
-rw-r--r--release_23/include/llvm/Analysis/ScalarEvolution.h304
-rw-r--r--release_23/include/llvm/Analysis/ScalarEvolutionExpander.h148
-rw-r--r--release_23/include/llvm/Analysis/ScalarEvolutionExpressions.h593
-rw-r--r--release_23/include/llvm/Analysis/Trace.h120
-rw-r--r--release_23/include/llvm/Analysis/ValueNumbering.h75
-rw-r--r--release_23/include/llvm/Analysis/Verifier.h75
-rw-r--r--release_23/include/llvm/Argument.h94
-rw-r--r--release_23/include/llvm/Assembly/AsmAnnotationWriter.h53
-rw-r--r--release_23/include/llvm/Assembly/Parser.h97
-rw-r--r--release_23/include/llvm/Assembly/PrintModulePass.h82
-rw-r--r--release_23/include/llvm/Assembly/Writer.h45
-rw-r--r--release_23/include/llvm/AutoUpgrade.h40
-rw-r--r--release_23/include/llvm/BasicBlock.h221
-rw-r--r--release_23/include/llvm/Bitcode/Archive.h557
-rw-r--r--release_23/include/llvm/Bitcode/BitCodes.h181
-rw-r--r--release_23/include/llvm/Bitcode/BitstreamReader.h482
-rw-r--r--release_23/include/llvm/Bitcode/BitstreamWriter.h405
-rw-r--r--release_23/include/llvm/Bitcode/Deserialize.h517
-rw-r--r--release_23/include/llvm/Bitcode/LLVMBitCodes.h210
-rw-r--r--release_23/include/llvm/Bitcode/ReaderWriter.h48
-rw-r--r--release_23/include/llvm/Bitcode/Serialization.h68
-rw-r--r--release_23/include/llvm/Bitcode/SerializationFwd.h27
-rw-r--r--release_23/include/llvm/Bitcode/Serialize.h211
-rw-r--r--release_23/include/llvm/CallGraphSCCPass.h72
-rw-r--r--release_23/include/llvm/CallingConv.h70
-rw-r--r--release_23/include/llvm/CodeGen/AsmPrinter.h360
-rw-r--r--release_23/include/llvm/CodeGen/BreakCriticalMachineEdge.h109
-rw-r--r--release_23/include/llvm/CodeGen/CallingConvLower.h233
-rw-r--r--release_23/include/llvm/CodeGen/Collector.h133
-rw-r--r--release_23/include/llvm/CodeGen/CollectorMetadata.h194
-rw-r--r--release_23/include/llvm/CodeGen/Collectors.h39
-rw-r--r--release_23/include/llvm/CodeGen/DwarfWriter.h82
-rw-r--r--release_23/include/llvm/CodeGen/ELFRelocation.h52
-rw-r--r--release_23/include/llvm/CodeGen/FileWriters.h32
-rw-r--r--release_23/include/llvm/CodeGen/IntrinsicLowering.h50
-rw-r--r--release_23/include/llvm/CodeGen/LinkAllCodegenComponents.h51
-rw-r--r--release_23/include/llvm/CodeGen/LiveInterval.h383
-rw-r--r--release_23/include/llvm/CodeGen/LiveIntervalAnalysis.h440
-rw-r--r--release_23/include/llvm/CodeGen/LiveVariables.h289
-rw-r--r--release_23/include/llvm/CodeGen/MachORelocation.h54
-rw-r--r--release_23/include/llvm/CodeGen/MachineBasicBlock.h397
-rw-r--r--release_23/include/llvm/CodeGen/MachineCodeEmitter.h279
-rw-r--r--release_23/include/llvm/CodeGen/MachineConstantPool.h150
-rw-r--r--release_23/include/llvm/CodeGen/MachineDominators.h216
-rw-r--r--release_23/include/llvm/CodeGen/MachineFrameInfo.h370
-rw-r--r--release_23/include/llvm/CodeGen/MachineFunction.h322
-rw-r--r--release_23/include/llvm/CodeGen/MachineFunctionPass.h50
-rw-r--r--release_23/include/llvm/CodeGen/MachineInstr.h307
-rw-r--r--release_23/include/llvm/CodeGen/MachineInstrBuilder.h155
-rw-r--r--release_23/include/llvm/CodeGen/MachineJumpTableInfo.h104
-rw-r--r--release_23/include/llvm/CodeGen/MachineLocation.h106
-rw-r--r--release_23/include/llvm/CodeGen/MachineLoopInfo.h190
-rw-r--r--release_23/include/llvm/CodeGen/MachineMemOperand.h83
-rw-r--r--release_23/include/llvm/CodeGen/MachineModuleInfo.h1305
-rw-r--r--release_23/include/llvm/CodeGen/MachineOperand.h431
-rw-r--r--release_23/include/llvm/CodeGen/MachinePassRegistry.h156
-rw-r--r--release_23/include/llvm/CodeGen/MachineRegisterInfo.h282
-rw-r--r--release_23/include/llvm/CodeGen/MachineRelocation.h324
-rw-r--r--release_23/include/llvm/CodeGen/Passes.h178
-rw-r--r--release_23/include/llvm/CodeGen/PseudoSourceValue.h58
-rw-r--r--release_23/include/llvm/CodeGen/RegAllocRegistry.h64
-rw-r--r--release_23/include/llvm/CodeGen/RegisterCoalescer.h159
-rw-r--r--release_23/include/llvm/CodeGen/RegisterScavenging.h165
-rw-r--r--release_23/include/llvm/CodeGen/RuntimeLibcalls.h153
-rw-r--r--release_23/include/llvm/CodeGen/SchedGraphCommon.h289
-rw-r--r--release_23/include/llvm/CodeGen/ScheduleDAG.h487
-rw-r--r--release_23/include/llvm/CodeGen/SchedulerRegistry.h71
-rw-r--r--release_23/include/llvm/CodeGen/SelectionDAG.h639
-rw-r--r--release_23/include/llvm/CodeGen/SelectionDAGISel.h200
-rw-r--r--release_23/include/llvm/CodeGen/SelectionDAGNodes.h2200
-rw-r--r--release_23/include/llvm/CodeGen/ValueTypes.h392
-rw-r--r--release_23/include/llvm/CodeGen/ValueTypes.td59
-rw-r--r--release_23/include/llvm/Config/alloca.h50
-rw-r--r--release_23/include/llvm/Config/config.h.in573
-rw-r--r--release_23/include/llvm/Constant.h129
-rw-r--r--release_23/include/llvm/Constants.h767
-rw-r--r--release_23/include/llvm/Debugger/Debugger.h175
-rw-r--r--release_23/include/llvm/Debugger/InferiorProcess.h138
-rw-r--r--release_23/include/llvm/Debugger/ProgramInfo.h246
-rw-r--r--release_23/include/llvm/Debugger/RuntimeInfo.h142
-rw-r--r--release_23/include/llvm/Debugger/SourceFile.h87
-rw-r--r--release_23/include/llvm/Debugger/SourceLanguage.h99
-rw-r--r--release_23/include/llvm/DerivedTypes.h429
-rw-r--r--release_23/include/llvm/ExecutionEngine/ExecutionEngine.h287
-rw-r--r--release_23/include/llvm/ExecutionEngine/GenericValue.h44
-rw-r--r--release_23/include/llvm/ExecutionEngine/Interpreter.h40
-rw-r--r--release_23/include/llvm/ExecutionEngine/JIT.h40
-rw-r--r--release_23/include/llvm/ExecutionEngine/JITMemoryManager.h115
-rw-r--r--release_23/include/llvm/Function.h360
-rw-r--r--release_23/include/llvm/GlobalAlias.h100
-rw-r--r--release_23/include/llvm/GlobalValue.h151
-rw-r--r--release_23/include/llvm/GlobalVariable.h146
-rw-r--r--release_23/include/llvm/InlineAsm.h134
-rw-r--r--release_23/include/llvm/InstrTypes.h603
-rw-r--r--release_23/include/llvm/Instruction.def193
-rw-r--r--release_23/include/llvm/Instruction.h242
-rw-r--r--release_23/include/llvm/Instructions.h2624
-rw-r--r--release_23/include/llvm/IntrinsicInst.h312
-rw-r--r--release_23/include/llvm/Intrinsics.h71
-rw-r--r--release_23/include/llvm/Intrinsics.td340
-rw-r--r--release_23/include/llvm/IntrinsicsARM.td21
-rw-r--r--release_23/include/llvm/IntrinsicsCellSPU.td242
-rw-r--r--release_23/include/llvm/IntrinsicsPowerPC.td462
-rw-r--r--release_23/include/llvm/IntrinsicsX86.td1045
-rw-r--r--release_23/include/llvm/LinkAllPasses.h130
-rw-r--r--release_23/include/llvm/LinkAllVMCore.h54
-rw-r--r--release_23/include/llvm/LinkTimeOptimizer.h178
-rw-r--r--release_23/include/llvm/Linker.h297
-rw-r--r--release_23/include/llvm/Module.h423
-rw-r--r--release_23/include/llvm/ModuleProvider.h88
-rw-r--r--release_23/include/llvm/ParameterAttributes.h205
-rw-r--r--release_23/include/llvm/Pass.h383
-rw-r--r--release_23/include/llvm/PassAnalysisSupport.h240
-rw-r--r--release_23/include/llvm/PassManager.h106
-rw-r--r--release_23/include/llvm/PassManagers.h413
-rw-r--r--release_23/include/llvm/PassSupport.h262
-rw-r--r--release_23/include/llvm/Support/AIXDataTypesFix.h25
-rw-r--r--release_23/include/llvm/Support/AlignOf.h60
-rw-r--r--release_23/include/llvm/Support/Allocator.h62
-rw-r--r--release_23/include/llvm/Support/Annotation.h218
-rw-r--r--release_23/include/llvm/Support/CFG.h265
-rw-r--r--release_23/include/llvm/Support/CallSite.h158
-rw-r--r--release_23/include/llvm/Support/Casting.h303
-rw-r--r--release_23/include/llvm/Support/CommandLine.h1336
-rw-r--r--release_23/include/llvm/Support/Compiler.h48
-rw-r--r--release_23/include/llvm/Support/ConstantRange.h198
-rw-r--r--release_23/include/llvm/Support/DOTGraphTraits.h123
-rw-r--r--release_23/include/llvm/Support/DataFlow.h104
-rw-r--r--release_23/include/llvm/Support/DataTypes.h.in131
-rw-r--r--release_23/include/llvm/Support/Debug.h78
-rw-r--r--release_23/include/llvm/Support/Dwarf.h568
-rw-r--r--release_23/include/llvm/Support/DynamicLinker.h40
-rw-r--r--release_23/include/llvm/Support/ELF.h300
-rw-r--r--release_23/include/llvm/Support/FileUtilities.h59
-rw-r--r--release_23/include/llvm/Support/GetElementPtrTypeIterator.h112
-rw-r--r--release_23/include/llvm/Support/GraphWriter.h317
-rw-r--r--release_23/include/llvm/Support/IRBuilder.h542
-rw-r--r--release_23/include/llvm/Support/InstIterator.h147
-rw-r--r--release_23/include/llvm/Support/InstVisitor.h222
-rw-r--r--release_23/include/llvm/Support/LeakDetector.h91
-rw-r--r--release_23/include/llvm/Support/ManagedStatic.h96
-rw-r--r--release_23/include/llvm/Support/Mangler.h114
-rw-r--r--release_23/include/llvm/Support/MathExtras.h402
-rw-r--r--release_23/include/llvm/Support/MemoryBuffer.h109
-rw-r--r--release_23/include/llvm/Support/MutexGuard.h41
-rw-r--r--release_23/include/llvm/Support/OutputBuffer.h154
-rw-r--r--release_23/include/llvm/Support/PassNameParser.h132
-rw-r--r--release_23/include/llvm/Support/PatternMatch.h453
-rw-r--r--release_23/include/llvm/Support/PluginLoader.h37
-rw-r--r--release_23/include/llvm/Support/Registry.h239
-rw-r--r--release_23/include/llvm/Support/SlowOperationInformer.h65
-rw-r--r--release_23/include/llvm/Support/StableBasicBlockNumbering.h59
-rw-r--r--release_23/include/llvm/Support/Streams.h72
-rw-r--r--release_23/include/llvm/Support/StringPool.h148
-rw-r--r--release_23/include/llvm/Support/SystemUtils.h42
-rw-r--r--release_23/include/llvm/Support/Timer.h165
-rw-r--r--release_23/include/llvm/Support/type_traits.h54
-rw-r--r--release_23/include/llvm/SymbolTableListTraits.h76
-rw-r--r--release_23/include/llvm/System/Alarm.h45
-rw-r--r--release_23/include/llvm/System/Disassembler.h35
-rw-r--r--release_23/include/llvm/System/DynamicLibrary.h98
-rw-r--r--release_23/include/llvm/System/Host.h36
-rw-r--r--release_23/include/llvm/System/IncludeFile.h78
-rw-r--r--release_23/include/llvm/System/LICENSE.TXT6
-rw-r--r--release_23/include/llvm/System/Memory.h73
-rw-r--r--release_23/include/llvm/System/Mutex.h84
-rw-r--r--release_23/include/llvm/System/Path.h718
-rw-r--r--release_23/include/llvm/System/Process.h102
-rw-r--r--release_23/include/llvm/System/Program.h92
-rw-r--r--release_23/include/llvm/System/Signals.h52
-rw-r--r--release_23/include/llvm/System/TimeValue.h382
-rw-r--r--release_23/include/llvm/Target/SubtargetFeature.h111
-rw-r--r--release_23/include/llvm/Target/TargetAsmInfo.h683
-rw-r--r--release_23/include/llvm/Target/TargetData.h289
-rw-r--r--release_23/include/llvm/Target/TargetELFWriterInfo.h43
-rw-r--r--release_23/include/llvm/Target/TargetFrameInfo.h82
-rw-r--r--release_23/include/llvm/Target/TargetInstrDesc.h394
-rw-r--r--release_23/include/llvm/Target/TargetInstrInfo.h428
-rw-r--r--release_23/include/llvm/Target/TargetInstrItineraries.h85
-rw-r--r--release_23/include/llvm/Target/TargetJITInfo.h107
-rw-r--r--release_23/include/llvm/Target/TargetLowering.h1446
-rw-r--r--release_23/include/llvm/Target/TargetMachOWriterInfo.h112
-rw-r--r--release_23/include/llvm/Target/TargetMachine.h339
-rw-r--r--release_23/include/llvm/Target/TargetMachineRegistry.h96
-rw-r--r--release_23/include/llvm/Target/TargetOptions.h98
-rw-r--r--release_23/include/llvm/Target/TargetRegisterInfo.h618
-rw-r--r--release_23/include/llvm/Target/TargetSubtarget.h36
-rw-r--r--release_23/include/llvm/Transforms/IPO.h172
-rw-r--r--release_23/include/llvm/Transforms/IPO/InlinerPass.h70
-rw-r--r--release_23/include/llvm/Transforms/Instrumentation.h37
-rw-r--r--release_23/include/llvm/Transforms/RSProfiling.h38
-rw-r--r--release_23/include/llvm/Transforms/Scalar.h341
-rw-r--r--release_23/include/llvm/Transforms/Utils/BasicBlockUtils.h138
-rw-r--r--release_23/include/llvm/Transforms/Utils/BasicInliner.h55
-rw-r--r--release_23/include/llvm/Transforms/Utils/Cloning.h191
-rw-r--r--release_23/include/llvm/Transforms/Utils/FunctionUtils.h41
-rw-r--r--release_23/include/llvm/Transforms/Utils/InlineCost.h89
-rw-r--r--release_23/include/llvm/Transforms/Utils/Local.h91
-rw-r--r--release_23/include/llvm/Transforms/Utils/PromoteMemToReg.h46
-rw-r--r--release_23/include/llvm/Transforms/Utils/UnifyFunctionExitNodes.h49
-rw-r--r--release_23/include/llvm/Transforms/Utils/ValueMapper.h29
-rw-r--r--release_23/include/llvm/Type.h412
-rw-r--r--release_23/include/llvm/TypeSymbolTable.h137
-rw-r--r--release_23/include/llvm/Use.h181
-rw-r--r--release_23/include/llvm/User.h127
-rw-r--r--release_23/include/llvm/Value.h282
-rw-r--r--release_23/include/llvm/ValueSymbolTable.h137
-rw-r--r--release_23/lib/Analysis/AliasAnalysis.cpp216
-rw-r--r--release_23/lib/Analysis/AliasAnalysisCounter.cpp171
-rw-r--r--release_23/lib/Analysis/AliasAnalysisEvaluator.cpp247
-rw-r--r--release_23/lib/Analysis/AliasDebugger.cpp131
-rw-r--r--release_23/lib/Analysis/AliasSetTracker.cpp590
-rw-r--r--release_23/lib/Analysis/Analysis.cpp44
-rw-r--r--release_23/lib/Analysis/BasicAliasAnalysis.cpp833
-rw-r--r--release_23/lib/Analysis/CFGPrinter.cpp214
-rw-r--r--release_23/lib/Analysis/ConstantFolding.cpp753
-rw-r--r--release_23/lib/Analysis/IPA/Andersens.cpp2869
-rw-r--r--release_23/lib/Analysis/IPA/CallGraph.cpp323
-rw-r--r--release_23/lib/Analysis/IPA/CallGraphSCCPass.cpp195
-rw-r--r--release_23/lib/Analysis/IPA/FindUsedTypes.cpp98
-rw-r--r--release_23/lib/Analysis/IPA/GlobalsModRef.cpp559
-rw-r--r--release_23/lib/Analysis/IPA/Makefile14
-rw-r--r--release_23/lib/Analysis/InstCount.cpp86
-rw-r--r--release_23/lib/Analysis/Interval.cpp57
-rw-r--r--release_23/lib/Analysis/IntervalPartition.cpp114
-rw-r--r--release_23/lib/Analysis/LibCallAliasAnalysis.cpp169
-rw-r--r--release_23/lib/Analysis/LibCallSemantics.cpp65
-rw-r--r--release_23/lib/Analysis/LoadValueNumbering.cpp528
-rw-r--r--release_23/lib/Analysis/LoopInfo.cpp53
-rw-r--r--release_23/lib/Analysis/LoopPass.cpp320
-rw-r--r--release_23/lib/Analysis/Makefile16
-rw-r--r--release_23/lib/Analysis/MemoryDependenceAnalysis.cpp578
-rw-r--r--release_23/lib/Analysis/PostDominators.cpp86
-rw-r--r--release_23/lib/Analysis/ProfileInfo.cpp102
-rw-r--r--release_23/lib/Analysis/ProfileInfoLoader.cpp276
-rw-r--r--release_23/lib/Analysis/ProfileInfoLoaderPass.cpp92
-rw-r--r--release_23/lib/Analysis/ScalarEvolution.cpp2905
-rw-r--r--release_23/lib/Analysis/ScalarEvolutionExpander.cpp242
-rw-r--r--release_23/lib/Analysis/Trace.cpp50
-rw-r--r--release_23/lib/Analysis/ValueNumbering.cpp280
-rw-r--r--release_23/lib/Archive/Archive.cpp266
-rw-r--r--release_23/lib/Archive/ArchiveInternals.h85
-rw-r--r--release_23/lib/Archive/ArchiveReader.cpp628
-rw-r--r--release_23/lib/Archive/ArchiveWriter.cpp471
-rw-r--r--release_23/lib/Archive/Makefile17
-rw-r--r--release_23/lib/AsmParser/LLLexer.cpp844
-rw-r--r--release_23/lib/AsmParser/LLLexer.h57
-rw-r--r--release_23/lib/AsmParser/Makefile26
-rw-r--r--release_23/lib/AsmParser/Parser.cpp90
-rw-r--r--release_23/lib/AsmParser/ParserInternals.h242
-rw-r--r--release_23/lib/AsmParser/llvmAsmParser.cpp.cvs6675
-rw-r--r--release_23/lib/AsmParser/llvmAsmParser.h.cvs403
-rw-r--r--release_23/lib/AsmParser/llvmAsmParser.y3227
-rw-r--r--release_23/lib/AsmParser/llvmAsmParser.y.cvs3227
-rw-r--r--release_23/lib/Bitcode/Makefile14
-rw-r--r--release_23/lib/Bitcode/Reader/BitReader.cpp51
-rw-r--r--release_23/lib/Bitcode/Reader/BitcodeReader.cpp1785
-rw-r--r--release_23/lib/Bitcode/Reader/BitcodeReader.h208
-rw-r--r--release_23/lib/Bitcode/Reader/Deserialize.cpp454
-rw-r--r--release_23/lib/Bitcode/Reader/DeserializeAPFloat.cpp24
-rw-r--r--release_23/lib/Bitcode/Reader/DeserializeAPInt.cpp33
-rw-r--r--release_23/lib/Bitcode/Reader/Makefile15
-rw-r--r--release_23/lib/Bitcode/Writer/BitWriter.cpp52
-rw-r--r--release_23/lib/Bitcode/Writer/BitcodeWriter.cpp1258
-rw-r--r--release_23/lib/Bitcode/Writer/BitcodeWriterPass.cpp43
-rw-r--r--release_23/lib/Bitcode/Writer/Makefile15
-rw-r--r--release_23/lib/Bitcode/Writer/Serialize.cpp118
-rw-r--r--release_23/lib/Bitcode/Writer/SerializeAPFloat.cpp21
-rw-r--r--release_23/lib/Bitcode/Writer/SerializeAPInt.cpp31
-rw-r--r--release_23/lib/Bitcode/Writer/ValueEnumerator.cpp327
-rw-r--r--release_23/lib/Bitcode/Writer/ValueEnumerator.h127
-rw-r--r--release_23/lib/CodeGen/AsmPrinter.cpp1437
-rw-r--r--release_23/lib/CodeGen/BranchFolding.cpp1214
-rw-r--r--release_23/lib/CodeGen/Collector.cpp400
-rw-r--r--release_23/lib/CodeGen/CollectorMetadata.cpp215
-rw-r--r--release_23/lib/CodeGen/Collectors.cpp21
-rw-r--r--release_23/lib/CodeGen/DwarfWriter.cpp3823
-rw-r--r--release_23/lib/CodeGen/ELFWriter.cpp563
-rw-r--r--release_23/lib/CodeGen/ELFWriter.h229
-rw-r--r--release_23/lib/CodeGen/IfConversion.cpp1223
-rw-r--r--release_23/lib/CodeGen/IntrinsicLowering.cpp870
-rw-r--r--release_23/lib/CodeGen/LLVMTargetMachine.cpp278
-rw-r--r--release_23/lib/CodeGen/LiveInterval.cpp726
-rw-r--r--release_23/lib/CodeGen/LiveIntervalAnalysis.cpp1743
-rw-r--r--release_23/lib/CodeGen/LiveVariables.cpp715
-rw-r--r--release_23/lib/CodeGen/LoopAligner.cpp67
-rw-r--r--release_23/lib/CodeGen/LowerSubregs.cpp195
-rw-r--r--release_23/lib/CodeGen/MachOWriter.cpp963
-rw-r--r--release_23/lib/CodeGen/MachOWriter.h628
-rw-r--r--release_23/lib/CodeGen/MachineBasicBlock.cpp358
-rw-r--r--release_23/lib/CodeGen/MachineDominators.cpp30
-rw-r--r--release_23/lib/CodeGen/MachineFunction.cpp499
-rw-r--r--release_23/lib/CodeGen/MachineInstr.cpp846
-rw-r--r--release_23/lib/CodeGen/MachineLICM.cpp327
-rw-r--r--release_23/lib/CodeGen/MachineLoopInfo.cpp42
-rw-r--r--release_23/lib/CodeGen/MachineModuleInfo.cpp1945
-rw-r--r--release_23/lib/CodeGen/MachinePassRegistry.cpp41
-rw-r--r--release_23/lib/CodeGen/MachineRegisterInfo.cpp83
-rw-r--r--release_23/lib/CodeGen/MachineSink.cpp234
-rw-r--r--release_23/lib/CodeGen/Makefile22
-rw-r--r--release_23/lib/CodeGen/OcamlCollector.cpp171
-rw-r--r--release_23/lib/CodeGen/PHIElimination.cpp373
-rw-r--r--release_23/lib/CodeGen/Passes.cpp57
-rw-r--r--release_23/lib/CodeGen/PhysRegTracker.h73
-rw-r--r--release_23/lib/CodeGen/PostRASchedulerList.cpp66
-rw-r--r--release_23/lib/CodeGen/PrologEpilogInserter.cpp585
-rw-r--r--release_23/lib/CodeGen/PseudoSourceValue.cpp46
-rw-r--r--release_23/lib/CodeGen/README.txt199
-rw-r--r--release_23/lib/CodeGen/RegAllocBigBlock.cpp891
-rw-r--r--release_23/lib/CodeGen/RegAllocLinearScan.cpp937
-rw-r--r--release_23/lib/CodeGen/RegAllocLocal.cpp850
-rw-r--r--release_23/lib/CodeGen/RegAllocSimple.cpp256
-rw-r--r--release_23/lib/CodeGen/RegisterCoalescer.cpp43
-rw-r--r--release_23/lib/CodeGen/RegisterScavenging.cpp412
-rw-r--r--release_23/lib/CodeGen/SelectionDAG/CallingConvLower.cpp120
-rw-r--r--release_23/lib/CodeGen/SelectionDAG/DAGCombiner.cpp5552
-rw-r--r--release_23/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp7113
-rw-r--r--release_23/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp567
-rw-r--r--release_23/lib/CodeGen/SelectionDAG/LegalizeTypes.h402
-rw-r--r--release_23/lib/CodeGen/SelectionDAG/LegalizeTypesExpand.cpp1466
-rw-r--r--release_23/lib/CodeGen/SelectionDAG/LegalizeTypesFloatToInt.cpp356
-rw-r--r--release_23/lib/CodeGen/SelectionDAG/LegalizeTypesPromote.cpp748
-rw-r--r--release_23/lib/CodeGen/SelectionDAG/LegalizeTypesScalarize.cpp233
-rw-r--r--release_23/lib/CodeGen/SelectionDAG/LegalizeTypesSplit.cpp573
-rw-r--r--release_23/lib/CodeGen/SelectionDAG/Makefile15
-rw-r--r--release_23/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp1199
-rw-r--r--release_23/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp571
-rw-r--r--release_23/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp1860
-rw-r--r--release_23/lib/CodeGen/SelectionDAG/SelectionDAG.cpp4718
-rw-r--r--release_23/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp5290
-rw-r--r--release_23/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp340
-rw-r--r--release_23/lib/CodeGen/SelectionDAG/TargetLowering.cpp2068
-rw-r--r--release_23/lib/CodeGen/ShadowStackCollector.cpp438
-rw-r--r--release_23/lib/CodeGen/SimpleRegisterCoalescing.cpp2125
-rw-r--r--release_23/lib/CodeGen/SimpleRegisterCoalescing.h254
-rw-r--r--release_23/lib/CodeGen/StrongPHIElimination.cpp920
-rw-r--r--release_23/lib/CodeGen/TargetInstrInfoImpl.cpp107
-rw-r--r--release_23/lib/CodeGen/TwoAddressInstructionPass.cpp361
-rw-r--r--release_23/lib/CodeGen/UnreachableBlockElim.cpp81
-rw-r--r--release_23/lib/CodeGen/VirtRegMap.cpp1655
-rw-r--r--release_23/lib/CodeGen/VirtRegMap.h448
-rw-r--r--release_23/lib/Debugger/Debugger.cpp229
-rw-r--r--release_23/lib/Debugger/Makefile16
-rw-r--r--release_23/lib/Debugger/ProgramInfo.cpp372
-rw-r--r--release_23/lib/Debugger/README.txt8
-rw-r--r--release_23/lib/Debugger/RuntimeInfo.cpp69
-rw-r--r--release_23/lib/Debugger/SourceFile.cpp82
-rw-r--r--release_23/lib/Debugger/SourceLanguage-CFamily.cpp28
-rw-r--r--release_23/lib/Debugger/SourceLanguage-CPlusPlus.cpp27
-rw-r--r--release_23/lib/Debugger/SourceLanguage-Unknown.cpp138
-rw-r--r--release_23/lib/Debugger/SourceLanguage.cpp54
-rw-r--r--release_23/lib/ExecutionEngine/ExecutionEngine.cpp980
-rw-r--r--release_23/lib/ExecutionEngine/ExecutionEngineBindings.cpp194
-rw-r--r--release_23/lib/ExecutionEngine/Interpreter/Execution.cpp1363
-rw-r--r--release_23/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp825
-rw-r--r--release_23/lib/ExecutionEngine/Interpreter/Interpreter.cpp99
-rw-r--r--release_23/lib/ExecutionEngine/Interpreter/Interpreter.h241
-rw-r--r--release_23/lib/ExecutionEngine/Interpreter/Makefile12
-rw-r--r--release_23/lib/ExecutionEngine/JIT/Intercept.cpp139
-rw-r--r--release_23/lib/ExecutionEngine/JIT/JIT.cpp416
-rw-r--r--release_23/lib/ExecutionEngine/JIT/JIT.h137
-rw-r--r--release_23/lib/ExecutionEngine/JIT/JITDwarfEmitter.cpp1082
-rw-r--r--release_23/lib/ExecutionEngine/JIT/JITDwarfEmitter.h87
-rw-r--r--release_23/lib/ExecutionEngine/JIT/JITEmitter.cpp988
-rw-r--r--release_23/lib/ExecutionEngine/JIT/JITMemoryManager.cpp475
-rw-r--r--release_23/lib/ExecutionEngine/JIT/Makefile37
-rw-r--r--release_23/lib/ExecutionEngine/JIT/TargetSelect.cpp80
-rw-r--r--release_23/lib/ExecutionEngine/Makefile13
-rw-r--r--release_23/lib/Linker/LinkArchives.cpp201
-rw-r--r--release_23/lib/Linker/LinkItems.cpp238
-rw-r--r--release_23/lib/Linker/LinkModules.cpp1224
-rw-r--r--release_23/lib/Linker/Linker.cpp178
-rw-r--r--release_23/lib/Linker/Makefile15
-rw-r--r--release_23/lib/Makefile15
-rw-r--r--release_23/lib/Support/APFloat.cpp2826
-rw-r--r--release_23/lib/Support/APInt.cpp2713
-rw-r--r--release_23/lib/Support/APSInt.cpp23
-rw-r--r--release_23/lib/Support/Allocator.cpp132
-rw-r--r--release_23/lib/Support/Annotation.cpp105
-rw-r--r--release_23/lib/Support/CommandLine.cpp1141
-rw-r--r--release_23/lib/Support/ConstantRange.cpp474
-rw-r--r--release_23/lib/Support/Debug.cpp77
-rw-r--r--release_23/lib/Support/Dwarf.cpp583
-rw-r--r--release_23/lib/Support/FileUtilities.cpp263
-rw-r--r--release_23/lib/Support/FoldingSet.cpp362
-rw-r--r--release_23/lib/Support/GraphWriter.cpp89
-rw-r--r--release_23/lib/Support/IsInf.cpp49
-rw-r--r--release_23/lib/Support/IsNAN.cpp33
-rw-r--r--release_23/lib/Support/Makefile17
-rw-r--r--release_23/lib/Support/ManagedStatic.cpp53
-rw-r--r--release_23/lib/Support/MemoryBuffer.cpp267
-rw-r--r--release_23/lib/Support/PluginLoader.cpp44
-rw-r--r--release_23/lib/Support/SlowOperationInformer.cpp66
-rw-r--r--release_23/lib/Support/SmallPtrSet.cpp223
-rw-r--r--release_23/lib/Support/Statistic.cpp122
-rw-r--r--release_23/lib/Support/Streams.cpp21
-rw-r--r--release_23/lib/Support/StringExtras.cpp111
-rw-r--r--release_23/lib/Support/StringMap.cpp234
-rw-r--r--release_23/lib/Support/StringPool.cpp35
-rw-r--r--release_23/lib/Support/SystemUtils.cpp58
-rw-r--r--release_23/lib/Support/Timer.cpp355
-rw-r--r--release_23/lib/System/Alarm.cpp33
-rw-r--r--release_23/lib/System/Disassembler.cpp75
-rw-r--r--release_23/lib/System/DynamicLibrary.cpp161
-rw-r--r--release_23/lib/System/IncludeFile.cpp20
-rw-r--r--release_23/lib/System/LICENSE.TXT6
-rw-r--r--release_23/lib/System/Makefile19
-rw-r--r--release_23/lib/System/Memory.cpp34
-rw-r--r--release_23/lib/System/Mutex.cpp160
-rw-r--r--release_23/lib/System/Path.cpp246
-rw-r--r--release_23/lib/System/Process.cpp33
-rw-r--r--release_23/lib/System/Program.cpp33
-rw-r--r--release_23/lib/System/README.txt43
-rw-r--r--release_23/lib/System/Signals.cpp34
-rw-r--r--release_23/lib/System/TimeValue.cpp58
-rw-r--r--release_23/lib/System/Unix/Alarm.inc68
-rw-r--r--release_23/lib/System/Unix/Memory.inc76
-rw-r--r--release_23/lib/System/Unix/Mutex.inc49
-rw-r--r--release_23/lib/System/Unix/Path.inc781
-rw-r--r--release_23/lib/System/Unix/Process.inc192
-rw-r--r--release_23/lib/System/Unix/Program.inc288
-rw-r--r--release_23/lib/System/Unix/README.txt16
-rw-r--r--release_23/lib/System/Unix/Signals.inc161
-rw-r--r--release_23/lib/System/Unix/TimeValue.inc56
-rw-r--r--release_23/lib/System/Unix/Unix.h101
-rw-r--r--release_23/lib/System/Win32/Alarm.inc36
-rw-r--r--release_23/lib/System/Win32/DynamicLibrary.inc180
-rw-r--r--release_23/lib/System/Win32/Memory.inc57
-rw-r--r--release_23/lib/System/Win32/Mutex.inc58
-rw-r--r--release_23/lib/System/Win32/Path.inc791
-rw-r--r--release_23/lib/System/Win32/Process.inc134
-rw-r--r--release_23/lib/System/Win32/Program.inc284
-rw-r--r--release_23/lib/System/Win32/Signals.inc294
-rw-r--r--release_23/lib/System/Win32/TimeValue.inc51
-rw-r--r--release_23/lib/System/Win32/Win32.h57
-rw-r--r--release_23/lib/Target/ARM/ARM.h108
-rw-r--r--release_23/lib/Target/ARM/ARM.td120
-rw-r--r--release_23/lib/Target/ARM/ARMAddressingModes.h394
-rw-r--r--release_23/lib/Target/ARM/ARMAsmPrinter.cpp1052
-rw-r--r--release_23/lib/Target/ARM/ARMCodeEmitter.cpp654
-rw-r--r--release_23/lib/Target/ARM/ARMConstantIslandPass.cpp1277
-rw-r--r--release_23/lib/Target/ARM/ARMConstantPoolValue.cpp90
-rw-r--r--release_23/lib/Target/ARM/ARMConstantPoolValue.h75
-rw-r--r--release_23/lib/Target/ARM/ARMFrameInfo.h32
-rw-r--r--release_23/lib/Target/ARM/ARMISelDAGToDAG.cpp861
-rw-r--r--release_23/lib/Target/ARM/ARMISelLowering.cpp1872
-rw-r--r--release_23/lib/Target/ARM/ARMISelLowering.h157
-rw-r--r--release_23/lib/Target/ARM/ARMInstrInfo.cpp939
-rw-r--r--release_23/lib/Target/ARM/ARMInstrInfo.h236
-rw-r--r--release_23/lib/Target/ARM/ARMInstrInfo.td1455
-rw-r--r--release_23/lib/Target/ARM/ARMInstrThumb.td599
-rw-r--r--release_23/lib/Target/ARM/ARMInstrVFP.td388
-rw-r--r--release_23/lib/Target/ARM/ARMJITInfo.cpp164
-rw-r--r--release_23/lib/Target/ARM/ARMJITInfo.h51
-rw-r--r--release_23/lib/Target/ARM/ARMLoadStoreOptimizer.cpp771
-rw-r--r--release_23/lib/Target/ARM/ARMMachineFunctionInfo.h220
-rw-r--r--release_23/lib/Target/ARM/ARMRegisterInfo.cpp1387
-rw-r--r--release_23/lib/Target/ARM/ARMRegisterInfo.h91
-rw-r--r--release_23/lib/Target/ARM/ARMRegisterInfo.td195
-rw-r--r--release_23/lib/Target/ARM/ARMRelocations.h30
-rw-r--r--release_23/lib/Target/ARM/ARMSubtarget.cpp57
-rw-r--r--release_23/lib/Target/ARM/ARMSubtarget.h101
-rw-r--r--release_23/lib/Target/ARM/ARMTargetAsmInfo.cpp286
-rw-r--r--release_23/lib/Target/ARM/ARMTargetAsmInfo.h38
-rw-r--r--release_23/lib/Target/ARM/ARMTargetMachine.cpp164
-rw-r--r--release_23/lib/Target/ARM/ARMTargetMachine.h80
-rw-r--r--release_23/lib/Target/ARM/Makefile20
-rw-r--r--release_23/lib/Target/ARM/README-Thumb.txt227
-rw-r--r--release_23/lib/Target/ARM/README.txt554
-rw-r--r--release_23/lib/Target/Alpha/Alpha.h48
-rw-r--r--release_23/lib/Target/Alpha/Alpha.td66
-rw-r--r--release_23/lib/Target/Alpha/AlphaAsmPrinter.cpp295
-rw-r--r--release_23/lib/Target/Alpha/AlphaBranchSelector.cpp67
-rw-r--r--release_23/lib/Target/Alpha/AlphaCodeEmitter.cpp219
-rw-r--r--release_23/lib/Target/Alpha/AlphaISelDAGToDAG.cpp564
-rw-r--r--release_23/lib/Target/Alpha/AlphaISelLowering.cpp724
-rw-r--r--release_23/lib/Target/Alpha/AlphaISelLowering.h100
-rw-r--r--release_23/lib/Target/Alpha/AlphaInstrFormats.td268
-rw-r--r--release_23/lib/Target/Alpha/AlphaInstrInfo.cpp424
-rw-r--r--release_23/lib/Target/Alpha/AlphaInstrInfo.h94
-rw-r--r--release_23/lib/Target/Alpha/AlphaInstrInfo.td1127
-rw-r--r--release_23/lib/Target/Alpha/AlphaJITInfo.cpp307
-rw-r--r--release_23/lib/Target/Alpha/AlphaJITInfo.h50
-rw-r--r--release_23/lib/Target/Alpha/AlphaLLRP.cpp157
-rw-r--r--release_23/lib/Target/Alpha/AlphaRegisterInfo.cpp330
-rw-r--r--release_23/lib/Target/Alpha/AlphaRegisterInfo.h67
-rw-r--r--release_23/lib/Target/Alpha/AlphaRegisterInfo.td171
-rw-r--r--release_23/lib/Target/Alpha/AlphaRelocations.h31
-rw-r--r--release_23/lib/Target/Alpha/AlphaSchedule.td84
-rw-r--r--release_23/lib/Target/Alpha/AlphaSubtarget.cpp25
-rw-r--r--release_23/lib/Target/Alpha/AlphaSubtarget.h46
-rw-r--r--release_23/lib/Target/Alpha/AlphaTargetAsmInfo.cpp24
-rw-r--r--release_23/lib/Target/Alpha/AlphaTargetAsmInfo.h30
-rw-r--r--release_23/lib/Target/Alpha/AlphaTargetMachine.cpp99
-rw-r--r--release_23/lib/Target/Alpha/AlphaTargetMachine.h73
-rw-r--r--release_23/lib/Target/Alpha/Makefile20
-rw-r--r--release_23/lib/Target/Alpha/README.txt42
-rw-r--r--release_23/lib/Target/CBackend/CBackend.cpp3307
-rw-r--r--release_23/lib/Target/CBackend/CTargetMachine.h41
-rw-r--r--release_23/lib/Target/CBackend/Makefile14
-rw-r--r--release_23/lib/Target/CellSPU/CellSDKIntrinsics.td448
-rw-r--r--release_23/lib/Target/CellSPU/Makefile20
-rw-r--r--release_23/lib/Target/CellSPU/README.txt50
-rw-r--r--release_23/lib/Target/CellSPU/SPU.h89
-rw-r--r--release_23/lib/Target/CellSPU/SPU.td59
-rw-r--r--release_23/lib/Target/CellSPU/SPUAsmPrinter.cpp655
-rw-r--r--release_23/lib/Target/CellSPU/SPUCallingConv.td59
-rw-r--r--release_23/lib/Target/CellSPU/SPUFrameInfo.cpp29
-rw-r--r--release_23/lib/Target/CellSPU/SPUFrameInfo.h79
-rw-r--r--release_23/lib/Target/CellSPU/SPUHazardRecognizers.cpp135
-rw-r--r--release_23/lib/Target/CellSPU/SPUHazardRecognizers.h41
-rw-r--r--release_23/lib/Target/CellSPU/SPUISelDAGToDAG.cpp705
-rw-r--r--release_23/lib/Target/CellSPU/SPUISelLowering.cpp2930
-rw-r--r--release_23/lib/Target/CellSPU/SPUISelLowering.h139
-rw-r--r--release_23/lib/Target/CellSPU/SPUInstrBuilder.h55
-rw-r--r--release_23/lib/Target/CellSPU/SPUInstrFormats.td296
-rw-r--r--release_23/lib/Target/CellSPU/SPUInstrInfo.cpp434
-rw-r--r--release_23/lib/Target/CellSPU/SPUInstrInfo.h95
-rw-r--r--release_23/lib/Target/CellSPU/SPUInstrInfo.td3912
-rw-r--r--release_23/lib/Target/CellSPU/SPUMachineFunction.h43
-rw-r--r--release_23/lib/Target/CellSPU/SPUNodes.td197
-rw-r--r--release_23/lib/Target/CellSPU/SPUOperands.td644
-rw-r--r--release_23/lib/Target/CellSPU/SPURegisterInfo.cpp606
-rw-r--r--release_23/lib/Target/CellSPU/SPURegisterInfo.h97
-rw-r--r--release_23/lib/Target/CellSPU/SPURegisterInfo.td427
-rw-r--r--release_23/lib/Target/CellSPU/SPURegisterNames.h18
-rw-r--r--release_23/lib/Target/CellSPU/SPUSchedule.td57
-rw-r--r--release_23/lib/Target/CellSPU/SPUSubtarget.cpp40
-rw-r--r--release_23/lib/Target/CellSPU/SPUSubtarget.h94
-rw-r--r--release_23/lib/Target/CellSPU/SPUTargetAsmInfo.cpp52
-rw-r--r--release_23/lib/Target/CellSPU/SPUTargetAsmInfo.h30
-rw-r--r--release_23/lib/Target/CellSPU/SPUTargetMachine.cpp85
-rw-r--r--release_23/lib/Target/CellSPU/SPUTargetMachine.h93
-rw-r--r--release_23/lib/Target/CppBackend/CPPBackend.cpp1953
-rw-r--r--release_23/lib/Target/CppBackend/CPPTargetMachine.h41
-rw-r--r--release_23/lib/Target/CppBackend/Makefile14
-rw-r--r--release_23/lib/Target/IA64/IA64.h54
-rw-r--r--release_23/lib/Target/IA64/IA64.td39
-rw-r--r--release_23/lib/Target/IA64/IA64AsmPrinter.cpp358
-rw-r--r--release_23/lib/Target/IA64/IA64Bundling.cpp118
-rw-r--r--release_23/lib/Target/IA64/IA64ISelDAGToDAG.cpp589
-rw-r--r--release_23/lib/Target/IA64/IA64ISelLowering.cpp609
-rw-r--r--release_23/lib/Target/IA64/IA64ISelLowering.h74
-rw-r--r--release_23/lib/Target/IA64/IA64InstrBuilder.h52
-rw-r--r--release_23/lib/Target/IA64/IA64InstrFormats.td80
-rw-r--r--release_23/lib/Target/IA64/IA64InstrInfo.cpp184
-rw-r--r--release_23/lib/Target/IA64/IA64InstrInfo.h72
-rw-r--r--release_23/lib/Target/IA64/IA64InstrInfo.td751
-rw-r--r--release_23/lib/Target/IA64/IA64MachineFunctionInfo.h34
-rw-r--r--release_23/lib/Target/IA64/IA64RegisterInfo.cpp328
-rw-r--r--release_23/lib/Target/IA64/IA64RegisterInfo.h63
-rw-r--r--release_23/lib/Target/IA64/IA64RegisterInfo.td509
-rw-r--r--release_23/lib/Target/IA64/IA64TargetAsmInfo.cpp34
-rw-r--r--release_23/lib/Target/IA64/IA64TargetAsmInfo.h31
-rw-r--r--release_23/lib/Target/IA64/IA64TargetMachine.cpp91
-rw-r--r--release_23/lib/Target/IA64/IA64TargetMachine.h60
-rw-r--r--release_23/lib/Target/IA64/Makefile18
-rw-r--r--release_23/lib/Target/IA64/README48
-rw-r--r--release_23/lib/Target/MSIL/MSILWriter.cpp1665
-rw-r--r--release_23/lib/Target/MSIL/MSILWriter.h255
-rw-r--r--release_23/lib/Target/MSIL/Makefile14
-rw-r--r--release_23/lib/Target/MSIL/README.TXT26
-rw-r--r--release_23/lib/Target/Makefile20
-rw-r--r--release_23/lib/Target/Mips/Makefile21
-rw-r--r--release_23/lib/Target/Mips/Mips.h38
-rw-r--r--release_23/lib/Target/Mips/Mips.td51
-rw-r--r--release_23/lib/Target/Mips/MipsAsmPrinter.cpp549
-rw-r--r--release_23/lib/Target/Mips/MipsCallingConv.td39
-rw-r--r--release_23/lib/Target/Mips/MipsDelaySlotFiller.cpp77
-rw-r--r--release_23/lib/Target/Mips/MipsISelDAGToDAG.cpp347
-rw-r--r--release_23/lib/Target/Mips/MipsISelLowering.cpp694
-rw-r--r--release_23/lib/Target/Mips/MipsISelLowering.h97
-rw-r--r--release_23/lib/Target/Mips/MipsInstrFormats.td104
-rw-r--r--release_23/lib/Target/Mips/MipsInstrInfo.cpp456
-rw-r--r--release_23/lib/Target/Mips/MipsInstrInfo.h131
-rw-r--r--release_23/lib/Target/Mips/MipsInstrInfo.td612
-rw-r--r--release_23/lib/Target/Mips/MipsMachineFunction.h116
-rw-r--r--release_23/lib/Target/Mips/MipsRegisterInfo.cpp426
-rw-r--r--release_23/lib/Target/Mips/MipsRegisterInfo.h70
-rw-r--r--release_23/lib/Target/Mips/MipsRegisterInfo.td80
-rw-r--r--release_23/lib/Target/Mips/MipsSchedule.td63
-rw-r--r--release_23/lib/Target/Mips/MipsSubtarget.cpp27
-rw-r--r--release_23/lib/Target/Mips/MipsSubtarget.h49
-rw-r--r--release_23/lib/Target/Mips/MipsTargetAsmInfo.cpp37
-rw-r--r--release_23/lib/Target/Mips/MipsTargetAsmInfo.h30
-rw-r--r--release_23/lib/Target/Mips/MipsTargetMachine.cpp93
-rw-r--r--release_23/lib/Target/Mips/MipsTargetMachine.h65
-rw-r--r--release_23/lib/Target/PowerPC/Makefile20
-rw-r--r--release_23/lib/Target/PowerPC/PPC.h46
-rw-r--r--release_23/lib/Target/PowerPC/PPC.td114
-rw-r--r--release_23/lib/Target/PowerPC/PPCAsmPrinter.cpp1143
-rw-r--r--release_23/lib/Target/PowerPC/PPCBranchSelector.cpp173
-rw-r--r--release_23/lib/Target/PowerPC/PPCCallingConv.td66
-rw-r--r--release_23/lib/Target/PowerPC/PPCCodeEmitter.cpp245
-rw-r--r--release_23/lib/Target/PowerPC/PPCFrameInfo.h93
-rw-r--r--release_23/lib/Target/PowerPC/PPCHazardRecognizers.cpp305
-rw-r--r--release_23/lib/Target/PowerPC/PPCHazardRecognizers.h73
-rw-r--r--release_23/lib/Target/PowerPC/PPCISelDAGToDAG.cpp1142
-rw-r--r--release_23/lib/Target/PowerPC/PPCISelLowering.cpp4540
-rw-r--r--release_23/lib/Target/PowerPC/PPCISelLowering.h387
-rw-r--r--release_23/lib/Target/PowerPC/PPCInstr64Bit.td673
-rw-r--r--release_23/lib/Target/PowerPC/PPCInstrAltivec.td653
-rw-r--r--release_23/lib/Target/PowerPC/PPCInstrBuilder.h55
-rw-r--r--release_23/lib/Target/PowerPC/PPCInstrFormats.td853
-rw-r--r--release_23/lib/Target/PowerPC/PPCInstrInfo.cpp745
-rw-r--r--release_23/lib/Target/PowerPC/PPCInstrInfo.h167
-rw-r--r--release_23/lib/Target/PowerPC/PPCInstrInfo.td1335
-rw-r--r--release_23/lib/Target/PowerPC/PPCJITInfo.cpp448
-rw-r--r--release_23/lib/Target/PowerPC/PPCJITInfo.h47
-rw-r--r--release_23/lib/Target/PowerPC/PPCMachOWriterInfo.cpp150
-rw-r--r--release_23/lib/Target/PowerPC/PPCMachOWriterInfo.h55
-rw-r--r--release_23/lib/Target/PowerPC/PPCMachineFunctionInfo.h102
-rw-r--r--release_23/lib/Target/PowerPC/PPCPerfectShuffle.h6586
-rw-r--r--release_23/lib/Target/PowerPC/PPCPredicates.cpp30
-rw-r--r--release_23/lib/Target/PowerPC/PPCPredicates.h39
-rw-r--r--release_23/lib/Target/PowerPC/PPCRegisterInfo.cpp1430
-rw-r--r--release_23/lib/Target/PowerPC/PPCRegisterInfo.h91
-rw-r--r--release_23/lib/Target/PowerPC/PPCRegisterInfo.td351
-rw-r--r--release_23/lib/Target/PowerPC/PPCRelocations.h56
-rw-r--r--release_23/lib/Target/PowerPC/PPCSchedule.td508
-rw-r--r--release_23/lib/Target/PowerPC/PPCScheduleG3.td63
-rw-r--r--release_23/lib/Target/PowerPC/PPCScheduleG4.td73
-rw-r--r--release_23/lib/Target/PowerPC/PPCScheduleG4Plus.td76
-rw-r--r--release_23/lib/Target/PowerPC/PPCScheduleG5.td83
-rw-r--r--release_23/lib/Target/PowerPC/PPCSubtarget.cpp147
-rw-r--r--release_23/lib/Target/PowerPC/PPCSubtarget.h153
-rw-r--r--release_23/lib/Target/PowerPC/PPCTargetAsmInfo.cpp161
-rw-r--r--release_23/lib/Target/PowerPC/PPCTargetAsmInfo.h42
-rw-r--r--release_23/lib/Target/PowerPC/PPCTargetMachine.cpp171
-rw-r--r--release_23/lib/Target/PowerPC/PPCTargetMachine.h101
-rw-r--r--release_23/lib/Target/PowerPC/README.txt755
-rw-r--r--release_23/lib/Target/PowerPC/README_ALTIVEC.txt211
-rw-r--r--release_23/lib/Target/README.txt808
-rw-r--r--release_23/lib/Target/Sparc/DelaySlotFiller.cpp76
-rw-r--r--release_23/lib/Target/Sparc/FPMover.cpp138
-rw-r--r--release_23/lib/Target/Sparc/Makefile20
-rw-r--r--release_23/lib/Target/Sparc/README.txt58
-rw-r--r--release_23/lib/Target/Sparc/Sparc.h116
-rw-r--r--release_23/lib/Target/Sparc/Sparc.td76
-rw-r--r--release_23/lib/Target/Sparc/SparcAsmPrinter.cpp290
-rw-r--r--release_23/lib/Target/Sparc/SparcCallingConv.td32
-rw-r--r--release_23/lib/Target/Sparc/SparcISelDAGToDAG.cpp198
-rw-r--r--release_23/lib/Target/Sparc/SparcISelLowering.cpp954
-rw-r--r--release_23/lib/Target/Sparc/SparcISelLowering.h69
-rw-r--r--release_23/lib/Target/Sparc/SparcInstrFormats.td114
-rw-r--r--release_23/lib/Target/Sparc/SparcInstrInfo.cpp262
-rw-r--r--release_23/lib/Target/Sparc/SparcInstrInfo.h112
-rw-r--r--release_23/lib/Target/Sparc/SparcInstrInfo.td765
-rw-r--r--release_23/lib/Target/Sparc/SparcRegisterInfo.cpp190
-rw-r--r--release_23/lib/Target/Sparc/SparcRegisterInfo.h67
-rw-r--r--release_23/lib/Target/Sparc/SparcRegisterInfo.td158
-rw-r--r--release_23/lib/Target/Sparc/SparcSubtarget.cpp43
-rw-r--r--release_23/lib/Target/Sparc/SparcSubtarget.h42
-rw-r--r--release_23/lib/Target/Sparc/SparcTargetAsmInfo.cpp25
-rw-r--r--release_23/lib/Target/Sparc/SparcTargetAsmInfo.h31
-rw-r--r--release_23/lib/Target/Sparc/SparcTargetMachine.cpp83
-rw-r--r--release_23/lib/Target/Sparc/SparcTargetMachine.h57
-rw-r--r--release_23/lib/Target/SubtargetFeature.cpp357
-rw-r--r--release_23/lib/Target/Target.cpp94
-rw-r--r--release_23/lib/Target/Target.td481
-rw-r--r--release_23/lib/Target/TargetAsmInfo.cpp143
-rw-r--r--release_23/lib/Target/TargetCallingConv.td103
-rw-r--r--release_23/lib/Target/TargetData.cpp606
-rw-r--r--release_23/lib/Target/TargetFrameInfo.cpp19
-rw-r--r--release_23/lib/Target/TargetInstrInfo.cpp50
-rw-r--r--release_23/lib/Target/TargetMachOWriterInfo.cpp25
-rw-r--r--release_23/lib/Target/TargetMachine.cpp197
-rw-r--r--release_23/lib/Target/TargetMachineRegistry.cpp85
-rw-r--r--release_23/lib/Target/TargetRegisterInfo.cpp114
-rw-r--r--release_23/lib/Target/TargetSchedule.td72
-rw-r--r--release_23/lib/Target/TargetSelectionDAG.td936
-rw-r--r--release_23/lib/Target/TargetSubtarget.cpp22
-rw-r--r--release_23/lib/Target/X86/Makefile20
-rw-r--r--release_23/lib/Target/X86/README-FPStack.txt85
-rw-r--r--release_23/lib/Target/X86/README-MMX.txt43
-rw-r--r--release_23/lib/Target/X86/README-SSE.txt837
-rw-r--r--release_23/lib/Target/X86/README-X86-64.txt259
-rw-r--r--release_23/lib/Target/X86/README.txt1711
-rw-r--r--release_23/lib/Target/X86/X86.h70
-rw-r--r--release_23/lib/Target/X86/X86.td159
-rw-r--r--release_23/lib/Target/X86/X86ATTAsmPrinter.cpp648
-rw-r--r--release_23/lib/Target/X86/X86ATTAsmPrinter.h102
-rw-r--r--release_23/lib/Target/X86/X86AsmPrinter.cpp447
-rw-r--r--release_23/lib/Target/X86/X86AsmPrinter.h98
-rw-r--r--release_23/lib/Target/X86/X86COFF.h95
-rw-r--r--release_23/lib/Target/X86/X86CallingConv.td340
-rw-r--r--release_23/lib/Target/X86/X86CodeEmitter.cpp688
-rw-r--r--release_23/lib/Target/X86/X86CompilationCallback_Win64.asm67
-rw-r--r--release_23/lib/Target/X86/X86ELFWriterInfo.cpp18
-rw-r--r--release_23/lib/Target/X86/X86ELFWriterInfo.h29
-rw-r--r--release_23/lib/Target/X86/X86FloatingPoint.cpp1126
-rw-r--r--release_23/lib/Target/X86/X86ISelDAGToDAG.cpp1643
-rw-r--r--release_23/lib/Target/X86/X86ISelLowering.cpp6873
-rw-r--r--release_23/lib/Target/X86/X86ISelLowering.h569
-rw-r--r--release_23/lib/Target/X86/X86Instr64bit.td1354
-rw-r--r--release_23/lib/Target/X86/X86InstrBuilder.h125
-rw-r--r--release_23/lib/Target/X86/X86InstrFPStack.td591
-rw-r--r--release_23/lib/Target/X86/X86InstrFormats.td269
-rw-r--r--release_23/lib/Target/X86/X86InstrInfo.cpp2828
-rw-r--r--release_23/lib/Target/X86/X86InstrInfo.h407
-rw-r--r--release_23/lib/Target/X86/X86InstrInfo.td2828
-rw-r--r--release_23/lib/Target/X86/X86InstrMMX.td645
-rw-r--r--release_23/lib/Target/X86/X86InstrSSE.td3457
-rw-r--r--release_23/lib/Target/X86/X86IntelAsmPrinter.cpp512
-rw-r--r--release_23/lib/Target/X86/X86IntelAsmPrinter.h123
-rw-r--r--release_23/lib/Target/X86/X86JITInfo.cpp495
-rw-r--r--release_23/lib/Target/X86/X86JITInfo.h67
-rw-r--r--release_23/lib/Target/X86/X86MachineFunctionInfo.h101
-rw-r--r--release_23/lib/Target/X86/X86RegisterInfo.cpp1151
-rw-r--r--release_23/lib/Target/X86/X86RegisterInfo.h157
-rw-r--r--release_23/lib/Target/X86/X86RegisterInfo.td537
-rw-r--r--release_23/lib/Target/X86/X86Relocations.h39
-rw-r--r--release_23/lib/Target/X86/X86Subtarget.cpp331
-rw-r--r--release_23/lib/Target/X86/X86Subtarget.h199
-rw-r--r--release_23/lib/Target/X86/X86TargetAsmInfo.cpp376
-rw-r--r--release_23/lib/Target/X86/X86TargetAsmInfo.h37
-rw-r--r--release_23/lib/Target/X86/X86TargetMachine.cpp207
-rw-r--r--release_23/lib/Target/X86/X86TargetMachine.h97
-rw-r--r--release_23/lib/Transforms/Hello/Hello.cpp64
-rw-r--r--release_23/lib/Transforms/Hello/Makefile16
-rw-r--r--release_23/lib/Transforms/IPO/ArgumentPromotion.cpp710
-rw-r--r--release_23/lib/Transforms/IPO/ConstantMerge.cpp113
-rw-r--r--release_23/lib/Transforms/IPO/DeadArgumentElimination.cpp773
-rw-r--r--release_23/lib/Transforms/IPO/DeadTypeElimination.cpp106
-rw-r--r--release_23/lib/Transforms/IPO/ExtractGV.cpp175
-rw-r--r--release_23/lib/Transforms/IPO/GlobalDCE.cpp203
-rw-r--r--release_23/lib/Transforms/IPO/GlobalOpt.cpp2234
-rw-r--r--release_23/lib/Transforms/IPO/IPConstantPropagation.cpp237
-rw-r--r--release_23/lib/Transforms/IPO/IndMemRemoval.cpp89
-rw-r--r--release_23/lib/Transforms/IPO/InlineSimple.cpp96
-rw-r--r--release_23/lib/Transforms/IPO/Inliner.cpp222
-rw-r--r--release_23/lib/Transforms/IPO/Internalize.cpp156
-rw-r--r--release_23/lib/Transforms/IPO/LoopExtractor.cpp259
-rw-r--r--release_23/lib/Transforms/IPO/LowerSetJmp.cpp541
-rw-r--r--release_23/lib/Transforms/IPO/Makefile15
-rw-r--r--release_23/lib/Transforms/IPO/PruneEH.cpp236
-rw-r--r--release_23/lib/Transforms/IPO/RaiseAllocations.cpp252
-rw-r--r--release_23/lib/Transforms/IPO/StripDeadPrototypes.cpp72
-rw-r--r--release_23/lib/Transforms/IPO/StripSymbols.cpp225
-rw-r--r--release_23/lib/Transforms/IPO/StructRetPromotion.cpp346
-rw-r--r--release_23/lib/Transforms/Instrumentation/BlockProfiling.cpp126
-rw-r--r--release_23/lib/Transforms/Instrumentation/EdgeProfiling.cpp101
-rw-r--r--release_23/lib/Transforms/Instrumentation/Makefile15
-rw-r--r--release_23/lib/Transforms/Instrumentation/ProfilingUtils.cpp120
-rw-r--r--release_23/lib/Transforms/Instrumentation/ProfilingUtils.h31
-rw-r--r--release_23/lib/Transforms/Instrumentation/RSProfiling.cpp652
-rw-r--r--release_23/lib/Transforms/Instrumentation/RSProfiling.h31
-rw-r--r--release_23/lib/Transforms/Makefile14
-rw-r--r--release_23/lib/Transforms/Scalar/ADCE.cpp470
-rw-r--r--release_23/lib/Transforms/Scalar/BasicBlockPlacement.cpp148
-rw-r--r--release_23/lib/Transforms/Scalar/CodeGenPrepare.cpp1135
-rw-r--r--release_23/lib/Transforms/Scalar/CondPropagate.cpp221
-rw-r--r--release_23/lib/Transforms/Scalar/ConstantProp.cpp90
-rw-r--r--release_23/lib/Transforms/Scalar/DCE.cpp129
-rw-r--r--release_23/lib/Transforms/Scalar/DeadStoreElimination.cpp559
-rw-r--r--release_23/lib/Transforms/Scalar/GCSE.cpp201
-rw-r--r--release_23/lib/Transforms/Scalar/GVN.cpp1121
-rw-r--r--release_23/lib/Transforms/Scalar/GVNPRE.cpp1874
-rw-r--r--release_23/lib/Transforms/Scalar/IndVarSimplify.cpp607
-rw-r--r--release_23/lib/Transforms/Scalar/InstructionCombining.cpp11520
-rw-r--r--release_23/lib/Transforms/Scalar/JumpThreading.cpp514
-rw-r--r--release_23/lib/Transforms/Scalar/LICM.cpp876
-rw-r--r--release_23/lib/Transforms/Scalar/LoopDeletion.cpp280
-rw-r--r--release_23/lib/Transforms/Scalar/LoopIndexSplit.cpp1692
-rw-r--r--release_23/lib/Transforms/Scalar/LoopRotation.cpp605
-rw-r--r--release_23/lib/Transforms/Scalar/LoopStrengthReduce.cpp1822
-rw-r--r--release_23/lib/Transforms/Scalar/LoopUnroll.cpp508
-rw-r--r--release_23/lib/Transforms/Scalar/LoopUnswitch.cpp1308
-rw-r--r--release_23/lib/Transforms/Scalar/Makefile15
-rw-r--r--release_23/lib/Transforms/Scalar/MemCpyOptimizer.cpp728
-rw-r--r--release_23/lib/Transforms/Scalar/PredicateSimplifier.cpp2657
-rw-r--r--release_23/lib/Transforms/Scalar/Reassociate.cpp883
-rw-r--r--release_23/lib/Transforms/Scalar/Reg2Mem.cpp124
-rw-r--r--release_23/lib/Transforms/Scalar/SCCP.cpp1799
-rw-r--r--release_23/lib/Transforms/Scalar/Scalar.cpp47
-rw-r--r--release_23/lib/Transforms/Scalar/ScalarReplAggregates.cpp1413
-rw-r--r--release_23/lib/Transforms/Scalar/SimplifyCFG.cpp230
-rw-r--r--release_23/lib/Transforms/Scalar/SimplifyLibCalls.cpp1498
-rw-r--r--release_23/lib/Transforms/Scalar/TailDuplication.cpp340
-rw-r--r--release_23/lib/Transforms/Scalar/TailRecursionElimination.cpp475
-rw-r--r--release_23/lib/Transforms/Utils/BasicBlockUtils.cpp285
-rw-r--r--release_23/lib/Transforms/Utils/BasicInliner.cpp170
-rw-r--r--release_23/lib/Transforms/Utils/BreakCriticalEdges.cpp279
-rw-r--r--release_23/lib/Transforms/Utils/CloneFunction.cpp505
-rw-r--r--release_23/lib/Transforms/Utils/CloneLoop.cpp153
-rw-r--r--release_23/lib/Transforms/Utils/CloneModule.cpp125
-rw-r--r--release_23/lib/Transforms/Utils/CloneTrace.cpp119
-rw-r--r--release_23/lib/Transforms/Utils/CodeExtractor.cpp742
-rw-r--r--release_23/lib/Transforms/Utils/DemoteRegToStack.cpp148
-rw-r--r--release_23/lib/Transforms/Utils/InlineCost.cpp271
-rw-r--r--release_23/lib/Transforms/Utils/InlineFunction.cpp613
-rw-r--r--release_23/lib/Transforms/Utils/LCSSA.cpp294
-rw-r--r--release_23/lib/Transforms/Utils/Local.cpp202
-rw-r--r--release_23/lib/Transforms/Utils/LoopSimplify.cpp597
-rw-r--r--release_23/lib/Transforms/Utils/LowerAllocations.cpp176
-rw-r--r--release_23/lib/Transforms/Utils/LowerInvoke.cpp615
-rw-r--r--release_23/lib/Transforms/Utils/LowerSwitch.cpp324
-rw-r--r--release_23/lib/Transforms/Utils/Makefile15
-rw-r--r--release_23/lib/Transforms/Utils/Mem2Reg.cpp92
-rw-r--r--release_23/lib/Transforms/Utils/PromoteMemoryToRegister.cpp1003
-rw-r--r--release_23/lib/Transforms/Utils/SimplifyCFG.cpp1950
-rw-r--r--release_23/lib/Transforms/Utils/UnifyFunctionExitNodes.cpp162
-rw-r--r--release_23/lib/Transforms/Utils/ValueMapper.cpp118
-rw-r--r--release_23/lib/VMCore/AsmWriter.cpp1673
-rw-r--r--release_23/lib/VMCore/AutoUpgrade.cpp316
-rw-r--r--release_23/lib/VMCore/BasicBlock.cpp293
-rw-r--r--release_23/lib/VMCore/ConstantFold.cpp1517
-rw-r--r--release_23/lib/VMCore/ConstantFold.h53
-rw-r--r--release_23/lib/VMCore/Constants.cpp2350
-rw-r--r--release_23/lib/VMCore/Core.cpp1367
-rw-r--r--release_23/lib/VMCore/Dominators.cpp288
-rw-r--r--release_23/lib/VMCore/Function.cpp360
-rw-r--r--release_23/lib/VMCore/Globals.cpp248
-rw-r--r--release_23/lib/VMCore/InlineAsm.cpp226
-rw-r--r--release_23/lib/VMCore/Instruction.cpp314
-rw-r--r--release_23/lib/VMCore/Instructions.cpp2764
-rw-r--r--release_23/lib/VMCore/IntrinsicInst.cpp76
-rw-r--r--release_23/lib/VMCore/LeakDetector.cpp131
-rw-r--r--release_23/lib/VMCore/Makefile33
-rw-r--r--release_23/lib/VMCore/Mangler.cpp213
-rw-r--r--release_23/lib/VMCore/Module.cpp322
-rw-r--r--release_23/lib/VMCore/ModuleProvider.cpp26
-rw-r--r--release_23/lib/VMCore/ParameterAttributes.cpp294
-rw-r--r--release_23/lib/VMCore/Pass.cpp326
-rw-r--r--release_23/lib/VMCore/PassManager.cpp1570
-rw-r--r--release_23/lib/VMCore/SymbolTableListTraitsImpl.h118
-rw-r--r--release_23/lib/VMCore/Type.cpp1540
-rw-r--r--release_23/lib/VMCore/TypeSymbolTable.cpp163
-rw-r--r--release_23/lib/VMCore/Value.cpp357
-rw-r--r--release_23/lib/VMCore/ValueSymbolTable.cpp142
-rw-r--r--release_23/lib/VMCore/ValueTypes.cpp125
-rw-r--r--release_23/lib/VMCore/Verifier.cpp1500
-rw-r--r--release_23/llvm.spec.in67
-rw-r--r--release_23/projects/Makefile20
-rw-r--r--release_23/projects/sample/Makefile18
-rw-r--r--release_23/projects/sample/Makefile.common.in22
-rwxr-xr-xrelease_23/projects/sample/autoconf/AutoRegen.sh52
-rw-r--r--release_23/projects/sample/autoconf/LICENSE.TXT24
-rwxr-xr-xrelease_23/projects/sample/autoconf/config.guess1388
-rwxr-xr-xrelease_23/projects/sample/autoconf/config.sub1489
-rw-r--r--release_23/projects/sample/autoconf/configure.ac68
-rwxr-xr-xrelease_23/projects/sample/configure2364
-rw-r--r--release_23/projects/sample/include/sample.h8
-rw-r--r--release_23/projects/sample/lib/Makefile13
-rw-r--r--release_23/projects/sample/lib/sample/Makefile18
-rw-r--r--release_23/projects/sample/lib/sample/sample.c25
-rw-r--r--release_23/projects/sample/tools/Makefile13
-rw-r--r--release_23/projects/sample/tools/sample/Makefile23
-rw-r--r--release_23/projects/sample/tools/sample/main.c14
-rw-r--r--release_23/runtime/GC/GCInterface.h48
-rw-r--r--release_23/runtime/GC/Makefile19
-rw-r--r--release_23/runtime/GC/SemiSpace/Makefile19
-rw-r--r--release_23/runtime/GC/SemiSpace/README.txt5
-rw-r--r--release_23/runtime/GC/SemiSpace/semispace.c127
-rw-r--r--release_23/runtime/GC/gc_exported_symbols.lst7
-rw-r--r--release_23/runtime/Makefile35
-rw-r--r--release_23/runtime/README.txt4
-rw-r--r--release_23/runtime/libprofile/BasicBlockTracing.c67
-rw-r--r--release_23/runtime/libprofile/BlockProfiling.c45
-rw-r--r--release_23/runtime/libprofile/CommonProfiling.c117
-rw-r--r--release_23/runtime/libprofile/EdgeProfiling.c45
-rw-r--r--release_23/runtime/libprofile/FunctionProfiling.c42
-rw-r--r--release_23/runtime/libprofile/Makefile19
-rw-r--r--release_23/runtime/libprofile/Profiling.h31
-rw-r--r--release_23/runtime/libprofile/exported_symbols.lst5
-rw-r--r--release_23/test/Analysis/Andersens/2007-11-19-InlineAsm.ll8
-rw-r--r--release_23/test/Analysis/Andersens/2008-03-19-External.ll12
-rw-r--r--release_23/test/Analysis/Andersens/2008-04-07-Memcpy.ll14
-rw-r--r--release_23/test/Analysis/Andersens/arg-must-alias.ll15
-rw-r--r--release_23/test/Analysis/Andersens/basictest.ll28
-rw-r--r--release_23/test/Analysis/Andersens/dg.exp4
-rw-r--r--release_23/test/Analysis/Andersens/external.ll20
-rw-r--r--release_23/test/Analysis/Andersens/modreftest.ll15
-rw-r--r--release_23/test/Analysis/Andersens/modreftest2.ll14
-rw-r--r--release_23/test/Analysis/Andersens/trivialtest.ll3
-rw-r--r--release_23/test/Analysis/BasicAA/2003-02-26-AccessSizeTest.ll18
-rw-r--r--release_23/test/Analysis/BasicAA/2003-03-04-GEPCrash.ll7
-rw-r--r--release_23/test/Analysis/BasicAA/2003-04-22-GEPProblem.ll15
-rw-r--r--release_23/test/Analysis/BasicAA/2003-04-25-GEPCrash.ll7
-rw-r--r--release_23/test/Analysis/BasicAA/2003-05-21-GEP-Problem.ll21
-rw-r--r--release_23/test/Analysis/BasicAA/2003-06-01-AliasCrash.ll11
-rw-r--r--release_23/test/Analysis/BasicAA/2003-07-03-BasicAACrash.ll10
-rw-r--r--release_23/test/Analysis/BasicAA/2003-09-19-LocalArgument.ll12
-rw-r--r--release_23/test/Analysis/BasicAA/2003-11-04-SimpleCases.ll16
-rw-r--r--release_23/test/Analysis/BasicAA/2003-12-11-ConstExprGEP.ll18
-rw-r--r--release_23/test/Analysis/BasicAA/2004-01-29-InvariantMemory.ll13
-rw-r--r--release_23/test/Analysis/BasicAA/2004-07-28-MustAliasbug.ll10
-rw-r--r--release_23/test/Analysis/BasicAA/2004-12-08-BasicAACrash.ll22
-rw-r--r--release_23/test/Analysis/BasicAA/2004-12-08-BasicAACrash2.ll20
-rw-r--r--release_23/test/Analysis/BasicAA/2005-03-09-BrokenBasicAA.ll15
-rw-r--r--release_23/test/Analysis/BasicAA/2006-03-03-BadArraySubscript.ll30
-rw-r--r--release_23/test/Analysis/BasicAA/2006-11-03-BasicAAVectorCrash.ll48
-rw-r--r--release_23/test/Analysis/BasicAA/2007-01-13-BasePointerBadNoAlias.ll35
-rw-r--r--release_23/test/Analysis/BasicAA/2007-08-01-NoAliasAndCalls.ll10
-rw-r--r--release_23/test/Analysis/BasicAA/2007-08-01-NoAliasAndGEP.ll17
-rw-r--r--release_23/test/Analysis/BasicAA/2007-08-05-GetOverloadedModRef.ll17
-rw-r--r--release_23/test/Analysis/BasicAA/2007-10-24-ArgumentsGlobals.ll14
-rw-r--r--release_23/test/Analysis/BasicAA/2007-11-05-SizeCrash.ll34
-rw-r--r--release_23/test/Analysis/BasicAA/2007-12-08-OutOfBoundsCrash.ll31
-rw-r--r--release_23/test/Analysis/BasicAA/2008-04-15-Byval.ll18
-rw-r--r--release_23/test/Analysis/BasicAA/byval.ll18
-rw-r--r--release_23/test/Analysis/BasicAA/dg.exp3
-rw-r--r--release_23/test/Analysis/BasicAA/featuretest.ll82
-rw-r--r--release_23/test/Analysis/BasicAA/gcsetest.ll46
-rw-r--r--release_23/test/Analysis/BasicAA/global-size.ll15
-rw-r--r--release_23/test/Analysis/BasicAA/licmtest.ll42
-rw-r--r--release_23/test/Analysis/BasicAA/modref.ll15
-rw-r--r--release_23/test/Analysis/BasicAA/pure-const-dce.ll33
-rw-r--r--release_23/test/Analysis/BasicAA/tailcall-modref.ll16
-rw-r--r--release_23/test/Analysis/Dominators/2006-09-26-PostDominanceFrontier.ll97
-rw-r--r--release_23/test/Analysis/Dominators/2006-10-02-BreakCritEdges.ll20
-rw-r--r--release_23/test/Analysis/Dominators/2007-01-14-BreakCritEdges.ll187
-rw-r--r--release_23/test/Analysis/Dominators/2007-04-17-PostDominanceFrontier.ll692
-rw-r--r--release_23/test/Analysis/Dominators/2007-04-20-PostDom-Reset.ll28
-rw-r--r--release_23/test/Analysis/Dominators/2007-07-11-SplitBlock.ll21
-rw-r--r--release_23/test/Analysis/Dominators/2007-07-12-SplitBlock.ll13
-rw-r--r--release_23/test/Analysis/Dominators/dg.exp3
-rw-r--r--release_23/test/Analysis/GlobalsModRef/aliastest.ll9
-rw-r--r--release_23/test/Analysis/GlobalsModRef/chaining-analysis.ll20
-rw-r--r--release_23/test/Analysis/GlobalsModRef/dg.exp3
-rw-r--r--release_23/test/Analysis/GlobalsModRef/indirect-global.ll20
-rw-r--r--release_23/test/Analysis/GlobalsModRef/modreftest.ll13
-rw-r--r--release_23/test/Analysis/GlobalsModRef/purecse.ll23
-rw-r--r--release_23/test/Analysis/LoadVN/RLE-Eliminate.ll25
-rw-r--r--release_23/test/Analysis/LoadVN/RLE-Preserve-Volatile.ll8
-rw-r--r--release_23/test/Analysis/LoadVN/RLE-Preserve.ll26
-rw-r--r--release_23/test/Analysis/LoadVN/call_cse.ll12
-rw-r--r--release_23/test/Analysis/LoadVN/call_pure_function.ll14
-rw-r--r--release_23/test/Analysis/LoadVN/casts.ll13
-rw-r--r--release_23/test/Analysis/LoadVN/dependent_loads.ll25
-rw-r--r--release_23/test/Analysis/LoadVN/dg.exp3
-rw-r--r--release_23/test/Analysis/LoadVN/undefined_load.ll14
-rw-r--r--release_23/test/Analysis/LoopInfo/2003-05-15-NestingProblem.ll30
-rw-r--r--release_23/test/Analysis/LoopInfo/dg.exp3
-rw-r--r--release_23/test/Analysis/PostDominators/dg.exp3
-rw-r--r--release_23/test/Analysis/PostDominators/pr1098.ll14
-rw-r--r--release_23/test/Analysis/ScalarEvolution/2007-07-15-NegativeStride.ll20
-rw-r--r--release_23/test/Analysis/ScalarEvolution/2007-08-06-MisinterpretBranch.ll18
-rw-r--r--release_23/test/Analysis/ScalarEvolution/2007-08-06-Unsigned.ll30
-rw-r--r--release_23/test/Analysis/ScalarEvolution/2007-09-27-LargeStepping.ll21
-rw-r--r--release_23/test/Analysis/ScalarEvolution/2007-11-14-SignedAddRec.ll24
-rw-r--r--release_23/test/Analysis/ScalarEvolution/2007-11-18-OrInstruction.ll18
-rw-r--r--release_23/test/Analysis/ScalarEvolution/2008-02-11-ReversedCondition.ll16
-rw-r--r--release_23/test/Analysis/ScalarEvolution/2008-02-12-SMAXTripCount.ll16
-rw-r--r--release_23/test/Analysis/ScalarEvolution/2008-02-15-UMax.ll17
-rw-r--r--release_23/test/Analysis/ScalarEvolution/SolveQuadraticEquation.ll32
-rw-r--r--release_23/test/Analysis/ScalarEvolution/dg.exp3
-rw-r--r--release_23/test/Analysis/ScalarEvolution/do-loop.ll18
-rw-r--r--release_23/test/Analysis/ScalarEvolution/smax.ll12
-rw-r--r--release_23/test/Analysis/ScalarEvolution/trip-count.ll29
-rw-r--r--release_23/test/Analysis/ScalarEvolution/trip-count2.ll35
-rw-r--r--release_23/test/Archive/GNU.abin4210 -> 0 bytes
-rw-r--r--release_23/test/Archive/GNU.toc4
-rw-r--r--release_23/test/Archive/IsNAN.obin2280 -> 0 bytes
-rw-r--r--release_23/test/Archive/MacOSX.abin4176 -> 0 bytes
-rw-r--r--release_23/test/Archive/MacOSX.tocbin97 -> 0 bytes
-rw-r--r--release_23/test/Archive/README.txt24
-rw-r--r--release_23/test/Archive/SVR4.abin4214 -> 0 bytes
-rw-r--r--release_23/test/Archive/SVR4.toc4
-rw-r--r--release_23/test/Archive/dg.exp3
-rw-r--r--release_23/test/Archive/evenlen1
-rw-r--r--release_23/test/Archive/extract_GNU.ll5
-rw-r--r--release_23/test/Archive/extract_MacOSX.ll6
-rw-r--r--release_23/test/Archive/extract_SVR4.ll6
-rw-r--r--release_23/test/Archive/extract_xpg4.ll6
-rw-r--r--release_23/test/Archive/oddlen1
-rw-r--r--release_23/test/Archive/toc_GNU.ll5
-rw-r--r--release_23/test/Archive/toc_MacOSX.ll5
-rw-r--r--release_23/test/Archive/toc_SVR4.ll5
-rw-r--r--release_23/test/Archive/toc_xpg4.ll5
-rw-r--r--release_23/test/Archive/very_long_bytecode_file_name.bcbin1465 -> 0 bytes
-rw-r--r--release_23/test/Archive/xpg4.abin4214 -> 0 bytes
-rw-r--r--release_23/test/Archive/xpg4.toc4
-rw-r--r--release_23/test/Assembler/2002-01-24-BadSymbolTableAssert.ll11
-rw-r--r--release_23/test/Assembler/2002-01-24-ValueRefineAbsType.ll23
-rw-r--r--release_23/test/Assembler/2002-02-19-TypeParsing.ll3
-rw-r--r--release_23/test/Assembler/2002-03-08-NameCollision.ll15
-rw-r--r--release_23/test/Assembler/2002-03-08-NameCollision2.ll12
-rw-r--r--release_23/test/Assembler/2002-04-04-PureVirtMethCall.ll6
-rw-r--r--release_23/test/Assembler/2002-04-04-PureVirtMethCall2.ll5
-rw-r--r--release_23/test/Assembler/2002-04-05-TypeParsing.ll3
-rw-r--r--release_23/test/Assembler/2002-04-07-HexFloatConstants.ll16
-rw-r--r--release_23/test/Assembler/2002-04-07-InfConstant.ll9
-rw-r--r--release_23/test/Assembler/2002-04-29-NameBinding.ll18
-rw-r--r--release_23/test/Assembler/2002-05-02-InvalidForwardRef.ll10
-rw-r--r--release_23/test/Assembler/2002-05-02-ParseError.ll7
-rw-r--r--release_23/test/Assembler/2002-07-08-HugePerformanceProblem.ll67
-rw-r--r--release_23/test/Assembler/2002-07-14-InternalLossage.ll9
-rw-r--r--release_23/test/Assembler/2002-07-14-OpaqueType.ll10
-rw-r--r--release_23/test/Assembler/2002-07-25-ParserAssertionFailure.ll13
-rw-r--r--release_23/test/Assembler/2002-07-25-QuoteInString.ll5
-rw-r--r--release_23/test/Assembler/2002-07-25-ReturnPtrFunction.ll15
-rw-r--r--release_23/test/Assembler/2002-07-31-SlashInString.ll5
-rw-r--r--release_23/test/Assembler/2002-08-15-CastAmbiguity.ll6
-rw-r--r--release_23/test/Assembler/2002-08-15-ConstantExprProblem.ll16
-rw-r--r--release_23/test/Assembler/2002-08-15-UnresolvedGlobalReference.ll8
-rw-r--r--release_23/test/Assembler/2002-08-16-ConstExprInlined.ll22
-rw-r--r--release_23/test/Assembler/2002-08-19-BytecodeReader.ll17
-rw-r--r--release_23/test/Assembler/2002-08-22-DominanceProblem.ll17
-rw-r--r--release_23/test/Assembler/2002-10-08-LargeArrayPerformance.ll8
-rw-r--r--release_23/test/Assembler/2002-10-13-ConstantEncodingProblem.ll5
-rw-r--r--release_23/test/Assembler/2002-10-15-NameClash.ll7
-rw-r--r--release_23/test/Assembler/2002-12-15-GlobalResolve.ll7
-rw-r--r--release_23/test/Assembler/2003-01-30-UnsignedString.ll4
-rw-r--r--release_23/test/Assembler/2003-04-15-ConstantInitAssertion.ll4
-rw-r--r--release_23/test/Assembler/2003-04-25-UnresolvedGlobalReference.ll7
-rw-r--r--release_23/test/Assembler/2003-05-03-BytecodeReaderProblem.ll6
-rw-r--r--release_23/test/Assembler/2003-05-12-MinIntProblem.ll5
-rw-r--r--release_23/test/Assembler/2003-05-15-AssemblerProblem.ll14
-rw-r--r--release_23/test/Assembler/2003-05-15-SwitchBug.ll11
-rw-r--r--release_23/test/Assembler/2003-05-21-ConstantShiftExpr.ll4
-rw-r--r--release_23/test/Assembler/2003-05-21-EmptyStructTest.ll6
-rw-r--r--release_23/test/Assembler/2003-05-21-MalformedShiftCrash.ll4
-rw-r--r--release_23/test/Assembler/2003-05-21-MalformedStructCrash.ll4
-rw-r--r--release_23/test/Assembler/2003-06-17-InvokeDisassemble.ll9
-rw-r--r--release_23/test/Assembler/2003-06-30-RecursiveTypeProblem.ll3
-rw-r--r--release_23/test/Assembler/2003-08-20-ConstantExprGEP-Fold.ll16
-rw-r--r--release_23/test/Assembler/2003-08-21-ConstantExprCast-Fold.ll4
-rw-r--r--release_23/test/Assembler/2003-10-04-NotMergingGlobalConstants.ll6
-rw-r--r--release_23/test/Assembler/2003-11-05-ConstantExprShift.ll5
-rw-r--r--release_23/test/Assembler/2003-11-11-ImplicitRename.ll8
-rw-r--r--release_23/test/Assembler/2003-11-12-ConstantExprCast.ll10
-rw-r--r--release_23/test/Assembler/2003-11-24-SymbolTableCrash.ll11
-rw-r--r--release_23/test/Assembler/2003-12-30-TypeMapInvalidMemory.ll55
-rw-r--r--release_23/test/Assembler/2004-01-11-getelementptrfolding.ll12
-rw-r--r--release_23/test/Assembler/2004-01-20-MaxLongLong.ll4
-rw-r--r--release_23/test/Assembler/2004-02-01-NegativeZero.ll5
-rw-r--r--release_23/test/Assembler/2004-02-27-SelfUseAssertError.ll25
-rw-r--r--release_23/test/Assembler/2004-03-07-FunctionAddressAlignment.ll15
-rw-r--r--release_23/test/Assembler/2004-03-30-UnclosedFunctionCrash.ll3
-rw-r--r--release_23/test/Assembler/2004-04-04-GetElementPtrIndexTypes.ll10
-rw-r--r--release_23/test/Assembler/2004-06-07-VerifierBug.ll11
-rw-r--r--release_23/test/Assembler/2004-09-29-VerifierIsReallySlow.ll24452
-rw-r--r--release_23/test/Assembler/2004-10-22-BCWriterUndefBug.ll5
-rw-r--r--release_23/test/Assembler/2004-11-28-InvalidTypeCrash.ll5
-rw-r--r--release_23/test/Assembler/2005-01-03-FPConstantDisassembly.ll6
-rw-r--r--release_23/test/Assembler/2005-01-31-CallingAggregateFunction.ll8
-rw-r--r--release_23/test/Assembler/2005-02-09-AsmWriterStoreBug.ll14
-rw-r--r--release_23/test/Assembler/2005-05-05-OpaqueUndefValues.ll4
-rw-r--r--release_23/test/Assembler/2005-12-21-ZeroInitVector.ll6
-rw-r--r--release_23/test/Assembler/2006-05-26-VarargsCallEncode.ll8
-rw-r--r--release_23/test/Assembler/2006-09-28-CrashOnInvalid.ll8
-rw-r--r--release_23/test/Assembler/2006-12-09-Cast-To-Bool.ll6
-rw-r--r--release_23/test/Assembler/2007-01-02-Undefined-Arg-Type.ll9
-rw-r--r--release_23/test/Assembler/2007-01-05-Cmp-ConstExpr.ll18
-rw-r--r--release_23/test/Assembler/2007-01-16-CrashOnBadCast.ll7
-rw-r--r--release_23/test/Assembler/2007-01-16-CrashOnBadCast2.ll4
-rw-r--r--release_23/test/Assembler/2007-03-18-InvalidNumberedVar.ll9
-rw-r--r--release_23/test/Assembler/2007-03-19-NegValue.ll7
-rw-r--r--release_23/test/Assembler/2007-04-15-BadIntrinsic.ll9
-rw-r--r--release_23/test/Assembler/2007-04-20-AlignedLoad.ll7
-rw-r--r--release_23/test/Assembler/2007-04-20-AlignedStore.ll7
-rw-r--r--release_23/test/Assembler/2007-04-25-AssemblerFoldExternWeak.ll6
-rw-r--r--release_23/test/Assembler/2007-05-21-Escape.ll22
-rw-r--r--release_23/test/Assembler/2007-07-19-ParamAttrAmbiguity.ll9
-rw-r--r--release_23/test/Assembler/2007-07-30-AutoUpgradeZextSext.ll12
-rw-r--r--release_23/test/Assembler/2007-08-06-AliasInvalid.ll7
-rw-r--r--release_23/test/Assembler/2007-09-10-AliasFwdRef.ll9
-rw-r--r--release_23/test/Assembler/2007-09-29-GC.ll12
-rw-r--r--release_23/test/Assembler/2007-11-26-AttributeOverload.ll4
-rw-r--r--release_23/test/Assembler/2007-11-27-AutoUpgradeAttributes.ll3
-rw-r--r--release_23/test/Assembler/2007-12-11-AddressSpaces.ll25
-rw-r--r--release_23/test/Assembler/2008-01-11-VarargAttrs.ll10
-rw-r--r--release_23/test/Assembler/2008-02-18-IntPointerCrash.ll6
-rw-r--r--release_23/test/Assembler/2008-02-20-MultipleReturnValue.ll22
-rw-r--r--release_23/test/Assembler/AutoUpgradeIntrinsics.ll81
-rw-r--r--release_23/test/Assembler/ConstantExprFold.ll30
-rw-r--r--release_23/test/Assembler/ConstantExprFoldCast.ll14
-rw-r--r--release_23/test/Assembler/MultipleReturnValueType.ll13
-rw-r--r--release_23/test/Assembler/dg.exp3
-rw-r--r--release_23/test/Assembler/select.ll9
-rw-r--r--release_23/test/Bindings/Ocaml/analysis.ml48
-rw-r--r--release_23/test/Bindings/Ocaml/bitreader.ml75
-rw-r--r--release_23/test/Bindings/Ocaml/bitwriter.ml16
-rw-r--r--release_23/test/Bindings/Ocaml/executionengine.ml109
-rw-r--r--release_23/test/Bindings/Ocaml/ocaml.exp3
-rw-r--r--release_23/test/Bindings/Ocaml/scalar_opts.ml56
-rw-r--r--release_23/test/Bindings/Ocaml/target.ml51
-rw-r--r--release_23/test/Bindings/Ocaml/vmcore.ml1066
-rw-r--r--release_23/test/Bitcode/2006-12-11-Cast-ConstExpr.ll10
-rw-r--r--release_23/test/Bitcode/AutoUpgradeIntrinsics.ll10
-rw-r--r--release_23/test/Bitcode/AutoUpgradeIntrinsics.ll.bcbin800 -> 0 bytes
-rw-r--r--release_23/test/Bitcode/dg.exp3
-rw-r--r--release_23/test/Bitcode/memcpy.ll21
-rw-r--r--release_23/test/Bitcode/sse2_movl_dq.ll2
-rw-r--r--release_23/test/Bitcode/sse2_movl_dq.ll.bcbin480 -> 0 bytes
-rw-r--r--release_23/test/BugPoint/crash-narrowfunctiontest.ll12
-rw-r--r--release_23/test/BugPoint/dg.exp3
-rw-r--r--release_23/test/BugPoint/misopt-basictest.ll10
-rw-r--r--release_23/test/BugPoint/remove_arguments_test.ll11
-rw-r--r--release_23/test/C++Frontend/2003-08-20-ExceptionFail.cpp12
-rw-r--r--release_23/test/C++Frontend/2003-08-21-EmptyClass.cpp9
-rw-r--r--release_23/test/C++Frontend/2003-08-24-Cleanup.cpp.tr10
-rw-r--r--release_23/test/C++Frontend/2003-08-27-TypeNamespaces.cpp16
-rw-r--r--release_23/test/C++Frontend/2003-08-28-ForwardType.cpp23
-rw-r--r--release_23/test/C++Frontend/2003-08-28-SaveExprBug.cpp24
-rw-r--r--release_23/test/C++Frontend/2003-08-29-ArgPassingBug.cpp.tr13
-rw-r--r--release_23/test/C++Frontend/2003-08-31-StructLayout.cpp16
-rw-r--r--release_23/test/C++Frontend/2003-09-22-CompositeExprValue.cpp11
-rw-r--r--release_23/test/C++Frontend/2003-09-29-ArgumentNumberMismatch.cpp17
-rw-r--r--release_23/test/C++Frontend/2003-09-30-CommaExprBug.cpp10
-rw-r--r--release_23/test/C++Frontend/2003-09-30-ForIncrementExprBug.cpp10
-rw-r--r--release_23/test/C++Frontend/2003-09-30-ForIncrementExprBug2.cpp12
-rw-r--r--release_23/test/C++Frontend/2003-09-30-NestedFunctionDecl.cpp12
-rw-r--r--release_23/test/C++Frontend/2003-10-17-BoolBitfields.cpp11
-rw-r--r--release_23/test/C++Frontend/2003-10-21-InnerClass.cpp.tr12
-rw-r--r--release_23/test/C++Frontend/2003-10-27-VirtualBaseClassCrash.cpp17
-rw-r--r--release_23/test/C++Frontend/2003-11-02-WeakLinkage.cpp.tr13
-rw-r--r--release_23/test/C++Frontend/2003-11-04-ArrayConstructors.cpp12
-rw-r--r--release_23/test/C++Frontend/2003-11-04-CatchLabelName.cpp11
-rw-r--r--release_23/test/C++Frontend/2003-11-08-ArrayAddress.cpp.tr10
-rw-r--r--release_23/test/C++Frontend/2003-11-09-ConstructorTypeSafety.cpp.tr21
-rw-r--r--release_23/test/C++Frontend/2003-11-18-EnumArray.cpp14
-rw-r--r--release_23/test/C++Frontend/2003-11-18-MemberInitializationCasting.cpp.tr13
-rw-r--r--release_23/test/C++Frontend/2003-11-18-PtrMemConstantInitializer.cpp14
-rw-r--r--release_23/test/C++Frontend/2003-11-25-ReturningOpaqueByValue.cpp12
-rw-r--r--release_23/test/C++Frontend/2003-11-27-MultipleInheritanceThunk.cpp28
-rw-r--r--release_23/test/C++Frontend/2003-11-29-DuplicatedCleanupTest.cpp41
-rw-r--r--release_23/test/C++Frontend/2003-12-08-ArrayOfPtrToMemberFunc.cpp12
-rw-r--r--release_23/test/C++Frontend/2004-01-11-DynamicInitializedConstant.cpp.tr6
-rw-r--r--release_23/test/C++Frontend/2004-03-08-ReinterpretCastCopy.cpp21
-rw-r--r--release_23/test/C++Frontend/2004-03-09-UnmangledBuiltinMethods.cpp.tr8
-rw-r--r--release_23/test/C++Frontend/2004-03-15-CleanupsAndGotos.cpp14
-rw-r--r--release_23/test/C++Frontend/2004-06-08-LateTemplateInstantiation.cpp19
-rw-r--r--release_23/test/C++Frontend/2004-09-27-CompilerCrash.cpp13
-rw-r--r--release_23/test/C++Frontend/2004-09-27-DidntEmitTemplate.cpp.tr23
-rw-r--r--release_23/test/C++Frontend/2004-11-27-EmitsUnusedInlineFunctions.cpp7
-rw-r--r--release_23/test/C++Frontend/2004-11-27-ExceptionCleanupAssertion.cpp14
-rw-r--r--release_23/test/C++Frontend/2004-11-27-FriendDefaultArgCrash.cpp9
-rw-r--r--release_23/test/C++Frontend/2004-11-27-InlineAsmFunctionRedefinition.cpp26
-rw-r--r--release_23/test/C++Frontend/2005-01-03-StaticInitializers.cpp8
-rw-r--r--release_23/test/C++Frontend/2005-02-11-AnonymousUnion.cpp32
-rw-r--r--release_23/test/C++Frontend/2005-02-13-BadDynamicInit.cpp9
-rw-r--r--release_23/test/C++Frontend/2005-02-14-BitFieldOffset.cpp11
-rw-r--r--release_23/test/C++Frontend/2005-02-19-BitfieldStructCrash.cpp14
-rw-r--r--release_23/test/C++Frontend/2005-02-19-UnnamedVirtualThunkArgument.cpp22
-rw-r--r--release_23/test/C++Frontend/2005-02-20-BrokenReferenceTest.cpp11
-rw-r--r--release_23/test/C++Frontend/2005-02-27-PlacementArrayNewCrash.cpp8
-rw-r--r--release_23/test/C++Frontend/2005-07-21-VirtualBaseAccess.cpp14
-rw-r--r--release_23/test/C++Frontend/2006-03-01-GimplifyCrash.cpp14
-rw-r--r--release_23/test/C++Frontend/2006-03-06-C++RecurseCrash.cpp24
-rw-r--r--release_23/test/C++Frontend/2006-09-08-powi.cpp7
-rw-r--r--release_23/test/C++Frontend/2006-09-12-OpaqueStructCrash.cpp28
-rw-r--r--release_23/test/C++Frontend/2006-09-27-Debug-Protection.cpp13
-rw-r--r--release_23/test/C++Frontend/2006-10-30-ClassBitfield.cpp16
-rw-r--r--release_23/test/C++Frontend/2006-11-06-StackTrace.cpp36
-rw-r--r--release_23/test/C++Frontend/2006-11-20-GlobalSymbols.cpp10
-rw-r--r--release_23/test/C++Frontend/2006-11-30-ConstantExprCrash.cpp27
-rw-r--r--release_23/test/C++Frontend/2006-11-30-NoCompileUnit.cpp58
-rw-r--r--release_23/test/C++Frontend/2006-11-30-Pubnames.cpp20
-rw-r--r--release_23/test/C++Frontend/2007-01-02-UnboundedArray.cpp14
-rw-r--r--release_23/test/C++Frontend/2007-01-06-ELF-Thunk-Sections.cpp49
-rw-r--r--release_23/test/C++Frontend/2007-01-06-PtrMethodInit.cpp75
-rw-r--r--release_23/test/C++Frontend/2007-03-27-FunctionVarRename.cpp17
-rw-r--r--release_23/test/C++Frontend/2007-04-05-PackedBitFields-1.cpp23
-rw-r--r--release_23/test/C++Frontend/2007-04-05-PackedBitFieldsOverlap-2.cpp24
-rw-r--r--release_23/test/C++Frontend/2007-04-05-PackedBitFieldsOverlap.cpp24
-rw-r--r--release_23/test/C++Frontend/2007-04-05-PackedBitFieldsSmall.cpp27
-rw-r--r--release_23/test/C++Frontend/2007-04-05-StructPackedFieldUnpacked.cpp25
-rw-r--r--release_23/test/C++Frontend/2007-04-10-PackedUnion.cpp41
-rw-r--r--release_23/test/C++Frontend/2007-04-11-InlineStorageClassC++.cpp44
-rw-r--r--release_23/test/C++Frontend/2007-04-14-FNoBuiltin.cpp7
-rw-r--r--release_23/test/C++Frontend/2007-04-31-TryCatch.cpp12
-rw-r--r--release_23/test/C++Frontend/2007-05-03-VectorInit.cpp17
-rw-r--r--release_23/test/C++Frontend/2007-05-16-ReverseBitFieldCrash.cpp24
-rw-r--r--release_23/test/C++Frontend/2007-05-23-TryFinally.cpp16
-rw-r--r--release_23/test/C++Frontend/2007-07-04-NestedCatches.cpp32
-rw-r--r--release_23/test/C++Frontend/2007-07-29-RestrictPtrArg.cpp6
-rw-r--r--release_23/test/C++Frontend/2007-07-29-RestrictRefArg.cpp6
-rw-r--r--release_23/test/C++Frontend/2007-08-01-RestrictMethod.cpp13
-rw-r--r--release_23/test/C++Frontend/2007-09-10-RecursiveTypeResolution.cpp88
-rw-r--r--release_23/test/C++Frontend/2007-10-01-StructResize.cpp14
-rw-r--r--release_23/test/C++Frontend/2008-01-11-BadWarning.cpp6
-rw-r--r--release_23/test/C++Frontend/2008-01-12-VecInit.cpp6
-rw-r--r--release_23/test/C++Frontend/2008-02-13-sret.cpp41
-rw-r--r--release_23/test/C++Frontend/2008-05-07-CrazyOffsetOf.cpp8
-rw-r--r--release_23/test/C++Frontend/dg.exp5
-rw-r--r--release_23/test/C++Frontend/ptr-to-method-devirt.cpp14
-rw-r--r--release_23/test/CFrontend/2002-01-23-LoadQISIReloadFailure.c11
-rw-r--r--release_23/test/CFrontend/2002-01-24-ComplexSpaceInType.c11
-rw-r--r--release_23/test/CFrontend/2002-01-24-HandleCallInsnSEGV.c9
-rw-r--r--release_23/test/CFrontend/2002-02-13-ConditionalInCall.c11
-rw-r--r--release_23/test/CFrontend/2002-02-13-ReloadProblem.c18
-rw-r--r--release_23/test/CFrontend/2002-02-13-TypeVarNameCollision.c16
-rw-r--r--release_23/test/CFrontend/2002-02-13-UnnamedLocal.c21
-rw-r--r--release_23/test/CFrontend/2002-02-14-EntryNodePreds.c37
-rw-r--r--release_23/test/CFrontend/2002-02-16-RenamingTest.c18
-rw-r--r--release_23/test/CFrontend/2002-02-17-ArgumentAddress.c39
-rw-r--r--release_23/test/CFrontend/2002-02-18-64bitConstant.c8
-rw-r--r--release_23/test/CFrontend/2002-02-18-StaticData.c13
-rw-r--r--release_23/test/CFrontend/2002-03-11-LargeCharInString.c10
-rw-r--r--release_23/test/CFrontend/2002-03-12-ArrayInitialization.c19
-rw-r--r--release_23/test/CFrontend/2002-03-12-StructInitialize.c14
-rw-r--r--release_23/test/CFrontend/2002-03-12-StructInitializer.c18
-rw-r--r--release_23/test/CFrontend/2002-03-14-BrokenPHINode.c19
-rw-r--r--release_23/test/CFrontend/2002-03-14-BrokenSSA.c17
-rw-r--r--release_23/test/CFrontend/2002-03-14-QuotesInStrConst.c10
-rw-r--r--release_23/test/CFrontend/2002-04-07-SwitchStmt.c22
-rw-r--r--release_23/test/CFrontend/2002-04-08-LocalArray.c14
-rw-r--r--release_23/test/CFrontend/2002-04-09-StructRetVal.c12
-rw-r--r--release_23/test/CFrontend/2002-04-10-StructParameters.c25
-rw-r--r--release_23/test/CFrontend/2002-05-23-StaticValues.c15
-rw-r--r--release_23/test/CFrontend/2002-05-23-TypeNameCollision.c19
-rw-r--r--release_23/test/CFrontend/2002-05-24-Alloca.c11
-rw-r--r--release_23/test/CFrontend/2002-06-25-FWriteInterfaceFailure.c7
-rw-r--r--release_23/test/CFrontend/2002-07-14-MiscListTests.c71
-rw-r--r--release_23/test/CFrontend/2002-07-14-MiscTests.c57
-rw-r--r--release_23/test/CFrontend/2002-07-14-MiscTests2.c13
-rw-r--r--release_23/test/CFrontend/2002-07-14-MiscTests3.c187
-rw-r--r--release_23/test/CFrontend/2002-07-16-HardStringInit.c8
-rw-r--r--release_23/test/CFrontend/2002-07-17-StringConstant.c4
-rw-r--r--release_23/test/CFrontend/2002-07-29-Casts.c86
-rw-r--r--release_23/test/CFrontend/2002-07-30-SubregSetAssertion.c12
-rw-r--r--release_23/test/CFrontend/2002-07-30-UnionTest.c22
-rw-r--r--release_23/test/CFrontend/2002-07-30-VarArgsCallFailure.c8
-rw-r--r--release_23/test/CFrontend/2002-07-31-BadAssert.c16
-rw-r--r--release_23/test/CFrontend/2002-07-31-SubregFailure.c14
-rw-r--r--release_23/test/CFrontend/2002-08-02-UnionTest.c19
-rw-r--r--release_23/test/CFrontend/2002-08-19-RecursiveLocals.c18
-rw-r--r--release_23/test/CFrontend/2002-09-08-PointerShifts.c6
-rw-r--r--release_23/test/CFrontend/2002-09-18-UnionProblem.c26
-rw-r--r--release_23/test/CFrontend/2002-09-19-StarInLabel.c9
-rw-r--r--release_23/test/CFrontend/2002-10-12-TooManyArguments.c8
-rw-r--r--release_23/test/CFrontend/2002-12-15-GlobalBoolTest.c5
-rw-r--r--release_23/test/CFrontend/2002-12-15-GlobalConstantTest.c8
-rw-r--r--release_23/test/CFrontend/2002-12-15-GlobalRedefinition.c5
-rw-r--r--release_23/test/CFrontend/2002-12-15-StructParameters.c18
-rw-r--r--release_23/test/CFrontend/2003-01-30-UnionInit.c8
-rw-r--r--release_23/test/CFrontend/2003-03-03-DeferredType.c12
-rw-r--r--release_23/test/CFrontend/2003-06-22-UnionCrash.c13
-rw-r--r--release_23/test/CFrontend/2003-06-23-GCC-fold-infinite-recursion.c6
-rw-r--r--release_23/test/CFrontend/2003-06-26-CFECrash.c19
-rw-r--r--release_23/test/CFrontend/2003-06-29-MultipleFunctionDefinition.c8
-rw-r--r--release_23/test/CFrontend/2003-07-22-ArrayAccessTypeSafety.c.tr7
-rw-r--r--release_23/test/CFrontend/2003-08-06-BuiltinSetjmpLongjmp.c.tr14
-rw-r--r--release_23/test/CFrontend/2003-08-17-DeadCodeShortCircuit.c.tr7
-rw-r--r--release_23/test/CFrontend/2003-08-18-SigSetJmp.c10
-rw-r--r--release_23/test/CFrontend/2003-08-18-StructAsValue.c11
-rw-r--r--release_23/test/CFrontend/2003-08-20-BadBitfieldRef.c8
-rw-r--r--release_23/test/CFrontend/2003-08-20-PrototypeMismatch.c15
-rw-r--r--release_23/test/CFrontend/2003-08-20-vfork-bug.c6
-rw-r--r--release_23/test/CFrontend/2003-08-21-BinOp-Type-Mismatch.c10
-rw-r--r--release_23/test/CFrontend/2003-08-21-StmtExpr.c12
-rw-r--r--release_23/test/CFrontend/2003-08-21-WideString.c5
-rw-r--r--release_23/test/CFrontend/2003-08-23-LocalUnionTest.c11
-rw-r--r--release_23/test/CFrontend/2003-08-29-BitFieldStruct.c13
-rw-r--r--release_23/test/CFrontend/2003-08-29-HugeCharConst.c5
-rw-r--r--release_23/test/CFrontend/2003-08-29-StructLayoutBug.c10
-rw-r--r--release_23/test/CFrontend/2003-08-30-AggregateInitializer.c16
-rw-r--r--release_23/test/CFrontend/2003-08-30-LargeIntegerBitfieldMember.c9
-rw-r--r--release_23/test/CFrontend/2003-09-18-BitfieldTests.c30
-rw-r--r--release_23/test/CFrontend/2003-09-30-StructLayout.c18
-rw-r--r--release_23/test/CFrontend/2003-10-02-UnionLValueError.c11
-rw-r--r--release_23/test/CFrontend/2003-10-06-NegateExprType.c8
-rw-r--r--release_23/test/CFrontend/2003-10-09-UnionInitializerBug.c17
-rw-r--r--release_23/test/CFrontend/2003-10-28-ident.c4
-rw-r--r--release_23/test/CFrontend/2003-10-29-AsmRename.c22
-rw-r--r--release_23/test/CFrontend/2003-11-01-C99-CompoundLiteral.c8
-rw-r--r--release_23/test/CFrontend/2003-11-01-EmptyStructCrash.c6
-rw-r--r--release_23/test/CFrontend/2003-11-01-GlobalUnionInit.c7
-rw-r--r--release_23/test/CFrontend/2003-11-03-AddrArrayElement.c.tr11
-rw-r--r--release_23/test/CFrontend/2003-11-04-EmptyStruct.c6
-rw-r--r--release_23/test/CFrontend/2003-11-04-OutOfMemory.c9
-rw-r--r--release_23/test/CFrontend/2003-11-08-PointerSubNotGetelementptr.c.tr9
-rw-r--r--release_23/test/CFrontend/2003-11-12-VoidString.c4
-rw-r--r--release_23/test/CFrontend/2003-11-13-TypeSafety.c.tr5
-rw-r--r--release_23/test/CFrontend/2003-11-16-StaticArrayInit.c8
-rw-r--r--release_23/test/CFrontend/2003-11-18-CondExprLValue.c9
-rw-r--r--release_23/test/CFrontend/2003-11-19-AddressOfRegister.c.tr12
-rw-r--r--release_23/test/CFrontend/2003-11-19-BitFieldArray.c12
-rw-r--r--release_23/test/CFrontend/2003-11-20-Bitfields.c12
-rw-r--r--release_23/test/CFrontend/2003-11-20-ComplexDivision.c7
-rw-r--r--release_23/test/CFrontend/2003-11-20-UnionBitfield.c12
-rw-r--r--release_23/test/CFrontend/2003-11-26-PointerShift.c6
-rw-r--r--release_23/test/CFrontend/2003-11-27-ConstructorCast.c14
-rw-r--r--release_23/test/CFrontend/2003-11-27-UnionCtorInitialization.c16
-rw-r--r--release_23/test/CFrontend/2003-12-14-ExternInlineSupport.c.tr3
-rw-r--r--release_23/test/CFrontend/2004-01-01-UnknownInitSize.c14
-rw-r--r--release_23/test/CFrontend/2004-01-08-ExternInlineRedefine.c14
-rw-r--r--release_23/test/CFrontend/2004-02-12-LargeAggregateCopy.c.tr8
-rw-r--r--release_23/test/CFrontend/2004-02-13-BuiltinFrameReturnAddress.c.tr8
-rw-r--r--release_23/test/CFrontend/2004-02-13-IllegalVararg.c.tr11
-rw-r--r--release_23/test/CFrontend/2004-02-13-Memset.c6
-rw-r--r--release_23/test/CFrontend/2004-02-14-ZeroInitializer.c4
-rw-r--r--release_23/test/CFrontend/2004-02-20-Builtins.c.tr6
-rw-r--r--release_23/test/CFrontend/2004-03-07-ComplexDivEquals.c6
-rw-r--r--release_23/test/CFrontend/2004-03-07-ExternalConstant.c.tr7
-rw-r--r--release_23/test/CFrontend/2004-03-09-LargeArrayInitializers.c32
-rw-r--r--release_23/test/CFrontend/2004-03-15-SimpleIndirectGoto.c23
-rw-r--r--release_23/test/CFrontend/2004-03-16-AsmRegisterCrash.c6
-rw-r--r--release_23/test/CFrontend/2004-05-07-VarArrays.c5
-rw-r--r--release_23/test/CFrontend/2004-05-21-IncompleteEnum.c5
-rw-r--r--release_23/test/CFrontend/2004-06-08-OpaqueStructArg.c7
-rw-r--r--release_23/test/CFrontend/2004-06-17-UnorderedBuiltins.c24
-rw-r--r--release_23/test/CFrontend/2004-06-17-UnorderedCompares.c.tr21
-rw-r--r--release_23/test/CFrontend/2004-06-18-VariableLengthArrayOfStructures.c10
-rw-r--r--release_23/test/CFrontend/2004-07-06-FunctionCast.c10
-rw-r--r--release_23/test/CFrontend/2004-08-06-LargeStructTest.c19
-rw-r--r--release_23/test/CFrontend/2004-11-25-UnnamedBitfieldPadding.c8
-rw-r--r--release_23/test/CFrontend/2004-11-27-InvalidConstantExpr.c10
-rw-r--r--release_23/test/CFrontend/2004-11-27-StaticFunctionRedeclare.c15
-rw-r--r--release_23/test/CFrontend/2004-11-27-VariableSizeInStructure.c11
-rw-r--r--release_23/test/CFrontend/2005-01-02-ConstantInits.c24
-rw-r--r--release_23/test/CFrontend/2005-01-02-PointerDifference.c.tr3
-rw-r--r--release_23/test/CFrontend/2005-01-02-VAArgError-ICE.c10
-rw-r--r--release_23/test/CFrontend/2005-02-20-AggregateSAVEEXPR.c19
-rw-r--r--release_23/test/CFrontend/2005-02-27-MarkGlobalConstant.c10
-rw-r--r--release_23/test/CFrontend/2005-03-05-OffsetOfHack.c12
-rw-r--r--release_23/test/CFrontend/2005-03-06-OffsetOfStructCrash.c14
-rw-r--r--release_23/test/CFrontend/2005-03-11-Prefetch.c6
-rw-r--r--release_23/test/CFrontend/2005-04-09-ComplexOps.c9
-rw-r--r--release_23/test/CFrontend/2005-05-06-CountBuiltins.c17
-rw-r--r--release_23/test/CFrontend/2005-05-10-GlobalUnionInit.c6
-rw-r--r--release_23/test/CFrontend/2005-06-15-ExpandGotoInternalProblem.c14
-rw-r--r--release_23/test/CFrontend/2005-07-20-SqrtNoErrno.c7
-rw-r--r--release_23/test/CFrontend/2005-07-26-UnionInitCrash.c3
-rw-r--r--release_23/test/CFrontend/2005-07-28-IncorrectWeakGlobal.c5
-rw-r--r--release_23/test/CFrontend/2005-09-20-ComplexConstants.c4
-rw-r--r--release_23/test/CFrontend/2005-09-24-AsmUserPrefix.c8
-rw-r--r--release_23/test/CFrontend/2005-09-24-BitFieldCrash.c33
-rw-r--r--release_23/test/CFrontend/2005-10-18-VariableSizedElementCrash.c9
-rw-r--r--release_23/test/CFrontend/2005-12-04-AttributeUsed.c8
-rw-r--r--release_23/test/CFrontend/2005-12-04-DeclarationLineNumbers.c23
-rw-r--r--release_23/test/CFrontend/2006-01-13-Includes.c9
-rw-r--r--release_23/test/CFrontend/2006-01-13-StackSave.c11
-rw-r--r--release_23/test/CFrontend/2006-01-16-BitCountIntrinsicsUnsigned.c9
-rw-r--r--release_23/test/CFrontend/2006-01-23-FileScopeAsm.c8
-rw-r--r--release_23/test/CFrontend/2006-03-03-MissingInitializer.c11
-rw-r--r--release_23/test/CFrontend/2006-03-16-VectorCtor.c10
-rw-r--r--release_23/test/CFrontend/2006-03-17-KnRMismatch.c8
-rw-r--r--release_23/test/CFrontend/2006-05-01-AppleAlignmentPragma.c12
-rw-r--r--release_23/test/CFrontend/2006-05-19-SingleEltReturn.c23
-rw-r--r--release_23/test/CFrontend/2006-07-31-PR854.c11
-rw-r--r--release_23/test/CFrontend/2006-09-11-BitfieldRefCrash.c12
-rw-r--r--release_23/test/CFrontend/2006-09-18-fwrite-cast-crash.c13
-rw-r--r--release_23/test/CFrontend/2006-09-21-IncompleteElementType.c3
-rw-r--r--release_23/test/CFrontend/2006-09-25-DebugFilename.c6
-rw-r--r--release_23/test/CFrontend/2006-09-25-DebugFilename.h6
-rw-r--r--release_23/test/CFrontend/2006-09-28-SimpleAsm.c10
-rw-r--r--release_23/test/CFrontend/2006-10-30-ArrayCrash.c17
-rw-r--r--release_23/test/CFrontend/2006-12-14-ordered_expr.c6
-rw-r--r--release_23/test/CFrontend/2007-01-06-KNR-Proto.c10
-rw-r--r--release_23/test/CFrontend/2007-01-20-VectorICE.c11
-rw-r--r--release_23/test/CFrontend/2007-01-24-InlineAsmCModifier.c10
-rw-r--r--release_23/test/CFrontend/2007-02-04-AddrLValue-2.c13
-rw-r--r--release_23/test/CFrontend/2007-02-04-AddrLValue.c23
-rw-r--r--release_23/test/CFrontend/2007-02-04-EmptyStruct.c9
-rw-r--r--release_23/test/CFrontend/2007-02-04-WITH_SIZE_EXPR.c21
-rw-r--r--release_23/test/CFrontend/2007-02-05-nested.c54
-rw-r--r--release_23/test/CFrontend/2007-02-07-AddrLabel.c10
-rw-r--r--release_23/test/CFrontend/2007-02-16-VariableSizeStructArg.c7
-rw-r--r--release_23/test/CFrontend/2007-02-16-VoidPtrDiff.c5
-rw-r--r--release_23/test/CFrontend/2007-02-16-WritableStrings.c8
-rw-r--r--release_23/test/CFrontend/2007-02-25-C-DotDotDot.c12
-rw-r--r--release_23/test/CFrontend/2007-03-01-VarSizeArrayIdx.c7
-rw-r--r--release_23/test/CFrontend/2007-03-05-DataLayout.c53
-rw-r--r--release_23/test/CFrontend/2007-03-06-VarSizeInStruct1.c8
-rw-r--r--release_23/test/CFrontend/2007-03-06-VarSizeInStruct2.c8
-rw-r--r--release_23/test/CFrontend/2007-03-26-BitfieldAfterZeroWidth.c6
-rw-r--r--release_23/test/CFrontend/2007-03-26-ZeroWidthBitfield.c2
-rw-r--r--release_23/test/CFrontend/2007-03-27-ArrayCompatible.c10
-rw-r--r--release_23/test/CFrontend/2007-03-27-VarLengthArray.c7
-rw-r--r--release_23/test/CFrontend/2007-04-05-PackedBitFields-2.c16
-rw-r--r--release_23/test/CFrontend/2007-04-05-PackedBitFields.c16
-rw-r--r--release_23/test/CFrontend/2007-04-05-PackedStruct.c18
-rw-r--r--release_23/test/CFrontend/2007-04-05-PadBeforeZeroLengthField.c9
-rw-r--r--release_23/test/CFrontend/2007-04-05-UnPackedStruct.c16
-rw-r--r--release_23/test/CFrontend/2007-04-11-InlineAsmStruct.c9
-rw-r--r--release_23/test/CFrontend/2007-04-11-InlineAsmUnion.c7
-rw-r--r--release_23/test/CFrontend/2007-04-11-InlineStorageClassC89.c46
-rw-r--r--release_23/test/CFrontend/2007-04-11-InlineStorageClassC99.c46
-rw-r--r--release_23/test/CFrontend/2007-04-11-PR1321.c12
-rw-r--r--release_23/test/CFrontend/2007-04-13-InlineAsmStruct2.c9
-rw-r--r--release_23/test/CFrontend/2007-04-13-InlineAsmUnion2.c7
-rw-r--r--release_23/test/CFrontend/2007-04-14-FNoBuiltin.c7
-rw-r--r--release_23/test/CFrontend/2007-04-17-ZeroSizeBitFields.c4
-rw-r--r--release_23/test/CFrontend/2007-04-24-VolatileStructCopy.c10
-rw-r--r--release_23/test/CFrontend/2007-04-24-bit-not-expr.c7
-rw-r--r--release_23/test/CFrontend/2007-04-24-str-const.c17
-rw-r--r--release_23/test/CFrontend/2007-05-07-NestedStructReturn.c13
-rw-r--r--release_23/test/CFrontend/2007-05-07-PaddingElements.c12
-rw-r--r--release_23/test/CFrontend/2007-05-08-PCH.c7
-rw-r--r--release_23/test/CFrontend/2007-05-11-str-const.c5
-rw-r--r--release_23/test/CFrontend/2007-05-15-PaddingElement.c23
-rw-r--r--release_23/test/CFrontend/2007-05-16-EmptyStruct.c5
-rw-r--r--release_23/test/CFrontend/2007-05-29-UnionCopy.c18
-rw-r--r--release_23/test/CFrontend/2007-06-05-NoInlineAttribute.c13
-rw-r--r--release_23/test/CFrontend/2007-06-15-AnnotateAttribute.c24
-rw-r--r--release_23/test/CFrontend/2007-06-18-SextAttrAggregate.c11
-rw-r--r--release_23/test/CFrontend/2007-07-29-RestrictPtrArg.c6
-rw-r--r--release_23/test/CFrontend/2007-08-01-LoadStoreAlign.c17
-rw-r--r--release_23/test/CFrontend/2007-08-21-ComplexCst.c3
-rw-r--r--release_23/test/CFrontend/2007-08-22-CTTZ.c6
-rw-r--r--release_23/test/CFrontend/2007-09-05-ConstCtor.c14
-rw-r--r--release_23/test/CFrontend/2007-09-12-PragmaPack.c30
-rw-r--r--release_23/test/CFrontend/2007-09-14-NegatePointer.c7
-rw-r--r--release_23/test/CFrontend/2007-09-17-WeakRef.c10
-rw-r--r--release_23/test/CFrontend/2007-09-20-GcrootAttribute.c29
-rw-r--r--release_23/test/CFrontend/2007-09-26-Alignment.c7
-rw-r--r--release_23/test/CFrontend/2007-09-27-ComplexIntCompare.c14
-rw-r--r--release_23/test/CFrontend/2007-09-28-PackedUnionMember.c37
-rw-r--r--release_23/test/CFrontend/2007-10-01-BuildArrayRef.c8
-rw-r--r--release_23/test/CFrontend/2007-10-02-VolatileArray.c7
-rw-r--r--release_23/test/CFrontend/2007-10-15-VoidPtr.c4
-rw-r--r--release_23/test/CFrontend/2007-10-30-Volatile.c6
-rw-r--r--release_23/test/CFrontend/2007-11-07-AlignedMemcpy.c4
-rw-r--r--release_23/test/CFrontend/2007-11-07-CopyAggregateAlign.c3
-rw-r--r--release_23/test/CFrontend/2007-11-07-ZeroAggregateAlign.c3
-rw-r--r--release_23/test/CFrontend/2007-11-27-SExtZExt.c12
-rw-r--r--release_23/test/CFrontend/2007-11-28-GlobalInitializer.c8
-rw-r--r--release_23/test/CFrontend/2007-12-16-AsmNoUnwind.c3
-rw-r--r--release_23/test/CFrontend/2007-12-VarArrayDebug.c18
-rw-r--r--release_23/test/CFrontend/2008-01-04-WideBitfield.c13
-rw-r--r--release_23/test/CFrontend/2008-01-07-UnusualIntSize.c11
-rw-r--r--release_23/test/CFrontend/2008-01-11-ChainConsistency.c3
-rw-r--r--release_23/test/CFrontend/2008-01-21-PackedBitFields.c7
-rw-r--r--release_23/test/CFrontend/2008-01-21-PackedStructField.c18
-rw-r--r--release_23/test/CFrontend/2008-01-24-StructAlignAndBitFields.c4
-rw-r--r--release_23/test/CFrontend/2008-01-25-ByValReadNone.c15
-rw-r--r--release_23/test/CFrontend/2008-01-25-ZeroSizedAggregate.c39
-rw-r--r--release_23/test/CFrontend/2008-01-28-PragmaMark.c6
-rw-r--r--release_23/test/CFrontend/2008-01-28-UnionSize.c24
-rw-r--r--release_23/test/CFrontend/2008-02-11-AnnotateBuiltin.c7
-rw-r--r--release_23/test/CFrontend/2008-03-03-CtorAttrType.c6
-rw-r--r--release_23/test/CFrontend/2008-03-05-syncPtr.c27
-rw-r--r--release_23/test/CFrontend/2008-03-24-BitField-And-Alloca.c88
-rw-r--r--release_23/test/CFrontend/2008-03-26-PackedBitFields.c7
-rw-r--r--release_23/test/CFrontend/2008-04-08-NoExceptions.c7
-rw-r--r--release_23/test/CFrontend/2008-05-06-CFECrash.c4
-rw-r--r--release_23/test/CFrontend/BasicInstrs.c26
-rw-r--r--release_23/test/CFrontend/attribute_constructor.c6
-rw-r--r--release_23/test/CFrontend/block-copy.c20
-rw-r--r--release_23/test/CFrontend/dg.exp5
-rw-r--r--release_23/test/CFrontend/exact-div-expr.c6
-rw-r--r--release_23/test/CFrontend/extern-weak.c12
-rw-r--r--release_23/test/CFrontend/funccall.c17
-rw-r--r--release_23/test/CFrontend/hidden-visibility.c3
-rw-r--r--release_23/test/CFrontend/inline-asm-mrv.c12
-rw-r--r--release_23/test/CFrontend/libcalls.c10
-rw-r--r--release_23/test/CFrontend/nested-functions.c18
-rw-r--r--release_23/test/CFrontend/sret.c15
-rw-r--r--release_23/test/CFrontend/sret2.c9
-rw-r--r--release_23/test/CFrontend/unaligned-memcpy.c5
-rw-r--r--release_23/test/CodeGen/ARM/2006-11-10-CycleInDAG.ll20
-rw-r--r--release_23/test/CodeGen/ARM/2007-01-19-InfiniteLoop.ll103
-rw-r--r--release_23/test/CodeGen/ARM/2007-01-31-RegInfoAssert.ll16
-rw-r--r--release_23/test/CodeGen/ARM/2007-02-02-JoinIntervalsCrash.ll27
-rw-r--r--release_23/test/CodeGen/ARM/2007-03-06-AddR7.ll117
-rw-r--r--release_23/test/CodeGen/ARM/2007-03-07-CombinerCrash.ll21
-rw-r--r--release_23/test/CodeGen/ARM/2007-03-13-InstrSched.ll48
-rw-r--r--release_23/test/CodeGen/ARM/2007-03-21-JoinIntervalsCrash.ll96
-rw-r--r--release_23/test/CodeGen/ARM/2007-03-26-RegScavengerAssert.ll947
-rw-r--r--release_23/test/CodeGen/ARM/2007-03-27-RegScavengerAssert.ll35
-rw-r--r--release_23/test/CodeGen/ARM/2007-03-30-RegScavengerAssert.ll101
-rw-r--r--release_23/test/CodeGen/ARM/2007-04-02-RegScavengerAssert.ll55
-rw-r--r--release_23/test/CodeGen/ARM/2007-04-03-PEIBug.ll12
-rw-r--r--release_23/test/CodeGen/ARM/2007-04-03-UndefinedSymbol.ll99
-rw-r--r--release_23/test/CodeGen/ARM/2007-04-30-CombinerCrash.ll32
-rw-r--r--release_23/test/CodeGen/ARM/2007-05-03-BadPostIndexedLd.ll113
-rw-r--r--release_23/test/CodeGen/ARM/2007-05-05-InvalidPushPop.ll41
-rw-r--r--release_23/test/CodeGen/ARM/2007-05-07-jumptoentry.ll58
-rw-r--r--release_23/test/CodeGen/ARM/2007-05-07-tailmerge-1.ll68
-rw-r--r--release_23/test/CodeGen/ARM/2007-05-09-tailmerge-2.ll69
-rw-r--r--release_23/test/CodeGen/ARM/2007-05-14-InlineAsmCstCrash.ll6
-rw-r--r--release_23/test/CodeGen/ARM/2007-05-14-RegScavengerAssert.ll30
-rw-r--r--release_23/test/CodeGen/ARM/2007-05-22-tailmerge-3.ll73
-rw-r--r--release_23/test/CodeGen/ARM/2007-05-23-BadPreIndexedStore.ll34
-rw-r--r--release_23/test/CodeGen/ARM/2007-05-31-RegScavengerInfiniteLoop.ll237
-rw-r--r--release_23/test/CodeGen/ARM/2007-08-15-ReuseBug.ll106
-rw-r--r--release_23/test/CodeGen/ARM/2008-02-04-LocalRegAllocBug.ll19
-rw-r--r--release_23/test/CodeGen/ARM/2008-02-29-RegAllocLocal.ll21
-rw-r--r--release_23/test/CodeGen/ARM/2008-03-05-SxtInRegBug.ll14
-rw-r--r--release_23/test/CodeGen/ARM/2008-03-07-RegScavengerAssert.ll20
-rw-r--r--release_23/test/CodeGen/ARM/2008-04-04-ScavengerAssert.ll60
-rw-r--r--release_23/test/CodeGen/ARM/2008-04-10-ScavengerAssert.ll258
-rw-r--r--release_23/test/CodeGen/ARM/2008-04-11-PHIofImpDef.ll3544
-rw-r--r--release_23/test/CodeGen/ARM/addrmode.ll15
-rw-r--r--release_23/test/CodeGen/ARM/aliases.ll32
-rw-r--r--release_23/test/CodeGen/ARM/align.ll15
-rw-r--r--release_23/test/CodeGen/ARM/alloca.ll13
-rw-r--r--release_23/test/CodeGen/ARM/argaddr.ll19
-rw-r--r--release_23/test/CodeGen/ARM/arguments.ll11
-rw-r--r--release_23/test/CodeGen/ARM/arm-asm.ll7
-rw-r--r--release_23/test/CodeGen/ARM/arm-negative-stride.ll20
-rw-r--r--release_23/test/CodeGen/ARM/bits.ll36
-rw-r--r--release_23/test/CodeGen/ARM/branch.ll57
-rw-r--r--release_23/test/CodeGen/ARM/bx_fold.ll30
-rw-r--r--release_23/test/CodeGen/ARM/call.ll19
-rw-r--r--release_23/test/CodeGen/ARM/call_nolink.ll52
-rw-r--r--release_23/test/CodeGen/ARM/clz.ll8
-rw-r--r--release_23/test/CodeGen/ARM/compare-call.ll20
-rw-r--r--release_23/test/CodeGen/ARM/constants.ll42
-rw-r--r--release_23/test/CodeGen/ARM/ctors_dtors.ll25
-rw-r--r--release_23/test/CodeGen/ARM/dg.exp5
-rw-r--r--release_23/test/CodeGen/ARM/div.ll30
-rw-r--r--release_23/test/CodeGen/ARM/dyn-stackalloc.ll60
-rw-r--r--release_23/test/CodeGen/ARM/extloadi1.ll20
-rw-r--r--release_23/test/CodeGen/ARM/fcopysign.ll18
-rw-r--r--release_23/test/CodeGen/ARM/fmdrr-fmrrd.ll13
-rw-r--r--release_23/test/CodeGen/ARM/fnmul.ll11
-rw-r--r--release_23/test/CodeGen/ARM/fp.ll62
-rw-r--r--release_23/test/CodeGen/ARM/fparith.ll85
-rw-r--r--release_23/test/CodeGen/ARM/fpcmp.ll57
-rw-r--r--release_23/test/CodeGen/ARM/fpcmp_ueq.ll10
-rw-r--r--release_23/test/CodeGen/ARM/fpconv.ll83
-rw-r--r--release_23/test/CodeGen/ARM/fpmem.ll22
-rw-r--r--release_23/test/CodeGen/ARM/fpowi.ll16
-rw-r--r--release_23/test/CodeGen/ARM/fptoint.ll47
-rw-r--r--release_23/test/CodeGen/ARM/frame_thumb.ll9
-rw-r--r--release_23/test/CodeGen/ARM/hello.ll14
-rw-r--r--release_23/test/CodeGen/ARM/iabs.ll22
-rw-r--r--release_23/test/CodeGen/ARM/ifcvt1.ll15
-rw-r--r--release_23/test/CodeGen/ARM/ifcvt2.ll36
-rw-r--r--release_23/test/CodeGen/ARM/ifcvt3.ll19
-rw-r--r--release_23/test/CodeGen/ARM/ifcvt4.ll38
-rw-r--r--release_23/test/CodeGen/ARM/ifcvt5.ll24
-rw-r--r--release_23/test/CodeGen/ARM/ifcvt6.ll25
-rw-r--r--release_23/test/CodeGen/ARM/ifcvt7.ll39
-rw-r--r--release_23/test/CodeGen/ARM/ifcvt8.ll22
-rw-r--r--release_23/test/CodeGen/ARM/illegal-vector-bitcast.ll13
-rw-r--r--release_23/test/CodeGen/ARM/imm.ll16
-rw-r--r--release_23/test/CodeGen/ARM/inlineasm.ll19
-rw-r--r--release_23/test/CodeGen/ARM/inlineasm2.ll11
-rw-r--r--release_23/test/CodeGen/ARM/insn-sched1.ll11
-rw-r--r--release_23/test/CodeGen/ARM/ispositive.ll10
-rw-r--r--release_23/test/CodeGen/ARM/large-stack.ll21
-rw-r--r--release_23/test/CodeGen/ARM/ldm.ll35
-rw-r--r--release_23/test/CodeGen/ARM/ldr.ll23
-rw-r--r--release_23/test/CodeGen/ARM/ldr_ext.ll32
-rw-r--r--release_23/test/CodeGen/ARM/ldr_frame.ll32
-rw-r--r--release_23/test/CodeGen/ARM/ldr_post.ll12
-rw-r--r--release_23/test/CodeGen/ARM/ldr_pre.ll19
-rw-r--r--release_23/test/CodeGen/ARM/load-global.ll19
-rw-r--r--release_23/test/CodeGen/ARM/load.ll34
-rw-r--r--release_23/test/CodeGen/ARM/long-setcc.ll18
-rw-r--r--release_23/test/CodeGen/ARM/long.ll87
-rw-r--r--release_23/test/CodeGen/ARM/long_shift.ll31
-rw-r--r--release_23/test/CodeGen/ARM/lsr-code-insertion.ll60
-rw-r--r--release_23/test/CodeGen/ARM/lsr-scale-addr-mode.ll19
-rw-r--r--release_23/test/CodeGen/ARM/mem.ll14
-rw-r--r--release_23/test/CodeGen/ARM/memcpy-inline.ll15
-rw-r--r--release_23/test/CodeGen/ARM/memfunc.ll16
-rw-r--r--release_23/test/CodeGen/ARM/mul.ll24
-rw-r--r--release_23/test/CodeGen/ARM/mulhi.ll22
-rw-r--r--release_23/test/CodeGen/ARM/mvn.ll74
-rw-r--r--release_23/test/CodeGen/ARM/pack.ll73
-rw-r--r--release_23/test/CodeGen/ARM/remat.ll116
-rw-r--r--release_23/test/CodeGen/ARM/ret0.ll5
-rw-r--r--release_23/test/CodeGen/ARM/ret_arg1.ll5
-rw-r--r--release_23/test/CodeGen/ARM/ret_arg2.ll6
-rw-r--r--release_23/test/CodeGen/ARM/ret_arg3.ll5
-rw-r--r--release_23/test/CodeGen/ARM/ret_arg4.ll5
-rw-r--r--release_23/test/CodeGen/ARM/ret_arg5.ll5
-rw-r--r--release_23/test/CodeGen/ARM/ret_void.ll6
-rw-r--r--release_23/test/CodeGen/ARM/rev.ll27
-rw-r--r--release_23/test/CodeGen/ARM/section.ll7
-rw-r--r--release_23/test/CodeGen/ARM/select.ll63
-rw-r--r--release_23/test/CodeGen/ARM/select_xform.ll16
-rw-r--r--release_23/test/CodeGen/ARM/shifter_operand.ll18
-rw-r--r--release_23/test/CodeGen/ARM/smul.ll36
-rw-r--r--release_23/test/CodeGen/ARM/stack-frame.ll15
-rw-r--r--release_23/test/CodeGen/ARM/str_post.ll21
-rw-r--r--release_23/test/CodeGen/ARM/str_pre.ll18
-rw-r--r--release_23/test/CodeGen/ARM/str_trunc.ll16
-rw-r--r--release_23/test/CodeGen/ARM/sxt_rot.ll22
-rw-r--r--release_23/test/CodeGen/ARM/thread_pointer.ll10
-rw-r--r--release_23/test/CodeGen/ARM/thumb-imm.ll10
-rw-r--r--release_23/test/CodeGen/ARM/tls1.ll20
-rw-r--r--release_23/test/CodeGen/ARM/tls2.ll19
-rw-r--r--release_23/test/CodeGen/ARM/tls3.ll11
-rw-r--r--release_23/test/CodeGen/ARM/trunc_ldr.ll24
-rw-r--r--release_23/test/CodeGen/ARM/truncstore-dag-combine.ll18
-rw-r--r--release_23/test/CodeGen/ARM/tst_teq.ll19
-rw-r--r--release_23/test/CodeGen/ARM/unaligned_load_store.ll16
-rw-r--r--release_23/test/CodeGen/ARM/unord.ll16
-rw-r--r--release_23/test/CodeGen/ARM/uxt_rot.ll24
-rw-r--r--release_23/test/CodeGen/ARM/uxtb.ll74
-rw-r--r--release_23/test/CodeGen/ARM/vargs.ll12
-rw-r--r--release_23/test/CodeGen/ARM/vargs2.ll36
-rw-r--r--release_23/test/CodeGen/ARM/vargs_align.ll21
-rw-r--r--release_23/test/CodeGen/ARM/vfp.ll144
-rw-r--r--release_23/test/CodeGen/ARM/weak.ll16
-rw-r--r--release_23/test/CodeGen/ARM/weak2.ll18
-rw-r--r--release_23/test/CodeGen/Alpha/2005-07-12-TwoMallocCalls.ll17
-rw-r--r--release_23/test/CodeGen/Alpha/2005-12-12-MissingFCMov.ll40
-rw-r--r--release_23/test/CodeGen/Alpha/2006-01-18-MissedGlobal.ll27
-rw-r--r--release_23/test/CodeGen/Alpha/2006-01-26-VaargBreak.ll14
-rw-r--r--release_23/test/CodeGen/Alpha/2006-04-04-zextload.ll34
-rw-r--r--release_23/test/CodeGen/Alpha/2006-07-03-ASMFormalLowering.ll18
-rw-r--r--release_23/test/CodeGen/Alpha/2006-11-01-vastart.ll15
-rw-r--r--release_23/test/CodeGen/Alpha/2007-11-27-mulneg3.ll13
-rw-r--r--release_23/test/CodeGen/Alpha/add.ll179
-rw-r--r--release_23/test/CodeGen/Alpha/bic.ll9
-rw-r--r--release_23/test/CodeGen/Alpha/bsr.ll12
-rw-r--r--release_23/test/CodeGen/Alpha/call_adj.ll13
-rw-r--r--release_23/test/CodeGen/Alpha/cmov.ll23
-rw-r--r--release_23/test/CodeGen/Alpha/cmpbge.ll16
-rw-r--r--release_23/test/CodeGen/Alpha/ctlz.ll15
-rw-r--r--release_23/test/CodeGen/Alpha/ctlz_e.ll11
-rw-r--r--release_23/test/CodeGen/Alpha/ctpop.ll19
-rw-r--r--release_23/test/CodeGen/Alpha/dg.exp5
-rw-r--r--release_23/test/CodeGen/Alpha/eqv.ll10
-rw-r--r--release_23/test/CodeGen/Alpha/i32_sub_1.ll9
-rw-r--r--release_23/test/CodeGen/Alpha/illegal-element-type.ll23
-rw-r--r--release_23/test/CodeGen/Alpha/jmp_table.ll99
-rw-r--r--release_23/test/CodeGen/Alpha/mb.ll8
-rw-r--r--release_23/test/CodeGen/Alpha/mul5.ll53
-rw-r--r--release_23/test/CodeGen/Alpha/neg1.ll7
-rw-r--r--release_23/test/CodeGen/Alpha/not.ll8
-rw-r--r--release_23/test/CodeGen/Alpha/ornot.ll10
-rw-r--r--release_23/test/CodeGen/Alpha/rpcc.ll9
-rw-r--r--release_23/test/CodeGen/Alpha/srl_and.ll10
-rw-r--r--release_23/test/CodeGen/Alpha/weak.ll16
-rw-r--r--release_23/test/CodeGen/Alpha/wmb.ll8
-rw-r--r--release_23/test/CodeGen/Alpha/zapnot.ll9
-rw-r--r--release_23/test/CodeGen/Alpha/zapnot2.ll9
-rw-r--r--release_23/test/CodeGen/Alpha/zapnot3.ll15
-rw-r--r--release_23/test/CodeGen/Alpha/zapnot4.ll7
-rw-r--r--release_23/test/CodeGen/CBackend/2002-05-16-NameCollide.ll8
-rw-r--r--release_23/test/CodeGen/CBackend/2002-05-21-MissingReturn.ll20
-rw-r--r--release_23/test/CodeGen/CBackend/2002-08-19-ConstPointerRef.ll7
-rw-r--r--release_23/test/CodeGen/CBackend/2002-08-19-ConstantExpr.ll8
-rw-r--r--release_23/test/CodeGen/CBackend/2002-08-19-DataPointer.ll4
-rw-r--r--release_23/test/CodeGen/CBackend/2002-08-19-FunctionPointer.ll5
-rw-r--r--release_23/test/CodeGen/CBackend/2002-08-19-HardConstantExpr.ll5
-rw-r--r--release_23/test/CodeGen/CBackend/2002-08-20-RecursiveTypes.ll3
-rw-r--r--release_23/test/CodeGen/CBackend/2002-08-20-UnnamedArgument.ll10
-rw-r--r--release_23/test/CodeGen/CBackend/2002-08-26-IndirectCallTest.ll17
-rw-r--r--release_23/test/CodeGen/CBackend/2002-08-30-StructureOrderingTest.ll8
-rw-r--r--release_23/test/CodeGen/CBackend/2002-09-20-ArrayTypeFailure.ll7
-rw-r--r--release_23/test/CodeGen/CBackend/2002-09-20-VarArgPrototypes.ll6
-rw-r--r--release_23/test/CodeGen/CBackend/2002-10-15-OpaqueTypeProblem.ll6
-rw-r--r--release_23/test/CodeGen/CBackend/2002-10-16-External.ll4
-rw-r--r--release_23/test/CodeGen/CBackend/2002-10-30-FunctionPointerAlloca.ll10
-rw-r--r--release_23/test/CodeGen/CBackend/2002-11-06-PrintEscaped.ll11
-rw-r--r--release_23/test/CodeGen/CBackend/2003-05-12-IntegerSizeWarning.ll8
-rw-r--r--release_23/test/CodeGen/CBackend/2003-05-13-VarArgFunction.ll11
-rw-r--r--release_23/test/CodeGen/CBackend/2003-05-31-MissingStructName.ll5
-rw-r--r--release_23/test/CodeGen/CBackend/2003-06-01-NullPointerType.ll9
-rw-r--r--release_23/test/CodeGen/CBackend/2003-06-11-HexConstant.ll4
-rw-r--r--release_23/test/CodeGen/CBackend/2003-06-11-LiteralStringProblem.ll3
-rw-r--r--release_23/test/CodeGen/CBackend/2003-06-28-InvokeSupport.ll17
-rw-r--r--release_23/test/CodeGen/CBackend/2003-06-28-LinkOnceGlobalVars.ll3
-rw-r--r--release_23/test/CodeGen/CBackend/2003-10-12-NANGlobalInits.ll5
-rw-r--r--release_23/test/CodeGen/CBackend/2003-10-23-UnusedType.ll8
-rw-r--r--release_23/test/CodeGen/CBackend/2003-10-28-CastToPtrToStruct.ll12
-rw-r--r--release_23/test/CodeGen/CBackend/2003-11-21-ConstantShiftExpr.ll13
-rw-r--r--release_23/test/CodeGen/CBackend/2004-02-13-FrameReturnAddress.ll16
-rw-r--r--release_23/test/CodeGen/CBackend/2004-02-15-PreexistingExternals.ll18
-rw-r--r--release_23/test/CodeGen/CBackend/2004-02-26-FPNotPrintableConstants.ll11
-rw-r--r--release_23/test/CodeGen/CBackend/2004-02-26-LinkOnceFunctions.ll6
-rw-r--r--release_23/test/CodeGen/CBackend/2004-08-09-va-end-null.ll10
-rw-r--r--release_23/test/CodeGen/CBackend/2004-11-13-FunctionPointerCast.ll12
-rw-r--r--release_23/test/CodeGen/CBackend/2004-12-03-ExternStatics.ll10
-rw-r--r--release_23/test/CodeGen/CBackend/2004-12-28-LogicalConstantExprs.ll5
-rw-r--r--release_23/test/CodeGen/CBackend/2005-02-14-VolatileOperations.ll8
-rw-r--r--release_23/test/CodeGen/CBackend/2005-03-08-RecursiveTypeCrash.ll5
-rw-r--r--release_23/test/CodeGen/CBackend/2005-07-14-NegationToMinusMinus.ll18
-rw-r--r--release_23/test/CodeGen/CBackend/2005-08-23-Fmod.ll7
-rw-r--r--release_23/test/CodeGen/CBackend/2005-09-27-VolatileFuncPtr.ll10
-rw-r--r--release_23/test/CodeGen/CBackend/2006-12-11-Float-Bitcast.ll49
-rw-r--r--release_23/test/CodeGen/CBackend/2007-01-08-ParamAttr-ICmp.ll26
-rw-r--r--release_23/test/CodeGen/CBackend/2007-01-15-NamedArrayType.ll11
-rw-r--r--release_23/test/CodeGen/CBackend/2007-01-17-StackSaveNRestore.ll12
-rw-r--r--release_23/test/CodeGen/CBackend/2007-02-05-memset.ll13
-rw-r--r--release_23/test/CodeGen/CBackend/2007-02-23-NameConflicts.ll13
-rw-r--r--release_23/test/CodeGen/CBackend/2007-07-11-PackedStruct.ll9
-rw-r--r--release_23/test/CodeGen/CBackend/2008-02-01-UnalignedLoadStore.ll15
-rw-r--r--release_23/test/CodeGen/CBackend/2008-05-21-MRV-InlineAsm.ll19
-rw-r--r--release_23/test/CodeGen/CBackend/2008-05-31-BoolOverflow.ll14
-rw-r--r--release_23/test/CodeGen/CBackend/2008-06-04-IndirectMem.ll12
-rw-r--r--release_23/test/CodeGen/CBackend/dg.exp5
-rw-r--r--release_23/test/CodeGen/CBackend/vectors.ll37
-rw-r--r--release_23/test/CodeGen/CellSPU/and_ops.ll279
-rw-r--r--release_23/test/CodeGen/CellSPU/and_ops_more.ll26
-rw-r--r--release_23/test/CodeGen/CellSPU/call.ll20
-rw-r--r--release_23/test/CodeGen/CellSPU/call_indirect.ll49
-rw-r--r--release_23/test/CodeGen/CellSPU/ctpop.ll30
-rw-r--r--release_23/test/CodeGen/CellSPU/dg.exp5
-rw-r--r--release_23/test/CodeGen/CellSPU/dp_farith.ll102
-rw-r--r--release_23/test/CodeGen/CellSPU/eqv.ll152
-rw-r--r--release_23/test/CodeGen/CellSPU/extract_elt.ll177
-rw-r--r--release_23/test/CodeGen/CellSPU/fcmp.ll22
-rw-r--r--release_23/test/CodeGen/CellSPU/fdiv.ll20
-rw-r--r--release_23/test/CodeGen/CellSPU/fneg-fabs.ll43
-rw-r--r--release_23/test/CodeGen/CellSPU/icmp16.ll350
-rw-r--r--release_23/test/CodeGen/CellSPU/icmp32.ll350
-rw-r--r--release_23/test/CodeGen/CellSPU/icmp8.ll286
-rw-r--r--release_23/test/CodeGen/CellSPU/immed16.ll40
-rw-r--r--release_23/test/CodeGen/CellSPU/immed32.ll72
-rw-r--r--release_23/test/CodeGen/CellSPU/immed64.ll93
-rw-r--r--release_23/test/CodeGen/CellSPU/int2fp.ll41
-rw-r--r--release_23/test/CodeGen/CellSPU/intrinsics_branch.ll150
-rw-r--r--release_23/test/CodeGen/CellSPU/intrinsics_float.ll94
-rw-r--r--release_23/test/CodeGen/CellSPU/intrinsics_logical.ll49
-rw-r--r--release_23/test/CodeGen/CellSPU/mul_ops.ll89
-rw-r--r--release_23/test/CodeGen/CellSPU/nand.ll121
-rw-r--r--release_23/test/CodeGen/CellSPU/or_ops.ll264
-rw-r--r--release_23/test/CodeGen/CellSPU/rotate_ops.ll159
-rw-r--r--release_23/test/CodeGen/CellSPU/select_bits.ll569
-rw-r--r--release_23/test/CodeGen/CellSPU/shift_ops.ll212
-rw-r--r--release_23/test/CodeGen/CellSPU/sp_farith.ll90
-rw-r--r--release_23/test/CodeGen/CellSPU/struct_1.ll144
-rw-r--r--release_23/test/CodeGen/CellSPU/vec_const.ll154
-rw-r--r--release_23/test/CodeGen/CellSPU/vecinsert.ll53
-rw-r--r--release_23/test/CodeGen/Generic/2002-04-14-UnexpectedUnsignedType.ll13
-rw-r--r--release_23/test/CodeGen/Generic/2002-04-16-StackFrameSizeAlignment.ll14
-rw-r--r--release_23/test/CodeGen/Generic/2003-05-27-phifcmpd.ll19
-rw-r--r--release_23/test/CodeGen/Generic/2003-05-27-useboolinotherbb.ll13
-rw-r--r--release_23/test/CodeGen/Generic/2003-05-27-usefsubasbool.ll14
-rw-r--r--release_23/test/CodeGen/Generic/2003-05-28-ManyArgs.ll153
-rw-r--r--release_23/test/CodeGen/Generic/2003-05-30-BadFoldGEP.ll39
-rw-r--r--release_23/test/CodeGen/Generic/2003-05-30-BadPreselectPhi.ll33
-rw-r--r--release_23/test/CodeGen/Generic/2003-07-06-BadIntCmp.ll51
-rw-r--r--release_23/test/CodeGen/Generic/2003-07-07-BadLongConst.ll20
-rw-r--r--release_23/test/CodeGen/Generic/2003-07-08-BadCastToBool.ll34
-rw-r--r--release_23/test/CodeGen/Generic/2003-07-29-BadConstSbyte.ll40
-rw-r--r--release_23/test/CodeGen/Generic/2004-02-08-UnwindSupport.ll17
-rw-r--r--release_23/test/CodeGen/Generic/2004-05-09-LiveVarPartialRegister.ll13
-rw-r--r--release_23/test/CodeGen/Generic/2005-01-18-SetUO-InfLoop.ll20
-rw-r--r--release_23/test/CodeGen/Generic/2005-04-09-GlobalInPHI.ll20
-rw-r--r--release_23/test/CodeGen/Generic/2005-07-12-memcpy-i64-length.ll11
-rw-r--r--release_23/test/CodeGen/Generic/2005-10-18-ZeroSizeStackObject.ll6
-rw-r--r--release_23/test/CodeGen/Generic/2005-10-21-longlonggtu.ll16
-rw-r--r--release_23/test/CodeGen/Generic/2005-12-01-Crash.ll20
-rw-r--r--release_23/test/CodeGen/Generic/2005-12-12-ExpandSextInreg.ll7
-rw-r--r--release_23/test/CodeGen/Generic/2006-01-12-BadSetCCFold.ll35
-rw-r--r--release_23/test/CodeGen/Generic/2006-01-18-InvalidBranchOpcodeAssert.ll15
-rw-r--r--release_23/test/CodeGen/Generic/2006-02-12-InsertLibcall.ll60
-rw-r--r--release_23/test/CodeGen/Generic/2006-03-01-dagcombineinfloop.ll95
-rw-r--r--release_23/test/CodeGen/Generic/2006-03-27-DebugInfoNULLDeclare.ll9
-rw-r--r--release_23/test/CodeGen/Generic/2006-04-11-vecload.ll12
-rw-r--r--release_23/test/CodeGen/Generic/2006-04-26-SetCCAnd.ll40
-rw-r--r--release_23/test/CodeGen/Generic/2006-04-28-Sign-extend-bool.ll9
-rw-r--r--release_23/test/CodeGen/Generic/2006-05-06-GEP-Cast-Sink-Crash.ll29
-rw-r--r--release_23/test/CodeGen/Generic/2006-06-12-LowerSwitchCrash.ll10
-rw-r--r--release_23/test/CodeGen/Generic/2006-06-13-ComputeMaskedBitsCrash.ll35
-rw-r--r--release_23/test/CodeGen/Generic/2006-06-28-SimplifySetCCCrash.ll279
-rw-r--r--release_23/test/CodeGen/Generic/2006-07-03-schedulers.ll30
-rw-r--r--release_23/test/CodeGen/Generic/2006-08-30-CoalescerCrash.ll112
-rw-r--r--release_23/test/CodeGen/Generic/2006-09-02-LocalAllocCrash.ll117
-rw-r--r--release_23/test/CodeGen/Generic/2006-09-06-SwitchLowering.ll96
-rw-r--r--release_23/test/CodeGen/Generic/2006-10-27-CondFolding.ll21
-rw-r--r--release_23/test/CodeGen/Generic/2006-10-29-Crash.ll22
-rw-r--r--release_23/test/CodeGen/Generic/2006-11-06-MemIntrinsicExpand.ll11
-rw-r--r--release_23/test/CodeGen/Generic/2006-11-20-DAGCombineCrash.ll41
-rw-r--r--release_23/test/CodeGen/Generic/2006-12-16-InlineAsmCrash.ll30
-rw-r--r--release_23/test/CodeGen/Generic/2007-01-15-LoadSelectCycle.ll12
-rw-r--r--release_23/test/CodeGen/Generic/2007-02-16-BranchFold.ll95
-rw-r--r--release_23/test/CodeGen/Generic/2007-02-23-DAGCombine-Miscompile.ll13
-rw-r--r--release_23/test/CodeGen/Generic/2007-02-25-invoke.ll12
-rw-r--r--release_23/test/CodeGen/Generic/2007-04-08-MultipleFrameIndices.ll11
-rw-r--r--release_23/test/CodeGen/Generic/2007-04-13-SwitchLowerBadPhi.ll27
-rw-r--r--release_23/test/CodeGen/Generic/2007-04-14-BitTestsBadMask.ll160
-rw-r--r--release_23/test/CodeGen/Generic/2007-04-14-EHSelectorCrash.ll18
-rw-r--r--release_23/test/CodeGen/Generic/2007-04-17-lsr-crash.ll35
-rw-r--r--release_23/test/CodeGen/Generic/2007-04-27-BitTestsBadMask.ll18
-rw-r--r--release_23/test/CodeGen/Generic/2007-04-27-InlineAsm-X-Dest.ll10
-rw-r--r--release_23/test/CodeGen/Generic/2007-04-27-LargeMemObject.ll15
-rw-r--r--release_23/test/CodeGen/Generic/2007-04-30-LandingPadBranchFolding.ll59
-rw-r--r--release_23/test/CodeGen/Generic/2007-05-03-EHTypeInfo.ll12
-rw-r--r--release_23/test/CodeGen/Generic/2007-05-05-Personality.ll35
-rw-r--r--release_23/test/CodeGen/Generic/2007-05-15-InfiniteRecursion.ll90
-rw-r--r--release_23/test/CodeGen/Generic/2007-06-06-CriticalEdgeLandingPad.ll2866
-rw-r--r--release_23/test/CodeGen/Generic/2007-11-21-UndeadIllegalNode.ll161
-rw-r--r--release_23/test/CodeGen/Generic/2007-12-17-InvokeAsm.ll15
-rw-r--r--release_23/test/CodeGen/Generic/2007-12-31-UnusedSelector.ll36
-rw-r--r--release_23/test/CodeGen/Generic/2008-01-25-dag-combine-mul.ll31
-rw-r--r--release_23/test/CodeGen/Generic/2008-01-30-LoadCrash.ll19
-rw-r--r--release_23/test/CodeGen/Generic/2008-02-04-Ctlz.ll21
-rw-r--r--release_23/test/CodeGen/Generic/2008-02-04-ExtractSubvector.ll14
-rw-r--r--release_23/test/CodeGen/Generic/2008-02-20-MatchingMem.ll9
-rw-r--r--release_23/test/CodeGen/Generic/2008-02-25-NegateZero.ll14
-rw-r--r--release_23/test/CodeGen/Generic/2008-02-26-NegatableCrash.ll50
-rw-r--r--release_23/test/CodeGen/Generic/BasicInstrs.ll54
-rw-r--r--release_23/test/CodeGen/Generic/BurgBadRegAlloc.ll829
-rw-r--r--release_23/test/CodeGen/Generic/ConstantExprLowering.ll22
-rw-r--r--release_23/test/CodeGen/Generic/GC/alloc_loop.ll53
-rw-r--r--release_23/test/CodeGen/Generic/GC/argpromotion.ll19
-rw-r--r--release_23/test/CodeGen/Generic/GC/badreadproto.ll13
-rw-r--r--release_23/test/CodeGen/Generic/GC/badrootproto.ll13
-rw-r--r--release_23/test/CodeGen/Generic/GC/badwriteproto.ll22
-rw-r--r--release_23/test/CodeGen/Generic/GC/deadargelim.ll16
-rw-r--r--release_23/test/CodeGen/Generic/GC/dg.exp3
-rw-r--r--release_23/test/CodeGen/Generic/GC/frame_size.ll14
-rw-r--r--release_23/test/CodeGen/Generic/GC/inline.ll23
-rw-r--r--release_23/test/CodeGen/Generic/GC/inline2.ll24
-rw-r--r--release_23/test/CodeGen/Generic/GC/lower_gcroot.ll11
-rw-r--r--release_23/test/CodeGen/Generic/GC/outside.ll10
-rw-r--r--release_23/test/CodeGen/Generic/GC/redundant_init.ll17
-rw-r--r--release_23/test/CodeGen/Generic/GC/simple_ocaml.ll42
-rw-r--r--release_23/test/CodeGen/Generic/Makefile23
-rw-r--r--release_23/test/CodeGen/Generic/SwitchLowering.ll28
-rw-r--r--release_23/test/CodeGen/Generic/addc-fold2.ll10
-rw-r--r--release_23/test/CodeGen/Generic/asm-large-immediate.ll8
-rw-r--r--release_23/test/CodeGen/Generic/badCallArgLRLLVM.ll31
-rw-r--r--release_23/test/CodeGen/Generic/badFoldGEP.ll27
-rw-r--r--release_23/test/CodeGen/Generic/badarg6.ll32
-rw-r--r--release_23/test/CodeGen/Generic/badlive.ll28
-rw-r--r--release_23/test/CodeGen/Generic/bit-intrinsics.ll32
-rw-r--r--release_23/test/CodeGen/Generic/bool-to-double.ll6
-rw-r--r--release_23/test/CodeGen/Generic/bool-vector.ll11
-rw-r--r--release_23/test/CodeGen/Generic/call-ret0.ll10
-rw-r--r--release_23/test/CodeGen/Generic/call-ret42.ll10
-rw-r--r--release_23/test/CodeGen/Generic/call-void.ll11
-rw-r--r--release_23/test/CodeGen/Generic/call2-ret0.ll16
-rw-r--r--release_23/test/CodeGen/Generic/cast-fp.ll33
-rw-r--r--release_23/test/CodeGen/Generic/constindices.ll44
-rw-r--r--release_23/test/CodeGen/Generic/debug-info.ll19
-rw-r--r--release_23/test/CodeGen/Generic/dg.exp3
-rw-r--r--release_23/test/CodeGen/Generic/div-neg-power-2.ll7
-rw-r--r--release_23/test/CodeGen/Generic/fneg-fabs.ll26
-rw-r--r--release_23/test/CodeGen/Generic/fp_to_int.ll81
-rw-r--r--release_23/test/CodeGen/Generic/fpowi-promote.ll12
-rw-r--r--release_23/test/CodeGen/Generic/fwdtwice.ll29
-rw-r--r--release_23/test/CodeGen/Generic/getresult-undef.ll6
-rw-r--r--release_23/test/CodeGen/Generic/global-ret0.ll8
-rw-r--r--release_23/test/CodeGen/Generic/hello.ll11
-rw-r--r--release_23/test/CodeGen/Generic/i128-addsub.ll39
-rw-r--r--release_23/test/CodeGen/Generic/i128-arith.ll11
-rw-r--r--release_23/test/CodeGen/Generic/intrinsics.ll40
-rw-r--r--release_23/test/CodeGen/Generic/invalid-memcpy.ll19
-rw-r--r--release_23/test/CodeGen/Generic/isunord.ll10
-rw-r--r--release_23/test/CodeGen/Generic/llvm-ct-intrinsics.ll62
-rw-r--r--release_23/test/CodeGen/Generic/multiple-return-values-cross-block-with-invoke.ll18
-rw-r--r--release_23/test/CodeGen/Generic/negintconst.ll47
-rw-r--r--release_23/test/CodeGen/Generic/nested-select.ll19
-rw-r--r--release_23/test/CodeGen/Generic/phi-immediate-factoring.ll54
-rw-r--r--release_23/test/CodeGen/Generic/print-add.ll18
-rw-r--r--release_23/test/CodeGen/Generic/print-arith-fp.ll61
-rw-r--r--release_23/test/CodeGen/Generic/print-arith-int.ll84
-rw-r--r--release_23/test/CodeGen/Generic/print-int.ll13
-rw-r--r--release_23/test/CodeGen/Generic/print-mul-exp.ll55
-rw-r--r--release_23/test/CodeGen/Generic/print-mul.ll32
-rw-r--r--release_23/test/CodeGen/Generic/print-shift.ll34
-rw-r--r--release_23/test/CodeGen/Generic/ret0.ll5
-rw-r--r--release_23/test/CodeGen/Generic/ret42.ll5
-rw-r--r--release_23/test/CodeGen/Generic/sched.ll27
-rw-r--r--release_23/test/CodeGen/Generic/select.ll187
-rw-r--r--release_23/test/CodeGen/Generic/shift-int64.ll12
-rw-r--r--release_23/test/CodeGen/Generic/spillccr.ll49
-rw-r--r--release_23/test/CodeGen/Generic/stacksave-restore.ll14
-rw-r--r--release_23/test/CodeGen/Generic/storetrunc-fp.ll8
-rw-r--r--release_23/test/CodeGen/Generic/switch-crit-edge-constant.ll52
-rw-r--r--release_23/test/CodeGen/Generic/switch-lower-feature-2.ll50
-rw-r--r--release_23/test/CodeGen/Generic/switch-lower-feature.ll29
-rw-r--r--release_23/test/CodeGen/Generic/switch-lower.ll334
-rw-r--r--release_23/test/CodeGen/Generic/trap.ll9
-rw-r--r--release_23/test/CodeGen/Generic/v-split.ll11
-rw-r--r--release_23/test/CodeGen/Generic/vector-constantexpr.ll7
-rw-r--r--release_23/test/CodeGen/Generic/vector-identity-shuffle.ll17
-rw-r--r--release_23/test/CodeGen/Generic/vector.ll154
-rw-r--r--release_23/test/CodeGen/IA64/2005-08-22-LegalizerCrash.ll10
-rw-r--r--release_23/test/CodeGen/IA64/2005-10-29-shladd.ll9
-rw-r--r--release_23/test/CodeGen/IA64/dg.exp5
-rw-r--r--release_23/test/CodeGen/IA64/ret-0.ll5
-rw-r--r--release_23/test/CodeGen/PowerPC/2004-11-29-ShrCrash.ll6
-rw-r--r--release_23/test/CodeGen/PowerPC/2004-11-30-shift-crash.ll7
-rw-r--r--release_23/test/CodeGen/PowerPC/2004-11-30-shr-var-crash.ll9
-rw-r--r--release_23/test/CodeGen/PowerPC/2004-12-12-ZeroSizeCommon.ll4
-rw-r--r--release_23/test/CodeGen/PowerPC/2005-01-14-SetSelectCrash.ll8
-rw-r--r--release_23/test/CodeGen/PowerPC/2005-01-14-UndefLong.ll5
-rw-r--r--release_23/test/CodeGen/PowerPC/2005-08-12-rlwimi-crash.ll13
-rw-r--r--release_23/test/CodeGen/PowerPC/2005-09-02-LegalizeDuplicatesCalls.ll11
-rw-r--r--release_23/test/CodeGen/PowerPC/2005-10-08-ArithmeticRotate.ll11
-rw-r--r--release_23/test/CodeGen/PowerPC/2005-11-30-vastart-crash.ll18
-rw-r--r--release_23/test/CodeGen/PowerPC/2006-01-11-darwin-fp-argument.ll10
-rw-r--r--release_23/test/CodeGen/PowerPC/2006-01-20-ShiftPartsCrash.ll19
-rw-r--r--release_23/test/CodeGen/PowerPC/2006-04-01-FloatDoubleExtend.ll9
-rw-r--r--release_23/test/CodeGen/PowerPC/2006-04-05-splat-ish.ll11
-rw-r--r--release_23/test/CodeGen/PowerPC/2006-04-19-vmaddfp-crash.ll58
-rw-r--r--release_23/test/CodeGen/PowerPC/2006-05-12-rlwimi-crash.ll55
-rw-r--r--release_23/test/CodeGen/PowerPC/2006-07-07-ComputeMaskedBits.ll17
-rw-r--r--release_23/test/CodeGen/PowerPC/2006-07-19-stwbrx-crash.ll11
-rw-r--r--release_23/test/CodeGen/PowerPC/2006-08-11-RetVector.ll8
-rw-r--r--release_23/test/CodeGen/PowerPC/2006-08-15-SelectionCrash.ll30
-rw-r--r--release_23/test/CodeGen/PowerPC/2006-09-28-shift_64.ll25
-rw-r--r--release_23/test/CodeGen/PowerPC/2006-10-11-combiner-aa-regression.ll24
-rw-r--r--release_23/test/CodeGen/PowerPC/2006-10-13-Miscompile.ll16
-rw-r--r--release_23/test/CodeGen/PowerPC/2006-10-17-brcc-miscompile.ll20
-rw-r--r--release_23/test/CodeGen/PowerPC/2006-10-17-ppc64-alloca.ll7
-rw-r--r--release_23/test/CodeGen/PowerPC/2006-11-10-DAGCombineMiscompile.ll13
-rw-r--r--release_23/test/CodeGen/PowerPC/2006-11-29-AltivecFPSplat.ll10
-rw-r--r--release_23/test/CodeGen/PowerPC/2006-12-07-LargeAlloca.ll24
-rw-r--r--release_23/test/CodeGen/PowerPC/2006-12-07-SelectCrash.ll22
-rw-r--r--release_23/test/CodeGen/PowerPC/2007-01-04-ArgExtension.ll10
-rw-r--r--release_23/test/CodeGen/PowerPC/2007-01-15-AsmDialect.ll27
-rw-r--r--release_23/test/CodeGen/PowerPC/2007-01-29-lbrx-asm.ll7
-rw-r--r--release_23/test/CodeGen/PowerPC/2007-01-31-InlineAsmAddrMode.ll24
-rw-r--r--release_23/test/CodeGen/PowerPC/2007-02-16-AlignPacked.ll4
-rw-r--r--release_23/test/CodeGen/PowerPC/2007-02-16-InlineAsmNConstraint.ll11
-rw-r--r--release_23/test/CodeGen/PowerPC/2007-02-23-lr-saved-twice.ll14
-rw-r--r--release_23/test/CodeGen/PowerPC/2007-03-24-cntlzd.ll12
-rw-r--r--release_23/test/CodeGen/PowerPC/2007-03-30-SpillerCrash.ll1801
-rw-r--r--release_23/test/CodeGen/PowerPC/2007-04-24-InlineAsm-I-Modifier.ll14
-rw-r--r--release_23/test/CodeGen/PowerPC/2007-04-30-InlineAsmEarlyClobber.ll27
-rw-r--r--release_23/test/CodeGen/PowerPC/2007-05-03-InlineAsm-S-Constraint.ll12
-rw-r--r--release_23/test/CodeGen/PowerPC/2007-05-14-InlineAsmSelectCrash.ll25
-rw-r--r--release_23/test/CodeGen/PowerPC/2007-05-22-tailmerge-3.ll68
-rw-r--r--release_23/test/CodeGen/PowerPC/2007-05-30-dagcombine-miscomp.ll14
-rw-r--r--release_23/test/CodeGen/PowerPC/2007-06-28-BCCISelBug.ll85
-rw-r--r--release_23/test/CodeGen/PowerPC/2007-08-04-CoalescerAssert.ll28
-rw-r--r--release_23/test/CodeGen/PowerPC/2007-09-04-AltivecDST.ll15
-rw-r--r--release_23/test/CodeGen/PowerPC/2007-09-07-LoadStoreIdxForms.ll16
-rw-r--r--release_23/test/CodeGen/PowerPC/2007-09-08-unaligned.ll53
-rw-r--r--release_23/test/CodeGen/PowerPC/2007-09-11-RegCoalescerAssert.ll9
-rw-r--r--release_23/test/CodeGen/PowerPC/2007-09-12-LiveIntervalsAssert.ll15
-rw-r--r--release_23/test/CodeGen/PowerPC/2007-10-16-InlineAsmFrameOffset.ll14
-rw-r--r--release_23/test/CodeGen/PowerPC/2007-10-18-PtrArithmetic.ll22
-rw-r--r--release_23/test/CodeGen/PowerPC/2007-10-21-LocalRegAllocAssert.ll27
-rw-r--r--release_23/test/CodeGen/PowerPC/2007-10-21-LocalRegAllocAssert2.ll25
-rw-r--r--release_23/test/CodeGen/PowerPC/2007-11-04-CoalescerCrash.ll148
-rw-r--r--release_23/test/CodeGen/PowerPC/2007-11-16-landingpad-split.ll133
-rw-r--r--release_23/test/CodeGen/PowerPC/2007-11-19-VectorSplitting.ll16
-rw-r--r--release_23/test/CodeGen/PowerPC/2008-01-25-EmptyFunction.ll8
-rw-r--r--release_23/test/CodeGen/PowerPC/2008-02-05-LiveIntervalsAssert.ll67
-rw-r--r--release_23/test/CodeGen/PowerPC/2008-02-09-LocalRegAllocAssert.ll10
-rw-r--r--release_23/test/CodeGen/PowerPC/2008-03-05-RegScavengerAssert.ll18
-rw-r--r--release_23/test/CodeGen/PowerPC/2008-03-06-KillInfo.ll21
-rw-r--r--release_23/test/CodeGen/PowerPC/2008-03-17-RegScavengerCrash.ll31
-rw-r--r--release_23/test/CodeGen/PowerPC/2008-03-18-RegScavengerAssert.ll6
-rw-r--r--release_23/test/CodeGen/PowerPC/2008-03-24-AddressRegImm.ll25
-rw-r--r--release_23/test/CodeGen/PowerPC/2008-03-24-CoalescerBug.ll30
-rw-r--r--release_23/test/CodeGen/PowerPC/2008-03-26-CoalescerBug.ll28
-rw-r--r--release_23/test/CodeGen/PowerPC/2008-04-10-LiveIntervalCrash.ll100
-rw-r--r--release_23/test/CodeGen/PowerPC/2008-04-16-CoalescerBug.ll14
-rw-r--r--release_23/test/CodeGen/PowerPC/2008-04-23-CoalescerCrash.ll89
-rw-r--r--release_23/test/CodeGen/PowerPC/2008-05-01-ppc_fp128.ll15
-rw-r--r--release_23/test/CodeGen/PowerPC/Frames-alloca.ll37
-rw-r--r--release_23/test/CodeGen/PowerPC/Frames-large.ll77
-rw-r--r--release_23/test/CodeGen/PowerPC/Frames-leaf.ll37
-rw-r--r--release_23/test/CodeGen/PowerPC/Frames-small.ll33
-rw-r--r--release_23/test/CodeGen/PowerPC/LargeAbsoluteAddr.ll17
-rw-r--r--release_23/test/CodeGen/PowerPC/addc.ll26
-rw-r--r--release_23/test/CodeGen/PowerPC/addi-reassoc.ll19
-rw-r--r--release_23/test/CodeGen/PowerPC/align.ll11
-rw-r--r--release_23/test/CodeGen/PowerPC/and-branch.ll17
-rw-r--r--release_23/test/CodeGen/PowerPC/and-elim.ll18
-rw-r--r--release_23/test/CodeGen/PowerPC/and-imm.ll14
-rw-r--r--release_23/test/CodeGen/PowerPC/and_add.ll15
-rw-r--r--release_23/test/CodeGen/PowerPC/and_sext.ll28
-rw-r--r--release_23/test/CodeGen/PowerPC/and_sra.ll27
-rw-r--r--release_23/test/CodeGen/PowerPC/atomic-1.ll27
-rw-r--r--release_23/test/CodeGen/PowerPC/atomic-2.ll21
-rw-r--r--release_23/test/CodeGen/PowerPC/big-endian-actual-args.ll9
-rw-r--r--release_23/test/CodeGen/PowerPC/big-endian-call-result.ll13
-rw-r--r--release_23/test/CodeGen/PowerPC/big-endian-formal-args.ll15
-rw-r--r--release_23/test/CodeGen/PowerPC/branch-opt.ll71
-rw-r--r--release_23/test/CodeGen/PowerPC/bswap-load-store.ll45
-rw-r--r--release_23/test/CodeGen/PowerPC/buildvec_canonicalize.ll26
-rw-r--r--release_23/test/CodeGen/PowerPC/calls.ll32
-rw-r--r--release_23/test/CodeGen/PowerPC/cmp-cmp.ll13
-rw-r--r--release_23/test/CodeGen/PowerPC/compare-duplicate.ll11
-rw-r--r--release_23/test/CodeGen/PowerPC/compare-fcmp-ord.ll24
-rw-r--r--release_23/test/CodeGen/PowerPC/compare-simm.ll14
-rw-r--r--release_23/test/CodeGen/PowerPC/constants.ll52
-rw-r--r--release_23/test/CodeGen/PowerPC/cttz.ll11
-rw-r--r--release_23/test/CodeGen/PowerPC/darwin-labels.ll6
-rw-r--r--release_23/test/CodeGen/PowerPC/dg.exp5
-rw-r--r--release_23/test/CodeGen/PowerPC/div-2.ll30
-rw-r--r--release_23/test/CodeGen/PowerPC/eqv-andc-orc-nor.ll93
-rw-r--r--release_23/test/CodeGen/PowerPC/extsh.ll8
-rw-r--r--release_23/test/CodeGen/PowerPC/fabs.ll7
-rw-r--r--release_23/test/CodeGen/PowerPC/fma.ll54
-rw-r--r--release_23/test/CodeGen/PowerPC/fnabs.ll10
-rw-r--r--release_23/test/CodeGen/PowerPC/fneg.ll12
-rw-r--r--release_23/test/CodeGen/PowerPC/fnegsel.ll9
-rw-r--r--release_23/test/CodeGen/PowerPC/fold-li.ll15
-rw-r--r--release_23/test/CodeGen/PowerPC/fp-branch.ll21
-rw-r--r--release_23/test/CodeGen/PowerPC/fp-int-fp.ll27
-rw-r--r--release_23/test/CodeGen/PowerPC/fp_to_uint.ll8
-rw-r--r--release_23/test/CodeGen/PowerPC/fpcopy.ll7
-rw-r--r--release_23/test/CodeGen/PowerPC/frounds.ll19
-rw-r--r--release_23/test/CodeGen/PowerPC/fsqrt.ll23
-rw-r--r--release_23/test/CodeGen/PowerPC/hello.ll12
-rw-r--r--release_23/test/CodeGen/PowerPC/i64_fp.ll26
-rw-r--r--release_23/test/CodeGen/PowerPC/iabs.ll15
-rw-r--r--release_23/test/CodeGen/PowerPC/illegal-element-type.ll23
-rw-r--r--release_23/test/CodeGen/PowerPC/inlineasm-copy.ll14
-rw-r--r--release_23/test/CodeGen/PowerPC/int-fp-conv-0.ll17
-rw-r--r--release_23/test/CodeGen/PowerPC/int-fp-conv-1.ll11
-rw-r--r--release_23/test/CodeGen/PowerPC/invalid-memcpy.ll20
-rw-r--r--release_23/test/CodeGen/PowerPC/inverted-bool-compares.ll13
-rw-r--r--release_23/test/CodeGen/PowerPC/ispositive.ll10
-rw-r--r--release_23/test/CodeGen/PowerPC/itofp128.ll14
-rw-r--r--release_23/test/CodeGen/PowerPC/lha.ll8
-rw-r--r--release_23/test/CodeGen/PowerPC/load-constant-addr.ll9
-rw-r--r--release_23/test/CodeGen/PowerPC/long-compare.ll9
-rw-r--r--release_23/test/CodeGen/PowerPC/longdbl-truncate.ll9
-rw-r--r--release_23/test/CodeGen/PowerPC/mask64.ll27
-rw-r--r--release_23/test/CodeGen/PowerPC/mem-rr-addr-mode.ll18
-rw-r--r--release_23/test/CodeGen/PowerPC/mem_update.ll68
-rw-r--r--release_23/test/CodeGen/PowerPC/mul-neg-power-2.ll8
-rw-r--r--release_23/test/CodeGen/PowerPC/mulhs.ll17
-rw-r--r--release_23/test/CodeGen/PowerPC/multiple-return-values.ll17
-rw-r--r--release_23/test/CodeGen/PowerPC/neg.ll7
-rw-r--r--release_23/test/CodeGen/PowerPC/no-dead-strip.ll8
-rw-r--r--release_23/test/CodeGen/PowerPC/or-addressing-mode.ll22
-rw-r--r--release_23/test/CodeGen/PowerPC/ppcf128-1-opt.ll29
-rw-r--r--release_23/test/CodeGen/PowerPC/ppcf128-1.ll92
-rw-r--r--release_23/test/CodeGen/PowerPC/ppcf128-2.ll14
-rw-r--r--release_23/test/CodeGen/PowerPC/ppcf128-3.ll32
-rw-r--r--release_23/test/CodeGen/PowerPC/ppcf128-4.ll10
-rw-r--r--release_23/test/CodeGen/PowerPC/reg-coalesce-simple.ll12
-rw-r--r--release_23/test/CodeGen/PowerPC/retaddr.ll15
-rw-r--r--release_23/test/CodeGen/PowerPC/return-val-i128.ll36
-rw-r--r--release_23/test/CodeGen/PowerPC/rlwimi-commute.ll34
-rw-r--r--release_23/test/CodeGen/PowerPC/rlwimi.ll70
-rw-r--r--release_23/test/CodeGen/PowerPC/rlwimi2.ll29
-rw-r--r--release_23/test/CodeGen/PowerPC/rlwimi3.ll25
-rw-r--r--release_23/test/CodeGen/PowerPC/rlwinm.ll61
-rw-r--r--release_23/test/CodeGen/PowerPC/rlwinm2.ll28
-rw-r--r--release_23/test/CodeGen/PowerPC/rotl-2.ll38
-rw-r--r--release_23/test/CodeGen/PowerPC/rotl-64.ll20
-rw-r--r--release_23/test/CodeGen/PowerPC/rotl.ll37
-rw-r--r--release_23/test/CodeGen/PowerPC/select_lt0.ll50
-rw-r--r--release_23/test/CodeGen/PowerPC/setcc_no_zext.ll9
-rw-r--r--release_23/test/CodeGen/PowerPC/seteq-0.ll10
-rw-r--r--release_23/test/CodeGen/PowerPC/shift128.ll14
-rw-r--r--release_23/test/CodeGen/PowerPC/shl_elim.ll11
-rw-r--r--release_23/test/CodeGen/PowerPC/shl_sext.ll18
-rw-r--r--release_23/test/CodeGen/PowerPC/sign_ext_inreg1.ll12
-rw-r--r--release_23/test/CodeGen/PowerPC/small-arguments.ll52
-rw-r--r--release_23/test/CodeGen/PowerPC/stfiwx-2.ll11
-rw-r--r--release_23/test/CodeGen/PowerPC/stfiwx.ll26
-rw-r--r--release_23/test/CodeGen/PowerPC/store-load-fwd.ll8
-rw-r--r--release_23/test/CodeGen/PowerPC/subc.ll25
-rw-r--r--release_23/test/CodeGen/PowerPC/tailcall1-64.ll11
-rw-r--r--release_23/test/CodeGen/PowerPC/tailcall1.ll11
-rw-r--r--release_23/test/CodeGen/PowerPC/tailcallpic1.ll14
-rw-r--r--release_23/test/CodeGen/PowerPC/unsafe-math.ll10
-rw-r--r--release_23/test/CodeGen/PowerPC/vcmp-fold.ll22
-rw-r--r--release_23/test/CodeGen/PowerPC/vec_br_cmp.ll22
-rw-r--r--release_23/test/CodeGen/PowerPC/vec_call.ll11
-rw-r--r--release_23/test/CodeGen/PowerPC/vec_constants.ll40
-rw-r--r--release_23/test/CodeGen/PowerPC/vec_fneg.ll8
-rw-r--r--release_23/test/CodeGen/PowerPC/vec_insert.ll8
-rw-r--r--release_23/test/CodeGen/PowerPC/vec_misaligned.ll37
-rw-r--r--release_23/test/CodeGen/PowerPC/vec_mul.ll23
-rw-r--r--release_23/test/CodeGen/PowerPC/vec_perf_shuffle.ll36
-rw-r--r--release_23/test/CodeGen/PowerPC/vec_shuffle.ll504
-rw-r--r--release_23/test/CodeGen/PowerPC/vec_spat.ll71
-rw-r--r--release_23/test/CodeGen/PowerPC/vec_vrsave.ll14
-rw-r--r--release_23/test/CodeGen/PowerPC/vec_zero.ll9
-rw-r--r--release_23/test/CodeGen/PowerPC/vector-identity-shuffle.ll17
-rw-r--r--release_23/test/CodeGen/PowerPC/vector.ll158
-rw-r--r--release_23/test/CodeGen/SPARC/2006-01-22-BitConvertLegalize.ll12
-rw-r--r--release_23/test/CodeGen/SPARC/2007-05-09-JumpTables.ll30
-rw-r--r--release_23/test/CodeGen/SPARC/2007-07-05-LiveIntervalAssert.ll11
-rw-r--r--release_23/test/CodeGen/SPARC/basictest.ll6
-rw-r--r--release_23/test/CodeGen/SPARC/ctpop.ll14
-rw-r--r--release_23/test/CodeGen/SPARC/dg.exp5
-rw-r--r--release_23/test/CodeGen/SPARC/xnor.ll15
-rw-r--r--release_23/test/CodeGen/X86/2002-12-23-LocalRAProblem.ll15
-rw-r--r--release_23/test/CodeGen/X86/2002-12-23-SubProblem.ll7
-rw-r--r--release_23/test/CodeGen/X86/2003-08-03-CallArgLiveRanges.ll18
-rw-r--r--release_23/test/CodeGen/X86/2003-08-23-DeadBlockTest.ll12
-rw-r--r--release_23/test/CodeGen/X86/2003-11-03-GlobalBool.ll4
-rw-r--r--release_23/test/CodeGen/X86/2004-02-12-Memcpy.ll25
-rw-r--r--release_23/test/CodeGen/X86/2004-02-13-FrameReturnAddress.ll16
-rw-r--r--release_23/test/CodeGen/X86/2004-02-14-InefficientStackPointer.ll5
-rw-r--r--release_23/test/CodeGen/X86/2004-02-22-Casts.ll12
-rw-r--r--release_23/test/CodeGen/X86/2004-03-30-Select-Max.ll8
-rw-r--r--release_23/test/CodeGen/X86/2004-04-09-SameValueCoalescing.ll13
-rw-r--r--release_23/test/CodeGen/X86/2004-04-13-FPCMOV-Crash.ll7
-rw-r--r--release_23/test/CodeGen/X86/2004-06-10-StackifierCrash.ll6
-rw-r--r--release_23/test/CodeGen/X86/2004-10-08-SelectSetCCFold.ll8
-rw-r--r--release_23/test/CodeGen/X86/2005-01-17-CycleInDAG.ll17
-rw-r--r--release_23/test/CodeGen/X86/2005-02-14-IllegalAssembler.ll5
-rw-r--r--release_23/test/CodeGen/X86/2005-05-08-FPStackifierPHI.ll38
-rw-r--r--release_23/test/CodeGen/X86/2006-01-19-ISelFoldingBug.ll20
-rw-r--r--release_23/test/CodeGen/X86/2006-03-01-InstrSchedBug.ll12
-rw-r--r--release_23/test/CodeGen/X86/2006-03-02-InstrSchedBug.ll12
-rw-r--r--release_23/test/CodeGen/X86/2006-04-04-CrossBlockCrash.ll50
-rw-r--r--release_23/test/CodeGen/X86/2006-04-27-ISelFoldingBug.ll32
-rw-r--r--release_23/test/CodeGen/X86/2006-05-01-SchedCausingSpills.ll76
-rw-r--r--release_23/test/CodeGen/X86/2006-05-02-InstrSched1.ll24
-rw-r--r--release_23/test/CodeGen/X86/2006-05-02-InstrSched2.ll24
-rw-r--r--release_23/test/CodeGen/X86/2006-05-08-CoalesceSubRegClass.ll25
-rw-r--r--release_23/test/CodeGen/X86/2006-05-08-InstrSched.ll26
-rw-r--r--release_23/test/CodeGen/X86/2006-05-11-InstrSched.ll55
-rw-r--r--release_23/test/CodeGen/X86/2006-05-17-VectorArg.ll15
-rw-r--r--release_23/test/CodeGen/X86/2006-05-22-FPSetEQ.ll10
-rw-r--r--release_23/test/CodeGen/X86/2006-05-25-CycleInDAG.ll20
-rw-r--r--release_23/test/CodeGen/X86/2006-07-10-InlineAsmAConstraint.ll8
-rw-r--r--release_23/test/CodeGen/X86/2006-07-12-InlineAsmQConstraint.ll12
-rw-r--r--release_23/test/CodeGen/X86/2006-07-19-ATTAsm.ll48
-rw-r--r--release_23/test/CodeGen/X86/2006-07-20-InlineAsm.ll23
-rw-r--r--release_23/test/CodeGen/X86/2006-07-28-AsmPrint-Long-As-Pointer.ll5
-rw-r--r--release_23/test/CodeGen/X86/2006-07-31-SingleRegClass.ll11
-rw-r--r--release_23/test/CodeGen/X86/2006-08-07-CycleInDAG.ll31
-rw-r--r--release_23/test/CodeGen/X86/2006-08-16-CycleInDAG.ll23
-rw-r--r--release_23/test/CodeGen/X86/2006-08-21-ExtraMovInst.ll17
-rw-r--r--release_23/test/CodeGen/X86/2006-09-01-CycleInDAG.ll131
-rw-r--r--release_23/test/CodeGen/X86/2006-10-02-BoolRetCrash.ll7
-rw-r--r--release_23/test/CodeGen/X86/2006-10-07-ScalarSSEMiscompile.ll15
-rw-r--r--release_23/test/CodeGen/X86/2006-10-09-CycleInDAG.ll11
-rw-r--r--release_23/test/CodeGen/X86/2006-10-10-FindModifiedNodeSlotBug.ll28
-rw-r--r--release_23/test/CodeGen/X86/2006-10-12-CycleInDAG.ll41
-rw-r--r--release_23/test/CodeGen/X86/2006-10-13-CycleInDAG.ll19
-rw-r--r--release_23/test/CodeGen/X86/2006-10-19-SwitchUnnecessaryBranching.ll26
-rw-r--r--release_23/test/CodeGen/X86/2006-11-12-CSRetCC.ll59
-rw-r--r--release_23/test/CodeGen/X86/2006-11-17-IllegalMove.ll43
-rw-r--r--release_23/test/CodeGen/X86/2006-11-27-SelectLegalize.ll9
-rw-r--r--release_23/test/CodeGen/X86/2006-11-28-Memcpy.ll36
-rw-r--r--release_23/test/CodeGen/X86/2006-12-19-IntelSyntax.ll86
-rw-r--r--release_23/test/CodeGen/X86/2007-01-08-InstrSched.ll14
-rw-r--r--release_23/test/CodeGen/X86/2007-01-13-StackPtrIndex.ll461
-rw-r--r--release_23/test/CodeGen/X86/2007-01-29-InlineAsm-ir.ll7
-rw-r--r--release_23/test/CodeGen/X86/2007-02-04-OrAddrMode.ll21
-rw-r--r--release_23/test/CodeGen/X86/2007-02-19-LiveIntervalAssert.ll21
-rw-r--r--release_23/test/CodeGen/X86/2007-02-25-FastCCStack.ll5
-rw-r--r--release_23/test/CodeGen/X86/2007-03-01-SpillerCrash.ll85
-rw-r--r--release_23/test/CodeGen/X86/2007-03-15-GEP-Idx-Sink.ll73
-rw-r--r--release_23/test/CodeGen/X86/2007-03-16-InlineAsm.ll27
-rw-r--r--release_23/test/CodeGen/X86/2007-03-18-LiveIntervalAssert.ll7
-rw-r--r--release_23/test/CodeGen/X86/2007-03-24-InlineAsmMultiRegConstraint.ll11
-rw-r--r--release_23/test/CodeGen/X86/2007-03-24-InlineAsmPModifier.ll10
-rw-r--r--release_23/test/CodeGen/X86/2007-03-24-InlineAsmVectorOp.ll11
-rw-r--r--release_23/test/CodeGen/X86/2007-03-24-InlineAsmXConstraint.ll9
-rw-r--r--release_23/test/CodeGen/X86/2007-03-26-CoalescerBug.ll49
-rw-r--r--release_23/test/CodeGen/X86/2007-04-08-InlineAsmCrash.ll18
-rw-r--r--release_23/test/CodeGen/X86/2007-04-11-InlineAsmVectorResult.ll21
-rw-r--r--release_23/test/CodeGen/X86/2007-04-17-LiveIntervalAssert.ll42
-rw-r--r--release_23/test/CodeGen/X86/2007-04-24-Huge-Stack.ll19
-rw-r--r--release_23/test/CodeGen/X86/2007-04-24-VectorCrash.ll63
-rw-r--r--release_23/test/CodeGen/X86/2007-04-25-MMX-PADDQ.ll25
-rw-r--r--release_23/test/CodeGen/X86/2007-04-27-InlineAsm-IntMemInput.ll12
-rw-r--r--release_23/test/CodeGen/X86/2007-05-05-VecCastExpand.ll21
-rw-r--r--release_23/test/CodeGen/X86/2007-05-07-InvokeSRet.ll15
-rw-r--r--release_23/test/CodeGen/X86/2007-05-14-LiveIntervalAssert.ll27
-rw-r--r--release_23/test/CodeGen/X86/2007-05-15-maskmovq.ll14
-rw-r--r--release_23/test/CodeGen/X86/2007-05-17-ShuffleISelBug.ll23
-rw-r--r--release_23/test/CodeGen/X86/2007-06-04-X86-64-CtorAsmBugs.ll28
-rw-r--r--release_23/test/CodeGen/X86/2007-06-04-tailmerge4.ll454
-rw-r--r--release_23/test/CodeGen/X86/2007-06-05-LSR-Dominator.ll129
-rw-r--r--release_23/test/CodeGen/X86/2007-06-14-branchfold.ll133
-rw-r--r--release_23/test/CodeGen/X86/2007-06-15-IntToMMX.ll17
-rw-r--r--release_23/test/CodeGen/X86/2007-06-28-X86-64-isel.ll16
-rw-r--r--release_23/test/CodeGen/X86/2007-06-29-DAGCombinerBug.ll50
-rw-r--r--release_23/test/CodeGen/X86/2007-06-29-VecFPConstantCSEBug.ll11
-rw-r--r--release_23/test/CodeGen/X86/2007-07-03-GR64ToVR64.ll20
-rw-r--r--release_23/test/CodeGen/X86/2007-07-10-StackerAssert.ll41
-rw-r--r--release_23/test/CodeGen/X86/2007-07-18-Vector-Extract.ll15
-rw-r--r--release_23/test/CodeGen/X86/2007-07-25-EpilogueBug.ll58
-rw-r--r--release_23/test/CodeGen/X86/2007-08-01-LiveVariablesBug.ll8
-rw-r--r--release_23/test/CodeGen/X86/2007-08-09-IllegalX86-64Asm.ll235
-rw-r--r--release_23/test/CodeGen/X86/2007-08-10-SignExtSubreg.ll10
-rw-r--r--release_23/test/CodeGen/X86/2007-08-13-AppendingLinkage.ll12
-rw-r--r--release_23/test/CodeGen/X86/2007-08-13-SpillerReuse.ll102
-rw-r--r--release_23/test/CodeGen/X86/2007-09-03-X86-64-EhSelector.ll38
-rw-r--r--release_23/test/CodeGen/X86/2007-09-05-InvalidAsm.ll49
-rw-r--r--release_23/test/CodeGen/X86/2007-09-06-ExtWeakAliasee.ll4
-rw-r--r--release_23/test/CodeGen/X86/2007-09-17-ObjcFrameEH.ll65
-rw-r--r--release_23/test/CodeGen/X86/2007-09-18-ShuffleXformBug.ll30
-rw-r--r--release_23/test/CodeGen/X86/2007-09-27-LDIntrinsics.ll47
-rw-r--r--release_23/test/CodeGen/X86/2007-10-04-AvoidEFLAGSCopy.ll20
-rw-r--r--release_23/test/CodeGen/X86/2007-10-05-3AddrConvert.ll32
-rw-r--r--release_23/test/CodeGen/X86/2007-10-12-CoalesceExtSubReg.ll35
-rw-r--r--release_23/test/CodeGen/X86/2007-10-12-SpillerUnfold1.ll45
-rw-r--r--release_23/test/CodeGen/X86/2007-10-12-SpillerUnfold2.ll57
-rw-r--r--release_23/test/CodeGen/X86/2007-10-14-CoalescerCrash.ll28
-rw-r--r--release_23/test/CodeGen/X86/2007-10-15-CoalescerCrash.ll400
-rw-r--r--release_23/test/CodeGen/X86/2007-10-16-CoalescerCrash.ll31
-rw-r--r--release_23/test/CodeGen/X86/2007-10-16-IllegalAsm.ll272
-rw-r--r--release_23/test/CodeGen/X86/2007-10-16-fp80_select.ll19
-rw-r--r--release_23/test/CodeGen/X86/2007-10-17-IllegalAsm.ll87
-rw-r--r--release_23/test/CodeGen/X86/2007-10-19-SpillerUnfold.ll84
-rw-r--r--release_23/test/CodeGen/X86/2007-10-28-inlineasm-q-modifier.ll11
-rw-r--r--release_23/test/CodeGen/X86/2007-10-29-ExtendSetCC.ll17
-rw-r--r--release_23/test/CodeGen/X86/2007-10-30-LSRCrash.ll48
-rw-r--r--release_23/test/CodeGen/X86/2007-10-31-extractelement-i64.ll82
-rw-r--r--release_23/test/CodeGen/X86/2007-11-01-ISelCrash.ll12
-rw-r--r--release_23/test/CodeGen/X86/2007-11-02-BadAsm.ll144
-rw-r--r--release_23/test/CodeGen/X86/2007-11-03-x86-64-q-constraint.ll9
-rw-r--r--release_23/test/CodeGen/X86/2007-11-04-LiveIntervalCrash.ll37
-rw-r--r--release_23/test/CodeGen/X86/2007-11-04-LiveVariablesBug.ll16
-rw-r--r--release_23/test/CodeGen/X86/2007-11-04-rip-immediate-constant.ll11
-rw-r--r--release_23/test/CodeGen/X86/2007-11-06-InstrSched.ll25
-rw-r--r--release_23/test/CodeGen/X86/2007-11-07-MulBy4.ll129
-rw-r--r--release_23/test/CodeGen/X86/2007-11-14-Coalescer-Bug.ll67
-rw-r--r--release_23/test/CodeGen/X86/2007-11-30-LoadFolding-Bug.ll81
-rw-r--r--release_23/test/CodeGen/X86/2007-11-30-TestLoadFolding.ll58
-rw-r--r--release_23/test/CodeGen/X86/2007-12-11-FoldImpDefSpill.ll680
-rw-r--r--release_23/test/CodeGen/X86/2007-12-16-BURRSchedCrash.ll35
-rw-r--r--release_23/test/CodeGen/X86/2007-12-18-LoadCSEBug.ll28
-rw-r--r--release_23/test/CodeGen/X86/2008-01-08-IllegalCMP.ll17
-rw-r--r--release_23/test/CodeGen/X86/2008-01-08-SchedulerCrash.ll32
-rw-r--r--release_23/test/CodeGen/X86/2008-01-09-LongDoubleSin.ll11
-rw-r--r--release_23/test/CodeGen/X86/2008-01-16-FPStackifierAssert.ll35
-rw-r--r--release_23/test/CodeGen/X86/2008-01-16-InvalidDAGCombineXform.ll30
-rw-r--r--release_23/test/CodeGen/X86/2008-01-16-Trampoline.ll14
-rw-r--r--release_23/test/CodeGen/X86/2008-01-25-EmptyFunction.ll8
-rw-r--r--release_23/test/CodeGen/X86/2008-02-05-ISelCrash.ll12
-rw-r--r--release_23/test/CodeGen/X86/2008-02-06-LoadFoldingBug.ll20
-rw-r--r--release_23/test/CodeGen/X86/2008-02-08-LoadFoldingBug.ll99
-rw-r--r--release_23/test/CodeGen/X86/2008-02-14-BitMiscompile.ll8
-rw-r--r--release_23/test/CodeGen/X86/2008-02-18-TailMergingBug.ll219
-rw-r--r--release_23/test/CodeGen/X86/2008-02-20-InlineAsmClobber.ll24
-rw-r--r--release_23/test/CodeGen/X86/2008-02-22-LocalRegAllocBug.ll55
-rw-r--r--release_23/test/CodeGen/X86/2008-02-22-ReMatBug.ll50
-rw-r--r--release_23/test/CodeGen/X86/2008-02-25-InlineAsmBug.ll33
-rw-r--r--release_23/test/CodeGen/X86/2008-02-25-X86-64-CoalescerBug.ll55
-rw-r--r--release_23/test/CodeGen/X86/2008-02-26-AsmDirectMemOp.ll17
-rw-r--r--release_23/test/CodeGen/X86/2008-02-27-DeadSlotElimBug.ll66
-rw-r--r--release_23/test/CodeGen/X86/2008-02-27-PEICrash.ll33
-rw-r--r--release_23/test/CodeGen/X86/2008-03-06-frem-fpstack.ll7
-rw-r--r--release_23/test/CodeGen/X86/2008-03-07-APIntBug.ll94
-rw-r--r--release_23/test/CodeGen/X86/2008-03-10-RegAllocInfLoop.ll15
-rw-r--r--release_23/test/CodeGen/X86/2008-03-12-ThreadLocalAlias.ll37
-rw-r--r--release_23/test/CodeGen/X86/2008-03-13-TwoAddrPassCrash.ll68
-rw-r--r--release_23/test/CodeGen/X86/2008-03-14-SpillerCrash.ll48
-rw-r--r--release_23/test/CodeGen/X86/2008-03-18-CoalescerBug.ll51
-rw-r--r--release_23/test/CodeGen/X86/2008-03-19-DAGCombinerBug.ll14
-rw-r--r--release_23/test/CodeGen/X86/2008-03-23-DarwinAsmComments.ll49
-rw-r--r--release_23/test/CodeGen/X86/2008-03-25-TwoAddrPassBug.ll24
-rw-r--r--release_23/test/CodeGen/X86/2008-03-31-SpillerFoldingBug.ll40
-rw-r--r--release_23/test/CodeGen/X86/2008-04-02-unnamedEH.ll27
-rw-r--r--release_23/test/CodeGen/X86/2008-04-08-CoalescerCrash.ll19
-rw-r--r--release_23/test/CodeGen/X86/2008-04-09-BranchFolding.ll48
-rw-r--r--release_23/test/CodeGen/X86/2008-04-15-LiveVariableBug.ll49
-rw-r--r--release_23/test/CodeGen/X86/2008-04-16-CoalescerBug.ll33
-rw-r--r--release_23/test/CodeGen/X86/2008-04-16-ReMatBug.ll46
-rw-r--r--release_23/test/CodeGen/X86/2008-04-17-CoalescerBug.ll171
-rw-r--r--release_23/test/CodeGen/X86/2008-04-24-MemCpyBug.ll12
-rw-r--r--release_23/test/CodeGen/X86/2008-04-24-pblendw-fold-crash.ll15
-rw-r--r--release_23/test/CodeGen/X86/2008-04-26-Asm-Optimize-Imm.ll11
-rw-r--r--release_23/test/CodeGen/X86/2008-04-28-CoalescerBug.ll166
-rw-r--r--release_23/test/CodeGen/X86/2008-04-28-CyclicSchedUnit.ll6
-rw-r--r--release_23/test/CodeGen/X86/2008-05-01-InvalidOrdCompare.ll15
-rw-r--r--release_23/test/CodeGen/X86/2008-05-06-SpillerBug.ll37
-rw-r--r--release_23/test/CodeGen/X86/2008-05-09-PHIElimBug.ll25
-rw-r--r--release_23/test/CodeGen/X86/2008-05-09-ShuffleLoweringBug.ll10
-rw-r--r--release_23/test/CodeGen/X86/aliases.ll38
-rw-r--r--release_23/test/CodeGen/X86/aligned-comm.ll8
-rw-r--r--release_23/test/CodeGen/X86/all-ones-vector.ll14
-rw-r--r--release_23/test/CodeGen/X86/alloca-align-rounding.ll16
-rw-r--r--release_23/test/CodeGen/X86/and-or-fold.ll14
-rw-r--r--release_23/test/CodeGen/X86/arg-cast.ll18
-rw-r--r--release_23/test/CodeGen/X86/asm-block-labels.ll41
-rw-r--r--release_23/test/CodeGen/X86/asm-global-imm.ll23
-rw-r--r--release_23/test/CodeGen/X86/atomic_op.ll93
-rw-r--r--release_23/test/CodeGen/X86/bitcast-int-to-vector.ll10
-rw-r--r--release_23/test/CodeGen/X86/bitcast.ll24
-rw-r--r--release_23/test/CodeGen/X86/bitcast2.ll13
-rw-r--r--release_23/test/CodeGen/X86/bswap.ll27
-rw-r--r--release_23/test/CodeGen/X86/byval.ll13
-rw-r--r--release_23/test/CodeGen/X86/byval2.ll22
-rw-r--r--release_23/test/CodeGen/X86/byval3.ll30
-rw-r--r--release_23/test/CodeGen/X86/byval4.ll36
-rw-r--r--release_23/test/CodeGen/X86/byval5.ll44
-rw-r--r--release_23/test/CodeGen/X86/byval6.ll16
-rw-r--r--release_23/test/CodeGen/X86/byval7.ll15
-rw-r--r--release_23/test/CodeGen/X86/call-push.ll24
-rw-r--r--release_23/test/CodeGen/X86/clz.ll26
-rw-r--r--release_23/test/CodeGen/X86/cmp-test.ll27
-rw-r--r--release_23/test/CodeGen/X86/cmp0.ll7
-rw-r--r--release_23/test/CodeGen/X86/cmp1.ll7
-rw-r--r--release_23/test/CodeGen/X86/coalescer-commute1.ll26
-rw-r--r--release_23/test/CodeGen/X86/coalescer-commute2.ll34
-rw-r--r--release_23/test/CodeGen/X86/coalescer-commute3.ll24
-rw-r--r--release_23/test/CodeGen/X86/coalescer-commute4.ll30
-rw-r--r--release_23/test/CodeGen/X86/coalescer-commute5.ll21
-rw-r--r--release_23/test/CodeGen/X86/commute-two-addr.ll25
-rw-r--r--release_23/test/CodeGen/X86/compare-add.ll8
-rw-r--r--release_23/test/CodeGen/X86/compare_folding.ll11
-rw-r--r--release_23/test/CodeGen/X86/constant-pool-remat-0.ll13
-rw-r--r--release_23/test/CodeGen/X86/copysign-zero.ll14
-rw-r--r--release_23/test/CodeGen/X86/dagcombine-cse.ll27
-rw-r--r--release_23/test/CodeGen/X86/darwin-bzero.ll8
-rw-r--r--release_23/test/CodeGen/X86/darwin-no-dead-strip.ll7
-rw-r--r--release_23/test/CodeGen/X86/dg.exp5
-rw-r--r--release_23/test/CodeGen/X86/div_const.ll7
-rw-r--r--release_23/test/CodeGen/X86/divrem.ll58
-rw-r--r--release_23/test/CodeGen/X86/dollar-name.ll17
-rw-r--r--release_23/test/CodeGen/X86/dyn-stackalloc.ll16
-rw-r--r--release_23/test/CodeGen/X86/epilogue.ll11
-rw-r--r--release_23/test/CodeGen/X86/extend.ll18
-rw-r--r--release_23/test/CodeGen/X86/extern_weak.ll13
-rw-r--r--release_23/test/CodeGen/X86/extmul128.ll14
-rw-r--r--release_23/test/CodeGen/X86/extmul64.ll14
-rw-r--r--release_23/test/CodeGen/X86/extractelement-from-arg.ll7
-rw-r--r--release_23/test/CodeGen/X86/fabs.ll29
-rw-r--r--release_23/test/CodeGen/X86/fast-cc-callee-pops.ll8
-rw-r--r--release_23/test/CodeGen/X86/fast-cc-merge-stack-adj.ll13
-rw-r--r--release_23/test/CodeGen/X86/fast-cc-pass-in-regs.ll15
-rw-r--r--release_23/test/CodeGen/X86/fastcall-correct-mangling.ll9
-rw-r--r--release_23/test/CodeGen/X86/field-extract-use-trunc.ll39
-rw-r--r--release_23/test/CodeGen/X86/fildll.ll12
-rw-r--r--release_23/test/CodeGen/X86/fold-and-shift.ll21
-rw-r--r--release_23/test/CodeGen/X86/fold-load.ll27
-rw-r--r--release_23/test/CodeGen/X86/fold-mul-lohi.ll30
-rw-r--r--release_23/test/CodeGen/X86/fp-immediate-shorten.ll9
-rw-r--r--release_23/test/CodeGen/X86/fp-in-intregs.ll21
-rw-r--r--release_23/test/CodeGen/X86/fp-stack-2results.ll60
-rw-r--r--release_23/test/CodeGen/X86/fp-stack-compare.ll12
-rw-r--r--release_23/test/CodeGen/X86/fp-stack-direct-ret.ll11
-rw-r--r--release_23/test/CodeGen/X86/fp-stack-ret-conv.ll17
-rw-r--r--release_23/test/CodeGen/X86/fp-stack-ret-store.ll26
-rw-r--r--release_23/test/CodeGen/X86/fp-stack-ret.ll26
-rw-r--r--release_23/test/CodeGen/X86/fp-stack-retcopy.ll12
-rw-r--r--release_23/test/CodeGen/X86/fp2sint.ll18
-rw-r--r--release_23/test/CodeGen/X86/fp_constant_op.ll35
-rw-r--r--release_23/test/CodeGen/X86/fp_load_cast_fold.ll20
-rw-r--r--release_23/test/CodeGen/X86/fp_load_fold.ll40
-rw-r--r--release_23/test/CodeGen/X86/fsxor-alignment.ll14
-rw-r--r--release_23/test/CodeGen/X86/hidden-vis.ll20
-rw-r--r--release_23/test/CodeGen/X86/i128-immediate.ll5
-rw-r--r--release_23/test/CodeGen/X86/i128-mul.ll12
-rw-r--r--release_23/test/CodeGen/X86/i128-ret.ll8
-rw-r--r--release_23/test/CodeGen/X86/iabs.ll17
-rw-r--r--release_23/test/CodeGen/X86/illegal-insert.ll18
-rw-r--r--release_23/test/CodeGen/X86/illegal-vector-args-return.ll14
-rw-r--r--release_23/test/CodeGen/X86/imp-def-copies.ll29
-rw-r--r--release_23/test/CodeGen/X86/imul-lea.ll10
-rw-r--r--release_23/test/CodeGen/X86/inline-asm-fpstack.ll43
-rw-r--r--release_23/test/CodeGen/X86/inline-asm-mrv.ll35
-rw-r--r--release_23/test/CodeGen/X86/inline-asm-x-scalar.ll24
-rw-r--r--release_23/test/CodeGen/X86/inline-asm.ll21
-rw-r--r--release_23/test/CodeGen/X86/ins_subreg_coalesce-1.ll24
-rw-r--r--release_23/test/CodeGen/X86/ins_subreg_coalesce-2.ll7
-rw-r--r--release_23/test/CodeGen/X86/ins_subreg_coalesce-3.ll93
-rw-r--r--release_23/test/CodeGen/X86/insertelement-copytoregs.ll11
-rw-r--r--release_23/test/CodeGen/X86/invalid-shift-immediate.ll30
-rw-r--r--release_23/test/CodeGen/X86/isel-sink.ll18
-rw-r--r--release_23/test/CodeGen/X86/isnan.ll11
-rw-r--r--release_23/test/CodeGen/X86/isnan.llx9
-rw-r--r--release_23/test/CodeGen/X86/ispositive.ll9
-rw-r--r--release_23/test/CodeGen/X86/jump_sign.ll20
-rw-r--r--release_23/test/CodeGen/X86/ldzero.ll43
-rw-r--r--release_23/test/CodeGen/X86/lea-2.ll13
-rw-r--r--release_23/test/CodeGen/X86/lea-3.ll20
-rw-r--r--release_23/test/CodeGen/X86/lea-recursion.ll47
-rw-r--r--release_23/test/CodeGen/X86/lea.ll9
-rw-r--r--release_23/test/CodeGen/X86/lfence.ll8
-rw-r--r--release_23/test/CodeGen/X86/long-setcc.ll18
-rw-r--r--release_23/test/CodeGen/X86/longlong-deadload.ll11
-rw-r--r--release_23/test/CodeGen/X86/loop-hoist.ll26
-rw-r--r--release_23/test/CodeGen/X86/loop-strength-reduce.ll29
-rw-r--r--release_23/test/CodeGen/X86/loop-strength-reduce2.ll29
-rw-r--r--release_23/test/CodeGen/X86/loop-strength-reduce3.ll37
-rw-r--r--release_23/test/CodeGen/X86/loop-strength-reduce4.ll49
-rw-r--r--release_23/test/CodeGen/X86/loop-strength-reduce5.ll23
-rw-r--r--release_23/test/CodeGen/X86/loop-strength-reduce6.ll66
-rw-r--r--release_23/test/CodeGen/X86/lsr-negative-stride.ll49
-rw-r--r--release_23/test/CodeGen/X86/memcpy.ll17
-rw-r--r--release_23/test/CodeGen/X86/memmove-0.ll9
-rw-r--r--release_23/test/CodeGen/X86/memmove-1.ll9
-rw-r--r--release_23/test/CodeGen/X86/memmove-2.ll9
-rw-r--r--release_23/test/CodeGen/X86/memmove-3.ll9
-rw-r--r--release_23/test/CodeGen/X86/memset64-on-x86-32.ll13
-rw-r--r--release_23/test/CodeGen/X86/mfence.ll20
-rw-r--r--release_23/test/CodeGen/X86/mingw-alloca.ll27
-rw-r--r--release_23/test/CodeGen/X86/mmx-arg-passing.ll24
-rw-r--r--release_23/test/CodeGen/X86/mmx-arg-passing2.ll24
-rw-r--r--release_23/test/CodeGen/X86/mmx-arith.ll131
-rw-r--r--release_23/test/CodeGen/X86/mmx-bitcast-to-i64.ll26
-rw-r--r--release_23/test/CodeGen/X86/mmx-copy-gprs.ll15
-rw-r--r--release_23/test/CodeGen/X86/mmx-emms.ll11
-rw-r--r--release_23/test/CodeGen/X86/mmx-insert-element.ll23
-rw-r--r--release_23/test/CodeGen/X86/mmx-punpckhdq.ll14
-rw-r--r--release_23/test/CodeGen/X86/mmx-shift.ll32
-rw-r--r--release_23/test/CodeGen/X86/mmx-shuffle.ll29
-rw-r--r--release_23/test/CodeGen/X86/mul-legalize.ll27
-rw-r--r--release_23/test/CodeGen/X86/mul-remat.ll8
-rw-r--r--release_23/test/CodeGen/X86/mul-shift-reassoc.ll12
-rw-r--r--release_23/test/CodeGen/X86/mul128.ll6
-rw-r--r--release_23/test/CodeGen/X86/mul64.ll6
-rw-r--r--release_23/test/CodeGen/X86/multiple-return-values-cross-block.ll15
-rw-r--r--release_23/test/CodeGen/X86/multiple-return-values.ll16
-rw-r--r--release_23/test/CodeGen/X86/nancvt.ll180
-rw-r--r--release_23/test/CodeGen/X86/negative-sin.ll12
-rw-r--r--release_23/test/CodeGen/X86/negative_zero.ll6
-rw-r--r--release_23/test/CodeGen/X86/nofence.ll27
-rw-r--r--release_23/test/CodeGen/X86/opt-ext-uses.ll19
-rw-r--r--release_23/test/CodeGen/X86/or-branch.ll19
-rw-r--r--release_23/test/CodeGen/X86/overlap-shift.ll19
-rw-r--r--release_23/test/CodeGen/X86/packed_struct.ll33
-rw-r--r--release_23/test/CodeGen/X86/peep-vector-extract-concat.ll6
-rw-r--r--release_23/test/CodeGen/X86/peep-vector-extract-insert.ll12
-rw-r--r--release_23/test/CodeGen/X86/pic-1.ll19
-rw-r--r--release_23/test/CodeGen/X86/pic-2.ll18
-rw-r--r--release_23/test/CodeGen/X86/pic-3.ll15
-rw-r--r--release_23/test/CodeGen/X86/pic-4.ll22
-rw-r--r--release_23/test/CodeGen/X86/pic-5.ll14
-rw-r--r--release_23/test/CodeGen/X86/pic-6.ll18
-rw-r--r--release_23/test/CodeGen/X86/pic-cpool.ll14
-rw-r--r--release_23/test/CodeGen/X86/pic-jtbl.ll58
-rw-r--r--release_23/test/CodeGen/X86/pic-load-remat.ll47
-rw-r--r--release_23/test/CodeGen/X86/pic_jumptable.ll76
-rw-r--r--release_23/test/CodeGen/X86/postalloc-coalescing.ll35
-rw-r--r--release_23/test/CodeGen/X86/pr1462.ll25
-rw-r--r--release_23/test/CodeGen/X86/pr1489.ll55
-rw-r--r--release_23/test/CodeGen/X86/pr1505.ll12
-rw-r--r--release_23/test/CodeGen/X86/pr1505b.ll59
-rw-r--r--release_23/test/CodeGen/X86/pr2177.ll35
-rw-r--r--release_23/test/CodeGen/X86/pr2182.ll24
-rw-r--r--release_23/test/CodeGen/X86/prefetch.ll15
-rw-r--r--release_23/test/CodeGen/X86/rdtsc.ll8
-rw-r--r--release_23/test/CodeGen/X86/regpressure.ll114
-rw-r--r--release_23/test/CodeGen/X86/rem.ll22
-rw-r--r--release_23/test/CodeGen/X86/rotate.ll100
-rw-r--r--release_23/test/CodeGen/X86/rotate2.ll19
-rw-r--r--release_23/test/CodeGen/X86/scalar-min-max-fill-operand.ll20
-rw-r--r--release_23/test/CodeGen/X86/scalar_sse_minmax.ll44
-rw-r--r--release_23/test/CodeGen/X86/select-zero-one.ll25
-rw-r--r--release_23/test/CodeGen/X86/select.ll63
-rw-r--r--release_23/test/CodeGen/X86/setuge.ll13
-rw-r--r--release_23/test/CodeGen/X86/sext-load.ll9
-rw-r--r--release_23/test/CodeGen/X86/sext-select.ll23
-rw-r--r--release_23/test/CodeGen/X86/sfence.ll8
-rw-r--r--release_23/test/CodeGen/X86/shift-coalesce.ll15
-rw-r--r--release_23/test/CodeGen/X86/shift-codegen.ll27
-rw-r--r--release_23/test/CodeGen/X86/shift-combine.ll15
-rw-r--r--release_23/test/CodeGen/X86/shift-double.ll41
-rw-r--r--release_23/test/CodeGen/X86/shift-folding.ll23
-rw-r--r--release_23/test/CodeGen/X86/shift-one.ll10
-rw-r--r--release_23/test/CodeGen/X86/shl_elim.ll13
-rw-r--r--release_23/test/CodeGen/X86/shrink-fp-const1.ll7
-rw-r--r--release_23/test/CodeGen/X86/shrink-fp-const2.ll7
-rw-r--r--release_23/test/CodeGen/X86/sincos.ll50
-rw-r--r--release_23/test/CodeGen/X86/small-byval-memcpy.ll22
-rw-r--r--release_23/test/CodeGen/X86/split-select.ll7
-rw-r--r--release_23/test/CodeGen/X86/split-vector-rem.ll15
-rw-r--r--release_23/test/CodeGen/X86/sse-align-0.ll12
-rw-r--r--release_23/test/CodeGen/X86/sse-align-1.ll10
-rw-r--r--release_23/test/CodeGen/X86/sse-align-10.ll6
-rw-r--r--release_23/test/CodeGen/X86/sse-align-11.ll12
-rw-r--r--release_23/test/CodeGen/X86/sse-align-12.ll48
-rw-r--r--release_23/test/CodeGen/X86/sse-align-2.ll12
-rw-r--r--release_23/test/CodeGen/X86/sse-align-3.ll10
-rw-r--r--release_23/test/CodeGen/X86/sse-align-4.ll10
-rw-r--r--release_23/test/CodeGen/X86/sse-align-5.ll6
-rw-r--r--release_23/test/CodeGen/X86/sse-align-6.ll7
-rw-r--r--release_23/test/CodeGen/X86/sse-align-7.ll6
-rw-r--r--release_23/test/CodeGen/X86/sse-align-8.ll6
-rw-r--r--release_23/test/CodeGen/X86/sse-align-9.ll10
-rw-r--r--release_23/test/CodeGen/X86/sse-fcopysign.ll16
-rw-r--r--release_23/test/CodeGen/X86/sse-load-ret.ll21
-rw-r--r--release_23/test/CodeGen/X86/sse-varargs.ll9
-rw-r--r--release_23/test/CodeGen/X86/sse41-extractps-bitcast-0.ll12
-rw-r--r--release_23/test/CodeGen/X86/sse41-extractps-bitcast-1.ll19
-rw-r--r--release_23/test/CodeGen/X86/sse_reload_fold.ll124
-rw-r--r--release_23/test/CodeGen/X86/stack-align.ll22
-rw-r--r--release_23/test/CodeGen/X86/store-fp-constant.ll19
-rw-r--r--release_23/test/CodeGen/X86/store-global-address.ll10
-rw-r--r--release_23/test/CodeGen/X86/store_op_load_fold.ll13
-rw-r--r--release_23/test/CodeGen/X86/store_op_load_fold2.ll34
-rw-r--r--release_23/test/CodeGen/X86/storetrunc-fp.ll8
-rw-r--r--release_23/test/CodeGen/X86/stride-nine-with-base-reg.ll34
-rw-r--r--release_23/test/CodeGen/X86/stride-reuse.ll30
-rw-r--r--release_23/test/CodeGen/X86/tailcall1.ll11
-rw-r--r--release_23/test/CodeGen/X86/tailcallbyval.ll19
-rw-r--r--release_23/test/CodeGen/X86/tailcallbyval64.ll29
-rw-r--r--release_23/test/CodeGen/X86/tailcallpic1.ll12
-rw-r--r--release_23/test/CodeGen/X86/tailcallpic2.ll12
-rw-r--r--release_23/test/CodeGen/X86/tailcallstack64.ll21
-rw-r--r--release_23/test/CodeGen/X86/test-nofold.ll29
-rw-r--r--release_23/test/CodeGen/X86/tls1.ll19
-rw-r--r--release_23/test/CodeGen/X86/tls2.ll19
-rw-r--r--release_23/test/CodeGen/X86/trap.ll9
-rw-r--r--release_23/test/CodeGen/X86/trunc-to-bool.ll60
-rw-r--r--release_23/test/CodeGen/X86/twoaddr-pass-sink.ll29
-rw-r--r--release_23/test/CodeGen/X86/urem-i8-constant.ll6
-rw-r--r--release_23/test/CodeGen/X86/v4f32-immediate.ll5
-rw-r--r--release_23/test/CodeGen/X86/variable-sized-darwin-bzero.ll8
-rw-r--r--release_23/test/CodeGen/X86/vec_add.ll7
-rw-r--r--release_23/test/CodeGen/X86/vec_align.ll35
-rw-r--r--release_23/test/CodeGen/X86/vec_call.ll13
-rw-r--r--release_23/test/CodeGen/X86/vec_clear.ll10
-rw-r--r--release_23/test/CodeGen/X86/vec_ctbits.ll18
-rw-r--r--release_23/test/CodeGen/X86/vec_extract-sse4.ll30
-rw-r--r--release_23/test/CodeGen/X86/vec_extract.ll36
-rw-r--r--release_23/test/CodeGen/X86/vec_fneg.ll11
-rw-r--r--release_23/test/CodeGen/X86/vec_ins_extract.ll51
-rw-r--r--release_23/test/CodeGen/X86/vec_insert-2.ll26
-rw-r--r--release_23/test/CodeGen/X86/vec_insert-3.ll6
-rw-r--r--release_23/test/CodeGen/X86/vec_insert.ll19
-rw-r--r--release_23/test/CodeGen/X86/vec_insert_4.ll11
-rw-r--r--release_23/test/CodeGen/X86/vec_logical.ll42
-rw-r--r--release_23/test/CodeGen/X86/vec_return.ll12
-rw-r--r--release_23/test/CodeGen/X86/vec_select.ll12
-rw-r--r--release_23/test/CodeGen/X86/vec_set-2.ll19
-rw-r--r--release_23/test/CodeGen/X86/vec_set-3.ll17
-rw-r--r--release_23/test/CodeGen/X86/vec_set-4.ll24
-rw-r--r--release_23/test/CodeGen/X86/vec_set-5.ll29
-rw-r--r--release_23/test/CodeGen/X86/vec_set-6.ll12
-rw-r--r--release_23/test/CodeGen/X86/vec_set-7.ll11
-rw-r--r--release_23/test/CodeGen/X86/vec_set-8.ll10
-rw-r--r--release_23/test/CodeGen/X86/vec_set-9.ll9
-rw-r--r--release_23/test/CodeGen/X86/vec_set-A.ll6
-rw-r--r--release_23/test/CodeGen/X86/vec_set-B.ll24
-rw-r--r--release_23/test/CodeGen/X86/vec_set-C.ll8
-rw-r--r--release_23/test/CodeGen/X86/vec_set-D.ll7
-rw-r--r--release_23/test/CodeGen/X86/vec_set-E.ll9
-rw-r--r--release_23/test/CodeGen/X86/vec_set-F.ll19
-rw-r--r--release_23/test/CodeGen/X86/vec_set-G.ll9
-rw-r--r--release_23/test/CodeGen/X86/vec_set.ll15
-rw-r--r--release_23/test/CodeGen/X86/vec_shift.ll34
-rw-r--r--release_23/test/CodeGen/X86/vec_shift2.ll17
-rw-r--r--release_23/test/CodeGen/X86/vec_shift3.ll26
-rw-r--r--release_23/test/CodeGen/X86/vec_shuffle-10.ll27
-rw-r--r--release_23/test/CodeGen/X86/vec_shuffle-11.ll11
-rw-r--r--release_23/test/CodeGen/X86/vec_shuffle-12.ll28
-rw-r--r--release_23/test/CodeGen/X86/vec_shuffle-13.ll21
-rw-r--r--release_23/test/CodeGen/X86/vec_shuffle-14.ll42
-rw-r--r--release_23/test/CodeGen/X86/vec_shuffle-15.ll81
-rw-r--r--release_23/test/CodeGen/X86/vec_shuffle-16.ll25
-rw-r--r--release_23/test/CodeGen/X86/vec_shuffle-17.ll13
-rw-r--r--release_23/test/CodeGen/X86/vec_shuffle-2.ll47
-rw-r--r--release_23/test/CodeGen/X86/vec_shuffle-3.ll21
-rw-r--r--release_23/test/CodeGen/X86/vec_shuffle-4.ll12
-rw-r--r--release_23/test/CodeGen/X86/vec_shuffle-5.ll13
-rw-r--r--release_23/test/CodeGen/X86/vec_shuffle-6.ll42
-rw-r--r--release_23/test/CodeGen/X86/vec_shuffle-7.ll11
-rw-r--r--release_23/test/CodeGen/X86/vec_shuffle-8.ll10
-rw-r--r--release_23/test/CodeGen/X86/vec_shuffle-9.ll20
-rw-r--r--release_23/test/CodeGen/X86/vec_shuffle.ll44
-rw-r--r--release_23/test/CodeGen/X86/vec_splat-2.ll26
-rw-r--r--release_23/test/CodeGen/X86/vec_splat.ll22
-rw-r--r--release_23/test/CodeGen/X86/vec_ss_load_fold.ll41
-rw-r--r--release_23/test/CodeGen/X86/vec_zero-2.ll24
-rw-r--r--release_23/test/CodeGen/X86/vec_zero.ll16
-rw-r--r--release_23/test/CodeGen/X86/vec_zero_cse.ll35
-rw-r--r--release_23/test/CodeGen/X86/vector-intrinsics.ll27
-rw-r--r--release_23/test/CodeGen/X86/vector-rem.ll15
-rw-r--r--release_23/test/CodeGen/X86/vector.ll156
-rw-r--r--release_23/test/CodeGen/X86/weak.ll4
-rw-r--r--release_23/test/CodeGen/X86/x86-64-and-mask.ll12
-rw-r--r--release_23/test/CodeGen/X86/x86-64-arg.ll15
-rw-r--r--release_23/test/CodeGen/X86/x86-64-asm.ll12
-rw-r--r--release_23/test/CodeGen/X86/x86-64-dead-stack-adjust.ll12
-rw-r--r--release_23/test/CodeGen/X86/x86-64-gv-offset.ll14
-rw-r--r--release_23/test/CodeGen/X86/x86-64-mem.ll37
-rw-r--r--release_23/test/CodeGen/X86/x86-64-ret0.ll8
-rw-r--r--release_23/test/CodeGen/X86/x86-64-shortint.ll12
-rw-r--r--release_23/test/CodeGen/X86/x86-64-sret-return.ll54
-rw-r--r--release_23/test/CodeGen/X86/x86-64-varargs.ll11
-rw-r--r--release_23/test/CodeGen/X86/xmm-r64.ll12
-rw-r--r--release_23/test/CodeGen/X86/xor-undef.ll11
-rw-r--r--release_23/test/CodeGen/X86/xor_not.ll74
-rw-r--r--release_23/test/CodeGen/X86/xorl.ll85
-rw-r--r--release_23/test/CodeGen/X86/zero-remat.ll16
-rw-r--r--release_23/test/DebugInfo/dg.exp3
-rw-r--r--release_23/test/DebugInfo/funccall.ll147
-rw-r--r--release_23/test/DebugInfo/globalGetElementPtr.ll264
-rw-r--r--release_23/test/ExecutionEngine/2002-12-16-ArgTest.ll38
-rw-r--r--release_23/test/ExecutionEngine/2003-01-04-ArgumentBug.ll14
-rw-r--r--release_23/test/ExecutionEngine/2003-01-04-LoopTest.ll21
-rw-r--r--release_23/test/ExecutionEngine/2003-01-04-PhiTest.ll13
-rw-r--r--release_23/test/ExecutionEngine/2003-01-09-SARTest.ll12
-rw-r--r--release_23/test/ExecutionEngine/2003-01-10-FUCOM.ll11
-rw-r--r--release_23/test/ExecutionEngine/2003-01-15-AlignmentTest.ll18
-rw-r--r--release_23/test/ExecutionEngine/2003-05-06-LivenessClobber.ll19
-rw-r--r--release_23/test/ExecutionEngine/2003-05-07-ArgumentTest.ll11
-rw-r--r--release_23/test/ExecutionEngine/2003-05-11-PHIRegAllocBug.ll16
-rw-r--r--release_23/test/ExecutionEngine/2003-06-04-bzip2-bug.ll20
-rw-r--r--release_23/test/ExecutionEngine/2003-06-05-PHIBug.ll18
-rw-r--r--release_23/test/ExecutionEngine/2003-08-15-AllocaAssertion.ll12
-rw-r--r--release_23/test/ExecutionEngine/2003-08-21-EnvironmentTest.ll22
-rw-r--r--release_23/test/ExecutionEngine/2003-08-23-RegisterAllocatePhysReg.ll35
-rw-r--r--release_23/test/ExecutionEngine/2003-10-18-PHINode-ConstantExpr-CondCode-Failure.ll24
-rw-r--r--release_23/test/ExecutionEngine/2004-12-04-LazyCompileFuncs.ll29
-rw-r--r--release_23/test/ExecutionEngine/2005-12-02-TailCallBug.ll21
-rw-r--r--release_23/test/ExecutionEngine/2007-05-12-APInt-Shl.ll30
-rw-r--r--release_23/test/ExecutionEngine/2007-12-10-APIntLoadStore.ll19
-rw-r--r--release_23/test/ExecutionEngine/2007-12-14-BigEndian.ll81
-rw-r--r--release_23/test/ExecutionEngine/2007-12-14-LittleEndian.ll81
-rw-r--r--release_23/test/ExecutionEngine/dg.exp3
-rw-r--r--release_23/test/ExecutionEngine/fpbitcast.ll21
-rw-r--r--release_23/test/ExecutionEngine/hello.ll12
-rw-r--r--release_23/test/ExecutionEngine/hello2.ll18
-rw-r--r--release_23/test/ExecutionEngine/simplesttest.ll7
-rw-r--r--release_23/test/ExecutionEngine/simpletest.ll12
-rw-r--r--release_23/test/ExecutionEngine/test-arith.ll35
-rw-r--r--release_23/test/ExecutionEngine/test-branch.ll13
-rw-r--r--release_23/test/ExecutionEngine/test-call.ll22
-rw-r--r--release_23/test/ExecutionEngine/test-cast.ll110
-rw-r--r--release_23/test/ExecutionEngine/test-constantexpr.ll13
-rw-r--r--release_23/test/ExecutionEngine/test-fp.ll24
-rw-r--r--release_23/test/ExecutionEngine/test-loadstore.ll32
-rw-r--r--release_23/test/ExecutionEngine/test-logical.ll19
-rw-r--r--release_23/test/ExecutionEngine/test-loop.ll15
-rw-r--r--release_23/test/ExecutionEngine/test-malloc.ll14
-rw-r--r--release_23/test/ExecutionEngine/test-phi.ll35
-rw-r--r--release_23/test/ExecutionEngine/test-ret.ll47
-rw-r--r--release_23/test/ExecutionEngine/test-setcond-fp.ll25
-rw-r--r--release_23/test/ExecutionEngine/test-setcond-int.ll70
-rw-r--r--release_23/test/ExecutionEngine/test-shift.ll33
-rw-r--r--release_23/test/Feature/README.txt6
-rw-r--r--release_23/test/Feature/aliases.ll32
-rw-r--r--release_23/test/Feature/alignment.ll21
-rw-r--r--release_23/test/Feature/basictest.ll31
-rw-r--r--release_23/test/Feature/callingconventions.ll50
-rw-r--r--release_23/test/Feature/calltest.ll32
-rw-r--r--release_23/test/Feature/casttest.ll12
-rw-r--r--release_23/test/Feature/cfgstructures.ll53
-rw-r--r--release_23/test/Feature/constexpr.ll80
-rw-r--r--release_23/test/Feature/constpointer.ll31
-rw-r--r--release_23/test/Feature/dg.exp3
-rw-r--r--release_23/test/Feature/escaped_label.ll11
-rw-r--r--release_23/test/Feature/float.ll6
-rw-r--r--release_23/test/Feature/fold-fpcast.ll18
-rw-r--r--release_23/test/Feature/forwardreftest.ll29
-rw-r--r--release_23/test/Feature/global_section.ll10
-rw-r--r--release_23/test/Feature/globalredefinition.ll18
-rw-r--r--release_23/test/Feature/globalredefinition3.ll6
-rw-r--r--release_23/test/Feature/globalvars.ll18
-rw-r--r--release_23/test/Feature/indirectcall.ll49
-rw-r--r--release_23/test/Feature/indirectcall2.ll22
-rw-r--r--release_23/test/Feature/inlineasm.ll13
-rw-r--r--release_23/test/Feature/instructions.ll24
-rw-r--r--release_23/test/Feature/intrinsics.ll62
-rw-r--r--release_23/test/Feature/llvm2cpp.exp3
-rw-r--r--release_23/test/Feature/llvm2cpp.ll756
-rw-r--r--release_23/test/Feature/load_module.ll10
-rw-r--r--release_23/test/Feature/newcasts.ll33
-rw-r--r--release_23/test/Feature/opaquetypes.ll57
-rw-r--r--release_23/test/Feature/packed.ll15
-rw-r--r--release_23/test/Feature/packed_struct.ll33
-rw-r--r--release_23/test/Feature/paramattrs.ll22
-rw-r--r--release_23/test/Feature/ppcld.ll26
-rw-r--r--release_23/test/Feature/properties.ll7
-rw-r--r--release_23/test/Feature/prototype.ll11
-rw-r--r--release_23/test/Feature/recursivetype.ll103
-rw-r--r--release_23/test/Feature/simplecalltest.ll24
-rw-r--r--release_23/test/Feature/small.ll11
-rw-r--r--release_23/test/Feature/smallest.ll4
-rw-r--r--release_23/test/Feature/sparcld.ll24
-rw-r--r--release_23/test/Feature/testalloca.ll22
-rw-r--r--release_23/test/Feature/testconstants.ll29
-rw-r--r--release_23/test/Feature/testlogical.ll11
-rw-r--r--release_23/test/Feature/testmemory.ll36
-rw-r--r--release_23/test/Feature/testswitch.ll26
-rw-r--r--release_23/test/Feature/testvarargs.ll12
-rw-r--r--release_23/test/Feature/undefined.ll17
-rw-r--r--release_23/test/Feature/unreachable.ll15
-rw-r--r--release_23/test/Feature/varargs.ll29
-rw-r--r--release_23/test/Feature/varargs_new.ll38
-rw-r--r--release_23/test/Feature/weirdnames.ll9
-rw-r--r--release_23/test/Feature/x86ld.ll26
-rw-r--r--release_23/test/FrontendAda/Support/fat_fields.ads6
-rw-r--r--release_23/test/FrontendAda/Support/global_constant.ads4
-rw-r--r--release_23/test/FrontendAda/Support/non_lvalue.ads11
-rw-r--r--release_23/test/FrontendAda/Support/unc_constructor.ads8
-rw-r--r--release_23/test/FrontendAda/Support/var_offset.ads9
-rw-r--r--release_23/test/FrontendAda/Support/var_size.ads7
-rw-r--r--release_23/test/FrontendAda/array_constructor.adb6
-rw-r--r--release_23/test/FrontendAda/array_range_ref.adb7
-rw-r--r--release_23/test/FrontendAda/array_ref.adb11
-rw-r--r--release_23/test/FrontendAda/array_size.adb10
-rw-r--r--release_23/test/FrontendAda/asm.adb6
-rw-r--r--release_23/test/FrontendAda/debug_var_size.ads8
-rw-r--r--release_23/test/FrontendAda/dg.exp6
-rw-r--r--release_23/test/FrontendAda/emit_var.ads5
-rw-r--r--release_23/test/FrontendAda/fat_fields.adb10
-rw-r--r--release_23/test/FrontendAda/field_order.ads7
-rw-r--r--release_23/test/FrontendAda/global_constant.adb5
-rw-r--r--release_23/test/FrontendAda/init_size.ads12
-rw-r--r--release_23/test/FrontendAda/non_bitfield.ads12
-rw-r--r--release_23/test/FrontendAda/non_lvalue.adb7
-rw-r--r--release_23/test/FrontendAda/placeholder.adb12
-rw-r--r--release_23/test/FrontendAda/switch.adb12
-rw-r--r--release_23/test/FrontendAda/unc_constructor.adb9
-rw-r--r--release_23/test/FrontendAda/var_offset.adb7
-rw-r--r--release_23/test/FrontendAda/var_size.adb7
-rw-r--r--release_23/test/FrontendAda/vce.adb7
-rw-r--r--release_23/test/FrontendAda/vce_lv.adb9
-rw-r--r--release_23/test/FrontendObjC/2007-04-03-ObjcEH.m29
-rw-r--r--release_23/test/FrontendObjC/2007-05-02-Strong.m23
-rw-r--r--release_23/test/FrontendObjC/2007-09-25-EH.m27
-rw-r--r--release_23/test/FrontendObjC/2007-10-03-MetadataPointers.mm7
-rw-r--r--release_23/test/FrontendObjC/2007-10-17-SJLJExceptions.m24
-rw-r--r--release_23/test/FrontendObjC/2007-10-18-ProDescriptor.m19
-rw-r--r--release_23/test/FrontendObjC/2007-10-23-GC-WriteBarrier.m9
-rw-r--r--release_23/test/FrontendObjC/dg.exp7
-rw-r--r--release_23/test/Integer/2007-01-19-TruncSext.ll29
-rw-r--r--release_23/test/Integer/BitArith.ll25
-rw-r--r--release_23/test/Integer/BitBit.ll24
-rw-r--r--release_23/test/Integer/BitCast.ll26
-rw-r--r--release_23/test/Integer/BitIcmp.ll43
-rw-r--r--release_23/test/Integer/BitMem.ll29
-rw-r--r--release_23/test/Integer/BitMisc.ll24
-rw-r--r--release_23/test/Integer/BitPacked.ll21
-rw-r--r--release_23/test/Integer/a1.ll25
-rw-r--r--release_23/test/Integer/a1.ll.out19
-rw-r--r--release_23/test/Integer/a15.ll27
-rw-r--r--release_23/test/Integer/a15.ll.out20
-rw-r--r--release_23/test/Integer/a17.ll25
-rw-r--r--release_23/test/Integer/a17.ll.out19
-rw-r--r--release_23/test/Integer/a31.ll25
-rw-r--r--release_23/test/Integer/a31.ll.out19
-rw-r--r--release_23/test/Integer/a33.ll26
-rw-r--r--release_23/test/Integer/a33.ll.out19
-rw-r--r--release_23/test/Integer/a63.ll25
-rw-r--r--release_23/test/Integer/a63.ll.out19
-rw-r--r--release_23/test/Integer/a7.ll31
-rw-r--r--release_23/test/Integer/a7.ll.out24
-rw-r--r--release_23/test/Integer/a9.ll25
-rw-r--r--release_23/test/Integer/a9.ll.out18
-rw-r--r--release_23/test/Integer/alignment_bt.ll21
-rw-r--r--release_23/test/Integer/basictest_bt.ll31
-rw-r--r--release_23/test/Integer/cfgstructures_bt.ll56
-rw-r--r--release_23/test/Integer/constexpr_bt.ll84
-rw-r--r--release_23/test/Integer/constpointer_bt.ll32
-rw-r--r--release_23/test/Integer/dg.exp3
-rw-r--r--release_23/test/Integer/fold-fpcast_bt.ll33
-rw-r--r--release_23/test/Integer/forwardreftest_bt.ll33
-rw-r--r--release_23/test/Integer/globalredefinition_bt.ll18
-rw-r--r--release_23/test/Integer/globalvars_bt.ll26
-rw-r--r--release_23/test/Integer/indirectcall2_bt.ll24
-rw-r--r--release_23/test/Integer/indirectcall_bt.ll52
-rw-r--r--release_23/test/Integer/instructions_bt.ll26
-rw-r--r--release_23/test/Integer/newcasts_bt.ll28
-rw-r--r--release_23/test/Integer/opaquetypes_bt.ll60
-rw-r--r--release_23/test/Integer/packed_bt.ll16
-rw-r--r--release_23/test/Integer/packed_struct_bt.ll33
-rw-r--r--release_23/test/Integer/paramattrs_bt.ll19
-rw-r--r--release_23/test/Integer/properties_bt.ll9
-rw-r--r--release_23/test/Integer/prototype_bt.ll13
-rw-r--r--release_23/test/Integer/recursivetype_bt.ll108
-rw-r--r--release_23/test/Integer/simplecalltest_bt.ll28
-rw-r--r--release_23/test/Integer/small_bt.ll13
-rw-r--r--release_23/test/Integer/testalloca_bt.ll28
-rw-r--r--release_23/test/Integer/testarith_bt.ll21
-rw-r--r--release_23/test/Integer/testconstants_bt.ll32
-rw-r--r--release_23/test/Integer/testicmp_bt.ll23
-rw-r--r--release_23/test/Integer/testlogical_bt.ll13
-rw-r--r--release_23/test/Integer/testlogical_new_bt.ll15
-rw-r--r--release_23/test/Integer/testmemory_bt.ll45
-rw-r--r--release_23/test/Integer/testswitch_bt.ll24
-rw-r--r--release_23/test/Integer/testvarargs_bt.ll14
-rw-r--r--release_23/test/Integer/undefined_bt.ll18
-rw-r--r--release_23/test/Integer/unreachable_bt.ll16
-rw-r--r--release_23/test/Integer/varargs_bt.ll23
-rw-r--r--release_23/test/Integer/varargs_new_bt.ll32
-rw-r--r--release_23/test/LLVMC/dg.exp10
-rw-r--r--release_23/test/LLVMC/false.c14
-rw-r--r--release_23/test/LLVMC/hello.c12
-rw-r--r--release_23/test/LLVMC/hello.cpp8
-rw-r--r--release_23/test/LLVMC/test_data/false.cpp17
-rw-r--r--release_23/test/LLVMC/test_data/false2.cpp6
-rw-r--r--release_23/test/LLVMC/test_data/together.c9
-rw-r--r--release_23/test/LLVMC/together.cpp9
-rw-r--r--release_23/test/Linker/2002-07-17-GlobalFail.ll8
-rw-r--r--release_23/test/Linker/2002-07-17-LinkTest2.ll10
-rw-r--r--release_23/test/Linker/2002-08-20-ConstantExpr.ll9
-rw-r--r--release_23/test/Linker/2003-01-30-LinkerRename.ll9
-rw-r--r--release_23/test/Linker/2003-01-30-LinkerTypeRename.ll9
-rw-r--r--release_23/test/Linker/2003-04-21-Linkage.ll14
-rw-r--r--release_23/test/Linker/2003-04-23-LinkOnceLost.ll10
-rw-r--r--release_23/test/Linker/2003-04-26-NullPtrLinkProblem.ll17
-rw-r--r--release_23/test/Linker/2003-05-15-TypeProblem.ll10
-rw-r--r--release_23/test/Linker/2003-05-31-LinkerRename.ll17
-rw-r--r--release_23/test/Linker/2003-06-02-TypeResolveProblem.ll7
-rw-r--r--release_23/test/Linker/2003-06-02-TypeResolveProblem2.ll7
-rw-r--r--release_23/test/Linker/2003-08-20-OpaqueTypeResolve.ll8
-rw-r--r--release_23/test/Linker/2003-08-23-GlobalVarLinking.ll10
-rw-r--r--release_23/test/Linker/2003-08-23-RecursiveOpaqueTypeResolve.ll9
-rw-r--r--release_23/test/Linker/2003-08-24-InheritPtrSize.ll9
-rw-r--r--release_23/test/Linker/2003-08-28-TypeResolvesGlobal.ll12
-rw-r--r--release_23/test/Linker/2003-08-28-TypeResolvesGlobal2.ll18
-rw-r--r--release_23/test/Linker/2003-08-28-TypeResolvesGlobal3.ll15
-rw-r--r--release_23/test/Linker/2003-10-21-ConflictingTypesTolerance.ll7
-rw-r--r--release_23/test/Linker/2003-10-27-LinkOncePromote.ll8
-rw-r--r--release_23/test/Linker/2003-11-18-TypeResolution.ll20
-rw-r--r--release_23/test/Linker/2004-02-17-WeakStrongLinkage.ll7
-rw-r--r--release_23/test/Linker/2004-05-07-TypeResolution1.ll35
-rw-r--r--release_23/test/Linker/2004-05-07-TypeResolution2.ll15
-rw-r--r--release_23/test/Linker/2004-12-03-DisagreeingType.ll9
-rw-r--r--release_23/test/Linker/2005-02-12-ConstantGlobals-2.ll8
-rw-r--r--release_23/test/Linker/2005-02-12-ConstantGlobals.ll8
-rw-r--r--release_23/test/Linker/2005-12-06-AppendingZeroLengthArrays.ll10
-rw-r--r--release_23/test/Linker/2006-01-19-ConstantPacked.ll13
-rw-r--r--release_23/test/Linker/2006-06-15-GlobalVarAlignment.ll7
-rw-r--r--release_23/test/Linker/2008-03-05-AliasReference.ll17
-rw-r--r--release_23/test/Linker/2008-03-05-AliasReference2.ll11
-rw-r--r--release_23/test/Linker/2008-03-07-DroppedSection_a.ll11
-rw-r--r--release_23/test/Linker/2008-03-07-DroppedSection_b.ll10
-rw-r--r--release_23/test/Linker/AppendingLinkage.ll15
-rw-r--r--release_23/test/Linker/AppendingLinkage2.ll8
-rw-r--r--release_23/test/Linker/ConstantGlobals1.ll9
-rw-r--r--release_23/test/Linker/ConstantGlobals2.ll9
-rw-r--r--release_23/test/Linker/ConstantGlobals3.ll8
-rw-r--r--release_23/test/Linker/LinkOnce.ll8
-rw-r--r--release_23/test/Linker/basiclink.ll13
-rw-r--r--release_23/test/Linker/dg.exp3
-rw-r--r--release_23/test/Linker/link-archive.ll15
-rw-r--r--release_23/test/Linker/link-messages.ll11
-rw-r--r--release_23/test/Linker/redefinition.ll10
-rw-r--r--release_23/test/Linker/testlink1.ll42
-rw-r--r--release_23/test/Linker/testlink2.ll41
-rw-r--r--release_23/test/Linker/weakextern.ll11
-rw-r--r--release_23/test/Makefile111
-rw-r--r--release_23/test/Makefile.tests80
-rw-r--r--release_23/test/Other/2002-01-31-CallGraph.ll13
-rw-r--r--release_23/test/Other/2002-02-24-InlineBrokePHINodes.ll23
-rw-r--r--release_23/test/Other/2002-03-11-ConstPropCrash.ll24
-rw-r--r--release_23/test/Other/2003-02-19-LoopInfoNestingBug.ll29
-rw-r--r--release_23/test/Other/2004-08-16-PackedConstantInlineStore.ll8
-rw-r--r--release_23/test/Other/2004-08-16-PackedGlobalConstant.ll11
-rw-r--r--release_23/test/Other/2004-08-16-PackedSelect.ll13
-rw-r--r--release_23/test/Other/2004-08-16-PackedSimple.ll13
-rw-r--r--release_23/test/Other/2004-08-20-PackedControlFlow.ll22
-rw-r--r--release_23/test/Other/2006-02-05-PassManager.ll5
-rw-r--r--release_23/test/Other/2007-04-24-eliminate-mostly-empty-blocks.ll309
-rw-r--r--release_23/test/Other/2007-06-05-PassID.ll11
-rw-r--r--release_23/test/Other/2007-06-16-Funcname.ll7
-rw-r--r--release_23/test/Other/2007-06-28-PassManager.ll7
-rw-r--r--release_23/test/Other/2007-09-10-PassManager.ll32
-rw-r--r--release_23/test/Other/2008-02-14-PassManager.ll5
-rw-r--r--release_23/test/Other/2008-03-19-PassManager.ll58
-rw-r--r--release_23/test/Other/dg.exp3
-rw-r--r--release_23/test/Other/invalid-commandline-option.ll3
-rw-r--r--release_23/test/Scripts/README.txt2
-rwxr-xr-xrelease_23/test/Scripts/count17
-rwxr-xr-xrelease_23/test/Scripts/ignore10
-rwxr-xr-xrelease_23/test/Scripts/not12
-rwxr-xr-xrelease_23/test/Scripts/notcast16
-rwxr-xr-xrelease_23/test/Scripts/prcontext.tcl36
-rw-r--r--release_23/test/TableGen/2003-08-03-PassCode.td7
-rw-r--r--release_23/test/TableGen/2006-09-18-LargeInt.td5
-rw-r--r--release_23/test/TableGen/AnonDefinitionOnDemand.td12
-rw-r--r--release_23/test/TableGen/BitsInitOverflow.td5
-rw-r--r--release_23/test/TableGen/CStyleComment.td14
-rw-r--r--release_23/test/TableGen/DagDefSubst.ll15
-rw-r--r--release_23/test/TableGen/DagIntSubst.ll10
-rw-r--r--release_23/test/TableGen/ForwardRef.td15
-rw-r--r--release_23/test/TableGen/GeneralList.td8
-rw-r--r--release_23/test/TableGen/Include.inc4
-rw-r--r--release_23/test/TableGen/Include.td7
-rw-r--r--release_23/test/TableGen/IntBitInit.td5
-rw-r--r--release_23/test/TableGen/LazyChange.td11
-rw-r--r--release_23/test/TableGen/ListConversion.td10
-rw-r--r--release_23/test/TableGen/ListSlices.td18
-rw-r--r--release_23/test/TableGen/MultiClass.td25
-rw-r--r--release_23/test/TableGen/SuperSubclassSameName.td20
-rw-r--r--release_23/test/TableGen/TargetInstrInfo.td148
-rw-r--r--release_23/test/TableGen/TemplateArgRename.td17
-rw-r--r--release_23/test/TableGen/Tree.td18
-rw-r--r--release_23/test/TableGen/TreeNames.td17
-rw-r--r--release_23/test/TableGen/UnterminatedComment.td6
-rw-r--r--release_23/test/TableGen/dg.exp3
-rw-r--r--release_23/test/TableGen/nested-comment.td12
-rw-r--r--release_23/test/TableGen/strconcat.td7
-rwxr-xr-xrelease_23/test/TestRunner.sh36
-rw-r--r--release_23/test/Transforms/ADCE/2002-01-31-UseStuckAround.ll13
-rw-r--r--release_23/test/Transforms/ADCE/2002-05-22-PHITest.ll16
-rw-r--r--release_23/test/Transforms/ADCE/2002-05-23-ZeroArgPHITest.ll32
-rw-r--r--release_23/test/Transforms/ADCE/2002-05-28-Crash-distilled.ll17
-rw-r--r--release_23/test/Transforms/ADCE/2002-05-28-Crash.ll54
-rw-r--r--release_23/test/Transforms/ADCE/2002-07-17-AssertionFailure.ll13
-rw-r--r--release_23/test/Transforms/ADCE/2002-07-17-PHIAssertion.ll48
-rw-r--r--release_23/test/Transforms/ADCE/2002-07-29-Segfault.ll9
-rw-r--r--release_23/test/Transforms/ADCE/2003-01-22-PredecessorProblem.ll25
-rw-r--r--release_23/test/Transforms/ADCE/2003-04-25-PHIPostDominateProblem.ll35
-rw-r--r--release_23/test/Transforms/ADCE/2003-06-11-InvalidCFG.ll28
-rw-r--r--release_23/test/Transforms/ADCE/2003-06-24-BadSuccessor.ll91
-rw-r--r--release_23/test/Transforms/ADCE/2003-06-24-BasicFunctionality.ll41
-rw-r--r--release_23/test/Transforms/ADCE/2003-09-10-UnwindInstFail.ll19
-rw-r--r--release_23/test/Transforms/ADCE/2003-09-15-InfLoopCrash.ll9
-rw-r--r--release_23/test/Transforms/ADCE/2003-11-16-MissingPostDominanceInfo.ll18
-rw-r--r--release_23/test/Transforms/ADCE/2003-12-19-MergeReturn.ll27
-rw-r--r--release_23/test/Transforms/ADCE/2004-05-04-UnreachableBlock.ll16
-rw-r--r--release_23/test/Transforms/ADCE/2005-02-17-PHI-Invoke-Crash.ll45
-rw-r--r--release_23/test/Transforms/ADCE/adcetest.ll36
-rw-r--r--release_23/test/Transforms/ADCE/basictest.ll19
-rw-r--r--release_23/test/Transforms/ADCE/basictest1.ll97
-rw-r--r--release_23/test/Transforms/ADCE/basictest2.ll97
-rw-r--r--release_23/test/Transforms/ADCE/dce_pure_call.ll8
-rw-r--r--release_23/test/Transforms/ADCE/dce_pure_invoke.ll15
-rw-r--r--release_23/test/Transforms/ADCE/dead-phi-edge.ll17
-rw-r--r--release_23/test/Transforms/ADCE/dg.exp3
-rw-r--r--release_23/test/Transforms/ADCE/unreachable-function.ll5
-rw-r--r--release_23/test/Transforms/ArgumentPromotion/2008-02-01-ReturnAttrs.ll15
-rw-r--r--release_23/test/Transforms/ArgumentPromotion/aggregate-promote.ll23
-rw-r--r--release_23/test/Transforms/ArgumentPromotion/attrs.ll25
-rw-r--r--release_23/test/Transforms/ArgumentPromotion/basictest.ll22
-rw-r--r--release_23/test/Transforms/ArgumentPromotion/byval-2.ll26
-rw-r--r--release_23/test/Transforms/ArgumentPromotion/byval.ll24
-rw-r--r--release_23/test/Transforms/ArgumentPromotion/chained.ll16
-rw-r--r--release_23/test/Transforms/ArgumentPromotion/control-flow.ll19
-rw-r--r--release_23/test/Transforms/ArgumentPromotion/control-flow2.ll21
-rw-r--r--release_23/test/Transforms/ArgumentPromotion/dg.exp3
-rw-r--r--release_23/test/Transforms/BlockPlacement/basictest.ll15
-rw-r--r--release_23/test/Transforms/BlockPlacement/dg.exp3
-rw-r--r--release_23/test/Transforms/BranchFolding/2007-10-19-InlineAsmDirectives.ll18
-rw-r--r--release_23/test/Transforms/CodeExtractor/2004-03-13-LoopExtractorCrash.ll75
-rw-r--r--release_23/test/Transforms/CodeExtractor/2004-03-14-DominanceProblem.ll33
-rw-r--r--release_23/test/Transforms/CodeExtractor/2004-03-14-NoSwitchSupport.ll28
-rw-r--r--release_23/test/Transforms/CodeExtractor/2004-03-17-MissedLiveIns.ll47
-rw-r--r--release_23/test/Transforms/CodeExtractor/2004-03-17-OutputMismatch.ll20
-rw-r--r--release_23/test/Transforms/CodeExtractor/2004-03-17-UpdatePHIsOutsideRegion.ll23
-rw-r--r--release_23/test/Transforms/CodeExtractor/2004-03-18-InvokeHandling.ll194
-rw-r--r--release_23/test/Transforms/CodeExtractor/2004-08-12-BlockExtractPHI.ll26
-rw-r--r--release_23/test/Transforms/CodeExtractor/2004-11-12-InvokeExtract.ll15
-rw-r--r--release_23/test/Transforms/CodeExtractor/dg.exp3
-rw-r--r--release_23/test/Transforms/CondProp/2006-08-14-SingleEntryPhiCrash.ll462
-rw-r--r--release_23/test/Transforms/CondProp/2006-11-01-PhiNodeCrash.ll1084
-rw-r--r--release_23/test/Transforms/CondProp/2007-08-01-InvalidRead.ll814
-rw-r--r--release_23/test/Transforms/CondProp/basictest.ll27
-rw-r--r--release_23/test/Transforms/CondProp/dg.exp3
-rw-r--r--release_23/test/Transforms/CondProp/phisimplify.ll43
-rw-r--r--release_23/test/Transforms/CondProp/phisimplify2.ll46
-rw-r--r--release_23/test/Transforms/ConstProp/2002-05-03-DivideByZeroException.ll15
-rw-r--r--release_23/test/Transforms/ConstProp/2002-05-03-NotOperator.ll19
-rw-r--r--release_23/test/Transforms/ConstProp/2002-09-03-SetCC-Bools.ll20
-rw-r--r--release_23/test/Transforms/ConstProp/2003-05-12-DivideError.ll15
-rw-r--r--release_23/test/Transforms/ConstProp/2005-01-28-SetCCGEP.ll10
-rw-r--r--release_23/test/Transforms/ConstProp/2006-11-30-vector-cast.ll10
-rw-r--r--release_23/test/Transforms/ConstProp/2006-12-01-TruncBoolBug.ll7
-rw-r--r--release_23/test/Transforms/ConstProp/2006-12-01-bool-casts.ll15
-rw-r--r--release_23/test/Transforms/ConstProp/2007-02-05-BitCast.ll7
-rw-r--r--release_23/test/Transforms/ConstProp/2007-02-23-sdiv.ll5
-rw-r--r--release_23/test/Transforms/ConstProp/2007-11-23-cttz.ll8
-rw-r--r--release_23/test/Transforms/ConstProp/basictest.ll20
-rw-r--r--release_23/test/Transforms/ConstProp/bitcast.ll2
-rw-r--r--release_23/test/Transforms/ConstProp/bswap.ll25
-rw-r--r--release_23/test/Transforms/ConstProp/calls.ll30
-rw-r--r--release_23/test/Transforms/ConstProp/dg.exp3
-rw-r--r--release_23/test/Transforms/ConstProp/float-to-ptr-cast.ll12
-rw-r--r--release_23/test/Transforms/ConstProp/logicaltest.ll35
-rw-r--r--release_23/test/Transforms/ConstProp/nottest.ll19
-rw-r--r--release_23/test/Transforms/ConstProp/phi.ll17
-rw-r--r--release_23/test/Transforms/ConstProp/remtest.ll24
-rw-r--r--release_23/test/Transforms/ConstantMerge/2002-09-23-CPR-Update.ll13
-rw-r--r--release_23/test/Transforms/ConstantMerge/2003-10-28-MergeExternalConstants.ll5
-rw-r--r--release_23/test/Transforms/ConstantMerge/2006-03-07-DontMergeDiffSections.ll16
-rw-r--r--release_23/test/Transforms/ConstantMerge/dg.exp3
-rw-r--r--release_23/test/Transforms/DeadArgElim/2006-06-27-struct-ret.ll11
-rw-r--r--release_23/test/Transforms/DeadArgElim/2007-02-07-FuncRename.ll11
-rw-r--r--release_23/test/Transforms/DeadArgElim/2007-10-18-VarargsReturn.ll12
-rw-r--r--release_23/test/Transforms/DeadArgElim/2007-12-20-ParamAttrs.ll19
-rw-r--r--release_23/test/Transforms/DeadArgElim/2008-01-16-VarargsParamAttrs.ll31
-rw-r--r--release_23/test/Transforms/DeadArgElim/basictest.ll36
-rw-r--r--release_23/test/Transforms/DeadArgElim/dead_vaargs.ll12
-rw-r--r--release_23/test/Transforms/DeadArgElim/deadretval.ll18
-rw-r--r--release_23/test/Transforms/DeadArgElim/deadretval2.ll33
-rw-r--r--release_23/test/Transforms/DeadArgElim/dg.exp3
-rw-r--r--release_23/test/Transforms/DeadStoreElimination/2004-11-28-LiveStoreDeleted.ll14
-rw-r--r--release_23/test/Transforms/DeadStoreElimination/2004-12-28-PartialStore.ll13
-rw-r--r--release_23/test/Transforms/DeadStoreElimination/2005-11-30-vaarg.ll9
-rw-r--r--release_23/test/Transforms/DeadStoreElimination/2006-06-27-AST-Remove.ll1113
-rw-r--r--release_23/test/Transforms/DeadStoreElimination/PartialStore.ll13
-rw-r--r--release_23/test/Transforms/DeadStoreElimination/alloca.ll9
-rw-r--r--release_23/test/Transforms/DeadStoreElimination/byval.ll10
-rw-r--r--release_23/test/Transforms/DeadStoreElimination/context-sensitive.ll14
-rw-r--r--release_23/test/Transforms/DeadStoreElimination/dg.exp3
-rw-r--r--release_23/test/Transforms/DeadStoreElimination/free.ll8
-rw-r--r--release_23/test/Transforms/DeadStoreElimination/memcpy.ll52
-rw-r--r--release_23/test/Transforms/DeadStoreElimination/simple.ll9
-rw-r--r--release_23/test/Transforms/DeadStoreElimination/volatile-load.ll8
-rw-r--r--release_23/test/Transforms/GCSE/2002-05-14-OperandSwap.ll17
-rw-r--r--release_23/test/Transforms/GCSE/2002-05-21-NoSharedDominator.ll14
-rw-r--r--release_23/test/Transforms/GCSE/2003-06-13-LoadStoreEliminate.ll11
-rw-r--r--release_23/test/Transforms/GCSE/dg.exp3
-rw-r--r--release_23/test/Transforms/GCSE/gcsetests.ll46
-rw-r--r--release_23/test/Transforms/GCSE/vectorops.ll24
-rw-r--r--release_23/test/Transforms/GVN/2007-07-25-DominatedLoop.ll86
-rw-r--r--release_23/test/Transforms/GVN/2007-07-25-InfiniteLoop.ll14
-rw-r--r--release_23/test/Transforms/GVN/2007-07-25-Loop.ll15
-rw-r--r--release_23/test/Transforms/GVN/2007-07-25-NestedLoop.ll38
-rw-r--r--release_23/test/Transforms/GVN/2007-07-25-SinglePredecessor.ll29
-rw-r--r--release_23/test/Transforms/GVN/2007-07-26-InterlockingLoops.ll30
-rw-r--r--release_23/test/Transforms/GVN/2007-07-26-NonRedundant.ll16
-rw-r--r--release_23/test/Transforms/GVN/2007-07-26-PhiErasure.ll28
-rw-r--r--release_23/test/Transforms/GVN/2007-07-30-PredIDom.ll274
-rw-r--r--release_23/test/Transforms/GVN/2007-07-31-NoDomInherit.ll313
-rw-r--r--release_23/test/Transforms/GVN/2007-07-31-RedundantPhi.ll22
-rw-r--r--release_23/test/Transforms/GVN/2008-02-12-UndefLoad.ll20
-rw-r--r--release_23/test/Transforms/GVN/2008-02-13-NewPHI.ll22
-rw-r--r--release_23/test/Transforms/GVN/2008-02-24-NonDominatedMemcpy.ll25
-rw-r--r--release_23/test/Transforms/GVN/2008-02-26-MemCpySize.ll46
-rw-r--r--release_23/test/Transforms/GVN/basic.ll10
-rw-r--r--release_23/test/Transforms/GVN/call.ll12
-rw-r--r--release_23/test/Transforms/GVN/dg.exp3
-rw-r--r--release_23/test/Transforms/GVN/dominated.ll20
-rw-r--r--release_23/test/Transforms/GVN/mixed.ll13
-rw-r--r--release_23/test/Transforms/GVN/nonlocal.ll19
-rw-r--r--release_23/test/Transforms/GVN/semidominated.ll19
-rw-r--r--release_23/test/Transforms/GVNPRE/2007-06-12-NoExit.ll9
-rw-r--r--release_23/test/Transforms/GVNPRE/2007-06-12-PhiTranslate.ll19
-rw-r--r--release_23/test/Transforms/GVNPRE/2007-06-15-InvokeInst.ll70
-rw-r--r--release_23/test/Transforms/GVNPRE/2007-06-15-Looping.ll22
-rw-r--r--release_23/test/Transforms/GVNPRE/2007-06-18-ConstantInPhi.ll22
-rw-r--r--release_23/test/Transforms/GVNPRE/2007-06-18-EraseNumbering.ll26
-rw-r--r--release_23/test/Transforms/GVNPRE/2007-07-03-PhiTranslateGEP.ll14
-rw-r--r--release_23/test/Transforms/GVNPRE/2007-07-04-CleanSelect.ll9
-rw-r--r--release_23/test/Transforms/GVNPRE/2007-07-04-SelectInst.ll18
-rw-r--r--release_23/test/Transforms/GVNPRE/2007-07-05-AvailabilityUpdating.ll54
-rw-r--r--release_23/test/Transforms/GVNPRE/2007-07-07-AnticOutUnique.ll14
-rw-r--r--release_23/test/Transforms/GVNPRE/basic.ll38
-rw-r--r--release_23/test/Transforms/GVNPRE/cast.ll17
-rw-r--r--release_23/test/Transforms/GVNPRE/dg.exp3
-rw-r--r--release_23/test/Transforms/GVNPRE/extractelement.ll18
-rw-r--r--release_23/test/Transforms/GVNPRE/gep.ll17
-rw-r--r--release_23/test/Transforms/GVNPRE/insertelement.ll18
-rw-r--r--release_23/test/Transforms/GVNPRE/select.ll17
-rw-r--r--release_23/test/Transforms/GVNPRE/shufflevector.ll18
-rw-r--r--release_23/test/Transforms/GlobalDCE/2002-07-17-CastRef.ll11
-rw-r--r--release_23/test/Transforms/GlobalDCE/2002-07-17-ConstantRef.ll13
-rw-r--r--release_23/test/Transforms/GlobalDCE/2002-08-17-FunctionDGE.ll17
-rw-r--r--release_23/test/Transforms/GlobalDCE/2002-08-17-WorkListTest.ll12
-rw-r--r--release_23/test/Transforms/GlobalDCE/2002-09-12-Redeletion.ll11
-rw-r--r--release_23/test/Transforms/GlobalDCE/2003-07-01-SelfReference.ll11
-rw-r--r--release_23/test/Transforms/GlobalDCE/2003-10-09-PreserveWeakGlobals.ll6
-rw-r--r--release_23/test/Transforms/GlobalDCE/basicvariabletest.ll5
-rw-r--r--release_23/test/Transforms/GlobalDCE/dg.exp3
-rw-r--r--release_23/test/Transforms/GlobalOpt/2004-10-10-CastStoreOnce.ll17
-rw-r--r--release_23/test/Transforms/GlobalOpt/2005-06-15-LocalizeConstExprCrash.ll10
-rw-r--r--release_23/test/Transforms/GlobalOpt/2005-09-27-Crash.ll27
-rw-r--r--release_23/test/Transforms/GlobalOpt/2006-07-07-InlineAsmCrash.ll135
-rw-r--r--release_23/test/Transforms/GlobalOpt/2006-11-01-ShrinkGlobalPhiCrash.ll33
-rw-r--r--release_23/test/Transforms/GlobalOpt/2007-04-05-Crash.ll34
-rw-r--r--release_23/test/Transforms/GlobalOpt/2007-05-13-Crash.ll74
-rw-r--r--release_23/test/Transforms/GlobalOpt/2007-06-04-PackedStruct.ll36
-rw-r--r--release_23/test/Transforms/GlobalOpt/2007-11-09-GEP-GEP-Crash.ll19
-rw-r--r--release_23/test/Transforms/GlobalOpt/2008-01-03-Crash.ll26
-rw-r--r--release_23/test/Transforms/GlobalOpt/2008-01-13-OutOfRangeSROA.ll16
-rw-r--r--release_23/test/Transforms/GlobalOpt/2008-01-29-VolatileGlobal.ll9
-rw-r--r--release_23/test/Transforms/GlobalOpt/2008-02-16-NestAttr.ll57
-rw-r--r--release_23/test/Transforms/GlobalOpt/2008-04-26-SROA-Global-Align.ll32
-rw-r--r--release_23/test/Transforms/GlobalOpt/basictest.ll9
-rw-r--r--release_23/test/Transforms/GlobalOpt/constantexpr-dangle.ll13
-rw-r--r--release_23/test/Transforms/GlobalOpt/ctor-list-opt.ll85
-rw-r--r--release_23/test/Transforms/GlobalOpt/deadglobal-2.ll11
-rw-r--r--release_23/test/Transforms/GlobalOpt/deadglobal.ll9
-rw-r--r--release_23/test/Transforms/GlobalOpt/dg.exp3
-rw-r--r--release_23/test/Transforms/GlobalOpt/globalsra-partial.ll23
-rw-r--r--release_23/test/Transforms/GlobalOpt/globalsra.ll23
-rw-r--r--release_23/test/Transforms/GlobalOpt/integer-bool.ll23
-rw-r--r--release_23/test/Transforms/GlobalOpt/iterate.ll11
-rw-r--r--release_23/test/Transforms/GlobalOpt/load-store-global.ll15
-rw-r--r--release_23/test/Transforms/GlobalOpt/malloc-promote-1.ll18
-rw-r--r--release_23/test/Transforms/GlobalOpt/malloc-promote-2.ll20
-rw-r--r--release_23/test/Transforms/GlobalOpt/malloc-promote-3.ll26
-rw-r--r--release_23/test/Transforms/GlobalOpt/memcpy.ll15
-rw-r--r--release_23/test/Transforms/GlobalOpt/memset.ll21
-rw-r--r--release_23/test/Transforms/GlobalOpt/phi-select.ll31
-rw-r--r--release_23/test/Transforms/GlobalOpt/storepointer-compare.ll30
-rw-r--r--release_23/test/Transforms/GlobalOpt/storepointer.ll19
-rw-r--r--release_23/test/Transforms/GlobalOpt/trivialstore.ll19
-rw-r--r--release_23/test/Transforms/GlobalOpt/undef-init.ll17
-rw-r--r--release_23/test/Transforms/IPConstantProp/deadarg.ll6
-rw-r--r--release_23/test/Transforms/IPConstantProp/dg.exp3
-rw-r--r--release_23/test/Transforms/IPConstantProp/recursion.ll12
-rw-r--r--release_23/test/Transforms/IPConstantProp/return-constant.ll18
-rw-r--r--release_23/test/Transforms/IPConstantProp/return-constants.ll20
-rw-r--r--release_23/test/Transforms/IndVarsSimplify/2002-09-09-PointerIndVar.ll17
-rw-r--r--release_23/test/Transforms/IndVarsSimplify/2003-04-16-ExprAnalysis.ll17
-rw-r--r--release_23/test/Transforms/IndVarsSimplify/2003-09-12-MultiplePred.ll15
-rw-r--r--release_23/test/Transforms/IndVarsSimplify/2003-09-23-NotAtTop.ll17
-rw-r--r--release_23/test/Transforms/IndVarsSimplify/2003-12-10-IndVarDeadCode.ll25
-rw-r--r--release_23/test/Transforms/IndVarsSimplify/2003-12-10-RemoveInstrCrash.ll18
-rw-r--r--release_23/test/Transforms/IndVarsSimplify/2003-12-15-Crash.ll24
-rw-r--r--release_23/test/Transforms/IndVarsSimplify/2003-12-21-IndVarSize.ll15
-rw-r--r--release_23/test/Transforms/IndVarsSimplify/2004-03-10-PHIInsertionBug.ll26
-rw-r--r--release_23/test/Transforms/IndVarsSimplify/2004-04-05-InvokeCastCrash.ll283
-rw-r--r--release_23/test/Transforms/IndVarsSimplify/2004-04-07-ScalarEvolutionCrash.ll27
-rw-r--r--release_23/test/Transforms/IndVarsSimplify/2005-02-11-InvokeCrash.ll23
-rw-r--r--release_23/test/Transforms/IndVarsSimplify/2005-02-17-TruncateExprCrash.ll61
-rw-r--r--release_23/test/Transforms/IndVarsSimplify/2005-02-26-ExitValueCompute.ll20
-rw-r--r--release_23/test/Transforms/IndVarsSimplify/2005-06-15-InstMoveCrash.ll37
-rw-r--r--release_23/test/Transforms/IndVarsSimplify/2005-11-18-Crash.ll17
-rw-r--r--release_23/test/Transforms/IndVarsSimplify/2006-03-31-NegativeStride.ll22
-rw-r--r--release_23/test/Transforms/IndVarsSimplify/2006-06-16-Indvar-LCSSA-Crash.ll22
-rw-r--r--release_23/test/Transforms/IndVarsSimplify/2006-09-20-LFTR-Crash.ll44
-rw-r--r--release_23/test/Transforms/IndVarsSimplify/2006-12-10-BitCast.ll33
-rw-r--r--release_23/test/Transforms/IndVarsSimplify/2007-01-06-TripCount.ll38
-rw-r--r--release_23/test/Transforms/IndVarsSimplify/2007-01-08-X86-64-Pointer.ll19
-rw-r--r--release_23/test/Transforms/IndVarsSimplify/2007-06-06-DeleteDanglesPtr.ll117
-rw-r--r--release_23/test/Transforms/IndVarsSimplify/2007-11-23-BitcastCrash.ll20
-rw-r--r--release_23/test/Transforms/IndVarsSimplify/complex-scev.ll29
-rw-r--r--release_23/test/Transforms/IndVarsSimplify/dg.exp3
-rw-r--r--release_23/test/Transforms/IndVarsSimplify/exit_value_tests.ll114
-rw-r--r--release_23/test/Transforms/IndVarsSimplify/iterationCount_zext_or_trunc.ll25
-rw-r--r--release_23/test/Transforms/IndVarsSimplify/lftr_simple.ll22
-rw-r--r--release_23/test/Transforms/IndVarsSimplify/loop_evaluate_1.ll21
-rw-r--r--release_23/test/Transforms/IndVarsSimplify/loop_evaluate_2.ll28
-rw-r--r--release_23/test/Transforms/IndVarsSimplify/loop_evaluate_3.ll19
-rw-r--r--release_23/test/Transforms/IndVarsSimplify/loop_evaluate_4.ll20
-rw-r--r--release_23/test/Transforms/IndVarsSimplify/pointer-indvars.ll15
-rw-r--r--release_23/test/Transforms/IndVarsSimplify/subtract.ll15
-rw-r--r--release_23/test/Transforms/IndVarsSimplify/tripcount_compute.ll100
-rw-r--r--release_23/test/Transforms/IndVarsSimplify/tripcount_infinite.ll38
-rw-r--r--release_23/test/Transforms/IndVarsSimplify/variable-stride-ivs.ll43
-rw-r--r--release_23/test/Transforms/Inline/2003-09-14-InlineValue.ll21
-rw-r--r--release_23/test/Transforms/Inline/2003-09-22-PHINodeInlineFail.ll16
-rw-r--r--release_23/test/Transforms/Inline/2003-09-22-PHINodesInExceptionDest.ll25
-rw-r--r--release_23/test/Transforms/Inline/2003-09-22-PHINodesInNormalInvokeDest.ll23
-rw-r--r--release_23/test/Transforms/Inline/2003-10-13-AllocaDominanceProblem.ll19
-rw-r--r--release_23/test/Transforms/Inline/2003-10-26-InlineInvokeExceptionDestPhi.ll20
-rw-r--r--release_23/test/Transforms/Inline/2004-04-15-InlineDeletesCall.ll20
-rw-r--r--release_23/test/Transforms/Inline/2004-04-20-InlineLinkOnce.ll11
-rw-r--r--release_23/test/Transforms/Inline/2004-10-17-InlineFunctionWithoutReturn.ll11
-rw-r--r--release_23/test/Transforms/Inline/2006-01-14-CallGraphUpdate.ll25
-rw-r--r--release_23/test/Transforms/Inline/2006-07-12-InlinePruneCGUpdate.ll840
-rw-r--r--release_23/test/Transforms/Inline/2006-11-09-InlineCGUpdate-2.ll245
-rw-r--r--release_23/test/Transforms/Inline/2006-11-09-InlineCGUpdate.ll338
-rw-r--r--release_23/test/Transforms/Inline/2007-04-15-InlineEH.ll49
-rw-r--r--release_23/test/Transforms/Inline/2007-06-06-NoInline.ll46
-rw-r--r--release_23/test/Transforms/Inline/2007-06-25-WeakInline.ll14
-rw-r--r--release_23/test/Transforms/Inline/2007-12-19-InlineNoUnwind.ll19
-rw-r--r--release_23/test/Transforms/Inline/2008-03-04-StructRet.ll28
-rw-r--r--release_23/test/Transforms/Inline/alloca_test.ll21
-rw-r--r--release_23/test/Transforms/Inline/basictest.ll12
-rw-r--r--release_23/test/Transforms/Inline/byval.ll28
-rw-r--r--release_23/test/Transforms/Inline/byval2.ll28
-rw-r--r--release_23/test/Transforms/Inline/casts.ll19
-rw-r--r--release_23/test/Transforms/Inline/cfg_preserve_test.ll16
-rw-r--r--release_23/test/Transforms/Inline/dg.exp3
-rw-r--r--release_23/test/Transforms/Inline/dynamic_alloca_test.ll31
-rw-r--r--release_23/test/Transforms/Inline/inline-tail.ll15
-rw-r--r--release_23/test/Transforms/Inline/inline_cleanup.ll63
-rw-r--r--release_23/test/Transforms/Inline/inline_constprop.ll14
-rw-r--r--release_23/test/Transforms/Inline/inline_dce.ll25
-rw-r--r--release_23/test/Transforms/Inline/inline_prune.ll45
-rw-r--r--release_23/test/Transforms/Inline/invoke_test-1.ll24
-rw-r--r--release_23/test/Transforms/Inline/invoke_test-2.ll30
-rw-r--r--release_23/test/Transforms/Inline/invoke_test-3.ll32
-rw-r--r--release_23/test/Transforms/InstCombine/2002-03-11-InstCombineHang.ll9
-rw-r--r--release_23/test/Transforms/InstCombine/2002-05-14-SubFailure.ll10
-rw-r--r--release_23/test/Transforms/InstCombine/2002-05-14-TouchDeletedInst.ll508
-rw-r--r--release_23/test/Transforms/InstCombine/2002-08-02-CastTest.ll11
-rw-r--r--release_23/test/Transforms/InstCombine/2002-09-17-GetElementPtrCrash.ll12
-rw-r--r--release_23/test/Transforms/InstCombine/2002-12-05-MissedConstProp.ll11
-rw-r--r--release_23/test/Transforms/InstCombine/2003-05-26-CastMiscompile.ll8
-rw-r--r--release_23/test/Transforms/InstCombine/2003-05-27-ConstExprCrash.ll10
-rw-r--r--release_23/test/Transforms/InstCombine/2003-06-05-BranchInvertInfLoop.ll16
-rw-r--r--release_23/test/Transforms/InstCombine/2003-06-22-ConstantExprCrash.ll13
-rw-r--r--release_23/test/Transforms/InstCombine/2003-07-21-ExternalConstant.ll44
-rw-r--r--release_23/test/Transforms/InstCombine/2003-08-12-AllocaNonNull.ll21
-rw-r--r--release_23/test/Transforms/InstCombine/2003-09-09-VolatileLoadElim.ll7
-rw-r--r--release_23/test/Transforms/InstCombine/2003-10-23-InstcombineNullFail.ll12
-rw-r--r--release_23/test/Transforms/InstCombine/2003-10-29-CallSiteResolve.ll15
-rw-r--r--release_23/test/Transforms/InstCombine/2003-11-03-VarargsCallBug.ll13
-rw-r--r--release_23/test/Transforms/InstCombine/2003-11-13-ConstExprCastCall.ll9
-rw-r--r--release_23/test/Transforms/InstCombine/2004-01-13-InstCombineInvokePHI.ll28
-rw-r--r--release_23/test/Transforms/InstCombine/2004-02-23-ShiftShiftOverflow.ll15
-rw-r--r--release_23/test/Transforms/InstCombine/2004-03-13-InstCombineInfLoop.ll13
-rw-r--r--release_23/test/Transforms/InstCombine/2004-04-04-InstCombineReplaceAllUsesWith.ll10
-rw-r--r--release_23/test/Transforms/InstCombine/2004-05-07-UnsizedCastLoad.ll10
-rw-r--r--release_23/test/Transforms/InstCombine/2004-07-27-ConstantExprMul.ll9
-rw-r--r--release_23/test/Transforms/InstCombine/2004-08-09-RemInfLoop.ll9
-rw-r--r--release_23/test/Transforms/InstCombine/2004-08-10-BoolSetCC.ll8
-rw-r--r--release_23/test/Transforms/InstCombine/2004-09-20-BadLoadCombine.ll18
-rw-r--r--release_23/test/Transforms/InstCombine/2004-09-20-BadLoadCombine2.ll25
-rw-r--r--release_23/test/Transforms/InstCombine/2004-09-28-BadShiftAndSetCC.ll9
-rw-r--r--release_23/test/Transforms/InstCombine/2004-11-22-Missed-and-fold.ll10
-rw-r--r--release_23/test/Transforms/InstCombine/2004-11-27-SetCCForCastLargerAndConstant.ll132
-rw-r--r--release_23/test/Transforms/InstCombine/2004-12-08-InstCombineCrash.ll14
-rw-r--r--release_23/test/Transforms/InstCombine/2004-12-08-RemInfiniteLoop.ll7
-rw-r--r--release_23/test/Transforms/InstCombine/2005-03-04-ShiftOverflow.ll9
-rw-r--r--release_23/test/Transforms/InstCombine/2005-04-07-UDivSelectCrash.ll8
-rw-r--r--release_23/test/Transforms/InstCombine/2005-06-15-DivSelectCrash.ll10
-rw-r--r--release_23/test/Transforms/InstCombine/2005-06-15-ShiftSetCCCrash.ll9
-rw-r--r--release_23/test/Transforms/InstCombine/2005-06-16-RangeCrash.ll9
-rw-r--r--release_23/test/Transforms/InstCombine/2005-06-16-SetCCOrSetCCMiscompile.ll14
-rw-r--r--release_23/test/Transforms/InstCombine/2005-07-07-DeadPHILoop.ll14
-rw-r--r--release_23/test/Transforms/InstCombine/2006-02-07-SextZextCrash.ll21
-rw-r--r--release_23/test/Transforms/InstCombine/2006-02-13-DemandedMiscompile.ll10
-rw-r--r--release_23/test/Transforms/InstCombine/2006-02-28-Crash.ll8
-rw-r--r--release_23/test/Transforms/InstCombine/2006-03-30-ExtractElement.ll8
-rw-r--r--release_23/test/Transforms/InstCombine/2006-04-01-InfLoop.ll444
-rw-r--r--release_23/test/Transforms/InstCombine/2006-04-28-ShiftShiftLongLong.ll11
-rw-r--r--release_23/test/Transforms/InstCombine/2006-05-04-DemandedBitCrash.ll51
-rw-r--r--release_23/test/Transforms/InstCombine/2006-05-06-Infloop.ll519
-rw-r--r--release_23/test/Transforms/InstCombine/2006-06-28-infloop.ll20
-rw-r--r--release_23/test/Transforms/InstCombine/2006-09-11-EmptyStructCrash.ll46
-rw-r--r--release_23/test/Transforms/InstCombine/2006-09-15-CastToBool.ll14
-rw-r--r--release_23/test/Transforms/InstCombine/2006-10-19-SignedToUnsignedCastAndConst-2.ll10
-rw-r--r--release_23/test/Transforms/InstCombine/2006-10-19-SignedToUnsignedCastAndConst.ll12
-rw-r--r--release_23/test/Transforms/InstCombine/2006-10-20-mask.ll11
-rw-r--r--release_23/test/Transforms/InstCombine/2006-10-26-VectorReassoc.ll9
-rw-r--r--release_23/test/Transforms/InstCombine/2006-11-03-Memmove64.ll16
-rw-r--r--release_23/test/Transforms/InstCombine/2006-11-10-ashr-miscompile.ll9
-rw-r--r--release_23/test/Transforms/InstCombine/2006-11-27-XorBug.ll12
-rw-r--r--release_23/test/Transforms/InstCombine/2006-12-01-BadFPVectorXform.ll9
-rw-r--r--release_23/test/Transforms/InstCombine/2006-12-05-fp-to-int-ext.ll12
-rw-r--r--release_23/test/Transforms/InstCombine/2006-12-08-ICmp-Combining.ll18
-rw-r--r--release_23/test/Transforms/InstCombine/2006-12-08-Phi-ICmp-Op-Fold.ll51
-rw-r--r--release_23/test/Transforms/InstCombine/2006-12-08-Select-ICmp.ll41
-rw-r--r--release_23/test/Transforms/InstCombine/2006-12-10-ICmp-GEP-GEP.ll162
-rw-r--r--release_23/test/Transforms/InstCombine/2006-12-15-Range-Test.ll31
-rw-r--r--release_23/test/Transforms/InstCombine/2006-12-23-Select-Cmp-Cmp.ll30
-rw-r--r--release_23/test/Transforms/InstCombine/2007-01-13-ExtCompareMiscompile.ll10
-rw-r--r--release_23/test/Transforms/InstCombine/2007-01-14-FcmpSelf.ll6
-rw-r--r--release_23/test/Transforms/InstCombine/2007-01-18-VectorInfLoop.ll7
-rw-r--r--release_23/test/Transforms/InstCombine/2007-01-27-AndICmp.ll8
-rw-r--r--release_23/test/Transforms/InstCombine/2007-02-01-LoadSinkAlloca.ll45
-rw-r--r--release_23/test/Transforms/InstCombine/2007-02-07-PointerCast.ll22
-rw-r--r--release_23/test/Transforms/InstCombine/2007-02-23-PhiFoldInfLoop.ll31
-rw-r--r--release_23/test/Transforms/InstCombine/2007-03-13-CompareMerge.ll9
-rw-r--r--release_23/test/Transforms/InstCombine/2007-03-19-BadTruncChangePR1261.ll10
-rw-r--r--release_23/test/Transforms/InstCombine/2007-03-21-SignedRangeTest.ll7
-rw-r--r--release_23/test/Transforms/InstCombine/2007-03-25-BadShiftMask.ll29
-rw-r--r--release_23/test/Transforms/InstCombine/2007-03-25-DoubleShift.ll9
-rw-r--r--release_23/test/Transforms/InstCombine/2007-03-26-BadShiftMask.ll36
-rw-r--r--release_23/test/Transforms/InstCombine/2007-03-27-PR1280.ll15
-rw-r--r--release_23/test/Transforms/InstCombine/2007-03-31-InfiniteLoop.ll302
-rw-r--r--release_23/test/Transforms/InstCombine/2007-04-04-BadFoldBitcastIntoMalloc.ll19
-rw-r--r--release_23/test/Transforms/InstCombine/2007-04-08-SingleEltVectorCrash.ll7
-rw-r--r--release_23/test/Transforms/InstCombine/2007-05-04-Crash.ll30
-rw-r--r--release_23/test/Transforms/InstCombine/2007-05-10-icmp-or.ll8
-rw-r--r--release_23/test/Transforms/InstCombine/2007-05-14-Crash.ll18
-rw-r--r--release_23/test/Transforms/InstCombine/2007-05-18-CastFoldBug.ll10
-rw-r--r--release_23/test/Transforms/InstCombine/2007-06-06-AshrSignBit.ll22
-rw-r--r--release_23/test/Transforms/InstCombine/2007-06-21-DivCompareMiscomp.ll9
-rw-r--r--release_23/test/Transforms/InstCombine/2007-08-02-InfiniteLoop.ll10
-rw-r--r--release_23/test/Transforms/InstCombine/2007-09-05-EqualGEP.ll10
-rw-r--r--release_23/test/Transforms/InstCombine/2007-09-10-AliasConstFold.ll13
-rw-r--r--release_23/test/Transforms/InstCombine/2007-09-11-Trampoline.ll24
-rw-r--r--release_23/test/Transforms/InstCombine/2007-09-17-AliasConstFold2.ll14
-rw-r--r--release_23/test/Transforms/InstCombine/2007-10-10-EliminateMemCpy.ll20
-rw-r--r--release_23/test/Transforms/InstCombine/2007-10-12-Crash.ll38
-rw-r--r--release_23/test/Transforms/InstCombine/2007-10-28-EmptyField.ll24
-rw-r--r--release_23/test/Transforms/InstCombine/2007-10-28-stacksave.ll47
-rw-r--r--release_23/test/Transforms/InstCombine/2007-10-31-RangeCrash.ll35
-rw-r--r--release_23/test/Transforms/InstCombine/2007-10-31-StringCrash.ll21
-rw-r--r--release_23/test/Transforms/InstCombine/2007-11-07-OpaqueAlignCrash.ll22
-rw-r--r--release_23/test/Transforms/InstCombine/2007-11-15-CompareMiscomp.ll10
-rw-r--r--release_23/test/Transforms/InstCombine/2007-11-22-IcmpCrash.ll16
-rw-r--r--release_23/test/Transforms/InstCombine/2007-11-25-CompatibleAttributes.ll12
-rw-r--r--release_23/test/Transforms/InstCombine/2007-12-10-ConstFoldCompare.ll9
-rw-r--r--release_23/test/Transforms/InstCombine/2007-12-12-GEPScale.ll10
-rw-r--r--release_23/test/Transforms/InstCombine/2007-12-16-AsmNoUnwind.ll7
-rw-r--r--release_23/test/Transforms/InstCombine/2007-12-18-AddSelCmpSub.ll29
-rw-r--r--release_23/test/Transforms/InstCombine/2007-12-28-IcmpSub2.ll89
-rw-r--r--release_23/test/Transforms/InstCombine/2008-01-06-BitCastAttributes.ll22
-rw-r--r--release_23/test/Transforms/InstCombine/2008-01-06-CastCrash.ll10
-rw-r--r--release_23/test/Transforms/InstCombine/2008-01-06-VoidCast.ll10
-rw-r--r--release_23/test/Transforms/InstCombine/2008-01-13-AndCmpCmp.ll9
-rw-r--r--release_23/test/Transforms/InstCombine/2008-01-13-NoBitCastAttributes.ll15
-rw-r--r--release_23/test/Transforms/InstCombine/2008-01-14-DoubleNest.ll24
-rw-r--r--release_23/test/Transforms/InstCombine/2008-01-14-VarArgTrampoline.ll24
-rw-r--r--release_23/test/Transforms/InstCombine/2008-01-21-MismatchedCastAndCompare.ll17
-rw-r--r--release_23/test/Transforms/InstCombine/2008-01-21-MulTrunc.ll11
-rw-r--r--release_23/test/Transforms/InstCombine/2008-01-27-FloatSelect.ll7
-rw-r--r--release_23/test/Transforms/InstCombine/2008-01-29-AddICmp.ll20
-rw-r--r--release_23/test/Transforms/InstCombine/2008-02-04-GEPIdxBug.ll33
-rw-r--r--release_23/test/Transforms/InstCombine/2008-02-13-MulURem.ll8
-rw-r--r--release_23/test/Transforms/InstCombine/2008-02-16-SDivOverflow.ll14
-rw-r--r--release_23/test/Transforms/InstCombine/2008-02-16-SDivOverflow2.ll9
-rw-r--r--release_23/test/Transforms/InstCombine/2008-02-23-MulSub.ll9
-rw-r--r--release_23/test/Transforms/InstCombine/2008-02-28-OrFCmpCrash.ll16
-rw-r--r--release_23/test/Transforms/InstCombine/2008-03-13-IntToPtr.ll9
-rw-r--r--release_23/test/Transforms/InstCombine/2008-04-22-ByValBitcast.ll15
-rw-r--r--release_23/test/Transforms/InstCombine/2008-04-28-VolatileStore.ll8
-rw-r--r--release_23/test/Transforms/InstCombine/2008-04-29-VolatileLoadDontMerge.ll25
-rw-r--r--release_23/test/Transforms/InstCombine/2008-04-29-VolatileLoadMerge.ll21
-rw-r--r--release_23/test/Transforms/InstCombine/2008-05-08-LiveStoreDelete.ll25
-rw-r--r--release_23/test/Transforms/InstCombine/2008-05-08-StrLenSink.ll28
-rw-r--r--release_23/test/Transforms/InstCombine/CPP_min_max.ll34
-rw-r--r--release_23/test/Transforms/InstCombine/GEPIdxCanon.ll10
-rw-r--r--release_23/test/Transforms/InstCombine/IntPtrCast.ll9
-rw-r--r--release_23/test/Transforms/InstCombine/JavaCompare.ll15
-rw-r--r--release_23/test/Transforms/InstCombine/README.txt4
-rw-r--r--release_23/test/Transforms/InstCombine/add.ll277
-rw-r--r--release_23/test/Transforms/InstCombine/add2.ll31
-rw-r--r--release_23/test/Transforms/InstCombine/addnegneg.ll12
-rw-r--r--release_23/test/Transforms/InstCombine/align-2d-gep.ll43
-rw-r--r--release_23/test/Transforms/InstCombine/align-addr.ll30
-rw-r--r--release_23/test/Transforms/InstCombine/align-inc.ll14
-rw-r--r--release_23/test/Transforms/InstCombine/alloca.ll31
-rw-r--r--release_23/test/Transforms/InstCombine/and-compare.ll11
-rw-r--r--release_23/test/Transforms/InstCombine/and-or-and.ll61
-rw-r--r--release_23/test/Transforms/InstCombine/and-or-not.ll46
-rw-r--r--release_23/test/Transforms/InstCombine/and-xor-merge.ll19
-rw-r--r--release_23/test/Transforms/InstCombine/and.ll255
-rw-r--r--release_23/test/Transforms/InstCombine/and2.ll12
-rw-r--r--release_23/test/Transforms/InstCombine/apint-add1.ll34
-rw-r--r--release_23/test/Transforms/InstCombine/apint-add2.ll46
-rw-r--r--release_23/test/Transforms/InstCombine/apint-and-compare.ll16
-rw-r--r--release_23/test/Transforms/InstCombine/apint-and-or-and.ll50
-rw-r--r--release_23/test/Transforms/InstCombine/apint-and-xor-merge.ll22
-rw-r--r--release_23/test/Transforms/InstCombine/apint-and1.ll57
-rw-r--r--release_23/test/Transforms/InstCombine/apint-and2.ll82
-rw-r--r--release_23/test/Transforms/InstCombine/apint-call-cast-target.ll13
-rw-r--r--release_23/test/Transforms/InstCombine/apint-cast-and-cast.ll15
-rw-r--r--release_23/test/Transforms/InstCombine/apint-cast-cast-to-and.ll8
-rw-r--r--release_23/test/Transforms/InstCombine/apint-cast.ll20
-rw-r--r--release_23/test/Transforms/InstCombine/apint-div1.ll22
-rw-r--r--release_23/test/Transforms/InstCombine/apint-div2.ll22
-rw-r--r--release_23/test/Transforms/InstCombine/apint-elim-logicalops.ll39
-rw-r--r--release_23/test/Transforms/InstCombine/apint-mul1.ll11
-rw-r--r--release_23/test/Transforms/InstCombine/apint-mul2.ll12
-rw-r--r--release_23/test/Transforms/InstCombine/apint-not.ll42
-rw-r--r--release_23/test/Transforms/InstCombine/apint-or1.ll36
-rw-r--r--release_23/test/Transforms/InstCombine/apint-or2.ll35
-rw-r--r--release_23/test/Transforms/InstCombine/apint-rem1.ll22
-rw-r--r--release_23/test/Transforms/InstCombine/apint-rem2.ll22
-rw-r--r--release_23/test/Transforms/InstCombine/apint-select.ll44
-rw-r--r--release_23/test/Transforms/InstCombine/apint-shift-simplify.ll23
-rw-r--r--release_23/test/Transforms/InstCombine/apint-shift.ll191
-rw-r--r--release_23/test/Transforms/InstCombine/apint-shl-trunc.ll14
-rw-r--r--release_23/test/Transforms/InstCombine/apint-sub.ll139
-rw-r--r--release_23/test/Transforms/InstCombine/apint-xor1.ll50
-rw-r--r--release_23/test/Transforms/InstCombine/apint-xor2.ll51
-rw-r--r--release_23/test/Transforms/InstCombine/apint-zext1.ll9
-rw-r--r--release_23/test/Transforms/InstCombine/apint-zext2.ll9
-rw-r--r--release_23/test/Transforms/InstCombine/binop-cast.ll7
-rw-r--r--release_23/test/Transforms/InstCombine/bit-tracking.ll26
-rw-r--r--release_23/test/Transforms/InstCombine/bitcast-gep.ll19
-rw-r--r--release_23/test/Transforms/InstCombine/bitcast-vector-fold.ll33
-rw-r--r--release_23/test/Transforms/InstCombine/bitcount.ll19
-rw-r--r--release_23/test/Transforms/InstCombine/bittest.ll30
-rw-r--r--release_23/test/Transforms/InstCombine/bswap-fold.ll29
-rw-r--r--release_23/test/Transforms/InstCombine/bswap.ll57
-rw-r--r--release_23/test/Transforms/InstCombine/call-cast-target.ll14
-rw-r--r--release_23/test/Transforms/InstCombine/call-intrinsics.ll19
-rw-r--r--release_23/test/Transforms/InstCombine/call.ll77
-rw-r--r--release_23/test/Transforms/InstCombine/call2.ll27
-rw-r--r--release_23/test/Transforms/InstCombine/canonicalize_branch.ll36
-rw-r--r--release_23/test/Transforms/InstCombine/cast-and-cast.ll17
-rw-r--r--release_23/test/Transforms/InstCombine/cast-cast-to-and.ll9
-rw-r--r--release_23/test/Transforms/InstCombine/cast-load-gep.ll20
-rw-r--r--release_23/test/Transforms/InstCombine/cast-malloc.ll15
-rw-r--r--release_23/test/Transforms/InstCombine/cast-propagate.ll11
-rw-r--r--release_23/test/Transforms/InstCombine/cast-set.ll51
-rw-r--r--release_23/test/Transforms/InstCombine/cast.ll240
-rw-r--r--release_23/test/Transforms/InstCombine/cast2.ll29
-rw-r--r--release_23/test/Transforms/InstCombine/cast_ptr.ll19
-rw-r--r--release_23/test/Transforms/InstCombine/deadcode.ll24
-rw-r--r--release_23/test/Transforms/InstCombine/dg.exp3
-rw-r--r--release_23/test/Transforms/InstCombine/div.ll74
-rw-r--r--release_23/test/Transforms/InstCombine/fold-vector-zero.ll35
-rw-r--r--release_23/test/Transforms/InstCombine/fpcast.ll15
-rw-r--r--release_23/test/Transforms/InstCombine/fpextend.ll36
-rw-r--r--release_23/test/Transforms/InstCombine/getelementptr-setcc.ll31
-rw-r--r--release_23/test/Transforms/InstCombine/getelementptr-seteq.ll13
-rw-r--r--release_23/test/Transforms/InstCombine/getelementptr.ll81
-rw-r--r--release_23/test/Transforms/InstCombine/getelementptr_cast.ll11
-rw-r--r--release_23/test/Transforms/InstCombine/getelementptr_const.ll15
-rw-r--r--release_23/test/Transforms/InstCombine/getelementptr_index.ll9
-rw-r--r--release_23/test/Transforms/InstCombine/hoist_instr.ll17
-rw-r--r--release_23/test/Transforms/InstCombine/icmp.ll31
-rw-r--r--release_23/test/Transforms/InstCombine/known_align.ll27
-rw-r--r--release_23/test/Transforms/InstCombine/load.ll70
-rw-r--r--release_23/test/Transforms/InstCombine/load2.ll11
-rw-r--r--release_23/test/Transforms/InstCombine/loadstore-alignment.ll66
-rw-r--r--release_23/test/Transforms/InstCombine/malloc-free-delete.ll11
-rw-r--r--release_23/test/Transforms/InstCombine/malloc.ll7
-rw-r--r--release_23/test/Transforms/InstCombine/malloc2.ll19
-rw-r--r--release_23/test/Transforms/InstCombine/malloc3.ll26
-rw-r--r--release_23/test/Transforms/InstCombine/memcpy-to-load.ll14
-rw-r--r--release_23/test/Transforms/InstCombine/memmove.ll36
-rw-r--r--release_23/test/Transforms/InstCombine/memset.ll15
-rw-r--r--release_23/test/Transforms/InstCombine/mul-masked-bits.ll10
-rw-r--r--release_23/test/Transforms/InstCombine/mul.ll80
-rw-r--r--release_23/test/Transforms/InstCombine/narrow.ll18
-rw-r--r--release_23/test/Transforms/InstCombine/not-fcmp.ll10
-rw-r--r--release_23/test/Transforms/InstCombine/not.ll54
-rw-r--r--release_23/test/Transforms/InstCombine/or.ll171
-rw-r--r--release_23/test/Transforms/InstCombine/or2.ll12
-rw-r--r--release_23/test/Transforms/InstCombine/phi-merge.ll31
-rw-r--r--release_23/test/Transforms/InstCombine/phi.ll101
-rw-r--r--release_23/test/Transforms/InstCombine/rem.ll83
-rw-r--r--release_23/test/Transforms/InstCombine/select.ll204
-rw-r--r--release_23/test/Transforms/InstCombine/set.ll171
-rw-r--r--release_23/test/Transforms/InstCombine/setcc-cast-cast.ll46
-rw-r--r--release_23/test/Transforms/InstCombine/setcc-strength-reduce.ll37
-rw-r--r--release_23/test/Transforms/InstCombine/sext-misc.ll45
-rw-r--r--release_23/test/Transforms/InstCombine/shift-simplify.ll42
-rw-r--r--release_23/test/Transforms/InstCombine/shift-sra.ll19
-rw-r--r--release_23/test/Transforms/InstCombine/shift-trunc-shift.ll10
-rw-r--r--release_23/test/Transforms/InstCombine/shift.ll209
-rw-r--r--release_23/test/Transforms/InstCombine/shl-icmp.ll29
-rw-r--r--release_23/test/Transforms/InstCombine/shl-trunc.ll9
-rw-r--r--release_23/test/Transforms/InstCombine/signext.ll45
-rw-r--r--release_23/test/Transforms/InstCombine/sink_instruction.ll19
-rw-r--r--release_23/test/Transforms/InstCombine/srem-simplify-bug.ll9
-rw-r--r--release_23/test/Transforms/InstCombine/srem.ll8
-rw-r--r--release_23/test/Transforms/InstCombine/stacksaverestore.ll56
-rw-r--r--release_23/test/Transforms/InstCombine/store-merge.ll37
-rw-r--r--release_23/test/Transforms/InstCombine/store.ll17
-rw-r--r--release_23/test/Transforms/InstCombine/sub.ll146
-rw-r--r--release_23/test/Transforms/InstCombine/udiv-simplify-bug-0.ll14
-rw-r--r--release_23/test/Transforms/InstCombine/udiv-simplify-bug-1.ll25
-rw-r--r--release_23/test/Transforms/InstCombine/udiv_select_to_select_shift.ll17
-rw-r--r--release_23/test/Transforms/InstCombine/urem-simplify-bug.ll32
-rw-r--r--release_23/test/Transforms/InstCombine/urem.ll8
-rw-r--r--release_23/test/Transforms/InstCombine/vec_demanded_elts.ll47
-rw-r--r--release_23/test/Transforms/InstCombine/vec_extract_elt.ll9
-rw-r--r--release_23/test/Transforms/InstCombine/vec_insert_to_shuffle.ll19
-rw-r--r--release_23/test/Transforms/InstCombine/vec_insertelt.ll7
-rw-r--r--release_23/test/Transforms/InstCombine/vec_narrow.ll12
-rw-r--r--release_23/test/Transforms/InstCombine/vec_shuffle.ll47
-rw-r--r--release_23/test/Transforms/InstCombine/vector-srem.ll9
-rw-r--r--release_23/test/Transforms/InstCombine/volatile_store.ll14
-rw-r--r--release_23/test/Transforms/InstCombine/xor-undef.ll6
-rw-r--r--release_23/test/Transforms/InstCombine/xor.ll193
-rw-r--r--release_23/test/Transforms/InstCombine/xor2.ll17
-rw-r--r--release_23/test/Transforms/InstCombine/zero-point-zero-add.ll15
-rw-r--r--release_23/test/Transforms/InstCombine/zeroext-and-reduce.ll10
-rw-r--r--release_23/test/Transforms/InstCombine/zext-fold.ll13
-rw-r--r--release_23/test/Transforms/InstCombine/zext-or-icmp.ll35
-rw-r--r--release_23/test/Transforms/InstCombine/zext.ll10
-rw-r--r--release_23/test/Transforms/JumpThreading/2008-04-24-InfLoop.ll142
-rw-r--r--release_23/test/Transforms/JumpThreading/2008-05-05-MRV-Crash.ll25
-rw-r--r--release_23/test/Transforms/JumpThreading/and-and-cond.ll33
-rw-r--r--release_23/test/Transforms/JumpThreading/and-cond.ll32
-rw-r--r--release_23/test/Transforms/JumpThreading/basic.ll31
-rw-r--r--release_23/test/Transforms/JumpThreading/compare.ll30
-rw-r--r--release_23/test/Transforms/JumpThreading/dg.exp3
-rw-r--r--release_23/test/Transforms/LCSSA/2006-06-03-IncorrectIDFPhis.ll23
-rw-r--r--release_23/test/Transforms/LCSSA/2006-06-12-MultipleExitsSameBlock.ll27
-rw-r--r--release_23/test/Transforms/LCSSA/2006-07-09-NoDominator.ll24
-rw-r--r--release_23/test/Transforms/LCSSA/2006-10-31-UnreachableBlock-2.ll145
-rw-r--r--release_23/test/Transforms/LCSSA/2006-10-31-UnreachableBlock.ll184
-rw-r--r--release_23/test/Transforms/LCSSA/2007-07-12-LICM-2.ll17
-rw-r--r--release_23/test/Transforms/LCSSA/2007-07-12-LICM-3.ll24
-rw-r--r--release_23/test/Transforms/LCSSA/2007-07-12-LICM.ll14
-rw-r--r--release_23/test/Transforms/LCSSA/basictest.ll24
-rw-r--r--release_23/test/Transforms/LCSSA/dg.exp3
-rw-r--r--release_23/test/Transforms/LICM/2003-02-26-LoopExitNotDominated.ll18
-rw-r--r--release_23/test/Transforms/LICM/2003-02-27-NestedLoopExitBlocks.ll17
-rw-r--r--release_23/test/Transforms/LICM/2003-02-27-PreheaderExitNodeUpdate.ll16
-rw-r--r--release_23/test/Transforms/LICM/2003-02-27-PreheaderProblem.ll24
-rw-r--r--release_23/test/Transforms/LICM/2003-02-27-StoreSinkPHIs.ll15
-rw-r--r--release_23/test/Transforms/LICM/2003-02-28-PromoteDifferentType.ll15
-rw-r--r--release_23/test/Transforms/LICM/2003-05-02-LoadHoist.ll23
-rw-r--r--release_23/test/Transforms/LICM/2003-08-04-TrappingInstHoist.ll26
-rw-r--r--release_23/test/Transforms/LICM/2003-08-04-TrappingInstOkHoist.ll21
-rw-r--r--release_23/test/Transforms/LICM/2003-12-11-SinkingToPHI.ll16
-rw-r--r--release_23/test/Transforms/LICM/2003-12-13-VolatilePromote.ll16
-rw-r--r--release_23/test/Transforms/LICM/2004-09-14-AliasAnalysisInvalidate.ll19
-rw-r--r--release_23/test/Transforms/LICM/2004-11-17-UndefIndexCrash.ll20
-rw-r--r--release_23/test/Transforms/LICM/2005-03-24-LICM-Aggregate-Crash.ll9
-rw-r--r--release_23/test/Transforms/LICM/2006-09-12-DeadUserOfSunkInstr.ll148
-rw-r--r--release_23/test/Transforms/LICM/2007-05-22-VolatileSink.ll56
-rw-r--r--release_23/test/Transforms/LICM/2007-07-30-AliasSet.ll39
-rw-r--r--release_23/test/Transforms/LICM/2007-09-17-PromoteValue.ll61
-rw-r--r--release_23/test/Transforms/LICM/2007-09-24-PromoteNullValue.ll46
-rw-r--r--release_23/test/Transforms/LICM/2007-10-01-PromoteSafeValue.ll21
-rw-r--r--release_23/test/Transforms/LICM/Preserve-LCSSA.ll25
-rw-r--r--release_23/test/Transforms/LICM/basictest.ll15
-rw-r--r--release_23/test/Transforms/LICM/call_sink_const_function.ll17
-rw-r--r--release_23/test/Transforms/LICM/call_sink_pure_function.ll16
-rw-r--r--release_23/test/Transforms/LICM/dg.exp3
-rw-r--r--release_23/test/Transforms/LICM/no-preheader-test.ll20
-rw-r--r--release_23/test/Transforms/LICM/scalar_promote.ll35
-rw-r--r--release_23/test/Transforms/LICM/sink_critical_edge.ll16
-rw-r--r--release_23/test/Transforms/LICM/sink_inst.ll20
-rw-r--r--release_23/test/Transforms/LICM/sink_load.ll21
-rw-r--r--release_23/test/Transforms/LICM/sink_multiple.ll21
-rw-r--r--release_23/test/Transforms/LICM/sink_multiple_exits.ll24
-rw-r--r--release_23/test/Transforms/LICM/sink_only_some_exits.ll23
-rw-r--r--release_23/test/Transforms/LICM/sink_phi_node_use.ll21
-rw-r--r--release_23/test/Transforms/LICM/sink_trapping_inst.ll18
-rw-r--r--release_23/test/Transforms/LoopDeletion/2007-07-23-InfiniteLoop.ll13
-rw-r--r--release_23/test/Transforms/LoopDeletion/2008-05-06-Phi.ll109
-rw-r--r--release_23/test/Transforms/LoopDeletion/dg.exp3
-rw-r--r--release_23/test/Transforms/LoopIndexSplit/2007-09-21-LoopBound.ll63
-rw-r--r--release_23/test/Transforms/LoopIndexSplit/2007-09-24-UpdateIterationSpace.ll57
-rw-r--r--release_23/test/Transforms/LoopIndexSplit/2007-09-25-UpdateIterationSpace-2.ll59
-rw-r--r--release_23/test/Transforms/LoopIndexSplit/2008-01-28-IndDecrement.ll46
-rw-r--r--release_23/test/Transforms/LoopIndexSplit/2008-02-08-Crash.ll48
-rw-r--r--release_23/test/Transforms/LoopIndexSplit/2008-02-13-ExitValueNum.ll67
-rw-r--r--release_23/test/Transforms/LoopIndexSplit/2008-02-13-LoopLatch.ll72
-rw-r--r--release_23/test/Transforms/LoopIndexSplit/2008-02-13-LoopLatchPHI.ll74
-rw-r--r--release_23/test/Transforms/LoopIndexSplit/2008-02-14-Crash.ll464
-rw-r--r--release_23/test/Transforms/LoopIndexSplit/2008-03-24-ExitPhi.ll69
-rw-r--r--release_23/test/Transforms/LoopIndexSplit/Crash-2007-08-17.ll52
-rw-r--r--release_23/test/Transforms/LoopIndexSplit/Crash-2007-12-03.ll44
-rw-r--r--release_23/test/Transforms/LoopIndexSplit/Crash2-2007-08-17.ll58
-rw-r--r--release_23/test/Transforms/LoopIndexSplit/ExitCondition-2007-09-10.ll50
-rw-r--r--release_23/test/Transforms/LoopIndexSplit/OneIterLoop-2007-08-17.ll61
-rw-r--r--release_23/test/Transforms/LoopIndexSplit/OneIterLoop2-2007-08-17.ll62
-rw-r--r--release_23/test/Transforms/LoopIndexSplit/OneIterLoop3-2007-08-17.ll35
-rw-r--r--release_23/test/Transforms/LoopIndexSplit/SaveLastValue-2007-08-17.ll52
-rw-r--r--release_23/test/Transforms/LoopIndexSplit/SplitValue-2007-08-24.ll52
-rw-r--r--release_23/test/Transforms/LoopIndexSplit/UpperBound-2007-08-24.ll52
-rw-r--r--release_23/test/Transforms/LoopIndexSplit/dg.exp3
-rw-r--r--release_23/test/Transforms/LoopRotate/LRCrash-1.ll18
-rw-r--r--release_23/test/Transforms/LoopRotate/LRCrash-2.ll24
-rw-r--r--release_23/test/Transforms/LoopRotate/LRCrash-3.ll29
-rw-r--r--release_23/test/Transforms/LoopRotate/LRCrash-4.ll18
-rw-r--r--release_23/test/Transforms/LoopRotate/LRCrash-5.ll26
-rw-r--r--release_23/test/Transforms/LoopRotate/PhiRename-1.ll95
-rw-r--r--release_23/test/Transforms/LoopRotate/PhiSelfRefernce-1.ll39
-rw-r--r--release_23/test/Transforms/LoopRotate/dg.exp3
-rw-r--r--release_23/test/Transforms/LoopSimplify/2003-04-25-AssertFail.ll20
-rw-r--r--release_23/test/Transforms/LoopSimplify/2003-05-12-PreheaderExitOfChild.ll42
-rw-r--r--release_23/test/Transforms/LoopSimplify/2003-08-15-PreheadersFail.ll52
-rw-r--r--release_23/test/Transforms/LoopSimplify/2003-12-10-ExitBlocksProblem.ll36
-rw-r--r--release_23/test/Transforms/LoopSimplify/2004-02-05-DominatorInfoCorruption.ll14
-rw-r--r--release_23/test/Transforms/LoopSimplify/2004-03-15-IncorrectDomUpdate.ll11
-rw-r--r--release_23/test/Transforms/LoopSimplify/2004-04-01-IncorrectDomUpdate.ll20
-rw-r--r--release_23/test/Transforms/LoopSimplify/2004-04-12-LoopSimplify-SwitchBackedges.ll18
-rw-r--r--release_23/test/Transforms/LoopSimplify/2004-04-13-LoopSimplifyUpdateDomFrontier.ll18
-rw-r--r--release_23/test/Transforms/LoopSimplify/2007-10-28-InvokeCrash.ll892
-rw-r--r--release_23/test/Transforms/LoopSimplify/basictest.ll16
-rw-r--r--release_23/test/Transforms/LoopSimplify/dg.exp3
-rw-r--r--release_23/test/Transforms/LoopSimplify/hardertest.ll15
-rw-r--r--release_23/test/Transforms/LoopSimplify/phi-node-simplify.ll55
-rw-r--r--release_23/test/Transforms/LoopSimplify/single-backedge.ll19
-rw-r--r--release_23/test/Transforms/LoopStrengthReduce/2005-08-15-AddRecIV.ll57
-rw-r--r--release_23/test/Transforms/LoopStrengthReduce/2005-08-17-OutOfLoopVariant.ll17
-rw-r--r--release_23/test/Transforms/LoopStrengthReduce/2005-09-12-UsesOutOutsideOfLoop.ll32
-rw-r--r--release_23/test/Transforms/LoopStrengthReduce/2007-04-23-UseIterator.ll71
-rw-r--r--release_23/test/Transforms/LoopStrengthReduce/dg.exp3
-rw-r--r--release_23/test/Transforms/LoopStrengthReduce/different-type-ivs.ll25
-rw-r--r--release_23/test/Transforms/LoopStrengthReduce/dont-hoist-simple-loop-constants.ll23
-rw-r--r--release_23/test/Transforms/LoopStrengthReduce/dont_insert_redundant_ops.ll36
-rw-r--r--release_23/test/Transforms/LoopStrengthReduce/dont_reduce_bytes.ll22
-rw-r--r--release_23/test/Transforms/LoopStrengthReduce/exit_compare_live_range.ll20
-rw-r--r--release_23/test/Transforms/LoopStrengthReduce/invariant_value_first.ll23
-rw-r--r--release_23/test/Transforms/LoopStrengthReduce/invariant_value_first_arg.ll20
-rw-r--r--release_23/test/Transforms/LoopStrengthReduce/nested-reduce.ll49
-rw-r--r--release_23/test/Transforms/LoopStrengthReduce/ops_after_indvar.ll24
-rw-r--r--release_23/test/Transforms/LoopStrengthReduce/phi_node_update_multiple_preds.ll28
-rw-r--r--release_23/test/Transforms/LoopStrengthReduce/related_indvars.ll27
-rw-r--r--release_23/test/Transforms/LoopStrengthReduce/remove_indvar.ll19
-rw-r--r--release_23/test/Transforms/LoopStrengthReduce/share_code_in_preheader.ll27
-rw-r--r--release_23/test/Transforms/LoopStrengthReduce/share_ivs.ll24
-rw-r--r--release_23/test/Transforms/LoopStrengthReduce/use_postinc_value_outside_loop.ll29
-rw-r--r--release_23/test/Transforms/LoopStrengthReduce/var_stride_used_by_compare.ll41
-rw-r--r--release_23/test/Transforms/LoopStrengthReduce/variable_stride.ll18
-rw-r--r--release_23/test/Transforms/LoopUnroll/2004-05-13-DontUnrollTooMuch.ll14
-rw-r--r--release_23/test/Transforms/LoopUnroll/2005-03-06-BadLoopInfoUpdate.ll22
-rw-r--r--release_23/test/Transforms/LoopUnroll/2006-08-24-MultiBlockLoop.ll16
-rw-r--r--release_23/test/Transforms/LoopUnroll/2007-04-16-PhiUpdate.ll17
-rw-r--r--release_23/test/Transforms/LoopUnroll/2007-05-05-UnrollMiscomp.ll36
-rw-r--r--release_23/test/Transforms/LoopUnroll/2007-05-09-UnknownTripCount.ll18
-rw-r--r--release_23/test/Transforms/LoopUnroll/2007-11-05-Crash.ll295
-rw-r--r--release_23/test/Transforms/LoopUnroll/dg.exp3
-rw-r--r--release_23/test/Transforms/LoopUnswitch/2006-02-14-LoopSimplifyCrash.ll1697
-rw-r--r--release_23/test/Transforms/LoopUnswitch/2006-02-22-UnswitchCrash.ll32
-rw-r--r--release_23/test/Transforms/LoopUnswitch/2006-06-13-SingleEntryPHI.ll35
-rw-r--r--release_23/test/Transforms/LoopUnswitch/2006-06-27-DeadSwitchCase.ll25
-rw-r--r--release_23/test/Transforms/LoopUnswitch/2007-05-09-Unreachable.ll28
-rw-r--r--release_23/test/Transforms/LoopUnswitch/2007-05-09-tl.ll95
-rw-r--r--release_23/test/Transforms/LoopUnswitch/2007-07-12-ExitDomInfo.ll45
-rw-r--r--release_23/test/Transforms/LoopUnswitch/2007-07-13-DomInfo.ll27
-rw-r--r--release_23/test/Transforms/LoopUnswitch/2007-07-18-DomInfo.ll66
-rw-r--r--release_23/test/Transforms/LoopUnswitch/2007-08-01-Dom.ll30
-rw-r--r--release_23/test/Transforms/LoopUnswitch/2007-08-01-LCSSA.ll55
-rw-r--r--release_23/test/Transforms/LoopUnswitch/2007-10-04-DomFrontier.ll29
-rw-r--r--release_23/test/Transforms/LoopUnswitch/basictest.ll31
-rw-r--r--release_23/test/Transforms/LoopUnswitch/dg.exp3
-rw-r--r--release_23/test/Transforms/LowerInvoke/2003-12-10-Crash.ll22
-rw-r--r--release_23/test/Transforms/LowerInvoke/2004-02-29-PHICrash.ll15
-rw-r--r--release_23/test/Transforms/LowerInvoke/2005-08-03-InvokeWithPHI.ll17
-rw-r--r--release_23/test/Transforms/LowerInvoke/2005-08-03-InvokeWithPHIUse.ll15
-rw-r--r--release_23/test/Transforms/LowerInvoke/2008-02-14-CritEdgePhiCrash.ll14
-rw-r--r--release_23/test/Transforms/LowerInvoke/basictest.ll30
-rw-r--r--release_23/test/Transforms/LowerInvoke/dg.exp3
-rw-r--r--release_23/test/Transforms/LowerSetJmp/2003-11-05-DominanceProperties.ll16
-rw-r--r--release_23/test/Transforms/LowerSetJmp/dg.exp3
-rw-r--r--release_23/test/Transforms/LowerSetJmp/simpletest.ll32
-rw-r--r--release_23/test/Transforms/LowerSwitch/2003-05-01-PHIProblem.ll15
-rw-r--r--release_23/test/Transforms/LowerSwitch/2003-08-23-EmptySwitch.ll9
-rw-r--r--release_23/test/Transforms/LowerSwitch/2004-03-13-SwitchIsDefaultCrash.ll19
-rw-r--r--release_23/test/Transforms/LowerSwitch/dg.exp3
-rw-r--r--release_23/test/Transforms/LowerSwitch/feature.ll51
-rw-r--r--release_23/test/Transforms/Mem2Reg/2002-03-28-UninitializedVal.ll11
-rw-r--r--release_23/test/Transforms/Mem2Reg/2002-05-01-ShouldNotPromoteThisAlloca.ll12
-rw-r--r--release_23/test/Transforms/Mem2Reg/2003-04-10-DFNotFound.ll10
-rw-r--r--release_23/test/Transforms/Mem2Reg/2003-04-18-DeadBlockProblem.ll16
-rw-r--r--release_23/test/Transforms/Mem2Reg/2003-04-24-MultipleIdenticalSuccessors.ll16
-rw-r--r--release_23/test/Transforms/Mem2Reg/2003-06-26-IterativePromote.ll16
-rw-r--r--release_23/test/Transforms/Mem2Reg/2003-10-05-DeadPHIInsertion.ll22
-rw-r--r--release_23/test/Transforms/Mem2Reg/2005-06-30-ReadBeforeWrite.ll47
-rw-r--r--release_23/test/Transforms/Mem2Reg/2005-11-28-Crash.ll62
-rw-r--r--release_23/test/Transforms/Mem2Reg/2007-08-27-VolatileLoadsStores.ll47
-rw-r--r--release_23/test/Transforms/Mem2Reg/PromoteMemToRegister.ll18
-rw-r--r--release_23/test/Transforms/Mem2Reg/UndefValuesMerge.ll13
-rw-r--r--release_23/test/Transforms/Mem2Reg/dg.exp3
-rw-r--r--release_23/test/Transforms/MemCpyOpt/2008-02-24-MultipleUseofSRet.ll34
-rw-r--r--release_23/test/Transforms/MemCpyOpt/2008-03-13-ReturnSlotBitcast.ll19
-rw-r--r--release_23/test/Transforms/MemCpyOpt/2008-04-29-SRetRemoval.ll17
-rw-r--r--release_23/test/Transforms/MemCpyOpt/dg.exp3
-rw-r--r--release_23/test/Transforms/MemCpyOpt/form-memset.ll55
-rw-r--r--release_23/test/Transforms/MemCpyOpt/form-memset2.ll99
-rw-r--r--release_23/test/Transforms/MemCpyOpt/memcpy.ll22
-rw-r--r--release_23/test/Transforms/MemCpyOpt/sret.ll28
-rw-r--r--release_23/test/Transforms/PredicateSimplifier/2006-08-02-Switch.ll19
-rw-r--r--release_23/test/Transforms/PredicateSimplifier/2006-08-07-LeaderOffByOne.ll23
-rw-r--r--release_23/test/Transforms/PredicateSimplifier/2006-09-20-ResolveCycle.ll24
-rw-r--r--release_23/test/Transforms/PredicateSimplifier/2006-09-20-SetCC.ll46
-rw-r--r--release_23/test/Transforms/PredicateSimplifier/2006-10-22-IntOr.ll48
-rw-r--r--release_23/test/Transforms/PredicateSimplifier/2006-10-25-AddSetCC.ll26
-rw-r--r--release_23/test/Transforms/PredicateSimplifier/2006-11-04-ImpossibleGT.ll16
-rw-r--r--release_23/test/Transforms/PredicateSimplifier/2006-11-04-ReplacingZeros.ll25
-rw-r--r--release_23/test/Transforms/PredicateSimplifier/2006-11-05-CycleGTLT.ll13
-rw-r--r--release_23/test/Transforms/PredicateSimplifier/2006-11-11-Squeeze.ll25
-rw-r--r--release_23/test/Transforms/PredicateSimplifier/2006-11-12-MergeNodes.ll41
-rw-r--r--release_23/test/Transforms/PredicateSimplifier/2007-01-04-SelectSwitch.ll17
-rw-r--r--release_23/test/Transforms/PredicateSimplifier/2007-03-17-OpsToDefVRP.ll19
-rw-r--r--release_23/test/Transforms/PredicateSimplifier/2007-09-19-Subtract.ll102
-rw-r--r--release_23/test/Transforms/PredicateSimplifier/dg.exp3
-rw-r--r--release_23/test/Transforms/PredicateSimplifier/predsimplify.ll279
-rw-r--r--release_23/test/Transforms/PredicateSimplifier/predsimplify.reg1.ll20
-rw-r--r--release_23/test/Transforms/PredicateSimplifier/predsimplify.reg2.ll37
-rw-r--r--release_23/test/Transforms/PredicateSimplifier/predsimplify.reg3.ll22
-rw-r--r--release_23/test/Transforms/PredicateSimplifier/predsimplify.reg4.ll28
-rw-r--r--release_23/test/Transforms/PruneEH/2003-09-14-ExternalCall.ll11
-rw-r--r--release_23/test/Transforms/PruneEH/2003-11-21-PHIUpdate.ll15
-rw-r--r--release_23/test/Transforms/PruneEH/dg.exp3
-rw-r--r--release_23/test/Transforms/PruneEH/recursivetest.ll20
-rw-r--r--release_23/test/Transforms/PruneEH/simplenoreturntest.ll13
-rw-r--r--release_23/test/Transforms/PruneEH/simpletest.ll19
-rw-r--r--release_23/test/Transforms/RaiseAllocations/2004-11-08-FreeUseCrash.ll10
-rw-r--r--release_23/test/Transforms/RaiseAllocations/2007-10-17-InvokeFree.ll17
-rw-r--r--release_23/test/Transforms/RaiseAllocations/FreeCastConstantExpr.ll11
-rw-r--r--release_23/test/Transforms/RaiseAllocations/dg.exp3
-rw-r--r--release_23/test/Transforms/Reassociate/2002-05-15-AgressiveSubMove.ll9
-rw-r--r--release_23/test/Transforms/Reassociate/2002-05-15-MissedTree.ll9
-rw-r--r--release_23/test/Transforms/Reassociate/2002-05-15-SubReassociate.ll12
-rw-r--r--release_23/test/Transforms/Reassociate/2002-05-15-SubReassociate2.ll13
-rw-r--r--release_23/test/Transforms/Reassociate/2002-07-09-DominanceProblem.ll10
-rw-r--r--release_23/test/Transforms/Reassociate/2003-08-12-InfiniteLoop.ll9
-rw-r--r--release_23/test/Transforms/Reassociate/2005-08-24-Crash.ll13
-rw-r--r--release_23/test/Transforms/Reassociate/2005-09-01-ArrayOutOfBounds.ll23
-rw-r--r--release_23/test/Transforms/Reassociate/2006-04-27-ReassociateVector.ll8
-rw-r--r--release_23/test/Transforms/Reassociate/basictest.ll10
-rw-r--r--release_23/test/Transforms/Reassociate/basictest2.ll11
-rw-r--r--release_23/test/Transforms/Reassociate/basictest3.ll54
-rw-r--r--release_23/test/Transforms/Reassociate/basictest4.ll23
-rw-r--r--release_23/test/Transforms/Reassociate/dg.exp3
-rw-r--r--release_23/test/Transforms/Reassociate/inverses.ll28
-rw-r--r--release_23/test/Transforms/Reassociate/looptest.ll50
-rw-r--r--release_23/test/Transforms/Reassociate/mul-factor3.ll16
-rw-r--r--release_23/test/Transforms/Reassociate/mul-neg-add.ll10
-rw-r--r--release_23/test/Transforms/Reassociate/mulfactor.ll14
-rw-r--r--release_23/test/Transforms/Reassociate/mulfactor2.ll16
-rw-r--r--release_23/test/Transforms/Reassociate/negation.ll21
-rw-r--r--release_23/test/Transforms/Reassociate/otherops.ll28
-rw-r--r--release_23/test/Transforms/Reassociate/shift-factor.ll13
-rw-r--r--release_23/test/Transforms/Reassociate/shifttest.ll12
-rw-r--r--release_23/test/Transforms/Reassociate/subtest.ll11
-rw-r--r--release_23/test/Transforms/Reassociate/subtest2.ll13
-rw-r--r--release_23/test/Transforms/SCCP/2002-05-02-EdgeFailure.ll26
-rw-r--r--release_23/test/Transforms/SCCP/2002-05-02-MissSecondInst.ll8
-rw-r--r--release_23/test/Transforms/SCCP/2002-05-20-MissedIncomingValue.ll19
-rw-r--r--release_23/test/Transforms/SCCP/2002-05-21-InvalidSimplify.ll33
-rw-r--r--release_23/test/Transforms/SCCP/2002-08-30-GetElementPtrTest.ll9
-rw-r--r--release_23/test/Transforms/SCCP/2003-06-24-OverdefinedPHIValue.ll30
-rw-r--r--release_23/test/Transforms/SCCP/2003-08-26-InvokeHandling.ll18
-rw-r--r--release_23/test/Transforms/SCCP/2004-11-16-DeadInvoke.ll13
-rw-r--r--release_23/test/Transforms/SCCP/2004-12-10-UndefBranchBug.ll12
-rw-r--r--release_23/test/Transforms/SCCP/2006-10-23-IPSCCP-Crash.ll103
-rw-r--r--release_23/test/Transforms/SCCP/2006-12-04-PackedType.ll140
-rw-r--r--release_23/test/Transforms/SCCP/2006-12-19-UndefBug.ll8
-rw-r--r--release_23/test/Transforms/SCCP/2007-05-16-InvokeCrash.ll41
-rw-r--r--release_23/test/Transforms/SCCP/2008-01-27-UndefCorrelate.ll36
-rw-r--r--release_23/test/Transforms/SCCP/2008-03-10-sret.ll14
-rw-r--r--release_23/test/Transforms/SCCP/2008-04-22-multiple-ret-sccp.ll11
-rw-r--r--release_23/test/Transforms/SCCP/apint-array.ll23
-rw-r--r--release_23/test/Transforms/SCCP/apint-basictest.ll16
-rw-r--r--release_23/test/Transforms/SCCP/apint-basictest2.ll17
-rw-r--r--release_23/test/Transforms/SCCP/apint-basictest3.ll23
-rw-r--r--release_23/test/Transforms/SCCP/apint-basictest4.ll25
-rw-r--r--release_23/test/Transforms/SCCP/apint-bigarray.ll23
-rw-r--r--release_23/test/Transforms/SCCP/apint-bigint.ll9
-rw-r--r--release_23/test/Transforms/SCCP/apint-bigint2.ll18
-rw-r--r--release_23/test/Transforms/SCCP/apint-ipsccp1.ll24
-rw-r--r--release_23/test/Transforms/SCCP/apint-ipsccp2.ll19
-rw-r--r--release_23/test/Transforms/SCCP/apint-ipsccp3.ll23
-rw-r--r--release_23/test/Transforms/SCCP/apint-ipsccp4.ll49
-rw-r--r--release_23/test/Transforms/SCCP/apint-load.ll36
-rw-r--r--release_23/test/Transforms/SCCP/apint-phi.ll19
-rw-r--r--release_23/test/Transforms/SCCP/apint-select.ll21
-rw-r--r--release_23/test/Transforms/SCCP/basictest.ll17
-rw-r--r--release_23/test/Transforms/SCCP/calltest.ll22
-rw-r--r--release_23/test/Transforms/SCCP/dg.exp3
-rw-r--r--release_23/test/Transforms/SCCP/ipsccp-basic.ll13
-rw-r--r--release_23/test/Transforms/SCCP/ipsccp-conditional.ll19
-rw-r--r--release_23/test/Transforms/SCCP/ipsccp-gvar.ll22
-rw-r--r--release_23/test/Transforms/SCCP/loadtest.ll26
-rw-r--r--release_23/test/Transforms/SCCP/logical-nuke.ll9
-rw-r--r--release_23/test/Transforms/SCCP/phitest.ll21
-rw-r--r--release_23/test/Transforms/SCCP/sccptest.ll31
-rw-r--r--release_23/test/Transforms/SCCP/select.ll12
-rw-r--r--release_23/test/Transforms/SRETPromotion/2008-03-07-Inline-2.ll53
-rw-r--r--release_23/test/Transforms/SRETPromotion/2008-03-07-Inline.ll57
-rw-r--r--release_23/test/Transforms/SRETPromotion/2008-03-11-attributes.ll7
-rw-r--r--release_23/test/Transforms/SRETPromotion/dg.exp3
-rw-r--r--release_23/test/Transforms/ScalarRepl/2003-05-29-ArrayFail.ll13
-rw-r--r--release_23/test/Transforms/ScalarRepl/2003-05-30-InvalidIndices.ll8
-rw-r--r--release_23/test/Transforms/ScalarRepl/2003-05-30-MultiLevel.ll10
-rw-r--r--release_23/test/Transforms/ScalarRepl/2003-09-12-IncorrectPromote.ll13
-rw-r--r--release_23/test/Transforms/ScalarRepl/2003-10-29-ArrayProblem.ll16
-rw-r--r--release_23/test/Transforms/ScalarRepl/2005-12-14-UnionPromoteCrash.ll28
-rw-r--r--release_23/test/Transforms/ScalarRepl/2006-01-24-IllegalUnionPromoteCrash.ll12
-rw-r--r--release_23/test/Transforms/ScalarRepl/2006-04-20-PromoteCrash.ll18
-rw-r--r--release_23/test/Transforms/ScalarRepl/2006-10-23-PointerUnionCrash.ll57
-rw-r--r--release_23/test/Transforms/ScalarRepl/2006-11-07-InvalidArrayPromote.ll20
-rw-r--r--release_23/test/Transforms/ScalarRepl/2006-12-11-SROA-Crash.ll20
-rw-r--r--release_23/test/Transforms/ScalarRepl/2007-03-19-CanonicalizeMemcpy.ll44
-rw-r--r--release_23/test/Transforms/ScalarRepl/2007-05-24-LargeAggregate.ll27
-rw-r--r--release_23/test/Transforms/ScalarRepl/2007-05-29-MemcpyPreserve.ll23
-rw-r--r--release_23/test/Transforms/ScalarRepl/2007-11-03-bigendian_apint.ll30
-rw-r--r--release_23/test/Transforms/ScalarRepl/2008-01-29-PromoteBug.ll21
-rw-r--r--release_23/test/Transforms/ScalarRepl/2008-02-28-SubElementExtractCrash.ll16
-rw-r--r--release_23/test/Transforms/ScalarRepl/AggregatePromote.ll51
-rw-r--r--release_23/test/Transforms/ScalarRepl/DifferingTypes.ll15
-rw-r--r--release_23/test/Transforms/ScalarRepl/arraytest.ll10
-rw-r--r--release_23/test/Transforms/ScalarRepl/badarray.ll11
-rw-r--r--release_23/test/Transforms/ScalarRepl/basictest.ll10
-rw-r--r--release_23/test/Transforms/ScalarRepl/dg.exp3
-rw-r--r--release_23/test/Transforms/ScalarRepl/memcpy-from-global.ll33
-rw-r--r--release_23/test/Transforms/ScalarRepl/memset-aggregate-byte-leader.ll23
-rw-r--r--release_23/test/Transforms/ScalarRepl/memset-aggregate.ll48
-rw-r--r--release_23/test/Transforms/ScalarRepl/phinodepromote.ll34
-rw-r--r--release_23/test/Transforms/ScalarRepl/select_promote.ll18
-rw-r--r--release_23/test/Transforms/ScalarRepl/sroa_two.ll13
-rw-r--r--release_23/test/Transforms/ScalarRepl/union-fp-int.ll13
-rw-r--r--release_23/test/Transforms/ScalarRepl/union-packed.ll13
-rw-r--r--release_23/test/Transforms/ScalarRepl/union-pointer.ll41
-rw-r--r--release_23/test/Transforms/ScalarRepl/vector_promote.ll55
-rw-r--r--release_23/test/Transforms/SimplifyCFG/2002-05-05-EmptyBlockMerge.ll22
-rw-r--r--release_23/test/Transforms/SimplifyCFG/2002-05-21-PHIElimination.ll19
-rw-r--r--release_23/test/Transforms/SimplifyCFG/2002-06-24-PHINode.ll14
-rw-r--r--release_23/test/Transforms/SimplifyCFG/2002-09-24-PHIAssertion.ll13
-rw-r--r--release_23/test/Transforms/SimplifyCFG/2003-03-07-DominateProblem.ll17
-rw-r--r--release_23/test/Transforms/SimplifyCFG/2003-08-05-InvokeCrash.ll13
-rw-r--r--release_23/test/Transforms/SimplifyCFG/2003-08-05-MishandleInvoke.ll12
-rw-r--r--release_23/test/Transforms/SimplifyCFG/2003-08-17-BranchFold.ll22
-rw-r--r--release_23/test/Transforms/SimplifyCFG/2003-08-17-BranchFoldOrdering.ll26
-rw-r--r--release_23/test/Transforms/SimplifyCFG/2003-08-17-FoldSwitch.ll80
-rw-r--r--release_23/test/Transforms/SimplifyCFG/2004-12-10-SimplifyCFGCrash.ll40
-rw-r--r--release_23/test/Transforms/SimplifyCFG/2005-06-16-PHICrash.ll95
-rw-r--r--release_23/test/Transforms/SimplifyCFG/2005-08-01-PHIUpdateFail.ll71
-rw-r--r--release_23/test/Transforms/SimplifyCFG/2005-08-03-PHIFactorCrash.ll75
-rw-r--r--release_23/test/Transforms/SimplifyCFG/2005-10-02-InvokeSimplify.ll15
-rw-r--r--release_23/test/Transforms/SimplifyCFG/2005-12-03-IncorrectPHIFold.ll124
-rw-r--r--release_23/test/Transforms/SimplifyCFG/2006-02-17-InfiniteUnroll.ll27
-rw-r--r--release_23/test/Transforms/SimplifyCFG/2006-06-12-InfLoop.ll413
-rw-r--r--release_23/test/Transforms/SimplifyCFG/2006-08-03-Crash.ll98
-rw-r--r--release_23/test/Transforms/SimplifyCFG/2006-10-19-UncondDiv.ll26
-rw-r--r--release_23/test/Transforms/SimplifyCFG/2006-10-29-InvokeCrash.ll555
-rw-r--r--release_23/test/Transforms/SimplifyCFG/2006-12-08-Ptr-ICmp-Branch.ll131
-rw-r--r--release_23/test/Transforms/SimplifyCFG/2007-11-22-InvokeNoUnwind.ll14
-rw-r--r--release_23/test/Transforms/SimplifyCFG/2007-12-21-Crash.ll37
-rw-r--r--release_23/test/Transforms/SimplifyCFG/2008-01-02-hoist-fp-add.ll26
-rw-r--r--release_23/test/Transforms/SimplifyCFG/2008-04-23-MergeMultipleResultRet.ll43
-rw-r--r--release_23/test/Transforms/SimplifyCFG/2008-04-27-MultipleReturnCrash.ll30
-rw-r--r--release_23/test/Transforms/SimplifyCFG/BrUnwind.ll15
-rw-r--r--release_23/test/Transforms/SimplifyCFG/DeadSetCC.ll28
-rw-r--r--release_23/test/Transforms/SimplifyCFG/EqualPHIEdgeBlockMerge.ll18
-rw-r--r--release_23/test/Transforms/SimplifyCFG/HoistCode.ll11
-rw-r--r--release_23/test/Transforms/SimplifyCFG/InvokeEliminate.ll18
-rw-r--r--release_23/test/Transforms/SimplifyCFG/PhiBlockMerge.ll22
-rw-r--r--release_23/test/Transforms/SimplifyCFG/PhiBlockMerge2.ll27
-rw-r--r--release_23/test/Transforms/SimplifyCFG/PhiEliminate.ll41
-rw-r--r--release_23/test/Transforms/SimplifyCFG/PhiEliminate2.ll14
-rw-r--r--release_23/test/Transforms/SimplifyCFG/PhiNoEliminate.ll27
-rw-r--r--release_23/test/Transforms/SimplifyCFG/UncondBranchToReturn.ll33
-rw-r--r--release_23/test/Transforms/SimplifyCFG/UnreachableEliminate.ll33
-rw-r--r--release_23/test/Transforms/SimplifyCFG/basictest.ll25
-rw-r--r--release_23/test/Transforms/SimplifyCFG/branch-cond-merge.ll19
-rw-r--r--release_23/test/Transforms/SimplifyCFG/branch-cond-prop.ll17
-rw-r--r--release_23/test/Transforms/SimplifyCFG/branch-fold-test.ll17
-rw-r--r--release_23/test/Transforms/SimplifyCFG/branch-fold.ll13
-rw-r--r--release_23/test/Transforms/SimplifyCFG/branch-phi-thread.ll66
-rw-r--r--release_23/test/Transforms/SimplifyCFG/dg.exp3
-rw-r--r--release_23/test/Transforms/SimplifyCFG/hoist-common-code.ll18
-rw-r--r--release_23/test/Transforms/SimplifyCFG/iterative-simplify.ll100
-rw-r--r--release_23/test/Transforms/SimplifyCFG/noreturn-call.ll11
-rw-r--r--release_23/test/Transforms/SimplifyCFG/return-merge.ll19
-rw-r--r--release_23/test/Transforms/SimplifyCFG/switch-simplify-crash.ll108
-rw-r--r--release_23/test/Transforms/SimplifyCFG/switch_create.ll47
-rw-r--r--release_23/test/Transforms/SimplifyCFG/switch_formation.ll31
-rw-r--r--release_23/test/Transforms/SimplifyCFG/switch_switch_fold.ll47
-rw-r--r--release_23/test/Transforms/SimplifyCFG/switch_thread.ll79
-rw-r--r--release_23/test/Transforms/SimplifyCFG/two-entry-phi-return.ll15
-rw-r--r--release_23/test/Transforms/SimplifyLibCalls/2005-05-20-sprintf-crash.ll11
-rw-r--r--release_23/test/Transforms/SimplifyLibCalls/2007-04-06-strchr-miscompile.ll29
-rw-r--r--release_23/test/Transforms/SimplifyLibCalls/ExitInMain.ll15
-rw-r--r--release_23/test/Transforms/SimplifyLibCalls/FFS.ll30
-rw-r--r--release_23/test/Transforms/SimplifyLibCalls/FPrintF.ll25
-rw-r--r--release_23/test/Transforms/SimplifyLibCalls/IsDigit.ll21
-rw-r--r--release_23/test/Transforms/SimplifyLibCalls/MemCpy.ll20
-rw-r--r--release_23/test/Transforms/SimplifyLibCalls/Printf.ll21
-rw-r--r--release_23/test/Transforms/SimplifyLibCalls/Puts.ll26
-rw-r--r--release_23/test/Transforms/SimplifyLibCalls/SPrintF.ll36
-rw-r--r--release_23/test/Transforms/SimplifyLibCalls/StrCat.ll26
-rw-r--r--release_23/test/Transforms/SimplifyLibCalls/StrChr.ll22
-rw-r--r--release_23/test/Transforms/SimplifyLibCalls/StrCmp.ll28
-rw-r--r--release_23/test/Transforms/SimplifyLibCalls/StrCpy.ll26
-rw-r--r--release_23/test/Transforms/SimplifyLibCalls/StrLen.ll56
-rw-r--r--release_23/test/Transforms/SimplifyLibCalls/StrNCmp.ll28
-rw-r--r--release_23/test/Transforms/SimplifyLibCalls/ToAscii.ll21
-rw-r--r--release_23/test/Transforms/SimplifyLibCalls/dg.exp3
-rw-r--r--release_23/test/Transforms/SimplifyLibCalls/exp2.ll38
-rw-r--r--release_23/test/Transforms/SimplifyLibCalls/floor.ll39
-rw-r--r--release_23/test/Transforms/SimplifyLibCalls/memcmp.ll22
-rw-r--r--release_23/test/Transforms/SimplifyLibCalls/pow2.ll37
-rw-r--r--release_23/test/Transforms/StripSymbols/2007-01-15-llvm.used.ll15
-rw-r--r--release_23/test/Transforms/StripSymbols/dg.exp3
-rw-r--r--release_23/test/Transforms/TailCallElim/accum_recursion.ll15
-rw-r--r--release_23/test/Transforms/TailCallElim/accum_recursion_constant_arg.ll20
-rw-r--r--release_23/test/Transforms/TailCallElim/ackermann.ll26
-rw-r--r--release_23/test/Transforms/TailCallElim/dg.exp3
-rw-r--r--release_23/test/Transforms/TailCallElim/dont-tce-tail-marked-call.ll13
-rw-r--r--release_23/test/Transforms/TailCallElim/inf-recursion.ll10
-rw-r--r--release_23/test/Transforms/TailCallElim/intervening-inst.ll17
-rw-r--r--release_23/test/Transforms/TailCallElim/move_alloca_for_tail_call.ll13
-rw-r--r--release_23/test/Transforms/TailCallElim/return_constant.ll17
-rw-r--r--release_23/test/Transforms/TailCallElim/trivial_codegen_tailcall.ll11
-rw-r--r--release_23/test/Transforms/TailDup/2003-06-24-Simpleloop.ll15
-rw-r--r--release_23/test/Transforms/TailDup/2003-07-22-InfiniteLoop.ll11
-rw-r--r--release_23/test/Transforms/TailDup/2003-08-23-InvalidatedPointers.ll29
-rw-r--r--release_23/test/Transforms/TailDup/2003-08-31-UnreachableBlocks.ll17
-rw-r--r--release_23/test/Transforms/TailDup/2004-04-01-DemoteRegToStack.ll20
-rw-r--r--release_23/test/Transforms/TailDup/MergeTest.ll27
-rw-r--r--release_23/test/Transforms/TailDup/PHIUpdateTest.ll16
-rw-r--r--release_23/test/Transforms/TailDup/basictest.ll20
-rw-r--r--release_23/test/Transforms/TailDup/basictest2.ll15
-rw-r--r--release_23/test/Transforms/TailDup/dg.exp3
-rw-r--r--release_23/test/Transforms/TailDup/if-tail-dup.ll49
-rw-r--r--release_23/test/Verifier/2002-04-13-RetTypes.ll10
-rw-r--r--release_23/test/Verifier/2002-11-05-GetelementptrPointers.ll9
-rw-r--r--release_23/test/Verifier/2004-05-21-SwitchConstantMismatch.ll13
-rw-r--r--release_23/test/Verifier/2005-03-21-UndefinedTypeReference.ll7
-rw-r--r--release_23/test/Verifier/2006-07-11-StoreStruct.ll9
-rw-r--r--release_23/test/Verifier/2006-10-15-AddrLabel.ll9
-rw-r--r--release_23/test/Verifier/2006-12-12-IntrinsicDefine.ll7
-rw-r--r--release_23/test/Verifier/2007-12-21-InvokeParamAttrs.ll10
-rw-r--r--release_23/test/Verifier/2008-01-11-VarargAttrs.ll10
-rw-r--r--release_23/test/Verifier/2008-03-01-AllocaSized.ll8
-rw-r--r--release_23/test/Verifier/AmbiguousPhi.ll10
-rw-r--r--release_23/test/Verifier/PhiGrouping.ll17
-rw-r--r--release_23/test/Verifier/README.txt3
-rw-r--r--release_23/test/Verifier/SelfReferential.ll9
-rw-r--r--release_23/test/Verifier/aliasing-chain.ll6
-rw-r--r--release_23/test/Verifier/byval-1.ll2
-rw-r--r--release_23/test/Verifier/byval-2.ll3
-rw-r--r--release_23/test/Verifier/byval-4.ll4
-rw-r--r--release_23/test/Verifier/dg.exp3
-rw-r--r--release_23/test/Verifier/gcread-ptrptr.ll13
-rw-r--r--release_23/test/Verifier/gcroot-alloca.ll14
-rw-r--r--release_23/test/Verifier/gcroot-meta.ll16
-rw-r--r--release_23/test/Verifier/gcroot-ptrptr.ll14
-rw-r--r--release_23/test/Verifier/gcwrite-ptrptr.ll13
-rw-r--r--release_23/test/Verifier/invoke-1.ll10
-rw-r--r--release_23/test/Verifier/invoke-2.ll14
-rw-r--r--release_23/test/lib/llvm.exp264
-rw-r--r--release_23/test/lib/llvm2cpp.exp100
-rw-r--r--release_23/tools/Makefile32
-rw-r--r--release_23/tools/bugpoint/BugDriver.cpp239
-rw-r--r--release_23/tools/bugpoint/BugDriver.h319
-rw-r--r--release_23/tools/bugpoint/CrashDebugger.cpp559
-rw-r--r--release_23/tools/bugpoint/ExecutionDriver.cpp416
-rw-r--r--release_23/tools/bugpoint/ExtractFunction.cpp368
-rw-r--r--release_23/tools/bugpoint/FindBugs.cpp112
-rw-r--r--release_23/tools/bugpoint/ListReducer.h189
-rw-r--r--release_23/tools/bugpoint/Makefile17
-rw-r--r--release_23/tools/bugpoint/Miscompilation.cpp915
-rw-r--r--release_23/tools/bugpoint/OptimizerDriver.cpp259
-rw-r--r--release_23/tools/bugpoint/TestPasses.cpp75
-rw-r--r--release_23/tools/bugpoint/ToolRunner.cpp730
-rw-r--r--release_23/tools/bugpoint/ToolRunner.h218
-rw-r--r--release_23/tools/bugpoint/bugpoint.cpp94
-rw-r--r--release_23/tools/gccas/Makefile28
-rw-r--r--release_23/tools/gccas/gccas.sh64
-rw-r--r--release_23/tools/gccld/Makefile29
-rw-r--r--release_23/tools/gccld/gccld.sh23
-rw-r--r--release_23/tools/llc/Makefile21
-rw-r--r--release_23/tools/llc/llc.cpp311
-rw-r--r--release_23/tools/lli/Makefile15
-rw-r--r--release_23/tools/lli/lli.cpp182
-rw-r--r--release_23/tools/llvm-ar/Makefile22
-rw-r--r--release_23/tools/llvm-ar/llvm-ar.cpp775
-rw-r--r--release_23/tools/llvm-as/Makefile15
-rw-r--r--release_23/tools/llvm-as/llvm-as.cpp145
-rw-r--r--release_23/tools/llvm-bcanalyzer/Makefile15
-rw-r--r--release_23/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp502
-rw-r--r--release_23/tools/llvm-config/Makefile87
-rwxr-xr-xrelease_23/tools/llvm-config/find-cycles.pl165
-rw-r--r--release_23/tools/llvm-config/llvm-config.in.in451
-rw-r--r--release_23/tools/llvm-db/CLICommand.h111
-rw-r--r--release_23/tools/llvm-db/CLIDebugger.cpp308
-rw-r--r--release_23/tools/llvm-db/CLIDebugger.h205
-rw-r--r--release_23/tools/llvm-db/Commands.cpp865
-rw-r--r--release_23/tools/llvm-db/Makefile15
-rw-r--r--release_23/tools/llvm-db/llvm-db.cpp96
-rw-r--r--release_23/tools/llvm-dis/Makefile15
-rw-r--r--release_23/tools/llvm-dis/llvm-dis.cpp138
-rw-r--r--release_23/tools/llvm-extract/Makefile15
-rw-r--r--release_23/tools/llvm-extract/llvm-extract.cpp132
-rw-r--r--release_23/tools/llvm-ld/Makefile16
-rw-r--r--release_23/tools/llvm-ld/Optimize.cpp222
-rw-r--r--release_23/tools/llvm-ld/llvm-ld.cpp666
-rw-r--r--release_23/tools/llvm-link/Makefile14
-rw-r--r--release_23/tools/llvm-link/llvm-link.cpp150
-rw-r--r--release_23/tools/llvm-nm/Makefile14
-rw-r--r--release_23/tools/llvm-nm/llvm-nm.cpp184
-rw-r--r--release_23/tools/llvm-prof/Makefile15
-rw-r--r--release_23/tools/llvm-prof/llvm-prof.cpp251
-rw-r--r--release_23/tools/llvm-ranlib/Makefile15
-rw-r--r--release_23/tools/llvm-ranlib/llvm-ranlib.cpp96
-rw-r--r--release_23/tools/llvm-stub/Makefile13
-rw-r--r--release_23/tools/llvm-stub/llvm-stub.c69
-rw-r--r--release_23/tools/llvmc2/Action.cpp74
-rw-r--r--release_23/tools/llvmc2/Action.h42
-rw-r--r--release_23/tools/llvmc2/AutoGenerated.cpp27
-rw-r--r--release_23/tools/llvmc2/AutoGenerated.h34
-rw-r--r--release_23/tools/llvmc2/Common.td90
-rw-r--r--release_23/tools/llvmc2/CompilationGraph.cpp406
-rw-r--r--release_23/tools/llvmc2/CompilationGraph.h314
-rw-r--r--release_23/tools/llvmc2/Graph.td47
-rw-r--r--release_23/tools/llvmc2/Makefile27
-rw-r--r--release_23/tools/llvmc2/Tool.h68
-rw-r--r--release_23/tools/llvmc2/Tools.td113
-rw-r--r--release_23/tools/llvmc2/doc/LLVMC-Enhancements.rst264
-rw-r--r--release_23/tools/llvmc2/doc/LLVMC-Tutorial.rst258
-rw-r--r--release_23/tools/llvmc2/llvmc.cpp102
-rw-r--r--release_23/tools/lto/Makefile30
-rw-r--r--release_23/tools/lto/lto-c.cpp66
-rw-r--r--release_23/tools/lto/lto.cpp561
-rw-r--r--release_23/tools/lto2/LTOCodeGenerator.cpp442
-rw-r--r--release_23/tools/lto2/LTOCodeGenerator.h62
-rw-r--r--release_23/tools/lto2/LTOModule.cpp321
-rw-r--r--release_23/tools/lto2/LTOModule.h103
-rw-r--r--release_23/tools/lto2/Makefile53
-rw-r--r--release_23/tools/lto2/lto.cpp241
-rw-r--r--release_23/tools/lto2/lto.exports22
-rw-r--r--release_23/tools/opt/AnalysisWrappers.cpp88
-rw-r--r--release_23/tools/opt/GraphPrinters.cpp83
-rw-r--r--release_23/tools/opt/Makefile15
-rw-r--r--release_23/tools/opt/PrintSCC.cpp112
-rw-r--r--release_23/tools/opt/opt.cpp443
-rwxr-xr-xrelease_23/utils/DSAclean.py32
-rw-r--r--release_23/utils/DSAextract.py111
-rwxr-xr-xrelease_23/utils/GenLibDeps.pl214
-rw-r--r--release_23/utils/Makefile21
-rw-r--r--release_23/utils/NLT.schema8
-rwxr-xr-xrelease_23/utils/NewNightlyTest.pl1159
-rw-r--r--release_23/utils/NightlyTest.gnuplot214
-rw-r--r--release_23/utils/NightlyTestTemplate.html244
-rw-r--r--release_23/utils/OldenDataRecover.pl37
-rw-r--r--release_23/utils/PerfectShuffle/Makefile14
-rw-r--r--release_23/utils/PerfectShuffle/PerfectShuffle.cpp497
-rwxr-xr-xrelease_23/utils/RegressionFinder.pl186
-rw-r--r--release_23/utils/TableGen/AsmWriterEmitter.cpp727
-rw-r--r--release_23/utils/TableGen/AsmWriterEmitter.h50
-rw-r--r--release_23/utils/TableGen/CallingConvEmitter.cpp197
-rw-r--r--release_23/utils/TableGen/CallingConvEmitter.h38
-rw-r--r--release_23/utils/TableGen/CodeEmitterGen.cpp243
-rw-r--r--release_23/utils/TableGen/CodeEmitterGen.h43
-rw-r--r--release_23/utils/TableGen/CodeGenDAGPatterns.cpp2322
-rw-r--r--release_23/utils/TableGen/CodeGenDAGPatterns.h572
-rw-r--r--release_23/utils/TableGen/CodeGenInstruction.cpp271
-rw-r--r--release_23/utils/TableGen/CodeGenInstruction.h150
-rw-r--r--release_23/utils/TableGen/CodeGenIntrinsics.h60
-rw-r--r--release_23/utils/TableGen/CodeGenRegisters.h61
-rw-r--r--release_23/utils/TableGen/CodeGenTarget.cpp475
-rw-r--r--release_23/utils/TableGen/CodeGenTarget.h200
-rw-r--r--release_23/utils/TableGen/DAGISelEmitter.cpp2172
-rw-r--r--release_23/utils/TableGen/DAGISelEmitter.h54
-rw-r--r--release_23/utils/TableGen/InstrEnumEmitter.cpp54
-rw-r--r--release_23/utils/TableGen/InstrEnumEmitter.h33
-rw-r--r--release_23/utils/TableGen/InstrInfoEmitter.cpp323
-rw-r--r--release_23/utils/TableGen/InstrInfoEmitter.h63
-rw-r--r--release_23/utils/TableGen/IntrinsicEmitter.cpp485
-rw-r--r--release_23/utils/TableGen/IntrinsicEmitter.h53
-rw-r--r--release_23/utils/TableGen/LLVMCConfigurationEmitter.cpp1203
-rw-r--r--release_23/utils/TableGen/LLVMCConfigurationEmitter.h33
-rw-r--r--release_23/utils/TableGen/Makefile18
-rw-r--r--release_23/utils/TableGen/Record.cpp996
-rw-r--r--release_23/utils/TableGen/Record.h1184
-rw-r--r--release_23/utils/TableGen/RegisterInfoEmitter.cpp683
-rw-r--r--release_23/utils/TableGen/RegisterInfoEmitter.h40
-rw-r--r--release_23/utils/TableGen/SubtargetEmitter.cpp530
-rw-r--r--release_23/utils/TableGen/SubtargetEmitter.h62
-rw-r--r--release_23/utils/TableGen/TGLexer.cpp419
-rw-r--r--release_23/utils/TableGen/TGLexer.h133
-rw-r--r--release_23/utils/TableGen/TGParser.cpp1380
-rw-r--r--release_23/utils/TableGen/TGParser.h109
-rw-r--r--release_23/utils/TableGen/TableGen.cpp221
-rw-r--r--release_23/utils/TableGen/TableGenBackend.cpp25
-rw-r--r--release_23/utils/TableGen/TableGenBackend.h43
-rw-r--r--release_23/utils/buildit/GNUmakefile115
-rwxr-xr-xrelease_23/utils/buildit/build_llvm245
-rwxr-xr-xrelease_23/utils/cgiplotNLT.pl68
-rwxr-xr-xrelease_23/utils/check-each-file150
-rwxr-xr-xrelease_23/utils/codegen-diff135
-rwxr-xr-xrelease_23/utils/countloc.sh40
-rw-r--r--release_23/utils/emacs/README27
-rw-r--r--release_23/utils/emacs/emacs.el12
-rw-r--r--release_23/utils/emacs/llvm-mode.el128
-rw-r--r--release_23/utils/emacs/tablegen-mode.el122
-rwxr-xr-xrelease_23/utils/findmisopt178
-rwxr-xr-xrelease_23/utils/findoptdiff101
-rwxr-xr-xrelease_23/utils/findsym.pl33
-rw-r--r--release_23/utils/fpcmp/Makefile16
-rw-r--r--release_23/utils/fpcmp/fpcmp.cpp43
-rwxr-xr-xrelease_23/utils/getsrcs.sh34
-rw-r--r--release_23/utils/importNLT.pl86
-rwxr-xr-xrelease_23/utils/llvm-native-gcc249
-rwxr-xr-xrelease_23/utils/llvm-native-gxx249
-rwxr-xr-xrelease_23/utils/llvmdo198
-rwxr-xr-xrelease_23/utils/llvmgrep39
-rwxr-xr-xrelease_23/utils/makellvm144
-rwxr-xr-xrelease_23/utils/mkpatch37
-rw-r--r--release_23/utils/parseNLT.pl34
-rw-r--r--release_23/utils/plotNLT.pl53
-rwxr-xr-xrelease_23/utils/profile.pl74
-rwxr-xr-xrelease_23/utils/userloc.pl216
-rw-r--r--release_23/utils/vim/README43
-rw-r--r--release_23/utils/vim/llvm.vim69
-rw-r--r--release_23/utils/vim/tablegen.vim54
-rw-r--r--release_23/utils/vim/vimrc40
-rwxr-xr-xrelease_23/utils/webNLT.pl83
-rw-r--r--release_23/website/index.html26
-rw-r--r--release_23/win32/Analysis/Analysis.vcproj557
-rw-r--r--release_23/win32/Archive/Archive.vcproj337
-rw-r--r--release_23/win32/AsmParser/AsmParser.vcproj394
-rw-r--r--release_23/win32/Bitcode/Bitcode.vcproj421
-rw-r--r--release_23/win32/CBackend/CBackend.vcproj325
-rw-r--r--release_23/win32/CodeGen/CodeGen.vcproj765
-rw-r--r--release_23/win32/Configure/Configure.vcproj319
-rw-r--r--release_23/win32/ExecutionEngine/ExecutionEngine.vcproj429
-rw-r--r--release_23/win32/Fibonacci/Fibonacci.vcproj386
-rw-r--r--release_23/win32/Linker/Linker.vcproj337
-rw-r--r--release_23/win32/Support/Support.vcproj742
-rw-r--r--release_23/win32/System/System.vcproj462
-rw-r--r--release_23/win32/TableGen/TableGen.vcproj524
-rw-r--r--release_23/win32/Target/Target.vcproj421
-rw-r--r--release_23/win32/Transforms/Transforms.vcproj743
-rw-r--r--release_23/win32/VMCore/VMCore.vcproj642
-rw-r--r--release_23/win32/bugpoint/bugpoint.vcproj429
-rw-r--r--release_23/win32/clang.sln741
-rw-r--r--release_23/win32/config.h28
-rwxr-xr-xrelease_23/win32/dobison.cmd27
-rwxr-xr-xrelease_23/win32/doflex.cmd20
-rw-r--r--release_23/win32/llc/llc.vcproj385
-rw-r--r--release_23/win32/lli/lli.vcproj385
-rw-r--r--release_23/win32/llvm-ar/llvm-ar.vcproj381
-rw-r--r--release_23/win32/llvm-as/llvm-as.vcproj381
-rw-r--r--release_23/win32/llvm-bcanalyzer/llvm-bcanalyzer.vcproj381
-rw-r--r--release_23/win32/llvm-dis/llvm-dis.vcproj381
-rw-r--r--release_23/win32/llvm-ld/llvm-ld.vcproj385
-rw-r--r--release_23/win32/llvm-link/llvm-link.vcproj381
-rw-r--r--release_23/win32/llvm-nm/llvm-nm.vcproj381
-rw-r--r--release_23/win32/llvm-prof/llvm-prof.vcproj381
-rw-r--r--release_23/win32/llvm-ranlib/llvm-ranlib.vcproj381
-rw-r--r--release_23/win32/llvm.sln719
-rw-r--r--release_23/win32/opt/opt.vcproj393
-rw-r--r--release_23/win32/unistd.h1
-rw-r--r--release_23/win32/x86/x86.vcproj584
4333 files changed, 6 insertions, 694589 deletions
diff --git a/docs/CommandGuide/Makefile b/docs/CommandGuide/Makefile
index a2953512b819..cf77e6a33db0 100644
--- a/docs/CommandGuide/Makefile
+++ b/docs/CommandGuide/Makefile
@@ -23,6 +23,12 @@ all:: html man ps
clean:
rm -f pod2htm*.*~~ $(HTML) $(MAN) $(PS)
+
+# To create other directories, as needed, and timestamp their creation
+%/.dir:
+ -mkdir $* > /dev/null
+ date > $@
+
else
# Otherwise, if not in BUILD_FOR_WEBSITE mode, use the project info.
diff --git a/release_23/CREDITS.TXT b/release_23/CREDITS.TXT
deleted file mode 100644
index 84f7e5ad1648..000000000000
--- a/release_23/CREDITS.TXT
+++ /dev/null
@@ -1,268 +0,0 @@
-This file is a partial list of people who have contributed to the LLVM
-project. If you have contributed a patch or made some other contribution to
-LLVM, please submit a patch to this file to add yourself, and it will be
-done!
-
-The list is sorted by name and formatted to allow easy grepping and
-beautification by scripts. The fields are: name (N), email (E), web-address
-(W), PGP key ID and fingerprint (P), description (D), and snail-mail address
-(S).
-
-N: Vikram Adve
-E: vadve@cs.uiuc.edu
-W: http://www.cs.uiuc.edu/~vadve/
-D: The Sparc64 backend, provider of much wisdom, and motivator for LLVM
-
-N: Owen Anderson
-E: resistor@mac.com
-D: LCSSA pass and related LoopUnswitch work
-D: GVNPRE pass, TargetData refactoring, random improvements
-
-N: Henrik Bach
-D: MingW Win32 API portability layer
-
-N: Nate Begeman
-E: natebegeman@mac.com
-D: PowerPC backend developer
-D: Target-independent code generator and analysis improvements
-
-N: Daniel Berlin
-E: dberlin@dberlin.org
-D: ET-Forest implementation.
-D: Sparse bitmap
-
-N: Neil Booth
-E: neil@daikokuya.co.uk
-D: APFloat implementation.
-
-N: Misha Brukman
-E: brukman+llvm@uiuc.edu
-W: http://misha.brukman.net
-D: Portions of X86 and Sparc JIT compilers, PowerPC backend
-D: Incremental bytecode loader
-
-N: Cameron Buschardt
-E: buschard@uiuc.edu
-D: The `mem2reg' pass - promotes values stored in memory to registers
-
-N: Chandler Carruth
-E: chandlerc@gmail.com
-D: LinkTimeOptimizer for Linux, via binutils integration, and C API
-
-N: Casey Carter
-E: ccarter@uiuc.edu
-D: Fixes to the Reassociation pass, various improvement patches
-
-N: Evan Cheng
-E: evan.cheng@apple.com
-D: ARM and X86 backends
-D: Instruction scheduler improvements
-D: Register allocator improvements
-D: Loop optimizer improvements
-D: Target-independent code generator improvements
-
-N: Jeff Cohen
-E: jeffc@jolt-lang.org
-W: http://jolt-lang.org
-D: Native Win32 API portability layer
-
-N: John T. Criswell
-E: criswell@uiuc.edu
-D: Original Autoconf support, documentation improvements, bug fixes
-
-N: Rafael Avila de Espindola
-E: rafael.espindola@gmail.com
-D: The ARM backend
-
-N: Alkis Evlogimenos
-E: alkis@evlogimenos.com
-D: Linear scan register allocator, many codegen improvements, Java frontend
-
-N: Brian Gaeke
-E: gaeke@uiuc.edu
-W: http://www.students.uiuc.edu/~gaeke/
-D: Portions of X86 static and JIT compilers; initial SparcV8 backend
-D: Dynamic trace optimizer
-D: FreeBSD/X86 compatibility fixes, the llvm-nm tool
-
-N: Nicolas Geoffray
-E: nicolas.geoffray@lip6.fr
-W: http://www-src.lip6.fr/homepages/Nicolas.Geoffray/
-D: PPC backend fixes for Linux
-
-N: Louis Gerbarg
-D: Portions of the PowerPC backend
-
-N: Saem Ghani
-E: saemghani@gmail.com
-D: Callgraph class cleanups
-
-N: Mikhail Glushenkov
-E: foldr@codedgers.com
-D: Author of llvmc2
-
-N: Dan Gohman
-E: djg@cray.com
-D: Miscellaneous bug fixes
-
-N: David Greene
-E: greened@obbligato.org
-D: Miscellaneous bug fixes
-D: Register allocation refactoring
-
-N: Gordon Henriksen
-E: gordonhenriksen@mac.com
-D: Pluggable GC support
-D: C interface
-D: Ocaml bindings
-
-N: Raul Fernandes Herbster
-E: raul@dsc.ufcg.edu.br
-D: JIT support for ARM
-
-N: Paolo Invernizzi
-E: arathorn@fastwebnet.it
-D: Visual C++ compatibility fixes
-
-N: Patrick Jenkins
-E: patjenk@wam.umd.edu
-D: Nightly Tester
-
-N: Brad Jones
-E: kungfoomaster@nondot.org
-D: Support for packed types
-
-N: Dale Johannesen
-E: dalej@apple.com
-D: ARM constant islands improvements
-D: Tail merging improvements
-D: Rewrite X87 back end
-D: Use APFloat for floating point constants widely throughout compiler
-D: Implement X87 long double
-
-N: Eric Kidd
-W: http://randomhacks.net/
-D: llvm-config script
-
-N: Anton Korobeynikov
-E: asl@math.spbu.ru
-D: Mingw32 fixes, cross-compiling support, stdcall/fastcall calling conv.
-D: x86/linux PIC codegen, aliases, regparm/visibility attributes
-D: Switch lowering refactoring
-
-N: Sumant Kowshik
-E: kowshik@uiuc.edu
-D: Author of the original C backend
-
-N: Christopher Lamb
-E: christopher.lamb@gmail.com
-D: aligned load/store support, parts of noalias and restrict support
-D: vreg subreg infrastructure, X86 codegen improvements based on subregs
-D: address spaces
-
-N: Jim Laskey
-E: jlaskey@apple.com
-D: Improvements to the PPC backend, instruction scheduling
-D: Debug and Dwarf implementation
-D: Auto upgrade mangler
-D: llvm-gcc4 svn wrangler
-
-N: Chris Lattner
-E: sabre@nondot.org
-W: http://nondot.org/~sabre/
-D: Primary architect of LLVM
-
-N: Tanya Lattner (Tanya Brethour)
-E: tonic@nondot.org
-W: http://nondot.org/~tonic/
-D: The initial llvm-ar tool, converted regression testsuite to dejagnu
-D: Modulo scheduling in the SparcV9 backend
-D: Release manager (1.7+)
-
-N: Andrew Lenharth
-E: alenhar2@cs.uiuc.edu
-W: http://www.lenharth.org/~andrewl/
-D: Alpha backend
-D: Sampling based profiling
-
-N: Nick Lewycky
-E: nicholas@mxc.ca
-D: PredicateSimplifier pass
-
-N: Bruno Cardoso Lopes
-E: bruno.cardoso@gmail.com
-W: http://www.brunocardoso.org
-D: The Mips backend
-
-N: Duraid Madina
-E: duraid@octopus.com.au
-W: http://kinoko.c.u-tokyo.ac.jp/~duraid/
-D: IA64 backend, BigBlock register allocator
-
-N: Michael McCracken
-E: michael.mccracken@gmail.com
-D: Line number support for llvmgcc
-
-N: Vladimir Merzliakov
-E: wanderer@rsu.ru
-D: Test suite fixes for FreeBSD
-
-N: Scott Michel
-E: scottm@aero.org
-D: Added STI Cell SPU backend.
-
-N: Morten Ofstad
-E: morten@hue.no
-D: Visual C++ compatibility fixes
-
-N: Devang Patel
-E: dpatel@apple.com
-D: LTO tool, PassManager rewrite, Loop Pass Manager, Loop Rotate
-D: GCC PCH Integration (llvm-gcc), llvm-gcc improvements
-D: Optimizer improvements, Loop Index Split
-
-N: Vladimir Prus
-W: http://vladimir_prus.blogspot.com
-E: ghost@cs.msu.su
-D: Made inst_iterator behave like a proper iterator, LowerConstantExprs pass
-
-N: Roman Samoilov
-E: roman@codedgers.com
-D: MSIL backend
-
-N: Duncan Sands
-E: baldrick@free.fr
-D: Ada front-end, exception handling improvements
-
-N: Ruchira Sasanka
-E: sasanka@uiuc.edu
-D: Graph coloring register allocator for the Sparc64 backend
-
-N: Arnold Schwaighofer
-E: arnold.schwaighofer@gmail.com
-D: Tail call optimization for the x86 backend
-
-N: Anand Shukla
-E: ashukla@cs.uiuc.edu
-D: The `paths' pass
-
-N: Reid Spencer
-E: rspencer@reidspencer.com
-W: http://reidspencer.com/
-D: Lots of stuff, see: http://wiki.llvm.org/index.php/User:Reid
-
-N: Adam Treat
-E: manyoso@yahoo.com
-D: C++ bugs filed, and C++ front-end bug fixes.
-
-N: Lauro Ramos Venancio
-E: lauro.venancio@indt.org.br
-D: ARM backend improvements
-D: Thread Local Storage implementation
-
-N: Bill Wendling
-E: isanbard@gmail.com
-W: http://web.mac.com/bwendling/
-D: Darwin exception handling
-D: MMX & SSSE3 instructions
-D: SPEC2006 support
diff --git a/release_23/LICENSE.TXT b/release_23/LICENSE.TXT
deleted file mode 100644
index fa41b109f6dd..000000000000
--- a/release_23/LICENSE.TXT
+++ /dev/null
@@ -1,71 +0,0 @@
-==============================================================================
-LLVM Release License
-==============================================================================
-University of Illinois/NCSA
-Open Source License
-
-Copyright (c) 2003-2008 University of Illinois at Urbana-Champaign.
-All rights reserved.
-
-Developed by:
-
- LLVM Team
-
- University of Illinois at Urbana-Champaign
-
- http://llvm.org
-
-Permission is hereby granted, free of charge, to any person obtaining a copy of
-this software and associated documentation files (the "Software"), to deal with
-the Software without restriction, including without limitation the rights to
-use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
-of the Software, and to permit persons to whom the Software is furnished to do
-so, subject to the following conditions:
-
- * Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimers.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimers in the
- documentation and/or other materials provided with the distribution.
-
- * Neither the names of the LLVM Team, University of Illinois at
- Urbana-Champaign, nor the names of its contributors may be used to
- endorse or promote products derived from this Software without specific
- prior written permission.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
-FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE
-SOFTWARE.
-
-==============================================================================
-Copyrights and Licenses for Third Party Software Distributed with LLVM:
-==============================================================================
-The LLVM software contains code written by third parties. Such software will
-have its own individual LICENSE.TXT file in the directory in which it appears.
-This file will describe the copyrights, license, and restrictions which apply
-to that code.
-
-The disclaimer of warranty in the University of Illinois Open Source License
-applies to all code in the LLVM Distribution, and nothing in any of the
-other licenses gives permission to use the names of the LLVM Team or the
-University of Illinois to endorse or promote products derived from this
-Software.
-
-The following pieces of software have additional or alternate copyrights,
-licenses, and/or restrictions:
-
-Program Directory
-------- ---------
-System Library llvm/lib/System
-Compiler Driver llvm/tools/llvmc
-Autoconf llvm/autoconf
- llvm/projects/ModuleMaker/autoconf
- llvm/projects/sample/autoconf
-CellSPU backend llvm/lib/Target/CellSPU/README.txt
-
-
diff --git a/release_23/Makefile b/release_23/Makefile
deleted file mode 100644
index 36031f7cb3d8..000000000000
--- a/release_23/Makefile
+++ /dev/null
@@ -1,163 +0,0 @@
-#===- ./Makefile -------------------------------------------*- Makefile -*--===#
-#
-# The LLVM Compiler Infrastructure
-#
-# This file is distributed under the University of Illinois Open Source
-# License. See LICENSE.TXT for details.
-#
-#===------------------------------------------------------------------------===#
-
-LEVEL := .
-
-# Top-Level LLVM Build Stages:
-# 1. Build lib/System and lib/Support, which are used by utils (tblgen).
-# 2. Build utils, which is used by VMCore.
-# 3. Build VMCore, which builds the Intrinsics.inc file used by libs.
-# 4. Build libs, which are needed by llvm-config.
-# 5. Build llvm-config, which determines inter-lib dependencies for tools.
-# 6. Build tools, runtime, docs.
-#
-DIRS := lib/System lib/Support utils lib/VMCore lib tools/llvm-config \
- tools runtime docs
-
-OPTIONAL_DIRS := examples projects bindings
-EXTRA_DIST := test llvm.spec include win32 Xcode
-
-include $(LEVEL)/Makefile.config
-
-# llvm-gcc4 doesn't need runtime libs. llvm-gcc4 is the only supported one.
-# FIXME: Remove runtime entirely once we have an understanding of where
-# libprofile etc should go.
-#ifeq ($(LLVMGCC_MAJVERS),4)
- DIRS := $(filter-out runtime, $(DIRS))
-#endif
-
-ifeq ($(MAKECMDGOALS),libs-only)
- DIRS := $(filter-out tools runtime docs, $(DIRS))
- OPTIONAL_DIRS :=
-endif
-
-ifeq ($(MAKECMDGOALS),install-libs)
- DIRS := $(filter-out tools runtime docs, $(DIRS))
- OPTIONAL_DIRS := $(filter bindings, $(OPTIONAL_DIRS))
-endif
-
-ifeq ($(MAKECMDGOALS),tools-only)
- DIRS := $(filter-out runtime docs, $(DIRS))
- OPTIONAL_DIRS :=
-endif
-
-# Don't install utils, examples, or projects they are only used to
-# build LLVM.
-ifeq ($(MAKECMDGOALS),install)
- DIRS := $(filter-out utils, $(DIRS))
- OPTIONAL_DIRS := $(filter bindings, $(OPTIONAL_DIRS))
-endif
-
-# Include the main makefile machinery.
-include $(LLVM_SRC_ROOT)/Makefile.rules
-
-# Specify options to pass to configure script when we're
-# running the dist-check target
-DIST_CHECK_CONFIG_OPTIONS = --with-llvmgccdir=$(LLVMGCCDIR)
-
-.PHONY: debug-opt-prof
-debug-opt-prof:
- $(Echo) Building Debug Version
- $(Verb) $(MAKE)
- $(Echo)
- $(Echo) Building Optimized Version
- $(Echo)
- $(Verb) $(MAKE) ENABLE_OPTIMIZED=1
- $(Echo)
- $(Echo) Building Profiling Version
- $(Echo)
- $(Verb) $(MAKE) ENABLE_PROFILING=1
-
-dist-hook::
- $(Echo) Eliminating files constructed by configure
- $(Verb) $(RM) -f \
- $(TopDistDir)/include/llvm/ADT/hash_map \
- $(TopDistDir)/include/llvm/ADT/hash_set \
- $(TopDistDir)/include/llvm/ADT/iterator \
- $(TopDistDir)/include/llvm/Config/config.h \
- $(TopDistDir)/include/llvm/Support/DataTypes.h \
- $(TopDistDir)/include/llvm/Support/ThreadSupport.h
-
-tools-only: all
-libs-only: all
-install-libs: install
-
-#------------------------------------------------------------------------
-# Make sure the generated headers are up-to-date. This must be kept in
-# sync with the AC_CONFIG_HEADER invocations in autoconf/configure.ac
-#------------------------------------------------------------------------
-FilesToConfig := \
- include/llvm/Config/config.h \
- include/llvm/Support/DataTypes.h \
- include/llvm/ADT/hash_map \
- include/llvm/ADT/hash_set \
- include/llvm/ADT/iterator
-FilesToConfigPATH := $(addprefix $(LLVM_OBJ_ROOT)/,$(FilesToConfig))
-
-all-local:: $(FilesToConfigPATH)
-$(FilesToConfigPATH) : $(LLVM_OBJ_ROOT)/% : $(LLVM_SRC_ROOT)/%.in
- $(Echo) Regenerating $*
- $(Verb) cd $(LLVM_OBJ_ROOT) && $(ConfigStatusScript) $*
-.PRECIOUS: $(FilesToConfigPATH)
-
-# NOTE: This needs to remain as the last target definition in this file so
-# that it gets executed last.
-all::
- $(Echo) '*****' Completed $(BuildMode)$(AssertMode) Build
-ifeq ($(BuildMode),Debug)
- $(Echo) '*****' Note: Debug build can be 10 times slower than an
- $(Echo) '*****' optimized build. Use 'make ENABLE_OPTIMIZED=1' to
- $(Echo) '*****' make an optimized build. Alternatively you can
- $(Echo) '*****' configure with --enable-optimized.
-endif
-
-check-llvm2cpp:
- $(Verb)$(MAKE) check TESTSUITE=Feature RUNLLVM2CPP=1
-
-check-one:
- $(Verb)$(MAKE) -C test check-one TESTONE=$(TESTONE)
-
-srpm: $(LLVM_OBJ_ROOT)/llvm.spec
- rpmbuild -bs $(LLVM_OBJ_ROOT)/llvm.spec
-
-rpm: $(LLVM_OBJ_ROOT)/llvm.spec
- rpmbuild -bb --target $(TARGET_TRIPLE) $(LLVM_OBJ_ROOT)/llvm.spec
-
-show-footprint:
- $(Verb) du -sk $(LibDir)
- $(Verb) du -sk $(ToolDir)
- $(Verb) du -sk $(ExmplDir)
- $(Verb) du -sk $(ObjDir)
-
-build-for-llvm-top:
- $(Verb) if test ! -f ./config.status ; then \
- ./configure --prefix="$(LLVM_TOP)/install" \
- --with-llvm-gcc="$(LLVM_TOP)/llvm-gcc" ; \
- fi
- $(Verb) $(MAKE) tools-only
-
-SVN = svn
-SVN-UPDATE-OPTIONS =
-AWK = awk
-SUB-SVN-DIRS = $(AWK) '/\?\ \ \ \ \ \ / {print $$2}' \
- | LANG=C xargs $(SVN) info 2>/dev/null \
- | $(AWK) '/Path:\ / {print $$2}'
-
-update:
- $(SVN) $(SVN-UPDATE-OPTIONS) update $(LLVM_SRC_ROOT)
- @ $(SVN) status $(LLVM_SRC_ROOT) | $(SUB-SVN-DIRS) | xargs $(SVN) $(SVN-UPDATE-OPTIONS) update
-
-happiness: update all check
-
-.PHONY: srpm rpm update happiness
-
-# declare all targets at this level to be serial:
-
-.NOTPARALLEL:
-
diff --git a/release_23/Makefile.common b/release_23/Makefile.common
deleted file mode 100644
index 18a4ace19fd0..000000000000
--- a/release_23/Makefile.common
+++ /dev/null
@@ -1,70 +0,0 @@
-#===-- Makefile.common - Common make rules for LLVM --------*- Makefile -*--===#
-#
-# The LLVM Compiler Infrastructure
-#
-# This file is distributed under the University of Illinois Open Source
-# License. See LICENSE.TXT for details.
-#
-#===------------------------------------------------------------------------===#
-#
-# This file is included by all of the LLVM makefiles. This file defines common
-# rules to do things like compile a .cpp file or generate dependency info.
-# These are platform dependent, so this is the file used to specify these
-# system dependent operations.
-#
-# The following functionality can be set by setting incoming variables.
-# The variable $(LEVEL) *must* be set:
-#
-# 1. LEVEL - The level of the current subdirectory from the top of the
-# source directory. This level should be expressed as a path, for
-# example, ../.. for two levels deep.
-#
-# 2. DIRS - A list of subdirectories to be built. Fake targets are set up
-# so that each of the targets "all", "install", and "clean" each build
-# the subdirectories before the local target. DIRS are guaranteed to be
-# built in order.
-#
-# 3. PARALLEL_DIRS - A list of subdirectories to be built, but that may be
-# built in any order. All DIRS are built in order before PARALLEL_DIRS are
-# built, which are then built in any order.
-#
-# 4. Source - If specified, this sets the source code filenames. If this
-# is not set, it defaults to be all of the .cpp, .c, .y, and .l files
-# in the current directory. Also, if you want to build files in addition
-# to the local files, you can use the ExtraSource variable
-#
-# 5. SourceDir - If specified, this specifies a directory that the source files
-# are in, if they are not in the current directory. This should include a
-# trailing / character.
-#
-# 6. LLVM_SRC_ROOT - If specified, points to the top of the LLVM source tree.
-#
-# 8. PROJ_SRC_DIR - The directory which contains the current set of Makefiles
-# and usually the source code too (unless SourceDir is set).
-#
-# 9. PROJ_SRC_ROOT - The root directory of the source code being compiled.
-#
-# 10. PROJ_OBJ_DIR - The directory where object code should be placed.
-#
-# 11. PROJ_OBJ_ROOT - The root directory for where object code should be
-# placed.
-#
-# For building,
-# LLVM, LLVM_SRC_ROOT = PROJ_SRC_ROOT
-#
-#===-----------------------------------------------------------------------====
-
-#
-# Configuration file to set paths specific to local installation of LLVM
-#
-ifndef LLVM_OBJ_ROOT
-include $(LEVEL)/Makefile.config
-else
-include $(LLVM_OBJ_ROOT)/Makefile.config
-endif
-
-#
-# Include all of the build rules used for making LLVM
-#
-include $(LLVM_SRC_ROOT)/Makefile.rules
-
diff --git a/release_23/Makefile.config.in b/release_23/Makefile.config.in
deleted file mode 100644
index f3a934659289..000000000000
--- a/release_23/Makefile.config.in
+++ /dev/null
@@ -1,276 +0,0 @@
-#===-- Makefile.config - Local configuration for LLVM ------*- Makefile -*--===#
-#
-# The LLVM Compiler Infrastructure
-#
-# This file is distributed under the University of Illinois Open Source
-# License. See LICENSE.TXT for details.
-#
-#===------------------------------------------------------------------------===#
-#
-# This file is included by Makefile.common. It defines paths and other
-# values specific to a particular installation of LLVM.
-#
-#===------------------------------------------------------------------------===#
-
-# Define LLVM specific info and directories based on the autoconf variables
-LLVMPackageName := @PACKAGE_NAME@
-LLVMVersion := @PACKAGE_VERSION@
-LLVM_CONFIGTIME := @LLVM_CONFIGTIME@
-
-###########################################################################
-# Directory Configuration
-# This section of the Makefile determines what is where. To be
-# specific, there are several locations that need to be defined:
-#
-# o LLVM_SRC_ROOT : The root directory of the LLVM source code.
-# o LLVM_OBJ_ROOT : The root directory containing the built LLVM code.
-#
-# o PROJ_SRC_DIR : The directory containing the code to build.
-# o PROJ_SRC_ROOT : The root directory of the code to build.
-#
-# o PROJ_OBJ_DIR : The directory in which compiled code will be placed.
-# o PROJ_OBJ_ROOT : The root directory in which compiled code is placed.
-#
-###########################################################################
-
-PWD := @BINPWD@
-# Set the project name to LLVM if its not defined
-ifndef PROJECT_NAME
-PROJECT_NAME := $(LLVMPackageName)
-endif
-
-PROJ_OBJ_DIR := $(shell $(PWD))
-PROJ_OBJ_ROOT := $(shell cd $(PROJ_OBJ_DIR)/$(LEVEL); $(PWD))
-
-ifeq ($(PROJECT_NAME),llvm)
-LLVM_SRC_ROOT := $(shell cd @abs_top_srcdir@; $(PWD))
-LLVM_OBJ_ROOT := $(shell cd @abs_top_builddir@; $(PWD))
-PROJ_SRC_ROOT := $(shell cd $(LLVM_SRC_ROOT); $(PWD))
-PROJ_SRC_DIR := $(shell cd $(LLVM_SRC_ROOT)/$(patsubst $(PROJ_OBJ_ROOT)%,%,$(PROJ_OBJ_DIR)); $(PWD))
-prefix := @prefix@
-PROJ_prefix := $(prefix)
-PROJ_VERSION := $(LLVMVersion)
-else
-ifndef PROJ_SRC_ROOT
-$(error Projects must define PROJ_SRC_ROOT)
-endif
-ifndef PROJ_OBJ_ROOT
-$(error Projects must define PROJ_OBJ_ROOT)
-endif
-ifndef PROJ_INSTALL_ROOT
-$(error Projects must define PROJ_INSTALL_ROOT)
-endif
-ifndef LLVM_SRC_ROOT
-$(error Projects must define LLVM_SRC_ROOT)
-endif
-ifndef LLVM_OBJ_ROOT
-$(error Projects must define LLVM_OBJ_ROOT)
-endif
-PROJ_SRC_DIR := $(shell cd $(PROJ_SRC_ROOT)/$(patsubst $(PROJ_OBJ_ROOT)%,%,$(PROJ_OBJ_DIR)); $(PWD))
-prefix := $(PROJ_INSTALL_ROOT)
-PROJ_prefix := $(prefix)
-ifndef PROJ_VERSION
-PROJ_VERSION := 1.0
-endif
-endif
-
-LLVMMAKE := $(LLVM_SRC_ROOT)/make
-
-PROJ_bindir := $(DESTDIR)$(PROJ_prefix)/bin
-PROJ_libdir := $(DESTDIR)$(PROJ_prefix)/lib
-PROJ_datadir := $(DESTDIR)$(PROJ_prefix)/share
-PROJ_docsdir := $(DESTDIR)$(PROJ_prefix)/docs/llvm
-PROJ_etcdir := $(DESTDIR)$(PROJ_prefix)/etc/llvm
-PROJ_includedir := $(DESTDIR)$(PROJ_prefix)/include
-PROJ_infodir := $(DESTDIR)$(PROJ_prefix)/info
-PROJ_mandir := $(DESTDIR)$(PROJ_prefix)/share/man
-
-# Determine if we're on a unix type operating system
-LLVM_ON_UNIX:=@LLVM_ON_UNIX@
-LLVM_ON_WIN32:=@LLVM_ON_WIN32@
-
-# Target operating system for which LLVM will be compiled.
-OS=@OS@
-
-# Target hardware architecture
-ARCH=@ARCH@
-
-# Indicates, whether we're cross-compiling LLVM or not
-LLVM_CROSS_COMPILING=@LLVM_CROSS_COMPILING@
-
-# Executable file extension for build platform (mainly for
-# tablegen call if we're cross-compiling).
-BUILD_EXEEXT=@BUILD_EXEEXT@
-
-# Target triple (cpu-vendor-os) for which we should generate code
-TARGET_TRIPLE=@target@
-
-# Extra options to compile LLVM with
-EXTRA_OPTIONS=@EXTRA_OPTIONS@
-
-# Endian-ness of the target
-ENDIAN=@ENDIAN@
-
-# Path to the C++ compiler to use. This is an optional setting, which defaults
-# to whatever your gmake defaults to.
-CXX = @CXX@
-
-# Path to the CC binary, which use used by testcases for native builds.
-CC := @CC@
-
-# Linker flags.
-LDFLAGS+=@LDFLAGS@
-
-# Path to the library archiver program.
-AR_PATH = @AR@
-
-# Path to the nm program
-NM_PATH = @NM@
-
-# The pathnames of the programs we require to build
-BISON := @BISON@
-CMP := @CMP@
-CP := @CP@
-DATE := @DATE@
-FIND := @FIND@
-FLEX := @LEX@
-GREP := @GREP@
-INSTALL := @INSTALL@
-MKDIR := $(LLVM_SRC_ROOT)/autoconf/mkinstalldirs
-MV := @MV@
-RANLIB := @RANLIB@
-RM := @RM@
-SED := @SED@
-TAR := @TAR@
-YACC := @YACC@
-
-# Paths to miscellaneous programs we hope are present but might not be
-PERL := @PERL@
-BZIP2 := @BZIP2@
-DOT := @DOT@
-DOXYGEN := @DOXYGEN@
-GROFF := @GROFF@
-GZIP := @GZIP@
-OCAMLC := @OCAMLC@
-OCAMLOPT := @OCAMLOPT@
-OCAMLDEP := @OCAMLDEP@
-OCAMLDOC := @OCAMLDOC@
-POD2HTML := @POD2HTML@
-POD2MAN := @POD2MAN@
-RUNTEST := @RUNTEST@
-TCLSH := @TCLSH@
-ZIP := @ZIP@
-
-HAVE_PERL := @HAVE_PERL@
-HAVE_PTHREAD := @HAVE_PTHREAD@
-
-LIBS := @LIBS@
-
-# Targets that we should build
-TARGETS_TO_BUILD=@TARGETS_TO_BUILD@
-
-# Path to location for LLVM C/C++ front-end. You can modify this if you
-# want to override the value set by configure.
-LLVMGCCDIR := @LLVMGCCDIR@
-
-# Determine the target for which LLVM should generate code.
-ifeq (@LLVMGCC_MAJVERS@,3)
-LLVMGCCARCH := @target@/3.4-llvm
-else
-LLVMGCCARCH := @target@/@LLVMGCC_VERSION@
-endif
-
-# Determine the path where the library executables are
-LLVMGCCLIBEXEC := @LLVMGCCLIBEXEC@
-
-# Full pathnames of LLVM C/C++ front-end 'cc1' and 'cc1plus' binaries:
-LLVMGCC := @LLVMGCC@
-LLVMGXX := @LLVMGXX@
-LLVMCC1 := @LLVMCC1@
-LLVMCC1PLUS := @LLVMCC1PLUS@
-LLVMGCC_VERSION := @LLVMGCC_VERSION@
-LLVMGCC_MAJVERS := @LLVMGCC_MAJVERS@
-LLVMGCC_LANGS := @LLVMGCC_LANGS@
-
-# Path to directory where object files should be stored during a build.
-# Set OBJ_ROOT to "." if you do not want to use a separate place for
-# object files.
-OBJ_ROOT := .
-
-# These are options that can either be enabled here, or can be enabled on the
-# make command line (ie, make ENABLE_PROFILING=1):
-
-# When ENABLE_OPTIMIZED is enabled, LLVM code is optimized and output is put
-# into the "Release" directories. Otherwise, LLVM code is not optimized and
-# output is put in the "Debug" directories.
-#ENABLE_OPTIMIZED = 1
-@ENABLE_OPTIMIZED@
-
-# When DISABLE_ASSERTIONS is enabled, builds of all of the LLVM code will
-# exclude assertion checks, otherwise they are included.
-#DISABLE_ASSERTIONS = 1
-@DISABLE_ASSERTIONS@
-
-# When ENABLE_EXPENSIVE_CHECKS is enabled, builds of all of the LLVM
-# code will include expensive checks, otherwise they are excluded.
-#ENABLE_EXPENSIVE_CHECKS = 0
-@ENABLE_EXPENSIVE_CHECKS@
-
-# When DEBUG_RUNTIME is enabled, the runtime libraries will retain debug
-# symbols.
-#DEBUG_RUNTIME = 1
-@DEBUG_RUNTIME@
-
-# When ENABLE_PROFILING is enabled, the llvm source base is built with profile
-# information to allow gprof to be used to get execution frequencies.
-#ENABLE_PROFILING = 1
-
-# When ENABLE_DOXYGEN is enabled, the doxygen documentation will be built
-ENABLE_DOXYGEN = @ENABLE_DOXYGEN@
-
-# Do we want to enable threads?
-ENABLE_THREADS := @ENABLE_THREADS@
-
-# Do we want to build with position independent code?
-ENABLE_PIC := @ENABLE_PIC@
-
-# This option tells the Makefiles to produce verbose output.
-# It essentially prints the commands that make is executing
-#VERBOSE = 1
-
-# Enable JIT for this platform
-TARGET_HAS_JIT = @TARGET_HAS_JIT@
-
-# Shared library extension for host platform.
-SHLIBEXT = @SHLIBEXT@
-
-# Executable file extension for host platform.
-EXEEXT = @EXEEXT@
-
-# Things we just assume are "there"
-ECHO := echo
-
-# Get the options for causing archives to link all their content instead of
-# just missing symbols, and the inverse of that. This is used for certain LLVM
-# tools that permit loadable modules. It ensures that the LLVM symbols will be
-# available to those loadable modules.
-LINKALL := @LINKALL@
-NOLINKALL := @NOLINKALL@
-
-# Get the value of HUGE_VAL_SANITY which will be either "yes" or "no" depending
-# on the check.
-HUGE_VAL_SANITY = @HUGE_VAL_SANITY@
-
-# Bindings that we should build
-BINDINGS_TO_BUILD := @BINDINGS_TO_BUILD@
-ALL_BINDINGS := @ALL_BINDINGS@
-OCAML_LIBDIR := @OCAML_LIBDIR@
-
-# When compiling under Mingw/Cygwin, executables such as tblgen
-# expect Windows paths, whereas the build system uses Unix paths.
-# The function SYSPATH transforms Unix paths into Windows paths.
-ifneq (,$(findstring -mno-cygwin, $(CXX)))
- SYSPATH = $(shell echo $(1) | cygpath -m -f -)
-else
- SYSPATH = $(1)
-endif
diff --git a/release_23/Makefile.rules b/release_23/Makefile.rules
deleted file mode 100644
index e28ccf187aa4..000000000000
--- a/release_23/Makefile.rules
+++ /dev/null
@@ -1,1791 +0,0 @@
-#===-- Makefile.rules - Common make rules for LLVM ---------*- Makefile -*--===#
-#
-# The LLVM Compiler Infrastructure
-#
-# This file is distributed under the University of Illinois Open Source
-# License. See LICENSE.TXT for details.
-#
-#===------------------------------------------------------------------------===#
-#
-# This file is included by all of the LLVM makefiles. For details on how to use
-# it properly, please see the document MakefileGuide.html in the docs directory.
-#
-#===-----------------------------------------------------------------------====#
-
-################################################################################
-# TARGETS: Define standard targets that can be invoked
-################################################################################
-
-#--------------------------------------------------------------------
-# Define the various target sets
-#--------------------------------------------------------------------
-RecursiveTargets := all clean clean-all install uninstall install-bytecode
-LocalTargets := all-local clean-local clean-all-local check-local \
- install-local printvars uninstall-local \
- install-bytecode-local
-TopLevelTargets := check dist dist-check dist-clean dist-gzip dist-bzip2 \
- dist-zip
-UserTargets := $(RecursiveTargets) $(LocalTargets) $(TopLevelTargets)
-InternalTargets := preconditions distdir dist-hook
-
-################################################################################
-# INITIALIZATION: Basic things the makefile needs
-################################################################################
-
-#--------------------------------------------------------------------
-# Set the VPATH so that we can find source files.
-#--------------------------------------------------------------------
-VPATH=$(PROJ_SRC_DIR)
-
-#--------------------------------------------------------------------
-# Reset the list of suffixes we know how to build.
-#--------------------------------------------------------------------
-.SUFFIXES:
-.SUFFIXES: .c .cpp .cc .h .hpp .y .l .lo .o .a .bc .td .ps .dot .ll
-.SUFFIXES: $(SHLIBEXT) $(SUFFIXES)
-
-#--------------------------------------------------------------------
-# Mark all of these targets as phony to avoid implicit rule search
-#--------------------------------------------------------------------
-.PHONY: $(UserTargets) $(InternalTargets)
-
-#--------------------------------------------------------------------
-# Make sure all the user-target rules are double colon rules and
-# they are defined first.
-#--------------------------------------------------------------------
-
-$(UserTargets)::
-
-################################################################################
-# PRECONDITIONS: that which must be built/checked first
-################################################################################
-
-SrcMakefiles := $(filter %Makefile %Makefile.tests,\
- $(wildcard $(PROJ_SRC_DIR)/Makefile*))
-ObjMakefiles := $(subst $(PROJ_SRC_DIR),$(PROJ_OBJ_DIR),$(SrcMakefiles))
-ConfigureScript := $(PROJ_SRC_ROOT)/configure
-ConfigStatusScript := $(PROJ_OBJ_ROOT)/config.status
-MakefileConfigIn := $(strip $(wildcard $(PROJ_SRC_ROOT)/Makefile.config.in))
-MakefileCommonIn := $(strip $(wildcard $(PROJ_SRC_ROOT)/Makefile.common.in))
-MakefileConfig := $(PROJ_OBJ_ROOT)/Makefile.config
-MakefileCommon := $(PROJ_OBJ_ROOT)/Makefile.common
-PreConditions := $(ConfigStatusScript) $(ObjMakefiles)
-ifneq ($(MakefileCommonIn),)
-PreConditions += $(MakefileCommon)
-endif
-
-ifneq ($(MakefileConfigIn),)
-PreConditions += $(MakefileConfig)
-endif
-
-preconditions: $(PreConditions)
-
-#------------------------------------------------------------------------
-# Make sure the BUILT_SOURCES are built first
-#------------------------------------------------------------------------
-$(filter-out clean clean-local,$(UserTargets)):: $(BUILT_SOURCES)
-
-clean-all-local::
-ifneq ($(strip $(BUILT_SOURCES)),)
- -$(Verb) $(RM) -f $(BUILT_SOURCES)
-endif
-
-ifneq ($(PROJ_OBJ_ROOT),$(PROJ_SRC_ROOT))
-spotless:
- $(Verb) if test -x config.status ; then \
- $(EchoCmd) Wiping out $(PROJ_OBJ_ROOT) ; \
- $(MKDIR) .spotless.save ; \
- $(MV) config.status .spotless.save ; \
- $(MV) mklib .spotless.save ; \
- $(MV) projects .spotless.save ; \
- $(RM) -rf * ; \
- $(MV) .spotless.save/config.status . ; \
- $(MV) .spotless.save/mklib . ; \
- $(MV) .spotless.save/projects . ; \
- $(RM) -rf .spotless.save ; \
- $(EchoCmd) Rebuilding configuration of $(PROJ_OBJ_ROOT) ; \
- $(ConfigStatusScript) --recheck $(ConfigureScriptFLAGS) && \
- $(ConfigStatusScript) ; \
- else \
- $(EchoCmd) "make spotless" can only be run from $(PROJ_OBJ_ROOT); \
- fi
-else
-spotless:
- $(EchoCmd) "spotless target not supported for objdir == srcdir"
-endif
-
-$(BUILT_SOURCES) : $(ObjMakefiles)
-
-#------------------------------------------------------------------------
-# Make sure we're not using a stale configuration
-#------------------------------------------------------------------------
-reconfigure:
- $(Echo) Reconfiguring $(PROJ_OBJ_ROOT)
- $(Verb) cd $(PROJ_OBJ_ROOT) && \
- if test -w $(PROJ_OBJ_ROOT)/config.cache ; then \
- $(RM) $(PROJ_OBJ_ROOT)/config.cache ; \
- fi ; \
- $(ConfigStatusScript) --recheck $(ConfigureScriptFLAGS) && \
- $(ConfigStatusScript)
-
-.PRECIOUS: $(ConfigStatusScript)
-$(ConfigStatusScript): $(ConfigureScript)
- $(Echo) Reconfiguring with $<
- $(Verb) cd $(PROJ_OBJ_ROOT) && \
- if test -w $(PROJ_OBJ_ROOT)/config.cache ; then \
- $(RM) $(PROJ_OBJ_ROOT)/config.cache ; \
- fi ; \
- $(ConfigStatusScript) --recheck $(ConfigureScriptFLAGS) && \
- $(ConfigStatusScript)
-
-#------------------------------------------------------------------------
-# Make sure the configuration makefile is up to date
-#------------------------------------------------------------------------
-ifneq ($(MakefileConfigIn),)
-$(MakefileConfig): $(MakefileConfigIn) $(ConfigStatusScript)
- $(Echo) Regenerating $@
- $(Verb) cd $(PROJ_OBJ_ROOT) ; $(ConfigStatusScript) Makefile.config
-endif
-
-ifneq ($(MakefileCommonIn),)
-$(MakefileCommon): $(MakefileCommonIn) $(ConfigStatusScript)
- $(Echo) Regenerating $@
- $(Verb) cd $(PROJ_OBJ_ROOT) ; $(ConfigStatusScript) Makefile.common
-endif
-
-#------------------------------------------------------------------------
-# If the Makefile in the source tree has been updated, copy it over into the
-# build tree. But, only do this if the source and object makefiles differ
-#------------------------------------------------------------------------
-ifneq ($(PROJ_OBJ_DIR),$(PROJ_SRC_DIR))
-
-Makefile: $(PROJ_SRC_DIR)/Makefile $(ExtraMakefiles)
- $(Echo) "Updating Makefile"
- $(Verb) $(MKDIR) $(@D)
- $(Verb) $(CP) -f $< $@
-
-# Copy the Makefile.* files unless we're in the root directory which avoids
-# the copying of Makefile.config.in or other things that should be explicitly
-# taken care of.
-$(PROJ_OBJ_DIR)/Makefile% : $(PROJ_SRC_DIR)/Makefile%
- @case '$?' in \
- *Makefile.rules) ;; \
- *.in) ;; \
- *) $(EchoCmd) "Updating $(@F)" ; \
- $(MKDIR) $(@D) ; \
- $(CP) -f $< $@ ;; \
- esac
-
-endif
-
-#------------------------------------------------------------------------
-# Set up the basic dependencies
-#------------------------------------------------------------------------
-$(UserTargets):: $(PreConditions)
-
-all:: all-local
-clean:: clean-local
-clean-all:: clean-local clean-all-local
-install:: install-local
-uninstall:: uninstall-local
-install-local:: all-local
-install-bytecode:: install-bytecode-local
-
-###############################################################################
-# VARIABLES: Set up various variables based on configuration data
-###############################################################################
-
-#--------------------------------------------------------------------
-# Variables derived from configuration we are building
-#--------------------------------------------------------------------
-
-CPP.Defines :=
-# OPTIMIZE_OPTION - The optimization level option we want to build LLVM with
-# this can be overridden on the make command line.
-ifneq ($(OS),MingW)
- OPTIMIZE_OPTION := -O3
-else
- OPTIMIZE_OPTION := -O2
-endif
-
-ifdef ENABLE_PROFILING
- BuildMode := Profile
- CXX.Flags += $(OPTIMIZE_OPTION) -pg -g
- C.Flags += $(OPTIMIZE_OPTION) -pg -g
- LD.Flags += $(OPTIMIZE_OPTION) -pg -g
- KEEP_SYMBOLS := 1
-else
- ifeq ($(ENABLE_OPTIMIZED),1)
- BuildMode := Release
- # Don't use -fomit-frame-pointer on Darwin or FreeBSD.
- ifneq ($(OS),FreeBSD)
- ifneq ($(OS),Darwin)
- OmitFramePointer := -fomit-frame-pointer
- endif
- endif
-
- # Darwin requires -fstrict-aliasing to be explicitly enabled.
- ifeq ($(OS),Darwin)
- EXTRA_OPTIONS += -fstrict-aliasing
- endif
-
- CXX.Flags += $(OPTIMIZE_OPTION) $(OmitFramePointer)
- C.Flags += $(OPTIMIZE_OPTION) $(OmitFramePointer)
- LD.Flags += $(OPTIMIZE_OPTION)
- else
- BuildMode := Debug
- CXX.Flags += -g
- C.Flags += -g
- LD.Flags += -g
- KEEP_SYMBOLS := 1
- endif
-endif
-
-# IF REQUIRES_EH=1 is specified then don't disable exceptions
-ifndef REQUIRES_EH
- CXX.Flags += -fno-exceptions
-endif
-
-# IF REQUIRES_RTTI=1 is specified then don't disable run-time type id
-ifndef REQUIRES_RTTI
-# CXX.Flags += -fno-rtti
-endif
-
-# If DISABLE_ASSERTIONS=1 is specified (make command line or configured),
-# then disable assertions by defining the appropriate preprocessor symbols.
-ifdef DISABLE_ASSERTIONS
- BuildMode := $(BuildMode)-Asserts
- CPP.Defines += -DNDEBUG
-else
- CPP.Defines += -D_DEBUG
-endif
-
-# If ENABLE_EXPENSIVE_CHECKS=1 is specified (make command line or
-# configured), then enable expensive checks by defining the
-# appropriate preprocessor symbols.
-ifdef ENABLE_EXPENSIVE_CHECKS
- BuildMode := $(BuildMode)+Checks
- CPP.Defines += -D_GLIBCXX_DEBUG
-endif
-
-ifeq ($(ENABLE_PIC),1)
- CXX.Flags += -fPIC
- C.Flags += -fPIC
-endif
-
-CXX.Flags += $(CXXFLAGS) -Woverloaded-virtual
-C.Flags += $(CFLAGS)
-CPP.Defines += $(CPPFLAGS)
-CPP.BaseFlags += $(CPP.Defines)
-LD.Flags += $(LDFLAGS)
-AR.Flags := cru
-LibTool.Flags := --tag=CXX
-
-# Make Floating point IEEE compliant on Alpha.
-ifeq ($(ARCH),Alpha)
- CXX.Flags += -mieee
- CPP.BaseFlags += -mieee
-ifeq ($(ENABLE_PIC),0)
- CXX.Flags += -fPIC
- CPP.BaseFlags += -fPIC
-endif
-endif
-
-ifeq ($(ARCH),Alpha)
- LD.Flags += -Wl,--no-relax
-endif
-
-#--------------------------------------------------------------------
-# Directory locations
-#--------------------------------------------------------------------
-ObjDir := $(PROJ_OBJ_DIR)/$(BuildMode)
-LibDir := $(PROJ_OBJ_ROOT)/$(BuildMode)/lib
-ToolDir := $(PROJ_OBJ_ROOT)/$(BuildMode)/bin
-ExmplDir := $(PROJ_OBJ_ROOT)/$(BuildMode)/examples
-LLVMLibDir := $(LLVM_OBJ_ROOT)/$(BuildMode)/lib
-LLVMToolDir := $(LLVM_OBJ_ROOT)/$(BuildMode)/bin
-LLVMExmplDir:= $(LLVM_OBJ_ROOT)/$(BuildMode)/examples
-CFERuntimeLibDir := $(LLVMGCCDIR)/lib
-
-#--------------------------------------------------------------------
-# Full Paths To Compiled Tools and Utilities
-#--------------------------------------------------------------------
-EchoCmd = $(ECHO) llvm[$(MAKELEVEL)]:
-Echo = @$(EchoCmd)
-ifndef LIBTOOL
-LIBTOOL := $(LLVM_OBJ_ROOT)/mklib
-endif
-ifndef LLVMAS
-LLVMAS := $(LLVMToolDir)/llvm-as$(EXEEXT)
-endif
-ifndef TBLGEN
- ifeq ($(LLVM_CROSS_COMPILING),1)
- TBLGEN := $(LLVMToolDir)/tblgen$(BUILD_EXEEXT)
- else
- TBLGEN := $(LLVMToolDir)/tblgen$(EXEEXT)
- endif
-endif
-LLVM_CONFIG := $(LLVMToolDir)/llvm-config
-ifndef LLVMLD
-LLVMLD := $(LLVMToolDir)/llvm-ld$(EXEEXT)
-endif
-ifndef LLVMDIS
-LLVMDIS := $(LLVMToolDir)/llvm-dis$(EXEEXT)
-endif
-ifndef LLI
-LLI := $(LLVMToolDir)/lli$(EXEEXT)
-endif
-ifndef LLC
-LLC := $(LLVMToolDir)/llc$(EXEEXT)
-endif
-ifndef LOPT
-LOPT := $(LLVMToolDir)/opt$(EXEEXT)
-endif
-ifndef LBUGPOINT
-LBUGPOINT := $(LLVMToolDir)/bugpoint$(EXEEXT)
-endif
-ifndef LUPGRADE
-LUPGRADE := $(LLVMToolDir)/llvm-upgrade$(EXEEXT)
-endif
-ifeq ($(LLVMGCC_MAJVERS),3)
-UPGRADE_MSG = $(Echo) "Upgrading $(1) assembly to latest."
-UPGRADE_LL = $(Verb)$(LUPGRADE) $(1) -o $(1).up.tmp -f ; $(MV) $(1).up.tmp $(1)
-LLVMGCCWITHPATH := PATH="$(LLVMToolDir):$(PATH)" $(LLVMGCC)
-LLVMGXXWITHPATH := PATH="$(LLVMToolDir):$(PATH)" $(LLVMGXX)
-else
-UPGRADE_MSG =
-UPGRADE_LL =
-LLVMGCCWITHPATH := $(LLVMGCC)
-LLVMGXXWITHPATH := $(LLVMGXX)
-endif
-
-#--------------------------------------------------------------------
-# Adjust to user's request
-#--------------------------------------------------------------------
-
-# Adjust LD.Flags and Libtool.Flags depending on the kind of library that is
-# to be built. Note that if LOADABLE_MODULE is specified then the resulting
-# shared library can be opened with dlopen. Also, LOADABLE_MODULE implies
-# several other things so we force them to be defined/on.
-ifdef LOADABLE_MODULE
- SHARED_LIBRARY := 1
- DONT_BUILD_RELINKED := 1
- LINK_LIBS_IN_SHARED := 1
- LD.Flags += -module
-endif
-
-ifdef SHARED_LIBRARY
- LD.Flags += -rpath $(LibDir)
-else
- LibTool.Flags += --tag=disable-shared
-endif
-
-ifdef TOOL_VERBOSE
- C.Flags += -v
- CXX.Flags += -v
- LD.Flags += -v
- VERBOSE := 1
-endif
-
-# Adjust settings for verbose mode
-ifndef VERBOSE
- Verb := @
- LibTool.Flags += --silent
- AR.Flags += >/dev/null 2>/dev/null
- ConfigureScriptFLAGS += >$(PROJ_OBJ_DIR)/configure.out 2>&1
-else
- ConfigureScriptFLAGS :=
-endif
-
-# By default, strip symbol information from executable
-ifndef KEEP_SYMBOLS
- Strip := $(PLATFORMSTRIPOPTS)
- StripWarnMsg := "(without symbols)"
- Install.StripFlag += -s
-endif
-
-# Adjust linker flags for building an executable
-ifdef TOOLNAME
-ifdef EXAMPLE_TOOL
- LD.Flags += -rpath $(ExmplDir) -export-dynamic
-else
- LD.Flags += -rpath $(ToolDir) -export-dynamic
-endif
-endif
-
-#----------------------------------------------------------
-# Options To Invoke Tools
-#----------------------------------------------------------
-
-CompileCommonOpts := -pedantic -Wall -W -Wwrite-strings -Wno-long-long \
- -Wunused -Wno-unused-parameter $(EXTRA_OPTIONS)
-
-ifeq ($(OS),HP-UX)
- CompileCommonOpts := -D_REENTRANT -D_HPUX_SOURCE
-endif
-
-# If we are building a universal binary on Mac OS/X, pass extra options. This
-# is useful to people that want to link the LLVM libraries into their universal
-# apps.
-#
-# The following can be optionally specified:
-# UNIVERSAL_SDK_PATH variable can be specified as a path to the SDK to use.
-# For Mac OS/X 10.4 Intel machines, the traditional one is:
-# UNIVERSAL_SDK_PATH=/Developer/SDKs/MacOSX10.4u.sdk/
-# UNIVERSAL_ARCH can be optionally specified to be a list of architectures
-# to build for, e.g. UNIVERSAL_ARCH="i386 ppc ppc64". This defaults to
-# i386/ppc only.
-ifdef UNIVERSAL
- ifndef UNIVERSAL_ARCH
- UNIVERSAL_ARCH := i386 ppc
- endif
- UNIVERSAL_ARCH_OPTIONS := $(UNIVERSAL_ARCH:%=-arch %)
- CompileCommonOpts += $(UNIVERSAL_ARCH_OPTIONS)
- Relink.Flags := $(UNIVERSAL_ARCH_OPTIONS:%=-XCClinker %)
- ifdef UNIVERSAL_SDK_PATH
- CompileCommonOpts += -isysroot $(UNIVERSAL_SDK_PATH)
- Relink.Flags += -XCClinker -isysroot -XCClinker $(UNIVERSAL_SDK_PATH)
- endif
-
- # Building universal cannot compute dependencies automatically.
- DISABLE_AUTO_DEPENDENCIES=1
-endif
-
-LD.Flags += -L$(LibDir) -L$(LLVMLibDir)
-CPP.BaseFlags += -D_GNU_SOURCE -D__STDC_LIMIT_MACROS
-# All -I flags should go here, so that they don't confuse llvm-config.
-CPP.Flags += $(sort -I$(PROJ_OBJ_DIR) -I$(PROJ_SRC_DIR) \
- $(patsubst %,-I%/include,\
- $(PROJ_OBJ_ROOT) $(PROJ_SRC_ROOT) \
- $(LLVM_OBJ_ROOT) $(LLVM_SRC_ROOT))) \
- $(CPP.BaseFlags)
-
-Compile.C = $(CC) $(CPP.Flags) $(C.Flags) $(CompileCommonOpts) -c
-LTCompile.C = $(LIBTOOL) $(LibTool.Flags) --mode=compile $(Compile.C)
-BCCompile.C = $(LLVMGCCWITHPATH) $(CPP.Flags) $(C.Flags) $(CompileCommonOpts)
-Preprocess.C = $(CC) $(CPP.Flags) $(C.Flags) $(CompileCommonOpts) -E
-
-Compile.CXX = $(CXX) $(CPP.Flags) $(CXX.Flags) $(CompileCommonOpts) -c
-LTCompile.CXX = $(LIBTOOL) $(LibTool.Flags) --mode=compile $(Compile.CXX)
-BCCompile.CXX = $(LLVMGXXWITHPATH) $(CPP.Flags) $(CXX.Flags) \
- $(CompileCommonOpts)
-
-Preprocess.CXX= $(CXX) $(CPP.Flags) $(CompileCommonOpts) $(CXX.Flags) -E
-Link = $(CXX) $(CPP.Flags) $(CXX.Flags) $(CompileCommonOpts) \
- $(LD.Flags) $(Strip)
-LTLink = $(LIBTOOL) $(LibTool.Flags) --mode=link $(Link)
-Relink = $(CXX) $(CPP.Flags) $(CXX.Flags) $(CompileCommonOpts) \
- $(Relink.Flags)
-LTRelink = $(LIBTOOL) $(LibTool.Flags) --mode=link $(Relink)
-LTInstall = $(LIBTOOL) $(LibTool.Flags) --mode=install $(INSTALL) \
- $(Install.Flags)
-ProgInstall = $(INSTALL) $(Install.StripFlag) -m 0755
-ScriptInstall = $(INSTALL) -m 0755
-DataInstall = $(INSTALL) -m 0644
-
-# When compiling under Mingw/Cygwin, the tblgen tool expects Windows
-# paths. In this case, the SYSPATH function (defined in
-# Makefile.config) transforms Unix paths into Windows paths.
-TableGen = $(TBLGEN) -I $(call SYSPATH, $(PROJ_SRC_DIR)) \
- -I $(call SYSPATH, $(PROJ_SRC_ROOT)/include) \
- -I $(call SYSPATH, $(PROJ_SRC_ROOT)/lib/Target)
-
-Archive = $(AR) $(AR.Flags)
-LArchive = $(LLVMToolDir)/llvm-ar rcsf
-ifdef RANLIB
-Ranlib = $(RANLIB)
-else
-Ranlib = ranlib
-endif
-
-#----------------------------------------------------------
-# Get the list of source files and compute object file
-# names from them.
-#----------------------------------------------------------
-
-ifndef SOURCES
- Sources := $(notdir $(wildcard $(PROJ_SRC_DIR)/*.cpp \
- $(PROJ_SRC_DIR)/*.cc $(PROJ_SRC_DIR)/*.c $(PROJ_SRC_DIR)/*.y \
- $(PROJ_SRC_DIR)/*.l))
-else
- Sources := $(SOURCES)
-endif
-
-ifdef BUILT_SOURCES
-Sources += $(filter %.cpp %.c %.cc %.y %.l,$(BUILT_SOURCES))
-endif
-
-BaseNameSources := $(sort $(basename $(Sources)))
-
-ObjectsO := $(BaseNameSources:%=$(ObjDir)/%.o)
-ObjectsLO := $(BaseNameSources:%=$(ObjDir)/%.lo)
-ObjectsBC := $(BaseNameSources:%=$(ObjDir)/%.bc)
-
-###############################################################################
-# DIRECTORIES: Handle recursive descent of directory structure
-###############################################################################
-
-#---------------------------------------------------------
-# Provide rules to make install dirs. This must be early
-# in the file so they get built before dependencies
-#---------------------------------------------------------
-
-$(PROJ_bindir): $(PROJ_bindir)/.dir
-$(PROJ_libdir): $(PROJ_libdir)/.dir
-$(PROJ_includedir): $(PROJ_includedir)/.dir
-$(PROJ_etcdir): $(PROJ_etcdir)/.dir
-
-# To create other directories, as needed, and timestamp their creation
-%/.dir:
- $(Verb) $(MKDIR) $* > /dev/null
- $(Verb) $(DATE) > $@
-
-.PRECIOUS: $(ObjDir)/.dir $(LibDir)/.dir $(ToolDir)/.dir $(ExmplDir)/.dir
-.PRECIOUS: $(LLVMLibDir)/.dir $(LLVMToolDir)/.dir $(LLVMExmplDir)/.dir
-
-#---------------------------------------------------------
-# Handle the DIRS options for sequential construction
-#---------------------------------------------------------
-
-SubDirs :=
-ifdef DIRS
-SubDirs += $(DIRS)
-
-ifneq ($(PROJ_SRC_ROOT),$(PROJ_OBJ_ROOT))
-$(RecursiveTargets)::
- $(Verb) for dir in $(DIRS); do \
- if [ ! -f $$dir/Makefile ]; then \
- $(MKDIR) $$dir; \
- $(CP) $(PROJ_SRC_DIR)/$$dir/Makefile $$dir/Makefile; \
- fi; \
- ($(MAKE) -C $$dir $@ ) || exit 1; \
- done
-else
-$(RecursiveTargets)::
- $(Verb) for dir in $(DIRS); do \
- ($(MAKE) -C $$dir $@ ) || exit 1; \
- done
-endif
-
-endif
-
-#---------------------------------------------------------
-# Handle the EXPERIMENTAL_DIRS options ensuring success
-# after each directory is built.
-#---------------------------------------------------------
-ifdef EXPERIMENTAL_DIRS
-$(RecursiveTargets)::
- $(Verb) for dir in $(EXPERIMENTAL_DIRS); do \
- if [ ! -f $$dir/Makefile ]; then \
- $(MKDIR) $$dir; \
- $(CP) $(PROJ_SRC_DIR)/$$dir/Makefile $$dir/Makefile; \
- fi; \
- ($(MAKE) -C $$dir $@ ) || exit 0; \
- done
-endif
-
-#-----------------------------------------------------------
-# Handle the PARALLEL_DIRS options for parallel construction
-#-----------------------------------------------------------
-ifdef PARALLEL_DIRS
-
-SubDirs += $(PARALLEL_DIRS)
-
-# Unfortunately, this list must be maintained if new recursive targets are added
-all :: $(addsuffix /.makeall ,$(PARALLEL_DIRS))
-clean :: $(addsuffix /.makeclean ,$(PARALLEL_DIRS))
-clean-all:: $(addsuffix /.makeclean-all,$(PARALLEL_DIRS))
-install :: $(addsuffix /.makeinstall ,$(PARALLEL_DIRS))
-uninstall:: $(addsuffix /.makeuninstall,$(PARALLEL_DIRS))
-install-bytecode :: $(addsuffix /.makeinstall-bytecode,$(PARALLEL_DIRS))
-
-ParallelTargets := $(foreach T,$(RecursiveTargets),%/.make$(T))
-
-$(ParallelTargets) :
- $(Verb) if [ ! -f $(@D)/Makefile ]; then \
- $(MKDIR) $(@D); \
- $(CP) $(PROJ_SRC_DIR)/$(@D)/Makefile $(@D)/Makefile; \
- fi; \
- $(MAKE) -C $(@D) $(subst $(@D)/.make,,$@)
-endif
-
-#---------------------------------------------------------
-# Handle the OPTIONAL_DIRS options for directores that may
-# or may not exist.
-#---------------------------------------------------------
-ifdef OPTIONAL_DIRS
-
-SubDirs += $(OPTIONAL_DIRS)
-
-ifneq ($(PROJ_SRC_ROOT),$(PROJ_OBJ_ROOT))
-$(RecursiveTargets)::
- $(Verb) for dir in $(OPTIONAL_DIRS); do \
- if [ -d $(PROJ_SRC_DIR)/$$dir ]; then\
- if [ ! -f $$dir/Makefile ]; then \
- $(MKDIR) $$dir; \
- $(CP) $(PROJ_SRC_DIR)/$$dir/Makefile $$dir/Makefile; \
- fi; \
- ($(MAKE) -C$$dir $@ ) || exit 1; \
- fi \
- done
-else
-$(RecursiveTargets)::
- $(Verb) for dir in $(OPTIONAL_DIRS); do \
- ($(MAKE) -C$$dir $@ ) || exit 1; \
- done
-endif
-endif
-
-#---------------------------------------------------------
-# Handle the CONFIG_FILES options
-#---------------------------------------------------------
-ifdef CONFIG_FILES
-
-ifdef NO_INSTALL
-install-local::
- $(Echo) Install circumvented with NO_INSTALL
-uninstall-local::
- $(Echo) UnInstall circumvented with NO_INSTALL
-else
-install-local:: $(PROJ_etcdir) $(CONFIG_FILES)
- $(Echo) Installing Configuration Files To $(PROJ_etcdir)
- $(Verb)for file in $(CONFIG_FILES); do \
- if test -f $(PROJ_OBJ_DIR)/$${file} ; then \
- $(DataInstall) $(PROJ_OBJ_DIR)/$${file} $(PROJ_etcdir) ; \
- elif test -f $(PROJ_SRC_DIR)/$${file} ; then \
- $(DataInstall) $(PROJ_SRC_DIR)/$${file} $(PROJ_etcdir) ; \
- else \
- $(ECHO) Error: cannot find config file $${file}. ; \
- fi \
- done
-
-uninstall-local::
- $(Echo) Uninstalling Configuration Files From $(PROJ_etcdir)
- $(Verb)for file in $(CONFIG_FILES); do \
- $(RM) -f $(PROJ_etcdir)/$${file} ; \
- done
-endif
-
-endif
-
-###############################################################################
-# Set up variables for building libararies
-###############################################################################
-
-#---------------------------------------------------------
-# Define various command line options pertaining to the
-# libraries needed when linking. There are "Proj" libs
-# (defined by the user's project) and "LLVM" libs (defined
-# by the LLVM project).
-#---------------------------------------------------------
-
-ifdef USEDLIBS
-ProjLibsOptions := $(patsubst %.a.o, -l%, $(addsuffix .o, $(USEDLIBS)))
-ProjLibsOptions := $(patsubst %.o, $(LibDir)/%.o, $(ProjLibsOptions))
-ProjUsedLibs := $(patsubst %.a.o, lib%.a, $(addsuffix .o, $(USEDLIBS)))
-ProjLibsPaths := $(addprefix $(LibDir)/,$(ProjUsedLibs))
-endif
-
-ifdef LLVMLIBS
-LLVMLibsOptions := $(patsubst %.a.o, -l%, $(addsuffix .o, $(LLVMLIBS)))
-LLVMLibsOptions := $(patsubst %.o, $(LLVMLibDir)/%.o, $(LLVMLibsOptions))
-LLVMUsedLibs := $(patsubst %.a.o, lib%.a, $(addsuffix .o, $(LLVMLIBS)))
-LLVMLibsPaths := $(addprefix $(LLVMLibDir)/,$(LLVMUsedLibs))
-endif
-
-ifeq ($(strip $(filter clean clean-local dist-clean,$(MAKECMDGOALS))),)
-ifdef LINK_COMPONENTS
-
-# If LLVM_CONFIG doesn't exist, build it. This can happen if you do a make
-# clean in tools, then do a make in tools (instead of at the top level).
-$(LLVM_CONFIG):
- @echo "*** llvm-config doesn't exist - rebuilding it."
- @$(MAKE) -C $(PROJ_OBJ_ROOT)/tools/llvm-config
-
-$(ToolDir)/$(strip $(TOOLNAME))$(EXEEXT): $(LLVM_CONFIG)
-
-ProjLibsOptions += $(shell $(LLVM_CONFIG) --libs $(LINK_COMPONENTS))
-ProjLibsPaths += $(LLVM_CONFIG) \
- $(shell $(LLVM_CONFIG) --libfiles $(LINK_COMPONENTS))
-endif
-endif
-
-###############################################################################
-# Library Build Rules: Four ways to build a library
-###############################################################################
-
-#---------------------------------------------------------
-# Bytecode Module Targets:
-# If the user set MODULE_NAME then they want to build a
-# bytecode module from the sources. We compile all the
-# sources and link it together into a single bytecode
-# module.
-#---------------------------------------------------------
-
-ifdef MODULE_NAME
-ifeq ($(strip $(LLVMGCC)),)
-$(warning Modules require llvm-gcc but no llvm-gcc is available ****)
-else
-
-Module := $(LibDir)/$(MODULE_NAME).bc
-LinkModule := $(LLVMLD) -L$(CFERuntimeLibDir) -r
-
-
-ifdef EXPORTED_SYMBOL_FILE
-LinkModule += -internalize-public-api-file=$(EXPORTED_SYMBOL_FILE)
-endif
-
-$(Module): $(BUILT_SOURCES) $(ObjectsBC) $(LibDir)/.dir $(LLVMLD)
- $(Echo) Building $(BuildMode) Bytecode Module $(notdir $@)
- $(Verb) $(LinkModule) -o $@ $(ObjectsBC)
-
-all-local:: $(Module)
-
-clean-local::
-ifneq ($(strip $(Module)),)
- -$(Verb) $(RM) -f $(Module)
-endif
-
-ifdef BYTECODE_DESTINATION
-ModuleDestDir := $(BYTECODE_DESTINATION)
-else
-ModuleDestDir := $(PROJ_libdir)
-endif
-
-ifdef NO_INSTALL
-install-local::
- $(Echo) Install circumvented with NO_INSTALL
-uninstall-local::
- $(Echo) Uninstall circumvented with NO_INSTALL
-else
-DestModule := $(ModuleDestDir)/$(MODULE_NAME).bc
-
-install-module:: $(DestModule)
-install-local:: $(DestModule)
-
-$(DestModule): $(ModuleDestDir) $(Module)
- $(Echo) Installing $(BuildMode) Bytecode Module $(DestModule)
- $(Verb) $(DataInstall) $(Module) $(DestModule)
-
-uninstall-local::
- $(Echo) Uninstalling $(BuildMode) Bytecode Module $(DestModule)
- -$(Verb) $(RM) -f $(DestModule)
-endif
-
-endif
-endif
-
-# if we're building a library ...
-ifdef LIBRARYNAME
-
-# Make sure there isn't any extranous whitespace on the LIBRARYNAME option
-LIBRARYNAME := $(strip $(LIBRARYNAME))
-ifdef LOADABLE_MODULE
-LibName.LA := $(LibDir)/$(LIBRARYNAME).la
-else
-LibName.LA := $(LibDir)/lib$(LIBRARYNAME).la
-endif
-LibName.A := $(LibDir)/lib$(LIBRARYNAME).a
-LibName.O := $(LibDir)/$(LIBRARYNAME).o
-LibName.BCA:= $(LibDir)/lib$(LIBRARYNAME).bca
-
-#---------------------------------------------------------
-# Shared Library Targets:
-# If the user asked for a shared library to be built
-# with the SHARED_LIBRARY variable, then we provide
-# targets for building them.
-#---------------------------------------------------------
-ifdef SHARED_LIBRARY
-
-all-local:: $(LibName.LA)
-
-ifdef LINK_LIBS_IN_SHARED
-ifdef LOADABLE_MODULE
-SharedLibKindMessage := "Loadable Module"
-else
-SharedLibKindMessage := "Shared Library"
-endif
-$(LibName.LA): $(ObjectsLO) $(ProjLibsPaths) $(LLVMLibsPaths) $(LibDir)/.dir
- $(Echo) Linking $(BuildMode) $(SharedLibKindMessage) \
- $(LIBRARYNAME)$(SHLIBEXT)
- $(Verb) $(LTLink) -o $@ $(ObjectsLO) $(ProjLibsOptions) \
- $(LLVMLibsOptions)
- $(Verb) $(LTInstall) $@ $(LibDir)
-else
-$(LibName.LA): $(ObjectsLO) $(LibDir)/.dir
- $(Echo) Linking $(BuildMode) Shared Library $(LIBRARYNAME)$(SHLIBEXT)
- $(Verb) $(LTLink) -o $@ $(ObjectsLO)
- $(Verb) $(LTInstall) $@ $(LibDir)
-endif
-
-clean-local::
-ifneq ($(strip $(LibName.LA)),)
- -$(Verb) $(RM) -f $(LibName.LA)
-endif
-
-ifdef NO_INSTALL
-install-local::
- $(Echo) Install circumvented with NO_INSTALL
-uninstall-local::
- $(Echo) Uninstall circumvented with NO_INSTALL
-else
-DestSharedLib = $(PROJ_libdir)/lib$(LIBRARYNAME)$(SHLIBEXT)
-
-install-local:: $(DestSharedLib)
-
-$(DestSharedLib): $(PROJ_libdir) $(LibName.LA)
- $(Echo) Installing $(BuildMode) Shared Library $(DestSharedLib)
- $(Verb) $(LTInstall) $(LibName.LA) $(DestSharedLib)
- $(Verb) $(LIBTOOL) --finish $(PROJ_libdir)
-
-uninstall-local::
- $(Echo) Uninstalling $(BuildMode) Shared Library $(DestSharedLib)
- -$(Verb) $(RM) -f $(PROJ_libdir)/lib$(LIBRARYNAME).*
-endif
-endif
-
-#---------------------------------------------------------
-# Bytecode Library Targets:
-# If the user asked for a bytecode library to be built
-# with the BYTECODE_LIBRARY variable, then we provide
-# targets for building them.
-#---------------------------------------------------------
-ifdef BYTECODE_LIBRARY
-ifeq ($(strip $(LLVMGCC)),)
-$(warning Bytecode libraries require llvm-gcc which could not be found ****)
-else
-
-all-local:: $(LibName.BCA)
-
-ifdef EXPORTED_SYMBOL_FILE
-BCLinkLib = $(LLVMLD) -L$(CFERuntimeLibDir) \
- -internalize-public-api-file=$(EXPORTED_SYMBOL_FILE)
-
-$(LibName.BCA): $(ObjectsBC) $(LibDir)/.dir $(LLVMLD) \
- $(LLVMToolDir)/llvm-ar
- $(Echo) Building $(BuildMode) Bytecode Archive $(notdir $@) \
- "(internalize)"
- $(Verb) $(BCLinkLib) -o $(ObjDir)/$(LIBRARYNAME).o $(ObjectsBC)
- $(Verb) $(RM) -f $@
- $(Verb) $(LArchive) $@ $(ObjDir)/$(LIBRARYNAME).o
-else
-$(LibName.BCA): $(ObjectsBC) $(LibDir)/.dir \
- $(LLVMToolDir)/llvm-ar
- $(Echo) Building $(BuildMode) Bytecode Archive $(notdir $@)
- $(Verb) $(RM) -f $@
- $(Verb) $(LArchive) $@ $(ObjectsBC)
-
-endif
-
-clean-local::
-ifneq ($(strip $(LibName.BCA)),)
- -$(Verb) $(RM) -f $(LibName.BCA)
-endif
-
-ifdef BYTECODE_DESTINATION
-BytecodeDestDir := $(BYTECODE_DESTINATION)
-else
-BytecodeDestDir := $(PROJ_libdir)
-endif
-
-DestBytecodeLib = $(BytecodeDestDir)/lib$(LIBRARYNAME).a
-
-install-bytecode-local:: $(DestBytecodeLib)
-
-ifdef NO_INSTALL
-install-local::
- $(Echo) Install circumvented with NO_INSTALL
-uninstall-local::
- $(Echo) Uninstall circumvented with NO_INSTALL
-else
-install-local:: $(DestBytecodeLib)
-
-$(DestBytecodeLib): $(BytecodeDestDir) $(LibName.BCA)
- $(Echo) Installing $(BuildMode) Bytecode Archive $(DestBytecodeLib)
- $(Verb) $(DataInstall) $(LibName.BCA) $(DestBytecodeLib)
-
-uninstall-local::
- $(Echo) Uninstalling $(BuildMode) Bytecode Archive $(DestBytecodeLib)
- -$(Verb) $(RM) -f $(DestBytecodeLib)
-endif
-endif
-endif
-
-#---------------------------------------------------------
-# ReLinked Library Targets:
-# If the user explicitly requests a relinked library with
-# BUILD_RELINKED, provide it. Otherwise, if they specify
-# neither of BUILD_ARCHIVE or DONT_BUILD_RELINKED, give
-# them one.
-#---------------------------------------------------------
-ifndef BUILD_ARCHIVE
-ifndef DONT_BUILD_RELINKED
-BUILD_RELINKED = 1
-endif
-endif
-
-ifdef BUILD_RELINKED
-
-all-local:: $(LibName.O)
-
-$(LibName.O): $(ObjectsO) $(LibDir)/.dir
- $(Echo) Linking $(BuildMode) Object Library $(notdir $@)
- $(Verb) $(LTRelink) -o $@ $(ObjectsO)
-
-clean-local::
-ifneq ($(strip $(LibName.O)),)
- -$(Verb) $(RM) -f $(LibName.O)
-endif
-
-ifdef NO_INSTALL
-install-local::
- $(Echo) Install circumvented with NO_INSTALL
-uninstall-local::
- $(Echo) Uninstall circumvented with NO_INSTALL
-else
-DestRelinkedLib = $(PROJ_libdir)/$(LIBRARYNAME).o
-
-install-local:: $(DestRelinkedLib)
-
-$(DestRelinkedLib): $(PROJ_libdir) $(LibName.O)
- $(Echo) Installing $(BuildMode) Object Library $(DestRelinkedLib)
- $(Verb) $(LTInstall) $(LibName.O) $(DestRelinkedLib)
-
-uninstall-local::
- $(Echo) Uninstalling $(BuildMode) Object Library $(DestRelinkedLib)
- -$(Verb) $(RM) -f $(DestRelinkedLib)
-endif
-endif
-
-#---------------------------------------------------------
-# Archive Library Targets:
-# If the user wanted a regular archive library built,
-# then we provide targets for building them.
-#---------------------------------------------------------
-ifdef BUILD_ARCHIVE
-
-all-local:: $(LibName.A)
-
-$(LibName.A): $(ObjectsO) $(LibDir)/.dir
- $(Echo) Building $(BuildMode) Archive Library $(notdir $@)
- -$(Verb) $(RM) -f $@
- $(Verb) $(Archive) $@ $(ObjectsO)
- $(Verb) $(Ranlib) $@
-
-clean-local::
-ifneq ($(strip $(LibName.A)),)
- -$(Verb) $(RM) -f $(LibName.A)
-endif
-
-ifdef NO_INSTALL
-install-local::
- $(Echo) Install circumvented with NO_INSTALL
-uninstall-local::
- $(Echo) Uninstall circumvented with NO_INSTALL
-else
-DestArchiveLib := $(PROJ_libdir)/lib$(LIBRARYNAME).a
-
-install-local:: $(DestArchiveLib)
-
-$(DestArchiveLib): $(PROJ_libdir) $(LibName.A)
- $(Echo) Installing $(BuildMode) Archive Library $(DestArchiveLib)
- $(Verb) $(MKDIR) $(PROJ_libdir)
- $(Verb) $(LTInstall) $(LibName.A) $(DestArchiveLib)
-
-uninstall-local::
- $(Echo) Uninstalling $(BuildMode) Archive Library $(DestArchiveLib)
- -$(Verb) $(RM) -f $(DestArchiveLib)
-endif
-endif
-
-# endif LIBRARYNAME
-endif
-
-###############################################################################
-# Tool Build Rules: Build executable tool based on TOOLNAME option
-###############################################################################
-
-ifdef TOOLNAME
-
-#---------------------------------------------------------
-# Set up variables for building a tool.
-#---------------------------------------------------------
-ifdef EXAMPLE_TOOL
-ToolBuildPath := $(ExmplDir)/$(strip $(TOOLNAME))$(EXEEXT)
-else
-ToolBuildPath := $(ToolDir)/$(strip $(TOOLNAME))$(EXEEXT)
-endif
-
-#---------------------------------------------------------
-# Provide targets for building the tools
-#---------------------------------------------------------
-all-local:: $(ToolBuildPath)
-
-clean-local::
-ifneq ($(strip $(ToolBuildPath)),)
- -$(Verb) $(RM) -f $(ToolBuildPath)
-endif
-
-ifdef EXAMPLE_TOOL
-$(ToolBuildPath): $(ExmplDir)/.dir
-else
-$(ToolBuildPath): $(ToolDir)/.dir
-endif
-
-$(ToolBuildPath): $(ObjectsO) $(ProjLibsPaths) $(LLVMLibsPaths)
- $(Echo) Linking $(BuildMode) executable $(TOOLNAME) $(StripWarnMsg)
- $(Verb) $(LTLink) -o $@ $(TOOLLINKOPTS) $(ObjectsO) $(ProjLibsOptions) \
- $(LLVMLibsOptions) $(ExtraLibs) $(TOOLLINKOPTSB) $(LIBS)
- $(Echo) ======= Finished Linking $(BuildMode) Executable $(TOOLNAME) \
- $(StripWarnMsg)
-
-ifdef NO_INSTALL
-install-local::
- $(Echo) Install circumvented with NO_INSTALL
-uninstall-local::
- $(Echo) Uninstall circumvented with NO_INSTALL
-else
-DestTool = $(PROJ_bindir)/$(TOOLNAME)
-
-install-local:: $(DestTool)
-
-$(DestTool): $(PROJ_bindir) $(ToolBuildPath)
- $(Echo) Installing $(BuildMode) $(DestTool)
- $(Verb) $(ProgInstall) $(ToolBuildPath) $(DestTool)
-
-uninstall-local::
- $(Echo) Uninstalling $(BuildMode) $(DestTool)
- -$(Verb) $(RM) -f $(DestTool)
-endif
-endif
-
-###############################################################################
-# Object Build Rules: Build object files based on sources
-###############################################################################
-
-# FIXME: This should be checking for "if not GCC or ICC", not for "if HP-UX"
-ifeq ($(OS),HP-UX)
- DISABLE_AUTO_DEPENDENCIES=1
-endif
-
-ifdef SHARED_LIBRARY
-PIC_FLAG = "(PIC)"
-MAYBE_PIC_Compile.CXX = $(LTCompile.CXX)
-MAYBE_PIC_Compile.C = $(LTCompile.C)
-else
-MAYBE_PIC_Compile.CXX = $(Compile.CXX)
-MAYBE_PIC_Compile.C = $(Compile.C)
-endif
-
-# Provide rule sets for when dependency generation is enabled
-ifndef DISABLE_AUTO_DEPENDENCIES
-
-#---------------------------------------------------------
-# Create .lo files in the ObjDir directory from the .cpp and .c files...
-#---------------------------------------------------------
-
-DEPEND_OPTIONS = -MMD -MP -MF "$(ObjDir)/$*.d.tmp" \
- -MT "$(ObjDir)/$*.lo" -MT "$(ObjDir)/$*.o" -MT "$(ObjDir)/$*.d"
-
-# If the build succeeded, move the dependency file over. If it failed, put an
-# empty file there.
-DEPEND_MOVEFILE = then $(MV) -f "$(ObjDir)/$*.d.tmp" "$(ObjDir)/$*.d"; \
- else $(RM) "$(ObjDir)/$*.d.tmp"; exit 1; fi
-
-$(ObjDir)/%.lo $(ObjDir)/%.o: %.cpp $(ObjDir)/.dir $(BUILT_SOURCES)
- $(Echo) "Compiling $*.cpp for $(BuildMode) build " $(PIC_FLAG)
- $(Verb) if $(MAYBE_PIC_Compile.CXX) $(DEPEND_OPTIONS) $< -o $(ObjDir)/$*.o ; \
- $(DEPEND_MOVEFILE)
-
-$(ObjDir)/%.lo $(ObjDir)/%.o: %.cc $(ObjDir)/.dir $(BUILT_SOURCES)
- $(Echo) "Compiling $*.cc for $(BuildMode) build" $(PIC_FLAG)
- $(Verb) if $(MAYBE_PIC_Compile.CXX) $(DEPEND_OPTIONS) $< -o $(ObjDir)/$*.o ; \
- $(DEPEND_MOVEFILE)
-
-$(ObjDir)/%.lo $(ObjDir)/%.o: %.c $(ObjDir)/.dir $(BUILT_SOURCES)
- $(Echo) "Compiling $*.c for $(BuildMode) build" $(PIC_FLAG)
- $(Verb) if $(MAYBE_PIC_Compile.C) $(DEPEND_OPTIONS) $< -o $(ObjDir)/$*.o ; \
- $(DEPEND_MOVEFILE)
-
-#---------------------------------------------------------
-# Create .bc files in the ObjDir directory from .cpp .cc and .c files...
-#---------------------------------------------------------
-
-$(ObjDir)/%.ll: %.cpp $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMGXX)
- $(Echo) "Compiling $*.cpp for $(BuildMode) build (bytecode)"
- $(Verb) if $(BCCompile.CXX) -MD -MT $@ -MP -MF "$(ObjDir)/$*.BCCXXd" \
- $< -o $@ -S -emit-llvm ; \
- then $(MV) -f "$(ObjDir)/$*.BCCXXd" "$(ObjDir)/$*.d"; \
- else $(RM) -f "$(ObjDir)/$*.BCCXXd"; exit 1; fi
- $(call UPGRADE_MSG,$@)
- $(call UPGRADE_LL,$@)
-
-$(ObjDir)/%.ll: %.cc $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMGXX)
- $(Echo) "Compiling $*.cc for $(BuildMode) build (bytecode)"
- $(Verb) if $(BCCompile.CXX) -MD -MT $@ -MP -MF "$(ObjDir)/$*.BCCXXd" \
- $< -o $@ -S -emit-llvm ; \
- then $(MV) -f "$(ObjDir)/$*.BCCXXd" "$(ObjDir)/$*.d"; \
- else $(RM) -f "$(ObjDir)/$*.BCCXXd"; exit 1; fi
- $(call UPGRADE_MSG,$@)
- $(call UPGRADE_LL,$@)
-
-$(ObjDir)/%.ll: %.c $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMGCC)
- $(Echo) "Compiling $*.c for $(BuildMode) build (bytecode)"
- $(Verb) if $(BCCompile.C) -MD -MT $@ -MP -MF "$(ObjDir)/$*.BCCd" \
- $< -o $@ -S -emit-llvm ; \
- then $(MV) -f "$(ObjDir)/$*.BCCd" "$(ObjDir)/$*.d"; \
- else $(RM) -f "$(ObjDir)/$*.BCCd"; exit 1; fi
- $(call UPGRADE_MSG,$@)
- $(call UPGRADE_LL,$@)
-
-# Provide alternate rule sets if dependencies are disabled
-else
-
-$(ObjDir)/%.lo $(ObjDir)/%.o: %.cpp $(ObjDir)/.dir $(BUILT_SOURCES)
- $(Echo) "Compiling $*.cpp for $(BuildMode) build" $(PIC_FLAG)
- $(MAYBE_PIC_Compile.CXX) $< -o $@
-
-$(ObjDir)/%.lo $(ObjDir)/%.o: %.cc $(ObjDir)/.dir $(BUILT_SOURCES)
- $(Echo) "Compiling $*.cc for $(BuildMode) build" $(PIC_FLAG)
- $(MAYBE_PIC_Compile.CXX) $< -o $@
-
-$(ObjDir)/%.lo $(ObjDir)/%.o: %.c $(ObjDir)/.dir $(BUILT_SOURCES)
- $(Echo) "Compiling $*.c for $(BuildMode) build" $(PIC_FLAG)
- $(MAYBE_PIC_Compile.C) $< -o $@
-
-$(ObjDir)/%.ll: %.cpp $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMGXX)
- $(Echo) "Compiling $*.cpp for $(BuildMode) build (bytecode)"
- $(BCCompile.CXX) $< -o $@ -S -emit-llvm
- $(call UPGRADE_MSG,$@)
- $(call UPGRADE_LL,$@)
-
-$(ObjDir)/%.ll: %.cc $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMGXX)
- $(Echo) "Compiling $*.cc for $(BuildMode) build (bytecode)"
- $(BCCompile.CXX) $< -o $@ -S -emit-llvm
- $(call UPGRADE_MSG,$@)
- $(call UPGRADE_LL,$@)
-
-$(ObjDir)/%.ll: %.c $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMGCC)
- $(Echo) "Compiling $*.c for $(BuildMode) build (bytecode)"
- $(BCCompile.C) $< -o $@ -S -emit-llvm
- $(call UPGRADE_MSG,@)
- $(call UPGRADE_LL,@)
-
-endif
-
-
-## Rules for building preprocessed (.i/.ii) outputs.
-$(BuildMode)/%.ii: %.cpp $(ObjDir)/.dir $(BUILT_SOURCES)
- $(Echo) "Compiling $*.cpp for $(BuildMode) build to .ii file"
- $(Verb) $(Preprocess.CXX) $< -o $@
-
-$(BuildMode)/%.ii: %.cc $(ObjDir)/.dir $(BUILT_SOURCES)
- $(Echo) "Compiling $*.cc for $(BuildMode) build to .ii file"
- $(Verb) $(Preprocess.CXX) $< -o $@
-
-$(BuildMode)/%.i: %.c $(ObjDir)/.dir $(BUILT_SOURCES)
- $(Echo) "Compiling $*.c for $(BuildMode) build to .i file"
- $(Verb) $(Preprocess.C) $< -o $@
-
-
-$(ObjDir)/%.s: %.cpp $(ObjDir)/.dir $(BUILT_SOURCES)
- $(Echo) "Compiling $*.cpp to asm for $(BuildMode) build" $(PIC_FLAG)
- $(MAYBE_PIC_Compile.CXX) $< -o $@ -S
-
-$(ObjDir)/%.s: %.cc $(ObjDir)/.dir $(BUILT_SOURCES)
- $(Echo) "Compiling $*.cc to asm for $(BuildMode) build" $(PIC_FLAG)
- $(MAYBE_PIC_Compile.CXX) $< -o $@ -S
-
-$(ObjDir)/%.s: %.c $(ObjDir)/.dir $(BUILT_SOURCES)
- $(Echo) "Compiling $*.c to asm for $(BuildMode) build" $(PIC_FLAG)
- $(MAYBE_PIC_Compile.C) $< -o $@ -S
-
-
-# make the C and C++ compilers strip debug info out of bytecode libraries.
-ifdef DEBUG_RUNTIME
-$(ObjectsBC): $(ObjDir)/%.bc: $(ObjDir)/%.ll $(LLVMAS) $(LOPT)
- $(Echo) "Compiling $*.ll to $*.bc for $(BuildMode) build (bytecode)"
- $(Verb) $(LLVMAS) $< -o - | $(LOPT) -std-compile-opts -o $@ -f
-else
-$(ObjectsBC): $(ObjDir)/%.bc: $(ObjDir)/%.ll $(LLVMAS) $(LOPT)
- $(Echo) "Compiling $*.ll to $*.bc for $(BuildMode) build (bytecode)"
- $(Verb) $(LLVMAS) $< -o - | \
- $(LOPT) -std-compile-opts -strip-debug -o $@ -f
-endif
-
-
-#---------------------------------------------------------
-# Provide rule to build .bc files from .ll sources,
-# regardless of dependencies
-#---------------------------------------------------------
-$(ObjDir)/%.bc: %.ll $(ObjDir)/.dir $(LLVMAS)
- $(Echo) "Compiling $*.ll for $(BuildMode) build"
- $(Verb) $(LLVMAS) $< -f -o $@
-
-###############################################################################
-# TABLEGEN: Provide rules for running tblgen to produce *.inc files
-###############################################################################
-
-ifdef TARGET
-
-TDFiles := $(strip $(wildcard $(PROJ_SRC_DIR)/*.td) \
- $(LLVM_SRC_ROOT)/lib/Target/Target.td \
- $(LLVM_SRC_ROOT)/lib/Target/TargetCallingConv.td \
- $(LLVM_SRC_ROOT)/lib/Target/TargetSelectionDAG.td \
- $(LLVM_SRC_ROOT)/include/llvm/CodeGen/ValueTypes.td) \
- $(wildcard $(LLVM_SRC_ROOT)/include/llvm/Intrinsics*.td)
-INCFiles := $(filter %.inc,$(BUILT_SOURCES))
-INCTMPFiles := $(INCFiles:%=$(ObjDir)/%.tmp)
-.PRECIOUS: $(INCTMPFiles) $(INCFiles)
-
-# All of these files depend on tblgen and the .td files.
-$(INCTMPFiles) : $(TBLGEN) $(TDFiles)
-
-# INCFiles rule: All of the tblgen generated files are emitted to
-# $(ObjDir)/%.inc.tmp, instead of emitting them directly to %.inc. This allows
-# us to only "touch" the real file if the contents of it change. IOW, if
-# tblgen is modified, all of the .inc.tmp files are regereated, but no
-# dependencies of the .inc files are, unless the contents of the .inc file
-# changes.
-$(INCFiles) : %.inc : $(ObjDir)/%.inc.tmp
- $(Verb) $(CMP) -s $@ $< || $(CP) $< $@
-
-$(TARGET:%=$(ObjDir)/%GenRegisterNames.inc.tmp): \
-$(ObjDir)/%GenRegisterNames.inc.tmp : %.td $(ObjDir)/.dir
- $(Echo) "Building $(<F) register names with tblgen"
- $(Verb) $(TableGen) -gen-register-enums -o $(call SYSPATH, $@) $<
-
-$(TARGET:%=$(ObjDir)/%GenRegisterInfo.h.inc.tmp): \
-$(ObjDir)/%GenRegisterInfo.h.inc.tmp : %.td $(ObjDir)/.dir
- $(Echo) "Building $(<F) register information header with tblgen"
- $(Verb) $(TableGen) -gen-register-desc-header -o $(call SYSPATH, $@) $<
-
-$(TARGET:%=$(ObjDir)/%GenRegisterInfo.inc.tmp): \
-$(ObjDir)/%GenRegisterInfo.inc.tmp : %.td $(ObjDir)/.dir
- $(Echo) "Building $(<F) register info implementation with tblgen"
- $(Verb) $(TableGen) -gen-register-desc -o $(call SYSPATH, $@) $<
-
-$(TARGET:%=$(ObjDir)/%GenInstrNames.inc.tmp): \
-$(ObjDir)/%GenInstrNames.inc.tmp : %.td $(ObjDir)/.dir
- $(Echo) "Building $(<F) instruction names with tblgen"
- $(Verb) $(TableGen) -gen-instr-enums -o $(call SYSPATH, $@) $<
-
-$(TARGET:%=$(ObjDir)/%GenInstrInfo.inc.tmp): \
-$(ObjDir)/%GenInstrInfo.inc.tmp : %.td $(ObjDir)/.dir
- $(Echo) "Building $(<F) instruction information with tblgen"
- $(Verb) $(TableGen) -gen-instr-desc -o $(call SYSPATH, $@) $<
-
-$(TARGET:%=$(ObjDir)/%GenAsmWriter.inc.tmp): \
-$(ObjDir)/%GenAsmWriter.inc.tmp : %.td $(ObjDir)/.dir
- $(Echo) "Building $(<F) assembly writer with tblgen"
- $(Verb) $(TableGen) -gen-asm-writer -o $(call SYSPATH, $@) $<
-
-$(TARGET:%=$(ObjDir)/%GenAsmWriter1.inc.tmp): \
-$(ObjDir)/%GenAsmWriter1.inc.tmp : %.td $(ObjDir)/.dir
- $(Echo) "Building $(<F) assembly writer #1 with tblgen"
- $(Verb) $(TableGen) -gen-asm-writer -asmwriternum=1 -o $(call SYSPATH, $@) $<
-
-$(TARGET:%=$(ObjDir)/%GenCodeEmitter.inc.tmp): \
-$(ObjDir)/%GenCodeEmitter.inc.tmp: %.td $(ObjDir)/.dir
- $(Echo) "Building $(<F) code emitter with tblgen"
- $(Verb) $(TableGen) -gen-emitter -o $(call SYSPATH, $@) $<
-
-$(TARGET:%=$(ObjDir)/%GenDAGISel.inc.tmp): \
-$(ObjDir)/%GenDAGISel.inc.tmp : %.td $(ObjDir)/.dir
- $(Echo) "Building $(<F) instruction selector implementation with tblgen"
- $(Verb) $(TableGen) -gen-dag-isel -o $(call SYSPATH, $@) $<
-
-$(TARGET:%=$(ObjDir)/%GenSubtarget.inc.tmp): \
-$(ObjDir)/%GenSubtarget.inc.tmp : %.td $(ObjDir)/.dir
- $(Echo) "Building $(<F) subtarget information with tblgen"
- $(Verb) $(TableGen) -gen-subtarget -o $(call SYSPATH, $@) $<
-
-$(TARGET:%=$(ObjDir)/%GenCallingConv.inc.tmp): \
-$(ObjDir)/%GenCallingConv.inc.tmp : %.td $(ObjDir)/.dir
- $(Echo) "Building $(<F) calling convention information with tblgen"
- $(Verb) $(TableGen) -gen-callingconv -o $(call SYSPATH, $@) $<
-
-clean-local::
- -$(Verb) $(RM) -f $(INCFiles)
-
-endif
-
-###############################################################################
-# LEX AND YACC: Provide rules for generating sources with lex and yacc
-###############################################################################
-
-#---------------------------------------------------------
-# Provide rules for generating a .cpp source file from
-# (f)lex input sources.
-#---------------------------------------------------------
-
-LexFiles := $(filter %.l,$(Sources))
-
-ifneq ($(LexFiles),)
-
-# Cancel built-in rules for lex
-%.c: %.l
-%.cpp: %.l
-
-all:: $(LexFiles:%.l=$(PROJ_SRC_DIR)/%.cpp.cvs)
-
-# Note the extra sed filtering here, used to cut down on the warnings emited
-# by GCC. The last line is a gross hack to work around flex aparently not
-# being able to resize the buffer on a large token input. Currently, for
-# uninitialized string buffers in LLVM we can generate very long tokens, so
-# this is a hack around it.
-# FIXME. (f.e. char Buffer[10000] )
-$(PROJ_SRC_DIR)/%.cpp: $(PROJ_SRC_DIR)/%.l
- $(Echo) Flexing $*.l
- $(Verb) $(FLEX) -t $(PROJ_SRC_DIR)/$*.l | \
- $(SED) 's/void yyunput/inline void yyunput/' | \
- $(SED) 's/void \*yy_flex_realloc/inline void *yy_flex_realloc/' | \
- $(SED) 's/#define YY_BUF_SIZE 16384/#define YY_BUF_SIZE (16384*64)/' \
- > $(PROJ_SRC_DIR)/$*.cpp
-
-# IFF the .l file has changed since it was last checked into SVN, copy the .l
-# file to .l.cvs and the generated .cpp file to .cpp.cvs. We use this mechanism
-# so that people without flex can build LLVM by copying the .cvs files to the
-# source location and building them.
-$(LexFiles:%.l=$(PROJ_SRC_DIR)/%.cpp.cvs): \
-$(PROJ_SRC_DIR)/%.cpp.cvs: $(PROJ_SRC_DIR)/%.cpp
- $(Verb) $(CMP) -s $(PROJ_SRC_DIR)/$*.l $(PROJ_SRC_DIR)/$*.l.cvs || \
- ($(CP) $< $@; $(CP) $(PROJ_SRC_DIR)/$*.l $(PROJ_SRC_DIR)/$*.l.cvs)
-
-$(LexFiles:%.l=$(ObjDir)/%.o) : \
-$(ObjDir)/%.o : $(PROJ_SRC_DIR)/%.cpp
-
-clean-local::
- -$(Verb) $(RM) -f $(LexOutput)
-
-endif
-
-#---------------------------------------------------------
-# Provide rules for generating a .cpp and .h source files
-# from yacc (bison) input sources.
-#---------------------------------------------------------
-
-YaccFiles := $(filter %.y,$(Sources))
-ifneq ($(YaccFiles),)
-
-.PRECIOUS: $(YaccOutput)
-
-all:: $(YaccFiles:%.y=$(PROJ_SRC_DIR)/%.cpp.cvs)
-
-# Cancel built-in rules for yacc
-%.c: %.y
-%.cpp: %.y
-%.h: %.y
-
-# Rule for building the bison based parsers...
-ifneq ($(BISON),)
-$(PROJ_SRC_DIR)/%.cpp $(PROJ_SRC_DIR)/%.h : $(PROJ_SRC_DIR)/%.y
- $(Echo) "Bisoning $*.y"
- $(Verb) $(BISON) -v -d -p $(<F:%Parser.y=%) -o $*.tab.c $<
- $(Verb) $(MV) -f $*.tab.c $(PROJ_SRC_DIR)/$*.cpp
- $(Verb) $(MV) -f $*.tab.h $(PROJ_SRC_DIR)/$*.h
-
-# IFF the .y file has changed since it was last checked into SVN, copy the .y
-# file to .y.cvs and the generated .cpp/.h file to .cpp.cvs/.h.cvs. We use this
-# mechanism so that people without flex can build LLVM by copying the .cvs files
-# to the source location and building them.
-$(YaccFiles:%.y=$(PROJ_SRC_DIR)/%.cpp.cvs): \
-$(PROJ_SRC_DIR)/%.cpp.cvs: $(PROJ_SRC_DIR)/%.cpp
- $(Verb) $(CMP) -s $(PROJ_SRC_DIR)/$*.y $(PROJ_SRC_DIR)/$*.y.cvs || \
- ($(CP) $< $@; \
- $(CP) $(PROJ_SRC_DIR)/$*.y $(PROJ_SRC_DIR)/$*.y.cvs; \
- $(CP) $(PROJ_SRC_DIR)/$*.h $(PROJ_SRC_DIR)/$*.h.cvs)
-
-else
-$(PROJ_SRC_DIR)/%.cpp : $(PROJ_SRC_DIR)/%.cpp.cvs
- $(Echo) "Bison of $*.y SKIPPED, bison not found -- copying .cpp.cvs"
- $(Verb)$(CP) $(PROJ_SRC_DIR)/$*.cpp.cvs $(PROJ_SRC_DIR)/$*.cpp
-
-$(PROJ_SRC_DIR)/%.h : $(PROJ_SRC_DIR)/%.h.cvs
- $(Echo) "Bison of $*.y SKIPPED, bison not found -- copying .h.cvs"
- $(Verb)$(CP) $(PROJ_SRC_DIR)/$*.h.cvs $(PROJ_SRC_DIR)/$*.h
-endif
-
-
-$(YaccFiles:%.y=$(ObjDir)/%.o): $(ObjDir)/%.o : $(PROJ_SRC_DIR)/%.cpp
-
-YaccOutput := $(YaccFiles:%.y=%.output)
-
-clean-local::
- -$(Verb) $(RM) -f $(YaccOutput)
-endif
-
-###############################################################################
-# OTHER RULES: Other rules needed
-###############################################################################
-
-# To create postscript files from dot files...
-ifneq ($(DOT),false)
-%.ps: %.dot
- $(DOT) -Tps < $< > $@
-else
-%.ps: %.dot
- $(Echo) "Cannot build $@: The program dot is not installed"
-endif
-
-# This rules ensures that header files that are removed still have a rule for
-# which they can be "generated." This allows make to ignore them and
-# reproduce the dependency lists.
-%.h:: ;
-%.hpp:: ;
-
-# Define clean-local to clean the current directory. Note that this uses a
-# very conservative approach ensuring that empty variables do not cause
-# errors or disastrous removal.
-clean-local::
-ifneq ($(strip $(ObjDir)),)
- -$(Verb) $(RM) -rf $(ObjDir)
-endif
- -$(Verb) $(RM) -f core core.[0-9][0-9]* *.o *.d *~ *.flc
-ifneq ($(strip $(SHLIBEXT)),) # Extra paranoia - make real sure SHLIBEXT is set
- -$(Verb) $(RM) -f *$(SHLIBEXT)
-endif
-
-clean-all-local::
- -$(Verb) $(RM) -rf Debug Release Profile
-
-
-###############################################################################
-# DEPENDENCIES: Include the dependency files if we should
-###############################################################################
-ifndef DISABLE_AUTO_DEPENDENCIES
-
-# If its not one of the cleaning targets
-ifneq ($(strip $(filter-out clean clean-local dist-clean,$(MAKECMDGOALS))),)
-
-# Get the list of dependency files
-DependFiles := $(basename $(filter %.cpp %.c %.cc, $(Sources)))
-DependFiles := $(DependFiles:%=$(PROJ_OBJ_DIR)/$(BuildMode)/%.d)
-
--include $(DependFiles) ""
-
-endif
-
-endif
-
-###############################################################################
-# CHECK: Running the test suite
-###############################################################################
-
-check::
- $(Verb) if test -d "$(PROJ_OBJ_ROOT)/test" ; then \
- if test -f "$(PROJ_OBJ_ROOT)/test/Makefile" ; then \
- $(EchoCmd) Running test suite ; \
- $(MAKE) -C $(PROJ_OBJ_ROOT)/test check-local \
- TESTSUITE=$(TESTSUITE) ; \
- else \
- $(EchoCmd) No Makefile in test directory ; \
- fi ; \
- else \
- $(EchoCmd) No test directory ; \
- fi
-
-###############################################################################
-# DISTRIBUTION: Handle construction of a distribution tarball
-###############################################################################
-
-#------------------------------------------------------------------------
-# Define distribution related variables
-#------------------------------------------------------------------------
-DistName := $(PROJECT_NAME)-$(PROJ_VERSION)
-DistDir := $(PROJ_OBJ_ROOT)/$(DistName)
-TopDistDir := $(PROJ_OBJ_ROOT)/$(DistName)
-DistTarGZip := $(PROJ_OBJ_ROOT)/$(DistName).tar.gz
-DistZip := $(PROJ_OBJ_ROOT)/$(DistName).zip
-DistTarBZ2 := $(PROJ_OBJ_ROOT)/$(DistName).tar.bz2
-DistAlways := CREDITS.TXT LICENSE.TXT README.txt README AUTHORS COPYING \
- ChangeLog INSTALL NEWS Makefile Makefile.common Makefile.rules \
- Makefile.config.in configure autoconf
-DistOther := $(notdir $(wildcard \
- $(PROJ_SRC_DIR)/*.h \
- $(PROJ_SRC_DIR)/*.td \
- $(PROJ_SRC_DIR)/*.def \
- $(PROJ_SRC_DIR)/*.ll \
- $(PROJ_SRC_DIR)/*.in))
-DistSubDirs := $(SubDirs)
-DistSources = $(Sources) $(EXTRA_DIST)
-DistFiles = $(DistAlways) $(DistSources) $(DistOther)
-
-#------------------------------------------------------------------------
-# We MUST build distribution with OBJ_DIR != SRC_DIR
-#------------------------------------------------------------------------
-ifeq ($(PROJ_SRC_DIR),$(PROJ_OBJ_DIR))
-dist dist-check dist-clean dist-gzip dist-bzip2 dist-zip ::
- $(Echo) ERROR: Target $@ only available with OBJ_DIR != SRC_DIR
-
-else
-
-#------------------------------------------------------------------------
-# Prevent attempt to run dist targets from anywhere but the top level
-#------------------------------------------------------------------------
-ifneq ($(LEVEL),.)
-dist dist-check dist-clean dist-gzip dist-bzip2 dist-zip ::
- $(Echo) ERROR: You must run $@ from $(PROJ_OBJ_ROOT)
-else
-
-#------------------------------------------------------------------------
-# Provide the top level targets
-#------------------------------------------------------------------------
-
-dist-gzip:: $(DistTarGZip)
-
-$(DistTarGZip) : $(TopDistDir)/.makedistdir
- $(Echo) Packing gzipped distribution tar file.
- $(Verb) cd $(PROJ_OBJ_ROOT) ; $(TAR) chf - "$(DistName)" | \
- $(GZIP) -c > "$(DistTarGZip)"
-
-dist-bzip2:: $(DistTarBZ2)
-
-$(DistTarBZ2) : $(TopDistDir)/.makedistdir
- $(Echo) Packing bzipped distribution tar file.
- $(Verb) cd $(PROJ_OBJ_ROOT) ; $(TAR) chf - $(DistName) | \
- $(BZIP2) -c >$(DistTarBZ2)
-
-dist-zip:: $(DistZip)
-
-$(DistZip) : $(TopDistDir)/.makedistdir
- $(Echo) Packing zipped distribution file.
- $(Verb) rm -f $(DistZip)
- $(Verb) cd $(PROJ_OBJ_ROOT) ; $(ZIP) -rq $(DistZip) $(DistName)
-
-dist :: $(DistTarGZip) $(DistTarBZ2) $(DistZip)
- $(Echo) ===== DISTRIBUTION PACKAGING SUCESSFUL =====
-
-DistCheckDir := $(PROJ_OBJ_ROOT)/_distcheckdir
-
-dist-check:: $(DistTarGZip)
- $(Echo) Checking distribution tar file.
- $(Verb) if test -d $(DistCheckDir) ; then \
- $(RM) -rf $(DistCheckDir) ; \
- fi
- $(Verb) $(MKDIR) $(DistCheckDir)
- $(Verb) cd $(DistCheckDir) && \
- $(MKDIR) $(DistCheckDir)/build && \
- $(MKDIR) $(DistCheckDir)/install && \
- gunzip -c $(DistTarGZip) | $(TAR) xf - && \
- cd build && \
- ../$(DistName)/configure --prefix="$(DistCheckDir)/install" \
- --srcdir=../$(DistName) $(DIST_CHECK_CONFIG_OPTIONS) && \
- $(MAKE) all && \
- $(MAKE) check && \
- $(MAKE) install && \
- $(MAKE) uninstall && \
- $(MAKE) dist-clean && \
- $(EchoCmd) ===== $(DistTarGZip) Ready For Distribution =====
-
-dist-clean::
- $(Echo) Cleaning distribution files
- -$(Verb) $(RM) -rf $(DistTarGZip) $(DistTarBZ2) $(DistZip) $(DistName) \
- $(DistCheckDir)
-
-endif
-
-#------------------------------------------------------------------------
-# Provide the recursive distdir target for building the distribution directory
-#------------------------------------------------------------------------
-distdir: $(DistDir)/.makedistdir
-$(DistDir)/.makedistdir: $(DistSources)
- $(Verb) if test "$(DistDir)" = "$(TopDistDir)" ; then \
- if test -d "$(DistDir)" ; then \
- find $(DistDir) -type d ! -perm -200 -exec chmod u+w {} ';' || \
- exit 1 ; \
- fi ; \
- $(EchoCmd) Removing old $(DistDir) ; \
- $(RM) -rf $(DistDir); \
- $(EchoCmd) Making 'all' to verify build ; \
- $(MAKE) ENABLE_OPTIMIZED=1 all ; \
- fi
- $(Echo) Building Distribution Directory $(DistDir)
- $(Verb) $(MKDIR) $(DistDir)
- $(Verb) srcdirstrip=`echo "$(PROJ_SRC_DIR)" | sed 's|.|.|g'`; \
- srcrootstrip=`echo "$(PROJ_SRC_ROOT)" | sed 's|.|.|g'`; \
- for file in $(DistFiles) ; do \
- case "$$file" in \
- $(PROJ_SRC_DIR)/*) \
- file=`echo "$$file" | sed "s#^$$srcdirstrip/##"` \
- ;; \
- $(PROJ_SRC_ROOT)/*) \
- file=`echo "$$file" | \
- sed "s#^$$srcrootstrip/##"` \
- ;; \
- esac; \
- if test -f "$(PROJ_SRC_DIR)/$$file" || \
- test -d "$(PROJ_SRC_DIR)/$$file" ; then \
- from_dir="$(PROJ_SRC_DIR)" ; \
- elif test -f "$$file" || test -d "$$file" ; then \
- from_dir=. ; \
- fi ; \
- to_dir=`echo "$$file" | sed -e 's#/[^/]*$$##'` ; \
- if test "$$to_dir" != "$$file" && test "$$to_dir" != "."; then \
- to_dir="$(DistDir)/$$dir"; \
- $(MKDIR) "$$to_dir" ; \
- else \
- to_dir="$(DistDir)"; \
- fi; \
- mid_dir=`echo "$$file" | sed -n -e 's#^\(.*\)/[^/]*$$#\1#p'`; \
- if test -n "$$mid_dir" ; then \
- $(MKDIR) "$$to_dir/$$mid_dir" || exit 1; \
- fi ; \
- if test -d "$$from_dir/$$file"; then \
- if test -d "$(PROJ_SRC_DIR)/$$file" && \
- test "$$from_dir" != "$(PROJ_SRC_DIR)" ; then \
- cd $(PROJ_SRC_DIR) ; \
- $(TAR) cf - $$file --exclude .svn --exclude CVS | \
- ( cd $$to_dir ; $(TAR) xf - ) ; \
- cd $(PROJ_OBJ_DIR) ; \
- else \
- cd $$from_dir ; \
- $(TAR) cf - $$file --exclude .svn --exclude CVS | \
- ( cd $$to_dir ; $(TAR) xf - ) ; \
- cd $(PROJ_OBJ_DIR) ; \
- fi; \
- elif test -f "$$from_dir/$$file" ; then \
- $(CP) -p "$$from_dir/$$file" "$(DistDir)/$$file" || exit 1; \
- elif test -L "$$from_dir/$$file" ; then \
- $(CP) -pd "$$from_dir/$$file" $(DistDir)/$$file || exit 1; \
- elif echo "$(DistAlways)" | grep -v "$$file" >/dev/null ; then \
- $(EchoCmd) "===== WARNING: Distribution Source " \
- "$$from_dir/$$file Not Found!" ; \
- elif test "$(Verb)" != '@' ; then \
- $(EchoCmd) "Skipping non-existent $$from_dir/$$file" ; \
- fi; \
- done
- $(Verb) for subdir in $(DistSubDirs) ; do \
- if test "$$subdir" \!= "." ; then \
- new_distdir="$(DistDir)/$$subdir" ; \
- test -d "$$new_distdir" || $(MKDIR) "$$new_distdir" || exit 1; \
- ( cd $$subdir && $(MAKE) ENABLE_OPTIMIZED=1 \
- DistDir="$$new_distdir" distdir ) || exit 1; \
- fi; \
- done
- $(Verb) if test "$(DistDir)" = "$(TopDistDir)" ; then \
- $(EchoCmd) Eliminating CVS/.svn directories from distribution ; \
- $(RM) -rf `find $(TopDistDir) -type d \( -name CVS -o \
- -name .svn \) -print` ;\
- $(MAKE) dist-hook ; \
- $(FIND) $(TopDistDir) -type d ! -perm -777 -exec chmod a+rwx {} \; \
- -o ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; \
- -o ! -type d ! -perm -400 -exec chmod a+r {} \; \
- -o ! -type d ! -perm -444 -exec \
- $(SHELL) $(INSTALL_SH) -c -m a+r {} {} \; \
- || chmod -R a+r $(DistDir) ; \
- fi
-
-# This is invoked by distdir target, define it as a no-op to avoid errors if not
-# defined by user.
-dist-hook::
-
-endif
-
-###############################################################################
-# TOP LEVEL - targets only to apply at the top level directory
-###############################################################################
-
-ifeq ($(LEVEL),.)
-
-#------------------------------------------------------------------------
-# Install support for the project's include files:
-#------------------------------------------------------------------------
-ifdef NO_INSTALL
-install-local::
- $(Echo) Install circumvented with NO_INSTALL
-uninstall-local::
- $(Echo) Uninstall circumvented with NO_INSTALL
-else
-install-local::
- $(Echo) Installing include files
- $(Verb) $(MKDIR) $(PROJ_includedir)
- $(Verb) if test -d "$(PROJ_SRC_ROOT)/include" ; then \
- cd $(PROJ_SRC_ROOT)/include && \
- for hdr in `find . -type f '!' '(' -name '*~' -o -name '.cvsignore' \
- -o -name '.#*' -o -name '*.in' ')' -print | grep -v CVS | \
- grep -v .svn` ; do \
- instdir=`dirname "$(PROJ_includedir)/$$hdr"` ; \
- if test \! -d "$$instdir" ; then \
- $(EchoCmd) Making install directory $$instdir ; \
- $(MKDIR) $$instdir ;\
- fi ; \
- $(DataInstall) $$hdr $(PROJ_includedir)/$$hdr ; \
- done ; \
- fi
-ifneq ($(PROJ_SRC_ROOT),$(PROJ_OBJ_ROOT))
- $(Verb) if test -d "$(PROJ_OBJ_ROOT)/include" ; then \
- cd $(PROJ_OBJ_ROOT)/include && \
- for hdr in `find . -type f -print | grep -v CVS` ; do \
- $(DataInstall) $$hdr $(PROJ_includedir)/$$hdr ; \
- done ; \
- fi
-endif
-
-uninstall-local::
- $(Echo) Uninstalling include files
- $(Verb) if [ -d "$(PROJ_SRC_ROOT)/include" ] ; then \
- cd $(PROJ_SRC_ROOT)/include && \
- $(RM) -f `find . -path '*/Internal' -prune -o '(' -type f \
- '!' '(' -name '*~' -o -name '.cvsignore' -o -name '.#*' \
- -o -name '*.in' ')' -print ')' | \
- grep -v CVS | sed 's#^#$(PROJ_includedir)/#'` ; \
- cd $(PROJ_SRC_ROOT)/include && \
- $(RM) -f `find . -path '*/Internal' -prune -o '(' -type f -name '*.in' \
- -print ')' | sed 's#\.in$$##;s#^#$(PROJ_includedir)/#'` ; \
- fi
-endif
-endif
-
-check-line-length:
- @egrep -n '.{81}' $(Sources)
-
-check-for-tabs:
- @egrep -n ' ' $(Sources)
-check-footprint:
- @ls -l $(LibDir) | awk '\
- BEGIN { sum = 0; } \
- { sum += $$5; } \
- END { printf("Libraries: %6.3f MBytes\n", sum/(1024.0*1024.0)); }'
- @ls -l $(ToolDir) | awk '\
- BEGIN { sum = 0; } \
- { sum += $$5; } \
- END { printf("Programs: %6.3f MBytes\n", sum/(1024.0*1024.0)); }'
-#------------------------------------------------------------------------
-# Print out the directories used for building
-#------------------------------------------------------------------------
-printvars::
- $(Echo) "BuildMode : " '$(BuildMode)'
- $(Echo) "PROJ_SRC_ROOT: " '$(PROJ_SRC_ROOT)'
- $(Echo) "PROJ_SRC_DIR : " '$(PROJ_SRC_DIR)'
- $(Echo) "PROJ_OBJ_ROOT: " '$(PROJ_OBJ_ROOT)'
- $(Echo) "PROJ_OBJ_DIR : " '$(PROJ_OBJ_DIR)'
- $(Echo) "LLVM_SRC_ROOT: " '$(LLVM_SRC_ROOT)'
- $(Echo) "LLVM_OBJ_ROOT: " '$(LLVM_OBJ_ROOT)'
- $(Echo) "PROJ_prefix : " '$(PROJ_prefix)'
- $(Echo) "PROJ_bindir : " '$(PROJ_bindir)'
- $(Echo) "PROJ_libdir : " '$(PROJ_libdir)'
- $(Echo) "PROJ_etcdir : " '$(PROJ_etcdir)'
- $(Echo) "PROJ_includedir : " '$(PROJ_includedir)'
- $(Echo) "UserTargets : " '$(UserTargets)'
- $(Echo) "ObjMakefiles : " '$(ObjMakefiles)'
- $(Echo) "SrcMakefiles : " '$(SrcMakefiles)'
- $(Echo) "ObjDir : " '$(ObjDir)'
- $(Echo) "LibDir : " '$(LibDir)'
- $(Echo) "ToolDir : " '$(ToolDir)'
- $(Echo) "ExmplDir : " '$(ExmplDir)'
- $(Echo) "Sources : " '$(Sources)'
- $(Echo) "TDFiles : " '$(TDFiles)'
- $(Echo) "INCFiles : " '$(INCFiles)'
- $(Echo) "INCTMPFiles : " '$(INCTMPFiles)'
- $(Echo) "PreConditions: " '$(PreConditions)'
- $(Echo) "Compile.CXX : " '$(Compile.CXX)'
- $(Echo) "Compile.C : " '$(Compile.C)'
- $(Echo) "Archive : " '$(Archive)'
- $(Echo) "YaccFiles : " '$(YaccFiles)'
- $(Echo) "LexFiles : " '$(LexFiles)'
- $(Echo) "Module : " '$(Module)'
- $(Echo) "FilesToConfig: " '$(FilesToConfigPATH)'
- $(Echo) "SubDirs : " '$(SubDirs)'
- $(Echo) "ProjLibsPaths: " '$(ProjLibsPaths)'
- $(Echo) "ProjLibsOptions: " '$(ProjLibsOptions)'
diff --git a/release_23/ModuleInfo.txt b/release_23/ModuleInfo.txt
deleted file mode 100644
index ec9da652cb8f..000000000000
--- a/release_23/ModuleInfo.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-DepModule:
-BuildCmd: ./build-for-llvm-top.sh
-CleanCmd: make clean
-InstallCmd: make install
diff --git a/release_23/README.txt b/release_23/README.txt
deleted file mode 100644
index 34d3766feb46..000000000000
--- a/release_23/README.txt
+++ /dev/null
@@ -1,13 +0,0 @@
-Low Level Virtual Machine (LLVM)
-================================
-
-This directory and its subdirectories contain source code for the Low Level
-Virtual Machine, a toolkit for the construction of highly optimized compilers,
-optimizers, and runtime environments.
-
-LLVM is open source software. You may freely distribute it under the terms of
-the license agreement found in LICENSE.txt.
-
-Please see the HTML documentation provided in docs/index.html for further
-assistance with LLVM.
-
diff --git a/release_23/Xcode/LLVM.xcodeproj/project.pbxproj b/release_23/Xcode/LLVM.xcodeproj/project.pbxproj
deleted file mode 100644
index 181508e54dc0..000000000000
--- a/release_23/Xcode/LLVM.xcodeproj/project.pbxproj
+++ /dev/null
@@ -1,3368 +0,0 @@
-// !$*UTF8*$!
-{
- archiveVersion = 1;
- classes = {
- };
- objectVersion = 42;
- objects = {
-
-/* Begin PBXAggregateTarget section */
- CF0329BC08D1BE8E0030FD33 /* LLVM full llc */ = {
- isa = PBXAggregateTarget;
- buildConfigurationList = CF0329C708D1BEC40030FD33 /* Build configuration list for PBXAggregateTarget "LLVM full llc" */;
- buildPhases = (
- );
- dependencies = (
- CF0329BE08D1BE970030FD33 /* PBXTargetDependency */,
- CF0329C008D1BE9B0030FD33 /* PBXTargetDependency */,
- );
- name = "LLVM full llc";
- productName = "LLVM full llc";
- };
- CFDF86D00ADE820000D40A3D /* LLVM full llc release */ = {
- isa = PBXAggregateTarget;
- buildConfigurationList = CFDF86D50ADE820000D40A3D /* Build configuration list for PBXAggregateTarget "LLVM full llc release" */;
- buildPhases = (
- );
- dependencies = (
- CFDF86DA0ADE822100D40A3D /* PBXTargetDependency */,
- CFDF86DC0ADE822100D40A3D /* PBXTargetDependency */,
- );
- name = "LLVM full llc release";
- productName = "LLVM full llc";
- };
-/* End PBXAggregateTarget section */
-
-/* Begin PBXContainerItemProxy section */
- CF0329BD08D1BE970030FD33 /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
- proxyType = 1;
- remoteGlobalIDString = CF0329B608D1BE110030FD33;
- remoteInfo = "LLVM lib";
- };
- CF0329BF08D1BE9B0030FD33 /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
- proxyType = 1;
- remoteGlobalIDString = CF0329BB08D1BE5D0030FD33;
- remoteInfo = "LLVM llc";
- };
- CFDF86D90ADE822100D40A3D /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
- proxyType = 1;
- remoteGlobalIDString = CFDF86BD0ADE819D00D40A3D;
- remoteInfo = "LLVM lib release";
- };
- CFDF86DB0ADE822100D40A3D /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
- proxyType = 1;
- remoteGlobalIDString = CFDF86C60ADE81D000D40A3D;
- remoteInfo = "LLVM llc release";
- };
-/* End PBXContainerItemProxy section */
-
-/* Begin PBXFileReference section */
- 354CF6D10CD299440059AF3E /* DeserializeAPInt.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DeserializeAPInt.cpp; sourceTree = "<group>"; };
- 354CF6D20CD2994D0059AF3E /* SerializeAPInt.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SerializeAPInt.cpp; sourceTree = "<group>"; };
- 35A9CDED0CD0F6AF008ABC1D /* Deserialize.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Deserialize.h; sourceTree = "<group>"; };
- 35A9CDEE0CD0F6AF008ABC1D /* Serialization.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Serialization.h; sourceTree = "<group>"; };
- 35A9CDEF0CD0F6AF008ABC1D /* Serialize.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Serialize.h; sourceTree = "<group>"; };
- 35A9CDF00CD0F6D5008ABC1D /* Deserialize.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Deserialize.cpp; sourceTree = "<group>"; };
- 35A9CDF10CD0F6E1008ABC1D /* Serialize.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Serialize.cpp; sourceTree = "<group>"; };
- 35E98A830CBC2ED300C5CDC1 /* DenseSet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DenseSet.h; sourceTree = "<group>"; };
- 35E98A840CBC2ED300C5CDC1 /* ImmutableMap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ImmutableMap.h; sourceTree = "<group>"; };
- 35E98A850CBC2ED300C5CDC1 /* ImmutableSet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ImmutableSet.h; sourceTree = "<group>"; };
- 754221420D171DFC00DDB61B /* MachineLICM.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MachineLICM.cpp; sourceTree = "<group>"; };
- 84115FFE0B66D87400E1293E /* TargetMachOWriterInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = TargetMachOWriterInfo.cpp; sourceTree = "<group>"; };
- 84115FFF0B66D89B00E1293E /* PPCMachOWriterInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = PPCMachOWriterInfo.cpp; sourceTree = "<group>"; };
- 841160000B66D8AC00E1293E /* PPCMachOWriterInfo.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = PPCMachOWriterInfo.h; sourceTree = "<group>"; };
- 8443EF210B66B62D00959964 /* TargetMachOWriterInfo.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = TargetMachOWriterInfo.h; sourceTree = "<group>"; };
- 9F4B0E5E0D0E02580061F270 /* bitreader_ocaml.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bitreader_ocaml.c; sourceTree = "<group>"; };
- 9F4B0E5F0D0E02580061F270 /* llvm_bitreader.ml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = llvm_bitreader.ml; sourceTree = "<group>"; };
- 9F4B0E600D0E02580061F270 /* llvm_bitreader.mli */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = llvm_bitreader.mli; sourceTree = "<group>"; };
- 9F4B0E8C0D0E05ED0061F270 /* BitReader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BitReader.cpp; sourceTree = "<group>"; };
- 9F4B0E8D0D0E05ED0061F270 /* DeserializeAPFloat.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DeserializeAPFloat.cpp; sourceTree = "<group>"; };
- 9F502ADB0D1D8CA3007939DF /* executionengine_ocaml.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = executionengine_ocaml.c; sourceTree = "<group>"; };
- 9F502ADC0D1D8CA3007939DF /* llvm_executionengine.ml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = llvm_executionengine.ml; sourceTree = "<group>"; };
- 9F502ADD0D1D8CA3007939DF /* llvm_executionengine.mli */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = llvm_executionengine.mli; sourceTree = "<group>"; };
- 9F502AEC0D1D8CF8007939DF /* executionengine.ml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = executionengine.ml; sourceTree = "<group>"; };
- 9F502B090D1D8D8D007939DF /* ExecutionEngineBindings.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ExecutionEngineBindings.cpp; sourceTree = "<group>"; };
- 9F5B90CB0D0CE87100CDFDEA /* StringPool.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StringPool.cpp; sourceTree = "<group>"; };
- 9F5B90CE0D0CE89300CDFDEA /* AlignOf.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AlignOf.h; sourceTree = "<group>"; };
- 9F5B90CF0D0CE89300CDFDEA /* Registry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Registry.h; sourceTree = "<group>"; };
- 9F5B90D00D0CE89300CDFDEA /* StringPool.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StringPool.h; sourceTree = "<group>"; };
- 9F5B90E70D0DF19100CDFDEA /* BitReader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BitReader.h; sourceTree = "<group>"; };
- 9F68EB010C77AD02004AA152 /* LoopPass.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = LoopPass.cpp; sourceTree = "<group>"; };
- 9F68EB020C77AD02004AA152 /* MemoryDependenceAnalysis.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = MemoryDependenceAnalysis.cpp; sourceTree = "<group>"; };
- 9F68EB060C77AD2C004AA152 /* BitcodeReader.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = BitcodeReader.cpp; sourceTree = "<group>"; };
- 9F68EB070C77AD2C004AA152 /* BitcodeReader.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = BitcodeReader.h; sourceTree = "<group>"; };
- 9F68EB120C77AD2C004AA152 /* BitcodeWriter.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = BitcodeWriter.cpp; sourceTree = "<group>"; };
- 9F68EB130C77AD2C004AA152 /* BitcodeWriterPass.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = BitcodeWriterPass.cpp; sourceTree = "<group>"; };
- 9F68EB250C77AD2C004AA152 /* ValueEnumerator.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = ValueEnumerator.cpp; sourceTree = "<group>"; };
- 9F68EB260C77AD2C004AA152 /* ValueEnumerator.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = ValueEnumerator.h; sourceTree = "<group>"; };
- 9F6B2CC00D0F6E56000F00FD /* bitreader.ml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = bitreader.ml; sourceTree = "<group>"; };
- 9F70401A0D8D732400FD06FF /* llvm_scalar_opts.ml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = llvm_scalar_opts.ml; path = transforms/scalar/llvm_scalar_opts.ml; sourceTree = "<group>"; };
- 9F70401B0D8D732400FD06FF /* llvm_scalar_opts.mli */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = llvm_scalar_opts.mli; path = transforms/scalar/llvm_scalar_opts.mli; sourceTree = "<group>"; };
- 9F70401E0D8D735E00FD06FF /* scalar_opts_ocaml.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = scalar_opts_ocaml.c; path = transforms/scalar/scalar_opts_ocaml.c; sourceTree = "<group>"; };
- 9F7793460C73BC2000551F9C /* CodeGenPrepare.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CodeGenPrepare.cpp; sourceTree = "<group>"; };
- 9F7793470C73BC2000551F9C /* GVN.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GVN.cpp; sourceTree = "<group>"; };
- 9F7793480C73BC2000551F9C /* GVNPRE.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GVNPRE.cpp; sourceTree = "<group>"; };
- 9F7793490C73BC2000551F9C /* LoopIndexSplit.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LoopIndexSplit.cpp; sourceTree = "<group>"; };
- 9F77934A0C73BC2000551F9C /* LoopRotation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LoopRotation.cpp; sourceTree = "<group>"; };
- 9F7793500C73BD1500551F9C /* ELFWriter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ELFWriter.h; sourceTree = "<group>"; };
- 9F7793510C73BD1500551F9C /* IfConversion.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IfConversion.cpp; sourceTree = "<group>"; };
- 9F7793520C73BD1500551F9C /* LowerSubregs.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LowerSubregs.cpp; sourceTree = "<group>"; };
- 9F7793530C73BD1500551F9C /* MachOWriter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MachOWriter.h; sourceTree = "<group>"; };
- 9F7793540C73BD1500551F9C /* PostRASchedulerList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PostRASchedulerList.cpp; sourceTree = "<group>"; };
- 9F7793550C73BD1500551F9C /* RegAllocBigBlock.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RegAllocBigBlock.cpp; sourceTree = "<group>"; };
- 9F7793560C73BD1500551F9C /* RegisterScavenging.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RegisterScavenging.cpp; sourceTree = "<group>"; };
- 9F7793570C73BD1500551F9C /* SimpleRegisterCoalescing.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SimpleRegisterCoalescing.cpp; sourceTree = "<group>"; };
- 9F7793770C73C48A00551F9C /* StripDeadPrototypes.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StripDeadPrototypes.cpp; sourceTree = "<group>"; };
- 9F7793780C73C49A00551F9C /* BasicInliner.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BasicInliner.cpp; sourceTree = "<group>"; };
- 9F7793790C73C49A00551F9C /* CloneLoop.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CloneLoop.cpp; sourceTree = "<group>"; };
- 9F77937A0C73C49A00551F9C /* InlineCost.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InlineCost.cpp; sourceTree = "<group>"; };
- 9F77937B0C73C4F400551F9C /* AutoUpgrade.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AutoUpgrade.cpp; path = ../lib/VMCore/AutoUpgrade.cpp; sourceTree = SOURCE_ROOT; };
- 9F77937C0C73C4F400551F9C /* ConstantFold.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ConstantFold.cpp; path = ../lib/VMCore/ConstantFold.cpp; sourceTree = SOURCE_ROOT; };
- 9F77937D0C73C4F400551F9C /* ConstantFold.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ConstantFold.h; path = ../lib/VMCore/ConstantFold.h; sourceTree = SOURCE_ROOT; };
- 9F77937E0C73C53000551F9C /* ParameterAttributes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ParameterAttributes.h; sourceTree = "<group>"; };
- 9F7793800C73C54C00551F9C /* Archive.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Archive.h; sourceTree = "<group>"; };
- 9F7793810C73C54C00551F9C /* BitCodes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BitCodes.h; sourceTree = "<group>"; };
- 9F7793820C73C54C00551F9C /* BitstreamReader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BitstreamReader.h; sourceTree = "<group>"; };
- 9F7793830C73C54C00551F9C /* BitstreamWriter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BitstreamWriter.h; sourceTree = "<group>"; };
- 9F7793840C73C54C00551F9C /* LLVMBitCodes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LLVMBitCodes.h; sourceTree = "<group>"; };
- 9F7793850C73C54C00551F9C /* ReaderWriter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ReaderWriter.h; sourceTree = "<group>"; };
- 9F7793860C73C57100551F9C /* CallingConvLower.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CallingConvLower.h; sourceTree = "<group>"; };
- 9F7793870C73C57100551F9C /* ELFRelocation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ELFRelocation.h; sourceTree = "<group>"; };
- 9F7793880C73C57100551F9C /* FileWriters.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FileWriters.h; sourceTree = "<group>"; };
- 9F7793890C73C57100551F9C /* MachORelocation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MachORelocation.h; sourceTree = "<group>"; };
- 9F77938A0C73C57100551F9C /* RegisterScavenging.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RegisterScavenging.h; sourceTree = "<group>"; };
- 9F7794140C73CB6100551F9C /* Mips.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Mips.h; sourceTree = "<group>"; };
- 9F7794150C73CB6100551F9C /* Mips.td */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Mips.td; sourceTree = "<group>"; };
- 9F7794160C73CB6100551F9C /* MipsAsmPrinter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MipsAsmPrinter.cpp; sourceTree = "<group>"; };
- 9F7794170C73CB6100551F9C /* MipsCallingConv.td */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = MipsCallingConv.td; sourceTree = "<group>"; };
- 9F7794180C73CB6100551F9C /* MipsInstrFormats.td */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = MipsInstrFormats.td; sourceTree = "<group>"; };
- 9F7794190C73CB6100551F9C /* MipsInstrInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MipsInstrInfo.cpp; sourceTree = "<group>"; };
- 9F77941A0C73CB6100551F9C /* MipsInstrInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MipsInstrInfo.h; sourceTree = "<group>"; };
- 9F77941B0C73CB6100551F9C /* MipsInstrInfo.td */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = MipsInstrInfo.td; sourceTree = "<group>"; };
- 9F77941C0C73CB6100551F9C /* MipsISelDAGToDAG.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MipsISelDAGToDAG.cpp; sourceTree = "<group>"; };
- 9F77941D0C73CB6100551F9C /* MipsISelLowering.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MipsISelLowering.cpp; sourceTree = "<group>"; };
- 9F77941E0C73CB6100551F9C /* MipsISelLowering.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MipsISelLowering.h; sourceTree = "<group>"; };
- 9F77941F0C73CB6100551F9C /* MipsMachineFunction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MipsMachineFunction.h; sourceTree = "<group>"; };
- 9F7794200C73CB6100551F9C /* MipsRegisterInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MipsRegisterInfo.cpp; sourceTree = "<group>"; };
- 9F7794210C73CB6100551F9C /* MipsRegisterInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MipsRegisterInfo.h; sourceTree = "<group>"; };
- 9F7794220C73CB6100551F9C /* MipsRegisterInfo.td */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = MipsRegisterInfo.td; sourceTree = "<group>"; };
- 9F7794230C73CB6100551F9C /* MipsSubtarget.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MipsSubtarget.cpp; sourceTree = "<group>"; };
- 9F7794240C73CB6100551F9C /* MipsSubtarget.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MipsSubtarget.h; sourceTree = "<group>"; };
- 9F7794250C73CB6100551F9C /* MipsTargetAsmInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MipsTargetAsmInfo.cpp; sourceTree = "<group>"; };
- 9F7794260C73CB6100551F9C /* MipsTargetAsmInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MipsTargetAsmInfo.h; sourceTree = "<group>"; };
- 9F7794270C73CB6100551F9C /* MipsTargetMachine.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MipsTargetMachine.cpp; sourceTree = "<group>"; };
- 9F7794280C73CB6100551F9C /* MipsTargetMachine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MipsTargetMachine.h; sourceTree = "<group>"; };
- 9F77942F0C73CB7900551F9C /* MSILWriter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MSILWriter.cpp; sourceTree = "<group>"; };
- 9F7794300C73CB7900551F9C /* MSILWriter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MSILWriter.h; sourceTree = "<group>"; };
- 9F7794880C73D51000551F9C /* MemoryBuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MemoryBuffer.h; sourceTree = "<group>"; };
- 9F7794890C73D51000551F9C /* Streams.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Streams.h; sourceTree = "<group>"; };
- 9F7C23E50CB81C2100498408 /* Analysis.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Analysis.h; sourceTree = "<group>"; };
- 9F7C23E60CB81C2B00498408 /* Analysis.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Analysis.cpp; sourceTree = "<group>"; };
- 9F7C240C0CB81ECD00498408 /* analysis_ocaml.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = analysis_ocaml.c; sourceTree = "<group>"; };
- 9F7C240D0CB81ECD00498408 /* llvm_analysis.ml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = llvm_analysis.ml; sourceTree = "<group>"; };
- 9F7C240E0CB81ECD00498408 /* llvm_analysis.mli */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = llvm_analysis.mli; sourceTree = "<group>"; };
- 9F7C2C4F0CB9496C00498408 /* analysis.ml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = analysis.ml; sourceTree = "<group>"; };
- 9F7C2C520CB9496C00498408 /* bitwriter.ml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = bitwriter.ml; sourceTree = "<group>"; };
- 9F7C2C5D0CB9496C00498408 /* vmcore.ml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = vmcore.ml; sourceTree = "<group>"; };
- 9FA638D90C77B184007F12AE /* AutoUpgrade.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = AutoUpgrade.h; sourceTree = "<group>"; };
- 9FA638DA0C77B184007F12AE /* GlobalAlias.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = GlobalAlias.h; sourceTree = "<group>"; };
- 9FA638DB0C77B1AB007F12AE /* APInt.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = APInt.h; sourceTree = "<group>"; };
- 9FA638DC0C77B1AB007F12AE /* APSInt.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = APSInt.h; sourceTree = "<group>"; };
- 9FA638DD0C77B1AB007F12AE /* BitVector.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = BitVector.h; sourceTree = "<group>"; };
- 9FA638E00C77B1AB007F12AE /* IndexedMap.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = IndexedMap.h; sourceTree = "<group>"; };
- 9FA638E20C77B1AB007F12AE /* SmallPtrSet.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SmallPtrSet.h; sourceTree = "<group>"; };
- 9FA638E30C77B1AB007F12AE /* SmallSet.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SmallSet.h; sourceTree = "<group>"; };
- 9FA638E40C77B1AB007F12AE /* StringMap.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = StringMap.h; sourceTree = "<group>"; };
- 9FA638E50C77B203007F12AE /* LoopPass.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = LoopPass.h; sourceTree = "<group>"; };
- 9FA638E60C77B203007F12AE /* MemoryDependenceAnalysis.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = MemoryDependenceAnalysis.h; sourceTree = "<group>"; };
- 9FA638E70C77B222007F12AE /* Disassembler.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Disassembler.h; sourceTree = "<group>"; };
- 9FA638E80C77B231007F12AE /* TargetELFWriterInfo.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = TargetELFWriterInfo.h; sourceTree = "<group>"; };
- 9FA638EA0C77B252007F12AE /* InlinerPass.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = InlinerPass.h; sourceTree = "<group>"; };
- 9FA638EB0C77B26B007F12AE /* BasicInliner.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = BasicInliner.h; sourceTree = "<group>"; };
- 9FA638EC0C77B26B007F12AE /* InlineCost.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = InlineCost.h; sourceTree = "<group>"; };
- 9FD3E5710CA0116100E54D15 /* bitwriter_ocaml.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = bitwriter_ocaml.c; sourceTree = "<group>"; };
- 9FD3E5720CA0116100E54D15 /* llvm_bitwriter.ml */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = llvm_bitwriter.ml; sourceTree = "<group>"; };
- 9FD3E5730CA0116100E54D15 /* llvm_bitwriter.mli */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = llvm_bitwriter.mli; sourceTree = "<group>"; };
- 9FD3E57B0CA0116100E54D15 /* llvm.ml */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = llvm.ml; sourceTree = "<group>"; };
- 9FD3E57C0CA0116100E54D15 /* llvm.mli */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = llvm.mli; sourceTree = "<group>"; };
- 9FD3E57D0CA0116100E54D15 /* llvm_ocaml.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = llvm_ocaml.c; sourceTree = "<group>"; };
- 9FD3E58D0CA0125F00E54D15 /* BitWriter.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = BitWriter.h; sourceTree = "<group>"; };
- 9FD3E58E0CA0125F00E54D15 /* Core.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Core.h; sourceTree = "<group>"; };
- 9FD3E5900CA0129D00E54D15 /* Core.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = Core.cpp; path = ../lib/VMCore/Core.cpp; sourceTree = SOURCE_ROOT; };
- 9FD3E5920CA012B300E54D15 /* BitWriter.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = BitWriter.cpp; sourceTree = "<group>"; };
- 9FE25D900CAB166D005383FC /* APFloat.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APFloat.h; sourceTree = "<group>"; };
- 9FE25D910CAB166D005383FC /* SparseBitVector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SparseBitVector.h; sourceTree = "<group>"; };
- 9FE25D920CAB169F005383FC /* RegisterCoalescer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RegisterCoalescer.h; sourceTree = "<group>"; };
- 9FE25D940CAB16FB005383FC /* RegisterCoalescer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RegisterCoalescer.cpp; sourceTree = "<group>"; };
- 9FE25D950CAB1724005383FC /* APFloat.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = APFloat.cpp; sourceTree = "<group>"; };
- 9FE25D960CAB1759005383FC /* TargetCallingConv.td */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = TargetCallingConv.td; sourceTree = "<group>"; };
- 9FE4508B0C77A77000C4FEA4 /* ARMCodeEmitter.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = ARMCodeEmitter.cpp; sourceTree = "<group>"; };
- 9FE4508C0C77A77000C4FEA4 /* ARMGenAsmWriter.inc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.pascal; path = ARMGenAsmWriter.inc; sourceTree = "<group>"; };
- 9FE4508D0C77A77000C4FEA4 /* ARMGenDAGISel.inc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.pascal; path = ARMGenDAGISel.inc; sourceTree = "<group>"; };
- 9FE4508E0C77A77100C4FEA4 /* ARMGenInstrInfo.inc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.pascal; path = ARMGenInstrInfo.inc; sourceTree = "<group>"; };
- 9FE4508F0C77A77100C4FEA4 /* ARMGenInstrNames.inc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.pascal; path = ARMGenInstrNames.inc; sourceTree = "<group>"; };
- 9FE450900C77A77100C4FEA4 /* ARMGenRegisterInfo.h.inc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.pascal; path = ARMGenRegisterInfo.h.inc; sourceTree = "<group>"; };
- 9FE450910C77A77100C4FEA4 /* ARMGenRegisterInfo.inc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.pascal; path = ARMGenRegisterInfo.inc; sourceTree = "<group>"; };
- 9FE450920C77A77100C4FEA4 /* ARMGenRegisterNames.inc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.pascal; path = ARMGenRegisterNames.inc; sourceTree = "<group>"; };
- 9FE450930C77A77100C4FEA4 /* ARMGenSubtarget.inc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.pascal; path = ARMGenSubtarget.inc; sourceTree = "<group>"; };
- 9FE450940C77A77100C4FEA4 /* ARMJITInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = ARMJITInfo.cpp; sourceTree = "<group>"; };
- 9FE450950C77A77100C4FEA4 /* ARMJITInfo.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = ARMJITInfo.h; sourceTree = "<group>"; };
- 9FE450960C77A77100C4FEA4 /* ARMRelocations.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = ARMRelocations.h; sourceTree = "<group>"; };
- 9FE450970C77A77100C4FEA4 /* README-Thumb.txt */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = "README-Thumb.txt"; sourceTree = "<group>"; };
- 9FE450980C77A77100C4FEA4 /* README.txt */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = README.txt; sourceTree = "<group>"; };
- 9FE4509A0C77A79C00C4FEA4 /* PPCCallingConv.td */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = PPCCallingConv.td; sourceTree = "<group>"; };
- 9FE4509B0C77A79C00C4FEA4 /* PPCGenCallingConv.inc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.pascal; path = PPCGenCallingConv.inc; sourceTree = "<group>"; };
- 9FE4509C0C77A7BC00C4FEA4 /* README-MMX.txt */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = "README-MMX.txt"; sourceTree = "<group>"; };
- 9FE4509D0C77A7BC00C4FEA4 /* X86CallingConv.td */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = X86CallingConv.td; sourceTree = "<group>"; };
- 9FE4509F0C77A7BC00C4FEA4 /* X86ELFWriterInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = X86ELFWriterInfo.cpp; sourceTree = "<group>"; };
- 9FE450A00C77A7BC00C4FEA4 /* X86ELFWriterInfo.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = X86ELFWriterInfo.h; sourceTree = "<group>"; };
- 9FE450A10C77A7BC00C4FEA4 /* X86GenCallingConv.inc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.pascal; path = X86GenCallingConv.inc; sourceTree = "<group>"; };
- 9FE450A20C77A7BC00C4FEA4 /* X86InstrFormats.td */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = X86InstrFormats.td; sourceTree = "<group>"; };
- 9FE450A50C77AAF000C4FEA4 /* Disassembler.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Disassembler.cpp; sourceTree = "<group>"; };
- 9FE450A60C77AB3200C4FEA4 /* APInt.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = APInt.cpp; sourceTree = "<group>"; };
- 9FE450A70C77AB3200C4FEA4 /* ConstantRange.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = ConstantRange.cpp; sourceTree = "<group>"; };
- 9FE450A80C77AB3200C4FEA4 /* MemoryBuffer.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = MemoryBuffer.cpp; sourceTree = "<group>"; };
- 9FE450A90C77AB3200C4FEA4 /* SmallPtrSet.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = SmallPtrSet.cpp; sourceTree = "<group>"; };
- 9FE450AA0C77AB3200C4FEA4 /* StringMap.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = StringMap.cpp; sourceTree = "<group>"; };
- 9FE450AB0C77AB6100C4FEA4 /* README.txt */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = README.txt; sourceTree = "<group>"; };
- 9FE450AC0C77AB6E00C4FEA4 /* CallingConvLower.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = CallingConvLower.cpp; sourceTree = "<group>"; };
- 9FE450DF0C77ABE400C4FEA4 /* Archive.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Archive.cpp; sourceTree = "<group>"; };
- 9FE450E00C77ABE400C4FEA4 /* ArchiveInternals.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = ArchiveInternals.h; sourceTree = "<group>"; };
- 9FE450E10C77ABE400C4FEA4 /* ArchiveReader.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = ArchiveReader.cpp; sourceTree = "<group>"; };
- 9FE450E20C77ABE400C4FEA4 /* ArchiveWriter.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = ArchiveWriter.cpp; sourceTree = "<group>"; };
- 9FEB8C550D1CD1E200EE46BC /* ExecutionEngine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ExecutionEngine.h; sourceTree = "<group>"; };
- 9FEDD5F10D8D73AB009F6DF1 /* Scalar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Scalar.h; sourceTree = "<group>"; };
- 9FEDD5F70D8D797D009F6DF1 /* Scalar.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Scalar.cpp; sourceTree = "<group>"; };
- 9FEDD6140D8D7C3B009F6DF1 /* scalar_opts.ml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = scalar_opts.ml; sourceTree = "<group>"; };
- 9FEDD6B60D8D83D0009F6DF1 /* Target.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Target.cpp; sourceTree = "<group>"; };
- 9FEDD6B80D8D83EC009F6DF1 /* Target.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Target.h; sourceTree = "<group>"; };
- 9FEDD6BB0D8D8408009F6DF1 /* lto.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lto.h; sourceTree = "<group>"; };
- 9FEDD6BD0D8D8426009F6DF1 /* target.ml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = target.ml; sourceTree = "<group>"; };
- 9FEDD6C10D8D844E009F6DF1 /* llvm_target.ml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = llvm_target.ml; sourceTree = "<group>"; };
- 9FEDD6C20D8D844E009F6DF1 /* llvm_target.mli */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = llvm_target.mli; sourceTree = "<group>"; };
- 9FEDD6C40D8D844E009F6DF1 /* target_ocaml.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = target_ocaml.c; sourceTree = "<group>"; };
- CF1ACC9709C9DE4400D3C5EB /* IntrinsicInst.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = IntrinsicInst.cpp; path = ../lib/VMCore/IntrinsicInst.cpp; sourceTree = "<group>"; };
- CF26835B09178F5500C5F253 /* TargetInstrItineraries.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TargetInstrItineraries.h; sourceTree = "<group>"; };
- CF32AF5C0AEE6A4E00D24CD4 /* LLVMTargetMachine.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LLVMTargetMachine.cpp; sourceTree = "<group>"; };
- CF33BE160AF62B4200E93805 /* SmallString.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SmallString.h; sourceTree = "<group>"; };
- CF341DAD0AB07A8B0099B064 /* AlphaTargetAsmInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AlphaTargetAsmInfo.h; sourceTree = "<group>"; };
- CF341DAE0AB07A8B0099B064 /* AlphaTargetAsmInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AlphaTargetAsmInfo.cpp; sourceTree = "<group>"; };
- CF341DE80AB07F890099B064 /* IA64TargetAsmInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IA64TargetAsmInfo.h; sourceTree = "<group>"; };
- CF341DE90AB07F890099B064 /* IA64TargetAsmInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IA64TargetAsmInfo.cpp; sourceTree = "<group>"; };
- CF341E010AB080220099B064 /* PPCTargetAsmInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PPCTargetAsmInfo.h; sourceTree = "<group>"; };
- CF341E020AB080220099B064 /* PPCTargetAsmInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PPCTargetAsmInfo.cpp; sourceTree = "<group>"; };
- CF341E220AB0814B0099B064 /* SparcTargetAsmInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SparcTargetAsmInfo.h; sourceTree = "<group>"; };
- CF341E230AB0814B0099B064 /* SparcTargetAsmInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SparcTargetAsmInfo.cpp; sourceTree = "<group>"; };
- CF341E320AB082D60099B064 /* X86TargetAsmInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = X86TargetAsmInfo.h; sourceTree = "<group>"; };
- CF341E330AB082D60099B064 /* X86TargetAsmInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = X86TargetAsmInfo.cpp; sourceTree = "<group>"; };
- CF42B6BF0AF24F5300D5D47C /* FoldingSet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FoldingSet.h; sourceTree = "<group>"; };
- CF42B6C40AF2512000D5D47C /* FoldingSet.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FoldingSet.cpp; sourceTree = "<group>"; };
- CF47BD380AAF40BC00A8B13E /* TargetAsmInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TargetAsmInfo.h; sourceTree = "<group>"; };
- CF47BD860AAF487E00A8B13E /* TargetAsmInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TargetAsmInfo.cpp; sourceTree = "<group>"; };
- CF490D14090541D30072DB1C /* TargetSchedule.td */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = TargetSchedule.td; sourceTree = "<group>"; };
- CF490D15090541D30072DB1C /* TargetSelectionDAG.td */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = TargetSelectionDAG.td; sourceTree = "<group>"; };
- CF490E2F0907BBF80072DB1C /* SubtargetEmitter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SubtargetEmitter.h; sourceTree = "<group>"; };
- CF490E300907BBF80072DB1C /* SubtargetEmitter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SubtargetEmitter.cpp; sourceTree = "<group>"; };
- CF4F27E60A7B6E23004359F6 /* MachinePassRegistry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MachinePassRegistry.h; sourceTree = "<group>"; };
- CF4F27F60A7B6FA3004359F6 /* MachinePassRegistry.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MachinePassRegistry.cpp; sourceTree = "<group>"; };
- CF65223409CA39B800C4B521 /* Intrinsics.gen */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Intrinsics.gen; sourceTree = "<group>"; };
- CF6527D909D1A53400C4B521 /* MachineLocation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MachineLocation.h; sourceTree = "<group>"; };
- CF6527FA09D1BA3800C4B521 /* DelaySlotFiller.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DelaySlotFiller.cpp; path = ../lib/Target/Sparc/DelaySlotFiller.cpp; sourceTree = SOURCE_ROOT; };
- CF6527FB09D1BA3800C4B521 /* FPMover.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FPMover.cpp; path = ../lib/Target/Sparc/FPMover.cpp; sourceTree = SOURCE_ROOT; };
- CF6527FC09D1BA3800C4B521 /* Makefile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.make; name = Makefile; path = ../lib/Target/Sparc/Makefile; sourceTree = SOURCE_ROOT; };
- CF6527FD09D1BA3800C4B521 /* README.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = README.txt; path = ../lib/Target/Sparc/README.txt; sourceTree = SOURCE_ROOT; };
- CF6527FE09D1BA3800C4B521 /* Sparc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Sparc.h; path = ../lib/Target/Sparc/Sparc.h; sourceTree = SOURCE_ROOT; };
- CF6527FF09D1BA3800C4B521 /* Sparc.td */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = Sparc.td; path = ../lib/Target/Sparc/Sparc.td; sourceTree = SOURCE_ROOT; };
- CF65280009D1BA3800C4B521 /* SparcAsmPrinter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SparcAsmPrinter.cpp; path = ../lib/Target/Sparc/SparcAsmPrinter.cpp; sourceTree = SOURCE_ROOT; };
- CF65280109D1BA3800C4B521 /* SparcGenAsmWriter.inc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; name = SparcGenAsmWriter.inc; path = ../lib/Target/Sparc/SparcGenAsmWriter.inc; sourceTree = SOURCE_ROOT; };
- CF65280209D1BA3800C4B521 /* SparcGenDAGISel.inc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; name = SparcGenDAGISel.inc; path = ../lib/Target/Sparc/SparcGenDAGISel.inc; sourceTree = SOURCE_ROOT; };
- CF65280309D1BA3800C4B521 /* SparcGenInstrInfo.inc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; name = SparcGenInstrInfo.inc; path = ../lib/Target/Sparc/SparcGenInstrInfo.inc; sourceTree = SOURCE_ROOT; };
- CF65280409D1BA3800C4B521 /* SparcGenInstrNames.inc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; name = SparcGenInstrNames.inc; path = ../lib/Target/Sparc/SparcGenInstrNames.inc; sourceTree = SOURCE_ROOT; };
- CF65280509D1BA3800C4B521 /* SparcGenRegisterInfo.h.inc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; name = SparcGenRegisterInfo.h.inc; path = ../lib/Target/Sparc/SparcGenRegisterInfo.h.inc; sourceTree = SOURCE_ROOT; };
- CF65280609D1BA3800C4B521 /* SparcGenRegisterInfo.inc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; name = SparcGenRegisterInfo.inc; path = ../lib/Target/Sparc/SparcGenRegisterInfo.inc; sourceTree = SOURCE_ROOT; };
- CF65280709D1BA3800C4B521 /* SparcGenRegisterNames.inc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; name = SparcGenRegisterNames.inc; path = ../lib/Target/Sparc/SparcGenRegisterNames.inc; sourceTree = SOURCE_ROOT; };
- CF65280809D1BA3800C4B521 /* SparcGenSubtarget.inc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; name = SparcGenSubtarget.inc; path = ../lib/Target/Sparc/SparcGenSubtarget.inc; sourceTree = SOURCE_ROOT; };
- CF65280909D1BA3800C4B521 /* SparcInstrFormats.td */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = SparcInstrFormats.td; path = ../lib/Target/Sparc/SparcInstrFormats.td; sourceTree = SOURCE_ROOT; };
- CF65280A09D1BA3800C4B521 /* SparcInstrInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SparcInstrInfo.cpp; path = ../lib/Target/Sparc/SparcInstrInfo.cpp; sourceTree = SOURCE_ROOT; };
- CF65280B09D1BA3800C4B521 /* SparcInstrInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SparcInstrInfo.h; path = ../lib/Target/Sparc/SparcInstrInfo.h; sourceTree = SOURCE_ROOT; };
- CF65280C09D1BA3800C4B521 /* SparcInstrInfo.td */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = SparcInstrInfo.td; path = ../lib/Target/Sparc/SparcInstrInfo.td; sourceTree = SOURCE_ROOT; };
- CF65280D09D1BA3800C4B521 /* SparcISelDAGToDAG.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SparcISelDAGToDAG.cpp; path = ../lib/Target/Sparc/SparcISelDAGToDAG.cpp; sourceTree = SOURCE_ROOT; };
- CF65280E09D1BA3800C4B521 /* SparcRegisterInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SparcRegisterInfo.cpp; path = ../lib/Target/Sparc/SparcRegisterInfo.cpp; sourceTree = SOURCE_ROOT; };
- CF65280F09D1BA3800C4B521 /* SparcRegisterInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SparcRegisterInfo.h; path = ../lib/Target/Sparc/SparcRegisterInfo.h; sourceTree = SOURCE_ROOT; };
- CF65281009D1BA3800C4B521 /* SparcRegisterInfo.td */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = SparcRegisterInfo.td; path = ../lib/Target/Sparc/SparcRegisterInfo.td; sourceTree = SOURCE_ROOT; };
- CF65281109D1BA3800C4B521 /* SparcSubtarget.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SparcSubtarget.cpp; path = ../lib/Target/Sparc/SparcSubtarget.cpp; sourceTree = SOURCE_ROOT; };
- CF65281209D1BA3800C4B521 /* SparcSubtarget.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SparcSubtarget.h; path = ../lib/Target/Sparc/SparcSubtarget.h; sourceTree = SOURCE_ROOT; };
- CF65281309D1BA3800C4B521 /* SparcTargetMachine.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SparcTargetMachine.cpp; path = ../lib/Target/Sparc/SparcTargetMachine.cpp; sourceTree = SOURCE_ROOT; };
- CF65281409D1BA3800C4B521 /* SparcTargetMachine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SparcTargetMachine.h; path = ../lib/Target/Sparc/SparcTargetMachine.h; sourceTree = SOURCE_ROOT; };
- CF6529A6095B21A8007F884E /* MachineModuleInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MachineModuleInfo.cpp; sourceTree = "<group>"; };
- CF6B5AFD095C82C300D1EA42 /* DAGCombiner.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DAGCombiner.cpp; sourceTree = "<group>"; };
- CF6F487109505E1500BC9E82 /* MachineModuleInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MachineModuleInfo.h; sourceTree = "<group>"; };
- CF71B60F0AC45EDA0007F57C /* SmallVector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SmallVector.h; sourceTree = "<group>"; };
- CF73C0A2098A4FDF00627152 /* InlineAsm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InlineAsm.h; sourceTree = "<group>"; };
- CF73C0A3098A4FDF00627152 /* TypeSymbolTable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TypeSymbolTable.h; sourceTree = "<group>"; };
- CF73C0A4098A4FDF00627152 /* ValueSymbolTable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ValueSymbolTable.h; sourceTree = "<group>"; };
- CF73C0A5098A507300627152 /* ConstantFolding.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ConstantFolding.h; sourceTree = "<group>"; };
- CF73C0A9098A50FD00627152 /* config.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = config.h; sourceTree = "<group>"; };
- CF73C0AD098A519400627152 /* DataTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DataTypes.h; sourceTree = "<group>"; };
- CF73C0AE098A51AD00627152 /* Alarm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Alarm.h; sourceTree = "<group>"; };
- CF73C0AF098A51DD00627152 /* RSProfiling.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RSProfiling.h; sourceTree = "<group>"; };
- CF73C0B0098A523C00627152 /* ConstantFolding.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ConstantFolding.cpp; sourceTree = "<group>"; };
- CF73C0B6098A53EF00627152 /* IA64Bundling.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IA64Bundling.cpp; sourceTree = "<group>"; };
- CF73C0B7098A546000627152 /* RSProfiling.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RSProfiling.cpp; sourceTree = "<group>"; };
- CF73C0B8098A546000627152 /* RSProfiling.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RSProfiling.h; sourceTree = "<group>"; };
- CF73C0B9098A546000627152 /* Reg2Mem.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Reg2Mem.cpp; sourceTree = "<group>"; };
- CF73C0BD098A551F00627152 /* InlineAsm.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = InlineAsm.cpp; path = ../lib/VMCore/InlineAsm.cpp; sourceTree = SOURCE_ROOT; };
- CF73C0BE098A551F00627152 /* TypeSymbolTable.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TypeSymbolTable.cpp; path = ../lib/VMCore/TypeSymbolTable.cpp; sourceTree = SOURCE_ROOT; };
- CF73C0BF098A551F00627152 /* ValueSymbolTable.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ValueSymbolTable.cpp; path = ../lib/VMCore/ValueSymbolTable.cpp; sourceTree = SOURCE_ROOT; };
- CF79495D09B326D4005ADFCA /* Dwarf.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Dwarf.cpp; sourceTree = "<group>"; };
- CF7FFA1F0985081C008B0087 /* ScheduleDAGList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScheduleDAGList.cpp; sourceTree = "<group>"; };
- CF7FFA2109850864008B0087 /* ScheduleDAG.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScheduleDAG.h; sourceTree = "<group>"; };
- CF8D62FA09C2226F006017BA /* Intrinsics.td */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Intrinsics.td; sourceTree = "<group>"; };
- CF8E00490989162500DA2399 /* Dwarf.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Dwarf.h; sourceTree = "<group>"; };
- CF8F1B410B64F6D100BB4199 /* RuntimeLibcalls.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RuntimeLibcalls.h; sourceTree = "<group>"; };
- CF8F1B420B64F70B00BB4199 /* PassManagers.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PassManagers.h; sourceTree = "<group>"; };
- CF8F1B430B64F74400BB4199 /* Allocator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Allocator.h; sourceTree = "<group>"; };
- CF8F1B440B64F74400BB4199 /* Compiler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Compiler.h; sourceTree = "<group>"; };
- CF8F1B460B64F74400BB4199 /* ManagedStatic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ManagedStatic.h; sourceTree = "<group>"; };
- CF8F1B470B64F74400BB4199 /* OutputBuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OutputBuffer.h; sourceTree = "<group>"; };
- CF8F1B490B64F7AB00BB4199 /* LinkTimeOptimizer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LinkTimeOptimizer.h; sourceTree = "<group>"; };
- CF8F1B4D0B64F80700BB4199 /* AliasDebugger.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AliasDebugger.cpp; sourceTree = "<group>"; };
- CF8F1B500B64F86A00BB4199 /* ManagedStatic.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ManagedStatic.cpp; sourceTree = "<group>"; };
- CF8F1B510B64F86A00BB4199 /* Streams.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Streams.cpp; sourceTree = "<group>"; };
- CF8F1B530B64F8C000BB4199 /* IncludeFile.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IncludeFile.cpp; sourceTree = "<group>"; };
- CF8F1B540B64F90F00BB4199 /* AlphaBranchSelector.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AlphaBranchSelector.cpp; sourceTree = "<group>"; };
- CF8F1B550B64F90F00BB4199 /* AlphaLLRP.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AlphaLLRP.cpp; sourceTree = "<group>"; };
- CF8F1B560B64F98900BB4199 /* CBackend.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CBackend.cpp; sourceTree = "<group>"; };
- CF8F1B570B64F9AC00BB4199 /* PPCPredicates.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PPCPredicates.cpp; sourceTree = "<group>"; };
- CF8F1B580B64F9AC00BB4199 /* PPCPredicates.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PPCPredicates.h; sourceTree = "<group>"; };
- CF8F1B590B64F9E100BB4199 /* X86COFF.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = X86COFF.h; sourceTree = "<group>"; };
- CF8F1B5B0B64FA2F00BB4199 /* PredicateSimplifier.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PredicateSimplifier.cpp; sourceTree = "<group>"; };
- CF8F1B5C0B64FA7300BB4199 /* PassManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PassManager.cpp; path = ../lib/VMCore/PassManager.cpp; sourceTree = SOURCE_ROOT; };
- CF8F1B680B64FADA00BB4199 /* llvm-upgrade.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "llvm-upgrade.cpp"; sourceTree = "<group>"; };
- CF8F1B720B64FADA00BB4199 /* UpgradeInternals.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UpgradeInternals.h; sourceTree = "<group>"; };
- CF8F1B750B64FADA00BB4199 /* UpgradeLexer.l */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.lex; path = UpgradeLexer.l; sourceTree = "<group>"; };
- CF8F1B7C0B64FADA00BB4199 /* UpgradeParser.y */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.yacc; path = UpgradeParser.y; sourceTree = "<group>"; };
- CF8F1B7F0B64FADA00BB4199 /* CppWriter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CppWriter.cpp; sourceTree = "<group>"; };
- CF8F1B800B64FADA00BB4199 /* CppWriter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CppWriter.h; sourceTree = "<group>"; };
- CF8F1B870B64FADA00BB4199 /* llvm2cpp.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = llvm2cpp.cpp; sourceTree = "<group>"; };
- CF8F1B950B64FB5000BB4199 /* ConfigLexer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ConfigLexer.cpp; sourceTree = "<group>"; };
- CF8F1B9D0B64FB7F00BB4199 /* lto-c.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "lto-c.cpp"; sourceTree = "<group>"; };
- CF8F1B9E0B64FB7F00BB4199 /* lto.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lto.cpp; sourceTree = "<group>"; };
- CF8F1BAC0B64FB8000BB4199 /* AnalysisWrappers.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AnalysisWrappers.cpp; sourceTree = "<group>"; };
- CF8F1BB70B64FB8000BB4199 /* GraphPrinters.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GraphPrinters.cpp; sourceTree = "<group>"; };
- CF8F1BB90B64FB8000BB4199 /* opt.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = opt.cpp; sourceTree = "<group>"; };
- CF8F1BBA0B64FB8000BB4199 /* PrintSCC.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PrintSCC.cpp; sourceTree = "<group>"; };
- CF8F1BC90B64FBD500BB4199 /* CodeGenIntrinsics.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CodeGenIntrinsics.h; sourceTree = "<group>"; };
- CF8F1BD10B64FC8A00BB4199 /* ARM.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ARM.h; sourceTree = "<group>"; };
- CF8F1BD20B64FC8A00BB4199 /* ARM.td */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ARM.td; sourceTree = "<group>"; };
- CF8F1BD30B64FC8A00BB4199 /* ARMAddressingModes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ARMAddressingModes.h; sourceTree = "<group>"; };
- CF8F1BD40B64FC8A00BB4199 /* ARMAsmPrinter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ARMAsmPrinter.cpp; sourceTree = "<group>"; };
- CF8F1BD50B64FC8A00BB4199 /* ARMConstantIslandPass.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ARMConstantIslandPass.cpp; sourceTree = "<group>"; };
- CF8F1BD60B64FC8A00BB4199 /* ARMConstantPoolValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ARMConstantPoolValue.cpp; sourceTree = "<group>"; };
- CF8F1BD70B64FC8A00BB4199 /* ARMConstantPoolValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ARMConstantPoolValue.h; sourceTree = "<group>"; };
- CF8F1BD80B64FC8A00BB4199 /* ARMFrameInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ARMFrameInfo.h; sourceTree = "<group>"; };
- CF8F1BD90B64FC8A00BB4199 /* ARMInstrInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ARMInstrInfo.cpp; sourceTree = "<group>"; };
- CF8F1BDA0B64FC8A00BB4199 /* ARMInstrInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ARMInstrInfo.h; sourceTree = "<group>"; };
- CF8F1BDB0B64FC8A00BB4199 /* ARMInstrInfo.td */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ARMInstrInfo.td; sourceTree = "<group>"; };
- CF8F1BDC0B64FC8A00BB4199 /* ARMInstrThumb.td */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ARMInstrThumb.td; sourceTree = "<group>"; };
- CF8F1BDD0B64FC8A00BB4199 /* ARMInstrVFP.td */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ARMInstrVFP.td; sourceTree = "<group>"; };
- CF8F1BDE0B64FC8A00BB4199 /* ARMISelDAGToDAG.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ARMISelDAGToDAG.cpp; sourceTree = "<group>"; };
- CF8F1BDF0B64FC8A00BB4199 /* ARMISelLowering.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ARMISelLowering.cpp; sourceTree = "<group>"; };
- CF8F1BE00B64FC8A00BB4199 /* ARMISelLowering.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ARMISelLowering.h; sourceTree = "<group>"; };
- CF8F1BE10B64FC8A00BB4199 /* ARMLoadStoreOptimizer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ARMLoadStoreOptimizer.cpp; sourceTree = "<group>"; };
- CF8F1BE20B64FC8A00BB4199 /* ARMMachineFunctionInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ARMMachineFunctionInfo.h; sourceTree = "<group>"; };
- CF8F1BE30B64FC8A00BB4199 /* ARMRegisterInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ARMRegisterInfo.cpp; sourceTree = "<group>"; };
- CF8F1BE40B64FC8A00BB4199 /* ARMRegisterInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ARMRegisterInfo.h; sourceTree = "<group>"; };
- CF8F1BE50B64FC8A00BB4199 /* ARMRegisterInfo.td */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ARMRegisterInfo.td; sourceTree = "<group>"; };
- CF8F1BE60B64FC8A00BB4199 /* ARMSubtarget.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ARMSubtarget.cpp; sourceTree = "<group>"; };
- CF8F1BE70B64FC8A00BB4199 /* ARMSubtarget.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ARMSubtarget.h; sourceTree = "<group>"; };
- CF8F1BE80B64FC8A00BB4199 /* ARMTargetAsmInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ARMTargetAsmInfo.cpp; sourceTree = "<group>"; };
- CF8F1BE90B64FC8A00BB4199 /* ARMTargetAsmInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ARMTargetAsmInfo.h; sourceTree = "<group>"; };
- CF8F1BEA0B64FC8A00BB4199 /* ARMTargetMachine.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ARMTargetMachine.cpp; sourceTree = "<group>"; };
- CF8F1BEB0B64FC8A00BB4199 /* ARMTargetMachine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ARMTargetMachine.h; sourceTree = "<group>"; };
- CF9720260A9F39B9002CEEDD /* LinkAllPasses.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LinkAllPasses.h; sourceTree = "<group>"; };
- CF9720270A9F39B9002CEEDD /* LinkTimeOptimizer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LinkTimeOptimizer.h; sourceTree = "<group>"; };
- CF9720340A9F3A41002CEEDD /* IncludeFile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IncludeFile.h; sourceTree = "<group>"; };
- CF9720350A9F3ADC002CEEDD /* MachOWriter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MachOWriter.cpp; sourceTree = "<group>"; };
- CF9720370A9F3B1C002CEEDD /* TargetLowering.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TargetLowering.cpp; sourceTree = "<group>"; };
- CF97208A0A9F3C6F002CEEDD /* LCSSA.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LCSSA.cpp; sourceTree = "<group>"; };
- CF97208B0A9F3C6F002CEEDD /* LowerAllocations.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LowerAllocations.cpp; sourceTree = "<group>"; };
- CF97208C0A9F3C6F002CEEDD /* LowerInvoke.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LowerInvoke.cpp; sourceTree = "<group>"; };
- CF97208E0A9F3C6F002CEEDD /* LowerSwitch.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LowerSwitch.cpp; sourceTree = "<group>"; };
- CF97208F0A9F3C6F002CEEDD /* Mem2Reg.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Mem2Reg.cpp; sourceTree = "<group>"; };
- CF9720900A9F3CA2002CEEDD /* ValueTypes.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ValueTypes.cpp; path = ../lib/VMCore/ValueTypes.cpp; sourceTree = SOURCE_ROOT; };
- CF9720910A9F3CC7002CEEDD /* FindBugs.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FindBugs.cpp; sourceTree = "<group>"; };
- CF9720920A9F3CC7002CEEDD /* ToolRunner.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ToolRunner.cpp; sourceTree = "<group>"; };
- CF9720930A9F3CC7002CEEDD /* ToolRunner.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ToolRunner.h; sourceTree = "<group>"; };
- CF9720970A9F3D4D002CEEDD /* IntrinsicEmitter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IntrinsicEmitter.cpp; sourceTree = "<group>"; };
- CF9720980A9F3D4D002CEEDD /* IntrinsicEmitter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IntrinsicEmitter.h; sourceTree = "<group>"; };
- CF9BCD0808C74DE0001E7011 /* SubtargetFeature.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SubtargetFeature.h; sourceTree = "<group>"; };
- CF9BCD1508C75070001E7011 /* SubtargetFeature.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SubtargetFeature.cpp; sourceTree = "<group>"; };
- CFA702BB0A6FA85F0006009A /* AlphaGenAsmWriter.inc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; path = AlphaGenAsmWriter.inc; sourceTree = "<group>"; };
- CFA702BC0A6FA85F0006009A /* AlphaGenCodeEmitter.inc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; path = AlphaGenCodeEmitter.inc; sourceTree = "<group>"; };
- CFA702BD0A6FA85F0006009A /* AlphaGenDAGISel.inc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; path = AlphaGenDAGISel.inc; sourceTree = "<group>"; };
- CFA702BE0A6FA85F0006009A /* AlphaGenInstrInfo.inc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; path = AlphaGenInstrInfo.inc; sourceTree = "<group>"; };
- CFA702BF0A6FA85F0006009A /* AlphaGenInstrNames.inc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; path = AlphaGenInstrNames.inc; sourceTree = "<group>"; };
- CFA702C00A6FA85F0006009A /* AlphaGenRegisterInfo.h.inc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; path = AlphaGenRegisterInfo.h.inc; sourceTree = "<group>"; };
- CFA702C10A6FA85F0006009A /* AlphaGenRegisterInfo.inc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; path = AlphaGenRegisterInfo.inc; sourceTree = "<group>"; };
- CFA702C20A6FA85F0006009A /* AlphaGenRegisterNames.inc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; path = AlphaGenRegisterNames.inc; sourceTree = "<group>"; };
- CFA702C30A6FA85F0006009A /* AlphaGenSubtarget.inc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; path = AlphaGenSubtarget.inc; sourceTree = "<group>"; };
- CFA702C40A6FA8910006009A /* IA64GenAsmWriter.inc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; path = IA64GenAsmWriter.inc; sourceTree = "<group>"; };
- CFA702C50A6FA8910006009A /* IA64GenDAGISel.inc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; path = IA64GenDAGISel.inc; sourceTree = "<group>"; };
- CFA702C60A6FA8910006009A /* IA64GenInstrInfo.inc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; path = IA64GenInstrInfo.inc; sourceTree = "<group>"; };
- CFA702C70A6FA8910006009A /* IA64GenInstrNames.inc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; path = IA64GenInstrNames.inc; sourceTree = "<group>"; };
- CFA702C80A6FA8910006009A /* IA64GenRegisterInfo.h.inc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; path = IA64GenRegisterInfo.h.inc; sourceTree = "<group>"; };
- CFA702C90A6FA8910006009A /* IA64GenRegisterInfo.inc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; path = IA64GenRegisterInfo.inc; sourceTree = "<group>"; };
- CFA702CA0A6FA8910006009A /* IA64GenRegisterNames.inc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; path = IA64GenRegisterNames.inc; sourceTree = "<group>"; };
- CFA702CB0A6FA8AD0006009A /* PPCGenAsmWriter.inc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; path = PPCGenAsmWriter.inc; sourceTree = "<group>"; };
- CFA702CC0A6FA8AD0006009A /* PPCGenCodeEmitter.inc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; path = PPCGenCodeEmitter.inc; sourceTree = "<group>"; };
- CFA702CD0A6FA8AD0006009A /* PPCGenDAGISel.inc */ = {isa = PBXFileReference; explicitFileType = sourcecode.pascal; fileEncoding = 4; path = PPCGenDAGISel.inc; sourceTree = "<group>"; };
- CFA702CE0A6FA8AD0006009A /* PPCGenInstrInfo.inc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; path = PPCGenInstrInfo.inc; sourceTree = "<group>"; };
- CFA702CF0A6FA8AD0006009A /* PPCGenInstrNames.inc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; path = PPCGenInstrNames.inc; sourceTree = "<group>"; };
- CFA702D00A6FA8AD0006009A /* PPCGenRegisterInfo.h.inc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; path = PPCGenRegisterInfo.h.inc; sourceTree = "<group>"; };
- CFA702D10A6FA8AD0006009A /* PPCGenRegisterInfo.inc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; path = PPCGenRegisterInfo.inc; sourceTree = "<group>"; };
- CFA702D20A6FA8AD0006009A /* PPCGenRegisterNames.inc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; path = PPCGenRegisterNames.inc; sourceTree = "<group>"; };
- CFA702D30A6FA8AD0006009A /* PPCGenSubtarget.inc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; path = PPCGenSubtarget.inc; sourceTree = "<group>"; };
- CFA702D40A6FA8DD0006009A /* X86GenAsmWriter.inc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; path = X86GenAsmWriter.inc; sourceTree = "<group>"; };
- CFA702D50A6FA8DD0006009A /* X86GenAsmWriter1.inc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; path = X86GenAsmWriter1.inc; sourceTree = "<group>"; };
- CFA702D60A6FA8DD0006009A /* X86GenDAGISel.inc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; path = X86GenDAGISel.inc; sourceTree = "<group>"; };
- CFA702D70A6FA8DD0006009A /* X86GenInstrInfo.inc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; path = X86GenInstrInfo.inc; sourceTree = "<group>"; };
- CFA702D80A6FA8DD0006009A /* X86GenInstrNames.inc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; path = X86GenInstrNames.inc; sourceTree = "<group>"; };
- CFA702D90A6FA8DD0006009A /* X86GenRegisterInfo.h.inc */ = {isa = PBXFileReference; fileEncoding = 4; languageSpecificationIdentifier = c.cpp; lastKnownFileType = sourcecode.pascal; path = X86GenRegisterInfo.h.inc; sourceTree = "<group>"; };
- CFA702DA0A6FA8DD0006009A /* X86GenRegisterInfo.inc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; path = X86GenRegisterInfo.inc; sourceTree = "<group>"; };
- CFA702DB0A6FA8DD0006009A /* X86GenRegisterNames.inc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; path = X86GenRegisterNames.inc; sourceTree = "<group>"; };
- CFA702DC0A6FA8DD0006009A /* X86GenSubtarget.inc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; path = X86GenSubtarget.inc; sourceTree = "<group>"; };
- CFABD0A20B09E342003EB061 /* PPCMachineFunctionInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PPCMachineFunctionInfo.h; sourceTree = "<group>"; };
- CFBD8B1A090E76540020B107 /* AlphaISelDAGToDAG.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AlphaISelDAGToDAG.cpp; sourceTree = "<group>"; };
- CFBD8B1B090E76540020B107 /* AlphaISelLowering.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AlphaISelLowering.cpp; sourceTree = "<group>"; };
- CFBD8B1C090E76540020B107 /* AlphaISelLowering.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AlphaISelLowering.h; sourceTree = "<group>"; };
- CFBD8B1D090E76540020B107 /* AlphaSubtarget.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AlphaSubtarget.cpp; sourceTree = "<group>"; };
- CFBD8B1E090E76540020B107 /* AlphaSubtarget.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AlphaSubtarget.h; sourceTree = "<group>"; };
- CFC244570959DEF2009F8C47 /* DwarfWriter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DwarfWriter.cpp; sourceTree = "<group>"; };
- CFC244BB0959F24C009F8C47 /* X86ISelDAGToDAG.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = X86ISelDAGToDAG.cpp; sourceTree = "<group>"; };
- CFC244BC0959F24C009F8C47 /* X86ISelLowering.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = X86ISelLowering.cpp; sourceTree = "<group>"; };
- CFC244BD0959F24C009F8C47 /* X86ISelLowering.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = X86ISelLowering.h; sourceTree = "<group>"; };
- CFC244BF0959F2E3009F8C47 /* IA64ISelDAGToDAG.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IA64ISelDAGToDAG.cpp; sourceTree = "<group>"; };
- CFC244C00959F2E3009F8C47 /* IA64ISelLowering.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IA64ISelLowering.cpp; sourceTree = "<group>"; };
- CFC244C10959F2E3009F8C47 /* IA64ISelLowering.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IA64ISelLowering.h; sourceTree = "<group>"; };
- CFD7E4F30A798FC3000C7379 /* LinkAllCodegenComponents.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LinkAllCodegenComponents.h; sourceTree = "<group>"; };
- CFD99AA80AFE827B0068D19C /* LICENSE.TXT */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = LICENSE.TXT; path = ../LICENSE.TXT; sourceTree = SOURCE_ROOT; };
- CFD99AAD0AFE827B0068D19C /* README.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = README.txt; path = ../README.txt; sourceTree = SOURCE_ROOT; };
- CFD99AB70AFE848A0068D19C /* Allocator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Allocator.cpp; sourceTree = "<group>"; };
- CFD99ABA0AFE84D70068D19C /* IncludeFile.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IncludeFile.cpp; sourceTree = "<group>"; };
- CFD99ABB0AFE84EF0068D19C /* Alarm.inc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; path = Alarm.inc; sourceTree = "<group>"; };
- CFD99ABE0AFE857A0068D19C /* README-X86-64.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "README-X86-64.txt"; sourceTree = "<group>"; };
- CFD99ADA0AFE87650068D19C /* lto.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = lto.cpp; path = lto/lto.cpp; sourceTree = "<group>"; };
- CFD99ADB0AFE87870068D19C /* AnalysisWrappers.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AnalysisWrappers.cpp; path = opt/AnalysisWrappers.cpp; sourceTree = "<group>"; };
- CFD99ADC0AFE87870068D19C /* GraphPrinters.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = GraphPrinters.cpp; path = opt/GraphPrinters.cpp; sourceTree = "<group>"; };
- CFD99ADD0AFE87870068D19C /* opt.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = opt.cpp; path = opt/opt.cpp; sourceTree = "<group>"; };
- CFD99ADE0AFE87870068D19C /* PrintSCC.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PrintSCC.cpp; path = opt/PrintSCC.cpp; sourceTree = "<group>"; };
- CFE21C780A80CC0600D3E908 /* RegAllocRegistry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RegAllocRegistry.h; sourceTree = "<group>"; };
- CFE21C7B0A80CC1C00D3E908 /* SchedulerRegistry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SchedulerRegistry.h; sourceTree = "<group>"; };
- CFE420FB0A66F67300AB4BF6 /* MachineJumpTableInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MachineJumpTableInfo.h; sourceTree = "<group>"; };
- CFE420FC0A66F67300AB4BF6 /* ValueTypes.td */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ValueTypes.td; sourceTree = "<group>"; };
- CFE420FD0A66F67300AB4BF6 /* Interpreter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Interpreter.h; sourceTree = "<group>"; };
- CFE420FE0A66F67300AB4BF6 /* JIT.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JIT.h; sourceTree = "<group>"; };
- CFE420FF0A66F67300AB4BF6 /* IntrinsicsPowerPC.td */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = IntrinsicsPowerPC.td; sourceTree = "<group>"; };
- CFE421000A66F67300AB4BF6 /* IntrinsicsX86.td */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = IntrinsicsX86.td; sourceTree = "<group>"; };
- CFE421010A66F67300AB4BF6 /* LinkAllVMCore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LinkAllVMCore.h; sourceTree = "<group>"; };
- CFE421060A66F86D00AB4BF6 /* ScheduleDAGRRList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScheduleDAGRRList.cpp; sourceTree = "<group>"; };
- CFE421070A66F8DC00AB4BF6 /* GraphWriter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GraphWriter.cpp; sourceTree = "<group>"; };
- CFE421090A66F93300AB4BF6 /* Alarm.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Alarm.cpp; sourceTree = "<group>"; };
- CFE4210A0A66F93300AB4BF6 /* Alarm.inc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; path = Alarm.inc; sourceTree = "<group>"; };
- CFE4210B0A66F96400AB4BF6 /* AlphaSchedule.td */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = AlphaSchedule.td; sourceTree = "<group>"; };
- CFE421140A66FA2D00AB4BF6 /* PPC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PPC.h; sourceTree = "<group>"; };
- CFE421150A66FA2D00AB4BF6 /* PPC.td */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = PPC.td; sourceTree = "<group>"; };
- CFE421160A66FA2D00AB4BF6 /* PPCAsmPrinter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PPCAsmPrinter.cpp; sourceTree = "<group>"; };
- CFE421170A66FA2D00AB4BF6 /* PPCBranchSelector.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PPCBranchSelector.cpp; sourceTree = "<group>"; };
- CFE421180A66FA2D00AB4BF6 /* PPCCodeEmitter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PPCCodeEmitter.cpp; sourceTree = "<group>"; };
- CFE421190A66FA2D00AB4BF6 /* PPCFrameInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PPCFrameInfo.h; sourceTree = "<group>"; };
- CFE4211A0A66FA2D00AB4BF6 /* PPCHazardRecognizers.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PPCHazardRecognizers.cpp; sourceTree = "<group>"; };
- CFE4211B0A66FA2D00AB4BF6 /* PPCHazardRecognizers.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PPCHazardRecognizers.h; sourceTree = "<group>"; };
- CFE4211C0A66FA2D00AB4BF6 /* PPCInstr64Bit.td */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = PPCInstr64Bit.td; sourceTree = "<group>"; };
- CFE4211D0A66FA2D00AB4BF6 /* PPCInstrAltivec.td */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = PPCInstrAltivec.td; sourceTree = "<group>"; };
- CFE4211E0A66FA2D00AB4BF6 /* PPCInstrBuilder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PPCInstrBuilder.h; sourceTree = "<group>"; };
- CFE4211F0A66FA2D00AB4BF6 /* PPCInstrFormats.td */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = PPCInstrFormats.td; sourceTree = "<group>"; };
- CFE421200A66FA2D00AB4BF6 /* PPCInstrInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PPCInstrInfo.cpp; sourceTree = "<group>"; };
- CFE421210A66FA2D00AB4BF6 /* PPCInstrInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PPCInstrInfo.h; sourceTree = "<group>"; };
- CFE421220A66FA2D00AB4BF6 /* PPCInstrInfo.td */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = PPCInstrInfo.td; sourceTree = "<group>"; };
- CFE421230A66FA2D00AB4BF6 /* PPCISelDAGToDAG.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PPCISelDAGToDAG.cpp; sourceTree = "<group>"; };
- CFE421240A66FA2D00AB4BF6 /* PPCISelLowering.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PPCISelLowering.cpp; sourceTree = "<group>"; };
- CFE421250A66FA2D00AB4BF6 /* PPCISelLowering.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PPCISelLowering.h; sourceTree = "<group>"; };
- CFE421260A66FA2D00AB4BF6 /* PPCJITInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PPCJITInfo.cpp; sourceTree = "<group>"; };
- CFE421270A66FA2D00AB4BF6 /* PPCJITInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PPCJITInfo.h; sourceTree = "<group>"; };
- CFE421280A66FA2D00AB4BF6 /* PPCPerfectShuffle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PPCPerfectShuffle.h; sourceTree = "<group>"; };
- CFE421290A66FA2D00AB4BF6 /* PPCRegisterInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PPCRegisterInfo.cpp; sourceTree = "<group>"; };
- CFE4212A0A66FA2D00AB4BF6 /* PPCRegisterInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PPCRegisterInfo.h; sourceTree = "<group>"; };
- CFE4212B0A66FA2D00AB4BF6 /* PPCRegisterInfo.td */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = PPCRegisterInfo.td; sourceTree = "<group>"; };
- CFE4212C0A66FA2D00AB4BF6 /* PPCRelocations.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PPCRelocations.h; sourceTree = "<group>"; };
- CFE4212D0A66FA2D00AB4BF6 /* PPCSchedule.td */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = PPCSchedule.td; sourceTree = "<group>"; };
- CFE4212E0A66FA2D00AB4BF6 /* PPCScheduleG3.td */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = PPCScheduleG3.td; sourceTree = "<group>"; };
- CFE4212F0A66FA2D00AB4BF6 /* PPCScheduleG4.td */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = PPCScheduleG4.td; sourceTree = "<group>"; };
- CFE421300A66FA2D00AB4BF6 /* PPCScheduleG4Plus.td */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = PPCScheduleG4Plus.td; sourceTree = "<group>"; };
- CFE421310A66FA2D00AB4BF6 /* PPCScheduleG5.td */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = PPCScheduleG5.td; sourceTree = "<group>"; };
- CFE421320A66FA2E00AB4BF6 /* PPCSubtarget.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PPCSubtarget.cpp; sourceTree = "<group>"; };
- CFE421330A66FA2E00AB4BF6 /* PPCSubtarget.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PPCSubtarget.h; sourceTree = "<group>"; };
- CFE421340A66FA2E00AB4BF6 /* PPCTargetMachine.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PPCTargetMachine.cpp; sourceTree = "<group>"; };
- CFE421350A66FA2E00AB4BF6 /* PPCTargetMachine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PPCTargetMachine.h; sourceTree = "<group>"; };
- CFE421360A66FA2E00AB4BF6 /* README_ALTIVEC.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = README_ALTIVEC.txt; sourceTree = "<group>"; };
- CFE421370A66FA2E00AB4BF6 /* README.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = README.txt; sourceTree = "<group>"; };
- CFE421380A66FA8000AB4BF6 /* README-FPStack.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "README-FPStack.txt"; sourceTree = "<group>"; };
- CFE421390A66FA8000AB4BF6 /* README-SSE.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "README-SSE.txt"; sourceTree = "<group>"; };
- CFE4213A0A66FA8000AB4BF6 /* README.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = README.txt; sourceTree = "<group>"; };
- CFE4213B0A66FA8000AB4BF6 /* X86MachineFunctionInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = X86MachineFunctionInfo.h; sourceTree = "<group>"; };
- CFE4213D0A66FAE100AB4BF6 /* Hello.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Hello.cpp; sourceTree = "<group>"; };
- CFE4213F0A66FB5E00AB4BF6 /* IndMemRemoval.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IndMemRemoval.cpp; sourceTree = "<group>"; };
- CFF0DE6309BF6C360031957F /* X86InstrFPStack.td */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = X86InstrFPStack.td; sourceTree = "<group>"; };
- CFF0DE6409BF6C360031957F /* X86InstrMMX.td */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = X86InstrMMX.td; sourceTree = "<group>"; };
- CFF0DE6509BF6C360031957F /* X86InstrSSE.td */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = X86InstrSSE.td; sourceTree = "<group>"; };
- CFF8B434097C605F0047F72A /* UniqueVector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UniqueVector.h; sourceTree = "<group>"; };
- DE4DA0390911476D0012D44B /* LoopSimplify.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = LoopSimplify.cpp; path = ../lib/Transforms/Utils/LoopSimplify.cpp; sourceTree = SOURCE_ROOT; };
- DE4DA03C091147920012D44B /* LiveInterval.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = LiveInterval.h; path = ../include/llvm/CodeGen/LiveInterval.h; sourceTree = SOURCE_ROOT; };
- DE4DA03D091147920012D44B /* LiveIntervalAnalysis.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = LiveIntervalAnalysis.h; path = ../include/llvm/CodeGen/LiveIntervalAnalysis.h; sourceTree = SOURCE_ROOT; };
- DE4DA065091148520012D44B /* SubtargetEmitter.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = SubtargetEmitter.cpp; path = ../utils/TableGen/SubtargetEmitter.cpp; sourceTree = SOURCE_ROOT; };
- DE4DA066091148520012D44B /* SubtargetEmitter.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = SubtargetEmitter.h; path = ../utils/TableGen/SubtargetEmitter.h; sourceTree = SOURCE_ROOT; };
- DE66EC5B08ABE86900323D32 /* AsmWriter.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = AsmWriter.cpp; path = ../lib/VMCore/AsmWriter.cpp; sourceTree = SOURCE_ROOT; };
- DE66EC5C08ABE86A00323D32 /* BasicBlock.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = BasicBlock.cpp; path = ../lib/VMCore/BasicBlock.cpp; sourceTree = SOURCE_ROOT; };
- DE66EC6008ABE86A00323D32 /* Constants.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = Constants.cpp; path = ../lib/VMCore/Constants.cpp; sourceTree = SOURCE_ROOT; };
- DE66EC6108ABE86A00323D32 /* Dominators.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = Dominators.cpp; path = ../lib/VMCore/Dominators.cpp; sourceTree = SOURCE_ROOT; };
- DE66EC6208ABE86A00323D32 /* Function.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = Function.cpp; path = ../lib/VMCore/Function.cpp; sourceTree = SOURCE_ROOT; };
- DE66EC6308ABE86A00323D32 /* Globals.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = Globals.cpp; path = ../lib/VMCore/Globals.cpp; sourceTree = SOURCE_ROOT; };
- DE66EC6408ABE86A00323D32 /* Instruction.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = Instruction.cpp; path = ../lib/VMCore/Instruction.cpp; sourceTree = SOURCE_ROOT; };
- DE66EC6508ABE86A00323D32 /* Instructions.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = Instructions.cpp; path = ../lib/VMCore/Instructions.cpp; sourceTree = SOURCE_ROOT; };
- DE66EC6608ABE86A00323D32 /* LeakDetector.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = LeakDetector.cpp; path = ../lib/VMCore/LeakDetector.cpp; sourceTree = SOURCE_ROOT; };
- DE66EC6708ABE86A00323D32 /* Mangler.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = Mangler.cpp; path = ../lib/VMCore/Mangler.cpp; sourceTree = SOURCE_ROOT; };
- DE66EC6808ABE86A00323D32 /* Module.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = Module.cpp; path = ../lib/VMCore/Module.cpp; sourceTree = SOURCE_ROOT; };
- DE66EC6908ABE86A00323D32 /* ModuleProvider.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = ModuleProvider.cpp; path = ../lib/VMCore/ModuleProvider.cpp; sourceTree = SOURCE_ROOT; };
- DE66EC6A08ABE86A00323D32 /* Pass.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = Pass.cpp; path = ../lib/VMCore/Pass.cpp; sourceTree = SOURCE_ROOT; };
- DE66EC6D08ABE86A00323D32 /* SymbolTableListTraitsImpl.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = SymbolTableListTraitsImpl.h; path = ../lib/VMCore/SymbolTableListTraitsImpl.h; sourceTree = SOURCE_ROOT; };
- DE66EC6E08ABE86A00323D32 /* Type.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = Type.cpp; path = ../lib/VMCore/Type.cpp; sourceTree = SOURCE_ROOT; };
- DE66EC6F08ABE86A00323D32 /* Value.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = Value.cpp; path = ../lib/VMCore/Value.cpp; sourceTree = SOURCE_ROOT; };
- DE66EC7008ABE86A00323D32 /* Verifier.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = Verifier.cpp; path = ../lib/VMCore/Verifier.cpp; sourceTree = SOURCE_ROOT; };
- DE66EC8E08ABEAF000323D32 /* llvmAsmParser.y */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.yacc; name = llvmAsmParser.y; path = ../lib/AsmParser/llvmAsmParser.y; sourceTree = SOURCE_ROOT; };
- DE66EC8F08ABEAF000323D32 /* Parser.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = Parser.cpp; path = ../lib/AsmParser/Parser.cpp; sourceTree = SOURCE_ROOT; };
- DE66EC9008ABEAF000323D32 /* ParserInternals.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = ParserInternals.h; path = ../lib/AsmParser/ParserInternals.h; sourceTree = SOURCE_ROOT; };
- DE66ECBE08ABEC0700323D32 /* AliasAnalysis.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = AliasAnalysis.cpp; sourceTree = "<group>"; };
- DE66ECBF08ABEC0700323D32 /* AliasAnalysisCounter.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = AliasAnalysisCounter.cpp; sourceTree = "<group>"; };
- DE66ECC008ABEC0700323D32 /* AliasAnalysisEvaluator.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = AliasAnalysisEvaluator.cpp; sourceTree = "<group>"; };
- DE66ECC108ABEC0700323D32 /* AliasSetTracker.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = AliasSetTracker.cpp; sourceTree = "<group>"; };
- DE66ECC208ABEC0700323D32 /* BasicAliasAnalysis.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = BasicAliasAnalysis.cpp; sourceTree = "<group>"; };
- DE66ECC308ABEC0700323D32 /* CFGPrinter.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = CFGPrinter.cpp; sourceTree = "<group>"; };
- DE66ED1708ABEC0800323D32 /* InstCount.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = InstCount.cpp; sourceTree = "<group>"; };
- DE66ED1808ABEC0800323D32 /* Interval.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Interval.cpp; sourceTree = "<group>"; };
- DE66ED1908ABEC0800323D32 /* IntervalPartition.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = IntervalPartition.cpp; sourceTree = "<group>"; };
- DE66ED1B08ABEC0800323D32 /* Andersens.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Andersens.cpp; sourceTree = "<group>"; };
- DE66ED1C08ABEC0800323D32 /* CallGraph.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = CallGraph.cpp; sourceTree = "<group>"; };
- DE66ED1D08ABEC0800323D32 /* CallGraphSCCPass.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = CallGraphSCCPass.cpp; sourceTree = "<group>"; };
- DE66ED2F08ABEC0800323D32 /* FindUsedTypes.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = FindUsedTypes.cpp; sourceTree = "<group>"; };
- DE66ED3008ABEC0800323D32 /* GlobalsModRef.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = GlobalsModRef.cpp; sourceTree = "<group>"; };
- DE66ED3308ABEC0800323D32 /* LoadValueNumbering.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = LoadValueNumbering.cpp; sourceTree = "<group>"; };
- DE66ED3408ABEC0800323D32 /* LoopInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = LoopInfo.cpp; sourceTree = "<group>"; };
- DE66ED3608ABEC0800323D32 /* PostDominators.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = PostDominators.cpp; sourceTree = "<group>"; };
- DE66ED3708ABEC0800323D32 /* ProfileInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = ProfileInfo.cpp; sourceTree = "<group>"; };
- DE66ED3808ABEC0800323D32 /* ProfileInfoLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = ProfileInfoLoader.cpp; sourceTree = "<group>"; };
- DE66ED3908ABEC0800323D32 /* ProfileInfoLoaderPass.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = ProfileInfoLoaderPass.cpp; sourceTree = "<group>"; };
- DE66ED3A08ABEC0800323D32 /* ScalarEvolution.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = ScalarEvolution.cpp; sourceTree = "<group>"; };
- DE66ED3B08ABEC0800323D32 /* ScalarEvolutionExpander.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = ScalarEvolutionExpander.cpp; sourceTree = "<group>"; };
- DE66ED3C08ABEC0800323D32 /* Trace.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Trace.cpp; sourceTree = "<group>"; };
- DE66ED3D08ABEC0800323D32 /* ValueNumbering.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = ValueNumbering.cpp; sourceTree = "<group>"; };
- DE66ED3F08ABEC2A00323D32 /* AsmPrinter.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = AsmPrinter.cpp; sourceTree = "<group>"; };
- DE66ED4008ABEC2A00323D32 /* BranchFolding.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = BranchFolding.cpp; sourceTree = "<group>"; };
- DE66ED6F08ABEC2B00323D32 /* ELFWriter.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = ELFWriter.cpp; sourceTree = "<group>"; };
- DE66ED7008ABEC2B00323D32 /* IntrinsicLowering.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = IntrinsicLowering.cpp; sourceTree = "<group>"; };
- DE66ED7108ABEC2B00323D32 /* LiveInterval.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = LiveInterval.cpp; sourceTree = "<group>"; };
- DE66ED7308ABEC2B00323D32 /* LiveIntervalAnalysis.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = LiveIntervalAnalysis.cpp; sourceTree = "<group>"; };
- DE66ED7508ABEC2B00323D32 /* LiveVariables.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = LiveVariables.cpp; sourceTree = "<group>"; };
- DE66ED7608ABEC2B00323D32 /* MachineBasicBlock.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = MachineBasicBlock.cpp; sourceTree = "<group>"; };
- DE66ED7808ABEC2B00323D32 /* MachineFunction.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = MachineFunction.cpp; sourceTree = "<group>"; };
- DE66ED7908ABEC2B00323D32 /* MachineInstr.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = MachineInstr.cpp; sourceTree = "<group>"; };
- DE66ED7B08ABEC2B00323D32 /* Passes.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Passes.cpp; sourceTree = "<group>"; };
- DE66ED7C08ABEC2B00323D32 /* PHIElimination.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = PHIElimination.cpp; sourceTree = "<group>"; };
- DE66ED7D08ABEC2B00323D32 /* PhysRegTracker.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = PhysRegTracker.h; sourceTree = "<group>"; };
- DE66ED7E08ABEC2B00323D32 /* PrologEpilogInserter.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = PrologEpilogInserter.cpp; sourceTree = "<group>"; };
- DE66ED8008ABEC2B00323D32 /* RegAllocLinearScan.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = RegAllocLinearScan.cpp; sourceTree = "<group>"; };
- DE66ED8108ABEC2B00323D32 /* RegAllocLocal.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = RegAllocLocal.cpp; sourceTree = "<group>"; };
- DE66ED8208ABEC2B00323D32 /* RegAllocSimple.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = RegAllocSimple.cpp; sourceTree = "<group>"; };
- DE66ED9008ABEC2B00323D32 /* LegalizeDAG.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = LegalizeDAG.cpp; sourceTree = "<group>"; };
- DE66ED9208ABEC2B00323D32 /* SelectionDAG.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = SelectionDAG.cpp; sourceTree = "<group>"; };
- DE66ED9308ABEC2B00323D32 /* SelectionDAGISel.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = SelectionDAGISel.cpp; sourceTree = "<group>"; };
- DE66ED9408ABEC2B00323D32 /* SelectionDAGPrinter.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = SelectionDAGPrinter.cpp; sourceTree = "<group>"; };
- DE66ED9508ABEC2B00323D32 /* TwoAddressInstructionPass.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = TwoAddressInstructionPass.cpp; sourceTree = "<group>"; };
- DE66ED9608ABEC2B00323D32 /* UnreachableBlockElim.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = UnreachableBlockElim.cpp; sourceTree = "<group>"; };
- DE66ED9808ABEC2B00323D32 /* VirtRegMap.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = VirtRegMap.cpp; sourceTree = "<group>"; };
- DE66ED9908ABEC2B00323D32 /* VirtRegMap.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = VirtRegMap.h; sourceTree = "<group>"; };
- DE66EDB108ABEC7300323D32 /* Debugger.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Debugger.cpp; sourceTree = "<group>"; };
- DE66EDB508ABEC7300323D32 /* ProgramInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = ProgramInfo.cpp; sourceTree = "<group>"; };
- DE66EDB608ABEC7300323D32 /* README.txt */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = README.txt; sourceTree = "<group>"; };
- DE66EDB708ABEC7300323D32 /* RuntimeInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = RuntimeInfo.cpp; sourceTree = "<group>"; };
- DE66EDB808ABEC7300323D32 /* SourceFile.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = SourceFile.cpp; sourceTree = "<group>"; };
- DE66EDB908ABEC7300323D32 /* SourceLanguage-CFamily.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = "SourceLanguage-CFamily.cpp"; sourceTree = "<group>"; };
- DE66EDBA08ABEC7300323D32 /* SourceLanguage-CPlusPlus.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = "SourceLanguage-CPlusPlus.cpp"; sourceTree = "<group>"; };
- DE66EDBB08ABEC7300323D32 /* SourceLanguage-Unknown.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = "SourceLanguage-Unknown.cpp"; sourceTree = "<group>"; };
- DE66EDBC08ABEC7300323D32 /* SourceLanguage.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = SourceLanguage.cpp; sourceTree = "<group>"; };
- DE66EDC408ABEC9000323D32 /* ExecutionEngine.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = ExecutionEngine.cpp; sourceTree = "<group>"; };
- DE66EDCE08ABEC9000323D32 /* Execution.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Execution.cpp; sourceTree = "<group>"; };
- DE66EDCF08ABEC9000323D32 /* ExternalFunctions.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = ExternalFunctions.cpp; sourceTree = "<group>"; };
- DE66EDD008ABEC9000323D32 /* Interpreter.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Interpreter.cpp; sourceTree = "<group>"; };
- DE66EDD108ABEC9000323D32 /* Interpreter.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Interpreter.h; sourceTree = "<group>"; };
- DE66EDDE08ABEC9100323D32 /* Intercept.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Intercept.cpp; sourceTree = "<group>"; };
- DE66EDDF08ABEC9100323D32 /* JIT.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JIT.cpp; sourceTree = "<group>"; };
- DE66EDE008ABEC9100323D32 /* JIT.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JIT.h; sourceTree = "<group>"; };
- DE66EDE108ABEC9100323D32 /* JITEmitter.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JITEmitter.cpp; sourceTree = "<group>"; };
- DE66EDE308ABEC9100323D32 /* TargetSelect.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = TargetSelect.cpp; sourceTree = "<group>"; };
- DE66EDF608ABEDD300323D32 /* LinkArchives.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = LinkArchives.cpp; sourceTree = "<group>"; };
- DE66EDF708ABEDD300323D32 /* Linker.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Linker.cpp; sourceTree = "<group>"; };
- DE66EDF808ABEDD300323D32 /* LinkItems.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = LinkItems.cpp; sourceTree = "<group>"; };
- DE66EDF908ABEDD300323D32 /* LinkModules.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = LinkModules.cpp; sourceTree = "<group>"; };
- DE66EDFC08ABEDE600323D32 /* Annotation.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Annotation.cpp; sourceTree = "<group>"; };
- DE66EE1D08ABEDE600323D32 /* CommandLine.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = CommandLine.cpp; sourceTree = "<group>"; };
- DE66EE3D08ABEDE600323D32 /* Debug.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Debug.cpp; sourceTree = "<group>"; };
- DE66EE3E08ABEDE600323D32 /* FileUtilities.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = FileUtilities.cpp; sourceTree = "<group>"; };
- DE66EE3F08ABEDE600323D32 /* IsInf.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = IsInf.cpp; sourceTree = "<group>"; };
- DE66EE4008ABEDE600323D32 /* IsNAN.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = IsNAN.cpp; sourceTree = "<group>"; };
- DE66EE4208ABEDE600323D32 /* PluginLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = PluginLoader.cpp; sourceTree = "<group>"; };
- DE66EE4308ABEDE600323D32 /* SlowOperationInformer.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = SlowOperationInformer.cpp; sourceTree = "<group>"; };
- DE66EE4408ABEDE600323D32 /* Statistic.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Statistic.cpp; sourceTree = "<group>"; };
- DE66EE4508ABEDE700323D32 /* StringExtras.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = StringExtras.cpp; sourceTree = "<group>"; };
- DE66EE4608ABEDE700323D32 /* SystemUtils.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = SystemUtils.cpp; sourceTree = "<group>"; };
- DE66EE4708ABEDE700323D32 /* Timer.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Timer.cpp; sourceTree = "<group>"; };
- DE66EE6008ABEE3400323D32 /* DynamicLibrary.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = DynamicLibrary.cpp; sourceTree = "<group>"; };
- DE66EE6108ABEE3400323D32 /* LICENSE.TXT */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = LICENSE.TXT; sourceTree = "<group>"; };
- DE66EE6508ABEE3400323D32 /* MappedFile.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = MappedFile.cpp; sourceTree = "<group>"; };
- DE66EE6608ABEE3400323D32 /* Memory.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Memory.cpp; sourceTree = "<group>"; };
- DE66EE6708ABEE3400323D32 /* Mutex.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Mutex.cpp; sourceTree = "<group>"; };
- DE66EE6808ABEE3400323D32 /* Path.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Path.cpp; sourceTree = "<group>"; };
- DE66EE6908ABEE3400323D32 /* Process.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Process.cpp; sourceTree = "<group>"; };
- DE66EE6A08ABEE3400323D32 /* Program.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Program.cpp; sourceTree = "<group>"; };
- DE66EE6B08ABEE3400323D32 /* README.txt */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = README.txt; sourceTree = "<group>"; };
- DE66EE7C08ABEE3400323D32 /* Signals.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Signals.cpp; sourceTree = "<group>"; };
- DE66EE7D08ABEE3400323D32 /* TimeValue.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = TimeValue.cpp; sourceTree = "<group>"; };
- DE66EE7F08ABEE3500323D32 /* MappedFile.inc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = MappedFile.inc; sourceTree = "<group>"; };
- DE66EE8008ABEE3500323D32 /* Memory.inc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = Memory.inc; sourceTree = "<group>"; };
- DE66EE8108ABEE3500323D32 /* Mutex.inc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = Mutex.inc; sourceTree = "<group>"; };
- DE66EE8208ABEE3500323D32 /* Path.inc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = Path.inc; sourceTree = "<group>"; };
- DE66EE8308ABEE3500323D32 /* Process.inc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = Process.inc; sourceTree = "<group>"; };
- DE66EE8408ABEE3500323D32 /* Program.inc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = Program.inc; sourceTree = "<group>"; };
- DE66EE8508ABEE3500323D32 /* README.txt */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = README.txt; sourceTree = "<group>"; };
- DE66EE8608ABEE3500323D32 /* Signals.inc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = Signals.inc; sourceTree = "<group>"; };
- DE66EE8908ABEE3500323D32 /* TimeValue.inc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = TimeValue.inc; sourceTree = "<group>"; };
- DE66EE8A08ABEE3500323D32 /* Unix.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Unix.h; sourceTree = "<group>"; };
- DE66EE8C08ABEE3500323D32 /* DynamicLibrary.inc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = DynamicLibrary.inc; sourceTree = "<group>"; };
- DE66EE8D08ABEE3500323D32 /* MappedFile.inc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = MappedFile.inc; sourceTree = "<group>"; };
- DE66EE8E08ABEE3500323D32 /* Memory.inc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = Memory.inc; sourceTree = "<group>"; };
- DE66EE8F08ABEE3500323D32 /* Mutex.inc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = Mutex.inc; sourceTree = "<group>"; };
- DE66EE9008ABEE3500323D32 /* Path.inc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = Path.inc; sourceTree = "<group>"; };
- DE66EE9108ABEE3500323D32 /* Process.inc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = Process.inc; sourceTree = "<group>"; };
- DE66EE9208ABEE3500323D32 /* Program.inc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = Program.inc; sourceTree = "<group>"; };
- DE66EE9308ABEE3500323D32 /* Signals.inc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = Signals.inc; sourceTree = "<group>"; };
- DE66EE9408ABEE3500323D32 /* TimeValue.inc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = TimeValue.inc; sourceTree = "<group>"; };
- DE66EE9508ABEE3500323D32 /* Win32.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Win32.h; sourceTree = "<group>"; };
- DE66EE9808ABEE5E00323D32 /* Alpha.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Alpha.h; sourceTree = "<group>"; };
- DE66EE9908ABEE5E00323D32 /* Alpha.td */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = Alpha.td; sourceTree = "<group>"; };
- DE66EE9A08ABEE5E00323D32 /* AlphaAsmPrinter.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = AlphaAsmPrinter.cpp; sourceTree = "<group>"; };
- DE66EE9B08ABEE5E00323D32 /* AlphaCodeEmitter.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = AlphaCodeEmitter.cpp; sourceTree = "<group>"; };
- DE66EEA308ABEE5E00323D32 /* AlphaInstrFormats.td */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = AlphaInstrFormats.td; sourceTree = "<group>"; };
- DE66EEA408ABEE5E00323D32 /* AlphaInstrInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = AlphaInstrInfo.cpp; sourceTree = "<group>"; };
- DE66EEA508ABEE5E00323D32 /* AlphaInstrInfo.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = AlphaInstrInfo.h; sourceTree = "<group>"; };
- DE66EEA608ABEE5E00323D32 /* AlphaInstrInfo.td */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = AlphaInstrInfo.td; sourceTree = "<group>"; };
- DE66EEA908ABEE5E00323D32 /* AlphaJITInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = AlphaJITInfo.cpp; sourceTree = "<group>"; };
- DE66EEAA08ABEE5E00323D32 /* AlphaJITInfo.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = AlphaJITInfo.h; sourceTree = "<group>"; };
- DE66EEAB08ABEE5E00323D32 /* AlphaRegisterInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = AlphaRegisterInfo.cpp; sourceTree = "<group>"; };
- DE66EEAC08ABEE5E00323D32 /* AlphaRegisterInfo.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = AlphaRegisterInfo.h; sourceTree = "<group>"; };
- DE66EEAD08ABEE5E00323D32 /* AlphaRegisterInfo.td */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = AlphaRegisterInfo.td; sourceTree = "<group>"; };
- DE66EEAE08ABEE5E00323D32 /* AlphaRelocations.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = AlphaRelocations.h; sourceTree = "<group>"; };
- DE66EEAF08ABEE5E00323D32 /* AlphaTargetMachine.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = AlphaTargetMachine.cpp; sourceTree = "<group>"; };
- DE66EEB008ABEE5E00323D32 /* AlphaTargetMachine.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = AlphaTargetMachine.h; sourceTree = "<group>"; };
- DE66EECA08ABEE5E00323D32 /* CTargetMachine.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = CTargetMachine.h; sourceTree = "<group>"; };
- DE66EEF808ABEE5E00323D32 /* IA64.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = IA64.h; sourceTree = "<group>"; };
- DE66EEF908ABEE5E00323D32 /* IA64.td */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = IA64.td; sourceTree = "<group>"; };
- DE66EEFA08ABEE5E00323D32 /* IA64AsmPrinter.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = IA64AsmPrinter.cpp; sourceTree = "<group>"; };
- DE66EF0108ABEE5E00323D32 /* IA64InstrBuilder.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = IA64InstrBuilder.h; sourceTree = "<group>"; };
- DE66EF0208ABEE5E00323D32 /* IA64InstrFormats.td */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = IA64InstrFormats.td; sourceTree = "<group>"; };
- DE66EF0308ABEE5E00323D32 /* IA64InstrInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = IA64InstrInfo.cpp; sourceTree = "<group>"; };
- DE66EF0408ABEE5E00323D32 /* IA64InstrInfo.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = IA64InstrInfo.h; sourceTree = "<group>"; };
- DE66EF0508ABEE5E00323D32 /* IA64InstrInfo.td */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = IA64InstrInfo.td; sourceTree = "<group>"; };
- DE66EF0708ABEE5E00323D32 /* IA64MachineFunctionInfo.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = IA64MachineFunctionInfo.h; sourceTree = "<group>"; };
- DE66EF0808ABEE5E00323D32 /* IA64RegisterInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = IA64RegisterInfo.cpp; sourceTree = "<group>"; };
- DE66EF0908ABEE5E00323D32 /* IA64RegisterInfo.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = IA64RegisterInfo.h; sourceTree = "<group>"; };
- DE66EF0A08ABEE5E00323D32 /* IA64RegisterInfo.td */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = IA64RegisterInfo.td; sourceTree = "<group>"; };
- DE66EF0B08ABEE5E00323D32 /* IA64TargetMachine.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = IA64TargetMachine.cpp; sourceTree = "<group>"; };
- DE66EF0C08ABEE5E00323D32 /* IA64TargetMachine.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = IA64TargetMachine.h; sourceTree = "<group>"; };
- DE66EF0E08ABEE5E00323D32 /* README */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = README; sourceTree = "<group>"; };
- DE66EF1008ABEE5E00323D32 /* TargetRegisterInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = TargetRegisterInfo.cpp; sourceTree = "<group>"; };
- DE66F08A08ABEE6000323D32 /* Target.td */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = Target.td; sourceTree = "<group>"; };
- DE66F08B08ABEE6000323D32 /* TargetData.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = TargetData.cpp; sourceTree = "<group>"; };
- DE66F08C08ABEE6000323D32 /* TargetFrameInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = TargetFrameInfo.cpp; sourceTree = "<group>"; };
- DE66F08D08ABEE6000323D32 /* TargetInstrInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = TargetInstrInfo.cpp; sourceTree = "<group>"; };
- DE66F08F08ABEE6000323D32 /* TargetMachine.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = TargetMachine.cpp; sourceTree = "<group>"; };
- DE66F09008ABEE6000323D32 /* TargetMachineRegistry.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = TargetMachineRegistry.cpp; sourceTree = "<group>"; };
- DE66F09208ABEE6000323D32 /* TargetSubtarget.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = TargetSubtarget.cpp; sourceTree = "<group>"; };
- DE66F0BC08ABEE6000323D32 /* X86.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = X86.h; sourceTree = "<group>"; };
- DE66F0BD08ABEE6000323D32 /* X86.td */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = X86.td; sourceTree = "<group>"; };
- DE66F0BE08ABEE6000323D32 /* X86AsmPrinter.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = X86AsmPrinter.cpp; sourceTree = "<group>"; };
- DE66F0BF08ABEE6000323D32 /* X86AsmPrinter.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = X86AsmPrinter.h; sourceTree = "<group>"; };
- DE66F0C008ABEE6000323D32 /* X86ATTAsmPrinter.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = X86ATTAsmPrinter.cpp; sourceTree = "<group>"; };
- DE66F0C108ABEE6000323D32 /* X86ATTAsmPrinter.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = X86ATTAsmPrinter.h; sourceTree = "<group>"; };
- DE66F0C208ABEE6000323D32 /* X86CodeEmitter.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = X86CodeEmitter.cpp; sourceTree = "<group>"; };
- DE66F0C408ABEE6000323D32 /* X86FloatingPoint.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = X86FloatingPoint.cpp; sourceTree = "<group>"; };
- DE66F0CC08ABEE6000323D32 /* X86InstrBuilder.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = X86InstrBuilder.h; sourceTree = "<group>"; };
- DE66F0CD08ABEE6000323D32 /* X86InstrInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = X86InstrInfo.cpp; sourceTree = "<group>"; };
- DE66F0CE08ABEE6000323D32 /* X86InstrInfo.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = X86InstrInfo.h; sourceTree = "<group>"; };
- DE66F0CF08ABEE6100323D32 /* X86InstrInfo.td */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = X86InstrInfo.td; sourceTree = "<group>"; };
- DE66F0D008ABEE6100323D32 /* X86IntelAsmPrinter.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = X86IntelAsmPrinter.cpp; sourceTree = "<group>"; };
- DE66F0D108ABEE6100323D32 /* X86IntelAsmPrinter.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = X86IntelAsmPrinter.h; sourceTree = "<group>"; };
- DE66F0D508ABEE6100323D32 /* X86JITInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = X86JITInfo.cpp; sourceTree = "<group>"; };
- DE66F0D608ABEE6100323D32 /* X86JITInfo.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = X86JITInfo.h; sourceTree = "<group>"; };
- DE66F0D808ABEE6100323D32 /* X86RegisterInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = X86RegisterInfo.cpp; sourceTree = "<group>"; };
- DE66F0D908ABEE6100323D32 /* X86RegisterInfo.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = X86RegisterInfo.h; sourceTree = "<group>"; };
- DE66F0DA08ABEE6100323D32 /* X86RegisterInfo.td */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = X86RegisterInfo.td; sourceTree = "<group>"; };
- DE66F0DB08ABEE6100323D32 /* X86Relocations.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = X86Relocations.h; sourceTree = "<group>"; };
- DE66F0DC08ABEE6100323D32 /* X86Subtarget.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = X86Subtarget.cpp; sourceTree = "<group>"; };
- DE66F0DD08ABEE6100323D32 /* X86Subtarget.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = X86Subtarget.h; sourceTree = "<group>"; };
- DE66F0DE08ABEE6100323D32 /* X86TargetMachine.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = X86TargetMachine.cpp; sourceTree = "<group>"; };
- DE66F0DF08ABEE6100323D32 /* X86TargetMachine.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = X86TargetMachine.h; sourceTree = "<group>"; };
- DE66F0EF08ABEFB300323D32 /* BlockProfiling.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = BlockProfiling.cpp; sourceTree = "<group>"; };
- DE66F0FE08ABEFB300323D32 /* EdgeProfiling.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = EdgeProfiling.cpp; sourceTree = "<group>"; };
- DE66F11B08ABEFB300323D32 /* ProfilingUtils.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = ProfilingUtils.cpp; sourceTree = "<group>"; };
- DE66F11C08ABEFB300323D32 /* ProfilingUtils.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = ProfilingUtils.h; sourceTree = "<group>"; };
- DE66F12008ABEFB300323D32 /* ArgumentPromotion.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = ArgumentPromotion.cpp; sourceTree = "<group>"; };
- DE66F12108ABEFB300323D32 /* ConstantMerge.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = ConstantMerge.cpp; sourceTree = "<group>"; };
- DE66F12208ABEFB300323D32 /* DeadArgumentElimination.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = DeadArgumentElimination.cpp; sourceTree = "<group>"; };
- DE66F12308ABEFB300323D32 /* DeadTypeElimination.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = DeadTypeElimination.cpp; sourceTree = "<group>"; };
- DE66F14C08ABEFB400323D32 /* GlobalDCE.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = GlobalDCE.cpp; sourceTree = "<group>"; };
- DE66F14D08ABEFB400323D32 /* GlobalOpt.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = GlobalOpt.cpp; sourceTree = "<group>"; };
- DE66F14E08ABEFB400323D32 /* Inliner.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Inliner.cpp; sourceTree = "<group>"; };
- DE66F15008ABEFB400323D32 /* InlineSimple.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = InlineSimple.cpp; sourceTree = "<group>"; };
- DE66F15108ABEFB400323D32 /* Internalize.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Internalize.cpp; sourceTree = "<group>"; };
- DE66F15208ABEFB400323D32 /* IPConstantPropagation.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = IPConstantPropagation.cpp; sourceTree = "<group>"; };
- DE66F15308ABEFB400323D32 /* LoopExtractor.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = LoopExtractor.cpp; sourceTree = "<group>"; };
- DE66F15408ABEFB400323D32 /* LowerSetJmp.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = LowerSetJmp.cpp; sourceTree = "<group>"; };
- DE66F15608ABEFB400323D32 /* PruneEH.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = PruneEH.cpp; sourceTree = "<group>"; };
- DE66F15708ABEFB400323D32 /* RaiseAllocations.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = RaiseAllocations.cpp; sourceTree = "<group>"; };
- DE66F15808ABEFB400323D32 /* SimplifyLibCalls.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = SimplifyLibCalls.cpp; sourceTree = "<group>"; };
- DE66F15908ABEFB400323D32 /* StripSymbols.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = StripSymbols.cpp; sourceTree = "<group>"; };
- DE66F15E08ABEFB400323D32 /* ADCE.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = ADCE.cpp; sourceTree = "<group>"; };
- DE66F15F08ABEFB400323D32 /* BasicBlockPlacement.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = BasicBlockPlacement.cpp; sourceTree = "<group>"; };
- DE66F16008ABEFB400323D32 /* CondPropagate.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = CondPropagate.cpp; sourceTree = "<group>"; };
- DE66F16108ABEFB400323D32 /* ConstantProp.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = ConstantProp.cpp; sourceTree = "<group>"; };
- DE66F16308ABEFB400323D32 /* DCE.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = DCE.cpp; sourceTree = "<group>"; };
- DE66F16408ABEFB400323D32 /* DeadStoreElimination.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = DeadStoreElimination.cpp; sourceTree = "<group>"; };
- DE66F1A308ABEFB400323D32 /* GCSE.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = GCSE.cpp; sourceTree = "<group>"; };
- DE66F1A408ABEFB400323D32 /* IndVarSimplify.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = IndVarSimplify.cpp; sourceTree = "<group>"; };
- DE66F1A508ABEFB400323D32 /* InstructionCombining.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = InstructionCombining.cpp; sourceTree = "<group>"; };
- DE66F1A608ABEFB400323D32 /* LICM.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = LICM.cpp; sourceTree = "<group>"; };
- DE66F1A808ABEFB400323D32 /* LoopStrengthReduce.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = LoopStrengthReduce.cpp; sourceTree = "<group>"; };
- DE66F1A908ABEFB400323D32 /* LoopUnroll.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = LoopUnroll.cpp; sourceTree = "<group>"; };
- DE66F1AA08ABEFB400323D32 /* LoopUnswitch.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = LoopUnswitch.cpp; sourceTree = "<group>"; };
- DE66F1B508ABEFB400323D32 /* Reassociate.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Reassociate.cpp; sourceTree = "<group>"; };
- DE66F1B608ABEFB400323D32 /* ScalarReplAggregates.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = ScalarReplAggregates.cpp; sourceTree = "<group>"; };
- DE66F1B708ABEFB400323D32 /* SCCP.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = SCCP.cpp; sourceTree = "<group>"; };
- DE66F1B808ABEFB400323D32 /* SimplifyCFG.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = SimplifyCFG.cpp; sourceTree = "<group>"; };
- DE66F1B908ABEFB400323D32 /* TailDuplication.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = TailDuplication.cpp; sourceTree = "<group>"; };
- DE66F1BA08ABEFB400323D32 /* TailRecursionElimination.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = TailRecursionElimination.cpp; sourceTree = "<group>"; };
- DE66F1BE08ABEFB400323D32 /* BasicBlockUtils.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = BasicBlockUtils.cpp; sourceTree = "<group>"; };
- DE66F1BF08ABEFB400323D32 /* BreakCriticalEdges.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = BreakCriticalEdges.cpp; sourceTree = "<group>"; };
- DE66F1C008ABEFB400323D32 /* CloneFunction.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = CloneFunction.cpp; sourceTree = "<group>"; };
- DE66F1C108ABEFB400323D32 /* CloneModule.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = CloneModule.cpp; sourceTree = "<group>"; };
- DE66F1C208ABEFB400323D32 /* CloneTrace.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = CloneTrace.cpp; sourceTree = "<group>"; };
- DE66F1C308ABEFB400323D32 /* CodeExtractor.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = CodeExtractor.cpp; sourceTree = "<group>"; };
- DE66F1E008ABEFB400323D32 /* DemoteRegToStack.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = DemoteRegToStack.cpp; sourceTree = "<group>"; };
- DE66F1E108ABEFB400323D32 /* InlineFunction.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = InlineFunction.cpp; sourceTree = "<group>"; };
- DE66F1E208ABEFB400323D32 /* Local.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Local.cpp; sourceTree = "<group>"; };
- DE66F1E408ABEFB400323D32 /* PromoteMemoryToRegister.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = PromoteMemoryToRegister.cpp; sourceTree = "<group>"; };
- DE66F1E508ABEFB400323D32 /* SimplifyCFG.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = SimplifyCFG.cpp; sourceTree = "<group>"; };
- DE66F1E608ABEFB400323D32 /* UnifyFunctionExitNodes.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = UnifyFunctionExitNodes.cpp; sourceTree = "<group>"; };
- DE66F1E708ABEFB400323D32 /* ValueMapper.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = ValueMapper.cpp; sourceTree = "<group>"; };
- DE66F1EA08ABF03100323D32 /* AbstractTypeUser.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = AbstractTypeUser.h; sourceTree = "<group>"; };
- DE66F1EE08ABF03100323D32 /* DenseMap.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DenseMap.h; sourceTree = "<group>"; };
- DE66F1EF08ABF03100323D32 /* DepthFirstIterator.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DepthFirstIterator.h; sourceTree = "<group>"; };
- DE66F1F008ABF03100323D32 /* EquivalenceClasses.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = EquivalenceClasses.h; sourceTree = "<group>"; };
- DE66F1F108ABF03100323D32 /* GraphTraits.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = GraphTraits.h; sourceTree = "<group>"; };
- DE66F1F308ABF03100323D32 /* hash_map.in */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = hash_map.in; sourceTree = "<group>"; };
- DE66F1F508ABF03100323D32 /* hash_set.in */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = hash_set.in; sourceTree = "<group>"; };
- DE66F1F608ABF03100323D32 /* HashExtras.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = HashExtras.h; sourceTree = "<group>"; };
- DE66F1F708ABF03100323D32 /* ilist */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = ilist; sourceTree = "<group>"; };
- DE66F1F908ABF03100323D32 /* iterator.in */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = iterator.in; sourceTree = "<group>"; };
- DE66F1FA08ABF03100323D32 /* PostOrderIterator.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = PostOrderIterator.h; sourceTree = "<group>"; };
- DE66F1FB08ABF03100323D32 /* SCCIterator.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SCCIterator.h; sourceTree = "<group>"; };
- DE66F1FC08ABF03100323D32 /* SetOperations.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SetOperations.h; sourceTree = "<group>"; };
- DE66F1FD08ABF03100323D32 /* SetVector.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SetVector.h; sourceTree = "<group>"; };
- DE66F1FE08ABF03100323D32 /* Statistic.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Statistic.h; sourceTree = "<group>"; };
- DE66F1FF08ABF03100323D32 /* STLExtras.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = STLExtras.h; sourceTree = "<group>"; };
- DE66F20008ABF03100323D32 /* StringExtras.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = StringExtras.h; sourceTree = "<group>"; };
- DE66F20108ABF03100323D32 /* Tree.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Tree.h; sourceTree = "<group>"; };
- DE66F20208ABF03100323D32 /* VectorExtras.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = VectorExtras.h; sourceTree = "<group>"; };
- DE66F20408ABF03100323D32 /* AliasAnalysis.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = AliasAnalysis.h; sourceTree = "<group>"; };
- DE66F20508ABF03100323D32 /* AliasSetTracker.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = AliasSetTracker.h; sourceTree = "<group>"; };
- DE66F20608ABF03100323D32 /* CallGraph.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = CallGraph.h; sourceTree = "<group>"; };
- DE66F20708ABF03100323D32 /* CFGPrinter.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = CFGPrinter.h; sourceTree = "<group>"; };
- DE66F20808ABF03100323D32 /* ConstantsScanner.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = ConstantsScanner.h; sourceTree = "<group>"; };
- DE66F20F08ABF03100323D32 /* Dominators.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Dominators.h; sourceTree = "<group>"; };
- DE66F21208ABF03100323D32 /* FindUsedTypes.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = FindUsedTypes.h; sourceTree = "<group>"; };
- DE66F21308ABF03100323D32 /* Interval.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Interval.h; sourceTree = "<group>"; };
- DE66F21408ABF03100323D32 /* IntervalIterator.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = IntervalIterator.h; sourceTree = "<group>"; };
- DE66F21508ABF03100323D32 /* IntervalPartition.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = IntervalPartition.h; sourceTree = "<group>"; };
- DE66F21608ABF03100323D32 /* LoadValueNumbering.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = LoadValueNumbering.h; sourceTree = "<group>"; };
- DE66F21708ABF03100323D32 /* LoopInfo.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = LoopInfo.h; sourceTree = "<group>"; };
- DE66F21808ABF03100323D32 /* Passes.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Passes.h; sourceTree = "<group>"; };
- DE66F21908ABF03100323D32 /* PostDominators.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = PostDominators.h; sourceTree = "<group>"; };
- DE66F21A08ABF03100323D32 /* ProfileInfo.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = ProfileInfo.h; sourceTree = "<group>"; };
- DE66F21B08ABF03100323D32 /* ProfileInfoLoader.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = ProfileInfoLoader.h; sourceTree = "<group>"; };
- DE66F21C08ABF03100323D32 /* ProfileInfoTypes.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = ProfileInfoTypes.h; sourceTree = "<group>"; };
- DE66F21D08ABF03100323D32 /* ScalarEvolution.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = ScalarEvolution.h; sourceTree = "<group>"; };
- DE66F21E08ABF03100323D32 /* ScalarEvolutionExpander.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = ScalarEvolutionExpander.h; sourceTree = "<group>"; };
- DE66F21F08ABF03100323D32 /* ScalarEvolutionExpressions.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = ScalarEvolutionExpressions.h; sourceTree = "<group>"; };
- DE66F22008ABF03100323D32 /* Trace.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Trace.h; sourceTree = "<group>"; };
- DE66F22108ABF03100323D32 /* ValueNumbering.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = ValueNumbering.h; sourceTree = "<group>"; };
- DE66F22208ABF03100323D32 /* Verifier.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Verifier.h; sourceTree = "<group>"; };
- DE66F22308ABF03100323D32 /* Argument.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Argument.h; sourceTree = "<group>"; };
- DE66F22508ABF03100323D32 /* AsmAnnotationWriter.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = AsmAnnotationWriter.h; sourceTree = "<group>"; };
- DE66F22708ABF03100323D32 /* Parser.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Parser.h; sourceTree = "<group>"; };
- DE66F22808ABF03100323D32 /* PrintModulePass.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = PrintModulePass.h; sourceTree = "<group>"; };
- DE66F22908ABF03100323D32 /* Writer.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Writer.h; sourceTree = "<group>"; };
- DE66F22A08ABF03100323D32 /* BasicBlock.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = BasicBlock.h; sourceTree = "<group>"; };
- DE66F23308ABF03100323D32 /* CallGraphSCCPass.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = CallGraphSCCPass.h; sourceTree = "<group>"; };
- DE66F23408ABF03100323D32 /* CallingConv.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = CallingConv.h; sourceTree = "<group>"; };
- DE66F23608ABF03100323D32 /* AsmPrinter.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = AsmPrinter.h; sourceTree = "<group>"; };
- DE66F23908ABF03100323D32 /* IntrinsicLowering.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = IntrinsicLowering.h; sourceTree = "<group>"; };
- DE66F23A08ABF03100323D32 /* LiveVariables.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = LiveVariables.h; sourceTree = "<group>"; };
- DE66F23B08ABF03100323D32 /* MachineBasicBlock.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = MachineBasicBlock.h; sourceTree = "<group>"; };
- DE66F23C08ABF03100323D32 /* MachineCodeEmitter.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = MachineCodeEmitter.h; sourceTree = "<group>"; };
- DE66F23D08ABF03100323D32 /* MachineConstantPool.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = MachineConstantPool.h; sourceTree = "<group>"; };
- DE66F23E08ABF03100323D32 /* MachineFrameInfo.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = MachineFrameInfo.h; sourceTree = "<group>"; };
- DE66F23F08ABF03100323D32 /* MachineFunction.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = MachineFunction.h; sourceTree = "<group>"; };
- DE66F24008ABF03100323D32 /* MachineFunctionPass.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = MachineFunctionPass.h; sourceTree = "<group>"; };
- DE66F24108ABF03100323D32 /* MachineInstr.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = MachineInstr.h; sourceTree = "<group>"; };
- DE66F24208ABF03100323D32 /* MachineInstrBuilder.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = MachineInstrBuilder.h; sourceTree = "<group>"; };
- DE66F24308ABF03100323D32 /* MachineRelocation.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = MachineRelocation.h; sourceTree = "<group>"; };
- DE66F24408ABF03100323D32 /* Passes.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Passes.h; sourceTree = "<group>"; };
- DE66F24508ABF03100323D32 /* SchedGraphCommon.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SchedGraphCommon.h; sourceTree = "<group>"; };
- DE66F24608ABF03100323D32 /* SelectionDAG.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SelectionDAG.h; sourceTree = "<group>"; };
- DE66F24708ABF03100323D32 /* SelectionDAGISel.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SelectionDAGISel.h; sourceTree = "<group>"; };
- DE66F24808ABF03100323D32 /* SelectionDAGNodes.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SelectionDAGNodes.h; sourceTree = "<group>"; };
- DE66F24B08ABF03100323D32 /* ValueTypes.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = ValueTypes.h; sourceTree = "<group>"; };
- DE66F24E08ABF03100323D32 /* alloca.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = alloca.h; sourceTree = "<group>"; };
- DE66F25008ABF03100323D32 /* config.h.in */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = config.h.in; sourceTree = "<group>"; };
- DE66F25108ABF03100323D32 /* Constant.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Constant.h; sourceTree = "<group>"; };
- DE66F25208ABF03100323D32 /* Constants.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Constants.h; sourceTree = "<group>"; };
- DE66F25408ABF03100323D32 /* Debugger.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Debugger.h; sourceTree = "<group>"; };
- DE66F25508ABF03100323D32 /* InferiorProcess.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = InferiorProcess.h; sourceTree = "<group>"; };
- DE66F25608ABF03100323D32 /* ProgramInfo.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = ProgramInfo.h; sourceTree = "<group>"; };
- DE66F25708ABF03100323D32 /* RuntimeInfo.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = RuntimeInfo.h; sourceTree = "<group>"; };
- DE66F25808ABF03100323D32 /* SourceFile.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SourceFile.h; sourceTree = "<group>"; };
- DE66F25908ABF03100323D32 /* SourceLanguage.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SourceLanguage.h; sourceTree = "<group>"; };
- DE66F25A08ABF03100323D32 /* DerivedTypes.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DerivedTypes.h; sourceTree = "<group>"; };
- DE66F25C08ABF03100323D32 /* ExecutionEngine.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = ExecutionEngine.h; sourceTree = "<group>"; };
- DE66F25D08ABF03100323D32 /* GenericValue.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = GenericValue.h; sourceTree = "<group>"; };
- DE66F25E08ABF03100323D32 /* Function.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Function.h; sourceTree = "<group>"; };
- DE66F25F08ABF03100323D32 /* GlobalValue.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = GlobalValue.h; sourceTree = "<group>"; };
- DE66F26008ABF03100323D32 /* GlobalVariable.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = GlobalVariable.h; sourceTree = "<group>"; };
- DE66F26108ABF03100323D32 /* InstrTypes.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = InstrTypes.h; sourceTree = "<group>"; };
- DE66F26208ABF03100323D32 /* Instruction.def */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = Instruction.def; sourceTree = "<group>"; };
- DE66F26308ABF03100323D32 /* Instruction.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Instruction.h; sourceTree = "<group>"; };
- DE66F26408ABF03100323D32 /* Instructions.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Instructions.h; sourceTree = "<group>"; };
- DE66F26508ABF03100323D32 /* IntrinsicInst.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = IntrinsicInst.h; sourceTree = "<group>"; };
- DE66F26608ABF03100323D32 /* Intrinsics.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Intrinsics.h; sourceTree = "<group>"; };
- DE66F26708ABF03100323D32 /* Linker.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Linker.h; sourceTree = "<group>"; };
- DE66F26808ABF03100323D32 /* Module.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Module.h; sourceTree = "<group>"; };
- DE66F26908ABF03200323D32 /* ModuleProvider.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = ModuleProvider.h; sourceTree = "<group>"; };
- DE66F26A08ABF03200323D32 /* Pass.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Pass.h; sourceTree = "<group>"; };
- DE66F26B08ABF03200323D32 /* PassAnalysisSupport.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = PassAnalysisSupport.h; sourceTree = "<group>"; };
- DE66F26C08ABF03200323D32 /* PassManager.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = PassManager.h; sourceTree = "<group>"; };
- DE66F26D08ABF03200323D32 /* PassSupport.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = PassSupport.h; sourceTree = "<group>"; };
- DE66F27008ABF03200323D32 /* AIXDataTypesFix.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = AIXDataTypesFix.h; sourceTree = "<group>"; };
- DE66F27108ABF03200323D32 /* Annotation.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Annotation.h; sourceTree = "<group>"; };
- DE66F27208ABF03200323D32 /* CallSite.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = CallSite.h; sourceTree = "<group>"; };
- DE66F27308ABF03200323D32 /* Casting.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Casting.h; sourceTree = "<group>"; };
- DE66F27408ABF03200323D32 /* CFG.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = CFG.h; sourceTree = "<group>"; };
- DE66F27508ABF03200323D32 /* CommandLine.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = CommandLine.h; sourceTree = "<group>"; };
- DE66F27708ABF03200323D32 /* ConstantRange.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = ConstantRange.h; sourceTree = "<group>"; };
- DE66F27908ABF03200323D32 /* DataTypes.h.in */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = DataTypes.h.in; sourceTree = "<group>"; };
- DE66F27A08ABF03200323D32 /* Debug.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Debug.h; sourceTree = "<group>"; };
- DE66F27B08ABF03200323D32 /* DOTGraphTraits.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DOTGraphTraits.h; sourceTree = "<group>"; };
- DE66F27C08ABF03200323D32 /* DynamicLinker.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DynamicLinker.h; sourceTree = "<group>"; };
- DE66F27D08ABF03200323D32 /* ELF.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = ELF.h; sourceTree = "<group>"; };
- DE66F27E08ABF03200323D32 /* FileUtilities.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = FileUtilities.h; sourceTree = "<group>"; };
- DE66F27F08ABF03200323D32 /* GetElementPtrTypeIterator.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = GetElementPtrTypeIterator.h; sourceTree = "<group>"; };
- DE66F28008ABF03200323D32 /* GraphWriter.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = GraphWriter.h; sourceTree = "<group>"; };
- DE66F28108ABF03200323D32 /* InstIterator.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = InstIterator.h; sourceTree = "<group>"; };
- DE66F28208ABF03200323D32 /* InstVisitor.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = InstVisitor.h; sourceTree = "<group>"; };
- DE66F28308ABF03200323D32 /* LeakDetector.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = LeakDetector.h; sourceTree = "<group>"; };
- DE66F28408ABF03200323D32 /* Mangler.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Mangler.h; sourceTree = "<group>"; };
- DE66F28508ABF03200323D32 /* MathExtras.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = MathExtras.h; sourceTree = "<group>"; };
- DE66F28608ABF03200323D32 /* MutexGuard.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = MutexGuard.h; sourceTree = "<group>"; };
- DE66F28708ABF03200323D32 /* PassNameParser.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = PassNameParser.h; sourceTree = "<group>"; };
- DE66F28808ABF03200323D32 /* PatternMatch.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = PatternMatch.h; sourceTree = "<group>"; };
- DE66F28908ABF03200323D32 /* PluginLoader.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = PluginLoader.h; sourceTree = "<group>"; };
- DE66F28A08ABF03200323D32 /* SlowOperationInformer.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SlowOperationInformer.h; sourceTree = "<group>"; };
- DE66F28B08ABF03200323D32 /* StableBasicBlockNumbering.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = StableBasicBlockNumbering.h; sourceTree = "<group>"; };
- DE66F28C08ABF03200323D32 /* SystemUtils.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SystemUtils.h; sourceTree = "<group>"; };
- DE66F28E08ABF03200323D32 /* Timer.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Timer.h; sourceTree = "<group>"; };
- DE66F29008ABF03200323D32 /* type_traits.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = type_traits.h; sourceTree = "<group>"; };
- DE66F29308ABF03200323D32 /* SymbolTableListTraits.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SymbolTableListTraits.h; sourceTree = "<group>"; };
- DE66F29508ABF03200323D32 /* DynamicLibrary.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DynamicLibrary.h; sourceTree = "<group>"; };
- DE66F29608ABF03200323D32 /* LICENSE.TXT */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = LICENSE.TXT; sourceTree = "<group>"; };
- DE66F29708ABF03200323D32 /* MappedFile.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = MappedFile.h; sourceTree = "<group>"; };
- DE66F29808ABF03200323D32 /* Memory.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Memory.h; sourceTree = "<group>"; };
- DE66F29908ABF03200323D32 /* Mutex.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Mutex.h; sourceTree = "<group>"; };
- DE66F29A08ABF03200323D32 /* Path.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Path.h; sourceTree = "<group>"; };
- DE66F29B08ABF03200323D32 /* Process.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Process.h; sourceTree = "<group>"; };
- DE66F29C08ABF03200323D32 /* Program.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Program.h; sourceTree = "<group>"; };
- DE66F29D08ABF03200323D32 /* Signals.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Signals.h; sourceTree = "<group>"; };
- DE66F29E08ABF03200323D32 /* TimeValue.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = TimeValue.h; sourceTree = "<group>"; };
- DE66F2A008ABF03200323D32 /* TargetRegisterInfo.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = TargetRegisterInfo.h; sourceTree = "<group>"; };
- DE66F2A108ABF03200323D32 /* TargetData.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = TargetData.h; sourceTree = "<group>"; };
- DE66F2A208ABF03200323D32 /* TargetFrameInfo.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = TargetFrameInfo.h; sourceTree = "<group>"; };
- DE66F2A308ABF03200323D32 /* TargetInstrInfo.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = TargetInstrInfo.h; sourceTree = "<group>"; };
- DE66F2A408ABF03200323D32 /* TargetJITInfo.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = TargetJITInfo.h; sourceTree = "<group>"; };
- DE66F2A508ABF03200323D32 /* TargetLowering.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = TargetLowering.h; sourceTree = "<group>"; };
- DE66F2A608ABF03200323D32 /* TargetMachine.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = TargetMachine.h; sourceTree = "<group>"; };
- DE66F2A708ABF03200323D32 /* TargetMachineRegistry.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = TargetMachineRegistry.h; sourceTree = "<group>"; };
- DE66F2A808ABF03200323D32 /* TargetOptions.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = TargetOptions.h; sourceTree = "<group>"; };
- DE66F2AA08ABF03200323D32 /* TargetSubtarget.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = TargetSubtarget.h; sourceTree = "<group>"; };
- DE66F2AC08ABF03200323D32 /* Instrumentation.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Instrumentation.h; sourceTree = "<group>"; };
- DE66F2AD08ABF03200323D32 /* IPO.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = IPO.h; sourceTree = "<group>"; };
- DE66F2AF08ABF03200323D32 /* Scalar.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Scalar.h; sourceTree = "<group>"; };
- DE66F2B108ABF03200323D32 /* BasicBlockUtils.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = BasicBlockUtils.h; sourceTree = "<group>"; };
- DE66F2B208ABF03200323D32 /* Cloning.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Cloning.h; sourceTree = "<group>"; };
- DE66F2B308ABF03200323D32 /* FunctionUtils.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = FunctionUtils.h; sourceTree = "<group>"; };
- DE66F2B408ABF03200323D32 /* Local.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Local.h; sourceTree = "<group>"; };
- DE66F2B508ABF03200323D32 /* PromoteMemToReg.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = PromoteMemToReg.h; sourceTree = "<group>"; };
- DE66F2B608ABF03200323D32 /* UnifyFunctionExitNodes.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = UnifyFunctionExitNodes.h; sourceTree = "<group>"; };
- DE66F2B708ABF03200323D32 /* Type.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Type.h; sourceTree = "<group>"; };
- DE66F2B808ABF03200323D32 /* Use.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Use.h; sourceTree = "<group>"; };
- DE66F2B908ABF03200323D32 /* User.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = User.h; sourceTree = "<group>"; };
- DE66F2BA08ABF03200323D32 /* Value.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Value.h; sourceTree = "<group>"; };
- DE66F2CC08ABF14400323D32 /* BugDriver.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = BugDriver.cpp; sourceTree = "<group>"; };
- DE66F2CD08ABF14400323D32 /* BugDriver.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = BugDriver.h; sourceTree = "<group>"; };
- DE66F2CE08ABF14400323D32 /* bugpoint.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = bugpoint.cpp; sourceTree = "<group>"; };
- DE66F2CF08ABF14400323D32 /* CrashDebugger.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = CrashDebugger.cpp; sourceTree = "<group>"; };
- DE66F2E208ABF14400323D32 /* ExecutionDriver.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = ExecutionDriver.cpp; sourceTree = "<group>"; };
- DE66F2E308ABF14400323D32 /* ExtractFunction.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = ExtractFunction.cpp; sourceTree = "<group>"; };
- DE66F2E408ABF14400323D32 /* ListReducer.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = ListReducer.h; sourceTree = "<group>"; };
- DE66F2E608ABF14400323D32 /* Miscompilation.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Miscompilation.cpp; sourceTree = "<group>"; };
- DE66F2E708ABF14400323D32 /* OptimizerDriver.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = OptimizerDriver.cpp; sourceTree = "<group>"; };
- DE66F2E808ABF14400323D32 /* TestPasses.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = TestPasses.cpp; sourceTree = "<group>"; };
- DE66F30008ABF14400323D32 /* llc.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = llc.cpp; path = llc/llc.cpp; sourceTree = "<group>"; };
- DE66F30708ABF14400323D32 /* lli.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = lli.cpp; path = lli/lli.cpp; sourceTree = "<group>"; };
- DE66F30E08ABF14400323D32 /* llvm-ar.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = "llvm-ar.cpp"; path = "llvm-ar/llvm-ar.cpp"; sourceTree = "<group>"; };
- DE66F31508ABF14400323D32 /* llvm-as.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = "llvm-as.cpp"; path = "llvm-as/llvm-as.cpp"; sourceTree = "<group>"; };
- DE66F31C08ABF14400323D32 /* llvm-bcanalyzer.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = "llvm-bcanalyzer.cpp"; path = "llvm-bcanalyzer/llvm-bcanalyzer.cpp"; sourceTree = "<group>"; };
- DE66F31F08ABF14400323D32 /* CLICommand.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = CLICommand.h; sourceTree = "<group>"; };
- DE66F32008ABF14400323D32 /* CLIDebugger.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = CLIDebugger.cpp; sourceTree = "<group>"; };
- DE66F32108ABF14400323D32 /* CLIDebugger.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = CLIDebugger.h; sourceTree = "<group>"; };
- DE66F32208ABF14400323D32 /* Commands.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Commands.cpp; sourceTree = "<group>"; };
- DE66F32B08ABF14400323D32 /* llvm-db.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = "llvm-db.cpp"; sourceTree = "<group>"; };
- DE66F33208ABF14400323D32 /* llvm-dis.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = "llvm-dis.cpp"; path = "llvm-dis/llvm-dis.cpp"; sourceTree = "<group>"; };
- DE66F33908ABF14400323D32 /* llvm-extract.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = "llvm-extract.cpp"; path = "llvm-extract/llvm-extract.cpp"; sourceTree = "<group>"; };
- DE66F34208ABF14400323D32 /* llvm-ld.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = "llvm-ld.cpp"; sourceTree = "<group>"; };
- DE66F34408ABF14400323D32 /* Optimize.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Optimize.cpp; sourceTree = "<group>"; };
- DE66F34A08ABF14400323D32 /* llvm-link.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = "llvm-link.cpp"; path = "llvm-link/llvm-link.cpp"; sourceTree = "<group>"; };
- DE66F35108ABF14400323D32 /* llvm-nm.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = "llvm-nm.cpp"; path = "llvm-nm/llvm-nm.cpp"; sourceTree = "<group>"; };
- DE66F35808ABF14500323D32 /* llvm-prof.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = "llvm-prof.cpp"; path = "llvm-prof/llvm-prof.cpp"; sourceTree = "<group>"; };
- DE66F35F08ABF14500323D32 /* llvm-ranlib.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = "llvm-ranlib.cpp"; path = "llvm-ranlib/llvm-ranlib.cpp"; sourceTree = "<group>"; };
- DE66F36908ABF14500323D32 /* c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = c; sourceTree = "<group>"; };
- DE66F36A08ABF14500323D32 /* CompilerDriver.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = CompilerDriver.cpp; sourceTree = "<group>"; };
- DE66F36B08ABF14500323D32 /* CompilerDriver.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = CompilerDriver.h; sourceTree = "<group>"; };
- DE66F36D08ABF14500323D32 /* ConfigLexer.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = ConfigLexer.h; sourceTree = "<group>"; };
- DE66F36E08ABF14500323D32 /* ConfigLexer.l */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.lex; path = ConfigLexer.l; sourceTree = "<group>"; };
- DE66F36F08ABF14500323D32 /* Configuration.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Configuration.cpp; sourceTree = "<group>"; };
- DE66F37008ABF14500323D32 /* Configuration.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Configuration.h; sourceTree = "<group>"; };
- DE66F37108ABF14500323D32 /* cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = cpp; sourceTree = "<group>"; };
- DE66F37D08ABF14500323D32 /* ll */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = ll; sourceTree = "<group>"; };
- DE66F37E08ABF14500323D32 /* llvmc.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llvmc.cpp; sourceTree = "<group>"; };
- DE66F38C08ABF35300323D32 /* CREDITS.TXT */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; name = CREDITS.TXT; path = ../CREDITS.TXT; sourceTree = SOURCE_ROOT; };
- DE66F38F08ABF35C00323D32 /* AliasAnalysis.html */ = {isa = PBXFileReference; explicitFileType = text.html.documentation; fileEncoding = 30; path = AliasAnalysis.html; sourceTree = "<group>"; };
- DE66F39008ABF35C00323D32 /* Bugpoint.html */ = {isa = PBXFileReference; explicitFileType = text.html.documentation; fileEncoding = 30; path = Bugpoint.html; sourceTree = "<group>"; };
- DE66F39208ABF35C00323D32 /* GCCFEBuildInstrs.html */ = {isa = PBXFileReference; explicitFileType = text.html.documentation; fileEncoding = 30; path = GCCFEBuildInstrs.html; sourceTree = "<group>"; };
- DE66F39308ABF35C00323D32 /* CodeGenerator.html */ = {isa = PBXFileReference; explicitFileType = text.html.documentation; fileEncoding = 30; path = CodeGenerator.html; sourceTree = "<group>"; };
- DE66F39408ABF35C00323D32 /* CodingStandards.html */ = {isa = PBXFileReference; explicitFileType = text.html.documentation; fileEncoding = 30; path = CodingStandards.html; sourceTree = "<group>"; };
- DE66F39808ABF35C00323D32 /* bugpoint.pod */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = bugpoint.pod; sourceTree = "<group>"; };
- DE66F39E08ABF35C00323D32 /* index.html */ = {isa = PBXFileReference; explicitFileType = text.html.documentation; fileEncoding = 30; path = index.html; sourceTree = "<group>"; };
- DE66F39F08ABF35C00323D32 /* llc.pod */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = llc.pod; sourceTree = "<group>"; };
- DE66F3A008ABF35C00323D32 /* lli.pod */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = lli.pod; sourceTree = "<group>"; };
- DE66F3A108ABF35C00323D32 /* llvm-ar.pod */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = "llvm-ar.pod"; sourceTree = "<group>"; };
- DE66F3A208ABF35C00323D32 /* llvm-as.pod */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = "llvm-as.pod"; sourceTree = "<group>"; };
- DE66F3A308ABF35C00323D32 /* llvm-bcanalyzer.pod */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = "llvm-bcanalyzer.pod"; sourceTree = "<group>"; };
- DE66F3A408ABF35C00323D32 /* llvm-db.pod */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = "llvm-db.pod"; sourceTree = "<group>"; };
- DE66F3A508ABF35C00323D32 /* llvm-dis.pod */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = "llvm-dis.pod"; sourceTree = "<group>"; };
- DE66F3A608ABF35C00323D32 /* llvm-extract.pod */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = "llvm-extract.pod"; sourceTree = "<group>"; };
- DE66F3A708ABF35C00323D32 /* llvm-ld.pod */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = "llvm-ld.pod"; sourceTree = "<group>"; };
- DE66F3A808ABF35C00323D32 /* llvm-link.pod */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = "llvm-link.pod"; sourceTree = "<group>"; };
- DE66F3A908ABF35C00323D32 /* llvm-nm.pod */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = "llvm-nm.pod"; sourceTree = "<group>"; };
- DE66F3AA08ABF35C00323D32 /* llvm-prof.pod */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = "llvm-prof.pod"; sourceTree = "<group>"; };
- DE66F3AB08ABF35C00323D32 /* llvm-ranlib.pod */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = "llvm-ranlib.pod"; sourceTree = "<group>"; };
- DE66F3AC08ABF35C00323D32 /* llvmc.pod */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = llvmc.pod; sourceTree = "<group>"; };
- DE66F3AD08ABF35C00323D32 /* llvmgcc.pod */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = llvmgcc.pod; sourceTree = "<group>"; };
- DE66F3AE08ABF35C00323D32 /* llvmgxx.pod */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = llvmgxx.pod; sourceTree = "<group>"; };
- DE66F3AF08ABF35C00323D32 /* Makefile */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.make; path = Makefile; sourceTree = "<group>"; };
- DE66F3B408ABF35D00323D32 /* manpage.css */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = manpage.css; sourceTree = "<group>"; };
- DE66F3B508ABF35D00323D32 /* opt.pod */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = opt.pod; sourceTree = "<group>"; };
- DE66F3B808ABF35D00323D32 /* stkrc.pod */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = stkrc.pod; sourceTree = "<group>"; };
- DE66F3B908ABF35D00323D32 /* CommandLine.html */ = {isa = PBXFileReference; explicitFileType = text.html.documentation; fileEncoding = 30; path = CommandLine.html; sourceTree = "<group>"; };
- DE66F3BA08ABF35D00323D32 /* CompilerDriver.html */ = {isa = PBXFileReference; explicitFileType = text.html.documentation; fileEncoding = 30; path = CompilerDriver.html; sourceTree = "<group>"; };
- DE66F3BB08ABF35D00323D32 /* CompilerWriterInfo.html */ = {isa = PBXFileReference; explicitFileType = text.html.documentation; fileEncoding = 30; path = CompilerWriterInfo.html; sourceTree = "<group>"; };
- DE66F3BD08ABF35D00323D32 /* doxygen.cfg.in */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = doxygen.cfg.in; sourceTree = "<group>"; };
- DE66F3BE08ABF35D00323D32 /* doxygen.css */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = doxygen.css; sourceTree = "<group>"; };
- DE66F3BF08ABF35D00323D32 /* doxygen.footer */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = doxygen.footer; sourceTree = "<group>"; };
- DE66F3C008ABF35D00323D32 /* doxygen.header */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = doxygen.header; sourceTree = "<group>"; };
- DE66F3C108ABF35D00323D32 /* doxygen.intro */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = doxygen.intro; sourceTree = "<group>"; };
- DE66F3C208ABF35D00323D32 /* ExtendingLLVM.html */ = {isa = PBXFileReference; explicitFileType = text.html.documentation; fileEncoding = 30; path = ExtendingLLVM.html; sourceTree = "<group>"; };
- DE66F3C308ABF35D00323D32 /* FAQ.html */ = {isa = PBXFileReference; explicitFileType = text.html.documentation; fileEncoding = 30; path = FAQ.html; sourceTree = "<group>"; };
- DE66F3C408ABF35D00323D32 /* GarbageCollection.html */ = {isa = PBXFileReference; explicitFileType = text.html.documentation; fileEncoding = 30; path = GarbageCollection.html; sourceTree = "<group>"; };
- DE66F3C508ABF35D00323D32 /* GettingStarted.html */ = {isa = PBXFileReference; explicitFileType = text.html.documentation; fileEncoding = 30; path = GettingStarted.html; sourceTree = "<group>"; };
- DE66F3C608ABF35D00323D32 /* GettingStartedVS.html */ = {isa = PBXFileReference; explicitFileType = text.html.documentation; fileEncoding = 30; path = GettingStartedVS.html; sourceTree = "<group>"; };
- DE66F3E408ABF35D00323D32 /* HowToSubmitABug.html */ = {isa = PBXFileReference; explicitFileType = text.html.documentation; fileEncoding = 30; path = HowToSubmitABug.html; sourceTree = "<group>"; };
- DE66F3E608ABF35D00323D32 /* Debugging.gif */ = {isa = PBXFileReference; lastKnownFileType = image.gif; path = Debugging.gif; sourceTree = "<group>"; };
- DE66F3E708ABF35D00323D32 /* libdeps.gif */ = {isa = PBXFileReference; lastKnownFileType = image.gif; path = libdeps.gif; sourceTree = "<group>"; };
- DE66F3E808ABF35D00323D32 /* lines.gif */ = {isa = PBXFileReference; lastKnownFileType = image.gif; path = lines.gif; sourceTree = "<group>"; };
- DE66F3E908ABF35D00323D32 /* objdeps.gif */ = {isa = PBXFileReference; lastKnownFileType = image.gif; path = objdeps.gif; sourceTree = "<group>"; };
- DE66F3EA08ABF35D00323D32 /* venusflytrap.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = venusflytrap.jpg; sourceTree = "<group>"; };
- DE66F3EB08ABF35D00323D32 /* index.html */ = {isa = PBXFileReference; explicitFileType = text.html.documentation; fileEncoding = 30; path = index.html; sourceTree = "<group>"; };
- DE66F3EC08ABF35D00323D32 /* LangRef.html */ = {isa = PBXFileReference; explicitFileType = text.html.documentation; fileEncoding = 30; path = LangRef.html; sourceTree = "<group>"; };
- DE66F3ED08ABF35D00323D32 /* Lexicon.html */ = {isa = PBXFileReference; explicitFileType = text.html.documentation; fileEncoding = 30; path = Lexicon.html; sourceTree = "<group>"; };
- DE66F3EE08ABF35D00323D32 /* llvm.css */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = llvm.css; sourceTree = "<group>"; };
- DE66F3F108ABF35D00323D32 /* MakefileGuide.html */ = {isa = PBXFileReference; explicitFileType = text.html.documentation; fileEncoding = 30; path = MakefileGuide.html; sourceTree = "<group>"; };
- DE66F3F208ABF35D00323D32 /* ProgrammersManual.html */ = {isa = PBXFileReference; explicitFileType = text.html.documentation; fileEncoding = 30; path = ProgrammersManual.html; sourceTree = "<group>"; };
- DE66F3F308ABF35D00323D32 /* Projects.html */ = {isa = PBXFileReference; explicitFileType = text.html.documentation; fileEncoding = 30; path = Projects.html; sourceTree = "<group>"; };
- DE66F3F408ABF35D00323D32 /* ReleaseNotes.html */ = {isa = PBXFileReference; explicitFileType = text.html.documentation; fileEncoding = 30; path = ReleaseNotes.html; sourceTree = "<group>"; };
- DE66F3F508ABF35D00323D32 /* SourceLevelDebugging.html */ = {isa = PBXFileReference; explicitFileType = text.html.documentation; fileEncoding = 30; path = SourceLevelDebugging.html; sourceTree = "<group>"; };
- DE66F3F608ABF35D00323D32 /* Stacker.html */ = {isa = PBXFileReference; explicitFileType = text.html.documentation; fileEncoding = 30; path = Stacker.html; sourceTree = "<group>"; };
- DE66F3F708ABF35D00323D32 /* SystemLibrary.html */ = {isa = PBXFileReference; explicitFileType = text.html.documentation; fileEncoding = 30; path = SystemLibrary.html; sourceTree = "<group>"; };
- DE66F3F808ABF35D00323D32 /* TableGenFundamentals.html */ = {isa = PBXFileReference; explicitFileType = text.html.documentation; fileEncoding = 30; path = TableGenFundamentals.html; sourceTree = "<group>"; };
- DE66F3F908ABF35D00323D32 /* TestingGuide.html */ = {isa = PBXFileReference; explicitFileType = text.html.documentation; fileEncoding = 30; path = TestingGuide.html; sourceTree = "<group>"; };
- DE66F3FA08ABF35D00323D32 /* UsingLibraries.html */ = {isa = PBXFileReference; explicitFileType = text.html.documentation; fileEncoding = 30; path = UsingLibraries.html; sourceTree = "<group>"; };
- DE66F3FB08ABF35D00323D32 /* WritingAnLLVMBackend.html */ = {isa = PBXFileReference; explicitFileType = text.html.documentation; fileEncoding = 30; path = WritingAnLLVMBackend.html; sourceTree = "<group>"; };
- DE66F3FC08ABF35D00323D32 /* WritingAnLLVMPass.html */ = {isa = PBXFileReference; explicitFileType = text.html.documentation; fileEncoding = 30; path = WritingAnLLVMPass.html; sourceTree = "<group>"; };
- DE66F40E08ABF37000323D32 /* fibonacci.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = fibonacci.cpp; path = Fibonacci/fibonacci.cpp; sourceTree = "<group>"; };
- DE66F41508ABF37000323D32 /* HowToUseJIT.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = HowToUseJIT.cpp; path = HowToUseJIT/HowToUseJIT.cpp; sourceTree = "<group>"; };
- DE66F41E08ABF37000323D32 /* ModuleMaker.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = ModuleMaker.cpp; path = ModuleMaker/ModuleMaker.cpp; sourceTree = "<group>"; };
- DE66F42608ABF37000323D32 /* ParallelJIT.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = ParallelJIT.cpp; path = ParallelJIT/ParallelJIT.cpp; sourceTree = "<group>"; };
- DE694D9F08B51E0C0039C106 /* ScheduleDAG.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = ScheduleDAG.cpp; sourceTree = "<group>"; };
- DE81704008CFB44D0093BDEF /* fpcmp.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = fpcmp.cpp; path = fpcmp/fpcmp.cpp; sourceTree = "<group>"; };
- DE81704F08CFB44D0093BDEF /* NightlyTest.gnuplot */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = NightlyTest.gnuplot; sourceTree = "<group>"; };
- DE81705108CFB44D0093BDEF /* NightlyTestTemplate.html */ = {isa = PBXFileReference; explicitFileType = text.html.documentation; fileEncoding = 30; path = NightlyTestTemplate.html; sourceTree = "<group>"; };
- DE81705908CFB44D0093BDEF /* AsmWriterEmitter.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = AsmWriterEmitter.cpp; sourceTree = "<group>"; };
- DE81705A08CFB44D0093BDEF /* AsmWriterEmitter.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = AsmWriterEmitter.h; sourceTree = "<group>"; };
- DE81705B08CFB44D0093BDEF /* CodeEmitterGen.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = CodeEmitterGen.cpp; sourceTree = "<group>"; };
- DE81705C08CFB44D0093BDEF /* CodeEmitterGen.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = CodeEmitterGen.h; sourceTree = "<group>"; };
- DE81705D08CFB44D0093BDEF /* CodeGenInstruction.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = CodeGenInstruction.h; sourceTree = "<group>"; };
- DE81705E08CFB44D0093BDEF /* CodeGenRegisters.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = CodeGenRegisters.h; sourceTree = "<group>"; };
- DE81705F08CFB44D0093BDEF /* CodeGenTarget.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = CodeGenTarget.cpp; sourceTree = "<group>"; };
- DE81706008CFB44D0093BDEF /* CodeGenTarget.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = CodeGenTarget.h; sourceTree = "<group>"; };
- DE81706708CFB44D0093BDEF /* DAGISelEmitter.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = DAGISelEmitter.cpp; sourceTree = "<group>"; };
- DE81706808CFB44D0093BDEF /* DAGISelEmitter.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DAGISelEmitter.h; sourceTree = "<group>"; };
- DE81708908CFB44D0093BDEF /* InstrInfoEmitter.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = InstrInfoEmitter.cpp; sourceTree = "<group>"; };
- DE81708A08CFB44D0093BDEF /* InstrInfoEmitter.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = InstrInfoEmitter.h; sourceTree = "<group>"; };
- DE81708E08CFB44D0093BDEF /* Record.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Record.cpp; sourceTree = "<group>"; };
- DE81708F08CFB44D0093BDEF /* Record.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Record.h; sourceTree = "<group>"; };
- DE81709008CFB44D0093BDEF /* RegisterInfoEmitter.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = RegisterInfoEmitter.cpp; sourceTree = "<group>"; };
- DE81709108CFB44D0093BDEF /* RegisterInfoEmitter.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = RegisterInfoEmitter.h; sourceTree = "<group>"; };
- DE8170AA08CFB44D0093BDEF /* TableGen.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = TableGen.cpp; sourceTree = "<group>"; };
- DE8170AB08CFB44D0093BDEF /* TableGenBackend.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = TableGenBackend.cpp; sourceTree = "<group>"; };
- DE8170AC08CFB44D0093BDEF /* TableGenBackend.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = TableGenBackend.h; sourceTree = "<group>"; };
- DEFAB19D0959E9A100E0AB42 /* DwarfWriter.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = DwarfWriter.h; path = ../include/llvm/CodeGen/DwarfWriter.h; sourceTree = SOURCE_ROOT; };
- F22627320DAE34D10008F441 /* index.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = index.html; sourceTree = "<group>"; };
- F22627330DAE34D20008F441 /* JITTutorial1.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = JITTutorial1.html; sourceTree = "<group>"; };
- F22627340DAE34D20008F441 /* JITTutorial2-1.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "JITTutorial2-1.png"; sourceTree = "<group>"; };
- F22627350DAE34D20008F441 /* JITTutorial2.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = JITTutorial2.html; sourceTree = "<group>"; };
- F22627360DAE34D20008F441 /* LangImpl1.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = LangImpl1.html; sourceTree = "<group>"; };
- F22627370DAE34D20008F441 /* LangImpl2.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = LangImpl2.html; sourceTree = "<group>"; };
- F22627380DAE34D20008F441 /* LangImpl3.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = LangImpl3.html; sourceTree = "<group>"; };
- F22627390DAE34D20008F441 /* LangImpl4.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = LangImpl4.html; sourceTree = "<group>"; };
- F226273A0DAE34D20008F441 /* LangImpl5-cfg.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "LangImpl5-cfg.png"; sourceTree = "<group>"; };
- F226273B0DAE34D20008F441 /* LangImpl5.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = LangImpl5.html; sourceTree = "<group>"; };
- F226273C0DAE34D20008F441 /* LangImpl6.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = LangImpl6.html; sourceTree = "<group>"; };
- F226273D0DAE34D20008F441 /* LangImpl7.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = LangImpl7.html; sourceTree = "<group>"; };
- F226273E0DAE34D20008F441 /* LangImpl8.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = LangImpl8.html; sourceTree = "<group>"; };
- F226273F0DAE34D20008F441 /* Makefile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.make; path = Makefile; sourceTree = "<group>"; };
- F22627400DAE34D20008F441 /* OCamlLangImpl1.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = OCamlLangImpl1.html; sourceTree = "<group>"; };
- F22627410DAE34D20008F441 /* OCamlLangImpl2.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = OCamlLangImpl2.html; sourceTree = "<group>"; };
- F22627420DAE34D20008F441 /* OCamlLangImpl3.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = OCamlLangImpl3.html; sourceTree = "<group>"; };
- F22627430DAE34D20008F441 /* OCamlLangImpl4.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = OCamlLangImpl4.html; sourceTree = "<group>"; };
- F22627440DAE34D20008F441 /* OCamlLangImpl5.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = OCamlLangImpl5.html; sourceTree = "<group>"; };
- F22627450DAE34D20008F441 /* OCamlLangImpl6.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = OCamlLangImpl6.html; sourceTree = "<group>"; };
- F22627460DAE34D20008F441 /* OCamlLangImpl7.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = OCamlLangImpl7.html; sourceTree = "<group>"; };
- F22761DF0DAD09CD003D8065 /* BrainF.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = BrainF.cpp; path = BrainF/BrainF.cpp; sourceTree = "<group>"; };
- F22761E00DAD09CD003D8065 /* BrainF.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BrainF.h; path = BrainF/BrainF.h; sourceTree = "<group>"; };
- F22761E10DAD09CD003D8065 /* BrainFDriver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = BrainFDriver.cpp; path = BrainF/BrainFDriver.cpp; sourceTree = "<group>"; };
- F27C8CE90DAD2EF900A33844 /* IRBuilder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IRBuilder.h; sourceTree = "<group>"; };
- F27C8CFF0DAD307700A33844 /* ShadowStackCollector.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ShadowStackCollector.cpp; sourceTree = "<group>"; };
-/* End PBXFileReference section */
-
-/* Begin PBXGroup section */
- 08FB7794FE84155DC02AAC07 /* LLVM */ = {
- isa = PBXGroup;
- children = (
- DE66F1E908ABF03100323D32 /* include/llvm */,
- CF8F1B480B64F7AB00BB4199 /* include/llvm-c */,
- DE66ECBD08ABEC0700323D32 /* lib/Analysis */,
- 9FE450DE0C77ABE400C4FEA4 /* lib/Archive */,
- DE66EC8808ABEAC900323D32 /* lib/AsmParser */,
- 9F68EB030C77AD2C004AA152 /* lib/Bitcode */,
- DE66ED3E08ABEC2A00323D32 /* lib/CodeGen */,
- DE66ED9A08ABEC7200323D32 /* lib/Debugger */,
- DE66EDBF08ABEC8F00323D32 /* lib/ExecutionEngine */,
- DE66EDEB08ABEDD300323D32 /* lib/Linker */,
- DE66EDFB08ABEDE600323D32 /* lib/Support */,
- DE66EE4908ABEE3400323D32 /* lib/System */,
- DE66EE9608ABEE5D00323D32 /* lib/Target */,
- DE66F0E108ABEFB300323D32 /* lib/Transforms */,
- DE66EC7508ABE8EF00323D32 /* lib/VMCore */,
- DE66F2BD08ABF14400323D32 /* tools */,
- DE816FAC08CFB44C0093BDEF /* utils */,
- DE66F38D08ABF35C00323D32 /* docs */,
- 9FD3E56D0CA0116100E54D15 /* bindings */,
- 9F7C2B690CB9496B00498408 /* test */,
- DE66F3FD08ABF37000323D32 /* examples */,
- DE66F38C08ABF35300323D32 /* CREDITS.TXT */,
- CFD99AA80AFE827B0068D19C /* LICENSE.TXT */,
- CFD99AAD0AFE827B0068D19C /* README.txt */,
- 721CA1750D0B44D200D5004F /* Products */,
- );
- name = LLVM;
- sourceTree = "<group>";
- };
- 721CA1750D0B44D200D5004F /* Products */ = {
- isa = PBXGroup;
- children = (
- );
- name = Products;
- sourceTree = "<group>";
- };
- 9F4B0E5D0D0E02580061F270 /* bitreader */ = {
- isa = PBXGroup;
- children = (
- 9F4B0E5E0D0E02580061F270 /* bitreader_ocaml.c */,
- 9F4B0E5F0D0E02580061F270 /* llvm_bitreader.ml */,
- 9F4B0E600D0E02580061F270 /* llvm_bitreader.mli */,
- );
- path = bitreader;
- sourceTree = "<group>";
- };
- 9F502ACD0D1D8CA3007939DF /* executionengine */ = {
- isa = PBXGroup;
- children = (
- 9F502ADB0D1D8CA3007939DF /* executionengine_ocaml.c */,
- 9F502ADC0D1D8CA3007939DF /* llvm_executionengine.ml */,
- 9F502ADD0D1D8CA3007939DF /* llvm_executionengine.mli */,
- );
- path = executionengine;
- sourceTree = "<group>";
- };
- 9F68EB030C77AD2C004AA152 /* lib/Bitcode */ = {
- isa = PBXGroup;
- children = (
- 9F68EB050C77AD2C004AA152 /* Reader */,
- 9F68EB110C77AD2C004AA152 /* Writer */,
- );
- name = lib/Bitcode;
- path = ../lib/Bitcode;
- sourceTree = SOURCE_ROOT;
- };
- 9F68EB050C77AD2C004AA152 /* Reader */ = {
- isa = PBXGroup;
- children = (
- 35A9CDF00CD0F6D5008ABC1D /* Deserialize.cpp */,
- 9F4B0E8D0D0E05ED0061F270 /* DeserializeAPFloat.cpp */,
- 354CF6D10CD299440059AF3E /* DeserializeAPInt.cpp */,
- 9F68EB060C77AD2C004AA152 /* BitcodeReader.cpp */,
- 9F68EB070C77AD2C004AA152 /* BitcodeReader.h */,
- 9F4B0E8C0D0E05ED0061F270 /* BitReader.cpp */,
- );
- path = Reader;
- sourceTree = "<group>";
- };
- 9F68EB110C77AD2C004AA152 /* Writer */ = {
- isa = PBXGroup;
- children = (
- 354CF6D20CD2994D0059AF3E /* SerializeAPInt.cpp */,
- 9FD3E5920CA012B300E54D15 /* BitWriter.cpp */,
- 9F68EB120C77AD2C004AA152 /* BitcodeWriter.cpp */,
- 9F68EB130C77AD2C004AA152 /* BitcodeWriterPass.cpp */,
- 9F68EB250C77AD2C004AA152 /* ValueEnumerator.cpp */,
- 9F68EB260C77AD2C004AA152 /* ValueEnumerator.h */,
- 35A9CDF10CD0F6E1008ABC1D /* Serialize.cpp */,
- );
- path = Writer;
- sourceTree = "<group>";
- };
- 9F7040170D8D72FF00FD06FF /* transforms */ = {
- isa = PBXGroup;
- children = (
- 9F7040190D8D730A00FD06FF /* scalar */,
- );
- name = transforms;
- sourceTree = "<group>";
- };
- 9F7040190D8D730A00FD06FF /* scalar */ = {
- isa = PBXGroup;
- children = (
- 9F70401A0D8D732400FD06FF /* llvm_scalar_opts.ml */,
- 9F70401B0D8D732400FD06FF /* llvm_scalar_opts.mli */,
- 9F70401E0D8D735E00FD06FF /* scalar_opts_ocaml.c */,
- );
- name = scalar;
- sourceTree = "<group>";
- };
- 9F77937F0C73C54C00551F9C /* Bitcode */ = {
- isa = PBXGroup;
- children = (
- 9F7793800C73C54C00551F9C /* Archive.h */,
- 9F7793810C73C54C00551F9C /* BitCodes.h */,
- 9F7793820C73C54C00551F9C /* BitstreamReader.h */,
- 9F7793830C73C54C00551F9C /* BitstreamWriter.h */,
- 9F7793840C73C54C00551F9C /* LLVMBitCodes.h */,
- 9F7793850C73C54C00551F9C /* ReaderWriter.h */,
- 35A9CDEE0CD0F6AF008ABC1D /* Serialization.h */,
- 35A9CDEF0CD0F6AF008ABC1D /* Serialize.h */,
- 35A9CDED0CD0F6AF008ABC1D /* Deserialize.h */,
- );
- path = Bitcode;
- sourceTree = "<group>";
- };
- 9F7794120C73CB6100551F9C /* Mips */ = {
- isa = PBXGroup;
- children = (
- 9F7794140C73CB6100551F9C /* Mips.h */,
- 9F7794150C73CB6100551F9C /* Mips.td */,
- 9F7794160C73CB6100551F9C /* MipsAsmPrinter.cpp */,
- 9F7794170C73CB6100551F9C /* MipsCallingConv.td */,
- 9F7794180C73CB6100551F9C /* MipsInstrFormats.td */,
- 9F7794190C73CB6100551F9C /* MipsInstrInfo.cpp */,
- 9F77941A0C73CB6100551F9C /* MipsInstrInfo.h */,
- 9F77941B0C73CB6100551F9C /* MipsInstrInfo.td */,
- 9F77941C0C73CB6100551F9C /* MipsISelDAGToDAG.cpp */,
- 9F77941D0C73CB6100551F9C /* MipsISelLowering.cpp */,
- 9F77941E0C73CB6100551F9C /* MipsISelLowering.h */,
- 9F77941F0C73CB6100551F9C /* MipsMachineFunction.h */,
- 9F7794200C73CB6100551F9C /* MipsRegisterInfo.cpp */,
- 9F7794210C73CB6100551F9C /* MipsRegisterInfo.h */,
- 9F7794220C73CB6100551F9C /* MipsRegisterInfo.td */,
- 9F7794230C73CB6100551F9C /* MipsSubtarget.cpp */,
- 9F7794240C73CB6100551F9C /* MipsSubtarget.h */,
- 9F7794250C73CB6100551F9C /* MipsTargetAsmInfo.cpp */,
- 9F7794260C73CB6100551F9C /* MipsTargetAsmInfo.h */,
- 9F7794270C73CB6100551F9C /* MipsTargetMachine.cpp */,
- 9F7794280C73CB6100551F9C /* MipsTargetMachine.h */,
- );
- path = Mips;
- sourceTree = "<group>";
- };
- 9F7794290C73CB7900551F9C /* MSIL */ = {
- isa = PBXGroup;
- children = (
- 9F77942F0C73CB7900551F9C /* MSILWriter.cpp */,
- 9F7794300C73CB7900551F9C /* MSILWriter.h */,
- );
- path = MSIL;
- sourceTree = "<group>";
- };
- 9F7C240B0CB81ECD00498408 /* analysis */ = {
- isa = PBXGroup;
- children = (
- 9F7C240C0CB81ECD00498408 /* analysis_ocaml.c */,
- 9F7C240D0CB81ECD00498408 /* llvm_analysis.ml */,
- 9F7C240E0CB81ECD00498408 /* llvm_analysis.mli */,
- );
- path = analysis;
- sourceTree = "<group>";
- };
- 9F7C2B690CB9496B00498408 /* test */ = {
- isa = PBXGroup;
- children = (
- 9F7C2C4B0CB9496C00498408 /* Bindings */,
- );
- name = test;
- path = ../test;
- sourceTree = SOURCE_ROOT;
- };
- 9F7C2C4B0CB9496C00498408 /* Bindings */ = {
- isa = PBXGroup;
- children = (
- 9F7C2C4C0CB9496C00498408 /* Ocaml */,
- );
- path = Bindings;
- sourceTree = "<group>";
- };
- 9F7C2C4C0CB9496C00498408 /* Ocaml */ = {
- isa = PBXGroup;
- children = (
- 9F7C2C4F0CB9496C00498408 /* analysis.ml */,
- 9F6B2CC00D0F6E56000F00FD /* bitreader.ml */,
- 9F7C2C520CB9496C00498408 /* bitwriter.ml */,
- 9F502AEC0D1D8CF8007939DF /* executionengine.ml */,
- 9FEDD6140D8D7C3B009F6DF1 /* scalar_opts.ml */,
- 9FEDD6BD0D8D8426009F6DF1 /* target.ml */,
- 9F7C2C5D0CB9496C00498408 /* vmcore.ml */,
- );
- path = Ocaml;
- sourceTree = "<group>";
- };
- 9FA638E90C77B252007F12AE /* IPO */ = {
- isa = PBXGroup;
- children = (
- 9FA638EA0C77B252007F12AE /* InlinerPass.h */,
- );
- path = IPO;
- sourceTree = "<group>";
- };
- 9FD3E56D0CA0116100E54D15 /* bindings */ = {
- isa = PBXGroup;
- children = (
- 9FD3E56F0CA0116100E54D15 /* ocaml */,
- );
- name = bindings;
- path = ../bindings;
- sourceTree = SOURCE_ROOT;
- };
- 9FD3E56F0CA0116100E54D15 /* ocaml */ = {
- isa = PBXGroup;
- children = (
- 9F502ACD0D1D8CA3007939DF /* executionengine */,
- 9F7C240B0CB81ECD00498408 /* analysis */,
- 9F4B0E5D0D0E02580061F270 /* bitreader */,
- 9FD3E5700CA0116100E54D15 /* bitwriter */,
- 9FD3E57A0CA0116100E54D15 /* llvm */,
- 9FEDD6C00D8D844E009F6DF1 /* target */,
- 9F7040170D8D72FF00FD06FF /* transforms */,
- );
- path = ocaml;
- sourceTree = "<group>";
- };
- 9FD3E5700CA0116100E54D15 /* bitwriter */ = {
- isa = PBXGroup;
- children = (
- 9FD3E5710CA0116100E54D15 /* bitwriter_ocaml.c */,
- 9FD3E5720CA0116100E54D15 /* llvm_bitwriter.ml */,
- 9FD3E5730CA0116100E54D15 /* llvm_bitwriter.mli */,
- );
- path = bitwriter;
- sourceTree = "<group>";
- };
- 9FD3E57A0CA0116100E54D15 /* llvm */ = {
- isa = PBXGroup;
- children = (
- 9FD3E57B0CA0116100E54D15 /* llvm.ml */,
- 9FD3E57C0CA0116100E54D15 /* llvm.mli */,
- 9FD3E57D0CA0116100E54D15 /* llvm_ocaml.c */,
- );
- path = llvm;
- sourceTree = "<group>";
- };
- 9FE450DE0C77ABE400C4FEA4 /* lib/Archive */ = {
- isa = PBXGroup;
- children = (
- 9FE450DF0C77ABE400C4FEA4 /* Archive.cpp */,
- 9FE450E00C77ABE400C4FEA4 /* ArchiveInternals.h */,
- 9FE450E10C77ABE400C4FEA4 /* ArchiveReader.cpp */,
- 9FE450E20C77ABE400C4FEA4 /* ArchiveWriter.cpp */,
- );
- name = lib/Archive;
- path = ../lib/Archive;
- sourceTree = SOURCE_ROOT;
- };
- 9FEDD5F00D8D73AB009F6DF1 /* Transforms */ = {
- isa = PBXGroup;
- children = (
- 9FEDD5F10D8D73AB009F6DF1 /* Scalar.h */,
- );
- path = Transforms;
- sourceTree = "<group>";
- };
- 9FEDD6C00D8D844E009F6DF1 /* target */ = {
- isa = PBXGroup;
- children = (
- 9FEDD6C10D8D844E009F6DF1 /* llvm_target.ml */,
- 9FEDD6C20D8D844E009F6DF1 /* llvm_target.mli */,
- 9FEDD6C40D8D844E009F6DF1 /* target_ocaml.c */,
- );
- path = target;
- sourceTree = "<group>";
- };
- CF8F1B480B64F7AB00BB4199 /* include/llvm-c */ = {
- isa = PBXGroup;
- children = (
- 9F7C23E50CB81C2100498408 /* Analysis.h */,
- 9F5B90E70D0DF19100CDFDEA /* BitReader.h */,
- 9FD3E58D0CA0125F00E54D15 /* BitWriter.h */,
- 9FD3E58E0CA0125F00E54D15 /* Core.h */,
- 9FEB8C550D1CD1E200EE46BC /* ExecutionEngine.h */,
- CF8F1B490B64F7AB00BB4199 /* LinkTimeOptimizer.h */,
- 9FEDD6BB0D8D8408009F6DF1 /* lto.h */,
- 9FEDD6B80D8D83EC009F6DF1 /* Target.h */,
- 9FEDD5F00D8D73AB009F6DF1 /* Transforms */,
- );
- name = "include/llvm-c";
- path = "../include/llvm-c";
- sourceTree = SOURCE_ROOT;
- };
- CF8F1B5E0B64FADA00BB4199 /* llvm-upgrade */ = {
- isa = PBXGroup;
- children = (
- CF8F1B680B64FADA00BB4199 /* llvm-upgrade.cpp */,
- CF8F1B720B64FADA00BB4199 /* UpgradeInternals.h */,
- CF8F1B750B64FADA00BB4199 /* UpgradeLexer.l */,
- CF8F1B7C0B64FADA00BB4199 /* UpgradeParser.y */,
- );
- path = "llvm-upgrade";
- sourceTree = "<group>";
- };
- CF8F1B7E0B64FADA00BB4199 /* llvm2cpp */ = {
- isa = PBXGroup;
- children = (
- CF8F1B7F0B64FADA00BB4199 /* CppWriter.cpp */,
- CF8F1B800B64FADA00BB4199 /* CppWriter.h */,
- CF8F1B870B64FADA00BB4199 /* llvm2cpp.cpp */,
- );
- path = llvm2cpp;
- sourceTree = "<group>";
- };
- CF8F1B960B64FB7F00BB4199 /* lto */ = {
- isa = PBXGroup;
- children = (
- CF8F1B9D0B64FB7F00BB4199 /* lto-c.cpp */,
- CF8F1B9E0B64FB7F00BB4199 /* lto.cpp */,
- );
- path = lto;
- sourceTree = "<group>";
- };
- CF8F1BAB0B64FB8000BB4199 /* opt */ = {
- isa = PBXGroup;
- children = (
- CF8F1BAC0B64FB8000BB4199 /* AnalysisWrappers.cpp */,
- CF8F1BB70B64FB8000BB4199 /* GraphPrinters.cpp */,
- CF8F1BB90B64FB8000BB4199 /* opt.cpp */,
- CF8F1BBA0B64FB8000BB4199 /* PrintSCC.cpp */,
- );
- path = opt;
- sourceTree = "<group>";
- };
- CF8F1BCF0B64FC8A00BB4199 /* ARM */ = {
- isa = PBXGroup;
- children = (
- 9FE4508B0C77A77000C4FEA4 /* ARMCodeEmitter.cpp */,
- 9FE4508C0C77A77000C4FEA4 /* ARMGenAsmWriter.inc */,
- 9FE4508D0C77A77000C4FEA4 /* ARMGenDAGISel.inc */,
- 9FE4508E0C77A77100C4FEA4 /* ARMGenInstrInfo.inc */,
- 9FE4508F0C77A77100C4FEA4 /* ARMGenInstrNames.inc */,
- 9FE450900C77A77100C4FEA4 /* ARMGenRegisterInfo.h.inc */,
- 9FE450910C77A77100C4FEA4 /* ARMGenRegisterInfo.inc */,
- 9FE450920C77A77100C4FEA4 /* ARMGenRegisterNames.inc */,
- 9FE450930C77A77100C4FEA4 /* ARMGenSubtarget.inc */,
- 9FE450940C77A77100C4FEA4 /* ARMJITInfo.cpp */,
- 9FE450950C77A77100C4FEA4 /* ARMJITInfo.h */,
- 9FE450960C77A77100C4FEA4 /* ARMRelocations.h */,
- 9FE450970C77A77100C4FEA4 /* README-Thumb.txt */,
- 9FE450980C77A77100C4FEA4 /* README.txt */,
- CF8F1BD10B64FC8A00BB4199 /* ARM.h */,
- CF8F1BD20B64FC8A00BB4199 /* ARM.td */,
- CF8F1BD30B64FC8A00BB4199 /* ARMAddressingModes.h */,
- CF8F1BD40B64FC8A00BB4199 /* ARMAsmPrinter.cpp */,
- CF8F1BD50B64FC8A00BB4199 /* ARMConstantIslandPass.cpp */,
- CF8F1BD60B64FC8A00BB4199 /* ARMConstantPoolValue.cpp */,
- CF8F1BD70B64FC8A00BB4199 /* ARMConstantPoolValue.h */,
- CF8F1BD80B64FC8A00BB4199 /* ARMFrameInfo.h */,
- CF8F1BD90B64FC8A00BB4199 /* ARMInstrInfo.cpp */,
- CF8F1BDA0B64FC8A00BB4199 /* ARMInstrInfo.h */,
- CF8F1BDB0B64FC8A00BB4199 /* ARMInstrInfo.td */,
- CF8F1BDC0B64FC8A00BB4199 /* ARMInstrThumb.td */,
- CF8F1BDD0B64FC8A00BB4199 /* ARMInstrVFP.td */,
- CF8F1BDE0B64FC8A00BB4199 /* ARMISelDAGToDAG.cpp */,
- CF8F1BDF0B64FC8A00BB4199 /* ARMISelLowering.cpp */,
- CF8F1BE00B64FC8A00BB4199 /* ARMISelLowering.h */,
- CF8F1BE10B64FC8A00BB4199 /* ARMLoadStoreOptimizer.cpp */,
- CF8F1BE20B64FC8A00BB4199 /* ARMMachineFunctionInfo.h */,
- CF8F1BE30B64FC8A00BB4199 /* ARMRegisterInfo.cpp */,
- CF8F1BE40B64FC8A00BB4199 /* ARMRegisterInfo.h */,
- CF8F1BE50B64FC8A00BB4199 /* ARMRegisterInfo.td */,
- CF8F1BE60B64FC8A00BB4199 /* ARMSubtarget.cpp */,
- CF8F1BE70B64FC8A00BB4199 /* ARMSubtarget.h */,
- CF8F1BE80B64FC8A00BB4199 /* ARMTargetAsmInfo.cpp */,
- CF8F1BE90B64FC8A00BB4199 /* ARMTargetAsmInfo.h */,
- CF8F1BEA0B64FC8A00BB4199 /* ARMTargetMachine.cpp */,
- CF8F1BEB0B64FC8A00BB4199 /* ARMTargetMachine.h */,
- );
- path = ARM;
- sourceTree = "<group>";
- };
- CFD99ADF0AFE878F0068D19C /* opt */ = {
- isa = PBXGroup;
- children = (
- CFD99ADB0AFE87870068D19C /* AnalysisWrappers.cpp */,
- CFD99ADC0AFE87870068D19C /* GraphPrinters.cpp */,
- CFD99ADD0AFE87870068D19C /* opt.cpp */,
- CFD99ADE0AFE87870068D19C /* PrintSCC.cpp */,
- );
- name = opt;
- sourceTree = "<group>";
- };
- CFE4213C0A66FAE100AB4BF6 /* Hello */ = {
- isa = PBXGroup;
- children = (
- CFE4213D0A66FAE100AB4BF6 /* Hello.cpp */,
- );
- path = Hello;
- sourceTree = "<group>";
- };
- DE66EC7508ABE8EF00323D32 /* lib/VMCore */ = {
- isa = PBXGroup;
- children = (
- DE66EC5B08ABE86900323D32 /* AsmWriter.cpp */,
- 9F77937B0C73C4F400551F9C /* AutoUpgrade.cpp */,
- DE66EC5C08ABE86A00323D32 /* BasicBlock.cpp */,
- 9F77937C0C73C4F400551F9C /* ConstantFold.cpp */,
- 9F77937D0C73C4F400551F9C /* ConstantFold.h */,
- DE66EC6008ABE86A00323D32 /* Constants.cpp */,
- 9FD3E5900CA0129D00E54D15 /* Core.cpp */,
- DE66EC6108ABE86A00323D32 /* Dominators.cpp */,
- DE66EC6208ABE86A00323D32 /* Function.cpp */,
- DE66EC6308ABE86A00323D32 /* Globals.cpp */,
- CF73C0BD098A551F00627152 /* InlineAsm.cpp */,
- DE66EC6408ABE86A00323D32 /* Instruction.cpp */,
- DE66EC6508ABE86A00323D32 /* Instructions.cpp */,
- CF1ACC9709C9DE4400D3C5EB /* IntrinsicInst.cpp */,
- DE66EC6608ABE86A00323D32 /* LeakDetector.cpp */,
- DE66EC6708ABE86A00323D32 /* Mangler.cpp */,
- DE66EC6808ABE86A00323D32 /* Module.cpp */,
- DE66EC6908ABE86A00323D32 /* ModuleProvider.cpp */,
- DE66EC6A08ABE86A00323D32 /* Pass.cpp */,
- CF8F1B5C0B64FA7300BB4199 /* PassManager.cpp */,
- DE66EC6D08ABE86A00323D32 /* SymbolTableListTraitsImpl.h */,
- DE66EC6E08ABE86A00323D32 /* Type.cpp */,
- CF73C0BE098A551F00627152 /* TypeSymbolTable.cpp */,
- DE66EC6F08ABE86A00323D32 /* Value.cpp */,
- CF73C0BF098A551F00627152 /* ValueSymbolTable.cpp */,
- CF9720900A9F3CA2002CEEDD /* ValueTypes.cpp */,
- DE66EC7008ABE86A00323D32 /* Verifier.cpp */,
- );
- name = lib/VMCore;
- sourceTree = "<group>";
- };
- DE66EC8808ABEAC900323D32 /* lib/AsmParser */ = {
- isa = PBXGroup;
- children = (
- DE66EC8E08ABEAF000323D32 /* llvmAsmParser.y */,
- DE66EC8F08ABEAF000323D32 /* Parser.cpp */,
- DE66EC9008ABEAF000323D32 /* ParserInternals.h */,
- );
- name = lib/AsmParser;
- sourceTree = "<group>";
- };
- DE66ECBD08ABEC0700323D32 /* lib/Analysis */ = {
- isa = PBXGroup;
- children = (
- DE66ED1A08ABEC0800323D32 /* IPA */,
- DE66ECBE08ABEC0700323D32 /* AliasAnalysis.cpp */,
- DE66ECBF08ABEC0700323D32 /* AliasAnalysisCounter.cpp */,
- DE66ECC008ABEC0700323D32 /* AliasAnalysisEvaluator.cpp */,
- CF8F1B4D0B64F80700BB4199 /* AliasDebugger.cpp */,
- DE66ECC108ABEC0700323D32 /* AliasSetTracker.cpp */,
- 9F7C23E60CB81C2B00498408 /* Analysis.cpp */,
- DE66ECC208ABEC0700323D32 /* BasicAliasAnalysis.cpp */,
- DE66ECC308ABEC0700323D32 /* CFGPrinter.cpp */,
- CF73C0B0098A523C00627152 /* ConstantFolding.cpp */,
- DE66ED1708ABEC0800323D32 /* InstCount.cpp */,
- DE66ED1808ABEC0800323D32 /* Interval.cpp */,
- DE66ED1908ABEC0800323D32 /* IntervalPartition.cpp */,
- DE66ED3308ABEC0800323D32 /* LoadValueNumbering.cpp */,
- DE66ED3408ABEC0800323D32 /* LoopInfo.cpp */,
- 9F68EB010C77AD02004AA152 /* LoopPass.cpp */,
- 9F68EB020C77AD02004AA152 /* MemoryDependenceAnalysis.cpp */,
- DE66ED3608ABEC0800323D32 /* PostDominators.cpp */,
- DE66ED3708ABEC0800323D32 /* ProfileInfo.cpp */,
- DE66ED3808ABEC0800323D32 /* ProfileInfoLoader.cpp */,
- DE66ED3908ABEC0800323D32 /* ProfileInfoLoaderPass.cpp */,
- DE66ED3A08ABEC0800323D32 /* ScalarEvolution.cpp */,
- DE66ED3B08ABEC0800323D32 /* ScalarEvolutionExpander.cpp */,
- DE66ED3C08ABEC0800323D32 /* Trace.cpp */,
- DE66ED3D08ABEC0800323D32 /* ValueNumbering.cpp */,
- );
- name = lib/Analysis;
- path = ../lib/Analysis;
- sourceTree = SOURCE_ROOT;
- };
- DE66ED1A08ABEC0800323D32 /* IPA */ = {
- isa = PBXGroup;
- children = (
- DE66ED1B08ABEC0800323D32 /* Andersens.cpp */,
- DE66ED1C08ABEC0800323D32 /* CallGraph.cpp */,
- DE66ED1D08ABEC0800323D32 /* CallGraphSCCPass.cpp */,
- DE66ED2F08ABEC0800323D32 /* FindUsedTypes.cpp */,
- DE66ED3008ABEC0800323D32 /* GlobalsModRef.cpp */,
- );
- path = IPA;
- sourceTree = "<group>";
- };
- DE66ED3E08ABEC2A00323D32 /* lib/CodeGen */ = {
- isa = PBXGroup;
- children = (
- F27C8CFF0DAD307700A33844 /* ShadowStackCollector.cpp */,
- 754221420D171DFC00DDB61B /* MachineLICM.cpp */,
- 9FE450AB0C77AB6100C4FEA4 /* README.txt */,
- DE66ED8308ABEC2B00323D32 /* SelectionDAG */,
- DE66ED3F08ABEC2A00323D32 /* AsmPrinter.cpp */,
- DE66ED4008ABEC2A00323D32 /* BranchFolding.cpp */,
- CFC244570959DEF2009F8C47 /* DwarfWriter.cpp */,
- 9F7793500C73BD1500551F9C /* ELFWriter.h */,
- DE66ED6F08ABEC2B00323D32 /* ELFWriter.cpp */,
- 9F7793510C73BD1500551F9C /* IfConversion.cpp */,
- DE66ED7008ABEC2B00323D32 /* IntrinsicLowering.cpp */,
- DE66ED7108ABEC2B00323D32 /* LiveInterval.cpp */,
- DE66ED7308ABEC2B00323D32 /* LiveIntervalAnalysis.cpp */,
- DE66ED7508ABEC2B00323D32 /* LiveVariables.cpp */,
- CF32AF5C0AEE6A4E00D24CD4 /* LLVMTargetMachine.cpp */,
- 9F7793520C73BD1500551F9C /* LowerSubregs.cpp */,
- DE66ED7608ABEC2B00323D32 /* MachineBasicBlock.cpp */,
- CF6529A6095B21A8007F884E /* MachineModuleInfo.cpp */,
- DE66ED7808ABEC2B00323D32 /* MachineFunction.cpp */,
- DE66ED7908ABEC2B00323D32 /* MachineInstr.cpp */,
- CF4F27F60A7B6FA3004359F6 /* MachinePassRegistry.cpp */,
- 9F7793530C73BD1500551F9C /* MachOWriter.h */,
- CF9720350A9F3ADC002CEEDD /* MachOWriter.cpp */,
- DE66ED7B08ABEC2B00323D32 /* Passes.cpp */,
- DE66ED7C08ABEC2B00323D32 /* PHIElimination.cpp */,
- 9F7793540C73BD1500551F9C /* PostRASchedulerList.cpp */,
- DE66ED7D08ABEC2B00323D32 /* PhysRegTracker.h */,
- DE66ED7E08ABEC2B00323D32 /* PrologEpilogInserter.cpp */,
- 9F7793550C73BD1500551F9C /* RegAllocBigBlock.cpp */,
- DE66ED8008ABEC2B00323D32 /* RegAllocLinearScan.cpp */,
- DE66ED8108ABEC2B00323D32 /* RegAllocLocal.cpp */,
- 9FE25D940CAB16FB005383FC /* RegisterCoalescer.cpp */,
- 9F7793560C73BD1500551F9C /* RegisterScavenging.cpp */,
- DE66ED8208ABEC2B00323D32 /* RegAllocSimple.cpp */,
- 9F7793570C73BD1500551F9C /* SimpleRegisterCoalescing.cpp */,
- DE66ED9508ABEC2B00323D32 /* TwoAddressInstructionPass.cpp */,
- DE66ED9608ABEC2B00323D32 /* UnreachableBlockElim.cpp */,
- DE66ED9808ABEC2B00323D32 /* VirtRegMap.cpp */,
- DE66ED9908ABEC2B00323D32 /* VirtRegMap.h */,
- );
- name = lib/CodeGen;
- path = ../lib/CodeGen;
- sourceTree = SOURCE_ROOT;
- };
- DE66ED8308ABEC2B00323D32 /* SelectionDAG */ = {
- isa = PBXGroup;
- children = (
- 9FE450AC0C77AB6E00C4FEA4 /* CallingConvLower.cpp */,
- CF6B5AFD095C82C300D1EA42 /* DAGCombiner.cpp */,
- DE66ED9008ABEC2B00323D32 /* LegalizeDAG.cpp */,
- CF7FFA1F0985081C008B0087 /* ScheduleDAGList.cpp */,
- DE694D9F08B51E0C0039C106 /* ScheduleDAG.cpp */,
- DE66ED9208ABEC2B00323D32 /* SelectionDAG.cpp */,
- DE66ED9308ABEC2B00323D32 /* SelectionDAGISel.cpp */,
- DE66ED9408ABEC2B00323D32 /* SelectionDAGPrinter.cpp */,
- CFE421060A66F86D00AB4BF6 /* ScheduleDAGRRList.cpp */,
- CF9720370A9F3B1C002CEEDD /* TargetLowering.cpp */,
- );
- path = SelectionDAG;
- sourceTree = "<group>";
- };
- DE66ED9A08ABEC7200323D32 /* lib/Debugger */ = {
- isa = PBXGroup;
- children = (
- DE66EDB108ABEC7300323D32 /* Debugger.cpp */,
- DE66EDB508ABEC7300323D32 /* ProgramInfo.cpp */,
- DE66EDB608ABEC7300323D32 /* README.txt */,
- DE66EDB708ABEC7300323D32 /* RuntimeInfo.cpp */,
- DE66EDB808ABEC7300323D32 /* SourceFile.cpp */,
- DE66EDB908ABEC7300323D32 /* SourceLanguage-CFamily.cpp */,
- DE66EDBA08ABEC7300323D32 /* SourceLanguage-CPlusPlus.cpp */,
- DE66EDBB08ABEC7300323D32 /* SourceLanguage-Unknown.cpp */,
- DE66EDBC08ABEC7300323D32 /* SourceLanguage.cpp */,
- );
- name = lib/Debugger;
- path = ../lib/Debugger;
- sourceTree = SOURCE_ROOT;
- };
- DE66EDBF08ABEC8F00323D32 /* lib/ExecutionEngine */ = {
- isa = PBXGroup;
- children = (
- DE66EDC508ABEC9000323D32 /* Interpreter */,
- DE66EDD308ABEC9000323D32 /* JIT */,
- DE66EDC408ABEC9000323D32 /* ExecutionEngine.cpp */,
- 9F502B090D1D8D8D007939DF /* ExecutionEngineBindings.cpp */,
- );
- name = lib/ExecutionEngine;
- path = ../lib/ExecutionEngine;
- sourceTree = SOURCE_ROOT;
- };
- DE66EDC508ABEC9000323D32 /* Interpreter */ = {
- isa = PBXGroup;
- children = (
- DE66EDCE08ABEC9000323D32 /* Execution.cpp */,
- DE66EDCF08ABEC9000323D32 /* ExternalFunctions.cpp */,
- DE66EDD008ABEC9000323D32 /* Interpreter.cpp */,
- DE66EDD108ABEC9000323D32 /* Interpreter.h */,
- );
- path = Interpreter;
- sourceTree = "<group>";
- };
- DE66EDD308ABEC9000323D32 /* JIT */ = {
- isa = PBXGroup;
- children = (
- DE66EDDE08ABEC9100323D32 /* Intercept.cpp */,
- DE66EDDF08ABEC9100323D32 /* JIT.cpp */,
- DE66EDE008ABEC9100323D32 /* JIT.h */,
- DE66EDE108ABEC9100323D32 /* JITEmitter.cpp */,
- DE66EDE308ABEC9100323D32 /* TargetSelect.cpp */,
- );
- path = JIT;
- sourceTree = "<group>";
- };
- DE66EDEB08ABEDD300323D32 /* lib/Linker */ = {
- isa = PBXGroup;
- children = (
- DE66EDF608ABEDD300323D32 /* LinkArchives.cpp */,
- DE66EDF708ABEDD300323D32 /* Linker.cpp */,
- DE66EDF808ABEDD300323D32 /* LinkItems.cpp */,
- DE66EDF908ABEDD300323D32 /* LinkModules.cpp */,
- );
- name = lib/Linker;
- path = ../lib/Linker;
- sourceTree = SOURCE_ROOT;
- };
- DE66EDFB08ABEDE600323D32 /* lib/Support */ = {
- isa = PBXGroup;
- children = (
- 9FE25D950CAB1724005383FC /* APFloat.cpp */,
- 9FE450A60C77AB3200C4FEA4 /* APInt.cpp */,
- 9FE450A70C77AB3200C4FEA4 /* ConstantRange.cpp */,
- 9FE450A80C77AB3200C4FEA4 /* MemoryBuffer.cpp */,
- 9FE450A90C77AB3200C4FEA4 /* SmallPtrSet.cpp */,
- 9FE450AA0C77AB3200C4FEA4 /* StringMap.cpp */,
- CFD99AB70AFE848A0068D19C /* Allocator.cpp */,
- DE66EDFC08ABEDE600323D32 /* Annotation.cpp */,
- DE66EE1D08ABEDE600323D32 /* CommandLine.cpp */,
- DE66EE3D08ABEDE600323D32 /* Debug.cpp */,
- CF79495D09B326D4005ADFCA /* Dwarf.cpp */,
- DE66EE3E08ABEDE600323D32 /* FileUtilities.cpp */,
- CF42B6C40AF2512000D5D47C /* FoldingSet.cpp */,
- CFE421070A66F8DC00AB4BF6 /* GraphWriter.cpp */,
- DE66EE3F08ABEDE600323D32 /* IsInf.cpp */,
- DE66EE4008ABEDE600323D32 /* IsNAN.cpp */,
- CF8F1B500B64F86A00BB4199 /* ManagedStatic.cpp */,
- DE66EE4208ABEDE600323D32 /* PluginLoader.cpp */,
- DE66EE4308ABEDE600323D32 /* SlowOperationInformer.cpp */,
- DE66EE4408ABEDE600323D32 /* Statistic.cpp */,
- CF8F1B510B64F86A00BB4199 /* Streams.cpp */,
- DE66EE4508ABEDE700323D32 /* StringExtras.cpp */,
- 9F5B90CB0D0CE87100CDFDEA /* StringPool.cpp */,
- DE66EE4608ABEDE700323D32 /* SystemUtils.cpp */,
- DE66EE4708ABEDE700323D32 /* Timer.cpp */,
- );
- name = lib/Support;
- path = ../lib/Support;
- sourceTree = SOURCE_ROOT;
- };
- DE66EE4908ABEE3400323D32 /* lib/System */ = {
- isa = PBXGroup;
- children = (
- 9FE450A50C77AAF000C4FEA4 /* Disassembler.cpp */,
- DE66EE7E08ABEE3500323D32 /* Unix */,
- DE66EE8B08ABEE3500323D32 /* Win32 */,
- CFE421090A66F93300AB4BF6 /* Alarm.cpp */,
- DE66EE6008ABEE3400323D32 /* DynamicLibrary.cpp */,
- CF8F1B530B64F8C000BB4199 /* IncludeFile.cpp */,
- DE66EE6108ABEE3400323D32 /* LICENSE.TXT */,
- CFD99ABA0AFE84D70068D19C /* IncludeFile.cpp */,
- DE66EE6508ABEE3400323D32 /* MappedFile.cpp */,
- DE66EE6608ABEE3400323D32 /* Memory.cpp */,
- DE66EE6708ABEE3400323D32 /* Mutex.cpp */,
- DE66EE6808ABEE3400323D32 /* Path.cpp */,
- DE66EE6908ABEE3400323D32 /* Process.cpp */,
- DE66EE6A08ABEE3400323D32 /* Program.cpp */,
- DE66EE6B08ABEE3400323D32 /* README.txt */,
- DE66EE7C08ABEE3400323D32 /* Signals.cpp */,
- DE66EE7D08ABEE3400323D32 /* TimeValue.cpp */,
- );
- name = lib/System;
- path = ../lib/System;
- sourceTree = SOURCE_ROOT;
- };
- DE66EE7E08ABEE3500323D32 /* Unix */ = {
- isa = PBXGroup;
- children = (
- CFD99ABB0AFE84EF0068D19C /* Alarm.inc */,
- DE66EE7F08ABEE3500323D32 /* MappedFile.inc */,
- DE66EE8008ABEE3500323D32 /* Memory.inc */,
- DE66EE8108ABEE3500323D32 /* Mutex.inc */,
- DE66EE8208ABEE3500323D32 /* Path.inc */,
- DE66EE8308ABEE3500323D32 /* Process.inc */,
- DE66EE8408ABEE3500323D32 /* Program.inc */,
- DE66EE8508ABEE3500323D32 /* README.txt */,
- DE66EE8608ABEE3500323D32 /* Signals.inc */,
- DE66EE8908ABEE3500323D32 /* TimeValue.inc */,
- DE66EE8A08ABEE3500323D32 /* Unix.h */,
- );
- path = Unix;
- sourceTree = "<group>";
- };
- DE66EE8B08ABEE3500323D32 /* Win32 */ = {
- isa = PBXGroup;
- children = (
- CFE4210A0A66F93300AB4BF6 /* Alarm.inc */,
- DE66EE8C08ABEE3500323D32 /* DynamicLibrary.inc */,
- DE66EE8D08ABEE3500323D32 /* MappedFile.inc */,
- DE66EE8E08ABEE3500323D32 /* Memory.inc */,
- DE66EE8F08ABEE3500323D32 /* Mutex.inc */,
- DE66EE9008ABEE3500323D32 /* Path.inc */,
- DE66EE9108ABEE3500323D32 /* Process.inc */,
- DE66EE9208ABEE3500323D32 /* Program.inc */,
- DE66EE9308ABEE3500323D32 /* Signals.inc */,
- DE66EE9408ABEE3500323D32 /* TimeValue.inc */,
- DE66EE9508ABEE3500323D32 /* Win32.h */,
- );
- path = Win32;
- sourceTree = "<group>";
- };
- DE66EE9608ABEE5D00323D32 /* lib/Target */ = {
- isa = PBXGroup;
- children = (
- 9F7794290C73CB7900551F9C /* MSIL */,
- DE66EE9708ABEE5D00323D32 /* Alpha */,
- CF8F1BCF0B64FC8A00BB4199 /* ARM */,
- DE66EEC908ABEE5E00323D32 /* CBackend */,
- DE66EEE508ABEE5E00323D32 /* IA64 */,
- 9F7794120C73CB6100551F9C /* Mips */,
- DE66EF1108ABEE5E00323D32 /* PowerPC */,
- DE66EF7008ABEE5F00323D32 /* Sparc */,
- DE66F09308ABEE6000323D32 /* X86 */,
- DE66EF1008ABEE5E00323D32 /* TargetRegisterInfo.cpp */,
- CF9BCD1508C75070001E7011 /* SubtargetFeature.cpp */,
- 9FEDD6B60D8D83D0009F6DF1 /* Target.cpp */,
- DE66F08A08ABEE6000323D32 /* Target.td */,
- CF47BD860AAF487E00A8B13E /* TargetAsmInfo.cpp */,
- 9FE25D960CAB1759005383FC /* TargetCallingConv.td */,
- DE66F08B08ABEE6000323D32 /* TargetData.cpp */,
- DE66F08C08ABEE6000323D32 /* TargetFrameInfo.cpp */,
- DE66F08D08ABEE6000323D32 /* TargetInstrInfo.cpp */,
- DE66F08F08ABEE6000323D32 /* TargetMachine.cpp */,
- DE66F09008ABEE6000323D32 /* TargetMachineRegistry.cpp */,
- 84115FFE0B66D87400E1293E /* TargetMachOWriterInfo.cpp */,
- CF490D14090541D30072DB1C /* TargetSchedule.td */,
- CF490D15090541D30072DB1C /* TargetSelectionDAG.td */,
- DE66F09208ABEE6000323D32 /* TargetSubtarget.cpp */,
- );
- name = lib/Target;
- path = ../lib/Target;
- sourceTree = SOURCE_ROOT;
- };
- DE66EE9708ABEE5D00323D32 /* Alpha */ = {
- isa = PBXGroup;
- children = (
- DE66EE9808ABEE5E00323D32 /* Alpha.h */,
- DE66EE9908ABEE5E00323D32 /* Alpha.td */,
- DE66EE9A08ABEE5E00323D32 /* AlphaAsmPrinter.cpp */,
- CF8F1B540B64F90F00BB4199 /* AlphaBranchSelector.cpp */,
- DE66EE9B08ABEE5E00323D32 /* AlphaCodeEmitter.cpp */,
- CFA702BB0A6FA85F0006009A /* AlphaGenAsmWriter.inc */,
- CFA702BC0A6FA85F0006009A /* AlphaGenCodeEmitter.inc */,
- CFA702BD0A6FA85F0006009A /* AlphaGenDAGISel.inc */,
- CFA702BE0A6FA85F0006009A /* AlphaGenInstrInfo.inc */,
- CFA702BF0A6FA85F0006009A /* AlphaGenInstrNames.inc */,
- CFA702C00A6FA85F0006009A /* AlphaGenRegisterInfo.h.inc */,
- CFA702C10A6FA85F0006009A /* AlphaGenRegisterInfo.inc */,
- CFA702C20A6FA85F0006009A /* AlphaGenRegisterNames.inc */,
- CFA702C30A6FA85F0006009A /* AlphaGenSubtarget.inc */,
- DE66EEA308ABEE5E00323D32 /* AlphaInstrFormats.td */,
- DE66EEA408ABEE5E00323D32 /* AlphaInstrInfo.cpp */,
- DE66EEA508ABEE5E00323D32 /* AlphaInstrInfo.h */,
- DE66EEA608ABEE5E00323D32 /* AlphaInstrInfo.td */,
- CFBD8B1A090E76540020B107 /* AlphaISelDAGToDAG.cpp */,
- CFBD8B1B090E76540020B107 /* AlphaISelLowering.cpp */,
- CFBD8B1C090E76540020B107 /* AlphaISelLowering.h */,
- DE66EEA908ABEE5E00323D32 /* AlphaJITInfo.cpp */,
- DE66EEAA08ABEE5E00323D32 /* AlphaJITInfo.h */,
- CF8F1B550B64F90F00BB4199 /* AlphaLLRP.cpp */,
- DE66EEAB08ABEE5E00323D32 /* AlphaRegisterInfo.cpp */,
- DE66EEAC08ABEE5E00323D32 /* AlphaRegisterInfo.h */,
- DE66EEAD08ABEE5E00323D32 /* AlphaRegisterInfo.td */,
- DE66EEAE08ABEE5E00323D32 /* AlphaRelocations.h */,
- CFE4210B0A66F96400AB4BF6 /* AlphaSchedule.td */,
- CFBD8B1D090E76540020B107 /* AlphaSubtarget.cpp */,
- CFBD8B1E090E76540020B107 /* AlphaSubtarget.h */,
- CF341DAE0AB07A8B0099B064 /* AlphaTargetAsmInfo.cpp */,
- CF341DAD0AB07A8B0099B064 /* AlphaTargetAsmInfo.h */,
- DE66EEAF08ABEE5E00323D32 /* AlphaTargetMachine.cpp */,
- DE66EEB008ABEE5E00323D32 /* AlphaTargetMachine.h */,
- );
- path = Alpha;
- sourceTree = "<group>";
- };
- DE66EEC908ABEE5E00323D32 /* CBackend */ = {
- isa = PBXGroup;
- children = (
- CF8F1B560B64F98900BB4199 /* CBackend.cpp */,
- DE66EECA08ABEE5E00323D32 /* CTargetMachine.h */,
- );
- path = CBackend;
- sourceTree = "<group>";
- };
- DE66EEE508ABEE5E00323D32 /* IA64 */ = {
- isa = PBXGroup;
- children = (
- CFA702C40A6FA8910006009A /* IA64GenAsmWriter.inc */,
- CFA702C50A6FA8910006009A /* IA64GenDAGISel.inc */,
- CFA702C60A6FA8910006009A /* IA64GenInstrInfo.inc */,
- CFA702C70A6FA8910006009A /* IA64GenInstrNames.inc */,
- CFA702C80A6FA8910006009A /* IA64GenRegisterInfo.h.inc */,
- CFA702C90A6FA8910006009A /* IA64GenRegisterInfo.inc */,
- CFA702CA0A6FA8910006009A /* IA64GenRegisterNames.inc */,
- DE66EEF808ABEE5E00323D32 /* IA64.h */,
- DE66EEF908ABEE5E00323D32 /* IA64.td */,
- DE66EEFA08ABEE5E00323D32 /* IA64AsmPrinter.cpp */,
- CF73C0B6098A53EF00627152 /* IA64Bundling.cpp */,
- DE66EF0108ABEE5E00323D32 /* IA64InstrBuilder.h */,
- DE66EF0208ABEE5E00323D32 /* IA64InstrFormats.td */,
- DE66EF0308ABEE5E00323D32 /* IA64InstrInfo.cpp */,
- DE66EF0408ABEE5E00323D32 /* IA64InstrInfo.h */,
- DE66EF0508ABEE5E00323D32 /* IA64InstrInfo.td */,
- CFC244BF0959F2E3009F8C47 /* IA64ISelDAGToDAG.cpp */,
- CFC244C00959F2E3009F8C47 /* IA64ISelLowering.cpp */,
- CFC244C10959F2E3009F8C47 /* IA64ISelLowering.h */,
- DE66EF0708ABEE5E00323D32 /* IA64MachineFunctionInfo.h */,
- DE66EF0808ABEE5E00323D32 /* IA64RegisterInfo.cpp */,
- DE66EF0908ABEE5E00323D32 /* IA64RegisterInfo.h */,
- DE66EF0A08ABEE5E00323D32 /* IA64RegisterInfo.td */,
- CF341DE90AB07F890099B064 /* IA64TargetAsmInfo.cpp */,
- CF341DE80AB07F890099B064 /* IA64TargetAsmInfo.h */,
- DE66EF0B08ABEE5E00323D32 /* IA64TargetMachine.cpp */,
- DE66EF0C08ABEE5E00323D32 /* IA64TargetMachine.h */,
- DE66EF0E08ABEE5E00323D32 /* README */,
- );
- path = IA64;
- sourceTree = "<group>";
- };
- DE66EF1108ABEE5E00323D32 /* PowerPC */ = {
- isa = PBXGroup;
- children = (
- 9FE4509A0C77A79C00C4FEA4 /* PPCCallingConv.td */,
- 9FE4509B0C77A79C00C4FEA4 /* PPCGenCallingConv.inc */,
- 841160000B66D8AC00E1293E /* PPCMachOWriterInfo.h */,
- 84115FFF0B66D89B00E1293E /* PPCMachOWriterInfo.cpp */,
- CFA702CB0A6FA8AD0006009A /* PPCGenAsmWriter.inc */,
- CFA702CC0A6FA8AD0006009A /* PPCGenCodeEmitter.inc */,
- CFA702CD0A6FA8AD0006009A /* PPCGenDAGISel.inc */,
- CFA702CE0A6FA8AD0006009A /* PPCGenInstrInfo.inc */,
- CFA702CF0A6FA8AD0006009A /* PPCGenInstrNames.inc */,
- CFA702D00A6FA8AD0006009A /* PPCGenRegisterInfo.h.inc */,
- CFA702D10A6FA8AD0006009A /* PPCGenRegisterInfo.inc */,
- CFA702D20A6FA8AD0006009A /* PPCGenRegisterNames.inc */,
- CFA702D30A6FA8AD0006009A /* PPCGenSubtarget.inc */,
- CFE421140A66FA2D00AB4BF6 /* PPC.h */,
- CFE421150A66FA2D00AB4BF6 /* PPC.td */,
- CFE421160A66FA2D00AB4BF6 /* PPCAsmPrinter.cpp */,
- CFE421170A66FA2D00AB4BF6 /* PPCBranchSelector.cpp */,
- CFE421180A66FA2D00AB4BF6 /* PPCCodeEmitter.cpp */,
- CFE421190A66FA2D00AB4BF6 /* PPCFrameInfo.h */,
- CFE4211A0A66FA2D00AB4BF6 /* PPCHazardRecognizers.cpp */,
- CFE4211B0A66FA2D00AB4BF6 /* PPCHazardRecognizers.h */,
- CFE4211C0A66FA2D00AB4BF6 /* PPCInstr64Bit.td */,
- CFE4211D0A66FA2D00AB4BF6 /* PPCInstrAltivec.td */,
- CFE4211E0A66FA2D00AB4BF6 /* PPCInstrBuilder.h */,
- CFE4211F0A66FA2D00AB4BF6 /* PPCInstrFormats.td */,
- CFE421200A66FA2D00AB4BF6 /* PPCInstrInfo.cpp */,
- CFE421210A66FA2D00AB4BF6 /* PPCInstrInfo.h */,
- CFE421220A66FA2D00AB4BF6 /* PPCInstrInfo.td */,
- CFE421230A66FA2D00AB4BF6 /* PPCISelDAGToDAG.cpp */,
- CFE421240A66FA2D00AB4BF6 /* PPCISelLowering.cpp */,
- CFE421250A66FA2D00AB4BF6 /* PPCISelLowering.h */,
- CFE421260A66FA2D00AB4BF6 /* PPCJITInfo.cpp */,
- CFE421270A66FA2D00AB4BF6 /* PPCJITInfo.h */,
- CFABD0A20B09E342003EB061 /* PPCMachineFunctionInfo.h */,
- CFE421280A66FA2D00AB4BF6 /* PPCPerfectShuffle.h */,
- CF8F1B570B64F9AC00BB4199 /* PPCPredicates.cpp */,
- CF8F1B580B64F9AC00BB4199 /* PPCPredicates.h */,
- CFE421290A66FA2D00AB4BF6 /* PPCRegisterInfo.cpp */,
- CFE4212A0A66FA2D00AB4BF6 /* PPCRegisterInfo.h */,
- CFE4212B0A66FA2D00AB4BF6 /* PPCRegisterInfo.td */,
- CFE4212C0A66FA2D00AB4BF6 /* PPCRelocations.h */,
- CFE4212D0A66FA2D00AB4BF6 /* PPCSchedule.td */,
- CFE4212E0A66FA2D00AB4BF6 /* PPCScheduleG3.td */,
- CFE4212F0A66FA2D00AB4BF6 /* PPCScheduleG4.td */,
- CFE421300A66FA2D00AB4BF6 /* PPCScheduleG4Plus.td */,
- CFE421310A66FA2D00AB4BF6 /* PPCScheduleG5.td */,
- CFE421320A66FA2E00AB4BF6 /* PPCSubtarget.cpp */,
- CFE421330A66FA2E00AB4BF6 /* PPCSubtarget.h */,
- CF341E020AB080220099B064 /* PPCTargetAsmInfo.cpp */,
- CF341E010AB080220099B064 /* PPCTargetAsmInfo.h */,
- CFE421340A66FA2E00AB4BF6 /* PPCTargetMachine.cpp */,
- CFE421350A66FA2E00AB4BF6 /* PPCTargetMachine.h */,
- CFE421360A66FA2E00AB4BF6 /* README_ALTIVEC.txt */,
- CFE421370A66FA2E00AB4BF6 /* README.txt */,
- );
- path = PowerPC;
- sourceTree = "<group>";
- };
- DE66EF7008ABEE5F00323D32 /* Sparc */ = {
- isa = PBXGroup;
- children = (
- CF65280109D1BA3800C4B521 /* SparcGenAsmWriter.inc */,
- CF65280209D1BA3800C4B521 /* SparcGenDAGISel.inc */,
- CF65280309D1BA3800C4B521 /* SparcGenInstrInfo.inc */,
- CF65280409D1BA3800C4B521 /* SparcGenInstrNames.inc */,
- CF65280509D1BA3800C4B521 /* SparcGenRegisterInfo.h.inc */,
- CF65280609D1BA3800C4B521 /* SparcGenRegisterInfo.inc */,
- CF65280709D1BA3800C4B521 /* SparcGenRegisterNames.inc */,
- CF65280809D1BA3800C4B521 /* SparcGenSubtarget.inc */,
- CF6527FA09D1BA3800C4B521 /* DelaySlotFiller.cpp */,
- CF6527FB09D1BA3800C4B521 /* FPMover.cpp */,
- CF6527FC09D1BA3800C4B521 /* Makefile */,
- CF6527FD09D1BA3800C4B521 /* README.txt */,
- CF6527FE09D1BA3800C4B521 /* Sparc.h */,
- CF6527FF09D1BA3800C4B521 /* Sparc.td */,
- CF65280009D1BA3800C4B521 /* SparcAsmPrinter.cpp */,
- CF65280909D1BA3800C4B521 /* SparcInstrFormats.td */,
- CF65280A09D1BA3800C4B521 /* SparcInstrInfo.cpp */,
- CF65280B09D1BA3800C4B521 /* SparcInstrInfo.h */,
- CF65280C09D1BA3800C4B521 /* SparcInstrInfo.td */,
- CF65280D09D1BA3800C4B521 /* SparcISelDAGToDAG.cpp */,
- CF65280E09D1BA3800C4B521 /* SparcRegisterInfo.cpp */,
- CF65280F09D1BA3800C4B521 /* SparcRegisterInfo.h */,
- CF65281009D1BA3800C4B521 /* SparcRegisterInfo.td */,
- CF65281109D1BA3800C4B521 /* SparcSubtarget.cpp */,
- CF65281209D1BA3800C4B521 /* SparcSubtarget.h */,
- CF341E230AB0814B0099B064 /* SparcTargetAsmInfo.cpp */,
- CF341E220AB0814B0099B064 /* SparcTargetAsmInfo.h */,
- CF65281309D1BA3800C4B521 /* SparcTargetMachine.cpp */,
- CF65281409D1BA3800C4B521 /* SparcTargetMachine.h */,
- );
- path = Sparc;
- sourceTree = "<group>";
- };
- DE66F09308ABEE6000323D32 /* X86 */ = {
- isa = PBXGroup;
- children = (
- 9FE4509C0C77A7BC00C4FEA4 /* README-MMX.txt */,
- 9FE4509D0C77A7BC00C4FEA4 /* X86CallingConv.td */,
- 9FE4509F0C77A7BC00C4FEA4 /* X86ELFWriterInfo.cpp */,
- 9FE450A00C77A7BC00C4FEA4 /* X86ELFWriterInfo.h */,
- 9FE450A10C77A7BC00C4FEA4 /* X86GenCallingConv.inc */,
- 9FE450A20C77A7BC00C4FEA4 /* X86InstrFormats.td */,
- CFA702D40A6FA8DD0006009A /* X86GenAsmWriter.inc */,
- CFA702D50A6FA8DD0006009A /* X86GenAsmWriter1.inc */,
- CFA702D60A6FA8DD0006009A /* X86GenDAGISel.inc */,
- CFA702D70A6FA8DD0006009A /* X86GenInstrInfo.inc */,
- CFA702D80A6FA8DD0006009A /* X86GenInstrNames.inc */,
- CFA702D90A6FA8DD0006009A /* X86GenRegisterInfo.h.inc */,
- CFA702DA0A6FA8DD0006009A /* X86GenRegisterInfo.inc */,
- CFA702DB0A6FA8DD0006009A /* X86GenRegisterNames.inc */,
- CFA702DC0A6FA8DD0006009A /* X86GenSubtarget.inc */,
- CFE421380A66FA8000AB4BF6 /* README-FPStack.txt */,
- CFE421390A66FA8000AB4BF6 /* README-SSE.txt */,
- CFD99ABE0AFE857A0068D19C /* README-X86-64.txt */,
- CFE4213A0A66FA8000AB4BF6 /* README.txt */,
- CFF0DE6309BF6C360031957F /* X86InstrFPStack.td */,
- CFF0DE6409BF6C360031957F /* X86InstrMMX.td */,
- CFF0DE6509BF6C360031957F /* X86InstrSSE.td */,
- DE66F0BC08ABEE6000323D32 /* X86.h */,
- DE66F0BD08ABEE6000323D32 /* X86.td */,
- DE66F0BE08ABEE6000323D32 /* X86AsmPrinter.cpp */,
- DE66F0BF08ABEE6000323D32 /* X86AsmPrinter.h */,
- DE66F0C008ABEE6000323D32 /* X86ATTAsmPrinter.cpp */,
- DE66F0C108ABEE6000323D32 /* X86ATTAsmPrinter.h */,
- DE66F0C208ABEE6000323D32 /* X86CodeEmitter.cpp */,
- CF8F1B590B64F9E100BB4199 /* X86COFF.h */,
- DE66F0C408ABEE6000323D32 /* X86FloatingPoint.cpp */,
- DE66F0CC08ABEE6000323D32 /* X86InstrBuilder.h */,
- DE66F0CD08ABEE6000323D32 /* X86InstrInfo.cpp */,
- DE66F0CE08ABEE6000323D32 /* X86InstrInfo.h */,
- DE66F0CF08ABEE6100323D32 /* X86InstrInfo.td */,
- DE66F0D008ABEE6100323D32 /* X86IntelAsmPrinter.cpp */,
- DE66F0D108ABEE6100323D32 /* X86IntelAsmPrinter.h */,
- DE66F0D508ABEE6100323D32 /* X86JITInfo.cpp */,
- DE66F0D608ABEE6100323D32 /* X86JITInfo.h */,
- CFE4213B0A66FA8000AB4BF6 /* X86MachineFunctionInfo.h */,
- DE66F0D808ABEE6100323D32 /* X86RegisterInfo.cpp */,
- DE66F0D908ABEE6100323D32 /* X86RegisterInfo.h */,
- DE66F0DA08ABEE6100323D32 /* X86RegisterInfo.td */,
- DE66F0DB08ABEE6100323D32 /* X86Relocations.h */,
- CFC244BB0959F24C009F8C47 /* X86ISelDAGToDAG.cpp */,
- CFC244BC0959F24C009F8C47 /* X86ISelLowering.cpp */,
- CFC244BD0959F24C009F8C47 /* X86ISelLowering.h */,
- DE66F0DC08ABEE6100323D32 /* X86Subtarget.cpp */,
- DE66F0DD08ABEE6100323D32 /* X86Subtarget.h */,
- CF341E330AB082D60099B064 /* X86TargetAsmInfo.cpp */,
- CF341E320AB082D60099B064 /* X86TargetAsmInfo.h */,
- DE66F0DE08ABEE6100323D32 /* X86TargetMachine.cpp */,
- DE66F0DF08ABEE6100323D32 /* X86TargetMachine.h */,
- );
- path = X86;
- sourceTree = "<group>";
- };
- DE66F0E108ABEFB300323D32 /* lib/Transforms */ = {
- isa = PBXGroup;
- children = (
- DE66F0EE08ABEFB300323D32 /* Instrumentation */,
- CFE4213C0A66FAE100AB4BF6 /* Hello */,
- DE66F11F08ABEFB300323D32 /* IPO */,
- DE66F15C08ABEFB400323D32 /* Scalar */,
- DE66F1BD08ABEFB400323D32 /* Utils */,
- );
- name = lib/Transforms;
- path = ../lib/Transforms;
- sourceTree = SOURCE_ROOT;
- };
- DE66F0EE08ABEFB300323D32 /* Instrumentation */ = {
- isa = PBXGroup;
- children = (
- DE66F0EF08ABEFB300323D32 /* BlockProfiling.cpp */,
- DE66F0FE08ABEFB300323D32 /* EdgeProfiling.cpp */,
- DE66F11B08ABEFB300323D32 /* ProfilingUtils.cpp */,
- DE66F11C08ABEFB300323D32 /* ProfilingUtils.h */,
- CF73C0B7098A546000627152 /* RSProfiling.cpp */,
- CF73C0B8098A546000627152 /* RSProfiling.h */,
- );
- path = Instrumentation;
- sourceTree = "<group>";
- };
- DE66F11F08ABEFB300323D32 /* IPO */ = {
- isa = PBXGroup;
- children = (
- 9F7793770C73C48A00551F9C /* StripDeadPrototypes.cpp */,
- DE66F12008ABEFB300323D32 /* ArgumentPromotion.cpp */,
- DE66F12108ABEFB300323D32 /* ConstantMerge.cpp */,
- DE66F12208ABEFB300323D32 /* DeadArgumentElimination.cpp */,
- DE66F12308ABEFB300323D32 /* DeadTypeElimination.cpp */,
- DE66F14C08ABEFB400323D32 /* GlobalDCE.cpp */,
- DE66F14D08ABEFB400323D32 /* GlobalOpt.cpp */,
- CFE4213F0A66FB5E00AB4BF6 /* IndMemRemoval.cpp */,
- DE66F14E08ABEFB400323D32 /* Inliner.cpp */,
- DE66F15008ABEFB400323D32 /* InlineSimple.cpp */,
- DE66F15108ABEFB400323D32 /* Internalize.cpp */,
- DE66F15208ABEFB400323D32 /* IPConstantPropagation.cpp */,
- DE66F15308ABEFB400323D32 /* LoopExtractor.cpp */,
- DE66F15408ABEFB400323D32 /* LowerSetJmp.cpp */,
- DE66F15608ABEFB400323D32 /* PruneEH.cpp */,
- DE66F15708ABEFB400323D32 /* RaiseAllocations.cpp */,
- DE66F15808ABEFB400323D32 /* SimplifyLibCalls.cpp */,
- DE66F15908ABEFB400323D32 /* StripSymbols.cpp */,
- );
- path = IPO;
- sourceTree = "<group>";
- };
- DE66F15C08ABEFB400323D32 /* Scalar */ = {
- isa = PBXGroup;
- children = (
- DE66F15E08ABEFB400323D32 /* ADCE.cpp */,
- DE66F15F08ABEFB400323D32 /* BasicBlockPlacement.cpp */,
- 9F7793460C73BC2000551F9C /* CodeGenPrepare.cpp */,
- DE66F16008ABEFB400323D32 /* CondPropagate.cpp */,
- DE66F16108ABEFB400323D32 /* ConstantProp.cpp */,
- DE66F16308ABEFB400323D32 /* DCE.cpp */,
- DE66F16408ABEFB400323D32 /* DeadStoreElimination.cpp */,
- DE66F1A308ABEFB400323D32 /* GCSE.cpp */,
- 9F7793470C73BC2000551F9C /* GVN.cpp */,
- 9F7793480C73BC2000551F9C /* GVNPRE.cpp */,
- DE66F1A408ABEFB400323D32 /* IndVarSimplify.cpp */,
- DE66F1A508ABEFB400323D32 /* InstructionCombining.cpp */,
- DE66F1A608ABEFB400323D32 /* LICM.cpp */,
- 9F77934A0C73BC2000551F9C /* LoopRotation.cpp */,
- 9F7793490C73BC2000551F9C /* LoopIndexSplit.cpp */,
- DE66F1A808ABEFB400323D32 /* LoopStrengthReduce.cpp */,
- DE66F1A908ABEFB400323D32 /* LoopUnroll.cpp */,
- DE66F1AA08ABEFB400323D32 /* LoopUnswitch.cpp */,
- CF8F1B5B0B64FA2F00BB4199 /* PredicateSimplifier.cpp */,
- DE66F1B508ABEFB400323D32 /* Reassociate.cpp */,
- CF73C0B9098A546000627152 /* Reg2Mem.cpp */,
- 9FEDD5F70D8D797D009F6DF1 /* Scalar.cpp */,
- DE66F1B608ABEFB400323D32 /* ScalarReplAggregates.cpp */,
- DE66F1B708ABEFB400323D32 /* SCCP.cpp */,
- DE66F1B808ABEFB400323D32 /* SimplifyCFG.cpp */,
- DE66F1B908ABEFB400323D32 /* TailDuplication.cpp */,
- DE66F1BA08ABEFB400323D32 /* TailRecursionElimination.cpp */,
- );
- path = Scalar;
- sourceTree = "<group>";
- };
- DE66F1BD08ABEFB400323D32 /* Utils */ = {
- isa = PBXGroup;
- children = (
- DE66F1BE08ABEFB400323D32 /* BasicBlockUtils.cpp */,
- 9F7793780C73C49A00551F9C /* BasicInliner.cpp */,
- DE66F1BF08ABEFB400323D32 /* BreakCriticalEdges.cpp */,
- DE66F1C008ABEFB400323D32 /* CloneFunction.cpp */,
- 9F7793790C73C49A00551F9C /* CloneLoop.cpp */,
- DE66F1C108ABEFB400323D32 /* CloneModule.cpp */,
- DE66F1C208ABEFB400323D32 /* CloneTrace.cpp */,
- DE66F1C308ABEFB400323D32 /* CodeExtractor.cpp */,
- DE66F1E008ABEFB400323D32 /* DemoteRegToStack.cpp */,
- 9F77937A0C73C49A00551F9C /* InlineCost.cpp */,
- DE66F1E108ABEFB400323D32 /* InlineFunction.cpp */,
- CF97208A0A9F3C6F002CEEDD /* LCSSA.cpp */,
- DE66F1E208ABEFB400323D32 /* Local.cpp */,
- DE4DA0390911476D0012D44B /* LoopSimplify.cpp */,
- CF97208B0A9F3C6F002CEEDD /* LowerAllocations.cpp */,
- CF97208C0A9F3C6F002CEEDD /* LowerInvoke.cpp */,
- CF97208E0A9F3C6F002CEEDD /* LowerSwitch.cpp */,
- CF97208F0A9F3C6F002CEEDD /* Mem2Reg.cpp */,
- DE66F1E408ABEFB400323D32 /* PromoteMemoryToRegister.cpp */,
- DE66F1E508ABEFB400323D32 /* SimplifyCFG.cpp */,
- DE66F1E608ABEFB400323D32 /* UnifyFunctionExitNodes.cpp */,
- DE66F1E708ABEFB400323D32 /* ValueMapper.cpp */,
- );
- path = Utils;
- sourceTree = "<group>";
- };
- DE66F1E908ABF03100323D32 /* include/llvm */ = {
- isa = PBXGroup;
- children = (
- DE66F1EB08ABF03100323D32 /* ADT */,
- DE66F20308ABF03100323D32 /* Analysis */,
- DE66F22408ABF03100323D32 /* Assembly */,
- 9F77937F0C73C54C00551F9C /* Bitcode */,
- DE66F23508ABF03100323D32 /* CodeGen */,
- DE66F24C08ABF03100323D32 /* Config */,
- DE66F25308ABF03100323D32 /* Debugger */,
- DE66F25B08ABF03100323D32 /* ExecutionEngine */,
- DE66F26E08ABF03200323D32 /* Support */,
- DE66F29408ABF03200323D32 /* System */,
- DE66F29F08ABF03200323D32 /* Target */,
- DE66F2AB08ABF03200323D32 /* Transforms */,
- DE66F1EA08ABF03100323D32 /* AbstractTypeUser.h */,
- DE66F22308ABF03100323D32 /* Argument.h */,
- 9FA638D90C77B184007F12AE /* AutoUpgrade.h */,
- DE66F22A08ABF03100323D32 /* BasicBlock.h */,
- DE66F23308ABF03100323D32 /* CallGraphSCCPass.h */,
- DE66F23408ABF03100323D32 /* CallingConv.h */,
- DE66F25108ABF03100323D32 /* Constant.h */,
- DE66F25208ABF03100323D32 /* Constants.h */,
- DE66F25A08ABF03100323D32 /* DerivedTypes.h */,
- DE66F25E08ABF03100323D32 /* Function.h */,
- 9FA638DA0C77B184007F12AE /* GlobalAlias.h */,
- DE66F25F08ABF03100323D32 /* GlobalValue.h */,
- DE66F26008ABF03100323D32 /* GlobalVariable.h */,
- CF73C0A2098A4FDF00627152 /* InlineAsm.h */,
- DE66F26108ABF03100323D32 /* InstrTypes.h */,
- DE66F26208ABF03100323D32 /* Instruction.def */,
- DE66F26308ABF03100323D32 /* Instruction.h */,
- DE66F26408ABF03100323D32 /* Instructions.h */,
- DE66F26508ABF03100323D32 /* IntrinsicInst.h */,
- DE66F26608ABF03100323D32 /* Intrinsics.h */,
- CF65223409CA39B800C4B521 /* Intrinsics.gen */,
- CFE420FF0A66F67300AB4BF6 /* IntrinsicsPowerPC.td */,
- CFE421000A66F67300AB4BF6 /* IntrinsicsX86.td */,
- CF8D62FA09C2226F006017BA /* Intrinsics.td */,
- CF9720260A9F39B9002CEEDD /* LinkAllPasses.h */,
- CFE421010A66F67300AB4BF6 /* LinkAllVMCore.h */,
- CF9720270A9F39B9002CEEDD /* LinkTimeOptimizer.h */,
- DE66F26708ABF03100323D32 /* Linker.h */,
- DE66F26808ABF03100323D32 /* Module.h */,
- DE66F26908ABF03200323D32 /* ModuleProvider.h */,
- 9F77937E0C73C53000551F9C /* ParameterAttributes.h */,
- DE66F26A08ABF03200323D32 /* Pass.h */,
- DE66F26B08ABF03200323D32 /* PassAnalysisSupport.h */,
- DE66F26C08ABF03200323D32 /* PassManager.h */,
- CF8F1B420B64F70B00BB4199 /* PassManagers.h */,
- DE66F26D08ABF03200323D32 /* PassSupport.h */,
- DE66F29308ABF03200323D32 /* SymbolTableListTraits.h */,
- DE66F2B708ABF03200323D32 /* Type.h */,
- CF73C0A3098A4FDF00627152 /* TypeSymbolTable.h */,
- DE66F2B808ABF03200323D32 /* Use.h */,
- DE66F2B908ABF03200323D32 /* User.h */,
- DE66F2BA08ABF03200323D32 /* Value.h */,
- CF73C0A4098A4FDF00627152 /* ValueSymbolTable.h */,
- );
- name = include/llvm;
- path = ../include/llvm;
- sourceTree = SOURCE_ROOT;
- };
- DE66F1EB08ABF03100323D32 /* ADT */ = {
- isa = PBXGroup;
- children = (
- 35E98A830CBC2ED300C5CDC1 /* DenseSet.h */,
- 35E98A840CBC2ED300C5CDC1 /* ImmutableMap.h */,
- 35E98A850CBC2ED300C5CDC1 /* ImmutableSet.h */,
- 9FA638DD0C77B1AB007F12AE /* BitVector.h */,
- DE66F1EE08ABF03100323D32 /* DenseMap.h */,
- DE66F1EF08ABF03100323D32 /* DepthFirstIterator.h */,
- DE66F1F008ABF03100323D32 /* EquivalenceClasses.h */,
- CF42B6BF0AF24F5300D5D47C /* FoldingSet.h */,
- CF42B6BF0AF24F5300D5D47C /* FoldingSet.h */,
- DE66F1F108ABF03100323D32 /* GraphTraits.h */,
- DE66F1F308ABF03100323D32 /* hash_map.in */,
- DE66F1F508ABF03100323D32 /* hash_set.in */,
- DE66F1F608ABF03100323D32 /* HashExtras.h */,
- DE66F1F708ABF03100323D32 /* ilist */,
- 9FA638E00C77B1AB007F12AE /* IndexedMap.h */,
- 9FE25D900CAB166D005383FC /* APFloat.h */,
- 9FA638DB0C77B1AB007F12AE /* APInt.h */,
- 9FA638DC0C77B1AB007F12AE /* APSInt.h */,
- DE66F1F908ABF03100323D32 /* iterator.in */,
- DE66F1FA08ABF03100323D32 /* PostOrderIterator.h */,
- DE66F1FB08ABF03100323D32 /* SCCIterator.h */,
- DE66F1FC08ABF03100323D32 /* SetOperations.h */,
- DE66F1FD08ABF03100323D32 /* SetVector.h */,
- 9FA638E20C77B1AB007F12AE /* SmallPtrSet.h */,
- 9FA638E30C77B1AB007F12AE /* SmallSet.h */,
- CF33BE160AF62B4200E93805 /* SmallString.h */,
- CF71B60F0AC45EDA0007F57C /* SmallVector.h */,
- 9FE25D910CAB166D005383FC /* SparseBitVector.h */,
- 9FA638E40C77B1AB007F12AE /* StringMap.h */,
- DE66F1FE08ABF03100323D32 /* Statistic.h */,
- DE66F1FF08ABF03100323D32 /* STLExtras.h */,
- DE66F20008ABF03100323D32 /* StringExtras.h */,
- DE66F20108ABF03100323D32 /* Tree.h */,
- CFF8B434097C605F0047F72A /* UniqueVector.h */,
- DE66F20208ABF03100323D32 /* VectorExtras.h */,
- );
- path = ADT;
- sourceTree = "<group>";
- };
- DE66F20308ABF03100323D32 /* Analysis */ = {
- isa = PBXGroup;
- children = (
- 9FA638E50C77B203007F12AE /* LoopPass.h */,
- 9FA638E60C77B203007F12AE /* MemoryDependenceAnalysis.h */,
- DE66F20408ABF03100323D32 /* AliasAnalysis.h */,
- DE66F20508ABF03100323D32 /* AliasSetTracker.h */,
- DE66F20608ABF03100323D32 /* CallGraph.h */,
- DE66F20708ABF03100323D32 /* CFGPrinter.h */,
- CF73C0A5098A507300627152 /* ConstantFolding.h */,
- DE66F20808ABF03100323D32 /* ConstantsScanner.h */,
- DE66F20F08ABF03100323D32 /* Dominators.h */,
- DE66F21208ABF03100323D32 /* FindUsedTypes.h */,
- DE66F21308ABF03100323D32 /* Interval.h */,
- DE66F21408ABF03100323D32 /* IntervalIterator.h */,
- DE66F21508ABF03100323D32 /* IntervalPartition.h */,
- DE66F21608ABF03100323D32 /* LoadValueNumbering.h */,
- DE66F21708ABF03100323D32 /* LoopInfo.h */,
- DE66F21808ABF03100323D32 /* Passes.h */,
- DE66F21908ABF03100323D32 /* PostDominators.h */,
- DE66F21A08ABF03100323D32 /* ProfileInfo.h */,
- DE66F21B08ABF03100323D32 /* ProfileInfoLoader.h */,
- DE66F21C08ABF03100323D32 /* ProfileInfoTypes.h */,
- DE66F21D08ABF03100323D32 /* ScalarEvolution.h */,
- DE66F21E08ABF03100323D32 /* ScalarEvolutionExpander.h */,
- DE66F21F08ABF03100323D32 /* ScalarEvolutionExpressions.h */,
- DE66F22008ABF03100323D32 /* Trace.h */,
- DE66F22108ABF03100323D32 /* ValueNumbering.h */,
- DE66F22208ABF03100323D32 /* Verifier.h */,
- );
- path = Analysis;
- sourceTree = "<group>";
- };
- DE66F22408ABF03100323D32 /* Assembly */ = {
- isa = PBXGroup;
- children = (
- DE66F22508ABF03100323D32 /* AsmAnnotationWriter.h */,
- DE66F22708ABF03100323D32 /* Parser.h */,
- DE66F22808ABF03100323D32 /* PrintModulePass.h */,
- DE66F22908ABF03100323D32 /* Writer.h */,
- );
- path = Assembly;
- sourceTree = "<group>";
- };
- DE66F23508ABF03100323D32 /* CodeGen */ = {
- isa = PBXGroup;
- children = (
- DE66F23608ABF03100323D32 /* AsmPrinter.h */,
- 9F7793860C73C57100551F9C /* CallingConvLower.h */,
- DEFAB19D0959E9A100E0AB42 /* DwarfWriter.h */,
- 9F7793870C73C57100551F9C /* ELFRelocation.h */,
- 9F7793880C73C57100551F9C /* FileWriters.h */,
- DE66F23908ABF03100323D32 /* IntrinsicLowering.h */,
- CFD7E4F30A798FC3000C7379 /* LinkAllCodegenComponents.h */,
- DE4DA03C091147920012D44B /* LiveInterval.h */,
- DE4DA03D091147920012D44B /* LiveIntervalAnalysis.h */,
- DE66F23A08ABF03100323D32 /* LiveVariables.h */,
- DE66F23B08ABF03100323D32 /* MachineBasicBlock.h */,
- DE66F23C08ABF03100323D32 /* MachineCodeEmitter.h */,
- DE66F23D08ABF03100323D32 /* MachineConstantPool.h */,
- CF6F487109505E1500BC9E82 /* MachineModuleInfo.h */,
- DE66F23E08ABF03100323D32 /* MachineFrameInfo.h */,
- DE66F23F08ABF03100323D32 /* MachineFunction.h */,
- DE66F24008ABF03100323D32 /* MachineFunctionPass.h */,
- DE66F24108ABF03100323D32 /* MachineInstr.h */,
- DE66F24208ABF03100323D32 /* MachineInstrBuilder.h */,
- CFE420FB0A66F67300AB4BF6 /* MachineJumpTableInfo.h */,
- CF6527D909D1A53400C4B521 /* MachineLocation.h */,
- CF4F27E60A7B6E23004359F6 /* MachinePassRegistry.h */,
- DE66F24308ABF03100323D32 /* MachineRelocation.h */,
- 9F7793890C73C57100551F9C /* MachORelocation.h */,
- DE66F24408ABF03100323D32 /* Passes.h */,
- CFE21C780A80CC0600D3E908 /* RegAllocRegistry.h */,
- 9FE25D920CAB169F005383FC /* RegisterCoalescer.h */,
- 9F77938A0C73C57100551F9C /* RegisterScavenging.h */,
- CF8F1B410B64F6D100BB4199 /* RuntimeLibcalls.h */,
- DE66F24508ABF03100323D32 /* SchedGraphCommon.h */,
- CF7FFA2109850864008B0087 /* ScheduleDAG.h */,
- CFE21C7B0A80CC1C00D3E908 /* SchedulerRegistry.h */,
- DE66F24608ABF03100323D32 /* SelectionDAG.h */,
- DE66F24708ABF03100323D32 /* SelectionDAGISel.h */,
- DE66F24808ABF03100323D32 /* SelectionDAGNodes.h */,
- DE66F24B08ABF03100323D32 /* ValueTypes.h */,
- CFE420FC0A66F67300AB4BF6 /* ValueTypes.td */,
- );
- path = CodeGen;
- sourceTree = "<group>";
- };
- DE66F24C08ABF03100323D32 /* Config */ = {
- isa = PBXGroup;
- children = (
- DE66F24E08ABF03100323D32 /* alloca.h */,
- CF73C0A9098A50FD00627152 /* config.h */,
- DE66F25008ABF03100323D32 /* config.h.in */,
- );
- path = Config;
- sourceTree = "<group>";
- };
- DE66F25308ABF03100323D32 /* Debugger */ = {
- isa = PBXGroup;
- children = (
- DE66F25408ABF03100323D32 /* Debugger.h */,
- DE66F25508ABF03100323D32 /* InferiorProcess.h */,
- DE66F25608ABF03100323D32 /* ProgramInfo.h */,
- DE66F25708ABF03100323D32 /* RuntimeInfo.h */,
- DE66F25808ABF03100323D32 /* SourceFile.h */,
- DE66F25908ABF03100323D32 /* SourceLanguage.h */,
- );
- path = Debugger;
- sourceTree = "<group>";
- };
- DE66F25B08ABF03100323D32 /* ExecutionEngine */ = {
- isa = PBXGroup;
- children = (
- DE66F25C08ABF03100323D32 /* ExecutionEngine.h */,
- DE66F25D08ABF03100323D32 /* GenericValue.h */,
- CFE420FD0A66F67300AB4BF6 /* Interpreter.h */,
- CFE420FE0A66F67300AB4BF6 /* JIT.h */,
- );
- path = ExecutionEngine;
- sourceTree = "<group>";
- };
- DE66F26E08ABF03200323D32 /* Support */ = {
- isa = PBXGroup;
- children = (
- F27C8CE90DAD2EF900A33844 /* IRBuilder.h */,
- DE66F27008ABF03200323D32 /* AIXDataTypesFix.h */,
- 9F5B90CE0D0CE89300CDFDEA /* AlignOf.h */,
- CF8F1B430B64F74400BB4199 /* Allocator.h */,
- DE66F27108ABF03200323D32 /* Annotation.h */,
- DE66F27208ABF03200323D32 /* CallSite.h */,
- DE66F27308ABF03200323D32 /* Casting.h */,
- DE66F27408ABF03200323D32 /* CFG.h */,
- DE66F27508ABF03200323D32 /* CommandLine.h */,
- CF8F1B440B64F74400BB4199 /* Compiler.h */,
- DE66F27708ABF03200323D32 /* ConstantRange.h */,
- CF73C0AD098A519400627152 /* DataTypes.h */,
- DE66F27908ABF03200323D32 /* DataTypes.h.in */,
- DE66F27A08ABF03200323D32 /* Debug.h */,
- DE66F27B08ABF03200323D32 /* DOTGraphTraits.h */,
- DE66F27C08ABF03200323D32 /* DynamicLinker.h */,
- DE66F27D08ABF03200323D32 /* ELF.h */,
- CF8E00490989162500DA2399 /* Dwarf.h */,
- DE66F27E08ABF03200323D32 /* FileUtilities.h */,
- DE66F27F08ABF03200323D32 /* GetElementPtrTypeIterator.h */,
- DE66F28008ABF03200323D32 /* GraphWriter.h */,
- DE66F28108ABF03200323D32 /* InstIterator.h */,
- DE66F28208ABF03200323D32 /* InstVisitor.h */,
- DE66F28308ABF03200323D32 /* LeakDetector.h */,
- CF8F1B460B64F74400BB4199 /* ManagedStatic.h */,
- DE66F28408ABF03200323D32 /* Mangler.h */,
- DE66F28508ABF03200323D32 /* MathExtras.h */,
- 9F7794880C73D51000551F9C /* MemoryBuffer.h */,
- DE66F28608ABF03200323D32 /* MutexGuard.h */,
- CF8F1B470B64F74400BB4199 /* OutputBuffer.h */,
- DE66F28708ABF03200323D32 /* PassNameParser.h */,
- DE66F28808ABF03200323D32 /* PatternMatch.h */,
- DE66F28908ABF03200323D32 /* PluginLoader.h */,
- 9F5B90CF0D0CE89300CDFDEA /* Registry.h */,
- DE66F28A08ABF03200323D32 /* SlowOperationInformer.h */,
- DE66F28B08ABF03200323D32 /* StableBasicBlockNumbering.h */,
- 9F7794890C73D51000551F9C /* Streams.h */,
- 9F5B90D00D0CE89300CDFDEA /* StringPool.h */,
- DE66F28C08ABF03200323D32 /* SystemUtils.h */,
- DE66F28E08ABF03200323D32 /* Timer.h */,
- DE66F29008ABF03200323D32 /* type_traits.h */,
- );
- path = Support;
- sourceTree = "<group>";
- };
- DE66F29408ABF03200323D32 /* System */ = {
- isa = PBXGroup;
- children = (
- CF73C0AE098A51AD00627152 /* Alarm.h */,
- 9FA638E70C77B222007F12AE /* Disassembler.h */,
- DE66F29508ABF03200323D32 /* DynamicLibrary.h */,
- CF9720340A9F3A41002CEEDD /* IncludeFile.h */,
- DE66F29608ABF03200323D32 /* LICENSE.TXT */,
- DE66F29708ABF03200323D32 /* MappedFile.h */,
- DE66F29808ABF03200323D32 /* Memory.h */,
- DE66F29908ABF03200323D32 /* Mutex.h */,
- DE66F29A08ABF03200323D32 /* Path.h */,
- DE66F29B08ABF03200323D32 /* Process.h */,
- DE66F29C08ABF03200323D32 /* Program.h */,
- DE66F29D08ABF03200323D32 /* Signals.h */,
- DE66F29E08ABF03200323D32 /* TimeValue.h */,
- );
- path = System;
- sourceTree = "<group>";
- };
- DE66F29F08ABF03200323D32 /* Target */ = {
- isa = PBXGroup;
- children = (
- DE66F2A008ABF03200323D32 /* TargetRegisterInfo.h */,
- CF9BCD0808C74DE0001E7011 /* SubtargetFeature.h */,
- CF47BD380AAF40BC00A8B13E /* TargetAsmInfo.h */,
- DE66F2A108ABF03200323D32 /* TargetData.h */,
- 9FA638E80C77B231007F12AE /* TargetELFWriterInfo.h */,
- DE66F2A208ABF03200323D32 /* TargetFrameInfo.h */,
- DE66F2A308ABF03200323D32 /* TargetInstrInfo.h */,
- CF26835B09178F5500C5F253 /* TargetInstrItineraries.h */,
- DE66F2A408ABF03200323D32 /* TargetJITInfo.h */,
- DE66F2A508ABF03200323D32 /* TargetLowering.h */,
- DE66F2A608ABF03200323D32 /* TargetMachine.h */,
- DE66F2A708ABF03200323D32 /* TargetMachineRegistry.h */,
- 8443EF210B66B62D00959964 /* TargetMachOWriterInfo.h */,
- DE66F2A808ABF03200323D32 /* TargetOptions.h */,
- DE66F2AA08ABF03200323D32 /* TargetSubtarget.h */,
- );
- path = Target;
- sourceTree = "<group>";
- };
- DE66F2AB08ABF03200323D32 /* Transforms */ = {
- isa = PBXGroup;
- children = (
- DE66F2AC08ABF03200323D32 /* Instrumentation.h */,
- 9FA638E90C77B252007F12AE /* IPO */,
- DE66F2AD08ABF03200323D32 /* IPO.h */,
- CF73C0AF098A51DD00627152 /* RSProfiling.h */,
- DE66F2AF08ABF03200323D32 /* Scalar.h */,
- DE66F2B008ABF03200323D32 /* Utils */,
- );
- path = Transforms;
- sourceTree = "<group>";
- };
- DE66F2B008ABF03200323D32 /* Utils */ = {
- isa = PBXGroup;
- children = (
- DE66F2B108ABF03200323D32 /* BasicBlockUtils.h */,
- 9FA638EB0C77B26B007F12AE /* BasicInliner.h */,
- DE66F2B208ABF03200323D32 /* Cloning.h */,
- DE66F2B308ABF03200323D32 /* FunctionUtils.h */,
- 9FA638EC0C77B26B007F12AE /* InlineCost.h */,
- DE66F2B408ABF03200323D32 /* Local.h */,
- DE66F2B508ABF03200323D32 /* PromoteMemToReg.h */,
- DE66F2B608ABF03200323D32 /* UnifyFunctionExitNodes.h */,
- );
- path = Utils;
- sourceTree = "<group>";
- };
- DE66F2BD08ABF14400323D32 /* tools */ = {
- isa = PBXGroup;
- children = (
- CFD99ADF0AFE878F0068D19C /* opt */,
- DE66F2CB08ABF14400323D32 /* bugpoint */,
- DE66F2F008ABF14400323D32 /* gccld */,
- DE66F31E08ABF14400323D32 /* llvm-db */,
- DE66F33B08ABF14400323D32 /* llvm-ld */,
- DE66F36808ABF14500323D32 /* llvmc */,
- CF8F1B5E0B64FADA00BB4199 /* llvm-upgrade */,
- CF8F1B7E0B64FADA00BB4199 /* llvm2cpp */,
- CFD99ADA0AFE87650068D19C /* lto.cpp */,
- DE66F30008ABF14400323D32 /* llc.cpp */,
- DE66F30708ABF14400323D32 /* lli.cpp */,
- DE66F30E08ABF14400323D32 /* llvm-ar.cpp */,
- DE66F31508ABF14400323D32 /* llvm-as.cpp */,
- DE66F31C08ABF14400323D32 /* llvm-bcanalyzer.cpp */,
- DE66F33208ABF14400323D32 /* llvm-dis.cpp */,
- DE66F33908ABF14400323D32 /* llvm-extract.cpp */,
- DE66F34A08ABF14400323D32 /* llvm-link.cpp */,
- DE66F35108ABF14400323D32 /* llvm-nm.cpp */,
- DE66F35808ABF14500323D32 /* llvm-prof.cpp */,
- DE66F35F08ABF14500323D32 /* llvm-ranlib.cpp */,
- CF8F1B960B64FB7F00BB4199 /* lto */,
- CF8F1BAB0B64FB8000BB4199 /* opt */,
- );
- name = tools;
- path = ../tools;
- sourceTree = SOURCE_ROOT;
- };
- DE66F2CB08ABF14400323D32 /* bugpoint */ = {
- isa = PBXGroup;
- children = (
- DE66F2CC08ABF14400323D32 /* BugDriver.cpp */,
- DE66F2CD08ABF14400323D32 /* BugDriver.h */,
- DE66F2CE08ABF14400323D32 /* bugpoint.cpp */,
- DE66F2CF08ABF14400323D32 /* CrashDebugger.cpp */,
- DE66F2E208ABF14400323D32 /* ExecutionDriver.cpp */,
- DE66F2E308ABF14400323D32 /* ExtractFunction.cpp */,
- CF9720910A9F3CC7002CEEDD /* FindBugs.cpp */,
- DE66F2E408ABF14400323D32 /* ListReducer.h */,
- DE66F2E608ABF14400323D32 /* Miscompilation.cpp */,
- DE66F2E708ABF14400323D32 /* OptimizerDriver.cpp */,
- DE66F2E808ABF14400323D32 /* TestPasses.cpp */,
- CF9720920A9F3CC7002CEEDD /* ToolRunner.cpp */,
- CF9720930A9F3CC7002CEEDD /* ToolRunner.h */,
- );
- path = bugpoint;
- sourceTree = "<group>";
- };
- DE66F2F008ABF14400323D32 /* gccld */ = {
- isa = PBXGroup;
- children = (
- );
- path = gccld;
- sourceTree = "<group>";
- };
- DE66F31E08ABF14400323D32 /* llvm-db */ = {
- isa = PBXGroup;
- children = (
- DE66F31F08ABF14400323D32 /* CLICommand.h */,
- DE66F32008ABF14400323D32 /* CLIDebugger.cpp */,
- DE66F32108ABF14400323D32 /* CLIDebugger.h */,
- DE66F32208ABF14400323D32 /* Commands.cpp */,
- DE66F32B08ABF14400323D32 /* llvm-db.cpp */,
- );
- path = "llvm-db";
- sourceTree = "<group>";
- };
- DE66F33B08ABF14400323D32 /* llvm-ld */ = {
- isa = PBXGroup;
- children = (
- DE66F34208ABF14400323D32 /* llvm-ld.cpp */,
- DE66F34408ABF14400323D32 /* Optimize.cpp */,
- );
- path = "llvm-ld";
- sourceTree = "<group>";
- };
- DE66F36808ABF14500323D32 /* llvmc */ = {
- isa = PBXGroup;
- children = (
- DE66F36908ABF14500323D32 /* c */,
- DE66F36A08ABF14500323D32 /* CompilerDriver.cpp */,
- DE66F36B08ABF14500323D32 /* CompilerDriver.h */,
- CF8F1B950B64FB5000BB4199 /* ConfigLexer.cpp */,
- DE66F36D08ABF14500323D32 /* ConfigLexer.h */,
- DE66F36E08ABF14500323D32 /* ConfigLexer.l */,
- DE66F36F08ABF14500323D32 /* Configuration.cpp */,
- DE66F37008ABF14500323D32 /* Configuration.h */,
- DE66F37108ABF14500323D32 /* cpp */,
- DE66F37D08ABF14500323D32 /* ll */,
- DE66F37E08ABF14500323D32 /* llvmc.cpp */,
- );
- path = llvmc;
- sourceTree = "<group>";
- };
- DE66F38D08ABF35C00323D32 /* docs */ = {
- isa = PBXGroup;
- children = (
- F22627310DAE34D10008F441 /* tutorial */,
- DE66F38F08ABF35C00323D32 /* AliasAnalysis.html */,
- DE66F39008ABF35C00323D32 /* Bugpoint.html */,
- DE66F39208ABF35C00323D32 /* GCCFEBuildInstrs.html */,
- DE66F39308ABF35C00323D32 /* CodeGenerator.html */,
- DE66F39408ABF35C00323D32 /* CodingStandards.html */,
- DE66F39508ABF35C00323D32 /* CommandGuide */,
- DE66F3B908ABF35D00323D32 /* CommandLine.html */,
- DE66F3BA08ABF35D00323D32 /* CompilerDriver.html */,
- DE66F3BB08ABF35D00323D32 /* CompilerWriterInfo.html */,
- DE66F3BD08ABF35D00323D32 /* doxygen.cfg.in */,
- DE66F3BE08ABF35D00323D32 /* doxygen.css */,
- DE66F3BF08ABF35D00323D32 /* doxygen.footer */,
- DE66F3C008ABF35D00323D32 /* doxygen.header */,
- DE66F3C108ABF35D00323D32 /* doxygen.intro */,
- DE66F3C208ABF35D00323D32 /* ExtendingLLVM.html */,
- DE66F3C308ABF35D00323D32 /* FAQ.html */,
- DE66F3C408ABF35D00323D32 /* GarbageCollection.html */,
- DE66F3C508ABF35D00323D32 /* GettingStarted.html */,
- DE66F3C608ABF35D00323D32 /* GettingStartedVS.html */,
- DE66F3E408ABF35D00323D32 /* HowToSubmitABug.html */,
- DE66F3E508ABF35D00323D32 /* img */,
- DE66F3EB08ABF35D00323D32 /* index.html */,
- DE66F3EC08ABF35D00323D32 /* LangRef.html */,
- DE66F3ED08ABF35D00323D32 /* Lexicon.html */,
- DE66F3EE08ABF35D00323D32 /* llvm.css */,
- DE66F3F108ABF35D00323D32 /* MakefileGuide.html */,
- DE66F3F208ABF35D00323D32 /* ProgrammersManual.html */,
- DE66F3F308ABF35D00323D32 /* Projects.html */,
- DE66F3F408ABF35D00323D32 /* ReleaseNotes.html */,
- DE66F3F508ABF35D00323D32 /* SourceLevelDebugging.html */,
- DE66F3F608ABF35D00323D32 /* Stacker.html */,
- DE66F3F708ABF35D00323D32 /* SystemLibrary.html */,
- DE66F3F808ABF35D00323D32 /* TableGenFundamentals.html */,
- DE66F3F908ABF35D00323D32 /* TestingGuide.html */,
- DE66F3FA08ABF35D00323D32 /* UsingLibraries.html */,
- DE66F3FB08ABF35D00323D32 /* WritingAnLLVMBackend.html */,
- DE66F3FC08ABF35D00323D32 /* WritingAnLLVMPass.html */,
- );
- name = docs;
- path = ../docs;
- sourceTree = SOURCE_ROOT;
- };
- DE66F39508ABF35C00323D32 /* CommandGuide */ = {
- isa = PBXGroup;
- children = (
- DE66F39808ABF35C00323D32 /* bugpoint.pod */,
- DE66F39E08ABF35C00323D32 /* index.html */,
- DE66F39F08ABF35C00323D32 /* llc.pod */,
- DE66F3A008ABF35C00323D32 /* lli.pod */,
- DE66F3A108ABF35C00323D32 /* llvm-ar.pod */,
- DE66F3A208ABF35C00323D32 /* llvm-as.pod */,
- DE66F3A308ABF35C00323D32 /* llvm-bcanalyzer.pod */,
- DE66F3A408ABF35C00323D32 /* llvm-db.pod */,
- DE66F3A508ABF35C00323D32 /* llvm-dis.pod */,
- DE66F3A608ABF35C00323D32 /* llvm-extract.pod */,
- DE66F3A708ABF35C00323D32 /* llvm-ld.pod */,
- DE66F3A808ABF35C00323D32 /* llvm-link.pod */,
- DE66F3A908ABF35C00323D32 /* llvm-nm.pod */,
- DE66F3AA08ABF35C00323D32 /* llvm-prof.pod */,
- DE66F3AB08ABF35C00323D32 /* llvm-ranlib.pod */,
- DE66F3AC08ABF35C00323D32 /* llvmc.pod */,
- DE66F3AD08ABF35C00323D32 /* llvmgcc.pod */,
- DE66F3AE08ABF35C00323D32 /* llvmgxx.pod */,
- DE66F3AF08ABF35C00323D32 /* Makefile */,
- DE66F3B408ABF35D00323D32 /* manpage.css */,
- DE66F3B508ABF35D00323D32 /* opt.pod */,
- DE66F3B808ABF35D00323D32 /* stkrc.pod */,
- );
- path = CommandGuide;
- sourceTree = "<group>";
- };
- DE66F3E508ABF35D00323D32 /* img */ = {
- isa = PBXGroup;
- children = (
- DE66F3E608ABF35D00323D32 /* Debugging.gif */,
- DE66F3E708ABF35D00323D32 /* libdeps.gif */,
- DE66F3E808ABF35D00323D32 /* lines.gif */,
- DE66F3E908ABF35D00323D32 /* objdeps.gif */,
- DE66F3EA08ABF35D00323D32 /* venusflytrap.jpg */,
- );
- path = img;
- sourceTree = "<group>";
- };
- DE66F3FD08ABF37000323D32 /* examples */ = {
- isa = PBXGroup;
- children = (
- F22761DF0DAD09CD003D8065 /* BrainF.cpp */,
- F22761E00DAD09CD003D8065 /* BrainF.h */,
- F22761E10DAD09CD003D8065 /* BrainFDriver.cpp */,
- DE66F40E08ABF37000323D32 /* fibonacci.cpp */,
- DE66F41508ABF37000323D32 /* HowToUseJIT.cpp */,
- DE66F41E08ABF37000323D32 /* ModuleMaker.cpp */,
- DE66F42608ABF37000323D32 /* ParallelJIT.cpp */,
- );
- name = examples;
- path = ../examples;
- sourceTree = SOURCE_ROOT;
- };
- DE816FAC08CFB44C0093BDEF /* utils */ = {
- isa = PBXGroup;
- children = (
- DE81705708CFB44D0093BDEF /* TableGen */,
- DE81704008CFB44D0093BDEF /* fpcmp.cpp */,
- DE81704F08CFB44D0093BDEF /* NightlyTest.gnuplot */,
- DE81705108CFB44D0093BDEF /* NightlyTestTemplate.html */,
- );
- name = utils;
- path = ../utils;
- sourceTree = SOURCE_ROOT;
- };
- DE81705708CFB44D0093BDEF /* TableGen */ = {
- isa = PBXGroup;
- children = (
- DE81705908CFB44D0093BDEF /* AsmWriterEmitter.cpp */,
- DE81705A08CFB44D0093BDEF /* AsmWriterEmitter.h */,
- DE81705B08CFB44D0093BDEF /* CodeEmitterGen.cpp */,
- DE81705C08CFB44D0093BDEF /* CodeEmitterGen.h */,
- DE81705D08CFB44D0093BDEF /* CodeGenInstruction.h */,
- CF8F1BC90B64FBD500BB4199 /* CodeGenIntrinsics.h */,
- DE81705E08CFB44D0093BDEF /* CodeGenRegisters.h */,
- DE81705F08CFB44D0093BDEF /* CodeGenTarget.cpp */,
- DE81706008CFB44D0093BDEF /* CodeGenTarget.h */,
- DE81706708CFB44D0093BDEF /* DAGISelEmitter.cpp */,
- DE81706808CFB44D0093BDEF /* DAGISelEmitter.h */,
- CF9720970A9F3D4D002CEEDD /* IntrinsicEmitter.cpp */,
- CF9720980A9F3D4D002CEEDD /* IntrinsicEmitter.h */,
- DE81708908CFB44D0093BDEF /* InstrInfoEmitter.cpp */,
- DE81708A08CFB44D0093BDEF /* InstrInfoEmitter.h */,
- DE81708E08CFB44D0093BDEF /* Record.cpp */,
- DE81708F08CFB44D0093BDEF /* Record.h */,
- DE81709008CFB44D0093BDEF /* RegisterInfoEmitter.cpp */,
- DE81709108CFB44D0093BDEF /* RegisterInfoEmitter.h */,
- DE4DA065091148520012D44B /* SubtargetEmitter.cpp */,
- DE4DA066091148520012D44B /* SubtargetEmitter.h */,
- DE8170AA08CFB44D0093BDEF /* TableGen.cpp */,
- DE8170AB08CFB44D0093BDEF /* TableGenBackend.cpp */,
- DE8170AC08CFB44D0093BDEF /* TableGenBackend.h */,
- CF490E300907BBF80072DB1C /* SubtargetEmitter.cpp */,
- CF490E2F0907BBF80072DB1C /* SubtargetEmitter.h */,
- );
- path = TableGen;
- sourceTree = "<group>";
- };
- F22627310DAE34D10008F441 /* tutorial */ = {
- isa = PBXGroup;
- children = (
- F22627320DAE34D10008F441 /* index.html */,
- F22627330DAE34D20008F441 /* JITTutorial1.html */,
- F22627340DAE34D20008F441 /* JITTutorial2-1.png */,
- F22627350DAE34D20008F441 /* JITTutorial2.html */,
- F22627360DAE34D20008F441 /* LangImpl1.html */,
- F22627370DAE34D20008F441 /* LangImpl2.html */,
- F22627380DAE34D20008F441 /* LangImpl3.html */,
- F22627390DAE34D20008F441 /* LangImpl4.html */,
- F226273A0DAE34D20008F441 /* LangImpl5-cfg.png */,
- F226273B0DAE34D20008F441 /* LangImpl5.html */,
- F226273C0DAE34D20008F441 /* LangImpl6.html */,
- F226273D0DAE34D20008F441 /* LangImpl7.html */,
- F226273E0DAE34D20008F441 /* LangImpl8.html */,
- F226273F0DAE34D20008F441 /* Makefile */,
- F22627400DAE34D20008F441 /* OCamlLangImpl1.html */,
- F22627410DAE34D20008F441 /* OCamlLangImpl2.html */,
- F22627420DAE34D20008F441 /* OCamlLangImpl3.html */,
- F22627430DAE34D20008F441 /* OCamlLangImpl4.html */,
- F22627440DAE34D20008F441 /* OCamlLangImpl5.html */,
- F22627450DAE34D20008F441 /* OCamlLangImpl6.html */,
- F22627460DAE34D20008F441 /* OCamlLangImpl7.html */,
- );
- path = tutorial;
- sourceTree = "<group>";
- };
-/* End PBXGroup section */
-
-/* Begin PBXLegacyTarget section */
- CF0329B608D1BE110030FD33 /* LLVM lib */ = {
- isa = PBXLegacyTarget;
- buildArgumentsString = "$(ACTION) -j 2";
- buildConfigurationList = CF0329B708D1BE530030FD33 /* Build configuration list for PBXLegacyTarget "LLVM lib" */;
- buildPhases = (
- );
- buildToolPath = /usr/bin/make;
- buildWorkingDirectory = "$(SRCROOT)/../lib";
- dependencies = (
- );
- name = "LLVM lib";
- passBuildSettingsInEnvironment = 0;
- productName = "LLVM lib";
- };
- CF0329BB08D1BE5D0030FD33 /* LLVM llc */ = {
- isa = PBXLegacyTarget;
- buildArgumentsString = "$(ACTION) -j 2";
- buildConfigurationList = CF0329C308D1BEC40030FD33 /* Build configuration list for PBXLegacyTarget "LLVM llc" */;
- buildPhases = (
- );
- buildToolPath = /usr/bin/make;
- buildWorkingDirectory = "$(SRCROOT)/../tools/llc";
- dependencies = (
- );
- name = "LLVM llc";
- passBuildSettingsInEnvironment = 0;
- productName = "LLVM llc";
- };
- CF490E830907CDAB0072DB1C /* LLVM TableGen */ = {
- isa = PBXLegacyTarget;
- buildArgumentsString = "$(ACTION) -j 2";
- buildConfigurationList = CF490E840907CDAB0072DB1C /* Build configuration list for PBXLegacyTarget "LLVM TableGen" */;
- buildPhases = (
- );
- buildToolPath = /usr/bin/make;
- buildWorkingDirectory = "${SRCROOT}/../utils/TableGen";
- dependencies = (
- );
- name = "LLVM TableGen";
- passBuildSettingsInEnvironment = 0;
- productName = "LLVM llc";
- };
- CFDF86BD0ADE819D00D40A3D /* LLVM lib release */ = {
- isa = PBXLegacyTarget;
- buildArgumentsString = "$(ACTION) -j 2 ENABLE_OPTIMIZED=1 DISABLE_ASSERTIONS=1";
- buildConfigurationList = CFDF86BE0ADE819D00D40A3D /* Build configuration list for PBXLegacyTarget "LLVM lib release" */;
- buildPhases = (
- );
- buildToolPath = /usr/bin/make;
- buildWorkingDirectory = "$(SRCROOT)/../lib";
- dependencies = (
- );
- name = "LLVM lib release";
- passBuildSettingsInEnvironment = 0;
- productName = "LLVM lib";
- };
- CFDF86C60ADE81D000D40A3D /* LLVM llc release */ = {
- isa = PBXLegacyTarget;
- buildArgumentsString = "$(ACTION) -j 2 ENABLE_OPTIMIZED=1 DISABLE_ASSERTIONS=1";
- buildConfigurationList = CFDF86C70ADE81D000D40A3D /* Build configuration list for PBXLegacyTarget "LLVM llc release" */;
- buildPhases = (
- );
- buildToolPath = /usr/bin/make;
- buildWorkingDirectory = "$(SRCROOT)/../tools/llc";
- dependencies = (
- );
- name = "LLVM llc release";
- passBuildSettingsInEnvironment = 0;
- productName = "LLVM llc";
- };
- D28A88AD04BDD90700651E21 /* LLVM */ = {
- isa = PBXLegacyTarget;
- buildArgumentsString = "$(ACTION) -j 2";
- buildConfigurationList = DE66EC4C08ABE78900323D32 /* Build configuration list for PBXLegacyTarget "LLVM" */;
- buildPhases = (
- );
- buildToolPath = /usr/bin/make;
- buildWorkingDirectory = "$(SRCROOT)/../";
- dependencies = (
- );
- name = LLVM;
- passBuildSettingsInEnvironment = 0;
- productName = LLVM;
- };
-/* End PBXLegacyTarget section */
-
-/* Begin PBXProject section */
- 08FB7793FE84155DC02AAC07 /* Project object */ = {
- isa = PBXProject;
- buildConfigurationList = DE66EC5008ABE78900323D32 /* Build configuration list for PBXProject "LLVM" */;
- compatibilityVersion = "Xcode 2.4";
- hasScannedForEncodings = 1;
- mainGroup = 08FB7794FE84155DC02AAC07 /* LLVM */;
- productRefGroup = 721CA1750D0B44D200D5004F /* Products */;
- projectDirPath = "";
- projectRoot = "";
- targets = (
- D28A88AD04BDD90700651E21 /* LLVM */,
- CF0329B608D1BE110030FD33 /* LLVM lib */,
- CF0329BB08D1BE5D0030FD33 /* LLVM llc */,
- CF0329BC08D1BE8E0030FD33 /* LLVM full llc */,
- CF490E830907CDAB0072DB1C /* LLVM TableGen */,
- CFDF86BD0ADE819D00D40A3D /* LLVM lib release */,
- CFDF86C60ADE81D000D40A3D /* LLVM llc release */,
- CFDF86D00ADE820000D40A3D /* LLVM full llc release */,
- );
- };
-/* End PBXProject section */
-
-/* Begin PBXTargetDependency section */
- CF0329BE08D1BE970030FD33 /* PBXTargetDependency */ = {
- isa = PBXTargetDependency;
- target = CF0329B608D1BE110030FD33 /* LLVM lib */;
- targetProxy = CF0329BD08D1BE970030FD33 /* PBXContainerItemProxy */;
- };
- CF0329C008D1BE9B0030FD33 /* PBXTargetDependency */ = {
- isa = PBXTargetDependency;
- target = CF0329BB08D1BE5D0030FD33 /* LLVM llc */;
- targetProxy = CF0329BF08D1BE9B0030FD33 /* PBXContainerItemProxy */;
- };
- CFDF86DA0ADE822100D40A3D /* PBXTargetDependency */ = {
- isa = PBXTargetDependency;
- target = CFDF86BD0ADE819D00D40A3D /* LLVM lib release */;
- targetProxy = CFDF86D90ADE822100D40A3D /* PBXContainerItemProxy */;
- };
- CFDF86DC0ADE822100D40A3D /* PBXTargetDependency */ = {
- isa = PBXTargetDependency;
- target = CFDF86C60ADE81D000D40A3D /* LLVM llc release */;
- targetProxy = CFDF86DB0ADE822100D40A3D /* PBXContainerItemProxy */;
- };
-/* End PBXTargetDependency section */
-
-/* Begin XCBuildConfiguration section */
- CF0329B808D1BE530030FD33 /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- COPY_PHASE_STRIP = NO;
- GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
- OPTIMIZATION_CFLAGS = "-O0";
- OTHER_CFLAGS = "";
- OTHER_LDFLAGS = "";
- OTHER_REZFLAGS = "";
- PRODUCT_NAME = "LLVM lib";
- SECTORDER_FLAGS = "";
- WARNING_CFLAGS = (
- "-Wmost",
- "-Wno-four-char-constants",
- "-Wno-unknown-pragmas",
- );
- };
- name = Debug;
- };
- CF0329B908D1BE530030FD33 /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- COPY_PHASE_STRIP = YES;
- GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
- OPTIMIZATION_CFLAGS = "-O0";
- OTHER_CFLAGS = "";
- OTHER_LDFLAGS = "";
- OTHER_REZFLAGS = "";
- PRODUCT_NAME = "LLVM lib";
- SECTORDER_FLAGS = "";
- WARNING_CFLAGS = (
- "-Wmost",
- "-Wno-four-char-constants",
- "-Wno-unknown-pragmas",
- );
- };
- name = Release;
- };
- CF0329C408D1BEC40030FD33 /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- COPY_PHASE_STRIP = NO;
- GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
- OPTIMIZATION_CFLAGS = "-O0";
- OTHER_CFLAGS = "";
- OTHER_LDFLAGS = "";
- OTHER_REZFLAGS = "";
- PRODUCT_NAME = "LLVM llc";
- SECTORDER_FLAGS = "";
- WARNING_CFLAGS = (
- "-Wmost",
- "-Wno-four-char-constants",
- "-Wno-unknown-pragmas",
- );
- };
- name = Debug;
- };
- CF0329C508D1BEC40030FD33 /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- COPY_PHASE_STRIP = YES;
- GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
- OPTIMIZATION_CFLAGS = "-O0";
- OTHER_CFLAGS = "";
- OTHER_LDFLAGS = "";
- OTHER_REZFLAGS = "";
- PRODUCT_NAME = "LLVM llc";
- SECTORDER_FLAGS = "";
- WARNING_CFLAGS = (
- "-Wmost",
- "-Wno-four-char-constants",
- "-Wno-unknown-pragmas",
- );
- };
- name = Release;
- };
- CF0329C808D1BEC40030FD33 /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- COPY_PHASE_STRIP = NO;
- GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
- OPTIMIZATION_CFLAGS = "-O0";
- OTHER_CFLAGS = "";
- OTHER_LDFLAGS = "";
- OTHER_REZFLAGS = "";
- PRODUCT_NAME = "LLVM full llc";
- SECTORDER_FLAGS = "";
- WARNING_CFLAGS = (
- "-Wmost",
- "-Wno-four-char-constants",
- "-Wno-unknown-pragmas",
- );
- };
- name = Debug;
- };
- CF0329C908D1BEC40030FD33 /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- COPY_PHASE_STRIP = YES;
- GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
- OPTIMIZATION_CFLAGS = "-O0";
- OTHER_CFLAGS = "";
- OTHER_LDFLAGS = "";
- OTHER_REZFLAGS = "";
- PRODUCT_NAME = "LLVM full llc";
- SECTORDER_FLAGS = "";
- WARNING_CFLAGS = (
- "-Wmost",
- "-Wno-four-char-constants",
- "-Wno-unknown-pragmas",
- );
- };
- name = Release;
- };
- CF490E850907CDAB0072DB1C /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- COPY_PHASE_STRIP = NO;
- GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
- OPTIMIZATION_CFLAGS = "-O0";
- OTHER_CFLAGS = "";
- OTHER_LDFLAGS = "";
- OTHER_REZFLAGS = "";
- PRODUCT_NAME = "LLVM TableGen";
- SECTORDER_FLAGS = "";
- WARNING_CFLAGS = (
- "-Wmost",
- "-Wno-four-char-constants",
- "-Wno-unknown-pragmas",
- );
- };
- name = Debug;
- };
- CF490E860907CDAB0072DB1C /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- COPY_PHASE_STRIP = YES;
- GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
- OPTIMIZATION_CFLAGS = "-O0";
- OTHER_CFLAGS = "";
- OTHER_LDFLAGS = "";
- OTHER_REZFLAGS = "";
- PRODUCT_NAME = "LLVM llc";
- SECTORDER_FLAGS = "";
- WARNING_CFLAGS = (
- "-Wmost",
- "-Wno-four-char-constants",
- "-Wno-unknown-pragmas",
- );
- };
- name = Release;
- };
- CFDF86BF0ADE819D00D40A3D /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- COPY_PHASE_STRIP = NO;
- GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
- OPTIMIZATION_CFLAGS = "-O0";
- OTHER_CFLAGS = "";
- OTHER_LDFLAGS = "";
- OTHER_REZFLAGS = "";
- PRODUCT_NAME = "LLVM lib";
- SECTORDER_FLAGS = "";
- WARNING_CFLAGS = (
- "-Wmost",
- "-Wno-four-char-constants",
- "-Wno-unknown-pragmas",
- );
- };
- name = Debug;
- };
- CFDF86C00ADE819D00D40A3D /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- COPY_PHASE_STRIP = YES;
- GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
- OPTIMIZATION_CFLAGS = "-O0";
- OTHER_CFLAGS = "";
- OTHER_LDFLAGS = "";
- OTHER_REZFLAGS = "";
- PRODUCT_NAME = "LLVM lib";
- SECTORDER_FLAGS = "";
- WARNING_CFLAGS = (
- "-Wmost",
- "-Wno-four-char-constants",
- "-Wno-unknown-pragmas",
- );
- };
- name = Release;
- };
- CFDF86C80ADE81D000D40A3D /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- COPY_PHASE_STRIP = NO;
- GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
- OPTIMIZATION_CFLAGS = "-O0";
- OTHER_CFLAGS = "";
- OTHER_LDFLAGS = "";
- OTHER_REZFLAGS = "";
- PRODUCT_NAME = "LLVM llc";
- SECTORDER_FLAGS = "";
- WARNING_CFLAGS = (
- "-Wmost",
- "-Wno-four-char-constants",
- "-Wno-unknown-pragmas",
- );
- };
- name = Debug;
- };
- CFDF86C90ADE81D000D40A3D /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- COPY_PHASE_STRIP = YES;
- GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
- OPTIMIZATION_CFLAGS = "-O0";
- OTHER_CFLAGS = "";
- OTHER_LDFLAGS = "";
- OTHER_REZFLAGS = "";
- PRODUCT_NAME = "LLVM llc";
- SECTORDER_FLAGS = "";
- WARNING_CFLAGS = (
- "-Wmost",
- "-Wno-four-char-constants",
- "-Wno-unknown-pragmas",
- );
- };
- name = Release;
- };
- CFDF86D60ADE820000D40A3D /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- COPY_PHASE_STRIP = NO;
- GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
- OPTIMIZATION_CFLAGS = "-O0";
- OTHER_CFLAGS = "";
- OTHER_LDFLAGS = "";
- OTHER_REZFLAGS = "";
- PRODUCT_NAME = "LLVM full llc";
- SECTORDER_FLAGS = "";
- WARNING_CFLAGS = (
- "-Wmost",
- "-Wno-four-char-constants",
- "-Wno-unknown-pragmas",
- );
- };
- name = Debug;
- };
- CFDF86D70ADE820000D40A3D /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- COPY_PHASE_STRIP = YES;
- GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
- OPTIMIZATION_CFLAGS = "-O0";
- OTHER_CFLAGS = "";
- OTHER_LDFLAGS = "";
- OTHER_REZFLAGS = "";
- PRODUCT_NAME = "LLVM full llc";
- SECTORDER_FLAGS = "";
- WARNING_CFLAGS = (
- "-Wmost",
- "-Wno-four-char-constants",
- "-Wno-unknown-pragmas",
- );
- };
- name = Release;
- };
- DE66EC4D08ABE78900323D32 /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- COPY_PHASE_STRIP = NO;
- DEBUGGING_SYMBOLS = YES;
- GCC_DYNAMIC_NO_PIC = NO;
- GCC_ENABLE_FIX_AND_CONTINUE = YES;
- GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
- GCC_OPTIMIZATION_LEVEL = 0;
- OPTIMIZATION_CFLAGS = "-O0";
- OTHER_CFLAGS = "";
- OTHER_LDFLAGS = "";
- PRODUCT_NAME = LLVM;
- ZERO_LINK = YES;
- };
- name = Debug;
- };
- DE66EC4E08ABE78900323D32 /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- COPY_PHASE_STRIP = YES;
- ENABLE_OPTIMIZED = 1;
- GCC_ENABLE_FIX_AND_CONTINUE = NO;
- OTHER_CFLAGS = "";
- OTHER_LDFLAGS = "";
- PRODUCT_NAME = LLVM;
- ZERO_LINK = NO;
- };
- name = Release;
- };
- DE66EC5108ABE78900323D32 /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- DEBUG_INFORMATION_FORMAT = dwarf;
- GCC_OPTIMIZATION_LEVEL = 0;
- USER_HEADER_SEARCH_PATHS = "../include/**";
- };
- name = Debug;
- };
- DE66EC5208ABE78900323D32 /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- DEBUG_INFORMATION_FORMAT = dwarf;
- USER_HEADER_SEARCH_PATHS = "../include/**";
- };
- name = Release;
- };
-/* End XCBuildConfiguration section */
-
-/* Begin XCConfigurationList section */
- CF0329B708D1BE530030FD33 /* Build configuration list for PBXLegacyTarget "LLVM lib" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- CF0329B808D1BE530030FD33 /* Debug */,
- CF0329B908D1BE530030FD33 /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Debug;
- };
- CF0329C308D1BEC40030FD33 /* Build configuration list for PBXLegacyTarget "LLVM llc" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- CF0329C408D1BEC40030FD33 /* Debug */,
- CF0329C508D1BEC40030FD33 /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Debug;
- };
- CF0329C708D1BEC40030FD33 /* Build configuration list for PBXAggregateTarget "LLVM full llc" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- CF0329C808D1BEC40030FD33 /* Debug */,
- CF0329C908D1BEC40030FD33 /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Debug;
- };
- CF490E840907CDAB0072DB1C /* Build configuration list for PBXLegacyTarget "LLVM TableGen" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- CF490E850907CDAB0072DB1C /* Debug */,
- CF490E860907CDAB0072DB1C /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Debug;
- };
- CFDF86BE0ADE819D00D40A3D /* Build configuration list for PBXLegacyTarget "LLVM lib release" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- CFDF86BF0ADE819D00D40A3D /* Debug */,
- CFDF86C00ADE819D00D40A3D /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Debug;
- };
- CFDF86C70ADE81D000D40A3D /* Build configuration list for PBXLegacyTarget "LLVM llc release" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- CFDF86C80ADE81D000D40A3D /* Debug */,
- CFDF86C90ADE81D000D40A3D /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Debug;
- };
- CFDF86D50ADE820000D40A3D /* Build configuration list for PBXAggregateTarget "LLVM full llc release" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- CFDF86D60ADE820000D40A3D /* Debug */,
- CFDF86D70ADE820000D40A3D /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Debug;
- };
- DE66EC4C08ABE78900323D32 /* Build configuration list for PBXLegacyTarget "LLVM" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- DE66EC4D08ABE78900323D32 /* Debug */,
- DE66EC4E08ABE78900323D32 /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Debug;
- };
- DE66EC5008ABE78900323D32 /* Build configuration list for PBXProject "LLVM" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- DE66EC5108ABE78900323D32 /* Debug */,
- DE66EC5208ABE78900323D32 /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Debug;
- };
-/* End XCConfigurationList section */
- };
- rootObject = 08FB7793FE84155DC02AAC07 /* Project object */;
-}
diff --git a/release_23/Xcode/README.txt b/release_23/Xcode/README.txt
deleted file mode 100644
index 614cd6747266..000000000000
--- a/release_23/Xcode/README.txt
+++ /dev/null
@@ -1 +0,0 @@
-Xcode project files for LLVM, for Xcode 2.1
diff --git a/release_23/autoconf/AutoRegen.sh b/release_23/autoconf/AutoRegen.sh
deleted file mode 100755
index 3dca38673718..000000000000
--- a/release_23/autoconf/AutoRegen.sh
+++ /dev/null
@@ -1,48 +0,0 @@
-#!/bin/sh
-die () {
- echo "$@" 1>&2
- exit 1
-}
-
-### NOTE: ############################################################"
-### The below two variables specify the auto* versions
-### periods should be escaped with backslash, for use by grep
-want_autoconf_version='2\.60'
-want_autoheader_version=$want_autoconf_version
-### END NOTE #########################################################"
-
-
-outfile=configure
-configfile=configure.ac
-
-want_autoconf_version_clean=`echo $want_autoconf_version | sed -e 's/\\\\//g'`
-want_autoheader_version_clean=`echo $want_autoheader_version | sed -e 's/\\\\//g'`
-
-test -d autoconf && test -f autoconf/$configfile && cd autoconf
-test -f $configfile || die "Can't find 'autoconf' dir; please cd into it first"
-autoconf --version | grep $want_autoconf_version > /dev/null
-test $? -eq 0 || die "Your autoconf was not detected as being $want_autoconf_version_clean"
-aclocal --version | grep '^aclocal.*1\.9\.6' > /dev/null
-test $? -eq 0 || die "Your aclocal was not detected as being 1.9.6"
-autoheader --version | grep '^autoheader.*'$want_autoheader_version > /dev/null
-test $? -eq 0 || die "Your autoheader was not detected as being $want_autoheader_version_clean"
-libtool --version | grep '1\.5\.22' > /dev/null
-test $? -eq 0 || die "Your libtool was not detected as being 1.5.22"
-echo ""
-echo "### NOTE: ############################################################"
-echo "### If you get *any* warnings from autoconf below you MUST fix the"
-echo "### scripts in the m4 directory because there are future forward"
-echo "### compatibility or platform support issues at risk. Please do NOT"
-echo "### commit any configure script that was generated with warnings"
-echo "### present. You should get just three 'Regenerating..' lines."
-echo "######################################################################"
-echo ""
-echo "Regenerating aclocal.m4 with aclocal 1.9.6"
-cwd=`pwd`
-aclocal --force -I $cwd/m4 || die "aclocal failed"
-echo "Regenerating configure with autoconf $want_autoconf_version_clean"
-autoconf --force --warnings=all -o ../$outfile $configfile || die "autoconf failed"
-cd ..
-echo "Regenerating config.h.in with autoheader $want_autoheader_version_clean"
-autoheader --warnings=all -I autoconf -I autoconf/m4 autoconf/$configfile || die "autoheader failed"
-exit 0
diff --git a/release_23/autoconf/LICENSE.TXT b/release_23/autoconf/LICENSE.TXT
deleted file mode 100644
index 72fdd39edcc8..000000000000
--- a/release_23/autoconf/LICENSE.TXT
+++ /dev/null
@@ -1,24 +0,0 @@
-------------------------------------------------------------------------------
-Autoconf Files
-------------------------------------------------------------------------------
-All autoconf files are licensed under the LLVM license with the following
-additions:
-
-llvm/autoconf/install-sh:
- This script is licensed under the LLVM license, with the following
- additional copyrights and restrictions:
-
- Copyright 1991 by the Massachusetts Institute of Technology
-
- Permission to use, copy, modify, distribute, and sell this software and its
- documentation for any purpose is hereby granted without fee, provided that
- the above copyright notice appear in all copies and that both that
- copyright notice and this permission notice appear in supporting
- documentation, and that the name of M.I.T. not be used in advertising or
- publicity pertaining to distribution of the software without specific,
- written prior permission. M.I.T. makes no representations about the
- suitability of this software for any purpose. It is provided "as is"
- without express or implied warranty.
-
-Please see the source files for additional copyrights.
-
diff --git a/release_23/autoconf/README.TXT b/release_23/autoconf/README.TXT
deleted file mode 100644
index 3dabdf7b8793..000000000000
--- a/release_23/autoconf/README.TXT
+++ /dev/null
@@ -1,49 +0,0 @@
-Upgrading Libtool
-===============================================================================
-
-If you are in the mood to upgrade libtool, you must do the following:
-
- 1. Get the new version of libtool and put it in <SRC>
- 2. configure/build/install libtool with --prefix=<PFX>
- 3. Copy <SRC>/ltdl.m4 to llvm/autoconf/m4
- 4. Copy <PFX>/share/aclocal/libtool.m4 to llvm/autoconf/m4/libtool.m4
- 5. Copy <PFX>/share/libtool/ltmain.sh to llvm/autoconf/ltmain.sh
- 6. Copy <PFX>/share/libtool/libltdl/ltdl.c to llvm/lib/System
- 7. Copy <PFX>/share/libtool/libltdl/ltdl.h to llvm/lib/System
- 8. Edit the ltdl.h file to #include "llvm/Config/config.h" at the very top. You
- might also need to resolve some compiler warnings (typically about
- comparison of signed vs. unsigned values). But, you won't find out about
- those until you build LLVM (step 13).
- 9. Edit the llvm/autoconf/m4/libtool.m4 file so that:
- a) in AC_PROB_LIBTOOL macro, the value of LIBTOOL is set to
- $(top_builddir)/mklib, not $(top_builddir)/libtool
- b) in AC_LIBTOOL_SETUP macro, the variable default_ofile is set to
- "mklib" instead of "libtool"
- c) s/AC_ENABLE_SHARED_DEFAULT/enable_shared_default/g
- d) s/AC_ENABLE_STATIC_DEFAULT/enable_static_default/g
- e) s/AC_ENABLE_FAST_INSTALL_DEFAULT/enable_fast_install_default/g
-10. Run "autoupdate libtool.m4 ltdl.m4" in the llvm/autoconf/m4 directory.
- This should correctly update the macro definitions in the libtool m4
- files to match the version of autoconf that LLVM uses. This converts
- AC_HELP_STRING to AS_HELP_STRING and AC_TRY_LINK to AC_LINK_IFELSE, amongst
- other things. You may need to manually adjust the files.
-11. Run AutoRegen.sh to get the new macros into configure script
-12. If there are any warnings from AutoRegen.sh, go to step 9.
-13. Rebuild LLVM, making sure it reconfigures
-14. Test the JIT which uses libltdl
-15. If it all works, only THEN commit the changes.
-
-Upgrading autoconf
-===============================================================================
-
-If you are in the mood to upgrade autoconf, you should:
-
- 1. Consider not upgrading.
- 2. No really, this is a hassle, you don't want to do it.
- 3. Get the new version of autoconf and put it in <SRC>
- 4. configure/build/install autoconf with --prefix=<PFX>
- 5. Run autoupdate on all the m4 macros in llvm/autoconf/m4
- 6. Run autoupdate on llvm/autoconf/configure.ac
- 7. Regenerate configure script with AutoRegen.sh
- 8. If there are any warnings from AutoRegen.sh, fix them and go to step 7.
- 9. Test, test, test.
diff --git a/release_23/autoconf/config.guess b/release_23/autoconf/config.guess
deleted file mode 100755
index 7d0185e019ed..000000000000
--- a/release_23/autoconf/config.guess
+++ /dev/null
@@ -1,1447 +0,0 @@
-#! /bin/sh
-# Attempt to guess a canonical system name.
-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-# 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
-
-timestamp='2004-09-07'
-
-# This file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-# Originally written by Per Bothner <per@bothner.com>.
-# Please send patches to <config-patches@gnu.org>. Submit a context
-# diff and a properly formatted ChangeLog entry.
-#
-# This script attempts to guess a canonical system name similar to
-# config.sub. If it succeeds, it prints the system name on stdout, and
-# exits with 0. Otherwise, it exits with 1.
-#
-# The plan is that this can be called by configure scripts if you
-# don't specify an explicit build system type.
-
-me=`echo "$0" | sed -e 's,.*/,,'`
-
-usage="\
-Usage: $0 [OPTION]
-
-Output the configuration name of the system \`$me' is run on.
-
-Operation modes:
- -h, --help print this help, then exit
- -t, --time-stamp print date of last modification, then exit
- -v, --version print version number, then exit
-
-Report bugs and patches to <config-patches@gnu.org>."
-
-version="\
-GNU config.guess ($timestamp)
-
-Originally written by Per Bothner.
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
-Free Software Foundation, Inc.
-
-This is free software; see the source for copying conditions. There is NO
-warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
-
-help="
-Try \`$me --help' for more information."
-
-# Parse command line
-while test $# -gt 0 ; do
- case $1 in
- --time-stamp | --time* | -t )
- echo "$timestamp" ; exit 0 ;;
- --version | -v )
- echo "$version" ; exit 0 ;;
- --help | --h* | -h )
- echo "$usage"; exit 0 ;;
- -- ) # Stop option processing
- shift; break ;;
- - ) # Use stdin as input.
- break ;;
- -* )
- echo "$me: invalid option $1$help" >&2
- exit 1 ;;
- * )
- break ;;
- esac
-done
-
-if test $# != 0; then
- echo "$me: too many arguments$help" >&2
- exit 1
-fi
-
-trap 'exit 1' 1 2 15
-
-# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
-# compiler to aid in system detection is discouraged as it requires
-# temporary files to be created and, as you can see below, it is a
-# headache to deal with in a portable fashion.
-
-# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
-# use `HOST_CC' if defined, but it is deprecated.
-
-# Portable tmp directory creation inspired by the Autoconf team.
-
-set_cc_for_build='
-trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
-trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
-: ${TMPDIR=/tmp} ;
- { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
- { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
- { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
- { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
-dummy=$tmp/dummy ;
-tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
-case $CC_FOR_BUILD,$HOST_CC,$CC in
- ,,) echo "int x;" > $dummy.c ;
- for c in cc gcc c89 c99 ; do
- if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
- CC_FOR_BUILD="$c"; break ;
- fi ;
- done ;
- if test x"$CC_FOR_BUILD" = x ; then
- CC_FOR_BUILD=no_compiler_found ;
- fi
- ;;
- ,,*) CC_FOR_BUILD=$CC ;;
- ,*,*) CC_FOR_BUILD=$HOST_CC ;;
-esac ;'
-
-# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
-# (ghazi@noc.rutgers.edu 1994-08-24)
-if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
- PATH=$PATH:/.attbin ; export PATH
-fi
-
-UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
-UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
-UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
-UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
-
-# Note: order is significant - the case branches are not exclusive.
-
-case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
- *:NetBSD:*:*)
- # NetBSD (nbsd) targets should (where applicable) match one or
- # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
- # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
- # switched to ELF, *-*-netbsd* would select the old
- # object file format. This provides both forward
- # compatibility and a consistent mechanism for selecting the
- # object file format.
- #
- # Note: NetBSD doesn't particularly care about the vendor
- # portion of the name. We always set it to "unknown".
- sysctl="sysctl -n hw.machine_arch"
- UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
- /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
- case "${UNAME_MACHINE_ARCH}" in
- armeb) machine=armeb-unknown ;;
- arm*) machine=arm-unknown ;;
- sh3el) machine=shl-unknown ;;
- sh3eb) machine=sh-unknown ;;
- *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
- esac
- # The Operating System including object format, if it has switched
- # to ELF recently, or will in the future.
- case "${UNAME_MACHINE_ARCH}" in
- arm*|i386|m68k|ns32k|sh3*|sparc|vax)
- eval $set_cc_for_build
- if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
- | grep __ELF__ >/dev/null
- then
- # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
- # Return netbsd for either. FIX?
- os=netbsd
- else
- os=netbsdelf
- fi
- ;;
- *)
- os=netbsd
- ;;
- esac
- # The OS release
- # Debian GNU/NetBSD machines have a different userland, and
- # thus, need a distinct triplet. However, they do not need
- # kernel version information, so it can be replaced with a
- # suitable tag, in the style of linux-gnu.
- case "${UNAME_VERSION}" in
- Debian*)
- release='-gnu'
- ;;
- *)
- release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
- ;;
- esac
- # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
- # contains redundant information, the shorter form:
- # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
- echo "${machine}-${os}${release}"
- exit 0 ;;
- amd64:OpenBSD:*:*)
- echo x86_64-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- amiga:OpenBSD:*:*)
- echo m68k-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- cats:OpenBSD:*:*)
- echo arm-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- hp300:OpenBSD:*:*)
- echo m68k-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- luna88k:OpenBSD:*:*)
- echo m88k-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- mac68k:OpenBSD:*:*)
- echo m68k-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- macppc:OpenBSD:*:*)
- echo powerpc-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- mvme68k:OpenBSD:*:*)
- echo m68k-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- mvme88k:OpenBSD:*:*)
- echo m88k-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- mvmeppc:OpenBSD:*:*)
- echo powerpc-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- sgi:OpenBSD:*:*)
- echo mips64-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- sun3:OpenBSD:*:*)
- echo m68k-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- *:OpenBSD:*:*)
- echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- *:ekkoBSD:*:*)
- echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
- exit 0 ;;
- macppc:MirBSD:*:*)
- echo powerppc-unknown-mirbsd${UNAME_RELEASE}
- exit 0 ;;
- *:MirBSD:*:*)
- echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
- exit 0 ;;
- alpha:OSF1:*:*)
- case $UNAME_RELEASE in
- *4.0)
- UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
- ;;
- *5.*)
- UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
- ;;
- esac
- # According to Compaq, /usr/sbin/psrinfo has been available on
- # OSF/1 and Tru64 systems produced since 1995. I hope that
- # covers most systems running today. This code pipes the CPU
- # types through head -n 1, so we only detect the type of CPU 0.
- ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1`
- case "$ALPHA_CPU_TYPE" in
- "EV4 (21064)")
- UNAME_MACHINE="alpha" ;;
- "EV4.5 (21064)")
- UNAME_MACHINE="alpha" ;;
- "LCA4 (21066/21068)")
- UNAME_MACHINE="alpha" ;;
- "EV5 (21164)")
- UNAME_MACHINE="alphaev5" ;;
- "EV5.6 (21164A)")
- UNAME_MACHINE="alphaev56" ;;
- "EV5.6 (21164PC)")
- UNAME_MACHINE="alphapca56" ;;
- "EV5.7 (21164PC)")
- UNAME_MACHINE="alphapca57" ;;
- "EV6 (21264)")
- UNAME_MACHINE="alphaev6" ;;
- "EV6.7 (21264A)")
- UNAME_MACHINE="alphaev67" ;;
- "EV6.8CB (21264C)")
- UNAME_MACHINE="alphaev68" ;;
- "EV6.8AL (21264B)")
- UNAME_MACHINE="alphaev68" ;;
- "EV6.8CX (21264D)")
- UNAME_MACHINE="alphaev68" ;;
- "EV6.9A (21264/EV69A)")
- UNAME_MACHINE="alphaev69" ;;
- "EV7 (21364)")
- UNAME_MACHINE="alphaev7" ;;
- "EV7.9 (21364A)")
- UNAME_MACHINE="alphaev79" ;;
- esac
- # A Pn.n version is a patched version.
- # A Vn.n version is a released version.
- # A Tn.n version is a released field test version.
- # A Xn.n version is an unreleased experimental baselevel.
- # 1.2 uses "1.2" for uname -r.
- echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
- exit 0 ;;
- Alpha\ *:Windows_NT*:*)
- # How do we know it's Interix rather than the generic POSIX subsystem?
- # Should we change UNAME_MACHINE based on the output of uname instead
- # of the specific Alpha model?
- echo alpha-pc-interix
- exit 0 ;;
- 21064:Windows_NT:50:3)
- echo alpha-dec-winnt3.5
- exit 0 ;;
- Amiga*:UNIX_System_V:4.0:*)
- echo m68k-unknown-sysv4
- exit 0;;
- *:[Aa]miga[Oo][Ss]:*:*)
- echo ${UNAME_MACHINE}-unknown-amigaos
- exit 0 ;;
- *:[Mm]orph[Oo][Ss]:*:*)
- echo ${UNAME_MACHINE}-unknown-morphos
- exit 0 ;;
- *:OS/390:*:*)
- echo i370-ibm-openedition
- exit 0 ;;
- *:OS400:*:*)
- echo powerpc-ibm-os400
- exit 0 ;;
- arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
- echo arm-acorn-riscix${UNAME_RELEASE}
- exit 0;;
- SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
- echo hppa1.1-hitachi-hiuxmpp
- exit 0;;
- Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
- # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
- if test "`(/bin/universe) 2>/dev/null`" = att ; then
- echo pyramid-pyramid-sysv3
- else
- echo pyramid-pyramid-bsd
- fi
- exit 0 ;;
- NILE*:*:*:dcosx)
- echo pyramid-pyramid-svr4
- exit 0 ;;
- DRS?6000:unix:4.0:6*)
- echo sparc-icl-nx6
- exit 0 ;;
- DRS?6000:UNIX_SV:4.2*:7*)
- case `/usr/bin/uname -p` in
- sparc) echo sparc-icl-nx7 && exit 0 ;;
- esac ;;
- sun4H:SunOS:5.*:*)
- echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit 0 ;;
- sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
- echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit 0 ;;
- i86pc:SunOS:5.*:*)
- echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit 0 ;;
- sun4*:SunOS:6*:*)
- # According to config.sub, this is the proper way to canonicalize
- # SunOS6. Hard to guess exactly what SunOS6 will be like, but
- # it's likely to be more like Solaris than SunOS4.
- echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit 0 ;;
- sun4*:SunOS:*:*)
- case "`/usr/bin/arch -k`" in
- Series*|S4*)
- UNAME_RELEASE=`uname -v`
- ;;
- esac
- # Japanese Language versions have a version number like `4.1.3-JL'.
- echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
- exit 0 ;;
- sun3*:SunOS:*:*)
- echo m68k-sun-sunos${UNAME_RELEASE}
- exit 0 ;;
- sun*:*:4.2BSD:*)
- UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
- test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
- case "`/bin/arch`" in
- sun3)
- echo m68k-sun-sunos${UNAME_RELEASE}
- ;;
- sun4)
- echo sparc-sun-sunos${UNAME_RELEASE}
- ;;
- esac
- exit 0 ;;
- aushp:SunOS:*:*)
- echo sparc-auspex-sunos${UNAME_RELEASE}
- exit 0 ;;
- # The situation for MiNT is a little confusing. The machine name
- # can be virtually everything (everything which is not
- # "atarist" or "atariste" at least should have a processor
- # > m68000). The system name ranges from "MiNT" over "FreeMiNT"
- # to the lowercase version "mint" (or "freemint"). Finally
- # the system name "TOS" denotes a system which is actually not
- # MiNT. But MiNT is downward compatible to TOS, so this should
- # be no problem.
- atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
- echo m68k-atari-mint${UNAME_RELEASE}
- exit 0 ;;
- atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
- echo m68k-atari-mint${UNAME_RELEASE}
- exit 0 ;;
- *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
- echo m68k-atari-mint${UNAME_RELEASE}
- exit 0 ;;
- milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
- echo m68k-milan-mint${UNAME_RELEASE}
- exit 0 ;;
- hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
- echo m68k-hades-mint${UNAME_RELEASE}
- exit 0 ;;
- *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
- echo m68k-unknown-mint${UNAME_RELEASE}
- exit 0 ;;
- m68k:machten:*:*)
- echo m68k-apple-machten${UNAME_RELEASE}
- exit 0 ;;
- powerpc:machten:*:*)
- echo powerpc-apple-machten${UNAME_RELEASE}
- exit 0 ;;
- RISC*:Mach:*:*)
- echo mips-dec-mach_bsd4.3
- exit 0 ;;
- RISC*:ULTRIX:*:*)
- echo mips-dec-ultrix${UNAME_RELEASE}
- exit 0 ;;
- VAX*:ULTRIX*:*:*)
- echo vax-dec-ultrix${UNAME_RELEASE}
- exit 0 ;;
- 2020:CLIX:*:* | 2430:CLIX:*:*)
- echo clipper-intergraph-clix${UNAME_RELEASE}
- exit 0 ;;
- mips:*:*:UMIPS | mips:*:*:RISCos)
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
-#ifdef __cplusplus
-#include <stdio.h> /* for printf() prototype */
- int main (int argc, char *argv[]) {
-#else
- int main (argc, argv) int argc; char *argv[]; {
-#endif
- #if defined (host_mips) && defined (MIPSEB)
- #if defined (SYSTYPE_SYSV)
- printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
- #endif
- #if defined (SYSTYPE_SVR4)
- printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
- #endif
- #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
- printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
- #endif
- #endif
- exit (-1);
- }
-EOF
- $CC_FOR_BUILD -o $dummy $dummy.c \
- && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
- && exit 0
- echo mips-mips-riscos${UNAME_RELEASE}
- exit 0 ;;
- Motorola:PowerMAX_OS:*:*)
- echo powerpc-motorola-powermax
- exit 0 ;;
- Motorola:*:4.3:PL8-*)
- echo powerpc-harris-powermax
- exit 0 ;;
- Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
- echo powerpc-harris-powermax
- exit 0 ;;
- Night_Hawk:Power_UNIX:*:*)
- echo powerpc-harris-powerunix
- exit 0 ;;
- m88k:CX/UX:7*:*)
- echo m88k-harris-cxux7
- exit 0 ;;
- m88k:*:4*:R4*)
- echo m88k-motorola-sysv4
- exit 0 ;;
- m88k:*:3*:R3*)
- echo m88k-motorola-sysv3
- exit 0 ;;
- AViiON:dgux:*:*)
- # DG/UX returns AViiON for all architectures
- UNAME_PROCESSOR=`/usr/bin/uname -p`
- if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
- then
- if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
- [ ${TARGET_BINARY_INTERFACE}x = x ]
- then
- echo m88k-dg-dgux${UNAME_RELEASE}
- else
- echo m88k-dg-dguxbcs${UNAME_RELEASE}
- fi
- else
- echo i586-dg-dgux${UNAME_RELEASE}
- fi
- exit 0 ;;
- M88*:DolphinOS:*:*) # DolphinOS (SVR3)
- echo m88k-dolphin-sysv3
- exit 0 ;;
- M88*:*:R3*:*)
- # Delta 88k system running SVR3
- echo m88k-motorola-sysv3
- exit 0 ;;
- XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
- echo m88k-tektronix-sysv3
- exit 0 ;;
- Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
- echo m68k-tektronix-bsd
- exit 0 ;;
- *:IRIX*:*:*)
- echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
- exit 0 ;;
- ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
- echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
- exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX '
- i*86:AIX:*:*)
- echo i386-ibm-aix
- exit 0 ;;
- ia64:AIX:*:*)
- if [ -x /usr/bin/oslevel ] ; then
- IBM_REV=`/usr/bin/oslevel`
- else
- IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
- fi
- echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
- exit 0 ;;
- *:AIX:2:3)
- if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
- #include <sys/systemcfg.h>
-
- main()
- {
- if (!__power_pc())
- exit(1);
- puts("powerpc-ibm-aix3.2.5");
- exit(0);
- }
-EOF
- $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
- echo rs6000-ibm-aix3.2.5
- elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
- echo rs6000-ibm-aix3.2.4
- else
- echo rs6000-ibm-aix3.2
- fi
- exit 0 ;;
- *:AIX:*:[45])
- IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
- if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
- IBM_ARCH=rs6000
- else
- IBM_ARCH=powerpc
- fi
- if [ -x /usr/bin/oslevel ] ; then
- IBM_REV=`/usr/bin/oslevel`
- else
- IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
- fi
- echo ${IBM_ARCH}-ibm-aix${IBM_REV}
- exit 0 ;;
- *:AIX:*:*)
- echo rs6000-ibm-aix
- exit 0 ;;
- ibmrt:4.4BSD:*|romp-ibm:BSD:*)
- echo romp-ibm-bsd4.4
- exit 0 ;;
- ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
- echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
- exit 0 ;; # report: romp-ibm BSD 4.3
- *:BOSX:*:*)
- echo rs6000-bull-bosx
- exit 0 ;;
- DPX/2?00:B.O.S.:*:*)
- echo m68k-bull-sysv3
- exit 0 ;;
- 9000/[34]??:4.3bsd:1.*:*)
- echo m68k-hp-bsd
- exit 0 ;;
- hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
- echo m68k-hp-bsd4.4
- exit 0 ;;
- 9000/[34678]??:HP-UX:*:*)
- HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
- case "${UNAME_MACHINE}" in
- 9000/31? ) HP_ARCH=m68000 ;;
- 9000/[34]?? ) HP_ARCH=m68k ;;
- 9000/[678][0-9][0-9])
- if [ -x /usr/bin/getconf ]; then
- sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
- sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
- case "${sc_cpu_version}" in
- 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
- 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
- 532) # CPU_PA_RISC2_0
- case "${sc_kernel_bits}" in
- 32) HP_ARCH="hppa2.0n" ;;
- 64) HP_ARCH="hppa2.0w" ;;
- '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20
- esac ;;
- esac
- fi
- if [ "${HP_ARCH}" = "" ]; then
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
-
- #define _HPUX_SOURCE
- #include <stdlib.h>
- #include <unistd.h>
-
- int main ()
- {
- #if defined(_SC_KERNEL_BITS)
- long bits = sysconf(_SC_KERNEL_BITS);
- #endif
- long cpu = sysconf (_SC_CPU_VERSION);
-
- switch (cpu)
- {
- case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
- case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
- case CPU_PA_RISC2_0:
- #if defined(_SC_KERNEL_BITS)
- switch (bits)
- {
- case 64: puts ("hppa2.0w"); break;
- case 32: puts ("hppa2.0n"); break;
- default: puts ("hppa2.0"); break;
- } break;
- #else /* !defined(_SC_KERNEL_BITS) */
- puts ("hppa2.0"); break;
- #endif
- default: puts ("hppa1.0"); break;
- }
- exit (0);
- }
-EOF
- (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
- test -z "$HP_ARCH" && HP_ARCH=hppa
- fi ;;
- esac
- if [ ${HP_ARCH} = "hppa2.0w" ]
- then
- # avoid double evaluation of $set_cc_for_build
- test -n "$CC_FOR_BUILD" || eval $set_cc_for_build
- if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__ >/dev/null
- then
- HP_ARCH="hppa2.0w"
- else
- HP_ARCH="hppa64"
- fi
- fi
- echo ${HP_ARCH}-hp-hpux${HPUX_REV}
- exit 0 ;;
- ia64:HP-UX:*:*)
- HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
- echo ia64-hp-hpux${HPUX_REV}
- exit 0 ;;
- 3050*:HI-UX:*:*)
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
- #include <unistd.h>
- int
- main ()
- {
- long cpu = sysconf (_SC_CPU_VERSION);
- /* The order matters, because CPU_IS_HP_MC68K erroneously returns
- true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct
- results, however. */
- if (CPU_IS_PA_RISC (cpu))
- {
- switch (cpu)
- {
- case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
- case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
- case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
- default: puts ("hppa-hitachi-hiuxwe2"); break;
- }
- }
- else if (CPU_IS_HP_MC68K (cpu))
- puts ("m68k-hitachi-hiuxwe2");
- else puts ("unknown-hitachi-hiuxwe2");
- exit (0);
- }
-EOF
- $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
- echo unknown-hitachi-hiuxwe2
- exit 0 ;;
- 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
- echo hppa1.1-hp-bsd
- exit 0 ;;
- 9000/8??:4.3bsd:*:*)
- echo hppa1.0-hp-bsd
- exit 0 ;;
- *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
- echo hppa1.0-hp-mpeix
- exit 0 ;;
- hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
- echo hppa1.1-hp-osf
- exit 0 ;;
- hp8??:OSF1:*:*)
- echo hppa1.0-hp-osf
- exit 0 ;;
- i*86:OSF1:*:*)
- if [ -x /usr/sbin/sysversion ] ; then
- echo ${UNAME_MACHINE}-unknown-osf1mk
- else
- echo ${UNAME_MACHINE}-unknown-osf1
- fi
- exit 0 ;;
- parisc*:Lites*:*:*)
- echo hppa1.1-hp-lites
- exit 0 ;;
- C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
- echo c1-convex-bsd
- exit 0 ;;
- C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
- if getsysinfo -f scalar_acc
- then echo c32-convex-bsd
- else echo c2-convex-bsd
- fi
- exit 0 ;;
- C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
- echo c34-convex-bsd
- exit 0 ;;
- C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
- echo c38-convex-bsd
- exit 0 ;;
- C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
- echo c4-convex-bsd
- exit 0 ;;
- CRAY*Y-MP:*:*:*)
- echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit 0 ;;
- CRAY*[A-Z]90:*:*:*)
- echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
- | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
- -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
- -e 's/\.[^.]*$/.X/'
- exit 0 ;;
- CRAY*TS:*:*:*)
- echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit 0 ;;
- CRAY*T3E:*:*:*)
- echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit 0 ;;
- CRAY*SV1:*:*:*)
- echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit 0 ;;
- *:UNICOS/mp:*:*)
- echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit 0 ;;
- F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
- FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
- FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
- FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
- echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
- exit 0 ;;
- 5000:UNIX_System_V:4.*:*)
- FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
- FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
- echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
- exit 0 ;;
- i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
- echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
- exit 0 ;;
- sparc*:BSD/OS:*:*)
- echo sparc-unknown-bsdi${UNAME_RELEASE}
- exit 0 ;;
- *:BSD/OS:*:*)
- echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
- exit 0 ;;
- *:FreeBSD:*:*)
- echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
- exit 0 ;;
- i*:CYGWIN*:*)
- echo ${UNAME_MACHINE}-pc-cygwin
- exit 0 ;;
- i*:MINGW*:*)
- echo ${UNAME_MACHINE}-pc-mingw32
- exit 0 ;;
- i*:PW*:*)
- echo ${UNAME_MACHINE}-pc-pw32
- exit 0 ;;
- x86:Interix*:[34]*)
- echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//'
- exit 0 ;;
- [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
- echo i${UNAME_MACHINE}-pc-mks
- exit 0 ;;
- i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
- # How do we know it's Interix rather than the generic POSIX subsystem?
- # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
- # UNAME_MACHINE based on the output of uname instead of i386?
- echo i586-pc-interix
- exit 0 ;;
- i*:UWIN*:*)
- echo ${UNAME_MACHINE}-pc-uwin
- exit 0 ;;
- p*:CYGWIN*:*)
- echo powerpcle-unknown-cygwin
- exit 0 ;;
- prep*:SunOS:5.*:*)
- echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit 0 ;;
- *:GNU:*:*)
- # the GNU system
- echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
- exit 0 ;;
- *:GNU/*:*:*)
- # other systems with GNU libc and userland
- echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
- exit 0 ;;
- i*86:Minix:*:*)
- echo ${UNAME_MACHINE}-pc-minix
- exit 0 ;;
- arm*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit 0 ;;
- cris:Linux:*:*)
- echo cris-axis-linux-gnu
- exit 0 ;;
- crisv32:Linux:*:*)
- echo crisv32-axis-linux-gnu
- exit 0 ;;
- frv:Linux:*:*)
- echo frv-unknown-linux-gnu
- exit 0 ;;
- ia64:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit 0 ;;
- m32r*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit 0 ;;
- m68*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit 0 ;;
- mips:Linux:*:*)
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
- #undef CPU
- #undef mips
- #undef mipsel
- #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
- CPU=mipsel
- #else
- #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
- CPU=mips
- #else
- CPU=
- #endif
- #endif
-EOF
- eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
- test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0
- ;;
- mips64:Linux:*:*)
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
- #undef CPU
- #undef mips64
- #undef mips64el
- #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
- CPU=mips64el
- #else
- #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
- CPU=mips64
- #else
- CPU=
- #endif
- #endif
-EOF
- eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
- test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0
- ;;
- ppc:Linux:*:*)
- echo powerpc-unknown-linux-gnu
- exit 0 ;;
- ppc64:Linux:*:*)
- echo powerpc64-unknown-linux-gnu
- exit 0 ;;
- alpha:Linux:*:*)
- case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
- EV5) UNAME_MACHINE=alphaev5 ;;
- EV56) UNAME_MACHINE=alphaev56 ;;
- PCA56) UNAME_MACHINE=alphapca56 ;;
- PCA57) UNAME_MACHINE=alphapca56 ;;
- EV6) UNAME_MACHINE=alphaev6 ;;
- EV67) UNAME_MACHINE=alphaev67 ;;
- EV68*) UNAME_MACHINE=alphaev68 ;;
- esac
- objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
- if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
- echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
- exit 0 ;;
- parisc:Linux:*:* | hppa:Linux:*:*)
- # Look for CPU level
- case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
- PA7*) echo hppa1.1-unknown-linux-gnu ;;
- PA8*) echo hppa2.0-unknown-linux-gnu ;;
- *) echo hppa-unknown-linux-gnu ;;
- esac
- exit 0 ;;
- parisc64:Linux:*:* | hppa64:Linux:*:*)
- echo hppa64-unknown-linux-gnu
- exit 0 ;;
- s390:Linux:*:* | s390x:Linux:*:*)
- echo ${UNAME_MACHINE}-ibm-linux
- exit 0 ;;
- sh64*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit 0 ;;
- sh*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit 0 ;;
- sparc:Linux:*:* | sparc64:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit 0 ;;
- x86_64:Linux:*:*)
- echo x86_64-unknown-linux-gnu
- exit 0 ;;
- i*86:Linux:*:*)
- # The BFD linker knows what the default object file format is, so
- # first see if it will tell us. cd to the root directory to prevent
- # problems with other programs or directories called `ld' in the path.
- # Set LC_ALL=C to ensure ld outputs messages in English.
- ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
- | sed -ne '/supported targets:/!d
- s/[ ][ ]*/ /g
- s/.*supported targets: *//
- s/ .*//
- p'`
- case "$ld_supported_targets" in
- elf32-i386)
- TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
- ;;
- a.out-i386-linux)
- echo "${UNAME_MACHINE}-pc-linux-gnuaout"
- exit 0 ;;
- coff-i386)
- echo "${UNAME_MACHINE}-pc-linux-gnucoff"
- exit 0 ;;
- "")
- # Either a pre-BFD a.out linker (linux-gnuoldld) or
- # one that does not give us useful --help.
- echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
- exit 0 ;;
- esac
- # Determine whether the default compiler is a.out or elf
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
- #include <features.h>
- #ifdef __ELF__
- # ifdef __GLIBC__
- # if __GLIBC__ >= 2
- LIBC=gnu
- # else
- LIBC=gnulibc1
- # endif
- # else
- LIBC=gnulibc1
- # endif
- #else
- #ifdef __INTEL_COMPILER
- LIBC=gnu
- #else
- LIBC=gnuaout
- #endif
- #endif
- #ifdef __dietlibc__
- LIBC=dietlibc
- #endif
-EOF
- eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
- test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0
- test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0
- ;;
- i*86:DYNIX/ptx:4*:*)
- # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
- # earlier versions are messed up and put the nodename in both
- # sysname and nodename.
- echo i386-sequent-sysv4
- exit 0 ;;
- i*86:UNIX_SV:4.2MP:2.*)
- # Unixware is an offshoot of SVR4, but it has its own version
- # number series starting with 2...
- # I am not positive that other SVR4 systems won't match this,
- # I just have to hope. -- rms.
- # Use sysv4.2uw... so that sysv4* matches it.
- echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
- exit 0 ;;
- i*86:OS/2:*:*)
- # If we were able to find `uname', then EMX Unix compatibility
- # is probably installed.
- echo ${UNAME_MACHINE}-pc-os2-emx
- exit 0 ;;
- i*86:XTS-300:*:STOP)
- echo ${UNAME_MACHINE}-unknown-stop
- exit 0 ;;
- i*86:atheos:*:*)
- echo ${UNAME_MACHINE}-unknown-atheos
- exit 0 ;;
- i*86:syllable:*:*)
- echo ${UNAME_MACHINE}-pc-syllable
- exit 0 ;;
- i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
- echo i386-unknown-lynxos${UNAME_RELEASE}
- exit 0 ;;
- i*86:*DOS:*:*)
- echo ${UNAME_MACHINE}-pc-msdosdjgpp
- exit 0 ;;
- i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
- UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
- if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
- echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
- else
- echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
- fi
- exit 0 ;;
- i*86:*:5:[78]*)
- case `/bin/uname -X | grep "^Machine"` in
- *486*) UNAME_MACHINE=i486 ;;
- *Pentium) UNAME_MACHINE=i586 ;;
- *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
- esac
- echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
- exit 0 ;;
- i*86:*:3.2:*)
- if test -f /usr/options/cb.name; then
- UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
- echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
- elif /bin/uname -X 2>/dev/null >/dev/null ; then
- UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
- (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
- (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
- && UNAME_MACHINE=i586
- (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
- && UNAME_MACHINE=i686
- (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
- && UNAME_MACHINE=i686
- echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
- else
- echo ${UNAME_MACHINE}-pc-sysv32
- fi
- exit 0 ;;
- pc:*:*:*)
- # Left here for compatibility:
- # uname -m prints for DJGPP always 'pc', but it prints nothing about
- # the processor, so we play safe by assuming i386.
- echo i386-pc-msdosdjgpp
- exit 0 ;;
- Intel:Mach:3*:*)
- echo i386-pc-mach3
- exit 0 ;;
- paragon:*:*:*)
- echo i860-intel-osf1
- exit 0 ;;
- i860:*:4.*:*) # i860-SVR4
- if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
- echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
- else # Add other i860-SVR4 vendors below as they are discovered.
- echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
- fi
- exit 0 ;;
- mini*:CTIX:SYS*5:*)
- # "miniframe"
- echo m68010-convergent-sysv
- exit 0 ;;
- mc68k:UNIX:SYSTEM5:3.51m)
- echo m68k-convergent-sysv
- exit 0 ;;
- M680?0:D-NIX:5.3:*)
- echo m68k-diab-dnix
- exit 0 ;;
- M68*:*:R3V[5678]*:*)
- test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
- 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
- OS_REL=''
- test -r /etc/.relid \
- && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
- /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
- && echo i486-ncr-sysv4.3${OS_REL} && exit 0
- /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
- && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;;
- 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
- /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
- && echo i486-ncr-sysv4 && exit 0 ;;
- m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
- echo m68k-unknown-lynxos${UNAME_RELEASE}
- exit 0 ;;
- mc68030:UNIX_System_V:4.*:*)
- echo m68k-atari-sysv4
- exit 0 ;;
- TSUNAMI:LynxOS:2.*:*)
- echo sparc-unknown-lynxos${UNAME_RELEASE}
- exit 0 ;;
- rs6000:LynxOS:2.*:*)
- echo rs6000-unknown-lynxos${UNAME_RELEASE}
- exit 0 ;;
- PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
- echo powerpc-unknown-lynxos${UNAME_RELEASE}
- exit 0 ;;
- SM[BE]S:UNIX_SV:*:*)
- echo mips-dde-sysv${UNAME_RELEASE}
- exit 0 ;;
- RM*:ReliantUNIX-*:*:*)
- echo mips-sni-sysv4
- exit 0 ;;
- RM*:SINIX-*:*:*)
- echo mips-sni-sysv4
- exit 0 ;;
- *:SINIX-*:*:*)
- if uname -p 2>/dev/null >/dev/null ; then
- UNAME_MACHINE=`(uname -p) 2>/dev/null`
- echo ${UNAME_MACHINE}-sni-sysv4
- else
- echo ns32k-sni-sysv
- fi
- exit 0 ;;
- PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
- # says <Richard.M.Bartel@ccMail.Census.GOV>
- echo i586-unisys-sysv4
- exit 0 ;;
- *:UNIX_System_V:4*:FTX*)
- # From Gerald Hewes <hewes@openmarket.com>.
- # How about differentiating between stratus architectures? -djm
- echo hppa1.1-stratus-sysv4
- exit 0 ;;
- *:*:*:FTX*)
- # From seanf@swdc.stratus.com.
- echo i860-stratus-sysv4
- exit 0 ;;
- *:VOS:*:*)
- # From Paul.Green@stratus.com.
- echo hppa1.1-stratus-vos
- exit 0 ;;
- mc68*:A/UX:*:*)
- echo m68k-apple-aux${UNAME_RELEASE}
- exit 0 ;;
- news*:NEWS-OS:6*:*)
- echo mips-sony-newsos6
- exit 0 ;;
- R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
- if [ -d /usr/nec ]; then
- echo mips-nec-sysv${UNAME_RELEASE}
- else
- echo mips-unknown-sysv${UNAME_RELEASE}
- fi
- exit 0 ;;
- BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
- echo powerpc-be-beos
- exit 0 ;;
- BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
- echo powerpc-apple-beos
- exit 0 ;;
- BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
- echo i586-pc-beos
- exit 0 ;;
- SX-4:SUPER-UX:*:*)
- echo sx4-nec-superux${UNAME_RELEASE}
- exit 0 ;;
- SX-5:SUPER-UX:*:*)
- echo sx5-nec-superux${UNAME_RELEASE}
- exit 0 ;;
- SX-6:SUPER-UX:*:*)
- echo sx6-nec-superux${UNAME_RELEASE}
- exit 0 ;;
- Power*:Rhapsody:*:*)
- echo powerpc-apple-rhapsody${UNAME_RELEASE}
- exit 0 ;;
- *:Rhapsody:*:*)
- echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
- exit 0 ;;
- *:Darwin:*:*)
- UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
- case $UNAME_PROCESSOR in
- *86) UNAME_PROCESSOR=i686 ;;
- unknown) UNAME_PROCESSOR=powerpc ;;
- esac
- echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
- exit 0 ;;
- *:procnto*:*:* | *:QNX:[0123456789]*:*)
- UNAME_PROCESSOR=`uname -p`
- if test "$UNAME_PROCESSOR" = "x86"; then
- UNAME_PROCESSOR=i386
- UNAME_MACHINE=pc
- fi
- echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
- exit 0 ;;
- *:QNX:*:4*)
- echo i386-pc-qnx
- exit 0 ;;
- NSR-?:NONSTOP_KERNEL:*:*)
- echo nsr-tandem-nsk${UNAME_RELEASE}
- exit 0 ;;
- *:NonStop-UX:*:*)
- echo mips-compaq-nonstopux
- exit 0 ;;
- BS2000:POSIX*:*:*)
- echo bs2000-siemens-sysv
- exit 0 ;;
- DS/*:UNIX_System_V:*:*)
- echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
- exit 0 ;;
- *:Plan9:*:*)
- # "uname -m" is not consistent, so use $cputype instead. 386
- # is converted to i386 for consistency with other x86
- # operating systems.
- if test "$cputype" = "386"; then
- UNAME_MACHINE=i386
- else
- UNAME_MACHINE="$cputype"
- fi
- echo ${UNAME_MACHINE}-unknown-plan9
- exit 0 ;;
- *:TOPS-10:*:*)
- echo pdp10-unknown-tops10
- exit 0 ;;
- *:TENEX:*:*)
- echo pdp10-unknown-tenex
- exit 0 ;;
- KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
- echo pdp10-dec-tops20
- exit 0 ;;
- XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
- echo pdp10-xkl-tops20
- exit 0 ;;
- *:TOPS-20:*:*)
- echo pdp10-unknown-tops20
- exit 0 ;;
- *:ITS:*:*)
- echo pdp10-unknown-its
- exit 0 ;;
- SEI:*:*:SEIUX)
- echo mips-sei-seiux${UNAME_RELEASE}
- exit 0 ;;
- *:DragonFly:*:*)
- echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
- exit 0 ;;
- *:*VMS:*:*)
- UNAME_MACHINE=`(uname -p) 2>/dev/null`
- case "${UNAME_MACHINE}" in
- A*) echo alpha-dec-vms && exit 0 ;;
- I*) echo ia64-dec-vms && exit 0 ;;
- V*) echo vax-dec-vms && exit 0 ;;
- esac
-esac
-
-#echo '(No uname command or uname output not recognized.)' 1>&2
-#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
-
-eval $set_cc_for_build
-cat >$dummy.c <<EOF
-#ifdef _SEQUENT_
-# include <sys/types.h>
-# include <sys/utsname.h>
-#endif
-main ()
-{
-#if defined (sony)
-#if defined (MIPSEB)
- /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed,
- I don't know.... */
- printf ("mips-sony-bsd\n"); exit (0);
-#else
-#include <sys/param.h>
- printf ("m68k-sony-newsos%s\n",
-#ifdef NEWSOS4
- "4"
-#else
- ""
-#endif
- ); exit (0);
-#endif
-#endif
-
-#if defined (__arm) && defined (__acorn) && defined (__unix)
- printf ("arm-acorn-riscix"); exit (0);
-#endif
-
-#if defined (hp300) && !defined (hpux)
- printf ("m68k-hp-bsd\n"); exit (0);
-#endif
-
-#if defined (NeXT)
-#if !defined (__ARCHITECTURE__)
-#define __ARCHITECTURE__ "m68k"
-#endif
- int version;
- version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
- if (version < 4)
- printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
- else
- printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
- exit (0);
-#endif
-
-#if defined (MULTIMAX) || defined (n16)
-#if defined (UMAXV)
- printf ("ns32k-encore-sysv\n"); exit (0);
-#else
-#if defined (CMU)
- printf ("ns32k-encore-mach\n"); exit (0);
-#else
- printf ("ns32k-encore-bsd\n"); exit (0);
-#endif
-#endif
-#endif
-
-#if defined (__386BSD__)
- printf ("i386-pc-bsd\n"); exit (0);
-#endif
-
-#if defined (sequent)
-#if defined (i386)
- printf ("i386-sequent-dynix\n"); exit (0);
-#endif
-#if defined (ns32000)
- printf ("ns32k-sequent-dynix\n"); exit (0);
-#endif
-#endif
-
-#if defined (_SEQUENT_)
- struct utsname un;
-
- uname(&un);
-
- if (strncmp(un.version, "V2", 2) == 0) {
- printf ("i386-sequent-ptx2\n"); exit (0);
- }
- if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
- printf ("i386-sequent-ptx1\n"); exit (0);
- }
- printf ("i386-sequent-ptx\n"); exit (0);
-
-#endif
-
-#if defined (vax)
-# if !defined (ultrix)
-# include <sys/param.h>
-# if defined (BSD)
-# if BSD == 43
- printf ("vax-dec-bsd4.3\n"); exit (0);
-# else
-# if BSD == 199006
- printf ("vax-dec-bsd4.3reno\n"); exit (0);
-# else
- printf ("vax-dec-bsd\n"); exit (0);
-# endif
-# endif
-# else
- printf ("vax-dec-bsd\n"); exit (0);
-# endif
-# else
- printf ("vax-dec-ultrix\n"); exit (0);
-# endif
-#endif
-
-#if defined (alliant) && defined (i860)
- printf ("i860-alliant-bsd\n"); exit (0);
-#endif
-
- exit (1);
-}
-EOF
-
-$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && exit 0
-
-# Apollos put the system type in the environment.
-
-test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; }
-
-# Convex versions that predate uname can use getsysinfo(1)
-
-if [ -x /usr/convex/getsysinfo ]
-then
- case `getsysinfo -f cpu_type` in
- c1*)
- echo c1-convex-bsd
- exit 0 ;;
- c2*)
- if getsysinfo -f scalar_acc
- then echo c32-convex-bsd
- else echo c2-convex-bsd
- fi
- exit 0 ;;
- c34*)
- echo c34-convex-bsd
- exit 0 ;;
- c38*)
- echo c38-convex-bsd
- exit 0 ;;
- c4*)
- echo c4-convex-bsd
- exit 0 ;;
- esac
-fi
-
-cat >&2 <<EOF
-$0: unable to guess system type
-
-This script, last modified $timestamp, has failed to recognize
-the operating system you are using. It is advised that you
-download the most up to date version of the config scripts from
-
- ftp://ftp.gnu.org/pub/gnu/config/
-
-If the version you run ($0) is already up to date, please
-send the following data and any information you think might be
-pertinent to <config-patches@gnu.org> in order to provide the needed
-information to handle your system.
-
-config.guess timestamp = $timestamp
-
-uname -m = `(uname -m) 2>/dev/null || echo unknown`
-uname -r = `(uname -r) 2>/dev/null || echo unknown`
-uname -s = `(uname -s) 2>/dev/null || echo unknown`
-uname -v = `(uname -v) 2>/dev/null || echo unknown`
-
-/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
-/bin/uname -X = `(/bin/uname -X) 2>/dev/null`
-
-hostinfo = `(hostinfo) 2>/dev/null`
-/bin/universe = `(/bin/universe) 2>/dev/null`
-/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null`
-/bin/arch = `(/bin/arch) 2>/dev/null`
-/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null`
-/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
-
-UNAME_MACHINE = ${UNAME_MACHINE}
-UNAME_RELEASE = ${UNAME_RELEASE}
-UNAME_SYSTEM = ${UNAME_SYSTEM}
-UNAME_VERSION = ${UNAME_VERSION}
-EOF
-
-exit 1
-
-# Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
-# time-stamp-start: "timestamp='"
-# time-stamp-format: "%:y-%02m-%02d"
-# time-stamp-end: "'"
-# End:
diff --git a/release_23/autoconf/config.sub b/release_23/autoconf/config.sub
deleted file mode 100755
index edb6b663ca2b..000000000000
--- a/release_23/autoconf/config.sub
+++ /dev/null
@@ -1,1555 +0,0 @@
-#! /bin/sh
-# Configuration validation subroutine script.
-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-# 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
-
-timestamp='2004-08-29'
-
-# This file is (in principle) common to ALL GNU software.
-# The presence of a machine in this file suggests that SOME GNU software
-# can handle that machine. It does not imply ALL GNU software can.
-#
-# This file is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330,
-# Boston, MA 02111-1307, USA.
-
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-# Please send patches to <config-patches@gnu.org>. Submit a context
-# diff and a properly formatted ChangeLog entry.
-#
-# Configuration subroutine to validate and canonicalize a configuration type.
-# Supply the specified configuration type as an argument.
-# If it is invalid, we print an error message on stderr and exit with code 1.
-# Otherwise, we print the canonical config type on stdout and succeed.
-
-# This file is supposed to be the same for all GNU packages
-# and recognize all the CPU types, system types and aliases
-# that are meaningful with *any* GNU software.
-# Each package is responsible for reporting which valid configurations
-# it does not support. The user should be able to distinguish
-# a failure to support a valid configuration from a meaningless
-# configuration.
-
-# The goal of this file is to map all the various variations of a given
-# machine specification into a single specification in the form:
-# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
-# or in some cases, the newer four-part form:
-# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
-# It is wrong to echo any other type of specification.
-
-me=`echo "$0" | sed -e 's,.*/,,'`
-
-usage="\
-Usage: $0 [OPTION] CPU-MFR-OPSYS
- $0 [OPTION] ALIAS
-
-Canonicalize a configuration name.
-
-Operation modes:
- -h, --help print this help, then exit
- -t, --time-stamp print date of last modification, then exit
- -v, --version print version number, then exit
-
-Report bugs and patches to <config-patches@gnu.org>."
-
-version="\
-GNU config.sub ($timestamp)
-
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
-Free Software Foundation, Inc.
-
-This is free software; see the source for copying conditions. There is NO
-warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
-
-help="
-Try \`$me --help' for more information."
-
-# Parse command line
-while test $# -gt 0 ; do
- case $1 in
- --time-stamp | --time* | -t )
- echo "$timestamp" ; exit 0 ;;
- --version | -v )
- echo "$version" ; exit 0 ;;
- --help | --h* | -h )
- echo "$usage"; exit 0 ;;
- -- ) # Stop option processing
- shift; break ;;
- - ) # Use stdin as input.
- break ;;
- -* )
- echo "$me: invalid option $1$help"
- exit 1 ;;
-
- *local*)
- # First pass through any local machine types.
- echo $1
- exit 0;;
-
- * )
- break ;;
- esac
-done
-
-case $# in
- 0) echo "$me: missing argument$help" >&2
- exit 1;;
- 1) ;;
- *) echo "$me: too many arguments$help" >&2
- exit 1;;
-esac
-
-# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
-# Here we must recognize all the valid KERNEL-OS combinations.
-maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
-case $maybe_os in
- nto-qnx* | linux-gnu* | linux-dietlibc | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | \
- kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*)
- os=-$maybe_os
- basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
- ;;
- *)
- basic_machine=`echo $1 | sed 's/-[^-]*$//'`
- if [ $basic_machine != $1 ]
- then os=`echo $1 | sed 's/.*-/-/'`
- else os=; fi
- ;;
-esac
-
-### Let's recognize common machines as not being operating systems so
-### that things like config.sub decstation-3100 work. We also
-### recognize some manufacturers as not being operating systems, so we
-### can provide default operating systems below.
-case $os in
- -sun*os*)
- # Prevent following clause from handling this invalid input.
- ;;
- -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
- -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
- -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
- -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
- -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
- -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
- -apple | -axis | -knuth | -cray)
- os=
- basic_machine=$1
- ;;
- -sim | -cisco | -oki | -wec | -winbond)
- os=
- basic_machine=$1
- ;;
- -scout)
- ;;
- -wrs)
- os=-vxworks
- basic_machine=$1
- ;;
- -chorusos*)
- os=-chorusos
- basic_machine=$1
- ;;
- -chorusrdb)
- os=-chorusrdb
- basic_machine=$1
- ;;
- -hiux*)
- os=-hiuxwe2
- ;;
- -sco5)
- os=-sco3.2v5
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco4)
- os=-sco3.2v4
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco3.2.[4-9]*)
- os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco3.2v[4-9]*)
- # Don't forget version if it is 3.2v4 or newer.
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco*)
- os=-sco3.2v2
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -udk*)
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -isc)
- os=-isc2.2
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -clix*)
- basic_machine=clipper-intergraph
- ;;
- -isc*)
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -lynx*)
- os=-lynxos
- ;;
- -ptx*)
- basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
- ;;
- -windowsnt*)
- os=`echo $os | sed -e 's/windowsnt/winnt/'`
- ;;
- -psos*)
- os=-psos
- ;;
- -mint | -mint[0-9]*)
- basic_machine=m68k-atari
- os=-mint
- ;;
-esac
-
-# Decode aliases for certain CPU-COMPANY combinations.
-case $basic_machine in
- # Recognize the basic CPU types without company name.
- # Some are omitted here because they have special meanings below.
- 1750a | 580 \
- | a29k \
- | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
- | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
- | am33_2.0 \
- | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \
- | c4x | clipper \
- | d10v | d30v | dlx | dsp16xx \
- | fr30 | frv \
- | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
- | i370 | i860 | i960 | ia64 \
- | ip2k | iq2000 \
- | m32r | m32rle | m68000 | m68k | m88k | mcore \
- | mips | mipsbe | mipseb | mipsel | mipsle \
- | mips16 \
- | mips64 | mips64el \
- | mips64vr | mips64vrel \
- | mips64orion | mips64orionel \
- | mips64vr4100 | mips64vr4100el \
- | mips64vr4300 | mips64vr4300el \
- | mips64vr5000 | mips64vr5000el \
- | mipsisa32 | mipsisa32el \
- | mipsisa32r2 | mipsisa32r2el \
- | mipsisa64 | mipsisa64el \
- | mipsisa64r2 | mipsisa64r2el \
- | mipsisa64sb1 | mipsisa64sb1el \
- | mipsisa64sr71k | mipsisa64sr71kel \
- | mipstx39 | mipstx39el \
- | mn10200 | mn10300 \
- | msp430 \
- | ns16k | ns32k \
- | openrisc | or32 \
- | pdp10 | pdp11 | pj | pjl \
- | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
- | pyramid \
- | sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \
- | sh64 | sh64le \
- | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv8 | sparcv9 | sparcv9b \
- | strongarm \
- | tahoe | thumb | tic4x | tic80 | tron \
- | v850 | v850e \
- | we32k \
- | x86 | xscale | xstormy16 | xtensa \
- | z8k)
- basic_machine=$basic_machine-unknown
- ;;
- m6811 | m68hc11 | m6812 | m68hc12)
- # Motorola 68HC11/12.
- basic_machine=$basic_machine-unknown
- os=-none
- ;;
- m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
- ;;
-
- # We use `pc' rather than `unknown'
- # because (1) that's what they normally are, and
- # (2) the word "unknown" tends to confuse beginning users.
- i*86 | x86_64)
- basic_machine=$basic_machine-pc
- ;;
- # Object if more than one company name word.
- *-*-*)
- echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
- exit 1
- ;;
- # Recognize the basic CPU types with company name.
- 580-* \
- | a29k-* \
- | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
- | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
- | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
- | arm-* | armbe-* | armle-* | armeb-* | armv*-* \
- | avr-* \
- | bs2000-* \
- | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
- | clipper-* | craynv-* | cydra-* \
- | d10v-* | d30v-* | dlx-* \
- | elxsi-* \
- | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \
- | h8300-* | h8500-* \
- | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
- | i*86-* | i860-* | i960-* | ia64-* \
- | ip2k-* | iq2000-* \
- | m32r-* | m32rle-* \
- | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
- | m88110-* | m88k-* | mcore-* \
- | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
- | mips16-* \
- | mips64-* | mips64el-* \
- | mips64vr-* | mips64vrel-* \
- | mips64orion-* | mips64orionel-* \
- | mips64vr4100-* | mips64vr4100el-* \
- | mips64vr4300-* | mips64vr4300el-* \
- | mips64vr5000-* | mips64vr5000el-* \
- | mipsisa32-* | mipsisa32el-* \
- | mipsisa32r2-* | mipsisa32r2el-* \
- | mipsisa64-* | mipsisa64el-* \
- | mipsisa64r2-* | mipsisa64r2el-* \
- | mipsisa64sb1-* | mipsisa64sb1el-* \
- | mipsisa64sr71k-* | mipsisa64sr71kel-* \
- | mipstx39-* | mipstx39el-* \
- | mmix-* \
- | msp430-* \
- | none-* | np1-* | ns16k-* | ns32k-* \
- | orion-* \
- | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
- | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
- | pyramid-* \
- | romp-* | rs6000-* \
- | sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \
- | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
- | sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \
- | sparcv8-* | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \
- | tahoe-* | thumb-* \
- | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
- | tron-* \
- | v850-* | v850e-* | vax-* \
- | we32k-* \
- | x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \
- | xtensa-* \
- | ymp-* \
- | z8k-*)
- ;;
- # Recognize the various machine names and aliases which stand
- # for a CPU type and a company and sometimes even an OS.
- 386bsd)
- basic_machine=i386-unknown
- os=-bsd
- ;;
- 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
- basic_machine=m68000-att
- ;;
- 3b*)
- basic_machine=we32k-att
- ;;
- a29khif)
- basic_machine=a29k-amd
- os=-udi
- ;;
- abacus)
- basic_machine=abacus-unknown
- ;;
- adobe68k)
- basic_machine=m68010-adobe
- os=-scout
- ;;
- alliant | fx80)
- basic_machine=fx80-alliant
- ;;
- altos | altos3068)
- basic_machine=m68k-altos
- ;;
- am29k)
- basic_machine=a29k-none
- os=-bsd
- ;;
- amd64)
- basic_machine=x86_64-pc
- ;;
- amd64-*)
- basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- amdahl)
- basic_machine=580-amdahl
- os=-sysv
- ;;
- amiga | amiga-*)
- basic_machine=m68k-unknown
- ;;
- amigaos | amigados)
- basic_machine=m68k-unknown
- os=-amigaos
- ;;
- amigaunix | amix)
- basic_machine=m68k-unknown
- os=-sysv4
- ;;
- apollo68)
- basic_machine=m68k-apollo
- os=-sysv
- ;;
- apollo68bsd)
- basic_machine=m68k-apollo
- os=-bsd
- ;;
- aux)
- basic_machine=m68k-apple
- os=-aux
- ;;
- balance)
- basic_machine=ns32k-sequent
- os=-dynix
- ;;
- c90)
- basic_machine=c90-cray
- os=-unicos
- ;;
- convex-c1)
- basic_machine=c1-convex
- os=-bsd
- ;;
- convex-c2)
- basic_machine=c2-convex
- os=-bsd
- ;;
- convex-c32)
- basic_machine=c32-convex
- os=-bsd
- ;;
- convex-c34)
- basic_machine=c34-convex
- os=-bsd
- ;;
- convex-c38)
- basic_machine=c38-convex
- os=-bsd
- ;;
- cray | j90)
- basic_machine=j90-cray
- os=-unicos
- ;;
- craynv)
- basic_machine=craynv-cray
- os=-unicosmp
- ;;
- cr16c)
- basic_machine=cr16c-unknown
- os=-elf
- ;;
- crds | unos)
- basic_machine=m68k-crds
- ;;
- crisv32 | crisv32-* | etraxfs*)
- basic_machine=crisv32-axis
- ;;
- cris | cris-* | etrax*)
- basic_machine=cris-axis
- ;;
- crx)
- basic_machine=crx-unknown
- os=-elf
- ;;
- da30 | da30-*)
- basic_machine=m68k-da30
- ;;
- decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
- basic_machine=mips-dec
- ;;
- decsystem10* | dec10*)
- basic_machine=pdp10-dec
- os=-tops10
- ;;
- decsystem20* | dec20*)
- basic_machine=pdp10-dec
- os=-tops20
- ;;
- delta | 3300 | motorola-3300 | motorola-delta \
- | 3300-motorola | delta-motorola)
- basic_machine=m68k-motorola
- ;;
- delta88)
- basic_machine=m88k-motorola
- os=-sysv3
- ;;
- dpx20 | dpx20-*)
- basic_machine=rs6000-bull
- os=-bosx
- ;;
- dpx2* | dpx2*-bull)
- basic_machine=m68k-bull
- os=-sysv3
- ;;
- ebmon29k)
- basic_machine=a29k-amd
- os=-ebmon
- ;;
- elxsi)
- basic_machine=elxsi-elxsi
- os=-bsd
- ;;
- encore | umax | mmax)
- basic_machine=ns32k-encore
- ;;
- es1800 | OSE68k | ose68k | ose | OSE)
- basic_machine=m68k-ericsson
- os=-ose
- ;;
- fx2800)
- basic_machine=i860-alliant
- ;;
- genix)
- basic_machine=ns32k-ns
- ;;
- gmicro)
- basic_machine=tron-gmicro
- os=-sysv
- ;;
- go32)
- basic_machine=i386-pc
- os=-go32
- ;;
- h3050r* | hiux*)
- basic_machine=hppa1.1-hitachi
- os=-hiuxwe2
- ;;
- h8300hms)
- basic_machine=h8300-hitachi
- os=-hms
- ;;
- h8300xray)
- basic_machine=h8300-hitachi
- os=-xray
- ;;
- h8500hms)
- basic_machine=h8500-hitachi
- os=-hms
- ;;
- harris)
- basic_machine=m88k-harris
- os=-sysv3
- ;;
- hp300-*)
- basic_machine=m68k-hp
- ;;
- hp300bsd)
- basic_machine=m68k-hp
- os=-bsd
- ;;
- hp300hpux)
- basic_machine=m68k-hp
- os=-hpux
- ;;
- hp3k9[0-9][0-9] | hp9[0-9][0-9])
- basic_machine=hppa1.0-hp
- ;;
- hp9k2[0-9][0-9] | hp9k31[0-9])
- basic_machine=m68000-hp
- ;;
- hp9k3[2-9][0-9])
- basic_machine=m68k-hp
- ;;
- hp9k6[0-9][0-9] | hp6[0-9][0-9])
- basic_machine=hppa1.0-hp
- ;;
- hp9k7[0-79][0-9] | hp7[0-79][0-9])
- basic_machine=hppa1.1-hp
- ;;
- hp9k78[0-9] | hp78[0-9])
- # FIXME: really hppa2.0-hp
- basic_machine=hppa1.1-hp
- ;;
- hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
- # FIXME: really hppa2.0-hp
- basic_machine=hppa1.1-hp
- ;;
- hp9k8[0-9][13679] | hp8[0-9][13679])
- basic_machine=hppa1.1-hp
- ;;
- hp9k8[0-9][0-9] | hp8[0-9][0-9])
- basic_machine=hppa1.0-hp
- ;;
- hppa-next)
- os=-nextstep3
- ;;
- hppaosf)
- basic_machine=hppa1.1-hp
- os=-osf
- ;;
- hppro)
- basic_machine=hppa1.1-hp
- os=-proelf
- ;;
- i370-ibm* | ibm*)
- basic_machine=i370-ibm
- ;;
-# I'm not sure what "Sysv32" means. Should this be sysv3.2?
- i*86v32)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
- os=-sysv32
- ;;
- i*86v4*)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
- os=-sysv4
- ;;
- i*86v)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
- os=-sysv
- ;;
- i*86sol2)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
- os=-solaris2
- ;;
- i386mach)
- basic_machine=i386-mach
- os=-mach
- ;;
- i386-vsta | vsta)
- basic_machine=i386-unknown
- os=-vsta
- ;;
- iris | iris4d)
- basic_machine=mips-sgi
- case $os in
- -irix*)
- ;;
- *)
- os=-irix4
- ;;
- esac
- ;;
- isi68 | isi)
- basic_machine=m68k-isi
- os=-sysv
- ;;
- m88k-omron*)
- basic_machine=m88k-omron
- ;;
- magnum | m3230)
- basic_machine=mips-mips
- os=-sysv
- ;;
- merlin)
- basic_machine=ns32k-utek
- os=-sysv
- ;;
- mingw32)
- basic_machine=i386-pc
- os=-mingw32
- ;;
- miniframe)
- basic_machine=m68000-convergent
- ;;
- *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
- basic_machine=m68k-atari
- os=-mint
- ;;
- mips3*-*)
- basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
- ;;
- mips3*)
- basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
- ;;
- monitor)
- basic_machine=m68k-rom68k
- os=-coff
- ;;
- morphos)
- basic_machine=powerpc-unknown
- os=-morphos
- ;;
- msdos)
- basic_machine=i386-pc
- os=-msdos
- ;;
- mvs)
- basic_machine=i370-ibm
- os=-mvs
- ;;
- ncr3000)
- basic_machine=i486-ncr
- os=-sysv4
- ;;
- netbsd386)
- basic_machine=i386-unknown
- os=-netbsd
- ;;
- netwinder)
- basic_machine=armv4l-rebel
- os=-linux
- ;;
- news | news700 | news800 | news900)
- basic_machine=m68k-sony
- os=-newsos
- ;;
- news1000)
- basic_machine=m68030-sony
- os=-newsos
- ;;
- news-3600 | risc-news)
- basic_machine=mips-sony
- os=-newsos
- ;;
- necv70)
- basic_machine=v70-nec
- os=-sysv
- ;;
- next | m*-next )
- basic_machine=m68k-next
- case $os in
- -nextstep* )
- ;;
- -ns2*)
- os=-nextstep2
- ;;
- *)
- os=-nextstep3
- ;;
- esac
- ;;
- nh3000)
- basic_machine=m68k-harris
- os=-cxux
- ;;
- nh[45]000)
- basic_machine=m88k-harris
- os=-cxux
- ;;
- nindy960)
- basic_machine=i960-intel
- os=-nindy
- ;;
- mon960)
- basic_machine=i960-intel
- os=-mon960
- ;;
- nonstopux)
- basic_machine=mips-compaq
- os=-nonstopux
- ;;
- np1)
- basic_machine=np1-gould
- ;;
- nsr-tandem)
- basic_machine=nsr-tandem
- ;;
- op50n-* | op60c-*)
- basic_machine=hppa1.1-oki
- os=-proelf
- ;;
- or32 | or32-*)
- basic_machine=or32-unknown
- os=-coff
- ;;
- os400)
- basic_machine=powerpc-ibm
- os=-os400
- ;;
- OSE68000 | ose68000)
- basic_machine=m68000-ericsson
- os=-ose
- ;;
- os68k)
- basic_machine=m68k-none
- os=-os68k
- ;;
- pa-hitachi)
- basic_machine=hppa1.1-hitachi
- os=-hiuxwe2
- ;;
- paragon)
- basic_machine=i860-intel
- os=-osf
- ;;
- pbd)
- basic_machine=sparc-tti
- ;;
- pbb)
- basic_machine=m68k-tti
- ;;
- pc532 | pc532-*)
- basic_machine=ns32k-pc532
- ;;
- pentium | p5 | k5 | k6 | nexgen | viac3)
- basic_machine=i586-pc
- ;;
- pentiumpro | p6 | 6x86 | athlon | athlon_*)
- basic_machine=i686-pc
- ;;
- pentiumii | pentium2 | pentiumiii | pentium3)
- basic_machine=i686-pc
- ;;
- pentium4)
- basic_machine=i786-pc
- ;;
- pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
- basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- pentiumpro-* | p6-* | 6x86-* | athlon-*)
- basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
- basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- pentium4-*)
- basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- pn)
- basic_machine=pn-gould
- ;;
- power) basic_machine=power-ibm
- ;;
- ppc) basic_machine=powerpc-unknown
- ;;
- ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- ppcle | powerpclittle | ppc-le | powerpc-little)
- basic_machine=powerpcle-unknown
- ;;
- ppcle-* | powerpclittle-*)
- basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- ppc64) basic_machine=powerpc64-unknown
- ;;
- ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- ppc64le | powerpc64little | ppc64-le | powerpc64-little)
- basic_machine=powerpc64le-unknown
- ;;
- ppc64le-* | powerpc64little-*)
- basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- ps2)
- basic_machine=i386-ibm
- ;;
- pw32)
- basic_machine=i586-unknown
- os=-pw32
- ;;
- rom68k)
- basic_machine=m68k-rom68k
- os=-coff
- ;;
- rm[46]00)
- basic_machine=mips-siemens
- ;;
- rtpc | rtpc-*)
- basic_machine=romp-ibm
- ;;
- s390 | s390-*)
- basic_machine=s390-ibm
- ;;
- s390x | s390x-*)
- basic_machine=s390x-ibm
- ;;
- sa29200)
- basic_machine=a29k-amd
- os=-udi
- ;;
- sb1)
- basic_machine=mipsisa64sb1-unknown
- ;;
- sb1el)
- basic_machine=mipsisa64sb1el-unknown
- ;;
- sei)
- basic_machine=mips-sei
- os=-seiux
- ;;
- sequent)
- basic_machine=i386-sequent
- ;;
- sh)
- basic_machine=sh-hitachi
- os=-hms
- ;;
- sh64)
- basic_machine=sh64-unknown
- ;;
- sparclite-wrs | simso-wrs)
- basic_machine=sparclite-wrs
- os=-vxworks
- ;;
- sps7)
- basic_machine=m68k-bull
- os=-sysv2
- ;;
- spur)
- basic_machine=spur-unknown
- ;;
- st2000)
- basic_machine=m68k-tandem
- ;;
- stratus)
- basic_machine=i860-stratus
- os=-sysv4
- ;;
- sun2)
- basic_machine=m68000-sun
- ;;
- sun2os3)
- basic_machine=m68000-sun
- os=-sunos3
- ;;
- sun2os4)
- basic_machine=m68000-sun
- os=-sunos4
- ;;
- sun3os3)
- basic_machine=m68k-sun
- os=-sunos3
- ;;
- sun3os4)
- basic_machine=m68k-sun
- os=-sunos4
- ;;
- sun4os3)
- basic_machine=sparc-sun
- os=-sunos3
- ;;
- sun4os4)
- basic_machine=sparc-sun
- os=-sunos4
- ;;
- sun4sol2)
- basic_machine=sparc-sun
- os=-solaris2
- ;;
- sun3 | sun3-*)
- basic_machine=m68k-sun
- ;;
- sun4)
- basic_machine=sparc-sun
- ;;
- sun386 | sun386i | roadrunner)
- basic_machine=i386-sun
- ;;
- sv1)
- basic_machine=sv1-cray
- os=-unicos
- ;;
- symmetry)
- basic_machine=i386-sequent
- os=-dynix
- ;;
- t3e)
- basic_machine=alphaev5-cray
- os=-unicos
- ;;
- t90)
- basic_machine=t90-cray
- os=-unicos
- ;;
- tic54x | c54x*)
- basic_machine=tic54x-unknown
- os=-coff
- ;;
- tic55x | c55x*)
- basic_machine=tic55x-unknown
- os=-coff
- ;;
- tic6x | c6x*)
- basic_machine=tic6x-unknown
- os=-coff
- ;;
- tx39)
- basic_machine=mipstx39-unknown
- ;;
- tx39el)
- basic_machine=mipstx39el-unknown
- ;;
- toad1)
- basic_machine=pdp10-xkl
- os=-tops20
- ;;
- tower | tower-32)
- basic_machine=m68k-ncr
- ;;
- tpf)
- basic_machine=s390x-ibm
- os=-tpf
- ;;
- udi29k)
- basic_machine=a29k-amd
- os=-udi
- ;;
- ultra3)
- basic_machine=a29k-nyu
- os=-sym1
- ;;
- v810 | necv810)
- basic_machine=v810-nec
- os=-none
- ;;
- vaxv)
- basic_machine=vax-dec
- os=-sysv
- ;;
- vms)
- basic_machine=vax-dec
- os=-vms
- ;;
- vpp*|vx|vx-*)
- basic_machine=f301-fujitsu
- ;;
- vxworks960)
- basic_machine=i960-wrs
- os=-vxworks
- ;;
- vxworks68)
- basic_machine=m68k-wrs
- os=-vxworks
- ;;
- vxworks29k)
- basic_machine=a29k-wrs
- os=-vxworks
- ;;
- w65*)
- basic_machine=w65-wdc
- os=-none
- ;;
- w89k-*)
- basic_machine=hppa1.1-winbond
- os=-proelf
- ;;
- xps | xps100)
- basic_machine=xps100-honeywell
- ;;
- ymp)
- basic_machine=ymp-cray
- os=-unicos
- ;;
- z8k-*-coff)
- basic_machine=z8k-unknown
- os=-sim
- ;;
- none)
- basic_machine=none-none
- os=-none
- ;;
-
-# Here we handle the default manufacturer of certain CPU types. It is in
-# some cases the only manufacturer, in others, it is the most popular.
- w89k)
- basic_machine=hppa1.1-winbond
- ;;
- op50n)
- basic_machine=hppa1.1-oki
- ;;
- op60c)
- basic_machine=hppa1.1-oki
- ;;
- romp)
- basic_machine=romp-ibm
- ;;
- mmix)
- basic_machine=mmix-knuth
- ;;
- rs6000)
- basic_machine=rs6000-ibm
- ;;
- vax)
- basic_machine=vax-dec
- ;;
- pdp10)
- # there are many clones, so DEC is not a safe bet
- basic_machine=pdp10-unknown
- ;;
- pdp11)
- basic_machine=pdp11-dec
- ;;
- we32k)
- basic_machine=we32k-att
- ;;
- sh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele)
- basic_machine=sh-unknown
- ;;
- sh64)
- basic_machine=sh64-unknown
- ;;
- sparc | sparcv8 | sparcv9 | sparcv9b)
- basic_machine=sparc-sun
- ;;
- cydra)
- basic_machine=cydra-cydrome
- ;;
- orion)
- basic_machine=orion-highlevel
- ;;
- orion105)
- basic_machine=clipper-highlevel
- ;;
- mac | mpw | mac-mpw)
- basic_machine=m68k-apple
- ;;
- pmac | pmac-mpw)
- basic_machine=powerpc-apple
- ;;
- *-unknown)
- # Make sure to match an already-canonicalized machine name.
- ;;
- *)
- echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
- exit 1
- ;;
-esac
-
-# Here we canonicalize certain aliases for manufacturers.
-case $basic_machine in
- *-digital*)
- basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
- ;;
- *-commodore*)
- basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
- ;;
- *)
- ;;
-esac
-
-# Decode manufacturer-specific aliases for certain operating systems.
-
-if [ x"$os" != x"" ]
-then
-case $os in
- # First match some system type aliases
- # that might get confused with valid system types.
- # -solaris* is a basic system type, with this one exception.
- -solaris1 | -solaris1.*)
- os=`echo $os | sed -e 's|solaris1|sunos4|'`
- ;;
- -solaris)
- os=-solaris2
- ;;
- -svr4*)
- os=-sysv4
- ;;
- -unixware*)
- os=-sysv4.2uw
- ;;
- -gnu/linux*)
- os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
- ;;
- # First accept the basic system types.
- # The portable systems comes first.
- # Each alternative MUST END IN A *, to match a version number.
- # -sysv* is not here because it comes later, after sysvr4.
- -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
- | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
- | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
- | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
- | -aos* \
- | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
- | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
- | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* | -openbsd* \
- | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
- | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
- | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
- | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
- | -chorusos* | -chorusrdb* \
- | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
- | -mingw32* | -linux-gnu* | -linux-uclibc* | -uxpv* | -beos* | -mpeix* | -udk* \
- | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
- | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
- | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
- | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
- | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
- | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly*)
- # Remember, each alternative MUST END IN *, to match a version number.
- ;;
- -qnx*)
- case $basic_machine in
- x86-* | i*86-*)
- ;;
- *)
- os=-nto$os
- ;;
- esac
- ;;
- -nto-qnx*)
- ;;
- -nto*)
- os=`echo $os | sed -e 's|nto|nto-qnx|'`
- ;;
- -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
- | -windows* | -osx | -abug | -netware* | -os9* | -beos* \
- | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
- ;;
- -mac*)
- os=`echo $os | sed -e 's|mac|macos|'`
- ;;
- -linux-dietlibc)
- os=-linux-dietlibc
- ;;
- -linux*)
- os=`echo $os | sed -e 's|linux|linux-gnu|'`
- ;;
- -sunos5*)
- os=`echo $os | sed -e 's|sunos5|solaris2|'`
- ;;
- -sunos6*)
- os=`echo $os | sed -e 's|sunos6|solaris3|'`
- ;;
- -opened*)
- os=-openedition
- ;;
- -os400*)
- os=-os400
- ;;
- -wince*)
- os=-wince
- ;;
- -osfrose*)
- os=-osfrose
- ;;
- -osf*)
- os=-osf
- ;;
- -utek*)
- os=-bsd
- ;;
- -dynix*)
- os=-bsd
- ;;
- -acis*)
- os=-aos
- ;;
- -atheos*)
- os=-atheos
- ;;
- -syllable*)
- os=-syllable
- ;;
- -386bsd)
- os=-bsd
- ;;
- -ctix* | -uts*)
- os=-sysv
- ;;
- -nova*)
- os=-rtmk-nova
- ;;
- -ns2 )
- os=-nextstep2
- ;;
- -nsk*)
- os=-nsk
- ;;
- # Preserve the version number of sinix5.
- -sinix5.*)
- os=`echo $os | sed -e 's|sinix|sysv|'`
- ;;
- -sinix*)
- os=-sysv4
- ;;
- -tpf*)
- os=-tpf
- ;;
- -triton*)
- os=-sysv3
- ;;
- -oss*)
- os=-sysv3
- ;;
- -svr4)
- os=-sysv4
- ;;
- -svr3)
- os=-sysv3
- ;;
- -sysvr4)
- os=-sysv4
- ;;
- # This must come after -sysvr4.
- -sysv*)
- ;;
- -ose*)
- os=-ose
- ;;
- -es1800*)
- os=-ose
- ;;
- -xenix)
- os=-xenix
- ;;
- -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
- os=-mint
- ;;
- -aros*)
- os=-aros
- ;;
- -kaos*)
- os=-kaos
- ;;
- -none)
- ;;
- *)
- # Get rid of the `-' at the beginning of $os.
- os=`echo $os | sed 's/[^-]*-//'`
- echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
- exit 1
- ;;
-esac
-else
-
-# Here we handle the default operating systems that come with various machines.
-# The value should be what the vendor currently ships out the door with their
-# machine or put another way, the most popular os provided with the machine.
-
-# Note that if you're going to try to match "-MANUFACTURER" here (say,
-# "-sun"), then you have to tell the case statement up towards the top
-# that MANUFACTURER isn't an operating system. Otherwise, code above
-# will signal an error saying that MANUFACTURER isn't an operating
-# system, and we'll never get to this point.
-
-case $basic_machine in
- *-acorn)
- os=-riscix1.2
- ;;
- arm*-rebel)
- os=-linux
- ;;
- arm*-semi)
- os=-aout
- ;;
- c4x-* | tic4x-*)
- os=-coff
- ;;
- # This must come before the *-dec entry.
- pdp10-*)
- os=-tops20
- ;;
- pdp11-*)
- os=-none
- ;;
- *-dec | vax-*)
- os=-ultrix4.2
- ;;
- m68*-apollo)
- os=-domain
- ;;
- i386-sun)
- os=-sunos4.0.2
- ;;
- m68000-sun)
- os=-sunos3
- # This also exists in the configure program, but was not the
- # default.
- # os=-sunos4
- ;;
- m68*-cisco)
- os=-aout
- ;;
- mips*-cisco)
- os=-elf
- ;;
- mips*-*)
- os=-elf
- ;;
- or32-*)
- os=-coff
- ;;
- *-tti) # must be before sparc entry or we get the wrong os.
- os=-sysv3
- ;;
- sparc-* | *-sun)
- os=-sunos4.1.1
- ;;
- *-be)
- os=-beos
- ;;
- *-ibm)
- os=-aix
- ;;
- *-knuth)
- os=-mmixware
- ;;
- *-wec)
- os=-proelf
- ;;
- *-winbond)
- os=-proelf
- ;;
- *-oki)
- os=-proelf
- ;;
- *-hp)
- os=-hpux
- ;;
- *-hitachi)
- os=-hiux
- ;;
- i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
- os=-sysv
- ;;
- *-cbm)
- os=-amigaos
- ;;
- *-dg)
- os=-dgux
- ;;
- *-dolphin)
- os=-sysv3
- ;;
- m68k-ccur)
- os=-rtu
- ;;
- m88k-omron*)
- os=-luna
- ;;
- *-next )
- os=-nextstep
- ;;
- *-sequent)
- os=-ptx
- ;;
- *-crds)
- os=-unos
- ;;
- *-ns)
- os=-genix
- ;;
- i370-*)
- os=-mvs
- ;;
- *-next)
- os=-nextstep3
- ;;
- *-gould)
- os=-sysv
- ;;
- *-highlevel)
- os=-bsd
- ;;
- *-encore)
- os=-bsd
- ;;
- *-sgi)
- os=-irix
- ;;
- *-siemens)
- os=-sysv4
- ;;
- *-masscomp)
- os=-rtu
- ;;
- f30[01]-fujitsu | f700-fujitsu)
- os=-uxpv
- ;;
- *-rom68k)
- os=-coff
- ;;
- *-*bug)
- os=-coff
- ;;
- *-apple)
- os=-macos
- ;;
- *-atari*)
- os=-mint
- ;;
- *)
- os=-none
- ;;
-esac
-fi
-
-# Here we handle the case where we know the os, and the CPU type, but not the
-# manufacturer. We pick the logical manufacturer.
-vendor=unknown
-case $basic_machine in
- *-unknown)
- case $os in
- -riscix*)
- vendor=acorn
- ;;
- -sunos*)
- vendor=sun
- ;;
- -aix*)
- vendor=ibm
- ;;
- -beos*)
- vendor=be
- ;;
- -hpux*)
- vendor=hp
- ;;
- -mpeix*)
- vendor=hp
- ;;
- -hiux*)
- vendor=hitachi
- ;;
- -unos*)
- vendor=crds
- ;;
- -dgux*)
- vendor=dg
- ;;
- -luna*)
- vendor=omron
- ;;
- -genix*)
- vendor=ns
- ;;
- -mvs* | -opened*)
- vendor=ibm
- ;;
- -os400*)
- vendor=ibm
- ;;
- -ptx*)
- vendor=sequent
- ;;
- -tpf*)
- vendor=ibm
- ;;
- -vxsim* | -vxworks* | -windiss*)
- vendor=wrs
- ;;
- -aux*)
- vendor=apple
- ;;
- -hms*)
- vendor=hitachi
- ;;
- -mpw* | -macos*)
- vendor=apple
- ;;
- -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
- vendor=atari
- ;;
- -vos*)
- vendor=stratus
- ;;
- esac
- basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
- ;;
-esac
-
-echo $basic_machine$os
-exit 0
-
-# Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
-# time-stamp-start: "timestamp='"
-# time-stamp-format: "%:y-%02m-%02d"
-# time-stamp-end: "'"
-# End:
diff --git a/release_23/autoconf/configure.ac b/release_23/autoconf/configure.ac
deleted file mode 100644
index 2d0938203411..000000000000
--- a/release_23/autoconf/configure.ac
+++ /dev/null
@@ -1,1012 +0,0 @@
-dnl === configure.ac --------------------------------------------------------===
-dnl The LLVM Compiler Infrastructure
-dnl
-dnl This file is distributed under the University of Illinois Open Source
-dnl License. See LICENSE.TXT for details.
-dnl
-dnl===-----------------------------------------------------------------------===
-dnl This is the LLVM configuration script. It is processed by the autoconf
-dnl program to produce a script named configure. This script contains the
-dnl configuration checks that LLVM needs in order to support multiple platforms.
-dnl This file is composed of 10 sections per the recommended organization of
-dnl autoconf input defined in the autoconf documentation. As this file evolves,
-dnl please keep the various types of checks within their sections. The sections
-dnl are as follows:
-dnl
-dnl SECTION 1: Initialization & Setup
-dnl SECTION 2: Architecture, target, and host checks
-dnl SECTION 3: Command line arguments for the configure script.
-dnl SECTION 4: Check for programs we need and that they are the right version
-dnl SECTION 5: Check for libraries
-dnl SECTION 6: Check for header files
-dnl SECTION 7: Check for types and structures
-dnl SECTION 8: Check for specific functions needed
-dnl SECTION 9: Additional checks, variables, etc.
-dnl SECTION 10: Specify the output files and generate it
-dnl
-dnl===-----------------------------------------------------------------------===
-dnl===
-dnl=== SECTION 1: Initialization & Setup
-dnl===
-dnl===-----------------------------------------------------------------------===
-dnl Initialize autoconf and define the package name, version number and
-dnl email address for reporting bugs.
-AC_INIT([[llvm]],[[2.3]],[llvmbugs@cs.uiuc.edu])
-
-dnl Provide a copyright substitution and ensure the copyright notice is included
-dnl in the output of --version option of the generated configure script.
-AC_SUBST(LLVM_COPYRIGHT,["Copyright (c) 2003-2008 University of Illinois at Urbana-Champaign."])
-AC_COPYRIGHT([Copyright (c) 2003-2008 University of Illinois at Urbana-Champaign.])
-
-dnl Indicate that we require autoconf 2.59 or later. Ths is needed because we
-dnl use some autoconf macros only available in 2.59.
-AC_PREREQ(2.59)
-
-dnl Verify that the source directory is valid. This makes sure that we are
-dnl configuring LLVM and not some other package (it validates --srcdir argument)
-AC_CONFIG_SRCDIR([lib/VMCore/Module.cpp])
-
-dnl Place all of the extra autoconf files into the config subdirectory. Tell
-dnl various tools where the m4 autoconf macros are.
-AC_CONFIG_AUX_DIR([autoconf])
-
-dnl Quit if the source directory has already been configured.
-dnl NOTE: This relies upon undocumented autoconf behavior.
-if test ${srcdir} != "." ; then
- if test -f ${srcdir}/include/llvm/Config/config.h ; then
- AC_MSG_ERROR([Already configured in ${srcdir}])
- fi
-fi
-
-dnl Configure all of the projects present in our source tree. While we could
-dnl just AC_CONFIG_SUBDIRS on the set of directories in projects that have a
-dnl configure script, that usage of the AC_CONFIG_SUBDIRS macro is deprecated.
-dnl Instead we match on the known projects.
-for i in `ls ${srcdir}/projects`
-do
- if test -d ${srcdir}/projects/${i} ; then
- case ${i} in
- CVS) ;;
- sample) AC_CONFIG_SUBDIRS([projects/sample]) ;;
- privbracket) AC_CONFIG_SUBDIRS([projects/privbracket]) ;;
- llvm-stacker) AC_CONFIG_SUBDIRS([projects/llvm-stacker]) ;;
- llvm-test) AC_CONFIG_SUBDIRS([projects/llvm-test]) ;;
- llvm-reopt) AC_CONFIG_SUBDIRS([projects/llvm-reopt]);;
- llvm-gcc) AC_CONFIG_SUBDIRS([projects/llvm-gcc]) ;;
- llvm-java) AC_CONFIG_SUBDIRS([projects/llvm-java]) ;;
- llvm-tv) AC_CONFIG_SUBDIRS([projects/llvm-tv]) ;;
- llvm-poolalloc) AC_CONFIG_SUBDIRS([projects/llvm-poolalloc]) ;;
- poolalloc) AC_CONFIG_SUBDIRS([projects/poolalloc]) ;;
- llvm-kernel) AC_CONFIG_SUBDIRS([projects/llvm-kernel]) ;;
- *)
- AC_MSG_WARN([Unknown project (${i}) won't be configured automatically])
- ;;
- esac
- fi
-done
-
-dnl===-----------------------------------------------------------------------===
-dnl===
-dnl=== SECTION 2: Architecture, target, and host checks
-dnl===
-dnl===-----------------------------------------------------------------------===
-
-dnl Check the target for which we're compiling and the host that will do the
-dnl compilations. This will tell us which LLVM compiler will be used for
-dnl compiling SSA into object code. This needs to be done early because
-dnl following tests depend on it.
-AC_CANONICAL_TARGET
-
-dnl Determine the platform type and cache its value. This helps us configure
-dnl the System library to the correct build platform.
-AC_CACHE_CHECK([type of operating system we're going to host on],
- [llvm_cv_os_type],
-[case $host in
- *-*-aix*)
- llvm_cv_link_all_option="-Wl,--whole-archive"
- llvm_cv_no_link_all_option="-Wl,--no-whole-archive"
- llvm_cv_os_type="AIX"
- llvm_cv_platform_type="Unix" ;;
- *-*-irix*)
- llvm_cv_link_all_option="-Wl,--whole-archive"
- llvm_cv_no_link_all_option="-Wl,--no-whole-archive"
- llvm_cv_os_type="IRIX"
- llvm_cv_platform_type="Unix" ;;
- *-*-cygwin*)
- llvm_cv_link_all_option="-Wl,--whole-archive"
- llvm_cv_no_link_all_option="-Wl,--no-whole-archive"
- llvm_cv_os_type="Cygwin"
- llvm_cv_platform_type="Unix" ;;
- *-*-darwin*)
- llvm_cv_link_all_option="-Wl,-all_load"
- llvm_cv_no_link_all_option="-Wl,-noall_load"
- llvm_cv_os_type="Darwin"
- llvm_cv_platform_type="Unix" ;;
- *-*-freebsd*)
- llvm_cv_link_all_option="-Wl,--whole-archive"
- llvm_cv_no_link_all_option="-Wl,--no-whole-archive"
- llvm_cv_os_type="FreeBSD"
- llvm_cv_platform_type="Unix" ;;
- *-*-openbsd*)
- llvm_cv_link_all_option="-Wl,--whole-archive"
- llvm_cv_no_link_all_option="-Wl,--no-whole-archive"
- llvm_cv_os_type="OpenBSD"
- llvm_cv_platform_type="Unix" ;;
- *-*-netbsd*)
- llvm_cv_link_all_option="-Wl,--whole-archive"
- llvm_cv_no_link_all_option="-Wl,--no-whole-archive"
- llvm_cv_os_type="NetBSD"
- llvm_cv_platform_type="Unix" ;;
- *-*-hpux*)
- llvm_cv_link_all_option="-Wl,--whole-archive"
- llvm_cv_no_link_all_option="-Wl,--no-whole-archive"
- llvm_cv_os_type="HP-UX"
- llvm_cv_platform_type="Unix" ;;
- *-*-interix*)
- llvm_cv_link_all_option="-Wl,--whole-archive"
- llvm_cv_no_link_all_option="-Wl,--no-whole-archive"
- llvm_cv_os_type="Interix"
- llvm_cv_platform_type="Unix" ;;
- *-*-linux*)
- llvm_cv_link_all_option="-Wl,--whole-archive"
- llvm_cv_no_link_all_option="-Wl,--no-whole-archive"
- llvm_cv_os_type="Linux"
- llvm_cv_platform_type="Unix" ;;
- *-*-solaris*)
- llvm_cv_link_all_option="-Wl,-z,allextract"
- llvm_cv_no_link_all_option="-Wl,-z,defaultextract"
- llvm_cv_os_type="SunOS"
- llvm_cv_platform_type="Unix" ;;
- *-*-win32*)
- llvm_cv_link_all_option="-Wl,--whole-archive"
- llvm_cv_no_link_all_option="-Wl,--no-whole-archive"
- llvm_cv_os_type="Win32"
- llvm_cv_platform_type="Win32" ;;
- *-*-mingw*)
- llvm_cv_link_all_option="-Wl,--whole-archive"
- llvm_cv_no_link_all_option="-Wl,--no-whole-archive"
- llvm_cv_os_type="MingW"
- llvm_cv_platform_type="Win32" ;;
- *)
- llvm_cv_link_all_option=""
- llvm_cv_no_link_all_option=""
- llvm_cv_os_type="Unknown"
- llvm_cv_platform_type="Unknown" ;;
-esac])
-
-dnl Make sure we aren't attempting to configure for an unknown system
-if test "$llvm_cv_os_type" = "Unknown" ; then
- AC_MSG_ERROR([Operating system is unknown, configure can't continue])
-fi
-
-dnl Set the "OS" Makefile variable based on the platform type so the
-dnl makefile can configure itself to specific build hosts
-AC_SUBST(OS,$llvm_cv_os_type)
-
-dnl Set the LINKALL and NOLINKALL Makefile variables based on the platform
-AC_SUBST(LINKALL,$llvm_cv_link_all_option)
-AC_SUBST(NOLINKALL,$llvm_cv_no_link_all_option)
-
-dnl Set the "LLVM_ON_*" variables based on llvm_cvs_platform_type
-dnl This is used by lib/System to determine the basic kind of implementation
-dnl to use.
-case $llvm_cv_platform_type in
- Unix)
- AC_DEFINE([LLVM_ON_UNIX],[1],[Define if this is Unixish platform])
- AC_SUBST(LLVM_ON_UNIX,[1])
- AC_SUBST(LLVM_ON_WIN32,[0])
- ;;
- Win32)
- AC_DEFINE([LLVM_ON_WIN32],[1],[Define if this is Win32ish platform])
- AC_SUBST(LLVM_ON_UNIX,[0])
- AC_SUBST(LLVM_ON_WIN32,[1])
- ;;
-esac
-
-dnl Determine what our target architecture is and configure accordingly.
-dnl This will allow Makefiles to make a distinction between the hardware and
-dnl the OS.
-AC_CACHE_CHECK([target architecture],[llvm_cv_target_arch],
-[case $target in
- i?86-*) llvm_cv_target_arch="x86" ;;
- amd64-* | x86_64-*) llvm_cv_target_arch="x86_64" ;;
- sparc*-*) llvm_cv_target_arch="Sparc" ;;
- powerpc*-*) llvm_cv_target_arch="PowerPC" ;;
- alpha*-*) llvm_cv_target_arch="Alpha" ;;
- ia64-*) llvm_cv_target_arch="IA64" ;;
- arm-*) llvm_cv_target_arch="ARM" ;;
- mips-*) llvm_cv_target_arch="Mips" ;;
- *) llvm_cv_target_arch="Unknown" ;;
-esac])
-
-if test "$llvm_cv_target_arch" = "Unknown" ; then
- AC_MSG_WARN([Configuring LLVM for an unknown target archicture])
-fi
-
-dnl Define a substitution, ARCH, for the target architecture
-AC_SUBST(ARCH,$llvm_cv_target_arch)
-
-dnl Check for the endianness of the target
-AC_C_BIGENDIAN(AC_SUBST([ENDIAN],[big]),AC_SUBST([ENDIAN],[little]))
-
-dnl Check for build platform executable suffix if we're crosscompiling
-if test "$cross_compiling" = yes; then
- AC_SUBST(LLVM_CROSS_COMPILING, [1])
- AC_BUILD_EXEEXT
-else
- AC_SUBST(LLVM_CROSS_COMPILING, [0])
-fi
-
-dnl Check to see if there's a "CVS" (or .svn) directory indicating that this
-dnl build is being done from a checkout. This sets up several defaults for the
-dnl command line switches. When we build with a CVS directory, we get a
-dnl debug with assertions turned on. Without, we assume a source release and we
-dnl get an optimized build without assertions. See --enable-optimized and
-dnl --enable-assertions below
-if test -d "CVS" -o -d "${srcdir}/CVS" -o -d ".svn" -o -d "${srcdir}/.svn"; then
- cvsbuild="yes"
- optimize="no"
- AC_SUBST(CVSBUILD,[[CVSBUILD=1]])
-else
- cvsbuild="no"
- optimize="yes"
-fi
-
-dnl===-----------------------------------------------------------------------===
-dnl===
-dnl=== SECTION 3: Command line arguments for the configure script.
-dnl===
-dnl===-----------------------------------------------------------------------===
-
-dnl --enable-optimized : check whether they want to do an optimized build:
-AC_ARG_ENABLE(optimized, AS_HELP_STRING(
- [--enable-optimized,Compile with optimizations enabled (default is NO)]),,enableval=$optimize)
-if test ${enableval} = "no" ; then
- AC_SUBST(ENABLE_OPTIMIZED,[[]])
-else
- AC_SUBST(ENABLE_OPTIMIZED,[[ENABLE_OPTIMIZED=1]])
-fi
-
-dnl --enable-assertions : check whether they want to turn on assertions or not:
-AC_ARG_ENABLE(assertions,AS_HELP_STRING(
- [--enable-assertions,Compile with assertion checks enabled (default is YES)]),, enableval="yes")
-if test ${enableval} = "yes" ; then
- AC_SUBST(DISABLE_ASSERTIONS,[[]])
-else
- AC_SUBST(DISABLE_ASSERTIONS,[[DISABLE_ASSERTIONS=1]])
-fi
-
-dnl --enable-expensive-checks : check whether they want to turn on expensive debug checks:
-AC_ARG_ENABLE(expensive-checks,AS_HELP_STRING(
- [--enable-expensive-checks,Compile with expensive debug checks enabled (default is NO)]),, enableval="no")
-if test ${enableval} = "yes" ; then
- AC_SUBST(ENABLE_EXPENSIVE_CHECKS,[[ENABLE_EXPENSIVE_CHECKS=1]])
- AC_SUBST(EXPENSIVE_CHECKS,[[yes]])
-else
- AC_SUBST(ENABLE_EXPENSIVE_CHECKS,[[]])
- AC_SUBST(EXPENSIVE_CHECKS,[[no]])
-fi
-
-dnl --enable-debug-runtime : should runtime libraries have debug symbols?
-AC_ARG_ENABLE(debug-runtime,
- AS_HELP_STRING([--enable-debug-runtime,Build runtime libs with debug symbols (default is NO)]),,enableval=no)
-if test ${enableval} = "no" ; then
- AC_SUBST(DEBUG_RUNTIME,[[]])
-else
- AC_SUBST(DEBUG_RUNTIME,[[DEBUG_RUNTIME=1]])
-fi
-
-dnl --enable-jit: check whether they want to enable the jit
-AC_ARG_ENABLE(jit,
- AS_HELP_STRING(--enable-jit,
- [Enable Just In Time Compiling (default is YES)]),,
- enableval=default)
-if test ${enableval} = "no"
-then
- AC_SUBST(JIT,[[]])
-else
- case "$llvm_cv_target_arch" in
- x86) AC_SUBST(TARGET_HAS_JIT,1) ;;
- Sparc) AC_SUBST(TARGET_HAS_JIT,0) ;;
- PowerPC) AC_SUBST(TARGET_HAS_JIT,1) ;;
- x86_64) AC_SUBST(TARGET_HAS_JIT,1) ;;
- Alpha) AC_SUBST(TARGET_HAS_JIT,1) ;;
- IA64) AC_SUBST(TARGET_HAS_JIT,0) ;;
- ARM) AC_SUBST(TARGET_HAS_JIT,0) ;;
- Mips) AC_SUBST(TARGET_HAS_JIT,0) ;;
- *) AC_SUBST(TARGET_HAS_JIT,0) ;;
- esac
-fi
-
-dnl Allow enablement of doxygen generated documentation
-AC_ARG_ENABLE(doxygen,
- AS_HELP_STRING([--enable-doxygen],
- [Build doxygen documentation (default is NO)]),,
- enableval=default)
-case "$enableval" in
- yes) AC_SUBST(ENABLE_DOXYGEN,[1]) ;;
- no) AC_SUBST(ENABLE_DOXYGEN,[0]) ;;
- default) AC_SUBST(ENABLE_DOXYGEN,[0]) ;;
- *) AC_MSG_ERROR([Invalid setting for --enable-doxygen. Use "yes" or "no"]) ;;
-esac
-
-dnl Allow disablement of threads
-AC_ARG_ENABLE(threads,
- AS_HELP_STRING([--enable-threads],
- [Use threads if available (default is YES)]),,
- enableval=default)
-case "$enableval" in
- yes) AC_SUBST(ENABLE_THREADS,[1]) ;;
- no) AC_SUBST(ENABLE_THREADS,[0]) ;;
- default) AC_SUBST(ENABLE_THREADS,[1]) ;;
- *) AC_MSG_ERROR([Invalid setting for --enable-threads. Use "yes" or "no"]) ;;
-esac
-AC_DEFINE_UNQUOTED([ENABLE_THREADS],$ENABLE_THREADS,[Define if threads enabled])
-
-dnl Allow building with position independent code
-AC_ARG_ENABLE(pic,
- AS_HELP_STRING([--enable-pic],
- [Build LLVM with Position Independent Code (default is NO)]),,
- enableval=default)
-case "$enableval" in
- yes) AC_SUBST(ENABLE_PIC,[1]) ;;
- no) AC_SUBST(ENABLE_PIC,[0]) ;;
- default) AC_SUBST(ENABLE_PIC,[0]) ;;
- *) AC_MSG_ERROR([Invalid setting for --enable-pic. Use "yes" or "no"]) ;;
-esac
-AC_DEFINE_UNQUOTED([ENABLE_PIC],$ENABLE_PIC,
- [Define if position independent code is enabled])
-
-dnl Allow specific targets to be specified for building (or not)
-TARGETS_TO_BUILD=""
-AC_ARG_ENABLE([targets],AS_HELP_STRING([--enable-targets],
- [Build specific host targets: all,host-only,{target-name} (default=all)]),,
- enableval=all)
-case "$enableval" in
- all) TARGETS_TO_BUILD="X86 Sparc PowerPC Alpha IA64 ARM Mips CellSPU CBackend MSIL CppBackend" ;;
- host-only)
- case "$llvm_cv_target_arch" in
- x86) TARGETS_TO_BUILD="X86" ;;
- x86_64) TARGETS_TO_BUILD="X86" ;;
- Sparc) TARGETS_TO_BUILD="Sparc" ;;
- PowerPC) TARGETS_TO_BUILD="PowerPC" ;;
- Alpha) TARGETS_TO_BUILD="Alpha" ;;
- IA64) TARGETS_TO_BUILD="IA64" ;;
- ARM) TARGETS_TO_BUILD="ARM" ;;
- Mips) TARGETS_TO_BUILD="Mips" ;;
- CellSPU|SPU) TARGETS_TO_BUILD="CellSPU" ;;
- *) AC_MSG_ERROR([Can not set target to build]) ;;
- esac
- ;;
- *)for a_target in `echo $enableval|sed -e 's/,/ /g' ` ; do
- case "$a_target" in
- x86) TARGETS_TO_BUILD="X86 $TARGETS_TO_BUILD" ;;
- x86_64) TARGETS_TO_BUILD="X86 $TARGETS_TO_BUILD" ;;
- sparc) TARGETS_TO_BUILD="Sparc $TARGETS_TO_BUILD" ;;
- powerpc) TARGETS_TO_BUILD="PowerPC $TARGETS_TO_BUILD" ;;
- alpha) TARGETS_TO_BUILD="Alpha $TARGETS_TO_BUILD" ;;
- ia64) TARGETS_TO_BUILD="IA64 $TARGETS_TO_BUILD" ;;
- arm) TARGETS_TO_BUILD="ARM $TARGETS_TO_BUILD" ;;
- mips) TARGETS_TO_BUILD="Mips $TARGETS_TO_BUILD" ;;
- spu) TARGETS_TO_BUILD="CellSPU $TARGETS_TO_BUILD" ;;
- cbe) TARGETS_TO_BUILD="CBackend $TARGETS_TO_BUILD" ;;
- msil) TARGETS_TO_BUILD="MSIL $TARGETS_TO_BUILD" ;;
- cpp) TARGETS_TO_BUILD="CppBackend $TARGETS_TO_BUILD" ;;
- *) AC_MSG_ERROR([Unrecognized target $a_target]) ;;
- esac
- done
- ;;
-esac
-AC_SUBST(TARGETS_TO_BUILD,$TARGETS_TO_BUILD)
-
-dnl Prevent the CBackend from using printf("%a") for floating point so older
-dnl C compilers that cannot deal with the 0x0p+0 hex floating point format
-dnl can still compile the CBE's output
-AC_ARG_ENABLE([cbe-printf-a],AS_HELP_STRING([--enable-cbe-printf-a],
- [Enable C Backend output with hex floating point via %a (default is YES)]),,
- enableval=default)
-case "$enableval" in
- yes) AC_SUBST(ENABLE_CBE_PRINTF_A,[1]) ;;
- no) AC_SUBST(ENABLE_CBE_PRINTF_A,[0]) ;;
- default) AC_SUBST(ENABLE_CBE_PRINTF_A,[1]) ;;
- *) AC_MSG_ERROR([Invalid setting for --enable-cbe-printf-a. Use "yes" or "no"]) ;;
-esac
-AC_DEFINE_UNQUOTED([ENABLE_CBE_PRINTF_A],$ENABLE_CBE_PRINTF_A,
- [Define if CBE is enabled for printf %a output])
-
-dnl Allow a specific llvm-gcc/llvm-g++ pair to be used with this LLVM config.
-AC_ARG_WITH(llvmgccdir,
- AS_HELP_STRING([--with-llvmgccdir],
- [Specify location of llvm-gcc install dir (default searches PATH)]),,
- withval=default)
-case "$withval" in
- default) WITH_LLVMGCCDIR=default ;;
- /* | [[A-Za-z]]:[[\\/]]*) WITH_LLVMGCCDIR=$withval ;;
- *) AC_MSG_ERROR([Invalid path for --with-llvmgccdir. Provide full path]) ;;
-esac
-
-dnl Allow a specific llvm-gcc compiler to be used with this LLVM config.
-AC_ARG_WITH(llvmgcc,
- AS_HELP_STRING([--with-llvmgcc],
- [Specify location of llvm-gcc driver (default searches PATH)]),
- LLVMGCC=$with_llvmgcc
- WITH_LLVMGCCDIR="",)
-
-dnl Allow a specific llvm-g++ compiler to be used with this LLVM config.
-AC_ARG_WITH(llvmgxx,
- AS_HELP_STRING([--with-llvmgxx],
- [Specify location of llvm-g++ driver (default searches PATH)]),
- LLVMGXX=$with_llvmgxx
- WITH_LLVMGCCDIR="",)
-
-if test -n "$LLVMGCC" && test -z "$LLVMGXX"; then
- AC_MSG_ERROR([Invalid llvm-g++. Use --with-llvmgxx when --with-llvmgcc is used]);
-fi
-
-if test -n "$LLVMGXX" && test -z "$LLVMGCC"; then
- AC_MSG_ERROR([Invalid llvm-gcc. Use --with-llvmgcc when --with-llvmgxx is used]);
-fi
-
-dnl Specify extra build options
-AC_ARG_WITH(extra-options,
- AS_HELP_STRING([--with-extra-options],
- [Specify addtional options to compile LLVM with]),,
- withval=default)
-case "$withval" in
- default) EXTRA_OPTIONS= ;;
- *) EXTRA_OPTIONS=$withval ;;
-esac
-AC_SUBST(EXTRA_OPTIONS,$EXTRA_OPTIONS)
-
-dnl Allow specific bindings to be specified for building (or not)
-AC_ARG_ENABLE([bindings],AS_HELP_STRING([--enable-bindings],
- [Build specific language bindings: all,auto,none,{binding-name} (default=auto)]),,
- enableval=default)
-BINDINGS_TO_BUILD=""
-case "$enableval" in
- yes | default | auto) BINDINGS_TO_BUILD="auto" ;;
- all ) BINDINGS_TO_BUILD="ocaml" ;;
- none | no) BINDINGS_TO_BUILD="" ;;
- *)for a_binding in `echo $enableval|sed -e 's/,/ /g' ` ; do
- case "$a_binding" in
- ocaml) BINDINGS_TO_BUILD="ocaml $BINDINGS_TO_BUILD" ;;
- *) AC_MSG_ERROR([Unrecognized binding $a_binding]) ;;
- esac
- done
- ;;
-esac
-
-dnl Allow the ocaml libdir to be overridden. This could go in a configure
-dnl script for bindings/ocaml/configure, except that its auto value depends on
-dnl OCAMLC, which is found here to support tests.
-AC_ARG_WITH([ocaml-libdir],
- [AS_HELP_STRING([--with-ocaml-libdir],
- [Specify install location for ocaml bindings (default is stdlib)])],
- [],
- [withval=auto])
-case "$withval" in
- auto) with_ocaml_libdir="$withval" ;;
- /* | [[A-Za-z]]:[[\\/]]*) with_ocaml_libdir="$withval" ;;
- *) AC_MSG_ERROR([Invalid path for --with-ocaml-libdir. Provide full path]) ;;
-esac
-
-dnl===-----------------------------------------------------------------------===
-dnl===
-dnl=== SECTION 4: Check for programs we need and that they are the right version
-dnl===
-dnl===-----------------------------------------------------------------------===
-
-dnl Check for compilation tools
-AC_PROG_CPP
-AC_PROG_CC(gcc)
-AC_PROG_CXX(g++)
-AC_PROG_FLEX
-AC_PROG_BISON
-
-AC_PROG_NM
-AC_SUBST(NM)
-
-dnl Check for the tools that the makefiles require
-AC_CHECK_GNU_MAKE
-AC_PROG_LN_S
-AC_PATH_PROG(CMP, [cmp], [cmp])
-AC_PATH_PROG(CP, [cp], [cp])
-AC_PATH_PROG(DATE, [date], [date])
-AC_PATH_PROG(FIND, [find], [find])
-AC_PATH_PROG(GREP, [grep], [grep])
-AC_PATH_PROG(MKDIR,[mkdir],[mkdir])
-AC_PATH_PROG(MV, [mv], [mv])
-AC_PROG_RANLIB
-AC_PATH_PROG(RM, [rm], [rm])
-AC_PATH_PROG(SED, [sed], [sed])
-AC_PATH_PROG(TAR, [tar], [gtar])
-AC_PATH_PROG(BINPWD,[pwd], [pwd])
-
-dnl Looking for misc. graph plotting software
-AC_PATH_PROG(GRAPHVIZ, [Graphviz], [echo Graphviz])
-if test "$GRAPHVIZ" != "echo Graphviz" ; then
- AC_DEFINE([HAVE_GRAPHVIZ],[1],[Define if the Graphviz program is available])
- dnl If we're targeting for mingw we should emit windows paths, not msys
- if test "$llvm_cv_os_type" = "MingW" ; then
- GRAPHVIZ=`echo $GRAPHVIZ | sed 's/^\/\([[A-Za-z]]\)\//\1:\//' `
- fi
- AC_DEFINE_UNQUOTED([LLVM_PATH_GRAPHVIZ],"$GRAPHVIZ${EXEEXT}",
- [Define to path to Graphviz program if found or 'echo Graphviz' otherwise])
-fi
-AC_PATH_PROG(DOT, [dot], [echo dot])
-if test "$DOT" != "echo dot" ; then
- AC_DEFINE([HAVE_DOT],[1],[Define if the dot program is available])
- dnl If we're targeting for mingw we should emit windows paths, not msys
- if test "$llvm_cv_os_type" = "MingW" ; then
- DOT=`echo $DOT | sed 's/^\/\([[A-Za-z]]\)\//\1:\//' `
- fi
- AC_DEFINE_UNQUOTED([LLVM_PATH_DOT],"$DOT${EXEEXT}",
- [Define to path to dot program if found or 'echo dot' otherwise])
-fi
-AC_PATH_PROGS(GV, [gv gsview32], [echo gv])
-if test "$GV" != "echo gv" ; then
- AC_DEFINE([HAVE_GV],[1],[Define if the gv program is available])
- dnl If we're targeting for mingw we should emit windows paths, not msys
- if test "$llvm_cv_os_type" = "MingW" ; then
- GV=`echo $GV | sed 's/^\/\([[A-Za-z]]\)\//\1:\//' `
- fi
- AC_DEFINE_UNQUOTED([LLVM_PATH_GV],"$GV${EXEEXT}",
- [Define to path to gv program if found or 'echo gv' otherwise])
-fi
-AC_PATH_PROG(DOTTY, [dotty], [echo dotty])
-if test "$DOTTY" != "echo dotty" ; then
- AC_DEFINE([HAVE_DOTTY],[1],[Define if the dotty program is available])
- dnl If we're targeting for mingw we should emit windows paths, not msys
- if test "$llvm_cv_os_type" = "MingW" ; then
- DOTTY=`echo $DOTTY | sed 's/^\/\([[A-Za-z]]\)\//\1:\//' `
- fi
- AC_DEFINE_UNQUOTED([LLVM_PATH_DOTTY],"$DOTTY${EXEEXT}",
- [Define to path to dotty program if found or 'echo dotty' otherwise])
-fi
-
-dnl Look for a sufficiently recent version of Perl.
-LLVM_PROG_PERL([5.006])
-AC_SUBST(PERL)
-if test x"$PERL" = xnone; then
- AC_SUBST(HAVE_PERL,0)
- AC_MSG_ERROR([perl is required but was not found, please install it])
-else
- AC_SUBST(HAVE_PERL,1)
-fi
-
-dnl Find the install program
-AC_PROG_INSTALL
-
-dnl Checks for documentation and testing tools that we can do without. If these
-dnl are not found then they are set to "true" which always succeeds but does
-dnl nothing. This just lets the build output show that we could have done
-dnl something if the tool was available.
-AC_PATH_PROG(BZIP2, [bzip2])
-AC_PATH_PROG(DOXYGEN, [doxygen])
-AC_PATH_PROG(GROFF, [groff])
-AC_PATH_PROG(GZIP, [gzip])
-AC_PATH_PROG(POD2HTML, [pod2html])
-AC_PATH_PROG(POD2MAN, [pod2man])
-AC_PATH_PROG(RUNTEST, [runtest])
-DJ_AC_PATH_TCLSH
-AC_PATH_PROG(ZIP, [zip])
-AC_PATH_PROGS(OCAMLC, [ocamlc.opt ocamlc])
-AC_PATH_PROGS(OCAMLOPT, [ocamlopt.opt ocamlopt])
-AC_PATH_PROGS(OCAMLDEP, [ocamldep.opt ocamldep])
-AC_PATH_PROGS(OCAMLDOC, [ocamldoc.opt ocamldoc])
-
-dnl Determine if the linker supports the -R option.
-AC_LINK_USE_R
-
-dnl Check for libtool and the library that has dlopen function (which must come
-dnl before the AC_PROG_LIBTOOL check in order to enable dlopening libraries with
-dnl libtool).
-AC_LIBTOOL_DLOPEN
-AC_LIB_LTDL
-AC_PROG_LIBTOOL
-
-if test "$lt_cv_dlopen_self" = "yes" ; then
- AC_DEFINE([CAN_DLOPEN_SELF],[1],
- [Define if dlopen(0) will open the symbols of the program])
-fi
-
-if test "$WITH_LLVMGCCDIR" = "default" ; then
- LLVMGCC="llvm-gcc${EXEEXT}"
- LLVMGXX="llvm-g++${EXEEXT}"
- AC_PATH_PROG(LLVMGCC, $LLVMGCC, [])
- AC_PATH_PROG(LLVMGXX, $LLVMGXX, [])
-else
- if test -z "$LLVMGCC"; then
- LLVMGCC="$WITH_LLVMGCCDIR/bin/llvm-gcc${EXEEXT}"
- fi
- if test -z "$LLVMGXX"; then
- LLVMGXX="$WITH_LLVMGCCDIR/bin/llvm-g++${EXEEXT}"
- fi
- AC_SUBST(LLVMGCC,$LLVMGCC)
- AC_SUBST(LLVMGXX,$LLVMGXX)
-fi
-
-AC_MSG_CHECKING([tool compatibility])
-
-dnl Ensure that compilation tools are GCC or a GNU compatible compiler such as
-dnl ICC; we use GCC specific options in the makefiles so the compiler needs
-dnl to support those options.
-dnl "icc" emits gcc signatures
-dnl "icc -no-gcc" emits no gcc signature BUT is still compatible
-ICC=no
-IXX=no
-case $CC in
- icc*|icpc*)
- ICC=yes
- IXX=yes
- ;;
- *)
- ;;
-esac
-
-if test "$GCC" != "yes" && test "$ICC" != "yes"
-then
- AC_MSG_ERROR([gcc|icc required but not found])
-fi
-
-dnl Ensure that compilation tools are GCC; we use GCC specific extensions
-if test "$GXX" != "yes" && test "$IXX" != "yes"
-then
- AC_MSG_ERROR([g++|icc required but not found])
-fi
-
-dnl Verify that GCC is version 3.0 or higher
-if test "$GCC" = "yes"
-then
- AC_COMPILE_IFELSE([[#if !defined(__GNUC__) || __GNUC__ < 3
-#error Unsupported GCC version
-#endif
-]], [], [AC_MSG_ERROR([gcc 3.x required, but you have a lower version])])
-fi
-
-dnl Check for GNU Make. We use its extensions, so don't build without it
-if test -z "$llvm_cv_gnu_make_command"
-then
- AC_MSG_ERROR([GNU Make required but not found])
-fi
-
-dnl Tool compatibility is okay if we make it here.
-AC_MSG_RESULT([ok])
-
-dnl===-----------------------------------------------------------------------===
-dnl===
-dnl=== SECTION 5: Check for libraries
-dnl===
-dnl===-----------------------------------------------------------------------===
-
-dnl libelf is for sparc only; we can ignore it if we don't have it
-AC_CHECK_LIB(elf, elf_begin)
-AC_CHECK_LIB(m,sin)
-if test "$llvm_cv_os_type" = "MingW" ; then
- AC_CHECK_LIB(imagehlp, main)
- AC_CHECK_LIB(psapi, main)
-fi
-
-dnl dlopen() is required for plugin support.
-AC_SEARCH_LIBS(dlopen,dl,AC_DEFINE([HAVE_DLOPEN],[1],
- [Define if dlopen() is available on this platform.]),
- AC_MSG_WARN([dlopen() not found - disabling plugin support]))
-
-dnl mallinfo is optional; the code can compile (minus features) without it
-AC_SEARCH_LIBS(mallinfo,malloc,AC_DEFINE([HAVE_MALLINFO],[1],
- [Define if mallinfo() is available on this platform.]))
-
-dnl pthread locking functions are optional - but llvm will not be thread-safe
-dnl without locks.
-if test "$ENABLE_THREADS" -eq 1 ; then
- AC_CHECK_LIB(pthread,pthread_mutex_init)
- AC_SEARCH_LIBS(pthread_mutex_lock,pthread,
- AC_DEFINE([HAVE_PTHREAD_MUTEX_LOCK],[1],
- [Have pthread_mutex_lock]))
-fi
-
-dnl Allow extra x86-disassembler library
-AC_ARG_WITH(udis86,
- AS_HELP_STRING([--with-udis86=<path>],
- [Use udis86 external x86 disassembler library]),
- [
- AC_SUBST(USE_UDIS86, [1])
- case "$withval" in
- /usr/lib|yes) ;;
- *) LDFLAGS="$LDFLAGS -L${withval}" ;;
- esac
- AC_CHECK_LIB(udis86, ud_init, [], [
- echo "Error! You need to have libudis86 around."
- exit -1
- ])
- ],
- AC_SUBST(USE_UDIS86, [0]))
-AC_DEFINE_UNQUOTED([USE_UDIS86],$USE_UDIS86,
- [Define if use udis86 library])
-
-dnl===-----------------------------------------------------------------------===
-dnl===
-dnl=== SECTION 6: Check for header files
-dnl===
-dnl===-----------------------------------------------------------------------===
-
-dnl First, use autoconf provided macros for specific headers that we need
-dnl We don't check for ancient stuff or things that are guaranteed to be there
-dnl by the C++ standard. We always use the <cfoo> versions of <foo.h> C headers.
-dnl Generally we're looking for POSIX headers.
-AC_HEADER_DIRENT
-AC_HEADER_MMAP_ANONYMOUS
-AC_HEADER_STAT
-AC_HEADER_STDC
-AC_HEADER_SYS_WAIT
-AC_HEADER_TIME
-
-AC_CHECK_HEADERS([dlfcn.h execinfo.h fcntl.h inttypes.h limits.h link.h])
-AC_CHECK_HEADERS([malloc.h setjmp.h signal.h stdint.h unistd.h utime.h])
-AC_CHECK_HEADERS([windows.h])
-AC_CHECK_HEADERS([sys/mman.h sys/param.h sys/resource.h sys/time.h])
-AC_CHECK_HEADERS([sys/types.h malloc/malloc.h mach/mach.h])
-if test "$ENABLE_THREADS" -eq 1 ; then
- AC_CHECK_HEADERS(pthread.h,
- AC_SUBST(HAVE_PTHREAD, 1),
- AC_SUBST(HAVE_PTHREAD, 0))
-else
- AC_SUBST(HAVE_PTHREAD, 0)
-fi
-
-dnl===-----------------------------------------------------------------------===
-dnl===
-dnl=== SECTION 7: Check for types and structures
-dnl===
-dnl===-----------------------------------------------------------------------===
-
-AC_HUGE_VAL_CHECK
-AC_TYPE_PID_T
-AC_TYPE_SIZE_T
-AC_TYPE_SIGNAL
-AC_STRUCT_TM
-AC_CHECK_TYPES([int64_t],,AC_MSG_ERROR([Type int64_t required but not found]))
-AC_CHECK_TYPES([uint64_t],,
- AC_CHECK_TYPES([u_int64_t],,
- AC_MSG_ERROR([Type uint64_t or u_int64_t required but not found])))
-
-dnl===-----------------------------------------------------------------------===
-dnl===
-dnl=== SECTION 8: Check for specific functions needed
-dnl===
-dnl===-----------------------------------------------------------------------===
-
-AC_CHECK_FUNCS([backtrace ceilf floorf roundf rintf nearbyintf getcwd ])
-AC_CHECK_FUNCS([powf fmodf strtof round ])
-AC_CHECK_FUNCS([getpagesize getrusage getrlimit setrlimit gettimeofday ])
-AC_CHECK_FUNCS([isatty mkdtemp mkstemp ])
-AC_CHECK_FUNCS([mktemp realpath sbrk setrlimit strdup strerror strerror_r ])
-AC_CHECK_FUNCS([strtoll strtoq sysconf malloc_zone_statistics ])
-AC_CHECK_FUNCS([setjmp longjmp sigsetjmp siglongjmp])
-AC_C_PRINTF_A
-AC_FUNC_ALLOCA
-AC_FUNC_RAND48
-
-dnl Check for variations in the Standard C++ library and STL. These macros are
-dnl provided by LLVM in the autoconf/m4 directory.
-AC_CXX_HAVE_HASH_MAP
-AC_CXX_HAVE_HASH_SET
-AC_CXX_HAVE_STD_ITERATOR
-AC_CXX_HAVE_BI_ITERATOR
-AC_CXX_HAVE_FWD_ITERATOR
-AC_FUNC_ISNAN
-AC_FUNC_ISINF
-
-dnl Check for mmap support.We also need to know if /dev/zero is required to
-dnl be opened for allocating RWX memory.
-dnl Make sure we aren't attempting to configure for an unknown system
-if test "$llvm_cv_platform_type" = "Unix" ; then
- AC_FUNC_MMAP
- AC_FUNC_MMAP_FILE
- AC_NEED_DEV_ZERO_FOR_MMAP
-
- if test "$ac_cv_func_mmap_fixed_mapped" = "no"
- then
- AC_MSG_WARN([mmap() of a fixed address required but not supported])
- fi
- if test "$ac_cv_func_mmap_file" = "no"
- then
- AC_MSG_WARN([mmap() of files required but not found])
- fi
-fi
-
-dnl===-----------------------------------------------------------------------===
-dnl===
-dnl=== SECTION 9: Additional checks, variables, etc.
-dnl===
-dnl===-----------------------------------------------------------------------===
-
-dnl Check, whether __dso_handle is present
-AC_CHECK_FUNCS([__dso_handle])
-
-dnl See if the llvm-gcc executable can compile to LLVM assembly
-AC_CACHE_CHECK([whether llvm-gcc is sane],[llvm_cv_llvmgcc_sanity],
-[llvm_cv_llvmgcc_sanity="no"
-if test -x "$LLVMGCC" ; then
- cp /dev/null conftest.c
- "$LLVMGCC" -emit-llvm -S -o - conftest.c | \
- grep 'target datalayout =' > /dev/null 2>&1
- if test $? -eq 0 ; then
- llvm_cv_llvmgcc_sanity="yes"
- fi
- rm conftest.c
-fi])
-
-dnl Since we have a sane llvm-gcc, identify it and its sub-tools
-if test "$llvm_cv_llvmgcc_sanity" = "yes" ; then
- AC_MSG_CHECKING([llvm-gcc component support])
- llvmcc1path=`"$LLVMGCC" --print-prog-name=cc1`
- AC_SUBST(LLVMCC1,$llvmcc1path)
- llvmcc1pluspath=`"$LLVMGCC" --print-prog-name=cc1plus`
- AC_SUBST(LLVMCC1PLUS,$llvmcc1pluspath)
- llvmgccdir=`echo "$llvmcc1path" | sed 's,/libexec/.*,,'`
- AC_SUBST(LLVMGCCDIR,$llvmgccdir)
- llvmgcclibexec=`echo "$llvmcc1path" | sed 's,/cc1,,'`
- AC_SUBST(LLVMGCCLIBEXEC,$llvmgcclibexec)
- llvmgccversion=[`"$LLVMGCC" -dumpversion 2>&1 | sed 's/^\([0-9.]*\).*/\1/'`]
- llvmgccmajvers=[`echo $llvmgccversion | sed 's/^\([0-9]\).*/\1/'`]
- AC_SUBST(LLVMGCC_VERSION,$llvmgccversion)
- AC_SUBST(LLVMGCC_MAJVERS,$llvmgccmajvers)
- llvmgcclangs=[`"$LLVMGCC" -v --help 2>&1 | grep '^Configured with:' | sed 's/^.*--enable-languages=\([^ -]*\).*/\1/'`]
- AC_SUBST(LLVMGCC_LANGS,$llvmgcclangs)
- AC_MSG_RESULT([ok])
-fi
-
-dnl Propagate the shared library extension that the libltdl checks did to
-dnl the Makefiles so we can use it there too
-AC_SUBST(SHLIBEXT,$libltdl_cv_shlibext)
-
-# Translate the various configuration directories and other basic
-# information into substitutions that will end up in Makefile.config.in
-# that these configured values can be used by the makefiles
-if test "${prefix}" = "NONE" ; then
- prefix="/usr/local"
-fi
-eval LLVM_PREFIX="${prefix}";
-eval LLVM_BINDIR="${prefix}/bin";
-eval LLVM_LIBDIR="${prefix}/lib";
-eval LLVM_DATADIR="${prefix}/share/llvm";
-eval LLVM_DOCSDIR="${prefix}/docs/llvm";
-eval LLVM_ETCDIR="${prefix}/etc/llvm";
-eval LLVM_INCLUDEDIR="${prefix}/include";
-eval LLVM_INFODIR="${prefix}/info";
-eval LLVM_MANDIR="${prefix}/man";
-LLVM_CONFIGTIME=`date`
-AC_SUBST(LLVM_PREFIX)
-AC_SUBST(LLVM_BINDIR)
-AC_SUBST(LLVM_LIBDIR)
-AC_SUBST(LLVM_DATADIR)
-AC_SUBST(LLVM_DOCSDIR)
-AC_SUBST(LLVM_ETCDIR)
-AC_SUBST(LLVM_INCLUDEDIR)
-AC_SUBST(LLVM_INFODIR)
-AC_SUBST(LLVM_MANDIR)
-AC_SUBST(LLVM_CONFIGTIME)
-
-# Place the various directores into the config.h file as #defines so that we
-# can know about the installation paths within LLVM.
-AC_DEFINE_UNQUOTED(LLVM_PREFIX,"$LLVM_PREFIX",
- [Installation prefix directory])
-AC_DEFINE_UNQUOTED(LLVM_BINDIR, "$LLVM_BINDIR",
- [Installation directory for binary executables])
-AC_DEFINE_UNQUOTED(LLVM_LIBDIR, "$LLVM_LIBDIR",
- [Installation directory for libraries])
-AC_DEFINE_UNQUOTED(LLVM_DATADIR, "$LLVM_DATADIR",
- [Installation directory for data files])
-AC_DEFINE_UNQUOTED(LLVM_DOCSDIR, "$LLVM_DOCSDIR",
- [Installation directory for documentation])
-AC_DEFINE_UNQUOTED(LLVM_ETCDIR, "$LLVM_ETCDIR",
- [Installation directory for config files])
-AC_DEFINE_UNQUOTED(LLVM_INCLUDEDIR, "$LLVM_INCLUDEDIR",
- [Installation directory for include files])
-AC_DEFINE_UNQUOTED(LLVM_INFODIR, "$LLVM_INFODIR",
- [Installation directory for .info files])
-AC_DEFINE_UNQUOTED(LLVM_MANDIR, "$LLVM_MANDIR",
- [Installation directory for man pages])
-AC_DEFINE_UNQUOTED(LLVM_CONFIGTIME, "$LLVM_CONFIGTIME",
- [Time at which LLVM was configured])
-AC_DEFINE_UNQUOTED(LLVM_HOSTTRIPLE, "$host",
- [Host triple we were built on])
-
-# Determine which bindings to build.
-if test "$BINDINGS_TO_BUILD" = auto ; then
- BINDINGS_TO_BUILD=""
- if test "x$OCAMLC" != x -a "x$OCAMLDEP" != x ; then
- BINDINGS_TO_BUILD="ocaml $BINDINGS_TO_BUILD"
- fi
-fi
-AC_SUBST(BINDINGS_TO_BUILD,$BINDINGS_TO_BUILD)
-
-# This isn't really configurey, but it avoids having to repeat the list in
-# other files.
-AC_SUBST(ALL_BINDINGS,ocaml)
-
-# Do any work necessary to ensure that bindings have what they need.
-binding_prereqs_failed=0
-for a_binding in $BINDINGS_TO_BUILD ; do
- case "$a_binding" in
- ocaml)
- if test "x$OCAMLC" = x ; then
- AC_MSG_WARN([--enable-bindings=ocaml specified, but ocamlc not found. Try configure OCAMLC=/path/to/ocamlc])
- binding_prereqs_failed=1
- fi
- if test "x$OCAMLDEP" = x ; then
- AC_MSG_WARN([--enable-bindings=ocaml specified, but ocamldep not found. Try configure OCAMLDEP=/path/to/ocamldep])
- binding_prereqs_failed=1
- fi
- if test "x$OCAMLOPT" = x ; then
- AC_MSG_WARN([--enable-bindings=ocaml specified, but ocamlopt not found. Try configure OCAMLOPT=/path/to/ocamlopt])
- dnl ocamlopt is optional!
- fi
- if test "x$with_ocaml_libdir" != xauto ; then
- AC_SUBST(OCAML_LIBDIR,$with_ocaml_libdir)
- else
- ocaml_stdlib="`"$OCAMLC" -where`"
- if test "$LLVM_PREFIX" '<' "$ocaml_stdlib" -a "$ocaml_stdlib" '<' "$LLVM_PREFIX~"
- then
- # ocaml stdlib is beneath our prefix; use stdlib
- AC_SUBST(OCAML_LIBDIR,$ocaml_stdlib)
- else
- # ocaml stdlib is outside our prefix; use libdir/ocaml
- AC_SUBST(OCAML_LIBDIR,$LLVM_LIBDIR/ocaml)
- fi
- fi
- ;;
- esac
-done
-if test "$binding_prereqs_failed" = 1 ; then
- AC_MSG_ERROR([Prequisites for bindings not satisfied. Fix them or use configure --disable-bindings.])
-fi
-
-
-dnl===-----------------------------------------------------------------------===
-dnl===
-dnl=== SECTION 10: Specify the output files and generate it
-dnl===
-dnl===-----------------------------------------------------------------------===
-
-dnl Configure header files
-dnl WARNING: dnl If you add or remove any of the following config headers, then
-dnl you MUST also update Makefile.rules so that the variable FilesToConfig
-dnl contains the same list of files as AC_CONFIG_HEADERS below. This ensures the
-dnl files can be updated automatically when their *.in sources change.
-AC_CONFIG_HEADERS([include/llvm/Config/config.h])
-AC_CONFIG_HEADERS([include/llvm/Support/DataTypes.h])
-AC_CONFIG_HEADERS([include/llvm/ADT/hash_map])
-AC_CONFIG_HEADERS([include/llvm/ADT/hash_set])
-AC_CONFIG_HEADERS([include/llvm/ADT/iterator])
-
-dnl Configure the makefile's configuration data
-AC_CONFIG_FILES([Makefile.config])
-
-dnl Configure the RPM spec file for LLVM
-AC_CONFIG_FILES([llvm.spec])
-
-dnl Configure doxygen's configuration file
-AC_CONFIG_FILES([docs/doxygen.cfg])
-
-dnl Do the first stage of configuration for llvm-config.in.
-AC_CONFIG_FILES([tools/llvm-config/llvm-config.in])
-
-dnl Do special configuration of Makefiles
-AC_CONFIG_COMMANDS([setup],,[llvm_src="${srcdir}"])
-AC_CONFIG_MAKEFILE(Makefile)
-AC_CONFIG_MAKEFILE(Makefile.common)
-AC_CONFIG_MAKEFILE(examples/Makefile)
-AC_CONFIG_MAKEFILE(lib/Makefile)
-AC_CONFIG_MAKEFILE(runtime/Makefile)
-AC_CONFIG_MAKEFILE(test/Makefile)
-AC_CONFIG_MAKEFILE(test/Makefile.tests)
-AC_CONFIG_MAKEFILE(tools/Makefile)
-AC_CONFIG_MAKEFILE(utils/Makefile)
-AC_CONFIG_MAKEFILE(projects/Makefile)
-AC_CONFIG_MAKEFILE(bindings/Makefile)
-AC_CONFIG_MAKEFILE(bindings/ocaml/Makefile.ocaml)
-
-dnl Finally, crank out the output
-AC_OUTPUT
diff --git a/release_23/autoconf/depcomp b/release_23/autoconf/depcomp
deleted file mode 100755
index 11e2d3bfe1cf..000000000000
--- a/release_23/autoconf/depcomp
+++ /dev/null
@@ -1,522 +0,0 @@
-#! /bin/sh
-# depcomp - compile a program generating dependencies as side-effects
-
-scriptversion=2004-05-31.23
-
-# Copyright (C) 1999, 2000, 2003, 2004 Free Software Foundation, Inc.
-
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
-
-case $1 in
- '')
- echo "$0: No command. Try \`$0 --help' for more information." 1>&2
- exit 1;
- ;;
- -h | --h*)
- cat <<\EOF
-Usage: depcomp [--help] [--version] PROGRAM [ARGS]
-
-Run PROGRAMS ARGS to compile a file, generating dependencies
-as side-effects.
-
-Environment variables:
- depmode Dependency tracking mode.
- source Source file read by `PROGRAMS ARGS'.
- object Object file output by `PROGRAMS ARGS'.
- DEPDIR directory where to store dependencies.
- depfile Dependency file to output.
- tmpdepfile Temporary file to use when outputing dependencies.
- libtool Whether libtool is used (yes/no).
-
-Report bugs to <bug-automake@gnu.org>.
-EOF
- exit 0
- ;;
- -v | --v*)
- echo "depcomp $scriptversion"
- exit 0
- ;;
-esac
-
-if test -z "$depmode" || test -z "$source" || test -z "$object"; then
- echo "depcomp: Variables source, object and depmode must be set" 1>&2
- exit 1
-fi
-
-# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
-depfile=${depfile-`echo "$object" |
- sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
-tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
-
-rm -f "$tmpdepfile"
-
-# Some modes work just like other modes, but use different flags. We
-# parameterize here, but still list the modes in the big case below,
-# to make depend.m4 easier to write. Note that we *cannot* use a case
-# here, because this file can only contain one case statement.
-if test "$depmode" = hp; then
- # HP compiler uses -M and no extra arg.
- gccflag=-M
- depmode=gcc
-fi
-
-if test "$depmode" = dashXmstdout; then
- # This is just like dashmstdout with a different argument.
- dashmflag=-xM
- depmode=dashmstdout
-fi
-
-case "$depmode" in
-gcc3)
-## gcc 3 implements dependency tracking that does exactly what
-## we want. Yay! Note: for some reason libtool 1.4 doesn't like
-## it if -MD -MP comes after the -MF stuff. Hmm.
- "$@" -MT "$object" -MD -MP -MF "$tmpdepfile"
- stat=$?
- if test $stat -eq 0; then :
- else
- rm -f "$tmpdepfile"
- exit $stat
- fi
- mv "$tmpdepfile" "$depfile"
- ;;
-
-gcc)
-## There are various ways to get dependency output from gcc. Here's
-## why we pick this rather obscure method:
-## - Don't want to use -MD because we'd like the dependencies to end
-## up in a subdir. Having to rename by hand is ugly.
-## (We might end up doing this anyway to support other compilers.)
-## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
-## -MM, not -M (despite what the docs say).
-## - Using -M directly means running the compiler twice (even worse
-## than renaming).
- if test -z "$gccflag"; then
- gccflag=-MD,
- fi
- "$@" -Wp,"$gccflag$tmpdepfile"
- stat=$?
- if test $stat -eq 0; then :
- else
- rm -f "$tmpdepfile"
- exit $stat
- fi
- rm -f "$depfile"
- echo "$object : \\" > "$depfile"
- alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
-## The second -e expression handles DOS-style file names with drive letters.
- sed -e 's/^[^:]*: / /' \
- -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
-## This next piece of magic avoids the `deleted header file' problem.
-## The problem is that when a header file which appears in a .P file
-## is deleted, the dependency causes make to die (because there is
-## typically no way to rebuild the header). We avoid this by adding
-## dummy dependencies for each header file. Too bad gcc doesn't do
-## this for us directly.
- tr ' ' '
-' < "$tmpdepfile" |
-## Some versions of gcc put a space before the `:'. On the theory
-## that the space means something, we add a space to the output as
-## well.
-## Some versions of the HPUX 10.20 sed can't process this invocation
-## correctly. Breaking it into two sed invocations is a workaround.
- sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
- rm -f "$tmpdepfile"
- ;;
-
-hp)
- # This case exists only to let depend.m4 do its work. It works by
- # looking at the text of this script. This case will never be run,
- # since it is checked for above.
- exit 1
- ;;
-
-sgi)
- if test "$libtool" = yes; then
- "$@" "-Wp,-MDupdate,$tmpdepfile"
- else
- "$@" -MDupdate "$tmpdepfile"
- fi
- stat=$?
- if test $stat -eq 0; then :
- else
- rm -f "$tmpdepfile"
- exit $stat
- fi
- rm -f "$depfile"
-
- if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
- echo "$object : \\" > "$depfile"
-
- # Clip off the initial element (the dependent). Don't try to be
- # clever and replace this with sed code, as IRIX sed won't handle
- # lines with more than a fixed number of characters (4096 in
- # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
- # the IRIX cc adds comments like `#:fec' to the end of the
- # dependency line.
- tr ' ' '
-' < "$tmpdepfile" \
- | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
- tr '
-' ' ' >> $depfile
- echo >> $depfile
-
- # The second pass generates a dummy entry for each header file.
- tr ' ' '
-' < "$tmpdepfile" \
- | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
- >> $depfile
- else
- # The sourcefile does not contain any dependencies, so just
- # store a dummy comment line, to avoid errors with the Makefile
- # "include basename.Plo" scheme.
- echo "#dummy" > "$depfile"
- fi
- rm -f "$tmpdepfile"
- ;;
-
-aix)
- # The C for AIX Compiler uses -M and outputs the dependencies
- # in a .u file. In older versions, this file always lives in the
- # current directory. Also, the AIX compiler puts `$object:' at the
- # start of each line; $object doesn't have directory information.
- # Version 6 uses the directory in both cases.
- stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'`
- tmpdepfile="$stripped.u"
- if test "$libtool" = yes; then
- "$@" -Wc,-M
- else
- "$@" -M
- fi
- stat=$?
-
- if test -f "$tmpdepfile"; then :
- else
- stripped=`echo "$stripped" | sed 's,^.*/,,'`
- tmpdepfile="$stripped.u"
- fi
-
- if test $stat -eq 0; then :
- else
- rm -f "$tmpdepfile"
- exit $stat
- fi
-
- if test -f "$tmpdepfile"; then
- outname="$stripped.o"
- # Each line is of the form `foo.o: dependent.h'.
- # Do two passes, one to just change these to
- # `$object: dependent.h' and one to simply `dependent.h:'.
- sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile"
- sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile"
- else
- # The sourcefile does not contain any dependencies, so just
- # store a dummy comment line, to avoid errors with the Makefile
- # "include basename.Plo" scheme.
- echo "#dummy" > "$depfile"
- fi
- rm -f "$tmpdepfile"
- ;;
-
-icc)
- # Intel's C compiler understands `-MD -MF file'. However on
- # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c
- # ICC 7.0 will fill foo.d with something like
- # foo.o: sub/foo.c
- # foo.o: sub/foo.h
- # which is wrong. We want:
- # sub/foo.o: sub/foo.c
- # sub/foo.o: sub/foo.h
- # sub/foo.c:
- # sub/foo.h:
- # ICC 7.1 will output
- # foo.o: sub/foo.c sub/foo.h
- # and will wrap long lines using \ :
- # foo.o: sub/foo.c ... \
- # sub/foo.h ... \
- # ...
-
- "$@" -MD -MF "$tmpdepfile"
- stat=$?
- if test $stat -eq 0; then :
- else
- rm -f "$tmpdepfile"
- exit $stat
- fi
- rm -f "$depfile"
- # Each line is of the form `foo.o: dependent.h',
- # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
- # Do two passes, one to just change these to
- # `$object: dependent.h' and one to simply `dependent.h:'.
- sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
- # Some versions of the HPUX 10.20 sed can't process this invocation
- # correctly. Breaking it into two sed invocations is a workaround.
- sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" |
- sed -e 's/$/ :/' >> "$depfile"
- rm -f "$tmpdepfile"
- ;;
-
-tru64)
- # The Tru64 compiler uses -MD to generate dependencies as a side
- # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
- # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
- # dependencies in `foo.d' instead, so we check for that too.
- # Subdirectories are respected.
- dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
- test "x$dir" = "x$object" && dir=
- base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
-
- if test "$libtool" = yes; then
- # Dependencies are output in .lo.d with libtool 1.4.
- # With libtool 1.5 they are output both in $dir.libs/$base.o.d
- # and in $dir.libs/$base.o.d and $dir$base.o.d. We process the
- # latter, because the former will be cleaned when $dir.libs is
- # erased.
- tmpdepfile1="$dir.libs/$base.lo.d"
- tmpdepfile2="$dir$base.o.d"
- tmpdepfile3="$dir.libs/$base.d"
- "$@" -Wc,-MD
- else
- tmpdepfile1="$dir$base.o.d"
- tmpdepfile2="$dir$base.d"
- tmpdepfile3="$dir$base.d"
- "$@" -MD
- fi
-
- stat=$?
- if test $stat -eq 0; then :
- else
- rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
- exit $stat
- fi
-
- if test -f "$tmpdepfile1"; then
- tmpdepfile="$tmpdepfile1"
- elif test -f "$tmpdepfile2"; then
- tmpdepfile="$tmpdepfile2"
- else
- tmpdepfile="$tmpdepfile3"
- fi
- if test -f "$tmpdepfile"; then
- sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
- # That's a tab and a space in the [].
- sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
- else
- echo "#dummy" > "$depfile"
- fi
- rm -f "$tmpdepfile"
- ;;
-
-#nosideeffect)
- # This comment above is used by automake to tell side-effect
- # dependency tracking mechanisms from slower ones.
-
-dashmstdout)
- # Important note: in order to support this mode, a compiler *must*
- # always write the preprocessed file to stdout, regardless of -o.
- "$@" || exit $?
-
- # Remove the call to Libtool.
- if test "$libtool" = yes; then
- while test $1 != '--mode=compile'; do
- shift
- done
- shift
- fi
-
- # Remove `-o $object'.
- IFS=" "
- for arg
- do
- case $arg in
- -o)
- shift
- ;;
- $object)
- shift
- ;;
- *)
- set fnord "$@" "$arg"
- shift # fnord
- shift # $arg
- ;;
- esac
- done
-
- test -z "$dashmflag" && dashmflag=-M
- # Require at least two characters before searching for `:'
- # in the target name. This is to cope with DOS-style filenames:
- # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise.
- "$@" $dashmflag |
- sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile"
- rm -f "$depfile"
- cat < "$tmpdepfile" > "$depfile"
- tr ' ' '
-' < "$tmpdepfile" | \
-## Some versions of the HPUX 10.20 sed can't process this invocation
-## correctly. Breaking it into two sed invocations is a workaround.
- sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
- rm -f "$tmpdepfile"
- ;;
-
-dashXmstdout)
- # This case only exists to satisfy depend.m4. It is never actually
- # run, as this mode is specially recognized in the preamble.
- exit 1
- ;;
-
-makedepend)
- "$@" || exit $?
- # Remove any Libtool call
- if test "$libtool" = yes; then
- while test $1 != '--mode=compile'; do
- shift
- done
- shift
- fi
- # X makedepend
- shift
- cleared=no
- for arg in "$@"; do
- case $cleared in
- no)
- set ""; shift
- cleared=yes ;;
- esac
- case "$arg" in
- -D*|-I*)
- set fnord "$@" "$arg"; shift ;;
- # Strip any option that makedepend may not understand. Remove
- # the object too, otherwise makedepend will parse it as a source file.
- -*|$object)
- ;;
- *)
- set fnord "$@" "$arg"; shift ;;
- esac
- done
- obj_suffix="`echo $object | sed 's/^.*\././'`"
- touch "$tmpdepfile"
- ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
- rm -f "$depfile"
- cat < "$tmpdepfile" > "$depfile"
- sed '1,2d' "$tmpdepfile" | tr ' ' '
-' | \
-## Some versions of the HPUX 10.20 sed can't process this invocation
-## correctly. Breaking it into two sed invocations is a workaround.
- sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
- rm -f "$tmpdepfile" "$tmpdepfile".bak
- ;;
-
-cpp)
- # Important note: in order to support this mode, a compiler *must*
- # always write the preprocessed file to stdout.
- "$@" || exit $?
-
- # Remove the call to Libtool.
- if test "$libtool" = yes; then
- while test $1 != '--mode=compile'; do
- shift
- done
- shift
- fi
-
- # Remove `-o $object'.
- IFS=" "
- for arg
- do
- case $arg in
- -o)
- shift
- ;;
- $object)
- shift
- ;;
- *)
- set fnord "$@" "$arg"
- shift # fnord
- shift # $arg
- ;;
- esac
- done
-
- "$@" -E |
- sed -n '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
- sed '$ s: \\$::' > "$tmpdepfile"
- rm -f "$depfile"
- echo "$object : \\" > "$depfile"
- cat < "$tmpdepfile" >> "$depfile"
- sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
- rm -f "$tmpdepfile"
- ;;
-
-msvisualcpp)
- # Important note: in order to support this mode, a compiler *must*
- # always write the preprocessed file to stdout, regardless of -o,
- # because we must use -o when running libtool.
- "$@" || exit $?
- IFS=" "
- for arg
- do
- case "$arg" in
- "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
- set fnord "$@"
- shift
- shift
- ;;
- *)
- set fnord "$@" "$arg"
- shift
- shift
- ;;
- esac
- done
- "$@" -E |
- sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile"
- rm -f "$depfile"
- echo "$object : \\" > "$depfile"
- . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile"
- echo " " >> "$depfile"
- . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile"
- rm -f "$tmpdepfile"
- ;;
-
-none)
- exec "$@"
- ;;
-
-*)
- echo "Unknown depmode $depmode" 1>&2
- exit 1
- ;;
-esac
-
-exit 0
-
-# Local Variables:
-# mode: shell-script
-# sh-indentation: 2
-# eval: (add-hook 'write-file-hooks 'time-stamp)
-# time-stamp-start: "scriptversion="
-# time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-end: "$"
-# End:
diff --git a/release_23/autoconf/install-sh b/release_23/autoconf/install-sh
deleted file mode 100644
index dd97db7aa1ca..000000000000
--- a/release_23/autoconf/install-sh
+++ /dev/null
@@ -1,322 +0,0 @@
-#!/bin/sh
-# install - install a program, script, or datafile
-
-scriptversion=2004-09-10.20
-
-# This originates from X11R5 (mit/util/scripts/install.sh), which was
-# later released in X11R6 (xc/config/util/install.sh) with the
-# following copyright and license.
-#
-# Copyright (C) 1994 X Consortium
-#
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documentation files (the "Software"), to
-# deal in the Software without restriction, including without limitation the
-# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
-# sell copies of the Software, and to permit persons to whom the Software is
-# furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be included in
-# all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
-# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-#
-# Except as contained in this notice, the name of the X Consortium shall not
-# be used in advertising or otherwise to promote the sale, use or other deal-
-# ings in this Software without prior written authorization from the X Consor-
-# tium.
-#
-#
-# FSF changes to this file are in the public domain.
-#
-# Calling this script install-sh is preferred over install.sh, to prevent
-# `make' implicit rules from creating a file called install from it
-# when there is no Makefile.
-#
-# This script is compatible with the BSD install script, but was written
-# from scratch. It can only install one file at a time, a restriction
-# shared with many OS's install programs.
-
-# set DOITPROG to echo to test this script
-
-# Don't use :- since 4.3BSD and earlier shells don't like it.
-doit="${DOITPROG-}"
-
-# put in absolute paths if you don't have them in your path; or use env. vars.
-
-mvprog="${MVPROG-mv}"
-cpprog="${CPPROG-cp}"
-chmodprog="${CHMODPROG-chmod}"
-chownprog="${CHOWNPROG-chown}"
-chgrpprog="${CHGRPPROG-chgrp}"
-stripprog="${STRIPPROG-strip}"
-rmprog="${RMPROG-rm}"
-mkdirprog="${MKDIRPROG-mkdir}"
-
-chmodcmd="$chmodprog 0755"
-chowncmd=
-chgrpcmd=
-stripcmd=
-rmcmd="$rmprog -f"
-mvcmd="$mvprog"
-src=
-dst=
-dir_arg=
-dstarg=
-no_target_directory=
-
-usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
- or: $0 [OPTION]... SRCFILES... DIRECTORY
- or: $0 [OPTION]... -t DIRECTORY SRCFILES...
- or: $0 [OPTION]... -d DIRECTORIES...
-
-In the 1st form, copy SRCFILE to DSTFILE.
-In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
-In the 4th, create DIRECTORIES.
-
-Options:
--c (ignored)
--d create directories instead of installing files.
--g GROUP $chgrpprog installed files to GROUP.
--m MODE $chmodprog installed files to MODE.
--o USER $chownprog installed files to USER.
--s $stripprog installed files.
--t DIRECTORY install into DIRECTORY.
--T report an error if DSTFILE is a directory.
---help display this help and exit.
---version display version info and exit.
-
-Environment variables override the default commands:
- CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG
-"
-
-while test -n "$1"; do
- case $1 in
- -c) shift
- continue;;
-
- -d) dir_arg=true
- shift
- continue;;
-
- -g) chgrpcmd="$chgrpprog $2"
- shift
- shift
- continue;;
-
- --help) echo "$usage"; exit 0;;
-
- -m) chmodcmd="$chmodprog $2"
- shift
- shift
- continue;;
-
- -o) chowncmd="$chownprog $2"
- shift
- shift
- continue;;
-
- -s) stripcmd=$stripprog
- shift
- continue;;
-
- -t) dstarg=$2
- shift
- shift
- continue;;
-
- -T) no_target_directory=true
- shift
- continue;;
-
- --version) echo "$0 $scriptversion"; exit 0;;
-
- *) # When -d is used, all remaining arguments are directories to create.
- # When -t is used, the destination is already specified.
- test -n "$dir_arg$dstarg" && break
- # Otherwise, the last argument is the destination. Remove it from $@.
- for arg
- do
- if test -n "$dstarg"; then
- # $@ is not empty: it contains at least $arg.
- set fnord "$@" "$dstarg"
- shift # fnord
- fi
- shift # arg
- dstarg=$arg
- done
- break;;
- esac
-done
-
-if test -z "$1"; then
- if test -z "$dir_arg"; then
- echo "$0: no input file specified." >&2
- exit 1
- fi
- # It's OK to call `install-sh -d' without argument.
- # This can happen when creating conditional directories.
- exit 0
-fi
-
-for src
-do
- # Protect names starting with `-'.
- case $src in
- -*) src=./$src ;;
- esac
-
- if test -n "$dir_arg"; then
- dst=$src
- src=
-
- if test -d "$dst"; then
- mkdircmd=:
- chmodcmd=
- else
- mkdircmd=$mkdirprog
- fi
- else
- # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
- # might cause directories to be created, which would be especially bad
- # if $src (and thus $dsttmp) contains '*'.
- if test ! -f "$src" && test ! -d "$src"; then
- echo "$0: $src does not exist." >&2
- exit 1
- fi
-
- if test -z "$dstarg"; then
- echo "$0: no destination specified." >&2
- exit 1
- fi
-
- dst=$dstarg
- # Protect names starting with `-'.
- case $dst in
- -*) dst=./$dst ;;
- esac
-
- # If destination is a directory, append the input filename; won't work
- # if double slashes aren't ignored.
- if test -d "$dst"; then
- if test -n "$no_target_directory"; then
- echo "$0: $dstarg: Is a directory" >&2
- exit 1
- fi
- dst=$dst/`basename "$src"`
- fi
- fi
-
- # This sed command emulates the dirname command.
- dstdir=`echo "$dst" | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
-
- # Make sure that the destination directory exists.
-
- # Skip lots of stat calls in the usual case.
- if test ! -d "$dstdir"; then
- defaultIFS='
- '
- IFS="${IFS-$defaultIFS}"
-
- oIFS=$IFS
- # Some sh's can't handle IFS=/ for some reason.
- IFS='%'
- set - `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'`
- IFS=$oIFS
-
- pathcomp=
-
- while test $# -ne 0 ; do
- pathcomp=$pathcomp$1
- shift
- if test ! -d "$pathcomp"; then
- $mkdirprog "$pathcomp"
- # mkdir can fail with a `File exist' error in case several
- # install-sh are creating the directory concurrently. This
- # is OK.
- test -d "$pathcomp" || exit
- fi
- pathcomp=$pathcomp/
- done
- fi
-
- if test -n "$dir_arg"; then
- $doit $mkdircmd "$dst" \
- && { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \
- && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \
- && { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \
- && { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; }
-
- else
- dstfile=`basename "$dst"`
-
- # Make a couple of temp file names in the proper directory.
- dsttmp=$dstdir/_inst.$$_
- rmtmp=$dstdir/_rm.$$_
-
- # Trap to clean up those temp files at exit.
- trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
- trap '(exit $?); exit' 1 2 13 15
-
- # Copy the file name to the temp name.
- $doit $cpprog "$src" "$dsttmp" &&
-
- # and set any options; do chmod last to preserve setuid bits.
- #
- # If any of these fail, we abort the whole thing. If we want to
- # ignore errors from any of these, just make sure not to ignore
- # errors from the above "$doit $cpprog $src $dsttmp" command.
- #
- { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \
- && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \
- && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \
- && { test -z "$chmodcmd" || $doit $chmodcmd "$dsttmp"; } &&
-
- # Now rename the file to the real destination.
- { $doit $mvcmd -f "$dsttmp" "$dstdir/$dstfile" 2>/dev/null \
- || {
- # The rename failed, perhaps because mv can't rename something else
- # to itself, or perhaps because mv is so ancient that it does not
- # support -f.
-
- # Now remove or move aside any old file at destination location.
- # We try this two ways since rm can't unlink itself on some
- # systems and the destination file might be busy for other
- # reasons. In this case, the final cleanup might fail but the new
- # file should still install successfully.
- {
- if test -f "$dstdir/$dstfile"; then
- $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \
- || $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \
- || {
- echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2
- (exit 1); exit
- }
- else
- :
- fi
- } &&
-
- # Now rename the file to the real destination.
- $doit $mvcmd "$dsttmp" "$dstdir/$dstfile"
- }
- }
- fi || { (exit 1); exit; }
-done
-
-# The final little trick to "correctly" pass the exit status to the exit trap.
-{
- (exit 0); exit
-}
-
-# Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
-# time-stamp-start: "scriptversion="
-# time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-end: "$"
-# End:
diff --git a/release_23/autoconf/ltmain.sh b/release_23/autoconf/ltmain.sh
deleted file mode 100644
index 06823e057a57..000000000000
--- a/release_23/autoconf/ltmain.sh
+++ /dev/null
@@ -1,6863 +0,0 @@
-# ltmain.sh - Provide generalized library-building support services.
-# NOTE: Changing this file will not affect anything until you rerun configure.
-#
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005
-# Free Software Foundation, Inc.
-# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-basename="s,^.*/,,g"
-
-# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
-# is ksh but when the shell is invoked as "sh" and the current value of
-# the _XPG environment variable is not equal to 1 (one), the special
-# positional parameter $0, within a function call, is the name of the
-# function.
-progpath="$0"
-
-# The name of this program:
-progname=`echo "$progpath" | $SED $basename`
-modename="$progname"
-
-# Global variables:
-EXIT_SUCCESS=0
-EXIT_FAILURE=1
-
-PROGRAM=ltmain.sh
-PACKAGE=libtool
-VERSION=1.5.22
-TIMESTAMP=" (1.1220.2.365 2005/12/18 22:14:06)"
-
-# See if we are running on zsh, and set the options which allow our
-# commands through without removal of \ escapes.
-if test -n "${ZSH_VERSION+set}" ; then
- setopt NO_GLOB_SUBST
-fi
-
-# Check that we have a working $echo.
-if test "X$1" = X--no-reexec; then
- # Discard the --no-reexec flag, and continue.
- shift
-elif test "X$1" = X--fallback-echo; then
- # Avoid inline document here, it may be left over
- :
-elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
- # Yippee, $echo works!
- :
-else
- # Restart under the correct shell, and then maybe $echo will work.
- exec $SHELL "$progpath" --no-reexec ${1+"$@"}
-fi
-
-if test "X$1" = X--fallback-echo; then
- # used as fallback echo
- shift
- cat <<EOF
-$*
-EOF
- exit $EXIT_SUCCESS
-fi
-
-default_mode=
-help="Try \`$progname --help' for more information."
-magic="%%%MAGIC variable%%%"
-mkdir="mkdir"
-mv="mv -f"
-rm="rm -f"
-
-# Sed substitution that helps us do robust quoting. It backslashifies
-# metacharacters that are still active within double-quoted strings.
-Xsed="${SED}"' -e 1s/^X//'
-sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
-# test EBCDIC or ASCII
-case `echo X|tr X '\101'` in
- A) # ASCII based system
- # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
- SP2NL='tr \040 \012'
- NL2SP='tr \015\012 \040\040'
- ;;
- *) # EBCDIC based system
- SP2NL='tr \100 \n'
- NL2SP='tr \r\n \100\100'
- ;;
-esac
-
-# NLS nuisances.
-# Only set LANG and LC_ALL to C if already set.
-# These must not be set unconditionally because not all systems understand
-# e.g. LANG=C (notably SCO).
-# We save the old values to restore during execute mode.
-if test "${LC_ALL+set}" = set; then
- save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL
-fi
-if test "${LANG+set}" = set; then
- save_LANG="$LANG"; LANG=C; export LANG
-fi
-
-# Make sure IFS has a sensible default
-lt_nl='
-'
-IFS=" $lt_nl"
-
-if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
- $echo "$modename: not configured to build any kind of library" 1>&2
- $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
- exit $EXIT_FAILURE
-fi
-
-# Global variables.
-mode=$default_mode
-nonopt=
-prev=
-prevopt=
-run=
-show="$echo"
-show_help=
-execute_dlfiles=
-duplicate_deps=no
-preserve_args=
-lo2o="s/\\.lo\$/.${objext}/"
-o2lo="s/\\.${objext}\$/.lo/"
-
-#####################################
-# Shell function definitions:
-# This seems to be the best place for them
-
-# func_mktempdir [string]
-# Make a temporary directory that won't clash with other running
-# libtool processes, and avoids race conditions if possible. If
-# given, STRING is the basename for that directory.
-func_mktempdir ()
-{
- my_template="${TMPDIR-/tmp}/${1-$progname}"
-
- if test "$run" = ":"; then
- # Return a directory name, but don't create it in dry-run mode
- my_tmpdir="${my_template}-$$"
- else
-
- # If mktemp works, use that first and foremost
- my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
-
- if test ! -d "$my_tmpdir"; then
- # Failing that, at least try and use $RANDOM to avoid a race
- my_tmpdir="${my_template}-${RANDOM-0}$$"
-
- save_mktempdir_umask=`umask`
- umask 0077
- $mkdir "$my_tmpdir"
- umask $save_mktempdir_umask
- fi
-
- # If we're not in dry-run mode, bomb out on failure
- test -d "$my_tmpdir" || {
- $echo "cannot create temporary directory \`$my_tmpdir'" 1>&2
- exit $EXIT_FAILURE
- }
- fi
-
- $echo "X$my_tmpdir" | $Xsed
-}
-
-
-# func_win32_libid arg
-# return the library type of file 'arg'
-#
-# Need a lot of goo to handle *both* DLLs and import libs
-# Has to be a shell function in order to 'eat' the argument
-# that is supplied when $file_magic_command is called.
-func_win32_libid ()
-{
- win32_libid_type="unknown"
- win32_fileres=`file -L $1 2>/dev/null`
- case $win32_fileres in
- *ar\ archive\ import\ library*) # definitely import
- win32_libid_type="x86 archive import"
- ;;
- *ar\ archive*) # could be an import, or static
- if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \
- $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
- win32_nmres=`eval $NM -f posix -A $1 | \
- $SED -n -e '1,100{/ I /{s,.*,import,;p;q;};}'`
- case $win32_nmres in
- import*) win32_libid_type="x86 archive import";;
- *) win32_libid_type="x86 archive static";;
- esac
- fi
- ;;
- *DLL*)
- win32_libid_type="x86 DLL"
- ;;
- *executable*) # but shell scripts are "executable" too...
- case $win32_fileres in
- *MS\ Windows\ PE\ Intel*)
- win32_libid_type="x86 DLL"
- ;;
- esac
- ;;
- esac
- $echo $win32_libid_type
-}
-
-
-# func_infer_tag arg
-# Infer tagged configuration to use if any are available and
-# if one wasn't chosen via the "--tag" command line option.
-# Only attempt this if the compiler in the base compile
-# command doesn't match the default compiler.
-# arg is usually of the form 'gcc ...'
-func_infer_tag ()
-{
- if test -n "$available_tags" && test -z "$tagname"; then
- CC_quoted=
- for arg in $CC; do
- case $arg in
- *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
- arg="\"$arg\""
- ;;
- esac
- CC_quoted="$CC_quoted $arg"
- done
- case $@ in
- # Blanks in the command may have been stripped by the calling shell,
- # but not from the CC environment variable when configure was run.
- " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;;
- # Blanks at the start of $base_compile will cause this to fail
- # if we don't check for them as well.
- *)
- for z in $available_tags; do
- if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
- # Evaluate the configuration.
- eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
- CC_quoted=
- for arg in $CC; do
- # Double-quote args containing other shell metacharacters.
- case $arg in
- *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
- arg="\"$arg\""
- ;;
- esac
- CC_quoted="$CC_quoted $arg"
- done
- case "$@ " in
- " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*)
- # The compiler in the base compile command matches
- # the one in the tagged configuration.
- # Assume this is the tagged configuration we want.
- tagname=$z
- break
- ;;
- esac
- fi
- done
- # If $tagname still isn't set, then no tagged configuration
- # was found and let the user know that the "--tag" command
- # line option must be used.
- if test -z "$tagname"; then
- $echo "$modename: unable to infer tagged configuration"
- $echo "$modename: specify a tag with \`--tag'" 1>&2
- exit $EXIT_FAILURE
-# else
-# $echo "$modename: using $tagname tagged configuration"
- fi
- ;;
- esac
- fi
-}
-
-
-# func_extract_an_archive dir oldlib
-func_extract_an_archive ()
-{
- f_ex_an_ar_dir="$1"; shift
- f_ex_an_ar_oldlib="$1"
-
- $show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_oldlib)"
- $run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" || exit $?
- if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
- :
- else
- $echo "$modename: ERROR: object name conflicts: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" 1>&2
- exit $EXIT_FAILURE
- fi
-}
-
-# func_extract_archives gentop oldlib ...
-func_extract_archives ()
-{
- my_gentop="$1"; shift
- my_oldlibs=${1+"$@"}
- my_oldobjs=""
- my_xlib=""
- my_xabs=""
- my_xdir=""
- my_status=""
-
- $show "${rm}r $my_gentop"
- $run ${rm}r "$my_gentop"
- $show "$mkdir $my_gentop"
- $run $mkdir "$my_gentop"
- my_status=$?
- if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then
- exit $my_status
- fi
-
- for my_xlib in $my_oldlibs; do
- # Extract the objects.
- case $my_xlib in
- [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
- *) my_xabs=`pwd`"/$my_xlib" ;;
- esac
- my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'`
- my_xdir="$my_gentop/$my_xlib"
-
- $show "${rm}r $my_xdir"
- $run ${rm}r "$my_xdir"
- $show "$mkdir $my_xdir"
- $run $mkdir "$my_xdir"
- exit_status=$?
- if test "$exit_status" -ne 0 && test ! -d "$my_xdir"; then
- exit $exit_status
- fi
- case $host in
- *-darwin*)
- $show "Extracting $my_xabs"
- # Do not bother doing anything if just a dry run
- if test -z "$run"; then
- darwin_orig_dir=`pwd`
- cd $my_xdir || exit $?
- darwin_archive=$my_xabs
- darwin_curdir=`pwd`
- darwin_base_archive=`$echo "X$darwin_archive" | $Xsed -e 's%^.*/%%'`
- darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null`
- if test -n "$darwin_arches"; then
- darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'`
- darwin_arch=
- $show "$darwin_base_archive has multiple architectures $darwin_arches"
- for darwin_arch in $darwin_arches ; do
- mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
- lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
- cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
- func_extract_an_archive "`pwd`" "${darwin_base_archive}"
- cd "$darwin_curdir"
- $rm "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
- done # $darwin_arches
- ## Okay now we have a bunch of thin objects, gotta fatten them up :)
- darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP`
- darwin_file=
- darwin_files=
- for darwin_file in $darwin_filelist; do
- darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP`
- lipo -create -output "$darwin_file" $darwin_files
- done # $darwin_filelist
- ${rm}r unfat-$$
- cd "$darwin_orig_dir"
- else
- cd "$darwin_orig_dir"
- func_extract_an_archive "$my_xdir" "$my_xabs"
- fi # $darwin_arches
- fi # $run
- ;;
- *)
- func_extract_an_archive "$my_xdir" "$my_xabs"
- ;;
- esac
- my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
- done
- func_extract_archives_result="$my_oldobjs"
-}
-# End of Shell function definitions
-#####################################
-
-# Darwin sucks
-eval std_shrext=\"$shrext_cmds\"
-
-disable_libs=no
-
-# Parse our command line options once, thoroughly.
-while test "$#" -gt 0
-do
- arg="$1"
- shift
-
- case $arg in
- -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
- *) optarg= ;;
- esac
-
- # If the previous option needs an argument, assign it.
- if test -n "$prev"; then
- case $prev in
- execute_dlfiles)
- execute_dlfiles="$execute_dlfiles $arg"
- ;;
- tag)
- tagname="$arg"
- preserve_args="${preserve_args}=$arg"
-
- # Check whether tagname contains only valid characters
- case $tagname in
- *[!-_A-Za-z0-9,/]*)
- $echo "$progname: invalid tag name: $tagname" 1>&2
- exit $EXIT_FAILURE
- ;;
- esac
-
- case $tagname in
- CC)
- # Don't test for the "default" C tag, as we know, it's there, but
- # not specially marked.
- ;;
- *)
- if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then
- taglist="$taglist $tagname"
- # Evaluate the configuration.
- eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`"
- else
- $echo "$progname: ignoring unknown tag $tagname" 1>&2
- fi
- ;;
- esac
- ;;
- *)
- eval "$prev=\$arg"
- ;;
- esac
-
- prev=
- prevopt=
- continue
- fi
-
- # Have we seen a non-optional argument yet?
- case $arg in
- --help)
- show_help=yes
- ;;
-
- --version)
- $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
- $echo
- $echo "Copyright (C) 2005 Free Software Foundation, Inc."
- $echo "This is free software; see the source for copying conditions. There is NO"
- $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
- exit $?
- ;;
-
- --config)
- ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath
- # Now print the configurations for the tags.
- for tagname in $taglist; do
- ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath"
- done
- exit $?
- ;;
-
- --debug)
- $echo "$progname: enabling shell trace mode"
- set -x
- preserve_args="$preserve_args $arg"
- ;;
-
- --dry-run | -n)
- run=:
- ;;
-
- --features)
- $echo "host: $host"
- if test "$build_libtool_libs" = yes; then
- $echo "enable shared libraries"
- else
- $echo "disable shared libraries"
- fi
- if test "$build_old_libs" = yes; then
- $echo "enable static libraries"
- else
- $echo "disable static libraries"
- fi
- exit $?
- ;;
-
- --finish) mode="finish" ;;
-
- --mode) prevopt="--mode" prev=mode ;;
- --mode=*) mode="$optarg" ;;
-
- --preserve-dup-deps) duplicate_deps="yes" ;;
-
- --quiet | --silent)
- show=:
- preserve_args="$preserve_args $arg"
- ;;
-
- --tag)
- prevopt="--tag"
- prev=tag
- preserve_args="$preserve_args --tag"
- ;;
- --tag=*)
- set tag "$optarg" ${1+"$@"}
- shift
- prev=tag
- preserve_args="$preserve_args --tag"
- ;;
-
- -dlopen)
- prevopt="-dlopen"
- prev=execute_dlfiles
- ;;
-
- -*)
- $echo "$modename: unrecognized option \`$arg'" 1>&2
- $echo "$help" 1>&2
- exit $EXIT_FAILURE
- ;;
-
- *)
- nonopt="$arg"
- break
- ;;
- esac
-done
-
-if test -n "$prevopt"; then
- $echo "$modename: option \`$prevopt' requires an argument" 1>&2
- $echo "$help" 1>&2
- exit $EXIT_FAILURE
-fi
-
-case $disable_libs in
-no)
- ;;
-shared)
- build_libtool_libs=no
- build_old_libs=yes
- ;;
-static)
- build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
- ;;
-esac
-
-# If this variable is set in any of the actions, the command in it
-# will be execed at the end. This prevents here-documents from being
-# left over by shells.
-exec_cmd=
-
-if test -z "$show_help"; then
-
- # Infer the operation mode.
- if test -z "$mode"; then
- $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2
- $echo "*** Future versions of Libtool will require --mode=MODE be specified." 1>&2
- case $nonopt in
- *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*)
- mode=link
- for arg
- do
- case $arg in
- -c)
- mode=compile
- break
- ;;
- esac
- done
- ;;
- *db | *dbx | *strace | *truss)
- mode=execute
- ;;
- *install*|cp|mv)
- mode=install
- ;;
- *rm)
- mode=uninstall
- ;;
- *)
- # If we have no mode, but dlfiles were specified, then do execute mode.
- test -n "$execute_dlfiles" && mode=execute
-
- # Just use the default operation mode.
- if test -z "$mode"; then
- if test -n "$nonopt"; then
- $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
- else
- $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
- fi
- fi
- ;;
- esac
- fi
-
- # Only execute mode is allowed to have -dlopen flags.
- if test -n "$execute_dlfiles" && test "$mode" != execute; then
- $echo "$modename: unrecognized option \`-dlopen'" 1>&2
- $echo "$help" 1>&2
- exit $EXIT_FAILURE
- fi
-
- # Change the help message to a mode-specific one.
- generic_help="$help"
- help="Try \`$modename --help --mode=$mode' for more information."
-
- # These modes are in order of execution frequency so that they run quickly.
- case $mode in
- # libtool compile mode
- compile)
- modename="$modename: compile"
- # Get the compilation command and the source file.
- base_compile=
- srcfile="$nonopt" # always keep a non-empty value in "srcfile"
- suppress_opt=yes
- suppress_output=
- arg_mode=normal
- libobj=
- later=
-
- for arg
- do
- case $arg_mode in
- arg )
- # do not "continue". Instead, add this to base_compile
- lastarg="$arg"
- arg_mode=normal
- ;;
-
- target )
- libobj="$arg"
- arg_mode=normal
- continue
- ;;
-
- normal )
- # Accept any command-line options.
- case $arg in
- -o)
- if test -n "$libobj" ; then
- $echo "$modename: you cannot specify \`-o' more than once" 1>&2
- exit $EXIT_FAILURE
- fi
- arg_mode=target
- continue
- ;;
-
- -static | -prefer-pic | -prefer-non-pic)
- later="$later $arg"
- continue
- ;;
-
- -no-suppress)
- suppress_opt=no
- continue
- ;;
-
- -Xcompiler)
- arg_mode=arg # the next one goes into the "base_compile" arg list
- continue # The current "srcfile" will either be retained or
- ;; # replaced later. I would guess that would be a bug.
-
- -Wc,*)
- args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
- lastarg=
- save_ifs="$IFS"; IFS=','
- for arg in $args; do
- IFS="$save_ifs"
-
- # Double-quote args containing other shell metacharacters.
- # Many Bourne shells cannot handle close brackets correctly
- # in scan sets, so we specify it separately.
- case $arg in
- *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
- arg="\"$arg\""
- ;;
- esac
- lastarg="$lastarg $arg"
- done
- IFS="$save_ifs"
- lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
-
- # Add the arguments to base_compile.
- base_compile="$base_compile $lastarg"
- continue
- ;;
-
- * )
- # Accept the current argument as the source file.
- # The previous "srcfile" becomes the current argument.
- #
- lastarg="$srcfile"
- srcfile="$arg"
- ;;
- esac # case $arg
- ;;
- esac # case $arg_mode
-
- # Aesthetically quote the previous argument.
- lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
-
- case $lastarg in
- # Double-quote args containing other shell metacharacters.
- # Many Bourne shells cannot handle close brackets correctly
- # in scan sets, and some SunOS ksh mistreat backslash-escaping
- # in scan sets (worked around with variable expansion),
- # and furthermore cannot handle '|' '&' '(' ')' in scan sets
- # at all, so we specify them separately.
- *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
- lastarg="\"$lastarg\""
- ;;
- esac
-
- base_compile="$base_compile $lastarg"
- done # for arg
-
- case $arg_mode in
- arg)
- $echo "$modename: you must specify an argument for -Xcompile"
- exit $EXIT_FAILURE
- ;;
- target)
- $echo "$modename: you must specify a target with \`-o'" 1>&2
- exit $EXIT_FAILURE
- ;;
- *)
- # Get the name of the library object.
- [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
- ;;
- esac
-
- # Recognize several different file suffixes.
- # If the user specifies -o file.o, it is replaced with file.lo
- xform='[cCFSifmso]'
- case $libobj in
- *.ada) xform=ada ;;
- *.adb) xform=adb ;;
- *.ads) xform=ads ;;
- *.asm) xform=asm ;;
- *.c++) xform=c++ ;;
- *.cc) xform=cc ;;
- *.ii) xform=ii ;;
- *.class) xform=class ;;
- *.cpp) xform=cpp ;;
- *.cxx) xform=cxx ;;
- *.f90) xform=f90 ;;
- *.for) xform=for ;;
- *.java) xform=java ;;
- esac
-
- libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
-
- case $libobj in
- *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
- *)
- $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
- exit $EXIT_FAILURE
- ;;
- esac
-
- func_infer_tag $base_compile
-
- for arg in $later; do
- case $arg in
- -static)
- build_old_libs=yes
- continue
- ;;
-
- -prefer-pic)
- pic_mode=yes
- continue
- ;;
-
- -prefer-non-pic)
- pic_mode=no
- continue
- ;;
- esac
- done
-
- qlibobj=`$echo "X$libobj" | $Xsed -e "$sed_quote_subst"`
- case $qlibobj in
- *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
- qlibobj="\"$qlibobj\"" ;;
- esac
- test "X$libobj" != "X$qlibobj" \
- && $echo "X$libobj" | grep '[]~#^*{};<>?"'"'"' &()|`$[]' \
- && $echo "$modename: libobj name \`$libobj' may not contain shell special characters."
- objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
- xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
- if test "X$xdir" = "X$obj"; then
- xdir=
- else
- xdir=$xdir/
- fi
- lobj=${xdir}$objdir/$objname
-
- if test -z "$base_compile"; then
- $echo "$modename: you must specify a compilation command" 1>&2
- $echo "$help" 1>&2
- exit $EXIT_FAILURE
- fi
-
- # Delete any leftover library objects.
- if test "$build_old_libs" = yes; then
- removelist="$obj $lobj $libobj ${libobj}T"
- else
- removelist="$lobj $libobj ${libobj}T"
- fi
-
- $run $rm $removelist
- trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
-
- # On Cygwin there's no "real" PIC flag so we must build both object types
- case $host_os in
- cygwin* | mingw* | pw32* | os2*)
- pic_mode=default
- ;;
- esac
- if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
- # non-PIC code in shared libraries is not supported
- pic_mode=default
- fi
-
- # Calculate the filename of the output object if compiler does
- # not support -o with -c
- if test "$compiler_c_o" = no; then
- output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
- lockfile="$output_obj.lock"
- removelist="$removelist $output_obj $lockfile"
- trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
- else
- output_obj=
- need_locks=no
- lockfile=
- fi
-
- # Lock this critical section if it is needed
- # We use this script file to make the link, it avoids creating a new file
- if test "$need_locks" = yes; then
- until $run ln "$progpath" "$lockfile" 2>/dev/null; do
- $show "Waiting for $lockfile to be removed"
- sleep 2
- done
- elif test "$need_locks" = warn; then
- if test -f "$lockfile"; then
- $echo "\
-*** ERROR, $lockfile exists and contains:
-`cat $lockfile 2>/dev/null`
-
-This indicates that another process is trying to use the same
-temporary object file, and libtool could not work around it because
-your compiler does not support \`-c' and \`-o' together. If you
-repeat this compilation, it may succeed, by chance, but you had better
-avoid parallel builds (make -j) in this platform, or get a better
-compiler."
-
- $run $rm $removelist
- exit $EXIT_FAILURE
- fi
- $echo "$srcfile" > "$lockfile"
- fi
-
- if test -n "$fix_srcfile_path"; then
- eval srcfile=\"$fix_srcfile_path\"
- fi
- qsrcfile=`$echo "X$srcfile" | $Xsed -e "$sed_quote_subst"`
- case $qsrcfile in
- *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
- qsrcfile="\"$qsrcfile\"" ;;
- esac
-
- $run $rm "$libobj" "${libobj}T"
-
- # Create a libtool object file (analogous to a ".la" file),
- # but don't create it if we're doing a dry run.
- test -z "$run" && cat > ${libobj}T <<EOF
-# $libobj - a libtool object file
-# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
-#
-# Please DO NOT delete this file!
-# It is necessary for linking the library.
-
-# Name of the PIC object.
-EOF
-
- # Only build a PIC object if we are building libtool libraries.
- if test "$build_libtool_libs" = yes; then
- # Without this assignment, base_compile gets emptied.
- fbsd_hideous_sh_bug=$base_compile
-
- if test "$pic_mode" != no; then
- command="$base_compile $qsrcfile $pic_flag"
- else
- # Don't build PIC code
- command="$base_compile $qsrcfile"
- fi
-
- if test ! -d "${xdir}$objdir"; then
- $show "$mkdir ${xdir}$objdir"
- $run $mkdir ${xdir}$objdir
- exit_status=$?
- if test "$exit_status" -ne 0 && test ! -d "${xdir}$objdir"; then
- exit $exit_status
- fi
- fi
-
- if test -z "$output_obj"; then
- # Place PIC objects in $objdir
- command="$command -o $lobj"
- fi
-
- $run $rm "$lobj" "$output_obj"
-
- $show "$command"
- if $run eval "$command"; then :
- else
- test -n "$output_obj" && $run $rm $removelist
- exit $EXIT_FAILURE
- fi
-
- if test "$need_locks" = warn &&
- test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
- $echo "\
-*** ERROR, $lockfile contains:
-`cat $lockfile 2>/dev/null`
-
-but it should contain:
-$srcfile
-
-This indicates that another process is trying to use the same
-temporary object file, and libtool could not work around it because
-your compiler does not support \`-c' and \`-o' together. If you
-repeat this compilation, it may succeed, by chance, but you had better
-avoid parallel builds (make -j) in this platform, or get a better
-compiler."
-
- $run $rm $removelist
- exit $EXIT_FAILURE
- fi
-
- # Just move the object if needed, then go on to compile the next one
- if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
- $show "$mv $output_obj $lobj"
- if $run $mv $output_obj $lobj; then :
- else
- error=$?
- $run $rm $removelist
- exit $error
- fi
- fi
-
- # Append the name of the PIC object to the libtool object file.
- test -z "$run" && cat >> ${libobj}T <<EOF
-pic_object='$objdir/$objname'
-
-EOF
-
- # Allow error messages only from the first compilation.
- if test "$suppress_opt" = yes; then
- suppress_output=' >/dev/null 2>&1'
- fi
- else
- # No PIC object so indicate it doesn't exist in the libtool
- # object file.
- test -z "$run" && cat >> ${libobj}T <<EOF
-pic_object=none
-
-EOF
- fi
-
- # Only build a position-dependent object if we build old libraries.
- if test "$build_old_libs" = yes; then
- if test "$pic_mode" != yes; then
- # Don't build PIC code
- command="$base_compile $qsrcfile"
- else
- command="$base_compile $qsrcfile $pic_flag"
- fi
- if test "$compiler_c_o" = yes; then
- command="$command -o $obj"
- fi
-
- # Suppress compiler output if we already did a PIC compilation.
- command="$command$suppress_output"
- $run $rm "$obj" "$output_obj"
- $show "$command"
- if $run eval "$command"; then :
- else
- $run $rm $removelist
- exit $EXIT_FAILURE
- fi
-
- if test "$need_locks" = warn &&
- test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
- $echo "\
-*** ERROR, $lockfile contains:
-`cat $lockfile 2>/dev/null`
-
-but it should contain:
-$srcfile
-
-This indicates that another process is trying to use the same
-temporary object file, and libtool could not work around it because
-your compiler does not support \`-c' and \`-o' together. If you
-repeat this compilation, it may succeed, by chance, but you had better
-avoid parallel builds (make -j) in this platform, or get a better
-compiler."
-
- $run $rm $removelist
- exit $EXIT_FAILURE
- fi
-
- # Just move the object if needed
- if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
- $show "$mv $output_obj $obj"
- if $run $mv $output_obj $obj; then :
- else
- error=$?
- $run $rm $removelist
- exit $error
- fi
- fi
-
- # Append the name of the non-PIC object the libtool object file.
- # Only append if the libtool object file exists.
- test -z "$run" && cat >> ${libobj}T <<EOF
-# Name of the non-PIC object.
-non_pic_object='$objname'
-
-EOF
- else
- # Append the name of the non-PIC object the libtool object file.
- # Only append if the libtool object file exists.
- test -z "$run" && cat >> ${libobj}T <<EOF
-# Name of the non-PIC object.
-non_pic_object=none
-
-EOF
- fi
-
- $run $mv "${libobj}T" "${libobj}"
-
- # Unlock the critical section if it was locked
- if test "$need_locks" != no; then
- $run $rm "$lockfile"
- fi
-
- exit $EXIT_SUCCESS
- ;;
-
- # libtool link mode
- link | relink)
- modename="$modename: link"
- case $host in
- *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
- # It is impossible to link a dll without this setting, and
- # we shouldn't force the makefile maintainer to figure out
- # which system we are compiling for in order to pass an extra
- # flag for every libtool invocation.
- # allow_undefined=no
-
- # FIXME: Unfortunately, there are problems with the above when trying
- # to make a dll which has undefined symbols, in which case not
- # even a static library is built. For now, we need to specify
- # -no-undefined on the libtool link line when we can be certain
- # that all symbols are satisfied, otherwise we get a static library.
- allow_undefined=yes
- ;;
- *)
- allow_undefined=yes
- ;;
- esac
- libtool_args="$nonopt"
- base_compile="$nonopt $@"
- compile_command="$nonopt"
- finalize_command="$nonopt"
-
- compile_rpath=
- finalize_rpath=
- compile_shlibpath=
- finalize_shlibpath=
- convenience=
- old_convenience=
- deplibs=
- old_deplibs=
- compiler_flags=
- linker_flags=
- dllsearchpath=
- lib_search_path=`pwd`
- inst_prefix_dir=
-
- avoid_version=no
- dlfiles=
- dlprefiles=
- dlself=no
- export_dynamic=no
- export_symbols=
- export_symbols_regex=
- generated=
- libobjs=
- ltlibs=
- module=no
- no_install=no
- objs=
- non_pic_objects=
- notinst_path= # paths that contain not-installed libtool libraries
- precious_files_regex=
- prefer_static_libs=no
- preload=no
- prev=
- prevarg=
- release=
- rpath=
- xrpath=
- perm_rpath=
- temp_rpath=
- thread_safe=no
- vinfo=
- vinfo_number=no
-
- func_infer_tag $base_compile
-
- # We need to know -static, to get the right output filenames.
- for arg
- do
- case $arg in
- -all-static | -static)
- if test "X$arg" = "X-all-static"; then
- if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
- $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
- fi
- if test -n "$link_static_flag"; then
- dlopen_self=$dlopen_self_static
- fi
- prefer_static_libs=yes
- else
- if test -z "$pic_flag" && test -n "$link_static_flag"; then
- dlopen_self=$dlopen_self_static
- fi
- prefer_static_libs=built
- fi
- build_libtool_libs=no
- build_old_libs=yes
- break
- ;;
- esac
- done
-
- # See if our shared archives depend on static archives.
- test -n "$old_archive_from_new_cmds" && build_old_libs=yes
-
- # Go through the arguments, transforming them on the way.
- while test "$#" -gt 0; do
- arg="$1"
- shift
- case $arg in
- *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
- qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
- ;;
- *) qarg=$arg ;;
- esac
- libtool_args="$libtool_args $qarg"
-
- # If the previous option needs an argument, assign it.
- if test -n "$prev"; then
- case $prev in
- output)
- compile_command="$compile_command @OUTPUT@"
- finalize_command="$finalize_command @OUTPUT@"
- ;;
- esac
-
- case $prev in
- dlfiles|dlprefiles)
- if test "$preload" = no; then
- # Add the symbol object into the linking commands.
- compile_command="$compile_command @SYMFILE@"
- finalize_command="$finalize_command @SYMFILE@"
- preload=yes
- fi
- case $arg in
- *.la | *.lo) ;; # We handle these cases below.
- force)
- if test "$dlself" = no; then
- dlself=needless
- export_dynamic=yes
- fi
- prev=
- continue
- ;;
- self)
- if test "$prev" = dlprefiles; then
- dlself=yes
- elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
- dlself=yes
- else
- dlself=needless
- export_dynamic=yes
- fi
- prev=
- continue
- ;;
- *)
- if test "$prev" = dlfiles; then
- dlfiles="$dlfiles $arg"
- else
- dlprefiles="$dlprefiles $arg"
- fi
- prev=
- continue
- ;;
- esac
- ;;
- expsyms)
- export_symbols="$arg"
- if test ! -f "$arg"; then
- $echo "$modename: symbol file \`$arg' does not exist"
- exit $EXIT_FAILURE
- fi
- prev=
- continue
- ;;
- expsyms_regex)
- export_symbols_regex="$arg"
- prev=
- continue
- ;;
- inst_prefix)
- inst_prefix_dir="$arg"
- prev=
- continue
- ;;
- precious_regex)
- precious_files_regex="$arg"
- prev=
- continue
- ;;
- release)
- release="-$arg"
- prev=
- continue
- ;;
- objectlist)
- if test -f "$arg"; then
- save_arg=$arg
- moreargs=
- for fil in `cat $save_arg`
- do
-# moreargs="$moreargs $fil"
- arg=$fil
- # A libtool-controlled object.
-
- # Check to see that this really is a libtool object.
- if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
- pic_object=
- non_pic_object=
-
- # Read the .lo file
- # If there is no directory component, then add one.
- case $arg in
- */* | *\\*) . $arg ;;
- *) . ./$arg ;;
- esac
-
- if test -z "$pic_object" || \
- test -z "$non_pic_object" ||
- test "$pic_object" = none && \
- test "$non_pic_object" = none; then
- $echo "$modename: cannot find name of object for \`$arg'" 1>&2
- exit $EXIT_FAILURE
- fi
-
- # Extract subdirectory from the argument.
- xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
- if test "X$xdir" = "X$arg"; then
- xdir=
- else
- xdir="$xdir/"
- fi
-
- if test "$pic_object" != none; then
- # Prepend the subdirectory the object is found in.
- pic_object="$xdir$pic_object"
-
- if test "$prev" = dlfiles; then
- if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
- dlfiles="$dlfiles $pic_object"
- prev=
- continue
- else
- # If libtool objects are unsupported, then we need to preload.
- prev=dlprefiles
- fi
- fi
-
- # CHECK ME: I think I busted this. -Ossama
- if test "$prev" = dlprefiles; then
- # Preload the old-style object.
- dlprefiles="$dlprefiles $pic_object"
- prev=
- fi
-
- # A PIC object.
- libobjs="$libobjs $pic_object"
- arg="$pic_object"
- fi
-
- # Non-PIC object.
- if test "$non_pic_object" != none; then
- # Prepend the subdirectory the object is found in.
- non_pic_object="$xdir$non_pic_object"
-
- # A standard non-PIC object
- non_pic_objects="$non_pic_objects $non_pic_object"
- if test -z "$pic_object" || test "$pic_object" = none ; then
- arg="$non_pic_object"
- fi
- else
- # If the PIC object exists, use it instead.
- # $xdir was prepended to $pic_object above.
- non_pic_object="$pic_object"
- non_pic_objects="$non_pic_objects $non_pic_object"
- fi
- else
- # Only an error if not doing a dry-run.
- if test -z "$run"; then
- $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
- exit $EXIT_FAILURE
- else
- # Dry-run case.
-
- # Extract subdirectory from the argument.
- xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
- if test "X$xdir" = "X$arg"; then
- xdir=
- else
- xdir="$xdir/"
- fi
-
- pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
- non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
- libobjs="$libobjs $pic_object"
- non_pic_objects="$non_pic_objects $non_pic_object"
- fi
- fi
- done
- else
- $echo "$modename: link input file \`$save_arg' does not exist"
- exit $EXIT_FAILURE
- fi
- arg=$save_arg
- prev=
- continue
- ;;
- rpath | xrpath)
- # We need an absolute path.
- case $arg in
- [\\/]* | [A-Za-z]:[\\/]*) ;;
- *)
- $echo "$modename: only absolute run-paths are allowed" 1>&2
- exit $EXIT_FAILURE
- ;;
- esac
- if test "$prev" = rpath; then
- case "$rpath " in
- *" $arg "*) ;;
- *) rpath="$rpath $arg" ;;
- esac
- else
- case "$xrpath " in
- *" $arg "*) ;;
- *) xrpath="$xrpath $arg" ;;
- esac
- fi
- prev=
- continue
- ;;
- xcompiler)
- compiler_flags="$compiler_flags $qarg"
- prev=
- compile_command="$compile_command $qarg"
- finalize_command="$finalize_command $qarg"
- continue
- ;;
- xlinker)
- linker_flags="$linker_flags $qarg"
- compiler_flags="$compiler_flags $wl$qarg"
- prev=
- compile_command="$compile_command $wl$qarg"
- finalize_command="$finalize_command $wl$qarg"
- continue
- ;;
- xcclinker)
- linker_flags="$linker_flags $qarg"
- compiler_flags="$compiler_flags $qarg"
- prev=
- compile_command="$compile_command $qarg"
- finalize_command="$finalize_command $qarg"
- continue
- ;;
- shrext)
- shrext_cmds="$arg"
- prev=
- continue
- ;;
- darwin_framework|darwin_framework_skip)
- test "$prev" = "darwin_framework" && compiler_flags="$compiler_flags $arg"
- compile_command="$compile_command $arg"
- finalize_command="$finalize_command $arg"
- prev=
- continue
- ;;
- *)
- eval "$prev=\"\$arg\""
- prev=
- continue
- ;;
- esac
- fi # test -n "$prev"
-
- prevarg="$arg"
-
- case $arg in
- -all-static)
- if test -n "$link_static_flag"; then
- compile_command="$compile_command $link_static_flag"
- finalize_command="$finalize_command $link_static_flag"
- fi
- continue
- ;;
-
- -allow-undefined)
- # FIXME: remove this flag sometime in the future.
- $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
- continue
- ;;
-
- -avoid-version)
- avoid_version=yes
- continue
- ;;
-
- -dlopen)
- prev=dlfiles
- continue
- ;;
-
- -dlpreopen)
- prev=dlprefiles
- continue
- ;;
-
- -export-dynamic)
- export_dynamic=yes
- continue
- ;;
-
- -export-symbols | -export-symbols-regex)
- if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
- $echo "$modename: more than one -exported-symbols argument is not allowed"
- exit $EXIT_FAILURE
- fi
- if test "X$arg" = "X-export-symbols"; then
- prev=expsyms
- else
- prev=expsyms_regex
- fi
- continue
- ;;
-
- -framework|-arch|-isysroot)
- case " $CC " in
- *" ${arg} ${1} "* | *" ${arg} ${1} "*)
- prev=darwin_framework_skip ;;
- *) compiler_flags="$compiler_flags $arg"
- prev=darwin_framework ;;
- esac
- compile_command="$compile_command $arg"
- finalize_command="$finalize_command $arg"
- continue
- ;;
-
- -inst-prefix-dir)
- prev=inst_prefix
- continue
- ;;
-
- # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
- # so, if we see these flags be careful not to treat them like -L
- -L[A-Z][A-Z]*:*)
- case $with_gcc/$host in
- no/*-*-irix* | /*-*-irix*)
- compile_command="$compile_command $arg"
- finalize_command="$finalize_command $arg"
- ;;
- esac
- continue
- ;;
-
- -L*)
- dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
- # We need an absolute path.
- case $dir in
- [\\/]* | [A-Za-z]:[\\/]*) ;;
- *)
- absdir=`cd "$dir" && pwd`
- if test -z "$absdir"; then
- $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
- absdir="$dir"
- notinst_path="$notinst_path $dir"
- fi
- dir="$absdir"
- ;;
- esac
- case "$deplibs " in
- *" -L$dir "*) ;;
- *)
- deplibs="$deplibs -L$dir"
- lib_search_path="$lib_search_path $dir"
- ;;
- esac
- case $host in
- *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
- testbindir=`$echo "X$dir" | $Xsed -e 's*/lib$*/bin*'`
- case :$dllsearchpath: in
- *":$dir:"*) ;;
- *) dllsearchpath="$dllsearchpath:$dir";;
- esac
- case :$dllsearchpath: in
- *":$testbindir:"*) ;;
- *) dllsearchpath="$dllsearchpath:$testbindir";;
- esac
- ;;
- esac
- continue
- ;;
-
- -l*)
- if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
- case $host in
- *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos*)
- # These systems don't actually have a C or math library (as such)
- continue
- ;;
- *-*-os2*)
- # These systems don't actually have a C library (as such)
- test "X$arg" = "X-lc" && continue
- ;;
- *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
- # Do not include libc due to us having libc/libc_r.
- test "X$arg" = "X-lc" && continue
- ;;
- *-*-rhapsody* | *-*-darwin1.[012])
- # Rhapsody C and math libraries are in the System framework
- deplibs="$deplibs -framework System"
- continue
- ;;
- *-*-sco3.2v5* | *-*-sco5v6*)
- # Causes problems with __ctype
- test "X$arg" = "X-lc" && continue
- ;;
- *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
- # Compiler inserts libc in the correct place for threads to work
- test "X$arg" = "X-lc" && continue
- ;;
- esac
- elif test "X$arg" = "X-lc_r"; then
- case $host in
- *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
- # Do not include libc_r directly, use -pthread flag.
- continue
- ;;
- esac
- fi
- deplibs="$deplibs $arg"
- continue
- ;;
-
- # Tru64 UNIX uses -model [arg] to determine the layout of C++
- # classes, name mangling, and exception handling.
- -model)
- compile_command="$compile_command $arg"
- compiler_flags="$compiler_flags $arg"
- finalize_command="$finalize_command $arg"
- prev=xcompiler
- continue
- ;;
-
- -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
- compiler_flags="$compiler_flags $arg"
- compile_command="$compile_command $arg"
- finalize_command="$finalize_command $arg"
- continue
- ;;
-
- -module)
- module=yes
- continue
- ;;
-
- # -64, -mips[0-9] enable 64-bit mode on the SGI compiler
- # -r[0-9][0-9]* specifies the processor on the SGI compiler
- # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler
- # +DA*, +DD* enable 64-bit mode on the HP compiler
- # -q* pass through compiler args for the IBM compiler
- # -m* pass through architecture-specific compiler args for GCC
- # -m*, -t[45]*, -txscale* pass through architecture-specific
- # compiler args for GCC
- # -pg pass through profiling flag for GCC
- # @file GCC response files
- -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*|-pg| \
- -t[45]*|-txscale*|@*)
-
- # Unknown arguments in both finalize_command and compile_command need
- # to be aesthetically quoted because they are evaled later.
- arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
- case $arg in
- *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
- arg="\"$arg\""
- ;;
- esac
- compile_command="$compile_command $arg"
- finalize_command="$finalize_command $arg"
- compiler_flags="$compiler_flags $arg"
- continue
- ;;
-
- -shrext)
- prev=shrext
- continue
- ;;
-
- -no-fast-install)
- fast_install=no
- continue
- ;;
-
- -no-install)
- case $host in
- *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
- # The PATH hackery in wrapper scripts is required on Windows
- # in order for the loader to find any dlls it needs.
- $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
- $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
- fast_install=no
- ;;
- *) no_install=yes ;;
- esac
- continue
- ;;
-
- -no-undefined)
- allow_undefined=no
- continue
- ;;
-
- -objectlist)
- prev=objectlist
- continue
- ;;
-
- -o) prev=output ;;
-
- -precious-files-regex)
- prev=precious_regex
- continue
- ;;
-
- -release)
- prev=release
- continue
- ;;
-
- -rpath)
- prev=rpath
- continue
- ;;
-
- -R)
- prev=xrpath
- continue
- ;;
-
- -R*)
- dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
- # We need an absolute path.
- case $dir in
- [\\/]* | [A-Za-z]:[\\/]*) ;;
- *)
- $echo "$modename: only absolute run-paths are allowed" 1>&2
- exit $EXIT_FAILURE
- ;;
- esac
- case "$xrpath " in
- *" $dir "*) ;;
- *) xrpath="$xrpath $dir" ;;
- esac
- continue
- ;;
-
- -static)
- # The effects of -static are defined in a previous loop.
- # We used to do the same as -all-static on platforms that
- # didn't have a PIC flag, but the assumption that the effects
- # would be equivalent was wrong. It would break on at least
- # Digital Unix and AIX.
- continue
- ;;
-
- -thread-safe)
- thread_safe=yes
- continue
- ;;
-
- -version-info)
- prev=vinfo
- continue
- ;;
- -version-number)
- prev=vinfo
- vinfo_number=yes
- continue
- ;;
-
- -Wc,*)
- args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
- arg=
- save_ifs="$IFS"; IFS=','
- for flag in $args; do
- IFS="$save_ifs"
- case $flag in
- *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
- flag="\"$flag\""
- ;;
- esac
- arg="$arg $wl$flag"
- compiler_flags="$compiler_flags $flag"
- done
- IFS="$save_ifs"
- arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
- ;;
-
- -Wl,*)
- args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
- arg=
- save_ifs="$IFS"; IFS=','
- for flag in $args; do
- IFS="$save_ifs"
- case $flag in
- *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
- flag="\"$flag\""
- ;;
- esac
- arg="$arg $wl$flag"
- compiler_flags="$compiler_flags $wl$flag"
- linker_flags="$linker_flags $flag"
- done
- IFS="$save_ifs"
- arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
- ;;
-
- -Xcompiler)
- prev=xcompiler
- continue
- ;;
-
- -Xlinker)
- prev=xlinker
- continue
- ;;
-
- -XCClinker)
- prev=xcclinker
- continue
- ;;
-
- # Some other compiler flag.
- -* | +*)
- # Unknown arguments in both finalize_command and compile_command need
- # to be aesthetically quoted because they are evaled later.
- arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
- case $arg in
- *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
- arg="\"$arg\""
- ;;
- esac
- ;;
-
- *.$objext)
- # A standard object.
- objs="$objs $arg"
- ;;
-
- *.lo)
- # A libtool-controlled object.
-
- # Check to see that this really is a libtool object.
- if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
- pic_object=
- non_pic_object=
-
- # Read the .lo file
- # If there is no directory component, then add one.
- case $arg in
- */* | *\\*) . $arg ;;
- *) . ./$arg ;;
- esac
-
- if test -z "$pic_object" || \
- test -z "$non_pic_object" ||
- test "$pic_object" = none && \
- test "$non_pic_object" = none; then
- $echo "$modename: cannot find name of object for \`$arg'" 1>&2
- exit $EXIT_FAILURE
- fi
-
- # Extract subdirectory from the argument.
- xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
- if test "X$xdir" = "X$arg"; then
- xdir=
- else
- xdir="$xdir/"
- fi
-
- if test "$pic_object" != none; then
- # Prepend the subdirectory the object is found in.
- pic_object="$xdir$pic_object"
-
- if test "$prev" = dlfiles; then
- if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
- dlfiles="$dlfiles $pic_object"
- prev=
- continue
- else
- # If libtool objects are unsupported, then we need to preload.
- prev=dlprefiles
- fi
- fi
-
- # CHECK ME: I think I busted this. -Ossama
- if test "$prev" = dlprefiles; then
- # Preload the old-style object.
- dlprefiles="$dlprefiles $pic_object"
- prev=
- fi
-
- # A PIC object.
- libobjs="$libobjs $pic_object"
- arg="$pic_object"
- fi
-
- # Non-PIC object.
- if test "$non_pic_object" != none; then
- # Prepend the subdirectory the object is found in.
- non_pic_object="$xdir$non_pic_object"
-
- # A standard non-PIC object
- non_pic_objects="$non_pic_objects $non_pic_object"
- if test -z "$pic_object" || test "$pic_object" = none ; then
- arg="$non_pic_object"
- fi
- else
- # If the PIC object exists, use it instead.
- # $xdir was prepended to $pic_object above.
- non_pic_object="$pic_object"
- non_pic_objects="$non_pic_objects $non_pic_object"
- fi
- else
- # Only an error if not doing a dry-run.
- if test -z "$run"; then
- $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
- exit $EXIT_FAILURE
- else
- # Dry-run case.
-
- # Extract subdirectory from the argument.
- xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
- if test "X$xdir" = "X$arg"; then
- xdir=
- else
- xdir="$xdir/"
- fi
-
- pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
- non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
- libobjs="$libobjs $pic_object"
- non_pic_objects="$non_pic_objects $non_pic_object"
- fi
- fi
- ;;
-
- *.$libext)
- # An archive.
- deplibs="$deplibs $arg"
- old_deplibs="$old_deplibs $arg"
- continue
- ;;
-
- *.la)
- # A libtool-controlled library.
-
- if test "$prev" = dlfiles; then
- # This library was specified with -dlopen.
- dlfiles="$dlfiles $arg"
- prev=
- elif test "$prev" = dlprefiles; then
- # The library was specified with -dlpreopen.
- dlprefiles="$dlprefiles $arg"
- prev=
- else
- deplibs="$deplibs $arg"
- fi
- continue
- ;;
-
- # Some other compiler argument.
- *)
- # Unknown arguments in both finalize_command and compile_command need
- # to be aesthetically quoted because they are evaled later.
- arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
- case $arg in
- *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
- arg="\"$arg\""
- ;;
- esac
- ;;
- esac # arg
-
- # Now actually substitute the argument into the commands.
- if test -n "$arg"; then
- compile_command="$compile_command $arg"
- finalize_command="$finalize_command $arg"
- fi
- done # argument parsing loop
-
- if test -n "$prev"; then
- $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
- $echo "$help" 1>&2
- exit $EXIT_FAILURE
- fi
-
- if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
- eval arg=\"$export_dynamic_flag_spec\"
- compile_command="$compile_command $arg"
- finalize_command="$finalize_command $arg"
- fi
-
- oldlibs=
- # calculate the name of the file, without its directory
- outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
- libobjs_save="$libobjs"
-
- if test -n "$shlibpath_var"; then
- # get the directories listed in $shlibpath_var
- eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
- else
- shlib_search_path=
- fi
- eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
- eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
-
- output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
- if test "X$output_objdir" = "X$output"; then
- output_objdir="$objdir"
- else
- output_objdir="$output_objdir/$objdir"
- fi
- # Create the object directory.
- if test ! -d "$output_objdir"; then
- $show "$mkdir $output_objdir"
- $run $mkdir $output_objdir
- exit_status=$?
- if test "$exit_status" -ne 0 && test ! -d "$output_objdir"; then
- exit $exit_status
- fi
- fi
-
- # Determine the type of output
- case $output in
- "")
- $echo "$modename: you must specify an output file" 1>&2
- $echo "$help" 1>&2
- exit $EXIT_FAILURE
- ;;
- *.$libext) linkmode=oldlib ;;
- *.lo | *.$objext) linkmode=obj ;;
- *.la) linkmode=lib ;;
- *) linkmode=prog ;; # Anything else should be a program.
- esac
-
- case $host in
- *cygwin* | *mingw* | *pw32*)
- # don't eliminate duplications in $postdeps and $predeps
- duplicate_compiler_generated_deps=yes
- ;;
- *)
- duplicate_compiler_generated_deps=$duplicate_deps
- ;;
- esac
- specialdeplibs=
-
- libs=
- # Find all interdependent deplibs by searching for libraries
- # that are linked more than once (e.g. -la -lb -la)
- for deplib in $deplibs; do
- if test "X$duplicate_deps" = "Xyes" ; then
- case "$libs " in
- *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
- esac
- fi
- libs="$libs $deplib"
- done
-
- if test "$linkmode" = lib; then
- libs="$predeps $libs $compiler_lib_search_path $postdeps"
-
- # Compute libraries that are listed more than once in $predeps
- # $postdeps and mark them as special (i.e., whose duplicates are
- # not to be eliminated).
- pre_post_deps=
- if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then
- for pre_post_dep in $predeps $postdeps; do
- case "$pre_post_deps " in
- *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
- esac
- pre_post_deps="$pre_post_deps $pre_post_dep"
- done
- fi
- pre_post_deps=
- fi
-
- deplibs=
- newdependency_libs=
- newlib_search_path=
- need_relink=no # whether we're linking any uninstalled libtool libraries
- notinst_deplibs= # not-installed libtool libraries
- case $linkmode in
- lib)
- passes="conv link"
- for file in $dlfiles $dlprefiles; do
- case $file in
- *.la) ;;
- *)
- $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
- exit $EXIT_FAILURE
- ;;
- esac
- done
- ;;
- prog)
- compile_deplibs=
- finalize_deplibs=
- alldeplibs=no
- newdlfiles=
- newdlprefiles=
- passes="conv scan dlopen dlpreopen link"
- ;;
- *) passes="conv"
- ;;
- esac
- for pass in $passes; do
- if test "$linkmode,$pass" = "lib,link" ||
- test "$linkmode,$pass" = "prog,scan"; then
- libs="$deplibs"
- deplibs=
- fi
- if test "$linkmode" = prog; then
- case $pass in
- dlopen) libs="$dlfiles" ;;
- dlpreopen) libs="$dlprefiles" ;;
- link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
- esac
- fi
- if test "$pass" = dlopen; then
- # Collect dlpreopened libraries
- save_deplibs="$deplibs"
- deplibs=
- fi
- for deplib in $libs; do
- lib=
- found=no
- case $deplib in
- -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
- if test "$linkmode,$pass" = "prog,link"; then
- compile_deplibs="$deplib $compile_deplibs"
- finalize_deplibs="$deplib $finalize_deplibs"
- else
- compiler_flags="$compiler_flags $deplib"
- fi
- continue
- ;;
- -l*)
- if test "$linkmode" != lib && test "$linkmode" != prog; then
- $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
- continue
- fi
- name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
- for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
- for search_ext in .la $std_shrext .so .a; do
- # Search the libtool library
- lib="$searchdir/lib${name}${search_ext}"
- if test -f "$lib"; then
- if test "$search_ext" = ".la"; then
- found=yes
- else
- found=no
- fi
- break 2
- fi
- done
- done
- if test "$found" != yes; then
- # deplib doesn't seem to be a libtool library
- if test "$linkmode,$pass" = "prog,link"; then
- compile_deplibs="$deplib $compile_deplibs"
- finalize_deplibs="$deplib $finalize_deplibs"
- else
- deplibs="$deplib $deplibs"
- test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
- fi
- continue
- else # deplib is a libtool library
- # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
- # We need to do some special things here, and not later.
- if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
- case " $predeps $postdeps " in
- *" $deplib "*)
- if (${SED} -e '2q' $lib |
- grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
- library_names=
- old_library=
- case $lib in
- */* | *\\*) . $lib ;;
- *) . ./$lib ;;
- esac
- for l in $old_library $library_names; do
- ll="$l"
- done
- if test "X$ll" = "X$old_library" ; then # only static version available
- found=no
- ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
- test "X$ladir" = "X$lib" && ladir="."
- lib=$ladir/$old_library
- if test "$linkmode,$pass" = "prog,link"; then
- compile_deplibs="$deplib $compile_deplibs"
- finalize_deplibs="$deplib $finalize_deplibs"
- else
- deplibs="$deplib $deplibs"
- test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
- fi
- continue
- fi
- fi
- ;;
- *) ;;
- esac
- fi
- fi
- ;; # -l
- -L*)
- case $linkmode in
- lib)
- deplibs="$deplib $deplibs"
- test "$pass" = conv && continue
- newdependency_libs="$deplib $newdependency_libs"
- newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
- ;;
- prog)
- if test "$pass" = conv; then
- deplibs="$deplib $deplibs"
- continue
- fi
- if test "$pass" = scan; then
- deplibs="$deplib $deplibs"
- else
- compile_deplibs="$deplib $compile_deplibs"
- finalize_deplibs="$deplib $finalize_deplibs"
- fi
- newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
- ;;
- *)
- $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
- ;;
- esac # linkmode
- continue
- ;; # -L
- -R*)
- if test "$pass" = link; then
- dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
- # Make sure the xrpath contains only unique directories.
- case "$xrpath " in
- *" $dir "*) ;;
- *) xrpath="$xrpath $dir" ;;
- esac
- fi
- deplibs="$deplib $deplibs"
- continue
- ;;
- *.la) lib="$deplib" ;;
- *.$libext)
- if test "$pass" = conv; then
- deplibs="$deplib $deplibs"
- continue
- fi
- case $linkmode in
- lib)
- valid_a_lib=no
- case $deplibs_check_method in
- match_pattern*)
- set dummy $deplibs_check_method
- match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
- if eval $echo \"$deplib\" 2>/dev/null \
- | $SED 10q \
- | $EGREP "$match_pattern_regex" > /dev/null; then
- valid_a_lib=yes
- fi
- ;;
- pass_all)
- valid_a_lib=yes
- ;;
- esac
- if test "$valid_a_lib" != yes; then
- $echo
- $echo "*** Warning: Trying to link with static lib archive $deplib."
- $echo "*** I have the capability to make that library automatically link in when"
- $echo "*** you link to this library. But I can only do this if you have a"
- $echo "*** shared version of the library, which you do not appear to have"
- $echo "*** because the file extensions .$libext of this argument makes me believe"
- $echo "*** that it is just a static archive that I should not used here."
- else
- $echo
- $echo "*** Warning: Linking the shared library $output against the"
- $echo "*** static library $deplib is not portable!"
- deplibs="$deplib $deplibs"
- fi
- continue
- ;;
- prog)
- if test "$pass" != link; then
- deplibs="$deplib $deplibs"
- else
- compile_deplibs="$deplib $compile_deplibs"
- finalize_deplibs="$deplib $finalize_deplibs"
- fi
- continue
- ;;
- esac # linkmode
- ;; # *.$libext
- *.lo | *.$objext)
- if test "$pass" = conv; then
- deplibs="$deplib $deplibs"
- elif test "$linkmode" = prog; then
- if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
- # If there is no dlopen support or we're linking statically,
- # we need to preload.
- newdlprefiles="$newdlprefiles $deplib"
- compile_deplibs="$deplib $compile_deplibs"
- finalize_deplibs="$deplib $finalize_deplibs"
- else
- newdlfiles="$newdlfiles $deplib"
- fi
- fi
- continue
- ;;
- %DEPLIBS%)
- alldeplibs=yes
- continue
- ;;
- esac # case $deplib
- if test "$found" = yes || test -f "$lib"; then :
- else
- $echo "$modename: cannot find the library \`$lib' or unhandled argument \`$deplib'" 1>&2
- exit $EXIT_FAILURE
- fi
-
- # Check to see that this really is a libtool archive.
- if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
- else
- $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
- exit $EXIT_FAILURE
- fi
-
- ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
- test "X$ladir" = "X$lib" && ladir="."
-
- dlname=
- dlopen=
- dlpreopen=
- libdir=
- library_names=
- old_library=
- # If the library was installed with an old release of libtool,
- # it will not redefine variables installed, or shouldnotlink
- installed=yes
- shouldnotlink=no
- avoidtemprpath=
-
-
- # Read the .la file
- case $lib in
- */* | *\\*) . $lib ;;
- *) . ./$lib ;;
- esac
-
- if test "$linkmode,$pass" = "lib,link" ||
- test "$linkmode,$pass" = "prog,scan" ||
- { test "$linkmode" != prog && test "$linkmode" != lib; }; then
- test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
- test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
- fi
-
- if test "$pass" = conv; then
- # Only check for convenience libraries
- deplibs="$lib $deplibs"
- if test -z "$libdir"; then
- if test -z "$old_library"; then
- $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
- exit $EXIT_FAILURE
- fi
- # It is a libtool convenience library, so add in its objects.
- convenience="$convenience $ladir/$objdir/$old_library"
- old_convenience="$old_convenience $ladir/$objdir/$old_library"
- tmp_libs=
- for deplib in $dependency_libs; do
- deplibs="$deplib $deplibs"
- if test "X$duplicate_deps" = "Xyes" ; then
- case "$tmp_libs " in
- *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
- esac
- fi
- tmp_libs="$tmp_libs $deplib"
- done
- elif test "$linkmode" != prog && test "$linkmode" != lib; then
- $echo "$modename: \`$lib' is not a convenience library" 1>&2
- exit $EXIT_FAILURE
- fi
- continue
- fi # $pass = conv
-
-
- # Get the name of the library we link against.
- linklib=
- for l in $old_library $library_names; do
- linklib="$l"
- done
- if test -z "$linklib"; then
- $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
- exit $EXIT_FAILURE
- fi
-
- # This library was specified with -dlopen.
- if test "$pass" = dlopen; then
- if test -z "$libdir"; then
- $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
- exit $EXIT_FAILURE
- fi
- if test -z "$dlname" ||
- test "$dlopen_support" != yes ||
- test "$build_libtool_libs" = no; then
- # If there is no dlname, no dlopen support or we're linking
- # statically, we need to preload. We also need to preload any
- # dependent libraries so libltdl's deplib preloader doesn't
- # bomb out in the load deplibs phase.
- dlprefiles="$dlprefiles $lib $dependency_libs"
- else
- newdlfiles="$newdlfiles $lib"
- fi
- continue
- fi # $pass = dlopen
-
- # We need an absolute path.
- case $ladir in
- [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
- *)
- abs_ladir=`cd "$ladir" && pwd`
- if test -z "$abs_ladir"; then
- $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
- $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
- abs_ladir="$ladir"
- fi
- ;;
- esac
- laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
-
- # Find the relevant object directory and library name.
- if test "X$installed" = Xyes; then
- if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
- $echo "$modename: warning: library \`$lib' was moved." 1>&2
- dir="$ladir"
- absdir="$abs_ladir"
- libdir="$abs_ladir"
- else
- dir="$libdir"
- absdir="$libdir"
- fi
- test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
- else
- if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
- dir="$ladir"
- absdir="$abs_ladir"
- # Remove this search path later
- notinst_path="$notinst_path $abs_ladir"
- else
- dir="$ladir/$objdir"
- absdir="$abs_ladir/$objdir"
- # Remove this search path later
- notinst_path="$notinst_path $abs_ladir"
- fi
- fi # $installed = yes
- name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
-
- # This library was specified with -dlpreopen.
- if test "$pass" = dlpreopen; then
- if test -z "$libdir"; then
- $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
- exit $EXIT_FAILURE
- fi
- # Prefer using a static library (so that no silly _DYNAMIC symbols
- # are required to link).
- if test -n "$old_library"; then
- newdlprefiles="$newdlprefiles $dir/$old_library"
- # Otherwise, use the dlname, so that lt_dlopen finds it.
- elif test -n "$dlname"; then
- newdlprefiles="$newdlprefiles $dir/$dlname"
- else
- newdlprefiles="$newdlprefiles $dir/$linklib"
- fi
- fi # $pass = dlpreopen
-
- if test -z "$libdir"; then
- # Link the convenience library
- if test "$linkmode" = lib; then
- deplibs="$dir/$old_library $deplibs"
- elif test "$linkmode,$pass" = "prog,link"; then
- compile_deplibs="$dir/$old_library $compile_deplibs"
- finalize_deplibs="$dir/$old_library $finalize_deplibs"
- else
- deplibs="$lib $deplibs" # used for prog,scan pass
- fi
- continue
- fi
-
-
- if test "$linkmode" = prog && test "$pass" != link; then
- newlib_search_path="$newlib_search_path $ladir"
- deplibs="$lib $deplibs"
-
- linkalldeplibs=no
- if test "$link_all_deplibs" != no || test -z "$library_names" ||
- test "$build_libtool_libs" = no; then
- linkalldeplibs=yes
- fi
-
- tmp_libs=
- for deplib in $dependency_libs; do
- case $deplib in
- -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
- esac
- # Need to link against all dependency_libs?
- if test "$linkalldeplibs" = yes; then
- deplibs="$deplib $deplibs"
- else
- # Need to hardcode shared library paths
- # or/and link against static libraries
- newdependency_libs="$deplib $newdependency_libs"
- fi
- if test "X$duplicate_deps" = "Xyes" ; then
- case "$tmp_libs " in
- *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
- esac
- fi
- tmp_libs="$tmp_libs $deplib"
- done # for deplib
- continue
- fi # $linkmode = prog...
-
- if test "$linkmode,$pass" = "prog,link"; then
- if test -n "$library_names" &&
- { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
- # We need to hardcode the library path
- if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
- # Make sure the rpath contains only unique directories.
- case "$temp_rpath " in
- *" $dir "*) ;;
- *" $absdir "*) ;;
- *) temp_rpath="$temp_rpath $absdir" ;;
- esac
- fi
-
- # Hardcode the library path.
- # Skip directories that are in the system default run-time
- # search path.
- case " $sys_lib_dlsearch_path " in
- *" $absdir "*) ;;
- *)
- case "$compile_rpath " in
- *" $absdir "*) ;;
- *) compile_rpath="$compile_rpath $absdir"
- esac
- ;;
- esac
- case " $sys_lib_dlsearch_path " in
- *" $libdir "*) ;;
- *)
- case "$finalize_rpath " in
- *" $libdir "*) ;;
- *) finalize_rpath="$finalize_rpath $libdir"
- esac
- ;;
- esac
- fi # $linkmode,$pass = prog,link...
-
- if test "$alldeplibs" = yes &&
- { test "$deplibs_check_method" = pass_all ||
- { test "$build_libtool_libs" = yes &&
- test -n "$library_names"; }; }; then
- # We only need to search for static libraries
- continue
- fi
- fi
-
- link_static=no # Whether the deplib will be linked statically
- use_static_libs=$prefer_static_libs
- if test "$use_static_libs" = built && test "$installed" = yes ; then
- use_static_libs=no
- fi
- if test -n "$library_names" &&
- { test "$use_static_libs" = no || test -z "$old_library"; }; then
- if test "$installed" = no; then
- notinst_deplibs="$notinst_deplibs $lib"
- need_relink=yes
- fi
- # This is a shared library
-
- # Warn about portability, can't link against -module's on
- # some systems (darwin)
- if test "$shouldnotlink" = yes && test "$pass" = link ; then
- $echo
- if test "$linkmode" = prog; then
- $echo "*** Warning: Linking the executable $output against the loadable module"
- else
- $echo "*** Warning: Linking the shared library $output against the loadable module"
- fi
- $echo "*** $linklib is not portable!"
- fi
- if test "$linkmode" = lib &&
- test "$hardcode_into_libs" = yes; then
- # Hardcode the library path.
- # Skip directories that are in the system default run-time
- # search path.
- case " $sys_lib_dlsearch_path " in
- *" $absdir "*) ;;
- *)
- case "$compile_rpath " in
- *" $absdir "*) ;;
- *) compile_rpath="$compile_rpath $absdir"
- esac
- ;;
- esac
- case " $sys_lib_dlsearch_path " in
- *" $libdir "*) ;;
- *)
- case "$finalize_rpath " in
- *" $libdir "*) ;;
- *) finalize_rpath="$finalize_rpath $libdir"
- esac
- ;;
- esac
- fi
-
- if test -n "$old_archive_from_expsyms_cmds"; then
- # figure out the soname
- set dummy $library_names
- realname="$2"
- shift; shift
- libname=`eval \\$echo \"$libname_spec\"`
- # use dlname if we got it. it's perfectly good, no?
- if test -n "$dlname"; then
- soname="$dlname"
- elif test -n "$soname_spec"; then
- # bleh windows
- case $host in
- *cygwin* | mingw*)
- major=`expr $current - $age`
- versuffix="-$major"
- ;;
- esac
- eval soname=\"$soname_spec\"
- else
- soname="$realname"
- fi
-
- # Make a new name for the extract_expsyms_cmds to use
- soroot="$soname"
- soname=`$echo $soroot | ${SED} -e 's/^.*\///'`
- newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"
-
- # If the library has no export list, then create one now
- if test -f "$output_objdir/$soname-def"; then :
- else
- $show "extracting exported symbol list from \`$soname'"
- save_ifs="$IFS"; IFS='~'
- cmds=$extract_expsyms_cmds
- for cmd in $cmds; do
- IFS="$save_ifs"
- eval cmd=\"$cmd\"
- $show "$cmd"
- $run eval "$cmd" || exit $?
- done
- IFS="$save_ifs"
- fi
-
- # Create $newlib
- if test -f "$output_objdir/$newlib"; then :; else
- $show "generating import library for \`$soname'"
- save_ifs="$IFS"; IFS='~'
- cmds=$old_archive_from_expsyms_cmds
- for cmd in $cmds; do
- IFS="$save_ifs"
- eval cmd=\"$cmd\"
- $show "$cmd"
- $run eval "$cmd" || exit $?
- done
- IFS="$save_ifs"
- fi
- # make sure the library variables are pointing to the new library
- dir=$output_objdir
- linklib=$newlib
- fi # test -n "$old_archive_from_expsyms_cmds"
-
- if test "$linkmode" = prog || test "$mode" != relink; then
- add_shlibpath=
- add_dir=
- add=
- lib_linked=yes
- case $hardcode_action in
- immediate | unsupported)
- if test "$hardcode_direct" = no; then
- add="$dir/$linklib"
- case $host in
- *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;;
- *-*-sysv4*uw2*) add_dir="-L$dir" ;;
- *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
- *-*-unixware7*) add_dir="-L$dir" ;;
- *-*-darwin* )
- # if the lib is a module then we can not link against
- # it, someone is ignoring the new warnings I added
- if /usr/bin/file -L $add 2> /dev/null |
- $EGREP ": [^:]* bundle" >/dev/null ; then
- $echo "** Warning, lib $linklib is a module, not a shared library"
- if test -z "$old_library" ; then
- $echo
- $echo "** And there doesn't seem to be a static archive available"
- $echo "** The link will probably fail, sorry"
- else
- add="$dir/$old_library"
- fi
- fi
- esac
- elif test "$hardcode_minus_L" = no; then
- case $host in
- *-*-sunos*) add_shlibpath="$dir" ;;
- esac
- add_dir="-L$dir"
- add="-l$name"
- elif test "$hardcode_shlibpath_var" = no; then
- add_shlibpath="$dir"
- add="-l$name"
- else
- lib_linked=no
- fi
- ;;
- relink)
- if test "$hardcode_direct" = yes; then
- add="$dir/$linklib"
- elif test "$hardcode_minus_L" = yes; then
- add_dir="-L$dir"
- # Try looking first in the location we're being installed to.
- if test -n "$inst_prefix_dir"; then
- case $libdir in
- [\\/]*)
- add_dir="$add_dir -L$inst_prefix_dir$libdir"
- ;;
- esac
- fi
- add="-l$name"
- elif test "$hardcode_shlibpath_var" = yes; then
- add_shlibpath="$dir"
- add="-l$name"
- else
- lib_linked=no
- fi
- ;;
- *) lib_linked=no ;;
- esac
-
- if test "$lib_linked" != yes; then
- $echo "$modename: configuration error: unsupported hardcode properties"
- exit $EXIT_FAILURE
- fi
-
- if test -n "$add_shlibpath"; then
- case :$compile_shlibpath: in
- *":$add_shlibpath:"*) ;;
- *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
- esac
- fi
- if test "$linkmode" = prog; then
- test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
- test -n "$add" && compile_deplibs="$add $compile_deplibs"
- else
- test -n "$add_dir" && deplibs="$add_dir $deplibs"
- test -n "$add" && deplibs="$add $deplibs"
- if test "$hardcode_direct" != yes && \
- test "$hardcode_minus_L" != yes && \
- test "$hardcode_shlibpath_var" = yes; then
- case :$finalize_shlibpath: in
- *":$libdir:"*) ;;
- *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
- esac
- fi
- fi
- fi
-
- if test "$linkmode" = prog || test "$mode" = relink; then
- add_shlibpath=
- add_dir=
- add=
- # Finalize command for both is simple: just hardcode it.
- if test "$hardcode_direct" = yes; then
- add="$libdir/$linklib"
- elif test "$hardcode_minus_L" = yes; then
- add_dir="-L$libdir"
- add="-l$name"
- elif test "$hardcode_shlibpath_var" = yes; then
- case :$finalize_shlibpath: in
- *":$libdir:"*) ;;
- *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
- esac
- add="-l$name"
- elif test "$hardcode_automatic" = yes; then
- if test -n "$inst_prefix_dir" &&
- test -f "$inst_prefix_dir$libdir/$linklib" ; then
- add="$inst_prefix_dir$libdir/$linklib"
- else
- add="$libdir/$linklib"
- fi
- else
- # We cannot seem to hardcode it, guess we'll fake it.
- add_dir="-L$libdir"
- # Try looking first in the location we're being installed to.
- if test -n "$inst_prefix_dir"; then
- case $libdir in
- [\\/]*)
- add_dir="$add_dir -L$inst_prefix_dir$libdir"
- ;;
- esac
- fi
- add="-l$name"
- fi
-
- if test "$linkmode" = prog; then
- test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
- test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
- else
- test -n "$add_dir" && deplibs="$add_dir $deplibs"
- test -n "$add" && deplibs="$add $deplibs"
- fi
- fi
- elif test "$linkmode" = prog; then
- # Here we assume that one of hardcode_direct or hardcode_minus_L
- # is not unsupported. This is valid on all known static and
- # shared platforms.
- if test "$hardcode_direct" != unsupported; then
- test -n "$old_library" && linklib="$old_library"
- compile_deplibs="$dir/$linklib $compile_deplibs"
- finalize_deplibs="$dir/$linklib $finalize_deplibs"
- else
- compile_deplibs="-l$name -L$dir $compile_deplibs"
- finalize_deplibs="-l$name -L$dir $finalize_deplibs"
- fi
- elif test "$build_libtool_libs" = yes; then
- # Not a shared library
- if test "$deplibs_check_method" != pass_all; then
- # We're trying link a shared library against a static one
- # but the system doesn't support it.
-
- # Just print a warning and add the library to dependency_libs so
- # that the program can be linked against the static library.
- $echo
- $echo "*** Warning: This system can not link to static lib archive $lib."
- $echo "*** I have the capability to make that library automatically link in when"
- $echo "*** you link to this library. But I can only do this if you have a"
- $echo "*** shared version of the library, which you do not appear to have."
- if test "$module" = yes; then
- $echo "*** But as you try to build a module library, libtool will still create "
- $echo "*** a static module, that should work as long as the dlopening application"
- $echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
- if test -z "$global_symbol_pipe"; then
- $echo
- $echo "*** However, this would only work if libtool was able to extract symbol"
- $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
- $echo "*** not find such a program. So, this module is probably useless."
- $echo "*** \`nm' from GNU binutils and a full rebuild may help."
- fi
- if test "$build_old_libs" = no; then
- build_libtool_libs=module
- build_old_libs=yes
- else
- build_libtool_libs=no
- fi
- fi
- else
- deplibs="$dir/$old_library $deplibs"
- link_static=yes
- fi
- fi # link shared/static library?
-
- if test "$linkmode" = lib; then
- if test -n "$dependency_libs" &&
- { test "$hardcode_into_libs" != yes ||
- test "$build_old_libs" = yes ||
- test "$link_static" = yes; }; then
- # Extract -R from dependency_libs
- temp_deplibs=
- for libdir in $dependency_libs; do
- case $libdir in
- -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
- case " $xrpath " in
- *" $temp_xrpath "*) ;;
- *) xrpath="$xrpath $temp_xrpath";;
- esac;;
- *) temp_deplibs="$temp_deplibs $libdir";;
- esac
- done
- dependency_libs="$temp_deplibs"
- fi
-
- newlib_search_path="$newlib_search_path $absdir"
- # Link against this library
- test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
- # ... and its dependency_libs
- tmp_libs=
- for deplib in $dependency_libs; do
- newdependency_libs="$deplib $newdependency_libs"
- if test "X$duplicate_deps" = "Xyes" ; then
- case "$tmp_libs " in
- *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
- esac
- fi
- tmp_libs="$tmp_libs $deplib"
- done
-
- if test "$link_all_deplibs" != no; then
- # Add the search paths of all dependency libraries
- for deplib in $dependency_libs; do
- case $deplib in
- -L*) path="$deplib" ;;
- *.la)
- dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
- test "X$dir" = "X$deplib" && dir="."
- # We need an absolute path.
- case $dir in
- [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
- *)
- absdir=`cd "$dir" && pwd`
- if test -z "$absdir"; then
- $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
- absdir="$dir"
- fi
- ;;
- esac
- if grep "^installed=no" $deplib > /dev/null; then
- path="$absdir/$objdir"
- else
- eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
- if test -z "$libdir"; then
- $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
- exit $EXIT_FAILURE
- fi
- if test "$absdir" != "$libdir"; then
- $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
- fi
- path="$absdir"
- fi
- depdepl=
- case $host in
- *-*-darwin*)
- # we do not want to link against static libs,
- # but need to link against shared
- eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
- if test -n "$deplibrary_names" ; then
- for tmp in $deplibrary_names ; do
- depdepl=$tmp
- done
- if test -f "$path/$depdepl" ; then
- depdepl="$path/$depdepl"
- fi
- # do not add paths which are already there
- case " $newlib_search_path " in
- *" $path "*) ;;
- *) newlib_search_path="$newlib_search_path $path";;
- esac
- fi
- path=""
- ;;
- *)
- path="-L$path"
- ;;
- esac
- ;;
- -l*)
- case $host in
- *-*-darwin*)
- # Again, we only want to link against shared libraries
- eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"`
- for tmp in $newlib_search_path ; do
- if test -f "$tmp/lib$tmp_libs.dylib" ; then
- eval depdepl="$tmp/lib$tmp_libs.dylib"
- break
- fi
- done
- path=""
- ;;
- *) continue ;;
- esac
- ;;
- *) continue ;;
- esac
- case " $deplibs " in
- *" $path "*) ;;
- *) deplibs="$path $deplibs" ;;
- esac
- case " $deplibs " in
- *" $depdepl "*) ;;
- *) deplibs="$depdepl $deplibs" ;;
- esac
- done
- fi # link_all_deplibs != no
- fi # linkmode = lib
- done # for deplib in $libs
- dependency_libs="$newdependency_libs"
- if test "$pass" = dlpreopen; then
- # Link the dlpreopened libraries before other libraries
- for deplib in $save_deplibs; do
- deplibs="$deplib $deplibs"
- done
- fi
- if test "$pass" != dlopen; then
- if test "$pass" != conv; then
- # Make sure lib_search_path contains only unique directories.
- lib_search_path=
- for dir in $newlib_search_path; do
- case "$lib_search_path " in
- *" $dir "*) ;;
- *) lib_search_path="$lib_search_path $dir" ;;
- esac
- done
- newlib_search_path=
- fi
-
- if test "$linkmode,$pass" != "prog,link"; then
- vars="deplibs"
- else
- vars="compile_deplibs finalize_deplibs"
- fi
- for var in $vars dependency_libs; do
- # Add libraries to $var in reverse order
- eval tmp_libs=\"\$$var\"
- new_libs=
- for deplib in $tmp_libs; do
- # FIXME: Pedantically, this is the right thing to do, so
- # that some nasty dependency loop isn't accidentally
- # broken:
- #new_libs="$deplib $new_libs"
- # Pragmatically, this seems to cause very few problems in
- # practice:
- case $deplib in
- -L*) new_libs="$deplib $new_libs" ;;
- -R*) ;;
- *)
- # And here is the reason: when a library appears more
- # than once as an explicit dependence of a library, or
- # is implicitly linked in more than once by the
- # compiler, it is considered special, and multiple
- # occurrences thereof are not removed. Compare this
- # with having the same library being listed as a
- # dependency of multiple other libraries: in this case,
- # we know (pedantically, we assume) the library does not
- # need to be listed more than once, so we keep only the
- # last copy. This is not always right, but it is rare
- # enough that we require users that really mean to play
- # such unportable linking tricks to link the library
- # using -Wl,-lname, so that libtool does not consider it
- # for duplicate removal.
- case " $specialdeplibs " in
- *" $deplib "*) new_libs="$deplib $new_libs" ;;
- *)
- case " $new_libs " in
- *" $deplib "*) ;;
- *) new_libs="$deplib $new_libs" ;;
- esac
- ;;
- esac
- ;;
- esac
- done
- tmp_libs=
- for deplib in $new_libs; do
- case $deplib in
- -L*)
- case " $tmp_libs " in
- *" $deplib "*) ;;
- *) tmp_libs="$tmp_libs $deplib" ;;
- esac
- ;;
- *) tmp_libs="$tmp_libs $deplib" ;;
- esac
- done
- eval $var=\"$tmp_libs\"
- done # for var
- fi
- # Last step: remove runtime libs from dependency_libs
- # (they stay in deplibs)
- tmp_libs=
- for i in $dependency_libs ; do
- case " $predeps $postdeps $compiler_lib_search_path " in
- *" $i "*)
- i=""
- ;;
- esac
- if test -n "$i" ; then
- tmp_libs="$tmp_libs $i"
- fi
- done
- dependency_libs=$tmp_libs
- done # for pass
- if test "$linkmode" = prog; then
- dlfiles="$newdlfiles"
- dlprefiles="$newdlprefiles"
- fi
-
- case $linkmode in
- oldlib)
- if test -n "$deplibs"; then
- $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
- fi
-
- if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
- $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
- fi
-
- if test -n "$rpath"; then
- $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
- fi
-
- if test -n "$xrpath"; then
- $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
- fi
-
- if test -n "$vinfo"; then
- $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2
- fi
-
- if test -n "$release"; then
- $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
- fi
-
- if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
- $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
- fi
-
- # Now set the variables for building old libraries.
- build_libtool_libs=no
- oldlibs="$output"
- objs="$objs$old_deplibs"
- ;;
-
- lib)
- # Make sure we only generate libraries of the form `libNAME.la'.
- case $outputname in
- lib*)
- name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
- eval shared_ext=\"$shrext_cmds\"
- eval libname=\"$libname_spec\"
- ;;
- *)
- if test "$module" = no; then
- $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
- $echo "$help" 1>&2
- exit $EXIT_FAILURE
- fi
- if test "$need_lib_prefix" != no; then
- # Add the "lib" prefix for modules if required
- name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
- eval shared_ext=\"$shrext_cmds\"
- eval libname=\"$libname_spec\"
- else
- libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
- fi
- ;;
- esac
-
- if test -n "$objs"; then
- if test "$deplibs_check_method" != pass_all; then
- $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
- exit $EXIT_FAILURE
- else
- $echo
- $echo "*** Warning: Linking the shared library $output against the non-libtool"
- $echo "*** objects $objs is not portable!"
- libobjs="$libobjs $objs"
- fi
- fi
-
- if test "$dlself" != no; then
- $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
- fi
-
- set dummy $rpath
- if test "$#" -gt 2; then
- $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
- fi
- install_libdir="$2"
-
- oldlibs=
- if test -z "$rpath"; then
- if test "$build_libtool_libs" = yes; then
- # Building a libtool convenience library.
- # Some compilers have problems with a `.al' extension so
- # convenience libraries should have the same extension an
- # archive normally would.
- oldlibs="$output_objdir/$libname.$libext $oldlibs"
- build_libtool_libs=convenience
- build_old_libs=yes
- fi
-
- if test -n "$vinfo"; then
- $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2
- fi
-
- if test -n "$release"; then
- $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
- fi
- else
-
- # Parse the version information argument.
- save_ifs="$IFS"; IFS=':'
- set dummy $vinfo 0 0 0
- IFS="$save_ifs"
-
- if test -n "$8"; then
- $echo "$modename: too many parameters to \`-version-info'" 1>&2
- $echo "$help" 1>&2
- exit $EXIT_FAILURE
- fi
-
- # convert absolute version numbers to libtool ages
- # this retains compatibility with .la files and attempts
- # to make the code below a bit more comprehensible
-
- case $vinfo_number in
- yes)
- number_major="$2"
- number_minor="$3"
- number_revision="$4"
- #
- # There are really only two kinds -- those that
- # use the current revision as the major version
- # and those that subtract age and use age as
- # a minor version. But, then there is irix
- # which has an extra 1 added just for fun
- #
- case $version_type in
- darwin|linux|osf|windows)
- current=`expr $number_major + $number_minor`
- age="$number_minor"
- revision="$number_revision"
- ;;
- freebsd-aout|freebsd-elf|sunos)
- current="$number_major"
- revision="$number_minor"
- age="0"
- ;;
- irix|nonstopux)
- current=`expr $number_major + $number_minor - 1`
- age="$number_minor"
- revision="$number_minor"
- ;;
- esac
- ;;
- no)
- current="$2"
- revision="$3"
- age="$4"
- ;;
- esac
-
- # Check that each of the things are valid numbers.
- case $current in
- 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
- *)
- $echo "$modename: CURRENT \`$current' must be a nonnegative integer" 1>&2
- $echo "$modename: \`$vinfo' is not valid version information" 1>&2
- exit $EXIT_FAILURE
- ;;
- esac
-
- case $revision in
- 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
- *)
- $echo "$modename: REVISION \`$revision' must be a nonnegative integer" 1>&2
- $echo "$modename: \`$vinfo' is not valid version information" 1>&2
- exit $EXIT_FAILURE
- ;;
- esac
-
- case $age in
- 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
- *)
- $echo "$modename: AGE \`$age' must be a nonnegative integer" 1>&2
- $echo "$modename: \`$vinfo' is not valid version information" 1>&2
- exit $EXIT_FAILURE
- ;;
- esac
-
- if test "$age" -gt "$current"; then
- $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
- $echo "$modename: \`$vinfo' is not valid version information" 1>&2
- exit $EXIT_FAILURE
- fi
-
- # Calculate the version variables.
- major=
- versuffix=
- verstring=
- case $version_type in
- none) ;;
-
- darwin)
- # Like Linux, but with the current version available in
- # verstring for coding it into the library header
- major=.`expr $current - $age`
- versuffix="$major.$age.$revision"
- # Darwin ld doesn't like 0 for these options...
- minor_current=`expr $current + 1`
- verstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
- ;;
-
- freebsd-aout)
- major=".$current"
- versuffix=".$current.$revision";
- ;;
-
- freebsd-elf)
- major=".$current"
- versuffix=".$current";
- ;;
-
- irix | nonstopux)
- major=`expr $current - $age + 1`
-
- case $version_type in
- nonstopux) verstring_prefix=nonstopux ;;
- *) verstring_prefix=sgi ;;
- esac
- verstring="$verstring_prefix$major.$revision"
-
- # Add in all the interfaces that we are compatible with.
- loop=$revision
- while test "$loop" -ne 0; do
- iface=`expr $revision - $loop`
- loop=`expr $loop - 1`
- verstring="$verstring_prefix$major.$iface:$verstring"
- done
-
- # Before this point, $major must not contain `.'.
- major=.$major
- versuffix="$major.$revision"
- ;;
-
- linux)
- major=.`expr $current - $age`
- versuffix="$major.$age.$revision"
- ;;
-
- osf)
- major=.`expr $current - $age`
- versuffix=".$current.$age.$revision"
- verstring="$current.$age.$revision"
-
- # Add in all the interfaces that we are compatible with.
- loop=$age
- while test "$loop" -ne 0; do
- iface=`expr $current - $loop`
- loop=`expr $loop - 1`
- verstring="$verstring:${iface}.0"
- done
-
- # Make executables depend on our current version.
- verstring="$verstring:${current}.0"
- ;;
-
- sunos)
- major=".$current"
- versuffix=".$current.$revision"
- ;;
-
- windows)
- # Use '-' rather than '.', since we only want one
- # extension on DOS 8.3 filesystems.
- major=`expr $current - $age`
- versuffix="-$major"
- ;;
-
- *)
- $echo "$modename: unknown library version type \`$version_type'" 1>&2
- $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
- exit $EXIT_FAILURE
- ;;
- esac
-
- # Clear the version info if we defaulted, and they specified a release.
- if test -z "$vinfo" && test -n "$release"; then
- major=
- case $version_type in
- darwin)
- # we can't check for "0.0" in archive_cmds due to quoting
- # problems, so we reset it completely
- verstring=
- ;;
- *)
- verstring="0.0"
- ;;
- esac
- if test "$need_version" = no; then
- versuffix=
- else
- versuffix=".0.0"
- fi
- fi
-
- # Remove version info from name if versioning should be avoided
- if test "$avoid_version" = yes && test "$need_version" = no; then
- major=
- versuffix=
- verstring=""
- fi
-
- # Check to see if the archive will have undefined symbols.
- if test "$allow_undefined" = yes; then
- if test "$allow_undefined_flag" = unsupported; then
- $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
- build_libtool_libs=no
- build_old_libs=yes
- fi
- else
- # Don't allow undefined symbols.
- allow_undefined_flag="$no_undefined_flag"
- fi
- fi
-
- if test "$mode" != relink; then
- # Remove our outputs, but don't remove object files since they
- # may have been created when compiling PIC objects.
- removelist=
- tempremovelist=`$echo "$output_objdir/*"`
- for p in $tempremovelist; do
- case $p in
- *.$objext)
- ;;
- $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
- if test "X$precious_files_regex" != "X"; then
- if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
- then
- continue
- fi
- fi
- removelist="$removelist $p"
- ;;
- *) ;;
- esac
- done
- if test -n "$removelist"; then
- $show "${rm}r $removelist"
- $run ${rm}r $removelist
- fi
- fi
-
- # Now set the variables for building old libraries.
- if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
- oldlibs="$oldlibs $output_objdir/$libname.$libext"
-
- # Transform .lo files to .o files.
- oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
- fi
-
- # Eliminate all temporary directories.
- for path in $notinst_path; do
- lib_search_path=`$echo "$lib_search_path " | ${SED} -e "s% $path % %g"`
- deplibs=`$echo "$deplibs " | ${SED} -e "s% -L$path % %g"`
- dependency_libs=`$echo "$dependency_libs " | ${SED} -e "s% -L$path % %g"`
- done
-
- if test -n "$xrpath"; then
- # If the user specified any rpath flags, then add them.
- temp_xrpath=
- for libdir in $xrpath; do
- temp_xrpath="$temp_xrpath -R$libdir"
- case "$finalize_rpath " in
- *" $libdir "*) ;;
- *) finalize_rpath="$finalize_rpath $libdir" ;;
- esac
- done
- if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
- dependency_libs="$temp_xrpath $dependency_libs"
- fi
- fi
-
- # Make sure dlfiles contains only unique files that won't be dlpreopened
- old_dlfiles="$dlfiles"
- dlfiles=
- for lib in $old_dlfiles; do
- case " $dlprefiles $dlfiles " in
- *" $lib "*) ;;
- *) dlfiles="$dlfiles $lib" ;;
- esac
- done
-
- # Make sure dlprefiles contains only unique files
- old_dlprefiles="$dlprefiles"
- dlprefiles=
- for lib in $old_dlprefiles; do
- case "$dlprefiles " in
- *" $lib "*) ;;
- *) dlprefiles="$dlprefiles $lib" ;;
- esac
- done
-
- if test "$build_libtool_libs" = yes; then
- if test -n "$rpath"; then
- case $host in
- *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
- # these systems don't actually have a c library (as such)!
- ;;
- *-*-rhapsody* | *-*-darwin1.[012])
- # Rhapsody C library is in the System framework
- deplibs="$deplibs -framework System"
- ;;
- *-*-netbsd*)
- # Don't link with libc until the a.out ld.so is fixed.
- ;;
- *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
- # Do not include libc due to us having libc/libc_r.
- ;;
- *-*-sco3.2v5* | *-*-sco5v6*)
- # Causes problems with __ctype
- ;;
- *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
- # Compiler inserts libc in the correct place for threads to work
- ;;
- *)
- # Add libc to deplibs on all other systems if necessary.
- if test "$build_libtool_need_lc" = "yes"; then
- deplibs="$deplibs -lc"
- fi
- ;;
- esac
- fi
-
- # Transform deplibs into only deplibs that can be linked in shared.
- name_save=$name
- libname_save=$libname
- release_save=$release
- versuffix_save=$versuffix
- major_save=$major
- # I'm not sure if I'm treating the release correctly. I think
- # release should show up in the -l (ie -lgmp5) so we don't want to
- # add it in twice. Is that correct?
- release=""
- versuffix=""
- major=""
- newdeplibs=
- droppeddeps=no
- case $deplibs_check_method in
- pass_all)
- # Don't check for shared/static. Everything works.
- # This might be a little naive. We might want to check
- # whether the library exists or not. But this is on
- # osf3 & osf4 and I'm not really sure... Just
- # implementing what was already the behavior.
- newdeplibs=$deplibs
- ;;
- test_compile)
- # This code stresses the "libraries are programs" paradigm to its
- # limits. Maybe even breaks it. We compile a program, linking it
- # against the deplibs as a proxy for the library. Then we can check
- # whether they linked in statically or dynamically with ldd.
- $rm conftest.c
- cat > conftest.c <<EOF
- int main() { return 0; }
-EOF
- $rm conftest
- $LTCC $LTCFLAGS -o conftest conftest.c $deplibs
- if test "$?" -eq 0 ; then
- ldd_output=`ldd conftest`
- for i in $deplibs; do
- name=`expr $i : '-l\(.*\)'`
- # If $name is empty we are operating on a -L argument.
- if test "$name" != "" && test "$name" -ne "0"; then
- if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
- case " $predeps $postdeps " in
- *" $i "*)
- newdeplibs="$newdeplibs $i"
- i=""
- ;;
- esac
- fi
- if test -n "$i" ; then
- libname=`eval \\$echo \"$libname_spec\"`
- deplib_matches=`eval \\$echo \"$library_names_spec\"`
- set dummy $deplib_matches
- deplib_match=$2
- if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
- newdeplibs="$newdeplibs $i"
- else
- droppeddeps=yes
- $echo
- $echo "*** Warning: dynamic linker does not accept needed library $i."
- $echo "*** I have the capability to make that library automatically link in when"
- $echo "*** you link to this library. But I can only do this if you have a"
- $echo "*** shared version of the library, which I believe you do not have"
- $echo "*** because a test_compile did reveal that the linker did not use it for"
- $echo "*** its dynamic dependency list that programs get resolved with at runtime."
- fi
- fi
- else
- newdeplibs="$newdeplibs $i"
- fi
- done
- else
- # Error occurred in the first compile. Let's try to salvage
- # the situation: Compile a separate program for each library.
- for i in $deplibs; do
- name=`expr $i : '-l\(.*\)'`
- # If $name is empty we are operating on a -L argument.
- if test "$name" != "" && test "$name" != "0"; then
- $rm conftest
- $LTCC $LTCFLAGS -o conftest conftest.c $i
- # Did it work?
- if test "$?" -eq 0 ; then
- ldd_output=`ldd conftest`
- if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
- case " $predeps $postdeps " in
- *" $i "*)
- newdeplibs="$newdeplibs $i"
- i=""
- ;;
- esac
- fi
- if test -n "$i" ; then
- libname=`eval \\$echo \"$libname_spec\"`
- deplib_matches=`eval \\$echo \"$library_names_spec\"`
- set dummy $deplib_matches
- deplib_match=$2
- if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
- newdeplibs="$newdeplibs $i"
- else
- droppeddeps=yes
- $echo
- $echo "*** Warning: dynamic linker does not accept needed library $i."
- $echo "*** I have the capability to make that library automatically link in when"
- $echo "*** you link to this library. But I can only do this if you have a"
- $echo "*** shared version of the library, which you do not appear to have"
- $echo "*** because a test_compile did reveal that the linker did not use this one"
- $echo "*** as a dynamic dependency that programs can get resolved with at runtime."
- fi
- fi
- else
- droppeddeps=yes
- $echo
- $echo "*** Warning! Library $i is needed by this library but I was not able to"
- $echo "*** make it link in! You will probably need to install it or some"
- $echo "*** library that it depends on before this library will be fully"
- $echo "*** functional. Installing it before continuing would be even better."
- fi
- else
- newdeplibs="$newdeplibs $i"
- fi
- done
- fi
- ;;
- file_magic*)
- set dummy $deplibs_check_method
- file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
- for a_deplib in $deplibs; do
- name=`expr $a_deplib : '-l\(.*\)'`
- # If $name is empty we are operating on a -L argument.
- if test "$name" != "" && test "$name" != "0"; then
- if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
- case " $predeps $postdeps " in
- *" $a_deplib "*)
- newdeplibs="$newdeplibs $a_deplib"
- a_deplib=""
- ;;
- esac
- fi
- if test -n "$a_deplib" ; then
- libname=`eval \\$echo \"$libname_spec\"`
- for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
- potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
- for potent_lib in $potential_libs; do
- # Follow soft links.
- if ls -lLd "$potent_lib" 2>/dev/null \
- | grep " -> " >/dev/null; then
- continue
- fi
- # The statement above tries to avoid entering an
- # endless loop below, in case of cyclic links.
- # We might still enter an endless loop, since a link
- # loop can be closed while we follow links,
- # but so what?
- potlib="$potent_lib"
- while test -h "$potlib" 2>/dev/null; do
- potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
- case $potliblink in
- [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
- *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
- esac
- done
- if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
- | ${SED} 10q \
- | $EGREP "$file_magic_regex" > /dev/null; then
- newdeplibs="$newdeplibs $a_deplib"
- a_deplib=""
- break 2
- fi
- done
- done
- fi
- if test -n "$a_deplib" ; then
- droppeddeps=yes
- $echo
- $echo "*** Warning: linker path does not have real file for library $a_deplib."
- $echo "*** I have the capability to make that library automatically link in when"
- $echo "*** you link to this library. But I can only do this if you have a"
- $echo "*** shared version of the library, which you do not appear to have"
- $echo "*** because I did check the linker path looking for a file starting"
- if test -z "$potlib" ; then
- $echo "*** with $libname but no candidates were found. (...for file magic test)"
- else
- $echo "*** with $libname and none of the candidates passed a file format test"
- $echo "*** using a file magic. Last file checked: $potlib"
- fi
- fi
- else
- # Add a -L argument.
- newdeplibs="$newdeplibs $a_deplib"
- fi
- done # Gone through all deplibs.
- ;;
- match_pattern*)
- set dummy $deplibs_check_method
- match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
- for a_deplib in $deplibs; do
- name=`expr $a_deplib : '-l\(.*\)'`
- # If $name is empty we are operating on a -L argument.
- if test -n "$name" && test "$name" != "0"; then
- if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
- case " $predeps $postdeps " in
- *" $a_deplib "*)
- newdeplibs="$newdeplibs $a_deplib"
- a_deplib=""
- ;;
- esac
- fi
- if test -n "$a_deplib" ; then
- libname=`eval \\$echo \"$libname_spec\"`
- for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
- potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
- for potent_lib in $potential_libs; do
- potlib="$potent_lib" # see symlink-check above in file_magic test
- if eval $echo \"$potent_lib\" 2>/dev/null \
- | ${SED} 10q \
- | $EGREP "$match_pattern_regex" > /dev/null; then
- newdeplibs="$newdeplibs $a_deplib"
- a_deplib=""
- break 2
- fi
- done
- done
- fi
- if test -n "$a_deplib" ; then
- droppeddeps=yes
- $echo
- $echo "*** Warning: linker path does not have real file for library $a_deplib."
- $echo "*** I have the capability to make that library automatically link in when"
- $echo "*** you link to this library. But I can only do this if you have a"
- $echo "*** shared version of the library, which you do not appear to have"
- $echo "*** because I did check the linker path looking for a file starting"
- if test -z "$potlib" ; then
- $echo "*** with $libname but no candidates were found. (...for regex pattern test)"
- else
- $echo "*** with $libname and none of the candidates passed a file format test"
- $echo "*** using a regex pattern. Last file checked: $potlib"
- fi
- fi
- else
- # Add a -L argument.
- newdeplibs="$newdeplibs $a_deplib"
- fi
- done # Gone through all deplibs.
- ;;
- none | unknown | *)
- newdeplibs=""
- tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
- -e 's/ -[LR][^ ]*//g'`
- if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
- for i in $predeps $postdeps ; do
- # can't use Xsed below, because $i might contain '/'
- tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"`
- done
- fi
- if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \
- | grep . >/dev/null; then
- $echo
- if test "X$deplibs_check_method" = "Xnone"; then
- $echo "*** Warning: inter-library dependencies are not supported in this platform."
- else
- $echo "*** Warning: inter-library dependencies are not known to be supported."
- fi
- $echo "*** All declared inter-library dependencies are being dropped."
- droppeddeps=yes
- fi
- ;;
- esac
- versuffix=$versuffix_save
- major=$major_save
- release=$release_save
- libname=$libname_save
- name=$name_save
-
- case $host in
- *-*-rhapsody* | *-*-darwin1.[012])
- # On Rhapsody replace the C library is the System framework
- newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
- ;;
- esac
-
- if test "$droppeddeps" = yes; then
- if test "$module" = yes; then
- $echo
- $echo "*** Warning: libtool could not satisfy all declared inter-library"
- $echo "*** dependencies of module $libname. Therefore, libtool will create"
- $echo "*** a static module, that should work as long as the dlopening"
- $echo "*** application is linked with the -dlopen flag."
- if test -z "$global_symbol_pipe"; then
- $echo
- $echo "*** However, this would only work if libtool was able to extract symbol"
- $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
- $echo "*** not find such a program. So, this module is probably useless."
- $echo "*** \`nm' from GNU binutils and a full rebuild may help."
- fi
- if test "$build_old_libs" = no; then
- oldlibs="$output_objdir/$libname.$libext"
- build_libtool_libs=module
- build_old_libs=yes
- else
- build_libtool_libs=no
- fi
- else
- $echo "*** The inter-library dependencies that have been dropped here will be"
- $echo "*** automatically added whenever a program is linked with this library"
- $echo "*** or is declared to -dlopen it."
-
- if test "$allow_undefined" = no; then
- $echo
- $echo "*** Since this library must not contain undefined symbols,"
- $echo "*** because either the platform does not support them or"
- $echo "*** it was explicitly requested with -no-undefined,"
- $echo "*** libtool will only create a static version of it."
- if test "$build_old_libs" = no; then
- oldlibs="$output_objdir/$libname.$libext"
- build_libtool_libs=module
- build_old_libs=yes
- else
- build_libtool_libs=no
- fi
- fi
- fi
- fi
- # Done checking deplibs!
- deplibs=$newdeplibs
- fi
-
-
- # move library search paths that coincide with paths to not yet
- # installed libraries to the beginning of the library search list
- new_libs=
- for path in $notinst_path; do
- case " $new_libs " in
- *" -L$path/$objdir "*) ;;
- *)
- case " $deplibs " in
- *" -L$path/$objdir "*)
- new_libs="$new_libs -L$path/$objdir" ;;
- esac
- ;;
- esac
- done
- for deplib in $deplibs; do
- case $deplib in
- -L*)
- case " $new_libs " in
- *" $deplib "*) ;;
- *) new_libs="$new_libs $deplib" ;;
- esac
- ;;
- *) new_libs="$new_libs $deplib" ;;
- esac
- done
- deplibs="$new_libs"
-
-
- # All the library-specific variables (install_libdir is set above).
- library_names=
- old_library=
- dlname=
-
- # Test again, we may have decided not to build it any more
- if test "$build_libtool_libs" = yes; then
- if test "$hardcode_into_libs" = yes; then
- # Hardcode the library paths
- hardcode_libdirs=
- dep_rpath=
- rpath="$finalize_rpath"
- test "$mode" != relink && rpath="$compile_rpath$rpath"
- for libdir in $rpath; do
- if test -n "$hardcode_libdir_flag_spec"; then
- if test -n "$hardcode_libdir_separator"; then
- if test -z "$hardcode_libdirs"; then
- hardcode_libdirs="$libdir"
- else
- # Just accumulate the unique libdirs.
- case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
- *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
- ;;
- *)
- hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
- ;;
- esac
- fi
- else
- eval flag=\"$hardcode_libdir_flag_spec\"
- dep_rpath="$dep_rpath $flag"
- fi
- elif test -n "$runpath_var"; then
- case "$perm_rpath " in
- *" $libdir "*) ;;
- *) perm_rpath="$perm_rpath $libdir" ;;
- esac
- fi
- done
- # Substitute the hardcoded libdirs into the rpath.
- if test -n "$hardcode_libdir_separator" &&
- test -n "$hardcode_libdirs"; then
- libdir="$hardcode_libdirs"
- if test -n "$hardcode_libdir_flag_spec_ld"; then
- eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
- else
- eval dep_rpath=\"$hardcode_libdir_flag_spec\"
- fi
- fi
- if test -n "$runpath_var" && test -n "$perm_rpath"; then
- # We should set the runpath_var.
- rpath=
- for dir in $perm_rpath; do
- rpath="$rpath$dir:"
- done
- eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
- fi
- test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
- fi
-
- shlibpath="$finalize_shlibpath"
- test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
- if test -n "$shlibpath"; then
- eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
- fi
-
- # Get the real and link names of the library.
- eval shared_ext=\"$shrext_cmds\"
- eval library_names=\"$library_names_spec\"
- set dummy $library_names
- realname="$2"
- shift; shift
-
- if test -n "$soname_spec"; then
- eval soname=\"$soname_spec\"
- else
- soname="$realname"
- fi
- if test -z "$dlname"; then
- dlname=$soname
- fi
-
- lib="$output_objdir/$realname"
- linknames=
- for link
- do
- linknames="$linknames $link"
- done
-
- # Use standard objects if they are pic
- test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
-
- # Prepare the list of exported symbols
- if test -z "$export_symbols"; then
- if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
- $show "generating symbol list for \`$libname.la'"
- export_symbols="$output_objdir/$libname.exp"
- $run $rm $export_symbols
- cmds=$export_symbols_cmds
- save_ifs="$IFS"; IFS='~'
- for cmd in $cmds; do
- IFS="$save_ifs"
- eval cmd=\"$cmd\"
- if len=`expr "X$cmd" : ".*"` &&
- test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
- $show "$cmd"
- $run eval "$cmd" || exit $?
- skipped_export=false
- else
- # The command line is too long to execute in one step.
- $show "using reloadable object file for export list..."
- skipped_export=:
- # Break out early, otherwise skipped_export may be
- # set to false by a later but shorter cmd.
- break
- fi
- done
- IFS="$save_ifs"
- if test -n "$export_symbols_regex"; then
- $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
- $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
- $show "$mv \"${export_symbols}T\" \"$export_symbols\""
- $run eval '$mv "${export_symbols}T" "$export_symbols"'
- fi
- fi
- fi
-
- if test -n "$export_symbols" && test -n "$include_expsyms"; then
- $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
- fi
-
- tmp_deplibs=
- for test_deplib in $deplibs; do
- case " $convenience " in
- *" $test_deplib "*) ;;
- *)
- tmp_deplibs="$tmp_deplibs $test_deplib"
- ;;
- esac
- done
- deplibs="$tmp_deplibs"
-
- if test -n "$convenience"; then
- if test -n "$whole_archive_flag_spec"; then
- save_libobjs=$libobjs
- eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
- else
- gentop="$output_objdir/${outputname}x"
- generated="$generated $gentop"
-
- func_extract_archives $gentop $convenience
- libobjs="$libobjs $func_extract_archives_result"
- fi
- fi
-
- if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
- eval flag=\"$thread_safe_flag_spec\"
- linker_flags="$linker_flags $flag"
- fi
-
- # Make a backup of the uninstalled library when relinking
- if test "$mode" = relink; then
- $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $?
- fi
-
- # Do each of the archive commands.
- if test "$module" = yes && test -n "$module_cmds" ; then
- if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
- eval test_cmds=\"$module_expsym_cmds\"
- cmds=$module_expsym_cmds
- else
- eval test_cmds=\"$module_cmds\"
- cmds=$module_cmds
- fi
- else
- if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
- eval test_cmds=\"$archive_expsym_cmds\"
- cmds=$archive_expsym_cmds
- else
- eval test_cmds=\"$archive_cmds\"
- cmds=$archive_cmds
- fi
- fi
-
- if test "X$skipped_export" != "X:" &&
- len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
- test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
- :
- else
- # The command line is too long to link in one step, link piecewise.
- $echo "creating reloadable object files..."
-
- # Save the value of $output and $libobjs because we want to
- # use them later. If we have whole_archive_flag_spec, we
- # want to use save_libobjs as it was before
- # whole_archive_flag_spec was expanded, because we can't
- # assume the linker understands whole_archive_flag_spec.
- # This may have to be revisited, in case too many
- # convenience libraries get linked in and end up exceeding
- # the spec.
- if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
- save_libobjs=$libobjs
- fi
- save_output=$output
- output_la=`$echo "X$output" | $Xsed -e "$basename"`
-
- # Clear the reloadable object creation command queue and
- # initialize k to one.
- test_cmds=
- concat_cmds=
- objlist=
- delfiles=
- last_robj=
- k=1
- output=$output_objdir/$output_la-${k}.$objext
- # Loop over the list of objects to be linked.
- for obj in $save_libobjs
- do
- eval test_cmds=\"$reload_cmds $objlist $last_robj\"
- if test "X$objlist" = X ||
- { len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
- test "$len" -le "$max_cmd_len"; }; then
- objlist="$objlist $obj"
- else
- # The command $test_cmds is almost too long, add a
- # command to the queue.
- if test "$k" -eq 1 ; then
- # The first file doesn't have a previous command to add.
- eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
- else
- # All subsequent reloadable object files will link in
- # the last one created.
- eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\"
- fi
- last_robj=$output_objdir/$output_la-${k}.$objext
- k=`expr $k + 1`
- output=$output_objdir/$output_la-${k}.$objext
- objlist=$obj
- len=1
- fi
- done
- # Handle the remaining objects by creating one last
- # reloadable object file. All subsequent reloadable object
- # files will link in the last one created.
- test -z "$concat_cmds" || concat_cmds=$concat_cmds~
- eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
-
- if ${skipped_export-false}; then
- $show "generating symbol list for \`$libname.la'"
- export_symbols="$output_objdir/$libname.exp"
- $run $rm $export_symbols
- libobjs=$output
- # Append the command to create the export file.
- eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\"
- fi
-
- # Set up a command to remove the reloadable object files
- # after they are used.
- i=0
- while test "$i" -lt "$k"
- do
- i=`expr $i + 1`
- delfiles="$delfiles $output_objdir/$output_la-${i}.$objext"
- done
-
- $echo "creating a temporary reloadable object file: $output"
-
- # Loop through the commands generated above and execute them.
- save_ifs="$IFS"; IFS='~'
- for cmd in $concat_cmds; do
- IFS="$save_ifs"
- $show "$cmd"
- $run eval "$cmd" || exit $?
- done
- IFS="$save_ifs"
-
- libobjs=$output
- # Restore the value of output.
- output=$save_output
-
- if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
- eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
- fi
- # Expand the library linking commands again to reset the
- # value of $libobjs for piecewise linking.
-
- # Do each of the archive commands.
- if test "$module" = yes && test -n "$module_cmds" ; then
- if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
- cmds=$module_expsym_cmds
- else
- cmds=$module_cmds
- fi
- else
- if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
- cmds=$archive_expsym_cmds
- else
- cmds=$archive_cmds
- fi
- fi
-
- # Append the command to remove the reloadable object files
- # to the just-reset $cmds.
- eval cmds=\"\$cmds~\$rm $delfiles\"
- fi
- save_ifs="$IFS"; IFS='~'
- for cmd in $cmds; do
- IFS="$save_ifs"
- eval cmd=\"$cmd\"
- $show "$cmd"
- $run eval "$cmd" || {
- lt_exit=$?
-
- # Restore the uninstalled library and exit
- if test "$mode" = relink; then
- $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)'
- fi
-
- exit $lt_exit
- }
- done
- IFS="$save_ifs"
-
- # Restore the uninstalled library and exit
- if test "$mode" = relink; then
- $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
-
- if test -n "$convenience"; then
- if test -z "$whole_archive_flag_spec"; then
- $show "${rm}r $gentop"
- $run ${rm}r "$gentop"
- fi
- fi
-
- exit $EXIT_SUCCESS
- fi
-
- # Create links to the real library.
- for linkname in $linknames; do
- if test "$realname" != "$linkname"; then
- $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
- $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
- fi
- done
-
- # If -module or -export-dynamic was specified, set the dlname.
- if test "$module" = yes || test "$export_dynamic" = yes; then
- # On all known operating systems, these are identical.
- dlname="$soname"
- fi
- fi
- ;;
-
- obj)
- if test -n "$deplibs"; then
- $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
- fi
-
- if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
- $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
- fi
-
- if test -n "$rpath"; then
- $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
- fi
-
- if test -n "$xrpath"; then
- $echo "$modename: warning: \`-R' is ignored for objects" 1>&2
- fi
-
- if test -n "$vinfo"; then
- $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
- fi
-
- if test -n "$release"; then
- $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
- fi
-
- case $output in
- *.lo)
- if test -n "$objs$old_deplibs"; then
- $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
- exit $EXIT_FAILURE
- fi
- libobj="$output"
- obj=`$echo "X$output" | $Xsed -e "$lo2o"`
- ;;
- *)
- libobj=
- obj="$output"
- ;;
- esac
-
- # Delete the old objects.
- $run $rm $obj $libobj
-
- # Objects from convenience libraries. This assumes
- # single-version convenience libraries. Whenever we create
- # different ones for PIC/non-PIC, this we'll have to duplicate
- # the extraction.
- reload_conv_objs=
- gentop=
- # reload_cmds runs $LD directly, so let us get rid of
- # -Wl from whole_archive_flag_spec
- wl=
-
- if test -n "$convenience"; then
- if test -n "$whole_archive_flag_spec"; then
- eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
- else
- gentop="$output_objdir/${obj}x"
- generated="$generated $gentop"
-
- func_extract_archives $gentop $convenience
- reload_conv_objs="$reload_objs $func_extract_archives_result"
- fi
- fi
-
- # Create the old-style object.
- reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
-
- output="$obj"
- cmds=$reload_cmds
- save_ifs="$IFS"; IFS='~'
- for cmd in $cmds; do
- IFS="$save_ifs"
- eval cmd=\"$cmd\"
- $show "$cmd"
- $run eval "$cmd" || exit $?
- done
- IFS="$save_ifs"
-
- # Exit if we aren't doing a library object file.
- if test -z "$libobj"; then
- if test -n "$gentop"; then
- $show "${rm}r $gentop"
- $run ${rm}r $gentop
- fi
-
- exit $EXIT_SUCCESS
- fi
-
- if test "$build_libtool_libs" != yes; then
- if test -n "$gentop"; then
- $show "${rm}r $gentop"
- $run ${rm}r $gentop
- fi
-
- # Create an invalid libtool object if no PIC, so that we don't
- # accidentally link it into a program.
- # $show "echo timestamp > $libobj"
- # $run eval "echo timestamp > $libobj" || exit $?
- exit $EXIT_SUCCESS
- fi
-
- if test -n "$pic_flag" || test "$pic_mode" != default; then
- # Only do commands if we really have different PIC objects.
- reload_objs="$libobjs $reload_conv_objs"
- output="$libobj"
- cmds=$reload_cmds
- save_ifs="$IFS"; IFS='~'
- for cmd in $cmds; do
- IFS="$save_ifs"
- eval cmd=\"$cmd\"
- $show "$cmd"
- $run eval "$cmd" || exit $?
- done
- IFS="$save_ifs"
- fi
-
- if test -n "$gentop"; then
- $show "${rm}r $gentop"
- $run ${rm}r $gentop
- fi
-
- exit $EXIT_SUCCESS
- ;;
-
- prog)
- case $host in
- *cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;
- esac
- if test -n "$vinfo"; then
- $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
- fi
-
- if test -n "$release"; then
- $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
- fi
-
- if test "$preload" = yes; then
- if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown &&
- test "$dlopen_self_static" = unknown; then
- $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
- fi
- fi
-
- case $host in
- *-*-rhapsody* | *-*-darwin1.[012])
- # On Rhapsody replace the C library is the System framework
- compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
- finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
- ;;
- esac
-
- case $host in
- *darwin*)
- # Don't allow lazy linking, it breaks C++ global constructors
- if test "$tagname" = CXX ; then
- compile_command="$compile_command ${wl}-bind_at_load"
- finalize_command="$finalize_command ${wl}-bind_at_load"
- fi
- ;;
- esac
-
-
- # move library search paths that coincide with paths to not yet
- # installed libraries to the beginning of the library search list
- new_libs=
- for path in $notinst_path; do
- case " $new_libs " in
- *" -L$path/$objdir "*) ;;
- *)
- case " $compile_deplibs " in
- *" -L$path/$objdir "*)
- new_libs="$new_libs -L$path/$objdir" ;;
- esac
- ;;
- esac
- done
- for deplib in $compile_deplibs; do
- case $deplib in
- -L*)
- case " $new_libs " in
- *" $deplib "*) ;;
- *) new_libs="$new_libs $deplib" ;;
- esac
- ;;
- *) new_libs="$new_libs $deplib" ;;
- esac
- done
- compile_deplibs="$new_libs"
-
-
- compile_command="$compile_command $compile_deplibs"
- finalize_command="$finalize_command $finalize_deplibs"
-
- if test -n "$rpath$xrpath"; then
- # If the user specified any rpath flags, then add them.
- for libdir in $rpath $xrpath; do
- # This is the magic to use -rpath.
- case "$finalize_rpath " in
- *" $libdir "*) ;;
- *) finalize_rpath="$finalize_rpath $libdir" ;;
- esac
- done
- fi
-
- # Now hardcode the library paths
- rpath=
- hardcode_libdirs=
- for libdir in $compile_rpath $finalize_rpath; do
- if test -n "$hardcode_libdir_flag_spec"; then
- if test -n "$hardcode_libdir_separator"; then
- if test -z "$hardcode_libdirs"; then
- hardcode_libdirs="$libdir"
- else
- # Just accumulate the unique libdirs.
- case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
- *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
- ;;
- *)
- hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
- ;;
- esac
- fi
- else
- eval flag=\"$hardcode_libdir_flag_spec\"
- rpath="$rpath $flag"
- fi
- elif test -n "$runpath_var"; then
- case "$perm_rpath " in
- *" $libdir "*) ;;
- *) perm_rpath="$perm_rpath $libdir" ;;
- esac
- fi
- case $host in
- *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
- testbindir=`$echo "X$libdir" | $Xsed -e 's*/lib$*/bin*'`
- case :$dllsearchpath: in
- *":$libdir:"*) ;;
- *) dllsearchpath="$dllsearchpath:$libdir";;
- esac
- case :$dllsearchpath: in
- *":$testbindir:"*) ;;
- *) dllsearchpath="$dllsearchpath:$testbindir";;
- esac
- ;;
- esac
- done
- # Substitute the hardcoded libdirs into the rpath.
- if test -n "$hardcode_libdir_separator" &&
- test -n "$hardcode_libdirs"; then
- libdir="$hardcode_libdirs"
- eval rpath=\" $hardcode_libdir_flag_spec\"
- fi
- compile_rpath="$rpath"
-
- rpath=
- hardcode_libdirs=
- for libdir in $finalize_rpath; do
- if test -n "$hardcode_libdir_flag_spec"; then
- if test -n "$hardcode_libdir_separator"; then
- if test -z "$hardcode_libdirs"; then
- hardcode_libdirs="$libdir"
- else
- # Just accumulate the unique libdirs.
- case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
- *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
- ;;
- *)
- hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
- ;;
- esac
- fi
- else
- eval flag=\"$hardcode_libdir_flag_spec\"
- rpath="$rpath $flag"
- fi
- elif test -n "$runpath_var"; then
- case "$finalize_perm_rpath " in
- *" $libdir "*) ;;
- *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
- esac
- fi
- done
- # Substitute the hardcoded libdirs into the rpath.
- if test -n "$hardcode_libdir_separator" &&
- test -n "$hardcode_libdirs"; then
- libdir="$hardcode_libdirs"
- eval rpath=\" $hardcode_libdir_flag_spec\"
- fi
- finalize_rpath="$rpath"
-
- if test -n "$libobjs" && test "$build_old_libs" = yes; then
- # Transform all the library objects into standard objects.
- compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
- finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
- fi
-
- dlsyms=
- if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
- if test -n "$NM" && test -n "$global_symbol_pipe"; then
- dlsyms="${outputname}S.c"
- else
- $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
- fi
- fi
-
- if test -n "$dlsyms"; then
- case $dlsyms in
- "") ;;
- *.c)
- # Discover the nlist of each of the dlfiles.
- nlist="$output_objdir/${outputname}.nm"
-
- $show "$rm $nlist ${nlist}S ${nlist}T"
- $run $rm "$nlist" "${nlist}S" "${nlist}T"
-
- # Parse the name list into a source file.
- $show "creating $output_objdir/$dlsyms"
-
- test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
-/* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
-/* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
-
-#ifdef __cplusplus
-extern \"C\" {
-#endif
-
-/* Prevent the only kind of declaration conflicts we can make. */
-#define lt_preloaded_symbols some_other_symbol
-
-/* External symbol declarations for the compiler. */\
-"
-
- if test "$dlself" = yes; then
- $show "generating symbol list for \`$output'"
-
- test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
-
- # Add our own program objects to the symbol list.
- progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
- for arg in $progfiles; do
- $show "extracting global C symbols from \`$arg'"
- $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
- done
-
- if test -n "$exclude_expsyms"; then
- $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
- $run eval '$mv "$nlist"T "$nlist"'
- fi
-
- if test -n "$export_symbols_regex"; then
- $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
- $run eval '$mv "$nlist"T "$nlist"'
- fi
-
- # Prepare the list of exported symbols
- if test -z "$export_symbols"; then
- export_symbols="$output_objdir/$outputname.exp"
- $run $rm $export_symbols
- $run eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
- case $host in
- *cygwin* | *mingw* )
- $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
- $run eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
- ;;
- esac
- else
- $run eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
- $run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
- $run eval 'mv "$nlist"T "$nlist"'
- case $host in
- *cygwin* | *mingw* )
- $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
- $run eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
- ;;
- esac
- fi
- fi
-
- for arg in $dlprefiles; do
- $show "extracting global C symbols from \`$arg'"
- name=`$echo "$arg" | ${SED} -e 's%^.*/%%'`
- $run eval '$echo ": $name " >> "$nlist"'
- $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
- done
-
- if test -z "$run"; then
- # Make sure we have at least an empty file.
- test -f "$nlist" || : > "$nlist"
-
- if test -n "$exclude_expsyms"; then
- $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
- $mv "$nlist"T "$nlist"
- fi
-
- # Try sorting and uniquifying the output.
- if grep -v "^: " < "$nlist" |
- if sort -k 3 </dev/null >/dev/null 2>&1; then
- sort -k 3
- else
- sort +2
- fi |
- uniq > "$nlist"S; then
- :
- else
- grep -v "^: " < "$nlist" > "$nlist"S
- fi
-
- if test -f "$nlist"S; then
- eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
- else
- $echo '/* NONE */' >> "$output_objdir/$dlsyms"
- fi
-
- $echo >> "$output_objdir/$dlsyms" "\
-
-#undef lt_preloaded_symbols
-
-#if defined (__STDC__) && __STDC__
-# define lt_ptr void *
-#else
-# define lt_ptr char *
-# define const
-#endif
-
-/* The mapping between symbol names and symbols. */
-"
-
- case $host in
- *cygwin* | *mingw* )
- $echo >> "$output_objdir/$dlsyms" "\
-/* DATA imports from DLLs on WIN32 can't be const, because
- runtime relocations are performed -- see ld's documentation
- on pseudo-relocs */
-struct {
-"
- ;;
- * )
- $echo >> "$output_objdir/$dlsyms" "\
-const struct {
-"
- ;;
- esac
-
-
- $echo >> "$output_objdir/$dlsyms" "\
- const char *name;
- lt_ptr address;
-}
-lt_preloaded_symbols[] =
-{\
-"
-
- eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms"
-
- $echo >> "$output_objdir/$dlsyms" "\
- {0, (lt_ptr) 0}
-};
-
-/* This works around a problem in FreeBSD linker */
-#ifdef FREEBSD_WORKAROUND
-static const void *lt_preloaded_setup() {
- return lt_preloaded_symbols;
-}
-#endif
-
-#ifdef __cplusplus
-}
-#endif\
-"
- fi
-
- pic_flag_for_symtable=
- case $host in
- # compiling the symbol table file with pic_flag works around
- # a FreeBSD bug that causes programs to crash when -lm is
- # linked before any other PIC object. But we must not use
- # pic_flag when linking with -static. The problem exists in
- # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
- *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
- case "$compile_command " in
- *" -static "*) ;;
- *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";;
- esac;;
- *-*-hpux*)
- case "$compile_command " in
- *" -static "*) ;;
- *) pic_flag_for_symtable=" $pic_flag";;
- esac
- esac
-
- # Now compile the dynamic symbol file.
- $show "(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
- $run eval '(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
-
- # Clean up the generated files.
- $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
- $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
-
- # Transform the symbol file into the correct name.
- case $host in
- *cygwin* | *mingw* )
- if test -f "$output_objdir/${outputname}.def" ; then
- compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%"`
- finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%"`
- else
- compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
- finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
- fi
- ;;
- * )
- compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
- finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
- ;;
- esac
- ;;
- *)
- $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
- exit $EXIT_FAILURE
- ;;
- esac
- else
- # We keep going just in case the user didn't refer to
- # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
- # really was required.
-
- # Nullify the symbol file.
- compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
- finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
- fi
-
- if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
- # Replace the output file specification.
- compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
- link_command="$compile_command$compile_rpath"
-
- # We have no uninstalled library dependencies, so finalize right now.
- $show "$link_command"
- $run eval "$link_command"
- exit_status=$?
-
- # Delete the generated files.
- if test -n "$dlsyms"; then
- $show "$rm $output_objdir/${outputname}S.${objext}"
- $run $rm "$output_objdir/${outputname}S.${objext}"
- fi
-
- exit $exit_status
- fi
-
- if test -n "$shlibpath_var"; then
- # We should set the shlibpath_var
- rpath=
- for dir in $temp_rpath; do
- case $dir in
- [\\/]* | [A-Za-z]:[\\/]*)
- # Absolute path.
- rpath="$rpath$dir:"
- ;;
- *)
- # Relative path: add a thisdir entry.
- rpath="$rpath\$thisdir/$dir:"
- ;;
- esac
- done
- temp_rpath="$rpath"
- fi
-
- if test -n "$compile_shlibpath$finalize_shlibpath"; then
- compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
- fi
- if test -n "$finalize_shlibpath"; then
- finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
- fi
-
- compile_var=
- finalize_var=
- if test -n "$runpath_var"; then
- if test -n "$perm_rpath"; then
- # We should set the runpath_var.
- rpath=
- for dir in $perm_rpath; do
- rpath="$rpath$dir:"
- done
- compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
- fi
- if test -n "$finalize_perm_rpath"; then
- # We should set the runpath_var.
- rpath=
- for dir in $finalize_perm_rpath; do
- rpath="$rpath$dir:"
- done
- finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
- fi
- fi
-
- if test "$no_install" = yes; then
- # We don't need to create a wrapper script.
- link_command="$compile_var$compile_command$compile_rpath"
- # Replace the output file specification.
- link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
- # Delete the old output file.
- $run $rm $output
- # Link the executable and exit
- $show "$link_command"
- $run eval "$link_command" || exit $?
- exit $EXIT_SUCCESS
- fi
-
- if test "$hardcode_action" = relink; then
- # Fast installation is not supported
- link_command="$compile_var$compile_command$compile_rpath"
- relink_command="$finalize_var$finalize_command$finalize_rpath"
-
- $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
- $echo "$modename: \`$output' will be relinked during installation" 1>&2
- else
- if test "$fast_install" != no; then
- link_command="$finalize_var$compile_command$finalize_rpath"
- if test "$fast_install" = yes; then
- relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
- else
- # fast_install is set to needless
- relink_command=
- fi
- else
- link_command="$compile_var$compile_command$compile_rpath"
- relink_command="$finalize_var$finalize_command$finalize_rpath"
- fi
- fi
-
- # Replace the output file specification.
- link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
-
- # Delete the old output files.
- $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
-
- $show "$link_command"
- $run eval "$link_command" || exit $?
-
- # Now create the wrapper script.
- $show "creating $output"
-
- # Quote the relink command for shipping.
- if test -n "$relink_command"; then
- # Preserve any variables that may affect compiler behavior
- for var in $variables_saved_for_relink; do
- if eval test -z \"\${$var+set}\"; then
- relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
- elif eval var_value=\$$var; test -z "$var_value"; then
- relink_command="$var=; export $var; $relink_command"
- else
- var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
- relink_command="$var=\"$var_value\"; export $var; $relink_command"
- fi
- done
- relink_command="(cd `pwd`; $relink_command)"
- relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
- fi
-
- # Quote $echo for shipping.
- if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then
- case $progpath in
- [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";;
- *) qecho="$SHELL `pwd`/$progpath --fallback-echo";;
- esac
- qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
- else
- qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
- fi
-
- # Only actually do things if our run command is non-null.
- if test -z "$run"; then
- # win32 will think the script is a binary if it has
- # a .exe suffix, so we strip it off here.
- case $output in
- *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;;
- esac
- # test for cygwin because mv fails w/o .exe extensions
- case $host in
- *cygwin*)
- exeext=.exe
- outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;;
- *) exeext= ;;
- esac
- case $host in
- *cygwin* | *mingw* )
- output_name=`basename $output`
- output_path=`dirname $output`
- cwrappersource="$output_path/$objdir/lt-$output_name.c"
- cwrapper="$output_path/$output_name.exe"
- $rm $cwrappersource $cwrapper
- trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
-
- cat > $cwrappersource <<EOF
-
-/* $cwrappersource - temporary wrapper executable for $objdir/$outputname
- Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
-
- The $output program cannot be directly executed until all the libtool
- libraries that it depends on are installed.
-
- This wrapper executable should never be moved out of the build directory.
- If it is, it will not operate correctly.
-
- Currently, it simply execs the wrapper *script* "/bin/sh $output",
- but could eventually absorb all of the scripts functionality and
- exec $objdir/$outputname directly.
-*/
-EOF
- cat >> $cwrappersource<<"EOF"
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <malloc.h>
-#include <stdarg.h>
-#include <assert.h>
-#include <string.h>
-#include <ctype.h>
-#include <sys/stat.h>
-
-#if defined(PATH_MAX)
-# define LT_PATHMAX PATH_MAX
-#elif defined(MAXPATHLEN)
-# define LT_PATHMAX MAXPATHLEN
-#else
-# define LT_PATHMAX 1024
-#endif
-
-#ifndef DIR_SEPARATOR
-# define DIR_SEPARATOR '/'
-# define PATH_SEPARATOR ':'
-#endif
-
-#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
- defined (__OS2__)
-# define HAVE_DOS_BASED_FILE_SYSTEM
-# ifndef DIR_SEPARATOR_2
-# define DIR_SEPARATOR_2 '\\'
-# endif
-# ifndef PATH_SEPARATOR_2
-# define PATH_SEPARATOR_2 ';'
-# endif
-#endif
-
-#ifndef DIR_SEPARATOR_2
-# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
-#else /* DIR_SEPARATOR_2 */
-# define IS_DIR_SEPARATOR(ch) \
- (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
-#endif /* DIR_SEPARATOR_2 */
-
-#ifndef PATH_SEPARATOR_2
-# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
-#else /* PATH_SEPARATOR_2 */
-# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
-#endif /* PATH_SEPARATOR_2 */
-
-#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
-#define XFREE(stale) do { \
- if (stale) { free ((void *) stale); stale = 0; } \
-} while (0)
-
-/* -DDEBUG is fairly common in CFLAGS. */
-#undef DEBUG
-#if defined DEBUGWRAPPER
-# define DEBUG(format, ...) fprintf(stderr, format, __VA_ARGS__)
-#else
-# define DEBUG(format, ...)
-#endif
-
-const char *program_name = NULL;
-
-void * xmalloc (size_t num);
-char * xstrdup (const char *string);
-const char * base_name (const char *name);
-char * find_executable(const char *wrapper);
-int check_executable(const char *path);
-char * strendzap(char *str, const char *pat);
-void lt_fatal (const char *message, ...);
-
-int
-main (int argc, char *argv[])
-{
- char **newargz;
- int i;
-
- program_name = (char *) xstrdup (base_name (argv[0]));
- DEBUG("(main) argv[0] : %s\n",argv[0]);
- DEBUG("(main) program_name : %s\n",program_name);
- newargz = XMALLOC(char *, argc+2);
-EOF
-
- cat >> $cwrappersource <<EOF
- newargz[0] = (char *) xstrdup("$SHELL");
-EOF
-
- cat >> $cwrappersource <<"EOF"
- newargz[1] = find_executable(argv[0]);
- if (newargz[1] == NULL)
- lt_fatal("Couldn't find %s", argv[0]);
- DEBUG("(main) found exe at : %s\n",newargz[1]);
- /* we know the script has the same name, without the .exe */
- /* so make sure newargz[1] doesn't end in .exe */
- strendzap(newargz[1],".exe");
- for (i = 1; i < argc; i++)
- newargz[i+1] = xstrdup(argv[i]);
- newargz[argc+1] = NULL;
-
- for (i=0; i<argc+1; i++)
- {
- DEBUG("(main) newargz[%d] : %s\n",i,newargz[i]);
- ;
- }
-
-EOF
-
- case $host_os in
- mingw*)
- cat >> $cwrappersource <<EOF
- execv("$SHELL",(char const **)newargz);
-EOF
- ;;
- *)
- cat >> $cwrappersource <<EOF
- execv("$SHELL",newargz);
-EOF
- ;;
- esac
-
- cat >> $cwrappersource <<"EOF"
- return 127;
-}
-
-void *
-xmalloc (size_t num)
-{
- void * p = (void *) malloc (num);
- if (!p)
- lt_fatal ("Memory exhausted");
-
- return p;
-}
-
-char *
-xstrdup (const char *string)
-{
- return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL
-;
-}
-
-const char *
-base_name (const char *name)
-{
- const char *base;
-
-#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
- /* Skip over the disk name in MSDOS pathnames. */
- if (isalpha ((unsigned char)name[0]) && name[1] == ':')
- name += 2;
-#endif
-
- for (base = name; *name; name++)
- if (IS_DIR_SEPARATOR (*name))
- base = name + 1;
- return base;
-}
-
-int
-check_executable(const char * path)
-{
- struct stat st;
-
- DEBUG("(check_executable) : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!");
- if ((!path) || (!*path))
- return 0;
-
- if ((stat (path, &st) >= 0) &&
- (
- /* MinGW & native WIN32 do not support S_IXOTH or S_IXGRP */
-#if defined (S_IXOTH)
- ((st.st_mode & S_IXOTH) == S_IXOTH) ||
-#endif
-#if defined (S_IXGRP)
- ((st.st_mode & S_IXGRP) == S_IXGRP) ||
-#endif
- ((st.st_mode & S_IXUSR) == S_IXUSR))
- )
- return 1;
- else
- return 0;
-}
-
-/* Searches for the full path of the wrapper. Returns
- newly allocated full path name if found, NULL otherwise */
-char *
-find_executable (const char* wrapper)
-{
- int has_slash = 0;
- const char* p;
- const char* p_next;
- /* static buffer for getcwd */
- char tmp[LT_PATHMAX + 1];
- int tmp_len;
- char* concat_name;
-
- DEBUG("(find_executable) : %s\n", wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!");
-
- if ((wrapper == NULL) || (*wrapper == '\0'))
- return NULL;
-
- /* Absolute path? */
-#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
- if (isalpha ((unsigned char)wrapper[0]) && wrapper[1] == ':')
- {
- concat_name = xstrdup (wrapper);
- if (check_executable(concat_name))
- return concat_name;
- XFREE(concat_name);
- }
- else
- {
-#endif
- if (IS_DIR_SEPARATOR (wrapper[0]))
- {
- concat_name = xstrdup (wrapper);
- if (check_executable(concat_name))
- return concat_name;
- XFREE(concat_name);
- }
-#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
- }
-#endif
-
- for (p = wrapper; *p; p++)
- if (*p == '/')
- {
- has_slash = 1;
- break;
- }
- if (!has_slash)
- {
- /* no slashes; search PATH */
- const char* path = getenv ("PATH");
- if (path != NULL)
- {
- for (p = path; *p; p = p_next)
- {
- const char* q;
- size_t p_len;
- for (q = p; *q; q++)
- if (IS_PATH_SEPARATOR(*q))
- break;
- p_len = q - p;
- p_next = (*q == '\0' ? q : q + 1);
- if (p_len == 0)
- {
- /* empty path: current directory */
- if (getcwd (tmp, LT_PATHMAX) == NULL)
- lt_fatal ("getcwd failed");
- tmp_len = strlen(tmp);
- concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1);
- memcpy (concat_name, tmp, tmp_len);
- concat_name[tmp_len] = '/';
- strcpy (concat_name + tmp_len + 1, wrapper);
- }
- else
- {
- concat_name = XMALLOC(char, p_len + 1 + strlen(wrapper) + 1);
- memcpy (concat_name, p, p_len);
- concat_name[p_len] = '/';
- strcpy (concat_name + p_len + 1, wrapper);
- }
- if (check_executable(concat_name))
- return concat_name;
- XFREE(concat_name);
- }
- }
- /* not found in PATH; assume curdir */
- }
- /* Relative path | not found in path: prepend cwd */
- if (getcwd (tmp, LT_PATHMAX) == NULL)
- lt_fatal ("getcwd failed");
- tmp_len = strlen(tmp);
- concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1);
- memcpy (concat_name, tmp, tmp_len);
- concat_name[tmp_len] = '/';
- strcpy (concat_name + tmp_len + 1, wrapper);
-
- if (check_executable(concat_name))
- return concat_name;
- XFREE(concat_name);
- return NULL;
-}
-
-char *
-strendzap(char *str, const char *pat)
-{
- size_t len, patlen;
-
- assert(str != NULL);
- assert(pat != NULL);
-
- len = strlen(str);
- patlen = strlen(pat);
-
- if (patlen <= len)
- {
- str += len - patlen;
- if (strcmp(str, pat) == 0)
- *str = '\0';
- }
- return str;
-}
-
-static void
-lt_error_core (int exit_status, const char * mode,
- const char * message, va_list ap)
-{
- fprintf (stderr, "%s: %s: ", program_name, mode);
- vfprintf (stderr, message, ap);
- fprintf (stderr, ".\n");
-
- if (exit_status >= 0)
- exit (exit_status);
-}
-
-void
-lt_fatal (const char *message, ...)
-{
- va_list ap;
- va_start (ap, message);
- lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
- va_end (ap);
-}
-EOF
- # we should really use a build-platform specific compiler
- # here, but OTOH, the wrappers (shell script and this C one)
- # are only useful if you want to execute the "real" binary.
- # Since the "real" binary is built for $host, then this
- # wrapper might as well be built for $host, too.
- $run $LTCC $LTCFLAGS -s -o $cwrapper $cwrappersource
- ;;
- esac
- $rm $output
- trap "$rm $output; exit $EXIT_FAILURE" 1 2 15
-
- $echo > $output "\
-#! $SHELL
-
-# $output - temporary wrapper script for $objdir/$outputname
-# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
-#
-# The $output program cannot be directly executed until all the libtool
-# libraries that it depends on are installed.
-#
-# This wrapper script should never be moved out of the build directory.
-# If it is, it will not operate correctly.
-
-# Sed substitution that helps us do robust quoting. It backslashifies
-# metacharacters that are still active within double-quoted strings.
-Xsed='${SED} -e 1s/^X//'
-sed_quote_subst='$sed_quote_subst'
-
-# The HP-UX ksh and POSIX shell print the target directory to stdout
-# if CDPATH is set.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-
-relink_command=\"$relink_command\"
-
-# This environment variable determines our operation mode.
-if test \"\$libtool_install_magic\" = \"$magic\"; then
- # install mode needs the following variable:
- notinst_deplibs='$notinst_deplibs'
-else
- # When we are sourced in execute mode, \$file and \$echo are already set.
- if test \"\$libtool_execute_magic\" != \"$magic\"; then
- echo=\"$qecho\"
- file=\"\$0\"
- # Make sure echo works.
- if test \"X\$1\" = X--no-reexec; then
- # Discard the --no-reexec flag, and continue.
- shift
- elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
- # Yippee, \$echo works!
- :
- else
- # Restart under the correct shell, and then maybe \$echo will work.
- exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
- fi
- fi\
-"
- $echo >> $output "\
-
- # Find the directory that this script lives in.
- thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
- test \"x\$thisdir\" = \"x\$file\" && thisdir=.
-
- # Follow symbolic links until we get to the real thisdir.
- file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
- while test -n \"\$file\"; do
- destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
-
- # If there was a directory component, then change thisdir.
- if test \"x\$destdir\" != \"x\$file\"; then
- case \"\$destdir\" in
- [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
- *) thisdir=\"\$thisdir/\$destdir\" ;;
- esac
- fi
-
- file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
- file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
- done
-
- # Try to get the absolute directory name.
- absdir=\`cd \"\$thisdir\" && pwd\`
- test -n \"\$absdir\" && thisdir=\"\$absdir\"
-"
-
- if test "$fast_install" = yes; then
- $echo >> $output "\
- program=lt-'$outputname'$exeext
- progdir=\"\$thisdir/$objdir\"
-
- if test ! -f \"\$progdir/\$program\" || \\
- { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
- test \"X\$file\" != \"X\$progdir/\$program\"; }; then
-
- file=\"\$\$-\$program\"
-
- if test ! -d \"\$progdir\"; then
- $mkdir \"\$progdir\"
- else
- $rm \"\$progdir/\$file\"
- fi"
-
- $echo >> $output "\
-
- # relink executable if necessary
- if test -n \"\$relink_command\"; then
- if relink_command_output=\`eval \$relink_command 2>&1\`; then :
- else
- $echo \"\$relink_command_output\" >&2
- $rm \"\$progdir/\$file\"
- exit $EXIT_FAILURE
- fi
- fi
-
- $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
- { $rm \"\$progdir/\$program\";
- $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
- $rm \"\$progdir/\$file\"
- fi"
- else
- $echo >> $output "\
- program='$outputname'
- progdir=\"\$thisdir/$objdir\"
-"
- fi
-
- $echo >> $output "\
-
- if test -f \"\$progdir/\$program\"; then"
-
- # Export our shlibpath_var if we have one.
- if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
- $echo >> $output "\
- # Add our own library path to $shlibpath_var
- $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
-
- # Some systems cannot cope with colon-terminated $shlibpath_var
- # The second colon is a workaround for a bug in BeOS R4 sed
- $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
-
- export $shlibpath_var
-"
- fi
-
- # fixup the dll searchpath if we need to.
- if test -n "$dllsearchpath"; then
- $echo >> $output "\
- # Add the dll search path components to the executable PATH
- PATH=$dllsearchpath:\$PATH
-"
- fi
-
- $echo >> $output "\
- if test \"\$libtool_execute_magic\" != \"$magic\"; then
- # Run the actual program with our arguments.
-"
- case $host in
- # Backslashes separate directories on plain windows
- *-*-mingw | *-*-os2*)
- $echo >> $output "\
- exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
-"
- ;;
-
- *)
- $echo >> $output "\
- exec \"\$progdir/\$program\" \${1+\"\$@\"}
-"
- ;;
- esac
- $echo >> $output "\
- \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
- exit $EXIT_FAILURE
- fi
- else
- # The program doesn't exist.
- \$echo \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
- \$echo \"This script is just a wrapper for \$program.\" 1>&2
- $echo \"See the $PACKAGE documentation for more information.\" 1>&2
- exit $EXIT_FAILURE
- fi
-fi\
-"
- chmod +x $output
- fi
- exit $EXIT_SUCCESS
- ;;
- esac
-
- # See if we need to build an old-fashioned archive.
- for oldlib in $oldlibs; do
-
- if test "$build_libtool_libs" = convenience; then
- oldobjs="$libobjs_save"
- addlibs="$convenience"
- build_libtool_libs=no
- else
- if test "$build_libtool_libs" = module; then
- oldobjs="$libobjs_save"
- build_libtool_libs=no
- else
- oldobjs="$old_deplibs $non_pic_objects"
- fi
- addlibs="$old_convenience"
- fi
-
- if test -n "$addlibs"; then
- gentop="$output_objdir/${outputname}x"
- generated="$generated $gentop"
-
- func_extract_archives $gentop $addlibs
- oldobjs="$oldobjs $func_extract_archives_result"
- fi
-
- # Do each command in the archive commands.
- if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
- cmds=$old_archive_from_new_cmds
- else
- # POSIX demands no paths to be encoded in archives. We have
- # to avoid creating archives with duplicate basenames if we
- # might have to extract them afterwards, e.g., when creating a
- # static archive out of a convenience library, or when linking
- # the entirety of a libtool archive into another (currently
- # not supported by libtool).
- if (for obj in $oldobjs
- do
- $echo "X$obj" | $Xsed -e 's%^.*/%%'
- done | sort | sort -uc >/dev/null 2>&1); then
- :
- else
- $echo "copying selected object files to avoid basename conflicts..."
-
- if test -z "$gentop"; then
- gentop="$output_objdir/${outputname}x"
- generated="$generated $gentop"
-
- $show "${rm}r $gentop"
- $run ${rm}r "$gentop"
- $show "$mkdir $gentop"
- $run $mkdir "$gentop"
- exit_status=$?
- if test "$exit_status" -ne 0 && test ! -d "$gentop"; then
- exit $exit_status
- fi
- fi
-
- save_oldobjs=$oldobjs
- oldobjs=
- counter=1
- for obj in $save_oldobjs
- do
- objbase=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
- case " $oldobjs " in
- " ") oldobjs=$obj ;;
- *[\ /]"$objbase "*)
- while :; do
- # Make sure we don't pick an alternate name that also
- # overlaps.
- newobj=lt$counter-$objbase
- counter=`expr $counter + 1`
- case " $oldobjs " in
- *[\ /]"$newobj "*) ;;
- *) if test ! -f "$gentop/$newobj"; then break; fi ;;
- esac
- done
- $show "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
- $run ln "$obj" "$gentop/$newobj" ||
- $run cp "$obj" "$gentop/$newobj"
- oldobjs="$oldobjs $gentop/$newobj"
- ;;
- *) oldobjs="$oldobjs $obj" ;;
- esac
- done
- fi
-
- eval cmds=\"$old_archive_cmds\"
-
- if len=`expr "X$cmds" : ".*"` &&
- test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
- cmds=$old_archive_cmds
- else
- # the command line is too long to link in one step, link in parts
- $echo "using piecewise archive linking..."
- save_RANLIB=$RANLIB
- RANLIB=:
- objlist=
- concat_cmds=
- save_oldobjs=$oldobjs
-
- # Is there a better way of finding the last object in the list?
- for obj in $save_oldobjs
- do
- last_oldobj=$obj
- done
- for obj in $save_oldobjs
- do
- oldobjs="$objlist $obj"
- objlist="$objlist $obj"
- eval test_cmds=\"$old_archive_cmds\"
- if len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
- test "$len" -le "$max_cmd_len"; then
- :
- else
- # the above command should be used before it gets too long
- oldobjs=$objlist
- if test "$obj" = "$last_oldobj" ; then
- RANLIB=$save_RANLIB
- fi
- test -z "$concat_cmds" || concat_cmds=$concat_cmds~
- eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
- objlist=
- fi
- done
- RANLIB=$save_RANLIB
- oldobjs=$objlist
- if test "X$oldobjs" = "X" ; then
- eval cmds=\"\$concat_cmds\"
- else
- eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
- fi
- fi
- fi
- save_ifs="$IFS"; IFS='~'
- for cmd in $cmds; do
- eval cmd=\"$cmd\"
- IFS="$save_ifs"
- $show "$cmd"
- $run eval "$cmd" || exit $?
- done
- IFS="$save_ifs"
- done
-
- if test -n "$generated"; then
- $show "${rm}r$generated"
- $run ${rm}r$generated
- fi
-
- # Now create the libtool archive.
- case $output in
- *.la)
- old_library=
- test "$build_old_libs" = yes && old_library="$libname.$libext"
- $show "creating $output"
-
- # Preserve any variables that may affect compiler behavior
- for var in $variables_saved_for_relink; do
- if eval test -z \"\${$var+set}\"; then
- relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
- elif eval var_value=\$$var; test -z "$var_value"; then
- relink_command="$var=; export $var; $relink_command"
- else
- var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
- relink_command="$var=\"$var_value\"; export $var; $relink_command"
- fi
- done
- # Quote the link command for shipping.
- relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
- relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
- if test "$hardcode_automatic" = yes ; then
- relink_command=
- fi
-
-
- # Only create the output if not a dry run.
- if test -z "$run"; then
- for installed in no yes; do
- if test "$installed" = yes; then
- if test -z "$install_libdir"; then
- break
- fi
- output="$output_objdir/$outputname"i
- # Replace all uninstalled libtool libraries with the installed ones
- newdependency_libs=
- for deplib in $dependency_libs; do
- case $deplib in
- *.la)
- name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
- eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
- if test -z "$libdir"; then
- $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
- exit $EXIT_FAILURE
- fi
- newdependency_libs="$newdependency_libs $libdir/$name"
- ;;
- *) newdependency_libs="$newdependency_libs $deplib" ;;
- esac
- done
- dependency_libs="$newdependency_libs"
- newdlfiles=
- for lib in $dlfiles; do
- name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
- eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
- if test -z "$libdir"; then
- $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
- exit $EXIT_FAILURE
- fi
- newdlfiles="$newdlfiles $libdir/$name"
- done
- dlfiles="$newdlfiles"
- newdlprefiles=
- for lib in $dlprefiles; do
- name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
- eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
- if test -z "$libdir"; then
- $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
- exit $EXIT_FAILURE
- fi
- newdlprefiles="$newdlprefiles $libdir/$name"
- done
- dlprefiles="$newdlprefiles"
- else
- newdlfiles=
- for lib in $dlfiles; do
- case $lib in
- [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
- *) abs=`pwd`"/$lib" ;;
- esac
- newdlfiles="$newdlfiles $abs"
- done
- dlfiles="$newdlfiles"
- newdlprefiles=
- for lib in $dlprefiles; do
- case $lib in
- [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
- *) abs=`pwd`"/$lib" ;;
- esac
- newdlprefiles="$newdlprefiles $abs"
- done
- dlprefiles="$newdlprefiles"
- fi
- $rm $output
- # place dlname in correct position for cygwin
- tdlname=$dlname
- case $host,$output,$installed,$module,$dlname in
- *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
- esac
- $echo > $output "\
-# $outputname - a libtool library file
-# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
-#
-# Please DO NOT delete this file!
-# It is necessary for linking the library.
-
-# The name that we can dlopen(3).
-dlname='$tdlname'
-
-# Names of this library.
-library_names='$library_names'
-
-# The name of the static archive.
-old_library='$old_library'
-
-# Libraries that this one depends upon.
-dependency_libs='$dependency_libs'
-
-# Version information for $libname.
-current=$current
-age=$age
-revision=$revision
-
-# Is this an already installed library?
-installed=$installed
-
-# Should we warn about portability when linking against -modules?
-shouldnotlink=$module
-
-# Files to dlopen/dlpreopen
-dlopen='$dlfiles'
-dlpreopen='$dlprefiles'
-
-# Directory that this library needs to be installed in:
-libdir='$install_libdir'"
- if test "$installed" = no && test "$need_relink" = yes; then
- $echo >> $output "\
-relink_command=\"$relink_command\""
- fi
- done
- fi
-
- # Do a symbolic link so that the libtool archive can be found in
- # LD_LIBRARY_PATH before the program is installed.
- $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
- $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
- ;;
- esac
- exit $EXIT_SUCCESS
- ;;
-
- # libtool install mode
- install)
- modename="$modename: install"
-
- # There may be an optional sh(1) argument at the beginning of
- # install_prog (especially on Windows NT).
- if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
- # Allow the use of GNU shtool's install command.
- $echo "X$nonopt" | grep shtool > /dev/null; then
- # Aesthetically quote it.
- arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
- case $arg in
- *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
- arg="\"$arg\""
- ;;
- esac
- install_prog="$arg "
- arg="$1"
- shift
- else
- install_prog=
- arg=$nonopt
- fi
-
- # The real first argument should be the name of the installation program.
- # Aesthetically quote it.
- arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
- case $arg in
- *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
- arg="\"$arg\""
- ;;
- esac
- install_prog="$install_prog$arg"
-
- # We need to accept at least all the BSD install flags.
- dest=
- files=
- opts=
- prev=
- install_type=
- isdir=no
- stripme=
- for arg
- do
- if test -n "$dest"; then
- files="$files $dest"
- dest=$arg
- continue
- fi
-
- case $arg in
- -d) isdir=yes ;;
- -f)
- case " $install_prog " in
- *[\\\ /]cp\ *) ;;
- *) prev=$arg ;;
- esac
- ;;
- -g | -m | -o) prev=$arg ;;
- -s)
- stripme=" -s"
- continue
- ;;
- -*)
- ;;
- *)
- # If the previous option needed an argument, then skip it.
- if test -n "$prev"; then
- prev=
- else
- dest=$arg
- continue
- fi
- ;;
- esac
-
- # Aesthetically quote the argument.
- arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
- case $arg in
- *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
- arg="\"$arg\""
- ;;
- esac
- install_prog="$install_prog $arg"
- done
-
- if test -z "$install_prog"; then
- $echo "$modename: you must specify an install program" 1>&2
- $echo "$help" 1>&2
- exit $EXIT_FAILURE
- fi
-
- if test -n "$prev"; then
- $echo "$modename: the \`$prev' option requires an argument" 1>&2
- $echo "$help" 1>&2
- exit $EXIT_FAILURE
- fi
-
- if test -z "$files"; then
- if test -z "$dest"; then
- $echo "$modename: no file or destination specified" 1>&2
- else
- $echo "$modename: you must specify a destination" 1>&2
- fi
- $echo "$help" 1>&2
- exit $EXIT_FAILURE
- fi
-
- # Strip any trailing slash from the destination.
- dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
-
- # Check to see that the destination is a directory.
- test -d "$dest" && isdir=yes
- if test "$isdir" = yes; then
- destdir="$dest"
- destname=
- else
- destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
- test "X$destdir" = "X$dest" && destdir=.
- destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
-
- # Not a directory, so check to see that there is only one file specified.
- set dummy $files
- if test "$#" -gt 2; then
- $echo "$modename: \`$dest' is not a directory" 1>&2
- $echo "$help" 1>&2
- exit $EXIT_FAILURE
- fi
- fi
- case $destdir in
- [\\/]* | [A-Za-z]:[\\/]*) ;;
- *)
- for file in $files; do
- case $file in
- *.lo) ;;
- *)
- $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
- $echo "$help" 1>&2
- exit $EXIT_FAILURE
- ;;
- esac
- done
- ;;
- esac
-
- # This variable tells wrapper scripts just to set variables rather
- # than running their programs.
- libtool_install_magic="$magic"
-
- staticlibs=
- future_libdirs=
- current_libdirs=
- for file in $files; do
-
- # Do each installation.
- case $file in
- *.$libext)
- # Do the static libraries later.
- staticlibs="$staticlibs $file"
- ;;
-
- *.la)
- # Check to see that this really is a libtool archive.
- if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
- else
- $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
- $echo "$help" 1>&2
- exit $EXIT_FAILURE
- fi
-
- library_names=
- old_library=
- relink_command=
- # If there is no directory component, then add one.
- case $file in
- */* | *\\*) . $file ;;
- *) . ./$file ;;
- esac
-
- # Add the libdir to current_libdirs if it is the destination.
- if test "X$destdir" = "X$libdir"; then
- case "$current_libdirs " in
- *" $libdir "*) ;;
- *) current_libdirs="$current_libdirs $libdir" ;;
- esac
- else
- # Note the libdir as a future libdir.
- case "$future_libdirs " in
- *" $libdir "*) ;;
- *) future_libdirs="$future_libdirs $libdir" ;;
- esac
- fi
-
- dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
- test "X$dir" = "X$file/" && dir=
- dir="$dir$objdir"
-
- if test -n "$relink_command"; then
- # Determine the prefix the user has applied to our future dir.
- inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"`
-
- # Don't allow the user to place us outside of our expected
- # location b/c this prevents finding dependent libraries that
- # are installed to the same prefix.
- # At present, this check doesn't affect windows .dll's that
- # are installed into $libdir/../bin (currently, that works fine)
- # but it's something to keep an eye on.
- if test "$inst_prefix_dir" = "$destdir"; then
- $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
- exit $EXIT_FAILURE
- fi
-
- if test -n "$inst_prefix_dir"; then
- # Stick the inst_prefix_dir data into the link command.
- relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
- else
- relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
- fi
-
- $echo "$modename: warning: relinking \`$file'" 1>&2
- $show "$relink_command"
- if $run eval "$relink_command"; then :
- else
- $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
- exit $EXIT_FAILURE
- fi
- fi
-
- # See the names of the shared library.
- set dummy $library_names
- if test -n "$2"; then
- realname="$2"
- shift
- shift
-
- srcname="$realname"
- test -n "$relink_command" && srcname="$realname"T
-
- # Install the shared library and build the symlinks.
- $show "$install_prog $dir/$srcname $destdir/$realname"
- $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $?
- if test -n "$stripme" && test -n "$striplib"; then
- $show "$striplib $destdir/$realname"
- $run eval "$striplib $destdir/$realname" || exit $?
- fi
-
- if test "$#" -gt 0; then
- # Delete the old symlinks, and create new ones.
- # Try `ln -sf' first, because the `ln' binary might depend on
- # the symlink we replace! Solaris /bin/ln does not understand -f,
- # so we also need to try rm && ln -s.
- for linkname
- do
- if test "$linkname" != "$realname"; then
- $show "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })"
- $run eval "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })"
- fi
- done
- fi
-
- # Do each command in the postinstall commands.
- lib="$destdir/$realname"
- cmds=$postinstall_cmds
- save_ifs="$IFS"; IFS='~'
- for cmd in $cmds; do
- IFS="$save_ifs"
- eval cmd=\"$cmd\"
- $show "$cmd"
- $run eval "$cmd" || {
- lt_exit=$?
-
- # Restore the uninstalled library and exit
- if test "$mode" = relink; then
- $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)'
- fi
-
- exit $lt_exit
- }
- done
- IFS="$save_ifs"
- fi
-
- # Install the pseudo-library for information purposes.
- name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
- instname="$dir/$name"i
- $show "$install_prog $instname $destdir/$name"
- $run eval "$install_prog $instname $destdir/$name" || exit $?
-
- # Maybe install the static library, too.
- test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
- ;;
-
- *.lo)
- # Install (i.e. copy) a libtool object.
-
- # Figure out destination file name, if it wasn't already specified.
- if test -n "$destname"; then
- destfile="$destdir/$destname"
- else
- destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
- destfile="$destdir/$destfile"
- fi
-
- # Deduce the name of the destination old-style object file.
- case $destfile in
- *.lo)
- staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
- ;;
- *.$objext)
- staticdest="$destfile"
- destfile=
- ;;
- *)
- $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
- $echo "$help" 1>&2
- exit $EXIT_FAILURE
- ;;
- esac
-
- # Install the libtool object if requested.
- if test -n "$destfile"; then
- $show "$install_prog $file $destfile"
- $run eval "$install_prog $file $destfile" || exit $?
- fi
-
- # Install the old object if enabled.
- if test "$build_old_libs" = yes; then
- # Deduce the name of the old-style object file.
- staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
-
- $show "$install_prog $staticobj $staticdest"
- $run eval "$install_prog \$staticobj \$staticdest" || exit $?
- fi
- exit $EXIT_SUCCESS
- ;;
-
- *)
- # Figure out destination file name, if it wasn't already specified.
- if test -n "$destname"; then
- destfile="$destdir/$destname"
- else
- destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
- destfile="$destdir/$destfile"
- fi
-
- # If the file is missing, and there is a .exe on the end, strip it
- # because it is most likely a libtool script we actually want to
- # install
- stripped_ext=""
- case $file in
- *.exe)
- if test ! -f "$file"; then
- file=`$echo $file|${SED} 's,.exe$,,'`
- stripped_ext=".exe"
- fi
- ;;
- esac
-
- # Do a test to see if this is really a libtool program.
- case $host in
- *cygwin*|*mingw*)
- wrapper=`$echo $file | ${SED} -e 's,.exe$,,'`
- ;;
- *)
- wrapper=$file
- ;;
- esac
- if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then
- notinst_deplibs=
- relink_command=
-
- # Note that it is not necessary on cygwin/mingw to append a dot to
- # foo even if both foo and FILE.exe exist: automatic-append-.exe
- # behavior happens only for exec(3), not for open(2)! Also, sourcing
- # `FILE.' does not work on cygwin managed mounts.
- #
- # If there is no directory component, then add one.
- case $wrapper in
- */* | *\\*) . ${wrapper} ;;
- *) . ./${wrapper} ;;
- esac
-
- # Check the variables that should have been set.
- if test -z "$notinst_deplibs"; then
- $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
- exit $EXIT_FAILURE
- fi
-
- finalize=yes
- for lib in $notinst_deplibs; do
- # Check to see that each library is installed.
- libdir=
- if test -f "$lib"; then
- # If there is no directory component, then add one.
- case $lib in
- */* | *\\*) . $lib ;;
- *) . ./$lib ;;
- esac
- fi
- libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
- if test -n "$libdir" && test ! -f "$libfile"; then
- $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
- finalize=no
- fi
- done
-
- relink_command=
- # Note that it is not necessary on cygwin/mingw to append a dot to
- # foo even if both foo and FILE.exe exist: automatic-append-.exe
- # behavior happens only for exec(3), not for open(2)! Also, sourcing
- # `FILE.' does not work on cygwin managed mounts.
- #
- # If there is no directory component, then add one.
- case $wrapper in
- */* | *\\*) . ${wrapper} ;;
- *) . ./${wrapper} ;;
- esac
-
- outputname=
- if test "$fast_install" = no && test -n "$relink_command"; then
- if test "$finalize" = yes && test -z "$run"; then
- tmpdir=`func_mktempdir`
- file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
- outputname="$tmpdir/$file"
- # Replace the output file specification.
- relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
-
- $show "$relink_command"
- if $run eval "$relink_command"; then :
- else
- $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
- ${rm}r "$tmpdir"
- continue
- fi
- file="$outputname"
- else
- $echo "$modename: warning: cannot relink \`$file'" 1>&2
- fi
- else
- # Install the binary that we compiled earlier.
- file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
- fi
- fi
-
- # remove .exe since cygwin /usr/bin/install will append another
- # one anyway
- case $install_prog,$host in
- */usr/bin/install*,*cygwin*)
- case $file:$destfile in
- *.exe:*.exe)
- # this is ok
- ;;
- *.exe:*)
- destfile=$destfile.exe
- ;;
- *:*.exe)
- destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'`
- ;;
- esac
- ;;
- esac
- $show "$install_prog$stripme $file $destfile"
- $run eval "$install_prog\$stripme \$file \$destfile" || exit $?
- test -n "$outputname" && ${rm}r "$tmpdir"
- ;;
- esac
- done
-
- for file in $staticlibs; do
- name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
-
- # Set up the ranlib parameters.
- oldlib="$destdir/$name"
-
- $show "$install_prog $file $oldlib"
- $run eval "$install_prog \$file \$oldlib" || exit $?
-
- if test -n "$stripme" && test -n "$old_striplib"; then
- $show "$old_striplib $oldlib"
- $run eval "$old_striplib $oldlib" || exit $?
- fi
-
- # Do each command in the postinstall commands.
- cmds=$old_postinstall_cmds
- save_ifs="$IFS"; IFS='~'
- for cmd in $cmds; do
- IFS="$save_ifs"
- eval cmd=\"$cmd\"
- $show "$cmd"
- $run eval "$cmd" || exit $?
- done
- IFS="$save_ifs"
- done
-
- if test -n "$future_libdirs"; then
- $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
- fi
-
- if test -n "$current_libdirs"; then
- # Maybe just do a dry run.
- test -n "$run" && current_libdirs=" -n$current_libdirs"
- exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
- else
- exit $EXIT_SUCCESS
- fi
- ;;
-
- # libtool finish mode
- finish)
- modename="$modename: finish"
- libdirs="$nonopt"
- admincmds=
-
- if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
- for dir
- do
- libdirs="$libdirs $dir"
- done
-
- for libdir in $libdirs; do
- if test -n "$finish_cmds"; then
- # Do each command in the finish commands.
- cmds=$finish_cmds
- save_ifs="$IFS"; IFS='~'
- for cmd in $cmds; do
- IFS="$save_ifs"
- eval cmd=\"$cmd\"
- $show "$cmd"
- $run eval "$cmd" || admincmds="$admincmds
- $cmd"
- done
- IFS="$save_ifs"
- fi
- if test -n "$finish_eval"; then
- # Do the single finish_eval.
- eval cmds=\"$finish_eval\"
- $run eval "$cmds" || admincmds="$admincmds
- $cmds"
- fi
- done
- fi
-
- # Exit here if they wanted silent mode.
- test "$show" = : && exit $EXIT_SUCCESS
-
- $echo "X----------------------------------------------------------------------" | $Xsed
- $echo "Libraries have been installed in:"
- for libdir in $libdirs; do
- $echo " $libdir"
- done
- $echo
- $echo "If you ever happen to want to link against installed libraries"
- $echo "in a given directory, LIBDIR, you must either use libtool, and"
- $echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
- $echo "flag during linking and do at least one of the following:"
- if test -n "$shlibpath_var"; then
- $echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
- $echo " during execution"
- fi
- if test -n "$runpath_var"; then
- $echo " - add LIBDIR to the \`$runpath_var' environment variable"
- $echo " during linking"
- fi
- if test -n "$hardcode_libdir_flag_spec"; then
- libdir=LIBDIR
- eval flag=\"$hardcode_libdir_flag_spec\"
-
- $echo " - use the \`$flag' linker flag"
- fi
- if test -n "$admincmds"; then
- $echo " - have your system administrator run these commands:$admincmds"
- fi
- if test -f /etc/ld.so.conf; then
- $echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
- fi
- $echo
- $echo "See any operating system documentation about shared libraries for"
- $echo "more information, such as the ld(1) and ld.so(8) manual pages."
- $echo "X----------------------------------------------------------------------" | $Xsed
- exit $EXIT_SUCCESS
- ;;
-
- # libtool execute mode
- execute)
- modename="$modename: execute"
-
- # The first argument is the command name.
- cmd="$nonopt"
- if test -z "$cmd"; then
- $echo "$modename: you must specify a COMMAND" 1>&2
- $echo "$help"
- exit $EXIT_FAILURE
- fi
-
- # Handle -dlopen flags immediately.
- for file in $execute_dlfiles; do
- if test ! -f "$file"; then
- $echo "$modename: \`$file' is not a file" 1>&2
- $echo "$help" 1>&2
- exit $EXIT_FAILURE
- fi
-
- dir=
- case $file in
- *.la)
- # Check to see that this really is a libtool archive.
- if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
- else
- $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
- $echo "$help" 1>&2
- exit $EXIT_FAILURE
- fi
-
- # Read the libtool library.
- dlname=
- library_names=
-
- # If there is no directory component, then add one.
- case $file in
- */* | *\\*) . $file ;;
- *) . ./$file ;;
- esac
-
- # Skip this library if it cannot be dlopened.
- if test -z "$dlname"; then
- # Warn if it was a shared library.
- test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
- continue
- fi
-
- dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
- test "X$dir" = "X$file" && dir=.
-
- if test -f "$dir/$objdir/$dlname"; then
- dir="$dir/$objdir"
- else
- $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
- exit $EXIT_FAILURE
- fi
- ;;
-
- *.lo)
- # Just add the directory containing the .lo file.
- dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
- test "X$dir" = "X$file" && dir=.
- ;;
-
- *)
- $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
- continue
- ;;
- esac
-
- # Get the absolute pathname.
- absdir=`cd "$dir" && pwd`
- test -n "$absdir" && dir="$absdir"
-
- # Now add the directory to shlibpath_var.
- if eval "test -z \"\$$shlibpath_var\""; then
- eval "$shlibpath_var=\"\$dir\""
- else
- eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
- fi
- done
-
- # This variable tells wrapper scripts just to set shlibpath_var
- # rather than running their programs.
- libtool_execute_magic="$magic"
-
- # Check if any of the arguments is a wrapper script.
- args=
- for file
- do
- case $file in
- -*) ;;
- *)
- # Do a test to see if this is really a libtool program.
- if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
- # If there is no directory component, then add one.
- case $file in
- */* | *\\*) . $file ;;
- *) . ./$file ;;
- esac
-
- # Transform arg to wrapped name.
- file="$progdir/$program"
- fi
- ;;
- esac
- # Quote arguments (to preserve shell metacharacters).
- file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
- args="$args \"$file\""
- done
-
- if test -z "$run"; then
- if test -n "$shlibpath_var"; then
- # Export the shlibpath_var.
- eval "export $shlibpath_var"
- fi
-
- # Restore saved environment variables
- if test "${save_LC_ALL+set}" = set; then
- LC_ALL="$save_LC_ALL"; export LC_ALL
- fi
- if test "${save_LANG+set}" = set; then
- LANG="$save_LANG"; export LANG
- fi
-
- # Now prepare to actually exec the command.
- exec_cmd="\$cmd$args"
- else
- # Display what would be done.
- if test -n "$shlibpath_var"; then
- eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
- $echo "export $shlibpath_var"
- fi
- $echo "$cmd$args"
- exit $EXIT_SUCCESS
- fi
- ;;
-
- # libtool clean and uninstall mode
- clean | uninstall)
- modename="$modename: $mode"
- rm="$nonopt"
- files=
- rmforce=
- exit_status=0
-
- # This variable tells wrapper scripts just to set variables rather
- # than running their programs.
- libtool_install_magic="$magic"
-
- for arg
- do
- case $arg in
- -f) rm="$rm $arg"; rmforce=yes ;;
- -*) rm="$rm $arg" ;;
- *) files="$files $arg" ;;
- esac
- done
-
- if test -z "$rm"; then
- $echo "$modename: you must specify an RM program" 1>&2
- $echo "$help" 1>&2
- exit $EXIT_FAILURE
- fi
-
- rmdirs=
-
- origobjdir="$objdir"
- for file in $files; do
- dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
- if test "X$dir" = "X$file"; then
- dir=.
- objdir="$origobjdir"
- else
- objdir="$dir/$origobjdir"
- fi
- name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
- test "$mode" = uninstall && objdir="$dir"
-
- # Remember objdir for removal later, being careful to avoid duplicates
- if test "$mode" = clean; then
- case " $rmdirs " in
- *" $objdir "*) ;;
- *) rmdirs="$rmdirs $objdir" ;;
- esac
- fi
-
- # Don't error if the file doesn't exist and rm -f was used.
- if (test -L "$file") >/dev/null 2>&1 \
- || (test -h "$file") >/dev/null 2>&1 \
- || test -f "$file"; then
- :
- elif test -d "$file"; then
- exit_status=1
- continue
- elif test "$rmforce" = yes; then
- continue
- fi
-
- rmfiles="$file"
-
- case $name in
- *.la)
- # Possibly a libtool archive, so verify it.
- if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
- . $dir/$name
-
- # Delete the libtool libraries and symlinks.
- for n in $library_names; do
- rmfiles="$rmfiles $objdir/$n"
- done
- test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
-
- case "$mode" in
- clean)
- case " $library_names " in
- # " " in the beginning catches empty $dlname
- *" $dlname "*) ;;
- *) rmfiles="$rmfiles $objdir/$dlname" ;;
- esac
- test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
- ;;
- uninstall)
- if test -n "$library_names"; then
- # Do each command in the postuninstall commands.
- cmds=$postuninstall_cmds
- save_ifs="$IFS"; IFS='~'
- for cmd in $cmds; do
- IFS="$save_ifs"
- eval cmd=\"$cmd\"
- $show "$cmd"
- $run eval "$cmd"
- if test "$?" -ne 0 && test "$rmforce" != yes; then
- exit_status=1
- fi
- done
- IFS="$save_ifs"
- fi
-
- if test -n "$old_library"; then
- # Do each command in the old_postuninstall commands.
- cmds=$old_postuninstall_cmds
- save_ifs="$IFS"; IFS='~'
- for cmd in $cmds; do
- IFS="$save_ifs"
- eval cmd=\"$cmd\"
- $show "$cmd"
- $run eval "$cmd"
- if test "$?" -ne 0 && test "$rmforce" != yes; then
- exit_status=1
- fi
- done
- IFS="$save_ifs"
- fi
- # FIXME: should reinstall the best remaining shared library.
- ;;
- esac
- fi
- ;;
-
- *.lo)
- # Possibly a libtool object, so verify it.
- if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
-
- # Read the .lo file
- . $dir/$name
-
- # Add PIC object to the list of files to remove.
- if test -n "$pic_object" \
- && test "$pic_object" != none; then
- rmfiles="$rmfiles $dir/$pic_object"
- fi
-
- # Add non-PIC object to the list of files to remove.
- if test -n "$non_pic_object" \
- && test "$non_pic_object" != none; then
- rmfiles="$rmfiles $dir/$non_pic_object"
- fi
- fi
- ;;
-
- *)
- if test "$mode" = clean ; then
- noexename=$name
- case $file in
- *.exe)
- file=`$echo $file|${SED} 's,.exe$,,'`
- noexename=`$echo $name|${SED} 's,.exe$,,'`
- # $file with .exe has already been added to rmfiles,
- # add $file without .exe
- rmfiles="$rmfiles $file"
- ;;
- esac
- # Do a test to see if this is a libtool program.
- if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
- relink_command=
- . $dir/$noexename
-
- # note $name still contains .exe if it was in $file originally
- # as does the version of $file that was added into $rmfiles
- rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
- if test "$fast_install" = yes && test -n "$relink_command"; then
- rmfiles="$rmfiles $objdir/lt-$name"
- fi
- if test "X$noexename" != "X$name" ; then
- rmfiles="$rmfiles $objdir/lt-${noexename}.c"
- fi
- fi
- fi
- ;;
- esac
- $show "$rm $rmfiles"
- $run $rm $rmfiles || exit_status=1
- done
- objdir="$origobjdir"
-
- # Try to remove the ${objdir}s in the directories where we deleted files
- for dir in $rmdirs; do
- if test -d "$dir"; then
- $show "rmdir $dir"
- $run rmdir $dir >/dev/null 2>&1
- fi
- done
-
- exit $exit_status
- ;;
-
- "")
- $echo "$modename: you must specify a MODE" 1>&2
- $echo "$generic_help" 1>&2
- exit $EXIT_FAILURE
- ;;
- esac
-
- if test -z "$exec_cmd"; then
- $echo "$modename: invalid operation mode \`$mode'" 1>&2
- $echo "$generic_help" 1>&2
- exit $EXIT_FAILURE
- fi
-fi # test -z "$show_help"
-
-if test -n "$exec_cmd"; then
- eval exec $exec_cmd
- exit $EXIT_FAILURE
-fi
-
-# We need to display help for each of the modes.
-case $mode in
-"") $echo \
-"Usage: $modename [OPTION]... [MODE-ARG]...
-
-Provide generalized library-building support services.
-
- --config show all configuration variables
- --debug enable verbose shell tracing
--n, --dry-run display commands without modifying any files
- --features display basic configuration information and exit
- --finish same as \`--mode=finish'
- --help display this help message and exit
- --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
- --quiet same as \`--silent'
- --silent don't print informational messages
- --tag=TAG use configuration variables from tag TAG
- --version print version information
-
-MODE must be one of the following:
-
- clean remove files from the build directory
- compile compile a source file into a libtool object
- execute automatically set library path, then run a program
- finish complete the installation of libtool libraries
- install install libraries or executables
- link create a library or an executable
- uninstall remove libraries from an installed directory
-
-MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
-a more detailed description of MODE.
-
-Report bugs to <bug-libtool@gnu.org>."
- exit $EXIT_SUCCESS
- ;;
-
-clean)
- $echo \
-"Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
-
-Remove files from the build directory.
-
-RM is the name of the program to use to delete files associated with each FILE
-(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
-to RM.
-
-If FILE is a libtool library, object or program, all the files associated
-with it are deleted. Otherwise, only FILE itself is deleted using RM."
- ;;
-
-compile)
- $echo \
-"Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
-
-Compile a source file into a libtool library object.
-
-This mode accepts the following additional options:
-
- -o OUTPUT-FILE set the output file name to OUTPUT-FILE
- -prefer-pic try to building PIC objects only
- -prefer-non-pic try to building non-PIC objects only
- -static always build a \`.o' file suitable for static linking
-
-COMPILE-COMMAND is a command to be used in creating a \`standard' object file
-from the given SOURCEFILE.
-
-The output file name is determined by removing the directory component from
-SOURCEFILE, then substituting the C source code suffix \`.c' with the
-library object suffix, \`.lo'."
- ;;
-
-execute)
- $echo \
-"Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
-
-Automatically set library path, then run a program.
-
-This mode accepts the following additional options:
-
- -dlopen FILE add the directory containing FILE to the library path
-
-This mode sets the library path environment variable according to \`-dlopen'
-flags.
-
-If any of the ARGS are libtool executable wrappers, then they are translated
-into their corresponding uninstalled binary, and any of their required library
-directories are added to the library path.
-
-Then, COMMAND is executed, with ARGS as arguments."
- ;;
-
-finish)
- $echo \
-"Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
-
-Complete the installation of libtool libraries.
-
-Each LIBDIR is a directory that contains libtool libraries.
-
-The commands that this mode executes may require superuser privileges. Use
-the \`--dry-run' option if you just want to see what would be executed."
- ;;
-
-install)
- $echo \
-"Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
-
-Install executables or libraries.
-
-INSTALL-COMMAND is the installation command. The first component should be
-either the \`install' or \`cp' program.
-
-The rest of the components are interpreted as arguments to that command (only
-BSD-compatible install options are recognized)."
- ;;
-
-link)
- $echo \
-"Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
-
-Link object files or libraries together to form another library, or to
-create an executable program.
-
-LINK-COMMAND is a command using the C compiler that you would use to create
-a program from several object files.
-
-The following components of LINK-COMMAND are treated specially:
-
- -all-static do not do any dynamic linking at all
- -avoid-version do not add a version suffix if possible
- -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
- -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
- -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
- -export-symbols SYMFILE
- try to export only the symbols listed in SYMFILE
- -export-symbols-regex REGEX
- try to export only the symbols matching REGEX
- -LLIBDIR search LIBDIR for required installed libraries
- -lNAME OUTPUT-FILE requires the installed library libNAME
- -module build a library that can dlopened
- -no-fast-install disable the fast-install mode
- -no-install link a not-installable executable
- -no-undefined declare that a library does not refer to external symbols
- -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
- -objectlist FILE Use a list of object files found in FILE to specify objects
- -precious-files-regex REGEX
- don't remove output files matching REGEX
- -release RELEASE specify package release information
- -rpath LIBDIR the created library will eventually be installed in LIBDIR
- -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
- -static do not do any dynamic linking of libtool libraries
- -version-info CURRENT[:REVISION[:AGE]]
- specify library version info [each variable defaults to 0]
-
-All other options (arguments beginning with \`-') are ignored.
-
-Every other argument is treated as a filename. Files ending in \`.la' are
-treated as uninstalled libtool libraries, other files are standard or library
-object files.
-
-If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
-only library objects (\`.lo' files) may be specified, and \`-rpath' is
-required, except when creating a convenience library.
-
-If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
-using \`ar' and \`ranlib', or on Windows using \`lib'.
-
-If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
-is created, otherwise an executable program is created."
- ;;
-
-uninstall)
- $echo \
-"Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
-
-Remove libraries from an installation directory.
-
-RM is the name of the program to use to delete files associated with each FILE
-(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
-to RM.
-
-If FILE is a libtool library, all the files associated with it are deleted.
-Otherwise, only FILE itself is deleted using RM."
- ;;
-
-*)
- $echo "$modename: invalid operation mode \`$mode'" 1>&2
- $echo "$help" 1>&2
- exit $EXIT_FAILURE
- ;;
-esac
-
-$echo
-$echo "Try \`$modename --help' for more information about other modes."
-
-exit $?
-
-# The TAGs below are defined such that we never get into a situation
-# in which we disable both kinds of libraries. Given conflicting
-# choices, we go for a static library, that is the most portable,
-# since we can't tell whether shared libraries were disabled because
-# the user asked for that or because the platform doesn't support
-# them. This is particularly important on AIX, because we don't
-# support having both static and shared libraries enabled at the same
-# time on that platform, so we default to a shared-only configuration.
-# If a disable-shared tag is given, we'll fallback to a static-only
-# configuration. But we'll never go from static-only to shared-only.
-
-# ### BEGIN LIBTOOL TAG CONFIG: disable-shared
-disable_libs=shared
-# ### END LIBTOOL TAG CONFIG: disable-shared
-
-# ### BEGIN LIBTOOL TAG CONFIG: disable-static
-disable_libs=static
-# ### END LIBTOOL TAG CONFIG: disable-static
-
-# Local Variables:
-# mode:shell-script
-# sh-indentation:2
-# End:
diff --git a/release_23/autoconf/m4/bison.m4 b/release_23/autoconf/m4/bison.m4
deleted file mode 100644
index 48b83cc4a61f..000000000000
--- a/release_23/autoconf/m4/bison.m4
+++ /dev/null
@@ -1,15 +0,0 @@
-#
-# Check for Bison.
-#
-# This macro verifies that Bison is installed. If successful, then
-# 1) YACC is set to bison -y (to emulate YACC calls)
-# 2) BISON is set to bison
-#
-AC_DEFUN([AC_PROG_BISON],
-[AC_CACHE_CHECK([],[llvm_cv_has_bison],[AC_PROG_YACC()])
-if test "$YACC" != "bison -y"; then
- AC_SUBST(BISON,[])
- AC_MSG_WARN([bison not found, can't rebuild grammars])
-else
- AC_SUBST(BISON,[bison])
-fi])
diff --git a/release_23/autoconf/m4/build_exeext.m4 b/release_23/autoconf/m4/build_exeext.m4
deleted file mode 100644
index 5ea7d2e64126..000000000000
--- a/release_23/autoconf/m4/build_exeext.m4
+++ /dev/null
@@ -1,42 +0,0 @@
-# Check for the extension used for executables on build platform.
-# This is necessary for cross-compiling where the build platform
-# may differ from the host platform.
-AC_DEFUN([AC_BUILD_EXEEXT],
-[
-AC_MSG_CHECKING([for executable suffix on build platform])
-AC_CACHE_VAL(ac_cv_build_exeext,
-[if test "$CYGWIN" = yes || test "$MINGW32" = yes; then
- ac_cv_build_exeext=.exe
-else
- ac_build_prefix=${build_alias}-
-
- AC_CHECK_PROG(BUILD_CC, ${ac_build_prefix}gcc, ${ac_build_prefix}gcc)
- if test -z "$BUILD_CC"; then
- AC_CHECK_PROG(BUILD_CC, gcc, gcc)
- if test -z "$BUILD_CC"; then
- AC_CHECK_PROG(BUILD_CC, cc, cc, , , /usr/ucb/cc)
- fi
- fi
- test -z "$BUILD_CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH])
- ac_build_link='${BUILD_CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&AS_MESSAGE_LOG_FD'
- rm -f conftest*
- echo 'int main () { return 0; }' > conftest.$ac_ext
- ac_cv_build_exeext=
- if AC_TRY_EVAL(ac_build_link); then
- for file in conftest.*; do
- case $file in
- *.c | *.o | *.obj) ;;
- *) ac_cv_build_exeext=`echo $file | sed -e s/conftest//` ;;
- esac
- done
- else
- AC_MSG_ERROR([installation or configuration problem: compiler cannot create executables.])
- fi
- rm -f conftest*
- test x"${ac_cv_build_exeext}" = x && ac_cv_build_exeext=blank
-fi])
-BUILD_EXEEXT=""
-test x"${ac_cv_build_exeext}" != xblank && BUILD_EXEEXT=${ac_cv_build_exeext}
-AC_MSG_RESULT(${ac_cv_build_exeext})
-ac_build_exeext=$BUILD_EXEEXT
-AC_SUBST(BUILD_EXEEXT)])
diff --git a/release_23/autoconf/m4/c_printf_a.m4 b/release_23/autoconf/m4/c_printf_a.m4
deleted file mode 100644
index 61bac8c9dd11..000000000000
--- a/release_23/autoconf/m4/c_printf_a.m4
+++ /dev/null
@@ -1,31 +0,0 @@
-#
-# Determine if the printf() functions have the %a format character.
-# This is modified from:
-# http://www.gnu.org/software/ac-archive/htmldoc/ac_cxx_have_ext_slist.html
-AC_DEFUN([AC_C_PRINTF_A],
-[AC_CACHE_CHECK([if printf has the %a format character],[llvm_cv_c_printf_a],
-[AC_LANG_PUSH([C])
- AC_RUN_IFELSE([
- AC_LANG_PROGRAM([[
-#include <stdio.h>
-#include <stdlib.h>
-]],[[
-volatile double A, B;
-char Buffer[100];
-A = 1;
-A /= 10.0;
-sprintf(Buffer, "%a", A);
-B = atof(Buffer);
-if (A != B)
- return (1);
-if (A != 0x1.999999999999ap-4)
- return (1);
-return (0);]])],
- llvm_cv_c_printf_a=yes,
- llvmac_cv_c_printf_a=no,
- llvmac_cv_c_printf_a=no)
- AC_LANG_POP([C])])
- if test "$llvm_cv_c_printf_a" = "yes"; then
- AC_DEFINE([HAVE_PRINTF_A],[1],[Define to have the %a format string])
- fi
-])
diff --git a/release_23/autoconf/m4/check_gnu_make.m4 b/release_23/autoconf/m4/check_gnu_make.m4
deleted file mode 100644
index 7355e1c85bb9..000000000000
--- a/release_23/autoconf/m4/check_gnu_make.m4
+++ /dev/null
@@ -1,26 +0,0 @@
-#
-# Check for GNU Make. This is originally from
-# http://www.gnu.org/software/ac-archive/htmldoc/check_gnu_make.html
-#
-AC_DEFUN([AC_CHECK_GNU_MAKE],
-[AC_CACHE_CHECK([for GNU make],[llvm_cv_gnu_make_command],
-dnl Search all the common names for GNU make
-[llvm_cv_gnu_make_command=''
- for a in "$MAKE" make gmake gnumake ; do
- if test -z "$a" ; then continue ; fi ;
- if ( sh -c "$a --version" 2> /dev/null | grep GNU 2>&1 > /dev/null )
- then
- llvm_cv_gnu_make_command=$a ;
- break;
- fi
- done])
-dnl If there was a GNU version, then set @ifGNUmake@ to the empty string,
-dnl '#' otherwise
- if test "x$llvm_cv_gnu_make_command" != "x" ; then
- ifGNUmake='' ;
- else
- ifGNUmake='#' ;
- AC_MSG_RESULT("Not found");
- fi
- AC_SUBST(ifGNUmake)
-])
diff --git a/release_23/autoconf/m4/config_makefile.m4 b/release_23/autoconf/m4/config_makefile.m4
deleted file mode 100644
index f21a25631edf..000000000000
--- a/release_23/autoconf/m4/config_makefile.m4
+++ /dev/null
@@ -1,9 +0,0 @@
-#
-# Configure a Makefile without clobbering it if it exists and is not out of
-# date. This macro is unique to LLVM.
-#
-AC_DEFUN([AC_CONFIG_MAKEFILE],
-[AC_CONFIG_COMMANDS($1,
- [${llvm_src}/autoconf/mkinstalldirs `dirname $1`
- ${SHELL} ${llvm_src}/autoconf/install-sh -c ${srcdir}/$1 $1])
-])
diff --git a/release_23/autoconf/m4/config_project.m4 b/release_23/autoconf/m4/config_project.m4
deleted file mode 100644
index eea7faf165c2..000000000000
--- a/release_23/autoconf/m4/config_project.m4
+++ /dev/null
@@ -1,14 +0,0 @@
-#
-# Provide the arguments and other processing needed for an LLVM project
-#
-AC_DEFUN([LLVM_CONFIG_PROJECT],
- [AC_ARG_WITH([llvmsrc],
- AS_HELP_STRING([--with-llvmsrc],[Location of LLVM Source Code]),
- [llvm_src="$withval"],[llvm_src="]$1["])
- AC_SUBST(LLVM_SRC,$llvm_src)
- AC_ARG_WITH([llvmobj],
- AS_HELP_STRING([--with-llvmobj],[Location of LLVM Object Code]),
- [llvm_obj="$withval"],[llvm_obj="]$2["])
- AC_SUBST(LLVM_OBJ,$llvm_obj)
- AC_CONFIG_COMMANDS([setup],,[llvm_src="${LLVM_SRC}"])
-])
diff --git a/release_23/autoconf/m4/cxx_bidi_iterator.m4 b/release_23/autoconf/m4/cxx_bidi_iterator.m4
deleted file mode 100644
index d7de85630b5f..000000000000
--- a/release_23/autoconf/m4/cxx_bidi_iterator.m4
+++ /dev/null
@@ -1,22 +0,0 @@
-#
-# Check for bidirectional iterator extension. This is modified from
-# http://www.gnu.org/software/ac-archive/htmldoc/ac_cxx_have_ext_hash_set.html
-#
-AC_DEFUN([AC_CXX_HAVE_BI_ITERATOR],
-[AC_CACHE_CHECK(whether the compiler has the bidirectional iterator,
-ac_cv_cxx_have_bi_iterator,
-[AC_REQUIRE([AC_CXX_NAMESPACES])
- AC_LANG_PUSH([C++])
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <iterator>
-#ifdef HAVE_NAMESPACES
-using namespace std;
-#endif]], [[bidirectional_iterator<int,int> t; return 0;]])],[ac_cv_cxx_have_bi_iterator=yes],[ac_cv_cxx_have_bi_iterator=no])
- AC_LANG_POP([C++])
-])
-if test "$ac_cv_cxx_have_bi_iterator" = yes
-then
- AC_DEFINE(HAVE_BI_ITERATOR,1,[Have bi-directional iterator])
-else
- AC_DEFINE(HAVE_BI_ITERATOR,0,[Does not have bi-directional iterator])
-fi
-])
diff --git a/release_23/autoconf/m4/cxx_fwd_iterator.m4 b/release_23/autoconf/m4/cxx_fwd_iterator.m4
deleted file mode 100644
index eb7660c7c25c..000000000000
--- a/release_23/autoconf/m4/cxx_fwd_iterator.m4
+++ /dev/null
@@ -1,22 +0,0 @@
-# Check for forward iterator extension. This is modified from
-# http://www.gnu.org/software/ac-archive/htmldoc/ac_cxx_have_ext_hash_set.html
-AC_DEFUN([AC_CXX_HAVE_FWD_ITERATOR],
-[AC_CACHE_CHECK(whether the compiler has forward iterators,
-ac_cv_cxx_have_fwd_iterator,
-[AC_REQUIRE([AC_CXX_NAMESPACES])
- AC_LANG_PUSH([C++])
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <iterator>
-#ifdef HAVE_NAMESPACES
-using namespace std;
-#endif]], [[forward_iterator<int,int> t; return 0;]])],[ac_cv_cxx_have_fwd_iterator=yes],[ac_cv_cxx_have_fwd_iterator=no])
- AC_LANG_POP([C++])
-])
-if test "$ac_cv_cxx_have_fwd_iterator" = yes
-then
- AC_DEFINE(HAVE_FWD_ITERATOR,1,[Have forward iterator])
-else
- AC_DEFINE(HAVE_FWD_ITERATOR,0,[Does not have forward iterator])
-fi
-])
-
-
diff --git a/release_23/autoconf/m4/cxx_hash_map.m4 b/release_23/autoconf/m4/cxx_hash_map.m4
deleted file mode 100644
index 71c74b11e1b8..000000000000
--- a/release_23/autoconf/m4/cxx_hash_map.m4
+++ /dev/null
@@ -1,59 +0,0 @@
-# Check for hash_map extension. This is from
-# http://www.gnu.org/software/ac-archive/htmldoc/ac_cxx_have_ext_hash_map.html
-AC_DEFUN([AC_CXX_HAVE_STD_EXT_HASH_MAP],
-[AC_CACHE_CHECK([whether the compiler has <ext/hash_map> defining template class std::hash_map],
- ac_cv_cxx_have_std_ext_hash_map,
- [AC_REQUIRE([AC_CXX_NAMESPACES])
- AC_LANG_PUSH([C++])
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <ext/hash_map>
-#ifdef HAVE_NAMESPACES
-using namespace std;
-#endif]], [[hash_map<int, int> t;]])],[ac_cv_cxx_have_std_ext_hash_map=yes],[ac_cv_cxx_have_std_ext_hash_map=no])
- AC_LANG_POP([C++])])
- if test "$ac_cv_cxx_have_std_ext_hash_map" = yes
- then
- AC_DEFINE(HAVE_STD_EXT_HASH_MAP,1,[Have ext/hash_map>])
- else
- AC_DEFINE(HAVE_STD_EXT_HASH_MAP,0,[Does not have ext/hash_map>])
- fi
- ])
-
-AC_DEFUN([AC_CXX_HAVE_GNU_EXT_HASH_MAP],
-[AC_CACHE_CHECK([whether the compiler has <ext/hash_map> defining template class __gnu_cxx::hash_map],
- ac_cv_cxx_have_gnu_ext_hash_map,
- [AC_REQUIRE([AC_CXX_NAMESPACES])
- AC_LANG_PUSH([C++])
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <ext/hash_map>
-#ifdef HAVE_NAMESPACES
-using namespace __gnu_cxx;
-#endif]], [[hash_map<int,int> t; ]])],[ac_cv_cxx_have_gnu_ext_hash_map=yes],[ac_cv_cxx_have_gnu_ext_hash_map=no])
- AC_LANG_POP([C++])])
- if test "$ac_cv_cxx_have_gnu_ext_hash_map" = yes
- then
- AC_DEFINE(HAVE_GNU_EXT_HASH_MAP,1,[Have ext/hash_map])
- else
- AC_DEFINE(HAVE_GNU_EXT_HASH_MAP,0,[Does not have ext/hash_map])
- fi
- ])
-
-AC_DEFUN([AC_CXX_HAVE_GLOBAL_HASH_MAP],
-[AC_CACHE_CHECK([whether the compiler has <hash_map> defining template class ::hash_map],
- ac_cv_cxx_have_global_hash_map,
- [AC_REQUIRE([AC_CXX_NAMESPACES])
- AC_LANG_PUSH([C++])
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <hash_map>]], [[hash_map<int,int> t; ]])],[ac_cv_cxx_have_global_hash_map=yes],[ac_cv_cxx_have_global_hash_map=no])
- AC_LANG_POP([C++])])
- if test "$ac_cv_cxx_have_global_hash_map" = yes
- then
- AC_DEFINE(HAVE_GLOBAL_HASH_MAP,1,[Have <hash_map>])
- else
- AC_DEFINE(HAVE_GLOBAL_HASH_MAP,0,[Does not have <hash_map>])
- fi
- ])
-
-AC_DEFUN([AC_CXX_HAVE_HASH_MAP],
-[AC_CXX_HAVE_STD_EXT_HASH_MAP
- AC_CXX_HAVE_GNU_EXT_HASH_MAP
- AC_CXX_HAVE_GLOBAL_HASH_MAP])
-
-
diff --git a/release_23/autoconf/m4/cxx_hash_set.m4 b/release_23/autoconf/m4/cxx_hash_set.m4
deleted file mode 100644
index e9d28bfe35b9..000000000000
--- a/release_23/autoconf/m4/cxx_hash_set.m4
+++ /dev/null
@@ -1,60 +0,0 @@
-# Check for hash_set extension. This is modified from
-# http://www.gnu.org/software/ac-archive/htmldoc/ac_cxx_have_ext_hash_set.html
-AC_DEFUN([AC_CXX_HAVE_STD_EXT_HASH_SET],
-[AC_CACHE_CHECK([whether the compiler has <ext/hash_set> defining template class std::hash_set],
- ac_cv_cxx_have_std_ext_hash_set,
- [AC_REQUIRE([AC_CXX_NAMESPACES])
- AC_LANG_PUSH([C++])
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <ext/hash_set>
-#ifdef HAVE_NAMESPACES
-using namespace std;
-#endif]], [[hash_set<int> t; ]])],[ac_cv_cxx_have_std_ext_hash_set=yes],[ac_cv_cxx_have_std_ext_hash_set=no])
- AC_LANG_POP([C++])])
- if test "$ac_cv_cxx_have_std_ext_hash_set" = yes
- then
- AC_DEFINE(HAVE_STD_EXT_HASH_SET,1,[Have hash_set in std namespace])
- else
- AC_DEFINE(HAVE_STD_EXT_HASH_SET,0,[Does not have hash_set in std namespace])
- fi
- ])
-
-AC_DEFUN([AC_CXX_HAVE_GNU_EXT_HASH_SET],
-[AC_CACHE_CHECK(
- [whether the compiler has <ext/hash_set> defining template class __gnu_cxx::hash_set],
- ac_cv_cxx_have_gnu_ext_hash_set,
- [AC_REQUIRE([AC_CXX_NAMESPACES])
- AC_LANG_PUSH([C++])
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <ext/hash_set>
-#ifdef HAVE_NAMESPACES
-using namespace __gnu_cxx;
-#endif]], [[hash_set<int> t; ]])],[ac_cv_cxx_have_gnu_ext_hash_set=yes],[ac_cv_cxx_have_gnu_ext_hash_set=no])
- AC_LANG_POP([C++])])
- if test "$ac_cv_cxx_have_gnu_ext_hash_set" = yes
- then
- AC_DEFINE(HAVE_GNU_EXT_HASH_SET,1,[Have hash_set in gnu namespace])
- else
- AC_DEFINE(HAVE_GNU_EXT_HASH_SET,0,[Does not have hash_set in gnu namespace])
- fi
- ])
-
-AC_DEFUN([AC_CXX_HAVE_GLOBAL_HASH_SET],
-[AC_CACHE_CHECK([whether the compiler has <hash_set> defining template class ::hash_set],
- ac_cv_cxx_have_global_hash_set,
- [AC_REQUIRE([AC_CXX_NAMESPACES])
- AC_LANG_PUSH([C++])
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <hash_set>]], [[hash_set<int> t; return 0;]])],[ac_cv_cxx_have_global_hash_set=yes],[ac_cv_cxx_have_global_hash_set=no])
- AC_LANG_POP([C++])])
- if test "$ac_cv_cxx_have_global_hash_set" = yes
- then
- AC_DEFINE(HAVE_GLOBAL_HASH_SET,1,[Have hash_set in global namespace])
- else
- AC_DEFINE(HAVE_GLOBAL_HASH_SET,0,[Does not have hash_set in global namespace])
- fi
- ])
-
-AC_DEFUN([AC_CXX_HAVE_HASH_SET],
-[AC_CXX_HAVE_STD_EXT_HASH_SET
- AC_CXX_HAVE_GNU_EXT_HASH_SET
- AC_CXX_HAVE_GLOBAL_HASH_SET])
-
-
diff --git a/release_23/autoconf/m4/cxx_namespaces.m4 b/release_23/autoconf/m4/cxx_namespaces.m4
deleted file mode 100644
index d8d650e4d449..000000000000
--- a/release_23/autoconf/m4/cxx_namespaces.m4
+++ /dev/null
@@ -1,19 +0,0 @@
-# Check for C++ namespace support. This is from
-# http://www.gnu.org/software/ac-archive/htmldoc/ac_cxx_namespaces.html
-#
-AC_DEFUN([AC_CXX_NAMESPACES],
-[AC_CACHE_CHECK(whether the compiler implements namespaces,
-ac_cv_cxx_namespaces,
-[AC_LANG_PUSH([C++])
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
- [[namespace Outer { namespace Inner { int i = 0; }}]],
- [[using namespace Outer::Inner; return i;]])],
- ac_cv_cxx_namespaces=yes,
- ac_cv_cxx_namespaces=no)
- AC_LANG_POP([C++])
-])
-if test "$ac_cv_cxx_namespaces" = yes; then
- AC_DEFINE(HAVE_NAMESPACES,,[define if the compiler implements namespaces])
-fi
-])
-
diff --git a/release_23/autoconf/m4/cxx_std_iterator.m4 b/release_23/autoconf/m4/cxx_std_iterator.m4
deleted file mode 100644
index 38a611764c79..000000000000
--- a/release_23/autoconf/m4/cxx_std_iterator.m4
+++ /dev/null
@@ -1,26 +0,0 @@
-# Check for standard iterator extension. This is modified from
-# http://www.gnu.org/software/ac-archive/htmldoc/ac_cxx_have_ext_hash_set.html
-AC_DEFUN([AC_CXX_HAVE_STD_ITERATOR],
-[AC_CACHE_CHECK(whether the compiler has the standard iterator,
-ac_cv_cxx_have_std_iterator,
-[AC_REQUIRE([AC_CXX_NAMESPACES])
- AC_LANG_PUSH([C++])
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
- [[#include <iterator>
-#ifdef HAVE_NAMESPACES
-using namespace std;
-#endif]],
- [[iterator<int,int,int> t; return 0;]])],
- ac_cv_cxx_have_std_iterator=yes,
- ac_cv_cxx_have_std_iterator=no)
- AC_LANG_POP([C++])
-])
-if test "$ac_cv_cxx_have_std_iterator" = yes
-then
- AC_DEFINE(HAVE_STD_ITERATOR,1,[Have std namespace iterator])
-else
- AC_DEFINE(HAVE_STD_ITERATOR,0,[Does not have std namespace iterator])
-fi
-])
-
-
diff --git a/release_23/autoconf/m4/find_std_program.m4 b/release_23/autoconf/m4/find_std_program.m4
deleted file mode 100644
index c789df8e641d..000000000000
--- a/release_23/autoconf/m4/find_std_program.m4
+++ /dev/null
@@ -1,118 +0,0 @@
-dnl Check for a standard program that has a bin, include and lib directory
-dnl
-dnl Parameters:
-dnl $1 - prefix directory to check
-dnl $2 - program name to check
-dnl $3 - header file to check
-dnl $4 - library file to check
-AC_DEFUN([CHECK_STD_PROGRAM],
-[m4_define([allcapsname],translit($2,a-z,A-Z))
-if test -n "$1" -a -d "$1" -a -n "$2" -a -d "$1/bin" -a -x "$1/bin/$2" ; then
- AC_SUBST([USE_]allcapsname(),["USE_]allcapsname()[ = 1"])
- AC_SUBST(allcapsname(),[$1/bin/$2])
- AC_SUBST(allcapsname()[_BIN],[$1/bin])
- AC_SUBST(allcapsname()[_DIR],[$1])
- if test -n "$3" -a -d "$1/include" -a -f "$1/include/$3" ; then
- AC_SUBST(allcapsname()[_INC],[$1/include])
- fi
- if test -n "$4" -a -d "$1/lib" -a -f "$1/lib/$4" ; then
- AC_SUBST(allcapsname()[_LIB],[$1/lib])
- fi
-fi
-])
-
-dnl Find a program via --with options, in the path, or well known places
-dnl
-dnl Parameters:
-dnl $1 - program's executable name
-dnl $2 - header file name to check (optional)
-dnl $3 - library file name to check (optional)
-dnl $4 - alternate (long) name for the program
-AC_DEFUN([FIND_STD_PROGRAM],
-[m4_define([allcapsname],translit($1,a-z,A-Z))
-m4_define([stdprog_long_name],ifelse($4,,translit($1,[ !@#$%^&*()-+={}[]:;"',./?],[-]),translit($4,[ !@#$%^&*()-+={}[]:;"',./?],[-])))
-AC_MSG_CHECKING([for ]stdprog_long_name()[ bin/lib/include locations])
-AC_ARG_WITH($1,
- AS_HELP_STRING([--with-]stdprog_long_name()[=DIR],
- [Specify that the ]stdprog_long_name()[ install prefix is DIR]),
- $1[pfxdir=$withval],$1[pfxdir=nada])
-AC_ARG_WITH($1[-bin],
- AS_HELP_STRING([--with-]stdprog_long_name()[-bin=DIR],
- [Specify that the ]stdprog_long_name()[ binary is in DIR]),
- $1[bindir=$withval],$1[bindir=nada])
-AC_ARG_WITH($1[-lib],
- AS_HELP_STRING([--with-]stdprog_long_name()[-lib=DIR],
- [Specify that ]stdprog_long_name()[ libraries are in DIR]),
- $1[libdir=$withval],$1[libdir=nada])
-AC_ARG_WITH($1[-inc],
- AS_HELP_STRING([--with-]stdprog_long_name()[-inc=DIR],
- [Specify that the ]stdprog_long_name()[ includes are in DIR]),
- $1[incdir=$withval],$1[incdir=nada])
-eval pfxval=\$\{$1pfxdir\}
-eval binval=\$\{$1bindir\}
-eval incval=\$\{$1incdir\}
-eval libval=\$\{$1libdir\}
-if test "${pfxval}" != "nada" ; then
- CHECK_STD_PROGRAM(${pfxval},$1,$2,$3)
-elif test "${binval}" != "nada" ; then
- if test "${libval}" != "nada" ; then
- if test "${incval}" != "nada" ; then
- if test -d "${binval}" ; then
- if test -d "${incval}" ; then
- if test -d "${libval}" ; then
- AC_SUBST(allcapsname(),${binval}/$1)
- AC_SUBST(allcapsname()[_BIN],${binval})
- AC_SUBST(allcapsname()[_INC],${incval})
- AC_SUBST(allcapsname()[_LIB],${libval})
- AC_SUBST([USE_]allcapsname(),["USE_]allcapsname()[ = 1"])
- AC_MSG_RESULT([found via --with options])
- else
- AC_MSG_RESULT([failed])
- AC_MSG_ERROR([The --with-]$1[-libdir value must be a directory])
- fi
- else
- AC_MSG_RESULT([failed])
- AC_MSG_ERROR([The --with-]$1[-incdir value must be a directory])
- fi
- else
- AC_MSG_RESULT([failed])
- AC_MSG_ERROR([The --with-]$1[-bindir value must be a directory])
- fi
- else
- AC_MSG_RESULT([failed])
- AC_MSG_ERROR([The --with-]$1[-incdir option must be specified])
- fi
- else
- AC_MSG_RESULT([failed])
- AC_MSG_ERROR([The --with-]$1[-libdir option must be specified])
- fi
-else
- tmppfxdir=`which $1 2>&1`
- if test -n "$tmppfxdir" -a -d "${tmppfxdir%*$1}" -a \
- -d "${tmppfxdir%*$1}/.." ; then
- tmppfxdir=`cd "${tmppfxdir%*$1}/.." ; pwd`
- CHECK_STD_PROGRAM($tmppfxdir,$1,$2,$3)
- AC_MSG_RESULT([found in PATH at ]$tmppfxdir)
- else
- checkresult="yes"
- eval checkval=\$\{"USE_"allcapsname()\}
- CHECK_STD_PROGRAM([/usr],$1,$2,$3)
- if test -z "${checkval}" ; then
- CHECK_STD_PROGRAM([/usr/local],$1,$2,$3)
- if test -z "${checkval}" ; then
- CHECK_STD_PROGRAM([/sw],$1,$2,$3)
- if test -z "${checkval}" ; then
- CHECK_STD_PROGRAM([/opt],$1,$2,$3)
- if test -z "${checkval}" ; then
- CHECK_STD_PROGRAM([/],$1,$2,$3)
- if test -z "${checkval}" ; then
- checkresult="no"
- fi
- fi
- fi
- fi
- fi
- AC_MSG_RESULT($checkresult)
- fi
-fi
-])
diff --git a/release_23/autoconf/m4/flex.m4 b/release_23/autoconf/m4/flex.m4
deleted file mode 100644
index 5cb3dc4f8fdd..000000000000
--- a/release_23/autoconf/m4/flex.m4
+++ /dev/null
@@ -1,17 +0,0 @@
-#
-# Check for FLEX.
-#
-# This macro verifies that flex is installed. If successful, then
-# 1) $LEX is set to "flex" (to emulate lex calls)
-# 2) BISON is set to bison
-AC_DEFUN([AC_PROG_FLEX],
-[AC_CACHE_CHECK(,
-ac_cv_has_flex,
-[AC_PROG_LEX()
-])
-if test "$LEX" != "flex"; then
- AC_MSG_ERROR([flex not found but required])
-else
- AC_SUBST(FLEX,[flex],[location of flex])
-fi
-])
diff --git a/release_23/autoconf/m4/func_isinf.m4 b/release_23/autoconf/m4/func_isinf.m4
deleted file mode 100644
index c936bf920d02..000000000000
--- a/release_23/autoconf/m4/func_isinf.m4
+++ /dev/null
@@ -1,36 +0,0 @@
-#
-# This function determins if the the isinf function isavailable on this
-# platform.
-#
-AC_DEFUN([AC_FUNC_ISINF],[
-AC_SINGLE_CXX_CHECK([ac_cv_func_isinf_in_math_h],
- [isinf], [<math.h>],
- [float f; isinf(f);])
-if test "$ac_cv_func_isinf_in_math_h" = "yes" ; then
- AC_DEFINE([HAVE_ISINF_IN_MATH_H],1,[Set to 1 if the isinf function is found in <math.h>])
-fi
-
-AC_SINGLE_CXX_CHECK([ac_cv_func_isinf_in_cmath],
- [isinf], [<cmath>],
- [float f; isinf(f);])
-if test "$ac_cv_func_isinf_in_cmath" = "yes" ; then
- AC_DEFINE([HAVE_ISINF_IN_CMATH],1,[Set to 1 if the isinf function is found in <cmath>])
-fi
-
-AC_SINGLE_CXX_CHECK([ac_cv_func_std_isinf_in_cmath],
- [std::isinf], [<cmath>],
- [float f; std::isinf(f)}])
-if test "$ac_cv_func_std_isinf_in_cmath" = "yes" ; then
- AC_DEFINE([HAVE_STD_ISINF_IN_CMATH],1,[Set to 1 if the std::isinf function is found in <cmath>])
-fi
-
-AC_SINGLE_CXX_CHECK([ac_cv_func_finite_in_ieeefp_h],
- [finite], [<ieeefp.h>],
- [float f; finite(f);])
-if test "$ac_cv_func_finite_in_ieeefp_h" = "yes" ; then
- AC_DEFINE([HAVE_FINITE_IN_IEEEFP_H],1,[Set to 1 if the finite function is found in <ieeefp.h>])
-fi
-
-])
-
-
diff --git a/release_23/autoconf/m4/func_isnan.m4 b/release_23/autoconf/m4/func_isnan.m4
deleted file mode 100644
index eb5ca0daeb5e..000000000000
--- a/release_23/autoconf/m4/func_isnan.m4
+++ /dev/null
@@ -1,27 +0,0 @@
-#
-# This function determines if the isnan function is available on this
-# platform.
-#
-AC_DEFUN([AC_FUNC_ISNAN],[
-AC_SINGLE_CXX_CHECK([ac_cv_func_isnan_in_math_h],
- [isnan], [<math.h>],
- [float f; isnan(f);])
-
-if test "$ac_cv_func_isnan_in_math_h" = "yes" ; then
- AC_DEFINE([HAVE_ISNAN_IN_MATH_H],1,[Set to 1 if the isnan function is found in <math.h>])
-fi
-
-AC_SINGLE_CXX_CHECK([ac_cv_func_isnan_in_cmath],
- [isnan], [<cmath>],
- [float f; isnan(f);])
-if test "$ac_cv_func_isnan_in_cmath" = "yes" ; then
- AC_DEFINE([HAVE_ISNAN_IN_CMATH],1,[Set to 1 if the isnan function is found in <cmath>])
-fi
-
-AC_SINGLE_CXX_CHECK([ac_cv_func_std_isnan_in_cmath],
- [std::isnan], [<cmath>],
- [float f; std::isnan(f);])
-if test "$ac_cv_func_std_isnan_in_cmath" = "yes" ; then
- AC_DEFINE([HAVE_STD_ISNAN_IN_CMATH],1,[Set to 1 if the std::isnan function is found in <cmath>])
-fi
-])
diff --git a/release_23/autoconf/m4/func_mmap_file.m4 b/release_23/autoconf/m4/func_mmap_file.m4
deleted file mode 100644
index 372c87fbe5c6..000000000000
--- a/release_23/autoconf/m4/func_mmap_file.m4
+++ /dev/null
@@ -1,26 +0,0 @@
-#
-# Check for the ability to mmap a file.
-#
-AC_DEFUN([AC_FUNC_MMAP_FILE],
-[AC_CACHE_CHECK(for mmap of files,
-ac_cv_func_mmap_file,
-[ AC_LANG_PUSH([C])
- AC_RUN_IFELSE([
- AC_LANG_PROGRAM([[
-#include <sys/types.h>
-#include <sys/mman.h>
-#include <fcntl.h>
-]],[[
- int fd;
- fd = creat ("foo",0777);
- fd = (int) mmap (0, 1, PROT_READ, MAP_SHARED, fd, 0);
- unlink ("foo");
- return (fd != (int) MAP_FAILED);]])],
- [ac_cv_func_mmap_file=yes],[ac_cv_func_mmap_file=no],[ac_cv_func_mmap_file=no])
- AC_LANG_POP([C])
-])
-if test "$ac_cv_func_mmap_file" = yes; then
- AC_DEFINE([HAVE_MMAP_FILE],[],[Define if mmap() can map files into memory])
- AC_SUBST(MMAP_FILE,[yes])
-fi
-])
diff --git a/release_23/autoconf/m4/header_mmap_anonymous.m4 b/release_23/autoconf/m4/header_mmap_anonymous.m4
deleted file mode 100644
index 2270d29557b6..000000000000
--- a/release_23/autoconf/m4/header_mmap_anonymous.m4
+++ /dev/null
@@ -1,21 +0,0 @@
-#
-# Check for anonymous mmap macros. This is modified from
-# http://www.gnu.org/software/ac-archive/htmldoc/ac_cxx_have_ext_slist.html
-#
-AC_DEFUN([AC_HEADER_MMAP_ANONYMOUS],
-[AC_CACHE_CHECK(for MAP_ANONYMOUS vs. MAP_ANON,
-ac_cv_header_mmap_anon,
-[ AC_LANG_PUSH([C])
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
- [[#include <sys/mman.h>
-#include <unistd.h>
-#include <fcntl.h>]],
- [[mmap (0, 1, PROT_READ, MAP_ANONYMOUS, -1, 0); return (0);]])],
- ac_cv_header_mmap_anon=yes,
- ac_cv_header_mmap_anon=no)
- AC_LANG_POP([C])
-])
-if test "$ac_cv_header_mmap_anon" = yes; then
- AC_DEFINE([HAVE_MMAP_ANONYMOUS],[1],[Define if mmap() uses MAP_ANONYMOUS to map anonymous pages, or undefine if it uses MAP_ANON])
-fi
-])
diff --git a/release_23/autoconf/m4/huge_val.m4 b/release_23/autoconf/m4/huge_val.m4
deleted file mode 100644
index fd94c11c86e0..000000000000
--- a/release_23/autoconf/m4/huge_val.m4
+++ /dev/null
@@ -1,18 +0,0 @@
-#
-# This function determins if the the HUGE_VAL macro is compilable with the
-# -pedantic switch or not. XCode < 2.4.1 doesn't get it right.
-#
-AC_DEFUN([AC_HUGE_VAL_CHECK],[
- AC_CACHE_CHECK([for HUGE_VAL sanity], [ac_cv_huge_val_sanity],[
- AC_LANG_PUSH([C++])
- CXXFLAGS=-pedantic
- AC_RUN_IFELSE(
- AC_LANG_PROGRAM(
- [#include <math.h>],
- [double x = HUGE_VAL; return x != x; ]),
- [ac_cv_huge_val_sanity=yes],[ac_cv_huge_val_sanity=no],
- [ac_cv_huge_val_sanity=yes])
- AC_LANG_POP([C++])
- ])
- AC_SUBST(HUGE_VAL_SANITY,$ac_cv_huge_val_sanity)
-])
diff --git a/release_23/autoconf/m4/libtool.m4 b/release_23/autoconf/m4/libtool.m4
deleted file mode 100644
index a8b5e6a94fc5..000000000000
--- a/release_23/autoconf/m4/libtool.m4
+++ /dev/null
@@ -1,6389 +0,0 @@
-# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
-## Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005
-## Free Software Foundation, Inc.
-## Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
-##
-## This file is free software; the Free Software Foundation gives
-## unlimited permission to copy and/or distribute it, with or without
-## modifications, as long as this notice is preserved.
-
-# serial 48 AC_PROG_LIBTOOL
-
-
-# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED)
-# -----------------------------------------------------------
-# If this macro is not defined by Autoconf, define it here.
-m4_ifdef([AC_PROVIDE_IFELSE],
- [],
- [m4_define([AC_PROVIDE_IFELSE],
- [m4_ifdef([AC_PROVIDE_$1],
- [$2], [$3])])])
-
-
-# AC_PROG_LIBTOOL
-# ---------------
-AC_DEFUN([AC_PROG_LIBTOOL],
-[AC_REQUIRE([_AC_PROG_LIBTOOL])dnl
-dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX
-dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX.
- AC_PROVIDE_IFELSE([AC_PROG_CXX],
- [AC_LIBTOOL_CXX],
- [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX
- ])])
-dnl And a similar setup for Fortran 77 support
- AC_PROVIDE_IFELSE([AC_PROG_F77],
- [AC_LIBTOOL_F77],
- [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77
-])])
-
-dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly.
-dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run
-dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both.
- AC_PROVIDE_IFELSE([AC_PROG_GCJ],
- [AC_LIBTOOL_GCJ],
- [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
- [AC_LIBTOOL_GCJ],
- [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],
- [AC_LIBTOOL_GCJ],
- [ifdef([AC_PROG_GCJ],
- [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])
- ifdef([A][M_PROG_GCJ],
- [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])])
- ifdef([LT_AC_PROG_GCJ],
- [define([LT_AC_PROG_GCJ],
- defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])])
-])])# AC_PROG_LIBTOOL
-
-
-# _AC_PROG_LIBTOOL
-# ----------------
-AC_DEFUN([_AC_PROG_LIBTOOL],
-[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
-AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl
-AC_BEFORE([$0],[AC_LIBTOOL_F77])dnl
-AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl
-
-# This can be used to rebuild libtool when needed
-LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
-
-# Always use our own libtool.
-LIBTOOL='$(SHELL) $(top_builddir)/mklib'
-AC_SUBST(LIBTOOL)dnl
-
-# Prevent multiple expansion
-define([AC_PROG_LIBTOOL], [])
-])# _AC_PROG_LIBTOOL
-
-
-# AC_LIBTOOL_SETUP
-# ----------------
-AC_DEFUN([AC_LIBTOOL_SETUP],
-[AC_PREREQ(2.60)dnl
-AC_REQUIRE([AC_ENABLE_SHARED])dnl
-AC_REQUIRE([AC_ENABLE_STATIC])dnl
-AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
-AC_REQUIRE([AC_CANONICAL_HOST])dnl
-AC_REQUIRE([AC_CANONICAL_BUILD])dnl
-AC_REQUIRE([AC_PROG_CC])dnl
-AC_REQUIRE([AC_PROG_LD])dnl
-AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl
-AC_REQUIRE([AC_PROG_NM])dnl
-
-AC_REQUIRE([AC_PROG_LN_S])dnl
-AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl
-# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
-AC_REQUIRE([AC_OBJEXT])dnl
-AC_REQUIRE([AC_EXEEXT])dnl
-dnl
-
-AC_LIBTOOL_SYS_MAX_CMD_LEN
-AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
-AC_LIBTOOL_OBJDIR
-
-AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
-_LT_AC_PROG_ECHO_BACKSLASH
-
-case $host_os in
-aix3*)
- # AIX sometimes has problems with the GCC collect2 program. For some
- # reason, if we set the COLLECT_NAMES environment variable, the problems
- # vanish in a puff of smoke.
- if test "X${COLLECT_NAMES+set}" != Xset; then
- COLLECT_NAMES=
- export COLLECT_NAMES
- fi
- ;;
-esac
-
-# Sed substitution that helps us do robust quoting. It backslashifies
-# metacharacters that are still active within double-quoted strings.
-Xsed='sed -e 1s/^X//'
-[sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g']
-
-# Same as above, but do not quote variable references.
-[double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g']
-
-# Sed substitution to delay expansion of an escaped shell variable in a
-# double_quote_subst'ed string.
-delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
-
-# Sed substitution to avoid accidental globbing in evaled expressions
-no_glob_subst='s/\*/\\\*/g'
-
-# Constants:
-rm="rm -f"
-
-# Global variables:
-default_ofile=mklib
-can_build_shared=yes
-
-# All known linkers require a `.a' archive for static linking (except MSVC,
-# which needs '.lib').
-libext=a
-ltmain="$ac_aux_dir/ltmain.sh"
-ofile="$default_ofile"
-with_gnu_ld="$lt_cv_prog_gnu_ld"
-
-AC_CHECK_TOOL(AR, ar, false)
-AC_CHECK_TOOL(RANLIB, ranlib, :)
-AC_CHECK_TOOL(STRIP, strip, :)
-
-old_CC="$CC"
-old_CFLAGS="$CFLAGS"
-
-# Set sane defaults for various variables
-test -z "$AR" && AR=ar
-test -z "$AR_FLAGS" && AR_FLAGS=cru
-test -z "$AS" && AS=as
-test -z "$CC" && CC=cc
-test -z "$LTCC" && LTCC=$CC
-test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
-test -z "$DLLTOOL" && DLLTOOL=dlltool
-test -z "$LD" && LD=ld
-test -z "$LN_S" && LN_S="ln -s"
-test -z "$MAGIC_CMD" && MAGIC_CMD=file
-test -z "$NM" && NM=nm
-test -z "$SED" && SED=sed
-test -z "$OBJDUMP" && OBJDUMP=objdump
-test -z "$RANLIB" && RANLIB=:
-test -z "$STRIP" && STRIP=:
-test -z "$ac_objext" && ac_objext=o
-
-# Determine commands to create old-style static archives.
-old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
-old_postinstall_cmds='chmod 644 $oldlib'
-old_postuninstall_cmds=
-
-if test -n "$RANLIB"; then
- case $host_os in
- openbsd*)
- old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
- ;;
- *)
- old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
- ;;
- esac
- old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
-fi
-
-_LT_CC_BASENAME([$compiler])
-
-# Only perform the check for file, if the check method requires it
-case $deplibs_check_method in
-file_magic*)
- if test "$file_magic_cmd" = '$MAGIC_CMD'; then
- AC_PATH_MAGIC
- fi
- ;;
-esac
-
-AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no)
-AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
-enable_win32_dll=yes, enable_win32_dll=no)
-
-AC_ARG_ENABLE([libtool-lock],
- [AS_HELP_STRING([--disable-libtool-lock],[avoid locking (might break parallel builds)])])
-test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
-
-AC_ARG_WITH([pic],
- [AS_HELP_STRING([--with-pic],[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
- [pic_mode="$withval"],
- [pic_mode=default])
-test -z "$pic_mode" && pic_mode=default
-
-# Use C for the default configuration in the libtool script
-tagname=
-AC_LIBTOOL_LANG_C_CONFIG
-_LT_AC_TAGCONFIG
-])# AC_LIBTOOL_SETUP
-
-
-# _LT_AC_SYS_COMPILER
-# -------------------
-AC_DEFUN([_LT_AC_SYS_COMPILER],
-[AC_REQUIRE([AC_PROG_CC])dnl
-
-# If no C compiler was specified, use CC.
-LTCC=${LTCC-"$CC"}
-
-# If no C compiler flags were specified, use CFLAGS.
-LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
-
-# Allow CC to be a program name with arguments.
-compiler=$CC
-])# _LT_AC_SYS_COMPILER
-
-
-# _LT_CC_BASENAME(CC)
-# -------------------
-# Calculate cc_basename. Skip known compiler wrappers and cross-prefix.
-AC_DEFUN([_LT_CC_BASENAME],
-[for cc_temp in $1""; do
- case $cc_temp in
- compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
- distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
- \-*) ;;
- *) break;;
- esac
-done
-cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
-])
-
-
-# _LT_COMPILER_BOILERPLATE
-# ------------------------
-# Check for compiler boilerplate output or warnings with
-# the simple compiler test code.
-AC_DEFUN([_LT_COMPILER_BOILERPLATE],
-[ac_outfile=conftest.$ac_objext
-printf "$lt_simple_compile_test_code" >conftest.$ac_ext
-eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_compiler_boilerplate=`cat conftest.err`
-$rm conftest*
-])# _LT_COMPILER_BOILERPLATE
-
-
-# _LT_LINKER_BOILERPLATE
-# ----------------------
-# Check for linker boilerplate output or warnings with
-# the simple link test code.
-AC_DEFUN([_LT_LINKER_BOILERPLATE],
-[ac_outfile=conftest.$ac_objext
-printf "$lt_simple_link_test_code" >conftest.$ac_ext
-eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_linker_boilerplate=`cat conftest.err`
-$rm conftest*
-])# _LT_LINKER_BOILERPLATE
-
-
-# _LT_AC_SYS_LIBPATH_AIX
-# ----------------------
-# Links a minimal program and checks the executable
-# for the system default hardcoded library path. In most cases,
-# this is /usr/lib:/lib, but when the MPI compilers are used
-# the location of the communication and MPI libs are included too.
-# If we don't find anything, use the default library path according
-# to the aix ld manual.
-AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX],
-[AC_LINK_IFELSE(AC_LANG_PROGRAM,[
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
-}'`
-# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
-}'`; fi],[])
-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
-])# _LT_AC_SYS_LIBPATH_AIX
-
-
-# _LT_AC_SHELL_INIT(ARG)
-# ----------------------
-AC_DEFUN([_LT_AC_SHELL_INIT],
-[ifdef([AC_DIVERSION_NOTICE],
- [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
- [AC_DIVERT_PUSH(NOTICE)])
-$1
-AC_DIVERT_POP
-])# _LT_AC_SHELL_INIT
-
-
-# _LT_AC_PROG_ECHO_BACKSLASH
-# --------------------------
-# Add some code to the start of the generated configure script which
-# will find an echo command which doesn't interpret backslashes.
-AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH],
-[_LT_AC_SHELL_INIT([
-# Check that we are running under the correct shell.
-SHELL=${CONFIG_SHELL-/bin/sh}
-
-case X$ECHO in
-X*--fallback-echo)
- # Remove one level of quotation (which was required for Make).
- ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','`
- ;;
-esac
-
-echo=${ECHO-echo}
-if test "X[$]1" = X--no-reexec; then
- # Discard the --no-reexec flag, and continue.
- shift
-elif test "X[$]1" = X--fallback-echo; then
- # Avoid inline document here, it may be left over
- :
-elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then
- # Yippee, $echo works!
- :
-else
- # Restart under the correct shell.
- exec $SHELL "[$]0" --no-reexec ${1+"[$]@"}
-fi
-
-if test "X[$]1" = X--fallback-echo; then
- # used as fallback echo
- shift
- cat <<EOF
-[$]*
-EOF
- exit 0
-fi
-
-# The HP-UX ksh and POSIX shell print the target directory to stdout
-# if CDPATH is set.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-
-if test -z "$ECHO"; then
-if test "X${echo_test_string+set}" != Xset; then
-# find a string as large as possible, as long as the shell can cope with it
- for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do
- # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
- if (echo_test_string=`eval $cmd`) 2>/dev/null &&
- echo_test_string=`eval $cmd` &&
- (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null
- then
- break
- fi
- done
-fi
-
-if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
- echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
- test "X$echo_testing_string" = "X$echo_test_string"; then
- :
-else
- # The Solaris, AIX, and Digital Unix default echo programs unquote
- # backslashes. This makes it impossible to quote backslashes using
- # echo "$something" | sed 's/\\/\\\\/g'
- #
- # So, first we look for a working echo in the user's PATH.
-
- lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
- for dir in $PATH /usr/ucb; do
- IFS="$lt_save_ifs"
- if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
- test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
- echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
- test "X$echo_testing_string" = "X$echo_test_string"; then
- echo="$dir/echo"
- break
- fi
- done
- IFS="$lt_save_ifs"
-
- if test "X$echo" = Xecho; then
- # We didn't find a better echo, so look for alternatives.
- if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
- echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` &&
- test "X$echo_testing_string" = "X$echo_test_string"; then
- # This shell has a builtin print -r that does the trick.
- echo='print -r'
- elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
- test "X$CONFIG_SHELL" != X/bin/ksh; then
- # If we have ksh, try running configure again with it.
- ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
- export ORIGINAL_CONFIG_SHELL
- CONFIG_SHELL=/bin/ksh
- export CONFIG_SHELL
- exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"}
- else
- # Try using printf.
- echo='printf %s\n'
- if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
- echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
- test "X$echo_testing_string" = "X$echo_test_string"; then
- # Cool, printf works
- :
- elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
- test "X$echo_testing_string" = 'X\t' &&
- echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
- test "X$echo_testing_string" = "X$echo_test_string"; then
- CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
- export CONFIG_SHELL
- SHELL="$CONFIG_SHELL"
- export SHELL
- echo="$CONFIG_SHELL [$]0 --fallback-echo"
- elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
- test "X$echo_testing_string" = 'X\t' &&
- echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
- test "X$echo_testing_string" = "X$echo_test_string"; then
- echo="$CONFIG_SHELL [$]0 --fallback-echo"
- else
- # maybe with a smaller string...
- prev=:
-
- for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do
- if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null
- then
- break
- fi
- prev="$cmd"
- done
-
- if test "$prev" != 'sed 50q "[$]0"'; then
- echo_test_string=`eval $prev`
- export echo_test_string
- exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"}
- else
- # Oops. We lost completely, so just stick with echo.
- echo=echo
- fi
- fi
- fi
- fi
-fi
-fi
-
-# Copy echo and quote the copy suitably for passing to libtool from
-# the Makefile, instead of quoting the original, which is used later.
-ECHO=$echo
-if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then
- ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"
-fi
-
-AC_SUBST(ECHO)
-])])# _LT_AC_PROG_ECHO_BACKSLASH
-
-
-# _LT_AC_LOCK
-# -----------
-AC_DEFUN([_LT_AC_LOCK],
-[AC_ARG_ENABLE([libtool-lock],
- [AS_HELP_STRING([--disable-libtool-lock],[avoid locking (might break parallel builds)])])
-test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
-
-# Some flags need to be propagated to the compiler or linker for good
-# libtool support.
-case $host in
-ia64-*-hpux*)
- # Find out which ABI we are using.
- echo 'int i;' > conftest.$ac_ext
- if AC_TRY_EVAL(ac_compile); then
- case `/usr/bin/file conftest.$ac_objext` in
- *ELF-32*)
- HPUX_IA64_MODE="32"
- ;;
- *ELF-64*)
- HPUX_IA64_MODE="64"
- ;;
- esac
- fi
- rm -rf conftest*
- ;;
-*-*-irix6*)
- # Find out which ABI we are using.
- echo '[#]line __oline__ "configure"' > conftest.$ac_ext
- if AC_TRY_EVAL(ac_compile); then
- if test "$lt_cv_prog_gnu_ld" = yes; then
- case `/usr/bin/file conftest.$ac_objext` in
- *32-bit*)
- LD="${LD-ld} -melf32bsmip"
- ;;
- *N32*)
- LD="${LD-ld} -melf32bmipn32"
- ;;
- *64-bit*)
- LD="${LD-ld} -melf64bmip"
- ;;
- esac
- else
- case `/usr/bin/file conftest.$ac_objext` in
- *32-bit*)
- LD="${LD-ld} -32"
- ;;
- *N32*)
- LD="${LD-ld} -n32"
- ;;
- *64-bit*)
- LD="${LD-ld} -64"
- ;;
- esac
- fi
- fi
- rm -rf conftest*
- ;;
-
-x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*)
- # Find out which ABI we are using.
- echo 'int i;' > conftest.$ac_ext
- if AC_TRY_EVAL(ac_compile); then
- case `/usr/bin/file conftest.o` in
- *32-bit*)
- case $host in
- x86_64-*linux*)
- LD="${LD-ld} -m elf_i386"
- ;;
- ppc64-*linux*|powerpc64-*linux*)
- LD="${LD-ld} -m elf32ppclinux"
- ;;
- s390x-*linux*)
- LD="${LD-ld} -m elf_s390"
- ;;
- sparc64-*linux*)
- LD="${LD-ld} -m elf32_sparc"
- ;;
- esac
- ;;
- *64-bit*)
- case $host in
- x86_64-*linux*)
- LD="${LD-ld} -m elf_x86_64"
- ;;
- ppc*-*linux*|powerpc*-*linux*)
- LD="${LD-ld} -m elf64ppc"
- ;;
- s390*-*linux*)
- LD="${LD-ld} -m elf64_s390"
- ;;
- sparc*-*linux*)
- LD="${LD-ld} -m elf64_sparc"
- ;;
- esac
- ;;
- esac
- fi
- rm -rf conftest*
- ;;
-
-*-*-sco3.2v5*)
- # On SCO OpenServer 5, we need -belf to get full-featured binaries.
- SAVE_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS -belf"
- AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
- [AC_LANG_PUSH(C)
- AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
- AC_LANG_POP])
- if test x"$lt_cv_cc_needs_belf" != x"yes"; then
- # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
- CFLAGS="$SAVE_CFLAGS"
- fi
- ;;
-sparc*-*solaris*)
- # Find out which ABI we are using.
- echo 'int i;' > conftest.$ac_ext
- if AC_TRY_EVAL(ac_compile); then
- case `/usr/bin/file conftest.o` in
- *64-bit*)
- case $lt_cv_prog_gnu_ld in
- yes*) LD="${LD-ld} -m elf64_sparc" ;;
- *) LD="${LD-ld} -64" ;;
- esac
- ;;
- esac
- fi
- rm -rf conftest*
- ;;
-
-AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
-[*-*-cygwin* | *-*-mingw* | *-*-pw32*)
- AC_CHECK_TOOL(DLLTOOL, dlltool, false)
- AC_CHECK_TOOL(AS, as, false)
- AC_CHECK_TOOL(OBJDUMP, objdump, false)
- ;;
- ])
-esac
-
-need_locks="$enable_libtool_lock"
-
-])# _LT_AC_LOCK
-
-
-# AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
-# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
-# ----------------------------------------------------------------
-# Check whether the given compiler option works
-AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION],
-[AC_REQUIRE([LT_AC_PROG_SED])
-AC_CACHE_CHECK([$1], [$2],
- [$2=no
- ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
- printf "$lt_simple_compile_test_code" > conftest.$ac_ext
- lt_compiler_flag="$3"
- # Insert the option either (1) after the last *FLAGS variable, or
- # (2) before a word containing "conftest.", or (3) at the end.
- # Note that $ac_compile itself does not contain backslashes and begins
- # with a dollar sign (not a hyphen), so the echo should work correctly.
- # The option is referenced via a variable to avoid confusing sed.
- lt_compile=`echo "$ac_compile" | $SED \
- -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
- -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
- -e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
- (eval "$lt_compile" 2>conftest.err)
- ac_status=$?
- cat conftest.err >&AS_MESSAGE_LOG_FD
- echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
- if (exit $ac_status) && test -s "$ac_outfile"; then
- # The compiler can only warn and ignore the option if not recognized
- # So say no if there are warnings other than the usual output.
- $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
- $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
- if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
- $2=yes
- fi
- fi
- $rm conftest*
-])
-
-if test x"[$]$2" = xyes; then
- ifelse([$5], , :, [$5])
-else
- ifelse([$6], , :, [$6])
-fi
-])# AC_LIBTOOL_COMPILER_OPTION
-
-
-# AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
-# [ACTION-SUCCESS], [ACTION-FAILURE])
-# ------------------------------------------------------------
-# Check whether the given compiler option works
-AC_DEFUN([AC_LIBTOOL_LINKER_OPTION],
-[AC_CACHE_CHECK([$1], [$2],
- [$2=no
- save_LDFLAGS="$LDFLAGS"
- LDFLAGS="$LDFLAGS $3"
- printf "$lt_simple_link_test_code" > conftest.$ac_ext
- if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
- # The linker can only warn and ignore the option if not recognized
- # So say no if there are warnings
- if test -s conftest.err; then
- # Append any errors to the config.log.
- cat conftest.err 1>&AS_MESSAGE_LOG_FD
- $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
- $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
- if diff conftest.exp conftest.er2 >/dev/null; then
- $2=yes
- fi
- else
- $2=yes
- fi
- fi
- $rm conftest*
- LDFLAGS="$save_LDFLAGS"
-])
-
-if test x"[$]$2" = xyes; then
- ifelse([$4], , :, [$4])
-else
- ifelse([$5], , :, [$5])
-fi
-])# AC_LIBTOOL_LINKER_OPTION
-
-
-# AC_LIBTOOL_SYS_MAX_CMD_LEN
-# --------------------------
-AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN],
-[# find the maximum length of command line arguments
-AC_MSG_CHECKING([the maximum length of command line arguments])
-AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
- i=0
- teststring="ABCD"
-
- case $build_os in
- msdosdjgpp*)
- # On DJGPP, this test can blow up pretty badly due to problems in libc
- # (any single argument exceeding 2000 bytes causes a buffer overrun
- # during glob expansion). Even if it were fixed, the result of this
- # check would be larger than it should be.
- lt_cv_sys_max_cmd_len=12288; # 12K is about right
- ;;
-
- gnu*)
- # Under GNU Hurd, this test is not required because there is
- # no limit to the length of command line arguments.
- # Libtool will interpret -1 as no limit whatsoever
- lt_cv_sys_max_cmd_len=-1;
- ;;
-
- cygwin* | mingw*)
- # On Win9x/ME, this test blows up -- it succeeds, but takes
- # about 5 minutes as the teststring grows exponentially.
- # Worse, since 9x/ME are not pre-emptively multitasking,
- # you end up with a "frozen" computer, even though with patience
- # the test eventually succeeds (with a max line length of 256k).
- # Instead, let's just punt: use the minimum linelength reported by
- # all of the supported platforms: 8192 (on NT/2K/XP).
- lt_cv_sys_max_cmd_len=8192;
- ;;
-
- amigaos*)
- # On AmigaOS with pdksh, this test takes hours, literally.
- # So we just punt and use a minimum line length of 8192.
- lt_cv_sys_max_cmd_len=8192;
- ;;
-
- netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
- # This has been around since 386BSD, at least. Likely further.
- if test -x /sbin/sysctl; then
- lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
- elif test -x /usr/sbin/sysctl; then
- lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
- else
- lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs
- fi
- # And add a safety zone
- lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
- lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
- ;;
-
- interix*)
- # We know the value 262144 and hardcode it with a safety zone (like BSD)
- lt_cv_sys_max_cmd_len=196608
- ;;
-
- osf*)
- # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
- # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
- # nice to cause kernel panics so lets avoid the loop below.
- # First set a reasonable default.
- lt_cv_sys_max_cmd_len=16384
- #
- if test -x /sbin/sysconfig; then
- case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
- *1*) lt_cv_sys_max_cmd_len=-1 ;;
- esac
- fi
- ;;
- sco3.2v5*)
- lt_cv_sys_max_cmd_len=102400
- ;;
- sysv5* | sco5v6* | sysv4.2uw2*)
- kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
- if test -n "$kargmax"; then
- lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'`
- else
- lt_cv_sys_max_cmd_len=32768
- fi
- ;;
- *)
- # If test is not a shell built-in, we'll probably end up computing a
- # maximum length that is only half of the actual maximum length, but
- # we can't tell.
- SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
- while (test "X"`$SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \
- = "XX$teststring") >/dev/null 2>&1 &&
- new_result=`expr "X$teststring" : ".*" 2>&1` &&
- lt_cv_sys_max_cmd_len=$new_result &&
- test $i != 17 # 1/2 MB should be enough
- do
- i=`expr $i + 1`
- teststring=$teststring$teststring
- done
- teststring=
- # Add a significant safety factor because C++ compilers can tack on massive
- # amounts of additional arguments before passing them to the linker.
- # It appears as though 1/2 is a usable value.
- lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
- ;;
- esac
-])
-if test -n $lt_cv_sys_max_cmd_len ; then
- AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
-else
- AC_MSG_RESULT(none)
-fi
-])# AC_LIBTOOL_SYS_MAX_CMD_LEN
-
-
-# _LT_AC_CHECK_DLFCN
-# ------------------
-AC_DEFUN([_LT_AC_CHECK_DLFCN],
-[AC_CHECK_HEADERS(dlfcn.h)dnl
-])# _LT_AC_CHECK_DLFCN
-
-
-# _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
-# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
-# ---------------------------------------------------------------------
-AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF],
-[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
-if test "$cross_compiling" = yes; then :
- [$4]
-else
- lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
- lt_status=$lt_dlunknown
- cat > conftest.$ac_ext <<EOF
-[#line __oline__ "configure"
-#include "confdefs.h"
-
-#if HAVE_DLFCN_H
-#include <dlfcn.h>
-#endif
-
-#include <stdio.h>
-
-#ifdef RTLD_GLOBAL
-# define LT_DLGLOBAL RTLD_GLOBAL
-#else
-# ifdef DL_GLOBAL
-# define LT_DLGLOBAL DL_GLOBAL
-# else
-# define LT_DLGLOBAL 0
-# endif
-#endif
-
-/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
- find out it does not work in some platform. */
-#ifndef LT_DLLAZY_OR_NOW
-# ifdef RTLD_LAZY
-# define LT_DLLAZY_OR_NOW RTLD_LAZY
-# else
-# ifdef DL_LAZY
-# define LT_DLLAZY_OR_NOW DL_LAZY
-# else
-# ifdef RTLD_NOW
-# define LT_DLLAZY_OR_NOW RTLD_NOW
-# else
-# ifdef DL_NOW
-# define LT_DLLAZY_OR_NOW DL_NOW
-# else
-# define LT_DLLAZY_OR_NOW 0
-# endif
-# endif
-# endif
-# endif
-#endif
-
-#ifdef __cplusplus
-extern "C" void exit (int);
-#endif
-
-void fnord() { int i=42;}
-int main ()
-{
- void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
- int status = $lt_dlunknown;
-
- if (self)
- {
- if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
- else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
- /* dlclose (self); */
- }
- else
- puts (dlerror ());
-
- exit (status);
-}]
-EOF
- if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
- (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
- lt_status=$?
- case x$lt_status in
- x$lt_dlno_uscore) $1 ;;
- x$lt_dlneed_uscore) $2 ;;
- x$lt_dlunknown|x*) $3 ;;
- esac
- else :
- # compilation failed
- $3
- fi
-fi
-rm -fr conftest*
-])# _LT_AC_TRY_DLOPEN_SELF
-
-
-# AC_LIBTOOL_DLOPEN_SELF
-# ----------------------
-AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF],
-[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
-if test "x$enable_dlopen" != xyes; then
- enable_dlopen=unknown
- enable_dlopen_self=unknown
- enable_dlopen_self_static=unknown
-else
- lt_cv_dlopen=no
- lt_cv_dlopen_libs=
-
- case $host_os in
- beos*)
- lt_cv_dlopen="load_add_on"
- lt_cv_dlopen_libs=
- lt_cv_dlopen_self=yes
- ;;
-
- mingw* | pw32*)
- lt_cv_dlopen="LoadLibrary"
- lt_cv_dlopen_libs=
- ;;
-
- cygwin*)
- lt_cv_dlopen="dlopen"
- lt_cv_dlopen_libs=
- ;;
-
- darwin*)
- # if libdl is installed we need to link against it
- AC_CHECK_LIB([dl], [dlopen],
- [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
- lt_cv_dlopen="dyld"
- lt_cv_dlopen_libs=
- lt_cv_dlopen_self=yes
- ])
- ;;
-
- *)
- AC_CHECK_FUNC([shl_load],
- [lt_cv_dlopen="shl_load"],
- [AC_CHECK_LIB([dld], [shl_load],
- [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"],
- [AC_CHECK_FUNC([dlopen],
- [lt_cv_dlopen="dlopen"],
- [AC_CHECK_LIB([dl], [dlopen],
- [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
- [AC_CHECK_LIB([svld], [dlopen],
- [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
- [AC_CHECK_LIB([dld], [dld_link],
- [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"])
- ])
- ])
- ])
- ])
- ])
- ;;
- esac
-
- if test "x$lt_cv_dlopen" != xno; then
- enable_dlopen=yes
- else
- enable_dlopen=no
- fi
-
- case $lt_cv_dlopen in
- dlopen)
- save_CPPFLAGS="$CPPFLAGS"
- test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
-
- save_LDFLAGS="$LDFLAGS"
- wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
-
- save_LIBS="$LIBS"
- LIBS="$lt_cv_dlopen_libs $LIBS"
-
- AC_CACHE_CHECK([whether a program can dlopen itself],
- lt_cv_dlopen_self, [dnl
- _LT_AC_TRY_DLOPEN_SELF(
- lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
- lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
- ])
-
- if test "x$lt_cv_dlopen_self" = xyes; then
- wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
- AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
- lt_cv_dlopen_self_static, [dnl
- _LT_AC_TRY_DLOPEN_SELF(
- lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
- lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross)
- ])
- fi
-
- CPPFLAGS="$save_CPPFLAGS"
- LDFLAGS="$save_LDFLAGS"
- LIBS="$save_LIBS"
- ;;
- esac
-
- case $lt_cv_dlopen_self in
- yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
- *) enable_dlopen_self=unknown ;;
- esac
-
- case $lt_cv_dlopen_self_static in
- yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
- *) enable_dlopen_self_static=unknown ;;
- esac
-fi
-])# AC_LIBTOOL_DLOPEN_SELF
-
-
-# AC_LIBTOOL_PROG_CC_C_O([TAGNAME])
-# ---------------------------------
-# Check to see if options -c and -o are simultaneously supported by compiler
-AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O],
-[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
-AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
- [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
- [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
- $rm -r conftest 2>/dev/null
- mkdir conftest
- cd conftest
- mkdir out
- printf "$lt_simple_compile_test_code" > conftest.$ac_ext
-
- lt_compiler_flag="-o out/conftest2.$ac_objext"
- # Insert the option either (1) after the last *FLAGS variable, or
- # (2) before a word containing "conftest.", or (3) at the end.
- # Note that $ac_compile itself does not contain backslashes and begins
- # with a dollar sign (not a hyphen), so the echo should work correctly.
- lt_compile=`echo "$ac_compile" | $SED \
- -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
- -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
- -e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
- (eval "$lt_compile" 2>out/conftest.err)
- ac_status=$?
- cat out/conftest.err >&AS_MESSAGE_LOG_FD
- echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
- if (exit $ac_status) && test -s out/conftest2.$ac_objext
- then
- # The compiler can only warn and ignore the option if not recognized
- # So say no if there are warnings
- $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
- $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
- if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
- _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
- fi
- fi
- chmod u+w . 2>&AS_MESSAGE_LOG_FD
- $rm conftest*
- # SGI C++ compiler will create directory out/ii_files/ for
- # template instantiation
- test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files
- $rm out/* && rmdir out
- cd ..
- rmdir conftest
- $rm conftest*
-])
-])# AC_LIBTOOL_PROG_CC_C_O
-
-
-# AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME])
-# -----------------------------------------
-# Check to see if we can do hard links to lock some files if needed
-AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS],
-[AC_REQUIRE([_LT_AC_LOCK])dnl
-
-hard_links="nottested"
-if test "$_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
- # do not overwrite the value of need_locks provided by the user
- AC_MSG_CHECKING([if we can lock with hard links])
- hard_links=yes
- $rm conftest*
- ln conftest.a conftest.b 2>/dev/null && hard_links=no
- touch conftest.a
- ln conftest.a conftest.b 2>&5 || hard_links=no
- ln conftest.a conftest.b 2>/dev/null && hard_links=no
- AC_MSG_RESULT([$hard_links])
- if test "$hard_links" = no; then
- AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
- need_locks=warn
- fi
-else
- need_locks=no
-fi
-])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS
-
-
-# AC_LIBTOOL_OBJDIR
-# -----------------
-AC_DEFUN([AC_LIBTOOL_OBJDIR],
-[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
-[rm -f .libs 2>/dev/null
-mkdir .libs 2>/dev/null
-if test -d .libs; then
- lt_cv_objdir=.libs
-else
- # MS-DOS does not allow filenames that begin with a dot.
- lt_cv_objdir=_libs
-fi
-rmdir .libs 2>/dev/null])
-objdir=$lt_cv_objdir
-])# AC_LIBTOOL_OBJDIR
-
-
-# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME])
-# ----------------------------------------------
-# Check hardcoding attributes.
-AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH],
-[AC_MSG_CHECKING([how to hardcode library paths into programs])
-_LT_AC_TAGVAR(hardcode_action, $1)=
-if test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \
- test -n "$_LT_AC_TAGVAR(runpath_var, $1)" || \
- test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
-
- # We can hardcode non-existant directories.
- if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != no &&
- # If the only mechanism to avoid hardcoding is shlibpath_var, we
- # have to relink, otherwise we might link with an installed library
- # when we should be linking with a yet-to-be-installed one
- ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
- test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then
- # Linking always hardcodes the temporary library directory.
- _LT_AC_TAGVAR(hardcode_action, $1)=relink
- else
- # We can link without hardcoding, and we can hardcode nonexisting dirs.
- _LT_AC_TAGVAR(hardcode_action, $1)=immediate
- fi
-else
- # We cannot hardcode anything, or else we can only hardcode existing
- # directories.
- _LT_AC_TAGVAR(hardcode_action, $1)=unsupported
-fi
-AC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)])
-
-if test "$_LT_AC_TAGVAR(hardcode_action, $1)" = relink; then
- # Fast installation is not supported
- enable_fast_install=no
-elif test "$shlibpath_overrides_runpath" = yes ||
- test "$enable_shared" = no; then
- # Fast installation is not necessary
- enable_fast_install=needless
-fi
-])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH
-
-
-# AC_LIBTOOL_SYS_LIB_STRIP
-# ------------------------
-AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP],
-[striplib=
-old_striplib=
-AC_MSG_CHECKING([whether stripping libraries is possible])
-if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
- test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
- test -z "$striplib" && striplib="$STRIP --strip-unneeded"
- AC_MSG_RESULT([yes])
-else
-# FIXME - insert some real tests, host_os isn't really good enough
- case $host_os in
- darwin*)
- if test -n "$STRIP" ; then
- striplib="$STRIP -x"
- AC_MSG_RESULT([yes])
- else
- AC_MSG_RESULT([no])
-fi
- ;;
- *)
- AC_MSG_RESULT([no])
- ;;
- esac
-fi
-])# AC_LIBTOOL_SYS_LIB_STRIP
-
-
-# AC_LIBTOOL_SYS_DYNAMIC_LINKER
-# -----------------------------
-# PORTME Fill in your ld.so characteristics
-AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER],
-[AC_MSG_CHECKING([dynamic linker characteristics])
-library_names_spec=
-libname_spec='lib$name'
-soname_spec=
-shrext_cmds=".so"
-postinstall_cmds=
-postuninstall_cmds=
-finish_cmds=
-finish_eval=
-shlibpath_var=
-shlibpath_overrides_runpath=unknown
-version_type=none
-dynamic_linker="$host_os ld.so"
-sys_lib_dlsearch_path_spec="/lib /usr/lib"
-if test "$GCC" = yes; then
- sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
- if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then
- # if the path contains ";" then we assume it to be the separator
- # otherwise default to the standard path separator (i.e. ":") - it is
- # assumed that no part of a normal pathname contains ";" but that should
- # okay in the real world where ";" in dirpaths is itself problematic.
- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
- else
- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
- fi
-else
- sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
-fi
-need_lib_prefix=unknown
-hardcode_into_libs=no
-
-# when you set need_version to no, make sure it does not cause -set_version
-# flags to be left without arguments
-need_version=unknown
-
-case $host_os in
-aix3*)
- version_type=linux
- library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
- shlibpath_var=LIBPATH
-
- # AIX 3 has no versioning support, so we append a major version to the name.
- soname_spec='${libname}${release}${shared_ext}$major'
- ;;
-
-aix4* | aix5*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- hardcode_into_libs=yes
- if test "$host_cpu" = ia64; then
- # AIX 5 supports IA64
- library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
- shlibpath_var=LD_LIBRARY_PATH
- else
- # With GCC up to 2.95.x, collect2 would create an import file
- # for dependence libraries. The import file would start with
- # the line `#! .'. This would cause the generated library to
- # depend on `.', always an invalid library. This was fixed in
- # development snapshots of GCC prior to 3.0.
- case $host_os in
- aix4 | aix4.[[01]] | aix4.[[01]].*)
- if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
- echo ' yes '
- echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
- :
- else
- can_build_shared=no
- fi
- ;;
- esac
- # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
- # soname into executable. Probably we can add versioning support to
- # collect2, so additional links can be useful in future.
- if test "$aix_use_runtimelinking" = yes; then
- # If using run time linking (on AIX 4.2 or later) use lib<name>.so
- # instead of lib<name>.a to let people know that these are not
- # typical AIX shared libraries.
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- else
- # We preserve .a as extension for shared libraries through AIX4.2
- # and later when we are not doing run time linking.
- library_names_spec='${libname}${release}.a $libname.a'
- soname_spec='${libname}${release}${shared_ext}$major'
- fi
- shlibpath_var=LIBPATH
- fi
- ;;
-
-amigaos*)
- library_names_spec='$libname.ixlibrary $libname.a'
- # Create ${libname}_ixlibrary.a entries in /sys/libs.
- finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
- ;;
-
-beos*)
- library_names_spec='${libname}${shared_ext}'
- dynamic_linker="$host_os ld.so"
- shlibpath_var=LIBRARY_PATH
- ;;
-
-bsdi[[45]]*)
- version_type=linux
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
- sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
- # the default ld.so.conf also contains /usr/contrib/lib and
- # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
- # libtool to hard-code these into programs
- ;;
-
-cygwin* | mingw* | pw32*)
- version_type=windows
- shrext_cmds=".dll"
- need_version=no
- need_lib_prefix=no
-
- case $GCC,$host_os in
- yes,cygwin* | yes,mingw* | yes,pw32*)
- library_names_spec='$libname.dll.a'
- # DLL is installed to $(libdir)/../bin by postinstall_cmds
- postinstall_cmds='base_file=`basename \${file}`~
- dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
- dldir=$destdir/`dirname \$dlpath`~
- test -d \$dldir || mkdir -p \$dldir~
- $install_prog $dir/$dlname \$dldir/$dlname~
- chmod a+x \$dldir/$dlname'
- postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
- dlpath=$dir/\$dldll~
- $rm \$dlpath'
- shlibpath_overrides_runpath=yes
-
- case $host_os in
- cygwin*)
- # Cygwin DLLs use 'cyg' prefix rather than 'lib'
- soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
- sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
- ;;
- mingw*)
- # MinGW DLLs use traditional 'lib' prefix
- soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
- sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
- if echo "$sys_lib_search_path_spec" | [grep ';[c-zC-Z]:/' >/dev/null]; then
- # It is most probably a Windows format PATH printed by
- # mingw gcc, but we are running on Cygwin. Gcc prints its search
- # path with ; separators, and with drive letters. We can handle the
- # drive letters (cygwin fileutils understands them), so leave them,
- # especially as we might pass files found there to a mingw objdump,
- # which wouldn't understand a cygwinified path. Ahh.
- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
- else
- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
- fi
- ;;
- pw32*)
- # pw32 DLLs use 'pw' prefix rather than 'lib'
- library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
- ;;
- esac
- ;;
-
- *)
- library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
- ;;
- esac
- dynamic_linker='Win32 ld.exe'
- # FIXME: first we should search . and the directory the executable is in
- shlibpath_var=PATH
- ;;
-
-darwin* | rhapsody*)
- dynamic_linker="$host_os dyld"
- version_type=darwin
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
- soname_spec='${libname}${release}${major}$shared_ext'
- shlibpath_overrides_runpath=yes
- shlibpath_var=DYLD_LIBRARY_PATH
- shrext_cmds='.dylib'
- # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
- if test "$GCC" = yes; then
- sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
- else
- sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
- fi
- sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
- ;;
-
-dgux*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- ;;
-
-freebsd1*)
- dynamic_linker=no
- ;;
-
-kfreebsd*-gnu)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- dynamic_linker='GNU ld.so'
- ;;
-
-freebsd* | dragonfly*)
- # DragonFly does not have aout. When/if they implement a new
- # versioning mechanism, adjust this.
- if test -x /usr/bin/objformat; then
- objformat=`/usr/bin/objformat`
- else
- case $host_os in
- freebsd[[123]]*) objformat=aout ;;
- *) objformat=elf ;;
- esac
- fi
- version_type=freebsd-$objformat
- case $version_type in
- freebsd-elf*)
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
- need_version=no
- need_lib_prefix=no
- ;;
- freebsd-*)
- library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
- need_version=yes
- ;;
- esac
- shlibpath_var=LD_LIBRARY_PATH
- case $host_os in
- freebsd2*)
- shlibpath_overrides_runpath=yes
- ;;
- freebsd3.[[01]]* | freebsdelf3.[[01]]*)
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- ;;
- freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
- freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- ;;
- freebsd*) # from 4.6 on
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- ;;
- esac
- ;;
-
-gnu*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- hardcode_into_libs=yes
- ;;
-
-hpux9* | hpux10* | hpux11*)
- # Give a soname corresponding to the major version so that dld.sl refuses to
- # link against other versions.
- version_type=sunos
- need_lib_prefix=no
- need_version=no
- case $host_cpu in
- ia64*)
- shrext_cmds='.so'
- hardcode_into_libs=yes
- dynamic_linker="$host_os dld.so"
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- if test "X$HPUX_IA64_MODE" = X32; then
- sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
- else
- sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
- fi
- sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
- ;;
- hppa*64*)
- shrext_cmds='.sl'
- hardcode_into_libs=yes
- dynamic_linker="$host_os dld.sl"
- shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
- shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
- sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
- ;;
- *)
- shrext_cmds='.sl'
- dynamic_linker="$host_os dld.sl"
- shlibpath_var=SHLIB_PATH
- shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- ;;
- esac
- # HP-UX runs *really* slowly unless shared libraries are mode 555.
- postinstall_cmds='chmod 555 $lib'
- ;;
-
-interix3*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- ;;
-
-irix5* | irix6* | nonstopux*)
- case $host_os in
- nonstopux*) version_type=nonstopux ;;
- *)
- if test "$lt_cv_prog_gnu_ld" = yes; then
- version_type=linux
- else
- version_type=irix
- fi ;;
- esac
- need_lib_prefix=no
- need_version=no
- soname_spec='${libname}${release}${shared_ext}$major'
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
- case $host_os in
- irix5* | nonstopux*)
- libsuff= shlibsuff=
- ;;
- *)
- case $LD in # libtool.m4 will add one of these switches to LD
- *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
- libsuff= shlibsuff= libmagic=32-bit;;
- *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
- libsuff=32 shlibsuff=N32 libmagic=N32;;
- *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
- libsuff=64 shlibsuff=64 libmagic=64-bit;;
- *) libsuff= shlibsuff= libmagic=never-match;;
- esac
- ;;
- esac
- shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
- shlibpath_overrides_runpath=no
- sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
- sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
- hardcode_into_libs=yes
- ;;
-
-# No shared lib support for Linux oldld, aout, or coff.
-linux*oldld* | linux*aout* | linux*coff*)
- dynamic_linker=no
- ;;
-
-# This must be Linux ELF.
-linux*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- # This implies no fast_install, which is unacceptable.
- # Some rework will be needed to allow for fast_install
- # before this can be enabled.
- hardcode_into_libs=yes
-
- # Append ld.so.conf contents to the search path
- if test -f /etc/ld.so.conf; then
- lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
- sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
- fi
-
- # We used to test for /lib/ld.so.1 and disable shared libraries on
- # powerpc, because MkLinux only supported shared libraries with the
- # GNU dynamic linker. Since this was broken with cross compilers,
- # most powerpc-linux boxes support dynamic linking these days and
- # people can always --disable-shared, the test was removed, and we
- # assume the GNU/Linux dynamic linker is in use.
- dynamic_linker='GNU/Linux ld.so'
- ;;
-
-knetbsd*-gnu)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- dynamic_linker='GNU ld.so'
- ;;
-
-netbsd*)
- version_type=sunos
- need_lib_prefix=no
- need_version=no
- if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
- dynamic_linker='NetBSD (a.out) ld.so'
- else
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- dynamic_linker='NetBSD ld.elf_so'
- fi
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- ;;
-
-newsos6)
- version_type=linux
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- ;;
-
-nto-qnx*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- ;;
-
-openbsd*)
- version_type=sunos
- sys_lib_dlsearch_path_spec="/usr/lib"
- need_lib_prefix=no
- # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
- case $host_os in
- openbsd3.3 | openbsd3.3.*) need_version=yes ;;
- *) need_version=no ;;
- esac
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
- case $host_os in
- openbsd2.[[89]] | openbsd2.[[89]].*)
- shlibpath_overrides_runpath=no
- ;;
- *)
- shlibpath_overrides_runpath=yes
- ;;
- esac
- else
- shlibpath_overrides_runpath=yes
- fi
- ;;
-
-os2*)
- libname_spec='$name'
- shrext_cmds=".dll"
- need_lib_prefix=no
- library_names_spec='$libname${shared_ext} $libname.a'
- dynamic_linker='OS/2 ld.exe'
- shlibpath_var=LIBPATH
- ;;
-
-osf3* | osf4* | osf5*)
- version_type=osf
- need_lib_prefix=no
- need_version=no
- soname_spec='${libname}${release}${shared_ext}$major'
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- shlibpath_var=LD_LIBRARY_PATH
- sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
- sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
- ;;
-
-solaris*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- # ldd complains unless libraries are executable
- postinstall_cmds='chmod +x $lib'
- ;;
-
-sunos4*)
- version_type=sunos
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
- finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- if test "$with_gnu_ld" = yes; then
- need_lib_prefix=no
- fi
- need_version=yes
- ;;
-
-sysv4 | sysv4.3*)
- version_type=linux
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- case $host_vendor in
- sni)
- shlibpath_overrides_runpath=no
- need_lib_prefix=no
- export_dynamic_flag_spec='${wl}-Blargedynsym'
- runpath_var=LD_RUN_PATH
- ;;
- siemens)
- need_lib_prefix=no
- ;;
- motorola)
- need_lib_prefix=no
- need_version=no
- shlibpath_overrides_runpath=no
- sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
- ;;
- esac
- ;;
-
-sysv4*MP*)
- if test -d /usr/nec ;then
- version_type=linux
- library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
- soname_spec='$libname${shared_ext}.$major'
- shlibpath_var=LD_LIBRARY_PATH
- fi
- ;;
-
-sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
- version_type=freebsd-elf
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- hardcode_into_libs=yes
- if test "$with_gnu_ld" = yes; then
- sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
- shlibpath_overrides_runpath=no
- else
- sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
- shlibpath_overrides_runpath=yes
- case $host_os in
- sco3.2v5*)
- sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
- ;;
- esac
- fi
- sys_lib_dlsearch_path_spec='/usr/lib'
- ;;
-
-uts4*)
- version_type=linux
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- ;;
-
-*)
- dynamic_linker=no
- ;;
-esac
-AC_MSG_RESULT([$dynamic_linker])
-test "$dynamic_linker" = no && can_build_shared=no
-
-variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
-if test "$GCC" = yes; then
- variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
-fi
-])# AC_LIBTOOL_SYS_DYNAMIC_LINKER
-
-
-# _LT_AC_TAGCONFIG
-# ----------------
-AC_DEFUN([_LT_AC_TAGCONFIG],
-[AC_ARG_WITH([tags],
- [AS_HELP_STRING([--with-tags@<:@=TAGS@:>@],[include additional configurations @<:@automatic@:>@])],
- [tagnames="$withval"])
-
-if test -f "$ltmain" && test -n "$tagnames"; then
- if test ! -f "${ofile}"; then
- AC_MSG_WARN([output file `$ofile' does not exist])
- fi
-
- if test -z "$LTCC"; then
- eval "`$SHELL ${ofile} --config | grep '^LTCC='`"
- if test -z "$LTCC"; then
- AC_MSG_WARN([output file `$ofile' does not look like a libtool script])
- else
- AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile'])
- fi
- fi
- if test -z "$LTCFLAGS"; then
- eval "`$SHELL ${ofile} --config | grep '^LTCFLAGS='`"
- fi
-
- # Extract list of available tagged configurations in $ofile.
- # Note that this assumes the entire list is on one line.
- available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'`
-
- lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
- for tagname in $tagnames; do
- IFS="$lt_save_ifs"
- # Check whether tagname contains only valid characters
- case `$echo "X$tagname" | $Xsed -e 's:[[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]]::g'` in
- "") ;;
- *) AC_MSG_ERROR([invalid tag name: $tagname])
- ;;
- esac
-
- if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null
- then
- AC_MSG_ERROR([tag name "$tagname" already exists])
- fi
-
- # Update the list of available tags.
- if test -n "$tagname"; then
- echo appending configuration tag \"$tagname\" to $ofile
-
- case $tagname in
- CXX)
- if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
- ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
- (test "X$CXX" != "Xg++"))) ; then
- AC_LIBTOOL_LANG_CXX_CONFIG
- else
- tagname=""
- fi
- ;;
-
- F77)
- if test -n "$F77" && test "X$F77" != "Xno"; then
- AC_LIBTOOL_LANG_F77_CONFIG
- else
- tagname=""
- fi
- ;;
-
- GCJ)
- if test -n "$GCJ" && test "X$GCJ" != "Xno"; then
- AC_LIBTOOL_LANG_GCJ_CONFIG
- else
- tagname=""
- fi
- ;;
-
- RC)
- AC_LIBTOOL_LANG_RC_CONFIG
- ;;
-
- *)
- AC_MSG_ERROR([Unsupported tag name: $tagname])
- ;;
- esac
-
- # Append the new tag name to the list of available tags.
- if test -n "$tagname" ; then
- available_tags="$available_tags $tagname"
- fi
- fi
- done
- IFS="$lt_save_ifs"
-
- # Now substitute the updated list of available tags.
- if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then
- mv "${ofile}T" "$ofile"
- chmod +x "$ofile"
- else
- rm -f "${ofile}T"
- AC_MSG_ERROR([unable to update list of available tagged configurations.])
- fi
-fi
-])# _LT_AC_TAGCONFIG
-
-
-# AC_LIBTOOL_DLOPEN
-# -----------------
-# enable checks for dlopen support
-AC_DEFUN([AC_LIBTOOL_DLOPEN],
- [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])
-])# AC_LIBTOOL_DLOPEN
-
-
-# AC_LIBTOOL_WIN32_DLL
-# --------------------
-# declare package support for building win32 DLLs
-AC_DEFUN([AC_LIBTOOL_WIN32_DLL],
-[AC_BEFORE([$0], [AC_LIBTOOL_SETUP])
-])# AC_LIBTOOL_WIN32_DLL
-
-
-# AC_ENABLE_SHARED([DEFAULT])
-# ---------------------------
-# implement the --enable-shared flag
-# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
-AC_DEFUN([AC_ENABLE_SHARED],
-[define([enable_shared_default], ifelse($1, no, no, yes))dnl
-AC_ARG_ENABLE([shared],
- AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],[build shared libraries @<:@default=enable_shared_default@:>@]),
- [p=${PACKAGE-default}
- case $enableval in
- yes) enable_shared=yes ;;
- no) enable_shared=no ;;
- *)
- enable_shared=no
- # Look at the argument we got. We use all the common list separators.
- lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
- for pkg in $enableval; do
- IFS="$lt_save_ifs"
- if test "X$pkg" = "X$p"; then
- enable_shared=yes
- fi
- done
- IFS="$lt_save_ifs"
- ;;
- esac],
- [enable_shared=]enable_shared_default)
-])# AC_ENABLE_SHARED
-
-
-# AC_DISABLE_SHARED
-# -----------------
-# set the default shared flag to --disable-shared
-AC_DEFUN([AC_DISABLE_SHARED],
-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
-AC_ENABLE_SHARED(no)
-])# AC_DISABLE_SHARED
-
-
-# AC_ENABLE_STATIC([DEFAULT])
-# ---------------------------
-# implement the --enable-static flag
-# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
-AC_DEFUN([AC_ENABLE_STATIC],
-[define([enable_static_default], ifelse($1, no, no, yes))dnl
-AC_ARG_ENABLE([static],
- AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],[build static libraries @<:@default=enable_static_default@:>@]),
- [p=${PACKAGE-default}
- case $enableval in
- yes) enable_static=yes ;;
- no) enable_static=no ;;
- *)
- enable_static=no
- # Look at the argument we got. We use all the common list separators.
- lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
- for pkg in $enableval; do
- IFS="$lt_save_ifs"
- if test "X$pkg" = "X$p"; then
- enable_static=yes
- fi
- done
- IFS="$lt_save_ifs"
- ;;
- esac],
- [enable_static=]enable_static_default)
-])# AC_ENABLE_STATIC
-
-
-# AC_DISABLE_STATIC
-# -----------------
-# set the default static flag to --disable-static
-AC_DEFUN([AC_DISABLE_STATIC],
-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
-AC_ENABLE_STATIC(no)
-])# AC_DISABLE_STATIC
-
-
-# AC_ENABLE_FAST_INSTALL([DEFAULT])
-# ---------------------------------
-# implement the --enable-fast-install flag
-# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
-AC_DEFUN([AC_ENABLE_FAST_INSTALL],
-[define([enable_Fast_install_default], ifelse($1, no, no, yes))dnl
-AC_ARG_ENABLE([fast-install],
- AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],[optimize for fast installation @<:@default=enable_Fast_install_default@:>@]),
- [p=${PACKAGE-default}
- case $enableval in
- yes) enable_fast_install=yes ;;
- no) enable_fast_install=no ;;
- *)
- enable_fast_install=no
- # Look at the argument we got. We use all the common list separators.
- lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
- for pkg in $enableval; do
- IFS="$lt_save_ifs"
- if test "X$pkg" = "X$p"; then
- enable_fast_install=yes
- fi
- done
- IFS="$lt_save_ifs"
- ;;
- esac],
- [enable_fast_install=]enable_Fast_install_default)
-])# AC_ENABLE_FAST_INSTALL
-
-
-# AC_DISABLE_FAST_INSTALL
-# -----------------------
-# set the default to --disable-fast-install
-AC_DEFUN([AC_DISABLE_FAST_INSTALL],
-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
-AC_ENABLE_FAST_INSTALL(no)
-])# AC_DISABLE_FAST_INSTALL
-
-
-# AC_LIBTOOL_PICMODE([MODE])
-# --------------------------
-# implement the --with-pic flag
-# MODE is either `yes' or `no'. If omitted, it defaults to `both'.
-AC_DEFUN([AC_LIBTOOL_PICMODE],
-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
-pic_mode=ifelse($#,1,$1,default)
-])# AC_LIBTOOL_PICMODE
-
-
-# AC_PROG_EGREP
-# -------------
-# This is predefined starting with Autoconf 2.54, so this conditional
-# definition can be removed once we require Autoconf 2.54 or later.
-m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP],
-[AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep],
- [if echo a | (grep -E '(a|b)') >/dev/null 2>&1
- then ac_cv_prog_egrep='grep -E'
- else ac_cv_prog_egrep='egrep'
- fi])
- EGREP=$ac_cv_prog_egrep
- AC_SUBST([EGREP])
-])])
-
-
-# AC_PATH_TOOL_PREFIX
-# -------------------
-# find a file program which can recognise shared library
-AC_DEFUN([AC_PATH_TOOL_PREFIX],
-[AC_REQUIRE([AC_PROG_EGREP])dnl
-AC_MSG_CHECKING([for $1])
-AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
-[case $MAGIC_CMD in
-[[\\/*] | ?:[\\/]*])
- lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
- ;;
-*)
- lt_save_MAGIC_CMD="$MAGIC_CMD"
- lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
-dnl $ac_dummy forces splitting on constant user-supplied paths.
-dnl POSIX.2 word splitting is done only on the output of word expansions,
-dnl not every word. This closes a longstanding sh security hole.
- ac_dummy="ifelse([$2], , $PATH, [$2])"
- for ac_dir in $ac_dummy; do
- IFS="$lt_save_ifs"
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$1; then
- lt_cv_path_MAGIC_CMD="$ac_dir/$1"
- if test -n "$file_magic_test_file"; then
- case $deplibs_check_method in
- "file_magic "*)
- file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
- MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
- if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
- $EGREP "$file_magic_regex" > /dev/null; then
- :
- else
- cat <<EOF 1>&2
-
-*** Warning: the command libtool uses to detect shared libraries,
-*** $file_magic_cmd, produces output that libtool cannot recognize.
-*** The result is that libtool may fail to recognize shared libraries
-*** as such. This will affect the creation of libtool libraries that
-*** depend on shared libraries, but programs linked with such libtool
-*** libraries will work regardless of this problem. Nevertheless, you
-*** may want to report the problem to your system manager and/or to
-*** bug-libtool@gnu.org
-
-EOF
- fi ;;
- esac
- fi
- break
- fi
- done
- IFS="$lt_save_ifs"
- MAGIC_CMD="$lt_save_MAGIC_CMD"
- ;;
-esac])
-MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
-if test -n "$MAGIC_CMD"; then
- AC_MSG_RESULT($MAGIC_CMD)
-else
- AC_MSG_RESULT(no)
-fi
-])# AC_PATH_TOOL_PREFIX
-
-
-# AC_PATH_MAGIC
-# -------------
-# find a file program which can recognise a shared library
-AC_DEFUN([AC_PATH_MAGIC],
-[AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
-if test -z "$lt_cv_path_MAGIC_CMD"; then
- if test -n "$ac_tool_prefix"; then
- AC_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
- else
- MAGIC_CMD=:
- fi
-fi
-])# AC_PATH_MAGIC
-
-
-# AC_PROG_LD
-# ----------
-# find the pathname to the GNU or non-GNU linker
-AC_DEFUN([AC_PROG_LD],
-[AC_ARG_WITH([gnu-ld],
- [AS_HELP_STRING([--with-gnu-ld],[assume the C compiler uses GNU ld @<:@default=no@:>@])],
- [test "$withval" = no || with_gnu_ld=yes],
- [with_gnu_ld=no])
-AC_REQUIRE([LT_AC_PROG_SED])dnl
-AC_REQUIRE([AC_PROG_CC])dnl
-AC_REQUIRE([AC_CANONICAL_HOST])dnl
-AC_REQUIRE([AC_CANONICAL_BUILD])dnl
-ac_prog=ld
-if test "$GCC" = yes; then
- # Check if gcc -print-prog-name=ld gives a path.
- AC_MSG_CHECKING([for ld used by $CC])
- case $host in
- *-*-mingw*)
- # gcc leaves a trailing carriage return which upsets mingw
- ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
- *)
- ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
- esac
- case $ac_prog in
- # Accept absolute paths.
- [[\\/]]* | ?:[[\\/]]*)
- re_direlt='/[[^/]][[^/]]*/\.\./'
- # Canonicalize the pathname of ld
- ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'`
- while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
- ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"`
- done
- test -z "$LD" && LD="$ac_prog"
- ;;
- "")
- # If it fails, then pretend we aren't using GCC.
- ac_prog=ld
- ;;
- *)
- # If it is relative, then search for the first ld in PATH.
- with_gnu_ld=unknown
- ;;
- esac
-elif test "$with_gnu_ld" = yes; then
- AC_MSG_CHECKING([for GNU ld])
-else
- AC_MSG_CHECKING([for non-GNU ld])
-fi
-AC_CACHE_VAL(lt_cv_path_LD,
-[if test -z "$LD"; then
- lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
- for ac_dir in $PATH; do
- IFS="$lt_save_ifs"
- test -z "$ac_dir" && ac_dir=.
- if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
- lt_cv_path_LD="$ac_dir/$ac_prog"
- # Check to see if the program is GNU ld. I'd rather use --version,
- # but apparently some variants of GNU ld only accept -v.
- # Break only if it was the GNU/non-GNU ld that we prefer.
- case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
- *GNU* | *'with BFD'*)
- test "$with_gnu_ld" != no && break
- ;;
- *)
- test "$with_gnu_ld" != yes && break
- ;;
- esac
- fi
- done
- IFS="$lt_save_ifs"
-else
- lt_cv_path_LD="$LD" # Let the user override the test with a path.
-fi])
-LD="$lt_cv_path_LD"
-if test -n "$LD"; then
- AC_MSG_RESULT($LD)
-else
- AC_MSG_RESULT(no)
-fi
-test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
-AC_PROG_LD_GNU
-])# AC_PROG_LD
-
-
-# AC_PROG_LD_GNU
-# --------------
-AC_DEFUN([AC_PROG_LD_GNU],
-[AC_REQUIRE([AC_PROG_EGREP])dnl
-AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
-[# I'd rather use --version here, but apparently some GNU lds only accept -v.
-case `$LD -v 2>&1 </dev/null` in
-*GNU* | *'with BFD'*)
- lt_cv_prog_gnu_ld=yes
- ;;
-*)
- lt_cv_prog_gnu_ld=no
- ;;
-esac])
-with_gnu_ld=$lt_cv_prog_gnu_ld
-])# AC_PROG_LD_GNU
-
-
-# AC_PROG_LD_RELOAD_FLAG
-# ----------------------
-# find reload flag for linker
-# -- PORTME Some linkers may need a different reload flag.
-AC_DEFUN([AC_PROG_LD_RELOAD_FLAG],
-[AC_CACHE_CHECK([for $LD option to reload object files],
- lt_cv_ld_reload_flag,
- [lt_cv_ld_reload_flag='-r'])
-reload_flag=$lt_cv_ld_reload_flag
-case $reload_flag in
-"" | " "*) ;;
-*) reload_flag=" $reload_flag" ;;
-esac
-reload_cmds='$LD$reload_flag -o $output$reload_objs'
-case $host_os in
- darwin*)
- if test "$GCC" = yes; then
- reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r $compiler_flags -o $output$reload_objs'
- else
- reload_cmds='$LD$reload_flag -o $output$reload_objs'
- fi
- ;;
-esac
-])# AC_PROG_LD_RELOAD_FLAG
-
-
-# AC_DEPLIBS_CHECK_METHOD
-# -----------------------
-# how to check for library dependencies
-# -- PORTME fill in with the dynamic library characteristics
-AC_DEFUN([AC_DEPLIBS_CHECK_METHOD],
-[AC_CACHE_CHECK([how to recognise dependent libraries],
-lt_cv_deplibs_check_method,
-[lt_cv_file_magic_cmd='$MAGIC_CMD'
-lt_cv_file_magic_test_file=
-lt_cv_deplibs_check_method='unknown'
-# Need to set the preceding variable on all platforms that support
-# interlibrary dependencies.
-# 'none' -- dependencies not supported.
-# `unknown' -- same as none, but documents that we really don't know.
-# 'pass_all' -- all dependencies passed with no checks.
-# 'test_compile' -- check by making test program.
-# 'file_magic [[regex]]' -- check by looking for files in library path
-# which responds to the $file_magic_cmd with a given extended regex.
-# If you have `file' or equivalent on your system and you're not sure
-# whether `pass_all' will *always* work, you probably want this one.
-
-case $host_os in
-aix4* | aix5*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-beos*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-bsdi[[45]]*)
- lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
- lt_cv_file_magic_cmd='/usr/bin/file -L'
- lt_cv_file_magic_test_file=/shlib/libc.so
- ;;
-
-cygwin*)
- # func_win32_libid is a shell function defined in ltmain.sh
- lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
- lt_cv_file_magic_cmd='func_win32_libid'
- ;;
-
-mingw* | pw32*)
- # Base MSYS/MinGW do not provide the 'file' command needed by
- # func_win32_libid shell function, so use a weaker test based on 'objdump'.
- lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
- lt_cv_file_magic_cmd='$OBJDUMP -f'
- ;;
-
-darwin* | rhapsody*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-freebsd* | kfreebsd*-gnu | dragonfly*)
- if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
- case $host_cpu in
- i*86 )
- # Not sure whether the presence of OpenBSD here was a mistake.
- # Let's accept both of them until this is cleared up.
- lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
- lt_cv_file_magic_cmd=/usr/bin/file
- lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
- ;;
- esac
- else
- lt_cv_deplibs_check_method=pass_all
- fi
- ;;
-
-gnu*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-hpux10.20* | hpux11*)
- lt_cv_file_magic_cmd=/usr/bin/file
- case $host_cpu in
- ia64*)
- lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
- lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
- ;;
- hppa*64*)
- [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]']
- lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
- ;;
- *)
- lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library'
- lt_cv_file_magic_test_file=/usr/lib/libc.sl
- ;;
- esac
- ;;
-
-interix3*)
- # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
- lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
- ;;
-
-irix5* | irix6* | nonstopux*)
- case $LD in
- *-32|*"-32 ") libmagic=32-bit;;
- *-n32|*"-n32 ") libmagic=N32;;
- *-64|*"-64 ") libmagic=64-bit;;
- *) libmagic=never-match;;
- esac
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-# This must be Linux ELF.
-linux*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-netbsd*)
- if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
- lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
- else
- lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
- fi
- ;;
-
-newos6*)
- lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
- lt_cv_file_magic_cmd=/usr/bin/file
- lt_cv_file_magic_test_file=/usr/lib/libnls.so
- ;;
-
-nto-qnx*)
- lt_cv_deplibs_check_method=unknown
- ;;
-
-openbsd*)
- if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
- lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
- else
- lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
- fi
- ;;
-
-osf3* | osf4* | osf5*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-solaris*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-sysv4 | sysv4.3*)
- case $host_vendor in
- motorola)
- lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]'
- lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
- ;;
- ncr)
- lt_cv_deplibs_check_method=pass_all
- ;;
- sequent)
- lt_cv_file_magic_cmd='/bin/file'
- lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
- ;;
- sni)
- lt_cv_file_magic_cmd='/bin/file'
- lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
- lt_cv_file_magic_test_file=/lib/libc.so
- ;;
- siemens)
- lt_cv_deplibs_check_method=pass_all
- ;;
- pc)
- lt_cv_deplibs_check_method=pass_all
- ;;
- esac
- ;;
-
-sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-esac
-])
-file_magic_cmd=$lt_cv_file_magic_cmd
-deplibs_check_method=$lt_cv_deplibs_check_method
-test -z "$deplibs_check_method" && deplibs_check_method=unknown
-])# AC_DEPLIBS_CHECK_METHOD
-
-
-# AC_PROG_NM
-# ----------
-# find the pathname to a BSD-compatible name lister
-AC_DEFUN([AC_PROG_NM],
-[AC_CACHE_CHECK([for BSD-compatible nm], lt_cv_path_NM,
-[if test -n "$NM"; then
- # Let the user override the test.
- lt_cv_path_NM="$NM"
-else
- lt_nm_to_check="${ac_tool_prefix}nm"
- if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
- lt_nm_to_check="$lt_nm_to_check nm"
- fi
- for lt_tmp_nm in $lt_nm_to_check; do
- lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
- for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
- IFS="$lt_save_ifs"
- test -z "$ac_dir" && ac_dir=.
- tmp_nm="$ac_dir/$lt_tmp_nm"
- if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
- # Check to see if the nm accepts a BSD-compat flag.
- # Adding the `sed 1q' prevents false positives on HP-UX, which says:
- # nm: unknown option "B" ignored
- # Tru64's nm complains that /dev/null is an invalid object file
- case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
- */dev/null* | *'Invalid file or object type'*)
- lt_cv_path_NM="$tmp_nm -B"
- break
- ;;
- *)
- case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
- */dev/null*)
- lt_cv_path_NM="$tmp_nm -p"
- break
- ;;
- *)
- lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
- continue # so that we can try to find one that supports BSD flags
- ;;
- esac
- ;;
- esac
- fi
- done
- IFS="$lt_save_ifs"
- done
- test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
-fi])
-NM="$lt_cv_path_NM"
-])# AC_PROG_NM
-
-
-# AC_CHECK_LIBM
-# -------------
-# check for math library
-AC_DEFUN([AC_CHECK_LIBM],
-[AC_REQUIRE([AC_CANONICAL_HOST])dnl
-LIBM=
-case $host in
-*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*)
- # These system don't have libm, or don't need it
- ;;
-*-ncr-sysv4.3*)
- AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
- AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
- ;;
-*)
- AC_CHECK_LIB(m, cos, LIBM="-lm")
- ;;
-esac
-])# AC_CHECK_LIBM
-
-
-# AC_LIBLTDL_CONVENIENCE([DIRECTORY])
-# -----------------------------------
-# sets LIBLTDL to the link flags for the libltdl convenience library and
-# LTDLINCL to the include flags for the libltdl header and adds
-# --enable-ltdl-convenience to the configure arguments. Note that
-# AC_CONFIG_SUBDIRS is not called here. If DIRECTORY is not provided,
-# it is assumed to be `libltdl'. LIBLTDL will be prefixed with
-# '${top_builddir}/' and LTDLINCL will be prefixed with '${top_srcdir}/'
-# (note the single quotes!). If your package is not flat and you're not
-# using automake, define top_builddir and top_srcdir appropriately in
-# the Makefiles.
-AC_DEFUN([AC_LIBLTDL_CONVENIENCE],
-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
- case $enable_ltdl_convenience in
- no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
- "") enable_ltdl_convenience=yes
- ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
- esac
- LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
- LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
- # For backwards non-gettext consistent compatibility...
- INCLTDL="$LTDLINCL"
-])# AC_LIBLTDL_CONVENIENCE
-
-
-# AC_LIBLTDL_INSTALLABLE([DIRECTORY])
-# -----------------------------------
-# sets LIBLTDL to the link flags for the libltdl installable library and
-# LTDLINCL to the include flags for the libltdl header and adds
-# --enable-ltdl-install to the configure arguments. Note that
-# AC_CONFIG_SUBDIRS is not called here. If DIRECTORY is not provided,
-# and an installed libltdl is not found, it is assumed to be `libltdl'.
-# LIBLTDL will be prefixed with '${top_builddir}/'# and LTDLINCL with
-# '${top_srcdir}/' (note the single quotes!). If your package is not
-# flat and you're not using automake, define top_builddir and top_srcdir
-# appropriately in the Makefiles.
-# In the future, this macro may have to be called after AC_PROG_LIBTOOL.
-AC_DEFUN([AC_LIBLTDL_INSTALLABLE],
-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
- AC_CHECK_LIB(ltdl, lt_dlinit,
- [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
- [if test x"$enable_ltdl_install" = xno; then
- AC_MSG_WARN([libltdl not installed, but installation disabled])
- else
- enable_ltdl_install=yes
- fi
- ])
- if test x"$enable_ltdl_install" = x"yes"; then
- ac_configure_args="$ac_configure_args --enable-ltdl-install"
- LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la
- LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
- else
- ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
- LIBLTDL="-lltdl"
- LTDLINCL=
- fi
- # For backwards non-gettext consistent compatibility...
- INCLTDL="$LTDLINCL"
-])# AC_LIBLTDL_INSTALLABLE
-
-
-# AC_LIBTOOL_CXX
-# --------------
-# enable support for C++ libraries
-AC_DEFUN([AC_LIBTOOL_CXX],
-[AC_REQUIRE([_LT_AC_LANG_CXX])
-])# AC_LIBTOOL_CXX
-
-
-# _LT_AC_LANG_CXX
-# ---------------
-AC_DEFUN([_LT_AC_LANG_CXX],
-[AC_REQUIRE([AC_PROG_CXX])
-AC_REQUIRE([_LT_AC_PROG_CXXCPP])
-_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}CXX])
-])# _LT_AC_LANG_CXX
-
-# _LT_AC_PROG_CXXCPP
-# ------------------
-AC_DEFUN([_LT_AC_PROG_CXXCPP],
-[
-AC_REQUIRE([AC_PROG_CXX])
-if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
- ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
- (test "X$CXX" != "Xg++"))) ; then
- AC_PROG_CXXCPP
-fi
-])# _LT_AC_PROG_CXXCPP
-
-# AC_LIBTOOL_F77
-# --------------
-# enable support for Fortran 77 libraries
-AC_DEFUN([AC_LIBTOOL_F77],
-[AC_REQUIRE([_LT_AC_LANG_F77])
-])# AC_LIBTOOL_F77
-
-
-# _LT_AC_LANG_F77
-# ---------------
-AC_DEFUN([_LT_AC_LANG_F77],
-[AC_REQUIRE([AC_PROG_F77])
-_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}F77])
-])# _LT_AC_LANG_F77
-
-
-# AC_LIBTOOL_GCJ
-# --------------
-# enable support for GCJ libraries
-AC_DEFUN([AC_LIBTOOL_GCJ],
-[AC_REQUIRE([_LT_AC_LANG_GCJ])
-])# AC_LIBTOOL_GCJ
-
-
-# _LT_AC_LANG_GCJ
-# ---------------
-AC_DEFUN([_LT_AC_LANG_GCJ],
-[AC_PROVIDE_IFELSE([AC_PROG_GCJ],[],
- [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[],
- [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[],
- [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])],
- [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])],
- [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])])
-_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}GCJ])
-])# _LT_AC_LANG_GCJ
-
-
-# AC_LIBTOOL_RC
-# -------------
-# enable support for Windows resource files
-AC_DEFUN([AC_LIBTOOL_RC],
-[AC_REQUIRE([LT_AC_PROG_RC])
-_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}RC])
-])# AC_LIBTOOL_RC
-
-
-# AC_LIBTOOL_LANG_C_CONFIG
-# ------------------------
-# Ensure that the configuration vars for the C compiler are
-# suitably defined. Those variables are subsequently used by
-# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
-AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG], [_LT_AC_LANG_C_CONFIG])
-AC_DEFUN([_LT_AC_LANG_C_CONFIG],
-[lt_save_CC="$CC"
-AC_LANG_PUSH(C)
-
-# Source file extension for C test sources.
-ac_ext=c
-
-# Object file extension for compiled C test sources.
-objext=o
-_LT_AC_TAGVAR(objext, $1)=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code="int some_variable = 0;\n"
-
-# Code to be used in simple link tests
-lt_simple_link_test_code='int main(){return(0);}\n'
-
-_LT_AC_SYS_COMPILER
-
-# save warnings/boilerplate of simple test code
-_LT_COMPILER_BOILERPLATE
-_LT_LINKER_BOILERPLATE
-
-## CAVEAT EMPTOR:
-## There is no encapsulation within the following macros, do not change
-## the running order or otherwise move them around unless you know exactly
-## what you are doing...
-AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1)
-AC_LIBTOOL_PROG_COMPILER_PIC($1)
-AC_LIBTOOL_PROG_CC_C_O($1)
-AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
-AC_LIBTOOL_PROG_LD_SHLIBS($1)
-AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
-AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
-AC_LIBTOOL_SYS_LIB_STRIP
-AC_LIBTOOL_DLOPEN_SELF
-
-# Report which library types will actually be built
-AC_MSG_CHECKING([if libtool supports shared libraries])
-AC_MSG_RESULT([$can_build_shared])
-
-AC_MSG_CHECKING([whether to build shared libraries])
-test "$can_build_shared" = "no" && enable_shared=no
-
-# On AIX, shared libraries and static libraries use the same namespace, and
-# are all built from PIC.
-case $host_os in
-aix3*)
- test "$enable_shared" = yes && enable_static=no
- if test -n "$RANLIB"; then
- archive_cmds="$archive_cmds~\$RANLIB \$lib"
- postinstall_cmds='$RANLIB $lib'
- fi
- ;;
-
-aix4* | aix5*)
- if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
- test "$enable_shared" = yes && enable_static=no
- fi
- ;;
-esac
-AC_MSG_RESULT([$enable_shared])
-
-AC_MSG_CHECKING([whether to build static libraries])
-# Make sure either enable_shared or enable_static is yes.
-test "$enable_shared" = yes || enable_static=yes
-AC_MSG_RESULT([$enable_static])
-
-AC_LIBTOOL_CONFIG($1)
-
-AC_LANG_POP
-CC="$lt_save_CC"
-])# AC_LIBTOOL_LANG_C_CONFIG
-
-
-# AC_LIBTOOL_LANG_CXX_CONFIG
-# --------------------------
-# Ensure that the configuration vars for the C compiler are
-# suitably defined. Those variables are subsequently used by
-# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
-AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)])
-AC_DEFUN([_LT_AC_LANG_CXX_CONFIG],
-[AC_LANG_PUSH(C++)
-AC_REQUIRE([AC_PROG_CXX])
-AC_REQUIRE([_LT_AC_PROG_CXXCPP])
-
-_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
-_LT_AC_TAGVAR(allow_undefined_flag, $1)=
-_LT_AC_TAGVAR(always_export_symbols, $1)=no
-_LT_AC_TAGVAR(archive_expsym_cmds, $1)=
-_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
-_LT_AC_TAGVAR(hardcode_direct, $1)=no
-_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
-_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
-_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
-_LT_AC_TAGVAR(hardcode_minus_L, $1)=no
-_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
-_LT_AC_TAGVAR(hardcode_automatic, $1)=no
-_LT_AC_TAGVAR(module_cmds, $1)=
-_LT_AC_TAGVAR(module_expsym_cmds, $1)=
-_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
-_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
-_LT_AC_TAGVAR(no_undefined_flag, $1)=
-_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
-_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
-
-# Dependencies to place before and after the object being linked:
-_LT_AC_TAGVAR(predep_objects, $1)=
-_LT_AC_TAGVAR(postdep_objects, $1)=
-_LT_AC_TAGVAR(predeps, $1)=
-_LT_AC_TAGVAR(postdeps, $1)=
-_LT_AC_TAGVAR(compiler_lib_search_path, $1)=
-
-# Source file extension for C++ test sources.
-ac_ext=cpp
-
-# Object file extension for compiled C++ test sources.
-objext=o
-_LT_AC_TAGVAR(objext, $1)=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code="int some_variable = 0;\n"
-
-# Code to be used in simple link tests
-lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }\n'
-
-# ltmain only uses $CC for tagged configurations so make sure $CC is set.
-_LT_AC_SYS_COMPILER
-
-# save warnings/boilerplate of simple test code
-_LT_COMPILER_BOILERPLATE
-_LT_LINKER_BOILERPLATE
-
-# Allow CC to be a program name with arguments.
-lt_save_CC=$CC
-lt_save_LD=$LD
-lt_save_GCC=$GCC
-GCC=$GXX
-lt_save_with_gnu_ld=$with_gnu_ld
-lt_save_path_LD=$lt_cv_path_LD
-if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
- lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
-else
- $as_unset lt_cv_prog_gnu_ld
-fi
-if test -n "${lt_cv_path_LDCXX+set}"; then
- lt_cv_path_LD=$lt_cv_path_LDCXX
-else
- $as_unset lt_cv_path_LD
-fi
-test -z "${LDCXX+set}" || LD=$LDCXX
-CC=${CXX-"c++"}
-compiler=$CC
-_LT_AC_TAGVAR(compiler, $1)=$CC
-_LT_CC_BASENAME([$compiler])
-
-# We don't want -fno-exception wen compiling C++ code, so set the
-# no_builtin_flag separately
-if test "$GXX" = yes; then
- _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
-else
- _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
-fi
-
-if test "$GXX" = yes; then
- # Set up default GNU C++ configuration
-
- AC_PROG_LD
-
- # Check if GNU C++ uses GNU ld as the underlying linker, since the
- # archiving commands below assume that GNU ld is being used.
- if test "$with_gnu_ld" = yes; then
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
-
- # If archive_cmds runs LD, not CC, wlarc should be empty
- # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
- # investigate it a little bit more. (MM)
- wlarc='${wl}'
-
- # ancient GNU ld didn't support --whole-archive et. al.
- if eval "`$CC -print-prog-name=ld` --help 2>&1" | \
- grep 'no-whole-archive' > /dev/null; then
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
- else
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
- fi
- else
- with_gnu_ld=no
- wlarc=
-
- # A generic and very simple default shared library creation
- # command for GNU C++ for the case where it uses the native
- # linker, instead of GNU ld. If possible, this setting should
- # overridden to take advantage of the native linker features on
- # the platform it is being used on.
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
- fi
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
-
-else
- GXX=no
- with_gnu_ld=no
- wlarc=
-fi
-
-# PORTME: fill in a description of your system's C++ link characteristics
-AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
-_LT_AC_TAGVAR(ld_shlibs, $1)=yes
-case $host_os in
- aix3*)
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- aix4* | aix5*)
- if test "$host_cpu" = ia64; then
- # On IA64, the linker does run time linking by default, so we don't
- # have to do anything special.
- aix_use_runtimelinking=no
- exp_sym_flag='-Bexport'
- no_entry_flag=""
- else
- aix_use_runtimelinking=no
-
- # Test if we are trying to use run time linking or normal
- # AIX style linking. If -brtl is somewhere in LDFLAGS, we
- # need to do runtime linking.
- case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*)
- for ld_flag in $LDFLAGS; do
- case $ld_flag in
- *-brtl*)
- aix_use_runtimelinking=yes
- break
- ;;
- esac
- done
- ;;
- esac
-
- exp_sym_flag='-bexport'
- no_entry_flag='-bnoentry'
- fi
-
- # When large executables or shared objects are built, AIX ld can
- # have problems creating the table of contents. If linking a library
- # or program results in "error TOC overflow" add -mminimal-toc to
- # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
- # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
-
- _LT_AC_TAGVAR(archive_cmds, $1)=''
- _LT_AC_TAGVAR(hardcode_direct, $1)=yes
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
- _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
-
- if test "$GXX" = yes; then
- case $host_os in aix4.[[012]]|aix4.[[012]].*)
- # We only want to do this on AIX 4.2 and lower, the check
- # below for broken collect2 doesn't work under 4.3+
- collect2name=`${CC} -print-prog-name=collect2`
- if test -f "$collect2name" && \
- strings "$collect2name" | grep resolve_lib_name >/dev/null
- then
- # We have reworked collect2
- _LT_AC_TAGVAR(hardcode_direct, $1)=yes
- else
- # We have old collect2
- _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
- # It fails to find uninstalled libraries when the uninstalled
- # path is not listed in the libpath. Setting hardcode_minus_L
- # to unsupported forces relinking
- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
- fi
- ;;
- esac
- shared_flag='-shared'
- if test "$aix_use_runtimelinking" = yes; then
- shared_flag="$shared_flag "'${wl}-G'
- fi
- else
- # not using gcc
- if test "$host_cpu" = ia64; then
- # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
- # chokes on -Wl,-G. The following line is correct:
- shared_flag='-G'
- else
- if test "$aix_use_runtimelinking" = yes; then
- shared_flag='${wl}-G'
- else
- shared_flag='${wl}-bM:SRE'
- fi
- fi
- fi
-
- # It seems that -bexpall does not export symbols beginning with
- # underscore (_), so it is better to generate a list of symbols to export.
- _LT_AC_TAGVAR(always_export_symbols, $1)=yes
- if test "$aix_use_runtimelinking" = yes; then
- # Warning - without using the other runtime loading flags (-brtl),
- # -berok will link without error, but may produce a broken library.
- _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok'
- # Determine the default libpath from the value encoded in an empty executable.
- _LT_AC_SYS_LIBPATH_AIX
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
-
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
- else
- if test "$host_cpu" = ia64; then
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
- _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
- else
- # Determine the default libpath from the value encoded in an empty executable.
- _LT_AC_SYS_LIBPATH_AIX
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
- # Warning - without using the other run time loading flags,
- # -berok will link without error, but may produce a broken library.
- _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
- _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
- # Exported symbols can be pulled into shared objects from archives
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
- # This is similar to how AIX traditionally builds its shared libraries.
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
- fi
- fi
- ;;
-
- beos*)
- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
- # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
- # support --undefined. This deserves some investigation. FIXME
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- else
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
-
- chorus*)
- case $cc_basename in
- *)
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- esac
- ;;
-
- cygwin* | mingw* | pw32*)
- # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
- # as there is no search path for DLLs.
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
- _LT_AC_TAGVAR(always_export_symbols, $1)=no
- _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
-
- if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
- # If the export-symbols file already is a .def file (1st line
- # is EXPORTS), use it as is; otherwise, prepend...
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
- cp $export_symbols $output_objdir/$soname.def;
- else
- echo EXPORTS > $output_objdir/$soname.def;
- cat $export_symbols >> $output_objdir/$soname.def;
- fi~
- $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
- else
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
- darwin* | rhapsody*)
- case $host_os in
- rhapsody* | darwin1.[[012]])
- _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress'
- ;;
- *) # Darwin 1.3 on
- if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
- _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
- else
- case ${MACOSX_DEPLOYMENT_TARGET} in
- 10.[[012]])
- _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
- ;;
- 10.*)
- _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup'
- ;;
- esac
- fi
- ;;
- esac
- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
- _LT_AC_TAGVAR(hardcode_direct, $1)=no
- _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=''
- _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
-
- if test "$GXX" = yes ; then
- lt_int_apple_cc_single_mod=no
- output_verbose_link_cmd='echo'
- if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then
- lt_int_apple_cc_single_mod=yes
- fi
- if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
- else
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
- fi
- _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
- # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
- if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- else
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- fi
- _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- else
- case $cc_basename in
- xlc*)
- output_verbose_link_cmd='echo'
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
- _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
- # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- ;;
- *)
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- esac
- fi
- ;;
-
- dgux*)
- case $cc_basename in
- ec++*)
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- ghcx*)
- # Green Hills C++ Compiler
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- *)
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- esac
- ;;
- freebsd[[12]]*)
- # C++ shared libraries reported to be fairly broken before switch to ELF
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- freebsd-elf*)
- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
- ;;
- freebsd* | kfreebsd*-gnu | dragonfly*)
- # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
- # conventions
- _LT_AC_TAGVAR(ld_shlibs, $1)=yes
- ;;
- gnu*)
- ;;
- hpux9*)
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
- _LT_AC_TAGVAR(hardcode_direct, $1)=yes
- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
- # but as the default
- # location of the library.
-
- case $cc_basename in
- CC*)
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- aCC*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- #
- # There doesn't appear to be a way to prevent this compiler from
- # explicitly linking system object files so we need to strip them
- # from the output so that they don't get included in the library
- # dependencies.
- output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[[-]]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
- ;;
- *)
- if test "$GXX" = yes; then
- _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
- else
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
- esac
- ;;
- hpux10*|hpux11*)
- if test $with_gnu_ld = no; then
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-
- case $host_cpu in
- hppa*64*|ia64*)
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
- ;;
- *)
- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
- ;;
- esac
- fi
- case $host_cpu in
- hppa*64*|ia64*)
- _LT_AC_TAGVAR(hardcode_direct, $1)=no
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
- *)
- _LT_AC_TAGVAR(hardcode_direct, $1)=yes
- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
- # but as the default
- # location of the library.
- ;;
- esac
-
- case $cc_basename in
- CC*)
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- aCC*)
- case $host_cpu in
- hppa*64*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- ;;
- ia64*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- ;;
- *)
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- ;;
- esac
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- #
- # There doesn't appear to be a way to prevent this compiler from
- # explicitly linking system object files so we need to strip them
- # from the output so that they don't get included in the library
- # dependencies.
- output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
- ;;
- *)
- if test "$GXX" = yes; then
- if test $with_gnu_ld = no; then
- case $host_cpu in
- hppa*64*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- ;;
- ia64*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- ;;
- *)
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- ;;
- esac
- fi
- else
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
- esac
- ;;
- interix3*)
- _LT_AC_TAGVAR(hardcode_direct, $1)=no
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
- # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
- # Instead, shared libraries are loaded at an image base (0x10000000 by
- # default) and relocated if they conflict, which is a slow very memory
- # consuming and fragmenting process. To avoid this, we pick a random,
- # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
- # time. Moving up from 0x10000000 also allows more sbrk(2) space.
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
- ;;
- irix5* | irix6*)
- case $cc_basename in
- CC*)
- # SGI C++
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
-
- # Archives containing C++ object files must be created using
- # "CC -ar", where "CC" is the IRIX C++ compiler. This is
- # necessary to make sure instantiated templates are included
- # in the archive.
- _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
- ;;
- *)
- if test "$GXX" = yes; then
- if test "$with_gnu_ld" = no; then
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- else
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib'
- fi
- fi
- _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
- ;;
- esac
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
- ;;
- linux*)
- case $cc_basename in
- KCC*)
- # Kuck and Associates, Inc. (KAI) C++ Compiler
-
- # KCC will only create a shared library if the output file
- # ends with ".so" (or ".sl" for HP-UX), so rename the library
- # to its proper name (with version) after linking.
- _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- #
- # There doesn't appear to be a way to prevent this compiler from
- # explicitly linking system object files so we need to strip them
- # from the output so that they don't get included in the library
- # dependencies.
- output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
-
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir'
- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
-
- # Archives containing C++ object files must be created using
- # "CC -Bstatic", where "CC" is the KAI C++ compiler.
- _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
- ;;
- icpc*)
- # Intel C++
- with_gnu_ld=yes
- # version 8.0 and above of icpc choke on multiply defined symbols
- # if we add $predep_objects and $postdep_objects, however 7.1 and
- # earlier do not add the objects themselves.
- case `$CC -V 2>&1` in
- *"Version 7."*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
- ;;
- *) # Version 8.0 or newer
- tmp_idyn=
- case $host_cpu in
- ia64*) tmp_idyn=' -i_dynamic';;
- esac
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
- ;;
- esac
- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
- ;;
- pgCC*)
- # Portland Group C++ compiler
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
-
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
- ;;
- cxx*)
- # Compaq C++
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
-
- runpath_var=LD_RUN_PATH
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- #
- # There doesn't appear to be a way to prevent this compiler from
- # explicitly linking system object files so we need to strip them
- # from the output so that they don't get included in the library
- # dependencies.
- output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
- ;;
- esac
- ;;
- lynxos*)
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- m88k*)
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- mvs*)
- case $cc_basename in
- cxx*)
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- *)
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- esac
- ;;
- netbsd*)
- if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
- wlarc=
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
- _LT_AC_TAGVAR(hardcode_direct, $1)=yes
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- fi
- # Workaround some broken pre-1.5 toolchains
- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
- ;;
- openbsd2*)
- # C++ shared libraries are fairly broken
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- openbsd*)
- _LT_AC_TAGVAR(hardcode_direct, $1)=yes
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
- if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
- fi
- output_verbose_link_cmd='echo'
- ;;
- osf3*)
- case $cc_basename in
- KCC*)
- # Kuck and Associates, Inc. (KAI) C++ Compiler
-
- # KCC will only create a shared library if the output file
- # ends with ".so" (or ".sl" for HP-UX), so rename the library
- # to its proper name (with version) after linking.
- _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
-
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-
- # Archives containing C++ object files must be created using
- # "CC -Bstatic", where "CC" is the KAI C++ compiler.
- _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
-
- ;;
- RCC*)
- # Rational C++ 2.4.1
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- cxx*)
- _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
-
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- #
- # There doesn't appear to be a way to prevent this compiler from
- # explicitly linking system object files so we need to strip them
- # from the output so that they don't get included in the library
- # dependencies.
- output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
- ;;
- *)
- if test "$GXX" = yes && test "$with_gnu_ld" = no; then
- _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
-
- else
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
- esac
- ;;
- osf4* | osf5*)
- case $cc_basename in
- KCC*)
- # Kuck and Associates, Inc. (KAI) C++ Compiler
-
- # KCC will only create a shared library if the output file
- # ends with ".so" (or ".sl" for HP-UX), so rename the library
- # to its proper name (with version) after linking.
- _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
-
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-
- # Archives containing C++ object files must be created using
- # the KAI C++ compiler.
- _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs'
- ;;
- RCC*)
- # Rational C++ 2.4.1
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- cxx*)
- _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
- echo "-hidden">> $lib.exp~
- $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~
- $rm $lib.exp'
-
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- #
- # There doesn't appear to be a way to prevent this compiler from
- # explicitly linking system object files so we need to strip them
- # from the output so that they don't get included in the library
- # dependencies.
- output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
- ;;
- *)
- if test "$GXX" = yes && test "$with_gnu_ld" = no; then
- _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
-
- else
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
- esac
- ;;
- psos*)
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- sunos4*)
- case $cc_basename in
- CC*)
- # Sun C++ 4.x
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- lcc*)
- # Lucid
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- *)
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- esac
- ;;
- solaris*)
- case $cc_basename in
- CC*)
- # Sun C++ 4.2, 5.x and Centerline C++
- _LT_AC_TAGVAR(archive_cmds_need_lc,$1)=yes
- _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs'
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
- $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
-
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- case $host_os in
- solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
- *)
- # The C++ compiler is used as linker so we must use $wl
- # flag to pass the commands to the underlying system
- # linker. We must also pass each convience library through
- # to the system linker between allextract/defaultextract.
- # The C++ compiler will combine linker options so we
- # cannot just pass the convience library names through
- # without $wl.
- # Supported since Solaris 2.6 (maybe 2.5.1?)
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract'
- ;;
- esac
- _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
-
- output_verbose_link_cmd='echo'
-
- # Archives containing C++ object files must be created using
- # "CC -xar", where "CC" is the Sun C++ compiler. This is
- # necessary to make sure instantiated templates are included
- # in the archive.
- _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
- ;;
- gcx*)
- # Green Hills C++ Compiler
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
-
- # The C++ compiler must be used to create the archive.
- _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
- ;;
- *)
- # GNU C++ compiler with Solaris linker
- if test "$GXX" = yes && test "$with_gnu_ld" = no; then
- _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
- if $CC --version | grep -v '^2\.7' > /dev/null; then
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
- $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
- else
- # g++ 2.7 appears to require `-G' NOT `-shared' on this
- # platform.
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
- $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
- fi
-
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
- fi
- ;;
- esac
- ;;
- sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
- _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- runpath_var='LD_RUN_PATH'
-
- case $cc_basename in
- CC*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- *)
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- esac
- ;;
- sysv5* | sco3.2v5* | sco5v6*)
- # Note: We can NOT use -z defs as we might desire, because we do not
- # link with -lc, and that would cause any symbols used from libc to
- # always be unresolved, which means just about no library would
- # ever link correctly. If we're not using GNU ld we use -z text
- # though, which does catch some bad symbols but isn't as heavy-handed
- # as -z defs.
- # For security reasons, it is highly recommended that you always
- # use absolute paths for naming shared libraries, and exclude the
- # DT_RUNPATH tag from executables and libraries. But doing so
- # requires that you compile everything twice, which is a pain.
- # So that behaviour is only enabled if SCOABSPATH is set to a
- # non-empty value in the environment. Most likely only useful for
- # creating official distributions of packages.
- # This is a hack until libtool officially supports absolute path
- # names for shared libraries.
- _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
- _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
- _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
- runpath_var='LD_RUN_PATH'
-
- case $cc_basename in
- CC*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- *)
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- esac
- ;;
- tandem*)
- case $cc_basename in
- NCC*)
- # NonStop-UX NCC 3.20
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- *)
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- esac
- ;;
- vxworks*)
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- *)
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
-esac
-AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)])
-test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
-
-_LT_AC_TAGVAR(GCC, $1)="$GXX"
-_LT_AC_TAGVAR(LD, $1)="$LD"
-
-## CAVEAT EMPTOR:
-## There is no encapsulation within the following macros, do not change
-## the running order or otherwise move them around unless you know exactly
-## what you are doing...
-AC_LIBTOOL_POSTDEP_PREDEP($1)
-AC_LIBTOOL_PROG_COMPILER_PIC($1)
-AC_LIBTOOL_PROG_CC_C_O($1)
-AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
-AC_LIBTOOL_PROG_LD_SHLIBS($1)
-AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
-AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
-
-AC_LIBTOOL_CONFIG($1)
-
-AC_LANG_POP
-CC=$lt_save_CC
-LDCXX=$LD
-LD=$lt_save_LD
-GCC=$lt_save_GCC
-with_gnu_ldcxx=$with_gnu_ld
-with_gnu_ld=$lt_save_with_gnu_ld
-lt_cv_path_LDCXX=$lt_cv_path_LD
-lt_cv_path_LD=$lt_save_path_LD
-lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
-lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
-])# AC_LIBTOOL_LANG_CXX_CONFIG
-
-# AC_LIBTOOL_POSTDEP_PREDEP([TAGNAME])
-# ------------------------------------
-# Figure out "hidden" library dependencies from verbose
-# compiler output when linking a shared library.
-# Parse the compiler output and extract the necessary
-# objects, libraries and library flags.
-AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP],[
-dnl we can't use the lt_simple_compile_test_code here,
-dnl because it contains code intended for an executable,
-dnl not a library. It's possible we should let each
-dnl tag define a new lt_????_link_test_code variable,
-dnl but it's only used here...
-ifelse([$1],[],[cat > conftest.$ac_ext <<EOF
-int a;
-void foo (void) { a = 0; }
-EOF
-],[$1],[CXX],[cat > conftest.$ac_ext <<EOF
-class Foo
-{
-public:
- Foo (void) { a = 0; }
-private:
- int a;
-};
-EOF
-],[$1],[F77],[cat > conftest.$ac_ext <<EOF
- subroutine foo
- implicit none
- integer*4 a
- a=0
- return
- end
-EOF
-],[$1],[GCJ],[cat > conftest.$ac_ext <<EOF
-public class foo {
- private int a;
- public void bar (void) {
- a = 0;
- }
-};
-EOF
-])
-dnl Parse the compiler output and extract the necessary
-dnl objects, libraries and library flags.
-if AC_TRY_EVAL(ac_compile); then
- # Parse the compiler output and extract the necessary
- # objects, libraries and library flags.
-
- # Sentinel used to keep track of whether or not we are before
- # the conftest object file.
- pre_test_object_deps_done=no
-
- # The `*' in the case matches for architectures that use `case' in
- # $output_verbose_cmd can trigger glob expansion during the loop
- # eval without this substitution.
- output_verbose_link_cmd=`$echo "X$output_verbose_link_cmd" | $Xsed -e "$no_glob_subst"`
-
- for p in `eval $output_verbose_link_cmd`; do
- case $p in
-
- -L* | -R* | -l*)
- # Some compilers place space between "-{L,R}" and the path.
- # Remove the space.
- if test $p = "-L" \
- || test $p = "-R"; then
- prev=$p
- continue
- else
- prev=
- fi
-
- if test "$pre_test_object_deps_done" = no; then
- case $p in
- -L* | -R*)
- # Internal compiler library paths should come after those
- # provided the user. The postdeps already come after the
- # user supplied libs so there is no need to process them.
- if test -z "$_LT_AC_TAGVAR(compiler_lib_search_path, $1)"; then
- _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
- else
- _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${_LT_AC_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
- fi
- ;;
- # The "-l" case would never come before the object being
- # linked, so don't bother handling this case.
- esac
- else
- if test -z "$_LT_AC_TAGVAR(postdeps, $1)"; then
- _LT_AC_TAGVAR(postdeps, $1)="${prev}${p}"
- else
- _LT_AC_TAGVAR(postdeps, $1)="${_LT_AC_TAGVAR(postdeps, $1)} ${prev}${p}"
- fi
- fi
- ;;
-
- *.$objext)
- # This assumes that the test object file only shows up
- # once in the compiler output.
- if test "$p" = "conftest.$objext"; then
- pre_test_object_deps_done=yes
- continue
- fi
-
- if test "$pre_test_object_deps_done" = no; then
- if test -z "$_LT_AC_TAGVAR(predep_objects, $1)"; then
- _LT_AC_TAGVAR(predep_objects, $1)="$p"
- else
- _LT_AC_TAGVAR(predep_objects, $1)="$_LT_AC_TAGVAR(predep_objects, $1) $p"
- fi
- else
- if test -z "$_LT_AC_TAGVAR(postdep_objects, $1)"; then
- _LT_AC_TAGVAR(postdep_objects, $1)="$p"
- else
- _LT_AC_TAGVAR(postdep_objects, $1)="$_LT_AC_TAGVAR(postdep_objects, $1) $p"
- fi
- fi
- ;;
-
- *) ;; # Ignore the rest.
-
- esac
- done
-
- # Clean up.
- rm -f a.out a.exe
-else
- echo "libtool.m4: error: problem compiling $1 test program"
-fi
-
-$rm -f confest.$objext
-
-# PORTME: override above test on systems where it is broken
-ifelse([$1],[CXX],
-[case $host_os in
-interix3*)
- # Interix 3.5 installs completely hosed .la files for C++, so rather than
- # hack all around it, let's just trust "g++" to DTRT.
- _LT_AC_TAGVAR(predep_objects,$1)=
- _LT_AC_TAGVAR(postdep_objects,$1)=
- _LT_AC_TAGVAR(postdeps,$1)=
- ;;
-
-solaris*)
- case $cc_basename in
- CC*)
- # Adding this requires a known-good setup of shared libraries for
- # Sun compiler versions before 5.6, else PIC objects from an old
- # archive will be linked into the output, leading to subtle bugs.
- _LT_AC_TAGVAR(postdeps,$1)='-lCstd -lCrun'
- ;;
- esac
- ;;
-esac
-])
-
-case " $_LT_AC_TAGVAR(postdeps, $1) " in
-*" -lc "*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no ;;
-esac
-])# AC_LIBTOOL_POSTDEP_PREDEP
-
-# AC_LIBTOOL_LANG_F77_CONFIG
-# --------------------------
-# Ensure that the configuration vars for the C compiler are
-# suitably defined. Those variables are subsequently used by
-# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
-AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG], [_LT_AC_LANG_F77_CONFIG(F77)])
-AC_DEFUN([_LT_AC_LANG_F77_CONFIG],
-[AC_REQUIRE([AC_PROG_F77])
-AC_LANG_PUSH(Fortran 77)
-
-_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
-_LT_AC_TAGVAR(allow_undefined_flag, $1)=
-_LT_AC_TAGVAR(always_export_symbols, $1)=no
-_LT_AC_TAGVAR(archive_expsym_cmds, $1)=
-_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
-_LT_AC_TAGVAR(hardcode_direct, $1)=no
-_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
-_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
-_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
-_LT_AC_TAGVAR(hardcode_minus_L, $1)=no
-_LT_AC_TAGVAR(hardcode_automatic, $1)=no
-_LT_AC_TAGVAR(module_cmds, $1)=
-_LT_AC_TAGVAR(module_expsym_cmds, $1)=
-_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
-_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
-_LT_AC_TAGVAR(no_undefined_flag, $1)=
-_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
-_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
-
-# Source file extension for f77 test sources.
-ac_ext=f
-
-# Object file extension for compiled f77 test sources.
-objext=o
-_LT_AC_TAGVAR(objext, $1)=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code=" subroutine t\n return\n end\n"
-
-# Code to be used in simple link tests
-lt_simple_link_test_code=" program t\n end\n"
-
-# ltmain only uses $CC for tagged configurations so make sure $CC is set.
-_LT_AC_SYS_COMPILER
-
-# save warnings/boilerplate of simple test code
-_LT_COMPILER_BOILERPLATE
-_LT_LINKER_BOILERPLATE
-
-# Allow CC to be a program name with arguments.
-lt_save_CC="$CC"
-CC=${F77-"f77"}
-compiler=$CC
-_LT_AC_TAGVAR(compiler, $1)=$CC
-_LT_CC_BASENAME([$compiler])
-
-AC_MSG_CHECKING([if libtool supports shared libraries])
-AC_MSG_RESULT([$can_build_shared])
-
-AC_MSG_CHECKING([whether to build shared libraries])
-test "$can_build_shared" = "no" && enable_shared=no
-
-# On AIX, shared libraries and static libraries use the same namespace, and
-# are all built from PIC.
-case $host_os in
-aix3*)
- test "$enable_shared" = yes && enable_static=no
- if test -n "$RANLIB"; then
- archive_cmds="$archive_cmds~\$RANLIB \$lib"
- postinstall_cmds='$RANLIB $lib'
- fi
- ;;
-aix4* | aix5*)
- if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
- test "$enable_shared" = yes && enable_static=no
- fi
- ;;
-esac
-AC_MSG_RESULT([$enable_shared])
-
-AC_MSG_CHECKING([whether to build static libraries])
-# Make sure either enable_shared or enable_static is yes.
-test "$enable_shared" = yes || enable_static=yes
-AC_MSG_RESULT([$enable_static])
-
-_LT_AC_TAGVAR(GCC, $1)="$G77"
-_LT_AC_TAGVAR(LD, $1)="$LD"
-
-AC_LIBTOOL_PROG_COMPILER_PIC($1)
-AC_LIBTOOL_PROG_CC_C_O($1)
-AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
-AC_LIBTOOL_PROG_LD_SHLIBS($1)
-AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
-AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
-
-AC_LIBTOOL_CONFIG($1)
-
-AC_LANG_POP
-CC="$lt_save_CC"
-])# AC_LIBTOOL_LANG_F77_CONFIG
-
-
-# AC_LIBTOOL_LANG_GCJ_CONFIG
-# --------------------------
-# Ensure that the configuration vars for the C compiler are
-# suitably defined. Those variables are subsequently used by
-# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
-AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG], [_LT_AC_LANG_GCJ_CONFIG(GCJ)])
-AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG],
-[AC_LANG_PUSH(C)
-
-# Source file extension for Java test sources.
-ac_ext=java
-
-# Object file extension for compiled Java test sources.
-objext=o
-_LT_AC_TAGVAR(objext, $1)=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code="class foo {}\n"
-
-# Code to be used in simple link tests
-lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }\n'
-
-# ltmain only uses $CC for tagged configurations so make sure $CC is set.
-_LT_AC_SYS_COMPILER
-
-# save warnings/boilerplate of simple test code
-_LT_COMPILER_BOILERPLATE
-_LT_LINKER_BOILERPLATE
-
-# Allow CC to be a program name with arguments.
-lt_save_CC="$CC"
-CC=${GCJ-"gcj"}
-compiler=$CC
-_LT_AC_TAGVAR(compiler, $1)=$CC
-_LT_CC_BASENAME([$compiler])
-
-# GCJ did not exist at the time GCC didn't implicitly link libc in.
-_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
-
-_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
-
-## CAVEAT EMPTOR:
-## There is no encapsulation within the following macros, do not change
-## the running order or otherwise move them around unless you know exactly
-## what you are doing...
-AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1)
-AC_LIBTOOL_PROG_COMPILER_PIC($1)
-AC_LIBTOOL_PROG_CC_C_O($1)
-AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
-AC_LIBTOOL_PROG_LD_SHLIBS($1)
-AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
-AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
-
-AC_LIBTOOL_CONFIG($1)
-
-AC_LANG_POP([])
-CC="$lt_save_CC"
-])# AC_LIBTOOL_LANG_GCJ_CONFIG
-
-
-# AC_LIBTOOL_LANG_RC_CONFIG
-# -------------------------
-# Ensure that the configuration vars for the Windows resource compiler are
-# suitably defined. Those variables are subsequently used by
-# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
-AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG], [_LT_AC_LANG_RC_CONFIG(RC)])
-AC_DEFUN([_LT_AC_LANG_RC_CONFIG],
-[AC_LANG_PUSH(C)
-
-# Source file extension for RC test sources.
-ac_ext=rc
-
-# Object file extension for compiled RC test sources.
-objext=o
-_LT_AC_TAGVAR(objext, $1)=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n'
-
-# Code to be used in simple link tests
-lt_simple_link_test_code="$lt_simple_compile_test_code"
-
-# ltmain only uses $CC for tagged configurations so make sure $CC is set.
-_LT_AC_SYS_COMPILER
-
-# save warnings/boilerplate of simple test code
-_LT_COMPILER_BOILERPLATE
-_LT_LINKER_BOILERPLATE
-
-# Allow CC to be a program name with arguments.
-lt_save_CC="$CC"
-CC=${RC-"windres"}
-compiler=$CC
-_LT_AC_TAGVAR(compiler, $1)=$CC
-_LT_CC_BASENAME([$compiler])
-_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
-
-AC_LIBTOOL_CONFIG($1)
-
-AC_LANG_POP([])
-CC="$lt_save_CC"
-])# AC_LIBTOOL_LANG_RC_CONFIG
-
-
-# AC_LIBTOOL_CONFIG([TAGNAME])
-# ----------------------------
-# If TAGNAME is not passed, then create an initial libtool script
-# with a default configuration from the untagged config vars. Otherwise
-# add code to config.status for appending the configuration named by
-# TAGNAME from the matching tagged config vars.
-AC_DEFUN([AC_LIBTOOL_CONFIG],
-[# The else clause should only fire when bootstrapping the
-# libtool distribution, otherwise you forgot to ship ltmain.sh
-# with your package, and you will get complaints that there are
-# no rules to generate ltmain.sh.
-if test -f "$ltmain"; then
- # See if we are running on zsh, and set the options which allow our commands through
- # without removal of \ escapes.
- if test -n "${ZSH_VERSION+set}" ; then
- setopt NO_GLOB_SUBST
- fi
- # Now quote all the things that may contain metacharacters while being
- # careful not to overquote the AC_SUBSTed values. We take copies of the
- # variables and quote the copies for generation of the libtool script.
- for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \
- SED SHELL STRIP \
- libname_spec library_names_spec soname_spec extract_expsyms_cmds \
- old_striplib striplib file_magic_cmd finish_cmds finish_eval \
- deplibs_check_method reload_flag reload_cmds need_locks \
- lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
- lt_cv_sys_global_symbol_to_c_name_address \
- sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
- old_postinstall_cmds old_postuninstall_cmds \
- _LT_AC_TAGVAR(compiler, $1) \
- _LT_AC_TAGVAR(CC, $1) \
- _LT_AC_TAGVAR(LD, $1) \
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1) \
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1) \
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1) \
- _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) \
- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1) \
- _LT_AC_TAGVAR(thread_safe_flag_spec, $1) \
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1) \
- _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) \
- _LT_AC_TAGVAR(old_archive_cmds, $1) \
- _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) \
- _LT_AC_TAGVAR(predep_objects, $1) \
- _LT_AC_TAGVAR(postdep_objects, $1) \
- _LT_AC_TAGVAR(predeps, $1) \
- _LT_AC_TAGVAR(postdeps, $1) \
- _LT_AC_TAGVAR(compiler_lib_search_path, $1) \
- _LT_AC_TAGVAR(archive_cmds, $1) \
- _LT_AC_TAGVAR(archive_expsym_cmds, $1) \
- _LT_AC_TAGVAR(postinstall_cmds, $1) \
- _LT_AC_TAGVAR(postuninstall_cmds, $1) \
- _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) \
- _LT_AC_TAGVAR(allow_undefined_flag, $1) \
- _LT_AC_TAGVAR(no_undefined_flag, $1) \
- _LT_AC_TAGVAR(export_symbols_cmds, $1) \
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) \
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) \
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1) \
- _LT_AC_TAGVAR(hardcode_automatic, $1) \
- _LT_AC_TAGVAR(module_cmds, $1) \
- _LT_AC_TAGVAR(module_expsym_cmds, $1) \
- _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) \
- _LT_AC_TAGVAR(exclude_expsyms, $1) \
- _LT_AC_TAGVAR(include_expsyms, $1); do
-
- case $var in
- _LT_AC_TAGVAR(old_archive_cmds, $1) | \
- _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) | \
- _LT_AC_TAGVAR(archive_cmds, $1) | \
- _LT_AC_TAGVAR(archive_expsym_cmds, $1) | \
- _LT_AC_TAGVAR(module_cmds, $1) | \
- _LT_AC_TAGVAR(module_expsym_cmds, $1) | \
- _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) | \
- _LT_AC_TAGVAR(export_symbols_cmds, $1) | \
- extract_expsyms_cmds | reload_cmds | finish_cmds | \
- postinstall_cmds | postuninstall_cmds | \
- old_postinstall_cmds | old_postuninstall_cmds | \
- sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
- # Double-quote double-evaled strings.
- eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
- ;;
- *)
- eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
- ;;
- esac
- done
-
- case $lt_echo in
- *'\[$]0 --fallback-echo"')
- lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\[$]0 --fallback-echo"[$]/[$]0 --fallback-echo"/'`
- ;;
- esac
-
-ifelse([$1], [],
- [cfgfile="${ofile}T"
- trap "$rm \"$cfgfile\"; exit 1" 1 2 15
- $rm -f "$cfgfile"
- AC_MSG_NOTICE([creating $ofile])],
- [cfgfile="$ofile"])
-
- cat <<__EOF__ >> "$cfgfile"
-ifelse([$1], [],
-[#! $SHELL
-
-# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
-# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
-# NOTE: Changes made to this file will be lost: look at ltmain.sh.
-#
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
-# Free Software Foundation, Inc.
-#
-# This file is part of GNU Libtool:
-# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-# A sed program that does not truncate output.
-SED=$lt_SED
-
-# Sed that helps us avoid accidentally triggering echo(1) options like -n.
-Xsed="$SED -e 1s/^X//"
-
-# The HP-UX ksh and POSIX shell print the target directory to stdout
-# if CDPATH is set.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-
-# The names of the tagged configurations supported by this script.
-available_tags=
-
-# ### BEGIN LIBTOOL CONFIG],
-[# ### BEGIN LIBTOOL TAG CONFIG: $tagname])
-
-# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
-
-# Shell to use when invoking shell scripts.
-SHELL=$lt_SHELL
-
-# Whether or not to build shared libraries.
-build_libtool_libs=$enable_shared
-
-# Whether or not to build static libraries.
-build_old_libs=$enable_static
-
-# Whether or not to add -lc for building shared libraries.
-build_libtool_need_lc=$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)
-
-# Whether or not to disallow shared libs when runtime libs are static
-allow_libtool_libs_with_static_runtimes=$_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)
-
-# Whether or not to optimize for fast installation.
-fast_install=$enable_fast_install
-
-# The host system.
-host_alias=$host_alias
-host=$host
-host_os=$host_os
-
-# The build system.
-build_alias=$build_alias
-build=$build
-build_os=$build_os
-
-# An echo program that does not interpret backslashes.
-echo=$lt_echo
-
-# The archiver.
-AR=$lt_AR
-AR_FLAGS=$lt_AR_FLAGS
-
-# A C compiler.
-LTCC=$lt_LTCC
-
-# LTCC compiler flags.
-LTCFLAGS=$lt_LTCFLAGS
-
-# A language-specific compiler.
-CC=$lt_[]_LT_AC_TAGVAR(compiler, $1)
-
-# Is the compiler the GNU C compiler?
-with_gcc=$_LT_AC_TAGVAR(GCC, $1)
-
-# An ERE matcher.
-EGREP=$lt_EGREP
-
-# The linker used to build libraries.
-LD=$lt_[]_LT_AC_TAGVAR(LD, $1)
-
-# Whether we need hard or soft links.
-LN_S=$lt_LN_S
-
-# A BSD-compatible nm program.
-NM=$lt_NM
-
-# A symbol stripping program
-STRIP=$lt_STRIP
-
-# Used to examine libraries when file_magic_cmd begins "file"
-MAGIC_CMD=$MAGIC_CMD
-
-# Used on cygwin: DLL creation program.
-DLLTOOL="$DLLTOOL"
-
-# Used on cygwin: object dumper.
-OBJDUMP="$OBJDUMP"
-
-# Used on cygwin: assembler.
-AS="$AS"
-
-# The name of the directory that contains temporary libtool files.
-objdir=$objdir
-
-# How to create reloadable object files.
-reload_flag=$lt_reload_flag
-reload_cmds=$lt_reload_cmds
-
-# How to pass a linker flag through the compiler.
-wl=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)
-
-# Object file suffix (normally "o").
-objext="$ac_objext"
-
-# Old archive suffix (normally "a").
-libext="$libext"
-
-# Shared library suffix (normally ".so").
-shrext_cmds='$shrext_cmds'
-
-# Executable file suffix (normally "").
-exeext="$exeext"
-
-# Additional compiler flags for building library objects.
-pic_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)
-pic_mode=$pic_mode
-
-# What is the maximum length of a command?
-max_cmd_len=$lt_cv_sys_max_cmd_len
-
-# Does compiler simultaneously support -c and -o options?
-compiler_c_o=$lt_[]_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)
-
-# Must we lock files when doing compilation?
-need_locks=$lt_need_locks
-
-# Do we need the lib prefix for modules?
-need_lib_prefix=$need_lib_prefix
-
-# Do we need a version for libraries?
-need_version=$need_version
-
-# Whether dlopen is supported.
-dlopen_support=$enable_dlopen
-
-# Whether dlopen of programs is supported.
-dlopen_self=$enable_dlopen_self
-
-# Whether dlopen of statically linked programs is supported.
-dlopen_self_static=$enable_dlopen_self_static
-
-# Compiler flag to prevent dynamic linking.
-link_static_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_static, $1)
-
-# Compiler flag to turn off builtin functions.
-no_builtin_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)
-
-# Compiler flag to allow reflexive dlopens.
-export_dynamic_flag_spec=$lt_[]_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)
-
-# Compiler flag to generate shared objects directly from archives.
-whole_archive_flag_spec=$lt_[]_LT_AC_TAGVAR(whole_archive_flag_spec, $1)
-
-# Compiler flag to generate thread-safe objects.
-thread_safe_flag_spec=$lt_[]_LT_AC_TAGVAR(thread_safe_flag_spec, $1)
-
-# Library versioning type.
-version_type=$version_type
-
-# Format of library name prefix.
-libname_spec=$lt_libname_spec
-
-# List of archive names. First name is the real one, the rest are links.
-# The last name is the one that the linker finds with -lNAME.
-library_names_spec=$lt_library_names_spec
-
-# The coded name of the library, if different from the real name.
-soname_spec=$lt_soname_spec
-
-# Commands used to build and install an old-style archive.
-RANLIB=$lt_RANLIB
-old_archive_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_cmds, $1)
-old_postinstall_cmds=$lt_old_postinstall_cmds
-old_postuninstall_cmds=$lt_old_postuninstall_cmds
-
-# Create an old-style archive from a shared archive.
-old_archive_from_new_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_new_cmds, $1)
-
-# Create a temporary old-style archive to link instead of a shared archive.
-old_archive_from_expsyms_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)
-
-# Commands used to build and install a shared archive.
-archive_cmds=$lt_[]_LT_AC_TAGVAR(archive_cmds, $1)
-archive_expsym_cmds=$lt_[]_LT_AC_TAGVAR(archive_expsym_cmds, $1)
-postinstall_cmds=$lt_postinstall_cmds
-postuninstall_cmds=$lt_postuninstall_cmds
-
-# Commands used to build a loadable module (assumed same as above if empty)
-module_cmds=$lt_[]_LT_AC_TAGVAR(module_cmds, $1)
-module_expsym_cmds=$lt_[]_LT_AC_TAGVAR(module_expsym_cmds, $1)
-
-# Commands to strip libraries.
-old_striplib=$lt_old_striplib
-striplib=$lt_striplib
-
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predep_objects=$lt_[]_LT_AC_TAGVAR(predep_objects, $1)
-
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdep_objects=$lt_[]_LT_AC_TAGVAR(postdep_objects, $1)
-
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predeps=$lt_[]_LT_AC_TAGVAR(predeps, $1)
-
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1)
-
-# The library search path used internally by the compiler when linking
-# a shared library.
-compiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1)
-
-# Method to check whether dependent libraries are shared objects.
-deplibs_check_method=$lt_deplibs_check_method
-
-# Command to use when deplibs_check_method == file_magic.
-file_magic_cmd=$lt_file_magic_cmd
-
-# Flag that allows shared libraries with undefined symbols to be built.
-allow_undefined_flag=$lt_[]_LT_AC_TAGVAR(allow_undefined_flag, $1)
-
-# Flag that forces no undefined symbols.
-no_undefined_flag=$lt_[]_LT_AC_TAGVAR(no_undefined_flag, $1)
-
-# Commands used to finish a libtool library installation in a directory.
-finish_cmds=$lt_finish_cmds
-
-# Same as above, but a single script fragment to be evaled but not shown.
-finish_eval=$lt_finish_eval
-
-# Take the output of nm and produce a listing of raw symbols and C names.
-global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
-
-# Transform the output of nm in a proper C declaration
-global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
-
-# Transform the output of nm in a C name address pair
-global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
-
-# This is the shared library runtime path variable.
-runpath_var=$runpath_var
-
-# This is the shared library path variable.
-shlibpath_var=$shlibpath_var
-
-# Is shlibpath searched before the hard-coded library search path?
-shlibpath_overrides_runpath=$shlibpath_overrides_runpath
-
-# How to hardcode a shared library path into an executable.
-hardcode_action=$_LT_AC_TAGVAR(hardcode_action, $1)
-
-# Whether we should hardcode library paths into libraries.
-hardcode_into_libs=$hardcode_into_libs
-
-# Flag to hardcode \$libdir into a binary during linking.
-# This must work even if \$libdir does not exist.
-hardcode_libdir_flag_spec=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)
-
-# If ld is used when linking, flag to hardcode \$libdir into
-# a binary during linking. This must work even if \$libdir does
-# not exist.
-hardcode_libdir_flag_spec_ld=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)
-
-# Whether we need a single -rpath flag with a separated argument.
-hardcode_libdir_separator=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_separator, $1)
-
-# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
-# resulting binary.
-hardcode_direct=$_LT_AC_TAGVAR(hardcode_direct, $1)
-
-# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
-# resulting binary.
-hardcode_minus_L=$_LT_AC_TAGVAR(hardcode_minus_L, $1)
-
-# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
-# the resulting binary.
-hardcode_shlibpath_var=$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)
-
-# Set to yes if building a shared library automatically hardcodes DIR into the library
-# and all subsequent libraries and executables linked against it.
-hardcode_automatic=$_LT_AC_TAGVAR(hardcode_automatic, $1)
-
-# Variables whose values should be saved in libtool wrapper scripts and
-# restored at relink time.
-variables_saved_for_relink="$variables_saved_for_relink"
-
-# Whether libtool must link a program against all its dependency libraries.
-link_all_deplibs=$_LT_AC_TAGVAR(link_all_deplibs, $1)
-
-# Compile-time system search path for libraries
-sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
-
-# Run-time system search path for libraries
-sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
-
-# Fix the shell variable \$srcfile for the compiler.
-fix_srcfile_path="$_LT_AC_TAGVAR(fix_srcfile_path, $1)"
-
-# Set to yes if exported symbols are required.
-always_export_symbols=$_LT_AC_TAGVAR(always_export_symbols, $1)
-
-# The commands to list exported symbols.
-export_symbols_cmds=$lt_[]_LT_AC_TAGVAR(export_symbols_cmds, $1)
-
-# The commands to extract the exported symbol list from a shared archive.
-extract_expsyms_cmds=$lt_extract_expsyms_cmds
-
-# Symbols that should not be listed in the preloaded symbols.
-exclude_expsyms=$lt_[]_LT_AC_TAGVAR(exclude_expsyms, $1)
-
-# Symbols that must always be exported.
-include_expsyms=$lt_[]_LT_AC_TAGVAR(include_expsyms, $1)
-
-ifelse([$1],[],
-[# ### END LIBTOOL CONFIG],
-[# ### END LIBTOOL TAG CONFIG: $tagname])
-
-__EOF__
-
-ifelse([$1],[], [
- case $host_os in
- aix3*)
- cat <<\EOF >> "$cfgfile"
-
-# AIX sometimes has problems with the GCC collect2 program. For some
-# reason, if we set the COLLECT_NAMES environment variable, the problems
-# vanish in a puff of smoke.
-if test "X${COLLECT_NAMES+set}" != Xset; then
- COLLECT_NAMES=
- export COLLECT_NAMES
-fi
-EOF
- ;;
- esac
-
- # We use sed instead of cat because bash on DJGPP gets confused if
- # if finds mixed CR/LF and LF-only lines. Since sed operates in
- # text mode, it properly converts lines to CR/LF. This bash problem
- # is reportedly fixed, but why not run on old versions too?
- sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1)
-
- mv -f "$cfgfile" "$ofile" || \
- (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
- chmod +x "$ofile"
-])
-else
- # If there is no Makefile yet, we rely on a make rule to execute
- # `config.status --recheck' to rerun these tests and create the
- # libtool script then.
- ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
- if test -f "$ltmain_in"; then
- test -f Makefile && make "$ltmain"
- fi
-fi
-])# AC_LIBTOOL_CONFIG
-
-
-# AC_LIBTOOL_PROG_COMPILER_NO_RTTI([TAGNAME])
-# -------------------------------------------
-AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI],
-[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
-
-_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
-
-if test "$GCC" = yes; then
- _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
-
- AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
- lt_cv_prog_compiler_rtti_exceptions,
- [-fno-rtti -fno-exceptions], [],
- [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
-fi
-])# AC_LIBTOOL_PROG_COMPILER_NO_RTTI
-
-
-# AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
-# ---------------------------------
-AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE],
-[AC_REQUIRE([AC_CANONICAL_HOST])
-AC_REQUIRE([AC_PROG_NM])
-AC_REQUIRE([AC_OBJEXT])
-# Check for command to grab the raw symbol name followed by C symbol from nm.
-AC_MSG_CHECKING([command to parse $NM output from $compiler object])
-AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
-[
-# These are sane defaults that work on at least a few old systems.
-# [They come from Ultrix. What could be older than Ultrix?!! ;)]
-
-# Character class describing NM global symbol codes.
-symcode='[[BCDEGRST]]'
-
-# Regexp to match symbols that can be accessed directly from C.
-sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
-
-# Transform an extracted symbol line into a proper C declaration
-lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'"
-
-# Transform an extracted symbol line into symbol name and symbol address
-lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'"
-
-# Define system-specific variables.
-case $host_os in
-aix*)
- symcode='[[BCDT]]'
- ;;
-cygwin* | mingw* | pw32*)
- symcode='[[ABCDGISTW]]'
- ;;
-hpux*) # Its linker distinguishes data from code symbols
- if test "$host_cpu" = ia64; then
- symcode='[[ABCDEGRST]]'
- fi
- lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
- lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'"
- ;;
-linux*)
- if test "$host_cpu" = ia64; then
- symcode='[[ABCDGIRSTW]]'
- lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
- lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'"
- fi
- ;;
-irix* | nonstopux*)
- symcode='[[BCDEGRST]]'
- ;;
-osf*)
- symcode='[[BCDEGQRST]]'
- ;;
-solaris*)
- symcode='[[BDRT]]'
- ;;
-sco3.2v5*)
- symcode='[[DT]]'
- ;;
-sysv4.2uw2*)
- symcode='[[DT]]'
- ;;
-sysv5* | sco5v6* | unixware* | OpenUNIX*)
- symcode='[[ABDT]]'
- ;;
-sysv4)
- symcode='[[DFNSTU]]'
- ;;
-esac
-
-# Handle CRLF in mingw tool chain
-opt_cr=
-case $build_os in
-mingw*)
- opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp
- ;;
-esac
-
-# If we're using GNU nm, then use its standard symbol codes.
-case `$NM -V 2>&1` in
-*GNU* | *'with BFD'*)
- symcode='[[ABCDGIRSTW]]' ;;
-esac
-
-# Try without a prefix undercore, then with it.
-for ac_symprfx in "" "_"; do
-
- # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
- symxfrm="\\1 $ac_symprfx\\2 \\2"
-
- # Write the raw and C identifiers.
- lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
-
- # Check to see that the pipe works correctly.
- pipe_works=no
-
- rm -f conftest*
- cat > conftest.$ac_ext <<EOF
-#ifdef __cplusplus
-extern "C" {
-#endif
-char nm_test_var;
-void nm_test_func(){}
-#ifdef __cplusplus
-}
-#endif
-int main(){nm_test_var='a';nm_test_func();return(0);}
-EOF
-
- if AC_TRY_EVAL(ac_compile); then
- # Now try to grab the symbols.
- nlist=conftest.nm
- if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then
- # Try sorting and uniquifying the output.
- if sort "$nlist" | uniq > "$nlist"T; then
- mv -f "$nlist"T "$nlist"
- else
- rm -f "$nlist"T
- fi
-
- # Make sure that we snagged all the symbols we need.
- if grep ' nm_test_var$' "$nlist" >/dev/null; then
- if grep ' nm_test_func$' "$nlist" >/dev/null; then
- cat <<EOF > conftest.$ac_ext
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-EOF
- # Now generate the symbol file.
- eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext'
-
- cat <<EOF >> conftest.$ac_ext
-#if defined (__STDC__) && __STDC__
-# define lt_ptr_t void *
-#else
-# define lt_ptr_t char *
-# define const
-#endif
-
-/* The mapping between symbol names and symbols. */
-const struct {
- const char *name;
- lt_ptr_t address;
-}
-lt_preloaded_symbols[[]] =
-{
-EOF
- $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext
- cat <<\EOF >> conftest.$ac_ext
- {0, (lt_ptr_t) 0}
-};
-
-#ifdef __cplusplus
-}
-#endif
-EOF
- # Now try linking the two files.
- mv conftest.$ac_objext conftstm.$ac_objext
- lt_save_LIBS="$LIBS"
- lt_save_CFLAGS="$CFLAGS"
- LIBS="conftstm.$ac_objext"
- CFLAGS="$CFLAGS$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
- if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
- pipe_works=yes
- fi
- LIBS="$lt_save_LIBS"
- CFLAGS="$lt_save_CFLAGS"
- else
- echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
- fi
- else
- echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
- fi
- else
- echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
- fi
- else
- echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
- cat conftest.$ac_ext >&5
- fi
- rm -f conftest* conftst*
-
- # Do not use the global_symbol_pipe unless it works.
- if test "$pipe_works" = yes; then
- break
- else
- lt_cv_sys_global_symbol_pipe=
- fi
-done
-])
-if test -z "$lt_cv_sys_global_symbol_pipe"; then
- lt_cv_sys_global_symbol_to_cdecl=
-fi
-if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
- AC_MSG_RESULT(failed)
-else
- AC_MSG_RESULT(ok)
-fi
-]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
-
-
-# AC_LIBTOOL_PROG_COMPILER_PIC([TAGNAME])
-# ---------------------------------------
-AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC],
-[_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)=
-_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
-_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=
-
-AC_MSG_CHECKING([for $compiler option to produce PIC])
- ifelse([$1],[CXX],[
- # C++ specific cases for pic, static, wl, etc.
- if test "$GXX" = yes; then
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
-
- case $host_os in
- aix*)
- # All AIX code is PIC.
- if test "$host_cpu" = ia64; then
- # AIX 5 now supports IA64 processor
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- fi
- ;;
- amigaos*)
- # FIXME: we need at least 68020 code to build shared libraries, but
- # adding the `-m68020' flag to GCC prevents building anything better,
- # like `-m68040'.
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
- ;;
- beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
- # PIC is the default for these OSes.
- ;;
- mingw* | os2* | pw32*)
- # This hack is so that the source file can tell whether it is being
- # built for inclusion in a dll (and should export symbols for example).
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
- ;;
- darwin* | rhapsody*)
- # PIC is the default on this platform
- # Common symbols not allowed in MH_DYLIB files
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
- ;;
- *djgpp*)
- # DJGPP does not support shared libraries at all
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
- ;;
- interix3*)
- # Interix 3.x gcc -fpic/-fPIC options generate broken code.
- # Instead, we relocate shared libraries at runtime.
- ;;
- sysv4*MP*)
- if test -d /usr/nec; then
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
- fi
- ;;
- hpux*)
- # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
- # not for PA HP-UX.
- case $host_cpu in
- hppa*64*|ia64*)
- ;;
- *)
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
- ;;
- esac
- ;;
- *)
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
- ;;
- esac
- else
- case $host_os in
- aix4* | aix5*)
- # All AIX code is PIC.
- if test "$host_cpu" = ia64; then
- # AIX 5 now supports IA64 processor
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- else
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
- fi
- ;;
- chorus*)
- case $cc_basename in
- cxch68*)
- # Green Hills C++ Compiler
- # _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
- ;;
- esac
- ;;
- darwin*)
- # PIC is the default on this platform
- # Common symbols not allowed in MH_DYLIB files
- case $cc_basename in
- xlc*)
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon'
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- ;;
- esac
- ;;
- dgux*)
- case $cc_basename in
- ec++*)
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- ;;
- ghcx*)
- # Green Hills C++ Compiler
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
- ;;
- *)
- ;;
- esac
- ;;
- freebsd* | kfreebsd*-gnu | dragonfly*)
- # FreeBSD uses GNU C++
- ;;
- hpux9* | hpux10* | hpux11*)
- case $cc_basename in
- CC*)
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
- if test "$host_cpu" != ia64; then
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
- fi
- ;;
- aCC*)
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
- case $host_cpu in
- hppa*64*|ia64*)
- # +Z the default
- ;;
- *)
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
- ;;
- esac
- ;;
- *)
- ;;
- esac
- ;;
- interix*)
- # This is c89, which is MS Visual C++ (no shared libs)
- # Anyone wants to do a port?
- ;;
- irix5* | irix6* | nonstopux*)
- case $cc_basename in
- CC*)
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
- # CC pic flag -KPIC is the default.
- ;;
- *)
- ;;
- esac
- ;;
- linux*)
- case $cc_basename in
- KCC*)
- # KAI C++ Compiler
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
- ;;
- icpc* | ecpc*)
- # Intel C++
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
- ;;
- pgCC*)
- # Portland Group C++ compiler.
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- ;;
- cxx*)
- # Compaq C++
- # Make sure the PIC flag is empty. It appears that all Alpha
- # Linux and Compaq Tru64 Unix objects are PIC.
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
- ;;
- *)
- ;;
- esac
- ;;
- lynxos*)
- ;;
- m88k*)
- ;;
- mvs*)
- case $cc_basename in
- cxx*)
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
- ;;
- *)
- ;;
- esac
- ;;
- netbsd*)
- ;;
- osf3* | osf4* | osf5*)
- case $cc_basename in
- KCC*)
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
- ;;
- RCC*)
- # Rational C++ 2.4.1
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
- ;;
- cxx*)
- # Digital/Compaq C++
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- # Make sure the PIC flag is empty. It appears that all Alpha
- # Linux and Compaq Tru64 Unix objects are PIC.
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
- ;;
- *)
- ;;
- esac
- ;;
- psos*)
- ;;
- solaris*)
- case $cc_basename in
- CC*)
- # Sun C++ 4.2, 5.x and Centerline C++
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
- ;;
- gcx*)
- # Green Hills C++ Compiler
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
- ;;
- *)
- ;;
- esac
- ;;
- sunos4*)
- case $cc_basename in
- CC*)
- # Sun C++ 4.x
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- ;;
- lcc*)
- # Lucid
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
- ;;
- *)
- ;;
- esac
- ;;
- tandem*)
- case $cc_basename in
- NCC*)
- # NonStop-UX NCC 3.20
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- ;;
- *)
- ;;
- esac
- ;;
- sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
- case $cc_basename in
- CC*)
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- ;;
- esac
- ;;
- vxworks*)
- ;;
- *)
- _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
- ;;
- esac
- fi
-],
-[
- if test "$GCC" = yes; then
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
-
- case $host_os in
- aix*)
- # All AIX code is PIC.
- if test "$host_cpu" = ia64; then
- # AIX 5 now supports IA64 processor
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- fi
- ;;
-
- amigaos*)
- # FIXME: we need at least 68020 code to build shared libraries, but
- # adding the `-m68020' flag to GCC prevents building anything better,
- # like `-m68040'.
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
- ;;
-
- beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
- # PIC is the default for these OSes.
- ;;
-
- mingw* | pw32* | os2*)
- # This hack is so that the source file can tell whether it is being
- # built for inclusion in a dll (and should export symbols for example).
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
- ;;
-
- darwin* | rhapsody*)
- # PIC is the default on this platform
- # Common symbols not allowed in MH_DYLIB files
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
- ;;
-
- interix3*)
- # Interix 3.x gcc -fpic/-fPIC options generate broken code.
- # Instead, we relocate shared libraries at runtime.
- ;;
-
- msdosdjgpp*)
- # Just because we use GCC doesn't mean we suddenly get shared libraries
- # on systems that don't support them.
- _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
- enable_shared=no
- ;;
-
- sysv4*MP*)
- if test -d /usr/nec; then
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
- fi
- ;;
-
- hpux*)
- # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
- # not for PA HP-UX.
- case $host_cpu in
- hppa*64*|ia64*)
- # +Z the default
- ;;
- *)
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
- ;;
- esac
- ;;
-
- *)
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
- ;;
- esac
- else
- # PORTME Check for flag to pass linker flags through the system compiler.
- case $host_os in
- aix*)
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- if test "$host_cpu" = ia64; then
- # AIX 5 now supports IA64 processor
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- else
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
- fi
- ;;
- darwin*)
- # PIC is the default on this platform
- # Common symbols not allowed in MH_DYLIB files
- case $cc_basename in
- xlc*)
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon'
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- ;;
- esac
- ;;
-
- mingw* | pw32* | os2*)
- # This hack is so that the source file can tell whether it is being
- # built for inclusion in a dll (and should export symbols for example).
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
- ;;
-
- hpux9* | hpux10* | hpux11*)
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
- # not for PA HP-UX.
- case $host_cpu in
- hppa*64*|ia64*)
- # +Z the default
- ;;
- *)
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
- ;;
- esac
- # Is there a better lt_prog_compiler_static that works with the bundled CC?
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
- ;;
-
- irix5* | irix6* | nonstopux*)
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- # PIC (with -KPIC) is the default.
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
- ;;
-
- newsos6)
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- ;;
-
- linux*)
- case $cc_basename in
- icc* | ecc*)
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
- ;;
- pgcc* | pgf77* | pgf90* | pgf95*)
- # Portland Group compilers (*not* the Pentium gcc compiler,
- # which looks to be a dead project)
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- ;;
- ccc*)
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- # All Alpha code is PIC.
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
- ;;
- esac
- ;;
-
- osf3* | osf4* | osf5*)
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- # All OSF/1 code is PIC.
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
- ;;
-
- solaris*)
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- case $cc_basename in
- f77* | f90* | f95*)
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
- *)
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
- esac
- ;;
-
- sunos4*)
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- ;;
-
- sysv4 | sysv4.2uw2* | sysv4.3*)
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- ;;
-
- sysv4*MP*)
- if test -d /usr/nec ;then
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- fi
- ;;
-
- sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- ;;
-
- unicos*)
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
- ;;
-
- uts4*)
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- ;;
-
- *)
- _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
- ;;
- esac
- fi
-])
-AC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)])
-
-#
-# Check to make sure the PIC flag actually works.
-#
-if test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then
- AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works],
- _LT_AC_TAGVAR(lt_prog_compiler_pic_works, $1),
- [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])], [],
- [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in
- "" | " "*) ;;
- *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)" ;;
- esac],
- [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
- _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
-fi
-case $host_os in
- # For platforms which do not support PIC, -DPIC is meaningless:
- *djgpp*)
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
- ;;
- *)
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])"
- ;;
-esac
-
-#
-# Check to make sure the static flag actually works.
-#
-wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_AC_TAGVAR(lt_prog_compiler_static, $1)\"
-AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
- _LT_AC_TAGVAR(lt_prog_compiler_static_works, $1),
- $lt_tmp_static_flag,
- [],
- [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=])
-])
-
-
-# AC_LIBTOOL_PROG_LD_SHLIBS([TAGNAME])
-# ------------------------------------
-# See if the linker supports building shared libraries.
-AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS],
-[AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
-ifelse([$1],[CXX],[
- _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
- case $host_os in
- aix4* | aix5*)
- # If we're using GNU nm, then we don't want the "-C" option.
- # -C means demangle to AIX nm, but means don't demangle with GNU nm
- if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
- _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
- else
- _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
- fi
- ;;
- pw32*)
- _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
- ;;
- cygwin* | mingw*)
- _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/;/^.* __nm__/s/^.* __nm__\([[^ ]]*\) [[^ ]]*/\1 DATA/;/^I /d;/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols'
- ;;
- *)
- _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
- ;;
- esac
-],[
- runpath_var=
- _LT_AC_TAGVAR(allow_undefined_flag, $1)=
- _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
- _LT_AC_TAGVAR(archive_cmds, $1)=
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)=
- _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)=
- _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)=
- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
- _LT_AC_TAGVAR(thread_safe_flag_spec, $1)=
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
- _LT_AC_TAGVAR(hardcode_direct, $1)=no
- _LT_AC_TAGVAR(hardcode_minus_L, $1)=no
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
- _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
- _LT_AC_TAGVAR(hardcode_automatic, $1)=no
- _LT_AC_TAGVAR(module_cmds, $1)=
- _LT_AC_TAGVAR(module_expsym_cmds, $1)=
- _LT_AC_TAGVAR(always_export_symbols, $1)=no
- _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
- # include_expsyms should be a list of space-separated symbols to be *always*
- # included in the symbol list
- _LT_AC_TAGVAR(include_expsyms, $1)=
- # exclude_expsyms can be an extended regexp of symbols to exclude
- # it will be wrapped by ` (' and `)$', so one must not match beginning or
- # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
- # as well as any symbol that contains `d'.
- _LT_AC_TAGVAR(exclude_expsyms, $1)="_GLOBAL_OFFSET_TABLE_"
- # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
- # platforms (ab)use it in PIC code, but their linkers get confused if
- # the symbol is explicitly referenced. Since portable code cannot
- # rely on this symbol name, it's probably fine to never include it in
- # preloaded symbol tables.
- extract_expsyms_cmds=
- # Just being paranoid about ensuring that cc_basename is set.
- _LT_CC_BASENAME([$compiler])
- case $host_os in
- cygwin* | mingw* | pw32*)
- # FIXME: the MSVC++ port hasn't been tested in a loooong time
- # When not using gcc, we currently assume that we are using
- # Microsoft Visual C++.
- if test "$GCC" != yes; then
- with_gnu_ld=no
- fi
- ;;
- interix*)
- # we just hope/assume this is gcc and not c89 (= MSVC++)
- with_gnu_ld=yes
- ;;
- openbsd*)
- with_gnu_ld=no
- ;;
- esac
-
- _LT_AC_TAGVAR(ld_shlibs, $1)=yes
- if test "$with_gnu_ld" = yes; then
- # If archive_cmds runs LD, not CC, wlarc should be empty
- wlarc='${wl}'
-
- # Set some defaults for GNU ld with shared library support. These
- # are reset later if shared libraries are not supported. Putting them
- # here allows them to be overridden if necessary.
- runpath_var=LD_RUN_PATH
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
- # ancient GNU ld didn't support --whole-archive et. al.
- if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
- else
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
- fi
- supports_anon_versioning=no
- case `$LD -v 2>/dev/null` in
- *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
- *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
- *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
- *\ 2.11.*) ;; # other 2.11 versions
- *) supports_anon_versioning=yes ;;
- esac
-
- # See if GNU ld supports shared libraries.
- case $host_os in
- aix3* | aix4* | aix5*)
- # On AIX/PPC, the GNU linker is very broken
- if test "$host_cpu" != ia64; then
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- cat <<EOF 1>&2
-
-*** Warning: the GNU linker, at least up to release 2.9.1, is reported
-*** to be unable to reliably create shared libraries on AIX.
-*** Therefore, libtool is disabling shared libraries support. If you
-*** really care for shared libraries, you may want to modify your PATH
-*** so that a non-GNU linker is found, and then restart.
-
-EOF
- fi
- ;;
-
- amigaos*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
-
- # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
- # that the semantics of dynamic libraries on AmigaOS, at least up
- # to version 4, is to share data among multiple programs linked
- # with the same dynamic library. Since this doesn't match the
- # behavior of shared libraries on other platforms, we can't use
- # them.
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
-
- beos*)
- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
- # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
- # support --undefined. This deserves some investigation. FIXME
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- else
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
-
- cygwin* | mingw* | pw32*)
- # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
- # as there is no search path for DLLs.
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
- _LT_AC_TAGVAR(always_export_symbols, $1)=no
- _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
- _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols'
-
- if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
- # If the export-symbols file already is a .def file (1st line
- # is EXPORTS), use it as is; otherwise, prepend...
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
- cp $export_symbols $output_objdir/$soname.def;
- else
- echo EXPORTS > $output_objdir/$soname.def;
- cat $export_symbols >> $output_objdir/$soname.def;
- fi~
- $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
- else
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
-
- interix3*)
- _LT_AC_TAGVAR(hardcode_direct, $1)=no
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
- # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
- # Instead, shared libraries are loaded at an image base (0x10000000 by
- # default) and relocated if they conflict, which is a slow very memory
- # consuming and fragmenting process. To avoid this, we pick a random,
- # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
- # time. Moving up from 0x10000000 also allows more sbrk(2) space.
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
- ;;
-
- linux*)
- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- tmp_addflag=
- case $cc_basename,$host_cpu in
- pgcc*) # Portland Group C compiler
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
- tmp_addflag=' $pic_flag'
- ;;
- pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
- tmp_addflag=' $pic_flag -Mnomain' ;;
- ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64
- tmp_addflag=' -i_dynamic' ;;
- efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64
- tmp_addflag=' -i_dynamic -nofor_main' ;;
- ifc* | ifort*) # Intel Fortran compiler
- tmp_addflag=' -nofor_main' ;;
- esac
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-
- if test $supports_anon_versioning = yes; then
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $output_objdir/$libname.ver~
- cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
- $echo "local: *; };" >> $output_objdir/$libname.ver~
- $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
- fi
- else
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
-
- netbsd*)
- if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
- wlarc=
- else
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
- fi
- ;;
-
- solaris*)
- if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- cat <<EOF 1>&2
-
-*** Warning: The releases 2.8.* of the GNU linker cannot reliably
-*** create shared libraries on Solaris systems. Therefore, libtool
-*** is disabling shared libraries support. We urge you to upgrade GNU
-*** binutils to release 2.9.1 or newer. Another option is to modify
-*** your PATH or compiler configuration so that the native linker is
-*** used, and then restart.
-
-EOF
- elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
- else
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
-
- sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
- case `$LD -v 2>&1` in
- *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- cat <<_LT_EOF 1>&2
-
-*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
-*** reliably create shared libraries on SCO systems. Therefore, libtool
-*** is disabling shared libraries support. We urge you to upgrade GNU
-*** binutils to release 2.16.91.0.3 or newer. Another option is to modify
-*** your PATH or compiler configuration so that the native linker is
-*** used, and then restart.
-
-_LT_EOF
- ;;
- *)
- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib'
- else
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
- esac
- ;;
-
- sunos4*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
- wlarc=
- _LT_AC_TAGVAR(hardcode_direct, $1)=yes
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
-
- *)
- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
- else
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
- esac
-
- if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no; then
- runpath_var=
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
- fi
- else
- # PORTME fill in a description of your system's linker (not GNU ld)
- case $host_os in
- aix3*)
- _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
- _LT_AC_TAGVAR(always_export_symbols, $1)=yes
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
- # Note: this linker hardcodes the directories in LIBPATH if there
- # are no directories specified by -L.
- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
- if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
- # Neither direct hardcoding nor static linking is supported with a
- # broken collect2.
- _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
- fi
- ;;
-
- aix4* | aix5*)
- if test "$host_cpu" = ia64; then
- # On IA64, the linker does run time linking by default, so we don't
- # have to do anything special.
- aix_use_runtimelinking=no
- exp_sym_flag='-Bexport'
- no_entry_flag=""
- else
- # If we're using GNU nm, then we don't want the "-C" option.
- # -C means demangle to AIX nm, but means don't demangle with GNU nm
- if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
- _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
- else
- _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
- fi
- aix_use_runtimelinking=no
-
- # Test if we are trying to use run time linking or normal
- # AIX style linking. If -brtl is somewhere in LDFLAGS, we
- # need to do runtime linking.
- case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*)
- for ld_flag in $LDFLAGS; do
- if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
- aix_use_runtimelinking=yes
- break
- fi
- done
- ;;
- esac
-
- exp_sym_flag='-bexport'
- no_entry_flag='-bnoentry'
- fi
-
- # When large executables or shared objects are built, AIX ld can
- # have problems creating the table of contents. If linking a library
- # or program results in "error TOC overflow" add -mminimal-toc to
- # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
- # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
-
- _LT_AC_TAGVAR(archive_cmds, $1)=''
- _LT_AC_TAGVAR(hardcode_direct, $1)=yes
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
- _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
-
- if test "$GCC" = yes; then
- case $host_os in aix4.[[012]]|aix4.[[012]].*)
- # We only want to do this on AIX 4.2 and lower, the check
- # below for broken collect2 doesn't work under 4.3+
- collect2name=`${CC} -print-prog-name=collect2`
- if test -f "$collect2name" && \
- strings "$collect2name" | grep resolve_lib_name >/dev/null
- then
- # We have reworked collect2
- _LT_AC_TAGVAR(hardcode_direct, $1)=yes
- else
- # We have old collect2
- _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
- # It fails to find uninstalled libraries when the uninstalled
- # path is not listed in the libpath. Setting hardcode_minus_L
- # to unsupported forces relinking
- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
- fi
- ;;
- esac
- shared_flag='-shared'
- if test "$aix_use_runtimelinking" = yes; then
- shared_flag="$shared_flag "'${wl}-G'
- fi
- else
- # not using gcc
- if test "$host_cpu" = ia64; then
- # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
- # chokes on -Wl,-G. The following line is correct:
- shared_flag='-G'
- else
- if test "$aix_use_runtimelinking" = yes; then
- shared_flag='${wl}-G'
- else
- shared_flag='${wl}-bM:SRE'
- fi
- fi
- fi
-
- # It seems that -bexpall does not export symbols beginning with
- # underscore (_), so it is better to generate a list of symbols to export.
- _LT_AC_TAGVAR(always_export_symbols, $1)=yes
- if test "$aix_use_runtimelinking" = yes; then
- # Warning - without using the other runtime loading flags (-brtl),
- # -berok will link without error, but may produce a broken library.
- _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok'
- # Determine the default libpath from the value encoded in an empty executable.
- _LT_AC_SYS_LIBPATH_AIX
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
- else
- if test "$host_cpu" = ia64; then
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
- _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
- else
- # Determine the default libpath from the value encoded in an empty executable.
- _LT_AC_SYS_LIBPATH_AIX
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
- # Warning - without using the other run time loading flags,
- # -berok will link without error, but may produce a broken library.
- _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
- _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
- # Exported symbols can be pulled into shared objects from archives
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
- # This is similar to how AIX traditionally builds its shared libraries.
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
- fi
- fi
- ;;
-
- amigaos*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
- # see comment about different semantics on the GNU ld section
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
-
- bsdi[[45]]*)
- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
- ;;
-
- cygwin* | mingw* | pw32*)
- # When not using gcc, we currently assume that we are using
- # Microsoft Visual C++.
- # hardcode_libdir_flag_spec is actually meaningless, as there is
- # no search path for DLLs.
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
- _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
- # Tell ltmain to make .lib files, not .a files.
- libext=lib
- # Tell ltmain to make .dll files, not .so files.
- shrext_cmds=".dll"
- # FIXME: Setting linknames here is a bad hack.
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
- # The linker will automatically build a .lib file if we build a DLL.
- _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true'
- # FIXME: Should let the user specify the lib program.
- _LT_AC_TAGVAR(old_archive_cmds, $1)='lib /OUT:$oldlib$oldobjs$old_deplibs'
- _LT_AC_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`'
- _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
- ;;
-
- darwin* | rhapsody*)
- case $host_os in
- rhapsody* | darwin1.[[012]])
- _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress'
- ;;
- *) # Darwin 1.3 on
- if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
- _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
- else
- case ${MACOSX_DEPLOYMENT_TARGET} in
- 10.[[012]])
- _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
- ;;
- 10.*)
- _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup'
- ;;
- esac
- fi
- ;;
- esac
- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
- _LT_AC_TAGVAR(hardcode_direct, $1)=no
- _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=''
- _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
- if test "$GCC" = yes ; then
- output_verbose_link_cmd='echo'
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
- _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
- # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- else
- case $cc_basename in
- xlc*)
- output_verbose_link_cmd='echo'
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
- _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
- # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- ;;
- *)
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- esac
- fi
- ;;
-
- dgux*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
-
- freebsd1*)
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
-
- # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
- # support. Future versions do this automatically, but an explicit c++rt0.o
- # does not break anything, and helps significantly (at the cost of a little
- # extra space).
- freebsd2.2*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
- _LT_AC_TAGVAR(hardcode_direct, $1)=yes
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
-
- # Unfortunately, older versions of FreeBSD 2 do not have this feature.
- freebsd2*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
- _LT_AC_TAGVAR(hardcode_direct, $1)=yes
- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
-
- # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
- freebsd* | kfreebsd*-gnu | dragonfly*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
- _LT_AC_TAGVAR(hardcode_direct, $1)=yes
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
-
- hpux9*)
- if test "$GCC" = yes; then
- _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
- else
- _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
- fi
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
- _LT_AC_TAGVAR(hardcode_direct, $1)=yes
-
- # hardcode_minus_L: Not really in the search PATH,
- # but as the default location of the library.
- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
- ;;
-
- hpux10*)
- if test "$GCC" = yes -a "$with_gnu_ld" = no; then
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
- else
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
- fi
- if test "$with_gnu_ld" = no; then
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-
- _LT_AC_TAGVAR(hardcode_direct, $1)=yes
- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
-
- # hardcode_minus_L: Not really in the search PATH,
- # but as the default location of the library.
- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
- fi
- ;;
-
- hpux11*)
- if test "$GCC" = yes -a "$with_gnu_ld" = no; then
- case $host_cpu in
- hppa*64*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- ia64*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- *)
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- esac
- else
- case $host_cpu in
- hppa*64*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- ia64*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- *)
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- esac
- fi
- if test "$with_gnu_ld" = no; then
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-
- case $host_cpu in
- hppa*64*|ia64*)
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
- _LT_AC_TAGVAR(hardcode_direct, $1)=no
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
- *)
- _LT_AC_TAGVAR(hardcode_direct, $1)=yes
- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
-
- # hardcode_minus_L: Not really in the search PATH,
- # but as the default location of the library.
- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
- ;;
- esac
- fi
- ;;
-
- irix5* | irix6* | nonstopux*)
- if test "$GCC" = yes; then
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- else
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir'
- fi
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
- _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
- ;;
-
- netbsd*)
- if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
- else
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
- fi
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
- _LT_AC_TAGVAR(hardcode_direct, $1)=yes
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
-
- newsos6)
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- _LT_AC_TAGVAR(hardcode_direct, $1)=yes
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
-
- openbsd*)
- _LT_AC_TAGVAR(hardcode_direct, $1)=yes
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
- else
- case $host_os in
- openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
- ;;
- *)
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
- ;;
- esac
- fi
- ;;
-
- os2*)
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
- _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
- _LT_AC_TAGVAR(archive_cmds, $1)='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
- _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
- ;;
-
- osf3*)
- if test "$GCC" = yes; then
- _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- else
- _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
- fi
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
- ;;
-
- osf4* | osf5*) # as osf3* with the addition of -msym flag
- if test "$GCC" = yes; then
- _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
- else
- _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
- $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp'
-
- # Both c and cxx compiler support -rpath directly
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
- fi
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
- ;;
-
- solaris*)
- _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text'
- if test "$GCC" = yes; then
- wlarc='${wl}'
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
- $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
- else
- wlarc=''
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
- $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
- fi
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- case $host_os in
- solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
- *)
- # The compiler driver will combine linker options so we
- # cannot just pass the convience library names through
- # without $wl, iff we do not link with $LD.
- # Luckily, gcc supports the same syntax we need for Sun Studio.
- # Supported since Solaris 2.6 (maybe 2.5.1?)
- case $wlarc in
- '')
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;;
- *)
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;;
- esac ;;
- esac
- _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
- ;;
-
- sunos4*)
- if test "x$host_vendor" = xsequent; then
- # Use $CC to link under sequent, because it throws in some extra .o
- # files that make .init and .fini sections work.
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
- else
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
- fi
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- _LT_AC_TAGVAR(hardcode_direct, $1)=yes
- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
-
- sysv4)
- case $host_vendor in
- sni)
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- _LT_AC_TAGVAR(hardcode_direct, $1)=yes # is this really true???
- ;;
- siemens)
- ## LD is ld it makes a PLAMLIB
- ## CC just makes a GrossModule.
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
- _LT_AC_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
- _LT_AC_TAGVAR(hardcode_direct, $1)=no
- ;;
- motorola)
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- _LT_AC_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
- ;;
- esac
- runpath_var='LD_RUN_PATH'
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
-
- sysv4.3*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
- ;;
-
- sysv4*MP*)
- if test -d /usr/nec; then
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- runpath_var=LD_RUN_PATH
- hardcode_runpath_var=yes
- _LT_AC_TAGVAR(ld_shlibs, $1)=yes
- fi
- ;;
-
- sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7*)
- _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- runpath_var='LD_RUN_PATH'
-
- if test "$GCC" = yes; then
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- else
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- fi
- ;;
-
- sysv5* | sco3.2v5* | sco5v6*)
- # Note: We can NOT use -z defs as we might desire, because we do not
- # link with -lc, and that would cause any symbols used from libc to
- # always be unresolved, which means just about no library would
- # ever link correctly. If we're not using GNU ld we use -z text
- # though, which does catch some bad symbols but isn't as heavy-handed
- # as -z defs.
- _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
- _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
- _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
- runpath_var='LD_RUN_PATH'
-
- if test "$GCC" = yes; then
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- else
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- fi
- ;;
-
- uts4*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
-
- *)
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- esac
- fi
-])
-AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)])
-test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
-
-#
-# Do we need to explicitly link libc?
-#
-case "x$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)" in
-x|xyes)
- # Assume -lc should be added
- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
-
- if test "$enable_shared" = yes && test "$GCC" = yes; then
- case $_LT_AC_TAGVAR(archive_cmds, $1) in
- *'~'*)
- # FIXME: we may have to deal with multi-command sequences.
- ;;
- '$CC '*)
- # Test whether the compiler implicitly links with -lc since on some
- # systems, -lgcc has to come before -lc. If gcc already passes -lc
- # to ld, don't add -lc before -lgcc.
- AC_MSG_CHECKING([whether -lc should be explicitly linked in])
- $rm conftest*
- printf "$lt_simple_compile_test_code" > conftest.$ac_ext
-
- if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
- soname=conftest
- lib=conftest
- libobjs=conftest.$ac_objext
- deplibs=
- wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)
- pic_flag=$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)
- compiler_flags=-v
- linker_flags=-v
- verstring=
- output_objdir=.
- libname=conftest
- lt_save_allow_undefined_flag=$_LT_AC_TAGVAR(allow_undefined_flag, $1)
- _LT_AC_TAGVAR(allow_undefined_flag, $1)=
- if AC_TRY_EVAL(_LT_AC_TAGVAR(archive_cmds, $1) 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1)
- then
- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
- else
- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
- fi
- _LT_AC_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
- else
- cat conftest.err 1>&5
- fi
- $rm conftest*
- AC_MSG_RESULT([$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)])
- ;;
- esac
- fi
- ;;
-esac
-])# AC_LIBTOOL_PROG_LD_SHLIBS
-
-
-# _LT_AC_FILE_LTDLL_C
-# -------------------
-# Be careful that the start marker always follows a newline.
-AC_DEFUN([_LT_AC_FILE_LTDLL_C], [
-# /* ltdll.c starts here */
-# #define WIN32_LEAN_AND_MEAN
-# #include <windows.h>
-# #undef WIN32_LEAN_AND_MEAN
-# #include <stdio.h>
-#
-# #ifndef __CYGWIN__
-# # ifdef __CYGWIN32__
-# # define __CYGWIN__ __CYGWIN32__
-# # endif
-# #endif
-#
-# #ifdef __cplusplus
-# extern "C" {
-# #endif
-# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
-# #ifdef __cplusplus
-# }
-# #endif
-#
-# #ifdef __CYGWIN__
-# #include <cygwin/cygwin_dll.h>
-# DECLARE_CYGWIN_DLL( DllMain );
-# #endif
-# HINSTANCE __hDllInstance_base;
-#
-# BOOL APIENTRY
-# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
-# {
-# __hDllInstance_base = hInst;
-# return TRUE;
-# }
-# /* ltdll.c ends here */
-])# _LT_AC_FILE_LTDLL_C
-
-
-# _LT_AC_TAGVAR(VARNAME, [TAGNAME])
-# ---------------------------------
-AC_DEFUN([_LT_AC_TAGVAR], [ifelse([$2], [], [$1], [$1_$2])])
-
-
-# old names
-AC_DEFUN([AM_PROG_LIBTOOL], [AC_PROG_LIBTOOL])
-AC_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
-AC_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
-AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
-AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
-AC_DEFUN([AM_PROG_LD], [AC_PROG_LD])
-AC_DEFUN([AM_PROG_NM], [AC_PROG_NM])
-
-# This is just to silence aclocal about the macro not being used
-ifelse([AC_DISABLE_FAST_INSTALL])
-
-AC_DEFUN([LT_AC_PROG_GCJ],
-[AC_CHECK_TOOL(GCJ, gcj, no)
- test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
- AC_SUBST(GCJFLAGS)
-])
-
-AC_DEFUN([LT_AC_PROG_RC],
-[AC_CHECK_TOOL(RC, windres, no)
-])
-
-############################################################
-# NOTE: This macro has been submitted for inclusion into #
-# GNU Autoconf as AC_PROG_SED. When it is available in #
-# a released version of Autoconf we should remove this #
-# macro and use it instead. #
-############################################################
-# LT_AC_PROG_SED
-# --------------
-# Check for a fully-functional sed program, that truncates
-# as few characters as possible. Prefer GNU sed if found.
-AC_DEFUN([LT_AC_PROG_SED],
-[AC_MSG_CHECKING([for a sed that does not truncate output])
-AC_CACHE_VAL(lt_cv_path_SED,
-[# Loop through the user's path and test for sed and gsed.
-# Then use that list of sed's as ones to test for truncation.
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for lt_ac_prog in sed gsed; do
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
- lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
- fi
- done
- done
-done
-lt_ac_max=0
-lt_ac_count=0
-# Add /usr/xpg4/bin/sed as it is typically found on Solaris
-# along with /bin/sed that truncates output.
-for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
- test ! -f $lt_ac_sed && continue
- cat /dev/null > conftest.in
- lt_ac_count=0
- echo $ECHO_N "0123456789$ECHO_C" >conftest.in
- # Check for GNU sed and select it if it is found.
- if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
- lt_cv_path_SED=$lt_ac_sed
- break
- fi
- while true; do
- cat conftest.in conftest.in >conftest.tmp
- mv conftest.tmp conftest.in
- cp conftest.in conftest.nl
- echo >>conftest.nl
- $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
- cmp -s conftest.out conftest.nl || break
- # 10000 chars as input seems more than enough
- test $lt_ac_count -gt 10 && break
- lt_ac_count=`expr $lt_ac_count + 1`
- if test $lt_ac_count -gt $lt_ac_max; then
- lt_ac_max=$lt_ac_count
- lt_cv_path_SED=$lt_ac_sed
- fi
- done
-done
-])
-SED=$lt_cv_path_SED
-AC_MSG_RESULT([$SED])
-])
diff --git a/release_23/autoconf/m4/link_use_r.m4 b/release_23/autoconf/m4/link_use_r.m4
deleted file mode 100644
index 30c964e25971..000000000000
--- a/release_23/autoconf/m4/link_use_r.m4
+++ /dev/null
@@ -1,19 +0,0 @@
-#
-# Determine if the system can handle the -R option being passed to the linker.
-#
-# This macro is specific to LLVM.
-#
-AC_DEFUN([AC_LINK_USE_R],
-[AC_CACHE_CHECK([for compiler -Wl,-R<path> option],[llvm_cv_link_use_r],
-[ AC_LANG_PUSH([C])
- oldcflags="$CFLAGS"
- CFLAGS="$CFLAGS -Wl,-R."
- AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[int main() { return 0; }]])],
- [llvm_cv_link_use_r=yes],[llvm_cv_link_use_r=no])
- CFLAGS="$oldcflags"
- AC_LANG_POP([C])
-])
-if test "$llvm_cv_link_use_r" = yes ; then
- AC_DEFINE([HAVE_LINK_R],[1],[Define if you can use -Wl,-R. to pass -R. to the linker, in order to add the current directory to the dynamic linker search path.])
- fi
-])
diff --git a/release_23/autoconf/m4/ltdl.m4 b/release_23/autoconf/m4/ltdl.m4
deleted file mode 100644
index bc9e2ad24193..000000000000
--- a/release_23/autoconf/m4/ltdl.m4
+++ /dev/null
@@ -1,418 +0,0 @@
-## ltdl.m4 - Configure ltdl for the target system. -*-Autoconf-*-
-## Copyright (C) 1999-2000 Free Software Foundation, Inc.
-##
-## This file is free software; the Free Software Foundation gives
-## unlimited permission to copy and/or distribute it, with or without
-## modifications, as long as this notice is preserved.
-
-# serial 7 AC_LIB_LTDL
-
-# AC_WITH_LTDL
-# ------------
-# Clients of libltdl can use this macro to allow the installer to
-# choose between a shipped copy of the ltdl sources or a preinstalled
-# version of the library.
-AC_DEFUN([AC_WITH_LTDL],
-[AC_REQUIRE([AC_LIB_LTDL])
-AC_SUBST([LIBLTDL])
-AC_SUBST([INCLTDL])
-
-# Unless the user asks us to check, assume no installed ltdl exists.
-use_installed_libltdl=no
-
-AC_ARG_WITH([included_ltdl],
- [ --with-included-ltdl use the GNU ltdl sources included here])
-
-if test "x$with_included_ltdl" != xyes; then
- # We are not being forced to use the included libltdl sources, so
- # decide whether there is a useful installed version we can use.
- AC_CHECK_HEADER([ltdl.h],
- [AC_CHECK_LIB([ltdl], [lt_dlcaller_register],
- [with_included_ltdl=no],
- [with_included_ltdl=yes])
- ])
-fi
-
-if test "x$enable_ltdl_install" != xyes; then
- # If the user did not specify an installable libltdl, then default
- # to a convenience lib.
- AC_LIBLTDL_CONVENIENCE
-fi
-
-if test "x$with_included_ltdl" = xno; then
- # If the included ltdl is not to be used. then Use the
- # preinstalled libltdl we found.
- AC_DEFINE([HAVE_LTDL], [1],
- [Define this if a modern libltdl is already installed])
- LIBLTDL=-lltdl
-fi
-
-# Report our decision...
-AC_MSG_CHECKING([whether to use included libltdl])
-AC_MSG_RESULT([$with_included_ltdl])
-
-AC_CONFIG_SUBDIRS([libltdl])
-])# AC_WITH_LTDL
-
-
-# AC_LIB_LTDL
-# -----------
-# Perform all the checks necessary for compilation of the ltdl objects
-# -- including compiler checks and header checks.
-AC_DEFUN([AC_LIB_LTDL],
-[AC_PREREQ(2.60)
-AC_REQUIRE([AC_PROG_CC])
-AC_REQUIRE([AC_C_CONST])
-AC_REQUIRE([AC_HEADER_STDC])
-AC_REQUIRE([AC_HEADER_DIRENT])
-AC_REQUIRE([_LT_AC_CHECK_DLFCN])
-AC_REQUIRE([AC_LTDL_ENABLE_INSTALL])
-AC_REQUIRE([AC_LTDL_SHLIBEXT])
-AC_REQUIRE([AC_LTDL_SHLIBPATH])
-AC_REQUIRE([AC_LTDL_SYSSEARCHPATH])
-AC_REQUIRE([AC_LTDL_OBJDIR])
-AC_REQUIRE([AC_LTDL_DLPREOPEN])
-AC_REQUIRE([AC_LTDL_DLLIB])
-AC_REQUIRE([AC_LTDL_SYMBOL_USCORE])
-AC_REQUIRE([AC_LTDL_DLSYM_USCORE])
-AC_REQUIRE([AC_LTDL_SYS_DLOPEN_DEPLIBS])
-AC_REQUIRE([AC_LTDL_FUNC_ARGZ])
-
-AC_CHECK_HEADERS([assert.h ctype.h errno.h malloc.h memory.h stdlib.h \
- stdio.h unistd.h])
-AC_CHECK_HEADERS([dl.h sys/dl.h dld.h mach-o/dyld.h])
-AC_CHECK_HEADERS([string.h strings.h], [break])
-
-AC_CHECK_FUNCS([strchr index], [break])
-AC_CHECK_FUNCS([strrchr rindex], [break])
-AC_CHECK_FUNCS([memcpy bcopy], [break])
-AC_CHECK_FUNCS([memmove strcmp])
-AC_CHECK_FUNCS([closedir opendir readdir])
-])# AC_LIB_LTDL
-
-
-# AC_LTDL_ENABLE_INSTALL
-# ----------------------
-AC_DEFUN([AC_LTDL_ENABLE_INSTALL],
-[AC_ARG_ENABLE([ltdl-install],
- [AS_HELP_STRING([--enable-ltdl-install],[install libltdl])])
-
-AM_CONDITIONAL(INSTALL_LTDL, test x"${enable_ltdl_install-no}" != xno)
-AM_CONDITIONAL(CONVENIENCE_LTDL, test x"${enable_ltdl_convenience-no}" != xno)
-])# AC_LTDL_ENABLE_INSTALL
-
-
-# AC_LTDL_SYS_DLOPEN_DEPLIBS
-# --------------------------
-AC_DEFUN([AC_LTDL_SYS_DLOPEN_DEPLIBS],
-[AC_REQUIRE([AC_CANONICAL_HOST])
-AC_CACHE_CHECK([whether deplibs are loaded by dlopen],
- [libltdl_cv_sys_dlopen_deplibs],
- [# PORTME does your system automatically load deplibs for dlopen?
- # or its logical equivalent (e.g. shl_load for HP-UX < 11)
- # For now, we just catch OSes we know something about -- in the
- # future, we'll try test this programmatically.
- libltdl_cv_sys_dlopen_deplibs=unknown
- case "$host_os" in
- aix3*|aix4.1.*|aix4.2.*)
- # Unknown whether this is true for these versions of AIX, but
- # we want this `case' here to explicitly catch those versions.
- libltdl_cv_sys_dlopen_deplibs=unknown
- ;;
- aix[[45]]*)
- libltdl_cv_sys_dlopen_deplibs=yes
- ;;
- darwin*)
- # Assuming the user has installed a libdl from somewhere, this is true
- # If you are looking for one http://www.opendarwin.org/projects/dlcompat
- libltdl_cv_sys_dlopen_deplibs=yes
- ;;
- gnu* | linux* | kfreebsd*-gnu | knetbsd*-gnu)
- # GNU and its variants, using gnu ld.so (Glibc)
- libltdl_cv_sys_dlopen_deplibs=yes
- ;;
- hpux10*|hpux11*)
- libltdl_cv_sys_dlopen_deplibs=yes
- ;;
- interix*)
- libltdl_cv_sys_dlopen_deplibs=yes
- ;;
- irix[[12345]]*|irix6.[[01]]*)
- # Catch all versions of IRIX before 6.2, and indicate that we don't
- # know how it worked for any of those versions.
- libltdl_cv_sys_dlopen_deplibs=unknown
- ;;
- irix*)
- # The case above catches anything before 6.2, and it's known that
- # at 6.2 and later dlopen does load deplibs.
- libltdl_cv_sys_dlopen_deplibs=yes
- ;;
- netbsd*)
- libltdl_cv_sys_dlopen_deplibs=yes
- ;;
- openbsd*)
- libltdl_cv_sys_dlopen_deplibs=yes
- ;;
- osf[[1234]]*)
- # dlopen did load deplibs (at least at 4.x), but until the 5.x series,
- # it did *not* use an RPATH in a shared library to find objects the
- # library depends on, so we explictly say `no'.
- libltdl_cv_sys_dlopen_deplibs=no
- ;;
- osf5.0|osf5.0a|osf5.1)
- # dlopen *does* load deplibs and with the right loader patch applied
- # it even uses RPATH in a shared library to search for shared objects
- # that the library depends on, but there's no easy way to know if that
- # patch is installed. Since this is the case, all we can really
- # say is unknown -- it depends on the patch being installed. If
- # it is, this changes to `yes'. Without it, it would be `no'.
- libltdl_cv_sys_dlopen_deplibs=unknown
- ;;
- osf*)
- # the two cases above should catch all versions of osf <= 5.1. Read
- # the comments above for what we know about them.
- # At > 5.1, deplibs are loaded *and* any RPATH in a shared library
- # is used to find them so we can finally say `yes'.
- libltdl_cv_sys_dlopen_deplibs=yes
- ;;
- solaris*)
- libltdl_cv_sys_dlopen_deplibs=yes
- ;;
- sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
- libltdl_cv_sys_dlopen_deplibs=yes
- ;;
- esac
- ])
-if test "$libltdl_cv_sys_dlopen_deplibs" != yes; then
- AC_DEFINE([LTDL_DLOPEN_DEPLIBS], [1],
- [Define if the OS needs help to load dependent libraries for dlopen().])
-fi
-])# AC_LTDL_SYS_DLOPEN_DEPLIBS
-
-
-# AC_LTDL_SHLIBEXT
-# ----------------
-AC_DEFUN([AC_LTDL_SHLIBEXT],
-[AC_REQUIRE([AC_LIBTOOL_SYS_DYNAMIC_LINKER])
-AC_CACHE_CHECK([which extension is used for loadable modules],
- [libltdl_cv_shlibext],
-[
-module=yes
-eval libltdl_cv_shlibext=$shrext_cmds
- ])
-if test -n "$libltdl_cv_shlibext"; then
- AC_DEFINE_UNQUOTED([LTDL_SHLIB_EXT], ["$libltdl_cv_shlibext"],
- [Define to the extension used for shared libraries, say, ".so".])
-fi
-])# AC_LTDL_SHLIBEXT
-
-
-# AC_LTDL_SHLIBPATH
-# -----------------
-AC_DEFUN([AC_LTDL_SHLIBPATH],
-[AC_REQUIRE([AC_LIBTOOL_SYS_DYNAMIC_LINKER])
-AC_CACHE_CHECK([which variable specifies run-time library path],
- [libltdl_cv_shlibpath_var], [libltdl_cv_shlibpath_var="$shlibpath_var"])
-if test -n "$libltdl_cv_shlibpath_var"; then
- AC_DEFINE_UNQUOTED([LTDL_SHLIBPATH_VAR], ["$libltdl_cv_shlibpath_var"],
- [Define to the name of the environment variable that determines the dynamic library search path.])
-fi
-])# AC_LTDL_SHLIBPATH
-
-
-# AC_LTDL_SYSSEARCHPATH
-# ---------------------
-AC_DEFUN([AC_LTDL_SYSSEARCHPATH],
-[AC_REQUIRE([AC_LIBTOOL_SYS_DYNAMIC_LINKER])
-AC_CACHE_CHECK([for the default library search path],
- [libltdl_cv_sys_search_path],
- [libltdl_cv_sys_search_path="$sys_lib_dlsearch_path_spec"])
-if test -n "$libltdl_cv_sys_search_path"; then
- sys_search_path=
- for dir in $libltdl_cv_sys_search_path; do
- if test -z "$sys_search_path"; then
- sys_search_path="$dir"
- else
- sys_search_path="$sys_search_path$PATH_SEPARATOR$dir"
- fi
- done
- AC_DEFINE_UNQUOTED([LTDL_SYSSEARCHPATH], ["$sys_search_path"],
- [Define to the system default library search path.])
-fi
-])# AC_LTDL_SYSSEARCHPATH
-
-
-# AC_LTDL_OBJDIR
-# --------------
-AC_DEFUN([AC_LTDL_OBJDIR],
-[AC_CACHE_CHECK([for objdir],
- [libltdl_cv_objdir],
- [libltdl_cv_objdir="$objdir"
- if test -n "$objdir"; then
- :
- else
- rm -f .libs 2>/dev/null
- mkdir .libs 2>/dev/null
- if test -d .libs; then
- libltdl_cv_objdir=.libs
- else
- # MS-DOS does not allow filenames that begin with a dot.
- libltdl_cv_objdir=_libs
- fi
- rmdir .libs 2>/dev/null
- fi
- ])
-AC_DEFINE_UNQUOTED([LTDL_OBJDIR], ["$libltdl_cv_objdir/"],
- [Define to the sub-directory in which libtool stores uninstalled libraries.])
-])# AC_LTDL_OBJDIR
-
-
-# AC_LTDL_DLPREOPEN
-# -----------------
-AC_DEFUN([AC_LTDL_DLPREOPEN],
-[AC_REQUIRE([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])
-AC_CACHE_CHECK([whether libtool supports -dlopen/-dlpreopen],
- [libltdl_cv_preloaded_symbols],
- [if test -n "$lt_cv_sys_global_symbol_pipe"; then
- libltdl_cv_preloaded_symbols=yes
- else
- libltdl_cv_preloaded_symbols=no
- fi
- ])
-if test x"$libltdl_cv_preloaded_symbols" = xyes; then
- AC_DEFINE([HAVE_PRELOADED_SYMBOLS], [1],
- [Define if libtool can extract symbol lists from object files.])
-fi
-])# AC_LTDL_DLPREOPEN
-
-
-# AC_LTDL_DLLIB
-# -------------
-AC_DEFUN([AC_LTDL_DLLIB],
-[LIBADD_DL=
-AC_SUBST(LIBADD_DL)
-AC_LANG_PUSH([C])
-
-AC_CHECK_FUNC([shl_load],
- [AC_DEFINE([HAVE_SHL_LOAD], [1],
- [Define if you have the shl_load function.])],
- [AC_CHECK_LIB([dld], [shl_load],
- [AC_DEFINE([HAVE_SHL_LOAD], [1],
- [Define if you have the shl_load function.])
- LIBADD_DL="$LIBADD_DL -ldld"],
- [AC_CHECK_LIB([dl], [dlopen],
- [AC_DEFINE([HAVE_LIBDL], [1],
- [Define if you have the libdl library or equivalent.])
- LIBADD_DL="-ldl" libltdl_cv_lib_dl_dlopen="yes"],
- [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#if HAVE_DLFCN_H
-# include <dlfcn.h>
-#endif
- ]], [[dlopen(0, 0);]])],[AC_DEFINE([HAVE_LIBDL], [1],
- [Define if you have the libdl library or equivalent.]) libltdl_cv_func_dlopen="yes"],[AC_CHECK_LIB([svld], [dlopen],
- [AC_DEFINE([HAVE_LIBDL], [1],
- [Define if you have the libdl library or equivalent.])
- LIBADD_DL="-lsvld" libltdl_cv_func_dlopen="yes"],
- [AC_CHECK_LIB([dld], [dld_link],
- [AC_DEFINE([HAVE_DLD], [1],
- [Define if you have the GNU dld library.])
- LIBADD_DL="$LIBADD_DL -ldld"],
- [AC_CHECK_FUNC([_dyld_func_lookup],
- [AC_DEFINE([HAVE_DYLD], [1],
- [Define if you have the _dyld_func_lookup function.])])
- ])
- ])
- ])
- ])
- ])
-])
-
-if test x"$libltdl_cv_func_dlopen" = xyes || test x"$libltdl_cv_lib_dl_dlopen" = xyes
-then
- lt_save_LIBS="$LIBS"
- LIBS="$LIBS $LIBADD_DL"
- AC_CHECK_FUNCS([dlerror])
- LIBS="$lt_save_LIBS"
-fi
-AC_LANG_POP
-])# AC_LTDL_DLLIB
-
-
-# AC_LTDL_SYMBOL_USCORE
-# ---------------------
-# does the compiler prefix global symbols with an underscore?
-AC_DEFUN([AC_LTDL_SYMBOL_USCORE],
-[AC_REQUIRE([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])
-AC_CACHE_CHECK([for _ prefix in compiled symbols],
- [ac_cv_sys_symbol_underscore],
- [ac_cv_sys_symbol_underscore=no
- cat > conftest.$ac_ext <<EOF
-void nm_test_func(){}
-int main(){nm_test_func;return 0;}
-EOF
- if AC_TRY_EVAL(ac_compile); then
- # Now try to grab the symbols.
- ac_nlist=conftest.nm
- if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $ac_nlist) && test -s "$ac_nlist"; then
- # See whether the symbols have a leading underscore.
- if grep '^. _nm_test_func' "$ac_nlist" >/dev/null; then
- ac_cv_sys_symbol_underscore=yes
- else
- if grep '^. nm_test_func ' "$ac_nlist" >/dev/null; then
- :
- else
- echo "configure: cannot find nm_test_func in $ac_nlist" >&AS_MESSAGE_LOG_FD
- fi
- fi
- else
- echo "configure: cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
- fi
- else
- echo "configure: failed program was:" >&AS_MESSAGE_LOG_FD
- cat conftest.c >&AS_MESSAGE_LOG_FD
- fi
- rm -rf conftest*
- ])
-])# AC_LTDL_SYMBOL_USCORE
-
-
-# AC_LTDL_DLSYM_USCORE
-# --------------------
-AC_DEFUN([AC_LTDL_DLSYM_USCORE],
-[AC_REQUIRE([AC_LTDL_SYMBOL_USCORE])
-if test x"$ac_cv_sys_symbol_underscore" = xyes; then
- if test x"$libltdl_cv_func_dlopen" = xyes ||
- test x"$libltdl_cv_lib_dl_dlopen" = xyes ; then
- AC_CACHE_CHECK([whether we have to add an underscore for dlsym],
- [libltdl_cv_need_uscore],
- [libltdl_cv_need_uscore=unknown
- save_LIBS="$LIBS"
- LIBS="$LIBS $LIBADD_DL"
- _LT_AC_TRY_DLOPEN_SELF(
- [libltdl_cv_need_uscore=no], [libltdl_cv_need_uscore=yes],
- [], [libltdl_cv_need_uscore=cross])
- LIBS="$save_LIBS"
- ])
- fi
-fi
-
-if test x"$libltdl_cv_need_uscore" = xyes; then
- AC_DEFINE([NEED_USCORE], [1],
- [Define if dlsym() requires a leading underscore in symbol names.])
-fi
-])# AC_LTDL_DLSYM_USCORE
-
-# AC_LTDL_FUNC_ARGZ
-# -----------------
-AC_DEFUN([AC_LTDL_FUNC_ARGZ],
-[AC_CHECK_HEADERS([argz.h])
-
-AC_CHECK_TYPES([error_t],
- [],
- [AC_DEFINE([error_t], [int],
- [Define to a type to use for `error_t' if it is not otherwise available.])],
- [#if HAVE_ARGZ_H
-# include <argz.h>
-#endif])
-
-AC_CHECK_FUNCS([argz_append argz_create_sep argz_insert argz_next argz_stringify])
-])# AC_LTDL_FUNC_ARGZ
diff --git a/release_23/autoconf/m4/need_dev_zero_for_mmap.m4 b/release_23/autoconf/m4/need_dev_zero_for_mmap.m4
deleted file mode 100644
index 57b322830172..000000000000
--- a/release_23/autoconf/m4/need_dev_zero_for_mmap.m4
+++ /dev/null
@@ -1,17 +0,0 @@
-#
-# When allocating RWX memory, check whether we need to use /dev/zero
-# as the file descriptor or not.
-#
-AC_DEFUN([AC_NEED_DEV_ZERO_FOR_MMAP],
-[AC_CACHE_CHECK([if /dev/zero is needed for mmap],
-ac_cv_need_dev_zero_for_mmap,
-[if test "$llvm_cv_os_type" = "Interix" ; then
- ac_cv_need_dev_zero_for_mmap=yes
- else
- ac_cv_need_dev_zero_for_mmap=no
- fi
-])
-if test "$ac_cv_need_dev_zero_for_mmap" = yes; then
- AC_DEFINE([NEED_DEV_ZERO_FOR_MMAP],[1],
- [Define if /dev/zero should be used when mapping RWX memory, or undefine if its not necessary])
-fi])
diff --git a/release_23/autoconf/m4/path_perl.m4 b/release_23/autoconf/m4/path_perl.m4
deleted file mode 100644
index 406656cb0322..000000000000
--- a/release_23/autoconf/m4/path_perl.m4
+++ /dev/null
@@ -1,16 +0,0 @@
-dnl Check for a reasonable version of Perl.
-dnl $1 - Minimum Perl version. Typically 5.006.
-dnl
-AC_DEFUN([LLVM_PROG_PERL], [
-AC_PATH_PROG(PERL, [perl], [none])
-if test "$PERL" != "none"; then
- AC_MSG_CHECKING(for Perl $1 or newer)
- if $PERL -e 'use $1;' 2>&1 > /dev/null; then
- AC_MSG_RESULT(yes)
- else
- PERL=none
- AC_MSG_RESULT(not found)
- fi
-fi
-])
-
diff --git a/release_23/autoconf/m4/path_tclsh.m4 b/release_23/autoconf/m4/path_tclsh.m4
deleted file mode 100644
index e0a9d067a163..000000000000
--- a/release_23/autoconf/m4/path_tclsh.m4
+++ /dev/null
@@ -1,39 +0,0 @@
-dnl This macro checks for tclsh which is required to run dejagnu. On some
-dnl platforms (notably FreeBSD), tclsh is named tclshX.Y - this handles
-dnl that for us so we can get the latest installed tclsh version.
-dnl
-AC_DEFUN([DJ_AC_PATH_TCLSH], [
-no_itcl=true
-AC_MSG_CHECKING(for the tclsh program in tclinclude directory)
-AC_ARG_WITH(tclinclude,
- AS_HELP_STRING([--with-tclinclude],
- [directory where tcl headers are]),
- [with_tclinclude=${withval}],[with_tclinclude=''])
-AC_CACHE_VAL(ac_cv_path_tclsh,[
-dnl first check to see if --with-itclinclude was specified
-if test x"${with_tclinclude}" != x ; then
- if test -f ${with_tclinclude}/tclsh ; then
- ac_cv_path_tclsh=`(cd ${with_tclinclude}; pwd)`
- elif test -f ${with_tclinclude}/src/tclsh ; then
- ac_cv_path_tclsh=`(cd ${with_tclinclude}/src; pwd)`
- else
- AC_MSG_ERROR([${with_tclinclude} directory doesn't contain tclsh])
- fi
-fi
-
-dnl see if one is installed
-if test x"${ac_cv_path_tclsh}" = x ; then
- AC_MSG_RESULT(none)
- AC_PATH_PROGS([TCLSH],[tclsh8.4 tclsh8.4.8 tclsh8.4.7 tclsh8.4.6 tclsh8.4.5 tclsh8.4.4 tclsh8.4.3 tclsh8.4.2 tclsh8.4.1 tclsh8.4.0 tclsh8.3 tclsh8.3.5 tclsh8.3.4 tclsh8.3.3 tclsh8.3.2 tclsh8.3.1 tclsh8.3.0 tclsh])
- if test x"${TCLSH}" = x ; then
- ac_cv_path_tclsh='';
- else
- ac_cv_path_tclsh="${TCLSH}";
- fi
-else
- AC_MSG_RESULT(${ac_cv_path_tclsh})
- TCLSH="${ac_cv_path_tclsh}"
- AC_SUBST(TCLSH)
-fi
-])])
-
diff --git a/release_23/autoconf/m4/rand48.m4 b/release_23/autoconf/m4/rand48.m4
deleted file mode 100644
index 56705d85c9c5..000000000000
--- a/release_23/autoconf/m4/rand48.m4
+++ /dev/null
@@ -1,12 +0,0 @@
-#
-# This function determins if the the srand48,drand48,lrand48 functions are
-# available on this platform.
-#
-AC_DEFUN([AC_FUNC_RAND48],[
-AC_SINGLE_CXX_CHECK([ac_cv_func_rand48],
- [srand48/lrand48/drand48], [<stdlib.h>],
- [srand48(0);lrand48();drand48();])
-if test "$ac_cv_func_rand48" = "yes" ; then
-AC_DEFINE([HAVE_RAND48],1,[Define to 1 if srand48/lrand48/drand48 exist in <stdlib.h>])
-fi
-])
diff --git a/release_23/autoconf/m4/sanity_check.m4 b/release_23/autoconf/m4/sanity_check.m4
deleted file mode 100644
index 639fccca2464..000000000000
--- a/release_23/autoconf/m4/sanity_check.m4
+++ /dev/null
@@ -1,31 +0,0 @@
-dnl Check a program for version sanity. The test runs a program, passes it an
-dnl argument to make it print out some identification string, and filters that
-dnl output with a regular expression. If the output is non-empty, the program
-dnl passes the sanity check.
-dnl $1 - Name or full path of the program to run
-dnl $2 - Argument to pass to print out identification string
-dnl $3 - grep RE to match identification string
-dnl $4 - set to 1 to make errors only a warning
-AC_DEFUN([CHECK_PROGRAM_SANITY],
-[
-AC_MSG_CHECKING([sanity for program ]$1)
-sanity="0"
-sanity_path=`which $1 2>/dev/null`
-if test "$?" -eq 0 -a -x "$sanity_path" ; then
- sanity=`$1 $2 2>&1 | grep "$3"`
- if test -z "$sanity" ; then
- AC_MSG_RESULT([no])
- sanity="0"
- if test "$4" -eq 1 ; then
- AC_MSG_WARN([Program ]$1[ failed to pass sanity check.])
- else
- AC_MSG_ERROR([Program ]$1[ failed to pass sanity check.])
- fi
- else
- AC_MSG_RESULT([yes])
- sanity="1"
- fi
-else
- AC_MSG_RESULT([not found])
-fi
-])
diff --git a/release_23/autoconf/m4/single_cxx_check.m4 b/release_23/autoconf/m4/single_cxx_check.m4
deleted file mode 100644
index 21efa4bed353..000000000000
--- a/release_23/autoconf/m4/single_cxx_check.m4
+++ /dev/null
@@ -1,10 +0,0 @@
-dnl AC_SINGLE_CXX_CHECK(CACHEVAR, FUNCTION, HEADER, PROGRAM)
-dnl $1, $2, $3, $4,
-dnl
-AC_DEFUN([AC_SINGLE_CXX_CHECK],
- [AC_CACHE_CHECK([for $2 in $3], [$1],
- [AC_LANG_PUSH([C++])
- AC_COMPILE_IFELSE(AC_LANG_PROGRAM([#include $3],[$4]),[$1=yes],[$1=no])
- AC_LANG_POP([C++])])
- ])
-
diff --git a/release_23/autoconf/missing b/release_23/autoconf/missing
deleted file mode 100755
index 64b5f901dd55..000000000000
--- a/release_23/autoconf/missing
+++ /dev/null
@@ -1,353 +0,0 @@
-#! /bin/sh
-# Common stub for a few missing GNU programs while installing.
-
-scriptversion=2004-09-07.08
-
-# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004
-# Free Software Foundation, Inc.
-# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
-
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-if test $# -eq 0; then
- echo 1>&2 "Try \`$0 --help' for more information"
- exit 1
-fi
-
-run=:
-
-# In the cases where this matters, `missing' is being run in the
-# srcdir already.
-if test -f configure.ac; then
- configure_ac=configure.ac
-else
- configure_ac=configure.in
-fi
-
-msg="missing on your system"
-
-case "$1" in
---run)
- # Try to run requested program, and just exit if it succeeds.
- run=
- shift
- "$@" && exit 0
- # Exit code 63 means version mismatch. This often happens
- # when the user try to use an ancient version of a tool on
- # a file that requires a minimum version. In this case we
- # we should proceed has if the program had been absent, or
- # if --run hadn't been passed.
- if test $? = 63; then
- run=:
- msg="probably too old"
- fi
- ;;
-
- -h|--h|--he|--hel|--help)
- echo "\
-$0 [OPTION]... PROGRAM [ARGUMENT]...
-
-Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
-error status if there is no known handling for PROGRAM.
-
-Options:
- -h, --help display this help and exit
- -v, --version output version information and exit
- --run try to run the given command, and emulate it if it fails
-
-Supported PROGRAM values:
- aclocal touch file \`aclocal.m4'
- autoconf touch file \`configure'
- autoheader touch file \`config.h.in'
- automake touch all \`Makefile.in' files
- bison create \`y.tab.[ch]', if possible, from existing .[ch]
- flex create \`lex.yy.c', if possible, from existing .c
- help2man touch the output file
- lex create \`lex.yy.c', if possible, from existing .c
- makeinfo touch the output file
- tar try tar, gnutar, gtar, then tar without non-portable flags
- yacc create \`y.tab.[ch]', if possible, from existing .[ch]
-
-Send bug reports to <bug-automake@gnu.org>."
- exit 0
- ;;
-
- -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
- echo "missing $scriptversion (GNU Automake)"
- exit 0
- ;;
-
- -*)
- echo 1>&2 "$0: Unknown \`$1' option"
- echo 1>&2 "Try \`$0 --help' for more information"
- exit 1
- ;;
-
-esac
-
-# Now exit if we have it, but it failed. Also exit now if we
-# don't have it and --version was passed (most likely to detect
-# the program).
-case "$1" in
- lex|yacc)
- # Not GNU programs, they don't have --version.
- ;;
-
- tar)
- if test -n "$run"; then
- echo 1>&2 "ERROR: \`tar' requires --run"
- exit 1
- elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
- exit 1
- fi
- ;;
-
- *)
- if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
- # We have it, but it failed.
- exit 1
- elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
- # Could not run --version or --help. This is probably someone
- # running `$TOOL --version' or `$TOOL --help' to check whether
- # $TOOL exists and not knowing $TOOL uses missing.
- exit 1
- fi
- ;;
-esac
-
-# If it does not exist, or fails to run (possibly an outdated version),
-# try to emulate it.
-case "$1" in
- aclocal*)
- echo 1>&2 "\
-WARNING: \`$1' is $msg. You should only need it if
- you modified \`acinclude.m4' or \`${configure_ac}'. You might want
- to install the \`Automake' and \`Perl' packages. Grab them from
- any GNU archive site."
- touch aclocal.m4
- ;;
-
- autoconf)
- echo 1>&2 "\
-WARNING: \`$1' is $msg. You should only need it if
- you modified \`${configure_ac}'. You might want to install the
- \`Autoconf' and \`GNU m4' packages. Grab them from any GNU
- archive site."
- touch configure
- ;;
-
- autoheader)
- echo 1>&2 "\
-WARNING: \`$1' is $msg. You should only need it if
- you modified \`acconfig.h' or \`${configure_ac}'. You might want
- to install the \`Autoconf' and \`GNU m4' packages. Grab them
- from any GNU archive site."
- files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
- test -z "$files" && files="config.h"
- touch_files=
- for f in $files; do
- case "$f" in
- *:*) touch_files="$touch_files "`echo "$f" |
- sed -e 's/^[^:]*://' -e 's/:.*//'`;;
- *) touch_files="$touch_files $f.in";;
- esac
- done
- touch $touch_files
- ;;
-
- automake*)
- echo 1>&2 "\
-WARNING: \`$1' is $msg. You should only need it if
- you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
- You might want to install the \`Automake' and \`Perl' packages.
- Grab them from any GNU archive site."
- find . -type f -name Makefile.am -print |
- sed 's/\.am$/.in/' |
- while read f; do touch "$f"; done
- ;;
-
- autom4te)
- echo 1>&2 "\
-WARNING: \`$1' is needed, but is $msg.
- You might have modified some files without having the
- proper tools for further handling them.
- You can get \`$1' as part of \`Autoconf' from any GNU
- archive site."
-
- file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'`
- test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'`
- if test -f "$file"; then
- touch $file
- else
- test -z "$file" || exec >$file
- echo "#! /bin/sh"
- echo "# Created by GNU Automake missing as a replacement of"
- echo "# $ $@"
- echo "exit 0"
- chmod +x $file
- exit 1
- fi
- ;;
-
- bison|yacc)
- echo 1>&2 "\
-WARNING: \`$1' $msg. You should only need it if
- you modified a \`.y' file. You may need the \`Bison' package
- in order for those modifications to take effect. You can get
- \`Bison' from any GNU archive site."
- rm -f y.tab.c y.tab.h
- if [ $# -ne 1 ]; then
- eval LASTARG="\${$#}"
- case "$LASTARG" in
- *.y)
- SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
- if [ -f "$SRCFILE" ]; then
- cp "$SRCFILE" y.tab.c
- fi
- SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
- if [ -f "$SRCFILE" ]; then
- cp "$SRCFILE" y.tab.h
- fi
- ;;
- esac
- fi
- if [ ! -f y.tab.h ]; then
- echo >y.tab.h
- fi
- if [ ! -f y.tab.c ]; then
- echo 'main() { return 0; }' >y.tab.c
- fi
- ;;
-
- lex|flex)
- echo 1>&2 "\
-WARNING: \`$1' is $msg. You should only need it if
- you modified a \`.l' file. You may need the \`Flex' package
- in order for those modifications to take effect. You can get
- \`Flex' from any GNU archive site."
- rm -f lex.yy.c
- if [ $# -ne 1 ]; then
- eval LASTARG="\${$#}"
- case "$LASTARG" in
- *.l)
- SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
- if [ -f "$SRCFILE" ]; then
- cp "$SRCFILE" lex.yy.c
- fi
- ;;
- esac
- fi
- if [ ! -f lex.yy.c ]; then
- echo 'main() { return 0; }' >lex.yy.c
- fi
- ;;
-
- help2man)
- echo 1>&2 "\
-WARNING: \`$1' is $msg. You should only need it if
- you modified a dependency of a manual page. You may need the
- \`Help2man' package in order for those modifications to take
- effect. You can get \`Help2man' from any GNU archive site."
-
- file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
- if test -z "$file"; then
- file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'`
- fi
- if [ -f "$file" ]; then
- touch $file
- else
- test -z "$file" || exec >$file
- echo ".ab help2man is required to generate this page"
- exit 1
- fi
- ;;
-
- makeinfo)
- echo 1>&2 "\
-WARNING: \`$1' is $msg. You should only need it if
- you modified a \`.texi' or \`.texinfo' file, or any other file
- indirectly affecting the aspect of the manual. The spurious
- call might also be the consequence of using a buggy \`make' (AIX,
- DU, IRIX). You might want to install the \`Texinfo' package or
- the \`GNU make' package. Grab either from any GNU archive site."
- file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
- if test -z "$file"; then
- file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
- file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file`
- fi
- touch $file
- ;;
-
- tar)
- shift
-
- # We have already tried tar in the generic part.
- # Look for gnutar/gtar before invocation to avoid ugly error
- # messages.
- if (gnutar --version > /dev/null 2>&1); then
- gnutar "$@" && exit 0
- fi
- if (gtar --version > /dev/null 2>&1); then
- gtar "$@" && exit 0
- fi
- firstarg="$1"
- if shift; then
- case "$firstarg" in
- *o*)
- firstarg=`echo "$firstarg" | sed s/o//`
- tar "$firstarg" "$@" && exit 0
- ;;
- esac
- case "$firstarg" in
- *h*)
- firstarg=`echo "$firstarg" | sed s/h//`
- tar "$firstarg" "$@" && exit 0
- ;;
- esac
- fi
-
- echo 1>&2 "\
-WARNING: I can't seem to be able to run \`tar' with the given arguments.
- You may want to install GNU tar or Free paxutils, or check the
- command line arguments."
- exit 1
- ;;
-
- *)
- echo 1>&2 "\
-WARNING: \`$1' is needed, and is $msg.
- You might have modified some files without having the
- proper tools for further handling them. Check the \`README' file,
- it often tells you about the needed prerequisites for installing
- this package. You may also peek at any GNU archive site, in case
- some other package would contain this missing \`$1' program."
- exit 1
- ;;
-esac
-
-exit 0
-
-# Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
-# time-stamp-start: "scriptversion="
-# time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-end: "$"
-# End:
diff --git a/release_23/autoconf/mkinstalldirs b/release_23/autoconf/mkinstalldirs
deleted file mode 100755
index 1ee2d580177f..000000000000
--- a/release_23/autoconf/mkinstalldirs
+++ /dev/null
@@ -1,150 +0,0 @@
-#! /bin/sh
-# mkinstalldirs --- make directory hierarchy
-
-scriptversion=2004-02-15.20
-
-# Original author: Noah Friedman <friedman@prep.ai.mit.edu>
-# Created: 1993-05-16
-# Public domain.
-#
-# This file is maintained in Automake, please report
-# bugs to <bug-automake@gnu.org> or send patches to
-# <automake-patches@gnu.org>.
-
-errstatus=0
-dirmode=""
-
-usage="\
-Usage: mkinstalldirs [-h] [--help] [--version] [-m MODE] DIR ...
-
-Create each directory DIR (with mode MODE, if specified), including all
-leading file name components.
-
-Report bugs to <bug-automake@gnu.org>."
-
-# process command line arguments
-while test $# -gt 0 ; do
- case $1 in
- -h | --help | --h*) # -h for help
- echo "$usage"
- exit 0
- ;;
- -m) # -m PERM arg
- shift
- test $# -eq 0 && { echo "$usage" 1>&2; exit 1; }
- dirmode=$1
- shift
- ;;
- --version)
- echo "$0 $scriptversion"
- exit 0
- ;;
- --) # stop option processing
- shift
- break
- ;;
- -*) # unknown option
- echo "$usage" 1>&2
- exit 1
- ;;
- *) # first non-opt arg
- break
- ;;
- esac
-done
-
-for file
-do
- if test -d "$file"; then
- shift
- else
- break
- fi
-done
-
-case $# in
- 0) exit 0 ;;
-esac
-
-# Solaris 8's mkdir -p isn't thread-safe. If you mkdir -p a/b and
-# mkdir -p a/c at the same time, both will detect that a is missing,
-# one will create a, then the other will try to create a and die with
-# a "File exists" error. This is a problem when calling mkinstalldirs
-# from a parallel make. We use --version in the probe to restrict
-# ourselves to GNU mkdir, which is thread-safe.
-case $dirmode in
- '')
- if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
- # echo "mkdir -p -- $*"
- exec mkdir -p -- "$@"
- else
- # On NextStep and OpenStep, the `mkdir' command does not
- # recognize any option. It will interpret all options as
- # directories to create, and then abort because `.' already
- # exists.
- test -d ./-p && rmdir ./-p
- test -d ./--version && rmdir ./--version
- fi
- ;;
- *)
- if mkdir -m "$dirmode" -p --version . >/dev/null 2>&1 &&
- test ! -d ./--version; then
- # echo "mkdir -m $dirmode -p -- $*"
- exec mkdir -m "$dirmode" -p -- "$@"
- else
- # Clean up after NextStep and OpenStep mkdir.
- for d in ./-m ./-p ./--version "./$dirmode";
- do
- test -d $d && rmdir $d
- done
- fi
- ;;
-esac
-
-for file
-do
- set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
- shift
-
- pathcomp=
- for d
- do
- pathcomp="$pathcomp$d"
- case $pathcomp in
- -*) pathcomp=./$pathcomp ;;
- esac
-
- if test ! -d "$pathcomp"; then
- # echo "mkdir $pathcomp"
-
- mkdir "$pathcomp" || lasterr=$?
-
- if test ! -d "$pathcomp"; then
- errstatus=$lasterr
- else
- if test ! -z "$dirmode"; then
- # echo "chmod $dirmode $pathcomp"
- lasterr=""
- chmod "$dirmode" "$pathcomp" || lasterr=$?
-
- if test ! -z "$lasterr"; then
- errstatus=$lasterr
- fi
- fi
- fi
- fi
-
- pathcomp="$pathcomp/"
- done
-done
-
-exit $errstatus
-
-# Local Variables:
-# mode: shell-script
-# sh-indentation: 2
-# eval: (add-hook 'write-file-hooks 'time-stamp)
-# time-stamp-start: "scriptversion="
-# time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-end: "$"
-# End:
diff --git a/release_23/bindings/Makefile b/release_23/bindings/Makefile
deleted file mode 100644
index c545b28854cc..000000000000
--- a/release_23/bindings/Makefile
+++ /dev/null
@@ -1,16 +0,0 @@
-##===- bindings/Makefile -----------------------------------*- Makefile -*-===##
-#
-# The LLVM Compiler Infrastructure
-#
-# This file is distributed under the University of Illinois Open Source
-# License. See LICENSE.TXT for details.
-#
-##===----------------------------------------------------------------------===##
-
-LEVEL := ..
-
-include $(LEVEL)/Makefile.config
-
-PARALLEL_DIRS = $(BINDINGS_TO_BUILD)
-
-include $(LEVEL)/Makefile.common
diff --git a/release_23/bindings/README.txt b/release_23/bindings/README.txt
deleted file mode 100644
index 7693cb2cead0..000000000000
--- a/release_23/bindings/README.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-This directory contains bindings for the LLVM compiler infrastructure to allow
-programs written in languages other than C or C++ to take advantage of the LLVM
-infrastructure--for instance, a self-hosted compiler front-end.
diff --git a/release_23/bindings/ocaml/Makefile b/release_23/bindings/ocaml/Makefile
deleted file mode 100644
index a89caefb4ded..000000000000
--- a/release_23/bindings/ocaml/Makefile
+++ /dev/null
@@ -1,19 +0,0 @@
-##===- bindings/ocaml/Makefile -----------------------------*- Makefile -*-===##
-#
-# The LLVM Compiler Infrastructure
-#
-# This file is distributed under the University of Illinois Open Source
-# License. See LICENSE.TXT for details.
-#
-##===----------------------------------------------------------------------===##
-
-LEVEL := ../..
-DIRS = llvm bitreader bitwriter analysis target executionengine transforms
-ExtraMakefiles = $(PROJ_OBJ_DIR)/Makefile.ocaml
-
-ocamldoc:
- $(Verb) for i in $(DIRS) ; do \
- $(MAKE) -C $$i ocamldoc; \
- done
-
-include $(LEVEL)/Makefile.common
diff --git a/release_23/bindings/ocaml/Makefile.ocaml b/release_23/bindings/ocaml/Makefile.ocaml
deleted file mode 100644
index c8e826f77e99..000000000000
--- a/release_23/bindings/ocaml/Makefile.ocaml
+++ /dev/null
@@ -1,338 +0,0 @@
-##===- tools/ml/Makefile -----------------------------------*- Makefile -*-===##
-#
-# The LLVM Compiler Infrastructure
-#
-# This file is distributed under the University of Illinois Open Source
-# License. See LICENSE.TXT for details.
-#
-##===----------------------------------------------------------------------===##
-#
-# An ocaml library is a unique project type in the context of LLVM, so rules are
-# here rather than in Makefile.rules.
-#
-# Reference materials on installing ocaml libraries:
-#
-# https://fedoraproject.org/wiki/Packaging/OCaml
-# http://pkg-ocaml-maint.alioth.debian.org/ocaml_packaging_policy.txt
-#
-##===----------------------------------------------------------------------===##
-
-include $(LEVEL)/Makefile.config
-
-# CFLAGS needs to be set before Makefile.rules is included.
-CXX.Flags += -I"$(shell $(OCAMLC) -where)"
-C.Flags += -I"$(shell $(OCAMLC) -where)"
-
-include $(LEVEL)/Makefile.common
-
-# Intentionally ignore PROJ_prefix here. We want the ocaml stdlib. However, the
-# user can override this with OCAML_LIBDIR or configure --with-ocaml-libdir=.
-PROJ_libocamldir := $(DESTDIR)$(OCAML_LIBDIR)
-OcamlDir := $(LibDir)/ocaml
-
-# Info from llvm-config and similar
-ifdef UsedComponents
-UsedLibs = $(shell $(LLVM_CONFIG) --libs $(UsedComponents))
-UsedLibNames = $(shell $(LLVM_CONFIG) --libnames $(UsedComponents))
-endif
-
-# Tools
-OCAMLCFLAGS += -I $(OcamlDir) -I $(ObjDir)
-ifneq ($(ObjectsO),)
-OCAMLAFLAGS += $(patsubst %,-cclib %, \
- $(filter-out -L$(LibDir),-l$(LIBRARYNAME) \
- $(shell $(LLVM_CONFIG) --ldflags)) \
- $(UsedLibs))
-else
-OCAMLAFLAGS += $(patsubst %,-cclib %, \
- $(filter-out -L$(LibDir),$(shell $(LLVM_CONFIG) --ldflags)) \
- $(UsedLibs))
-endif
-
-# -g was introduced in 3.10.0.
-#ifneq ($(ENABLE_OPTIMIZED),1)
-# OCAMLDEBUGFLAG := -g
-#endif
-
-Compile.CMI := $(strip $(OCAMLC) -c $(OCAMLCFLAGS) $(OCAMLDEBUGFLAG) -o)
-Compile.CMO := $(strip $(OCAMLC) -c $(OCAMLCFLAGS) $(OCAMLDEBUGFLAG) -o)
-Archive.CMA := $(strip $(OCAMLC) -a -custom $(OCAMLAFLAGS) $(OCAMLDEBUGFLAG) \
- -o)
-
-Compile.CMX := $(strip $(OCAMLOPT) -c $(OCAMLCFLAGS) $(OCAMLDEBUGFLAG) -o)
-Archive.CMXA := $(strip $(OCAMLOPT) -a $(OCAMLAFLAGS) $(OCAMLDEBUGFLAG) -o)
-
-# Source files
-OcamlSources1 := $(sort $(wildcard $(PROJ_SRC_DIR)/*.ml))
-OcamlHeaders1 := $(OcamlSources1:.ml=.mli)
-
-OcamlSources := $(OcamlSources1:$(PROJ_SRC_DIR)/%=$(ObjDir)/%)
-OcamlHeaders := $(OcamlHeaders1:$(PROJ_SRC_DIR)/%=$(ObjDir)/%)
-
-# Intermediate files
-LibraryCMA := $(ObjDir)/$(LIBRARYNAME).cma
-LibraryCMXA := $(ObjDir)/$(LIBRARYNAME).cmxa
-ObjectsCMI := $(OcamlSources:%.ml=%.cmi)
-ObjectsCMO := $(OcamlSources:%.ml=%.cmo)
-ObjectsCMX := $(OcamlSources:%.ml=%.cmx)
-
-# Output files
-# The .cmo files are the only intermediates; all others are to be installed.
-LibraryA := $(OcamlDir)/lib$(LIBRARYNAME).a
-OutputCMA := $(LibraryCMA:$(ObjDir)/%.cma=$(OcamlDir)/%.cma)
-OutputCMXA := $(LibraryCMXA:$(ObjDir)/%.cmxa=$(OcamlDir)/%.cmxa)
-OutputsCMI := $(ObjectsCMI:$(ObjDir)/%.cmi=$(OcamlDir)/%.cmi)
-OutputsCMX := $(ObjectsCMX:$(ObjDir)/%.cmx=$(OcamlDir)/%.cmx)
-OutputLibs := $(UsedLibNames:%=$(OcamlDir)/%)
-
-# Installation targets
-DestA := $(PROJ_libocamldir)/lib$(LIBRARYNAME).a
-DestCMA := $(PROJ_libocamldir)/$(LIBRARYNAME).cma
-DestCMXA := $(PROJ_libocamldir)/$(LIBRARYNAME).cmxa
-DestLibs := $(UsedLibNames:%=$(PROJ_libocamldir)/%)
-
-
-##===- Dependencies -------------------------------------------------------===##
-# Copy the sources into the intermediate directory because older ocamlc doesn't
-# support -o except when linking (outputs are placed next to inputs).
-
-$(ObjDir)/%.mli: $(PROJ_SRC_DIR)/%.mli $(ObjDir)/.dir
- $(Verb) $(CP) -f $< $@
-
-$(ObjDir)/%.ml: $(PROJ_SRC_DIR)/%.ml $(ObjDir)/.dir
- $(Verb) $(CP) -f $< $@
-
-$(ObjDir)/$(LIBRARYNAME).ocamldep: $(OcamlSources) $(OcamlHeaders) \
- $(OcamlDir)/.dir $(ObjDir)/.dir
- $(Verb) $(OCAMLDEP) $(OCAMLCFLAGS) $(OcamlSources) $(OcamlHeaders) > $@
-
-$(ObjectsCMI): $(UsedOcamlInterfaces:%=$(OcamlDir)/%.cmi)
-
--include $(ObjDir)/$(LIBRARYNAME).ocamldep
-
-
-##===- Build static library from C sources --------------------------------===##
-
-ifneq ($(ObjectsO),)
-all-local:: $(LibraryA)
-clean-local:: clean-a
-install-local:: install-a
-uninstall-local:: uninstall-a
-
-$(LibraryA): $(ObjectsO) $(OcamlDir)/.dir
- $(Echo) "Building $(BuildMode) $(notdir $@)"
- -$(Verb) $(RM) -f $@
- $(Verb) $(Archive) $@ $(ObjectsO)
- $(Verb) $(Ranlib) $@
-
-clean-a::
- -$(Verb) $(RM) -f $(LibraryA)
-
-install-a:: $(LibraryA)
- $(Echo) "Installing $(BuildMode) $(DestA)"
- $(Verb) $(MKDIR) $(PROJ_libocamldir)
- $(Verb) $(LTInstall) $(LibraryA) $(DestA)
- $(Verb)
-
-uninstall-a::
- $(Echo) "Uninstalling $(DestA)"
- -$(Verb) $(RM) -f $(DestA)
-endif
-
-
-##===- Deposit dependent libraries adjacent to Ocaml libs -----------------===##
-
-all-local:: build-deplibs
-clean-local:: clean-deplibs
-install-local:: install-deplibs
-uninstall-local:: uninstall-deplibs
-
-build-deplibs: $(OutputLibs)
-
-$(OcamlDir)/%.a: $(LibDir)/%.a
- $(Verb) ln -sf $< $@
-
-$(OcamlDir)/%.o: $(LibDir)/%.o
- $(Verb) ln -sf $< $@
-
-clean-deplibs:
- $(Verb) rm -f $(OutputLibs)
-
-install-deplibs:
- $(Verb) for i in $(DestLibs:$(PROJ_libocamldir)/%=%); do \
- ln -sf "$(PROJ_libdir)/$$i" "$(PROJ_libocamldir)/$$i"; \
- done
-
-uninstall-deplibs:
- $(Verb) rm -f $(DestLibs)
-
-
-##===- Build ocaml interfaces (.mli's -> .cmi's) --------------------------===##
-
-all-local:: build-cmis
-clean-local:: clean-cmis
-install-local:: install-cmis
-uninstall-local:: uninstall-cmis
-
-build-cmis: $(OutputsCMI)
-
-$(OcamlDir)/%.cmi: $(ObjDir)/%.cmi $(OcamlDir)/.dir
- $(Verb) $(CP) -f $< $@
-
-$(ObjDir)/%.cmi: $(ObjDir)/%.mli $(ObjDir)/.dir
- $(Echo) "Compiling $(notdir $<) for $(BuildMode) build"
- $(Verb) $(Compile.CMI) $@ $<
-
-clean-cmis::
- -$(Verb) $(RM) -f $(OutputsCMI)
-
-# Also install the .mli's (headers) as documentation.
-install-cmis: $(OutputsCMI) $(OcamlHeaders)
- $(Verb) $(MKDIR) $(PROJ_libocamldir)
- $(Verb) for i in $(OutputsCMI:$(OcamlDir)/%=%); do \
- $(EchoCmd) "Installing $(BuildMode) $(PROJ_libocamldir)/$$i"; \
- $(DataInstall) $(OcamlDir)/$$i "$(PROJ_libocamldir)/$$i"; \
- done
- $(Verb) for i in $(OcamlHeaders:$(ObjDir)/%=%); do \
- $(EchoCmd) "Installing $(BuildMode) $(PROJ_libocamldir)/$$i"; \
- $(DataInstall) $(ObjDir)/$$i "$(PROJ_libocamldir)/$$i"; \
- done
-
-uninstall-cmis::
- $(Verb) for i in $(OutputsCMI:$(OcamlDir)/%=%); do \
- $(EchoCmd) "Uninstalling $(PROJ_libocamldir)/$$i"; \
- $(RM) -f "$(PROJ_libocamldir)/$$i"; \
- done
- $(Verb) for i in $(OcamlHeaders:$(ObjDir)/%=%); do \
- $(EchoCmd) "Uninstalling $(PROJ_libocamldir)/$$i"; \
- $(RM) -f "$(PROJ_libocamldir)/$$i"; \
- done
-
-
-##===- Build ocaml bytecode archive (.ml's -> .cmo's -> .cma) -------------===##
-
-all-local:: $(OutputCMA)
-clean-local:: clean-cma
-install-local:: install-cma
-uninstall-local:: uninstall-cma
-
-$(OutputCMA): $(LibraryCMA) $(OcamlDir)/.dir
- $(Verb) $(CP) -f $< $@
-
-$(LibraryCMA): $(ObjectsCMO) $(OcamlDir)/.dir
- $(Echo) "Archiving $(notdir $@) for $(BuildMode) build"
- $(Verb) $(Archive.CMA) $@ $(ObjectsCMO)
-
-$(ObjDir)/%.cmo: $(ObjDir)/%.ml
- $(Echo) "Compiling $(notdir $<) for $(BuildMode) build"
- $(Verb) $(Compile.CMO) $@ $<
-
-clean-cma::
- $(Verb) $(RM) -f $(OutputCMA) $(UsedLibNames:%=$(OcamlDir)/%)
-
-install-cma:: $(OutputCMA)
- $(Echo) "Installing $(BuildMode) $(DestCMA)"
- $(Verb) $(MKDIR) $(PROJ_libocamldir)
- $(Verb) $(DataInstall) $(OutputCMA) "$(DestCMA)"
-
-uninstall-cma::
- $(Echo) "Uninstalling $(DestCMA)"
- -$(Verb) $(RM) -f $(DestCMA)
-
-
-##===- Build optimized ocaml archive (.ml's -> .cmx's -> .cmxa, .a) -------===##
-
-# The ocamlopt compiler is supported on a set of targets disjoint from LLVM's.
-# If unavailable, 'configure' will not define OCAMLOPT in Makefile.config.
-ifdef OCAMLOPT
-
-all-local:: $(OutputCMXA) $(OutputsCMX)
-clean-local:: clean-cmxa
-install-local:: install-cmxa
-uninstall-local:: uninstall-cmxa
-
-$(OutputCMXA): $(LibraryCMXA)
- $(Verb) $(CP) -f $< $@
- $(Verb) $(CP) -f $(<:.cmxa=.a) $(@:.cmxa=.a)
-
-$(OcamlDir)/%.cmx: $(ObjDir)/%.cmx
- $(Verb) $(CP) -f $< $@
-
-$(LibraryCMXA): $(ObjectsCMX)
- $(Echo) "Archiving $(notdir $@) for $(BuildMode) build"
- $(Verb) $(Archive.CMXA) $@ $(ObjectsCMX)
- $(Verb) $(RM) -f $(@:.cmxa=.o)
-
-$(ObjDir)/%.cmx: $(ObjDir)/%.ml
- $(Echo) "Compiling optimized $(notdir $<) for $(BuildMode) build"
- $(Verb) $(Compile.CMX) $@ $<
-
-clean-cmxa::
- $(Verb) $(RM) -f $(OutputCMXA) $(OutputCMXA:.cmxa=.a) $(OutputsCMX)
-
-install-cmxa:: $(OutputCMXA) $(OutputsCMX)
- $(Verb) $(MKDIR) $(PROJ_libocamldir)
- $(Echo) "Installing $(BuildMode) $(DestCMXA)"
- $(Verb) $(DataInstall) $(OutputCMXA) $(DestCMXA)
- $(Echo) "Installing $(BuildMode) $(DestCMXA:.cmxa=.a)"
- $(Verb) $(DataInstall) $(OutputCMXA:.cmxa=.a) $(DestCMXA:.cmxa=.a)
- $(Verb) for i in $(OutputsCMX:$(OcamlDir)/%=%); do \
- $(EchoCmd) "Installing $(BuildMode) $(PROJ_libocamldir)/$$i"; \
- $(DataInstall) $(OcamlDir)/$$i "$(PROJ_libocamldir)/$$i"; \
- done
-
-uninstall-cmxa::
- $(Echo) "Uninstalling $(DestCMXA)"
- $(Verb) $(RM) -f $(DestCMXA)
- $(Echo) "Uninstalling $(DestCMXA:.cmxa=.a)"
- $(Verb) $(RM) -f $(DestCMXA:.cmxa=.a)
- $(Verb) for i in $(OutputsCMX:$(OcamlDir)/%=%); do \
- $(EchoCmd) "Uninstalling $(PROJ_libocamldir)/$$i"; \
- $(RM) -f $(PROJ_libocamldir)/$$i; \
- done
-
-endif
-
-##===- Generate documentation ---------------------------------------------===##
-
-$(ObjDir)/$(LIBRARYNAME).odoc: $(ObjectsCMI)
- $(Echo) "Documenting $(notdir $@)"
- $(Verb) $(OCAMLDOC) -I $(OcamlDir) -I $(ObjDir) -dump $@ $(OcamlHeaders)
-
-ocamldoc: $(ObjDir)/$(LIBRARYNAME).odoc
-
-##===- Debugging gunk -----------------------------------------------------===##
-printvars:: printcamlvars
-
-printcamlvars::
- $(Echo) "LLVM_CONFIG : " '$(LLVM_CONFIG)'
- $(Echo) "OCAMLCFLAGS : " '$(OCAMLCFLAGS)'
- $(Echo) "OCAMLAFLAGS : " '$(OCAMLAFLAGS)'
- $(Echo) "OCAMLC : " '$(OCAMLC)'
- $(Echo) "OCAMLOPT : " '$(OCAMLOPT)'
- $(Echo) "OCAMLDEP : " '$(OCAMLDEP)'
- $(Echo) "Compile.CMI : " '$(Compile.CMI)'
- $(Echo) "Compile.CMO : " '$(Compile.CMO)'
- $(Echo) "Archive.CMA : " '$(Archive.CMA)'
- $(Echo) "Compile.CMX : " '$(Compile.CMX)'
- $(Echo) "Archive.CMXA : " '$(Archive.CMXA)'
- $(Echo) "CAML_LIBDIR : " '$(CAML_LIBDIR)'
- $(Echo) "LibraryCMA : " '$(LibraryCMA)'
- $(Echo) "LibraryCMXA : " '$(LibraryCMXA)'
- $(Echo) "OcamlSources1: " '$(OcamlSources1)'
- $(Echo) "OcamlSources : " '$(OcamlSources)'
- $(Echo) "OcamlHeaders : " '$(OcamlHeaders)'
- $(Echo) "ObjectsCMI : " '$(ObjectsCMI)'
- $(Echo) "ObjectsCMO : " '$(ObjectsCMO)'
- $(Echo) "ObjectsCMX : " '$(ObjectsCMX)'
- $(Echo) "OCAML_LIBDIR : " '$(OCAML_LIBDIR)'
- $(Echo) "DestA : " '$(DestA)'
- $(Echo) "DestCMA : " '$(DestCMA)'
- $(Echo) "DestCMXA : " '$(DestCMXA)'
- $(Echo) "UsedLibs : " '$(UsedLibs)'
- $(Echo) "UsedLibNames : " '$(UsedLibNames)'
-
-.PHONY: printcamlvars build-cmis \
- clean-a clean-cmis clean-cma clean-cmxa \
- install-a install-cmis install-cma install-cmxa \
- uninstall-a uninstall-cmis uninstall-cma uninstall-cmxa
diff --git a/release_23/bindings/ocaml/analysis/Makefile b/release_23/bindings/ocaml/analysis/Makefile
deleted file mode 100644
index 0e95ecd678d5..000000000000
--- a/release_23/bindings/ocaml/analysis/Makefile
+++ /dev/null
@@ -1,20 +0,0 @@
-##===- bindings/ocaml/analysis/Makefile --------------------*- Makefile -*-===##
-#
-# The LLVM Compiler Infrastructure
-#
-# This file is distributed under the University of Illinois Open Source
-# License. See LICENSE.TXT for details.
-#
-##===----------------------------------------------------------------------===##
-#
-# This is the makefile for the Objective Caml Llvm_analysis interface.
-#
-##===----------------------------------------------------------------------===##
-
-LEVEL := ../../..
-LIBRARYNAME := llvm_analysis
-DONT_BUILD_RELINKED := 1
-UsedComponents := analysis
-UsedOcamlInterfaces := llvm
-
-include ../Makefile.ocaml
diff --git a/release_23/bindings/ocaml/analysis/analysis_ocaml.c b/release_23/bindings/ocaml/analysis/analysis_ocaml.c
deleted file mode 100644
index 97167055f70e..000000000000
--- a/release_23/bindings/ocaml/analysis/analysis_ocaml.c
+++ /dev/null
@@ -1,72 +0,0 @@
-/*===-- analysis_ocaml.c - LLVM Ocaml Glue ----------------------*- C++ -*-===*\
-|* *|
-|* The LLVM Compiler Infrastructure *|
-|* *|
-|* This file is distributed under the University of Illinois Open Source *|
-|* License. See LICENSE.TXT for details. *|
-|* *|
-|*===----------------------------------------------------------------------===*|
-|* *|
-|* This file glues LLVM's ocaml interface to its C interface. These functions *|
-|* are by and large transparent wrappers to the corresponding C functions. *|
-|* *|
-|* Note that these functions intentionally take liberties with the CAMLparamX *|
-|* macros, since most of the parameters are not GC heap objects. *|
-|* *|
-\*===----------------------------------------------------------------------===*/
-
-#include "llvm-c/Analysis.h"
-#include "caml/alloc.h"
-#include "caml/mlvalues.h"
-#include "caml/memory.h"
-
-
-/* Llvm.llmodule -> string option */
-CAMLprim value llvm_verify_module(LLVMModuleRef M) {
- CAMLparam0();
- CAMLlocal2(String, Option);
-
- char *Message;
- int Result = LLVMVerifyModule(M, LLVMReturnStatusAction, &Message);
-
- if (0 == Result) {
- Option = Val_int(0);
- } else {
- Option = alloc(1, 0);
- String = copy_string(Message);
- Store_field(Option, 0, String);
- }
-
- LLVMDisposeMessage(Message);
-
- CAMLreturn(Option);
-}
-
-/* Llvm.llvalue -> bool */
-CAMLprim value llvm_verify_function(LLVMValueRef Fn) {
- return Val_bool(LLVMVerifyFunction(Fn, LLVMReturnStatusAction) == 0);
-}
-
-/* Llvm.llmodule -> unit */
-CAMLprim value llvm_assert_valid_module(LLVMModuleRef M) {
- LLVMVerifyModule(M, LLVMAbortProcessAction, 0);
- return Val_unit;
-}
-
-/* Llvm.llvalue -> unit */
-CAMLprim value llvm_assert_valid_function(LLVMValueRef Fn) {
- LLVMVerifyFunction(Fn, LLVMAbortProcessAction);
- return Val_unit;
-}
-
-/* Llvm.llvalue -> unit */
-CAMLprim value llvm_view_function_cfg(LLVMValueRef Fn) {
- LLVMViewFunctionCFG(Fn);
- return Val_unit;
-}
-
-/* Llvm.llvalue -> unit */
-CAMLprim value llvm_view_function_cfg_only(LLVMValueRef Fn) {
- LLVMViewFunctionCFGOnly(Fn);
- return Val_unit;
-}
diff --git a/release_23/bindings/ocaml/analysis/llvm_analysis.ml b/release_23/bindings/ocaml/analysis/llvm_analysis.ml
deleted file mode 100644
index fc4d20370747..000000000000
--- a/release_23/bindings/ocaml/analysis/llvm_analysis.ml
+++ /dev/null
@@ -1,22 +0,0 @@
-(*===-- llvm_analysis.ml - LLVM Ocaml Interface -----------------*- C++ -*-===*
- *
- * The LLVM Compiler Infrastructure
- *
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
- *
- *===----------------------------------------------------------------------===*)
-
-
-external verify_module : Llvm.llmodule -> string option = "llvm_verify_module"
-
-external verify_function : Llvm.llvalue -> bool = "llvm_verify_function"
-
-external assert_valid_module : Llvm.llmodule -> unit
- = "llvm_assert_valid_module"
-
-external assert_valid_function : Llvm.llvalue -> unit
- = "llvm_assert_valid_function"
-external view_function_cfg : Llvm.llvalue -> unit = "llvm_view_function_cfg"
-external view_function_cfg_only : Llvm.llvalue -> unit
- = "llvm_view_function_cfg_only"
diff --git a/release_23/bindings/ocaml/analysis/llvm_analysis.mli b/release_23/bindings/ocaml/analysis/llvm_analysis.mli
deleted file mode 100644
index 793f482e3c6c..000000000000
--- a/release_23/bindings/ocaml/analysis/llvm_analysis.mli
+++ /dev/null
@@ -1,46 +0,0 @@
-(*===-- llvm_analysis.mli - LLVM Ocaml Interface ----------------*- C++ -*-===*
- *
- * The LLVM Compiler Infrastructure
- *
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
- *
- *===----------------------------------------------------------------------===*)
-
-(** Intermediate representation analysis.
-
- This interface provides an ocaml API for LLVM IR analyses, the classes in
- the Analysis library. *)
-
-(** [verify_module m] returns [None] if the module [m] is valid, and
- [Some reason] if it is invalid. [reason] is a string containing a
- human-readable validation report. See [llvm::verifyModule]. *)
-external verify_module : Llvm.llmodule -> string option = "llvm_verify_module"
-
-(** [verify_function f] returns [None] if the function [f] is valid, and
- [Some reason] if it is invalid. [reason] is a string containing a
- human-readable validation report. See [llvm::verifyFunction]. *)
-external verify_function : Llvm.llvalue -> bool = "llvm_verify_function"
-
-(** [verify_module m] returns if the module [m] is valid, but prints a
- validation report to [stderr] and aborts the program if it is invalid. See
- [llvm::verifyModule]. *)
-external assert_valid_module : Llvm.llmodule -> unit
- = "llvm_assert_valid_module"
-
-(** [verify_function f] returns if the function [f] is valid, but prints a
- validation report to [stderr] and aborts the program if it is invalid. See
- [llvm::verifyFunction]. *)
-external assert_valid_function : Llvm.llvalue -> unit
- = "llvm_assert_valid_function"
-
-(** [view_function_cfg f] opens up a ghostscript window displaying the CFG of
- the current function with the code for each basic block inside.
- See [llvm::Function::viewCFG]. *)
-external view_function_cfg : Llvm.llvalue -> unit = "llvm_view_function_cfg"
-
-(** [view_function_cfg_only f] works just like [view_function_cfg], but does not
- include the contents of basic blocks into the nodes.
- See [llvm::Function::viewCFGOnly]. *)
-external view_function_cfg_only : Llvm.llvalue -> unit
- = "llvm_view_function_cfg_only"
diff --git a/release_23/bindings/ocaml/bitreader/Makefile b/release_23/bindings/ocaml/bitreader/Makefile
deleted file mode 100644
index 6a11cc60da59..000000000000
--- a/release_23/bindings/ocaml/bitreader/Makefile
+++ /dev/null
@@ -1,20 +0,0 @@
-##===- bindings/ocaml/bitreader/Makefile -------------------*- Makefile -*-===##
-#
-# The LLVM Compiler Infrastructure
-#
-# This file is distributed under the University of Illinois Open Source
-# License. See LICENSE.TXT for details.
-#
-##===----------------------------------------------------------------------===##
-#
-# This is the makefile for the Objective Caml Llvm_bitreader interface.
-#
-##===----------------------------------------------------------------------===##
-
-LEVEL := ../../..
-LIBRARYNAME := llvm_bitreader
-DONT_BUILD_RELINKED := 1
-UsedComponents := bitreader
-UsedOcamlInterfaces := llvm
-
-include ../Makefile.ocaml
diff --git a/release_23/bindings/ocaml/bitreader/bitreader_ocaml.c b/release_23/bindings/ocaml/bitreader/bitreader_ocaml.c
deleted file mode 100644
index 0fd484f12343..000000000000
--- a/release_23/bindings/ocaml/bitreader/bitreader_ocaml.c
+++ /dev/null
@@ -1,72 +0,0 @@
-/*===-- bitwriter_ocaml.c - LLVM Ocaml Glue ---------------------*- C++ -*-===*\
-|* *|
-|* The LLVM Compiler Infrastructure *|
-|* *|
-|* This file is distributed under the University of Illinois Open Source *|
-|* License. See LICENSE.TXT for details. *|
-|* *|
-|*===----------------------------------------------------------------------===*|
-|* *|
-|* This file glues LLVM's ocaml interface to its C interface. These functions *|
-|* are by and large transparent wrappers to the corresponding C functions. *|
-|* *|
-\*===----------------------------------------------------------------------===*/
-
-#include "llvm-c/BitReader.h"
-#include "caml/alloc.h"
-#include "caml/fail.h"
-#include "caml/memory.h"
-
-
-/* Can't use the recommended caml_named_value mechanism for backwards
- compatibility reasons. This is largely equivalent. */
-static value llvm_bitreader_error_exn;
-
-CAMLprim value llvm_register_bitreader_exns(value Error) {
- llvm_bitreader_error_exn = Field(Error, 0);
- register_global_root(&llvm_bitreader_error_exn);
- return Val_unit;
-}
-
-static void llvm_raise(value Prototype, char *Message) {
- CAMLparam1(Prototype);
- CAMLlocal1(CamlMessage);
-
- CamlMessage = copy_string(Message);
- LLVMDisposeMessage(Message);
-
- raise_with_arg(Prototype, CamlMessage);
- abort(); /* NOTREACHED */
-#ifdef CAMLnoreturn
- CAMLnoreturn; /* Silences warnings, but is missing in some versions. */
-#endif
-}
-
-
-/*===-- Modules -----------------------------------------------------------===*/
-
-/* Llvm.llmemorybuffer -> Llvm.module */
-CAMLprim value llvm_get_module_provider(LLVMMemoryBufferRef MemBuf) {
- CAMLparam0();
- CAMLlocal2(Variant, MessageVal);
- char *Message;
-
- LLVMModuleProviderRef MP;
- if (LLVMGetBitcodeModuleProvider(MemBuf, &MP, &Message))
- llvm_raise(llvm_bitreader_error_exn, Message);
-
- CAMLreturn((value) MemBuf);
-}
-
-/* Llvm.llmemorybuffer -> Llvm.llmodule */
-CAMLprim value llvm_parse_bitcode(LLVMMemoryBufferRef MemBuf) {
- CAMLparam0();
- CAMLlocal2(Variant, MessageVal);
- LLVMModuleRef M;
- char *Message;
-
- if (LLVMParseBitcode(MemBuf, &M, &Message))
- llvm_raise(llvm_bitreader_error_exn, Message);
-
- CAMLreturn((value) M);
-}
diff --git a/release_23/bindings/ocaml/bitreader/llvm_bitreader.ml b/release_23/bindings/ocaml/bitreader/llvm_bitreader.ml
deleted file mode 100644
index 816e1565526c..000000000000
--- a/release_23/bindings/ocaml/bitreader/llvm_bitreader.ml
+++ /dev/null
@@ -1,19 +0,0 @@
-(*===-- llvm_bitreader.ml - LLVM Ocaml Interface ----------------*- C++ -*-===*
- *
- * The LLVM Compiler Infrastructure
- *
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
- *
- *===----------------------------------------------------------------------===*)
-
-
-exception Error of string
-
-external register_exns : exn -> unit = "llvm_register_bitreader_exns"
-let _ = register_exns (Error "")
-
-external get_module_provider : Llvm.llmemorybuffer -> Llvm.llmoduleprovider
- = "llvm_get_module_provider"
-external parse_bitcode : Llvm.llmemorybuffer -> Llvm.llmodule
- = "llvm_parse_bitcode"
diff --git a/release_23/bindings/ocaml/bitreader/llvm_bitreader.mli b/release_23/bindings/ocaml/bitreader/llvm_bitreader.mli
deleted file mode 100644
index 15b389bb83c7..000000000000
--- a/release_23/bindings/ocaml/bitreader/llvm_bitreader.mli
+++ /dev/null
@@ -1,29 +0,0 @@
-(*===-- llvm_bitreader.mli - LLVM Ocaml Interface ---------------*- C++ -*-===*
- *
- * The LLVM Compiler Infrastructure
- *
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
- *
- *===----------------------------------------------------------------------===*)
-
-(** Bitcode reader.
-
- This interface provides an ocaml API for the LLVM bitcode reader, the
- classes in the Bitreader library. *)
-
-exception Error of string
-
-(** [read_bitcode_file path] reads the bitcode for a new module [m] from the
- file at [path]. Returns [Success m] if successful, and [Failure msg]
- otherwise, where [msg] is a description of the error encountered.
- See the function [llvm::getBitcodeModuleProvider]. *)
-external get_module_provider : Llvm.llmemorybuffer -> Llvm.llmoduleprovider
- = "llvm_get_module_provider"
-
-(** [parse_bitcode mb] parses the bitcode for a new module [m] from the memory
- buffer [mb]. Returns [Success m] if successful, and [Failure msg] otherwise,
- where [msg] is a description of the error encountered.
- See the function [llvm::ParseBitcodeFile]. *)
-external parse_bitcode : Llvm.llmemorybuffer -> Llvm.llmodule
- = "llvm_parse_bitcode"
diff --git a/release_23/bindings/ocaml/bitwriter/Makefile b/release_23/bindings/ocaml/bitwriter/Makefile
deleted file mode 100644
index e57e3fe52cf2..000000000000
--- a/release_23/bindings/ocaml/bitwriter/Makefile
+++ /dev/null
@@ -1,20 +0,0 @@
-##===- bindings/ocaml/bitwriter/Makefile -------------------*- Makefile -*-===##
-#
-# The LLVM Compiler Infrastructure
-#
-# This file is distributed under the University of Illinois Open Source
-# License. See LICENSE.TXT for details.
-#
-##===----------------------------------------------------------------------===##
-#
-# This is the makefile for the Objective Caml Llvm_bitwriter interface.
-#
-##===----------------------------------------------------------------------===##
-
-LEVEL := ../../..
-LIBRARYNAME := llvm_bitwriter
-DONT_BUILD_RELINKED := 1
-UsedComponents := bitwriter
-UsedOcamlInterfaces := llvm
-
-include ../Makefile.ocaml
diff --git a/release_23/bindings/ocaml/bitwriter/bitwriter_ocaml.c b/release_23/bindings/ocaml/bitwriter/bitwriter_ocaml.c
deleted file mode 100644
index 41aca259ca7e..000000000000
--- a/release_23/bindings/ocaml/bitwriter/bitwriter_ocaml.c
+++ /dev/null
@@ -1,30 +0,0 @@
-/*===-- bitwriter_ocaml.c - LLVM Ocaml Glue ---------------------*- C++ -*-===*\
-|* *|
-|* The LLVM Compiler Infrastructure *|
-|* *|
-|* This file is distributed under the University of Illinois Open Source *|
-|* License. See LICENSE.TXT for details. *|
-|* *|
-|*===----------------------------------------------------------------------===*|
-|* *|
-|* This file glues LLVM's ocaml interface to its C interface. These functions *|
-|* are by and large transparent wrappers to the corresponding C functions. *|
-|* *|
-|* Note that these functions intentionally take liberties with the CAMLparamX *|
-|* macros, since most of the parameters are not GC heap objects. *|
-|* *|
-\*===----------------------------------------------------------------------===*/
-
-#include "llvm-c/BitWriter.h"
-#include "llvm-c/Core.h"
-#include "caml/alloc.h"
-#include "caml/mlvalues.h"
-#include "caml/memory.h"
-
-/*===-- Modules -----------------------------------------------------------===*/
-
-/* Llvm.llmodule -> string -> bool */
-CAMLprim value llvm_write_bitcode_file(value M, value Path) {
- int res = LLVMWriteBitcodeToFile((LLVMModuleRef) M, String_val(Path));
- return Val_bool(res == 0);
-}
diff --git a/release_23/bindings/ocaml/bitwriter/llvm_bitwriter.ml b/release_23/bindings/ocaml/bitwriter/llvm_bitwriter.ml
deleted file mode 100644
index 7b45c53dbf82..000000000000
--- a/release_23/bindings/ocaml/bitwriter/llvm_bitwriter.ml
+++ /dev/null
@@ -1,18 +0,0 @@
-(*===-- llvm_bitwriter.ml - LLVM Ocaml Interface ----------------*- C++ -*-===*
- *
- * The LLVM Compiler Infrastructure
- *
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
- *
- *===----------------------------------------------------------------------===
- *
- * This interface provides an ocaml API for the LLVM intermediate
- * representation, the classes in the VMCore library.
- *
- *===----------------------------------------------------------------------===*)
-
-
-(* Writes the bitcode for module the given path. Returns true if successful. *)
-external write_bitcode_file : Llvm.llmodule -> string -> bool
- = "llvm_write_bitcode_file"
diff --git a/release_23/bindings/ocaml/bitwriter/llvm_bitwriter.mli b/release_23/bindings/ocaml/bitwriter/llvm_bitwriter.mli
deleted file mode 100644
index 2f782a1d9f6c..000000000000
--- a/release_23/bindings/ocaml/bitwriter/llvm_bitwriter.mli
+++ /dev/null
@@ -1,18 +0,0 @@
-(*===-- llvm_bitwriter.mli - LLVM Ocaml Interface ---------------*- C++ -*-===*
- *
- * The LLVM Compiler Infrastructure
- *
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
- *
- *===----------------------------------------------------------------------===*)
-
-(** Bitcode writer.
-
- This interface provides an ocaml API for the LLVM bitcode writer, the
- classes in the Bitwriter library. *)
-
-(** [write_bitcode_file m path] writes the bitcode for module [m] to the file at
- [path]. Returns [true] if successful, [false] otherwise. *)
-external write_bitcode_file : Llvm.llmodule -> string -> bool
- = "llvm_write_bitcode_file"
diff --git a/release_23/bindings/ocaml/executionengine/Makefile b/release_23/bindings/ocaml/executionengine/Makefile
deleted file mode 100644
index 40fb98e1914a..000000000000
--- a/release_23/bindings/ocaml/executionengine/Makefile
+++ /dev/null
@@ -1,20 +0,0 @@
-##===- bindings/ocaml/executionengine/Makefile --------------*- Makefile -*-===##
-#
-# The LLVM Compiler Infrastructure
-#
-# This file is distributed under the University of Illinois Open Source
-# License. See LICENSE.TXT for details.
-#
-##===----------------------------------------------------------------------===##
-#
-# This is the makefile for the Objective Caml Llvm_executionengine interface.
-#
-##===----------------------------------------------------------------------===##
-
-LEVEL := ../../..
-LIBRARYNAME := llvm_executionengine
-DONT_BUILD_RELINKED := 1
-UsedComponents := executionengine jit interpreter native
-UsedOcamlInterfaces := llvm llvm_target
-
-include ../Makefile.ocaml
diff --git a/release_23/bindings/ocaml/executionengine/executionengine_ocaml.c b/release_23/bindings/ocaml/executionengine/executionengine_ocaml.c
deleted file mode 100644
index 4af771123c0c..000000000000
--- a/release_23/bindings/ocaml/executionengine/executionengine_ocaml.c
+++ /dev/null
@@ -1,313 +0,0 @@
-/*===-- executionengine_ocaml.c - LLVM Ocaml Glue ---------------*- C++ -*-===*\
-|* *|
-|* The LLVM Compiler Infrastructure *|
-|* *|
-|* This file is distributed under the University of Illinois Open Source *|
-|* License. See LICENSE.TXT for details. *|
-|* *|
-|*===----------------------------------------------------------------------===*|
-|* *|
-|* This file glues LLVM's ocaml interface to its C interface. These functions *|
-|* are by and large transparent wrappers to the corresponding C functions. *|
-|* *|
-|* Note that these functions intentionally take liberties with the CAMLparamX *|
-|* macros, since most of the parameters are not GC heap objects. *|
-|* *|
-\*===----------------------------------------------------------------------===*/
-
-#include "llvm-c/ExecutionEngine.h"
-#include "caml/alloc.h"
-#include "caml/custom.h"
-#include "caml/fail.h"
-#include "caml/memory.h"
-#include <string.h>
-#include <assert.h>
-
-
-/* Can't use the recommended caml_named_value mechanism for backwards
- compatibility reasons. This is largely equivalent. */
-static value llvm_ee_error_exn;
-
-CAMLprim value llvm_register_ee_exns(value Error) {
- llvm_ee_error_exn = Field(Error, 0);
- register_global_root(&llvm_ee_error_exn);
- return Val_unit;
-}
-
-static void llvm_raise(value Prototype, char *Message) {
- CAMLparam1(Prototype);
- CAMLlocal1(CamlMessage);
-
- CamlMessage = copy_string(Message);
- LLVMDisposeMessage(Message);
-
- raise_with_arg(Prototype, CamlMessage);
- abort(); /* NOTREACHED */
-#ifdef CAMLnoreturn
- CAMLnoreturn; /* Silences warnings, but is missing in some versions. */
-#endif
-}
-
-
-/*--... Operations on generic values .......................................--*/
-
-#define Genericvalue_val(v) (*(LLVMGenericValueRef *)(Data_custom_val(v)))
-
-static void llvm_finalize_generic_value(value GenVal) {
- LLVMDisposeGenericValue(Genericvalue_val(GenVal));
-}
-
-static struct custom_operations generic_value_ops = {
- (char *) "LLVMGenericValue",
- llvm_finalize_generic_value,
- custom_compare_default,
- custom_hash_default,
- custom_serialize_default,
- custom_deserialize_default
-};
-
-static value alloc_generic_value(LLVMGenericValueRef Ref) {
- value Val = alloc_custom(&generic_value_ops, sizeof(LLVMGenericValueRef), 0, 1);
- Genericvalue_val(Val) = Ref;
- return Val;
-}
-
-/* Llvm.lltype -> float -> t */
-CAMLprim value llvm_genericvalue_of_float(LLVMTypeRef Ty, value N) {
- CAMLparam1(N);
- CAMLreturn(alloc_generic_value(
- LLVMCreateGenericValueOfFloat(Ty, Double_val(N))));
-}
-
-/* 'a -> t */
-CAMLprim value llvm_genericvalue_of_value(value V) {
- CAMLparam1(V);
- CAMLreturn(alloc_generic_value(LLVMCreateGenericValueOfPointer(Op_val(V))));
-}
-
-/* Llvm.lltype -> int -> t */
-CAMLprim value llvm_genericvalue_of_int(LLVMTypeRef Ty, value Int) {
- return alloc_generic_value(LLVMCreateGenericValueOfInt(Ty, Int_val(Int), 1));
-}
-
-/* Llvm.lltype -> int32 -> t */
-CAMLprim value llvm_genericvalue_of_int32(LLVMTypeRef Ty, value Int32) {
- CAMLparam1(Int32);
- CAMLreturn(alloc_generic_value(
- LLVMCreateGenericValueOfInt(Ty, Int32_val(Int32), 1)));
-}
-
-/* Llvm.lltype -> nativeint -> t */
-CAMLprim value llvm_genericvalue_of_nativeint(LLVMTypeRef Ty, value NatInt) {
- CAMLparam1(NatInt);
- CAMLreturn(alloc_generic_value(
- LLVMCreateGenericValueOfInt(Ty, Nativeint_val(NatInt), 1)));
-}
-
-/* Llvm.lltype -> int64 -> t */
-CAMLprim value llvm_genericvalue_of_int64(LLVMTypeRef Ty, value Int64) {
- CAMLparam1(Int64);
- CAMLreturn(alloc_generic_value(
- LLVMCreateGenericValueOfInt(Ty, Int64_val(Int64), 1)));
-}
-
-/* Llvm.lltype -> t -> float */
-CAMLprim value llvm_genericvalue_as_float(LLVMTypeRef Ty, value GenVal) {
- CAMLparam1(GenVal);
- CAMLreturn(copy_double(
- LLVMGenericValueToFloat(Ty, Genericvalue_val(GenVal))));
-}
-
-/* t -> 'a */
-CAMLprim value llvm_genericvalue_as_value(value GenVal) {
- return Val_op(LLVMGenericValueToPointer(Genericvalue_val(GenVal)));
-}
-
-/* t -> int */
-CAMLprim value llvm_genericvalue_as_int(value GenVal) {
- assert(LLVMGenericValueIntWidth(Genericvalue_val(GenVal)) <= 8 * sizeof(value)
- && "Generic value too wide to treat as an int!");
- return Val_int(LLVMGenericValueToInt(Genericvalue_val(GenVal), 1));
-}
-
-/* t -> int32 */
-CAMLprim value llvm_genericvalue_as_int32(value GenVal) {
- CAMLparam1(GenVal);
- assert(LLVMGenericValueIntWidth(Genericvalue_val(GenVal)) <= 32
- && "Generic value too wide to treat as an int32!");
- CAMLreturn(copy_int32(LLVMGenericValueToInt(Genericvalue_val(GenVal), 1)));
-}
-
-/* t -> int64 */
-CAMLprim value llvm_genericvalue_as_int64(value GenVal) {
- CAMLparam1(GenVal);
- assert(LLVMGenericValueIntWidth(Genericvalue_val(GenVal)) <= 64
- && "Generic value too wide to treat as an int64!");
- CAMLreturn(copy_int64(LLVMGenericValueToInt(Genericvalue_val(GenVal), 1)));
-}
-
-/* t -> nativeint */
-CAMLprim value llvm_genericvalue_as_nativeint(value GenVal) {
- CAMLparam1(GenVal);
- assert(LLVMGenericValueIntWidth(Genericvalue_val(GenVal)) <= 8 * sizeof(value)
- && "Generic value too wide to treat as a nativeint!");
- CAMLreturn(copy_nativeint(LLVMGenericValueToInt(Genericvalue_val(GenVal),1)));
-}
-
-
-/*--... Operations on execution engines ....................................--*/
-
-/* llmoduleprovider -> ExecutionEngine.t */
-CAMLprim LLVMExecutionEngineRef llvm_ee_create(LLVMModuleProviderRef MP) {
- LLVMExecutionEngineRef Interp;
- char *Error;
- if (LLVMCreateExecutionEngine(&Interp, MP, &Error))
- llvm_raise(llvm_ee_error_exn, Error);
- return Interp;
-}
-
-/* llmoduleprovider -> ExecutionEngine.t */
-CAMLprim LLVMExecutionEngineRef
-llvm_ee_create_interpreter(LLVMModuleProviderRef MP) {
- LLVMExecutionEngineRef Interp;
- char *Error;
- if (LLVMCreateInterpreter(&Interp, MP, &Error))
- llvm_raise(llvm_ee_error_exn, Error);
- return Interp;
-}
-
-/* llmoduleprovider -> ExecutionEngine.t */
-CAMLprim LLVMExecutionEngineRef
-llvm_ee_create_jit(LLVMModuleProviderRef MP) {
- LLVMExecutionEngineRef JIT;
- char *Error;
- if (LLVMCreateJITCompiler(&JIT, MP, &Error))
- llvm_raise(llvm_ee_error_exn, Error);
- return JIT;
-}
-
-/* ExecutionEngine.t -> unit */
-CAMLprim value llvm_ee_dispose(LLVMExecutionEngineRef EE) {
- LLVMDisposeExecutionEngine(EE);
- return Val_unit;
-}
-
-/* llmoduleprovider -> ExecutionEngine.t -> unit */
-CAMLprim value llvm_ee_add_mp(LLVMModuleProviderRef MP,
- LLVMExecutionEngineRef EE) {
- LLVMAddModuleProvider(EE, MP);
- return Val_unit;
-}
-
-/* llmoduleprovider -> ExecutionEngine.t -> llmodule */
-CAMLprim LLVMModuleRef llvm_ee_remove_mp(LLVMModuleProviderRef MP,
- LLVMExecutionEngineRef EE) {
- LLVMModuleRef RemovedModule;
- char *Error;
- if (LLVMRemoveModuleProvider(EE, MP, &RemovedModule, &Error))
- llvm_raise(llvm_ee_error_exn, Error);
- return RemovedModule;
-}
-
-/* string -> ExecutionEngine.t -> llvalue option */
-CAMLprim value llvm_ee_find_function(value Name, LLVMExecutionEngineRef EE) {
- CAMLparam1(Name);
- CAMLlocal1(Option);
- LLVMValueRef Found;
- if (LLVMFindFunction(EE, String_val(Name), &Found))
- CAMLreturn(Val_unit);
- Option = alloc(1, 1);
- Field(Option, 0) = Val_op(Found);
- CAMLreturn(Option);
-}
-
-/* llvalue -> GenericValue.t array -> ExecutionEngine.t -> GenericValue.t */
-CAMLprim value llvm_ee_run_function(LLVMValueRef F, value Args,
- LLVMExecutionEngineRef EE) {
- unsigned NumArgs;
- LLVMGenericValueRef Result, *GVArgs;
- unsigned I;
-
- NumArgs = Wosize_val(Args);
- GVArgs = (LLVMGenericValueRef*) malloc(NumArgs * sizeof(LLVMGenericValueRef));
- for (I = 0; I != NumArgs; ++I)
- GVArgs[I] = Genericvalue_val(Field(Args, I));
-
- Result = LLVMRunFunction(EE, F, NumArgs, GVArgs);
-
- free(GVArgs);
- return alloc_generic_value(Result);
-}
-
-/* ExecutionEngine.t -> unit */
-CAMLprim value llvm_ee_run_static_ctors(LLVMExecutionEngineRef EE) {
- LLVMRunStaticConstructors(EE);
- return Val_unit;
-}
-
-/* ExecutionEngine.t -> unit */
-CAMLprim value llvm_ee_run_static_dtors(LLVMExecutionEngineRef EE) {
- LLVMRunStaticDestructors(EE);
- return Val_unit;
-}
-
-/* llvalue -> string array -> (string * string) array -> ExecutionEngine.t ->
- int */
-CAMLprim value llvm_ee_run_function_as_main(LLVMValueRef F,
- value Args, value Env,
- LLVMExecutionEngineRef EE) {
- CAMLparam2(Args, Env);
- int I, NumArgs, NumEnv, EnvSize, Result;
- const char **CArgs, **CEnv;
- char *CEnvBuf, *Pos;
-
- NumArgs = Wosize_val(Args);
- NumEnv = Wosize_val(Env);
-
- /* Build the environment. */
- CArgs = (const char **) malloc(NumArgs * sizeof(char*));
- for (I = 0; I != NumArgs; ++I)
- CArgs[I] = String_val(Field(Args, I));
-
- /* Compute the size of the environment string buffer. */
- for (I = 0, EnvSize = 0; I != NumEnv; ++I) {
- EnvSize += strlen(String_val(Field(Field(Env, I), 0))) + 1;
- EnvSize += strlen(String_val(Field(Field(Env, I), 1))) + 1;
- }
-
- /* Build the environment. */
- CEnv = (const char **) malloc((NumEnv + 1) * sizeof(char*));
- CEnvBuf = (char*) malloc(EnvSize);
- Pos = CEnvBuf;
- for (I = 0; I != NumEnv; ++I) {
- char *Name = String_val(Field(Field(Env, I), 0)),
- *Value = String_val(Field(Field(Env, I), 1));
- int NameLen = strlen(Name),
- ValueLen = strlen(Value);
-
- CEnv[I] = Pos;
- memcpy(Pos, Name, NameLen);
- Pos += NameLen;
- *Pos++ = '=';
- memcpy(Pos, Value, ValueLen);
- Pos += ValueLen;
- *Pos++ = '\0';
- }
- CEnv[NumEnv] = NULL;
-
- Result = LLVMRunFunctionAsMain(EE, F, NumArgs, CArgs, CEnv);
-
- free(CArgs);
- free(CEnv);
- free(CEnvBuf);
-
- CAMLreturn(Val_int(Result));
-}
-
-/* llvalue -> ExecutionEngine.t -> unit */
-CAMLprim value llvm_ee_free_machine_code(LLVMValueRef F,
- LLVMExecutionEngineRef EE) {
- LLVMFreeMachineCodeForFunction(EE, F);
- return Val_unit;
-}
-
diff --git a/release_23/bindings/ocaml/executionengine/llvm_executionengine.ml b/release_23/bindings/ocaml/executionengine/llvm_executionengine.ml
deleted file mode 100644
index 4b9132df052e..000000000000
--- a/release_23/bindings/ocaml/executionengine/llvm_executionengine.ml
+++ /dev/null
@@ -1,109 +0,0 @@
-(*===-- llvm_executionengine.ml - LLVM Ocaml Interface ----------*- C++ -*-===*
- *
- * The LLVM Compiler Infrastructure
- *
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
- *
- *===----------------------------------------------------------------------===*)
-
-
-exception Error of string
-
-external register_exns: exn -> unit
- = "llvm_register_ee_exns"
-
-
-module GenericValue = struct
- type t
-
- external of_float: Llvm.lltype -> float -> t
- = "llvm_genericvalue_of_float"
- external of_pointer: 'a -> t
- = "llvm_genericvalue_of_value"
- external of_int32: Llvm.lltype -> int32 -> t
- = "llvm_genericvalue_of_int32"
- external of_int: Llvm.lltype -> int -> t
- = "llvm_genericvalue_of_int"
- external of_nativeint: Llvm.lltype -> nativeint -> t
- = "llvm_genericvalue_of_nativeint"
- external of_int64: Llvm.lltype -> int64 -> t
- = "llvm_genericvalue_of_int64"
-
- external as_float: Llvm.lltype -> t -> float
- = "llvm_genericvalue_as_float"
- external as_pointer: t -> 'a
- = "llvm_genericvalue_as_value"
- external as_int32: t -> int32
- = "llvm_genericvalue_as_int32"
- external as_int: t -> int
- = "llvm_genericvalue_as_int"
- external as_nativeint: t -> nativeint
- = "llvm_genericvalue_as_nativeint"
- external as_int64: t -> int64
- = "llvm_genericvalue_as_int64"
-end
-
-
-module ExecutionEngine = struct
- type t
-
- (* FIXME: Ocaml is not running this setup code unless we use 'val' in the
- interface, which causes the emission of a stub for each function;
- using 'external' in the module allows direct calls into
- ocaml_executionengine.c. This is hardly fatal, but it is unnecessary
- overhead on top of the two stubs that are already invoked for each
- call into LLVM. *)
- let _ = register_exns (Error "")
-
- external create: Llvm.llmoduleprovider -> t
- = "llvm_ee_create"
- external create_interpreter: Llvm.llmoduleprovider -> t
- = "llvm_ee_create_interpreter"
- external create_jit: Llvm.llmoduleprovider -> t
- = "llvm_ee_create_jit"
- external dispose: t -> unit
- = "llvm_ee_dispose"
- external add_module_provider: Llvm.llmoduleprovider -> t -> unit
- = "llvm_ee_add_mp"
- external remove_module_provider: Llvm.llmoduleprovider -> t -> Llvm.llmodule
- = "llvm_ee_remove_mp"
- external find_function: string -> t -> Llvm.llvalue option
- = "llvm_ee_find_function"
- external run_function: Llvm.llvalue -> GenericValue.t array -> t ->
- GenericValue.t
- = "llvm_ee_run_function"
- external run_static_ctors: t -> unit
- = "llvm_ee_run_static_ctors"
- external run_static_dtors: t -> unit
- = "llvm_ee_run_static_dtors"
- external run_function_as_main: Llvm.llvalue -> string array ->
- (string * string) array -> t -> int
- = "llvm_ee_run_function_as_main"
- external free_machine_code: Llvm.llvalue -> t -> unit
- = "llvm_ee_free_machine_code"
-
- external target_data: t -> Llvm_target.TargetData.t
- = "LLVMGetExecutionEngineTargetData"
-
- (* The following are not bound. Patches are welcome.
-
- get_target_data: t -> lltargetdata
- add_global_mapping: llvalue -> llgenericvalue -> t -> unit
- clear_all_global_mappings: t -> unit
- update_global_mapping: llvalue -> llgenericvalue -> t -> unit
- get_pointer_to_global_if_available: llvalue -> t -> llgenericvalue
- get_pointer_to_global: llvalue -> t -> llgenericvalue
- get_pointer_to_function: llvalue -> t -> llgenericvalue
- get_pointer_to_function_or_stub: llvalue -> t -> llgenericvalue
- get_global_value_at_address: llgenericvalue -> t -> llvalue option
- store_value_to_memory: llgenericvalue -> llgenericvalue -> lltype -> unit
- initialize_memory: llvalue -> llgenericvalue -> t -> unit
- recompile_and_relink_function: llvalue -> t -> llgenericvalue
- get_or_emit_global_variable: llvalue -> t -> llgenericvalue
- disable_lazy_compilation: t -> unit
- lazy_compilation_enabled: t -> bool
- install_lazy_function_creator: (string -> llgenericvalue) -> t -> unit
-
- *)
-end
diff --git a/release_23/bindings/ocaml/executionengine/llvm_executionengine.mli b/release_23/bindings/ocaml/executionengine/llvm_executionengine.mli
deleted file mode 100644
index 9794f358fff1..000000000000
--- a/release_23/bindings/ocaml/executionengine/llvm_executionengine.mli
+++ /dev/null
@@ -1,154 +0,0 @@
-(*===-- llvm_executionengine.mli - LLVM Ocaml Interface ---------*- C++ -*-===*
- *
- * The LLVM Compiler Infrastructure
- *
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
- *
- *===----------------------------------------------------------------------===*)
-
-(** JIT Interpreter.
-
- This interface provides an ocaml API for LLVM execution engine (JIT/
- interpreter), the classes in the ExecutionEngine library. *)
-
-exception Error of string
-
-module GenericValue: sig
- (** [GenericValue.t] is a boxed union type used to portably pass arguments to
- and receive values from the execution engine. It supports only a limited
- selection of types; for more complex argument types, it is necessary to
- generate a stub function by hand or to pass parameters by reference.
- See the struct [llvm::GenericValue]. *)
- type t
-
- (** [of_float fpty n] boxes the float [n] in a float-valued generic value
- according to the floating point type [fpty]. See the fields
- [llvm::GenericValue::DoubleVal] and [llvm::GenericValue::FloatVal]. *)
- val of_float: Llvm.lltype -> float -> t
-
- (** [of_pointer v] boxes the pointer value [v] in a generic value. See the
- field [llvm::GenericValue::PointerVal]. *)
- val of_pointer: 'a -> t
-
- (** [of_int32 n w] boxes the int32 [i] in a generic value with the bitwidth
- [w]. See the field [llvm::GenericValue::IntVal]. *)
- val of_int32: Llvm.lltype -> int32 -> t
-
- (** [of_int n w] boxes the int [i] in a generic value with the bitwidth
- [w]. See the field [llvm::GenericValue::IntVal]. *)
- val of_int: Llvm.lltype -> int -> t
-
- (** [of_natint n w] boxes the native int [i] in a generic value with the
- bitwidth [w]. See the field [llvm::GenericValue::IntVal]. *)
- val of_nativeint: Llvm.lltype -> nativeint -> t
-
- (** [of_int64 n w] boxes the int64 [i] in a generic value with the bitwidth
- [w]. See the field [llvm::GenericValue::IntVal]. *)
- val of_int64: Llvm.lltype -> int64 -> t
-
- (** [as_float fpty gv] unboxes the floating point-valued generic value [gv] of
- floating point type [fpty]. See the fields [llvm::GenericValue::DoubleVal]
- and [llvm::GenericValue::FloatVal]. *)
- val as_float: Llvm.lltype -> t -> float
-
- (** [as_pointer gv] unboxes the pointer-valued generic value [gv]. See the
- field [llvm::GenericValue::PointerVal]. *)
- val as_pointer: t -> 'a
-
- (** [as_int32 gv] unboxes the integer-valued generic value [gv] as an [int32].
- Is invalid if [gv] has a bitwidth greater than 32 bits. See the field
- [llvm::GenericValue::IntVal]. *)
- val as_int32: t -> int32
-
- (** [as_int gv] unboxes the integer-valued generic value [gv] as an [int].
- Is invalid if [gv] has a bitwidth greater than the host bit width (but the
- most significant bit may be lost). See the field
- [llvm::GenericValue::IntVal]. *)
- val as_int: t -> int
-
- (** [as_natint gv] unboxes the integer-valued generic value [gv] as a
- [nativeint]. Is invalid if [gv] has a bitwidth greater than
- [nativeint]. See the field [llvm::GenericValue::IntVal]. *)
- val as_nativeint: t -> nativeint
-
- (** [as_int64 gv] returns the integer-valued generic value [gv] as an [int64].
- Is invalid if [gv] has a bitwidth greater than [int64]. See the field
- [llvm::GenericValue::IntVal]. *)
- val as_int64: t -> int64
-end
-
-
-module ExecutionEngine: sig
- (** An execution engine is either a JIT compiler or an interpreter, capable of
- directly loading an LLVM module and executing its functions without first
- invoking a static compiler and generating a native executable. *)
- type t
-
- (** [create mp] creates a new execution engine, taking ownership of the
- module provider [mp] if successful. Creates a JIT if possible, else falls
- back to an interpreter. Raises [Error msg] if an error occurrs. The
- execution engine is not garbage collected and must be destroyed with
- [dispose ee]. See the function [llvm::ExecutionEngine::create]. *)
- val create: Llvm.llmoduleprovider -> t
-
- (** [create_interpreter mp] creates a new interpreter, taking ownership of the
- module provider [mp] if successful. Raises [Error msg] if an error
- occurrs. The execution engine is not garbage collected and must be
- destroyed with [dispose ee].
- See the function [llvm::ExecutionEngine::create]. *)
- val create_interpreter: Llvm.llmoduleprovider -> t
-
- (** [create_jit mp] creates a new JIT (just-in-time compiler), taking
- ownership of the module provider [mp] if successful. Raises [Error msg] if
- an error occurrs. The execution engine is not garbage collected and must
- be destroyed with [dispose ee].
- See the function [llvm::ExecutionEngine::create]. *)
- val create_jit: Llvm.llmoduleprovider -> t
-
- (** [dispose ee] releases the memory used by the execution engine and must be
- invoked to avoid memory leaks. *)
- val dispose: t -> unit
-
- (** [add_module_provider mp ee] adds the module provider [mp] to the execution
- engine [ee]. *)
- val add_module_provider: Llvm.llmoduleprovider -> t -> unit
-
- (** [remove_module_provider mp ee] removes the module provider [mp] from the
- execution engine [ee], disposing of [mp] and the module referenced by
- [mp]. Raises [Error msg] if an error occurs. *)
- val remove_module_provider: Llvm.llmoduleprovider -> t -> Llvm.llmodule
-
- (** [find_function n ee] finds the function named [n] defined in any of the
- modules owned by the execution engine [ee]. Returns [None] if the function
- is not found and [Some f] otherwise. *)
- val find_function: string -> t -> Llvm.llvalue option
-
- (** [run_function f args ee] synchronously executes the function [f] with the
- arguments [args], which must be compatible with the parameter types. *)
- val run_function: Llvm.llvalue -> GenericValue.t array -> t ->
- GenericValue.t
-
- (** [run_static_ctors ee] executes the static constructors of each module in
- the execution engine [ee]. *)
- val run_static_ctors: t -> unit
-
- (** [run_static_dtors ee] executes the static destructors of each module in
- the execution engine [ee]. *)
- val run_static_dtors: t -> unit
-
- (** [run_function_as_main f args env ee] executes the function [f] as a main
- function, passing it [argv] and [argc] according to the string array
- [args], and [envp] as specified by the array [env]. Returns the integer
- return value of the function. *)
- val run_function_as_main: Llvm.llvalue -> string array ->
- (string * string) array -> t -> int
-
- (** [free_machine_code f ee] releases the memory in the execution engine [ee]
- used to store the machine code for the function [f]. *)
- val free_machine_code: Llvm.llvalue -> t -> unit
-
- (** [target_data ee] is the target data owned by the execution engine
- [ee]. *)
- val target_data: t -> Llvm_target.TargetData.t
-end
diff --git a/release_23/bindings/ocaml/llvm/Makefile b/release_23/bindings/ocaml/llvm/Makefile
deleted file mode 100644
index 3a06fb6a9abb..000000000000
--- a/release_23/bindings/ocaml/llvm/Makefile
+++ /dev/null
@@ -1,20 +0,0 @@
-##===- bindings/ocaml/bitwriter/Makefile -------------------*- Makefile -*-===##
-#
-# The LLVM Compiler Infrastructure
-#
-# This file is distributed under the University of Illinois Open Source
-# License. See LICENSE.TXT for details.
-#
-##===----------------------------------------------------------------------===##
-#
-# This is the makefile for the Objective Caml Llvm interface.
-#
-##===----------------------------------------------------------------------===##
-
-LEVEL := ../../..
-LIBRARYNAME := llvm
-DONT_BUILD_RELINKED := 1
-UsedComponents := core
-UsedOcamLibs := llvm
-
-include ../Makefile.ocaml
diff --git a/release_23/bindings/ocaml/llvm/llvm.ml b/release_23/bindings/ocaml/llvm/llvm.ml
deleted file mode 100644
index 85acc5e5787c..000000000000
--- a/release_23/bindings/ocaml/llvm/llvm.ml
+++ /dev/null
@@ -1,806 +0,0 @@
-(*===-- llvm/llvm.ml - LLVM Ocaml Interface --------------------------------===*
- *
- * The LLVM Compiler Infrastructure
- *
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
- *
- *===----------------------------------------------------------------------===*)
-
-
-type llmodule
-type lltype
-type lltypehandle
-type llvalue
-type llbasicblock
-type llbuilder
-type llmoduleprovider
-type llmemorybuffer
-
-module TypeKind = struct
- type t =
- | Void
- | Float
- | Double
- | X86fp80
- | Fp128
- | Ppc_fp128
- | Label
- | Integer
- | Function
- | Struct
- | Array
- | Pointer
- | Opaque
- | Vector
-end
-
-module Linkage = struct
- type t =
- | External
- | Link_once
- | Weak
- | Appending
- | Internal
- | Dllimport
- | Dllexport
- | External_weak
- | Ghost
-end
-
-module Visibility = struct
- type t =
- | Default
- | Hidden
- | Protected
-end
-
-module CallConv = struct
- let c = 0
- let fast = 8
- let cold = 9
- let x86_stdcall = 64
- let x86_fastcall = 65
-end
-
-module Icmp = struct
- type t =
- | Eq
- | Ne
- | Ugt
- | Uge
- | Ult
- | Ule
- | Sgt
- | Sge
- | Slt
- | Sle
-end
-
-module Fcmp = struct
- type t =
- | False
- | Oeq
- | Ogt
- | Oge
- | Olt
- | Ole
- | One
- | Ord
- | Uno
- | Ueq
- | Ugt
- | Uge
- | Ult
- | Ule
- | Une
- | True
-end
-
-exception IoError of string
-
-external register_exns : exn -> unit = "llvm_register_core_exns"
-let _ = register_exns (IoError "")
-
-type ('a, 'b) llpos =
-| At_end of 'a
-| Before of 'b
-
-type ('a, 'b) llrev_pos =
-| At_start of 'a
-| After of 'b
-
-
-(*===-- Modules -----------------------------------------------------------===*)
-
-external create_module : string -> llmodule = "llvm_create_module"
-external dispose_module : llmodule -> unit = "llvm_dispose_module"
-external target_triple: llmodule -> string
- = "llvm_target_triple"
-external set_target_triple: string -> llmodule -> unit
- = "llvm_set_target_triple"
-external data_layout: llmodule -> string
- = "llvm_data_layout"
-external set_data_layout: string -> llmodule -> unit
- = "llvm_set_data_layout"
-external define_type_name : string -> lltype -> llmodule -> bool
- = "llvm_add_type_name"
-external delete_type_name : string -> llmodule -> unit
- = "llvm_delete_type_name"
-external dump_module : llmodule -> unit = "llvm_dump_module"
-
-(*===-- Types -------------------------------------------------------------===*)
-
-external classify_type : lltype -> TypeKind.t = "llvm_classify_type"
-
-(*--... Operations on integer types ........................................--*)
-external _i1_type : unit -> lltype = "llvm_i1_type"
-external _i8_type : unit -> lltype = "llvm_i8_type"
-external _i16_type : unit -> lltype = "llvm_i16_type"
-external _i32_type : unit -> lltype = "llvm_i32_type"
-external _i64_type : unit -> lltype = "llvm_i64_type"
-
-let i1_type = _i1_type ()
-let i8_type = _i8_type ()
-let i16_type = _i16_type ()
-let i32_type = _i32_type ()
-let i64_type = _i64_type ()
-
-external integer_type : int -> lltype = "llvm_integer_type"
-external integer_bitwidth : lltype -> int = "llvm_integer_bitwidth"
-
-(*--... Operations on real types ...........................................--*)
-external _float_type : unit -> lltype = "llvm_float_type"
-external _double_type : unit -> lltype = "llvm_double_type"
-external _x86fp80_type : unit -> lltype = "llvm_x86fp80_type"
-external _fp128_type : unit -> lltype = "llvm_fp128_type"
-external _ppc_fp128_type : unit -> lltype = "llvm_ppc_fp128_type"
-
-let float_type = _float_type ()
-let double_type = _double_type ()
-let x86fp80_type = _x86fp80_type ()
-let fp128_type = _fp128_type ()
-let ppc_fp128_type = _ppc_fp128_type ()
-
-(*--... Operations on function types .......................................--*)
-external function_type : lltype -> lltype array -> lltype = "llvm_function_type"
-external var_arg_function_type : lltype -> lltype array -> lltype
- = "llvm_var_arg_function_type"
-external is_var_arg : lltype -> bool = "llvm_is_var_arg"
-external return_type : lltype -> lltype = "LLVMGetReturnType"
-external param_types : lltype -> lltype array = "llvm_param_types"
-
-(*--... Operations on struct types .........................................--*)
-external struct_type : lltype array -> lltype = "llvm_struct_type"
-external packed_struct_type : lltype array -> lltype = "llvm_packed_struct_type"
-external element_types : lltype -> lltype array = "llvm_element_types"
-external is_packed : lltype -> bool = "llvm_is_packed"
-
-(*--... Operations on pointer, vector, and array types .....................--*)
-external array_type : lltype -> int -> lltype = "llvm_array_type"
-external pointer_type : lltype -> lltype = "llvm_pointer_type"
-external qualified_pointer_type : lltype -> int -> lltype
- = "llvm_qualified_pointer_type"
-external vector_type : lltype -> int -> lltype = "llvm_vector_type"
-
-external element_type : lltype -> lltype = "LLVMGetElementType"
-external array_length : lltype -> int = "llvm_array_length"
-external address_space : lltype -> int = "llvm_address_space"
-external vector_size : lltype -> int = "llvm_vector_size"
-
-(*--... Operations on other types ..........................................--*)
-external opaque_type : unit -> lltype = "llvm_opaque_type"
-external _void_type : unit -> lltype = "llvm_void_type"
-external _label_type : unit -> lltype = "llvm_label_type"
-
-let void_type = _void_type ()
-let label_type = _label_type ()
-
-(*--... Operations on type handles .........................................--*)
-external handle_to_type : lltype -> lltypehandle = "llvm_handle_to_type"
-external type_of_handle : lltypehandle -> lltype = "llvm_type_of_handle"
-external refine_type : lltype -> lltype -> unit = "llvm_refine_type"
-
-
-(*===-- Values ------------------------------------------------------------===*)
-
-external type_of : llvalue -> lltype = "llvm_type_of"
-external value_name : llvalue -> string = "llvm_value_name"
-external set_value_name : string -> llvalue -> unit = "llvm_set_value_name"
-external dump_value : llvalue -> unit = "llvm_dump_value"
-
-(*--... Operations on constants of (mostly) any type .......................--*)
-external is_constant : llvalue -> bool = "llvm_is_constant"
-external const_null : lltype -> llvalue = "LLVMConstNull"
-external const_all_ones : (*int|vec*)lltype -> llvalue = "LLVMConstAllOnes"
-external undef : lltype -> llvalue = "LLVMGetUndef"
-external is_null : llvalue -> bool = "llvm_is_null"
-external is_undef : llvalue -> bool = "llvm_is_undef"
-
-(*--... Operations on scalar constants .....................................--*)
-external const_int : lltype -> int -> llvalue = "llvm_const_int"
-external const_of_int64 : lltype -> Int64.t -> bool -> llvalue
- = "llvm_const_of_int64"
-external const_float : lltype -> float -> llvalue = "llvm_const_float"
-
-(*--... Operations on composite constants ..................................--*)
-external const_string : string -> llvalue = "llvm_const_string"
-external const_stringz : string -> llvalue = "llvm_const_stringz"
-external const_array : lltype -> llvalue array -> llvalue = "llvm_const_array"
-external const_struct : llvalue array -> llvalue = "llvm_const_struct"
-external const_packed_struct : llvalue array -> llvalue
- = "llvm_const_packed_struct"
-external const_vector : llvalue array -> llvalue = "llvm_const_vector"
-
-(*--... Constant expressions ...............................................--*)
-external size_of : lltype -> llvalue = "LLVMSizeOf"
-external const_neg : llvalue -> llvalue = "LLVMConstNeg"
-external const_not : llvalue -> llvalue = "LLVMConstNot"
-external const_add : llvalue -> llvalue -> llvalue = "LLVMConstAdd"
-external const_sub : llvalue -> llvalue -> llvalue = "LLVMConstSub"
-external const_mul : llvalue -> llvalue -> llvalue = "LLVMConstMul"
-external const_udiv : llvalue -> llvalue -> llvalue = "LLVMConstUDiv"
-external const_sdiv : llvalue -> llvalue -> llvalue = "LLVMConstSDiv"
-external const_fdiv : llvalue -> llvalue -> llvalue = "LLVMConstFDiv"
-external const_urem : llvalue -> llvalue -> llvalue = "LLVMConstURem"
-external const_srem : llvalue -> llvalue -> llvalue = "LLVMConstSRem"
-external const_frem : llvalue -> llvalue -> llvalue = "LLVMConstFRem"
-external const_and : llvalue -> llvalue -> llvalue = "LLVMConstAnd"
-external const_or : llvalue -> llvalue -> llvalue = "LLVMConstOr"
-external const_xor : llvalue -> llvalue -> llvalue = "LLVMConstXor"
-external const_icmp : Icmp.t -> llvalue -> llvalue -> llvalue
- = "llvm_const_icmp"
-external const_fcmp : Fcmp.t -> llvalue -> llvalue -> llvalue
- = "llvm_const_fcmp"
-external const_shl : llvalue -> llvalue -> llvalue = "LLVMConstShl"
-external const_lshr : llvalue -> llvalue -> llvalue = "LLVMConstLShr"
-external const_ashr : llvalue -> llvalue -> llvalue = "LLVMConstAShr"
-external const_gep : llvalue -> llvalue array -> llvalue = "llvm_const_gep"
-external const_trunc : llvalue -> lltype -> llvalue = "LLVMConstTrunc"
-external const_sext : llvalue -> lltype -> llvalue = "LLVMConstSExt"
-external const_zext : llvalue -> lltype -> llvalue = "LLVMConstZExt"
-external const_fptrunc : llvalue -> lltype -> llvalue = "LLVMConstFPTrunc"
-external const_fpext : llvalue -> lltype -> llvalue = "LLVMConstFPExt"
-external const_uitofp : llvalue -> lltype -> llvalue = "LLVMConstUIToFP"
-external const_sitofp : llvalue -> lltype -> llvalue = "LLVMConstSIToFP"
-external const_fptoui : llvalue -> lltype -> llvalue = "LLVMConstFPToUI"
-external const_fptosi : llvalue -> lltype -> llvalue = "LLVMConstFPToSI"
-external const_ptrtoint : llvalue -> lltype -> llvalue = "LLVMConstPtrToInt"
-external const_inttoptr : llvalue -> lltype -> llvalue = "LLVMConstIntToPtr"
-external const_bitcast : llvalue -> lltype -> llvalue = "LLVMConstBitCast"
-external const_select : llvalue -> llvalue -> llvalue -> llvalue
- = "LLVMConstSelect"
-external const_extractelement : llvalue -> llvalue -> llvalue
- = "LLVMConstExtractElement"
-external const_insertelement : llvalue -> llvalue -> llvalue -> llvalue
- = "LLVMConstInsertElement"
-external const_shufflevector : llvalue -> llvalue -> llvalue -> llvalue
- = "LLVMConstShuffleVector"
-
-(*--... Operations on global variables, functions, and aliases (globals) ...--*)
-external global_parent : llvalue -> llmodule = "LLVMGetGlobalParent"
-external is_declaration : llvalue -> bool = "llvm_is_declaration"
-external linkage : llvalue -> Linkage.t = "llvm_linkage"
-external set_linkage : Linkage.t -> llvalue -> unit = "llvm_set_linkage"
-external section : llvalue -> string = "llvm_section"
-external set_section : string -> llvalue -> unit = "llvm_set_section"
-external visibility : llvalue -> Visibility.t = "llvm_visibility"
-external set_visibility : Visibility.t -> llvalue -> unit = "llvm_set_visibility"
-external alignment : llvalue -> int = "llvm_alignment"
-external set_alignment : int -> llvalue -> unit = "llvm_set_alignment"
-external is_global_constant : llvalue -> bool = "llvm_is_global_constant"
-external set_global_constant : bool -> llvalue -> unit
- = "llvm_set_global_constant"
-
-(*--... Operations on global variables .....................................--*)
-external declare_global : lltype -> string -> llmodule -> llvalue
- = "llvm_declare_global"
-external define_global : string -> llvalue -> llmodule -> llvalue
- = "llvm_define_global"
-external lookup_global : string -> llmodule -> llvalue option
- = "llvm_lookup_global"
-external delete_global : llvalue -> unit = "llvm_delete_global"
-external has_initializer : llvalue -> bool = "llvm_has_initializer"
-external global_initializer : llvalue -> llvalue = "LLVMGetInitializer"
-external set_initializer : llvalue -> llvalue -> unit = "llvm_set_initializer"
-external remove_initializer : llvalue -> unit = "llvm_remove_initializer"
-external is_thread_local : llvalue -> bool = "llvm_is_thread_local"
-external set_thread_local : bool -> llvalue -> unit = "llvm_set_thread_local"
-external global_begin : llmodule -> (llmodule, llvalue) llpos
- = "llvm_global_begin"
-external global_succ : llvalue -> (llmodule, llvalue) llpos
- = "llvm_global_succ"
-external global_end : llmodule -> (llmodule, llvalue) llrev_pos
- = "llvm_global_end"
-external global_pred : llvalue -> (llmodule, llvalue) llrev_pos
- = "llvm_global_pred"
-
-let rec iter_global_range f i e =
- if i = e then () else
- match i with
- | At_end _ -> raise (Invalid_argument "Invalid global variable range.")
- | Before bb ->
- f bb;
- iter_global_range f (global_succ bb) e
-
-let iter_globals f m =
- iter_global_range f (global_begin m) (At_end m)
-
-let rec fold_left_global_range f init i e =
- if i = e then init else
- match i with
- | At_end _ -> raise (Invalid_argument "Invalid global variable range.")
- | Before bb -> fold_left_global_range f (f init bb) (global_succ bb) e
-
-let fold_left_globals f init m =
- fold_left_global_range f init (global_begin m) (At_end m)
-
-let rec rev_iter_global_range f i e =
- if i = e then () else
- match i with
- | At_start _ -> raise (Invalid_argument "Invalid global variable range.")
- | After bb ->
- f bb;
- rev_iter_global_range f (global_pred bb) e
-
-let rev_iter_globals f m =
- rev_iter_global_range f (global_end m) (At_start m)
-
-let rec fold_right_global_range f i e init =
- if i = e then init else
- match i with
- | At_start _ -> raise (Invalid_argument "Invalid global variable range.")
- | After bb -> fold_right_global_range f (global_pred bb) e (f bb init)
-
-let fold_right_globals f m init =
- fold_right_global_range f (global_end m) (At_start m) init
-
-(*--... Operations on functions ............................................--*)
-external declare_function : string -> lltype -> llmodule -> llvalue
- = "llvm_declare_function"
-external define_function : string -> lltype -> llmodule -> llvalue
- = "llvm_define_function"
-external lookup_function : string -> llmodule -> llvalue option
- = "llvm_lookup_function"
-external delete_function : llvalue -> unit = "llvm_delete_function"
-external is_intrinsic : llvalue -> bool = "llvm_is_intrinsic"
-external function_call_conv : llvalue -> int = "llvm_function_call_conv"
-external set_function_call_conv : int -> llvalue -> unit
- = "llvm_set_function_call_conv"
-external collector : llvalue -> string option = "llvm_collector"
-external set_collector : string option -> llvalue -> unit = "llvm_set_collector"
-external function_begin : llmodule -> (llmodule, llvalue) llpos
- = "llvm_function_begin"
-external function_succ : llvalue -> (llmodule, llvalue) llpos
- = "llvm_function_succ"
-external function_end : llmodule -> (llmodule, llvalue) llrev_pos
- = "llvm_function_end"
-external function_pred : llvalue -> (llmodule, llvalue) llrev_pos
- = "llvm_function_pred"
-
-let rec iter_function_range f i e =
- if i = e then () else
- match i with
- | At_end _ -> raise (Invalid_argument "Invalid function range.")
- | Before fn ->
- f fn;
- iter_function_range f (function_succ fn) e
-
-let iter_functions f m =
- iter_function_range f (function_begin m) (At_end m)
-
-let rec fold_left_function_range f init i e =
- if i = e then init else
- match i with
- | At_end _ -> raise (Invalid_argument "Invalid function range.")
- | Before fn -> fold_left_function_range f (f init fn) (function_succ fn) e
-
-let fold_left_functions f init m =
- fold_left_function_range f init (function_begin m) (At_end m)
-
-let rec rev_iter_function_range f i e =
- if i = e then () else
- match i with
- | At_start _ -> raise (Invalid_argument "Invalid function range.")
- | After fn ->
- f fn;
- rev_iter_function_range f (function_pred fn) e
-
-let rev_iter_functions f m =
- rev_iter_function_range f (function_end m) (At_start m)
-
-let rec fold_right_function_range f i e init =
- if i = e then init else
- match i with
- | At_start _ -> raise (Invalid_argument "Invalid function range.")
- | After fn -> fold_right_function_range f (function_pred fn) e (f fn init)
-
-let fold_right_functions f m init =
- fold_right_function_range f (function_end m) (At_start m) init
-
-(* TODO: param attrs *)
-
-(*--... Operations on params ...............................................--*)
-external params : llvalue -> llvalue array = "llvm_params"
-external param : llvalue -> int -> llvalue = "llvm_param"
-external param_parent : llvalue -> llvalue = "LLVMGetParamParent"
-external param_begin : llvalue -> (llvalue, llvalue) llpos = "llvm_param_begin"
-external param_succ : llvalue -> (llvalue, llvalue) llpos = "llvm_param_succ"
-external param_end : llvalue -> (llvalue, llvalue) llrev_pos = "llvm_param_end"
-external param_pred : llvalue -> (llvalue, llvalue) llrev_pos ="llvm_param_pred"
-
-let rec iter_param_range f i e =
- if i = e then () else
- match i with
- | At_end _ -> raise (Invalid_argument "Invalid parameter range.")
- | Before p ->
- f p;
- iter_param_range f (param_succ p) e
-
-let iter_params f fn =
- iter_param_range f (param_begin fn) (At_end fn)
-
-let rec fold_left_param_range f init i e =
- if i = e then init else
- match i with
- | At_end _ -> raise (Invalid_argument "Invalid parameter range.")
- | Before p -> fold_left_param_range f (f init p) (param_succ p) e
-
-let fold_left_params f init fn =
- fold_left_param_range f init (param_begin fn) (At_end fn)
-
-let rec rev_iter_param_range f i e =
- if i = e then () else
- match i with
- | At_start _ -> raise (Invalid_argument "Invalid parameter range.")
- | After p ->
- f p;
- rev_iter_param_range f (param_pred p) e
-
-let rev_iter_params f fn =
- rev_iter_param_range f (param_end fn) (At_start fn)
-
-let rec fold_right_param_range f init i e =
- if i = e then init else
- match i with
- | At_start _ -> raise (Invalid_argument "Invalid parameter range.")
- | After p -> fold_right_param_range f (f p init) (param_pred p) e
-
-let fold_right_params f fn init =
- fold_right_param_range f init (param_end fn) (At_start fn)
-
-(*--... Operations on basic blocks .........................................--*)
-external value_of_block : llbasicblock -> llvalue = "LLVMBasicBlockAsValue"
-external value_is_block : llvalue -> bool = "llvm_value_is_block"
-external block_of_value : llvalue -> llbasicblock = "LLVMValueAsBasicBlock"
-external block_parent : llbasicblock -> llvalue = "LLVMGetBasicBlockParent"
-external basic_blocks : llvalue -> llbasicblock array = "llvm_basic_blocks"
-external entry_block : llvalue -> llbasicblock = "LLVMGetEntryBasicBlock"
-external delete_block : llbasicblock -> unit = "llvm_delete_block"
-external append_block : string -> llvalue -> llbasicblock = "llvm_append_block"
-external insert_block : string -> llbasicblock -> llbasicblock
- = "llvm_insert_block"
-external block_begin : llvalue -> (llvalue, llbasicblock) llpos
- = "llvm_block_begin"
-external block_succ : llbasicblock -> (llvalue, llbasicblock) llpos
- = "llvm_block_succ"
-external block_end : llvalue -> (llvalue, llbasicblock) llrev_pos
- = "llvm_block_end"
-external block_pred : llbasicblock -> (llvalue, llbasicblock) llrev_pos
- = "llvm_block_pred"
-
-let rec iter_block_range f i e =
- if i = e then () else
- match i with
- | At_end _ -> raise (Invalid_argument "Invalid block range.")
- | Before bb ->
- f bb;
- iter_block_range f (block_succ bb) e
-
-let iter_blocks f fn =
- iter_block_range f (block_begin fn) (At_end fn)
-
-let rec fold_left_block_range f init i e =
- if i = e then init else
- match i with
- | At_end _ -> raise (Invalid_argument "Invalid block range.")
- | Before bb -> fold_left_block_range f (f init bb) (block_succ bb) e
-
-let fold_left_blocks f init fn =
- fold_left_block_range f init (block_begin fn) (At_end fn)
-
-let rec rev_iter_block_range f i e =
- if i = e then () else
- match i with
- | At_start _ -> raise (Invalid_argument "Invalid block range.")
- | After bb ->
- f bb;
- rev_iter_block_range f (block_pred bb) e
-
-let rev_iter_blocks f fn =
- rev_iter_block_range f (block_end fn) (At_start fn)
-
-let rec fold_right_block_range f init i e =
- if i = e then init else
- match i with
- | At_start _ -> raise (Invalid_argument "Invalid block range.")
- | After bb -> fold_right_block_range f (f bb init) (block_pred bb) e
-
-let fold_right_blocks f fn init =
- fold_right_block_range f init (block_end fn) (At_start fn)
-
-(*--... Operations on instructions .........................................--*)
-external instr_parent : llvalue -> llbasicblock = "LLVMGetInstructionParent"
-external instr_begin : llbasicblock -> (llbasicblock, llvalue) llpos
- = "llvm_instr_begin"
-external instr_succ : llvalue -> (llbasicblock, llvalue) llpos
- = "llvm_instr_succ"
-external instr_end : llbasicblock -> (llbasicblock, llvalue) llrev_pos
- = "llvm_instr_end"
-external instr_pred : llvalue -> (llbasicblock, llvalue) llrev_pos
- = "llvm_instr_pred"
-
-let rec iter_instrs_range f i e =
- if i = e then () else
- match i with
- | At_end _ -> raise (Invalid_argument "Invalid instruction range.")
- | Before i ->
- f i;
- iter_instrs_range f (instr_succ i) e
-
-let iter_instrs f bb =
- iter_instrs_range f (instr_begin bb) (At_end bb)
-
-let rec fold_left_instrs_range f init i e =
- if i = e then init else
- match i with
- | At_end _ -> raise (Invalid_argument "Invalid instruction range.")
- | Before i -> fold_left_instrs_range f (f init i) (instr_succ i) e
-
-let fold_left_instrs f init bb =
- fold_left_instrs_range f init (instr_begin bb) (At_end bb)
-
-let rec rev_iter_instrs_range f i e =
- if i = e then () else
- match i with
- | At_start _ -> raise (Invalid_argument "Invalid instruction range.")
- | After i ->
- f i;
- rev_iter_instrs_range f (instr_pred i) e
-
-let rev_iter_instrs f bb =
- rev_iter_instrs_range f (instr_end bb) (At_start bb)
-
-let rec fold_right_instr_range f i e init =
- if i = e then init else
- match i with
- | At_start _ -> raise (Invalid_argument "Invalid instruction range.")
- | After i -> fold_right_instr_range f (instr_pred i) e (f i init)
-
-let fold_right_instrs f bb init =
- fold_right_instr_range f (instr_end bb) (At_start bb) init
-
-
-(*--... Operations on call sites ...........................................--*)
-external instruction_call_conv: llvalue -> int
- = "llvm_instruction_call_conv"
-external set_instruction_call_conv: int -> llvalue -> unit
- = "llvm_set_instruction_call_conv"
-
-(*--... Operations on phi nodes ............................................--*)
-external add_incoming : (llvalue * llbasicblock) -> llvalue -> unit
- = "llvm_add_incoming"
-external incoming : llvalue -> (llvalue * llbasicblock) list = "llvm_incoming"
-
-
-(*===-- Instruction builders ----------------------------------------------===*)
-external builder : unit -> llbuilder = "llvm_builder"
-external position_builder : (llbasicblock, llvalue) llpos -> llbuilder -> unit
- = "llvm_position_builder"
-external insertion_block : llbuilder -> llbasicblock = "llvm_insertion_block"
-
-let builder_at ip =
- let b = builder () in
- position_builder ip b;
- b
-
-let builder_before i = builder_at (Before i)
-let builder_at_end bb = builder_at (At_end bb)
-
-let position_before i = position_builder (Before i)
-let position_at_end bb = position_builder (At_end bb)
-
-
-(*--... Terminators ........................................................--*)
-external build_ret_void : llbuilder -> llvalue = "llvm_build_ret_void"
-external build_ret : llvalue -> llbuilder -> llvalue = "llvm_build_ret"
-external build_br : llbasicblock -> llbuilder -> llvalue = "llvm_build_br"
-external build_cond_br : llvalue -> llbasicblock -> llbasicblock -> llbuilder ->
- llvalue = "llvm_build_cond_br"
-external build_switch : llvalue -> llbasicblock -> int -> llbuilder -> llvalue
- = "llvm_build_switch"
-external build_invoke : llvalue -> llvalue array -> llbasicblock ->
- llbasicblock -> string -> llbuilder -> llvalue
- = "llvm_build_invoke_bc" "llvm_build_invoke_nat"
-external build_unwind : llbuilder -> llvalue = "llvm_build_unwind"
-external build_unreachable : llbuilder -> llvalue = "llvm_build_unreachable"
-
-(*--... Arithmetic .........................................................--*)
-external build_add : llvalue -> llvalue -> string -> llbuilder -> llvalue
- = "llvm_build_add"
-external build_sub : llvalue -> llvalue -> string -> llbuilder -> llvalue
- = "llvm_build_sub"
-external build_mul : llvalue -> llvalue -> string -> llbuilder -> llvalue
- = "llvm_build_mul"
-external build_udiv : llvalue -> llvalue -> string -> llbuilder -> llvalue
- = "llvm_build_udiv"
-external build_sdiv : llvalue -> llvalue -> string -> llbuilder -> llvalue
- = "llvm_build_sdiv"
-external build_fdiv : llvalue -> llvalue -> string -> llbuilder -> llvalue
- = "llvm_build_fdiv"
-external build_urem : llvalue -> llvalue -> string -> llbuilder -> llvalue
- = "llvm_build_urem"
-external build_srem : llvalue -> llvalue -> string -> llbuilder -> llvalue
- = "llvm_build_srem"
-external build_frem : llvalue -> llvalue -> string -> llbuilder -> llvalue
- = "llvm_build_frem"
-external build_shl : llvalue -> llvalue -> string -> llbuilder -> llvalue
- = "llvm_build_shl"
-external build_lshr : llvalue -> llvalue -> string -> llbuilder -> llvalue
- = "llvm_build_lshr"
-external build_ashr : llvalue -> llvalue -> string -> llbuilder -> llvalue
- = "llvm_build_ashr"
-external build_and : llvalue -> llvalue -> string -> llbuilder -> llvalue
- = "llvm_build_and"
-external build_or : llvalue -> llvalue -> string -> llbuilder -> llvalue
- = "llvm_build_or"
-external build_xor : llvalue -> llvalue -> string -> llbuilder -> llvalue
- = "llvm_build_xor"
-external build_neg : llvalue -> string -> llbuilder -> llvalue
- = "llvm_build_neg"
-external build_not : llvalue -> string -> llbuilder -> llvalue
- = "llvm_build_not"
-
-(*--... Memory .............................................................--*)
-external build_malloc : lltype -> string -> llbuilder -> llvalue
- = "llvm_build_malloc"
-external build_array_malloc : lltype -> llvalue -> string -> llbuilder ->
- llvalue = "llvm_build_array_malloc"
-external build_alloca : lltype -> string -> llbuilder -> llvalue
- = "llvm_build_alloca"
-external build_array_alloca : lltype -> llvalue -> string -> llbuilder ->
- llvalue = "llvm_build_array_alloca"
-external build_free : llvalue -> llbuilder -> llvalue = "llvm_build_free"
-external build_load : llvalue -> string -> llbuilder -> llvalue
- = "llvm_build_load"
-external build_store : llvalue -> llvalue -> llbuilder -> llvalue
- = "llvm_build_store"
-external build_gep : llvalue -> llvalue array -> string -> llbuilder -> llvalue
- = "llvm_build_gep"
-
-(*--... Casts ..............................................................--*)
-external build_trunc : llvalue -> lltype -> string -> llbuilder -> llvalue
- = "llvm_build_trunc"
-external build_zext : llvalue -> lltype -> string -> llbuilder -> llvalue
- = "llvm_build_zext"
-external build_sext : llvalue -> lltype -> string -> llbuilder -> llvalue
- = "llvm_build_sext"
-external build_fptoui : llvalue -> lltype -> string -> llbuilder -> llvalue
- = "llvm_build_fptoui"
-external build_fptosi : llvalue -> lltype -> string -> llbuilder -> llvalue
- = "llvm_build_fptosi"
-external build_uitofp : llvalue -> lltype -> string -> llbuilder -> llvalue
- = "llvm_build_uitofp"
-external build_sitofp : llvalue -> lltype -> string -> llbuilder -> llvalue
- = "llvm_build_sitofp"
-external build_fptrunc : llvalue -> lltype -> string -> llbuilder -> llvalue
- = "llvm_build_fptrunc"
-external build_fpext : llvalue -> lltype -> string -> llbuilder -> llvalue
- = "llvm_build_fpext"
-external build_ptrtoint : llvalue -> lltype -> string -> llbuilder -> llvalue
- = "llvm_build_prttoint"
-external build_inttoptr : llvalue -> lltype -> string -> llbuilder -> llvalue
- = "llvm_build_inttoptr"
-external build_bitcast : llvalue -> lltype -> string -> llbuilder -> llvalue
- = "llvm_build_bitcast"
-
-(*--... Comparisons ........................................................--*)
-external build_icmp : Icmp.t -> llvalue -> llvalue -> string ->
- llbuilder -> llvalue = "llvm_build_icmp"
-external build_fcmp : Fcmp.t -> llvalue -> llvalue -> string ->
- llbuilder -> llvalue = "llvm_build_fcmp"
-
-(*--... Miscellaneous instructions .........................................--*)
-external build_phi : (llvalue * llbasicblock) list -> string -> llbuilder ->
- llvalue = "llvm_build_phi"
-external build_call : llvalue -> llvalue array -> string -> llbuilder -> llvalue
- = "llvm_build_call"
-external build_select : llvalue -> llvalue -> llvalue -> string -> llbuilder ->
- llvalue = "llvm_build_select"
-external build_va_arg : llvalue -> lltype -> string -> llbuilder -> llvalue
- = "llvm_build_va_arg"
-external build_extractelement : llvalue -> llvalue -> string -> llbuilder ->
- llvalue = "llvm_build_extractelement"
-external build_insertelement : llvalue -> llvalue -> llvalue -> string ->
- llbuilder -> llvalue = "llvm_build_insertelement"
-external build_shufflevector : llvalue -> llvalue -> llvalue -> string ->
- llbuilder -> llvalue = "llvm_build_shufflevector"
-
-
-(*===-- Module providers --------------------------------------------------===*)
-
-module ModuleProvider = struct
- external create : llmodule -> llmoduleprovider
- = "LLVMCreateModuleProviderForExistingModule"
- external dispose : llmoduleprovider -> unit = "llvm_dispose_module_provider"
-end
-
-
-(*===-- Memory buffers ----------------------------------------------------===*)
-
-module MemoryBuffer = struct
- external of_file : string -> llmemorybuffer = "llvm_memorybuffer_of_file"
- external of_stdin : unit -> llmemorybuffer = "llvm_memorybuffer_of_stdin"
- external dispose : llmemorybuffer -> unit = "llvm_memorybuffer_dispose"
-end
-
-
-(*===-- Pass Manager ------------------------------------------------------===*)
-
-module PassManager = struct
- type 'a t
- type any = [ `Module | `Function ]
- external create : unit -> [ `Module ] t = "llvm_passmanager_create"
- external create_function : llmoduleprovider -> [ `Function ] t
- = "LLVMCreateFunctionPassManager"
- external run_module : llmodule -> [ `Module ] t -> bool
- = "llvm_passmanager_run_module"
- external initialize : [ `Function ] t -> bool = "llvm_passmanager_initialize"
- external run_function : llvalue -> [ `Function ] t -> bool
- = "llvm_passmanager_run_function"
- external finalize : [ `Function ] t -> bool = "llvm_passmanager_finalize"
- external dispose : [< any ] t -> unit = "llvm_passmanager_dispose"
-end
-
-
-(*===-- Non-Externs -------------------------------------------------------===*)
-(* These functions are built using the externals, so must be declared late. *)
-
-let concat2 sep arr =
- let s = ref "" in
- if 0 < Array.length arr then begin
- s := !s ^ arr.(0);
- for i = 1 to (Array.length arr) - 1 do
- s := !s ^ sep ^ arr.(i)
- done
- end;
- !s
-
-let rec string_of_lltype ty =
- (* FIXME: stop infinite recursion! :) *)
- match classify_type ty with
- TypeKind.Integer -> "i" ^ string_of_int (integer_bitwidth ty)
- | TypeKind.Pointer -> (string_of_lltype (element_type ty)) ^ "*"
- | TypeKind.Struct ->
- let s = "{ " ^ (concat2 ", " (
- Array.map string_of_lltype (element_types ty)
- )) ^ " }" in
- if is_packed ty
- then "<" ^ s ^ ">"
- else s
- | TypeKind.Array -> "[" ^ (string_of_int (array_length ty)) ^
- " x " ^ (string_of_lltype (element_type ty)) ^ "]"
- | TypeKind.Vector -> "<" ^ (string_of_int (vector_size ty)) ^
- " x " ^ (string_of_lltype (element_type ty)) ^ ">"
- | TypeKind.Opaque -> "opaque"
- | TypeKind.Function -> string_of_lltype (return_type ty) ^
- " (" ^ (concat2 ", " (
- Array.map string_of_lltype (param_types ty)
- )) ^ ")"
- | TypeKind.Label -> "label"
- | TypeKind.Ppc_fp128 -> "ppc_fp128"
- | TypeKind.Fp128 -> "fp128"
- | TypeKind.X86fp80 -> "x86_fp80"
- | TypeKind.Double -> "double"
- | TypeKind.Float -> "float"
- | TypeKind.Void -> "void"
diff --git a/release_23/bindings/ocaml/llvm/llvm.mli b/release_23/bindings/ocaml/llvm/llvm.mli
deleted file mode 100644
index 5aedefb9257f..000000000000
--- a/release_23/bindings/ocaml/llvm/llvm.mli
+++ /dev/null
@@ -1,1665 +0,0 @@
-(*===-- llvm/llvm.mli - LLVM Ocaml Interface -------------------------------===*
- *
- * The LLVM Compiler Infrastructure
- *
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
- *
- *===----------------------------------------------------------------------===*)
-
-(** Core API.
-
- This interface provides an ocaml API for the LLVM intermediate
- representation, the classes in the VMCore library. *)
-
-
-(** {6 Abstract types}
-
- These abstract types correlate directly to the LLVM VMCore classes. *)
-
-(** The top-level container for all other LLVM Intermediate Representation (IR)
- objects. See the [llvm::Module] class. *)
-type llmodule
-
-(** Each value in the LLVM IR has a type, an instance of [lltype]. See the
- [llvm::Type] class. *)
-type lltype
-
-(** When building recursive types using {!refine_type}, [lltype] values may
- become invalid; use [lltypehandle] to resolve this problem. See the
- [llvm::AbstractTypeHolder] class. *)
-type lltypehandle
-
-(** Any value in the LLVM IR. Functions, instructions, global variables,
- constants, and much more are all [llvalues]. See the [llvm::Value] class.
- This type covers a wide range of subclasses. *)
-type llvalue
-
-(** A basic block in LLVM IR. See the [llvm::BasicBlock] class. *)
-type llbasicblock
-
-(** Used to generate instructions in the LLVM IR. See the [llvm::LLVMBuilder]
- class. *)
-type llbuilder
-
-(** Used to provide a module to JIT or interpreter.
- See the [llvm::ModuleProvider] class. *)
-type llmoduleprovider
-
-(** Used to efficiently handle large buffers of read-only binary data.
- See the [llvm::MemoryBuffer] class. *)
-type llmemorybuffer
-
-(** The kind of an [lltype], the result of [classify_type ty]. See the
- [llvm::Type::TypeID] enumeration. *)
-module TypeKind : sig
- type t =
- Void
- | Float
- | Double
- | X86fp80
- | Fp128
- | Ppc_fp128
- | Label
- | Integer
- | Function
- | Struct
- | Array
- | Pointer
- | Opaque
- | Vector
-end
-
-(** The linkage of a global value, accessed with {!linkage} and
- {!set_linkage}. See [llvm::GlobalValue::LinkageTypes]. *)
-module Linkage : sig
- type t =
- External
- | Link_once
- | Weak
- | Appending
- | Internal
- | Dllimport
- | Dllexport
- | External_weak
- | Ghost
-end
-
-(** The linker visibility of a global value, accessed with {!visibility} and
- {!set_visibility}. See [llvm::GlobalValue::VisibilityTypes]. *)
-module Visibility : sig
- type t =
- Default
- | Hidden
- | Protected
-end
-
-(** The following calling convention values may be accessed with
- {!function_call_conv} and {!set_function_call_conv}. Calling
- conventions are open-ended. *)
-module CallConv : sig
- val c : int (** [c] is the C calling convention. *)
- val fast : int (** [fast] is the calling convention to allow LLVM
- maximum optimization opportunities. Use only with
- internal linkage. *)
- val cold : int (** [cold] is the calling convention for
- callee-save. *)
- val x86_stdcall : int (** [x86_stdcall] is the familiar stdcall calling
- convention from C. *)
- val x86_fastcall : int (** [x86_fastcall] is the familiar fastcall calling
- convention from C. *)
-end
-
-(** The predicate for an integer comparison ([icmp]) instruction.
- See the [llvm::ICmpInst::Predicate] enumeration. *)
-module Icmp : sig
- type t =
- | Eq
- | Ne
- | Ugt
- | Uge
- | Ult
- | Ule
- | Sgt
- | Sge
- | Slt
- | Sle
-end
-
-(** The predicate for a floating-point comparison ([fcmp]) instruction.
- See the [llvm::FCmpInst::Predicate] enumeration. *)
-module Fcmp : sig
- type t =
- | False
- | Oeq
- | Ogt
- | Oge
- | Olt
- | Ole
- | One
- | Ord
- | Uno
- | Ueq
- | Ugt
- | Uge
- | Ult
- | Ule
- | Une
- | True
-end
-
-
-(** {6 Iteration} *)
-
-(** [Before b] and [At_end a] specify positions from the start of the ['b] list
- of [a]. [llpos] is used to specify positions in and for forward iteration
- through the various value lists maintained by the LLVM IR. *)
-type ('a, 'b) llpos =
-| At_end of 'a
-| Before of 'b
-
-(** [After b] and [At_start a] specify positions from the end of the ['b] list
- of [a]. [llrev_pos] is used for reverse iteration through the various value
- lists maintained by the LLVM IR. *)
-type ('a, 'b) llrev_pos =
-| At_start of 'a
-| After of 'b
-
-
-(** {6 Exceptions} *)
-
-exception IoError of string
-
-
-(** {6 Modules} *)
-
-(** [create_module id] creates a module with the supplied module ID. Modules are
- not garbage collected; it is mandatory to call {!dispose_module} to free
- memory. See the constructor [llvm::Module::Module]. *)
-external create_module : string -> llmodule = "llvm_create_module"
-
-(** [dispose_module m] destroys a module [m] and all of the IR objects it
- contained. All references to subordinate objects are invalidated;
- referencing them will invoke undefined behavior. See the destructor
- [llvm::Module::~Module]. *)
-external dispose_module : llmodule -> unit = "llvm_dispose_module"
-
-(** [target_triple m] is the target specifier for the module [m], something like
- [i686-apple-darwin8]. See the method [llvm::Module::getTargetTriple]. *)
-external target_triple: llmodule -> string
- = "llvm_target_triple"
-
-(** [target_triple triple m] changes the target specifier for the module [m] to
- the string [triple]. See the method [llvm::Module::setTargetTriple]. *)
-external set_target_triple: string -> llmodule -> unit
- = "llvm_set_target_triple"
-
-(** [data_layout m] is the data layout specifier for the module [m], something
- like [e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-...-a0:0:64-f80:128:128]. See the
- method [llvm::Module::getDataLayout]. *)
-external data_layout: llmodule -> string
- = "llvm_data_layout"
-
-(** [set_data_layout s m] changes the data layout specifier for the module [m]
- to the string [s]. See the method [llvm::Module::setDataLayout]. *)
-external set_data_layout: string -> llmodule -> unit
- = "llvm_set_data_layout"
-
-(** [define_type_name name ty m] adds a named type to the module's symbol table.
- Returns [true] if successful. If such a name already exists, then no entry
- is added and [false] is returned. See the [llvm::Module::addTypeName]
- method. *)
-external define_type_name : string -> lltype -> llmodule -> bool
- = "llvm_add_type_name"
-
-(** [delete_type_name name] removes a type name from the module's symbol
- table. *)
-external delete_type_name : string -> llmodule -> unit
- = "llvm_delete_type_name"
-
-(** [dump_module m] prints the .ll representation of the module [m] to standard
- error. See the method [llvm::Module::dump]. *)
-external dump_module : llmodule -> unit = "llvm_dump_module"
-
-
-(** {6 Types} *)
-
-(** [classify_type ty] returns the {!TypeKind.t} corresponding to the type [ty].
- See the method [llvm::Type::getTypeID]. *)
-external classify_type : lltype -> TypeKind.t = "llvm_classify_type"
-
-(** [string_of_lltype ty] returns a string describing the type [ty]. *)
-val string_of_lltype : lltype -> string
-
-(** {7 Operations on integer types} *)
-
-(** The 1-bit integer type. See [llvm::Type::Int1Ty]. *)
-val i1_type : lltype
-
-(** The 8-bit integer type. See [llvm::Type::Int8Ty]. *)
-val i8_type : lltype
-
-(** The 16-bit integer type. See [llvm::Type::Int16Ty]. *)
-val i16_type : lltype
-
-(** The 32-bit integer type. See [llvm::Type::Int32Ty]. *)
-val i32_type : lltype
-
-(** The 64-bit integer type. See [llvm::Type::Int64Ty]. *)
-val i64_type : lltype
-
-(** [integer_type n] returns an integer type of bitwidth [n].
- See the method [llvm::IntegerType::get]. *)
-external integer_type : int -> lltype = "llvm_integer_type"
-
-(** [integer_bitwidth ty] returns the number of bits in the integer type [ty].
- See the method [llvm::IntegerType::getBitWidth]. *)
-external integer_bitwidth : lltype -> int = "llvm_integer_bitwidth"
-
-
-(** {7 Operations on real types} *)
-
-(** The IEEE 32-bit floating point type. See [llvm::Type::FloatTy]. *)
-val float_type : lltype
-
-(** The IEEE 64-bit floating point type. See [llvm::Type::DoubleTy]. *)
-val double_type : lltype
-
-(** The x87 80-bit floating point type. See [llvm::Type::X86_FP80Ty]. *)
-val x86fp80_type : lltype
-
-(** The IEEE 128-bit floating point type. See [llvm::Type::FP128Ty]. *)
-val fp128_type : lltype
-
-(** The PowerPC 128-bit floating point type. See [llvm::Type::PPC_FP128Ty]. *)
-val ppc_fp128_type : lltype
-
-
-(** {7 Operations on function types} *)
-
-(** [function_type ret_ty param_tys] returns the function type returning
- [ret_ty] and taking [param_tys] as parameters.
- See the method [llvm::FunctionType::get]. *)
-external function_type : lltype -> lltype array -> lltype = "llvm_function_type"
-
-(** [va_arg_function_type ret_ty param_tys] is just like
- [function_type ret_ty param_tys] except that it returns the function type
- which also takes a variable number of arguments.
- See the method [llvm::FunctionType::get]. *)
-external var_arg_function_type : lltype -> lltype array -> lltype
- = "llvm_var_arg_function_type"
-
-(** [is_var_arg fty] returns [true] if [fty] is a varargs function type, [false]
- otherwise. See the method [llvm::FunctionType::isVarArg]. *)
-external is_var_arg : lltype -> bool = "llvm_is_var_arg"
-
-(** [return_type fty] gets the return type of the function type [fty].
- See the method [llvm::FunctionType::getReturnType]. *)
-external return_type : lltype -> lltype = "LLVMGetReturnType"
-
-(** [param_types fty] gets the parameter types of the function type [fty].
- See the method [llvm::FunctionType::getParamType]. *)
-external param_types : lltype -> lltype array = "llvm_param_types"
-
-
-(** {7 Operations on struct types} *)
-
-(** [struct_type tys] returns the structure type containing in the types in the
- array [tys]. See the method [llvm::StructType::get]. *)
-external struct_type : lltype array -> lltype = "llvm_struct_type"
-
-(** [struct_type tys] returns the packed structure type containing in the types
- in the array [tys]. See the method [llvm::StructType::get]. *)
-external packed_struct_type : lltype array -> lltype = "llvm_packed_struct_type"
-
-(** [element_types sty] returns the constituent types of the struct type [sty].
- See the method [llvm::StructType::getElementType]. *)
-external element_types : lltype -> lltype array = "llvm_element_types"
-
-(** [is_packed sty] returns [true] if the structure type [sty] is packed,
- [false] otherwise. See the method [llvm::StructType::isPacked]. *)
-external is_packed : lltype -> bool = "llvm_is_packed"
-
-
-(** {7 Operations on pointer, vector, and array types} *)
-
-(** [array_type ty n] returns the array type containing [n] elements of type
- [ty]. See the method [llvm::ArrayType::get]. *)
-external array_type : lltype -> int -> lltype = "llvm_array_type"
-
-(** [pointer_type ty] returns the pointer type referencing objects of type
- [ty] in the default address space (0).
- See the method [llvm::PointerType::getUnqual]. *)
-external pointer_type : lltype -> lltype = "llvm_pointer_type"
-
-(** [qualified_pointer_type ty as] returns the pointer type referencing objects
- of type [ty] in address space [as].
- See the method [llvm::PointerType::get]. *)
-external qualified_pointer_type : lltype -> int -> lltype
- = "llvm_qualified_pointer_type"
-
-(** [vector_type ty n] returns the array type containing [n] elements of the
- primitive type [ty]. See the method [llvm::ArrayType::get]. *)
-external vector_type : lltype -> int -> lltype = "llvm_vector_type"
-
-(** [element_type ty] returns the element type of the pointer, vector, or array
- type [ty]. See the method [llvm::SequentialType::get]. *)
-external element_type : lltype -> lltype = "LLVMGetElementType"
-
-(** [element_type aty] returns the element count of the array type [aty].
- See the method [llvm::ArrayType::getNumElements]. *)
-external array_length : lltype -> int = "llvm_array_length"
-
-(** [address_space pty] returns the address space qualifier of the pointer type
- [pty]. See the method [llvm::PointerType::getAddressSpace]. *)
-external address_space : lltype -> int = "llvm_address_space"
-
-(** [element_type ty] returns the element count of the vector type [ty].
- See the method [llvm::VectorType::getNumElements]. *)
-external vector_size : lltype -> int = "llvm_vector_size"
-
-
-(** {7 Operations on other types} *)
-
-(** [opaque_type ()] creates a new opaque type distinct from any other.
- Opaque types are useful for building recursive types in combination with
- {!refine_type}.
- See [llvm::OpaqueType::get]. *)
-external opaque_type : unit -> lltype = "llvm_opaque_type"
-
-(** [void_type] is the type of a function which does not return any value.
- See [llvm::Type::VoidTy]. *)
-val void_type : lltype
-
-(** [label_type] is the type of a basic block. See [llvm::Type::LabelTy]. *)
-val label_type : lltype
-
-(** {7 Operations on type handles} *)
-
-(** [handle_to_type ty] creates a handle to the type [ty]. If [ty] is later
- refined as a result of a call to {!refine_type}, the handle will be updated;
- any bare [lltype] references will become invalid.
- See the class [llvm::PATypeHolder]. *)
-external handle_to_type : lltype -> lltypehandle = "llvm_handle_to_type"
-
-(** [type_of_handle tyh] resolves the type handle [tyh].
- See the method [llvm::PATypeHolder::get()]. *)
-external type_of_handle : lltypehandle -> lltype = "llvm_type_of_handle"
-
-(** [refine_type opaque_ty ty] replaces the abstract type [opaque_ty] with the
- concrete type [ty] in all users. Warning: This may invalidate {!lltype}
- values! Use {!lltypehandle} to manipulate potentially abstract types. See
- the method [llvm::Type::refineAbstractType]. *)
-external refine_type : lltype -> lltype -> unit = "llvm_refine_type"
-
-
-(* {6 Values} *)
-
-(** [type_of v] returns the type of the value [v].
- See the method [llvm::Value::getType]. *)
-external type_of : llvalue -> lltype = "llvm_type_of"
-
-(** [value_name v] returns the name of the value [v]. For global values, this is
- the symbol name. For instructions and basic blocks, it is the SSA register
- name. It is meaningless for constants.
- See the method [llvm::Value::getName]. *)
-external value_name : llvalue -> string = "llvm_value_name"
-
-(** [set_value_name n v] sets the name of the value [v] to [n]. See the method
- [llvm::Value::setName]. *)
-external set_value_name : string -> llvalue -> unit = "llvm_set_value_name"
-
-(** [dump_value v] prints the .ll representation of the value [v] to standard
- error. See the method [llvm::Value::dump]. *)
-external dump_value : llvalue -> unit = "llvm_dump_value"
-
-
-(** {7 Operations on constants of (mostly) any type} *)
-
-(** [is_constant v] returns [true] if the value [v] is a constant, [false]
- otherwise. Similar to [llvm::isa<Constant>]. *)
-external is_constant : llvalue -> bool = "llvm_is_constant"
-
-(** [const_null ty] returns the constant null (zero) of the type [ty].
- See the method [llvm::Constant::getNullValue]. *)
-external const_null : lltype -> llvalue = "LLVMConstNull"
-
-(** [const_all_ones ty] returns the constant '-1' of the integer or vector type
- [ty]. See the method [llvm::Constant::getAllOnesValue]. *)
-external const_all_ones : (*int|vec*)lltype -> llvalue = "LLVMConstAllOnes"
-
-(** [undef ty] returns the undefined value of the type [ty].
- See the method [llvm::UndefValue::get]. *)
-external undef : lltype -> llvalue = "LLVMGetUndef"
-
-(** [is_null v] returns [true] if the value [v] is the null (zero) value.
- See the method [llvm::Constant::isNullValue]. *)
-external is_null : llvalue -> bool = "llvm_is_null"
-
-(** [is_undef v] returns [true] if the value [v] is an undefined value, [false]
- otherwise. Similar to [llvm::isa<UndefValue>]. *)
-external is_undef : llvalue -> bool = "llvm_is_undef"
-
-
-(** {7 Operations on scalar constants} *)
-
-(** [const_int ty i] returns the integer constant of type [ty] and value [i].
- See the method [llvm::ConstantInt::get]. *)
-external const_int : lltype -> int -> llvalue = "llvm_const_int"
-
-(** [const_of_int64 ty i] returns the integer constant of type [ty] and value
- [i]. See the method [llvm::ConstantInt::get]. *)
-external const_of_int64 : lltype -> Int64.t -> bool -> llvalue
- = "llvm_const_of_int64"
-
-(** [const_float ty n] returns the floating point constant of type [ty] and
- value [n]. See the method [llvm::ConstantInt::get]. *)
-external const_float : lltype -> float -> llvalue = "llvm_const_float"
-
-
-(** {7 Operations on composite constants} *)
-
-(** [const_string s] returns the constant [i8] array with the values of the
- characters in the string [s]. The array is not null-terminated (but see
- {!const_stringz}). This value can in turn be used as the initializer for a
- global variable. See the method [llvm::ConstantArray::get]. *)
-external const_string : string -> llvalue = "llvm_const_string"
-
-(** [const_stringz s] returns the constant [i8] array with the values of the
- characters in the string [s] and a null terminator. This value can in turn
- be used as the initializer for a global variable.
- See the method [llvm::ConstantArray::get]. *)
-external const_stringz : string -> llvalue = "llvm_const_stringz"
-
-(** [const_array ty elts] returns the constant array of type
- [array_type ty (Array.length elts)] and containing the values [elts].
- This value can in turn be used as the initializer for a global variable.
- See the method [llvm::ConstantArray::get]. *)
-external const_array : lltype -> llvalue array -> llvalue = "llvm_const_array"
-
-(** [const_struct elts] returns the structured constant of type
- [struct_type (Array.map type_of elts)] and containing the values [elts].
- This value can in turn be used as the initializer for a global variable.
- See the method [llvm::ConstantStruct::get]. *)
-external const_struct : llvalue array -> llvalue = "llvm_const_struct"
-
-(** [const_packed_struct elts] returns the structured constant of type
- {!packed_struct_type} [(Array.map type_of elts)] and containing the values
- [elts]. This value can in turn be used as the initializer for a global
- variable. See the method [llvm::ConstantStruct::get]. *)
-external const_packed_struct : llvalue array -> llvalue
- = "llvm_const_packed_struct"
-
-(** [const_vector elts] returns the vector constant of type
- [vector_type (type_of elts.(0)) (Array.length elts)] and containing the
- values [elts]. See the method [llvm::ConstantVector::get]. *)
-external const_vector : llvalue array -> llvalue = "llvm_const_vector"
-
-
-(** {7 Constant expressions} *)
-
-(** [size_of ty] returns the sizeof constant for the type [ty]. This is
- equivalent to [const_ptrtoint (const_gep (const_null (pointer_type ty))
- (const_int i64_type 1)) i64_type], but considerably more readable.
- See the method [llvm::ConstantExpr::getSizeOf]. *)
-external size_of : lltype -> llvalue = "LLVMSizeOf"
-
-(** [const_neg c] returns the arithmetic negation of the constant [c].
- See the method [llvm::ConstantExpr::getNeg]. *)
-external const_neg : llvalue -> llvalue = "LLVMConstNeg"
-
-(** [const_not c] returns the bitwise inverse of the constant [c].
- See the method [llvm::ConstantExpr::getNot]. *)
-external const_not : llvalue -> llvalue = "LLVMConstNot"
-
-(** [const_add c1 c2] returns the constant sum of two constants.
- See the method [llvm::ConstantExpr::getAdd]. *)
-external const_add : llvalue -> llvalue -> llvalue = "LLVMConstAdd"
-
-(** [const_sub c1 c2] returns the constant difference, [c1 - c2], of two
- constants. See the method [llvm::ConstantExpr::getSub]. *)
-external const_sub : llvalue -> llvalue -> llvalue = "LLVMConstSub"
-
-(** [const_mul c1 c2] returns the constant product of two constants.
- See the method [llvm::ConstantExpr::getMul]. *)
-external const_mul : llvalue -> llvalue -> llvalue = "LLVMConstMul"
-
-(** [const_udiv c1 c2] returns the constant quotient [c1 / c2] of two unsigned
- integer constants.
- See the method [llvm::ConstantExpr::getUDiv]. *)
-external const_udiv : llvalue -> llvalue -> llvalue = "LLVMConstUDiv"
-
-(** [const_sdiv c1 c2] returns the constant quotient [c1 / c2] of two signed
- integer constants.
- See the method [llvm::ConstantExpr::]. *)
-external const_sdiv : llvalue -> llvalue -> llvalue = "LLVMConstSDiv"
-
-(** [const_fdiv c1 c2] returns the constant quotient [c1 / c2] of two floating
- point constants.
- See the method [llvm::ConstantExpr::getFDiv]. *)
-external const_fdiv : llvalue -> llvalue -> llvalue = "LLVMConstFDiv"
-
-(** [const_udiv c1 c2] returns the constant remainder [c1 MOD c2] of two
- unsigned integer constants.
- See the method [llvm::ConstantExpr::getURem]. *)
-external const_urem : llvalue -> llvalue -> llvalue = "LLVMConstURem"
-
-(** [const_sdiv c1 c2] returns the constant remainder [c1 MOD c2] of two
- signed integer constants.
- See the method [llvm::ConstantExpr::getSRem]. *)
-external const_srem : llvalue -> llvalue -> llvalue = "LLVMConstSRem"
-
-(** [const_frem c1 c2] returns the constant remainder [c1 MOD c2] of two
- signed floating point constants.
- See the method [llvm::ConstantExpr::getFRem]. *)
-external const_frem : llvalue -> llvalue -> llvalue = "LLVMConstFRem"
-
-(** [const_and c1 c2] returns the constant bitwise [AND] of two integer
- constants.
- See the method [llvm::ConstantExpr::getAnd]. *)
-external const_and : llvalue -> llvalue -> llvalue = "LLVMConstAnd"
-
-(** [const_or c1 c2] returns the constant bitwise [OR] of two integer
- constants.
- See the method [llvm::ConstantExpr::getOr]. *)
-external const_or : llvalue -> llvalue -> llvalue = "LLVMConstOr"
-
-(** [const_xor c1 c2] returns the constant bitwise [XOR] of two integer
- constants.
- See the method [llvm::ConstantExpr::getXor]. *)
-external const_xor : llvalue -> llvalue -> llvalue = "LLVMConstXor"
-
-(** [const_icmp pred c1 c2] returns the constant comparison of two integer
- constants, [c1 pred c2].
- See the method [llvm::ConstantExpr::getICmp]. *)
-external const_icmp : Icmp.t -> llvalue -> llvalue -> llvalue
- = "llvm_const_icmp"
-
-(** [const_fcmp pred c1 c2] returns the constant comparison of two floating
- point constants, [c1 pred c2].
- See the method [llvm::ConstantExpr::getFCmp]. *)
-external const_fcmp : Fcmp.t -> llvalue -> llvalue -> llvalue
- = "llvm_const_fcmp"
-
-(** [const_shl c1 c2] returns the constant integer [c1] left-shifted by the
- constant integer [c2].
- See the method [llvm::ConstantExpr::getShl]. *)
-external const_shl : llvalue -> llvalue -> llvalue = "LLVMConstShl"
-
-(** [const_lshr c1 c2] returns the constant integer [c1] right-shifted by the
- constant integer [c2] with zero extension.
- See the method [llvm::ConstantExpr::getLShr]. *)
-external const_lshr : llvalue -> llvalue -> llvalue = "LLVMConstLShr"
-
-(** [const_ashr c1 c2] returns the constant integer [c1] right-shifted by the
- constant integer [c2] with sign extension.
- See the method [llvm::ConstantExpr::getAShr]. *)
-external const_ashr : llvalue -> llvalue -> llvalue = "LLVMConstAShr"
-
-(** [const_gep pc indices] returns the constant [getElementPtr] of [p1] with the
- constant integers indices from the array [indices].
- See the method [llvm::ConstantExpr::getGetElementPtr]. *)
-external const_gep : llvalue -> llvalue array -> llvalue = "llvm_const_gep"
-
-(** [const_trunc c ty] returns the constant truncation of integer constant [c]
- to the smaller integer type [ty].
- See the method [llvm::ConstantExpr::getTrunc]. *)
-external const_trunc : llvalue -> lltype -> llvalue = "LLVMConstTrunc"
-
-(** [const_sext c ty] returns the constant sign extension of integer constant
- [c] to the larger integer type [ty].
- See the method [llvm::ConstantExpr::getSExt]. *)
-external const_sext : llvalue -> lltype -> llvalue = "LLVMConstSExt"
-
-(** [const_zext c ty] returns the constant zero extension of integer constant
- [c] to the larger integer type [ty].
- See the method [llvm::ConstantExpr::getZExt]. *)
-external const_zext : llvalue -> lltype -> llvalue = "LLVMConstZExt"
-
-(** [const_fptrunc c ty] returns the constant truncation of floating point
- constant [c] to the smaller floating point type [ty].
- See the method [llvm::ConstantExpr::getFPTrunc]. *)
-external const_fptrunc : llvalue -> lltype -> llvalue = "LLVMConstFPTrunc"
-
-(** [const_fpext c ty] returns the constant extension of floating point constant
- [c] to the larger floating point type [ty].
- See the method [llvm::ConstantExpr::getFPExt]. *)
-external const_fpext : llvalue -> lltype -> llvalue = "LLVMConstFPExt"
-
-(** [const_uitofp c ty] returns the constant floating point conversion of
- unsigned integer constant [c] to the floating point type [ty].
- See the method [llvm::ConstantExpr::getUIToFP]. *)
-external const_uitofp : llvalue -> lltype -> llvalue = "LLVMConstUIToFP"
-
-(** [const_sitofp c ty] returns the constant floating point conversion of
- signed integer constant [c] to the floating point type [ty].
- See the method [llvm::ConstantExpr::getSIToFP]. *)
-external const_sitofp : llvalue -> lltype -> llvalue = "LLVMConstSIToFP"
-
-(** [const_fptoui c ty] returns the constant unsigned integer conversion of
- floating point constant [c] to integer type [ty].
- See the method [llvm::ConstantExpr::getFPToUI]. *)
-external const_fptoui : llvalue -> lltype -> llvalue = "LLVMConstFPToUI"
-
-(** [const_fptoui c ty] returns the constant unsigned integer conversion of
- floating point constant [c] to integer type [ty].
- See the method [llvm::ConstantExpr::getFPToSI]. *)
-external const_fptosi : llvalue -> lltype -> llvalue = "LLVMConstFPToSI"
-
-(** [const_ptrtoint c ty] returns the constant integer conversion of
- pointer constant [c] to integer type [ty].
- See the method [llvm::ConstantExpr::getPtrToInt]. *)
-external const_ptrtoint : llvalue -> lltype -> llvalue = "LLVMConstPtrToInt"
-
-(** [const_inttoptr c ty] returns the constant pointer conversion of
- integer constant [c] to pointer type [ty].
- See the method [llvm::ConstantExpr::getIntToPtr]. *)
-external const_inttoptr : llvalue -> lltype -> llvalue = "LLVMConstIntToPtr"
-
-(** [const_bitcast c ty] returns the constant bitwise conversion of constant [c]
- to type [ty] of equal size.
- See the method [llvm::ConstantExpr::getBitCast]. *)
-external const_bitcast : llvalue -> lltype -> llvalue = "LLVMConstBitCast"
-
-(** [const_select cond t f] returns the constant conditional which returns value
- [t] if the boolean constant [cond] is true and the value [f] otherwise.
- See the method [llvm::ConstantExpr::getSelect]. *)
-external const_select : llvalue -> llvalue -> llvalue -> llvalue
- = "LLVMConstSelect"
-
-(** [const_extractelement vec i] returns the constant [i]th element of
- constant vector [vec]. [i] must be a constant [i32] value unsigned less than
- the size of the vector.
- See the method [llvm::ConstantExpr::getExtractElement]. *)
-external const_extractelement : llvalue -> llvalue -> llvalue
- = "LLVMConstExtractElement"
-
-(** [const_insertelement vec v i] returns the constant vector with the same
- elements as constant vector [v] but the [i]th element replaced by the
- constant [v]. [v] must be a constant value with the type of the vector
- elements. [i] must be a constant [i32] value unsigned less than the size
- of the vector.
- See the method [llvm::ConstantExpr::getInsertElement]. *)
-external const_insertelement : llvalue -> llvalue -> llvalue -> llvalue
- = "LLVMConstInsertElement"
-
-(** [const_shufflevector a b mask] returns a constant [shufflevector].
- See the LLVM Language Reference for details on the [sufflevector]
- instruction.
- See the method [llvm::ConstantExpr::getShuffleVector]. *)
-external const_shufflevector : llvalue -> llvalue -> llvalue -> llvalue
- = "LLVMConstShuffleVector"
-
-
-(** {7 Operations on global variables, functions, and aliases (globals)} *)
-
-(** [global_parent g] is the enclosing module of the global value [g].
- See the method [llvm::GlobalValue::getParent]. *)
-external global_parent : llvalue -> llmodule = "LLVMGetGlobalParent"
-
-(** [is_declaration g] returns [true] if the global value [g] is a declaration
- only. Returns [false] otherwise.
- See the method [llvm::GlobalValue::isDeclaration]. *)
-external is_declaration : llvalue -> bool = "llvm_is_declaration"
-
-(** [linkage g] returns the linkage of the global value [g].
- See the method [llvm::GlobalValue::getLinkage]. *)
-external linkage : llvalue -> Linkage.t = "llvm_linkage"
-
-(** [set_linkage l g] sets the linkage of the global value [g] to [l].
- See the method [llvm::GlobalValue::setLinkage]. *)
-external set_linkage : Linkage.t -> llvalue -> unit = "llvm_set_linkage"
-
-(** [section g] returns the linker section of the global value [g].
- See the method [llvm::GlobalValue::getSection]. *)
-external section : llvalue -> string = "llvm_section"
-
-(** [set_section s g] sets the linker section of the global value [g] to [s].
- See the method [llvm::GlobalValue::setSection]. *)
-external set_section : string -> llvalue -> unit = "llvm_set_section"
-
-(** [visibility g] returns the linker visibility of the global value [g].
- See the method [llvm::GlobalValue::getVisibility]. *)
-external visibility : llvalue -> Visibility.t = "llvm_visibility"
-
-(** [set_visibility v g] sets the linker visibility of the global value [g] to
- [v]. See the method [llvm::GlobalValue::setVisibility]. *)
-external set_visibility : Visibility.t -> llvalue -> unit
- = "llvm_set_visibility"
-
-(** [alignment g] returns the required alignment of the global value [g].
- See the method [llvm::GlobalValue::getAlignment]. *)
-external alignment : llvalue -> int = "llvm_alignment"
-
-(** [set_alignment n g] sets the required alignment of the global value [g] to
- [n] bytes. See the method [llvm::GlobalValue::setAlignment]. *)
-external set_alignment : int -> llvalue -> unit = "llvm_set_alignment"
-
-
-(** {7 Operations on global variables} *)
-
-(** [declare_global ty name m] returns a new global variable of type [ty] and
- with name [name] in module [m]. If such a global variable already exists,
- it is returned. If the type of the existing global differs, then a bitcast
- to [ty] is returned. *)
-external declare_global : lltype -> string -> llmodule -> llvalue
- = "llvm_declare_global"
-
-(** [define_global name init m] returns a new global with name [name] and
- initializer [init] in module [m]. If the named global already exists, it is
- renamed.
- See the constructor of [llvm::GlobalVariable]. *)
-external define_global : string -> llvalue -> llmodule -> llvalue
- = "llvm_define_global"
-
-(** [lookup_global name m] returns [Some g] if a global variable with name
- [name] exists in module [m]. If no such global exists, returns [None].
- See the [llvm::GlobalVariable] constructor. *)
-external lookup_global : string -> llmodule -> llvalue option
- = "llvm_lookup_global"
-
-(** [delete_global gv] destroys the global variable [gv].
- See the method [llvm::GlobalVariable::eraseFromParent]. *)
-external delete_global : llvalue -> unit = "llvm_delete_global"
-
-(** [global_begin m] returns the first position in the global variable list of
- the module [m]. [global_begin] and [global_succ] can be used to iterate
- over the global list in order.
- See the method [llvm::Module::global_begin]. *)
-external global_begin : llmodule -> (llmodule, llvalue) llpos
- = "llvm_global_begin"
-
-(** [global_succ gv] returns the global variable list position succeeding
- [Before gv].
- See the method [llvm::Module::global_iterator::operator++]. *)
-external global_succ : llvalue -> (llmodule, llvalue) llpos
- = "llvm_global_succ"
-
-(** [iter_globals f m] applies function [f] to each of the global variables of
- module [m] in order. Tail recursive. *)
-val iter_globals : (llvalue -> unit) -> llmodule -> unit
-
-(** [fold_left_globals f init m] is [f (... (f init g1) ...) gN] where
- [g1,...,gN] are the global variables of module [m]. Tail recursive. *)
-val fold_left_globals : ('a -> llvalue -> 'a) -> 'a -> llmodule -> 'a
-
-(** [global_end m] returns the last position in the global variable list of the
- module [m]. [global_end] and [global_pred] can be used to iterate over the
- global list in reverse.
- See the method [llvm::Module::global_end]. *)
-external global_end : llmodule -> (llmodule, llvalue) llrev_pos
- = "llvm_global_end"
-
-(** [global_pred gv] returns the global variable list position preceding
- [After gv].
- See the method [llvm::Module::global_iterator::operator--]. *)
-external global_pred : llvalue -> (llmodule, llvalue) llrev_pos
- = "llvm_global_pred"
-
-(** [rev_iter_globals f m] applies function [f] to each of the global variables
- of module [m] in reverse order. Tail recursive. *)
-val rev_iter_globals : (llvalue -> unit) -> llmodule -> unit
-
-(** [fold_right_globals f m init] is [f g1 (... (f gN init) ...)] where
- [g1,...,gN] are the global variables of module [m]. Tail recursive. *)
-val fold_right_globals : (llvalue -> 'a -> 'a) -> llmodule -> 'a -> 'a
-
-(** [is_global_constant gv] returns [true] if the global variabile [gv] is a
- constant. Returns [false] otherwise.
- See the method [llvm::GlobalVariable::isConstant]. *)
-external is_global_constant : llvalue -> bool = "llvm_is_global_constant"
-
-(** [set_global_constant c gv] sets the global variable [gv] to be a constant if
- [c] is [true] and not if [c] is [false].
- See the method [llvm::GlobalVariable::setConstant]. *)
-external set_global_constant : bool -> llvalue -> unit
- = "llvm_set_global_constant"
-
-(** [has_initializer gv] returns [true] if the global variable [gv] has an
- initializer and [false] otherwise.
- See the method [llvm::GlobalVariable::hasInitializer]. *)
-external has_initializer : llvalue -> bool = "llvm_has_initializer"
-
-(** [global_initializer gv] returns the initializer for the global variable
- [gv]. See the method [llvm::GlobalVariable::getInitializer]. *)
-external global_initializer : llvalue -> llvalue = "LLVMGetInitializer"
-
-(** [set_initializer c gv] sets the initializer for the global variable
- [gv] to the constant [c].
- See the method [llvm::GlobalVariable::setInitializer]. *)
-external set_initializer : llvalue -> llvalue -> unit = "llvm_set_initializer"
-
-(** [remove_initializer gv] unsets the initializer for the global variable
- [gv].
- See the method [llvm::GlobalVariable::setInitializer]. *)
-external remove_initializer : llvalue -> unit = "llvm_remove_initializer"
-
-(** [is_thread_local gv] returns [true] if the global variable [gv] is
- thread-local and [false] otherwise.
- See the method [llvm::GlobalVariable::isThreadLocal]. *)
-external is_thread_local : llvalue -> bool = "llvm_is_thread_local"
-
-(** [set_thread_local c gv] sets the global variable [gv] to be thread local if
- [c] is [true] and not otherwise.
- See the method [llvm::GlobalVariable::setThreadLocal]. *)
-external set_thread_local : bool -> llvalue -> unit = "llvm_set_thread_local"
-
-
-(** {7 Operations on functions} *)
-
-(** [declare_function name ty m] returns a new function of type [ty] and
- with name [name] in module [m]. If such a function already exists,
- it is returned. If the type of the existing function differs, then a bitcast
- to [ty] is returned. *)
-external declare_function : string -> lltype -> llmodule -> llvalue
- = "llvm_declare_function"
-
-(** [define_function name ty m] creates a new function with name [name] and
- type [ty] in module [m]. If the named function already exists, it is
- renamed. An entry basic block is created in the function.
- See the constructor of [llvm::GlobalVariable]. *)
-external define_function : string -> lltype -> llmodule -> llvalue
- = "llvm_define_function"
-
-(** [lookup_function name m] returns [Some f] if a function with name
- [name] exists in module [m]. If no such function exists, returns [None].
- See the method [llvm::Module] constructor. *)
-external lookup_function : string -> llmodule -> llvalue option
- = "llvm_lookup_function"
-
-(** [delete_function f] destroys the function [f].
- See the method [llvm::Function::eraseFromParent]. *)
-external delete_function : llvalue -> unit = "llvm_delete_function"
-
-(** [function_begin m] returns the first position in the function list of the
- module [m]. [function_begin] and [function_succ] can be used to iterate over
- the function list in order.
- See the method [llvm::Module::begin]. *)
-external function_begin : llmodule -> (llmodule, llvalue) llpos
- = "llvm_function_begin"
-
-(** [function_succ gv] returns the function list position succeeding
- [Before gv].
- See the method [llvm::Module::iterator::operator++]. *)
-external function_succ : llvalue -> (llmodule, llvalue) llpos
- = "llvm_function_succ"
-
-(** [iter_functions f m] applies function [f] to each of the functions of module
- [m] in order. Tail recursive. *)
-val iter_functions : (llvalue -> unit) -> llmodule -> unit
-
-(** [fold_left_function f init m] is [f (... (f init f1) ...) fN] where
- [f1,...,fN] are the functions of module [m]. Tail recursive. *)
-val fold_left_functions : ('a -> llvalue -> 'a) -> 'a -> llmodule -> 'a
-
-(** [function_end m] returns the last position in the function list of
- the module [m]. [function_end] and [function_pred] can be used to iterate
- over the function list in reverse.
- See the method [llvm::Module::end]. *)
-external function_end : llmodule -> (llmodule, llvalue) llrev_pos
- = "llvm_function_end"
-
-(** [function_pred gv] returns the function list position preceding [After gv].
- See the method [llvm::Module::iterator::operator--]. *)
-external function_pred : llvalue -> (llmodule, llvalue) llrev_pos
- = "llvm_function_pred"
-
-(** [rev_iter_functions f fn] applies function [f] to each of the functions of
- module [m] in reverse order. Tail recursive. *)
-val rev_iter_functions : (llvalue -> unit) -> llmodule -> unit
-
-(** [fold_right_functions f m init] is [f (... (f init fN) ...) f1] where
- [f1,...,fN] are the functions of module [m]. Tail recursive. *)
-val fold_right_functions : (llvalue -> 'a -> 'a) -> llmodule -> 'a -> 'a
-
-(** [is_intrinsic f] returns true if the function [f] is an intrinsic.
- See the method [llvm::Function::isIntrinsic]. *)
-external is_intrinsic : llvalue -> bool = "llvm_is_intrinsic"
-
-(** [function_call_conv f] returns the calling convention of the function [f].
- See the method [llvm::Function::getCallingConv]. *)
-external function_call_conv : llvalue -> int = "llvm_function_call_conv"
-
-(** [set_function_call_conv cc f] sets the calling convention of the function
- [f] to the calling convention numbered [cc].
- See the method [llvm::Function::setCallingConv]. *)
-external set_function_call_conv : int -> llvalue -> unit
- = "llvm_set_function_call_conv"
-
-(** [collector f] returns [Some name] if the function [f] has a garbage
- collection algorithm specified and [None] otherwise.
- See the method [llvm::Function::getCollector]. *)
-external collector : llvalue -> string option = "llvm_collector"
-
-(** [set_collector gc f] sets the collection algorithm for the function [f] to
- [gc]. See the method [llvm::Function::setCollector]. *)
-external set_collector : string option -> llvalue -> unit = "llvm_set_collector"
-
-
-(** {7 Operations on params} *)
-
-(** [params f] returns the parameters of function [f].
- See the method [llvm::Function::getArgumentList]. *)
-external params : llvalue -> llvalue array = "llvm_params"
-
-(** [param f n] returns the [n]th parameter of function [f].
- See the method [llvm::Function::getArgumentList]. *)
-external param : llvalue -> int -> llvalue = "llvm_param"
-
-(** [param_parent p] returns the parent function that owns the parameter.
- See the method [llvm::Argument::getParent]. *)
-external param_parent : llvalue -> llvalue = "LLVMGetParamParent"
-
-(** [param_begin f] returns the first position in the parameter list of the
- function [f]. [param_begin] and [param_succ] can be used to iterate over
- the parameter list in order.
- See the method [llvm::Function::arg_begin]. *)
-external param_begin : llvalue -> (llvalue, llvalue) llpos = "llvm_param_begin"
-
-(** [param_succ bb] returns the parameter list position succeeding
- [Before bb].
- See the method [llvm::Function::arg_iterator::operator++]. *)
-external param_succ : llvalue -> (llvalue, llvalue) llpos = "llvm_param_succ"
-
-(** [iter_params f fn] applies function [f] to each of the parameters
- of function [fn] in order. Tail recursive. *)
-val iter_params : (llvalue -> unit) -> llvalue -> unit
-
-(** [fold_left_params f init fn] is [f (... (f init b1) ...) bN] where
- [b1,...,bN] are the parameters of function [fn]. Tail recursive. *)
-val fold_left_params : ('a -> llvalue -> 'a) -> 'a -> llvalue -> 'a
-
-(** [param_end f] returns the last position in the parameter list of
- the function [f]. [param_end] and [param_pred] can be used to iterate
- over the parameter list in reverse.
- See the method [llvm::Function::arg_end]. *)
-external param_end : llvalue -> (llvalue, llvalue) llrev_pos = "llvm_param_end"
-
-(** [param_pred gv] returns the function list position preceding [After gv].
- See the method [llvm::Function::arg_iterator::operator--]. *)
-external param_pred : llvalue -> (llvalue, llvalue) llrev_pos
- = "llvm_param_pred"
-
-(** [rev_iter_params f fn] applies function [f] to each of the parameters
- of function [fn] in reverse order. Tail recursive. *)
-val rev_iter_params : (llvalue -> unit) -> llvalue -> unit
-
-(** [fold_right_params f fn init] is [f (... (f init bN) ...) b1] where
- [b1,...,bN] are the parameters of function [fn]. Tail recursive. *)
-val fold_right_params : (llvalue -> 'a -> 'a) -> llvalue -> 'a -> 'a
-
-
-(** {7 Operations on basic blocks} *)
-
-(** [basic_blocks fn] returns the basic blocks of the function [f].
- See the method [llvm::Function::getBasicBlockList]. *)
-external basic_blocks : llvalue -> llbasicblock array = "llvm_basic_blocks"
-
-(** [entry_block fn] returns the entry basic block of the function [f].
- See the method [llvm::Function::getEntryBlock]. *)
-external entry_block : llvalue -> llbasicblock = "LLVMGetEntryBasicBlock"
-
-(** [delete_block bb] deletes the basic block [bb].
- See the method [llvm::BasicBlock::eraseFromParent]. *)
-external delete_block : llbasicblock -> unit = "llvm_delete_block"
-
-(** [append_block name f] creates a new basic block named [name] at the end of
- function [f].
- See the constructor of [llvm::BasicBlock]. *)
-external append_block : string -> llvalue -> llbasicblock = "llvm_append_block"
-
-(** [insert_block name bb] creates a new basic block named [name] before the
- basic block [bb].
- See the constructor of [llvm::BasicBlock]. *)
-external insert_block : string -> llbasicblock -> llbasicblock
- = "llvm_insert_block"
-
-(** [block_parent bb] returns the parent function that owns the basic block.
- See the method [llvm::BasicBlock::getParent]. *)
-external block_parent : llbasicblock -> llvalue = "LLVMGetBasicBlockParent"
-
-(** [block_begin f] returns the first position in the basic block list of the
- function [f]. [block_begin] and [block_succ] can be used to iterate over
- the basic block list in order.
- See the method [llvm::Function::begin]. *)
-external block_begin : llvalue -> (llvalue, llbasicblock) llpos
- = "llvm_block_begin"
-
-(** [block_succ bb] returns the basic block list position succeeding
- [Before bb].
- See the method [llvm::Function::iterator::operator++]. *)
-external block_succ : llbasicblock -> (llvalue, llbasicblock) llpos
- = "llvm_block_succ"
-
-(** [iter_blocks f fn] applies function [f] to each of the basic blocks
- of function [fn] in order. Tail recursive. *)
-val iter_blocks : (llbasicblock -> unit) -> llvalue -> unit
-
-(** [fold_left_blocks f init fn] is [f (... (f init b1) ...) bN] where
- [b1,...,bN] are the basic blocks of function [fn]. Tail recursive. *)
-val fold_left_blocks : ('a -> llbasicblock -> 'a) -> 'a -> llvalue -> 'a
-
-(** [block_end f] returns the last position in the basic block list of
- the function [f]. [block_end] and [block_pred] can be used to iterate
- over the basic block list in reverse.
- See the method [llvm::Function::end]. *)
-external block_end : llvalue -> (llvalue, llbasicblock) llrev_pos
- = "llvm_block_end"
-
-(** [block_pred gv] returns the function list position preceding [After gv].
- See the method [llvm::Function::iterator::operator--]. *)
-external block_pred : llbasicblock -> (llvalue, llbasicblock) llrev_pos
- = "llvm_block_pred"
-
-(** [rev_iter_blocks f fn] applies function [f] to each of the basic blocks
- of function [fn] in reverse order. Tail recursive. *)
-val rev_iter_blocks : (llbasicblock -> unit) -> llvalue -> unit
-
-(** [fold_right_blocks f fn init] is [f (... (f init bN) ...) b1] where
- [b1,...,bN] are the basic blocks of function [fn]. Tail recursive. *)
-val fold_right_blocks : (llbasicblock -> 'a -> 'a) -> llvalue -> 'a -> 'a
-
-(** [value_of_block bb] losslessly casts [bb] to an [llvalue]. *)
-external value_of_block : llbasicblock -> llvalue = "LLVMBasicBlockAsValue"
-
-(** [value_is_block v] returns [true] if the value [v] is a basic block and
- [false] otherwise.
- Similar to [llvm::isa<BasicBlock>]. *)
-external value_is_block : llvalue -> bool = "llvm_value_is_block"
-
-(** [block_of_value v] losslessly casts [v] to an [llbasicblock]. *)
-external block_of_value : llvalue -> llbasicblock = "LLVMValueAsBasicBlock"
-
-
-(** {7 Operations on instructions} *)
-
-(** [instr_parent i] is the enclosing basic block of the instruction [i].
- See the method [llvm::Instruction::getParent]. *)
-external instr_parent : llvalue -> llbasicblock = "LLVMGetInstructionParent"
-
-(** [instr_begin bb] returns the first position in the instruction list of the
- basic block [bb]. [instr_begin] and [instr_succ] can be used to iterate over
- the instruction list in order.
- See the method [llvm::BasicBlock::begin]. *)
-external instr_begin : llbasicblock -> (llbasicblock, llvalue) llpos
- = "llvm_instr_begin"
-
-(** [instr_succ i] returns the instruction list position succeeding [Before i].
- See the method [llvm::BasicBlock::iterator::operator++]. *)
-external instr_succ : llvalue -> (llbasicblock, llvalue) llpos
- = "llvm_instr_succ"
-
-(** [iter_instrs f bb] applies function [f] to each of the instructions of basic
- block [bb] in order. Tail recursive. *)
-val iter_instrs: (llvalue -> unit) -> llbasicblock -> unit
-
-(** [fold_left_instrs f init bb] is [f (... (f init g1) ...) gN] where
- [g1,...,gN] are the instructions of basic block [bb]. Tail recursive. *)
-val fold_left_instrs: ('a -> llvalue -> 'a) -> 'a -> llbasicblock -> 'a
-
-(** [instr_end bb] returns the last position in the instruction list of the
- basic block [bb]. [instr_end] and [instr_pred] can be used to iterate over
- the instruction list in reverse.
- See the method [llvm::BasicBlock::end]. *)
-external instr_end : llbasicblock -> (llbasicblock, llvalue) llrev_pos
- = "llvm_instr_end"
-
-(** [instr_pred i] returns the instruction list position preceding [After i].
- See the method [llvm::BasicBlock::iterator::operator--]. *)
-external instr_pred : llvalue -> (llbasicblock, llvalue) llrev_pos
- = "llvm_instr_pred"
-
-(** [fold_right_instrs f bb init] is [f (... (f init fN) ...) f1] where
- [f1,...,fN] are the instructions of basic block [bb]. Tail recursive. *)
-val fold_right_instrs: (llvalue -> 'a -> 'a) -> llbasicblock -> 'a -> 'a
-
-
-(** {7 Operations on call sites} *)
-
-(** [instruction_call_conv ci] is the calling convention for the call or invoke
- instruction [ci], which may be one of the values from the module
- {!CallConv}. See the method [llvm::CallInst::getCallingConv] and
- [llvm::InvokeInst::getCallingConv]. *)
-external instruction_call_conv: llvalue -> int
- = "llvm_instruction_call_conv"
-
-(** [set_instruction_call_conv cc ci] sets the calling convention for the call
- or invoke instruction [ci] to the integer [cc], which can be one of the
- values from the module {!CallConv}.
- See the method [llvm::CallInst::setCallingConv]
- and [llvm::InvokeInst::setCallingConv]. *)
-external set_instruction_call_conv: int -> llvalue -> unit
- = "llvm_set_instruction_call_conv"
-
-
-(** {7 Operations on phi nodes} *)
-
-(** [add_incoming (v, bb) pn] adds the value [v] to the phi node [pn] for use
- with branches from [bb]. See the method [llvm::PHINode::addIncoming]. *)
-external add_incoming : (llvalue * llbasicblock) -> llvalue -> unit
- = "llvm_add_incoming"
-
-(** [incoming pn] returns the list of value-block pairs for phi node [pn].
- See the method [llvm::PHINode::getIncomingValue]. *)
-external incoming : llvalue -> (llvalue * llbasicblock) list = "llvm_incoming"
-
-
-
-(** {6 Instruction builders} *)
-
-(** [builder ()] creates an instruction builder with no position. It is invalid
- to use this builder until its position is set with {!position_before} or
- {!position_at_end}. See the constructor for [llvm::LLVMBuilder]. *)
-external builder : unit -> llbuilder = "llvm_builder"
-
-(** [builder_at ip] creates an instruction builder positioned at [ip].
- See the constructor for [llvm::LLVMBuilder]. *)
-val builder_at : (llbasicblock, llvalue) llpos -> llbuilder
-
-(** [builder_before ins] creates an instruction builder positioned before the
- instruction [isn]. See the constructor for [llvm::LLVMBuilder]. *)
-val builder_before : llvalue -> llbuilder
-
-(** [builder_at_end bb] creates an instruction builder positioned at the end of
- the basic block [bb]. See the constructor for [llvm::LLVMBuilder]. *)
-val builder_at_end : llbasicblock -> llbuilder
-
-(** [position_builder ip bb] moves the instruction builder [bb] to the position
- [ip].
- See the constructor for [llvm::LLVMBuilder]. *)
-external position_builder : (llbasicblock, llvalue) llpos -> llbuilder -> unit
- = "llvm_position_builder"
-
-(** [position_before ins b] moves the instruction builder [b] to before the
- instruction [isn]. See the method [llvm::LLVMBuilder::SetInsertPoint]. *)
-val position_before : llvalue -> llbuilder -> unit
-
-(** [position_at_end bb b] moves the instruction builder [b] to the end of the
- basic block [bb]. See the method [llvm::LLVMBuilder::SetInsertPoint]. *)
-val position_at_end : llbasicblock -> llbuilder -> unit
-
-(** [insertion_block b] returns the basic block that the builder [b] is
- positioned to insert into. Raises [Not_Found] if the instruction builder is
- uninitialized.
- See the method [llvm::LLVMBuilder::GetInsertBlock]. *)
-external insertion_block : llbuilder -> llbasicblock = "llvm_insertion_block"
-
-
-(** {7 Terminators} *)
-
-(** [build_ret_void b] creates a
- [ret void]
- instruction at the position specified by the instruction builder [b].
- See the method [llvm::LLVMBuilder::CreateRetVoid]. *)
-external build_ret_void : llbuilder -> llvalue = "llvm_build_ret_void"
-
-(** [build_ret v b] creates a
- [ret %v]
- instruction at the position specified by the instruction builder [b].
- See the method [llvm::LLVMBuilder::CreateRet]. *)
-external build_ret : llvalue -> llbuilder -> llvalue = "llvm_build_ret"
-
-(** [build_br bb b] creates a
- [b %bb]
- instruction at the position specified by the instruction builder [b].
- See the method [llvm::LLVMBuilder::CreateBr]. *)
-external build_br : llbasicblock -> llbuilder -> llvalue = "llvm_build_br"
-
-(** [build_cond_br cond tbb fbb b] creates a
- [b %cond, %tbb, %fbb]
- instruction at the position specified by the instruction builder [b].
- See the method [llvm::LLVMBuilder::CreateCondBr]. *)
-external build_cond_br : llvalue -> llbasicblock -> llbasicblock -> llbuilder ->
- llvalue = "llvm_build_cond_br"
-
-(** [build_switch case elsebb b] creates an empty
- [switch %case, %elsebb]
- instruction at the position specified by the instruction builder [b].
- See the method [llvm::LLVMBuilder::CreateSwitch]. *)
-external build_switch : llvalue -> llbasicblock -> int -> llbuilder -> llvalue
- = "llvm_build_switch"
-
-(** [build_invoke fn args tobb unwindbb name b] creates an
- [%name = invoke %fn(args) to %tobb unwind %unwindbb]
- instruction at the position specified by the instruction builder [b].
- See the method [llvm::LLVMBuilder::CreateInvoke]. *)
-external build_invoke : llvalue -> llvalue array -> llbasicblock ->
- llbasicblock -> string -> llbuilder -> llvalue
- = "llvm_build_invoke_bc" "llvm_build_invoke_nat"
-
-(** [build_unwind b] creates an
- [unwind]
- instruction at the position specified by the instruction builder [b].
- See the method [llvm::LLVMBuilder::CreateUnwind]. *)
-external build_unwind : llbuilder -> llvalue = "llvm_build_unwind"
-
-(** [build_unreachable b] creates an
- [unreachable]
- instruction at the position specified by the instruction builder [b].
- See the method [llvm::LLVMBuilder::CreateUnwind]. *)
-external build_unreachable : llbuilder -> llvalue = "llvm_build_unreachable"
-
-
-(** {7 Arithmetic} *)
-
-(** [build_add x y name b] creates a
- [%name = add %x, %y]
- instruction at the position specified by the instruction builder [b].
- See the method [llvm::LLVMBuilder::CreateAdd]. *)
-external build_add : llvalue -> llvalue -> string -> llbuilder -> llvalue
- = "llvm_build_add"
-
-(** [build_sub x y name b] creates a
- [%name = sub %x, %y]
- instruction at the position specified by the instruction builder [b].
- See the method [llvm::LLVMBuilder::CreateSub]. *)
-external build_sub : llvalue -> llvalue -> string -> llbuilder -> llvalue
- = "llvm_build_sub"
-
-(** [build_mul x y name b] creates a
- [%name = mul %x, %y]
- instruction at the position specified by the instruction builder [b].
- See the method [llvm::LLVMBuilder::CreateMul]. *)
-external build_mul : llvalue -> llvalue -> string -> llbuilder -> llvalue
- = "llvm_build_mul"
-
-(** [build_udiv x y name b] creates a
- [%name = udiv %x, %y]
- instruction at the position specified by the instruction builder [b].
- See the method [llvm::LLVMBuilder::CreateUDiv]. *)
-external build_udiv : llvalue -> llvalue -> string -> llbuilder -> llvalue
- = "llvm_build_udiv"
-
-(** [build_sdiv x y name b] creates a
- [%name = sdiv %x, %y]
- instruction at the position specified by the instruction builder [b].
- See the method [llvm::LLVMBuilder::CreateSDiv]. *)
-external build_sdiv : llvalue -> llvalue -> string -> llbuilder -> llvalue
- = "llvm_build_sdiv"
-
-(** [build_fdiv x y name b] creates a
- [%name = fdiv %x, %y]
- instruction at the position specified by the instruction builder [b].
- See the method [llvm::LLVMBuilder::CreateFDiv]. *)
-external build_fdiv : llvalue -> llvalue -> string -> llbuilder -> llvalue
- = "llvm_build_fdiv"
-
-(** [build_urem x y name b] creates a
- [%name = urem %x, %y]
- instruction at the position specified by the instruction builder [b].
- See the method [llvm::LLVMBuilder::CreateURem]. *)
-external build_urem : llvalue -> llvalue -> string -> llbuilder -> llvalue
- = "llvm_build_urem"
-
-(** [build_SRem x y name b] creates a
- [%name = srem %x, %y]
- instruction at the position specified by the instruction builder [b].
- See the method [llvm::LLVMBuilder::CreateSRem]. *)
-external build_srem : llvalue -> llvalue -> string -> llbuilder -> llvalue
- = "llvm_build_srem"
-
-(** [build_frem x y name b] creates a
- [%name = frem %x, %y]
- instruction at the position specified by the instruction builder [b].
- See the method [llvm::LLVMBuilder::CreateFRem]. *)
-external build_frem : llvalue -> llvalue -> string -> llbuilder -> llvalue
- = "llvm_build_frem"
-
-(** [build_shl x y name b] creates a
- [%name = shl %x, %y]
- instruction at the position specified by the instruction builder [b].
- See the method [llvm::LLVMBuilder::CreateShl]. *)
-external build_shl : llvalue -> llvalue -> string -> llbuilder -> llvalue
- = "llvm_build_shl"
-
-(** [build_lshr x y name b] creates a
- [%name = lshr %x, %y]
- instruction at the position specified by the instruction builder [b].
- See the method [llvm::LLVMBuilder::CreateLShr]. *)
-external build_lshr : llvalue -> llvalue -> string -> llbuilder -> llvalue
- = "llvm_build_lshr"
-
-(** [build_ashr x y name b] creates a
- [%name = ashr %x, %y]
- instruction at the position specified by the instruction builder [b].
- See the method [llvm::LLVMBuilder::CreateAShr]. *)
-external build_ashr : llvalue -> llvalue -> string -> llbuilder -> llvalue
- = "llvm_build_ashr"
-
-(** [build_and x y name b] creates a
- [%name = and %x, %y]
- instruction at the position specified by the instruction builder [b].
- See the method [llvm::LLVMBuilder::CreateAnd]. *)
-external build_and : llvalue -> llvalue -> string -> llbuilder -> llvalue
- = "llvm_build_and"
-
-(** [build_or x y name b] creates a
- [%name = or %x, %y]
- instruction at the position specified by the instruction builder [b].
- See the method [llvm::LLVMBuilder::CreateOr]. *)
-external build_or : llvalue -> llvalue -> string -> llbuilder -> llvalue
- = "llvm_build_or"
-
-(** [build_xor x y name b] creates a
- [%name = xor %x, %y]
- instruction at the position specified by the instruction builder [b].
- See the method [llvm::LLVMBuilder::CreateXor]. *)
-external build_xor : llvalue -> llvalue -> string -> llbuilder -> llvalue
- = "llvm_build_xor"
-
-(** [build_neg x name b] creates a
- [%name = sub 0, %x]
- instruction at the position specified by the instruction builder [b].
- [-0.0] is used for floating point types to compute the correct sign.
- See the method [llvm::LLVMBuilder::CreateNeg]. *)
-external build_neg : llvalue -> string -> llbuilder -> llvalue
- = "llvm_build_neg"
-
-(** [build_xor x name b] creates a
- [%name = xor %x, -1]
- instruction at the position specified by the instruction builder [b].
- [-1] is the correct "all ones" value for the type of [x].
- See the method [llvm::LLVMBuilder::CreateXor]. *)
-external build_not : llvalue -> string -> llbuilder -> llvalue
- = "llvm_build_not"
-
-
-(** {7 Memory} *)
-
-(** [build_malloc ty name b] creates a
- [%name = malloc %ty]
- instruction at the position specified by the instruction builder [b].
- See the method [llvm::LLVMBuilder::CreateAlloca]. *)
-external build_malloc : lltype -> string -> llbuilder -> llvalue
- = "llvm_build_malloc"
-
-(** [build_array_malloc ty n name b] creates a
- [%name = malloc %ty, %n]
- instruction at the position specified by the instruction builder [b].
- See the method [llvm::LLVMBuilder::CreateMalloc]. *)
-external build_array_malloc : lltype -> llvalue -> string -> llbuilder ->
- llvalue = "llvm_build_array_malloc"
-
-(** [build_alloca ty name b] creates a
- [%name = alloca %ty]
- instruction at the position specified by the instruction builder [b].
- See the method [llvm::LLVMBuilder::CreateAlloca]. *)
-external build_alloca : lltype -> string -> llbuilder -> llvalue
- = "llvm_build_alloca"
-
-(** [build_array_alloca ty n name b] creates a
- [%name = alloca %ty, %n]
- instruction at the position specified by the instruction builder [b].
- See the method [llvm::LLVMBuilder::CreateAlloca]. *)
-external build_array_alloca : lltype -> llvalue -> string -> llbuilder ->
- llvalue = "llvm_build_array_alloca"
-
-(** [build_free v b] creates a
- [free %v]
- instruction at the position specified by the instruction builder [b].
- See the method [llvm::LLVMBuilder::CreateFree]. *)
-external build_free : llvalue -> llbuilder -> llvalue = "llvm_build_free"
-
-(** [build_load v name b] creates a
- [%name = load %v]
- instruction at the position specified by the instruction builder [b].
- See the method [llvm::LLVMBuilder::CreateLoad]. *)
-external build_load : llvalue -> string -> llbuilder -> llvalue
- = "llvm_build_load"
-
-(** [build_store v p b] creates a
- [store %v, %p]
- instruction at the position specified by the instruction builder [b].
- See the method [llvm::LLVMBuilder::CreateStore]. *)
-external build_store : llvalue -> llvalue -> llbuilder -> llvalue
- = "llvm_build_store"
-
-(** [build_gep p indices name b] creates a
- [%name = gep %p, indices...]
- instruction at the position specified by the instruction builder [b].
- See the method [llvm::LLVMBuilder::CreateGetElementPtr]. *)
-external build_gep : llvalue -> llvalue array -> string -> llbuilder -> llvalue
- = "llvm_build_gep"
-
-
-(** {7 Casts} *)
-
-(** [build_trunc v ty name b] creates a
- [%name = trunc %p to %ty]
- instruction at the position specified by the instruction builder [b].
- See the method [llvm::LLVMBuilder::CreateTrunc]. *)
-external build_trunc : llvalue -> lltype -> string -> llbuilder -> llvalue
- = "llvm_build_trunc"
-
-(** [build_zext v ty name b] creates a
- [%name = zext %p to %ty]
- instruction at the position specified by the instruction builder [b].
- See the method [llvm::LLVMBuilder::CreateZExt]. *)
-external build_zext : llvalue -> lltype -> string -> llbuilder -> llvalue
- = "llvm_build_zext"
-
-(** [build_sext v ty name b] creates a
- [%name = sext %p to %ty]
- instruction at the position specified by the instruction builder [b].
- See the method [llvm::LLVMBuilder::CreateSExt]. *)
-external build_sext : llvalue -> lltype -> string -> llbuilder -> llvalue
- = "llvm_build_sext"
-
-(** [build_fptoui v ty name b] creates a
- [%name = fptoui %p to %ty]
- instruction at the position specified by the instruction builder [b].
- See the method [llvm::LLVMBuilder::CreateFPToUI]. *)
-external build_fptoui : llvalue -> lltype -> string -> llbuilder -> llvalue
- = "llvm_build_fptoui"
-
-(** [build_fptosi v ty name b] creates a
- [%name = fptosi %p to %ty]
- instruction at the position specified by the instruction builder [b].
- See the method [llvm::LLVMBuilder::CreateFPToSI]. *)
-external build_fptosi : llvalue -> lltype -> string -> llbuilder -> llvalue
- = "llvm_build_fptosi"
-
-(** [build_uitofp v ty name b] creates a
- [%name = uitofp %p to %ty]
- instruction at the position specified by the instruction builder [b].
- See the method [llvm::LLVMBuilder::CreateUIToFP]. *)
-external build_uitofp : llvalue -> lltype -> string -> llbuilder -> llvalue
- = "llvm_build_uitofp"
-
-(** [build_sitofp v ty name b] creates a
- [%name = sitofp %p to %ty]
- instruction at the position specified by the instruction builder [b].
- See the method [llvm::LLVMBuilder::CreateSIToFP]. *)
-external build_sitofp : llvalue -> lltype -> string -> llbuilder -> llvalue
- = "llvm_build_sitofp"
-
-(** [build_fptrunc v ty name b] creates a
- [%name = fptrunc %p to %ty]
- instruction at the position specified by the instruction builder [b].
- See the method [llvm::LLVMBuilder::CreateFPTrunc]. *)
-external build_fptrunc : llvalue -> lltype -> string -> llbuilder -> llvalue
- = "llvm_build_fptrunc"
-
-(** [build_fpext v ty name b] creates a
- [%name = fpext %p to %ty]
- instruction at the position specified by the instruction builder [b].
- See the method [llvm::LLVMBuilder::CreateFPExt]. *)
-external build_fpext : llvalue -> lltype -> string -> llbuilder -> llvalue
- = "llvm_build_fpext"
-
-(** [build_ptrtoint v ty name b] creates a
- [%name = prtotint %p to %ty]
- instruction at the position specified by the instruction builder [b].
- See the method [llvm::LLVMBuilder::CreatePtrToInt]. *)
-external build_ptrtoint : llvalue -> lltype -> string -> llbuilder -> llvalue
- = "llvm_build_prttoint"
-
-(** [build_inttoptr v ty name b] creates a
- [%name = inttoptr %p to %ty]
- instruction at the position specified by the instruction builder [b].
- See the method [llvm::LLVMBuilder::CreateIntToPtr]. *)
-external build_inttoptr : llvalue -> lltype -> string -> llbuilder -> llvalue
- = "llvm_build_inttoptr"
-
-(** [build_bitcast v ty name b] creates a
- [%name = bitcast %p to %ty]
- instruction at the position specified by the instruction builder [b].
- See the method [llvm::LLVMBuilder::CreateBitcast]. *)
-external build_bitcast : llvalue -> lltype -> string -> llbuilder -> llvalue
- = "llvm_build_bitcast"
-
-
-(** {7 Comparisons} *)
-
-(** [build_icmp pred x y name b] creates a
- [%name = icmp %pred %x, %y]
- instruction at the position specified by the instruction builder [b].
- See the method [llvm::LLVMBuilder::CreateICmp]. *)
-external build_icmp : Icmp.t -> llvalue -> llvalue -> string ->
- llbuilder -> llvalue = "llvm_build_icmp"
-
-(** [build_fcmp pred x y name b] creates a
- [%name = fcmp %pred %x, %y]
- instruction at the position specified by the instruction builder [b].
- See the method [llvm::LLVMBuilder::CreateFCmp]. *)
-external build_fcmp : Fcmp.t -> llvalue -> llvalue -> string ->
- llbuilder -> llvalue = "llvm_build_fcmp"
-
-
-(** {7 Miscellaneous instructions} *)
-
-(** [build_phi incoming name b] creates a
- [%name = phi %incoming]
- instruction at the position specified by the instruction builder [b].
- [incoming] is a list of [(llvalue, llbasicblock)] tuples.
- See the method [llvm::LLVMBuilder::CreatePHI]. *)
-external build_phi : (llvalue * llbasicblock) list -> string -> llbuilder ->
- llvalue = "llvm_build_phi"
-
-(** [build_call fn args name b] creates a
- [%name = call %fn(args...)]
- instruction at the position specified by the instruction builder [b].
- See the method [llvm::LLVMBuilder::CreateCall]. *)
-external build_call : llvalue -> llvalue array -> string -> llbuilder -> llvalue
- = "llvm_build_call"
-
-(** [build_select cond thenv elsev name b] creates a
- [%name = select %cond, %thenv, %elsev]
- instruction at the position specified by the instruction builder [b].
- See the method [llvm::LLVMBuilder::CreateSelect]. *)
-external build_select : llvalue -> llvalue -> llvalue -> string -> llbuilder ->
- llvalue = "llvm_build_select"
-
-(** [build_va_arg valist argty name b] creates a
- [%name = va_arg %valist, %argty]
- instruction at the position specified by the instruction builder [b].
- See the method [llvm::LLVMBuilder::CreateVAArg]. *)
-external build_va_arg : llvalue -> lltype -> string -> llbuilder -> llvalue
- = "llvm_build_va_arg"
-
-(** [build_extractelement vec i name b] creates a
- [%name = extractelement %vec, %i]
- instruction at the position specified by the instruction builder [b].
- See the method [llvm::LLVMBuilder::CreateExtractElement]. *)
-external build_extractelement : llvalue -> llvalue -> string -> llbuilder ->
- llvalue = "llvm_build_extractelement"
-
-(** [build_insertelement vec elt i name b] creates a
- [%name = insertelement %vec, %elt, %i]
- instruction at the position specified by the instruction builder [b].
- See the method [llvm::LLVMBuilder::CreateInsertElement]. *)
-external build_insertelement : llvalue -> llvalue -> llvalue -> string ->
- llbuilder -> llvalue = "llvm_build_insertelement"
-
-(** [build_shufflevector veca vecb mask name b] creates a
- [%name = shufflevector %veca, %vecb, %mask]
- instruction at the position specified by the instruction builder [b].
- See the method [llvm::LLVMBuilder::CreateShuffleVector]. *)
-external build_shufflevector : llvalue -> llvalue -> llvalue -> string ->
- llbuilder -> llvalue = "llvm_build_shufflevector"
-
-
-(** {6 Module providers} *)
-
-module ModuleProvider : sig
- (** [create_module_provider m] encapsulates [m] in a module provider and takes
- ownership of the module. See the constructor
- [llvm::ExistingModuleProvider::ExistingModuleProvider]. *)
- external create : llmodule -> llmoduleprovider
- = "LLVMCreateModuleProviderForExistingModule"
-
- (** [dispose_module_provider mp] destroys the module provider [mp] as well as
- the contained module. *)
- external dispose : llmoduleprovider -> unit = "llvm_dispose_module_provider"
-end
-
-
-(** {6 Memory buffers} *)
-
-module MemoryBuffer : sig
- (** [of_file p] is the memory buffer containing the contents of the file at
- path [p]. If the file could not be read, then [IoError msg] is
- raised. *)
- external of_file : string -> llmemorybuffer = "llvm_memorybuffer_of_file"
-
- (** [stdin ()] is the memory buffer containing the contents of standard input.
- If standard input is empty, then [IoError msg] is raised. *)
- external of_stdin : unit -> llmemorybuffer = "llvm_memorybuffer_of_stdin"
-
- (** Disposes of a memory buffer. *)
- external dispose : llmemorybuffer -> unit = "llvm_memorybuffer_dispose"
-end
-
-
-(** {6 Pass Managers} *)
-
-module PassManager : sig
- (** *)
- type 'a t
- type any = [ `Module | `Function ]
-
- (** [PassManager.create ()] constructs a new whole-module pass pipeline. This
- type of pipeline is suitable for link-time optimization and whole-module
- transformations.
- See the constructor of [llvm::PassManager]. *)
- external create : unit -> [ `Module ] t = "llvm_passmanager_create"
-
- (** [PassManager.create_function mp] constructs a new function-by-function
- pass pipeline over the module provider [mp]. It does not take ownership of
- [mp]. This type of pipeline is suitable for code generation and JIT
- compilation tasks.
- See the constructor of [llvm::FunctionPassManager]. *)
- external create_function : llmoduleprovider -> [ `Function ] t
- = "LLVMCreateFunctionPassManager"
-
- (** [run_module m pm] initializes, executes on the module [m], and finalizes
- all of the passes scheduled in the pass manager [pm]. Returns [true] if
- any of the passes modified the module, [false] otherwise.
- See the [llvm::PassManager::run] method. *)
- external run_module : llmodule -> [ `Module ] t -> bool
- = "llvm_passmanager_run_module"
-
- (** [initialize fpm] initializes all of the function passes scheduled in the
- function pass manager [fpm]. Returns [true] if any of the passes modified
- the module, [false] otherwise.
- See the [llvm::FunctionPassManager::doInitialization] method. *)
- external initialize : [ `Function ] t -> bool = "llvm_passmanager_initialize"
-
- (** [run_function f fpm] executes all of the function passes scheduled in the
- function pass manager [fpm] over the function [f]. Returns [true] if any
- of the passes modified [f], [false] otherwise.
- See the [llvm::FunctionPassManager::run] method. *)
- external run_function : llvalue -> [ `Function ] t -> bool
- = "llvm_passmanager_run_function"
-
- (** [finalize fpm] finalizes all of the function passes scheduled in in the
- function pass manager [fpm]. Returns [true] if any of the passes
- modified the module, [false] otherwise.
- See the [llvm::FunctionPassManager::doFinalization] method. *)
- external finalize : [ `Function ] t -> bool = "llvm_passmanager_finalize"
-
- (** Frees the memory of a pass pipeline. For function pipelines, does not free
- the module provider.
- See the destructor of [llvm::BasePassManager]. *)
- external dispose : [< any ] t -> unit = "llvm_passmanager_dispose"
-end
diff --git a/release_23/bindings/ocaml/llvm/llvm_ocaml.c b/release_23/bindings/ocaml/llvm/llvm_ocaml.c
deleted file mode 100644
index 9aa376282f6a..000000000000
--- a/release_23/bindings/ocaml/llvm/llvm_ocaml.c
+++ /dev/null
@@ -1,1270 +0,0 @@
-/*===-- llvm_ocaml.c - LLVM Ocaml Glue --------------------------*- C++ -*-===*\
-|* *|
-|* The LLVM Compiler Infrastructure *|
-|* *|
-|* This file is distributed under the University of Illinois Open Source *|
-|* License. See LICENSE.TXT for details. *|
-|* *|
-|*===----------------------------------------------------------------------===*|
-|* *|
-|* This file glues LLVM's ocaml interface to its C interface. These functions *|
-|* are by and large transparent wrappers to the corresponding C functions. *|
-|* *|
-|* Note that these functions intentionally take liberties with the CAMLparamX *|
-|* macros, since most of the parameters are not GC heap objects. *|
-|* *|
-\*===----------------------------------------------------------------------===*/
-
-#include "llvm-c/Core.h"
-#include "caml/alloc.h"
-#include "caml/custom.h"
-#include "caml/memory.h"
-#include "caml/fail.h"
-#include "caml/callback.h"
-#include "llvm/Config/config.h"
-#include <assert.h>
-#include <stdlib.h>
-
-
-/* Can't use the recommended caml_named_value mechanism for backwards
- compatibility reasons. This is largely equivalent. */
-static value llvm_ioerror_exn;
-
-CAMLprim value llvm_register_core_exns(value IoError) {
- llvm_ioerror_exn = Field(IoError, 0);
- register_global_root(&llvm_ioerror_exn);
- return Val_unit;
-}
-
-static void llvm_raise(value Prototype, char *Message) {
- CAMLparam1(Prototype);
- CAMLlocal1(CamlMessage);
-
- CamlMessage = copy_string(Message);
- LLVMDisposeMessage(Message);
-
- raise_with_arg(Prototype, CamlMessage);
- abort(); /* NOTREACHED */
-#ifdef CAMLnoreturn
- CAMLnoreturn; /* Silences warnings, but is missing in some versions. */
-#endif
-}
-
-static value alloc_variant(int tag, void *Value) {
- value Iter = alloc_small(1, tag);
- Field(Iter, 0) = Val_op(Value);
- return Iter;
-}
-
-/* Macro to convert the C first/next/last/prev idiom to the Ocaml llpos/
- llrev_pos idiom. */
-#define DEFINE_ITERATORS(camlname, cname, pty, cty, pfun) \
- /* llmodule -> ('a, 'b) llpos */ \
- CAMLprim value llvm_##camlname##_begin(pty Mom) { \
- cty First = LLVMGetFirst##cname(Mom); \
- if (First) \
- return alloc_variant(1, First); \
- return alloc_variant(0, Mom); \
- } \
- \
- /* llvalue -> ('a, 'b) llpos */ \
- CAMLprim value llvm_##camlname##_succ(cty Kid) { \
- cty Next = LLVMGetNext##cname(Kid); \
- if (Next) \
- return alloc_variant(1, Next); \
- return alloc_variant(0, pfun(Kid)); \
- } \
- \
- /* llmodule -> ('a, 'b) llrev_pos */ \
- CAMLprim value llvm_##camlname##_end(pty Mom) { \
- cty Last = LLVMGetLast##cname(Mom); \
- if (Last) \
- return alloc_variant(1, Last); \
- return alloc_variant(0, Mom); \
- } \
- \
- /* llvalue -> ('a, 'b) llrev_pos */ \
- CAMLprim value llvm_##camlname##_pred(cty Kid) { \
- cty Prev = LLVMGetPrevious##cname(Kid); \
- if (Prev) \
- return alloc_variant(1, Prev); \
- return alloc_variant(0, pfun(Kid)); \
- }
-
-
-/*===-- Modules -----------------------------------------------------------===*/
-
-/* string -> llmodule */
-CAMLprim LLVMModuleRef llvm_create_module(value ModuleID) {
- return LLVMModuleCreateWithName(String_val(ModuleID));
-}
-
-/* llmodule -> unit */
-CAMLprim value llvm_dispose_module(LLVMModuleRef M) {
- LLVMDisposeModule(M);
- return Val_unit;
-}
-
-/* llmodule -> string */
-CAMLprim value llvm_target_triple(LLVMModuleRef M) {
- return copy_string(LLVMGetTarget(M));
-}
-
-/* string -> llmodule -> unit */
-CAMLprim value llvm_set_target_triple(value Trip, LLVMModuleRef M) {
- LLVMSetTarget(M, String_val(Trip));
- return Val_unit;
-}
-
-/* llmodule -> string */
-CAMLprim value llvm_data_layout(LLVMModuleRef M) {
- return copy_string(LLVMGetDataLayout(M));
-}
-
-/* string -> llmodule -> unit */
-CAMLprim value llvm_set_data_layout(value Layout, LLVMModuleRef M) {
- LLVMSetDataLayout(M, String_val(Layout));
- return Val_unit;
-}
-
-/* string -> lltype -> llmodule -> bool */
-CAMLprim value llvm_add_type_name(value Name, LLVMTypeRef Ty, LLVMModuleRef M) {
- int res = LLVMAddTypeName(M, String_val(Name), Ty);
- return Val_bool(res == 0);
-}
-
-/* string -> llmodule -> unit */
-CAMLprim value llvm_delete_type_name(value Name, LLVMModuleRef M) {
- LLVMDeleteTypeName(M, String_val(Name));
- return Val_unit;
-}
-
-/* llmodule -> unit */
-CAMLprim value llvm_dump_module(LLVMModuleRef M) {
- LLVMDumpModule(M);
- return Val_unit;
-}
-
-
-/*===-- Types -------------------------------------------------------------===*/
-
-/* lltype -> TypeKind.t */
-CAMLprim value llvm_classify_type(LLVMTypeRef Ty) {
- return Val_int(LLVMGetTypeKind(Ty));
-}
-
-/*--... Operations on integer types ........................................--*/
-
-/* unit -> lltype */
-CAMLprim LLVMTypeRef llvm_i1_type (value Unit) { return LLVMInt1Type(); }
-CAMLprim LLVMTypeRef llvm_i8_type (value Unit) { return LLVMInt8Type(); }
-CAMLprim LLVMTypeRef llvm_i16_type(value Unit) { return LLVMInt16Type(); }
-CAMLprim LLVMTypeRef llvm_i32_type(value Unit) { return LLVMInt32Type(); }
-CAMLprim LLVMTypeRef llvm_i64_type(value Unit) { return LLVMInt64Type(); }
-
-/* int -> lltype */
-CAMLprim LLVMTypeRef llvm_integer_type(value Width) {
- return LLVMIntType(Int_val(Width));
-}
-
-/* lltype -> int */
-CAMLprim value llvm_integer_bitwidth(LLVMTypeRef IntegerTy) {
- return Val_int(LLVMGetIntTypeWidth(IntegerTy));
-}
-
-/*--... Operations on real types ...........................................--*/
-
-/* unit -> lltype */
-CAMLprim LLVMTypeRef llvm_float_type(value Unit) {
- return LLVMFloatType();
-}
-
-/* unit -> lltype */
-CAMLprim LLVMTypeRef llvm_double_type(value Unit) {
- return LLVMDoubleType();
-}
-
-/* unit -> lltype */
-CAMLprim LLVMTypeRef llvm_x86fp80_type(value Unit) {
- return LLVMX86FP80Type();
-}
-
-/* unit -> lltype */
-CAMLprim LLVMTypeRef llvm_fp128_type(value Unit) {
- return LLVMFP128Type();
-}
-
-/* unit -> lltype */
-CAMLprim LLVMTypeRef llvm_ppc_fp128_type(value Unit) {
- return LLVMPPCFP128Type();
-}
-
-/*--... Operations on function types .......................................--*/
-
-/* lltype -> lltype array -> lltype */
-CAMLprim LLVMTypeRef llvm_function_type(LLVMTypeRef RetTy, value ParamTys) {
- return LLVMFunctionType(RetTy, (LLVMTypeRef *) ParamTys,
- Wosize_val(ParamTys), 0);
-}
-
-/* lltype -> lltype array -> lltype */
-CAMLprim LLVMTypeRef llvm_var_arg_function_type(LLVMTypeRef RetTy,
- value ParamTys) {
- return LLVMFunctionType(RetTy, (LLVMTypeRef *) ParamTys,
- Wosize_val(ParamTys), 1);
-}
-
-/* lltype -> bool */
-CAMLprim value llvm_is_var_arg(LLVMTypeRef FunTy) {
- return Val_bool(LLVMIsFunctionVarArg(FunTy));
-}
-
-/* lltype -> lltype array */
-CAMLprim value llvm_param_types(LLVMTypeRef FunTy) {
- value Tys = alloc(LLVMCountParamTypes(FunTy), 0);
- LLVMGetParamTypes(FunTy, (LLVMTypeRef *) Tys);
- return Tys;
-}
-
-/*--... Operations on struct types .........................................--*/
-
-/* lltype array -> lltype */
-CAMLprim LLVMTypeRef llvm_struct_type(value ElementTypes) {
- return LLVMStructType((LLVMTypeRef *) ElementTypes,
- Wosize_val(ElementTypes), 0);
-}
-
-/* lltype array -> lltype */
-CAMLprim LLVMTypeRef llvm_packed_struct_type(value ElementTypes) {
- return LLVMStructType((LLVMTypeRef *) ElementTypes,
- Wosize_val(ElementTypes), 1);
-}
-
-/* lltype -> lltype array */
-CAMLprim value llvm_element_types(LLVMTypeRef StructTy) {
- value Tys = alloc(LLVMCountStructElementTypes(StructTy), 0);
- LLVMGetStructElementTypes(StructTy, (LLVMTypeRef *) Tys);
- return Tys;
-}
-
-/* lltype -> bool */
-CAMLprim value llvm_is_packed(LLVMTypeRef StructTy) {
- return Val_bool(LLVMIsPackedStruct(StructTy));
-}
-
-/*--... Operations on array, pointer, and vector types .....................--*/
-
-/* lltype -> int -> lltype */
-CAMLprim LLVMTypeRef llvm_array_type(LLVMTypeRef ElementTy, value Count) {
- return LLVMArrayType(ElementTy, Int_val(Count));
-}
-
-/* lltype -> lltype */
-CAMLprim LLVMTypeRef llvm_pointer_type(LLVMTypeRef ElementTy) {
- return LLVMPointerType(ElementTy, 0);
-}
-
-/* lltype -> int -> lltype */
-CAMLprim LLVMTypeRef llvm_qualified_pointer_type(LLVMTypeRef ElementTy,
- value AddressSpace) {
- return LLVMPointerType(ElementTy, Int_val(AddressSpace));
-}
-
-/* lltype -> int -> lltype */
-CAMLprim LLVMTypeRef llvm_vector_type(LLVMTypeRef ElementTy, value Count) {
- return LLVMVectorType(ElementTy, Int_val(Count));
-}
-
-/* lltype -> int */
-CAMLprim value llvm_array_length(LLVMTypeRef ArrayTy) {
- return Val_int(LLVMGetArrayLength(ArrayTy));
-}
-
-/* lltype -> int */
-CAMLprim value llvm_address_space(LLVMTypeRef PtrTy) {
- return Val_int(LLVMGetPointerAddressSpace(PtrTy));
-}
-
-/* lltype -> int */
-CAMLprim value llvm_vector_size(LLVMTypeRef VectorTy) {
- return Val_int(LLVMGetVectorSize(VectorTy));
-}
-
-/*--... Operations on other types ..........................................--*/
-
-/* unit -> lltype */
-CAMLprim LLVMTypeRef llvm_void_type (value Unit) { return LLVMVoidType(); }
-CAMLprim LLVMTypeRef llvm_label_type(value Unit) { return LLVMLabelType(); }
-
-/* unit -> lltype */
-CAMLprim LLVMTypeRef llvm_opaque_type(value Unit) {
- return LLVMOpaqueType();
-}
-
-/*--... Operations on type handles .........................................--*/
-
-#define Typehandle_val(v) (*(LLVMTypeHandleRef *)(Data_custom_val(v)))
-
-static void llvm_finalize_handle(value TH) {
- LLVMDisposeTypeHandle(Typehandle_val(TH));
-}
-
-static struct custom_operations typehandle_ops = {
- (char *) "LLVMTypeHandle",
- llvm_finalize_handle,
- custom_compare_default,
- custom_hash_default,
- custom_serialize_default,
- custom_deserialize_default
-};
-
-CAMLprim value llvm_handle_to_type(LLVMTypeRef PATy) {
- value TH = alloc_custom(&typehandle_ops, sizeof(LLVMBuilderRef), 0, 1);
- Typehandle_val(TH) = LLVMCreateTypeHandle(PATy);
- return TH;
-}
-
-CAMLprim LLVMTypeRef llvm_type_of_handle(value TH) {
- return LLVMResolveTypeHandle(Typehandle_val(TH));
-}
-
-CAMLprim value llvm_refine_type(LLVMTypeRef AbstractTy, LLVMTypeRef ConcreteTy){
- LLVMRefineAbstractType(AbstractTy, ConcreteTy);
- return Val_unit;
-}
-
-
-/*===-- VALUES ------------------------------------------------------------===*/
-
-/* llvalue -> lltype */
-CAMLprim LLVMTypeRef llvm_type_of(LLVMValueRef Val) {
- return LLVMTypeOf(Val);
-}
-
-/* llvalue -> string */
-CAMLprim value llvm_value_name(LLVMValueRef Val) {
- return copy_string(LLVMGetValueName(Val));
-}
-
-/* string -> llvalue -> unit */
-CAMLprim value llvm_set_value_name(value Name, LLVMValueRef Val) {
- LLVMSetValueName(Val, String_val(Name));
- return Val_unit;
-}
-
-/* llvalue -> unit */
-CAMLprim value llvm_dump_value(LLVMValueRef Val) {
- LLVMDumpValue(Val);
- return Val_unit;
-}
-
-/*--... Operations on constants of (mostly) any type .......................--*/
-
-/* llvalue -> bool */
-CAMLprim value llvm_is_constant(LLVMValueRef Val) {
- return Val_bool(LLVMIsConstant(Val));
-}
-
-/* llvalue -> bool */
-CAMLprim value llvm_is_null(LLVMValueRef Val) {
- return Val_bool(LLVMIsNull(Val));
-}
-
-/* llvalue -> bool */
-CAMLprim value llvm_is_undef(LLVMValueRef Val) {
- return Val_bool(LLVMIsUndef(Val));
-}
-
-/*--... Operations on scalar constants .....................................--*/
-
-/* lltype -> int -> llvalue */
-CAMLprim LLVMValueRef llvm_const_int(LLVMTypeRef IntTy, value N) {
- return LLVMConstInt(IntTy, (long long) Int_val(N), 1);
-}
-
-/* lltype -> Int64.t -> bool -> llvalue */
-CAMLprim LLVMValueRef llvm_const_of_int64(LLVMTypeRef IntTy, value N,
- value SExt) {
- return LLVMConstInt(IntTy, Int64_val(N), Bool_val(SExt));
-}
-
-/* lltype -> float -> llvalue */
-CAMLprim LLVMValueRef llvm_const_float(LLVMTypeRef RealTy, value N) {
- return LLVMConstReal(RealTy, Double_val(N));
-}
-
-/*--... Operations on composite constants ..................................--*/
-
-/* string -> llvalue */
-CAMLprim LLVMValueRef llvm_const_string(value Str, value NullTerminate) {
- return LLVMConstString(String_val(Str), string_length(Str), 1);
-}
-
-/* string -> llvalue */
-CAMLprim LLVMValueRef llvm_const_stringz(value Str, value NullTerminate) {
- return LLVMConstString(String_val(Str), string_length(Str), 0);
-}
-
-/* lltype -> llvalue array -> llvalue */
-CAMLprim LLVMValueRef llvm_const_array(LLVMTypeRef ElementTy,
- value ElementVals) {
- return LLVMConstArray(ElementTy, (LLVMValueRef*) Op_val(ElementVals),
- Wosize_val(ElementVals));
-}
-
-/* llvalue array -> llvalue */
-CAMLprim LLVMValueRef llvm_const_struct(value ElementVals) {
- return LLVMConstStruct((LLVMValueRef *) Op_val(ElementVals),
- Wosize_val(ElementVals), 0);
-}
-
-/* llvalue array -> llvalue */
-CAMLprim LLVMValueRef llvm_const_packed_struct(value ElementVals) {
- return LLVMConstStruct((LLVMValueRef *) Op_val(ElementVals),
- Wosize_val(ElementVals), 1);
-}
-
-/* llvalue array -> llvalue */
-CAMLprim LLVMValueRef llvm_const_vector(value ElementVals) {
- return LLVMConstVector((LLVMValueRef*) Op_val(ElementVals),
- Wosize_val(ElementVals));
-}
-
-/*--... Constant expressions ...............................................--*/
-
-/* Icmp.t -> llvalue -> llvalue -> llvalue */
-CAMLprim LLVMValueRef llvm_const_icmp(value Pred,
- LLVMValueRef LHSConstant,
- LLVMValueRef RHSConstant) {
- return LLVMConstICmp(Int_val(Pred) + LLVMIntEQ, LHSConstant, RHSConstant);
-}
-
-/* Fcmp.t -> llvalue -> llvalue -> llvalue */
-CAMLprim LLVMValueRef llvm_const_fcmp(value Pred,
- LLVMValueRef LHSConstant,
- LLVMValueRef RHSConstant) {
- return LLVMConstFCmp(Int_val(Pred), LHSConstant, RHSConstant);
-}
-
-/* llvalue -> llvalue array -> llvalue */
-CAMLprim LLVMValueRef llvm_const_gep(LLVMValueRef ConstantVal, value Indices) {
- return LLVMConstGEP(ConstantVal, (LLVMValueRef*) Op_val(Indices),
- Wosize_val(Indices));
-}
-
-/*--... Operations on global variables, functions, and aliases (globals) ...--*/
-
-/* llvalue -> bool */
-CAMLprim value llvm_is_declaration(LLVMValueRef Global) {
- return Val_bool(LLVMIsDeclaration(Global));
-}
-
-/* llvalue -> Linkage.t */
-CAMLprim value llvm_linkage(LLVMValueRef Global) {
- return Val_int(LLVMGetLinkage(Global));
-}
-
-/* Linkage.t -> llvalue -> unit */
-CAMLprim value llvm_set_linkage(value Linkage, LLVMValueRef Global) {
- LLVMSetLinkage(Global, Int_val(Linkage));
- return Val_unit;
-}
-
-/* llvalue -> string */
-CAMLprim value llvm_section(LLVMValueRef Global) {
- return copy_string(LLVMGetSection(Global));
-}
-
-/* string -> llvalue -> unit */
-CAMLprim value llvm_set_section(value Section, LLVMValueRef Global) {
- LLVMSetSection(Global, String_val(Section));
- return Val_unit;
-}
-
-/* llvalue -> Visibility.t */
-CAMLprim value llvm_visibility(LLVMValueRef Global) {
- return Val_int(LLVMGetVisibility(Global));
-}
-
-/* Visibility.t -> llvalue -> unit */
-CAMLprim value llvm_set_visibility(value Viz, LLVMValueRef Global) {
- LLVMSetVisibility(Global, Int_val(Viz));
- return Val_unit;
-}
-
-/* llvalue -> int */
-CAMLprim value llvm_alignment(LLVMValueRef Global) {
- return Val_int(LLVMGetAlignment(Global));
-}
-
-/* int -> llvalue -> unit */
-CAMLprim value llvm_set_alignment(value Bytes, LLVMValueRef Global) {
- LLVMSetAlignment(Global, Int_val(Bytes));
- return Val_unit;
-}
-
-/*--... Operations on global variables .....................................--*/
-
-DEFINE_ITERATORS(global, Global, LLVMModuleRef, LLVMValueRef,
- LLVMGetGlobalParent)
-
-/* lltype -> string -> llmodule -> llvalue */
-CAMLprim LLVMValueRef llvm_declare_global(LLVMTypeRef Ty, value Name,
- LLVMModuleRef M) {
- LLVMValueRef GlobalVar;
- if ((GlobalVar = LLVMGetNamedGlobal(M, String_val(Name)))) {
- if (LLVMGetElementType(LLVMTypeOf(GlobalVar)) != Ty)
- return LLVMConstBitCast(GlobalVar, LLVMPointerType(Ty, 0));
- return GlobalVar;
- }
- return LLVMAddGlobal(M, Ty, String_val(Name));
-}
-
-/* string -> llmodule -> llvalue option */
-CAMLprim value llvm_lookup_global(value Name, LLVMModuleRef M) {
- CAMLparam1(Name);
- LLVMValueRef GlobalVar;
- if ((GlobalVar = LLVMGetNamedGlobal(M, String_val(Name)))) {
- value Option = alloc(1, 0);
- Field(Option, 0) = (value) GlobalVar;
- CAMLreturn(Option);
- }
- CAMLreturn(Val_int(0));
-}
-
-/* string -> llvalue -> llmodule -> llvalue */
-CAMLprim LLVMValueRef llvm_define_global(value Name, LLVMValueRef Initializer,
- LLVMModuleRef M) {
- LLVMValueRef GlobalVar = LLVMAddGlobal(M, LLVMTypeOf(Initializer),
- String_val(Name));
- LLVMSetInitializer(GlobalVar, Initializer);
- return GlobalVar;
-}
-
-/* llvalue -> unit */
-CAMLprim value llvm_delete_global(LLVMValueRef GlobalVar) {
- LLVMDeleteGlobal(GlobalVar);
- return Val_unit;
-}
-
-/* llvalue -> llvalue -> unit */
-CAMLprim value llvm_set_initializer(LLVMValueRef ConstantVal,
- LLVMValueRef GlobalVar) {
- LLVMSetInitializer(GlobalVar, ConstantVal);
- return Val_unit;
-}
-
-/* llvalue -> unit */
-CAMLprim value llvm_remove_initializer(LLVMValueRef GlobalVar) {
- LLVMSetInitializer(GlobalVar, NULL);
- return Val_unit;
-}
-
-/* llvalue -> bool */
-CAMLprim value llvm_is_thread_local(LLVMValueRef GlobalVar) {
- return Val_bool(LLVMIsThreadLocal(GlobalVar));
-}
-
-/* bool -> llvalue -> unit */
-CAMLprim value llvm_set_thread_local(value IsThreadLocal,
- LLVMValueRef GlobalVar) {
- LLVMSetThreadLocal(GlobalVar, Bool_val(IsThreadLocal));
- return Val_unit;
-}
-
-/* llvalue -> bool */
-CAMLprim value llvm_is_global_constant(LLVMValueRef GlobalVar) {
- return Val_bool(LLVMIsGlobalConstant(GlobalVar));
-}
-
-/* bool -> llvalue -> unit */
-CAMLprim value llvm_set_global_constant(value Flag, LLVMValueRef GlobalVar) {
- LLVMSetGlobalConstant(GlobalVar, Bool_val(Flag));
- return Val_unit;
-}
-
-/*--... Operations on functions ............................................--*/
-
-DEFINE_ITERATORS(function, Function, LLVMModuleRef, LLVMValueRef,
- LLVMGetGlobalParent)
-
-/* string -> lltype -> llmodule -> llvalue */
-CAMLprim LLVMValueRef llvm_declare_function(value Name, LLVMTypeRef Ty,
- LLVMModuleRef M) {
- LLVMValueRef Fn;
- if ((Fn = LLVMGetNamedFunction(M, String_val(Name)))) {
- if (LLVMGetElementType(LLVMTypeOf(Fn)) != Ty)
- return LLVMConstBitCast(Fn, LLVMPointerType(Ty, 0));
- return Fn;
- }
- return LLVMAddFunction(M, String_val(Name), Ty);
-}
-
-/* string -> llmodule -> llvalue option */
-CAMLprim value llvm_lookup_function(value Name, LLVMModuleRef M) {
- CAMLparam1(Name);
- LLVMValueRef Fn;
- if ((Fn = LLVMGetNamedFunction(M, String_val(Name)))) {
- value Option = alloc(1, 0);
- Field(Option, 0) = (value) Fn;
- CAMLreturn(Option);
- }
- CAMLreturn(Val_int(0));
-}
-
-/* string -> lltype -> llmodule -> llvalue */
-CAMLprim LLVMValueRef llvm_define_function(value Name, LLVMTypeRef Ty,
- LLVMModuleRef M) {
- LLVMValueRef Fn = LLVMAddFunction(M, String_val(Name), Ty);
- LLVMAppendBasicBlock(Fn, "entry");
- return Fn;
-}
-
-/* llvalue -> unit */
-CAMLprim value llvm_delete_function(LLVMValueRef Fn) {
- LLVMDeleteFunction(Fn);
- return Val_unit;
-}
-
-/* llvalue -> bool */
-CAMLprim value llvm_is_intrinsic(LLVMValueRef Fn) {
- return Val_bool(LLVMGetIntrinsicID(Fn));
-}
-
-/* llvalue -> int */
-CAMLprim value llvm_function_call_conv(LLVMValueRef Fn) {
- return Val_int(LLVMGetFunctionCallConv(Fn));
-}
-
-/* int -> llvalue -> unit */
-CAMLprim value llvm_set_function_call_conv(value Id, LLVMValueRef Fn) {
- LLVMSetFunctionCallConv(Fn, Int_val(Id));
- return Val_unit;
-}
-
-/* llvalue -> string option */
-CAMLprim value llvm_collector(LLVMValueRef Fn) {
- const char *Collector;
- CAMLparam0();
- CAMLlocal2(Name, Option);
-
- if ((Collector = LLVMGetCollector(Fn))) {
- Name = copy_string(Collector);
-
- Option = alloc(1, 0);
- Field(Option, 0) = Name;
- CAMLreturn(Option);
- } else {
- CAMLreturn(Val_int(0));
- }
-}
-
-/* string option -> llvalue -> unit */
-CAMLprim value llvm_set_collector(value GC, LLVMValueRef Fn) {
- LLVMSetCollector(Fn, GC == Val_int(0)? 0 : String_val(Field(GC, 0)));
- return Val_unit;
-}
-
-/*--... Operations on parameters ...........................................--*/
-
-DEFINE_ITERATORS(param, Param, LLVMValueRef, LLVMValueRef, LLVMGetParamParent)
-
-/* llvalue -> int -> llvalue */
-CAMLprim LLVMValueRef llvm_param(LLVMValueRef Fn, value Index) {
- return LLVMGetParam(Fn, Int_val(Index));
-}
-
-/* llvalue -> int -> llvalue */
-CAMLprim value llvm_params(LLVMValueRef Fn, value Index) {
- value Params = alloc(LLVMCountParams(Fn), 0);
- LLVMGetParams(Fn, (LLVMValueRef *) Op_val(Params));
- return Params;
-}
-
-/*--... Operations on basic blocks .........................................--*/
-
-DEFINE_ITERATORS(
- block, BasicBlock, LLVMValueRef, LLVMBasicBlockRef, LLVMGetBasicBlockParent)
-
-/* llvalue -> llbasicblock array */
-CAMLprim value llvm_basic_blocks(LLVMValueRef Fn) {
- value MLArray = alloc(LLVMCountBasicBlocks(Fn), 0);
- LLVMGetBasicBlocks(Fn, (LLVMBasicBlockRef *) Op_val(MLArray));
- return MLArray;
-}
-
-/* llbasicblock -> unit */
-CAMLprim value llvm_delete_block(LLVMBasicBlockRef BB) {
- LLVMDeleteBasicBlock(BB);
- return Val_unit;
-}
-
-/* string -> llvalue -> llbasicblock */
-CAMLprim LLVMBasicBlockRef llvm_append_block(value Name, LLVMValueRef Fn) {
- return LLVMAppendBasicBlock(Fn, String_val(Name));
-}
-
-/* string -> llbasicblock -> llbasicblock */
-CAMLprim LLVMBasicBlockRef llvm_insert_block(value Name, LLVMBasicBlockRef BB) {
- return LLVMInsertBasicBlock(BB, String_val(Name));
-}
-
-/* llvalue -> bool */
-CAMLprim value llvm_value_is_block(LLVMValueRef Val) {
- return Val_bool(LLVMValueIsBasicBlock(Val));
-}
-
-/*--... Operations on instructions .........................................--*/
-
-DEFINE_ITERATORS(instr, Instruction, LLVMBasicBlockRef, LLVMValueRef,
- LLVMGetInstructionParent)
-
-
-/*--... Operations on call sites ...........................................--*/
-
-/* llvalue -> int */
-CAMLprim value llvm_instruction_call_conv(LLVMValueRef Inst) {
- return Val_int(LLVMGetInstructionCallConv(Inst));
-}
-
-/* int -> llvalue -> unit */
-CAMLprim value llvm_set_instruction_call_conv(value CC, LLVMValueRef Inst) {
- LLVMSetInstructionCallConv(Inst, Int_val(CC));
- return Val_unit;
-}
-
-/*--... Operations on phi nodes ............................................--*/
-
-/* (llvalue * llbasicblock) -> llvalue -> unit */
-CAMLprim value llvm_add_incoming(value Incoming, LLVMValueRef PhiNode) {
- LLVMAddIncoming(PhiNode,
- (LLVMValueRef*) &Field(Incoming, 0),
- (LLVMBasicBlockRef*) &Field(Incoming, 1),
- 1);
- return Val_unit;
-}
-
-/* llvalue -> (llvalue * llbasicblock) list */
-CAMLprim value llvm_incoming(LLVMValueRef PhiNode) {
- unsigned I;
- CAMLparam0();
- CAMLlocal3(Hd, Tl, Tmp);
-
- /* Build a tuple list of them. */
- Tl = Val_int(0);
- for (I = LLVMCountIncoming(PhiNode); I != 0; ) {
- Hd = alloc(2, 0);
- Store_field(Hd, 0, (value) LLVMGetIncomingValue(PhiNode, --I));
- Store_field(Hd, 1, (value) LLVMGetIncomingBlock(PhiNode, I));
-
- Tmp = alloc(2, 0);
- Store_field(Tmp, 0, Hd);
- Store_field(Tmp, 1, Tl);
- Tl = Tmp;
- }
-
- CAMLreturn(Tl);
-}
-
-
-/*===-- Instruction builders ----------------------------------------------===*/
-
-#define Builder_val(v) (*(LLVMBuilderRef *)(Data_custom_val(v)))
-
-static void llvm_finalize_builder(value B) {
- LLVMDisposeBuilder(Builder_val(B));
-}
-
-static struct custom_operations builder_ops = {
- (char *) "IRBuilder",
- llvm_finalize_builder,
- custom_compare_default,
- custom_hash_default,
- custom_serialize_default,
- custom_deserialize_default
-};
-
-static value alloc_builder(LLVMBuilderRef B) {
- value V = alloc_custom(&builder_ops, sizeof(LLVMBuilderRef), 0, 1);
- Builder_val(V) = B;
- return V;
-}
-
-/* unit-> llbuilder */
-CAMLprim value llvm_builder(value Unit) {
- return alloc_builder(LLVMCreateBuilder());
-}
-
-/* (llbasicblock, llvalue) llpos -> llbuilder -> unit */
-CAMLprim value llvm_position_builder(value Pos, value B) {
- if (Tag_val(Pos) == 0) {
- LLVMBasicBlockRef BB = (LLVMBasicBlockRef) Op_val(Field(Pos, 0));
- LLVMPositionBuilderAtEnd(Builder_val(B), BB);
- } else {
- LLVMValueRef I = (LLVMValueRef) Op_val(Field(Pos, 0));
- LLVMPositionBuilderBefore(Builder_val(B), I);
- }
- return Val_unit;
-}
-
-/* llbuilder -> llbasicblock */
-CAMLprim LLVMBasicBlockRef llvm_insertion_block(LLVMBuilderRef B) {
- LLVMBasicBlockRef InsertBlock = LLVMGetInsertBlock(Builder_val(B));
- if (!InsertBlock)
- raise_not_found();
- return InsertBlock;
-}
-
-/*--... Terminators ........................................................--*/
-
-/* llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_ret_void(value B) {
- return LLVMBuildRetVoid(Builder_val(B));
-}
-
-/* llvalue -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_ret(LLVMValueRef Val, value B) {
- return LLVMBuildRet(Builder_val(B), Val);
-}
-
-/* llbasicblock -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_br(LLVMBasicBlockRef BB, value B) {
- return LLVMBuildBr(Builder_val(B), BB);
-}
-
-/* llvalue -> llbasicblock -> llbasicblock -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_cond_br(LLVMValueRef If,
- LLVMBasicBlockRef Then,
- LLVMBasicBlockRef Else,
- value B) {
- return LLVMBuildCondBr(Builder_val(B), If, Then, Else);
-}
-
-/* llvalue -> llbasicblock -> int -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_switch(LLVMValueRef Of,
- LLVMBasicBlockRef Else,
- value EstimatedCount,
- value B) {
- return LLVMBuildSwitch(Builder_val(B), Of, Else, Int_val(EstimatedCount));
-}
-
-/* llvalue -> llvalue array -> llbasicblock -> llbasicblock -> string ->
- llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_invoke_nat(LLVMValueRef Fn, value Args,
- LLVMBasicBlockRef Then,
- LLVMBasicBlockRef Catch,
- value Name, value B) {
- return LLVMBuildInvoke(Builder_val(B), Fn, (LLVMValueRef *) Op_val(Args),
- Wosize_val(Args), Then, Catch, String_val(Name));
-}
-
-/* llvalue -> llvalue array -> llbasicblock -> llbasicblock -> string ->
- llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_invoke_bc(value Args[], int NumArgs) {
- return llvm_build_invoke_nat((LLVMValueRef) Args[0], Args[1],
- (LLVMBasicBlockRef) Args[2],
- (LLVMBasicBlockRef) Args[3],
- Args[4], Args[5]);
-}
-
-/* llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_unwind(value B) {
- return LLVMBuildUnwind(Builder_val(B));
-}
-
-/* llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_unreachable(value B) {
- return LLVMBuildUnreachable(Builder_val(B));
-}
-
-/*--... Arithmetic .........................................................--*/
-
-/* llvalue -> llvalue -> string -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_add(LLVMValueRef LHS, LLVMValueRef RHS,
- value Name, value B) {
- return LLVMBuildAdd(Builder_val(B), LHS, RHS, String_val(Name));
-}
-
-/* llvalue -> llvalue -> string -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_sub(LLVMValueRef LHS, LLVMValueRef RHS,
- value Name, value B) {
- return LLVMBuildSub(Builder_val(B), LHS, RHS, String_val(Name));
-}
-
-/* llvalue -> llvalue -> string -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_mul(LLVMValueRef LHS, LLVMValueRef RHS,
- value Name, value B) {
- return LLVMBuildMul(Builder_val(B), LHS, RHS, String_val(Name));
-}
-
-/* llvalue -> llvalue -> string -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_udiv(LLVMValueRef LHS, LLVMValueRef RHS,
- value Name, value B) {
- return LLVMBuildUDiv(Builder_val(B), LHS, RHS, String_val(Name));
-}
-
-/* llvalue -> llvalue -> string -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_sdiv(LLVMValueRef LHS, LLVMValueRef RHS,
- value Name, value B) {
- return LLVMBuildSDiv(Builder_val(B), LHS, RHS, String_val(Name));
-}
-
-/* llvalue -> llvalue -> string -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_fdiv(LLVMValueRef LHS, LLVMValueRef RHS,
- value Name, value B) {
- return LLVMBuildFDiv(Builder_val(B), LHS, RHS, String_val(Name));
-}
-
-/* llvalue -> llvalue -> string -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_urem(LLVMValueRef LHS, LLVMValueRef RHS,
- value Name, value B) {
- return LLVMBuildURem(Builder_val(B), LHS, RHS, String_val(Name));
-}
-
-/* llvalue -> llvalue -> string -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_srem(LLVMValueRef LHS, LLVMValueRef RHS,
- value Name, value B) {
- return LLVMBuildSRem(Builder_val(B), LHS, RHS, String_val(Name));
-}
-
-/* llvalue -> llvalue -> string -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_frem(LLVMValueRef LHS, LLVMValueRef RHS,
- value Name, value B) {
- return LLVMBuildFRem(Builder_val(B), LHS, RHS, String_val(Name));
-}
-
-/* llvalue -> llvalue -> string -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_shl(LLVMValueRef LHS, LLVMValueRef RHS,
- value Name, value B) {
- return LLVMBuildShl(Builder_val(B), LHS, RHS, String_val(Name));
-}
-
-/* llvalue -> llvalue -> string -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_lshr(LLVMValueRef LHS, LLVMValueRef RHS,
- value Name, value B) {
- return LLVMBuildLShr(Builder_val(B), LHS, RHS, String_val(Name));
-}
-
-/* llvalue -> llvalue -> string -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_ashr(LLVMValueRef LHS, LLVMValueRef RHS,
- value Name, value B) {
- return LLVMBuildAShr(Builder_val(B), LHS, RHS, String_val(Name));
-}
-
-/* llvalue -> llvalue -> string -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_and(LLVMValueRef LHS, LLVMValueRef RHS,
- value Name, value B) {
- return LLVMBuildAnd(Builder_val(B), LHS, RHS, String_val(Name));
-}
-
-/* llvalue -> llvalue -> string -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_or(LLVMValueRef LHS, LLVMValueRef RHS,
- value Name, value B) {
- return LLVMBuildOr(Builder_val(B), LHS, RHS, String_val(Name));
-}
-
-/* llvalue -> llvalue -> string -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_xor(LLVMValueRef LHS, LLVMValueRef RHS,
- value Name, value B) {
- return LLVMBuildXor(Builder_val(B), LHS, RHS, String_val(Name));
-}
-
-/* llvalue -> string -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_neg(LLVMValueRef X,
- value Name, value B) {
- return LLVMBuildNeg(Builder_val(B), X, String_val(Name));
-}
-
-/* llvalue -> string -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_not(LLVMValueRef X,
- value Name, value B) {
- return LLVMBuildNot(Builder_val(B), X, String_val(Name));
-}
-
-/*--... Memory .............................................................--*/
-
-/* lltype -> string -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_malloc(LLVMTypeRef Ty,
- value Name, value B) {
- return LLVMBuildMalloc(Builder_val(B), Ty, String_val(Name));
-}
-
-/* lltype -> llvalue -> string -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_array_malloc(LLVMTypeRef Ty, LLVMValueRef Size,
- value Name, value B) {
- return LLVMBuildArrayMalloc(Builder_val(B), Ty, Size, String_val(Name));
-}
-
-/* lltype -> string -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_alloca(LLVMTypeRef Ty,
- value Name, value B) {
- return LLVMBuildAlloca(Builder_val(B), Ty, String_val(Name));
-}
-
-/* lltype -> llvalue -> string -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_array_alloca(LLVMTypeRef Ty, LLVMValueRef Size,
- value Name, value B) {
- return LLVMBuildArrayAlloca(Builder_val(B), Ty, Size, String_val(Name));
-}
-
-/* llvalue -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_free(LLVMValueRef Pointer, value B) {
- return LLVMBuildFree(Builder_val(B), Pointer);
-}
-
-/* llvalue -> string -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_load(LLVMValueRef Pointer,
- value Name, value B) {
- return LLVMBuildLoad(Builder_val(B), Pointer, String_val(Name));
-}
-
-/* llvalue -> llvalue -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_store(LLVMValueRef Value, LLVMValueRef Pointer,
- value B) {
- return LLVMBuildStore(Builder_val(B), Value, Pointer);
-}
-
-/* llvalue -> llvalue array -> string -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_gep(LLVMValueRef Pointer, value Indices,
- value Name, value B) {
- return LLVMBuildGEP(Builder_val(B), Pointer,
- (LLVMValueRef *) Op_val(Indices), Wosize_val(Indices),
- String_val(Name));
-}
-
-/*--... Casts ..............................................................--*/
-
-/* llvalue -> lltype -> string -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_trunc(LLVMValueRef X, LLVMTypeRef Ty,
- value Name, value B) {
- return LLVMBuildTrunc(Builder_val(B), X, Ty, String_val(Name));
-}
-
-/* llvalue -> lltype -> string -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_zext(LLVMValueRef X, LLVMTypeRef Ty,
- value Name, value B) {
- return LLVMBuildZExt(Builder_val(B), X, Ty, String_val(Name));
-}
-
-/* llvalue -> lltype -> string -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_sext(LLVMValueRef X, LLVMTypeRef Ty,
- value Name, value B) {
- return LLVMBuildSExt(Builder_val(B), X, Ty, String_val(Name));
-}
-
-/* llvalue -> lltype -> string -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_fptoui(LLVMValueRef X, LLVMTypeRef Ty,
- value Name, value B) {
- return LLVMBuildFPToUI(Builder_val(B), X, Ty, String_val(Name));
-}
-
-/* llvalue -> lltype -> string -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_fptosi(LLVMValueRef X, LLVMTypeRef Ty,
- value Name, value B) {
- return LLVMBuildFPToSI(Builder_val(B), X, Ty, String_val(Name));
-}
-
-/* llvalue -> lltype -> string -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_uitofp(LLVMValueRef X, LLVMTypeRef Ty,
- value Name, value B) {
- return LLVMBuildUIToFP(Builder_val(B), X, Ty, String_val(Name));
-}
-
-/* llvalue -> lltype -> string -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_sitofp(LLVMValueRef X, LLVMTypeRef Ty,
- value Name, value B) {
- return LLVMBuildSIToFP(Builder_val(B), X, Ty, String_val(Name));
-}
-
-/* llvalue -> lltype -> string -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_fptrunc(LLVMValueRef X, LLVMTypeRef Ty,
- value Name, value B) {
- return LLVMBuildFPTrunc(Builder_val(B), X, Ty, String_val(Name));
-}
-
-/* llvalue -> lltype -> string -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_fpext(LLVMValueRef X, LLVMTypeRef Ty,
- value Name, value B) {
- return LLVMBuildFPExt(Builder_val(B), X, Ty, String_val(Name));
-}
-
-/* llvalue -> lltype -> string -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_prttoint(LLVMValueRef X, LLVMTypeRef Ty,
- value Name, value B) {
- return LLVMBuildPtrToInt(Builder_val(B), X, Ty, String_val(Name));
-}
-
-/* llvalue -> lltype -> string -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_inttoptr(LLVMValueRef X, LLVMTypeRef Ty,
- value Name, value B) {
- return LLVMBuildIntToPtr(Builder_val(B), X, Ty, String_val(Name));
-}
-
-/* llvalue -> lltype -> string -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_bitcast(LLVMValueRef X, LLVMTypeRef Ty,
- value Name, value B) {
- return LLVMBuildBitCast(Builder_val(B), X, Ty, String_val(Name));
-}
-
-/*--... Comparisons ........................................................--*/
-
-/* Icmp.t -> llvalue -> llvalue -> string -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_icmp(value Pred,
- LLVMValueRef LHS, LLVMValueRef RHS,
- value Name, value B) {
- return LLVMBuildICmp(Builder_val(B), Int_val(Pred) + LLVMIntEQ, LHS, RHS,
- String_val(Name));
-}
-
-/* Fcmp.t -> llvalue -> llvalue -> string -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_fcmp(value Pred,
- LLVMValueRef LHS, LLVMValueRef RHS,
- value Name, value B) {
- return LLVMBuildFCmp(Builder_val(B), Int_val(Pred), LHS, RHS,
- String_val(Name));
-}
-
-/*--... Miscellaneous instructions .........................................--*/
-
-/* (llvalue * llbasicblock) list -> string -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_phi(value Incoming, value Name, value B) {
- value Hd, Tl;
- LLVMValueRef FirstValue, PhiNode;
-
- assert(Incoming != Val_int(0) && "Empty list passed to Llvm.build_phi!");
-
- Hd = Field(Incoming, 0);
- FirstValue = (LLVMValueRef) Field(Hd, 0);
- PhiNode = LLVMBuildPhi(Builder_val(B), LLVMTypeOf(FirstValue),
- String_val(Name));
-
- for (Tl = Incoming; Tl != Val_int(0); Tl = Field(Tl, 1)) {
- value Hd = Field(Tl, 0);
- LLVMAddIncoming(PhiNode, (LLVMValueRef*) &Field(Hd, 0),
- (LLVMBasicBlockRef*) &Field(Hd, 1), 1);
- }
-
- return PhiNode;
-}
-
-/* llvalue -> llvalue array -> string -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_call(LLVMValueRef Fn, value Params,
- value Name, value B) {
- return LLVMBuildCall(Builder_val(B), Fn, (LLVMValueRef *) Op_val(Params),
- Wosize_val(Params), String_val(Name));
-}
-
-/* llvalue -> llvalue -> llvalue -> string -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_select(LLVMValueRef If,
- LLVMValueRef Then, LLVMValueRef Else,
- value Name, value B) {
- return LLVMBuildSelect(Builder_val(B), If, Then, Else, String_val(Name));
-}
-
-/* llvalue -> lltype -> string -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_va_arg(LLVMValueRef List, LLVMTypeRef Ty,
- value Name, value B) {
- return LLVMBuildVAArg(Builder_val(B), List, Ty, String_val(Name));
-}
-
-/* llvalue -> llvalue -> string -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_extractelement(LLVMValueRef Vec,
- LLVMValueRef Idx,
- value Name, value B) {
- return LLVMBuildExtractElement(Builder_val(B), Vec, Idx, String_val(Name));
-}
-
-/* llvalue -> llvalue -> llvalue -> string -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_insertelement(LLVMValueRef Vec,
- LLVMValueRef Element,
- LLVMValueRef Idx,
- value Name, value B) {
- return LLVMBuildInsertElement(Builder_val(B), Vec, Element, Idx,
- String_val(Name));
-}
-
-/* llvalue -> llvalue -> llvalue -> string -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_shufflevector(LLVMValueRef V1, LLVMValueRef V2,
- LLVMValueRef Mask,
- value Name, value B) {
- return LLVMBuildShuffleVector(Builder_val(B), V1, V2, Mask, String_val(Name));
-}
-
-
-/*===-- Module Providers --------------------------------------------------===*/
-
-/* llmoduleprovider -> unit */
-CAMLprim value llvm_dispose_module_provider(LLVMModuleProviderRef MP) {
- LLVMDisposeModuleProvider(MP);
- return Val_unit;
-}
-
-
-/*===-- Memory buffers ----------------------------------------------------===*/
-
-/* string -> llmemorybuffer
- raises IoError msg on error */
-CAMLprim value llvm_memorybuffer_of_file(value Path) {
- CAMLparam1(Path);
- char *Message;
- LLVMMemoryBufferRef MemBuf;
-
- if (LLVMCreateMemoryBufferWithContentsOfFile(String_val(Path),
- &MemBuf, &Message))
- llvm_raise(llvm_ioerror_exn, Message);
-
- CAMLreturn((value) MemBuf);
-}
-
-/* unit -> llmemorybuffer
- raises IoError msg on error */
-CAMLprim LLVMMemoryBufferRef llvm_memorybuffer_of_stdin(value Unit) {
- char *Message;
- LLVMMemoryBufferRef MemBuf;
-
- if (LLVMCreateMemoryBufferWithSTDIN(&MemBuf, &Message))
- llvm_raise(llvm_ioerror_exn, Message);
-
- return MemBuf;
-}
-
-/* llmemorybuffer -> unit */
-CAMLprim value llvm_memorybuffer_dispose(LLVMMemoryBufferRef MemBuf) {
- LLVMDisposeMemoryBuffer(MemBuf);
- return Val_unit;
-}
-
-/*===-- Pass Managers -----------------------------------------------------===*/
-
-/* unit -> [ `Module ] PassManager.t */
-CAMLprim LLVMPassManagerRef llvm_passmanager_create(value Unit) {
- return LLVMCreatePassManager();
-}
-
-/* llmodule -> [ `Function ] PassManager.t -> bool */
-CAMLprim value llvm_passmanager_run_module(LLVMModuleRef M,
- LLVMPassManagerRef PM) {
- return Val_bool(LLVMRunPassManager(PM, M));
-}
-
-/* [ `Function ] PassManager.t -> bool */
-CAMLprim value llvm_passmanager_initialize(LLVMPassManagerRef FPM) {
- return Val_bool(LLVMInitializeFunctionPassManager(FPM));
-}
-
-/* llvalue -> [ `Function ] PassManager.t -> bool */
-CAMLprim value llvm_passmanager_run_function(LLVMValueRef F,
- LLVMPassManagerRef FPM) {
- return Val_bool(LLVMRunFunctionPassManager(FPM, F));
-}
-
-/* [ `Function ] PassManager.t -> bool */
-CAMLprim value llvm_passmanager_finalize(LLVMPassManagerRef FPM) {
- return Val_bool(LLVMFinalizeFunctionPassManager(FPM));
-}
-
-/* PassManager.any PassManager.t -> unit */
-CAMLprim value llvm_passmanager_dispose(LLVMPassManagerRef PM) {
- LLVMDisposePassManager(PM);
- return Val_unit;
-}
diff --git a/release_23/bindings/ocaml/target/Makefile b/release_23/bindings/ocaml/target/Makefile
deleted file mode 100644
index 5cd677b76656..000000000000
--- a/release_23/bindings/ocaml/target/Makefile
+++ /dev/null
@@ -1,20 +0,0 @@
-##===- bindings/ocaml/target/Makefile ----------------------*- Makefile -*-===##
-#
-# The LLVM Compiler Infrastructure
-#
-# This file is distributed under the University of Illinois Open Source
-# License. See LICENSE.TXT for details.
-#
-##===----------------------------------------------------------------------===##
-#
-# This is the makefile for the Objective Caml Llvm_target interface.
-#
-##===----------------------------------------------------------------------===##
-
-LEVEL := ../../..
-LIBRARYNAME := llvm_target
-DONT_BUILD_RELINKED := 1
-UsedComponents := target
-UsedOcamlInterfaces := llvm
-
-include ../Makefile.ocaml
diff --git a/release_23/bindings/ocaml/target/llvm_target.ml b/release_23/bindings/ocaml/target/llvm_target.ml
deleted file mode 100644
index ea5341d5e8b2..000000000000
--- a/release_23/bindings/ocaml/target/llvm_target.ml
+++ /dev/null
@@ -1,44 +0,0 @@
-(*===-- llvm_target.ml - LLVM Ocaml Interface ------------------*- OCaml -*-===*
- *
- * The LLVM Compiler Infrastructure
- *
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
- *
- *===----------------------------------------------------------------------===*)
-
-module Endian = struct
- type t =
- | Big
- | Little
-end
-
-module TargetData = struct
- type t
-
- external create : string -> t = "llvm_targetdata_create"
- external add : t -> [<Llvm.PassManager.any] Llvm.PassManager.t -> unit
- = "llvm_targetdata_add"
- external as_string : t -> string = "llvm_targetdata_as_string"
- external invalidate_struct_layout : t -> Llvm.lltype -> unit
- = "llvm_targetdata_invalidate_struct_layout"
- external dispose : t -> unit = "llvm_targetdata_dispose"
-end
-
-external byte_order : TargetData.t -> Endian.t = "llvm_byte_order"
-external pointer_size : TargetData.t -> int = "llvm_pointer_size"
-external intptr_type : TargetData.t -> Llvm.lltype = "LLVMIntPtrType"
-external size_in_bits : TargetData.t -> Llvm.lltype -> Int64.t
- = "llvm_size_in_bits"
-external store_size : TargetData.t -> Llvm.lltype -> Int64.t = "llvm_store_size"
-external abi_size : TargetData.t -> Llvm.lltype -> Int64.t = "llvm_abi_size"
-external abi_align : TargetData.t -> Llvm.lltype -> int = "llvm_abi_align"
-external stack_align : TargetData.t -> Llvm.lltype -> int = "llvm_stack_align"
-external preferred_align : TargetData.t -> Llvm.lltype -> int
- = "llvm_preferred_align"
-external preferred_align_of_global : TargetData.t -> Llvm.llvalue -> int
- = "llvm_preferred_align_of_global"
-external element_at_offset : TargetData.t -> Llvm.lltype -> Int64.t -> int
- = "llvm_element_at_offset"
-external offset_of_element : TargetData.t -> Llvm.lltype -> int -> Int64.t
- = "llvm_offset_of_element"
diff --git a/release_23/bindings/ocaml/target/llvm_target.mli b/release_23/bindings/ocaml/target/llvm_target.mli
deleted file mode 100644
index a44758f95b9a..000000000000
--- a/release_23/bindings/ocaml/target/llvm_target.mli
+++ /dev/null
@@ -1,102 +0,0 @@
-(*===-- llvm_target.mli - LLVM Ocaml Interface -----------------*- OCaml -*-===*
- *
- * The LLVM Compiler Infrastructure
- *
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
- *
- *===----------------------------------------------------------------------===*)
-
-(** Target Information.
-
- This interface provides an ocaml API for LLVM target information,
- the classes in the Target library. *)
-
-module Endian : sig
- type t =
- | Big
- | Little
-end
-
-module TargetData : sig
- type t
-
- (** [TargetData.create rep] parses the target data string representation [rep].
- See the constructor llvm::TargetData::TargetData. *)
- external create : string -> t = "llvm_targetdata_create"
-
- (** [add_target_data td pm] adds the target data [td] to the pass manager [pm].
- Does not take ownership of the target data.
- See the method llvm::PassManagerBase::add. *)
- external add : t -> [<Llvm.PassManager.any] Llvm.PassManager.t -> unit
- = "llvm_targetdata_add"
-
- (** [as_string td] is the string representation of the target data [td].
- See the constructor llvm::TargetData::TargetData. *)
- external as_string : t -> string = "llvm_targetdata_as_string"
-
- (** Struct layouts are speculatively cached. If a TargetDataRef is alive when
- types are being refined and removed, this method must be called whenever a
- struct type is removed to avoid a dangling pointer in this cache.
- See the method llvm::TargetData::InvalidateStructLayoutInfo. *)
- external invalidate_struct_layout : t -> Llvm.lltype -> unit
- = "llvm_targetdata_invalidate_struct_layout"
-
- (** Deallocates a TargetData.
- See the destructor llvm::TargetData::~TargetData. *)
- external dispose : t -> unit = "llvm_targetdata_dispose"
-end
-
-(** Returns the byte order of a target, either LLVMBigEndian or
- LLVMLittleEndian.
- See the method llvm::TargetData::isLittleEndian. *)
-external byte_order : TargetData.t -> Endian.t = "llvm_byte_order"
-
-(** Returns the pointer size in bytes for a target.
- See the method llvm::TargetData::getPointerSize. *)
-external pointer_size : TargetData.t -> int = "llvm_pointer_size"
-
-(** Returns the integer type that is the same size as a pointer on a target.
- See the method llvm::TargetData::getIntPtrType. *)
-external intptr_type : TargetData.t -> Llvm.lltype = "LLVMIntPtrType"
-
-(** Computes the size of a type in bytes for a target.
- See the method llvm::TargetData::getTypeSizeInBits. *)
-external size_in_bits : TargetData.t -> Llvm.lltype -> Int64.t
- = "llvm_size_in_bits"
-
-(** Computes the storage size of a type in bytes for a target.
- See the method llvm::TargetData::getTypeStoreSize. *)
-external store_size : TargetData.t -> Llvm.lltype -> Int64.t = "llvm_store_size"
-
-(** Computes the ABI size of a type in bytes for a target.
- See the method llvm::TargetData::getABITypeSize. *)
-external abi_size : TargetData.t -> Llvm.lltype -> Int64.t = "llvm_abi_size"
-
-(** Computes the ABI alignment of a type in bytes for a target.
- See the method llvm::TargetData::getTypeABISize. *)
-external abi_align : TargetData.t -> Llvm.lltype -> int = "llvm_abi_align"
-
-(** Computes the call frame alignment of a type in bytes for a target.
- See the method llvm::TargetData::getTypeABISize. *)
-external stack_align : TargetData.t -> Llvm.lltype -> int = "llvm_stack_align"
-
-(** Computes the preferred alignment of a type in bytes for a target.
- See the method llvm::TargetData::getTypeABISize. *)
-external preferred_align : TargetData.t -> Llvm.lltype -> int
- = "llvm_preferred_align"
-
-(** Computes the preferred alignment of a global variable in bytes for a target.
- See the method llvm::TargetData::getPreferredAlignment. *)
-external preferred_align_of_global : TargetData.t -> Llvm.llvalue -> int
- = "llvm_preferred_align_of_global"
-
-(** Computes the structure element that contains the byte offset for a target.
- See the method llvm::StructLayout::getElementContainingOffset. *)
-external element_at_offset : TargetData.t -> Llvm.lltype -> Int64.t -> int
- = "llvm_element_at_offset"
-
-(** Computes the byte offset of the indexed struct element for a target.
- See the method llvm::StructLayout::getElementContainingOffset. *)
-external offset_of_element : TargetData.t -> Llvm.lltype -> int -> Int64.t
- = "llvm_offset_of_element"
diff --git a/release_23/bindings/ocaml/target/target_ocaml.c b/release_23/bindings/ocaml/target/target_ocaml.c
deleted file mode 100644
index cc20e8187a7a..000000000000
--- a/release_23/bindings/ocaml/target/target_ocaml.c
+++ /dev/null
@@ -1,109 +0,0 @@
-/*===-- target_ocaml.c - LLVM Ocaml Glue ------------------------*- C++ -*-===*\
-|* *|
-|* The LLVM Compiler Infrastructure *|
-|* *|
-|* This file is distributed under the University of Illinois Open Source *|
-|* License. See LICENSE.TXT for details. *|
-|* *|
-|*===----------------------------------------------------------------------===*|
-|* *|
-|* This file glues LLVM's ocaml interface to its C interface. These functions *|
-|* are by and large transparent wrappers to the corresponding C functions. *|
-|* *|
-|* Note that these functions intentionally take liberties with the CAMLparamX *|
-|* macros, since most of the parameters are not GC heap objects. *|
-|* *|
-\*===----------------------------------------------------------------------===*/
-
-#include "llvm-c/Target.h"
-#include "caml/alloc.h"
-
-/* string -> TargetData.t */
-CAMLprim LLVMTargetDataRef llvm_targetdata_create(value StringRep) {
- return LLVMCreateTargetData(String_val(StringRep));
-}
-
-/* TargetData.t -> [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */
-CAMLprim value llvm_targetdata_add(LLVMTargetDataRef TD, LLVMPassManagerRef PM){
- LLVMAddTargetData(TD, PM);
- return Val_unit;
-}
-
-/* TargetData.t -> string */
-CAMLprim value llvm_targetdata_as_string(LLVMTargetDataRef TD) {
- char *StringRep = LLVMCopyStringRepOfTargetData(TD);
- value Copy = copy_string(StringRep);
- LLVMDisposeMessage(StringRep);
- return Copy;
-}
-
-/* TargetData.t -> Llvm.lltype -> unit */
-CAMLprim value llvm_targetdata_invalidate_struct_layout(LLVMTargetDataRef TD,
- LLVMTypeRef Ty) {
- LLVMInvalidateStructLayout(TD, Ty);
- return Val_unit;
-}
-
-/* TargetData.t -> unit */
-CAMLprim value llvm_targetdata_dispose(LLVMTargetDataRef TD) {
- LLVMDisposeTargetData(TD);
- return Val_unit;
-}
-
-/* TargetData.t -> Endian.t */
-CAMLprim value llvm_byte_order(LLVMTargetDataRef TD) {
- return Val_int(LLVMByteOrder(TD));
-}
-
-/* TargetData.t -> int */
-CAMLprim value llvm_pointer_size(LLVMTargetDataRef TD) {
- return Val_int(LLVMPointerSize(TD));
-}
-
-/* TargetData.t -> Llvm.lltype -> Int64.t */
-CAMLprim value llvm_size_in_bits(LLVMTargetDataRef TD, LLVMTypeRef Ty) {
- return caml_copy_int64(LLVMSizeOfTypeInBits(TD, Ty));
-}
-
-/* TargetData.t -> Llvm.lltype -> Int64.t */
-CAMLprim value llvm_store_size(LLVMTargetDataRef TD, LLVMTypeRef Ty) {
- return caml_copy_int64(LLVMStoreSizeOfType(TD, Ty));
-}
-
-/* TargetData.t -> Llvm.lltype -> Int64.t */
-CAMLprim value llvm_abi_size(LLVMTargetDataRef TD, LLVMTypeRef Ty) {
- return caml_copy_int64(LLVMABISizeOfType(TD, Ty));
-}
-
-/* TargetData.t -> Llvm.lltype -> int */
-CAMLprim value llvm_abi_align(LLVMTargetDataRef TD, LLVMTypeRef Ty) {
- return Val_int(LLVMABIAlignmentOfType(TD, Ty));
-}
-
-/* TargetData.t -> Llvm.lltype -> int */
-CAMLprim value llvm_stack_align(LLVMTargetDataRef TD, LLVMTypeRef Ty) {
- return Val_int(LLVMCallFrameAlignmentOfType(TD, Ty));
-}
-
-/* TargetData.t -> Llvm.lltype -> int */
-CAMLprim value llvm_preferred_align(LLVMTargetDataRef TD, LLVMTypeRef Ty) {
- return Val_int(LLVMPreferredAlignmentOfType(TD, Ty));
-}
-
-/* TargetData.t -> Llvm.llvalue -> int */
-CAMLprim value llvm_preferred_align_of_global(LLVMTargetDataRef TD,
- LLVMValueRef GlobalVar) {
- return Val_int(LLVMPreferredAlignmentOfGlobal(TD, GlobalVar));
-}
-
-/* TargetData.t -> Llvm.lltype -> Int64.t -> int */
-CAMLprim value llvm_element_at_offset(LLVMTargetDataRef TD, LLVMTypeRef Ty,
- value Offset) {
- return Val_int(LLVMElementAtOffset(TD, Ty, Int_val(Offset)));
-}
-
-/* TargetData.t -> Llvm.lltype -> int -> Int64.t */
-CAMLprim value llvm_offset_of_element(LLVMTargetDataRef TD, LLVMTypeRef Ty,
- value Index) {
- return caml_copy_int64(LLVMOffsetOfElement(TD, Ty, Int_val(Index)));
-}
diff --git a/release_23/bindings/ocaml/transforms/Makefile b/release_23/bindings/ocaml/transforms/Makefile
deleted file mode 100644
index 95b00c8d74aa..000000000000
--- a/release_23/bindings/ocaml/transforms/Makefile
+++ /dev/null
@@ -1,18 +0,0 @@
-##===- bindings/ocaml/transforms/Makefile ------------------*- Makefile -*-===##
-#
-# The LLVM Compiler Infrastructure
-#
-# This file is distributed under the University of Illinois Open Source
-# License. See LICENSE.TXT for details.
-#
-##===----------------------------------------------------------------------===##
-
-LEVEL := ../../..
-DIRS = scalar
-
-ocamldoc:
- $(Verb) for i in $(DIRS) ; do \
- $(MAKE) -C $$i ocamldoc; \
- done
-
-include $(LEVEL)/Makefile.common
diff --git a/release_23/bindings/ocaml/transforms/scalar/Makefile b/release_23/bindings/ocaml/transforms/scalar/Makefile
deleted file mode 100644
index cbaffa4ea7ae..000000000000
--- a/release_23/bindings/ocaml/transforms/scalar/Makefile
+++ /dev/null
@@ -1,20 +0,0 @@
-##===- bindings/ocaml/transforms/scalar/Makefile -----------*- Makefile -*-===##
-#
-# The LLVM Compiler Infrastructure
-#
-# This file is distributed under the University of Illinois Open Source
-# License. See LICENSE.TXT for details.
-#
-##===----------------------------------------------------------------------===##
-#
-# This is the makefile for the Objective Caml Llvm_scalar_opts interface.
-#
-##===----------------------------------------------------------------------===##
-
-LEVEL := ../../../..
-LIBRARYNAME := llvm_scalar_opts
-DONT_BUILD_RELINKED := 1
-UsedComponents := scalaropts
-UsedOcamlInterfaces := llvm
-
-include ../../Makefile.ocaml
diff --git a/release_23/bindings/ocaml/transforms/scalar/llvm_scalar_opts.ml b/release_23/bindings/ocaml/transforms/scalar/llvm_scalar_opts.ml
deleted file mode 100644
index b4563b716a82..000000000000
--- a/release_23/bindings/ocaml/transforms/scalar/llvm_scalar_opts.ml
+++ /dev/null
@@ -1,32 +0,0 @@
-(*===-- llvm_scalar_opts.ml - LLVM Ocaml Interface -------------*- OCaml -*-===*
- *
- * The LLVM Compiler Infrastructure
- *
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
- *
- *===----------------------------------------------------------------------===*)
-
-external add_constant_propagation : [<Llvm.PassManager.any] Llvm.PassManager.t
- -> unit
- = "llvm_add_constant_propagation"
-external add_instruction_combining : [<Llvm.PassManager.any] Llvm.PassManager.t
- -> unit
- = "llvm_add_instruction_combining"
-external
-add_memory_to_register_promotion : [<Llvm.PassManager.any] Llvm.PassManager.t
- -> unit
- = "llvm_add_memory_to_register_promotion"
-external
-add_memory_to_register_demotion : [<Llvm.PassManager.any] Llvm.PassManager.t
- -> unit
- = "llvm_add_memory_to_register_demotion"
-external add_reassociation : [<Llvm.PassManager.any] Llvm.PassManager.t
- -> unit
- = "llvm_add_reassociation"
-external add_gvn : [<Llvm.PassManager.any] Llvm.PassManager.t
- -> unit
- = "llvm_add_gvn"
-external add_cfg_simplification : [<Llvm.PassManager.any] Llvm.PassManager.t
- -> unit
- = "llvm_add_cfg_simplification"
diff --git a/release_23/bindings/ocaml/transforms/scalar/llvm_scalar_opts.mli b/release_23/bindings/ocaml/transforms/scalar/llvm_scalar_opts.mli
deleted file mode 100644
index 6fcce0432d71..000000000000
--- a/release_23/bindings/ocaml/transforms/scalar/llvm_scalar_opts.mli
+++ /dev/null
@@ -1,50 +0,0 @@
-(*===-- llvm_scalar_opts.mli - LLVM Ocaml Interface ------------*- OCaml -*-===*
- *
- * The LLVM Compiler Infrastructure
- *
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
- *
- *===----------------------------------------------------------------------===*)
-
-(** Scalar Transforms.
-
- This interface provides an ocaml API for LLVM scalar transforms, the
- classes in the [LLVMScalarOpts] library. *)
-
-(** See the [llvm::createConstantPropogationPass] function. *)
-external add_constant_propagation : [<Llvm.PassManager.any] Llvm.PassManager.t
- -> unit
- = "llvm_add_constant_propagation"
-
-(** See the [llvm::createInstructionCombiningPass] function. *)
-external add_instruction_combining : [<Llvm.PassManager.any] Llvm.PassManager.t
- -> unit
- = "llvm_add_instruction_combining"
-
-(** See the [llvm::createPromoteMemoryToRegisterPass] function. *)
-external
-add_memory_to_register_promotion : [<Llvm.PassManager.any] Llvm.PassManager.t
- -> unit
- = "llvm_add_memory_to_register_promotion"
-
-(** See the [llvm::createDemoteMemoryToRegisterPass] function. *)
-external
-add_memory_to_register_demotion : [<Llvm.PassManager.any] Llvm.PassManager.t
- -> unit
- = "llvm_add_memory_to_register_demotion"
-
-(** See the [llvm::createReassociatePass] function. *)
-external add_reassociation : [<Llvm.PassManager.any] Llvm.PassManager.t
- -> unit
- = "llvm_add_reassociation"
-
-(** See the [llvm::createGVNPass] function. *)
-external add_gvn : [<Llvm.PassManager.any] Llvm.PassManager.t
- -> unit
- = "llvm_add_gvn"
-
-(** See the [llvm::createCFGSimplificationPass] function. *)
-external add_cfg_simplification : [<Llvm.PassManager.any] Llvm.PassManager.t
- -> unit
- = "llvm_add_cfg_simplification"
diff --git a/release_23/bindings/ocaml/transforms/scalar/scalar_opts_ocaml.c b/release_23/bindings/ocaml/transforms/scalar/scalar_opts_ocaml.c
deleted file mode 100644
index 87c106098432..000000000000
--- a/release_23/bindings/ocaml/transforms/scalar/scalar_opts_ocaml.c
+++ /dev/null
@@ -1,62 +0,0 @@
-/*===-- scalar_opts_ocaml.c - LLVM Ocaml Glue -------------------*- C++ -*-===*\
-|* *|
-|* The LLVM Compiler Infrastructure *|
-|* *|
-|* This file is distributed under the University of Illinois Open Source *|
-|* License. See LICENSE.TXT for details. *|
-|* *|
-|*===----------------------------------------------------------------------===*|
-|* *|
-|* This file glues LLVM's ocaml interface to its C interface. These functions *|
-|* are by and large transparent wrappers to the corresponding C functions. *|
-|* *|
-|* Note that these functions intentionally take liberties with the CAMLparamX *|
-|* macros, since most of the parameters are not GC heap objects. *|
-|* *|
-\*===----------------------------------------------------------------------===*/
-
-#include "llvm-c/Transforms/Scalar.h"
-#include "caml/mlvalues.h"
-#include "caml/misc.h"
-
-/* [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */
-CAMLprim value llvm_add_constant_propagation(LLVMPassManagerRef PM) {
- LLVMAddConstantPropagationPass(PM);
- return Val_unit;
-}
-
-/* [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */
-CAMLprim value llvm_add_instruction_combining(LLVMPassManagerRef PM) {
- LLVMAddInstructionCombiningPass(PM);
- return Val_unit;
-}
-
-/* [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */
-CAMLprim value llvm_add_memory_to_register_promotion(LLVMPassManagerRef PM) {
- LLVMAddPromoteMemoryToRegisterPass(PM);
- return Val_unit;
-}
-
-/* [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */
-CAMLprim value llvm_add_memory_to_register_demotion(LLVMPassManagerRef PM) {
- LLVMAddDemoteMemoryToRegisterPass(PM);
- return Val_unit;
-}
-
-/* [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */
-CAMLprim value llvm_add_reassociation(LLVMPassManagerRef PM) {
- LLVMAddReassociatePass(PM);
- return Val_unit;
-}
-
-/* [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */
-CAMLprim value llvm_add_gvn(LLVMPassManagerRef PM) {
- LLVMAddGVNPass(PM);
- return Val_unit;
-}
-
-/* [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */
-CAMLprim value llvm_add_cfg_simplification(LLVMPassManagerRef PM) {
- LLVMAddCFGSimplificationPass(PM);
- return Val_unit;
-}
diff --git a/release_23/build-for-llvm-top.sh b/release_23/build-for-llvm-top.sh
deleted file mode 100755
index 2a68c79965b8..000000000000
--- a/release_23/build-for-llvm-top.sh
+++ /dev/null
@@ -1,58 +0,0 @@
-#!/bin/sh
-
-# This includes the Bourne shell library from llvm-top. Since this file is
-# generally only used when building from llvm-top, it is safe to assume that
-# llvm is checked out into llvm-top in which case .. just works.
-. ../library.sh
-
-# Process the options passed in to us by the build script into standard
-# variables.
-process_arguments "$@"
-
-# See if we have previously been configured by sensing the presence
-# of the config.status scripts
-if test ! -x "config.status" ; then
- # We must configure so build a list of configure options
- config_options="--prefix=$PREFIX --with-llvmgccdir=$PREFIX"
- if test "$OPTIMIZED" -eq 1 ; then
- config_options="$config_options --enable-optimized"
- else
- config_options="$config_options --disable-optimized"
- fi
- if test "$DEBUG" -eq 1 ; then
- config_options="$config_options --enable-debug"
- else
- config_options="$config_options --disable-debug"
- fi
- if test "$ASSERTIONS" -eq 1 ; then
- config_options="$config_options --enable-assertions"
- else
- config_options="$config_options --disable-assertions"
- fi
- if test "$CHECKING" -eq 1 ; then
- config_options="$config_options --enable-expensive-checks"
- else
- config_options="$config_options --disable-expensive-checks"
- fi
- if test "$DOXYGEN" -eq 1 ; then
- config_options="$config_options --enable-doxygen"
- else
- config_options="$config_options --disable-doxygen"
- fi
- if test "$THREADS" -eq 1 ; then
- config_options="$config_options --enable-threads"
- else
- config_options="$config_options --disable-threads"
- fi
- config_options="$config_options $OPTIONS_DASH $OPTIONS_DASH_DASH"
- msg 0 Configuring $module with:
- msg 0 " ./configure" $config_options
- $LLVM_TOP/llvm/configure $config_options || \
- die $? "Configuring llvm module failed"
-else
- msg 0 Module $module already configured, ignoring configure options.
-fi
-
-msg 0 Building $module with:
-msg 0 " make" $OPTIONS_ASSIGN tools-only
-make $OPTIONS_ASSIGN tools-only
diff --git a/release_23/configure b/release_23/configure
deleted file mode 100755
index 41d74cd11ece..000000000000
--- a/release_23/configure
+++ /dev/null
@@ -1,35814 +0,0 @@
-#! /bin/sh
-# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.60 for llvm 2.3.
-#
-# Report bugs to <llvmbugs@cs.uiuc.edu>.
-#
-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
-# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
-# This configure script is free software; the Free Software Foundation
-# gives unlimited permission to copy, distribute and modify it.
-#
-# Copyright (c) 2003-2008 University of Illinois at Urbana-Champaign.
-## --------------------- ##
-## M4sh Initialization. ##
-## --------------------- ##
-
-# Be Bourne compatible
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
- emulate sh
- NULLCMD=:
- # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
- # is contrary to our usage. Disable this feature.
- alias -g '${1+"$@"}'='"$@"'
- setopt NO_GLOB_SUBST
-else
- case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
-fi
-BIN_SH=xpg4; export BIN_SH # for Tru64
-DUALCASE=1; export DUALCASE # for MKS sh
-
-
-# PATH needs CR
-# Avoid depending upon Character Ranges.
-as_cr_letters='abcdefghijklmnopqrstuvwxyz'
-as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
-as_cr_Letters=$as_cr_letters$as_cr_LETTERS
-as_cr_digits='0123456789'
-as_cr_alnum=$as_cr_Letters$as_cr_digits
-
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
- echo "#! /bin/sh" >conf$$.sh
- echo "exit 0" >>conf$$.sh
- chmod +x conf$$.sh
- if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
- PATH_SEPARATOR=';'
- else
- PATH_SEPARATOR=:
- fi
- rm -f conf$$.sh
-fi
-
-# Support unset when possible.
-if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
- as_unset=unset
-else
- as_unset=false
-fi
-
-
-# IFS
-# We need space, tab and new line, in precisely that order. Quoting is
-# there to prevent editors from complaining about space-tab.
-# (If _AS_PATH_WALK were called with IFS unset, it would disable word
-# splitting by setting IFS to empty value.)
-as_nl='
-'
-IFS=" "" $as_nl"
-
-# Find who we are. Look in the path if we contain no directory separator.
-case $0 in
- *[\\/]* ) as_myself=$0 ;;
- *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
-done
-IFS=$as_save_IFS
-
- ;;
-esac
-# We did not find ourselves, most probably we were run as `sh COMMAND'
-# in which case we are not to be found in the path.
-if test "x$as_myself" = x; then
- as_myself=$0
-fi
-if test ! -f "$as_myself"; then
- echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
- { (exit 1); exit 1; }
-fi
-
-# Work around bugs in pre-3.0 UWIN ksh.
-for as_var in ENV MAIL MAILPATH
-do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
-done
-PS1='$ '
-PS2='> '
-PS4='+ '
-
-# NLS nuisances.
-for as_var in \
- LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
- LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
- LC_TELEPHONE LC_TIME
-do
- if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
- eval $as_var=C; export $as_var
- else
- ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
- fi
-done
-
-# Required to use basename.
-if expr a : '\(a\)' >/dev/null 2>&1 &&
- test "X`expr 00001 : '.*\(...\)'`" = X001; then
- as_expr=expr
-else
- as_expr=false
-fi
-
-if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
- as_basename=basename
-else
- as_basename=false
-fi
-
-
-# Name of the executable.
-as_me=`$as_basename -- "$0" ||
-$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
- X"$0" : 'X\(//\)$' \| \
- X"$0" : 'X\(/\)' \| . 2>/dev/null ||
-echo X/"$0" |
- sed '/^.*\/\([^/][^/]*\)\/*$/{
- s//\1/
- q
- }
- /^X\/\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\/\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
-
-# CDPATH.
-$as_unset CDPATH
-
-
-if test "x$CONFIG_SHELL" = x; then
- if (eval ":") 2>/dev/null; then
- as_have_required=yes
-else
- as_have_required=no
-fi
-
- if test $as_have_required = yes && (eval ":
-(as_func_return () {
- (exit \$1)
-}
-as_func_success () {
- as_func_return 0
-}
-as_func_failure () {
- as_func_return 1
-}
-as_func_ret_success () {
- return 0
-}
-as_func_ret_failure () {
- return 1
-}
-
-exitcode=0
-if as_func_success; then
- :
-else
- exitcode=1
- echo as_func_success failed.
-fi
-
-if as_func_failure; then
- exitcode=1
- echo as_func_failure succeeded.
-fi
-
-if as_func_ret_success; then
- :
-else
- exitcode=1
- echo as_func_ret_success failed.
-fi
-
-if as_func_ret_failure; then
- exitcode=1
- echo as_func_ret_failure succeeded.
-fi
-
-if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
- :
-else
- exitcode=1
- echo positional parameters were not saved.
-fi
-
-test \$exitcode = 0) || { (exit 1); exit 1; }
-
-(
- as_lineno_1=\$LINENO
- as_lineno_2=\$LINENO
- test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" &&
- test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; }
-") 2> /dev/null; then
- :
-else
- as_candidate_shells=
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in /usr/bin/posix$PATH_SEPARATOR/bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- case $as_dir in
- /*)
- for as_base in sh bash ksh sh5; do
- as_candidate_shells="$as_candidate_shells $as_dir/$as_base"
- done;;
- esac
-done
-IFS=$as_save_IFS
-
-
- for as_shell in $as_candidate_shells $SHELL; do
- # Try only shells that exist, to save several forks.
- if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
- { ("$as_shell") 2> /dev/null <<\_ASEOF
-# Be Bourne compatible
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
- emulate sh
- NULLCMD=:
- # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
- # is contrary to our usage. Disable this feature.
- alias -g '${1+"$@"}'='"$@"'
- setopt NO_GLOB_SUBST
-else
- case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
-fi
-BIN_SH=xpg4; export BIN_SH # for Tru64
-DUALCASE=1; export DUALCASE # for MKS sh
-
-:
-_ASEOF
-}; then
- CONFIG_SHELL=$as_shell
- as_have_required=yes
- if { "$as_shell" 2> /dev/null <<\_ASEOF
-# Be Bourne compatible
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
- emulate sh
- NULLCMD=:
- # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
- # is contrary to our usage. Disable this feature.
- alias -g '${1+"$@"}'='"$@"'
- setopt NO_GLOB_SUBST
-else
- case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
-fi
-BIN_SH=xpg4; export BIN_SH # for Tru64
-DUALCASE=1; export DUALCASE # for MKS sh
-
-:
-(as_func_return () {
- (exit $1)
-}
-as_func_success () {
- as_func_return 0
-}
-as_func_failure () {
- as_func_return 1
-}
-as_func_ret_success () {
- return 0
-}
-as_func_ret_failure () {
- return 1
-}
-
-exitcode=0
-if as_func_success; then
- :
-else
- exitcode=1
- echo as_func_success failed.
-fi
-
-if as_func_failure; then
- exitcode=1
- echo as_func_failure succeeded.
-fi
-
-if as_func_ret_success; then
- :
-else
- exitcode=1
- echo as_func_ret_success failed.
-fi
-
-if as_func_ret_failure; then
- exitcode=1
- echo as_func_ret_failure succeeded.
-fi
-
-if ( set x; as_func_ret_success y && test x = "$1" ); then
- :
-else
- exitcode=1
- echo positional parameters were not saved.
-fi
-
-test $exitcode = 0) || { (exit 1); exit 1; }
-
-(
- as_lineno_1=$LINENO
- as_lineno_2=$LINENO
- test "x$as_lineno_1" != "x$as_lineno_2" &&
- test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; }
-
-_ASEOF
-}; then
- break
-fi
-
-fi
-
- done
-
- if test "x$CONFIG_SHELL" != x; then
- for as_var in BASH_ENV ENV
- do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
- done
- export CONFIG_SHELL
- exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
-fi
-
-
- if test $as_have_required = no; then
- echo This script requires a shell more modern than all the
- echo shells that I found on your system. Please install a
- echo modern shell, or manually run the script under such a
- echo shell if you do have one.
- { (exit 1); exit 1; }
-fi
-
-
-fi
-
-fi
-
-
-
-(eval "as_func_return () {
- (exit \$1)
-}
-as_func_success () {
- as_func_return 0
-}
-as_func_failure () {
- as_func_return 1
-}
-as_func_ret_success () {
- return 0
-}
-as_func_ret_failure () {
- return 1
-}
-
-exitcode=0
-if as_func_success; then
- :
-else
- exitcode=1
- echo as_func_success failed.
-fi
-
-if as_func_failure; then
- exitcode=1
- echo as_func_failure succeeded.
-fi
-
-if as_func_ret_success; then
- :
-else
- exitcode=1
- echo as_func_ret_success failed.
-fi
-
-if as_func_ret_failure; then
- exitcode=1
- echo as_func_ret_failure succeeded.
-fi
-
-if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
- :
-else
- exitcode=1
- echo positional parameters were not saved.
-fi
-
-test \$exitcode = 0") || {
- echo No shell found that supports shell functions.
- echo Please tell autoconf@gnu.org about your system,
- echo including any error possibly output before this
- echo message
-}
-
-
-
- as_lineno_1=$LINENO
- as_lineno_2=$LINENO
- test "x$as_lineno_1" != "x$as_lineno_2" &&
- test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
-
- # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
- # uniformly replaced by the line number. The first 'sed' inserts a
- # line-number line after each line using $LINENO; the second 'sed'
- # does the real work. The second script uses 'N' to pair each
- # line-number line with the line containing $LINENO, and appends
- # trailing '-' during substitution so that $LINENO is not a special
- # case at line end.
- # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
- # scripts with optimization help from Paolo Bonzini. Blame Lee
- # E. McMahon (1931-1989) for sed's syntax. :-)
- sed -n '
- p
- /[$]LINENO/=
- ' <$as_myself |
- sed '
- s/[$]LINENO.*/&-/
- t lineno
- b
- :lineno
- N
- :loop
- s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
- t loop
- s/-\n.*//
- ' >$as_me.lineno &&
- chmod +x "$as_me.lineno" ||
- { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
- { (exit 1); exit 1; }; }
-
- # Don't try to exec as it changes $[0], causing all sort of problems
- # (the dirname of $[0] is not the place where we might find the
- # original and so on. Autoconf is especially sensitive to this).
- . "./$as_me.lineno"
- # Exit status is that of the last command.
- exit
-}
-
-
-if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
- as_dirname=dirname
-else
- as_dirname=false
-fi
-
-ECHO_C= ECHO_N= ECHO_T=
-case `echo -n x` in
--n*)
- case `echo 'x\c'` in
- *c*) ECHO_T=' ';; # ECHO_T is single tab character.
- *) ECHO_C='\c';;
- esac;;
-*)
- ECHO_N='-n';;
-esac
-
-if expr a : '\(a\)' >/dev/null 2>&1 &&
- test "X`expr 00001 : '.*\(...\)'`" = X001; then
- as_expr=expr
-else
- as_expr=false
-fi
-
-rm -f conf$$ conf$$.exe conf$$.file
-if test -d conf$$.dir; then
- rm -f conf$$.dir/conf$$.file
-else
- rm -f conf$$.dir
- mkdir conf$$.dir
-fi
-echo >conf$$.file
-if ln -s conf$$.file conf$$ 2>/dev/null; then
- as_ln_s='ln -s'
- # ... but there are two gotchas:
- # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
- # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
- # In both cases, we have to default to `cp -p'.
- ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
- as_ln_s='cp -p'
-elif ln conf$$.file conf$$ 2>/dev/null; then
- as_ln_s=ln
-else
- as_ln_s='cp -p'
-fi
-rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
-rmdir conf$$.dir 2>/dev/null
-
-if mkdir -p . 2>/dev/null; then
- as_mkdir_p=:
-else
- test -d ./-p && rmdir ./-p
- as_mkdir_p=false
-fi
-
-# Find out whether ``test -x'' works. Don't use a zero-byte file, as
-# systems may use methods other than mode bits to determine executability.
-cat >conf$$.file <<_ASEOF
-#! /bin/sh
-exit 0
-_ASEOF
-chmod +x conf$$.file
-if test -x conf$$.file >/dev/null 2>&1; then
- as_executable_p="test -x"
-else
- as_executable_p=:
-fi
-rm -f conf$$.file
-
-# Sed expression to map a string onto a valid CPP name.
-as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
-
-# Sed expression to map a string onto a valid variable name.
-as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
-
-
-
-
-# Check that we are running under the correct shell.
-SHELL=${CONFIG_SHELL-/bin/sh}
-
-case X$ECHO in
-X*--fallback-echo)
- # Remove one level of quotation (which was required for Make).
- ECHO=`echo "$ECHO" | sed 's,\\\\\$\\$0,'$0','`
- ;;
-esac
-
-echo=${ECHO-echo}
-if test "X$1" = X--no-reexec; then
- # Discard the --no-reexec flag, and continue.
- shift
-elif test "X$1" = X--fallback-echo; then
- # Avoid inline document here, it may be left over
- :
-elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then
- # Yippee, $echo works!
- :
-else
- # Restart under the correct shell.
- exec $SHELL "$0" --no-reexec ${1+"$@"}
-fi
-
-if test "X$1" = X--fallback-echo; then
- # used as fallback echo
- shift
- cat <<EOF
-$*
-EOF
- exit 0
-fi
-
-# The HP-UX ksh and POSIX shell print the target directory to stdout
-# if CDPATH is set.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-
-if test -z "$ECHO"; then
-if test "X${echo_test_string+set}" != Xset; then
-# find a string as large as possible, as long as the shell can cope with it
- for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do
- # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
- if (echo_test_string=`eval $cmd`) 2>/dev/null &&
- echo_test_string=`eval $cmd` &&
- (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null
- then
- break
- fi
- done
-fi
-
-if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
- echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
- test "X$echo_testing_string" = "X$echo_test_string"; then
- :
-else
- # The Solaris, AIX, and Digital Unix default echo programs unquote
- # backslashes. This makes it impossible to quote backslashes using
- # echo "$something" | sed 's/\\/\\\\/g'
- #
- # So, first we look for a working echo in the user's PATH.
-
- lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
- for dir in $PATH /usr/ucb; do
- IFS="$lt_save_ifs"
- if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
- test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
- echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
- test "X$echo_testing_string" = "X$echo_test_string"; then
- echo="$dir/echo"
- break
- fi
- done
- IFS="$lt_save_ifs"
-
- if test "X$echo" = Xecho; then
- # We didn't find a better echo, so look for alternatives.
- if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
- echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` &&
- test "X$echo_testing_string" = "X$echo_test_string"; then
- # This shell has a builtin print -r that does the trick.
- echo='print -r'
- elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
- test "X$CONFIG_SHELL" != X/bin/ksh; then
- # If we have ksh, try running configure again with it.
- ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
- export ORIGINAL_CONFIG_SHELL
- CONFIG_SHELL=/bin/ksh
- export CONFIG_SHELL
- exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"}
- else
- # Try using printf.
- echo='printf %s\n'
- if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
- echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
- test "X$echo_testing_string" = "X$echo_test_string"; then
- # Cool, printf works
- :
- elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` &&
- test "X$echo_testing_string" = 'X\t' &&
- echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
- test "X$echo_testing_string" = "X$echo_test_string"; then
- CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
- export CONFIG_SHELL
- SHELL="$CONFIG_SHELL"
- export SHELL
- echo="$CONFIG_SHELL $0 --fallback-echo"
- elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` &&
- test "X$echo_testing_string" = 'X\t' &&
- echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
- test "X$echo_testing_string" = "X$echo_test_string"; then
- echo="$CONFIG_SHELL $0 --fallback-echo"
- else
- # maybe with a smaller string...
- prev=:
-
- for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do
- if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null
- then
- break
- fi
- prev="$cmd"
- done
-
- if test "$prev" != 'sed 50q "$0"'; then
- echo_test_string=`eval $prev`
- export echo_test_string
- exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"}
- else
- # Oops. We lost completely, so just stick with echo.
- echo=echo
- fi
- fi
- fi
- fi
-fi
-fi
-
-# Copy echo and quote the copy suitably for passing to libtool from
-# the Makefile, instead of quoting the original, which is used later.
-ECHO=$echo
-if test "X$ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then
- ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo"
-fi
-
-
-
-
-tagnames=${tagnames+${tagnames},}CXX
-
-tagnames=${tagnames+${tagnames},}F77
-
-exec 7<&0 </dev/null 6>&1
-
-# Name of the host.
-# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
-# so uname gets run too.
-ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
-
-#
-# Initializations.
-#
-ac_default_prefix=/usr/local
-ac_clean_files=
-ac_config_libobj_dir=.
-LIBOBJS=
-cross_compiling=no
-subdirs=
-MFLAGS=
-MAKEFLAGS=
-SHELL=${CONFIG_SHELL-/bin/sh}
-
-# Identity of this package.
-PACKAGE_NAME='llvm'
-PACKAGE_TARNAME='-llvm-'
-PACKAGE_VERSION='2.3'
-PACKAGE_STRING='llvm 2.3'
-PACKAGE_BUGREPORT='llvmbugs@cs.uiuc.edu'
-
-ac_unique_file="lib/VMCore/Module.cpp"
-# Factoring default headers for most tests.
-ac_includes_default="\
-#include <stdio.h>
-#if HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
-#if HAVE_SYS_STAT_H
-# include <sys/stat.h>
-#endif
-#if STDC_HEADERS
-# include <stdlib.h>
-# include <stddef.h>
-#else
-# if HAVE_STDLIB_H
-# include <stdlib.h>
-# endif
-#endif
-#if HAVE_STRING_H
-# if !STDC_HEADERS && HAVE_MEMORY_H
-# include <memory.h>
-# endif
-# include <string.h>
-#endif
-#if HAVE_STRINGS_H
-# include <strings.h>
-#endif
-#if HAVE_INTTYPES_H
-# include <inttypes.h>
-#endif
-#if HAVE_STDINT_H
-# include <stdint.h>
-#endif
-#if HAVE_UNISTD_H
-# include <unistd.h>
-#endif"
-
-ac_subst_vars='SHELL
-PATH_SEPARATOR
-PACKAGE_NAME
-PACKAGE_TARNAME
-PACKAGE_VERSION
-PACKAGE_STRING
-PACKAGE_BUGREPORT
-exec_prefix
-prefix
-program_transform_name
-bindir
-sbindir
-libexecdir
-datarootdir
-datadir
-sysconfdir
-sharedstatedir
-localstatedir
-includedir
-oldincludedir
-docdir
-infodir
-htmldir
-dvidir
-pdfdir
-psdir
-libdir
-localedir
-mandir
-DEFS
-ECHO_C
-ECHO_N
-ECHO_T
-LIBS
-build_alias
-host_alias
-target_alias
-LLVM_COPYRIGHT
-subdirs
-build
-build_cpu
-build_vendor
-build_os
-host
-host_cpu
-host_vendor
-host_os
-target
-target_cpu
-target_vendor
-target_os
-OS
-LINKALL
-NOLINKALL
-LLVM_ON_UNIX
-LLVM_ON_WIN32
-ARCH
-ENDIAN
-CC
-CFLAGS
-LDFLAGS
-CPPFLAGS
-ac_ct_CC
-EXEEXT
-OBJEXT
-CPP
-GREP
-EGREP
-LLVM_CROSS_COMPILING
-BUILD_CC
-BUILD_EXEEXT
-CVSBUILD
-ENABLE_OPTIMIZED
-DISABLE_ASSERTIONS
-ENABLE_EXPENSIVE_CHECKS
-EXPENSIVE_CHECKS
-DEBUG_RUNTIME
-JIT
-TARGET_HAS_JIT
-ENABLE_DOXYGEN
-ENABLE_THREADS
-ENABLE_PIC
-TARGETS_TO_BUILD
-ENABLE_CBE_PRINTF_A
-EXTRA_OPTIONS
-CXX
-CXXFLAGS
-ac_ct_CXX
-LEX
-LEXLIB
-LEX_OUTPUT_ROOT
-FLEX
-YACC
-YFLAGS
-BISON
-NM
-ifGNUmake
-LN_S
-CMP
-CP
-DATE
-FIND
-MKDIR
-MV
-RANLIB
-RM
-SED
-TAR
-BINPWD
-GRAPHVIZ
-DOT
-GV
-DOTTY
-PERL
-HAVE_PERL
-INSTALL_PROGRAM
-INSTALL_SCRIPT
-INSTALL_DATA
-BZIP2
-DOXYGEN
-GROFF
-GZIP
-POD2HTML
-POD2MAN
-RUNTEST
-TCLSH
-ZIP
-OCAMLC
-OCAMLOPT
-OCAMLDEP
-OCAMLDOC
-INSTALL_LTDL_TRUE
-INSTALL_LTDL_FALSE
-CONVENIENCE_LTDL_TRUE
-CONVENIENCE_LTDL_FALSE
-LIBADD_DL
-ECHO
-AR
-STRIP
-CXXCPP
-F77
-FFLAGS
-ac_ct_F77
-LIBTOOL
-LLVMGCC
-LLVMGXX
-USE_UDIS86
-HAVE_PTHREAD
-HUGE_VAL_SANITY
-ALLOCA
-MMAP_FILE
-LLVMCC1
-LLVMCC1PLUS
-LLVMGCCDIR
-LLVMGCCLIBEXEC
-LLVMGCC_VERSION
-LLVMGCC_MAJVERS
-LLVMGCC_LANGS
-SHLIBEXT
-LLVM_PREFIX
-LLVM_BINDIR
-LLVM_LIBDIR
-LLVM_DATADIR
-LLVM_DOCSDIR
-LLVM_ETCDIR
-LLVM_INCLUDEDIR
-LLVM_INFODIR
-LLVM_MANDIR
-LLVM_CONFIGTIME
-BINDINGS_TO_BUILD
-ALL_BINDINGS
-OCAML_LIBDIR
-LIBOBJS
-LTLIBOBJS'
-ac_subst_files=''
- ac_precious_vars='build_alias
-host_alias
-target_alias
-CC
-CFLAGS
-LDFLAGS
-CPPFLAGS
-CPP
-CXX
-CXXFLAGS
-CCC
-YACC
-YFLAGS
-CXXCPP
-F77
-FFLAGS'
-ac_subdirs_all='projects/sample
-projects/privbracket
-projects/llvm-stacker
-projects/llvm-test
-projects/llvm-reopt
-projects/llvm-gcc
-projects/llvm-java
-projects/llvm-tv
-projects/llvm-poolalloc
-projects/poolalloc
-projects/llvm-kernel'
-
-# Initialize some variables set by options.
-ac_init_help=
-ac_init_version=false
-# The variables have the same names as the options, with
-# dashes changed to underlines.
-cache_file=/dev/null
-exec_prefix=NONE
-no_create=
-no_recursion=
-prefix=NONE
-program_prefix=NONE
-program_suffix=NONE
-program_transform_name=s,x,x,
-silent=
-site=
-srcdir=
-verbose=
-x_includes=NONE
-x_libraries=NONE
-
-# Installation directory options.
-# These are left unexpanded so users can "make install exec_prefix=/foo"
-# and all the variables that are supposed to be based on exec_prefix
-# by default will actually change.
-# Use braces instead of parens because sh, perl, etc. also accept them.
-# (The list follows the same order as the GNU Coding Standards.)
-bindir='${exec_prefix}/bin'
-sbindir='${exec_prefix}/sbin'
-libexecdir='${exec_prefix}/libexec'
-datarootdir='${prefix}/share'
-datadir='${datarootdir}'
-sysconfdir='${prefix}/etc'
-sharedstatedir='${prefix}/com'
-localstatedir='${prefix}/var'
-includedir='${prefix}/include'
-oldincludedir='/usr/include'
-docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
-infodir='${datarootdir}/info'
-htmldir='${docdir}'
-dvidir='${docdir}'
-pdfdir='${docdir}'
-psdir='${docdir}'
-libdir='${exec_prefix}/lib'
-localedir='${datarootdir}/locale'
-mandir='${datarootdir}/man'
-
-ac_prev=
-ac_dashdash=
-for ac_option
-do
- # If the previous option needs an argument, assign it.
- if test -n "$ac_prev"; then
- eval $ac_prev=\$ac_option
- ac_prev=
- continue
- fi
-
- case $ac_option in
- *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
- *) ac_optarg=yes ;;
- esac
-
- # Accept the important Cygnus configure options, so we can diagnose typos.
-
- case $ac_dashdash$ac_option in
- --)
- ac_dashdash=yes ;;
-
- -bindir | --bindir | --bindi | --bind | --bin | --bi)
- ac_prev=bindir ;;
- -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
- bindir=$ac_optarg ;;
-
- -build | --build | --buil | --bui | --bu)
- ac_prev=build_alias ;;
- -build=* | --build=* | --buil=* | --bui=* | --bu=*)
- build_alias=$ac_optarg ;;
-
- -cache-file | --cache-file | --cache-fil | --cache-fi \
- | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
- ac_prev=cache_file ;;
- -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
- | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
- cache_file=$ac_optarg ;;
-
- --config-cache | -C)
- cache_file=config.cache ;;
-
- -datadir | --datadir | --datadi | --datad)
- ac_prev=datadir ;;
- -datadir=* | --datadir=* | --datadi=* | --datad=*)
- datadir=$ac_optarg ;;
-
- -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
- | --dataroo | --dataro | --datar)
- ac_prev=datarootdir ;;
- -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
- | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
- datarootdir=$ac_optarg ;;
-
- -disable-* | --disable-*)
- ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
- # Reject names that are not valid shell variable names.
- expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
- { echo "$as_me: error: invalid feature name: $ac_feature" >&2
- { (exit 1); exit 1; }; }
- ac_feature=`echo $ac_feature | sed 's/-/_/g'`
- eval enable_$ac_feature=no ;;
-
- -docdir | --docdir | --docdi | --doc | --do)
- ac_prev=docdir ;;
- -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
- docdir=$ac_optarg ;;
-
- -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
- ac_prev=dvidir ;;
- -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
- dvidir=$ac_optarg ;;
-
- -enable-* | --enable-*)
- ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
- # Reject names that are not valid shell variable names.
- expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
- { echo "$as_me: error: invalid feature name: $ac_feature" >&2
- { (exit 1); exit 1; }; }
- ac_feature=`echo $ac_feature | sed 's/-/_/g'`
- eval enable_$ac_feature=\$ac_optarg ;;
-
- -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
- | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
- | --exec | --exe | --ex)
- ac_prev=exec_prefix ;;
- -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
- | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
- | --exec=* | --exe=* | --ex=*)
- exec_prefix=$ac_optarg ;;
-
- -gas | --gas | --ga | --g)
- # Obsolete; use --with-gas.
- with_gas=yes ;;
-
- -help | --help | --hel | --he | -h)
- ac_init_help=long ;;
- -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
- ac_init_help=recursive ;;
- -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
- ac_init_help=short ;;
-
- -host | --host | --hos | --ho)
- ac_prev=host_alias ;;
- -host=* | --host=* | --hos=* | --ho=*)
- host_alias=$ac_optarg ;;
-
- -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
- ac_prev=htmldir ;;
- -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
- | --ht=*)
- htmldir=$ac_optarg ;;
-
- -includedir | --includedir | --includedi | --included | --include \
- | --includ | --inclu | --incl | --inc)
- ac_prev=includedir ;;
- -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
- | --includ=* | --inclu=* | --incl=* | --inc=*)
- includedir=$ac_optarg ;;
-
- -infodir | --infodir | --infodi | --infod | --info | --inf)
- ac_prev=infodir ;;
- -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
- infodir=$ac_optarg ;;
-
- -libdir | --libdir | --libdi | --libd)
- ac_prev=libdir ;;
- -libdir=* | --libdir=* | --libdi=* | --libd=*)
- libdir=$ac_optarg ;;
-
- -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
- | --libexe | --libex | --libe)
- ac_prev=libexecdir ;;
- -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
- | --libexe=* | --libex=* | --libe=*)
- libexecdir=$ac_optarg ;;
-
- -localedir | --localedir | --localedi | --localed | --locale)
- ac_prev=localedir ;;
- -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
- localedir=$ac_optarg ;;
-
- -localstatedir | --localstatedir | --localstatedi | --localstated \
- | --localstate | --localstat | --localsta | --localst | --locals)
- ac_prev=localstatedir ;;
- -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
- | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
- localstatedir=$ac_optarg ;;
-
- -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
- ac_prev=mandir ;;
- -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
- mandir=$ac_optarg ;;
-
- -nfp | --nfp | --nf)
- # Obsolete; use --without-fp.
- with_fp=no ;;
-
- -no-create | --no-create | --no-creat | --no-crea | --no-cre \
- | --no-cr | --no-c | -n)
- no_create=yes ;;
-
- -no-recursion | --no-recursion | --no-recursio | --no-recursi \
- | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
- no_recursion=yes ;;
-
- -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
- | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
- | --oldin | --oldi | --old | --ol | --o)
- ac_prev=oldincludedir ;;
- -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
- | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
- | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
- oldincludedir=$ac_optarg ;;
-
- -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
- ac_prev=prefix ;;
- -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
- prefix=$ac_optarg ;;
-
- -program-prefix | --program-prefix | --program-prefi | --program-pref \
- | --program-pre | --program-pr | --program-p)
- ac_prev=program_prefix ;;
- -program-prefix=* | --program-prefix=* | --program-prefi=* \
- | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
- program_prefix=$ac_optarg ;;
-
- -program-suffix | --program-suffix | --program-suffi | --program-suff \
- | --program-suf | --program-su | --program-s)
- ac_prev=program_suffix ;;
- -program-suffix=* | --program-suffix=* | --program-suffi=* \
- | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
- program_suffix=$ac_optarg ;;
-
- -program-transform-name | --program-transform-name \
- | --program-transform-nam | --program-transform-na \
- | --program-transform-n | --program-transform- \
- | --program-transform | --program-transfor \
- | --program-transfo | --program-transf \
- | --program-trans | --program-tran \
- | --progr-tra | --program-tr | --program-t)
- ac_prev=program_transform_name ;;
- -program-transform-name=* | --program-transform-name=* \
- | --program-transform-nam=* | --program-transform-na=* \
- | --program-transform-n=* | --program-transform-=* \
- | --program-transform=* | --program-transfor=* \
- | --program-transfo=* | --program-transf=* \
- | --program-trans=* | --program-tran=* \
- | --progr-tra=* | --program-tr=* | --program-t=*)
- program_transform_name=$ac_optarg ;;
-
- -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
- ac_prev=pdfdir ;;
- -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
- pdfdir=$ac_optarg ;;
-
- -psdir | --psdir | --psdi | --psd | --ps)
- ac_prev=psdir ;;
- -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
- psdir=$ac_optarg ;;
-
- -q | -quiet | --quiet | --quie | --qui | --qu | --q \
- | -silent | --silent | --silen | --sile | --sil)
- silent=yes ;;
-
- -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
- ac_prev=sbindir ;;
- -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
- | --sbi=* | --sb=*)
- sbindir=$ac_optarg ;;
-
- -sharedstatedir | --sharedstatedir | --sharedstatedi \
- | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
- | --sharedst | --shareds | --shared | --share | --shar \
- | --sha | --sh)
- ac_prev=sharedstatedir ;;
- -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
- | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
- | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
- | --sha=* | --sh=*)
- sharedstatedir=$ac_optarg ;;
-
- -site | --site | --sit)
- ac_prev=site ;;
- -site=* | --site=* | --sit=*)
- site=$ac_optarg ;;
-
- -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
- ac_prev=srcdir ;;
- -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
- srcdir=$ac_optarg ;;
-
- -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
- | --syscon | --sysco | --sysc | --sys | --sy)
- ac_prev=sysconfdir ;;
- -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
- | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
- sysconfdir=$ac_optarg ;;
-
- -target | --target | --targe | --targ | --tar | --ta | --t)
- ac_prev=target_alias ;;
- -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
- target_alias=$ac_optarg ;;
-
- -v | -verbose | --verbose | --verbos | --verbo | --verb)
- verbose=yes ;;
-
- -version | --version | --versio | --versi | --vers | -V)
- ac_init_version=: ;;
-
- -with-* | --with-*)
- ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
- # Reject names that are not valid shell variable names.
- expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
- { echo "$as_me: error: invalid package name: $ac_package" >&2
- { (exit 1); exit 1; }; }
- ac_package=`echo $ac_package| sed 's/-/_/g'`
- eval with_$ac_package=\$ac_optarg ;;
-
- -without-* | --without-*)
- ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
- # Reject names that are not valid shell variable names.
- expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
- { echo "$as_me: error: invalid package name: $ac_package" >&2
- { (exit 1); exit 1; }; }
- ac_package=`echo $ac_package | sed 's/-/_/g'`
- eval with_$ac_package=no ;;
-
- --x)
- # Obsolete; use --with-x.
- with_x=yes ;;
-
- -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
- | --x-incl | --x-inc | --x-in | --x-i)
- ac_prev=x_includes ;;
- -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
- | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
- x_includes=$ac_optarg ;;
-
- -x-libraries | --x-libraries | --x-librarie | --x-librari \
- | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
- ac_prev=x_libraries ;;
- -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
- | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
- x_libraries=$ac_optarg ;;
-
- -*) { echo "$as_me: error: unrecognized option: $ac_option
-Try \`$0 --help' for more information." >&2
- { (exit 1); exit 1; }; }
- ;;
-
- *=*)
- ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
- # Reject names that are not valid shell variable names.
- expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
- { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
- { (exit 1); exit 1; }; }
- eval $ac_envvar=\$ac_optarg
- export $ac_envvar ;;
-
- *)
- # FIXME: should be removed in autoconf 3.0.
- echo "$as_me: WARNING: you should use --build, --host, --target" >&2
- expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
- echo "$as_me: WARNING: invalid host type: $ac_option" >&2
- : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
- ;;
-
- esac
-done
-
-if test -n "$ac_prev"; then
- ac_option=--`echo $ac_prev | sed 's/_/-/g'`
- { echo "$as_me: error: missing argument to $ac_option" >&2
- { (exit 1); exit 1; }; }
-fi
-
-# Be sure to have absolute directory names.
-for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
- datadir sysconfdir sharedstatedir localstatedir includedir \
- oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
- libdir localedir mandir
-do
- eval ac_val=\$$ac_var
- case $ac_val in
- [\\/$]* | ?:[\\/]* ) continue;;
- NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
- esac
- { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
- { (exit 1); exit 1; }; }
-done
-
-# There might be people who depend on the old broken behavior: `$host'
-# used to hold the argument of --host etc.
-# FIXME: To remove some day.
-build=$build_alias
-host=$host_alias
-target=$target_alias
-
-# FIXME: To remove some day.
-if test "x$host_alias" != x; then
- if test "x$build_alias" = x; then
- cross_compiling=maybe
- echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
- If a cross compiler is detected then cross compile mode will be used." >&2
- elif test "x$build_alias" != "x$host_alias"; then
- cross_compiling=yes
- fi
-fi
-
-ac_tool_prefix=
-test -n "$host_alias" && ac_tool_prefix=$host_alias-
-
-test "$silent" = yes && exec 6>/dev/null
-
-
-ac_pwd=`pwd` && test -n "$ac_pwd" &&
-ac_ls_di=`ls -di .` &&
-ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
- { echo "$as_me: error: Working directory cannot be determined" >&2
- { (exit 1); exit 1; }; }
-test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
- { echo "$as_me: error: pwd does not report name of working directory" >&2
- { (exit 1); exit 1; }; }
-
-
-# Find the source files, if location was not specified.
-if test -z "$srcdir"; then
- ac_srcdir_defaulted=yes
- # Try the directory containing this script, then the parent directory.
- ac_confdir=`$as_dirname -- "$0" ||
-$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$0" : 'X\(//\)[^/]' \| \
- X"$0" : 'X\(//\)$' \| \
- X"$0" : 'X\(/\)' \| . 2>/dev/null ||
-echo X"$0" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
- srcdir=$ac_confdir
- if test ! -r "$srcdir/$ac_unique_file"; then
- srcdir=..
- fi
-else
- ac_srcdir_defaulted=no
-fi
-if test ! -r "$srcdir/$ac_unique_file"; then
- test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
- { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
- { (exit 1); exit 1; }; }
-fi
-ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
-ac_abs_confdir=`(
- cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2
- { (exit 1); exit 1; }; }
- pwd)`
-# When building in place, set srcdir=.
-if test "$ac_abs_confdir" = "$ac_pwd"; then
- srcdir=.
-fi
-# Remove unnecessary trailing slashes from srcdir.
-# Double slashes in file names in object file debugging info
-# mess up M-x gdb in Emacs.
-case $srcdir in
-*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
-esac
-for ac_var in $ac_precious_vars; do
- eval ac_env_${ac_var}_set=\${${ac_var}+set}
- eval ac_env_${ac_var}_value=\$${ac_var}
- eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
- eval ac_cv_env_${ac_var}_value=\$${ac_var}
-done
-
-#
-# Report the --help message.
-#
-if test "$ac_init_help" = "long"; then
- # Omit some internal or obsolete options to make the list less imposing.
- # This message is too long to be a string in the A/UX 3.1 sh.
- cat <<_ACEOF
-\`configure' configures llvm 2.3 to adapt to many kinds of systems.
-
-Usage: $0 [OPTION]... [VAR=VALUE]...
-
-To assign environment variables (e.g., CC, CFLAGS...), specify them as
-VAR=VALUE. See below for descriptions of some of the useful variables.
-
-Defaults for the options are specified in brackets.
-
-Configuration:
- -h, --help display this help and exit
- --help=short display options specific to this package
- --help=recursive display the short help of all the included packages
- -V, --version display version information and exit
- -q, --quiet, --silent do not print \`checking...' messages
- --cache-file=FILE cache test results in FILE [disabled]
- -C, --config-cache alias for \`--cache-file=config.cache'
- -n, --no-create do not create output files
- --srcdir=DIR find the sources in DIR [configure dir or \`..']
-
-Installation directories:
- --prefix=PREFIX install architecture-independent files in PREFIX
- [$ac_default_prefix]
- --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
- [PREFIX]
-
-By default, \`make install' will install all the files in
-\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify
-an installation prefix other than \`$ac_default_prefix' using \`--prefix',
-for instance \`--prefix=\$HOME'.
-
-For better control, use the options below.
-
-Fine tuning of the installation directories:
- --bindir=DIR user executables [EPREFIX/bin]
- --sbindir=DIR system admin executables [EPREFIX/sbin]
- --libexecdir=DIR program executables [EPREFIX/libexec]
- --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
- --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
- --localstatedir=DIR modifiable single-machine data [PREFIX/var]
- --libdir=DIR object code libraries [EPREFIX/lib]
- --includedir=DIR C header files [PREFIX/include]
- --oldincludedir=DIR C header files for non-gcc [/usr/include]
- --datarootdir=DIR read-only arch.-independent data root [PREFIX/share]
- --datadir=DIR read-only architecture-independent data [DATAROOTDIR]
- --infodir=DIR info documentation [DATAROOTDIR/info]
- --localedir=DIR locale-dependent data [DATAROOTDIR/locale]
- --mandir=DIR man documentation [DATAROOTDIR/man]
- --docdir=DIR documentation root [DATAROOTDIR/doc/-llvm-]
- --htmldir=DIR html documentation [DOCDIR]
- --dvidir=DIR dvi documentation [DOCDIR]
- --pdfdir=DIR pdf documentation [DOCDIR]
- --psdir=DIR ps documentation [DOCDIR]
-_ACEOF
-
- cat <<\_ACEOF
-
-System types:
- --build=BUILD configure for building on BUILD [guessed]
- --host=HOST cross-compile to build programs to run on HOST [BUILD]
- --target=TARGET configure for building compilers for TARGET [HOST]
-_ACEOF
-fi
-
-if test -n "$ac_init_help"; then
- case $ac_init_help in
- short | recursive ) echo "Configuration of llvm 2.3:";;
- esac
- cat <<\_ACEOF
-
-Optional Features:
- --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
- --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
- --enable-optimized
- --enable-assertions
- --enable-expensive-checks
-
- --enable-debug-runtime
- --enable-jit Enable Just In Time Compiling (default is YES)
- --enable-doxygen Build doxygen documentation (default is NO)
- --enable-threads Use threads if available (default is YES)
- --enable-pic Build LLVM with Position Independent Code (default
- is NO)
- --enable-targets Build specific host targets:
- all,host-only,{target-name} (default=all)
- --enable-cbe-printf-a Enable C Backend output with hex floating point via
- %a (default is YES)
- --enable-bindings Build specific language bindings:
- all,auto,none,{binding-name} (default=auto)
- --enable-ltdl-install install libltdl
- --enable-shared[=PKGS] build shared libraries
- [default=yes]
- --enable-static[=PKGS] build static libraries
- [default=yes]
- --enable-fast-install[=PKGS]
- optimize for fast installation
- [default=yes]
- --disable-libtool-lock avoid locking (might break parallel builds)
-
-Optional Packages:
- --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
- --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
- --with-llvmgccdir Specify location of llvm-gcc install dir (default
- searches PATH)
- --with-llvmgcc Specify location of llvm-gcc driver (default
- searches PATH)
- --with-llvmgxx Specify location of llvm-g++ driver (default
- searches PATH)
- --with-extra-options Specify addtional options to compile LLVM with
- --with-ocaml-libdir Specify install location for ocaml bindings (default
- is stdlib)
- --with-tclinclude directory where tcl headers are
- --with-gnu-ld assume the C compiler uses GNU ld [default=no]
- --with-pic try to use only PIC/non-PIC objects [default=use
- both]
- --with-tags[=TAGS] include additional configurations [automatic]
- --with-udis86=<path> Use udis86 external x86 disassembler library
-
-Some influential environment variables:
- CC C compiler command
- CFLAGS C compiler flags
- LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
- nonstandard directory <lib dir>
- CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I<include dir> if
- you have headers in a nonstandard directory <include dir>
- CPP C preprocessor
- CXX C++ compiler command
- CXXFLAGS C++ compiler flags
- YACC The `Yet Another C Compiler' implementation to use. Defaults to
- the first program found out of: `bison -y', `byacc', `yacc'.
- YFLAGS The list of arguments that will be passed by default to $YACC.
- This script will default YFLAGS to the empty string to avoid a
- default value of `-d' given by some make applications.
- CXXCPP C++ preprocessor
- F77 Fortran 77 compiler command
- FFLAGS Fortran 77 compiler flags
-
-Use these variables to override the choices made by `configure' or to help
-it to find libraries and programs with nonstandard names/locations.
-
-Report bugs to <llvmbugs@cs.uiuc.edu>.
-_ACEOF
-ac_status=$?
-fi
-
-if test "$ac_init_help" = "recursive"; then
- # If there are subdirs, report their specific --help.
- for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
- test -d "$ac_dir" || continue
- ac_builddir=.
-
-case "$ac_dir" in
-.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
-*)
- ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
- # A ".." for each directory in $ac_dir_suffix.
- ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'`
- case $ac_top_builddir_sub in
- "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
- *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
- esac ;;
-esac
-ac_abs_top_builddir=$ac_pwd
-ac_abs_builddir=$ac_pwd$ac_dir_suffix
-# for backward compatibility:
-ac_top_builddir=$ac_top_build_prefix
-
-case $srcdir in
- .) # We are building in place.
- ac_srcdir=.
- ac_top_srcdir=$ac_top_builddir_sub
- ac_abs_top_srcdir=$ac_pwd ;;
- [\\/]* | ?:[\\/]* ) # Absolute name.
- ac_srcdir=$srcdir$ac_dir_suffix;
- ac_top_srcdir=$srcdir
- ac_abs_top_srcdir=$srcdir ;;
- *) # Relative name.
- ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
- ac_top_srcdir=$ac_top_build_prefix$srcdir
- ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
-esac
-ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
-
- cd "$ac_dir" || { ac_status=$?; continue; }
- # Check for guested configure.
- if test -f "$ac_srcdir/configure.gnu"; then
- echo &&
- $SHELL "$ac_srcdir/configure.gnu" --help=recursive
- elif test -f "$ac_srcdir/configure"; then
- echo &&
- $SHELL "$ac_srcdir/configure" --help=recursive
- else
- echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
- fi || ac_status=$?
- cd "$ac_pwd" || { ac_status=$?; break; }
- done
-fi
-
-test -n "$ac_init_help" && exit $ac_status
-if $ac_init_version; then
- cat <<\_ACEOF
-llvm configure 2.3
-generated by GNU Autoconf 2.60
-
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
-2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
-This configure script is free software; the Free Software Foundation
-gives unlimited permission to copy, distribute and modify it.
-
-Copyright (c) 2003-2008 University of Illinois at Urbana-Champaign.
-_ACEOF
- exit
-fi
-cat >config.log <<_ACEOF
-This file contains any messages produced by compilers while
-running configure, to aid debugging if configure makes a mistake.
-
-It was created by llvm $as_me 2.3, which was
-generated by GNU Autoconf 2.60. Invocation command line was
-
- $ $0 $@
-
-_ACEOF
-exec 5>>config.log
-{
-cat <<_ASUNAME
-## --------- ##
-## Platform. ##
-## --------- ##
-
-hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
-uname -m = `(uname -m) 2>/dev/null || echo unknown`
-uname -r = `(uname -r) 2>/dev/null || echo unknown`
-uname -s = `(uname -s) 2>/dev/null || echo unknown`
-uname -v = `(uname -v) 2>/dev/null || echo unknown`
-
-/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
-/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown`
-
-/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown`
-/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown`
-/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
-/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown`
-/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown`
-/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown`
-/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown`
-
-_ASUNAME
-
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- echo "PATH: $as_dir"
-done
-IFS=$as_save_IFS
-
-} >&5
-
-cat >&5 <<_ACEOF
-
-
-## ----------- ##
-## Core tests. ##
-## ----------- ##
-
-_ACEOF
-
-
-# Keep a trace of the command line.
-# Strip out --no-create and --no-recursion so they do not pile up.
-# Strip out --silent because we don't want to record it for future runs.
-# Also quote any args containing shell meta-characters.
-# Make two passes to allow for proper duplicate-argument suppression.
-ac_configure_args=
-ac_configure_args0=
-ac_configure_args1=
-ac_must_keep_next=false
-for ac_pass in 1 2
-do
- for ac_arg
- do
- case $ac_arg in
- -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
- -q | -quiet | --quiet | --quie | --qui | --qu | --q \
- | -silent | --silent | --silen | --sile | --sil)
- continue ;;
- *\'*)
- ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
- esac
- case $ac_pass in
- 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;;
- 2)
- ac_configure_args1="$ac_configure_args1 '$ac_arg'"
- if test $ac_must_keep_next = true; then
- ac_must_keep_next=false # Got value, back to normal.
- else
- case $ac_arg in
- *=* | --config-cache | -C | -disable-* | --disable-* \
- | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
- | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
- | -with-* | --with-* | -without-* | --without-* | --x)
- case "$ac_configure_args0 " in
- "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
- esac
- ;;
- -* ) ac_must_keep_next=true ;;
- esac
- fi
- ac_configure_args="$ac_configure_args '$ac_arg'"
- ;;
- esac
- done
-done
-$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; }
-$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; }
-
-# When interrupted or exit'd, cleanup temporary files, and complete
-# config.log. We remove comments because anyway the quotes in there
-# would cause problems or look ugly.
-# WARNING: Use '\'' to represent an apostrophe within the trap.
-# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
-trap 'exit_status=$?
- # Save into config.log some information that might help in debugging.
- {
- echo
-
- cat <<\_ASBOX
-## ---------------- ##
-## Cache variables. ##
-## ---------------- ##
-_ASBOX
- echo
- # The following way of writing the cache mishandles newlines in values,
-(
- for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
- eval ac_val=\$$ac_var
- case $ac_val in #(
- *${as_nl}*)
- case $ac_var in #(
- *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5
-echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;;
- esac
- case $ac_var in #(
- _ | IFS | as_nl) ;; #(
- *) $as_unset $ac_var ;;
- esac ;;
- esac
- done
- (set) 2>&1 |
- case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
- *${as_nl}ac_space=\ *)
- sed -n \
- "s/'\''/'\''\\\\'\'''\''/g;
- s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
- ;; #(
- *)
- sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
- ;;
- esac |
- sort
-)
- echo
-
- cat <<\_ASBOX
-## ----------------- ##
-## Output variables. ##
-## ----------------- ##
-_ASBOX
- echo
- for ac_var in $ac_subst_vars
- do
- eval ac_val=\$$ac_var
- case $ac_val in
- *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
- esac
- echo "$ac_var='\''$ac_val'\''"
- done | sort
- echo
-
- if test -n "$ac_subst_files"; then
- cat <<\_ASBOX
-## ------------------- ##
-## File substitutions. ##
-## ------------------- ##
-_ASBOX
- echo
- for ac_var in $ac_subst_files
- do
- eval ac_val=\$$ac_var
- case $ac_val in
- *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
- esac
- echo "$ac_var='\''$ac_val'\''"
- done | sort
- echo
- fi
-
- if test -s confdefs.h; then
- cat <<\_ASBOX
-## ----------- ##
-## confdefs.h. ##
-## ----------- ##
-_ASBOX
- echo
- cat confdefs.h
- echo
- fi
- test "$ac_signal" != 0 &&
- echo "$as_me: caught signal $ac_signal"
- echo "$as_me: exit $exit_status"
- } >&5
- rm -f core *.core core.conftest.* &&
- rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
- exit $exit_status
-' 0
-for ac_signal in 1 2 13 15; do
- trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
-done
-ac_signal=0
-
-# confdefs.h avoids OS command line length limits that DEFS can exceed.
-rm -f -r conftest* confdefs.h
-
-# Predefined preprocessor variables.
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_NAME "$PACKAGE_NAME"
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_VERSION "$PACKAGE_VERSION"
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_STRING "$PACKAGE_STRING"
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
-_ACEOF
-
-
-# Let the site file select an alternate cache file if it wants to.
-# Prefer explicitly selected file to automatically selected ones.
-if test -n "$CONFIG_SITE"; then
- set x "$CONFIG_SITE"
-elif test "x$prefix" != xNONE; then
- set x "$prefix/share/config.site" "$prefix/etc/config.site"
-else
- set x "$ac_default_prefix/share/config.site" \
- "$ac_default_prefix/etc/config.site"
-fi
-shift
-for ac_site_file
-do
- if test -r "$ac_site_file"; then
- { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
-echo "$as_me: loading site script $ac_site_file" >&6;}
- sed 's/^/| /' "$ac_site_file" >&5
- . "$ac_site_file"
- fi
-done
-
-if test -r "$cache_file"; then
- # Some versions of bash will fail to source /dev/null (special
- # files actually), so we avoid doing that.
- if test -f "$cache_file"; then
- { echo "$as_me:$LINENO: loading cache $cache_file" >&5
-echo "$as_me: loading cache $cache_file" >&6;}
- case $cache_file in
- [\\/]* | ?:[\\/]* ) . "$cache_file";;
- *) . "./$cache_file";;
- esac
- fi
-else
- { echo "$as_me:$LINENO: creating cache $cache_file" >&5
-echo "$as_me: creating cache $cache_file" >&6;}
- >$cache_file
-fi
-
-# Check that the precious variables saved in the cache have kept the same
-# value.
-ac_cache_corrupted=false
-for ac_var in $ac_precious_vars; do
- eval ac_old_set=\$ac_cv_env_${ac_var}_set
- eval ac_new_set=\$ac_env_${ac_var}_set
- eval ac_old_val=\$ac_cv_env_${ac_var}_value
- eval ac_new_val=\$ac_env_${ac_var}_value
- case $ac_old_set,$ac_new_set in
- set,)
- { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
-echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
- ac_cache_corrupted=: ;;
- ,set)
- { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
-echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
- ac_cache_corrupted=: ;;
- ,);;
- *)
- if test "x$ac_old_val" != "x$ac_new_val"; then
- { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
-echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
- { echo "$as_me:$LINENO: former value: $ac_old_val" >&5
-echo "$as_me: former value: $ac_old_val" >&2;}
- { echo "$as_me:$LINENO: current value: $ac_new_val" >&5
-echo "$as_me: current value: $ac_new_val" >&2;}
- ac_cache_corrupted=:
- fi;;
- esac
- # Pass precious variables to config.status.
- if test "$ac_new_set" = set; then
- case $ac_new_val in
- *\'*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
- *) ac_arg=$ac_var=$ac_new_val ;;
- esac
- case " $ac_configure_args " in
- *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy.
- *) ac_configure_args="$ac_configure_args '$ac_arg'" ;;
- esac
- fi
-done
-if $ac_cache_corrupted; then
- { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
-echo "$as_me: error: changes in the environment can compromise the build" >&2;}
- { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
-echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
- { (exit 1); exit 1; }; }
-fi
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
-
-LLVM_COPYRIGHT="Copyright (c) 2003-2008 University of Illinois at Urbana-Champaign."
-
-
-
-
-
-
-
-ac_aux_dir=
-for ac_dir in autoconf "$srcdir"/autoconf; do
- if test -f "$ac_dir/install-sh"; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/install-sh -c"
- break
- elif test -f "$ac_dir/install.sh"; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/install.sh -c"
- break
- elif test -f "$ac_dir/shtool"; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/shtool install -c"
- break
- fi
-done
-if test -z "$ac_aux_dir"; then
- { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in autoconf \"$srcdir\"/autoconf" >&5
-echo "$as_me: error: cannot find install-sh or install.sh in autoconf \"$srcdir\"/autoconf" >&2;}
- { (exit 1); exit 1; }; }
-fi
-
-# These three variables are undocumented and unsupported,
-# and are intended to be withdrawn in a future Autoconf release.
-# They can cause serious problems if a builder's source tree is in a directory
-# whose full name contains unusual characters.
-ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var.
-ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var.
-ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
-
-
-
-if test ${srcdir} != "." ; then
- if test -f ${srcdir}/include/llvm/Config/config.h ; then
- { { echo "$as_me:$LINENO: error: Already configured in ${srcdir}" >&5
-echo "$as_me: error: Already configured in ${srcdir}" >&2;}
- { (exit 1); exit 1; }; }
- fi
-fi
-
-for i in `ls ${srcdir}/projects`
-do
- if test -d ${srcdir}/projects/${i} ; then
- case ${i} in
- CVS) ;;
- sample) subdirs="$subdirs projects/sample"
- ;;
- privbracket) subdirs="$subdirs projects/privbracket"
- ;;
- llvm-stacker) subdirs="$subdirs projects/llvm-stacker"
- ;;
- llvm-test) subdirs="$subdirs projects/llvm-test"
- ;;
- llvm-reopt) subdirs="$subdirs projects/llvm-reopt"
-;;
- llvm-gcc) subdirs="$subdirs projects/llvm-gcc"
- ;;
- llvm-java) subdirs="$subdirs projects/llvm-java"
- ;;
- llvm-tv) subdirs="$subdirs projects/llvm-tv"
- ;;
- llvm-poolalloc) subdirs="$subdirs projects/llvm-poolalloc"
- ;;
- poolalloc) subdirs="$subdirs projects/poolalloc"
- ;;
- llvm-kernel) subdirs="$subdirs projects/llvm-kernel"
- ;;
- *)
- { echo "$as_me:$LINENO: WARNING: Unknown project (${i}) won't be configured automatically" >&5
-echo "$as_me: WARNING: Unknown project (${i}) won't be configured automatically" >&2;}
- ;;
- esac
- fi
-done
-
-
-# Make sure we can run config.sub.
-$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
- { { echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5
-echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;}
- { (exit 1); exit 1; }; }
-
-{ echo "$as_me:$LINENO: checking build system type" >&5
-echo $ECHO_N "checking build system type... $ECHO_C" >&6; }
-if test "${ac_cv_build+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_build_alias=$build_alias
-test "x$ac_build_alias" = x &&
- ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
-test "x$ac_build_alias" = x &&
- { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5
-echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
- { (exit 1); exit 1; }; }
-ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
- { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5
-echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;}
- { (exit 1); exit 1; }; }
-
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_build" >&5
-echo "${ECHO_T}$ac_cv_build" >&6; }
-case $ac_cv_build in
-*-*-*) ;;
-*) { { echo "$as_me:$LINENO: error: invalid value of canonical build" >&5
-echo "$as_me: error: invalid value of canonical build" >&2;}
- { (exit 1); exit 1; }; };;
-esac
-build=$ac_cv_build
-ac_save_IFS=$IFS; IFS='-'
-set x $ac_cv_build
-shift
-build_cpu=$1
-build_vendor=$2
-shift; shift
-# Remember, the first character of IFS is used to create $*,
-# except with old shells:
-build_os=$*
-IFS=$ac_save_IFS
-case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
-
-
-{ echo "$as_me:$LINENO: checking host system type" >&5
-echo $ECHO_N "checking host system type... $ECHO_C" >&6; }
-if test "${ac_cv_host+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test "x$host_alias" = x; then
- ac_cv_host=$ac_cv_build
-else
- ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
- { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5
-echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;}
- { (exit 1); exit 1; }; }
-fi
-
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_host" >&5
-echo "${ECHO_T}$ac_cv_host" >&6; }
-case $ac_cv_host in
-*-*-*) ;;
-*) { { echo "$as_me:$LINENO: error: invalid value of canonical host" >&5
-echo "$as_me: error: invalid value of canonical host" >&2;}
- { (exit 1); exit 1; }; };;
-esac
-host=$ac_cv_host
-ac_save_IFS=$IFS; IFS='-'
-set x $ac_cv_host
-shift
-host_cpu=$1
-host_vendor=$2
-shift; shift
-# Remember, the first character of IFS is used to create $*,
-# except with old shells:
-host_os=$*
-IFS=$ac_save_IFS
-case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
-
-
-{ echo "$as_me:$LINENO: checking target system type" >&5
-echo $ECHO_N "checking target system type... $ECHO_C" >&6; }
-if test "${ac_cv_target+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test "x$target_alias" = x; then
- ac_cv_target=$ac_cv_host
-else
- ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` ||
- { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&5
-echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&2;}
- { (exit 1); exit 1; }; }
-fi
-
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_target" >&5
-echo "${ECHO_T}$ac_cv_target" >&6; }
-case $ac_cv_target in
-*-*-*) ;;
-*) { { echo "$as_me:$LINENO: error: invalid value of canonical target" >&5
-echo "$as_me: error: invalid value of canonical target" >&2;}
- { (exit 1); exit 1; }; };;
-esac
-target=$ac_cv_target
-ac_save_IFS=$IFS; IFS='-'
-set x $ac_cv_target
-shift
-target_cpu=$1
-target_vendor=$2
-shift; shift
-# Remember, the first character of IFS is used to create $*,
-# except with old shells:
-target_os=$*
-IFS=$ac_save_IFS
-case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac
-
-
-# The aliases save the names the user supplied, while $host etc.
-# will get canonicalized.
-test -n "$target_alias" &&
- test "$program_prefix$program_suffix$program_transform_name" = \
- NONENONEs,x,x, &&
- program_prefix=${target_alias}-
-
-{ echo "$as_me:$LINENO: checking type of operating system we're going to host on" >&5
-echo $ECHO_N "checking type of operating system we're going to host on... $ECHO_C" >&6; }
-if test "${llvm_cv_os_type+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- case $host in
- *-*-aix*)
- llvm_cv_link_all_option="-Wl,--whole-archive"
- llvm_cv_no_link_all_option="-Wl,--no-whole-archive"
- llvm_cv_os_type="AIX"
- llvm_cv_platform_type="Unix" ;;
- *-*-irix*)
- llvm_cv_link_all_option="-Wl,--whole-archive"
- llvm_cv_no_link_all_option="-Wl,--no-whole-archive"
- llvm_cv_os_type="IRIX"
- llvm_cv_platform_type="Unix" ;;
- *-*-cygwin*)
- llvm_cv_link_all_option="-Wl,--whole-archive"
- llvm_cv_no_link_all_option="-Wl,--no-whole-archive"
- llvm_cv_os_type="Cygwin"
- llvm_cv_platform_type="Unix" ;;
- *-*-darwin*)
- llvm_cv_link_all_option="-Wl,-all_load"
- llvm_cv_no_link_all_option="-Wl,-noall_load"
- llvm_cv_os_type="Darwin"
- llvm_cv_platform_type="Unix" ;;
- *-*-freebsd*)
- llvm_cv_link_all_option="-Wl,--whole-archive"
- llvm_cv_no_link_all_option="-Wl,--no-whole-archive"
- llvm_cv_os_type="FreeBSD"
- llvm_cv_platform_type="Unix" ;;
- *-*-openbsd*)
- llvm_cv_link_all_option="-Wl,--whole-archive"
- llvm_cv_no_link_all_option="-Wl,--no-whole-archive"
- llvm_cv_os_type="OpenBSD"
- llvm_cv_platform_type="Unix" ;;
- *-*-netbsd*)
- llvm_cv_link_all_option="-Wl,--whole-archive"
- llvm_cv_no_link_all_option="-Wl,--no-whole-archive"
- llvm_cv_os_type="NetBSD"
- llvm_cv_platform_type="Unix" ;;
- *-*-hpux*)
- llvm_cv_link_all_option="-Wl,--whole-archive"
- llvm_cv_no_link_all_option="-Wl,--no-whole-archive"
- llvm_cv_os_type="HP-UX"
- llvm_cv_platform_type="Unix" ;;
- *-*-interix*)
- llvm_cv_link_all_option="-Wl,--whole-archive"
- llvm_cv_no_link_all_option="-Wl,--no-whole-archive"
- llvm_cv_os_type="Interix"
- llvm_cv_platform_type="Unix" ;;
- *-*-linux*)
- llvm_cv_link_all_option="-Wl,--whole-archive"
- llvm_cv_no_link_all_option="-Wl,--no-whole-archive"
- llvm_cv_os_type="Linux"
- llvm_cv_platform_type="Unix" ;;
- *-*-solaris*)
- llvm_cv_link_all_option="-Wl,-z,allextract"
- llvm_cv_no_link_all_option="-Wl,-z,defaultextract"
- llvm_cv_os_type="SunOS"
- llvm_cv_platform_type="Unix" ;;
- *-*-win32*)
- llvm_cv_link_all_option="-Wl,--whole-archive"
- llvm_cv_no_link_all_option="-Wl,--no-whole-archive"
- llvm_cv_os_type="Win32"
- llvm_cv_platform_type="Win32" ;;
- *-*-mingw*)
- llvm_cv_link_all_option="-Wl,--whole-archive"
- llvm_cv_no_link_all_option="-Wl,--no-whole-archive"
- llvm_cv_os_type="MingW"
- llvm_cv_platform_type="Win32" ;;
- *)
- llvm_cv_link_all_option=""
- llvm_cv_no_link_all_option=""
- llvm_cv_os_type="Unknown"
- llvm_cv_platform_type="Unknown" ;;
-esac
-fi
-{ echo "$as_me:$LINENO: result: $llvm_cv_os_type" >&5
-echo "${ECHO_T}$llvm_cv_os_type" >&6; }
-
-if test "$llvm_cv_os_type" = "Unknown" ; then
- { { echo "$as_me:$LINENO: error: Operating system is unknown, configure can't continue" >&5
-echo "$as_me: error: Operating system is unknown, configure can't continue" >&2;}
- { (exit 1); exit 1; }; }
-fi
-
-OS=$llvm_cv_os_type
-
-
-LINKALL=$llvm_cv_link_all_option
-
-NOLINKALL=$llvm_cv_no_link_all_option
-
-
-case $llvm_cv_platform_type in
- Unix)
-
-cat >>confdefs.h <<\_ACEOF
-#define LLVM_ON_UNIX 1
-_ACEOF
-
- LLVM_ON_UNIX=1
-
- LLVM_ON_WIN32=0
-
- ;;
- Win32)
-
-cat >>confdefs.h <<\_ACEOF
-#define LLVM_ON_WIN32 1
-_ACEOF
-
- LLVM_ON_UNIX=0
-
- LLVM_ON_WIN32=1
-
- ;;
-esac
-
-{ echo "$as_me:$LINENO: checking target architecture" >&5
-echo $ECHO_N "checking target architecture... $ECHO_C" >&6; }
-if test "${llvm_cv_target_arch+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- case $target in
- i?86-*) llvm_cv_target_arch="x86" ;;
- amd64-* | x86_64-*) llvm_cv_target_arch="x86_64" ;;
- sparc*-*) llvm_cv_target_arch="Sparc" ;;
- powerpc*-*) llvm_cv_target_arch="PowerPC" ;;
- alpha*-*) llvm_cv_target_arch="Alpha" ;;
- ia64-*) llvm_cv_target_arch="IA64" ;;
- arm-*) llvm_cv_target_arch="ARM" ;;
- mips-*) llvm_cv_target_arch="Mips" ;;
- *) llvm_cv_target_arch="Unknown" ;;
-esac
-fi
-{ echo "$as_me:$LINENO: result: $llvm_cv_target_arch" >&5
-echo "${ECHO_T}$llvm_cv_target_arch" >&6; }
-
-if test "$llvm_cv_target_arch" = "Unknown" ; then
- { echo "$as_me:$LINENO: WARNING: Configuring LLVM for an unknown target archicture" >&5
-echo "$as_me: WARNING: Configuring LLVM for an unknown target archicture" >&2;}
-fi
-
-ARCH=$llvm_cv_target_arch
-
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
-set dummy ${ac_tool_prefix}gcc; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_CC="${ac_tool_prefix}gcc"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
- { echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_CC"; then
- ac_ct_CC=$CC
- # Extract the first word of "gcc", so it can be a program name with args.
-set dummy gcc; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$ac_ct_CC"; then
- ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_ac_ct_CC="gcc"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_CC=$ac_cv_prog_ac_ct_CC
-if test -n "$ac_ct_CC"; then
- { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
-echo "${ECHO_T}$ac_ct_CC" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
- if test "x$ac_ct_CC" = x; then
- CC=""
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&5
-echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&2;}
-ac_tool_warned=yes ;;
-esac
- CC=$ac_ct_CC
- fi
-else
- CC="$ac_cv_prog_CC"
-fi
-
-if test -z "$CC"; then
- if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
-set dummy ${ac_tool_prefix}cc; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_CC="${ac_tool_prefix}cc"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
- { echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-
- fi
-fi
-if test -z "$CC"; then
- # Extract the first word of "cc", so it can be a program name with args.
-set dummy cc; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
- ac_prog_rejected=no
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
- if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
- ac_prog_rejected=yes
- continue
- fi
- ac_cv_prog_CC="cc"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
-if test $ac_prog_rejected = yes; then
- # We found a bogon in the path, so make sure we never use it.
- set dummy $ac_cv_prog_CC
- shift
- if test $# != 0; then
- # We chose a different compiler from the bogus one.
- # However, it has the same basename, so the bogon will be chosen
- # first if we set CC to just the basename; use the full file name.
- shift
- ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
- fi
-fi
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
- { echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-
-fi
-if test -z "$CC"; then
- if test -n "$ac_tool_prefix"; then
- for ac_prog in cl.exe
- do
- # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
-set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
- { echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-
- test -n "$CC" && break
- done
-fi
-if test -z "$CC"; then
- ac_ct_CC=$CC
- for ac_prog in cl.exe
-do
- # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$ac_ct_CC"; then
- ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_ac_ct_CC="$ac_prog"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_CC=$ac_cv_prog_ac_ct_CC
-if test -n "$ac_ct_CC"; then
- { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
-echo "${ECHO_T}$ac_ct_CC" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-
- test -n "$ac_ct_CC" && break
-done
-
- if test "x$ac_ct_CC" = x; then
- CC=""
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&5
-echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&2;}
-ac_tool_warned=yes ;;
-esac
- CC=$ac_ct_CC
- fi
-fi
-
-fi
-
-
-test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
-See \`config.log' for more details." >&5
-echo "$as_me: error: no acceptable C compiler found in \$PATH
-See \`config.log' for more details." >&2;}
- { (exit 1); exit 1; }; }
-
-# Provide some information about the compiler.
-echo "$as_me:$LINENO: checking for C compiler version" >&5
-ac_compiler=`set X $ac_compile; echo $2`
-{ (ac_try="$ac_compiler --version >&5"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compiler --version >&5") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }
-{ (ac_try="$ac_compiler -v >&5"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compiler -v >&5") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }
-{ (ac_try="$ac_compiler -V >&5"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compiler -V >&5") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }
-
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-ac_clean_files_save=$ac_clean_files
-ac_clean_files="$ac_clean_files a.out a.exe b.out"
-# Try to create an executable without -o first, disregard a.out.
-# It will help us diagnose broken compilers, and finding out an intuition
-# of exeext.
-{ echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
-echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; }
-ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
-#
-# List of possible output files, starting from the most likely.
-# The algorithm is not robust to junk in `.', hence go to wildcards (a.*)
-# only as a last resort. b.out is created by i960 compilers.
-ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out'
-#
-# The IRIX 6 linker writes into existing files which may not be
-# executable, retaining their permissions. Remove them first so a
-# subsequent execution test works.
-ac_rmfiles=
-for ac_file in $ac_files
-do
- case $ac_file in
- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
- * ) ac_rmfiles="$ac_rmfiles $ac_file";;
- esac
-done
-rm -f $ac_rmfiles
-
-if { (ac_try="$ac_link_default"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link_default") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; then
- # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
-# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
-# in a Makefile. We should not override ac_cv_exeext if it was cached,
-# so that the user can short-circuit this test for compilers unknown to
-# Autoconf.
-for ac_file in $ac_files
-do
- test -f "$ac_file" || continue
- case $ac_file in
- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj )
- ;;
- [ab].out )
- # We found the default executable, but exeext='' is most
- # certainly right.
- break;;
- *.* )
- if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
- then :; else
- ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
- fi
- # We set ac_cv_exeext here because the later test for it is not
- # safe: cross compilers may not add the suffix if given an `-o'
- # argument, so we may need to know it at that point already.
- # Even if this section looks crufty: it has the advantage of
- # actually working.
- break;;
- * )
- break;;
- esac
-done
-test "$ac_cv_exeext" = no && ac_cv_exeext=
-
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-{ { echo "$as_me:$LINENO: error: C compiler cannot create executables
-See \`config.log' for more details." >&5
-echo "$as_me: error: C compiler cannot create executables
-See \`config.log' for more details." >&2;}
- { (exit 77); exit 77; }; }
-fi
-
-ac_exeext=$ac_cv_exeext
-{ echo "$as_me:$LINENO: result: $ac_file" >&5
-echo "${ECHO_T}$ac_file" >&6; }
-
-# Check that the compiler produces executables we can run. If not, either
-# the compiler is broken, or we cross compile.
-{ echo "$as_me:$LINENO: checking whether the C compiler works" >&5
-echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; }
-# FIXME: These cross compiler hacks should be removed for Autoconf 3.0
-# If not cross compiling, check that we can run a simple program.
-if test "$cross_compiling" != yes; then
- if { ac_try='./$ac_file'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- cross_compiling=no
- else
- if test "$cross_compiling" = maybe; then
- cross_compiling=yes
- else
- { { echo "$as_me:$LINENO: error: cannot run C compiled programs.
-If you meant to cross compile, use \`--host'.
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot run C compiled programs.
-If you meant to cross compile, use \`--host'.
-See \`config.log' for more details." >&2;}
- { (exit 1); exit 1; }; }
- fi
- fi
-fi
-{ echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
-
-rm -f a.out a.exe conftest$ac_cv_exeext b.out
-ac_clean_files=$ac_clean_files_save
-# Check that the compiler produces executables we can run. If not, either
-# the compiler is broken, or we cross compile.
-{ echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
-echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; }
-{ echo "$as_me:$LINENO: result: $cross_compiling" >&5
-echo "${ECHO_T}$cross_compiling" >&6; }
-
-{ echo "$as_me:$LINENO: checking for suffix of executables" >&5
-echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; }
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; then
- # If both `conftest.exe' and `conftest' are `present' (well, observable)
-# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will
-# work properly (i.e., refer to `conftest.exe'), while it won't with
-# `rm'.
-for ac_file in conftest.exe conftest conftest.*; do
- test -f "$ac_file" || continue
- case $ac_file in
- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
- *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
- break;;
- * ) break;;
- esac
-done
-else
- { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute suffix of executables: cannot compile and link
-See \`config.log' for more details." >&2;}
- { (exit 1); exit 1; }; }
-fi
-
-rm -f conftest$ac_cv_exeext
-{ echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
-echo "${ECHO_T}$ac_cv_exeext" >&6; }
-
-rm -f conftest.$ac_ext
-EXEEXT=$ac_cv_exeext
-ac_exeext=$EXEEXT
-{ echo "$as_me:$LINENO: checking for suffix of object files" >&5
-echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; }
-if test "${ac_cv_objext+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.o conftest.obj
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; then
- for ac_file in conftest.o conftest.obj conftest.*; do
- test -f "$ac_file" || continue;
- case $ac_file in
- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;;
- *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
- break;;
- esac
-done
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute suffix of object files: cannot compile
-See \`config.log' for more details." >&2;}
- { (exit 1); exit 1; }; }
-fi
-
-rm -f conftest.$ac_cv_objext conftest.$ac_ext
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
-echo "${ECHO_T}$ac_cv_objext" >&6; }
-OBJEXT=$ac_cv_objext
-ac_objext=$OBJEXT
-{ echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
-echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; }
-if test "${ac_cv_c_compiler_gnu+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-int
-main ()
-{
-#ifndef __GNUC__
- choke me
-#endif
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_compiler_gnu=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_compiler_gnu=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-ac_cv_c_compiler_gnu=$ac_compiler_gnu
-
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
-echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; }
-GCC=`test $ac_compiler_gnu = yes && echo yes`
-ac_test_CFLAGS=${CFLAGS+set}
-ac_save_CFLAGS=$CFLAGS
-{ echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
-echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; }
-if test "${ac_cv_prog_cc_g+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_save_c_werror_flag=$ac_c_werror_flag
- ac_c_werror_flag=yes
- ac_cv_prog_cc_g=no
- CFLAGS="-g"
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_prog_cc_g=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- CFLAGS=""
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- :
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_c_werror_flag=$ac_save_c_werror_flag
- CFLAGS="-g"
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_prog_cc_g=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- ac_c_werror_flag=$ac_save_c_werror_flag
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
-echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; }
-if test "$ac_test_CFLAGS" = set; then
- CFLAGS=$ac_save_CFLAGS
-elif test $ac_cv_prog_cc_g = yes; then
- if test "$GCC" = yes; then
- CFLAGS="-g -O2"
- else
- CFLAGS="-g"
- fi
-else
- if test "$GCC" = yes; then
- CFLAGS="-O2"
- else
- CFLAGS=
- fi
-fi
-{ echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5
-echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; }
-if test "${ac_cv_prog_cc_c89+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_cv_prog_cc_c89=no
-ac_save_CC=$CC
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <stdarg.h>
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
-struct buf { int x; };
-FILE * (*rcsopen) (struct buf *, struct stat *, int);
-static char *e (p, i)
- char **p;
- int i;
-{
- return p[i];
-}
-static char *f (char * (*g) (char **, int), char **p, ...)
-{
- char *s;
- va_list v;
- va_start (v,p);
- s = g (p, va_arg (v,int));
- va_end (v);
- return s;
-}
-
-/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
- function prototypes and stuff, but not '\xHH' hex character constants.
- These don't provoke an error unfortunately, instead are silently treated
- as 'x'. The following induces an error, until -std is added to get
- proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
- array size at least. It's necessary to write '\x00'==0 to get something
- that's true only with -std. */
-int osf4_cc_array ['\x00' == 0 ? 1 : -1];
-
-/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
- inside strings and character constants. */
-#define FOO(x) 'x'
-int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
-
-int test (int i, double x);
-struct s1 {int (*f) (int a);};
-struct s2 {int (*f) (double a);};
-int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
-int argc;
-char **argv;
-int
-main ()
-{
-return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
- ;
- return 0;
-}
-_ACEOF
-for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
- -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
-do
- CC="$ac_save_CC $ac_arg"
- rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_prog_cc_c89=$ac_arg
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
-fi
-
-rm -f core conftest.err conftest.$ac_objext
- test "x$ac_cv_prog_cc_c89" != "xno" && break
-done
-rm -f conftest.$ac_ext
-CC=$ac_save_CC
-
-fi
-# AC_CACHE_VAL
-case "x$ac_cv_prog_cc_c89" in
- x)
- { echo "$as_me:$LINENO: result: none needed" >&5
-echo "${ECHO_T}none needed" >&6; } ;;
- xno)
- { echo "$as_me:$LINENO: result: unsupported" >&5
-echo "${ECHO_T}unsupported" >&6; } ;;
- *)
- CC="$CC $ac_cv_prog_cc_c89"
- { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5
-echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;;
-esac
-
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-{ echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
-echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; }
-# On Suns, sometimes $CPP names a directory.
-if test -n "$CPP" && test -d "$CPP"; then
- CPP=
-fi
-if test -z "$CPP"; then
- if test "${ac_cv_prog_CPP+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- # Double quotes because CPP needs to be expanded
- for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
- do
- ac_preproc_ok=false
-for ac_c_preproc_warn_flag in '' yes
-do
- # Use a header file that comes with gcc, so configuring glibc
- # with a fresh cross-compiler works.
- # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- # <limits.h> exists even on freestanding compilers.
- # On the NeXT, cc -E runs the code through the compiler's parser,
- # not just through cpp. "Syntax error" is here to catch this case.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
- Syntax error
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_c_preproc_warn_flag
- ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
- else
- ac_cpp_err=
- fi
-else
- ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
- :
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- # Broken: fails on valid input.
-continue
-fi
-
-rm -f conftest.err conftest.$ac_ext
-
- # OK, works on sane cases. Now check whether nonexistent headers
- # can be detected and how.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <ac_nonexistent.h>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_c_preproc_warn_flag
- ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
- else
- ac_cpp_err=
- fi
-else
- ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
- # Broken: success on invalid input.
-continue
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- # Passes both tests.
-ac_preproc_ok=:
-break
-fi
-
-rm -f conftest.err conftest.$ac_ext
-
-done
-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then
- break
-fi
-
- done
- ac_cv_prog_CPP=$CPP
-
-fi
- CPP=$ac_cv_prog_CPP
-else
- ac_cv_prog_CPP=$CPP
-fi
-{ echo "$as_me:$LINENO: result: $CPP" >&5
-echo "${ECHO_T}$CPP" >&6; }
-ac_preproc_ok=false
-for ac_c_preproc_warn_flag in '' yes
-do
- # Use a header file that comes with gcc, so configuring glibc
- # with a fresh cross-compiler works.
- # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- # <limits.h> exists even on freestanding compilers.
- # On the NeXT, cc -E runs the code through the compiler's parser,
- # not just through cpp. "Syntax error" is here to catch this case.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
- Syntax error
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_c_preproc_warn_flag
- ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
- else
- ac_cpp_err=
- fi
-else
- ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
- :
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- # Broken: fails on valid input.
-continue
-fi
-
-rm -f conftest.err conftest.$ac_ext
-
- # OK, works on sane cases. Now check whether nonexistent headers
- # can be detected and how.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <ac_nonexistent.h>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_c_preproc_warn_flag
- ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
- else
- ac_cpp_err=
- fi
-else
- ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
- # Broken: success on invalid input.
-continue
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- # Passes both tests.
-ac_preproc_ok=:
-break
-fi
-
-rm -f conftest.err conftest.$ac_ext
-
-done
-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then
- :
-else
- { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
-See \`config.log' for more details." >&5
-echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
-See \`config.log' for more details." >&2;}
- { (exit 1); exit 1; }; }
-fi
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
-{ echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5
-echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; }
-if test "${ac_cv_path_GREP+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- # Extract the first word of "grep ggrep" to use in msg output
-if test -z "$GREP"; then
-set dummy grep ggrep; ac_prog_name=$2
-if test "${ac_cv_path_GREP+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_path_GREP_found=false
-# Loop through the user's path and test for each of PROGNAME-LIST
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_prog in grep ggrep; do
- for ac_exec_ext in '' $ac_executable_extensions; do
- ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
- { test -f "$ac_path_GREP" && $as_executable_p "$ac_path_GREP"; } || continue
- # Check for GNU ac_path_GREP and select it if it is found.
- # Check for GNU $ac_path_GREP
-case `"$ac_path_GREP" --version 2>&1` in
-*GNU*)
- ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
-*)
- ac_count=0
- echo $ECHO_N "0123456789$ECHO_C" >"conftest.in"
- while :
- do
- cat "conftest.in" "conftest.in" >"conftest.tmp"
- mv "conftest.tmp" "conftest.in"
- cp "conftest.in" "conftest.nl"
- echo 'GREP' >> "conftest.nl"
- "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
- diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
- ac_count=`expr $ac_count + 1`
- if test $ac_count -gt ${ac_path_GREP_max-0}; then
- # Best one so far, save it but keep looking for a better one
- ac_cv_path_GREP="$ac_path_GREP"
- ac_path_GREP_max=$ac_count
- fi
- # 10*(2^10) chars as input seems more than enough
- test $ac_count -gt 10 && break
- done
- rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
-esac
-
-
- $ac_path_GREP_found && break 3
- done
-done
-
-done
-IFS=$as_save_IFS
-
-
-fi
-
-GREP="$ac_cv_path_GREP"
-if test -z "$GREP"; then
- { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
-echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
- { (exit 1); exit 1; }; }
-fi
-
-else
- ac_cv_path_GREP=$GREP
-fi
-
-
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5
-echo "${ECHO_T}$ac_cv_path_GREP" >&6; }
- GREP="$ac_cv_path_GREP"
-
-
-{ echo "$as_me:$LINENO: checking for egrep" >&5
-echo $ECHO_N "checking for egrep... $ECHO_C" >&6; }
-if test "${ac_cv_path_EGREP+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
- then ac_cv_path_EGREP="$GREP -E"
- else
- # Extract the first word of "egrep" to use in msg output
-if test -z "$EGREP"; then
-set dummy egrep; ac_prog_name=$2
-if test "${ac_cv_path_EGREP+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_path_EGREP_found=false
-# Loop through the user's path and test for each of PROGNAME-LIST
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_prog in egrep; do
- for ac_exec_ext in '' $ac_executable_extensions; do
- ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
- { test -f "$ac_path_EGREP" && $as_executable_p "$ac_path_EGREP"; } || continue
- # Check for GNU ac_path_EGREP and select it if it is found.
- # Check for GNU $ac_path_EGREP
-case `"$ac_path_EGREP" --version 2>&1` in
-*GNU*)
- ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
-*)
- ac_count=0
- echo $ECHO_N "0123456789$ECHO_C" >"conftest.in"
- while :
- do
- cat "conftest.in" "conftest.in" >"conftest.tmp"
- mv "conftest.tmp" "conftest.in"
- cp "conftest.in" "conftest.nl"
- echo 'EGREP' >> "conftest.nl"
- "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
- diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
- ac_count=`expr $ac_count + 1`
- if test $ac_count -gt ${ac_path_EGREP_max-0}; then
- # Best one so far, save it but keep looking for a better one
- ac_cv_path_EGREP="$ac_path_EGREP"
- ac_path_EGREP_max=$ac_count
- fi
- # 10*(2^10) chars as input seems more than enough
- test $ac_count -gt 10 && break
- done
- rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
-esac
-
-
- $ac_path_EGREP_found && break 3
- done
-done
-
-done
-IFS=$as_save_IFS
-
-
-fi
-
-EGREP="$ac_cv_path_EGREP"
-if test -z "$EGREP"; then
- { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
-echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
- { (exit 1); exit 1; }; }
-fi
-
-else
- ac_cv_path_EGREP=$EGREP
-fi
-
-
- fi
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5
-echo "${ECHO_T}$ac_cv_path_EGREP" >&6; }
- EGREP="$ac_cv_path_EGREP"
-
-
-{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5
-echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; }
-if test "${ac_cv_header_stdc+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <stdlib.h>
-#include <stdarg.h>
-#include <string.h>
-#include <float.h>
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_header_stdc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_header_stdc=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-if test $ac_cv_header_stdc = yes; then
- # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <string.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "memchr" >/dev/null 2>&1; then
- :
-else
- ac_cv_header_stdc=no
-fi
-rm -f conftest*
-
-fi
-
-if test $ac_cv_header_stdc = yes; then
- # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <stdlib.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "free" >/dev/null 2>&1; then
- :
-else
- ac_cv_header_stdc=no
-fi
-rm -f conftest*
-
-fi
-
-if test $ac_cv_header_stdc = yes; then
- # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
- if test "$cross_compiling" = yes; then
- :
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <ctype.h>
-#include <stdlib.h>
-#if ((' ' & 0x0FF) == 0x020)
-# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
-# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
-#else
-# define ISLOWER(c) \
- (('a' <= (c) && (c) <= 'i') \
- || ('j' <= (c) && (c) <= 'r') \
- || ('s' <= (c) && (c) <= 'z'))
-# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
-#endif
-
-#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
-int
-main ()
-{
- int i;
- for (i = 0; i < 256; i++)
- if (XOR (islower (i), ISLOWER (i))
- || toupper (i) != TOUPPER (i))
- return 2;
- return 0;
-}
-_ACEOF
-rm -f conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- :
-else
- echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-( exit $ac_status )
-ac_cv_header_stdc=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-
-
-fi
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
-echo "${ECHO_T}$ac_cv_header_stdc" >&6; }
-if test $ac_cv_header_stdc = yes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define STDC_HEADERS 1
-_ACEOF
-
-fi
-
-# On IRIX 5.3, sys/types and inttypes.h are conflicting.
-
-
-
-
-
-
-
-
-
-for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
- inttypes.h stdint.h unistd.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- eval "$as_ac_Header=yes"
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- eval "$as_ac_Header=no"
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-
-{ echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5
-echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6; }
-if test "${ac_cv_c_bigendian+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- # See if sys/param.h defines the BYTE_ORDER macro.
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <sys/types.h>
-#include <sys/param.h>
-
-int
-main ()
-{
-#if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
- bogus endian macros
-#endif
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- # It does; now see whether it defined to BIG_ENDIAN or not.
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <sys/types.h>
-#include <sys/param.h>
-
-int
-main ()
-{
-#if BYTE_ORDER != BIG_ENDIAN
- not big endian
-#endif
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_c_bigendian=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_c_bigendian=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- # It does not; compile a test program.
-if test "$cross_compiling" = yes; then
- # try to guess the endianness by grepping values into an object file
- ac_cv_c_bigendian=unknown
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-short int ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
-short int ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
-void _ascii () { char *s = (char *) ascii_mm; s = (char *) ascii_ii; }
-short int ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
-short int ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
-void _ebcdic () { char *s = (char *) ebcdic_mm; s = (char *) ebcdic_ii; }
-int
-main ()
-{
- _ascii (); _ebcdic ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- if grep BIGenDianSyS conftest.$ac_objext >/dev/null ; then
- ac_cv_c_bigendian=yes
-fi
-if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then
- if test "$ac_cv_c_bigendian" = unknown; then
- ac_cv_c_bigendian=no
- else
- # finding both strings is unlikely to happen, but who knows?
- ac_cv_c_bigendian=unknown
- fi
-fi
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-int
-main ()
-{
-
- /* Are we little or big endian? From Harbison&Steele. */
- union
- {
- long int l;
- char c[sizeof (long int)];
- } u;
- u.l = 1;
- return u.c[sizeof (long int) - 1] == 1;
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_c_bigendian=no
-else
- echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-( exit $ac_status )
-ac_cv_c_bigendian=yes
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-
-
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5
-echo "${ECHO_T}$ac_cv_c_bigendian" >&6; }
-case $ac_cv_c_bigendian in
- yes)
- ENDIAN=big
- ;;
- no)
- ENDIAN=little
- ;;
- *)
- { { echo "$as_me:$LINENO: error: unknown endianness
-presetting ac_cv_c_bigendian=no (or yes) will help" >&5
-echo "$as_me: error: unknown endianness
-presetting ac_cv_c_bigendian=no (or yes) will help" >&2;}
- { (exit 1); exit 1; }; } ;;
-esac
-
-
-if test "$cross_compiling" = yes; then
- LLVM_CROSS_COMPILING=1
-
-
-{ echo "$as_me:$LINENO: checking for executable suffix on build platform" >&5
-echo $ECHO_N "checking for executable suffix on build platform... $ECHO_C" >&6; }
-if test "${ac_cv_build_exeext+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test "$CYGWIN" = yes || test "$MINGW32" = yes; then
- ac_cv_build_exeext=.exe
-else
- ac_build_prefix=${build_alias}-
-
- # Extract the first word of "${ac_build_prefix}gcc", so it can be a program name with args.
-set dummy ${ac_build_prefix}gcc; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_BUILD_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$BUILD_CC"; then
- ac_cv_prog_BUILD_CC="$BUILD_CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_BUILD_CC="${ac_build_prefix}gcc"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
-fi
-fi
-BUILD_CC=$ac_cv_prog_BUILD_CC
-if test -n "$BUILD_CC"; then
- { echo "$as_me:$LINENO: result: $BUILD_CC" >&5
-echo "${ECHO_T}$BUILD_CC" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-
- if test -z "$BUILD_CC"; then
- # Extract the first word of "gcc", so it can be a program name with args.
-set dummy gcc; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_BUILD_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$BUILD_CC"; then
- ac_cv_prog_BUILD_CC="$BUILD_CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_BUILD_CC="gcc"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
-fi
-fi
-BUILD_CC=$ac_cv_prog_BUILD_CC
-if test -n "$BUILD_CC"; then
- { echo "$as_me:$LINENO: result: $BUILD_CC" >&5
-echo "${ECHO_T}$BUILD_CC" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-
- if test -z "$BUILD_CC"; then
- # Extract the first word of "cc", so it can be a program name with args.
-set dummy cc; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_BUILD_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$BUILD_CC"; then
- ac_cv_prog_BUILD_CC="$BUILD_CC" # Let the user override the test.
-else
- ac_prog_rejected=no
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
- if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
- ac_prog_rejected=yes
- continue
- fi
- ac_cv_prog_BUILD_CC="cc"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
-if test $ac_prog_rejected = yes; then
- # We found a bogon in the path, so make sure we never use it.
- set dummy $ac_cv_prog_BUILD_CC
- shift
- if test $# != 0; then
- # We chose a different compiler from the bogus one.
- # However, it has the same basename, so the bogon will be chosen
- # first if we set BUILD_CC to just the basename; use the full file name.
- shift
- ac_cv_prog_BUILD_CC="$as_dir/$ac_word${1+' '}$@"
- fi
-fi
-fi
-fi
-BUILD_CC=$ac_cv_prog_BUILD_CC
-if test -n "$BUILD_CC"; then
- { echo "$as_me:$LINENO: result: $BUILD_CC" >&5
-echo "${ECHO_T}$BUILD_CC" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-
- fi
- fi
- test -z "$BUILD_CC" && { { echo "$as_me:$LINENO: error: no acceptable cc found in \$PATH" >&5
-echo "$as_me: error: no acceptable cc found in \$PATH" >&2;}
- { (exit 1); exit 1; }; }
- ac_build_link='${BUILD_CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
- rm -f conftest*
- echo 'int main () { return 0; }' > conftest.$ac_ext
- ac_cv_build_exeext=
- if { (eval echo "$as_me:$LINENO: \"$ac_build_link\"") >&5
- (eval $ac_build_link) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; then
- for file in conftest.*; do
- case $file in
- *.c | *.o | *.obj) ;;
- *) ac_cv_build_exeext=`echo $file | sed -e s/conftest//` ;;
- esac
- done
- else
- { { echo "$as_me:$LINENO: error: installation or configuration problem: compiler cannot create executables." >&5
-echo "$as_me: error: installation or configuration problem: compiler cannot create executables." >&2;}
- { (exit 1); exit 1; }; }
- fi
- rm -f conftest*
- test x"${ac_cv_build_exeext}" = x && ac_cv_build_exeext=blank
-fi
-fi
-
-BUILD_EXEEXT=""
-test x"${ac_cv_build_exeext}" != xblank && BUILD_EXEEXT=${ac_cv_build_exeext}
-{ echo "$as_me:$LINENO: result: ${ac_cv_build_exeext}" >&5
-echo "${ECHO_T}${ac_cv_build_exeext}" >&6; }
-ac_build_exeext=$BUILD_EXEEXT
-
-else
- LLVM_CROSS_COMPILING=0
-
-fi
-
-if test -d "CVS" -o -d "${srcdir}/CVS" -o -d ".svn" -o -d "${srcdir}/.svn"; then
- cvsbuild="yes"
- optimize="no"
- CVSBUILD=CVSBUILD=1
-
-else
- cvsbuild="no"
- optimize="yes"
-fi
-
-
-# Check whether --enable-optimized was given.
-if test "${enable_optimized+set}" = set; then
- enableval=$enable_optimized;
-else
- enableval=$optimize
-fi
-
-if test ${enableval} = "no" ; then
- ENABLE_OPTIMIZED=
-
-else
- ENABLE_OPTIMIZED=ENABLE_OPTIMIZED=1
-
-fi
-
-# Check whether --enable-assertions was given.
-if test "${enable_assertions+set}" = set; then
- enableval=$enable_assertions;
-else
- enableval="yes"
-fi
-
-if test ${enableval} = "yes" ; then
- DISABLE_ASSERTIONS=
-
-else
- DISABLE_ASSERTIONS=DISABLE_ASSERTIONS=1
-
-fi
-
-# Check whether --enable-expensive-checks was given.
-if test "${enable_expensive_checks+set}" = set; then
- enableval=$enable_expensive_checks;
-else
- enableval="no"
-fi
-
-if test ${enableval} = "yes" ; then
- ENABLE_EXPENSIVE_CHECKS=ENABLE_EXPENSIVE_CHECKS=1
-
- EXPENSIVE_CHECKS=yes
-
-else
- ENABLE_EXPENSIVE_CHECKS=
-
- EXPENSIVE_CHECKS=no
-
-fi
-
-# Check whether --enable-debug-runtime was given.
-if test "${enable_debug_runtime+set}" = set; then
- enableval=$enable_debug_runtime;
-else
- enableval=no
-fi
-
-if test ${enableval} = "no" ; then
- DEBUG_RUNTIME=
-
-else
- DEBUG_RUNTIME=DEBUG_RUNTIME=1
-
-fi
-
-# Check whether --enable-jit was given.
-if test "${enable_jit+set}" = set; then
- enableval=$enable_jit;
-else
- enableval=default
-fi
-
-if test ${enableval} = "no"
-then
- JIT=
-
-else
- case "$llvm_cv_target_arch" in
- x86) TARGET_HAS_JIT=1
- ;;
- Sparc) TARGET_HAS_JIT=0
- ;;
- PowerPC) TARGET_HAS_JIT=1
- ;;
- x86_64) TARGET_HAS_JIT=1
- ;;
- Alpha) TARGET_HAS_JIT=1
- ;;
- IA64) TARGET_HAS_JIT=0
- ;;
- ARM) TARGET_HAS_JIT=0
- ;;
- Mips) TARGET_HAS_JIT=0
- ;;
- *) TARGET_HAS_JIT=0
- ;;
- esac
-fi
-
-# Check whether --enable-doxygen was given.
-if test "${enable_doxygen+set}" = set; then
- enableval=$enable_doxygen;
-else
- enableval=default
-fi
-
-case "$enableval" in
- yes) ENABLE_DOXYGEN=1
- ;;
- no) ENABLE_DOXYGEN=0
- ;;
- default) ENABLE_DOXYGEN=0
- ;;
- *) { { echo "$as_me:$LINENO: error: Invalid setting for --enable-doxygen. Use \"yes\" or \"no\"" >&5
-echo "$as_me: error: Invalid setting for --enable-doxygen. Use \"yes\" or \"no\"" >&2;}
- { (exit 1); exit 1; }; } ;;
-esac
-
-# Check whether --enable-threads was given.
-if test "${enable_threads+set}" = set; then
- enableval=$enable_threads;
-else
- enableval=default
-fi
-
-case "$enableval" in
- yes) ENABLE_THREADS=1
- ;;
- no) ENABLE_THREADS=0
- ;;
- default) ENABLE_THREADS=1
- ;;
- *) { { echo "$as_me:$LINENO: error: Invalid setting for --enable-threads. Use \"yes\" or \"no\"" >&5
-echo "$as_me: error: Invalid setting for --enable-threads. Use \"yes\" or \"no\"" >&2;}
- { (exit 1); exit 1; }; } ;;
-esac
-
-cat >>confdefs.h <<_ACEOF
-#define ENABLE_THREADS $ENABLE_THREADS
-_ACEOF
-
-
-# Check whether --enable-pic was given.
-if test "${enable_pic+set}" = set; then
- enableval=$enable_pic;
-else
- enableval=default
-fi
-
-case "$enableval" in
- yes) ENABLE_PIC=1
- ;;
- no) ENABLE_PIC=0
- ;;
- default) ENABLE_PIC=0
- ;;
- *) { { echo "$as_me:$LINENO: error: Invalid setting for --enable-pic. Use \"yes\" or \"no\"" >&5
-echo "$as_me: error: Invalid setting for --enable-pic. Use \"yes\" or \"no\"" >&2;}
- { (exit 1); exit 1; }; } ;;
-esac
-
-cat >>confdefs.h <<_ACEOF
-#define ENABLE_PIC $ENABLE_PIC
-_ACEOF
-
-
-TARGETS_TO_BUILD=""
-# Check whether --enable-targets was given.
-if test "${enable_targets+set}" = set; then
- enableval=$enable_targets;
-else
- enableval=all
-fi
-
-case "$enableval" in
- all) TARGETS_TO_BUILD="X86 Sparc PowerPC Alpha IA64 ARM Mips CellSPU CBackend MSIL CppBackend" ;;
- host-only)
- case "$llvm_cv_target_arch" in
- x86) TARGETS_TO_BUILD="X86" ;;
- x86_64) TARGETS_TO_BUILD="X86" ;;
- Sparc) TARGETS_TO_BUILD="Sparc" ;;
- PowerPC) TARGETS_TO_BUILD="PowerPC" ;;
- Alpha) TARGETS_TO_BUILD="Alpha" ;;
- IA64) TARGETS_TO_BUILD="IA64" ;;
- ARM) TARGETS_TO_BUILD="ARM" ;;
- Mips) TARGETS_TO_BUILD="Mips" ;;
- CellSPU|SPU) TARGETS_TO_BUILD="CellSPU" ;;
- *) { { echo "$as_me:$LINENO: error: Can not set target to build" >&5
-echo "$as_me: error: Can not set target to build" >&2;}
- { (exit 1); exit 1; }; } ;;
- esac
- ;;
- *)for a_target in `echo $enableval|sed -e 's/,/ /g' ` ; do
- case "$a_target" in
- x86) TARGETS_TO_BUILD="X86 $TARGETS_TO_BUILD" ;;
- x86_64) TARGETS_TO_BUILD="X86 $TARGETS_TO_BUILD" ;;
- sparc) TARGETS_TO_BUILD="Sparc $TARGETS_TO_BUILD" ;;
- powerpc) TARGETS_TO_BUILD="PowerPC $TARGETS_TO_BUILD" ;;
- alpha) TARGETS_TO_BUILD="Alpha $TARGETS_TO_BUILD" ;;
- ia64) TARGETS_TO_BUILD="IA64 $TARGETS_TO_BUILD" ;;
- arm) TARGETS_TO_BUILD="ARM $TARGETS_TO_BUILD" ;;
- mips) TARGETS_TO_BUILD="Mips $TARGETS_TO_BUILD" ;;
- spu) TARGETS_TO_BUILD="CellSPU $TARGETS_TO_BUILD" ;;
- cbe) TARGETS_TO_BUILD="CBackend $TARGETS_TO_BUILD" ;;
- msil) TARGETS_TO_BUILD="MSIL $TARGETS_TO_BUILD" ;;
- cpp) TARGETS_TO_BUILD="CppBackend $TARGETS_TO_BUILD" ;;
- *) { { echo "$as_me:$LINENO: error: Unrecognized target $a_target" >&5
-echo "$as_me: error: Unrecognized target $a_target" >&2;}
- { (exit 1); exit 1; }; } ;;
- esac
- done
- ;;
-esac
-TARGETS_TO_BUILD=$TARGETS_TO_BUILD
-
-
-# Check whether --enable-cbe-printf-a was given.
-if test "${enable_cbe_printf_a+set}" = set; then
- enableval=$enable_cbe_printf_a;
-else
- enableval=default
-fi
-
-case "$enableval" in
- yes) ENABLE_CBE_PRINTF_A=1
- ;;
- no) ENABLE_CBE_PRINTF_A=0
- ;;
- default) ENABLE_CBE_PRINTF_A=1
- ;;
- *) { { echo "$as_me:$LINENO: error: Invalid setting for --enable-cbe-printf-a. Use \"yes\" or \"no\"" >&5
-echo "$as_me: error: Invalid setting for --enable-cbe-printf-a. Use \"yes\" or \"no\"" >&2;}
- { (exit 1); exit 1; }; } ;;
-esac
-
-cat >>confdefs.h <<_ACEOF
-#define ENABLE_CBE_PRINTF_A $ENABLE_CBE_PRINTF_A
-_ACEOF
-
-
-
-# Check whether --with-llvmgccdir was given.
-if test "${with_llvmgccdir+set}" = set; then
- withval=$with_llvmgccdir;
-else
- withval=default
-fi
-
-case "$withval" in
- default) WITH_LLVMGCCDIR=default ;;
- /* | [A-Za-z]:[\\/]*) WITH_LLVMGCCDIR=$withval ;;
- *) { { echo "$as_me:$LINENO: error: Invalid path for --with-llvmgccdir. Provide full path" >&5
-echo "$as_me: error: Invalid path for --with-llvmgccdir. Provide full path" >&2;}
- { (exit 1); exit 1; }; } ;;
-esac
-
-
-# Check whether --with-llvmgcc was given.
-if test "${with_llvmgcc+set}" = set; then
- withval=$with_llvmgcc; LLVMGCC=$with_llvmgcc
- WITH_LLVMGCCDIR=""
-fi
-
-
-
-# Check whether --with-llvmgxx was given.
-if test "${with_llvmgxx+set}" = set; then
- withval=$with_llvmgxx; LLVMGXX=$with_llvmgxx
- WITH_LLVMGCCDIR=""
-fi
-
-
-if test -n "$LLVMGCC" && test -z "$LLVMGXX"; then
- { { echo "$as_me:$LINENO: error: Invalid llvm-g++. Use --with-llvmgxx when --with-llvmgcc is used" >&5
-echo "$as_me: error: Invalid llvm-g++. Use --with-llvmgxx when --with-llvmgcc is used" >&2;}
- { (exit 1); exit 1; }; };
-fi
-
-if test -n "$LLVMGXX" && test -z "$LLVMGCC"; then
- { { echo "$as_me:$LINENO: error: Invalid llvm-gcc. Use --with-llvmgcc when --with-llvmgxx is used" >&5
-echo "$as_me: error: Invalid llvm-gcc. Use --with-llvmgcc when --with-llvmgxx is used" >&2;}
- { (exit 1); exit 1; }; };
-fi
-
-
-# Check whether --with-extra-options was given.
-if test "${with_extra_options+set}" = set; then
- withval=$with_extra_options;
-else
- withval=default
-fi
-
-case "$withval" in
- default) EXTRA_OPTIONS= ;;
- *) EXTRA_OPTIONS=$withval ;;
-esac
-EXTRA_OPTIONS=$EXTRA_OPTIONS
-
-
-# Check whether --enable-bindings was given.
-if test "${enable_bindings+set}" = set; then
- enableval=$enable_bindings;
-else
- enableval=default
-fi
-
-BINDINGS_TO_BUILD=""
-case "$enableval" in
- yes | default | auto) BINDINGS_TO_BUILD="auto" ;;
- all ) BINDINGS_TO_BUILD="ocaml" ;;
- none | no) BINDINGS_TO_BUILD="" ;;
- *)for a_binding in `echo $enableval|sed -e 's/,/ /g' ` ; do
- case "$a_binding" in
- ocaml) BINDINGS_TO_BUILD="ocaml $BINDINGS_TO_BUILD" ;;
- *) { { echo "$as_me:$LINENO: error: Unrecognized binding $a_binding" >&5
-echo "$as_me: error: Unrecognized binding $a_binding" >&2;}
- { (exit 1); exit 1; }; } ;;
- esac
- done
- ;;
-esac
-
-
-# Check whether --with-ocaml-libdir was given.
-if test "${with_ocaml_libdir+set}" = set; then
- withval=$with_ocaml_libdir;
-else
- withval=auto
-fi
-
-case "$withval" in
- auto) with_ocaml_libdir="$withval" ;;
- /* | [A-Za-z]:[\\/]*) with_ocaml_libdir="$withval" ;;
- *) { { echo "$as_me:$LINENO: error: Invalid path for --with-ocaml-libdir. Provide full path" >&5
-echo "$as_me: error: Invalid path for --with-ocaml-libdir. Provide full path" >&2;}
- { (exit 1); exit 1; }; } ;;
-esac
-
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-{ echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
-echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; }
-# On Suns, sometimes $CPP names a directory.
-if test -n "$CPP" && test -d "$CPP"; then
- CPP=
-fi
-if test -z "$CPP"; then
- if test "${ac_cv_prog_CPP+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- # Double quotes because CPP needs to be expanded
- for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
- do
- ac_preproc_ok=false
-for ac_c_preproc_warn_flag in '' yes
-do
- # Use a header file that comes with gcc, so configuring glibc
- # with a fresh cross-compiler works.
- # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- # <limits.h> exists even on freestanding compilers.
- # On the NeXT, cc -E runs the code through the compiler's parser,
- # not just through cpp. "Syntax error" is here to catch this case.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
- Syntax error
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_c_preproc_warn_flag
- ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
- else
- ac_cpp_err=
- fi
-else
- ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
- :
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- # Broken: fails on valid input.
-continue
-fi
-
-rm -f conftest.err conftest.$ac_ext
-
- # OK, works on sane cases. Now check whether nonexistent headers
- # can be detected and how.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <ac_nonexistent.h>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_c_preproc_warn_flag
- ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
- else
- ac_cpp_err=
- fi
-else
- ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
- # Broken: success on invalid input.
-continue
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- # Passes both tests.
-ac_preproc_ok=:
-break
-fi
-
-rm -f conftest.err conftest.$ac_ext
-
-done
-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then
- break
-fi
-
- done
- ac_cv_prog_CPP=$CPP
-
-fi
- CPP=$ac_cv_prog_CPP
-else
- ac_cv_prog_CPP=$CPP
-fi
-{ echo "$as_me:$LINENO: result: $CPP" >&5
-echo "${ECHO_T}$CPP" >&6; }
-ac_preproc_ok=false
-for ac_c_preproc_warn_flag in '' yes
-do
- # Use a header file that comes with gcc, so configuring glibc
- # with a fresh cross-compiler works.
- # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- # <limits.h> exists even on freestanding compilers.
- # On the NeXT, cc -E runs the code through the compiler's parser,
- # not just through cpp. "Syntax error" is here to catch this case.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
- Syntax error
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_c_preproc_warn_flag
- ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
- else
- ac_cpp_err=
- fi
-else
- ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
- :
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- # Broken: fails on valid input.
-continue
-fi
-
-rm -f conftest.err conftest.$ac_ext
-
- # OK, works on sane cases. Now check whether nonexistent headers
- # can be detected and how.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <ac_nonexistent.h>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_c_preproc_warn_flag
- ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
- else
- ac_cpp_err=
- fi
-else
- ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
- # Broken: success on invalid input.
-continue
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- # Passes both tests.
-ac_preproc_ok=:
-break
-fi
-
-rm -f conftest.err conftest.$ac_ext
-
-done
-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then
- :
-else
- { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
-See \`config.log' for more details." >&5
-echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
-See \`config.log' for more details." >&2;}
- { (exit 1); exit 1; }; }
-fi
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-if test -n "$ac_tool_prefix"; then
- for ac_prog in gcc
- do
- # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
-set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
- { echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-
- test -n "$CC" && break
- done
-fi
-if test -z "$CC"; then
- ac_ct_CC=$CC
- for ac_prog in gcc
-do
- # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$ac_ct_CC"; then
- ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_ac_ct_CC="$ac_prog"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_CC=$ac_cv_prog_ac_ct_CC
-if test -n "$ac_ct_CC"; then
- { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
-echo "${ECHO_T}$ac_ct_CC" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-
- test -n "$ac_ct_CC" && break
-done
-
- if test "x$ac_ct_CC" = x; then
- CC=""
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&5
-echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&2;}
-ac_tool_warned=yes ;;
-esac
- CC=$ac_ct_CC
- fi
-fi
-
-
-test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
-See \`config.log' for more details." >&5
-echo "$as_me: error: no acceptable C compiler found in \$PATH
-See \`config.log' for more details." >&2;}
- { (exit 1); exit 1; }; }
-
-# Provide some information about the compiler.
-echo "$as_me:$LINENO: checking for C compiler version" >&5
-ac_compiler=`set X $ac_compile; echo $2`
-{ (ac_try="$ac_compiler --version >&5"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compiler --version >&5") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }
-{ (ac_try="$ac_compiler -v >&5"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compiler -v >&5") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }
-{ (ac_try="$ac_compiler -V >&5"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compiler -V >&5") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }
-
-{ echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
-echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; }
-if test "${ac_cv_c_compiler_gnu+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-int
-main ()
-{
-#ifndef __GNUC__
- choke me
-#endif
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_compiler_gnu=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_compiler_gnu=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-ac_cv_c_compiler_gnu=$ac_compiler_gnu
-
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
-echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; }
-GCC=`test $ac_compiler_gnu = yes && echo yes`
-ac_test_CFLAGS=${CFLAGS+set}
-ac_save_CFLAGS=$CFLAGS
-{ echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
-echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; }
-if test "${ac_cv_prog_cc_g+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_save_c_werror_flag=$ac_c_werror_flag
- ac_c_werror_flag=yes
- ac_cv_prog_cc_g=no
- CFLAGS="-g"
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_prog_cc_g=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- CFLAGS=""
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- :
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_c_werror_flag=$ac_save_c_werror_flag
- CFLAGS="-g"
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_prog_cc_g=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- ac_c_werror_flag=$ac_save_c_werror_flag
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
-echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; }
-if test "$ac_test_CFLAGS" = set; then
- CFLAGS=$ac_save_CFLAGS
-elif test $ac_cv_prog_cc_g = yes; then
- if test "$GCC" = yes; then
- CFLAGS="-g -O2"
- else
- CFLAGS="-g"
- fi
-else
- if test "$GCC" = yes; then
- CFLAGS="-O2"
- else
- CFLAGS=
- fi
-fi
-{ echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5
-echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; }
-if test "${ac_cv_prog_cc_c89+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_cv_prog_cc_c89=no
-ac_save_CC=$CC
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <stdarg.h>
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
-struct buf { int x; };
-FILE * (*rcsopen) (struct buf *, struct stat *, int);
-static char *e (p, i)
- char **p;
- int i;
-{
- return p[i];
-}
-static char *f (char * (*g) (char **, int), char **p, ...)
-{
- char *s;
- va_list v;
- va_start (v,p);
- s = g (p, va_arg (v,int));
- va_end (v);
- return s;
-}
-
-/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
- function prototypes and stuff, but not '\xHH' hex character constants.
- These don't provoke an error unfortunately, instead are silently treated
- as 'x'. The following induces an error, until -std is added to get
- proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
- array size at least. It's necessary to write '\x00'==0 to get something
- that's true only with -std. */
-int osf4_cc_array ['\x00' == 0 ? 1 : -1];
-
-/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
- inside strings and character constants. */
-#define FOO(x) 'x'
-int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
-
-int test (int i, double x);
-struct s1 {int (*f) (int a);};
-struct s2 {int (*f) (double a);};
-int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
-int argc;
-char **argv;
-int
-main ()
-{
-return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
- ;
- return 0;
-}
-_ACEOF
-for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
- -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
-do
- CC="$ac_save_CC $ac_arg"
- rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_prog_cc_c89=$ac_arg
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
-fi
-
-rm -f core conftest.err conftest.$ac_objext
- test "x$ac_cv_prog_cc_c89" != "xno" && break
-done
-rm -f conftest.$ac_ext
-CC=$ac_save_CC
-
-fi
-# AC_CACHE_VAL
-case "x$ac_cv_prog_cc_c89" in
- x)
- { echo "$as_me:$LINENO: result: none needed" >&5
-echo "${ECHO_T}none needed" >&6; } ;;
- xno)
- { echo "$as_me:$LINENO: result: unsupported" >&5
-echo "${ECHO_T}unsupported" >&6; } ;;
- *)
- CC="$CC $ac_cv_prog_cc_c89"
- { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5
-echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;;
-esac
-
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-ac_ext=cpp
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-if test -z "$CXX"; then
- if test -n "$CCC"; then
- CXX=$CCC
- else
- if test -n "$ac_tool_prefix"; then
- for ac_prog in g++
- do
- # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
-set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_CXX+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$CXX"; then
- ac_cv_prog_CXX="$CXX" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_CXX="$ac_tool_prefix$ac_prog"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
-fi
-fi
-CXX=$ac_cv_prog_CXX
-if test -n "$CXX"; then
- { echo "$as_me:$LINENO: result: $CXX" >&5
-echo "${ECHO_T}$CXX" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-
- test -n "$CXX" && break
- done
-fi
-if test -z "$CXX"; then
- ac_ct_CXX=$CXX
- for ac_prog in g++
-do
- # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$ac_ct_CXX"; then
- ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_ac_ct_CXX="$ac_prog"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_CXX=$ac_cv_prog_ac_ct_CXX
-if test -n "$ac_ct_CXX"; then
- { echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5
-echo "${ECHO_T}$ac_ct_CXX" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-
- test -n "$ac_ct_CXX" && break
-done
-
- if test "x$ac_ct_CXX" = x; then
- CXX="g++"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&5
-echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&2;}
-ac_tool_warned=yes ;;
-esac
- CXX=$ac_ct_CXX
- fi
-fi
-
- fi
-fi
-# Provide some information about the compiler.
-echo "$as_me:$LINENO: checking for C++ compiler version" >&5
-ac_compiler=`set X $ac_compile; echo $2`
-{ (ac_try="$ac_compiler --version >&5"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compiler --version >&5") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }
-{ (ac_try="$ac_compiler -v >&5"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compiler -v >&5") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }
-{ (ac_try="$ac_compiler -V >&5"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compiler -V >&5") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }
-
-{ echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5
-echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6; }
-if test "${ac_cv_cxx_compiler_gnu+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-int
-main ()
-{
-#ifndef __GNUC__
- choke me
-#endif
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_compiler_gnu=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_compiler_gnu=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-ac_cv_cxx_compiler_gnu=$ac_compiler_gnu
-
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5
-echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6; }
-GXX=`test $ac_compiler_gnu = yes && echo yes`
-ac_test_CXXFLAGS=${CXXFLAGS+set}
-ac_save_CXXFLAGS=$CXXFLAGS
-{ echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5
-echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6; }
-if test "${ac_cv_prog_cxx_g+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_save_cxx_werror_flag=$ac_cxx_werror_flag
- ac_cxx_werror_flag=yes
- ac_cv_prog_cxx_g=no
- CXXFLAGS="-g"
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_prog_cxx_g=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- CXXFLAGS=""
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- :
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cxx_werror_flag=$ac_save_cxx_werror_flag
- CXXFLAGS="-g"
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_prog_cxx_g=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- ac_cxx_werror_flag=$ac_save_cxx_werror_flag
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5
-echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6; }
-if test "$ac_test_CXXFLAGS" = set; then
- CXXFLAGS=$ac_save_CXXFLAGS
-elif test $ac_cv_prog_cxx_g = yes; then
- if test "$GXX" = yes; then
- CXXFLAGS="-g -O2"
- else
- CXXFLAGS="-g"
- fi
-else
- if test "$GXX" = yes; then
- CXXFLAGS="-O2"
- else
- CXXFLAGS=
- fi
-fi
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-{ echo "$as_me:$LINENO: checking " >&5
-echo $ECHO_N "checking ... $ECHO_C" >&6; }
-if test "${ac_cv_has_flex+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- for ac_prog in flex lex
-do
- # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_LEX+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$LEX"; then
- ac_cv_prog_LEX="$LEX" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_LEX="$ac_prog"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
-fi
-fi
-LEX=$ac_cv_prog_LEX
-if test -n "$LEX"; then
- { echo "$as_me:$LINENO: result: $LEX" >&5
-echo "${ECHO_T}$LEX" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-
- test -n "$LEX" && break
-done
-test -n "$LEX" || LEX=":"
-
-if test -z "$LEXLIB"
-then
- { echo "$as_me:$LINENO: checking for yywrap in -lfl" >&5
-echo $ECHO_N "checking for yywrap in -lfl... $ECHO_C" >&6; }
-if test "${ac_cv_lib_fl_yywrap+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lfl $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char yywrap ();
-int
-main ()
-{
-return yywrap ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_lib_fl_yywrap=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_lib_fl_yywrap=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_fl_yywrap" >&5
-echo "${ECHO_T}$ac_cv_lib_fl_yywrap" >&6; }
-if test $ac_cv_lib_fl_yywrap = yes; then
- LEXLIB="-lfl"
-else
- { echo "$as_me:$LINENO: checking for yywrap in -ll" >&5
-echo $ECHO_N "checking for yywrap in -ll... $ECHO_C" >&6; }
-if test "${ac_cv_lib_l_yywrap+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-ll $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char yywrap ();
-int
-main ()
-{
-return yywrap ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_lib_l_yywrap=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_lib_l_yywrap=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_l_yywrap" >&5
-echo "${ECHO_T}$ac_cv_lib_l_yywrap" >&6; }
-if test $ac_cv_lib_l_yywrap = yes; then
- LEXLIB="-ll"
-fi
-
-fi
-
-fi
-
-if test "x$LEX" != "x:"; then
- { echo "$as_me:$LINENO: checking lex output file root" >&5
-echo $ECHO_N "checking lex output file root... $ECHO_C" >&6; }
-if test "${ac_cv_prog_lex_root+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- # The minimal lex program is just a single line: %%. But some broken lexes
-# (Solaris, I think it was) want two %% lines, so accommodate them.
-cat >conftest.l <<_ACEOF
-%%
-%%
-_ACEOF
-{ (ac_try="$LEX conftest.l"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$LEX conftest.l") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }
-if test -f lex.yy.c; then
- ac_cv_prog_lex_root=lex.yy
-elif test -f lexyy.c; then
- ac_cv_prog_lex_root=lexyy
-else
- { { echo "$as_me:$LINENO: error: cannot find output from $LEX; giving up" >&5
-echo "$as_me: error: cannot find output from $LEX; giving up" >&2;}
- { (exit 1); exit 1; }; }
-fi
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_prog_lex_root" >&5
-echo "${ECHO_T}$ac_cv_prog_lex_root" >&6; }
-rm -f conftest.l
-LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root
-
-{ echo "$as_me:$LINENO: checking whether yytext is a pointer" >&5
-echo $ECHO_N "checking whether yytext is a pointer... $ECHO_C" >&6; }
-if test "${ac_cv_prog_lex_yytext_pointer+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- # POSIX says lex can declare yytext either as a pointer or an array; the
-# default is implementation-dependent. Figure out which it is, since
-# not all implementations provide the %pointer and %array declarations.
-ac_cv_prog_lex_yytext_pointer=no
-echo 'extern char *yytext;' >>$LEX_OUTPUT_ROOT.c
-ac_save_LIBS=$LIBS
-LIBS="$LIBS $LEXLIB"
-cat >conftest.$ac_ext <<_ACEOF
-`cat $LEX_OUTPUT_ROOT.c`
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_prog_lex_yytext_pointer=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
-fi
-
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_save_LIBS
-rm -f "${LEX_OUTPUT_ROOT}.c"
-
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_prog_lex_yytext_pointer" >&5
-echo "${ECHO_T}$ac_cv_prog_lex_yytext_pointer" >&6; }
-if test $ac_cv_prog_lex_yytext_pointer = yes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define YYTEXT_POINTER 1
-_ACEOF
-
-fi
-
-fi
-
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_has_flex" >&5
-echo "${ECHO_T}$ac_cv_has_flex" >&6; }
-if test "$LEX" != "flex"; then
- { { echo "$as_me:$LINENO: error: flex not found but required" >&5
-echo "$as_me: error: flex not found but required" >&2;}
- { (exit 1); exit 1; }; }
-else
- FLEX=flex
-
-fi
-
-{ echo "$as_me:$LINENO: checking " >&5
-echo $ECHO_N "checking ... $ECHO_C" >&6; }
-if test "${llvm_cv_has_bison+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- for ac_prog in 'bison -y' byacc
-do
- # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_YACC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$YACC"; then
- ac_cv_prog_YACC="$YACC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_YACC="$ac_prog"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
-fi
-fi
-YACC=$ac_cv_prog_YACC
-if test -n "$YACC"; then
- { echo "$as_me:$LINENO: result: $YACC" >&5
-echo "${ECHO_T}$YACC" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-
- test -n "$YACC" && break
-done
-test -n "$YACC" || YACC="yacc"
-
-fi
-{ echo "$as_me:$LINENO: result: $llvm_cv_has_bison" >&5
-echo "${ECHO_T}$llvm_cv_has_bison" >&6; }
-if test "$YACC" != "bison -y"; then
-
- { echo "$as_me:$LINENO: WARNING: bison not found, can't rebuild grammars" >&5
-echo "$as_me: WARNING: bison not found, can't rebuild grammars" >&2;}
-else
- BISON=bison
-
-fi
-
-{ echo "$as_me:$LINENO: checking for BSD-compatible nm" >&5
-echo $ECHO_N "checking for BSD-compatible nm... $ECHO_C" >&6; }
-if test "${lt_cv_path_NM+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$NM"; then
- # Let the user override the test.
- lt_cv_path_NM="$NM"
-else
- lt_nm_to_check="${ac_tool_prefix}nm"
- if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
- lt_nm_to_check="$lt_nm_to_check nm"
- fi
- for lt_tmp_nm in $lt_nm_to_check; do
- lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
- for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
- IFS="$lt_save_ifs"
- test -z "$ac_dir" && ac_dir=.
- tmp_nm="$ac_dir/$lt_tmp_nm"
- if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
- # Check to see if the nm accepts a BSD-compat flag.
- # Adding the `sed 1q' prevents false positives on HP-UX, which says:
- # nm: unknown option "B" ignored
- # Tru64's nm complains that /dev/null is an invalid object file
- case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
- */dev/null* | *'Invalid file or object type'*)
- lt_cv_path_NM="$tmp_nm -B"
- break
- ;;
- *)
- case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
- */dev/null*)
- lt_cv_path_NM="$tmp_nm -p"
- break
- ;;
- *)
- lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
- continue # so that we can try to find one that supports BSD flags
- ;;
- esac
- ;;
- esac
- fi
- done
- IFS="$lt_save_ifs"
- done
- test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
-fi
-fi
-{ echo "$as_me:$LINENO: result: $lt_cv_path_NM" >&5
-echo "${ECHO_T}$lt_cv_path_NM" >&6; }
-NM="$lt_cv_path_NM"
-
-
-
-{ echo "$as_me:$LINENO: checking for GNU make" >&5
-echo $ECHO_N "checking for GNU make... $ECHO_C" >&6; }
-if test "${llvm_cv_gnu_make_command+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- llvm_cv_gnu_make_command=''
- for a in "$MAKE" make gmake gnumake ; do
- if test -z "$a" ; then continue ; fi ;
- if ( sh -c "$a --version" 2> /dev/null | grep GNU 2>&1 > /dev/null )
- then
- llvm_cv_gnu_make_command=$a ;
- break;
- fi
- done
-fi
-{ echo "$as_me:$LINENO: result: $llvm_cv_gnu_make_command" >&5
-echo "${ECHO_T}$llvm_cv_gnu_make_command" >&6; }
- if test "x$llvm_cv_gnu_make_command" != "x" ; then
- ifGNUmake='' ;
- else
- ifGNUmake='#' ;
- { echo "$as_me:$LINENO: result: \"Not found\"" >&5
-echo "${ECHO_T}\"Not found\"" >&6; };
- fi
-
-
-{ echo "$as_me:$LINENO: checking whether ln -s works" >&5
-echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6; }
-LN_S=$as_ln_s
-if test "$LN_S" = "ln -s"; then
- { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
-else
- { echo "$as_me:$LINENO: result: no, using $LN_S" >&5
-echo "${ECHO_T}no, using $LN_S" >&6; }
-fi
-
-# Extract the first word of "cmp", so it can be a program name with args.
-set dummy cmp; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_path_CMP+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- case $CMP in
- [\\/]* | ?:[\\/]*)
- ac_cv_path_CMP="$CMP" # Let the user override the test with a path.
- ;;
- *)
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_path_CMP="$as_dir/$ac_word$ac_exec_ext"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
- test -z "$ac_cv_path_CMP" && ac_cv_path_CMP="cmp"
- ;;
-esac
-fi
-CMP=$ac_cv_path_CMP
-if test -n "$CMP"; then
- { echo "$as_me:$LINENO: result: $CMP" >&5
-echo "${ECHO_T}$CMP" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-
-# Extract the first word of "cp", so it can be a program name with args.
-set dummy cp; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_path_CP+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- case $CP in
- [\\/]* | ?:[\\/]*)
- ac_cv_path_CP="$CP" # Let the user override the test with a path.
- ;;
- *)
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_path_CP="$as_dir/$ac_word$ac_exec_ext"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
- test -z "$ac_cv_path_CP" && ac_cv_path_CP="cp"
- ;;
-esac
-fi
-CP=$ac_cv_path_CP
-if test -n "$CP"; then
- { echo "$as_me:$LINENO: result: $CP" >&5
-echo "${ECHO_T}$CP" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-
-# Extract the first word of "date", so it can be a program name with args.
-set dummy date; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_path_DATE+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- case $DATE in
- [\\/]* | ?:[\\/]*)
- ac_cv_path_DATE="$DATE" # Let the user override the test with a path.
- ;;
- *)
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_path_DATE="$as_dir/$ac_word$ac_exec_ext"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
- test -z "$ac_cv_path_DATE" && ac_cv_path_DATE="date"
- ;;
-esac
-fi
-DATE=$ac_cv_path_DATE
-if test -n "$DATE"; then
- { echo "$as_me:$LINENO: result: $DATE" >&5
-echo "${ECHO_T}$DATE" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-
-# Extract the first word of "find", so it can be a program name with args.
-set dummy find; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_path_FIND+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- case $FIND in
- [\\/]* | ?:[\\/]*)
- ac_cv_path_FIND="$FIND" # Let the user override the test with a path.
- ;;
- *)
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_path_FIND="$as_dir/$ac_word$ac_exec_ext"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
- test -z "$ac_cv_path_FIND" && ac_cv_path_FIND="find"
- ;;
-esac
-fi
-FIND=$ac_cv_path_FIND
-if test -n "$FIND"; then
- { echo "$as_me:$LINENO: result: $FIND" >&5
-echo "${ECHO_T}$FIND" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-
-# Extract the first word of "grep", so it can be a program name with args.
-set dummy grep; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_path_GREP+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- case $GREP in
- [\\/]* | ?:[\\/]*)
- ac_cv_path_GREP="$GREP" # Let the user override the test with a path.
- ;;
- *)
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_path_GREP="$as_dir/$ac_word$ac_exec_ext"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
- test -z "$ac_cv_path_GREP" && ac_cv_path_GREP="grep"
- ;;
-esac
-fi
-GREP=$ac_cv_path_GREP
-if test -n "$GREP"; then
- { echo "$as_me:$LINENO: result: $GREP" >&5
-echo "${ECHO_T}$GREP" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-
-# Extract the first word of "mkdir", so it can be a program name with args.
-set dummy mkdir; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_path_MKDIR+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- case $MKDIR in
- [\\/]* | ?:[\\/]*)
- ac_cv_path_MKDIR="$MKDIR" # Let the user override the test with a path.
- ;;
- *)
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_path_MKDIR="$as_dir/$ac_word$ac_exec_ext"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
- test -z "$ac_cv_path_MKDIR" && ac_cv_path_MKDIR="mkdir"
- ;;
-esac
-fi
-MKDIR=$ac_cv_path_MKDIR
-if test -n "$MKDIR"; then
- { echo "$as_me:$LINENO: result: $MKDIR" >&5
-echo "${ECHO_T}$MKDIR" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-
-# Extract the first word of "mv", so it can be a program name with args.
-set dummy mv; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_path_MV+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- case $MV in
- [\\/]* | ?:[\\/]*)
- ac_cv_path_MV="$MV" # Let the user override the test with a path.
- ;;
- *)
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_path_MV="$as_dir/$ac_word$ac_exec_ext"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
- test -z "$ac_cv_path_MV" && ac_cv_path_MV="mv"
- ;;
-esac
-fi
-MV=$ac_cv_path_MV
-if test -n "$MV"; then
- { echo "$as_me:$LINENO: result: $MV" >&5
-echo "${ECHO_T}$MV" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-
-if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
-set dummy ${ac_tool_prefix}ranlib; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_RANLIB+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$RANLIB"; then
- ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
-fi
-fi
-RANLIB=$ac_cv_prog_RANLIB
-if test -n "$RANLIB"; then
- { echo "$as_me:$LINENO: result: $RANLIB" >&5
-echo "${ECHO_T}$RANLIB" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_RANLIB"; then
- ac_ct_RANLIB=$RANLIB
- # Extract the first word of "ranlib", so it can be a program name with args.
-set dummy ranlib; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$ac_ct_RANLIB"; then
- ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_ac_ct_RANLIB="ranlib"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
-if test -n "$ac_ct_RANLIB"; then
- { echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5
-echo "${ECHO_T}$ac_ct_RANLIB" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
- if test "x$ac_ct_RANLIB" = x; then
- RANLIB=":"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&5
-echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&2;}
-ac_tool_warned=yes ;;
-esac
- RANLIB=$ac_ct_RANLIB
- fi
-else
- RANLIB="$ac_cv_prog_RANLIB"
-fi
-
-# Extract the first word of "rm", so it can be a program name with args.
-set dummy rm; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_path_RM+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- case $RM in
- [\\/]* | ?:[\\/]*)
- ac_cv_path_RM="$RM" # Let the user override the test with a path.
- ;;
- *)
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_path_RM="$as_dir/$ac_word$ac_exec_ext"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
- test -z "$ac_cv_path_RM" && ac_cv_path_RM="rm"
- ;;
-esac
-fi
-RM=$ac_cv_path_RM
-if test -n "$RM"; then
- { echo "$as_me:$LINENO: result: $RM" >&5
-echo "${ECHO_T}$RM" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-
-# Extract the first word of "sed", so it can be a program name with args.
-set dummy sed; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_path_SED+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- case $SED in
- [\\/]* | ?:[\\/]*)
- ac_cv_path_SED="$SED" # Let the user override the test with a path.
- ;;
- *)
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_path_SED="$as_dir/$ac_word$ac_exec_ext"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
- test -z "$ac_cv_path_SED" && ac_cv_path_SED="sed"
- ;;
-esac
-fi
-SED=$ac_cv_path_SED
-if test -n "$SED"; then
- { echo "$as_me:$LINENO: result: $SED" >&5
-echo "${ECHO_T}$SED" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-
-# Extract the first word of "tar", so it can be a program name with args.
-set dummy tar; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_path_TAR+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- case $TAR in
- [\\/]* | ?:[\\/]*)
- ac_cv_path_TAR="$TAR" # Let the user override the test with a path.
- ;;
- *)
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_path_TAR="$as_dir/$ac_word$ac_exec_ext"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
- test -z "$ac_cv_path_TAR" && ac_cv_path_TAR="gtar"
- ;;
-esac
-fi
-TAR=$ac_cv_path_TAR
-if test -n "$TAR"; then
- { echo "$as_me:$LINENO: result: $TAR" >&5
-echo "${ECHO_T}$TAR" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-
-# Extract the first word of "pwd", so it can be a program name with args.
-set dummy pwd; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_path_BINPWD+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- case $BINPWD in
- [\\/]* | ?:[\\/]*)
- ac_cv_path_BINPWD="$BINPWD" # Let the user override the test with a path.
- ;;
- *)
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_path_BINPWD="$as_dir/$ac_word$ac_exec_ext"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
- test -z "$ac_cv_path_BINPWD" && ac_cv_path_BINPWD="pwd"
- ;;
-esac
-fi
-BINPWD=$ac_cv_path_BINPWD
-if test -n "$BINPWD"; then
- { echo "$as_me:$LINENO: result: $BINPWD" >&5
-echo "${ECHO_T}$BINPWD" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-
-
-# Extract the first word of "Graphviz", so it can be a program name with args.
-set dummy Graphviz; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_path_GRAPHVIZ+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- case $GRAPHVIZ in
- [\\/]* | ?:[\\/]*)
- ac_cv_path_GRAPHVIZ="$GRAPHVIZ" # Let the user override the test with a path.
- ;;
- *)
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_path_GRAPHVIZ="$as_dir/$ac_word$ac_exec_ext"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
- test -z "$ac_cv_path_GRAPHVIZ" && ac_cv_path_GRAPHVIZ="echo Graphviz"
- ;;
-esac
-fi
-GRAPHVIZ=$ac_cv_path_GRAPHVIZ
-if test -n "$GRAPHVIZ"; then
- { echo "$as_me:$LINENO: result: $GRAPHVIZ" >&5
-echo "${ECHO_T}$GRAPHVIZ" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-
-if test "$GRAPHVIZ" != "echo Graphviz" ; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_GRAPHVIZ 1
-_ACEOF
-
- if test "$llvm_cv_os_type" = "MingW" ; then
- GRAPHVIZ=`echo $GRAPHVIZ | sed 's/^\/\([A-Za-z]\)\//\1:\//' `
- fi
-
-cat >>confdefs.h <<_ACEOF
-#define LLVM_PATH_GRAPHVIZ "$GRAPHVIZ${EXEEXT}"
-_ACEOF
-
-fi
-# Extract the first word of "dot", so it can be a program name with args.
-set dummy dot; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_path_DOT+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- case $DOT in
- [\\/]* | ?:[\\/]*)
- ac_cv_path_DOT="$DOT" # Let the user override the test with a path.
- ;;
- *)
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_path_DOT="$as_dir/$ac_word$ac_exec_ext"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
- test -z "$ac_cv_path_DOT" && ac_cv_path_DOT="echo dot"
- ;;
-esac
-fi
-DOT=$ac_cv_path_DOT
-if test -n "$DOT"; then
- { echo "$as_me:$LINENO: result: $DOT" >&5
-echo "${ECHO_T}$DOT" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-
-if test "$DOT" != "echo dot" ; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_DOT 1
-_ACEOF
-
- if test "$llvm_cv_os_type" = "MingW" ; then
- DOT=`echo $DOT | sed 's/^\/\([A-Za-z]\)\//\1:\//' `
- fi
-
-cat >>confdefs.h <<_ACEOF
-#define LLVM_PATH_DOT "$DOT${EXEEXT}"
-_ACEOF
-
-fi
-for ac_prog in gv gsview32
-do
- # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_path_GV+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- case $GV in
- [\\/]* | ?:[\\/]*)
- ac_cv_path_GV="$GV" # Let the user override the test with a path.
- ;;
- *)
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_path_GV="$as_dir/$ac_word$ac_exec_ext"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
- ;;
-esac
-fi
-GV=$ac_cv_path_GV
-if test -n "$GV"; then
- { echo "$as_me:$LINENO: result: $GV" >&5
-echo "${ECHO_T}$GV" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-
- test -n "$GV" && break
-done
-test -n "$GV" || GV="echo gv"
-
-if test "$GV" != "echo gv" ; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_GV 1
-_ACEOF
-
- if test "$llvm_cv_os_type" = "MingW" ; then
- GV=`echo $GV | sed 's/^\/\([A-Za-z]\)\//\1:\//' `
- fi
-
-cat >>confdefs.h <<_ACEOF
-#define LLVM_PATH_GV "$GV${EXEEXT}"
-_ACEOF
-
-fi
-# Extract the first word of "dotty", so it can be a program name with args.
-set dummy dotty; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_path_DOTTY+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- case $DOTTY in
- [\\/]* | ?:[\\/]*)
- ac_cv_path_DOTTY="$DOTTY" # Let the user override the test with a path.
- ;;
- *)
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_path_DOTTY="$as_dir/$ac_word$ac_exec_ext"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
- test -z "$ac_cv_path_DOTTY" && ac_cv_path_DOTTY="echo dotty"
- ;;
-esac
-fi
-DOTTY=$ac_cv_path_DOTTY
-if test -n "$DOTTY"; then
- { echo "$as_me:$LINENO: result: $DOTTY" >&5
-echo "${ECHO_T}$DOTTY" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-
-if test "$DOTTY" != "echo dotty" ; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_DOTTY 1
-_ACEOF
-
- if test "$llvm_cv_os_type" = "MingW" ; then
- DOTTY=`echo $DOTTY | sed 's/^\/\([A-Za-z]\)\//\1:\//' `
- fi
-
-cat >>confdefs.h <<_ACEOF
-#define LLVM_PATH_DOTTY "$DOTTY${EXEEXT}"
-_ACEOF
-
-fi
-
-
-# Extract the first word of "perl", so it can be a program name with args.
-set dummy perl; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_path_PERL+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- case $PERL in
- [\\/]* | ?:[\\/]*)
- ac_cv_path_PERL="$PERL" # Let the user override the test with a path.
- ;;
- *)
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_path_PERL="$as_dir/$ac_word$ac_exec_ext"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
- test -z "$ac_cv_path_PERL" && ac_cv_path_PERL="none"
- ;;
-esac
-fi
-PERL=$ac_cv_path_PERL
-if test -n "$PERL"; then
- { echo "$as_me:$LINENO: result: $PERL" >&5
-echo "${ECHO_T}$PERL" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-
-if test "$PERL" != "none"; then
- { echo "$as_me:$LINENO: checking for Perl 5.006 or newer" >&5
-echo $ECHO_N "checking for Perl 5.006 or newer... $ECHO_C" >&6; }
- if $PERL -e 'use 5.006;' 2>&1 > /dev/null; then
- { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
- else
- PERL=none
- { echo "$as_me:$LINENO: result: not found" >&5
-echo "${ECHO_T}not found" >&6; }
- fi
-fi
-
-
-if test x"$PERL" = xnone; then
- HAVE_PERL=0
-
- { { echo "$as_me:$LINENO: error: perl is required but was not found, please install it" >&5
-echo "$as_me: error: perl is required but was not found, please install it" >&2;}
- { (exit 1); exit 1; }; }
-else
- HAVE_PERL=1
-
-fi
-
-# Find a good install program. We prefer a C program (faster),
-# so one script is as good as another. But avoid the broken or
-# incompatible versions:
-# SysV /etc/install, /usr/sbin/install
-# SunOS /usr/etc/install
-# IRIX /sbin/install
-# AIX /bin/install
-# AmigaOS /C/install, which installs bootblocks on floppy discs
-# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
-# AFS /usr/afsws/bin/install, which mishandles nonexistent args
-# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
-# OS/2's system install, which has a completely different semantic
-# ./install, which can be erroneously created by make from ./install.sh.
-{ echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
-echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; }
-if test -z "$INSTALL"; then
-if test "${ac_cv_path_install+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- # Account for people who put trailing slashes in PATH elements.
-case $as_dir/ in
- ./ | .// | /cC/* | \
- /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
- ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \
- /usr/ucb/* ) ;;
- *)
- # OSF1 and SCO ODT 3.0 have their own names for install.
- # Don't use installbsd from OSF since it installs stuff as root
- # by default.
- for ac_prog in ginstall scoinst install; do
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; }; then
- if test $ac_prog = install &&
- grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
- # AIX install. It has an incompatible calling convention.
- :
- elif test $ac_prog = install &&
- grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
- # program-specific install script used by HP pwplus--don't use.
- :
- else
- ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
- break 3
- fi
- fi
- done
- done
- ;;
-esac
-done
-IFS=$as_save_IFS
-
-
-fi
- if test "${ac_cv_path_install+set}" = set; then
- INSTALL=$ac_cv_path_install
- else
- # As a last resort, use the slow shell script. Don't cache a
- # value for INSTALL within a source directory, because that will
- # break other packages using the cache if that directory is
- # removed, or if the value is a relative name.
- INSTALL=$ac_install_sh
- fi
-fi
-{ echo "$as_me:$LINENO: result: $INSTALL" >&5
-echo "${ECHO_T}$INSTALL" >&6; }
-
-# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
-# It thinks the first close brace ends the variable substitution.
-test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
-
-test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
-
-test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
-
-
-# Extract the first word of "bzip2", so it can be a program name with args.
-set dummy bzip2; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_path_BZIP2+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- case $BZIP2 in
- [\\/]* | ?:[\\/]*)
- ac_cv_path_BZIP2="$BZIP2" # Let the user override the test with a path.
- ;;
- *)
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_path_BZIP2="$as_dir/$ac_word$ac_exec_ext"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
- ;;
-esac
-fi
-BZIP2=$ac_cv_path_BZIP2
-if test -n "$BZIP2"; then
- { echo "$as_me:$LINENO: result: $BZIP2" >&5
-echo "${ECHO_T}$BZIP2" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-
-# Extract the first word of "doxygen", so it can be a program name with args.
-set dummy doxygen; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_path_DOXYGEN+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- case $DOXYGEN in
- [\\/]* | ?:[\\/]*)
- ac_cv_path_DOXYGEN="$DOXYGEN" # Let the user override the test with a path.
- ;;
- *)
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_path_DOXYGEN="$as_dir/$ac_word$ac_exec_ext"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
- ;;
-esac
-fi
-DOXYGEN=$ac_cv_path_DOXYGEN
-if test -n "$DOXYGEN"; then
- { echo "$as_me:$LINENO: result: $DOXYGEN" >&5
-echo "${ECHO_T}$DOXYGEN" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-
-# Extract the first word of "groff", so it can be a program name with args.
-set dummy groff; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_path_GROFF+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- case $GROFF in
- [\\/]* | ?:[\\/]*)
- ac_cv_path_GROFF="$GROFF" # Let the user override the test with a path.
- ;;
- *)
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_path_GROFF="$as_dir/$ac_word$ac_exec_ext"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
- ;;
-esac
-fi
-GROFF=$ac_cv_path_GROFF
-if test -n "$GROFF"; then
- { echo "$as_me:$LINENO: result: $GROFF" >&5
-echo "${ECHO_T}$GROFF" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-
-# Extract the first word of "gzip", so it can be a program name with args.
-set dummy gzip; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_path_GZIP+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- case $GZIP in
- [\\/]* | ?:[\\/]*)
- ac_cv_path_GZIP="$GZIP" # Let the user override the test with a path.
- ;;
- *)
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_path_GZIP="$as_dir/$ac_word$ac_exec_ext"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
- ;;
-esac
-fi
-GZIP=$ac_cv_path_GZIP
-if test -n "$GZIP"; then
- { echo "$as_me:$LINENO: result: $GZIP" >&5
-echo "${ECHO_T}$GZIP" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-
-# Extract the first word of "pod2html", so it can be a program name with args.
-set dummy pod2html; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_path_POD2HTML+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- case $POD2HTML in
- [\\/]* | ?:[\\/]*)
- ac_cv_path_POD2HTML="$POD2HTML" # Let the user override the test with a path.
- ;;
- *)
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_path_POD2HTML="$as_dir/$ac_word$ac_exec_ext"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
- ;;
-esac
-fi
-POD2HTML=$ac_cv_path_POD2HTML
-if test -n "$POD2HTML"; then
- { echo "$as_me:$LINENO: result: $POD2HTML" >&5
-echo "${ECHO_T}$POD2HTML" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-
-# Extract the first word of "pod2man", so it can be a program name with args.
-set dummy pod2man; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_path_POD2MAN+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- case $POD2MAN in
- [\\/]* | ?:[\\/]*)
- ac_cv_path_POD2MAN="$POD2MAN" # Let the user override the test with a path.
- ;;
- *)
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_path_POD2MAN="$as_dir/$ac_word$ac_exec_ext"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
- ;;
-esac
-fi
-POD2MAN=$ac_cv_path_POD2MAN
-if test -n "$POD2MAN"; then
- { echo "$as_me:$LINENO: result: $POD2MAN" >&5
-echo "${ECHO_T}$POD2MAN" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-
-# Extract the first word of "runtest", so it can be a program name with args.
-set dummy runtest; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_path_RUNTEST+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- case $RUNTEST in
- [\\/]* | ?:[\\/]*)
- ac_cv_path_RUNTEST="$RUNTEST" # Let the user override the test with a path.
- ;;
- *)
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_path_RUNTEST="$as_dir/$ac_word$ac_exec_ext"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
- ;;
-esac
-fi
-RUNTEST=$ac_cv_path_RUNTEST
-if test -n "$RUNTEST"; then
- { echo "$as_me:$LINENO: result: $RUNTEST" >&5
-echo "${ECHO_T}$RUNTEST" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-
-
-no_itcl=true
-{ echo "$as_me:$LINENO: checking for the tclsh program in tclinclude directory" >&5
-echo $ECHO_N "checking for the tclsh program in tclinclude directory... $ECHO_C" >&6; }
-
-# Check whether --with-tclinclude was given.
-if test "${with_tclinclude+set}" = set; then
- withval=$with_tclinclude; with_tclinclude=${withval}
-else
- with_tclinclude=''
-fi
-
-if test "${ac_cv_path_tclsh+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
-if test x"${with_tclinclude}" != x ; then
- if test -f ${with_tclinclude}/tclsh ; then
- ac_cv_path_tclsh=`(cd ${with_tclinclude}; pwd)`
- elif test -f ${with_tclinclude}/src/tclsh ; then
- ac_cv_path_tclsh=`(cd ${with_tclinclude}/src; pwd)`
- else
- { { echo "$as_me:$LINENO: error: ${with_tclinclude} directory doesn't contain tclsh" >&5
-echo "$as_me: error: ${with_tclinclude} directory doesn't contain tclsh" >&2;}
- { (exit 1); exit 1; }; }
- fi
-fi
-
-if test x"${ac_cv_path_tclsh}" = x ; then
- { echo "$as_me:$LINENO: result: none" >&5
-echo "${ECHO_T}none" >&6; }
- for ac_prog in tclsh8.4 tclsh8.4.8 tclsh8.4.7 tclsh8.4.6 tclsh8.4.5 tclsh8.4.4 tclsh8.4.3 tclsh8.4.2 tclsh8.4.1 tclsh8.4.0 tclsh8.3 tclsh8.3.5 tclsh8.3.4 tclsh8.3.3 tclsh8.3.2 tclsh8.3.1 tclsh8.3.0 tclsh
-do
- # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_path_TCLSH+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- case $TCLSH in
- [\\/]* | ?:[\\/]*)
- ac_cv_path_TCLSH="$TCLSH" # Let the user override the test with a path.
- ;;
- *)
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_path_TCLSH="$as_dir/$ac_word$ac_exec_ext"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
- ;;
-esac
-fi
-TCLSH=$ac_cv_path_TCLSH
-if test -n "$TCLSH"; then
- { echo "$as_me:$LINENO: result: $TCLSH" >&5
-echo "${ECHO_T}$TCLSH" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-
- test -n "$TCLSH" && break
-done
-
- if test x"${TCLSH}" = x ; then
- ac_cv_path_tclsh='';
- else
- ac_cv_path_tclsh="${TCLSH}";
- fi
-else
- { echo "$as_me:$LINENO: result: ${ac_cv_path_tclsh}" >&5
-echo "${ECHO_T}${ac_cv_path_tclsh}" >&6; }
- TCLSH="${ac_cv_path_tclsh}"
-
-fi
-
-fi
-
-# Extract the first word of "zip", so it can be a program name with args.
-set dummy zip; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_path_ZIP+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- case $ZIP in
- [\\/]* | ?:[\\/]*)
- ac_cv_path_ZIP="$ZIP" # Let the user override the test with a path.
- ;;
- *)
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_path_ZIP="$as_dir/$ac_word$ac_exec_ext"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
- ;;
-esac
-fi
-ZIP=$ac_cv_path_ZIP
-if test -n "$ZIP"; then
- { echo "$as_me:$LINENO: result: $ZIP" >&5
-echo "${ECHO_T}$ZIP" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-
-for ac_prog in ocamlc.opt ocamlc
-do
- # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_path_OCAMLC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- case $OCAMLC in
- [\\/]* | ?:[\\/]*)
- ac_cv_path_OCAMLC="$OCAMLC" # Let the user override the test with a path.
- ;;
- *)
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_path_OCAMLC="$as_dir/$ac_word$ac_exec_ext"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
- ;;
-esac
-fi
-OCAMLC=$ac_cv_path_OCAMLC
-if test -n "$OCAMLC"; then
- { echo "$as_me:$LINENO: result: $OCAMLC" >&5
-echo "${ECHO_T}$OCAMLC" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-
- test -n "$OCAMLC" && break
-done
-
-for ac_prog in ocamlopt.opt ocamlopt
-do
- # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_path_OCAMLOPT+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- case $OCAMLOPT in
- [\\/]* | ?:[\\/]*)
- ac_cv_path_OCAMLOPT="$OCAMLOPT" # Let the user override the test with a path.
- ;;
- *)
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_path_OCAMLOPT="$as_dir/$ac_word$ac_exec_ext"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
- ;;
-esac
-fi
-OCAMLOPT=$ac_cv_path_OCAMLOPT
-if test -n "$OCAMLOPT"; then
- { echo "$as_me:$LINENO: result: $OCAMLOPT" >&5
-echo "${ECHO_T}$OCAMLOPT" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-
- test -n "$OCAMLOPT" && break
-done
-
-for ac_prog in ocamldep.opt ocamldep
-do
- # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_path_OCAMLDEP+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- case $OCAMLDEP in
- [\\/]* | ?:[\\/]*)
- ac_cv_path_OCAMLDEP="$OCAMLDEP" # Let the user override the test with a path.
- ;;
- *)
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_path_OCAMLDEP="$as_dir/$ac_word$ac_exec_ext"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
- ;;
-esac
-fi
-OCAMLDEP=$ac_cv_path_OCAMLDEP
-if test -n "$OCAMLDEP"; then
- { echo "$as_me:$LINENO: result: $OCAMLDEP" >&5
-echo "${ECHO_T}$OCAMLDEP" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-
- test -n "$OCAMLDEP" && break
-done
-
-for ac_prog in ocamldoc.opt ocamldoc
-do
- # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_path_OCAMLDOC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- case $OCAMLDOC in
- [\\/]* | ?:[\\/]*)
- ac_cv_path_OCAMLDOC="$OCAMLDOC" # Let the user override the test with a path.
- ;;
- *)
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_path_OCAMLDOC="$as_dir/$ac_word$ac_exec_ext"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
- ;;
-esac
-fi
-OCAMLDOC=$ac_cv_path_OCAMLDOC
-if test -n "$OCAMLDOC"; then
- { echo "$as_me:$LINENO: result: $OCAMLDOC" >&5
-echo "${ECHO_T}$OCAMLDOC" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-
- test -n "$OCAMLDOC" && break
-done
-
-
-{ echo "$as_me:$LINENO: checking for compiler -Wl,-R<path> option" >&5
-echo $ECHO_N "checking for compiler -Wl,-R<path> option... $ECHO_C" >&6; }
-if test "${llvm_cv_link_use_r+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
- oldcflags="$CFLAGS"
- CFLAGS="$CFLAGS -Wl,-R."
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-int
-main ()
-{
-int main() { return 0; }
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- llvm_cv_link_use_r=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- llvm_cv_link_use_r=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
- CFLAGS="$oldcflags"
- ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
-fi
-{ echo "$as_me:$LINENO: result: $llvm_cv_link_use_r" >&5
-echo "${ECHO_T}$llvm_cv_link_use_r" >&6; }
-if test "$llvm_cv_link_use_r" = yes ; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_LINK_R 1
-_ACEOF
-
- fi
-
-
-
-
-{ echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5
-echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6; }
-if test "${ac_cv_c_const+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-int
-main ()
-{
-/* FIXME: Include the comments suggested by Paul. */
-#ifndef __cplusplus
- /* Ultrix mips cc rejects this. */
- typedef int charset[2];
- const charset x;
- /* SunOS 4.1.1 cc rejects this. */
- char const *const *ccp;
- char **p;
- /* NEC SVR4.0.2 mips cc rejects this. */
- struct point {int x, y;};
- static struct point const zero = {0,0};
- /* AIX XL C 1.02.0.0 rejects this.
- It does not let you subtract one const X* pointer from another in
- an arm of an if-expression whose if-part is not a constant
- expression */
- const char *g = "string";
- ccp = &g + (g ? g-g : 0);
- /* HPUX 7.0 cc rejects these. */
- ++ccp;
- p = (char**) ccp;
- ccp = (char const *const *) p;
- { /* SCO 3.2v4 cc rejects this. */
- char *t;
- char const *s = 0 ? (char *) 0 : (char const *) 0;
-
- *t++ = 0;
- if (s) return 0;
- }
- { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */
- int x[] = {25, 17};
- const int *foo = &x[0];
- ++foo;
- }
- { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
- typedef const int *iptr;
- iptr p = 0;
- ++p;
- }
- { /* AIX XL C 1.02.0.0 rejects this saying
- "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
- struct s { int j; const int *ap[3]; };
- struct s *b; b->j = 5;
- }
- { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
- const int foo = 10;
- if (!foo) return 0;
- }
- return !x[0] && !zero.x;
-#endif
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_c_const=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_c_const=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5
-echo "${ECHO_T}$ac_cv_c_const" >&6; }
-if test $ac_cv_c_const = no; then
-
-cat >>confdefs.h <<\_ACEOF
-#define const
-_ACEOF
-
-fi
-
-
-
-
-
-
-ac_header_dirent=no
-for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do
- as_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_hdr that defines DIR" >&5
-echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <sys/types.h>
-#include <$ac_hdr>
-
-int
-main ()
-{
-if ((DIR *) 0)
-return 0;
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- eval "$as_ac_Header=yes"
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- eval "$as_ac_Header=no"
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_hdr" | $as_tr_cpp` 1
-_ACEOF
-
-ac_header_dirent=$ac_hdr; break
-fi
-
-done
-# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
-if test $ac_header_dirent = dirent.h; then
- { echo "$as_me:$LINENO: checking for library containing opendir" >&5
-echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6; }
-if test "${ac_cv_search_opendir+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_func_search_save_LIBS=$LIBS
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char opendir ();
-int
-main ()
-{
-return opendir ();
- ;
- return 0;
-}
-_ACEOF
-for ac_lib in '' dir; do
- if test -z "$ac_lib"; then
- ac_res="none required"
- else
- ac_res=-l$ac_lib
- LIBS="-l$ac_lib $ac_func_search_save_LIBS"
- fi
- rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_search_opendir=$ac_res
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
-fi
-
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext
- if test "${ac_cv_search_opendir+set}" = set; then
- break
-fi
-done
-if test "${ac_cv_search_opendir+set}" = set; then
- :
-else
- ac_cv_search_opendir=no
-fi
-rm conftest.$ac_ext
-LIBS=$ac_func_search_save_LIBS
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5
-echo "${ECHO_T}$ac_cv_search_opendir" >&6; }
-ac_res=$ac_cv_search_opendir
-if test "$ac_res" != no; then
- test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
-
-fi
-
-else
- { echo "$as_me:$LINENO: checking for library containing opendir" >&5
-echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6; }
-if test "${ac_cv_search_opendir+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_func_search_save_LIBS=$LIBS
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char opendir ();
-int
-main ()
-{
-return opendir ();
- ;
- return 0;
-}
-_ACEOF
-for ac_lib in '' x; do
- if test -z "$ac_lib"; then
- ac_res="none required"
- else
- ac_res=-l$ac_lib
- LIBS="-l$ac_lib $ac_func_search_save_LIBS"
- fi
- rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_search_opendir=$ac_res
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
-fi
-
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext
- if test "${ac_cv_search_opendir+set}" = set; then
- break
-fi
-done
-if test "${ac_cv_search_opendir+set}" = set; then
- :
-else
- ac_cv_search_opendir=no
-fi
-rm conftest.$ac_ext
-LIBS=$ac_func_search_save_LIBS
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5
-echo "${ECHO_T}$ac_cv_search_opendir" >&6; }
-ac_res=$ac_cv_search_opendir
-if test "$ac_res" != no; then
- test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
-
-fi
-
-fi
-
-
-for ac_header in dlfcn.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- { echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-else
- # Is the header compilable?
-{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_header_compiler=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <$ac_header>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_c_preproc_warn_flag
- ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
- else
- ac_cpp_err=
- fi
-else
- ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
- ac_header_preproc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
- yes:no: )
- { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
- ac_header_preproc=yes
- ;;
- no:yes:* )
- { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
- ( cat <<\_ASBOX
-## ----------------------------------- ##
-## Report this to llvmbugs@cs.uiuc.edu ##
-## ----------------------------------- ##
-_ASBOX
- ) | sed "s/^/$as_me: WARNING: /" >&2
- ;;
-esac
-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- eval "$as_ac_Header=\$ac_header_preproc"
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-# Check whether --enable-ltdl-install was given.
-if test "${enable_ltdl_install+set}" = set; then
- enableval=$enable_ltdl_install;
-fi
-
-
-
-
-if test x"${enable_ltdl_install-no}" != xno; then
- INSTALL_LTDL_TRUE=
- INSTALL_LTDL_FALSE='#'
-else
- INSTALL_LTDL_TRUE='#'
- INSTALL_LTDL_FALSE=
-fi
-
-
-
-if test x"${enable_ltdl_convenience-no}" != xno; then
- CONVENIENCE_LTDL_TRUE=
- CONVENIENCE_LTDL_FALSE='#'
-else
- CONVENIENCE_LTDL_TRUE='#'
- CONVENIENCE_LTDL_FALSE=
-fi
-
-
-{ echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
-echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; }
-library_names_spec=
-libname_spec='lib$name'
-soname_spec=
-shrext_cmds=".so"
-postinstall_cmds=
-postuninstall_cmds=
-finish_cmds=
-finish_eval=
-shlibpath_var=
-shlibpath_overrides_runpath=unknown
-version_type=none
-dynamic_linker="$host_os ld.so"
-sys_lib_dlsearch_path_spec="/lib /usr/lib"
-if test "$GCC" = yes; then
- sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
- if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then
- # if the path contains ";" then we assume it to be the separator
- # otherwise default to the standard path separator (i.e. ":") - it is
- # assumed that no part of a normal pathname contains ";" but that should
- # okay in the real world where ";" in dirpaths is itself problematic.
- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
- else
- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
- fi
-else
- sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
-fi
-need_lib_prefix=unknown
-hardcode_into_libs=no
-
-# when you set need_version to no, make sure it does not cause -set_version
-# flags to be left without arguments
-need_version=unknown
-
-case $host_os in
-aix3*)
- version_type=linux
- library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
- shlibpath_var=LIBPATH
-
- # AIX 3 has no versioning support, so we append a major version to the name.
- soname_spec='${libname}${release}${shared_ext}$major'
- ;;
-
-aix4* | aix5*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- hardcode_into_libs=yes
- if test "$host_cpu" = ia64; then
- # AIX 5 supports IA64
- library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
- shlibpath_var=LD_LIBRARY_PATH
- else
- # With GCC up to 2.95.x, collect2 would create an import file
- # for dependence libraries. The import file would start with
- # the line `#! .'. This would cause the generated library to
- # depend on `.', always an invalid library. This was fixed in
- # development snapshots of GCC prior to 3.0.
- case $host_os in
- aix4 | aix4.[01] | aix4.[01].*)
- if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
- echo ' yes '
- echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
- :
- else
- can_build_shared=no
- fi
- ;;
- esac
- # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
- # soname into executable. Probably we can add versioning support to
- # collect2, so additional links can be useful in future.
- if test "$aix_use_runtimelinking" = yes; then
- # If using run time linking (on AIX 4.2 or later) use lib<name>.so
- # instead of lib<name>.a to let people know that these are not
- # typical AIX shared libraries.
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- else
- # We preserve .a as extension for shared libraries through AIX4.2
- # and later when we are not doing run time linking.
- library_names_spec='${libname}${release}.a $libname.a'
- soname_spec='${libname}${release}${shared_ext}$major'
- fi
- shlibpath_var=LIBPATH
- fi
- ;;
-
-amigaos*)
- library_names_spec='$libname.ixlibrary $libname.a'
- # Create ${libname}_ixlibrary.a entries in /sys/libs.
- finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
- ;;
-
-beos*)
- library_names_spec='${libname}${shared_ext}'
- dynamic_linker="$host_os ld.so"
- shlibpath_var=LIBRARY_PATH
- ;;
-
-bsdi[45]*)
- version_type=linux
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
- sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
- # the default ld.so.conf also contains /usr/contrib/lib and
- # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
- # libtool to hard-code these into programs
- ;;
-
-cygwin* | mingw* | pw32*)
- version_type=windows
- shrext_cmds=".dll"
- need_version=no
- need_lib_prefix=no
-
- case $GCC,$host_os in
- yes,cygwin* | yes,mingw* | yes,pw32*)
- library_names_spec='$libname.dll.a'
- # DLL is installed to $(libdir)/../bin by postinstall_cmds
- postinstall_cmds='base_file=`basename \${file}`~
- dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
- dldir=$destdir/`dirname \$dlpath`~
- test -d \$dldir || mkdir -p \$dldir~
- $install_prog $dir/$dlname \$dldir/$dlname~
- chmod a+x \$dldir/$dlname'
- postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
- dlpath=$dir/\$dldll~
- $rm \$dlpath'
- shlibpath_overrides_runpath=yes
-
- case $host_os in
- cygwin*)
- # Cygwin DLLs use 'cyg' prefix rather than 'lib'
- soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
- sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
- ;;
- mingw*)
- # MinGW DLLs use traditional 'lib' prefix
- soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
- sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
- if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then
- # It is most probably a Windows format PATH printed by
- # mingw gcc, but we are running on Cygwin. Gcc prints its search
- # path with ; separators, and with drive letters. We can handle the
- # drive letters (cygwin fileutils understands them), so leave them,
- # especially as we might pass files found there to a mingw objdump,
- # which wouldn't understand a cygwinified path. Ahh.
- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
- else
- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
- fi
- ;;
- pw32*)
- # pw32 DLLs use 'pw' prefix rather than 'lib'
- library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
- ;;
- esac
- ;;
-
- *)
- library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
- ;;
- esac
- dynamic_linker='Win32 ld.exe'
- # FIXME: first we should search . and the directory the executable is in
- shlibpath_var=PATH
- ;;
-
-darwin* | rhapsody*)
- dynamic_linker="$host_os dyld"
- version_type=darwin
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
- soname_spec='${libname}${release}${major}$shared_ext'
- shlibpath_overrides_runpath=yes
- shlibpath_var=DYLD_LIBRARY_PATH
- shrext_cmds='.dylib'
- # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
- if test "$GCC" = yes; then
- sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
- else
- sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
- fi
- sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
- ;;
-
-dgux*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- ;;
-
-freebsd1*)
- dynamic_linker=no
- ;;
-
-kfreebsd*-gnu)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- dynamic_linker='GNU ld.so'
- ;;
-
-freebsd* | dragonfly*)
- # DragonFly does not have aout. When/if they implement a new
- # versioning mechanism, adjust this.
- if test -x /usr/bin/objformat; then
- objformat=`/usr/bin/objformat`
- else
- case $host_os in
- freebsd[123]*) objformat=aout ;;
- *) objformat=elf ;;
- esac
- fi
- version_type=freebsd-$objformat
- case $version_type in
- freebsd-elf*)
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
- need_version=no
- need_lib_prefix=no
- ;;
- freebsd-*)
- library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
- need_version=yes
- ;;
- esac
- shlibpath_var=LD_LIBRARY_PATH
- case $host_os in
- freebsd2*)
- shlibpath_overrides_runpath=yes
- ;;
- freebsd3.[01]* | freebsdelf3.[01]*)
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- ;;
- freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
- freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- ;;
- freebsd*) # from 4.6 on
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- ;;
- esac
- ;;
-
-gnu*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- hardcode_into_libs=yes
- ;;
-
-hpux9* | hpux10* | hpux11*)
- # Give a soname corresponding to the major version so that dld.sl refuses to
- # link against other versions.
- version_type=sunos
- need_lib_prefix=no
- need_version=no
- case $host_cpu in
- ia64*)
- shrext_cmds='.so'
- hardcode_into_libs=yes
- dynamic_linker="$host_os dld.so"
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- if test "X$HPUX_IA64_MODE" = X32; then
- sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
- else
- sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
- fi
- sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
- ;;
- hppa*64*)
- shrext_cmds='.sl'
- hardcode_into_libs=yes
- dynamic_linker="$host_os dld.sl"
- shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
- shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
- sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
- ;;
- *)
- shrext_cmds='.sl'
- dynamic_linker="$host_os dld.sl"
- shlibpath_var=SHLIB_PATH
- shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- ;;
- esac
- # HP-UX runs *really* slowly unless shared libraries are mode 555.
- postinstall_cmds='chmod 555 $lib'
- ;;
-
-interix3*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- ;;
-
-irix5* | irix6* | nonstopux*)
- case $host_os in
- nonstopux*) version_type=nonstopux ;;
- *)
- if test "$lt_cv_prog_gnu_ld" = yes; then
- version_type=linux
- else
- version_type=irix
- fi ;;
- esac
- need_lib_prefix=no
- need_version=no
- soname_spec='${libname}${release}${shared_ext}$major'
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
- case $host_os in
- irix5* | nonstopux*)
- libsuff= shlibsuff=
- ;;
- *)
- case $LD in # libtool.m4 will add one of these switches to LD
- *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
- libsuff= shlibsuff= libmagic=32-bit;;
- *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
- libsuff=32 shlibsuff=N32 libmagic=N32;;
- *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
- libsuff=64 shlibsuff=64 libmagic=64-bit;;
- *) libsuff= shlibsuff= libmagic=never-match;;
- esac
- ;;
- esac
- shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
- shlibpath_overrides_runpath=no
- sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
- sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
- hardcode_into_libs=yes
- ;;
-
-# No shared lib support for Linux oldld, aout, or coff.
-linux*oldld* | linux*aout* | linux*coff*)
- dynamic_linker=no
- ;;
-
-# This must be Linux ELF.
-linux*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- # This implies no fast_install, which is unacceptable.
- # Some rework will be needed to allow for fast_install
- # before this can be enabled.
- hardcode_into_libs=yes
-
- # Append ld.so.conf contents to the search path
- if test -f /etc/ld.so.conf; then
- lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
- sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
- fi
-
- # We used to test for /lib/ld.so.1 and disable shared libraries on
- # powerpc, because MkLinux only supported shared libraries with the
- # GNU dynamic linker. Since this was broken with cross compilers,
- # most powerpc-linux boxes support dynamic linking these days and
- # people can always --disable-shared, the test was removed, and we
- # assume the GNU/Linux dynamic linker is in use.
- dynamic_linker='GNU/Linux ld.so'
- ;;
-
-knetbsd*-gnu)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- dynamic_linker='GNU ld.so'
- ;;
-
-netbsd*)
- version_type=sunos
- need_lib_prefix=no
- need_version=no
- if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
- dynamic_linker='NetBSD (a.out) ld.so'
- else
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- dynamic_linker='NetBSD ld.elf_so'
- fi
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- ;;
-
-newsos6)
- version_type=linux
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- ;;
-
-nto-qnx*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- ;;
-
-openbsd*)
- version_type=sunos
- sys_lib_dlsearch_path_spec="/usr/lib"
- need_lib_prefix=no
- # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
- case $host_os in
- openbsd3.3 | openbsd3.3.*) need_version=yes ;;
- *) need_version=no ;;
- esac
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
- case $host_os in
- openbsd2.[89] | openbsd2.[89].*)
- shlibpath_overrides_runpath=no
- ;;
- *)
- shlibpath_overrides_runpath=yes
- ;;
- esac
- else
- shlibpath_overrides_runpath=yes
- fi
- ;;
-
-os2*)
- libname_spec='$name'
- shrext_cmds=".dll"
- need_lib_prefix=no
- library_names_spec='$libname${shared_ext} $libname.a'
- dynamic_linker='OS/2 ld.exe'
- shlibpath_var=LIBPATH
- ;;
-
-osf3* | osf4* | osf5*)
- version_type=osf
- need_lib_prefix=no
- need_version=no
- soname_spec='${libname}${release}${shared_ext}$major'
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- shlibpath_var=LD_LIBRARY_PATH
- sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
- sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
- ;;
-
-solaris*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- # ldd complains unless libraries are executable
- postinstall_cmds='chmod +x $lib'
- ;;
-
-sunos4*)
- version_type=sunos
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
- finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- if test "$with_gnu_ld" = yes; then
- need_lib_prefix=no
- fi
- need_version=yes
- ;;
-
-sysv4 | sysv4.3*)
- version_type=linux
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- case $host_vendor in
- sni)
- shlibpath_overrides_runpath=no
- need_lib_prefix=no
- export_dynamic_flag_spec='${wl}-Blargedynsym'
- runpath_var=LD_RUN_PATH
- ;;
- siemens)
- need_lib_prefix=no
- ;;
- motorola)
- need_lib_prefix=no
- need_version=no
- shlibpath_overrides_runpath=no
- sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
- ;;
- esac
- ;;
-
-sysv4*MP*)
- if test -d /usr/nec ;then
- version_type=linux
- library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
- soname_spec='$libname${shared_ext}.$major'
- shlibpath_var=LD_LIBRARY_PATH
- fi
- ;;
-
-sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
- version_type=freebsd-elf
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- hardcode_into_libs=yes
- if test "$with_gnu_ld" = yes; then
- sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
- shlibpath_overrides_runpath=no
- else
- sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
- shlibpath_overrides_runpath=yes
- case $host_os in
- sco3.2v5*)
- sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
- ;;
- esac
- fi
- sys_lib_dlsearch_path_spec='/usr/lib'
- ;;
-
-uts4*)
- version_type=linux
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- ;;
-
-*)
- dynamic_linker=no
- ;;
-esac
-{ echo "$as_me:$LINENO: result: $dynamic_linker" >&5
-echo "${ECHO_T}$dynamic_linker" >&6; }
-test "$dynamic_linker" = no && can_build_shared=no
-
-variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
-if test "$GCC" = yes; then
- variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
-fi
-
-
-{ echo "$as_me:$LINENO: checking which extension is used for loadable modules" >&5
-echo $ECHO_N "checking which extension is used for loadable modules... $ECHO_C" >&6; }
-if test "${libltdl_cv_shlibext+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
-module=yes
-eval libltdl_cv_shlibext=$shrext_cmds
-
-fi
-{ echo "$as_me:$LINENO: result: $libltdl_cv_shlibext" >&5
-echo "${ECHO_T}$libltdl_cv_shlibext" >&6; }
-if test -n "$libltdl_cv_shlibext"; then
-
-cat >>confdefs.h <<_ACEOF
-#define LTDL_SHLIB_EXT "$libltdl_cv_shlibext"
-_ACEOF
-
-fi
-
-
-{ echo "$as_me:$LINENO: checking which variable specifies run-time library path" >&5
-echo $ECHO_N "checking which variable specifies run-time library path... $ECHO_C" >&6; }
-if test "${libltdl_cv_shlibpath_var+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- libltdl_cv_shlibpath_var="$shlibpath_var"
-fi
-{ echo "$as_me:$LINENO: result: $libltdl_cv_shlibpath_var" >&5
-echo "${ECHO_T}$libltdl_cv_shlibpath_var" >&6; }
-if test -n "$libltdl_cv_shlibpath_var"; then
-
-cat >>confdefs.h <<_ACEOF
-#define LTDL_SHLIBPATH_VAR "$libltdl_cv_shlibpath_var"
-_ACEOF
-
-fi
-
-
-{ echo "$as_me:$LINENO: checking for the default library search path" >&5
-echo $ECHO_N "checking for the default library search path... $ECHO_C" >&6; }
-if test "${libltdl_cv_sys_search_path+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- libltdl_cv_sys_search_path="$sys_lib_dlsearch_path_spec"
-fi
-{ echo "$as_me:$LINENO: result: $libltdl_cv_sys_search_path" >&5
-echo "${ECHO_T}$libltdl_cv_sys_search_path" >&6; }
-if test -n "$libltdl_cv_sys_search_path"; then
- sys_search_path=
- for dir in $libltdl_cv_sys_search_path; do
- if test -z "$sys_search_path"; then
- sys_search_path="$dir"
- else
- sys_search_path="$sys_search_path$PATH_SEPARATOR$dir"
- fi
- done
-
-cat >>confdefs.h <<_ACEOF
-#define LTDL_SYSSEARCHPATH "$sys_search_path"
-_ACEOF
-
-fi
-
-{ echo "$as_me:$LINENO: checking for objdir" >&5
-echo $ECHO_N "checking for objdir... $ECHO_C" >&6; }
-if test "${libltdl_cv_objdir+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- libltdl_cv_objdir="$objdir"
- if test -n "$objdir"; then
- :
- else
- rm -f .libs 2>/dev/null
- mkdir .libs 2>/dev/null
- if test -d .libs; then
- libltdl_cv_objdir=.libs
- else
- # MS-DOS does not allow filenames that begin with a dot.
- libltdl_cv_objdir=_libs
- fi
- rmdir .libs 2>/dev/null
- fi
-
-fi
-{ echo "$as_me:$LINENO: result: $libltdl_cv_objdir" >&5
-echo "${ECHO_T}$libltdl_cv_objdir" >&6; }
-
-cat >>confdefs.h <<_ACEOF
-#define LTDL_OBJDIR "$libltdl_cv_objdir/"
-_ACEOF
-
-
-
-
-
-
-# Check for command to grab the raw symbol name followed by C symbol from nm.
-{ echo "$as_me:$LINENO: checking command to parse $NM output from $compiler object" >&5
-echo $ECHO_N "checking command to parse $NM output from $compiler object... $ECHO_C" >&6; }
-if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
-# These are sane defaults that work on at least a few old systems.
-# [They come from Ultrix. What could be older than Ultrix?!! ;)]
-
-# Character class describing NM global symbol codes.
-symcode='[BCDEGRST]'
-
-# Regexp to match symbols that can be accessed directly from C.
-sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
-
-# Transform an extracted symbol line into a proper C declaration
-lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'"
-
-# Transform an extracted symbol line into symbol name and symbol address
-lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'"
-
-# Define system-specific variables.
-case $host_os in
-aix*)
- symcode='[BCDT]'
- ;;
-cygwin* | mingw* | pw32*)
- symcode='[ABCDGISTW]'
- ;;
-hpux*) # Its linker distinguishes data from code symbols
- if test "$host_cpu" = ia64; then
- symcode='[ABCDEGRST]'
- fi
- lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
- lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'"
- ;;
-linux*)
- if test "$host_cpu" = ia64; then
- symcode='[ABCDGIRSTW]'
- lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
- lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'"
- fi
- ;;
-irix* | nonstopux*)
- symcode='[BCDEGRST]'
- ;;
-osf*)
- symcode='[BCDEGQRST]'
- ;;
-solaris*)
- symcode='[BDRT]'
- ;;
-sco3.2v5*)
- symcode='[DT]'
- ;;
-sysv4.2uw2*)
- symcode='[DT]'
- ;;
-sysv5* | sco5v6* | unixware* | OpenUNIX*)
- symcode='[ABDT]'
- ;;
-sysv4)
- symcode='[DFNSTU]'
- ;;
-esac
-
-# Handle CRLF in mingw tool chain
-opt_cr=
-case $build_os in
-mingw*)
- opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp
- ;;
-esac
-
-# If we're using GNU nm, then use its standard symbol codes.
-case `$NM -V 2>&1` in
-*GNU* | *'with BFD'*)
- symcode='[ABCDGIRSTW]' ;;
-esac
-
-# Try without a prefix undercore, then with it.
-for ac_symprfx in "" "_"; do
-
- # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
- symxfrm="\\1 $ac_symprfx\\2 \\2"
-
- # Write the raw and C identifiers.
- lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
-
- # Check to see that the pipe works correctly.
- pipe_works=no
-
- rm -f conftest*
- cat > conftest.$ac_ext <<EOF
-#ifdef __cplusplus
-extern "C" {
-#endif
-char nm_test_var;
-void nm_test_func(){}
-#ifdef __cplusplus
-}
-#endif
-int main(){nm_test_var='a';nm_test_func();return(0);}
-EOF
-
- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; then
- # Now try to grab the symbols.
- nlist=conftest.nm
- if { (eval echo "$as_me:$LINENO: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\"") >&5
- (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && test -s "$nlist"; then
- # Try sorting and uniquifying the output.
- if sort "$nlist" | uniq > "$nlist"T; then
- mv -f "$nlist"T "$nlist"
- else
- rm -f "$nlist"T
- fi
-
- # Make sure that we snagged all the symbols we need.
- if grep ' nm_test_var$' "$nlist" >/dev/null; then
- if grep ' nm_test_func$' "$nlist" >/dev/null; then
- cat <<EOF > conftest.$ac_ext
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-EOF
- # Now generate the symbol file.
- eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext'
-
- cat <<EOF >> conftest.$ac_ext
-#if defined (__STDC__) && __STDC__
-# define lt_ptr_t void *
-#else
-# define lt_ptr_t char *
-# define const
-#endif
-
-/* The mapping between symbol names and symbols. */
-const struct {
- const char *name;
- lt_ptr_t address;
-}
-lt_preloaded_symbols[] =
-{
-EOF
- $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext
- cat <<\EOF >> conftest.$ac_ext
- {0, (lt_ptr_t) 0}
-};
-
-#ifdef __cplusplus
-}
-#endif
-EOF
- # Now try linking the two files.
- mv conftest.$ac_objext conftstm.$ac_objext
- lt_save_LIBS="$LIBS"
- lt_save_CFLAGS="$CFLAGS"
- LIBS="conftstm.$ac_objext"
- CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag"
- if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && test -s conftest${ac_exeext}; then
- pipe_works=yes
- fi
- LIBS="$lt_save_LIBS"
- CFLAGS="$lt_save_CFLAGS"
- else
- echo "cannot find nm_test_func in $nlist" >&5
- fi
- else
- echo "cannot find nm_test_var in $nlist" >&5
- fi
- else
- echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5
- fi
- else
- echo "$progname: failed program was:" >&5
- cat conftest.$ac_ext >&5
- fi
- rm -f conftest* conftst*
-
- # Do not use the global_symbol_pipe unless it works.
- if test "$pipe_works" = yes; then
- break
- else
- lt_cv_sys_global_symbol_pipe=
- fi
-done
-
-fi
-
-if test -z "$lt_cv_sys_global_symbol_pipe"; then
- lt_cv_sys_global_symbol_to_cdecl=
-fi
-if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
- { echo "$as_me:$LINENO: result: failed" >&5
-echo "${ECHO_T}failed" >&6; }
-else
- { echo "$as_me:$LINENO: result: ok" >&5
-echo "${ECHO_T}ok" >&6; }
-fi
-
-
-{ echo "$as_me:$LINENO: checking whether libtool supports -dlopen/-dlpreopen" >&5
-echo $ECHO_N "checking whether libtool supports -dlopen/-dlpreopen... $ECHO_C" >&6; }
-if test "${libltdl_cv_preloaded_symbols+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$lt_cv_sys_global_symbol_pipe"; then
- libltdl_cv_preloaded_symbols=yes
- else
- libltdl_cv_preloaded_symbols=no
- fi
-
-fi
-{ echo "$as_me:$LINENO: result: $libltdl_cv_preloaded_symbols" >&5
-echo "${ECHO_T}$libltdl_cv_preloaded_symbols" >&6; }
-if test x"$libltdl_cv_preloaded_symbols" = xyes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_PRELOADED_SYMBOLS 1
-_ACEOF
-
-fi
-
-LIBADD_DL=
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
-{ echo "$as_me:$LINENO: checking for shl_load" >&5
-echo $ECHO_N "checking for shl_load... $ECHO_C" >&6; }
-if test "${ac_cv_func_shl_load+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-/* Define shl_load to an innocuous variant, in case <limits.h> declares shl_load.
- For example, HP-UX 11i <limits.h> declares gettimeofday. */
-#define shl_load innocuous_shl_load
-
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char shl_load (); below.
- Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- <limits.h> exists even on freestanding compilers. */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef shl_load
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char shl_load ();
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined __stub_shl_load || defined __stub___shl_load
-choke me
-#endif
-
-int
-main ()
-{
-return shl_load ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_func_shl_load=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_func_shl_load=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5
-echo "${ECHO_T}$ac_cv_func_shl_load" >&6; }
-if test $ac_cv_func_shl_load = yes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_SHL_LOAD 1
-_ACEOF
-
-else
- { echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5
-echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6; }
-if test "${ac_cv_lib_dld_shl_load+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldld $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char shl_load ();
-int
-main ()
-{
-return shl_load ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_lib_dld_shl_load=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_lib_dld_shl_load=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5
-echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6; }
-if test $ac_cv_lib_dld_shl_load = yes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_SHL_LOAD 1
-_ACEOF
-
- LIBADD_DL="$LIBADD_DL -ldld"
-else
- { echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
-echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; }
-if test "${ac_cv_lib_dl_dlopen+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldl $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char dlopen ();
-int
-main ()
-{
-return dlopen ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_lib_dl_dlopen=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_lib_dl_dlopen=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
-echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; }
-if test $ac_cv_lib_dl_dlopen = yes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_LIBDL 1
-_ACEOF
-
- LIBADD_DL="-ldl" libltdl_cv_lib_dl_dlopen="yes"
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#if HAVE_DLFCN_H
-# include <dlfcn.h>
-#endif
-
-int
-main ()
-{
-dlopen(0, 0);
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_LIBDL 1
-_ACEOF
- libltdl_cv_func_dlopen="yes"
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- { echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5
-echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6; }
-if test "${ac_cv_lib_svld_dlopen+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lsvld $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char dlopen ();
-int
-main ()
-{
-return dlopen ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_lib_svld_dlopen=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_lib_svld_dlopen=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5
-echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6; }
-if test $ac_cv_lib_svld_dlopen = yes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_LIBDL 1
-_ACEOF
-
- LIBADD_DL="-lsvld" libltdl_cv_func_dlopen="yes"
-else
- { echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5
-echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6; }
-if test "${ac_cv_lib_dld_dld_link+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldld $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char dld_link ();
-int
-main ()
-{
-return dld_link ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_lib_dld_dld_link=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_lib_dld_dld_link=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5
-echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6; }
-if test $ac_cv_lib_dld_dld_link = yes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_DLD 1
-_ACEOF
-
- LIBADD_DL="$LIBADD_DL -ldld"
-else
- { echo "$as_me:$LINENO: checking for _dyld_func_lookup" >&5
-echo $ECHO_N "checking for _dyld_func_lookup... $ECHO_C" >&6; }
-if test "${ac_cv_func__dyld_func_lookup+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-/* Define _dyld_func_lookup to an innocuous variant, in case <limits.h> declares _dyld_func_lookup.
- For example, HP-UX 11i <limits.h> declares gettimeofday. */
-#define _dyld_func_lookup innocuous__dyld_func_lookup
-
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char _dyld_func_lookup (); below.
- Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- <limits.h> exists even on freestanding compilers. */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef _dyld_func_lookup
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char _dyld_func_lookup ();
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined __stub__dyld_func_lookup || defined __stub____dyld_func_lookup
-choke me
-#endif
-
-int
-main ()
-{
-return _dyld_func_lookup ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_func__dyld_func_lookup=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_func__dyld_func_lookup=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_func__dyld_func_lookup" >&5
-echo "${ECHO_T}$ac_cv_func__dyld_func_lookup" >&6; }
-if test $ac_cv_func__dyld_func_lookup = yes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_DYLD 1
-_ACEOF
-
-fi
-
-
-fi
-
-
-fi
-
-
-fi
-
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-
-fi
-
-
-fi
-
-
-fi
-
-
-if test x"$libltdl_cv_func_dlopen" = xyes || test x"$libltdl_cv_lib_dl_dlopen" = xyes
-then
- lt_save_LIBS="$LIBS"
- LIBS="$LIBS $LIBADD_DL"
-
-for ac_func in dlerror
-do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
-if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
- For example, HP-UX 11i <limits.h> declares gettimeofday. */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func (); below.
- Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- <limits.h> exists even on freestanding compilers. */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef $ac_func
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char $ac_func ();
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined __stub_$ac_func || defined __stub___$ac_func
-choke me
-#endif
-
-int
-main ()
-{
-return $ac_func ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- eval "$as_ac_var=yes"
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- eval "$as_ac_var=no"
-fi
-
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-fi
-ac_res=`eval echo '${'$as_ac_var'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_var'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-done
-
- LIBS="$lt_save_LIBS"
-fi
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
-
-{ echo "$as_me:$LINENO: checking for _ prefix in compiled symbols" >&5
-echo $ECHO_N "checking for _ prefix in compiled symbols... $ECHO_C" >&6; }
-if test "${ac_cv_sys_symbol_underscore+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_cv_sys_symbol_underscore=no
- cat > conftest.$ac_ext <<EOF
-void nm_test_func(){}
-int main(){nm_test_func;return 0;}
-EOF
- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; then
- # Now try to grab the symbols.
- ac_nlist=conftest.nm
- if { (eval echo "$as_me:$LINENO: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $ac_nlist\"") >&5
- (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $ac_nlist) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && test -s "$ac_nlist"; then
- # See whether the symbols have a leading underscore.
- if grep '^. _nm_test_func' "$ac_nlist" >/dev/null; then
- ac_cv_sys_symbol_underscore=yes
- else
- if grep '^. nm_test_func ' "$ac_nlist" >/dev/null; then
- :
- else
- echo "configure: cannot find nm_test_func in $ac_nlist" >&5
- fi
- fi
- else
- echo "configure: cannot run $lt_cv_sys_global_symbol_pipe" >&5
- fi
- else
- echo "configure: failed program was:" >&5
- cat conftest.c >&5
- fi
- rm -rf conftest*
-
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_sys_symbol_underscore" >&5
-echo "${ECHO_T}$ac_cv_sys_symbol_underscore" >&6; }
-
-
-if test x"$ac_cv_sys_symbol_underscore" = xyes; then
- if test x"$libltdl_cv_func_dlopen" = xyes ||
- test x"$libltdl_cv_lib_dl_dlopen" = xyes ; then
- { echo "$as_me:$LINENO: checking whether we have to add an underscore for dlsym" >&5
-echo $ECHO_N "checking whether we have to add an underscore for dlsym... $ECHO_C" >&6; }
-if test "${libltdl_cv_need_uscore+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- libltdl_cv_need_uscore=unknown
- save_LIBS="$LIBS"
- LIBS="$LIBS $LIBADD_DL"
- if test "$cross_compiling" = yes; then :
- libltdl_cv_need_uscore=cross
-else
- lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
- lt_status=$lt_dlunknown
- cat > conftest.$ac_ext <<EOF
-#line 10634 "configure"
-#include "confdefs.h"
-
-#if HAVE_DLFCN_H
-#include <dlfcn.h>
-#endif
-
-#include <stdio.h>
-
-#ifdef RTLD_GLOBAL
-# define LT_DLGLOBAL RTLD_GLOBAL
-#else
-# ifdef DL_GLOBAL
-# define LT_DLGLOBAL DL_GLOBAL
-# else
-# define LT_DLGLOBAL 0
-# endif
-#endif
-
-/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
- find out it does not work in some platform. */
-#ifndef LT_DLLAZY_OR_NOW
-# ifdef RTLD_LAZY
-# define LT_DLLAZY_OR_NOW RTLD_LAZY
-# else
-# ifdef DL_LAZY
-# define LT_DLLAZY_OR_NOW DL_LAZY
-# else
-# ifdef RTLD_NOW
-# define LT_DLLAZY_OR_NOW RTLD_NOW
-# else
-# ifdef DL_NOW
-# define LT_DLLAZY_OR_NOW DL_NOW
-# else
-# define LT_DLLAZY_OR_NOW 0
-# endif
-# endif
-# endif
-# endif
-#endif
-
-#ifdef __cplusplus
-extern "C" void exit (int);
-#endif
-
-void fnord() { int i=42;}
-int main ()
-{
- void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
- int status = $lt_dlunknown;
-
- if (self)
- {
- if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
- else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
- /* dlclose (self); */
- }
- else
- puts (dlerror ());
-
- exit (status);
-}
-EOF
- if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
- (./conftest; exit; ) >&5 2>/dev/null
- lt_status=$?
- case x$lt_status in
- x$lt_dlno_uscore) libltdl_cv_need_uscore=no ;;
- x$lt_dlneed_uscore) libltdl_cv_need_uscore=yes ;;
- x$lt_dlunknown|x*) ;;
- esac
- else :
- # compilation failed
-
- fi
-fi
-rm -fr conftest*
-
- LIBS="$save_LIBS"
-
-fi
-{ echo "$as_me:$LINENO: result: $libltdl_cv_need_uscore" >&5
-echo "${ECHO_T}$libltdl_cv_need_uscore" >&6; }
- fi
-fi
-
-if test x"$libltdl_cv_need_uscore" = xyes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define NEED_USCORE 1
-_ACEOF
-
-fi
-
-
-{ echo "$as_me:$LINENO: checking whether deplibs are loaded by dlopen" >&5
-echo $ECHO_N "checking whether deplibs are loaded by dlopen... $ECHO_C" >&6; }
-if test "${libltdl_cv_sys_dlopen_deplibs+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- # PORTME does your system automatically load deplibs for dlopen?
- # or its logical equivalent (e.g. shl_load for HP-UX < 11)
- # For now, we just catch OSes we know something about -- in the
- # future, we'll try test this programmatically.
- libltdl_cv_sys_dlopen_deplibs=unknown
- case "$host_os" in
- aix3*|aix4.1.*|aix4.2.*)
- # Unknown whether this is true for these versions of AIX, but
- # we want this `case' here to explicitly catch those versions.
- libltdl_cv_sys_dlopen_deplibs=unknown
- ;;
- aix[45]*)
- libltdl_cv_sys_dlopen_deplibs=yes
- ;;
- darwin*)
- # Assuming the user has installed a libdl from somewhere, this is true
- # If you are looking for one http://www.opendarwin.org/projects/dlcompat
- libltdl_cv_sys_dlopen_deplibs=yes
- ;;
- gnu* | linux* | kfreebsd*-gnu | knetbsd*-gnu)
- # GNU and its variants, using gnu ld.so (Glibc)
- libltdl_cv_sys_dlopen_deplibs=yes
- ;;
- hpux10*|hpux11*)
- libltdl_cv_sys_dlopen_deplibs=yes
- ;;
- interix*)
- libltdl_cv_sys_dlopen_deplibs=yes
- ;;
- irix[12345]*|irix6.[01]*)
- # Catch all versions of IRIX before 6.2, and indicate that we don't
- # know how it worked for any of those versions.
- libltdl_cv_sys_dlopen_deplibs=unknown
- ;;
- irix*)
- # The case above catches anything before 6.2, and it's known that
- # at 6.2 and later dlopen does load deplibs.
- libltdl_cv_sys_dlopen_deplibs=yes
- ;;
- netbsd*)
- libltdl_cv_sys_dlopen_deplibs=yes
- ;;
- openbsd*)
- libltdl_cv_sys_dlopen_deplibs=yes
- ;;
- osf[1234]*)
- # dlopen did load deplibs (at least at 4.x), but until the 5.x series,
- # it did *not* use an RPATH in a shared library to find objects the
- # library depends on, so we explictly say `no'.
- libltdl_cv_sys_dlopen_deplibs=no
- ;;
- osf5.0|osf5.0a|osf5.1)
- # dlopen *does* load deplibs and with the right loader patch applied
- # it even uses RPATH in a shared library to search for shared objects
- # that the library depends on, but there's no easy way to know if that
- # patch is installed. Since this is the case, all we can really
- # say is unknown -- it depends on the patch being installed. If
- # it is, this changes to `yes'. Without it, it would be `no'.
- libltdl_cv_sys_dlopen_deplibs=unknown
- ;;
- osf*)
- # the two cases above should catch all versions of osf <= 5.1. Read
- # the comments above for what we know about them.
- # At > 5.1, deplibs are loaded *and* any RPATH in a shared library
- # is used to find them so we can finally say `yes'.
- libltdl_cv_sys_dlopen_deplibs=yes
- ;;
- solaris*)
- libltdl_cv_sys_dlopen_deplibs=yes
- ;;
- sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
- libltdl_cv_sys_dlopen_deplibs=yes
- ;;
- esac
-
-fi
-{ echo "$as_me:$LINENO: result: $libltdl_cv_sys_dlopen_deplibs" >&5
-echo "${ECHO_T}$libltdl_cv_sys_dlopen_deplibs" >&6; }
-if test "$libltdl_cv_sys_dlopen_deplibs" != yes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define LTDL_DLOPEN_DEPLIBS 1
-_ACEOF
-
-fi
-
-
-for ac_header in argz.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- { echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-else
- # Is the header compilable?
-{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_header_compiler=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <$ac_header>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_c_preproc_warn_flag
- ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
- else
- ac_cpp_err=
- fi
-else
- ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
- ac_header_preproc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
- yes:no: )
- { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
- ac_header_preproc=yes
- ;;
- no:yes:* )
- { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
- ( cat <<\_ASBOX
-## ----------------------------------- ##
-## Report this to llvmbugs@cs.uiuc.edu ##
-## ----------------------------------- ##
-_ASBOX
- ) | sed "s/^/$as_me: WARNING: /" >&2
- ;;
-esac
-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- eval "$as_ac_Header=\$ac_header_preproc"
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-
-{ echo "$as_me:$LINENO: checking for error_t" >&5
-echo $ECHO_N "checking for error_t... $ECHO_C" >&6; }
-if test "${ac_cv_type_error_t+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#if HAVE_ARGZ_H
-# include <argz.h>
-#endif
-
-typedef error_t ac__type_new_;
-int
-main ()
-{
-if ((ac__type_new_ *) 0)
- return 0;
-if (sizeof (ac__type_new_))
- return 0;
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_type_error_t=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_type_error_t=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_type_error_t" >&5
-echo "${ECHO_T}$ac_cv_type_error_t" >&6; }
-if test $ac_cv_type_error_t = yes; then
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_ERROR_T 1
-_ACEOF
-
-
-else
-
-cat >>confdefs.h <<\_ACEOF
-#define error_t int
-_ACEOF
-
-fi
-
-
-
-
-
-
-
-for ac_func in argz_append argz_create_sep argz_insert argz_next argz_stringify
-do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
-if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
- For example, HP-UX 11i <limits.h> declares gettimeofday. */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func (); below.
- Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- <limits.h> exists even on freestanding compilers. */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef $ac_func
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char $ac_func ();
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined __stub_$ac_func || defined __stub___$ac_func
-choke me
-#endif
-
-int
-main ()
-{
-return $ac_func ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- eval "$as_ac_var=yes"
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- eval "$as_ac_var=no"
-fi
-
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-fi
-ac_res=`eval echo '${'$as_ac_var'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_var'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-done
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-for ac_header in assert.h ctype.h errno.h malloc.h memory.h stdlib.h \
- stdio.h unistd.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- { echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-else
- # Is the header compilable?
-{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_header_compiler=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <$ac_header>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_c_preproc_warn_flag
- ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
- else
- ac_cpp_err=
- fi
-else
- ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
- ac_header_preproc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
- yes:no: )
- { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
- ac_header_preproc=yes
- ;;
- no:yes:* )
- { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
- ( cat <<\_ASBOX
-## ----------------------------------- ##
-## Report this to llvmbugs@cs.uiuc.edu ##
-## ----------------------------------- ##
-_ASBOX
- ) | sed "s/^/$as_me: WARNING: /" >&2
- ;;
-esac
-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- eval "$as_ac_Header=\$ac_header_preproc"
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-
-
-
-
-for ac_header in dl.h sys/dl.h dld.h mach-o/dyld.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- { echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-else
- # Is the header compilable?
-{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_header_compiler=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <$ac_header>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_c_preproc_warn_flag
- ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
- else
- ac_cpp_err=
- fi
-else
- ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
- ac_header_preproc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
- yes:no: )
- { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
- ac_header_preproc=yes
- ;;
- no:yes:* )
- { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
- ( cat <<\_ASBOX
-## ----------------------------------- ##
-## Report this to llvmbugs@cs.uiuc.edu ##
-## ----------------------------------- ##
-_ASBOX
- ) | sed "s/^/$as_me: WARNING: /" >&2
- ;;
-esac
-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- eval "$as_ac_Header=\$ac_header_preproc"
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-
-
-for ac_header in string.h strings.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- { echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-else
- # Is the header compilable?
-{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_header_compiler=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <$ac_header>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_c_preproc_warn_flag
- ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
- else
- ac_cpp_err=
- fi
-else
- ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
- ac_header_preproc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
- yes:no: )
- { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
- ac_header_preproc=yes
- ;;
- no:yes:* )
- { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
- ( cat <<\_ASBOX
-## ----------------------------------- ##
-## Report this to llvmbugs@cs.uiuc.edu ##
-## ----------------------------------- ##
-_ASBOX
- ) | sed "s/^/$as_me: WARNING: /" >&2
- ;;
-esac
-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- eval "$as_ac_Header=\$ac_header_preproc"
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
- break
-fi
-
-done
-
-
-
-
-for ac_func in strchr index
-do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
-if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
- For example, HP-UX 11i <limits.h> declares gettimeofday. */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func (); below.
- Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- <limits.h> exists even on freestanding compilers. */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef $ac_func
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char $ac_func ();
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined __stub_$ac_func || defined __stub___$ac_func
-choke me
-#endif
-
-int
-main ()
-{
-return $ac_func ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- eval "$as_ac_var=yes"
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- eval "$as_ac_var=no"
-fi
-
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-fi
-ac_res=`eval echo '${'$as_ac_var'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_var'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
- break
-fi
-done
-
-
-
-for ac_func in strrchr rindex
-do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
-if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
- For example, HP-UX 11i <limits.h> declares gettimeofday. */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func (); below.
- Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- <limits.h> exists even on freestanding compilers. */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef $ac_func
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char $ac_func ();
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined __stub_$ac_func || defined __stub___$ac_func
-choke me
-#endif
-
-int
-main ()
-{
-return $ac_func ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- eval "$as_ac_var=yes"
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- eval "$as_ac_var=no"
-fi
-
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-fi
-ac_res=`eval echo '${'$as_ac_var'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_var'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
- break
-fi
-done
-
-
-
-for ac_func in memcpy bcopy
-do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
-if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
- For example, HP-UX 11i <limits.h> declares gettimeofday. */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func (); below.
- Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- <limits.h> exists even on freestanding compilers. */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef $ac_func
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char $ac_func ();
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined __stub_$ac_func || defined __stub___$ac_func
-choke me
-#endif
-
-int
-main ()
-{
-return $ac_func ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- eval "$as_ac_var=yes"
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- eval "$as_ac_var=no"
-fi
-
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-fi
-ac_res=`eval echo '${'$as_ac_var'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_var'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
- break
-fi
-done
-
-
-
-for ac_func in memmove strcmp
-do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
-if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
- For example, HP-UX 11i <limits.h> declares gettimeofday. */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func (); below.
- Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- <limits.h> exists even on freestanding compilers. */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef $ac_func
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char $ac_func ();
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined __stub_$ac_func || defined __stub___$ac_func
-choke me
-#endif
-
-int
-main ()
-{
-return $ac_func ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- eval "$as_ac_var=yes"
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- eval "$as_ac_var=no"
-fi
-
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-fi
-ac_res=`eval echo '${'$as_ac_var'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_var'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-done
-
-
-
-
-for ac_func in closedir opendir readdir
-do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
-if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
- For example, HP-UX 11i <limits.h> declares gettimeofday. */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func (); below.
- Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- <limits.h> exists even on freestanding compilers. */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef $ac_func
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char $ac_func ();
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined __stub_$ac_func || defined __stub___$ac_func
-choke me
-#endif
-
-int
-main ()
-{
-return $ac_func ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- eval "$as_ac_var=yes"
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- eval "$as_ac_var=no"
-fi
-
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-fi
-ac_res=`eval echo '${'$as_ac_var'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_var'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-done
-
-
-# Check whether --enable-shared was given.
-if test "${enable_shared+set}" = set; then
- enableval=$enable_shared; p=${PACKAGE-default}
- case $enableval in
- yes) enable_shared=yes ;;
- no) enable_shared=no ;;
- *)
- enable_shared=no
- # Look at the argument we got. We use all the common list separators.
- lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
- for pkg in $enableval; do
- IFS="$lt_save_ifs"
- if test "X$pkg" = "X$p"; then
- enable_shared=yes
- fi
- done
- IFS="$lt_save_ifs"
- ;;
- esac
-else
- enable_shared=yes
-fi
-
-
-# Check whether --enable-static was given.
-if test "${enable_static+set}" = set; then
- enableval=$enable_static; p=${PACKAGE-default}
- case $enableval in
- yes) enable_static=yes ;;
- no) enable_static=no ;;
- *)
- enable_static=no
- # Look at the argument we got. We use all the common list separators.
- lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
- for pkg in $enableval; do
- IFS="$lt_save_ifs"
- if test "X$pkg" = "X$p"; then
- enable_static=yes
- fi
- done
- IFS="$lt_save_ifs"
- ;;
- esac
-else
- enable_static=yes
-fi
-
-
-# Check whether --enable-fast-install was given.
-if test "${enable_fast_install+set}" = set; then
- enableval=$enable_fast_install; p=${PACKAGE-default}
- case $enableval in
- yes) enable_fast_install=yes ;;
- no) enable_fast_install=no ;;
- *)
- enable_fast_install=no
- # Look at the argument we got. We use all the common list separators.
- lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
- for pkg in $enableval; do
- IFS="$lt_save_ifs"
- if test "X$pkg" = "X$p"; then
- enable_fast_install=yes
- fi
- done
- IFS="$lt_save_ifs"
- ;;
- esac
-else
- enable_fast_install=yes
-fi
-
-
-{ echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5
-echo $ECHO_N "checking for a sed that does not truncate output... $ECHO_C" >&6; }
-if test "${lt_cv_path_SED+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- # Loop through the user's path and test for sed and gsed.
-# Then use that list of sed's as ones to test for truncation.
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for lt_ac_prog in sed gsed; do
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
- lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
- fi
- done
- done
-done
-lt_ac_max=0
-lt_ac_count=0
-# Add /usr/xpg4/bin/sed as it is typically found on Solaris
-# along with /bin/sed that truncates output.
-for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
- test ! -f $lt_ac_sed && continue
- cat /dev/null > conftest.in
- lt_ac_count=0
- echo $ECHO_N "0123456789$ECHO_C" >conftest.in
- # Check for GNU sed and select it if it is found.
- if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
- lt_cv_path_SED=$lt_ac_sed
- break
- fi
- while true; do
- cat conftest.in conftest.in >conftest.tmp
- mv conftest.tmp conftest.in
- cp conftest.in conftest.nl
- echo >>conftest.nl
- $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
- cmp -s conftest.out conftest.nl || break
- # 10000 chars as input seems more than enough
- test $lt_ac_count -gt 10 && break
- lt_ac_count=`expr $lt_ac_count + 1`
- if test $lt_ac_count -gt $lt_ac_max; then
- lt_ac_max=$lt_ac_count
- lt_cv_path_SED=$lt_ac_sed
- fi
- done
-done
-
-fi
-
-SED=$lt_cv_path_SED
-{ echo "$as_me:$LINENO: result: $SED" >&5
-echo "${ECHO_T}$SED" >&6; }
-
-
-# Check whether --with-gnu-ld was given.
-if test "${with_gnu_ld+set}" = set; then
- withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
-else
- with_gnu_ld=no
-fi
-
-ac_prog=ld
-if test "$GCC" = yes; then
- # Check if gcc -print-prog-name=ld gives a path.
- { echo "$as_me:$LINENO: checking for ld used by $CC" >&5
-echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6; }
- case $host in
- *-*-mingw*)
- # gcc leaves a trailing carriage return which upsets mingw
- ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
- *)
- ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
- esac
- case $ac_prog in
- # Accept absolute paths.
- [\\/]* | ?:[\\/]*)
- re_direlt='/[^/][^/]*/\.\./'
- # Canonicalize the pathname of ld
- ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'`
- while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
- ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"`
- done
- test -z "$LD" && LD="$ac_prog"
- ;;
- "")
- # If it fails, then pretend we aren't using GCC.
- ac_prog=ld
- ;;
- *)
- # If it is relative, then search for the first ld in PATH.
- with_gnu_ld=unknown
- ;;
- esac
-elif test "$with_gnu_ld" = yes; then
- { echo "$as_me:$LINENO: checking for GNU ld" >&5
-echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6; }
-else
- { echo "$as_me:$LINENO: checking for non-GNU ld" >&5
-echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6; }
-fi
-if test "${lt_cv_path_LD+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -z "$LD"; then
- lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
- for ac_dir in $PATH; do
- IFS="$lt_save_ifs"
- test -z "$ac_dir" && ac_dir=.
- if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
- lt_cv_path_LD="$ac_dir/$ac_prog"
- # Check to see if the program is GNU ld. I'd rather use --version,
- # but apparently some variants of GNU ld only accept -v.
- # Break only if it was the GNU/non-GNU ld that we prefer.
- case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
- *GNU* | *'with BFD'*)
- test "$with_gnu_ld" != no && break
- ;;
- *)
- test "$with_gnu_ld" != yes && break
- ;;
- esac
- fi
- done
- IFS="$lt_save_ifs"
-else
- lt_cv_path_LD="$LD" # Let the user override the test with a path.
-fi
-fi
-
-LD="$lt_cv_path_LD"
-if test -n "$LD"; then
- { echo "$as_me:$LINENO: result: $LD" >&5
-echo "${ECHO_T}$LD" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5
-echo "$as_me: error: no acceptable ld found in \$PATH" >&2;}
- { (exit 1); exit 1; }; }
-{ echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5
-echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6; }
-if test "${lt_cv_prog_gnu_ld+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- # I'd rather use --version here, but apparently some GNU lds only accept -v.
-case `$LD -v 2>&1 </dev/null` in
-*GNU* | *'with BFD'*)
- lt_cv_prog_gnu_ld=yes
- ;;
-*)
- lt_cv_prog_gnu_ld=no
- ;;
-esac
-fi
-{ echo "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5
-echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6; }
-with_gnu_ld=$lt_cv_prog_gnu_ld
-
-
-{ echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5
-echo $ECHO_N "checking for $LD option to reload object files... $ECHO_C" >&6; }
-if test "${lt_cv_ld_reload_flag+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- lt_cv_ld_reload_flag='-r'
-fi
-{ echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5
-echo "${ECHO_T}$lt_cv_ld_reload_flag" >&6; }
-reload_flag=$lt_cv_ld_reload_flag
-case $reload_flag in
-"" | " "*) ;;
-*) reload_flag=" $reload_flag" ;;
-esac
-reload_cmds='$LD$reload_flag -o $output$reload_objs'
-case $host_os in
- darwin*)
- if test "$GCC" = yes; then
- reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r $compiler_flags -o $output$reload_objs'
- else
- reload_cmds='$LD$reload_flag -o $output$reload_objs'
- fi
- ;;
-esac
-
-{ echo "$as_me:$LINENO: checking how to recognise dependent libraries" >&5
-echo $ECHO_N "checking how to recognise dependent libraries... $ECHO_C" >&6; }
-if test "${lt_cv_deplibs_check_method+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- lt_cv_file_magic_cmd='$MAGIC_CMD'
-lt_cv_file_magic_test_file=
-lt_cv_deplibs_check_method='unknown'
-# Need to set the preceding variable on all platforms that support
-# interlibrary dependencies.
-# 'none' -- dependencies not supported.
-# `unknown' -- same as none, but documents that we really don't know.
-# 'pass_all' -- all dependencies passed with no checks.
-# 'test_compile' -- check by making test program.
-# 'file_magic [[regex]]' -- check by looking for files in library path
-# which responds to the $file_magic_cmd with a given extended regex.
-# If you have `file' or equivalent on your system and you're not sure
-# whether `pass_all' will *always* work, you probably want this one.
-
-case $host_os in
-aix4* | aix5*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-beos*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-bsdi[45]*)
- lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'
- lt_cv_file_magic_cmd='/usr/bin/file -L'
- lt_cv_file_magic_test_file=/shlib/libc.so
- ;;
-
-cygwin*)
- # func_win32_libid is a shell function defined in ltmain.sh
- lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
- lt_cv_file_magic_cmd='func_win32_libid'
- ;;
-
-mingw* | pw32*)
- # Base MSYS/MinGW do not provide the 'file' command needed by
- # func_win32_libid shell function, so use a weaker test based on 'objdump'.
- lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
- lt_cv_file_magic_cmd='$OBJDUMP -f'
- ;;
-
-darwin* | rhapsody*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-freebsd* | kfreebsd*-gnu | dragonfly*)
- if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
- case $host_cpu in
- i*86 )
- # Not sure whether the presence of OpenBSD here was a mistake.
- # Let's accept both of them until this is cleared up.
- lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library'
- lt_cv_file_magic_cmd=/usr/bin/file
- lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
- ;;
- esac
- else
- lt_cv_deplibs_check_method=pass_all
- fi
- ;;
-
-gnu*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-hpux10.20* | hpux11*)
- lt_cv_file_magic_cmd=/usr/bin/file
- case $host_cpu in
- ia64*)
- lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64'
- lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
- ;;
- hppa*64*)
- lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]'
- lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
- ;;
- *)
- lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library'
- lt_cv_file_magic_test_file=/usr/lib/libc.sl
- ;;
- esac
- ;;
-
-interix3*)
- # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
- lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$'
- ;;
-
-irix5* | irix6* | nonstopux*)
- case $LD in
- *-32|*"-32 ") libmagic=32-bit;;
- *-n32|*"-n32 ") libmagic=N32;;
- *-64|*"-64 ") libmagic=64-bit;;
- *) libmagic=never-match;;
- esac
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-# This must be Linux ELF.
-linux*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-netbsd*)
- if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
- lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
- else
- lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$'
- fi
- ;;
-
-newos6*)
- lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)'
- lt_cv_file_magic_cmd=/usr/bin/file
- lt_cv_file_magic_test_file=/usr/lib/libnls.so
- ;;
-
-nto-qnx*)
- lt_cv_deplibs_check_method=unknown
- ;;
-
-openbsd*)
- if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
- lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$'
- else
- lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
- fi
- ;;
-
-osf3* | osf4* | osf5*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-solaris*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-sysv4 | sysv4.3*)
- case $host_vendor in
- motorola)
- lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]'
- lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
- ;;
- ncr)
- lt_cv_deplibs_check_method=pass_all
- ;;
- sequent)
- lt_cv_file_magic_cmd='/bin/file'
- lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )'
- ;;
- sni)
- lt_cv_file_magic_cmd='/bin/file'
- lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib"
- lt_cv_file_magic_test_file=/lib/libc.so
- ;;
- siemens)
- lt_cv_deplibs_check_method=pass_all
- ;;
- pc)
- lt_cv_deplibs_check_method=pass_all
- ;;
- esac
- ;;
-
-sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-esac
-
-fi
-{ echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5
-echo "${ECHO_T}$lt_cv_deplibs_check_method" >&6; }
-file_magic_cmd=$lt_cv_file_magic_cmd
-deplibs_check_method=$lt_cv_deplibs_check_method
-test -z "$deplibs_check_method" && deplibs_check_method=unknown
-
-
-
-# If no C compiler was specified, use CC.
-LTCC=${LTCC-"$CC"}
-
-# If no C compiler flags were specified, use CFLAGS.
-LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
-
-# Allow CC to be a program name with arguments.
-compiler=$CC
-
-# Check whether --enable-libtool-lock was given.
-if test "${enable_libtool_lock+set}" = set; then
- enableval=$enable_libtool_lock;
-fi
-
-test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
-
-# Some flags need to be propagated to the compiler or linker for good
-# libtool support.
-case $host in
-ia64-*-hpux*)
- # Find out which ABI we are using.
- echo 'int i;' > conftest.$ac_ext
- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; then
- case `/usr/bin/file conftest.$ac_objext` in
- *ELF-32*)
- HPUX_IA64_MODE="32"
- ;;
- *ELF-64*)
- HPUX_IA64_MODE="64"
- ;;
- esac
- fi
- rm -rf conftest*
- ;;
-*-*-irix6*)
- # Find out which ABI we are using.
- echo '#line 12778 "configure"' > conftest.$ac_ext
- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; then
- if test "$lt_cv_prog_gnu_ld" = yes; then
- case `/usr/bin/file conftest.$ac_objext` in
- *32-bit*)
- LD="${LD-ld} -melf32bsmip"
- ;;
- *N32*)
- LD="${LD-ld} -melf32bmipn32"
- ;;
- *64-bit*)
- LD="${LD-ld} -melf64bmip"
- ;;
- esac
- else
- case `/usr/bin/file conftest.$ac_objext` in
- *32-bit*)
- LD="${LD-ld} -32"
- ;;
- *N32*)
- LD="${LD-ld} -n32"
- ;;
- *64-bit*)
- LD="${LD-ld} -64"
- ;;
- esac
- fi
- fi
- rm -rf conftest*
- ;;
-
-x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*)
- # Find out which ABI we are using.
- echo 'int i;' > conftest.$ac_ext
- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; then
- case `/usr/bin/file conftest.o` in
- *32-bit*)
- case $host in
- x86_64-*linux*)
- LD="${LD-ld} -m elf_i386"
- ;;
- ppc64-*linux*|powerpc64-*linux*)
- LD="${LD-ld} -m elf32ppclinux"
- ;;
- s390x-*linux*)
- LD="${LD-ld} -m elf_s390"
- ;;
- sparc64-*linux*)
- LD="${LD-ld} -m elf32_sparc"
- ;;
- esac
- ;;
- *64-bit*)
- case $host in
- x86_64-*linux*)
- LD="${LD-ld} -m elf_x86_64"
- ;;
- ppc*-*linux*|powerpc*-*linux*)
- LD="${LD-ld} -m elf64ppc"
- ;;
- s390*-*linux*)
- LD="${LD-ld} -m elf64_s390"
- ;;
- sparc*-*linux*)
- LD="${LD-ld} -m elf64_sparc"
- ;;
- esac
- ;;
- esac
- fi
- rm -rf conftest*
- ;;
-
-*-*-sco3.2v5*)
- # On SCO OpenServer 5, we need -belf to get full-featured binaries.
- SAVE_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS -belf"
- { echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5
-echo $ECHO_N "checking whether the C compiler needs -belf... $ECHO_C" >&6; }
-if test "${lt_cv_cc_needs_belf+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- lt_cv_cc_needs_belf=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- lt_cv_cc_needs_belf=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
- ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-fi
-{ echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5
-echo "${ECHO_T}$lt_cv_cc_needs_belf" >&6; }
- if test x"$lt_cv_cc_needs_belf" != x"yes"; then
- # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
- CFLAGS="$SAVE_CFLAGS"
- fi
- ;;
-sparc*-*solaris*)
- # Find out which ABI we are using.
- echo 'int i;' > conftest.$ac_ext
- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; then
- case `/usr/bin/file conftest.o` in
- *64-bit*)
- case $lt_cv_prog_gnu_ld in
- yes*) LD="${LD-ld} -m elf64_sparc" ;;
- *) LD="${LD-ld} -64" ;;
- esac
- ;;
- esac
- fi
- rm -rf conftest*
- ;;
-
-
-esac
-
-need_locks="$enable_libtool_lock"
-
-
-
-
-if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
- ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
- (test "X$CXX" != "Xg++"))) ; then
- ac_ext=cpp
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-{ echo "$as_me:$LINENO: checking how to run the C++ preprocessor" >&5
-echo $ECHO_N "checking how to run the C++ preprocessor... $ECHO_C" >&6; }
-if test -z "$CXXCPP"; then
- if test "${ac_cv_prog_CXXCPP+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- # Double quotes because CXXCPP needs to be expanded
- for CXXCPP in "$CXX -E" "/lib/cpp"
- do
- ac_preproc_ok=false
-for ac_cxx_preproc_warn_flag in '' yes
-do
- # Use a header file that comes with gcc, so configuring glibc
- # with a fresh cross-compiler works.
- # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- # <limits.h> exists even on freestanding compilers.
- # On the NeXT, cc -E runs the code through the compiler's parser,
- # not just through cpp. "Syntax error" is here to catch this case.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
- Syntax error
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_cxx_preproc_warn_flag
- ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag
- else
- ac_cpp_err=
- fi
-else
- ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
- :
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- # Broken: fails on valid input.
-continue
-fi
-
-rm -f conftest.err conftest.$ac_ext
-
- # OK, works on sane cases. Now check whether nonexistent headers
- # can be detected and how.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <ac_nonexistent.h>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_cxx_preproc_warn_flag
- ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag
- else
- ac_cpp_err=
- fi
-else
- ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
- # Broken: success on invalid input.
-continue
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- # Passes both tests.
-ac_preproc_ok=:
-break
-fi
-
-rm -f conftest.err conftest.$ac_ext
-
-done
-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then
- break
-fi
-
- done
- ac_cv_prog_CXXCPP=$CXXCPP
-
-fi
- CXXCPP=$ac_cv_prog_CXXCPP
-else
- ac_cv_prog_CXXCPP=$CXXCPP
-fi
-{ echo "$as_me:$LINENO: result: $CXXCPP" >&5
-echo "${ECHO_T}$CXXCPP" >&6; }
-ac_preproc_ok=false
-for ac_cxx_preproc_warn_flag in '' yes
-do
- # Use a header file that comes with gcc, so configuring glibc
- # with a fresh cross-compiler works.
- # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- # <limits.h> exists even on freestanding compilers.
- # On the NeXT, cc -E runs the code through the compiler's parser,
- # not just through cpp. "Syntax error" is here to catch this case.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
- Syntax error
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_cxx_preproc_warn_flag
- ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag
- else
- ac_cpp_err=
- fi
-else
- ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
- :
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- # Broken: fails on valid input.
-continue
-fi
-
-rm -f conftest.err conftest.$ac_ext
-
- # OK, works on sane cases. Now check whether nonexistent headers
- # can be detected and how.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <ac_nonexistent.h>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_cxx_preproc_warn_flag
- ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag
- else
- ac_cpp_err=
- fi
-else
- ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
- # Broken: success on invalid input.
-continue
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- # Passes both tests.
-ac_preproc_ok=:
-break
-fi
-
-rm -f conftest.err conftest.$ac_ext
-
-done
-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then
- :
-else
- { { echo "$as_me:$LINENO: error: C++ preprocessor \"$CXXCPP\" fails sanity check
-See \`config.log' for more details." >&5
-echo "$as_me: error: C++ preprocessor \"$CXXCPP\" fails sanity check
-See \`config.log' for more details." >&2;}
- { (exit 1); exit 1; }; }
-fi
-
-ac_ext=cpp
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-
-fi
-
-
-ac_ext=f
-ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'
-ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_f77_compiler_gnu
-if test -n "$ac_tool_prefix"; then
- for ac_prog in g77 f77 xlf frt pgf77 cf77 fort77 fl32 af77 f90 xlf90 pgf90 pghpf epcf90 gfortran g95 f95 fort xlf95 ifort ifc efc pgf95 lf95 ftn
- do
- # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
-set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_F77+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$F77"; then
- ac_cv_prog_F77="$F77" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_F77="$ac_tool_prefix$ac_prog"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
-fi
-fi
-F77=$ac_cv_prog_F77
-if test -n "$F77"; then
- { echo "$as_me:$LINENO: result: $F77" >&5
-echo "${ECHO_T}$F77" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-
- test -n "$F77" && break
- done
-fi
-if test -z "$F77"; then
- ac_ct_F77=$F77
- for ac_prog in g77 f77 xlf frt pgf77 cf77 fort77 fl32 af77 f90 xlf90 pgf90 pghpf epcf90 gfortran g95 f95 fort xlf95 ifort ifc efc pgf95 lf95 ftn
-do
- # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_ac_ct_F77+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$ac_ct_F77"; then
- ac_cv_prog_ac_ct_F77="$ac_ct_F77" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_ac_ct_F77="$ac_prog"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_F77=$ac_cv_prog_ac_ct_F77
-if test -n "$ac_ct_F77"; then
- { echo "$as_me:$LINENO: result: $ac_ct_F77" >&5
-echo "${ECHO_T}$ac_ct_F77" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-
- test -n "$ac_ct_F77" && break
-done
-
- if test "x$ac_ct_F77" = x; then
- F77=""
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&5
-echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&2;}
-ac_tool_warned=yes ;;
-esac
- F77=$ac_ct_F77
- fi
-fi
-
-
-# Provide some information about the compiler.
-echo "$as_me:$LINENO: checking for Fortran 77 compiler version" >&5
-ac_compiler=`set X $ac_compile; echo $2`
-{ (ac_try="$ac_compiler --version >&5"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compiler --version >&5") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }
-{ (ac_try="$ac_compiler -v >&5"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compiler -v >&5") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }
-{ (ac_try="$ac_compiler -V >&5"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compiler -V >&5") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }
-rm -f a.out
-
-# If we don't use `.F' as extension, the preprocessor is not run on the
-# input file. (Note that this only needs to work for GNU compilers.)
-ac_save_ext=$ac_ext
-ac_ext=F
-{ echo "$as_me:$LINENO: checking whether we are using the GNU Fortran 77 compiler" >&5
-echo $ECHO_N "checking whether we are using the GNU Fortran 77 compiler... $ECHO_C" >&6; }
-if test "${ac_cv_f77_compiler_gnu+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
- program main
-#ifndef __GNUC__
- choke me
-#endif
-
- end
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_f77_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_compiler_gnu=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_compiler_gnu=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-ac_cv_f77_compiler_gnu=$ac_compiler_gnu
-
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_f77_compiler_gnu" >&5
-echo "${ECHO_T}$ac_cv_f77_compiler_gnu" >&6; }
-ac_ext=$ac_save_ext
-ac_test_FFLAGS=${FFLAGS+set}
-ac_save_FFLAGS=$FFLAGS
-FFLAGS=
-{ echo "$as_me:$LINENO: checking whether $F77 accepts -g" >&5
-echo $ECHO_N "checking whether $F77 accepts -g... $ECHO_C" >&6; }
-if test "${ac_cv_prog_f77_g+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- FFLAGS=-g
-cat >conftest.$ac_ext <<_ACEOF
- program main
-
- end
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_f77_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_prog_f77_g=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_prog_f77_g=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_prog_f77_g" >&5
-echo "${ECHO_T}$ac_cv_prog_f77_g" >&6; }
-if test "$ac_test_FFLAGS" = set; then
- FFLAGS=$ac_save_FFLAGS
-elif test $ac_cv_prog_f77_g = yes; then
- if test "x$ac_cv_f77_compiler_gnu" = xyes; then
- FFLAGS="-g -O2"
- else
- FFLAGS="-g"
- fi
-else
- if test "x$ac_cv_f77_compiler_gnu" = xyes; then
- FFLAGS="-O2"
- else
- FFLAGS=
- fi
-fi
-
-G77=`test $ac_compiler_gnu = yes && echo yes`
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
-
-# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
-
-# find the maximum length of command line arguments
-{ echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5
-echo $ECHO_N "checking the maximum length of command line arguments... $ECHO_C" >&6; }
-if test "${lt_cv_sys_max_cmd_len+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- i=0
- teststring="ABCD"
-
- case $build_os in
- msdosdjgpp*)
- # On DJGPP, this test can blow up pretty badly due to problems in libc
- # (any single argument exceeding 2000 bytes causes a buffer overrun
- # during glob expansion). Even if it were fixed, the result of this
- # check would be larger than it should be.
- lt_cv_sys_max_cmd_len=12288; # 12K is about right
- ;;
-
- gnu*)
- # Under GNU Hurd, this test is not required because there is
- # no limit to the length of command line arguments.
- # Libtool will interpret -1 as no limit whatsoever
- lt_cv_sys_max_cmd_len=-1;
- ;;
-
- cygwin* | mingw*)
- # On Win9x/ME, this test blows up -- it succeeds, but takes
- # about 5 minutes as the teststring grows exponentially.
- # Worse, since 9x/ME are not pre-emptively multitasking,
- # you end up with a "frozen" computer, even though with patience
- # the test eventually succeeds (with a max line length of 256k).
- # Instead, let's just punt: use the minimum linelength reported by
- # all of the supported platforms: 8192 (on NT/2K/XP).
- lt_cv_sys_max_cmd_len=8192;
- ;;
-
- amigaos*)
- # On AmigaOS with pdksh, this test takes hours, literally.
- # So we just punt and use a minimum line length of 8192.
- lt_cv_sys_max_cmd_len=8192;
- ;;
-
- netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
- # This has been around since 386BSD, at least. Likely further.
- if test -x /sbin/sysctl; then
- lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
- elif test -x /usr/sbin/sysctl; then
- lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
- else
- lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs
- fi
- # And add a safety zone
- lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
- lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
- ;;
-
- interix*)
- # We know the value 262144 and hardcode it with a safety zone (like BSD)
- lt_cv_sys_max_cmd_len=196608
- ;;
-
- osf*)
- # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
- # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
- # nice to cause kernel panics so lets avoid the loop below.
- # First set a reasonable default.
- lt_cv_sys_max_cmd_len=16384
- #
- if test -x /sbin/sysconfig; then
- case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
- *1*) lt_cv_sys_max_cmd_len=-1 ;;
- esac
- fi
- ;;
- sco3.2v5*)
- lt_cv_sys_max_cmd_len=102400
- ;;
- sysv5* | sco5v6* | sysv4.2uw2*)
- kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
- if test -n "$kargmax"; then
- lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'`
- else
- lt_cv_sys_max_cmd_len=32768
- fi
- ;;
- *)
- # If test is not a shell built-in, we'll probably end up computing a
- # maximum length that is only half of the actual maximum length, but
- # we can't tell.
- SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
- while (test "X"`$SHELL $0 --fallback-echo "X$teststring" 2>/dev/null` \
- = "XX$teststring") >/dev/null 2>&1 &&
- new_result=`expr "X$teststring" : ".*" 2>&1` &&
- lt_cv_sys_max_cmd_len=$new_result &&
- test $i != 17 # 1/2 MB should be enough
- do
- i=`expr $i + 1`
- teststring=$teststring$teststring
- done
- teststring=
- # Add a significant safety factor because C++ compilers can tack on massive
- # amounts of additional arguments before passing them to the linker.
- # It appears as though 1/2 is a usable value.
- lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
- ;;
- esac
-
-fi
-
-if test -n $lt_cv_sys_max_cmd_len ; then
- { echo "$as_me:$LINENO: result: $lt_cv_sys_max_cmd_len" >&5
-echo "${ECHO_T}$lt_cv_sys_max_cmd_len" >&6; }
-else
- { echo "$as_me:$LINENO: result: none" >&5
-echo "${ECHO_T}none" >&6; }
-fi
-
-
-
-
-# Check for command to grab the raw symbol name followed by C symbol from nm.
-{ echo "$as_me:$LINENO: checking command to parse $NM output from $compiler object" >&5
-echo $ECHO_N "checking command to parse $NM output from $compiler object... $ECHO_C" >&6; }
-if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
-# These are sane defaults that work on at least a few old systems.
-# [They come from Ultrix. What could be older than Ultrix?!! ;)]
-
-# Character class describing NM global symbol codes.
-symcode='[BCDEGRST]'
-
-# Regexp to match symbols that can be accessed directly from C.
-sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
-
-# Transform an extracted symbol line into a proper C declaration
-lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'"
-
-# Transform an extracted symbol line into symbol name and symbol address
-lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'"
-
-# Define system-specific variables.
-case $host_os in
-aix*)
- symcode='[BCDT]'
- ;;
-cygwin* | mingw* | pw32*)
- symcode='[ABCDGISTW]'
- ;;
-hpux*) # Its linker distinguishes data from code symbols
- if test "$host_cpu" = ia64; then
- symcode='[ABCDEGRST]'
- fi
- lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
- lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'"
- ;;
-linux*)
- if test "$host_cpu" = ia64; then
- symcode='[ABCDGIRSTW]'
- lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
- lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'"
- fi
- ;;
-irix* | nonstopux*)
- symcode='[BCDEGRST]'
- ;;
-osf*)
- symcode='[BCDEGQRST]'
- ;;
-solaris*)
- symcode='[BDRT]'
- ;;
-sco3.2v5*)
- symcode='[DT]'
- ;;
-sysv4.2uw2*)
- symcode='[DT]'
- ;;
-sysv5* | sco5v6* | unixware* | OpenUNIX*)
- symcode='[ABDT]'
- ;;
-sysv4)
- symcode='[DFNSTU]'
- ;;
-esac
-
-# Handle CRLF in mingw tool chain
-opt_cr=
-case $build_os in
-mingw*)
- opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp
- ;;
-esac
-
-# If we're using GNU nm, then use its standard symbol codes.
-case `$NM -V 2>&1` in
-*GNU* | *'with BFD'*)
- symcode='[ABCDGIRSTW]' ;;
-esac
-
-# Try without a prefix undercore, then with it.
-for ac_symprfx in "" "_"; do
-
- # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
- symxfrm="\\1 $ac_symprfx\\2 \\2"
-
- # Write the raw and C identifiers.
- lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
-
- # Check to see that the pipe works correctly.
- pipe_works=no
-
- rm -f conftest*
- cat > conftest.$ac_ext <<EOF
-#ifdef __cplusplus
-extern "C" {
-#endif
-char nm_test_var;
-void nm_test_func(){}
-#ifdef __cplusplus
-}
-#endif
-int main(){nm_test_var='a';nm_test_func();return(0);}
-EOF
-
- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; then
- # Now try to grab the symbols.
- nlist=conftest.nm
- if { (eval echo "$as_me:$LINENO: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\"") >&5
- (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && test -s "$nlist"; then
- # Try sorting and uniquifying the output.
- if sort "$nlist" | uniq > "$nlist"T; then
- mv -f "$nlist"T "$nlist"
- else
- rm -f "$nlist"T
- fi
-
- # Make sure that we snagged all the symbols we need.
- if grep ' nm_test_var$' "$nlist" >/dev/null; then
- if grep ' nm_test_func$' "$nlist" >/dev/null; then
- cat <<EOF > conftest.$ac_ext
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-EOF
- # Now generate the symbol file.
- eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext'
-
- cat <<EOF >> conftest.$ac_ext
-#if defined (__STDC__) && __STDC__
-# define lt_ptr_t void *
-#else
-# define lt_ptr_t char *
-# define const
-#endif
-
-/* The mapping between symbol names and symbols. */
-const struct {
- const char *name;
- lt_ptr_t address;
-}
-lt_preloaded_symbols[] =
-{
-EOF
- $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext
- cat <<\EOF >> conftest.$ac_ext
- {0, (lt_ptr_t) 0}
-};
-
-#ifdef __cplusplus
-}
-#endif
-EOF
- # Now try linking the two files.
- mv conftest.$ac_objext conftstm.$ac_objext
- lt_save_LIBS="$LIBS"
- lt_save_CFLAGS="$CFLAGS"
- LIBS="conftstm.$ac_objext"
- CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag"
- if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && test -s conftest${ac_exeext}; then
- pipe_works=yes
- fi
- LIBS="$lt_save_LIBS"
- CFLAGS="$lt_save_CFLAGS"
- else
- echo "cannot find nm_test_func in $nlist" >&5
- fi
- else
- echo "cannot find nm_test_var in $nlist" >&5
- fi
- else
- echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5
- fi
- else
- echo "$progname: failed program was:" >&5
- cat conftest.$ac_ext >&5
- fi
- rm -f conftest* conftst*
-
- # Do not use the global_symbol_pipe unless it works.
- if test "$pipe_works" = yes; then
- break
- else
- lt_cv_sys_global_symbol_pipe=
- fi
-done
-
-fi
-
-if test -z "$lt_cv_sys_global_symbol_pipe"; then
- lt_cv_sys_global_symbol_to_cdecl=
-fi
-if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
- { echo "$as_me:$LINENO: result: failed" >&5
-echo "${ECHO_T}failed" >&6; }
-else
- { echo "$as_me:$LINENO: result: ok" >&5
-echo "${ECHO_T}ok" >&6; }
-fi
-
-{ echo "$as_me:$LINENO: checking for objdir" >&5
-echo $ECHO_N "checking for objdir... $ECHO_C" >&6; }
-if test "${lt_cv_objdir+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- rm -f .libs 2>/dev/null
-mkdir .libs 2>/dev/null
-if test -d .libs; then
- lt_cv_objdir=.libs
-else
- # MS-DOS does not allow filenames that begin with a dot.
- lt_cv_objdir=_libs
-fi
-rmdir .libs 2>/dev/null
-fi
-{ echo "$as_me:$LINENO: result: $lt_cv_objdir" >&5
-echo "${ECHO_T}$lt_cv_objdir" >&6; }
-objdir=$lt_cv_objdir
-
-
-
-
-
-case $host_os in
-aix3*)
- # AIX sometimes has problems with the GCC collect2 program. For some
- # reason, if we set the COLLECT_NAMES environment variable, the problems
- # vanish in a puff of smoke.
- if test "X${COLLECT_NAMES+set}" != Xset; then
- COLLECT_NAMES=
- export COLLECT_NAMES
- fi
- ;;
-esac
-
-# Sed substitution that helps us do robust quoting. It backslashifies
-# metacharacters that are still active within double-quoted strings.
-Xsed='sed -e 1s/^X//'
-sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g'
-
-# Same as above, but do not quote variable references.
-double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'
-
-# Sed substitution to delay expansion of an escaped shell variable in a
-# double_quote_subst'ed string.
-delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
-
-# Sed substitution to avoid accidental globbing in evaled expressions
-no_glob_subst='s/\*/\\\*/g'
-
-# Constants:
-rm="rm -f"
-
-# Global variables:
-default_ofile=mklib
-can_build_shared=yes
-
-# All known linkers require a `.a' archive for static linking (except MSVC,
-# which needs '.lib').
-libext=a
-ltmain="$ac_aux_dir/ltmain.sh"
-ofile="$default_ofile"
-with_gnu_ld="$lt_cv_prog_gnu_ld"
-
-if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
-set dummy ${ac_tool_prefix}ar; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_AR+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$AR"; then
- ac_cv_prog_AR="$AR" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_AR="${ac_tool_prefix}ar"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
-fi
-fi
-AR=$ac_cv_prog_AR
-if test -n "$AR"; then
- { echo "$as_me:$LINENO: result: $AR" >&5
-echo "${ECHO_T}$AR" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_AR"; then
- ac_ct_AR=$AR
- # Extract the first word of "ar", so it can be a program name with args.
-set dummy ar; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$ac_ct_AR"; then
- ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_ac_ct_AR="ar"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_AR=$ac_cv_prog_ac_ct_AR
-if test -n "$ac_ct_AR"; then
- { echo "$as_me:$LINENO: result: $ac_ct_AR" >&5
-echo "${ECHO_T}$ac_ct_AR" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
- if test "x$ac_ct_AR" = x; then
- AR="false"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&5
-echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&2;}
-ac_tool_warned=yes ;;
-esac
- AR=$ac_ct_AR
- fi
-else
- AR="$ac_cv_prog_AR"
-fi
-
-if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
-set dummy ${ac_tool_prefix}ranlib; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_RANLIB+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$RANLIB"; then
- ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
-fi
-fi
-RANLIB=$ac_cv_prog_RANLIB
-if test -n "$RANLIB"; then
- { echo "$as_me:$LINENO: result: $RANLIB" >&5
-echo "${ECHO_T}$RANLIB" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_RANLIB"; then
- ac_ct_RANLIB=$RANLIB
- # Extract the first word of "ranlib", so it can be a program name with args.
-set dummy ranlib; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$ac_ct_RANLIB"; then
- ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_ac_ct_RANLIB="ranlib"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
-if test -n "$ac_ct_RANLIB"; then
- { echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5
-echo "${ECHO_T}$ac_ct_RANLIB" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
- if test "x$ac_ct_RANLIB" = x; then
- RANLIB=":"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&5
-echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&2;}
-ac_tool_warned=yes ;;
-esac
- RANLIB=$ac_ct_RANLIB
- fi
-else
- RANLIB="$ac_cv_prog_RANLIB"
-fi
-
-if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
-set dummy ${ac_tool_prefix}strip; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_STRIP+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$STRIP"; then
- ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_STRIP="${ac_tool_prefix}strip"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
-fi
-fi
-STRIP=$ac_cv_prog_STRIP
-if test -n "$STRIP"; then
- { echo "$as_me:$LINENO: result: $STRIP" >&5
-echo "${ECHO_T}$STRIP" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_STRIP"; then
- ac_ct_STRIP=$STRIP
- # Extract the first word of "strip", so it can be a program name with args.
-set dummy strip; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$ac_ct_STRIP"; then
- ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_ac_ct_STRIP="strip"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
-if test -n "$ac_ct_STRIP"; then
- { echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
-echo "${ECHO_T}$ac_ct_STRIP" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
- if test "x$ac_ct_STRIP" = x; then
- STRIP=":"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&5
-echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&2;}
-ac_tool_warned=yes ;;
-esac
- STRIP=$ac_ct_STRIP
- fi
-else
- STRIP="$ac_cv_prog_STRIP"
-fi
-
-
-old_CC="$CC"
-old_CFLAGS="$CFLAGS"
-
-# Set sane defaults for various variables
-test -z "$AR" && AR=ar
-test -z "$AR_FLAGS" && AR_FLAGS=cru
-test -z "$AS" && AS=as
-test -z "$CC" && CC=cc
-test -z "$LTCC" && LTCC=$CC
-test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
-test -z "$DLLTOOL" && DLLTOOL=dlltool
-test -z "$LD" && LD=ld
-test -z "$LN_S" && LN_S="ln -s"
-test -z "$MAGIC_CMD" && MAGIC_CMD=file
-test -z "$NM" && NM=nm
-test -z "$SED" && SED=sed
-test -z "$OBJDUMP" && OBJDUMP=objdump
-test -z "$RANLIB" && RANLIB=:
-test -z "$STRIP" && STRIP=:
-test -z "$ac_objext" && ac_objext=o
-
-# Determine commands to create old-style static archives.
-old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
-old_postinstall_cmds='chmod 644 $oldlib'
-old_postuninstall_cmds=
-
-if test -n "$RANLIB"; then
- case $host_os in
- openbsd*)
- old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
- ;;
- *)
- old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
- ;;
- esac
- old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
-fi
-
-for cc_temp in $compiler""; do
- case $cc_temp in
- compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
- distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
- \-*) ;;
- *) break;;
- esac
-done
-cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
-
-
-# Only perform the check for file, if the check method requires it
-case $deplibs_check_method in
-file_magic*)
- if test "$file_magic_cmd" = '$MAGIC_CMD'; then
- { echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5
-echo $ECHO_N "checking for ${ac_tool_prefix}file... $ECHO_C" >&6; }
-if test "${lt_cv_path_MAGIC_CMD+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- case $MAGIC_CMD in
-[\\/*] | ?:[\\/]*)
- lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
- ;;
-*)
- lt_save_MAGIC_CMD="$MAGIC_CMD"
- lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
- ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
- for ac_dir in $ac_dummy; do
- IFS="$lt_save_ifs"
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/${ac_tool_prefix}file; then
- lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file"
- if test -n "$file_magic_test_file"; then
- case $deplibs_check_method in
- "file_magic "*)
- file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
- MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
- if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
- $EGREP "$file_magic_regex" > /dev/null; then
- :
- else
- cat <<EOF 1>&2
-
-*** Warning: the command libtool uses to detect shared libraries,
-*** $file_magic_cmd, produces output that libtool cannot recognize.
-*** The result is that libtool may fail to recognize shared libraries
-*** as such. This will affect the creation of libtool libraries that
-*** depend on shared libraries, but programs linked with such libtool
-*** libraries will work regardless of this problem. Nevertheless, you
-*** may want to report the problem to your system manager and/or to
-*** bug-libtool@gnu.org
-
-EOF
- fi ;;
- esac
- fi
- break
- fi
- done
- IFS="$lt_save_ifs"
- MAGIC_CMD="$lt_save_MAGIC_CMD"
- ;;
-esac
-fi
-
-MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
-if test -n "$MAGIC_CMD"; then
- { echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5
-echo "${ECHO_T}$MAGIC_CMD" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-if test -z "$lt_cv_path_MAGIC_CMD"; then
- if test -n "$ac_tool_prefix"; then
- { echo "$as_me:$LINENO: checking for file" >&5
-echo $ECHO_N "checking for file... $ECHO_C" >&6; }
-if test "${lt_cv_path_MAGIC_CMD+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- case $MAGIC_CMD in
-[\\/*] | ?:[\\/]*)
- lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
- ;;
-*)
- lt_save_MAGIC_CMD="$MAGIC_CMD"
- lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
- ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
- for ac_dir in $ac_dummy; do
- IFS="$lt_save_ifs"
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/file; then
- lt_cv_path_MAGIC_CMD="$ac_dir/file"
- if test -n "$file_magic_test_file"; then
- case $deplibs_check_method in
- "file_magic "*)
- file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
- MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
- if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
- $EGREP "$file_magic_regex" > /dev/null; then
- :
- else
- cat <<EOF 1>&2
-
-*** Warning: the command libtool uses to detect shared libraries,
-*** $file_magic_cmd, produces output that libtool cannot recognize.
-*** The result is that libtool may fail to recognize shared libraries
-*** as such. This will affect the creation of libtool libraries that
-*** depend on shared libraries, but programs linked with such libtool
-*** libraries will work regardless of this problem. Nevertheless, you
-*** may want to report the problem to your system manager and/or to
-*** bug-libtool@gnu.org
-
-EOF
- fi ;;
- esac
- fi
- break
- fi
- done
- IFS="$lt_save_ifs"
- MAGIC_CMD="$lt_save_MAGIC_CMD"
- ;;
-esac
-fi
-
-MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
-if test -n "$MAGIC_CMD"; then
- { echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5
-echo "${ECHO_T}$MAGIC_CMD" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
- else
- MAGIC_CMD=:
- fi
-fi
-
- fi
- ;;
-esac
-
-enable_dlopen=yes
-enable_win32_dll=no
-
-# Check whether --enable-libtool-lock was given.
-if test "${enable_libtool_lock+set}" = set; then
- enableval=$enable_libtool_lock;
-fi
-
-test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
-
-
-# Check whether --with-pic was given.
-if test "${with_pic+set}" = set; then
- withval=$with_pic; pic_mode="$withval"
-else
- pic_mode=default
-fi
-
-test -z "$pic_mode" && pic_mode=default
-
-# Use C for the default configuration in the libtool script
-tagname=
-lt_save_CC="$CC"
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
-# Source file extension for C test sources.
-ac_ext=c
-
-# Object file extension for compiled C test sources.
-objext=o
-objext=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code="int some_variable = 0;\n"
-
-# Code to be used in simple link tests
-lt_simple_link_test_code='int main(){return(0);}\n'
-
-
-# If no C compiler was specified, use CC.
-LTCC=${LTCC-"$CC"}
-
-# If no C compiler flags were specified, use CFLAGS.
-LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
-
-# Allow CC to be a program name with arguments.
-compiler=$CC
-
-
-# save warnings/boilerplate of simple test code
-ac_outfile=conftest.$ac_objext
-printf "$lt_simple_compile_test_code" >conftest.$ac_ext
-eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_compiler_boilerplate=`cat conftest.err`
-$rm conftest*
-
-ac_outfile=conftest.$ac_objext
-printf "$lt_simple_link_test_code" >conftest.$ac_ext
-eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_linker_boilerplate=`cat conftest.err`
-$rm conftest*
-
-
-
-lt_prog_compiler_no_builtin_flag=
-
-if test "$GCC" = yes; then
- lt_prog_compiler_no_builtin_flag=' -fno-builtin'
-
-
-{ echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
-echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6; }
-if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- lt_cv_prog_compiler_rtti_exceptions=no
- ac_outfile=conftest.$ac_objext
- printf "$lt_simple_compile_test_code" > conftest.$ac_ext
- lt_compiler_flag="-fno-rtti -fno-exceptions"
- # Insert the option either (1) after the last *FLAGS variable, or
- # (2) before a word containing "conftest.", or (3) at the end.
- # Note that $ac_compile itself does not contain backslashes and begins
- # with a dollar sign (not a hyphen), so the echo should work correctly.
- # The option is referenced via a variable to avoid confusing sed.
- lt_compile=`echo "$ac_compile" | $SED \
- -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
- -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
- -e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:14496: $lt_compile\"" >&5)
- (eval "$lt_compile" 2>conftest.err)
- ac_status=$?
- cat conftest.err >&5
- echo "$as_me:14500: \$? = $ac_status" >&5
- if (exit $ac_status) && test -s "$ac_outfile"; then
- # The compiler can only warn and ignore the option if not recognized
- # So say no if there are warnings other than the usual output.
- $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
- $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
- if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
- lt_cv_prog_compiler_rtti_exceptions=yes
- fi
- fi
- $rm conftest*
-
-fi
-{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
-echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6; }
-
-if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then
- lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions"
-else
- :
-fi
-
-fi
-
-lt_prog_compiler_wl=
-lt_prog_compiler_pic=
-lt_prog_compiler_static=
-
-{ echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
-echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
-
- if test "$GCC" = yes; then
- lt_prog_compiler_wl='-Wl,'
- lt_prog_compiler_static='-static'
-
- case $host_os in
- aix*)
- # All AIX code is PIC.
- if test "$host_cpu" = ia64; then
- # AIX 5 now supports IA64 processor
- lt_prog_compiler_static='-Bstatic'
- fi
- ;;
-
- amigaos*)
- # FIXME: we need at least 68020 code to build shared libraries, but
- # adding the `-m68020' flag to GCC prevents building anything better,
- # like `-m68040'.
- lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4'
- ;;
-
- beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
- # PIC is the default for these OSes.
- ;;
-
- mingw* | pw32* | os2*)
- # This hack is so that the source file can tell whether it is being
- # built for inclusion in a dll (and should export symbols for example).
- lt_prog_compiler_pic='-DDLL_EXPORT'
- ;;
-
- darwin* | rhapsody*)
- # PIC is the default on this platform
- # Common symbols not allowed in MH_DYLIB files
- lt_prog_compiler_pic='-fno-common'
- ;;
-
- interix3*)
- # Interix 3.x gcc -fpic/-fPIC options generate broken code.
- # Instead, we relocate shared libraries at runtime.
- ;;
-
- msdosdjgpp*)
- # Just because we use GCC doesn't mean we suddenly get shared libraries
- # on systems that don't support them.
- lt_prog_compiler_can_build_shared=no
- enable_shared=no
- ;;
-
- sysv4*MP*)
- if test -d /usr/nec; then
- lt_prog_compiler_pic=-Kconform_pic
- fi
- ;;
-
- hpux*)
- # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
- # not for PA HP-UX.
- case $host_cpu in
- hppa*64*|ia64*)
- # +Z the default
- ;;
- *)
- lt_prog_compiler_pic='-fPIC'
- ;;
- esac
- ;;
-
- *)
- lt_prog_compiler_pic='-fPIC'
- ;;
- esac
- else
- # PORTME Check for flag to pass linker flags through the system compiler.
- case $host_os in
- aix*)
- lt_prog_compiler_wl='-Wl,'
- if test "$host_cpu" = ia64; then
- # AIX 5 now supports IA64 processor
- lt_prog_compiler_static='-Bstatic'
- else
- lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp'
- fi
- ;;
- darwin*)
- # PIC is the default on this platform
- # Common symbols not allowed in MH_DYLIB files
- case $cc_basename in
- xlc*)
- lt_prog_compiler_pic='-qnocommon'
- lt_prog_compiler_wl='-Wl,'
- ;;
- esac
- ;;
-
- mingw* | pw32* | os2*)
- # This hack is so that the source file can tell whether it is being
- # built for inclusion in a dll (and should export symbols for example).
- lt_prog_compiler_pic='-DDLL_EXPORT'
- ;;
-
- hpux9* | hpux10* | hpux11*)
- lt_prog_compiler_wl='-Wl,'
- # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
- # not for PA HP-UX.
- case $host_cpu in
- hppa*64*|ia64*)
- # +Z the default
- ;;
- *)
- lt_prog_compiler_pic='+Z'
- ;;
- esac
- # Is there a better lt_prog_compiler_static that works with the bundled CC?
- lt_prog_compiler_static='${wl}-a ${wl}archive'
- ;;
-
- irix5* | irix6* | nonstopux*)
- lt_prog_compiler_wl='-Wl,'
- # PIC (with -KPIC) is the default.
- lt_prog_compiler_static='-non_shared'
- ;;
-
- newsos6)
- lt_prog_compiler_pic='-KPIC'
- lt_prog_compiler_static='-Bstatic'
- ;;
-
- linux*)
- case $cc_basename in
- icc* | ecc*)
- lt_prog_compiler_wl='-Wl,'
- lt_prog_compiler_pic='-KPIC'
- lt_prog_compiler_static='-static'
- ;;
- pgcc* | pgf77* | pgf90* | pgf95*)
- # Portland Group compilers (*not* the Pentium gcc compiler,
- # which looks to be a dead project)
- lt_prog_compiler_wl='-Wl,'
- lt_prog_compiler_pic='-fpic'
- lt_prog_compiler_static='-Bstatic'
- ;;
- ccc*)
- lt_prog_compiler_wl='-Wl,'
- # All Alpha code is PIC.
- lt_prog_compiler_static='-non_shared'
- ;;
- esac
- ;;
-
- osf3* | osf4* | osf5*)
- lt_prog_compiler_wl='-Wl,'
- # All OSF/1 code is PIC.
- lt_prog_compiler_static='-non_shared'
- ;;
-
- solaris*)
- lt_prog_compiler_pic='-KPIC'
- lt_prog_compiler_static='-Bstatic'
- case $cc_basename in
- f77* | f90* | f95*)
- lt_prog_compiler_wl='-Qoption ld ';;
- *)
- lt_prog_compiler_wl='-Wl,';;
- esac
- ;;
-
- sunos4*)
- lt_prog_compiler_wl='-Qoption ld '
- lt_prog_compiler_pic='-PIC'
- lt_prog_compiler_static='-Bstatic'
- ;;
-
- sysv4 | sysv4.2uw2* | sysv4.3*)
- lt_prog_compiler_wl='-Wl,'
- lt_prog_compiler_pic='-KPIC'
- lt_prog_compiler_static='-Bstatic'
- ;;
-
- sysv4*MP*)
- if test -d /usr/nec ;then
- lt_prog_compiler_pic='-Kconform_pic'
- lt_prog_compiler_static='-Bstatic'
- fi
- ;;
-
- sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
- lt_prog_compiler_wl='-Wl,'
- lt_prog_compiler_pic='-KPIC'
- lt_prog_compiler_static='-Bstatic'
- ;;
-
- unicos*)
- lt_prog_compiler_wl='-Wl,'
- lt_prog_compiler_can_build_shared=no
- ;;
-
- uts4*)
- lt_prog_compiler_pic='-pic'
- lt_prog_compiler_static='-Bstatic'
- ;;
-
- *)
- lt_prog_compiler_can_build_shared=no
- ;;
- esac
- fi
-
-{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic" >&5
-echo "${ECHO_T}$lt_prog_compiler_pic" >&6; }
-
-#
-# Check to make sure the PIC flag actually works.
-#
-if test -n "$lt_prog_compiler_pic"; then
-
-{ echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5
-echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic works... $ECHO_C" >&6; }
-if test "${lt_prog_compiler_pic_works+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- lt_prog_compiler_pic_works=no
- ac_outfile=conftest.$ac_objext
- printf "$lt_simple_compile_test_code" > conftest.$ac_ext
- lt_compiler_flag="$lt_prog_compiler_pic -DPIC"
- # Insert the option either (1) after the last *FLAGS variable, or
- # (2) before a word containing "conftest.", or (3) at the end.
- # Note that $ac_compile itself does not contain backslashes and begins
- # with a dollar sign (not a hyphen), so the echo should work correctly.
- # The option is referenced via a variable to avoid confusing sed.
- lt_compile=`echo "$ac_compile" | $SED \
- -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
- -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
- -e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:14764: $lt_compile\"" >&5)
- (eval "$lt_compile" 2>conftest.err)
- ac_status=$?
- cat conftest.err >&5
- echo "$as_me:14768: \$? = $ac_status" >&5
- if (exit $ac_status) && test -s "$ac_outfile"; then
- # The compiler can only warn and ignore the option if not recognized
- # So say no if there are warnings other than the usual output.
- $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
- $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
- if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
- lt_prog_compiler_pic_works=yes
- fi
- fi
- $rm conftest*
-
-fi
-{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works" >&5
-echo "${ECHO_T}$lt_prog_compiler_pic_works" >&6; }
-
-if test x"$lt_prog_compiler_pic_works" = xyes; then
- case $lt_prog_compiler_pic in
- "" | " "*) ;;
- *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;;
- esac
-else
- lt_prog_compiler_pic=
- lt_prog_compiler_can_build_shared=no
-fi
-
-fi
-case $host_os in
- # For platforms which do not support PIC, -DPIC is meaningless:
- *djgpp*)
- lt_prog_compiler_pic=
- ;;
- *)
- lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC"
- ;;
-esac
-
-#
-# Check to make sure the static flag actually works.
-#
-wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\"
-{ echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5
-echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; }
-if test "${lt_prog_compiler_static_works+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- lt_prog_compiler_static_works=no
- save_LDFLAGS="$LDFLAGS"
- LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
- printf "$lt_simple_link_test_code" > conftest.$ac_ext
- if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
- # The linker can only warn and ignore the option if not recognized
- # So say no if there are warnings
- if test -s conftest.err; then
- # Append any errors to the config.log.
- cat conftest.err 1>&5
- $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
- $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
- if diff conftest.exp conftest.er2 >/dev/null; then
- lt_prog_compiler_static_works=yes
- fi
- else
- lt_prog_compiler_static_works=yes
- fi
- fi
- $rm conftest*
- LDFLAGS="$save_LDFLAGS"
-
-fi
-{ echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works" >&5
-echo "${ECHO_T}$lt_prog_compiler_static_works" >&6; }
-
-if test x"$lt_prog_compiler_static_works" = xyes; then
- :
-else
- lt_prog_compiler_static=
-fi
-
-
-{ echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
-echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; }
-if test "${lt_cv_prog_compiler_c_o+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- lt_cv_prog_compiler_c_o=no
- $rm -r conftest 2>/dev/null
- mkdir conftest
- cd conftest
- mkdir out
- printf "$lt_simple_compile_test_code" > conftest.$ac_ext
-
- lt_compiler_flag="-o out/conftest2.$ac_objext"
- # Insert the option either (1) after the last *FLAGS variable, or
- # (2) before a word containing "conftest.", or (3) at the end.
- # Note that $ac_compile itself does not contain backslashes and begins
- # with a dollar sign (not a hyphen), so the echo should work correctly.
- lt_compile=`echo "$ac_compile" | $SED \
- -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
- -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
- -e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:14868: $lt_compile\"" >&5)
- (eval "$lt_compile" 2>out/conftest.err)
- ac_status=$?
- cat out/conftest.err >&5
- echo "$as_me:14872: \$? = $ac_status" >&5
- if (exit $ac_status) && test -s out/conftest2.$ac_objext
- then
- # The compiler can only warn and ignore the option if not recognized
- # So say no if there are warnings
- $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
- $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
- if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
- lt_cv_prog_compiler_c_o=yes
- fi
- fi
- chmod u+w . 2>&5
- $rm conftest*
- # SGI C++ compiler will create directory out/ii_files/ for
- # template instantiation
- test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files
- $rm out/* && rmdir out
- cd ..
- rmdir conftest
- $rm conftest*
-
-fi
-{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5
-echo "${ECHO_T}$lt_cv_prog_compiler_c_o" >&6; }
-
-
-hard_links="nottested"
-if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then
- # do not overwrite the value of need_locks provided by the user
- { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
-echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6; }
- hard_links=yes
- $rm conftest*
- ln conftest.a conftest.b 2>/dev/null && hard_links=no
- touch conftest.a
- ln conftest.a conftest.b 2>&5 || hard_links=no
- ln conftest.a conftest.b 2>/dev/null && hard_links=no
- { echo "$as_me:$LINENO: result: $hard_links" >&5
-echo "${ECHO_T}$hard_links" >&6; }
- if test "$hard_links" = no; then
- { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
-echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
- need_locks=warn
- fi
-else
- need_locks=no
-fi
-
-{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
-echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; }
-
- runpath_var=
- allow_undefined_flag=
- enable_shared_with_static_runtimes=no
- archive_cmds=
- archive_expsym_cmds=
- old_archive_From_new_cmds=
- old_archive_from_expsyms_cmds=
- export_dynamic_flag_spec=
- whole_archive_flag_spec=
- thread_safe_flag_spec=
- hardcode_libdir_flag_spec=
- hardcode_libdir_flag_spec_ld=
- hardcode_libdir_separator=
- hardcode_direct=no
- hardcode_minus_L=no
- hardcode_shlibpath_var=unsupported
- link_all_deplibs=unknown
- hardcode_automatic=no
- module_cmds=
- module_expsym_cmds=
- always_export_symbols=no
- export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
- # include_expsyms should be a list of space-separated symbols to be *always*
- # included in the symbol list
- include_expsyms=
- # exclude_expsyms can be an extended regexp of symbols to exclude
- # it will be wrapped by ` (' and `)$', so one must not match beginning or
- # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
- # as well as any symbol that contains `d'.
- exclude_expsyms="_GLOBAL_OFFSET_TABLE_"
- # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
- # platforms (ab)use it in PIC code, but their linkers get confused if
- # the symbol is explicitly referenced. Since portable code cannot
- # rely on this symbol name, it's probably fine to never include it in
- # preloaded symbol tables.
- extract_expsyms_cmds=
- # Just being paranoid about ensuring that cc_basename is set.
- for cc_temp in $compiler""; do
- case $cc_temp in
- compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
- distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
- \-*) ;;
- *) break;;
- esac
-done
-cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
-
- case $host_os in
- cygwin* | mingw* | pw32*)
- # FIXME: the MSVC++ port hasn't been tested in a loooong time
- # When not using gcc, we currently assume that we are using
- # Microsoft Visual C++.
- if test "$GCC" != yes; then
- with_gnu_ld=no
- fi
- ;;
- interix*)
- # we just hope/assume this is gcc and not c89 (= MSVC++)
- with_gnu_ld=yes
- ;;
- openbsd*)
- with_gnu_ld=no
- ;;
- esac
-
- ld_shlibs=yes
- if test "$with_gnu_ld" = yes; then
- # If archive_cmds runs LD, not CC, wlarc should be empty
- wlarc='${wl}'
-
- # Set some defaults for GNU ld with shared library support. These
- # are reset later if shared libraries are not supported. Putting them
- # here allows them to be overridden if necessary.
- runpath_var=LD_RUN_PATH
- hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir'
- export_dynamic_flag_spec='${wl}--export-dynamic'
- # ancient GNU ld didn't support --whole-archive et. al.
- if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then
- whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
- else
- whole_archive_flag_spec=
- fi
- supports_anon_versioning=no
- case `$LD -v 2>/dev/null` in
- *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
- *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
- *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
- *\ 2.11.*) ;; # other 2.11 versions
- *) supports_anon_versioning=yes ;;
- esac
-
- # See if GNU ld supports shared libraries.
- case $host_os in
- aix3* | aix4* | aix5*)
- # On AIX/PPC, the GNU linker is very broken
- if test "$host_cpu" != ia64; then
- ld_shlibs=no
- cat <<EOF 1>&2
-
-*** Warning: the GNU linker, at least up to release 2.9.1, is reported
-*** to be unable to reliably create shared libraries on AIX.
-*** Therefore, libtool is disabling shared libraries support. If you
-*** really care for shared libraries, you may want to modify your PATH
-*** so that a non-GNU linker is found, and then restart.
-
-EOF
- fi
- ;;
-
- amigaos*)
- archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
- hardcode_libdir_flag_spec='-L$libdir'
- hardcode_minus_L=yes
-
- # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
- # that the semantics of dynamic libraries on AmigaOS, at least up
- # to version 4, is to share data among multiple programs linked
- # with the same dynamic library. Since this doesn't match the
- # behavior of shared libraries on other platforms, we can't use
- # them.
- ld_shlibs=no
- ;;
-
- beos*)
- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- allow_undefined_flag=unsupported
- # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
- # support --undefined. This deserves some investigation. FIXME
- archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- else
- ld_shlibs=no
- fi
- ;;
-
- cygwin* | mingw* | pw32*)
- # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless,
- # as there is no search path for DLLs.
- hardcode_libdir_flag_spec='-L$libdir'
- allow_undefined_flag=unsupported
- always_export_symbols=no
- enable_shared_with_static_runtimes=yes
- export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
-
- if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
- # If the export-symbols file already is a .def file (1st line
- # is EXPORTS), use it as is; otherwise, prepend...
- archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
- cp $export_symbols $output_objdir/$soname.def;
- else
- echo EXPORTS > $output_objdir/$soname.def;
- cat $export_symbols >> $output_objdir/$soname.def;
- fi~
- $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
- else
- ld_shlibs=no
- fi
- ;;
-
- interix3*)
- hardcode_direct=no
- hardcode_shlibpath_var=no
- hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
- export_dynamic_flag_spec='${wl}-E'
- # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
- # Instead, shared libraries are loaded at an image base (0x10000000 by
- # default) and relocated if they conflict, which is a slow very memory
- # consuming and fragmenting process. To avoid this, we pick a random,
- # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
- # time. Moving up from 0x10000000 also allows more sbrk(2) space.
- archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
- archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
- ;;
-
- linux*)
- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- tmp_addflag=
- case $cc_basename,$host_cpu in
- pgcc*) # Portland Group C compiler
- whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
- tmp_addflag=' $pic_flag'
- ;;
- pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers
- whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
- tmp_addflag=' $pic_flag -Mnomain' ;;
- ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64
- tmp_addflag=' -i_dynamic' ;;
- efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64
- tmp_addflag=' -i_dynamic -nofor_main' ;;
- ifc* | ifort*) # Intel Fortran compiler
- tmp_addflag=' -nofor_main' ;;
- esac
- archive_cmds='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-
- if test $supports_anon_versioning = yes; then
- archive_expsym_cmds='$echo "{ global:" > $output_objdir/$libname.ver~
- cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
- $echo "local: *; };" >> $output_objdir/$libname.ver~
- $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
- fi
- else
- ld_shlibs=no
- fi
- ;;
-
- netbsd*)
- if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
- archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
- wlarc=
- else
- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
- fi
- ;;
-
- solaris*)
- if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
- ld_shlibs=no
- cat <<EOF 1>&2
-
-*** Warning: The releases 2.8.* of the GNU linker cannot reliably
-*** create shared libraries on Solaris systems. Therefore, libtool
-*** is disabling shared libraries support. We urge you to upgrade GNU
-*** binutils to release 2.9.1 or newer. Another option is to modify
-*** your PATH or compiler configuration so that the native linker is
-*** used, and then restart.
-
-EOF
- elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
- else
- ld_shlibs=no
- fi
- ;;
-
- sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
- case `$LD -v 2>&1` in
- *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
- ld_shlibs=no
- cat <<_LT_EOF 1>&2
-
-*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
-*** reliably create shared libraries on SCO systems. Therefore, libtool
-*** is disabling shared libraries support. We urge you to upgrade GNU
-*** binutils to release 2.16.91.0.3 or newer. Another option is to modify
-*** your PATH or compiler configuration so that the native linker is
-*** used, and then restart.
-
-_LT_EOF
- ;;
- *)
- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib'
- archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib'
- else
- ld_shlibs=no
- fi
- ;;
- esac
- ;;
-
- sunos4*)
- archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
- wlarc=
- hardcode_direct=yes
- hardcode_shlibpath_var=no
- ;;
-
- *)
- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
- else
- ld_shlibs=no
- fi
- ;;
- esac
-
- if test "$ld_shlibs" = no; then
- runpath_var=
- hardcode_libdir_flag_spec=
- export_dynamic_flag_spec=
- whole_archive_flag_spec=
- fi
- else
- # PORTME fill in a description of your system's linker (not GNU ld)
- case $host_os in
- aix3*)
- allow_undefined_flag=unsupported
- always_export_symbols=yes
- archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
- # Note: this linker hardcodes the directories in LIBPATH if there
- # are no directories specified by -L.
- hardcode_minus_L=yes
- if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
- # Neither direct hardcoding nor static linking is supported with a
- # broken collect2.
- hardcode_direct=unsupported
- fi
- ;;
-
- aix4* | aix5*)
- if test "$host_cpu" = ia64; then
- # On IA64, the linker does run time linking by default, so we don't
- # have to do anything special.
- aix_use_runtimelinking=no
- exp_sym_flag='-Bexport'
- no_entry_flag=""
- else
- # If we're using GNU nm, then we don't want the "-C" option.
- # -C means demangle to AIX nm, but means don't demangle with GNU nm
- if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
- export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
- else
- export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
- fi
- aix_use_runtimelinking=no
-
- # Test if we are trying to use run time linking or normal
- # AIX style linking. If -brtl is somewhere in LDFLAGS, we
- # need to do runtime linking.
- case $host_os in aix4.[23]|aix4.[23].*|aix5*)
- for ld_flag in $LDFLAGS; do
- if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
- aix_use_runtimelinking=yes
- break
- fi
- done
- ;;
- esac
-
- exp_sym_flag='-bexport'
- no_entry_flag='-bnoentry'
- fi
-
- # When large executables or shared objects are built, AIX ld can
- # have problems creating the table of contents. If linking a library
- # or program results in "error TOC overflow" add -mminimal-toc to
- # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
- # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
-
- archive_cmds=''
- hardcode_direct=yes
- hardcode_libdir_separator=':'
- link_all_deplibs=yes
-
- if test "$GCC" = yes; then
- case $host_os in aix4.[012]|aix4.[012].*)
- # We only want to do this on AIX 4.2 and lower, the check
- # below for broken collect2 doesn't work under 4.3+
- collect2name=`${CC} -print-prog-name=collect2`
- if test -f "$collect2name" && \
- strings "$collect2name" | grep resolve_lib_name >/dev/null
- then
- # We have reworked collect2
- hardcode_direct=yes
- else
- # We have old collect2
- hardcode_direct=unsupported
- # It fails to find uninstalled libraries when the uninstalled
- # path is not listed in the libpath. Setting hardcode_minus_L
- # to unsupported forces relinking
- hardcode_minus_L=yes
- hardcode_libdir_flag_spec='-L$libdir'
- hardcode_libdir_separator=
- fi
- ;;
- esac
- shared_flag='-shared'
- if test "$aix_use_runtimelinking" = yes; then
- shared_flag="$shared_flag "'${wl}-G'
- fi
- else
- # not using gcc
- if test "$host_cpu" = ia64; then
- # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
- # chokes on -Wl,-G. The following line is correct:
- shared_flag='-G'
- else
- if test "$aix_use_runtimelinking" = yes; then
- shared_flag='${wl}-G'
- else
- shared_flag='${wl}-bM:SRE'
- fi
- fi
- fi
-
- # It seems that -bexpall does not export symbols beginning with
- # underscore (_), so it is better to generate a list of symbols to export.
- always_export_symbols=yes
- if test "$aix_use_runtimelinking" = yes; then
- # Warning - without using the other runtime loading flags (-brtl),
- # -berok will link without error, but may produce a broken library.
- allow_undefined_flag='-berok'
- # Determine the default libpath from the value encoded in an empty executable.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
-
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
-}'`
-# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
-}'`; fi
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
-fi
-
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
-
- hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
- archive_expsym_cmds="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
- else
- if test "$host_cpu" = ia64; then
- hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
- allow_undefined_flag="-z nodefs"
- archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
- else
- # Determine the default libpath from the value encoded in an empty executable.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
-
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
-}'`
-# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
-}'`; fi
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
-fi
-
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
-
- hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
- # Warning - without using the other run time loading flags,
- # -berok will link without error, but may produce a broken library.
- no_undefined_flag=' ${wl}-bernotok'
- allow_undefined_flag=' ${wl}-berok'
- # Exported symbols can be pulled into shared objects from archives
- whole_archive_flag_spec='$convenience'
- archive_cmds_need_lc=yes
- # This is similar to how AIX traditionally builds its shared libraries.
- archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
- fi
- fi
- ;;
-
- amigaos*)
- archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
- hardcode_libdir_flag_spec='-L$libdir'
- hardcode_minus_L=yes
- # see comment about different semantics on the GNU ld section
- ld_shlibs=no
- ;;
-
- bsdi[45]*)
- export_dynamic_flag_spec=-rdynamic
- ;;
-
- cygwin* | mingw* | pw32*)
- # When not using gcc, we currently assume that we are using
- # Microsoft Visual C++.
- # hardcode_libdir_flag_spec is actually meaningless, as there is
- # no search path for DLLs.
- hardcode_libdir_flag_spec=' '
- allow_undefined_flag=unsupported
- # Tell ltmain to make .lib files, not .a files.
- libext=lib
- # Tell ltmain to make .dll files, not .so files.
- shrext_cmds=".dll"
- # FIXME: Setting linknames here is a bad hack.
- archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
- # The linker will automatically build a .lib file if we build a DLL.
- old_archive_From_new_cmds='true'
- # FIXME: Should let the user specify the lib program.
- old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs'
- fix_srcfile_path='`cygpath -w "$srcfile"`'
- enable_shared_with_static_runtimes=yes
- ;;
-
- darwin* | rhapsody*)
- case $host_os in
- rhapsody* | darwin1.[012])
- allow_undefined_flag='${wl}-undefined ${wl}suppress'
- ;;
- *) # Darwin 1.3 on
- if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
- allow_undefined_flag='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
- else
- case ${MACOSX_DEPLOYMENT_TARGET} in
- 10.[012])
- allow_undefined_flag='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
- ;;
- 10.*)
- allow_undefined_flag='${wl}-undefined ${wl}dynamic_lookup'
- ;;
- esac
- fi
- ;;
- esac
- archive_cmds_need_lc=no
- hardcode_direct=no
- hardcode_automatic=yes
- hardcode_shlibpath_var=unsupported
- whole_archive_flag_spec=''
- link_all_deplibs=yes
- if test "$GCC" = yes ; then
- output_verbose_link_cmd='echo'
- archive_cmds='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
- module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
- # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
- archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- else
- case $cc_basename in
- xlc*)
- output_verbose_link_cmd='echo'
- archive_cmds='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
- module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
- # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
- archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- ;;
- *)
- ld_shlibs=no
- ;;
- esac
- fi
- ;;
-
- dgux*)
- archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_libdir_flag_spec='-L$libdir'
- hardcode_shlibpath_var=no
- ;;
-
- freebsd1*)
- ld_shlibs=no
- ;;
-
- # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
- # support. Future versions do this automatically, but an explicit c++rt0.o
- # does not break anything, and helps significantly (at the cost of a little
- # extra space).
- freebsd2.2*)
- archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
- hardcode_libdir_flag_spec='-R$libdir'
- hardcode_direct=yes
- hardcode_shlibpath_var=no
- ;;
-
- # Unfortunately, older versions of FreeBSD 2 do not have this feature.
- freebsd2*)
- archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
- hardcode_direct=yes
- hardcode_minus_L=yes
- hardcode_shlibpath_var=no
- ;;
-
- # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
- freebsd* | kfreebsd*-gnu | dragonfly*)
- archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
- hardcode_libdir_flag_spec='-R$libdir'
- hardcode_direct=yes
- hardcode_shlibpath_var=no
- ;;
-
- hpux9*)
- if test "$GCC" = yes; then
- archive_cmds='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
- else
- archive_cmds='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
- fi
- hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
- hardcode_libdir_separator=:
- hardcode_direct=yes
-
- # hardcode_minus_L: Not really in the search PATH,
- # but as the default location of the library.
- hardcode_minus_L=yes
- export_dynamic_flag_spec='${wl}-E'
- ;;
-
- hpux10*)
- if test "$GCC" = yes -a "$with_gnu_ld" = no; then
- archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
- else
- archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
- fi
- if test "$with_gnu_ld" = no; then
- hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
- hardcode_libdir_separator=:
-
- hardcode_direct=yes
- export_dynamic_flag_spec='${wl}-E'
-
- # hardcode_minus_L: Not really in the search PATH,
- # but as the default location of the library.
- hardcode_minus_L=yes
- fi
- ;;
-
- hpux11*)
- if test "$GCC" = yes -a "$with_gnu_ld" = no; then
- case $host_cpu in
- hppa*64*)
- archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- ia64*)
- archive_cmds='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- *)
- archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- esac
- else
- case $host_cpu in
- hppa*64*)
- archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- ia64*)
- archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- *)
- archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- esac
- fi
- if test "$with_gnu_ld" = no; then
- hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
- hardcode_libdir_separator=:
-
- case $host_cpu in
- hppa*64*|ia64*)
- hardcode_libdir_flag_spec_ld='+b $libdir'
- hardcode_direct=no
- hardcode_shlibpath_var=no
- ;;
- *)
- hardcode_direct=yes
- export_dynamic_flag_spec='${wl}-E'
-
- # hardcode_minus_L: Not really in the search PATH,
- # but as the default location of the library.
- hardcode_minus_L=yes
- ;;
- esac
- fi
- ;;
-
- irix5* | irix6* | nonstopux*)
- if test "$GCC" = yes; then
- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- else
- archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
- hardcode_libdir_flag_spec_ld='-rpath $libdir'
- fi
- hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
- hardcode_libdir_separator=:
- link_all_deplibs=yes
- ;;
-
- netbsd*)
- if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
- archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
- else
- archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
- fi
- hardcode_libdir_flag_spec='-R$libdir'
- hardcode_direct=yes
- hardcode_shlibpath_var=no
- ;;
-
- newsos6)
- archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_direct=yes
- hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
- hardcode_libdir_separator=:
- hardcode_shlibpath_var=no
- ;;
-
- openbsd*)
- hardcode_direct=yes
- hardcode_shlibpath_var=no
- if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
- archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
- hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
- export_dynamic_flag_spec='${wl}-E'
- else
- case $host_os in
- openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
- archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
- hardcode_libdir_flag_spec='-R$libdir'
- ;;
- *)
- archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
- hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
- ;;
- esac
- fi
- ;;
-
- os2*)
- hardcode_libdir_flag_spec='-L$libdir'
- hardcode_minus_L=yes
- allow_undefined_flag=unsupported
- archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
- old_archive_From_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
- ;;
-
- osf3*)
- if test "$GCC" = yes; then
- allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
- archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- else
- allow_undefined_flag=' -expect_unresolved \*'
- archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
- fi
- hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
- hardcode_libdir_separator=:
- ;;
-
- osf4* | osf5*) # as osf3* with the addition of -msym flag
- if test "$GCC" = yes; then
- allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
- archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
- else
- allow_undefined_flag=' -expect_unresolved \*'
- archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
- archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
- $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp'
-
- # Both c and cxx compiler support -rpath directly
- hardcode_libdir_flag_spec='-rpath $libdir'
- fi
- hardcode_libdir_separator=:
- ;;
-
- solaris*)
- no_undefined_flag=' -z text'
- if test "$GCC" = yes; then
- wlarc='${wl}'
- archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
- $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
- else
- wlarc=''
- archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
- archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
- $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
- fi
- hardcode_libdir_flag_spec='-R$libdir'
- hardcode_shlibpath_var=no
- case $host_os in
- solaris2.[0-5] | solaris2.[0-5].*) ;;
- *)
- # The compiler driver will combine linker options so we
- # cannot just pass the convience library names through
- # without $wl, iff we do not link with $LD.
- # Luckily, gcc supports the same syntax we need for Sun Studio.
- # Supported since Solaris 2.6 (maybe 2.5.1?)
- case $wlarc in
- '')
- whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;;
- *)
- whole_archive_flag_spec='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;;
- esac ;;
- esac
- link_all_deplibs=yes
- ;;
-
- sunos4*)
- if test "x$host_vendor" = xsequent; then
- # Use $CC to link under sequent, because it throws in some extra .o
- # files that make .init and .fini sections work.
- archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
- else
- archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
- fi
- hardcode_libdir_flag_spec='-L$libdir'
- hardcode_direct=yes
- hardcode_minus_L=yes
- hardcode_shlibpath_var=no
- ;;
-
- sysv4)
- case $host_vendor in
- sni)
- archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_direct=yes # is this really true???
- ;;
- siemens)
- ## LD is ld it makes a PLAMLIB
- ## CC just makes a GrossModule.
- archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
- reload_cmds='$CC -r -o $output$reload_objs'
- hardcode_direct=no
- ;;
- motorola)
- archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_direct=no #Motorola manual says yes, but my tests say they lie
- ;;
- esac
- runpath_var='LD_RUN_PATH'
- hardcode_shlibpath_var=no
- ;;
-
- sysv4.3*)
- archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_shlibpath_var=no
- export_dynamic_flag_spec='-Bexport'
- ;;
-
- sysv4*MP*)
- if test -d /usr/nec; then
- archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_shlibpath_var=no
- runpath_var=LD_RUN_PATH
- hardcode_runpath_var=yes
- ld_shlibs=yes
- fi
- ;;
-
- sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*)
- no_undefined_flag='${wl}-z,text'
- archive_cmds_need_lc=no
- hardcode_shlibpath_var=no
- runpath_var='LD_RUN_PATH'
-
- if test "$GCC" = yes; then
- archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- else
- archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- fi
- ;;
-
- sysv5* | sco3.2v5* | sco5v6*)
- # Note: We can NOT use -z defs as we might desire, because we do not
- # link with -lc, and that would cause any symbols used from libc to
- # always be unresolved, which means just about no library would
- # ever link correctly. If we're not using GNU ld we use -z text
- # though, which does catch some bad symbols but isn't as heavy-handed
- # as -z defs.
- no_undefined_flag='${wl}-z,text'
- allow_undefined_flag='${wl}-z,nodefs'
- archive_cmds_need_lc=no
- hardcode_shlibpath_var=no
- hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
- hardcode_libdir_separator=':'
- link_all_deplibs=yes
- export_dynamic_flag_spec='${wl}-Bexport'
- runpath_var='LD_RUN_PATH'
-
- if test "$GCC" = yes; then
- archive_cmds='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- else
- archive_cmds='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- fi
- ;;
-
- uts4*)
- archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_libdir_flag_spec='-L$libdir'
- hardcode_shlibpath_var=no
- ;;
-
- *)
- ld_shlibs=no
- ;;
- esac
- fi
-
-{ echo "$as_me:$LINENO: result: $ld_shlibs" >&5
-echo "${ECHO_T}$ld_shlibs" >&6; }
-test "$ld_shlibs" = no && can_build_shared=no
-
-#
-# Do we need to explicitly link libc?
-#
-case "x$archive_cmds_need_lc" in
-x|xyes)
- # Assume -lc should be added
- archive_cmds_need_lc=yes
-
- if test "$enable_shared" = yes && test "$GCC" = yes; then
- case $archive_cmds in
- *'~'*)
- # FIXME: we may have to deal with multi-command sequences.
- ;;
- '$CC '*)
- # Test whether the compiler implicitly links with -lc since on some
- # systems, -lgcc has to come before -lc. If gcc already passes -lc
- # to ld, don't add -lc before -lgcc.
- { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
-echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; }
- $rm conftest*
- printf "$lt_simple_compile_test_code" > conftest.$ac_ext
-
- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } 2>conftest.err; then
- soname=conftest
- lib=conftest
- libobjs=conftest.$ac_objext
- deplibs=
- wl=$lt_prog_compiler_wl
- pic_flag=$lt_prog_compiler_pic
- compiler_flags=-v
- linker_flags=-v
- verstring=
- output_objdir=.
- libname=conftest
- lt_save_allow_undefined_flag=$allow_undefined_flag
- allow_undefined_flag=
- if { (eval echo "$as_me:$LINENO: \"$archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5
- (eval $archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }
- then
- archive_cmds_need_lc=no
- else
- archive_cmds_need_lc=yes
- fi
- allow_undefined_flag=$lt_save_allow_undefined_flag
- else
- cat conftest.err 1>&5
- fi
- $rm conftest*
- { echo "$as_me:$LINENO: result: $archive_cmds_need_lc" >&5
-echo "${ECHO_T}$archive_cmds_need_lc" >&6; }
- ;;
- esac
- fi
- ;;
-esac
-
-{ echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
-echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; }
-library_names_spec=
-libname_spec='lib$name'
-soname_spec=
-shrext_cmds=".so"
-postinstall_cmds=
-postuninstall_cmds=
-finish_cmds=
-finish_eval=
-shlibpath_var=
-shlibpath_overrides_runpath=unknown
-version_type=none
-dynamic_linker="$host_os ld.so"
-sys_lib_dlsearch_path_spec="/lib /usr/lib"
-if test "$GCC" = yes; then
- sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
- if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then
- # if the path contains ";" then we assume it to be the separator
- # otherwise default to the standard path separator (i.e. ":") - it is
- # assumed that no part of a normal pathname contains ";" but that should
- # okay in the real world where ";" in dirpaths is itself problematic.
- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
- else
- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
- fi
-else
- sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
-fi
-need_lib_prefix=unknown
-hardcode_into_libs=no
-
-# when you set need_version to no, make sure it does not cause -set_version
-# flags to be left without arguments
-need_version=unknown
-
-case $host_os in
-aix3*)
- version_type=linux
- library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
- shlibpath_var=LIBPATH
-
- # AIX 3 has no versioning support, so we append a major version to the name.
- soname_spec='${libname}${release}${shared_ext}$major'
- ;;
-
-aix4* | aix5*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- hardcode_into_libs=yes
- if test "$host_cpu" = ia64; then
- # AIX 5 supports IA64
- library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
- shlibpath_var=LD_LIBRARY_PATH
- else
- # With GCC up to 2.95.x, collect2 would create an import file
- # for dependence libraries. The import file would start with
- # the line `#! .'. This would cause the generated library to
- # depend on `.', always an invalid library. This was fixed in
- # development snapshots of GCC prior to 3.0.
- case $host_os in
- aix4 | aix4.[01] | aix4.[01].*)
- if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
- echo ' yes '
- echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
- :
- else
- can_build_shared=no
- fi
- ;;
- esac
- # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
- # soname into executable. Probably we can add versioning support to
- # collect2, so additional links can be useful in future.
- if test "$aix_use_runtimelinking" = yes; then
- # If using run time linking (on AIX 4.2 or later) use lib<name>.so
- # instead of lib<name>.a to let people know that these are not
- # typical AIX shared libraries.
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- else
- # We preserve .a as extension for shared libraries through AIX4.2
- # and later when we are not doing run time linking.
- library_names_spec='${libname}${release}.a $libname.a'
- soname_spec='${libname}${release}${shared_ext}$major'
- fi
- shlibpath_var=LIBPATH
- fi
- ;;
-
-amigaos*)
- library_names_spec='$libname.ixlibrary $libname.a'
- # Create ${libname}_ixlibrary.a entries in /sys/libs.
- finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
- ;;
-
-beos*)
- library_names_spec='${libname}${shared_ext}'
- dynamic_linker="$host_os ld.so"
- shlibpath_var=LIBRARY_PATH
- ;;
-
-bsdi[45]*)
- version_type=linux
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
- sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
- # the default ld.so.conf also contains /usr/contrib/lib and
- # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
- # libtool to hard-code these into programs
- ;;
-
-cygwin* | mingw* | pw32*)
- version_type=windows
- shrext_cmds=".dll"
- need_version=no
- need_lib_prefix=no
-
- case $GCC,$host_os in
- yes,cygwin* | yes,mingw* | yes,pw32*)
- library_names_spec='$libname.dll.a'
- # DLL is installed to $(libdir)/../bin by postinstall_cmds
- postinstall_cmds='base_file=`basename \${file}`~
- dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
- dldir=$destdir/`dirname \$dlpath`~
- test -d \$dldir || mkdir -p \$dldir~
- $install_prog $dir/$dlname \$dldir/$dlname~
- chmod a+x \$dldir/$dlname'
- postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
- dlpath=$dir/\$dldll~
- $rm \$dlpath'
- shlibpath_overrides_runpath=yes
-
- case $host_os in
- cygwin*)
- # Cygwin DLLs use 'cyg' prefix rather than 'lib'
- soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
- sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
- ;;
- mingw*)
- # MinGW DLLs use traditional 'lib' prefix
- soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
- sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
- if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then
- # It is most probably a Windows format PATH printed by
- # mingw gcc, but we are running on Cygwin. Gcc prints its search
- # path with ; separators, and with drive letters. We can handle the
- # drive letters (cygwin fileutils understands them), so leave them,
- # especially as we might pass files found there to a mingw objdump,
- # which wouldn't understand a cygwinified path. Ahh.
- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
- else
- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
- fi
- ;;
- pw32*)
- # pw32 DLLs use 'pw' prefix rather than 'lib'
- library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
- ;;
- esac
- ;;
-
- *)
- library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
- ;;
- esac
- dynamic_linker='Win32 ld.exe'
- # FIXME: first we should search . and the directory the executable is in
- shlibpath_var=PATH
- ;;
-
-darwin* | rhapsody*)
- dynamic_linker="$host_os dyld"
- version_type=darwin
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
- soname_spec='${libname}${release}${major}$shared_ext'
- shlibpath_overrides_runpath=yes
- shlibpath_var=DYLD_LIBRARY_PATH
- shrext_cmds='.dylib'
- # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
- if test "$GCC" = yes; then
- sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
- else
- sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
- fi
- sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
- ;;
-
-dgux*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- ;;
-
-freebsd1*)
- dynamic_linker=no
- ;;
-
-kfreebsd*-gnu)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- dynamic_linker='GNU ld.so'
- ;;
-
-freebsd* | dragonfly*)
- # DragonFly does not have aout. When/if they implement a new
- # versioning mechanism, adjust this.
- if test -x /usr/bin/objformat; then
- objformat=`/usr/bin/objformat`
- else
- case $host_os in
- freebsd[123]*) objformat=aout ;;
- *) objformat=elf ;;
- esac
- fi
- version_type=freebsd-$objformat
- case $version_type in
- freebsd-elf*)
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
- need_version=no
- need_lib_prefix=no
- ;;
- freebsd-*)
- library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
- need_version=yes
- ;;
- esac
- shlibpath_var=LD_LIBRARY_PATH
- case $host_os in
- freebsd2*)
- shlibpath_overrides_runpath=yes
- ;;
- freebsd3.[01]* | freebsdelf3.[01]*)
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- ;;
- freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
- freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- ;;
- freebsd*) # from 4.6 on
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- ;;
- esac
- ;;
-
-gnu*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- hardcode_into_libs=yes
- ;;
-
-hpux9* | hpux10* | hpux11*)
- # Give a soname corresponding to the major version so that dld.sl refuses to
- # link against other versions.
- version_type=sunos
- need_lib_prefix=no
- need_version=no
- case $host_cpu in
- ia64*)
- shrext_cmds='.so'
- hardcode_into_libs=yes
- dynamic_linker="$host_os dld.so"
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- if test "X$HPUX_IA64_MODE" = X32; then
- sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
- else
- sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
- fi
- sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
- ;;
- hppa*64*)
- shrext_cmds='.sl'
- hardcode_into_libs=yes
- dynamic_linker="$host_os dld.sl"
- shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
- shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
- sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
- ;;
- *)
- shrext_cmds='.sl'
- dynamic_linker="$host_os dld.sl"
- shlibpath_var=SHLIB_PATH
- shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- ;;
- esac
- # HP-UX runs *really* slowly unless shared libraries are mode 555.
- postinstall_cmds='chmod 555 $lib'
- ;;
-
-interix3*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- ;;
-
-irix5* | irix6* | nonstopux*)
- case $host_os in
- nonstopux*) version_type=nonstopux ;;
- *)
- if test "$lt_cv_prog_gnu_ld" = yes; then
- version_type=linux
- else
- version_type=irix
- fi ;;
- esac
- need_lib_prefix=no
- need_version=no
- soname_spec='${libname}${release}${shared_ext}$major'
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
- case $host_os in
- irix5* | nonstopux*)
- libsuff= shlibsuff=
- ;;
- *)
- case $LD in # libtool.m4 will add one of these switches to LD
- *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
- libsuff= shlibsuff= libmagic=32-bit;;
- *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
- libsuff=32 shlibsuff=N32 libmagic=N32;;
- *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
- libsuff=64 shlibsuff=64 libmagic=64-bit;;
- *) libsuff= shlibsuff= libmagic=never-match;;
- esac
- ;;
- esac
- shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
- shlibpath_overrides_runpath=no
- sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
- sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
- hardcode_into_libs=yes
- ;;
-
-# No shared lib support for Linux oldld, aout, or coff.
-linux*oldld* | linux*aout* | linux*coff*)
- dynamic_linker=no
- ;;
-
-# This must be Linux ELF.
-linux*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- # This implies no fast_install, which is unacceptable.
- # Some rework will be needed to allow for fast_install
- # before this can be enabled.
- hardcode_into_libs=yes
-
- # Append ld.so.conf contents to the search path
- if test -f /etc/ld.so.conf; then
- lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
- sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
- fi
-
- # We used to test for /lib/ld.so.1 and disable shared libraries on
- # powerpc, because MkLinux only supported shared libraries with the
- # GNU dynamic linker. Since this was broken with cross compilers,
- # most powerpc-linux boxes support dynamic linking these days and
- # people can always --disable-shared, the test was removed, and we
- # assume the GNU/Linux dynamic linker is in use.
- dynamic_linker='GNU/Linux ld.so'
- ;;
-
-knetbsd*-gnu)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- dynamic_linker='GNU ld.so'
- ;;
-
-netbsd*)
- version_type=sunos
- need_lib_prefix=no
- need_version=no
- if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
- dynamic_linker='NetBSD (a.out) ld.so'
- else
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- dynamic_linker='NetBSD ld.elf_so'
- fi
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- ;;
-
-newsos6)
- version_type=linux
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- ;;
-
-nto-qnx*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- ;;
-
-openbsd*)
- version_type=sunos
- sys_lib_dlsearch_path_spec="/usr/lib"
- need_lib_prefix=no
- # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
- case $host_os in
- openbsd3.3 | openbsd3.3.*) need_version=yes ;;
- *) need_version=no ;;
- esac
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
- case $host_os in
- openbsd2.[89] | openbsd2.[89].*)
- shlibpath_overrides_runpath=no
- ;;
- *)
- shlibpath_overrides_runpath=yes
- ;;
- esac
- else
- shlibpath_overrides_runpath=yes
- fi
- ;;
-
-os2*)
- libname_spec='$name'
- shrext_cmds=".dll"
- need_lib_prefix=no
- library_names_spec='$libname${shared_ext} $libname.a'
- dynamic_linker='OS/2 ld.exe'
- shlibpath_var=LIBPATH
- ;;
-
-osf3* | osf4* | osf5*)
- version_type=osf
- need_lib_prefix=no
- need_version=no
- soname_spec='${libname}${release}${shared_ext}$major'
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- shlibpath_var=LD_LIBRARY_PATH
- sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
- sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
- ;;
-
-solaris*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- # ldd complains unless libraries are executable
- postinstall_cmds='chmod +x $lib'
- ;;
-
-sunos4*)
- version_type=sunos
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
- finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- if test "$with_gnu_ld" = yes; then
- need_lib_prefix=no
- fi
- need_version=yes
- ;;
-
-sysv4 | sysv4.3*)
- version_type=linux
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- case $host_vendor in
- sni)
- shlibpath_overrides_runpath=no
- need_lib_prefix=no
- export_dynamic_flag_spec='${wl}-Blargedynsym'
- runpath_var=LD_RUN_PATH
- ;;
- siemens)
- need_lib_prefix=no
- ;;
- motorola)
- need_lib_prefix=no
- need_version=no
- shlibpath_overrides_runpath=no
- sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
- ;;
- esac
- ;;
-
-sysv4*MP*)
- if test -d /usr/nec ;then
- version_type=linux
- library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
- soname_spec='$libname${shared_ext}.$major'
- shlibpath_var=LD_LIBRARY_PATH
- fi
- ;;
-
-sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
- version_type=freebsd-elf
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- hardcode_into_libs=yes
- if test "$with_gnu_ld" = yes; then
- sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
- shlibpath_overrides_runpath=no
- else
- sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
- shlibpath_overrides_runpath=yes
- case $host_os in
- sco3.2v5*)
- sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
- ;;
- esac
- fi
- sys_lib_dlsearch_path_spec='/usr/lib'
- ;;
-
-uts4*)
- version_type=linux
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- ;;
-
-*)
- dynamic_linker=no
- ;;
-esac
-{ echo "$as_me:$LINENO: result: $dynamic_linker" >&5
-echo "${ECHO_T}$dynamic_linker" >&6; }
-test "$dynamic_linker" = no && can_build_shared=no
-
-variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
-if test "$GCC" = yes; then
- variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
-fi
-
-{ echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
-echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; }
-hardcode_action=
-if test -n "$hardcode_libdir_flag_spec" || \
- test -n "$runpath_var" || \
- test "X$hardcode_automatic" = "Xyes" ; then
-
- # We can hardcode non-existant directories.
- if test "$hardcode_direct" != no &&
- # If the only mechanism to avoid hardcoding is shlibpath_var, we
- # have to relink, otherwise we might link with an installed library
- # when we should be linking with a yet-to-be-installed one
- ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, )" != no &&
- test "$hardcode_minus_L" != no; then
- # Linking always hardcodes the temporary library directory.
- hardcode_action=relink
- else
- # We can link without hardcoding, and we can hardcode nonexisting dirs.
- hardcode_action=immediate
- fi
-else
- # We cannot hardcode anything, or else we can only hardcode existing
- # directories.
- hardcode_action=unsupported
-fi
-{ echo "$as_me:$LINENO: result: $hardcode_action" >&5
-echo "${ECHO_T}$hardcode_action" >&6; }
-
-if test "$hardcode_action" = relink; then
- # Fast installation is not supported
- enable_fast_install=no
-elif test "$shlibpath_overrides_runpath" = yes ||
- test "$enable_shared" = no; then
- # Fast installation is not necessary
- enable_fast_install=needless
-fi
-
-striplib=
-old_striplib=
-{ echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5
-echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6; }
-if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
- test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
- test -z "$striplib" && striplib="$STRIP --strip-unneeded"
- { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
-else
-# FIXME - insert some real tests, host_os isn't really good enough
- case $host_os in
- darwin*)
- if test -n "$STRIP" ; then
- striplib="$STRIP -x"
- { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
- else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
- ;;
- *)
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
- ;;
- esac
-fi
-
-if test "x$enable_dlopen" != xyes; then
- enable_dlopen=unknown
- enable_dlopen_self=unknown
- enable_dlopen_self_static=unknown
-else
- lt_cv_dlopen=no
- lt_cv_dlopen_libs=
-
- case $host_os in
- beos*)
- lt_cv_dlopen="load_add_on"
- lt_cv_dlopen_libs=
- lt_cv_dlopen_self=yes
- ;;
-
- mingw* | pw32*)
- lt_cv_dlopen="LoadLibrary"
- lt_cv_dlopen_libs=
- ;;
-
- cygwin*)
- lt_cv_dlopen="dlopen"
- lt_cv_dlopen_libs=
- ;;
-
- darwin*)
- # if libdl is installed we need to link against it
- { echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
-echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; }
-if test "${ac_cv_lib_dl_dlopen+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldl $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char dlopen ();
-int
-main ()
-{
-return dlopen ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_lib_dl_dlopen=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_lib_dl_dlopen=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
-echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; }
-if test $ac_cv_lib_dl_dlopen = yes; then
- lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
-else
-
- lt_cv_dlopen="dyld"
- lt_cv_dlopen_libs=
- lt_cv_dlopen_self=yes
-
-fi
-
- ;;
-
- *)
- { echo "$as_me:$LINENO: checking for shl_load" >&5
-echo $ECHO_N "checking for shl_load... $ECHO_C" >&6; }
-if test "${ac_cv_func_shl_load+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-/* Define shl_load to an innocuous variant, in case <limits.h> declares shl_load.
- For example, HP-UX 11i <limits.h> declares gettimeofday. */
-#define shl_load innocuous_shl_load
-
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char shl_load (); below.
- Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- <limits.h> exists even on freestanding compilers. */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef shl_load
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char shl_load ();
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined __stub_shl_load || defined __stub___shl_load
-choke me
-#endif
-
-int
-main ()
-{
-return shl_load ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_func_shl_load=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_func_shl_load=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5
-echo "${ECHO_T}$ac_cv_func_shl_load" >&6; }
-if test $ac_cv_func_shl_load = yes; then
- lt_cv_dlopen="shl_load"
-else
- { echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5
-echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6; }
-if test "${ac_cv_lib_dld_shl_load+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldld $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char shl_load ();
-int
-main ()
-{
-return shl_load ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_lib_dld_shl_load=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_lib_dld_shl_load=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5
-echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6; }
-if test $ac_cv_lib_dld_shl_load = yes; then
- lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"
-else
- { echo "$as_me:$LINENO: checking for dlopen" >&5
-echo $ECHO_N "checking for dlopen... $ECHO_C" >&6; }
-if test "${ac_cv_func_dlopen+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-/* Define dlopen to an innocuous variant, in case <limits.h> declares dlopen.
- For example, HP-UX 11i <limits.h> declares gettimeofday. */
-#define dlopen innocuous_dlopen
-
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char dlopen (); below.
- Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- <limits.h> exists even on freestanding compilers. */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef dlopen
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char dlopen ();
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined __stub_dlopen || defined __stub___dlopen
-choke me
-#endif
-
-int
-main ()
-{
-return dlopen ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_func_dlopen=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_func_dlopen=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5
-echo "${ECHO_T}$ac_cv_func_dlopen" >&6; }
-if test $ac_cv_func_dlopen = yes; then
- lt_cv_dlopen="dlopen"
-else
- { echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
-echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; }
-if test "${ac_cv_lib_dl_dlopen+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldl $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char dlopen ();
-int
-main ()
-{
-return dlopen ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_lib_dl_dlopen=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_lib_dl_dlopen=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
-echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; }
-if test $ac_cv_lib_dl_dlopen = yes; then
- lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
-else
- { echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5
-echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6; }
-if test "${ac_cv_lib_svld_dlopen+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lsvld $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char dlopen ();
-int
-main ()
-{
-return dlopen ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_lib_svld_dlopen=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_lib_svld_dlopen=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5
-echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6; }
-if test $ac_cv_lib_svld_dlopen = yes; then
- lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
-else
- { echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5
-echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6; }
-if test "${ac_cv_lib_dld_dld_link+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldld $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char dld_link ();
-int
-main ()
-{
-return dld_link ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_lib_dld_dld_link=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_lib_dld_dld_link=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5
-echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6; }
-if test $ac_cv_lib_dld_dld_link = yes; then
- lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"
-fi
-
-
-fi
-
-
-fi
-
-
-fi
-
-
-fi
-
-
-fi
-
- ;;
- esac
-
- if test "x$lt_cv_dlopen" != xno; then
- enable_dlopen=yes
- else
- enable_dlopen=no
- fi
-
- case $lt_cv_dlopen in
- dlopen)
- save_CPPFLAGS="$CPPFLAGS"
- test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
-
- save_LDFLAGS="$LDFLAGS"
- wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
-
- save_LIBS="$LIBS"
- LIBS="$lt_cv_dlopen_libs $LIBS"
-
- { echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5
-echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6; }
-if test "${lt_cv_dlopen_self+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test "$cross_compiling" = yes; then :
- lt_cv_dlopen_self=cross
-else
- lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
- lt_status=$lt_dlunknown
- cat > conftest.$ac_ext <<EOF
-#line 17320 "configure"
-#include "confdefs.h"
-
-#if HAVE_DLFCN_H
-#include <dlfcn.h>
-#endif
-
-#include <stdio.h>
-
-#ifdef RTLD_GLOBAL
-# define LT_DLGLOBAL RTLD_GLOBAL
-#else
-# ifdef DL_GLOBAL
-# define LT_DLGLOBAL DL_GLOBAL
-# else
-# define LT_DLGLOBAL 0
-# endif
-#endif
-
-/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
- find out it does not work in some platform. */
-#ifndef LT_DLLAZY_OR_NOW
-# ifdef RTLD_LAZY
-# define LT_DLLAZY_OR_NOW RTLD_LAZY
-# else
-# ifdef DL_LAZY
-# define LT_DLLAZY_OR_NOW DL_LAZY
-# else
-# ifdef RTLD_NOW
-# define LT_DLLAZY_OR_NOW RTLD_NOW
-# else
-# ifdef DL_NOW
-# define LT_DLLAZY_OR_NOW DL_NOW
-# else
-# define LT_DLLAZY_OR_NOW 0
-# endif
-# endif
-# endif
-# endif
-#endif
-
-#ifdef __cplusplus
-extern "C" void exit (int);
-#endif
-
-void fnord() { int i=42;}
-int main ()
-{
- void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
- int status = $lt_dlunknown;
-
- if (self)
- {
- if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
- else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
- /* dlclose (self); */
- }
- else
- puts (dlerror ());
-
- exit (status);
-}
-EOF
- if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
- (./conftest; exit; ) >&5 2>/dev/null
- lt_status=$?
- case x$lt_status in
- x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;
- x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;;
- x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;;
- esac
- else :
- # compilation failed
- lt_cv_dlopen_self=no
- fi
-fi
-rm -fr conftest*
-
-
-fi
-{ echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5
-echo "${ECHO_T}$lt_cv_dlopen_self" >&6; }
-
- if test "x$lt_cv_dlopen_self" = xyes; then
- wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
- { echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5
-echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6; }
-if test "${lt_cv_dlopen_self_static+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test "$cross_compiling" = yes; then :
- lt_cv_dlopen_self_static=cross
-else
- lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
- lt_status=$lt_dlunknown
- cat > conftest.$ac_ext <<EOF
-#line 17420 "configure"
-#include "confdefs.h"
-
-#if HAVE_DLFCN_H
-#include <dlfcn.h>
-#endif
-
-#include <stdio.h>
-
-#ifdef RTLD_GLOBAL
-# define LT_DLGLOBAL RTLD_GLOBAL
-#else
-# ifdef DL_GLOBAL
-# define LT_DLGLOBAL DL_GLOBAL
-# else
-# define LT_DLGLOBAL 0
-# endif
-#endif
-
-/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
- find out it does not work in some platform. */
-#ifndef LT_DLLAZY_OR_NOW
-# ifdef RTLD_LAZY
-# define LT_DLLAZY_OR_NOW RTLD_LAZY
-# else
-# ifdef DL_LAZY
-# define LT_DLLAZY_OR_NOW DL_LAZY
-# else
-# ifdef RTLD_NOW
-# define LT_DLLAZY_OR_NOW RTLD_NOW
-# else
-# ifdef DL_NOW
-# define LT_DLLAZY_OR_NOW DL_NOW
-# else
-# define LT_DLLAZY_OR_NOW 0
-# endif
-# endif
-# endif
-# endif
-#endif
-
-#ifdef __cplusplus
-extern "C" void exit (int);
-#endif
-
-void fnord() { int i=42;}
-int main ()
-{
- void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
- int status = $lt_dlunknown;
-
- if (self)
- {
- if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
- else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
- /* dlclose (self); */
- }
- else
- puts (dlerror ());
-
- exit (status);
-}
-EOF
- if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
- (./conftest; exit; ) >&5 2>/dev/null
- lt_status=$?
- case x$lt_status in
- x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;
- x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;;
- x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;;
- esac
- else :
- # compilation failed
- lt_cv_dlopen_self_static=no
- fi
-fi
-rm -fr conftest*
-
-
-fi
-{ echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5
-echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6; }
- fi
-
- CPPFLAGS="$save_CPPFLAGS"
- LDFLAGS="$save_LDFLAGS"
- LIBS="$save_LIBS"
- ;;
- esac
-
- case $lt_cv_dlopen_self in
- yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
- *) enable_dlopen_self=unknown ;;
- esac
-
- case $lt_cv_dlopen_self_static in
- yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
- *) enable_dlopen_self_static=unknown ;;
- esac
-fi
-
-
-# Report which library types will actually be built
-{ echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5
-echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6; }
-{ echo "$as_me:$LINENO: result: $can_build_shared" >&5
-echo "${ECHO_T}$can_build_shared" >&6; }
-
-{ echo "$as_me:$LINENO: checking whether to build shared libraries" >&5
-echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6; }
-test "$can_build_shared" = "no" && enable_shared=no
-
-# On AIX, shared libraries and static libraries use the same namespace, and
-# are all built from PIC.
-case $host_os in
-aix3*)
- test "$enable_shared" = yes && enable_static=no
- if test -n "$RANLIB"; then
- archive_cmds="$archive_cmds~\$RANLIB \$lib"
- postinstall_cmds='$RANLIB $lib'
- fi
- ;;
-
-aix4* | aix5*)
- if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
- test "$enable_shared" = yes && enable_static=no
- fi
- ;;
-esac
-{ echo "$as_me:$LINENO: result: $enable_shared" >&5
-echo "${ECHO_T}$enable_shared" >&6; }
-
-{ echo "$as_me:$LINENO: checking whether to build static libraries" >&5
-echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6; }
-# Make sure either enable_shared or enable_static is yes.
-test "$enable_shared" = yes || enable_static=yes
-{ echo "$as_me:$LINENO: result: $enable_static" >&5
-echo "${ECHO_T}$enable_static" >&6; }
-
-# The else clause should only fire when bootstrapping the
-# libtool distribution, otherwise you forgot to ship ltmain.sh
-# with your package, and you will get complaints that there are
-# no rules to generate ltmain.sh.
-if test -f "$ltmain"; then
- # See if we are running on zsh, and set the options which allow our commands through
- # without removal of \ escapes.
- if test -n "${ZSH_VERSION+set}" ; then
- setopt NO_GLOB_SUBST
- fi
- # Now quote all the things that may contain metacharacters while being
- # careful not to overquote the AC_SUBSTed values. We take copies of the
- # variables and quote the copies for generation of the libtool script.
- for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \
- SED SHELL STRIP \
- libname_spec library_names_spec soname_spec extract_expsyms_cmds \
- old_striplib striplib file_magic_cmd finish_cmds finish_eval \
- deplibs_check_method reload_flag reload_cmds need_locks \
- lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
- lt_cv_sys_global_symbol_to_c_name_address \
- sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
- old_postinstall_cmds old_postuninstall_cmds \
- compiler \
- CC \
- LD \
- lt_prog_compiler_wl \
- lt_prog_compiler_pic \
- lt_prog_compiler_static \
- lt_prog_compiler_no_builtin_flag \
- export_dynamic_flag_spec \
- thread_safe_flag_spec \
- whole_archive_flag_spec \
- enable_shared_with_static_runtimes \
- old_archive_cmds \
- old_archive_from_new_cmds \
- predep_objects \
- postdep_objects \
- predeps \
- postdeps \
- compiler_lib_search_path \
- archive_cmds \
- archive_expsym_cmds \
- postinstall_cmds \
- postuninstall_cmds \
- old_archive_from_expsyms_cmds \
- allow_undefined_flag \
- no_undefined_flag \
- export_symbols_cmds \
- hardcode_libdir_flag_spec \
- hardcode_libdir_flag_spec_ld \
- hardcode_libdir_separator \
- hardcode_automatic \
- module_cmds \
- module_expsym_cmds \
- lt_cv_prog_compiler_c_o \
- exclude_expsyms \
- include_expsyms; do
-
- case $var in
- old_archive_cmds | \
- old_archive_from_new_cmds | \
- archive_cmds | \
- archive_expsym_cmds | \
- module_cmds | \
- module_expsym_cmds | \
- old_archive_from_expsyms_cmds | \
- export_symbols_cmds | \
- extract_expsyms_cmds | reload_cmds | finish_cmds | \
- postinstall_cmds | postuninstall_cmds | \
- old_postinstall_cmds | old_postuninstall_cmds | \
- sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
- # Double-quote double-evaled strings.
- eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
- ;;
- *)
- eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
- ;;
- esac
- done
-
- case $lt_echo in
- *'\$0 --fallback-echo"')
- lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
- ;;
- esac
-
-cfgfile="${ofile}T"
- trap "$rm \"$cfgfile\"; exit 1" 1 2 15
- $rm -f "$cfgfile"
- { echo "$as_me:$LINENO: creating $ofile" >&5
-echo "$as_me: creating $ofile" >&6;}
-
- cat <<__EOF__ >> "$cfgfile"
-#! $SHELL
-
-# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
-# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
-# NOTE: Changes made to this file will be lost: look at ltmain.sh.
-#
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
-# Free Software Foundation, Inc.
-#
-# This file is part of GNU Libtool:
-# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-# A sed program that does not truncate output.
-SED=$lt_SED
-
-# Sed that helps us avoid accidentally triggering echo(1) options like -n.
-Xsed="$SED -e 1s/^X//"
-
-# The HP-UX ksh and POSIX shell print the target directory to stdout
-# if CDPATH is set.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-
-# The names of the tagged configurations supported by this script.
-available_tags=
-
-# ### BEGIN LIBTOOL CONFIG
-
-# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
-
-# Shell to use when invoking shell scripts.
-SHELL=$lt_SHELL
-
-# Whether or not to build shared libraries.
-build_libtool_libs=$enable_shared
-
-# Whether or not to build static libraries.
-build_old_libs=$enable_static
-
-# Whether or not to add -lc for building shared libraries.
-build_libtool_need_lc=$archive_cmds_need_lc
-
-# Whether or not to disallow shared libs when runtime libs are static
-allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes
-
-# Whether or not to optimize for fast installation.
-fast_install=$enable_fast_install
-
-# The host system.
-host_alias=$host_alias
-host=$host
-host_os=$host_os
-
-# The build system.
-build_alias=$build_alias
-build=$build
-build_os=$build_os
-
-# An echo program that does not interpret backslashes.
-echo=$lt_echo
-
-# The archiver.
-AR=$lt_AR
-AR_FLAGS=$lt_AR_FLAGS
-
-# A C compiler.
-LTCC=$lt_LTCC
-
-# LTCC compiler flags.
-LTCFLAGS=$lt_LTCFLAGS
-
-# A language-specific compiler.
-CC=$lt_compiler
-
-# Is the compiler the GNU C compiler?
-with_gcc=$GCC
-
-# An ERE matcher.
-EGREP=$lt_EGREP
-
-# The linker used to build libraries.
-LD=$lt_LD
-
-# Whether we need hard or soft links.
-LN_S=$lt_LN_S
-
-# A BSD-compatible nm program.
-NM=$lt_NM
-
-# A symbol stripping program
-STRIP=$lt_STRIP
-
-# Used to examine libraries when file_magic_cmd begins "file"
-MAGIC_CMD=$MAGIC_CMD
-
-# Used on cygwin: DLL creation program.
-DLLTOOL="$DLLTOOL"
-
-# Used on cygwin: object dumper.
-OBJDUMP="$OBJDUMP"
-
-# Used on cygwin: assembler.
-AS="$AS"
-
-# The name of the directory that contains temporary libtool files.
-objdir=$objdir
-
-# How to create reloadable object files.
-reload_flag=$lt_reload_flag
-reload_cmds=$lt_reload_cmds
-
-# How to pass a linker flag through the compiler.
-wl=$lt_lt_prog_compiler_wl
-
-# Object file suffix (normally "o").
-objext="$ac_objext"
-
-# Old archive suffix (normally "a").
-libext="$libext"
-
-# Shared library suffix (normally ".so").
-shrext_cmds='$shrext_cmds'
-
-# Executable file suffix (normally "").
-exeext="$exeext"
-
-# Additional compiler flags for building library objects.
-pic_flag=$lt_lt_prog_compiler_pic
-pic_mode=$pic_mode
-
-# What is the maximum length of a command?
-max_cmd_len=$lt_cv_sys_max_cmd_len
-
-# Does compiler simultaneously support -c and -o options?
-compiler_c_o=$lt_lt_cv_prog_compiler_c_o
-
-# Must we lock files when doing compilation?
-need_locks=$lt_need_locks
-
-# Do we need the lib prefix for modules?
-need_lib_prefix=$need_lib_prefix
-
-# Do we need a version for libraries?
-need_version=$need_version
-
-# Whether dlopen is supported.
-dlopen_support=$enable_dlopen
-
-# Whether dlopen of programs is supported.
-dlopen_self=$enable_dlopen_self
-
-# Whether dlopen of statically linked programs is supported.
-dlopen_self_static=$enable_dlopen_self_static
-
-# Compiler flag to prevent dynamic linking.
-link_static_flag=$lt_lt_prog_compiler_static
-
-# Compiler flag to turn off builtin functions.
-no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag
-
-# Compiler flag to allow reflexive dlopens.
-export_dynamic_flag_spec=$lt_export_dynamic_flag_spec
-
-# Compiler flag to generate shared objects directly from archives.
-whole_archive_flag_spec=$lt_whole_archive_flag_spec
-
-# Compiler flag to generate thread-safe objects.
-thread_safe_flag_spec=$lt_thread_safe_flag_spec
-
-# Library versioning type.
-version_type=$version_type
-
-# Format of library name prefix.
-libname_spec=$lt_libname_spec
-
-# List of archive names. First name is the real one, the rest are links.
-# The last name is the one that the linker finds with -lNAME.
-library_names_spec=$lt_library_names_spec
-
-# The coded name of the library, if different from the real name.
-soname_spec=$lt_soname_spec
-
-# Commands used to build and install an old-style archive.
-RANLIB=$lt_RANLIB
-old_archive_cmds=$lt_old_archive_cmds
-old_postinstall_cmds=$lt_old_postinstall_cmds
-old_postuninstall_cmds=$lt_old_postuninstall_cmds
-
-# Create an old-style archive from a shared archive.
-old_archive_from_new_cmds=$lt_old_archive_from_new_cmds
-
-# Create a temporary old-style archive to link instead of a shared archive.
-old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds
-
-# Commands used to build and install a shared archive.
-archive_cmds=$lt_archive_cmds
-archive_expsym_cmds=$lt_archive_expsym_cmds
-postinstall_cmds=$lt_postinstall_cmds
-postuninstall_cmds=$lt_postuninstall_cmds
-
-# Commands used to build a loadable module (assumed same as above if empty)
-module_cmds=$lt_module_cmds
-module_expsym_cmds=$lt_module_expsym_cmds
-
-# Commands to strip libraries.
-old_striplib=$lt_old_striplib
-striplib=$lt_striplib
-
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predep_objects=$lt_predep_objects
-
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdep_objects=$lt_postdep_objects
-
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predeps=$lt_predeps
-
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdeps=$lt_postdeps
-
-# The library search path used internally by the compiler when linking
-# a shared library.
-compiler_lib_search_path=$lt_compiler_lib_search_path
-
-# Method to check whether dependent libraries are shared objects.
-deplibs_check_method=$lt_deplibs_check_method
-
-# Command to use when deplibs_check_method == file_magic.
-file_magic_cmd=$lt_file_magic_cmd
-
-# Flag that allows shared libraries with undefined symbols to be built.
-allow_undefined_flag=$lt_allow_undefined_flag
-
-# Flag that forces no undefined symbols.
-no_undefined_flag=$lt_no_undefined_flag
-
-# Commands used to finish a libtool library installation in a directory.
-finish_cmds=$lt_finish_cmds
-
-# Same as above, but a single script fragment to be evaled but not shown.
-finish_eval=$lt_finish_eval
-
-# Take the output of nm and produce a listing of raw symbols and C names.
-global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
-
-# Transform the output of nm in a proper C declaration
-global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
-
-# Transform the output of nm in a C name address pair
-global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
-
-# This is the shared library runtime path variable.
-runpath_var=$runpath_var
-
-# This is the shared library path variable.
-shlibpath_var=$shlibpath_var
-
-# Is shlibpath searched before the hard-coded library search path?
-shlibpath_overrides_runpath=$shlibpath_overrides_runpath
-
-# How to hardcode a shared library path into an executable.
-hardcode_action=$hardcode_action
-
-# Whether we should hardcode library paths into libraries.
-hardcode_into_libs=$hardcode_into_libs
-
-# Flag to hardcode \$libdir into a binary during linking.
-# This must work even if \$libdir does not exist.
-hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec
-
-# If ld is used when linking, flag to hardcode \$libdir into
-# a binary during linking. This must work even if \$libdir does
-# not exist.
-hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld
-
-# Whether we need a single -rpath flag with a separated argument.
-hardcode_libdir_separator=$lt_hardcode_libdir_separator
-
-# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
-# resulting binary.
-hardcode_direct=$hardcode_direct
-
-# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
-# resulting binary.
-hardcode_minus_L=$hardcode_minus_L
-
-# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
-# the resulting binary.
-hardcode_shlibpath_var=$hardcode_shlibpath_var
-
-# Set to yes if building a shared library automatically hardcodes DIR into the library
-# and all subsequent libraries and executables linked against it.
-hardcode_automatic=$hardcode_automatic
-
-# Variables whose values should be saved in libtool wrapper scripts and
-# restored at relink time.
-variables_saved_for_relink="$variables_saved_for_relink"
-
-# Whether libtool must link a program against all its dependency libraries.
-link_all_deplibs=$link_all_deplibs
-
-# Compile-time system search path for libraries
-sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
-
-# Run-time system search path for libraries
-sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
-
-# Fix the shell variable \$srcfile for the compiler.
-fix_srcfile_path="$fix_srcfile_path"
-
-# Set to yes if exported symbols are required.
-always_export_symbols=$always_export_symbols
-
-# The commands to list exported symbols.
-export_symbols_cmds=$lt_export_symbols_cmds
-
-# The commands to extract the exported symbol list from a shared archive.
-extract_expsyms_cmds=$lt_extract_expsyms_cmds
-
-# Symbols that should not be listed in the preloaded symbols.
-exclude_expsyms=$lt_exclude_expsyms
-
-# Symbols that must always be exported.
-include_expsyms=$lt_include_expsyms
-
-# ### END LIBTOOL CONFIG
-
-__EOF__
-
-
- case $host_os in
- aix3*)
- cat <<\EOF >> "$cfgfile"
-
-# AIX sometimes has problems with the GCC collect2 program. For some
-# reason, if we set the COLLECT_NAMES environment variable, the problems
-# vanish in a puff of smoke.
-if test "X${COLLECT_NAMES+set}" != Xset; then
- COLLECT_NAMES=
- export COLLECT_NAMES
-fi
-EOF
- ;;
- esac
-
- # We use sed instead of cat because bash on DJGPP gets confused if
- # if finds mixed CR/LF and LF-only lines. Since sed operates in
- # text mode, it properly converts lines to CR/LF. This bash problem
- # is reportedly fixed, but why not run on old versions too?
- sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1)
-
- mv -f "$cfgfile" "$ofile" || \
- (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
- chmod +x "$ofile"
-
-else
- # If there is no Makefile yet, we rely on a make rule to execute
- # `config.status --recheck' to rerun these tests and create the
- # libtool script then.
- ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
- if test -f "$ltmain_in"; then
- test -f Makefile && make "$ltmain"
- fi
-fi
-
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-CC="$lt_save_CC"
-
-
-# Check whether --with-tags was given.
-if test "${with_tags+set}" = set; then
- withval=$with_tags; tagnames="$withval"
-fi
-
-
-if test -f "$ltmain" && test -n "$tagnames"; then
- if test ! -f "${ofile}"; then
- { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not exist" >&5
-echo "$as_me: WARNING: output file \`$ofile' does not exist" >&2;}
- fi
-
- if test -z "$LTCC"; then
- eval "`$SHELL ${ofile} --config | grep '^LTCC='`"
- if test -z "$LTCC"; then
- { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not look like a libtool script" >&5
-echo "$as_me: WARNING: output file \`$ofile' does not look like a libtool script" >&2;}
- else
- { echo "$as_me:$LINENO: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&5
-echo "$as_me: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&2;}
- fi
- fi
- if test -z "$LTCFLAGS"; then
- eval "`$SHELL ${ofile} --config | grep '^LTCFLAGS='`"
- fi
-
- # Extract list of available tagged configurations in $ofile.
- # Note that this assumes the entire list is on one line.
- available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'`
-
- lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
- for tagname in $tagnames; do
- IFS="$lt_save_ifs"
- # Check whether tagname contains only valid characters
- case `$echo "X$tagname" | $Xsed -e 's:[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]::g'` in
- "") ;;
- *) { { echo "$as_me:$LINENO: error: invalid tag name: $tagname" >&5
-echo "$as_me: error: invalid tag name: $tagname" >&2;}
- { (exit 1); exit 1; }; }
- ;;
- esac
-
- if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null
- then
- { { echo "$as_me:$LINENO: error: tag name \"$tagname\" already exists" >&5
-echo "$as_me: error: tag name \"$tagname\" already exists" >&2;}
- { (exit 1); exit 1; }; }
- fi
-
- # Update the list of available tags.
- if test -n "$tagname"; then
- echo appending configuration tag \"$tagname\" to $ofile
-
- case $tagname in
- CXX)
- if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
- ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
- (test "X$CXX" != "Xg++"))) ; then
- ac_ext=cpp
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-
-
-
-
-archive_cmds_need_lc_CXX=no
-allow_undefined_flag_CXX=
-always_export_symbols_CXX=no
-archive_expsym_cmds_CXX=
-export_dynamic_flag_spec_CXX=
-hardcode_direct_CXX=no
-hardcode_libdir_flag_spec_CXX=
-hardcode_libdir_flag_spec_ld_CXX=
-hardcode_libdir_separator_CXX=
-hardcode_minus_L_CXX=no
-hardcode_shlibpath_var_CXX=unsupported
-hardcode_automatic_CXX=no
-module_cmds_CXX=
-module_expsym_cmds_CXX=
-link_all_deplibs_CXX=unknown
-old_archive_cmds_CXX=$old_archive_cmds
-no_undefined_flag_CXX=
-whole_archive_flag_spec_CXX=
-enable_shared_with_static_runtimes_CXX=no
-
-# Dependencies to place before and after the object being linked:
-predep_objects_CXX=
-postdep_objects_CXX=
-predeps_CXX=
-postdeps_CXX=
-compiler_lib_search_path_CXX=
-
-# Source file extension for C++ test sources.
-ac_ext=cpp
-
-# Object file extension for compiled C++ test sources.
-objext=o
-objext_CXX=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code="int some_variable = 0;\n"
-
-# Code to be used in simple link tests
-lt_simple_link_test_code='int main(int, char *[]) { return(0); }\n'
-
-# ltmain only uses $CC for tagged configurations so make sure $CC is set.
-
-# If no C compiler was specified, use CC.
-LTCC=${LTCC-"$CC"}
-
-# If no C compiler flags were specified, use CFLAGS.
-LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
-
-# Allow CC to be a program name with arguments.
-compiler=$CC
-
-
-# save warnings/boilerplate of simple test code
-ac_outfile=conftest.$ac_objext
-printf "$lt_simple_compile_test_code" >conftest.$ac_ext
-eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_compiler_boilerplate=`cat conftest.err`
-$rm conftest*
-
-ac_outfile=conftest.$ac_objext
-printf "$lt_simple_link_test_code" >conftest.$ac_ext
-eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_linker_boilerplate=`cat conftest.err`
-$rm conftest*
-
-
-# Allow CC to be a program name with arguments.
-lt_save_CC=$CC
-lt_save_LD=$LD
-lt_save_GCC=$GCC
-GCC=$GXX
-lt_save_with_gnu_ld=$with_gnu_ld
-lt_save_path_LD=$lt_cv_path_LD
-if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
- lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
-else
- $as_unset lt_cv_prog_gnu_ld
-fi
-if test -n "${lt_cv_path_LDCXX+set}"; then
- lt_cv_path_LD=$lt_cv_path_LDCXX
-else
- $as_unset lt_cv_path_LD
-fi
-test -z "${LDCXX+set}" || LD=$LDCXX
-CC=${CXX-"c++"}
-compiler=$CC
-compiler_CXX=$CC
-for cc_temp in $compiler""; do
- case $cc_temp in
- compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
- distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
- \-*) ;;
- *) break;;
- esac
-done
-cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
-
-
-# We don't want -fno-exception wen compiling C++ code, so set the
-# no_builtin_flag separately
-if test "$GXX" = yes; then
- lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin'
-else
- lt_prog_compiler_no_builtin_flag_CXX=
-fi
-
-if test "$GXX" = yes; then
- # Set up default GNU C++ configuration
-
-
-# Check whether --with-gnu-ld was given.
-if test "${with_gnu_ld+set}" = set; then
- withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
-else
- with_gnu_ld=no
-fi
-
-ac_prog=ld
-if test "$GCC" = yes; then
- # Check if gcc -print-prog-name=ld gives a path.
- { echo "$as_me:$LINENO: checking for ld used by $CC" >&5
-echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6; }
- case $host in
- *-*-mingw*)
- # gcc leaves a trailing carriage return which upsets mingw
- ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
- *)
- ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
- esac
- case $ac_prog in
- # Accept absolute paths.
- [\\/]* | ?:[\\/]*)
- re_direlt='/[^/][^/]*/\.\./'
- # Canonicalize the pathname of ld
- ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'`
- while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
- ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"`
- done
- test -z "$LD" && LD="$ac_prog"
- ;;
- "")
- # If it fails, then pretend we aren't using GCC.
- ac_prog=ld
- ;;
- *)
- # If it is relative, then search for the first ld in PATH.
- with_gnu_ld=unknown
- ;;
- esac
-elif test "$with_gnu_ld" = yes; then
- { echo "$as_me:$LINENO: checking for GNU ld" >&5
-echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6; }
-else
- { echo "$as_me:$LINENO: checking for non-GNU ld" >&5
-echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6; }
-fi
-if test "${lt_cv_path_LD+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -z "$LD"; then
- lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
- for ac_dir in $PATH; do
- IFS="$lt_save_ifs"
- test -z "$ac_dir" && ac_dir=.
- if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
- lt_cv_path_LD="$ac_dir/$ac_prog"
- # Check to see if the program is GNU ld. I'd rather use --version,
- # but apparently some variants of GNU ld only accept -v.
- # Break only if it was the GNU/non-GNU ld that we prefer.
- case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
- *GNU* | *'with BFD'*)
- test "$with_gnu_ld" != no && break
- ;;
- *)
- test "$with_gnu_ld" != yes && break
- ;;
- esac
- fi
- done
- IFS="$lt_save_ifs"
-else
- lt_cv_path_LD="$LD" # Let the user override the test with a path.
-fi
-fi
-
-LD="$lt_cv_path_LD"
-if test -n "$LD"; then
- { echo "$as_me:$LINENO: result: $LD" >&5
-echo "${ECHO_T}$LD" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5
-echo "$as_me: error: no acceptable ld found in \$PATH" >&2;}
- { (exit 1); exit 1; }; }
-{ echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5
-echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6; }
-if test "${lt_cv_prog_gnu_ld+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- # I'd rather use --version here, but apparently some GNU lds only accept -v.
-case `$LD -v 2>&1 </dev/null` in
-*GNU* | *'with BFD'*)
- lt_cv_prog_gnu_ld=yes
- ;;
-*)
- lt_cv_prog_gnu_ld=no
- ;;
-esac
-fi
-{ echo "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5
-echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6; }
-with_gnu_ld=$lt_cv_prog_gnu_ld
-
-
-
- # Check if GNU C++ uses GNU ld as the underlying linker, since the
- # archiving commands below assume that GNU ld is being used.
- if test "$with_gnu_ld" = yes; then
- archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
- archive_expsym_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-
- hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir'
- export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
-
- # If archive_cmds runs LD, not CC, wlarc should be empty
- # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
- # investigate it a little bit more. (MM)
- wlarc='${wl}'
-
- # ancient GNU ld didn't support --whole-archive et. al.
- if eval "`$CC -print-prog-name=ld` --help 2>&1" | \
- grep 'no-whole-archive' > /dev/null; then
- whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
- else
- whole_archive_flag_spec_CXX=
- fi
- else
- with_gnu_ld=no
- wlarc=
-
- # A generic and very simple default shared library creation
- # command for GNU C++ for the case where it uses the native
- # linker, instead of GNU ld. If possible, this setting should
- # overridden to take advantage of the native linker features on
- # the platform it is being used on.
- archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
- fi
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
-
-else
- GXX=no
- with_gnu_ld=no
- wlarc=
-fi
-
-# PORTME: fill in a description of your system's C++ link characteristics
-{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
-echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; }
-ld_shlibs_CXX=yes
-case $host_os in
- aix3*)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- aix4* | aix5*)
- if test "$host_cpu" = ia64; then
- # On IA64, the linker does run time linking by default, so we don't
- # have to do anything special.
- aix_use_runtimelinking=no
- exp_sym_flag='-Bexport'
- no_entry_flag=""
- else
- aix_use_runtimelinking=no
-
- # Test if we are trying to use run time linking or normal
- # AIX style linking. If -brtl is somewhere in LDFLAGS, we
- # need to do runtime linking.
- case $host_os in aix4.[23]|aix4.[23].*|aix5*)
- for ld_flag in $LDFLAGS; do
- case $ld_flag in
- *-brtl*)
- aix_use_runtimelinking=yes
- break
- ;;
- esac
- done
- ;;
- esac
-
- exp_sym_flag='-bexport'
- no_entry_flag='-bnoentry'
- fi
-
- # When large executables or shared objects are built, AIX ld can
- # have problems creating the table of contents. If linking a library
- # or program results in "error TOC overflow" add -mminimal-toc to
- # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
- # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
-
- archive_cmds_CXX=''
- hardcode_direct_CXX=yes
- hardcode_libdir_separator_CXX=':'
- link_all_deplibs_CXX=yes
-
- if test "$GXX" = yes; then
- case $host_os in aix4.[012]|aix4.[012].*)
- # We only want to do this on AIX 4.2 and lower, the check
- # below for broken collect2 doesn't work under 4.3+
- collect2name=`${CC} -print-prog-name=collect2`
- if test -f "$collect2name" && \
- strings "$collect2name" | grep resolve_lib_name >/dev/null
- then
- # We have reworked collect2
- hardcode_direct_CXX=yes
- else
- # We have old collect2
- hardcode_direct_CXX=unsupported
- # It fails to find uninstalled libraries when the uninstalled
- # path is not listed in the libpath. Setting hardcode_minus_L
- # to unsupported forces relinking
- hardcode_minus_L_CXX=yes
- hardcode_libdir_flag_spec_CXX='-L$libdir'
- hardcode_libdir_separator_CXX=
- fi
- ;;
- esac
- shared_flag='-shared'
- if test "$aix_use_runtimelinking" = yes; then
- shared_flag="$shared_flag "'${wl}-G'
- fi
- else
- # not using gcc
- if test "$host_cpu" = ia64; then
- # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
- # chokes on -Wl,-G. The following line is correct:
- shared_flag='-G'
- else
- if test "$aix_use_runtimelinking" = yes; then
- shared_flag='${wl}-G'
- else
- shared_flag='${wl}-bM:SRE'
- fi
- fi
- fi
-
- # It seems that -bexpall does not export symbols beginning with
- # underscore (_), so it is better to generate a list of symbols to export.
- always_export_symbols_CXX=yes
- if test "$aix_use_runtimelinking" = yes; then
- # Warning - without using the other runtime loading flags (-brtl),
- # -berok will link without error, but may produce a broken library.
- allow_undefined_flag_CXX='-berok'
- # Determine the default libpath from the value encoded in an empty executable.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
-
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
-}'`
-# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
-}'`; fi
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
-fi
-
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
-
- hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath"
-
- archive_expsym_cmds_CXX="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
- else
- if test "$host_cpu" = ia64; then
- hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib'
- allow_undefined_flag_CXX="-z nodefs"
- archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
- else
- # Determine the default libpath from the value encoded in an empty executable.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
-
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
-}'`
-# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
-}'`; fi
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
-fi
-
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
-
- hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath"
- # Warning - without using the other run time loading flags,
- # -berok will link without error, but may produce a broken library.
- no_undefined_flag_CXX=' ${wl}-bernotok'
- allow_undefined_flag_CXX=' ${wl}-berok'
- # Exported symbols can be pulled into shared objects from archives
- whole_archive_flag_spec_CXX='$convenience'
- archive_cmds_need_lc_CXX=yes
- # This is similar to how AIX traditionally builds its shared libraries.
- archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
- fi
- fi
- ;;
-
- beos*)
- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- allow_undefined_flag_CXX=unsupported
- # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
- # support --undefined. This deserves some investigation. FIXME
- archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- else
- ld_shlibs_CXX=no
- fi
- ;;
-
- chorus*)
- case $cc_basename in
- *)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- esac
- ;;
-
- cygwin* | mingw* | pw32*)
- # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless,
- # as there is no search path for DLLs.
- hardcode_libdir_flag_spec_CXX='-L$libdir'
- allow_undefined_flag_CXX=unsupported
- always_export_symbols_CXX=no
- enable_shared_with_static_runtimes_CXX=yes
-
- if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
- archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
- # If the export-symbols file already is a .def file (1st line
- # is EXPORTS), use it as is; otherwise, prepend...
- archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
- cp $export_symbols $output_objdir/$soname.def;
- else
- echo EXPORTS > $output_objdir/$soname.def;
- cat $export_symbols >> $output_objdir/$soname.def;
- fi~
- $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
- else
- ld_shlibs_CXX=no
- fi
- ;;
- darwin* | rhapsody*)
- case $host_os in
- rhapsody* | darwin1.[012])
- allow_undefined_flag_CXX='${wl}-undefined ${wl}suppress'
- ;;
- *) # Darwin 1.3 on
- if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
- allow_undefined_flag_CXX='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
- else
- case ${MACOSX_DEPLOYMENT_TARGET} in
- 10.[012])
- allow_undefined_flag_CXX='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
- ;;
- 10.*)
- allow_undefined_flag_CXX='${wl}-undefined ${wl}dynamic_lookup'
- ;;
- esac
- fi
- ;;
- esac
- archive_cmds_need_lc_CXX=no
- hardcode_direct_CXX=no
- hardcode_automatic_CXX=yes
- hardcode_shlibpath_var_CXX=unsupported
- whole_archive_flag_spec_CXX=''
- link_all_deplibs_CXX=yes
-
- if test "$GXX" = yes ; then
- lt_int_apple_cc_single_mod=no
- output_verbose_link_cmd='echo'
- if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then
- lt_int_apple_cc_single_mod=yes
- fi
- if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
- archive_cmds_CXX='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
- else
- archive_cmds_CXX='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
- fi
- module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
- # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
- if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
- archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- else
- archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- fi
- module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- else
- case $cc_basename in
- xlc*)
- output_verbose_link_cmd='echo'
- archive_cmds_CXX='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
- module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
- # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
- archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- ;;
- *)
- ld_shlibs_CXX=no
- ;;
- esac
- fi
- ;;
-
- dgux*)
- case $cc_basename in
- ec++*)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- ghcx*)
- # Green Hills C++ Compiler
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- *)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- esac
- ;;
- freebsd[12]*)
- # C++ shared libraries reported to be fairly broken before switch to ELF
- ld_shlibs_CXX=no
- ;;
- freebsd-elf*)
- archive_cmds_need_lc_CXX=no
- ;;
- freebsd* | kfreebsd*-gnu | dragonfly*)
- # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
- # conventions
- ld_shlibs_CXX=yes
- ;;
- gnu*)
- ;;
- hpux9*)
- hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir'
- hardcode_libdir_separator_CXX=:
- export_dynamic_flag_spec_CXX='${wl}-E'
- hardcode_direct_CXX=yes
- hardcode_minus_L_CXX=yes # Not in the search PATH,
- # but as the default
- # location of the library.
-
- case $cc_basename in
- CC*)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- aCC*)
- archive_cmds_CXX='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- #
- # There doesn't appear to be a way to prevent this compiler from
- # explicitly linking system object files so we need to strip them
- # from the output so that they don't get included in the library
- # dependencies.
- output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[-]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
- ;;
- *)
- if test "$GXX" = yes; then
- archive_cmds_CXX='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
- else
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- fi
- ;;
- esac
- ;;
- hpux10*|hpux11*)
- if test $with_gnu_ld = no; then
- hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir'
- hardcode_libdir_separator_CXX=:
-
- case $host_cpu in
- hppa*64*|ia64*)
- hardcode_libdir_flag_spec_ld_CXX='+b $libdir'
- ;;
- *)
- export_dynamic_flag_spec_CXX='${wl}-E'
- ;;
- esac
- fi
- case $host_cpu in
- hppa*64*|ia64*)
- hardcode_direct_CXX=no
- hardcode_shlibpath_var_CXX=no
- ;;
- *)
- hardcode_direct_CXX=yes
- hardcode_minus_L_CXX=yes # Not in the search PATH,
- # but as the default
- # location of the library.
- ;;
- esac
-
- case $cc_basename in
- CC*)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- aCC*)
- case $host_cpu in
- hppa*64*)
- archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- ;;
- ia64*)
- archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- ;;
- *)
- archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- ;;
- esac
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- #
- # There doesn't appear to be a way to prevent this compiler from
- # explicitly linking system object files so we need to strip them
- # from the output so that they don't get included in the library
- # dependencies.
- output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
- ;;
- *)
- if test "$GXX" = yes; then
- if test $with_gnu_ld = no; then
- case $host_cpu in
- hppa*64*)
- archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- ;;
- ia64*)
- archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- ;;
- *)
- archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- ;;
- esac
- fi
- else
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- fi
- ;;
- esac
- ;;
- interix3*)
- hardcode_direct_CXX=no
- hardcode_shlibpath_var_CXX=no
- hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
- export_dynamic_flag_spec_CXX='${wl}-E'
- # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
- # Instead, shared libraries are loaded at an image base (0x10000000 by
- # default) and relocated if they conflict, which is a slow very memory
- # consuming and fragmenting process. To avoid this, we pick a random,
- # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
- # time. Moving up from 0x10000000 also allows more sbrk(2) space.
- archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
- archive_expsym_cmds_CXX='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
- ;;
- irix5* | irix6*)
- case $cc_basename in
- CC*)
- # SGI C++
- archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
-
- # Archives containing C++ object files must be created using
- # "CC -ar", where "CC" is the IRIX C++ compiler. This is
- # necessary to make sure instantiated templates are included
- # in the archive.
- old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs'
- ;;
- *)
- if test "$GXX" = yes; then
- if test "$with_gnu_ld" = no; then
- archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- else
- archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib'
- fi
- fi
- link_all_deplibs_CXX=yes
- ;;
- esac
- hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
- hardcode_libdir_separator_CXX=:
- ;;
- linux*)
- case $cc_basename in
- KCC*)
- # Kuck and Associates, Inc. (KAI) C++ Compiler
-
- # KCC will only create a shared library if the output file
- # ends with ".so" (or ".sl" for HP-UX), so rename the library
- # to its proper name (with version) after linking.
- archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
- archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- #
- # There doesn't appear to be a way to prevent this compiler from
- # explicitly linking system object files so we need to strip them
- # from the output so that they don't get included in the library
- # dependencies.
- output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
-
- hardcode_libdir_flag_spec_CXX='${wl}--rpath,$libdir'
- export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
-
- # Archives containing C++ object files must be created using
- # "CC -Bstatic", where "CC" is the KAI C++ compiler.
- old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs'
- ;;
- icpc*)
- # Intel C++
- with_gnu_ld=yes
- # version 8.0 and above of icpc choke on multiply defined symbols
- # if we add $predep_objects and $postdep_objects, however 7.1 and
- # earlier do not add the objects themselves.
- case `$CC -V 2>&1` in
- *"Version 7."*)
- archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
- archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
- ;;
- *) # Version 8.0 or newer
- tmp_idyn=
- case $host_cpu in
- ia64*) tmp_idyn=' -i_dynamic';;
- esac
- archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
- ;;
- esac
- archive_cmds_need_lc_CXX=no
- hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
- export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
- whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
- ;;
- pgCC*)
- # Portland Group C++ compiler
- archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
- archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
-
- hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir'
- export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
- whole_archive_flag_spec_CXX='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
- ;;
- cxx*)
- # Compaq C++
- archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
- archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
-
- runpath_var=LD_RUN_PATH
- hardcode_libdir_flag_spec_CXX='-rpath $libdir'
- hardcode_libdir_separator_CXX=:
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- #
- # There doesn't appear to be a way to prevent this compiler from
- # explicitly linking system object files so we need to strip them
- # from the output so that they don't get included in the library
- # dependencies.
- output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
- ;;
- esac
- ;;
- lynxos*)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- m88k*)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- mvs*)
- case $cc_basename in
- cxx*)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- *)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- esac
- ;;
- netbsd*)
- if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
- archive_cmds_CXX='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
- wlarc=
- hardcode_libdir_flag_spec_CXX='-R$libdir'
- hardcode_direct_CXX=yes
- hardcode_shlibpath_var_CXX=no
- fi
- # Workaround some broken pre-1.5 toolchains
- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
- ;;
- openbsd2*)
- # C++ shared libraries are fairly broken
- ld_shlibs_CXX=no
- ;;
- openbsd*)
- hardcode_direct_CXX=yes
- hardcode_shlibpath_var_CXX=no
- archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
- hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
- if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
- archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
- export_dynamic_flag_spec_CXX='${wl}-E'
- whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
- fi
- output_verbose_link_cmd='echo'
- ;;
- osf3*)
- case $cc_basename in
- KCC*)
- # Kuck and Associates, Inc. (KAI) C++ Compiler
-
- # KCC will only create a shared library if the output file
- # ends with ".so" (or ".sl" for HP-UX), so rename the library
- # to its proper name (with version) after linking.
- archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
-
- hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
- hardcode_libdir_separator_CXX=:
-
- # Archives containing C++ object files must be created using
- # "CC -Bstatic", where "CC" is the KAI C++ compiler.
- old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs'
-
- ;;
- RCC*)
- # Rational C++ 2.4.1
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- cxx*)
- allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
- archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
-
- hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
- hardcode_libdir_separator_CXX=:
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- #
- # There doesn't appear to be a way to prevent this compiler from
- # explicitly linking system object files so we need to strip them
- # from the output so that they don't get included in the library
- # dependencies.
- output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
- ;;
- *)
- if test "$GXX" = yes && test "$with_gnu_ld" = no; then
- allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
- archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-
- hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
- hardcode_libdir_separator_CXX=:
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
-
- else
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- fi
- ;;
- esac
- ;;
- osf4* | osf5*)
- case $cc_basename in
- KCC*)
- # Kuck and Associates, Inc. (KAI) C++ Compiler
-
- # KCC will only create a shared library if the output file
- # ends with ".so" (or ".sl" for HP-UX), so rename the library
- # to its proper name (with version) after linking.
- archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
-
- hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
- hardcode_libdir_separator_CXX=:
-
- # Archives containing C++ object files must be created using
- # the KAI C++ compiler.
- old_archive_cmds_CXX='$CC -o $oldlib $oldobjs'
- ;;
- RCC*)
- # Rational C++ 2.4.1
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- cxx*)
- allow_undefined_flag_CXX=' -expect_unresolved \*'
- archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
- archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
- echo "-hidden">> $lib.exp~
- $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~
- $rm $lib.exp'
-
- hardcode_libdir_flag_spec_CXX='-rpath $libdir'
- hardcode_libdir_separator_CXX=:
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- #
- # There doesn't appear to be a way to prevent this compiler from
- # explicitly linking system object files so we need to strip them
- # from the output so that they don't get included in the library
- # dependencies.
- output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
- ;;
- *)
- if test "$GXX" = yes && test "$with_gnu_ld" = no; then
- allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
- archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-
- hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
- hardcode_libdir_separator_CXX=:
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
-
- else
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- fi
- ;;
- esac
- ;;
- psos*)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- sunos4*)
- case $cc_basename in
- CC*)
- # Sun C++ 4.x
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- lcc*)
- # Lucid
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- *)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- esac
- ;;
- solaris*)
- case $cc_basename in
- CC*)
- # Sun C++ 4.2, 5.x and Centerline C++
- archive_cmds_need_lc_CXX=yes
- no_undefined_flag_CXX=' -zdefs'
- archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
- $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
-
- hardcode_libdir_flag_spec_CXX='-R$libdir'
- hardcode_shlibpath_var_CXX=no
- case $host_os in
- solaris2.[0-5] | solaris2.[0-5].*) ;;
- *)
- # The C++ compiler is used as linker so we must use $wl
- # flag to pass the commands to the underlying system
- # linker. We must also pass each convience library through
- # to the system linker between allextract/defaultextract.
- # The C++ compiler will combine linker options so we
- # cannot just pass the convience library names through
- # without $wl.
- # Supported since Solaris 2.6 (maybe 2.5.1?)
- whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract'
- ;;
- esac
- link_all_deplibs_CXX=yes
-
- output_verbose_link_cmd='echo'
-
- # Archives containing C++ object files must be created using
- # "CC -xar", where "CC" is the Sun C++ compiler. This is
- # necessary to make sure instantiated templates are included
- # in the archive.
- old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs'
- ;;
- gcx*)
- # Green Hills C++ Compiler
- archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
-
- # The C++ compiler must be used to create the archive.
- old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
- ;;
- *)
- # GNU C++ compiler with Solaris linker
- if test "$GXX" = yes && test "$with_gnu_ld" = no; then
- no_undefined_flag_CXX=' ${wl}-z ${wl}defs'
- if $CC --version | grep -v '^2\.7' > /dev/null; then
- archive_cmds_CXX='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
- archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
- $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
- else
- # g++ 2.7 appears to require `-G' NOT `-shared' on this
- # platform.
- archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
- archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
- $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
- fi
-
- hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir'
- fi
- ;;
- esac
- ;;
- sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
- no_undefined_flag_CXX='${wl}-z,text'
- archive_cmds_need_lc_CXX=no
- hardcode_shlibpath_var_CXX=no
- runpath_var='LD_RUN_PATH'
-
- case $cc_basename in
- CC*)
- archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- *)
- archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- esac
- ;;
- sysv5* | sco3.2v5* | sco5v6*)
- # Note: We can NOT use -z defs as we might desire, because we do not
- # link with -lc, and that would cause any symbols used from libc to
- # always be unresolved, which means just about no library would
- # ever link correctly. If we're not using GNU ld we use -z text
- # though, which does catch some bad symbols but isn't as heavy-handed
- # as -z defs.
- # For security reasons, it is highly recommended that you always
- # use absolute paths for naming shared libraries, and exclude the
- # DT_RUNPATH tag from executables and libraries. But doing so
- # requires that you compile everything twice, which is a pain.
- # So that behaviour is only enabled if SCOABSPATH is set to a
- # non-empty value in the environment. Most likely only useful for
- # creating official distributions of packages.
- # This is a hack until libtool officially supports absolute path
- # names for shared libraries.
- no_undefined_flag_CXX='${wl}-z,text'
- allow_undefined_flag_CXX='${wl}-z,nodefs'
- archive_cmds_need_lc_CXX=no
- hardcode_shlibpath_var_CXX=no
- hardcode_libdir_flag_spec_CXX='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
- hardcode_libdir_separator_CXX=':'
- link_all_deplibs_CXX=yes
- export_dynamic_flag_spec_CXX='${wl}-Bexport'
- runpath_var='LD_RUN_PATH'
-
- case $cc_basename in
- CC*)
- archive_cmds_CXX='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- *)
- archive_cmds_CXX='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- esac
- ;;
- tandem*)
- case $cc_basename in
- NCC*)
- # NonStop-UX NCC 3.20
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- *)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- esac
- ;;
- vxworks*)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- *)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
-esac
-{ echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5
-echo "${ECHO_T}$ld_shlibs_CXX" >&6; }
-test "$ld_shlibs_CXX" = no && can_build_shared=no
-
-GCC_CXX="$GXX"
-LD_CXX="$LD"
-
-
-cat > conftest.$ac_ext <<EOF
-class Foo
-{
-public:
- Foo (void) { a = 0; }
-private:
- int a;
-};
-EOF
-
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; then
- # Parse the compiler output and extract the necessary
- # objects, libraries and library flags.
-
- # Sentinel used to keep track of whether or not we are before
- # the conftest object file.
- pre_test_object_deps_done=no
-
- # The `*' in the case matches for architectures that use `case' in
- # $output_verbose_cmd can trigger glob expansion during the loop
- # eval without this substitution.
- output_verbose_link_cmd=`$echo "X$output_verbose_link_cmd" | $Xsed -e "$no_glob_subst"`
-
- for p in `eval $output_verbose_link_cmd`; do
- case $p in
-
- -L* | -R* | -l*)
- # Some compilers place space between "-{L,R}" and the path.
- # Remove the space.
- if test $p = "-L" \
- || test $p = "-R"; then
- prev=$p
- continue
- else
- prev=
- fi
-
- if test "$pre_test_object_deps_done" = no; then
- case $p in
- -L* | -R*)
- # Internal compiler library paths should come after those
- # provided the user. The postdeps already come after the
- # user supplied libs so there is no need to process them.
- if test -z "$compiler_lib_search_path_CXX"; then
- compiler_lib_search_path_CXX="${prev}${p}"
- else
- compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} ${prev}${p}"
- fi
- ;;
- # The "-l" case would never come before the object being
- # linked, so don't bother handling this case.
- esac
- else
- if test -z "$postdeps_CXX"; then
- postdeps_CXX="${prev}${p}"
- else
- postdeps_CXX="${postdeps_CXX} ${prev}${p}"
- fi
- fi
- ;;
-
- *.$objext)
- # This assumes that the test object file only shows up
- # once in the compiler output.
- if test "$p" = "conftest.$objext"; then
- pre_test_object_deps_done=yes
- continue
- fi
-
- if test "$pre_test_object_deps_done" = no; then
- if test -z "$predep_objects_CXX"; then
- predep_objects_CXX="$p"
- else
- predep_objects_CXX="$predep_objects_CXX $p"
- fi
- else
- if test -z "$postdep_objects_CXX"; then
- postdep_objects_CXX="$p"
- else
- postdep_objects_CXX="$postdep_objects_CXX $p"
- fi
- fi
- ;;
-
- *) ;; # Ignore the rest.
-
- esac
- done
-
- # Clean up.
- rm -f a.out a.exe
-else
- echo "libtool.m4: error: problem compiling CXX test program"
-fi
-
-$rm -f confest.$objext
-
-# PORTME: override above test on systems where it is broken
-case $host_os in
-interix3*)
- # Interix 3.5 installs completely hosed .la files for C++, so rather than
- # hack all around it, let's just trust "g++" to DTRT.
- predep_objects_CXX=
- postdep_objects_CXX=
- postdeps_CXX=
- ;;
-
-solaris*)
- case $cc_basename in
- CC*)
- # Adding this requires a known-good setup of shared libraries for
- # Sun compiler versions before 5.6, else PIC objects from an old
- # archive will be linked into the output, leading to subtle bugs.
- postdeps_CXX='-lCstd -lCrun'
- ;;
- esac
- ;;
-esac
-
-
-case " $postdeps_CXX " in
-*" -lc "*) archive_cmds_need_lc_CXX=no ;;
-esac
-
-lt_prog_compiler_wl_CXX=
-lt_prog_compiler_pic_CXX=
-lt_prog_compiler_static_CXX=
-
-{ echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
-echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
-
- # C++ specific cases for pic, static, wl, etc.
- if test "$GXX" = yes; then
- lt_prog_compiler_wl_CXX='-Wl,'
- lt_prog_compiler_static_CXX='-static'
-
- case $host_os in
- aix*)
- # All AIX code is PIC.
- if test "$host_cpu" = ia64; then
- # AIX 5 now supports IA64 processor
- lt_prog_compiler_static_CXX='-Bstatic'
- fi
- ;;
- amigaos*)
- # FIXME: we need at least 68020 code to build shared libraries, but
- # adding the `-m68020' flag to GCC prevents building anything better,
- # like `-m68040'.
- lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4'
- ;;
- beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
- # PIC is the default for these OSes.
- ;;
- mingw* | os2* | pw32*)
- # This hack is so that the source file can tell whether it is being
- # built for inclusion in a dll (and should export symbols for example).
- lt_prog_compiler_pic_CXX='-DDLL_EXPORT'
- ;;
- darwin* | rhapsody*)
- # PIC is the default on this platform
- # Common symbols not allowed in MH_DYLIB files
- lt_prog_compiler_pic_CXX='-fno-common'
- ;;
- *djgpp*)
- # DJGPP does not support shared libraries at all
- lt_prog_compiler_pic_CXX=
- ;;
- interix3*)
- # Interix 3.x gcc -fpic/-fPIC options generate broken code.
- # Instead, we relocate shared libraries at runtime.
- ;;
- sysv4*MP*)
- if test -d /usr/nec; then
- lt_prog_compiler_pic_CXX=-Kconform_pic
- fi
- ;;
- hpux*)
- # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
- # not for PA HP-UX.
- case $host_cpu in
- hppa*64*|ia64*)
- ;;
- *)
- lt_prog_compiler_pic_CXX='-fPIC'
- ;;
- esac
- ;;
- *)
- lt_prog_compiler_pic_CXX='-fPIC'
- ;;
- esac
- else
- case $host_os in
- aix4* | aix5*)
- # All AIX code is PIC.
- if test "$host_cpu" = ia64; then
- # AIX 5 now supports IA64 processor
- lt_prog_compiler_static_CXX='-Bstatic'
- else
- lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp'
- fi
- ;;
- chorus*)
- case $cc_basename in
- cxch68*)
- # Green Hills C++ Compiler
- # _LT_AC_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
- ;;
- esac
- ;;
- darwin*)
- # PIC is the default on this platform
- # Common symbols not allowed in MH_DYLIB files
- case $cc_basename in
- xlc*)
- lt_prog_compiler_pic_CXX='-qnocommon'
- lt_prog_compiler_wl_CXX='-Wl,'
- ;;
- esac
- ;;
- dgux*)
- case $cc_basename in
- ec++*)
- lt_prog_compiler_pic_CXX='-KPIC'
- ;;
- ghcx*)
- # Green Hills C++ Compiler
- lt_prog_compiler_pic_CXX='-pic'
- ;;
- *)
- ;;
- esac
- ;;
- freebsd* | kfreebsd*-gnu | dragonfly*)
- # FreeBSD uses GNU C++
- ;;
- hpux9* | hpux10* | hpux11*)
- case $cc_basename in
- CC*)
- lt_prog_compiler_wl_CXX='-Wl,'
- lt_prog_compiler_static_CXX='${wl}-a ${wl}archive'
- if test "$host_cpu" != ia64; then
- lt_prog_compiler_pic_CXX='+Z'
- fi
- ;;
- aCC*)
- lt_prog_compiler_wl_CXX='-Wl,'
- lt_prog_compiler_static_CXX='${wl}-a ${wl}archive'
- case $host_cpu in
- hppa*64*|ia64*)
- # +Z the default
- ;;
- *)
- lt_prog_compiler_pic_CXX='+Z'
- ;;
- esac
- ;;
- *)
- ;;
- esac
- ;;
- interix*)
- # This is c89, which is MS Visual C++ (no shared libs)
- # Anyone wants to do a port?
- ;;
- irix5* | irix6* | nonstopux*)
- case $cc_basename in
- CC*)
- lt_prog_compiler_wl_CXX='-Wl,'
- lt_prog_compiler_static_CXX='-non_shared'
- # CC pic flag -KPIC is the default.
- ;;
- *)
- ;;
- esac
- ;;
- linux*)
- case $cc_basename in
- KCC*)
- # KAI C++ Compiler
- lt_prog_compiler_wl_CXX='--backend -Wl,'
- lt_prog_compiler_pic_CXX='-fPIC'
- ;;
- icpc* | ecpc*)
- # Intel C++
- lt_prog_compiler_wl_CXX='-Wl,'
- lt_prog_compiler_pic_CXX='-KPIC'
- lt_prog_compiler_static_CXX='-static'
- ;;
- pgCC*)
- # Portland Group C++ compiler.
- lt_prog_compiler_wl_CXX='-Wl,'
- lt_prog_compiler_pic_CXX='-fpic'
- lt_prog_compiler_static_CXX='-Bstatic'
- ;;
- cxx*)
- # Compaq C++
- # Make sure the PIC flag is empty. It appears that all Alpha
- # Linux and Compaq Tru64 Unix objects are PIC.
- lt_prog_compiler_pic_CXX=
- lt_prog_compiler_static_CXX='-non_shared'
- ;;
- *)
- ;;
- esac
- ;;
- lynxos*)
- ;;
- m88k*)
- ;;
- mvs*)
- case $cc_basename in
- cxx*)
- lt_prog_compiler_pic_CXX='-W c,exportall'
- ;;
- *)
- ;;
- esac
- ;;
- netbsd*)
- ;;
- osf3* | osf4* | osf5*)
- case $cc_basename in
- KCC*)
- lt_prog_compiler_wl_CXX='--backend -Wl,'
- ;;
- RCC*)
- # Rational C++ 2.4.1
- lt_prog_compiler_pic_CXX='-pic'
- ;;
- cxx*)
- # Digital/Compaq C++
- lt_prog_compiler_wl_CXX='-Wl,'
- # Make sure the PIC flag is empty. It appears that all Alpha
- # Linux and Compaq Tru64 Unix objects are PIC.
- lt_prog_compiler_pic_CXX=
- lt_prog_compiler_static_CXX='-non_shared'
- ;;
- *)
- ;;
- esac
- ;;
- psos*)
- ;;
- solaris*)
- case $cc_basename in
- CC*)
- # Sun C++ 4.2, 5.x and Centerline C++
- lt_prog_compiler_pic_CXX='-KPIC'
- lt_prog_compiler_static_CXX='-Bstatic'
- lt_prog_compiler_wl_CXX='-Qoption ld '
- ;;
- gcx*)
- # Green Hills C++ Compiler
- lt_prog_compiler_pic_CXX='-PIC'
- ;;
- *)
- ;;
- esac
- ;;
- sunos4*)
- case $cc_basename in
- CC*)
- # Sun C++ 4.x
- lt_prog_compiler_pic_CXX='-pic'
- lt_prog_compiler_static_CXX='-Bstatic'
- ;;
- lcc*)
- # Lucid
- lt_prog_compiler_pic_CXX='-pic'
- ;;
- *)
- ;;
- esac
- ;;
- tandem*)
- case $cc_basename in
- NCC*)
- # NonStop-UX NCC 3.20
- lt_prog_compiler_pic_CXX='-KPIC'
- ;;
- *)
- ;;
- esac
- ;;
- sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
- case $cc_basename in
- CC*)
- lt_prog_compiler_wl_CXX='-Wl,'
- lt_prog_compiler_pic_CXX='-KPIC'
- lt_prog_compiler_static_CXX='-Bstatic'
- ;;
- esac
- ;;
- vxworks*)
- ;;
- *)
- lt_prog_compiler_can_build_shared_CXX=no
- ;;
- esac
- fi
-
-{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_CXX" >&5
-echo "${ECHO_T}$lt_prog_compiler_pic_CXX" >&6; }
-
-#
-# Check to make sure the PIC flag actually works.
-#
-if test -n "$lt_prog_compiler_pic_CXX"; then
-
-{ echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5
-echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... $ECHO_C" >&6; }
-if test "${lt_prog_compiler_pic_works_CXX+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- lt_prog_compiler_pic_works_CXX=no
- ac_outfile=conftest.$ac_objext
- printf "$lt_simple_compile_test_code" > conftest.$ac_ext
- lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC"
- # Insert the option either (1) after the last *FLAGS variable, or
- # (2) before a word containing "conftest.", or (3) at the end.
- # Note that $ac_compile itself does not contain backslashes and begins
- # with a dollar sign (not a hyphen), so the echo should work correctly.
- # The option is referenced via a variable to avoid confusing sed.
- lt_compile=`echo "$ac_compile" | $SED \
- -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
- -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
- -e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:19788: $lt_compile\"" >&5)
- (eval "$lt_compile" 2>conftest.err)
- ac_status=$?
- cat conftest.err >&5
- echo "$as_me:19792: \$? = $ac_status" >&5
- if (exit $ac_status) && test -s "$ac_outfile"; then
- # The compiler can only warn and ignore the option if not recognized
- # So say no if there are warnings other than the usual output.
- $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
- $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
- if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
- lt_prog_compiler_pic_works_CXX=yes
- fi
- fi
- $rm conftest*
-
-fi
-{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_CXX" >&5
-echo "${ECHO_T}$lt_prog_compiler_pic_works_CXX" >&6; }
-
-if test x"$lt_prog_compiler_pic_works_CXX" = xyes; then
- case $lt_prog_compiler_pic_CXX in
- "" | " "*) ;;
- *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;;
- esac
-else
- lt_prog_compiler_pic_CXX=
- lt_prog_compiler_can_build_shared_CXX=no
-fi
-
-fi
-case $host_os in
- # For platforms which do not support PIC, -DPIC is meaningless:
- *djgpp*)
- lt_prog_compiler_pic_CXX=
- ;;
- *)
- lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC"
- ;;
-esac
-
-#
-# Check to make sure the static flag actually works.
-#
-wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\"
-{ echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5
-echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; }
-if test "${lt_prog_compiler_static_works_CXX+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- lt_prog_compiler_static_works_CXX=no
- save_LDFLAGS="$LDFLAGS"
- LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
- printf "$lt_simple_link_test_code" > conftest.$ac_ext
- if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
- # The linker can only warn and ignore the option if not recognized
- # So say no if there are warnings
- if test -s conftest.err; then
- # Append any errors to the config.log.
- cat conftest.err 1>&5
- $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
- $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
- if diff conftest.exp conftest.er2 >/dev/null; then
- lt_prog_compiler_static_works_CXX=yes
- fi
- else
- lt_prog_compiler_static_works_CXX=yes
- fi
- fi
- $rm conftest*
- LDFLAGS="$save_LDFLAGS"
-
-fi
-{ echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_CXX" >&5
-echo "${ECHO_T}$lt_prog_compiler_static_works_CXX" >&6; }
-
-if test x"$lt_prog_compiler_static_works_CXX" = xyes; then
- :
-else
- lt_prog_compiler_static_CXX=
-fi
-
-
-{ echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
-echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; }
-if test "${lt_cv_prog_compiler_c_o_CXX+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- lt_cv_prog_compiler_c_o_CXX=no
- $rm -r conftest 2>/dev/null
- mkdir conftest
- cd conftest
- mkdir out
- printf "$lt_simple_compile_test_code" > conftest.$ac_ext
-
- lt_compiler_flag="-o out/conftest2.$ac_objext"
- # Insert the option either (1) after the last *FLAGS variable, or
- # (2) before a word containing "conftest.", or (3) at the end.
- # Note that $ac_compile itself does not contain backslashes and begins
- # with a dollar sign (not a hyphen), so the echo should work correctly.
- lt_compile=`echo "$ac_compile" | $SED \
- -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
- -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
- -e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:19892: $lt_compile\"" >&5)
- (eval "$lt_compile" 2>out/conftest.err)
- ac_status=$?
- cat out/conftest.err >&5
- echo "$as_me:19896: \$? = $ac_status" >&5
- if (exit $ac_status) && test -s out/conftest2.$ac_objext
- then
- # The compiler can only warn and ignore the option if not recognized
- # So say no if there are warnings
- $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
- $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
- if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
- lt_cv_prog_compiler_c_o_CXX=yes
- fi
- fi
- chmod u+w . 2>&5
- $rm conftest*
- # SGI C++ compiler will create directory out/ii_files/ for
- # template instantiation
- test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files
- $rm out/* && rmdir out
- cd ..
- rmdir conftest
- $rm conftest*
-
-fi
-{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_CXX" >&5
-echo "${ECHO_T}$lt_cv_prog_compiler_c_o_CXX" >&6; }
-
-
-hard_links="nottested"
-if test "$lt_cv_prog_compiler_c_o_CXX" = no && test "$need_locks" != no; then
- # do not overwrite the value of need_locks provided by the user
- { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
-echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6; }
- hard_links=yes
- $rm conftest*
- ln conftest.a conftest.b 2>/dev/null && hard_links=no
- touch conftest.a
- ln conftest.a conftest.b 2>&5 || hard_links=no
- ln conftest.a conftest.b 2>/dev/null && hard_links=no
- { echo "$as_me:$LINENO: result: $hard_links" >&5
-echo "${ECHO_T}$hard_links" >&6; }
- if test "$hard_links" = no; then
- { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
-echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
- need_locks=warn
- fi
-else
- need_locks=no
-fi
-
-{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
-echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; }
-
- export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
- case $host_os in
- aix4* | aix5*)
- # If we're using GNU nm, then we don't want the "-C" option.
- # -C means demangle to AIX nm, but means don't demangle with GNU nm
- if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
- export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
- else
- export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
- fi
- ;;
- pw32*)
- export_symbols_cmds_CXX="$ltdll_cmds"
- ;;
- cygwin* | mingw*)
- export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/;/^.* __nm__/s/^.* __nm__\([^ ]*\) [^ ]*/\1 DATA/;/^I /d;/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
- ;;
- *)
- export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
- ;;
- esac
-
-{ echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5
-echo "${ECHO_T}$ld_shlibs_CXX" >&6; }
-test "$ld_shlibs_CXX" = no && can_build_shared=no
-
-#
-# Do we need to explicitly link libc?
-#
-case "x$archive_cmds_need_lc_CXX" in
-x|xyes)
- # Assume -lc should be added
- archive_cmds_need_lc_CXX=yes
-
- if test "$enable_shared" = yes && test "$GCC" = yes; then
- case $archive_cmds_CXX in
- *'~'*)
- # FIXME: we may have to deal with multi-command sequences.
- ;;
- '$CC '*)
- # Test whether the compiler implicitly links with -lc since on some
- # systems, -lgcc has to come before -lc. If gcc already passes -lc
- # to ld, don't add -lc before -lgcc.
- { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
-echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; }
- $rm conftest*
- printf "$lt_simple_compile_test_code" > conftest.$ac_ext
-
- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } 2>conftest.err; then
- soname=conftest
- lib=conftest
- libobjs=conftest.$ac_objext
- deplibs=
- wl=$lt_prog_compiler_wl_CXX
- pic_flag=$lt_prog_compiler_pic_CXX
- compiler_flags=-v
- linker_flags=-v
- verstring=
- output_objdir=.
- libname=conftest
- lt_save_allow_undefined_flag=$allow_undefined_flag_CXX
- allow_undefined_flag_CXX=
- if { (eval echo "$as_me:$LINENO: \"$archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5
- (eval $archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }
- then
- archive_cmds_need_lc_CXX=no
- else
- archive_cmds_need_lc_CXX=yes
- fi
- allow_undefined_flag_CXX=$lt_save_allow_undefined_flag
- else
- cat conftest.err 1>&5
- fi
- $rm conftest*
- { echo "$as_me:$LINENO: result: $archive_cmds_need_lc_CXX" >&5
-echo "${ECHO_T}$archive_cmds_need_lc_CXX" >&6; }
- ;;
- esac
- fi
- ;;
-esac
-
-{ echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
-echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; }
-library_names_spec=
-libname_spec='lib$name'
-soname_spec=
-shrext_cmds=".so"
-postinstall_cmds=
-postuninstall_cmds=
-finish_cmds=
-finish_eval=
-shlibpath_var=
-shlibpath_overrides_runpath=unknown
-version_type=none
-dynamic_linker="$host_os ld.so"
-sys_lib_dlsearch_path_spec="/lib /usr/lib"
-if test "$GCC" = yes; then
- sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
- if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then
- # if the path contains ";" then we assume it to be the separator
- # otherwise default to the standard path separator (i.e. ":") - it is
- # assumed that no part of a normal pathname contains ";" but that should
- # okay in the real world where ";" in dirpaths is itself problematic.
- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
- else
- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
- fi
-else
- sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
-fi
-need_lib_prefix=unknown
-hardcode_into_libs=no
-
-# when you set need_version to no, make sure it does not cause -set_version
-# flags to be left without arguments
-need_version=unknown
-
-case $host_os in
-aix3*)
- version_type=linux
- library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
- shlibpath_var=LIBPATH
-
- # AIX 3 has no versioning support, so we append a major version to the name.
- soname_spec='${libname}${release}${shared_ext}$major'
- ;;
-
-aix4* | aix5*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- hardcode_into_libs=yes
- if test "$host_cpu" = ia64; then
- # AIX 5 supports IA64
- library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
- shlibpath_var=LD_LIBRARY_PATH
- else
- # With GCC up to 2.95.x, collect2 would create an import file
- # for dependence libraries. The import file would start with
- # the line `#! .'. This would cause the generated library to
- # depend on `.', always an invalid library. This was fixed in
- # development snapshots of GCC prior to 3.0.
- case $host_os in
- aix4 | aix4.[01] | aix4.[01].*)
- if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
- echo ' yes '
- echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
- :
- else
- can_build_shared=no
- fi
- ;;
- esac
- # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
- # soname into executable. Probably we can add versioning support to
- # collect2, so additional links can be useful in future.
- if test "$aix_use_runtimelinking" = yes; then
- # If using run time linking (on AIX 4.2 or later) use lib<name>.so
- # instead of lib<name>.a to let people know that these are not
- # typical AIX shared libraries.
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- else
- # We preserve .a as extension for shared libraries through AIX4.2
- # and later when we are not doing run time linking.
- library_names_spec='${libname}${release}.a $libname.a'
- soname_spec='${libname}${release}${shared_ext}$major'
- fi
- shlibpath_var=LIBPATH
- fi
- ;;
-
-amigaos*)
- library_names_spec='$libname.ixlibrary $libname.a'
- # Create ${libname}_ixlibrary.a entries in /sys/libs.
- finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
- ;;
-
-beos*)
- library_names_spec='${libname}${shared_ext}'
- dynamic_linker="$host_os ld.so"
- shlibpath_var=LIBRARY_PATH
- ;;
-
-bsdi[45]*)
- version_type=linux
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
- sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
- # the default ld.so.conf also contains /usr/contrib/lib and
- # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
- # libtool to hard-code these into programs
- ;;
-
-cygwin* | mingw* | pw32*)
- version_type=windows
- shrext_cmds=".dll"
- need_version=no
- need_lib_prefix=no
-
- case $GCC,$host_os in
- yes,cygwin* | yes,mingw* | yes,pw32*)
- library_names_spec='$libname.dll.a'
- # DLL is installed to $(libdir)/../bin by postinstall_cmds
- postinstall_cmds='base_file=`basename \${file}`~
- dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
- dldir=$destdir/`dirname \$dlpath`~
- test -d \$dldir || mkdir -p \$dldir~
- $install_prog $dir/$dlname \$dldir/$dlname~
- chmod a+x \$dldir/$dlname'
- postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
- dlpath=$dir/\$dldll~
- $rm \$dlpath'
- shlibpath_overrides_runpath=yes
-
- case $host_os in
- cygwin*)
- # Cygwin DLLs use 'cyg' prefix rather than 'lib'
- soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
- sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
- ;;
- mingw*)
- # MinGW DLLs use traditional 'lib' prefix
- soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
- sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
- if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then
- # It is most probably a Windows format PATH printed by
- # mingw gcc, but we are running on Cygwin. Gcc prints its search
- # path with ; separators, and with drive letters. We can handle the
- # drive letters (cygwin fileutils understands them), so leave them,
- # especially as we might pass files found there to a mingw objdump,
- # which wouldn't understand a cygwinified path. Ahh.
- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
- else
- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
- fi
- ;;
- pw32*)
- # pw32 DLLs use 'pw' prefix rather than 'lib'
- library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
- ;;
- esac
- ;;
-
- *)
- library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
- ;;
- esac
- dynamic_linker='Win32 ld.exe'
- # FIXME: first we should search . and the directory the executable is in
- shlibpath_var=PATH
- ;;
-
-darwin* | rhapsody*)
- dynamic_linker="$host_os dyld"
- version_type=darwin
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
- soname_spec='${libname}${release}${major}$shared_ext'
- shlibpath_overrides_runpath=yes
- shlibpath_var=DYLD_LIBRARY_PATH
- shrext_cmds='.dylib'
- # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
- if test "$GCC" = yes; then
- sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
- else
- sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
- fi
- sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
- ;;
-
-dgux*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- ;;
-
-freebsd1*)
- dynamic_linker=no
- ;;
-
-kfreebsd*-gnu)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- dynamic_linker='GNU ld.so'
- ;;
-
-freebsd* | dragonfly*)
- # DragonFly does not have aout. When/if they implement a new
- # versioning mechanism, adjust this.
- if test -x /usr/bin/objformat; then
- objformat=`/usr/bin/objformat`
- else
- case $host_os in
- freebsd[123]*) objformat=aout ;;
- *) objformat=elf ;;
- esac
- fi
- version_type=freebsd-$objformat
- case $version_type in
- freebsd-elf*)
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
- need_version=no
- need_lib_prefix=no
- ;;
- freebsd-*)
- library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
- need_version=yes
- ;;
- esac
- shlibpath_var=LD_LIBRARY_PATH
- case $host_os in
- freebsd2*)
- shlibpath_overrides_runpath=yes
- ;;
- freebsd3.[01]* | freebsdelf3.[01]*)
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- ;;
- freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
- freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- ;;
- freebsd*) # from 4.6 on
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- ;;
- esac
- ;;
-
-gnu*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- hardcode_into_libs=yes
- ;;
-
-hpux9* | hpux10* | hpux11*)
- # Give a soname corresponding to the major version so that dld.sl refuses to
- # link against other versions.
- version_type=sunos
- need_lib_prefix=no
- need_version=no
- case $host_cpu in
- ia64*)
- shrext_cmds='.so'
- hardcode_into_libs=yes
- dynamic_linker="$host_os dld.so"
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- if test "X$HPUX_IA64_MODE" = X32; then
- sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
- else
- sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
- fi
- sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
- ;;
- hppa*64*)
- shrext_cmds='.sl'
- hardcode_into_libs=yes
- dynamic_linker="$host_os dld.sl"
- shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
- shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
- sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
- ;;
- *)
- shrext_cmds='.sl'
- dynamic_linker="$host_os dld.sl"
- shlibpath_var=SHLIB_PATH
- shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- ;;
- esac
- # HP-UX runs *really* slowly unless shared libraries are mode 555.
- postinstall_cmds='chmod 555 $lib'
- ;;
-
-interix3*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- ;;
-
-irix5* | irix6* | nonstopux*)
- case $host_os in
- nonstopux*) version_type=nonstopux ;;
- *)
- if test "$lt_cv_prog_gnu_ld" = yes; then
- version_type=linux
- else
- version_type=irix
- fi ;;
- esac
- need_lib_prefix=no
- need_version=no
- soname_spec='${libname}${release}${shared_ext}$major'
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
- case $host_os in
- irix5* | nonstopux*)
- libsuff= shlibsuff=
- ;;
- *)
- case $LD in # libtool.m4 will add one of these switches to LD
- *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
- libsuff= shlibsuff= libmagic=32-bit;;
- *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
- libsuff=32 shlibsuff=N32 libmagic=N32;;
- *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
- libsuff=64 shlibsuff=64 libmagic=64-bit;;
- *) libsuff= shlibsuff= libmagic=never-match;;
- esac
- ;;
- esac
- shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
- shlibpath_overrides_runpath=no
- sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
- sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
- hardcode_into_libs=yes
- ;;
-
-# No shared lib support for Linux oldld, aout, or coff.
-linux*oldld* | linux*aout* | linux*coff*)
- dynamic_linker=no
- ;;
-
-# This must be Linux ELF.
-linux*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- # This implies no fast_install, which is unacceptable.
- # Some rework will be needed to allow for fast_install
- # before this can be enabled.
- hardcode_into_libs=yes
-
- # Append ld.so.conf contents to the search path
- if test -f /etc/ld.so.conf; then
- lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
- sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
- fi
-
- # We used to test for /lib/ld.so.1 and disable shared libraries on
- # powerpc, because MkLinux only supported shared libraries with the
- # GNU dynamic linker. Since this was broken with cross compilers,
- # most powerpc-linux boxes support dynamic linking these days and
- # people can always --disable-shared, the test was removed, and we
- # assume the GNU/Linux dynamic linker is in use.
- dynamic_linker='GNU/Linux ld.so'
- ;;
-
-knetbsd*-gnu)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- dynamic_linker='GNU ld.so'
- ;;
-
-netbsd*)
- version_type=sunos
- need_lib_prefix=no
- need_version=no
- if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
- dynamic_linker='NetBSD (a.out) ld.so'
- else
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- dynamic_linker='NetBSD ld.elf_so'
- fi
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- ;;
-
-newsos6)
- version_type=linux
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- ;;
-
-nto-qnx*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- ;;
-
-openbsd*)
- version_type=sunos
- sys_lib_dlsearch_path_spec="/usr/lib"
- need_lib_prefix=no
- # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
- case $host_os in
- openbsd3.3 | openbsd3.3.*) need_version=yes ;;
- *) need_version=no ;;
- esac
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
- case $host_os in
- openbsd2.[89] | openbsd2.[89].*)
- shlibpath_overrides_runpath=no
- ;;
- *)
- shlibpath_overrides_runpath=yes
- ;;
- esac
- else
- shlibpath_overrides_runpath=yes
- fi
- ;;
-
-os2*)
- libname_spec='$name'
- shrext_cmds=".dll"
- need_lib_prefix=no
- library_names_spec='$libname${shared_ext} $libname.a'
- dynamic_linker='OS/2 ld.exe'
- shlibpath_var=LIBPATH
- ;;
-
-osf3* | osf4* | osf5*)
- version_type=osf
- need_lib_prefix=no
- need_version=no
- soname_spec='${libname}${release}${shared_ext}$major'
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- shlibpath_var=LD_LIBRARY_PATH
- sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
- sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
- ;;
-
-solaris*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- # ldd complains unless libraries are executable
- postinstall_cmds='chmod +x $lib'
- ;;
-
-sunos4*)
- version_type=sunos
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
- finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- if test "$with_gnu_ld" = yes; then
- need_lib_prefix=no
- fi
- need_version=yes
- ;;
-
-sysv4 | sysv4.3*)
- version_type=linux
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- case $host_vendor in
- sni)
- shlibpath_overrides_runpath=no
- need_lib_prefix=no
- export_dynamic_flag_spec='${wl}-Blargedynsym'
- runpath_var=LD_RUN_PATH
- ;;
- siemens)
- need_lib_prefix=no
- ;;
- motorola)
- need_lib_prefix=no
- need_version=no
- shlibpath_overrides_runpath=no
- sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
- ;;
- esac
- ;;
-
-sysv4*MP*)
- if test -d /usr/nec ;then
- version_type=linux
- library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
- soname_spec='$libname${shared_ext}.$major'
- shlibpath_var=LD_LIBRARY_PATH
- fi
- ;;
-
-sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
- version_type=freebsd-elf
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- hardcode_into_libs=yes
- if test "$with_gnu_ld" = yes; then
- sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
- shlibpath_overrides_runpath=no
- else
- sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
- shlibpath_overrides_runpath=yes
- case $host_os in
- sco3.2v5*)
- sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
- ;;
- esac
- fi
- sys_lib_dlsearch_path_spec='/usr/lib'
- ;;
-
-uts4*)
- version_type=linux
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- ;;
-
-*)
- dynamic_linker=no
- ;;
-esac
-{ echo "$as_me:$LINENO: result: $dynamic_linker" >&5
-echo "${ECHO_T}$dynamic_linker" >&6; }
-test "$dynamic_linker" = no && can_build_shared=no
-
-variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
-if test "$GCC" = yes; then
- variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
-fi
-
-{ echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
-echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; }
-hardcode_action_CXX=
-if test -n "$hardcode_libdir_flag_spec_CXX" || \
- test -n "$runpath_var_CXX" || \
- test "X$hardcode_automatic_CXX" = "Xyes" ; then
-
- # We can hardcode non-existant directories.
- if test "$hardcode_direct_CXX" != no &&
- # If the only mechanism to avoid hardcoding is shlibpath_var, we
- # have to relink, otherwise we might link with an installed library
- # when we should be linking with a yet-to-be-installed one
- ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, CXX)" != no &&
- test "$hardcode_minus_L_CXX" != no; then
- # Linking always hardcodes the temporary library directory.
- hardcode_action_CXX=relink
- else
- # We can link without hardcoding, and we can hardcode nonexisting dirs.
- hardcode_action_CXX=immediate
- fi
-else
- # We cannot hardcode anything, or else we can only hardcode existing
- # directories.
- hardcode_action_CXX=unsupported
-fi
-{ echo "$as_me:$LINENO: result: $hardcode_action_CXX" >&5
-echo "${ECHO_T}$hardcode_action_CXX" >&6; }
-
-if test "$hardcode_action_CXX" = relink; then
- # Fast installation is not supported
- enable_fast_install=no
-elif test "$shlibpath_overrides_runpath" = yes ||
- test "$enable_shared" = no; then
- # Fast installation is not necessary
- enable_fast_install=needless
-fi
-
-
-# The else clause should only fire when bootstrapping the
-# libtool distribution, otherwise you forgot to ship ltmain.sh
-# with your package, and you will get complaints that there are
-# no rules to generate ltmain.sh.
-if test -f "$ltmain"; then
- # See if we are running on zsh, and set the options which allow our commands through
- # without removal of \ escapes.
- if test -n "${ZSH_VERSION+set}" ; then
- setopt NO_GLOB_SUBST
- fi
- # Now quote all the things that may contain metacharacters while being
- # careful not to overquote the AC_SUBSTed values. We take copies of the
- # variables and quote the copies for generation of the libtool script.
- for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \
- SED SHELL STRIP \
- libname_spec library_names_spec soname_spec extract_expsyms_cmds \
- old_striplib striplib file_magic_cmd finish_cmds finish_eval \
- deplibs_check_method reload_flag reload_cmds need_locks \
- lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
- lt_cv_sys_global_symbol_to_c_name_address \
- sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
- old_postinstall_cmds old_postuninstall_cmds \
- compiler_CXX \
- CC_CXX \
- LD_CXX \
- lt_prog_compiler_wl_CXX \
- lt_prog_compiler_pic_CXX \
- lt_prog_compiler_static_CXX \
- lt_prog_compiler_no_builtin_flag_CXX \
- export_dynamic_flag_spec_CXX \
- thread_safe_flag_spec_CXX \
- whole_archive_flag_spec_CXX \
- enable_shared_with_static_runtimes_CXX \
- old_archive_cmds_CXX \
- old_archive_from_new_cmds_CXX \
- predep_objects_CXX \
- postdep_objects_CXX \
- predeps_CXX \
- postdeps_CXX \
- compiler_lib_search_path_CXX \
- archive_cmds_CXX \
- archive_expsym_cmds_CXX \
- postinstall_cmds_CXX \
- postuninstall_cmds_CXX \
- old_archive_from_expsyms_cmds_CXX \
- allow_undefined_flag_CXX \
- no_undefined_flag_CXX \
- export_symbols_cmds_CXX \
- hardcode_libdir_flag_spec_CXX \
- hardcode_libdir_flag_spec_ld_CXX \
- hardcode_libdir_separator_CXX \
- hardcode_automatic_CXX \
- module_cmds_CXX \
- module_expsym_cmds_CXX \
- lt_cv_prog_compiler_c_o_CXX \
- exclude_expsyms_CXX \
- include_expsyms_CXX; do
-
- case $var in
- old_archive_cmds_CXX | \
- old_archive_from_new_cmds_CXX | \
- archive_cmds_CXX | \
- archive_expsym_cmds_CXX | \
- module_cmds_CXX | \
- module_expsym_cmds_CXX | \
- old_archive_from_expsyms_cmds_CXX | \
- export_symbols_cmds_CXX | \
- extract_expsyms_cmds | reload_cmds | finish_cmds | \
- postinstall_cmds | postuninstall_cmds | \
- old_postinstall_cmds | old_postuninstall_cmds | \
- sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
- # Double-quote double-evaled strings.
- eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
- ;;
- *)
- eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
- ;;
- esac
- done
-
- case $lt_echo in
- *'\$0 --fallback-echo"')
- lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
- ;;
- esac
-
-cfgfile="$ofile"
-
- cat <<__EOF__ >> "$cfgfile"
-# ### BEGIN LIBTOOL TAG CONFIG: $tagname
-
-# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
-
-# Shell to use when invoking shell scripts.
-SHELL=$lt_SHELL
-
-# Whether or not to build shared libraries.
-build_libtool_libs=$enable_shared
-
-# Whether or not to build static libraries.
-build_old_libs=$enable_static
-
-# Whether or not to add -lc for building shared libraries.
-build_libtool_need_lc=$archive_cmds_need_lc_CXX
-
-# Whether or not to disallow shared libs when runtime libs are static
-allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX
-
-# Whether or not to optimize for fast installation.
-fast_install=$enable_fast_install
-
-# The host system.
-host_alias=$host_alias
-host=$host
-host_os=$host_os
-
-# The build system.
-build_alias=$build_alias
-build=$build
-build_os=$build_os
-
-# An echo program that does not interpret backslashes.
-echo=$lt_echo
-
-# The archiver.
-AR=$lt_AR
-AR_FLAGS=$lt_AR_FLAGS
-
-# A C compiler.
-LTCC=$lt_LTCC
-
-# LTCC compiler flags.
-LTCFLAGS=$lt_LTCFLAGS
-
-# A language-specific compiler.
-CC=$lt_compiler_CXX
-
-# Is the compiler the GNU C compiler?
-with_gcc=$GCC_CXX
-
-# An ERE matcher.
-EGREP=$lt_EGREP
-
-# The linker used to build libraries.
-LD=$lt_LD_CXX
-
-# Whether we need hard or soft links.
-LN_S=$lt_LN_S
-
-# A BSD-compatible nm program.
-NM=$lt_NM
-
-# A symbol stripping program
-STRIP=$lt_STRIP
-
-# Used to examine libraries when file_magic_cmd begins "file"
-MAGIC_CMD=$MAGIC_CMD
-
-# Used on cygwin: DLL creation program.
-DLLTOOL="$DLLTOOL"
-
-# Used on cygwin: object dumper.
-OBJDUMP="$OBJDUMP"
-
-# Used on cygwin: assembler.
-AS="$AS"
-
-# The name of the directory that contains temporary libtool files.
-objdir=$objdir
-
-# How to create reloadable object files.
-reload_flag=$lt_reload_flag
-reload_cmds=$lt_reload_cmds
-
-# How to pass a linker flag through the compiler.
-wl=$lt_lt_prog_compiler_wl_CXX
-
-# Object file suffix (normally "o").
-objext="$ac_objext"
-
-# Old archive suffix (normally "a").
-libext="$libext"
-
-# Shared library suffix (normally ".so").
-shrext_cmds='$shrext_cmds'
-
-# Executable file suffix (normally "").
-exeext="$exeext"
-
-# Additional compiler flags for building library objects.
-pic_flag=$lt_lt_prog_compiler_pic_CXX
-pic_mode=$pic_mode
-
-# What is the maximum length of a command?
-max_cmd_len=$lt_cv_sys_max_cmd_len
-
-# Does compiler simultaneously support -c and -o options?
-compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX
-
-# Must we lock files when doing compilation?
-need_locks=$lt_need_locks
-
-# Do we need the lib prefix for modules?
-need_lib_prefix=$need_lib_prefix
-
-# Do we need a version for libraries?
-need_version=$need_version
-
-# Whether dlopen is supported.
-dlopen_support=$enable_dlopen
-
-# Whether dlopen of programs is supported.
-dlopen_self=$enable_dlopen_self
-
-# Whether dlopen of statically linked programs is supported.
-dlopen_self_static=$enable_dlopen_self_static
-
-# Compiler flag to prevent dynamic linking.
-link_static_flag=$lt_lt_prog_compiler_static_CXX
-
-# Compiler flag to turn off builtin functions.
-no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX
-
-# Compiler flag to allow reflexive dlopens.
-export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX
-
-# Compiler flag to generate shared objects directly from archives.
-whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX
-
-# Compiler flag to generate thread-safe objects.
-thread_safe_flag_spec=$lt_thread_safe_flag_spec_CXX
-
-# Library versioning type.
-version_type=$version_type
-
-# Format of library name prefix.
-libname_spec=$lt_libname_spec
-
-# List of archive names. First name is the real one, the rest are links.
-# The last name is the one that the linker finds with -lNAME.
-library_names_spec=$lt_library_names_spec
-
-# The coded name of the library, if different from the real name.
-soname_spec=$lt_soname_spec
-
-# Commands used to build and install an old-style archive.
-RANLIB=$lt_RANLIB
-old_archive_cmds=$lt_old_archive_cmds_CXX
-old_postinstall_cmds=$lt_old_postinstall_cmds
-old_postuninstall_cmds=$lt_old_postuninstall_cmds
-
-# Create an old-style archive from a shared archive.
-old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX
-
-# Create a temporary old-style archive to link instead of a shared archive.
-old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX
-
-# Commands used to build and install a shared archive.
-archive_cmds=$lt_archive_cmds_CXX
-archive_expsym_cmds=$lt_archive_expsym_cmds_CXX
-postinstall_cmds=$lt_postinstall_cmds
-postuninstall_cmds=$lt_postuninstall_cmds
-
-# Commands used to build a loadable module (assumed same as above if empty)
-module_cmds=$lt_module_cmds_CXX
-module_expsym_cmds=$lt_module_expsym_cmds_CXX
-
-# Commands to strip libraries.
-old_striplib=$lt_old_striplib
-striplib=$lt_striplib
-
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predep_objects=$lt_predep_objects_CXX
-
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdep_objects=$lt_postdep_objects_CXX
-
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predeps=$lt_predeps_CXX
-
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdeps=$lt_postdeps_CXX
-
-# The library search path used internally by the compiler when linking
-# a shared library.
-compiler_lib_search_path=$lt_compiler_lib_search_path_CXX
-
-# Method to check whether dependent libraries are shared objects.
-deplibs_check_method=$lt_deplibs_check_method
-
-# Command to use when deplibs_check_method == file_magic.
-file_magic_cmd=$lt_file_magic_cmd
-
-# Flag that allows shared libraries with undefined symbols to be built.
-allow_undefined_flag=$lt_allow_undefined_flag_CXX
-
-# Flag that forces no undefined symbols.
-no_undefined_flag=$lt_no_undefined_flag_CXX
-
-# Commands used to finish a libtool library installation in a directory.
-finish_cmds=$lt_finish_cmds
-
-# Same as above, but a single script fragment to be evaled but not shown.
-finish_eval=$lt_finish_eval
-
-# Take the output of nm and produce a listing of raw symbols and C names.
-global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
-
-# Transform the output of nm in a proper C declaration
-global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
-
-# Transform the output of nm in a C name address pair
-global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
-
-# This is the shared library runtime path variable.
-runpath_var=$runpath_var
-
-# This is the shared library path variable.
-shlibpath_var=$shlibpath_var
-
-# Is shlibpath searched before the hard-coded library search path?
-shlibpath_overrides_runpath=$shlibpath_overrides_runpath
-
-# How to hardcode a shared library path into an executable.
-hardcode_action=$hardcode_action_CXX
-
-# Whether we should hardcode library paths into libraries.
-hardcode_into_libs=$hardcode_into_libs
-
-# Flag to hardcode \$libdir into a binary during linking.
-# This must work even if \$libdir does not exist.
-hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX
-
-# If ld is used when linking, flag to hardcode \$libdir into
-# a binary during linking. This must work even if \$libdir does
-# not exist.
-hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_CXX
-
-# Whether we need a single -rpath flag with a separated argument.
-hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX
-
-# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
-# resulting binary.
-hardcode_direct=$hardcode_direct_CXX
-
-# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
-# resulting binary.
-hardcode_minus_L=$hardcode_minus_L_CXX
-
-# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
-# the resulting binary.
-hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX
-
-# Set to yes if building a shared library automatically hardcodes DIR into the library
-# and all subsequent libraries and executables linked against it.
-hardcode_automatic=$hardcode_automatic_CXX
-
-# Variables whose values should be saved in libtool wrapper scripts and
-# restored at relink time.
-variables_saved_for_relink="$variables_saved_for_relink"
-
-# Whether libtool must link a program against all its dependency libraries.
-link_all_deplibs=$link_all_deplibs_CXX
-
-# Compile-time system search path for libraries
-sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
-
-# Run-time system search path for libraries
-sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
-
-# Fix the shell variable \$srcfile for the compiler.
-fix_srcfile_path="$fix_srcfile_path_CXX"
-
-# Set to yes if exported symbols are required.
-always_export_symbols=$always_export_symbols_CXX
-
-# The commands to list exported symbols.
-export_symbols_cmds=$lt_export_symbols_cmds_CXX
-
-# The commands to extract the exported symbol list from a shared archive.
-extract_expsyms_cmds=$lt_extract_expsyms_cmds
-
-# Symbols that should not be listed in the preloaded symbols.
-exclude_expsyms=$lt_exclude_expsyms_CXX
-
-# Symbols that must always be exported.
-include_expsyms=$lt_include_expsyms_CXX
-
-# ### END LIBTOOL TAG CONFIG: $tagname
-
-__EOF__
-
-
-else
- # If there is no Makefile yet, we rely on a make rule to execute
- # `config.status --recheck' to rerun these tests and create the
- # libtool script then.
- ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
- if test -f "$ltmain_in"; then
- test -f Makefile && make "$ltmain"
- fi
-fi
-
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-CC=$lt_save_CC
-LDCXX=$LD
-LD=$lt_save_LD
-GCC=$lt_save_GCC
-with_gnu_ldcxx=$with_gnu_ld
-with_gnu_ld=$lt_save_with_gnu_ld
-lt_cv_path_LDCXX=$lt_cv_path_LD
-lt_cv_path_LD=$lt_save_path_LD
-lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
-lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
-
- else
- tagname=""
- fi
- ;;
-
- F77)
- if test -n "$F77" && test "X$F77" != "Xno"; then
-
-ac_ext=f
-ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'
-ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_f77_compiler_gnu
-
-
-archive_cmds_need_lc_F77=no
-allow_undefined_flag_F77=
-always_export_symbols_F77=no
-archive_expsym_cmds_F77=
-export_dynamic_flag_spec_F77=
-hardcode_direct_F77=no
-hardcode_libdir_flag_spec_F77=
-hardcode_libdir_flag_spec_ld_F77=
-hardcode_libdir_separator_F77=
-hardcode_minus_L_F77=no
-hardcode_automatic_F77=no
-module_cmds_F77=
-module_expsym_cmds_F77=
-link_all_deplibs_F77=unknown
-old_archive_cmds_F77=$old_archive_cmds
-no_undefined_flag_F77=
-whole_archive_flag_spec_F77=
-enable_shared_with_static_runtimes_F77=no
-
-# Source file extension for f77 test sources.
-ac_ext=f
-
-# Object file extension for compiled f77 test sources.
-objext=o
-objext_F77=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code=" subroutine t\n return\n end\n"
-
-# Code to be used in simple link tests
-lt_simple_link_test_code=" program t\n end\n"
-
-# ltmain only uses $CC for tagged configurations so make sure $CC is set.
-
-# If no C compiler was specified, use CC.
-LTCC=${LTCC-"$CC"}
-
-# If no C compiler flags were specified, use CFLAGS.
-LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
-
-# Allow CC to be a program name with arguments.
-compiler=$CC
-
-
-# save warnings/boilerplate of simple test code
-ac_outfile=conftest.$ac_objext
-printf "$lt_simple_compile_test_code" >conftest.$ac_ext
-eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_compiler_boilerplate=`cat conftest.err`
-$rm conftest*
-
-ac_outfile=conftest.$ac_objext
-printf "$lt_simple_link_test_code" >conftest.$ac_ext
-eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_linker_boilerplate=`cat conftest.err`
-$rm conftest*
-
-
-# Allow CC to be a program name with arguments.
-lt_save_CC="$CC"
-CC=${F77-"f77"}
-compiler=$CC
-compiler_F77=$CC
-for cc_temp in $compiler""; do
- case $cc_temp in
- compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
- distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
- \-*) ;;
- *) break;;
- esac
-done
-cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
-
-
-{ echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5
-echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6; }
-{ echo "$as_me:$LINENO: result: $can_build_shared" >&5
-echo "${ECHO_T}$can_build_shared" >&6; }
-
-{ echo "$as_me:$LINENO: checking whether to build shared libraries" >&5
-echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6; }
-test "$can_build_shared" = "no" && enable_shared=no
-
-# On AIX, shared libraries and static libraries use the same namespace, and
-# are all built from PIC.
-case $host_os in
-aix3*)
- test "$enable_shared" = yes && enable_static=no
- if test -n "$RANLIB"; then
- archive_cmds="$archive_cmds~\$RANLIB \$lib"
- postinstall_cmds='$RANLIB $lib'
- fi
- ;;
-aix4* | aix5*)
- if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
- test "$enable_shared" = yes && enable_static=no
- fi
- ;;
-esac
-{ echo "$as_me:$LINENO: result: $enable_shared" >&5
-echo "${ECHO_T}$enable_shared" >&6; }
-
-{ echo "$as_me:$LINENO: checking whether to build static libraries" >&5
-echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6; }
-# Make sure either enable_shared or enable_static is yes.
-test "$enable_shared" = yes || enable_static=yes
-{ echo "$as_me:$LINENO: result: $enable_static" >&5
-echo "${ECHO_T}$enable_static" >&6; }
-
-GCC_F77="$G77"
-LD_F77="$LD"
-
-lt_prog_compiler_wl_F77=
-lt_prog_compiler_pic_F77=
-lt_prog_compiler_static_F77=
-
-{ echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
-echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
-
- if test "$GCC" = yes; then
- lt_prog_compiler_wl_F77='-Wl,'
- lt_prog_compiler_static_F77='-static'
-
- case $host_os in
- aix*)
- # All AIX code is PIC.
- if test "$host_cpu" = ia64; then
- # AIX 5 now supports IA64 processor
- lt_prog_compiler_static_F77='-Bstatic'
- fi
- ;;
-
- amigaos*)
- # FIXME: we need at least 68020 code to build shared libraries, but
- # adding the `-m68020' flag to GCC prevents building anything better,
- # like `-m68040'.
- lt_prog_compiler_pic_F77='-m68020 -resident32 -malways-restore-a4'
- ;;
-
- beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
- # PIC is the default for these OSes.
- ;;
-
- mingw* | pw32* | os2*)
- # This hack is so that the source file can tell whether it is being
- # built for inclusion in a dll (and should export symbols for example).
- lt_prog_compiler_pic_F77='-DDLL_EXPORT'
- ;;
-
- darwin* | rhapsody*)
- # PIC is the default on this platform
- # Common symbols not allowed in MH_DYLIB files
- lt_prog_compiler_pic_F77='-fno-common'
- ;;
-
- interix3*)
- # Interix 3.x gcc -fpic/-fPIC options generate broken code.
- # Instead, we relocate shared libraries at runtime.
- ;;
-
- msdosdjgpp*)
- # Just because we use GCC doesn't mean we suddenly get shared libraries
- # on systems that don't support them.
- lt_prog_compiler_can_build_shared_F77=no
- enable_shared=no
- ;;
-
- sysv4*MP*)
- if test -d /usr/nec; then
- lt_prog_compiler_pic_F77=-Kconform_pic
- fi
- ;;
-
- hpux*)
- # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
- # not for PA HP-UX.
- case $host_cpu in
- hppa*64*|ia64*)
- # +Z the default
- ;;
- *)
- lt_prog_compiler_pic_F77='-fPIC'
- ;;
- esac
- ;;
-
- *)
- lt_prog_compiler_pic_F77='-fPIC'
- ;;
- esac
- else
- # PORTME Check for flag to pass linker flags through the system compiler.
- case $host_os in
- aix*)
- lt_prog_compiler_wl_F77='-Wl,'
- if test "$host_cpu" = ia64; then
- # AIX 5 now supports IA64 processor
- lt_prog_compiler_static_F77='-Bstatic'
- else
- lt_prog_compiler_static_F77='-bnso -bI:/lib/syscalls.exp'
- fi
- ;;
- darwin*)
- # PIC is the default on this platform
- # Common symbols not allowed in MH_DYLIB files
- case $cc_basename in
- xlc*)
- lt_prog_compiler_pic_F77='-qnocommon'
- lt_prog_compiler_wl_F77='-Wl,'
- ;;
- esac
- ;;
-
- mingw* | pw32* | os2*)
- # This hack is so that the source file can tell whether it is being
- # built for inclusion in a dll (and should export symbols for example).
- lt_prog_compiler_pic_F77='-DDLL_EXPORT'
- ;;
-
- hpux9* | hpux10* | hpux11*)
- lt_prog_compiler_wl_F77='-Wl,'
- # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
- # not for PA HP-UX.
- case $host_cpu in
- hppa*64*|ia64*)
- # +Z the default
- ;;
- *)
- lt_prog_compiler_pic_F77='+Z'
- ;;
- esac
- # Is there a better lt_prog_compiler_static that works with the bundled CC?
- lt_prog_compiler_static_F77='${wl}-a ${wl}archive'
- ;;
-
- irix5* | irix6* | nonstopux*)
- lt_prog_compiler_wl_F77='-Wl,'
- # PIC (with -KPIC) is the default.
- lt_prog_compiler_static_F77='-non_shared'
- ;;
-
- newsos6)
- lt_prog_compiler_pic_F77='-KPIC'
- lt_prog_compiler_static_F77='-Bstatic'
- ;;
-
- linux*)
- case $cc_basename in
- icc* | ecc*)
- lt_prog_compiler_wl_F77='-Wl,'
- lt_prog_compiler_pic_F77='-KPIC'
- lt_prog_compiler_static_F77='-static'
- ;;
- pgcc* | pgf77* | pgf90* | pgf95*)
- # Portland Group compilers (*not* the Pentium gcc compiler,
- # which looks to be a dead project)
- lt_prog_compiler_wl_F77='-Wl,'
- lt_prog_compiler_pic_F77='-fpic'
- lt_prog_compiler_static_F77='-Bstatic'
- ;;
- ccc*)
- lt_prog_compiler_wl_F77='-Wl,'
- # All Alpha code is PIC.
- lt_prog_compiler_static_F77='-non_shared'
- ;;
- esac
- ;;
-
- osf3* | osf4* | osf5*)
- lt_prog_compiler_wl_F77='-Wl,'
- # All OSF/1 code is PIC.
- lt_prog_compiler_static_F77='-non_shared'
- ;;
-
- solaris*)
- lt_prog_compiler_pic_F77='-KPIC'
- lt_prog_compiler_static_F77='-Bstatic'
- case $cc_basename in
- f77* | f90* | f95*)
- lt_prog_compiler_wl_F77='-Qoption ld ';;
- *)
- lt_prog_compiler_wl_F77='-Wl,';;
- esac
- ;;
-
- sunos4*)
- lt_prog_compiler_wl_F77='-Qoption ld '
- lt_prog_compiler_pic_F77='-PIC'
- lt_prog_compiler_static_F77='-Bstatic'
- ;;
-
- sysv4 | sysv4.2uw2* | sysv4.3*)
- lt_prog_compiler_wl_F77='-Wl,'
- lt_prog_compiler_pic_F77='-KPIC'
- lt_prog_compiler_static_F77='-Bstatic'
- ;;
-
- sysv4*MP*)
- if test -d /usr/nec ;then
- lt_prog_compiler_pic_F77='-Kconform_pic'
- lt_prog_compiler_static_F77='-Bstatic'
- fi
- ;;
-
- sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
- lt_prog_compiler_wl_F77='-Wl,'
- lt_prog_compiler_pic_F77='-KPIC'
- lt_prog_compiler_static_F77='-Bstatic'
- ;;
-
- unicos*)
- lt_prog_compiler_wl_F77='-Wl,'
- lt_prog_compiler_can_build_shared_F77=no
- ;;
-
- uts4*)
- lt_prog_compiler_pic_F77='-pic'
- lt_prog_compiler_static_F77='-Bstatic'
- ;;
-
- *)
- lt_prog_compiler_can_build_shared_F77=no
- ;;
- esac
- fi
-
-{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_F77" >&5
-echo "${ECHO_T}$lt_prog_compiler_pic_F77" >&6; }
-
-#
-# Check to make sure the PIC flag actually works.
-#
-if test -n "$lt_prog_compiler_pic_F77"; then
-
-{ echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works" >&5
-echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works... $ECHO_C" >&6; }
-if test "${lt_prog_compiler_pic_works_F77+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- lt_prog_compiler_pic_works_F77=no
- ac_outfile=conftest.$ac_objext
- printf "$lt_simple_compile_test_code" > conftest.$ac_ext
- lt_compiler_flag="$lt_prog_compiler_pic_F77"
- # Insert the option either (1) after the last *FLAGS variable, or
- # (2) before a word containing "conftest.", or (3) at the end.
- # Note that $ac_compile itself does not contain backslashes and begins
- # with a dollar sign (not a hyphen), so the echo should work correctly.
- # The option is referenced via a variable to avoid confusing sed.
- lt_compile=`echo "$ac_compile" | $SED \
- -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
- -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
- -e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:21462: $lt_compile\"" >&5)
- (eval "$lt_compile" 2>conftest.err)
- ac_status=$?
- cat conftest.err >&5
- echo "$as_me:21466: \$? = $ac_status" >&5
- if (exit $ac_status) && test -s "$ac_outfile"; then
- # The compiler can only warn and ignore the option if not recognized
- # So say no if there are warnings other than the usual output.
- $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
- $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
- if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
- lt_prog_compiler_pic_works_F77=yes
- fi
- fi
- $rm conftest*
-
-fi
-{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_F77" >&5
-echo "${ECHO_T}$lt_prog_compiler_pic_works_F77" >&6; }
-
-if test x"$lt_prog_compiler_pic_works_F77" = xyes; then
- case $lt_prog_compiler_pic_F77 in
- "" | " "*) ;;
- *) lt_prog_compiler_pic_F77=" $lt_prog_compiler_pic_F77" ;;
- esac
-else
- lt_prog_compiler_pic_F77=
- lt_prog_compiler_can_build_shared_F77=no
-fi
-
-fi
-case $host_os in
- # For platforms which do not support PIC, -DPIC is meaningless:
- *djgpp*)
- lt_prog_compiler_pic_F77=
- ;;
- *)
- lt_prog_compiler_pic_F77="$lt_prog_compiler_pic_F77"
- ;;
-esac
-
-#
-# Check to make sure the static flag actually works.
-#
-wl=$lt_prog_compiler_wl_F77 eval lt_tmp_static_flag=\"$lt_prog_compiler_static_F77\"
-{ echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5
-echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; }
-if test "${lt_prog_compiler_static_works_F77+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- lt_prog_compiler_static_works_F77=no
- save_LDFLAGS="$LDFLAGS"
- LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
- printf "$lt_simple_link_test_code" > conftest.$ac_ext
- if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
- # The linker can only warn and ignore the option if not recognized
- # So say no if there are warnings
- if test -s conftest.err; then
- # Append any errors to the config.log.
- cat conftest.err 1>&5
- $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
- $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
- if diff conftest.exp conftest.er2 >/dev/null; then
- lt_prog_compiler_static_works_F77=yes
- fi
- else
- lt_prog_compiler_static_works_F77=yes
- fi
- fi
- $rm conftest*
- LDFLAGS="$save_LDFLAGS"
-
-fi
-{ echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_F77" >&5
-echo "${ECHO_T}$lt_prog_compiler_static_works_F77" >&6; }
-
-if test x"$lt_prog_compiler_static_works_F77" = xyes; then
- :
-else
- lt_prog_compiler_static_F77=
-fi
-
-
-{ echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
-echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; }
-if test "${lt_cv_prog_compiler_c_o_F77+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- lt_cv_prog_compiler_c_o_F77=no
- $rm -r conftest 2>/dev/null
- mkdir conftest
- cd conftest
- mkdir out
- printf "$lt_simple_compile_test_code" > conftest.$ac_ext
-
- lt_compiler_flag="-o out/conftest2.$ac_objext"
- # Insert the option either (1) after the last *FLAGS variable, or
- # (2) before a word containing "conftest.", or (3) at the end.
- # Note that $ac_compile itself does not contain backslashes and begins
- # with a dollar sign (not a hyphen), so the echo should work correctly.
- lt_compile=`echo "$ac_compile" | $SED \
- -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
- -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
- -e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:21566: $lt_compile\"" >&5)
- (eval "$lt_compile" 2>out/conftest.err)
- ac_status=$?
- cat out/conftest.err >&5
- echo "$as_me:21570: \$? = $ac_status" >&5
- if (exit $ac_status) && test -s out/conftest2.$ac_objext
- then
- # The compiler can only warn and ignore the option if not recognized
- # So say no if there are warnings
- $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
- $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
- if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
- lt_cv_prog_compiler_c_o_F77=yes
- fi
- fi
- chmod u+w . 2>&5
- $rm conftest*
- # SGI C++ compiler will create directory out/ii_files/ for
- # template instantiation
- test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files
- $rm out/* && rmdir out
- cd ..
- rmdir conftest
- $rm conftest*
-
-fi
-{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_F77" >&5
-echo "${ECHO_T}$lt_cv_prog_compiler_c_o_F77" >&6; }
-
-
-hard_links="nottested"
-if test "$lt_cv_prog_compiler_c_o_F77" = no && test "$need_locks" != no; then
- # do not overwrite the value of need_locks provided by the user
- { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
-echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6; }
- hard_links=yes
- $rm conftest*
- ln conftest.a conftest.b 2>/dev/null && hard_links=no
- touch conftest.a
- ln conftest.a conftest.b 2>&5 || hard_links=no
- ln conftest.a conftest.b 2>/dev/null && hard_links=no
- { echo "$as_me:$LINENO: result: $hard_links" >&5
-echo "${ECHO_T}$hard_links" >&6; }
- if test "$hard_links" = no; then
- { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
-echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
- need_locks=warn
- fi
-else
- need_locks=no
-fi
-
-{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
-echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; }
-
- runpath_var=
- allow_undefined_flag_F77=
- enable_shared_with_static_runtimes_F77=no
- archive_cmds_F77=
- archive_expsym_cmds_F77=
- old_archive_From_new_cmds_F77=
- old_archive_from_expsyms_cmds_F77=
- export_dynamic_flag_spec_F77=
- whole_archive_flag_spec_F77=
- thread_safe_flag_spec_F77=
- hardcode_libdir_flag_spec_F77=
- hardcode_libdir_flag_spec_ld_F77=
- hardcode_libdir_separator_F77=
- hardcode_direct_F77=no
- hardcode_minus_L_F77=no
- hardcode_shlibpath_var_F77=unsupported
- link_all_deplibs_F77=unknown
- hardcode_automatic_F77=no
- module_cmds_F77=
- module_expsym_cmds_F77=
- always_export_symbols_F77=no
- export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
- # include_expsyms should be a list of space-separated symbols to be *always*
- # included in the symbol list
- include_expsyms_F77=
- # exclude_expsyms can be an extended regexp of symbols to exclude
- # it will be wrapped by ` (' and `)$', so one must not match beginning or
- # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
- # as well as any symbol that contains `d'.
- exclude_expsyms_F77="_GLOBAL_OFFSET_TABLE_"
- # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
- # platforms (ab)use it in PIC code, but their linkers get confused if
- # the symbol is explicitly referenced. Since portable code cannot
- # rely on this symbol name, it's probably fine to never include it in
- # preloaded symbol tables.
- extract_expsyms_cmds=
- # Just being paranoid about ensuring that cc_basename is set.
- for cc_temp in $compiler""; do
- case $cc_temp in
- compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
- distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
- \-*) ;;
- *) break;;
- esac
-done
-cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
-
- case $host_os in
- cygwin* | mingw* | pw32*)
- # FIXME: the MSVC++ port hasn't been tested in a loooong time
- # When not using gcc, we currently assume that we are using
- # Microsoft Visual C++.
- if test "$GCC" != yes; then
- with_gnu_ld=no
- fi
- ;;
- interix*)
- # we just hope/assume this is gcc and not c89 (= MSVC++)
- with_gnu_ld=yes
- ;;
- openbsd*)
- with_gnu_ld=no
- ;;
- esac
-
- ld_shlibs_F77=yes
- if test "$with_gnu_ld" = yes; then
- # If archive_cmds runs LD, not CC, wlarc should be empty
- wlarc='${wl}'
-
- # Set some defaults for GNU ld with shared library support. These
- # are reset later if shared libraries are not supported. Putting them
- # here allows them to be overridden if necessary.
- runpath_var=LD_RUN_PATH
- hardcode_libdir_flag_spec_F77='${wl}--rpath ${wl}$libdir'
- export_dynamic_flag_spec_F77='${wl}--export-dynamic'
- # ancient GNU ld didn't support --whole-archive et. al.
- if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then
- whole_archive_flag_spec_F77="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
- else
- whole_archive_flag_spec_F77=
- fi
- supports_anon_versioning=no
- case `$LD -v 2>/dev/null` in
- *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
- *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
- *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
- *\ 2.11.*) ;; # other 2.11 versions
- *) supports_anon_versioning=yes ;;
- esac
-
- # See if GNU ld supports shared libraries.
- case $host_os in
- aix3* | aix4* | aix5*)
- # On AIX/PPC, the GNU linker is very broken
- if test "$host_cpu" != ia64; then
- ld_shlibs_F77=no
- cat <<EOF 1>&2
-
-*** Warning: the GNU linker, at least up to release 2.9.1, is reported
-*** to be unable to reliably create shared libraries on AIX.
-*** Therefore, libtool is disabling shared libraries support. If you
-*** really care for shared libraries, you may want to modify your PATH
-*** so that a non-GNU linker is found, and then restart.
-
-EOF
- fi
- ;;
-
- amigaos*)
- archive_cmds_F77='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
- hardcode_libdir_flag_spec_F77='-L$libdir'
- hardcode_minus_L_F77=yes
-
- # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
- # that the semantics of dynamic libraries on AmigaOS, at least up
- # to version 4, is to share data among multiple programs linked
- # with the same dynamic library. Since this doesn't match the
- # behavior of shared libraries on other platforms, we can't use
- # them.
- ld_shlibs_F77=no
- ;;
-
- beos*)
- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- allow_undefined_flag_F77=unsupported
- # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
- # support --undefined. This deserves some investigation. FIXME
- archive_cmds_F77='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- else
- ld_shlibs_F77=no
- fi
- ;;
-
- cygwin* | mingw* | pw32*)
- # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, F77) is actually meaningless,
- # as there is no search path for DLLs.
- hardcode_libdir_flag_spec_F77='-L$libdir'
- allow_undefined_flag_F77=unsupported
- always_export_symbols_F77=no
- enable_shared_with_static_runtimes_F77=yes
- export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
-
- if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
- archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
- # If the export-symbols file already is a .def file (1st line
- # is EXPORTS), use it as is; otherwise, prepend...
- archive_expsym_cmds_F77='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
- cp $export_symbols $output_objdir/$soname.def;
- else
- echo EXPORTS > $output_objdir/$soname.def;
- cat $export_symbols >> $output_objdir/$soname.def;
- fi~
- $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
- else
- ld_shlibs_F77=no
- fi
- ;;
-
- interix3*)
- hardcode_direct_F77=no
- hardcode_shlibpath_var_F77=no
- hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir'
- export_dynamic_flag_spec_F77='${wl}-E'
- # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
- # Instead, shared libraries are loaded at an image base (0x10000000 by
- # default) and relocated if they conflict, which is a slow very memory
- # consuming and fragmenting process. To avoid this, we pick a random,
- # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
- # time. Moving up from 0x10000000 also allows more sbrk(2) space.
- archive_cmds_F77='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
- archive_expsym_cmds_F77='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
- ;;
-
- linux*)
- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- tmp_addflag=
- case $cc_basename,$host_cpu in
- pgcc*) # Portland Group C compiler
- whole_archive_flag_spec_F77='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
- tmp_addflag=' $pic_flag'
- ;;
- pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers
- whole_archive_flag_spec_F77='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
- tmp_addflag=' $pic_flag -Mnomain' ;;
- ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64
- tmp_addflag=' -i_dynamic' ;;
- efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64
- tmp_addflag=' -i_dynamic -nofor_main' ;;
- ifc* | ifort*) # Intel Fortran compiler
- tmp_addflag=' -nofor_main' ;;
- esac
- archive_cmds_F77='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-
- if test $supports_anon_versioning = yes; then
- archive_expsym_cmds_F77='$echo "{ global:" > $output_objdir/$libname.ver~
- cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
- $echo "local: *; };" >> $output_objdir/$libname.ver~
- $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
- fi
- else
- ld_shlibs_F77=no
- fi
- ;;
-
- netbsd*)
- if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
- archive_cmds_F77='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
- wlarc=
- else
- archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
- fi
- ;;
-
- solaris*)
- if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
- ld_shlibs_F77=no
- cat <<EOF 1>&2
-
-*** Warning: The releases 2.8.* of the GNU linker cannot reliably
-*** create shared libraries on Solaris systems. Therefore, libtool
-*** is disabling shared libraries support. We urge you to upgrade GNU
-*** binutils to release 2.9.1 or newer. Another option is to modify
-*** your PATH or compiler configuration so that the native linker is
-*** used, and then restart.
-
-EOF
- elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
- else
- ld_shlibs_F77=no
- fi
- ;;
-
- sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
- case `$LD -v 2>&1` in
- *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
- ld_shlibs_F77=no
- cat <<_LT_EOF 1>&2
-
-*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
-*** reliably create shared libraries on SCO systems. Therefore, libtool
-*** is disabling shared libraries support. We urge you to upgrade GNU
-*** binutils to release 2.16.91.0.3 or newer. Another option is to modify
-*** your PATH or compiler configuration so that the native linker is
-*** used, and then restart.
-
-_LT_EOF
- ;;
- *)
- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- hardcode_libdir_flag_spec_F77='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
- archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib'
- archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib'
- else
- ld_shlibs_F77=no
- fi
- ;;
- esac
- ;;
-
- sunos4*)
- archive_cmds_F77='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
- wlarc=
- hardcode_direct_F77=yes
- hardcode_shlibpath_var_F77=no
- ;;
-
- *)
- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
- else
- ld_shlibs_F77=no
- fi
- ;;
- esac
-
- if test "$ld_shlibs_F77" = no; then
- runpath_var=
- hardcode_libdir_flag_spec_F77=
- export_dynamic_flag_spec_F77=
- whole_archive_flag_spec_F77=
- fi
- else
- # PORTME fill in a description of your system's linker (not GNU ld)
- case $host_os in
- aix3*)
- allow_undefined_flag_F77=unsupported
- always_export_symbols_F77=yes
- archive_expsym_cmds_F77='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
- # Note: this linker hardcodes the directories in LIBPATH if there
- # are no directories specified by -L.
- hardcode_minus_L_F77=yes
- if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
- # Neither direct hardcoding nor static linking is supported with a
- # broken collect2.
- hardcode_direct_F77=unsupported
- fi
- ;;
-
- aix4* | aix5*)
- if test "$host_cpu" = ia64; then
- # On IA64, the linker does run time linking by default, so we don't
- # have to do anything special.
- aix_use_runtimelinking=no
- exp_sym_flag='-Bexport'
- no_entry_flag=""
- else
- # If we're using GNU nm, then we don't want the "-C" option.
- # -C means demangle to AIX nm, but means don't demangle with GNU nm
- if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
- export_symbols_cmds_F77='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
- else
- export_symbols_cmds_F77='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
- fi
- aix_use_runtimelinking=no
-
- # Test if we are trying to use run time linking or normal
- # AIX style linking. If -brtl is somewhere in LDFLAGS, we
- # need to do runtime linking.
- case $host_os in aix4.[23]|aix4.[23].*|aix5*)
- for ld_flag in $LDFLAGS; do
- if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
- aix_use_runtimelinking=yes
- break
- fi
- done
- ;;
- esac
-
- exp_sym_flag='-bexport'
- no_entry_flag='-bnoentry'
- fi
-
- # When large executables or shared objects are built, AIX ld can
- # have problems creating the table of contents. If linking a library
- # or program results in "error TOC overflow" add -mminimal-toc to
- # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
- # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
-
- archive_cmds_F77=''
- hardcode_direct_F77=yes
- hardcode_libdir_separator_F77=':'
- link_all_deplibs_F77=yes
-
- if test "$GCC" = yes; then
- case $host_os in aix4.[012]|aix4.[012].*)
- # We only want to do this on AIX 4.2 and lower, the check
- # below for broken collect2 doesn't work under 4.3+
- collect2name=`${CC} -print-prog-name=collect2`
- if test -f "$collect2name" && \
- strings "$collect2name" | grep resolve_lib_name >/dev/null
- then
- # We have reworked collect2
- hardcode_direct_F77=yes
- else
- # We have old collect2
- hardcode_direct_F77=unsupported
- # It fails to find uninstalled libraries when the uninstalled
- # path is not listed in the libpath. Setting hardcode_minus_L
- # to unsupported forces relinking
- hardcode_minus_L_F77=yes
- hardcode_libdir_flag_spec_F77='-L$libdir'
- hardcode_libdir_separator_F77=
- fi
- ;;
- esac
- shared_flag='-shared'
- if test "$aix_use_runtimelinking" = yes; then
- shared_flag="$shared_flag "'${wl}-G'
- fi
- else
- # not using gcc
- if test "$host_cpu" = ia64; then
- # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
- # chokes on -Wl,-G. The following line is correct:
- shared_flag='-G'
- else
- if test "$aix_use_runtimelinking" = yes; then
- shared_flag='${wl}-G'
- else
- shared_flag='${wl}-bM:SRE'
- fi
- fi
- fi
-
- # It seems that -bexpall does not export symbols beginning with
- # underscore (_), so it is better to generate a list of symbols to export.
- always_export_symbols_F77=yes
- if test "$aix_use_runtimelinking" = yes; then
- # Warning - without using the other runtime loading flags (-brtl),
- # -berok will link without error, but may produce a broken library.
- allow_undefined_flag_F77='-berok'
- # Determine the default libpath from the value encoded in an empty executable.
- cat >conftest.$ac_ext <<_ACEOF
- program main
-
- end
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_f77_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
-
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
-}'`
-# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
-}'`; fi
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
-fi
-
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
-
- hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath"
- archive_expsym_cmds_F77="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
- else
- if test "$host_cpu" = ia64; then
- hardcode_libdir_flag_spec_F77='${wl}-R $libdir:/usr/lib:/lib'
- allow_undefined_flag_F77="-z nodefs"
- archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
- else
- # Determine the default libpath from the value encoded in an empty executable.
- cat >conftest.$ac_ext <<_ACEOF
- program main
-
- end
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_f77_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
-
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
-}'`
-# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
-}'`; fi
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
-fi
-
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
-
- hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath"
- # Warning - without using the other run time loading flags,
- # -berok will link without error, but may produce a broken library.
- no_undefined_flag_F77=' ${wl}-bernotok'
- allow_undefined_flag_F77=' ${wl}-berok'
- # Exported symbols can be pulled into shared objects from archives
- whole_archive_flag_spec_F77='$convenience'
- archive_cmds_need_lc_F77=yes
- # This is similar to how AIX traditionally builds its shared libraries.
- archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
- fi
- fi
- ;;
-
- amigaos*)
- archive_cmds_F77='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
- hardcode_libdir_flag_spec_F77='-L$libdir'
- hardcode_minus_L_F77=yes
- # see comment about different semantics on the GNU ld section
- ld_shlibs_F77=no
- ;;
-
- bsdi[45]*)
- export_dynamic_flag_spec_F77=-rdynamic
- ;;
-
- cygwin* | mingw* | pw32*)
- # When not using gcc, we currently assume that we are using
- # Microsoft Visual C++.
- # hardcode_libdir_flag_spec is actually meaningless, as there is
- # no search path for DLLs.
- hardcode_libdir_flag_spec_F77=' '
- allow_undefined_flag_F77=unsupported
- # Tell ltmain to make .lib files, not .a files.
- libext=lib
- # Tell ltmain to make .dll files, not .so files.
- shrext_cmds=".dll"
- # FIXME: Setting linknames here is a bad hack.
- archive_cmds_F77='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
- # The linker will automatically build a .lib file if we build a DLL.
- old_archive_From_new_cmds_F77='true'
- # FIXME: Should let the user specify the lib program.
- old_archive_cmds_F77='lib /OUT:$oldlib$oldobjs$old_deplibs'
- fix_srcfile_path_F77='`cygpath -w "$srcfile"`'
- enable_shared_with_static_runtimes_F77=yes
- ;;
-
- darwin* | rhapsody*)
- case $host_os in
- rhapsody* | darwin1.[012])
- allow_undefined_flag_F77='${wl}-undefined ${wl}suppress'
- ;;
- *) # Darwin 1.3 on
- if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
- allow_undefined_flag_F77='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
- else
- case ${MACOSX_DEPLOYMENT_TARGET} in
- 10.[012])
- allow_undefined_flag_F77='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
- ;;
- 10.*)
- allow_undefined_flag_F77='${wl}-undefined ${wl}dynamic_lookup'
- ;;
- esac
- fi
- ;;
- esac
- archive_cmds_need_lc_F77=no
- hardcode_direct_F77=no
- hardcode_automatic_F77=yes
- hardcode_shlibpath_var_F77=unsupported
- whole_archive_flag_spec_F77=''
- link_all_deplibs_F77=yes
- if test "$GCC" = yes ; then
- output_verbose_link_cmd='echo'
- archive_cmds_F77='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
- module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
- # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
- archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- else
- case $cc_basename in
- xlc*)
- output_verbose_link_cmd='echo'
- archive_cmds_F77='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
- module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
- # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
- archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- ;;
- *)
- ld_shlibs_F77=no
- ;;
- esac
- fi
- ;;
-
- dgux*)
- archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_libdir_flag_spec_F77='-L$libdir'
- hardcode_shlibpath_var_F77=no
- ;;
-
- freebsd1*)
- ld_shlibs_F77=no
- ;;
-
- # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
- # support. Future versions do this automatically, but an explicit c++rt0.o
- # does not break anything, and helps significantly (at the cost of a little
- # extra space).
- freebsd2.2*)
- archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
- hardcode_libdir_flag_spec_F77='-R$libdir'
- hardcode_direct_F77=yes
- hardcode_shlibpath_var_F77=no
- ;;
-
- # Unfortunately, older versions of FreeBSD 2 do not have this feature.
- freebsd2*)
- archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
- hardcode_direct_F77=yes
- hardcode_minus_L_F77=yes
- hardcode_shlibpath_var_F77=no
- ;;
-
- # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
- freebsd* | kfreebsd*-gnu | dragonfly*)
- archive_cmds_F77='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
- hardcode_libdir_flag_spec_F77='-R$libdir'
- hardcode_direct_F77=yes
- hardcode_shlibpath_var_F77=no
- ;;
-
- hpux9*)
- if test "$GCC" = yes; then
- archive_cmds_F77='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
- else
- archive_cmds_F77='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
- fi
- hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir'
- hardcode_libdir_separator_F77=:
- hardcode_direct_F77=yes
-
- # hardcode_minus_L: Not really in the search PATH,
- # but as the default location of the library.
- hardcode_minus_L_F77=yes
- export_dynamic_flag_spec_F77='${wl}-E'
- ;;
-
- hpux10*)
- if test "$GCC" = yes -a "$with_gnu_ld" = no; then
- archive_cmds_F77='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
- else
- archive_cmds_F77='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
- fi
- if test "$with_gnu_ld" = no; then
- hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir'
- hardcode_libdir_separator_F77=:
-
- hardcode_direct_F77=yes
- export_dynamic_flag_spec_F77='${wl}-E'
-
- # hardcode_minus_L: Not really in the search PATH,
- # but as the default location of the library.
- hardcode_minus_L_F77=yes
- fi
- ;;
-
- hpux11*)
- if test "$GCC" = yes -a "$with_gnu_ld" = no; then
- case $host_cpu in
- hppa*64*)
- archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- ia64*)
- archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- *)
- archive_cmds_F77='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- esac
- else
- case $host_cpu in
- hppa*64*)
- archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- ia64*)
- archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- *)
- archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- esac
- fi
- if test "$with_gnu_ld" = no; then
- hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir'
- hardcode_libdir_separator_F77=:
-
- case $host_cpu in
- hppa*64*|ia64*)
- hardcode_libdir_flag_spec_ld_F77='+b $libdir'
- hardcode_direct_F77=no
- hardcode_shlibpath_var_F77=no
- ;;
- *)
- hardcode_direct_F77=yes
- export_dynamic_flag_spec_F77='${wl}-E'
-
- # hardcode_minus_L: Not really in the search PATH,
- # but as the default location of the library.
- hardcode_minus_L_F77=yes
- ;;
- esac
- fi
- ;;
-
- irix5* | irix6* | nonstopux*)
- if test "$GCC" = yes; then
- archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- else
- archive_cmds_F77='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
- hardcode_libdir_flag_spec_ld_F77='-rpath $libdir'
- fi
- hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
- hardcode_libdir_separator_F77=:
- link_all_deplibs_F77=yes
- ;;
-
- netbsd*)
- if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
- archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
- else
- archive_cmds_F77='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
- fi
- hardcode_libdir_flag_spec_F77='-R$libdir'
- hardcode_direct_F77=yes
- hardcode_shlibpath_var_F77=no
- ;;
-
- newsos6)
- archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_direct_F77=yes
- hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
- hardcode_libdir_separator_F77=:
- hardcode_shlibpath_var_F77=no
- ;;
-
- openbsd*)
- hardcode_direct_F77=yes
- hardcode_shlibpath_var_F77=no
- if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
- archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
- hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir'
- export_dynamic_flag_spec_F77='${wl}-E'
- else
- case $host_os in
- openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
- archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
- hardcode_libdir_flag_spec_F77='-R$libdir'
- ;;
- *)
- archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
- hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir'
- ;;
- esac
- fi
- ;;
-
- os2*)
- hardcode_libdir_flag_spec_F77='-L$libdir'
- hardcode_minus_L_F77=yes
- allow_undefined_flag_F77=unsupported
- archive_cmds_F77='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
- old_archive_From_new_cmds_F77='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
- ;;
-
- osf3*)
- if test "$GCC" = yes; then
- allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*'
- archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- else
- allow_undefined_flag_F77=' -expect_unresolved \*'
- archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
- fi
- hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
- hardcode_libdir_separator_F77=:
- ;;
-
- osf4* | osf5*) # as osf3* with the addition of -msym flag
- if test "$GCC" = yes; then
- allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*'
- archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
- else
- allow_undefined_flag_F77=' -expect_unresolved \*'
- archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
- archive_expsym_cmds_F77='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
- $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp'
-
- # Both c and cxx compiler support -rpath directly
- hardcode_libdir_flag_spec_F77='-rpath $libdir'
- fi
- hardcode_libdir_separator_F77=:
- ;;
-
- solaris*)
- no_undefined_flag_F77=' -z text'
- if test "$GCC" = yes; then
- wlarc='${wl}'
- archive_cmds_F77='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
- $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
- else
- wlarc=''
- archive_cmds_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
- archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
- $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
- fi
- hardcode_libdir_flag_spec_F77='-R$libdir'
- hardcode_shlibpath_var_F77=no
- case $host_os in
- solaris2.[0-5] | solaris2.[0-5].*) ;;
- *)
- # The compiler driver will combine linker options so we
- # cannot just pass the convience library names through
- # without $wl, iff we do not link with $LD.
- # Luckily, gcc supports the same syntax we need for Sun Studio.
- # Supported since Solaris 2.6 (maybe 2.5.1?)
- case $wlarc in
- '')
- whole_archive_flag_spec_F77='-z allextract$convenience -z defaultextract' ;;
- *)
- whole_archive_flag_spec_F77='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;;
- esac ;;
- esac
- link_all_deplibs_F77=yes
- ;;
-
- sunos4*)
- if test "x$host_vendor" = xsequent; then
- # Use $CC to link under sequent, because it throws in some extra .o
- # files that make .init and .fini sections work.
- archive_cmds_F77='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
- else
- archive_cmds_F77='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
- fi
- hardcode_libdir_flag_spec_F77='-L$libdir'
- hardcode_direct_F77=yes
- hardcode_minus_L_F77=yes
- hardcode_shlibpath_var_F77=no
- ;;
-
- sysv4)
- case $host_vendor in
- sni)
- archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_direct_F77=yes # is this really true???
- ;;
- siemens)
- ## LD is ld it makes a PLAMLIB
- ## CC just makes a GrossModule.
- archive_cmds_F77='$LD -G -o $lib $libobjs $deplibs $linker_flags'
- reload_cmds_F77='$CC -r -o $output$reload_objs'
- hardcode_direct_F77=no
- ;;
- motorola)
- archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_direct_F77=no #Motorola manual says yes, but my tests say they lie
- ;;
- esac
- runpath_var='LD_RUN_PATH'
- hardcode_shlibpath_var_F77=no
- ;;
-
- sysv4.3*)
- archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_shlibpath_var_F77=no
- export_dynamic_flag_spec_F77='-Bexport'
- ;;
-
- sysv4*MP*)
- if test -d /usr/nec; then
- archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_shlibpath_var_F77=no
- runpath_var=LD_RUN_PATH
- hardcode_runpath_var=yes
- ld_shlibs_F77=yes
- fi
- ;;
-
- sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*)
- no_undefined_flag_F77='${wl}-z,text'
- archive_cmds_need_lc_F77=no
- hardcode_shlibpath_var_F77=no
- runpath_var='LD_RUN_PATH'
-
- if test "$GCC" = yes; then
- archive_cmds_F77='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds_F77='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- else
- archive_cmds_F77='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds_F77='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- fi
- ;;
-
- sysv5* | sco3.2v5* | sco5v6*)
- # Note: We can NOT use -z defs as we might desire, because we do not
- # link with -lc, and that would cause any symbols used from libc to
- # always be unresolved, which means just about no library would
- # ever link correctly. If we're not using GNU ld we use -z text
- # though, which does catch some bad symbols but isn't as heavy-handed
- # as -z defs.
- no_undefined_flag_F77='${wl}-z,text'
- allow_undefined_flag_F77='${wl}-z,nodefs'
- archive_cmds_need_lc_F77=no
- hardcode_shlibpath_var_F77=no
- hardcode_libdir_flag_spec_F77='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
- hardcode_libdir_separator_F77=':'
- link_all_deplibs_F77=yes
- export_dynamic_flag_spec_F77='${wl}-Bexport'
- runpath_var='LD_RUN_PATH'
-
- if test "$GCC" = yes; then
- archive_cmds_F77='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds_F77='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- else
- archive_cmds_F77='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds_F77='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- fi
- ;;
-
- uts4*)
- archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_libdir_flag_spec_F77='-L$libdir'
- hardcode_shlibpath_var_F77=no
- ;;
-
- *)
- ld_shlibs_F77=no
- ;;
- esac
- fi
-
-{ echo "$as_me:$LINENO: result: $ld_shlibs_F77" >&5
-echo "${ECHO_T}$ld_shlibs_F77" >&6; }
-test "$ld_shlibs_F77" = no && can_build_shared=no
-
-#
-# Do we need to explicitly link libc?
-#
-case "x$archive_cmds_need_lc_F77" in
-x|xyes)
- # Assume -lc should be added
- archive_cmds_need_lc_F77=yes
-
- if test "$enable_shared" = yes && test "$GCC" = yes; then
- case $archive_cmds_F77 in
- *'~'*)
- # FIXME: we may have to deal with multi-command sequences.
- ;;
- '$CC '*)
- # Test whether the compiler implicitly links with -lc since on some
- # systems, -lgcc has to come before -lc. If gcc already passes -lc
- # to ld, don't add -lc before -lgcc.
- { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
-echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; }
- $rm conftest*
- printf "$lt_simple_compile_test_code" > conftest.$ac_ext
-
- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } 2>conftest.err; then
- soname=conftest
- lib=conftest
- libobjs=conftest.$ac_objext
- deplibs=
- wl=$lt_prog_compiler_wl_F77
- pic_flag=$lt_prog_compiler_pic_F77
- compiler_flags=-v
- linker_flags=-v
- verstring=
- output_objdir=.
- libname=conftest
- lt_save_allow_undefined_flag=$allow_undefined_flag_F77
- allow_undefined_flag_F77=
- if { (eval echo "$as_me:$LINENO: \"$archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5
- (eval $archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }
- then
- archive_cmds_need_lc_F77=no
- else
- archive_cmds_need_lc_F77=yes
- fi
- allow_undefined_flag_F77=$lt_save_allow_undefined_flag
- else
- cat conftest.err 1>&5
- fi
- $rm conftest*
- { echo "$as_me:$LINENO: result: $archive_cmds_need_lc_F77" >&5
-echo "${ECHO_T}$archive_cmds_need_lc_F77" >&6; }
- ;;
- esac
- fi
- ;;
-esac
-
-{ echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
-echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; }
-library_names_spec=
-libname_spec='lib$name'
-soname_spec=
-shrext_cmds=".so"
-postinstall_cmds=
-postuninstall_cmds=
-finish_cmds=
-finish_eval=
-shlibpath_var=
-shlibpath_overrides_runpath=unknown
-version_type=none
-dynamic_linker="$host_os ld.so"
-sys_lib_dlsearch_path_spec="/lib /usr/lib"
-if test "$GCC" = yes; then
- sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
- if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then
- # if the path contains ";" then we assume it to be the separator
- # otherwise default to the standard path separator (i.e. ":") - it is
- # assumed that no part of a normal pathname contains ";" but that should
- # okay in the real world where ";" in dirpaths is itself problematic.
- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
- else
- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
- fi
-else
- sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
-fi
-need_lib_prefix=unknown
-hardcode_into_libs=no
-
-# when you set need_version to no, make sure it does not cause -set_version
-# flags to be left without arguments
-need_version=unknown
-
-case $host_os in
-aix3*)
- version_type=linux
- library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
- shlibpath_var=LIBPATH
-
- # AIX 3 has no versioning support, so we append a major version to the name.
- soname_spec='${libname}${release}${shared_ext}$major'
- ;;
-
-aix4* | aix5*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- hardcode_into_libs=yes
- if test "$host_cpu" = ia64; then
- # AIX 5 supports IA64
- library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
- shlibpath_var=LD_LIBRARY_PATH
- else
- # With GCC up to 2.95.x, collect2 would create an import file
- # for dependence libraries. The import file would start with
- # the line `#! .'. This would cause the generated library to
- # depend on `.', always an invalid library. This was fixed in
- # development snapshots of GCC prior to 3.0.
- case $host_os in
- aix4 | aix4.[01] | aix4.[01].*)
- if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
- echo ' yes '
- echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
- :
- else
- can_build_shared=no
- fi
- ;;
- esac
- # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
- # soname into executable. Probably we can add versioning support to
- # collect2, so additional links can be useful in future.
- if test "$aix_use_runtimelinking" = yes; then
- # If using run time linking (on AIX 4.2 or later) use lib<name>.so
- # instead of lib<name>.a to let people know that these are not
- # typical AIX shared libraries.
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- else
- # We preserve .a as extension for shared libraries through AIX4.2
- # and later when we are not doing run time linking.
- library_names_spec='${libname}${release}.a $libname.a'
- soname_spec='${libname}${release}${shared_ext}$major'
- fi
- shlibpath_var=LIBPATH
- fi
- ;;
-
-amigaos*)
- library_names_spec='$libname.ixlibrary $libname.a'
- # Create ${libname}_ixlibrary.a entries in /sys/libs.
- finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
- ;;
-
-beos*)
- library_names_spec='${libname}${shared_ext}'
- dynamic_linker="$host_os ld.so"
- shlibpath_var=LIBRARY_PATH
- ;;
-
-bsdi[45]*)
- version_type=linux
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
- sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
- # the default ld.so.conf also contains /usr/contrib/lib and
- # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
- # libtool to hard-code these into programs
- ;;
-
-cygwin* | mingw* | pw32*)
- version_type=windows
- shrext_cmds=".dll"
- need_version=no
- need_lib_prefix=no
-
- case $GCC,$host_os in
- yes,cygwin* | yes,mingw* | yes,pw32*)
- library_names_spec='$libname.dll.a'
- # DLL is installed to $(libdir)/../bin by postinstall_cmds
- postinstall_cmds='base_file=`basename \${file}`~
- dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
- dldir=$destdir/`dirname \$dlpath`~
- test -d \$dldir || mkdir -p \$dldir~
- $install_prog $dir/$dlname \$dldir/$dlname~
- chmod a+x \$dldir/$dlname'
- postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
- dlpath=$dir/\$dldll~
- $rm \$dlpath'
- shlibpath_overrides_runpath=yes
-
- case $host_os in
- cygwin*)
- # Cygwin DLLs use 'cyg' prefix rather than 'lib'
- soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
- sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
- ;;
- mingw*)
- # MinGW DLLs use traditional 'lib' prefix
- soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
- sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
- if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then
- # It is most probably a Windows format PATH printed by
- # mingw gcc, but we are running on Cygwin. Gcc prints its search
- # path with ; separators, and with drive letters. We can handle the
- # drive letters (cygwin fileutils understands them), so leave them,
- # especially as we might pass files found there to a mingw objdump,
- # which wouldn't understand a cygwinified path. Ahh.
- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
- else
- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
- fi
- ;;
- pw32*)
- # pw32 DLLs use 'pw' prefix rather than 'lib'
- library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
- ;;
- esac
- ;;
-
- *)
- library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
- ;;
- esac
- dynamic_linker='Win32 ld.exe'
- # FIXME: first we should search . and the directory the executable is in
- shlibpath_var=PATH
- ;;
-
-darwin* | rhapsody*)
- dynamic_linker="$host_os dyld"
- version_type=darwin
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
- soname_spec='${libname}${release}${major}$shared_ext'
- shlibpath_overrides_runpath=yes
- shlibpath_var=DYLD_LIBRARY_PATH
- shrext_cmds='.dylib'
- # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
- if test "$GCC" = yes; then
- sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
- else
- sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
- fi
- sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
- ;;
-
-dgux*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- ;;
-
-freebsd1*)
- dynamic_linker=no
- ;;
-
-kfreebsd*-gnu)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- dynamic_linker='GNU ld.so'
- ;;
-
-freebsd* | dragonfly*)
- # DragonFly does not have aout. When/if they implement a new
- # versioning mechanism, adjust this.
- if test -x /usr/bin/objformat; then
- objformat=`/usr/bin/objformat`
- else
- case $host_os in
- freebsd[123]*) objformat=aout ;;
- *) objformat=elf ;;
- esac
- fi
- version_type=freebsd-$objformat
- case $version_type in
- freebsd-elf*)
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
- need_version=no
- need_lib_prefix=no
- ;;
- freebsd-*)
- library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
- need_version=yes
- ;;
- esac
- shlibpath_var=LD_LIBRARY_PATH
- case $host_os in
- freebsd2*)
- shlibpath_overrides_runpath=yes
- ;;
- freebsd3.[01]* | freebsdelf3.[01]*)
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- ;;
- freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
- freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- ;;
- freebsd*) # from 4.6 on
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- ;;
- esac
- ;;
-
-gnu*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- hardcode_into_libs=yes
- ;;
-
-hpux9* | hpux10* | hpux11*)
- # Give a soname corresponding to the major version so that dld.sl refuses to
- # link against other versions.
- version_type=sunos
- need_lib_prefix=no
- need_version=no
- case $host_cpu in
- ia64*)
- shrext_cmds='.so'
- hardcode_into_libs=yes
- dynamic_linker="$host_os dld.so"
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- if test "X$HPUX_IA64_MODE" = X32; then
- sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
- else
- sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
- fi
- sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
- ;;
- hppa*64*)
- shrext_cmds='.sl'
- hardcode_into_libs=yes
- dynamic_linker="$host_os dld.sl"
- shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
- shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
- sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
- ;;
- *)
- shrext_cmds='.sl'
- dynamic_linker="$host_os dld.sl"
- shlibpath_var=SHLIB_PATH
- shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- ;;
- esac
- # HP-UX runs *really* slowly unless shared libraries are mode 555.
- postinstall_cmds='chmod 555 $lib'
- ;;
-
-interix3*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- ;;
-
-irix5* | irix6* | nonstopux*)
- case $host_os in
- nonstopux*) version_type=nonstopux ;;
- *)
- if test "$lt_cv_prog_gnu_ld" = yes; then
- version_type=linux
- else
- version_type=irix
- fi ;;
- esac
- need_lib_prefix=no
- need_version=no
- soname_spec='${libname}${release}${shared_ext}$major'
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
- case $host_os in
- irix5* | nonstopux*)
- libsuff= shlibsuff=
- ;;
- *)
- case $LD in # libtool.m4 will add one of these switches to LD
- *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
- libsuff= shlibsuff= libmagic=32-bit;;
- *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
- libsuff=32 shlibsuff=N32 libmagic=N32;;
- *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
- libsuff=64 shlibsuff=64 libmagic=64-bit;;
- *) libsuff= shlibsuff= libmagic=never-match;;
- esac
- ;;
- esac
- shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
- shlibpath_overrides_runpath=no
- sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
- sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
- hardcode_into_libs=yes
- ;;
-
-# No shared lib support for Linux oldld, aout, or coff.
-linux*oldld* | linux*aout* | linux*coff*)
- dynamic_linker=no
- ;;
-
-# This must be Linux ELF.
-linux*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- # This implies no fast_install, which is unacceptable.
- # Some rework will be needed to allow for fast_install
- # before this can be enabled.
- hardcode_into_libs=yes
-
- # Append ld.so.conf contents to the search path
- if test -f /etc/ld.so.conf; then
- lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
- sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
- fi
-
- # We used to test for /lib/ld.so.1 and disable shared libraries on
- # powerpc, because MkLinux only supported shared libraries with the
- # GNU dynamic linker. Since this was broken with cross compilers,
- # most powerpc-linux boxes support dynamic linking these days and
- # people can always --disable-shared, the test was removed, and we
- # assume the GNU/Linux dynamic linker is in use.
- dynamic_linker='GNU/Linux ld.so'
- ;;
-
-knetbsd*-gnu)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- dynamic_linker='GNU ld.so'
- ;;
-
-netbsd*)
- version_type=sunos
- need_lib_prefix=no
- need_version=no
- if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
- dynamic_linker='NetBSD (a.out) ld.so'
- else
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- dynamic_linker='NetBSD ld.elf_so'
- fi
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- ;;
-
-newsos6)
- version_type=linux
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- ;;
-
-nto-qnx*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- ;;
-
-openbsd*)
- version_type=sunos
- sys_lib_dlsearch_path_spec="/usr/lib"
- need_lib_prefix=no
- # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
- case $host_os in
- openbsd3.3 | openbsd3.3.*) need_version=yes ;;
- *) need_version=no ;;
- esac
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
- case $host_os in
- openbsd2.[89] | openbsd2.[89].*)
- shlibpath_overrides_runpath=no
- ;;
- *)
- shlibpath_overrides_runpath=yes
- ;;
- esac
- else
- shlibpath_overrides_runpath=yes
- fi
- ;;
-
-os2*)
- libname_spec='$name'
- shrext_cmds=".dll"
- need_lib_prefix=no
- library_names_spec='$libname${shared_ext} $libname.a'
- dynamic_linker='OS/2 ld.exe'
- shlibpath_var=LIBPATH
- ;;
-
-osf3* | osf4* | osf5*)
- version_type=osf
- need_lib_prefix=no
- need_version=no
- soname_spec='${libname}${release}${shared_ext}$major'
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- shlibpath_var=LD_LIBRARY_PATH
- sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
- sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
- ;;
-
-solaris*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- # ldd complains unless libraries are executable
- postinstall_cmds='chmod +x $lib'
- ;;
-
-sunos4*)
- version_type=sunos
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
- finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- if test "$with_gnu_ld" = yes; then
- need_lib_prefix=no
- fi
- need_version=yes
- ;;
-
-sysv4 | sysv4.3*)
- version_type=linux
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- case $host_vendor in
- sni)
- shlibpath_overrides_runpath=no
- need_lib_prefix=no
- export_dynamic_flag_spec='${wl}-Blargedynsym'
- runpath_var=LD_RUN_PATH
- ;;
- siemens)
- need_lib_prefix=no
- ;;
- motorola)
- need_lib_prefix=no
- need_version=no
- shlibpath_overrides_runpath=no
- sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
- ;;
- esac
- ;;
-
-sysv4*MP*)
- if test -d /usr/nec ;then
- version_type=linux
- library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
- soname_spec='$libname${shared_ext}.$major'
- shlibpath_var=LD_LIBRARY_PATH
- fi
- ;;
-
-sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
- version_type=freebsd-elf
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- hardcode_into_libs=yes
- if test "$with_gnu_ld" = yes; then
- sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
- shlibpath_overrides_runpath=no
- else
- sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
- shlibpath_overrides_runpath=yes
- case $host_os in
- sco3.2v5*)
- sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
- ;;
- esac
- fi
- sys_lib_dlsearch_path_spec='/usr/lib'
- ;;
-
-uts4*)
- version_type=linux
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- ;;
-
-*)
- dynamic_linker=no
- ;;
-esac
-{ echo "$as_me:$LINENO: result: $dynamic_linker" >&5
-echo "${ECHO_T}$dynamic_linker" >&6; }
-test "$dynamic_linker" = no && can_build_shared=no
-
-variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
-if test "$GCC" = yes; then
- variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
-fi
-
-{ echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
-echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; }
-hardcode_action_F77=
-if test -n "$hardcode_libdir_flag_spec_F77" || \
- test -n "$runpath_var_F77" || \
- test "X$hardcode_automatic_F77" = "Xyes" ; then
-
- # We can hardcode non-existant directories.
- if test "$hardcode_direct_F77" != no &&
- # If the only mechanism to avoid hardcoding is shlibpath_var, we
- # have to relink, otherwise we might link with an installed library
- # when we should be linking with a yet-to-be-installed one
- ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, F77)" != no &&
- test "$hardcode_minus_L_F77" != no; then
- # Linking always hardcodes the temporary library directory.
- hardcode_action_F77=relink
- else
- # We can link without hardcoding, and we can hardcode nonexisting dirs.
- hardcode_action_F77=immediate
- fi
-else
- # We cannot hardcode anything, or else we can only hardcode existing
- # directories.
- hardcode_action_F77=unsupported
-fi
-{ echo "$as_me:$LINENO: result: $hardcode_action_F77" >&5
-echo "${ECHO_T}$hardcode_action_F77" >&6; }
-
-if test "$hardcode_action_F77" = relink; then
- # Fast installation is not supported
- enable_fast_install=no
-elif test "$shlibpath_overrides_runpath" = yes ||
- test "$enable_shared" = no; then
- # Fast installation is not necessary
- enable_fast_install=needless
-fi
-
-
-# The else clause should only fire when bootstrapping the
-# libtool distribution, otherwise you forgot to ship ltmain.sh
-# with your package, and you will get complaints that there are
-# no rules to generate ltmain.sh.
-if test -f "$ltmain"; then
- # See if we are running on zsh, and set the options which allow our commands through
- # without removal of \ escapes.
- if test -n "${ZSH_VERSION+set}" ; then
- setopt NO_GLOB_SUBST
- fi
- # Now quote all the things that may contain metacharacters while being
- # careful not to overquote the AC_SUBSTed values. We take copies of the
- # variables and quote the copies for generation of the libtool script.
- for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \
- SED SHELL STRIP \
- libname_spec library_names_spec soname_spec extract_expsyms_cmds \
- old_striplib striplib file_magic_cmd finish_cmds finish_eval \
- deplibs_check_method reload_flag reload_cmds need_locks \
- lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
- lt_cv_sys_global_symbol_to_c_name_address \
- sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
- old_postinstall_cmds old_postuninstall_cmds \
- compiler_F77 \
- CC_F77 \
- LD_F77 \
- lt_prog_compiler_wl_F77 \
- lt_prog_compiler_pic_F77 \
- lt_prog_compiler_static_F77 \
- lt_prog_compiler_no_builtin_flag_F77 \
- export_dynamic_flag_spec_F77 \
- thread_safe_flag_spec_F77 \
- whole_archive_flag_spec_F77 \
- enable_shared_with_static_runtimes_F77 \
- old_archive_cmds_F77 \
- old_archive_from_new_cmds_F77 \
- predep_objects_F77 \
- postdep_objects_F77 \
- predeps_F77 \
- postdeps_F77 \
- compiler_lib_search_path_F77 \
- archive_cmds_F77 \
- archive_expsym_cmds_F77 \
- postinstall_cmds_F77 \
- postuninstall_cmds_F77 \
- old_archive_from_expsyms_cmds_F77 \
- allow_undefined_flag_F77 \
- no_undefined_flag_F77 \
- export_symbols_cmds_F77 \
- hardcode_libdir_flag_spec_F77 \
- hardcode_libdir_flag_spec_ld_F77 \
- hardcode_libdir_separator_F77 \
- hardcode_automatic_F77 \
- module_cmds_F77 \
- module_expsym_cmds_F77 \
- lt_cv_prog_compiler_c_o_F77 \
- exclude_expsyms_F77 \
- include_expsyms_F77; do
-
- case $var in
- old_archive_cmds_F77 | \
- old_archive_from_new_cmds_F77 | \
- archive_cmds_F77 | \
- archive_expsym_cmds_F77 | \
- module_cmds_F77 | \
- module_expsym_cmds_F77 | \
- old_archive_from_expsyms_cmds_F77 | \
- export_symbols_cmds_F77 | \
- extract_expsyms_cmds | reload_cmds | finish_cmds | \
- postinstall_cmds | postuninstall_cmds | \
- old_postinstall_cmds | old_postuninstall_cmds | \
- sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
- # Double-quote double-evaled strings.
- eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
- ;;
- *)
- eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
- ;;
- esac
- done
-
- case $lt_echo in
- *'\$0 --fallback-echo"')
- lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
- ;;
- esac
-
-cfgfile="$ofile"
-
- cat <<__EOF__ >> "$cfgfile"
-# ### BEGIN LIBTOOL TAG CONFIG: $tagname
-
-# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
-
-# Shell to use when invoking shell scripts.
-SHELL=$lt_SHELL
-
-# Whether or not to build shared libraries.
-build_libtool_libs=$enable_shared
-
-# Whether or not to build static libraries.
-build_old_libs=$enable_static
-
-# Whether or not to add -lc for building shared libraries.
-build_libtool_need_lc=$archive_cmds_need_lc_F77
-
-# Whether or not to disallow shared libs when runtime libs are static
-allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_F77
-
-# Whether or not to optimize for fast installation.
-fast_install=$enable_fast_install
-
-# The host system.
-host_alias=$host_alias
-host=$host
-host_os=$host_os
-
-# The build system.
-build_alias=$build_alias
-build=$build
-build_os=$build_os
-
-# An echo program that does not interpret backslashes.
-echo=$lt_echo
-
-# The archiver.
-AR=$lt_AR
-AR_FLAGS=$lt_AR_FLAGS
-
-# A C compiler.
-LTCC=$lt_LTCC
-
-# LTCC compiler flags.
-LTCFLAGS=$lt_LTCFLAGS
-
-# A language-specific compiler.
-CC=$lt_compiler_F77
-
-# Is the compiler the GNU C compiler?
-with_gcc=$GCC_F77
-
-# An ERE matcher.
-EGREP=$lt_EGREP
-
-# The linker used to build libraries.
-LD=$lt_LD_F77
-
-# Whether we need hard or soft links.
-LN_S=$lt_LN_S
-
-# A BSD-compatible nm program.
-NM=$lt_NM
-
-# A symbol stripping program
-STRIP=$lt_STRIP
-
-# Used to examine libraries when file_magic_cmd begins "file"
-MAGIC_CMD=$MAGIC_CMD
-
-# Used on cygwin: DLL creation program.
-DLLTOOL="$DLLTOOL"
-
-# Used on cygwin: object dumper.
-OBJDUMP="$OBJDUMP"
-
-# Used on cygwin: assembler.
-AS="$AS"
-
-# The name of the directory that contains temporary libtool files.
-objdir=$objdir
-
-# How to create reloadable object files.
-reload_flag=$lt_reload_flag
-reload_cmds=$lt_reload_cmds
-
-# How to pass a linker flag through the compiler.
-wl=$lt_lt_prog_compiler_wl_F77
-
-# Object file suffix (normally "o").
-objext="$ac_objext"
-
-# Old archive suffix (normally "a").
-libext="$libext"
-
-# Shared library suffix (normally ".so").
-shrext_cmds='$shrext_cmds'
-
-# Executable file suffix (normally "").
-exeext="$exeext"
-
-# Additional compiler flags for building library objects.
-pic_flag=$lt_lt_prog_compiler_pic_F77
-pic_mode=$pic_mode
-
-# What is the maximum length of a command?
-max_cmd_len=$lt_cv_sys_max_cmd_len
-
-# Does compiler simultaneously support -c and -o options?
-compiler_c_o=$lt_lt_cv_prog_compiler_c_o_F77
-
-# Must we lock files when doing compilation?
-need_locks=$lt_need_locks
-
-# Do we need the lib prefix for modules?
-need_lib_prefix=$need_lib_prefix
-
-# Do we need a version for libraries?
-need_version=$need_version
-
-# Whether dlopen is supported.
-dlopen_support=$enable_dlopen
-
-# Whether dlopen of programs is supported.
-dlopen_self=$enable_dlopen_self
-
-# Whether dlopen of statically linked programs is supported.
-dlopen_self_static=$enable_dlopen_self_static
-
-# Compiler flag to prevent dynamic linking.
-link_static_flag=$lt_lt_prog_compiler_static_F77
-
-# Compiler flag to turn off builtin functions.
-no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_F77
-
-# Compiler flag to allow reflexive dlopens.
-export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_F77
-
-# Compiler flag to generate shared objects directly from archives.
-whole_archive_flag_spec=$lt_whole_archive_flag_spec_F77
-
-# Compiler flag to generate thread-safe objects.
-thread_safe_flag_spec=$lt_thread_safe_flag_spec_F77
-
-# Library versioning type.
-version_type=$version_type
-
-# Format of library name prefix.
-libname_spec=$lt_libname_spec
-
-# List of archive names. First name is the real one, the rest are links.
-# The last name is the one that the linker finds with -lNAME.
-library_names_spec=$lt_library_names_spec
-
-# The coded name of the library, if different from the real name.
-soname_spec=$lt_soname_spec
-
-# Commands used to build and install an old-style archive.
-RANLIB=$lt_RANLIB
-old_archive_cmds=$lt_old_archive_cmds_F77
-old_postinstall_cmds=$lt_old_postinstall_cmds
-old_postuninstall_cmds=$lt_old_postuninstall_cmds
-
-# Create an old-style archive from a shared archive.
-old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_F77
-
-# Create a temporary old-style archive to link instead of a shared archive.
-old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_F77
-
-# Commands used to build and install a shared archive.
-archive_cmds=$lt_archive_cmds_F77
-archive_expsym_cmds=$lt_archive_expsym_cmds_F77
-postinstall_cmds=$lt_postinstall_cmds
-postuninstall_cmds=$lt_postuninstall_cmds
-
-# Commands used to build a loadable module (assumed same as above if empty)
-module_cmds=$lt_module_cmds_F77
-module_expsym_cmds=$lt_module_expsym_cmds_F77
-
-# Commands to strip libraries.
-old_striplib=$lt_old_striplib
-striplib=$lt_striplib
-
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predep_objects=$lt_predep_objects_F77
-
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdep_objects=$lt_postdep_objects_F77
-
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predeps=$lt_predeps_F77
-
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdeps=$lt_postdeps_F77
-
-# The library search path used internally by the compiler when linking
-# a shared library.
-compiler_lib_search_path=$lt_compiler_lib_search_path_F77
-
-# Method to check whether dependent libraries are shared objects.
-deplibs_check_method=$lt_deplibs_check_method
-
-# Command to use when deplibs_check_method == file_magic.
-file_magic_cmd=$lt_file_magic_cmd
-
-# Flag that allows shared libraries with undefined symbols to be built.
-allow_undefined_flag=$lt_allow_undefined_flag_F77
-
-# Flag that forces no undefined symbols.
-no_undefined_flag=$lt_no_undefined_flag_F77
-
-# Commands used to finish a libtool library installation in a directory.
-finish_cmds=$lt_finish_cmds
-
-# Same as above, but a single script fragment to be evaled but not shown.
-finish_eval=$lt_finish_eval
-
-# Take the output of nm and produce a listing of raw symbols and C names.
-global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
-
-# Transform the output of nm in a proper C declaration
-global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
-
-# Transform the output of nm in a C name address pair
-global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
-
-# This is the shared library runtime path variable.
-runpath_var=$runpath_var
-
-# This is the shared library path variable.
-shlibpath_var=$shlibpath_var
-
-# Is shlibpath searched before the hard-coded library search path?
-shlibpath_overrides_runpath=$shlibpath_overrides_runpath
-
-# How to hardcode a shared library path into an executable.
-hardcode_action=$hardcode_action_F77
-
-# Whether we should hardcode library paths into libraries.
-hardcode_into_libs=$hardcode_into_libs
-
-# Flag to hardcode \$libdir into a binary during linking.
-# This must work even if \$libdir does not exist.
-hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_F77
-
-# If ld is used when linking, flag to hardcode \$libdir into
-# a binary during linking. This must work even if \$libdir does
-# not exist.
-hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_F77
-
-# Whether we need a single -rpath flag with a separated argument.
-hardcode_libdir_separator=$lt_hardcode_libdir_separator_F77
-
-# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
-# resulting binary.
-hardcode_direct=$hardcode_direct_F77
-
-# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
-# resulting binary.
-hardcode_minus_L=$hardcode_minus_L_F77
-
-# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
-# the resulting binary.
-hardcode_shlibpath_var=$hardcode_shlibpath_var_F77
-
-# Set to yes if building a shared library automatically hardcodes DIR into the library
-# and all subsequent libraries and executables linked against it.
-hardcode_automatic=$hardcode_automatic_F77
-
-# Variables whose values should be saved in libtool wrapper scripts and
-# restored at relink time.
-variables_saved_for_relink="$variables_saved_for_relink"
-
-# Whether libtool must link a program against all its dependency libraries.
-link_all_deplibs=$link_all_deplibs_F77
-
-# Compile-time system search path for libraries
-sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
-
-# Run-time system search path for libraries
-sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
-
-# Fix the shell variable \$srcfile for the compiler.
-fix_srcfile_path="$fix_srcfile_path_F77"
-
-# Set to yes if exported symbols are required.
-always_export_symbols=$always_export_symbols_F77
-
-# The commands to list exported symbols.
-export_symbols_cmds=$lt_export_symbols_cmds_F77
-
-# The commands to extract the exported symbol list from a shared archive.
-extract_expsyms_cmds=$lt_extract_expsyms_cmds
-
-# Symbols that should not be listed in the preloaded symbols.
-exclude_expsyms=$lt_exclude_expsyms_F77
-
-# Symbols that must always be exported.
-include_expsyms=$lt_include_expsyms_F77
-
-# ### END LIBTOOL TAG CONFIG: $tagname
-
-__EOF__
-
-
-else
- # If there is no Makefile yet, we rely on a make rule to execute
- # `config.status --recheck' to rerun these tests and create the
- # libtool script then.
- ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
- if test -f "$ltmain_in"; then
- test -f Makefile && make "$ltmain"
- fi
-fi
-
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-CC="$lt_save_CC"
-
- else
- tagname=""
- fi
- ;;
-
- GCJ)
- if test -n "$GCJ" && test "X$GCJ" != "Xno"; then
- ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
-# Source file extension for Java test sources.
-ac_ext=java
-
-# Object file extension for compiled Java test sources.
-objext=o
-objext_GCJ=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code="class foo {}\n"
-
-# Code to be used in simple link tests
-lt_simple_link_test_code='public class conftest { public static void main(String[] argv) {}; }\n'
-
-# ltmain only uses $CC for tagged configurations so make sure $CC is set.
-
-# If no C compiler was specified, use CC.
-LTCC=${LTCC-"$CC"}
-
-# If no C compiler flags were specified, use CFLAGS.
-LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
-
-# Allow CC to be a program name with arguments.
-compiler=$CC
-
-
-# save warnings/boilerplate of simple test code
-ac_outfile=conftest.$ac_objext
-printf "$lt_simple_compile_test_code" >conftest.$ac_ext
-eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_compiler_boilerplate=`cat conftest.err`
-$rm conftest*
-
-ac_outfile=conftest.$ac_objext
-printf "$lt_simple_link_test_code" >conftest.$ac_ext
-eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_linker_boilerplate=`cat conftest.err`
-$rm conftest*
-
-
-# Allow CC to be a program name with arguments.
-lt_save_CC="$CC"
-CC=${GCJ-"gcj"}
-compiler=$CC
-compiler_GCJ=$CC
-for cc_temp in $compiler""; do
- case $cc_temp in
- compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
- distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
- \-*) ;;
- *) break;;
- esac
-done
-cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
-
-
-# GCJ did not exist at the time GCC didn't implicitly link libc in.
-archive_cmds_need_lc_GCJ=no
-
-old_archive_cmds_GCJ=$old_archive_cmds
-
-
-lt_prog_compiler_no_builtin_flag_GCJ=
-
-if test "$GCC" = yes; then
- lt_prog_compiler_no_builtin_flag_GCJ=' -fno-builtin'
-
-
-{ echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
-echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6; }
-if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- lt_cv_prog_compiler_rtti_exceptions=no
- ac_outfile=conftest.$ac_objext
- printf "$lt_simple_compile_test_code" > conftest.$ac_ext
- lt_compiler_flag="-fno-rtti -fno-exceptions"
- # Insert the option either (1) after the last *FLAGS variable, or
- # (2) before a word containing "conftest.", or (3) at the end.
- # Note that $ac_compile itself does not contain backslashes and begins
- # with a dollar sign (not a hyphen), so the echo should work correctly.
- # The option is referenced via a variable to avoid confusing sed.
- lt_compile=`echo "$ac_compile" | $SED \
- -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
- -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
- -e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:23801: $lt_compile\"" >&5)
- (eval "$lt_compile" 2>conftest.err)
- ac_status=$?
- cat conftest.err >&5
- echo "$as_me:23805: \$? = $ac_status" >&5
- if (exit $ac_status) && test -s "$ac_outfile"; then
- # The compiler can only warn and ignore the option if not recognized
- # So say no if there are warnings other than the usual output.
- $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
- $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
- if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
- lt_cv_prog_compiler_rtti_exceptions=yes
- fi
- fi
- $rm conftest*
-
-fi
-{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
-echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6; }
-
-if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then
- lt_prog_compiler_no_builtin_flag_GCJ="$lt_prog_compiler_no_builtin_flag_GCJ -fno-rtti -fno-exceptions"
-else
- :
-fi
-
-fi
-
-lt_prog_compiler_wl_GCJ=
-lt_prog_compiler_pic_GCJ=
-lt_prog_compiler_static_GCJ=
-
-{ echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
-echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
-
- if test "$GCC" = yes; then
- lt_prog_compiler_wl_GCJ='-Wl,'
- lt_prog_compiler_static_GCJ='-static'
-
- case $host_os in
- aix*)
- # All AIX code is PIC.
- if test "$host_cpu" = ia64; then
- # AIX 5 now supports IA64 processor
- lt_prog_compiler_static_GCJ='-Bstatic'
- fi
- ;;
-
- amigaos*)
- # FIXME: we need at least 68020 code to build shared libraries, but
- # adding the `-m68020' flag to GCC prevents building anything better,
- # like `-m68040'.
- lt_prog_compiler_pic_GCJ='-m68020 -resident32 -malways-restore-a4'
- ;;
-
- beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
- # PIC is the default for these OSes.
- ;;
-
- mingw* | pw32* | os2*)
- # This hack is so that the source file can tell whether it is being
- # built for inclusion in a dll (and should export symbols for example).
- lt_prog_compiler_pic_GCJ='-DDLL_EXPORT'
- ;;
-
- darwin* | rhapsody*)
- # PIC is the default on this platform
- # Common symbols not allowed in MH_DYLIB files
- lt_prog_compiler_pic_GCJ='-fno-common'
- ;;
-
- interix3*)
- # Interix 3.x gcc -fpic/-fPIC options generate broken code.
- # Instead, we relocate shared libraries at runtime.
- ;;
-
- msdosdjgpp*)
- # Just because we use GCC doesn't mean we suddenly get shared libraries
- # on systems that don't support them.
- lt_prog_compiler_can_build_shared_GCJ=no
- enable_shared=no
- ;;
-
- sysv4*MP*)
- if test -d /usr/nec; then
- lt_prog_compiler_pic_GCJ=-Kconform_pic
- fi
- ;;
-
- hpux*)
- # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
- # not for PA HP-UX.
- case $host_cpu in
- hppa*64*|ia64*)
- # +Z the default
- ;;
- *)
- lt_prog_compiler_pic_GCJ='-fPIC'
- ;;
- esac
- ;;
-
- *)
- lt_prog_compiler_pic_GCJ='-fPIC'
- ;;
- esac
- else
- # PORTME Check for flag to pass linker flags through the system compiler.
- case $host_os in
- aix*)
- lt_prog_compiler_wl_GCJ='-Wl,'
- if test "$host_cpu" = ia64; then
- # AIX 5 now supports IA64 processor
- lt_prog_compiler_static_GCJ='-Bstatic'
- else
- lt_prog_compiler_static_GCJ='-bnso -bI:/lib/syscalls.exp'
- fi
- ;;
- darwin*)
- # PIC is the default on this platform
- # Common symbols not allowed in MH_DYLIB files
- case $cc_basename in
- xlc*)
- lt_prog_compiler_pic_GCJ='-qnocommon'
- lt_prog_compiler_wl_GCJ='-Wl,'
- ;;
- esac
- ;;
-
- mingw* | pw32* | os2*)
- # This hack is so that the source file can tell whether it is being
- # built for inclusion in a dll (and should export symbols for example).
- lt_prog_compiler_pic_GCJ='-DDLL_EXPORT'
- ;;
-
- hpux9* | hpux10* | hpux11*)
- lt_prog_compiler_wl_GCJ='-Wl,'
- # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
- # not for PA HP-UX.
- case $host_cpu in
- hppa*64*|ia64*)
- # +Z the default
- ;;
- *)
- lt_prog_compiler_pic_GCJ='+Z'
- ;;
- esac
- # Is there a better lt_prog_compiler_static that works with the bundled CC?
- lt_prog_compiler_static_GCJ='${wl}-a ${wl}archive'
- ;;
-
- irix5* | irix6* | nonstopux*)
- lt_prog_compiler_wl_GCJ='-Wl,'
- # PIC (with -KPIC) is the default.
- lt_prog_compiler_static_GCJ='-non_shared'
- ;;
-
- newsos6)
- lt_prog_compiler_pic_GCJ='-KPIC'
- lt_prog_compiler_static_GCJ='-Bstatic'
- ;;
-
- linux*)
- case $cc_basename in
- icc* | ecc*)
- lt_prog_compiler_wl_GCJ='-Wl,'
- lt_prog_compiler_pic_GCJ='-KPIC'
- lt_prog_compiler_static_GCJ='-static'
- ;;
- pgcc* | pgf77* | pgf90* | pgf95*)
- # Portland Group compilers (*not* the Pentium gcc compiler,
- # which looks to be a dead project)
- lt_prog_compiler_wl_GCJ='-Wl,'
- lt_prog_compiler_pic_GCJ='-fpic'
- lt_prog_compiler_static_GCJ='-Bstatic'
- ;;
- ccc*)
- lt_prog_compiler_wl_GCJ='-Wl,'
- # All Alpha code is PIC.
- lt_prog_compiler_static_GCJ='-non_shared'
- ;;
- esac
- ;;
-
- osf3* | osf4* | osf5*)
- lt_prog_compiler_wl_GCJ='-Wl,'
- # All OSF/1 code is PIC.
- lt_prog_compiler_static_GCJ='-non_shared'
- ;;
-
- solaris*)
- lt_prog_compiler_pic_GCJ='-KPIC'
- lt_prog_compiler_static_GCJ='-Bstatic'
- case $cc_basename in
- f77* | f90* | f95*)
- lt_prog_compiler_wl_GCJ='-Qoption ld ';;
- *)
- lt_prog_compiler_wl_GCJ='-Wl,';;
- esac
- ;;
-
- sunos4*)
- lt_prog_compiler_wl_GCJ='-Qoption ld '
- lt_prog_compiler_pic_GCJ='-PIC'
- lt_prog_compiler_static_GCJ='-Bstatic'
- ;;
-
- sysv4 | sysv4.2uw2* | sysv4.3*)
- lt_prog_compiler_wl_GCJ='-Wl,'
- lt_prog_compiler_pic_GCJ='-KPIC'
- lt_prog_compiler_static_GCJ='-Bstatic'
- ;;
-
- sysv4*MP*)
- if test -d /usr/nec ;then
- lt_prog_compiler_pic_GCJ='-Kconform_pic'
- lt_prog_compiler_static_GCJ='-Bstatic'
- fi
- ;;
-
- sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
- lt_prog_compiler_wl_GCJ='-Wl,'
- lt_prog_compiler_pic_GCJ='-KPIC'
- lt_prog_compiler_static_GCJ='-Bstatic'
- ;;
-
- unicos*)
- lt_prog_compiler_wl_GCJ='-Wl,'
- lt_prog_compiler_can_build_shared_GCJ=no
- ;;
-
- uts4*)
- lt_prog_compiler_pic_GCJ='-pic'
- lt_prog_compiler_static_GCJ='-Bstatic'
- ;;
-
- *)
- lt_prog_compiler_can_build_shared_GCJ=no
- ;;
- esac
- fi
-
-{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_GCJ" >&5
-echo "${ECHO_T}$lt_prog_compiler_pic_GCJ" >&6; }
-
-#
-# Check to make sure the PIC flag actually works.
-#
-if test -n "$lt_prog_compiler_pic_GCJ"; then
-
-{ echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works" >&5
-echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works... $ECHO_C" >&6; }
-if test "${lt_prog_compiler_pic_works_GCJ+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- lt_prog_compiler_pic_works_GCJ=no
- ac_outfile=conftest.$ac_objext
- printf "$lt_simple_compile_test_code" > conftest.$ac_ext
- lt_compiler_flag="$lt_prog_compiler_pic_GCJ"
- # Insert the option either (1) after the last *FLAGS variable, or
- # (2) before a word containing "conftest.", or (3) at the end.
- # Note that $ac_compile itself does not contain backslashes and begins
- # with a dollar sign (not a hyphen), so the echo should work correctly.
- # The option is referenced via a variable to avoid confusing sed.
- lt_compile=`echo "$ac_compile" | $SED \
- -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
- -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
- -e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:24069: $lt_compile\"" >&5)
- (eval "$lt_compile" 2>conftest.err)
- ac_status=$?
- cat conftest.err >&5
- echo "$as_me:24073: \$? = $ac_status" >&5
- if (exit $ac_status) && test -s "$ac_outfile"; then
- # The compiler can only warn and ignore the option if not recognized
- # So say no if there are warnings other than the usual output.
- $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
- $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
- if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
- lt_prog_compiler_pic_works_GCJ=yes
- fi
- fi
- $rm conftest*
-
-fi
-{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_GCJ" >&5
-echo "${ECHO_T}$lt_prog_compiler_pic_works_GCJ" >&6; }
-
-if test x"$lt_prog_compiler_pic_works_GCJ" = xyes; then
- case $lt_prog_compiler_pic_GCJ in
- "" | " "*) ;;
- *) lt_prog_compiler_pic_GCJ=" $lt_prog_compiler_pic_GCJ" ;;
- esac
-else
- lt_prog_compiler_pic_GCJ=
- lt_prog_compiler_can_build_shared_GCJ=no
-fi
-
-fi
-case $host_os in
- # For platforms which do not support PIC, -DPIC is meaningless:
- *djgpp*)
- lt_prog_compiler_pic_GCJ=
- ;;
- *)
- lt_prog_compiler_pic_GCJ="$lt_prog_compiler_pic_GCJ"
- ;;
-esac
-
-#
-# Check to make sure the static flag actually works.
-#
-wl=$lt_prog_compiler_wl_GCJ eval lt_tmp_static_flag=\"$lt_prog_compiler_static_GCJ\"
-{ echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5
-echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; }
-if test "${lt_prog_compiler_static_works_GCJ+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- lt_prog_compiler_static_works_GCJ=no
- save_LDFLAGS="$LDFLAGS"
- LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
- printf "$lt_simple_link_test_code" > conftest.$ac_ext
- if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
- # The linker can only warn and ignore the option if not recognized
- # So say no if there are warnings
- if test -s conftest.err; then
- # Append any errors to the config.log.
- cat conftest.err 1>&5
- $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
- $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
- if diff conftest.exp conftest.er2 >/dev/null; then
- lt_prog_compiler_static_works_GCJ=yes
- fi
- else
- lt_prog_compiler_static_works_GCJ=yes
- fi
- fi
- $rm conftest*
- LDFLAGS="$save_LDFLAGS"
-
-fi
-{ echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_GCJ" >&5
-echo "${ECHO_T}$lt_prog_compiler_static_works_GCJ" >&6; }
-
-if test x"$lt_prog_compiler_static_works_GCJ" = xyes; then
- :
-else
- lt_prog_compiler_static_GCJ=
-fi
-
-
-{ echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
-echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; }
-if test "${lt_cv_prog_compiler_c_o_GCJ+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- lt_cv_prog_compiler_c_o_GCJ=no
- $rm -r conftest 2>/dev/null
- mkdir conftest
- cd conftest
- mkdir out
- printf "$lt_simple_compile_test_code" > conftest.$ac_ext
-
- lt_compiler_flag="-o out/conftest2.$ac_objext"
- # Insert the option either (1) after the last *FLAGS variable, or
- # (2) before a word containing "conftest.", or (3) at the end.
- # Note that $ac_compile itself does not contain backslashes and begins
- # with a dollar sign (not a hyphen), so the echo should work correctly.
- lt_compile=`echo "$ac_compile" | $SED \
- -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
- -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
- -e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:24173: $lt_compile\"" >&5)
- (eval "$lt_compile" 2>out/conftest.err)
- ac_status=$?
- cat out/conftest.err >&5
- echo "$as_me:24177: \$? = $ac_status" >&5
- if (exit $ac_status) && test -s out/conftest2.$ac_objext
- then
- # The compiler can only warn and ignore the option if not recognized
- # So say no if there are warnings
- $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
- $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
- if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
- lt_cv_prog_compiler_c_o_GCJ=yes
- fi
- fi
- chmod u+w . 2>&5
- $rm conftest*
- # SGI C++ compiler will create directory out/ii_files/ for
- # template instantiation
- test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files
- $rm out/* && rmdir out
- cd ..
- rmdir conftest
- $rm conftest*
-
-fi
-{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_GCJ" >&5
-echo "${ECHO_T}$lt_cv_prog_compiler_c_o_GCJ" >&6; }
-
-
-hard_links="nottested"
-if test "$lt_cv_prog_compiler_c_o_GCJ" = no && test "$need_locks" != no; then
- # do not overwrite the value of need_locks provided by the user
- { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
-echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6; }
- hard_links=yes
- $rm conftest*
- ln conftest.a conftest.b 2>/dev/null && hard_links=no
- touch conftest.a
- ln conftest.a conftest.b 2>&5 || hard_links=no
- ln conftest.a conftest.b 2>/dev/null && hard_links=no
- { echo "$as_me:$LINENO: result: $hard_links" >&5
-echo "${ECHO_T}$hard_links" >&6; }
- if test "$hard_links" = no; then
- { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
-echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
- need_locks=warn
- fi
-else
- need_locks=no
-fi
-
-{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
-echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; }
-
- runpath_var=
- allow_undefined_flag_GCJ=
- enable_shared_with_static_runtimes_GCJ=no
- archive_cmds_GCJ=
- archive_expsym_cmds_GCJ=
- old_archive_From_new_cmds_GCJ=
- old_archive_from_expsyms_cmds_GCJ=
- export_dynamic_flag_spec_GCJ=
- whole_archive_flag_spec_GCJ=
- thread_safe_flag_spec_GCJ=
- hardcode_libdir_flag_spec_GCJ=
- hardcode_libdir_flag_spec_ld_GCJ=
- hardcode_libdir_separator_GCJ=
- hardcode_direct_GCJ=no
- hardcode_minus_L_GCJ=no
- hardcode_shlibpath_var_GCJ=unsupported
- link_all_deplibs_GCJ=unknown
- hardcode_automatic_GCJ=no
- module_cmds_GCJ=
- module_expsym_cmds_GCJ=
- always_export_symbols_GCJ=no
- export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
- # include_expsyms should be a list of space-separated symbols to be *always*
- # included in the symbol list
- include_expsyms_GCJ=
- # exclude_expsyms can be an extended regexp of symbols to exclude
- # it will be wrapped by ` (' and `)$', so one must not match beginning or
- # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
- # as well as any symbol that contains `d'.
- exclude_expsyms_GCJ="_GLOBAL_OFFSET_TABLE_"
- # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
- # platforms (ab)use it in PIC code, but their linkers get confused if
- # the symbol is explicitly referenced. Since portable code cannot
- # rely on this symbol name, it's probably fine to never include it in
- # preloaded symbol tables.
- extract_expsyms_cmds=
- # Just being paranoid about ensuring that cc_basename is set.
- for cc_temp in $compiler""; do
- case $cc_temp in
- compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
- distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
- \-*) ;;
- *) break;;
- esac
-done
-cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
-
- case $host_os in
- cygwin* | mingw* | pw32*)
- # FIXME: the MSVC++ port hasn't been tested in a loooong time
- # When not using gcc, we currently assume that we are using
- # Microsoft Visual C++.
- if test "$GCC" != yes; then
- with_gnu_ld=no
- fi
- ;;
- interix*)
- # we just hope/assume this is gcc and not c89 (= MSVC++)
- with_gnu_ld=yes
- ;;
- openbsd*)
- with_gnu_ld=no
- ;;
- esac
-
- ld_shlibs_GCJ=yes
- if test "$with_gnu_ld" = yes; then
- # If archive_cmds runs LD, not CC, wlarc should be empty
- wlarc='${wl}'
-
- # Set some defaults for GNU ld with shared library support. These
- # are reset later if shared libraries are not supported. Putting them
- # here allows them to be overridden if necessary.
- runpath_var=LD_RUN_PATH
- hardcode_libdir_flag_spec_GCJ='${wl}--rpath ${wl}$libdir'
- export_dynamic_flag_spec_GCJ='${wl}--export-dynamic'
- # ancient GNU ld didn't support --whole-archive et. al.
- if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then
- whole_archive_flag_spec_GCJ="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
- else
- whole_archive_flag_spec_GCJ=
- fi
- supports_anon_versioning=no
- case `$LD -v 2>/dev/null` in
- *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
- *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
- *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
- *\ 2.11.*) ;; # other 2.11 versions
- *) supports_anon_versioning=yes ;;
- esac
-
- # See if GNU ld supports shared libraries.
- case $host_os in
- aix3* | aix4* | aix5*)
- # On AIX/PPC, the GNU linker is very broken
- if test "$host_cpu" != ia64; then
- ld_shlibs_GCJ=no
- cat <<EOF 1>&2
-
-*** Warning: the GNU linker, at least up to release 2.9.1, is reported
-*** to be unable to reliably create shared libraries on AIX.
-*** Therefore, libtool is disabling shared libraries support. If you
-*** really care for shared libraries, you may want to modify your PATH
-*** so that a non-GNU linker is found, and then restart.
-
-EOF
- fi
- ;;
-
- amigaos*)
- archive_cmds_GCJ='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
- hardcode_libdir_flag_spec_GCJ='-L$libdir'
- hardcode_minus_L_GCJ=yes
-
- # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
- # that the semantics of dynamic libraries on AmigaOS, at least up
- # to version 4, is to share data among multiple programs linked
- # with the same dynamic library. Since this doesn't match the
- # behavior of shared libraries on other platforms, we can't use
- # them.
- ld_shlibs_GCJ=no
- ;;
-
- beos*)
- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- allow_undefined_flag_GCJ=unsupported
- # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
- # support --undefined. This deserves some investigation. FIXME
- archive_cmds_GCJ='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- else
- ld_shlibs_GCJ=no
- fi
- ;;
-
- cygwin* | mingw* | pw32*)
- # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, GCJ) is actually meaningless,
- # as there is no search path for DLLs.
- hardcode_libdir_flag_spec_GCJ='-L$libdir'
- allow_undefined_flag_GCJ=unsupported
- always_export_symbols_GCJ=no
- enable_shared_with_static_runtimes_GCJ=yes
- export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
-
- if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
- archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
- # If the export-symbols file already is a .def file (1st line
- # is EXPORTS), use it as is; otherwise, prepend...
- archive_expsym_cmds_GCJ='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
- cp $export_symbols $output_objdir/$soname.def;
- else
- echo EXPORTS > $output_objdir/$soname.def;
- cat $export_symbols >> $output_objdir/$soname.def;
- fi~
- $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
- else
- ld_shlibs_GCJ=no
- fi
- ;;
-
- interix3*)
- hardcode_direct_GCJ=no
- hardcode_shlibpath_var_GCJ=no
- hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir'
- export_dynamic_flag_spec_GCJ='${wl}-E'
- # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
- # Instead, shared libraries are loaded at an image base (0x10000000 by
- # default) and relocated if they conflict, which is a slow very memory
- # consuming and fragmenting process. To avoid this, we pick a random,
- # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
- # time. Moving up from 0x10000000 also allows more sbrk(2) space.
- archive_cmds_GCJ='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
- archive_expsym_cmds_GCJ='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
- ;;
-
- linux*)
- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- tmp_addflag=
- case $cc_basename,$host_cpu in
- pgcc*) # Portland Group C compiler
- whole_archive_flag_spec_GCJ='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
- tmp_addflag=' $pic_flag'
- ;;
- pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers
- whole_archive_flag_spec_GCJ='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
- tmp_addflag=' $pic_flag -Mnomain' ;;
- ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64
- tmp_addflag=' -i_dynamic' ;;
- efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64
- tmp_addflag=' -i_dynamic -nofor_main' ;;
- ifc* | ifort*) # Intel Fortran compiler
- tmp_addflag=' -nofor_main' ;;
- esac
- archive_cmds_GCJ='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-
- if test $supports_anon_versioning = yes; then
- archive_expsym_cmds_GCJ='$echo "{ global:" > $output_objdir/$libname.ver~
- cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
- $echo "local: *; };" >> $output_objdir/$libname.ver~
- $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
- fi
- else
- ld_shlibs_GCJ=no
- fi
- ;;
-
- netbsd*)
- if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
- archive_cmds_GCJ='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
- wlarc=
- else
- archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
- fi
- ;;
-
- solaris*)
- if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
- ld_shlibs_GCJ=no
- cat <<EOF 1>&2
-
-*** Warning: The releases 2.8.* of the GNU linker cannot reliably
-*** create shared libraries on Solaris systems. Therefore, libtool
-*** is disabling shared libraries support. We urge you to upgrade GNU
-*** binutils to release 2.9.1 or newer. Another option is to modify
-*** your PATH or compiler configuration so that the native linker is
-*** used, and then restart.
-
-EOF
- elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
- else
- ld_shlibs_GCJ=no
- fi
- ;;
-
- sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
- case `$LD -v 2>&1` in
- *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
- ld_shlibs_GCJ=no
- cat <<_LT_EOF 1>&2
-
-*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
-*** reliably create shared libraries on SCO systems. Therefore, libtool
-*** is disabling shared libraries support. We urge you to upgrade GNU
-*** binutils to release 2.16.91.0.3 or newer. Another option is to modify
-*** your PATH or compiler configuration so that the native linker is
-*** used, and then restart.
-
-_LT_EOF
- ;;
- *)
- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- hardcode_libdir_flag_spec_GCJ='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
- archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib'
- archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib'
- else
- ld_shlibs_GCJ=no
- fi
- ;;
- esac
- ;;
-
- sunos4*)
- archive_cmds_GCJ='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
- wlarc=
- hardcode_direct_GCJ=yes
- hardcode_shlibpath_var_GCJ=no
- ;;
-
- *)
- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
- else
- ld_shlibs_GCJ=no
- fi
- ;;
- esac
-
- if test "$ld_shlibs_GCJ" = no; then
- runpath_var=
- hardcode_libdir_flag_spec_GCJ=
- export_dynamic_flag_spec_GCJ=
- whole_archive_flag_spec_GCJ=
- fi
- else
- # PORTME fill in a description of your system's linker (not GNU ld)
- case $host_os in
- aix3*)
- allow_undefined_flag_GCJ=unsupported
- always_export_symbols_GCJ=yes
- archive_expsym_cmds_GCJ='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
- # Note: this linker hardcodes the directories in LIBPATH if there
- # are no directories specified by -L.
- hardcode_minus_L_GCJ=yes
- if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
- # Neither direct hardcoding nor static linking is supported with a
- # broken collect2.
- hardcode_direct_GCJ=unsupported
- fi
- ;;
-
- aix4* | aix5*)
- if test "$host_cpu" = ia64; then
- # On IA64, the linker does run time linking by default, so we don't
- # have to do anything special.
- aix_use_runtimelinking=no
- exp_sym_flag='-Bexport'
- no_entry_flag=""
- else
- # If we're using GNU nm, then we don't want the "-C" option.
- # -C means demangle to AIX nm, but means don't demangle with GNU nm
- if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
- export_symbols_cmds_GCJ='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
- else
- export_symbols_cmds_GCJ='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
- fi
- aix_use_runtimelinking=no
-
- # Test if we are trying to use run time linking or normal
- # AIX style linking. If -brtl is somewhere in LDFLAGS, we
- # need to do runtime linking.
- case $host_os in aix4.[23]|aix4.[23].*|aix5*)
- for ld_flag in $LDFLAGS; do
- if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
- aix_use_runtimelinking=yes
- break
- fi
- done
- ;;
- esac
-
- exp_sym_flag='-bexport'
- no_entry_flag='-bnoentry'
- fi
-
- # When large executables or shared objects are built, AIX ld can
- # have problems creating the table of contents. If linking a library
- # or program results in "error TOC overflow" add -mminimal-toc to
- # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
- # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
-
- archive_cmds_GCJ=''
- hardcode_direct_GCJ=yes
- hardcode_libdir_separator_GCJ=':'
- link_all_deplibs_GCJ=yes
-
- if test "$GCC" = yes; then
- case $host_os in aix4.[012]|aix4.[012].*)
- # We only want to do this on AIX 4.2 and lower, the check
- # below for broken collect2 doesn't work under 4.3+
- collect2name=`${CC} -print-prog-name=collect2`
- if test -f "$collect2name" && \
- strings "$collect2name" | grep resolve_lib_name >/dev/null
- then
- # We have reworked collect2
- hardcode_direct_GCJ=yes
- else
- # We have old collect2
- hardcode_direct_GCJ=unsupported
- # It fails to find uninstalled libraries when the uninstalled
- # path is not listed in the libpath. Setting hardcode_minus_L
- # to unsupported forces relinking
- hardcode_minus_L_GCJ=yes
- hardcode_libdir_flag_spec_GCJ='-L$libdir'
- hardcode_libdir_separator_GCJ=
- fi
- ;;
- esac
- shared_flag='-shared'
- if test "$aix_use_runtimelinking" = yes; then
- shared_flag="$shared_flag "'${wl}-G'
- fi
- else
- # not using gcc
- if test "$host_cpu" = ia64; then
- # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
- # chokes on -Wl,-G. The following line is correct:
- shared_flag='-G'
- else
- if test "$aix_use_runtimelinking" = yes; then
- shared_flag='${wl}-G'
- else
- shared_flag='${wl}-bM:SRE'
- fi
- fi
- fi
-
- # It seems that -bexpall does not export symbols beginning with
- # underscore (_), so it is better to generate a list of symbols to export.
- always_export_symbols_GCJ=yes
- if test "$aix_use_runtimelinking" = yes; then
- # Warning - without using the other runtime loading flags (-brtl),
- # -berok will link without error, but may produce a broken library.
- allow_undefined_flag_GCJ='-berok'
- # Determine the default libpath from the value encoded in an empty executable.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
-
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
-}'`
-# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
-}'`; fi
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
-fi
-
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
-
- hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath"
- archive_expsym_cmds_GCJ="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
- else
- if test "$host_cpu" = ia64; then
- hardcode_libdir_flag_spec_GCJ='${wl}-R $libdir:/usr/lib:/lib'
- allow_undefined_flag_GCJ="-z nodefs"
- archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
- else
- # Determine the default libpath from the value encoded in an empty executable.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
-
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
-}'`
-# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
-}'`; fi
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
-fi
-
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
-
- hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath"
- # Warning - without using the other run time loading flags,
- # -berok will link without error, but may produce a broken library.
- no_undefined_flag_GCJ=' ${wl}-bernotok'
- allow_undefined_flag_GCJ=' ${wl}-berok'
- # Exported symbols can be pulled into shared objects from archives
- whole_archive_flag_spec_GCJ='$convenience'
- archive_cmds_need_lc_GCJ=yes
- # This is similar to how AIX traditionally builds its shared libraries.
- archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
- fi
- fi
- ;;
-
- amigaos*)
- archive_cmds_GCJ='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
- hardcode_libdir_flag_spec_GCJ='-L$libdir'
- hardcode_minus_L_GCJ=yes
- # see comment about different semantics on the GNU ld section
- ld_shlibs_GCJ=no
- ;;
-
- bsdi[45]*)
- export_dynamic_flag_spec_GCJ=-rdynamic
- ;;
-
- cygwin* | mingw* | pw32*)
- # When not using gcc, we currently assume that we are using
- # Microsoft Visual C++.
- # hardcode_libdir_flag_spec is actually meaningless, as there is
- # no search path for DLLs.
- hardcode_libdir_flag_spec_GCJ=' '
- allow_undefined_flag_GCJ=unsupported
- # Tell ltmain to make .lib files, not .a files.
- libext=lib
- # Tell ltmain to make .dll files, not .so files.
- shrext_cmds=".dll"
- # FIXME: Setting linknames here is a bad hack.
- archive_cmds_GCJ='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
- # The linker will automatically build a .lib file if we build a DLL.
- old_archive_From_new_cmds_GCJ='true'
- # FIXME: Should let the user specify the lib program.
- old_archive_cmds_GCJ='lib /OUT:$oldlib$oldobjs$old_deplibs'
- fix_srcfile_path_GCJ='`cygpath -w "$srcfile"`'
- enable_shared_with_static_runtimes_GCJ=yes
- ;;
-
- darwin* | rhapsody*)
- case $host_os in
- rhapsody* | darwin1.[012])
- allow_undefined_flag_GCJ='${wl}-undefined ${wl}suppress'
- ;;
- *) # Darwin 1.3 on
- if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
- allow_undefined_flag_GCJ='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
- else
- case ${MACOSX_DEPLOYMENT_TARGET} in
- 10.[012])
- allow_undefined_flag_GCJ='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
- ;;
- 10.*)
- allow_undefined_flag_GCJ='${wl}-undefined ${wl}dynamic_lookup'
- ;;
- esac
- fi
- ;;
- esac
- archive_cmds_need_lc_GCJ=no
- hardcode_direct_GCJ=no
- hardcode_automatic_GCJ=yes
- hardcode_shlibpath_var_GCJ=unsupported
- whole_archive_flag_spec_GCJ=''
- link_all_deplibs_GCJ=yes
- if test "$GCC" = yes ; then
- output_verbose_link_cmd='echo'
- archive_cmds_GCJ='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
- module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
- # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
- archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- else
- case $cc_basename in
- xlc*)
- output_verbose_link_cmd='echo'
- archive_cmds_GCJ='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
- module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
- # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
- archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- ;;
- *)
- ld_shlibs_GCJ=no
- ;;
- esac
- fi
- ;;
-
- dgux*)
- archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_libdir_flag_spec_GCJ='-L$libdir'
- hardcode_shlibpath_var_GCJ=no
- ;;
-
- freebsd1*)
- ld_shlibs_GCJ=no
- ;;
-
- # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
- # support. Future versions do this automatically, but an explicit c++rt0.o
- # does not break anything, and helps significantly (at the cost of a little
- # extra space).
- freebsd2.2*)
- archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
- hardcode_libdir_flag_spec_GCJ='-R$libdir'
- hardcode_direct_GCJ=yes
- hardcode_shlibpath_var_GCJ=no
- ;;
-
- # Unfortunately, older versions of FreeBSD 2 do not have this feature.
- freebsd2*)
- archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
- hardcode_direct_GCJ=yes
- hardcode_minus_L_GCJ=yes
- hardcode_shlibpath_var_GCJ=no
- ;;
-
- # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
- freebsd* | kfreebsd*-gnu | dragonfly*)
- archive_cmds_GCJ='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
- hardcode_libdir_flag_spec_GCJ='-R$libdir'
- hardcode_direct_GCJ=yes
- hardcode_shlibpath_var_GCJ=no
- ;;
-
- hpux9*)
- if test "$GCC" = yes; then
- archive_cmds_GCJ='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
- else
- archive_cmds_GCJ='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
- fi
- hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir'
- hardcode_libdir_separator_GCJ=:
- hardcode_direct_GCJ=yes
-
- # hardcode_minus_L: Not really in the search PATH,
- # but as the default location of the library.
- hardcode_minus_L_GCJ=yes
- export_dynamic_flag_spec_GCJ='${wl}-E'
- ;;
-
- hpux10*)
- if test "$GCC" = yes -a "$with_gnu_ld" = no; then
- archive_cmds_GCJ='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
- else
- archive_cmds_GCJ='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
- fi
- if test "$with_gnu_ld" = no; then
- hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir'
- hardcode_libdir_separator_GCJ=:
-
- hardcode_direct_GCJ=yes
- export_dynamic_flag_spec_GCJ='${wl}-E'
-
- # hardcode_minus_L: Not really in the search PATH,
- # but as the default location of the library.
- hardcode_minus_L_GCJ=yes
- fi
- ;;
-
- hpux11*)
- if test "$GCC" = yes -a "$with_gnu_ld" = no; then
- case $host_cpu in
- hppa*64*)
- archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- ia64*)
- archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- *)
- archive_cmds_GCJ='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- esac
- else
- case $host_cpu in
- hppa*64*)
- archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- ia64*)
- archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- *)
- archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- esac
- fi
- if test "$with_gnu_ld" = no; then
- hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir'
- hardcode_libdir_separator_GCJ=:
-
- case $host_cpu in
- hppa*64*|ia64*)
- hardcode_libdir_flag_spec_ld_GCJ='+b $libdir'
- hardcode_direct_GCJ=no
- hardcode_shlibpath_var_GCJ=no
- ;;
- *)
- hardcode_direct_GCJ=yes
- export_dynamic_flag_spec_GCJ='${wl}-E'
-
- # hardcode_minus_L: Not really in the search PATH,
- # but as the default location of the library.
- hardcode_minus_L_GCJ=yes
- ;;
- esac
- fi
- ;;
-
- irix5* | irix6* | nonstopux*)
- if test "$GCC" = yes; then
- archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- else
- archive_cmds_GCJ='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
- hardcode_libdir_flag_spec_ld_GCJ='-rpath $libdir'
- fi
- hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir'
- hardcode_libdir_separator_GCJ=:
- link_all_deplibs_GCJ=yes
- ;;
-
- netbsd*)
- if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
- archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
- else
- archive_cmds_GCJ='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
- fi
- hardcode_libdir_flag_spec_GCJ='-R$libdir'
- hardcode_direct_GCJ=yes
- hardcode_shlibpath_var_GCJ=no
- ;;
-
- newsos6)
- archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_direct_GCJ=yes
- hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir'
- hardcode_libdir_separator_GCJ=:
- hardcode_shlibpath_var_GCJ=no
- ;;
-
- openbsd*)
- hardcode_direct_GCJ=yes
- hardcode_shlibpath_var_GCJ=no
- if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
- archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
- hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir'
- export_dynamic_flag_spec_GCJ='${wl}-E'
- else
- case $host_os in
- openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
- archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
- hardcode_libdir_flag_spec_GCJ='-R$libdir'
- ;;
- *)
- archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
- hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir'
- ;;
- esac
- fi
- ;;
-
- os2*)
- hardcode_libdir_flag_spec_GCJ='-L$libdir'
- hardcode_minus_L_GCJ=yes
- allow_undefined_flag_GCJ=unsupported
- archive_cmds_GCJ='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
- old_archive_From_new_cmds_GCJ='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
- ;;
-
- osf3*)
- if test "$GCC" = yes; then
- allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*'
- archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- else
- allow_undefined_flag_GCJ=' -expect_unresolved \*'
- archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
- fi
- hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir'
- hardcode_libdir_separator_GCJ=:
- ;;
-
- osf4* | osf5*) # as osf3* with the addition of -msym flag
- if test "$GCC" = yes; then
- allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*'
- archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir'
- else
- allow_undefined_flag_GCJ=' -expect_unresolved \*'
- archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
- archive_expsym_cmds_GCJ='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
- $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp'
-
- # Both c and cxx compiler support -rpath directly
- hardcode_libdir_flag_spec_GCJ='-rpath $libdir'
- fi
- hardcode_libdir_separator_GCJ=:
- ;;
-
- solaris*)
- no_undefined_flag_GCJ=' -z text'
- if test "$GCC" = yes; then
- wlarc='${wl}'
- archive_cmds_GCJ='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
- $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
- else
- wlarc=''
- archive_cmds_GCJ='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
- archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
- $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
- fi
- hardcode_libdir_flag_spec_GCJ='-R$libdir'
- hardcode_shlibpath_var_GCJ=no
- case $host_os in
- solaris2.[0-5] | solaris2.[0-5].*) ;;
- *)
- # The compiler driver will combine linker options so we
- # cannot just pass the convience library names through
- # without $wl, iff we do not link with $LD.
- # Luckily, gcc supports the same syntax we need for Sun Studio.
- # Supported since Solaris 2.6 (maybe 2.5.1?)
- case $wlarc in
- '')
- whole_archive_flag_spec_GCJ='-z allextract$convenience -z defaultextract' ;;
- *)
- whole_archive_flag_spec_GCJ='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;;
- esac ;;
- esac
- link_all_deplibs_GCJ=yes
- ;;
-
- sunos4*)
- if test "x$host_vendor" = xsequent; then
- # Use $CC to link under sequent, because it throws in some extra .o
- # files that make .init and .fini sections work.
- archive_cmds_GCJ='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
- else
- archive_cmds_GCJ='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
- fi
- hardcode_libdir_flag_spec_GCJ='-L$libdir'
- hardcode_direct_GCJ=yes
- hardcode_minus_L_GCJ=yes
- hardcode_shlibpath_var_GCJ=no
- ;;
-
- sysv4)
- case $host_vendor in
- sni)
- archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_direct_GCJ=yes # is this really true???
- ;;
- siemens)
- ## LD is ld it makes a PLAMLIB
- ## CC just makes a GrossModule.
- archive_cmds_GCJ='$LD -G -o $lib $libobjs $deplibs $linker_flags'
- reload_cmds_GCJ='$CC -r -o $output$reload_objs'
- hardcode_direct_GCJ=no
- ;;
- motorola)
- archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_direct_GCJ=no #Motorola manual says yes, but my tests say they lie
- ;;
- esac
- runpath_var='LD_RUN_PATH'
- hardcode_shlibpath_var_GCJ=no
- ;;
-
- sysv4.3*)
- archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_shlibpath_var_GCJ=no
- export_dynamic_flag_spec_GCJ='-Bexport'
- ;;
-
- sysv4*MP*)
- if test -d /usr/nec; then
- archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_shlibpath_var_GCJ=no
- runpath_var=LD_RUN_PATH
- hardcode_runpath_var=yes
- ld_shlibs_GCJ=yes
- fi
- ;;
-
- sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*)
- no_undefined_flag_GCJ='${wl}-z,text'
- archive_cmds_need_lc_GCJ=no
- hardcode_shlibpath_var_GCJ=no
- runpath_var='LD_RUN_PATH'
-
- if test "$GCC" = yes; then
- archive_cmds_GCJ='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds_GCJ='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- else
- archive_cmds_GCJ='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds_GCJ='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- fi
- ;;
-
- sysv5* | sco3.2v5* | sco5v6*)
- # Note: We can NOT use -z defs as we might desire, because we do not
- # link with -lc, and that would cause any symbols used from libc to
- # always be unresolved, which means just about no library would
- # ever link correctly. If we're not using GNU ld we use -z text
- # though, which does catch some bad symbols but isn't as heavy-handed
- # as -z defs.
- no_undefined_flag_GCJ='${wl}-z,text'
- allow_undefined_flag_GCJ='${wl}-z,nodefs'
- archive_cmds_need_lc_GCJ=no
- hardcode_shlibpath_var_GCJ=no
- hardcode_libdir_flag_spec_GCJ='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
- hardcode_libdir_separator_GCJ=':'
- link_all_deplibs_GCJ=yes
- export_dynamic_flag_spec_GCJ='${wl}-Bexport'
- runpath_var='LD_RUN_PATH'
-
- if test "$GCC" = yes; then
- archive_cmds_GCJ='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds_GCJ='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- else
- archive_cmds_GCJ='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds_GCJ='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- fi
- ;;
-
- uts4*)
- archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_libdir_flag_spec_GCJ='-L$libdir'
- hardcode_shlibpath_var_GCJ=no
- ;;
-
- *)
- ld_shlibs_GCJ=no
- ;;
- esac
- fi
-
-{ echo "$as_me:$LINENO: result: $ld_shlibs_GCJ" >&5
-echo "${ECHO_T}$ld_shlibs_GCJ" >&6; }
-test "$ld_shlibs_GCJ" = no && can_build_shared=no
-
-#
-# Do we need to explicitly link libc?
-#
-case "x$archive_cmds_need_lc_GCJ" in
-x|xyes)
- # Assume -lc should be added
- archive_cmds_need_lc_GCJ=yes
-
- if test "$enable_shared" = yes && test "$GCC" = yes; then
- case $archive_cmds_GCJ in
- *'~'*)
- # FIXME: we may have to deal with multi-command sequences.
- ;;
- '$CC '*)
- # Test whether the compiler implicitly links with -lc since on some
- # systems, -lgcc has to come before -lc. If gcc already passes -lc
- # to ld, don't add -lc before -lgcc.
- { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
-echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; }
- $rm conftest*
- printf "$lt_simple_compile_test_code" > conftest.$ac_ext
-
- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } 2>conftest.err; then
- soname=conftest
- lib=conftest
- libobjs=conftest.$ac_objext
- deplibs=
- wl=$lt_prog_compiler_wl_GCJ
- pic_flag=$lt_prog_compiler_pic_GCJ
- compiler_flags=-v
- linker_flags=-v
- verstring=
- output_objdir=.
- libname=conftest
- lt_save_allow_undefined_flag=$allow_undefined_flag_GCJ
- allow_undefined_flag_GCJ=
- if { (eval echo "$as_me:$LINENO: \"$archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5
- (eval $archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }
- then
- archive_cmds_need_lc_GCJ=no
- else
- archive_cmds_need_lc_GCJ=yes
- fi
- allow_undefined_flag_GCJ=$lt_save_allow_undefined_flag
- else
- cat conftest.err 1>&5
- fi
- $rm conftest*
- { echo "$as_me:$LINENO: result: $archive_cmds_need_lc_GCJ" >&5
-echo "${ECHO_T}$archive_cmds_need_lc_GCJ" >&6; }
- ;;
- esac
- fi
- ;;
-esac
-
-{ echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
-echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; }
-library_names_spec=
-libname_spec='lib$name'
-soname_spec=
-shrext_cmds=".so"
-postinstall_cmds=
-postuninstall_cmds=
-finish_cmds=
-finish_eval=
-shlibpath_var=
-shlibpath_overrides_runpath=unknown
-version_type=none
-dynamic_linker="$host_os ld.so"
-sys_lib_dlsearch_path_spec="/lib /usr/lib"
-if test "$GCC" = yes; then
- sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
- if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then
- # if the path contains ";" then we assume it to be the separator
- # otherwise default to the standard path separator (i.e. ":") - it is
- # assumed that no part of a normal pathname contains ";" but that should
- # okay in the real world where ";" in dirpaths is itself problematic.
- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
- else
- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
- fi
-else
- sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
-fi
-need_lib_prefix=unknown
-hardcode_into_libs=no
-
-# when you set need_version to no, make sure it does not cause -set_version
-# flags to be left without arguments
-need_version=unknown
-
-case $host_os in
-aix3*)
- version_type=linux
- library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
- shlibpath_var=LIBPATH
-
- # AIX 3 has no versioning support, so we append a major version to the name.
- soname_spec='${libname}${release}${shared_ext}$major'
- ;;
-
-aix4* | aix5*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- hardcode_into_libs=yes
- if test "$host_cpu" = ia64; then
- # AIX 5 supports IA64
- library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
- shlibpath_var=LD_LIBRARY_PATH
- else
- # With GCC up to 2.95.x, collect2 would create an import file
- # for dependence libraries. The import file would start with
- # the line `#! .'. This would cause the generated library to
- # depend on `.', always an invalid library. This was fixed in
- # development snapshots of GCC prior to 3.0.
- case $host_os in
- aix4 | aix4.[01] | aix4.[01].*)
- if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
- echo ' yes '
- echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
- :
- else
- can_build_shared=no
- fi
- ;;
- esac
- # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
- # soname into executable. Probably we can add versioning support to
- # collect2, so additional links can be useful in future.
- if test "$aix_use_runtimelinking" = yes; then
- # If using run time linking (on AIX 4.2 or later) use lib<name>.so
- # instead of lib<name>.a to let people know that these are not
- # typical AIX shared libraries.
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- else
- # We preserve .a as extension for shared libraries through AIX4.2
- # and later when we are not doing run time linking.
- library_names_spec='${libname}${release}.a $libname.a'
- soname_spec='${libname}${release}${shared_ext}$major'
- fi
- shlibpath_var=LIBPATH
- fi
- ;;
-
-amigaos*)
- library_names_spec='$libname.ixlibrary $libname.a'
- # Create ${libname}_ixlibrary.a entries in /sys/libs.
- finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
- ;;
-
-beos*)
- library_names_spec='${libname}${shared_ext}'
- dynamic_linker="$host_os ld.so"
- shlibpath_var=LIBRARY_PATH
- ;;
-
-bsdi[45]*)
- version_type=linux
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
- sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
- # the default ld.so.conf also contains /usr/contrib/lib and
- # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
- # libtool to hard-code these into programs
- ;;
-
-cygwin* | mingw* | pw32*)
- version_type=windows
- shrext_cmds=".dll"
- need_version=no
- need_lib_prefix=no
-
- case $GCC,$host_os in
- yes,cygwin* | yes,mingw* | yes,pw32*)
- library_names_spec='$libname.dll.a'
- # DLL is installed to $(libdir)/../bin by postinstall_cmds
- postinstall_cmds='base_file=`basename \${file}`~
- dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
- dldir=$destdir/`dirname \$dlpath`~
- test -d \$dldir || mkdir -p \$dldir~
- $install_prog $dir/$dlname \$dldir/$dlname~
- chmod a+x \$dldir/$dlname'
- postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
- dlpath=$dir/\$dldll~
- $rm \$dlpath'
- shlibpath_overrides_runpath=yes
-
- case $host_os in
- cygwin*)
- # Cygwin DLLs use 'cyg' prefix rather than 'lib'
- soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
- sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
- ;;
- mingw*)
- # MinGW DLLs use traditional 'lib' prefix
- soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
- sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
- if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then
- # It is most probably a Windows format PATH printed by
- # mingw gcc, but we are running on Cygwin. Gcc prints its search
- # path with ; separators, and with drive letters. We can handle the
- # drive letters (cygwin fileutils understands them), so leave them,
- # especially as we might pass files found there to a mingw objdump,
- # which wouldn't understand a cygwinified path. Ahh.
- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
- else
- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
- fi
- ;;
- pw32*)
- # pw32 DLLs use 'pw' prefix rather than 'lib'
- library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
- ;;
- esac
- ;;
-
- *)
- library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
- ;;
- esac
- dynamic_linker='Win32 ld.exe'
- # FIXME: first we should search . and the directory the executable is in
- shlibpath_var=PATH
- ;;
-
-darwin* | rhapsody*)
- dynamic_linker="$host_os dyld"
- version_type=darwin
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
- soname_spec='${libname}${release}${major}$shared_ext'
- shlibpath_overrides_runpath=yes
- shlibpath_var=DYLD_LIBRARY_PATH
- shrext_cmds='.dylib'
- # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
- if test "$GCC" = yes; then
- sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
- else
- sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
- fi
- sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
- ;;
-
-dgux*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- ;;
-
-freebsd1*)
- dynamic_linker=no
- ;;
-
-kfreebsd*-gnu)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- dynamic_linker='GNU ld.so'
- ;;
-
-freebsd* | dragonfly*)
- # DragonFly does not have aout. When/if they implement a new
- # versioning mechanism, adjust this.
- if test -x /usr/bin/objformat; then
- objformat=`/usr/bin/objformat`
- else
- case $host_os in
- freebsd[123]*) objformat=aout ;;
- *) objformat=elf ;;
- esac
- fi
- version_type=freebsd-$objformat
- case $version_type in
- freebsd-elf*)
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
- need_version=no
- need_lib_prefix=no
- ;;
- freebsd-*)
- library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
- need_version=yes
- ;;
- esac
- shlibpath_var=LD_LIBRARY_PATH
- case $host_os in
- freebsd2*)
- shlibpath_overrides_runpath=yes
- ;;
- freebsd3.[01]* | freebsdelf3.[01]*)
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- ;;
- freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
- freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- ;;
- freebsd*) # from 4.6 on
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- ;;
- esac
- ;;
-
-gnu*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- hardcode_into_libs=yes
- ;;
-
-hpux9* | hpux10* | hpux11*)
- # Give a soname corresponding to the major version so that dld.sl refuses to
- # link against other versions.
- version_type=sunos
- need_lib_prefix=no
- need_version=no
- case $host_cpu in
- ia64*)
- shrext_cmds='.so'
- hardcode_into_libs=yes
- dynamic_linker="$host_os dld.so"
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- if test "X$HPUX_IA64_MODE" = X32; then
- sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
- else
- sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
- fi
- sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
- ;;
- hppa*64*)
- shrext_cmds='.sl'
- hardcode_into_libs=yes
- dynamic_linker="$host_os dld.sl"
- shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
- shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
- sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
- ;;
- *)
- shrext_cmds='.sl'
- dynamic_linker="$host_os dld.sl"
- shlibpath_var=SHLIB_PATH
- shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- ;;
- esac
- # HP-UX runs *really* slowly unless shared libraries are mode 555.
- postinstall_cmds='chmod 555 $lib'
- ;;
-
-interix3*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- ;;
-
-irix5* | irix6* | nonstopux*)
- case $host_os in
- nonstopux*) version_type=nonstopux ;;
- *)
- if test "$lt_cv_prog_gnu_ld" = yes; then
- version_type=linux
- else
- version_type=irix
- fi ;;
- esac
- need_lib_prefix=no
- need_version=no
- soname_spec='${libname}${release}${shared_ext}$major'
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
- case $host_os in
- irix5* | nonstopux*)
- libsuff= shlibsuff=
- ;;
- *)
- case $LD in # libtool.m4 will add one of these switches to LD
- *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
- libsuff= shlibsuff= libmagic=32-bit;;
- *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
- libsuff=32 shlibsuff=N32 libmagic=N32;;
- *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
- libsuff=64 shlibsuff=64 libmagic=64-bit;;
- *) libsuff= shlibsuff= libmagic=never-match;;
- esac
- ;;
- esac
- shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
- shlibpath_overrides_runpath=no
- sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
- sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
- hardcode_into_libs=yes
- ;;
-
-# No shared lib support for Linux oldld, aout, or coff.
-linux*oldld* | linux*aout* | linux*coff*)
- dynamic_linker=no
- ;;
-
-# This must be Linux ELF.
-linux*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- # This implies no fast_install, which is unacceptable.
- # Some rework will be needed to allow for fast_install
- # before this can be enabled.
- hardcode_into_libs=yes
-
- # Append ld.so.conf contents to the search path
- if test -f /etc/ld.so.conf; then
- lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
- sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
- fi
-
- # We used to test for /lib/ld.so.1 and disable shared libraries on
- # powerpc, because MkLinux only supported shared libraries with the
- # GNU dynamic linker. Since this was broken with cross compilers,
- # most powerpc-linux boxes support dynamic linking these days and
- # people can always --disable-shared, the test was removed, and we
- # assume the GNU/Linux dynamic linker is in use.
- dynamic_linker='GNU/Linux ld.so'
- ;;
-
-knetbsd*-gnu)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- dynamic_linker='GNU ld.so'
- ;;
-
-netbsd*)
- version_type=sunos
- need_lib_prefix=no
- need_version=no
- if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
- dynamic_linker='NetBSD (a.out) ld.so'
- else
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- dynamic_linker='NetBSD ld.elf_so'
- fi
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- ;;
-
-newsos6)
- version_type=linux
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- ;;
-
-nto-qnx*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- ;;
-
-openbsd*)
- version_type=sunos
- sys_lib_dlsearch_path_spec="/usr/lib"
- need_lib_prefix=no
- # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
- case $host_os in
- openbsd3.3 | openbsd3.3.*) need_version=yes ;;
- *) need_version=no ;;
- esac
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
- case $host_os in
- openbsd2.[89] | openbsd2.[89].*)
- shlibpath_overrides_runpath=no
- ;;
- *)
- shlibpath_overrides_runpath=yes
- ;;
- esac
- else
- shlibpath_overrides_runpath=yes
- fi
- ;;
-
-os2*)
- libname_spec='$name'
- shrext_cmds=".dll"
- need_lib_prefix=no
- library_names_spec='$libname${shared_ext} $libname.a'
- dynamic_linker='OS/2 ld.exe'
- shlibpath_var=LIBPATH
- ;;
-
-osf3* | osf4* | osf5*)
- version_type=osf
- need_lib_prefix=no
- need_version=no
- soname_spec='${libname}${release}${shared_ext}$major'
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- shlibpath_var=LD_LIBRARY_PATH
- sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
- sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
- ;;
-
-solaris*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- # ldd complains unless libraries are executable
- postinstall_cmds='chmod +x $lib'
- ;;
-
-sunos4*)
- version_type=sunos
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
- finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- if test "$with_gnu_ld" = yes; then
- need_lib_prefix=no
- fi
- need_version=yes
- ;;
-
-sysv4 | sysv4.3*)
- version_type=linux
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- case $host_vendor in
- sni)
- shlibpath_overrides_runpath=no
- need_lib_prefix=no
- export_dynamic_flag_spec='${wl}-Blargedynsym'
- runpath_var=LD_RUN_PATH
- ;;
- siemens)
- need_lib_prefix=no
- ;;
- motorola)
- need_lib_prefix=no
- need_version=no
- shlibpath_overrides_runpath=no
- sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
- ;;
- esac
- ;;
-
-sysv4*MP*)
- if test -d /usr/nec ;then
- version_type=linux
- library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
- soname_spec='$libname${shared_ext}.$major'
- shlibpath_var=LD_LIBRARY_PATH
- fi
- ;;
-
-sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
- version_type=freebsd-elf
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- hardcode_into_libs=yes
- if test "$with_gnu_ld" = yes; then
- sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
- shlibpath_overrides_runpath=no
- else
- sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
- shlibpath_overrides_runpath=yes
- case $host_os in
- sco3.2v5*)
- sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
- ;;
- esac
- fi
- sys_lib_dlsearch_path_spec='/usr/lib'
- ;;
-
-uts4*)
- version_type=linux
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- ;;
-
-*)
- dynamic_linker=no
- ;;
-esac
-{ echo "$as_me:$LINENO: result: $dynamic_linker" >&5
-echo "${ECHO_T}$dynamic_linker" >&6; }
-test "$dynamic_linker" = no && can_build_shared=no
-
-variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
-if test "$GCC" = yes; then
- variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
-fi
-
-{ echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
-echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; }
-hardcode_action_GCJ=
-if test -n "$hardcode_libdir_flag_spec_GCJ" || \
- test -n "$runpath_var_GCJ" || \
- test "X$hardcode_automatic_GCJ" = "Xyes" ; then
-
- # We can hardcode non-existant directories.
- if test "$hardcode_direct_GCJ" != no &&
- # If the only mechanism to avoid hardcoding is shlibpath_var, we
- # have to relink, otherwise we might link with an installed library
- # when we should be linking with a yet-to-be-installed one
- ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, GCJ)" != no &&
- test "$hardcode_minus_L_GCJ" != no; then
- # Linking always hardcodes the temporary library directory.
- hardcode_action_GCJ=relink
- else
- # We can link without hardcoding, and we can hardcode nonexisting dirs.
- hardcode_action_GCJ=immediate
- fi
-else
- # We cannot hardcode anything, or else we can only hardcode existing
- # directories.
- hardcode_action_GCJ=unsupported
-fi
-{ echo "$as_me:$LINENO: result: $hardcode_action_GCJ" >&5
-echo "${ECHO_T}$hardcode_action_GCJ" >&6; }
-
-if test "$hardcode_action_GCJ" = relink; then
- # Fast installation is not supported
- enable_fast_install=no
-elif test "$shlibpath_overrides_runpath" = yes ||
- test "$enable_shared" = no; then
- # Fast installation is not necessary
- enable_fast_install=needless
-fi
-
-
-# The else clause should only fire when bootstrapping the
-# libtool distribution, otherwise you forgot to ship ltmain.sh
-# with your package, and you will get complaints that there are
-# no rules to generate ltmain.sh.
-if test -f "$ltmain"; then
- # See if we are running on zsh, and set the options which allow our commands through
- # without removal of \ escapes.
- if test -n "${ZSH_VERSION+set}" ; then
- setopt NO_GLOB_SUBST
- fi
- # Now quote all the things that may contain metacharacters while being
- # careful not to overquote the AC_SUBSTed values. We take copies of the
- # variables and quote the copies for generation of the libtool script.
- for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \
- SED SHELL STRIP \
- libname_spec library_names_spec soname_spec extract_expsyms_cmds \
- old_striplib striplib file_magic_cmd finish_cmds finish_eval \
- deplibs_check_method reload_flag reload_cmds need_locks \
- lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
- lt_cv_sys_global_symbol_to_c_name_address \
- sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
- old_postinstall_cmds old_postuninstall_cmds \
- compiler_GCJ \
- CC_GCJ \
- LD_GCJ \
- lt_prog_compiler_wl_GCJ \
- lt_prog_compiler_pic_GCJ \
- lt_prog_compiler_static_GCJ \
- lt_prog_compiler_no_builtin_flag_GCJ \
- export_dynamic_flag_spec_GCJ \
- thread_safe_flag_spec_GCJ \
- whole_archive_flag_spec_GCJ \
- enable_shared_with_static_runtimes_GCJ \
- old_archive_cmds_GCJ \
- old_archive_from_new_cmds_GCJ \
- predep_objects_GCJ \
- postdep_objects_GCJ \
- predeps_GCJ \
- postdeps_GCJ \
- compiler_lib_search_path_GCJ \
- archive_cmds_GCJ \
- archive_expsym_cmds_GCJ \
- postinstall_cmds_GCJ \
- postuninstall_cmds_GCJ \
- old_archive_from_expsyms_cmds_GCJ \
- allow_undefined_flag_GCJ \
- no_undefined_flag_GCJ \
- export_symbols_cmds_GCJ \
- hardcode_libdir_flag_spec_GCJ \
- hardcode_libdir_flag_spec_ld_GCJ \
- hardcode_libdir_separator_GCJ \
- hardcode_automatic_GCJ \
- module_cmds_GCJ \
- module_expsym_cmds_GCJ \
- lt_cv_prog_compiler_c_o_GCJ \
- exclude_expsyms_GCJ \
- include_expsyms_GCJ; do
-
- case $var in
- old_archive_cmds_GCJ | \
- old_archive_from_new_cmds_GCJ | \
- archive_cmds_GCJ | \
- archive_expsym_cmds_GCJ | \
- module_cmds_GCJ | \
- module_expsym_cmds_GCJ | \
- old_archive_from_expsyms_cmds_GCJ | \
- export_symbols_cmds_GCJ | \
- extract_expsyms_cmds | reload_cmds | finish_cmds | \
- postinstall_cmds | postuninstall_cmds | \
- old_postinstall_cmds | old_postuninstall_cmds | \
- sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
- # Double-quote double-evaled strings.
- eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
- ;;
- *)
- eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
- ;;
- esac
- done
-
- case $lt_echo in
- *'\$0 --fallback-echo"')
- lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
- ;;
- esac
-
-cfgfile="$ofile"
-
- cat <<__EOF__ >> "$cfgfile"
-# ### BEGIN LIBTOOL TAG CONFIG: $tagname
-
-# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
-
-# Shell to use when invoking shell scripts.
-SHELL=$lt_SHELL
-
-# Whether or not to build shared libraries.
-build_libtool_libs=$enable_shared
-
-# Whether or not to build static libraries.
-build_old_libs=$enable_static
-
-# Whether or not to add -lc for building shared libraries.
-build_libtool_need_lc=$archive_cmds_need_lc_GCJ
-
-# Whether or not to disallow shared libs when runtime libs are static
-allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_GCJ
-
-# Whether or not to optimize for fast installation.
-fast_install=$enable_fast_install
-
-# The host system.
-host_alias=$host_alias
-host=$host
-host_os=$host_os
-
-# The build system.
-build_alias=$build_alias
-build=$build
-build_os=$build_os
-
-# An echo program that does not interpret backslashes.
-echo=$lt_echo
-
-# The archiver.
-AR=$lt_AR
-AR_FLAGS=$lt_AR_FLAGS
-
-# A C compiler.
-LTCC=$lt_LTCC
-
-# LTCC compiler flags.
-LTCFLAGS=$lt_LTCFLAGS
-
-# A language-specific compiler.
-CC=$lt_compiler_GCJ
-
-# Is the compiler the GNU C compiler?
-with_gcc=$GCC_GCJ
-
-# An ERE matcher.
-EGREP=$lt_EGREP
-
-# The linker used to build libraries.
-LD=$lt_LD_GCJ
-
-# Whether we need hard or soft links.
-LN_S=$lt_LN_S
-
-# A BSD-compatible nm program.
-NM=$lt_NM
-
-# A symbol stripping program
-STRIP=$lt_STRIP
-
-# Used to examine libraries when file_magic_cmd begins "file"
-MAGIC_CMD=$MAGIC_CMD
-
-# Used on cygwin: DLL creation program.
-DLLTOOL="$DLLTOOL"
-
-# Used on cygwin: object dumper.
-OBJDUMP="$OBJDUMP"
-
-# Used on cygwin: assembler.
-AS="$AS"
-
-# The name of the directory that contains temporary libtool files.
-objdir=$objdir
-
-# How to create reloadable object files.
-reload_flag=$lt_reload_flag
-reload_cmds=$lt_reload_cmds
-
-# How to pass a linker flag through the compiler.
-wl=$lt_lt_prog_compiler_wl_GCJ
-
-# Object file suffix (normally "o").
-objext="$ac_objext"
-
-# Old archive suffix (normally "a").
-libext="$libext"
-
-# Shared library suffix (normally ".so").
-shrext_cmds='$shrext_cmds'
-
-# Executable file suffix (normally "").
-exeext="$exeext"
-
-# Additional compiler flags for building library objects.
-pic_flag=$lt_lt_prog_compiler_pic_GCJ
-pic_mode=$pic_mode
-
-# What is the maximum length of a command?
-max_cmd_len=$lt_cv_sys_max_cmd_len
-
-# Does compiler simultaneously support -c and -o options?
-compiler_c_o=$lt_lt_cv_prog_compiler_c_o_GCJ
-
-# Must we lock files when doing compilation?
-need_locks=$lt_need_locks
-
-# Do we need the lib prefix for modules?
-need_lib_prefix=$need_lib_prefix
-
-# Do we need a version for libraries?
-need_version=$need_version
-
-# Whether dlopen is supported.
-dlopen_support=$enable_dlopen
-
-# Whether dlopen of programs is supported.
-dlopen_self=$enable_dlopen_self
-
-# Whether dlopen of statically linked programs is supported.
-dlopen_self_static=$enable_dlopen_self_static
-
-# Compiler flag to prevent dynamic linking.
-link_static_flag=$lt_lt_prog_compiler_static_GCJ
-
-# Compiler flag to turn off builtin functions.
-no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_GCJ
-
-# Compiler flag to allow reflexive dlopens.
-export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_GCJ
-
-# Compiler flag to generate shared objects directly from archives.
-whole_archive_flag_spec=$lt_whole_archive_flag_spec_GCJ
-
-# Compiler flag to generate thread-safe objects.
-thread_safe_flag_spec=$lt_thread_safe_flag_spec_GCJ
-
-# Library versioning type.
-version_type=$version_type
-
-# Format of library name prefix.
-libname_spec=$lt_libname_spec
-
-# List of archive names. First name is the real one, the rest are links.
-# The last name is the one that the linker finds with -lNAME.
-library_names_spec=$lt_library_names_spec
-
-# The coded name of the library, if different from the real name.
-soname_spec=$lt_soname_spec
-
-# Commands used to build and install an old-style archive.
-RANLIB=$lt_RANLIB
-old_archive_cmds=$lt_old_archive_cmds_GCJ
-old_postinstall_cmds=$lt_old_postinstall_cmds
-old_postuninstall_cmds=$lt_old_postuninstall_cmds
-
-# Create an old-style archive from a shared archive.
-old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_GCJ
-
-# Create a temporary old-style archive to link instead of a shared archive.
-old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_GCJ
-
-# Commands used to build and install a shared archive.
-archive_cmds=$lt_archive_cmds_GCJ
-archive_expsym_cmds=$lt_archive_expsym_cmds_GCJ
-postinstall_cmds=$lt_postinstall_cmds
-postuninstall_cmds=$lt_postuninstall_cmds
-
-# Commands used to build a loadable module (assumed same as above if empty)
-module_cmds=$lt_module_cmds_GCJ
-module_expsym_cmds=$lt_module_expsym_cmds_GCJ
-
-# Commands to strip libraries.
-old_striplib=$lt_old_striplib
-striplib=$lt_striplib
-
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predep_objects=$lt_predep_objects_GCJ
-
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdep_objects=$lt_postdep_objects_GCJ
-
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predeps=$lt_predeps_GCJ
-
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdeps=$lt_postdeps_GCJ
-
-# The library search path used internally by the compiler when linking
-# a shared library.
-compiler_lib_search_path=$lt_compiler_lib_search_path_GCJ
-
-# Method to check whether dependent libraries are shared objects.
-deplibs_check_method=$lt_deplibs_check_method
-
-# Command to use when deplibs_check_method == file_magic.
-file_magic_cmd=$lt_file_magic_cmd
-
-# Flag that allows shared libraries with undefined symbols to be built.
-allow_undefined_flag=$lt_allow_undefined_flag_GCJ
-
-# Flag that forces no undefined symbols.
-no_undefined_flag=$lt_no_undefined_flag_GCJ
-
-# Commands used to finish a libtool library installation in a directory.
-finish_cmds=$lt_finish_cmds
-
-# Same as above, but a single script fragment to be evaled but not shown.
-finish_eval=$lt_finish_eval
-
-# Take the output of nm and produce a listing of raw symbols and C names.
-global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
-
-# Transform the output of nm in a proper C declaration
-global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
-
-# Transform the output of nm in a C name address pair
-global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
-
-# This is the shared library runtime path variable.
-runpath_var=$runpath_var
-
-# This is the shared library path variable.
-shlibpath_var=$shlibpath_var
-
-# Is shlibpath searched before the hard-coded library search path?
-shlibpath_overrides_runpath=$shlibpath_overrides_runpath
-
-# How to hardcode a shared library path into an executable.
-hardcode_action=$hardcode_action_GCJ
-
-# Whether we should hardcode library paths into libraries.
-hardcode_into_libs=$hardcode_into_libs
-
-# Flag to hardcode \$libdir into a binary during linking.
-# This must work even if \$libdir does not exist.
-hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_GCJ
-
-# If ld is used when linking, flag to hardcode \$libdir into
-# a binary during linking. This must work even if \$libdir does
-# not exist.
-hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_GCJ
-
-# Whether we need a single -rpath flag with a separated argument.
-hardcode_libdir_separator=$lt_hardcode_libdir_separator_GCJ
-
-# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
-# resulting binary.
-hardcode_direct=$hardcode_direct_GCJ
-
-# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
-# resulting binary.
-hardcode_minus_L=$hardcode_minus_L_GCJ
-
-# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
-# the resulting binary.
-hardcode_shlibpath_var=$hardcode_shlibpath_var_GCJ
-
-# Set to yes if building a shared library automatically hardcodes DIR into the library
-# and all subsequent libraries and executables linked against it.
-hardcode_automatic=$hardcode_automatic_GCJ
-
-# Variables whose values should be saved in libtool wrapper scripts and
-# restored at relink time.
-variables_saved_for_relink="$variables_saved_for_relink"
-
-# Whether libtool must link a program against all its dependency libraries.
-link_all_deplibs=$link_all_deplibs_GCJ
-
-# Compile-time system search path for libraries
-sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
-
-# Run-time system search path for libraries
-sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
-
-# Fix the shell variable \$srcfile for the compiler.
-fix_srcfile_path="$fix_srcfile_path_GCJ"
-
-# Set to yes if exported symbols are required.
-always_export_symbols=$always_export_symbols_GCJ
-
-# The commands to list exported symbols.
-export_symbols_cmds=$lt_export_symbols_cmds_GCJ
-
-# The commands to extract the exported symbol list from a shared archive.
-extract_expsyms_cmds=$lt_extract_expsyms_cmds
-
-# Symbols that should not be listed in the preloaded symbols.
-exclude_expsyms=$lt_exclude_expsyms_GCJ
-
-# Symbols that must always be exported.
-include_expsyms=$lt_include_expsyms_GCJ
-
-# ### END LIBTOOL TAG CONFIG: $tagname
-
-__EOF__
-
-
-else
- # If there is no Makefile yet, we rely on a make rule to execute
- # `config.status --recheck' to rerun these tests and create the
- # libtool script then.
- ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
- if test -f "$ltmain_in"; then
- test -f Makefile && make "$ltmain"
- fi
-fi
-
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-CC="$lt_save_CC"
-
- else
- tagname=""
- fi
- ;;
-
- RC)
- ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
-# Source file extension for RC test sources.
-ac_ext=rc
-
-# Object file extension for compiled RC test sources.
-objext=o
-objext_RC=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n'
-
-# Code to be used in simple link tests
-lt_simple_link_test_code="$lt_simple_compile_test_code"
-
-# ltmain only uses $CC for tagged configurations so make sure $CC is set.
-
-# If no C compiler was specified, use CC.
-LTCC=${LTCC-"$CC"}
-
-# If no C compiler flags were specified, use CFLAGS.
-LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
-
-# Allow CC to be a program name with arguments.
-compiler=$CC
-
-
-# save warnings/boilerplate of simple test code
-ac_outfile=conftest.$ac_objext
-printf "$lt_simple_compile_test_code" >conftest.$ac_ext
-eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_compiler_boilerplate=`cat conftest.err`
-$rm conftest*
-
-ac_outfile=conftest.$ac_objext
-printf "$lt_simple_link_test_code" >conftest.$ac_ext
-eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_linker_boilerplate=`cat conftest.err`
-$rm conftest*
-
-
-# Allow CC to be a program name with arguments.
-lt_save_CC="$CC"
-CC=${RC-"windres"}
-compiler=$CC
-compiler_RC=$CC
-for cc_temp in $compiler""; do
- case $cc_temp in
- compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
- distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
- \-*) ;;
- *) break;;
- esac
-done
-cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
-
-lt_cv_prog_compiler_c_o_RC=yes
-
-# The else clause should only fire when bootstrapping the
-# libtool distribution, otherwise you forgot to ship ltmain.sh
-# with your package, and you will get complaints that there are
-# no rules to generate ltmain.sh.
-if test -f "$ltmain"; then
- # See if we are running on zsh, and set the options which allow our commands through
- # without removal of \ escapes.
- if test -n "${ZSH_VERSION+set}" ; then
- setopt NO_GLOB_SUBST
- fi
- # Now quote all the things that may contain metacharacters while being
- # careful not to overquote the AC_SUBSTed values. We take copies of the
- # variables and quote the copies for generation of the libtool script.
- for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \
- SED SHELL STRIP \
- libname_spec library_names_spec soname_spec extract_expsyms_cmds \
- old_striplib striplib file_magic_cmd finish_cmds finish_eval \
- deplibs_check_method reload_flag reload_cmds need_locks \
- lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
- lt_cv_sys_global_symbol_to_c_name_address \
- sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
- old_postinstall_cmds old_postuninstall_cmds \
- compiler_RC \
- CC_RC \
- LD_RC \
- lt_prog_compiler_wl_RC \
- lt_prog_compiler_pic_RC \
- lt_prog_compiler_static_RC \
- lt_prog_compiler_no_builtin_flag_RC \
- export_dynamic_flag_spec_RC \
- thread_safe_flag_spec_RC \
- whole_archive_flag_spec_RC \
- enable_shared_with_static_runtimes_RC \
- old_archive_cmds_RC \
- old_archive_from_new_cmds_RC \
- predep_objects_RC \
- postdep_objects_RC \
- predeps_RC \
- postdeps_RC \
- compiler_lib_search_path_RC \
- archive_cmds_RC \
- archive_expsym_cmds_RC \
- postinstall_cmds_RC \
- postuninstall_cmds_RC \
- old_archive_from_expsyms_cmds_RC \
- allow_undefined_flag_RC \
- no_undefined_flag_RC \
- export_symbols_cmds_RC \
- hardcode_libdir_flag_spec_RC \
- hardcode_libdir_flag_spec_ld_RC \
- hardcode_libdir_separator_RC \
- hardcode_automatic_RC \
- module_cmds_RC \
- module_expsym_cmds_RC \
- lt_cv_prog_compiler_c_o_RC \
- exclude_expsyms_RC \
- include_expsyms_RC; do
-
- case $var in
- old_archive_cmds_RC | \
- old_archive_from_new_cmds_RC | \
- archive_cmds_RC | \
- archive_expsym_cmds_RC | \
- module_cmds_RC | \
- module_expsym_cmds_RC | \
- old_archive_from_expsyms_cmds_RC | \
- export_symbols_cmds_RC | \
- extract_expsyms_cmds | reload_cmds | finish_cmds | \
- postinstall_cmds | postuninstall_cmds | \
- old_postinstall_cmds | old_postuninstall_cmds | \
- sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
- # Double-quote double-evaled strings.
- eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
- ;;
- *)
- eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
- ;;
- esac
- done
-
- case $lt_echo in
- *'\$0 --fallback-echo"')
- lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
- ;;
- esac
-
-cfgfile="$ofile"
-
- cat <<__EOF__ >> "$cfgfile"
-# ### BEGIN LIBTOOL TAG CONFIG: $tagname
-
-# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
-
-# Shell to use when invoking shell scripts.
-SHELL=$lt_SHELL
-
-# Whether or not to build shared libraries.
-build_libtool_libs=$enable_shared
-
-# Whether or not to build static libraries.
-build_old_libs=$enable_static
-
-# Whether or not to add -lc for building shared libraries.
-build_libtool_need_lc=$archive_cmds_need_lc_RC
-
-# Whether or not to disallow shared libs when runtime libs are static
-allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_RC
-
-# Whether or not to optimize for fast installation.
-fast_install=$enable_fast_install
-
-# The host system.
-host_alias=$host_alias
-host=$host
-host_os=$host_os
-
-# The build system.
-build_alias=$build_alias
-build=$build
-build_os=$build_os
-
-# An echo program that does not interpret backslashes.
-echo=$lt_echo
-
-# The archiver.
-AR=$lt_AR
-AR_FLAGS=$lt_AR_FLAGS
-
-# A C compiler.
-LTCC=$lt_LTCC
-
-# LTCC compiler flags.
-LTCFLAGS=$lt_LTCFLAGS
-
-# A language-specific compiler.
-CC=$lt_compiler_RC
-
-# Is the compiler the GNU C compiler?
-with_gcc=$GCC_RC
-
-# An ERE matcher.
-EGREP=$lt_EGREP
-
-# The linker used to build libraries.
-LD=$lt_LD_RC
-
-# Whether we need hard or soft links.
-LN_S=$lt_LN_S
-
-# A BSD-compatible nm program.
-NM=$lt_NM
-
-# A symbol stripping program
-STRIP=$lt_STRIP
-
-# Used to examine libraries when file_magic_cmd begins "file"
-MAGIC_CMD=$MAGIC_CMD
-
-# Used on cygwin: DLL creation program.
-DLLTOOL="$DLLTOOL"
-
-# Used on cygwin: object dumper.
-OBJDUMP="$OBJDUMP"
-
-# Used on cygwin: assembler.
-AS="$AS"
-
-# The name of the directory that contains temporary libtool files.
-objdir=$objdir
-
-# How to create reloadable object files.
-reload_flag=$lt_reload_flag
-reload_cmds=$lt_reload_cmds
-
-# How to pass a linker flag through the compiler.
-wl=$lt_lt_prog_compiler_wl_RC
-
-# Object file suffix (normally "o").
-objext="$ac_objext"
-
-# Old archive suffix (normally "a").
-libext="$libext"
-
-# Shared library suffix (normally ".so").
-shrext_cmds='$shrext_cmds'
-
-# Executable file suffix (normally "").
-exeext="$exeext"
-
-# Additional compiler flags for building library objects.
-pic_flag=$lt_lt_prog_compiler_pic_RC
-pic_mode=$pic_mode
-
-# What is the maximum length of a command?
-max_cmd_len=$lt_cv_sys_max_cmd_len
-
-# Does compiler simultaneously support -c and -o options?
-compiler_c_o=$lt_lt_cv_prog_compiler_c_o_RC
-
-# Must we lock files when doing compilation?
-need_locks=$lt_need_locks
-
-# Do we need the lib prefix for modules?
-need_lib_prefix=$need_lib_prefix
-
-# Do we need a version for libraries?
-need_version=$need_version
-
-# Whether dlopen is supported.
-dlopen_support=$enable_dlopen
-
-# Whether dlopen of programs is supported.
-dlopen_self=$enable_dlopen_self
-
-# Whether dlopen of statically linked programs is supported.
-dlopen_self_static=$enable_dlopen_self_static
-
-# Compiler flag to prevent dynamic linking.
-link_static_flag=$lt_lt_prog_compiler_static_RC
-
-# Compiler flag to turn off builtin functions.
-no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_RC
-
-# Compiler flag to allow reflexive dlopens.
-export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_RC
-
-# Compiler flag to generate shared objects directly from archives.
-whole_archive_flag_spec=$lt_whole_archive_flag_spec_RC
-
-# Compiler flag to generate thread-safe objects.
-thread_safe_flag_spec=$lt_thread_safe_flag_spec_RC
-
-# Library versioning type.
-version_type=$version_type
-
-# Format of library name prefix.
-libname_spec=$lt_libname_spec
-
-# List of archive names. First name is the real one, the rest are links.
-# The last name is the one that the linker finds with -lNAME.
-library_names_spec=$lt_library_names_spec
-
-# The coded name of the library, if different from the real name.
-soname_spec=$lt_soname_spec
-
-# Commands used to build and install an old-style archive.
-RANLIB=$lt_RANLIB
-old_archive_cmds=$lt_old_archive_cmds_RC
-old_postinstall_cmds=$lt_old_postinstall_cmds
-old_postuninstall_cmds=$lt_old_postuninstall_cmds
-
-# Create an old-style archive from a shared archive.
-old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_RC
-
-# Create a temporary old-style archive to link instead of a shared archive.
-old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_RC
-
-# Commands used to build and install a shared archive.
-archive_cmds=$lt_archive_cmds_RC
-archive_expsym_cmds=$lt_archive_expsym_cmds_RC
-postinstall_cmds=$lt_postinstall_cmds
-postuninstall_cmds=$lt_postuninstall_cmds
-
-# Commands used to build a loadable module (assumed same as above if empty)
-module_cmds=$lt_module_cmds_RC
-module_expsym_cmds=$lt_module_expsym_cmds_RC
-
-# Commands to strip libraries.
-old_striplib=$lt_old_striplib
-striplib=$lt_striplib
-
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predep_objects=$lt_predep_objects_RC
-
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdep_objects=$lt_postdep_objects_RC
-
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predeps=$lt_predeps_RC
-
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdeps=$lt_postdeps_RC
-
-# The library search path used internally by the compiler when linking
-# a shared library.
-compiler_lib_search_path=$lt_compiler_lib_search_path_RC
-
-# Method to check whether dependent libraries are shared objects.
-deplibs_check_method=$lt_deplibs_check_method
-
-# Command to use when deplibs_check_method == file_magic.
-file_magic_cmd=$lt_file_magic_cmd
-
-# Flag that allows shared libraries with undefined symbols to be built.
-allow_undefined_flag=$lt_allow_undefined_flag_RC
-
-# Flag that forces no undefined symbols.
-no_undefined_flag=$lt_no_undefined_flag_RC
-
-# Commands used to finish a libtool library installation in a directory.
-finish_cmds=$lt_finish_cmds
-
-# Same as above, but a single script fragment to be evaled but not shown.
-finish_eval=$lt_finish_eval
-
-# Take the output of nm and produce a listing of raw symbols and C names.
-global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
-
-# Transform the output of nm in a proper C declaration
-global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
-
-# Transform the output of nm in a C name address pair
-global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
-
-# This is the shared library runtime path variable.
-runpath_var=$runpath_var
-
-# This is the shared library path variable.
-shlibpath_var=$shlibpath_var
-
-# Is shlibpath searched before the hard-coded library search path?
-shlibpath_overrides_runpath=$shlibpath_overrides_runpath
-
-# How to hardcode a shared library path into an executable.
-hardcode_action=$hardcode_action_RC
-
-# Whether we should hardcode library paths into libraries.
-hardcode_into_libs=$hardcode_into_libs
-
-# Flag to hardcode \$libdir into a binary during linking.
-# This must work even if \$libdir does not exist.
-hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_RC
-
-# If ld is used when linking, flag to hardcode \$libdir into
-# a binary during linking. This must work even if \$libdir does
-# not exist.
-hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_RC
-
-# Whether we need a single -rpath flag with a separated argument.
-hardcode_libdir_separator=$lt_hardcode_libdir_separator_RC
-
-# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
-# resulting binary.
-hardcode_direct=$hardcode_direct_RC
-
-# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
-# resulting binary.
-hardcode_minus_L=$hardcode_minus_L_RC
-
-# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
-# the resulting binary.
-hardcode_shlibpath_var=$hardcode_shlibpath_var_RC
-
-# Set to yes if building a shared library automatically hardcodes DIR into the library
-# and all subsequent libraries and executables linked against it.
-hardcode_automatic=$hardcode_automatic_RC
-
-# Variables whose values should be saved in libtool wrapper scripts and
-# restored at relink time.
-variables_saved_for_relink="$variables_saved_for_relink"
-
-# Whether libtool must link a program against all its dependency libraries.
-link_all_deplibs=$link_all_deplibs_RC
-
-# Compile-time system search path for libraries
-sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
-
-# Run-time system search path for libraries
-sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
-
-# Fix the shell variable \$srcfile for the compiler.
-fix_srcfile_path="$fix_srcfile_path_RC"
-
-# Set to yes if exported symbols are required.
-always_export_symbols=$always_export_symbols_RC
-
-# The commands to list exported symbols.
-export_symbols_cmds=$lt_export_symbols_cmds_RC
-
-# The commands to extract the exported symbol list from a shared archive.
-extract_expsyms_cmds=$lt_extract_expsyms_cmds
-
-# Symbols that should not be listed in the preloaded symbols.
-exclude_expsyms=$lt_exclude_expsyms_RC
-
-# Symbols that must always be exported.
-include_expsyms=$lt_include_expsyms_RC
-
-# ### END LIBTOOL TAG CONFIG: $tagname
-
-__EOF__
-
-
-else
- # If there is no Makefile yet, we rely on a make rule to execute
- # `config.status --recheck' to rerun these tests and create the
- # libtool script then.
- ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
- if test -f "$ltmain_in"; then
- test -f Makefile && make "$ltmain"
- fi
-fi
-
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-CC="$lt_save_CC"
-
- ;;
-
- *)
- { { echo "$as_me:$LINENO: error: Unsupported tag name: $tagname" >&5
-echo "$as_me: error: Unsupported tag name: $tagname" >&2;}
- { (exit 1); exit 1; }; }
- ;;
- esac
-
- # Append the new tag name to the list of available tags.
- if test -n "$tagname" ; then
- available_tags="$available_tags $tagname"
- fi
- fi
- done
- IFS="$lt_save_ifs"
-
- # Now substitute the updated list of available tags.
- if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then
- mv "${ofile}T" "$ofile"
- chmod +x "$ofile"
- else
- rm -f "${ofile}T"
- { { echo "$as_me:$LINENO: error: unable to update list of available tagged configurations." >&5
-echo "$as_me: error: unable to update list of available tagged configurations." >&2;}
- { (exit 1); exit 1; }; }
- fi
-fi
-
-
-
-# This can be used to rebuild libtool when needed
-LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
-
-# Always use our own libtool.
-LIBTOOL='$(SHELL) $(top_builddir)/mklib'
-
-# Prevent multiple expansion
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-if test "$lt_cv_dlopen_self" = "yes" ; then
-
-cat >>confdefs.h <<\_ACEOF
-#define CAN_DLOPEN_SELF 1
-_ACEOF
-
-fi
-
-if test "$WITH_LLVMGCCDIR" = "default" ; then
- LLVMGCC="llvm-gcc${EXEEXT}"
- LLVMGXX="llvm-g++${EXEEXT}"
- # Extract the first word of "$LLVMGCC", so it can be a program name with args.
-set dummy $LLVMGCC; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_path_LLVMGCC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- case $LLVMGCC in
- [\\/]* | ?:[\\/]*)
- ac_cv_path_LLVMGCC="$LLVMGCC" # Let the user override the test with a path.
- ;;
- *)
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_path_LLVMGCC="$as_dir/$ac_word$ac_exec_ext"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
- ;;
-esac
-fi
-LLVMGCC=$ac_cv_path_LLVMGCC
-if test -n "$LLVMGCC"; then
- { echo "$as_me:$LINENO: result: $LLVMGCC" >&5
-echo "${ECHO_T}$LLVMGCC" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-
- # Extract the first word of "$LLVMGXX", so it can be a program name with args.
-set dummy $LLVMGXX; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_path_LLVMGXX+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- case $LLVMGXX in
- [\\/]* | ?:[\\/]*)
- ac_cv_path_LLVMGXX="$LLVMGXX" # Let the user override the test with a path.
- ;;
- *)
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_path_LLVMGXX="$as_dir/$ac_word$ac_exec_ext"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
- ;;
-esac
-fi
-LLVMGXX=$ac_cv_path_LLVMGXX
-if test -n "$LLVMGXX"; then
- { echo "$as_me:$LINENO: result: $LLVMGXX" >&5
-echo "${ECHO_T}$LLVMGXX" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-
-else
- if test -z "$LLVMGCC"; then
- LLVMGCC="$WITH_LLVMGCCDIR/bin/llvm-gcc${EXEEXT}"
- fi
- if test -z "$LLVMGXX"; then
- LLVMGXX="$WITH_LLVMGCCDIR/bin/llvm-g++${EXEEXT}"
- fi
- LLVMGCC=$LLVMGCC
-
- LLVMGXX=$LLVMGXX
-
-fi
-
-{ echo "$as_me:$LINENO: checking tool compatibility" >&5
-echo $ECHO_N "checking tool compatibility... $ECHO_C" >&6; }
-
-ICC=no
-IXX=no
-case $CC in
- icc*|icpc*)
- ICC=yes
- IXX=yes
- ;;
- *)
- ;;
-esac
-
-if test "$GCC" != "yes" && test "$ICC" != "yes"
-then
- { { echo "$as_me:$LINENO: error: gcc|icc required but not found" >&5
-echo "$as_me: error: gcc|icc required but not found" >&2;}
- { (exit 1); exit 1; }; }
-fi
-
-if test "$GXX" != "yes" && test "$IXX" != "yes"
-then
- { { echo "$as_me:$LINENO: error: g++|icc required but not found" >&5
-echo "$as_me: error: g++|icc required but not found" >&2;}
- { (exit 1); exit 1; }; }
-fi
-
-if test "$GCC" = "yes"
-then
- cat >conftest.$ac_ext <<_ACEOF
-#if !defined(__GNUC__) || __GNUC__ < 3
-#error Unsupported GCC version
-#endif
-
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- :
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- { { echo "$as_me:$LINENO: error: gcc 3.x required, but you have a lower version" >&5
-echo "$as_me: error: gcc 3.x required, but you have a lower version" >&2;}
- { (exit 1); exit 1; }; }
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-if test -z "$llvm_cv_gnu_make_command"
-then
- { { echo "$as_me:$LINENO: error: GNU Make required but not found" >&5
-echo "$as_me: error: GNU Make required but not found" >&2;}
- { (exit 1); exit 1; }; }
-fi
-
-{ echo "$as_me:$LINENO: result: ok" >&5
-echo "${ECHO_T}ok" >&6; }
-
-
-
-{ echo "$as_me:$LINENO: checking for elf_begin in -lelf" >&5
-echo $ECHO_N "checking for elf_begin in -lelf... $ECHO_C" >&6; }
-if test "${ac_cv_lib_elf_elf_begin+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lelf $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char elf_begin ();
-int
-main ()
-{
-return elf_begin ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_lib_elf_elf_begin=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_lib_elf_elf_begin=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_elf_elf_begin" >&5
-echo "${ECHO_T}$ac_cv_lib_elf_elf_begin" >&6; }
-if test $ac_cv_lib_elf_elf_begin = yes; then
- cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBELF 1
-_ACEOF
-
- LIBS="-lelf $LIBS"
-
-fi
-
-
-{ echo "$as_me:$LINENO: checking for sin in -lm" >&5
-echo $ECHO_N "checking for sin in -lm... $ECHO_C" >&6; }
-if test "${ac_cv_lib_m_sin+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lm $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char sin ();
-int
-main ()
-{
-return sin ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_lib_m_sin=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_lib_m_sin=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_m_sin" >&5
-echo "${ECHO_T}$ac_cv_lib_m_sin" >&6; }
-if test $ac_cv_lib_m_sin = yes; then
- cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBM 1
-_ACEOF
-
- LIBS="-lm $LIBS"
-
-fi
-
-if test "$llvm_cv_os_type" = "MingW" ; then
-
-{ echo "$as_me:$LINENO: checking for main in -limagehlp" >&5
-echo $ECHO_N "checking for main in -limagehlp... $ECHO_C" >&6; }
-if test "${ac_cv_lib_imagehlp_main+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-limagehlp $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-
-int
-main ()
-{
-return main ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_lib_imagehlp_main=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_lib_imagehlp_main=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_imagehlp_main" >&5
-echo "${ECHO_T}$ac_cv_lib_imagehlp_main" >&6; }
-if test $ac_cv_lib_imagehlp_main = yes; then
- cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBIMAGEHLP 1
-_ACEOF
-
- LIBS="-limagehlp $LIBS"
-
-fi
-
-
-{ echo "$as_me:$LINENO: checking for main in -lpsapi" >&5
-echo $ECHO_N "checking for main in -lpsapi... $ECHO_C" >&6; }
-if test "${ac_cv_lib_psapi_main+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lpsapi $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-
-int
-main ()
-{
-return main ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_lib_psapi_main=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_lib_psapi_main=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_psapi_main" >&5
-echo "${ECHO_T}$ac_cv_lib_psapi_main" >&6; }
-if test $ac_cv_lib_psapi_main = yes; then
- cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBPSAPI 1
-_ACEOF
-
- LIBS="-lpsapi $LIBS"
-
-fi
-
-fi
-
-{ echo "$as_me:$LINENO: checking for library containing dlopen" >&5
-echo $ECHO_N "checking for library containing dlopen... $ECHO_C" >&6; }
-if test "${ac_cv_search_dlopen+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_func_search_save_LIBS=$LIBS
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char dlopen ();
-int
-main ()
-{
-return dlopen ();
- ;
- return 0;
-}
-_ACEOF
-for ac_lib in '' dl; do
- if test -z "$ac_lib"; then
- ac_res="none required"
- else
- ac_res=-l$ac_lib
- LIBS="-l$ac_lib $ac_func_search_save_LIBS"
- fi
- rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_search_dlopen=$ac_res
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
-fi
-
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext
- if test "${ac_cv_search_dlopen+set}" = set; then
- break
-fi
-done
-if test "${ac_cv_search_dlopen+set}" = set; then
- :
-else
- ac_cv_search_dlopen=no
-fi
-rm conftest.$ac_ext
-LIBS=$ac_func_search_save_LIBS
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_search_dlopen" >&5
-echo "${ECHO_T}$ac_cv_search_dlopen" >&6; }
-ac_res=$ac_cv_search_dlopen
-if test "$ac_res" != no; then
- test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_DLOPEN 1
-_ACEOF
-
-else
- { echo "$as_me:$LINENO: WARNING: dlopen() not found - disabling plugin support" >&5
-echo "$as_me: WARNING: dlopen() not found - disabling plugin support" >&2;}
-fi
-
-
-{ echo "$as_me:$LINENO: checking for library containing mallinfo" >&5
-echo $ECHO_N "checking for library containing mallinfo... $ECHO_C" >&6; }
-if test "${ac_cv_search_mallinfo+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_func_search_save_LIBS=$LIBS
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char mallinfo ();
-int
-main ()
-{
-return mallinfo ();
- ;
- return 0;
-}
-_ACEOF
-for ac_lib in '' malloc; do
- if test -z "$ac_lib"; then
- ac_res="none required"
- else
- ac_res=-l$ac_lib
- LIBS="-l$ac_lib $ac_func_search_save_LIBS"
- fi
- rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_search_mallinfo=$ac_res
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
-fi
-
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext
- if test "${ac_cv_search_mallinfo+set}" = set; then
- break
-fi
-done
-if test "${ac_cv_search_mallinfo+set}" = set; then
- :
-else
- ac_cv_search_mallinfo=no
-fi
-rm conftest.$ac_ext
-LIBS=$ac_func_search_save_LIBS
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_search_mallinfo" >&5
-echo "${ECHO_T}$ac_cv_search_mallinfo" >&6; }
-ac_res=$ac_cv_search_mallinfo
-if test "$ac_res" != no; then
- test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_MALLINFO 1
-_ACEOF
-
-fi
-
-
-if test "$ENABLE_THREADS" -eq 1 ; then
-
-{ echo "$as_me:$LINENO: checking for pthread_mutex_init in -lpthread" >&5
-echo $ECHO_N "checking for pthread_mutex_init in -lpthread... $ECHO_C" >&6; }
-if test "${ac_cv_lib_pthread_pthread_mutex_init+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lpthread $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char pthread_mutex_init ();
-int
-main ()
-{
-return pthread_mutex_init ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_lib_pthread_pthread_mutex_init=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_lib_pthread_pthread_mutex_init=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_pthread_mutex_init" >&5
-echo "${ECHO_T}$ac_cv_lib_pthread_pthread_mutex_init" >&6; }
-if test $ac_cv_lib_pthread_pthread_mutex_init = yes; then
- cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBPTHREAD 1
-_ACEOF
-
- LIBS="-lpthread $LIBS"
-
-fi
-
- { echo "$as_me:$LINENO: checking for library containing pthread_mutex_lock" >&5
-echo $ECHO_N "checking for library containing pthread_mutex_lock... $ECHO_C" >&6; }
-if test "${ac_cv_search_pthread_mutex_lock+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_func_search_save_LIBS=$LIBS
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char pthread_mutex_lock ();
-int
-main ()
-{
-return pthread_mutex_lock ();
- ;
- return 0;
-}
-_ACEOF
-for ac_lib in '' pthread; do
- if test -z "$ac_lib"; then
- ac_res="none required"
- else
- ac_res=-l$ac_lib
- LIBS="-l$ac_lib $ac_func_search_save_LIBS"
- fi
- rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_search_pthread_mutex_lock=$ac_res
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
-fi
-
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext
- if test "${ac_cv_search_pthread_mutex_lock+set}" = set; then
- break
-fi
-done
-if test "${ac_cv_search_pthread_mutex_lock+set}" = set; then
- :
-else
- ac_cv_search_pthread_mutex_lock=no
-fi
-rm conftest.$ac_ext
-LIBS=$ac_func_search_save_LIBS
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_search_pthread_mutex_lock" >&5
-echo "${ECHO_T}$ac_cv_search_pthread_mutex_lock" >&6; }
-ac_res=$ac_cv_search_pthread_mutex_lock
-if test "$ac_res" != no; then
- test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_PTHREAD_MUTEX_LOCK 1
-_ACEOF
-
-fi
-
-fi
-
-
-# Check whether --with-udis86 was given.
-if test "${with_udis86+set}" = set; then
- withval=$with_udis86;
- USE_UDIS86=1
-
- case "$withval" in
- /usr/lib|yes) ;;
- *) LDFLAGS="$LDFLAGS -L${withval}" ;;
- esac
-
-{ echo "$as_me:$LINENO: checking for ud_init in -ludis86" >&5
-echo $ECHO_N "checking for ud_init in -ludis86... $ECHO_C" >&6; }
-if test "${ac_cv_lib_udis86_ud_init+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-ludis86 $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char ud_init ();
-int
-main ()
-{
-return ud_init ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_lib_udis86_ud_init=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_lib_udis86_ud_init=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_udis86_ud_init" >&5
-echo "${ECHO_T}$ac_cv_lib_udis86_ud_init" >&6; }
-if test $ac_cv_lib_udis86_ud_init = yes; then
- cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBUDIS86 1
-_ACEOF
-
- LIBS="-ludis86 $LIBS"
-
-else
-
- echo "Error! You need to have libudis86 around."
- exit -1
-
-fi
-
-
-else
- USE_UDIS86=0
-
-fi
-
-
-cat >>confdefs.h <<_ACEOF
-#define USE_UDIS86 $USE_UDIS86
-_ACEOF
-
-
-
-
-
-
-
-
-ac_header_dirent=no
-for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do
- as_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_hdr that defines DIR" >&5
-echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <sys/types.h>
-#include <$ac_hdr>
-
-int
-main ()
-{
-if ((DIR *) 0)
-return 0;
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- eval "$as_ac_Header=yes"
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- eval "$as_ac_Header=no"
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_hdr" | $as_tr_cpp` 1
-_ACEOF
-
-ac_header_dirent=$ac_hdr; break
-fi
-
-done
-# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
-if test $ac_header_dirent = dirent.h; then
- { echo "$as_me:$LINENO: checking for library containing opendir" >&5
-echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6; }
-if test "${ac_cv_search_opendir+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_func_search_save_LIBS=$LIBS
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char opendir ();
-int
-main ()
-{
-return opendir ();
- ;
- return 0;
-}
-_ACEOF
-for ac_lib in '' dir; do
- if test -z "$ac_lib"; then
- ac_res="none required"
- else
- ac_res=-l$ac_lib
- LIBS="-l$ac_lib $ac_func_search_save_LIBS"
- fi
- rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_search_opendir=$ac_res
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
-fi
-
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext
- if test "${ac_cv_search_opendir+set}" = set; then
- break
-fi
-done
-if test "${ac_cv_search_opendir+set}" = set; then
- :
-else
- ac_cv_search_opendir=no
-fi
-rm conftest.$ac_ext
-LIBS=$ac_func_search_save_LIBS
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5
-echo "${ECHO_T}$ac_cv_search_opendir" >&6; }
-ac_res=$ac_cv_search_opendir
-if test "$ac_res" != no; then
- test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
-
-fi
-
-else
- { echo "$as_me:$LINENO: checking for library containing opendir" >&5
-echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6; }
-if test "${ac_cv_search_opendir+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_func_search_save_LIBS=$LIBS
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char opendir ();
-int
-main ()
-{
-return opendir ();
- ;
- return 0;
-}
-_ACEOF
-for ac_lib in '' x; do
- if test -z "$ac_lib"; then
- ac_res="none required"
- else
- ac_res=-l$ac_lib
- LIBS="-l$ac_lib $ac_func_search_save_LIBS"
- fi
- rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_search_opendir=$ac_res
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
-fi
-
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext
- if test "${ac_cv_search_opendir+set}" = set; then
- break
-fi
-done
-if test "${ac_cv_search_opendir+set}" = set; then
- :
-else
- ac_cv_search_opendir=no
-fi
-rm conftest.$ac_ext
-LIBS=$ac_func_search_save_LIBS
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5
-echo "${ECHO_T}$ac_cv_search_opendir" >&6; }
-ac_res=$ac_cv_search_opendir
-if test "$ac_res" != no; then
- test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
-
-fi
-
-fi
-
-{ echo "$as_me:$LINENO: checking for MAP_ANONYMOUS vs. MAP_ANON" >&5
-echo $ECHO_N "checking for MAP_ANONYMOUS vs. MAP_ANON... $ECHO_C" >&6; }
-if test "${ac_cv_header_mmap_anon+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <sys/mman.h>
-#include <unistd.h>
-#include <fcntl.h>
-int
-main ()
-{
-mmap (0, 1, PROT_READ, MAP_ANONYMOUS, -1, 0); return (0);
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_header_mmap_anon=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_header_mmap_anon=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_mmap_anon" >&5
-echo "${ECHO_T}$ac_cv_header_mmap_anon" >&6; }
-if test "$ac_cv_header_mmap_anon" = yes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_MMAP_ANONYMOUS 1
-_ACEOF
-
-fi
-
-{ echo "$as_me:$LINENO: checking whether stat file-mode macros are broken" >&5
-echo $ECHO_N "checking whether stat file-mode macros are broken... $ECHO_C" >&6; }
-if test "${ac_cv_header_stat_broken+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <sys/types.h>
-#include <sys/stat.h>
-
-#if defined S_ISBLK && defined S_IFDIR
-# if S_ISBLK (S_IFDIR)
-You lose.
-# endif
-#endif
-
-#if defined S_ISBLK && defined S_IFCHR
-# if S_ISBLK (S_IFCHR)
-You lose.
-# endif
-#endif
-
-#if defined S_ISLNK && defined S_IFREG
-# if S_ISLNK (S_IFREG)
-You lose.
-# endif
-#endif
-
-#if defined S_ISSOCK && defined S_IFREG
-# if S_ISSOCK (S_IFREG)
-You lose.
-# endif
-#endif
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "You lose" >/dev/null 2>&1; then
- ac_cv_header_stat_broken=yes
-else
- ac_cv_header_stat_broken=no
-fi
-rm -f conftest*
-
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_stat_broken" >&5
-echo "${ECHO_T}$ac_cv_header_stat_broken" >&6; }
-if test $ac_cv_header_stat_broken = yes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define STAT_MACROS_BROKEN 1
-_ACEOF
-
-fi
-
-{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5
-echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; }
-if test "${ac_cv_header_stdc+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <stdlib.h>
-#include <stdarg.h>
-#include <string.h>
-#include <float.h>
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_header_stdc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_header_stdc=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-if test $ac_cv_header_stdc = yes; then
- # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <string.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "memchr" >/dev/null 2>&1; then
- :
-else
- ac_cv_header_stdc=no
-fi
-rm -f conftest*
-
-fi
-
-if test $ac_cv_header_stdc = yes; then
- # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <stdlib.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "free" >/dev/null 2>&1; then
- :
-else
- ac_cv_header_stdc=no
-fi
-rm -f conftest*
-
-fi
-
-if test $ac_cv_header_stdc = yes; then
- # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
- if test "$cross_compiling" = yes; then
- :
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <ctype.h>
-#include <stdlib.h>
-#if ((' ' & 0x0FF) == 0x020)
-# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
-# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
-#else
-# define ISLOWER(c) \
- (('a' <= (c) && (c) <= 'i') \
- || ('j' <= (c) && (c) <= 'r') \
- || ('s' <= (c) && (c) <= 'z'))
-# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
-#endif
-
-#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
-int
-main ()
-{
- int i;
- for (i = 0; i < 256; i++)
- if (XOR (islower (i), ISLOWER (i))
- || toupper (i) != TOUPPER (i))
- return 2;
- return 0;
-}
-_ACEOF
-rm -f conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- :
-else
- echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-( exit $ac_status )
-ac_cv_header_stdc=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-
-
-fi
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
-echo "${ECHO_T}$ac_cv_header_stdc" >&6; }
-if test $ac_cv_header_stdc = yes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define STDC_HEADERS 1
-_ACEOF
-
-fi
-
-{ echo "$as_me:$LINENO: checking for sys/wait.h that is POSIX.1 compatible" >&5
-echo $ECHO_N "checking for sys/wait.h that is POSIX.1 compatible... $ECHO_C" >&6; }
-if test "${ac_cv_header_sys_wait_h+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <sys/types.h>
-#include <sys/wait.h>
-#ifndef WEXITSTATUS
-# define WEXITSTATUS(stat_val) ((unsigned int) (stat_val) >> 8)
-#endif
-#ifndef WIFEXITED
-# define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
-#endif
-
-int
-main ()
-{
- int s;
- wait (&s);
- s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_header_sys_wait_h=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_header_sys_wait_h=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_sys_wait_h" >&5
-echo "${ECHO_T}$ac_cv_header_sys_wait_h" >&6; }
-if test $ac_cv_header_sys_wait_h = yes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_SYS_WAIT_H 1
-_ACEOF
-
-fi
-
-{ echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5
-echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6; }
-if test "${ac_cv_header_time+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <sys/types.h>
-#include <sys/time.h>
-#include <time.h>
-
-int
-main ()
-{
-if ((struct tm *) 0)
-return 0;
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_header_time=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_header_time=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5
-echo "${ECHO_T}$ac_cv_header_time" >&6; }
-if test $ac_cv_header_time = yes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define TIME_WITH_SYS_TIME 1
-_ACEOF
-
-fi
-
-
-
-
-
-
-
-
-for ac_header in dlfcn.h execinfo.h fcntl.h inttypes.h limits.h link.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- { echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-else
- # Is the header compilable?
-{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_header_compiler=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <$ac_header>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_c_preproc_warn_flag
- ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
- else
- ac_cpp_err=
- fi
-else
- ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
- ac_header_preproc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
- yes:no: )
- { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
- ac_header_preproc=yes
- ;;
- no:yes:* )
- { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
- ( cat <<\_ASBOX
-## ----------------------------------- ##
-## Report this to llvmbugs@cs.uiuc.edu ##
-## ----------------------------------- ##
-_ASBOX
- ) | sed "s/^/$as_me: WARNING: /" >&2
- ;;
-esac
-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- eval "$as_ac_Header=\$ac_header_preproc"
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-
-
-
-
-
-
-for ac_header in malloc.h setjmp.h signal.h stdint.h unistd.h utime.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- { echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-else
- # Is the header compilable?
-{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_header_compiler=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <$ac_header>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_c_preproc_warn_flag
- ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
- else
- ac_cpp_err=
- fi
-else
- ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
- ac_header_preproc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
- yes:no: )
- { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
- ac_header_preproc=yes
- ;;
- no:yes:* )
- { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
- ( cat <<\_ASBOX
-## ----------------------------------- ##
-## Report this to llvmbugs@cs.uiuc.edu ##
-## ----------------------------------- ##
-_ASBOX
- ) | sed "s/^/$as_me: WARNING: /" >&2
- ;;
-esac
-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- eval "$as_ac_Header=\$ac_header_preproc"
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-
-for ac_header in windows.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- { echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-else
- # Is the header compilable?
-{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_header_compiler=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <$ac_header>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_c_preproc_warn_flag
- ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
- else
- ac_cpp_err=
- fi
-else
- ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
- ac_header_preproc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
- yes:no: )
- { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
- ac_header_preproc=yes
- ;;
- no:yes:* )
- { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
- ( cat <<\_ASBOX
-## ----------------------------------- ##
-## Report this to llvmbugs@cs.uiuc.edu ##
-## ----------------------------------- ##
-_ASBOX
- ) | sed "s/^/$as_me: WARNING: /" >&2
- ;;
-esac
-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- eval "$as_ac_Header=\$ac_header_preproc"
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-
-
-
-
-for ac_header in sys/mman.h sys/param.h sys/resource.h sys/time.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- { echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-else
- # Is the header compilable?
-{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_header_compiler=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <$ac_header>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_c_preproc_warn_flag
- ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
- else
- ac_cpp_err=
- fi
-else
- ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
- ac_header_preproc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
- yes:no: )
- { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
- ac_header_preproc=yes
- ;;
- no:yes:* )
- { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
- ( cat <<\_ASBOX
-## ----------------------------------- ##
-## Report this to llvmbugs@cs.uiuc.edu ##
-## ----------------------------------- ##
-_ASBOX
- ) | sed "s/^/$as_me: WARNING: /" >&2
- ;;
-esac
-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- eval "$as_ac_Header=\$ac_header_preproc"
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-
-
-
-for ac_header in sys/types.h malloc/malloc.h mach/mach.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- { echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-else
- # Is the header compilable?
-{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_header_compiler=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <$ac_header>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_c_preproc_warn_flag
- ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
- else
- ac_cpp_err=
- fi
-else
- ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
- ac_header_preproc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
- yes:no: )
- { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
- ac_header_preproc=yes
- ;;
- no:yes:* )
- { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
- ( cat <<\_ASBOX
-## ----------------------------------- ##
-## Report this to llvmbugs@cs.uiuc.edu ##
-## ----------------------------------- ##
-_ASBOX
- ) | sed "s/^/$as_me: WARNING: /" >&2
- ;;
-esac
-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- eval "$as_ac_Header=\$ac_header_preproc"
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-if test "$ENABLE_THREADS" -eq 1 ; then
-
-for ac_header in pthread.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- { echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-else
- # Is the header compilable?
-{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_header_compiler=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <$ac_header>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_c_preproc_warn_flag
- ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
- else
- ac_cpp_err=
- fi
-else
- ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
- ac_header_preproc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
- yes:no: )
- { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
- ac_header_preproc=yes
- ;;
- no:yes:* )
- { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
- ( cat <<\_ASBOX
-## ----------------------------------- ##
-## Report this to llvmbugs@cs.uiuc.edu ##
-## ----------------------------------- ##
-_ASBOX
- ) | sed "s/^/$as_me: WARNING: /" >&2
- ;;
-esac
-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- eval "$as_ac_Header=\$ac_header_preproc"
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
- HAVE_PTHREAD=1
-
-else
- HAVE_PTHREAD=0
-
-fi
-
-done
-
-else
- HAVE_PTHREAD=0
-
-fi
-
-
-
- { echo "$as_me:$LINENO: checking for HUGE_VAL sanity" >&5
-echo $ECHO_N "checking for HUGE_VAL sanity... $ECHO_C" >&6; }
-if test "${ac_cv_huge_val_sanity+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
- ac_ext=cpp
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-
- CXXFLAGS=-pedantic
- if test "$cross_compiling" = yes; then
- ac_cv_huge_val_sanity=yes
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <math.h>
-int
-main ()
-{
-double x = HUGE_VAL; return x != x;
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_huge_val_sanity=yes
-else
- echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-( exit $ac_status )
-ac_cv_huge_val_sanity=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-
-
- ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_huge_val_sanity" >&5
-echo "${ECHO_T}$ac_cv_huge_val_sanity" >&6; }
- HUGE_VAL_SANITY=$ac_cv_huge_val_sanity
-
-
-{ echo "$as_me:$LINENO: checking for pid_t" >&5
-echo $ECHO_N "checking for pid_t... $ECHO_C" >&6; }
-if test "${ac_cv_type_pid_t+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-typedef pid_t ac__type_new_;
-int
-main ()
-{
-if ((ac__type_new_ *) 0)
- return 0;
-if (sizeof (ac__type_new_))
- return 0;
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_type_pid_t=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_type_pid_t=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_type_pid_t" >&5
-echo "${ECHO_T}$ac_cv_type_pid_t" >&6; }
-if test $ac_cv_type_pid_t = yes; then
- :
-else
-
-cat >>confdefs.h <<_ACEOF
-#define pid_t int
-_ACEOF
-
-fi
-
-{ echo "$as_me:$LINENO: checking for size_t" >&5
-echo $ECHO_N "checking for size_t... $ECHO_C" >&6; }
-if test "${ac_cv_type_size_t+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-typedef size_t ac__type_new_;
-int
-main ()
-{
-if ((ac__type_new_ *) 0)
- return 0;
-if (sizeof (ac__type_new_))
- return 0;
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_type_size_t=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_type_size_t=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5
-echo "${ECHO_T}$ac_cv_type_size_t" >&6; }
-if test $ac_cv_type_size_t = yes; then
- :
-else
-
-cat >>confdefs.h <<_ACEOF
-#define size_t unsigned int
-_ACEOF
-
-fi
-
-{ echo "$as_me:$LINENO: checking return type of signal handlers" >&5
-echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6; }
-if test "${ac_cv_type_signal+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <sys/types.h>
-#include <signal.h>
-
-int
-main ()
-{
-return *(signal (0, 0)) (0) == 1;
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_type_signal=int
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_type_signal=void
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_type_signal" >&5
-echo "${ECHO_T}$ac_cv_type_signal" >&6; }
-
-cat >>confdefs.h <<_ACEOF
-#define RETSIGTYPE $ac_cv_type_signal
-_ACEOF
-
-
-{ echo "$as_me:$LINENO: checking whether struct tm is in sys/time.h or time.h" >&5
-echo $ECHO_N "checking whether struct tm is in sys/time.h or time.h... $ECHO_C" >&6; }
-if test "${ac_cv_struct_tm+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <sys/types.h>
-#include <time.h>
-
-int
-main ()
-{
-struct tm *tp; tp->tm_sec;
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_struct_tm=time.h
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_struct_tm=sys/time.h
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_struct_tm" >&5
-echo "${ECHO_T}$ac_cv_struct_tm" >&6; }
-if test $ac_cv_struct_tm = sys/time.h; then
-
-cat >>confdefs.h <<\_ACEOF
-#define TM_IN_SYS_TIME 1
-_ACEOF
-
-fi
-
-{ echo "$as_me:$LINENO: checking for int64_t" >&5
-echo $ECHO_N "checking for int64_t... $ECHO_C" >&6; }
-if test "${ac_cv_type_int64_t+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-typedef int64_t ac__type_new_;
-int
-main ()
-{
-if ((ac__type_new_ *) 0)
- return 0;
-if (sizeof (ac__type_new_))
- return 0;
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_type_int64_t=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_type_int64_t=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_type_int64_t" >&5
-echo "${ECHO_T}$ac_cv_type_int64_t" >&6; }
-if test $ac_cv_type_int64_t = yes; then
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_INT64_T 1
-_ACEOF
-
-
-else
- { { echo "$as_me:$LINENO: error: Type int64_t required but not found" >&5
-echo "$as_me: error: Type int64_t required but not found" >&2;}
- { (exit 1); exit 1; }; }
-fi
-
-{ echo "$as_me:$LINENO: checking for uint64_t" >&5
-echo $ECHO_N "checking for uint64_t... $ECHO_C" >&6; }
-if test "${ac_cv_type_uint64_t+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-typedef uint64_t ac__type_new_;
-int
-main ()
-{
-if ((ac__type_new_ *) 0)
- return 0;
-if (sizeof (ac__type_new_))
- return 0;
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_type_uint64_t=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_type_uint64_t=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_type_uint64_t" >&5
-echo "${ECHO_T}$ac_cv_type_uint64_t" >&6; }
-if test $ac_cv_type_uint64_t = yes; then
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_UINT64_T 1
-_ACEOF
-
-
-else
- { echo "$as_me:$LINENO: checking for u_int64_t" >&5
-echo $ECHO_N "checking for u_int64_t... $ECHO_C" >&6; }
-if test "${ac_cv_type_u_int64_t+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-typedef u_int64_t ac__type_new_;
-int
-main ()
-{
-if ((ac__type_new_ *) 0)
- return 0;
-if (sizeof (ac__type_new_))
- return 0;
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_type_u_int64_t=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_type_u_int64_t=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_type_u_int64_t" >&5
-echo "${ECHO_T}$ac_cv_type_u_int64_t" >&6; }
-if test $ac_cv_type_u_int64_t = yes; then
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_U_INT64_T 1
-_ACEOF
-
-
-else
- { { echo "$as_me:$LINENO: error: Type uint64_t or u_int64_t required but not found" >&5
-echo "$as_me: error: Type uint64_t or u_int64_t required but not found" >&2;}
- { (exit 1); exit 1; }; }
-fi
-
-fi
-
-
-
-
-
-
-
-
-
-
-for ac_func in backtrace ceilf floorf roundf rintf nearbyintf getcwd
-do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
-if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
- For example, HP-UX 11i <limits.h> declares gettimeofday. */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func (); below.
- Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- <limits.h> exists even on freestanding compilers. */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef $ac_func
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char $ac_func ();
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined __stub_$ac_func || defined __stub___$ac_func
-choke me
-#endif
-
-int
-main ()
-{
-return $ac_func ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- eval "$as_ac_var=yes"
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- eval "$as_ac_var=no"
-fi
-
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-fi
-ac_res=`eval echo '${'$as_ac_var'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_var'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-done
-
-
-
-
-
-for ac_func in powf fmodf strtof round
-do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
-if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
- For example, HP-UX 11i <limits.h> declares gettimeofday. */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func (); below.
- Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- <limits.h> exists even on freestanding compilers. */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef $ac_func
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char $ac_func ();
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined __stub_$ac_func || defined __stub___$ac_func
-choke me
-#endif
-
-int
-main ()
-{
-return $ac_func ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- eval "$as_ac_var=yes"
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- eval "$as_ac_var=no"
-fi
-
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-fi
-ac_res=`eval echo '${'$as_ac_var'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_var'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-done
-
-
-
-
-
-
-for ac_func in getpagesize getrusage getrlimit setrlimit gettimeofday
-do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
-if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
- For example, HP-UX 11i <limits.h> declares gettimeofday. */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func (); below.
- Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- <limits.h> exists even on freestanding compilers. */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef $ac_func
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char $ac_func ();
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined __stub_$ac_func || defined __stub___$ac_func
-choke me
-#endif
-
-int
-main ()
-{
-return $ac_func ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- eval "$as_ac_var=yes"
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- eval "$as_ac_var=no"
-fi
-
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-fi
-ac_res=`eval echo '${'$as_ac_var'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_var'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-done
-
-
-
-
-for ac_func in isatty mkdtemp mkstemp
-do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
-if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
- For example, HP-UX 11i <limits.h> declares gettimeofday. */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func (); below.
- Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- <limits.h> exists even on freestanding compilers. */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef $ac_func
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char $ac_func ();
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined __stub_$ac_func || defined __stub___$ac_func
-choke me
-#endif
-
-int
-main ()
-{
-return $ac_func ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- eval "$as_ac_var=yes"
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- eval "$as_ac_var=no"
-fi
-
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-fi
-ac_res=`eval echo '${'$as_ac_var'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_var'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-done
-
-
-
-
-
-
-
-
-for ac_func in mktemp realpath sbrk setrlimit strdup strerror strerror_r
-do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
-if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
- For example, HP-UX 11i <limits.h> declares gettimeofday. */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func (); below.
- Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- <limits.h> exists even on freestanding compilers. */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef $ac_func
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char $ac_func ();
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined __stub_$ac_func || defined __stub___$ac_func
-choke me
-#endif
-
-int
-main ()
-{
-return $ac_func ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- eval "$as_ac_var=yes"
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- eval "$as_ac_var=no"
-fi
-
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-fi
-ac_res=`eval echo '${'$as_ac_var'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_var'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-done
-
-
-
-
-
-for ac_func in strtoll strtoq sysconf malloc_zone_statistics
-do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
-if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
- For example, HP-UX 11i <limits.h> declares gettimeofday. */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func (); below.
- Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- <limits.h> exists even on freestanding compilers. */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef $ac_func
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char $ac_func ();
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined __stub_$ac_func || defined __stub___$ac_func
-choke me
-#endif
-
-int
-main ()
-{
-return $ac_func ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- eval "$as_ac_var=yes"
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- eval "$as_ac_var=no"
-fi
-
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-fi
-ac_res=`eval echo '${'$as_ac_var'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_var'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-done
-
-
-
-
-
-for ac_func in setjmp longjmp sigsetjmp siglongjmp
-do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
-if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
- For example, HP-UX 11i <limits.h> declares gettimeofday. */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func (); below.
- Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- <limits.h> exists even on freestanding compilers. */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef $ac_func
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char $ac_func ();
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined __stub_$ac_func || defined __stub___$ac_func
-choke me
-#endif
-
-int
-main ()
-{
-return $ac_func ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- eval "$as_ac_var=yes"
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- eval "$as_ac_var=no"
-fi
-
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-fi
-ac_res=`eval echo '${'$as_ac_var'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_var'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-done
-
-{ echo "$as_me:$LINENO: checking if printf has the %a format character" >&5
-echo $ECHO_N "checking if printf has the %a format character... $ECHO_C" >&6; }
-if test "${llvm_cv_c_printf_a+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
- if test "$cross_compiling" = yes; then
- llvmac_cv_c_printf_a=no
-else
- cat >conftest.$ac_ext <<_ACEOF
-
- /* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-#include <stdio.h>
-#include <stdlib.h>
-
-int
-main ()
-{
-
-volatile double A, B;
-char Buffer[100];
-A = 1;
-A /= 10.0;
-sprintf(Buffer, "%a", A);
-B = atof(Buffer);
-if (A != B)
- return (1);
-if (A != 0x1.999999999999ap-4)
- return (1);
-return (0);
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- llvm_cv_c_printf_a=yes
-else
- echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-( exit $ac_status )
-llvmac_cv_c_printf_a=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-
-
- ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-fi
-{ echo "$as_me:$LINENO: result: $llvm_cv_c_printf_a" >&5
-echo "${ECHO_T}$llvm_cv_c_printf_a" >&6; }
- if test "$llvm_cv_c_printf_a" = "yes"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_PRINTF_A 1
-_ACEOF
-
- fi
-
-# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
-# for constant arguments. Useless!
-{ echo "$as_me:$LINENO: checking for working alloca.h" >&5
-echo $ECHO_N "checking for working alloca.h... $ECHO_C" >&6; }
-if test "${ac_cv_working_alloca_h+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <alloca.h>
-int
-main ()
-{
-char *p = (char *) alloca (2 * sizeof (int));
- if (p) return 0;
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_working_alloca_h=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_working_alloca_h=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_working_alloca_h" >&5
-echo "${ECHO_T}$ac_cv_working_alloca_h" >&6; }
-if test $ac_cv_working_alloca_h = yes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_ALLOCA_H 1
-_ACEOF
-
-fi
-
-{ echo "$as_me:$LINENO: checking for alloca" >&5
-echo $ECHO_N "checking for alloca... $ECHO_C" >&6; }
-if test "${ac_cv_func_alloca_works+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#ifdef __GNUC__
-# define alloca __builtin_alloca
-#else
-# ifdef _MSC_VER
-# include <malloc.h>
-# define alloca _alloca
-# else
-# if HAVE_ALLOCA_H
-# include <alloca.h>
-# else
-# ifdef _AIX
- #pragma alloca
-# else
-# ifndef alloca /* predefined by HP cc +Olibcalls */
-char *alloca ();
-# endif
-# endif
-# endif
-# endif
-#endif
-
-int
-main ()
-{
-char *p = (char *) alloca (1);
- if (p) return 0;
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_func_alloca_works=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_func_alloca_works=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_func_alloca_works" >&5
-echo "${ECHO_T}$ac_cv_func_alloca_works" >&6; }
-
-if test $ac_cv_func_alloca_works = yes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_ALLOCA 1
-_ACEOF
-
-else
- # The SVR3 libPW and SVR4 libucb both contain incompatible functions
-# that cause trouble. Some versions do not even contain alloca or
-# contain a buggy version. If you still want to use their alloca,
-# use ar to extract alloca.o from them instead of compiling alloca.c.
-
-ALLOCA=\${LIBOBJDIR}alloca.$ac_objext
-
-cat >>confdefs.h <<\_ACEOF
-#define C_ALLOCA 1
-_ACEOF
-
-
-{ echo "$as_me:$LINENO: checking whether \`alloca.c' needs Cray hooks" >&5
-echo $ECHO_N "checking whether \`alloca.c' needs Cray hooks... $ECHO_C" >&6; }
-if test "${ac_cv_os_cray+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#if defined CRAY && ! defined CRAY2
-webecray
-#else
-wenotbecray
-#endif
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "webecray" >/dev/null 2>&1; then
- ac_cv_os_cray=yes
-else
- ac_cv_os_cray=no
-fi
-rm -f conftest*
-
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_os_cray" >&5
-echo "${ECHO_T}$ac_cv_os_cray" >&6; }
-if test $ac_cv_os_cray = yes; then
- for ac_func in _getb67 GETB67 getb67; do
- as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
-if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
- For example, HP-UX 11i <limits.h> declares gettimeofday. */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func (); below.
- Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- <limits.h> exists even on freestanding compilers. */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef $ac_func
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char $ac_func ();
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined __stub_$ac_func || defined __stub___$ac_func
-choke me
-#endif
-
-int
-main ()
-{
-return $ac_func ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- eval "$as_ac_var=yes"
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- eval "$as_ac_var=no"
-fi
-
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-fi
-ac_res=`eval echo '${'$as_ac_var'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_var'}'` = yes; then
-
-cat >>confdefs.h <<_ACEOF
-#define CRAY_STACKSEG_END $ac_func
-_ACEOF
-
- break
-fi
-
- done
-fi
-
-{ echo "$as_me:$LINENO: checking stack direction for C alloca" >&5
-echo $ECHO_N "checking stack direction for C alloca... $ECHO_C" >&6; }
-if test "${ac_cv_c_stack_direction+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test "$cross_compiling" = yes; then
- ac_cv_c_stack_direction=0
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-int
-find_stack_direction ()
-{
- static char *addr = 0;
- auto char dummy;
- if (addr == 0)
- {
- addr = &dummy;
- return find_stack_direction ();
- }
- else
- return (&dummy > addr) ? 1 : -1;
-}
-
-int
-main ()
-{
- return find_stack_direction () < 0;
-}
-_ACEOF
-rm -f conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_c_stack_direction=1
-else
- echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-( exit $ac_status )
-ac_cv_c_stack_direction=-1
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-
-
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_c_stack_direction" >&5
-echo "${ECHO_T}$ac_cv_c_stack_direction" >&6; }
-
-cat >>confdefs.h <<_ACEOF
-#define STACK_DIRECTION $ac_cv_c_stack_direction
-_ACEOF
-
-
-fi
-
-
-{ echo "$as_me:$LINENO: checking for srand48/lrand48/drand48 in <stdlib.h>" >&5
-echo $ECHO_N "checking for srand48/lrand48/drand48 in <stdlib.h>... $ECHO_C" >&6; }
-if test "${ac_cv_func_rand48+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_ext=cpp
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <stdlib.h>
-int
-main ()
-{
-srand48(0);lrand48();drand48();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_func_rand48=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_func_rand48=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_func_rand48" >&5
-echo "${ECHO_T}$ac_cv_func_rand48" >&6; }
-
-if test "$ac_cv_func_rand48" = "yes" ; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_RAND48 1
-_ACEOF
-
-fi
-
-
-{ echo "$as_me:$LINENO: checking whether the compiler implements namespaces" >&5
-echo $ECHO_N "checking whether the compiler implements namespaces... $ECHO_C" >&6; }
-if test "${ac_cv_cxx_namespaces+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_ext=cpp
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-namespace Outer { namespace Inner { int i = 0; }}
-int
-main ()
-{
-using namespace Outer::Inner; return i;
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_cxx_namespaces=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_cxx_namespaces=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_cxx_namespaces" >&5
-echo "${ECHO_T}$ac_cv_cxx_namespaces" >&6; }
-if test "$ac_cv_cxx_namespaces" = yes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_NAMESPACES
-_ACEOF
-
-fi
-
-{ echo "$as_me:$LINENO: checking whether the compiler has <ext/hash_map> defining template class std::hash_map" >&5
-echo $ECHO_N "checking whether the compiler has <ext/hash_map> defining template class std::hash_map... $ECHO_C" >&6; }
-if test "${ac_cv_cxx_have_std_ext_hash_map+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
- ac_ext=cpp
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <ext/hash_map>
-#ifdef HAVE_NAMESPACES
-using namespace std;
-#endif
-int
-main ()
-{
-hash_map<int, int> t;
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_cxx_have_std_ext_hash_map=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_cxx_have_std_ext_hash_map=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_cxx_have_std_ext_hash_map" >&5
-echo "${ECHO_T}$ac_cv_cxx_have_std_ext_hash_map" >&6; }
- if test "$ac_cv_cxx_have_std_ext_hash_map" = yes
- then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_STD_EXT_HASH_MAP 1
-_ACEOF
-
- else
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_STD_EXT_HASH_MAP 0
-_ACEOF
-
- fi
-
- { echo "$as_me:$LINENO: checking whether the compiler has <ext/hash_map> defining template class __gnu_cxx::hash_map" >&5
-echo $ECHO_N "checking whether the compiler has <ext/hash_map> defining template class __gnu_cxx::hash_map... $ECHO_C" >&6; }
-if test "${ac_cv_cxx_have_gnu_ext_hash_map+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
- ac_ext=cpp
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <ext/hash_map>
-#ifdef HAVE_NAMESPACES
-using namespace __gnu_cxx;
-#endif
-int
-main ()
-{
-hash_map<int,int> t;
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_cxx_have_gnu_ext_hash_map=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_cxx_have_gnu_ext_hash_map=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_cxx_have_gnu_ext_hash_map" >&5
-echo "${ECHO_T}$ac_cv_cxx_have_gnu_ext_hash_map" >&6; }
- if test "$ac_cv_cxx_have_gnu_ext_hash_map" = yes
- then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_GNU_EXT_HASH_MAP 1
-_ACEOF
-
- else
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_GNU_EXT_HASH_MAP 0
-_ACEOF
-
- fi
-
- { echo "$as_me:$LINENO: checking whether the compiler has <hash_map> defining template class ::hash_map" >&5
-echo $ECHO_N "checking whether the compiler has <hash_map> defining template class ::hash_map... $ECHO_C" >&6; }
-if test "${ac_cv_cxx_have_global_hash_map+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
- ac_ext=cpp
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <hash_map>
-int
-main ()
-{
-hash_map<int,int> t;
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_cxx_have_global_hash_map=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_cxx_have_global_hash_map=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_cxx_have_global_hash_map" >&5
-echo "${ECHO_T}$ac_cv_cxx_have_global_hash_map" >&6; }
- if test "$ac_cv_cxx_have_global_hash_map" = yes
- then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_GLOBAL_HASH_MAP 1
-_ACEOF
-
- else
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_GLOBAL_HASH_MAP 0
-_ACEOF
-
- fi
-
-{ echo "$as_me:$LINENO: checking whether the compiler has <ext/hash_set> defining template class std::hash_set" >&5
-echo $ECHO_N "checking whether the compiler has <ext/hash_set> defining template class std::hash_set... $ECHO_C" >&6; }
-if test "${ac_cv_cxx_have_std_ext_hash_set+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
- ac_ext=cpp
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <ext/hash_set>
-#ifdef HAVE_NAMESPACES
-using namespace std;
-#endif
-int
-main ()
-{
-hash_set<int> t;
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_cxx_have_std_ext_hash_set=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_cxx_have_std_ext_hash_set=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_cxx_have_std_ext_hash_set" >&5
-echo "${ECHO_T}$ac_cv_cxx_have_std_ext_hash_set" >&6; }
- if test "$ac_cv_cxx_have_std_ext_hash_set" = yes
- then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_STD_EXT_HASH_SET 1
-_ACEOF
-
- else
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_STD_EXT_HASH_SET 0
-_ACEOF
-
- fi
-
- { echo "$as_me:$LINENO: checking whether the compiler has <ext/hash_set> defining template class __gnu_cxx::hash_set" >&5
-echo $ECHO_N "checking whether the compiler has <ext/hash_set> defining template class __gnu_cxx::hash_set... $ECHO_C" >&6; }
-if test "${ac_cv_cxx_have_gnu_ext_hash_set+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
- ac_ext=cpp
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <ext/hash_set>
-#ifdef HAVE_NAMESPACES
-using namespace __gnu_cxx;
-#endif
-int
-main ()
-{
-hash_set<int> t;
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_cxx_have_gnu_ext_hash_set=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_cxx_have_gnu_ext_hash_set=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_cxx_have_gnu_ext_hash_set" >&5
-echo "${ECHO_T}$ac_cv_cxx_have_gnu_ext_hash_set" >&6; }
- if test "$ac_cv_cxx_have_gnu_ext_hash_set" = yes
- then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_GNU_EXT_HASH_SET 1
-_ACEOF
-
- else
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_GNU_EXT_HASH_SET 0
-_ACEOF
-
- fi
-
- { echo "$as_me:$LINENO: checking whether the compiler has <hash_set> defining template class ::hash_set" >&5
-echo $ECHO_N "checking whether the compiler has <hash_set> defining template class ::hash_set... $ECHO_C" >&6; }
-if test "${ac_cv_cxx_have_global_hash_set+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
- ac_ext=cpp
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <hash_set>
-int
-main ()
-{
-hash_set<int> t; return 0;
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_cxx_have_global_hash_set=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_cxx_have_global_hash_set=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_cxx_have_global_hash_set" >&5
-echo "${ECHO_T}$ac_cv_cxx_have_global_hash_set" >&6; }
- if test "$ac_cv_cxx_have_global_hash_set" = yes
- then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_GLOBAL_HASH_SET 1
-_ACEOF
-
- else
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_GLOBAL_HASH_SET 0
-_ACEOF
-
- fi
-
-{ echo "$as_me:$LINENO: checking whether the compiler has the standard iterator" >&5
-echo $ECHO_N "checking whether the compiler has the standard iterator... $ECHO_C" >&6; }
-if test "${ac_cv_cxx_have_std_iterator+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
- ac_ext=cpp
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <iterator>
-#ifdef HAVE_NAMESPACES
-using namespace std;
-#endif
-int
-main ()
-{
-iterator<int,int,int> t; return 0;
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_cxx_have_std_iterator=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_cxx_have_std_iterator=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_cxx_have_std_iterator" >&5
-echo "${ECHO_T}$ac_cv_cxx_have_std_iterator" >&6; }
-if test "$ac_cv_cxx_have_std_iterator" = yes
-then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_STD_ITERATOR 1
-_ACEOF
-
-else
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_STD_ITERATOR 0
-_ACEOF
-
-fi
-
-{ echo "$as_me:$LINENO: checking whether the compiler has the bidirectional iterator" >&5
-echo $ECHO_N "checking whether the compiler has the bidirectional iterator... $ECHO_C" >&6; }
-if test "${ac_cv_cxx_have_bi_iterator+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
- ac_ext=cpp
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <iterator>
-#ifdef HAVE_NAMESPACES
-using namespace std;
-#endif
-int
-main ()
-{
-bidirectional_iterator<int,int> t; return 0;
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_cxx_have_bi_iterator=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_cxx_have_bi_iterator=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_cxx_have_bi_iterator" >&5
-echo "${ECHO_T}$ac_cv_cxx_have_bi_iterator" >&6; }
-if test "$ac_cv_cxx_have_bi_iterator" = yes
-then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_BI_ITERATOR 1
-_ACEOF
-
-else
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_BI_ITERATOR 0
-_ACEOF
-
-fi
-
-{ echo "$as_me:$LINENO: checking whether the compiler has forward iterators" >&5
-echo $ECHO_N "checking whether the compiler has forward iterators... $ECHO_C" >&6; }
-if test "${ac_cv_cxx_have_fwd_iterator+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
- ac_ext=cpp
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <iterator>
-#ifdef HAVE_NAMESPACES
-using namespace std;
-#endif
-int
-main ()
-{
-forward_iterator<int,int> t; return 0;
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_cxx_have_fwd_iterator=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_cxx_have_fwd_iterator=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_cxx_have_fwd_iterator" >&5
-echo "${ECHO_T}$ac_cv_cxx_have_fwd_iterator" >&6; }
-if test "$ac_cv_cxx_have_fwd_iterator" = yes
-then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_FWD_ITERATOR 1
-_ACEOF
-
-else
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_FWD_ITERATOR 0
-_ACEOF
-
-fi
-
-
-{ echo "$as_me:$LINENO: checking for isnan in <math.h>" >&5
-echo $ECHO_N "checking for isnan in <math.h>... $ECHO_C" >&6; }
-if test "${ac_cv_func_isnan_in_math_h+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_ext=cpp
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <math.h>
-int
-main ()
-{
-float f; isnan(f);
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_func_isnan_in_math_h=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_func_isnan_in_math_h=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_func_isnan_in_math_h" >&5
-echo "${ECHO_T}$ac_cv_func_isnan_in_math_h" >&6; }
-
-
-if test "$ac_cv_func_isnan_in_math_h" = "yes" ; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_ISNAN_IN_MATH_H 1
-_ACEOF
-
-fi
-
-{ echo "$as_me:$LINENO: checking for isnan in <cmath>" >&5
-echo $ECHO_N "checking for isnan in <cmath>... $ECHO_C" >&6; }
-if test "${ac_cv_func_isnan_in_cmath+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_ext=cpp
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <cmath>
-int
-main ()
-{
-float f; isnan(f);
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_func_isnan_in_cmath=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_func_isnan_in_cmath=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_func_isnan_in_cmath" >&5
-echo "${ECHO_T}$ac_cv_func_isnan_in_cmath" >&6; }
-
-if test "$ac_cv_func_isnan_in_cmath" = "yes" ; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_ISNAN_IN_CMATH 1
-_ACEOF
-
-fi
-
-{ echo "$as_me:$LINENO: checking for std::isnan in <cmath>" >&5
-echo $ECHO_N "checking for std::isnan in <cmath>... $ECHO_C" >&6; }
-if test "${ac_cv_func_std_isnan_in_cmath+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_ext=cpp
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <cmath>
-int
-main ()
-{
-float f; std::isnan(f);
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_func_std_isnan_in_cmath=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_func_std_isnan_in_cmath=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_func_std_isnan_in_cmath" >&5
-echo "${ECHO_T}$ac_cv_func_std_isnan_in_cmath" >&6; }
-
-if test "$ac_cv_func_std_isnan_in_cmath" = "yes" ; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_STD_ISNAN_IN_CMATH 1
-_ACEOF
-
-fi
-
-
-{ echo "$as_me:$LINENO: checking for isinf in <math.h>" >&5
-echo $ECHO_N "checking for isinf in <math.h>... $ECHO_C" >&6; }
-if test "${ac_cv_func_isinf_in_math_h+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_ext=cpp
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <math.h>
-int
-main ()
-{
-float f; isinf(f);
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_func_isinf_in_math_h=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_func_isinf_in_math_h=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_func_isinf_in_math_h" >&5
-echo "${ECHO_T}$ac_cv_func_isinf_in_math_h" >&6; }
-
-if test "$ac_cv_func_isinf_in_math_h" = "yes" ; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_ISINF_IN_MATH_H 1
-_ACEOF
-
-fi
-
-{ echo "$as_me:$LINENO: checking for isinf in <cmath>" >&5
-echo $ECHO_N "checking for isinf in <cmath>... $ECHO_C" >&6; }
-if test "${ac_cv_func_isinf_in_cmath+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_ext=cpp
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <cmath>
-int
-main ()
-{
-float f; isinf(f);
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_func_isinf_in_cmath=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_func_isinf_in_cmath=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_func_isinf_in_cmath" >&5
-echo "${ECHO_T}$ac_cv_func_isinf_in_cmath" >&6; }
-
-if test "$ac_cv_func_isinf_in_cmath" = "yes" ; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_ISINF_IN_CMATH 1
-_ACEOF
-
-fi
-
-{ echo "$as_me:$LINENO: checking for std::isinf in <cmath>" >&5
-echo $ECHO_N "checking for std::isinf in <cmath>... $ECHO_C" >&6; }
-if test "${ac_cv_func_std_isinf_in_cmath+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_ext=cpp
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <cmath>
-int
-main ()
-{
-float f; std::isinf(f)}
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_func_std_isinf_in_cmath=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_func_std_isinf_in_cmath=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_func_std_isinf_in_cmath" >&5
-echo "${ECHO_T}$ac_cv_func_std_isinf_in_cmath" >&6; }
-
-if test "$ac_cv_func_std_isinf_in_cmath" = "yes" ; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_STD_ISINF_IN_CMATH 1
-_ACEOF
-
-fi
-
-{ echo "$as_me:$LINENO: checking for finite in <ieeefp.h>" >&5
-echo $ECHO_N "checking for finite in <ieeefp.h>... $ECHO_C" >&6; }
-if test "${ac_cv_func_finite_in_ieeefp_h+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_ext=cpp
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <ieeefp.h>
-int
-main ()
-{
-float f; finite(f);
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_func_finite_in_ieeefp_h=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_func_finite_in_ieeefp_h=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_func_finite_in_ieeefp_h" >&5
-echo "${ECHO_T}$ac_cv_func_finite_in_ieeefp_h" >&6; }
-
-if test "$ac_cv_func_finite_in_ieeefp_h" = "yes" ; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_FINITE_IN_IEEEFP_H 1
-_ACEOF
-
-fi
-
-
-
-if test "$llvm_cv_platform_type" = "Unix" ; then
-
-
-for ac_header in stdlib.h unistd.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- { echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-else
- # Is the header compilable?
-{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_header_compiler=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <$ac_header>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_c_preproc_warn_flag
- ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
- else
- ac_cpp_err=
- fi
-else
- ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
- ac_header_preproc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
- yes:no: )
- { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
- ac_header_preproc=yes
- ;;
- no:yes:* )
- { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
- ( cat <<\_ASBOX
-## ----------------------------------- ##
-## Report this to llvmbugs@cs.uiuc.edu ##
-## ----------------------------------- ##
-_ASBOX
- ) | sed "s/^/$as_me: WARNING: /" >&2
- ;;
-esac
-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- eval "$as_ac_Header=\$ac_header_preproc"
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-
-for ac_func in getpagesize
-do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
-if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
- For example, HP-UX 11i <limits.h> declares gettimeofday. */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func (); below.
- Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- <limits.h> exists even on freestanding compilers. */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef $ac_func
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char $ac_func ();
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined __stub_$ac_func || defined __stub___$ac_func
-choke me
-#endif
-
-int
-main ()
-{
-return $ac_func ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- eval "$as_ac_var=yes"
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- eval "$as_ac_var=no"
-fi
-
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-fi
-ac_res=`eval echo '${'$as_ac_var'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_var'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-done
-
-{ echo "$as_me:$LINENO: checking for working mmap" >&5
-echo $ECHO_N "checking for working mmap... $ECHO_C" >&6; }
-if test "${ac_cv_func_mmap_fixed_mapped+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test "$cross_compiling" = yes; then
- ac_cv_func_mmap_fixed_mapped=no
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-/* malloc might have been renamed as rpl_malloc. */
-#undef malloc
-
-/* Thanks to Mike Haertel and Jim Avera for this test.
- Here is a matrix of mmap possibilities:
- mmap private not fixed
- mmap private fixed at somewhere currently unmapped
- mmap private fixed at somewhere already mapped
- mmap shared not fixed
- mmap shared fixed at somewhere currently unmapped
- mmap shared fixed at somewhere already mapped
- For private mappings, we should verify that changes cannot be read()
- back from the file, nor mmap's back from the file at a different
- address. (There have been systems where private was not correctly
- implemented like the infamous i386 svr4.0, and systems where the
- VM page cache was not coherent with the file system buffer cache
- like early versions of FreeBSD and possibly contemporary NetBSD.)
- For shared mappings, we should conversely verify that changes get
- propagated back to all the places they're supposed to be.
-
- Grep wants private fixed already mapped.
- The main things grep needs to know about mmap are:
- * does it exist and is it safe to write into the mmap'd area
- * how to use it (BSD variants) */
-
-#include <fcntl.h>
-#include <sys/mman.h>
-
-#if !STDC_HEADERS && !HAVE_STDLIB_H
-char *malloc ();
-#endif
-
-/* This mess was copied from the GNU getpagesize.h. */
-#if !HAVE_GETPAGESIZE
-/* Assume that all systems that can run configure have sys/param.h. */
-# if !HAVE_SYS_PARAM_H
-# define HAVE_SYS_PARAM_H 1
-# endif
-
-# ifdef _SC_PAGESIZE
-# define getpagesize() sysconf(_SC_PAGESIZE)
-# else /* no _SC_PAGESIZE */
-# if HAVE_SYS_PARAM_H
-# include <sys/param.h>
-# ifdef EXEC_PAGESIZE
-# define getpagesize() EXEC_PAGESIZE
-# else /* no EXEC_PAGESIZE */
-# ifdef NBPG
-# define getpagesize() NBPG * CLSIZE
-# ifndef CLSIZE
-# define CLSIZE 1
-# endif /* no CLSIZE */
-# else /* no NBPG */
-# ifdef NBPC
-# define getpagesize() NBPC
-# else /* no NBPC */
-# ifdef PAGESIZE
-# define getpagesize() PAGESIZE
-# endif /* PAGESIZE */
-# endif /* no NBPC */
-# endif /* no NBPG */
-# endif /* no EXEC_PAGESIZE */
-# else /* no HAVE_SYS_PARAM_H */
-# define getpagesize() 8192 /* punt totally */
-# endif /* no HAVE_SYS_PARAM_H */
-# endif /* no _SC_PAGESIZE */
-
-#endif /* no HAVE_GETPAGESIZE */
-
-int
-main ()
-{
- char *data, *data2, *data3;
- int i, pagesize;
- int fd;
-
- pagesize = getpagesize ();
-
- /* First, make a file with some known garbage in it. */
- data = (char *) malloc (pagesize);
- if (!data)
- return 1;
- for (i = 0; i < pagesize; ++i)
- *(data + i) = rand ();
- umask (0);
- fd = creat ("conftest.mmap", 0600);
- if (fd < 0)
- return 1;
- if (write (fd, data, pagesize) != pagesize)
- return 1;
- close (fd);
-
- /* Next, try to mmap the file at a fixed address which already has
- something else allocated at it. If we can, also make sure that
- we see the same garbage. */
- fd = open ("conftest.mmap", O_RDWR);
- if (fd < 0)
- return 1;
- data2 = (char *) malloc (2 * pagesize);
- if (!data2)
- return 1;
- data2 += (pagesize - ((long int) data2 & (pagesize - 1))) & (pagesize - 1);
- if (data2 != mmap (data2, pagesize, PROT_READ | PROT_WRITE,
- MAP_PRIVATE | MAP_FIXED, fd, 0L))
- return 1;
- for (i = 0; i < pagesize; ++i)
- if (*(data + i) != *(data2 + i))
- return 1;
-
- /* Finally, make sure that changes to the mapped area do not
- percolate back to the file as seen by read(). (This is a bug on
- some variants of i386 svr4.0.) */
- for (i = 0; i < pagesize; ++i)
- *(data2 + i) = *(data2 + i) + 1;
- data3 = (char *) malloc (pagesize);
- if (!data3)
- return 1;
- if (read (fd, data3, pagesize) != pagesize)
- return 1;
- for (i = 0; i < pagesize; ++i)
- if (*(data + i) != *(data3 + i))
- return 1;
- close (fd);
- return 0;
-}
-_ACEOF
-rm -f conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_func_mmap_fixed_mapped=yes
-else
- echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-( exit $ac_status )
-ac_cv_func_mmap_fixed_mapped=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-
-
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_func_mmap_fixed_mapped" >&5
-echo "${ECHO_T}$ac_cv_func_mmap_fixed_mapped" >&6; }
-if test $ac_cv_func_mmap_fixed_mapped = yes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_MMAP 1
-_ACEOF
-
-fi
-rm -f conftest.mmap
-
- { echo "$as_me:$LINENO: checking for mmap of files" >&5
-echo $ECHO_N "checking for mmap of files... $ECHO_C" >&6; }
-if test "${ac_cv_func_mmap_file+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
- if test "$cross_compiling" = yes; then
- ac_cv_func_mmap_file=no
-else
- cat >conftest.$ac_ext <<_ACEOF
-
- /* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-#include <sys/types.h>
-#include <sys/mman.h>
-#include <fcntl.h>
-
-int
-main ()
-{
-
- int fd;
- fd = creat ("foo",0777);
- fd = (int) mmap (0, 1, PROT_READ, MAP_SHARED, fd, 0);
- unlink ("foo");
- return (fd != (int) MAP_FAILED);
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_func_mmap_file=yes
-else
- echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-( exit $ac_status )
-ac_cv_func_mmap_file=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-
-
- ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_func_mmap_file" >&5
-echo "${ECHO_T}$ac_cv_func_mmap_file" >&6; }
-if test "$ac_cv_func_mmap_file" = yes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_MMAP_FILE
-_ACEOF
-
- MMAP_FILE=yes
-
-fi
-
- { echo "$as_me:$LINENO: checking if /dev/zero is needed for mmap" >&5
-echo $ECHO_N "checking if /dev/zero is needed for mmap... $ECHO_C" >&6; }
-if test "${ac_cv_need_dev_zero_for_mmap+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test "$llvm_cv_os_type" = "Interix" ; then
- ac_cv_need_dev_zero_for_mmap=yes
- else
- ac_cv_need_dev_zero_for_mmap=no
- fi
-
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_need_dev_zero_for_mmap" >&5
-echo "${ECHO_T}$ac_cv_need_dev_zero_for_mmap" >&6; }
-if test "$ac_cv_need_dev_zero_for_mmap" = yes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define NEED_DEV_ZERO_FOR_MMAP 1
-_ACEOF
-
-fi
-
- if test "$ac_cv_func_mmap_fixed_mapped" = "no"
- then
- { echo "$as_me:$LINENO: WARNING: mmap() of a fixed address required but not supported" >&5
-echo "$as_me: WARNING: mmap() of a fixed address required but not supported" >&2;}
- fi
- if test "$ac_cv_func_mmap_file" = "no"
- then
- { echo "$as_me:$LINENO: WARNING: mmap() of files required but not found" >&5
-echo "$as_me: WARNING: mmap() of files required but not found" >&2;}
- fi
-fi
-
-
-
-for ac_func in __dso_handle
-do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
-if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
- For example, HP-UX 11i <limits.h> declares gettimeofday. */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func (); below.
- Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- <limits.h> exists even on freestanding compilers. */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef $ac_func
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char $ac_func ();
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined __stub_$ac_func || defined __stub___$ac_func
-choke me
-#endif
-
-int
-main ()
-{
-return $ac_func ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- eval "$as_ac_var=yes"
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- eval "$as_ac_var=no"
-fi
-
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-fi
-ac_res=`eval echo '${'$as_ac_var'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_var'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-done
-
-
-{ echo "$as_me:$LINENO: checking whether llvm-gcc is sane" >&5
-echo $ECHO_N "checking whether llvm-gcc is sane... $ECHO_C" >&6; }
-if test "${llvm_cv_llvmgcc_sanity+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- llvm_cv_llvmgcc_sanity="no"
-if test -x "$LLVMGCC" ; then
- cp /dev/null conftest.c
- "$LLVMGCC" -emit-llvm -S -o - conftest.c | \
- grep 'target datalayout =' > /dev/null 2>&1
- if test $? -eq 0 ; then
- llvm_cv_llvmgcc_sanity="yes"
- fi
- rm conftest.c
-fi
-fi
-{ echo "$as_me:$LINENO: result: $llvm_cv_llvmgcc_sanity" >&5
-echo "${ECHO_T}$llvm_cv_llvmgcc_sanity" >&6; }
-
-if test "$llvm_cv_llvmgcc_sanity" = "yes" ; then
- { echo "$as_me:$LINENO: checking llvm-gcc component support" >&5
-echo $ECHO_N "checking llvm-gcc component support... $ECHO_C" >&6; }
- llvmcc1path=`"$LLVMGCC" --print-prog-name=cc1`
- LLVMCC1=$llvmcc1path
-
- llvmcc1pluspath=`"$LLVMGCC" --print-prog-name=cc1plus`
- LLVMCC1PLUS=$llvmcc1pluspath
-
- llvmgccdir=`echo "$llvmcc1path" | sed 's,/libexec/.*,,'`
- LLVMGCCDIR=$llvmgccdir
-
- llvmgcclibexec=`echo "$llvmcc1path" | sed 's,/cc1,,'`
- LLVMGCCLIBEXEC=$llvmgcclibexec
-
- llvmgccversion=`"$LLVMGCC" -dumpversion 2>&1 | sed 's/^\([0-9.]*\).*/\1/'`
- llvmgccmajvers=`echo $llvmgccversion | sed 's/^\([0-9]\).*/\1/'`
- LLVMGCC_VERSION=$llvmgccversion
-
- LLVMGCC_MAJVERS=$llvmgccmajvers
-
- llvmgcclangs=`"$LLVMGCC" -v --help 2>&1 | grep '^Configured with:' | sed 's/^.*--enable-languages=\([^ -]*\).*/\1/'`
- LLVMGCC_LANGS=$llvmgcclangs
-
- { echo "$as_me:$LINENO: result: ok" >&5
-echo "${ECHO_T}ok" >&6; }
-fi
-
-SHLIBEXT=$libltdl_cv_shlibext
-
-
-# Translate the various configuration directories and other basic
-# information into substitutions that will end up in Makefile.config.in
-# that these configured values can be used by the makefiles
-if test "${prefix}" = "NONE" ; then
- prefix="/usr/local"
-fi
-eval LLVM_PREFIX="${prefix}";
-eval LLVM_BINDIR="${prefix}/bin";
-eval LLVM_LIBDIR="${prefix}/lib";
-eval LLVM_DATADIR="${prefix}/share/llvm";
-eval LLVM_DOCSDIR="${prefix}/docs/llvm";
-eval LLVM_ETCDIR="${prefix}/etc/llvm";
-eval LLVM_INCLUDEDIR="${prefix}/include";
-eval LLVM_INFODIR="${prefix}/info";
-eval LLVM_MANDIR="${prefix}/man";
-LLVM_CONFIGTIME=`date`
-
-
-
-
-
-
-
-
-
-
-
-# Place the various directores into the config.h file as #defines so that we
-# can know about the installation paths within LLVM.
-
-cat >>confdefs.h <<_ACEOF
-#define LLVM_PREFIX "$LLVM_PREFIX"
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define LLVM_BINDIR "$LLVM_BINDIR"
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define LLVM_LIBDIR "$LLVM_LIBDIR"
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define LLVM_DATADIR "$LLVM_DATADIR"
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define LLVM_DOCSDIR "$LLVM_DOCSDIR"
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define LLVM_ETCDIR "$LLVM_ETCDIR"
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define LLVM_INCLUDEDIR "$LLVM_INCLUDEDIR"
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define LLVM_INFODIR "$LLVM_INFODIR"
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define LLVM_MANDIR "$LLVM_MANDIR"
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define LLVM_CONFIGTIME "$LLVM_CONFIGTIME"
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define LLVM_HOSTTRIPLE "$host"
-_ACEOF
-
-
-# Determine which bindings to build.
-if test "$BINDINGS_TO_BUILD" = auto ; then
- BINDINGS_TO_BUILD=""
- if test "x$OCAMLC" != x -a "x$OCAMLDEP" != x ; then
- BINDINGS_TO_BUILD="ocaml $BINDINGS_TO_BUILD"
- fi
-fi
-BINDINGS_TO_BUILD=$BINDINGS_TO_BUILD
-
-
-# This isn't really configurey, but it avoids having to repeat the list in
-# other files.
-ALL_BINDINGS=ocaml
-
-
-# Do any work necessary to ensure that bindings have what they need.
-binding_prereqs_failed=0
-for a_binding in $BINDINGS_TO_BUILD ; do
- case "$a_binding" in
- ocaml)
- if test "x$OCAMLC" = x ; then
- { echo "$as_me:$LINENO: WARNING: --enable-bindings=ocaml specified, but ocamlc not found. Try configure OCAMLC=/path/to/ocamlc" >&5
-echo "$as_me: WARNING: --enable-bindings=ocaml specified, but ocamlc not found. Try configure OCAMLC=/path/to/ocamlc" >&2;}
- binding_prereqs_failed=1
- fi
- if test "x$OCAMLDEP" = x ; then
- { echo "$as_me:$LINENO: WARNING: --enable-bindings=ocaml specified, but ocamldep not found. Try configure OCAMLDEP=/path/to/ocamldep" >&5
-echo "$as_me: WARNING: --enable-bindings=ocaml specified, but ocamldep not found. Try configure OCAMLDEP=/path/to/ocamldep" >&2;}
- binding_prereqs_failed=1
- fi
- if test "x$OCAMLOPT" = x ; then
- { echo "$as_me:$LINENO: WARNING: --enable-bindings=ocaml specified, but ocamlopt not found. Try configure OCAMLOPT=/path/to/ocamlopt" >&5
-echo "$as_me: WARNING: --enable-bindings=ocaml specified, but ocamlopt not found. Try configure OCAMLOPT=/path/to/ocamlopt" >&2;}
- fi
- if test "x$with_ocaml_libdir" != xauto ; then
- OCAML_LIBDIR=$with_ocaml_libdir
-
- else
- ocaml_stdlib="`"$OCAMLC" -where`"
- if test "$LLVM_PREFIX" '<' "$ocaml_stdlib" -a "$ocaml_stdlib" '<' "$LLVM_PREFIX~"
- then
- # ocaml stdlib is beneath our prefix; use stdlib
- OCAML_LIBDIR=$ocaml_stdlib
-
- else
- # ocaml stdlib is outside our prefix; use libdir/ocaml
- OCAML_LIBDIR=$LLVM_LIBDIR/ocaml
-
- fi
- fi
- ;;
- esac
-done
-if test "$binding_prereqs_failed" = 1 ; then
- { { echo "$as_me:$LINENO: error: Prequisites for bindings not satisfied. Fix them or use configure --disable-bindings." >&5
-echo "$as_me: error: Prequisites for bindings not satisfied. Fix them or use configure --disable-bindings." >&2;}
- { (exit 1); exit 1; }; }
-fi
-
-
-
-ac_config_headers="$ac_config_headers include/llvm/Config/config.h"
-
-ac_config_headers="$ac_config_headers include/llvm/Support/DataTypes.h"
-
-ac_config_headers="$ac_config_headers include/llvm/ADT/hash_map"
-
-ac_config_headers="$ac_config_headers include/llvm/ADT/hash_set"
-
-ac_config_headers="$ac_config_headers include/llvm/ADT/iterator"
-
-
-ac_config_files="$ac_config_files Makefile.config"
-
-
-ac_config_files="$ac_config_files llvm.spec"
-
-
-ac_config_files="$ac_config_files docs/doxygen.cfg"
-
-
-ac_config_files="$ac_config_files tools/llvm-config/llvm-config.in"
-
-
-ac_config_commands="$ac_config_commands setup"
-
-ac_config_commands="$ac_config_commands Makefile"
-
-
-ac_config_commands="$ac_config_commands Makefile.common"
-
-
-ac_config_commands="$ac_config_commands examples/Makefile"
-
-
-ac_config_commands="$ac_config_commands lib/Makefile"
-
-
-ac_config_commands="$ac_config_commands runtime/Makefile"
-
-
-ac_config_commands="$ac_config_commands test/Makefile"
-
-
-ac_config_commands="$ac_config_commands test/Makefile.tests"
-
-
-ac_config_commands="$ac_config_commands tools/Makefile"
-
-
-ac_config_commands="$ac_config_commands utils/Makefile"
-
-
-ac_config_commands="$ac_config_commands projects/Makefile"
-
-
-ac_config_commands="$ac_config_commands bindings/Makefile"
-
-
-ac_config_commands="$ac_config_commands bindings/ocaml/Makefile.ocaml"
-
-
-
-cat >confcache <<\_ACEOF
-# This file is a shell script that caches the results of configure
-# tests run on this system so they can be shared between configure
-# scripts and configure runs, see configure's option --config-cache.
-# It is not useful on other systems. If it contains results you don't
-# want to keep, you may remove or edit it.
-#
-# config.status only pays attention to the cache file if you give it
-# the --recheck option to rerun configure.
-#
-# `ac_cv_env_foo' variables (set or unset) will be overridden when
-# loading this file, other *unset* `ac_cv_foo' will be assigned the
-# following values.
-
-_ACEOF
-
-# The following way of writing the cache mishandles newlines in values,
-# but we know of no workaround that is simple, portable, and efficient.
-# So, we kill variables containing newlines.
-# Ultrix sh set writes to stderr and can't be redirected directly,
-# and sets the high bit in the cache file unless we assign to the vars.
-(
- for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
- eval ac_val=\$$ac_var
- case $ac_val in #(
- *${as_nl}*)
- case $ac_var in #(
- *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5
-echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;;
- esac
- case $ac_var in #(
- _ | IFS | as_nl) ;; #(
- *) $as_unset $ac_var ;;
- esac ;;
- esac
- done
-
- (set) 2>&1 |
- case $as_nl`(ac_space=' '; set) 2>&1` in #(
- *${as_nl}ac_space=\ *)
- # `set' does not quote correctly, so add quotes (double-quote
- # substitution turns \\\\ into \\, and sed turns \\ into \).
- sed -n \
- "s/'/'\\\\''/g;
- s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
- ;; #(
- *)
- # `set' quotes correctly as required by POSIX, so do not add quotes.
- sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
- ;;
- esac |
- sort
-) |
- sed '
- /^ac_cv_env_/b end
- t clear
- :clear
- s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
- t end
- s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
- :end' >>confcache
-if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
- if test -w "$cache_file"; then
- test "x$cache_file" != "x/dev/null" &&
- { echo "$as_me:$LINENO: updating cache $cache_file" >&5
-echo "$as_me: updating cache $cache_file" >&6;}
- cat confcache >$cache_file
- else
- { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5
-echo "$as_me: not updating unwritable cache $cache_file" >&6;}
- fi
-fi
-rm -f confcache
-
-test "x$prefix" = xNONE && prefix=$ac_default_prefix
-# Let make expand exec_prefix.
-test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
-
-DEFS=-DHAVE_CONFIG_H
-
-ac_libobjs=
-ac_ltlibobjs=
-for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
- # 1. Remove the extension, and $U if already installed.
- ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
- ac_i=`echo "$ac_i" | sed "$ac_script"`
- # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR
- # will be set to the directory where LIBOBJS objects are built.
- ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext"
- ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo'
-done
-LIBOBJS=$ac_libobjs
-
-LTLIBOBJS=$ac_ltlibobjs
-
-
-if test -z "${INSTALL_LTDL_TRUE}" && test -z "${INSTALL_LTDL_FALSE}"; then
- { { echo "$as_me:$LINENO: error: conditional \"INSTALL_LTDL\" was never defined.
-Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"INSTALL_LTDL\" was never defined.
-Usually this means the macro was only invoked conditionally." >&2;}
- { (exit 1); exit 1; }; }
-fi
-if test -z "${CONVENIENCE_LTDL_TRUE}" && test -z "${CONVENIENCE_LTDL_FALSE}"; then
- { { echo "$as_me:$LINENO: error: conditional \"CONVENIENCE_LTDL\" was never defined.
-Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"CONVENIENCE_LTDL\" was never defined.
-Usually this means the macro was only invoked conditionally." >&2;}
- { (exit 1); exit 1; }; }
-fi
-
-: ${CONFIG_STATUS=./config.status}
-ac_clean_files_save=$ac_clean_files
-ac_clean_files="$ac_clean_files $CONFIG_STATUS"
-{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
-echo "$as_me: creating $CONFIG_STATUS" >&6;}
-cat >$CONFIG_STATUS <<_ACEOF
-#! $SHELL
-# Generated by $as_me.
-# Run this file to recreate the current configuration.
-# Compiler output produced by configure, useful for debugging
-# configure, is in config.log if it exists.
-
-debug=false
-ac_cs_recheck=false
-ac_cs_silent=false
-SHELL=\${CONFIG_SHELL-$SHELL}
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF
-## --------------------- ##
-## M4sh Initialization. ##
-## --------------------- ##
-
-# Be Bourne compatible
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
- emulate sh
- NULLCMD=:
- # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
- # is contrary to our usage. Disable this feature.
- alias -g '${1+"$@"}'='"$@"'
- setopt NO_GLOB_SUBST
-else
- case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
-fi
-BIN_SH=xpg4; export BIN_SH # for Tru64
-DUALCASE=1; export DUALCASE # for MKS sh
-
-
-# PATH needs CR
-# Avoid depending upon Character Ranges.
-as_cr_letters='abcdefghijklmnopqrstuvwxyz'
-as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
-as_cr_Letters=$as_cr_letters$as_cr_LETTERS
-as_cr_digits='0123456789'
-as_cr_alnum=$as_cr_Letters$as_cr_digits
-
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
- echo "#! /bin/sh" >conf$$.sh
- echo "exit 0" >>conf$$.sh
- chmod +x conf$$.sh
- if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
- PATH_SEPARATOR=';'
- else
- PATH_SEPARATOR=:
- fi
- rm -f conf$$.sh
-fi
-
-# Support unset when possible.
-if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
- as_unset=unset
-else
- as_unset=false
-fi
-
-
-# IFS
-# We need space, tab and new line, in precisely that order. Quoting is
-# there to prevent editors from complaining about space-tab.
-# (If _AS_PATH_WALK were called with IFS unset, it would disable word
-# splitting by setting IFS to empty value.)
-as_nl='
-'
-IFS=" "" $as_nl"
-
-# Find who we are. Look in the path if we contain no directory separator.
-case $0 in
- *[\\/]* ) as_myself=$0 ;;
- *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
-done
-IFS=$as_save_IFS
-
- ;;
-esac
-# We did not find ourselves, most probably we were run as `sh COMMAND'
-# in which case we are not to be found in the path.
-if test "x$as_myself" = x; then
- as_myself=$0
-fi
-if test ! -f "$as_myself"; then
- echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
- { (exit 1); exit 1; }
-fi
-
-# Work around bugs in pre-3.0 UWIN ksh.
-for as_var in ENV MAIL MAILPATH
-do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
-done
-PS1='$ '
-PS2='> '
-PS4='+ '
-
-# NLS nuisances.
-for as_var in \
- LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
- LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
- LC_TELEPHONE LC_TIME
-do
- if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
- eval $as_var=C; export $as_var
- else
- ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
- fi
-done
-
-# Required to use basename.
-if expr a : '\(a\)' >/dev/null 2>&1 &&
- test "X`expr 00001 : '.*\(...\)'`" = X001; then
- as_expr=expr
-else
- as_expr=false
-fi
-
-if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
- as_basename=basename
-else
- as_basename=false
-fi
-
-
-# Name of the executable.
-as_me=`$as_basename -- "$0" ||
-$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
- X"$0" : 'X\(//\)$' \| \
- X"$0" : 'X\(/\)' \| . 2>/dev/null ||
-echo X/"$0" |
- sed '/^.*\/\([^/][^/]*\)\/*$/{
- s//\1/
- q
- }
- /^X\/\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\/\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
-
-# CDPATH.
-$as_unset CDPATH
-
-
-
- as_lineno_1=$LINENO
- as_lineno_2=$LINENO
- test "x$as_lineno_1" != "x$as_lineno_2" &&
- test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
-
- # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
- # uniformly replaced by the line number. The first 'sed' inserts a
- # line-number line after each line using $LINENO; the second 'sed'
- # does the real work. The second script uses 'N' to pair each
- # line-number line with the line containing $LINENO, and appends
- # trailing '-' during substitution so that $LINENO is not a special
- # case at line end.
- # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
- # scripts with optimization help from Paolo Bonzini. Blame Lee
- # E. McMahon (1931-1989) for sed's syntax. :-)
- sed -n '
- p
- /[$]LINENO/=
- ' <$as_myself |
- sed '
- s/[$]LINENO.*/&-/
- t lineno
- b
- :lineno
- N
- :loop
- s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
- t loop
- s/-\n.*//
- ' >$as_me.lineno &&
- chmod +x "$as_me.lineno" ||
- { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
- { (exit 1); exit 1; }; }
-
- # Don't try to exec as it changes $[0], causing all sort of problems
- # (the dirname of $[0] is not the place where we might find the
- # original and so on. Autoconf is especially sensitive to this).
- . "./$as_me.lineno"
- # Exit status is that of the last command.
- exit
-}
-
-
-if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
- as_dirname=dirname
-else
- as_dirname=false
-fi
-
-ECHO_C= ECHO_N= ECHO_T=
-case `echo -n x` in
--n*)
- case `echo 'x\c'` in
- *c*) ECHO_T=' ';; # ECHO_T is single tab character.
- *) ECHO_C='\c';;
- esac;;
-*)
- ECHO_N='-n';;
-esac
-
-if expr a : '\(a\)' >/dev/null 2>&1 &&
- test "X`expr 00001 : '.*\(...\)'`" = X001; then
- as_expr=expr
-else
- as_expr=false
-fi
-
-rm -f conf$$ conf$$.exe conf$$.file
-if test -d conf$$.dir; then
- rm -f conf$$.dir/conf$$.file
-else
- rm -f conf$$.dir
- mkdir conf$$.dir
-fi
-echo >conf$$.file
-if ln -s conf$$.file conf$$ 2>/dev/null; then
- as_ln_s='ln -s'
- # ... but there are two gotchas:
- # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
- # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
- # In both cases, we have to default to `cp -p'.
- ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
- as_ln_s='cp -p'
-elif ln conf$$.file conf$$ 2>/dev/null; then
- as_ln_s=ln
-else
- as_ln_s='cp -p'
-fi
-rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
-rmdir conf$$.dir 2>/dev/null
-
-if mkdir -p . 2>/dev/null; then
- as_mkdir_p=:
-else
- test -d ./-p && rmdir ./-p
- as_mkdir_p=false
-fi
-
-# Find out whether ``test -x'' works. Don't use a zero-byte file, as
-# systems may use methods other than mode bits to determine executability.
-cat >conf$$.file <<_ASEOF
-#! /bin/sh
-exit 0
-_ASEOF
-chmod +x conf$$.file
-if test -x conf$$.file >/dev/null 2>&1; then
- as_executable_p="test -x"
-else
- as_executable_p=:
-fi
-rm -f conf$$.file
-
-# Sed expression to map a string onto a valid CPP name.
-as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
-
-# Sed expression to map a string onto a valid variable name.
-as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
-
-
-exec 6>&1
-
-# Save the log message, to keep $[0] and so on meaningful, and to
-# report actual input values of CONFIG_FILES etc. instead of their
-# values after options handling.
-ac_log="
-This file was extended by llvm $as_me 2.3, which was
-generated by GNU Autoconf 2.60. Invocation command line was
-
- CONFIG_FILES = $CONFIG_FILES
- CONFIG_HEADERS = $CONFIG_HEADERS
- CONFIG_LINKS = $CONFIG_LINKS
- CONFIG_COMMANDS = $CONFIG_COMMANDS
- $ $0 $@
-
-on `(hostname || uname -n) 2>/dev/null | sed 1q`
-"
-
-_ACEOF
-
-cat >>$CONFIG_STATUS <<_ACEOF
-# Files that config.status was made for.
-config_files="$ac_config_files"
-config_headers="$ac_config_headers"
-config_commands="$ac_config_commands"
-
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF
-ac_cs_usage="\
-\`$as_me' instantiates files from templates according to the
-current configuration.
-
-Usage: $0 [OPTIONS] [FILE]...
-
- -h, --help print this help, then exit
- -V, --version print version number, then exit
- -q, --quiet do not print progress messages
- -d, --debug don't remove temporary files
- --recheck update $as_me by reconfiguring in the same conditions
- --file=FILE[:TEMPLATE]
- instantiate the configuration file FILE
- --header=FILE[:TEMPLATE]
- instantiate the configuration header FILE
-
-Configuration files:
-$config_files
-
-Configuration headers:
-$config_headers
-
-Configuration commands:
-$config_commands
-
-Report bugs to <bug-autoconf@gnu.org>."
-
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF
-ac_cs_version="\\
-llvm config.status 2.3
-configured by $0, generated by GNU Autoconf 2.60,
- with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
-
-Copyright (C) 2006 Free Software Foundation, Inc.
-This config.status script is free software; the Free Software Foundation
-gives unlimited permission to copy, distribute and modify it."
-
-ac_pwd='$ac_pwd'
-srcdir='$srcdir'
-INSTALL='$INSTALL'
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF
-# If no file are specified by the user, then we need to provide default
-# value. By we need to know if files were specified by the user.
-ac_need_defaults=:
-while test $# != 0
-do
- case $1 in
- --*=*)
- ac_option=`expr "X$1" : 'X\([^=]*\)='`
- ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
- ac_shift=:
- ;;
- *)
- ac_option=$1
- ac_optarg=$2
- ac_shift=shift
- ;;
- esac
-
- case $ac_option in
- # Handling of the options.
- -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
- ac_cs_recheck=: ;;
- --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
- echo "$ac_cs_version"; exit ;;
- --debug | --debu | --deb | --de | --d | -d )
- debug=: ;;
- --file | --fil | --fi | --f )
- $ac_shift
- CONFIG_FILES="$CONFIG_FILES $ac_optarg"
- ac_need_defaults=false;;
- --header | --heade | --head | --hea )
- $ac_shift
- CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg"
- ac_need_defaults=false;;
- --he | --h)
- # Conflict between --help and --header
- { echo "$as_me: error: ambiguous option: $1
-Try \`$0 --help' for more information." >&2
- { (exit 1); exit 1; }; };;
- --help | --hel | -h )
- echo "$ac_cs_usage"; exit ;;
- -q | -quiet | --quiet | --quie | --qui | --qu | --q \
- | -silent | --silent | --silen | --sile | --sil | --si | --s)
- ac_cs_silent=: ;;
-
- # This is an error.
- -*) { echo "$as_me: error: unrecognized option: $1
-Try \`$0 --help' for more information." >&2
- { (exit 1); exit 1; }; } ;;
-
- *) ac_config_targets="$ac_config_targets $1"
- ac_need_defaults=false ;;
-
- esac
- shift
-done
-
-ac_configure_extra_args=
-
-if $ac_cs_silent; then
- exec 6>/dev/null
- ac_configure_extra_args="$ac_configure_extra_args --silent"
-fi
-
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF
-if \$ac_cs_recheck; then
- echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6
- CONFIG_SHELL=$SHELL
- export CONFIG_SHELL
- exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
-fi
-
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
-exec 5>>config.log
-{
- echo
- sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
-## Running $as_me. ##
-_ASBOX
- echo "$ac_log"
-} >&5
-
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF
-#
-# INIT-COMMANDS
-#
-llvm_src="${srcdir}"
-
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF
-
-# Handling of arguments.
-for ac_config_target in $ac_config_targets
-do
- case $ac_config_target in
- "include/llvm/Config/config.h") CONFIG_HEADERS="$CONFIG_HEADERS include/llvm/Config/config.h" ;;
- "include/llvm/Support/DataTypes.h") CONFIG_HEADERS="$CONFIG_HEADERS include/llvm/Support/DataTypes.h" ;;
- "include/llvm/ADT/hash_map") CONFIG_HEADERS="$CONFIG_HEADERS include/llvm/ADT/hash_map" ;;
- "include/llvm/ADT/hash_set") CONFIG_HEADERS="$CONFIG_HEADERS include/llvm/ADT/hash_set" ;;
- "include/llvm/ADT/iterator") CONFIG_HEADERS="$CONFIG_HEADERS include/llvm/ADT/iterator" ;;
- "Makefile.config") CONFIG_FILES="$CONFIG_FILES Makefile.config" ;;
- "llvm.spec") CONFIG_FILES="$CONFIG_FILES llvm.spec" ;;
- "docs/doxygen.cfg") CONFIG_FILES="$CONFIG_FILES docs/doxygen.cfg" ;;
- "tools/llvm-config/llvm-config.in") CONFIG_FILES="$CONFIG_FILES tools/llvm-config/llvm-config.in" ;;
- "setup") CONFIG_COMMANDS="$CONFIG_COMMANDS setup" ;;
- "Makefile") CONFIG_COMMANDS="$CONFIG_COMMANDS Makefile" ;;
- "Makefile.common") CONFIG_COMMANDS="$CONFIG_COMMANDS Makefile.common" ;;
- "examples/Makefile") CONFIG_COMMANDS="$CONFIG_COMMANDS examples/Makefile" ;;
- "lib/Makefile") CONFIG_COMMANDS="$CONFIG_COMMANDS lib/Makefile" ;;
- "runtime/Makefile") CONFIG_COMMANDS="$CONFIG_COMMANDS runtime/Makefile" ;;
- "test/Makefile") CONFIG_COMMANDS="$CONFIG_COMMANDS test/Makefile" ;;
- "test/Makefile.tests") CONFIG_COMMANDS="$CONFIG_COMMANDS test/Makefile.tests" ;;
- "tools/Makefile") CONFIG_COMMANDS="$CONFIG_COMMANDS tools/Makefile" ;;
- "utils/Makefile") CONFIG_COMMANDS="$CONFIG_COMMANDS utils/Makefile" ;;
- "projects/Makefile") CONFIG_COMMANDS="$CONFIG_COMMANDS projects/Makefile" ;;
- "bindings/Makefile") CONFIG_COMMANDS="$CONFIG_COMMANDS bindings/Makefile" ;;
- "bindings/ocaml/Makefile.ocaml") CONFIG_COMMANDS="$CONFIG_COMMANDS bindings/ocaml/Makefile.ocaml" ;;
-
- *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
-echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
- { (exit 1); exit 1; }; };;
- esac
-done
-
-
-# If the user did not use the arguments to specify the items to instantiate,
-# then the envvar interface is used. Set only those that are not.
-# We use the long form for the default assignment because of an extremely
-# bizarre bug on SunOS 4.1.3.
-if $ac_need_defaults; then
- test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
- test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
- test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
-fi
-
-# Have a temporary directory for convenience. Make it in the build tree
-# simply because there is no reason against having it here, and in addition,
-# creating and moving files from /tmp can sometimes cause problems.
-# Hook for its removal unless debugging.
-# Note that there is a small window in which the directory will not be cleaned:
-# after its creation but before its name has been assigned to `$tmp'.
-$debug ||
-{
- tmp=
- trap 'exit_status=$?
- { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status
-' 0
- trap '{ (exit 1); exit 1; }' 1 2 13 15
-}
-# Create a (secure) tmp directory for tmp files.
-
-{
- tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
- test -n "$tmp" && test -d "$tmp"
-} ||
-{
- tmp=./conf$$-$RANDOM
- (umask 077 && mkdir "$tmp")
-} ||
-{
- echo "$me: cannot create a temporary directory in ." >&2
- { (exit 1); exit 1; }
-}
-
-#
-# Set up the sed scripts for CONFIG_FILES section.
-#
-
-# No need to generate the scripts if there are no CONFIG_FILES.
-# This happens for instance when ./config.status config.h
-if test -n "$CONFIG_FILES"; then
-
-_ACEOF
-
-
-
-ac_delim='%!_!# '
-for ac_last_try in false false false false false :; do
- cat >conf$$subs.sed <<_ACEOF
-SHELL!$SHELL$ac_delim
-PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim
-PACKAGE_NAME!$PACKAGE_NAME$ac_delim
-PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim
-PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim
-PACKAGE_STRING!$PACKAGE_STRING$ac_delim
-PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim
-exec_prefix!$exec_prefix$ac_delim
-prefix!$prefix$ac_delim
-program_transform_name!$program_transform_name$ac_delim
-bindir!$bindir$ac_delim
-sbindir!$sbindir$ac_delim
-libexecdir!$libexecdir$ac_delim
-datarootdir!$datarootdir$ac_delim
-datadir!$datadir$ac_delim
-sysconfdir!$sysconfdir$ac_delim
-sharedstatedir!$sharedstatedir$ac_delim
-localstatedir!$localstatedir$ac_delim
-includedir!$includedir$ac_delim
-oldincludedir!$oldincludedir$ac_delim
-docdir!$docdir$ac_delim
-infodir!$infodir$ac_delim
-htmldir!$htmldir$ac_delim
-dvidir!$dvidir$ac_delim
-pdfdir!$pdfdir$ac_delim
-psdir!$psdir$ac_delim
-libdir!$libdir$ac_delim
-localedir!$localedir$ac_delim
-mandir!$mandir$ac_delim
-DEFS!$DEFS$ac_delim
-ECHO_C!$ECHO_C$ac_delim
-ECHO_N!$ECHO_N$ac_delim
-ECHO_T!$ECHO_T$ac_delim
-LIBS!$LIBS$ac_delim
-build_alias!$build_alias$ac_delim
-host_alias!$host_alias$ac_delim
-target_alias!$target_alias$ac_delim
-LLVM_COPYRIGHT!$LLVM_COPYRIGHT$ac_delim
-subdirs!$subdirs$ac_delim
-build!$build$ac_delim
-build_cpu!$build_cpu$ac_delim
-build_vendor!$build_vendor$ac_delim
-build_os!$build_os$ac_delim
-host!$host$ac_delim
-host_cpu!$host_cpu$ac_delim
-host_vendor!$host_vendor$ac_delim
-host_os!$host_os$ac_delim
-target!$target$ac_delim
-target_cpu!$target_cpu$ac_delim
-target_vendor!$target_vendor$ac_delim
-target_os!$target_os$ac_delim
-OS!$OS$ac_delim
-LINKALL!$LINKALL$ac_delim
-NOLINKALL!$NOLINKALL$ac_delim
-LLVM_ON_UNIX!$LLVM_ON_UNIX$ac_delim
-LLVM_ON_WIN32!$LLVM_ON_WIN32$ac_delim
-ARCH!$ARCH$ac_delim
-ENDIAN!$ENDIAN$ac_delim
-CC!$CC$ac_delim
-CFLAGS!$CFLAGS$ac_delim
-LDFLAGS!$LDFLAGS$ac_delim
-CPPFLAGS!$CPPFLAGS$ac_delim
-ac_ct_CC!$ac_ct_CC$ac_delim
-EXEEXT!$EXEEXT$ac_delim
-OBJEXT!$OBJEXT$ac_delim
-CPP!$CPP$ac_delim
-GREP!$GREP$ac_delim
-EGREP!$EGREP$ac_delim
-LLVM_CROSS_COMPILING!$LLVM_CROSS_COMPILING$ac_delim
-BUILD_CC!$BUILD_CC$ac_delim
-BUILD_EXEEXT!$BUILD_EXEEXT$ac_delim
-CVSBUILD!$CVSBUILD$ac_delim
-ENABLE_OPTIMIZED!$ENABLE_OPTIMIZED$ac_delim
-DISABLE_ASSERTIONS!$DISABLE_ASSERTIONS$ac_delim
-ENABLE_EXPENSIVE_CHECKS!$ENABLE_EXPENSIVE_CHECKS$ac_delim
-EXPENSIVE_CHECKS!$EXPENSIVE_CHECKS$ac_delim
-DEBUG_RUNTIME!$DEBUG_RUNTIME$ac_delim
-JIT!$JIT$ac_delim
-TARGET_HAS_JIT!$TARGET_HAS_JIT$ac_delim
-ENABLE_DOXYGEN!$ENABLE_DOXYGEN$ac_delim
-ENABLE_THREADS!$ENABLE_THREADS$ac_delim
-ENABLE_PIC!$ENABLE_PIC$ac_delim
-TARGETS_TO_BUILD!$TARGETS_TO_BUILD$ac_delim
-ENABLE_CBE_PRINTF_A!$ENABLE_CBE_PRINTF_A$ac_delim
-EXTRA_OPTIONS!$EXTRA_OPTIONS$ac_delim
-CXX!$CXX$ac_delim
-CXXFLAGS!$CXXFLAGS$ac_delim
-ac_ct_CXX!$ac_ct_CXX$ac_delim
-LEX!$LEX$ac_delim
-LEXLIB!$LEXLIB$ac_delim
-LEX_OUTPUT_ROOT!$LEX_OUTPUT_ROOT$ac_delim
-FLEX!$FLEX$ac_delim
-YACC!$YACC$ac_delim
-YFLAGS!$YFLAGS$ac_delim
-BISON!$BISON$ac_delim
-NM!$NM$ac_delim
-ifGNUmake!$ifGNUmake$ac_delim
-_ACEOF
-
- if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
- break
- elif $ac_last_try; then
- { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
-echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
- { (exit 1); exit 1; }; }
- else
- ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
- fi
-done
-
-ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed`
-if test -n "$ac_eof"; then
- ac_eof=`echo "$ac_eof" | sort -nru | sed 1q`
- ac_eof=`expr $ac_eof + 1`
-fi
-
-cat >>$CONFIG_STATUS <<_ACEOF
-cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof
-/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
-_ACEOF
-sed '
-s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g
-s/^/s,@/; s/!/@,|#_!!_#|/
-:n
-t n
-s/'"$ac_delim"'$/,g/; t
-s/$/\\/; p
-N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n
-' >>$CONFIG_STATUS <conf$$subs.sed
-rm -f conf$$subs.sed
-cat >>$CONFIG_STATUS <<_ACEOF
-CEOF$ac_eof
-_ACEOF
-
-
-ac_delim='%!_!# '
-for ac_last_try in false false false false false :; do
- cat >conf$$subs.sed <<_ACEOF
-LN_S!$LN_S$ac_delim
-CMP!$CMP$ac_delim
-CP!$CP$ac_delim
-DATE!$DATE$ac_delim
-FIND!$FIND$ac_delim
-MKDIR!$MKDIR$ac_delim
-MV!$MV$ac_delim
-RANLIB!$RANLIB$ac_delim
-RM!$RM$ac_delim
-SED!$SED$ac_delim
-TAR!$TAR$ac_delim
-BINPWD!$BINPWD$ac_delim
-GRAPHVIZ!$GRAPHVIZ$ac_delim
-DOT!$DOT$ac_delim
-GV!$GV$ac_delim
-DOTTY!$DOTTY$ac_delim
-PERL!$PERL$ac_delim
-HAVE_PERL!$HAVE_PERL$ac_delim
-INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim
-INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim
-INSTALL_DATA!$INSTALL_DATA$ac_delim
-BZIP2!$BZIP2$ac_delim
-DOXYGEN!$DOXYGEN$ac_delim
-GROFF!$GROFF$ac_delim
-GZIP!$GZIP$ac_delim
-POD2HTML!$POD2HTML$ac_delim
-POD2MAN!$POD2MAN$ac_delim
-RUNTEST!$RUNTEST$ac_delim
-TCLSH!$TCLSH$ac_delim
-ZIP!$ZIP$ac_delim
-OCAMLC!$OCAMLC$ac_delim
-OCAMLOPT!$OCAMLOPT$ac_delim
-OCAMLDEP!$OCAMLDEP$ac_delim
-OCAMLDOC!$OCAMLDOC$ac_delim
-INSTALL_LTDL_TRUE!$INSTALL_LTDL_TRUE$ac_delim
-INSTALL_LTDL_FALSE!$INSTALL_LTDL_FALSE$ac_delim
-CONVENIENCE_LTDL_TRUE!$CONVENIENCE_LTDL_TRUE$ac_delim
-CONVENIENCE_LTDL_FALSE!$CONVENIENCE_LTDL_FALSE$ac_delim
-LIBADD_DL!$LIBADD_DL$ac_delim
-ECHO!$ECHO$ac_delim
-AR!$AR$ac_delim
-STRIP!$STRIP$ac_delim
-CXXCPP!$CXXCPP$ac_delim
-F77!$F77$ac_delim
-FFLAGS!$FFLAGS$ac_delim
-ac_ct_F77!$ac_ct_F77$ac_delim
-LIBTOOL!$LIBTOOL$ac_delim
-LLVMGCC!$LLVMGCC$ac_delim
-LLVMGXX!$LLVMGXX$ac_delim
-USE_UDIS86!$USE_UDIS86$ac_delim
-HAVE_PTHREAD!$HAVE_PTHREAD$ac_delim
-HUGE_VAL_SANITY!$HUGE_VAL_SANITY$ac_delim
-ALLOCA!$ALLOCA$ac_delim
-MMAP_FILE!$MMAP_FILE$ac_delim
-LLVMCC1!$LLVMCC1$ac_delim
-LLVMCC1PLUS!$LLVMCC1PLUS$ac_delim
-LLVMGCCDIR!$LLVMGCCDIR$ac_delim
-LLVMGCCLIBEXEC!$LLVMGCCLIBEXEC$ac_delim
-LLVMGCC_VERSION!$LLVMGCC_VERSION$ac_delim
-LLVMGCC_MAJVERS!$LLVMGCC_MAJVERS$ac_delim
-LLVMGCC_LANGS!$LLVMGCC_LANGS$ac_delim
-SHLIBEXT!$SHLIBEXT$ac_delim
-LLVM_PREFIX!$LLVM_PREFIX$ac_delim
-LLVM_BINDIR!$LLVM_BINDIR$ac_delim
-LLVM_LIBDIR!$LLVM_LIBDIR$ac_delim
-LLVM_DATADIR!$LLVM_DATADIR$ac_delim
-LLVM_DOCSDIR!$LLVM_DOCSDIR$ac_delim
-LLVM_ETCDIR!$LLVM_ETCDIR$ac_delim
-LLVM_INCLUDEDIR!$LLVM_INCLUDEDIR$ac_delim
-LLVM_INFODIR!$LLVM_INFODIR$ac_delim
-LLVM_MANDIR!$LLVM_MANDIR$ac_delim
-LLVM_CONFIGTIME!$LLVM_CONFIGTIME$ac_delim
-BINDINGS_TO_BUILD!$BINDINGS_TO_BUILD$ac_delim
-ALL_BINDINGS!$ALL_BINDINGS$ac_delim
-OCAML_LIBDIR!$OCAML_LIBDIR$ac_delim
-LIBOBJS!$LIBOBJS$ac_delim
-LTLIBOBJS!$LTLIBOBJS$ac_delim
-_ACEOF
-
- if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 77; then
- break
- elif $ac_last_try; then
- { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
-echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
- { (exit 1); exit 1; }; }
- else
- ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
- fi
-done
-
-ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed`
-if test -n "$ac_eof"; then
- ac_eof=`echo "$ac_eof" | sort -nru | sed 1q`
- ac_eof=`expr $ac_eof + 1`
-fi
-
-cat >>$CONFIG_STATUS <<_ACEOF
-cat >"\$tmp/subs-2.sed" <<\CEOF$ac_eof
-/@[a-zA-Z_][a-zA-Z_0-9]*@/!b end
-_ACEOF
-sed '
-s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g
-s/^/s,@/; s/!/@,|#_!!_#|/
-:n
-t n
-s/'"$ac_delim"'$/,g/; t
-s/$/\\/; p
-N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n
-' >>$CONFIG_STATUS <conf$$subs.sed
-rm -f conf$$subs.sed
-cat >>$CONFIG_STATUS <<_ACEOF
-:end
-s/|#_!!_#|//g
-CEOF$ac_eof
-_ACEOF
-
-
-# VPATH may cause trouble with some makes, so we remove $(srcdir),
-# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
-# trailing colons and then remove the whole line if VPATH becomes empty
-# (actually we leave an empty line to preserve line numbers).
-if test "x$srcdir" = x.; then
- ac_vpsub='/^[ ]*VPATH[ ]*=/{
-s/:*\$(srcdir):*/:/
-s/:*\${srcdir}:*/:/
-s/:*@srcdir@:*/:/
-s/^\([^=]*=[ ]*\):*/\1/
-s/:*$//
-s/^[^=]*=[ ]*$//
-}'
-fi
-
-cat >>$CONFIG_STATUS <<\_ACEOF
-fi # test -n "$CONFIG_FILES"
-
-
-for ac_tag in :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS
-do
- case $ac_tag in
- :[FHLC]) ac_mode=$ac_tag; continue;;
- esac
- case $ac_mode$ac_tag in
- :[FHL]*:*);;
- :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5
-echo "$as_me: error: Invalid tag $ac_tag." >&2;}
- { (exit 1); exit 1; }; };;
- :[FH]-) ac_tag=-:-;;
- :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
- esac
- ac_save_IFS=$IFS
- IFS=:
- set x $ac_tag
- IFS=$ac_save_IFS
- shift
- ac_file=$1
- shift
-
- case $ac_mode in
- :L) ac_source=$1;;
- :[FH])
- ac_file_inputs=
- for ac_f
- do
- case $ac_f in
- -) ac_f="$tmp/stdin";;
- *) # Look for the file first in the build tree, then in the source tree
- # (if the path is not absolute). The absolute path cannot be DOS-style,
- # because $ac_f cannot contain `:'.
- test -f "$ac_f" ||
- case $ac_f in
- [\\/$]*) false;;
- *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
- esac ||
- { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5
-echo "$as_me: error: cannot find input file: $ac_f" >&2;}
- { (exit 1); exit 1; }; };;
- esac
- ac_file_inputs="$ac_file_inputs $ac_f"
- done
-
- # Let's still pretend it is `configure' which instantiates (i.e., don't
- # use $as_me), people would be surprised to read:
- # /* config.h. Generated by config.status. */
- configure_input="Generated from "`IFS=:
- echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure."
- if test x"$ac_file" != x-; then
- configure_input="$ac_file. $configure_input"
- { echo "$as_me:$LINENO: creating $ac_file" >&5
-echo "$as_me: creating $ac_file" >&6;}
- fi
-
- case $ac_tag in
- *:-:* | *:-) cat >"$tmp/stdin";;
- esac
- ;;
- esac
-
- ac_dir=`$as_dirname -- "$ac_file" ||
-$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$ac_file" : 'X\(//\)[^/]' \| \
- X"$ac_file" : 'X\(//\)$' \| \
- X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
-echo X"$ac_file" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
- { as_dir="$ac_dir"
- case $as_dir in #(
- -*) as_dir=./$as_dir;;
- esac
- test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || {
- as_dirs=
- while :; do
- case $as_dir in #(
- *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #(
- *) as_qdir=$as_dir;;
- esac
- as_dirs="'$as_qdir' $as_dirs"
- as_dir=`$as_dirname -- "$as_dir" ||
-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$as_dir" : 'X\(//\)[^/]' \| \
- X"$as_dir" : 'X\(//\)$' \| \
- X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
-echo X"$as_dir" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
- test -d "$as_dir" && break
- done
- test -z "$as_dirs" || eval "mkdir $as_dirs"
- } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
-echo "$as_me: error: cannot create directory $as_dir" >&2;}
- { (exit 1); exit 1; }; }; }
- ac_builddir=.
-
-case "$ac_dir" in
-.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
-*)
- ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
- # A ".." for each directory in $ac_dir_suffix.
- ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'`
- case $ac_top_builddir_sub in
- "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
- *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
- esac ;;
-esac
-ac_abs_top_builddir=$ac_pwd
-ac_abs_builddir=$ac_pwd$ac_dir_suffix
-# for backward compatibility:
-ac_top_builddir=$ac_top_build_prefix
-
-case $srcdir in
- .) # We are building in place.
- ac_srcdir=.
- ac_top_srcdir=$ac_top_builddir_sub
- ac_abs_top_srcdir=$ac_pwd ;;
- [\\/]* | ?:[\\/]* ) # Absolute name.
- ac_srcdir=$srcdir$ac_dir_suffix;
- ac_top_srcdir=$srcdir
- ac_abs_top_srcdir=$srcdir ;;
- *) # Relative name.
- ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
- ac_top_srcdir=$ac_top_build_prefix$srcdir
- ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
-esac
-ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
-
-
- case $ac_mode in
- :F)
- #
- # CONFIG_FILE
- #
-
- case $INSTALL in
- [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
- *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
- esac
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF
-# If the template does not know about datarootdir, expand it.
-# FIXME: This hack should be removed a few years after 2.60.
-ac_datarootdir_hack=; ac_datarootdir_seen=
-
-case `sed -n '/datarootdir/ {
- p
- q
-}
-/@datadir@/p
-/@docdir@/p
-/@infodir@/p
-/@localedir@/p
-/@mandir@/p
-' $ac_file_inputs` in
-*datarootdir*) ac_datarootdir_seen=yes;;
-*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
- { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
-echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF
- ac_datarootdir_hack='
- s&@datadir@&$datadir&g
- s&@docdir@&$docdir&g
- s&@infodir@&$infodir&g
- s&@localedir@&$localedir&g
- s&@mandir@&$mandir&g
- s&\\\${datarootdir}&$datarootdir&g' ;;
-esac
-_ACEOF
-
-# Neutralize VPATH when `$srcdir' = `.'.
-# Shell code in configure.ac might set extrasub.
-# FIXME: do we really want to maintain this feature?
-cat >>$CONFIG_STATUS <<_ACEOF
- sed "$ac_vpsub
-$extrasub
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
-:t
-/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
-s&@configure_input@&$configure_input&;t t
-s&@top_builddir@&$ac_top_builddir_sub&;t t
-s&@srcdir@&$ac_srcdir&;t t
-s&@abs_srcdir@&$ac_abs_srcdir&;t t
-s&@top_srcdir@&$ac_top_srcdir&;t t
-s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
-s&@builddir@&$ac_builddir&;t t
-s&@abs_builddir@&$ac_abs_builddir&;t t
-s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
-s&@INSTALL@&$ac_INSTALL&;t t
-$ac_datarootdir_hack
-" $ac_file_inputs | sed -f "$tmp/subs-1.sed" | sed -f "$tmp/subs-2.sed" >$tmp/out
-
-test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
- { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
- { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
- { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir'
-which seems to be undefined. Please make sure it is defined." >&5
-echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
-which seems to be undefined. Please make sure it is defined." >&2;}
-
- rm -f "$tmp/stdin"
- case $ac_file in
- -) cat "$tmp/out"; rm -f "$tmp/out";;
- *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;;
- esac
- ;;
- :H)
- #
- # CONFIG_HEADER
- #
-_ACEOF
-
-# Transform confdefs.h into a sed script `conftest.defines', that
-# substitutes the proper values into config.h.in to produce config.h.
-rm -f conftest.defines conftest.tail
-# First, append a space to every undef/define line, to ease matching.
-echo 's/$/ /' >conftest.defines
-# Then, protect against being on the right side of a sed subst, or in
-# an unquoted here document, in config.status. If some macros were
-# called several times there might be several #defines for the same
-# symbol, which is useless. But do not sort them, since the last
-# AC_DEFINE must be honored.
-ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
-# These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where
-# NAME is the cpp macro being defined, VALUE is the value it is being given.
-# PARAMS is the parameter list in the macro definition--in most cases, it's
-# just an empty string.
-ac_dA='s,^\\([ #]*\\)[^ ]*\\([ ]*'
-ac_dB='\\)[ (].*,\\1define\\2'
-ac_dC=' '
-ac_dD=' ,'
-
-uniq confdefs.h |
- sed -n '
- t rset
- :rset
- s/^[ ]*#[ ]*define[ ][ ]*//
- t ok
- d
- :ok
- s/[\\&,]/\\&/g
- s/^\('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p
- s/^\('"$ac_word_re"'\)[ ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p
- ' >>conftest.defines
-
-# Remove the space that was appended to ease matching.
-# Then replace #undef with comments. This is necessary, for
-# example, in the case of _POSIX_SOURCE, which is predefined and required
-# on some systems where configure will not decide to define it.
-# (The regexp can be short, since the line contains either #define or #undef.)
-echo 's/ $//
-s,^[ #]*u.*,/* & */,' >>conftest.defines
-
-# Break up conftest.defines:
-ac_max_sed_lines=50
-
-# First sed command is: sed -f defines.sed $ac_file_inputs >"$tmp/out1"
-# Second one is: sed -f defines.sed "$tmp/out1" >"$tmp/out2"
-# Third one will be: sed -f defines.sed "$tmp/out2" >"$tmp/out1"
-# et cetera.
-ac_in='$ac_file_inputs'
-ac_out='"$tmp/out1"'
-ac_nxt='"$tmp/out2"'
-
-while :
-do
- # Write a here document:
- cat >>$CONFIG_STATUS <<_ACEOF
- # First, check the format of the line:
- cat >"\$tmp/defines.sed" <<\\CEOF
-/^[ ]*#[ ]*undef[ ][ ]*$ac_word_re[ ]*\$/b def
-/^[ ]*#[ ]*define[ ][ ]*$ac_word_re[( ]/b def
-b
-:def
-_ACEOF
- sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS
- echo 'CEOF
- sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS
- ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in
- sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail
- grep . conftest.tail >/dev/null || break
- rm -f conftest.defines
- mv conftest.tail conftest.defines
-done
-rm -f conftest.defines conftest.tail
-
-echo "ac_result=$ac_in" >>$CONFIG_STATUS
-cat >>$CONFIG_STATUS <<\_ACEOF
- if test x"$ac_file" != x-; then
- echo "/* $configure_input */" >"$tmp/config.h"
- cat "$ac_result" >>"$tmp/config.h"
- if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then
- { echo "$as_me:$LINENO: $ac_file is unchanged" >&5
-echo "$as_me: $ac_file is unchanged" >&6;}
- else
- rm -f $ac_file
- mv "$tmp/config.h" $ac_file
- fi
- else
- echo "/* $configure_input */"
- cat "$ac_result"
- fi
- rm -f "$tmp/out12"
- ;;
-
- :C) { echo "$as_me:$LINENO: executing $ac_file commands" >&5
-echo "$as_me: executing $ac_file commands" >&6;}
- ;;
- esac
-
-
- case $ac_file$ac_mode in
- "Makefile":C) ${llvm_src}/autoconf/mkinstalldirs `dirname Makefile`
- ${SHELL} ${llvm_src}/autoconf/install-sh -c ${srcdir}/Makefile Makefile ;;
- "Makefile.common":C) ${llvm_src}/autoconf/mkinstalldirs `dirname Makefile.common`
- ${SHELL} ${llvm_src}/autoconf/install-sh -c ${srcdir}/Makefile.common Makefile.common ;;
- "examples/Makefile":C) ${llvm_src}/autoconf/mkinstalldirs `dirname examples/Makefile`
- ${SHELL} ${llvm_src}/autoconf/install-sh -c ${srcdir}/examples/Makefile examples/Makefile ;;
- "lib/Makefile":C) ${llvm_src}/autoconf/mkinstalldirs `dirname lib/Makefile`
- ${SHELL} ${llvm_src}/autoconf/install-sh -c ${srcdir}/lib/Makefile lib/Makefile ;;
- "runtime/Makefile":C) ${llvm_src}/autoconf/mkinstalldirs `dirname runtime/Makefile`
- ${SHELL} ${llvm_src}/autoconf/install-sh -c ${srcdir}/runtime/Makefile runtime/Makefile ;;
- "test/Makefile":C) ${llvm_src}/autoconf/mkinstalldirs `dirname test/Makefile`
- ${SHELL} ${llvm_src}/autoconf/install-sh -c ${srcdir}/test/Makefile test/Makefile ;;
- "test/Makefile.tests":C) ${llvm_src}/autoconf/mkinstalldirs `dirname test/Makefile.tests`
- ${SHELL} ${llvm_src}/autoconf/install-sh -c ${srcdir}/test/Makefile.tests test/Makefile.tests ;;
- "tools/Makefile":C) ${llvm_src}/autoconf/mkinstalldirs `dirname tools/Makefile`
- ${SHELL} ${llvm_src}/autoconf/install-sh -c ${srcdir}/tools/Makefile tools/Makefile ;;
- "utils/Makefile":C) ${llvm_src}/autoconf/mkinstalldirs `dirname utils/Makefile`
- ${SHELL} ${llvm_src}/autoconf/install-sh -c ${srcdir}/utils/Makefile utils/Makefile ;;
- "projects/Makefile":C) ${llvm_src}/autoconf/mkinstalldirs `dirname projects/Makefile`
- ${SHELL} ${llvm_src}/autoconf/install-sh -c ${srcdir}/projects/Makefile projects/Makefile ;;
- "bindings/Makefile":C) ${llvm_src}/autoconf/mkinstalldirs `dirname bindings/Makefile`
- ${SHELL} ${llvm_src}/autoconf/install-sh -c ${srcdir}/bindings/Makefile bindings/Makefile ;;
- "bindings/ocaml/Makefile.ocaml":C) ${llvm_src}/autoconf/mkinstalldirs `dirname bindings/ocaml/Makefile.ocaml`
- ${SHELL} ${llvm_src}/autoconf/install-sh -c ${srcdir}/bindings/ocaml/Makefile.ocaml bindings/ocaml/Makefile.ocaml ;;
-
- esac
-done # for ac_tag
-
-
-{ (exit 0); exit 0; }
-_ACEOF
-chmod +x $CONFIG_STATUS
-ac_clean_files=$ac_clean_files_save
-
-
-# configure is writing to config.log, and then calls config.status.
-# config.status does its own redirection, appending to config.log.
-# Unfortunately, on DOS this fails, as config.log is still kept open
-# by configure, so config.status won't be able to write to it; its
-# output is simply discarded. So we exec the FD to /dev/null,
-# effectively closing config.log, so it can be properly (re)opened and
-# appended to by config.status. When coming back to configure, we
-# need to make the FD available again.
-if test "$no_create" != yes; then
- ac_cs_success=:
- ac_config_status_args=
- test "$silent" = yes &&
- ac_config_status_args="$ac_config_status_args --quiet"
- exec 5>/dev/null
- $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
- exec 5>>config.log
- # Use ||, not &&, to avoid exiting from the if with $? = 1, which
- # would make configure fail if this is the last instruction.
- $ac_cs_success || { (exit 1); exit 1; }
-fi
-
-#
-# CONFIG_SUBDIRS section.
-#
-if test "$no_recursion" != yes; then
-
- # Remove --cache-file and --srcdir arguments so they do not pile up.
- ac_sub_configure_args=
- ac_prev=
- eval "set x $ac_configure_args"
- shift
- for ac_arg
- do
- if test -n "$ac_prev"; then
- ac_prev=
- continue
- fi
- case $ac_arg in
- -cache-file | --cache-file | --cache-fil | --cache-fi \
- | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
- ac_prev=cache_file ;;
- -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
- | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* \
- | --c=*)
- ;;
- --config-cache | -C)
- ;;
- -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
- ac_prev=srcdir ;;
- -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
- ;;
- -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
- ac_prev=prefix ;;
- -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
- ;;
- *)
- case $ac_arg in
- *\'*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
- esac
- ac_sub_configure_args="$ac_sub_configure_args '$ac_arg'" ;;
- esac
- done
-
- # Always prepend --prefix to ensure using the same prefix
- # in subdir configurations.
- ac_arg="--prefix=$prefix"
- case $ac_arg in
- *\'*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
- esac
- ac_sub_configure_args="$ac_arg $ac_sub_configure_args"
-
- ac_popdir=`pwd`
- for ac_dir in : $subdirs; do test "x$ac_dir" = x: && continue
-
- # Do not complain, so a configure script can configure whichever
- # parts of a large source tree are present.
- test -d "$srcdir/$ac_dir" || continue
-
- ac_msg="=== configuring in $ac_dir (`pwd`/$ac_dir)"
- echo "$as_me:$LINENO: $ac_msg" >&5
- echo "$ac_msg" >&6
- { as_dir="$ac_dir"
- case $as_dir in #(
- -*) as_dir=./$as_dir;;
- esac
- test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || {
- as_dirs=
- while :; do
- case $as_dir in #(
- *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #(
- *) as_qdir=$as_dir;;
- esac
- as_dirs="'$as_qdir' $as_dirs"
- as_dir=`$as_dirname -- "$as_dir" ||
-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$as_dir" : 'X\(//\)[^/]' \| \
- X"$as_dir" : 'X\(//\)$' \| \
- X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
-echo X"$as_dir" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
- test -d "$as_dir" && break
- done
- test -z "$as_dirs" || eval "mkdir $as_dirs"
- } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
-echo "$as_me: error: cannot create directory $as_dir" >&2;}
- { (exit 1); exit 1; }; }; }
- ac_builddir=.
-
-case "$ac_dir" in
-.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
-*)
- ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
- # A ".." for each directory in $ac_dir_suffix.
- ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'`
- case $ac_top_builddir_sub in
- "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
- *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
- esac ;;
-esac
-ac_abs_top_builddir=$ac_pwd
-ac_abs_builddir=$ac_pwd$ac_dir_suffix
-# for backward compatibility:
-ac_top_builddir=$ac_top_build_prefix
-
-case $srcdir in
- .) # We are building in place.
- ac_srcdir=.
- ac_top_srcdir=$ac_top_builddir_sub
- ac_abs_top_srcdir=$ac_pwd ;;
- [\\/]* | ?:[\\/]* ) # Absolute name.
- ac_srcdir=$srcdir$ac_dir_suffix;
- ac_top_srcdir=$srcdir
- ac_abs_top_srcdir=$srcdir ;;
- *) # Relative name.
- ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
- ac_top_srcdir=$ac_top_build_prefix$srcdir
- ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
-esac
-ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
-
-
- cd "$ac_dir"
-
- # Check for guested configure; otherwise get Cygnus style configure.
- if test -f "$ac_srcdir/configure.gnu"; then
- ac_sub_configure=$ac_srcdir/configure.gnu
- elif test -f "$ac_srcdir/configure"; then
- ac_sub_configure=$ac_srcdir/configure
- elif test -f "$ac_srcdir/configure.in"; then
- # This should be Cygnus configure.
- ac_sub_configure=$ac_aux_dir/configure
- else
- { echo "$as_me:$LINENO: WARNING: no configuration information is in $ac_dir" >&5
-echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2;}
- ac_sub_configure=
- fi
-
- # The recursion is here.
- if test -n "$ac_sub_configure"; then
- # Make the cache file name correct relative to the subdirectory.
- case $cache_file in
- [\\/]* | ?:[\\/]* ) ac_sub_cache_file=$cache_file ;;
- *) # Relative name.
- ac_sub_cache_file=$ac_top_build_prefix$cache_file ;;
- esac
-
- { echo "$as_me:$LINENO: running $SHELL $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir" >&5
-echo "$as_me: running $SHELL $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir" >&6;}
- # The eval makes quoting arguments work.
- eval "\$SHELL \"\$ac_sub_configure\" $ac_sub_configure_args \
- --cache-file=\"\$ac_sub_cache_file\" --srcdir=\"\$ac_srcdir\"" ||
- { { echo "$as_me:$LINENO: error: $ac_sub_configure failed for $ac_dir" >&5
-echo "$as_me: error: $ac_sub_configure failed for $ac_dir" >&2;}
- { (exit 1); exit 1; }; }
- fi
-
- cd "$ac_popdir"
- done
-fi
-
diff --git a/release_23/docs/AliasAnalysis.html b/release_23/docs/AliasAnalysis.html
deleted file mode 100644
index 6663f0caa75f..000000000000
--- a/release_23/docs/AliasAnalysis.html
+++ /dev/null
@@ -1,984 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
- "http://www.w3.org/TR/html4/strict.dtd">
-<html>
-<head>
- <title>LLVM Alias Analysis Infrastructure</title>
- <link rel="stylesheet" href="llvm.css" type="text/css">
-</head>
-<body>
-
-<div class="doc_title">
- LLVM Alias Analysis Infrastructure
-</div>
-
-<ol>
- <li><a href="#introduction">Introduction</a></li>
-
- <li><a href="#overview"><tt>AliasAnalysis</tt> Class Overview</a>
- <ul>
- <li><a href="#pointers">Representation of Pointers</a></li>
- <li><a href="#alias">The <tt>alias</tt> method</a></li>
- <li><a href="#ModRefInfo">The <tt>getModRefInfo</tt> methods</a></li>
- <li><a href="#OtherItfs">Other useful <tt>AliasAnalysis</tt> methods</a></li>
- </ul>
- </li>
-
- <li><a href="#writingnew">Writing a new <tt>AliasAnalysis</tt> Implementation</a>
- <ul>
- <li><a href="#passsubclasses">Different Pass styles</a></li>
- <li><a href="#requiredcalls">Required initialization calls</a></li>
- <li><a href="#interfaces">Interfaces which may be specified</a></li>
- <li><a href="#chaining"><tt>AliasAnalysis</tt> chaining behavior</a></li>
- <li><a href="#updating">Updating analysis results for transformations</a></li>
- <li><a href="#implefficiency">Efficiency Issues</a></li>
- </ul>
- </li>
-
- <li><a href="#using">Using alias analysis results</a>
- <ul>
- <li><a href="#loadvn">Using the <tt>-load-vn</tt> Pass</a></li>
- <li><a href="#ast">Using the <tt>AliasSetTracker</tt> class</a></li>
- <li><a href="#direct">Using the <tt>AliasAnalysis</tt> interface directly</a></li>
- </ul>
- </li>
-
- <li><a href="#exist">Existing alias analysis implementations and clients</a>
- <ul>
- <li><a href="#impls">Available <tt>AliasAnalysis</tt> implementations</a></li>
- <li><a href="#aliasanalysis-xforms">Alias analysis driven transformations</a></li>
- <li><a href="#aliasanalysis-debug">Clients for debugging and evaluation of
- implementations</a></li>
- </ul>
- </li>
- <li><a href="#memdep">Memory Dependence Analysis</a></li>
-</ol>
-
-<div class="doc_author">
- <p>Written by <a href="mailto:sabre@nondot.org">Chris Lattner</a></p>
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section">
- <a name="introduction">Introduction</a>
-</div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>Alias Analysis (aka Pointer Analysis) is a class of techniques which attempt
-to determine whether or not two pointers ever can point to the same object in
-memory. There are many different algorithms for alias analysis and many
-different ways of classifying them: flow-sensitive vs flow-insensitive,
-context-sensitive vs context-insensitive, field-sensitive vs field-insensitive,
-unification-based vs subset-based, etc. Traditionally, alias analyses respond
-to a query with a <a href="#MustMayNo">Must, May, or No</a> alias response,
-indicating that two pointers always point to the same object, might point to the
-same object, or are known to never point to the same object.</p>
-
-<p>The LLVM <a
-href="http://llvm.org/doxygen/classllvm_1_1AliasAnalysis.html"><tt>AliasAnalysis</tt></a>
-class is the primary interface used by clients and implementations of alias
-analyses in the LLVM system. This class is the common interface between clients
-of alias analysis information and the implementations providing it, and is
-designed to support a wide range of implementations and clients (but currently
-all clients are assumed to be flow-insensitive). In addition to simple alias
-analysis information, this class exposes Mod/Ref information from those
-implementations which can provide it, allowing for powerful analyses and
-transformations to work well together.</p>
-
-<p>This document contains information necessary to successfully implement this
-interface, use it, and to test both sides. It also explains some of the finer
-points about what exactly results mean. If you feel that something is unclear
-or should be added, please <a href="mailto:sabre@nondot.org">let me
-know</a>.</p>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section">
- <a name="overview"><tt>AliasAnalysis</tt> Class Overview</a>
-</div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>The <a
-href="http://llvm.org/doxygen/classllvm_1_1AliasAnalysis.html"><tt>AliasAnalysis</tt></a>
-class defines the interface that the various alias analysis implementations
-should support. This class exports two important enums: <tt>AliasResult</tt>
-and <tt>ModRefResult</tt> which represent the result of an alias query or a
-mod/ref query, respectively.</p>
-
-<p>The <tt>AliasAnalysis</tt> interface exposes information about memory,
-represented in several different ways. In particular, memory objects are
-represented as a starting address and size, and function calls are represented
-as the actual <tt>call</tt> or <tt>invoke</tt> instructions that performs the
-call. The <tt>AliasAnalysis</tt> interface also exposes some helper methods
-which allow you to get mod/ref information for arbitrary instructions.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="pointers">Representation of Pointers</a>
-</div>
-
-<div class="doc_text">
-
-<p>Most importantly, the <tt>AliasAnalysis</tt> class provides several methods
-which are used to query whether or not two memory objects alias, whether
-function calls can modify or read a memory object, etc. For all of these
-queries, memory objects are represented as a pair of their starting address (a
-symbolic LLVM <tt>Value*</tt>) and a static size.</p>
-
-<p>Representing memory objects as a starting address and a size is critically
-important for correct Alias Analyses. For example, consider this (silly, but
-possible) C code:</p>
-
-<div class="doc_code">
-<pre>
-int i;
-char C[2];
-char A[10];
-/* ... */
-for (i = 0; i != 10; ++i) {
- C[0] = A[i]; /* One byte store */
- C[1] = A[9-i]; /* One byte store */
-}
-</pre>
-</div>
-
-<p>In this case, the <tt>basicaa</tt> pass will disambiguate the stores to
-<tt>C[0]</tt> and <tt>C[1]</tt> because they are accesses to two distinct
-locations one byte apart, and the accesses are each one byte. In this case, the
-LICM pass can use store motion to remove the stores from the loop. In
-constrast, the following code:</p>
-
-<div class="doc_code">
-<pre>
-int i;
-char C[2];
-char A[10];
-/* ... */
-for (i = 0; i != 10; ++i) {
- ((short*)C)[0] = A[i]; /* Two byte store! */
- C[1] = A[9-i]; /* One byte store */
-}
-</pre>
-</div>
-
-<p>In this case, the two stores to C do alias each other, because the access to
-the <tt>&amp;C[0]</tt> element is a two byte access. If size information wasn't
-available in the query, even the first case would have to conservatively assume
-that the accesses alias.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="alias">The <tt>alias</tt> method</a>
-</div>
-
-<div class="doc_text">
-The <tt>alias</tt> method is the primary interface used to determine whether or
-not two memory objects alias each other. It takes two memory objects as input
-and returns MustAlias, MayAlias, or NoAlias as appropriate.
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="MustMayNo">Must, May, and No Alias Responses</a>
-</div>
-
-<div class="doc_text">
-
-<p>An Alias Analysis implementation can return one of three responses:
-MustAlias, MayAlias, and NoAlias. The No and May alias results are obvious: if
-the two pointers can never equal each other, return NoAlias, if they might,
-return MayAlias.</p>
-
-<p>The MustAlias response is trickier though. In LLVM, the Must Alias response
-may only be returned if the two memory objects are guaranteed to always start at
-exactly the same location. If two memory objects overlap, but do not start at
-the same location, return MayAlias.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="ModRefInfo">The <tt>getModRefInfo</tt> methods</a>
-</div>
-
-<div class="doc_text">
-
-<p>The <tt>getModRefInfo</tt> methods return information about whether the
-execution of an instruction can read or modify a memory location. Mod/Ref
-information is always conservative: if an instruction <b>might</b> read or write
-a location, ModRef is returned.</p>
-
-<p>The <tt>AliasAnalysis</tt> class also provides a <tt>getModRefInfo</tt>
-method for testing dependencies between function calls. This method takes two
-call sites (CS1 &amp; CS2), returns NoModRef if the two calls refer to disjoint
-memory locations, Ref if CS1 reads memory written by CS2, Mod if CS1 writes to
-memory read or written by CS2, or ModRef if CS1 might read or write memory
-accessed by CS2. Note that this relation is not commutative. Clients that use
-this method should be predicated on the <tt>hasNoModRefInfoForCalls()</tt>
-method, which indicates whether or not an analysis can provide mod/ref
-information for function call pairs (most can not). If this predicate is false,
-the client shouldn't waste analysis time querying the <tt>getModRefInfo</tt>
-method many times.</p>
-
-</div>
-
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="OtherItfs">Other useful <tt>AliasAnalysis</tt> methods</a>
-</div>
-
-<div class="doc_text">
-
-<p>
-Several other tidbits of information are often collected by various alias
-analysis implementations and can be put to good use by various clients.
-</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- The <tt>getMustAliases</tt> method
-</div>
-
-<div class="doc_text">
-
-<p>The <tt>getMustAliases</tt> method returns all values that are known to
-always must alias a pointer. This information can be provided in some cases for
-important objects like the null pointer and global values. Knowing that a
-pointer always points to a particular function allows indirect calls to be
-turned into direct calls, for example.</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- The <tt>pointsToConstantMemory</tt> method
-</div>
-
-<div class="doc_text">
-
-<p>The <tt>pointsToConstantMemory</tt> method returns true if and only if the
-analysis can prove that the pointer only points to unchanging memory locations
-(functions, constant global variables, and the null pointer). This information
-can be used to refine mod/ref information: it is impossible for an unchanging
-memory location to be modified.</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="simplemodref">The <tt>doesNotAccessMemory</tt> and
- <tt>onlyReadsMemory</tt> methods</a>
-</div>
-
-<div class="doc_text">
-
-<p>These methods are used to provide very simple mod/ref information for
-function calls. The <tt>doesNotAccessMemory</tt> method returns true for a
-function if the analysis can prove that the function never reads or writes to
-memory, or if the function only reads from constant memory. Functions with this
-property are side-effect free and only depend on their input arguments, allowing
-them to be eliminated if they form common subexpressions or be hoisted out of
-loops. Many common functions behave this way (e.g., <tt>sin</tt> and
-<tt>cos</tt>) but many others do not (e.g., <tt>acos</tt>, which modifies the
-<tt>errno</tt> variable).</p>
-
-<p>The <tt>onlyReadsMemory</tt> method returns true for a function if analysis
-can prove that (at most) the function only reads from non-volatile memory.
-Functions with this property are side-effect free, only depending on their input
-arguments and the state of memory when they are called. This property allows
-calls to these functions to be eliminated and moved around, as long as there is
-no store instruction that changes the contents of memory. Note that all
-functions that satisfy the <tt>doesNotAccessMemory</tt> method also satisfies
-<tt>onlyReadsMemory</tt>.</p>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section">
- <a name="writingnew">Writing a new <tt>AliasAnalysis</tt> Implementation</a>
-</div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>Writing a new alias analysis implementation for LLVM is quite
-straight-forward. There are already several implementations that you can use
-for examples, and the following information should help fill in any details.
-For a examples, take a look at the <a href="#impls">various alias analysis
-implementations</a> included with LLVM.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="passsubclasses">Different Pass styles</a>
-</div>
-
-<div class="doc_text">
-
-<p>The first step to determining what type of <a
-href="WritingAnLLVMPass.html">LLVM pass</a> you need to use for your Alias
-Analysis. As is the case with most other analyses and transformations, the
-answer should be fairly obvious from what type of problem you are trying to
-solve:</p>
-
-<ol>
- <li>If you require interprocedural analysis, it should be a
- <tt>Pass</tt>.</li>
- <li>If you are a function-local analysis, subclass <tt>FunctionPass</tt>.</li>
- <li>If you don't need to look at the program at all, subclass
- <tt>ImmutablePass</tt>.</li>
-</ol>
-
-<p>In addition to the pass that you subclass, you should also inherit from the
-<tt>AliasAnalysis</tt> interface, of course, and use the
-<tt>RegisterAnalysisGroup</tt> template to register as an implementation of
-<tt>AliasAnalysis</tt>.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="requiredcalls">Required initialization calls</a>
-</div>
-
-<div class="doc_text">
-
-<p>Your subclass of <tt>AliasAnalysis</tt> is required to invoke two methods on
-the <tt>AliasAnalysis</tt> base class: <tt>getAnalysisUsage</tt> and
-<tt>InitializeAliasAnalysis</tt>. In particular, your implementation of
-<tt>getAnalysisUsage</tt> should explicitly call into the
-<tt>AliasAnalysis::getAnalysisUsage</tt> method in addition to doing any
-declaring any pass dependencies your pass has. Thus you should have something
-like this:</p>
-
-<div class="doc_code">
-<pre>
-void getAnalysisUsage(AnalysisUsage &amp;AU) const {
- AliasAnalysis::getAnalysisUsage(AU);
- <i>// declare your dependencies here.</i>
-}
-</pre>
-</div>
-
-<p>Additionally, your must invoke the <tt>InitializeAliasAnalysis</tt> method
-from your analysis run method (<tt>run</tt> for a <tt>Pass</tt>,
-<tt>runOnFunction</tt> for a <tt>FunctionPass</tt>, or <tt>InitializePass</tt>
-for an <tt>ImmutablePass</tt>). For example (as part of a <tt>Pass</tt>):</p>
-
-<div class="doc_code">
-<pre>
-bool run(Module &amp;M) {
- InitializeAliasAnalysis(this);
- <i>// Perform analysis here...</i>
- return false;
-}
-</pre>
-</div>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="interfaces">Interfaces which may be specified</a>
-</div>
-
-<div class="doc_text">
-
-<p>All of the <a
-href="/doxygen/classllvm_1_1AliasAnalysis.html"><tt>AliasAnalysis</tt></a>
-virtual methods default to providing <a href="#chaining">chaining</a> to another
-alias analysis implementation, which ends up returning conservatively correct
-information (returning "May" Alias and "Mod/Ref" for alias and mod/ref queries
-respectively). Depending on the capabilities of the analysis you are
-implementing, you just override the interfaces you can improve.</p>
-
-</div>
-
-
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="chaining"><tt>AliasAnalysis</tt> chaining behavior</a>
-</div>
-
-<div class="doc_text">
-
-<p>With only two special exceptions (the <tt><a
-href="#basic-aa">basicaa</a></tt> and <a href="#no-aa"><tt>no-aa</tt></a>
-passes) every alias analysis pass chains to another alias analysis
-implementation (for example, the user can specify "<tt>-basicaa -ds-aa
--anders-aa -licm</tt>" to get the maximum benefit from the three alias
-analyses). The alias analysis class automatically takes care of most of this
-for methods that you don't override. For methods that you do override, in code
-paths that return a conservative MayAlias or Mod/Ref result, simply return
-whatever the superclass computes. For example:</p>
-
-<div class="doc_code">
-<pre>
-AliasAnalysis::AliasResult alias(const Value *V1, unsigned V1Size,
- const Value *V2, unsigned V2Size) {
- if (...)
- return NoAlias;
- ...
-
- <i>// Couldn't determine a must or no-alias result.</i>
- return AliasAnalysis::alias(V1, V1Size, V2, V2Size);
-}
-</pre>
-</div>
-
-<p>In addition to analysis queries, you must make sure to unconditionally pass
-LLVM <a href="#updating">update notification</a> methods to the superclass as
-well if you override them, which allows all alias analyses in a change to be
-updated.</p>
-
-</div>
-
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="updating">Updating analysis results for transformations</a>
-</div>
-
-<div class="doc_text">
-<p>
-Alias analysis information is initially computed for a static snapshot of the
-program, but clients will use this information to make transformations to the
-code. All but the most trivial forms of alias analysis will need to have their
-analysis results updated to reflect the changes made by these transformations.
-</p>
-
-<p>
-The <tt>AliasAnalysis</tt> interface exposes two methods which are used to
-communicate program changes from the clients to the analysis implementations.
-Various alias analysis implementations should use these methods to ensure that
-their internal data structures are kept up-to-date as the program changes (for
-example, when an instruction is deleted), and clients of alias analysis must be
-sure to call these interfaces appropriately.
-</p>
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">The <tt>deleteValue</tt> method</div>
-
-<div class="doc_text">
-The <tt>deleteValue</tt> method is called by transformations when they remove an
-instruction or any other value from the program (including values that do not
-use pointers). Typically alias analyses keep data structures that have entries
-for each value in the program. When this method is called, they should remove
-any entries for the specified value, if they exist.
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">The <tt>copyValue</tt> method</div>
-
-<div class="doc_text">
-The <tt>copyValue</tt> method is used when a new value is introduced into the
-program. There is no way to introduce a value into the program that did not
-exist before (this doesn't make sense for a safe compiler transformation), so
-this is the only way to introduce a new value. This method indicates that the
-new value has exactly the same properties as the value being copied.
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">The <tt>replaceWithNewValue</tt> method</div>
-
-<div class="doc_text">
-This method is a simple helper method that is provided to make clients easier to
-use. It is implemented by copying the old analysis information to the new
-value, then deleting the old value. This method cannot be overridden by alias
-analysis implementations.
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="implefficiency">Efficiency Issues</a>
-</div>
-
-<div class="doc_text">
-
-<p>From the LLVM perspective, the only thing you need to do to provide an
-efficient alias analysis is to make sure that alias analysis <b>queries</b> are
-serviced quickly. The actual calculation of the alias analysis results (the
-"run" method) is only performed once, but many (perhaps duplicate) queries may
-be performed. Because of this, try to move as much computation to the run
-method as possible (within reason).</p>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section">
- <a name="using">Using alias analysis results</a>
-</div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>There are several different ways to use alias analysis results. In order of
-preference, these are...</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="loadvn">Using the <tt>-load-vn</tt> Pass</a>
-</div>
-
-<div class="doc_text">
-
-<p>The <tt>load-vn</tt> pass uses alias analysis to provide value numbering
-information for <tt>load</tt> instructions and pointer values. If your analysis
-or transformation can be modeled in a form that uses value numbering
-information, you don't have to do anything special to handle load instructions:
-just use the <tt>load-vn</tt> pass, which uses alias analysis.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="ast">Using the <tt>AliasSetTracker</tt> class</a>
-</div>
-
-<div class="doc_text">
-
-<p>Many transformations need information about alias <b>sets</b> that are active
-in some scope, rather than information about pairwise aliasing. The <tt><a
-href="/doxygen/classllvm_1_1AliasSetTracker.html">AliasSetTracker</a></tt> class
-is used to efficiently build these Alias Sets from the pairwise alias analysis
-information provided by the <tt>AliasAnalysis</tt> interface.</p>
-
-<p>First you initialize the AliasSetTracker by using the "<tt>add</tt>" methods
-to add information about various potentially aliasing instructions in the scope
-you are interested in. Once all of the alias sets are completed, your pass
-should simply iterate through the constructed alias sets, using the
-<tt>AliasSetTracker</tt> <tt>begin()</tt>/<tt>end()</tt> methods.</p>
-
-<p>The <tt>AliasSet</tt>s formed by the <tt>AliasSetTracker</tt> are guaranteed
-to be disjoint, calculate mod/ref information and volatility for the set, and
-keep track of whether or not all of the pointers in the set are Must aliases.
-The AliasSetTracker also makes sure that sets are properly folded due to call
-instructions, and can provide a list of pointers in each set.</p>
-
-<p>As an example user of this, the <a href="/doxygen/structLICM.html">Loop
-Invariant Code Motion</a> pass uses <tt>AliasSetTracker</tt>s to calculate alias
-sets for each loop nest. If an <tt>AliasSet</tt> in a loop is not modified,
-then all load instructions from that set may be hoisted out of the loop. If any
-alias sets are stored to <b>and</b> are must alias sets, then the stores may be
-sunk to outside of the loop, promoting the memory location to a register for the
-duration of the loop nest. Both of these transformations only apply if the
-pointer argument is loop-invariant.</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- The AliasSetTracker implementation
-</div>
-
-<div class="doc_text">
-
-<p>The AliasSetTracker class is implemented to be as efficient as possible. It
-uses the union-find algorithm to efficiently merge AliasSets when a pointer is
-inserted into the AliasSetTracker that aliases multiple sets. The primary data
-structure is a hash table mapping pointers to the AliasSet they are in.</p>
-
-<p>The AliasSetTracker class must maintain a list of all of the LLVM Value*'s
-that are in each AliasSet. Since the hash table already has entries for each
-LLVM Value* of interest, the AliasesSets thread the linked list through these
-hash-table nodes to avoid having to allocate memory unnecessarily, and to make
-merging alias sets extremely efficient (the linked list merge is constant time).
-</p>
-
-<p>You shouldn't need to understand these details if you are just a client of
-the AliasSetTracker, but if you look at the code, hopefully this brief
-description will help make sense of why things are designed the way they
-are.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="direct">Using the <tt>AliasAnalysis</tt> interface directly</a>
-</div>
-
-<div class="doc_text">
-
-<p>If neither of these utility class are what your pass needs, you should use
-the interfaces exposed by the <tt>AliasAnalysis</tt> class directly. Try to use
-the higher-level methods when possible (e.g., use mod/ref information instead of
-the <a href="#alias"><tt>alias</tt></a> method directly if possible) to get the
-best precision and efficiency.</p>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section">
- <a name="exist">Existing alias analysis implementations and clients</a>
-</div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>If you're going to be working with the LLVM alias analysis infrastructure,
-you should know what clients and implementations of alias analysis are
-available. In particular, if you are implementing an alias analysis, you should
-be aware of the <a href="#aliasanalysis-debug">the clients</a> that are useful
-for monitoring and evaluating different implementations.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="impls">Available <tt>AliasAnalysis</tt> implementations</a>
-</div>
-
-<div class="doc_text">
-
-<p>This section lists the various implementations of the <tt>AliasAnalysis</tt>
-interface. With the exception of the <a href="#no-aa"><tt>-no-aa</tt></a> and
-<a href="#basic-aa"><tt>-basicaa</tt></a> implementations, all of these <a
-href="#chaining">chain</a> to other alias analysis implementations.</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="no-aa">The <tt>-no-aa</tt> pass</a>
-</div>
-
-<div class="doc_text">
-
-<p>The <tt>-no-aa</tt> pass is just like what it sounds: an alias analysis that
-never returns any useful information. This pass can be useful if you think that
-alias analysis is doing something wrong and are trying to narrow down a
-problem.</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="basic-aa">The <tt>-basicaa</tt> pass</a>
-</div>
-
-<div class="doc_text">
-
-<p>The <tt>-basicaa</tt> pass is the default LLVM alias analysis. It is an
-aggressive local analysis that "knows" many important facts:</p>
-
-<ul>
-<li>Distinct globals, stack allocations, and heap allocations can never
- alias.</li>
-<li>Globals, stack allocations, and heap allocations never alias the null
- pointer.</li>
-<li>Different fields of a structure do not alias.</li>
-<li>Indexes into arrays with statically differing subscripts cannot alias.</li>
-<li>Many common standard C library functions <a
- href="#simplemodref">never access memory or only read memory</a>.</li>
-<li>Pointers that obviously point to constant globals
- "<tt>pointToConstantMemory</tt>".</li>
-<li>Function calls can not modify or references stack allocations if they never
- escape from the function that allocates them (a common case for automatic
- arrays).</li>
-</ul>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="globalsmodref">The <tt>-globalsmodref-aa</tt> pass</a>
-</div>
-
-<div class="doc_text">
-
-<p>This pass implements a simple context-sensitive mod/ref and alias analysis
-for internal global variables that don't "have their address taken". If a
-global does not have its address taken, the pass knows that no pointers alias
-the global. This pass also keeps track of functions that it knows never access
-memory or never read memory. This allows certain optimizations (e.g. GCSE) to
-eliminate call instructions entirely.
-</p>
-
-<p>The real power of this pass is that it provides context-sensitive mod/ref
-information for call instructions. This allows the optimizer to know that
-calls to a function do not clobber or read the value of the global, allowing
-loads and stores to be eliminated.</p>
-
-<p>Note that this pass is somewhat limited in its scope (only support
-non-address taken globals), but is very quick analysis.</p>
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="anders-aa">The <tt>-anders-aa</tt> pass</a>
-</div>
-
-<div class="doc_text">
-
-<p>The <tt>-anders-aa</tt> pass implements the well-known "Andersen's algorithm"
-for interprocedural alias analysis. This algorithm is a subset-based,
-flow-insensitive, context-insensitive, and field-insensitive alias analysis that
-is widely believed to be fairly precise. Unfortunately, this algorithm is also
-O(N<sup>3</sup>). The LLVM implementation currently does not implement any of
-the refinements (such as "online cycle elimination" or "offline variable
-substitution") to improve its efficiency, so it can be quite slow in common
-cases.
-</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="steens-aa">The <tt>-steens-aa</tt> pass</a>
-</div>
-
-<div class="doc_text">
-
-<p>The <tt>-steens-aa</tt> pass implements a variation on the well-known
-"Steensgaard's algorithm" for interprocedural alias analysis. Steensgaard's
-algorithm is a unification-based, flow-insensitive, context-insensitive, and
-field-insensitive alias analysis that is also very scalable (effectively linear
-time).</p>
-
-<p>The LLVM <tt>-steens-aa</tt> pass implements a "speculatively
-field-<b>sensitive</b>" version of Steensgaard's algorithm using the Data
-Structure Analysis framework. This gives it substantially more precision than
-the standard algorithm while maintaining excellent analysis scalability.</p>
-
-<p>Note that <tt>-steens-aa</tt> is available in the optional "poolalloc"
-module, it is not part of the LLVM core.</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="ds-aa">The <tt>-ds-aa</tt> pass</a>
-</div>
-
-<div class="doc_text">
-
-<p>The <tt>-ds-aa</tt> pass implements the full Data Structure Analysis
-algorithm. Data Structure Analysis is a modular unification-based,
-flow-insensitive, context-<b>sensitive</b>, and speculatively
-field-<b>sensitive</b> alias analysis that is also quite scalable, usually at
-O(n*log(n)).</p>
-
-<p>This algorithm is capable of responding to a full variety of alias analysis
-queries, and can provide context-sensitive mod/ref information as well. The
-only major facility not implemented so far is support for must-alias
-information.</p>
-
-<p>Note that <tt>-ds-aa</tt> is available in the optional "poolalloc"
-module, it is not part of the LLVM core.</p>
-
-</div>
-
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="aliasanalysis-xforms">Alias analysis driven transformations</a>
-</div>
-
-<div class="doc_text">
-LLVM includes several alias-analysis driven transformations which can be used
-with any of the implementations above.
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="adce">The <tt>-adce</tt> pass</a>
-</div>
-
-<div class="doc_text">
-
-<p>The <tt>-adce</tt> pass, which implements Aggressive Dead Code Elimination
-uses the <tt>AliasAnalysis</tt> interface to delete calls to functions that do
-not have side-effects and are not used.</p>
-
-</div>
-
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="licm">The <tt>-licm</tt> pass</a>
-</div>
-
-<div class="doc_text">
-
-<p>The <tt>-licm</tt> pass implements various Loop Invariant Code Motion related
-transformations. It uses the <tt>AliasAnalysis</tt> interface for several
-different transformations:</p>
-
-<ul>
-<li>It uses mod/ref information to hoist or sink load instructions out of loops
-if there are no instructions in the loop that modifies the memory loaded.</li>
-
-<li>It uses mod/ref information to hoist function calls out of loops that do not
-write to memory and are loop-invariant.</li>
-
-<li>If uses alias information to promote memory objects that are loaded and
-stored to in loops to live in a register instead. It can do this if there are
-no may aliases to the loaded/stored memory location.</li>
-</ul>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="argpromotion">The <tt>-argpromotion</tt> pass</a>
-</div>
-
-<div class="doc_text">
-<p>
-The <tt>-argpromotion</tt> pass promotes by-reference arguments to be passed in
-by-value instead. In particular, if pointer arguments are only loaded from it
-passes in the value loaded instead of the address to the function. This pass
-uses alias information to make sure that the value loaded from the argument
-pointer is not modified between the entry of the function and any load of the
-pointer.</p>
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="gcseloadvn">The <tt>-load-vn</tt> &amp; <tt>-gcse</tt> passes</a>
-</div>
-
-<div class="doc_text">
-
-<p>The <tt>-load-vn</tt> pass uses alias analysis to "<a href="#loadvn">value
-number</a>" loads and pointers values, which is used by the GCSE pass to
-eliminate instructions. The <tt>-load-vn</tt> pass relies on alias information
-and must-alias information. This combination of passes can make the following
-transformations:</p>
-
-<ul>
-<li>Redundant load instructions are eliminated.</li>
-<li>Load instructions that follow a store to the same location are replaced with
-the stored value ("store forwarding").</li>
-<li>Pointers values (e.g. formal arguments) that must-alias simpler expressions
-(e.g. global variables or the null pointer) are replaced. Note that this
-implements transformations like "virtual method resolution", turning indirect
-calls into direct calls.</li>
-</ul>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="aliasanalysis-debug">Clients for debugging and evaluation of
- implementations</a>
-</div>
-
-<div class="doc_text">
-
-<p>These passes are useful for evaluating the various alias analysis
-implementations. You can use them with commands like '<tt>opt -anders-aa -ds-aa
--aa-eval foo.bc -disable-output -stats</tt>'.</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="print-alias-sets">The <tt>-print-alias-sets</tt> pass</a>
-</div>
-
-<div class="doc_text">
-
-<p>The <tt>-print-alias-sets</tt> pass is exposed as part of the
-<tt>opt</tt> tool to print out the Alias Sets formed by the <a
-href="#ast"><tt>AliasSetTracker</tt></a> class. This is useful if you're using
-the <tt>AliasSetTracker</tt> class. To use it, use something like:</p>
-
-<div class="doc_code">
-<pre>
-% opt -ds-aa -print-alias-sets -disable-output
-</pre>
-</div>
-
-</div>
-
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="count-aa">The <tt>-count-aa</tt> pass</a>
-</div>
-
-<div class="doc_text">
-
-<p>The <tt>-count-aa</tt> pass is useful to see how many queries a particular
-pass is making and what responses are returned by the alias analysis. As an
-example,</p>
-
-<div class="doc_code">
-<pre>
-% opt -basicaa -count-aa -ds-aa -count-aa -licm
-</pre>
-</div>
-
-<p>will print out how many queries (and what responses are returned) by the
-<tt>-licm</tt> pass (of the <tt>-ds-aa</tt> pass) and how many queries are made
-of the <tt>-basicaa</tt> pass by the <tt>-ds-aa</tt> pass. This can be useful
-when debugging a transformation or an alias analysis implementation.</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="aa-eval">The <tt>-aa-eval</tt> pass</a>
-</div>
-
-<div class="doc_text">
-
-<p>The <tt>-aa-eval</tt> pass simply iterates through all pairs of pointers in a
-function and asks an alias analysis whether or not the pointers alias. This
-gives an indication of the precision of the alias analysis. Statistics are
-printed indicating the percent of no/may/must aliases found (a more precise
-algorithm will have a lower number of may aliases).</p>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section">
- <a name="memdep">Memory Dependence Analysis</a>
-</div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>If you're just looking to be a client of alias analysis information, consider
-using the Memory Dependence Analysis interface instead. MemDep is a lazy,
-caching layer on top of alias analysis that is able to answer the question of
-what preceding memory operations a given instruction depends on, either at an
-intra- or inter-block level. Because of its laziness and caching
-policy, using MemDep can be a significant performance win over accessing alias
-analysis directly.</p>
-
-</div>
-
-<!-- *********************************************************************** -->
-
-<hr>
-<address>
- <a href="http://jigsaw.w3.org/css-validator/check/referer"><img
- src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"></a>
- <a href="http://validator.w3.org/check/referer"><img
- src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!"></a>
-
- <a href="mailto:sabre@nondot.org">Chris Lattner</a><br>
- <a href="http://llvm.org">LLVM Compiler Infrastructure</a><br>
- Last modified: $Date$
-</address>
-
-</body>
-</html>
diff --git a/release_23/docs/BitCodeFormat.html b/release_23/docs/BitCodeFormat.html
deleted file mode 100644
index 4adf75e91b56..000000000000
--- a/release_23/docs/BitCodeFormat.html
+++ /dev/null
@@ -1,653 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
- "http://www.w3.org/TR/html4/strict.dtd">
-<html>
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <title>LLVM Bitcode File Format</title>
- <link rel="stylesheet" href="llvm.css" type="text/css">
-</head>
-<body>
-<div class="doc_title"> LLVM Bitcode File Format </div>
-<ol>
- <li><a href="#abstract">Abstract</a></li>
- <li><a href="#overview">Overview</a></li>
- <li><a href="#bitstream">Bitstream Format</a>
- <ol>
- <li><a href="#magic">Magic Numbers</a></li>
- <li><a href="#primitives">Primitives</a></li>
- <li><a href="#abbrevid">Abbreviation IDs</a></li>
- <li><a href="#blocks">Blocks</a></li>
- <li><a href="#datarecord">Data Records</a></li>
- <li><a href="#abbreviations">Abbreviations</a></li>
- <li><a href="#stdblocks">Standard Blocks</a></li>
- </ol>
- </li>
- <li><a href="#llvmir">LLVM IR Encoding</a>
- <ol>
- <li><a href="#basics">Basics</a></li>
- </ol>
- </li>
-</ol>
-<div class="doc_author">
- <p>Written by <a href="mailto:sabre@nondot.org">Chris Lattner</a>
- and <a href="http://www.reverberate.org">Joshua Haberman</a>.
-</p>
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section"> <a name="abstract">Abstract</a></div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>This document describes the LLVM bitstream file format and the encoding of
-the LLVM IR into it.</p>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section"> <a name="overview">Overview</a></div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>
-What is commonly known as the LLVM bitcode file format (also, sometimes
-anachronistically known as bytecode) is actually two things: a <a
-href="#bitstream">bitstream container format</a>
-and an <a href="#llvmir">encoding of LLVM IR</a> into the container format.</p>
-
-<p>
-The bitstream format is an abstract encoding of structured data, very
-similar to XML in some ways. Like XML, bitstream files contain tags, and nested
-structures, and you can parse the file without having to understand the tags.
-Unlike XML, the bitstream format is a binary encoding, and unlike XML it
-provides a mechanism for the file to self-describe "abbreviations", which are
-effectively size optimizations for the content.</p>
-
-<p>This document first describes the LLVM bitstream format, then describes the
-record structure used by LLVM IR files.
-</p>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section"> <a name="bitstream">Bitstream Format</a></div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>
-The bitstream format is literally a stream of bits, with a very simple
-structure. This structure consists of the following concepts:
-</p>
-
-<ul>
-<li>A "<a href="#magic">magic number</a>" that identifies the contents of
- the stream.</li>
-<li>Encoding <a href="#primitives">primitives</a> like variable bit-rate
- integers.</li>
-<li><a href="#blocks">Blocks</a>, which define nested content.</li>
-<li><a href="#datarecord">Data Records</a>, which describe entities within the
- file.</li>
-<li>Abbreviations, which specify compression optimizations for the file.</li>
-</ul>
-
-<p>Note that the <a
-href="CommandGuide/html/llvm-bcanalyzer.html">llvm-bcanalyzer</a> tool can be
-used to dump and inspect arbitrary bitstreams, which is very useful for
-understanding the encoding.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection"><a name="magic">Magic Numbers</a>
-</div>
-
-<div class="doc_text">
-
-<p>The first two bytes of a bitcode file are 'BC' (0x42, 0x43).
-The second two bytes are an application-specific magic number. Generic
-bitcode tools can look at only the first two bytes to verify the file is
-bitcode, while application-specific programs will want to look at all four.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection"><a name="primitives">Primitives</a>
-</div>
-
-<div class="doc_text">
-
-<p>
-A bitstream literally consists of a stream of bits, which are read in order
-starting with the least significant bit of each byte. The stream is made up of a
-number of primitive values that encode a stream of unsigned integer values.
-These
-integers are are encoded in two ways: either as <a href="#fixedwidth">Fixed
-Width Integers</a> or as <a href="#variablewidth">Variable Width
-Integers</a>.
-</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection"> <a name="fixedwidth">Fixed Width Integers</a>
-</div>
-
-<div class="doc_text">
-
-<p>Fixed-width integer values have their low bits emitted directly to the file.
- For example, a 3-bit integer value encodes 1 as 001. Fixed width integers
- are used when there are a well-known number of options for a field. For
- example, boolean values are usually encoded with a 1-bit wide integer.
-</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection"> <a name="variablewidth">Variable Width
-Integers</a></div>
-
-<div class="doc_text">
-
-<p>Variable-width integer (VBR) values encode values of arbitrary size,
-optimizing for the case where the values are small. Given a 4-bit VBR field,
-any 3-bit value (0 through 7) is encoded directly, with the high bit set to
-zero. Values larger than N-1 bits emit their bits in a series of N-1 bit
-chunks, where all but the last set the high bit.</p>
-
-<p>For example, the value 27 (0x1B) is encoded as 1011 0011 when emitted as a
-vbr4 value. The first set of four bits indicates the value 3 (011) with a
-continuation piece (indicated by a high bit of 1). The next word indicates a
-value of 24 (011 << 3) with no continuation. The sum (3+24) yields the value
-27.
-</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection"> <a name="char6">6-bit characters</a></div>
-
-<div class="doc_text">
-
-<p>6-bit characters encode common characters into a fixed 6-bit field. They
-represent the following characters with the following 6-bit values:</p>
-
-<ul>
-<li>'a' .. 'z' - 0 .. 25</li>
-<li>'A' .. 'Z' - 26 .. 51</li>
-<li>'0' .. '9' - 52 .. 61</li>
-<li>'.' - 62</li>
-<li>'_' - 63</li>
-</ul>
-
-<p>This encoding is only suitable for encoding characters and strings that
-consist only of the above characters. It is completely incapable of encoding
-characters not in the set.</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection"> <a name="wordalign">Word Alignment</a></div>
-
-<div class="doc_text">
-
-<p>Occasionally, it is useful to emit zero bits until the bitstream is a
-multiple of 32 bits. This ensures that the bit position in the stream can be
-represented as a multiple of 32-bit words.</p>
-
-</div>
-
-
-<!-- ======================================================================= -->
-<div class="doc_subsection"><a name="abbrevid">Abbreviation IDs</a>
-</div>
-
-<div class="doc_text">
-
-<p>
-A bitstream is a sequential series of <a href="#blocks">Blocks</a> and
-<a href="#datarecord">Data Records</a>. Both of these start with an
-abbreviation ID encoded as a fixed-bitwidth field. The width is specified by
-the current block, as described below. The value of the abbreviation ID
-specifies either a builtin ID (which have special meanings, defined below) or
-one of the abbreviation IDs defined by the stream itself.
-</p>
-
-<p>
-The set of builtin abbrev IDs is:
-</p>
-
-<ul>
-<li>0 - <a href="#END_BLOCK">END_BLOCK</a> - This abbrev ID marks the end of the
- current block.</li>
-<li>1 - <a href="#ENTER_SUBBLOCK">ENTER_SUBBLOCK</a> - This abbrev ID marks the
- beginning of a new block.</li>
-<li>2 - <a href="#DEFINE_ABBREV">DEFINE_ABBREV</a> - This defines a new
- abbreviation.</li>
-<li>3 - <a href="#UNABBREV_RECORD">UNABBREV_RECORD</a> - This ID specifies the
- definition of an unabbreviated record.</li>
-</ul>
-
-<p>Abbreviation IDs 4 and above are defined by the stream itself, and specify
-an <a href="#abbrev_records">abbreviated record encoding</a>.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection"><a name="blocks">Blocks</a>
-</div>
-
-<div class="doc_text">
-
-<p>
-Blocks in a bitstream denote nested regions of the stream, and are identified by
-a content-specific id number (for example, LLVM IR uses an ID of 12 to represent
-function bodies). Block IDs 0-7 are reserved for <a href="#stdblocks">standard blocks</a>
-whose meaning is defined by Bitcode; block IDs 8 and greater are
-application specific. Nested blocks capture the hierachical structure of the data
-encoded in it, and various properties are associated with blocks as the file is
-parsed. Block definitions allow the reader to efficiently skip blocks
-in constant time if the reader wants a summary of blocks, or if it wants to
-efficiently skip data they do not understand. The LLVM IR reader uses this
-mechanism to skip function bodies, lazily reading them on demand.
-</p>
-
-<p>
-When reading and encoding the stream, several properties are maintained for the
-block. In particular, each block maintains:
-</p>
-
-<ol>
-<li>A current abbrev id width. This value starts at 2, and is set every time a
- block record is entered. The block entry specifies the abbrev id width for
- the body of the block.</li>
-
-<li>A set of abbreviations. Abbreviations may be defined within a block, in
- which case they are only defined in that block (neither subblocks nor
- enclosing blocks see the abbreviation). Abbreviations can also be defined
- inside a <a href="#BLOCKINFO">BLOCKINFO</a> block, in which case they are
- defined in all blocks that match the ID that the BLOCKINFO block is describing.
-</li>
-</ol>
-
-<p>As sub blocks are entered, these properties are saved and the new sub-block
-has its own set of abbreviations, and its own abbrev id width. When a sub-block
-is popped, the saved values are restored.</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection"> <a name="ENTER_SUBBLOCK">ENTER_SUBBLOCK
-Encoding</a></div>
-
-<div class="doc_text">
-
-<p><tt>[ENTER_SUBBLOCK, blockid<sub>vbr8</sub>, newabbrevlen<sub>vbr4</sub>,
- &lt;align32bits&gt;, blocklen<sub>32</sub>]</tt></p>
-
-<p>
-The ENTER_SUBBLOCK abbreviation ID specifies the start of a new block record.
-The <tt>blockid</tt> value is encoded as a 8-bit VBR identifier, and indicates
-the type of block being entered (which can be a <a href="#stdblocks">standard
-block</a> or an application-specific block). The
-<tt>newabbrevlen</tt> value is a 4-bit VBR which specifies the
-abbrev id width for the sub-block. The <tt>blocklen</tt> is a 32-bit aligned
-value that specifies the size of the subblock, in 32-bit words. This value
-allows the reader to skip over the entire block in one jump.
-</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection"> <a name="END_BLOCK">END_BLOCK
-Encoding</a></div>
-
-<div class="doc_text">
-
-<p><tt>[END_BLOCK, &lt;align32bits&gt;]</tt></p>
-
-<p>
-The END_BLOCK abbreviation ID specifies the end of the current block record.
-Its end is aligned to 32-bits to ensure that the size of the block is an even
-multiple of 32-bits.</p>
-
-</div>
-
-
-
-<!-- ======================================================================= -->
-<div class="doc_subsection"><a name="datarecord">Data Records</a>
-</div>
-
-<div class="doc_text">
-<p>
-Data records consist of a record code and a number of (up to) 64-bit integer
-values. The interpretation of the code and values is application specific and
-there are multiple different ways to encode a record (with an unabbrev record
-or with an abbreviation). In the LLVM IR format, for example, there is a record
-which encodes the target triple of a module. The code is MODULE_CODE_TRIPLE,
-and the values of the record are the ascii codes for the characters in the
-string.</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection"> <a name="UNABBREV_RECORD">UNABBREV_RECORD
-Encoding</a></div>
-
-<div class="doc_text">
-
-<p><tt>[UNABBREV_RECORD, code<sub>vbr6</sub>, numops<sub>vbr6</sub>,
- op0<sub>vbr6</sub>, op1<sub>vbr6</sub>, ...]</tt></p>
-
-<p>An UNABBREV_RECORD provides a default fallback encoding, which is both
-completely general and also extremely inefficient. It can describe an arbitrary
-record, by emitting the code and operands as vbrs.</p>
-
-<p>For example, emitting an LLVM IR target triple as an unabbreviated record
-requires emitting the UNABBREV_RECORD abbrevid, a vbr6 for the
-MODULE_CODE_TRIPLE code, a vbr6 for the length of the string (which is equal to
-the number of operands), and a vbr6 for each character. Since there are no
-letters with value less than 32, each letter would need to be emitted as at
-least a two-part VBR, which means that each letter would require at least 12
-bits. This is not an efficient encoding, but it is fully general.</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection"> <a name="abbrev_records">Abbreviated Record
-Encoding</a></div>
-
-<div class="doc_text">
-
-<p><tt>[&lt;abbrevid&gt;, fields...]</tt></p>
-
-<p>An abbreviated record is a abbreviation id followed by a set of fields that
-are encoded according to the <a href="#abbreviations">abbreviation
-definition</a>. This allows records to be encoded significantly more densely
-than records encoded with the <a href="#UNABBREV_RECORD">UNABBREV_RECORD</a>
-type, and allows the abbreviation types to be specified in the stream itself,
-which allows the files to be completely self describing. The actual encoding
-of abbreviations is defined below.
-</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection"><a name="abbreviations">Abbreviations</a>
-</div>
-
-<div class="doc_text">
-<p>
-Abbreviations are an important form of compression for bitstreams. The idea is
-to specify a dense encoding for a class of records once, then use that encoding
-to emit many records. It takes space to emit the encoding into the file, but
-the space is recouped (hopefully plus some) when the records that use it are
-emitted.
-</p>
-
-<p>
-Abbreviations can be determined dynamically per client, per file. Since the
-abbreviations are stored in the bitstream itself, different streams of the same
-format can contain different sets of abbreviations if the specific stream does
-not need it. As a concrete example, LLVM IR files usually emit an abbreviation
-for binary operators. If a specific LLVM module contained no or few binary
-operators, the abbreviation does not need to be emitted.
-</p>
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection"><a name="DEFINE_ABBREV">DEFINE_ABBREV
- Encoding</a></div>
-
-<div class="doc_text">
-
-<p><tt>[DEFINE_ABBREV, numabbrevops<sub>vbr5</sub>, abbrevop0, abbrevop1,
- ...]</tt></p>
-
-<p>A DEFINE_ABBREV record adds an abbreviation to the list of currently
-defined abbreviations in the scope of this block. This definition only
-exists inside this immediate block -- it is not visible in subblocks or
-enclosing blocks.
-Abbreviations are implicitly assigned IDs
-sequentially starting from 4 (the first application-defined abbreviation ID).
-Any abbreviations defined in a BLOCKINFO record receive IDs first, in order,
-followed by any abbreviations defined within the block itself.
-Abbreviated data records reference this ID to indicate what abbreviation
-they are invoking.</p>
-
-<p>An abbreviation definition consists of the DEFINE_ABBREV abbrevid followed
-by a VBR that specifies the number of abbrev operands, then the abbrev
-operands themselves. Abbreviation operands come in three forms. They all start
-with a single bit that indicates whether the abbrev operand is a literal operand
-(when the bit is 1) or an encoding operand (when the bit is 0).</p>
-
-<ol>
-<li>Literal operands - <tt>[1<sub>1</sub>, litvalue<sub>vbr8</sub>]</tt> -
-Literal operands specify that the value in the result
-is always a single specific value. This specific value is emitted as a vbr8
-after the bit indicating that it is a literal operand.</li>
-<li>Encoding info without data - <tt>[0<sub>1</sub>, encoding<sub>3</sub>]</tt>
- - Operand encodings that do not have extra data are just emitted as their code.
-</li>
-<li>Encoding info with data - <tt>[0<sub>1</sub>, encoding<sub>3</sub>,
-value<sub>vbr5</sub>]</tt> - Operand encodings that do have extra data are
-emitted as their code, followed by the extra data.
-</li>
-</ol>
-
-<p>The possible operand encodings are:</p>
-
-<ul>
-<li>1 - Fixed - The field should be emitted as a <a
- href="#fixedwidth">fixed-width value</a>, whose width
- is specified by the operand's extra data.</li>
-<li>2 - VBR - The field should be emitted as a <a
- href="#variablewidth">variable-width value</a>, whose width
- is specified by the operand's extra data.</li>
-<li>3 - Array - This field is an array of values. The array operand has no
- extra data, but expects another operand to follow it which indicates the
- element type of the array. When reading an array in an abbreviated record,
- the first integer is a vbr6 that indicates the array length, followed by
- the encoded elements of the array. An array may only occur as the last
- operand of an abbreviation (except for the one final operand that gives
- the array's type).</li>
-<li>4 - Char6 - This field should be emitted as a <a href="#char6">char6-encoded
- value</a>. This operand type takes no extra data.</li>
-</ul>
-
-<p>For example, target triples in LLVM modules are encoded as a record of the
-form <tt>[TRIPLE, 'a', 'b', 'c', 'd']</tt>. Consider if the bitstream emitted
-the following abbrev entry:</p>
-
-<ul>
-<li><tt>[0, Fixed, 4]</tt></li>
-<li><tt>[0, Array]</tt></li>
-<li><tt>[0, Char6]</tt></li>
-</ul>
-
-<p>When emitting a record with this abbreviation, the above entry would be
-emitted as:</p>
-
-<p><tt>[4<sub>abbrevwidth</sub>, 2<sub>4</sub>, 4<sub>vbr6</sub>,
- 0<sub>6</sub>, 1<sub>6</sub>, 2<sub>6</sub>, 3<sub>6</sub>]</tt></p>
-
-<p>These values are:</p>
-
-<ol>
-<li>The first value, 4, is the abbreviation ID for this abbreviation.</li>
-<li>The second value, 2, is the code for TRIPLE in LLVM IR files.</li>
-<li>The third value, 4, is the length of the array.</li>
-<li>The rest of the values are the char6 encoded values for "abcd".</li>
-</ol>
-
-<p>With this abbreviation, the triple is emitted with only 37 bits (assuming a
-abbrev id width of 3). Without the abbreviation, significantly more space would
-be required to emit the target triple. Also, since the TRIPLE value is not
-emitted as a literal in the abbreviation, the abbreviation can also be used for
-any other string value.
-</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection"><a name="stdblocks">Standard Blocks</a>
-</div>
-
-<div class="doc_text">
-
-<p>
-In addition to the basic block structure and record encodings, the bitstream
-also defines specific builtin block types. These block types specify how the
-stream is to be decoded or other metadata. In the future, new standard blocks
-may be added. Block IDs 0-7 are reserved for standard blocks.
-</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection"><a name="BLOCKINFO">#0 - BLOCKINFO
-Block</a></div>
-
-<div class="doc_text">
-
-<p>The BLOCKINFO block allows the description of metadata for other blocks. The
- currently specified records are:</p>
-
-<ul>
-<li><tt>[SETBID (#1), blockid]</tt></li>
-<li><tt>[DEFINE_ABBREV, ...]</tt></li>
-</ul>
-
-<p>
-The SETBID record indicates which block ID is being described. SETBID
-records can occur multiple times throughout the block to change which
-block ID is being described. There must be a SETBID record prior to
-any other records.
-</p>
-
-<p>
-Standard DEFINE_ABBREV records can occur inside BLOCKINFO blocks, but unlike
-their occurrence in normal blocks, the abbreviation is defined for blocks
-matching the block ID we are describing, <i>not</i> the BLOCKINFO block itself.
-The abbreviations defined in BLOCKINFO blocks receive abbreviation ids
-as described in <a href="#DEFINE_ABBREV">DEFINE_ABBREV</a>.
-</p>
-
-<p>
-Note that although the data in BLOCKINFO blocks is described as "metadata," the
-abbreviations they contain are essential for parsing records from the
-corresponding blocks. It is not safe to skip them.
-</p>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section"> <a name="llvmir">LLVM IR Encoding</a></div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>LLVM IR is encoded into a bitstream by defining blocks and records. It uses
-blocks for things like constant pools, functions, symbol tables, etc. It uses
-records for things like instructions, global variable descriptors, type
-descriptions, etc. This document does not describe the set of abbreviations
-that the writer uses, as these are fully self-described in the file, and the
-reader is not allowed to build in any knowledge of this.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection"><a name="basics">Basics</a>
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection"><a name="ir_magic">LLVM IR Magic Number</a></div>
-
-<div class="doc_text">
-
-<p>
-The magic number for LLVM IR files is:
-</p>
-
-<p><tt>[0x0<sub>4</sub>, 0xC<sub>4</sub>, 0xE<sub>4</sub>, 0xD<sub>4</sub>]</tt></p>
-
-<p>When combined with the bitcode magic number and viewed as bytes, this is "BC 0xC0DE".</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection"><a name="ir_signed_vbr">Signed VBRs</a></div>
-
-<div class="doc_text">
-
-<p>
-<a href="#variablewidth">Variable Width Integers</a> are an efficient way to
-encode arbitrary sized unsigned values, but is an extremely inefficient way to
-encode signed values (as signed values are otherwise treated as maximally large
-unsigned values).</p>
-
-<p>As such, signed vbr values of a specific width are emitted as follows:</p>
-
-<ul>
-<li>Positive values are emitted as vbrs of the specified width, but with their
- value shifted left by one.</li>
-<li>Negative values are emitted as vbrs of the specified width, but the negated
- value is shifted left by one, and the low bit is set.</li>
-</ul>
-
-<p>With this encoding, small positive and small negative values can both be
-emitted efficiently.</p>
-
-</div>
-
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection"><a name="ir_blocks">LLVM IR Blocks</a></div>
-
-<div class="doc_text">
-
-<p>
-LLVM IR is defined with the following blocks:
-</p>
-
-<ul>
-<li>8 - MODULE_BLOCK - This is the top-level block that contains the
- entire module, and describes a variety of per-module information.</li>
-<li>9 - PARAMATTR_BLOCK - This enumerates the parameter attributes.</li>
-<li>10 - TYPE_BLOCK - This describes all of the types in the module.</li>
-<li>11 - CONSTANTS_BLOCK - This describes constants for a module or
- function.</li>
-<li>12 - FUNCTION_BLOCK - This describes a function body.</li>
-<li>13 - TYPE_SYMTAB_BLOCK - This describes the type symbol table.</li>
-<li>14 - VALUE_SYMTAB_BLOCK - This describes a value symbol table.</li>
-</ul>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection"><a name="MODULE_BLOCK">MODULE_BLOCK Contents</a>
-</div>
-
-<div class="doc_text">
-
-<p>
-</p>
-
-</div>
-
-
-<!-- *********************************************************************** -->
-<hr>
-<address> <a href="http://jigsaw.w3.org/css-validator/check/referer"><img
- src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"></a>
-<a href="http://validator.w3.org/check/referer"><img
- src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!"></a>
- <a href="mailto:sabre@nondot.org">Chris Lattner</a><br>
-<a href="http://llvm.org">The LLVM Compiler Infrastructure</a><br>
-Last modified: $Date$
-</address>
-</body>
-</html>
diff --git a/release_23/docs/Bugpoint.html b/release_23/docs/Bugpoint.html
deleted file mode 100644
index bdfd31379a94..000000000000
--- a/release_23/docs/Bugpoint.html
+++ /dev/null
@@ -1,244 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
- "http://www.w3.org/TR/html4/strict.dtd">
-<html>
-<head>
- <title>LLVM bugpoint tool: design and usage</title>
- <link rel="stylesheet" href="llvm.css" type="text/css">
-</head>
-
-<div class="doc_title">
- LLVM bugpoint tool: design and usage
-</div>
-
-<ul>
- <li><a href="#desc">Description</a></li>
- <li><a href="#design">Design Philosophy</a>
- <ul>
- <li><a href="#autoselect">Automatic Debugger Selection</a></li>
- <li><a href="#crashdebug">Crash debugger</a></li>
- <li><a href="#codegendebug">Code generator debugger</a></li>
- <li><a href="#miscompilationdebug">Miscompilation debugger</a></li>
- </ul></li>
- <li><a href="#advice">Advice for using <tt>bugpoint</tt></a></li>
-</ul>
-
-<div class="doc_author">
-<p>Written by <a href="mailto:sabre@nondot.org">Chris Lattner</a></p>
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section">
-<a name="desc">Description</a>
-</div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p><tt>bugpoint</tt> narrows down the source of problems in LLVM tools and
-passes. It can be used to debug three types of failures: optimizer crashes,
-miscompilations by optimizers, or bad native code generation (including problems
-in the static and JIT compilers). It aims to reduce large test cases to small,
-useful ones. For example, if <tt>opt</tt> crashes while optimizing a
-file, it will identify the optimization (or combination of optimizations) that
-causes the crash, and reduce the file down to a small example which triggers the
-crash.</p>
-
-<p>For detailed case scenarios, such as debugging <tt>opt</tt>,
-<tt>llvm-ld</tt>, or one of the LLVM code generators, see <a
-href="HowToSubmitABug.html">How To Submit a Bug Report document</a>.</p>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section">
-<a name="design">Design Philosophy</a>
-</div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p><tt>bugpoint</tt> is designed to be a useful tool without requiring any
-hooks into the LLVM infrastructure at all. It works with any and all LLVM
-passes and code generators, and does not need to "know" how they work. Because
-of this, it may appear to do stupid things or miss obvious
-simplifications. <tt>bugpoint</tt> is also designed to trade off programmer
-time for computer time in the compiler-debugging process; consequently, it may
-take a long period of (unattended) time to reduce a test case, but we feel it
-is still worth it. Note that <tt>bugpoint</tt> is generally very quick unless
-debugging a miscompilation where each test of the program (which requires
-executing it) takes a long time.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="autoselect">Automatic Debugger Selection</a>
-</div>
-
-<div class="doc_text">
-
-<p><tt>bugpoint</tt> reads each <tt>.bc</tt> or <tt>.ll</tt> file specified on
-the command line and links them together into a single module, called the test
-program. If any LLVM passes are specified on the command line, it runs these
-passes on the test program. If any of the passes crash, or if they produce
-malformed output (which causes the verifier to abort), <tt>bugpoint</tt> starts
-the <a href="#crashdebug">crash debugger</a>.</p>
-
-<p>Otherwise, if the <tt>-output</tt> option was not specified,
-<tt>bugpoint</tt> runs the test program with the C backend (which is assumed to
-generate good code) to generate a reference output. Once <tt>bugpoint</tt> has
-a reference output for the test program, it tries executing it with the
-selected code generator. If the selected code generator crashes,
-<tt>bugpoint</tt> starts the <a href="#crashdebug">crash debugger</a> on the
-code generator. Otherwise, if the resulting output differs from the reference
-output, it assumes the difference resulted from a code generator failure, and
-starts the <a href="#codegendebug">code generator debugger</a>.</p>
-
-<p>Finally, if the output of the selected code generator matches the reference
-output, <tt>bugpoint</tt> runs the test program after all of the LLVM passes
-have been applied to it. If its output differs from the reference output, it
-assumes the difference resulted from a failure in one of the LLVM passes, and
-enters the <a href="#miscompilationdebug">miscompilation debugger</a>.
-Otherwise, there is no problem <tt>bugpoint</tt> can debug.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="crashdebug">Crash debugger</a>
-</div>
-
-<div class="doc_text">
-
-<p>If an optimizer or code generator crashes, <tt>bugpoint</tt> will try as hard
-as it can to reduce the list of passes (for optimizer crashes) and the size of
-the test program. First, <tt>bugpoint</tt> figures out which combination of
-optimizer passes triggers the bug. This is useful when debugging a problem
-exposed by <tt>opt</tt>, for example, because it runs over 38 passes.</p>
-
-<p>Next, <tt>bugpoint</tt> tries removing functions from the test program, to
-reduce its size. Usually it is able to reduce a test program to a single
-function, when debugging intraprocedural optimizations. Once the number of
-functions has been reduced, it attempts to delete various edges in the control
-flow graph, to reduce the size of the function as much as possible. Finally,
-<tt>bugpoint</tt> deletes any individual LLVM instructions whose absence does
-not eliminate the failure. At the end, <tt>bugpoint</tt> should tell you what
-passes crash, give you a bitcode file, and give you instructions on how to
-reproduce the failure with <tt>opt</tt> or <tt>llc</tt>.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="codegendebug">Code generator debugger</a>
-</div>
-
-<div class="doc_text">
-
-<p>The code generator debugger attempts to narrow down the amount of code that
-is being miscompiled by the selected code generator. To do this, it takes the
-test program and partitions it into two pieces: one piece which it compiles
-with the C backend (into a shared object), and one piece which it runs with
-either the JIT or the static LLC compiler. It uses several techniques to
-reduce the amount of code pushed through the LLVM code generator, to reduce the
-potential scope of the problem. After it is finished, it emits two bitcode
-files (called "test" [to be compiled with the code generator] and "safe" [to be
-compiled with the C backend], respectively), and instructions for reproducing
-the problem. The code generator debugger assumes that the C backend produces
-good code.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="miscompilationdebug">Miscompilation debugger</a>
-</div>
-
-<div class="doc_text">
-
-<p>The miscompilation debugger works similarly to the code generator debugger.
-It works by splitting the test program into two pieces, running the
-optimizations specified on one piece, linking the two pieces back together, and
-then executing the result. It attempts to narrow down the list of passes to
-the one (or few) which are causing the miscompilation, then reduce the portion
-of the test program which is being miscompiled. The miscompilation debugger
-assumes that the selected code generator is working properly.</p>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section">
- <a name="advice">Advice for using bugpoint</a>
-</div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<tt>bugpoint</tt> can be a remarkably useful tool, but it sometimes works in
-non-obvious ways. Here are some hints and tips:<p>
-
-<ol>
-<li>In the code generator and miscompilation debuggers, <tt>bugpoint</tt> only
- works with programs that have deterministic output. Thus, if the program
- outputs <tt>argv[0]</tt>, the date, time, or any other "random" data,
- <tt>bugpoint</tt> may misinterpret differences in these data, when output,
- as the result of a miscompilation. Programs should be temporarily modified
- to disable outputs that are likely to vary from run to run.
-
-<li>In the code generator and miscompilation debuggers, debugging will go
- faster if you manually modify the program or its inputs to reduce the
- runtime, but still exhibit the problem.
-
-<li><tt>bugpoint</tt> is extremely useful when working on a new optimization:
- it helps track down regressions quickly. To avoid having to relink
- <tt>bugpoint</tt> every time you change your optimization however, have
- <tt>bugpoint</tt> dynamically load your optimization with the
- <tt>-load</tt> option.
-
-<li><p><tt>bugpoint</tt> can generate a lot of output and run for a long period
- of time. It is often useful to capture the output of the program to file.
- For example, in the C shell, you can run:</p>
-
-<div class="doc_code">
-<p><tt>bugpoint ... |&amp; tee bugpoint.log</tt></p>
-</div>
-
- <p>to get a copy of <tt>bugpoint</tt>'s output in the file
- <tt>bugpoint.log</tt>, as well as on your terminal.</p>
-
-<li><tt>bugpoint</tt> cannot debug problems with the LLVM linker. If
- <tt>bugpoint</tt> crashes before you see its "All input ok" message,
- you might try <tt>llvm-link -v</tt> on the same set of input files. If
- that also crashes, you may be experiencing a linker bug.
-
-<li>If your program is <b>supposed</b> to crash, <tt>bugpoint</tt> will be
- confused. One way to deal with this is to cause bugpoint to ignore the exit
- code from your program, by giving it the <tt>-check-exit-code=false</tt>
- option.
-
-<li><tt>bugpoint</tt> is useful for proactively finding bugs in LLVM.
- Invoking <tt>bugpoint</tt> with the <tt>-find-bugs</tt> option will cause
- the list of specified optimizations to be randomized and applied to the
- program. This process will repeat until a bug is found or the user
- kills <tt>bugpoint</tt>.
-
-</ol>
-
-</div>
-
-<!-- *********************************************************************** -->
-
-<hr>
-<address>
- <a href="http://jigsaw.w3.org/css-validator/check/referer"><img
- src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"></a>
- <a href="http://validator.w3.org/check/referer"><img
- src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!"></a>
-
- <a href="mailto:sabre@nondot.org">Chris Lattner</a><br>
- <a href="http://llvm.org">LLVM Compiler Infrastructure</a><br>
- Last modified: $Date$
-</address>
-
-</body>
-</html>
diff --git a/release_23/docs/CFEBuildInstrs.html b/release_23/docs/CFEBuildInstrs.html
deleted file mode 100644
index 8cdb197cbc20..000000000000
--- a/release_23/docs/CFEBuildInstrs.html
+++ /dev/null
@@ -1,29 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
- "http://www.w3.org/TR/html4/strict.dtd">
-<html>
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
- <link rel="stylesheet" href="llvm.css" type="text/css" media="screen">
- <title>Building the LLVM C/C++ Front-End</title>
- <meta HTTP-EQUIV="REFRESH" CONTENT="3; URL=GCCFEBuildInstrs.html">
-</head>
-<body>
-<div class="doc_title">
-This page has moved <a href="GCCFEBuildInstrs.html">here</A>.
-</div>
-
-<!-- *********************************************************************** -->
-
-<hr>
-<address>
- <a href="http://jigsaw.w3.org/css-validator/check/referer"><img
- src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"></a>
- <a href="http://validator.w3.org/check/referer"><img
- src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!"></a>
-
- <a href="http://llvm.org">LLVM Compiler Infrastructure</a><br>
- Last modified: $Date: 2008-02-13 17:46:10 +0100 (Wed, 13 Feb 2008) $
-</address>
-
-</body>
-</html>
diff --git a/release_23/docs/CodeGenerator.html b/release_23/docs/CodeGenerator.html
deleted file mode 100644
index c09d9e1cd702..000000000000
--- a/release_23/docs/CodeGenerator.html
+++ /dev/null
@@ -1,2006 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
- "http://www.w3.org/TR/html4/strict.dtd">
-<html>
-<head>
- <meta http-equiv="content-type" content="text/html; charset=utf-8">
- <title>The LLVM Target-Independent Code Generator</title>
- <link rel="stylesheet" href="llvm.css" type="text/css">
-</head>
-<body>
-
-<div class="doc_title">
- The LLVM Target-Independent Code Generator
-</div>
-
-<ol>
- <li><a href="#introduction">Introduction</a>
- <ul>
- <li><a href="#required">Required components in the code generator</a></li>
- <li><a href="#high-level-design">The high-level design of the code
- generator</a></li>
- <li><a href="#tablegen">Using TableGen for target description</a></li>
- </ul>
- </li>
- <li><a href="#targetdesc">Target description classes</a>
- <ul>
- <li><a href="#targetmachine">The <tt>TargetMachine</tt> class</a></li>
- <li><a href="#targetdata">The <tt>TargetData</tt> class</a></li>
- <li><a href="#targetlowering">The <tt>TargetLowering</tt> class</a></li>
- <li><a href="#targetregisterinfo">The <tt>TargetRegisterInfo</tt> class</a></li>
- <li><a href="#targetinstrinfo">The <tt>TargetInstrInfo</tt> class</a></li>
- <li><a href="#targetframeinfo">The <tt>TargetFrameInfo</tt> class</a></li>
- <li><a href="#targetsubtarget">The <tt>TargetSubtarget</tt> class</a></li>
- <li><a href="#targetjitinfo">The <tt>TargetJITInfo</tt> class</a></li>
- </ul>
- </li>
- <li><a href="#codegendesc">Machine code description classes</a>
- <ul>
- <li><a href="#machineinstr">The <tt>MachineInstr</tt> class</a></li>
- <li><a href="#machinebasicblock">The <tt>MachineBasicBlock</tt>
- class</a></li>
- <li><a href="#machinefunction">The <tt>MachineFunction</tt> class</a></li>
- </ul>
- </li>
- <li><a href="#codegenalgs">Target-independent code generation algorithms</a>
- <ul>
- <li><a href="#instselect">Instruction Selection</a>
- <ul>
- <li><a href="#selectiondag_intro">Introduction to SelectionDAGs</a></li>
- <li><a href="#selectiondag_process">SelectionDAG Code Generation
- Process</a></li>
- <li><a href="#selectiondag_build">Initial SelectionDAG
- Construction</a></li>
- <li><a href="#selectiondag_legalize">SelectionDAG Legalize Phase</a></li>
- <li><a href="#selectiondag_optimize">SelectionDAG Optimization
- Phase: the DAG Combiner</a></li>
- <li><a href="#selectiondag_select">SelectionDAG Select Phase</a></li>
- <li><a href="#selectiondag_sched">SelectionDAG Scheduling and Formation
- Phase</a></li>
- <li><a href="#selectiondag_future">Future directions for the
- SelectionDAG</a></li>
- </ul></li>
- <li><a href="#liveintervals">Live Intervals</a>
- <ul>
- <li><a href="#livevariable_analysis">Live Variable Analysis</a></li>
- <li><a href="#liveintervals_analysis">Live Intervals Analysis</a></li>
- </ul></li>
- <li><a href="#regalloc">Register Allocation</a>
- <ul>
- <li><a href="#regAlloc_represent">How registers are represented in
- LLVM</a></li>
- <li><a href="#regAlloc_howTo">Mapping virtual registers to physical
- registers</a></li>
- <li><a href="#regAlloc_twoAddr">Handling two address instructions</a></li>
- <li><a href="#regAlloc_ssaDecon">The SSA deconstruction phase</a></li>
- <li><a href="#regAlloc_fold">Instruction folding</a></li>
- <li><a href="#regAlloc_builtIn">Built in register allocators</a></li>
- </ul></li>
- <li><a href="#codeemit">Code Emission</a>
- <ul>
- <li><a href="#codeemit_asm">Generating Assembly Code</a></li>
- <li><a href="#codeemit_bin">Generating Binary Machine Code</a></li>
- </ul></li>
- </ul>
- </li>
- <li><a href="#targetimpls">Target-specific Implementation Notes</a>
- <ul>
- <li><a href="#tailcallopt">Tail call optimization</a></li>
- <li><a href="#x86">The X86 backend</a></li>
- <li><a href="#ppc">The PowerPC backend</a>
- <ul>
- <li><a href="#ppc_abi">LLVM PowerPC ABI</a></li>
- <li><a href="#ppc_frame">Frame Layout</a></li>
- <li><a href="#ppc_prolog">Prolog/Epilog</a></li>
- <li><a href="#ppc_dynamic">Dynamic Allocation</a></li>
- </ul></li>
- </ul></li>
-
-</ol>
-
-<div class="doc_author">
- <p>Written by <a href="mailto:sabre@nondot.org">Chris Lattner</a>,
- <a href="mailto:isanbard@gmail.com">Bill Wendling</a>,
- <a href="mailto:pronesto@gmail.com">Fernando Magno Quintao
- Pereira</a> and
- <a href="mailto:jlaskey@mac.com">Jim Laskey</a></p>
-</div>
-
-<div class="doc_warning">
- <p>Warning: This is a work in progress.</p>
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section">
- <a name="introduction">Introduction</a>
-</div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>The LLVM target-independent code generator is a framework that provides a
-suite of reusable components for translating the LLVM internal representation to
-the machine code for a specified target&mdash;either in assembly form (suitable
-for a static compiler) or in binary machine code format (usable for a JIT
-compiler). The LLVM target-independent code generator consists of five main
-components:</p>
-
-<ol>
-<li><a href="#targetdesc">Abstract target description</a> interfaces which
-capture important properties about various aspects of the machine, independently
-of how they will be used. These interfaces are defined in
-<tt>include/llvm/Target/</tt>.</li>
-
-<li>Classes used to represent the <a href="#codegendesc">machine code</a> being
-generated for a target. These classes are intended to be abstract enough to
-represent the machine code for <i>any</i> target machine. These classes are
-defined in <tt>include/llvm/CodeGen/</tt>.</li>
-
-<li><a href="#codegenalgs">Target-independent algorithms</a> used to implement
-various phases of native code generation (register allocation, scheduling, stack
-frame representation, etc). This code lives in <tt>lib/CodeGen/</tt>.</li>
-
-<li><a href="#targetimpls">Implementations of the abstract target description
-interfaces</a> for particular targets. These machine descriptions make use of
-the components provided by LLVM, and can optionally provide custom
-target-specific passes, to build complete code generators for a specific target.
-Target descriptions live in <tt>lib/Target/</tt>.</li>
-
-<li><a href="#jit">The target-independent JIT components</a>. The LLVM JIT is
-completely target independent (it uses the <tt>TargetJITInfo</tt> structure to
-interface for target-specific issues. The code for the target-independent
-JIT lives in <tt>lib/ExecutionEngine/JIT</tt>.</li>
-
-</ol>
-
-<p>
-Depending on which part of the code generator you are interested in working on,
-different pieces of this will be useful to you. In any case, you should be
-familiar with the <a href="#targetdesc">target description</a> and <a
-href="#codegendesc">machine code representation</a> classes. If you want to add
-a backend for a new target, you will need to <a href="#targetimpls">implement the
-target description</a> classes for your new target and understand the <a
-href="LangRef.html">LLVM code representation</a>. If you are interested in
-implementing a new <a href="#codegenalgs">code generation algorithm</a>, it
-should only depend on the target-description and machine code representation
-classes, ensuring that it is portable.
-</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="required">Required components in the code generator</a>
-</div>
-
-<div class="doc_text">
-
-<p>The two pieces of the LLVM code generator are the high-level interface to the
-code generator and the set of reusable components that can be used to build
-target-specific backends. The two most important interfaces (<a
-href="#targetmachine"><tt>TargetMachine</tt></a> and <a
-href="#targetdata"><tt>TargetData</tt></a>) are the only ones that are
-required to be defined for a backend to fit into the LLVM system, but the others
-must be defined if the reusable code generator components are going to be
-used.</p>
-
-<p>This design has two important implications. The first is that LLVM can
-support completely non-traditional code generation targets. For example, the C
-backend does not require register allocation, instruction selection, or any of
-the other standard components provided by the system. As such, it only
-implements these two interfaces, and does its own thing. Another example of a
-code generator like this is a (purely hypothetical) backend that converts LLVM
-to the GCC RTL form and uses GCC to emit machine code for a target.</p>
-
-<p>This design also implies that it is possible to design and
-implement radically different code generators in the LLVM system that do not
-make use of any of the built-in components. Doing so is not recommended at all,
-but could be required for radically different targets that do not fit into the
-LLVM machine description model: FPGAs for example.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="high-level-design">The high-level design of the code generator</a>
-</div>
-
-<div class="doc_text">
-
-<p>The LLVM target-independent code generator is designed to support efficient and
-quality code generation for standard register-based microprocessors. Code
-generation in this model is divided into the following stages:</p>
-
-<ol>
-<li><b><a href="#instselect">Instruction Selection</a></b> - This phase
-determines an efficient way to express the input LLVM code in the target
-instruction set.
-This stage produces the initial code for the program in the target instruction
-set, then makes use of virtual registers in SSA form and physical registers that
-represent any required register assignments due to target constraints or calling
-conventions. This step turns the LLVM code into a DAG of target
-instructions.</li>
-
-<li><b><a href="#selectiondag_sched">Scheduling and Formation</a></b> - This
-phase takes the DAG of target instructions produced by the instruction selection
-phase, determines an ordering of the instructions, then emits the instructions
-as <tt><a href="#machineinstr">MachineInstr</a></tt>s with that ordering. Note
-that we describe this in the <a href="#instselect">instruction selection
-section</a> because it operates on a <a
-href="#selectiondag_intro">SelectionDAG</a>.
-</li>
-
-<li><b><a href="#ssamco">SSA-based Machine Code Optimizations</a></b> - This
-optional stage consists of a series of machine-code optimizations that
-operate on the SSA-form produced by the instruction selector. Optimizations
-like modulo-scheduling or peephole optimization work here.
-</li>
-
-<li><b><a href="#regalloc">Register Allocation</a></b> - The
-target code is transformed from an infinite virtual register file in SSA form
-to the concrete register file used by the target. This phase introduces spill
-code and eliminates all virtual register references from the program.</li>
-
-<li><b><a href="#proepicode">Prolog/Epilog Code Insertion</a></b> - Once the
-machine code has been generated for the function and the amount of stack space
-required is known (used for LLVM alloca's and spill slots), the prolog and
-epilog code for the function can be inserted and "abstract stack location
-references" can be eliminated. This stage is responsible for implementing
-optimizations like frame-pointer elimination and stack packing.</li>
-
-<li><b><a href="#latemco">Late Machine Code Optimizations</a></b> - Optimizations
-that operate on "final" machine code can go here, such as spill code scheduling
-and peephole optimizations.</li>
-
-<li><b><a href="#codeemit">Code Emission</a></b> - The final stage actually
-puts out the code for the current function, either in the target assembler
-format or in machine code.</li>
-
-</ol>
-
-<p>The code generator is based on the assumption that the instruction selector
-will use an optimal pattern matching selector to create high-quality sequences of
-native instructions. Alternative code generator designs based on pattern
-expansion and aggressive iterative peephole optimization are much slower. This
-design permits efficient compilation (important for JIT environments) and
-aggressive optimization (used when generating code offline) by allowing
-components of varying levels of sophistication to be used for any step of
-compilation.</p>
-
-<p>In addition to these stages, target implementations can insert arbitrary
-target-specific passes into the flow. For example, the X86 target uses a
-special pass to handle the 80x87 floating point stack architecture. Other
-targets with unusual requirements can be supported with custom passes as
-needed.</p>
-
-</div>
-
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="tablegen">Using TableGen for target description</a>
-</div>
-
-<div class="doc_text">
-
-<p>The target description classes require a detailed description of the target
-architecture. These target descriptions often have a large amount of common
-information (e.g., an <tt>add</tt> instruction is almost identical to a
-<tt>sub</tt> instruction).
-In order to allow the maximum amount of commonality to be factored out, the LLVM
-code generator uses the <a href="TableGenFundamentals.html">TableGen</a> tool to
-describe big chunks of the target machine, which allows the use of
-domain-specific and target-specific abstractions to reduce the amount of
-repetition.</p>
-
-<p>As LLVM continues to be developed and refined, we plan to move more and more
-of the target description to the <tt>.td</tt> form. Doing so gives us a
-number of advantages. The most important is that it makes it easier to port
-LLVM because it reduces the amount of C++ code that has to be written, and the
-surface area of the code generator that needs to be understood before someone
-can get something working. Second, it makes it easier to change things. In
-particular, if tables and other things are all emitted by <tt>tblgen</tt>, we
-only need a change in one place (<tt>tblgen</tt>) to update all of the targets
-to a new interface.</p>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section">
- <a name="targetdesc">Target description classes</a>
-</div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>The LLVM target description classes (located in the
-<tt>include/llvm/Target</tt> directory) provide an abstract description of the
-target machine independent of any particular client. These classes are
-designed to capture the <i>abstract</i> properties of the target (such as the
-instructions and registers it has), and do not incorporate any particular pieces
-of code generation algorithms.</p>
-
-<p>All of the target description classes (except the <tt><a
-href="#targetdata">TargetData</a></tt> class) are designed to be subclassed by
-the concrete target implementation, and have virtual methods implemented. To
-get to these implementations, the <tt><a
-href="#targetmachine">TargetMachine</a></tt> class provides accessors that
-should be implemented by the target.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="targetmachine">The <tt>TargetMachine</tt> class</a>
-</div>
-
-<div class="doc_text">
-
-<p>The <tt>TargetMachine</tt> class provides virtual methods that are used to
-access the target-specific implementations of the various target description
-classes via the <tt>get*Info</tt> methods (<tt>getInstrInfo</tt>,
-<tt>getRegisterInfo</tt>, <tt>getFrameInfo</tt>, etc.). This class is
-designed to be specialized by
-a concrete target implementation (e.g., <tt>X86TargetMachine</tt>) which
-implements the various virtual methods. The only required target description
-class is the <a href="#targetdata"><tt>TargetData</tt></a> class, but if the
-code generator components are to be used, the other interfaces should be
-implemented as well.</p>
-
-</div>
-
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="targetdata">The <tt>TargetData</tt> class</a>
-</div>
-
-<div class="doc_text">
-
-<p>The <tt>TargetData</tt> class is the only required target description class,
-and it is the only class that is not extensible (you cannot derived a new
-class from it). <tt>TargetData</tt> specifies information about how the target
-lays out memory for structures, the alignment requirements for various data
-types, the size of pointers in the target, and whether the target is
-little-endian or big-endian.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="targetlowering">The <tt>TargetLowering</tt> class</a>
-</div>
-
-<div class="doc_text">
-
-<p>The <tt>TargetLowering</tt> class is used by SelectionDAG based instruction
-selectors primarily to describe how LLVM code should be lowered to SelectionDAG
-operations. Among other things, this class indicates:</p>
-
-<ul>
- <li>an initial register class to use for various <tt>ValueType</tt>s</li>
- <li>which operations are natively supported by the target machine</li>
- <li>the return type of <tt>setcc</tt> operations</li>
- <li>the type to use for shift amounts</li>
- <li>various high-level characteristics, like whether it is profitable to turn
- division by a constant into a multiplication sequence</li>
-</ul>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="targetregisterinfo">The <tt>TargetRegisterInfo</tt> class</a>
-</div>
-
-<div class="doc_text">
-
-<p>The <tt>TargetRegisterInfo</tt> class is used to describe the register
-file of the target and any interactions between the registers.</p>
-
-<p>Registers in the code generator are represented in the code generator by
-unsigned integers. Physical registers (those that actually exist in the target
-description) are unique small numbers, and virtual registers are generally
-large. Note that register #0 is reserved as a flag value.</p>
-
-<p>Each register in the processor description has an associated
-<tt>TargetRegisterDesc</tt> entry, which provides a textual name for the
-register (used for assembly output and debugging dumps) and a set of aliases
-(used to indicate whether one register overlaps with another).
-</p>
-
-<p>In addition to the per-register description, the <tt>TargetRegisterInfo</tt>
-class exposes a set of processor specific register classes (instances of the
-<tt>TargetRegisterClass</tt> class). Each register class contains sets of
-registers that have the same properties (for example, they are all 32-bit
-integer registers). Each SSA virtual register created by the instruction
-selector has an associated register class. When the register allocator runs, it
-replaces virtual registers with a physical register in the set.</p>
-
-<p>
-The target-specific implementations of these classes is auto-generated from a <a
-href="TableGenFundamentals.html">TableGen</a> description of the register file.
-</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="targetinstrinfo">The <tt>TargetInstrInfo</tt> class</a>
-</div>
-
-<div class="doc_text">
- <p>The <tt>TargetInstrInfo</tt> class is used to describe the machine
- instructions supported by the target. It is essentially an array of
- <tt>TargetInstrDescriptor</tt> objects, each of which describes one
- instruction the target supports. Descriptors define things like the mnemonic
- for the opcode, the number of operands, the list of implicit register uses
- and defs, whether the instruction has certain target-independent properties
- (accesses memory, is commutable, etc), and holds any target-specific
- flags.</p>
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="targetframeinfo">The <tt>TargetFrameInfo</tt> class</a>
-</div>
-
-<div class="doc_text">
- <p>The <tt>TargetFrameInfo</tt> class is used to provide information about the
- stack frame layout of the target. It holds the direction of stack growth,
- the known stack alignment on entry to each function, and the offset to the
- local area. The offset to the local area is the offset from the stack
- pointer on function entry to the first location where function data (local
- variables, spill locations) can be stored.</p>
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="targetsubtarget">The <tt>TargetSubtarget</tt> class</a>
-</div>
-
-<div class="doc_text">
- <p>The <tt>TargetSubtarget</tt> class is used to provide information about the
- specific chip set being targeted. A sub-target informs code generation of
- which instructions are supported, instruction latencies and instruction
- execution itinerary; i.e., which processing units are used, in what order, and
- for how long.</p>
-</div>
-
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="targetjitinfo">The <tt>TargetJITInfo</tt> class</a>
-</div>
-
-<div class="doc_text">
- <p>The <tt>TargetJITInfo</tt> class exposes an abstract interface used by the
- Just-In-Time code generator to perform target-specific activities, such as
- emitting stubs. If a <tt>TargetMachine</tt> supports JIT code generation, it
- should provide one of these objects through the <tt>getJITInfo</tt>
- method.</p>
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section">
- <a name="codegendesc">Machine code description classes</a>
-</div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>At the high-level, LLVM code is translated to a machine specific
-representation formed out of
-<a href="#machinefunction"><tt>MachineFunction</tt></a>,
-<a href="#machinebasicblock"><tt>MachineBasicBlock</tt></a>, and <a
-href="#machineinstr"><tt>MachineInstr</tt></a> instances
-(defined in <tt>include/llvm/CodeGen</tt>). This representation is completely
-target agnostic, representing instructions in their most abstract form: an
-opcode and a series of operands. This representation is designed to support
-both an SSA representation for machine code, as well as a register allocated,
-non-SSA form.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="machineinstr">The <tt>MachineInstr</tt> class</a>
-</div>
-
-<div class="doc_text">
-
-<p>Target machine instructions are represented as instances of the
-<tt>MachineInstr</tt> class. This class is an extremely abstract way of
-representing machine instructions. In particular, it only keeps track of
-an opcode number and a set of operands.</p>
-
-<p>The opcode number is a simple unsigned integer that only has meaning to a
-specific backend. All of the instructions for a target should be defined in
-the <tt>*InstrInfo.td</tt> file for the target. The opcode enum values
-are auto-generated from this description. The <tt>MachineInstr</tt> class does
-not have any information about how to interpret the instruction (i.e., what the
-semantics of the instruction are); for that you must refer to the
-<tt><a href="#targetinstrinfo">TargetInstrInfo</a></tt> class.</p>
-
-<p>The operands of a machine instruction can be of several different types:
-a register reference, a constant integer, a basic block reference, etc. In
-addition, a machine operand should be marked as a def or a use of the value
-(though only registers are allowed to be defs).</p>
-
-<p>By convention, the LLVM code generator orders instruction operands so that
-all register definitions come before the register uses, even on architectures
-that are normally printed in other orders. For example, the SPARC add
-instruction: "<tt>add %i1, %i2, %i3</tt>" adds the "%i1", and "%i2" registers
-and stores the result into the "%i3" register. In the LLVM code generator,
-the operands should be stored as "<tt>%i3, %i1, %i2</tt>": with the destination
-first.</p>
-
-<p>Keeping destination (definition) operands at the beginning of the operand
-list has several advantages. In particular, the debugging printer will print
-the instruction like this:</p>
-
-<div class="doc_code">
-<pre>
-%r3 = add %i1, %i2
-</pre>
-</div>
-
-<p>Also if the first operand is a def, it is easier to <a
-href="#buildmi">create instructions</a> whose only def is the first
-operand.</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="buildmi">Using the <tt>MachineInstrBuilder.h</tt> functions</a>
-</div>
-
-<div class="doc_text">
-
-<p>Machine instructions are created by using the <tt>BuildMI</tt> functions,
-located in the <tt>include/llvm/CodeGen/MachineInstrBuilder.h</tt> file. The
-<tt>BuildMI</tt> functions make it easy to build arbitrary machine
-instructions. Usage of the <tt>BuildMI</tt> functions look like this:</p>
-
-<div class="doc_code">
-<pre>
-// Create a 'DestReg = mov 42' (rendered in X86 assembly as 'mov DestReg, 42')
-// instruction. The '1' specifies how many operands will be added.
-MachineInstr *MI = BuildMI(X86::MOV32ri, 1, DestReg).addImm(42);
-
-// Create the same instr, but insert it at the end of a basic block.
-MachineBasicBlock &amp;MBB = ...
-BuildMI(MBB, X86::MOV32ri, 1, DestReg).addImm(42);
-
-// Create the same instr, but insert it before a specified iterator point.
-MachineBasicBlock::iterator MBBI = ...
-BuildMI(MBB, MBBI, X86::MOV32ri, 1, DestReg).addImm(42);
-
-// Create a 'cmp Reg, 0' instruction, no destination reg.
-MI = BuildMI(X86::CMP32ri, 2).addReg(Reg).addImm(0);
-// Create an 'sahf' instruction which takes no operands and stores nothing.
-MI = BuildMI(X86::SAHF, 0);
-
-// Create a self looping branch instruction.
-BuildMI(MBB, X86::JNE, 1).addMBB(&amp;MBB);
-</pre>
-</div>
-
-<p>The key thing to remember with the <tt>BuildMI</tt> functions is that you
-have to specify the number of operands that the machine instruction will take.
-This allows for efficient memory allocation. You also need to specify if
-operands default to be uses of values, not definitions. If you need to add a
-definition operand (other than the optional destination register), you must
-explicitly mark it as such:</p>
-
-<div class="doc_code">
-<pre>
-MI.addReg(Reg, MachineOperand::Def);
-</pre>
-</div>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="fixedregs">Fixed (preassigned) registers</a>
-</div>
-
-<div class="doc_text">
-
-<p>One important issue that the code generator needs to be aware of is the
-presence of fixed registers. In particular, there are often places in the
-instruction stream where the register allocator <em>must</em> arrange for a
-particular value to be in a particular register. This can occur due to
-limitations of the instruction set (e.g., the X86 can only do a 32-bit divide
-with the <tt>EAX</tt>/<tt>EDX</tt> registers), or external factors like calling
-conventions. In any case, the instruction selector should emit code that
-copies a virtual register into or out of a physical register when needed.</p>
-
-<p>For example, consider this simple LLVM example:</p>
-
-<div class="doc_code">
-<pre>
-int %test(int %X, int %Y) {
- %Z = div int %X, %Y
- ret int %Z
-}
-</pre>
-</div>
-
-<p>The X86 instruction selector produces this machine code for the <tt>div</tt>
-and <tt>ret</tt> (use
-"<tt>llc X.bc -march=x86 -print-machineinstrs</tt>" to get this):</p>
-
-<div class="doc_code">
-<pre>
-;; Start of div
-%EAX = mov %reg1024 ;; Copy X (in reg1024) into EAX
-%reg1027 = sar %reg1024, 31
-%EDX = mov %reg1027 ;; Sign extend X into EDX
-idiv %reg1025 ;; Divide by Y (in reg1025)
-%reg1026 = mov %EAX ;; Read the result (Z) out of EAX
-
-;; Start of ret
-%EAX = mov %reg1026 ;; 32-bit return value goes in EAX
-ret
-</pre>
-</div>
-
-<p>By the end of code generation, the register allocator has coalesced
-the registers and deleted the resultant identity moves producing the
-following code:</p>
-
-<div class="doc_code">
-<pre>
-;; X is in EAX, Y is in ECX
-mov %EAX, %EDX
-sar %EDX, 31
-idiv %ECX
-ret
-</pre>
-</div>
-
-<p>This approach is extremely general (if it can handle the X86 architecture,
-it can handle anything!) and allows all of the target specific
-knowledge about the instruction stream to be isolated in the instruction
-selector. Note that physical registers should have a short lifetime for good
-code generation, and all physical registers are assumed dead on entry to and
-exit from basic blocks (before register allocation). Thus, if you need a value
-to be live across basic block boundaries, it <em>must</em> live in a virtual
-register.</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="ssa">Machine code in SSA form</a>
-</div>
-
-<div class="doc_text">
-
-<p><tt>MachineInstr</tt>'s are initially selected in SSA-form, and
-are maintained in SSA-form until register allocation happens. For the most
-part, this is trivially simple since LLVM is already in SSA form; LLVM PHI nodes
-become machine code PHI nodes, and virtual registers are only allowed to have a
-single definition.</p>
-
-<p>After register allocation, machine code is no longer in SSA-form because there
-are no virtual registers left in the code.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="machinebasicblock">The <tt>MachineBasicBlock</tt> class</a>
-</div>
-
-<div class="doc_text">
-
-<p>The <tt>MachineBasicBlock</tt> class contains a list of machine instructions
-(<tt><a href="#machineinstr">MachineInstr</a></tt> instances). It roughly
-corresponds to the LLVM code input to the instruction selector, but there can be
-a one-to-many mapping (i.e. one LLVM basic block can map to multiple machine
-basic blocks). The <tt>MachineBasicBlock</tt> class has a
-"<tt>getBasicBlock</tt>" method, which returns the LLVM basic block that it
-comes from.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="machinefunction">The <tt>MachineFunction</tt> class</a>
-</div>
-
-<div class="doc_text">
-
-<p>The <tt>MachineFunction</tt> class contains a list of machine basic blocks
-(<tt><a href="#machinebasicblock">MachineBasicBlock</a></tt> instances). It
-corresponds one-to-one with the LLVM function input to the instruction selector.
-In addition to a list of basic blocks, the <tt>MachineFunction</tt> contains a
-a <tt>MachineConstantPool</tt>, a <tt>MachineFrameInfo</tt>, a
-<tt>MachineFunctionInfo</tt>, and a <tt>MachineRegisterInfo</tt>. See
-<tt>include/llvm/CodeGen/MachineFunction.h</tt> for more information.</p>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section">
- <a name="codegenalgs">Target-independent code generation algorithms</a>
-</div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>This section documents the phases described in the <a
-href="#high-level-design">high-level design of the code generator</a>. It
-explains how they work and some of the rationale behind their design.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="instselect">Instruction Selection</a>
-</div>
-
-<div class="doc_text">
-<p>
-Instruction Selection is the process of translating LLVM code presented to the
-code generator into target-specific machine instructions. There are several
-well-known ways to do this in the literature. LLVM uses a SelectionDAG based
-instruction selector.
-</p>
-
-<p>Portions of the DAG instruction selector are generated from the target
-description (<tt>*.td</tt>) files. Our goal is for the entire instruction
-selector to be generated from these <tt>.td</tt> files, though currently
-there are still things that require custom C++ code.</p>
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="selectiondag_intro">Introduction to SelectionDAGs</a>
-</div>
-
-<div class="doc_text">
-
-<p>The SelectionDAG provides an abstraction for code representation in a way
-that is amenable to instruction selection using automatic techniques
-(e.g. dynamic-programming based optimal pattern matching selectors). It is also
-well-suited to other phases of code generation; in particular,
-instruction scheduling (SelectionDAG's are very close to scheduling DAGs
-post-selection). Additionally, the SelectionDAG provides a host representation
-where a large variety of very-low-level (but target-independent)
-<a href="#selectiondag_optimize">optimizations</a> may be
-performed; ones which require extensive information about the instructions
-efficiently supported by the target.</p>
-
-<p>The SelectionDAG is a Directed-Acyclic-Graph whose nodes are instances of the
-<tt>SDNode</tt> class. The primary payload of the <tt>SDNode</tt> is its
-operation code (Opcode) that indicates what operation the node performs and
-the operands to the operation.
-The various operation node types are described at the top of the
-<tt>include/llvm/CodeGen/SelectionDAGNodes.h</tt> file.</p>
-
-<p>Although most operations define a single value, each node in the graph may
-define multiple values. For example, a combined div/rem operation will define
-both the dividend and the remainder. Many other situations require multiple
-values as well. Each node also has some number of operands, which are edges
-to the node defining the used value. Because nodes may define multiple values,
-edges are represented by instances of the <tt>SDOperand</tt> class, which is
-a <tt>&lt;SDNode, unsigned&gt;</tt> pair, indicating the node and result
-value being used, respectively. Each value produced by an <tt>SDNode</tt> has
-an associated <tt>MVT::ValueType</tt> indicating what type the value is.</p>
-
-<p>SelectionDAGs contain two different kinds of values: those that represent
-data flow and those that represent control flow dependencies. Data values are
-simple edges with an integer or floating point value type. Control edges are
-represented as "chain" edges which are of type <tt>MVT::Other</tt>. These edges
-provide an ordering between nodes that have side effects (such as
-loads, stores, calls, returns, etc). All nodes that have side effects should
-take a token chain as input and produce a new one as output. By convention,
-token chain inputs are always operand #0, and chain results are always the last
-value produced by an operation.</p>
-
-<p>A SelectionDAG has designated "Entry" and "Root" nodes. The Entry node is
-always a marker node with an Opcode of <tt>ISD::EntryToken</tt>. The Root node
-is the final side-effecting node in the token chain. For example, in a single
-basic block function it would be the return node.</p>
-
-<p>One important concept for SelectionDAGs is the notion of a "legal" vs.
-"illegal" DAG. A legal DAG for a target is one that only uses supported
-operations and supported types. On a 32-bit PowerPC, for example, a DAG with
-a value of type i1, i8, i16, or i64 would be illegal, as would a DAG that uses a
-SREM or UREM operation. The
-<a href="#selectiondag_legalize">legalize</a> phase is responsible for turning
-an illegal DAG into a legal DAG.</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="selectiondag_process">SelectionDAG Instruction Selection Process</a>
-</div>
-
-<div class="doc_text">
-
-<p>SelectionDAG-based instruction selection consists of the following steps:</p>
-
-<ol>
-<li><a href="#selectiondag_build">Build initial DAG</a> - This stage
- performs a simple translation from the input LLVM code to an illegal
- SelectionDAG.</li>
-<li><a href="#selectiondag_optimize">Optimize SelectionDAG</a> - This stage
- performs simple optimizations on the SelectionDAG to simplify it, and
- recognize meta instructions (like rotates and <tt>div</tt>/<tt>rem</tt>
- pairs) for targets that support these meta operations. This makes the
- resultant code more efficient and the <a href="#selectiondag_select">select
- instructions from DAG</a> phase (below) simpler.</li>
-<li><a href="#selectiondag_legalize">Legalize SelectionDAG</a> - This stage
- converts the illegal SelectionDAG to a legal SelectionDAG by eliminating
- unsupported operations and data types.</li>
-<li><a href="#selectiondag_optimize">Optimize SelectionDAG (#2)</a> - This
- second run of the SelectionDAG optimizes the newly legalized DAG to
- eliminate inefficiencies introduced by legalization.</li>
-<li><a href="#selectiondag_select">Select instructions from DAG</a> - Finally,
- the target instruction selector matches the DAG operations to target
- instructions. This process translates the target-independent input DAG into
- another DAG of target instructions.</li>
-<li><a href="#selectiondag_sched">SelectionDAG Scheduling and Formation</a>
- - The last phase assigns a linear order to the instructions in the
- target-instruction DAG and emits them into the MachineFunction being
- compiled. This step uses traditional prepass scheduling techniques.</li>
-</ol>
-
-<p>After all of these steps are complete, the SelectionDAG is destroyed and the
-rest of the code generation passes are run.</p>
-
-<p>One great way to visualize what is going on here is to take advantage of a
-few LLC command line options. In particular, the <tt>-view-isel-dags</tt>
-option pops up a window with the SelectionDAG input to the Select phase for all
-of the code compiled (if you only get errors printed to the console while using
-this, you probably <a href="ProgrammersManual.html#ViewGraph">need to configure
-your system</a> to add support for it). The <tt>-view-sched-dags</tt> option
-views the SelectionDAG output from the Select phase and input to the Scheduler
-phase. The <tt>-view-sunit-dags</tt> option views the ScheduleDAG, which is
-based on the final SelectionDAG, with nodes that must be scheduled as a unit
-bundled together into a single node, and with immediate operands and other
-nodes that aren't relevent for scheduling omitted.
-</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="selectiondag_build">Initial SelectionDAG Construction</a>
-</div>
-
-<div class="doc_text">
-
-<p>The initial SelectionDAG is na&iuml;vely peephole expanded from the LLVM
-input by the <tt>SelectionDAGLowering</tt> class in the
-<tt>lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp</tt> file. The intent of this
-pass is to expose as much low-level, target-specific details to the SelectionDAG
-as possible. This pass is mostly hard-coded (e.g. an LLVM <tt>add</tt> turns
-into an <tt>SDNode add</tt> while a <tt>geteelementptr</tt> is expanded into the
-obvious arithmetic). This pass requires target-specific hooks to lower calls,
-returns, varargs, etc. For these features, the
-<tt><a href="#targetlowering">TargetLowering</a></tt> interface is used.</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="selectiondag_legalize">SelectionDAG Legalize Phase</a>
-</div>
-
-<div class="doc_text">
-
-<p>The Legalize phase is in charge of converting a DAG to only use the types and
-operations that are natively supported by the target. This involves two major
-tasks:</p>
-
-<ol>
-<li><p>Convert values of unsupported types to values of supported types.</p>
- <p>There are two main ways of doing this: converting small types to
- larger types ("promoting"), and breaking up large integer types
- into smaller ones ("expanding"). For example, a target might require
- that all f32 values are promoted to f64 and that all i1/i8/i16 values
- are promoted to i32. The same target might require that all i64 values
- be expanded into i32 values. These changes can insert sign and zero
- extensions as needed to make sure that the final code has the same
- behavior as the input.</p>
- <p>A target implementation tells the legalizer which types are supported
- (and which register class to use for them) by calling the
- <tt>addRegisterClass</tt> method in its TargetLowering constructor.</p>
-</li>
-
-<li><p>Eliminate operations that are not supported by the target.</p>
- <p>Targets often have weird constraints, such as not supporting every
- operation on every supported datatype (e.g. X86 does not support byte
- conditional moves and PowerPC does not support sign-extending loads from
- a 16-bit memory location). Legalize takes care of this by open-coding
- another sequence of operations to emulate the operation ("expansion"), by
- promoting one type to a larger type that supports the operation
- ("promotion"), or by using a target-specific hook to implement the
- legalization ("custom").</p>
- <p>A target implementation tells the legalizer which operations are not
- supported (and which of the above three actions to take) by calling the
- <tt>setOperationAction</tt> method in its <tt>TargetLowering</tt>
- constructor.</p>
-</li>
-</ol>
-
-<p>Prior to the existance of the Legalize pass, we required that every target
-<a href="#selectiondag_optimize">selector</a> supported and handled every
-operator and type even if they are not natively supported. The introduction of
-the Legalize phase allows all of the cannonicalization patterns to be shared
-across targets, and makes it very easy to optimize the cannonicalized code
-because it is still in the form of a DAG.</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="selectiondag_optimize">SelectionDAG Optimization Phase: the DAG
- Combiner</a>
-</div>
-
-<div class="doc_text">
-
-<p>The SelectionDAG optimization phase is run twice for code generation: once
-immediately after the DAG is built and once after legalization. The first run
-of the pass allows the initial code to be cleaned up (e.g. performing
-optimizations that depend on knowing that the operators have restricted type
-inputs). The second run of the pass cleans up the messy code generated by the
-Legalize pass, which allows Legalize to be very simple (it can focus on making
-code legal instead of focusing on generating <em>good</em> and legal code).</p>
-
-<p>One important class of optimizations performed is optimizing inserted sign
-and zero extension instructions. We currently use ad-hoc techniques, but could
-move to more rigorous techniques in the future. Here are some good papers on
-the subject:</p>
-
-<p>
- "<a href="http://www.eecs.harvard.edu/~nr/pubs/widen-abstract.html">Widening
- integer arithmetic</a>"<br>
- Kevin Redwine and Norman Ramsey<br>
- International Conference on Compiler Construction (CC) 2004
-</p>
-
-
-<p>
- "<a href="http://portal.acm.org/citation.cfm?doid=512529.512552">Effective
- sign extension elimination</a>"<br>
- Motohiro Kawahito, Hideaki Komatsu, and Toshio Nakatani<br>
- Proceedings of the ACM SIGPLAN 2002 Conference on Programming Language Design
- and Implementation.
-</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="selectiondag_select">SelectionDAG Select Phase</a>
-</div>
-
-<div class="doc_text">
-
-<p>The Select phase is the bulk of the target-specific code for instruction
-selection. This phase takes a legal SelectionDAG as input, pattern matches the
-instructions supported by the target to this DAG, and produces a new DAG of
-target code. For example, consider the following LLVM fragment:</p>
-
-<div class="doc_code">
-<pre>
-%t1 = add float %W, %X
-%t2 = mul float %t1, %Y
-%t3 = add float %t2, %Z
-</pre>
-</div>
-
-<p>This LLVM code corresponds to a SelectionDAG that looks basically like
-this:</p>
-
-<div class="doc_code">
-<pre>
-(fadd:f32 (fmul:f32 (fadd:f32 W, X), Y), Z)
-</pre>
-</div>
-
-<p>If a target supports floating point multiply-and-add (FMA) operations, one
-of the adds can be merged with the multiply. On the PowerPC, for example, the
-output of the instruction selector might look like this DAG:</p>
-
-<div class="doc_code">
-<pre>
-(FMADDS (FADDS W, X), Y, Z)
-</pre>
-</div>
-
-<p>The <tt>FMADDS</tt> instruction is a ternary instruction that multiplies its
-first two operands and adds the third (as single-precision floating-point
-numbers). The <tt>FADDS</tt> instruction is a simple binary single-precision
-add instruction. To perform this pattern match, the PowerPC backend includes
-the following instruction definitions:</p>
-
-<div class="doc_code">
-<pre>
-def FMADDS : AForm_1&lt;59, 29,
- (ops F4RC:$FRT, F4RC:$FRA, F4RC:$FRC, F4RC:$FRB),
- "fmadds $FRT, $FRA, $FRC, $FRB",
- [<b>(set F4RC:$FRT, (fadd (fmul F4RC:$FRA, F4RC:$FRC),
- F4RC:$FRB))</b>]&gt;;
-def FADDS : AForm_2&lt;59, 21,
- (ops F4RC:$FRT, F4RC:$FRA, F4RC:$FRB),
- "fadds $FRT, $FRA, $FRB",
- [<b>(set F4RC:$FRT, (fadd F4RC:$FRA, F4RC:$FRB))</b>]&gt;;
-</pre>
-</div>
-
-<p>The portion of the instruction definition in bold indicates the pattern used
-to match the instruction. The DAG operators (like <tt>fmul</tt>/<tt>fadd</tt>)
-are defined in the <tt>lib/Target/TargetSelectionDAG.td</tt> file.
-"<tt>F4RC</tt>" is the register class of the input and result values.<p>
-
-<p>The TableGen DAG instruction selector generator reads the instruction
-patterns in the <tt>.td</tt> file and automatically builds parts of the pattern
-matching code for your target. It has the following strengths:</p>
-
-<ul>
-<li>At compiler-compiler time, it analyzes your instruction patterns and tells
- you if your patterns make sense or not.</li>
-<li>It can handle arbitrary constraints on operands for the pattern match. In
- particular, it is straight-forward to say things like "match any immediate
- that is a 13-bit sign-extended value". For examples, see the
- <tt>immSExt16</tt> and related <tt>tblgen</tt> classes in the PowerPC
- backend.</li>
-<li>It knows several important identities for the patterns defined. For
- example, it knows that addition is commutative, so it allows the
- <tt>FMADDS</tt> pattern above to match "<tt>(fadd X, (fmul Y, Z))</tt>" as
- well as "<tt>(fadd (fmul X, Y), Z)</tt>", without the target author having
- to specially handle this case.</li>
-<li>It has a full-featured type-inferencing system. In particular, you should
- rarely have to explicitly tell the system what type parts of your patterns
- are. In the <tt>FMADDS</tt> case above, we didn't have to tell
- <tt>tblgen</tt> that all of the nodes in the pattern are of type 'f32'. It
- was able to infer and propagate this knowledge from the fact that
- <tt>F4RC</tt> has type 'f32'.</li>
-<li>Targets can define their own (and rely on built-in) "pattern fragments".
- Pattern fragments are chunks of reusable patterns that get inlined into your
- patterns during compiler-compiler time. For example, the integer
- "<tt>(not x)</tt>" operation is actually defined as a pattern fragment that
- expands as "<tt>(xor x, -1)</tt>", since the SelectionDAG does not have a
- native '<tt>not</tt>' operation. Targets can define their own short-hand
- fragments as they see fit. See the definition of '<tt>not</tt>' and
- '<tt>ineg</tt>' for examples.</li>
-<li>In addition to instructions, targets can specify arbitrary patterns that
- map to one or more instructions using the 'Pat' class. For example,
- the PowerPC has no way to load an arbitrary integer immediate into a
- register in one instruction. To tell tblgen how to do this, it defines:
- <br>
- <br>
- <div class="doc_code">
- <pre>
-// Arbitrary immediate support. Implement in terms of LIS/ORI.
-def : Pat&lt;(i32 imm:$imm),
- (ORI (LIS (HI16 imm:$imm)), (LO16 imm:$imm))&gt;;
- </pre>
- </div>
- <br>
- If none of the single-instruction patterns for loading an immediate into a
- register match, this will be used. This rule says "match an arbitrary i32
- immediate, turning it into an <tt>ORI</tt> ('or a 16-bit immediate') and an
- <tt>LIS</tt> ('load 16-bit immediate, where the immediate is shifted to the
- left 16 bits') instruction". To make this work, the
- <tt>LO16</tt>/<tt>HI16</tt> node transformations are used to manipulate the
- input immediate (in this case, take the high or low 16-bits of the
- immediate).</li>
-<li>While the system does automate a lot, it still allows you to write custom
- C++ code to match special cases if there is something that is hard to
- express.</li>
-</ul>
-
-<p>While it has many strengths, the system currently has some limitations,
-primarily because it is a work in progress and is not yet finished:</p>
-
-<ul>
-<li>Overall, there is no way to define or match SelectionDAG nodes that define
- multiple values (e.g. <tt>ADD_PARTS</tt>, <tt>LOAD</tt>, <tt>CALL</tt>,
- etc). This is the biggest reason that you currently still <em>have to</em>
- write custom C++ code for your instruction selector.</li>
-<li>There is no great way to support matching complex addressing modes yet. In
- the future, we will extend pattern fragments to allow them to define
- multiple values (e.g. the four operands of the <a href="#x86_memory">X86
- addressing mode</a>, which are currently matched with custom C++ code).
- In addition, we'll extend fragments so that a
- fragment can match multiple different patterns.</li>
-<li>We don't automatically infer flags like isStore/isLoad yet.</li>
-<li>We don't automatically generate the set of supported registers and
- operations for the <a href="#selectiondag_legalize">Legalizer</a> yet.</li>
-<li>We don't have a way of tying in custom legalized nodes yet.</li>
-</ul>
-
-<p>Despite these limitations, the instruction selector generator is still quite
-useful for most of the binary and logical operations in typical instruction
-sets. If you run into any problems or can't figure out how to do something,
-please let Chris know!</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="selectiondag_sched">SelectionDAG Scheduling and Formation Phase</a>
-</div>
-
-<div class="doc_text">
-
-<p>The scheduling phase takes the DAG of target instructions from the selection
-phase and assigns an order. The scheduler can pick an order depending on
-various constraints of the machines (i.e. order for minimal register pressure or
-try to cover instruction latencies). Once an order is established, the DAG is
-converted to a list of <tt><a href="#machineinstr">MachineInstr</a></tt>s and
-the SelectionDAG is destroyed.</p>
-
-<p>Note that this phase is logically separate from the instruction selection
-phase, but is tied to it closely in the code because it operates on
-SelectionDAGs.</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="selectiondag_future">Future directions for the SelectionDAG</a>
-</div>
-
-<div class="doc_text">
-
-<ol>
-<li>Optional function-at-a-time selection.</li>
-<li>Auto-generate entire selector from <tt>.td</tt> file.</li>
-</ol>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="ssamco">SSA-based Machine Code Optimizations</a>
-</div>
-<div class="doc_text"><p>To Be Written</p></div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="liveintervals">Live Intervals</a>
-</div>
-
-<div class="doc_text">
-
-<p>Live Intervals are the ranges (intervals) where a variable is <i>live</i>.
-They are used by some <a href="#regalloc">register allocator</a> passes to
-determine if two or more virtual registers which require the same physical
-register are live at the same point in the program (i.e., they conflict). When
-this situation occurs, one virtual register must be <i>spilled</i>.</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="livevariable_analysis">Live Variable Analysis</a>
-</div>
-
-<div class="doc_text">
-
-<p>The first step in determining the live intervals of variables is to
-calculate the set of registers that are immediately dead after the
-instruction (i.e., the instruction calculates the value, but it is
-never used) and the set of registers that are used by the instruction,
-but are never used after the instruction (i.e., they are killed). Live
-variable information is computed for each <i>virtual</i> register and
-<i>register allocatable</i> physical register in the function. This
-is done in a very efficient manner because it uses SSA to sparsely
-compute lifetime information for virtual registers (which are in SSA
-form) and only has to track physical registers within a block. Before
-register allocation, LLVM can assume that physical registers are only
-live within a single basic block. This allows it to do a single,
-local analysis to resolve physical register lifetimes within each
-basic block. If a physical register is not register allocatable (e.g.,
-a stack pointer or condition codes), it is not tracked.</p>
-
-<p>Physical registers may be live in to or out of a function. Live in values
-are typically arguments in registers. Live out values are typically return
-values in registers. Live in values are marked as such, and are given a dummy
-"defining" instruction during live intervals analysis. If the last basic block
-of a function is a <tt>return</tt>, then it's marked as using all live out
-values in the function.</p>
-
-<p><tt>PHI</tt> nodes need to be handled specially, because the calculation
-of the live variable information from a depth first traversal of the CFG of
-the function won't guarantee that a virtual register used by the <tt>PHI</tt>
-node is defined before it's used. When a <tt>PHI</tt> node is encounted, only
-the definition is handled, because the uses will be handled in other basic
-blocks.</p>
-
-<p>For each <tt>PHI</tt> node of the current basic block, we simulate an
-assignment at the end of the current basic block and traverse the successor
-basic blocks. If a successor basic block has a <tt>PHI</tt> node and one of
-the <tt>PHI</tt> node's operands is coming from the current basic block,
-then the variable is marked as <i>alive</i> within the current basic block
-and all of its predecessor basic blocks, until the basic block with the
-defining instruction is encountered.</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="liveintervals_analysis">Live Intervals Analysis</a>
-</div>
-
-<div class="doc_text">
-
-<p>We now have the information available to perform the live intervals analysis
-and build the live intervals themselves. We start off by numbering the basic
-blocks and machine instructions. We then handle the "live-in" values. These
-are in physical registers, so the physical register is assumed to be killed by
-the end of the basic block. Live intervals for virtual registers are computed
-for some ordering of the machine instructions <tt>[1, N]</tt>. A live interval
-is an interval <tt>[i, j)</tt>, where <tt>1 <= i <= j < N</tt>, for which a
-variable is live.</p>
-
-<p><i><b>More to come...</b></i></p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="regalloc">Register Allocation</a>
-</div>
-
-<div class="doc_text">
-
-<p>The <i>Register Allocation problem</i> consists in mapping a program
-<i>P<sub>v</sub></i>, that can use an unbounded number of virtual
-registers, to a program <i>P<sub>p</sub></i> that contains a finite
-(possibly small) number of physical registers. Each target architecture has
-a different number of physical registers. If the number of physical
-registers is not enough to accommodate all the virtual registers, some of
-them will have to be mapped into memory. These virtuals are called
-<i>spilled virtuals</i>.</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-
-<div class="doc_subsubsection">
- <a name="regAlloc_represent">How registers are represented in LLVM</a>
-</div>
-
-<div class="doc_text">
-
-<p>In LLVM, physical registers are denoted by integer numbers that
-normally range from 1 to 1023. To see how this numbering is defined
-for a particular architecture, you can read the
-<tt>GenRegisterNames.inc</tt> file for that architecture. For
-instance, by inspecting
-<tt>lib/Target/X86/X86GenRegisterNames.inc</tt> we see that the 32-bit
-register <tt>EAX</tt> is denoted by 15, and the MMX register
-<tt>MM0</tt> is mapped to 48.</p>
-
-<p>Some architectures contain registers that share the same physical
-location. A notable example is the X86 platform. For instance, in the
-X86 architecture, the registers <tt>EAX</tt>, <tt>AX</tt> and
-<tt>AL</tt> share the first eight bits. These physical registers are
-marked as <i>aliased</i> in LLVM. Given a particular architecture, you
-can check which registers are aliased by inspecting its
-<tt>RegisterInfo.td</tt> file. Moreover, the method
-<tt>TargetRegisterInfo::getAliasSet(p_reg)</tt> returns an array containing
-all the physical registers aliased to the register <tt>p_reg</tt>.</p>
-
-<p>Physical registers, in LLVM, are grouped in <i>Register Classes</i>.
-Elements in the same register class are functionally equivalent, and can
-be interchangeably used. Each virtual register can only be mapped to
-physical registers of a particular class. For instance, in the X86
-architecture, some virtuals can only be allocated to 8 bit registers.
-A register class is described by <tt>TargetRegisterClass</tt> objects.
-To discover if a virtual register is compatible with a given physical,
-this code can be used:
-</p>
-
-<div class="doc_code">
-<pre>
-bool RegMapping_Fer::compatible_class(MachineFunction &amp;mf,
- unsigned v_reg,
- unsigned p_reg) {
- assert(TargetRegisterInfo::isPhysicalRegister(p_reg) &amp;&amp;
- "Target register must be physical");
- const TargetRegisterClass *trc = mf.getRegInfo().getRegClass(v_reg);
- return trc-&gt;contains(p_reg);
-}
-</pre>
-</div>
-
-<p>Sometimes, mostly for debugging purposes, it is useful to change
-the number of physical registers available in the target
-architecture. This must be done statically, inside the
-<tt>TargetRegsterInfo.td</tt> file. Just <tt>grep</tt> for
-<tt>RegisterClass</tt>, the last parameter of which is a list of
-registers. Just commenting some out is one simple way to avoid them
-being used. A more polite way is to explicitly exclude some registers
-from the <i>allocation order</i>. See the definition of the
-<tt>GR</tt> register class in
-<tt>lib/Target/IA64/IA64RegisterInfo.td</tt> for an example of this
-(e.g., <tt>numReservedRegs</tt> registers are hidden.)</p>
-
-<p>Virtual registers are also denoted by integer numbers. Contrary to
-physical registers, different virtual registers never share the same
-number. The smallest virtual register is normally assigned the number
-1024. This may change, so, in order to know which is the first virtual
-register, you should access
-<tt>TargetRegisterInfo::FirstVirtualRegister</tt>. Any register whose
-number is greater than or equal to
-<tt>TargetRegisterInfo::FirstVirtualRegister</tt> is considered a virtual
-register. Whereas physical registers are statically defined in a
-<tt>TargetRegisterInfo.td</tt> file and cannot be created by the
-application developer, that is not the case with virtual registers.
-In order to create new virtual registers, use the method
-<tt>MachineRegisterInfo::createVirtualRegister()</tt>. This method will return a
-virtual register with the highest code.
-</p>
-
-<p>Before register allocation, the operands of an instruction are
-mostly virtual registers, although physical registers may also be
-used. In order to check if a given machine operand is a register, use
-the boolean function <tt>MachineOperand::isRegister()</tt>. To obtain
-the integer code of a register, use
-<tt>MachineOperand::getReg()</tt>. An instruction may define or use a
-register. For instance, <tt>ADD reg:1026 := reg:1025 reg:1024</tt>
-defines the registers 1024, and uses registers 1025 and 1026. Given a
-register operand, the method <tt>MachineOperand::isUse()</tt> informs
-if that register is being used by the instruction. The method
-<tt>MachineOperand::isDef()</tt> informs if that registers is being
-defined.</p>
-
-<p>We will call physical registers present in the LLVM bitcode before
-register allocation <i>pre-colored registers</i>. Pre-colored
-registers are used in many different situations, for instance, to pass
-parameters of functions calls, and to store results of particular
-instructions. There are two types of pre-colored registers: the ones
-<i>implicitly</i> defined, and those <i>explicitly</i>
-defined. Explicitly defined registers are normal operands, and can be
-accessed with <tt>MachineInstr::getOperand(int)::getReg()</tt>. In
-order to check which registers are implicitly defined by an
-instruction, use the
-<tt>TargetInstrInfo::get(opcode)::ImplicitDefs</tt>, where
-<tt>opcode</tt> is the opcode of the target instruction. One important
-difference between explicit and implicit physical registers is that
-the latter are defined statically for each instruction, whereas the
-former may vary depending on the program being compiled. For example,
-an instruction that represents a function call will always implicitly
-define or use the same set of physical registers. To read the
-registers implicitly used by an instruction, use
-<tt>TargetInstrInfo::get(opcode)::ImplicitUses</tt>. Pre-colored
-registers impose constraints on any register allocation algorithm. The
-register allocator must make sure that none of them is been
-overwritten by the values of virtual registers while still alive.</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-
-<div class="doc_subsubsection">
- <a name="regAlloc_howTo">Mapping virtual registers to physical registers</a>
-</div>
-
-<div class="doc_text">
-
-<p>There are two ways to map virtual registers to physical registers (or to
-memory slots). The first way, that we will call <i>direct mapping</i>,
-is based on the use of methods of the classes <tt>TargetRegisterInfo</tt>,
-and <tt>MachineOperand</tt>. The second way, that we will call
-<i>indirect mapping</i>, relies on the <tt>VirtRegMap</tt> class in
-order to insert loads and stores sending and getting values to and from
-memory.</p>
-
-<p>The direct mapping provides more flexibility to the developer of
-the register allocator; however, it is more error prone, and demands
-more implementation work. Basically, the programmer will have to
-specify where load and store instructions should be inserted in the
-target function being compiled in order to get and store values in
-memory. To assign a physical register to a virtual register present in
-a given operand, use <tt>MachineOperand::setReg(p_reg)</tt>. To insert
-a store instruction, use
-<tt>TargetRegisterInfo::storeRegToStackSlot(...)</tt>, and to insert a load
-instruction, use <tt>TargetRegisterInfo::loadRegFromStackSlot</tt>.</p>
-
-<p>The indirect mapping shields the application developer from the
-complexities of inserting load and store instructions. In order to map
-a virtual register to a physical one, use
-<tt>VirtRegMap::assignVirt2Phys(vreg, preg)</tt>. In order to map a
-certain virtual register to memory, use
-<tt>VirtRegMap::assignVirt2StackSlot(vreg)</tt>. This method will
-return the stack slot where <tt>vreg</tt>'s value will be located. If
-it is necessary to map another virtual register to the same stack
-slot, use <tt>VirtRegMap::assignVirt2StackSlot(vreg,
-stack_location)</tt>. One important point to consider when using the
-indirect mapping, is that even if a virtual register is mapped to
-memory, it still needs to be mapped to a physical register. This
-physical register is the location where the virtual register is
-supposed to be found before being stored or after being reloaded.</p>
-
-<p>If the indirect strategy is used, after all the virtual registers
-have been mapped to physical registers or stack slots, it is necessary
-to use a spiller object to place load and store instructions in the
-code. Every virtual that has been mapped to a stack slot will be
-stored to memory after been defined and will be loaded before being
-used. The implementation of the spiller tries to recycle load/store
-instructions, avoiding unnecessary instructions. For an example of how
-to invoke the spiller, see
-<tt>RegAllocLinearScan::runOnMachineFunction</tt> in
-<tt>lib/CodeGen/RegAllocLinearScan.cpp</tt>.</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="regAlloc_twoAddr">Handling two address instructions</a>
-</div>
-
-<div class="doc_text">
-
-<p>With very rare exceptions (e.g., function calls), the LLVM machine
-code instructions are three address instructions. That is, each
-instruction is expected to define at most one register, and to use at
-most two registers. However, some architectures use two address
-instructions. In this case, the defined register is also one of the
-used register. For instance, an instruction such as <tt>ADD %EAX,
-%EBX</tt>, in X86 is actually equivalent to <tt>%EAX = %EAX +
-%EBX</tt>.</p>
-
-<p>In order to produce correct code, LLVM must convert three address
-instructions that represent two address instructions into true two
-address instructions. LLVM provides the pass
-<tt>TwoAddressInstructionPass</tt> for this specific purpose. It must
-be run before register allocation takes place. After its execution,
-the resulting code may no longer be in SSA form. This happens, for
-instance, in situations where an instruction such as <tt>%a = ADD %b
-%c</tt> is converted to two instructions such as:</p>
-
-<div class="doc_code">
-<pre>
-%a = MOVE %b
-%a = ADD %a %b
-</pre>
-</div>
-
-<p>Notice that, internally, the second instruction is represented as
-<tt>ADD %a[def/use] %b</tt>. I.e., the register operand <tt>%a</tt> is
-both used and defined by the instruction.</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="regAlloc_ssaDecon">The SSA deconstruction phase</a>
-</div>
-
-<div class="doc_text">
-
-<p>An important transformation that happens during register allocation is called
-the <i>SSA Deconstruction Phase</i>. The SSA form simplifies many
-analyses that are performed on the control flow graph of
-programs. However, traditional instruction sets do not implement
-PHI instructions. Thus, in order to generate executable code, compilers
-must replace PHI instructions with other instructions that preserve their
-semantics.</p>
-
-<p>There are many ways in which PHI instructions can safely be removed
-from the target code. The most traditional PHI deconstruction
-algorithm replaces PHI instructions with copy instructions. That is
-the strategy adopted by LLVM. The SSA deconstruction algorithm is
-implemented in n<tt>lib/CodeGen/>PHIElimination.cpp</tt>. In order to
-invoke this pass, the identifier <tt>PHIEliminationID</tt> must be
-marked as required in the code of the register allocator.</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="regAlloc_fold">Instruction folding</a>
-</div>
-
-<div class="doc_text">
-
-<p><i>Instruction folding</i> is an optimization performed during
-register allocation that removes unnecessary copy instructions. For
-instance, a sequence of instructions such as:</p>
-
-<div class="doc_code">
-<pre>
-%EBX = LOAD %mem_address
-%EAX = COPY %EBX
-</pre>
-</div>
-
-<p>can be safely substituted by the single instruction:
-
-<div class="doc_code">
-<pre>
-%EAX = LOAD %mem_address
-</pre>
-</div>
-
-<p>Instructions can be folded with the
-<tt>TargetRegisterInfo::foldMemoryOperand(...)</tt> method. Care must be
-taken when folding instructions; a folded instruction can be quite
-different from the original instruction. See
-<tt>LiveIntervals::addIntervalsForSpills</tt> in
-<tt>lib/CodeGen/LiveIntervalAnalysis.cpp</tt> for an example of its use.</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-
-<div class="doc_subsubsection">
- <a name="regAlloc_builtIn">Built in register allocators</a>
-</div>
-
-<div class="doc_text">
-
-<p>The LLVM infrastructure provides the application developer with
-three different register allocators:</p>
-
-<ul>
- <li><i>Simple</i> - This is a very simple implementation that does
- not keep values in registers across instructions. This register
- allocator immediately spills every value right after it is
- computed, and reloads all used operands from memory to temporary
- registers before each instruction.</li>
- <li><i>Local</i> - This register allocator is an improvement on the
- <i>Simple</i> implementation. It allocates registers on a basic
- block level, attempting to keep values in registers and reusing
- registers as appropriate.</li>
- <li><i>Linear Scan</i> - <i>The default allocator</i>. This is the
- well-know linear scan register allocator. Whereas the
- <i>Simple</i> and <i>Local</i> algorithms use a direct mapping
- implementation technique, the <i>Linear Scan</i> implementation
- uses a spiller in order to place load and stores.</li>
-</ul>
-
-<p>The type of register allocator used in <tt>llc</tt> can be chosen with the
-command line option <tt>-regalloc=...</tt>:</p>
-
-<div class="doc_code">
-<pre>
-$ llc -f -regalloc=simple file.bc -o sp.s;
-$ llc -f -regalloc=local file.bc -o lc.s;
-$ llc -f -regalloc=linearscan file.bc -o ln.s;
-</pre>
-</div>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="proepicode">Prolog/Epilog Code Insertion</a>
-</div>
-<div class="doc_text"><p>To Be Written</p></div>
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="latemco">Late Machine Code Optimizations</a>
-</div>
-<div class="doc_text"><p>To Be Written</p></div>
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="codeemit">Code Emission</a>
-</div>
-<div class="doc_text"><p>To Be Written</p></div>
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="codeemit_asm">Generating Assembly Code</a>
-</div>
-<div class="doc_text"><p>To Be Written</p></div>
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="codeemit_bin">Generating Binary Machine Code</a>
-</div>
-
-<div class="doc_text">
- <p>For the JIT or <tt>.o</tt> file writer</p>
-</div>
-
-
-<!-- *********************************************************************** -->
-<div class="doc_section">
- <a name="targetimpls">Target-specific Implementation Notes</a>
-</div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>This section of the document explains features or design decisions that
-are specific to the code generator for a particular target.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="tailcallopt">Tail call optimization</a>
-</div>
-
-<div class="doc_text">
- <p>Tail call optimization, callee reusing the stack of the caller, is currently supported on x86/x86-64 and PowerPC. It is performed if:
- <ul>
- <li>Caller and callee have the calling convention <tt>fastcc</tt>.</li>
- <li>The call is a tail call - in tail position (ret immediately follows call and ret uses value of call or is void).</li>
- <li>Option <tt>-tailcallopt</tt> is enabled.</li>
- <li>Platform specific constraints are met.</li>
- </ul>
- </p>
-
- <p>x86/x86-64 constraints:
- <ul>
- <li>No variable argument lists are used.</li>
- <li>On x86-64 when generating GOT/PIC code only module-local calls (visibility = hidden or protected) are supported.</li>
- </ul>
- </p>
- <p>PowerPC constraints:
- <ul>
- <li>No variable argument lists are used.</li>
- <li>No byval parameters are used.</li>
- <li>On ppc32/64 GOT/PIC only module-local calls (visibility = hidden or protected) are supported.</li>
- </ul>
- </p>
- <p>Example:</p>
- <p>Call as <tt>llc -tailcallopt test.ll</tt>.
- <div class="doc_code">
- <pre>
-declare fastcc i32 @tailcallee(i32 inreg %a1, i32 inreg %a2, i32 %a3, i32 %a4)
-
-define fastcc i32 @tailcaller(i32 %in1, i32 %in2) {
- %l1 = add i32 %in1, %in2
- %tmp = tail call fastcc i32 @tailcallee(i32 %in1 inreg, i32 %in2 inreg, i32 %in1, i32 %l1)
- ret i32 %tmp
-}</pre>
- </div>
- </p>
- <p>Implications of <tt>-tailcallopt</tt>:</p>
- <p>To support tail call optimization in situations where the callee has more arguments than the caller a 'callee pops arguments' convention is used. This currently causes each <tt>fastcc</tt> call that is not tail call optimized (because one or more of above constraints are not met) to be followed by a readjustment of the stack. So performance might be worse in such cases.</p>
- <p>On x86 and x86-64 one register is reserved for indirect tail calls (e.g via a function pointer). So there is one less register for integer argument passing. For x86 this means 2 registers (if <tt>inreg</tt> parameter attribute is used) and for x86-64 this means 5 register are used.</p>
-</div>
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="x86">The X86 backend</a>
-</div>
-
-<div class="doc_text">
-
-<p>The X86 code generator lives in the <tt>lib/Target/X86</tt> directory. This
-code generator is capable of targeting a variety of x86-32 and x86-64
-processors, and includes support for ISA extensions such as MMX and SSE.
-</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="x86_tt">X86 Target Triples Supported</a>
-</div>
-
-<div class="doc_text">
-
-<p>The following are the known target triples that are supported by the X86
-backend. This is not an exhaustive list, and it would be useful to add those
-that people test.</p>
-
-<ul>
-<li><b>i686-pc-linux-gnu</b> - Linux</li>
-<li><b>i386-unknown-freebsd5.3</b> - FreeBSD 5.3</li>
-<li><b>i686-pc-cygwin</b> - Cygwin on Win32</li>
-<li><b>i686-pc-mingw32</b> - MingW on Win32</li>
-<li><b>i386-pc-mingw32msvc</b> - MingW crosscompiler on Linux</li>
-<li><b>i686-apple-darwin*</b> - Apple Darwin on X86</li>
-</ul>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="x86_cc">X86 Calling Conventions supported</a>
-</div>
-
-
-<div class="doc_text">
-
-<p>The folowing target-specific calling conventions are known to backend:</p>
-
-<ul>
-<li><b>x86_StdCall</b> - stdcall calling convention seen on Microsoft Windows
-platform (CC ID = 64).</li>
-<li><b>x86_FastCall</b> - fastcall calling convention seen on Microsoft Windows
-platform (CC ID = 65).</li>
-</ul>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="x86_memory">Representing X86 addressing modes in MachineInstrs</a>
-</div>
-
-<div class="doc_text">
-
-<p>The x86 has a very flexible way of accessing memory. It is capable of
-forming memory addresses of the following expression directly in integer
-instructions (which use ModR/M addressing):</p>
-
-<div class="doc_code">
-<pre>
-Base + [1,2,4,8] * IndexReg + Disp32
-</pre>
-</div>
-
-<p>In order to represent this, LLVM tracks no less than 4 operands for each
-memory operand of this form. This means that the "load" form of '<tt>mov</tt>'
-has the following <tt>MachineOperand</tt>s in this order:</p>
-
-<pre>
-Index: 0 | 1 2 3 4
-Meaning: DestReg, | BaseReg, Scale, IndexReg, Displacement
-OperandTy: VirtReg, | VirtReg, UnsImm, VirtReg, SignExtImm
-</pre>
-
-<p>Stores, and all other instructions, treat the four memory operands in the
-same way and in the same order.</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="x86_names">Instruction naming</a>
-</div>
-
-<div class="doc_text">
-
-<p>An instruction name consists of the base name, a default operand size, and a
-a character per operand with an optional special size. For example:</p>
-
-<p>
-<tt>ADD8rr</tt> -&gt; add, 8-bit register, 8-bit register<br>
-<tt>IMUL16rmi</tt> -&gt; imul, 16-bit register, 16-bit memory, 16-bit immediate<br>
-<tt>IMUL16rmi8</tt> -&gt; imul, 16-bit register, 16-bit memory, 8-bit immediate<br>
-<tt>MOVSX32rm16</tt> -&gt; movsx, 32-bit register, 16-bit memory
-</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="ppc">The PowerPC backend</a>
-</div>
-
-<div class="doc_text">
-<p>The PowerPC code generator lives in the lib/Target/PowerPC directory. The
-code generation is retargetable to several variations or <i>subtargets</i> of
-the PowerPC ISA; including ppc32, ppc64 and altivec.
-</p>
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="ppc_abi">LLVM PowerPC ABI</a>
-</div>
-
-<div class="doc_text">
-<p>LLVM follows the AIX PowerPC ABI, with two deviations. LLVM uses a PC
-relative (PIC) or static addressing for accessing global values, so no TOC (r2)
-is used. Second, r31 is used as a frame pointer to allow dynamic growth of a
-stack frame. LLVM takes advantage of having no TOC to provide space to save
-the frame pointer in the PowerPC linkage area of the caller frame. Other
-details of PowerPC ABI can be found at <a href=
-"http://developer.apple.com/documentation/DeveloperTools/Conceptual/LowLevelABI/Articles/32bitPowerPC.html"
->PowerPC ABI.</a> Note: This link describes the 32 bit ABI. The
-64 bit ABI is similar except space for GPRs are 8 bytes wide (not 4) and r13 is
-reserved for system use.</p>
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="ppc_frame">Frame Layout</a>
-</div>
-
-<div class="doc_text">
-<p>The size of a PowerPC frame is usually fixed for the duration of a
-function&rsquo;s invocation. Since the frame is fixed size, all references into
-the frame can be accessed via fixed offsets from the stack pointer. The
-exception to this is when dynamic alloca or variable sized arrays are present,
-then a base pointer (r31) is used as a proxy for the stack pointer and stack
-pointer is free to grow or shrink. A base pointer is also used if llvm-gcc is
-not passed the -fomit-frame-pointer flag. The stack pointer is always aligned to
-16 bytes, so that space allocated for altivec vectors will be properly
-aligned.</p>
-<p>An invocation frame is layed out as follows (low memory at top);</p>
-</div>
-
-<div class="doc_text">
-<table class="layout">
- <tr>
- <td>Linkage<br><br></td>
- </tr>
- <tr>
- <td>Parameter area<br><br></td>
- </tr>
- <tr>
- <td>Dynamic area<br><br></td>
- </tr>
- <tr>
- <td>Locals area<br><br></td>
- </tr>
- <tr>
- <td>Saved registers area<br><br></td>
- </tr>
- <tr style="border-style: none hidden none hidden;">
- <td><br></td>
- </tr>
- <tr>
- <td>Previous Frame<br><br></td>
- </tr>
-</table>
-</div>
-
-<div class="doc_text">
-<p>The <i>linkage</i> area is used by a callee to save special registers prior
-to allocating its own frame. Only three entries are relevant to LLVM. The
-first entry is the previous stack pointer (sp), aka link. This allows probing
-tools like gdb or exception handlers to quickly scan the frames in the stack. A
-function epilog can also use the link to pop the frame from the stack. The
-third entry in the linkage area is used to save the return address from the lr
-register. Finally, as mentioned above, the last entry is used to save the
-previous frame pointer (r31.) The entries in the linkage area are the size of a
-GPR, thus the linkage area is 24 bytes long in 32 bit mode and 48 bytes in 64
-bit mode.</p>
-</div>
-
-<div class="doc_text">
-<p>32 bit linkage area</p>
-<table class="layout">
- <tr>
- <td>0</td>
- <td>Saved SP (r1)</td>
- </tr>
- <tr>
- <td>4</td>
- <td>Saved CR</td>
- </tr>
- <tr>
- <td>8</td>
- <td>Saved LR</td>
- </tr>
- <tr>
- <td>12</td>
- <td>Reserved</td>
- </tr>
- <tr>
- <td>16</td>
- <td>Reserved</td>
- </tr>
- <tr>
- <td>20</td>
- <td>Saved FP (r31)</td>
- </tr>
-</table>
-</div>
-
-<div class="doc_text">
-<p>64 bit linkage area</p>
-<table class="layout">
- <tr>
- <td>0</td>
- <td>Saved SP (r1)</td>
- </tr>
- <tr>
- <td>8</td>
- <td>Saved CR</td>
- </tr>
- <tr>
- <td>16</td>
- <td>Saved LR</td>
- </tr>
- <tr>
- <td>24</td>
- <td>Reserved</td>
- </tr>
- <tr>
- <td>32</td>
- <td>Reserved</td>
- </tr>
- <tr>
- <td>40</td>
- <td>Saved FP (r31)</td>
- </tr>
-</table>
-</div>
-
-<div class="doc_text">
-<p>The <i>parameter area</i> is used to store arguments being passed to a callee
-function. Following the PowerPC ABI, the first few arguments are actually
-passed in registers, with the space in the parameter area unused. However, if
-there are not enough registers or the callee is a thunk or vararg function,
-these register arguments can be spilled into the parameter area. Thus, the
-parameter area must be large enough to store all the parameters for the largest
-call sequence made by the caller. The size must also be mimimally large enough
-to spill registers r3-r10. This allows callees blind to the call signature,
-such as thunks and vararg functions, enough space to cache the argument
-registers. Therefore, the parameter area is minimally 32 bytes (64 bytes in 64
-bit mode.) Also note that since the parameter area is a fixed offset from the
-top of the frame, that a callee can access its spilt arguments using fixed
-offsets from the stack pointer (or base pointer.)</p>
-</div>
-
-<div class="doc_text">
-<p>Combining the information about the linkage, parameter areas and alignment. A
-stack frame is minimally 64 bytes in 32 bit mode and 128 bytes in 64 bit
-mode.</p>
-</div>
-
-<div class="doc_text">
-<p>The <i>dynamic area</i> starts out as size zero. If a function uses dynamic
-alloca then space is added to the stack, the linkage and parameter areas are
-shifted to top of stack, and the new space is available immediately below the
-linkage and parameter areas. The cost of shifting the linkage and parameter
-areas is minor since only the link value needs to be copied. The link value can
-be easily fetched by adding the original frame size to the base pointer. Note
-that allocations in the dynamic space need to observe 16 byte aligment.</p>
-</div>
-
-<div class="doc_text">
-<p>The <i>locals area</i> is where the llvm compiler reserves space for local
-variables.</p>
-</div>
-
-<div class="doc_text">
-<p>The <i>saved registers area</i> is where the llvm compiler spills callee saved
-registers on entry to the callee.</p>
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="ppc_prolog">Prolog/Epilog</a>
-</div>
-
-<div class="doc_text">
-<p>The llvm prolog and epilog are the same as described in the PowerPC ABI, with
-the following exceptions. Callee saved registers are spilled after the frame is
-created. This allows the llvm epilog/prolog support to be common with other
-targets. The base pointer callee saved register r31 is saved in the TOC slot of
-linkage area. This simplifies allocation of space for the base pointer and
-makes it convenient to locate programatically and during debugging.</p>
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="ppc_dynamic">Dynamic Allocation</a>
-</div>
-
-<div class="doc_text">
-<p></p>
-</div>
-
-<div class="doc_text">
-<p><i>TODO - More to come.</i></p>
-</div>
-
-
-<!-- *********************************************************************** -->
-<hr>
-<address>
- <a href="http://jigsaw.w3.org/css-validator/check/referer"><img
- src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"></a>
- <a href="http://validator.w3.org/check/referer"><img
- src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!" /></a>
-
- <a href="mailto:sabre@nondot.org">Chris Lattner</a><br>
- <a href="http://llvm.org">The LLVM Compiler Infrastructure</a><br>
- Last modified: $Date$
-</address>
-
-</body>
-</html>
diff --git a/release_23/docs/CodingStandards.html b/release_23/docs/CodingStandards.html
deleted file mode 100644
index 3a7f8b3d1e9a..000000000000
--- a/release_23/docs/CodingStandards.html
+++ /dev/null
@@ -1,767 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
- "http://www.w3.org/TR/html4/strict.dtd">
-<html>
-<head>
- <link rel="stylesheet" href="llvm.css" type="text/css">
- <title>A Few Coding Standards</title>
-</head>
-<body>
-
-<div class="doc_title">
- A Few Coding Standards
-</div>
-
-<ol>
- <li><a href="#introduction">Introduction</a></li>
- <li><a href="#mechanicalissues">Mechanical Source Issues</a>
- <ol>
- <li><a href="#sourceformating">Source Code Formatting</a>
- <ol>
- <li><a href="#scf_commenting">Commenting</a></li>
- <li><a href="#scf_commentformat">Comment Formatting</a></li>
- <li><a href="#scf_includes"><tt>#include</tt> Style</a></li>
- <li><a href="#scf_codewidth">Source Code Width</a></li>
- <li><a href="#scf_spacestabs">Use Spaces Instead of Tabs</a></li>
- <li><a href="#scf_indentation">Indent Code Consistently</a></li>
- </ol></li>
- <li><a href="#compilerissues">Compiler Issues</a>
- <ol>
- <li><a href="#ci_warningerrors">Treat Compiler Warnings Like
- Errors</a></li>
- <li><a href="#ci_portable_code">Write Portable Code</a></li>
- <li><a href="#ci_class_struct">Use of class/struct Keywords</a></li>
- </ol></li>
- </ol></li>
- <li><a href="#styleissues">Style Issues</a>
- <ol>
- <li><a href="#macro">The High Level Issues</a>
- <ol>
- <li><a href="#hl_module">A Public Header File <b>is</b> a
- Module</a></li>
- <li><a href="#hl_dontinclude">#include as Little as Possible</a></li>
- <li><a href="#hl_privateheaders">Keep "internal" Headers
- Private</a></li>
- <li><a href="#ll_iostream"><tt>#include &lt;iostream&gt;</tt> is
- <em>forbidden</em></a></li>
- </ol></li>
- <li><a href="#micro">The Low Level Issues</a>
- <ol>
- <li><a href="#ll_assert">Assert Liberally</a></li>
- <li><a href="#ll_ns_std">Do not use 'using namespace std'</a></li>
- <li><a href="#ll_virtual_anch">Provide a virtual method anchor for
- classes in headers</a></li>
- <li><a href="#ll_preincrement">Prefer Preincrement</a></li>
- <li><a href="#ll_avoidendl">Avoid <tt>std::endl</tt></a></li>
- </ol></li>
- </ol></li>
- <li><a href="#seealso">See Also</a></li>
-</ol>
-
-<div class="doc_author">
- <p>Written by <a href="mailto:sabre@nondot.org">Chris Lattner</a> and
- <a href="mailto:void@nondot.org">Bill Wendling</a></p>
-</div>
-
-
-<!-- *********************************************************************** -->
-<div class="doc_section">
- <a name="introduction">Introduction</a>
-</div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>This document attempts to describe a few coding standards that are being used
-in the LLVM source tree. Although no coding standards should be regarded as
-absolute requirements to be followed in all instances, coding standards can be
-useful.</p>
-
-<p>This document intentionally does not prescribe fixed standards for religious
-issues such as brace placement and space usage. For issues like this, follow
-the golden rule:</p>
-
-<blockquote>
-
-<p><b><a name="goldenrule">If you are adding a significant body of source to a
-project, feel free to use whatever style you are most comfortable with. If you
-are extending, enhancing, or bug fixing already implemented code, use the style
-that is already being used so that the source is uniform and easy to
-follow.</a></b></p>
-
-</blockquote>
-
-<p>The ultimate goal of these guidelines is the increase readability and
-maintainability of our common source base. If you have suggestions for topics to
-be included, please mail them to <a
-href="mailto:sabre@nondot.org">Chris</a>.</p>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section">
- <a name="mechanicalissues">Mechanical Source Issues</a>
-</div>
-<!-- *********************************************************************** -->
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="sourceformating">Source Code Formatting</a>
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="scf_commenting">Commenting</a>
-</div>
-
-<div class="doc_text">
-
-<p>Comments are one critical part of readability and maintainability. Everyone
-knows they should comment, so should you. Although we all should probably
-comment our code more than we do, there are a few very critical places that
-documentation is very useful:</p>
-
-<b>File Headers</b>
-
-<p>Every source file should have a header on it that describes the basic
-purpose of the file. If a file does not have a header, it should not be
-checked into Subversion. Most source trees will probably have a standard
-file header format. The standard format for the LLVM source tree looks like
-this:</p>
-
-<div class="doc_code">
-<pre>
-//===-- llvm/Instruction.h - Instruction class definition -------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains the declaration of the Instruction class, which is the
-// base class for all of the VM instructions.
-//
-//===----------------------------------------------------------------------===//
-</pre>
-</div>
-
-<p>A few things to note about this particular format: The "<tt>-*- C++
--*-</tt>" string on the first line is there to tell Emacs that the source file
-is a C++ file, not a C file (Emacs assumes .h files are C files by default).
-Note that this tag is not necessary in .cpp files. The name of the file is also
-on the first line, along with a very short description of the purpose of the
-file. This is important when printing out code and flipping though lots of
-pages.</p>
-
-<p>The next section in the file is a concise note that defines the license
-that the file is released under. This makes it perfectly clear what terms the
-source code can be distributed under and should not be modified in any way.</p>
-
-<p>The main body of the description does not have to be very long in most cases.
-Here it's only two lines. If an algorithm is being implemented or something
-tricky is going on, a reference to the paper where it is published should be
-included, as well as any notes or "gotchas" in the code to watch out for.</p>
-
-<b>Class overviews</b>
-
-<p>Classes are one fundamental part of a good object oriented design. As such,
-a class definition should have a comment block that explains what the class is
-used for... if it's not obvious. If it's so completely obvious your grandma
-could figure it out, it's probably safe to leave it out. Naming classes
-something sane goes a long ways towards avoiding writing documentation.</p>
-
-
-<b>Method information</b>
-
-<p>Methods defined in a class (as well as any global functions) should also be
-documented properly. A quick note about what it does any a description of the
-borderline behaviour is all that is necessary here (unless something
-particularly tricky or insideous is going on). The hope is that people can
-figure out how to use your interfaces without reading the code itself... that is
-the goal metric.</p>
-
-<p>Good things to talk about here are what happens when something unexpected
-happens: does the method return null? Abort? Format your hard disk?</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="scf_commentformat">Comment Formatting</a>
-</div>
-
-<div class="doc_text">
-
-<p>In general, prefer C++ style (<tt>//</tt>) comments. They take less space,
-require less typing, don't have nesting problems, etc. There are a few cases
-when it is useful to use C style (<tt>/* */</tt>) comments however:</p>
-
-<ol>
- <li>When writing a C code: Obviously if you are writing C code, use C style
- comments.</li>
- <li>When writing a header file that may be <tt>#include</tt>d by a C source
- file.</li>
- <li>When writing a source file that is used by a tool that only accepts C
- style comments.</li>
-</ol>
-
-<p>To comment out a large block of code, use <tt>#if 0</tt> and <tt>#endif</tt>.
-These nest properly and are better behaved in general than C style comments.</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="scf_includes"><tt>#include</tt> Style</a>
-</div>
-
-<div class="doc_text">
-
-<p>Immediately after the <a href="#scf_commenting">header file comment</a> (and
-include guards if working on a header file), the <a
-href="#hl_dontinclude">minimal</a> list of <tt>#include</tt>s required by the
-file should be listed. We prefer these <tt>#include</tt>s to be listed in this
-order:</p>
-
-<ol>
- <li><a href="#mmheader">Main Module header</a></li>
- <li><a href="#hl_privateheaders">Local/Private Headers</a></li>
- <li><tt>llvm/*</tt></li>
- <li><tt>llvm/Analysis/*</tt></li>
- <li><tt>llvm/Assembly/*</tt></li>
- <li><tt>llvm/Bytecode/*</tt></li>
- <li><tt>llvm/CodeGen/*</tt></li>
- <li>...</li>
- <li><tt>Support/*</tt></li>
- <li><tt>Config/*</tt></li>
- <li>System <tt>#includes</tt></li>
-</ol>
-
-<p>... and each catagory should be sorted by name.</p>
-
-<p><a name="mmheader">The "Main Module Header"</a> file applies to .cpp file
-which implement an interface defined by a .h file. This <tt>#include</tt>
-should always be included <b>first</b> regardless of where it lives on the file
-system. By including a header file first in the .cpp files that implement the
-interfaces, we ensure that the header does not have any hidden dependencies
-which are not explicitly #included in the header, but should be. It is also a
-form of documentation in the .cpp file to indicate where the interfaces it
-implements are defined.</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="scf_codewidth">Source Code Width</a>
-</div>
-
-<div class="doc_text">
-
-<p>Write your code to fit within 80 columns of text. This helps those of us who
-like to print out code and look at your code in an xterm without resizing
-it.</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="scf_spacestabs">Use Spaces Instead of Tabs</a>
-</div>
-
-<div class="doc_text">
-
-<p>In all cases, prefer spaces to tabs in source files. People have different
-prefered indentation levels, and different styles of indentation that they
-like... this is fine. What isn't is that different editors/viewers expand tabs
-out to different tab stops. This can cause your code to look completely
-unreadable, and it is not worth dealing with.</p>
-
-<p>As always, follow the <a href="#goldenrule">Golden Rule</a> above: follow the
-style of existing code if your are modifying and extending it. If you like four
-spaces of indentation, <b>DO NOT</b> do that in the middle of a chunk of code
-with two spaces of indentation. Also, do not reindent a whole source file: it
-makes for incredible diffs that are absolutely worthless.</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="scf_indentation">Indent Code Consistently</a>
-</div>
-
-<div class="doc_text">
-
-<p>Okay, your first year of programming you were told that indentation is
-important. If you didn't believe and internalize this then, now is the time.
-Just do it.</p>
-
-</div>
-
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="compilerissues">Compiler Issues</a>
-</div>
-
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="ci_warningerrors">Treat Compiler Warnings Like Errors</a>
-</div>
-
-<div class="doc_text">
-
-<p>If your code has compiler warnings in it, something is wrong: you aren't
-casting values correctly, your have "questionable" constructs in your code, or
-you are doing something legitimately wrong. Compiler warnings can cover up
-legitimate errors in output and make dealing with a translation unit
-difficult.</p>
-
-<p>It is not possible to prevent all warnings from all compilers, nor is it
-desirable. Instead, pick a standard compiler (like <tt>gcc</tt>) that provides
-a good thorough set of warnings, and stick to them. At least in the case of
-<tt>gcc</tt>, it is possible to work around any spurious errors by changing the
-syntax of the code slightly. For example, an warning that annoys me occurs when
-I write code like this:</p>
-
-<div class="doc_code">
-<pre>
-if (V = getValue()) {
- ...
-}
-</pre>
-</div>
-
-<p><tt>gcc</tt> will warn me that I probably want to use the <tt>==</tt>
-operator, and that I probably mistyped it. In most cases, I haven't, and I
-really don't want the spurious errors. To fix this particular problem, I
-rewrite the code like this:</p>
-
-<div class="doc_code">
-<pre>
-if ((V = getValue())) {
- ...
-}
-</pre>
-</div>
-
-<p>...which shuts <tt>gcc</tt> up. Any <tt>gcc</tt> warning that annoys you can
-be fixed by massaging the code appropriately.</p>
-
-<p>These are the <tt>gcc</tt> warnings that I prefer to enable: <tt>-Wall
--Winline -W -Wwrite-strings -Wno-unused</tt></p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="ci_portable_code">Write Portable Code</a>
-</div>
-
-<div class="doc_text">
-
-<p>In almost all cases, it is possible and within reason to write completely
-portable code. If there are cases where it isn't possible to write portable
-code, isolate it behind a well defined (and well documented) interface.</p>
-
-<p>In practice, this means that you shouldn't assume much about the host
-compiler, including its support for "high tech" features like partial
-specialization of templates. In fact, Visual C++ 6 could be an important target
-for our work in the future, and we don't want to have to rewrite all of our code
-to support it.</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
-<a name="ci_class_struct">Use of <tt>class</tt> and <tt>struct</tt> Keywords</a>
-</div>
-<div class="doc_text">
-
-<p>In C++, the <tt>class</tt> and <tt>struct</tt> keywords can be used almost
-interchangeably. The only difference is when they are used to declare a class:
-<tt>class</tt> makes all members private by default while <tt>struct</tt> makes
-all members public by default.</p>
-
-<p>Unfortunately, not all compilers follow the rules and some will generate
-different symbols based on whether <tt>class</tt> or <tt>struct</tt> was used to
-declare the symbol. This can lead to problems at link time.</p>
-
-<p>So, the rule for LLVM is to always use the <tt>class</tt> keyword, unless
-<b>all</b> members are public, in which case <tt>struct</tt> is allowed.</p>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section">
- <a name="styleissues">Style Issues</a>
-</div>
-<!-- *********************************************************************** -->
-
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="macro">The High Level Issues</a>
-</div>
-
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="hl_module">A Public Header File <b>is</b> a Module</a>
-</div>
-
-<div class="doc_text">
-
-<p>C++ doesn't do too well in the modularity department. There is no real
-encapsulation or data hiding (unless you use expensive protocol classes), but it
-is what we have to work with. When you write a public header file (in the LLVM
-source tree, they live in the top level "include" directory), you are defining a
-module of functionality.</p>
-
-<p>Ideally, modules should be completely independent of each other, and their
-header files should only include the absolute minimum number of headers
-possible. A module is not just a class, a function, or a namespace: <a
-href="http://www.cuj.com/articles/2000/0002/0002c/0002c.htm">it's a collection
-of these</a> that defines an interface. This interface may be several
-functions, classes or data structures, but the important issue is how they work
-together.</p>
-
-<p>In general, a module should be implemented with one or more <tt>.cpp</tt>
-files. Each of these <tt>.cpp</tt> files should include the header that defines
-their interface first. This ensure that all of the dependences of the module
-header have been properly added to the module header itself, and are not
-implicit. System headers should be included after user headers for a
-translation unit.</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="hl_dontinclude"><tt>#include</tt> as Little as Possible</a>
-</div>
-
-<div class="doc_text">
-
-<p><tt>#include</tt> hurts compile time performance. Don't do it unless you
-have to, especially in header files.</p>
-
-<p>But wait, sometimes you need to have the definition of a class to use it, or
-to inherit from it. In these cases go ahead and <tt>#include</tt> that header
-file. Be aware however that there are many cases where you don't need to have
-the full definition of a class. If you are using a pointer or reference to a
-class, you don't need the header file. If you are simply returning a class
-instance from a prototyped function or method, you don't need it. In fact, for
-most cases, you simply don't need the definition of a class... and not
-<tt>#include</tt>'ing speeds up compilation.</p>
-
-<p>It is easy to try to go too overboard on this recommendation, however. You
-<b>must</b> include all of the header files that you are using -- you can
-include them either directly
-or indirectly (through another header file). To make sure that you don't
-accidently forget to include a header file in your module header, make sure to
-include your module header <b>first</b> in the implementation file (as mentioned
-above). This way there won't be any hidden dependencies that you'll find out
-about later...</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="hl_privateheaders">Keep "internal" Headers Private</a>
-</div>
-
-<div class="doc_text">
-
-<p>Many modules have a complex implementation that causes them to use more than
-one implementation (<tt>.cpp</tt>) file. It is often tempting to put the
-internal communication interface (helper classes, extra functions, etc) in the
-public module header file. Don't do this.</p>
-
-<p>If you really need to do something like this, put a private header file in
-the same directory as the source files, and include it locally. This ensures
-that your private interface remains private and undisturbed by outsiders.</p>
-
-<p>Note however, that it's okay to put extra implementation methods a public
-class itself... just make them private (or protected), and all is well.</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="ll_iostream"><tt>#include &lt;iostream&gt;</tt> is forbidden</a>
-</div>
-
-<div class="doc_text">
-
-<p>The use of <tt>#include &lt;iostream&gt;</tt> in library files is
-hereby <b><em>forbidden</em></b>. The primary reason for doing this is to
-support clients using LLVM libraries as part of larger systems. In particular,
-we statically link LLVM into some dynamic libraries. Even if LLVM isn't used,
-the static c'tors are run whenever an application start up that uses the dynamic
-library. There are two problems with this:</p>
-
-<ol>
- <li>The time to run the static c'tors impacts startup time of
- applications&mdash;a critical time for GUI apps.</li>
- <li>The static c'tors cause the app to pull many extra pages of memory off the
- disk: both the code for the static c'tors in each <tt>.o</tt> file and the
- small amount of data that gets touched. In addition, touched/dirty pages
- put more pressure on the VM system on low-memory machines.</li>
-</ol>
-
-<div align="center">
-<table>
- <tbody>
- <tr>
- <th>Old Way</th>
- <th>New Way</th>
- </tr>
- <tr>
- <td align="left"><pre>#include &lt;iostream&gt;</pre></td>
- <td align="left"><pre>#include "llvm/Support/Streams.h"</pre></td>
- </tr>
- <tr>
- <td align="left"><pre>DEBUG(std::cerr &lt;&lt; ...);
-DEBUG(dump(std::cerr));</pre></td>
- <td align="left"><pre>DOUT &lt;&lt; ...;
-DEBUG(dump(DOUT));</pre></td>
- </tr>
- <tr>
- <td align="left"><pre>std::cerr &lt;&lt; "Hello world\n";</pre></td>
- <td align="left"><pre>llvm::cerr &lt;&lt; "Hello world\n";</pre></td>
- </tr>
- <tr>
- <td align="left"><pre>std::cout &lt;&lt; "Hello world\n";</pre></td>
- <td align="left"><pre>llvm::cout &lt;&lt; "Hello world\n";</pre></td>
- </tr>
- <tr>
- <td align="left"><pre>std::cin &gt;&gt; Var;</pre></td>
- <td align="left"><pre>llvm::cin &gt;&gt; Var;</pre></td>
- </tr>
- <tr>
- <td align="left"><pre>std::ostream</pre></td>
- <td align="left"><pre>llvm::OStream</pre></td>
- </tr>
- <tr>
- <td align="left"><pre>std::istream</pre></td>
- <td align="left"><pre>llvm::IStream</pre></td>
- </tr>
- <tr>
- <td align="left"><pre>std::stringstream</pre></td>
- <td align="left"><pre>llvm::StringStream</pre></td>
- </tr>
- <tr>
- <td align="left"><pre>void print(std::ostream &amp;Out);
-// ...
-print(std::cerr);</pre></td>
- <td align="left"><pre>void print(llvm::OStream Out);<sup>1</sup>
-// ...
-print(llvm::cerr);</pre>
-
-</td> </tbody> </table>
-</div>
-
-<div class="doc_text">
-<p><sup>1</sup><tt>llvm::OStream</tt> is a light-weight class so it should never
-be passed by reference. This is important because in some configurations,
-<tt>DOUT</tt> is an rvalue.</p>
-</div>
-
-</div>
-
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="micro">The Low Level Issues</a>
-</div>
-
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="ll_assert">Assert Liberally</a>
-</div>
-
-<div class="doc_text">
-
-<p>Use the "<tt>assert</tt>" function to its fullest. Check all of your
-preconditions and assumptions, you never know when a bug (not neccesarily even
-yours) might be caught early by an assertion, which reduces debugging time
-dramatically. The "<tt>&lt;cassert&gt;</tt>" header file is probably already
-included by the header files you are using, so it doesn't cost anything to use
-it.</p>
-
-<p>To further assist with debugging, make sure to put some kind of error message
-in the assertion statement (which is printed if the assertion is tripped). This
-helps the poor debugging make sense of why an assertion is being made and
-enforced, and hopefully what to do about it. Here is one complete example:</p>
-
-<div class="doc_code">
-<pre>
-inline Value *getOperand(unsigned i) {
- assert(i &lt; Operands.size() &amp;&amp; "getOperand() out of range!");
- return Operands[i];
-}
-</pre>
-</div>
-
-<p>Here are some examples:</p>
-
-<div class="doc_code">
-<pre>
-assert(Ty-&gt;isPointerType() &amp;&amp; "Can't allocate a non pointer type!");
-
-assert((Opcode == Shl || Opcode == Shr) &amp;&amp; "ShiftInst Opcode invalid!");
-
-assert(idx &lt; getNumSuccessors() &amp;&amp; "Successor # out of range!");
-
-assert(V1.getType() == V2.getType() &amp;&amp; "Constant types must be identical!");
-
-assert(isa&lt;PHINode&gt;(Succ-&gt;front()) &amp;&amp; "Only works on PHId BBs!");
-</pre>
-</div>
-
-<p>You get the idea...</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="ll_ns_std">Do not use '<tt>using namespace std</tt>'</a>
-</div>
-
-<div class="doc_text">
-<p>In LLVM, we prefer to explicitly prefix all identifiers from the standard
-namespace with an "<tt>std::</tt>" prefix, rather than rely on
-"<tt>using namespace std;</tt>".</p>
-
-<p> In header files, adding a '<tt>using namespace XXX</tt>' directive pollutes
-the namespace of any source file that includes the header. This is clearly a
-bad thing.</p>
-
-<p>In implementation files (e.g. .cpp files), the rule is more of a stylistic
-rule, but is still important. Basically, using explicit namespace prefixes
-makes the code <b>clearer</b>, because it is immediately obvious what facilities
-are being used and where they are coming from, and <b>more portable</b>, because
-namespace clashes cannot occur between LLVM code and other namespaces. The
-portability rule is important because different standard library implementations
-expose different symbols (potentially ones they shouldn't), and future revisions
-to the C++ standard will add more symbols to the <tt>std</tt> namespace. As
-such, we never use '<tt>using namespace std;</tt>' in LLVM.</p>
-
-<p>The exception to the general rule (i.e. it's not an exception for
-the <tt>std</tt> namespace) is for implementation files. For example, all of
-the code in the LLVM project implements code that lives in the 'llvm' namespace.
-As such, it is ok, and actually clearer, for the .cpp files to have a '<tt>using
-namespace llvm</tt>' directive at their top, after the <tt>#include</tt>s. The
-general form of this rule is that any .cpp file that implements code in any
-namespace may use that namespace (and its parents'), but should not use any
-others.</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="ll_virtual_anch">Provide a virtual method anchor for classes
- in headers</a>
-</div>
-
-<div class="doc_text">
-
-<p>If a class is defined in a header file and has a v-table (either it has
-virtual methods or it derives from classes with virtual methods), it must
-always have at least one out-of-line virtual method in the class. Without
-this, the compiler will copy the vtable and RTTI into every .o file that
-#includes the header, bloating .o file sizes and increasing link times.
-</p>
-
-</div>
-
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="ll_preincrement">Prefer Preincrement</a>
-</div>
-
-<div class="doc_text">
-
-<p>Hard fast rule: Preincrement (<tt>++X</tt>) may be no slower than
-postincrement (<tt>X++</tt>) and could very well be a lot faster than it. Use
-preincrementation whenever possible.</p>
-
-<p>The semantics of postincrement include making a copy of the value being
-incremented, returning it, and then preincrementing the "work value". For
-primitive types, this isn't a big deal... but for iterators, it can be a huge
-issue (for example, some iterators contains stack and set objects in them...
-copying an iterator could invoke the copy ctor's of these as well). In general,
-get in the habit of always using preincrement, and you won't have a problem.</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="ll_avoidendl">Avoid <tt>std::endl</tt></a>
-</div>
-
-<div class="doc_text">
-
-<p>The <tt>std::endl</tt> modifier, when used with iostreams outputs a newline
-to the output stream specified. In addition to doing this, however, it also
-flushes the output stream. In other words, these are equivalent:</p>
-
-<div class="doc_code">
-<pre>
-std::cout &lt;&lt; std::endl;
-std::cout &lt;&lt; '\n' &lt;&lt; std::flush;
-</pre>
-</div>
-
-<p>Most of the time, you probably have no reason to flush the output stream, so
-it's better to use a literal <tt>'\n'</tt>.</p>
-
-</div>
-
-
-<!-- *********************************************************************** -->
-<div class="doc_section">
- <a name="seealso">See Also</a>
-</div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>A lot of these comments and recommendations have been culled for other
-sources. Two particularly important books for our work are:</p>
-
-<ol>
-
-<li><a href="http://www.amazon.com/Effective-Specific-Addison-Wesley-Professional-Computing/dp/0321334876">Effective
-C++</a> by Scott Meyers. Also
-interesting and useful are "More Effective C++" and "Effective STL" by the same
-author.</li>
-
-<li>Large-Scale C++ Software Design by John Lakos</li>
-
-</ol>
-
-<p>If you get some free time, and you haven't read them: do so, you might learn
-something.</p>
-
-</div>
-
-<!-- *********************************************************************** -->
-
-<hr>
-<address>
- <a href="http://jigsaw.w3.org/css-validator/check/referer"><img
- src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"></a>
- <a href="http://validator.w3.org/check/referer"><img
- src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!"></a>
-
- <a href="mailto:sabre@nondot.org">Chris Lattner</a><br>
- <a href="http://llvm.org">LLVM Compiler Infrastructure</a><br>
- Last modified: $Date$
-</address>
-
-</body>
-</html>
diff --git a/release_23/docs/CommandGuide/Makefile b/release_23/docs/CommandGuide/Makefile
deleted file mode 100644
index cf77e6a33db0..000000000000
--- a/release_23/docs/CommandGuide/Makefile
+++ /dev/null
@@ -1,97 +0,0 @@
-##===- docs/CommandGuide/Makefile --------------------------*- Makefile -*-===##
-#
-# The LLVM Compiler Infrastructure
-#
-# This file is distributed under the University of Illinois Open Source
-# License. See LICENSE.TXT for details.
-#
-##===----------------------------------------------------------------------===##
-
-ifdef BUILD_FOR_WEBSITE
-# This special case is for keeping the CommandGuide on the LLVM web site
-# up to date automatically as the documents are checked in. It must build
-# the POD files to HTML only and keep them in the src directories. It must also
-# build in an unconfigured tree, hence the ifdef. To use this, run
-# make -s BUILD_FOR_WEBSITE=1 inside the cvs commit script.
-SRC_DOC_DIR=
-DST_HTML_DIR=html/
-DST_MAN_DIR=man/man1/
-DST_PS_DIR=ps/
-
-# If we are in BUILD_FOR_WEBSITE mode, default to the all target.
-all:: html man ps
-
-clean:
- rm -f pod2htm*.*~~ $(HTML) $(MAN) $(PS)
-
-# To create other directories, as needed, and timestamp their creation
-%/.dir:
- -mkdir $* > /dev/null
- date > $@
-
-else
-
-# Otherwise, if not in BUILD_FOR_WEBSITE mode, use the project info.
-LEVEL := ../..
-include $(LEVEL)/Makefile.common
-
-SRC_DOC_DIR=$(PROJ_SRC_DIR)/
-DST_HTML_DIR=$(PROJ_OBJ_DIR)/
-DST_MAN_DIR=$(PROJ_OBJ_DIR)/
-DST_PS_DIR=$(PROJ_OBJ_DIR)/
-
-endif
-
-
-POD := $(wildcard $(SRC_DOC_DIR)*.pod)
-HTML := $(patsubst $(SRC_DOC_DIR)%.pod, $(DST_HTML_DIR)%.html, $(POD))
-MAN := $(patsubst $(SRC_DOC_DIR)%.pod, $(DST_MAN_DIR)%.1, $(POD))
-PS := $(patsubst $(SRC_DOC_DIR)%.pod, $(DST_PS_DIR)%.ps, $(POD))
-
-.SUFFIXES:
-.SUFFIXES: .html .pod .1 .ps
-
-$(DST_HTML_DIR)%.html: %.pod $(DST_HTML_DIR)/.dir
- pod2html --css=manpage.css --htmlroot=. \
- --podpath=. --noindex --infile=$< --outfile=$@ --title=$*
-
-$(DST_MAN_DIR)%.1: %.pod $(DST_MAN_DIR)/.dir
- pod2man --release=CVS --center="LLVM Command Guide" $< $@
-
-$(DST_PS_DIR)%.ps: $(DST_MAN_DIR)%.1 $(DST_PS_DIR)/.dir
- groff -Tps -man $< > $@
-
-
-html: $(HTML)
-man: $(MAN)
-ps: $(PS)
-
-EXTRA_DIST := $(POD) index.html
-
-clean-local::
- $(Verb) $(RM) -f pod2htm*.*~~ $(HTML) $(MAN) $(PS)
-
-HTML_DIR := $(PROJ_docsdir)/html/CommandGuide
-MAN_DIR := $(PROJ_mandir)/man1
-PS_DIR := $(PROJ_docsdir)/ps
-
-install-local:: $(HTML) $(MAN) $(PS)
- $(Echo) Installing HTML CommandGuide Documentation
- $(Verb) $(MKDIR) $(HTML_DIR)
- $(Verb) $(DataInstall) $(HTML) $(HTML_DIR)
- $(Verb) $(DataInstall) $(PROJ_SRC_DIR)/index.html $(HTML_DIR)
- $(Verb) $(DataInstall) $(PROJ_SRC_DIR)/manpage.css $(HTML_DIR)
- $(Echo) Installing MAN CommandGuide Documentation
- $(Verb) $(MKDIR) $(MAN_DIR)
- $(Verb) $(DataInstall) $(MAN) $(MAN_DIR)
- $(Echo) Installing PS CommandGuide Documentation
- $(Verb) $(MKDIR) $(PS_DIR)
- $(Verb) $(DataInstall) $(PS) $(PS_DIR)
-
-uninstall-local::
- $(Echo) Uninstalling CommandGuide Documentation
- $(Verb) $(RM) -rf $(HTML_DIR) $(MAN_DIR) $(PS_DIR)
-
-printvars::
- $(Echo) "POD : " '$(POD)'
- $(Echo) "HTML : " '$(HTML)'
diff --git a/release_23/docs/CommandGuide/bugpoint.pod b/release_23/docs/CommandGuide/bugpoint.pod
deleted file mode 100644
index 12e32fbb2f5c..000000000000
--- a/release_23/docs/CommandGuide/bugpoint.pod
+++ /dev/null
@@ -1,134 +0,0 @@
-=pod
-
-=head1 NAME
-
-bugpoint - automatic test case reduction tool
-
-=head1 SYNOPSIS
-
-B<bugpoint> [I<options>] [I<input LLVM ll/bc files>] [I<LLVM passes>] B<--args>
-I<program arguments>
-
-=head1 DESCRIPTION
-
-B<bugpoint> narrows down the source of problems in LLVM tools and passes. It
-can be used to debug three types of failures: optimizer crashes, miscompilations
-by optimizers, or bad native code generation (including problems in the static
-and JIT compilers). It aims to reduce large test cases to small, useful ones.
-For more information on the design and inner workings of B<bugpoint>, as well as
-advice for using bugpoint, see F<llvm/docs/Bugpoint.html> in the LLVM
-distribution.
-
-=head1 OPTIONS
-
-=over
-
-=item B<--additional-so> F<library>
-
-Load the dynamic shared object F<library> into the test program whenever it is
-run. This is useful if you are debugging programs which depend on non-LLVM
-libraries (such as the X or curses libraries) to run.
-
-=item B<--args> I<program args>
-
-Pass all arguments specified after -args to the test program whenever it runs.
-Note that if any of the I<program args> start with a '-', you should use:
-
- bugpoint [bugpoint args] --args -- [program args]
-
-The "--" right after the B<--args> option tells B<bugpoint> to consider any
-options starting with C<-> to be part of the B<--args> option, not as options to
-B<bugpoint> itself.
-
-=item B<--tool-args> I<tool args>
-
-Pass all arguments specified after --tool-args to the LLVM tool under test
-(B<llc>, B<lli>, etc.) whenever it runs. You should use this option in the
-following way:
-
- bugpoint [bugpoint args] --tool-args -- [tool args]
-
-The "--" right after the B<--tool-args> option tells B<bugpoint> to consider any
-options starting with C<-> to be part of the B<--tool-args> option, not as
-options to B<bugpoint> itself. (See B<--args>, above.)
-
-=item B<--check-exit-code>=I<{true,false}>
-
-Assume a non-zero exit code or core dump from the test program is a failure.
-Defaults to true.
-
-=item B<--disable-{dce,simplifycfg}>
-
-Do not run the specified passes to clean up and reduce the size of the test
-program. By default, B<bugpoint> uses these passes internally when attempting to
-reduce test programs. If you're trying to find a bug in one of these passes,
-B<bugpoint> may crash.
-
-=item B<--enable-valgrind>
-
-Use valgrind to find faults in the optimization phase. This will allow
-bugpoint to find otherwise asymptomatic problems caused by memory
-mis-management.
-
-=item B<-find-bugs>
-
-Continually randomize the specified passes and run them on the test program
-until a bug is found or the user kills B<bugpoint>.
-
-=item B<--help>
-
-Print a summary of command line options.
-
-=item B<--input> F<filename>
-
-Open F<filename> and redirect the standard input of the test program, whenever
-it runs, to come from that file.
-
-=item B<--load> F<plugin>
-
-Load the dynamic object F<plugin> into B<bugpoint> itself. This object should
-register new optimization passes. Once loaded, the object will add new command
-line options to enable various optimizations. To see the new complete list of
-optimizations, use the B<--help> and B<--load> options together; for example:
-
- bugpoint --load myNewPass.so --help
-
-=item B<--mlimit> F<megabytes>
-
-Specifies an upper limit on memory usage of the optimization and codegen. Set
-to zero to disable the limit.
-
-=item B<--output> F<filename>
-
-Whenever the test program produces output on its standard output stream, it
-should match the contents of F<filename> (the "reference output"). If you
-do not use this option, B<bugpoint> will attempt to generate a reference output
-by compiling the program with the C backend and running it.
-
-=item B<--profile-info-file> F<filename>
-
-Profile file loaded by B<--profile-loader>.
-
-=item B<--run-{int,jit,llc,cbe}>
-
-Whenever the test program is compiled, B<bugpoint> should generate code for it
-using the specified code generator. These options allow you to choose the
-interpreter, the JIT compiler, the static native code compiler, or the C
-backend, respectively.
-
-=back
-
-=head1 EXIT STATUS
-
-If B<bugpoint> succeeds in finding a problem, it will exit with 0. Otherwise,
-if an error occurs, it will exit with a non-zero value.
-
-=head1 SEE ALSO
-
-L<opt|opt>
-
-=head1 AUTHOR
-
-Maintained by the LLVM Team (L<http://llvm.org>).
-
-=cut
diff --git a/release_23/docs/CommandGuide/html/manpage.css b/release_23/docs/CommandGuide/html/manpage.css
deleted file mode 100644
index b2003434901d..000000000000
--- a/release_23/docs/CommandGuide/html/manpage.css
+++ /dev/null
@@ -1,256 +0,0 @@
-/* Based on http://www.perldoc.com/css/perldoc.css */
-
-@import url("../llvm.css");
-
-body { font-family: Arial,Helvetica; }
-
-blockquote { margin: 10pt; }
-
-h1, a { color: #336699; }
-
-
-/*** Top menu style ****/
-.mmenuon {
- font-family: Arial,Helvetica; font-weight: bold; text-decoration: none;
- color: #ff6600; font-size: 10pt;
- }
-.mmenuoff {
- font-family: Arial,Helvetica; font-weight: bold; text-decoration: none;
- color: #ffffff; font-size: 10pt;
-}
-.cpyright {
- font-family: Arial,Helvetica; font-weight: bold; text-decoration: none;
- color: #ffffff; font-size: xx-small;
-}
-.cpyrightText {
- font-family: Arial,Helvetica; font-weight: bold; text-decoration: none;
- color: #ffffff; font-size: xx-small;
-}
-.sections {
- font-family: Arial,Helvetica; font-weight: bold; text-decoration: none;
- color: #336699; font-size: 11pt;
-}
-.dsections {
- font-family: Arial,Helvetica; font-weight: bold; text-decoration: none;
- color: #336699; font-size: 12pt;
-}
-.slink {
- font-family: Arial,Helvetica; font-weight: normal; text-decoration: none;
- color: #000000; font-size: 9pt;
-}
-
-.slink2 { font-family: Arial,Helvetica; text-decoration: none; color: #336699; }
-
-.maintitle {
- font-family: Arial,Helvetica; font-weight: bold; text-decoration: none;
- color: #336699; font-size: 18pt;
-}
-.dblArrow {
- font-family: Arial,Helvetica; font-weight: bold; text-decoration: none;
- color: #336699; font-size: small;
-}
-.menuSec {
- font-family: Arial,Helvetica; font-weight: bold; text-decoration: none;
- color: #336699; font-size: small;
-}
-
-.newstext {
- font-family: Arial,Helvetica; font-size: small;
-}
-
-.linkmenu {
- font-family: Arial,Helvetica; color: #000000; font-weight: bold;
- text-decoration: none;
-}
-
-P {
- font-family: Arial,Helvetica;
-}
-
-PRE {
- font-size: 10pt;
-}
-.quote {
- font-family: Times; text-decoration: none;
- color: #000000; font-size: 9pt; font-style: italic;
-}
-.smstd { font-family: Arial,Helvetica; color: #000000; font-size: x-small; }
-.std { font-family: Arial,Helvetica; color: #000000; }
-.meerkatTitle {
- font-family: sans-serif; font-size: x-small; color: black; }
-
-.meerkatDescription { font-family: sans-serif; font-size: 10pt; color: black }
-.meerkatCategory {
- font-family: sans-serif; font-size: 9pt; font-weight: bold; font-style: italic;
- color: brown; }
-.meerkatChannel {
- font-family: sans-serif; font-size: 9pt; font-style: italic; color: brown; }
-.meerkatDate { font-family: sans-serif; font-size: xx-small; color: #336699; }
-
-.tocTitle {
- font-family: Arial,Helvetica; font-weight: bold; text-decoration: none;
- color: #333333; font-size: 10pt;
-}
-
-.toc-item {
- font-family: Arial,Helvetica; font-weight: bold;
- color: #336699; font-size: 10pt; text-decoration: underline;
-}
-
-.perlVersion {
- font-family: Arial,Helvetica; font-weight: bold;
- color: #336699; font-size: 10pt; text-decoration: none;
-}
-
-.podTitle {
- font-family: Arial,Helvetica; font-weight: bold; text-decoration: none;
- color: #000000;
-}
-
-.docTitle {
- font-family: Arial,Helvetica; font-weight: bold; text-decoration: none;
- color: #000000; font-size: 10pt;
-}
-.dotDot {
- font-family: Arial,Helvetica; font-weight: bold;
- color: #000000; font-size: 9pt;
-}
-
-.docSec {
- font-family: Arial,Helvetica; font-weight: normal;
- color: #333333; font-size: 9pt;
-}
-.docVersion {
- font-family: Arial,Helvetica; font-weight: bold; text-decoration: none;
- color: #336699; font-size: 10pt;
-}
-
-.docSecs-on {
- font-family: Arial,Helvetica; font-weight: normal; text-decoration: none;
- color: #ff0000; font-size: 10pt;
-}
-.docSecs-off {
- font-family: Arial,Helvetica; font-weight: normal; text-decoration: none;
- color: #333333; font-size: 10pt;
-}
-
-h2 {
- font-family: Arial,Helvetica; font-weight: bold; text-decoration: none;
- color: #336699; font-size: medium;
-}
-h1 {
- font-family: Verdana,Arial,Helvetica; font-weight: bold; text-decoration: none;
- color: #336699; font-size: large;
-}
-
-DL {
- font-family: Arial,Helvetica; font-weight: normal; text-decoration: none;
- color: #333333; font-size: 10pt;
-}
-
-UL > LI > A {
- font-family: Arial,Helvetica; font-weight: bold;
- color: #336699; font-size: 10pt;
-}
-
-.moduleInfo {
- font-family: Arial,Helvetica; font-weight: bold; text-decoration: none;
- color: #333333; font-size: 11pt;
-}
-
-.moduleInfoSec {
- font-family: Arial,Helvetica; font-weight: bold; text-decoration: none;
- color: #336699; font-size: 10pt;
-}
-
-.moduleInfoVal {
- font-family: Arial,Helvetica; font-weight: normal; text-decoration: underline;
- color: #000000; font-size: 10pt;
-}
-
-.cpanNavTitle {
- font-family: Arial,Helvetica; font-weight: bold;
- color: #ffffff; font-size: 10pt;
-}
-.cpanNavLetter {
- font-family: Arial,Helvetica; font-weight: bold; text-decoration: none;
- color: #333333; font-size: 9pt;
-}
-.cpanCat {
- font-family: Arial,Helvetica; font-weight: bold; text-decoration: none;
- color: #336699; font-size: 9pt;
-}
-
-.bttndrkblue-bkgd-top {
- background-color: #225688;
- background-image: url(/global/mvc_objects/images/bttndrkblue_bgtop.gif);
-}
-.bttndrkblue-bkgd-left {
- background-color: #225688;
- background-image: url(/global/mvc_objects/images/bttndrkblue_bgleft.gif);
-}
-.bttndrkblue-bkgd {
- padding-top: 0px;
- padding-bottom: 0px;
- margin-bottom: 0px;
- margin-top: 0px;
- background-repeat: no-repeat;
- background-color: #225688;
- background-image: url(/global/mvc_objects/images/bttndrkblue_bgmiddle.gif);
- vertical-align: top;
-}
-.bttndrkblue-bkgd-right {
- background-color: #225688;
- background-image: url(/global/mvc_objects/images/bttndrkblue_bgright.gif);
-}
-.bttndrkblue-bkgd-bottom {
- background-color: #225688;
- background-image: url(/global/mvc_objects/images/bttndrkblue_bgbottom.gif);
-}
-.bttndrkblue-text a {
- color: #ffffff;
- text-decoration: none;
-}
-a.bttndrkblue-text:hover {
- color: #ffDD3C;
- text-decoration: none;
-}
-.bg-ltblue {
- background-color: #f0f5fa;
-}
-
-.border-left-b {
- background: #f0f5fa url(/i/corner-leftline.gif) repeat-y;
-}
-
-.border-right-b {
- background: #f0f5fa url(/i/corner-rightline.gif) repeat-y;
-}
-
-.border-top-b {
- background: #f0f5fa url(/i/corner-topline.gif) repeat-x;
-}
-
-.border-bottom-b {
- background: #f0f5fa url(/i/corner-botline.gif) repeat-x;
-}
-
-.border-right-w {
- background: #ffffff url(/i/corner-rightline.gif) repeat-y;
-}
-
-.border-top-w {
- background: #ffffff url(/i/corner-topline.gif) repeat-x;
-}
-
-.border-bottom-w {
- background: #ffffff url(/i/corner-botline.gif) repeat-x;
-}
-
-.bg-white {
- background-color: #ffffff;
-}
-
-.border-left-w {
- background: #ffffff url(/i/corner-leftline.gif) repeat-y;
-}
diff --git a/release_23/docs/CommandGuide/index.html b/release_23/docs/CommandGuide/index.html
deleted file mode 100644
index a411fea68bf4..000000000000
--- a/release_23/docs/CommandGuide/index.html
+++ /dev/null
@@ -1,152 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
- "http://www.w3.org/TR/html4/strict.dtd">
-<html>
-<head>
- <title>LLVM Command Guide</title>
- <link rel="stylesheet" href="/docs/llvm.css" type="text/css">
-</head>
-<body>
-
-<div class="doc_title">
- LLVM Command Guide
-</div>
-
-<div class="doc_text">
-
-<p>These documents are HTML versions of the <a href="man/man1/">man pages</a>
-for all of the LLVM tools. These pages describe how to use the LLVM commands
-and what their options are. Note that these pages do not describe all of the
-options available for all tools. To get a complete listing, pass the
-<tt>--help</tt> (general options) or <tt>--help-hidden</tt> (general+debugging
-options) arguments to the tool you are interested in.</p>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section">
- <a name="basic">Basic Commands</a>
-</div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<ul>
-
-<li><a href="/cmds/llvm-as.html"><b>llvm-as</b></a> -
- assemble a human-readable .ll file into bytecode</li>
-
-<li><a href="/cmds/llvm-dis.html"><b>llvm-dis</b></a> -
- disassemble a bytecode file into a human-readable .ll file</li>
-
-<li><a href="/cmds/opt.html"><b>opt</b></a> -
- run a series of LLVM-to-LLVM optimizations on a bytecode file</li>
-
-<li><a href="/cmds/llc.html"><b>llc</b></a> -
- generate native machine code for a bytecode file</li>
-
-<li><a href="/cmds/lli.html"><b>lli</b></a> -
- directly run a program compiled to bytecode using a JIT compiler or
- interpreter</li>
-
-<li><a href="/cmds/llvm-link.html"><b>llvm-link</b></a> -
- link several bytecode files into one</li>
-
-<li><a href="/cmds/llvm-ar.html"><b>llvm-ar</b></a> -
- archive bytecode files</li>
-
-<li><a href="/cmds/llvm-ranlib.html"><b>llvm-ranlib</b></a> -
- create an index for archives made with llvm-ar</li>
-
-<li><a href="/cmds/llvm-nm.html"><b>llvm-nm</b></a> -
- print out the names and types of symbols in a bytecode file</li>
-
-<li><a href="/cmds/llvm-prof.html"><b>llvm-prof</b></a> -
- format raw `<tt>llvmprof.out</tt>' data into a human-readable report</li>
-
-<li><a href="/cmds/llvm-ld.html"><b>llvm-ld</b></a> -
- general purpose linker with loadable runtime optimization support</li>
-
-<li><a href="/cmds/llvm-config.html"><b>llvm-config</b></a> -
- print out LLVM compilation options, libraries, etc. as configured.</li>
-
-</ul>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section">
- <a name="frontend">C, C++, and Stacker Front-end Commands</a>
-</div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-<ul>
-
-<li><a href="/cmds/llvmgcc.html"><b>llvmgcc</b></a> -
- GCC-based C front-end for LLVM
-
-<li><a href="/cmds/llvmgxx.html"><b>llvmg++</b></a> -
- GCC-based C++ front-end for LLVM</li>
-
-<li><a href="/cmds/stkrc.html"><b>stkrc</b></a> -
- front-end compiler for the <a href="../Stacker.html">Stacker</a>
- language</li>
-
-</ul>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section">
- <a name="debug">Debugging Tools</a>
-</div>
-<!-- *********************************************************************** -->
-
-
-<div class="doc_text">
-
-<ul>
-
-<li><a href="/cmds/bugpoint.html"><b>bugpoint</b></a> -
- automatic test-case reducer</li>
-
-<li><a href="/cmds/llvm-extract.html"><b>llvm-extract</b></a> -
- extract a function from an LLVM bytecode file</li>
-
-<li><a href="/cmds/llvm-bcanalyzer.html"><b>llvm-bcanalyzer</b></a> -
- bytecode analyzer (analyzes the binary encoding itself, not the program it
- represents)</li>
-
-</ul>
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section">
- <a name="internal">Internal Tools</a>
-</div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-<ul>
-
-<li><a href="/cmds/tblgen.html"><b>tblgen</b></a> -
- target description reader and generator</li>
-
-</ul>
-</div>
-
-<!-- *********************************************************************** -->
-
-<hr>
-<address>
- <a href="http://jigsaw.w3.org/css-validator/check/referer"><img
- src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"></a>
- <a href="http://validator.w3.org/check/referer"><img
- src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!"></a>
-
- <a href="http://llvm.org">LLVM Compiler Infrastructure</a><br>
- Last modified: $Date$
-</address>
-
-</body>
-</html>
diff --git a/release_23/docs/CommandGuide/llc.pod b/release_23/docs/CommandGuide/llc.pod
deleted file mode 100644
index f5fd34f01ab5..000000000000
--- a/release_23/docs/CommandGuide/llc.pod
+++ /dev/null
@@ -1,191 +0,0 @@
-=pod
-
-=head1 NAME
-
-llc - LLVM static compiler
-
-=head1 SYNOPSIS
-
-B<llc> [I<options>] [I<filename>]
-
-=head1 DESCRIPTION
-
-The B<llc> command compiles LLVM bitcode into assembly language for a
-specified architecture. The assembly language output can then be passed through
-a native assembler and linker to generate a native executable.
-
-The choice of architecture for the output assembly code is automatically
-determined from the input bitcode file, unless the B<-march> option is used to
-override the default.
-
-=head1 OPTIONS
-
-If I<filename> is - or omitted, B<llc> reads LLVM bitcode from standard input.
-Otherwise, it will read LLVM bitcode from I<filename>.
-
-If the B<-o> option is omitted, then B<llc> will send its output to standard
-output if the input is from standard input. If the B<-o> option specifies -,
-then the output will also be sent to standard output.
-
-If no B<-o> option is specified and an input file other than - is specified,
-then B<llc> creates the output filename by taking the input filename,
-removing any existing F<.bc> extension, and adding a F<.s> suffix.
-
-Other B<llc> options are as follows:
-
-=head2 End-user Options
-
-=over
-
-=item B<--help>
-
-Print a summary of command line options.
-
-=item B<-f>
-
-Overwrite output files. By default, B<llc> will refuse to overwrite
-an output file which already exists.
-
-=item B<-mtriple>=I<target triple>
-
-Override the target triple specified in the input bitcode file with the
-specified string.
-
-=item B<-march>=I<arch>
-
-Specify the architecture for which to generate assembly, overriding the target
-encoded in the bitcode file. See the output of B<llc --help> for a list of
-valid architectures. By default this is inferred from the target triple or
-autodetected to the current architecture.
-
-=item B<-mcpu>=I<cpuname>
-
-Specify a specific chip in the current architecture to generate code for.
-By default this is inferred from the target triple and autodetected to
-the current architecture. For a list of available CPUs, use:
-B<llvm-as E<lt> /dev/null | llc -march=xyz -mcpu=help>
-
-=item B<-mattr>=I<a1,+a2,-a3,...>
-
-Override or control specific attributes of the target, such as whether SIMD
-operations are enabled or not. The default set of attributes is set by the
-current CPU. For a list of available attributes, use:
-B<llvm-as E<lt> /dev/null | llc -march=xyz -mattr=help>
-
-=item B<--disable-fp-elim>
-
-Disable frame pointer elimination optimization.
-
-=item B<--disable-excess-fp-precision>
-
-Disable optimizations that may produce excess precision for floating point.
-Note that this option can dramatically slow down code on some systems
-(e.g. X86).
-
-=item B<--enable-unsafe-fp-math>
-
-Enable optimizations that make unsafe assumptions about IEEE math (e.g. that
-addition is associative) or may not work for all input ranges. These
-optimizations allow the code generator to make use of some instructions which
-would otherwise not be usable (such as fsin on X86).
-
-=item B<--enable-correct-eh-support>
-
-Instruct the B<lowerinvoke> pass to insert code for correct exception handling
-support. This is expensive and is by default omitted for efficiency.
-
-=item B<--stats>
-
-Print statistics recorded by code-generation passes.
-
-=item B<--time-passes>
-
-Record the amount of time needed for each pass and print a report to standard
-error.
-
-=item B<--load>=F<dso_path>
-
-Dynamically load F<dso_path> (a path to a dynamically shared object) that
-implements an LLVM target. This will permit the target name to be used with the
-B<-march> option so that code can be generated for that target.
-
-=back
-
-=head2 Tuning/Configuration Options
-
-=over
-
-=item B<--print-machineinstrs>
-
-Print generated machine code between compilation phases (useful for debugging).
-
-=item B<--regalloc>=I<allocator>
-
-Specify the register allocator to use. The default I<allocator> is I<local>.
-Valid register allocators are:
-
-=over
-
-=item I<simple>
-
-Very simple "always spill" register allocator
-
-=item I<local>
-
-Local register allocator
-
-=item I<linearscan>
-
-Linear scan global register allocator
-
-=item I<iterativescan>
-
-Iterative scan global register allocator
-
-=back
-
-=item B<--spiller>=I<spiller>
-
-Specify the spiller to use for register allocators that support it. Currently
-this option is used only by the linear scan register allocator. The default
-I<spiller> is I<local>. Valid spillers are:
-
-=over
-
-=item I<simple>
-
-Simple spiller
-
-=item I<local>
-
-Local spiller
-
-=back
-
-=back
-
-=head2 Intel IA-32-specific Options
-
-=over
-
-=item B<--x86-asm-syntax=att|intel>
-
-Specify whether to emit assembly code in AT&T syntax (the default) or intel
-syntax.
-
-=back
-
-=head1 EXIT STATUS
-
-If B<llc> succeeds, it will exit with 0. Otherwise, if an error occurs,
-it will exit with a non-zero value.
-
-=head1 SEE ALSO
-
-L<lli|lli>
-
-=head1 AUTHORS
-
-Maintained by the LLVM Team (L<http://llvm.org>).
-
-=cut
diff --git a/release_23/docs/CommandGuide/lli.pod b/release_23/docs/CommandGuide/lli.pod
deleted file mode 100644
index e9fdf74fe53e..000000000000
--- a/release_23/docs/CommandGuide/lli.pod
+++ /dev/null
@@ -1,216 +0,0 @@
-=pod
-
-=head1 NAME
-
-lli - directly execute programs from LLVM bitcode
-
-=head1 SYNOPSIS
-
-B<lli> [I<options>] [I<filename>] [I<program args>]
-
-=head1 DESCRIPTION
-
-B<lli> directly executes programs in LLVM bitcode format. It takes a program
-in LLVM bitcode format and executes it using a just-in-time compiler, if one is
-available for the current architecture, or an interpreter. B<lli> takes all of
-the same code generator options as L<llc|llc>, but they are only effective when
-B<lli> is using the just-in-time compiler.
-
-If I<filename> is not specified, then B<lli> reads the LLVM bitcode for the
-program from standard input.
-
-The optional I<args> specified on the command line are passed to the program as
-arguments.
-
-=head1 GENERAL OPTIONS
-
-=over
-
-=item B<-fake-argv0>=I<executable>
-
-Override the C<argv[0]> value passed into the executing program.
-
-=item B<-force-interpreter>=I<{false,true}>
-
-If set to true, use the interpreter even if a just-in-time compiler is available
-for this architecture. Defaults to false.
-
-=item B<-help>
-
-Print a summary of command line options.
-
-=item B<-load>=I<puginfilename>
-
-Causes B<lli> to load the plugin (shared object) named I<pluginfilename> and use
-it for optimization.
-
-=item B<-stats>
-
-Print statistics from the code-generation passes. This is only meaningful for
-the just-in-time compiler, at present.
-
-=item B<-time-passes>
-
-Record the amount of time needed for each code-generation pass and print it to
-standard error.
-
-=item B<-version>
-
-Print out the version of B<lli> and exit without doing anything else.
-
-=back
-
-=head1 TARGET OPTIONS
-
-=over
-
-=item B<-mtriple>=I<target triple>
-
-Override the target triple specified in the input bitcode file with the
-specified string. This may result in a crash if you pick an
-architecture which is not compatible with the current system.
-
-=item B<-march>=I<arch>
-
-Specify the architecture for which to generate assembly, overriding the target
-encoded in the bitcode file. See the output of B<llc --help> for a list of
-valid architectures. By default this is inferred from the target triple or
-autodetected to the current architecture.
-
-=item B<-mcpu>=I<cpuname>
-
-Specify a specific chip in the current architecture to generate code for.
-By default this is inferred from the target triple and autodetected to
-the current architecture. For a list of available CPUs, use:
-B<llvm-as E<lt> /dev/null | llc -march=xyz -mcpu=help>
-
-=item B<-mattr>=I<a1,+a2,-a3,...>
-
-Override or control specific attributes of the target, such as whether SIMD
-operations are enabled or not. The default set of attributes is set by the
-current CPU. For a list of available attributes, use:
-B<llvm-as E<lt> /dev/null | llc -march=xyz -mattr=help>
-
-=back
-
-
-=head1 FLOATING POINT OPTIONS
-
-=over
-
-=item B<-disable-excess-fp-precision>
-
-Disable optimizations that may increase floating point precision.
-
-=item B<-enable-finite-only-fp-math>
-
-Enable optimizations that assumes only finite floating point math. That is,
-there is no NAN or Inf values.
-
-=item B<-enable-unsafe-fp-math>
-
-Causes B<lli> to enable optimizations that may decrease floating point
-precision.
-
-=item B<-soft-float>
-
-Causes B<lli> to generate software floating point library calls instead of
-equivalent hardware instructions.
-
-=back
-
-=head1 CODE GENERATION OPTIONS
-
-=over
-
-=item B<-code-model>=I<model>
-
-Choose the code model from:
-
- default: Target default code model
- small: Small code model
- kernel: Kernel code model
- medium: Medium code model
- large: Large code model
-
-=item B<-disable-post-RA-scheduler>
-
-Disable scheduling after register allocation.
-
-=item B<-disable-spill-fusing>
-
-Disable fusing of spill code into instructions.
-
-=item B<-enable-correct-eh-support>
-
-Make the -lowerinvoke pass insert expensive, but correct, EH code.
-
-=item B<-enable-eh>
-
-Exception handling should be emitted.
-
-=item B<-join-liveintervals>
-
-Coalesce copies (default=true).
-
-=item B<-nozero-initialized-in-bss>
-Don't place zero-initialized symbols into the BSS section.
-
-=item B<-pre-RA-sched>=I<scheduler>
-
-Instruction schedulers available (before register allocation):
-
- =default: Best scheduler for the target
- =none: No scheduling: breadth first sequencing
- =simple: Simple two pass scheduling: minimize critical path and maximize processor utilization
- =simple-noitin: Simple two pass scheduling: Same as simple except using generic latency
- =list-burr: Bottom-up register reduction list scheduling
- =list-tdrr: Top-down register reduction list scheduling
- =list-td: Top-down list scheduler -print-machineinstrs - Print generated machine code
-
-=item B<-regalloc>=I<allocator>
-
-Register allocator to use: (default = linearscan)
-
- =bigblock: Big-block register allocator
- =linearscan: linear scan register allocator =local - local register allocator
- =simple: simple register allocator
-
-=item B<-relocation-model>=I<model>
-
-Choose relocation model from:
-
- =default: Target default relocation model
- =static: Non-relocatable code =pic - Fully relocatable, position independent code
- =dynamic-no-pic: Relocatable external references, non-relocatable code
-
-=item B<-spiller>
-
-Spiller to use: (default: local)
-
- =simple: simple spiller
- =local: local spiller
-
-=item B<-x86-asm-syntax>=I<syntax>
-
-Choose style of code to emit from X86 backend:
-
- =att: Emit AT&T-style assembly
- =intel: Emit Intel-style assembly
-
-=back
-
-=head1 EXIT STATUS
-
-If B<lli> fails to load the program, it will exit with an exit code of 1.
-Otherwise, it will return the exit code of the program it executes.
-
-=head1 SEE ALSO
-
-L<llc|llc>
-
-=head1 AUTHOR
-
-Maintained by the LLVM Team (L<http://llvm.org>).
-
-=cut
diff --git a/release_23/docs/CommandGuide/llvm-ar.pod b/release_23/docs/CommandGuide/llvm-ar.pod
deleted file mode 100644
index 63ba43f6f6f8..000000000000
--- a/release_23/docs/CommandGuide/llvm-ar.pod
+++ /dev/null
@@ -1,406 +0,0 @@
-=pod
-
-=head1 NAME
-
-llvm-ar - LLVM archiver
-
-=head1 SYNOPSIS
-
-B<llvm-ar> [-]{dmpqrtx}[Rabfikouz] [relpos] [count] <archive> [files...]
-
-
-=head1 DESCRIPTION
-
-The B<llvm-ar> command is similar to the common Unix utility, C<ar>. It
-archives several files together into a single file. The intent for this is
-to produce archive libraries by LLVM bitcode that can be linked into an
-LLVM program. However, the archive can contain any kind of file. By default,
-B<llvm-ar> generates a symbol table that makes linking faster because
-only the symbol table needs to be consulted, not each individual file member
-of the archive.
-
-The B<llvm-ar> command can be used to I<read> both SVR4 and BSD style archive
-files. However, it cannot be used to write them. While the B<llvm-ar> command
-produces files that are I<almost> identical to the format used by other C<ar>
-implementations, it has two significant departures in order to make the
-archive appropriate for LLVM. The first departure is that B<llvm-ar> only
-uses BSD4.4 style long path names (stored immediately after the header) and
-never contains a string table for long names. The second departure is that the
-symbol table is formated for efficient construction of an in-memory data
-structure that permits rapid (red-black tree) lookups. Consequently, archives
-produced with B<llvm-ar> usually won't be readable or editable with any
-C<ar> implementation or useful for linking. Using the C<f> modifier to flatten
-file names will make the archive readable by other C<ar> implementations
-but not for linking because the symbol table format for LLVM is unique. If an
-SVR4 or BSD style archive is used with the C<r> (replace) or C<q> (quick
-update) operations, the archive will be reconstructed in LLVM format. This
-means that the string table will be dropped (in deference to BSD 4.4 long names)
-and an LLVM symbol table will be added (by default). The system symbol table
-will be retained.
-
-Here's where B<llvm-ar> departs from previous C<ar> implementations:
-
-=over
-
-=item I<Symbol Table>
-
-Since B<llvm-ar> is intended to archive bitcode files, the symbol table
-won't make much sense to anything but LLVM. Consequently, the symbol table's
-format has been simplified. It consists simply of a sequence of pairs
-of a file member index number as an LSB 4byte integer and a null-terminated
-string.
-
-=item I<Long Paths>
-
-Some C<ar> implementations (SVR4) use a separate file member to record long
-path names (> 15 characters). B<llvm-ar> takes the BSD 4.4 and Mac OS X
-approach which is to simply store the full path name immediately preceding
-the data for the file. The path name is null terminated and may contain the
-slash (/) character.
-
-=item I<Compression>
-
-B<llvm-ar> can compress the members of an archive to save space. The
-compression used depends on what's available on the platform and what choices
-the LLVM Compressor utility makes. It generally favors bzip2 but will select
-between "no compression" or bzip2 depending on what makes sense for the
-file's content.
-
-=item I<Directory Recursion>
-
-Most C<ar> implementations do not recurse through directories but simply
-ignore directories if they are presented to the program in the F<files>
-option. B<llvm-ar>, however, can recurse through directory structures and
-add all the files under a directory, if requested.
-
-=item I<TOC Verbose Output>
-
-When B<llvm-ar> prints out the verbose table of contents (C<tv> option), it
-precedes the usual output with a character indicating the basic kind of
-content in the file. A blank means the file is a regular file. A 'Z' means
-the file is compressed. A 'B' means the file is an LLVM bitcode file. An
-'S' means the file is the symbol table.
-
-=back
-
-=head1 OPTIONS
-
-The options to B<llvm-ar> are compatible with other C<ar> implementations.
-However, there are a few modifiers (F<zR>) that are not found in other
-C<ar>s. The options to B<llvm-ar> specify a single basic operation to
-perform on the archive, a variety of modifiers for that operation, the
-name of the archive file, and an optional list of file names. These options
-are used to determine how B<llvm-ar> should process the archive file.
-
-The Operations and Modifiers are explained in the sections below. The minimal
-set of options is at least one operator and the name of the archive. Typically
-archive files end with a C<.a> suffix, but this is not required. Following
-the F<archive-name> comes a list of F<files> that indicate the specific members
-of the archive to operate on. If the F<files> option is not specified, it
-generally means either "none" or "all" members, depending on the operation.
-
-=head2 Operations
-
-=over
-
-=item d
-
-Delete files from the archive. No modifiers are applicable to this operation.
-The F<files> options specify which members should be removed from the
-archive. It is not an error if a specified file does not appear in the archive.
-If no F<files> are specified, the archive is not modified.
-
-=item m[abi]
-
-Move files from one location in the archive to another. The F<a>, F<b>, and
-F<i> modifiers apply to this operation. The F<files> will all be moved
-to the location given by the modifiers. If no modifiers are used, the files
-will be moved to the end of the archive. If no F<files> are specified, the
-archive is not modified.
-
-=item p[k]
-
-Print files to the standard output. The F<k> modifier applies to this
-operation. This operation simply prints the F<files> indicated to the
-standard output. If no F<files> are specified, the entire archive is printed.
-Printing bitcode files is ill-advised as they might confuse your terminal
-settings. The F<p> operation never modifies the archive.
-
-=item q[Rfz]
-
-Quickly append files to the end of the archive. The F<R>, F<f>, and F<z>
-modifiers apply to this operation. This operation quickly adds the
-F<files> to the archive without checking for duplicates that should be
-removed first. If no F<files> are specified, the archive is not modified.
-Because of the way that B<llvm-ar> constructs the archive file, its dubious
-whether the F<q> operation is any faster than the F<r> operation.
-
-=item r[Rabfuz]
-
-Replace or insert file members. The F<R>, F<a>, F<b>, F<f>, F<u>, and F<z>
-modifiers apply to this operation. This operation will replace existing
-F<files> or insert them at the end of the archive if they do not exist. If no
-F<files> are specified, the archive is not modified.
-
-=item t[v]
-
-Print the table of contents. Without any modifiers, this operation just prints
-the names of the members to the standard output. With the F<v> modifier,
-B<llvm-ar> also prints out the file type (B=bitcode, Z=compressed, S=symbol
-table, blank=regular file), the permission mode, the owner and group, the
-size, and the date. If any F<files> are specified, the listing is only for
-those files. If no F<files> are specified, the table of contents for the
-whole archive is printed.
-
-=item x[oP]
-
-Extract archive members back to files. The F<o> modifier applies to this
-operation. This operation retrieves the indicated F<files> from the archive
-and writes them back to the operating system's file system. If no
-F<files> are specified, the entire archive is extract.
-
-=back
-
-=head2 Modifiers (operation specific)
-
-The modifiers below are specific to certain operations. See the Operations
-section (above) to determine which modifiers are applicable to which operations.
-
-=over
-
-=item [a]
-
-When inserting or moving member files, this option specifies the destination of
-the new files as being C<a>fter the F<relpos> member. If F<relpos> is not found,
-the files are placed at the end of the archive.
-
-=item [b]
-
-When inserting or moving member files, this option specifies the destination of
-the new files as being C<b>efore the F<relpos> member. If F<relpos> is not
-found, the files are placed at the end of the archive. This modifier is
-identical to the the F<i> modifier.
-
-=item [f]
-
-Normally, B<llvm-ar> stores the full path name to a file as presented to it on
-the command line. With this option, truncated (15 characters max) names are
-used. This ensures name compatibility with older versions of C<ar> but may also
-thwart correct extraction of the files (duplicates may overwrite). If used with
-the F<R> option, the directory recursion will be performed but the file names
-will all be C<f>lattened to simple file names.
-
-=item [i]
-
-A synonym for the F<b> option.
-
-=item [k]
-
-Normally, B<llvm-ar> will not print the contents of bitcode files when the
-F<p> operation is used. This modifier defeats the default and allows the
-bitcode members to be printed.
-
-=item [N]
-
-This option is ignored by B<llvm-ar> but provided for compatibility.
-
-=item [o]
-
-When extracting files, this option will cause B<llvm-ar> to preserve the
-original modification times of the files it writes.
-
-=item [P]
-
-use full path names when matching
-
-=item [R]
-
-This modifier instructions the F<r> option to recursively process directories.
-Without F<R>, directories are ignored and only those F<files> that refer to
-files will be added to the archive. When F<R> is used, any directories specified
-with F<files> will be scanned (recursively) to find files to be added to the
-archive. Any file whose name begins with a dot will not be added.
-
-=item [u]
-
-When replacing existing files in the archive, only replace those files that have
-a time stamp than the time stamp of the member in the archive.
-
-=item [z]
-
-When inserting or replacing any file in the archive, compress the file first.
-This
-modifier is safe to use when (previously) compressed bitcode files are added to
-the archive; the compressed bitcode files will not be doubly compressed.
-
-=back
-
-=head2 Modifiers (generic)
-
-The modifiers below may be applied to any operation.
-
-=over
-
-=item [c]
-
-For all operations, B<llvm-ar> will always create the archive if it doesn't
-exist. Normally, B<llvm-ar> will print a warning message indicating that the
-archive is being created. Using this modifier turns off that warning.
-
-=item [s]
-
-This modifier requests that an archive index (or symbol table) be added to the
-archive. This is the default mode of operation. The symbol table will contain
-all the externally visible functions and global variables defined by all the
-bitcode files in the archive. Using this modifier is more efficient that using
-L<llvm-ranlib|llvm-ranlib> which also creates the symbol table.
-
-=item [S]
-
-This modifier is the opposite of the F<s> modifier. It instructs B<llvm-ar> to
-not build the symbol table. If both F<s> and F<S> are used, the last modifier to
-occur in the options will prevail.
-
-=item [v]
-
-This modifier instructs B<llvm-ar> to be verbose about what it is doing. Each
-editing operation taken against the archive will produce a line of output saying
-what is being done.
-
-=back
-
-=head1 STANDARDS
-
-The B<llvm-ar> utility is intended to provide a superset of the IEEE Std 1003.2
-(POSIX.2) functionality for C<ar>. B<llvm-ar> can read both SVR4 and BSD4.4 (or
-Mac OS X) archives. If the C<f> modifier is given to the C<x> or C<r> operations
-then B<llvm-ar> will write SVR4 compatible archives. Without this modifier,
-B<llvm-ar> will write BSD4.4 compatible archives that have long names
-immediately after the header and indicated using the "#1/ddd" notation for the
-name in the header.
-
-=head1 FILE FORMAT
-
-The file format for LLVM Archive files is similar to that of BSD 4.4 or Mac OSX
-archive files. In fact, except for the symbol table, the C<ar> commands on those
-operating systems should be able to read LLVM archive files. The details of the
-file format follow.
-
-Each archive begins with the archive magic number which is the eight printable
-characters "!<arch>\n" where \n represents the newline character (0x0A).
-Following the magic number, the file is composed of even length members that
-begin with an archive header and end with a \n padding character if necessary
-(to make the length even). Each file member is composed of a header (defined
-below), an optional newline-terminated "long file name" and the contents of
-the file.
-
-The fields of the header are described in the items below. All fields of the
-header contain only ASCII characters, are left justified and are right padded
-with space characters.
-
-=over
-
-=item name - char[16]
-
-This field of the header provides the name of the archive member. If the name is
-longer than 15 characters or contains a slash (/) character, then this field
-contains C<#1/nnn> where C<nnn> provides the length of the name and the C<#1/>
-is literal. In this case, the actual name of the file is provided in the C<nnn>
-bytes immediately following the header. If the name is 15 characters or less, it
-is contained directly in this field and terminated with a slash (/) character.
-
-=item date - char[12]
-
-This field provides the date of modification of the file in the form of a
-decimal encoded number that provides the number of seconds since the epoch
-(since 00:00:00 Jan 1, 1970) per Posix specifications.
-
-=item uid - char[6]
-
-This field provides the user id of the file encoded as a decimal ASCII string.
-This field might not make much sense on non-Unix systems. On Unix, it is the
-same value as the st_uid field of the stat structure returned by the stat(2)
-operating system call.
-
-=item gid - char[6]
-
-This field provides the group id of the file encoded as a decimal ASCII string.
-This field might not make much sense on non-Unix systems. On Unix, it is the
-same value as the st_gid field of the stat structure returned by the stat(2)
-operating system call.
-
-=item mode - char[8]
-
-This field provides the access mode of the file encoded as an octal ASCII
-string. This field might not make much sense on non-Unix systems. On Unix, it
-is the same value as the st_mode field of the stat structure returned by the
-stat(2) operating system call.
-
-=item size - char[10]
-
-This field provides the size of the file, in bytes, encoded as a decimal ASCII
-string. If the size field is negative (starts with a minus sign, 0x02D), then
-the archive member is stored in compressed form. The first byte of the archive
-member's data indicates the compression type used. A value of 0 (0x30) indicates
-that no compression was used. A value of 2 (0x32) indicates that bzip2
-compression was used.
-
-=item fmag - char[2]
-
-This field is the archive file member magic number. Its content is always the
-two characters back tick (0x60) and newline (0x0A). This provides some measure
-utility in identifying archive files that have been corrupted.
-
-=back
-
-The LLVM symbol table has the special name "#_LLVM_SYM_TAB_#". It is presumed
-that no regular archive member file will want this name. The LLVM symbol table
-is simply composed of a sequence of triplets: byte offset, length of symbol,
-and the symbol itself. Symbols are not null or newline terminated. Here are
-the details on each of these items:
-
-=over
-
-=item offset - vbr encoded 32-bit integer
-
-The offset item provides the offset into the archive file where the bitcode
-member is stored that is associated with the symbol. The offset value is 0
-based at the start of the first "normal" file member. To derive the actual
-file offset of the member, you must add the number of bytes occupied by the file
-signature (8 bytes) and the symbol tables. The value of this item is encoded
-using variable bit rate encoding to reduce the size of the symbol table.
-Variable bit rate encoding uses the high bit (0x80) of each byte to indicate
-if there are more bytes to follow. The remaining 7 bits in each byte carry bits
-from the value. The final byte does not have the high bit set.
-
-=item length - vbr encoded 32-bit integer
-
-The length item provides the length of the symbol that follows. Like this
-I<offset> item, the length is variable bit rate encoded.
-
-=item symbol - character array
-
-The symbol item provides the text of the symbol that is associated with the
-I<offset>. The symbol is not terminated by any character. Its length is provided
-by the I<length> field. Note that is allowed (but unwise) to use non-printing
-characters (even 0x00) in the symbol. This allows for multiple encodings of
-symbol names.
-
-=back
-
-=head1 EXIT STATUS
-
-If B<llvm-ar> succeeds, it will exit with 0. A usage error, results
-in an exit code of 1. A hard (file system typically) error results in an
-exit code of 2. Miscellaneous or unknown errors result in an
-exit code of 3.
-
-=head1 SEE ALSO
-
-L<llvm-ranlib|llvm-ranlib>, ar(1)
-
-=head1 AUTHORS
-
-Maintained by the LLVM Team (L<http://llvm.org>).
-
-=cut
diff --git a/release_23/docs/CommandGuide/llvm-as.pod b/release_23/docs/CommandGuide/llvm-as.pod
deleted file mode 100644
index 2befed13ae00..000000000000
--- a/release_23/docs/CommandGuide/llvm-as.pod
+++ /dev/null
@@ -1,77 +0,0 @@
-=pod
-
-=head1 NAME
-
-llvm-as - LLVM assembler
-
-=head1 SYNOPSIS
-
-B<llvm-as> [I<options>] [I<filename>]
-
-=head1 DESCRIPTION
-
-B<llvm-as> is the LLVM assembler. It reads a file containing human-readable
-LLVM assembly language, translates it to LLVM bitcode, and writes the result
-into a file or to standard output.
-
-If F<filename> is omitted or is C<->, then B<llvm-as> reads its input from
-standard input.
-
-If an output file is not specified with the B<-o> option, then
-B<llvm-as> sends its output to a file or standard output by following
-these rules:
-
-=over
-
-=item *
-
-If the input is standard input, then the output is standard output.
-
-=item *
-
-If the input is a file that ends with C<.ll>, then the output file is of
-the same name, except that the suffix is changed to C<.bc>.
-
-=item *
-
-If the input is a file that does not end with the C<.ll> suffix, then the
-output file has the same name as the input file, except that the C<.bc>
-suffix is appended.
-
-=back
-
-=head1 OPTIONS
-
-=over
-
-=item B<-f>
-
-Force overwrite. Normally, B<llvm-as> will refuse to overwrite an
-output file that already exists. With this option, B<llvm-as>
-will overwrite the output file and replace it with new bitcode.
-
-=item B<--help>
-
-Print a summary of command line options.
-
-=item B<-o> F<filename>
-
-Specify the output file name. If F<filename> is C<->, then B<llvm-as>
-sends its output to standard output.
-
-=back
-
-=head1 EXIT STATUS
-
-If B<llvm-as> succeeds, it will exit with 0. Otherwise, if an error
-occurs, it will exit with a non-zero value.
-
-=head1 SEE ALSO
-
-L<llvm-dis|llvm-dis>, L<gccas|gccas>
-
-=head1 AUTHORS
-
-Maintained by the LLVM Team (L<http://llvm.org>).
-
-=cut
diff --git a/release_23/docs/CommandGuide/llvm-bcanalyzer.pod b/release_23/docs/CommandGuide/llvm-bcanalyzer.pod
deleted file mode 100644
index e789c9813aff..000000000000
--- a/release_23/docs/CommandGuide/llvm-bcanalyzer.pod
+++ /dev/null
@@ -1,315 +0,0 @@
-=pod
-
-=head1 NAME
-
-llvm-bcanalyzer - LLVM bitcode analyzer
-
-=head1 SYNOPSIS
-
-B<llvm-bcanalyzer> [I<options>] [F<filename>]
-
-=head1 DESCRIPTION
-
-The B<llvm-bcanalyzer> command is a small utility for analyzing bitcode files.
-The tool reads a bitcode file (such as generated with the B<llvm-as> tool) and
-produces a statistical report on the contents of the bitcode file. The tool
-can also dump a low level but human readable version of the bitcode file.
-This tool is probably not of much interest or utility except for those working
-directly with the bitcode file format. Most LLVM users can just ignore
-this tool.
-
-If F<filename> is omitted or is C<->, then B<llvm-bcanalyzer> reads its input
-from standard input. This is useful for combining the tool into a pipeline.
-Output is written to the standard output.
-
-=head1 OPTIONS
-
-=over
-
-=item B<-nodetails>
-
-Causes B<llvm-bcanalyzer> to abbreviate its output by writing out only a module
-level summary. The details for individual functions are not displayed.
-
-=item B<-dump>
-
-Causes B<llvm-bcanalyzer> to dump the bitcode in a human readable format. This
-format is significantly different from LLVM assembly and provides details about
-the encoding of the bitcode file.
-
-=item B<-verify>
-
-Causes B<llvm-bcanalyzer> to verify the module produced by reading the
-bitcode. This ensures that the statistics generated are based on a consistent
-module.
-
-=item B<--help>
-
-Print a summary of command line options.
-
-=back
-
-=head1 EXIT STATUS
-
-If B<llvm-bcanalyzer> succeeds, it will exit with 0. Otherwise, if an error
-occurs, it will exit with a non-zero value, usually 1.
-
-=head1 SUMMARY OUTPUT DEFINITIONS
-
-The following items are always printed by llvm-bcanalyzer. They comprize the
-summary output.
-
-=over
-
-=item B<Bitcode Analysis Of Module>
-
-This just provides the name of the module for which bitcode analysis is being
-generated.
-
-=item B<Bitcode Version Number>
-
-The bitcode version (not LLVM version) of the file read by the analyzer.
-
-=item B<File Size>
-
-The size, in bytes, of the entire bitcode file.
-
-=item B<Module Bytes>
-
-The size, in bytes, of the module block. Percentage is relative to File Size.
-
-=item B<Function Bytes>
-
-The size, in bytes, of all the function blocks. Percentage is relative to File
-Size.
-
-=item B<Global Types Bytes>
-
-The size, in bytes, of the Global Types Pool. Percentage is relative to File
-Size. This is the size of the definitions of all types in the bitcode file.
-
-=item B<Constant Pool Bytes>
-
-The size, in bytes, of the Constant Pool Blocks Percentage is relative to File
-Size.
-
-=item B<Module Globals Bytes>
-
-Ths size, in bytes, of the Global Variable Definitions and their initializers.
-Percentage is relative to File Size.
-
-=item B<Instruction List Bytes>
-
-The size, in bytes, of all the instruction lists in all the functions.
-Percentage is relative to File Size. Note that this value is also included in
-the Function Bytes.
-
-=item B<Compaction Table Bytes>
-
-The size, in bytes, of all the compaction tables in all the functions.
-Percentage is relative to File Size. Note that this value is also included in
-the Function Bytes.
-
-=item B<Symbol Table Bytes>
-
-The size, in bytes, of all the symbol tables in all the functions. Percentage is
-relative to File Size. Note that this value is also included in the Function
-Bytes.
-
-=item B<Dependent Libraries Bytes>
-
-The size, in bytes, of the list of dependent libraries in the module. Percentage
-is relative to File Size. Note that this value is also included in the Module
-Global Bytes.
-
-=item B<Number Of Bitcode Blocks>
-
-The total number of blocks of any kind in the bitcode file.
-
-=item B<Number Of Functions>
-
-The total number of function definitions in the bitcode file.
-
-=item B<Number Of Types>
-
-The total number of types defined in the Global Types Pool.
-
-=item B<Number Of Constants>
-
-The total number of constants (of any type) defined in the Constant Pool.
-
-=item B<Number Of Basic Blocks>
-
-The total number of basic blocks defined in all functions in the bitcode file.
-
-=item B<Number Of Instructions>
-
-The total number of instructions defined in all functions in the bitcode file.
-
-=item B<Number Of Long Instructions>
-
-The total number of long instructions defined in all functions in the bitcode
-file. Long instructions are those taking greater than 4 bytes. Typically long
-instructions are GetElementPtr with several indices, PHI nodes, and calls to
-functions with large numbers of arguments.
-
-=item B<Number Of Operands>
-
-The total number of operands used in all instructions in the bitcode file.
-
-=item B<Number Of Compaction Tables>
-
-The total number of compaction tables in all functions in the bitcode file.
-
-=item B<Number Of Symbol Tables>
-
-The total number of symbol tables in all functions in the bitcode file.
-
-=item B<Number Of Dependent Libs>
-
-The total number of dependent libraries found in the bitcode file.
-
-=item B<Total Instruction Size>
-
-The total size of the instructions in all functions in the bitcode file.
-
-=item B<Average Instruction Size>
-
-The average number of bytes per instruction across all functions in the bitcode
-file. This value is computed by dividing Total Instruction Size by Number Of
-Instructions.
-
-=item B<Maximum Type Slot Number>
-
-The maximum value used for a type's slot number. Larger slot number values take
-more bytes to encode.
-
-=item B<Maximum Value Slot Number>
-
-The maximum value used for a value's slot number. Larger slot number values take
-more bytes to encode.
-
-=item B<Bytes Per Value>
-
-The average size of a Value definition (of any type). This is computed by
-dividing File Size by the total number of values of any type.
-
-=item B<Bytes Per Global>
-
-The average size of a global definition (constants and global variables).
-
-=item B<Bytes Per Function>
-
-The average number of bytes per function definition. This is computed by
-dividing Function Bytes by Number Of Functions.
-
-=item B<# of VBR 32-bit Integers>
-
-The total number of 32-bit integers encoded using the Variable Bit Rate
-encoding scheme.
-
-=item B<# of VBR 64-bit Integers>
-
-The total number of 64-bit integers encoded using the Variable Bit Rate encoding
-scheme.
-
-=item B<# of VBR Compressed Bytes>
-
-The total number of bytes consumed by the 32-bit and 64-bit integers that use
-the Variable Bit Rate encoding scheme.
-
-=item B<# of VBR Expanded Bytes>
-
-The total number of bytes that would have been consumed by the 32-bit and 64-bit
-integers had they not been compressed with the Variable Bit Rage encoding
-scheme.
-
-=item B<Bytes Saved With VBR>
-
-The total number of bytes saved by using the Variable Bit Rate encoding scheme.
-The percentage is relative to # of VBR Expanded Bytes.
-
-=back
-
-=head1 DETAILED OUTPUT DEFINITIONS
-
-The following definitions occur only if the -nodetails option was not given.
-The detailed output provides additional information on a per-function basis.
-
-=over
-
-=item B<Type>
-
-The type signature of the function.
-
-=item B<Byte Size>
-
-The total number of bytes in the function's block.
-
-=item B<Basic Blocks>
-
-The number of basic blocks defined by the function.
-
-=item B<Instructions>
-
-The number of instructions defined by the function.
-
-=item B<Long Instructions>
-
-The number of instructions using the long instruction format in the function.
-
-=item B<Operands>
-
-The number of operands used by all instructions in the function.
-
-=item B<Instruction Size>
-
-The number of bytes consumed by instructions in the function.
-
-=item B<Average Instruction Size>
-
-The average number of bytes consumed by the instructions in the funtion. This
-value is computed by dividing Instruction Size by Instructions.
-
-=item B<Bytes Per Instruction>
-
-The average number of bytes used by the function per instruction. This value is
-computed by dividing Byte Size by Instructions. Note that this is not the same
-as Average Instruction Size. It computes a number relative to the total function
-size not just the size of the instruction list.
-
-=item B<Number of VBR 32-bit Integers>
-
-The total number of 32-bit integers found in this function (for any use).
-
-=item B<Number of VBR 64-bit Integers>
-
-The total number of 64-bit integers found in this function (for any use).
-
-=item B<Number of VBR Compressed Bytes>
-
-The total number of bytes in this function consumed by the 32-bit and 64-bit
-integers that use the Variable Bit Rate encoding scheme.
-
-=item B<Number of VBR Expanded Bytes>
-
-The total number of bytes in this function that would have been consumed by
-the 32-bit and 64-bit integers had they not been compressed with the Variable
-Bit Rate encoding scheme.
-
-=item B<Bytes Saved With VBR>
-
-The total number of bytes saved in this function by using the Variable Bit
-Rate encoding scheme. The percentage is relative to # of VBR Expanded Bytes.
-
-=back
-
-=head1 SEE ALSO
-
-L<llvm-dis|llvm-dis>, L<http://llvm.org/docs/BitcodeFormat.html>
-
-=head1 AUTHORS
-
-Maintained by the LLVM Team (L<http://llvm.org>).
-
-=cut
diff --git a/release_23/docs/CommandGuide/llvm-config.pod b/release_23/docs/CommandGuide/llvm-config.pod
deleted file mode 100644
index 06f10de22167..000000000000
--- a/release_23/docs/CommandGuide/llvm-config.pod
+++ /dev/null
@@ -1,131 +0,0 @@
-=pod
-
-=head1 NAME
-
-llvm-config - Print LLVM compilation options
-
-=head1 SYNOPSIS
-
-B<llvm-config> I<option> [I<components>...]
-
-=head1 DESCRIPTION
-
-B<llvm-config> makes it easier to build applications that use LLVM. It can
-print the compiler flags, linker flags and object libraries needed to link
-against LLVM.
-
-=head1 EXAMPLES
-
-To link against the JIT:
-
- g++ `llvm-config --cxxflags` -o HowToUseJIT.o -c HowToUseJIT.cpp
- g++ `llvm-config --ldflags` -o HowToUseJIT HowToUseJIT.o \
- `llvm-config --libs engine bcreader scalaropts`
-
-=head1 OPTIONS
-
-=over
-
-=item B<--version>
-
-Print the version number of LLVM.
-
-=item B<--help>
-
-Print a summary of B<llvm-config> arguments.
-
-=item B<--prefix>
-
-Print the installation prefix for LLVM.
-
-=item B<--src-root>
-
-Print the source root from which LLVM was built.
-
-=item B<--obj-root>
-
-Print the object root used to build LLVM.
-
-=item B<--bindir>
-
-Print the installation directory for LLVM binaries.
-
-=item B<--includedir>
-
-Print the installation directory for LLVM headers.
-
-=item B<--libdir>
-
-Print the installation directory for LLVM libraries.
-
-=item B<--cxxflags>
-
-Print the C++ compiler flags needed to use LLVM headers.
-
-=item B<--ldflags>
-
-Print the flags needed to link against LLVM libraries.
-
-=item B<--libs>
-
-Print all the libraries needed to link against the specified LLVM
-I<components>, including any dependencies.
-
-=item B<--libnames>
-
-Similar to B<--libs>, but prints the bare filenames of the libraries
-without B<-l> or pathnames. Useful for linking against a not-yet-installed
-copy of LLVM.
-
-=item B<--libfiles>
-
-Similar to B<--libs>, but print the full path to each library file. This is
-useful when creating makefile dependencies, to ensure that a tool is relinked if
-any library it uses changes.
-
-=item B<--components>
-
-Print all valid component names.
-
-=item B<--targets-built>
-
-Print the component names for all targets supported by this copy of LLVM.
-
-=item B<--build-mode>
-
-Print the build mode used when LLVM was built (e.g. Debug or Release)
-
-=back
-
-=head1 COMPONENTS
-
-To print a list of all available components, run B<llvm-config
---components>. In most cases, components correspond directly to LLVM
-libraries. Useful "virtual" components include:
-
-=over
-
-=item B<all>
-
-Includes all LLVM libaries. The default if no components are specified.
-
-=item B<backend>
-
-Includes either a native backend or the C backend.
-
-=item B<engine>
-
-Includes either a native JIT or the bitcode interpreter.
-
-=back
-
-=head1 EXIT STATUS
-
-If B<llvm-config> succeeds, it will exit with 0. Otherwise, if an error
-occurs, it will exit with a non-zero value.
-
-=head1 AUTHORS
-
-Maintained by the LLVM Team (L<http://llvm.org>).
-
-=cut
diff --git a/release_23/docs/CommandGuide/llvm-db.pod b/release_23/docs/CommandGuide/llvm-db.pod
deleted file mode 100644
index 132417685c2b..000000000000
--- a/release_23/docs/CommandGuide/llvm-db.pod
+++ /dev/null
@@ -1,16 +0,0 @@
-=pod
-
-=head1 NAME
-
-llvm-db - LLVM debugger (alpha)
-
-=head1 SYNOPSIS
-
-Details coming soon. Please see
-L<http://llvm.org/docs/SourceLevelDebugging.html> in the meantime.
-
-=head1 AUTHORS
-
-Maintained by the LLVM Team (L<http://llvm.org>).
-
-=cut
diff --git a/release_23/docs/CommandGuide/llvm-dis.pod b/release_23/docs/CommandGuide/llvm-dis.pod
deleted file mode 100644
index 8df382d2e9c0..000000000000
--- a/release_23/docs/CommandGuide/llvm-dis.pod
+++ /dev/null
@@ -1,60 +0,0 @@
-=pod
-
-=head1 NAME
-
-llvm-dis - LLVM disassembler
-
-=head1 SYNOPSIS
-
-B<llvm-dis> [I<options>] [I<filename>]
-
-=head1 DESCRIPTION
-
-The B<llvm-dis> command is the LLVM disassembler. It takes an LLVM
-bitcode file and converts it into human-readable LLVM assembly language.
-
-If filename is omitted or specified as C<->, B<llvm-dis> reads its
-input from standard input.
-
-If the input is being read from standard input, then B<llvm-dis>
-will send its output to standard output by default. Otherwise, the
-output will be written to a file named after the input file, with
-a C<.ll> suffix added (any existing C<.bc> suffix will first be
-removed). You can override the choice of output file using the
-B<-o> option.
-
-=head1 OPTIONS
-
-=over
-
-=item B<-f>
-
-Force overwrite. Normally, B<llvm-dis> will refuse to overwrite
-an output file that already exists. With this option, B<llvm-dis>
-will overwrite the output file.
-
-=item B<--help>
-
-Print a summary of command line options.
-
-=item B<-o> F<filename>
-
-Specify the output file name. If F<filename> is -, then the output is sent
-to standard output.
-
-=back
-
-=head1 EXIT STATUS
-
-If B<llvm-dis> succeeds, it will exit with 0. Otherwise, if an error
-occurs, it will exit with a non-zero value.
-
-=head1 SEE ALSO
-
-L<llvm-as|llvm-as>
-
-=head1 AUTHORS
-
-Maintained by the LLVM Team (L<http://llvm.org>).
-
-=cut
diff --git a/release_23/docs/CommandGuide/llvm-extract.pod b/release_23/docs/CommandGuide/llvm-extract.pod
deleted file mode 100644
index d916612ec5c6..000000000000
--- a/release_23/docs/CommandGuide/llvm-extract.pod
+++ /dev/null
@@ -1,63 +0,0 @@
-=pod
-
-=head1 NAME
-
-llvm-extract - extract a function from an LLVM module
-
-=head1 SYNOPSIS
-
-B<llvm-extract> [I<options>] B<--func> I<function-name> [I<filename>]
-
-=head1 DESCRIPTION
-
-The B<llvm-extract> command takes the name of a function and extracts it from
-the specified LLVM bitcode file. It is primarily used as a debugging tool to
-reduce test cases from larger programs that are triggering a bug.
-
-In addition to extracting the bitcode of the specified function,
-B<llvm-extract> will also remove unreachable global variables, prototypes, and
-unused types.
-
-The B<llvm-extract> command reads its input from standard input if filename is
-omitted or if filename is -. The output is always written to standard output,
-unless the B<-o> option is specified (see below).
-
-=head1 OPTIONS
-
-=over
-
-=item B<-f>
-
-Force overwrite. Normally, B<llvm-extract> will refuse to overwrite an
-output file that already exists. With this option, B<llvm-extract>
-will overwrite the output file and replace it with new bitcode.
-
-=item B<--func> I<function-name>
-
-Extract the function named I<function-name> from the LLVM bitcode.
-
-=item B<--help>
-
-Print a summary of command line options.
-
-=item B<-o> I<filename>
-
-Specify the output filename. If filename is "-" (the default), then
-B<llvm-extract> sends its output to standard output.
-
-=back
-
-=head1 EXIT STATUS
-
-If B<llvm-extract> succeeds, it will exit with 0. Otherwise, if an error
-occurs, it will exit with a non-zero value.
-
-=head1 SEE ALSO
-
-L<bugpoint|bugpoint>
-
-=head1 AUTHORS
-
-Maintained by the LLVM Team (L<http://llvm.org>).
-
-=cut
diff --git a/release_23/docs/CommandGuide/llvm-ld.pod b/release_23/docs/CommandGuide/llvm-ld.pod
deleted file mode 100644
index d655737674ec..000000000000
--- a/release_23/docs/CommandGuide/llvm-ld.pod
+++ /dev/null
@@ -1,269 +0,0 @@
-=pod
-
-=head1 NAME
-
-llvm-ld - LLVM linker
-
-=head1 SYNOPSIS
-
-B<llvm-ld> <options> <files>
-
-=head1 DESCRIPTION
-
-The B<llvm-ld> tool takes a set of LLVM bitcode files and links them
-together into a single LLVM bitcode file. The output bitcode file can be
-another bitcode file or an executable bitcode program. Using additional
-options, B<llvm-ld> is able to produce native code executables.
-
-The B<llvm-ld> tool is the main linker for LLVM. It is used to link together
-the output of LLVM front-end compilers and run "link time" optimizations (mostly
-the inter-procedural kind).
-
-The B<llvm-ld> tools attempts to mimic the interface provided by the default
-system linker so that it can act as a I<drop-in> replacement.
-
-=head2 Search Order
-
-When looking for objects specified on the command line, B<llvm-ld> will search
-for the object first in the current directory and then in the directory
-specified by the B<LLVM_LIB_SEARCH_PATH> environment variable. If it cannot
-find the object, it fails.
-
-When looking for a library specified with the B<-l> option, B<llvm-ld> first
-attempts to load a file with that name from the current directory. If that
-fails, it looks for libI<library>.bc, libI<library>.a, or libI<library>.I<shared
-library extension>, in that order, in each directory added to the library search
-path with the B<-L> option. These directories are searched in the order they
-are specified. If the library cannot be located, then B<llvm-ld> looks in the
-directory specified by the B<LLVM_LIB_SEARCH_PATH> environment variable. If it
-does not find a library there, it fails.
-
-The I<shared library extension> may be I<.so>, I<.dyld>, I<.dll>, or something
-different, depending upon the system.
-
-The B<-L> option is global. It does not matter where it is specified in the
-list of command line arguments; the directory is simply added to the search path
-and is applied to all libraries, preceding or succeeding, in the command line.
-
-=head2 Link order
-
-All object and bitcode files are linked first in the order they were
-specified on the command line. All library files are linked next.
-Some libraries may not be linked into the object program; see below.
-
-=head2 Library Linkage
-
-Object files and static bitcode objects are always linked into the output
-file. Library archives (.a files) load only the objects within the archive
-that define symbols needed by the output file. Hence, libraries should be
-listed after the object files and libraries which need them; otherwise, the
-library may not be linked in, and the dependent library will not have its
-undefined symbols defined.
-
-=head2 Native code generation
-
-The B<llvm-ld> program has limited support for native code generation, when
-using the B<-native> or B<-native-cbe> options. Native code generation is
-performed by converting the linked bitcode into native assembly (.s) or C code
-and running the system compiler (typically gcc) on the result.
-
-=head1 OPTIONS
-
-=head2 General Options
-
-=over
-
-=item B<-help>
-
-Print a summary of command line options.
-
-=item B<-v>
-
-Specifies verbose mode. In this mode the linker will print additional
-information about the actions it takes, programs it executes, etc.
-
-=item B<-stats>
-
-Print statistics.
-
-=item B<-time-passes>
-
-Record the amount of time needed for each pass and print it to standard
-error.
-
-=back
-
-=head2 Input/Output Options
-
-=over
-
-=item B<-o> F<filename>
-
-This overrides the default output file and specifies the name of the file that
-should be generated by the linker. By default, B<llvm-ld> generates a file named
-F<a.out> for compatibility with B<ld>. The output will be written to
-F<filename>.
-
-=item B<-l>F<name>
-
-This option specifies the F<name> of a library to search when resolving symbols
-for the program. Only the base name should be specified as F<name>, without a
-F<lib> prefix or any suffix.
-
-=item B<-L>F<Path>
-
-This option tells B<llvm-ld> to look in F<Path> to find any library subsequently
-specified with the B<-l> option. The paths will be searched in the order in
-which they are specified on the command line. If the library is still not found,
-a small set of system specific directories will also be searched. Note that
-libraries specified with the B<-l> option that occur I<before> any B<-L> options
-will not search the paths given by the B<-L> options following it.
-
-=item B<-link-as-library>
-
-Link the bitcode files together as a library, not an executable. In this mode,
-undefined symbols will be permitted.
-
-=item B<-r>
-
-An alias for -link-as-library.
-
-=item B<-march=>C<target>
-
-Specifies the kind of machine for which code or assembly should be generated.
-
-=item B<-native>
-
-Generate a native machine code executable.
-
-When generating native executables, B<llvm-ld> first checks for a bitcode
-version of the library and links it in, if necessary. If the library is
-missing, B<llvm-ld> skips it. Then, B<llvm-ld> links in the same
-libraries as native code.
-
-In this way, B<llvm-ld> should be able to link in optimized bitcode
-subsets of common libraries and then link in any part of the library that
-hasn't been converted to bitcode.
-
-=item B<-native-cbe>
-
-Generate a native machine code executable with the LLVM C backend.
-
-This option is identical to the B<-native> option, but uses the
-C backend to generate code for the program instead of an LLVM native
-code generator.
-
-=back
-
-=head2 Optimization Options
-
-=over
-
-=item B<-O0>
-
-An alias for the -O1 option.
-
-=item B<-O1>
-
-Optimize for linking speed, not execution speed. The optimizer will attempt to
-reduce the size of the linked program to reduce I/O but will not otherwise
-perform any link-time optimizations.
-
-=item B<-O2>
-
-Perform only the minimal or required set of scalar optimizations.
-
-=item B<-03>
-
-An alias for the -O2 option.
-
-=item B<-04>
-
-Perform the standard link time inter-procedural optimizations. This will
-attempt to optimize the program taking the entire program into consideration.
-
-=item B<-O5>
-
-Perform aggressive link time optimizations. This is the same as -O4 but works
-more aggressively to optimize the program.
-
-=item B<-disable-inlining>
-
-Do not run the inlining pass. Functions will not be inlined into other
-functions.
-
-=item B<-disable-opt>
-
-Completely disable optimization. The various B<-On> options will be ignored and
-no link time optimization passes will be run.
-
-=item B<-disable-internalize>
-
-Do not mark all symbols as internal.
-
-=item B<-verify-each>
-
-Run the verification pass after each of the passes to verify intermediate
-results.
-
-=item B<-strip-all>
-
-Strip all debug and symbol information from the executable to make it smaller.
-
-=item B<-strip-debug>
-
-Strip all debug information from the executable to make it smaller.
-
-=item B<-s>
-
-An alias for B<-strip-all>.
-
-=item B<-S>
-
-An alias for B<-strip-debug>.
-
-=item B<-export-dynamic>
-
-An alias for B<-disable-internalize>
-
-=item B<-load> F<module>
-
-Load an optimization module, F<module>, which is expected to be a dynamic
-library that provides the function name C<RunOptimizations>. This function will
-be passed the PassManager, and the optimization level (values 0-5 based on the
-B<-On> option). This function may add passes to the PassManager that should be
-run. This feature allows the optimization passes of B<llvm-ld> to be extended.
-
-=item B<-post-link-opt>F<Path>
-
-Run post-link optimization program. After linking is completed a bitcode file
-will be generated. It will be passed to the program specified by F<Path> as the
-first argument. The second argument to the program will be the name of a
-temporary file into which the program should place its optimized output. For
-example, the "no-op optimization" would be a simple shell script:
-
- #!/bin/bash
- cp $1 $2
-
-=back
-
-=head1 EXIT STATUS
-
-If B<llvm-ld> succeeds, it will exit with 0 return code. If an error occurs,
-it will exit with a non-zero return code.
-
-=head1 ENVIRONMENT
-
-The C<LLVM_LIB_SEARCH_PATH> environment variable is used to find bitcode
-libraries. Any paths specified in this variable will be searched after the C<-L>
-options.
-
-=head1 SEE ALSO
-
-L<llvm-link|llvm-link>
-
-=head1 AUTHORS
-
-Maintained by the LLVM Team (L<http://llvm.org>).
-
-=cut
diff --git a/release_23/docs/CommandGuide/llvm-link.pod b/release_23/docs/CommandGuide/llvm-link.pod
deleted file mode 100644
index 5f4dcb6e354d..000000000000
--- a/release_23/docs/CommandGuide/llvm-link.pod
+++ /dev/null
@@ -1,74 +0,0 @@
-=pod
-
-=head1 NAME
-
-llvm-link - LLVM linker
-
-=head1 SYNOPSIS
-
-B<llvm-link> [I<options>] I<filename ...>
-
-=head1 DESCRIPTION
-
-B<llvm-link> takes several LLVM bitcode files and links them together into a
-single LLVM bitcode file. It writes the output file to standard output, unless
-the B<-o> option is used to specify a filename.
-
-B<llvm-link> attempts to load the input files from the current directory. If
-that fails, it looks for each file in each of the directories specified by the
-B<-L> options on the command line. The library search paths are global; each
-one is searched for every input file if necessary. The directories are searched
-in the order they were specified on the command line.
-
-=head1 OPTIONS
-
-=over
-
-=item B<-L> F<directory>
-
-Add the specified F<directory> to the library search path. When looking for
-libraries, B<llvm-link> will look in path name for libraries. This option can be
-specified multiple times; B<llvm-link> will search inside these directories in
-the order in which they were specified on the command line.
-
-=item B<-f>
-
-Overwrite output files. By default, B<llvm-link> will not overwrite an output
-file if it already exists.
-
-=item B<-o> F<filename>
-
-Specify the output file name. If F<filename> is C<->, then B<llvm-link> will
-write its output to standard output.
-
-=item B<-d>
-
-If specified, B<llvm-link> prints a human-readable version of the output
-bitcode file to standard error.
-
-=item B<--help>
-
-Print a summary of command line options.
-
-=item B<-v>
-
-Verbose mode. Print information about what B<llvm-link> is doing. This
-typically includes a message for each bitcode file linked in and for each
-library found.
-
-=back
-
-=head1 EXIT STATUS
-
-If B<llvm-link> succeeds, it will exit with 0. Otherwise, if an error
-occurs, it will exit with a non-zero value.
-
-=head1 SEE ALSO
-
-L<gccld|gccld>
-
-=head1 AUTHORS
-
-Maintained by the LLVM Team (L<http://llvm.org>).
-
-=cut
diff --git a/release_23/docs/CommandGuide/llvm-nm.pod b/release_23/docs/CommandGuide/llvm-nm.pod
deleted file mode 100644
index 995ac08139ac..000000000000
--- a/release_23/docs/CommandGuide/llvm-nm.pod
+++ /dev/null
@@ -1,122 +0,0 @@
-=pod
-
-=head1 NAME
-
-llvm-nm - list LLVM bitcode file's symbol table
-
-=head1 SYNOPSIS
-
-B<llvm-nm> [I<options>] [I<filenames...>]
-
-=head1 DESCRIPTION
-
-The B<llvm-nm> utility lists the names of symbols from the LLVM bitcode files,
-or B<ar> archives containing LLVM bitcode files, named on the command line.
-Each symbol is listed along with some simple information about its provenance.
-If no file name is specified, or I<-> is used as a file name, B<llvm-nm> will
-process a bitcode file on its standard input stream.
-
-B<llvm-nm>'s default output format is the traditional BSD B<nm> output format.
-Each such output record consists of an (optional) 8-digit hexadecimal address,
-followed by a type code character, followed by a name, for each symbol. One
-record is printed per line; fields are separated by spaces. When the address is
-omitted, it is replaced by 8 spaces.
-
-Type code characters currently supported, and their meanings, are as follows:
-
-=over
-
-=item U
-
-Named object is referenced but undefined in this bitcode file
-
-=item C
-
-Common (multiple definitions link together into one def)
-
-=item W
-
-Weak reference (multiple definitions link together into zero or one definitions)
-
-=item t
-
-Local function (text) object
-
-=item T
-
-Global function (text) object
-
-=item d
-
-Local data object
-
-=item D
-
-Global data object
-
-=item ?
-
-Something unrecognizable
-
-=back
-
-Because LLVM bitcode files typically contain objects that are not considered to
-have addresses until they are linked into an executable image or dynamically
-compiled "just-in-time", B<llvm-nm> does not print an address for any symbol,
-even symbols which are defined in the bitcode file.
-
-=head1 OPTIONS
-
-=over
-
-=item B<-P>
-
-Use POSIX.2 output format. Alias for B<--format=posix>.
-
-=item B<-B> (default)
-
-Use BSD output format. Alias for B<--format=bsd>.
-
-=item B<--help>
-
-Print a summary of command-line options and their meanings.
-
-=item B<--defined-only>
-
-Print only symbols defined in this bitcode file (as opposed to
-symbols which may be referenced by objects in this file, but not
-defined in this file.)
-
-=item B<--extern-only>, B<-g>
-
-Print only symbols whose definitions are external; that is, accessible
-from other bitcode files.
-
-=item B<--undefined-only>, B<-u>
-
-Print only symbols referenced but not defined in this bitcode file.
-
-=item B<--format=>I<fmt>, B<-f>
-
-Select an output format; I<fmt> may be I<sysv>, I<posix>, or I<bsd>. The
-default is I<bsd>.
-
-=back
-
-=head1 BUGS
-
-B<llvm-nm> cannot demangle C++ mangled names, like GNU B<nm> can.
-
-=head1 EXIT STATUS
-
-B<llvm-nm> exits with an exit code of zero.
-
-=head1 SEE ALSO
-
-L<llvm-dis|llvm-dis>, ar(1), nm(1)
-
-=head1 AUTHOR
-
-Maintained by the LLVM Team (L<http://llvm.org>).
-
-=cut
diff --git a/release_23/docs/CommandGuide/llvm-prof.pod b/release_23/docs/CommandGuide/llvm-prof.pod
deleted file mode 100644
index 381387d7dbe5..000000000000
--- a/release_23/docs/CommandGuide/llvm-prof.pod
+++ /dev/null
@@ -1,57 +0,0 @@
-=pod
-
-=head1 NAME
-
-llvm-prof - print execution profile of LLVM program
-
-=head1 SYNOPSIS
-
-B<llvm-prof> [I<options>] [I<bitcode file>] [I<llvmprof.out>]
-
-=head1 DESCRIPTION
-
-The B<llvm-prof> tool reads in an F<llvmprof.out> file (which can
-optionally use a specific file with the third program argument), a bitcode file
-for the program, and produces a human readable report, suitable for determining
-where the program hotspots are.
-
-This program is often used in conjunction with the F<utils/profile.pl>
-script. This script automatically instruments a program, runs it with the JIT,
-then runs B<llvm-prof> to format a report. To get more information about
-F<utils/profile.pl>, execute it with the B<--help> option.
-
-=head1 OPTIONS
-
-=over
-
-=item B<--annotated-llvm> or B<-A>
-
-In addition to the normal report printed, print out the code for the
-program, annotated with execution frequency information. This can be
-particularly useful when trying to visualize how frequently basic blocks
-are executed. This is most useful with basic block profiling
-information or better.
-
-=item B<--print-all-code>
-
-Using this option enables the B<--annotated-llvm> option, but it
-prints the entire module, instead of just the most commonly executed
-functions.
-
-=item B<--time-passes>
-
-Record the amount of time needed for each pass and print it to standard
-error.
-
-=back
-
-=head1 EXIT STATUS
-
-B<llvm-prof> returns 1 if it cannot load the bitcode file or the profile
-information. Otherwise, it exits with zero.
-
-=head1 AUTHOR
-
-B<llvm-prof> is maintained by the LLVM Team (L<http://llvm.org>).
-
-=cut
diff --git a/release_23/docs/CommandGuide/llvm-ranlib.pod b/release_23/docs/CommandGuide/llvm-ranlib.pod
deleted file mode 100644
index 130edb07715a..000000000000
--- a/release_23/docs/CommandGuide/llvm-ranlib.pod
+++ /dev/null
@@ -1,52 +0,0 @@
-=pod
-
-=head1 NAME
-
-llvm-ranlib - Generate index for LLVM archive
-
-=head1 SYNOPSIS
-
-B<llvm-ranlib> [--version] [--help] <archive-file>
-
-=head1 DESCRIPTION
-
-The B<llvm-ranlib> command is similar to the common Unix utility, C<ranlib>. It
-adds or updates the symbol table in an LLVM archive file. Note that using the
-B<llvm-ar> modifier F<s> is usually more efficient than running B<llvm-ranlib>
-which is only provided only for completness and compatibility. Unlike other
-implementations of C<ranlib>, B<llvm-ranlib> indexes LLVM bitcode files, not
-native object modules. You can list the contents of the symbol table with the
-C<llvm-nm -s> command.
-
-=head1 OPTIONS
-
-=over
-
-=item F<archive-file>
-
-Specifies the archive-file to which the symbol table is added or updated.
-
-=item F<--version>
-
-Print the version of B<llvm-ranlib> and exit without building a symbol table.
-
-=item F<--help>
-
-Print usage help for B<llvm-ranlib> and exit without building a symbol table.
-
-=back
-
-=head1 EXIT STATUS
-
-If B<llvm-ranlib> succeeds, it will exit with 0. If an error occurs, a non-zero
-exit code will be returned.
-
-=head1 SEE ALSO
-
-L<llvm-ar|llvm-ar>, ranlib(1)
-
-=head1 AUTHORS
-
-Maintained by the LLVM Team (L<http://llvm.org>).
-
-=cut
diff --git a/release_23/docs/CommandGuide/llvmgcc.pod b/release_23/docs/CommandGuide/llvmgcc.pod
deleted file mode 100644
index 0b2b1566824b..000000000000
--- a/release_23/docs/CommandGuide/llvmgcc.pod
+++ /dev/null
@@ -1,85 +0,0 @@
-=pod
-
-=head1 NAME
-
-llvm-gcc - LLVM C front-end
-
-=head1 SYNOPSIS
-
-B<llvm-gcc> [I<options>] I<filename>
-
-=head1 DESCRIPTION
-
-The B<llvm-gcc> command is the LLVM C front end. It is a modified
-version of gcc that compiles C/ObjC programs into native objects, LLVM
-bitcode or LLVM assembly language, depending upon the options.
-
-By default, B<llvm-gcc> compiles to native objects just like GCC does. If the
-B<-emit-llvm> option is given then it will generate LLVM bitcode files instead.
-If B<-S> (assembly) is also given, then it will generate LLVM assembly.
-
-Being derived from the GNU Compiler Collection, B<llvm-gcc> has many
-of gcc's features and accepts most of gcc's options. It handles a
-number of gcc's extensions to the C programming language.
-
-=head1 OPTIONS
-
-=over
-
-=item B<--help>
-
-Print a summary of command line options.
-
-=item B<-S>
-
-Do not generate an LLVM bitcode file. Rather, compile the source
-file into an LLVM assembly language file.
-
-=item B<-c>
-
-Do not generate a linked executable. Rather, compile the source
-file into an LLVM bitcode file. This bitcode file can then be
-linked with other bitcode files later on to generate a full LLVM
-executable.
-
-=item B<-o> I<filename>
-
-Specify the output file to be I<filename>.
-
-=item B<-I> I<directory>
-
-Add a directory to the header file search path. This option can be
-repeated.
-
-=item B<-L> I<directory>
-
-Add I<directory> to the library search path. This option can be
-repeated.
-
-=item B<-l>I<name>
-
-Link in the library libI<name>.[bc | a | so]. This library should
-be a bitcode library.
-
-=item B<-emit-llvm>
-
-Make the output be LLVM bitcode (or assembly) instead of native object (or
-assembly).
-
-=back
-
-=head1 EXIT STATUS
-
-If B<llvm-gcc> succeeds, it will exit with 0. Otherwise, if an error
-occurs, it will exit with a non-zero value.
-
-=head1 SEE ALSO
-
-L<llvm-g++|llvmgxx>
-
-=head1 AUTHORS
-
-Maintained by the LLVM Team (L<http://llvm.org>).
-
-=cut
-
diff --git a/release_23/docs/CommandGuide/llvmgxx.pod b/release_23/docs/CommandGuide/llvmgxx.pod
deleted file mode 100644
index 64b670ebe069..000000000000
--- a/release_23/docs/CommandGuide/llvmgxx.pod
+++ /dev/null
@@ -1,85 +0,0 @@
-=pod
-
-=head1 NAME
-
-llvm-g++ - LLVM C++ front-end
-
-=head1 SYNOPSIS
-
-B<llvm-g++> [I<options>] I<filename>
-
-=head1 DESCRIPTION
-
-The B<llvm-g++> command is the LLVM C++ front end. It is a modified
-version of g++ that compiles C++/ObjC++ programs into native code,
-LLVM bitcode or assembly language, depending upon the options.
-
-By default, B<llvm-g++> compiles to native objects just like GCC does. If the
-B<-emit-llvm> option is given then it will generate LLVM bitcode files instead.
-If B<-S> (assembly) is also given, then it will generate LLVM assembly.
-
-Being derived from the GNU Compiler Collection, B<llvm-g++> has many
-of g++'s features and accepts most of g++'s options. It handles a
-number of g++'s extensions to the C++ programming language.
-
-=head1 OPTIONS
-
-=over
-
-=item B<--help>
-
-Print a summary of command line options.
-
-=item B<-S>
-
-Do not generate an LLVM bitcode file. Rather, compile the source
-file into an LLVM assembly language file.
-
-=item B<-c>
-
-Do not generate a linked executable. Rather, compile the source
-file into an LLVM bitcode file. This bitcode file can then be
-linked with other bitcode files later on to generate a full LLVM
-executable.
-
-=item B<-o> I<filename>
-
-Specify the output file to be I<filename>.
-
-=item B<-I> I<directory>
-
-Add a directory to the header file search path. This option can be
-repeated.
-
-=item B<-L> I<directory>
-
-Add I<directory> to the library search path. This option can be
-repeated.
-
-=item B<-l>I<name>
-
-Link in the library libI<name>.[bc | a | so]. This library should
-be a bitcode library.
-
-=item B<-emit-llvm>
-
-Make the output be LLVM bitcode (or assembly) instead of native object (or
-assembly).
-
-=back
-
-=head1 EXIT STATUS
-
-If B<llvm-g++> succeeds, it will exit with 0. Otherwise, if an error
-occurs, it will exit with a non-zero value.
-
-=head1 SEE ALSO
-
-L<llvm-gcc|llvmgcc>
-
-=head1 AUTHORS
-
-Maintained by the LLVM Team (L<http://llvm.org>).
-
-=cut
-
diff --git a/release_23/docs/CommandGuide/manpage.css b/release_23/docs/CommandGuide/manpage.css
deleted file mode 100644
index c922564dc3c3..000000000000
--- a/release_23/docs/CommandGuide/manpage.css
+++ /dev/null
@@ -1,256 +0,0 @@
-/* Based on http://www.perldoc.com/css/perldoc.css */
-
-@import url("../llvm.css");
-
-body { font-family: Arial,Helvetica; }
-
-blockquote { margin: 10pt; }
-
-h1, a { color: #336699; }
-
-
-/*** Top menu style ****/
-.mmenuon {
- font-family: Arial,Helvetica; font-weight: bold; text-decoration: none;
- color: #ff6600; font-size: 10pt;
-}
-.mmenuoff {
- font-family: Arial,Helvetica; font-weight: bold; text-decoration: none;
- color: #ffffff; font-size: 10pt;
-}
-.cpyright {
- font-family: Arial,Helvetica; font-weight: bold; text-decoration: none;
- color: #ffffff; font-size: xx-small;
-}
-.cpyrightText {
- font-family: Arial,Helvetica; font-weight: bold; text-decoration: none;
- color: #ffffff; font-size: xx-small;
-}
-.sections {
- font-family: Arial,Helvetica; font-weight: bold; text-decoration: none;
- color: #336699; font-size: 11pt;
-}
-.dsections {
- font-family: Arial,Helvetica; font-weight: bold; text-decoration: none;
- color: #336699; font-size: 12pt;
-}
-.slink {
- font-family: Arial,Helvetica; font-weight: normal; text-decoration: none;
- color: #000000; font-size: 9pt;
-}
-
-.slink2 { font-family: Arial,Helvetica; text-decoration: none; color: #336699; }
-
-.maintitle {
- font-family: Arial,Helvetica; font-weight: bold; text-decoration: none;
- color: #336699; font-size: 18pt;
-}
-.dblArrow {
- font-family: Arial,Helvetica; font-weight: bold; text-decoration: none;
- color: #336699; font-size: small;
-}
-.menuSec {
- font-family: Arial,Helvetica; font-weight: bold; text-decoration: none;
- color: #336699; font-size: small;
-}
-
-.newstext {
- font-family: Arial,Helvetica; font-size: small;
-}
-
-.linkmenu {
- font-family: Arial,Helvetica; color: #000000; font-weight: bold;
- text-decoration: none;
-}
-
-P {
- font-family: Arial,Helvetica;
-}
-
-PRE {
- font-size: 10pt;
-}
-.quote {
- font-family: Times; text-decoration: none;
- color: #000000; font-size: 9pt; font-style: italic;
-}
-.smstd { font-family: Arial,Helvetica; color: #000000; font-size: x-small; }
-.std { font-family: Arial,Helvetica; color: #000000; }
-.meerkatTitle {
- font-family: sans-serif; font-size: x-small; color: black; }
-
-.meerkatDescription { font-family: sans-serif; font-size: 10pt; color: black }
-.meerkatCategory {
- font-family: sans-serif; font-size: 9pt; font-weight: bold; font-style: italic;
- color: brown; }
-.meerkatChannel {
- font-family: sans-serif; font-size: 9pt; font-style: italic; color: brown; }
-.meerkatDate { font-family: sans-serif; font-size: xx-small; color: #336699; }
-
-.tocTitle {
- font-family: Arial,Helvetica; font-weight: bold; text-decoration: none;
- color: #333333; font-size: 10pt;
-}
-
-.toc-item {
- font-family: Arial,Helvetica; font-weight: bold;
- color: #336699; font-size: 10pt; text-decoration: underline;
-}
-
-.perlVersion {
- font-family: Arial,Helvetica; font-weight: bold;
- color: #336699; font-size: 10pt; text-decoration: none;
-}
-
-.podTitle {
- font-family: Arial,Helvetica; font-weight: bold; text-decoration: none;
- color: #000000;
-}
-
-.docTitle {
- font-family: Arial,Helvetica; font-weight: bold; text-decoration: none;
- color: #000000; font-size: 10pt;
-}
-.dotDot {
- font-family: Arial,Helvetica; font-weight: bold;
- color: #000000; font-size: 9pt;
-}
-
-.docSec {
- font-family: Arial,Helvetica; font-weight: normal;
- color: #333333; font-size: 9pt;
-}
-.docVersion {
- font-family: Arial,Helvetica; font-weight: bold; text-decoration: none;
- color: #336699; font-size: 10pt;
-}
-
-.docSecs-on {
- font-family: Arial,Helvetica; font-weight: normal; text-decoration: none;
- color: #ff0000; font-size: 10pt;
-}
-.docSecs-off {
- font-family: Arial,Helvetica; font-weight: normal; text-decoration: none;
- color: #333333; font-size: 10pt;
-}
-
-h2 {
- font-family: Arial,Helvetica; font-weight: bold; text-decoration: none;
- color: #336699; font-size: medium;
-}
-h1 {
- font-family: Verdana,Arial,Helvetica; font-weight: bold; text-decoration: none;
- color: #336699; font-size: large;
-}
-
-DL {
- font-family: Arial,Helvetica; font-weight: normal; text-decoration: none;
- color: #333333; font-size: 10pt;
-}
-
-UL > LI > A {
- font-family: Arial,Helvetica; font-weight: bold;
- color: #336699; font-size: 10pt;
-}
-
-.moduleInfo {
- font-family: Arial,Helvetica; font-weight: bold; text-decoration: none;
- color: #333333; font-size: 11pt;
-}
-
-.moduleInfoSec {
- font-family: Arial,Helvetica; font-weight: bold; text-decoration: none;
- color: #336699; font-size: 10pt;
-}
-
-.moduleInfoVal {
- font-family: Arial,Helvetica; font-weight: normal; text-decoration: underline;
- color: #000000; font-size: 10pt;
-}
-
-.cpanNavTitle {
- font-family: Arial,Helvetica; font-weight: bold;
- color: #ffffff; font-size: 10pt;
-}
-.cpanNavLetter {
- font-family: Arial,Helvetica; font-weight: bold; text-decoration: none;
- color: #333333; font-size: 9pt;
-}
-.cpanCat {
- font-family: Arial,Helvetica; font-weight: bold; text-decoration: none;
- color: #336699; font-size: 9pt;
-}
-
-.bttndrkblue-bkgd-top {
- background-color: #225688;
- background-image: url(/global/mvc_objects/images/bttndrkblue_bgtop.gif);
-}
-.bttndrkblue-bkgd-left {
- background-color: #225688;
- background-image: url(/global/mvc_objects/images/bttndrkblue_bgleft.gif);
-}
-.bttndrkblue-bkgd {
- padding-top: 0px;
- padding-bottom: 0px;
- margin-bottom: 0px;
- margin-top: 0px;
- background-repeat: no-repeat;
- background-color: #225688;
- background-image: url(/global/mvc_objects/images/bttndrkblue_bgmiddle.gif);
- vertical-align: top;
-}
-.bttndrkblue-bkgd-right {
- background-color: #225688;
- background-image: url(/global/mvc_objects/images/bttndrkblue_bgright.gif);
-}
-.bttndrkblue-bkgd-bottom {
- background-color: #225688;
- background-image: url(/global/mvc_objects/images/bttndrkblue_bgbottom.gif);
-}
-.bttndrkblue-text a {
- color: #ffffff;
- text-decoration: none;
-}
-a.bttndrkblue-text:hover {
- color: #ffDD3C;
- text-decoration: none;
-}
-.bg-ltblue {
- background-color: #f0f5fa;
-}
-
-.border-left-b {
- background: #f0f5fa url(/i/corner-leftline.gif) repeat-y;
-}
-
-.border-right-b {
- background: #f0f5fa url(/i/corner-rightline.gif) repeat-y;
-}
-
-.border-top-b {
- background: #f0f5fa url(/i/corner-topline.gif) repeat-x;
-}
-
-.border-bottom-b {
- background: #f0f5fa url(/i/corner-botline.gif) repeat-x;
-}
-
-.border-right-w {
- background: #ffffff url(/i/corner-rightline.gif) repeat-y;
-}
-
-.border-top-w {
- background: #ffffff url(/i/corner-topline.gif) repeat-x;
-}
-
-.border-bottom-w {
- background: #ffffff url(/i/corner-botline.gif) repeat-x;
-}
-
-.bg-white {
- background-color: #ffffff;
-}
-
-.border-left-w {
- background: #ffffff url(/i/corner-leftline.gif) repeat-y;
-}
diff --git a/release_23/docs/CommandGuide/opt.pod b/release_23/docs/CommandGuide/opt.pod
deleted file mode 100644
index 75b7eddd4cf1..000000000000
--- a/release_23/docs/CommandGuide/opt.pod
+++ /dev/null
@@ -1,138 +0,0 @@
-=pod
-
-=head1 NAME
-
-opt - LLVM optimizer
-
-=head1 SYNOPSIS
-
-B<opt> [I<options>] [I<filename>]
-
-=head1 DESCRIPTION
-
-The B<opt> command is the modular LLVM optimizer and analyzer. It takes LLVM
-bitcode as input, runs the specified optimizations or analyses on it, and then
-outputs the optimized LLVM bitcode or the analysis results. The function of
-B<opt> depends on whether the B<-analyze> option is given.
-
-When B<-analyze> is specified, B<opt> performs various analyses of LLVM
-bitcode. It will usually print the results on standard output, but in a few
-cases, it will print output to standard error or generate a file with the
-analysis output, which is usually done when the output is meant for another
-program.
-
-While B<-analyze> is I<not> given, B<opt> attempts to produce an optimized
-bitcode file. The optimizations available via B<opt> depend upon what
-libraries were linked into it as well as any additional libraries that have
-been loaded with the B<-load> option. Use the B<-help> option to determine
-what optimizations you can use.
-
-If I<filename> is omitted from the command line or is I<->, B<opt> reads its
-input from standard input. The input must be an LLVM bitcode file.
-
-If an output filename is not specified with the B<-o> option, B<opt>
-writes its output to the standard output.
-
-=head1 OPTIONS
-
-=over
-
-=item B<-f>
-
-Force overwrite. Normally, B<opt> will refuse to overwrite an
-output file that already exists. With this option, B<opt> will
-overwrite the output file and replace it with new bitcode.
-
-=item B<-help>
-
-Print a summary of command line options.
-
-=item B<-o> I<filename>
-
-Specify the output filename.
-
-=item B<-{passname}>
-
-B<opt> provides the ability to run any of LLVM's optimization or analysis passes
-in any order. The B<-help> option lists all the passes available. The order in
-which the options occur on the command line are the order in which they are
-executed (within pass constraints).
-
-=item B<-std-compile-opts>
-
-This is short hand for a standard list of I<compile time optimization> passes.
-This is typically used to optimize the output from the llvm-gcc front end. It
-might be useful for other front end compilers as well. To discover the full set
-of options available, use the following command:
-
- llvm-as < /dev/null | opt -std-compile-opts -disable-output -debug-pass=Arguments
-
-=item B<-disable-inlining>
-
-This option is only meaningful when B<-std-compile-opts> is given. It simply
-removes the inlining pass from the standard list.
-
-=item B<-disable-opt>
-
-This option is only meaningful when B<-std-compile-opts> is given. It disables
-most, but not all, of the B<-std-compile-opts>. The ones that remain are
-B<-verify>, B<-lower-setjmp>, and B<-funcresolve>.
-
-=item B<-strip-debug>
-
-This option causes opt to strip debug information from the module before
-applying other optimizations. It is essentially the same as B<-strip> but it
-ensures that stripping of debug information is done first.
-
-=item B<-verify-each>
-
-This option causes opt to add a verify pass after every pass otherwise specified
-on the command line (including B<-verify>). This is useful for cases where it
-is suspected that a pass is creating an invalid module but it is not clear which
-pass is doing it. The combination of B<-std-compile-opts> and B<-verify-each>
-can quickly track down this kind of problem.
-
-=item B<-profile-info-file> I<filename>
-
-Specify the name of the file loaded by the -profile-loader option.
-
-=item B<-stats>
-
-Print statistics.
-
-=item B<-time-passes>
-
-Record the amount of time needed for each pass and print it to standard
-error.
-
-=item B<-debug>
-
-If this is a debug build, this option will enable debug printouts
-from passes which use the I<DEBUG()> macro. See the B<LLVM Programmer's
-Manual>, section I<#DEBUG> for more information.
-
-=item B<-load>=I<plugin>
-
-Load the dynamic object I<plugin>. This object should register new optimization
-or analysis passes. Once loaded, the object will add new command line options to
-enable various optimizations or analyses. To see the new complete list of
-optimizations, use the B<-help> and B<-load> options together. For example:
-
- opt -load=plugin.so -help
-
-=item B<-p>
-
-Print module after each transformation.
-
-=back
-
-=head1 EXIT STATUS
-
-If B<opt> succeeds, it will exit with 0. Otherwise, if an error
-occurs, it will exit with a non-zero value.
-
-=head1 AUTHORS
-
-Maintained by the LLVM Team (L<http://llvm.org>).
-
-=cut
diff --git a/release_23/docs/CommandGuide/stkrc.pod b/release_23/docs/CommandGuide/stkrc.pod
deleted file mode 100644
index 4d8b4c9758a3..000000000000
--- a/release_23/docs/CommandGuide/stkrc.pod
+++ /dev/null
@@ -1,96 +0,0 @@
-=pod
-
-=head1 NAME
-
-stkrc - Stacker Compiler
-
-=head1 SYNOPSIS
-
-B<stkrc> [I<options>] [I<filename>]
-
-=head1 DESCRIPTION
-
-The B<stkrc> command is the compiler for the Stacker language. Stacker is a
-simple stack based, Forth-like language that was written as a demonstration
-language for LLVM. For details on the language, please see
-L<http://llvm.org/docs/Stacker.html> . The B<stkrc> compiler is fairly
-minimal. It compiles to bitcode only and doesn't perform any optimizations.
-The output of stkrc (a bitcode file) can be piped through other LLVM tools
-for optimization and linking.
-
-If F<filename> is omitted or is C<->, then B<stkrc> reads its input
-from standard input. This is useful for combining the tool into a pipeline.
-
-If an output file is not specified with the B<-o> option, then
-B<llvm-as> sends its output to a file or standard output by following
-these rules:
-
-=over
-
-=item *
-
-If the input is standard input, then the output is standard output.
-
-=item *
-
-If the input is a file that ends with C<.st>, then the output file is of
-the same name, except that the suffix is changed to C<.bc>.
-
-=item *
-
-If the input is a file that does not end with the C<.st> suffix, then the
-output file has the same name as the input file, except that the C<.bc>
-suffix is appended.
-
-=back
-
-=head1 OPTIONS
-
-=over
-
-=item B<-o> F<filename>
-
-Specify the output file name. If F<filename> is C<->, then B<llvm-as>
-sends its output to standard output.
-
-=item B<-stats>
-
-Print statistics acquired during compilation.
-
-=item B<-time-passes>
-
-Record the amount of time needed for each pass and print it to standard
-error.
-
-=item B<-f>
-
-Force the output to be written. Normally, B<stkrc> won't overwrite an existing
-bitcode file. This option overrides that behavior.
-
-=item B<-s> F<stacksize>
-
-Specify the stack size for the program. The default stack size, 1024, should be
-sufficient for most programs. For very large programs, especially those that
-recurse a lot, you might want to provide a larger value. Each unit of this
-value consumes 8 bytes of memory.
-
-=item B<-help>
-
-Print a summary of command line options.
-
-=back
-
-=head1 EXIT STATUS
-
-If B<stkrc> succeeds, it will exit with 0. Otherwise, if an error
-occurs, it will exit with a non-zero value, usually 1.
-
-=head1 SEE ALSO
-
-L<llvm-as>, L<http://llvm.org/docs/Stacker.html>
-
-=head1 AUTHORS
-
-Maintained by the LLVM Team (L<http://llvm.org>).
-
-=cut
diff --git a/release_23/docs/CommandGuide/tblgen.pod b/release_23/docs/CommandGuide/tblgen.pod
deleted file mode 100644
index c8244af5cea8..000000000000
--- a/release_23/docs/CommandGuide/tblgen.pod
+++ /dev/null
@@ -1,115 +0,0 @@
-
-=pod
-
-=head1 NAME
-
-tblgen - Target Description To C++ Code Generator
-
-=head1 SYNOPSIS
-
-B<tblgen> [I<options>] [I<filename>]
-
-=head1 DESCRIPTION
-
-B<tblgen> translates from target description (.td) files into C++ code that can
-be included in the definition of an LLVM target library. Most users of LLVM will
-not need to use this program. It is only for assisting with writing an LLVM
-target backend.
-
-The input and output of B<tblgen> is beyond the scope of this short
-introduction. Please see the I<CodeGeneration> page in the LLVM documentation.
-
-The F<filename> argument specifies the name of a Target Description (.td) file
-to read as input.
-
-=head1 OPTIONS
-
-=over
-
-=item B<--help>
-
-Print a summary of command line options.
-
-=item B<-o> F<filename>
-
-Specify the output file name. If F<filename> is C<->, then B<tblgen>
-sends its output to standard output.
-
-=item B<-I> F<directory>
-
-Specify where to find other target description files for inclusion. The
-F<directory> value should be a full or partial path to a directory that contains
-target description files.
-
-=item B<-asmwriternum> F<N>
-
-Make -gen-asm-writer emit assembly writer number F<N>.
-
-=item B<-class> F<class Name>
-
-Print the enumeration list for this class.
-
-=item B<-print-records>
-
-Print all records to standard output (default).
-
-=item B<-print-enums>
-
-Print enumeration values for a class
-
-=item B<-gen-emitter>
-
-Generate machine code emitter.
-
-=item B<-gen-register-enums>
-
-Generate the enumeration values for all registers.
-
-=item B<-gen-register-desc>
-
-Generate a register info description for each register.
-
-=item B<-gen-register-desc-header>
-
-Generate a register info description header for each register.
-
-=item B<-gen-instr-enums>
-
-Generate enumeration values for instructions.
-
-=item B<-gen-instr-desc>
-
-Generate instruction descriptions.
-
-=item B<-gen-asm-writer>
-
-Generate the assembly writer.
-
-=item B<-gen-dag-isel>
-
-Generate a DAG (Directed Acycle Graph) instruction selector.
-
-=item B<-gen-subtarget>
-
-Generate subtarget enumerations.
-
-=item B<-gen-intrinsic>
-
-Generate intrinsic information.
-
-=item B<-version>
-
-Show the version number of this program.
-
-=back
-
-=head1 EXIT STATUS
-
-If B<tblgen> succeeds, it will exit with 0. Otherwise, if an error
-occurs, it will exit with a non-zero value.
-
-=head1 AUTHORS
-
-Maintained by The LLVM Team (L<http://llvm.org>).
-
-=cut
diff --git a/release_23/docs/CommandLine.html b/release_23/docs/CommandLine.html
deleted file mode 100644
index 93b5ca1c69e3..000000000000
--- a/release_23/docs/CommandLine.html
+++ /dev/null
@@ -1,1970 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
- "http://www.w3.org/TR/html4/strict.dtd">
-<html>
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <title>CommandLine 2.0 Library Manual</title>
- <link rel="stylesheet" href="llvm.css" type="text/css">
-</head>
-<body>
-
-<div class="doc_title">
- CommandLine 2.0 Library Manual
-</div>
-
-<ol>
- <li><a href="#introduction">Introduction</a></li>
-
- <li><a href="#quickstart">Quick Start Guide</a>
- <ol>
- <li><a href="#bool">Boolean Arguments</a></li>
- <li><a href="#alias">Argument Aliases</a></li>
- <li><a href="#onealternative">Selecting an alternative from a
- set of possibilities</a></li>
- <li><a href="#namedalternatives">Named alternatives</a></li>
- <li><a href="#list">Parsing a list of options</a></li>
- <li><a href="#bits">Collecting options as a set of flags</a></li>
- <li><a href="#description">Adding freeform text to help output</a></li>
- </ol></li>
-
- <li><a href="#referenceguide">Reference Guide</a>
- <ol>
- <li><a href="#positional">Positional Arguments</a>
- <ul>
- <li><a href="#--">Specifying positional options with hyphens</a></li>
- <li><a href="#getPosition">Determining absolute position with
- getPosition</a></li>
- <li><a href="#cl::ConsumeAfter">The <tt>cl::ConsumeAfter</tt>
- modifier</a></li>
- </ul></li>
-
- <li><a href="#storage">Internal vs External Storage</a></li>
-
- <li><a href="#attributes">Option Attributes</a></li>
-
- <li><a href="#modifiers">Option Modifiers</a>
- <ul>
- <li><a href="#hiding">Hiding an option from <tt>--help</tt>
- output</a></li>
- <li><a href="#numoccurrences">Controlling the number of occurrences
- required and allowed</a></li>
- <li><a href="#valrequired">Controlling whether or not a value must be
- specified</a></li>
- <li><a href="#formatting">Controlling other formatting options</a></li>
- <li><a href="#misc">Miscellaneous option modifiers</a></li>
- <li><a href="#response">Response files</a></li>
- </ul></li>
-
- <li><a href="#toplevel">Top-Level Classes and Functions</a>
- <ul>
- <li><a href="#cl::ParseCommandLineOptions">The
- <tt>cl::ParseCommandLineOptions</tt> function</a></li>
- <li><a href="#cl::ParseEnvironmentOptions">The
- <tt>cl::ParseEnvironmentOptions</tt> function</a></li>
- <li><a href="#cl::SetVersionPrinter">The <tt>cl::SetVersionPrinter</tt>
- function</a></li>
- <li><a href="#cl::opt">The <tt>cl::opt</tt> class</a></li>
- <li><a href="#cl::list">The <tt>cl::list</tt> class</a></li>
- <li><a href="#cl::bits">The <tt>cl::bits</tt> class</a></li>
- <li><a href="#cl::alias">The <tt>cl::alias</tt> class</a></li>
- <li><a href="#cl::extrahelp">The <tt>cl::extrahelp</tt> class</a></li>
- </ul></li>
-
- <li><a href="#builtinparsers">Builtin parsers</a>
- <ul>
- <li><a href="#genericparser">The Generic <tt>parser&lt;t&gt;</tt>
- parser</a></li>
- <li><a href="#boolparser">The <tt>parser&lt;bool&gt;</tt>
- specialization</a></li>
- <li><a href="#boolOrDefaultparser">The <tt>parser&lt;boolOrDefault&gt;</tt>
- specialization</a></li>
- <li><a href="#stringparser">The <tt>parser&lt;string&gt;</tt>
- specialization</a></li>
- <li><a href="#intparser">The <tt>parser&lt;int&gt;</tt>
- specialization</a></li>
- <li><a href="#doubleparser">The <tt>parser&lt;double&gt;</tt> and
- <tt>parser&lt;float&gt;</tt> specializations</a></li>
- </ul></li>
- </ol></li>
- <li><a href="#extensionguide">Extension Guide</a>
- <ol>
- <li><a href="#customparser">Writing a custom parser</a></li>
- <li><a href="#explotingexternal">Exploiting external storage</a></li>
- <li><a href="#dynamicopts">Dynamically adding command line
- options</a></li>
- </ol></li>
-</ol>
-
-<div class="doc_author">
- <p>Written by <a href="mailto:sabre@nondot.org">Chris Lattner</a></p>
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section">
- <a name="introduction">Introduction</a>
-</div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>This document describes the CommandLine argument processing library. It will
-show you how to use it, and what it can do. The CommandLine library uses a
-declarative approach to specifying the command line options that your program
-takes. By default, these options declarations implicitly hold the value parsed
-for the option declared (of course this <a href="#storage">can be
-changed</a>).</p>
-
-<p>Although there are a <b>lot</b> of command line argument parsing libraries
-out there in many different languages, none of them fit well with what I needed.
-By looking at the features and problems of other libraries, I designed the
-CommandLine library to have the following features:</p>
-
-<ol>
-<li>Speed: The CommandLine library is very quick and uses little resources. The
-parsing time of the library is directly proportional to the number of arguments
-parsed, not the the number of options recognized. Additionally, command line
-argument values are captured transparently into user defined global variables,
-which can be accessed like any other variable (and with the same
-performance).</li>
-
-<li>Type Safe: As a user of CommandLine, you don't have to worry about
-remembering the type of arguments that you want (is it an int? a string? a
-bool? an enum?) and keep casting it around. Not only does this help prevent
-error prone constructs, it also leads to dramatically cleaner source code.</li>
-
-<li>No subclasses required: To use CommandLine, you instantiate variables that
-correspond to the arguments that you would like to capture, you don't subclass a
-parser. This means that you don't have to write <b>any</b> boilerplate
-code.</li>
-
-<li>Globally accessible: Libraries can specify command line arguments that are
-automatically enabled in any tool that links to the library. This is possible
-because the application doesn't have to keep a list of arguments to pass to
-the parser. This also makes supporting <a href="#dynamicopts">dynamically
-loaded options</a> trivial.</li>
-
-<li>Cleaner: CommandLine supports enum and other types directly, meaning that
-there is less error and more security built into the library. You don't have to
-worry about whether your integral command line argument accidentally got
-assigned a value that is not valid for your enum type.</li>
-
-<li>Powerful: The CommandLine library supports many different types of
-arguments, from simple <a href="#boolparser">boolean flags</a> to <a
-href="#cl::opt">scalars arguments</a> (<a href="#stringparser">strings</a>, <a
-href="#intparser">integers</a>, <a href="#genericparser">enums</a>, <a
-href="#doubleparser">doubles</a>), to <a href="#cl::list">lists of
-arguments</a>. This is possible because CommandLine is...</li>
-
-<li>Extensible: It is very simple to add a new argument type to CommandLine.
-Simply specify the parser that you want to use with the command line option when
-you declare it. <a href="#customparser">Custom parsers</a> are no problem.</li>
-
-<li>Labor Saving: The CommandLine library cuts down on the amount of grunt work
-that you, the user, have to do. For example, it automatically provides a
-<tt>--help</tt> option that shows the available command line options for your
-tool. Additionally, it does most of the basic correctness checking for
-you.</li>
-
-<li>Capable: The CommandLine library can handle lots of different forms of
-options often found in real programs. For example, <a
-href="#positional">positional</a> arguments, <tt>ls</tt> style <a
-href="#cl::Grouping">grouping</a> options (to allow processing '<tt>ls
--lad</tt>' naturally), <tt>ld</tt> style <a href="#cl::Prefix">prefix</a>
-options (to parse '<tt>-lmalloc -L/usr/lib</tt>'), and <a
-href="#cl::ConsumeAfter">interpreter style options</a>.</li>
-
-</ol>
-
-<p>This document will hopefully let you jump in and start using CommandLine in
-your utility quickly and painlessly. Additionally it should be a simple
-reference manual to figure out how stuff works. If it is failing in some area
-(or you want an extension to the library), nag the author, <a
-href="mailto:sabre@nondot.org">Chris Lattner</a>.</p>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section">
- <a name="quickstart">Quick Start Guide</a>
-</div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>This section of the manual runs through a simple CommandLine'ification of a
-basic compiler tool. This is intended to show you how to jump into using the
-CommandLine library in your own program, and show you some of the cool things it
-can do.</p>
-
-<p>To start out, you need to include the CommandLine header file into your
-program:</p>
-
-<div class="doc_code"><pre>
- #include "llvm/Support/CommandLine.h"
-</pre></div>
-
-<p>Additionally, you need to add this as the first line of your main
-program:</p>
-
-<div class="doc_code"><pre>
-int main(int argc, char **argv) {
- <a href="#cl::ParseCommandLineOptions">cl::ParseCommandLineOptions</a>(argc, argv);
- ...
-}
-</pre></div>
-
-<p>... which actually parses the arguments and fills in the variable
-declarations.</p>
-
-<p>Now that you are ready to support command line arguments, we need to tell the
-system which ones we want, and what type of arguments they are. The CommandLine
-library uses a declarative syntax to model command line arguments with the
-global variable declarations that capture the parsed values. This means that
-for every command line option that you would like to support, there should be a
-global variable declaration to capture the result. For example, in a compiler,
-we would like to support the Unix-standard '<tt>-o &lt;filename&gt;</tt>' option
-to specify where to put the output. With the CommandLine library, this is
-represented like this:</p>
-
-<a name="value_desc_example"></a>
-<div class="doc_code"><pre>
-<a href="#cl::opt">cl::opt</a>&lt;string&gt; OutputFilename("<i>o</i>", <a href="#cl::desc">cl::desc</a>("<i>Specify output filename</i>"), <a href="#cl::value_desc">cl::value_desc</a>("<i>filename</i>"));
-</pre></div>
-
-<p>This declares a global variable "<tt>OutputFilename</tt>" that is used to
-capture the result of the "<tt>o</tt>" argument (first parameter). We specify
-that this is a simple scalar option by using the "<tt><a
-href="#cl::opt">cl::opt</a></tt>" template (as opposed to the <a
-href="#list">"<tt>cl::list</tt> template</a>), and tell the CommandLine library
-that the data type that we are parsing is a string.</p>
-
-<p>The second and third parameters (which are optional) are used to specify what
-to output for the "<tt>--help</tt>" option. In this case, we get a line that
-looks like this:</p>
-
-<div class="doc_code"><pre>
-USAGE: compiler [options]
-
-OPTIONS:
- -help - display available options (--help-hidden for more)
- <b>-o &lt;filename&gt; - Specify output filename</b>
-</pre></div>
-
-<p>Because we specified that the command line option should parse using the
-<tt>string</tt> data type, the variable declared is automatically usable as a
-real string in all contexts that a normal C++ string object may be used. For
-example:</p>
-
-<div class="doc_code"><pre>
- ...
- std::ofstream Output(OutputFilename.c_str());
- if (Output.good()) ...
- ...
-</pre></div>
-
-<p>There are many different options that you can use to customize the command
-line option handling library, but the above example shows the general interface
-to these options. The options can be specified in any order, and are specified
-with helper functions like <a href="#cl::desc"><tt>cl::desc(...)</tt></a>, so
-there are no positional dependencies to remember. The available options are
-discussed in detail in the <a href="#referenceguide">Reference Guide</a>.</p>
-
-<p>Continuing the example, we would like to have our compiler take an input
-filename as well as an output filename, but we do not want the input filename to
-be specified with a hyphen (ie, not <tt>-filename.c</tt>). To support this
-style of argument, the CommandLine library allows for <a
-href="#positional">positional</a> arguments to be specified for the program.
-These positional arguments are filled with command line parameters that are not
-in option form. We use this feature like this:</p>
-
-<div class="doc_code"><pre>
-<a href="#cl::opt">cl::opt</a>&lt;string&gt; InputFilename(<a href="#cl::Positional">cl::Positional</a>, <a href="#cl::desc">cl::desc</a>("<i>&lt;input file&gt;</i>"), <a href="#cl::init">cl::init</a>("<i>-</i>"));
-</pre></div>
-
-<p>This declaration indicates that the first positional argument should be
-treated as the input filename. Here we use the <tt><a
-href="#cl::init">cl::init</a></tt> option to specify an initial value for the
-command line option, which is used if the option is not specified (if you do not
-specify a <tt><a href="#cl::init">cl::init</a></tt> modifier for an option, then
-the default constructor for the data type is used to initialize the value).
-Command line options default to being optional, so if we would like to require
-that the user always specify an input filename, we would add the <tt><a
-href="#cl::Required">cl::Required</a></tt> flag, and we could eliminate the
-<tt><a href="#cl::init">cl::init</a></tt> modifier, like this:</p>
-
-<div class="doc_code"><pre>
-<a href="#cl::opt">cl::opt</a>&lt;string&gt; InputFilename(<a href="#cl::Positional">cl::Positional</a>, <a href="#cl::desc">cl::desc</a>("<i>&lt;input file&gt;</i>"), <b><a href="#cl::Required">cl::Required</a></b>);
-</pre></div>
-
-<p>Again, the CommandLine library does not require the options to be specified
-in any particular order, so the above declaration is equivalent to:</p>
-
-<div class="doc_code"><pre>
-<a href="#cl::opt">cl::opt</a>&lt;string&gt; InputFilename(<a href="#cl::Positional">cl::Positional</a>, <a href="#cl::Required">cl::Required</a>, <a href="#cl::desc">cl::desc</a>("<i>&lt;input file&gt;</i>"));
-</pre></div>
-
-<p>By simply adding the <tt><a href="#cl::Required">cl::Required</a></tt> flag,
-the CommandLine library will automatically issue an error if the argument is not
-specified, which shifts all of the command line option verification code out of
-your application into the library. This is just one example of how using flags
-can alter the default behaviour of the library, on a per-option basis. By
-adding one of the declarations above, the <tt>--help</tt> option synopsis is now
-extended to:</p>
-
-<div class="doc_code"><pre>
-USAGE: compiler [options] <b>&lt;input file&gt;</b>
-
-OPTIONS:
- -help - display available options (--help-hidden for more)
- -o &lt;filename&gt; - Specify output filename
-</pre></div>
-
-<p>... indicating that an input filename is expected.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="bool">Boolean Arguments</a>
-</div>
-
-<div class="doc_text">
-
-<p>In addition to input and output filenames, we would like the compiler example
-to support three boolean flags: "<tt>-f</tt>" to force overwriting of the output
-file, "<tt>--quiet</tt>" to enable quiet mode, and "<tt>-q</tt>" for backwards
-compatibility with some of our users. We can support these by declaring options
-of boolean type like this:</p>
-
-<div class="doc_code"><pre>
-<a href="#cl::opt">cl::opt</a>&lt;bool&gt; Force ("<i>f</i>", <a href="#cl::desc">cl::desc</a>("<i>Overwrite output files</i>"));
-<a href="#cl::opt">cl::opt</a>&lt;bool&gt; Quiet ("<i>quiet</i>", <a href="#cl::desc">cl::desc</a>("<i>Don't print informational messages</i>"));
-<a href="#cl::opt">cl::opt</a>&lt;bool&gt; Quiet2("<i>q</i>", <a href="#cl::desc">cl::desc</a>("<i>Don't print informational messages</i>"), <a href="#cl::Hidden">cl::Hidden</a>);
-</pre></div>
-
-<p>This does what you would expect: it declares three boolean variables
-("<tt>Force</tt>", "<tt>Quiet</tt>", and "<tt>Quiet2</tt>") to recognize these
-options. Note that the "<tt>-q</tt>" option is specified with the "<a
-href="#cl::Hidden"><tt>cl::Hidden</tt></a>" flag. This modifier prevents it
-from being shown by the standard "<tt>--help</tt>" output (note that it is still
-shown in the "<tt>--help-hidden</tt>" output).</p>
-
-<p>The CommandLine library uses a <a href="#builtinparsers">different parser</a>
-for different data types. For example, in the string case, the argument passed
-to the option is copied literally into the content of the string variable... we
-obviously cannot do that in the boolean case, however, so we must use a smarter
-parser. In the case of the boolean parser, it allows no options (in which case
-it assigns the value of true to the variable), or it allows the values
-"<tt>true</tt>" or "<tt>false</tt>" to be specified, allowing any of the
-following inputs:</p>
-
-<div class="doc_code"><pre>
- compiler -f # No value, 'Force' == true
- compiler -f=true # Value specified, 'Force' == true
- compiler -f=TRUE # Value specified, 'Force' == true
- compiler -f=FALSE # Value specified, 'Force' == false
-</pre></div>
-
-<p>... you get the idea. The <a href="#boolparser">bool parser</a> just turns
-the string values into boolean values, and rejects things like '<tt>compiler
--f=foo</tt>'. Similarly, the <a href="#doubleparser">float</a>, <a
-href="#doubleparser">double</a>, and <a href="#intparser">int</a> parsers work
-like you would expect, using the '<tt>strtol</tt>' and '<tt>strtod</tt>' C
-library calls to parse the string value into the specified data type.</p>
-
-<p>With the declarations above, "<tt>compiler --help</tt>" emits this:</p>
-
-<div class="doc_code"><pre>
-USAGE: compiler [options] &lt;input file&gt;
-
-OPTIONS:
- <b>-f - Overwrite output files</b>
- -o - Override output filename
- <b>-quiet - Don't print informational messages</b>
- -help - display available options (--help-hidden for more)
-</pre></div>
-
-<p>and "<tt>compiler --help-hidden</tt>" prints this:</p>
-
-<div class="doc_code"><pre>
-USAGE: compiler [options] &lt;input file&gt;
-
-OPTIONS:
- -f - Overwrite output files
- -o - Override output filename
- <b>-q - Don't print informational messages</b>
- -quiet - Don't print informational messages
- -help - display available options (--help-hidden for more)
-</pre></div>
-
-<p>This brief example has shown you how to use the '<tt><a
-href="#cl::opt">cl::opt</a></tt>' class to parse simple scalar command line
-arguments. In addition to simple scalar arguments, the CommandLine library also
-provides primitives to support CommandLine option <a href="#alias">aliases</a>,
-and <a href="#list">lists</a> of options.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="alias">Argument Aliases</a>
-</div>
-
-<div class="doc_text">
-
-<p>So far, the example works well, except for the fact that we need to check the
-quiet condition like this now:</p>
-
-<div class="doc_code"><pre>
-...
- if (!Quiet &amp;&amp; !Quiet2) printInformationalMessage(...);
-...
-</pre></div>
-
-<p>... which is a real pain! Instead of defining two values for the same
-condition, we can use the "<tt><a href="#cl::alias">cl::alias</a></tt>" class to make the "<tt>-q</tt>"
-option an <b>alias</b> for the "<tt>-quiet</tt>" option, instead of providing
-a value itself:</p>
-
-<div class="doc_code"><pre>
-<a href="#cl::opt">cl::opt</a>&lt;bool&gt; Force ("<i>f</i>", <a href="#cl::desc">cl::desc</a>("<i>Overwrite output files</i>"));
-<a href="#cl::opt">cl::opt</a>&lt;bool&gt; Quiet ("<i>quiet</i>", <a href="#cl::desc">cl::desc</a>("<i>Don't print informational messages</i>"));
-<a href="#cl::alias">cl::alias</a> QuietA("<i>q</i>", <a href="#cl::desc">cl::desc</a>("<i>Alias for -quiet</i>"), <a href="#cl::aliasopt">cl::aliasopt</a>(Quiet));
-</pre></div>
-
-<p>The third line (which is the only one we modified from above) defines a
-"<tt>-q</tt>" alias that updates the "<tt>Quiet</tt>" variable (as specified by
-the <tt><a href="#cl::aliasopt">cl::aliasopt</a></tt> modifier) whenever it is
-specified. Because aliases do not hold state, the only thing the program has to
-query is the <tt>Quiet</tt> variable now. Another nice feature of aliases is
-that they automatically hide themselves from the <tt>-help</tt> output
-(although, again, they are still visible in the <tt>--help-hidden
-output</tt>).</p>
-
-<p>Now the application code can simply use:</p>
-
-<div class="doc_code"><pre>
-...
- if (!Quiet) printInformationalMessage(...);
-...
-</pre></div>
-
-<p>... which is much nicer! The "<tt><a href="#cl::alias">cl::alias</a></tt>"
-can be used to specify an alternative name for any variable type, and has many
-uses.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="onealternative">Selecting an alternative from a set of
- possibilities</a>
-</div>
-
-<div class="doc_text">
-
-<p>So far we have seen how the CommandLine library handles builtin types like
-<tt>std::string</tt>, <tt>bool</tt> and <tt>int</tt>, but how does it handle
-things it doesn't know about, like enums or '<tt>int*</tt>'s?</p>
-
-<p>The answer is that it uses a table-driven generic parser (unless you specify
-your own parser, as described in the <a href="#extensionguide">Extension
-Guide</a>). This parser maps literal strings to whatever type is required, and
-requires you to tell it what this mapping should be.</p>
-
-<p>Let's say that we would like to add four optimization levels to our
-optimizer, using the standard flags "<tt>-g</tt>", "<tt>-O0</tt>",
-"<tt>-O1</tt>", and "<tt>-O2</tt>". We could easily implement this with boolean
-options like above, but there are several problems with this strategy:</p>
-
-<ol>
-<li>A user could specify more than one of the options at a time, for example,
-"<tt>compiler -O3 -O2</tt>". The CommandLine library would not be able to
-catch this erroneous input for us.</li>
-
-<li>We would have to test 4 different variables to see which ones are set.</li>
-
-<li>This doesn't map to the numeric levels that we want... so we cannot easily
-see if some level &gt;= "<tt>-O1</tt>" is enabled.</li>
-
-</ol>
-
-<p>To cope with these problems, we can use an enum value, and have the
-CommandLine library fill it in with the appropriate level directly, which is
-used like this:</p>
-
-<div class="doc_code"><pre>
-enum OptLevel {
- g, O1, O2, O3
-};
-
-<a href="#cl::opt">cl::opt</a>&lt;OptLevel&gt; OptimizationLevel(<a href="#cl::desc">cl::desc</a>("<i>Choose optimization level:</i>"),
- <a href="#cl::values">cl::values</a>(
- clEnumVal(g , "<i>No optimizations, enable debugging</i>"),
- clEnumVal(O1, "<i>Enable trivial optimizations</i>"),
- clEnumVal(O2, "<i>Enable default optimizations</i>"),
- clEnumVal(O3, "<i>Enable expensive optimizations</i>"),
- clEnumValEnd));
-
-...
- if (OptimizationLevel &gt;= O2) doPartialRedundancyElimination(...);
-...
-</pre></div>
-
-<p>This declaration defines a variable "<tt>OptimizationLevel</tt>" of the
-"<tt>OptLevel</tt>" enum type. This variable can be assigned any of the values
-that are listed in the declaration (Note that the declaration list must be
-terminated with the "<tt>clEnumValEnd</tt>" argument!). The CommandLine
-library enforces
-that the user can only specify one of the options, and it ensure that only valid
-enum values can be specified. The "<tt>clEnumVal</tt>" macros ensure that the
-command line arguments matched the enum values. With this option added, our
-help output now is:</p>
-
-<div class="doc_code"><pre>
-USAGE: compiler [options] &lt;input file&gt;
-
-OPTIONS:
- <b>Choose optimization level:
- -g - No optimizations, enable debugging
- -O1 - Enable trivial optimizations
- -O2 - Enable default optimizations
- -O3 - Enable expensive optimizations</b>
- -f - Overwrite output files
- -help - display available options (--help-hidden for more)
- -o &lt;filename&gt; - Specify output filename
- -quiet - Don't print informational messages
-</pre></div>
-
-<p>In this case, it is sort of awkward that flag names correspond directly to
-enum names, because we probably don't want a enum definition named "<tt>g</tt>"
-in our program. Because of this, we can alternatively write this example like
-this:</p>
-
-<div class="doc_code"><pre>
-enum OptLevel {
- Debug, O1, O2, O3
-};
-
-<a href="#cl::opt">cl::opt</a>&lt;OptLevel&gt; OptimizationLevel(<a href="#cl::desc">cl::desc</a>("<i>Choose optimization level:</i>"),
- <a href="#cl::values">cl::values</a>(
- clEnumValN(Debug, "g", "<i>No optimizations, enable debugging</i>"),
- clEnumVal(O1 , "<i>Enable trivial optimizations</i>"),
- clEnumVal(O2 , "<i>Enable default optimizations</i>"),
- clEnumVal(O3 , "<i>Enable expensive optimizations</i>"),
- clEnumValEnd));
-
-...
- if (OptimizationLevel == Debug) outputDebugInfo(...);
-...
-</pre></div>
-
-<p>By using the "<tt>clEnumValN</tt>" macro instead of "<tt>clEnumVal</tt>", we
-can directly specify the name that the flag should get. In general a direct
-mapping is nice, but sometimes you can't or don't want to preserve the mapping,
-which is when you would use it.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="namedalternatives">Named Alternatives</a>
-</div>
-
-<div class="doc_text">
-
-<p>Another useful argument form is a named alternative style. We shall use this
-style in our compiler to specify different debug levels that can be used.
-Instead of each debug level being its own switch, we want to support the
-following options, of which only one can be specified at a time:
-"<tt>--debug-level=none</tt>", "<tt>--debug-level=quick</tt>",
-"<tt>--debug-level=detailed</tt>". To do this, we use the exact same format as
-our optimization level flags, but we also specify an option name. For this
-case, the code looks like this:</p>
-
-<div class="doc_code"><pre>
-enum DebugLev {
- nodebuginfo, quick, detailed
-};
-
-// Enable Debug Options to be specified on the command line
-<a href="#cl::opt">cl::opt</a>&lt;DebugLev&gt; DebugLevel("<i>debug_level</i>", <a href="#cl::desc">cl::desc</a>("<i>Set the debugging level:</i>"),
- <a href="#cl::values">cl::values</a>(
- clEnumValN(nodebuginfo, "none", "<i>disable debug information</i>"),
- clEnumVal(quick, "<i>enable quick debug information</i>"),
- clEnumVal(detailed, "<i>enable detailed debug information</i>"),
- clEnumValEnd));
-</pre></div>
-
-<p>This definition defines an enumerated command line variable of type "<tt>enum
-DebugLev</tt>", which works exactly the same way as before. The difference here
-is just the interface exposed to the user of your program and the help output by
-the "<tt>--help</tt>" option:</p>
-
-<div class="doc_code"><pre>
-USAGE: compiler [options] &lt;input file&gt;
-
-OPTIONS:
- Choose optimization level:
- -g - No optimizations, enable debugging
- -O1 - Enable trivial optimizations
- -O2 - Enable default optimizations
- -O3 - Enable expensive optimizations
- <b>-debug_level - Set the debugging level:
- =none - disable debug information
- =quick - enable quick debug information
- =detailed - enable detailed debug information</b>
- -f - Overwrite output files
- -help - display available options (--help-hidden for more)
- -o &lt;filename&gt; - Specify output filename
- -quiet - Don't print informational messages
-</pre></div>
-
-<p>Again, the only structural difference between the debug level declaration and
-the optimization level declaration is that the debug level declaration includes
-an option name (<tt>"debug_level"</tt>), which automatically changes how the
-library processes the argument. The CommandLine library supports both forms so
-that you can choose the form most appropriate for your application.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="list">Parsing a list of options</a>
-</div>
-
-<div class="doc_text">
-
-<p>Now that we have the standard run-of-the-mill argument types out of the way,
-lets get a little wild and crazy. Lets say that we want our optimizer to accept
-a <b>list</b> of optimizations to perform, allowing duplicates. For example, we
-might want to run: "<tt>compiler -dce -constprop -inline -dce -strip</tt>". In
-this case, the order of the arguments and the number of appearances is very
-important. This is what the "<tt><a href="#cl::list">cl::list</a></tt>"
-template is for. First, start by defining an enum of the optimizations that you
-would like to perform:</p>
-
-<div class="doc_code"><pre>
-enum Opts {
- // 'inline' is a C++ keyword, so name it 'inlining'
- dce, constprop, inlining, strip
-};
-</pre></div>
-
-<p>Then define your "<tt><a href="#cl::list">cl::list</a></tt>" variable:</p>
-
-<div class="doc_code"><pre>
-<a href="#cl::list">cl::list</a>&lt;Opts&gt; OptimizationList(<a href="#cl::desc">cl::desc</a>("<i>Available Optimizations:</i>"),
- <a href="#cl::values">cl::values</a>(
- clEnumVal(dce , "<i>Dead Code Elimination</i>"),
- clEnumVal(constprop , "<i>Constant Propagation</i>"),
- clEnumValN(inlining, "<i>inline</i>", "<i>Procedure Integration</i>"),
- clEnumVal(strip , "<i>Strip Symbols</i>"),
- clEnumValEnd));
-</pre></div>
-
-<p>This defines a variable that is conceptually of the type
-"<tt>std::vector&lt;enum Opts&gt;</tt>". Thus, you can access it with standard
-vector methods:</p>
-
-<div class="doc_code"><pre>
- for (unsigned i = 0; i != OptimizationList.size(); ++i)
- switch (OptimizationList[i])
- ...
-</pre></div>
-
-<p>... to iterate through the list of options specified.</p>
-
-<p>Note that the "<tt><a href="#cl::list">cl::list</a></tt>" template is
-completely general and may be used with any data types or other arguments that
-you can use with the "<tt><a href="#cl::opt">cl::opt</a></tt>" template. One
-especially useful way to use a list is to capture all of the positional
-arguments together if there may be more than one specified. In the case of a
-linker, for example, the linker takes several '<tt>.o</tt>' files, and needs to
-capture them into a list. This is naturally specified as:</p>
-
-<div class="doc_code"><pre>
-...
-<a href="#cl::list">cl::list</a>&lt;std::string&gt; InputFilenames(<a href="#cl::Positional">cl::Positional</a>, <a href="#cl::desc">cl::desc</a>("&lt;Input files&gt;"), <a href="#cl::OneOrMore">cl::OneOrMore</a>);
-...
-</pre></div>
-
-<p>This variable works just like a "<tt>vector&lt;string&gt;</tt>" object. As
-such, accessing the list is simple, just like above. In this example, we used
-the <tt><a href="#cl::OneOrMore">cl::OneOrMore</a></tt> modifier to inform the
-CommandLine library that it is an error if the user does not specify any
-<tt>.o</tt> files on our command line. Again, this just reduces the amount of
-checking we have to do.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="bits">Collecting options as a set of flags</a>
-</div>
-
-<div class="doc_text">
-
-<p>Instead of collecting sets of options in a list, it is also possible to
-gather information for enum values in a <b>bit vector</b>. The represention used by
-the <a href="#bits"><tt>cl::bits</tt></a> class is an <tt>unsigned</tt>
-integer. An enum value is represented by a 0/1 in the enum's ordinal value bit
-position. 1 indicating that the enum was specified, 0 otherwise. As each
-specified value is parsed, the resulting enum's bit is set in the option's bit
-vector:</p>
-
-<div class="doc_code"><pre>
- <i>bits</i> |= 1 << (unsigned)<i>enum</i>;
-</pre></div>
-
-<p>Options that are specified multiple times are redundant. Any instances after
-the first are discarded.</p>
-
-<p>Reworking the above list example, we could replace <a href="#list">
-<tt>cl::list</tt></a> with <a href="#bits"><tt>cl::bits</tt></a>:</p>
-
-<div class="doc_code"><pre>
-<a href="#cl::bits">cl::bits</a>&lt;Opts&gt; OptimizationBits(<a href="#cl::desc">cl::desc</a>("<i>Available Optimizations:</i>"),
- <a href="#cl::values">cl::values</a>(
- clEnumVal(dce , "<i>Dead Code Elimination</i>"),
- clEnumVal(constprop , "<i>Constant Propagation</i>"),
- clEnumValN(inlining, "<i>inline</i>", "<i>Procedure Integration</i>"),
- clEnumVal(strip , "<i>Strip Symbols</i>"),
- clEnumValEnd));
-</pre></div>
-
-<p>To test to see if <tt>constprop</tt> was specified, we can use the
-<tt>cl:bits::isSet</tt> function:</p>
-
-<div class="doc_code"><pre>
- if (OptimizationBits.isSet(constprop)) {
- ...
- }
-</pre></div>
-
-<p>It's also possible to get the raw bit vector using the
-<tt>cl::bits::getBits</tt> function:</p>
-
-<div class="doc_code"><pre>
- unsigned bits = OptimizationBits.getBits();
-</pre></div>
-
-<p>Finally, if external storage is used, then the location specified must be of
-<b>type</b> <tt>unsigned</tt>. In all other ways a <a
-href="#bits"><tt>cl::bits</tt></a> option is equivalent to a <a
-href="#list"> <tt>cl::list</tt></a> option.</p>
-
-</div>
-
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="description">Adding freeform text to help output</a>
-</div>
-
-<div class="doc_text">
-
-<p>As our program grows and becomes more mature, we may decide to put summary
-information about what it does into the help output. The help output is styled
-to look similar to a Unix <tt>man</tt> page, providing concise information about
-a program. Unix <tt>man</tt> pages, however often have a description about what
-the program does. To add this to your CommandLine program, simply pass a third
-argument to the <a
-href="#cl::ParseCommandLineOptions"><tt>cl::ParseCommandLineOptions</tt></a>
-call in main. This additional argument is then printed as the overview
-information for your program, allowing you to include any additional information
-that you want. For example:</p>
-
-<div class="doc_code"><pre>
-int main(int argc, char **argv) {
- <a href="#cl::ParseCommandLineOptions">cl::ParseCommandLineOptions</a>(argc, argv, " CommandLine compiler example\n\n"
- " This program blah blah blah...\n");
- ...
-}
-</pre></div>
-
-<p>would yield the help output:</p>
-
-<div class="doc_code"><pre>
-<b>OVERVIEW: CommandLine compiler example
-
- This program blah blah blah...</b>
-
-USAGE: compiler [options] &lt;input file&gt;
-
-OPTIONS:
- ...
- -help - display available options (--help-hidden for more)
- -o &lt;filename&gt; - Specify output filename
-</pre></div>
-
-</div>
-
-
-<!-- *********************************************************************** -->
-<div class="doc_section">
- <a name="referenceguide">Reference Guide</a>
-</div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>Now that you know the basics of how to use the CommandLine library, this
-section will give you the detailed information you need to tune how command line
-options work, as well as information on more "advanced" command line option
-processing capabilities.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="positional">Positional Arguments</a>
-</div>
-
-<div class="doc_text">
-
-<p>Positional arguments are those arguments that are not named, and are not
-specified with a hyphen. Positional arguments should be used when an option is
-specified by its position alone. For example, the standard Unix <tt>grep</tt>
-tool takes a regular expression argument, and an optional filename to search
-through (which defaults to standard input if a filename is not specified).
-Using the CommandLine library, this would be specified as:</p>
-
-<div class="doc_code"><pre>
-<a href="#cl::opt">cl::opt</a>&lt;string&gt; Regex (<a href="#cl::Positional">cl::Positional</a>, <a href="#cl::desc">cl::desc</a>("<i>&lt;regular expression&gt;</i>"), <a href="#cl::Required">cl::Required</a>);
-<a href="#cl::opt">cl::opt</a>&lt;string&gt; Filename(<a href="#cl::Positional">cl::Positional</a>, <a href="#cl::desc">cl::desc</a>("<i>&lt;input file&gt;</i>"), <a href="#cl::init">cl::init</a>("<i>-</i>"));
-</pre></div>
-
-<p>Given these two option declarations, the <tt>--help</tt> output for our grep
-replacement would look like this:</p>
-
-<div class="doc_code"><pre>
-USAGE: spiffygrep [options] <b>&lt;regular expression&gt; &lt;input file&gt;</b>
-
-OPTIONS:
- -help - display available options (--help-hidden for more)
-</pre></div>
-
-<p>... and the resultant program could be used just like the standard
-<tt>grep</tt> tool.</p>
-
-<p>Positional arguments are sorted by their order of construction. This means
-that command line options will be ordered according to how they are listed in a
-.cpp file, but will not have an ordering defined if the positional arguments
-are defined in multiple .cpp files. The fix for this problem is simply to
-define all of your positional arguments in one .cpp file.</p>
-
-</div>
-
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="--">Specifying positional options with hyphens</a>
-</div>
-
-<div class="doc_text">
-
-<p>Sometimes you may want to specify a value to your positional argument that
-starts with a hyphen (for example, searching for '<tt>-foo</tt>' in a file). At
-first, you will have trouble doing this, because it will try to find an argument
-named '<tt>-foo</tt>', and will fail (and single quotes will not save you).
-Note that the system <tt>grep</tt> has the same problem:</p>
-
-<div class="doc_code"><pre>
- $ spiffygrep '-foo' test.txt
- Unknown command line argument '-foo'. Try: spiffygrep --help'
-
- $ grep '-foo' test.txt
- grep: illegal option -- f
- grep: illegal option -- o
- grep: illegal option -- o
- Usage: grep -hblcnsviw pattern file . . .
-</pre></div>
-
-<p>The solution for this problem is the same for both your tool and the system
-version: use the '<tt>--</tt>' marker. When the user specifies '<tt>--</tt>' on
-the command line, it is telling the program that all options after the
-'<tt>--</tt>' should be treated as positional arguments, not options. Thus, we
-can use it like this:</p>
-
-<div class="doc_code"><pre>
- $ spiffygrep -- -foo test.txt
- ...output...
-</pre></div>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="getPosition">Determining absolute position with getPosition()</a>
-</div>
-<div class="doc_text">
- <p>Sometimes an option can affect or modify the meaning of another option. For
- example, consider <tt>gcc</tt>'s <tt>-x LANG</tt> option. This tells
- <tt>gcc</tt> to ignore the suffix of subsequent positional arguments and force
- the file to be interpreted as if it contained source code in language
- <tt>LANG</tt>. In order to handle this properly, you need to know the
- absolute position of each argument, especially those in lists, so their
- interaction(s) can be applied correctly. This is also useful for options like
- <tt>-llibname</tt> which is actually a positional argument that starts with
- a dash.</p>
- <p>So, generally, the problem is that you have two <tt>cl::list</tt> variables
- that interact in some way. To ensure the correct interaction, you can use the
- <tt>cl::list::getPosition(optnum)</tt> method. This method returns the
- absolute position (as found on the command line) of the <tt>optnum</tt>
- item in the <tt>cl::list</tt>.</p>
- <p>The idiom for usage is like this:</p>
-
- <div class="doc_code"><pre>
- static cl::list&lt;std::string&gt; Files(cl::Positional, cl::OneOrMore);
- static cl::list&lt;std::string&gt; Libraries("l", cl::ZeroOrMore);
-
- int main(int argc, char**argv) {
- // ...
- std::vector&lt;std::string&gt;::iterator fileIt = Files.begin();
- std::vector&lt;std::string&gt;::iterator libIt = Libraries.begin();
- unsigned libPos = 0, filePos = 0;
- while ( 1 ) {
- if ( libIt != Libraries.end() )
- libPos = Libraries.getPosition( libIt - Libraries.begin() );
- else
- libPos = 0;
- if ( fileIt != Files.end() )
- filePos = Files.getPosition( fileIt - Files.begin() );
- else
- filePos = 0;
-
- if ( filePos != 0 &amp;&amp; (libPos == 0 || filePos &lt; libPos) ) {
- // Source File Is next
- ++fileIt;
- }
- else if ( libPos != 0 &amp;&amp; (filePos == 0 || libPos &lt; filePos) ) {
- // Library is next
- ++libIt;
- }
- else
- break; // we're done with the list
- }
- }</pre></div>
-
- <p>Note that, for compatibility reasons, the <tt>cl::opt</tt> also supports an
- <tt>unsigned getPosition()</tt> option that will provide the absolute position
- of that option. You can apply the same approach as above with a
- <tt>cl::opt</tt> and a <tt>cl::list</tt> option as you can with two lists.</p>
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="cl::ConsumeAfter">The <tt>cl::ConsumeAfter</tt> modifier</a>
-</div>
-
-<div class="doc_text">
-
-<p>The <tt>cl::ConsumeAfter</tt> <a href="#formatting">formatting option</a> is
-used to construct programs that use "interpreter style" option processing. With
-this style of option processing, all arguments specified after the last
-positional argument are treated as special interpreter arguments that are not
-interpreted by the command line argument.</p>
-
-<p>As a concrete example, lets say we are developing a replacement for the
-standard Unix Bourne shell (<tt>/bin/sh</tt>). To run <tt>/bin/sh</tt>, first
-you specify options to the shell itself (like <tt>-x</tt> which turns on trace
-output), then you specify the name of the script to run, then you specify
-arguments to the script. These arguments to the script are parsed by the Bourne
-shell command line option processor, but are not interpreted as options to the
-shell itself. Using the CommandLine library, we would specify this as:</p>
-
-<div class="doc_code"><pre>
-<a href="#cl::opt">cl::opt</a>&lt;string&gt; Script(<a href="#cl::Positional">cl::Positional</a>, <a href="#cl::desc">cl::desc</a>("<i>&lt;input script&gt;</i>"), <a href="#cl::init">cl::init</a>("-"));
-<a href="#cl::list">cl::list</a>&lt;string&gt; Argv(<a href="#cl::ConsumeAfter">cl::ConsumeAfter</a>, <a href="#cl::desc">cl::desc</a>("<i>&lt;program arguments&gt;...</i>"));
-<a href="#cl::opt">cl::opt</a>&lt;bool&gt; Trace("<i>x</i>", <a href="#cl::desc">cl::desc</a>("<i>Enable trace output</i>"));
-</pre></div>
-
-<p>which automatically provides the help output:</p>
-
-<div class="doc_code"><pre>
-USAGE: spiffysh [options] <b>&lt;input script&gt; &lt;program arguments&gt;...</b>
-
-OPTIONS:
- -help - display available options (--help-hidden for more)
- <b>-x - Enable trace output</b>
-</pre></div>
-
-<p>At runtime, if we run our new shell replacement as `<tt>spiffysh -x test.sh
--a -x -y bar</tt>', the <tt>Trace</tt> variable will be set to true, the
-<tt>Script</tt> variable will be set to "<tt>test.sh</tt>", and the
-<tt>Argv</tt> list will contain <tt>["-a", "-x", "-y", "bar"]</tt>, because they
-were specified after the last positional argument (which is the script
-name).</p>
-
-<p>There are several limitations to when <tt>cl::ConsumeAfter</tt> options can
-be specified. For example, only one <tt>cl::ConsumeAfter</tt> can be specified
-per program, there must be at least one <a href="#positional">positional
-argument</a> specified, there must not be any <a href="#cl::list">cl::list</a>
-positional arguments, and the <tt>cl::ConsumeAfter</tt> option should be a <a
-href="#cl::list">cl::list</a> option.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="storage">Internal vs External Storage</a>
-</div>
-
-<div class="doc_text">
-
-<p>By default, all command line options automatically hold the value that they
-parse from the command line. This is very convenient in the common case,
-especially when combined with the ability to define command line options in the
-files that use them. This is called the internal storage model.</p>
-
-<p>Sometimes, however, it is nice to separate the command line option processing
-code from the storage of the value parsed. For example, lets say that we have a
-'<tt>-debug</tt>' option that we would like to use to enable debug information
-across the entire body of our program. In this case, the boolean value
-controlling the debug code should be globally accessable (in a header file, for
-example) yet the command line option processing code should not be exposed to
-all of these clients (requiring lots of .cpp files to #include
-<tt>CommandLine.h</tt>).</p>
-
-<p>To do this, set up your .h file with your option, like this for example:</p>
-
-<div class="doc_code">
-<pre>
-<i>// DebugFlag.h - Get access to the '-debug' command line option
-//
-
-// DebugFlag - This boolean is set to true if the '-debug' command line option
-// is specified. This should probably not be referenced directly, instead, use
-// the DEBUG macro below.
-//</i>
-extern bool DebugFlag;
-
-<i>// DEBUG macro - This macro should be used by code to emit debug information.
-// In the '-debug' option is specified on the command line, and if this is a
-// debug build, then the code specified as the option to the macro will be
-// executed. Otherwise it will not be.</i>
-<span class="doc_hilite">#ifdef NDEBUG
-#define DEBUG(X)
-#else
-#define DEBUG(X)</span> do { if (DebugFlag) { X; } } while (0)
-<span class="doc_hilite">#endif</span>
-</pre>
-</div>
-
-<p>This allows clients to blissfully use the <tt>DEBUG()</tt> macro, or the
-<tt>DebugFlag</tt> explicitly if they want to. Now we just need to be able to
-set the <tt>DebugFlag</tt> boolean when the option is set. To do this, we pass
-an additional argument to our command line argument processor, and we specify
-where to fill in with the <a href="#cl::location">cl::location</a>
-attribute:</p>
-
-<div class="doc_code">
-<pre>
-bool DebugFlag; <i>// the actual value</i>
-static <a href="#cl::opt">cl::opt</a>&lt;bool, true&gt; <i>// The parser</i>
-Debug("<i>debug</i>", <a href="#cl::desc">cl::desc</a>("<i>Enable debug output</i>"), <a href="#cl::Hidden">cl::Hidden</a>, <a href="#cl::location">cl::location</a>(DebugFlag));
-</pre>
-</div>
-
-<p>In the above example, we specify "<tt>true</tt>" as the second argument to
-the <tt><a href="#cl::opt">cl::opt</a></tt> template, indicating that the
-template should not maintain a copy of the value itself. In addition to this,
-we specify the <tt><a href="#cl::location">cl::location</a></tt> attribute, so
-that <tt>DebugFlag</tt> is automatically set.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="attributes">Option Attributes</a>
-</div>
-
-<div class="doc_text">
-
-<p>This section describes the basic attributes that you can specify on
-options.</p>
-
-<ul>
-
-<li>The option name attribute (which is required for all options, except <a
-href="#positional">positional options</a>) specifies what the option name is.
-This option is specified in simple double quotes:
-
-<pre>
-<a href="#cl::opt">cl::opt</a>&lt;<b>bool</b>&gt; Quiet("<i>quiet</i>");
-</pre>
-
-</li>
-
-<li><a name="cl::desc">The <b><tt>cl::desc</tt></b></a> attribute specifies a
-description for the option to be shown in the <tt>--help</tt> output for the
-program.</li>
-
-<li><a name="cl::value_desc">The <b><tt>cl::value_desc</tt></b></a> attribute
-specifies a string that can be used to fine tune the <tt>--help</tt> output for
-a command line option. Look <a href="#value_desc_example">here</a> for an
-example.</li>
-
-<li><a name="cl::init">The <b><tt>cl::init</tt></b></a> attribute specifies an
-inital value for a <a href="#cl::opt">scalar</a> option. If this attribute is
-not specified then the command line option value defaults to the value created
-by the default constructor for the type. <b>Warning</b>: If you specify both
-<b><tt>cl::init</tt></b> and <b><tt>cl::location</tt></b> for an option,
-you must specify <b><tt>cl::location</tt></b> first, so that when the
-command-line parser sees <b><tt>cl::init</tt></b>, it knows where to put the
-initial value. (You will get an error at runtime if you don't put them in
-the right order.)</li>
-
-<li><a name="cl::location">The <b><tt>cl::location</tt></b></a> attribute where to
-store the value for a parsed command line option if using external storage. See
-the section on <a href="#storage">Internal vs External Storage</a> for more
-information.</li>
-
-<li><a name="cl::aliasopt">The <b><tt>cl::aliasopt</tt></b></a> attribute
-specifies which option a <tt><a href="#cl::alias">cl::alias</a></tt> option is
-an alias for.</li>
-
-<li><a name="cl::values">The <b><tt>cl::values</tt></b></a> attribute specifies
-the string-to-value mapping to be used by the generic parser. It takes a
-<b>clEnumValEnd terminated</b> list of (option, value, description) triplets
-that
-specify the option name, the value mapped to, and the description shown in the
-<tt>--help</tt> for the tool. Because the generic parser is used most
-frequently with enum values, two macros are often useful:
-
-<ol>
-
-<li><a name="clEnumVal">The <b><tt>clEnumVal</tt></b></a> macro is used as a
-nice simple way to specify a triplet for an enum. This macro automatically
-makes the option name be the same as the enum name. The first option to the
-macro is the enum, the second is the description for the command line
-option.</li>
-
-<li><a name="clEnumValN">The <b><tt>clEnumValN</tt></b></a> macro is used to
-specify macro options where the option name doesn't equal the enum name. For
-this macro, the first argument is the enum value, the second is the flag name,
-and the second is the description.</li>
-
-</ol>
-
-You will get a compile time error if you try to use cl::values with a parser
-that does not support it.</li>
-
-</ul>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="modifiers">Option Modifiers</a>
-</div>
-
-<div class="doc_text">
-
-<p>Option modifiers are the flags and expressions that you pass into the
-constructors for <tt><a href="#cl::opt">cl::opt</a></tt> and <tt><a
-href="#cl::list">cl::list</a></tt>. These modifiers give you the ability to
-tweak how options are parsed and how <tt>--help</tt> output is generated to fit
-your application well.</p>
-
-<p>These options fall into five main catagories:</p>
-
-<ol>
-<li><a href="#hiding">Hiding an option from <tt>--help</tt> output</a></li>
-<li><a href="#numoccurrences">Controlling the number of occurrences
- required and allowed</a></li>
-<li><a href="#valrequired">Controlling whether or not a value must be
- specified</a></li>
-<li><a href="#formatting">Controlling other formatting options</a></li>
-<li><a href="#misc">Miscellaneous option modifiers</a></li>
-</ol>
-
-<p>It is not possible to specify two options from the same catagory (you'll get
-a runtime error) to a single option, except for options in the miscellaneous
-catagory. The CommandLine library specifies defaults for all of these settings
-that are the most useful in practice and the most common, which mean that you
-usually shouldn't have to worry about these.</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="hiding">Hiding an option from <tt>--help</tt> output</a>
-</div>
-
-<div class="doc_text">
-
-<p>The <tt>cl::NotHidden</tt>, <tt>cl::Hidden</tt>, and
-<tt>cl::ReallyHidden</tt> modifiers are used to control whether or not an option
-appears in the <tt>--help</tt> and <tt>--help-hidden</tt> output for the
-compiled program:</p>
-
-<ul>
-
-<li><a name="cl::NotHidden">The <b><tt>cl::NotHidden</tt></b></a> modifier
-(which is the default for <tt><a href="#cl::opt">cl::opt</a></tt> and <tt><a
-href="#cl::list">cl::list</a></tt> options) indicates the option is to appear
-in both help listings.</li>
-
-<li><a name="cl::Hidden">The <b><tt>cl::Hidden</tt></b></a> modifier (which is the
-default for <tt><a href="#cl::alias">cl::alias</a></tt> options) indicates that
-the option should not appear in the <tt>--help</tt> output, but should appear in
-the <tt>--help-hidden</tt> output.</li>
-
-<li><a name="cl::ReallyHidden">The <b><tt>cl::ReallyHidden</tt></b></a> modifier
-indicates that the option should not appear in any help output.</li>
-
-</ul>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="numoccurrences">Controlling the number of occurrences required and
- allowed</a>
-</div>
-
-<div class="doc_text">
-
-<p>This group of options is used to control how many time an option is allowed
-(or required) to be specified on the command line of your program. Specifying a
-value for this setting allows the CommandLine library to do error checking for
-you.</p>
-
-<p>The allowed values for this option group are:</p>
-
-<ul>
-
-<li><a name="cl::Optional">The <b><tt>cl::Optional</tt></b></a> modifier (which
-is the default for the <tt><a href="#cl::opt">cl::opt</a></tt> and <tt><a
-href="#cl::alias">cl::alias</a></tt> classes) indicates that your program will
-allow either zero or one occurrence of the option to be specified.</li>
-
-<li><a name="cl::ZeroOrMore">The <b><tt>cl::ZeroOrMore</tt></b></a> modifier
-(which is the default for the <tt><a href="#cl::list">cl::list</a></tt> class)
-indicates that your program will allow the option to be specified zero or more
-times.</li>
-
-<li><a name="cl::Required">The <b><tt>cl::Required</tt></b></a> modifier
-indicates that the specified option must be specified exactly one time.</li>
-
-<li><a name="cl::OneOrMore">The <b><tt>cl::OneOrMore</tt></b></a> modifier
-indicates that the option must be specified at least one time.</li>
-
-<li>The <b><tt>cl::ConsumeAfter</tt></b> modifier is described in the <a
-href="#positional">Positional arguments section</a>.</li>
-
-</ul>
-
-<p>If an option is not specified, then the value of the option is equal to the
-value specified by the <tt><a href="#cl::init">cl::init</a></tt> attribute. If
-the <tt><a href="#cl::init">cl::init</a></tt> attribute is not specified, the
-option value is initialized with the default constructor for the data type.</p>
-
-<p>If an option is specified multiple times for an option of the <tt><a
-href="#cl::opt">cl::opt</a></tt> class, only the last value will be
-retained.</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="valrequired">Controlling whether or not a value must be specified</a>
-</div>
-
-<div class="doc_text">
-
-<p>This group of options is used to control whether or not the option allows a
-value to be present. In the case of the CommandLine library, a value is either
-specified with an equal sign (e.g. '<tt>-index-depth=17</tt>') or as a trailing
-string (e.g. '<tt>-o a.out</tt>').</p>
-
-<p>The allowed values for this option group are:</p>
-
-<ul>
-
-<li><a name="cl::ValueOptional">The <b><tt>cl::ValueOptional</tt></b></a> modifier
-(which is the default for <tt>bool</tt> typed options) specifies that it is
-acceptable to have a value, or not. A boolean argument can be enabled just by
-appearing on the command line, or it can have an explicit '<tt>-foo=true</tt>'.
-If an option is specified with this mode, it is illegal for the value to be
-provided without the equal sign. Therefore '<tt>-foo true</tt>' is illegal. To
-get this behavior, you must use the <a
-href="#cl::ValueRequired">cl::ValueRequired</a> modifier.</li>
-
-<li><a name="cl::ValueRequired">The <b><tt>cl::ValueRequired</tt></b></a> modifier
-(which is the default for all other types except for <a
-href="#onealternative">unnamed alternatives using the generic parser</a>)
-specifies that a value must be provided. This mode informs the command line
-library that if an option is not provides with an equal sign, that the next
-argument provided must be the value. This allows things like '<tt>-o
-a.out</tt>' to work.</li>
-
-<li><a name="cl::ValueDisallowed">The <b><tt>cl::ValueDisallowed</tt></b></a>
-modifier (which is the default for <a href="#onealternative">unnamed
-alternatives using the generic parser</a>) indicates that it is a runtime error
-for the user to specify a value. This can be provided to disallow users from
-providing options to boolean options (like '<tt>-foo=true</tt>').</li>
-
-</ul>
-
-<p>In general, the default values for this option group work just like you would
-want them to. As mentioned above, you can specify the <a
-href="#cl::ValueDisallowed">cl::ValueDisallowed</a> modifier to a boolean
-argument to restrict your command line parser. These options are mostly useful
-when <a href="#extensionguide">extending the library</a>.</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="formatting">Controlling other formatting options</a>
-</div>
-
-<div class="doc_text">
-
-<p>The formatting option group is used to specify that the command line option
-has special abilities and is otherwise different from other command line
-arguments. As usual, you can only specify one of these arguments at most.</p>
-
-<ul>
-
-<li><a name="cl::NormalFormatting">The <b><tt>cl::NormalFormatting</tt></b></a>
-modifier (which is the default all options) specifies that this option is
-"normal".</li>
-
-<li><a name="cl::Positional">The <b><tt>cl::Positional</tt></b></a> modifier
-specifies that this is a positional argument that does not have a command line
-option associated with it. See the <a href="#positional">Positional
-Arguments</a> section for more information.</li>
-
-<li>The <b><a href="#cl::ConsumeAfter"><tt>cl::ConsumeAfter</tt></a></b> modifier
-specifies that this option is used to capture "interpreter style" arguments. See <a href="#cl::ConsumeAfter">this section for more information</a>.</li>
-
-<li><a name="cl::Prefix">The <b><tt>cl::Prefix</tt></b></a> modifier specifies
-that this option prefixes its value. With 'Prefix' options, the equal sign does
-not separate the value from the option name specified. Instead, the value is
-everything after the prefix, including any equal sign if present. This is useful
-for processing odd arguments like <tt>-lmalloc</tt> and <tt>-L/usr/lib</tt> in a
-linker tool or <tt>-DNAME=value</tt> in a compiler tool. Here, the
-'<tt>l</tt>', '<tt>D</tt>' and '<tt>L</tt>' options are normal string (or list)
-options, that have the <b><tt><a href="#cl::Prefix">cl::Prefix</a></tt></b>
-modifier added to allow the CommandLine library to recognize them. Note that
-<b><tt><a href="#cl::Prefix">cl::Prefix</a></tt></b> options must not have the
-<b><tt><a href="#cl::ValueDisallowed">cl::ValueDisallowed</a></tt></b> modifier
-specified.</li>
-
-<li><a name="cl::Grouping">The <b><tt>cl::Grouping</tt></b></a> modifier is used
-to implement Unix-style tools (like <tt>ls</tt>) that have lots of single letter
-arguments, but only require a single dash. For example, the '<tt>ls -labF</tt>'
-command actually enables four different options, all of which are single
-letters. Note that <b><tt><a href="#cl::Grouping">cl::Grouping</a></tt></b>
-options cannot have values.</li>
-
-</ul>
-
-<p>The CommandLine library does not restrict how you use the <b><tt><a
-href="#cl::Prefix">cl::Prefix</a></tt></b> or <b><tt><a
-href="#cl::Grouping">cl::Grouping</a></tt></b> modifiers, but it is possible to
-specify ambiguous argument settings. Thus, it is possible to have multiple
-letter options that are prefix or grouping options, and they will still work as
-designed.</p>
-
-<p>To do this, the CommandLine library uses a greedy algorithm to parse the
-input option into (potentially multiple) prefix and grouping options. The
-strategy basically looks like this:</p>
-
-<div class="doc_code"><tt>parse(string OrigInput) {</tt>
-
-<ol>
-<li><tt>string input = OrigInput;</tt>
-<li><tt>if (isOption(input)) return getOption(input).parse();</tt>&nbsp;&nbsp;&nbsp;&nbsp;<i>// Normal option</i>
-<li><tt>while (!isOption(input) &amp;&amp; !input.empty()) input.pop_back();</tt>&nbsp;&nbsp;&nbsp;&nbsp;<i>// Remove the last letter</i>
-<li><tt>if (input.empty()) return error();</tt>&nbsp;&nbsp;&nbsp;&nbsp;<i>// No matching option</i>
-<li><tt>if (getOption(input).isPrefix())<br>
-&nbsp;&nbsp;return getOption(input).parse(input);</tt>
-<li><tt>while (!input.empty()) {&nbsp;&nbsp;&nbsp;&nbsp;<i>// Must be grouping options</i><br>
-&nbsp;&nbsp;getOption(input).parse();<br>
-&nbsp;&nbsp;OrigInput.erase(OrigInput.begin(), OrigInput.begin()+input.length());<br>
-&nbsp;&nbsp;input = OrigInput;<br>
-&nbsp;&nbsp;while (!isOption(input) &amp;&amp; !input.empty()) input.pop_back();<br>
-}</tt>
-<li><tt>if (!OrigInput.empty()) error();</tt></li>
-</ol>
-
-<p><tt>}</tt></p>
-</div>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="misc">Miscellaneous option modifiers</a>
-</div>
-
-<div class="doc_text">
-
-<p>The miscellaneous option modifiers are the only flags where you can specify
-more than one flag from the set: they are not mutually exclusive. These flags
-specify boolean properties that modify the option.</p>
-
-<ul>
-
-<li><a name="cl::CommaSeparated">The <b><tt>cl::CommaSeparated</tt></b></a> modifier
-indicates that any commas specified for an option's value should be used to
-split the value up into multiple values for the option. For example, these two
-options are equivalent when <tt>cl::CommaSeparated</tt> is specified:
-"<tt>-foo=a -foo=b -foo=c</tt>" and "<tt>-foo=a,b,c</tt>". This option only
-makes sense to be used in a case where the option is allowed to accept one or
-more values (i.e. it is a <a href="#cl::list">cl::list</a> option).</li>
-
-<li><a name="cl::PositionalEatsArgs">The
-<b><tt>cl::PositionalEatsArgs</tt></b></a> modifier (which only applies to
-positional arguments, and only makes sense for lists) indicates that positional
-argument should consume any strings after it (including strings that start with
-a "-") up until another recognized positional argument. For example, if you
-have two "eating" positional arguments, "<tt>pos1</tt>" and "<tt>pos2</tt>", the
-string "<tt>-pos1 -foo -bar baz -pos2 -bork</tt>" would cause the "<tt>-foo -bar
--baz</tt>" strings to be applied to the "<tt>-pos1</tt>" option and the
-"<tt>-bork</tt>" string to be applied to the "<tt>-pos2</tt>" option.</li>
-
-<li><a name="cl::Sink">The <b><tt>cl::Sink</tt></b></a> modifier is
-used to handle unknown options. If there is at least one option with
-<b><tt>cl::Sink</tt></b></a> modifier specified, the parser passes
-unrecognized option strings to it as values instead of signaling an
-error. As with <b><tt>cl::CommaSeparated</tt></b></a>, this modifier
-only makes sense with a <a href="#cl::list">cl::list</a> option.</li>
-
-
-</ul>
-
-<p>So far, these are the only three miscellaneous option modifiers.</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="response">Response files</a>
-</div>
-
-<div class="doc_text">
-
-<p>Some systems, such as certain variants of Microsoft Windows and
-some older Unices have a relatively low limit on command-line
-length. It is therefore customary to use the so-called 'response
-files' to circumvent this restriction. These files are mentioned on
-the command-line (using the "@file") syntax. The program reads these
-files and inserts the contents into argv, thereby working around the
-command-line length limits. Response files are enabled by an optional
-fourth argument to
-<a href="#cl::ParseEnvironmentOptions"><tt>cl::ParseEnvironmentOptions</tt></a>
-and
-<a href="#cl::ParseCommandLineOptions"><tt>cl::ParseCommandLineOptions</tt></a>.
-</p>
-
-</div>
-
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="toplevel">Top-Level Classes and Functions</a>
-</div>
-
-<div class="doc_text">
-
-<p>Despite all of the built-in flexibility, the CommandLine option library
-really only consists of one function (<a
-href="#cl::ParseCommandLineOptions"><tt>cl::ParseCommandLineOptions</tt></a>)
-and three main classes: <a href="#cl::opt"><tt>cl::opt</tt></a>, <a
-href="#cl::list"><tt>cl::list</tt></a>, and <a
-href="#cl::alias"><tt>cl::alias</tt></a>. This section describes these three
-classes in detail.</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="cl::ParseCommandLineOptions">The <tt>cl::ParseCommandLineOptions</tt>
- function</a>
-</div>
-
-<div class="doc_text">
-
-<p>The <tt>cl::ParseCommandLineOptions</tt> function is designed to be called
-directly from <tt>main</tt>, and is used to fill in the values of all of the
-command line option variables once <tt>argc</tt> and <tt>argv</tt> are
-available.</p>
-
-<p>The <tt>cl::ParseCommandLineOptions</tt> function requires two parameters
-(<tt>argc</tt> and <tt>argv</tt>), but may also take an optional third parameter
-which holds <a href="#description">additional extra text</a> to emit when the
-<tt>--help</tt> option is invoked, and a fourth boolean parameter that enables
-<a href="#response">response files</a>.</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="cl::ParseEnvironmentOptions">The <tt>cl::ParseEnvironmentOptions</tt>
- function</a>
-</div>
-
-<div class="doc_text">
-
-<p>The <tt>cl::ParseEnvironmentOptions</tt> function has mostly the same effects
-as <a
-href="#cl::ParseCommandLineOptions"><tt>cl::ParseCommandLineOptions</tt></a>,
-except that it is designed to take values for options from an environment
-variable, for those cases in which reading the command line is not convenient or
-desired. It fills in the values of all the command line option variables just
-like <a
-href="#cl::ParseCommandLineOptions"><tt>cl::ParseCommandLineOptions</tt></a>
-does.</p>
-
-<p>It takes four parameters: the name of the program (since <tt>argv</tt> may
-not be available, it can't just look in <tt>argv[0]</tt>), the name of the
-environment variable to examine, the optional
-<a href="#description">additional extra text</a> to emit when the
-<tt>--help</tt> option is invoked, and the boolean
-switch that controls whether <a href="#response">reponse files</a>
-should be read.</p>
-
-<p><tt>cl::ParseEnvironmentOptions</tt> will break the environment
-variable's value up into words and then process them using
-<a href="#cl::ParseCommandLineOptions"><tt>cl::ParseCommandLineOptions</tt></a>.
-<b>Note:</b> Currently <tt>cl::ParseEnvironmentOptions</tt> does not support
-quoting, so an environment variable containing <tt>-option "foo bar"</tt> will
-be parsed as three words, <tt>-option</tt>, <tt>"foo</tt>, and <tt>bar"</tt>,
-which is different from what you would get from the shell with the same
-input.</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="cl::SetVersionPrinter">The <tt>cl::SetVersionPrinter</tt>
- function</a>
-</div>
-
-<div class="doc_text">
-
-<p>The <tt>cl::SetVersionPrinter</tt> function is designed to be called
-directly from <tt>main</tt> and <i>before</i>
-<tt>cl::ParseCommandLineOptions</tt>. Its use is optional. It simply arranges
-for a function to be called in response to the <tt>--version</tt> option instead
-of having the <tt>CommandLine</tt> library print out the usual version string
-for LLVM. This is useful for programs that are not part of LLVM but wish to use
-the <tt>CommandLine</tt> facilities. Such programs should just define a small
-function that takes no arguments and returns <tt>void</tt> and that prints out
-whatever version information is appropriate for the program. Pass the address
-of that function to <tt>cl::SetVersionPrinter</tt> to arrange for it to be
-called when the <tt>--version</tt> option is given by the user.</p>
-
-</div>
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="cl::opt">The <tt>cl::opt</tt> class</a>
-</div>
-
-<div class="doc_text">
-
-<p>The <tt>cl::opt</tt> class is the class used to represent scalar command line
-options, and is the one used most of the time. It is a templated class which
-can take up to three arguments (all except for the first have default values
-though):</p>
-
-<div class="doc_code"><pre>
-<b>namespace</b> cl {
- <b>template</b> &lt;<b>class</b> DataType, <b>bool</b> ExternalStorage = <b>false</b>,
- <b>class</b> ParserClass = parser&lt;DataType&gt; &gt;
- <b>class</b> opt;
-}
-</pre></div>
-
-<p>The first template argument specifies what underlying data type the command
-line argument is, and is used to select a default parser implementation. The
-second template argument is used to specify whether the option should contain
-the storage for the option (the default) or whether external storage should be
-used to contain the value parsed for the option (see <a href="#storage">Internal
-vs External Storage</a> for more information).</p>
-
-<p>The third template argument specifies which parser to use. The default value
-selects an instantiation of the <tt>parser</tt> class based on the underlying
-data type of the option. In general, this default works well for most
-applications, so this option is only used when using a <a
-href="#customparser">custom parser</a>.</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="cl::list">The <tt>cl::list</tt> class</a>
-</div>
-
-<div class="doc_text">
-
-<p>The <tt>cl::list</tt> class is the class used to represent a list of command
-line options. It too is a templated class which can take up to three
-arguments:</p>
-
-<div class="doc_code"><pre>
-<b>namespace</b> cl {
- <b>template</b> &lt;<b>class</b> DataType, <b>class</b> Storage = <b>bool</b>,
- <b>class</b> ParserClass = parser&lt;DataType&gt; &gt;
- <b>class</b> list;
-}
-</pre></div>
-
-<p>This class works the exact same as the <a
-href="#cl::opt"><tt>cl::opt</tt></a> class, except that the second argument is
-the <b>type</b> of the external storage, not a boolean value. For this class,
-the marker type '<tt>bool</tt>' is used to indicate that internal storage should
-be used.</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="cl::bits">The <tt>cl::bits</tt> class</a>
-</div>
-
-<div class="doc_text">
-
-<p>The <tt>cl::bits</tt> class is the class used to represent a list of command
-line options in the form of a bit vector. It is also a templated class which
-can take up to three arguments:</p>
-
-<div class="doc_code"><pre>
-<b>namespace</b> cl {
- <b>template</b> &lt;<b>class</b> DataType, <b>class</b> Storage = <b>bool</b>,
- <b>class</b> ParserClass = parser&lt;DataType&gt; &gt;
- <b>class</b> bits;
-}
-</pre></div>
-
-<p>This class works the exact same as the <a
-href="#cl::opt"><tt>cl::lists</tt></a> class, except that the second argument
-must be of <b>type</b> <tt>unsigned</tt> if external storage is used.</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="cl::alias">The <tt>cl::alias</tt> class</a>
-</div>
-
-<div class="doc_text">
-
-<p>The <tt>cl::alias</tt> class is a nontemplated class that is used to form
-aliases for other arguments.</p>
-
-<div class="doc_code"><pre>
-<b>namespace</b> cl {
- <b>class</b> alias;
-}
-</pre></div>
-
-<p>The <a href="#cl::aliasopt"><tt>cl::aliasopt</tt></a> attribute should be
-used to specify which option this is an alias for. Alias arguments default to
-being <a href="#cl::Hidden">Hidden</a>, and use the aliased options parser to do
-the conversion from string to data.</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="cl::extrahelp">The <tt>cl::extrahelp</tt> class</a>
-</div>
-
-<div class="doc_text">
-
-<p>The <tt>cl::extrahelp</tt> class is a nontemplated class that allows extra
-help text to be printed out for the <tt>--help</tt> option.</p>
-
-<div class="doc_code"><pre>
-<b>namespace</b> cl {
- <b>struct</b> extrahelp;
-}
-</pre></div>
-
-<p>To use the extrahelp, simply construct one with a <tt>const char*</tt>
-parameter to the constructor. The text passed to the constructor will be printed
-at the bottom of the help message, verbatim. Note that multiple
-<tt>cl::extrahelp</tt> <b>can</b> be used, but this practice is discouraged. If
-your tool needs to print additional help information, put all that help into a
-single <tt>cl::extrahelp</tt> instance.</p>
-<p>For example:</p>
-<div class="doc_code"><pre>
- cl::extrahelp("\nADDITIONAL HELP:\n\n This is the extra help\n");
-</pre></div>
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="builtinparsers">Builtin parsers</a>
-</div>
-
-<div class="doc_text">
-
-<p>Parsers control how the string value taken from the command line is
-translated into a typed value, suitable for use in a C++ program. By default,
-the CommandLine library uses an instance of <tt>parser&lt;type&gt;</tt> if the
-command line option specifies that it uses values of type '<tt>type</tt>'.
-Because of this, custom option processing is specified with specializations of
-the '<tt>parser</tt>' class.</p>
-
-<p>The CommandLine library provides the following builtin parser
-specializations, which are sufficient for most applications. It can, however,
-also be extended to work with new data types and new ways of interpreting the
-same data. See the <a href="#customparser">Writing a Custom Parser</a> for more
-details on this type of library extension.</p>
-
-<ul>
-
-<li><a name="genericparser">The <b>generic <tt>parser&lt;t&gt;</tt> parser</b></a>
-can be used to map strings values to any data type, through the use of the <a
-href="#cl::values">cl::values</a> property, which specifies the mapping
-information. The most common use of this parser is for parsing enum values,
-which allows you to use the CommandLine library for all of the error checking to
-make sure that only valid enum values are specified (as opposed to accepting
-arbitrary strings). Despite this, however, the generic parser class can be used
-for any data type.</li>
-
-<li><a name="boolparser">The <b><tt>parser&lt;bool&gt;</tt> specialization</b></a>
-is used to convert boolean strings to a boolean value. Currently accepted
-strings are "<tt>true</tt>", "<tt>TRUE</tt>", "<tt>True</tt>", "<tt>1</tt>",
-"<tt>false</tt>", "<tt>FALSE</tt>", "<tt>False</tt>", and "<tt>0</tt>".</li>
-
-<li><a name="boolOrDefaultparser">The <b><tt>parser&lt;boolOrDefault&gt;</tt>
- specialization</b></a> is used for cases where the value is boolean,
-but we also need to know whether the option was specified at all. boolOrDefault
-is an enum with 3 values, BOU_UNSET, BOU_TRUE and BOU_FALSE. This parser accepts
-the same strings as <b><tt>parser&lt;bool&gt;</tt></b>.</li>
-
-<li><a name="stringparser">The <b><tt>parser&lt;string&gt;</tt>
-specialization</b></a> simply stores the parsed string into the string value
-specified. No conversion or modification of the data is performed.</li>
-
-<li><a name="intparser">The <b><tt>parser&lt;int&gt;</tt> specialization</b></a>
-uses the C <tt>strtol</tt> function to parse the string input. As such, it will
-accept a decimal number (with an optional '+' or '-' prefix) which must start
-with a non-zero digit. It accepts octal numbers, which are identified with a
-'<tt>0</tt>' prefix digit, and hexadecimal numbers with a prefix of
-'<tt>0x</tt>' or '<tt>0X</tt>'.</li>
-
-<li><a name="doubleparser">The <b><tt>parser&lt;double&gt;</tt></b></a> and
-<b><tt>parser&lt;float&gt;</tt> specializations</b> use the standard C
-<tt>strtod</tt> function to convert floating point strings into floating point
-values. As such, a broad range of string formats is supported, including
-exponential notation (ex: <tt>1.7e15</tt>) and properly supports locales.
-</li>
-
-</ul>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section">
- <a name="extensionguide">Extension Guide</a>
-</div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>Although the CommandLine library has a lot of functionality built into it
-already (as discussed previously), one of its true strengths lie in its
-extensibility. This section discusses how the CommandLine library works under
-the covers and illustrates how to do some simple, common, extensions.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="customparser">Writing a custom parser</a>
-</div>
-
-<div class="doc_text">
-
-<p>One of the simplest and most common extensions is the use of a custom parser.
-As <a href="#builtinparsers">discussed previously</a>, parsers are the portion
-of the CommandLine library that turns string input from the user into a
-particular parsed data type, validating the input in the process.</p>
-
-<p>There are two ways to use a new parser:</p>
-
-<ol>
-
-<li>
-
-<p>Specialize the <a href="#genericparser"><tt>cl::parser</tt></a> template for
-your custom data type.<p>
-
-<p>This approach has the advantage that users of your custom data type will
-automatically use your custom parser whenever they define an option with a value
-type of your data type. The disadvantage of this approach is that it doesn't
-work if your fundamental data type is something that is already supported.</p>
-
-</li>
-
-<li>
-
-<p>Write an independent class, using it explicitly from options that need
-it.</p>
-
-<p>This approach works well in situations where you would line to parse an
-option using special syntax for a not-very-special data-type. The drawback of
-this approach is that users of your parser have to be aware that they are using
-your parser instead of the builtin ones.</p>
-
-</li>
-
-</ol>
-
-<p>To guide the discussion, we will discuss a custom parser that accepts file
-sizes, specified with an optional unit after the numeric size. For example, we
-would like to parse "102kb", "41M", "1G" into the appropriate integer value. In
-this case, the underlying data type we want to parse into is
-'<tt>unsigned</tt>'. We choose approach #2 above because we don't want to make
-this the default for all <tt>unsigned</tt> options.</p>
-
-<p>To start out, we declare our new <tt>FileSizeParser</tt> class:</p>
-
-<div class="doc_code"><pre>
-<b>struct</b> FileSizeParser : <b>public</b> cl::basic_parser&lt;<b>unsigned</b>&gt; {
- <i>// parse - Return true on error.</i>
- <b>bool</b> parse(cl::Option &amp;O, <b>const char</b> *ArgName, <b>const</b> std::string &amp;ArgValue,
- <b>unsigned</b> &amp;Val);
-};
-</pre></div>
-
-<p>Our new class inherits from the <tt>cl::basic_parser</tt> template class to
-fill in the default, boiler plate code for us. We give it the data type that
-we parse into, the last argument to the <tt>parse</tt> method, so that clients of
-our custom parser know what object type to pass in to the parse method. (Here we
-declare that we parse into '<tt>unsigned</tt>' variables.)</p>
-
-<p>For most purposes, the only method that must be implemented in a custom
-parser is the <tt>parse</tt> method. The <tt>parse</tt> method is called
-whenever the option is invoked, passing in the option itself, the option name,
-the string to parse, and a reference to a return value. If the string to parse
-is not well-formed, the parser should output an error message and return true.
-Otherwise it should return false and set '<tt>Val</tt>' to the parsed value. In
-our example, we implement <tt>parse</tt> as:</p>
-
-<div class="doc_code"><pre>
-<b>bool</b> FileSizeParser::parse(cl::Option &amp;O, <b>const char</b> *ArgName,
- <b>const</b> std::string &amp;Arg, <b>unsigned</b> &amp;Val) {
- <b>const char</b> *ArgStart = Arg.c_str();
- <b>char</b> *End;
-
- <i>// Parse integer part, leaving 'End' pointing to the first non-integer char</i>
- Val = (unsigned)strtol(ArgStart, &amp;End, 0);
-
- <b>while</b> (1) {
- <b>switch</b> (*End++) {
- <b>case</b> 0: <b>return</b> false; <i>// No error</i>
- <b>case</b> 'i': <i>// Ignore the 'i' in KiB if people use that</i>
- <b>case</b> 'b': <b>case</b> 'B': <i>// Ignore B suffix</i>
- <b>break</b>;
-
- <b>case</b> 'g': <b>case</b> 'G': Val *= 1024*1024*1024; <b>break</b>;
- <b>case</b> 'm': <b>case</b> 'M': Val *= 1024*1024; <b>break</b>;
- <b>case</b> 'k': <b>case</b> 'K': Val *= 1024; <b>break</b>;
-
- default:
- <i>// Print an error message if unrecognized character!</i>
- <b>return</b> O.error(": '" + Arg + "' value invalid for file size argument!");
- }
- }
-}
-</pre></div>
-
-<p>This function implements a very simple parser for the kinds of strings we are
-interested in. Although it has some holes (it allows "<tt>123KKK</tt>" for
-example), it is good enough for this example. Note that we use the option
-itself to print out the error message (the <tt>error</tt> method always returns
-true) in order to get a nice error message (shown below). Now that we have our
-parser class, we can use it like this:</p>
-
-<div class="doc_code"><pre>
-<b>static</b> <a href="#cl::opt">cl::opt</a>&lt;<b>unsigned</b>, <b>false</b>, FileSizeParser&gt;
-MFS(<i>"max-file-size"</i>, <a href="#cl::desc">cl::desc</a>(<i>"Maximum file size to accept"</i>),
- <a href="#cl::value_desc">cl::value_desc</a>("<i>size</i>"));
-</pre></div>
-
-<p>Which adds this to the output of our program:</p>
-
-<div class="doc_code"><pre>
-OPTIONS:
- -help - display available options (--help-hidden for more)
- ...
- <b>-max-file-size=&lt;size&gt; - Maximum file size to accept</b>
-</pre></div>
-
-<p>And we can test that our parse works correctly now (the test program just
-prints out the max-file-size argument value):</p>
-
-<div class="doc_code"><pre>
-$ ./test
-MFS: 0
-$ ./test -max-file-size=123MB
-MFS: 128974848
-$ ./test -max-file-size=3G
-MFS: 3221225472
-$ ./test -max-file-size=dog
--max-file-size option: 'dog' value invalid for file size argument!
-</pre></div>
-
-<p>It looks like it works. The error message that we get is nice and helpful,
-and we seem to accept reasonable file sizes. This wraps up the "custom parser"
-tutorial.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="explotingexternal">Exploiting external storage</a>
-</div>
-
-<div class="doc_text">
- <p>Several of the LLVM libraries define static <tt>cl::opt</tt> instances that
- will automatically be included in any program that links with that library.
- This is a feature. However, sometimes it is necessary to know the value of the
- command line option outside of the library. In these cases the library does or
- should provide an external storage location that is accessible to users of the
- library. Examples of this include the <tt>llvm::DebugFlag</tt> exported by the
- <tt>lib/Support/Debug.cpp</tt> file and the <tt>llvm::TimePassesIsEnabled</tt>
- flag exported by the <tt>lib/VMCore/Pass.cpp</tt> file.</p>
-
-<p>TODO: complete this section</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="dynamicopts">Dynamically adding command line options</a>
-</div>
-
-<div class="doc_text">
-
-<p>TODO: fill in this section</p>
-
-</div>
-
-<!-- *********************************************************************** -->
-
-<hr>
-<address>
- <a href="http://jigsaw.w3.org/css-validator/check/referer"><img
- src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"></a>
- <a href="http://validator.w3.org/check/referer"><img
- src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!"></a>
-
- <a href="mailto:sabre@nondot.org">Chris Lattner</a><br>
- <a href="http://llvm.org">LLVM Compiler Infrastructure</a><br>
- Last modified: $Date$
-</address>
-
-</body>
-</html>
diff --git a/release_23/docs/CompilerDriver.html b/release_23/docs/CompilerDriver.html
deleted file mode 100644
index dd7526753df6..000000000000
--- a/release_23/docs/CompilerDriver.html
+++ /dev/null
@@ -1,420 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<meta name="generator" content="Docutils 0.4: http://docutils.sourceforge.net/" />
-<title>Customizing LLVMC: Reference Manual</title>
-<link rel="stylesheet" href="llvm.css" type="text/css" />
-</head>
-<body>
-<div class="document" id="customizing-llvmc-reference-manual">
-
-<div class="doc_title">Customizing LLVMC: Reference Manual</div>
-
-<div class="doc_warning">
- <p>Note: This document is a work-in-progress. Additions and clarifications
- are welcome.</p>
-</div>
-
-<p>LLVMC is a generic compiler driver, designed to be customizable and
-extensible. It plays the same role for LLVM as the <tt class="docutils literal"><span class="pre">gcc</span></tt> program
-does for GCC - LLVMC's job is essentially to transform a set of input
-files into a set of targets depending on configuration rules and user
-options. What makes LLVMC different is that these transformation rules
-are completely customizable - in fact, LLVMC knows nothing about the
-specifics of transformation (even the command-line options are mostly
-not hard-coded) and regards the transformation structure as an
-abstract graph. This makes it possible to adapt LLVMC for other
-purposes - for example, as a build tool for game resources.</p>
-<p>Because LLVMC employs TableGen <a class="footnote-reference" href="#id2" id="id1" name="id1">[1]</a> as its configuration language, you
-need to be familiar with it to customize LLVMC.</p>
-<div class="contents topic">
-<ul class="simple">
-<li><a class="reference" href="#compiling-with-llvmc" id="id3" name="id3">Compiling with LLVMC</a></li>
-<li><a class="reference" href="#predefined-options" id="id4" name="id4">Predefined options</a></li>
-<li><a class="reference" href="#customizing-llvmc-the-compilation-graph" id="id5" name="id5">Customizing LLVMC: the compilation graph</a></li>
-<li><a class="reference" href="#writing-a-tool-description" id="id6" name="id6">Writing a tool description</a></li>
-<li><a class="reference" href="#option-list-specifying-all-options-in-a-single-place" id="id7" name="id7">Option list - specifying all options in a single place</a></li>
-<li><a class="reference" href="#using-hooks-and-environment-variables-in-the-cmd-line-property" id="id8" name="id8">Using hooks and environment variables in the <tt class="docutils literal"><span class="pre">cmd_line</span></tt> property</a></li>
-<li><a class="reference" href="#conditional-evaluation-the-case-expression" id="id9" name="id9">Conditional evaluation: the <tt class="docutils literal"><span class="pre">case</span></tt> expression</a></li>
-<li><a class="reference" href="#language-map" id="id10" name="id10">Language map</a></li>
-<li><a class="reference" href="#references" id="id11" name="id11">References</a></li>
-</ul>
-</div>
-
-<div class="doc_author">Written by Mikhail Glushenkov</div>
-
-<div class="doc_text">
-<div class="doc_section"><a class="toc-backref" href="#id3" id="compiling-with-llvmc" name="compiling-with-llvmc">Compiling with LLVMC</a></div>
-<p>LLVMC tries hard to be as compatible with <tt class="docutils literal"><span class="pre">gcc</span></tt> as possible,
-although there are some small differences. Most of the time, however,
-you shouldn't be able to notice them:</p>
-<pre class="literal-block">
-$ # This works as expected:
-$ llvmc2 -O3 -Wall hello.cpp
-$ ./a.out
-hello
-</pre>
-<p>One nice feature of LLVMC is that one doesn't have to distinguish
-between different compilers for different languages (think <tt class="docutils literal"><span class="pre">g++</span></tt> and
-<tt class="docutils literal"><span class="pre">gcc</span></tt>) - the right toolchain is chosen automatically based on input
-language names (which are, in turn, determined from file
-extensions). If you want to force files ending with &quot;.c&quot; to compile as
-C++, use the <tt class="docutils literal"><span class="pre">-x</span></tt> option, just like you would do it with <tt class="docutils literal"><span class="pre">gcc</span></tt>:</p>
-<pre class="literal-block">
-$ llvmc2 -x c hello.cpp
-$ # hello.cpp is really a C file
-$ ./a.out
-hello
-</pre>
-<p>On the other hand, when using LLVMC as a linker to combine several C++
-object files you should provide the <tt class="docutils literal"><span class="pre">--linker</span></tt> option since it's
-impossible for LLVMC to choose the right linker in that case:</p>
-<pre class="literal-block">
-$ llvmc2 -c hello.cpp
-$ llvmc2 hello.o
-[A lot of link-time errors skipped]
-$ llvmc2 --linker=c++ hello.o
-$ ./a.out
-hello
-</pre>
-</div>
-<div class="doc_text">
-<div class="doc_section"><a class="toc-backref" href="#id4" id="predefined-options" name="predefined-options">Predefined options</a></div>
-<p>LLVMC has some built-in options that can't be overridden in the
-configuration files:</p>
-<ul class="simple">
-<li><tt class="docutils literal"><span class="pre">-o</span> <span class="pre">FILE</span></tt> - Output file name.</li>
-<li><tt class="docutils literal"><span class="pre">-x</span> <span class="pre">LANGUAGE</span></tt> - Specify the language of the following input files
-until the next -x option.</li>
-<li><tt class="docutils literal"><span class="pre">-v</span></tt> - Enable verbose mode, i.e. print out all executed commands.</li>
-<li><tt class="docutils literal"><span class="pre">--view-graph</span></tt> - Show a graphical representation of the compilation
-graph. Requires that you have <tt class="docutils literal"><span class="pre">dot</span></tt> and <tt class="docutils literal"><span class="pre">gv</span></tt> commands
-installed. Hidden option, useful for debugging.</li>
-<li><tt class="docutils literal"><span class="pre">--write-graph</span></tt> - Write a <tt class="docutils literal"><span class="pre">compilation-graph.dot</span></tt> file in the
-current directory with the compilation graph description in the
-Graphviz format. Hidden option, useful for debugging.</li>
-<li><tt class="docutils literal"><span class="pre">--save-temps</span></tt> - Write temporary files to the current directory
-and do not delete them on exit. Hidden option, useful for debugging.</li>
-<li><tt class="docutils literal"><span class="pre">--help</span></tt>, <tt class="docutils literal"><span class="pre">--help-hidden</span></tt>, <tt class="docutils literal"><span class="pre">--version</span></tt> - These options have
-their standard meaning.</li>
-</ul>
-</div>
-<div class="doc_text">
-<div class="doc_section"><a class="toc-backref" href="#id5" id="customizing-llvmc-the-compilation-graph" name="customizing-llvmc-the-compilation-graph">Customizing LLVMC: the compilation graph</a></div>
-<p>At the time of writing LLVMC does not support on-the-fly reloading of
-configuration, so to customize LLVMC you'll have to recompile the
-source code (which lives under <tt class="docutils literal"><span class="pre">$LLVM_DIR/tools/llvmc2</span></tt>). The
-default configuration files are <tt class="docutils literal"><span class="pre">Common.td</span></tt> (contains common
-definitions, don't forget to <tt class="docutils literal"><span class="pre">include</span></tt> it in your configuration
-files), <tt class="docutils literal"><span class="pre">Tools.td</span></tt> (tool descriptions) and <tt class="docutils literal"><span class="pre">Graph.td</span></tt> (compilation
-graph definition).</p>
-<p>To compile LLVMC with your own configuration file (say,``MyGraph.td``),
-run <tt class="docutils literal"><span class="pre">make</span></tt> like this:</p>
-<pre class="literal-block">
-$ cd $LLVM_DIR/tools/llvmc2
-$ make GRAPH=MyGraph.td TOOLNAME=my_llvmc
-</pre>
-<p>This will build an executable named <tt class="docutils literal"><span class="pre">my_llvmc</span></tt>. There are also
-several sample configuration files in the <tt class="docutils literal"><span class="pre">llvmc2/examples</span></tt>
-subdirectory that should help to get you started.</p>
-<p>Internally, LLVMC stores information about possible source
-transformations in form of a graph. Nodes in this graph represent
-tools, and edges between two nodes represent a transformation path. A
-special &quot;root&quot; node is used to mark entry points for the
-transformations. LLVMC also assigns a weight to each edge (more on
-this later) to choose between several alternative edges.</p>
-<p>The definition of the compilation graph (see file <tt class="docutils literal"><span class="pre">Graph.td</span></tt>) is
-just a list of edges:</p>
-<pre class="literal-block">
-def CompilationGraph : CompilationGraph&lt;[
- Edge&lt;root, llvm_gcc_c&gt;,
- Edge&lt;root, llvm_gcc_assembler&gt;,
- ...
-
- Edge&lt;llvm_gcc_c, llc&gt;,
- Edge&lt;llvm_gcc_cpp, llc&gt;,
- ...
-
- OptionalEdge&lt;llvm_gcc_c, opt, [(switch_on &quot;opt&quot;)]&gt;,
- OptionalEdge&lt;llvm_gcc_cpp, opt, [(switch_on &quot;opt&quot;)]&gt;,
- ...
-
- OptionalEdge&lt;llvm_gcc_assembler, llvm_gcc_cpp_linker,
- (case (input_languages_contain &quot;c++&quot;), (inc_weight),
- (or (parameter_equals &quot;linker&quot;, &quot;g++&quot;),
- (parameter_equals &quot;linker&quot;, &quot;c++&quot;)), (inc_weight))&gt;,
- ...
-
- ]&gt;;
-</pre>
-<p>As you can see, the edges can be either default or optional, where
-optional edges are differentiated by sporting a <tt class="docutils literal"><span class="pre">case</span></tt> expression
-used to calculate the edge's weight.</p>
-<p>The default edges are assigned a weight of 1, and optional edges get a
-weight of 0 + 2*N where N is the number of tests that evaluated to
-true in the <tt class="docutils literal"><span class="pre">case</span></tt> expression. It is also possible to provide an
-integer parameter to <tt class="docutils literal"><span class="pre">inc_weight</span></tt> and <tt class="docutils literal"><span class="pre">dec_weight</span></tt> - in this case,
-the weight is increased (or decreased) by the provided value instead
-of the default 2.</p>
-<p>When passing an input file through the graph, LLVMC picks the edge
-with the maximum weight. To avoid ambiguity, there should be only one
-default edge between two nodes (with the exception of the root node,
-which gets a special treatment - there you are allowed to specify one
-default edge <em>per language</em>).</p>
-<p>To get a visual representation of the compilation graph (useful for
-debugging), run <tt class="docutils literal"><span class="pre">llvmc2</span> <span class="pre">--view-graph</span></tt>. You will need <tt class="docutils literal"><span class="pre">dot</span></tt> and
-<tt class="docutils literal"><span class="pre">gsview</span></tt> installed for this to work properly.</p>
-</div>
-<div class="doc_text">
-<div class="doc_section"><a class="toc-backref" href="#id6" id="writing-a-tool-description" name="writing-a-tool-description">Writing a tool description</a></div>
-<p>As was said earlier, nodes in the compilation graph represent tools,
-which are described separately. A tool definition looks like this
-(taken from the <tt class="docutils literal"><span class="pre">Tools.td</span></tt> file):</p>
-<pre class="literal-block">
-def llvm_gcc_cpp : Tool&lt;[
- (in_language &quot;c++&quot;),
- (out_language &quot;llvm-assembler&quot;),
- (output_suffix &quot;bc&quot;),
- (cmd_line &quot;llvm-g++ -c $INFILE -o $OUTFILE -emit-llvm&quot;),
- (sink)
- ]&gt;;
-</pre>
-<p>This defines a new tool called <tt class="docutils literal"><span class="pre">llvm_gcc_cpp</span></tt>, which is an alias for
-<tt class="docutils literal"><span class="pre">llvm-g++</span></tt>. As you can see, a tool definition is just a list of
-properties; most of them should be self-explanatory. The <tt class="docutils literal"><span class="pre">sink</span></tt>
-property means that this tool should be passed all command-line
-options that lack explicit descriptions.</p>
-<p>The complete list of the currently implemented tool properties follows:</p>
-<ul class="simple">
-<li>Possible tool properties:<ul>
-<li><tt class="docutils literal"><span class="pre">in_language</span></tt> - input language name.</li>
-<li><tt class="docutils literal"><span class="pre">out_language</span></tt> - output language name.</li>
-<li><tt class="docutils literal"><span class="pre">output_suffix</span></tt> - output file suffix.</li>
-<li><tt class="docutils literal"><span class="pre">cmd_line</span></tt> - the actual command used to run the tool. You can
-use <tt class="docutils literal"><span class="pre">$INFILE</span></tt> and <tt class="docutils literal"><span class="pre">$OUTFILE</span></tt> variables, output redirection
-with <tt class="docutils literal"><span class="pre">&gt;</span></tt>, hook invocations (<tt class="docutils literal"><span class="pre">$CALL</span></tt>), environment variables
-(via <tt class="docutils literal"><span class="pre">$ENV</span></tt>) and the <tt class="docutils literal"><span class="pre">case</span></tt> construct (more on this below).</li>
-<li><tt class="docutils literal"><span class="pre">join</span></tt> - this tool is a &quot;join node&quot; in the graph, i.e. it gets a
-list of input files and joins them together. Used for linkers.</li>
-<li><tt class="docutils literal"><span class="pre">sink</span></tt> - all command-line options that are not handled by other
-tools are passed to this tool.</li>
-</ul>
-</li>
-</ul>
-<p>The next tool definition is slightly more complex:</p>
-<pre class="literal-block">
-def llvm_gcc_linker : Tool&lt;[
- (in_language &quot;object-code&quot;),
- (out_language &quot;executable&quot;),
- (output_suffix &quot;out&quot;),
- (cmd_line &quot;llvm-gcc $INFILE -o $OUTFILE&quot;),
- (join),
- (prefix_list_option &quot;L&quot;, (forward),
- (help &quot;add a directory to link path&quot;)),
- (prefix_list_option &quot;l&quot;, (forward),
- (help &quot;search a library when linking&quot;)),
- (prefix_list_option &quot;Wl&quot;, (unpack_values),
- (help &quot;pass options to linker&quot;))
- ]&gt;;
-</pre>
-<p>This tool has a &quot;join&quot; property, which means that it behaves like a
-linker. This tool also defines several command-line options: <tt class="docutils literal"><span class="pre">-l</span></tt>,
-<tt class="docutils literal"><span class="pre">-L</span></tt> and <tt class="docutils literal"><span class="pre">-Wl</span></tt> which have their usual meaning. An option has two
-attributes: a name and a (possibly empty) list of properties. All
-currently implemented option types and properties are described below:</p>
-<ul>
-<li><p class="first">Possible option types:</p>
-<blockquote>
-<ul class="simple">
-<li><tt class="docutils literal"><span class="pre">switch_option</span></tt> - a simple boolean switch, for example <tt class="docutils literal"><span class="pre">-time</span></tt>.</li>
-<li><tt class="docutils literal"><span class="pre">parameter_option</span></tt> - option that takes an argument, for example
-<tt class="docutils literal"><span class="pre">-std=c99</span></tt>;</li>
-<li><tt class="docutils literal"><span class="pre">parameter_list_option</span></tt> - same as the above, but more than one
-occurence of the option is allowed.</li>
-<li><tt class="docutils literal"><span class="pre">prefix_option</span></tt> - same as the parameter_option, but the option name
-and parameter value are not separated.</li>
-<li><tt class="docutils literal"><span class="pre">prefix_list_option</span></tt> - same as the above, but more than one
-occurence of the option is allowed; example: <tt class="docutils literal"><span class="pre">-lm</span> <span class="pre">-lpthread</span></tt>.</li>
-<li><tt class="docutils literal"><span class="pre">alias_option</span></tt> - a special option type for creating
-aliases. Unlike other option types, aliases are not allowed to
-have any properties besides the aliased option name. Usage
-example: <tt class="docutils literal"><span class="pre">(alias_option</span> <span class="pre">&quot;preprocess&quot;,</span> <span class="pre">&quot;E&quot;)</span></tt></li>
-</ul>
-</blockquote>
-</li>
-<li><p class="first">Possible option properties:</p>
-<blockquote>
-<ul class="simple">
-<li><tt class="docutils literal"><span class="pre">append_cmd</span></tt> - append a string to the tool invocation command.</li>
-<li><tt class="docutils literal"><span class="pre">forward</span></tt> - forward this option unchanged.</li>
-<li><tt class="docutils literal"><span class="pre">output_suffix</span></tt> - modify the output suffix of this
-tool. Example : <tt class="docutils literal"><span class="pre">(switch</span> <span class="pre">&quot;E&quot;,</span> <span class="pre">(output_suffix</span> <span class="pre">&quot;i&quot;)</span></tt>.</li>
-<li><tt class="docutils literal"><span class="pre">stop_compilation</span></tt> - stop compilation after this phase.</li>
-<li><tt class="docutils literal"><span class="pre">unpack_values</span></tt> - used for for splitting and forwarding
-comma-separated lists of options, e.g. <tt class="docutils literal"><span class="pre">-Wa,-foo=bar,-baz</span></tt> is
-converted to <tt class="docutils literal"><span class="pre">-foo=bar</span> <span class="pre">-baz</span></tt> and appended to the tool invocation
-command.</li>
-<li><tt class="docutils literal"><span class="pre">help</span></tt> - help string associated with this option. Used for
-<tt class="docutils literal"><span class="pre">--help</span></tt> output.</li>
-<li><tt class="docutils literal"><span class="pre">required</span></tt> - this option is obligatory.</li>
-</ul>
-</blockquote>
-</li>
-</ul>
-</div>
-<div class="doc_text">
-<div class="doc_section"><a class="toc-backref" href="#id7" id="option-list-specifying-all-options-in-a-single-place" name="option-list-specifying-all-options-in-a-single-place">Option list - specifying all options in a single place</a></div>
-<p>It can be handy to have all information about options gathered in a
-single place to provide an overview. This can be achieved by using a
-so-called <tt class="docutils literal"><span class="pre">OptionList</span></tt>:</p>
-<pre class="literal-block">
-def Options : OptionList&lt;[
-(switch_option &quot;E&quot;, (help &quot;Help string&quot;)),
-(alias_option &quot;quiet&quot;, &quot;q&quot;)
-...
-]&gt;;
-</pre>
-<p><tt class="docutils literal"><span class="pre">OptionList</span></tt> is also a good place to specify option aliases.</p>
-<p>Tool-specific option properties like <tt class="docutils literal"><span class="pre">append_cmd</span></tt> have (obviously)
-no meaning in the context of <tt class="docutils literal"><span class="pre">OptionList</span></tt>, so the only properties
-allowed there are <tt class="docutils literal"><span class="pre">help</span></tt> and <tt class="docutils literal"><span class="pre">required</span></tt>.</p>
-<p>Option lists are used at the file scope. See file
-<tt class="docutils literal"><span class="pre">examples/Clang.td</span></tt> for an example of <tt class="docutils literal"><span class="pre">OptionList</span></tt> usage.</p>
-</div>
-<div class="doc_text">
-<div class="doc_section"><a class="toc-backref" href="#id8" id="using-hooks-and-environment-variables-in-the-cmd-line-property" name="using-hooks-and-environment-variables-in-the-cmd-line-property">Using hooks and environment variables in the <tt class="docutils literal"><span class="pre">cmd_line</span></tt> property</a></div>
-<p>Normally, LLVMC executes programs from the system <tt class="docutils literal"><span class="pre">PATH</span></tt>. Sometimes,
-this is not sufficient: for example, we may want to specify tool names
-in the configuration file. This can be achieved via the mechanism of
-hooks - to compile LLVMC with your hooks, just drop a .cpp file into
-<tt class="docutils literal"><span class="pre">tools/llvmc2</span></tt> directory. Hooks should live in the <tt class="docutils literal"><span class="pre">hooks</span></tt>
-namespace and have the signature <tt class="docutils literal"><span class="pre">std::string</span> <span class="pre">hooks::MyHookName</span>
-<span class="pre">(void)</span></tt>. They can be used from the <tt class="docutils literal"><span class="pre">cmd_line</span></tt> tool property:</p>
-<pre class="literal-block">
-(cmd_line &quot;$CALL(MyHook)/path/to/file -o $CALL(AnotherHook)&quot;)
-</pre>
-<p>It is also possible to use environment variables in the same manner:</p>
-<pre class="literal-block">
-(cmd_line &quot;$ENV(VAR1)/path/to/file -o $ENV(VAR2)&quot;)
-</pre>
-<p>To change the command line string based on user-provided options use
-the <tt class="docutils literal"><span class="pre">case</span></tt> expression (documented below):</p>
-<pre class="literal-block">
-(cmd_line
- (case
- (switch_on &quot;E&quot;),
- &quot;llvm-g++ -E -x c $INFILE -o $OUTFILE&quot;,
- (default),
- &quot;llvm-g++ -c -x c $INFILE -o $OUTFILE -emit-llvm&quot;))
-</pre>
-</div>
-<div class="doc_text">
-<div class="doc_section"><a class="toc-backref" href="#id9" id="conditional-evaluation-the-case-expression" name="conditional-evaluation-the-case-expression">Conditional evaluation: the <tt class="docutils literal"><span class="pre">case</span></tt> expression</a></div>
-<p>The 'case' construct can be used to calculate weights of the optional
-edges and to choose between several alternative command line strings
-in the <tt class="docutils literal"><span class="pre">cmd_line</span></tt> tool property. It is designed after the
-similarly-named construct in functional languages and takes the form
-<tt class="docutils literal"><span class="pre">(case</span> <span class="pre">(test_1),</span> <span class="pre">statement_1,</span> <span class="pre">(test_2),</span> <span class="pre">statement_2,</span> <span class="pre">...</span> <span class="pre">(test_N),</span>
-<span class="pre">statement_N)</span></tt>. The statements are evaluated only if the corresponding
-tests evaluate to true.</p>
-<p>Examples:</p>
-<pre class="literal-block">
-// Increases edge weight by 5 if &quot;-A&quot; is provided on the
-// command-line, and by 5 more if &quot;-B&quot; is also provided.
-(case
- (switch_on &quot;A&quot;), (inc_weight 5),
- (switch_on &quot;B&quot;), (inc_weight 5))
-
-// Evaluates to &quot;cmdline1&quot; if option &quot;-A&quot; is provided on the
-// command line, otherwise to &quot;cmdline2&quot;
-(case
- (switch_on &quot;A&quot;), &quot;cmdline1&quot;,
- (switch_on &quot;B&quot;), &quot;cmdline2&quot;,
- (default), &quot;cmdline3&quot;)
-</pre>
-<p>Note the slight difference in 'case' expression handling in contexts
-of edge weights and command line specification - in the second example
-the value of the <tt class="docutils literal"><span class="pre">&quot;B&quot;</span></tt> switch is never checked when switch <tt class="docutils literal"><span class="pre">&quot;A&quot;</span></tt> is
-enabled, and the whole expression always evaluates to <tt class="docutils literal"><span class="pre">&quot;cmdline1&quot;</span></tt> in
-that case.</p>
-<p>Case expressions can also be nested, i.e. the following is legal:</p>
-<pre class="literal-block">
-(case (switch_on &quot;E&quot;), (case (switch_on &quot;o&quot;), ..., (default), ...)
- (default), ...)
-</pre>
-<p>You should, however, try to avoid doing that because it hurts
-readability. It is usually better to split tool descriptions and/or
-use TableGen inheritance instead.</p>
-<ul class="simple">
-<li>Possible tests are:<ul>
-<li><tt class="docutils literal"><span class="pre">switch_on</span></tt> - Returns true if a given command-line option is
-provided by the user. Example: <tt class="docutils literal"><span class="pre">(switch_on</span> <span class="pre">&quot;opt&quot;)</span></tt>. Note that
-you have to define all possible command-line options separately in
-the tool descriptions. See the next doc_text for the discussion of
-different kinds of command-line options.</li>
-<li><tt class="docutils literal"><span class="pre">parameter_equals</span></tt> - Returns true if a command-line parameter equals
-a given value. Example: <tt class="docutils literal"><span class="pre">(parameter_equals</span> <span class="pre">&quot;W&quot;,</span> <span class="pre">&quot;all&quot;)</span></tt>.</li>
-<li><tt class="docutils literal"><span class="pre">element_in_list</span></tt> - Returns true if a command-line parameter list
-includes a given value. Example: <tt class="docutils literal"><span class="pre">(parameter_in_list</span> <span class="pre">&quot;l&quot;,</span> <span class="pre">&quot;pthread&quot;)</span></tt>.</li>
-<li><tt class="docutils literal"><span class="pre">input_languages_contain</span></tt> - Returns true if a given language
-belongs to the current input language set. Example:
-<tt class="docutils literal"><span class="pre">`(input_languages_contain</span> <span class="pre">&quot;c++&quot;)</span></tt>.</li>
-<li><tt class="docutils literal"><span class="pre">in_language</span></tt> - Evaluates to true if the language of the input
-file equals to the argument. Valid only when using <tt class="docutils literal"><span class="pre">case</span></tt>
-expression in a <tt class="docutils literal"><span class="pre">cmd_line</span></tt> tool property. Example:
-<tt class="docutils literal"><span class="pre">`(in_language</span> <span class="pre">&quot;c++&quot;)</span></tt>.</li>
-<li><tt class="docutils literal"><span class="pre">not_empty</span></tt> - Returns true if a given option (which should be
-either a parameter or a parameter list) is set by the
-user. Example: <tt class="docutils literal"><span class="pre">`(not_empty</span> <span class="pre">&quot;o&quot;)</span></tt>.</li>
-<li><tt class="docutils literal"><span class="pre">default</span></tt> - Always evaluates to true. Should always be the last
-test in the <tt class="docutils literal"><span class="pre">case</span></tt> expression.</li>
-<li><tt class="docutils literal"><span class="pre">and</span></tt> - A standard logical combinator that returns true iff all
-of its arguments return true. Used like this: <tt class="docutils literal"><span class="pre">(and</span> <span class="pre">(test1),</span>
-<span class="pre">(test2),</span> <span class="pre">...</span> <span class="pre">(testN))</span></tt>. Nesting of <tt class="docutils literal"><span class="pre">and</span></tt> and <tt class="docutils literal"><span class="pre">or</span></tt> is allowed,
-but not encouraged.</li>
-<li><tt class="docutils literal"><span class="pre">or</span></tt> - Another logical combinator that returns true only if any
-one of its arguments returns true. Example: <tt class="docutils literal"><span class="pre">(or</span> <span class="pre">(test1),</span>
-<span class="pre">(test2),</span> <span class="pre">...</span> <span class="pre">(testN))</span></tt>.</li>
-</ul>
-</li>
-</ul>
-</div>
-<div class="doc_text">
-<div class="doc_section"><a class="toc-backref" href="#id10" id="language-map" name="language-map">Language map</a></div>
-<p>One last thing that you will need to modify when adding support for a
-new language to LLVMC is the language map, which defines mappings from
-file extensions to language names. It is used to choose the proper
-toolchain(s) for a given input file set. Language map definition is
-located in the file <tt class="docutils literal"><span class="pre">Tools.td</span></tt> and looks like this:</p>
-<pre class="literal-block">
-def LanguageMap : LanguageMap&lt;
- [LangToSuffixes&lt;&quot;c++&quot;, [&quot;cc&quot;, &quot;cp&quot;, &quot;cxx&quot;, &quot;cpp&quot;, &quot;CPP&quot;, &quot;c++&quot;, &quot;C&quot;]&gt;,
- LangToSuffixes&lt;&quot;c&quot;, [&quot;c&quot;]&gt;,
- ...
- ]&gt;;
-</pre>
-</div>
-<div class="doc_text">
-<div class="doc_section"><a class="toc-backref" href="#id11" id="references" name="references">References</a></div>
-<table class="docutils footnote" frame="void" id="id2" rules="none">
-<colgroup><col class="label" /><col /></colgroup>
-<tbody valign="top">
-<tr><td class="label"><a class="fn-backref" href="#id1" name="id2">[1]</a></td><td>TableGen Fundamentals
-<a class="reference" href="http://llvm.cs.uiuc.edu/docs/TableGenFundamentals.html">http://llvm.cs.uiuc.edu/docs/TableGenFundamentals.html</a></td></tr>
-</tbody>
-</table>
-</div>
-</div>
-<hr />
-<address>
- <a href="http://jigsaw.w3.org/css-validator/check/referer"><img
- src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!" /></a>
- <a href="http://validator.w3.org/check/referer"><img
- src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0!" /></a>
- <a href="http://llvm.org">The LLVM Compiler Infrastructure</a><br/>
- Last modified: $Date$
-</address>
-</body>
-</html>
diff --git a/release_23/docs/CompilerWriterInfo.html b/release_23/docs/CompilerWriterInfo.html
deleted file mode 100644
index 16810e5d051d..000000000000
--- a/release_23/docs/CompilerWriterInfo.html
+++ /dev/null
@@ -1,261 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
- "http://www.w3.org/TR/html4/strict.dtd">
-<html>
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <title>Architecture/platform information for compiler writers</title>
- <link rel="stylesheet" href="llvm.css" type="text/css">
-</head>
-
-<div class="doc_title">
- Architecture/platform information for compiler writers
-</div>
-
-<div class="doc_warning">
- <p>Note: This document is a work-in-progress. Additions and clarifications
- are welcome.</p>
-</div>
-
-<ol>
- <li><a href="#hw">Hardware</a>
- <ol>
- <li><a href="#alpha">Alpha</a></li>
- <li><a href="#arm">ARM</a></li>
- <li><a href="#ia64">Itanium</a></li>
- <li><a href="#mips">MIPS</a></li>
- <li><a href="#ppc">PowerPC</a></li>
- <li><a href="#sparc">SPARC</a></li>
- <li><a href="#x86">X86</a></li>
- <li><a href="#other">Other lists</a></li>
- </ol></li>
- <li><a href="#abi">Application Binary Interface (ABI)</a>
- <ol>
- <li><a href="#linux">Linux</a></li>
- <li><a href="#osx">OS X</a></li>
- </ol></li>
- <li><a href="#misc">Miscellaneous resources</a></li>
-</ol>
-
-<div class="doc_author">
- <p>Compiled by <a href="http://misha.brukman.net">Misha Brukman</a></p>
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section"><a name="hw">Hardware</a></div>
-<!-- *********************************************************************** -->
-
-<!-- ======================================================================= -->
-<div class="doc_subsection"><a name="alpha">Alpha</a></div>
-
-<div class="doc_text">
-<ul>
-<li><a
-href="http://ftp.digital.com/pub/Digital/info/semiconductor/literature/dsc-library.html">Alpha manuals</a>
-</li>
-</ul>
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection"><a name="arm">ARM</a></div>
-
-<div class="doc_text">
-<ul>
-<li><a href="http://www.arm.com/documentation/">ARM documentation</a>
-(<a href="http://www.arm.com/documentation/ARMProcessor_Cores/">Processor
-Cores</a>)</li>
-<li><a href="http://www.arm.com/products/DevTools/ABI.html">ABI</a></li>
-</ul>
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection"><a name="ia64">Itanium (ia64)</a></div>
-
-<div class="doc_text">
-<ul>
-<li><a
-href="http://developer.intel.com/design/itanium2/documentation.htm">Itanium documentation</a>
-</li>
-</ul>
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection"><a name="mips">MIPS</a></div>
-
-<div class="doc_text">
-<ul>
-<li><a
-href="http://mips.com/content/Documentation/MIPSDocumentation/ProcessorArchitecture/doclibrary">MIPS
-Processor Architecture</a></li>
-</ul>
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection"><a name="ppc">PowerPC</a></div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">IBM - Official manuals and docs</div>
-
-<div class="doc_text">
-
-<ul>
-<li><a
-href="http://www-106.ibm.com/developerworks/eserver/articles/archguide.html">PowerPC
-Architecture Book</a>
-<ul>
- <li>Book I: <a
- href="http://www-106.ibm.com/developerworks/eserver/pdfs/archpub1.pdf">PowerPC
- User Instruction Set Architecture</a></li>
- <li>Book II: <a
- href="http://www-106.ibm.com/developerworks/eserver/pdfs/archpub2.pdf">PowerPC
- Virtual Environment Architecture</a></li>
- <li>Book III: <a
- href="http://www-106.ibm.com/developerworks/eserver/pdfs/archpub3.pdf">PowerPC
- Operating Environment Architecture</a></li>
-</ul></li>
-<li><a
-href="http://www-3.ibm.com/chips/techlib/techlib.nsf/techdocs/852569B20050FF7785256996007558C6">PowerPC
-Compiler Writer's Guide</a></li>
-<li><A
-href="http://www-3.ibm.com/chips/techlib/techlib.nsf/products/PowerPC">PowerPC
-Processor Manuals</a></li>
-<li><a
-href="http://www-106.ibm.com/developerworks/linux/library/l-powarch/">Intro to
-PowerPC architecture</a></li>
-<li><a href="http://publibn.boulder.ibm.com/doc_link/en_US/a_doc_lib/aixassem/alangref/alangreftfrm.htm">IBM AIX/5L for POWER Assembly reference</a></li>
-</ul>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">Other documents, collections, notes</div>
-
-<div class="doc_text">
-
-<ul>
-<li><a href="http://penguinppc.org/dev/#library">PowerPC ABI documents</a></li>
-<li><a href="http://gcc.gnu.org/ml/gcc-patches/2003-09/msg00997.html">PowerPC64
-alignment of long doubles (from GCC)</a></li>
-<li><a href="http://sources.redhat.com/ml/binutils/2002-04/msg00573.html">Long
-branch stubs for powerpc64-linux (from binutils)</a></li>
-</ul>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection"><a name="sparc">SPARC</a></div>
-
-<div class="doc_text">
-
-<ul>
-<li><a href="http://www.sparc.org/resource.htm">SPARC resources</a></li>
-<li><a href="http://www.sparc.org/standards.html">SPARC standards</a></li>
-</ul>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection"><a name="x86">X86</a></div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">AMD - Official manuals and docs</div>
-
-<div class="doc_text">
-<ul>
-<li><a
-href="http://www.amd.com/us-en/Processors/TechnicalResources/0,,30_182_739,00.html">AMD processor manuals</a></li>
-<li><a href="http://www.x86-64.org/documentation">X86-64 ABI</a></li>
-</ul>
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">Intel - Official manuals and docs</div>
-
-<div class="doc_text">
-<ul>
-<li><a
-href="http://developer.intel.com/design/pentium4/manuals/index_new.htm">IA-32
-manuals</a></li>
-<li><a
-href="http://www.intel.com/design/itanium/documentation.htm?iid=ipp_srvr_proc_itanium2+techdocs">Intel
-Itanium documentation</a></li>
-</ul>
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">Other x86-specific information</div>
-
-<div class="doc_text">
-<ul>
-<li><a href="http://www.agner.org/assem/calling_conventions.pdf">Calling
-conventions for different C++ compilers and operating systems</a></li>
-</ul>
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection"><a name="other">Other relevant lists</a></div>
-
-<div class="doc_text">
-
-<ul>
-<li><a href="http://gcc.gnu.org/readings.html">GCC reading list</a></li>
-</ul>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section"><a name="abi">ABI</a></div>
-<!-- *********************************************************************** -->
-
-<!-- ======================================================================= -->
-<div class="doc_subsection"><a name="linux">Linux</a></div>
-
-<div class="doc_text">
-<ol>
-<li><a href="http://www.linuxbase.org/spec/ELF/ppc64/">PowerPC 64-bit ELF ABI
-Supplement</a></li>
-</ol>
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection"><a name="osx">OS X</a></div>
-
-<div class="doc_text">
-<ol>
-<li><a
-href="http://developer.apple.com/documentation/Darwin/RuntimeArchitecture-date.html">Mach-O
-Runtime Architecture</a></li>
-<li><a href="http://www.unsanity.org/archives/000044.php">Notes on Mach-O
-ABI</a></li>
-</ol>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section"><a name="misc">Miscellaneous resources</a></div>
-<!-- *********************************************************************** -->
-
-<ul>
-<li><a
-href="http://www.nondot.org/sabre/os/articles/ExecutableFileFormats/">Executable
-File Format library</a></li>
-<li><a href="http://gcc.gnu.org/projects/prefetch.html">GCC prefetch project</a>
-page has a good survey of the prefetching capabilities of a variety of modern
-processors.</li>
-</ul>
-
-<!-- *********************************************************************** -->
-
-<hr>
-<address>
- <a href="http://jigsaw.w3.org/css-validator/check/referer"><img
- src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"></a>
- <a href="http://validator.w3.org/check/referer"><img
- src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!"></a>
-
- <a href="http://misha.brukman.net">Misha Brukman</a><br>
- <a href="http://llvm.org">LLVM Compiler Infrastructure</a><br>
- Last modified: $Date$
-</address>
-
-</body>
-</html>
diff --git a/release_23/docs/DeveloperPolicy.html b/release_23/docs/DeveloperPolicy.html
deleted file mode 100644
index 18c1ff34ac27..000000000000
--- a/release_23/docs/DeveloperPolicy.html
+++ /dev/null
@@ -1,555 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
- "http://www.w3.org/TR/html4/strict.dtd">
-<html>
-<head>
- <title>LLVM Developer Policy</title>
- <link rel="stylesheet" href="llvm.css" type="text/css">
-</head>
-<body>
-
-<div class="doc_title">LLVM Developer Policy</div>
-<ol>
- <li><a href="#introduction">Introduction</a></li>
- <li><a href="#policies">Developer Policies</a>
- <ol>
- <li><a href="#informed">Stay Informed</a></li>
- <li><a href="#patches">Making a Patch</a></li>
- <li><a href="#reviews">Code Reviews</a></li>
- <li><a href="#owners">Code Owners</a></li>
- <li><a href="#testcases">Test Cases</a></li>
- <li><a href="#quality">Quality</a></li>
- <li><a href="#commitaccess">Obtaining Commit Access</a></li>
- <li><a href="#newwork">Making a Major Change</a></li>
- <li><a href="#incremental">Incremental Development</a></li>
- <li><a href="#attribution">Attribution of Changes</a></li>
- </ol></li>
- <li><a href="#clp">Copyright, License, and Patents</a>
- <ol>
- <li><a href="#copyright">Copyright</a></li>
- <li><a href="#license">License</a></li>
- <li><a href="#patents">Patents</a></li>
- <li><a href="#devagree">Developer Agreements</a></li>
- </ol></li>
-</ol>
-<div class="doc_author">Written by the LLVM Oversight Team</div>
-
-<!--=========================================================================-->
-<div class="doc_section"><a name="introduction">Introduction</a></div>
-<!--=========================================================================-->
-<div class="doc_text">
- <p>This document contains the LLVM Developer Policy which defines the
- project's policy towards developers and their contributions. The intent of
- this policy is to eliminate mis-communication, rework, and confusion that
- might arise from the distributed nature of LLVM's development. By stating
- the policy in clear terms, we hope each developer can know ahead of time
- what to expect when making LLVM contributions.</p>
- <p>This policy is also designed to accomplish the following objectives:</p>
- <ol>
- <li>Attract both users and developers to the LLVM project.</li>
- <li>Make life as simple and easy for contributors as possible.</li>
- <li>Keep the top of Subversion trees as stable as possible.</li>
- </ol>
-
- <p>This policy is aimed at frequent contributors to LLVM. People interested in
- contributing one-off patches can do so in an informal way by sending them to
- the <a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits">
- llvm-commits mailing list</a> and engaging another developer to see it through
- the process.</p>
-
-</div>
-
-<!--=========================================================================-->
-<div class="doc_section"><a name="policies">Developer Policies</a></div>
-<!--=========================================================================-->
-<div class="doc_text">
- <p>This section contains policies that pertain to frequent LLVM
- developers. We always welcome <a href="#patches">one-off patches</a> from
- people who do not routinely contribute to LLVM, but we expect more from
- frequent contributors to keep the system as efficient as possible for
- everyone.
- Frequent LLVM contributors are expected to meet the following requirements in
- order for LLVM to maintain a high standard of quality.<p>
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsection"> <a name="informed">Stay Informed</a> </div>
-<div class="doc_text">
- <p>Developers should stay informed by reading at least the
- <a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev">llvmdev</a>
- email list. If you are doing anything more than just casual work on LLVM,
- it is suggested that you also subscribe to the
- <a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits">llvm-commits</a>
- list and pay attention to changes being made by others.</p>
- <p>We recommend that active developers register an email account with
- <a href="http://llvm.org/bugs/">LLVM Bugzilla</a> and preferably subscribe to
- the <a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs">llvm-bugs</a>
- email list to keep track of bugs and enhancements occurring in LLVM.</p>
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsection"> <a name="patches">Making a Patch</a></div>
-
-<div class="doc_text">
-
-<p>When making a patch for review, the goal is to make it as easy for the
- reviewer to read it as possible. As such, we recommend that you:</p>
- <ol>
- <li>Make your patch against the Subversion trunk, not a branch, and not an
- old version of LLVM. This makes it easy to apply the patch.</li>
-
- <li>Similarly, patches should be submitted soon after they are generated.
- Old patches may not apply correctly if the underlying code changes between
- the time the patch was created and the time it is applied.</li>
-
- <li>Patches should be made with this command:
- <pre>svn diff -x -u</pre>
- or with the utility <tt>utils/mkpatch</tt>, which makes it easy to read the
- diff.</li>
-
- <li>Patches should not include differences in generated code such as the
- code generated by <tt>flex</tt>, <tt>bison</tt> or <tt>tblgen</tt>. The
- <tt>utils/mkpatch</tt> utility takes care of this for you.</li>
-
- </ol>
-
- <p>When sending a patch to a mailing list, it is a good idea to send it as an
- <em>attachment</em> to the message, not embedded into the text of the
- message. This ensures that your mailer will not mangle the patch when it
- sends it (e.g. by making whitespace changes or by wrapping lines).</p>
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsection"> <a name="reviews">Code Reviews</a></div>
-<div class="doc_text">
- <p>LLVM has a code review policy. Code review is one way to increase the
- quality of software. We generally follow these policies:</p>
- <ol>
- <li>All developers are required to have significant changes reviewed
- before they are committed to the repository.</li>
- <li>Code reviews are conducted by email, usually on the llvm-commits
- list.</li>
- <li>Code can be reviewed either before it is committed or after. We expect
- major changes to be reviewed before being committed, but smaller
- changes (or changes where the developer owns the component) can be
- reviewed after commit.</li>
- <li>The developer responsible for a code change is also responsible for
- making all necessary review-related changes.</li>
- <li>Code review can be an iterative process, which continues until the patch
- is ready to be committed.</li>
- </ol>
-
- <p>Developers should participate in code reviews as both reviewers and
- reviewees. If someone is kind enough to review your code, you should
- return the favor for someone else. Note that anyone is welcome to review
- and give feedback on a patch, but only people with Subversion write access
- can approve it.</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsection"> <a name="owners">Code Owners</a></div>
-<div class="doc_text">
-
- <p>The LLVM Project relies on two features of its process to maintain rapid
- development in addition to the high quality of its source base: the
- combination of code review plus post-commit review for trusted maintainers.
- Having both is a great way for the project to take advantage of the fact
- that most people do the right thing most of the time, and only commit
- patches without pre-commit review when they are confident they are
- right.</p>
-
- <p>The trick to this is that the project has to guarantee that all patches
- that are committed are reviewed after they go in: you don't want everyone
- to assume someone else will review it, allowing the patch to go unreviewed.
- To solve this problem, we have a notion of an 'owner' for a piece of the
- code. The sole responsibility of a code owner is to ensure that a commit
- to their area of the code is appropriately reviewed, either by themself or
- by someone else. The current code owners are:</p>
-
- <ol>
- <li><b>Anton Korobeynikov</b>: Exception handling, debug information, and
- Windows codegen.</li>
- <li><b>Duncan Sands</b>: llvm-gcc 4.2.</li>
- <li><b>Evan Cheng</b>: Code generator and all targets.</li>
- <li><b>Chris Lattner</b>: Everything else.</li>
- </ol>
-
- <p>Note that code ownership is completely different than reviewers: anyone can
- review a piece of code, and we welcome code review from anyone who is
- interested. Code owners are the "last line of defense" to guarantee that
- all patches that are committed are actually reviewed.</p>
-
- <p>Being a code owner is a somewhat unglamorous position, but it is incredibly
- important for the ongoing success of the project. Because people get busy,
- interests change, and unexpected things happen, code ownership is purely
- opt-in, and anyone can choose to resign their "title" at any time. For now,
- we do not have an official policy on how one gets elected to be a code
- owner.
- </p>
-
-</div>
-
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsection"> <a name="testcases">Test Cases</a></div>
-<div class="doc_text">
- <p>Developers are required to create test cases for any bugs fixed and any new
- features added. Some tips for getting your testcase approved:</p>
- <ol>
- <li>All feature and regression test cases are added to the
- <tt>llvm/test</tt> directory. The appropriate sub-directory should be
- selected (see the <a href="TestingGuide.html">Testing Guide</a> for
- details).</li>
- <li>Test cases should be written in
- <a href="LangRef.html">LLVM assembly language</a> unless the
- feature or regression being tested requires another language (e.g. the
- bug being fixed or feature being implemented is in the llvm-gcc C++
- front-end, in which case it must be written in C++).</li>
- <li>Test cases, especially for regressions, should be reduced as much as
- possible, by <a href="Bugpoint.html">bugpoint</a> or
- manually. It is unacceptable
- to place an entire failing program into <tt>llvm/test</tt> as this creates
- a <i>time-to-test</i> burden on all developers. Please keep them short.</li>
- </ol>
-
- <p>Note that llvm/test is designed for regression and small feature tests
- only. More extensive test cases (e.g., entire applications, benchmarks,
- etc) should be added to the <tt>llvm-test</tt> test suite. The llvm-test
- suite is for coverage (correctness, performance, etc) testing, not feature
- or regression testing.</p>
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsection"> <a name="quality">Quality</a></div>
-<div class="doc_text">
- <p>The minimum quality standards that any change must satisfy before being
- committed to the main development branch are:</p>
- <ol>
- <li>Code must adhere to the
- <a href="CodingStandards.html">LLVM Coding Standards</a>.</li>
- <li>Code must compile cleanly (no errors, no warnings) on at least one
- platform.</li>
- <li>Bug fixes and new features should <a href="#testcases">include a
- testcase</a> so we know if the fix/feature ever regresses in the
- future.</li>
- <li>Code must pass the dejagnu (<tt>llvm/test</tt>) test suite.</li>
- <li>The code must not cause regressions on a reasonable subset of llvm-test,
- where "reasonable" depends on the contributor's judgement and the scope
- of the change (more invasive changes require more testing). A reasonable
- subset is "<tt>llvm-test/MultiSource/Benchmarks</tt>".</li>
- </ol>
- <p>Additionally, the committer is responsible for addressing any problems
- found in the future that the change is responsible for. For example:</p>
- <ul>
- <li>The code should compile cleanly on all supported platforms.</li>
- <li>The changes should not cause any correctness regressions in the
- <tt>llvm-test</tt> suite and must not cause any major performance
- regressions.</li>
- <li>The change set should not cause performance or correctness regressions
- for the LLVM tools.</li>
- <li>The changes should not cause performance or correctness regressions in
- code compiled by LLVM on all applicable targets.</li>
- <li>You are expected to address any <a href="http://llvm.org/bugs/">bugzilla
- bugs</a> that result from your change.</li>
- </ul>
-
- <p>We prefer for this to be handled before submission but understand that it
- isn't possible to test all of this for every submission. Our nightly
- testing
- infrastructure normally finds these problems. A good rule of thumb is to
- check the nightly testers for regressions the day after your change.</p>
-
- <p>Commits that violate these quality standards (e.g. are very broken) may
- be reverted. This is necessary when the change blocks other developers from
- making progress. The developer is welcome to re-commit the change after
- the problem has been fixed.</p>
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsection">
- <a name="commitaccess">Obtaining Commit Access</a></div>
-<div class="doc_text">
-
-<p>
-We grant commit access to contributors with a track record of submitting high
-quality patches. If you would like commit access, please send an email to
-<a href="mailto:sabre@nondot.org">Chris</a> with the following information:</p>
-
-<ol>
- <li>The user name you want to commit with, e.g. "sabre".</li>
- <li>The full name and email address you want message to llvm-commits to come
- from, e.g. "Chris Lattner &lt;sabre@nondot.org&gt;".</li>
- <li>A "password hash" of the password you want to use, e.g. "2ACR96qjUqsyM".
- Note that you don't ever tell us what your password is, you just give it
- to us in an encrypted form. To get this, run "htpasswd" (a utility that
- comes with apache) in crypt mode (often enabled with "-d"), or find a web
- page that will do it for you.</li>
-</ol>
-
-<p>Once you've been granted commit access, you should be able to check out an
- LLVM tree with an SVN URL of "https://username@llvm.org/..." instead of the
- normal anonymous URL of "http://llvm.org/...". The first time you commit
- you'll have to type in your password. Note that you may get a warning from
- SVN about an untrusted key, you can ignore this. To verify that your commit
- access works, please do a test commit (e.g. change a comment or add a blank
- line). Your first commit to a repository may require the autogenerated email
- to be approved by a mailing list. This is normal, and will be done when
- the mailing list owner has time.</p>
-
-<p>If you have recently been granted commit access, these policies apply:</p>
-
-<ol>
- <li>You are granted <i>commit-after-approval</i> to all parts of LLVM.
- To get approval, submit a <a href="#patches">patch</a> to
- <a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits">
- llvm-commits</a>. When approved you may commit it yourself.</li>
- <li>You are allowed to commit patches without approval which you think are
- obvious. This is clearly a subjective decision &mdash; we simply expect you
- to use good judgement. Examples include: fixing build breakage, reverting
- obviously broken patches, documentation/comment changes, any other minor
- changes.</li>
- <li>You are allowed to commit patches without approval to those portions
- of LLVM that you have contributed or maintain (i.e., have been assigned
- responsibility for), with the proviso that such commits must not break the
- build. This is a "trust but verify" policy and commits of this nature are
- reviewed after they are committed.</li>
- <li>Multiple violations of these policies or a single egregious violation
- may cause commit access to be revoked.</li>
-</ol>
-
-<p>In any case, your changes are still subject to <a href="#reviews">code
-review</a> (either before or after they are committed, depending on the nature
-of the change). You are encouraged to review other peoples' patches as well,
-but you aren't required to.</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsection"> <a name="newwork">Making a Major Change</a></div>
-<div class="doc_text">
- <p>When a developer begins a major new project with the aim of contributing
- it back to LLVM, s/he should inform the community with an email to
- the <a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev">llvmdev</a>
- email list, to the extent possible. The reason for this is to:
- <ol>
- <li>keep the community informed about future changes to LLVM, </li>
- <li>avoid duplication of effort by preventing multiple parties working on
- the same thing and not knowing about it, and</li>
- <li>ensure that any technical issues around the proposed work are
- discussed and resolved before any significant work is done.</li>
- </ol>
-
- <p>The design of LLVM is carefully controlled to ensure that all the pieces
- fit together well and are as consistent as possible. If you plan to make a
- major change to the way LLVM works or want to add a major new extension, it
- is a good idea to get consensus with the development
- community before you start working on it.</p>
-
- <p>Once the design of the new feature is finalized, the work itself should be
- done as a series of <a href="#incremental">incremental changes</a>, not as
- a long-term development branch.</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsection"> <a name="incremental">Incremental Development</a>
-</div>
-<div class="doc_text">
- <p>In the LLVM project, we do all significant changes as a series of
- incremental patches. We have a strong dislike for huge changes or
- long-term development branches. Long-term development branches have a
- number of drawbacks:</p>
-
- <ol>
- <li>Branches must have mainline merged into them periodically. If the branch
- development and mainline development occur in the same pieces of code,
- resolving merge conflicts can take a lot of time.</li>
- <li>Other people in the community tend to ignore work on branches.</li>
- <li>Huge changes (produced when a branch is merged back onto mainline) are
- extremely difficult to <a href="#reviews">code review</a>.</li>
- <li>Branches are not routinely tested by our nightly tester
- infrastructure.</li>
- <li>Changes developed as monolithic large changes often don't work until the
- entire set of changes is done. Breaking it down into a set of smaller
- changes increases the odds that any of the work will be committed to the
- main repository.</li>
- </ol>
-
- <p>
- To address these problems, LLVM uses an incremental development style and we
- require contributors to follow this practice when making a large/invasive
- change. Some tips:</p>
-
- <ul>
- <li>Large/invasive changes usually have a number of secondary changes that
- are required before the big change can be made (e.g. API cleanup, etc).
- These sorts of changes can often be done before the major change is done,
- independently of that work.</li>
- <li>The remaining inter-related work should be decomposed into unrelated
- sets of changes if possible. Once this is done, define the first increment
- and get consensus on what the end goal of the change is.</li>
-
- <li>Each change in the set can be stand alone (e.g. to fix a bug), or part
- of a planned series of changes that works towards the development goal.</li>
-
- <li>Each change should be kept as small as possible. This simplifies your
- work (into a logical progression), simplifies code review and reduces the
- chance that you will get negative feedback on the change. Small increments
- also facilitate the maintenance of a high quality code base.</li>
-
- <li>Often, an independent precursor to a big change is to add a new API and
- slowly migrate clients to use the new API. Each change to use the new
- API is often "obvious" and can be committed without review. Once the
- new API is in place and used, it is much easier to replace the
- underlying implementation of the API. This implementation change is
- logically separate from the API change.</li>
- </ul>
-
- <p>If you are interested in making a large change, and this scares you, please
- make sure to first <a href="#newwork">discuss the change/gather
- consensus</a> then ask about the best way to go about making
- the change.</p>
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsection"><a name="attribution">Attribution of
-Changes</a></div>
-<div class="doc_text">
- <p>We believe in correct attribution of contributions to
- their contributors. However, we do not want the source code to be littered
- with random attributions "this code written by J Random Guy" (this is noisy
- and distracting. In practice, the revision control system keeps a perfect
- history of who change what, and the CREDITS.txt file describes higher-level
- contributions.</p>
-
- <p>Overall, please do not add contributor names to the source base.</p>
-</div>
-
-
-
-<!--=========================================================================-->
-<div class="doc_section">
- <a name="clp">Copyright, License, and Patents</a>
-</div>
-<!--=========================================================================-->
-
-<div class="doc_text">
- <p>This section addresses the issues of copyright, license and patents for
- the LLVM project.
- Currently, the University of Illinois is the LLVM copyright holder and the
- terms of its license to LLVM users and developers is the
- <a href="http://www.opensource.org/licenses/UoI-NCSA.php">University of
- Illinois/NCSA Open Source License</a>.</p>
-
-<div class="doc_notes">
- <p><b>NOTE: This section deals with legal matters but does not provide
- legal advice. We are not lawyers, please seek legal counsel from an
- attorney.</b></p>
-</div>
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsection"><a name="copyright">Copyright</a></div>
-<div class="doc_text">
- <p>
- <p>For consistency and ease of management, the project requires the
- copyright for all LLVM software to be held by a single copyright holder:
- the University of Illinois (UIUC).</p>
-
- <p>
- Although UIUC may eventually reassign the copyright of the software to another
- entity (e.g. a dedicated non-profit "LLVM Organization", or something)
- the intent for the project is to always have a single entity hold the
- copyrights to LLVM at any given time.</p>
-
- <p>We believe that having a single copyright
- holder is in the best interests of all developers and users as it greatly
- reduces the managerial burden for any kind of administrative or technical
- decisions about LLVM. The goal of the LLVM project is to always keep the code
- open and <a href="#license">licensed under a very liberal license</a>.</p>
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsection"><a name="license">License</a></div>
-<div class="doc_text">
- <p>We intend to keep LLVM perpetually open source
- and to use a liberal open source license. The current license is the
- <a href="http://www.opensource.org/licenses/UoI-NCSA.php">
- University of Illinois/NCSA Open Source License</a>, which boils
- down to this:</p>
- <ul>
- <li>You can freely distribute LLVM.</li>
- <li>You must retain the copyright notice if you redistribute LLVM.</li>
- <li>Binaries derived from LLVM must reproduce the copyright notice.</li>
- <li>You can't use our names to promote your LLVM derived products.</li>
- <li>There's no warranty on LLVM at all.</li>
- </ul>
-
- <p>We believe this fosters the widest adoption of LLVM because it <b>allows
- commercial products to be derived from LLVM</b> with few restrictions and
- without a requirement for making any derived works also open source (i.e.
- LLVM's license is not a "copyleft" license like the GPL). We suggest that you
- read the <a href="http://www.opensource.org/licenses/UoI-NCSA.php">License</a>
- if further clarification is needed.</p>
-
- <p>Note that the LLVM Project does distribute llvm-gcc, <b>which is GPL.</b>
- This means that anything "linked" into llvm-gcc must itself be compatible
- with the GPL, and must be releasable under the terms of the GPL. This implies
- that <b>any code linked into llvm-gcc and distributed to others may be subject
- to the viral aspects of the GPL</b> (for example, a proprietary code generator
- linked into llvm-gcc must be made available under the GPL). This is not a
- problem for code already distributed under a more liberal license (like the
- UIUC license), and does not affect code generated by llvm-gcc. It may be a
- problem if you intend to base commercial development on llvm-gcc without
- redistributing your source code.</p>
-
- <p>We have no plans to change the license of LLVM. If you have questions
- or comments about the license, please contact the <a
- href="mailto:llvm-oversight@cs.uiuc.edu">LLVM Oversight Group</a>.</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsection"><a name="patents">Patents</a></div>
-<div class="doc_text">
-
-<p>To the best of our knowledge, LLVM does not infringe on any patents (we have
- actually removed code from LLVM in the past that was found to infringe).
- Having code in LLVM that infringes on patents would violate an important
- goal of the project by making it hard or impossible to reuse the code for
- arbitrary purposes (including commercial use).</p>
-
-<p>When contributing code, we expect contributors to notify us of any potential
- for patent-related trouble with their changes. If you own the rights to a
- patent and would like to contribute code to LLVM that relies on it, we
- require that you sign an agreement that allows any other user of LLVM to
- freely use your patent. Please contact the <a
- href="mailto:llvm-oversight@cs.uiuc.edu">oversight group</a> for more
- details.</p>
-</div>
-
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsection"><a name="devagree">Developer Agreements</a></div>
-<div class="doc_text">
- <p>With regards to the LLVM copyright and licensing, developers agree to
- assign their copyrights to UIUC for any contribution made so that
- the entire software base can be managed by a single copyright holder. This
- implies that any contributions can be licensed under the license that the
- project uses.</p>
-</div>
-
-<!-- *********************************************************************** -->
-<hr>
-<address>
- <a href="http://jigsaw.w3.org/css-validator/check/referer"><img
- src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"></a>
- <a href="http://validator.w3.org/check/referer"><img
- src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!" /></a>
- Written by the
- <a href="mailto:llvm-oversight@cs.uiuc.edu">LLVM Oversight Group</a><br>
- <a href="http://llvm.org">The LLVM Compiler Infrastructure</a><br>
- Last modified: $Date$
-</address>
-</body>
-</html>
diff --git a/release_23/docs/ExceptionHandling.html b/release_23/docs/ExceptionHandling.html
deleted file mode 100644
index 0b1c65170414..000000000000
--- a/release_23/docs/ExceptionHandling.html
+++ /dev/null
@@ -1,478 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
- "http://www.w3.org/TR/html4/strict.dtd">
-<html>
-<head>
- <title>Exception Handling in LLVM</title>
- <link rel="stylesheet" href="llvm.css" type="text/css">
-</head>
-<body>
-
-<div class="doc_title">Exception Handling in LLVM</div>
-
-<table class="layout" style="width:100%">
- <tr class="layout">
- <td class="left">
-<ul>
- <li><a href="#introduction">Introduction</a>
- <ol>
- <li><a href="#itanium">Itanium ABI Zero-cost Exception Handling</a></li>
- <li><a href="#overview">Overview</a></li>
- </ol></li>
- <li><a href="#codegen">LLVM Code Generation</a>
- <ol>
- <li><a href="#throw">Throw</a></li>
- <li><a href="#try_catch">Try/Catch</a></li>
- <li><a href="#cleanups">Cleanups</a></li>
- <li><a href="#throw_filters">Throw Filters</a></li>
- <li><a href="#restrictions">Restrictions</a></li>
- </ol></li>
- <li><a href="#format_common_intrinsics">Exception Handling Intrinsics</a>
- <ol>
- <li><a href="#llvm_eh_exception"><tt>llvm.eh.exception</tt></a></li>
- <li><a href="#llvm_eh_selector"><tt>llvm.eh.selector</tt></a></li>
- <li><a href="#llvm_eh_typeid_for"><tt>llvm.eh.typeid.for</tt></a></li>
- </ol></li>
- <li><a href="#asm">Asm Table Formats</a>
- <ol>
- <li><a href="#unwind_tables">Exception Handling Frame</a></li>
- <li><a href="#exception_tables">Exception Tables</a></li>
- </ol></li>
- <li><a href="#todo">ToDo</a></li>
-</ul>
-</td>
-</tr></table>
-
-<div class="doc_author">
- <p>Written by <a href="mailto:jlaskey@mac.com">Jim Laskey</a></p>
-</div>
-
-
-<!-- *********************************************************************** -->
-<div class="doc_section"><a name="introduction">Introduction</a></div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>This document is the central repository for all information pertaining to
-exception handling in LLVM. It describes the format that LLVM exception
-handling information takes, which is useful for those interested in creating
-front-ends or dealing directly with the information. Further, this document
-provides specific examples of what exception handling information is used for
-C/C++.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="itanium">Itanium ABI Zero-cost Exception Handling</a>
-</div>
-
-<div class="doc_text">
-
-<p>Exception handling for most programming languages is designed to recover from
-conditions that rarely occur during general use of an application. To that end,
-exception handling should not interfere with the main flow of an
-application's algorithm by performing checkpointing tasks such as saving
-the current pc or register state.</p>
-
-<p>The Itanium ABI Exception Handling Specification defines a methodology for
-providing outlying data in the form of exception tables without inlining
-speculative exception handling code in the flow of an application's main
-algorithm. Thus, the specification is said to add "zero-cost" to the normal
-execution of an application.</p>
-
-<p>A more complete description of the Itanium ABI exception handling runtime
-support of can be found at <a
-href="http://www.codesourcery.com/cxx-abi/abi-eh.html">Itanium C++ ABI:
-Exception Handling.</a> A description of the exception frame format can be found
-at <a href="http://refspecs.freestandards.org/LSB_3.0.0/LSB-Core-generic/LSB-
-Core-generic/ehframechpt.html">Exception Frames</a>, with details of the Dwarf
-specification at <a href="http://www.eagercon.com/dwarf/dwarf3std.htm">Dwarf 3
-Standard.</a> A description for the C++ exception table formats can be found at
-<a href="http://www.codesourcery.com/cxx-abi/exceptions.pdf">Exception Handling
-Tables.</a></p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="overview">Overview</a>
-</div>
-
-<div class="doc_text">
-
-<p>When an exception is thrown in llvm code, the runtime does a best effort to
-find a handler suited to process the circumstance.</p>
-
-<p>The runtime first attempts to find an <i>exception frame</i> corresponding to
-the function where the exception was thrown. If the programming language (ex.
-C++) supports exception handling, the exception frame contains a reference to an
-exception table describing how to process the exception. If the language (ex.
-C) does not support exception handling or if the exception needs to be forwarded
-to a prior activation, the exception frame contains information about how to
-unwind the current activation and restore the state of the prior activation.
-This process is repeated until the exception is handled. If the exception is
-not handled and no activations remain, then the application is terminated with
-an appropriate error message.</p>
-
-<p>Since different programming languages have different behaviors when handling
-exceptions, the exception handling ABI provides a mechanism for supplying
-<i>personalities.</i> An exception handling personality is defined by way of a
-<i>personality function</i> (ex. for C++ <tt>__gxx_personality_v0</tt>) which
-receives the context of the exception, an <i>exception structure</i> containing
-the exception object type and value, and a reference to the exception table for
-the current function. The personality function for the current compile unit is
-specified in a <i>common exception frame</i>.</p>
-
-<p>The organization of an exception table is language dependent. For C++, an
-exception table is organized as a series of code ranges defining what to do if
-an exception occurs in that range. Typically, the information associated with a
-range defines which types of exception objects (using C++ <i>type info</i>) that
-are handled in that range, and an associated action that should take place.
-Actions typically pass control to a <i>landing pad</i>.</p>
-
-<p>A landing pad corresponds to the code found in the catch portion of a
-try/catch sequence. When execution resumes at a landing pad, it receives the
-exception structure and a selector corresponding to the <i>type</i> of exception
-thrown. The selector is then used to determine which catch should actually
-process the exception.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_section">
- <a name="codegen">LLVM Code Generation</a>
-</div>
-
-<div class="doc_text">
-
-<p>At the time of this writing, only C++ exception handling support is available
-in LLVM. So the remainder of this document will be somewhat C++-centric.</p>
-
-<p>From the C++ developers perspective, exceptions are defined in terms of the
-<tt>throw</tt> and <tt>try/catch</tt> statements. In this section we will
-describe the implementation of llvm exception handling in terms of C++
-examples.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="throw">Throw</a>
-</div>
-
-<div class="doc_text">
-
-<p>Languages that support exception handling typically provide a <tt>throw</tt>
-operation to initiate the exception process. Internally, a throw operation
-breaks down into two steps. First, a request is made to allocate exception
-space for an exception structure. This structure needs to survive beyond the
-current activation. This structure will contain the type and value of the
-object being thrown. Second, a call is made to the runtime to raise the
-exception, passing the exception structure as an argument.</p>
-
-<p>In C++, the allocation of the exception structure is done by the
-<tt>__cxa_allocate_exception</tt> runtime function. The exception raising is
-handled by <tt>__cxa_throw</tt>. The type of the exception is represented using
-a C++ RTTI type info structure.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="try_catch">Try/Catch</a>
-</div>
-
-<div class="doc_text">
-
-<p>A call within the scope of a try statement can potentially raise an exception.
-In those circumstances, the LLVM C++ front-end replaces the call with an
-<tt>invoke</tt> instruction. Unlike a call, the invoke has two potential
-continuation points; where to continue when the call succeeds as per normal, and
-where to continue if the call raises an exception, either by a throw or the
-unwinding of a throw.</p>
-
-<p>The term used to define a the place where an invoke continues after an
-exception is called a <i>landing pad</i>. LLVM landing pads are conceptually
-alternative function entry points where a exception structure reference and a type
-info index are passed in as arguments. The landing pad saves the exception
-structure reference and then proceeds to select the catch block that corresponds
-to the type info of the exception object.</p>
-
-<p>Two llvm intrinsic functions are used convey information about the landing
-pad to the back end.</p>
-
-<p><a href="#llvm_eh_exception"><tt>llvm.eh.exception</tt></a> takes no
-arguments and returns the exception structure reference. The backend replaces
-this intrinsic with the code that accesses the first argument of a call. The
-LLVM C++ front end generates code to save this value in an alloca location for
-further use in the landing pad and catch code.</p>
-
-<p><a href="#llvm_eh_selector"><tt>llvm.eh.selector</tt></a> takes a minimum of
-three arguments. The first argument is the reference to the exception
-structure. The second argument is a reference to the personality function to be
-used for this try catch sequence. Each of the remaining arguments is either a
-reference to the type info for a catch statement,
-a <a href="#throw_filters">filter</a> expression,
-or the number zero representing a <a href="#cleanups">cleanup</a>.
-The exception is tested against the arguments sequentially from first to last.
-The result of the <a href="#llvm_eh_selector"><tt>llvm.eh.selector</tt></a> is a
-positive number if the exception matched a type info, a negative number if it matched
-a filter, and zero if it matched a cleanup. If nothing is matched, the behaviour of
-the program is <a href="#restrictions">undefined</a>.
-The LLVM C++ front end generates code to save the selector value in an alloca
-location for further use in the landing pad and catch code.
-If a type info matched then the selector value is the index of the type info in
-the exception table, which can be obtained using the
-<a href="#llvm_eh_typeid_for"><tt>llvm.eh.typeid.for</tt></a> intrinsic.</p>
-
-<p>Once the landing pad has the type info selector, the code branches to the
-code for the first catch. The catch then checks the value of the type info
-selector against the index of type info for that catch. Since the type info
-index is not known until all the type info have been gathered in the backend,
-the catch code will call the <a
-href="#llvm_eh_typeid_for"><tt>llvm.eh.typeid.for</tt></a> intrinsic to
-determine the index for a given type info. If the catch fails to match the
-selector then control is passed on to the next catch. Note: Since the landing
-pad will not be used if there is no match in the list of type info on the call
-to <a href="#llvm_eh_selector"><tt>llvm.eh.selector</tt></a>, then neither the
-last catch nor <i>catch all</i> need to perform the the check against the
-selector.</p>
-
-<p>Finally, the entry and exit of catch code is bracketed with calls to
-<tt>__cxa_begin_catch</tt> and <tt>__cxa_end_catch</tt>.
-<tt>__cxa_begin_catch</tt> takes a exception structure reference as an argument
-and returns the value of the exception object. <tt>__cxa_end_catch</tt>
-takes a exception structure reference as an argument. This function clears the
-exception from the exception space. Note: a rethrow from within the catch may
-replace this call with a <tt>__cxa_rethrow</tt>.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="cleanups">Cleanups</a>
-</div>
-
-<div class="doc_text">
-
-<p>To handle destructors and cleanups in try code, control may not run directly
-from a landing pad to the first catch. Control may actually flow from the
-landing pad to clean up code and then to the first catch. Since the required
-clean up for each invoke in a try may be different (ex., intervening
-constructor), there may be several landing pads for a given try. If cleanups
-need to be run, the number zero should be passed as the last
-<a href="#llvm_eh_selector"><tt>llvm.eh.selector</tt></a> argument.
-However for C++ a <tt>null i8*</tt> <a href="#restrictions">must</a> be passed
-instead.
-</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="throw_filters">Throw Filters</a>
-</div>
-
-<div class="doc_text">
-
-<p>C++ allows the specification of which exception types that can be thrown from
-a function. To represent this a top level landing pad may exist to filter out
-invalid types. To express this in LLVM code the landing pad will call <a
-href="#llvm_eh_selector"><tt>llvm.eh.selector</tt></a>. The arguments are the
-length of the filter expression (the number of type infos plus one), followed by
-the type infos themselves.
-<a href="#llvm_eh_selector"><tt>llvm.eh.selector</tt></a> will return a negative
-value if the exception does not match any of the type infos. If no match is
-found then a call to <tt>__cxa_call_unexpected</tt> should be made, otherwise
-<tt>_Unwind_Resume</tt>. Each of these functions require a reference to the
-exception structure.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="restrictions">Restrictions</a>
-</div>
-
-<div class="doc_text">
-
-<p>The semantics of the invoke instruction require that any exception that
-unwinds through an invoke call should result in a branch to the invoke's unwind
-label. However such a branch will only happen if the
-<a href="#llvm_eh_selector"><tt>llvm.eh.selector</tt></a> matches.
-Thus in order to ensure correct operation, the front-end must only generate
-<a href="#llvm_eh_selector"><tt>llvm.eh.selector</tt></a> calls that are
-guaranteed to always match whatever exception unwinds through the invoke.
-For most languages it is enough to pass zero, indicating the presence of
-a <a href="#cleanups">cleanup</a>, as the last
-<a href="#llvm_eh_selector"><tt>llvm.eh.selector</tt></a> argument.
-However for C++ this is not sufficient, because the C++ personality function
-will terminate the program if it detects that unwinding the exception only
-results in matches with cleanups. For C++ a <tt>null i8*</tt> should
-be passed as the last
-<a href="#llvm_eh_selector"><tt>llvm.eh.selector</tt></a> argument instead.
-This is interpreted as a catch-all by the C++ personality function, and will
-always match.
-</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_section">
- <a name="format_common_intrinsics">Exception Handling Intrinsics</a>
-</div>
-
-<div class="doc_text">
-
-<p>LLVM uses several intrinsic functions (name prefixed with "llvm.eh") to
-provide exception handling information at various points in generated code.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsubsection">
- <a name="llvm_eh_exception">llvm.eh.exception</a>
-</div>
-
-<div class="doc_text">
-<pre>
- i8* %<a href="#llvm_eh_exception">llvm.eh.exception</a>( )
-</pre>
-
-<p>This intrinsic indicates that the exception structure is available at this
-point in the code. The backend will replace this intrinsic with code to fetch
-the first argument of a call. The effect is that the intrinsic result is the
-exception structure reference.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsubsection">
- <a name="llvm_eh_selector">llvm.eh.selector</a>
-</div>
-
-<div class="doc_text">
-<pre>
- i32 %<a href="#llvm_eh_selector">llvm.eh.selector.i32</a>(i8*, i8*, i8*, ...)
- i64 %<a href="#llvm_eh_selector">llvm.eh.selector.i64</a>(i8*, i8*, i8*, ...)
-</pre>
-
-<p>This intrinsic indicates that the exception selector is available at this
-point in the code. The backend will replace this intrinsic with code to fetch
-the second argument of a call. The effect is that the intrinsic result is the
-exception selector.</p>
-
-<p><a href="#llvm_eh_selector"><tt>llvm.eh.selector</tt></a> takes a minimum of
-three arguments. The first argument is the reference to the exception
-structure. The second argument is a reference to the personality function to be
-used for this try catch sequence. Each of the remaining arguments is either a
-reference to the type info for a catch statement,
-a <a href="#throw_filters">filter</a> expression,
-or the number zero representing a <a href="#cleanups">cleanup</a>.
-The exception is tested against the arguments sequentially from first to last.
-The result of the <a href="#llvm_eh_selector"><tt>llvm.eh.selector</tt></a> is a
-positive number if the exception matched a type info, a negative number if it matched
-a filter, and zero if it matched a cleanup. If nothing is matched, the behaviour of
-the program is <a href="#restrictions">undefined</a>.
-If a type info matched then the selector value is the index of the type info in
-the exception table, which can be obtained using the
-<a href="#llvm_eh_typeid_for"><tt>llvm.eh.typeid.for</tt></a> intrinsic.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsubsection">
- <a name="llvm_eh_typeid_for">llvm.eh.typeid.for</a>
-</div>
-
-<div class="doc_text">
-<pre>
- i32 %<a href="#llvm_eh_typeid_for">llvm.eh.typeid.for.i32</a>(i8*)
- i64 %<a href="#llvm_eh_typeid_for">llvm.eh.typeid.for.i64</a>(i8*)
-</pre>
-
-<p>This intrinsic returns the type info index in the exception table of the
-current function. This value can be used to compare against the result of <a
-href="#llvm_eh_selector"><tt>llvm.eh.selector</tt></a>. The single argument is
-a reference to a type info.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_section">
- <a name="asm">Asm Table Formats</a>
-</div>
-
-<div class="doc_text">
-
-<p>There are two tables that are used by the exception handling runtime to
-determine which actions should take place when an exception is thrown.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="unwind_tables">Exception Handling Frame</a>
-</div>
-
-<div class="doc_text">
-
-<p>An exception handling frame <tt>eh_frame</tt> is very similar to the unwind
-frame used by dwarf debug info. The frame contains all the information
-necessary to tear down the current frame and restore the state of the prior
-frame. There is an exception handling frame for each function in a compile
-unit, plus a common exception handling frame that defines information common to
-all functions in the unit.</p>
-
-<p>Todo - Table details here.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="exception_tables">Exception Tables</a>
-</div>
-
-<div class="doc_text">
-
-<p>An exception table contains information about what actions to take when an
-exception is thrown in a particular part of a function's code. There is
-one exception table per function except leaf routines and functions that have
-only calls to non-throwing functions will not need an exception table.</p>
-
-<p>Todo - Table details here.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_section">
- <a name="todo">ToDo</a>
-</div>
-
-<div class="doc_text">
-
-<ol>
-
-<li><p>Testing/Testing/Testing.</p></li>
-
-</ol>
-
-</div>
-
-<!-- *********************************************************************** -->
-
-<hr>
-<address>
- <a href="http://jigsaw.w3.org/css-validator/check/referer"><img
- src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"></a>
- <a href="http://validator.w3.org/check/referer"><img
- src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!"></a>
-
- <a href="mailto:sabre@nondot.org">Chris Lattner</a><br>
- <a href="http://llvm.org">LLVM Compiler Infrastructure</a><br>
- Last modified: $Date$
-</address>
-
-</body>
-</html>
diff --git a/release_23/docs/ExtendingLLVM.html b/release_23/docs/ExtendingLLVM.html
deleted file mode 100644
index b072ed3b6e85..000000000000
--- a/release_23/docs/ExtendingLLVM.html
+++ /dev/null
@@ -1,391 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
- "http://www.w3.org/TR/html4/strict.dtd">
-<html>
-<head>
- <title>Extending LLVM: Adding instructions, intrinsics, types, etc.</title>
- <link rel="stylesheet" href="llvm.css" type="text/css">
-</head>
-
-<body>
-
-<div class="doc_title">
- Extending LLVM: Adding instructions, intrinsics, types, etc.
-</div>
-
-<ol>
- <li><a href="#introduction">Introduction and Warning</a></li>
- <li><a href="#intrinsic">Adding a new intrinsic function</a></li>
- <li><a href="#instruction">Adding a new instruction</a></li>
- <li><a href="#sdnode">Adding a new SelectionDAG node</a></li>
- <li><a href="#type">Adding a new type</a>
- <ol>
- <li><a href="#fund_type">Adding a new fundamental type</a></li>
- <li><a href="#derived_type">Adding a new derived type</a></li>
- </ol></li>
-</ol>
-
-<div class="doc_author">
- <p>Written by <a href="http://misha.brukman.net">Misha Brukman</a>,
- Brad Jones, Nate Begeman,
- and <a href="http://nondot.org/sabre">Chris Lattner</a></p>
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section">
- <a name="introduction">Introduction and Warning</a>
-</div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>During the course of using LLVM, you may wish to customize it for your
-research project or for experimentation. At this point, you may realize that
-you need to add something to LLVM, whether it be a new fundamental type, a new
-intrinsic function, or a whole new instruction.</p>
-
-<p>When you come to this realization, stop and think. Do you really need to
-extend LLVM? Is it a new fundamental capability that LLVM does not support at
-its current incarnation or can it be synthesized from already pre-existing LLVM
-elements? If you are not sure, ask on the <a
-href="http://mail.cs.uiuc.edu/mailman/listinfo/llvmdev">LLVM-dev</a> list. The
-reason is that extending LLVM will get involved as you need to update all the
-different passes that you intend to use with your extension, and there are
-<em>many</em> LLVM analyses and transformations, so it may be quite a bit of
-work.</p>
-
-<p>Adding an <a href="#intrinsic">intrinsic function</a> is far easier than
-adding an instruction, and is transparent to optimization passes. If your added
-functionality can be expressed as a
-function call, an intrinsic function is the method of choice for LLVM
-extension.</p>
-
-<p>Before you invest a significant amount of effort into a non-trivial
-extension, <span class="doc_warning">ask on the list</span> if what you are
-looking to do can be done with already-existing infrastructure, or if maybe
-someone else is already working on it. You will save yourself a lot of time and
-effort by doing so.</p>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section">
- <a name="intrinsic">Adding a new intrinsic function</a>
-</div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>Adding a new intrinsic function to LLVM is much easier than adding a new
-instruction. Almost all extensions to LLVM should start as an intrinsic
-function and then be turned into an instruction if warranted.</p>
-
-<ol>
-<li><tt>llvm/docs/LangRef.html</tt>:
- Document the intrinsic. Decide whether it is code generator specific and
- what the restrictions are. Talk to other people about it so that you are
- sure it's a good idea.</li>
-
-<li><tt>llvm/include/llvm/Intrinsics*.td</tt>:
- Add an entry for your intrinsic. Describe its memory access characteristics
- for optimization (this controls whether it will be DCE'd, CSE'd, etc). Note
- that any intrinsic using the <tt>llvm_int_ty</tt> type for an argument will
- be deemed by <tt>tblgen</tt> as overloaded and the corresponding suffix
- will be required on the intrinsic's name.</li>
-
-<li><tt>llvm/lib/Analysis/ConstantFolding.cpp</tt>: If it is possible to
- constant fold your intrinsic, add support to it in the
- <tt>canConstantFoldCallTo</tt> and <tt>ConstantFoldCall</tt> functions.</li>
-
-<li><tt>llvm/test/Regression/*</tt>: Add test cases for your test cases to the
- test suite</li>
-</ol>
-
-<p>Once the intrinsic has been added to the system, you must add code generator
-support for it. Generally you must do the following steps:</p>
-
-<dl>
-<dt>Add support to the C backend in <tt>lib/Target/CBackend/</tt></dt>
-
-<dd>Depending on the intrinsic, there are a few ways to implement this. For
- most intrinsics, it makes sense to add code to lower your intrinsic in
- <tt>LowerIntrinsicCall</tt> in <tt>lib/CodeGen/IntrinsicLowering.cpp</tt>.
- Second, if it makes sense to lower the intrinsic to an expanded sequence of
- C code in all cases, just emit the expansion in <tt>visitCallInst</tt> in
- <tt>Writer.cpp</tt>. If the intrinsic has some way to express it with GCC
- (or any other compiler) extensions, it can be conditionally supported based
- on the compiler compiling the CBE output (see <tt>llvm.prefetch</tt> for an
- example). Third, if the intrinsic really has no way to be lowered, just
- have the code generator emit code that prints an error message and calls
- abort if executed.</dd>
-
-<dt>Add support to the .td file for the target(s) of your choice in
- <tt>lib/Target/*/*.td</tt>.</dt>
-
-<dd>This is usually a matter of adding a pattern to the .td file that matches
- the intrinsic, though it may obviously require adding the instructions you
- want to generate as well. There are lots of examples in the PowerPC and X86
- backend to follow.</dd>
-</dl>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section">
- <a name="sdnode">Adding a new SelectionDAG node</a>
-</div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>As with intrinsics, adding a new SelectionDAG node to LLVM is much easier
-than adding a new instruction. New nodes are often added to help represent
-instructions common to many targets. These nodes often map to an LLVM
-instruction (add, sub) or intrinsic (byteswap, population count). In other
-cases, new nodes have been added to allow many targets to perform a common task
-(converting between floating point and integer representation) or capture more
-complicated behavior in a single node (rotate).</p>
-
-<ol>
-<li><tt>include/llvm/CodeGen/SelectionDAGNodes.h</tt>:
- Add an enum value for the new SelectionDAG node.</li>
-<li><tt>lib/CodeGen/SelectionDAG/SelectionDAG.cpp</tt>:
- Add code to print the node to <tt>getOperationName</tt>. If your new node
- can be evaluated at compile time when given constant arguments (such as an
- add of a constant with another constant), find the <tt>getNode</tt> method
- that takes the appropriate number of arguments, and add a case for your node
- to the switch statement that performs constant folding for nodes that take
- the same number of arguments as your new node.</li>
-<li><tt>lib/CodeGen/SelectionDAG/LegalizeDAG.cpp</tt>:
- Add code to <a href="CodeGenerator.html#selectiondag_legalize">legalize,
- promote, and expand</a> the node as necessary. At a minimum, you will need
- to add a case statement for your node in <tt>LegalizeOp</tt> which calls
- LegalizeOp on the node's operands, and returns a new node if any of the
- operands changed as a result of being legalized. It is likely that not all
- targets supported by the SelectionDAG framework will natively support the
- new node. In this case, you must also add code in your node's case
- statement in <tt>LegalizeOp</tt> to Expand your node into simpler, legal
- operations. The case for <tt>ISD::UREM</tt> for expanding a remainder into
- a divide, multiply, and a subtract is a good example.</li>
-<li><tt>lib/CodeGen/SelectionDAG/LegalizeDAG.cpp</tt>:
- If targets may support the new node being added only at certain sizes, you
- will also need to add code to your node's case statement in
- <tt>LegalizeOp</tt> to Promote your node's operands to a larger size, and
- perform the correct operation. You will also need to add code to
- <tt>PromoteOp</tt> to do this as well. For a good example, see
- <tt>ISD::BSWAP</tt>,
- which promotes its operand to a wider size, performs the byteswap, and then
- shifts the correct bytes right to emulate the narrower byteswap in the
- wider type.</li>
-<li><tt>lib/CodeGen/SelectionDAG/LegalizeDAG.cpp</tt>:
- Add a case for your node in <tt>ExpandOp</tt> to teach the legalizer how to
- perform the action represented by the new node on a value that has been
- split into high and low halves. This case will be used to support your
- node with a 64 bit operand on a 32 bit target.</li>
-<li><tt>lib/CodeGen/SelectionDAG/DAGCombiner.cpp</tt>:
- If your node can be combined with itself, or other existing nodes in a
- peephole-like fashion, add a visit function for it, and call that function
- from <tt></tt>. There are several good examples for simple combines you
- can do; <tt>visitFABS</tt> and <tt>visitSRL</tt> are good starting places.
- </li>
-<li><tt>lib/Target/PowerPC/PPCISelLowering.cpp</tt>:
- Each target has an implementation of the <tt>TargetLowering</tt> class,
- usually in its own file (although some targets include it in the same
- file as the DAGToDAGISel). The default behavior for a target is to
- assume that your new node is legal for all types that are legal for
- that target. If this target does not natively support your node, then
- tell the target to either Promote it (if it is supported at a larger
- type) or Expand it. This will cause the code you wrote in
- <tt>LegalizeOp</tt> above to decompose your new node into other legal
- nodes for this target.</li>
-<li><tt>lib/Target/TargetSelectionDAG.td</tt>:
- Most current targets supported by LLVM generate code using the DAGToDAG
- method, where SelectionDAG nodes are pattern matched to target-specific
- nodes, which represent individual instructions. In order for the targets
- to match an instruction to your new node, you must add a def for that node
- to the list in this file, with the appropriate type constraints. Look at
- <tt>add</tt>, <tt>bswap</tt>, and <tt>fadd</tt> for examples.</li>
-<li><tt>lib/Target/PowerPC/PPCInstrInfo.td</tt>:
- Each target has a tablegen file that describes the target's instruction
- set. For targets that use the DAGToDAG instruction selection framework,
- add a pattern for your new node that uses one or more target nodes.
- Documentation for this is a bit sparse right now, but there are several
- decent examples. See the patterns for <tt>rotl</tt> in
- <tt>PPCInstrInfo.td</tt>.</li>
-<li>TODO: document complex patterns.</li>
-<li><tt>llvm/test/Regression/CodeGen/*</tt>: Add test cases for your new node
- to the test suite. <tt>llvm/test/Regression/CodeGen/X86/bswap.ll</tt> is
- a good example.</li>
-</ol>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section">
- <a name="instruction">Adding a new instruction</a>
-</div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p><span class="doc_warning">WARNING: adding instructions changes the bitcode
-format, and it will take some effort to maintain compatibility with
-the previous version.</span> Only add an instruction if it is absolutely
-necessary.</p>
-
-<ol>
-
-<li><tt>llvm/include/llvm/Instruction.def</tt>:
- add a number for your instruction and an enum name</li>
-
-<li><tt>llvm/include/llvm/Instructions.h</tt>:
- add a definition for the class that will represent your instruction</li>
-
-<li><tt>llvm/include/llvm/Support/InstVisitor.h</tt>:
- add a prototype for a visitor to your new instruction type</li>
-
-<li><tt>llvm/lib/AsmParser/Lexer.l</tt>:
- add a new token to parse your instruction from assembly text file</li>
-
-<li><tt>llvm/lib/AsmParser/llvmAsmParser.y</tt>:
- add the grammar on how your instruction can be read and what it will
- construct as a result</li>
-
-<li><tt>llvm/lib/Bitcode/Reader/Reader.cpp</tt>:
- add a case for your instruction and how it will be parsed from bitcode</li>
-
-<li><tt>llvm/lib/VMCore/Instruction.cpp</tt>:
- add a case for how your instruction will be printed out to assembly</li>
-
-<li><tt>llvm/lib/VMCore/Instructions.cpp</tt>:
- implement the class you defined in
- <tt>llvm/include/llvm/Instructions.h</tt></li>
-
-<li>Test your instruction</li>
-
-<li><tt>llvm/lib/Target/*</tt>:
- Add support for your instruction to code generators, or add a lowering
- pass.</li>
-
-<li><tt>llvm/test/Regression/*</tt>: add your test cases to the test suite.</li>
-
-</ol>
-
-<p>Also, you need to implement (or modify) any analyses or passes that you want
-to understand this new instruction.</p>
-
-</div>
-
-
-<!-- *********************************************************************** -->
-<div class="doc_section">
- <a name="type">Adding a new type</a>
-</div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p><span class="doc_warning">WARNING: adding new types changes the bitcode
-format, and will break compatibility with currently-existing LLVM
-installations.</span> Only add new types if it is absolutely necessary.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="fund_type">Adding a fundamental type</a>
-</div>
-
-<div class="doc_text">
-
-<ol>
-
-<li><tt>llvm/include/llvm/Type.h</tt>:
- add enum for the new type; add static <tt>Type*</tt> for this type</li>
-
-<li><tt>llvm/lib/VMCore/Type.cpp</tt>:
- add mapping from <tt>TypeID</tt> =&gt; <tt>Type*</tt>;
- initialize the static <tt>Type*</tt></li>
-
-<li><tt>llvm/lib/AsmReader/Lexer.l</tt>:
- add ability to parse in the type from text assembly</li>
-
-<li><tt>llvm/lib/AsmReader/llvmAsmParser.y</tt>:
- add a token for that type</li>
-
-</ol>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="derived_type">Adding a derived type</a>
-</div>
-
-<div class="doc_text">
-
-<ol>
-<li><tt>llvm/include/llvm/Type.h</tt>:
- add enum for the new type; add a forward declaration of the type
- also</li>
-
-<li><tt>llvm/include/llvm/DerivedTypes.h</tt>:
- add new class to represent new class in the hierarchy; add forward
- declaration to the TypeMap value type</li>
-
-<li><tt>llvm/lib/VMCore/Type.cpp</tt>:
- add support for derived type to:
-<div class="doc_code">
-<pre>
-std::string getTypeDescription(const Type &amp;Ty,
- std::vector&lt;const Type*&gt; &amp;TypeStack)
-bool TypesEqual(const Type *Ty, const Type *Ty2,
- std::map&lt;const Type*, const Type*&gt; &amp; EqTypes)
-</pre>
-</div>
- add necessary member functions for type, and factory methods</li>
-
-<li><tt>llvm/lib/AsmReader/Lexer.l</tt>:
- add ability to parse in the type from text assembly</li>
-
-<li><tt>llvm/lib/BitCode/Writer/Writer.cpp</tt>:
- modify <tt>void BitcodeWriter::outputType(const Type *T)</tt> to serialize
- your type</li>
-
-<li><tt>llvm/lib/BitCode/Reader/Reader.cpp</tt>:
- modify <tt>const Type *BitcodeReader::ParseType()</tt> to read your data
- type</li>
-
-<li><tt>llvm/lib/VMCore/AsmWriter.cpp</tt>:
- modify
-<div class="doc_code">
-<pre>
-void calcTypeName(const Type *Ty,
- std::vector&lt;const Type*&gt; &amp;TypeStack,
- std::map&lt;const Type*,std::string&gt; &amp;TypeNames,
- std::string &amp; Result)
-</pre>
-</div>
- to output the new derived type
-</li>
-
-
-</ol>
-
-</div>
-
-<!-- *********************************************************************** -->
-
-<hr>
-<address>
- <a href="http://jigsaw.w3.org/css-validator/check/referer"><img
- src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"></a>
- <a href="http://validator.w3.org/check/referer"><img
- src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!" /></a>
-
- <a href="http://llvm.org">The LLVM Compiler Infrastructure</a>
- <br>
- Last modified: $Date$
-</address>
-
-</body>
-</html>
diff --git a/release_23/docs/FAQ.html b/release_23/docs/FAQ.html
deleted file mode 100644
index 95e425aac669..000000000000
--- a/release_23/docs/FAQ.html
+++ /dev/null
@@ -1,737 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
- "http://www.w3.org/TR/html4/strict.dtd">
-<html>
-<head>
- <title>LLVM: Frequently Asked Questions</title>
- <style type="text/css">
- @import url("llvm.css");
- .question { font-weight: bold }
- .answer { margin-left: 2em }
- </style>
-</head>
-<body>
-
-<div class="doc_title">
- LLVM: Frequently Asked Questions
-</div>
-
-<ol>
- <li><a href="#license">License</a>
- <ol>
- <li>Why are the LLVM source code and the front-end distributed under different
- licenses?</li>
- <li>Does the University of Illinois Open Source License really qualify as an
- "open source" license?</li>
- <li>Can I modify LLVM source code and redistribute the modified source?</li>
- <li>Can I modify LLVM source code and redistribute binaries or other tools
- based on it, without redistributing the source?</li>
- </ol></li>
-
- <li><a href="#source">Source code</a>
- <ol>
- <li>In what language is LLVM written?</li>
- <li>How portable is the LLVM source code?</li>
- </ol></li>
-
- <li><a href="#build">Build Problems</a>
- <ol>
- <li>When I run configure, it finds the wrong C compiler.</li>
- <li>The <tt>configure</tt> script finds the right C compiler, but it uses the
- LLVM linker from a previous build. What do I do?</li>
- <li>When creating a dynamic library, I get a strange GLIBC error.</li>
- <li>I've updated my source tree from Subversion, and now my build is trying
- to use a file/directory that doesn't exist.</li>
- <li>I've modified a Makefile in my source tree, but my build tree keeps using
- the old version. What do I do?</li>
- <li>I've upgraded to a new version of LLVM, and I get strange build
- errors.</li>
- <li>I've built LLVM and am testing it, but the tests freeze.</li>
- <li>Why do test results differ when I perform different types of builds?</li>
- <li>Compiling LLVM with GCC 3.3.2 fails, what should I do?</li>
- <li>When I use the test suite, all of the C Backend tests fail. What is
- wrong?</li>
- <li>After Subversion update, rebuilding gives the error "No rule to make
- target".</li>
- <li><a href="#llvmc">The <tt>llvmc</tt> program gives me errors/doesn't
- work.</a></li>
- </ol></li>
-
- <li><a href="#felangs">Source Languages</a>
- <ol>
- <li><a href="#langs">What source languages are supported?</a></li>
- <li><a href="#langirgen">I'd like to write a self-hosting LLVM compiler. How
- should I interface with the LLVM middle-end optimizers and back-end code
- generators?</a></div>
- <li><a href="#langhlsupp">What support is there for higher level source
- language constructs for building a compiler?</a></li>
- <li><a href="GetElementPtr.html">I don't understand the GetElementPtr
- instruction. Help!</a></li>
- </ol>
-
- <li><a href="#cfe">Using the GCC Front End</a>
- <ol>
- <li>
- When I compile software that uses a configure script, the configure script
- thinks my system has all of the header files and libraries it is testing
- for. How do I get configure to work correctly?
- </li>
-
- <li>
- When I compile code using the LLVM GCC front end, it complains that it
- cannot find libcrtend.a.
- </li>
-
- <li>
- How can I disable all optimizations when compiling code using the LLVM GCC front end?
- </li>
-
- <li><a href="#translatec++">Can I use LLVM to convert C++ code to C code?</a></li>
-
- </ol>
- </li>
-
- <li><a href="#cfe_code">Questions about code generated by the GCC front-end</a>
- <ol>
- <li><a href="#iosinit">What is this <tt>llvm.global_ctors</tt> and
- <tt>_GLOBAL__I__tmp_webcompile...</tt> stuff that happens when I
- #include &lt;iostream&gt;?</a></li>
- <li><a href="#codedce">Where did all of my code go??</a></li>
- <li><a href="#undef">What is this "<tt>undef</tt>" thing that shows up in my code?</a></li>
- </ol>
- </li>
-</ol>
-
-<div class="doc_author">
- <p>Written by <a href="http://llvm.org">The LLVM Team</a></p>
-</div>
-
-
-<!-- *********************************************************************** -->
-<div class="doc_section">
- <a name="license">License</a>
-</div>
-<!-- *********************************************************************** -->
-
-<div class="question">
-<p>Why are the LLVM source code and the front-end distributed under different
-licenses?</p>
-</div>
-
-<div class="answer">
-<p>The C/C++ front-ends are based on GCC and must be distributed under the GPL.
-Our aim is to distribute LLVM source code under a <em>much less restrictive</em>
-license, in particular one that does not compel users who distribute tools based
-on modifying the source to redistribute the modified source code as well.</p>
-</div>
-
-<div class="question">
-<p>Does the University of Illinois Open Source License really qualify as an
-"open source" license?</p>
-</div>
-
-<div class="answer">
-<p>Yes, the license is <a
-href="http://www.opensource.org/licenses/UoI-NCSA.php">certified</a> by the Open
-Source Initiative (OSI).</p>
-</div>
-
-<div class="question">
-<p>Can I modify LLVM source code and redistribute the modified source?</p>
-</div>
-
-<div class="answer">
-<p>Yes. The modified source distribution must retain the copyright notice and
-follow the three bulletted conditions listed in the <a
-href="http://llvm.org/releases/1.3/LICENSE.TXT">LLVM license</a>.</p>
-</div>
-
-<div class="question">
-<p>Can I modify LLVM source code and redistribute binaries or other tools based
-on it, without redistributing the source?</p>
-</div>
-
-<div class="answer">
-<p>Yes, this is why we distribute LLVM under a less restrictive license than
-GPL, as explained in the first question above.</p>
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section">
- <a name="source">Source Code</a>
-</div>
-<!-- *********************************************************************** -->
-
-<div class="question">
-<p>In what language is LLVM written?</p>
-</div>
-
-<div class="answer">
-<p>All of the LLVM tools and libraries are written in C++ with extensive use of
-the STL.</p>
-</div>
-
-<div class="question">
-<p>How portable is the LLVM source code?</p>
-</div>
-
-<div class="answer">
-<p>The LLVM source code should be portable to most modern UNIX-like operating
-systems. Most of the code is written in standard C++ with operating system
-services abstracted to a support library. The tools required to build and test
-LLVM have been ported to a plethora of platforms.</p>
-
-<p>Some porting problems may exist in the following areas:</p>
-
-<ul>
- <li>The GCC front end code is not as portable as the LLVM suite, so it may not
- compile as well on unsupported platforms.</li>
-
- <li>The LLVM build system relies heavily on UNIX shell tools, like the Bourne
- Shell and sed. Porting to systems without these tools (MacOS 9, Plan 9)
- will require more effort.</li>
-</ul>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section">
- <a name="build">Build Problems</a>
-</div>
-<!-- *********************************************************************** -->
-
-<div class="question">
-<p>When I run configure, it finds the wrong C compiler.</p>
-</div>
-
-<div class="answer">
-
-<p>The <tt>configure</tt> script attempts to locate first <tt>gcc</tt> and then
-<tt>cc</tt>, unless it finds compiler paths set in <tt>CC</tt> and <tt>CXX</tt>
-for the C and C++ compiler, respectively.</p>
-
-<p>If <tt>configure</tt> finds the wrong compiler, either adjust your
-<tt>PATH</tt> environment variable or set <tt>CC</tt> and <tt>CXX</tt>
-explicitly.</p>
-
-</div>
-
-<div class="question">
-<p>The <tt>configure</tt> script finds the right C compiler, but it uses the
-LLVM linker from a previous build. What do I do?</p>
-</div>
-
-<div class="answer">
-<p>The <tt>configure</tt> script uses the <tt>PATH</tt> to find executables, so
-if it's grabbing the wrong linker/assembler/etc, there are two ways to fix
-it:</p>
-
-<ol>
- <li><p>Adjust your <tt>PATH</tt> environment variable so that the correct
- program appears first in the <tt>PATH</tt>. This may work, but may not be
- convenient when you want them <i>first</i> in your path for other
- work.</p></li>
-
- <li><p>Run <tt>configure</tt> with an alternative <tt>PATH</tt> that is
- correct. In a Borne compatible shell, the syntax would be:</p>
-
-<div class="doc_code">
-<pre>
-% PATH=[the path without the bad program] ./configure ...
-</pre>
-</div>
-
- <p>This is still somewhat inconvenient, but it allows <tt>configure</tt>
- to do its work without having to adjust your <tt>PATH</tt>
- permanently.</p></li>
-</ol>
-
-</div>
-
-<div class="question">
-<p>When creating a dynamic library, I get a strange GLIBC error.</p>
-</div>
-
-<div class="answer">
-<p>Under some operating systems (i.e. Linux), libtool does not work correctly if
-GCC was compiled with the --disable-shared option. To work around this, install
-your own version of GCC that has shared libraries enabled by default.</p>
-</div>
-
-<div class="question">
-<p>I've updated my source tree from Subversion, and now my build is trying to
-use a file/directory that doesn't exist.</p>
-</div>
-
-<div class="answer">
-<p>You need to re-run configure in your object directory. When new Makefiles
-are added to the source tree, they have to be copied over to the object tree in
-order to be used by the build.</p>
-</div>
-
-<div class="question">
-<p>I've modified a Makefile in my source tree, but my build tree keeps using the
-old version. What do I do?</p>
-</div>
-
-<div class="answer">
-<p>If the Makefile already exists in your object tree, you
-can just run the following command in the top level directory of your object
-tree:</p>
-
-<div class="doc_code">
-<pre>% ./config.status &lt;relative path to Makefile&gt;</pre>
-</div>
-
-<p>If the Makefile is new, you will have to modify the configure script to copy
-it over.</p>
-
-</div>
-
-<div class="question">
-<p>I've upgraded to a new version of LLVM, and I get strange build errors.</p>
-</div>
-
-<div class="answer">
-
-<p>Sometimes, changes to the LLVM source code alters how the build system works.
-Changes in libtool, autoconf, or header file dependencies are especially prone
-to this sort of problem.</p>
-
-<p>The best thing to try is to remove the old files and re-build. In most
-cases, this takes care of the problem. To do this, just type <tt>make
-clean</tt> and then <tt>make</tt> in the directory that fails to build.</p>
-
-</div>
-
-<div class="question">
-<p>I've built LLVM and am testing it, but the tests freeze.</p>
-</div>
-
-<div class="answer">
-
-<p>This is most likely occurring because you built a profile or release
-(optimized) build of LLVM and have not specified the same information on the
-<tt>gmake</tt> command line.</p>
-
-<p>For example, if you built LLVM with the command:</p>
-
-<div class="doc_code">
-<pre>% gmake ENABLE_PROFILING=1</pre>
-</div>
-
-<p>...then you must run the tests with the following commands:</p>
-
-<div class="doc_code">
-<pre>
-% cd llvm/test
-% gmake ENABLE_PROFILING=1
-</pre>
-</div>
-
-</div>
-
-<div class="question">
-<p>Why do test results differ when I perform different types of builds?</p>
-</div>
-
-<div class="answer">
-
-<p>The LLVM test suite is dependent upon several features of the LLVM tools and
-libraries.</p>
-
-<p>First, the debugging assertions in code are not enabled in optimized or
-profiling builds. Hence, tests that used to fail may pass.</p>
-
-<p>Second, some tests may rely upon debugging options or behavior that is only
-available in the debug build. These tests will fail in an optimized or profile
-build.</p>
-
-</div>
-
-<div class="question">
-<p>Compiling LLVM with GCC 3.3.2 fails, what should I do?</p>
-</div>
-
-<div class="answer">
-<p>This is <a href="http://gcc.gnu.org/PR?13392">a bug in GCC</a>, and
-affects projects other than LLVM. Try upgrading or downgrading your GCC.</p>
-</div>
-
-<div class="question">
-<p>After Subversion update, rebuilding gives the error "No rule to make
-target".</p>
-</div>
-
-<div class="answer">
-<p>If the error is of the form:</p>
-
-<div class="doc_code">
-<pre>
-gmake[2]: *** No rule to make target `/path/to/somefile', needed by
-`/path/to/another/file.d'.<br>
-Stop.
-</pre>
-</div>
-
-<p>This may occur anytime files are moved within the Subversion repository or
-removed entirely. In this case, the best solution is to erase all
-<tt>.d</tt> files, which list dependencies for source files, and rebuild:</p>
-
-<div class="doc_code">
-<pre>
-% cd $LLVM_OBJ_DIR
-% rm -f `find . -name \*\.d`
-% gmake
-</pre>
-</div>
-
-<p>In other cases, it may be necessary to run <tt>make clean</tt> before
-rebuilding.</p>
-</div>
-
-<div class="question"><p><a name="llvmc">
-The <tt>llvmc</tt> program gives me errors/doesn't work.</a></p>
-</div>
-
-<div class="answer">
-<p><tt>llvmc</tt> is experimental and isn't really supported. We suggest
-using <tt>llvm-gcc</tt> instead.</p>
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section"><a name="felangs">Source Languages</a></div>
-
-<div class="question"><p>
- <a name="langs">What source languages are supported?</a></p>
-</div>
-<div class="answer">
- <p>LLVM currently has full support for C and C++ source languages. These are
- available through a special version of GCC that LLVM calls the
- <a href="#cfe">C Front End</a></p>
- <p>There is an incomplete version of a Java front end available in the
- <tt>java</tt> module. There is no documentation on this yet so
- you'll need to download the code, compile it, and try it.</p>
- <p>In the <tt>stacker</tt> module is a compiler and runtime
- library for the Stacker language, a "toy" language loosely based on Forth.</p>
- <p>The PyPy developers are working on integrating LLVM into the PyPy backend
- so that PyPy language can translate to LLVM.</p>
-</div>
-
-<div class="question"><p><a name="langirgen">
- I'd like to write a self-hosting LLVM compiler. How should I interface with
- the LLVM middle-end optimizers and back-end code generators?
-</a></p></div>
-<div class="answer">
- <p>Your compiler front-end will communicate with LLVM by creating a module in
- the LLVM intermediate representation (IR) format. Assuming you want to
- write your language's compiler in the language itself (rather than C++),
- there are 3 major ways to tackle generating LLVM IR from a front-end:</p>
- <ul>
- <li>
- <strong>Call into the LLVM libraries code using your language's FFI
- (foreign function interface).</strong>
- <ul>
- <li><em>for:</em> best tracks changes to the LLVM IR, .ll syntax,
- and .bc format</li>
- <li><em>for:</em> enables running LLVM optimization passes without a
- emit/parse overhead</li>
- <li><em>for:</em> adapts well to a JIT context</li>
- <li><em>against:</em> lots of ugly glue code to write</li>
- </ul>
- </li>
- <li>
- <strong>Emit LLVM assembly from your compiler's native language.</strong>
- <ul>
- <li><em>for:</em> very straightforward to get started</li>
- <li><em>against:</em> the .ll parser is slower than the bitcode reader
- when interfacing to the middle end</li>
- <li><em>against:</em> you'll have to re-engineer the LLVM IR object
- model and asm writer in your language</li>
- <li><em>against:</em> it may be harder to track changes to the IR</li>
- </ul>
- </li>
- <li>
- <strong>Emit LLVM bitcode from your compiler's native language.</strong>
- <ul>
- <li><em>for:</em> can use the more-efficient bitcode reader when
- interfacing to the middle end</li>
- <li><em>against:</em> you'll have to re-engineer the LLVM IR object
- model and bitcode writer in your language</li>
- <li><em>against:</em> it may be harder to track changes to the IR</li>
- </ul>
- </li>
- </ul>
- <p>If you go with the first option, the C bindings in include/llvm-c should
- help a lot, since most languages have strong support for interfacing with
- C. The most common hurdle with calling C from managed code is interfacing
- with the garbage collector. The C interface was designed to require very
- little memory management, and so is straightforward in this regard.</p>
-</div>
-
-<div class="question"><p><a name="langhlsupp">
- What support is there for a higher level source language constructs for
- building a compiler?</a></p>
-</div>
-<div class="answer">
- <p>Currently, there isn't much. LLVM supports an intermediate representation
- which is useful for code representation but will not support the high level
- (abstract syntax tree) representation needed by most compilers. There are no
- facilities for lexical nor semantic analysis. There is, however, a <i>mostly
- implemented</i> configuration-driven
- <a href="CompilerDriver.html">compiler driver</a> which simplifies the task
- of running optimizations, linking, and executable generation.</p>
-</div>
-
-<div class="question"><p><a name="langhlsupp">
- I don't understand the GetElementPtr instruction. Help!</a></p>
-</div>
-<div class="answer">
- <p>See <a href="GetElementPtr.html">The Often Misunderstood GEP
- Instruction</a>.</p>
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section">
- <a name="cfe">Using the GCC Front End</a>
-</div>
-
-<div class="question">
-<p>
-When I compile software that uses a configure script, the configure script
-thinks my system has all of the header files and libraries it is testing for.
-How do I get configure to work correctly?
-</p>
-</div>
-
-<div class="answer">
-<p>
-The configure script is getting things wrong because the LLVM linker allows
-symbols to be undefined at link time (so that they can be resolved during JIT
-or translation to the C back end). That is why configure thinks your system
-"has everything."
-</p>
-<p>
-To work around this, perform the following steps:
-</p>
-<ol>
- <li>Make sure the CC and CXX environment variables contains the full path to
- the LLVM GCC front end.</li>
-
- <li>Make sure that the regular C compiler is first in your PATH. </li>
-
- <li>Add the string "-Wl,-native" to your CFLAGS environment variable.</li>
-</ol>
-
-<p>
-This will allow the <tt>llvm-ld</tt> linker to create a native code executable
-instead of shell script that runs the JIT. Creating native code requires
-standard linkage, which in turn will allow the configure script to find out if
-code is not linking on your system because the feature isn't available on your
-system.</p>
-</div>
-
-<div class="question">
-<p>
-When I compile code using the LLVM GCC front end, it complains that it cannot
-find libcrtend.a.
-</p>
-</div>
-
-<div class="answer">
-<p>
-The only way this can happen is if you haven't installed the runtime library. To
-correct this, do:</p>
-
-<div class="doc_code">
-<pre>
-% cd llvm/runtime
-% make clean ; make install-bytecode
-</pre>
-</div>
-</div>
-
-<div class="question">
-<p>
-How can I disable all optimizations when compiling code using the LLVM GCC front end?
-</p>
-</div>
-
-<div class="answer">
-<p>
-Passing "-Wa,-disable-opt -Wl,-disable-opt" will disable *all* cleanup and
-optimizations done at the llvm level, leaving you with the truly horrible
-code that you desire.
-</p>
-</div>
-
-
-<div class="question">
-<p>
-<a name="translatec++">Can I use LLVM to convert C++ code to C code?</a>
-</p>
-</div>
-
-<div class="answer">
-<p>Yes, you can use LLVM to convert code from any language LLVM supports to C.
-Note that the generated C code will be very low level (all loops are lowered
-to gotos, etc) and not very pretty (comments are stripped, original source
-formatting is totally lost, variables are renamed, expressions are regrouped),
-so this may not be what you're looking for. However, this is a good way to add
-C++ support for a processor that does not otherwise have a C++ compiler.
-</p>
-
-<p>Use commands like this:</p>
-
-<ol>
- <li><p>Compile your program as normal with llvm-g++:</p>
-
-<div class="doc_code">
-<pre>
-% llvm-g++ x.cpp -o program
-</pre>
-</div>
-
- <p>or:</p>
-
-<div class="doc_code">
-<pre>
-% llvm-g++ a.cpp -c
-% llvm-g++ b.cpp -c
-% llvm-g++ a.o b.o -o program
-</pre>
-</div>
-
- <p>With llvm-gcc3, this will generate program and program.bc. The .bc
- file is the LLVM version of the program all linked together.</p></li>
-
- <li><p>Convert the LLVM code to C code, using the LLC tool with the C
- backend:</p>
-
-<div class="doc_code">
-<pre>
-% llc -march=c program.bc -o program.c
-</pre>
-</div></li>
-
-<li><p>Finally, compile the C file:</p>
-
-<div class="doc_code">
-<pre>
-% cc x.c
-</pre>
-</div></li>
-
-</ol>
-
-<p>Note that, by default, the C backend does not support exception handling. If
-you want/need it for a certain program, you can enable it by passing
-"-enable-correct-eh-support" to the llc program. The resultant code will use
-setjmp/longjmp to implement exception support that is correct but relatively
-slow.</p>
-
-<p>Also note: this specific sequence of commands won't work if you use a
-function defined in the C++ runtime library (or any other C++ library). To
-access an external C++ library, you must manually compile libstdc++ to LLVM
-bitcode, statically link it into your program, then use the commands above to
-convert the whole result into C code. Alternatively, you can compile the
-libraries and your application into two different chunks of C code and link
-them.</p>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section">
- <a name="cfe_code">Questions about code generated by the GCC front-end</a>
-</div>
-
-<div class="question">
-<a name="iosinit"></a>
-<p> What is this <tt>llvm.global_ctors</tt> and
-<tt>_GLOBAL__I__tmp_webcompile...</tt> stuff that happens when I #include
-&lt;iostream&gt;?</p>
-</div>
-
-<div class="answer">
-
-<p>If you #include the &lt;iostream&gt; header into a C++ translation unit, the
-file will probably use the <tt>std::cin</tt>/<tt>std::cout</tt>/... global
-objects. However, C++ does not guarantee an order of initialization between
-static objects in different translation units, so if a static ctor/dtor in your
-.cpp file used <tt>std::cout</tt>, for example, the object would not necessarily
-be automatically initialized before your use.</p>
-
-<p>To make <tt>std::cout</tt> and friends work correctly in these scenarios, the
-STL that we use declares a static object that gets created in every translation
-unit that includes <tt>&lt;iostream&gt;</tt>. This object has a static
-constructor and destructor that initializes and destroys the global iostream
-objects before they could possibly be used in the file. The code that you see
-in the .ll file corresponds to the constructor and destructor registration code.
-</p>
-
-<p>If you would like to make it easier to <b>understand</b> the LLVM code
-generated by the compiler in the demo page, consider using <tt>printf()</tt>
-instead of <tt>iostream</tt>s to print values.</p>
-
-</div>
-
-<!--=========================================================================-->
-
-<div class="question"><p>
-<a name="codedce"></a>
-Where did all of my code go??
-</p></div>
-
-<div class="answer">
-<p>
-If you are using the LLVM demo page, you may often wonder what happened to all
-of the code that you typed in. Remember that the demo script is running the
-code through the LLVM optimizers, so if your code doesn't actually do anything
-useful, it might all be deleted.
-</p>
-
-<p>
-To prevent this, make sure that the code is actually needed. For example, if
-you are computing some expression, return the value from the function instead of
-leaving it in a local variable. If you really want to constrain the optimizer,
-you can read from and assign to <tt>volatile</tt> global variables.
-</p>
-</div>
-
-<!--=========================================================================-->
-
-<div class="question"><p>
-<a name="undef"></a>
-<p>What is this "<tt>undef</tt>" thing that shows up in my code?
-</p></div>
-
-<div class="answer">
-<p>
-<a href="LangRef.html#undef"><tt>undef</tt></a> is the LLVM way of representing
-a value that is not defined. You can get these if you do not initialize a
-variable before you use it. For example, the C function:</p>
-
-<div class="doc_code">
-<pre>
-int X() { int i; return i; }
-</pre>
-</div>
-
-<p>Is compiled to "<tt>ret i32 undef</tt>" because "<tt>i</tt>" never has
-a value specified for it.</p>
-</div>
-
-<!-- *********************************************************************** -->
-
-<hr>
-<address>
- <a href="http://jigsaw.w3.org/css-validator/check/referer"><img
- src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"></a>
- <a href="http://validator.w3.org/check/referer"><img
- src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!"></a>
-
- <a href="http://llvm.org">LLVM Compiler Infrastructure</a><br>
- Last modified: $Date$
-</address>
-
-</body>
-</html>
diff --git a/release_23/docs/GCCFEBuildInstrs.html b/release_23/docs/GCCFEBuildInstrs.html
deleted file mode 100644
index 80863f6b626b..000000000000
--- a/release_23/docs/GCCFEBuildInstrs.html
+++ /dev/null
@@ -1,284 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
- "http://www.w3.org/TR/html4/strict.dtd">
-<html>
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
- <link rel="stylesheet" href="llvm.css" type="text/css" media="screen">
- <title>Building the LLVM GCC Front-End</title>
-</head>
-<body>
-
-<div class="doc_title">
- Building the LLVM GCC Front-End
-</div>
-
-<ol>
- <li><a href="#instructions">Building llvm-gcc from Source</a></li>
- <li><a href="#license">License Information</a></li>
-</ol>
-
-<div class="doc_author">
- <p>Written by the LLVM Team</p>
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section">
- <a name="instructions">Building llvm-gcc from Source</a>
-</div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>This section describes how to acquire and build llvm-gcc 4.0 and 4.2, which are
-based on the GCC 4.0.1/4.2.1 front-ends respectively. Both front-ends support C,
-C++, Objective-C and Objective-C++. The 4.2 front-end also supports Ada and
-Fortran to some extent. Note that the instructions for building these front-ends
-are completely different (and much easier!) than those for building llvm-gcc3 in
-the past.</p>
-
-<ol>
- <li><p>Retrieve the appropriate llvm-gcc4.x-y.z.source.tar.gz archive from the
- <a href="http://llvm.org/releases/">llvm web site</a>.</p>
-
- <p>It is also possible to download the sources of the llvm-gcc front end
- from a read-only mirror using subversion. To check out the 4.0 code
- for first time use:</p>
-
-<div class="doc_code">
-<pre>
-svn co http://llvm.org/svn/llvm-project/llvm-gcc-4.0/trunk <i>dst-directory</i>
-</pre>
-</div>
-
-<p>To check out the 4.2 code use:</p>
-
-<div class="doc_code">
-<pre>
-svn co http://llvm.org/svn/llvm-project/llvm-gcc-4.2/trunk <i>dst-directory</i>
-</pre>
-</div>
-
- <p>After that, the code can be be updated in the destination directory
- using:</p>
-
-<div class="doc_code">
-<pre>svn update</pre>
-</div>
-
- <p>The mirror is brought up to date every evening.</p></li>
-
- <li>Follow the directions in the top-level <tt>README.LLVM</tt> file for
- up-to-date instructions on how to build llvm-gcc. See below for building
- with support for Ada or Fortran.
-</ol>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section">
- <a name="license">Building the Ada front-end</a>
-</div>
-
-<div class="doc_text">
-<p>Building with support for Ada amounts to following the directions in the
-top-level <tt>README.LLVM</tt> file, adding ",ada" to EXTRALANGS, for example:
-<tt>EXTRALANGS=,ada</tt></p>
-
-<p>There are some complications however:</p>
-
-<ol>
- <li><p>The only platform for which the Ada front-end is known to build is
- 32 bit intel x86 running linux. It is unlikely to build for other
- systems without some work.</p></li>
- <li><p>The build requires having a compiler that supports Ada, C and C++.
- The Ada front-end is written in Ada so an Ada compiler is needed to
- build it. Compilers known to work with the
- <a href="http://llvm.org/releases/download.html">LLVM 2.2 release</a>
- are <a href="http://gcc.gnu.org/releases.html">gcc-4.2</a> and the
- <a href="http://libre.adacore.com/">2005 GNAT GPL Edition</a>.
- <a href="GettingStarted.html#checkout">LLVM from subversion</a>
- also works with the
- <a href="http://libre.adacore.com/">2006 and 2007 GNAT GPL Editions</a>.
- The LLVM parts of llvm-gcc are written in C++ so a C++ compiler is
- needed to build them. The rest of gcc is written in C.
- Some linux distributions provide a version of gcc that supports all
- three languages (the Ada part often comes as an add-on package to
- the rest of gcc). Otherwise it is possible to combine two versions
- of gcc, one that supports Ada and C (such as the
- <a href="http://libre.adacore.com/">2005 GNAT GPL Edition</a>)
- and another which supports C++, see below.</p></li>
- <li><p>Because the Ada front-end is experimental, it is wise to build the
- compiler with checking enabled. This causes it to run much slower, but
- helps catch mistakes in the compiler (please report any problems using
- <a href="http://llvm.org/bugs">LLVM bugzilla</a>).</p></li>
-</ol>
-
-<p>Supposing appropriate compilers are available, llvm-gcc with Ada support can
- be built on an x86-32 linux box using the following recipe:</p>
-
-<ol>
- <li><p>Download the <a href="http://llvm.org/releases/download.html">LLVM source</a>
- and unpack it:</p>
-
-<div class="doc_code">
-<pre>wget http://llvm.org/releases/2.2/llvm-2.2.tar.gz
-tar xzf llvm-2.2.tar.gz
-mv llvm-2.2 llvm</pre>
-</div>
-
- <p>or <a href="GettingStarted.html#checkout">check out the
- latest version from subversion</a>:</p>
-
-<div class="doc_code">
-<pre>svn co http://llvm.org/svn/llvm-project/llvm/trunk llvm</pre>
-</div>
- </li>
-
- <li><p>Download the
- <a href="http://llvm.org/releases/download.html">llvm-gcc-4.2 source</a>
- and unpack it:</p>
-
-<div class="doc_code">
-<pre>wget http://llvm.org/releases/2.2/llvm-gcc4.2-2.2.source.tar.gz
-tar xzf llvm-gcc4.2-2.2.source.tar.gz
-mv llvm-gcc4.2-2.2.source llvm-gcc-4.2</pre>
-</div>
-
- <p>or <a href="GettingStarted.html#checkout">check out the
- latest version from subversion</a>:</p>
-
-<div class="doc_code">
-<pre>svn co http://llvm.org/svn/llvm-project/llvm-gcc-4.2/trunk llvm-gcc-4.2</pre>
-</div>
- </li>
-
- <li><p>Make a build directory <tt>llvm-objects</tt> for llvm and make it the
- current directory:</p>
-
-<div class="doc_code">
-<pre>mkdir llvm-objects
-cd llvm-objects</pre>
-</div>
- </li>
-
- <li><p>Configure LLVM (here it is configured to install into <tt>/usr/local</tt>):</p>
-
-<div class="doc_code">
-<pre>../llvm/configure --prefix=<b>/usr/local</b></pre>
-</div>
-
- <p>If you have a multi-compiler setup and the C++ compiler is not the
- default, then you can configure like this:</p>
-
-<div class="doc_code">
-<pre>CXX=<b>PATH_TO_C++_COMPILER</b> ../llvm/configure --prefix=<b>/usr/local</b></pre>
-</div>
- </li>
-
- <li><p>Build LLVM with checking enabled (use <tt>ENABLE_OPTIMIZED=1</tt> to
- build without checking):</p>
-
-<div class="doc_code">
-<pre>make ENABLE_OPTIMIZED=0</pre>
-</div>
- </li>
-
- <li><p>Install LLVM (optional):</p>
-
-<div class="doc_code">
-<pre>make install</pre>
-</div>
- </li>
-
- <li><p>Make a build directory <tt>llvm-gcc-4.2-objects</tt> for llvm-gcc and make it the
- current directory:</p>
-
-<div class="doc_code">
-<pre>
-cd ..
-mkdir llvm-gcc-4.2-objects
-cd llvm-gcc-4.2-objects</pre>
-</div>
- </li>
-
- <li><p>Configure llvm-gcc (here it is configured to install into <tt>/usr/local</tt>).
- The <tt>--enable-checking</tt> flag turns on sanity checks inside the compiler.
- If you omit it then LLVM must be built with <tt>make ENABLE_OPTIMIZED=1</tt>.
- Additional languages can be appended to the --enable-languages switch,
- for example <tt>--enable-languages=ada,c,c++</tt>.</p>
-
-<div class="doc_code">
-<pre>../llvm-gcc-4.2/configure --prefix=<b>/usr/local</b> --enable-languages=ada,c --enable-checking --enable-llvm=$PWD/../llvm-objects --disable-shared --disable-bootstrap --disable-multilib</pre>
-</div>
-
- <p>If you have a multi-compiler setup, then you can configure like this:</p>
-<div class="doc_code">
-
-<pre>
-export CC=<b>PATH_TO_C_AND_ADA_COMPILER</b>
-export CXX=<b>PATH_TO_C++_COMPILER</b>
-../llvm-gcc-4.2/configure --prefix=<b>/usr/local</b> --enable-languages=ada,c --enable-checking --enable-llvm=$PWD/../llvm-objects --disable-shared --disable-bootstrap --disable-multilib</pre>
-</div>
- </li>
-
- <li><p>Build and install the compiler:</p>
-
-<div class="doc_code">
-<pre>make
-make install</pre>
-</div>
- </li>
-</ol>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section">
- <a name="license">Building the Fortran front-end</a>
-</div>
-
-<div class="doc_text">
-<p>
-To build with support for Fortran, follow the directions in the top-level
-<tt>README.LLVM</tt> file, adding ",fortran" to EXTRALANGS, for example:</p>
-
-<div class="doc_code">
-<pre>
-EXTRALANGS=,fortran
-</pre>
-</div>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section">
- <a name="license">License Information</a>
-</div>
-
-<div class="doc_text">
-<p>
-The LLVM GCC frontend is licensed to you under the GNU General Public License
-and the GNU Lesser General Public License. Please see the files COPYING and
-COPYING.LIB for more details.
-</p>
-
-<p>
-More information is <a href="FAQ.html#license">available in the FAQ</a>.
-</p>
-</div>
-
-<!-- *********************************************************************** -->
-
-<hr>
-<address>
- <a href="http://jigsaw.w3.org/css-validator/check/referer"><img
- src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"></a>
- <a href="http://validator.w3.org/check/referer"><img
- src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!"></a>
-
- <a href="http://llvm.org">LLVM Compiler Infrastructure</a><br>
- Last modified: $Date$
-</address>
-
-</body>
-</html>
diff --git a/release_23/docs/GarbageCollection.html b/release_23/docs/GarbageCollection.html
deleted file mode 100644
index 91768f1e5339..000000000000
--- a/release_23/docs/GarbageCollection.html
+++ /dev/null
@@ -1,1419 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
- "http://www.w3.org/TR/html4/strict.dtd">
-<html>
-<head>
- <meta http-equiv="Content-Type" Content="text/html; charset=UTF-8" >
- <title>Accurate Garbage Collection with LLVM</title>
- <link rel="stylesheet" href="llvm.css" type="text/css">
- <style type="text/css">
- .rowhead { text-align: left; background: inherit; }
- .indent { padding-left: 1em; }
- .optl { color: #BFBFBF; }
- </style>
-</head>
-<body>
-
-<div class="doc_title">
- Accurate Garbage Collection with LLVM
-</div>
-
-<ol>
- <li><a href="#introduction">Introduction</a>
- <ul>
- <li><a href="#feature">GC features provided and algorithms
- supported</a></li>
- </ul>
- </li>
-
- <li><a href="#usage">Using the collectors</a>
- <ul>
- <li><a href="#shadow-stack">ShadowStack -
- A highly portable collector</a></li>
- <li><a href="#semispace">SemiSpace -
- A simple copying collector runtime</a></li>
- <li><a href="#ocaml">Ocaml -
- An Objective Caml-compatible collector</a></li>
- </ul>
- </li>
-
- <li><a href="#core">Core support</a>
- <ul>
- <li><a href="#gcattr">Specifying GC code generation:
- <tt>gc "..."</tt></a></li>
- <li><a href="#gcroot">Identifying GC roots on the stack:
- <tt>llvm.gcroot</tt></a></li>
- <li><a href="#barriers">Reading and writing references in the heap</a>
- <ul>
- <li><a href="#gcwrite">Write barrier: <tt>llvm.gcwrite</tt></a></li>
- <li><a href="#gcread">Read barrier: <tt>llvm.gcread</tt></a></li>
- </ul>
- </li>
- </ul>
- </li>
-
- <li><a href="#runtime">Recommended runtime interface</a>
- <ul>
- <li><a href="#initialize">Garbage collector startup and
- initialization</a></li>
- <li><a href="#allocate">Allocating memory from the GC</a></li>
- <li><a href="#explicit">Explicit invocation of the garbage
- collector</a></li>
- <li><a href="#traceroots">Tracing GC pointers from the program
- stack</a></li>
- <li><a href="#staticroots">Tracing GC pointers from static roots</a></li>
- </ul>
- </li>
-
- <li><a href="#plugin">Implementing a collector plugin</a>
- <ul>
- <li><a href="#collector-algos">Overview of available features</a></li>
- <li><a href="#stack-map">Computing stack maps</a></li>
- <li><a href="#init-roots">Initializing roots to null:
- <tt>InitRoots</tt></a></li>
- <li><a href="#custom">Custom lowering of intrinsics: <tt>CustomRoots</tt>,
- <tt>CustomReadBarriers</tt>, and <tt>CustomWriteBarriers</tt></a></li>
- <li><a href="#safe-points">Generating safe points:
- <tt>NeededSafePoints</tt></a></li>
- <li><a href="#assembly">Emitting assembly code:
- <tt>beginAssembly</tt> and <tt>finishAssembly</tt></a></li>
- </ul>
- </li>
-
- <li><a href="#runtime-impl">Implementing a collector runtime</a>
- <ul>
- <li><a href="#gcdescriptors">Tracing GC pointers from heap
- objects</a></li>
- </ul>
- </li>
-
- <li><a href="#references">References</a></li>
-
-</ol>
-
-<div class="doc_author">
- <p>Written by <a href="mailto:sabre@nondot.org">Chris Lattner</a> and
- Gordon Henriksen</p>
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section">
- <a name="introduction">Introduction</a>
-</div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>Garbage collection is a widely used technique that frees the programmer from
-having to know the lifetimes of heap objects, making software easier to produce
-and maintain. Many programming languages rely on garbage collection for
-automatic memory management. There are two primary forms of garbage collection:
-conservative and accurate.</p>
-
-<p>Conservative garbage collection often does not require any special support
-from either the language or the compiler: it can handle non-type-safe
-programming languages (such as C/C++) and does not require any special
-information from the compiler. The
-<a href="http://www.hpl.hp.com/personal/Hans_Boehm/gc/">Boehm collector</a> is
-an example of a state-of-the-art conservative collector.</p>
-
-<p>Accurate garbage collection requires the ability to identify all pointers in
-the program at run-time (which requires that the source-language be type-safe in
-most cases). Identifying pointers at run-time requires compiler support to
-locate all places that hold live pointer variables at run-time, including the
-<a href="#gcroot">processor stack and registers</a>.</p>
-
-<p>Conservative garbage collection is attractive because it does not require any
-special compiler support, but it does have problems. In particular, because the
-conservative garbage collector cannot <i>know</i> that a particular word in the
-machine is a pointer, it cannot move live objects in the heap (preventing the
-use of compacting and generational GC algorithms) and it can occasionally suffer
-from memory leaks due to integer values that happen to point to objects in the
-program. In addition, some aggressive compiler transformations can break
-conservative garbage collectors (though these seem rare in practice).</p>
-
-<p>Accurate garbage collectors do not suffer from any of these problems, but
-they can suffer from degraded scalar optimization of the program. In particular,
-because the runtime must be able to identify and update all pointers active in
-the program, some optimizations are less effective. In practice, however, the
-locality and performance benefits of using aggressive garbage allocation
-techniques dominates any low-level losses.</p>
-
-<p>This document describes the mechanisms and interfaces provided by LLVM to
-support accurate garbage collection.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="feature">GC features provided and algorithms supported</a>
-</div>
-
-<div class="doc_text">
-
-<p>LLVM's intermediate representation provides <a href="#intrinsics">garbage
-collection intrinsics</a> that offer support for a broad class of
-collector models. For instance, the intrinsics permit:</p>
-
-<ul>
- <li>semi-space collectors</li>
- <li>mark-sweep collectors</li>
- <li>generational collectors</li>
- <li>reference counting</li>
- <li>incremental collectors</li>
- <li>concurrent collectors</li>
- <li>cooperative collectors</li>
-</ul>
-
-<p>We hope that the primitive support built into the LLVM IR is sufficient to
-support a broad class of garbage collected languages including Scheme, ML, Java,
-C#, Perl, Python, Lua, Ruby, other scripting languages, and more.</p>
-
-<p>However, LLVM does not itself implement a garbage collector. This is because
-collectors are tightly coupled to object models, and LLVM is agnostic to object
-models. Since LLVM is agnostic to object models, it would be inappropriate for
-LLVM to dictate any particular collector. Instead, LLVM provides a framework for
-garbage collector implementations in two manners:</p>
-
-<ul>
- <li><b>At compile time</b> with <a href="#plugin">collector plugins</a> for
- the compiler. Collector plugins have ready access to important garbage
- collector algorithms. Leveraging these tools, it is straightforward to
- emit type-accurate stack maps for your runtime in as little as ~100 lines of
- C++ code.</li>
-
- <li><b>At runtime</b> with <a href="#runtime">suggested runtime
- interfaces</a>, which allow front-end compilers to support a range of
- collection runtimes.</li>
-</ul>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section">
- <a name="usage">Using the collectors</a>
-</div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>In general, using a collector implies:</p>
-
-<ul>
- <li>Emitting compatible code, including initialization in the main
- program if necessary.</li>
- <li>Loading a compiler plugin if the collector is not statically linked with
- your compiler. For <tt>llc</tt>, use the <tt>-load</tt> option.</li>
- <li>Selecting the collection algorithm by applying the <tt>gc "..."</tt>
- attribute to your garbage collected functions, or equivalently with
- the <tt>setCollector</tt> method.</li>
- <li>Linking your final executable with the garbage collector runtime.</li>
-</ul>
-
-<p>This table summarizes the available runtimes.</p>
-
-<table>
- <tr>
- <th>Collector</th>
- <th><tt>gc</tt> attribute</th>
- <th>Linkage</th>
- <th><tt>gcroot</tt></th>
- <th><tt>gcread</tt></th>
- <th><tt>gcwrite</tt></th>
- </tr>
- <tr valign="baseline">
- <td><a href="#semispace">SemiSpace</a></td>
- <td><tt>gc "shadow-stack"</tt></td>
- <td>TODO FIXME</td>
- <td>required</td>
- <td>optional</td>
- <td>optional</td>
- </tr>
- <tr valign="baseline">
- <td><a href="#ocaml">Ocaml</a></td>
- <td><tt>gc "ocaml"</tt></td>
- <td><i>provided by ocamlopt</i></td>
- <td>required</td>
- <td>optional</td>
- <td>optional</td>
- </tr>
-</table>
-
-<p>The sections for <a href="#intrinsics">Collection intrinsics</a> and
-<a href="#runtime">Recommended runtime interface</a> detail the interfaces that
-collectors may require user programs to utilize.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="shadow-stack">ShadowStack - A highly portable collector</a>
-</div>
-
-<div class="doc_code"><tt>
- Collector *llvm::createShadowStackCollector();
-</tt></div>
-
-<div class="doc_text">
-
-<p>The ShadowStack backend is invoked with the <tt>gc "shadow-stack"</tt>
-function attribute.
-Unlike many collectors which rely on a cooperative code generator to generate
-stack maps, this algorithm carefully maintains a linked list of stack root
-descriptors [<a href="#henderson02">Henderson2002</a>]. This so-called "shadow
-stack" mirrors the machine stack. Maintaining this data structure is slower
-than using stack maps, but has a significant portability advantage because it
-requires no special support from the target code generator.</p>
-
-<p>The ShadowStack collector does not use read or write barriers, so the user
-program may use <tt>load</tt> and <tt>store</tt> instead of <tt>llvm.gcread</tt>
-and <tt>llvm.gcwrite</tt>.</p>
-
-<p>ShadowStack is a code generator plugin only. It must be paired with a
-compatible runtime.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="semispace">SemiSpace - A simple copying collector runtime</a>
-</div>
-
-<div class="doc_text">
-
-<p>The SemiSpace runtime implements the <a href="runtime">suggested
-runtime interface</a> and is compatible with the ShadowStack backend.</p>
-
-<p>SemiSpace is a very simple copying collector. When it starts up, it
-allocates two blocks of memory for the heap. It uses a simple bump-pointer
-allocator to allocate memory from the first block until it runs out of space.
-When it runs out of space, it traces through all of the roots of the program,
-copying blocks to the other half of the memory space.</p>
-
-<p>This runtime is highly experimental and has not been used in a real project.
-Enhancements would be welcomed.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="ocaml">Ocaml - An Objective Caml-compatible collector</a>
-</div>
-
-<div class="doc_code"><tt>
- Collector *llvm::createOcamlCollector();
-</tt></div>
-
-<div class="doc_text">
-
-<p>The ocaml backend is invoked with the <tt>gc "ocaml"</tt> function attribute.
-It supports the
-<a href="http://caml.inria.fr/">Objective Caml</a> language runtime by emitting
-a type-accurate stack map in the form of an ocaml 3.10.0-compatible frametable.
-The linkage requirements are satisfied automatically by the <tt>ocamlopt</tt>
-compiler when linking an executable.</p>
-
-<p>The ocaml collector does not use read or write barriers, so the user program
-may use <tt>load</tt> and <tt>store</tt> instead of <tt>llvm.gcread</tt> and
-<tt>llvm.gcwrite</tt>.</p>
-
-</div>
-
-
-<!-- *********************************************************************** -->
-<div class="doc_section">
- <a name="core">Core support</a><a name="intrinsics"></a>
-</div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>This section describes the garbage collection facilities provided by the
-<a href="LangRef.html">LLVM intermediate representation</a>.</p>
-
-<p>These facilities are limited to those strictly necessary for compilation.
-They are not intended to be a complete interface to any garbage collector.
-Notably, heap allocation is not among the supplied primitives. A user program
-will also need to interface with the runtime, using either the
-<a href="#runtime">suggested runtime interface</a> or another interface
-specified by the runtime.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="gcattr">Specifying GC code generation: <tt>gc "..."</tt></a>
-</div>
-
-<div class="doc_code"><tt>
- define <i>ty</i> @<i>name</i>(...) <u>gc "<i>collector</i>"</u> { ...
-</tt></div>
-
-<div class="doc_text">
-
-<p>The <tt>gc</tt> function attribute is used to specify the desired collector
-algorithm to the compiler. It is equivalent to specifying the collector name
-programmatically using the <tt>setCollector</tt> method of
-<tt>Function</tt>.</p>
-
-<p>Specifying the collector on a per-function basis allows LLVM to link together
-programs that use different garbage collection algorithms.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="gcroot">Identifying GC roots on the stack: <tt>llvm.gcroot</tt></a>
-</div>
-
-<div class="doc_code"><tt>
- void @llvm.gcroot(i8** %ptrloc, i8* %metadata)
-</tt></div>
-
-<div class="doc_text">
-
-<p>The <tt>llvm.gcroot</tt> intrinsic is used to inform LLVM of a pointer
-variable on the stack. The first argument <b>must</b> be a value referring to an alloca instruction
-or a bitcast of an alloca. The second contains a pointer to metadata that
-should be associated with the pointer, and <b>must</b> be a constant or global
-value address. If your target collector uses tags, use a null pointer for
-metadata.</p>
-
-<p>Consider the following fragment of Java code:</p>
-
-<pre>
- {
- Object X; // A null-initialized reference to an object
- ...
- }
-</pre>
-
-<p>This block (which may be located in the middle of a function or in a loop
-nest), could be compiled to this LLVM code:</p>
-
-<pre>
-Entry:
- ;; In the entry block for the function, allocate the
- ;; stack space for X, which is an LLVM pointer.
- %X = alloca %Object*
-
- ;; Tell LLVM that the stack space is a stack root.
- ;; Java has type-tags on objects, so we pass null as metadata.
- %tmp = bitcast %Object** %X to i8**
- call void @llvm.gcroot(i8** %X, i8* null)
- ...
-
- ;; "CodeBlock" is the block corresponding to the start
- ;; of the scope above.
-CodeBlock:
- ;; Java null-initializes pointers.
- store %Object* null, %Object** %X
-
- ...
-
- ;; As the pointer goes out of scope, store a null value into
- ;; it, to indicate that the value is no longer live.
- store %Object* null, %Object** %X
- ...
-</pre>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="barriers">Reading and writing references in the heap</a>
-</div>
-
-<div class="doc_text">
-
-<p>Some collectors need to be informed when the mutator (the program that needs
-garbage collection) either reads a pointer from or writes a pointer to a field
-of a heap object. The code fragments inserted at these points are called
-<em>read barriers</em> and <em>write barriers</em>, respectively. The amount of
-code that needs to be executed is usually quite small and not on the critical
-path of any computation, so the overall performance impact of the barrier is
-tolerable.</p>
-
-<p>Barriers often require access to the <em>object pointer</em> rather than the
-<em>derived pointer</em> (which is a pointer to the field within the
-object). Accordingly, these intrinsics take both pointers as separate arguments
-for completeness. In this snippet, <tt>%object</tt> is the object pointer, and
-<tt>%derived</tt> is the derived pointer:</p>
-
-<blockquote><pre>
- ;; An array type.
- %class.Array = type { %class.Object, i32, [0 x %class.Object*] }
- ...
-
- ;; Load the object pointer from a gcroot.
- %object = load %class.Array** %object_addr
-
- ;; Compute the derived pointer.
- %derived = getelementptr %object, i32 0, i32 2, i32 %n</pre></blockquote>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsubsection">
- <a name="gcwrite">Write barrier: <tt>llvm.gcwrite</tt></a>
-</div>
-
-<div class="doc_code"><tt>
-void @llvm.gcwrite(i8* %value, i8* %object, i8** %derived)
-</tt></div>
-
-<div class="doc_text">
-
-<p>For write barriers, LLVM provides the <tt>llvm.gcwrite</tt> intrinsic
-function. It has exactly the same semantics as a non-volatile <tt>store</tt> to
-the derived pointer (the third argument).</p>
-
-<p>Many important algorithms require write barriers, including generational
-and concurrent collectors. Additionally, write barriers could be used to
-implement reference counting.</p>
-
-<p>The use of this intrinsic is optional if the target collector does use
-write barriers. If so, the collector will replace it with the corresponding
-<tt>store</tt>.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsubsection">
- <a name="gcread">Read barrier: <tt>llvm.gcread</tt></a>
-</div>
-
-<div class="doc_code"><tt>
-i8* @llvm.gcread(i8* %object, i8** %derived)<br>
-</tt></div>
-
-<div class="doc_text">
-
-<p>For read barriers, LLVM provides the <tt>llvm.gcread</tt> intrinsic function.
-It has exactly the same semantics as a non-volatile <tt>load</tt> from the
-derived pointer (the second argument).</p>
-
-<p>Read barriers are needed by fewer algorithms than write barriers, and may
-have a greater performance impact since pointer reads are more frequent than
-writes.</p>
-
-<p>As with <tt>llvm.gcwrite</tt>, a target collector might not require the use
-of this intrinsic.</p>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section">
- <a name="runtime">Recommended runtime interface</a>
-</div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>LLVM specifies the following recommended runtime interface to the garbage
-collection at runtime. A program should use these interfaces to accomplish the
-tasks not supported by the intrinsics.</p>
-
-<p>Unlike the intrinsics, which are integral to LLVM's code generator, there is
-nothing unique about these interfaces; a front-end compiler and runtime are free
-to agree to a different specification.</p>
-
-<p class="doc_warning">Note: This interface is a work in progress.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="initialize">Garbage collector startup and initialization</a>
-</div>
-
-<div class="doc_text">
-
-<div class="doc_code"><tt>
- void llvm_gc_initialize(unsigned InitialHeapSize);
-</tt></div>
-
-<p>
-The <tt>llvm_gc_initialize</tt> function should be called once before any other
-garbage collection functions are called. This gives the garbage collector the
-chance to initialize itself and allocate the heap. The initial heap size to
-allocate should be specified as an argument.
-</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="allocate">Allocating memory from the GC</a>
-</div>
-
-<div class="doc_text">
-
-<div class="doc_code"><tt>
- void *llvm_gc_allocate(unsigned Size);
-</tt></div>
-
-<p>The <tt>llvm_gc_allocate</tt> function is a global function defined by the
-garbage collector implementation to allocate memory. It returns a
-zeroed-out block of memory of the specified size, sufficiently aligned to store
-any object.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="explicit">Explicit invocation of the garbage collector</a>
-</div>
-
-<div class="doc_text">
-
-<div class="doc_code"><tt>
- void llvm_gc_collect();
-</tt></div>
-
-<p>
-The <tt>llvm_gc_collect</tt> function is exported by the garbage collector
-implementations to provide a full collection, even when the heap is not
-exhausted. This can be used by end-user code as a hint, and may be ignored by
-the garbage collector.
-</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="traceroots">Tracing GC pointers from the program stack</a>
-</div>
-
-<div class="doc_text">
- <div class="doc_code"><tt>
- void llvm_cg_walk_gcroots(void (*FP)(void **Root, void *Meta));
- </tt></div>
-
-<p>
-The <tt>llvm_cg_walk_gcroots</tt> function is a function provided by the code
-generator that iterates through all of the GC roots on the stack, calling the
-specified function pointer with each record. For each GC root, the address of
-the pointer and the meta-data (from the <a
-href="#gcroot"><tt>llvm.gcroot</tt></a> intrinsic) are provided.
-</p>
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="staticroots">Tracing GC pointers from static roots</a>
-</div>
-
-<div class="doc_text">
-TODO
-</div>
-
-
-<!-- *********************************************************************** -->
-<div class="doc_section">
- <a name="plugin">Implementing a collector plugin</a>
-</div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>User code specifies which collector plugin to use with the <tt>gc</tt>
-function attribute or, equivalently, with the <tt>setCollector</tt> method of
-<tt>Function</tt>.</p>
-
-<p>To implement a collector plugin, it is necessary to subclass
-<tt>llvm::Collector</tt>, which can be accomplished in a few lines of
-boilerplate code. LLVM's infrastructure provides access to several important
-algorithms. For an uncontroversial collector, all that remains may be to emit
-the assembly code for the collector's unique stack map data structure, which
-might be accomplished in as few as 100 LOC.</p>
-
-<p>To subclass <tt>llvm::Collector</tt> and register a collector:</p>
-
-<blockquote><pre>// lib/MyGC/MyGC.cpp - Example LLVM collector plugin
-
-#include "llvm/CodeGen/Collector.h"
-#include "llvm/CodeGen/Collectors.h"
-#include "llvm/CodeGen/CollectorMetadata.h"
-#include "llvm/Support/Compiler.h"
-
-using namespace llvm;
-
-namespace {
- class VISIBILITY_HIDDEN MyCollector : public Collector {
- public:
- MyCollector() {}
- };
-
- CollectorRegistry::Add&lt;MyCollector&gt;
- X("mygc", "My bespoke garbage collector.");
-}</pre></blockquote>
-
-<p>Using the LLVM makefiles (like the <a
-href="http://llvm.org/viewvc/llvm-project/llvm/trunk/projects/sample/">sample
-project</a>), this can be built into a plugin using a simple makefile:</p>
-
-<blockquote><pre
-># lib/MyGC/Makefile
-
-LEVEL := ../..
-LIBRARYNAME = <var>MyGC</var>
-LOADABLE_MODULE = 1
-
-include $(LEVEL)/Makefile.common</pre></blockquote>
-
-<p>Once the plugin is compiled, code using it may be compiled using <tt>llc
--load=<var>MyGC.so</var></tt> (though <var>MyGC.so</var> may have some other
-platform-specific extension):</p>
-
-<blockquote><pre
->$ cat sample.ll
-define void @f() gc "mygc" {
-entry:
- ret void
-}
-$ llvm-as &lt; sample.ll | llc -load=MyGC.so</pre></blockquote>
-
-<p>It is also possible to statically link the collector plugin into tools, such
-as a language-specific compiler front-end.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="collector-algos">Overview of available features</a>
-</div>
-
-<div class="doc_text">
-
-<p>The boilerplate collector above does nothing. More specifically:</p>
-
-<ul>
- <li><tt>llvm.gcread</tt> calls are replaced with the corresponding
- <tt>load</tt> instruction.</li>
- <li><tt>llvm.gcwrite</tt> calls are replaced with the corresponding
- <tt>store</tt> instruction.</li>
- <li>No stack map is emitted, and no safe points are added.</li>
-</ul>
-
-<p><tt>Collector</tt> provides a range of features through which a plugin
-collector may do useful work. This matrix summarizes the supported (and planned)
-features and correlates them with the collection techniques which typically
-require them.</p>
-
-<table>
- <tr>
- <th>Algorithm</th>
- <th>Done</th>
- <th>shadow stack</th>
- <th>refcount</th>
- <th>mark-sweep</th>
- <th>copying</th>
- <th>incremental</th>
- <th>threaded</th>
- <th>concurrent</th>
- </tr>
- <tr>
- <th class="rowhead"><a href="#stack-map">stack map</a></th>
- <td>&#10004;</td>
- <td></td>
- <td></td>
- <td>&#10008;</td>
- <td>&#10008;</td>
- <td>&#10008;</td>
- <td>&#10008;</td>
- <td>&#10008;</td>
- </tr>
- <tr>
- <th class="rowhead"><a href="#init-roots">initialize roots</a></th>
- <td>&#10004;</td>
- <td>&#10008;</td>
- <td>&#10008;</td>
- <td>&#10008;</td>
- <td>&#10008;</td>
- <td>&#10008;</td>
- <td>&#10008;</td>
- <td>&#10008;</td>
- </tr>
- <tr class="doc_warning">
- <th class="rowhead">derived pointers</th>
- <td>NO</td>
- <td></td>
- <td></td>
- <td></td>
- <td></td>
- <td></td>
- <td>&#10008;*</td>
- <td>&#10008;*</td>
- </tr>
- <tr>
- <th class="rowhead"><em><a href="#custom">custom lowering</a></em></th>
- <td>&#10004;</td>
- <th></th>
- <th></th>
- <th></th>
- <th></th>
- <th></th>
- <th></th>
- <th></th>
- </tr>
- <tr>
- <th class="rowhead indent">gcroot</th>
- <td>&#10004;</td>
- <td>&#10008;</td>
- <td>&#10008;</td>
- <td></td>
- <td></td>
- <td></td>
- <td></td>
- <td></td>
- </tr>
- <tr>
- <th class="rowhead indent">gcwrite</th>
- <td>&#10004;</td>
- <td></td>
- <td>&#10008;</td>
- <td></td>
- <td></td>
- <td>&#10008;</td>
- <td></td>
- <td>&#10008;</td>
- </tr>
- <tr>
- <th class="rowhead indent">gcread</th>
- <td>&#10004;</td>
- <td></td>
- <td></td>
- <td></td>
- <td></td>
- <td></td>
- <td></td>
- <td>&#10008;</td>
- </tr>
- <tr>
- <th class="rowhead"><em><a href="#safe-points">safe points</a></em></th>
- <td></td>
- <th></th>
- <th></th>
- <th></th>
- <th></th>
- <th></th>
- <th></th>
- <th></th>
- </tr>
- <tr>
- <th class="rowhead indent">in calls</th>
- <td>&#10004;</td>
- <td></td>
- <td></td>
- <td>&#10008;</td>
- <td>&#10008;</td>
- <td>&#10008;</td>
- <td>&#10008;</td>
- <td>&#10008;</td>
- </tr>
- <tr>
- <th class="rowhead indent">before calls</th>
- <td>&#10004;</td>
- <td></td>
- <td></td>
- <td></td>
- <td></td>
- <td></td>
- <td>&#10008;</td>
- <td>&#10008;</td>
- </tr>
- <tr class="doc_warning">
- <th class="rowhead indent">for loops</th>
- <td>NO</td>
- <td></td>
- <td></td>
- <td></td>
- <td></td>
- <td></td>
- <td>&#10008;</td>
- <td>&#10008;</td>
- </tr>
- <tr>
- <th class="rowhead indent">before escape</th>
- <td>&#10004;</td>
- <td></td>
- <td></td>
- <td></td>
- <td></td>
- <td></td>
- <td>&#10008;</td>
- <td>&#10008;</td>
- </tr>
- <tr class="doc_warning">
- <th class="rowhead">emit code at safe points</th>
- <td>NO</td>
- <td></td>
- <td></td>
- <td></td>
- <td></td>
- <td></td>
- <td>&#10008;</td>
- <td>&#10008;</td>
- </tr>
- <tr>
- <th class="rowhead"><em>output</em></th>
- <td></td>
- <th></th>
- <th></th>
- <th></th>
- <th></th>
- <th></th>
- <th></th>
- <th></th>
- </tr>
- <tr>
- <th class="rowhead indent"><a href="#assembly">assembly</a></th>
- <td>&#10004;</td>
- <td></td>
- <td></td>
- <td>&#10008;</td>
- <td>&#10008;</td>
- <td>&#10008;</td>
- <td>&#10008;</td>
- <td>&#10008;</td>
- </tr>
- <tr class="doc_warning">
- <th class="rowhead indent">JIT</th>
- <td>NO</td>
- <td></td>
- <td></td>
- <td class="optl">&#10008;</td>
- <td class="optl">&#10008;</td>
- <td class="optl">&#10008;</td>
- <td class="optl">&#10008;</td>
- <td class="optl">&#10008;</td>
- </tr>
- <tr class="doc_warning">
- <th class="rowhead indent">obj</th>
- <td>NO</td>
- <td></td>
- <td></td>
- <td class="optl">&#10008;</td>
- <td class="optl">&#10008;</td>
- <td class="optl">&#10008;</td>
- <td class="optl">&#10008;</td>
- <td class="optl">&#10008;</td>
- </tr>
- <tr class="doc_warning">
- <th class="rowhead">live analysis</th>
- <td>NO</td>
- <td></td>
- <td></td>
- <td class="optl">&#10008;</td>
- <td class="optl">&#10008;</td>
- <td class="optl">&#10008;</td>
- <td class="optl">&#10008;</td>
- <td class="optl">&#10008;</td>
- </tr>
- <tr class="doc_warning">
- <th class="rowhead">register map</th>
- <td>NO</td>
- <td></td>
- <td></td>
- <td class="optl">&#10008;</td>
- <td class="optl">&#10008;</td>
- <td class="optl">&#10008;</td>
- <td class="optl">&#10008;</td>
- <td class="optl">&#10008;</td>
- </tr>
- <tr>
- <td colspan="10">
- <div><span class="doc_warning">*</span> Derived pointers only pose a
- hazard to copying collectors.</div>
- <div><span class="optl">&#10008;</span> in gray denotes a feature which
- could be utilized if available.</div>
- </td>
- </tr>
-</table>
-
-<p>To be clear, the collection techniques above are defined as:</p>
-
-<dl>
- <dt>Shadow Stack</dt>
- <dd>The mutator carefully maintains a linked list of stack root
- descriptors.</dd>
- <dt>Reference Counting</dt>
- <dd>The mutator maintains a reference count for each object and frees an
- object when its count falls to zero.</dd>
- <dt>Mark-Sweep</dt>
- <dd>When the heap is exhausted, the collector marks reachable objects starting
- from the roots, then deallocates unreachable objects in a sweep
- phase.</dd>
- <dt>Copying</dt>
- <dd>As reachability analysis proceeds, the collector copies objects from one
- heap area to another, compacting them in the process. Copying collectors
- enable highly efficient "bump pointer" allocation and can improve locality
- of reference.</dd>
- <dt>Incremental</dt>
- <dd>(Including generational collectors.) Incremental collectors generally have
- all the properties of a copying collector (regardless of whether the
- mature heap is compacting), but bring the added complexity of requiring
- write barriers.</dd>
- <dt>Threaded</dt>
- <dd>Denotes a multithreaded mutator; the collector must still stop the mutator
- ("stop the world") before beginning reachability analysis. Stopping a
- multithreaded mutator is a complicated problem. It generally requires
- highly platform specific code in the runtime, and the production of
- carefully designed machine code at safe points.</dd>
- <dt>Concurrent</dt>
- <dd>In this technique, the mutator and the collector run concurrently, with
- the goal of eliminating pause times. In a <em>cooperative</em> collector,
- the mutator further aids with collection should a pause occur, allowing
- collection to take advantage of multiprocessor hosts. The "stop the world"
- problem of threaded collectors is generally still present to a limited
- extent. Sophisticated marking algorithms are necessary. Read barriers may
- be necessary.</dd>
-</dl>
-
-<p>As the matrix indicates, LLVM's garbage collection infrastructure is already
-suitable for a wide variety of collectors, but does not currently extend to
-multithreaded programs. This will be added in the future as there is
-interest.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="stack-map">Computing stack maps</a>
-</div>
-
-<div class="doc_text">
-
-<blockquote><pre
->for (iterator I = begin(), E = end(); I != E; ++I) {
- CollectorMetadata *MD = *I;
- unsigned FrameSize = MD-&gt;getFrameSize();
- size_t RootCount = MD-&gt;roots_size();
-
- for (CollectorMetadata::roots_iterator RI = MD-&gt;roots_begin(),
- RE = MD-&gt;roots_end();
- RI != RE; ++RI) {
- int RootNum = RI->Num;
- int RootStackOffset = RI->StackOffset;
- Constant *RootMetadata = RI->Metadata;
- }
-}</pre></blockquote>
-
-<p>LLVM automatically computes a stack map. All a <tt>Collector</tt> needs to do
-is access it using <tt>CollectorMetadata::roots_begin()</tt> and
--<tt>end()</tt>. If the <tt>llvm.gcroot</tt> intrinsic is eliminated before code
-generation by a custom lowering pass, LLVM's stack map will be empty.</p>
-
-</div>
-
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="init-roots">Initializing roots to null: <tt>InitRoots</tt></a>
-</div>
-
-<div class="doc_text">
-
-<blockquote><pre
->MyCollector::MyCollector() {
- InitRoots = true;
-}</pre></blockquote>
-
-<p>When set, LLVM will automatically initialize each root to <tt>null</tt> upon
-entry to the function. This prevents the reachability analysis from finding
-uninitialized values in stack roots at runtime, which will almost certainly
-cause it to segfault. This initialization occurs before custom lowering, so the
-two may be used together.</p>
-
-<p>Since LLVM does not yet compute liveness information, this feature should be
-used by all collectors which do not custom lower <tt>llvm.gcroot</tt>, and even
-some that do.</p>
-
-</div>
-
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="custom">Custom lowering of intrinsics: <tt>CustomRoots</tt>,
- <tt>CustomReadBarriers</tt>, and <tt>CustomWriteBarriers</tt></a>
-</div>
-
-<div class="doc_text">
-
-<p>For collectors with barriers or unusual treatment of stack roots, these
-flags allow the collector to perform any required transformation on the LLVM
-IR:</p>
-
-<blockquote><pre
->class MyCollector : public Collector {
-public:
- MyCollector() {
- CustomRoots = true;
- CustomReadBarriers = true;
- CustomWriteBarriers = true;
- }
-
- virtual bool initializeCustomLowering(Module &amp;M);
- virtual bool performCustomLowering(Function &amp;F);
-};</pre></blockquote>
-
-<p>If any of these flags are set, then LLVM suppresses its default lowering for
-the corresponding intrinsics and instead passes them on to a custom lowering
-pass specified by the collector.</p>
-
-<p>LLVM's default action for each intrinsic is as follows:</p>
-
-<ul>
- <li><tt>llvm.gcroot</tt>: Pass through to the code generator to generate a
- stack map.</li>
- <li><tt>llvm.gcread</tt>: Substitute a <tt>load</tt> instruction.</li>
- <li><tt>llvm.gcwrite</tt>: Substitute a <tt>store</tt> instruction.</li>
-</ul>
-
-<p>If <tt>CustomReadBarriers</tt> or <tt>CustomWriteBarriers</tt> are specified,
-then <tt>performCustomLowering</tt> <strong>must</strong> eliminate the
-corresponding barriers.</p>
-
-<p><tt>performCustomLowering</tt>, must comply with the same restrictions as <a
-href="WritingAnLLVMPass.html#runOnFunction"><tt>runOnFunction</tt></a>, and
-that <tt>initializeCustomLowering</tt> has the same semantics as <a
-href="WritingAnLLVMPass.html#doInitialization_mod"><tt>doInitialization(Module
-&amp;)</tt></a>.</p>
-
-<p>The following can be used as a template:</p>
-
-<blockquote><pre
->#include "llvm/Module.h"
-#include "llvm/IntrinsicInst.h"
-
-bool MyCollector::initializeCustomLowering(Module &amp;M) {
- return false;
-}
-
-bool MyCollector::performCustomLowering(Function &amp;F) {
- bool MadeChange = false;
-
- for (Function::iterator BB = F.begin(), E = F.end(); BB != E; ++BB)
- for (BasicBlock::iterator II = BB-&gt;begin(), E = BB-&gt;end(); II != E; )
- if (IntrinsicInst *CI = dyn_cast&lt;IntrinsicInst&gt;(II++))
- if (Function *F = CI-&gt;getCalledFunction())
- switch (F-&gt;getIntrinsicID()) {
- case Intrinsic::gcwrite:
- // Handle llvm.gcwrite.
- CI-&gt;eraseFromParent();
- MadeChange = true;
- break;
- case Intrinsic::gcread:
- // Handle llvm.gcread.
- CI-&gt;eraseFromParent();
- MadeChange = true;
- break;
- case Intrinsic::gcroot:
- // Handle llvm.gcroot.
- CI-&gt;eraseFromParent();
- MadeChange = true;
- break;
- }
-
- return MadeChange;
-}</pre></blockquote>
-
-</div>
-
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="safe-points">Generating safe points: <tt>NeededSafePoints</tt></a>
-</div>
-
-<div class="doc_text">
-
-<p>LLVM can compute four kinds of safe points:</p>
-
-<blockquote><pre
->namespace GC {
- /// PointKind - The type of a collector-safe point.
- ///
- enum PointKind {
- Loop, //&lt; Instr is a loop (backwards branch).
- Return, //&lt; Instr is a return instruction.
- PreCall, //&lt; Instr is a call instruction.
- PostCall //&lt; Instr is the return address of a call.
- };
-}</pre></blockquote>
-
-<p>A collector can request any combination of the four by setting the
-<tt>NeededSafePoints</tt> mask:</p>
-
-<blockquote><pre
->MyCollector::MyCollector() {
- NeededSafePoints = 1 &lt;&lt; GC::Loop
- | 1 &lt;&lt; GC::Return
- | 1 &lt;&lt; GC::PreCall
- | 1 &lt;&lt; GC::PostCall;
-}</pre></blockquote>
-
-<p>It can then use the following routines to access safe points.</p>
-
-<blockquote><pre
->for (iterator I = begin(), E = end(); I != E; ++I) {
- CollectorMetadata *MD = *I;
- size_t PointCount = MD-&gt;size();
-
- for (CollectorMetadata::iterator PI = MD-&gt;begin(),
- PE = MD-&gt;end(); PI != PE; ++PI) {
- GC::PointKind PointKind = PI-&gt;Kind;
- unsigned PointNum = PI-&gt;Num;
- }
-}
-</pre></blockquote>
-
-<p>Almost every collector requires <tt>PostCall</tt> safe points, since these
-correspond to the moments when the function is suspended during a call to a
-subroutine.</p>
-
-<p>Threaded programs generally require <tt>Loop</tt> safe points to guarantee
-that the application will reach a safe point within a bounded amount of time,
-even if it is executing a long-running loop which contains no function
-calls.</p>
-
-<p>Threaded collectors may also require <tt>Return</tt> and <tt>PreCall</tt>
-safe points to implement "stop the world" techniques using self-modifying code,
-where it is important that the program not exit the function without reaching a
-safe point (because only the topmost function has been patched).</p>
-
-</div>
-
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="assembly">Emitting assembly code:
- <tt>beginAssembly</tt> and <tt>finishAssembly</tt></a>
-</div>
-
-<div class="doc_text">
-
-<p>LLVM allows a collector to print arbitrary assembly code before and after
-the rest of a module's assembly code. From the latter callback, the collector
-can print stack maps built by the code generator.</p>
-
-<p>Note that LLVM does not currently have analogous APIs to support code
-generation in the JIT, nor using the object writers.</p>
-
-<blockquote><pre
->class MyCollector : public Collector {
-public:
- virtual void beginAssembly(std::ostream &amp;OS, AsmPrinter &amp;AP,
- const TargetAsmInfo &amp;TAI);
-
- virtual void finishAssembly(std::ostream &amp;OS, AsmPrinter &amp;AP,
- const TargetAsmInfo &amp;TAI);
-}</pre></blockquote>
-
-<p>The collector should use <tt>AsmPrinter</tt> and <tt>TargetAsmInfo</tt> to
-print portable assembly code to the <tt>std::ostream</tt>. The collector itself
-contains the stack map for the entire module, and may access the
-<tt>CollectorMetadata</tt> using its own <tt>begin()</tt> and <tt>end()</tt>
-methods. Here's a realistic example:</p>
-
-<blockquote><pre
->#include "llvm/CodeGen/AsmPrinter.h"
-#include "llvm/Function.h"
-#include "llvm/Target/TargetMachine.h"
-#include "llvm/Target/TargetData.h"
-#include "llvm/Target/TargetAsmInfo.h"
-
-void MyCollector::beginAssembly(std::ostream &amp;OS, AsmPrinter &amp;AP,
- const TargetAsmInfo &amp;TAI) {
- // Nothing to do.
-}
-
-void MyCollector::finishAssembly(std::ostream &amp;OS, AsmPrinter &amp;AP,
- const TargetAsmInfo &amp;TAI) {
- // Set up for emitting addresses.
- const char *AddressDirective;
- int AddressAlignLog;
- if (AP.TM.getTargetData()->getPointerSize() == sizeof(int32_t)) {
- AddressDirective = TAI.getData32bitsDirective();
- AddressAlignLog = 2;
- } else {
- AddressDirective = TAI.getData64bitsDirective();
- AddressAlignLog = 3;
- }
-
- // Put this in the data section.
- AP.SwitchToDataSection(TAI.getDataSection());
-
- // For each function...
- for (iterator FI = begin(), FE = end(); FI != FE; ++FI) {
- CollectorMetadata &amp;MD = **FI;
-
- // Emit this data structure:
- //
- // struct {
- // int32_t PointCount;
- // struct {
- // void *SafePointAddress;
- // int32_t LiveCount;
- // int32_t LiveOffsets[LiveCount];
- // } Points[PointCount];
- // } __gcmap_&lt;FUNCTIONNAME&gt;;
-
- // Align to address width.
- AP.EmitAlignment(AddressAlignLog);
-
- // Emit the symbol by which the stack map can be found.
- std::string Symbol;
- Symbol += TAI.getGlobalPrefix();
- Symbol += "__gcmap_";
- Symbol += MD.getFunction().getName();
- if (const char *GlobalDirective = TAI.getGlobalDirective())
- OS &lt;&lt; GlobalDirective &lt;&lt; Symbol &lt;&lt; "\n";
- OS &lt;&lt; TAI.getGlobalPrefix() &lt;&lt; Symbol &lt;&lt; ":\n";
-
- // Emit PointCount.
- AP.EmitInt32(MD.size());
- AP.EOL("safe point count");
-
- // And each safe point...
- for (CollectorMetadata::iterator PI = MD.begin(),
- PE = MD.end(); PI != PE; ++PI) {
- // Align to address width.
- AP.EmitAlignment(AddressAlignLog);
-
- // Emit the address of the safe point.
- OS &lt;&lt; AddressDirective
- &lt;&lt; TAI.getPrivateGlobalPrefix() &lt;&lt; "label" &lt;&lt; PI-&gt;Num;
- AP.EOL("safe point address");
-
- // Emit the stack frame size.
- AP.EmitInt32(MD.getFrameSize());
- AP.EOL("stack frame size");
-
- // Emit the number of live roots in the function.
- AP.EmitInt32(MD.live_size(PI));
- AP.EOL("live root count");
-
- // And for each live root...
- for (CollectorMetadata::live_iterator LI = MD.live_begin(PI),
- LE = MD.live_end(PI);
- LI != LE; ++LI) {
- // Print its offset within the stack frame.
- AP.EmitInt32(LI-&gt;StackOffset);
- AP.EOL("stack offset");
- }
- }
- }
-}
-</pre></blockquote>
-
-</div>
-
-
-<!-- *********************************************************************** -->
-<div class="doc_section">
- <a name="runtime-impl">Implementing a collector runtime</a>
-</div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>Implementing a garbage collector for LLVM is fairly straightforward. The
-LLVM garbage collectors are provided in a form that makes them easy to link into
-the language-specific runtime that a language front-end would use. They require
-functionality from the language-specific runtime to get information about <a
-href="#gcdescriptors">where pointers are located in heap objects</a>.</p>
-
-<p>The implementation must include the
-<a href="#allocate"><tt>llvm_gc_allocate</tt></a> and
-<a href="#explicit"><tt>llvm_gc_collect</tt></a> functions. To do this, it will
-probably have to <a href="#traceroots">trace through the roots
-from the stack</a> and understand the <a href="#gcdescriptors">GC descriptors
-for heap objects</a>. Luckily, there are some <a href="#usage">example
-implementations</a> available.
-</p>
-</div>
-
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="gcdescriptors">Tracing GC pointers from heap objects</a>
-</div>
-
-<div class="doc_text">
-<p>
-The three most common ways to keep track of where pointers live in heap objects
-are (listed in order of space overhead required):</p>
-
-<ol>
-<li>In languages with polymorphic objects, pointers from an object header are
-usually used to identify the GC pointers in the heap object. This is common for
-object-oriented languages like Self, Smalltalk, Java, or C#.</li>
-
-<li>If heap objects are not polymorphic, often the "shape" of the heap can be
-determined from the roots of the heap or from some other meta-data [<a
-href="#appel89">Appel89</a>, <a href="#goldberg91">Goldberg91</a>, <a
-href="#tolmach94">Tolmach94</a>]. In this case, the garbage collector can
-propagate the information around from meta data stored with the roots. This
-often eliminates the need to have a header on objects in the heap. This is
-common in the ML family.</li>
-
-<li>If all heap objects have pointers in the same locations, or pointers can be
-distinguished just by looking at them (e.g., the low order bit is clear), no
-book-keeping is needed at all. This is common for Lisp-like languages.</li>
-</ol>
-
-<p>The LLVM garbage collectors are capable of supporting all of these styles of
-language, including ones that mix various implementations. To do this, it
-allows the source-language to associate meta-data with the <a
-href="#gcroot">stack roots</a>, and the heap tracing routines can propagate the
-information. In addition, LLVM allows the front-end to extract GC information
-in any form from a specific object pointer (this supports situations #1 and #3).
-</p>
-
-</div>
-
-
-<!-- *********************************************************************** -->
-<div class="doc_section">
- <a name="references">References</a>
-</div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p><a name="appel89">[Appel89]</a> Runtime Tags Aren't Necessary. Andrew
-W. Appel. Lisp and Symbolic Computation 19(7):703-705, July 1989.</p>
-
-<p><a name="goldberg91">[Goldberg91]</a> Tag-free garbage collection for
-strongly typed programming languages. Benjamin Goldberg. ACM SIGPLAN
-PLDI'91.</p>
-
-<p><a name="tolmach94">[Tolmach94]</a> Tag-free garbage collection using
-explicit type parameters. Andrew Tolmach. Proceedings of the 1994 ACM
-conference on LISP and functional programming.</p>
-
-<p><a name="henderson02">[Henderson2002]</a> <a
-href="http://citeseer.ist.psu.edu/henderson02accurate.html">
-Accurate Garbage Collection in an Uncooperative Environment</a>.
-Fergus Henderson. International Symposium on Memory Management 2002.</p>
-
-</div>
-
-
-<!-- *********************************************************************** -->
-
-<hr>
-<address>
- <a href="http://jigsaw.w3.org/css-validator/check/referer"><img
- src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"></a>
- <a href="http://validator.w3.org/check/referer"><img
- src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!"></a>
-
- <a href="mailto:sabre@nondot.org">Chris Lattner</a><br>
- <a href="http://llvm.org">LLVM Compiler Infrastructure</a><br>
- Last modified: $Date$
-</address>
-
-</body>
-</html>
diff --git a/release_23/docs/GetElementPtr.html b/release_23/docs/GetElementPtr.html
deleted file mode 100644
index 6bf1f4f61e89..000000000000
--- a/release_23/docs/GetElementPtr.html
+++ /dev/null
@@ -1,370 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
- "http://www.w3.org/TR/html4/strict.dtd">
-<html>
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <title>The Often Misunderstood GEP Instruction</title>
- <link rel="stylesheet" href="llvm.css" type="text/css">
- <style type="text/css">
- TABLE { text-align: left; border: 1px solid black; border-collapse: collapse; margin: 0 0 0 0; }
- </style>
-</head>
-<body>
-
-<div class="doc_title">
- The Often Misunderstood GEP Instruction
-</div>
-
-<ol>
- <li><a href="#intro">Introduction</a></li>
- <li><a href="#questions">The Questions</a>
- <ol>
- <li><a href="#extra_index">Why is the extra 0 index required?</a></li>
- <li><a href="#deref">What is dereferenced by GEP?</a></li>
- <li><a href="#firstptr">Why can you index through the first pointer but not
- subsequent ones?</a></li>
- <li><a href="#lead0">Why don't GEP x,0,0,1 and GEP x,1 alias? </a></li>
- <li><a href="#trail0">Why do GEP x,1,0,0 and GEP x,1 alias? </a></li>
- </ol></li>
- <li><a href="#summary">Summary</a></li>
-</ol>
-
-<div class="doc_author">
- <p>Written by: <a href="mailto:rspencer@reidspencer.com">Reid Spencer</a>.</p>
-</div>
-
-
-<!-- *********************************************************************** -->
-<div class="doc_section"><a name="intro"><b>Introduction</b></a></div>
-<!-- *********************************************************************** -->
-<div class="doc_text">
- <p>This document seeks to dispel the mystery and confusion surrounding LLVM's
- GetElementPtr (GEP) instruction. Questions about the wiley GEP instruction are
- probably the most frequently occuring questions once a developer gets down to
- coding with LLVM. Here we lay out the sources of confusion and show that the
- GEP instruction is really quite simple.
- </p>
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section"><a name="questions"><b>The Questions</b></a></div>
-<!-- *********************************************************************** -->
-<div class="doc_text">
- <p>When people are first confronted with the GEP instruction, they tend to
- relate it to known concepts from other programming paradigms, most notably C
- array indexing and field selection. However, GEP is a little different and
- this leads to the following questions; all of which are answered in the
- following sections.</p>
- <ol>
- <li><a href="#firstptr">What is the first index of the GEP instruction?</a>
- </li>
- <li><a href="#extra_index">Why is the extra 0 index required?</a></li>
- <li><a href="#deref">What is dereferenced by GEP?</a></li>
- <li><a href="#lead0">Why don't GEP x,0,0,1 and GEP x,1 alias? </a></li>
- <li><a href="#trail0">Why do GEP x,1,0,0 and GEP x,1 alias? </a></li>
- </ol>
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_subsection">
- <a name="firstptr"><b>What is the first index of the GEP instruction?</b></a>
-</div>
-<div class="doc_text">
- <p>Quick answer: The index stepping through the first operand.</p>
- <p>The confusion with the first index usually arises from thinking about
- the GetElementPtr instruction as if it was a C index operator. They aren't the
- same. For example, when we write, in "C":</p>
-
-<div class="doc_code">
-<pre>
-AType *Foo;
-...
-X = &amp;Foo-&gt;F;
-</pre>
-</div>
-
- <p>it is natural to think that there is only one index, the selection of the
- field <tt>F</tt>. However, in this example, <tt>Foo</tt> is a pointer. That
- pointer must be indexed explicitly in LLVM. C, on the other hand, indexs
- through it transparently. To arrive at the same address location as the C
- code, you would provide the GEP instruction with two index operands. The
- first operand indexes through the pointer; the second operand indexes the
- field <tt>F</tt> of the structure, just as if you wrote:</p>
-
-<div class="doc_code">
-<pre>
-X = &amp;Foo[0].F;
-</pre>
-</div>
-
- <p>Sometimes this question gets rephrased as:</p>
- <blockquote><p><i>Why is it okay to index through the first pointer, but
- subsequent pointers won't be dereferenced?</i></p></blockquote>
- <p>The answer is simply because memory does not have to be accessed to
- perform the computation. The first operand to the GEP instruction must be a
- value of a pointer type. The value of the pointer is provided directly to
- the GEP instruction as an operand without any need for accessing memory. It
- must, therefore be indexed and requires an index operand. Consider this
- example:</p>
-
-<div class="doc_code">
-<pre>
-struct munger_struct {
- int f1;
- int f2;
-};
-void munge(struct munger_struct *P) {
- P[0].f1 = P[1].f1 + P[2].f2;
-}
-...
-munger_struct Array[3];
-...
-munge(Array);
-</pre>
-</div>
-
- <p>In this "C" example, the front end compiler (llvm-gcc) will generate three
- GEP instructions for the three indices through "P" in the assignment
- statement. The function argument <tt>P</tt> will be the first operand of each
- of these GEP instructions. The second operand indexes through that pointer.
- The third operand will be the field offset into the
- <tt>struct munger_struct</tt> type, for either the <tt>f1</tt> or
- <tt>f2</tt> field. So, in LLVM assembly the <tt>munge</tt> function looks
- like:</p>
-
-<div class="doc_code">
-<pre>
-void %munge(%struct.munger_struct* %P) {
-entry:
- %tmp = getelementptr %struct.munger_struct* %P, i32 1, i32 0
- %tmp = load i32* %tmp
- %tmp6 = getelementptr %struct.munger_struct* %P, i32 2, i32 1
- %tmp7 = load i32* %tmp6
- %tmp8 = add i32 %tmp7, %tmp
- %tmp9 = getelementptr %struct.munger_struct* %P, i32 0, i32 0
- store i32 %tmp8, i32* %tmp9
- ret void
-}
-</pre>
-</div>
-
- <p>In each case the first operand is the pointer through which the GEP
- instruction starts. The same is true whether the first operand is an
- argument, allocated memory, or a global variable. </p>
- <p>To make this clear, let's consider a more obtuse example:</p>
-
-<div class="doc_code">
-<pre>
-%MyVar = unintialized global i32
-...
-%idx1 = getelementptr i32* %MyVar, i64 0
-%idx2 = getelementptr i32* %MyVar, i64 1
-%idx3 = getelementptr i32* %MyVar, i64 2
-</pre>
-</div>
-
- <p>These GEP instructions are simply making address computations from the
- base address of <tt>MyVar</tt>. They compute, as follows (using C syntax):
- </p>
-
-<div class="doc_code">
-<pre>
-idx1 = (char*) &amp;MyVar + 0
-idx2 = (char*) &amp;MyVar + 4
-idx3 = (char*) &amp;MyVar + 8
-</pre>
-</div>
-
- <p>Since the type <tt>i32</tt> is known to be four bytes long, the indices
- 0, 1 and 2 translate into memory offsets of 0, 4, and 8, respectively. No
- memory is accessed to make these computations because the address of
- <tt>%MyVar</tt> is passed directly to the GEP instructions.</p>
- <p>The obtuse part of this example is in the cases of <tt>%idx2</tt> and
- <tt>%idx3</tt>. They result in the computation of addresses that point to
- memory past the end of the <tt>%MyVar</tt> global, which is only one
- <tt>i32</tt> long, not three <tt>i32</tt>s long. While this is legal in LLVM,
- it is inadvisable because any load or store with the pointer that results
- from these GEP instructions would produce undefined results.</p>
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_subsection">
- <a name="extra_index"><b>Why is the extra 0 index required?</b></a>
-</div>
-<!-- *********************************************************************** -->
-<div class="doc_text">
- <p>Quick answer: there are no superfluous indices.</p>
- <p>This question arises most often when the GEP instruction is applied to a
- global variable which is always a pointer type. For example, consider
- this:</p>
-
-<div class="doc_code">
-<pre>
-%MyStruct = uninitialized global { float*, i32 }
-...
-%idx = getelementptr { float*, i32 }* %MyStruct, i64 0, i32 1
-</pre>
-</div>
-
- <p>The GEP above yields an <tt>i32*</tt> by indexing the <tt>i32</tt> typed
- field of the structure <tt>%MyStruct</tt>. When people first look at it, they
- wonder why the <tt>i64 0</tt> index is needed. However, a closer inspection
- of how globals and GEPs work reveals the need. Becoming aware of the following
- facts will dispell the confusion:</p>
- <ol>
- <li>The type of <tt>%MyStruct</tt> is <i>not</i> <tt>{ float*, i32 }</tt>
- but rather <tt>{ float*, i32 }*</tt>. That is, <tt>%MyStruct</tt> is a
- pointer to a structure containing a pointer to a <tt>float</tt> and an
- <tt>i32</tt>.</li>
- <li>Point #1 is evidenced by noticing the type of the first operand of
- the GEP instruction (<tt>%MyStruct</tt>) which is
- <tt>{ float*, i32 }*</tt>.</li>
- <li>The first index, <tt>i64 0</tt> is required to step over the global
- variable <tt>%MyStruct</tt>. Since the first argument to the GEP
- instruction must always be a value of pointer type, the first index
- steps through that pointer. A value of 0 means 0 elements offset from that
- pointer.</li>
- <li>The second index, <tt>i32 1</tt> selects the second field of the
- structure (the <tt>i32</tt>). </li>
- </ol>
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_subsection">
- <a name="deref"><b>What is dereferenced by GEP?</b></a>
-</div>
-<div class="doc_text">
- <p>Quick answer: nothing.</p>
- <p>The GetElementPtr instruction dereferences nothing. That is, it doesn't
- access memory in any way. That's what the Load and Store instructions are for.
- GEP is only involved in the computation of addresses. For example, consider
- this:</p>
-
-<div class="doc_code">
-<pre>
-%MyVar = uninitialized global { [40 x i32 ]* }
-...
-%idx = getelementptr { [40 x i32]* }* %MyVar, i64 0, i32 0, i64 0, i64 17
-</pre>
-</div>
-
- <p>In this example, we have a global variable, <tt>%MyVar</tt> that is a
- pointer to a structure containing a pointer to an array of 40 ints. The
- GEP instruction seems to be accessing the 18th integer of the structure's
- array of ints. However, this is actually an illegal GEP instruction. It
- won't compile. The reason is that the pointer in the structure <i>must</i>
- be dereferenced in order to index into the array of 40 ints. Since the
- GEP instruction never accesses memory, it is illegal.</p>
- <p>In order to access the 18th integer in the array, you would need to do the
- following:</p>
-
-<div class="doc_code">
-<pre>
-%idx = getelementptr { [40 x i32]* }* %, i64 0, i32 0
-%arr = load [40 x i32]** %idx
-%idx = getelementptr [40 x i32]* %arr, i64 0, i64 17
-</pre>
-</div>
-
- <p>In this case, we have to load the pointer in the structure with a load
- instruction before we can index into the array. If the example was changed
- to:</p>
-
-<div class="doc_code">
-<pre>
-%MyVar = uninitialized global { [40 x i32 ] }
-...
-%idx = getelementptr { [40 x i32] }*, i64 0, i32 0, i64 17
-</pre>
-</div>
-
- <p>then everything works fine. In this case, the structure does not contain a
- pointer and the GEP instruction can index through the global variable,
- into the first field of the structure and access the 18th <tt>i32</tt> in the
- array there.</p>
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_subsection">
- <a name="lead0"><b>Why don't GEP x,0,0,1 and GEP x,1 alias?</b></a>
-</div>
-<div class="doc_text">
- <p>Quick Answer: They compute different address locations.</p>
- <p>If you look at the first indices in these GEP
- instructions you find that they are different (0 and 1), therefore the address
- computation diverges with that index. Consider this example:</p>
-
-<div class="doc_code">
-<pre>
-%MyVar = global { [10 x i32 ] }
-%idx1 = getlementptr { [10 x i32 ] }* %MyVar, i64 0, i32 0, i64 1
-%idx2 = getlementptr { [10 x i32 ] }* %MyVar, i64 1
-</pre>
-</div>
-
- <p>In this example, <tt>idx1</tt> computes the address of the second integer
- in the array that is in the structure in %MyVar, that is <tt>MyVar+4</tt>. The
- type of <tt>idx1</tt> is <tt>i32*</tt>. However, <tt>idx2</tt> computes the
- address of <i>the next</i> structure after <tt>%MyVar</tt>. The type of
- <tt>idx2</tt> is <tt>{ [10 x i32] }*</tt> and its value is equivalent
- to <tt>MyVar + 40</tt> because it indexes past the ten 4-byte integers
- in <tt>MyVar</tt>. Obviously, in such a situation, the pointers don't
- alias.</p>
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_subsection">
- <a name="trail0"><b>Why do GEP x,1,0,0 and GEP x,1 alias?</b></a>
-</div>
-<div class="doc_text">
- <p>Quick Answer: They compute the same address location.</p>
- <p>These two GEP instructions will compute the same address because indexing
- through the 0th element does not change the address. However, it does change
- the type. Consider this example:</p>
-
-<div class="doc_code">
-<pre>
-%MyVar = global { [10 x i32 ] }
-%idx1 = getlementptr { [10 x i32 ] }* %MyVar, i64 1, i32 0, i64 0
-%idx2 = getlementptr { [10 x i32 ] }* %MyVar, i64 1
-</pre>
-</div>
-
- <p>In this example, the value of <tt>%idx1</tt> is <tt>%MyVar+40</tt> and
- its type is <tt>i32*</tt>. The value of <tt>%idx2</tt> is also
- <tt>MyVar+40</tt> but its type is <tt>{ [10 x i32] }*</tt>.</p>
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section"><a name="summary"><b>Summary</b></a></div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
- <p>In summary, here's some things to always remember about the GetElementPtr
- instruction:</p>
- <ol>
- <li>The GEP instruction never accesses memory, it only provides pointer
- computations.</li>
- <li>The first operand to the GEP instruction is always a pointer and it must
- be indexed.</li>
- <li>There are no superfluous indices for the GEP instruction.</li>
- <li>Trailing zero indices are superfluous for pointer aliasing, but not for
- the types of the pointers.</li>
- <li>Leading zero indices are not superfluous for pointer aliasing nor the
- types of the pointers.</li>
- </ol>
-</div>
-
-<!-- *********************************************************************** -->
-
-<hr>
-<address>
- <a href="http://jigsaw.w3.org/css-validator/check/referer"><img
- src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"></a>
- <a href="http://validator.w3.org/check/referer"><img
- src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!" /></a>
- <a href="http://llvm.org">The LLVM Compiler Infrastructure</a><br/>
- Last modified: $Date$
-</address>
-</body>
-</html>
diff --git a/release_23/docs/GettingStarted.html b/release_23/docs/GettingStarted.html
deleted file mode 100644
index eed4547a7818..000000000000
--- a/release_23/docs/GettingStarted.html
+++ /dev/null
@@ -1,1649 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
- "http://www.w3.org/TR/html4/strict.dtd">
-<html>
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <title>Getting Started with LLVM System</title>
- <link rel="stylesheet" href="llvm.css" type="text/css">
-</head>
-<body>
-
-<div class="doc_title">
- Getting Started with the LLVM System
-</div>
-
-<ul>
- <li><a href="#overview">Overview</a>
- <li><a href="#quickstart">Getting Started Quickly (A Summary)</a>
- <li><a href="#requirements">Requirements</a>
- <ol>
- <li><a href="#hardware">Hardware</a></li>
- <li><a href="#software">Software</a></li>
- <li><a href="#brokengcc">Broken versions of GCC and other tools</a></li>
- </ol></li>
-
- <li><a href="#starting">Getting Started with LLVM</a>
- <ol>
- <li><a href="#terminology">Terminology and Notation</a></li>
- <li><a href="#environment">Setting Up Your Environment</a></li>
- <li><a href="#unpack">Unpacking the LLVM Archives</a></li>
- <li><a href="#checkout">Checkout LLVM from Subversion</a></li>
- <li><a href="#installcf">Install the GCC Front End</a></li>
- <li><a href="#config">Local LLVM Configuration</a></li>
- <li><a href="#compile">Compiling the LLVM Suite Source Code</a></li>
- <li><a href="#cross-compile">Cross-Compiling LLVM</a></li>
- <li><a href="#objfiles">The Location of LLVM Object Files</a></li>
- <li><a href="#optionalconfig">Optional Configuration Items</a></li>
- </ol></li>
-
- <li><a href="#layout">Program layout</a>
- <ol>
- <li><a href="#examples"><tt>llvm/examples</tt></a></li>
- <li><a href="#include"><tt>llvm/include</tt></a></li>
- <li><a href="#lib"><tt>llvm/lib</tt></a></li>
- <li><a href="#projects"><tt>llvm/projects</tt></a></li>
- <li><a href="#runtime"><tt>llvm/runtime</tt></a></li>
- <li><a href="#test"><tt>llvm/test</tt></a></li>
- <li><a href="#llvmtest"><tt>llvm-test</tt></a></li>
- <li><a href="#tools"><tt>llvm/tools</tt></a></li>
- <li><a href="#utils"><tt>llvm/utils</tt></a></li>
- <li><a href="#win32"><tt>llvm/win32</tt></a></li>
- </ol></li>
-
- <li><a href="#tutorial">An Example Using the LLVM Tool Chain</a>
- <ol>
- <li><a href="#tutorial4">Example with llvm-gcc4</a></li>
- </ol>
- <li><a href="#problems">Common Problems</a>
- <li><a href="#links">Links</a>
-</ul>
-
-<div class="doc_author">
- <p>Written by:
- <a href="mailto:criswell@uiuc.edu">John Criswell</a>,
- <a href="mailto:sabre@nondot.org">Chris Lattner</a>,
- <a href="http://misha.brukman.net">Misha Brukman</a>,
- <a href="http://www.cs.uiuc.edu/~vadve">Vikram Adve</a>, and
- <a href="mailto:gshi1@uiuc.edu">Guochun Shi</a>.
- </p>
-</div>
-
-
-<!-- *********************************************************************** -->
-<div class="doc_section">
- <a name="overview"><b>Overview</b></a>
-</div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>Welcome to LLVM! In order to get started, you first need to know some
-basic information.</p>
-
-<p>First, LLVM comes in two pieces. The first piece is the LLVM suite. This
-contains all of the tools, libraries, and header files needed to use the low
-level virtual machine. It contains an assembler, disassembler, bitcode
-analyzer and bitcode optimizer. It also contains a test suite that can be
-used to test the LLVM tools and the GCC front end.</p>
-
-<p>The second piece is the GCC front end. This component provides a version of
-GCC that compiles C and C++ code into LLVM bitcode. Currently, the GCC front
-end uses the GCC parser to convert code to LLVM. Once
-compiled into LLVM bitcode, a program can be manipulated with the LLVM tools
-from the LLVM suite.</p>
-
-<p>
-There is a third, optional piece called llvm-test. It is a suite of programs
-with a testing harness that can be used to further test LLVM's functionality
-and performance.
-</p>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section">
- <a name="quickstart"><b>Getting Started Quickly (A Summary)</b></a>
-</div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>Here's the short story for getting up and running quickly with LLVM:</p>
-
-<ol>
- <li>Read the documentation.</li>
- <li>Read the documentation.</li>
- <li>Remember that you were warned twice about reading the documentation.</li>
- <li>Install the llvm-gcc4.2 front end if you intend to compile C or C++:
- <ol>
- <li><tt>cd <i>where-you-want-the-C-front-end-to-live</i></tt></li>
- <li><tt>gunzip --stdout llvm-gcc.<i>platform</i>.tar.gz | tar -xvf -</tt>
- </li>
- <ul><li>If the binary extension is ".bz" use bunzip2 instead of gunzip.</li>
- </ul>
- <li>Add llvm-gcc's "bin" directory to your PATH variable.</li>
- </ol></li>
-
- <li>Get the LLVM Source Code
- <ul>
- <li>With the distributed files (or use <a href="#checkout">SVN</a>):
- <ol>
- <li><tt>cd <i>where-you-want-llvm-to-live</i></tt>
- <li><tt>gunzip --stdout llvm-<i>version</i>.tar.gz | tar -xvf -</tt>
- </ol></li>
-
- </ul></li>
-
- <li><b>[Optional]</b> Get the Test Suite Source Code
- <ul>
- <li>With the distributed files (or use <a href="#checkout">SVN</a>):
- <ol>
- <li><tt>cd <i>where-you-want-llvm-to-live</i></tt>
- <li><tt>cd llvm/projects</tt>
- <li><tt>gunzip --stdout llvm-test-<i>version</i>.tar.gz | tar -xvf -</tt>
- </ol></li>
-
- </ul></li>
-
-
- <li>Configure the LLVM Build Environment
- <ol>
- <li><tt>cd <i>where-you-want-to-build-llvm</i></tt></li>
- <li><tt><i>/path/to/llvm/</i>configure [options]</tt><br>
- Some common options:
-
- <ul>
- <li><tt>--prefix=<i>directory</i></tt>
- <p>Specify for <i>directory</i> the full pathname of where you
- want the LLVM tools and libraries to be installed (default
- <tt>/usr/local</tt>).</p></li>
- <li><tt>--with-llvmgccdir=<i>directory</i></tt>
- <p>Optionally, specify for <i>directory</i> the full pathname of the
- C/C++ front end installation to use with this LLVM configuration. If
- not specified, the PATH will be searched.</p></li>
- <li><tt>--enable-spec2000=<i>directory</i></tt>
- <p>Enable the SPEC2000 benchmarks for testing. The SPEC2000
- benchmarks should be available in
- <tt><i>directory</i></tt>.</p></li>
- </ul>
- </ol></li>
-
- <li>Build the LLVM Suite:
- <ol>
- <li><tt>gmake -k |&amp; tee gnumake.out
- &nbsp;&nbsp;&nbsp;# this is csh or tcsh syntax</tt></li>
- <li>If you get an "internal compiler error (ICE)" or test failures, see
- <a href="#brokengcc">below</a>.</li>
- </ol>
-
-</ol>
-
-<p>Consult the <a href="#starting">Getting Started with LLVM</a> section for
-detailed information on configuring and compiling LLVM. See <a
-href="#environment">Setting Up Your Environment</a> for tips that simplify
-working with the GCC front end and LLVM tools. Go to <a href="#layout">Program
-Layout</a> to learn about the layout of the source code tree.</p>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section">
- <a name="requirements"><b>Requirements</b></a>
-</div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>Before you begin to use the LLVM system, review the requirements given below.
-This may save you some trouble by knowing ahead of time what hardware and
-software you will need.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="hardware"><b>Hardware</b></a>
-</div>
-
-<div class="doc_text">
-
-<p>LLVM is known to work on the following platforms:</p>
-
-<table cellpadding="3" summary="Known LLVM platforms">
-<tr>
- <th>OS</th>
- <th>Arch</th>
- <th>Compilers</th>
-</tr>
-<tr>
- <td>Linux</td>
- <td>x86<sup><a href="#pf_1">1</a></sup></td>
- <td>GCC</td>
-</tr>
-<tr>
- <td>Solaris</td>
- <td>V9 (Ultrasparc)</td>
- <td>GCC</td>
-</tr>
-<tr>
- <td>FreeBSD</td>
- <td>x86<sup><a href="#pf_1">1</a></sup></td>
- <td>GCC</td>
-</tr>
-<tr>
- <td>MacOS X<sup><a href="#pf_2">2</a></sup></td>
- <td>PowerPC</td>
- <td>GCC</td>
-</tr>
-<tr>
- <td>MacOS X<sup><a href="#pf_2">2</a>,<a href="#pf_9">9</a></sup></td>
- <td>x86</td>
- <td>GCC</td>
-
-</tr>
-<tr>
- <td>Cygwin/Win32</td>
- <td>x86<sup><a href="#pf_1">1</a>,<a href="#pf_8">8</a></sup></td>
- <td>GCC 3.4.X, binutils 2.15</td>
-</tr>
-<tr>
- <td>MinGW/Win32</td>
- <td>x86<sup><a href="#pf_1">1</a>,<a href="#pf_6">6</a>,<a href="#pf_8">8</a></sup></td>
- <td>GCC 3.4.X, binutils 2.15</td>
-</tr>
-<tr>
- <td>Linux</td>
- <td>amd64<sup><a href="#pf_3">3</a></sup></td>
- <td>GCC</td>
-</tr>
-</table>
-
-<p>LLVM has partial support for the following platforms:</p>
-
-<table summary="LLVM partial platform support">
-<tr>
- <th>OS</th>
- <th>Arch</th>
- <th>Compilers</th>
-</tr>
-<tr>
- <td>Windows</td>
- <td>x86<sup><a href="#pf_1">1</a></sup></td>
- <td>Visual Studio .NET<sup><a href="#pf_4">4</a>,<a href="#pf_5">5</a></sup></td>
-<tr>
- <td>AIX<sup><a href="#pf_3">3</a>,<a href="#pf_4">4</a></sup></td>
- <td>PowerPC</td>
- <td>GCC</td>
-</tr>
-<tr>
- <td>Linux<sup><a href="#pf_3">3</a>,<a href="#pf_5">5</a></sup></td>
- <td>PowerPC</td>
- <td>GCC</td>
-</tr>
-
-<tr>
- <td>Linux<sup><a href="#pf_7">7</a></sup></td>
- <td>Alpha</td>
- <td>GCC</td>
-</tr>
-<tr>
- <td>Linux<sup><a href="#pf_7">7</a></sup></td>
- <td>Itanium (IA-64)</td>
- <td>GCC</td>
-</tr>
-<tr>
- <td>HP-UX<sup><a href="#pf_7">7</a></sup></td>
- <td>Itanium (IA-64)</td>
- <td>HP aCC</td>
-</tr>
-</table>
-
-<p><b>Notes:</b></p>
-
-<div class="doc_notes">
-<ol>
-<li><a name="pf_1">Code generation supported for Pentium processors and
-up</a></li>
-<li><a name="pf_2">Code generation supported for 32-bit ABI only</a></li>
-<li><a name="pf_3">No native code generation</a></li>
-<li><a name="pf_4">Build is not complete: one or more tools don't link</a></li>
-<li><a name="pf_5">The GCC-based C/C++ frontend does not build</a></li>
-<li><a name="pf_6">The port is done using the MSYS shell.</a>
-<a href="http://www.mingw.org/MinGWiki/">Download</a> and install
-bison (excl. M4.exe) and flex in that order. Build binutils-2.15 from source,
-if necessary. Bison &amp; flex can be also grabbed from GNUWin32 sf.net
-project.</li>
-<li><a name="pf_7">Native code generation exists but is not complete.</a></li>
-<li><a name="pf_8">Binutils</a> up to post-2.17 has bug in bfd/cofflink.c
- preventing LLVM from building correctly. Several workarounds have been
- introduced into LLVM build system, but the bug can occur anytime in the
- future. We highly recommend that you rebuild your current binutils with the
- patch from <a href="http://sourceware.org/bugzilla/show_bug.cgi?id=2659">
- Binutils bugzilla</a>, if it wasn't already applied.</li>
-<li><a name="pf_9">XCode 2.5 and gcc 4.0.1 (Apple Build 5370) will trip
- internal LLVM assert messages when compiled for Release at optimization
- levels greater than 0 (i.e., <i>&ldquo;-O1&rdquo;</i> and higher).
- Add <i>OPTIMIZE_OPTION=&quot;-O0&quot;</i> to the build command line
- if compiling for LLVM Release or bootstrapping the LLVM toolchain.</li>
-</ol>
-</div>
-
-<p>Note that you will need about 1-3 GB of space for a full LLVM build in Debug
-mode, depending on the system (it is so large because of all the debugging
-information and the fact that the libraries are statically linked into multiple
-tools). If you do not need many of the tools and you are space-conscious,
-you can disable them individually in <tt>llvm/tools/Makefile</tt>. The Release
-build requires considerably less space.</p>
-
-<p>The LLVM suite <i>may</i> compile on other platforms, but it is not
-guaranteed to do so. If compilation is successful, the LLVM utilities should be
-able to assemble, disassemble, analyze, and optimize LLVM bitcode. Code
-generation should work as well, although the generated native code may not work
-on your platform.</p>
-
-<p>The GCC front end is not very portable at the moment. If you want to get it
-to work on another platform, you can download a copy of the source and <a
-href="GCCFEBuildInstrs.html">try to compile it</a> on your platform.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection"><a name="software"><b>Software</b></a></div>
-<div class="doc_text">
- <p>Compiling LLVM requires that you have several software packages
- installed. The table below lists those required packages. The Package column
- is the usual name for the software package that LLVM depends on. The Version
- column provides "known to work" versions of the package. The Notes column
- describes how LLVM uses the package and provides other details.</p>
- <table summary="Packages required to compile LLVM">
- <tr><th>Package</th><th>Version</th><th>Notes</th></tr>
-
- <tr>
- <td><a href="http://savannah.gnu.org/projects/make">GNU Make</a></td>
- <td>3.79, 3.79.1</td>
- <td>Makefile/build processor</td>
- </tr>
-
- <tr>
- <td><a href="http://gcc.gnu.org">GCC</a></td>
- <td>3.4.2</td>
- <td>C/C++ compiler<sup><a href="#sf1">1</a></sup></td>
- </tr>
-
- <tr>
- <td><a href="http://www.gnu.org/software/texinfo">TeXinfo</a></td>
- <td>4.5</td>
- <td>For building the CFE</td>
- </tr>
-
- <tr>
- <td><a href="http://www.gnu.org/software/flex">Flex</a></td>
- <td>2.5.4</td>
- <td>LEX compiler</td>
- </tr>
-
- <tr>
- <td><a href="http://www.gnu.org/software/bison/bison.html">Bison</a></td>
- <td>1.28, 1.35, 1.75, 1.875d, 2.0, or 2.1<br>(not 1.85 or 1.875)</td>
- <td>YACC compiler</td>
- </tr>
-
- <tr>
- <td><a href="http://subversion.tigris.org/project_packages.html">SVN</a></td>
- <td>&ge;1.3</td>
- <td>Subversion access to LLVM<sup><a href="#sf2">2</a></sup></td>
- </tr>
-
- <tr>
- <td><a href="http://savannah.gnu.org/projects/dejagnu">DejaGnu</a></td>
- <td>1.4.2</td>
- <td>Automated test suite<sup><a href="#sf3">3</a></sup></td>
- </tr>
-
- <tr>
- <td><a href="http://www.tcl.tk/software/tcltk/">tcl</a></td>
- <td>8.3, 8.4</td>
- <td>Automated test suite<sup><a href="#sf3">3</a></sup></td>
- </tr>
-
- <tr>
- <td><a href="http://expect.nist.gov/">expect</a></td>
- <td>5.38.0</td>
- <td>Automated test suite<sup><a href="#sf3">3</a></sup></td>
- </tr>
-
- <tr>
- <td><a href="http://www.perl.com/download.csp">perl</a></td>
- <td>&ge;5.6.0</td>
- <td>Nightly tester, utilities</td>
- </tr>
-
- <tr>
- <td><a href="http://savannah.gnu.org/projects/m4">GNU M4</a>
- <td>1.4</td>
- <td>Macro processor for configuration<sup><a href="#sf4">4</a></sup></td>
- </tr>
-
- <tr>
- <td><a href="http://www.gnu.org/software/autoconf">GNU Autoconf</a></td>
- <td>2.59</td>
- <td>Configuration script builder<sup><a href="#sf4">4</a></sup></td>
- </tr>
-
- <tr>
- <td><a href="http://www.gnu.org/software/automake">GNU Automake</a></td>
- <td>1.9.2</td>
- <td>aclocal macro generator<sup><a href="#sf4">4</a></sup></td>
- </tr>
-
- <tr>
- <td><a href="http://savannah.gnu.org/projects/libtool">libtool</a></td>
- <td>1.5.10</td>
- <td>Shared library manager<sup><a href="#sf4">4</a></sup></td>
- </tr>
-
- </table>
-
- <p><b>Notes:</b></p>
- <div class="doc_notes">
- <ol>
- <li><a name="sf1">Only the C and C++ languages are needed so there's no
- need to build the other languages for LLVM's purposes.</a> See
- <a href="#brokengcc">below</a> for specific version info.</li>
- <li><a name="sf2">You only need Subversion if you intend to build from the
- latest LLVM sources. If you're working from a release distribution, you
- don't need Subversion.</a></li>
- <li><a name="sf3">Only needed if you want to run the automated test
- suite in the <tt>llvm/test</tt> directory.</a></li>
- <li><a name="sf4">If you want to make changes to the configure scripts,
- you will need GNU autoconf (2.59), and consequently, GNU M4 (version 1.4
- or higher). You will also need automake (1.9.2). We only use aclocal
- from that package.</a></li>
- </ol>
- </div>
-
- <p>Additionally, your compilation host is expected to have the usual
- plethora of Unix utilities. Specifically:</p>
- <ul>
- <li><b>ar</b> - archive library builder</li>
- <li><b>bzip2*</b> - bzip2 command for distribution generation</li>
- <li><b>bunzip2*</b> - bunzip2 command for distribution checking</li>
- <li><b>chmod</b> - change permissions on a file</li>
- <li><b>cat</b> - output concatenation utility</li>
- <li><b>cp</b> - copy files</li>
- <li><b>date</b> - print the current date/time </li>
- <li><b>echo</b> - print to standard output</li>
- <li><b>egrep</b> - extended regular expression search utility</li>
- <li><b>find</b> - find files/dirs in a file system</li>
- <li><b>grep</b> - regular expression search utility</li>
- <li><b>gzip*</b> - gzip command for distribution generation</li>
- <li><b>gunzip*</b> - gunzip command for distribution checking</li>
- <li><b>install</b> - install directories/files </li>
- <li><b>mkdir</b> - create a directory</li>
- <li><b>mv</b> - move (rename) files</li>
- <li><b>ranlib</b> - symbol table builder for archive libraries</li>
- <li><b>rm</b> - remove (delete) files and directories</li>
- <li><b>sed</b> - stream editor for transforming output</li>
- <li><b>sh</b> - Bourne shell for make build scripts</li>
- <li><b>tar</b> - tape archive for distribution generation</li>
- <li><b>test</b> - test things in file system</li>
- <li><b>unzip*</b> - unzip command for distribution checking</li>
- <li><b>zip*</b> - zip command for distribution generation</li>
- </ul>
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="brokengcc">Broken versions of GCC and other tools</a>
-</div>
-
-<div class="doc_text">
-
-<p>LLVM is very demanding of the host C++ compiler, and as such tends to expose
-bugs in the compiler. In particular, several versions of GCC crash when trying
-to compile LLVM. We routinely use GCC 3.3.3, 3.4.0, and Apple 4.0.1
-successfully with them (however, see important notes below). Other versions
-of GCC will probably work as well. GCC versions listed
-here are known to not work. If you are using one of these versions, please try
-to upgrade your GCC to something more recent. If you run into a problem with a
-version of GCC not listed here, please <a href="mailto:llvmdev@cs.uiuc.edu">let
-us know</a>. Please use the "<tt>gcc -v</tt>" command to find out which version
-of GCC you are using.
-</p>
-
-<p><b>GCC versions prior to 3.0</b>: GCC 2.96.x and before had several
-problems in the STL that effectively prevent it from compiling LLVM.
-</p>
-
-<p><b>GCC 3.2.2 and 3.2.3</b>: These versions of GCC fails to compile LLVM with
-a bogus template error. This was fixed in later GCCs.</p>
-
-<p><b>GCC 3.3.2</b>: This version of GCC suffered from a <a
-href="http://gcc.gnu.org/PR13392">serious bug</a> which causes it to crash in
-the "<tt>convert_from_eh_region_ranges_1</tt>" GCC function.</p>
-
-<p><b>Cygwin GCC 3.3.3</b>: The version of GCC 3.3.3 commonly shipped with
- Cygwin does not work. Please <a href="GCCFEBuildInstrs.html#cygwin">upgrade
- to a newer version</a> if possible.</p>
-<p><b>SuSE GCC 3.3.3</b>: The version of GCC 3.3.3 shipped with SuSE 9.1 (and
- possibly others) does not compile LLVM correctly (it appears that exception
- handling is broken in some cases). Please download the FSF 3.3.3 or upgrade
- to a newer version of GCC.</p>
-<p><b>GCC 3.4.0 on linux/x86 (32-bit)</b>: GCC miscompiles portions of the
- code generator, causing an infinite loop in the llvm-gcc build when built
- with optimizations enabled (i.e. a release build).</p>
-<p><b>GCC 3.4.2 on linux/x86 (32-bit)</b>: GCC miscompiles portions of the
- code generator at -O3, as with 3.4.0. However gcc 3.4.2 (unlike 3.4.0)
- correctly compiles LLVM at -O2. A work around is to build release LLVM
- builds with "make ENABLE_OPTIMIZED=1 OPTIMIZE_OPTION=-O2 ..."</p>
-<p><b>GCC 3.4.x on X86-64/amd64</b>: GCC <a href="http://llvm.org/PR1056">
- miscompiles portions of LLVM</a>.</p>
-<p><b>GCC 3.4.4 (CodeSourcery ARM 2005q3-2)</b>: this compiler miscompiles LLVM
- when building with optimizations enabled. It appears to work with
- "<tt>make ENABLE_OPTIMIZED=1 OPTIMIZE_OPTION=-O1</tt>" or build a debug
- build.</p>
-<p><b>IA-64 GCC 4.0.0</b>: The IA-64 version of GCC 4.0.0 is known to
- miscompile LLVM.</p>
-<p><b>Apple Xcode 2.3</b>: GCC crashes when compiling LLVM at -O3 (which is the
- default with ENABLE_OPTIMIZED=1. To work around this, build with
- "ENABLE_OPTIMIZED=1 OPTIMIZE_OPTION=-O2".</p>
-<p><b>GCC 4.1.1</b>: GCC fails to build LLVM with template concept check errors
- compiling some files. At the time of this writing, GCC mainline (4.2)
- did not share the problem.</p>
-<p><b>GCC 4.1.1 on X86-64/amd64</b>: GCC <a href="http://llvm.org/PR1063">
- miscompiles portions of LLVM</a> when compiling llvm itself into 64-bit
- code. LLVM will appear to mostly work but will be buggy, e.g. failing
- portions of its testsuite.</p>
-<p><b>GCC 4.1.2 on OpenSUSE</b>: Seg faults during libstdc++ build and on x86_64
-platforms compiling md5.c gets a mangled constant.</p>
-<p><b>GNU ld 2.16.X</b>. Some 2.16.X versions of the ld linker will produce very
-long warning messages complaining that some ".gnu.linkonce.t.*" symbol was
-defined in a discarded section. You can safely ignore these messages as they are
-erroneous and the linkage is correct. These messages disappear using ld
-2.17.</p>
-
-<p><b>GNU binutils 2.17</b>: Binutils 2.17 contains <a
-href="http://sourceware.org/bugzilla/show_bug.cgi?id=3111">a bug</a> which
-causes huge link times (minutes instead of seconds) when building LLVM. We
-recommend upgrading to a newer version (2.17.50.0.4 or later).</p>
-
-</div>
-
-
-
-<!-- *********************************************************************** -->
-<div class="doc_section">
- <a name="starting"><b>Getting Started with LLVM</b></a>
-</div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>The remainder of this guide is meant to get you up and running with
-LLVM and to give you some basic information about the LLVM environment.</p>
-
-<p>The later sections of this guide describe the <a
-href="#layout">general layout</a> of the the LLVM source tree, a <a
-href="#tutorial">simple example</a> using the LLVM tool chain, and <a
-href="#links">links</a> to find more information about LLVM or to get
-help via e-mail.</p>
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="terminology">Terminology and Notation</a>
-</div>
-
-<div class="doc_text">
-
-<p>Throughout this manual, the following names are used to denote paths
-specific to the local system and working environment. <i>These are not
-environment variables you need to set but just strings used in the rest
-of this document below</i>. In any of the examples below, simply replace
-each of these names with the appropriate pathname on your local system.
-All these paths are absolute:</p>
-
-<dl>
- <dt>SRC_ROOT
- <dd>
- This is the top level directory of the LLVM source tree.
- <br><br>
-
- <dt>OBJ_ROOT
- <dd>
- This is the top level directory of the LLVM object tree (i.e. the
- tree where object files and compiled programs will be placed. It
- can be the same as SRC_ROOT).
- <br><br>
-
- <dt>LLVMGCCDIR
- <dd>
- This is where the LLVM GCC Front End is installed.
- <p>
- For the pre-built GCC front end binaries, the LLVMGCCDIR is
- <tt>llvm-gcc/<i>platform</i>/llvm-gcc</tt>.
-</dl>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="environment">Setting Up Your Environment</a>
-</div>
-
-<div class="doc_text">
-
-<p>
-In order to compile and use LLVM, you may need to set some environment
-variables.
-
-<dl>
- <dt><tt>LLVM_LIB_SEARCH_PATH</tt>=<tt>/path/to/your/bitcode/libs</tt></dt>
- <dd>[Optional] This environment variable helps LLVM linking tools find the
- locations of your bitcode libraries. It is provided only as a
- convenience since you can specify the paths using the -L options of the
- tools and the C/C++ front-end will automatically use the bitcode files
- installed in its
- <tt>lib</tt> directory.</dd>
-</dl>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="unpack">Unpacking the LLVM Archives</a>
-</div>
-
-<div class="doc_text">
-
-<p>
-If you have the LLVM distribution, you will need to unpack it before you
-can begin to compile it. LLVM is distributed as a set of two files: the LLVM
-suite and the LLVM GCC front end compiled for your platform. There is an
-additional test suite that is optional. Each file is a TAR archive that is
-compressed with the gzip program.
-</p>
-
-<p>The files are as follows, with <em>x.y</em> marking the version number:
-<dl>
- <dt><tt>llvm-x.y.tar.gz</tt></dt>
- <dd>Source release for the LLVM libraries and tools.<br/></dd>
-
- <dt><tt>llvm-test-x.y.tar.gz</tt></dt>
- <dd>Source release for the LLVM test suite.</dd>
-
- <dt><tt>llvm-gcc4-x.y.source.tar.gz</tt></dt>
- <dd>Source release of the llvm-gcc4 front end. See README.LLVM in the root
- directory for build instructions.<br/></dd>
-
- <dt><tt>llvm-gcc4-x.y-platform.tar.gz</tt></dt>
- <dd>Binary release of the llvm-gcc4 front end for a specific platform.<br/></dd>
-
-</dl>
-
-<p>It is also possible to download the sources of the llvm-gcc4 front end from a
-read-only subversion mirror at
-svn://anonsvn.opensource.apple.com/svn/llvm/trunk. </p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="checkout">Checkout LLVM from Subversion</a>
-</div>
-
-<div class="doc_text">
-
-<p>If you have access to our Subversion repository, you can get a fresh copy of
-the entire source code. All you need to do is check it out from Subvresion as
-follows:</p>
-
-<ul>
- <li><tt>cd <i>where-you-want-llvm-to-live</i></tt></li>
- <li>Read-Only: <tt>svn co http://llvm.org/svn/llvm-project/llvm/trunk llvm</tt></li>
- <li>Read-Write:<tt>svn co https://user@llvm.org/svn/llvm-project/llvm/trunk
- llvm</tt></li>
-</ul>
-
-
-<p>This will create an '<tt>llvm</tt>' directory in the current
-directory and fully populate it with the LLVM source code, Makefiles,
-test directories, and local copies of documentation files.</p>
-
-<p>If you want to get a specific release (as opposed to the most recent
-revision), you can checkout it from the '<tt>tags</tt>' directory (instead of
-'<tt>trunk</tt>'). The following releases are located in the following
- subdirectories of the '<tt>tags</tt>' directory:</p>
-
-<ul>
-<li>Release 2.3: <b>RELEASE_23</b></li>
-<li>Release 2.2: <b>RELEASE_22</b></li>
-<li>Release 2.1: <b>RELEASE_21</b></li>
-<li>Release 2.0: <b>RELEASE_20</b></li>
-<li>Release 1.9: <b>RELEASE_19</b></li>
-<li>Release 1.8: <b>RELEASE_18</b></li>
-<li>Release 1.7: <b>RELEASE_17</b></li>
-<li>Release 1.6: <b>RELEASE_16</b></li>
-<li>Release 1.5: <b>RELEASE_15</b></li>
-<li>Release 1.4: <b>RELEASE_14</b></li>
-<li>Release 1.3: <b>RELEASE_13</b></li>
-<li>Release 1.2: <b>RELEASE_12</b></li>
-<li>Release 1.1: <b>RELEASE_11</b></li>
-<li>Release 1.0: <b>RELEASE_1</b></li>
-</ul>
-
-<p>If you would like to get the LLVM test suite (a separate package as of 1.4),
-you get it from the Subversion repository:</p>
-
-<div class="doc_code">
-<pre>
-% cd llvm/projects
-% svn co http://llvm.org/svn/llvm-project/test-suite/trunk llvm-test
-</pre>
-</div>
-
-<p>By placing it in the <tt>llvm/projects</tt>, it will be automatically
-configured by the LLVM configure script as well as automatically updated when
-you run <tt>svn update</tt>.</p>
-
-<p>If you would like to get the GCC front end source code, you can also get it
-and build it yourself. Please follow <a href="GCCFEBuildInstrs.html">these
-instructions</a> to successfully get and build the LLVM GCC front-end.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="installcf">Install the GCC Front End</a>
-</div>
-
-<div class="doc_text">
-
-<p>Before configuring and compiling the LLVM suite, you can optionally extract the
-LLVM GCC front end from the binary distribution. It is used for running the
-llvm-test testsuite and for compiling C/C++ programs. Note that you can optionally
-<a href="GCCFEBuildInstrs.html">build llvm-gcc yourself</a> after building the
-main LLVM repository.</p>
-
-<p>To install the GCC front end, do the following:</p>
-
-<ol>
- <li><tt>cd <i>where-you-want-the-front-end-to-live</i></tt></li>
- <li><tt>gunzip --stdout llvmgcc-<i>version</i>.<i>platform</i>.tar.gz | tar -xvf
- -</tt></li>
-</ol>
-
-<p>Once the binary is uncompressed, you should add a symlink for llvm-gcc and
-llvm-g++ to some directory in your path. When you configure LLVM, it will
-automatically detect llvm-gcc's presence (if it is in your path) enabling its
-use in llvm-test. Note that you can always build or install llvm-gcc at any
-pointer after building the main LLVM repository: just reconfigure llvm and
-llvm-test will pick it up.
-</p>
-
-<p>The binary versions of the GCC front end may not suit all of your needs. For
-example, the binary distribution may include an old version of a system header
-file, not "fix" a header file that needs to be fixed for GCC, or it may be
-linked with libraries not available on your system.</p>
-
-<p>In cases like these, you may want to try <a
-href="GCCFEBuildInstrs.html">building the GCC front end from source.</a> This is
-much easier now than it was in the past.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="config">Local LLVM Configuration</a>
-</div>
-
-<div class="doc_text">
-
- <p>Once checked out from the Subversion repository, the LLVM suite source
- code must be
-configured via the <tt>configure</tt> script. This script sets variables in the
-various <tt>*.in</tt> files, most notably <tt>llvm/Makefile.config</tt> and
-<tt>llvm/include/Config/config.h</tt>. It also populates <i>OBJ_ROOT</i> with
-the Makefiles needed to begin building LLVM.</p>
-
-<p>The following environment variables are used by the <tt>configure</tt>
-script to configure the build system:</p>
-
-<table summary="LLVM configure script environment variables">
- <tr><th>Variable</th><th>Purpose</th></tr>
- <tr>
- <td>CC</td>
- <td>Tells <tt>configure</tt> which C compiler to use. By default,
- <tt>configure</tt> will look for the first GCC C compiler in
- <tt>PATH</tt>. Use this variable to override
- <tt>configure</tt>'s default behavior.</td>
- </tr>
- <tr>
- <td>CXX</td>
- <td>Tells <tt>configure</tt> which C++ compiler to use. By default,
- <tt>configure</tt> will look for the first GCC C++ compiler in
- <tt>PATH</tt>. Use this variable to override
- <tt>configure</tt>'s default behavior.</td>
- </tr>
-</table>
-
-<p>The following options can be used to set or enable LLVM specific options:</p>
-
-<dl>
- <dt><i>--with-llvmgccdir</i></dt>
- <dd>Path to the LLVM C/C++ FrontEnd to be used with this LLVM configuration.
- The value of this option should specify the full pathname of the C/C++ Front
- End to be used. If this option is not provided, the PATH will be searched for
- a program named <i>llvm-gcc</i> and the C/C++ FrontEnd install directory will
- be inferred from the path found. If the option is not given, and no llvm-gcc
- can be found in the path then a warning will be produced by
- <tt>configure</tt> indicating this situation. LLVM may still be built with
- the <tt>tools-only</tt> target but attempting to build the runtime libraries
- will fail as these libraries require llvm-gcc and llvm-g++. See
- <a href="#installcf">Install the GCC Front End</a> for details on installing
- the C/C++ Front End. See
- <a href="GCCFEBuildInstrs.html">Bootstrapping the LLVM C/C++ Front-End</a>
- for details on building the C/C++ Front End.</dd>
- <dt><i>--with-tclinclude</i></dt>
- <dd>Path to the tcl include directory under which <tt>tclsh</tt> can be
- found. Use this if you have multiple tcl installations on your machine and you
- want to use a specific one (8.x) for LLVM. LLVM only uses tcl for running the
- dejagnu based test suite in <tt>llvm/test</tt>. If you don't specify this
- option, the LLVM configure script will search for the tcl 8.4 and 8.3
- releases.
- <br><br>
- </dd>
- <dt><i>--enable-optimized</i></dt>
- <dd>
- Enables optimized compilation by default (debugging symbols are removed
- and GCC optimization flags are enabled). The default is to use an
- unoptimized build (also known as a debug build).
- <br><br>
- </dd>
- <dt><i>--enable-debug-runtime</i></dt>
- <dd>
- Enables debug symbols in the runtime libraries. The default is to strip
- debug symbols from the runtime libraries.
- </dd>
- <dt><i>--enable-jit</i></dt>
- <dd>
- Compile the Just In Time (JIT) compiler functionality. This is not
- available
- on all platforms. The default is dependent on platform, so it is best
- to explicitly enable it if you want it.
- <br><br>
- </dd>
- <dt><i>--enable-targets=</i><tt>target-option</tt></dt>
- <dd>Controls which targets will be built and linked into llc. The default
- value for <tt>target_options</tt> is "all" which builds and links all
- available targets. The value "host-only" can be specified to build only a
- native compiler (no cross-compiler targets available). The "native" target is
- selected as the target of the build host. You can also specify a comma
- separated list of target names that you want available in llc. The target
- names use all lower case. The current set of targets is: <br/>
- <tt>alpha, ia64, powerpc, skeleton, sparc, x86</tt>.
- <br><br></dd>
- <dt><i>--enable-doxygen</i></dt>
- <dd>Look for the doxygen program and enable construction of doxygen based
- documentation from the source code. This is disabled by default because
- generating the documentation can take a long time and producess 100s of
- megabytes of output.</dd>
- <dt><i>--with-udis86</i></dt>
- <dd>LLVM can use external disassembler library for various purposes (now it's
- used only for examining code produced by JIT). This option will enable usage
- of <a href="http://udis86.sourceforge.net/">udis86</a> x86 (both 32 and 64
- bits) disassembler library.</dd>
-</dl>
-
-<p>To configure LLVM, follow these steps:</p>
-
-<ol>
- <li><p>Change directory into the object root directory:</p>
-
- <div class="doc_code"><pre>% cd <i>OBJ_ROOT</i></pre></div></li>
-
- <li><p>Run the <tt>configure</tt> script located in the LLVM source
- tree:</p>
-
- <div class="doc_code">
- <pre>% <i>SRC_ROOT</i>/configure --prefix=/install/path [other options]</pre>
- </div></li>
-</ol>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="compile">Compiling the LLVM Suite Source Code</a>
-</div>
-
-<div class="doc_text">
-
-<p>Once you have configured LLVM, you can build it. There are three types of
-builds:</p>
-
-<dl>
- <dt>Debug Builds
- <dd>
- These builds are the default when one types <tt>gmake</tt> (unless the
- <tt>--enable-optimized</tt> option was used during configuration). The
- build system will compile the tools and libraries with debugging
- information.
- <br><br>
-
- <dt>Release (Optimized) Builds
- <dd>
- These builds are enabled with the <tt>--enable-optimized</tt> option to
- <tt>configure</tt> or by specifying <tt>ENABLE_OPTIMIZED=1</tt> on the
- <tt>gmake</tt> command line. For these builds, the build system will
- compile the tools and libraries with GCC optimizations enabled and strip
- debugging information from the libraries and executables it generates.
- <br><br>
-
- <dt>Profile Builds
- <dd>
- These builds are for use with profiling. They compile profiling
- information into the code for use with programs like <tt>gprof</tt>.
- Profile builds must be started by specifying <tt>ENABLE_PROFILING=1</tt>
- on the <tt>gmake</tt> command line.
-</dl>
-
-<p>Once you have LLVM configured, you can build it by entering the
-<i>OBJ_ROOT</i> directory and issuing the following command:</p>
-
-<div class="doc_code"><pre>% gmake</pre></div>
-
-<p>If the build fails, please <a href="#brokengcc">check here</a> to see if you
-are using a version of GCC that is known not to compile LLVM.</p>
-
-<p>
-If you have multiple processors in your machine, you may wish to use some of
-the parallel build options provided by GNU Make. For example, you could use the
-command:</p>
-
-<div class="doc_code"><pre>% gmake -j2</pre></div>
-
-<p>There are several special targets which are useful when working with the LLVM
-source code:</p>
-
-<dl>
- <dt><tt>gmake clean</tt>
- <dd>
- Removes all files generated by the build. This includes object files,
- generated C/C++ files, libraries, and executables.
- <br><br>
-
- <dt><tt>gmake dist-clean</tt>
- <dd>
- Removes everything that <tt>gmake clean</tt> does, but also removes files
- generated by <tt>configure</tt>. It attempts to return the source tree to the
- original state in which it was shipped.
- <br><br>
-
- <dt><tt>gmake install</tt>
- <dd>
- Installs LLVM header files, libraries, tools, and documentation in a
- hierarchy
- under $PREFIX, specified with <tt>./configure --prefix=[dir]</tt>, which
- defaults to <tt>/usr/local</tt>.
- <br><br>
-
- <dt><tt>gmake -C runtime install-bytecode</tt>
- <dd>
- Assuming you built LLVM into $OBJDIR, when this command is run, it will
- install bitcode libraries into the GCC front end's bitcode library
- directory. If you need to update your bitcode libraries,
- this is the target to use once you've built them.
- <br><br>
-</dl>
-
-<p>Please see the <a href="MakefileGuide.html">Makefile Guide</a> for further
-details on these <tt>make</tt> targets and descriptions of other targets
-available.</p>
-
-<p>It is also possible to override default values from <tt>configure</tt> by
-declaring variables on the command line. The following are some examples:</p>
-
-<dl>
- <dt><tt>gmake ENABLE_OPTIMIZED=1</tt>
- <dd>
- Perform a Release (Optimized) build.
- <br><br>
-
- <dt><tt>gmake ENABLE_OPTIMIZED=1 DISABLE_ASSERTIONS=1</tt>
- <dd>
- Perform a Release (Optimized) build without assertions enabled.
- <br><br>
-
- <dt><tt>gmake ENABLE_PROFILING=1</tt>
- <dd>
- Perform a Profiling build.
- <br><br>
-
- <dt><tt>gmake VERBOSE=1</tt>
- <dd>
- Print what <tt>gmake</tt> is doing on standard output.
- <br><br>
-
- <dt><tt>gmake TOOL_VERBOSE=1</tt></dt>
- <dd>Ask each tool invoked by the makefiles to print out what it is doing on
- the standard output. This also implies <tt>VERBOSE=1</tt>.
- <br><br></dd>
-</dl>
-
-<p>Every directory in the LLVM object tree includes a <tt>Makefile</tt> to build
-it and any subdirectories that it contains. Entering any directory inside the
-LLVM object tree and typing <tt>gmake</tt> should rebuild anything in or below
-that directory that is out of date.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="cross-compile">Cross-Compiling LLVM</a>
-</div>
-
-<div class="doc_text">
- <p>It is possible to cross-compile LLVM. That is, you can create LLVM
- executables and libraries for a platform different than the one one which you
- are compiling. To do this, a few additional steps are
- required. <sup><a href="#ccn_1">1</a></sup> To cross-compile LLVM, use
- these instructions:</p>
- <ol>
- <li>Configure and build LLVM as a native compiler. You will need
- just <tt>TableGen</tt> from that build.
- <ul>
- <li>If you have <tt>$LLVM_OBJ_ROOT=$LLVM_SRC_ROOT</tt> just execute
- <tt>make -C utils/TableGen</tt> after configuring.</li>
- <li>Otherwise you will need to monitor building process and terminate
- it just after <tt>TableGen</tt> was built.</li>
- </ul>
- </li>
- <li>Copy the TableGen binary to somewhere safe (out of your build tree).
- </li>
- <li>Configure LLVM to build with a cross-compiler. To do this, supply the
- configure script with <tt>--build</tt> and <tt>--host</tt> options that
- are different. The values of these options must be legal target triples
- that your GCC compiler supports.</li>
- <li>Put the saved <tt>TableGen</tt> executable into the
- into <tt>$LLVM_OBJ_ROOT/{BUILD_TYPE}/bin</tt> directory (e.g. into
- <tt>.../Release/bin</tt> for a Release build).</li>
- <li>Build LLVM as usual.</li>
- </ol>
- <p>The result of such a build will produce executables that are not executable
- on your build host (--build option) but can be executed on your compile host
- (--host option).</p>
- <p><b>Notes:</b></p>
- <div class="doc_notes">
- <ol>
- <li><a name="ccn_1">Cross-compiling</a> was tested only with Linux as
- build platform and Windows as host using mingw32 cross-compiler. Other
- combinations have not been tested.</li>
- </ol>
- </div>
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="objfiles">The Location of LLVM Object Files</a>
-</div>
-
-<div class="doc_text">
-
-<p>The LLVM build system is capable of sharing a single LLVM source tree among
-several LLVM builds. Hence, it is possible to build LLVM for several different
-platforms or configurations using the same source tree.</p>
-
-<p>This is accomplished in the typical autoconf manner:</p>
-
-<ul>
- <li><p>Change directory to where the LLVM object files should live:</p>
-
- <div class="doc_code"><pre>% cd <i>OBJ_ROOT</i></pre></div></li>
-
- <li><p>Run the <tt>configure</tt> script found in the LLVM source
- directory:</p>
-
- <div class="doc_code"><pre>% <i>SRC_ROOT</i>/configure</pre></div></li>
-</ul>
-
-<p>The LLVM build will place files underneath <i>OBJ_ROOT</i> in directories
-named after the build type:</p>
-
-<dl>
- <dt>Debug Builds
- <dd>
- <dl>
- <dt>Tools
- <dd><tt><i>OBJ_ROOT</i>/Debug/bin</tt>
- <dt>Libraries
- <dd><tt><i>OBJ_ROOT</i>/Debug/lib</tt>
- </dl>
- <br><br>
-
- <dt>Release Builds
- <dd>
- <dl>
- <dt>Tools
- <dd><tt><i>OBJ_ROOT</i>/Release/bin</tt>
- <dt>Libraries
- <dd><tt><i>OBJ_ROOT</i>/Release/lib</tt>
- </dl>
- <br><br>
-
- <dt>Profile Builds
- <dd>
- <dl>
- <dt>Tools
- <dd><tt><i>OBJ_ROOT</i>/Profile/bin</tt>
- <dt>Libraries
- <dd><tt><i>OBJ_ROOT</i>/Profile/lib</tt>
- </dl>
-</dl>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="optionalconfig">Optional Configuration Items</a>
-</div>
-
-<div class="doc_text">
-
-<p>
-If you're running on a Linux system that supports the "<a
-href="http://www.tat.physik.uni-tuebingen.de/~rguenth/linux/binfmt_misc.html">binfmt_misc</a>"
-module, and you have root access on the system, you can set your system up to
-execute LLVM bitcode files directly. To do this, use commands like this (the
-first command may not be required if you are already using the module):</p>
-
-<div class="doc_code">
-<pre>
-$ mount -t binfmt_misc none /proc/sys/fs/binfmt_misc
-$ echo ':llvm:M::llvm::/path/to/lli:' &gt; /proc/sys/fs/binfmt_misc/register
-$ chmod u+x hello.bc (if needed)
-$ ./hello.bc
-</pre>
-</div>
-
-<p>
-This allows you to execute LLVM bitcode files directly. Thanks to Jack
-Cummings for pointing this out!
-</p>
-
-</div>
-
-
-<!-- *********************************************************************** -->
-<div class="doc_section">
- <a name="layout"><b>Program Layout</b></a>
-</div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>One useful source of information about the LLVM source base is the LLVM <a
-href="http://www.doxygen.org">doxygen</a> documentation available at <tt><a
-href="http://llvm.org/doxygen/">http://llvm.org/doxygen/</a></tt>.
-The following is a brief introduction to code layout:</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection"><a name="examples"><tt>llvm/examples</tt></a></div>
-<div class="doc_text">
- <p>This directory contains some simple examples of how to use the LLVM IR and
- JIT.</p>
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection"><a name="include"><tt>llvm/include</tt></a></div>
-<div class="doc_text">
-
-<p>This directory contains public header files exported from the LLVM
-library. The three main subdirectories of this directory are:</p>
-
-<dl>
- <dt><tt><b>llvm/include/llvm</b></tt></dt>
- <dd>This directory contains all of the LLVM specific header files. This
- directory also has subdirectories for different portions of LLVM:
- <tt>Analysis</tt>, <tt>CodeGen</tt>, <tt>Target</tt>, <tt>Transforms</tt>,
- etc...</dd>
-
- <dt><tt><b>llvm/include/llvm/Support</b></tt></dt>
- <dd>This directory contains generic support libraries that are provided with
- LLVM but not necessarily specific to LLVM. For example, some C++ STL utilities
- and a Command Line option processing library store their header files here.
- </dd>
-
- <dt><tt><b>llvm/include/llvm/Config</b></tt></dt>
- <dd>This directory contains header files configured by the <tt>configure</tt>
- script. They wrap "standard" UNIX and C header files. Source code can
- include these header files which automatically take care of the conditional
- #includes that the <tt>configure</tt> script generates.</dd>
-</dl>
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection"><a name="lib"><tt>llvm/lib</tt></a></div>
-<div class="doc_text">
-
-<p>This directory contains most of the source files of the LLVM system. In LLVM,
-almost all code exists in libraries, making it very easy to share code among the
-different <a href="#tools">tools</a>.</p>
-
-<dl>
- <dt><tt><b>llvm/lib/VMCore/</b></tt></dt>
- <dd> This directory holds the core LLVM source files that implement core
- classes like Instruction and BasicBlock.</dd>
-
- <dt><tt><b>llvm/lib/AsmParser/</b></tt></dt>
- <dd>This directory holds the source code for the LLVM assembly language parser
- library.</dd>
-
- <dt><tt><b>llvm/lib/BitCode/</b></tt></dt>
- <dd>This directory holds code for reading and write LLVM bitcode.</dd>
-
- <dt><tt><b>llvm/lib/Analysis/</b></tt><dd>This directory contains a variety of
- different program analyses, such as Dominator Information, Call Graphs,
- Induction Variables, Interval Identification, Natural Loop Identification,
- etc.</dd>
-
- <dt><tt><b>llvm/lib/Transforms/</b></tt></dt>
- <dd> This directory contains the source code for the LLVM to LLVM program
- transformations, such as Aggressive Dead Code Elimination, Sparse Conditional
- Constant Propagation, Inlining, Loop Invariant Code Motion, Dead Global
- Elimination, and many others.</dd>
-
- <dt><tt><b>llvm/lib/Target/</b></tt></dt>
- <dd> This directory contains files that describe various target architectures
- for code generation. For example, the <tt>llvm/lib/Target/X86</tt>
- directory holds the X86 machine description while
- <tt>llvm/lib/Target/CBackend</tt> implements the LLVM-to-C converter.</dd>
-
- <dt><tt><b>llvm/lib/CodeGen/</b></tt></dt>
- <dd> This directory contains the major parts of the code generator: Instruction
- Selector, Instruction Scheduling, and Register Allocation.</dd>
-
- <dt><tt><b>llvm/lib/Debugger/</b></tt></dt>
- <dd> This directory contains the source level debugger library that makes
- it possible to instrument LLVM programs so that a debugger could identify
- source code locations at which the program is executing.</dd>
-
- <dt><tt><b>llvm/lib/ExecutionEngine/</b></tt></dt>
- <dd> This directory contains libraries for executing LLVM bitcode directly
- at runtime in both interpreted and JIT compiled fashions.</dd>
-
- <dt><tt><b>llvm/lib/Support/</b></tt></dt>
- <dd> This directory contains the source code that corresponds to the header
- files located in <tt>llvm/include/Support/</tt>.</dd>
-
- <dt><tt><b>llvm/lib/System/</b></tt></dt>
- <dd>This directory contains the operating system abstraction layer that
- shields LLVM from platform-specific coding.</dd>
-</dl>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection"><a name="projects"><tt>llvm/projects</tt></a></div>
-<div class="doc_text">
- <p>This directory contains projects that are not strictly part of LLVM but are
- shipped with LLVM. This is also the directory where you should create your own
- LLVM-based projects. See <tt>llvm/projects/sample</tt> for an example of how
- to set up your own project. See <tt>llvm/projects/Stacker</tt> for a fully
- functional example of a compiler front end.</p>
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection"><a name="runtime"><tt>llvm/runtime</tt></a></div>
-<div class="doc_text">
-
-<p>This directory contains libraries which are compiled into LLVM bitcode and
-used when linking programs with the GCC front end. Most of these libraries are
-skeleton versions of real libraries; for example, libc is a stripped down
-version of glibc.</p>
-
-<p>Unlike the rest of the LLVM suite, this directory needs the LLVM GCC front
-end to compile.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection"><a name="test"><tt>llvm/test</tt></a></div>
-<div class="doc_text">
- <p>This directory contains feature and regression tests and other basic sanity
- checks on the LLVM infrastructure. These are intended to run quickly and cover
- a lot of territory without being exhaustive.</p>
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection"><a name="llvmtest"><tt>test-suite</tt></a></div>
-<div class="doc_text">
- <p>This is not a directory in the normal llvm module; it is a separate
- Subversion
- module that must be checked out (usually to <tt>projects/test-suite</tt>).
- This
- module contains a comprehensive correctness, performance, and benchmarking
- test
- suite for LLVM. It is a separate Subversion module because not every LLVM
- user is
- interested in downloading or building such a comprehensive test suite. For
- further details on this test suite, please see the
- <a href="TestingGuide.html">Testing Guide</a> document.</p>
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection"><a name="tools"><tt>llvm/tools</tt></a></div>
-<div class="doc_text">
-
-<p>The <b>tools</b> directory contains the executables built out of the
-libraries above, which form the main part of the user interface. You can
-always get help for a tool by typing <tt>tool_name --help</tt>. The
-following is a brief introduction to the most important tools. More detailed
-information is in the <a href="CommandGuide/index.html">Command Guide</a>.</p>
-
-<dl>
-
- <dt><tt><b>bugpoint</b></tt></dt>
- <dd><tt>bugpoint</tt> is used to debug
- optimization passes or code generation backends by narrowing down the
- given test case to the minimum number of passes and/or instructions that
- still cause a problem, whether it is a crash or miscompilation. See <a
- href="HowToSubmitABug.html">HowToSubmitABug.html</a> for more information
- on using <tt>bugpoint</tt>.</dd>
-
- <dt><tt><b>llvmc</b></tt></dt>
- <dd>The LLVM Compiler Driver. This program can
- be configured to utilize both LLVM and non-LLVM compilation tools to enable
- pre-processing, translation, optimization, assembly, and linking of programs
- all from one command line. <tt>llvmc</tt> also takes care of processing the
- dependent libraries found in bitcode. This reduces the need to get the
- traditional <tt>-l&lt;name&gt;</tt> options right on the command line. Please
- note that this tool, while functional, is still experimental and not feature
- complete.</dd>
-
- <dt><tt><b>llvm-ar</b></tt></dt>
- <dd>The archiver produces an archive containing
- the given LLVM bitcode files, optionally with an index for faster
- lookup.</dd>
-
- <dt><tt><b>llvm-as</b></tt></dt>
- <dd>The assembler transforms the human readable LLVM assembly to LLVM
- bitcode.</dd>
-
- <dt><tt><b>llvm-dis</b></tt></dt>
- <dd>The disassembler transforms the LLVM bitcode to human readable
- LLVM assembly.</dd>
-
- <dt><tt><b>llvm-ld</b></tt></dt>
- <dd><tt>llvm-ld</tt> is a general purpose and extensible linker for LLVM.
- This is the linker invoked by <tt>llvmc</tt>. It performsn standard link time
- optimizations and allows optimization modules to be loaded and run so that
- language specific optimizations can be applied at link time.</dd>
-
- <dt><tt><b>llvm-link</b></tt></dt>
- <dd><tt>llvm-link</tt>, not surprisingly, links multiple LLVM modules into
- a single program.</dd>
-
- <dt><tt><b>lli</b></tt></dt>
- <dd><tt>lli</tt> is the LLVM interpreter, which
- can directly execute LLVM bitcode (although very slowly...). For architectures
- that support it (currently x86, Sparc, and PowerPC), by default, <tt>lli</tt>
- will function as a Just-In-Time compiler (if the functionality was compiled
- in), and will execute the code <i>much</i> faster than the interpreter.</dd>
-
- <dt><tt><b>llc</b></tt></dt>
- <dd> <tt>llc</tt> is the LLVM backend compiler, which
- translates LLVM bitcode to a native code assembly file or to C code (with
- the -march=c option).</dd>
-
- <dt><tt><b>llvm-gcc</b></tt></dt>
- <dd><tt>llvm-gcc</tt> is a GCC-based C frontend that has been retargeted to
- use LLVM as its backend instead of GCC's RTL backend. It can also emit LLVM
- bitcode or assembly (with the <tt>-emit-llvm</tt> option) instead of the
- usual machine code output. It works just like any other GCC compiler,
- taking the typical <tt>-c, -S, -E, -o</tt> options that are typically used.
- Additionally, the the source code for <tt>llvm-gcc</tt> is available as a
- separate Subversion module.</dd>
-
- <dt><tt><b>opt</b></tt></dt>
- <dd><tt>opt</tt> reads LLVM bitcode, applies a series of LLVM to LLVM
- transformations (which are specified on the command line), and then outputs
- the resultant bitcode. The '<tt>opt --help</tt>' command is a good way to
- get a list of the program transformations available in LLVM.<br/>
- <dd><tt>opt</tt> can also be used to run a specific analysis on an input
- LLVM bitcode file and print out the results. It is primarily useful for
- debugging analyses, or familiarizing yourself with what an analysis does.</dd>
-</dl>
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection"><a name="utils"><tt>llvm/utils</tt></a></div>
-<div class="doc_text">
-
-<p>This directory contains utilities for working with LLVM source code, and some
-of the utilities are actually required as part of the build process because they
-are code generators for parts of LLVM infrastructure.</p>
-
-<dl>
- <dt><tt><b>codegen-diff</b></tt> <dd><tt>codegen-diff</tt> is a script
- that finds differences between code that LLC generates and code that LLI
- generates. This is a useful tool if you are debugging one of them,
- assuming that the other generates correct output. For the full user
- manual, run <tt>`perldoc codegen-diff'</tt>.<br><br>
-
- <dt><tt><b>emacs/</b></tt> <dd>The <tt>emacs</tt> directory contains
- syntax-highlighting files which will work with Emacs and XEmacs editors,
- providing syntax highlighting support for LLVM assembly files and TableGen
- description files. For information on how to use the syntax files, consult
- the <tt>README</tt> file in that directory.<br><br>
-
- <dt><tt><b>getsrcs.sh</b></tt> <dd>The <tt>getsrcs.sh</tt> script finds
- and outputs all non-generated source files, which is useful if one wishes
- to do a lot of development across directories and does not want to
- individually find each file. One way to use it is to run, for example:
- <tt>xemacs `utils/getsources.sh`</tt> from the top of your LLVM source
- tree.<br><br>
-
- <dt><tt><b>llvmgrep</b></tt></dt>
- <dd>This little tool performs an "egrep -H -n" on each source file in LLVM and
- passes to it a regular expression provided on <tt>llvmgrep</tt>'s command
- line. This is a very efficient way of searching the source base for a
- particular regular expression.</dd>
-
- <dt><tt><b>makellvm</b></tt> <dd>The <tt>makellvm</tt> script compiles all
- files in the current directory and then compiles and links the tool that
- is the first argument. For example, assuming you are in the directory
- <tt>llvm/lib/Target/Sparc</tt>, if <tt>makellvm</tt> is in your path,
- simply running <tt>makellvm llc</tt> will make a build of the current
- directory, switch to directory <tt>llvm/tools/llc</tt> and build it,
- causing a re-linking of LLC.<br><br>
-
- <dt><tt><b>NewNightlyTest.pl</b></tt> and
- <tt><b>NightlyTestTemplate.html</b></tt> <dd>These files are used in a
- cron script to generate nightly status reports of the functionality of
- tools, and the results can be seen by following the appropriate link on
- the <a href="http://llvm.org/">LLVM homepage</a>.<br><br>
-
- <dt><tt><b>TableGen/</b></tt> <dd>The <tt>TableGen</tt> directory contains
- the tool used to generate register descriptions, instruction set
- descriptions, and even assemblers from common TableGen description
- files.<br><br>
-
- <dt><tt><b>vim/</b></tt> <dd>The <tt>vim</tt> directory contains
- syntax-highlighting files which will work with the VIM editor, providing
- syntax highlighting support for LLVM assembly files and TableGen
- description files. For information on how to use the syntax files, consult
- the <tt>README</tt> file in that directory.<br><br>
-
-</dl>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection"><a name="win32"><tt>llvm/win32</tt></a></div>
-<div class="doc_text">
- <p>This directory contains build scripts and project files for use with
- Visual C++. This allows developers on Windows to build LLVM without the need
- for Cygwin. The contents of this directory should be considered experimental
- at this time.
- </p>
-</div>
-<!-- *********************************************************************** -->
-<div class="doc_section">
- <a name="tutorial">An Example Using the LLVM Tool Chain</a>
-</div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-<p>This section gives an example of using LLVM. llvm-gcc3 is now obsolete,
-so we only include instructiosn for llvm-gcc4.
-</p>
-
-<p><b>Note:</b> The <i>gcc4</i> frontend's invocation is <b><i>considerably different</i></b>
-from the previous <i>gcc3</i> frontend. In particular, the <i>gcc4</i> frontend <b><i>does not</i></b>
-create bitcode by default: <i>gcc4</i> produces native code. As the example below illustrates,
-the '--emit-llvm' flag is needed to produce LLVM bitcode output. For <i>makefiles</i> and
-<i>configure</i> scripts, the CFLAGS variable needs '--emit-llvm' to produce bitcode
-output.</p>
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection"><a name="tutorial4">Example with llvm-gcc4</a></div>
-
-<div class="doc_text">
-
-<ol>
- <li><p>First, create a simple C file, name it 'hello.c':</p>
-
-<div class="doc_code">
-<pre>
-#include &lt;stdio.h&gt;
-
-int main() {
- printf("hello world\n");
- return 0;
-}
-</pre></div></li>
-
- <li><p>Next, compile the C file into a native executable:</p>
-
- <div class="doc_code"><pre>% llvm-gcc hello.c -o hello</pre></div>
-
- <p>Note that llvm-gcc works just like GCC by default. The standard -S and
- -c arguments work as usual (producing a native .s or .o file,
- respectively).</p></li>
-
- <li><p>Next, compile the C file into a LLVM bitcode file:</p>
-
- <div class="doc_code">
- <pre>% llvm-gcc -O3 -emit-llvm hello.c -c -o hello.bc</pre></div>
-
- <p>The -emit-llvm option can be used with the -S or -c options to emit an
- LLVM ".ll" or ".bc" file (respectively) for the code. This allows you
- to use the <a href="CommandGuide/index.html">standard LLVM tools</a> on
- the bitcode file.</p>
-
- <p>Unlike llvm-gcc3, llvm-gcc4 correctly responds to -O[0123] arguments.
- </p></li>
-
- <li><p>Run the program in both forms. To run the program, use:</p>
-
- <div class="doc_code"><pre>% ./hello</pre></div>
-
- <p>and</p>
-
- <div class="doc_code"><pre>% lli hello.bc</pre></div>
-
- <p>The second examples shows how to invoke the LLVM JIT, <a
- href="CommandGuide/html/lli.html">lli</a>.</p></li>
-
- <li><p>Use the <tt>llvm-dis</tt> utility to take a look at the LLVM assembly
- code:</p>
-
-<div class="doc_code">
-<pre>llvm-dis &lt; hello.bc | less</pre>
-</div></li>
-
- <li><p>Compile the program to native assembly using the LLC code
- generator:</p>
-
- <div class="doc_code"><pre>% llc hello.bc -o hello.s</pre></div></li>
-
- <li><p>Assemble the native assembly language file into a program:</p>
-
-<div class="doc_code">
-<pre>
-<b>Solaris:</b> % /opt/SUNWspro/bin/cc -xarch=v9 hello.s -o hello.native
-
-<b>Others:</b> % gcc hello.s -o hello.native
-</pre>
-</div></li>
-
- <li><p>Execute the native code program:</p>
-
- <div class="doc_code"><pre>% ./hello.native</pre></div>
-
- <p>Note that using llvm-gcc to compile directly to native code (i.e. when
- the -emit-llvm option is not present) does steps 6/7/8 for you.</p>
- </li>
-
-</ol>
-
-</div>
-
-
-<!-- *********************************************************************** -->
-<div class="doc_section">
- <a name="problems">Common Problems</a>
-</div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>If you are having problems building or using LLVM, or if you have any other
-general questions about LLVM, please consult the <a href="FAQ.html">Frequently
-Asked Questions</a> page.</p>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section">
- <a name="links">Links</a>
-</div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>This document is just an <b>introduction</b> to how to use LLVM to do
-some simple things... there are many more interesting and complicated things
-that you can do that aren't documented here (but we'll gladly accept a patch
-if you want to write something up!). For more information about LLVM, check
-out:</p>
-
-<ul>
- <li><a href="http://llvm.org/">LLVM homepage</a></li>
- <li><a href="http://llvm.org/doxygen/">LLVM doxygen tree</a></li>
- <li><a href="http://llvm.org/docs/Projects.html">Starting a Project
- that Uses LLVM</a></li>
-</ul>
-
-</div>
-
-<!-- *********************************************************************** -->
-
-<hr>
-<address>
- <a href="http://jigsaw.w3.org/css-validator/check/referer"><img
- src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"></a>
- <a href="http://validator.w3.org/check/referer"><img
- src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!" /></a>
-
- <a href="mailto:sabre@nondot.org">Chris Lattner</a><br>
- <a href="http://llvm.x10sys.com/rspencer/">Reid Spencer</a><br>
- <a href="http://llvm.org">The LLVM Compiler Infrastructure</a><br>
- Last modified: $Date$
-</address>
-</body>
-</html>
diff --git a/release_23/docs/GettingStartedVS.html b/release_23/docs/GettingStartedVS.html
deleted file mode 100644
index a09559ed8e62..000000000000
--- a/release_23/docs/GettingStartedVS.html
+++ /dev/null
@@ -1,380 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
- "http://www.w3.org/TR/html4/strict.dtd">
-<html>
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <title>Getting Started with LLVM System for Microsoft Visual Studio</title>
- <link rel="stylesheet" href="llvm.css" type="text/css">
-</head>
-<body>
-
-<div class="doc_title">
- Getting Started with the LLVM System using Microsoft Visual Studio
-</div>
-
-<ul>
- <li><a href="#overview">Overview</a>
- <li><a href="#quickstart">Getting Started Quickly (A Summary)</a>
- <li><a href="#requirements">Requirements</a>
- <ol>
- <li><a href="#hardware">Hardware</a>
- <li><a href="#software">Software</a>
- </ol></li>
-
- <li><a href="#starting">Getting Started with LLVM</a>
- <ol>
- <li><a href="#terminology">Terminology and Notation</a>
- <li><a href="#objfiles">The Location of LLVM Object Files</a>
- </ol></li>
-
- <li><a href="#tutorial">An Example Using the LLVM Tool Chain</a>
- <li><a href="#problems">Common Problems</a>
- <li><a href="#links">Links</a>
-</ul>
-
-<div class="doc_author">
- <p>Written by:
- <a href="mailto:jeffc@jolt-lang.org">Jeff Cohen</a>
- </p>
-</div>
-
-
-<!-- *********************************************************************** -->
-<div class="doc_section">
- <a name="overview"><b>Overview</b></a>
-</div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
- <p>The Visual Studio port at this time is experimental. It is suitable for
- use only if you are writing your own compiler front end or otherwise have a
- need to dynamically generate machine code. The JIT and interpreter are
- functional, but it is currently not possible to generate assembly code which
- is then assembled into an executable. You can indirectly create executables
- by using the C back end.</p>
-
- <p>To emphasize, there is no C/C++ front end currently available.
- <tt>llvm-gcc</tt> is based on GCC, which cannot be bootstrapped using VC++.
- Eventually there should be a <tt>llvm-gcc</tt> based on Cygwin or MinGW that
- is usable. There is also the option of generating bitcode files on Unix and
- copying them over to Windows. But be aware the odds of linking C++ code
- compiled with <tt>llvm-gcc</tt> with code compiled with VC++ is essentially
- zero.</p>
-
- <p>The LLVM test suite cannot be run on the Visual Studio port at this
- time.</p>
-
- <p>Most of the tools build and work. <tt>llvm-db</tt> does not build at this
- time. <tt>bugpoint</tt> does build, but does not work.
-
- <p>Additional information about the LLVM directory structure and tool chain
- can be found on the main <a href="GettingStarted.html">Getting Started</a>
- page.</P>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section">
- <a name="quickstart"><b>Getting Started Quickly (A Summary)</b></a>
-</div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>Here's the short story for getting up and running quickly with LLVM:</p>
-
-<ol>
- <li>Read the documentation.</li>
- <li>Seriously, read the documentation.</li>
- <li>Remember that you were warned twice about reading the documentation.</li>
-
- <li>Get the Source Code
- <ul>
- <li>With the distributed files:
- <ol>
- <li><tt>cd <i>where-you-want-llvm-to-live</i></tt>
- <li><tt>gunzip --stdout llvm-<i>version</i>.tar.gz | tar -xvf -</tt>
- <i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;or use WinZip</i>
- <li><tt>cd llvm</tt></li>
- </ol></li>
-
- <li>With anonymous Subversion access:
- <ol>
- <li><tt>cd <i>where-you-want-llvm-to-live</i></tt></li>
- <li><tt>svn co http://llvm.org/svn/llvm-project/llvm-top/trunk llvm-top
- </tt></li>
- <li><tt>make checkout MODULE=llvm</tt>
- <li><tt>cd llvm</tt></li>
- </ol></li>
- </ul></li>
-
- <li>Start Visual Studio
- <ol>
- <li>Simply double click on the solution file <tt>llvm/win32/llvm.sln</tt>.
- </li>
- </ol></li>
-
- <li>Build the LLVM Suite:
- <ol>
- <li>Simply build the solution.</li>
- <li>The Fibonacci project is a sample program that uses the JIT. Modify
- the project's debugging properties to provide a numeric command line
- argument. The program will print the corresponding fibonacci value.</li>
- </ol></li>
-
-</ol>
-
-<p>It is strongly encouraged that you get the latest version from Subversion as
-changes are continually making the VS support better.</p>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section">
- <a name="requirements"><b>Requirements</b></a>
-</div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
- <p>Before you begin to use the LLVM system, review the requirements given
- below. This may save you some trouble by knowing ahead of time what hardware
- and software you will need.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="hardware"><b>Hardware</b></a>
-</div>
-
-<div class="doc_text">
-
- <p>Any system that can adequately run Visual Studio .NET 2003 is fine. The
- LLVM source tree and object files, libraries and executables will consume
- approximately 3GB.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection"><a name="software"><b>Software</b></a></div>
-<div class="doc_text">
-
- <p>You will need Visual Studio .NET 2003. Earlier versions cannot open the
- solution/project files. The VS 2005 beta can, but will migrate these files
- to its own format in the process. While it should work with the VS 2005
- beta, there are no guarantees and there is no support for it at this time.
- It has been reported that VC++ Express also works.</p>
-
- <p>If you plan to modify any .y or .l files, you will need to have bison
- and/or flex installed where Visual Studio can find them. Otherwise, you do
- not need them and the pre-generated files that come with the source tree
- will be used.</p>
-
- <p>
- Do not install the LLVM directory tree into a path containing spaces (e.g.
- C:\Documents and Settings\...) as the configure step will fail.</p>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section">
- <a name="starting"><b>Getting Started with LLVM</b></a>
-</div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>The remainder of this guide is meant to get you up and running with
-LLVM using Visual Studio and to give you some basic information about the LLVM
-environment.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="terminology">Terminology and Notation</a>
-</div>
-
-<div class="doc_text">
-
-<p>Throughout this manual, the following names are used to denote paths
-specific to the local system and working environment. <i>These are not
-environment variables you need to set but just strings used in the rest
-of this document below</i>. In any of the examples below, simply replace
-each of these names with the appropriate pathname on your local system.
-All these paths are absolute:</p>
-
-<dl>
- <dt>SRC_ROOT</dt>
- <dd><p>This is the top level directory of the LLVM source tree.</p></dd>
-
- <dt>OBJ_ROOT</dt>
- <dd><p>This is the top level directory of the LLVM object tree (i.e. the
- tree where object files and compiled programs will be placed. It is
- fixed at SRC_ROOT/win32).</p></dd>
-</dl>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="objfiles">The Location of LLVM Object Files</a>
-</div>
-
-<div class="doc_text">
-
- <p>The object files are placed under <tt>OBJ_ROOT/Debug</tt> for debug builds
- and <tt>OBJ_ROOT/Release</tt> for release (optimized) builds. These include
- both executables and libararies that your application can link against.</p>
-
- <p>The files that <tt>configure</tt> would create when building on Unix are
- created by the <tt>Configure</tt> project and placed in
- <tt>OBJ_ROOT/llvm</tt>. You application must have OBJ_ROOT in its include
- search path just before <tt>SRC_ROOT/include</tt>.</p>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section">
- <a name="tutorial">An Example Using the LLVM Tool Chain</a>
-</div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<ol>
- <li><p>First, create a simple C file, name it 'hello.c':</p>
-
-<div class="doc_code">
-<pre>
-#include &lt;stdio.h&gt;
-int main() {
- printf("hello world\n");
- return 0;
-}
-</pre></div></li>
-
- <li><p>Next, compile the C file into a LLVM bitcode file:</p>
-
-<div class="doc_code">
-<pre>
-% llvm-gcc -c hello.c -emit-llvm -o hello.bc
-</pre>
-</div>
-
- <p>This will create the result file <tt>hello.bc</tt> which is the LLVM
- bitcode that corresponds the the compiled program and the library
- facilities that it required. You can execute this file directly using
- <tt>lli</tt> tool, compile it to native assembly with the <tt>llc</tt>,
- optimize or analyze it further with the <tt>opt</tt> tool, etc.</p>
-
- <p><b>Note: while you cannot do this step on Windows, you can do it on a
- Unix system and transfer <tt>hello.bc</tt> to Windows. Important:
- transfer as a binary file!</b></p></li>
-
- <li><p>Run the program using the just-in-time compiler:</p>
-
-<div class="doc_code">
-<pre>
-% lli hello.bc
-</pre>
-</div>
-
- <p>Note: this will only work for trivial C programs. Non-trivial programs
- (and any C++ program) will have dependencies on the GCC runtime that
- won't be satisfied by the Microsoft runtime libraries.</p></li>
-
- <li><p>Use the <tt>llvm-dis</tt> utility to take a look at the LLVM assembly
- code:</p>
-
-<div class="doc_code">
-<pre>
-% llvm-dis &lt; hello.bc | more
-</pre>
-</div></li>
-
- <li><p>Compile the program to C using the LLC code generator:</p>
-
-<div class="doc_code">
-<pre>
-% llc -march=c hello.bc
-</pre>
-</div></li>
-
- <li><p>Compile to binary using Microsoft C:</p>
-
-<div class="doc_code">
-<pre>
-% cl hello.cbe.c
-</pre>
-</div>
-
- <p>Note: this will only work for trivial C programs. Non-trivial programs
- (and any C++ program) will have dependencies on the GCC runtime that
- won't be satisfied by the Microsoft runtime libraries.</p></li>
-
- <li><p>Execute the native code program:</p>
-
-<div class="doc_code">
-<pre>
-% hello.cbe.exe
-</pre>
-</div></li>
-</ol>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section">
- <a name="problems">Common Problems</a>
-</div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>If you are having problems building or using LLVM, or if you have any other
-general questions about LLVM, please consult the <a href="FAQ.html">Frequently
-Asked Questions</a> page.</p>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section">
- <a name="links">Links</a>
-</div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>This document is just an <b>introduction</b> to how to use LLVM to do
-some simple things... there are many more interesting and complicated things
-that you can do that aren't documented here (but we'll gladly accept a patch
-if you want to write something up!). For more information about LLVM, check
-out:</p>
-
-<ul>
- <li><a href="http://llvm.org/">LLVM homepage</a></li>
- <li><a href="http://llvm.org/doxygen/">LLVM doxygen tree</a></li>
- <li><a href="http://llvm.org/docs/Projects.html">Starting a Project
- that Uses LLVM</a></li>
-</ul>
-
-</div>
-
-<!-- *********************************************************************** -->
-
-<hr>
-<address>
- <a href="http://jigsaw.w3.org/css-validator/check/referer"><img
- src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"></a>
- <a href="http://validator.w3.org/check/referer"><img
- src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!" /></a>
-
- <a href="mailto:jeffc@jolt-lang.org">Jeff Cohen</a><br>
- <a href="http://llvm.org">The LLVM Compiler Infrastructure</a><br>
- Last modified: $Date$
-</address>
-</body>
-</html>
diff --git a/release_23/docs/HistoricalNotes/2000-11-18-EarlyDesignIdeas.txt b/release_23/docs/HistoricalNotes/2000-11-18-EarlyDesignIdeas.txt
deleted file mode 100644
index f08618119201..000000000000
--- a/release_23/docs/HistoricalNotes/2000-11-18-EarlyDesignIdeas.txt
+++ /dev/null
@@ -1,74 +0,0 @@
-Date: Sat, 18 Nov 2000 09:19:35 -0600 (CST)
-From: Vikram Adve <vadve@cs.uiuc.edu>
-To: Chris Lattner <lattner@cs.uiuc.edu>
-Subject: a few thoughts
-
-I've been mulling over the virtual machine problem and I had some
-thoughts about some things for us to think about discuss:
-
-1. We need to be clear on our goals for the VM. Do we want to emphasize
- portability and safety like the Java VM? Or shall we focus on the
- architecture interface first (i.e., consider the code generation and
- processor issues), since the architecture interface question is also
- important for portable Java-type VMs?
-
- This is important because the audiences for these two goals are very
- different. Architects and many compiler people care much more about
- the second question. The Java compiler and OS community care much more
- about the first one.
-
- Also, while the architecture interface question is important for
- Java-type VMs, the design constraints are very different.
-
-
-2. Design issues to consider (an initial list that we should continue
- to modify). Note that I'm not trying to suggest actual solutions here,
- but just various directions we can pursue:
-
- a. A single-assignment VM, which we've both already been thinking about.
-
- b. A strongly-typed VM. One question is do we need the types to be
- explicitly declared or should they be inferred by the dynamic compiler?
-
- c. How do we get more high-level information into the VM while keeping
- to a low-level VM design?
-
- o Explicit array references as operands? An alternative is
- to have just an array type, and let the index computations be
- separate 3-operand instructions.
-
- o Explicit instructions to handle aliasing, e.g.s:
- -- an instruction to say "I speculate that these two values are not
- aliased, but check at runtime", like speculative execution in
- EPIC?
- -- or an instruction to check whether two values are aliased and
- execute different code depending on the answer, somewhat like
- predicated code in EPIC
-
- o (This one is a difficult but powerful idea.)
- A "thread-id" field on every instruction that allows the static
- compiler to generate a set of parallel threads, and then have
- the runtime compiler and hardware do what they please with it.
- This has very powerful uses, but thread-id on every instruction
- is expensive in terms of instruction size and code size.
- We would need to compactly encode it somehow.
-
- Also, this will require some reading on at least two other
- projects:
- -- Multiscalar architecture from Wisconsin
- -- Simultaneous multithreading architecture from Washington
-
- o Or forget all this and stick to a traditional instruction set?
-
-
-BTW, on an unrelated note, after the meeting yesterday, I did remember
-that you had suggested doing instruction scheduling on SSA form instead
-of a dependence DAG earlier in the semester. When we talked about
-it yesterday, I didn't remember where the idea had come from but I
-remembered later. Just giving credit where its due...
-
-Perhaps you can save the above as a file under RCS so you and I can
-continue to expand on this.
-
---Vikram
-
diff --git a/release_23/docs/HistoricalNotes/2000-11-18-EarlyDesignIdeasResp.txt b/release_23/docs/HistoricalNotes/2000-11-18-EarlyDesignIdeasResp.txt
deleted file mode 100644
index 1c725f5aa715..000000000000
--- a/release_23/docs/HistoricalNotes/2000-11-18-EarlyDesignIdeasResp.txt
+++ /dev/null
@@ -1,199 +0,0 @@
-Date: Sun, 19 Nov 2000 16:23:57 -0600 (CST)
-From: Chris Lattner <sabre@nondot.org>
-To: Vikram Adve <vadve@cs.uiuc.edu>
-Subject: Re: a few thoughts
-
-Okay... here are a few of my thoughts on this (it's good to know that we
-think so alike!):
-
-> 1. We need to be clear on our goals for the VM. Do we want to emphasize
-> portability and safety like the Java VM? Or shall we focus on the
-> architecture interface first (i.e., consider the code generation and
-> processor issues), since the architecture interface question is also
-> important for portable Java-type VMs?
-
-I forsee the architecture looking kinda like this: (which is completely
-subject to change)
-
-1. The VM code is NOT guaranteed safe in a java sense. Doing so makes it
- basically impossible to support C like languages. Besides that,
- certifying a register based language as safe at run time would be a
- pretty expensive operation to have to do. Additionally, we would like
- to be able to statically eliminate many bounds checks in Java
- programs... for example.
-
- 2. Instead, we can do the following (eventually):
- * Java bytecode is used as our "safe" representation (to avoid
- reinventing something that we don't add much value to). When the
- user chooses to execute Java bytecodes directly (ie, not
- precompiled) the runtime compiler can do some very simple
- transformations (JIT style) to convert it into valid input for our
- VM. Performance is not wonderful, but it works right.
- * The file is scheduled to be compiled (rigorously) at a later
- time. This could be done by some background process or by a second
- processor in the system during idle time or something...
- * To keep things "safe" ie to enforce a sandbox on Java/foreign code,
- we could sign the generated VM code with a host specific private
- key. Then before the code is executed/loaded, we can check to see if
- the trusted compiler generated the code. This would be much quicker
- than having to validate consistency (especially if bounds checks have
- been removed, for example)
-
-> This is important because the audiences for these two goals are very
-> different. Architects and many compiler people care much more about
-> the second question. The Java compiler and OS community care much more
-> about the first one.
-
-3. By focusing on a more low level virtual machine, we have much more room
- for value add. The nice safe "sandbox" VM can be provided as a layer
- on top of it. It also lets us focus on the more interesting compilers
- related projects.
-
-> 2. Design issues to consider (an initial list that we should continue
-> to modify). Note that I'm not trying to suggest actual solutions here,
-> but just various directions we can pursue:
-
-Understood. :)
-
-> a. A single-assignment VM, which we've both already been thinking
-> about.
-
-Yup, I think that this makes a lot of sense. I am still intrigued,
-however, by the prospect of a minimally allocated VM representation... I
-think that it could have definate advantages for certain applications
-(think very small machines, like PDAs). I don't, however, think that our
-initial implementations should focus on this. :)
-
-Here are some other auxilliary goals that I think we should consider:
-
-1. Primary goal: Support a high performance dynamic compilation
- system. This means that we have an "ideal" division of labor between
- the runtime and static compilers. Of course, the other goals of the
- system somewhat reduce the importance of this point (f.e. portability
- reduces performance, but hopefully not much)
-2. Portability to different processors. Since we are most familiar with
- x86 and solaris, I think that these two are excellent candidates when
- we get that far...
-3. Support for all languages & styles of programming (general purpose
- VM). This is the point that disallows java style bytecodes, where all
- array refs are checked for bounds, etc...
-4. Support linking between different language families. For example, call
- C functions directly from Java without using the nasty/slow/gross JNI
- layer. This involves several subpoints:
- A. Support for languages that require garbage collectors and integration
- with languages that don't. As a base point, we could insist on
- always using a conservative GC, but implement free as a noop, f.e.
-
-> b. A strongly-typed VM. One question is do we need the types to be
-> explicitly declared or should they be inferred by the dynamic
-> compiler?
-
- B. This is kind of similar to another idea that I have: make OOP
- constructs (virtual function tables, class heirarchies, etc) explicit
- in the VM representation. I believe that the number of additional
- constructs would be fairly low, but would give us lots of important
- information... something else that would/could be important is to
- have exceptions as first class types so that they would be handled in
- a uniform way for the entire VM... so that C functions can call Java
- functions for example...
-
-> c. How do we get more high-level information into the VM while keeping
-> to a low-level VM design?
-> o Explicit array references as operands? An alternative is
-> to have just an array type, and let the index computations be
-> separate 3-operand instructions.
-
- C. In the model I was thinking of (subject to change of course), we
- would just have an array type (distinct from the pointer
- types). This would allow us to have arbitrarily complex index
- expressions, while still distinguishing "load" from "Array load",
- for example. Perhaps also, switch jump tables would be first class
- types as well? This would allow better reasoning about the program.
-
-5. Support dynamic loading of code from various sources. Already
- mentioned above was the example of loading java bytecodes, but we want
- to support dynamic loading of VM code as well. This makes the job of
- the runtime compiler much more interesting: it can do interprocedural
- optimizations that the static compiler can't do, because it doesn't
- have all of the required information (for example, inlining from
- shared libraries, etc...)
-
-6. Define a set of generally useful annotations to add to the VM
- representation. For example, a function can be analysed to see if it
- has any sideeffects when run... also, the MOD/REF sets could be
- calculated, etc... we would have to determine what is reasonable. This
- would generally be used to make IP optimizations cheaper for the
- runtime compiler...
-
-> o Explicit instructions to handle aliasing, e.g.s:
-> -- an instruction to say "I speculate that these two values are not
-> aliased, but check at runtime", like speculative execution in
-> EPIC?
-> -- or an instruction to check whether two values are aliased and
-> execute different code depending on the answer, somewhat like
-> predicated code in EPIC
-
-These are also very good points... if this can be determined at compile
-time. I think that an epic style of representation (not the instruction
-packing, just the information presented) could be a very interesting model
-to use... more later...
-
-> o (This one is a difficult but powerful idea.)
-> A "thread-id" field on every instruction that allows the static
-> compiler to generate a set of parallel threads, and then have
-> the runtime compiler and hardware do what they please with it.
-> This has very powerful uses, but thread-id on every instruction
-> is expensive in terms of instruction size and code size.
-> We would need to compactly encode it somehow.
-
-Yes yes yes! :) I think it would be *VERY* useful to include this kind
-of information (which EPIC architectures *implicitly* encode. The trend
-that we are seeing supports this greatly:
-
-1. Commodity processors are getting massive SIMD support:
- * Intel/Amd MMX/MMX2
- * AMD's 3Dnow!
- * Intel's SSE/SSE2
- * Sun's VIS
-2. SMP is becoming much more common, especially in the server space.
-3. Multiple processors on a die are right around the corner.
-
-If nothing else, not designing this in would severely limit our future
-expansion of the project...
-
-> Also, this will require some reading on at least two other
-> projects:
-> -- Multiscalar architecture from Wisconsin
-> -- Simultaneous multithreading architecture from Washington
->
-> o Or forget all this and stick to a traditional instruction set?
-
-Heh... :) Well, from a pure research point of view, it is almost more
-attactive to go with the most extreme/different ISA possible. On one axis
-you get safety and conservatism, and on the other you get degree of
-influence that the results have. Of course the problem with pure research
-is that often times there is no concrete product of the research... :)
-
-> BTW, on an unrelated note, after the meeting yesterday, I did remember
-> that you had suggested doing instruction scheduling on SSA form instead
-> of a dependence DAG earlier in the semester. When we talked about
-> it yesterday, I didn't remember where the idea had come from but I
-> remembered later. Just giving credit where its due...
-
-:) Thanks.
-
-> Perhaps you can save the above as a file under RCS so you and I can
-> continue to expand on this.
-
-I think it makes sense to do so when we get our ideas more formalized and
-bounce it back and forth a couple of times... then I'll do a more formal
-writeup of our goals and ideas. Obviously our first implementation will
-not want to do all of the stuff that I pointed out above... be we will
-want to design the project so that we do not artificially limit ourselves
-at sometime in the future...
-
-Anyways, let me know what you think about these ideas... and if they sound
-reasonable...
-
--Chris
-
diff --git a/release_23/docs/HistoricalNotes/2000-12-06-EncodingIdea.txt b/release_23/docs/HistoricalNotes/2000-12-06-EncodingIdea.txt
deleted file mode 100644
index 8c452924dd1a..000000000000
--- a/release_23/docs/HistoricalNotes/2000-12-06-EncodingIdea.txt
+++ /dev/null
@@ -1,30 +0,0 @@
-From: Chris Lattner [mailto:sabre@nondot.org]
-Sent: Wednesday, December 06, 2000 6:41 PM
-To: Vikram S. Adve
-Subject: Additional idea with respect to encoding
-
-Here's another idea with respect to keeping the common case instruction
-size down (less than 32 bits ideally):
-
-Instead of encoding an instruction to operate on two register numbers,
-have it operate on two negative offsets based on the current register
-number. Therefore, instead of using:
-
-r57 = add r55, r56 (r57 is the implicit dest register, of course)
-
-We could use:
-
-r57 = add -2, -1
-
-My guess is that most SSA references are to recent values (especially if
-they correspond to expressions like (x+y*z+p*q/ ...), so the negative
-numbers would tend to stay small, even at the end of the procedure (where
-the implicit register destination number could be quite large). Of course
-the negative sign is reduntant, so you would be storing small integers
-almost all of the time, and 5-6 bits worth of register number would be
-plenty for most cases...
-
-What do you think?
-
--Chris
-
diff --git a/release_23/docs/HistoricalNotes/2000-12-06-MeetingSummary.txt b/release_23/docs/HistoricalNotes/2000-12-06-MeetingSummary.txt
deleted file mode 100644
index b66e18556f5e..000000000000
--- a/release_23/docs/HistoricalNotes/2000-12-06-MeetingSummary.txt
+++ /dev/null
@@ -1,83 +0,0 @@
-SUMMARY
--------
-
-We met to discuss the LLVM instruction format and bytecode representation:
-
-ISSUES RESOLVED
----------------
-
-1. We decided that we shall use a flat namespace to represent our
- variables in SSA form, as opposed to having a two dimensional namespace
- of the original variable and the SSA instance subscript.
-
-ARGUMENT AGAINST:
- * A two dimensional namespace would be valuable when doing alias
- analysis because the extra information can help limit the scope of
- analysis.
-
-ARGUMENT FOR:
- * Including this information would require that all users of the LLVM
- bytecode would have to parse and handle it. This would slow down the
- common case and inflate the instruction representation with another
- infinite variable space.
-
-REASONING:
- * It was decided that because original variable sources could be
- reconstructed from SSA form in linear time, that it would be an
- unjustified expense for the common case to include the extra
- information for one optimization. Alias analysis itself is typically
- greater than linear in asymptotic complexity, so this extra analaysis
- would not affect the runtime of the optimization in a significant
- way. Additionally, this would be an unlikely optimization to do at
- runtime.
-
-
-IDEAS TO CONSIDER
------------------
-
-1. Including dominator information in the LLVM bytecode
- representation. This is one example of an analysis result that may be
- packaged with the bytecodes themselves. As a conceptual implementation
- idea, we could include an immediate dominator number for each basic block
- in the LLVM bytecode program. Basic blocks could be numbered according
- to the order of occurance in the bytecode representation.
-
-2. Including loop header and body information. This would facilitate
- detection of intervals and natural loops.
-
-UNRESOLVED ISSUES
------------------
-
-1. Will oSUIF provide enough of an infrastructure to support the research
- that we will be doing? We know that it has less than stellar
- performance, but hope that this will be of little importance for our
- static compiler. This could affect us if we decided to do some IP
- research. Also we do not yet understand the level of exception support
- currently implemented.
-
-2. Should we consider the requirements of a direct hardware implementation
- of the LLVM when we design it? If so, several design issues should
- have their priorities shifted. The other option is to focus on a
- software layer interpreting the LLVM in all cases.
-
-3. Should we use some form of packetized format to improve forward
- compatibility? For example, we could design the system to encode a
- packet type and length field before analysis information, to allow a
- runtime to skip information that it didn't understand in a bytecode
- stream. The obvious benefit would be for compatibility, the drawback
- is that it would tend to splinter that 'standard' LLVM definition.
-
-4. Should we use fixed length instructions or variable length
- instructions? Fetching variable length instructions is expensive (for
- either hardware or software based LLVM runtimes), but we have several
- 'infinite' spaces that instructions operate in (SSA register numbers,
- type spaces, or packet length [if packets were implemented]). Several
- options were mentioned including:
- A. Using 16 or 32 bit numbers, which would be 'big enough'
- B. A scheme similar to how UTF-8 works, to encode infinite numbers
- while keeping small number small.
- C. Use something similar to Huffman encoding, so that the most common
- numbers are the smallest.
-
--Chris
-
diff --git a/release_23/docs/HistoricalNotes/2001-01-31-UniversalIRIdea.txt b/release_23/docs/HistoricalNotes/2001-01-31-UniversalIRIdea.txt
deleted file mode 100644
index 111706a34477..000000000000
--- a/release_23/docs/HistoricalNotes/2001-01-31-UniversalIRIdea.txt
+++ /dev/null
@@ -1,39 +0,0 @@
-Date: Wed, 31 Jan 2001 12:04:33 -0600
-From: Vikram S. Adve <vadve@cs.uiuc.edu>
-To: Chris Lattner <lattner@cs.uiuc.edu>
-Subject: another thought
-
-I have a budding idea about making LLVM a little more ambitious: a
-customizable runtime system that can be used to implement language-specific
-virtual machines for many different languages. E.g., a C vm, a C++ vm, a
-Java vm, a Lisp vm, ..
-
-The idea would be that LLVM would provide a standard set of runtime features
-(some low-level like standard assembly instructions with code generation and
-static and runtime optimization; some higher-level like type-safety and
-perhaps a garbage collection library). Each language vm would select the
-runtime features needed for that language, extending or customizing them as
-needed. Most of the machine-dependent code-generation and optimization
-features as well as low-level machine-independent optimizations (like PRE)
-could be provided by LLVM and should be sufficient for any language,
-simplifying the language compiler. (This would also help interoperability
-between languages.) Also, some or most of the higher-level
-machine-independent features like type-safety and access safety should be
-reusable by different languages, with minor extensions. The language
-compiler could then focus on language-specific analyses and optimizations.
-
-The risk is that this sounds like a universal IR -- something that the
-compiler community has tried and failed to develop for decades, and is
-universally skeptical about. No matter what we say, we won't be able to
-convince anyone that we have a universal IR that will work. We need to
-think about whether LLVM is different or if has something novel that might
-convince people. E.g., the idea of providing a package of separable
-features that different languages select from. Also, using SSA with or
-without type-safety as the intermediate representation.
-
-One interesting starting point would be to discuss how a JVM would be
-implemented on top of LLVM a bit more. That might give us clues on how to
-structure LLVM to support one or more language VMs.
-
---Vikram
-
diff --git a/release_23/docs/HistoricalNotes/2001-02-06-TypeNotationDebate.txt b/release_23/docs/HistoricalNotes/2001-02-06-TypeNotationDebate.txt
deleted file mode 100644
index c09cf1f03cc7..000000000000
--- a/release_23/docs/HistoricalNotes/2001-02-06-TypeNotationDebate.txt
+++ /dev/null
@@ -1,67 +0,0 @@
-Date: Tue, 6 Feb 2001 20:27:37 -0600 (CST)
-From: Chris Lattner <sabre@nondot.org>
-To: Vikram S. Adve <vadve@cs.uiuc.edu>
-Subject: Type notation debate...
-
-This is the way that I am currently planning on implementing types:
-
-Primitive Types:
-type ::= void|bool|sbyte|ubyte|short|ushort|int|uint|long|ulong
-
-Method:
-typelist ::= typelisth | /*empty*/
-typelisth ::= type | typelisth ',' type
-type ::= type (typelist)
-
-Arrays (without and with size):
-type ::= '[' type ']' | '[' INT ',' type ']'
-
-Pointer:
-type ::= type '*'
-
-Structure:
-type ::= '{' typelist '}'
-
-Packed:
-type ::= '<' INT ',' type '>'
-
-Simple examples:
-
-[[ %4, int ]] - array of (array of 4 (int))
-[ { int, int } ] - Array of structure
-[ < %4, int > ] - Array of 128 bit SIMD packets
-int (int, [[int, %4]]) - Method taking a 2d array and int, returning int
-
-
-Okay before you comment, please look at:
-
-http://www.research.att.com/~bs/devXinterview.html
-
-Search for "In another interview, you defined the C declarator syntax as
-an experiment that failed. However, this syntactic construct has been
-around for 27 years and perhaps more; why do you consider it problematic
-(except for its cumbersome syntax)?" and read that response for me. :)
-
-Now with this syntax, his example would be represented as:
-
-[ %10, bool (int, int) * ] *
-
-vs
-
-bool (*(*)[10])(int, int)
-
-in C.
-
-Basically, my argument for this type construction system is that it is
-VERY simple to use and understand (although it IS different than C, it is
-very simple and straightforward, which C is NOT). In fact, I would assert
-that most programmers TODAY do not understand pointers to member
-functions, and have to look up an example when they have to write them.
-
-In my opinion, it is critically important to have clear and concise type
-specifications, because types are going to be all over the programs.
-
-Let me know your thoughts on this. :)
-
--Chris
-
diff --git a/release_23/docs/HistoricalNotes/2001-02-06-TypeNotationDebateResp1.txt b/release_23/docs/HistoricalNotes/2001-02-06-TypeNotationDebateResp1.txt
deleted file mode 100644
index 8bfefbf69f6c..000000000000
--- a/release_23/docs/HistoricalNotes/2001-02-06-TypeNotationDebateResp1.txt
+++ /dev/null
@@ -1,75 +0,0 @@
-Date: Thu, 8 Feb 2001 08:42:04 -0600
-From: Vikram S. Adve <vadve@cs.uiuc.edu>
-To: Chris Lattner <sabre@nondot.org>
-Subject: RE: Type notation debate...
-
-Chris,
-
-> Okay before you comment, please look at:
->
-> http://www.research.att.com/~bs/devXinterview.html
-
-I read this argument. Even before that, I was already in agreement with you
-and him that the C declarator syntax is difficult and confusing.
-
-But in fact, if you read the entire answer carefully, he came to the same
-conclusion I do: that you have to go with familiar syntax over logical
-syntax because familiarity is such a strong force:
-
- "However, familiarity is a strong force. To compare, in English, we
-live
-more or less happily with the absurd rules for "to be" (am, are, is, been,
-was, were, ...) and all attempts to simplify are treated with contempt or
-(preferably) humor. It be a curious world and it always beed."
-
-> Basically, my argument for this type construction system is that it is
-> VERY simple to use and understand (although it IS different than C, it is
-> very simple and straightforward, which C is NOT). In fact, I would assert
-> that most programmers TODAY do not understand pointers to member
-> functions, and have to look up an example when they have to write them.
-
-Again, I don't disagree with this at all. But to some extent this
-particular problem is inherently difficult. Your syntax for the above
-example may be easier for you to read because this is the way you have been
-thinking about it. Honestly, I don't find it much easier than the C syntax.
-In either case, I would have to look up an example to write pointers to
-member functions.
-
-But pointers to member functions are nowhere near as common as arrays. And
-the old array syntax:
- type [ int, int, ...]
-is just much more familiar and clear to people than anything new you
-introduce, no matter how logical it is. Introducing a new syntax that may
-make function pointers easier but makes arrays much more difficult seems
-very risky to me.
-
-> In my opinion, it is critically important to have clear and concise type
-> specifications, because types are going to be all over the programs.
-
-I absolutely agree. But the question is, what is more clear and concise?
-The syntax programmers are used to out of years of experience or a new
-syntax that they have never seen that has a more logical structure. I think
-the answer is the former. Sometimes, you have to give up a better idea
-because you can't overcome sociological barriers to it. Qwerty keyboards
-and Windows are two classic examples of bad technology that are difficult to
-root out.
-
-P.S. Also, while I agree that most your syntax is more logical, there is
-one part that isn't:
-
-Arrays (without and with size):
-type ::= '[' type ']' | '[' INT ',' type ']'.
-
-The arrays with size lists the dimensions and the type in a single list.
-That is just too confusing:
- [10, 40, int]
-This seems to be a 3-D array where the third dimension is something strange.
-It is too confusing to have a list of 3 things, some of which are dimensions
-and one is a type. Either of the following would be better:
-
- array [10, 40] of int
-or
- int [10, 40]
-
---Vikram
-
diff --git a/release_23/docs/HistoricalNotes/2001-02-06-TypeNotationDebateResp2.txt b/release_23/docs/HistoricalNotes/2001-02-06-TypeNotationDebateResp2.txt
deleted file mode 100644
index 6e9784158a35..000000000000
--- a/release_23/docs/HistoricalNotes/2001-02-06-TypeNotationDebateResp2.txt
+++ /dev/null
@@ -1,53 +0,0 @@
-Date: Thu, 8 Feb 2001 14:31:05 -0600 (CST)
-From: Chris Lattner <sabre@nondot.org>
-To: Vikram S. Adve <vadve@cs.uiuc.edu>
-Subject: RE: Type notation debate...
-
-> Arrays (without and with size):
-> type ::= '[' type ']' | '[' INT ',' type ']'.
->
-> The arrays with size lists the dimensions and the type in a single list.
-> That is just too confusing:
-
-> [10, 40, int]
-> This seems to be a 3-D array where the third dimension is something strange.
-> It is too confusing to have a list of 3 things, some of which are dimensions
-> and one is a type.
-
-The above grammar indicates that there is only one integer parameter, ie
-the upper bound. The lower bound is always implied to be zero, for
-several reasons:
-
-* As a low level VM, we want to expose addressing computations
- explicitly. Since the lower bound must always be known in a high level
- language statically, the language front end can do the translation
- automatically.
-* This fits more closely with what Java needs, ie what we need in the
- short term. Java arrays are always zero based.
-
-If a two element list is too confusing, I would recommend an alternate
-syntax of:
-
-type ::= '[' type ']' | '[' INT 'x' type ']'.
-
-For example:
- [12 x int]
- [12x int]
- [ 12 x [ 4x int ]]
-
-Which is syntactically nicer, and more explicit.
-
-> Either of the following would be better:
-> array [10, 40] of int
-
-I considered this approach for arrays in general (ie array of int/ array
-of 12 int), but found that it made declarations WAY too long. Remember
-that because of the nature of llvm, you get a lot of types strewn all over
-the program, and using the 'typedef' like facility is not a wonderful
-option, because then types aren't explicit anymore.
-
-I find this email interesting, because you contradict the previous email
-you sent, where you recommend that we stick to C syntax....
-
--Chris
-
diff --git a/release_23/docs/HistoricalNotes/2001-02-06-TypeNotationDebateResp4.txt b/release_23/docs/HistoricalNotes/2001-02-06-TypeNotationDebateResp4.txt
deleted file mode 100644
index 7b9032742a27..000000000000
--- a/release_23/docs/HistoricalNotes/2001-02-06-TypeNotationDebateResp4.txt
+++ /dev/null
@@ -1,89 +0,0 @@
-> But in fact, if you read the entire answer carefully, he came to the same
-> conclusion I do: that you have to go with familiar syntax over logical
-> syntax because familiarity is such a strong force:
-> "However, familiarity is a strong force. To compare, in English, we
-live
-> more or less happily with the absurd rules for "to be" (am, are, is, been,
-> was, were, ...) and all attempts to simplify are treated with contempt or
-> (preferably) humor. It be a curious world and it always beed."
-
-Although you have to remember that his situation was considerably
-different than ours. He was in a position where he was designing a high
-level language that had to be COMPATIBLE with C. Our language is such
-that a new person would have to learn the new, different, syntax
-anyways. Making them learn about the type system does not seem like much
-of a stretch from learning the opcodes and how SSA form works, and how
-everything ties together...
-
-> > Basically, my argument for this type construction system is that it is
-> > VERY simple to use and understand (although it IS different than C, it is
-> > very simple and straightforward, which C is NOT). In fact, I would assert
-> > that most programmers TODAY do not understand pointers to member
-> > functions, and have to look up an example when they have to write them.
-
-> Again, I don't disagree with this at all. But to some extent this
-> particular problem is inherently difficult. Your syntax for the above
-> example may be easier for you to read because this is the way you have been
-> thinking about it. Honestly, I don't find it much easier than the C syntax.
-> In either case, I would have to look up an example to write pointers to
-> member functions.
-
-I would argue that because the lexical structure of the language is self
-consistent, any person who spent a significant amount of time programming
-in LLVM directly would understand how to do it without looking it up in a
-manual. The reason this does not work for C is because you rarely have to
-declare these pointers, and the syntax is inconsistent with the method
-declaration and calling syntax.
-
-> But pointers to member functions are nowhere near as common as arrays.
-
-Very true. If you're implementing an object oriented language, however,
-remember that you have to do all the pointer to member function stuff
-yourself.... so everytime you invoke a virtual method one is involved
-(instead of having C++ hide it for you behind "syntactic sugar").
-
-> And the old array syntax:
-> type [ int, int, ...]
-> is just much more familiar and clear to people than anything new you
-> introduce, no matter how logical it is.
-
-Erm... excuse me but how is this the "old array syntax"? If you are
-arguing for consistency with C, you should be asking for 'type int []',
-which is significantly different than the above (beside the above
-introduces a new operator and duplicates information
-needlessly). Basically what I am suggesting is exactly the above without
-the fluff. So instead of:
-
- type [ int, int, ...]
-
-you use:
-
- type [ int ]
-
-> Introducing a new syntax that may
-> make function pointers easier but makes arrays much more difficult seems
-> very risky to me.
-
-This is not about function pointers. This is about consistency in the
-type system, and consistency with the rest of the language. The point
-above does not make arrays any more difficult to use, and makes the
-structure of types much more obvious than the "c way".
-
-> > In my opinion, it is critically important to have clear and concise type
-> > specifications, because types are going to be all over the programs.
->
-> I absolutely agree. But the question is, what is more clear and concise?
-> The syntax programmers are used to out of years of experience or a new
-> syntax that they have never seen that has a more logical structure. I think
-> the answer is the former. Sometimes, you have to give up a better idea
-> because you can't overcome sociological barriers to it. Qwerty keyboards
-> and Windows are two classic examples of bad technology that are difficult to
-> root out.
-
-Very true, but you seem to be advocating a completely different Type
-system than C has, in addition to it not offering the advantages of clear
-structure that the system I recommended does... so you seem to not have a
-problem with changing this, just with what I change it to. :)
-
--Chris
-
diff --git a/release_23/docs/HistoricalNotes/2001-02-09-AdveComments.txt b/release_23/docs/HistoricalNotes/2001-02-09-AdveComments.txt
deleted file mode 100644
index 5503233c1ede..000000000000
--- a/release_23/docs/HistoricalNotes/2001-02-09-AdveComments.txt
+++ /dev/null
@@ -1,120 +0,0 @@
-Ok, here are my comments and suggestions about the LLVM instruction set.
-We should discuss some now, but can discuss many of them later, when we
-revisit synchronization, type inference, and other issues.
-(We have discussed some of the comments already.)
-
-
-o We should consider eliminating the type annotation in cases where it is
- essentially obvious from the instruction type, e.g., in br, it is obvious
- that the first arg. should be a bool and the other args should be labels:
-
- br bool <cond>, label <iftrue>, label <iffalse>
-
- I think your point was that making all types explicit improves clarity
- and readability. I agree to some extent, but it also comes at the cost
- of verbosity. And when the types are obvious from people's experience
- (e.g., in the br instruction), it doesn't seem to help as much.
-
-
-o On reflection, I really like your idea of having the two different switch
- types (even though they encode implementation techniques rather than
- semantics). It should simplify building the CFG and my guess is it could
- enable some significant optimizations, though we should think about which.
-
-
-o In the lookup-indirect form of the switch, is there a reason not to make
- the val-type uint? Most HLL switch statements (including Java and C++)
- require that anyway. And it would also make the val-type uniform
- in the two forms of the switch.
-
- I did see the switch-on-bool examples and, while cute, we can just use
- the branch instructions in that particular case.
-
-
-o I agree with your comment that we don't need 'neg'.
-
-
-o There's a trade-off with the cast instruction:
- + it avoids having to define all the upcasts and downcasts that are
- valid for the operands of each instruction (you probably have thought
- of other benefits also)
- - it could make the bytecode significantly larger because there could
- be a lot of cast operations
-
-
-o Making the second arg. to 'shl' a ubyte seems good enough to me.
- 255 positions seems adequate for several generations of machines
- and is more compact than uint.
-
-
-o I still have some major concerns about including malloc and free in the
- language (either as builtin functions or instructions). LLVM must be
- able to represent code from many different languages. Languages such as
- C, C++ Java and Fortran 90 would not be able to use our malloc anyway
- because each of them will want to provide a library implementation of it.
-
- This gets even worse when code from different languages is linked
- into a single executable (which is fairly common in large apps).
- Having a single malloc would just not suffice, and instead would simply
- complicate the picture further because it adds an extra variant in
- addition to the one each language provides.
-
- Instead, providing a default library version of malloc and free
- (and perhaps a malloc_gc with garbage collection instead of free)
- would make a good implementation available to anyone who wants it.
-
- I don't recall all your arguments in favor so let's discuss this again,
- and soon.
-
-
-o 'alloca' on the other hand sounds like a good idea, and the
- implementation seems fairly language-independent so it doesn't have the
- problems with malloc listed above.
-
-
-o About indirect call:
- Your option #2 sounded good to me. I'm not sure I understand your
- concern about an explicit 'icall' instruction?
-
-
-o A pair of important synchronization instr'ns to think about:
- load-linked
- store-conditional
-
-
-o Other classes of instructions that are valuable for pipeline performance:
- conditional-move
- predicated instructions
-
-
-o I believe tail calls are relatively easy to identify; do you know why
- .NET has a tailcall instruction?
-
-
-o I agree that we need a static data space. Otherwise, emulating global
- data gets unnecessarily complex.
-
-
-o About explicit parallelism:
-
- We once talked about adding a symbolic thread-id field to each
- instruction. (It could be optional so single-threaded codes are
- not penalized.) This could map well to multi-threaded architectures
- while providing easy ILP for single-threaded onces. But it is probably
- too radical an idea to include in a base version of LLVM. Instead, it
- could a great topic for a separate study.
-
- What is the semantics of the IA64 stop bit?
-
-
-
-
-o And finally, another thought about the syntax for arrays :-)
-
- Although this syntax:
- array <dimension-list> of <type>
- is verbose, it will be used only in the human-readable assembly code so
- size should not matter. I think we should consider it because I find it
- to be the clearest syntax. It could even make arrays of function
- pointers somewhat readable.
-
diff --git a/release_23/docs/HistoricalNotes/2001-02-09-AdveCommentsResponse.txt b/release_23/docs/HistoricalNotes/2001-02-09-AdveCommentsResponse.txt
deleted file mode 100644
index 5c87330fb7ea..000000000000
--- a/release_23/docs/HistoricalNotes/2001-02-09-AdveCommentsResponse.txt
+++ /dev/null
@@ -1,245 +0,0 @@
-From: Chris Lattner <sabre@nondot.org>
-To: "Vikram S. Adve" <vadve@cs.uiuc.edu>
-Subject: Re: LLVM Feedback
-
-I've included your feedback in the /home/vadve/lattner/llvm/docs directory
-so that it will live in CVS eventually with the rest of LLVM. I've
-significantly updated the documentation to reflect the changes you
-suggested, as specified below:
-
-> We should consider eliminating the type annotation in cases where it is
-> essentially obvious from the instruction type:
-> br bool <cond>, label <iftrue>, label <iffalse>
-> I think your point was that making all types explicit improves clarity
-> and readability. I agree to some extent, but it also comes at the
-> cost of verbosity. And when the types are obvious from people's
-> experience (e.g., in the br instruction), it doesn't seem to help as
-> much.
-
-Very true. We should discuss this more, but my reasoning is more of a
-consistency argument. There are VERY few instructions that can have all
-of the types eliminated, and doing so when available unnecesarily makes
-the language more difficult to handle. Especially when you see 'int
-%this' and 'bool %that' all over the place, I think it would be
-disorienting to see:
-
- br %predicate, %iftrue, %iffalse
-
-for branches. Even just typing that once gives me the creeps. ;) Like I
-said, we should probably discuss this further in person...
-
-> On reflection, I really like your idea of having the two different
-> switch types (even though they encode implementation techniques rather
-> than semantics). It should simplify building the CFG and my guess is it
-> could enable some significant optimizations, though we should think
-> about which.
-
-Great. I added a note to the switch section commenting on how the VM
-should just use the instruction type as a hint, and that the
-implementation may choose altermate representations (such as predicated
-branches).
-
-> In the lookup-indirect form of the switch, is there a reason not to
-> make the val-type uint?
-
-No. This was something I was debating for a while, and didn't really feel
-strongly about either way. It is common to switch on other types in HLL's
-(for example signed int's are particually common), but in this case, all
-that will be added is an additional 'cast' instruction. I removed that
-from the spec.
-
-> I agree with your comment that we don't need 'neg'
-
-Removed.
-
-> There's a trade-off with the cast instruction:
-> + it avoids having to define all the upcasts and downcasts that are
-> valid for the operands of each instruction (you probably have
-> thought of other benefits also)
-> - it could make the bytecode significantly larger because there could
-> be a lot of cast operations
-
- + You NEED casts to represent things like:
- void foo(float);
- ...
- int x;
- ...
- foo(x);
- in a language like C. Even in a Java like language, you need upcasts
- and some way to implement dynamic downcasts.
- + Not all forms of instructions take every type (for example you can't
- shift by a floating point number of bits), thus SOME programs will need
- implicit casts.
-
-To be efficient and to avoid your '-' point above, we just have to be
-careful to specify that the instructions shall operate on all common
-types, therefore casting should be relatively uncommon. For example all
-of the arithmetic operations work on almost all data types.
-
-> Making the second arg. to 'shl' a ubyte seems good enough to me.
-> 255 positions seems adequate for several generations of machines
-
-Okay, that comment is removed.
-
-> and is more compact than uint.
-
-No, it isn't. Remember that the bytecode encoding saves value slots into
-the bytecode instructions themselves, not constant values. This is
-another case where we may introduce more cast instructions (but we will
-also reduce the number of opcode variants that must be supported by a
-virtual machine). Because most shifts are by constant values, I don't
-think that we'll have to cast many shifts. :)
-
-> I still have some major concerns about including malloc and free in the
-> language (either as builtin functions or instructions).
-
-Agreed. How about this proposal:
-
-malloc/free are either built in functions or actual opcodes. They provide
-all of the type safety that the document would indicate, blah blah
-blah. :)
-
-Now, because of all of the excellent points that you raised, an
-implementation may want to override the default malloc/free behavior of
-the program. To do this, they simply implement a "malloc" and
-"free" function. The virtual machine will then be defined to use the user
-defined malloc/free function (which return/take void*'s, not type'd
-pointers like the builtin function would) if one is available, otherwise
-fall back on a system malloc/free.
-
-Does this sound like a good compromise? It would give us all of the
-typesafety/elegance in the language while still allowing the user to do
-all the cool stuff they want to...
-
-> 'alloca' on the other hand sounds like a good idea, and the
-> implementation seems fairly language-independent so it doesn't have the
-> problems with malloc listed above.
-
-Okay, once we get the above stuff figured out, I'll put it all in the
-spec.
-
-> About indirect call:
-> Your option #2 sounded good to me. I'm not sure I understand your
-> concern about an explicit 'icall' instruction?
-
-I worry too much. :) The other alternative has been removed. 'icall' is
-now up in the instruction list next to 'call'.
-
-> I believe tail calls are relatively easy to identify; do you know why
-> .NET has a tailcall instruction?
-
-Although I am just guessing, I believe it probably has to do with the fact
-that they want languages like Haskell and lisp to be efficiently runnable
-on their VM. Of course this means that the VM MUST implement tail calls
-'correctly', or else life will suck. :) I would put this into a future
-feature bin, because it could be pretty handy...
-
-> A pair of important synchronization instr'ns to think about:
-> load-linked
-> store-conditional
-
-What is 'load-linked'? I think that (at least for now) I should add these
-to the 'possible extensions' section, because they are not immediately
-needed...
-
-> Other classes of instructions that are valuable for pipeline
-> performance:
-> conditional-move
-> predicated instructions
-
-Conditional move is effectly a special case of a predicated
-instruction... and I think that all predicated instructions can possibly
-be implemented later in LLVM. It would significantly change things, and
-it doesn't seem to be very necessary right now. It would seem to
-complicate flow control analysis a LOT in the virtual machine. I would
-tend to prefer that a predicated architecture like IA64 convert from a
-"basic block" representation to a predicated rep as part of it's dynamic
-complication phase. Also, if a basic block contains ONLY a move, then
-that can be trivally translated into a conditional move...
-
-> I agree that we need a static data space. Otherwise, emulating global
-> data gets unnecessarily complex.
-
-Definately. Also a later item though. :)
-
-> We once talked about adding a symbolic thread-id field to each
-> ..
-> Instead, it could a great topic for a separate study.
-
-Agreed. :)
-
-> What is the semantics of the IA64 stop bit?
-
-Basically, the IA64 writes instructions like this:
-mov ...
-add ...
-sub ...
-op xxx
-op xxx
-;;
-mov ...
-add ...
-sub ...
-op xxx
-op xxx
-;;
-
-Where the ;; delimits a group of instruction with no dependencies between
-them, which can all be executed concurrently (to the limits of the
-available functional units). The ;; gets translated into a bit set in one
-of the opcodes.
-
-The advantages of this representation is that you don't have to do some
-kind of 'thread id scheduling' pass by having to specify ahead of time how
-many threads to use, and the representation doesn't have a per instruction
-overhead...
-
-> And finally, another thought about the syntax for arrays :-)
-> Although this syntax:
-> array <dimension-list> of <type>
-> is verbose, it will be used only in the human-readable assembly code so
-> size should not matter. I think we should consider it because I find it
-> to be the clearest syntax. It could even make arrays of function
-> pointers somewhat readable.
-
-My only comment will be to give you an example of why this is a bad
-idea. :)
-
-Here is an example of using the switch statement (with my recommended
-syntax):
-
-switch uint %val, label %otherwise,
- [%3 x {uint, label}] [ { uint %57, label %l1 },
- { uint %20, label %l2 },
- { uint %14, label %l3 } ]
-
-Here it is with the syntax you are proposing:
-
-switch uint %val, label %otherwise,
- array %3 of {uint, label}
- array of {uint, label}
- { uint %57, label %l1 },
- { uint %20, label %l2 },
- { uint %14, label %l3 }
-
-Which is ambiguous and very verbose. It would be possible to specify
-constants with [] brackets as in my syntax, which would look like this:
-
-switch uint %val, label %otherwise,
- array %3 of {uint, label} [ { uint %57, label %l1 },
- { uint %20, label %l2 },
- { uint %14, label %l3 } ]
-
-But then the syntax is inconsistent between type definition and constant
-definition (why do []'s enclose the constants but not the types??).
-
-Anyways, I'm sure that there is much debate still to be had over
-this... :)
-
--Chris
-
-http://www.nondot.org/~sabre/os/
-http://www.nondot.org/MagicStats/
-http://korbit.sourceforge.net/
-
-
diff --git a/release_23/docs/HistoricalNotes/2001-02-13-Reference-Memory.txt b/release_23/docs/HistoricalNotes/2001-02-13-Reference-Memory.txt
deleted file mode 100644
index 2c7534d9da19..000000000000
--- a/release_23/docs/HistoricalNotes/2001-02-13-Reference-Memory.txt
+++ /dev/null
@@ -1,39 +0,0 @@
-Date: Tue, 13 Feb 2001 13:29:52 -0600 (CST)
-From: Chris Lattner <sabre@nondot.org>
-To: Vikram S. Adve <vadve@cs.uiuc.edu>
-Subject: LLVM Concerns...
-
-
-I've updated the documentation to include load store and allocation
-instructions (please take a look and let me know if I'm on the right
-track):
-
-file:/home/vadve/lattner/llvm/docs/LangRef.html#memoryops
-
-I have a couple of concerns I would like to bring up:
-
-1. Reference types
- Right now, I've spec'd out the language to have a pointer type, which
- works fine for lots of stuff... except that Java really has
- references: constrained pointers that cannot be manipulated: added and
- subtracted, moved, etc... Do we want to have a type like this? It
- could be very nice for analysis (pointer always points to the start of
- an object, etc...) and more closely matches Java semantics. The
- pointer type would be kept for C++ like semantics. Through analysis,
- C++ pointers could be promoted to references in the LLVM
- representation.
-
-2. Our "implicit" memory references in assembly language:
- After thinking about it, this model has two problems:
- A. If you do pointer analysis and realize that two stores are
- independent and can share the same memory source object, there is
- no way to represent this in either the bytecode or assembly.
- B. When parsing assembly/bytecode, we effectively have to do a full
- SSA generation/PHI node insertion pass to build the dependencies
- when we don't want the "pinned" representation. This is not
- cool.
- I'm tempted to make memory references explicit in both the assembly and
- bytecode to get around this... what do you think?
-
--Chris
-
diff --git a/release_23/docs/HistoricalNotes/2001-02-13-Reference-MemoryResponse.txt b/release_23/docs/HistoricalNotes/2001-02-13-Reference-MemoryResponse.txt
deleted file mode 100644
index 505343378dfe..000000000000
--- a/release_23/docs/HistoricalNotes/2001-02-13-Reference-MemoryResponse.txt
+++ /dev/null
@@ -1,47 +0,0 @@
-Date: Tue, 13 Feb 2001 18:25:42 -0600
-From: Vikram S. Adve <vadve@cs.uiuc.edu>
-To: Chris Lattner <sabre@nondot.org>
-Subject: RE: LLVM Concerns...
-
-> 1. Reference types
-> Right now, I've spec'd out the language to have a pointer type, which
-> works fine for lots of stuff... except that Java really has
-> references: constrained pointers that cannot be manipulated: added and
-> subtracted, moved, etc... Do we want to have a type like this? It
-> could be very nice for analysis (pointer always points to the start of
-> an object, etc...) and more closely matches Java semantics. The
-> pointer type would be kept for C++ like semantics. Through analysis,
-> C++ pointers could be promoted to references in the LLVM
-> representation.
-
-
-You're right, having references would be useful. Even for C++ the *static*
-compiler could generate references instead of pointers with fairly
-straightforward analysis. Let's include a reference type for now. But I'm
-also really concerned that LLVM is becoming big and complex and (perhaps)
-too high-level. After we get some initial performance results, we may have
-a clearer idea of what our goals should be and we should revisit this
-question then.
-
-> 2. Our "implicit" memory references in assembly language:
-> After thinking about it, this model has two problems:
-> A. If you do pointer analysis and realize that two stores are
-> independent and can share the same memory source object,
-
-not sure what you meant by "share the same memory source object"
-
-> there is
-> no way to represent this in either the bytecode or assembly.
-> B. When parsing assembly/bytecode, we effectively have to do a full
-> SSA generation/PHI node insertion pass to build the dependencies
-> when we don't want the "pinned" representation. This is not
-> cool.
-
-I understand the concern. But again, let's focus on the performance first
-and then look at the language design issues. E.g., it would be good to know
-how big the bytecode files are before expanding them further. I am pretty
-keen to explore the implications of LLVM for mobile devices. Both bytecode
-size and power consumption are important to consider there.
-
---Vikram
-
diff --git a/release_23/docs/HistoricalNotes/2001-04-16-DynamicCompilation.txt b/release_23/docs/HistoricalNotes/2001-04-16-DynamicCompilation.txt
deleted file mode 100644
index 5f7843ab563e..000000000000
--- a/release_23/docs/HistoricalNotes/2001-04-16-DynamicCompilation.txt
+++ /dev/null
@@ -1,49 +0,0 @@
-By Chris:
-
-LLVM has been designed with two primary goals in mind. First we strive to
-enable the best possible division of labor between static and dynamic
-compilers, and second, we need a flexible and powerful interface
-between these two complementary stages of compilation. We feel that
-providing a solution to these two goals will yield an excellent solution
-to the performance problem faced by modern architectures and programming
-languages.
-
-A key insight into current compiler and runtime systems is that a
-compiler may fall in anywhere in a "continuum of compilation" to do its
-job. On one side, scripting languages statically compile nothing and
-dynamically compile (or equivalently, interpret) everything. On the far
-other side, traditional static compilers process everything statically and
-nothing dynamically. These approaches have typically been seen as a
-tradeoff between performance and portability. On a deeper level, however,
-there are two reasons that optimal system performance may be obtained by a
-system somewhere in between these two extremes: Dynamic application
-behavior and social constraints.
-
-From a technical perspective, pure static compilation cannot ever give
-optimal performance in all cases, because applications have varying dynamic
-behavior that the static compiler cannot take into consideration. Even
-compilers that support profile guided optimization generate poor code in
-the real world, because using such optimization tunes that application
-to one particular usage pattern, whereas real programs (as opposed to
-benchmarks) often have several different usage patterns.
-
-On a social level, static compilation is a very shortsighted solution to
-the performance problem. Instruction set architectures (ISAs) continuously
-evolve, and each implementation of an ISA (a processor) must choose a set
-of tradeoffs that make sense in the market context that it is designed for.
-With every new processor introduced, the vendor faces two fundamental
-problems: First, there is a lag time between when a processor is introduced
-to when compilers generate quality code for the architecture. Secondly,
-even when compilers catch up to the new architecture there is often a large
-body of legacy code that was compiled for previous generations and will
-not or can not be upgraded. Thus a large percentage of code running on a
-processor may be compiled quite sub-optimally for the current
-characteristics of the dynamic execution environment.
-
-For these reasons, LLVM has been designed from the beginning as a long-term
-solution to these problems. Its design allows the large body of platform
-independent, static, program optimizations currently in compilers to be
-reused unchanged in their current form. It also provides important static
-type information to enable powerful dynamic and link time optimizations
-to be performed quickly and efficiently. This combination enables an
-increase in effective system performance for real world environments.
diff --git a/release_23/docs/HistoricalNotes/2001-05-18-ExceptionHandling.txt b/release_23/docs/HistoricalNotes/2001-05-18-ExceptionHandling.txt
deleted file mode 100644
index b546301d35a4..000000000000
--- a/release_23/docs/HistoricalNotes/2001-05-18-ExceptionHandling.txt
+++ /dev/null
@@ -1,202 +0,0 @@
-Meeting notes: Implementation idea: Exception Handling in C++/Java
-
-The 5/18/01 meeting discussed ideas for implementing exceptions in LLVM.
-We decided that the best solution requires a set of library calls provided by
-the VM, as well as an extension to the LLVM function invocation syntax.
-
-The LLVM function invocation instruction previously looks like this (ignoring
-types):
-
- call func(arg1, arg2, arg3)
-
-The extension discussed today adds an optional "with" clause that
-associates a label with the call site. The new syntax looks like this:
-
- call func(arg1, arg2, arg3) with funcCleanup
-
-This funcHandler always stays tightly associated with the call site (being
-encoded directly into the call opcode itself), and should be used whenever
-there is cleanup work that needs to be done for the current function if
-an exception is thrown by func (or if we are in a try block).
-
-To support this, the VM/Runtime provide the following simple library
-functions (all syntax in this document is very abstract):
-
-typedef struct { something } %frame;
- The VM must export a "frame type", that is an opaque structure used to
- implement different types of stack walking that may be used by various
- language runtime libraries. We imagine that it would be typical to
- represent a frame with a PC and frame pointer pair, although that is not
- required.
-
-%frame getStackCurrentFrame();
- Get a frame object for the current function. Note that if the current
- function was inlined into its caller, the "current" frame will belong to
- the "caller".
-
-bool isFirstFrame(%frame f);
- Returns true if the specified frame is the top level (first activated) frame
- for this thread. For the main thread, this corresponds to the main()
- function, for a spawned thread, it corresponds to the thread function.
-
-%frame getNextFrame(%frame f);
- Return the previous frame on the stack. This function is undefined if f
- satisfies the predicate isFirstFrame(f).
-
-Label *getFrameLabel(%frame f);
- If a label was associated with f (as discussed below), this function returns
- it. Otherwise, it returns a null pointer.
-
-doNonLocalBranch(Label *L);
- At this point, it is not clear whether this should be a function or
- intrinsic. It should probably be an intrinsic in LLVM, but we'll deal with
- this issue later.
-
-
-Here is a motivating example that illustrates how these facilities could be
-used to implement the C++ exception model:
-
-void TestFunction(...) {
- A a; B b;
- foo(); // Any function call may throw
- bar();
- C c;
-
- try {
- D d;
- baz();
- } catch (int) {
- ...int Stuff...
- // execution continues after the try block: the exception is consumed
- } catch (double) {
- ...double stuff...
- throw; // Exception is propogated
- }
-}
-
-This function would compile to approximately the following code (heavy
-pseudo code follows):
-
-Func:
- %a = alloca A
- A::A(%a) // These ctors & dtors could throw, but we ignore this
- %b = alloca B // minor detail for this example
- B::B(%b)
-
- call foo() with fooCleanup // An exception in foo is propogated to fooCleanup
- call bar() with barCleanup // An exception in bar is propogated to barCleanup
-
- %c = alloca C
- C::C(c)
- %d = alloca D
- D::D(d)
- call baz() with bazCleanup // An exception in baz is propogated to bazCleanup
- d->~D();
-EndTry: // This label corresponds to the end of the try block
- c->~C() // These could also throw, these are also ignored
- b->~B()
- a->~A()
- return
-
-Note that this is a very straight forward and literal translation: exactly
-what we want for zero cost (when unused) exception handling. Especially on
-platforms with many registers (ie, the IA64) setjmp/longjmp style exception
-handling is *very* impractical. Also, the "with" clauses describe the
-control flow paths explicitly so that analysis is not adversly effected.
-
-The foo/barCleanup labels are implemented as:
-
-TryCleanup: // Executed if an exception escapes the try block
- c->~C()
-barCleanup: // Executed if an exception escapes from bar()
- // fall through
-fooCleanup: // Executed if an exception escapes from foo()
- b->~B()
- a->~A()
- Exception *E = getThreadLocalException()
- call throw(E) // Implemented by the C++ runtime, described below
-
-Which does the work one would expect. getThreadLocalException is a function
-implemented by the C++ support library. It returns the current exception
-object for the current thread. Note that we do not attempt to recycle the
-shutdown code from before, because performance of the mainline code is
-critically important. Also, obviously fooCleanup and barCleanup may be
-merged and one of them eliminated. This just shows how the code generator
-would most likely emit code.
-
-The bazCleanup label is more interesting. Because the exception may be caught
-by the try block, we must dispatch to its handler... but it does not exist
-on the call stack (it does not have a VM Call->Label mapping installed), so
-we must dispatch statically with a goto. The bazHandler thus appears as:
-
-bazHandler:
- d->~D(); // destruct D as it goes out of scope when entering catch clauses
- goto TryHandler
-
-In general, TryHandler is not the same as bazHandler, because multiple
-function calls could be made from the try block. In this case, trivial
-optimization could merge the two basic blocks. TryHandler is the code
-that actually determines the type of exception, based on the Exception object
-itself. For this discussion, assume that the exception object contains *at
-least*:
-
-1. A pointer to the RTTI info for the contained object
-2. A pointer to the dtor for the contained object
-3. The contained object itself
-
-Note that it is necessary to maintain #1 & #2 in the exception object itself
-because objects without virtual function tables may be thrown (as in this
-example). Assuming this, TryHandler would look something like this:
-
-TryHandler:
- Exception *E = getThreadLocalException();
- switch (E->RTTIType) {
- case IntRTTIInfo:
- ...int Stuff... // The action to perform from the catch block
- break;
- case DoubleRTTIInfo:
- ...double Stuff... // The action to perform from the catch block
- goto TryCleanup // This catch block rethrows the exception
- break; // Redundant, eliminated by the optimizer
- default:
- goto TryCleanup // Exception not caught, rethrow
- }
-
- // Exception was consumed
- if (E->dtor)
- E->dtor(E->object) // Invoke the dtor on the object if it exists
- goto EndTry // Continue mainline code...
-
-And that is all there is to it.
-
-The throw(E) function would then be implemented like this (which may be
-inlined into the caller through standard optimization):
-
-function throw(Exception *E) {
- // Get the start of the stack trace...
- %frame %f = call getStackCurrentFrame()
-
- // Get the label information that corresponds to it
- label * %L = call getFrameLabel(%f)
- while (%L == 0 && !isFirstFrame(%f)) {
- // Loop until a cleanup handler is found
- %f = call getNextFrame(%f)
- %L = call getFrameLabel(%f)
- }
-
- if (%L != 0) {
- call setThreadLocalException(E) // Allow handlers access to this...
- call doNonLocalBranch(%L)
- }
- // No handler found!
- call BlowUp() // Ends up calling the terminate() method in use
-}
-
-That's a brief rundown of how C++ exception handling could be implemented in
-llvm. Java would be very similar, except it only uses destructors to unlock
-synchronized blocks, not to destroy data. Also, it uses two stack walks: a
-nondestructive walk that builds a stack trace, then a destructive walk that
-unwinds the stack as shown here.
-
-It would be trivial to get exception interoperability between C++ and Java.
-
diff --git a/release_23/docs/HistoricalNotes/2001-05-19-ExceptionResponse.txt b/release_23/docs/HistoricalNotes/2001-05-19-ExceptionResponse.txt
deleted file mode 100644
index 3375365f54c9..000000000000
--- a/release_23/docs/HistoricalNotes/2001-05-19-ExceptionResponse.txt
+++ /dev/null
@@ -1,45 +0,0 @@
-Date: Sat, 19 May 2001 19:09:13 -0500 (CDT)
-From: Chris Lattner <sabre@nondot.org>
-To: Vikram S. Adve <vadve@cs.uiuc.edu>
-Subject: RE: Meeting writeup
-
-> I read it through and it looks great!
-
-Thanks!
-
-> The finally clause in Java may need more thought. The code for this clause
-> is like a subroutine because it needs to be entered from many points (end of
-> try block and beginning of each catch block), and then needs to *return to
-> the place from where the code was entered*. That's why JVM has the
-> jsr/jsr_w instruction.
-
-Hrm... I guess that is an implementation decision. It can either be
-modelled as a subroutine (as java bytecodes do), which is really
-gross... or it can be modelled as code duplication (emitted once inline,
-then once in the exception path). Because this could, at worst,
-slightly less than double the amount of code in a function (it is
-bounded) I don't think this is a big deal. One of the really nice things
-about the LLVM representation is that it still allows for runtime code
-generation for exception paths (exceptions paths are not compiled until
-needed). Obviously a static compiler couldn't do this though. :)
-
-In this case, only one copy of the code would be compiled... until the
-other one is needed on demand. Also this strategy fits with the "zero
-cost" exception model... the standard case is not burdened with extra
-branches or "call"s.
-
-> I suppose you could save the return address in a particular register
-> (specific to this finally block), jump to the finally block, and then at the
-> end of the finally block, jump back indirectly through this register. It
-> will complicate building the CFG but I suppose that can be handled. It is
-> also unsafe in terms of checking where control returns (which is I suppose
-> why the JVM doesn't use this).
-
-I think that a code duplication method would be cleaner, and would avoid
-the caveats that you mention. Also, it does not slow down the normal case
-with an indirect branch...
-
-Like everything, we can probably defer a final decision until later. :)
-
--Chris
-
diff --git a/release_23/docs/HistoricalNotes/2001-06-01-GCCOptimizations.txt b/release_23/docs/HistoricalNotes/2001-06-01-GCCOptimizations.txt
deleted file mode 100644
index 97af16a2dad0..000000000000
--- a/release_23/docs/HistoricalNotes/2001-06-01-GCCOptimizations.txt
+++ /dev/null
@@ -1,63 +0,0 @@
-Date: Fri, 1 Jun 2001 16:38:17 -0500 (CDT)
-From: Chris Lattner <sabre@nondot.org>
-To: Vikram S. Adve <vadve@cs.uiuc.edu>
-Subject: Interesting: GCC passes
-
-
-Take a look at this document (which describes the order of optimizations
-that GCC performs):
-
-http://gcc.gnu.org/onlinedocs/gcc_17.html
-
-The rundown is that after RTL generation, the following happens:
-
-1 . [t] jump optimization (jumps to jumps, etc)
-2 . [t] Delete unreachable code
-3 . Compute live ranges for CSE
-4 . [t] Jump threading (jumps to jumps with identical or inverse conditions)
-5 . [t] CSE
-6 . *** Conversion to SSA
-7 . [t] SSA Based DCE
-8 . *** Conversion to LLVM
-9 . UnSSA
-10. GCSE
-11. LICM
-12. Strength Reduction
-13. Loop unrolling
-14. [t] CSE
-15. [t] DCE
-16. Instruction combination, register movement, scheduling... etc.
-
-I've marked optimizations with a [t] to indicate things that I believe to
-be relatively trivial to implement in LLVM itself. The time consuming
-things to reimplement would be SSA based PRE, Strength reduction & loop
-unrolling... these would be the major things we would miss out on if we
-did LLVM creation from tree code [inlining and other high level
-optimizations are done on the tree representation].
-
-Given the lack of "strong" optimizations that would take a long time to
-reimplement, I am leaning a bit more towards creating LLVM from the tree
-code. Especially given that SGI has GPL'd their compiler, including many
-SSA based optimizations that could be adapted (besides the fact that their
-code looks MUCH nicer than GCC :)
-
-Even if we choose to do LLVM code emission from RTL, we will almost
-certainly want to move LLVM emission from step 8 down until at least CSE
-has been rerun... which causes me to wonder if the SSA generation code
-will still work (due to global variable dependencies and stuff). I assume
-that it can be made to work, but might be a little more involved than we
-would like.
-
-I'm continuing to look at the Tree -> RTL code. It is pretty gross
-because they do some of the translation a statement at a time, and some
-of it a function at a time... I'm not quite clear why and how the
-distinction is drawn, but it does not appear that there is a wonderful
-place to attach extra info.
-
-Anyways, I'm proceeding with the RTL -> LLVM conversion phase for now. We
-can talk about this more on Monday.
-
-Wouldn't it be nice if there were a obvious decision to be made? :)
-
--Chris
-
diff --git a/release_23/docs/HistoricalNotes/2001-06-01-GCCOptimizations2.txt b/release_23/docs/HistoricalNotes/2001-06-01-GCCOptimizations2.txt
deleted file mode 100644
index 6c9e0971a04d..000000000000
--- a/release_23/docs/HistoricalNotes/2001-06-01-GCCOptimizations2.txt
+++ /dev/null
@@ -1,71 +0,0 @@
-Date: Fri, 1 Jun 2001 17:08:44 -0500 (CDT)
-From: Chris Lattner <sabre@nondot.org>
-To: Vikram S. Adve <vadve@cs.uiuc.edu>
-Subject: RE: Interesting: GCC passes
-
-> That is very interesting. I agree that some of these could be done on LLVM
-> at link-time, but it is the extra time required that concerns me. Link-time
-> optimization is severely time-constrained.
-
-If we were to reimplement any of these optimizations, I assume that we
-could do them a translation unit at a time, just as GCC does now. This
-would lead to a pipeline like this:
-
-Static optimizations, xlation unit at a time:
-.c --GCC--> .llvm --llvmopt--> .llvm
-
-Link time optimizations:
-.llvm --llvm-ld--> .llvm --llvm-link-opt--> .llvm
-
-Of course, many optimizations could be shared between llvmopt and
-llvm-link-opt, but the wouldn't need to be shared... Thus compile time
-could be faster, because we are using a "smarter" IR (SSA based).
-
-> BTW, about SGI, "borrowing" SSA-based optimizations from one compiler and
-> putting it into another is not necessarily easier than re-doing it.
-> Optimization code is usually heavily tied in to the specific IR they use.
-
-Understood. The only reason that I brought this up is because SGI's IR is
-more similar to LLVM than it is different in many respects (SSA based,
-relatively low level, etc), and could be easily adapted. Also their
-optimizations are written in C++ and are actually somewhat
-structured... of course it would be no walk in the park, but it would be
-much less time consuming to adapt, say, SSA-PRE than to rewrite it.
-
-> But your larger point is valid that adding SSA based optimizations is
-> feasible and should be fun. (Again, link time cost is the issue.)
-
-Assuming linktime cost wasn't an issue, the question is:
-Does using GCC's backend buy us anything?
-
-> It also occurs to me that GCC is probably doing quite a bit of back-end
-> optimization (step 16 in your list). Do you have a breakdown of that?
-
-Not really. The irritating part of GCC is that it mixes it all up and
-doesn't have a clean seperation of concerns. A lot of the "back end
-optimization" happens right along with other data optimizations (ie, CSE
-of machine specific things).
-
-As far as REAL back end optimizations go, it looks something like this:
-
-1. Instruction combination: try to make CISCy instructions, if available
-2. Register movement: try to get registers in the right places for the
-architecture to avoid register to register moves. For example, try to get
-the first argument of a function to naturally land in %o0 for sparc.
-3. Instruction scheduling: 'nuff said :)
-4. Register class preferencing: ??
-5. Local register allocation
-6. global register allocation
-7. Spilling
-8. Local regalloc
-9. Jump optimization
-10. Delay slot scheduling
-11. Branch shorting for CISC machines
-12. Instruction selection & peephole optimization
-13. Debug info output
-
-But none of this would be usable for LLVM anyways, unless we were using
-GCC as a static compiler.
-
--Chris
-
diff --git a/release_23/docs/HistoricalNotes/2001-06-20-.NET-Differences.txt b/release_23/docs/HistoricalNotes/2001-06-20-.NET-Differences.txt
deleted file mode 100644
index 1bc2eae746c3..000000000000
--- a/release_23/docs/HistoricalNotes/2001-06-20-.NET-Differences.txt
+++ /dev/null
@@ -1,30 +0,0 @@
-Date: Wed, 20 Jun 2001 12:32:22 -0500
-From: Vikram Adve <vadve@cs.uiuc.edu>
-To: Chris Lattner <lattner@cs.uiuc.edu>
-Subject: .NET vs. our VM
-
-One significant difference between .NET CLR and our VM is that the CLR
-includes full information about classes and inheritance. In fact, I just
-sat through the paper on adding templates to .NET CLR, and the speaker
-indicated that the goal seems to be to do simple static compilation (very
-little lowering or optimization). Also, the templates implementation in CLR
-"relies on dynamic class loading and JIT compilation".
-
-This is an important difference because I think there are some significant
-advantages to have a much lower level VM layer, and do significant static
-analysis and optimization.
-
-I also talked to the lead guy for KAI's C++ compiler (Arch Robison) and he
-said that SGI and other commercial compilers have included options to export
-their *IR* next to the object code (i.e., .il files) and use them for
-link-time code generation. In fact, he said that the .o file was nearly
-empty and was entirely generated from the .il at link-time. But he agreed
-that this limited the link-time interprocedural optimization to modules
-compiled by the same compiler, whereas our approach allows us to link and
-optimize modules from multiple different compilers. (Also, of course, they
-don't do anything for runtime optimization).
-
-All issues to bring up in Related Work.
-
---Vikram
-
diff --git a/release_23/docs/HistoricalNotes/2001-07-06-LoweringIRForCodeGen.txt b/release_23/docs/HistoricalNotes/2001-07-06-LoweringIRForCodeGen.txt
deleted file mode 100644
index 3e10416fe677..000000000000
--- a/release_23/docs/HistoricalNotes/2001-07-06-LoweringIRForCodeGen.txt
+++ /dev/null
@@ -1,31 +0,0 @@
-Date: Fri, 6 Jul 2001 16:56:56 -0500
-From: Vikram S. Adve <vadve@cs.uiuc.edu>
-To: Chris Lattner <lattner@cs.uiuc.edu>
-Subject: lowering the IR
-
-BTW, I do think that we should consider lowering the IR as you said. I
-didn't get time to raise it today, but it comes up with the SPARC
-move-conditional instruction. I don't think we want to put that in the core
-VM -- it is a little too specialized. But without a corresponding
-conditional move instruction in the VM, it is pretty difficult to maintain a
-close mapping between VM and machine code. Other architectures may have
-other such instructions.
-
-What I was going to suggest was that for a particular processor, we define
-additional VM instructions that match some of the unusual opcodes on the
-processor but have VM semantics otherwise, i.e., all operands are in SSA
-form and typed. This means that we can re-generate core VM code from the
-more specialized code any time we want (so that portability is not lost).
-
-Typically, a static compiler like gcc would generate just the core VM, which
-is relatively portable. Anyone (an offline tool, the linker, etc., or even
-the static compiler itself if it chooses) can transform that into more
-specialized target-specific VM code for a particular architecture. If the
-linker does it, it can do it after all machine-independent optimizations.
-This would be the most convenient, but not necessary.
-
-The main benefit of lowering will be that we will be able to retain a close
-mapping between VM and machine code.
-
---Vikram
-
diff --git a/release_23/docs/HistoricalNotes/2001-07-08-InstructionSelection.txt b/release_23/docs/HistoricalNotes/2001-07-08-InstructionSelection.txt
deleted file mode 100644
index 8cc75b89b8fe..000000000000
--- a/release_23/docs/HistoricalNotes/2001-07-08-InstructionSelection.txt
+++ /dev/null
@@ -1,51 +0,0 @@
-Date: Sun, 8 Jul 2001 09:37:22 -0500
-From: Vikram S. Adve <vadve@cs.uiuc.edu>
-To: Ruchira Sasanka <sasanka@students.uiuc.edu>
-Cc: Chris Lattner <lattner@cs.uiuc.edu>
-Subject: machine instruction operands
-
-Ruchira,
-
-When generating machine instructions, I have to make several choices about
-operands. For cases were a register is required, there are 3 cases:
-
-1. The register is for a Value* that is already in the VM code.
-
-2. The register is for a value that is not in the VM code, usually because 2
-machine instructions get generated for a single VM instruction (and the
-register holds the result of the first m/c instruction and is used by the
-second m/c instruction).
-
-3. The register is a pre-determined machine register.
-
-E.g, for this VM instruction:
- ptr = alloca type, numElements
-I have to generate 2 machine instructions:
- reg = mul constant, numElements
- ptr = add %sp, reg
-
-Each machine instruction is of class MachineInstr.
-It has a vector of operands. All register operands have type MO_REGISTER.
-The 3 types of register operands are marked using this enum:
-
- enum VirtualRegisterType {
- MO_VMVirtualReg, // virtual register for *value
- MO_MInstrVirtualReg, // virtual register for result of *minstr
- MO_MachineReg // pre-assigned machine register `regNum'
- } vregType;
-
-Here's how this affects register allocation:
-
-1. MO_VMVirtualReg is the standard case: you just do the register
-allocation.
-
-2. MO_MInstrVirtualReg is the case where there is a hidden register being
-used. You should decide how you want to handle it, e.g., do you want do
-create a Value object during the preprocessing phase to make the value
-explicit (like for address register for the RETURN instruction).
-
-3. For case MO_MachineReg, you don't need to do anything, at least for
-SPARC. The only machine regs I am using so far are %g0 and %sp.
-
---Vikram
-
diff --git a/release_23/docs/HistoricalNotes/2001-07-08-InstructionSelection2.txt b/release_23/docs/HistoricalNotes/2001-07-08-InstructionSelection2.txt
deleted file mode 100644
index 1ae006d50861..000000000000
--- a/release_23/docs/HistoricalNotes/2001-07-08-InstructionSelection2.txt
+++ /dev/null
@@ -1,25 +0,0 @@
-Date: Sun, 8 Jul 2001 10:02:20 -0500
-From: Vikram S. Adve <vadve@cs.uiuc.edu>
-To: vadve@cs.uiuc.edu, Ruchira Sasanka <sasanka@students.uiuc.edu>
-Cc: Chris Lattner <lattner@cs.uiuc.edu>
-Subject: RE: machine instruction operands
-
-I got interrupted and forgot to explain the example. In that case:
-
- reg will be the 3rd operand of MUL and it will be of type
-MO_MInstrVirtualReg. The field MachineInstr* minstr will point to the
-instruction that computes reg.
-
- numElements will be an immediate constant, not a register.
-
- %sp will be operand 1 of ADD and it will be of type MO_MachineReg. The
-field regNum identifies the register.
-
- numElements will be operand 2 of ADD and it will be of type
-MO_VMVirtualReg. The field Value* value identifies the value.
-
- ptr will be operand 3 of ADD will also be %sp, i.e., of
- type MO_MachineReg. regNum identifies the register.
-
---Vikram
-
diff --git a/release_23/docs/HistoricalNotes/2001-09-18-OptimizeExceptions.txt b/release_23/docs/HistoricalNotes/2001-09-18-OptimizeExceptions.txt
deleted file mode 100644
index 9379081018d0..000000000000
--- a/release_23/docs/HistoricalNotes/2001-09-18-OptimizeExceptions.txt
+++ /dev/null
@@ -1,56 +0,0 @@
-Date: Tue, 18 Sep 2001 00:38:37 -0500 (CDT)
-From: Chris Lattner <sabre@nondot.org>
-To: Vikram S. Adve <vadve@cs.uiuc.edu>
-Subject: Idea for a simple, useful link time optimization
-
-
-In C++ programs, exceptions suck, and here's why:
-
-1. In virtually all function calls, you must assume that the function
- throws an exception, unless it is defined as 'nothrow'. This means
- that every function call has to have code to invoke dtors on objects
- locally if one is thrown by the function. Most functions don't throw
- exceptions, so this code is dead [with all the bad effects of dead
- code, including icache pollution].
-2. Declaring a function nothrow causes catch blocks to be added to every
- call that isnot provably nothrow. This makes them very slow.
-3. Extra extraneous exception edges reduce the opportunity for code
- motion.
-4. EH is typically implemented with large lookup tables. Ours is going to
- be much smaller (than the "standard" way of doing it) to start with,
- but eliminating it entirely would be nice. :)
-5. It is physically impossible to correctly put (accurate, correct)
- exception specifications on generic, templated code. But it is trivial
- to analyze instantiations of said code.
-6. Most large C++ programs throw few exceptions. Most well designed
- programs only throw exceptions in specific planned portions of the
- code.
-
-Given our _planned_ model of handling exceptions, all of this would be
-pretty trivial to eliminate through some pretty simplistic interprocedural
-analysis. The DCE factor alone could probably be pretty significant. The
-extra code motion opportunities could also be exploited though...
-
-Additionally, this optimization can be implemented in a straight forward
-conservative manner, allowing libraries to be optimized or individual
-files even (if there are leaf functions visible in the translation unit
-that are called).
-
-I think it's a reasonable optimization that hasn't really been addressed
-(because assembly is way too low level for this), and could have decent
-payoffs... without being a overly complex optimization.
-
-After I wrote all of that, I found this page that is talking about
-basically the same thing I just wrote, except that it is translation unit
-at a time, tree based approach:
-http://www.ocston.org/~jls/ehopt.html
-
-but is very useful from "expected gain" and references perspective. Note
-that their compiler is apparently unable to inline functions that use
-exceptions, so there numbers are pretty worthless... also our results
-would (hopefully) be better because it's interprocedural...
-
-What do you think?
-
--Chris
-
diff --git a/release_23/docs/HistoricalNotes/2002-05-12-InstListChange.txt b/release_23/docs/HistoricalNotes/2002-05-12-InstListChange.txt
deleted file mode 100644
index 004edb068d73..000000000000
--- a/release_23/docs/HistoricalNotes/2002-05-12-InstListChange.txt
+++ /dev/null
@@ -1,55 +0,0 @@
-Date: Sun, 12 May 2002 17:12:53 -0500 (CDT)
-From: Chris Lattner <sabre@nondot.org>
-To: "Vikram S. Adve" <vadve@cs.uiuc.edu>
-Subject: LLVM change
-
-There is a fairly fundemental change that I would like to make to the LLVM
-infrastructure, but I'd like to know if you see any drawbacks that I
-don't...
-
-Basically right now at the basic block level, each basic block contains an
-instruction list (returned by getInstList()) that is a ValueHolder of
-instructions. To iterate over instructions, we must actually iterate over
-the instlist, and access the instructions through the instlist.
-
-To add or remove an instruction from a basic block, we need to get an
-iterator to an instruction, which, given just an Instruction*, requires a
-linear search of the basic block the instruction is contained in... just
-to insert an instruction before another instruction, or to delete an
-instruction! This complicates algorithms that should be very simple (like
-simple constant propogation), because they aren't actually sparse anymore,
-they have to traverse basic blocks to remove constant propogated
-instructions.
-
-Additionally, adding or removing instructions to a basic block
-_invalidates all iterators_ pointing into that block, which is really
-irritating.
-
-To fix these problems (and others), I would like to make the ordering of
-the instructions be represented with a doubly linked list in the
-instructions themselves, instead of an external data structure. This is
-how many other representations do it, and frankly I can't remember why I
-originally implemented it the way I did.
-
-Long term, all of the code that depends on the nasty features in the
-instruction list (which can be found by grep'ing for getInstList()) will
-be changed to do nice local transformations. In the short term, I'll
-change the representation, but preserve the interface (including
-getInstList()) so that all of the code doesn't have to change.
-
-Iteration over the instructions in a basic block remains the simple:
-for (BasicBlock::iterator I = BB->begin(), E = BB->end(); I != E; ++I) ...
-
-But we will also support:
-for (Instruction *I = BB->front(); I; I = I->getNext()) ...
-
-After converting instructions over, I'll convert basic blocks and
-functions to have a similar interface.
-
-The only negative aspect of this change that I see is that it increases
-the amount of memory consumed by one pointer per instruction. Given the
-benefits, I think this is a very reasonable tradeoff.
-
-What do you think?
-
--Chris
diff --git a/release_23/docs/HistoricalNotes/2002-06-25-MegaPatchInfo.txt b/release_23/docs/HistoricalNotes/2002-06-25-MegaPatchInfo.txt
deleted file mode 100644
index 2ca46117ca89..000000000000
--- a/release_23/docs/HistoricalNotes/2002-06-25-MegaPatchInfo.txt
+++ /dev/null
@@ -1,72 +0,0 @@
-Changes:
-* Change the casting code to be const correct. Now, doing this is invalid:
- const Value *V = ...;
- Instruction *I = dyn_cast<Instruction>(V);
- instead, the second line should be:
- const Instruction *I = dyn_cast<Instruction>(V);
-
-* Change the casting code to allow casting a reference value thus:
- const Value &V = ...;
- Instruction &I = cast<Instruction>(V);
-
- dyn_cast does not work with references, because it must return a null pointer
- on failure.
-
-* Fundamentally change how instructions and other values are represented.
- Before, every llvm container was an instance of the ValueHolder template,
- instantiated for each container type. This ValueHolder was effectively a
- wrapper around a vector of pointers to the sub-objects.
-
- Now, instead of having a vector to pointers of objects, the objects are
- maintained in a doubly linked list of values (ie each Instruction now has
- Next & Previous fields). The containers are now instances of ilist (intrusive
- linked list class), which use the next and previous fields to chain them
- together. The advantage of this implementation is that iterators can be
- formed directly from pointers to the LLVM value, and invalidation is much
- easier to handle.
-
-* As part of the above change, dereferencing an iterator (for example:
- BasicBlock::iterator) now produces a reference to the underlying type (same
- example: Instruction&) instead of a pointer to the underlying object. This
- makes it much easier to write nested loops that iterator over things, changing
- this:
-
- for (Function::iterator BI = Func->begin(); BI != Func->end(); ++BI)
- for (BasicBlock::iterator II = (*BI)->begin(); II != (*BI)->end(); ++II)
- (*II)->dump();
-
- into:
-
- for (Function::iterator BI = Func->begin(); BI != Func->end(); ++BI)
- for (BasicBlock::iterator II = BI->begin(); II != BI->end(); ++II)
- II->dump();
-
- which is much more natural and what users expect.
-
-* Simplification of #include's: Before, it was necessary for a .cpp file to
- include every .h file that it used. Now things are batched a little bit more
- to make it easier to use. Specifically, the include graph now includes these
- edges:
- Module.h -> Function.h, GlobalVariable.h
- Function.h -> BasicBlock.h, Argument.h
- BasicBlock.h -> Instruction.h
-
- Which means that #including Function.h is usually sufficient for getting the
- lower level #includes.
-
-* Printing out a Value* has now changed: Printing a Value* will soon print out
- the address of the value instead of the contents of the Value. To print out
- the contents, you must convert it to a reference with (for example)
- 'cout << *I' instead of 'cout << I;'. This conversion is not yet complete,
- but will be eventually. In the mean time, both forms print out the contents.
-
-* References are used much more throughout the code base. In general, if a
- pointer is known to never be null, it is passed in as a reference instead of a
- pointer. For example, the instruction visitor class uses references instead
- of pointers, and that Pass subclasses now all receive references to Values
- instead of pointers, because they may never be null.
-
-* The Function class now has helper functions for accessing the Arguments list.
- Instead of having to go through getArgumentList for simple things like
- iterator over the arguments, now the a*() methods can be used to access them.
-
diff --git a/release_23/docs/HistoricalNotes/2003-01-23-CygwinNotes.txt b/release_23/docs/HistoricalNotes/2003-01-23-CygwinNotes.txt
deleted file mode 100644
index fbe811d627f5..000000000000
--- a/release_23/docs/HistoricalNotes/2003-01-23-CygwinNotes.txt
+++ /dev/null
@@ -1,28 +0,0 @@
-Date: Mon, 20 Jan 2003 00:00:28 -0600
-From: Brian R. Gaeke <gaeke@uiuc.edu>
-Subject: windows vs. llvm
-
-If you're interested, here are some of the major problems compiling LLVM
-under Cygwin and/or Mingw.
-
-1. Cygwin doesn't have <inttypes.h> or <stdint.h>, so all the INT*_MAX
- symbols and standard int*_t types are off in limbo somewhere. Mingw has
- <stdint.h>, but Cygwin doesn't like it.
-
-2. Mingw doesn't have <dlfcn.h> (because Windows doesn't have it.)
-
-3. SA_SIGINFO and friends are not around; only signal() seems to work.
-
-4. Relink, aka ld -r, doesn't work (probably an ld bug); you need
- DONT_BUILD_RELINKED. This breaks all the tools makefiles; you just need to
- change them to have .a's.
-
-5. There isn't a <values.h>.
-
-6. There isn't a mallinfo() (or, at least, it's documented, but it doesn't seem
- to link).
-
-7. The version of Bison that cygwin (and newer Linux versions) comes with
- does not like = signs in rules. Burg's gram.yc source file uses them. I think
- you can just take them out.
-
diff --git a/release_23/docs/HistoricalNotes/2003-06-25-Reoptimizer1.txt b/release_23/docs/HistoricalNotes/2003-06-25-Reoptimizer1.txt
deleted file mode 100644
index a7457846395b..000000000000
--- a/release_23/docs/HistoricalNotes/2003-06-25-Reoptimizer1.txt
+++ /dev/null
@@ -1,137 +0,0 @@
-Wed Jun 25 15:13:51 CDT 2003
-
-First-level instrumentation
----------------------------
-
-We use opt to do Bytecode-to-bytecode instrumentation. Look at
-back-edges and insert llvm_first_trigger() function call which takes
-no arguments and no return value. This instrumentation is designed to
-be easy to remove, for instance by writing a NOP over the function
-call instruction.
-
-Keep count of every call to llvm_first_trigger(), and maintain
-counters in a map indexed by return address. If the trigger count
-exceeds a threshold, we identify a hot loop and perform second-level
-instrumentation on the hot loop region (the instructions between the
-target of the back-edge and the branch that causes the back-edge). We
-do not move code across basic-block boundaries.
-
-
-Second-level instrumentation
----------------------------
-
-We remove the first-level instrumentation by overwriting the CALL to
-llvm_first_trigger() with a NOP.
-
-The reoptimizer maintains a map between machine-code basic blocks and
-LLVM BasicBlock*s. We only keep track of paths that start at the
-first machine-code basic block of the hot loop region.
-
-How do we keep track of which edges to instrument, and which edges are
-exits from the hot region? 3 step process.
-
-1) Do a DFS from the first machine-code basic block of the hot loop
-region and mark reachable edges.
-
-2) Do a DFS from the last machine-code basic block of the hot loop
-region IGNORING back edges, and mark the edges which are reachable in
-1) and also in 2) (i.e., must be reachable from both the start BB and
-the end BB of the hot region).
-
-3) Mark BBs which end in edges that exit the hot region; we need to
-instrument these differently.
-
-Assume that there is 1 free register. On SPARC we use %g1, which LLC
-has agreed not to use. Shift a 1 into it at the beginning. At every
-edge which corresponds to a conditional branch, we shift 0 for not
-taken and 1 for taken into a register. This uniquely numbers the paths
-through the hot region. Silently fail if we need more than 64 bits.
-
-At the end BB we call countPath and increment the counter based on %g1
-and the return address of the countPath call. We keep track of the
-number of iterations and the number of paths. We only run this
-version 30 or 40 times.
-
-Find the BBs that total 90% or more of execution, and aggregate them
-together to form our trace. But we do not allow more than 5 paths; if
-we have more than 5 we take the ones that are executed the most. We
-verify our assumption that we picked a hot back-edge in first-level
-instrumentation, by making sure that the number of times we took an
-exit edge from the hot trace is less than 10% of the number of
-iterations.
-
-LLC has been taught to recognize llvm_first_trigger() calls and NOT
-generate saves and restores of caller-saved registers around these
-calls.
-
-
-Phase behavior
---------------
-
-We turn off llvm_first_trigger() calls with NOPs, but this would hide
-phase behavior from us (when some funcs/traces stop being hot and
-others become hot.)
-
-We have a SIGALRM timer that counts time for us. Every time we get a
-SIGALRM we look at our priority queue of locations where we have
-removed llvm_first_trigger() calls. Each location is inserted along
-with a time when we will next turn instrumentation back on for that
-call site. If the time has arrived for a particular call site, we pop
-that off the prio. queue and turn instrumentation back on for that
-call site.
-
-
-Generating traces
------------------
-
-When we finally generate an optimized trace we first copy the code
-into the trace cache. This leaves us with 3 copies of the code: the
-original code, the instrumented code, and the optimized trace. The
-optimized trace does not have instrumentation. The original code and
-the instrumented code are modified to have a branch to the trace
-cache, where the optimized traces are kept.
-
-We copy the code from the original to the instrumentation version
-by tracing the LLVM-to-Machine code basic block map and then copying
-each machine code basic block we think is in the hot region into the
-trace cache. Then we instrument that code. The process is similar for
-generating the final optimized trace; we copy the same basic blocks
-because we might need to put in fixup code for exit BBs.
-
-LLVM basic blocks are not typically used in the Reoptimizer except
-for the mapping information.
-
-We are restricted to using single instructions to branch between the
-original code, trace, and instrumented code. So we have to keep the
-code copies in memory near the original code (they can't be far enough
-away that a single pc-relative branch would not work.) Malloc() or
-data region space is too far away. this impacts the design of the
-trace cache.
-
-We use a dummy function that is full of a bunch of for loops which we
-overwrite with trace-cache code. The trace manager keeps track of
-whether or not we have enough space in the trace cache, etc.
-
-The trace insertion routine takes an original start address, a vector
-of machine instructions representing the trace, index of branches and
-their corresponding absolute targets, and index of calls and their
-corresponding absolute targets.
-
-The trace insertion routine is responsible for inserting branches from
-the beginning of the original code to the beginning of the optimized
-trace. This is because at some point the trace cache may run out of
-space and it may have to evict a trace, at which point the branch to
-the trace would also have to be removed. It uses a round-robin
-replacement policy; we have found that this is almost as good as LRU
-and better than random (especially because of problems fitting the new
-trace in.)
-
-We cannot deal with discontiguous trace cache areas. The trace cache
-is supposed to be cache-line-aligned, but it is not page-aligned.
-
-We generate instrumentation traces and optimized traces into separate
-trace caches. We keep the instrumented code around because you don't
-want to delete a trace when you still might have to return to it
-(i.e., return from a llvm_first_trigger() or countPath() call.)
-
-
diff --git a/release_23/docs/HistoricalNotes/2003-06-26-Reoptimizer2.txt b/release_23/docs/HistoricalNotes/2003-06-26-Reoptimizer2.txt
deleted file mode 100644
index ec4b93fea0a2..000000000000
--- a/release_23/docs/HistoricalNotes/2003-06-26-Reoptimizer2.txt
+++ /dev/null
@@ -1,110 +0,0 @@
-Thu Jun 26 14:43:04 CDT 2003
-
-Information about BinInterface
-------------------------------
-
-Take in a set of instructions with some particular register
-allocation. It allows you to add, modify, or delete some instructions,
-in SSA form (kind of like LLVM's MachineInstrs.) Then re-allocate
-registers. It assumes that the transformations you are doing are safe.
-It does not update the mapping information or the LLVM representation
-for the modified trace (so it would not, for instance, support
-multiple optimization passes; passes have to be aware of and update
-manually the mapping information.)
-
-The way you use it is you take the original code and provide it to
-BinInterface; then you do optimizations to it, then you put it in the
-trace cache.
-
-The BinInterface tries to find live-outs for traces so that it can do
-register allocation on just the trace, and stitch the trace back into
-the original code. It has to preserve the live-ins and live-outs when
-it does its register allocation. (On exits from the trace we have
-epilogues that copy live-outs back into the right registers, but
-live-ins have to be in the right registers.)
-
-
-Limitations of BinInterface
----------------------------
-
-It does copy insertions for PHIs, which it infers from the machine
-code. The mapping info inserted by LLC is not sufficient to determine
-the PHIs.
-
-It does not handle integer or floating-point condition codes and it
-does not handle floating-point register allocation.
-
-It is not aggressively able to use lots of registers.
-
-There is a problem with alloca: we cannot find our spill space for
-spilling registers, normally allocated on the stack, if the trace
-follows an alloca(). What might be an acceptable solution would be to
-disable trace generation on functions that have variable-sized
-alloca()s. Variable-sized allocas in the trace would also probably
-screw things up.
-
-Because of the FP and alloca limitations, the BinInterface is
-completely disabled right now.
-
-
-Demo
-----
-
-This is a demo of the Ball & Larus version that does NOT use 2-level
-profiling.
-
-1. Compile program with llvm-gcc.
-2. Run opt -lowerswitch -paths -emitfuncs on the bytecode.
- -lowerswitch change switch statements to branches
- -paths Ball & Larus path-profiling algorithm
- -emitfuncs emit the table of functions
-3. Run llc to generate SPARC assembly code for the result of step 2.
-4. Use g++ to link the (instrumented) assembly code.
-
-We use a script to do all this:
-------------------------------------------------------------------------------
-#!/bin/sh
-llvm-gcc $1.c -o $1
-opt -lowerswitch -paths -emitfuncs $1.bc > $1.run.bc
-llc -f $1.run.bc
-LIBS=$HOME/llvm_sparc/lib/Debug
-GXX=/usr/dcs/software/evaluation/bin/g++
-$GXX -g -L $LIBS $1.run.s -o $1.run.llc \
-$LIBS/tracecache.o \
-$LIBS/mapinfo.o \
-$LIBS/trigger.o \
-$LIBS/profpaths.o \
-$LIBS/bininterface.o \
-$LIBS/support.o \
-$LIBS/vmcore.o \
-$LIBS/transformutils.o \
-$LIBS/bcreader.o \
--lscalaropts -lscalaropts -lanalysis \
--lmalloc -lcpc -lm -ldl
-------------------------------------------------------------------------------
-
-5. Run the resulting binary. You will see output from BinInterface
-(described below) intermixed with the output from the program.
-
-
-Output from BinInterface
-------------------------
-
-BinInterface's debugging code prints out the following stuff in order:
-
-1. Initial code provided to BinInterface with original register
-allocation.
-
-2. Section 0 is the trace prolog, consisting mainly of live-ins and
-register saves which will be restored in epilogs.
-
-3. Section 1 is the trace itself, in SSA form used by BinInterface,
-along with the PHIs that are inserted.
-PHIs are followed by the copies that implement them.
-Each branch (i.e., out of the trace) is annotated with the
-section number that represents the epilog it branches to.
-
-4. All the other sections starting with Section 2 are trace epilogs.
-Every branch from the trace has to go to some epilog.
-
-5. After the last section is the register allocation output.
diff --git a/release_23/docs/HowToReleaseLLVM.html b/release_23/docs/HowToReleaseLLVM.html
deleted file mode 100644
index 161d5cf9678e..000000000000
--- a/release_23/docs/HowToReleaseLLVM.html
+++ /dev/null
@@ -1,608 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
- "http://www.w3.org/TR/html4/strict.dtd">
-<html>
-<head>
- <title>How To Release LLVM To The Public</title>
- <link rel="stylesheet" href="llvm.css" type="text/css">
-</head>
-<body>
-
-<div class="doc_title">How To Release LLVM To The Public</div>
-<ol>
- <li><a href="#introduction">Introduction</a></li>
- <li><a href="#introduction">Release Timeline</a></li>
- <li><a href="#process">Release Process</a></li>
- <li><a href="#dist_targets">Distribution Targets</a></li>
-</ol>
-<div class="doc_author">
- <p>Written by <a href="mailto:rspencer@x10sys.com">Reid Spencer</a>,
- <a href="mailto:criswell@cs.uiuc.edu">John Criswell</a>,
- <a href="mailto:tonic@nondot.org">Tanya Lattner</a></p>
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section"><a name="introduction">Introduction</a></div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
- <p>
- This document collects information about successfully releasing LLVM to the
- public. It is the release manager's guide to ensuring that a high quality
- build of LLVM is released.
- </p>
-
- <p>
- The following is the basic criteria for releasing LLVM:
- </p>
-
- <ol>
- <li>Successful configure and build.</li>
- <li>Clean 'make check'.</li>
- <li>No regressions in the testsuite from the previous release. This may
- include performance regressions for major benchmarks.</li>
- </ol>
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section"><a name="process">Release Timeline</a></div>
-<!-- *********************************************************************** -->
-<div class="doc_text">
-The release manager should attempt to have a release every 3-4 months because LLVM
-does time based releases (instead of feature based). The release schedule should
-be roughly as follows:
-<ol>
-<li>Set code freeze and branch creation date for 3 months after last release
-date. Announce release schedule to the LLVM community and update the website.</li>
-<li>Create release branch and begin release process. </li>
-<li>Send out pre-release for first round of testing. Testing will last 7-10 days.
-During the first round of testing, regressions should be found and fixed. Patches
-are merged from mainline to the release branch.</li>
-<li>Generate and send out second pre-release. Bugs found during this time will
-not be fixed unless absolutely critical. Bugs introduce by patches merged in
-will be fixed and if so, a 3rd round of testing is needed.</li>
-<li>The release notes should be updated during the first and second round of
-pre-release testing.</li>
-<li>Finally, release!</li>
-</ol>
-</div>
-
-
-<!-- *********************************************************************** -->
-<div class="doc_section"><a name="process">Release Process</a></div>
-<!-- *********************************************************************** -->
-
-<!-- ======================================================================= -->
-<div class="doc_subsection"><a name="overview">Process Overview</a></div>
-<div class="doc_text">
- <ol>
- <li><a href="#branch">Create Release Branch</a></li>
- <li><a href="#verchanges">Update LLVM Version </a></li>
- <li><a href="#dist">Build the LLVM Source Distributions</a></li>
- <li><a href="#build">Build LLVM</a></li>
- <li><a href="#llvmgccbin">Build the LLVM GCC Binary Distribution</a></li>
- <li><a href="#rpm">Build RPM Packages (optional)</a></li>
- <li><a href="#check">Run 'make check'</a></li>
- <li><a href="#test">Run LLVM Test Suite</a></li>
- <li><a href="#prerelease">Pre-Release Testing</a></li>
- <li><a href="#tag">Tag the LLVM Release Branch</a></li>
- <li><a href="#updocs">Update Documentation</a></li>
- <li><a href="#updemo">Update the LLVM Demo Page</a></li>
- <li><a href="#webupdates">Update the LLVM Website</a></li>
- <li><a href="#announce">Announce the Release</a></li>
-
- </ol>
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection"><a name="branch">Create Release Branch</a></div>
-<div class="doc_text">
-<p>Branch the Subversion HEAD using the following procedure:</p>
- <ol>
- <li>
- <p>Verify that the current Subversion HEAD is in decent shape by examining nightly
- tester results.</p></li>
- <li>
- <p>Request all developers to refrain from committing. Offenders get commit
- rights taken away (temporarily).</p></li>
- <li>
- <p> Create the release branch for <tt>llvm</tt>, <tt>llvm-gcc4.0</tt>,
- <tt>llvm-gcc4.2</tt>, and the <tt>test-suite</tt>. The
- branch name will be <tt>release_XX</tt>, where <tt>XX</tt> is the major and
- minor release numbers. These branches can be created without checking out
- anything from subversion.
- </p>
-
- <div class="doc_code">
-<pre>
-svn copy https://llvm.org/svn/llvm-project/llvm/trunk \
- https://llvm.org/svn/llvm-project/llvm/branches/release_<i>XX</i>
-svn copy https://llvm.org/svn/llvm-project/llvm-gcc-4.0/trunk \
- https://llvm.org/svn/llvm-project/llvm-gcc-4.0/branches/release_<i>XX</i>
-svn copy https://llvm.org/svn/llvm-project/llvm-gcc-4.2/trunk \
- https://llvm.org/svn/llvm-project/llvm-gcc-4.2/branches/release_<i>XX</i>
-svn copy https://llvm.org/svn/llvm-project/test-suite/trunk \
- https://llvm.org/svn/llvm-project/test-suite/branches/release_<i>XX</i>
-</pre>
- </div>
-
- <li>
- <p>Advise developers they can work on Subversion HEAD again.</p></li>
-
- <li>
- <p>The Release Manager should switch to the release branch (as all changes
- to the release will now be done in the branch). The easiest way to do this
- is to grab another working copy using the following commands:</p>
-
-<div class="doc_code">
-<pre>
-svn co https://llvm.org/svn/llvm-project/llvm/branches/release_<i>XX</i>
-svn co https://llvm.org/svn/llvm-project/llvm-gcc-4.0/branches/release_<i>XX</i>
-svn co https://llvm.org/svn/llvm-project/llvm-gcc-4.2/branches/release_<i>XX</i>
-svn co https://llvm.org/svn/llvm-project/test-suite/branches/release_<i>XX</i>
-</pre>
-</div></li>
-
-</div>
- </ol>
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection"><a name="verchanges">Update LLVM Version</a></div>
-<div class="doc_text">
- <p>
- After creating the LLVM release branch, update the release branches'
- autoconf/configure.ac version from X.Xsvn to just X.X. Update it on mainline
- as well to be the next version (X.X+1svn). Regenerated the configure script
- for both. This must be done for both llvm and the test-suite.
- </p>
- <p>In addition, the version number of all the Bugzilla components must be
- updated for the next release.
- </p>
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection"><a name="dist">Build the LLVM Source Distributions</a></div>
-<div class="doc_text">
- <p>
- Create source distributions for LLVM, LLVM GCC, and the LLVM Test Suite by
- exporting the source from Subversion and archiving it. This can be done with
- the following commands:
- </p>
-
-<div class="doc_code">
-<pre>
-svn export https://llvm.org/svn/llvm-project/llvm/branches/release_<i>XX</i> llvm-X.X
-svn export https://llvm.org/svn/llvm-project/llvm-gcc-4.0/branches/release_<i>XX</i> llvm-gcc4.0-X.X.source
-svn export https://llvm.org/svn/llvm-project/llvm-gcc-4.2/branches/release_<i>XX</i> llvm-gcc4.2-X.X.source
-svn export https://llvm.org/svn/llvm-project/test-suite/branches/release_<i>XX</i> llvm-test-X.X
-tar -cvf - llvm-X.X | gzip &gt; llvm-X.X.tar.gz
-tar -cvf - llvm-test-X.X | gzip &gt; llvm-test-X.X.tar.gz
-tar -cvf - llvm-gcc4.0-X.X.source | gzip &gt; llvm-gcc-4.0-X.X.source.tar.gz
-tar -cvf - llvm-gcc4.2-X.X.source | gzip &gt; llvm-gcc-4.2-X.X.source.tar.gz
-</pre>
-</div>
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection"><a name="build">Build LLVM</a></div>
-<div class="doc_text">
- <p>
- Build both debug and release (optimized) versions of LLVM on all
- platforms. Ensure the build is warning and error free on each platform.
- Note that when building the LLVM GCC Binary, use a release build of LLVM.
- </p>
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection"><a name="llvmgccbin">Build the LLVM GCC Binary Distribution</a></div>
-<div class="doc_text">
- <p>
- Creating the LLVM GCC binary distribution (release/optimized) requires
- performing the following steps for each supported platform:
- </p>
-
- <ol>
- <li>
- Build the LLVM GCC front-end by following the directions in the README.LLVM
- file. Be sure to build with LLVM_VERSION_INFO=X.X, where X is the major and
- minor release numbers.
- </li>
-
- <li>
- Copy the installation directory to a directory named for the specific target.
- For example on Red Hat Enterprise Linux, the directory would be named
- <tt>llvm-gcc4.0-2.1-x86-linux-RHEL4</tt>. Archive and compress the new directory.
- </li>
- </ol>
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection"><a name="check">Run 'make check'</a></div>
-<div class="doc_text">
- <p>
- Using the newly built llvm-gcc and llvm, reconfigure llvm to locate llvm-gcc.
- Run <tt>make check</tt> and ensure there are no unexpected failures. If there
- are, resolve the failures or file a bug. If there is a fix commited to mainline,
- merge back into the release branch, and restart testing by
- <a href="#build">re-building LLVM</a> and <a href="#build">llvm-gcc</a>. If no
- fix will be made, XFAIL the test and commit back to the release branch.
- </p>
-
- <p>
- Ensure that '<tt>make check</tt>' passes on all platforms for all targets. The
- test suite must complete with "0 unexpected failures" before sending out the
- pre-releases for testing.
- </p>
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection"><a name="test">LLVM Test Suite</a></div>
-<div class="doc_text">
- <p>
- Run the <tt>llvm-test</tt> suite and ensure there are no unacceptable
- failures. Unacceptable failures are regression from the previous release
- and (optionally) major performance regressions from the previous release.
- If a regression is found a bug is filled, but the pre-releases may still go
- out.</p>
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection"><a name="rpm">Building RPM packages (optional)</a></div>
-<div class="doc_text">
- <p>
- You can, optionally, create source and binary RPM packages for LLVM. These may
- make it easier to get LLVM into a distribution. This can be done with the
- following commands:
- </p>
-
-<div class="doc_code">
-<pre>
-make dist # Build the distribution source tarball
-make dist-check # Check that the source tarball can build itself.
-cp llvm-M.m.tar.gz /usr/src/redhat/SOURCES # Required by rpmbuild
-make srpm # for source rpm
-make rpm # for binary rpm
-</pre>
-</div>
-
- <p>
- First, use <tt>make dist</tt> to simply build the distribution. Any failures
- need to be corrected (on the branch). Once <tt>make dist</tt> can be
- successful, do <tt>make dist-check</tt>. This target will do the same thing as
- the 'dist' target but also test that distribution to make sure it can build
- itself and runs <tt>make check</tt> as well. This ensures that needed files
- are not missing and that the src tarball can be successfully unpacked, built,
- installed, and cleaned. Once you have a reliable tarball, you need to copy it
- to the <tt>/usr/src/redhat/SOURCES</tt> directory which is a requirement of
- the rpmbuild tool. The last two <tt>make</tt> invocations just run rpmbuild to
- build either a source (<tt>srpm</tt>) or binary (<tt>rpm</tt>) RPM package.
- </p>
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection"><a name="prerelease">Pre-Release Testing</a></div>
-<div class="doc_text">
- <p>
- Once all testing has been completed and appropriate bugs filed, the pre-release
- tar balls may be put on the website and the LLVM community is notified. Ask that
- all LLVM developers test the release in 2 ways:</p>
- <ol>
- <li>Download llvm-X.X, llvm-test-X.X, and the appropriate llvm-gcc4 binary.
- Run "make check" and the full llvm-test suite (make TEST=nightly report).<li>
- <li>Download llvm-X.X, llvm-test-X.X, and the llvm-gcc4 source. Compile
- everything. Run "make check" and the full llvm-test suite (make TEST=nightly
- report).</li>
- </ol>
- <p>Ask LLVM developers to submit the report and make check results to the list.
- Verify that there are no regressions from the previous release. For
- unsupported targets, verify that make check at least is clean.</p>
-
- <p>The first round of pre-release testing will be the longest. During this time,
- all regressions must be fixed before the second pre-release is created (repeat
- steps 4-8).</p>
-
- <p>If this is the second round of testing, this is only to ensure the bug fixes
- previously merged in have not created new major problems. This is not the time
- to solve additional and unrelated bugs. If no patches are merged in, the release
- is determined to be ready and the release manager may move onto the next step.</p>
-</div>
-
-
-<!-- ======================================================================= -->
-<div class="doc_subsection"><a name="tag">Tag the Release Branch</a></div>
-<div class="doc_text">
- <p>Tag the release branch using the following procedure:</p>
-<div class="doc_code">
-<pre>
-svn copy https://llvm.org/svn/llvm-project/llvm/branches/release_XX \
- https://llvm.org/svn/llvm-project/llvm/tags/RELEASE_<i>XX</i>
-svn copy https://llvm.org/svn/llvm-project/llvm-gcc-4.0/branches/release_XX \
- https://llvm.org/svn/llvm-project/llvm-gcc-4.0/tags/RELEASE_<i>XX</i>
-svn copy https://llvm.org/svn/llvm-project/llvm-gcc-4.2/branches/release_XX \
- https://llvm.org/svn/llvm-project/llvm-gcc-4.2/tags/RELEASE_<i>XX</i>
-svn copy https://llvm.org/svn/llvm-project/test-suite/branches/release_XX \
- https://llvm.org/svn/llvm-project/test-suite/tags/RELEASE_<i>XX</i>
-</pre>
-</div>
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection"><a name="updocs">Update Documentation</a></div>
-<div class="doc_text">
- <p>
- Review the documentation and ensure that it is up to date. The Release Notes
- must be updated to reflect bug fixes, new known issues, and changes in the
- list of supported platforms. The Getting Started Guide should be updated to
- reflect the new release version number tag avaiable from Subversion and
- changes in basic system requirements. Merge both changes from mainline into
- the release branch.
- </p>
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection"><a name="updemo">Update the LLVM Demo Page</a></div>
-<div class="doc_text">
- <p>
- The LLVM demo page must be updated to use the new release. This consists of
- using the llvm-gcc binary and building LLVM. Update the website demo page
- configuration to use the new release.</p>
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection"><a name="webupdates">Update the LLVM Website</a></div>
-<div class="doc_text">
- <p>
- The website must be updated before the release announcement is sent out. Here is
- what to do:</p>
- <ol>
- <li> Check out the <tt>website</tt> module from CVS. </li>
- <li> Create a new subdirectory X.X in the releases directory. </li>
- <li> Commit the <tt>llvm</tt>, <tt>test-suite</tt>, <tt>llvm-gcc</tt> source,
- and <tt>llvm-gcc</tt> binaries in this new directory. </li>
- <li> Copy and commit the <tt>llvm/docs</tt> and <tt>LICENSE.txt</tt>
- files into this new directory. The docs should be built with BUILD_FOR_WEBSITE=1.</li>
- <li> Commit the index.html to the release/X.X directory to redirect (use from previous
- release. </li>
- <li> Update the <tt>releases/download.html</tt> file with the new release. </li>
- <li>Update the <tt>releases/index.html</tt> with the new release and link to
- release documentation.</li>
- <li> Finally, update the main page (<tt>index.html</tt> and sidebar) to
- point to the new release and release announcement. Make sure this all gets
- commited back into Subversion.</li>
- </ol>
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection"><a name="announce">Announce the Release</a></div>
-<div class="doc_text">
- <p>Have Chris send out the release announcement when everything is finished.</p>
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section"><a name="dist_targets">Distribution Targets</a></div>
-<!-- *********************************************************************** -->
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">Overview</div>
-<div class="doc_text">
- <p>
- The first thing you need to understand is that there are multiple make targets
- to support this feature. Here's an overview, we'll delve into the details
- later.
- </p>
-
- <ul>
- <li><b>distdir</b> - builds the distribution directory from which the
- distribution will be packaged</li>
- <li><b>dist</b> - builds each of the distribution tarballs (tar.gz,
- tar.bzip2, .zip). These can be built individually as well, with separate
- targets.</li>
- <li><b>dist-check</b> - this is identical to <tt>dist</tt> but includes a
- check on the distribution that ensures the tarball can: unpack
- successfully, compile correctly, pass '<tt>make check</tt>', and pass
- '<tt>make clean</tt>'.</li>
- <li><b>dist-clean</b>- this just does a normal clean but also cleans up the
- stuff generated by the other three <tt>dist</tt> targets (above).</li>
- </ul>
-
- <p>
- Okay, that's the basic functionality. When making a release, we want to ensure
- that the tree you build the distribution from passes
- <tt>dist-check</tt>. Beyond fixing the usual bugs, there is generally one
- impediment to making the release in this fashion: missing files. The
- <tt>dist-check</tt> process guards against that possibility. It will either
- fail and that failure will indicate what's missing, or it will succeed meaning
- that it has proved that the tarballs can actually succeed in building LLVM
- correctly and that it passes <tt>make check</tt>.
- </p>
-</div>
-
-<!-- ======================================================================= -->
-
-<div class="doc_subsection">distdir</div>
-<div class="doc_text">
- <p>
- This target builds the distribution directory which is the directory from
- which the tarballs are generated. The distribution directory has the same
- name as the release, e.g. LLVM-1.7). This target goes through the following
- process:
- </p>
-
- <ol>
- <li>First, if there was an old distribution directory (for the current
- release), it is removed in its entirety and you see <tt>Removing old
- LLVM-1.7</tt></li>
- <li>Second, it issues a <tt>make all ENABLE_OPTIMIZED=3D1</tt> to ensure
- that the everything in your tree can be built in release mode. Often
- times there are discrepancies in building between debug and release
- modes so it enforces release mode first. If that fails, the
- <tt>distdir</tt> target fails too. This is preceded by the message
- <tt>Making 'all' to verify build</tt>.</li>
- <li>Next, it traverses your source tree and copies it to a new directory
- that has the name of the release (<tt>LLVM-M.m</tt> in our current
- case). This is the directory that will get tar'd. It contains all the
- software that needs to be in the distribution. During the copying
- process, it omits generated files, SVN directories, and any other
- "cruft" that's in your build tree. This is done to eliminate the
- possibility of huge distribution tarballs that include useless or
- irrelevant stuff in them. This is the trickiest part of making the
- distribution. Done manually you will either include stuff that
- shouldn't be in the distribution or exclude stuff that should. This
- step is preceded by the message <tt>Building Distribution Directory
- LLVM-1.7</tt></li>
- <li>The distribution directory is then traversed and all <tt>CVS</tt> or
- <tt>.svn</tt> directories are removed. You see: <tt>Eliminating CVS/.svn
- directories from distribution</tt></li>
- <li>The recursive <tt>dist-hook</tt> target is executed. This gives each
- directory a chance to modify the distribution in some way (more on this
- below).</li>
- <li>The distribution directory is traversed and the correct file
- permissions and modes are set based on the type of file.</li>
- </ol>
-
- <p>
- To control the process of making the distribution directory correctly, each
- Makefile can utilize two features:
- </p>
-
- <ol>
- <li><b><tt>EXTRA_DIST</tt></B> - this make variable specifies which files
- it should distribute. By default, all source files are automatically
- included for distribution as well as certain <tt>well known</tt> files
- (see DistAlways variable in Makefile.rules for details). Each Makefile
- specifies, via the <tt>EXTRA_DIST</tt> variable, which additional files
- need to be distributed. Only those files that are needed to build LLVM
- should be added to <tt>EXTRA_DIST</tt>. <tt>EXTRA_DIST</tt> contains a
- list of file or directory names that should be distributed. For example,
- the top level Makefile contains <tt>EXTRA_DIST := test llvm.spec
- include</tt>. This means that in addition to regular things that are
- distributed at the top level (<tt>CREDITS.txt, LICENSE.txt</tt>, etc.)
- the distribution should contain the entire <tt>test</tt> and
- <tt>include</tt> directories as well as the <tt>llvm.spec</tt> file.</li>
- <li><b><tt>dist-hook</tt></B> - this make target can be used to alter the
- content of the distribution directory. For example, in the top level
- Makefile there is some logic to eliminate files in the <tt>include</tt>
- subtree that are generated by the configure script. These should not be
- distributed. Similarly, any <tt>dist-hook</tt> target found in any
- directory can add or remove or modify things just before it gets
- packaged. Any transformation is permitted. Generally, not much is
- needed.</li>
- </ol>
-
- <p>
- You will see various messages if things go wrong:
- </p>
-
- <ol>
- <li>During the copying process, any files that are missing will be flagged
- with: <tt>===== WARNING: Distribution Source 'dir/file' Not Found!</tt>
- These must be corrected by either adding the file or removing it from
- <tt>EXTRA_DIST</tt>.</li>
- <li>If you build the distribution with <tt>VERBOSE=1</tt>, then you might
- also see: <tt>Skipping non-existent 'dir/file'</tt> in certain cases
- where it's okay to skip the file.</li>
- <li>The target can fail if any of the things it does fail. Error messages
- should indicate what went wrong.</li>
- </ol>
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">dist</div>
-<div class="doc_text">
- <p>
- This target does exactly what <tt>distdir</tt> target does, but also includes
- assembling the tarballs. There are actually four related targets here:
- </p>
-
- <ul>
- <li><b><tt>dist-gzip</tt></b>: package the gzipped distribution tar
- file. The distribution directory is packaged into a single file ending
- in <tt>.tar.gz</tt> which is gzip compressed.</li>
- <li><b><tt>dist-bzip2</tt></b>: package the bzip2 distribution tar file.
- The distribution directory is packaged into a single file ending in
- <tt>.tar.bzip2</tt> which is bzip2 compressed.</li>
- <li><b><tt>dist-zip</tt></b>: package the zip distribution file. The
- distribution directory is packaged into a single file ending in
- <tt>.zip</tt> which is zip compressed.</li>
- <li><b><tt>dist</tt></b>: does all three, dist-gzip, dist-bzip2,
- dist-zip</li>
- </ul>
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">dist-check</div>
-<div class="doc_text">
- <p>
- This target checks the distribution. The basic idea is that it unpacks the
- distribution tarball and ensures that it can build. It takes the following
- actions:
- </p>
-
- <ol>
- <li>It depends on the <tt>dist-gzip</tt> target which, if it hasn't already
- been built, builds the gzip tar bundle (see dist and distdir
- above).</li>
- <li>removes any pre-existing <tt>_distcheckdir</tt> at the top level.</li>
- <li>creates a new <tt>_distcheckdir</tt> directory at the top level.</li>
- <li>creates a <tt>build</tt> subdirectory and an <tt>install</tt>
- subdirectory under <tt>_distcheckdir</tt>.</li>
- <li>unzips and untars the release tarball into <tt>_distcheckdir</tt>,
- creating <tt>LLVM-1.7</tt> directory (from the tarball).</li>
- <li>in the build subdirectory, it configures with appropriate options to
- build from the unpacked source tarball into the <tt>build</tt> directory
- with installation in the <tt>install</tt> directory.</li>
- <li>runs <tt>make all</tt></li>
- <li>runs <tt>make </tt><tt>check</tt></li>
- <li>runs <tt>make install</tt></li>
- <li>runs <tt>make uninstall</tt></li>
- <li>runs <tt>make dist</tt></li>
- <li>runs <tt>make clean</tt></li>
- <li>runs <tt>make dist-clean</tt></li>
- </ol>
-
- <p>
- If it can pass all that, the distribution will be deemed distribution worth y
- and you will see:
- </p>
-
- <pre>===== LLVM-1.7.tar.gz Ready For Distribution =====</pre>
-
- <p>
- This means the tarball should then be tested on other platforms and have the
- nightly test run against it. If those all pass, THEN it is ready for
- distribution.
- </p>
-
- <p>
- A note about disk space: using <tt>dist-check</tt> will easily triple the
- amount of disk space your build tree is using. You might want to check
- available space before you begin.
- </p>
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">dist-clean</div>
-<div class="doc_text">
- <p>
- In addition to doing a normal <tt>clean</tt>, this target will clean up the
- files and directories created by the distribution targets. In particular the
- distribution directory (<tt>LLVM-X.X</tt>), check directory
- (<tt>_distcheckdir</tt>), and the various tarballs will be removed. You do
- this after the release has shipped and you no longer need this stuff in your
- build tree.
- </p>
-</div>
-
-<!-- *********************************************************************** -->
-<hr>
-<address>
- <a href="http://jigsaw.w3.org/css-validator/check/referer"><img
- src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"></a>
- <a href="http://validator.w3.org/check/referer"><img
- src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!" /></a>
- <a href="http://llvm.cs.uiuc.edu">The LLVM Compiler Infrastructure</a>
- <br/>
- Last modified: $Date$
-</address>
-</body>
-</html>
diff --git a/release_23/docs/HowToSubmitABug.html b/release_23/docs/HowToSubmitABug.html
deleted file mode 100644
index 93e0d2107f0d..000000000000
--- a/release_23/docs/HowToSubmitABug.html
+++ /dev/null
@@ -1,355 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
- "http://www.w3.org/TR/html4/strict.dtd">
-<html>
-<head>
- <title>How to submit an LLVM bug report</title>
- <link rel="stylesheet" href="llvm.css" type="text/css">
-</head>
-<body>
-
-<div class="doc_title">
- How to submit an LLVM bug report
-</div>
-
-<table class="layout" style="width: 90%" >
-<tr class="layout">
- <td class="left">
-<ol>
- <li><a href="#introduction">Introduction - Got bugs?</a></li>
- <li><a href="#crashers">Crashing Bugs</a>
- <ul>
- <li><a href="#front-end">Front-end bugs</a>
- <li><a href="#ct_optimizer">Compile-time optimization bugs</a>
- <li><a href="#ct_codegen">Code generator bugs</a>
- </ul></li>
- <li><a href="#miscompilations">Miscompilations</a></li>
- <li><a href="#codegen">Incorrect code generation (JIT and LLC)</a></li>
-</ol>
-<div class="doc_author">
- <p>Written by <a href="mailto:sabre@nondot.org">Chris Lattner</a> and
- <a href="http://misha.brukman.net">Misha Brukman</a></p>
-</div>
-</td>
-<td class="right">
- <img src="img/Debugging.gif" alt="Debugging" width="444" height="314">
-</td>
-</tr>
-</table>
-
-<!-- *********************************************************************** -->
-<div class="doc_section">
- <a name="introduction">Introduction - Got bugs?</a>
-</div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>If you're working with LLVM and run into a bug, we definitely want to know
-about it. This document describes what you can do to increase the odds of
-getting it fixed quickly.</p>
-
-<p>Basically you have to do two things at a minimum. First, decide whether the
-bug <a href="#crashers">crashes the compiler</a> (or an LLVM pass), or if the
-compiler is <a href="#miscompilations">miscompiling</a> the program (i.e., the
-compiler successfully produces an executable, but it doesn't run right). Based
-on
-what type of bug it is, follow the instructions in the linked section to narrow
-down the bug so that the person who fixes it will be able to find the problem
-more easily.</p>
-
-<p>Once you have a reduced test-case, go to <a
-href="http://llvm.org/bugs/enter_bug.cgi">the LLVM Bug Tracking
-System</a> and fill out the form with the necessary details (note that you don't
-need to pick a catagory, just use the "new-bugs" catagory if you're not sure).
-The bug description should contain the following
-information:</p>
-
-<ul>
- <li>All information necessary to reproduce the problem.</li>
- <li>The reduced test-case that triggers the bug.</li>
- <li>The location where you obtained LLVM (if not from our Subversion
- repository).</li>
-</ul>
-
-<p>Thanks for helping us make LLVM better!</p>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section">
- <a name="crashers">Crashing Bugs</a>
-</div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>More often than not, bugs in the compiler cause it to crash&mdash;often due
-to an assertion failure of some sort. The most important
-piece of the puzzle is to figure out if it is crashing in the GCC front-end
-or if it is one of the LLVM libraries (e.g. the optimizer or code generator)
-that has problems.</p>
-
-<p>To figure out which component is crashing (the front-end,
-optimizer or code generator), run the
-<tt><b>llvm-gcc</b></tt> command line as you were when the crash occurred, but
-with the following extra command line options:</p>
-
-<ul>
- <li><tt><b>-O0 -emit-llvm</b></tt>: If <tt>llvm-gcc</tt> still crashes when
- passed these options (which disable the optimizer and code generator), then
- the crash is in the front-end. Jump ahead to the section on <a
- href="#front-end">front-end bugs</a>.</li>
-
- <li><tt><b>-emit-llvm</b></tt>: If <tt>llvm-gcc</tt> crashes with this option
- (which disables the code generator), you found an optimizer bug. Jump ahead
- to <a href="#ct_optimizer"> compile-time optimization bugs</a>.</li>
-
- <li>Otherwise, you have a code generator crash. Jump ahead to <a
- href="#ct_codegen">code generator bugs</a>.</li>
-
-</ul>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="front-end">Front-end bugs</a>
-</div>
-
-<div class="doc_text">
-
-<p>If the problem is in the front-end, you should re-run the same
-<tt>llvm-gcc</tt> command that resulted in the crash, but add the
-<tt>-save-temps</tt> option. The compiler will crash again, but it will leave
-behind a <tt><i>foo</i>.i</tt> file (containing preprocessed C source code) and
-possibly <tt><i>foo</i>.s</tt> for each
-compiled <tt><i>foo</i>.c</tt> file. Send us the <tt><i>foo</i>.i</tt> file,
-along with the options you passed to llvm-gcc, and a brief description of the
-error it caused.</p>
-
-<p>The <a href="http://delta.tigris.org/">delta</a> tool helps to reduce the
-preprocessed file down to the smallest amount of code that still replicates the
-problem. You're encouraged to use delta to reduce the code to make the
-developers' lives easier. <a
-href="http://gcc.gnu.org/wiki/A_guide_to_testcase_reduction">This website</a>
-has instructions on the best way to use delta.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="ct_optimizer">Compile-time optimization bugs</a>
-</div>
-
-<div class="doc_text">
-
-<p>If you find that a bug crashes in the optimizer, compile your test-case to a
-<tt>.bc</tt> file by passing "<tt><b>-emit-llvm -O0 -c -o foo.bc</b></tt>".
-Then run:</p>
-
-<div class="doc_code">
-<p><tt><b>opt</b> -std-compile-opts -debug-pass=Arguments foo.bc
- -disable-output</tt></p>
-</div>
-
-<p>This command should do two things: it should print out a list of passes, and
-then it should crash in the same was as llvm-gcc. If it doesn't crash, please
-follow the instructions for a <a href="#front-end">front-end bug</a>.</p>
-
-<p>If this does crash, then you should be able to debug this with the following
-bugpoint command:</p>
-
-<div class="doc_code">
-<p><tt><b>bugpoint</b> foo.bc &lt;list of passes printed by
-<b>opt</b>&gt;</tt></p>
-</div>
-
-<p>Please run this, then file a bug with the instructions and reduced .bc files
-that bugpoint emits. If something goes wrong with bugpoint, please submit the
-"foo.bc" file and the list of passes printed by <b>opt</b>.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="ct_codegen">Code generator bugs</a>
-</div>
-
-<div class="doc_text">
-
-<p>If you find a bug that crashes llvm-gcc in the code generator, compile your
-source file to a .bc file by passing "<tt><b>-emit-llvm -c -o foo.bc</b></tt>"
-to llvm-gcc (in addition to the options you already pass). Once your have
-foo.bc, one of the following commands should fail:</p>
-
-<ol>
-<li><tt><b>llc</b> foo.bc -f</tt></li>
-<li><tt><b>llc</b> foo.bc -f -relocation-model=pic</tt></li>
-<li><tt><b>llc</b> foo.bc -f -relocation-model=static</tt></li>
-<li><tt><b>llc</b> foo.bc -f -enable-eh</tt></li>
-<li><tt><b>llc</b> foo.bc -f -relocation-model=pic -enable-eh</tt></li>
-<li><tt><b>llc</b> foo.bc -f -relocation-model=static -enable-eh</tt></li>
-</ol>
-
-<p>If none of these crash, please follow the instructions for a
-<a href="#front-end">front-end bug</a>. If one of these do crash, you should
-be able to reduce this with one of the following bugpoint command lines (use
-the one corresponding to the command above that failed):</p>
-
-<ol>
-<li><tt><b>bugpoint</b> -run-llc foo.bc</tt></li>
-<li><tt><b>bugpoint</b> -run-llc foo.bc --tool-args
- -relocation-model=pic</tt></li>
-<li><tt><b>bugpoint</b> -run-llc foo.bc --tool-args
- -relocation-model=static</tt></li>
-<li><tt><b>bugpoint</b> -run-llc foo.bc --tool-args -enable-eh</tt></li>
-<li><tt><b>bugpoint</b> -run-llc foo.bc --tool-args
- -relocation-model=pic -enable-eh</tt></li>
-<li><tt><b>bugpoint</b> -run-llc foo.bc --tool-args
- -relocation-model=static -enable-eh</tt></li>
-</ol>
-
-<p>Please run this, then file a bug with the instructions and reduced .bc file
-that bugpoint emits. If something goes wrong with bugpoint, please submit the
-"foo.bc" file and the option that llc crashes with.</p>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section">
- <a name="miscompilations">Miscompilations</a>
-</div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>If llvm-gcc successfully produces an executable, but that executable doesn't
-run right, this is either a bug in the code or a bug in the
-compiler. The first thing to check is to make sure it is not using undefined
-behavior (e.g. reading a variable before it is defined). In particular, check
-to see if the program <a href="http://valgrind.org/">valgrind</a>s clean,
-passes purify, or some other memory checker tool. Many of the "LLVM bugs" that
-we have chased down ended up being bugs in the program being compiled, not
- LLVM.</p>
-
-<p>Once you determine that the program itself is not buggy, you should choose
-which code generator you wish to compile the program with (e.g. C backend, the
-JIT, or LLC) and optionally a series of LLVM passes to run. For example:</p>
-
-<div class="doc_code">
-<p><tt>
-<b>bugpoint</b> -run-cbe [... optzn passes ...] file-to-test.bc --args -- [program arguments]</tt></p>
-</div>
-
-<p><tt>bugpoint</tt> will try to narrow down your list of passes to the one pass
-that causes an error, and simplify the bitcode file as much as it can to assist
-you. It will print a message letting you know how to reproduce the resulting
-error.</p>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section">
- <a name="codegen">Incorrect code generation</a>
-</div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>Similarly to debugging incorrect compilation by mis-behaving passes, you can
-debug incorrect code generation by either LLC or the JIT, using
-<tt>bugpoint</tt>. The process <tt>bugpoint</tt> follows in this case is to try
-to narrow the code down to a function that is miscompiled by one or the other
-method, but since for correctness, the entire program must be run,
-<tt>bugpoint</tt> will compile the code it deems to not be affected with the C
-Backend, and then link in the shared object it generates.</p>
-
-<p>To debug the JIT:</p>
-
-<div class="doc_code">
-<pre>
-bugpoint -run-jit -output=[correct output file] [bitcode file] \
- --tool-args -- [arguments to pass to lli] \
- --args -- [program arguments]
-</pre>
-</div>
-
-<p>Similarly, to debug the LLC, one would run:</p>
-
-<div class="doc_code">
-<pre>
-bugpoint -run-llc -output=[correct output file] [bitcode file] \
- --tool-args -- [arguments to pass to llc] \
- --args -- [program arguments]
-</pre>
-</div>
-
-<p><b>Special note:</b> if you are debugging MultiSource or SPEC tests that
-already exist in the <tt>llvm/test</tt> hierarchy, there is an easier way to
-debug the JIT, LLC, and CBE, using the pre-written Makefile targets, which
-will pass the program options specified in the Makefiles:</p>
-
-<div class="doc_code">
-<p><tt>
-cd llvm/test/../../program<br>
-make bugpoint-jit
-</tt></p>
-</div>
-
-<p>At the end of a successful <tt>bugpoint</tt> run, you will be presented
-with two bitcode files: a <em>safe</em> file which can be compiled with the C
-backend and the <em>test</em> file which either LLC or the JIT
-mis-codegenerates, and thus causes the error.</p>
-
-<p>To reproduce the error that <tt>bugpoint</tt> found, it is sufficient to do
-the following:</p>
-
-<ol>
-
-<li><p>Regenerate the shared object from the safe bitcode file:</p>
-
-<div class="doc_code">
-<p><tt>
-<b>llc</b> -march=c safe.bc -o safe.c<br>
-<b>gcc</b> -shared safe.c -o safe.so
-</tt></p>
-</div></li>
-
-<li><p>If debugging LLC, compile test bitcode native and link with the shared
- object:</p>
-
-<div class="doc_code">
-<p><tt>
-<b>llc</b> test.bc -o test.s -f<br>
-<b>gcc</b> test.s safe.so -o test.llc<br>
-./test.llc [program options]
-</tt></p>
-</div></li>
-
-<li><p>If debugging the JIT, load the shared object and supply the test
- bitcode:</p>
-
-<div class="doc_code">
-<p><tt><b>lli</b> -load=safe.so test.bc [program options]</tt></p>
-</div></li>
-
-</ol>
-
-</div>
-
-<!-- *********************************************************************** -->
-<hr>
-<address>
- <a href="http://jigsaw.w3.org/css-validator/check/referer"><img
- src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"></a>
- <a href="http://validator.w3.org/check/referer"><img
- src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!" /></a>
-
- <a href="mailto:sabre@nondot.org">Chris Lattner</a><br>
- <a href="http://llvm.org">The LLVM Compiler Infrastructure</a>
- <br>
- Last modified: $Date$
-</address>
-
-</body>
-</html>
diff --git a/release_23/docs/LangRef.html b/release_23/docs/LangRef.html
deleted file mode 100644
index 42f698607c3f..000000000000
--- a/release_23/docs/LangRef.html
+++ /dev/null
@@ -1,5745 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
- "http://www.w3.org/TR/html4/strict.dtd">
-<html>
-<head>
- <title>LLVM Assembly Language Reference Manual</title>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <meta name="author" content="Chris Lattner">
- <meta name="description"
- content="LLVM Assembly Language Reference Manual.">
- <link rel="stylesheet" href="llvm.css" type="text/css">
-</head>
-
-<body>
-
-<div class="doc_title"> LLVM Language Reference Manual </div>
-<ol>
- <li><a href="#abstract">Abstract</a></li>
- <li><a href="#introduction">Introduction</a></li>
- <li><a href="#identifiers">Identifiers</a></li>
- <li><a href="#highlevel">High Level Structure</a>
- <ol>
- <li><a href="#modulestructure">Module Structure</a></li>
- <li><a href="#linkage">Linkage Types</a></li>
- <li><a href="#callingconv">Calling Conventions</a></li>
- <li><a href="#globalvars">Global Variables</a></li>
- <li><a href="#functionstructure">Functions</a></li>
- <li><a href="#aliasstructure">Aliases</a>
- <li><a href="#paramattrs">Parameter Attributes</a></li>
- <li><a href="#gc">Garbage Collector Names</a></li>
- <li><a href="#moduleasm">Module-Level Inline Assembly</a></li>
- <li><a href="#datalayout">Data Layout</a></li>
- </ol>
- </li>
- <li><a href="#typesystem">Type System</a>
- <ol>
- <li><a href="#t_classifications">Type Classifications</a></li>
- <li><a href="#t_primitive">Primitive Types</a>
- <ol>
- <li><a href="#t_floating">Floating Point Types</a></li>
- <li><a href="#t_void">Void Type</a></li>
- <li><a href="#t_label">Label Type</a></li>
- </ol>
- </li>
- <li><a href="#t_derived">Derived Types</a>
- <ol>
- <li><a href="#t_integer">Integer Type</a></li>
- <li><a href="#t_array">Array Type</a></li>
- <li><a href="#t_function">Function Type</a></li>
- <li><a href="#t_pointer">Pointer Type</a></li>
- <li><a href="#t_struct">Structure Type</a></li>
- <li><a href="#t_pstruct">Packed Structure Type</a></li>
- <li><a href="#t_vector">Vector Type</a></li>
- <li><a href="#t_opaque">Opaque Type</a></li>
- </ol>
- </li>
- </ol>
- </li>
- <li><a href="#constants">Constants</a>
- <ol>
- <li><a href="#simpleconstants">Simple Constants</a>
- <li><a href="#aggregateconstants">Aggregate Constants</a>
- <li><a href="#globalconstants">Global Variable and Function Addresses</a>
- <li><a href="#undefvalues">Undefined Values</a>
- <li><a href="#constantexprs">Constant Expressions</a>
- </ol>
- </li>
- <li><a href="#othervalues">Other Values</a>
- <ol>
- <li><a href="#inlineasm">Inline Assembler Expressions</a>
- </ol>
- </li>
- <li><a href="#instref">Instruction Reference</a>
- <ol>
- <li><a href="#terminators">Terminator Instructions</a>
- <ol>
- <li><a href="#i_ret">'<tt>ret</tt>' Instruction</a></li>
- <li><a href="#i_br">'<tt>br</tt>' Instruction</a></li>
- <li><a href="#i_switch">'<tt>switch</tt>' Instruction</a></li>
- <li><a href="#i_invoke">'<tt>invoke</tt>' Instruction</a></li>
- <li><a href="#i_unwind">'<tt>unwind</tt>' Instruction</a></li>
- <li><a href="#i_unreachable">'<tt>unreachable</tt>' Instruction</a></li>
- </ol>
- </li>
- <li><a href="#binaryops">Binary Operations</a>
- <ol>
- <li><a href="#i_add">'<tt>add</tt>' Instruction</a></li>
- <li><a href="#i_sub">'<tt>sub</tt>' Instruction</a></li>
- <li><a href="#i_mul">'<tt>mul</tt>' Instruction</a></li>
- <li><a href="#i_udiv">'<tt>udiv</tt>' Instruction</a></li>
- <li><a href="#i_sdiv">'<tt>sdiv</tt>' Instruction</a></li>
- <li><a href="#i_fdiv">'<tt>fdiv</tt>' Instruction</a></li>
- <li><a href="#i_urem">'<tt>urem</tt>' Instruction</a></li>
- <li><a href="#i_srem">'<tt>srem</tt>' Instruction</a></li>
- <li><a href="#i_frem">'<tt>frem</tt>' Instruction</a></li>
- </ol>
- </li>
- <li><a href="#bitwiseops">Bitwise Binary Operations</a>
- <ol>
- <li><a href="#i_shl">'<tt>shl</tt>' Instruction</a></li>
- <li><a href="#i_lshr">'<tt>lshr</tt>' Instruction</a></li>
- <li><a href="#i_ashr">'<tt>ashr</tt>' Instruction</a></li>
- <li><a href="#i_and">'<tt>and</tt>' Instruction</a></li>
- <li><a href="#i_or">'<tt>or</tt>' Instruction</a></li>
- <li><a href="#i_xor">'<tt>xor</tt>' Instruction</a></li>
- </ol>
- </li>
- <li><a href="#vectorops">Vector Operations</a>
- <ol>
- <li><a href="#i_extractelement">'<tt>extractelement</tt>' Instruction</a></li>
- <li><a href="#i_insertelement">'<tt>insertelement</tt>' Instruction</a></li>
- <li><a href="#i_shufflevector">'<tt>shufflevector</tt>' Instruction</a></li>
- </ol>
- </li>
- <li><a href="#memoryops">Memory Access and Addressing Operations</a>
- <ol>
- <li><a href="#i_malloc">'<tt>malloc</tt>' Instruction</a></li>
- <li><a href="#i_free">'<tt>free</tt>' Instruction</a></li>
- <li><a href="#i_alloca">'<tt>alloca</tt>' Instruction</a></li>
- <li><a href="#i_load">'<tt>load</tt>' Instruction</a></li>
- <li><a href="#i_store">'<tt>store</tt>' Instruction</a></li>
- <li><a href="#i_getelementptr">'<tt>getelementptr</tt>' Instruction</a></li>
- </ol>
- </li>
- <li><a href="#convertops">Conversion Operations</a>
- <ol>
- <li><a href="#i_trunc">'<tt>trunc .. to</tt>' Instruction</a></li>
- <li><a href="#i_zext">'<tt>zext .. to</tt>' Instruction</a></li>
- <li><a href="#i_sext">'<tt>sext .. to</tt>' Instruction</a></li>
- <li><a href="#i_fptrunc">'<tt>fptrunc .. to</tt>' Instruction</a></li>
- <li><a href="#i_fpext">'<tt>fpext .. to</tt>' Instruction</a></li>
- <li><a href="#i_fptoui">'<tt>fptoui .. to</tt>' Instruction</a></li>
- <li><a href="#i_fptosi">'<tt>fptosi .. to</tt>' Instruction</a></li>
- <li><a href="#i_uitofp">'<tt>uitofp .. to</tt>' Instruction</a></li>
- <li><a href="#i_sitofp">'<tt>sitofp .. to</tt>' Instruction</a></li>
- <li><a href="#i_ptrtoint">'<tt>ptrtoint .. to</tt>' Instruction</a></li>
- <li><a href="#i_inttoptr">'<tt>inttoptr .. to</tt>' Instruction</a></li>
- <li><a href="#i_bitcast">'<tt>bitcast .. to</tt>' Instruction</a></li>
- </ol>
- <li><a href="#otherops">Other Operations</a>
- <ol>
- <li><a href="#i_icmp">'<tt>icmp</tt>' Instruction</a></li>
- <li><a href="#i_fcmp">'<tt>fcmp</tt>' Instruction</a></li>
- <li><a href="#i_phi">'<tt>phi</tt>' Instruction</a></li>
- <li><a href="#i_select">'<tt>select</tt>' Instruction</a></li>
- <li><a href="#i_call">'<tt>call</tt>' Instruction</a></li>
- <li><a href="#i_va_arg">'<tt>va_arg</tt>' Instruction</a></li>
- <li><a href="#i_getresult">'<tt>getresult</tt>' Instruction</a></li>
- </ol>
- </li>
- </ol>
- </li>
- <li><a href="#intrinsics">Intrinsic Functions</a>
- <ol>
- <li><a href="#int_varargs">Variable Argument Handling Intrinsics</a>
- <ol>
- <li><a href="#int_va_start">'<tt>llvm.va_start</tt>' Intrinsic</a></li>
- <li><a href="#int_va_end">'<tt>llvm.va_end</tt>' Intrinsic</a></li>
- <li><a href="#int_va_copy">'<tt>llvm.va_copy</tt>' Intrinsic</a></li>
- </ol>
- </li>
- <li><a href="#int_gc">Accurate Garbage Collection Intrinsics</a>
- <ol>
- <li><a href="#int_gcroot">'<tt>llvm.gcroot</tt>' Intrinsic</a></li>
- <li><a href="#int_gcread">'<tt>llvm.gcread</tt>' Intrinsic</a></li>
- <li><a href="#int_gcwrite">'<tt>llvm.gcwrite</tt>' Intrinsic</a></li>
- </ol>
- </li>
- <li><a href="#int_codegen">Code Generator Intrinsics</a>
- <ol>
- <li><a href="#int_returnaddress">'<tt>llvm.returnaddress</tt>' Intrinsic</a></li>
- <li><a href="#int_frameaddress">'<tt>llvm.frameaddress</tt>' Intrinsic</a></li>
- <li><a href="#int_stacksave">'<tt>llvm.stacksave</tt>' Intrinsic</a></li>
- <li><a href="#int_stackrestore">'<tt>llvm.stackrestore</tt>' Intrinsic</a></li>
- <li><a href="#int_prefetch">'<tt>llvm.prefetch</tt>' Intrinsic</a></li>
- <li><a href="#int_pcmarker">'<tt>llvm.pcmarker</tt>' Intrinsic</a></li>
- <li><a href="#int_readcyclecounter"><tt>llvm.readcyclecounter</tt>' Intrinsic</a></li>
- </ol>
- </li>
- <li><a href="#int_libc">Standard C Library Intrinsics</a>
- <ol>
- <li><a href="#int_memcpy">'<tt>llvm.memcpy.*</tt>' Intrinsic</a></li>
- <li><a href="#int_memmove">'<tt>llvm.memmove.*</tt>' Intrinsic</a></li>
- <li><a href="#int_memset">'<tt>llvm.memset.*</tt>' Intrinsic</a></li>
- <li><a href="#int_sqrt">'<tt>llvm.sqrt.*</tt>' Intrinsic</a></li>
- <li><a href="#int_powi">'<tt>llvm.powi.*</tt>' Intrinsic</a></li>
- <li><a href="#int_sin">'<tt>llvm.sin.*</tt>' Intrinsic</a></li>
- <li><a href="#int_cos">'<tt>llvm.cos.*</tt>' Intrinsic</a></li>
- <li><a href="#int_pow">'<tt>llvm.pow.*</tt>' Intrinsic</a></li>
- </ol>
- </li>
- <li><a href="#int_manip">Bit Manipulation Intrinsics</a>
- <ol>
- <li><a href="#int_bswap">'<tt>llvm.bswap.*</tt>' Intrinsics</a></li>
- <li><a href="#int_ctpop">'<tt>llvm.ctpop.*</tt>' Intrinsic </a></li>
- <li><a href="#int_ctlz">'<tt>llvm.ctlz.*</tt>' Intrinsic </a></li>
- <li><a href="#int_cttz">'<tt>llvm.cttz.*</tt>' Intrinsic </a></li>
- <li><a href="#int_part_select">'<tt>llvm.part.select.*</tt>' Intrinsic </a></li>
- <li><a href="#int_part_set">'<tt>llvm.part.set.*</tt>' Intrinsic </a></li>
- </ol>
- </li>
- <li><a href="#int_debugger">Debugger intrinsics</a></li>
- <li><a href="#int_eh">Exception Handling intrinsics</a></li>
- <li><a href="#int_trampoline">Trampoline Intrinsic</a>
- <ol>
- <li><a href="#int_it">'<tt>llvm.init.trampoline</tt>' Intrinsic</a></li>
- </ol>
- </li>
- <li><a href="#int_atomics">Atomic intrinsics</a>
- <ol>
- <li><a href="#int_memory_barrier"><tt>llvm.memory_barrier</tt></a></li>
- <li><a href="#int_atomic_lcs"><tt>llvm.atomic.lcs</tt></a></li>
- <li><a href="#int_atomic_las"><tt>llvm.atomic.las</tt></a></li>
- <li><a href="#int_atomic_swap"><tt>llvm.atomic.swap</tt></a></li>
- </ol>
- </li>
- <li><a href="#int_general">General intrinsics</a>
- <ol>
- <li><a href="#int_var_annotation">
- <tt>llvm.var.annotation</tt>' Intrinsic</a></li>
- <li><a href="#int_annotation">
- <tt>llvm.annotation.*</tt>' Intrinsic</a></li>
- <li><a href="#int_trap">
- <tt>llvm.trap</tt>' Intrinsic</a></li>
- </ol>
- </li>
- </ol>
- </li>
-</ol>
-
-<div class="doc_author">
- <p>Written by <a href="mailto:sabre@nondot.org">Chris Lattner</a>
- and <a href="mailto:vadve@cs.uiuc.edu">Vikram Adve</a></p>
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section"> <a name="abstract">Abstract </a></div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-<p>This document is a reference manual for the LLVM assembly language.
-LLVM is an SSA based representation that provides type safety,
-low-level operations, flexibility, and the capability of representing
-'all' high-level languages cleanly. It is the common code
-representation used throughout all phases of the LLVM compilation
-strategy.</p>
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section"> <a name="introduction">Introduction</a> </div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>The LLVM code representation is designed to be used in three
-different forms: as an in-memory compiler IR, as an on-disk bitcode
-representation (suitable for fast loading by a Just-In-Time compiler),
-and as a human readable assembly language representation. This allows
-LLVM to provide a powerful intermediate representation for efficient
-compiler transformations and analysis, while providing a natural means
-to debug and visualize the transformations. The three different forms
-of LLVM are all equivalent. This document describes the human readable
-representation and notation.</p>
-
-<p>The LLVM representation aims to be light-weight and low-level
-while being expressive, typed, and extensible at the same time. It
-aims to be a "universal IR" of sorts, by being at a low enough level
-that high-level ideas may be cleanly mapped to it (similar to how
-microprocessors are "universal IR's", allowing many source languages to
-be mapped to them). By providing type information, LLVM can be used as
-the target of optimizations: for example, through pointer analysis, it
-can be proven that a C automatic variable is never accessed outside of
-the current function... allowing it to be promoted to a simple SSA
-value instead of a memory location.</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection"> <a name="wellformed">Well-Formedness</a> </div>
-
-<div class="doc_text">
-
-<p>It is important to note that this document describes 'well formed'
-LLVM assembly language. There is a difference between what the parser
-accepts and what is considered 'well formed'. For example, the
-following instruction is syntactically okay, but not well formed:</p>
-
-<div class="doc_code">
-<pre>
-%x = <a href="#i_add">add</a> i32 1, %x
-</pre>
-</div>
-
-<p>...because the definition of <tt>%x</tt> does not dominate all of
-its uses. The LLVM infrastructure provides a verification pass that may
-be used to verify that an LLVM module is well formed. This pass is
-automatically run by the parser after parsing input assembly and by
-the optimizer before it outputs bitcode. The violations pointed out
-by the verifier pass indicate bugs in transformation passes or input to
-the parser.</p>
-</div>
-
-<!-- Describe the typesetting conventions here. -->
-
-<!-- *********************************************************************** -->
-<div class="doc_section"> <a name="identifiers">Identifiers</a> </div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
- <p>LLVM identifiers come in two basic types: global and local. Global
- identifiers (functions, global variables) begin with the @ character. Local
- identifiers (register names, types) begin with the % character. Additionally,
- there are three different formats for identifiers, for different purposes:
-
-<ol>
- <li>Named values are represented as a string of characters with their prefix.
- For example, %foo, @DivisionByZero, %a.really.long.identifier. The actual
- regular expression used is '<tt>[%@][a-zA-Z$._][a-zA-Z$._0-9]*</tt>'.
- Identifiers which require other characters in their names can be surrounded
- with quotes. In this way, anything except a <tt>&quot;</tt> character can
- be used in a named value.</li>
-
- <li>Unnamed values are represented as an unsigned numeric value with their
- prefix. For example, %12, @2, %44.</li>
-
- <li>Constants, which are described in a <a href="#constants">section about
- constants</a>, below.</li>
-</ol>
-
-<p>LLVM requires that values start with a prefix for two reasons: Compilers
-don't need to worry about name clashes with reserved words, and the set of
-reserved words may be expanded in the future without penalty. Additionally,
-unnamed identifiers allow a compiler to quickly come up with a temporary
-variable without having to avoid symbol table conflicts.</p>
-
-<p>Reserved words in LLVM are very similar to reserved words in other
-languages. There are keywords for different opcodes
-('<tt><a href="#i_add">add</a></tt>',
- '<tt><a href="#i_bitcast">bitcast</a></tt>',
- '<tt><a href="#i_ret">ret</a></tt>', etc...), for primitive type names ('<tt><a
-href="#t_void">void</a></tt>', '<tt><a href="#t_primitive">i32</a></tt>', etc...),
-and others. These reserved words cannot conflict with variable names, because
-none of them start with a prefix character ('%' or '@').</p>
-
-<p>Here is an example of LLVM code to multiply the integer variable
-'<tt>%X</tt>' by 8:</p>
-
-<p>The easy way:</p>
-
-<div class="doc_code">
-<pre>
-%result = <a href="#i_mul">mul</a> i32 %X, 8
-</pre>
-</div>
-
-<p>After strength reduction:</p>
-
-<div class="doc_code">
-<pre>
-%result = <a href="#i_shl">shl</a> i32 %X, i8 3
-</pre>
-</div>
-
-<p>And the hard way:</p>
-
-<div class="doc_code">
-<pre>
-<a href="#i_add">add</a> i32 %X, %X <i>; yields {i32}:%0</i>
-<a href="#i_add">add</a> i32 %0, %0 <i>; yields {i32}:%1</i>
-%result = <a href="#i_add">add</a> i32 %1, %1
-</pre>
-</div>
-
-<p>This last way of multiplying <tt>%X</tt> by 8 illustrates several
-important lexical features of LLVM:</p>
-
-<ol>
-
- <li>Comments are delimited with a '<tt>;</tt>' and go until the end of
- line.</li>
-
- <li>Unnamed temporaries are created when the result of a computation is not
- assigned to a named value.</li>
-
- <li>Unnamed temporaries are numbered sequentially</li>
-
-</ol>
-
-<p>...and it also shows a convention that we follow in this document. When
-demonstrating instructions, we will follow an instruction with a comment that
-defines the type and name of value produced. Comments are shown in italic
-text.</p>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section"> <a name="highlevel">High Level Structure</a> </div>
-<!-- *********************************************************************** -->
-
-<!-- ======================================================================= -->
-<div class="doc_subsection"> <a name="modulestructure">Module Structure</a>
-</div>
-
-<div class="doc_text">
-
-<p>LLVM programs are composed of "Module"s, each of which is a
-translation unit of the input programs. Each module consists of
-functions, global variables, and symbol table entries. Modules may be
-combined together with the LLVM linker, which merges function (and
-global variable) definitions, resolves forward declarations, and merges
-symbol table entries. Here is an example of the "hello world" module:</p>
-
-<div class="doc_code">
-<pre><i>; Declare the string constant as a global constant...</i>
-<a href="#identifiers">@.LC0</a> = <a href="#linkage_internal">internal</a> <a
- href="#globalvars">constant</a> <a href="#t_array">[13 x i8]</a> c"hello world\0A\00" <i>; [13 x i8]*</i>
-
-<i>; External declaration of the puts function</i>
-<a href="#functionstructure">declare</a> i32 @puts(i8 *) <i>; i32(i8 *)* </i>
-
-<i>; Definition of main function</i>
-define i32 @main() { <i>; i32()* </i>
- <i>; Convert [13x i8 ]* to i8 *...</i>
- %cast210 = <a
- href="#i_getelementptr">getelementptr</a> [13 x i8 ]* @.LC0, i64 0, i64 0 <i>; i8 *</i>
-
- <i>; Call puts function to write out the string to stdout...</i>
- <a
- href="#i_call">call</a> i32 @puts(i8 * %cast210) <i>; i32</i>
- <a
- href="#i_ret">ret</a> i32 0<br>}<br>
-</pre>
-</div>
-
-<p>This example is made up of a <a href="#globalvars">global variable</a>
-named "<tt>.LC0</tt>", an external declaration of the "<tt>puts</tt>"
-function, and a <a href="#functionstructure">function definition</a>
-for "<tt>main</tt>".</p>
-
-<p>In general, a module is made up of a list of global values,
-where both functions and global variables are global values. Global values are
-represented by a pointer to a memory location (in this case, a pointer to an
-array of char, and a pointer to a function), and have one of the following <a
-href="#linkage">linkage types</a>.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="linkage">Linkage Types</a>
-</div>
-
-<div class="doc_text">
-
-<p>
-All Global Variables and Functions have one of the following types of linkage:
-</p>
-
-<dl>
-
- <dt><tt><b><a name="linkage_internal">internal</a></b></tt> </dt>
-
- <dd>Global values with internal linkage are only directly accessible by
- objects in the current module. In particular, linking code into a module with
- an internal global value may cause the internal to be renamed as necessary to
- avoid collisions. Because the symbol is internal to the module, all
- references can be updated. This corresponds to the notion of the
- '<tt>static</tt>' keyword in C.
- </dd>
-
- <dt><tt><b><a name="linkage_linkonce">linkonce</a></b></tt>: </dt>
-
- <dd>Globals with "<tt>linkonce</tt>" linkage are merged with other globals of
- the same name when linkage occurs. This is typically used to implement
- inline functions, templates, or other code which must be generated in each
- translation unit that uses it. Unreferenced <tt>linkonce</tt> globals are
- allowed to be discarded.
- </dd>
-
- <dt><tt><b><a name="linkage_weak">weak</a></b></tt>: </dt>
-
- <dd>"<tt>weak</tt>" linkage is exactly the same as <tt>linkonce</tt> linkage,
- except that unreferenced <tt>weak</tt> globals may not be discarded. This is
- used for globals that may be emitted in multiple translation units, but that
- are not guaranteed to be emitted into every translation unit that uses them.
- One example of this are common globals in C, such as "<tt>int X;</tt>" at
- global scope.
- </dd>
-
- <dt><tt><b><a name="linkage_appending">appending</a></b></tt>: </dt>
-
- <dd>"<tt>appending</tt>" linkage may only be applied to global variables of
- pointer to array type. When two global variables with appending linkage are
- linked together, the two global arrays are appended together. This is the
- LLVM, typesafe, equivalent of having the system linker append together
- "sections" with identical names when .o files are linked.
- </dd>
-
- <dt><tt><b><a name="linkage_externweak">extern_weak</a></b></tt>: </dt>
- <dd>The semantics of this linkage follow the ELF model: the symbol is weak
- until linked, if not linked, the symbol becomes null instead of being an
- undefined reference.
- </dd>
-
- <dt><tt><b><a name="linkage_external">externally visible</a></b></tt>:</dt>
-
- <dd>If none of the above identifiers are used, the global is externally
- visible, meaning that it participates in linkage and can be used to resolve
- external symbol references.
- </dd>
-</dl>
-
- <p>
- The next two types of linkage are targeted for Microsoft Windows platform
- only. They are designed to support importing (exporting) symbols from (to)
- DLLs.
- </p>
-
- <dl>
- <dt><tt><b><a name="linkage_dllimport">dllimport</a></b></tt>: </dt>
-
- <dd>"<tt>dllimport</tt>" linkage causes the compiler to reference a function
- or variable via a global pointer to a pointer that is set up by the DLL
- exporting the symbol. On Microsoft Windows targets, the pointer name is
- formed by combining <code>_imp__</code> and the function or variable name.
- </dd>
-
- <dt><tt><b><a name="linkage_dllexport">dllexport</a></b></tt>: </dt>
-
- <dd>"<tt>dllexport</tt>" linkage causes the compiler to provide a global
- pointer to a pointer in a DLL, so that it can be referenced with the
- <tt>dllimport</tt> attribute. On Microsoft Windows targets, the pointer
- name is formed by combining <code>_imp__</code> and the function or variable
- name.
- </dd>
-
-</dl>
-
-<p><a name="linkage_external"></a>For example, since the "<tt>.LC0</tt>"
-variable is defined to be internal, if another module defined a "<tt>.LC0</tt>"
-variable and was linked with this one, one of the two would be renamed,
-preventing a collision. Since "<tt>main</tt>" and "<tt>puts</tt>" are
-external (i.e., lacking any linkage declarations), they are accessible
-outside of the current module.</p>
-<p>It is illegal for a function <i>declaration</i>
-to have any linkage type other than "externally visible", <tt>dllimport</tt>,
-or <tt>extern_weak</tt>.</p>
-<p>Aliases can have only <tt>external</tt>, <tt>internal</tt> and <tt>weak</tt>
-linkages.
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="callingconv">Calling Conventions</a>
-</div>
-
-<div class="doc_text">
-
-<p>LLVM <a href="#functionstructure">functions</a>, <a href="#i_call">calls</a>
-and <a href="#i_invoke">invokes</a> can all have an optional calling convention
-specified for the call. The calling convention of any pair of dynamic
-caller/callee must match, or the behavior of the program is undefined. The
-following calling conventions are supported by LLVM, and more may be added in
-the future:</p>
-
-<dl>
- <dt><b>"<tt>ccc</tt>" - The C calling convention</b>:</dt>
-
- <dd>This calling convention (the default if no other calling convention is
- specified) matches the target C calling conventions. This calling convention
- supports varargs function calls and tolerates some mismatch in the declared
- prototype and implemented declaration of the function (as does normal C).
- </dd>
-
- <dt><b>"<tt>fastcc</tt>" - The fast calling convention</b>:</dt>
-
- <dd>This calling convention attempts to make calls as fast as possible
- (e.g. by passing things in registers). This calling convention allows the
- target to use whatever tricks it wants to produce fast code for the target,
- without having to conform to an externally specified ABI. Implementations of
- this convention should allow arbitrary
- <a href="CodeGenerator.html#tailcallopt">tail call optimization</a> to be
- supported. This calling convention does not support varargs and requires the
- prototype of all callees to exactly match the prototype of the function
- definition.
- </dd>
-
- <dt><b>"<tt>coldcc</tt>" - The cold calling convention</b>:</dt>
-
- <dd>This calling convention attempts to make code in the caller as efficient
- as possible under the assumption that the call is not commonly executed. As
- such, these calls often preserve all registers so that the call does not break
- any live ranges in the caller side. This calling convention does not support
- varargs and requires the prototype of all callees to exactly match the
- prototype of the function definition.
- </dd>
-
- <dt><b>"<tt>cc &lt;<em>n</em>&gt;</tt>" - Numbered convention</b>:</dt>
-
- <dd>Any calling convention may be specified by number, allowing
- target-specific calling conventions to be used. Target specific calling
- conventions start at 64.
- </dd>
-</dl>
-
-<p>More calling conventions can be added/defined on an as-needed basis, to
-support pascal conventions or any other well-known target-independent
-convention.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="visibility">Visibility Styles</a>
-</div>
-
-<div class="doc_text">
-
-<p>
-All Global Variables and Functions have one of the following visibility styles:
-</p>
-
-<dl>
- <dt><b>"<tt>default</tt>" - Default style</b>:</dt>
-
- <dd>On ELF, default visibility means that the declaration is visible to other
- modules and, in shared libraries, means that the declared entity may be
- overridden. On Darwin, default visibility means that the declaration is
- visible to other modules. Default visibility corresponds to "external
- linkage" in the language.
- </dd>
-
- <dt><b>"<tt>hidden</tt>" - Hidden style</b>:</dt>
-
- <dd>Two declarations of an object with hidden visibility refer to the same
- object if they are in the same shared object. Usually, hidden visibility
- indicates that the symbol will not be placed into the dynamic symbol table,
- so no other module (executable or shared library) can reference it
- directly.
- </dd>
-
- <dt><b>"<tt>protected</tt>" - Protected style</b>:</dt>
-
- <dd>On ELF, protected visibility indicates that the symbol will be placed in
- the dynamic symbol table, but that references within the defining module will
- bind to the local symbol. That is, the symbol cannot be overridden by another
- module.
- </dd>
-</dl>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="globalvars">Global Variables</a>
-</div>
-
-<div class="doc_text">
-
-<p>Global variables define regions of memory allocated at compilation time
-instead of run-time. Global variables may optionally be initialized, may have
-an explicit section to be placed in, and may have an optional explicit alignment
-specified. A variable may be defined as "thread_local", which means that it
-will not be shared by threads (each thread will have a separated copy of the
-variable). A variable may be defined as a global "constant," which indicates
-that the contents of the variable will <b>never</b> be modified (enabling better
-optimization, allowing the global data to be placed in the read-only section of
-an executable, etc). Note that variables that need runtime initialization
-cannot be marked "constant" as there is a store to the variable.</p>
-
-<p>
-LLVM explicitly allows <em>declarations</em> of global variables to be marked
-constant, even if the final definition of the global is not. This capability
-can be used to enable slightly better optimization of the program, but requires
-the language definition to guarantee that optimizations based on the
-'constantness' are valid for the translation units that do not include the
-definition.
-</p>
-
-<p>As SSA values, global variables define pointer values that are in
-scope (i.e. they dominate) all basic blocks in the program. Global
-variables always define a pointer to their "content" type because they
-describe a region of memory, and all memory objects in LLVM are
-accessed through pointers.</p>
-
-<p>A global variable may be declared to reside in a target-specifc numbered
-address space. For targets that support them, address spaces may affect how
-optimizations are performed and/or what target instructions are used to access
-the variable. The default address space is zero. The address space qualifier
-must precede any other attributes.</p>
-
-<p>LLVM allows an explicit section to be specified for globals. If the target
-supports it, it will emit globals to the section specified.</p>
-
-<p>An explicit alignment may be specified for a global. If not present, or if
-the alignment is set to zero, the alignment of the global is set by the target
-to whatever it feels convenient. If an explicit alignment is specified, the
-global is forced to have at least that much alignment. All alignments must be
-a power of 2.</p>
-
-<p>For example, the following defines a global in a numbered address space with
-an initializer, section, and alignment:</p>
-
-<div class="doc_code">
-<pre>
-@G = constant float 1.0 addrspace(5), section "foo", align 4
-</pre>
-</div>
-
-</div>
-
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="functionstructure">Functions</a>
-</div>
-
-<div class="doc_text">
-
-<p>LLVM function definitions consist of the "<tt>define</tt>" keyord,
-an optional <a href="#linkage">linkage type</a>, an optional
-<a href="#visibility">visibility style</a>, an optional
-<a href="#callingconv">calling convention</a>, a return type, an optional
-<a href="#paramattrs">parameter attribute</a> for the return type, a function
-name, a (possibly empty) argument list (each with optional
-<a href="#paramattrs">parameter attributes</a>), an optional section, an
-optional alignment, an optional <a href="#gc">garbage collector name</a>, an
-opening curly brace, a list of basic blocks, and a closing curly brace.
-
-LLVM function declarations consist of the "<tt>declare</tt>" keyword, an
-optional <a href="#linkage">linkage type</a>, an optional
-<a href="#visibility">visibility style</a>, an optional
-<a href="#callingconv">calling convention</a>, a return type, an optional
-<a href="#paramattrs">parameter attribute</a> for the return type, a function
-name, a possibly empty list of arguments, an optional alignment, and an optional
-<a href="#gc">garbage collector name</a>.</p>
-
-<p>A function definition contains a list of basic blocks, forming the CFG for
-the function. Each basic block may optionally start with a label (giving the
-basic block a symbol table entry), contains a list of instructions, and ends
-with a <a href="#terminators">terminator</a> instruction (such as a branch or
-function return).</p>
-
-<p>The first basic block in a function is special in two ways: it is immediately
-executed on entrance to the function, and it is not allowed to have predecessor
-basic blocks (i.e. there can not be any branches to the entry block of a
-function). Because the block can have no predecessors, it also cannot have any
-<a href="#i_phi">PHI nodes</a>.</p>
-
-<p>LLVM allows an explicit section to be specified for functions. If the target
-supports it, it will emit functions to the section specified.</p>
-
-<p>An explicit alignment may be specified for a function. If not present, or if
-the alignment is set to zero, the alignment of the function is set by the target
-to whatever it feels convenient. If an explicit alignment is specified, the
-function is forced to have at least that much alignment. All alignments must be
-a power of 2.</p>
-
-</div>
-
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="aliasstructure">Aliases</a>
-</div>
-<div class="doc_text">
- <p>Aliases act as "second name" for the aliasee value (which can be either
- function, global variable, another alias or bitcast of global value). Aliases
- may have an optional <a href="#linkage">linkage type</a>, and an
- optional <a href="#visibility">visibility style</a>.</p>
-
- <h5>Syntax:</h5>
-
-<div class="doc_code">
-<pre>
-@&lt;Name&gt; = [Linkage] [Visibility] alias &lt;AliaseeTy&gt; @&lt;Aliasee&gt;
-</pre>
-</div>
-
-</div>
-
-
-
-<!-- ======================================================================= -->
-<div class="doc_subsection"><a name="paramattrs">Parameter Attributes</a></div>
-<div class="doc_text">
- <p>The return type and each parameter of a function type may have a set of
- <i>parameter attributes</i> associated with them. Parameter attributes are
- used to communicate additional information about the result or parameters of
- a function. Parameter attributes are considered to be part of the function,
- not of the function type, so functions with different parameter attributes
- can have the same function type.</p>
-
- <p>Parameter attributes are simple keywords that follow the type specified. If
- multiple parameter attributes are needed, they are space separated. For
- example:</p>
-
-<div class="doc_code">
-<pre>
-declare i32 @printf(i8* noalias , ...) nounwind
-declare i32 @atoi(i8*) nounwind readonly
-</pre>
-</div>
-
- <p>Note that any attributes for the function result (<tt>nounwind</tt>,
- <tt>readonly</tt>) come immediately after the argument list.</p>
-
- <p>Currently, only the following parameter attributes are defined:</p>
- <dl>
- <dt><tt>zeroext</tt></dt>
- <dd>This indicates that the parameter should be zero extended just before
- a call to this function.</dd>
-
- <dt><tt>signext</tt></dt>
- <dd>This indicates that the parameter should be sign extended just before
- a call to this function.</dd>
-
- <dt><tt>inreg</tt></dt>
- <dd>This indicates that the parameter should be placed in register (if
- possible) during assembling function call. Support for this attribute is
- target-specific</dd>
-
- <dt><tt>byval</tt></dt>
- <dd>This indicates that the pointer parameter should really be passed by
- value to the function. The attribute implies that a hidden copy of the
- pointee is made between the caller and the callee, so the callee is unable
- to modify the value in the callee. This attribute is only valid on llvm
- pointer arguments. It is generally used to pass structs and arrays by
- value, but is also valid on scalars (even though this is silly).</dd>
-
- <dt><tt>sret</tt></dt>
- <dd>This indicates that the pointer parameter specifies the address of a
- structure that is the return value of the function in the source program.
- Loads and stores to the structure are assumed not to trap.
- May only be applied to the first parameter.</dd>
-
- <dt><tt>noalias</tt></dt>
- <dd>This indicates that the parameter does not alias any global or any other
- parameter. The caller is responsible for ensuring that this is the case,
- usually by placing the value in a stack allocation.</dd>
-
- <dt><tt>noreturn</tt></dt>
- <dd>This function attribute indicates that the function never returns. This
- indicates to LLVM that every call to this function should be treated as if
- an <tt>unreachable</tt> instruction immediately followed the call.</dd>
-
- <dt><tt>nounwind</tt></dt>
- <dd>This function attribute indicates that no exceptions unwind out of the
- function. Usually this is because the function makes no use of exceptions,
- but it may also be that the function catches any exceptions thrown when
- executing it.</dd>
-
- <dt><tt>nest</tt></dt>
- <dd>This indicates that the parameter can be excised using the
- <a href="#int_trampoline">trampoline intrinsics</a>.</dd>
- <dt><tt>readonly</tt></dt>
- <dd>This function attribute indicates that the function has no side-effects
- except for producing a return value or throwing an exception. The value
- returned must only depend on the function arguments and/or global variables.
- It may use values obtained by dereferencing pointers.</dd>
- <dt><tt>readnone</tt></dt>
- <dd>A <tt>readnone</tt> function has the same restrictions as a <tt>readonly</tt>
- function, but in addition it is not allowed to dereference any pointer arguments
- or global variables.
- </dl>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="gc">Garbage Collector Names</a>
-</div>
-
-<div class="doc_text">
-<p>Each function may specify a garbage collector name, which is simply a
-string.</p>
-
-<div class="doc_code"><pre
->define void @f() gc "name" { ...</pre></div>
-
-<p>The compiler declares the supported values of <i>name</i>. Specifying a
-collector which will cause the compiler to alter its output in order to support
-the named garbage collection algorithm.</p>
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="moduleasm">Module-Level Inline Assembly</a>
-</div>
-
-<div class="doc_text">
-<p>
-Modules may contain "module-level inline asm" blocks, which corresponds to the
-GCC "file scope inline asm" blocks. These blocks are internally concatenated by
-LLVM and treated as a single unit, but may be separated in the .ll file if
-desired. The syntax is very simple:
-</p>
-
-<div class="doc_code">
-<pre>
-module asm "inline asm code goes here"
-module asm "more can go here"
-</pre>
-</div>
-
-<p>The strings can contain any character by escaping non-printable characters.
- The escape sequence used is simply "\xx" where "xx" is the two digit hex code
- for the number.
-</p>
-
-<p>
- The inline asm code is simply printed to the machine code .s file when
- assembly code is generated.
-</p>
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="datalayout">Data Layout</a>
-</div>
-
-<div class="doc_text">
-<p>A module may specify a target specific data layout string that specifies how
-data is to be laid out in memory. The syntax for the data layout is simply:</p>
-<pre> target datalayout = "<i>layout specification</i>"</pre>
-<p>The <i>layout specification</i> consists of a list of specifications
-separated by the minus sign character ('-'). Each specification starts with a
-letter and may include other information after the letter to define some
-aspect of the data layout. The specifications accepted are as follows: </p>
-<dl>
- <dt><tt>E</tt></dt>
- <dd>Specifies that the target lays out data in big-endian form. That is, the
- bits with the most significance have the lowest address location.</dd>
- <dt><tt>e</tt></dt>
- <dd>Specifies that hte target lays out data in little-endian form. That is,
- the bits with the least significance have the lowest address location.</dd>
- <dt><tt>p:<i>size</i>:<i>abi</i>:<i>pref</i></tt></dt>
- <dd>This specifies the <i>size</i> of a pointer and its <i>abi</i> and
- <i>preferred</i> alignments. All sizes are in bits. Specifying the <i>pref</i>
- alignment is optional. If omitted, the preceding <tt>:</tt> should be omitted
- too.</dd>
- <dt><tt>i<i>size</i>:<i>abi</i>:<i>pref</i></tt></dt>
- <dd>This specifies the alignment for an integer type of a given bit
- <i>size</i>. The value of <i>size</i> must be in the range [1,2^23).</dd>
- <dt><tt>v<i>size</i>:<i>abi</i>:<i>pref</i></tt></dt>
- <dd>This specifies the alignment for a vector type of a given bit
- <i>size</i>.</dd>
- <dt><tt>f<i>size</i>:<i>abi</i>:<i>pref</i></tt></dt>
- <dd>This specifies the alignment for a floating point type of a given bit
- <i>size</i>. The value of <i>size</i> must be either 32 (float) or 64
- (double).</dd>
- <dt><tt>a<i>size</i>:<i>abi</i>:<i>pref</i></tt></dt>
- <dd>This specifies the alignment for an aggregate type of a given bit
- <i>size</i>.</dd>
-</dl>
-<p>When constructing the data layout for a given target, LLVM starts with a
-default set of specifications which are then (possibly) overriden by the
-specifications in the <tt>datalayout</tt> keyword. The default specifications
-are given in this list:</p>
-<ul>
- <li><tt>E</tt> - big endian</li>
- <li><tt>p:32:64:64</tt> - 32-bit pointers with 64-bit alignment</li>
- <li><tt>i1:8:8</tt> - i1 is 8-bit (byte) aligned</li>
- <li><tt>i8:8:8</tt> - i8 is 8-bit (byte) aligned</li>
- <li><tt>i16:16:16</tt> - i16 is 16-bit aligned</li>
- <li><tt>i32:32:32</tt> - i32 is 32-bit aligned</li>
- <li><tt>i64:32:64</tt> - i64 has abi alignment of 32-bits but preferred
- alignment of 64-bits</li>
- <li><tt>f32:32:32</tt> - float is 32-bit aligned</li>
- <li><tt>f64:64:64</tt> - double is 64-bit aligned</li>
- <li><tt>v64:64:64</tt> - 64-bit vector is 64-bit aligned</li>
- <li><tt>v128:128:128</tt> - 128-bit vector is 128-bit aligned</li>
- <li><tt>a0:0:1</tt> - aggregates are 8-bit aligned</li>
-</ul>
-<p>When llvm is determining the alignment for a given type, it uses the
-following rules:
-<ol>
- <li>If the type sought is an exact match for one of the specifications, that
- specification is used.</li>
- <li>If no match is found, and the type sought is an integer type, then the
- smallest integer type that is larger than the bitwidth of the sought type is
- used. If none of the specifications are larger than the bitwidth then the the
- largest integer type is used. For example, given the default specifications
- above, the i7 type will use the alignment of i8 (next largest) while both
- i65 and i256 will use the alignment of i64 (largest specified).</li>
- <li>If no match is found, and the type sought is a vector type, then the
- largest vector type that is smaller than the sought vector type will be used
- as a fall back. This happens because <128 x double> can be implemented in
- terms of 64 <2 x double>, for example.</li>
-</ol>
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section"> <a name="typesystem">Type System</a> </div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>The LLVM type system is one of the most important features of the
-intermediate representation. Being typed enables a number of
-optimizations to be performed on the IR directly, without having to do
-extra analyses on the side before the transformation. A strong type
-system makes it easier to read the generated code and enables novel
-analyses and transformations that are not feasible to perform on normal
-three address code representations.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection"> <a name="t_classifications">Type
-Classifications</a> </div>
-<div class="doc_text">
-<p>The types fall into a few useful
-classifications:</p>
-
-<table border="1" cellspacing="0" cellpadding="4">
- <tbody>
- <tr><th>Classification</th><th>Types</th></tr>
- <tr>
- <td><a href="#t_integer">integer</a></td>
- <td><tt>i1, i2, i3, ... i8, ... i16, ... i32, ... i64, ... </tt></td>
- </tr>
- <tr>
- <td><a href="#t_floating">floating point</a></td>
- <td><tt>float, double, x86_fp80, fp128, ppc_fp128</tt></td>
- </tr>
- <tr>
- <td><a name="t_firstclass">first class</a></td>
- <td><a href="#t_integer">integer</a>,
- <a href="#t_floating">floating point</a>,
- <a href="#t_pointer">pointer</a>,
- <a href="#t_vector">vector</a>
- </td>
- </tr>
- <tr>
- <td><a href="#t_primitive">primitive</a></td>
- <td><a href="#t_label">label</a>,
- <a href="#t_void">void</a>,
- <a href="#t_integer">integer</a>,
- <a href="#t_floating">floating point</a>.</td>
- </tr>
- <tr>
- <td><a href="#t_derived">derived</a></td>
- <td><a href="#t_integer">integer</a>,
- <a href="#t_array">array</a>,
- <a href="#t_function">function</a>,
- <a href="#t_pointer">pointer</a>,
- <a href="#t_struct">structure</a>,
- <a href="#t_pstruct">packed structure</a>,
- <a href="#t_vector">vector</a>,
- <a href="#t_opaque">opaque</a>.
- </tr>
- </tbody>
-</table>
-
-<p>The <a href="#t_firstclass">first class</a> types are perhaps the
-most important. Values of these types are the only ones which can be
-produced by instructions, passed as arguments, or used as operands to
-instructions. This means that all structures and arrays must be
-manipulated either by pointer or by component.</p>
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection"> <a name="t_primitive">Primitive Types</a> </div>
-
-<div class="doc_text">
-<p>The primitive types are the fundamental building blocks of the LLVM
-system.</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection"> <a name="t_floating">Floating Point Types</a> </div>
-
-<div class="doc_text">
- <table>
- <tbody>
- <tr><th>Type</th><th>Description</th></tr>
- <tr><td><tt>float</tt></td><td>32-bit floating point value</td></tr>
- <tr><td><tt>double</tt></td><td>64-bit floating point value</td></tr>
- <tr><td><tt>fp128</tt></td><td>128-bit floating point value (112-bit mantissa)</td></tr>
- <tr><td><tt>x86_fp80</tt></td><td>80-bit floating point value (X87)</td></tr>
- <tr><td><tt>ppc_fp128</tt></td><td>128-bit floating point value (two 64-bits)</td></tr>
- </tbody>
- </table>
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection"> <a name="t_void">Void Type</a> </div>
-
-<div class="doc_text">
-<h5>Overview:</h5>
-<p>The void type does not represent any value and has no size.</p>
-
-<h5>Syntax:</h5>
-
-<pre>
- void
-</pre>
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection"> <a name="t_label">Label Type</a> </div>
-
-<div class="doc_text">
-<h5>Overview:</h5>
-<p>The label type represents code labels.</p>
-
-<h5>Syntax:</h5>
-
-<pre>
- label
-</pre>
-</div>
-
-
-<!-- ======================================================================= -->
-<div class="doc_subsection"> <a name="t_derived">Derived Types</a> </div>
-
-<div class="doc_text">
-
-<p>The real power in LLVM comes from the derived types in the system.
-This is what allows a programmer to represent arrays, functions,
-pointers, and other useful types. Note that these derived types may be
-recursive: For example, it is possible to have a two dimensional array.</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection"> <a name="t_integer">Integer Type</a> </div>
-
-<div class="doc_text">
-
-<h5>Overview:</h5>
-<p>The integer type is a very simple derived type that simply specifies an
-arbitrary bit width for the integer type desired. Any bit width from 1 bit to
-2^23-1 (about 8 million) can be specified.</p>
-
-<h5>Syntax:</h5>
-
-<pre>
- iN
-</pre>
-
-<p>The number of bits the integer will occupy is specified by the <tt>N</tt>
-value.</p>
-
-<h5>Examples:</h5>
-<table class="layout">
- <tbody>
- <tr>
- <td><tt>i1</tt></td>
- <td>a single-bit integer.</td>
- </tr><tr>
- <td><tt>i32</tt></td>
- <td>a 32-bit integer.</td>
- </tr><tr>
- <td><tt>i1942652</tt></td>
- <td>a really big integer of over 1 million bits.</td>
- </tr>
- </tbody>
-</table>
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection"> <a name="t_array">Array Type</a> </div>
-
-<div class="doc_text">
-
-<h5>Overview:</h5>
-
-<p>The array type is a very simple derived type that arranges elements
-sequentially in memory. The array type requires a size (number of
-elements) and an underlying data type.</p>
-
-<h5>Syntax:</h5>
-
-<pre>
- [&lt;# elements&gt; x &lt;elementtype&gt;]
-</pre>
-
-<p>The number of elements is a constant integer value; elementtype may
-be any type with a size.</p>
-
-<h5>Examples:</h5>
-<table class="layout">
- <tr class="layout">
- <td class="left"><tt>[40 x i32]</tt></td>
- <td class="left">Array of 40 32-bit integer values.</td>
- </tr>
- <tr class="layout">
- <td class="left"><tt>[41 x i32]</tt></td>
- <td class="left">Array of 41 32-bit integer values.</td>
- </tr>
- <tr class="layout">
- <td class="left"><tt>[4 x i8]</tt></td>
- <td class="left">Array of 4 8-bit integer values.</td>
- </tr>
-</table>
-<p>Here are some examples of multidimensional arrays:</p>
-<table class="layout">
- <tr class="layout">
- <td class="left"><tt>[3 x [4 x i32]]</tt></td>
- <td class="left">3x4 array of 32-bit integer values.</td>
- </tr>
- <tr class="layout">
- <td class="left"><tt>[12 x [10 x float]]</tt></td>
- <td class="left">12x10 array of single precision floating point values.</td>
- </tr>
- <tr class="layout">
- <td class="left"><tt>[2 x [3 x [4 x i16]]]</tt></td>
- <td class="left">2x3x4 array of 16-bit integer values.</td>
- </tr>
-</table>
-
-<p>Note that 'variable sized arrays' can be implemented in LLVM with a zero
-length array. Normally, accesses past the end of an array are undefined in
-LLVM (e.g. it is illegal to access the 5th element of a 3 element array).
-As a special case, however, zero length arrays are recognized to be variable
-length. This allows implementation of 'pascal style arrays' with the LLVM
-type "{ i32, [0 x float]}", for example.</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection"> <a name="t_function">Function Type</a> </div>
-<div class="doc_text">
-
-<h5>Overview:</h5>
-
-<p>The function type can be thought of as a function signature. It
-consists of a return type and a list of formal parameter types. The
-return type of a function type is a scalar type, a void type, or a struct type.
-If the return type is a struct type then all struct elements must be of first
-class types, and the struct must have at least one element.</p>
-
-<h5>Syntax:</h5>
-
-<pre>
- &lt;returntype list&gt; (&lt;parameter list&gt;)
-</pre>
-
-<p>...where '<tt>&lt;parameter list&gt;</tt>' is a comma-separated list of type
-specifiers. Optionally, the parameter list may include a type <tt>...</tt>,
-which indicates that the function takes a variable number of arguments.
-Variable argument functions can access their arguments with the <a
- href="#int_varargs">variable argument handling intrinsic</a> functions.
-'<tt>&lt;returntype list&gt;</tt>' is a comma-separated list of
-<a href="#t_firstclass">first class</a> type specifiers.</p>
-
-<h5>Examples:</h5>
-<table class="layout">
- <tr class="layout">
- <td class="left"><tt>i32 (i32)</tt></td>
- <td class="left">function taking an <tt>i32</tt>, returning an <tt>i32</tt>
- </td>
- </tr><tr class="layout">
- <td class="left"><tt>float&nbsp;(i16&nbsp;signext,&nbsp;i32&nbsp;*)&nbsp;*
- </tt></td>
- <td class="left"><a href="#t_pointer">Pointer</a> to a function that takes
- an <tt>i16</tt> that should be sign extended and a
- <a href="#t_pointer">pointer</a> to <tt>i32</tt>, returning
- <tt>float</tt>.
- </td>
- </tr><tr class="layout">
- <td class="left"><tt>i32 (i8*, ...)</tt></td>
- <td class="left">A vararg function that takes at least one
- <a href="#t_pointer">pointer</a> to <tt>i8 </tt> (char in C),
- which returns an integer. This is the signature for <tt>printf</tt> in
- LLVM.
- </td>
- </tr><tr class="layout">
- <td class="left"><tt>{i32, i32} (i32)</tt></td>
- <td class="left">A function taking an <tt>i32></tt>, returning two
- <tt> i32 </tt> values as an aggregate of type <tt>{ i32, i32 }</tt>
- </td>
- </tr>
-</table>
-
-</div>
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection"> <a name="t_struct">Structure Type</a> </div>
-<div class="doc_text">
-<h5>Overview:</h5>
-<p>The structure type is used to represent a collection of data members
-together in memory. The packing of the field types is defined to match
-the ABI of the underlying processor. The elements of a structure may
-be any type that has a size.</p>
-<p>Structures are accessed using '<tt><a href="#i_load">load</a></tt>
-and '<tt><a href="#i_store">store</a></tt>' by getting a pointer to a
-field with the '<tt><a href="#i_getelementptr">getelementptr</a></tt>'
-instruction.</p>
-<h5>Syntax:</h5>
-<pre> { &lt;type list&gt; }<br></pre>
-<h5>Examples:</h5>
-<table class="layout">
- <tr class="layout">
- <td class="left"><tt>{ i32, i32, i32 }</tt></td>
- <td class="left">A triple of three <tt>i32</tt> values</td>
- </tr><tr class="layout">
- <td class="left"><tt>{&nbsp;float,&nbsp;i32&nbsp;(i32)&nbsp;*&nbsp;}</tt></td>
- <td class="left">A pair, where the first element is a <tt>float</tt> and the
- second element is a <a href="#t_pointer">pointer</a> to a
- <a href="#t_function">function</a> that takes an <tt>i32</tt>, returning
- an <tt>i32</tt>.</td>
- </tr>
-</table>
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection"> <a name="t_pstruct">Packed Structure Type</a>
-</div>
-<div class="doc_text">
-<h5>Overview:</h5>
-<p>The packed structure type is used to represent a collection of data members
-together in memory. There is no padding between fields. Further, the alignment
-of a packed structure is 1 byte. The elements of a packed structure may
-be any type that has a size.</p>
-<p>Structures are accessed using '<tt><a href="#i_load">load</a></tt>
-and '<tt><a href="#i_store">store</a></tt>' by getting a pointer to a
-field with the '<tt><a href="#i_getelementptr">getelementptr</a></tt>'
-instruction.</p>
-<h5>Syntax:</h5>
-<pre> &lt; { &lt;type list&gt; } &gt; <br></pre>
-<h5>Examples:</h5>
-<table class="layout">
- <tr class="layout">
- <td class="left"><tt>&lt; { i32, i32, i32 } &gt;</tt></td>
- <td class="left">A triple of three <tt>i32</tt> values</td>
- </tr><tr class="layout">
- <td class="left"><tt>&lt; { float, i32 (i32)* } &gt;</tt></td>
- <td class="left">A pair, where the first element is a <tt>float</tt> and the
- second element is a <a href="#t_pointer">pointer</a> to a
- <a href="#t_function">function</a> that takes an <tt>i32</tt>, returning
- an <tt>i32</tt>.</td>
- </tr>
-</table>
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection"> <a name="t_pointer">Pointer Type</a> </div>
-<div class="doc_text">
-<h5>Overview:</h5>
-<p>As in many languages, the pointer type represents a pointer or
-reference to another object, which must live in memory. Pointer types may have
-an optional address space attribute defining the target-specific numbered
-address space where the pointed-to object resides. The default address space is
-zero.</p>
-<h5>Syntax:</h5>
-<pre> &lt;type&gt; *<br></pre>
-<h5>Examples:</h5>
-<table class="layout">
- <tr class="layout">
- <td class="left"><tt>[4x i32]*</tt></td>
- <td class="left">A <a href="#t_pointer">pointer</a> to <a
- href="#t_array">array</a> of four <tt>i32</tt> values.</td>
- </tr>
- <tr class="layout">
- <td class="left"><tt>i32 (i32 *) *</tt></td>
- <td class="left"> A <a href="#t_pointer">pointer</a> to a <a
- href="#t_function">function</a> that takes an <tt>i32*</tt>, returning an
- <tt>i32</tt>.</td>
- </tr>
- <tr class="layout">
- <td class="left"><tt>i32 addrspace(5)*</tt></td>
- <td class="left">A <a href="#t_pointer">pointer</a> to an <tt>i32</tt> value
- that resides in address space #5.</td>
- </tr>
-</table>
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection"> <a name="t_vector">Vector Type</a> </div>
-<div class="doc_text">
-
-<h5>Overview:</h5>
-
-<p>A vector type is a simple derived type that represents a vector
-of elements. Vector types are used when multiple primitive data
-are operated in parallel using a single instruction (SIMD).
-A vector type requires a size (number of
-elements) and an underlying primitive data type. Vectors must have a power
-of two length (1, 2, 4, 8, 16 ...). Vector types are
-considered <a href="#t_firstclass">first class</a>.</p>
-
-<h5>Syntax:</h5>
-
-<pre>
- &lt; &lt;# elements&gt; x &lt;elementtype&gt; &gt;
-</pre>
-
-<p>The number of elements is a constant integer value; elementtype may
-be any integer or floating point type.</p>
-
-<h5>Examples:</h5>
-
-<table class="layout">
- <tr class="layout">
- <td class="left"><tt>&lt;4 x i32&gt;</tt></td>
- <td class="left">Vector of 4 32-bit integer values.</td>
- </tr>
- <tr class="layout">
- <td class="left"><tt>&lt;8 x float&gt;</tt></td>
- <td class="left">Vector of 8 32-bit floating-point values.</td>
- </tr>
- <tr class="layout">
- <td class="left"><tt>&lt;2 x i64&gt;</tt></td>
- <td class="left">Vector of 2 64-bit integer values.</td>
- </tr>
-</table>
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection"> <a name="t_opaque">Opaque Type</a> </div>
-<div class="doc_text">
-
-<h5>Overview:</h5>
-
-<p>Opaque types are used to represent unknown types in the system. This
-corresponds (for example) to the C notion of a forward declared structure type.
-In LLVM, opaque types can eventually be resolved to any type (not just a
-structure type).</p>
-
-<h5>Syntax:</h5>
-
-<pre>
- opaque
-</pre>
-
-<h5>Examples:</h5>
-
-<table class="layout">
- <tr class="layout">
- <td class="left"><tt>opaque</tt></td>
- <td class="left">An opaque type.</td>
- </tr>
-</table>
-</div>
-
-
-<!-- *********************************************************************** -->
-<div class="doc_section"> <a name="constants">Constants</a> </div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>LLVM has several different basic types of constants. This section describes
-them all and their syntax.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection"><a name="simpleconstants">Simple Constants</a></div>
-
-<div class="doc_text">
-
-<dl>
- <dt><b>Boolean constants</b></dt>
-
- <dd>The two strings '<tt>true</tt>' and '<tt>false</tt>' are both valid
- constants of the <tt><a href="#t_primitive">i1</a></tt> type.
- </dd>
-
- <dt><b>Integer constants</b></dt>
-
- <dd>Standard integers (such as '4') are constants of the <a
- href="#t_integer">integer</a> type. Negative numbers may be used with
- integer types.
- </dd>
-
- <dt><b>Floating point constants</b></dt>
-
- <dd>Floating point constants use standard decimal notation (e.g. 123.421),
- exponential notation (e.g. 1.23421e+2), or a more precise hexadecimal
- notation (see below). The assembler requires the exact decimal value of
- a floating-point constant. For example, the assembler accepts 1.25 but
- rejects 1.3 because 1.3 is a repeating decimal in binary. Floating point
- constants must have a <a href="#t_floating">floating point</a> type. </dd>
-
- <dt><b>Null pointer constants</b></dt>
-
- <dd>The identifier '<tt>null</tt>' is recognized as a null pointer constant
- and must be of <a href="#t_pointer">pointer type</a>.</dd>
-
-</dl>
-
-<p>The one non-intuitive notation for constants is the optional hexadecimal form
-of floating point constants. For example, the form '<tt>double
-0x432ff973cafa8000</tt>' is equivalent to (but harder to read than) '<tt>double
-4.5e+15</tt>'. The only time hexadecimal floating point constants are required
-(and the only time that they are generated by the disassembler) is when a
-floating point constant must be emitted but it cannot be represented as a
-decimal floating point number. For example, NaN's, infinities, and other
-special values are represented in their IEEE hexadecimal format so that
-assembly and disassembly do not cause any bits to change in the constants.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection"><a name="aggregateconstants">Aggregate Constants</a>
-</div>
-
-<div class="doc_text">
-<p>Aggregate constants arise from aggregation of simple constants
-and smaller aggregate constants.</p>
-
-<dl>
- <dt><b>Structure constants</b></dt>
-
- <dd>Structure constants are represented with notation similar to structure
- type definitions (a comma separated list of elements, surrounded by braces
- (<tt>{}</tt>)). For example: "<tt>{ i32 4, float 17.0, i32* @G }</tt>",
- where "<tt>@G</tt>" is declared as "<tt>@G = external global i32</tt>". Structure constants
- must have <a href="#t_struct">structure type</a>, and the number and
- types of elements must match those specified by the type.
- </dd>
-
- <dt><b>Array constants</b></dt>
-
- <dd>Array constants are represented with notation similar to array type
- definitions (a comma separated list of elements, surrounded by square brackets
- (<tt>[]</tt>)). For example: "<tt>[ i32 42, i32 11, i32 74 ]</tt>". Array
- constants must have <a href="#t_array">array type</a>, and the number and
- types of elements must match those specified by the type.
- </dd>
-
- <dt><b>Vector constants</b></dt>
-
- <dd>Vector constants are represented with notation similar to vector type
- definitions (a comma separated list of elements, surrounded by
- less-than/greater-than's (<tt>&lt;&gt;</tt>)). For example: "<tt>&lt; i32 42,
- i32 11, i32 74, i32 100 &gt;</tt>". Vector constants must have <a
- href="#t_vector">vector type</a>, and the number and types of elements must
- match those specified by the type.
- </dd>
-
- <dt><b>Zero initialization</b></dt>
-
- <dd>The string '<tt>zeroinitializer</tt>' can be used to zero initialize a
- value to zero of <em>any</em> type, including scalar and aggregate types.
- This is often used to avoid having to print large zero initializers (e.g. for
- large arrays) and is always exactly equivalent to using explicit zero
- initializers.
- </dd>
-</dl>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="globalconstants">Global Variable and Function Addresses</a>
-</div>
-
-<div class="doc_text">
-
-<p>The addresses of <a href="#globalvars">global variables</a> and <a
-href="#functionstructure">functions</a> are always implicitly valid (link-time)
-constants. These constants are explicitly referenced when the <a
-href="#identifiers">identifier for the global</a> is used and always have <a
-href="#t_pointer">pointer</a> type. For example, the following is a legal LLVM
-file:</p>
-
-<div class="doc_code">
-<pre>
-@X = global i32 17
-@Y = global i32 42
-@Z = global [2 x i32*] [ i32* @X, i32* @Y ]
-</pre>
-</div>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection"><a name="undefvalues">Undefined Values</a></div>
-<div class="doc_text">
- <p>The string '<tt>undef</tt>' is recognized as a type-less constant that has
- no specific value. Undefined values may be of any type and be used anywhere
- a constant is permitted.</p>
-
- <p>Undefined values indicate to the compiler that the program is well defined
- no matter what value is used, giving the compiler more freedom to optimize.
- </p>
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection"><a name="constantexprs">Constant Expressions</a>
-</div>
-
-<div class="doc_text">
-
-<p>Constant expressions are used to allow expressions involving other constants
-to be used as constants. Constant expressions may be of any <a
-href="#t_firstclass">first class</a> type and may involve any LLVM operation
-that does not have side effects (e.g. load and call are not supported). The
-following is the syntax for constant expressions:</p>
-
-<dl>
- <dt><b><tt>trunc ( CST to TYPE )</tt></b></dt>
- <dd>Truncate a constant to another type. The bit size of CST must be larger
- than the bit size of TYPE. Both types must be integers.</dd>
-
- <dt><b><tt>zext ( CST to TYPE )</tt></b></dt>
- <dd>Zero extend a constant to another type. The bit size of CST must be
- smaller or equal to the bit size of TYPE. Both types must be integers.</dd>
-
- <dt><b><tt>sext ( CST to TYPE )</tt></b></dt>
- <dd>Sign extend a constant to another type. The bit size of CST must be
- smaller or equal to the bit size of TYPE. Both types must be integers.</dd>
-
- <dt><b><tt>fptrunc ( CST to TYPE )</tt></b></dt>
- <dd>Truncate a floating point constant to another floating point type. The
- size of CST must be larger than the size of TYPE. Both types must be
- floating point.</dd>
-
- <dt><b><tt>fpext ( CST to TYPE )</tt></b></dt>
- <dd>Floating point extend a constant to another type. The size of CST must be
- smaller or equal to the size of TYPE. Both types must be floating point.</dd>
-
- <dt><b><tt>fptoui ( CST to TYPE )</tt></b></dt>
- <dd>Convert a floating point constant to the corresponding unsigned integer
- constant. TYPE must be a scalar or vector integer type. CST must be of scalar
- or vector floating point type. Both CST and TYPE must be scalars, or vectors
- of the same number of elements. If the value won't fit in the integer type,
- the results are undefined.</dd>
-
- <dt><b><tt>fptosi ( CST to TYPE )</tt></b></dt>
- <dd>Convert a floating point constant to the corresponding signed integer
- constant. TYPE must be a scalar or vector integer type. CST must be of scalar
- or vector floating point type. Both CST and TYPE must be scalars, or vectors
- of the same number of elements. If the value won't fit in the integer type,
- the results are undefined.</dd>
-
- <dt><b><tt>uitofp ( CST to TYPE )</tt></b></dt>
- <dd>Convert an unsigned integer constant to the corresponding floating point
- constant. TYPE must be a scalar or vector floating point type. CST must be of
- scalar or vector integer type. Both CST and TYPE must be scalars, or vectors
- of the same number of elements. If the value won't fit in the floating point
- type, the results are undefined.</dd>
-
- <dt><b><tt>sitofp ( CST to TYPE )</tt></b></dt>
- <dd>Convert a signed integer constant to the corresponding floating point
- constant. TYPE must be a scalar or vector floating point type. CST must be of
- scalar or vector integer type. Both CST and TYPE must be scalars, or vectors
- of the same number of elements. If the value won't fit in the floating point
- type, the results are undefined.</dd>
-
- <dt><b><tt>ptrtoint ( CST to TYPE )</tt></b></dt>
- <dd>Convert a pointer typed constant to the corresponding integer constant
- TYPE must be an integer type. CST must be of pointer type. The CST value is
- zero extended, truncated, or unchanged to make it fit in TYPE.</dd>
-
- <dt><b><tt>inttoptr ( CST to TYPE )</tt></b></dt>
- <dd>Convert a integer constant to a pointer constant. TYPE must be a
- pointer type. CST must be of integer type. The CST value is zero extended,
- truncated, or unchanged to make it fit in a pointer size. This one is
- <i>really</i> dangerous!</dd>
-
- <dt><b><tt>bitcast ( CST to TYPE )</tt></b></dt>
- <dd>Convert a constant, CST, to another TYPE. The size of CST and TYPE must be
- identical (same number of bits). The conversion is done as if the CST value
- was stored to memory and read back as TYPE. In other words, no bits change
- with this operator, just the type. This can be used for conversion of
- vector types to any other type, as long as they have the same bit width. For
- pointers it is only valid to cast to another pointer type.
- </dd>
-
- <dt><b><tt>getelementptr ( CSTPTR, IDX0, IDX1, ... )</tt></b></dt>
-
- <dd>Perform the <a href="#i_getelementptr">getelementptr operation</a> on
- constants. As with the <a href="#i_getelementptr">getelementptr</a>
- instruction, the index list may have zero or more indexes, which are required
- to make sense for the type of "CSTPTR".</dd>
-
- <dt><b><tt>select ( COND, VAL1, VAL2 )</tt></b></dt>
-
- <dd>Perform the <a href="#i_select">select operation</a> on
- constants.</dd>
-
- <dt><b><tt>icmp COND ( VAL1, VAL2 )</tt></b></dt>
- <dd>Performs the <a href="#i_icmp">icmp operation</a> on constants.</dd>
-
- <dt><b><tt>fcmp COND ( VAL1, VAL2 )</tt></b></dt>
- <dd>Performs the <a href="#i_fcmp">fcmp operation</a> on constants.</dd>
-
- <dt><b><tt>extractelement ( VAL, IDX )</tt></b></dt>
-
- <dd>Perform the <a href="#i_extractelement">extractelement
- operation</a> on constants.
-
- <dt><b><tt>insertelement ( VAL, ELT, IDX )</tt></b></dt>
-
- <dd>Perform the <a href="#i_insertelement">insertelement
- operation</a> on constants.</dd>
-
-
- <dt><b><tt>shufflevector ( VEC1, VEC2, IDXMASK )</tt></b></dt>
-
- <dd>Perform the <a href="#i_shufflevector">shufflevector
- operation</a> on constants.</dd>
-
- <dt><b><tt>OPCODE ( LHS, RHS )</tt></b></dt>
-
- <dd>Perform the specified operation of the LHS and RHS constants. OPCODE may
- be any of the <a href="#binaryops">binary</a> or <a href="#bitwiseops">bitwise
- binary</a> operations. The constraints on operands are the same as those for
- the corresponding instruction (e.g. no bitwise operations on floating point
- values are allowed).</dd>
-</dl>
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section"> <a name="othervalues">Other Values</a> </div>
-<!-- *********************************************************************** -->
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
-<a name="inlineasm">Inline Assembler Expressions</a>
-</div>
-
-<div class="doc_text">
-
-<p>
-LLVM supports inline assembler expressions (as opposed to <a href="#moduleasm">
-Module-Level Inline Assembly</a>) through the use of a special value. This
-value represents the inline assembler as a string (containing the instructions
-to emit), a list of operand constraints (stored as a string), and a flag that
-indicates whether or not the inline asm expression has side effects. An example
-inline assembler expression is:
-</p>
-
-<div class="doc_code">
-<pre>
-i32 (i32) asm "bswap $0", "=r,r"
-</pre>
-</div>
-
-<p>
-Inline assembler expressions may <b>only</b> be used as the callee operand of
-a <a href="#i_call"><tt>call</tt> instruction</a>. Thus, typically we have:
-</p>
-
-<div class="doc_code">
-<pre>
-%X = call i32 asm "<a href="#int_bswap">bswap</a> $0", "=r,r"(i32 %Y)
-</pre>
-</div>
-
-<p>
-Inline asms with side effects not visible in the constraint list must be marked
-as having side effects. This is done through the use of the
-'<tt>sideeffect</tt>' keyword, like so:
-</p>
-
-<div class="doc_code">
-<pre>
-call void asm sideeffect "eieio", ""()
-</pre>
-</div>
-
-<p>TODO: The format of the asm and constraints string still need to be
-documented here. Constraints on what can be done (e.g. duplication, moving, etc
-need to be documented).
-</p>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section"> <a name="instref">Instruction Reference</a> </div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>The LLVM instruction set consists of several different
-classifications of instructions: <a href="#terminators">terminator
-instructions</a>, <a href="#binaryops">binary instructions</a>,
-<a href="#bitwiseops">bitwise binary instructions</a>, <a
- href="#memoryops">memory instructions</a>, and <a href="#otherops">other
-instructions</a>.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection"> <a name="terminators">Terminator
-Instructions</a> </div>
-
-<div class="doc_text">
-
-<p>As mentioned <a href="#functionstructure">previously</a>, every
-basic block in a program ends with a "Terminator" instruction, which
-indicates which block should be executed after the current block is
-finished. These terminator instructions typically yield a '<tt>void</tt>'
-value: they produce control flow, not values (the one exception being
-the '<a href="#i_invoke"><tt>invoke</tt></a>' instruction).</p>
-<p>There are six different terminator instructions: the '<a
- href="#i_ret"><tt>ret</tt></a>' instruction, the '<a href="#i_br"><tt>br</tt></a>'
-instruction, the '<a href="#i_switch"><tt>switch</tt></a>' instruction,
-the '<a href="#i_invoke"><tt>invoke</tt></a>' instruction, the '<a
- href="#i_unwind"><tt>unwind</tt></a>' instruction, and the '<a
- href="#i_unreachable"><tt>unreachable</tt></a>' instruction.</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection"> <a name="i_ret">'<tt>ret</tt>'
-Instruction</a> </div>
-<div class="doc_text">
-<h5>Syntax:</h5>
-<pre> ret &lt;type&gt; &lt;value&gt; <i>; Return a value from a non-void function</i>
- ret void <i>; Return from void function</i>
- ret &lt;type&gt; &lt;value&gt;, &lt;type&gt; &lt;value&gt; <i>; Return two values from a non-void function </i>
-</pre>
-
-<h5>Overview:</h5>
-
-<p>The '<tt>ret</tt>' instruction is used to return control flow (and a
-value) from a function back to the caller.</p>
-<p>There are two forms of the '<tt>ret</tt>' instruction: one that
-returns value(s) and then causes control flow, and one that just causes
-control flow to occur.</p>
-
-<h5>Arguments:</h5>
-
-<p>The '<tt>ret</tt>' instruction may return zero, one or multiple values.
-The type of each return value must be a '<a href="#t_firstclass">first
-class</a>' type. Note that a function is not <a href="#wellformed">well
-formed</a> if there exists a '<tt>ret</tt>' instruction inside of the
-function that returns values that do not match the return type of the
-function.</p>
-
-<h5>Semantics:</h5>
-
-<p>When the '<tt>ret</tt>' instruction is executed, control flow
-returns back to the calling function's context. If the caller is a "<a
- href="#i_call"><tt>call</tt></a>" instruction, execution continues at
-the instruction after the call. If the caller was an "<a
- href="#i_invoke"><tt>invoke</tt></a>" instruction, execution continues
-at the beginning of the "normal" destination block. If the instruction
-returns a value, that value shall set the call or invoke instruction's
-return value. If the instruction returns multiple values then these
-values can only be accessed through a '<a href="#i_getresult"><tt>getresult</tt>
-</a>' instruction.</p>
-
-<h5>Example:</h5>
-
-<pre>
- ret i32 5 <i>; Return an integer value of 5</i>
- ret void <i>; Return from a void function</i>
- ret i32 4, i8 2 <i>; Return two values 4 and 2 </i>
-</pre>
-</div>
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection"> <a name="i_br">'<tt>br</tt>' Instruction</a> </div>
-<div class="doc_text">
-<h5>Syntax:</h5>
-<pre> br i1 &lt;cond&gt;, label &lt;iftrue&gt;, label &lt;iffalse&gt;<br> br label &lt;dest&gt; <i>; Unconditional branch</i>
-</pre>
-<h5>Overview:</h5>
-<p>The '<tt>br</tt>' instruction is used to cause control flow to
-transfer to a different basic block in the current function. There are
-two forms of this instruction, corresponding to a conditional branch
-and an unconditional branch.</p>
-<h5>Arguments:</h5>
-<p>The conditional branch form of the '<tt>br</tt>' instruction takes a
-single '<tt>i1</tt>' value and two '<tt>label</tt>' values. The
-unconditional form of the '<tt>br</tt>' instruction takes a single
-'<tt>label</tt>' value as a target.</p>
-<h5>Semantics:</h5>
-<p>Upon execution of a conditional '<tt>br</tt>' instruction, the '<tt>i1</tt>'
-argument is evaluated. If the value is <tt>true</tt>, control flows
-to the '<tt>iftrue</tt>' <tt>label</tt> argument. If "cond" is <tt>false</tt>,
-control flows to the '<tt>iffalse</tt>' <tt>label</tt> argument.</p>
-<h5>Example:</h5>
-<pre>Test:<br> %cond = <a href="#i_icmp">icmp</a> eq, i32 %a, %b<br> br i1 %cond, label %IfEqual, label %IfUnequal<br>IfEqual:<br> <a
- href="#i_ret">ret</a> i32 1<br>IfUnequal:<br> <a href="#i_ret">ret</a> i32 0<br></pre>
-</div>
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="i_switch">'<tt>switch</tt>' Instruction</a>
-</div>
-
-<div class="doc_text">
-<h5>Syntax:</h5>
-
-<pre>
- switch &lt;intty&gt; &lt;value&gt;, label &lt;defaultdest&gt; [ &lt;intty&gt; &lt;val&gt;, label &lt;dest&gt; ... ]
-</pre>
-
-<h5>Overview:</h5>
-
-<p>The '<tt>switch</tt>' instruction is used to transfer control flow to one of
-several different places. It is a generalization of the '<tt>br</tt>'
-instruction, allowing a branch to occur to one of many possible
-destinations.</p>
-
-
-<h5>Arguments:</h5>
-
-<p>The '<tt>switch</tt>' instruction uses three parameters: an integer
-comparison value '<tt>value</tt>', a default '<tt>label</tt>' destination, and
-an array of pairs of comparison value constants and '<tt>label</tt>'s. The
-table is not allowed to contain duplicate constant entries.</p>
-
-<h5>Semantics:</h5>
-
-<p>The <tt>switch</tt> instruction specifies a table of values and
-destinations. When the '<tt>switch</tt>' instruction is executed, this
-table is searched for the given value. If the value is found, control flow is
-transfered to the corresponding destination; otherwise, control flow is
-transfered to the default destination.</p>
-
-<h5>Implementation:</h5>
-
-<p>Depending on properties of the target machine and the particular
-<tt>switch</tt> instruction, this instruction may be code generated in different
-ways. For example, it could be generated as a series of chained conditional
-branches or with a lookup table.</p>
-
-<h5>Example:</h5>
-
-<pre>
- <i>; Emulate a conditional br instruction</i>
- %Val = <a href="#i_zext">zext</a> i1 %value to i32
- switch i32 %Val, label %truedest [i32 0, label %falsedest ]
-
- <i>; Emulate an unconditional br instruction</i>
- switch i32 0, label %dest [ ]
-
- <i>; Implement a jump table:</i>
- switch i32 %val, label %otherwise [ i32 0, label %onzero
- i32 1, label %onone
- i32 2, label %ontwo ]
-</pre>
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="i_invoke">'<tt>invoke</tt>' Instruction</a>
-</div>
-
-<div class="doc_text">
-
-<h5>Syntax:</h5>
-
-<pre>
- &lt;result&gt; = invoke [<a href="#callingconv">cconv</a>] &lt;ptr to function ty&gt; &lt;function ptr val&gt;(&lt;function args&gt;)
- to label &lt;normal label&gt; unwind label &lt;exception label&gt;
-</pre>
-
-<h5>Overview:</h5>
-
-<p>The '<tt>invoke</tt>' instruction causes control to transfer to a specified
-function, with the possibility of control flow transfer to either the
-'<tt>normal</tt>' label or the
-'<tt>exception</tt>' label. If the callee function returns with the
-"<tt><a href="#i_ret">ret</a></tt>" instruction, control flow will return to the
-"normal" label. If the callee (or any indirect callees) returns with the "<a
-href="#i_unwind"><tt>unwind</tt></a>" instruction, control is interrupted and
-continued at the dynamically nearest "exception" label. If the callee function
-returns multiple values then individual return values are only accessible through
-a '<tt><a href="#i_getresult">getresult</a></tt>' instruction.</p>
-
-<h5>Arguments:</h5>
-
-<p>This instruction requires several arguments:</p>
-
-<ol>
- <li>
- The optional "cconv" marker indicates which <a href="#callingconv">calling
- convention</a> the call should use. If none is specified, the call defaults
- to using C calling conventions.
- </li>
- <li>'<tt>ptr to function ty</tt>': shall be the signature of the pointer to
- function value being invoked. In most cases, this is a direct function
- invocation, but indirect <tt>invoke</tt>s are just as possible, branching off
- an arbitrary pointer to function value.
- </li>
-
- <li>'<tt>function ptr val</tt>': An LLVM value containing a pointer to a
- function to be invoked. </li>
-
- <li>'<tt>function args</tt>': argument list whose types match the function
- signature argument types. If the function signature indicates the function
- accepts a variable number of arguments, the extra arguments can be
- specified. </li>
-
- <li>'<tt>normal label</tt>': the label reached when the called function
- executes a '<tt><a href="#i_ret">ret</a></tt>' instruction. </li>
-
- <li>'<tt>exception label</tt>': the label reached when a callee returns with
- the <a href="#i_unwind"><tt>unwind</tt></a> instruction. </li>
-
-</ol>
-
-<h5>Semantics:</h5>
-
-<p>This instruction is designed to operate as a standard '<tt><a
-href="#i_call">call</a></tt>' instruction in most regards. The primary
-difference is that it establishes an association with a label, which is used by
-the runtime library to unwind the stack.</p>
-
-<p>This instruction is used in languages with destructors to ensure that proper
-cleanup is performed in the case of either a <tt>longjmp</tt> or a thrown
-exception. Additionally, this is important for implementation of
-'<tt>catch</tt>' clauses in high-level languages that support them.</p>
-
-<h5>Example:</h5>
-<pre>
- %retval = invoke i32 @Test(i32 15) to label %Continue
- unwind label %TestCleanup <i>; {i32}:retval set</i>
- %retval = invoke <a href="#callingconv">coldcc</a> i32 %Testfnptr(i32 15) to label %Continue
- unwind label %TestCleanup <i>; {i32}:retval set</i>
-</pre>
-</div>
-
-
-<!-- _______________________________________________________________________ -->
-
-<div class="doc_subsubsection"> <a name="i_unwind">'<tt>unwind</tt>'
-Instruction</a> </div>
-
-<div class="doc_text">
-
-<h5>Syntax:</h5>
-<pre>
- unwind
-</pre>
-
-<h5>Overview:</h5>
-
-<p>The '<tt>unwind</tt>' instruction unwinds the stack, continuing control flow
-at the first callee in the dynamic call stack which used an <a
-href="#i_invoke"><tt>invoke</tt></a> instruction to perform the call. This is
-primarily used to implement exception handling.</p>
-
-<h5>Semantics:</h5>
-
-<p>The '<tt>unwind</tt>' instruction causes execution of the current function to
-immediately halt. The dynamic call stack is then searched for the first <a
-href="#i_invoke"><tt>invoke</tt></a> instruction on the call stack. Once found,
-execution continues at the "exceptional" destination block specified by the
-<tt>invoke</tt> instruction. If there is no <tt>invoke</tt> instruction in the
-dynamic call chain, undefined behavior results.</p>
-</div>
-
-<!-- _______________________________________________________________________ -->
-
-<div class="doc_subsubsection"> <a name="i_unreachable">'<tt>unreachable</tt>'
-Instruction</a> </div>
-
-<div class="doc_text">
-
-<h5>Syntax:</h5>
-<pre>
- unreachable
-</pre>
-
-<h5>Overview:</h5>
-
-<p>The '<tt>unreachable</tt>' instruction has no defined semantics. This
-instruction is used to inform the optimizer that a particular portion of the
-code is not reachable. This can be used to indicate that the code after a
-no-return function cannot be reached, and other facts.</p>
-
-<h5>Semantics:</h5>
-
-<p>The '<tt>unreachable</tt>' instruction has no defined semantics.</p>
-</div>
-
-
-
-<!-- ======================================================================= -->
-<div class="doc_subsection"> <a name="binaryops">Binary Operations</a> </div>
-<div class="doc_text">
-<p>Binary operators are used to do most of the computation in a
-program. They require two operands of the same type, execute an operation on them, and
-produce a single value. The operands might represent
-multiple data, as is the case with the <a href="#t_vector">vector</a> data type.
-The result value has the same type as its operands.</p>
-<p>There are several different binary operators:</p>
-</div>
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection"> <a name="i_add">'<tt>add</tt>'
-Instruction</a> </div>
-<div class="doc_text">
-<h5>Syntax:</h5>
-<pre> &lt;result&gt; = add &lt;ty&gt; &lt;var1&gt;, &lt;var2&gt; <i>; yields {ty}:result</i>
-</pre>
-<h5>Overview:</h5>
-<p>The '<tt>add</tt>' instruction returns the sum of its two operands.</p>
-<h5>Arguments:</h5>
-<p>The two arguments to the '<tt>add</tt>' instruction must be either <a
- href="#t_integer">integer</a> or <a href="#t_floating">floating point</a> values.
- This instruction can also take <a href="#t_vector">vector</a> versions of the values.
-Both arguments must have identical types.</p>
-<h5>Semantics:</h5>
-<p>The value produced is the integer or floating point sum of the two
-operands.</p>
-<p>If an integer sum has unsigned overflow, the result returned is the
-mathematical result modulo 2<sup>n</sup>, where n is the bit width of
-the result.</p>
-<p>Because LLVM integers use a two's complement representation, this
-instruction is appropriate for both signed and unsigned integers.</p>
-<h5>Example:</h5>
-<pre> &lt;result&gt; = add i32 4, %var <i>; yields {i32}:result = 4 + %var</i>
-</pre>
-</div>
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection"> <a name="i_sub">'<tt>sub</tt>'
-Instruction</a> </div>
-<div class="doc_text">
-<h5>Syntax:</h5>
-<pre> &lt;result&gt; = sub &lt;ty&gt; &lt;var1&gt;, &lt;var2&gt; <i>; yields {ty}:result</i>
-</pre>
-<h5>Overview:</h5>
-<p>The '<tt>sub</tt>' instruction returns the difference of its two
-operands.</p>
-<p>Note that the '<tt>sub</tt>' instruction is used to represent the '<tt>neg</tt>'
-instruction present in most other intermediate representations.</p>
-<h5>Arguments:</h5>
-<p>The two arguments to the '<tt>sub</tt>' instruction must be either <a
- href="#t_integer">integer</a> or <a href="#t_floating">floating point</a>
-values.
-This instruction can also take <a href="#t_vector">vector</a> versions of the values.
-Both arguments must have identical types.</p>
-<h5>Semantics:</h5>
-<p>The value produced is the integer or floating point difference of
-the two operands.</p>
-<p>If an integer difference has unsigned overflow, the result returned is the
-mathematical result modulo 2<sup>n</sup>, where n is the bit width of
-the result.</p>
-<p>Because LLVM integers use a two's complement representation, this
-instruction is appropriate for both signed and unsigned integers.</p>
-<h5>Example:</h5>
-<pre>
- &lt;result&gt; = sub i32 4, %var <i>; yields {i32}:result = 4 - %var</i>
- &lt;result&gt; = sub i32 0, %val <i>; yields {i32}:result = -%var</i>
-</pre>
-</div>
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection"> <a name="i_mul">'<tt>mul</tt>'
-Instruction</a> </div>
-<div class="doc_text">
-<h5>Syntax:</h5>
-<pre> &lt;result&gt; = mul &lt;ty&gt; &lt;var1&gt;, &lt;var2&gt; <i>; yields {ty}:result</i>
-</pre>
-<h5>Overview:</h5>
-<p>The '<tt>mul</tt>' instruction returns the product of its two
-operands.</p>
-<h5>Arguments:</h5>
-<p>The two arguments to the '<tt>mul</tt>' instruction must be either <a
- href="#t_integer">integer</a> or <a href="#t_floating">floating point</a>
-values.
-This instruction can also take <a href="#t_vector">vector</a> versions of the values.
-Both arguments must have identical types.</p>
-<h5>Semantics:</h5>
-<p>The value produced is the integer or floating point product of the
-two operands.</p>
-<p>If the result of an integer multiplication has unsigned overflow,
-the result returned is the mathematical result modulo
-2<sup>n</sup>, where n is the bit width of the result.</p>
-<p>Because LLVM integers use a two's complement representation, and the
-result is the same width as the operands, this instruction returns the
-correct result for both signed and unsigned integers. If a full product
-(e.g. <tt>i32</tt>x<tt>i32</tt>-><tt>i64</tt>) is needed, the operands
-should be sign-extended or zero-extended as appropriate to the
-width of the full product.</p>
-<h5>Example:</h5>
-<pre> &lt;result&gt; = mul i32 4, %var <i>; yields {i32}:result = 4 * %var</i>
-</pre>
-</div>
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection"> <a name="i_udiv">'<tt>udiv</tt>' Instruction
-</a></div>
-<div class="doc_text">
-<h5>Syntax:</h5>
-<pre> &lt;result&gt; = udiv &lt;ty&gt; &lt;var1&gt;, &lt;var2&gt; <i>; yields {ty}:result</i>
-</pre>
-<h5>Overview:</h5>
-<p>The '<tt>udiv</tt>' instruction returns the quotient of its two
-operands.</p>
-<h5>Arguments:</h5>
-<p>The two arguments to the '<tt>udiv</tt>' instruction must be
-<a href="#t_integer">integer</a> values. Both arguments must have identical
-types. This instruction can also take <a href="#t_vector">vector</a> versions
-of the values in which case the elements must be integers.</p>
-<h5>Semantics:</h5>
-<p>The value produced is the unsigned integer quotient of the two operands.</p>
-<p>Note that unsigned integer division and signed integer division are distinct
-operations; for signed integer division, use '<tt>sdiv</tt>'.</p>
-<p>Division by zero leads to undefined behavior.</p>
-<h5>Example:</h5>
-<pre> &lt;result&gt; = udiv i32 4, %var <i>; yields {i32}:result = 4 / %var</i>
-</pre>
-</div>
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection"> <a name="i_sdiv">'<tt>sdiv</tt>' Instruction
-</a> </div>
-<div class="doc_text">
-<h5>Syntax:</h5>
-<pre> &lt;result&gt; = sdiv &lt;ty&gt; &lt;var1&gt;, &lt;var2&gt; <i>; yields {ty}:result</i>
-</pre>
-<h5>Overview:</h5>
-<p>The '<tt>sdiv</tt>' instruction returns the quotient of its two
-operands.</p>
-<h5>Arguments:</h5>
-<p>The two arguments to the '<tt>sdiv</tt>' instruction must be
-<a href="#t_integer">integer</a> values. Both arguments must have identical
-types. This instruction can also take <a href="#t_vector">vector</a> versions
-of the values in which case the elements must be integers.</p>
-<h5>Semantics:</h5>
-<p>The value produced is the signed integer quotient of the two operands rounded towards zero.</p>
-<p>Note that signed integer division and unsigned integer division are distinct
-operations; for unsigned integer division, use '<tt>udiv</tt>'.</p>
-<p>Division by zero leads to undefined behavior. Overflow also leads to
-undefined behavior; this is a rare case, but can occur, for example,
-by doing a 32-bit division of -2147483648 by -1.</p>
-<h5>Example:</h5>
-<pre> &lt;result&gt; = sdiv i32 4, %var <i>; yields {i32}:result = 4 / %var</i>
-</pre>
-</div>
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection"> <a name="i_fdiv">'<tt>fdiv</tt>'
-Instruction</a> </div>
-<div class="doc_text">
-<h5>Syntax:</h5>
-<pre> &lt;result&gt; = fdiv &lt;ty&gt; &lt;var1&gt;, &lt;var2&gt; <i>; yields {ty}:result</i>
-</pre>
-<h5>Overview:</h5>
-<p>The '<tt>fdiv</tt>' instruction returns the quotient of its two
-operands.</p>
-<h5>Arguments:</h5>
-<p>The two arguments to the '<tt>fdiv</tt>' instruction must be
-<a href="#t_floating">floating point</a> values. Both arguments must have
-identical types. This instruction can also take <a href="#t_vector">vector</a>
-versions of floating point values.</p>
-<h5>Semantics:</h5>
-<p>The value produced is the floating point quotient of the two operands.</p>
-<h5>Example:</h5>
-<pre> &lt;result&gt; = fdiv float 4.0, %var <i>; yields {float}:result = 4.0 / %var</i>
-</pre>
-</div>
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection"> <a name="i_urem">'<tt>urem</tt>' Instruction</a>
-</div>
-<div class="doc_text">
-<h5>Syntax:</h5>
-<pre> &lt;result&gt; = urem &lt;ty&gt; &lt;var1&gt;, &lt;var2&gt; <i>; yields {ty}:result</i>
-</pre>
-<h5>Overview:</h5>
-<p>The '<tt>urem</tt>' instruction returns the remainder from the
-unsigned division of its two arguments.</p>
-<h5>Arguments:</h5>
-<p>The two arguments to the '<tt>urem</tt>' instruction must be
-<a href="#t_integer">integer</a> values. Both arguments must have identical
-types. This instruction can also take <a href="#t_vector">vector</a> versions
-of the values in which case the elements must be integers.</p>
-<h5>Semantics:</h5>
-<p>This instruction returns the unsigned integer <i>remainder</i> of a division.
-This instruction always performs an unsigned division to get the remainder.</p>
-<p>Note that unsigned integer remainder and signed integer remainder are
-distinct operations; for signed integer remainder, use '<tt>srem</tt>'.</p>
-<p>Taking the remainder of a division by zero leads to undefined behavior.</p>
-<h5>Example:</h5>
-<pre> &lt;result&gt; = urem i32 4, %var <i>; yields {i32}:result = 4 % %var</i>
-</pre>
-
-</div>
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection"> <a name="i_srem">'<tt>srem</tt>'
-Instruction</a> </div>
-<div class="doc_text">
-<h5>Syntax:</h5>
-<pre> &lt;result&gt; = srem &lt;ty&gt; &lt;var1&gt;, &lt;var2&gt; <i>; yields {ty}:result</i>
-</pre>
-<h5>Overview:</h5>
-<p>The '<tt>srem</tt>' instruction returns the remainder from the
-signed division of its two operands. This instruction can also take
-<a href="#t_vector">vector</a> versions of the values in which case
-the elements must be integers.</p>
-
-<h5>Arguments:</h5>
-<p>The two arguments to the '<tt>srem</tt>' instruction must be
-<a href="#t_integer">integer</a> values. Both arguments must have identical
-types.</p>
-<h5>Semantics:</h5>
-<p>This instruction returns the <i>remainder</i> of a division (where the result
-has the same sign as the dividend, <tt>var1</tt>), not the <i>modulo</i>
-operator (where the result has the same sign as the divisor, <tt>var2</tt>) of
-a value. For more information about the difference, see <a
- href="http://mathforum.org/dr.math/problems/anne.4.28.99.html">The
-Math Forum</a>. For a table of how this is implemented in various languages,
-please see <a href="http://en.wikipedia.org/wiki/Modulo_operation">
-Wikipedia: modulo operation</a>.</p>
-<p>Note that signed integer remainder and unsigned integer remainder are
-distinct operations; for unsigned integer remainder, use '<tt>urem</tt>'.</p>
-<p>Taking the remainder of a division by zero leads to undefined behavior.
-Overflow also leads to undefined behavior; this is a rare case, but can occur,
-for example, by taking the remainder of a 32-bit division of -2147483648 by -1.
-(The remainder doesn't actually overflow, but this rule lets srem be
-implemented using instructions that return both the result of the division
-and the remainder.)</p>
-<h5>Example:</h5>
-<pre> &lt;result&gt; = srem i32 4, %var <i>; yields {i32}:result = 4 % %var</i>
-</pre>
-
-</div>
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection"> <a name="i_frem">'<tt>frem</tt>'
-Instruction</a> </div>
-<div class="doc_text">
-<h5>Syntax:</h5>
-<pre> &lt;result&gt; = frem &lt;ty&gt; &lt;var1&gt;, &lt;var2&gt; <i>; yields {ty}:result</i>
-</pre>
-<h5>Overview:</h5>
-<p>The '<tt>frem</tt>' instruction returns the remainder from the
-division of its two operands.</p>
-<h5>Arguments:</h5>
-<p>The two arguments to the '<tt>frem</tt>' instruction must be
-<a href="#t_floating">floating point</a> values. Both arguments must have
-identical types. This instruction can also take <a href="#t_vector">vector</a>
-versions of floating point values.</p>
-<h5>Semantics:</h5>
-<p>This instruction returns the <i>remainder</i> of a division.
-The remainder has the same sign as the dividend.</p>
-<h5>Example:</h5>
-<pre> &lt;result&gt; = frem float 4.0, %var <i>; yields {float}:result = 4.0 % %var</i>
-</pre>
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection"> <a name="bitwiseops">Bitwise Binary
-Operations</a> </div>
-<div class="doc_text">
-<p>Bitwise binary operators are used to do various forms of
-bit-twiddling in a program. They are generally very efficient
-instructions and can commonly be strength reduced from other
-instructions. They require two operands of the same type, execute an operation on them,
-and produce a single value. The resulting value is the same type as its operands.</p>
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection"> <a name="i_shl">'<tt>shl</tt>'
-Instruction</a> </div>
-<div class="doc_text">
-<h5>Syntax:</h5>
-<pre> &lt;result&gt; = shl &lt;ty&gt; &lt;var1&gt;, &lt;var2&gt; <i>; yields {ty}:result</i>
-</pre>
-
-<h5>Overview:</h5>
-
-<p>The '<tt>shl</tt>' instruction returns the first operand shifted to
-the left a specified number of bits.</p>
-
-<h5>Arguments:</h5>
-
-<p>Both arguments to the '<tt>shl</tt>' instruction must be the same <a
- href="#t_integer">integer</a> type. '<tt>var2</tt>' is treated as an
-unsigned value.</p>
-
-<h5>Semantics:</h5>
-
-<p>The value produced is <tt>var1</tt> * 2<sup><tt>var2</tt></sup> mod 2<sup>n</sup>,
-where n is the width of the result. If <tt>var2</tt> is (statically or dynamically) negative or
-equal to or larger than the number of bits in <tt>var1</tt>, the result is undefined.</p>
-
-<h5>Example:</h5><pre>
- &lt;result&gt; = shl i32 4, %var <i>; yields {i32}: 4 &lt;&lt; %var</i>
- &lt;result&gt; = shl i32 4, 2 <i>; yields {i32}: 16</i>
- &lt;result&gt; = shl i32 1, 10 <i>; yields {i32}: 1024</i>
- &lt;result&gt; = shl i32 1, 32 <i>; undefined</i>
-</pre>
-</div>
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection"> <a name="i_lshr">'<tt>lshr</tt>'
-Instruction</a> </div>
-<div class="doc_text">
-<h5>Syntax:</h5>
-<pre> &lt;result&gt; = lshr &lt;ty&gt; &lt;var1&gt;, &lt;var2&gt; <i>; yields {ty}:result</i>
-</pre>
-
-<h5>Overview:</h5>
-<p>The '<tt>lshr</tt>' instruction (logical shift right) returns the first
-operand shifted to the right a specified number of bits with zero fill.</p>
-
-<h5>Arguments:</h5>
-<p>Both arguments to the '<tt>lshr</tt>' instruction must be the same
-<a href="#t_integer">integer</a> type. '<tt>var2</tt>' is treated as an
-unsigned value.</p>
-
-<h5>Semantics:</h5>
-
-<p>This instruction always performs a logical shift right operation. The most
-significant bits of the result will be filled with zero bits after the
-shift. If <tt>var2</tt> is (statically or dynamically) equal to or larger than
-the number of bits in <tt>var1</tt>, the result is undefined.</p>
-
-<h5>Example:</h5>
-<pre>
- &lt;result&gt; = lshr i32 4, 1 <i>; yields {i32}:result = 2</i>
- &lt;result&gt; = lshr i32 4, 2 <i>; yields {i32}:result = 1</i>
- &lt;result&gt; = lshr i8 4, 3 <i>; yields {i8}:result = 0</i>
- &lt;result&gt; = lshr i8 -2, 1 <i>; yields {i8}:result = 0x7FFFFFFF </i>
- &lt;result&gt; = lshr i32 1, 32 <i>; undefined</i>
-</pre>
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection"> <a name="i_ashr">'<tt>ashr</tt>'
-Instruction</a> </div>
-<div class="doc_text">
-
-<h5>Syntax:</h5>
-<pre> &lt;result&gt; = ashr &lt;ty&gt; &lt;var1&gt;, &lt;var2&gt; <i>; yields {ty}:result</i>
-</pre>
-
-<h5>Overview:</h5>
-<p>The '<tt>ashr</tt>' instruction (arithmetic shift right) returns the first
-operand shifted to the right a specified number of bits with sign extension.</p>
-
-<h5>Arguments:</h5>
-<p>Both arguments to the '<tt>ashr</tt>' instruction must be the same
-<a href="#t_integer">integer</a> type. '<tt>var2</tt>' is treated as an
-unsigned value.</p>
-
-<h5>Semantics:</h5>
-<p>This instruction always performs an arithmetic shift right operation,
-The most significant bits of the result will be filled with the sign bit
-of <tt>var1</tt>. If <tt>var2</tt> is (statically or dynamically) equal to or
-larger than the number of bits in <tt>var1</tt>, the result is undefined.
-</p>
-
-<h5>Example:</h5>
-<pre>
- &lt;result&gt; = ashr i32 4, 1 <i>; yields {i32}:result = 2</i>
- &lt;result&gt; = ashr i32 4, 2 <i>; yields {i32}:result = 1</i>
- &lt;result&gt; = ashr i8 4, 3 <i>; yields {i8}:result = 0</i>
- &lt;result&gt; = ashr i8 -2, 1 <i>; yields {i8}:result = -1</i>
- &lt;result&gt; = ashr i32 1, 32 <i>; undefined</i>
-</pre>
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection"> <a name="i_and">'<tt>and</tt>'
-Instruction</a> </div>
-<div class="doc_text">
-<h5>Syntax:</h5>
-<pre> &lt;result&gt; = and &lt;ty&gt; &lt;var1&gt;, &lt;var2&gt; <i>; yields {ty}:result</i>
-</pre>
-<h5>Overview:</h5>
-<p>The '<tt>and</tt>' instruction returns the bitwise logical and of
-its two operands.</p>
-<h5>Arguments:</h5>
-<p>The two arguments to the '<tt>and</tt>' instruction must be <a
- href="#t_integer">integer</a> values. Both arguments must have
-identical types.</p>
-<h5>Semantics:</h5>
-<p>The truth table used for the '<tt>and</tt>' instruction is:</p>
-<p> </p>
-<div style="align: center">
-<table border="1" cellspacing="0" cellpadding="4">
- <tbody>
- <tr>
- <td>In0</td>
- <td>In1</td>
- <td>Out</td>
- </tr>
- <tr>
- <td>0</td>
- <td>0</td>
- <td>0</td>
- </tr>
- <tr>
- <td>0</td>
- <td>1</td>
- <td>0</td>
- </tr>
- <tr>
- <td>1</td>
- <td>0</td>
- <td>0</td>
- </tr>
- <tr>
- <td>1</td>
- <td>1</td>
- <td>1</td>
- </tr>
- </tbody>
-</table>
-</div>
-<h5>Example:</h5>
-<pre> &lt;result&gt; = and i32 4, %var <i>; yields {i32}:result = 4 &amp; %var</i>
- &lt;result&gt; = and i32 15, 40 <i>; yields {i32}:result = 8</i>
- &lt;result&gt; = and i32 4, 8 <i>; yields {i32}:result = 0</i>
-</pre>
-</div>
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection"> <a name="i_or">'<tt>or</tt>' Instruction</a> </div>
-<div class="doc_text">
-<h5>Syntax:</h5>
-<pre> &lt;result&gt; = or &lt;ty&gt; &lt;var1&gt;, &lt;var2&gt; <i>; yields {ty}:result</i>
-</pre>
-<h5>Overview:</h5>
-<p>The '<tt>or</tt>' instruction returns the bitwise logical inclusive
-or of its two operands.</p>
-<h5>Arguments:</h5>
-<p>The two arguments to the '<tt>or</tt>' instruction must be <a
- href="#t_integer">integer</a> values. Both arguments must have
-identical types.</p>
-<h5>Semantics:</h5>
-<p>The truth table used for the '<tt>or</tt>' instruction is:</p>
-<p> </p>
-<div style="align: center">
-<table border="1" cellspacing="0" cellpadding="4">
- <tbody>
- <tr>
- <td>In0</td>
- <td>In1</td>
- <td>Out</td>
- </tr>
- <tr>
- <td>0</td>
- <td>0</td>
- <td>0</td>
- </tr>
- <tr>
- <td>0</td>
- <td>1</td>
- <td>1</td>
- </tr>
- <tr>
- <td>1</td>
- <td>0</td>
- <td>1</td>
- </tr>
- <tr>
- <td>1</td>
- <td>1</td>
- <td>1</td>
- </tr>
- </tbody>
-</table>
-</div>
-<h5>Example:</h5>
-<pre> &lt;result&gt; = or i32 4, %var <i>; yields {i32}:result = 4 | %var</i>
- &lt;result&gt; = or i32 15, 40 <i>; yields {i32}:result = 47</i>
- &lt;result&gt; = or i32 4, 8 <i>; yields {i32}:result = 12</i>
-</pre>
-</div>
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection"> <a name="i_xor">'<tt>xor</tt>'
-Instruction</a> </div>
-<div class="doc_text">
-<h5>Syntax:</h5>
-<pre> &lt;result&gt; = xor &lt;ty&gt; &lt;var1&gt;, &lt;var2&gt; <i>; yields {ty}:result</i>
-</pre>
-<h5>Overview:</h5>
-<p>The '<tt>xor</tt>' instruction returns the bitwise logical exclusive
-or of its two operands. The <tt>xor</tt> is used to implement the
-"one's complement" operation, which is the "~" operator in C.</p>
-<h5>Arguments:</h5>
-<p>The two arguments to the '<tt>xor</tt>' instruction must be <a
- href="#t_integer">integer</a> values. Both arguments must have
-identical types.</p>
-<h5>Semantics:</h5>
-<p>The truth table used for the '<tt>xor</tt>' instruction is:</p>
-<p> </p>
-<div style="align: center">
-<table border="1" cellspacing="0" cellpadding="4">
- <tbody>
- <tr>
- <td>In0</td>
- <td>In1</td>
- <td>Out</td>
- </tr>
- <tr>
- <td>0</td>
- <td>0</td>
- <td>0</td>
- </tr>
- <tr>
- <td>0</td>
- <td>1</td>
- <td>1</td>
- </tr>
- <tr>
- <td>1</td>
- <td>0</td>
- <td>1</td>
- </tr>
- <tr>
- <td>1</td>
- <td>1</td>
- <td>0</td>
- </tr>
- </tbody>
-</table>
-</div>
-<p> </p>
-<h5>Example:</h5>
-<pre> &lt;result&gt; = xor i32 4, %var <i>; yields {i32}:result = 4 ^ %var</i>
- &lt;result&gt; = xor i32 15, 40 <i>; yields {i32}:result = 39</i>
- &lt;result&gt; = xor i32 4, 8 <i>; yields {i32}:result = 12</i>
- &lt;result&gt; = xor i32 %V, -1 <i>; yields {i32}:result = ~%V</i>
-</pre>
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="vectorops">Vector Operations</a>
-</div>
-
-<div class="doc_text">
-
-<p>LLVM supports several instructions to represent vector operations in a
-target-independent manner. These instructions cover the element-access and
-vector-specific operations needed to process vectors effectively. While LLVM
-does directly support these vector operations, many sophisticated algorithms
-will want to use target-specific intrinsics to take full advantage of a specific
-target.</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="i_extractelement">'<tt>extractelement</tt>' Instruction</a>
-</div>
-
-<div class="doc_text">
-
-<h5>Syntax:</h5>
-
-<pre>
- &lt;result&gt; = extractelement &lt;n x &lt;ty&gt;&gt; &lt;val&gt;, i32 &lt;idx&gt; <i>; yields &lt;ty&gt;</i>
-</pre>
-
-<h5>Overview:</h5>
-
-<p>
-The '<tt>extractelement</tt>' instruction extracts a single scalar
-element from a vector at a specified index.
-</p>
-
-
-<h5>Arguments:</h5>
-
-<p>
-The first operand of an '<tt>extractelement</tt>' instruction is a
-value of <a href="#t_vector">vector</a> type. The second operand is
-an index indicating the position from which to extract the element.
-The index may be a variable.</p>
-
-<h5>Semantics:</h5>
-
-<p>
-The result is a scalar of the same type as the element type of
-<tt>val</tt>. Its value is the value at position <tt>idx</tt> of
-<tt>val</tt>. If <tt>idx</tt> exceeds the length of <tt>val</tt>, the
-results are undefined.
-</p>
-
-<h5>Example:</h5>
-
-<pre>
- %result = extractelement &lt;4 x i32&gt; %vec, i32 0 <i>; yields i32</i>
-</pre>
-</div>
-
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="i_insertelement">'<tt>insertelement</tt>' Instruction</a>
-</div>
-
-<div class="doc_text">
-
-<h5>Syntax:</h5>
-
-<pre>
- &lt;result&gt; = insertelement &lt;n x &lt;ty&gt;&gt; &lt;val&gt;, &lt;ty&gt; &lt;elt&gt, i32 &lt;idx&gt; <i>; yields &lt;n x &lt;ty&gt;&gt;</i>
-</pre>
-
-<h5>Overview:</h5>
-
-<p>
-The '<tt>insertelement</tt>' instruction inserts a scalar
-element into a vector at a specified index.
-</p>
-
-
-<h5>Arguments:</h5>
-
-<p>
-The first operand of an '<tt>insertelement</tt>' instruction is a
-value of <a href="#t_vector">vector</a> type. The second operand is a
-scalar value whose type must equal the element type of the first
-operand. The third operand is an index indicating the position at
-which to insert the value. The index may be a variable.</p>
-
-<h5>Semantics:</h5>
-
-<p>
-The result is a vector of the same type as <tt>val</tt>. Its
-element values are those of <tt>val</tt> except at position
-<tt>idx</tt>, where it gets the value <tt>elt</tt>. If <tt>idx</tt>
-exceeds the length of <tt>val</tt>, the results are undefined.
-</p>
-
-<h5>Example:</h5>
-
-<pre>
- %result = insertelement &lt;4 x i32&gt; %vec, i32 1, i32 0 <i>; yields &lt;4 x i32&gt;</i>
-</pre>
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="i_shufflevector">'<tt>shufflevector</tt>' Instruction</a>
-</div>
-
-<div class="doc_text">
-
-<h5>Syntax:</h5>
-
-<pre>
- &lt;result&gt; = shufflevector &lt;n x &lt;ty&gt;&gt; &lt;v1&gt;, &lt;n x &lt;ty&gt;&gt; &lt;v2&gt;, &lt;n x i32&gt; &lt;mask&gt; <i>; yields &lt;n x &lt;ty&gt;&gt;</i>
-</pre>
-
-<h5>Overview:</h5>
-
-<p>
-The '<tt>shufflevector</tt>' instruction constructs a permutation of elements
-from two input vectors, returning a vector of the same type.
-</p>
-
-<h5>Arguments:</h5>
-
-<p>
-The first two operands of a '<tt>shufflevector</tt>' instruction are vectors
-with types that match each other and types that match the result of the
-instruction. The third argument is a shuffle mask, which has the same number
-of elements as the other vector type, but whose element type is always 'i32'.
-</p>
-
-<p>
-The shuffle mask operand is required to be a constant vector with either
-constant integer or undef values.
-</p>
-
-<h5>Semantics:</h5>
-
-<p>
-The elements of the two input vectors are numbered from left to right across
-both of the vectors. The shuffle mask operand specifies, for each element of
-the result vector, which element of the two input registers the result element
-gets. The element selector may be undef (meaning "don't care") and the second
-operand may be undef if performing a shuffle from only one vector.
-</p>
-
-<h5>Example:</h5>
-
-<pre>
- %result = shufflevector &lt;4 x i32&gt; %v1, &lt;4 x i32&gt; %v2,
- &lt;4 x i32&gt; &lt;i32 0, i32 4, i32 1, i32 5&gt; <i>; yields &lt;4 x i32&gt;</i>
- %result = shufflevector &lt;4 x i32&gt; %v1, &lt;4 x i32&gt; undef,
- &lt;4 x i32&gt; &lt;i32 0, i32 1, i32 2, i32 3&gt; <i>; yields &lt;4 x i32&gt;</i> - Identity shuffle.
-</pre>
-</div>
-
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="memoryops">Memory Access and Addressing Operations</a>
-</div>
-
-<div class="doc_text">
-
-<p>A key design point of an SSA-based representation is how it
-represents memory. In LLVM, no memory locations are in SSA form, which
-makes things very simple. This section describes how to read, write,
-allocate, and free memory in LLVM.</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="i_malloc">'<tt>malloc</tt>' Instruction</a>
-</div>
-
-<div class="doc_text">
-
-<h5>Syntax:</h5>
-
-<pre>
- &lt;result&gt; = malloc &lt;type&gt;[, i32 &lt;NumElements&gt;][, align &lt;alignment&gt;] <i>; yields {type*}:result</i>
-</pre>
-
-<h5>Overview:</h5>
-
-<p>The '<tt>malloc</tt>' instruction allocates memory from the system
-heap and returns a pointer to it. The object is always allocated in the generic
-address space (address space zero).</p>
-
-<h5>Arguments:</h5>
-
-<p>The '<tt>malloc</tt>' instruction allocates
-<tt>sizeof(&lt;type&gt;)*NumElements</tt>
-bytes of memory from the operating system and returns a pointer of the
-appropriate type to the program. If "NumElements" is specified, it is the
-number of elements allocated, otherwise "NumElements" is defaulted to be one.
-If a constant alignment is specified, the value result of the allocation is guaranteed to
-be aligned to at least that boundary. If not specified, or if zero, the target can
-choose to align the allocation on any convenient boundary.</p>
-
-<p>'<tt>type</tt>' must be a sized type.</p>
-
-<h5>Semantics:</h5>
-
-<p>Memory is allocated using the system "<tt>malloc</tt>" function, and
-a pointer is returned. The result of a zero byte allocattion is undefined. The
-result is null if there is insufficient memory available.</p>
-
-<h5>Example:</h5>
-
-<pre>
- %array = malloc [4 x i8 ] <i>; yields {[%4 x i8]*}:array</i>
-
- %size = <a href="#i_add">add</a> i32 2, 2 <i>; yields {i32}:size = i32 4</i>
- %array1 = malloc i8, i32 4 <i>; yields {i8*}:array1</i>
- %array2 = malloc [12 x i8], i32 %size <i>; yields {[12 x i8]*}:array2</i>
- %array3 = malloc i32, i32 4, align 1024 <i>; yields {i32*}:array3</i>
- %array4 = malloc i32, align 1024 <i>; yields {i32*}:array4</i>
-</pre>
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="i_free">'<tt>free</tt>' Instruction</a>
-</div>
-
-<div class="doc_text">
-
-<h5>Syntax:</h5>
-
-<pre>
- free &lt;type&gt; &lt;value&gt; <i>; yields {void}</i>
-</pre>
-
-<h5>Overview:</h5>
-
-<p>The '<tt>free</tt>' instruction returns memory back to the unused
-memory heap to be reallocated in the future.</p>
-
-<h5>Arguments:</h5>
-
-<p>'<tt>value</tt>' shall be a pointer value that points to a value
-that was allocated with the '<tt><a href="#i_malloc">malloc</a></tt>'
-instruction.</p>
-
-<h5>Semantics:</h5>
-
-<p>Access to the memory pointed to by the pointer is no longer defined
-after this instruction executes. If the pointer is null, the operation
-is a noop.</p>
-
-<h5>Example:</h5>
-
-<pre>
- %array = <a href="#i_malloc">malloc</a> [4 x i8] <i>; yields {[4 x i8]*}:array</i>
- free [4 x i8]* %array
-</pre>
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="i_alloca">'<tt>alloca</tt>' Instruction</a>
-</div>
-
-<div class="doc_text">
-
-<h5>Syntax:</h5>
-
-<pre>
- &lt;result&gt; = alloca &lt;type&gt;[, i32 &lt;NumElements&gt;][, align &lt;alignment&gt;] <i>; yields {type*}:result</i>
-</pre>
-
-<h5>Overview:</h5>
-
-<p>The '<tt>alloca</tt>' instruction allocates memory on the stack frame of the
-currently executing function, to be automatically released when this function
-returns to its caller. The object is always allocated in the generic address
-space (address space zero).</p>
-
-<h5>Arguments:</h5>
-
-<p>The '<tt>alloca</tt>' instruction allocates <tt>sizeof(&lt;type&gt;)*NumElements</tt>
-bytes of memory on the runtime stack, returning a pointer of the
-appropriate type to the program. If "NumElements" is specified, it is the
-number of elements allocated, otherwise "NumElements" is defaulted to be one.
-If a constant alignment is specified, the value result of the allocation is guaranteed
-to be aligned to at least that boundary. If not specified, or if zero, the target
-can choose to align the allocation on any convenient boundary.</p>
-
-<p>'<tt>type</tt>' may be any sized type.</p>
-
-<h5>Semantics:</h5>
-
-<p>Memory is allocated; a pointer is returned. The operation is undefiend if
-there is insufficient stack space for the allocation. '<tt>alloca</tt>'d
-memory is automatically released when the function returns. The '<tt>alloca</tt>'
-instruction is commonly used to represent automatic variables that must
-have an address available. When the function returns (either with the <tt><a
- href="#i_ret">ret</a></tt> or <tt><a href="#i_unwind">unwind</a></tt>
-instructions), the memory is reclaimed. Allocating zero bytes
-is legal, but the result is undefined.</p>
-
-<h5>Example:</h5>
-
-<pre>
- %ptr = alloca i32 <i>; yields {i32*}:ptr</i>
- %ptr = alloca i32, i32 4 <i>; yields {i32*}:ptr</i>
- %ptr = alloca i32, i32 4, align 1024 <i>; yields {i32*}:ptr</i>
- %ptr = alloca i32, align 1024 <i>; yields {i32*}:ptr</i>
-</pre>
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection"> <a name="i_load">'<tt>load</tt>'
-Instruction</a> </div>
-<div class="doc_text">
-<h5>Syntax:</h5>
-<pre> &lt;result&gt; = load &lt;ty&gt;* &lt;pointer&gt;[, align &lt;alignment&gt;]<br> &lt;result&gt; = volatile load &lt;ty&gt;* &lt;pointer&gt;[, align &lt;alignment&gt;]<br></pre>
-<h5>Overview:</h5>
-<p>The '<tt>load</tt>' instruction is used to read from memory.</p>
-<h5>Arguments:</h5>
-<p>The argument to the '<tt>load</tt>' instruction specifies the memory
-address from which to load. The pointer must point to a <a
- href="#t_firstclass">first class</a> type. If the <tt>load</tt> is
-marked as <tt>volatile</tt>, then the optimizer is not allowed to modify
-the number or order of execution of this <tt>load</tt> with other
-volatile <tt>load</tt> and <tt><a href="#i_store">store</a></tt>
-instructions. </p>
-<p>
-The optional constant "align" argument specifies the alignment of the operation
-(that is, the alignment of the memory address). A value of 0 or an
-omitted "align" argument means that the operation has the preferential
-alignment for the target. It is the responsibility of the code emitter
-to ensure that the alignment information is correct. Overestimating
-the alignment results in an undefined behavior. Underestimating the
-alignment may produce less efficient code. An alignment of 1 is always
-safe.
-</p>
-<h5>Semantics:</h5>
-<p>The location of memory pointed to is loaded.</p>
-<h5>Examples:</h5>
-<pre> %ptr = <a href="#i_alloca">alloca</a> i32 <i>; yields {i32*}:ptr</i>
- <a
- href="#i_store">store</a> i32 3, i32* %ptr <i>; yields {void}</i>
- %val = load i32* %ptr <i>; yields {i32}:val = i32 3</i>
-</pre>
-</div>
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection"> <a name="i_store">'<tt>store</tt>'
-Instruction</a> </div>
-<div class="doc_text">
-<h5>Syntax:</h5>
-<pre> store &lt;ty&gt; &lt;value&gt;, &lt;ty&gt;* &lt;pointer&gt;[, align &lt;alignment&gt;] <i>; yields {void}</i>
- volatile store &lt;ty&gt; &lt;value&gt;, &lt;ty&gt;* &lt;pointer&gt;[, align &lt;alignment&gt;] <i>; yields {void}</i>
-</pre>
-<h5>Overview:</h5>
-<p>The '<tt>store</tt>' instruction is used to write to memory.</p>
-<h5>Arguments:</h5>
-<p>There are two arguments to the '<tt>store</tt>' instruction: a value
-to store and an address at which to store it. The type of the '<tt>&lt;pointer&gt;</tt>'
-operand must be a pointer to the <a href="#t_firstclass">first class</a> type
-of the '<tt>&lt;value&gt;</tt>'
-operand. If the <tt>store</tt> is marked as <tt>volatile</tt>, then the
-optimizer is not allowed to modify the number or order of execution of
-this <tt>store</tt> with other volatile <tt>load</tt> and <tt><a
- href="#i_store">store</a></tt> instructions.</p>
-<p>
-The optional constant "align" argument specifies the alignment of the operation
-(that is, the alignment of the memory address). A value of 0 or an
-omitted "align" argument means that the operation has the preferential
-alignment for the target. It is the responsibility of the code emitter
-to ensure that the alignment information is correct. Overestimating
-the alignment results in an undefined behavior. Underestimating the
-alignment may produce less efficient code. An alignment of 1 is always
-safe.
-</p>
-<h5>Semantics:</h5>
-<p>The contents of memory are updated to contain '<tt>&lt;value&gt;</tt>'
-at the location specified by the '<tt>&lt;pointer&gt;</tt>' operand.</p>
-<h5>Example:</h5>
-<pre> %ptr = <a href="#i_alloca">alloca</a> i32 <i>; yields {i32*}:ptr</i>
- store i32 3, i32* %ptr <i>; yields {void}</i>
- %val = <a href="#i_load">load</a> i32* %ptr <i>; yields {i32}:val = i32 3</i>
-</pre>
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="i_getelementptr">'<tt>getelementptr</tt>' Instruction</a>
-</div>
-
-<div class="doc_text">
-<h5>Syntax:</h5>
-<pre>
- &lt;result&gt; = getelementptr &lt;ty&gt;* &lt;ptrval&gt;{, &lt;ty&gt; &lt;idx&gt;}*
-</pre>
-
-<h5>Overview:</h5>
-
-<p>
-The '<tt>getelementptr</tt>' instruction is used to get the address of a
-subelement of an aggregate data structure.</p>
-
-<h5>Arguments:</h5>
-
-<p>This instruction takes a list of integer operands that indicate what
-elements of the aggregate object to index to. The actual types of the arguments
-provided depend on the type of the first pointer argument. The
-'<tt>getelementptr</tt>' instruction is used to index down through the type
-levels of a structure or to a specific index in an array. When indexing into a
-structure, only <tt>i32</tt> integer constants are allowed. When indexing
-into an array or pointer, only integers of 32 or 64 bits are allowed; 32-bit
-values will be sign extended to 64-bits if required.</p>
-
-<p>For example, let's consider a C code fragment and how it gets
-compiled to LLVM:</p>
-
-<div class="doc_code">
-<pre>
-struct RT {
- char A;
- int B[10][20];
- char C;
-};
-struct ST {
- int X;
- double Y;
- struct RT Z;
-};
-
-int *foo(struct ST *s) {
- return &amp;s[1].Z.B[5][13];
-}
-</pre>
-</div>
-
-<p>The LLVM code generated by the GCC frontend is:</p>
-
-<div class="doc_code">
-<pre>
-%RT = type { i8 , [10 x [20 x i32]], i8 }
-%ST = type { i32, double, %RT }
-
-define i32* %foo(%ST* %s) {
-entry:
- %reg = getelementptr %ST* %s, i32 1, i32 2, i32 1, i32 5, i32 13
- ret i32* %reg
-}
-</pre>
-</div>
-
-<h5>Semantics:</h5>
-
-<p>The index types specified for the '<tt>getelementptr</tt>' instruction depend
-on the pointer type that is being indexed into. <a href="#t_pointer">Pointer</a>
-and <a href="#t_array">array</a> types can use a 32-bit or 64-bit
-<a href="#t_integer">integer</a> type but the value will always be sign extended
-to 64-bits. <a href="#t_struct">Structure</a> and <a href="#t_pstruct">packed
-structure</a> types require <tt>i32</tt> <b>constants</b>.</p>
-
-<p>In the example above, the first index is indexing into the '<tt>%ST*</tt>'
-type, which is a pointer, yielding a '<tt>%ST</tt>' = '<tt>{ i32, double, %RT
-}</tt>' type, a structure. The second index indexes into the third element of
-the structure, yielding a '<tt>%RT</tt>' = '<tt>{ i8 , [10 x [20 x i32]],
-i8 }</tt>' type, another structure. The third index indexes into the second
-element of the structure, yielding a '<tt>[10 x [20 x i32]]</tt>' type, an
-array. The two dimensions of the array are subscripted into, yielding an
-'<tt>i32</tt>' type. The '<tt>getelementptr</tt>' instruction returns a pointer
-to this element, thus computing a value of '<tt>i32*</tt>' type.</p>
-
-<p>Note that it is perfectly legal to index partially through a
-structure, returning a pointer to an inner element. Because of this,
-the LLVM code for the given testcase is equivalent to:</p>
-
-<pre>
- define i32* %foo(%ST* %s) {
- %t1 = getelementptr %ST* %s, i32 1 <i>; yields %ST*:%t1</i>
- %t2 = getelementptr %ST* %t1, i32 0, i32 2 <i>; yields %RT*:%t2</i>
- %t3 = getelementptr %RT* %t2, i32 0, i32 1 <i>; yields [10 x [20 x i32]]*:%t3</i>
- %t4 = getelementptr [10 x [20 x i32]]* %t3, i32 0, i32 5 <i>; yields [20 x i32]*:%t4</i>
- %t5 = getelementptr [20 x i32]* %t4, i32 0, i32 13 <i>; yields i32*:%t5</i>
- ret i32* %t5
- }
-</pre>
-
-<p>Note that it is undefined to access an array out of bounds: array and
-pointer indexes must always be within the defined bounds of the array type.
-The one exception for this rule is zero length arrays. These arrays are
-defined to be accessible as variable length arrays, which requires access
-beyond the zero'th element.</p>
-
-<p>The getelementptr instruction is often confusing. For some more insight
-into how it works, see <a href="GetElementPtr.html">the getelementptr
-FAQ</a>.</p>
-
-<h5>Example:</h5>
-
-<pre>
- <i>; yields [12 x i8]*:aptr</i>
- %aptr = getelementptr {i32, [12 x i8]}* %sptr, i64 0, i32 1
-</pre>
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection"> <a name="convertops">Conversion Operations</a>
-</div>
-<div class="doc_text">
-<p>The instructions in this category are the conversion instructions (casting)
-which all take a single operand and a type. They perform various bit conversions
-on the operand.</p>
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="i_trunc">'<tt>trunc .. to</tt>' Instruction</a>
-</div>
-<div class="doc_text">
-
-<h5>Syntax:</h5>
-<pre>
- &lt;result&gt; = trunc &lt;ty&gt; &lt;value&gt; to &lt;ty2&gt; <i>; yields ty2</i>
-</pre>
-
-<h5>Overview:</h5>
-<p>
-The '<tt>trunc</tt>' instruction truncates its operand to the type <tt>ty2</tt>.
-</p>
-
-<h5>Arguments:</h5>
-<p>
-The '<tt>trunc</tt>' instruction takes a <tt>value</tt> to trunc, which must
-be an <a href="#t_integer">integer</a> type, and a type that specifies the size
-and type of the result, which must be an <a href="#t_integer">integer</a>
-type. The bit size of <tt>value</tt> must be larger than the bit size of
-<tt>ty2</tt>. Equal sized types are not allowed.</p>
-
-<h5>Semantics:</h5>
-<p>
-The '<tt>trunc</tt>' instruction truncates the high order bits in <tt>value</tt>
-and converts the remaining bits to <tt>ty2</tt>. Since the source size must be
-larger than the destination size, <tt>trunc</tt> cannot be a <i>no-op cast</i>.
-It will always truncate bits.</p>
-
-<h5>Example:</h5>
-<pre>
- %X = trunc i32 257 to i8 <i>; yields i8:1</i>
- %Y = trunc i32 123 to i1 <i>; yields i1:true</i>
- %Y = trunc i32 122 to i1 <i>; yields i1:false</i>
-</pre>
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="i_zext">'<tt>zext .. to</tt>' Instruction</a>
-</div>
-<div class="doc_text">
-
-<h5>Syntax:</h5>
-<pre>
- &lt;result&gt; = zext &lt;ty&gt; &lt;value&gt; to &lt;ty2&gt; <i>; yields ty2</i>
-</pre>
-
-<h5>Overview:</h5>
-<p>The '<tt>zext</tt>' instruction zero extends its operand to type
-<tt>ty2</tt>.</p>
-
-
-<h5>Arguments:</h5>
-<p>The '<tt>zext</tt>' instruction takes a value to cast, which must be of
-<a href="#t_integer">integer</a> type, and a type to cast it to, which must
-also be of <a href="#t_integer">integer</a> type. The bit size of the
-<tt>value</tt> must be smaller than the bit size of the destination type,
-<tt>ty2</tt>.</p>
-
-<h5>Semantics:</h5>
-<p>The <tt>zext</tt> fills the high order bits of the <tt>value</tt> with zero
-bits until it reaches the size of the destination type, <tt>ty2</tt>.</p>
-
-<p>When zero extending from i1, the result will always be either 0 or 1.</p>
-
-<h5>Example:</h5>
-<pre>
- %X = zext i32 257 to i64 <i>; yields i64:257</i>
- %Y = zext i1 true to i32 <i>; yields i32:1</i>
-</pre>
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="i_sext">'<tt>sext .. to</tt>' Instruction</a>
-</div>
-<div class="doc_text">
-
-<h5>Syntax:</h5>
-<pre>
- &lt;result&gt; = sext &lt;ty&gt; &lt;value&gt; to &lt;ty2&gt; <i>; yields ty2</i>
-</pre>
-
-<h5>Overview:</h5>
-<p>The '<tt>sext</tt>' sign extends <tt>value</tt> to the type <tt>ty2</tt>.</p>
-
-<h5>Arguments:</h5>
-<p>
-The '<tt>sext</tt>' instruction takes a value to cast, which must be of
-<a href="#t_integer">integer</a> type, and a type to cast it to, which must
-also be of <a href="#t_integer">integer</a> type. The bit size of the
-<tt>value</tt> must be smaller than the bit size of the destination type,
-<tt>ty2</tt>.</p>
-
-<h5>Semantics:</h5>
-<p>
-The '<tt>sext</tt>' instruction performs a sign extension by copying the sign
-bit (highest order bit) of the <tt>value</tt> until it reaches the bit size of
-the type <tt>ty2</tt>.</p>
-
-<p>When sign extending from i1, the extension always results in -1 or 0.</p>
-
-<h5>Example:</h5>
-<pre>
- %X = sext i8 -1 to i16 <i>; yields i16 :65535</i>
- %Y = sext i1 true to i32 <i>; yields i32:-1</i>
-</pre>
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="i_fptrunc">'<tt>fptrunc .. to</tt>' Instruction</a>
-</div>
-
-<div class="doc_text">
-
-<h5>Syntax:</h5>
-
-<pre>
- &lt;result&gt; = fptrunc &lt;ty&gt; &lt;value&gt; to &lt;ty2&gt; <i>; yields ty2</i>
-</pre>
-
-<h5>Overview:</h5>
-<p>The '<tt>fptrunc</tt>' instruction truncates <tt>value</tt> to type
-<tt>ty2</tt>.</p>
-
-
-<h5>Arguments:</h5>
-<p>The '<tt>fptrunc</tt>' instruction takes a <a href="#t_floating">floating
- point</a> value to cast and a <a href="#t_floating">floating point</a> type to
-cast it to. The size of <tt>value</tt> must be larger than the size of
-<tt>ty2</tt>. This implies that <tt>fptrunc</tt> cannot be used to make a
-<i>no-op cast</i>.</p>
-
-<h5>Semantics:</h5>
-<p> The '<tt>fptrunc</tt>' instruction truncates a <tt>value</tt> from a larger
-<a href="#t_floating">floating point</a> type to a smaller
-<a href="#t_floating">floating point</a> type. If the value cannot fit within
-the destination type, <tt>ty2</tt>, then the results are undefined.</p>
-
-<h5>Example:</h5>
-<pre>
- %X = fptrunc double 123.0 to float <i>; yields float:123.0</i>
- %Y = fptrunc double 1.0E+300 to float <i>; yields undefined</i>
-</pre>
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="i_fpext">'<tt>fpext .. to</tt>' Instruction</a>
-</div>
-<div class="doc_text">
-
-<h5>Syntax:</h5>
-<pre>
- &lt;result&gt; = fpext &lt;ty&gt; &lt;value&gt; to &lt;ty2&gt; <i>; yields ty2</i>
-</pre>
-
-<h5>Overview:</h5>
-<p>The '<tt>fpext</tt>' extends a floating point <tt>value</tt> to a larger
-floating point value.</p>
-
-<h5>Arguments:</h5>
-<p>The '<tt>fpext</tt>' instruction takes a
-<a href="#t_floating">floating point</a> <tt>value</tt> to cast,
-and a <a href="#t_floating">floating point</a> type to cast it to. The source
-type must be smaller than the destination type.</p>
-
-<h5>Semantics:</h5>
-<p>The '<tt>fpext</tt>' instruction extends the <tt>value</tt> from a smaller
-<a href="#t_floating">floating point</a> type to a larger
-<a href="#t_floating">floating point</a> type. The <tt>fpext</tt> cannot be
-used to make a <i>no-op cast</i> because it always changes bits. Use
-<tt>bitcast</tt> to make a <i>no-op cast</i> for a floating point cast.</p>
-
-<h5>Example:</h5>
-<pre>
- %X = fpext float 3.1415 to double <i>; yields double:3.1415</i>
- %Y = fpext float 1.0 to float <i>; yields float:1.0 (no-op)</i>
-</pre>
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="i_fptoui">'<tt>fptoui .. to</tt>' Instruction</a>
-</div>
-<div class="doc_text">
-
-<h5>Syntax:</h5>
-<pre>
- &lt;result&gt; = fptoui &lt;ty&gt; &lt;value&gt; to &lt;ty2&gt; <i>; yields ty2</i>
-</pre>
-
-<h5>Overview:</h5>
-<p>The '<tt>fptoui</tt>' converts a floating point <tt>value</tt> to its
-unsigned integer equivalent of type <tt>ty2</tt>.
-</p>
-
-<h5>Arguments:</h5>
-<p>The '<tt>fptoui</tt>' instruction takes a value to cast, which must be a
-scalar or vector <a href="#t_floating">floating point</a> value, and a type
-to cast it to <tt>ty2</tt>, which must be an <a href="#t_integer">integer</a>
-type. If <tt>ty</tt> is a vector floating point type, <tt>ty2</tt> must be a
-vector integer type with the same number of elements as <tt>ty</tt></p>
-
-<h5>Semantics:</h5>
-<p> The '<tt>fptoui</tt>' instruction converts its
-<a href="#t_floating">floating point</a> operand into the nearest (rounding
-towards zero) unsigned integer value. If the value cannot fit in <tt>ty2</tt>,
-the results are undefined.</p>
-
-<h5>Example:</h5>
-<pre>
- %X = fptoui double 123.0 to i32 <i>; yields i32:123</i>
- %Y = fptoui float 1.0E+300 to i1 <i>; yields undefined:1</i>
- %X = fptoui float 1.04E+17 to i8 <i>; yields undefined:1</i>
-</pre>
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="i_fptosi">'<tt>fptosi .. to</tt>' Instruction</a>
-</div>
-<div class="doc_text">
-
-<h5>Syntax:</h5>
-<pre>
- &lt;result&gt; = fptosi &lt;ty&gt; &lt;value&gt; to &lt;ty2&gt; <i>; yields ty2</i>
-</pre>
-
-<h5>Overview:</h5>
-<p>The '<tt>fptosi</tt>' instruction converts
-<a href="#t_floating">floating point</a> <tt>value</tt> to type <tt>ty2</tt>.
-</p>
-
-<h5>Arguments:</h5>
-<p> The '<tt>fptosi</tt>' instruction takes a value to cast, which must be a
-scalar or vector <a href="#t_floating">floating point</a> value, and a type
-to cast it to <tt>ty2</tt>, which must be an <a href="#t_integer">integer</a>
-type. If <tt>ty</tt> is a vector floating point type, <tt>ty2</tt> must be a
-vector integer type with the same number of elements as <tt>ty</tt></p>
-
-<h5>Semantics:</h5>
-<p>The '<tt>fptosi</tt>' instruction converts its
-<a href="#t_floating">floating point</a> operand into the nearest (rounding
-towards zero) signed integer value. If the value cannot fit in <tt>ty2</tt>,
-the results are undefined.</p>
-
-<h5>Example:</h5>
-<pre>
- %X = fptosi double -123.0 to i32 <i>; yields i32:-123</i>
- %Y = fptosi float 1.0E-247 to i1 <i>; yields undefined:1</i>
- %X = fptosi float 1.04E+17 to i8 <i>; yields undefined:1</i>
-</pre>
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="i_uitofp">'<tt>uitofp .. to</tt>' Instruction</a>
-</div>
-<div class="doc_text">
-
-<h5>Syntax:</h5>
-<pre>
- &lt;result&gt; = uitofp &lt;ty&gt; &lt;value&gt; to &lt;ty2&gt; <i>; yields ty2</i>
-</pre>
-
-<h5>Overview:</h5>
-<p>The '<tt>uitofp</tt>' instruction regards <tt>value</tt> as an unsigned
-integer and converts that value to the <tt>ty2</tt> type.</p>
-
-<h5>Arguments:</h5>
-<p>The '<tt>uitofp</tt>' instruction takes a value to cast, which must be a
-scalar or vector <a href="#t_integer">integer</a> value, and a type to cast it
-to <tt>ty2</tt>, which must be an <a href="#t_floating">floating point</a>
-type. If <tt>ty</tt> is a vector integer type, <tt>ty2</tt> must be a vector
-floating point type with the same number of elements as <tt>ty</tt></p>
-
-<h5>Semantics:</h5>
-<p>The '<tt>uitofp</tt>' instruction interprets its operand as an unsigned
-integer quantity and converts it to the corresponding floating point value. If
-the value cannot fit in the floating point value, the results are undefined.</p>
-
-<h5>Example:</h5>
-<pre>
- %X = uitofp i32 257 to float <i>; yields float:257.0</i>
- %Y = uitofp i8 -1 to double <i>; yields double:255.0</i>
-</pre>
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="i_sitofp">'<tt>sitofp .. to</tt>' Instruction</a>
-</div>
-<div class="doc_text">
-
-<h5>Syntax:</h5>
-<pre>
- &lt;result&gt; = sitofp &lt;ty&gt; &lt;value&gt; to &lt;ty2&gt; <i>; yields ty2</i>
-</pre>
-
-<h5>Overview:</h5>
-<p>The '<tt>sitofp</tt>' instruction regards <tt>value</tt> as a signed
-integer and converts that value to the <tt>ty2</tt> type.</p>
-
-<h5>Arguments:</h5>
-<p>The '<tt>sitofp</tt>' instruction takes a value to cast, which must be a
-scalar or vector <a href="#t_integer">integer</a> value, and a type to cast it
-to <tt>ty2</tt>, which must be an <a href="#t_floating">floating point</a>
-type. If <tt>ty</tt> is a vector integer type, <tt>ty2</tt> must be a vector
-floating point type with the same number of elements as <tt>ty</tt></p>
-
-<h5>Semantics:</h5>
-<p>The '<tt>sitofp</tt>' instruction interprets its operand as a signed
-integer quantity and converts it to the corresponding floating point value. If
-the value cannot fit in the floating point value, the results are undefined.</p>
-
-<h5>Example:</h5>
-<pre>
- %X = sitofp i32 257 to float <i>; yields float:257.0</i>
- %Y = sitofp i8 -1 to double <i>; yields double:-1.0</i>
-</pre>
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="i_ptrtoint">'<tt>ptrtoint .. to</tt>' Instruction</a>
-</div>
-<div class="doc_text">
-
-<h5>Syntax:</h5>
-<pre>
- &lt;result&gt; = ptrtoint &lt;ty&gt; &lt;value&gt; to &lt;ty2&gt; <i>; yields ty2</i>
-</pre>
-
-<h5>Overview:</h5>
-<p>The '<tt>ptrtoint</tt>' instruction converts the pointer <tt>value</tt> to
-the integer type <tt>ty2</tt>.</p>
-
-<h5>Arguments:</h5>
-<p>The '<tt>ptrtoint</tt>' instruction takes a <tt>value</tt> to cast, which
-must be a <a href="#t_pointer">pointer</a> value, and a type to cast it to
-<tt>ty2</tt>, which must be an <a href="#t_integer">integer</a> type.
-
-<h5>Semantics:</h5>
-<p>The '<tt>ptrtoint</tt>' instruction converts <tt>value</tt> to integer type
-<tt>ty2</tt> by interpreting the pointer value as an integer and either
-truncating or zero extending that value to the size of the integer type. If
-<tt>value</tt> is smaller than <tt>ty2</tt> then a zero extension is done. If
-<tt>value</tt> is larger than <tt>ty2</tt> then a truncation is done. If they
-are the same size, then nothing is done (<i>no-op cast</i>) other than a type
-change.</p>
-
-<h5>Example:</h5>
-<pre>
- %X = ptrtoint i32* %X to i8 <i>; yields truncation on 32-bit architecture</i>
- %Y = ptrtoint i32* %x to i64 <i>; yields zero extension on 32-bit architecture</i>
-</pre>
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="i_inttoptr">'<tt>inttoptr .. to</tt>' Instruction</a>
-</div>
-<div class="doc_text">
-
-<h5>Syntax:</h5>
-<pre>
- &lt;result&gt; = inttoptr &lt;ty&gt; &lt;value&gt; to &lt;ty2&gt; <i>; yields ty2</i>
-</pre>
-
-<h5>Overview:</h5>
-<p>The '<tt>inttoptr</tt>' instruction converts an integer <tt>value</tt> to
-a pointer type, <tt>ty2</tt>.</p>
-
-<h5>Arguments:</h5>
-<p>The '<tt>inttoptr</tt>' instruction takes an <a href="#t_integer">integer</a>
-value to cast, and a type to cast it to, which must be a
-<a href="#t_pointer">pointer</a> type.
-
-<h5>Semantics:</h5>
-<p>The '<tt>inttoptr</tt>' instruction converts <tt>value</tt> to type
-<tt>ty2</tt> by applying either a zero extension or a truncation depending on
-the size of the integer <tt>value</tt>. If <tt>value</tt> is larger than the
-size of a pointer then a truncation is done. If <tt>value</tt> is smaller than
-the size of a pointer then a zero extension is done. If they are the same size,
-nothing is done (<i>no-op cast</i>).</p>
-
-<h5>Example:</h5>
-<pre>
- %X = inttoptr i32 255 to i32* <i>; yields zero extension on 64-bit architecture</i>
- %X = inttoptr i32 255 to i32* <i>; yields no-op on 32-bit architecture</i>
- %Y = inttoptr i64 0 to i32* <i>; yields truncation on 32-bit architecture</i>
-</pre>
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="i_bitcast">'<tt>bitcast .. to</tt>' Instruction</a>
-</div>
-<div class="doc_text">
-
-<h5>Syntax:</h5>
-<pre>
- &lt;result&gt; = bitcast &lt;ty&gt; &lt;value&gt; to &lt;ty2&gt; <i>; yields ty2</i>
-</pre>
-
-<h5>Overview:</h5>
-<p>The '<tt>bitcast</tt>' instruction converts <tt>value</tt> to type
-<tt>ty2</tt> without changing any bits.</p>
-
-<h5>Arguments:</h5>
-<p>The '<tt>bitcast</tt>' instruction takes a value to cast, which must be
-a first class value, and a type to cast it to, which must also be a <a
- href="#t_firstclass">first class</a> type. The bit sizes of <tt>value</tt>
-and the destination type, <tt>ty2</tt>, must be identical. If the source
-type is a pointer, the destination type must also be a pointer.</p>
-
-<h5>Semantics:</h5>
-<p>The '<tt>bitcast</tt>' instruction converts <tt>value</tt> to type
-<tt>ty2</tt>. It is always a <i>no-op cast</i> because no bits change with
-this conversion. The conversion is done as if the <tt>value</tt> had been
-stored to memory and read back as type <tt>ty2</tt>. Pointer types may only be
-converted to other pointer types with this instruction. To convert pointers to
-other types, use the <a href="#i_inttoptr">inttoptr</a> or
-<a href="#i_ptrtoint">ptrtoint</a> instructions first.</p>
-
-<h5>Example:</h5>
-<pre>
- %X = bitcast i8 255 to i8 <i>; yields i8 :-1</i>
- %Y = bitcast i32* %x to sint* <i>; yields sint*:%x</i>
- %Z = bitcast <2xint> %V to i64; <i>; yields i64: %V</i>
-</pre>
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection"> <a name="otherops">Other Operations</a> </div>
-<div class="doc_text">
-<p>The instructions in this category are the "miscellaneous"
-instructions, which defy better classification.</p>
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection"><a name="i_icmp">'<tt>icmp</tt>' Instruction</a>
-</div>
-<div class="doc_text">
-<h5>Syntax:</h5>
-<pre> &lt;result&gt; = icmp &lt;cond&gt; &lt;ty&gt; &lt;var1&gt;, &lt;var2&gt; <i>; yields {i1}:result</i>
-</pre>
-<h5>Overview:</h5>
-<p>The '<tt>icmp</tt>' instruction returns a boolean value based on comparison
-of its two integer or pointer operands.</p>
-<h5>Arguments:</h5>
-<p>The '<tt>icmp</tt>' instruction takes three operands. The first operand is
-the condition code indicating the kind of comparison to perform. It is not
-a value, just a keyword. The possible condition code are:
-<ol>
- <li><tt>eq</tt>: equal</li>
- <li><tt>ne</tt>: not equal </li>
- <li><tt>ugt</tt>: unsigned greater than</li>
- <li><tt>uge</tt>: unsigned greater or equal</li>
- <li><tt>ult</tt>: unsigned less than</li>
- <li><tt>ule</tt>: unsigned less or equal</li>
- <li><tt>sgt</tt>: signed greater than</li>
- <li><tt>sge</tt>: signed greater or equal</li>
- <li><tt>slt</tt>: signed less than</li>
- <li><tt>sle</tt>: signed less or equal</li>
-</ol>
-<p>The remaining two arguments must be <a href="#t_integer">integer</a> or
-<a href="#t_pointer">pointer</a> typed. They must also be identical types.</p>
-<h5>Semantics:</h5>
-<p>The '<tt>icmp</tt>' compares <tt>var1</tt> and <tt>var2</tt> according to
-the condition code given as <tt>cond</tt>. The comparison performed always
-yields a <a href="#t_primitive">i1</a> result, as follows:
-<ol>
- <li><tt>eq</tt>: yields <tt>true</tt> if the operands are equal,
- <tt>false</tt> otherwise. No sign interpretation is necessary or performed.
- </li>
- <li><tt>ne</tt>: yields <tt>true</tt> if the operands are unequal,
- <tt>false</tt> otherwise. No sign interpretation is necessary or performed.
- <li><tt>ugt</tt>: interprets the operands as unsigned values and yields
- <tt>true</tt> if <tt>var1</tt> is greater than <tt>var2</tt>.</li>
- <li><tt>uge</tt>: interprets the operands as unsigned values and yields
- <tt>true</tt> if <tt>var1</tt> is greater than or equal to <tt>var2</tt>.</li>
- <li><tt>ult</tt>: interprets the operands as unsigned values and yields
- <tt>true</tt> if <tt>var1</tt> is less than <tt>var2</tt>.</li>
- <li><tt>ule</tt>: interprets the operands as unsigned values and yields
- <tt>true</tt> if <tt>var1</tt> is less than or equal to <tt>var2</tt>.</li>
- <li><tt>sgt</tt>: interprets the operands as signed values and yields
- <tt>true</tt> if <tt>var1</tt> is greater than <tt>var2</tt>.</li>
- <li><tt>sge</tt>: interprets the operands as signed values and yields
- <tt>true</tt> if <tt>var1</tt> is greater than or equal to <tt>var2</tt>.</li>
- <li><tt>slt</tt>: interprets the operands as signed values and yields
- <tt>true</tt> if <tt>var1</tt> is less than <tt>var2</tt>.</li>
- <li><tt>sle</tt>: interprets the operands as signed values and yields
- <tt>true</tt> if <tt>var1</tt> is less than or equal to <tt>var2</tt>.</li>
-</ol>
-<p>If the operands are <a href="#t_pointer">pointer</a> typed, the pointer
-values are compared as if they were integers.</p>
-
-<h5>Example:</h5>
-<pre> &lt;result&gt; = icmp eq i32 4, 5 <i>; yields: result=false</i>
- &lt;result&gt; = icmp ne float* %X, %X <i>; yields: result=false</i>
- &lt;result&gt; = icmp ult i16 4, 5 <i>; yields: result=true</i>
- &lt;result&gt; = icmp sgt i16 4, 5 <i>; yields: result=false</i>
- &lt;result&gt; = icmp ule i16 -4, 5 <i>; yields: result=false</i>
- &lt;result&gt; = icmp sge i16 4, 5 <i>; yields: result=false</i>
-</pre>
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection"><a name="i_fcmp">'<tt>fcmp</tt>' Instruction</a>
-</div>
-<div class="doc_text">
-<h5>Syntax:</h5>
-<pre> &lt;result&gt; = fcmp &lt;cond&gt; &lt;ty&gt; &lt;var1&gt;, &lt;var2&gt; <i>; yields {i1}:result</i>
-</pre>
-<h5>Overview:</h5>
-<p>The '<tt>fcmp</tt>' instruction returns a boolean value based on comparison
-of its floating point operands.</p>
-<h5>Arguments:</h5>
-<p>The '<tt>fcmp</tt>' instruction takes three operands. The first operand is
-the condition code indicating the kind of comparison to perform. It is not
-a value, just a keyword. The possible condition code are:
-<ol>
- <li><tt>false</tt>: no comparison, always returns false</li>
- <li><tt>oeq</tt>: ordered and equal</li>
- <li><tt>ogt</tt>: ordered and greater than </li>
- <li><tt>oge</tt>: ordered and greater than or equal</li>
- <li><tt>olt</tt>: ordered and less than </li>
- <li><tt>ole</tt>: ordered and less than or equal</li>
- <li><tt>one</tt>: ordered and not equal</li>
- <li><tt>ord</tt>: ordered (no nans)</li>
- <li><tt>ueq</tt>: unordered or equal</li>
- <li><tt>ugt</tt>: unordered or greater than </li>
- <li><tt>uge</tt>: unordered or greater than or equal</li>
- <li><tt>ult</tt>: unordered or less than </li>
- <li><tt>ule</tt>: unordered or less than or equal</li>
- <li><tt>une</tt>: unordered or not equal</li>
- <li><tt>uno</tt>: unordered (either nans)</li>
- <li><tt>true</tt>: no comparison, always returns true</li>
-</ol>
-<p><i>Ordered</i> means that neither operand is a QNAN while
-<i>unordered</i> means that either operand may be a QNAN.</p>
-<p>The <tt>val1</tt> and <tt>val2</tt> arguments must be
-<a href="#t_floating">floating point</a> typed. They must have identical
-types.</p>
-<h5>Semantics:</h5>
-<p>The '<tt>fcmp</tt>' compares <tt>var1</tt> and <tt>var2</tt> according to
-the condition code given as <tt>cond</tt>. The comparison performed always
-yields a <a href="#t_primitive">i1</a> result, as follows:
-<ol>
- <li><tt>false</tt>: always yields <tt>false</tt>, regardless of operands.</li>
- <li><tt>oeq</tt>: yields <tt>true</tt> if both operands are not a QNAN and
- <tt>var1</tt> is equal to <tt>var2</tt>.</li>
- <li><tt>ogt</tt>: yields <tt>true</tt> if both operands are not a QNAN and
- <tt>var1</tt> is greather than <tt>var2</tt>.</li>
- <li><tt>oge</tt>: yields <tt>true</tt> if both operands are not a QNAN and
- <tt>var1</tt> is greater than or equal to <tt>var2</tt>.</li>
- <li><tt>olt</tt>: yields <tt>true</tt> if both operands are not a QNAN and
- <tt>var1</tt> is less than <tt>var2</tt>.</li>
- <li><tt>ole</tt>: yields <tt>true</tt> if both operands are not a QNAN and
- <tt>var1</tt> is less than or equal to <tt>var2</tt>.</li>
- <li><tt>one</tt>: yields <tt>true</tt> if both operands are not a QNAN and
- <tt>var1</tt> is not equal to <tt>var2</tt>.</li>
- <li><tt>ord</tt>: yields <tt>true</tt> if both operands are not a QNAN.</li>
- <li><tt>ueq</tt>: yields <tt>true</tt> if either operand is a QNAN or
- <tt>var1</tt> is equal to <tt>var2</tt>.</li>
- <li><tt>ugt</tt>: yields <tt>true</tt> if either operand is a QNAN or
- <tt>var1</tt> is greater than <tt>var2</tt>.</li>
- <li><tt>uge</tt>: yields <tt>true</tt> if either operand is a QNAN or
- <tt>var1</tt> is greater than or equal to <tt>var2</tt>.</li>
- <li><tt>ult</tt>: yields <tt>true</tt> if either operand is a QNAN or
- <tt>var1</tt> is less than <tt>var2</tt>.</li>
- <li><tt>ule</tt>: yields <tt>true</tt> if either operand is a QNAN or
- <tt>var1</tt> is less than or equal to <tt>var2</tt>.</li>
- <li><tt>une</tt>: yields <tt>true</tt> if either operand is a QNAN or
- <tt>var1</tt> is not equal to <tt>var2</tt>.</li>
- <li><tt>uno</tt>: yields <tt>true</tt> if either operand is a QNAN.</li>
- <li><tt>true</tt>: always yields <tt>true</tt>, regardless of operands.</li>
-</ol>
-
-<h5>Example:</h5>
-<pre> &lt;result&gt; = fcmp oeq float 4.0, 5.0 <i>; yields: result=false</i>
- &lt;result&gt; = icmp one float 4.0, 5.0 <i>; yields: result=true</i>
- &lt;result&gt; = icmp olt float 4.0, 5.0 <i>; yields: result=true</i>
- &lt;result&gt; = icmp ueq double 1.0, 2.0 <i>; yields: result=false</i>
-</pre>
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection"> <a name="i_phi">'<tt>phi</tt>'
-Instruction</a> </div>
-<div class="doc_text">
-<h5>Syntax:</h5>
-<pre> &lt;result&gt; = phi &lt;ty&gt; [ &lt;val0&gt;, &lt;label0&gt;], ...<br></pre>
-<h5>Overview:</h5>
-<p>The '<tt>phi</tt>' instruction is used to implement the &#966; node in
-the SSA graph representing the function.</p>
-<h5>Arguments:</h5>
-<p>The type of the incoming values is specified with the first type
-field. After this, the '<tt>phi</tt>' instruction takes a list of pairs
-as arguments, with one pair for each predecessor basic block of the
-current block. Only values of <a href="#t_firstclass">first class</a>
-type may be used as the value arguments to the PHI node. Only labels
-may be used as the label arguments.</p>
-<p>There must be no non-phi instructions between the start of a basic
-block and the PHI instructions: i.e. PHI instructions must be first in
-a basic block.</p>
-<h5>Semantics:</h5>
-<p>At runtime, the '<tt>phi</tt>' instruction logically takes on the value
-specified by the pair corresponding to the predecessor basic block that executed
-just prior to the current block.</p>
-<h5>Example:</h5>
-<pre>Loop: ; Infinite loop that counts from 0 on up...<br> %indvar = phi i32 [ 0, %LoopHeader ], [ %nextindvar, %Loop ]<br> %nextindvar = add i32 %indvar, 1<br> br label %Loop<br></pre>
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="i_select">'<tt>select</tt>' Instruction</a>
-</div>
-
-<div class="doc_text">
-
-<h5>Syntax:</h5>
-
-<pre>
- &lt;result&gt; = select i1 &lt;cond&gt;, &lt;ty&gt; &lt;val1&gt;, &lt;ty&gt; &lt;val2&gt; <i>; yields ty</i>
-</pre>
-
-<h5>Overview:</h5>
-
-<p>
-The '<tt>select</tt>' instruction is used to choose one value based on a
-condition, without branching.
-</p>
-
-
-<h5>Arguments:</h5>
-
-<p>
-The '<tt>select</tt>' instruction requires a boolean value indicating the condition, and two values of the same <a href="#t_firstclass">first class</a> type.
-</p>
-
-<h5>Semantics:</h5>
-
-<p>
-If the boolean condition evaluates to true, the instruction returns the first
-value argument; otherwise, it returns the second value argument.
-</p>
-
-<h5>Example:</h5>
-
-<pre>
- %X = select i1 true, i8 17, i8 42 <i>; yields i8:17</i>
-</pre>
-</div>
-
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="i_call">'<tt>call</tt>' Instruction</a>
-</div>
-
-<div class="doc_text">
-
-<h5>Syntax:</h5>
-<pre>
- &lt;result&gt; = [tail] call [<a href="#callingconv">cconv</a>] &lt;ty&gt; [&lt;fnty&gt;*] &lt;fnptrval&gt;(&lt;param list&gt;)
-</pre>
-
-<h5>Overview:</h5>
-
-<p>The '<tt>call</tt>' instruction represents a simple function call.</p>
-
-<h5>Arguments:</h5>
-
-<p>This instruction requires several arguments:</p>
-
-<ol>
- <li>
- <p>The optional "tail" marker indicates whether the callee function accesses
- any allocas or varargs in the caller. If the "tail" marker is present, the
- function call is eligible for tail call optimization. Note that calls may
- be marked "tail" even if they do not occur before a <a
- href="#i_ret"><tt>ret</tt></a> instruction.
- </li>
- <li>
- <p>The optional "cconv" marker indicates which <a href="#callingconv">calling
- convention</a> the call should use. If none is specified, the call defaults
- to using C calling conventions.
- </li>
- <li>
- <p>'<tt>ty</tt>': the type of the call instruction itself which is also
- the type of the return value. Functions that return no value are marked
- <tt><a href="#t_void">void</a></tt>.</p>
- </li>
- <li>
- <p>'<tt>fnty</tt>': shall be the signature of the pointer to function
- value being invoked. The argument types must match the types implied by
- this signature. This type can be omitted if the function is not varargs
- and if the function type does not return a pointer to a function.</p>
- </li>
- <li>
- <p>'<tt>fnptrval</tt>': An LLVM value containing a pointer to a function to
- be invoked. In most cases, this is a direct function invocation, but
- indirect <tt>call</tt>s are just as possible, calling an arbitrary pointer
- to function value.</p>
- </li>
- <li>
- <p>'<tt>function args</tt>': argument list whose types match the
- function signature argument types. All arguments must be of
- <a href="#t_firstclass">first class</a> type. If the function signature
- indicates the function accepts a variable number of arguments, the extra
- arguments can be specified.</p>
- </li>
-</ol>
-
-<h5>Semantics:</h5>
-
-<p>The '<tt>call</tt>' instruction is used to cause control flow to
-transfer to a specified function, with its incoming arguments bound to
-the specified values. Upon a '<tt><a href="#i_ret">ret</a></tt>'
-instruction in the called function, control flow continues with the
-instruction after the function call, and the return value of the
-function is bound to the result argument. If the callee returns multiple
-values then the return values of the function are only accessible through
-the '<tt><a href="#i_getresult">getresult</a></tt>' instruction.</p>
-
-<h5>Example:</h5>
-
-<pre>
- %retval = call i32 @test(i32 %argc)
- call i32 (i8 *, ...)* @printf(i8 * %msg, i32 12, i8 42) <i>; yields i32</i>
- %X = tail call i32 @foo() <i>; yields i32</i>
- %Y = tail call <a href="#callingconv">fastcc</a> i32 @foo() <i>; yields i32</i>
- call void %foo(i8 97 signext)
-
- %struct.A = type { i32, i8 }
- %r = call %struct.A @foo() <i>; yields { 32, i8 }</i>
- %gr = getresult %struct.A %r, 0 <i>; yields i32</i>
- %gr1 = getresult %struct.A %r, 1 <i>; yields i8</i>
-</pre>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="i_va_arg">'<tt>va_arg</tt>' Instruction</a>
-</div>
-
-<div class="doc_text">
-
-<h5>Syntax:</h5>
-
-<pre>
- &lt;resultval&gt; = va_arg &lt;va_list*&gt; &lt;arglist&gt;, &lt;argty&gt;
-</pre>
-
-<h5>Overview:</h5>
-
-<p>The '<tt>va_arg</tt>' instruction is used to access arguments passed through
-the "variable argument" area of a function call. It is used to implement the
-<tt>va_arg</tt> macro in C.</p>
-
-<h5>Arguments:</h5>
-
-<p>This instruction takes a <tt>va_list*</tt> value and the type of
-the argument. It returns a value of the specified argument type and
-increments the <tt>va_list</tt> to point to the next argument. The
-actual type of <tt>va_list</tt> is target specific.</p>
-
-<h5>Semantics:</h5>
-
-<p>The '<tt>va_arg</tt>' instruction loads an argument of the specified
-type from the specified <tt>va_list</tt> and causes the
-<tt>va_list</tt> to point to the next argument. For more information,
-see the variable argument handling <a href="#int_varargs">Intrinsic
-Functions</a>.</p>
-
-<p>It is legal for this instruction to be called in a function which does not
-take a variable number of arguments, for example, the <tt>vfprintf</tt>
-function.</p>
-
-<p><tt>va_arg</tt> is an LLVM instruction instead of an <a
-href="#intrinsics">intrinsic function</a> because it takes a type as an
-argument.</p>
-
-<h5>Example:</h5>
-
-<p>See the <a href="#int_varargs">variable argument processing</a> section.</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="i_getresult">'<tt>getresult</tt>' Instruction</a>
-</div>
-
-<div class="doc_text">
-
-<h5>Syntax:</h5>
-<pre>
- &lt;resultval&gt; = getresult &lt;type&gt; &lt;retval&gt;, &lt;index&gt;
-</pre>
-
-<h5>Overview:</h5>
-
-<p> The '<tt>getresult</tt>' instruction is used to extract individual values
-from a '<tt><a href="#i_call">call</a></tt>'
-or '<tt><a href="#i_invoke">invoke</a></tt>' instruction that returns multiple
-results.</p>
-
-<h5>Arguments:</h5>
-
-<p>The '<tt>getresult</tt>' instruction takes a call or invoke value as its
-first argument, or an undef value. The value must have <a
-href="#t_struct">structure type</a>. The second argument is a constant
-unsigned index value which must be in range for the number of values returned
-by the call.</p>
-
-<h5>Semantics:</h5>
-
-<p>The '<tt>getresult</tt>' instruction extracts the element identified by
-'<tt>index</tt>' from the aggregate value.</p>
-
-<h5>Example:</h5>
-
-<pre>
- %struct.A = type { i32, i8 }
-
- %r = call %struct.A @foo()
- %gr = getresult %struct.A %r, 0 <i>; yields i32:%gr</i>
- %gr1 = getresult %struct.A %r, 1 <i>; yields i8:%gr1</i>
- add i32 %gr, 42
- add i8 %gr1, 41
-</pre>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section"> <a name="intrinsics">Intrinsic Functions</a> </div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>LLVM supports the notion of an "intrinsic function". These functions have
-well known names and semantics and are required to follow certain restrictions.
-Overall, these intrinsics represent an extension mechanism for the LLVM
-language that does not require changing all of the transformations in LLVM when
-adding to the language (or the bitcode reader/writer, the parser, etc...).</p>
-
-<p>Intrinsic function names must all start with an "<tt>llvm.</tt>" prefix. This
-prefix is reserved in LLVM for intrinsic names; thus, function names may not
-begin with this prefix. Intrinsic functions must always be external functions:
-you cannot define the body of intrinsic functions. Intrinsic functions may
-only be used in call or invoke instructions: it is illegal to take the address
-of an intrinsic function. Additionally, because intrinsic functions are part
-of the LLVM language, it is required if any are added that they be documented
-here.</p>
-
-<p>Some intrinsic functions can be overloaded, i.e., the intrinsic represents
-a family of functions that perform the same operation but on different data
-types. Because LLVM can represent over 8 million different integer types,
-overloading is used commonly to allow an intrinsic function to operate on any
-integer type. One or more of the argument types or the result type can be
-overloaded to accept any integer type. Argument types may also be defined as
-exactly matching a previous argument's type or the result type. This allows an
-intrinsic function which accepts multiple arguments, but needs all of them to
-be of the same type, to only be overloaded with respect to a single argument or
-the result.</p>
-
-<p>Overloaded intrinsics will have the names of its overloaded argument types
-encoded into its function name, each preceded by a period. Only those types
-which are overloaded result in a name suffix. Arguments whose type is matched
-against another type do not. For example, the <tt>llvm.ctpop</tt> function can
-take an integer of any width and returns an integer of exactly the same integer
-width. This leads to a family of functions such as
-<tt>i8 @llvm.ctpop.i8(i8 %val)</tt> and <tt>i29 @llvm.ctpop.i29(i29 %val)</tt>.
-Only one type, the return type, is overloaded, and only one type suffix is
-required. Because the argument's type is matched against the return type, it
-does not require its own name suffix.</p>
-
-<p>To learn how to add an intrinsic function, please see the
-<a href="ExtendingLLVM.html">Extending LLVM Guide</a>.
-</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="int_varargs">Variable Argument Handling Intrinsics</a>
-</div>
-
-<div class="doc_text">
-
-<p>Variable argument support is defined in LLVM with the <a
- href="#i_va_arg"><tt>va_arg</tt></a> instruction and these three
-intrinsic functions. These functions are related to the similarly
-named macros defined in the <tt>&lt;stdarg.h&gt;</tt> header file.</p>
-
-<p>All of these functions operate on arguments that use a
-target-specific value type "<tt>va_list</tt>". The LLVM assembly
-language reference manual does not define what this type is, so all
-transformations should be prepared to handle these functions regardless of
-the type used.</p>
-
-<p>This example shows how the <a href="#i_va_arg"><tt>va_arg</tt></a>
-instruction and the variable argument handling intrinsic functions are
-used.</p>
-
-<div class="doc_code">
-<pre>
-define i32 @test(i32 %X, ...) {
- ; Initialize variable argument processing
- %ap = alloca i8*
- %ap2 = bitcast i8** %ap to i8*
- call void @llvm.va_start(i8* %ap2)
-
- ; Read a single integer argument
- %tmp = va_arg i8** %ap, i32
-
- ; Demonstrate usage of llvm.va_copy and llvm.va_end
- %aq = alloca i8*
- %aq2 = bitcast i8** %aq to i8*
- call void @llvm.va_copy(i8* %aq2, i8* %ap2)
- call void @llvm.va_end(i8* %aq2)
-
- ; Stop processing of arguments.
- call void @llvm.va_end(i8* %ap2)
- ret i32 %tmp
-}
-
-declare void @llvm.va_start(i8*)
-declare void @llvm.va_copy(i8*, i8*)
-declare void @llvm.va_end(i8*)
-</pre>
-</div>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="int_va_start">'<tt>llvm.va_start</tt>' Intrinsic</a>
-</div>
-
-
-<div class="doc_text">
-<h5>Syntax:</h5>
-<pre> declare void %llvm.va_start(i8* &lt;arglist&gt;)<br></pre>
-<h5>Overview:</h5>
-<P>The '<tt>llvm.va_start</tt>' intrinsic initializes
-<tt>*&lt;arglist&gt;</tt> for subsequent use by <tt><a
-href="#i_va_arg">va_arg</a></tt>.</p>
-
-<h5>Arguments:</h5>
-
-<P>The argument is a pointer to a <tt>va_list</tt> element to initialize.</p>
-
-<h5>Semantics:</h5>
-
-<P>The '<tt>llvm.va_start</tt>' intrinsic works just like the <tt>va_start</tt>
-macro available in C. In a target-dependent way, it initializes the
-<tt>va_list</tt> element to which the argument points, so that the next call to
-<tt>va_arg</tt> will produce the first variable argument passed to the function.
-Unlike the C <tt>va_start</tt> macro, this intrinsic does not need to know the
-last argument of the function as the compiler can figure that out.</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="int_va_end">'<tt>llvm.va_end</tt>' Intrinsic</a>
-</div>
-
-<div class="doc_text">
-<h5>Syntax:</h5>
-<pre> declare void @llvm.va_end(i8* &lt;arglist&gt;)<br></pre>
-<h5>Overview:</h5>
-
-<p>The '<tt>llvm.va_end</tt>' intrinsic destroys <tt>*&lt;arglist&gt;</tt>,
-which has been initialized previously with <tt><a href="#int_va_start">llvm.va_start</a></tt>
-or <tt><a href="#i_va_copy">llvm.va_copy</a></tt>.</p>
-
-<h5>Arguments:</h5>
-
-<p>The argument is a pointer to a <tt>va_list</tt> to destroy.</p>
-
-<h5>Semantics:</h5>
-
-<p>The '<tt>llvm.va_end</tt>' intrinsic works just like the <tt>va_end</tt>
-macro available in C. In a target-dependent way, it destroys the
-<tt>va_list</tt> element to which the argument points. Calls to <a
-href="#int_va_start"><tt>llvm.va_start</tt></a> and <a href="#int_va_copy">
-<tt>llvm.va_copy</tt></a> must be matched exactly with calls to
-<tt>llvm.va_end</tt>.</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="int_va_copy">'<tt>llvm.va_copy</tt>' Intrinsic</a>
-</div>
-
-<div class="doc_text">
-
-<h5>Syntax:</h5>
-
-<pre>
- declare void @llvm.va_copy(i8* &lt;destarglist&gt;, i8* &lt;srcarglist&gt;)
-</pre>
-
-<h5>Overview:</h5>
-
-<p>The '<tt>llvm.va_copy</tt>' intrinsic copies the current argument position
-from the source argument list to the destination argument list.</p>
-
-<h5>Arguments:</h5>
-
-<p>The first argument is a pointer to a <tt>va_list</tt> element to initialize.
-The second argument is a pointer to a <tt>va_list</tt> element to copy from.</p>
-
-
-<h5>Semantics:</h5>
-
-<p>The '<tt>llvm.va_copy</tt>' intrinsic works just like the <tt>va_copy</tt>
-macro available in C. In a target-dependent way, it copies the source
-<tt>va_list</tt> element into the destination <tt>va_list</tt> element. This
-intrinsic is necessary because the <tt><a href="#int_va_start">
-llvm.va_start</a></tt> intrinsic may be arbitrarily complex and require, for
-example, memory allocation.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="int_gc">Accurate Garbage Collection Intrinsics</a>
-</div>
-
-<div class="doc_text">
-
-<p>
-LLVM support for <a href="GarbageCollection.html">Accurate Garbage
-Collection</a> requires the implementation and generation of these intrinsics.
-These intrinsics allow identification of <a href="#int_gcroot">GC roots on the
-stack</a>, as well as garbage collector implementations that require <a
-href="#int_gcread">read</a> and <a href="#int_gcwrite">write</a> barriers.
-Front-ends for type-safe garbage collected languages should generate these
-intrinsics to make use of the LLVM garbage collectors. For more details, see <a
-href="GarbageCollection.html">Accurate Garbage Collection with LLVM</a>.
-</p>
-
-<p>The garbage collection intrinsics only operate on objects in the generic
- address space (address space zero).</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="int_gcroot">'<tt>llvm.gcroot</tt>' Intrinsic</a>
-</div>
-
-<div class="doc_text">
-
-<h5>Syntax:</h5>
-
-<pre>
- declare void @llvm.gcroot(i8** %ptrloc, i8* %metadata)
-</pre>
-
-<h5>Overview:</h5>
-
-<p>The '<tt>llvm.gcroot</tt>' intrinsic declares the existence of a GC root to
-the code generator, and allows some metadata to be associated with it.</p>
-
-<h5>Arguments:</h5>
-
-<p>The first argument specifies the address of a stack object that contains the
-root pointer. The second pointer (which must be either a constant or a global
-value address) contains the meta-data to be associated with the root.</p>
-
-<h5>Semantics:</h5>
-
-<p>At runtime, a call to this intrinsic stores a null pointer into the "ptrloc"
-location. At compile-time, the code generator generates information to allow
-the runtime to find the pointer at GC safe points. The '<tt>llvm.gcroot</tt>'
-intrinsic may only be used in a function which <a href="#gc">specifies a GC
-algorithm</a>.</p>
-
-</div>
-
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="int_gcread">'<tt>llvm.gcread</tt>' Intrinsic</a>
-</div>
-
-<div class="doc_text">
-
-<h5>Syntax:</h5>
-
-<pre>
- declare i8* @llvm.gcread(i8* %ObjPtr, i8** %Ptr)
-</pre>
-
-<h5>Overview:</h5>
-
-<p>The '<tt>llvm.gcread</tt>' intrinsic identifies reads of references from heap
-locations, allowing garbage collector implementations that require read
-barriers.</p>
-
-<h5>Arguments:</h5>
-
-<p>The second argument is the address to read from, which should be an address
-allocated from the garbage collector. The first object is a pointer to the
-start of the referenced object, if needed by the language runtime (otherwise
-null).</p>
-
-<h5>Semantics:</h5>
-
-<p>The '<tt>llvm.gcread</tt>' intrinsic has the same semantics as a load
-instruction, but may be replaced with substantially more complex code by the
-garbage collector runtime, as needed. The '<tt>llvm.gcread</tt>' intrinsic
-may only be used in a function which <a href="#gc">specifies a GC
-algorithm</a>.</p>
-
-</div>
-
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="int_gcwrite">'<tt>llvm.gcwrite</tt>' Intrinsic</a>
-</div>
-
-<div class="doc_text">
-
-<h5>Syntax:</h5>
-
-<pre>
- declare void @llvm.gcwrite(i8* %P1, i8* %Obj, i8** %P2)
-</pre>
-
-<h5>Overview:</h5>
-
-<p>The '<tt>llvm.gcwrite</tt>' intrinsic identifies writes of references to heap
-locations, allowing garbage collector implementations that require write
-barriers (such as generational or reference counting collectors).</p>
-
-<h5>Arguments:</h5>
-
-<p>The first argument is the reference to store, the second is the start of the
-object to store it to, and the third is the address of the field of Obj to
-store to. If the runtime does not require a pointer to the object, Obj may be
-null.</p>
-
-<h5>Semantics:</h5>
-
-<p>The '<tt>llvm.gcwrite</tt>' intrinsic has the same semantics as a store
-instruction, but may be replaced with substantially more complex code by the
-garbage collector runtime, as needed. The '<tt>llvm.gcwrite</tt>' intrinsic
-may only be used in a function which <a href="#gc">specifies a GC
-algorithm</a>.</p>
-
-</div>
-
-
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="int_codegen">Code Generator Intrinsics</a>
-</div>
-
-<div class="doc_text">
-<p>
-These intrinsics are provided by LLVM to expose special features that may only
-be implemented with code generator support.
-</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="int_returnaddress">'<tt>llvm.returnaddress</tt>' Intrinsic</a>
-</div>
-
-<div class="doc_text">
-
-<h5>Syntax:</h5>
-<pre>
- declare i8 *@llvm.returnaddress(i32 &lt;level&gt;)
-</pre>
-
-<h5>Overview:</h5>
-
-<p>
-The '<tt>llvm.returnaddress</tt>' intrinsic attempts to compute a
-target-specific value indicating the return address of the current function
-or one of its callers.
-</p>
-
-<h5>Arguments:</h5>
-
-<p>
-The argument to this intrinsic indicates which function to return the address
-for. Zero indicates the calling function, one indicates its caller, etc. The
-argument is <b>required</b> to be a constant integer value.
-</p>
-
-<h5>Semantics:</h5>
-
-<p>
-The '<tt>llvm.returnaddress</tt>' intrinsic either returns a pointer indicating
-the return address of the specified call frame, or zero if it cannot be
-identified. The value returned by this intrinsic is likely to be incorrect or 0
-for arguments other than zero, so it should only be used for debugging purposes.
-</p>
-
-<p>
-Note that calling this intrinsic does not prevent function inlining or other
-aggressive transformations, so the value returned may not be that of the obvious
-source-language caller.
-</p>
-</div>
-
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="int_frameaddress">'<tt>llvm.frameaddress</tt>' Intrinsic</a>
-</div>
-
-<div class="doc_text">
-
-<h5>Syntax:</h5>
-<pre>
- declare i8 *@llvm.frameaddress(i32 &lt;level&gt;)
-</pre>
-
-<h5>Overview:</h5>
-
-<p>
-The '<tt>llvm.frameaddress</tt>' intrinsic attempts to return the
-target-specific frame pointer value for the specified stack frame.
-</p>
-
-<h5>Arguments:</h5>
-
-<p>
-The argument to this intrinsic indicates which function to return the frame
-pointer for. Zero indicates the calling function, one indicates its caller,
-etc. The argument is <b>required</b> to be a constant integer value.
-</p>
-
-<h5>Semantics:</h5>
-
-<p>
-The '<tt>llvm.frameaddress</tt>' intrinsic either returns a pointer indicating
-the frame address of the specified call frame, or zero if it cannot be
-identified. The value returned by this intrinsic is likely to be incorrect or 0
-for arguments other than zero, so it should only be used for debugging purposes.
-</p>
-
-<p>
-Note that calling this intrinsic does not prevent function inlining or other
-aggressive transformations, so the value returned may not be that of the obvious
-source-language caller.
-</p>
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="int_stacksave">'<tt>llvm.stacksave</tt>' Intrinsic</a>
-</div>
-
-<div class="doc_text">
-
-<h5>Syntax:</h5>
-<pre>
- declare i8 *@llvm.stacksave()
-</pre>
-
-<h5>Overview:</h5>
-
-<p>
-The '<tt>llvm.stacksave</tt>' intrinsic is used to remember the current state of
-the function stack, for use with <a href="#int_stackrestore">
-<tt>llvm.stackrestore</tt></a>. This is useful for implementing language
-features like scoped automatic variable sized arrays in C99.
-</p>
-
-<h5>Semantics:</h5>
-
-<p>
-This intrinsic returns a opaque pointer value that can be passed to <a
-href="#int_stackrestore"><tt>llvm.stackrestore</tt></a>. When an
-<tt>llvm.stackrestore</tt> intrinsic is executed with a value saved from
-<tt>llvm.stacksave</tt>, it effectively restores the state of the stack to the
-state it was in when the <tt>llvm.stacksave</tt> intrinsic executed. In
-practice, this pops any <a href="#i_alloca">alloca</a> blocks from the stack
-that were allocated after the <tt>llvm.stacksave</tt> was executed.
-</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="int_stackrestore">'<tt>llvm.stackrestore</tt>' Intrinsic</a>
-</div>
-
-<div class="doc_text">
-
-<h5>Syntax:</h5>
-<pre>
- declare void @llvm.stackrestore(i8 * %ptr)
-</pre>
-
-<h5>Overview:</h5>
-
-<p>
-The '<tt>llvm.stackrestore</tt>' intrinsic is used to restore the state of
-the function stack to the state it was in when the corresponding <a
-href="#int_stacksave"><tt>llvm.stacksave</tt></a> intrinsic executed. This is
-useful for implementing language features like scoped automatic variable sized
-arrays in C99.
-</p>
-
-<h5>Semantics:</h5>
-
-<p>
-See the description for <a href="#int_stacksave"><tt>llvm.stacksave</tt></a>.
-</p>
-
-</div>
-
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="int_prefetch">'<tt>llvm.prefetch</tt>' Intrinsic</a>
-</div>
-
-<div class="doc_text">
-
-<h5>Syntax:</h5>
-<pre>
- declare void @llvm.prefetch(i8* &lt;address&gt;, i32 &lt;rw&gt;, i32 &lt;locality&gt;)
-</pre>
-
-<h5>Overview:</h5>
-
-
-<p>
-The '<tt>llvm.prefetch</tt>' intrinsic is a hint to the code generator to insert
-a prefetch instruction if supported; otherwise, it is a noop. Prefetches have
-no
-effect on the behavior of the program but can change its performance
-characteristics.
-</p>
-
-<h5>Arguments:</h5>
-
-<p>
-<tt>address</tt> is the address to be prefetched, <tt>rw</tt> is the specifier
-determining if the fetch should be for a read (0) or write (1), and
-<tt>locality</tt> is a temporal locality specifier ranging from (0) - no
-locality, to (3) - extremely local keep in cache. The <tt>rw</tt> and
-<tt>locality</tt> arguments must be constant integers.
-</p>
-
-<h5>Semantics:</h5>
-
-<p>
-This intrinsic does not modify the behavior of the program. In particular,
-prefetches cannot trap and do not produce a value. On targets that support this
-intrinsic, the prefetch can provide hints to the processor cache for better
-performance.
-</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="int_pcmarker">'<tt>llvm.pcmarker</tt>' Intrinsic</a>
-</div>
-
-<div class="doc_text">
-
-<h5>Syntax:</h5>
-<pre>
- declare void @llvm.pcmarker(i32 &lt;id&gt;)
-</pre>
-
-<h5>Overview:</h5>
-
-
-<p>
-The '<tt>llvm.pcmarker</tt>' intrinsic is a method to export a Program Counter
-(PC) in a region of
-code to simulators and other tools. The method is target specific, but it is
-expected that the marker will use exported symbols to transmit the PC of the marker.
-The marker makes no guarantees that it will remain with any specific instruction
-after optimizations. It is possible that the presence of a marker will inhibit
-optimizations. The intended use is to be inserted after optimizations to allow
-correlations of simulation runs.
-</p>
-
-<h5>Arguments:</h5>
-
-<p>
-<tt>id</tt> is a numerical id identifying the marker.
-</p>
-
-<h5>Semantics:</h5>
-
-<p>
-This intrinsic does not modify the behavior of the program. Backends that do not
-support this intrinisic may ignore it.
-</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="int_readcyclecounter">'<tt>llvm.readcyclecounter</tt>' Intrinsic</a>
-</div>
-
-<div class="doc_text">
-
-<h5>Syntax:</h5>
-<pre>
- declare i64 @llvm.readcyclecounter( )
-</pre>
-
-<h5>Overview:</h5>
-
-
-<p>
-The '<tt>llvm.readcyclecounter</tt>' intrinsic provides access to the cycle
-counter register (or similar low latency, high accuracy clocks) on those targets
-that support it. On X86, it should map to RDTSC. On Alpha, it should map to RPCC.
-As the backing counters overflow quickly (on the order of 9 seconds on alpha), this
-should only be used for small timings.
-</p>
-
-<h5>Semantics:</h5>
-
-<p>
-When directly supported, reading the cycle counter should not modify any memory.
-Implementations are allowed to either return a application specific value or a
-system wide value. On backends without support, this is lowered to a constant 0.
-</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="int_libc">Standard C Library Intrinsics</a>
-</div>
-
-<div class="doc_text">
-<p>
-LLVM provides intrinsics for a few important standard C library functions.
-These intrinsics allow source-language front-ends to pass information about the
-alignment of the pointer arguments to the code generator, providing opportunity
-for more efficient code generation.
-</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="int_memcpy">'<tt>llvm.memcpy</tt>' Intrinsic</a>
-</div>
-
-<div class="doc_text">
-
-<h5>Syntax:</h5>
-<pre>
- declare void @llvm.memcpy.i32(i8 * &lt;dest&gt;, i8 * &lt;src&gt;,
- i32 &lt;len&gt;, i32 &lt;align&gt;)
- declare void @llvm.memcpy.i64(i8 * &lt;dest&gt;, i8 * &lt;src&gt;,
- i64 &lt;len&gt;, i32 &lt;align&gt;)
-</pre>
-
-<h5>Overview:</h5>
-
-<p>
-The '<tt>llvm.memcpy.*</tt>' intrinsics copy a block of memory from the source
-location to the destination location.
-</p>
-
-<p>
-Note that, unlike the standard libc function, the <tt>llvm.memcpy.*</tt>
-intrinsics do not return a value, and takes an extra alignment argument.
-</p>
-
-<h5>Arguments:</h5>
-
-<p>
-The first argument is a pointer to the destination, the second is a pointer to
-the source. The third argument is an integer argument
-specifying the number of bytes to copy, and the fourth argument is the alignment
-of the source and destination locations.
-</p>
-
-<p>
-If the call to this intrinisic has an alignment value that is not 0 or 1, then
-the caller guarantees that both the source and destination pointers are aligned
-to that boundary.
-</p>
-
-<h5>Semantics:</h5>
-
-<p>
-The '<tt>llvm.memcpy.*</tt>' intrinsics copy a block of memory from the source
-location to the destination location, which are not allowed to overlap. It
-copies "len" bytes of memory over. If the argument is known to be aligned to
-some boundary, this can be specified as the fourth argument, otherwise it should
-be set to 0 or 1.
-</p>
-</div>
-
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="int_memmove">'<tt>llvm.memmove</tt>' Intrinsic</a>
-</div>
-
-<div class="doc_text">
-
-<h5>Syntax:</h5>
-<pre>
- declare void @llvm.memmove.i32(i8 * &lt;dest&gt;, i8 * &lt;src&gt;,
- i32 &lt;len&gt;, i32 &lt;align&gt;)
- declare void @llvm.memmove.i64(i8 * &lt;dest&gt;, i8 * &lt;src&gt;,
- i64 &lt;len&gt;, i32 &lt;align&gt;)
-</pre>
-
-<h5>Overview:</h5>
-
-<p>
-The '<tt>llvm.memmove.*</tt>' intrinsics move a block of memory from the source
-location to the destination location. It is similar to the
-'<tt>llvm.memcpy</tt>' intrinsic but allows the two memory locations to overlap.
-</p>
-
-<p>
-Note that, unlike the standard libc function, the <tt>llvm.memmove.*</tt>
-intrinsics do not return a value, and takes an extra alignment argument.
-</p>
-
-<h5>Arguments:</h5>
-
-<p>
-The first argument is a pointer to the destination, the second is a pointer to
-the source. The third argument is an integer argument
-specifying the number of bytes to copy, and the fourth argument is the alignment
-of the source and destination locations.
-</p>
-
-<p>
-If the call to this intrinisic has an alignment value that is not 0 or 1, then
-the caller guarantees that the source and destination pointers are aligned to
-that boundary.
-</p>
-
-<h5>Semantics:</h5>
-
-<p>
-The '<tt>llvm.memmove.*</tt>' intrinsics copy a block of memory from the source
-location to the destination location, which may overlap. It
-copies "len" bytes of memory over. If the argument is known to be aligned to
-some boundary, this can be specified as the fourth argument, otherwise it should
-be set to 0 or 1.
-</p>
-</div>
-
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="int_memset">'<tt>llvm.memset.*</tt>' Intrinsics</a>
-</div>
-
-<div class="doc_text">
-
-<h5>Syntax:</h5>
-<pre>
- declare void @llvm.memset.i32(i8 * &lt;dest&gt;, i8 &lt;val&gt;,
- i32 &lt;len&gt;, i32 &lt;align&gt;)
- declare void @llvm.memset.i64(i8 * &lt;dest&gt;, i8 &lt;val&gt;,
- i64 &lt;len&gt;, i32 &lt;align&gt;)
-</pre>
-
-<h5>Overview:</h5>
-
-<p>
-The '<tt>llvm.memset.*</tt>' intrinsics fill a block of memory with a particular
-byte value.
-</p>
-
-<p>
-Note that, unlike the standard libc function, the <tt>llvm.memset</tt> intrinsic
-does not return a value, and takes an extra alignment argument.
-</p>
-
-<h5>Arguments:</h5>
-
-<p>
-The first argument is a pointer to the destination to fill, the second is the
-byte value to fill it with, the third argument is an integer
-argument specifying the number of bytes to fill, and the fourth argument is the
-known alignment of destination location.
-</p>
-
-<p>
-If the call to this intrinisic has an alignment value that is not 0 or 1, then
-the caller guarantees that the destination pointer is aligned to that boundary.
-</p>
-
-<h5>Semantics:</h5>
-
-<p>
-The '<tt>llvm.memset.*</tt>' intrinsics fill "len" bytes of memory starting at
-the
-destination location. If the argument is known to be aligned to some boundary,
-this can be specified as the fourth argument, otherwise it should be set to 0 or
-1.
-</p>
-</div>
-
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="int_sqrt">'<tt>llvm.sqrt.*</tt>' Intrinsic</a>
-</div>
-
-<div class="doc_text">
-
-<h5>Syntax:</h5>
-<p>This is an overloaded intrinsic. You can use <tt>llvm.sqrt</tt> on any
-floating point or vector of floating point type. Not all targets support all
-types however.
-<pre>
- declare float @llvm.sqrt.f32(float %Val)
- declare double @llvm.sqrt.f64(double %Val)
- declare x86_fp80 @llvm.sqrt.f80(x86_fp80 %Val)
- declare fp128 @llvm.sqrt.f128(fp128 %Val)
- declare ppc_fp128 @llvm.sqrt.ppcf128(ppc_fp128 %Val)
-</pre>
-
-<h5>Overview:</h5>
-
-<p>
-The '<tt>llvm.sqrt</tt>' intrinsics return the sqrt of the specified operand,
-returning the same value as the libm '<tt>sqrt</tt>' functions would. Unlike
-<tt>sqrt</tt> in libm, however, <tt>llvm.sqrt</tt> has undefined behavior for
-negative numbers other than -0.0 (which allows for better optimization, because
-there is no need to worry about errno being set). <tt>llvm.sqrt(-0.0)</tt> is
-defined to return -0.0 like IEEE sqrt.
-</p>
-
-<h5>Arguments:</h5>
-
-<p>
-The argument and return value are floating point numbers of the same type.
-</p>
-
-<h5>Semantics:</h5>
-
-<p>
-This function returns the sqrt of the specified operand if it is a nonnegative
-floating point number.
-</p>
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="int_powi">'<tt>llvm.powi.*</tt>' Intrinsic</a>
-</div>
-
-<div class="doc_text">
-
-<h5>Syntax:</h5>
-<p>This is an overloaded intrinsic. You can use <tt>llvm.powi</tt> on any
-floating point or vector of floating point type. Not all targets support all
-types however.
-<pre>
- declare float @llvm.powi.f32(float %Val, i32 %power)
- declare double @llvm.powi.f64(double %Val, i32 %power)
- declare x86_fp80 @llvm.powi.f80(x86_fp80 %Val, i32 %power)
- declare fp128 @llvm.powi.f128(fp128 %Val, i32 %power)
- declare ppc_fp128 @llvm.powi.ppcf128(ppc_fp128 %Val, i32 %power)
-</pre>
-
-<h5>Overview:</h5>
-
-<p>
-The '<tt>llvm.powi.*</tt>' intrinsics return the first operand raised to the
-specified (positive or negative) power. The order of evaluation of
-multiplications is not defined. When a vector of floating point type is
-used, the second argument remains a scalar integer value.
-</p>
-
-<h5>Arguments:</h5>
-
-<p>
-The second argument is an integer power, and the first is a value to raise to
-that power.
-</p>
-
-<h5>Semantics:</h5>
-
-<p>
-This function returns the first value raised to the second power with an
-unspecified sequence of rounding operations.</p>
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="int_sin">'<tt>llvm.sin.*</tt>' Intrinsic</a>
-</div>
-
-<div class="doc_text">
-
-<h5>Syntax:</h5>
-<p>This is an overloaded intrinsic. You can use <tt>llvm.sin</tt> on any
-floating point or vector of floating point type. Not all targets support all
-types however.
-<pre>
- declare float @llvm.sin.f32(float %Val)
- declare double @llvm.sin.f64(double %Val)
- declare x86_fp80 @llvm.sin.f80(x86_fp80 %Val)
- declare fp128 @llvm.sin.f128(fp128 %Val)
- declare ppc_fp128 @llvm.sin.ppcf128(ppc_fp128 %Val)
-</pre>
-
-<h5>Overview:</h5>
-
-<p>
-The '<tt>llvm.sin.*</tt>' intrinsics return the sine of the operand.
-</p>
-
-<h5>Arguments:</h5>
-
-<p>
-The argument and return value are floating point numbers of the same type.
-</p>
-
-<h5>Semantics:</h5>
-
-<p>
-This function returns the sine of the specified operand, returning the
-same values as the libm <tt>sin</tt> functions would, and handles error
-conditions in the same way.</p>
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="int_cos">'<tt>llvm.cos.*</tt>' Intrinsic</a>
-</div>
-
-<div class="doc_text">
-
-<h5>Syntax:</h5>
-<p>This is an overloaded intrinsic. You can use <tt>llvm.cos</tt> on any
-floating point or vector of floating point type. Not all targets support all
-types however.
-<pre>
- declare float @llvm.cos.f32(float %Val)
- declare double @llvm.cos.f64(double %Val)
- declare x86_fp80 @llvm.cos.f80(x86_fp80 %Val)
- declare fp128 @llvm.cos.f128(fp128 %Val)
- declare ppc_fp128 @llvm.cos.ppcf128(ppc_fp128 %Val)
-</pre>
-
-<h5>Overview:</h5>
-
-<p>
-The '<tt>llvm.cos.*</tt>' intrinsics return the cosine of the operand.
-</p>
-
-<h5>Arguments:</h5>
-
-<p>
-The argument and return value are floating point numbers of the same type.
-</p>
-
-<h5>Semantics:</h5>
-
-<p>
-This function returns the cosine of the specified operand, returning the
-same values as the libm <tt>cos</tt> functions would, and handles error
-conditions in the same way.</p>
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="int_pow">'<tt>llvm.pow.*</tt>' Intrinsic</a>
-</div>
-
-<div class="doc_text">
-
-<h5>Syntax:</h5>
-<p>This is an overloaded intrinsic. You can use <tt>llvm.pow</tt> on any
-floating point or vector of floating point type. Not all targets support all
-types however.
-<pre>
- declare float @llvm.pow.f32(float %Val, float %Power)
- declare double @llvm.pow.f64(double %Val, double %Power)
- declare x86_fp80 @llvm.pow.f80(x86_fp80 %Val, x86_fp80 %Power)
- declare fp128 @llvm.pow.f128(fp128 %Val, fp128 %Power)
- declare ppc_fp128 @llvm.pow.ppcf128(ppc_fp128 %Val, ppc_fp128 Power)
-</pre>
-
-<h5>Overview:</h5>
-
-<p>
-The '<tt>llvm.pow.*</tt>' intrinsics return the first operand raised to the
-specified (positive or negative) power.
-</p>
-
-<h5>Arguments:</h5>
-
-<p>
-The second argument is a floating point power, and the first is a value to
-raise to that power.
-</p>
-
-<h5>Semantics:</h5>
-
-<p>
-This function returns the first value raised to the second power,
-returning the
-same values as the libm <tt>pow</tt> functions would, and handles error
-conditions in the same way.</p>
-</div>
-
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="int_manip">Bit Manipulation Intrinsics</a>
-</div>
-
-<div class="doc_text">
-<p>
-LLVM provides intrinsics for a few important bit manipulation operations.
-These allow efficient code generation for some algorithms.
-</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="int_bswap">'<tt>llvm.bswap.*</tt>' Intrinsics</a>
-</div>
-
-<div class="doc_text">
-
-<h5>Syntax:</h5>
-<p>This is an overloaded intrinsic function. You can use bswap on any integer
-type that is an even number of bytes (i.e. BitWidth % 16 == 0).
-<pre>
- declare i16 @llvm.bswap.i16(i16 &lt;id&gt;)
- declare i32 @llvm.bswap.i32(i32 &lt;id&gt;)
- declare i64 @llvm.bswap.i64(i64 &lt;id&gt;)
-</pre>
-
-<h5>Overview:</h5>
-
-<p>
-The '<tt>llvm.bswap</tt>' family of intrinsics is used to byte swap integer
-values with an even number of bytes (positive multiple of 16 bits). These are
-useful for performing operations on data that is not in the target's native
-byte order.
-</p>
-
-<h5>Semantics:</h5>
-
-<p>
-The <tt>llvm.bswap.i16</tt> intrinsic returns an i16 value that has the high
-and low byte of the input i16 swapped. Similarly, the <tt>llvm.bswap.i32</tt>
-intrinsic returns an i32 value that has the four bytes of the input i32
-swapped, so that if the input bytes are numbered 0, 1, 2, 3 then the returned
-i32 will have its bytes in 3, 2, 1, 0 order. The <tt>llvm.bswap.i48</tt>,
-<tt>llvm.bswap.i64</tt> and other intrinsics extend this concept to
-additional even-byte lengths (6 bytes, 8 bytes and more, respectively).
-</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="int_ctpop">'<tt>llvm.ctpop.*</tt>' Intrinsic</a>
-</div>
-
-<div class="doc_text">
-
-<h5>Syntax:</h5>
-<p>This is an overloaded intrinsic. You can use llvm.ctpop on any integer bit
-width. Not all targets support all bit widths however.
-<pre>
- declare i8 @llvm.ctpop.i8 (i8 &lt;src&gt;)
- declare i16 @llvm.ctpop.i16(i16 &lt;src&gt;)
- declare i32 @llvm.ctpop.i32(i32 &lt;src&gt;)
- declare i64 @llvm.ctpop.i64(i64 &lt;src&gt;)
- declare i256 @llvm.ctpop.i256(i256 &lt;src&gt;)
-</pre>
-
-<h5>Overview:</h5>
-
-<p>
-The '<tt>llvm.ctpop</tt>' family of intrinsics counts the number of bits set in a
-value.
-</p>
-
-<h5>Arguments:</h5>
-
-<p>
-The only argument is the value to be counted. The argument may be of any
-integer type. The return type must match the argument type.
-</p>
-
-<h5>Semantics:</h5>
-
-<p>
-The '<tt>llvm.ctpop</tt>' intrinsic counts the 1's in a variable.
-</p>
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="int_ctlz">'<tt>llvm.ctlz.*</tt>' Intrinsic</a>
-</div>
-
-<div class="doc_text">
-
-<h5>Syntax:</h5>
-<p>This is an overloaded intrinsic. You can use <tt>llvm.ctlz</tt> on any
-integer bit width. Not all targets support all bit widths however.
-<pre>
- declare i8 @llvm.ctlz.i8 (i8 &lt;src&gt;)
- declare i16 @llvm.ctlz.i16(i16 &lt;src&gt;)
- declare i32 @llvm.ctlz.i32(i32 &lt;src&gt;)
- declare i64 @llvm.ctlz.i64(i64 &lt;src&gt;)
- declare i256 @llvm.ctlz.i256(i256 &lt;src&gt;)
-</pre>
-
-<h5>Overview:</h5>
-
-<p>
-The '<tt>llvm.ctlz</tt>' family of intrinsic functions counts the number of
-leading zeros in a variable.
-</p>
-
-<h5>Arguments:</h5>
-
-<p>
-The only argument is the value to be counted. The argument may be of any
-integer type. The return type must match the argument type.
-</p>
-
-<h5>Semantics:</h5>
-
-<p>
-The '<tt>llvm.ctlz</tt>' intrinsic counts the leading (most significant) zeros
-in a variable. If the src == 0 then the result is the size in bits of the type
-of src. For example, <tt>llvm.ctlz(i32 2) = 30</tt>.
-</p>
-</div>
-
-
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="int_cttz">'<tt>llvm.cttz.*</tt>' Intrinsic</a>
-</div>
-
-<div class="doc_text">
-
-<h5>Syntax:</h5>
-<p>This is an overloaded intrinsic. You can use <tt>llvm.cttz</tt> on any
-integer bit width. Not all targets support all bit widths however.
-<pre>
- declare i8 @llvm.cttz.i8 (i8 &lt;src&gt;)
- declare i16 @llvm.cttz.i16(i16 &lt;src&gt;)
- declare i32 @llvm.cttz.i32(i32 &lt;src&gt;)
- declare i64 @llvm.cttz.i64(i64 &lt;src&gt;)
- declare i256 @llvm.cttz.i256(i256 &lt;src&gt;)
-</pre>
-
-<h5>Overview:</h5>
-
-<p>
-The '<tt>llvm.cttz</tt>' family of intrinsic functions counts the number of
-trailing zeros.
-</p>
-
-<h5>Arguments:</h5>
-
-<p>
-The only argument is the value to be counted. The argument may be of any
-integer type. The return type must match the argument type.
-</p>
-
-<h5>Semantics:</h5>
-
-<p>
-The '<tt>llvm.cttz</tt>' intrinsic counts the trailing (least significant) zeros
-in a variable. If the src == 0 then the result is the size in bits of the type
-of src. For example, <tt>llvm.cttz(2) = 1</tt>.
-</p>
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="int_part_select">'<tt>llvm.part.select.*</tt>' Intrinsic</a>
-</div>
-
-<div class="doc_text">
-
-<h5>Syntax:</h5>
-<p>This is an overloaded intrinsic. You can use <tt>llvm.part.select</tt>
-on any integer bit width.
-<pre>
- declare i17 @llvm.part.select.i17 (i17 %val, i32 %loBit, i32 %hiBit)
- declare i29 @llvm.part.select.i29 (i29 %val, i32 %loBit, i32 %hiBit)
-</pre>
-
-<h5>Overview:</h5>
-<p>The '<tt>llvm.part.select</tt>' family of intrinsic functions selects a
-range of bits from an integer value and returns them in the same bit width as
-the original value.</p>
-
-<h5>Arguments:</h5>
-<p>The first argument, <tt>%val</tt> and the result may be integer types of
-any bit width but they must have the same bit width. The second and third
-arguments must be <tt>i32</tt> type since they specify only a bit index.</p>
-
-<h5>Semantics:</h5>
-<p>The operation of the '<tt>llvm.part.select</tt>' intrinsic has two modes
-of operation: forwards and reverse. If <tt>%loBit</tt> is greater than
-<tt>%hiBits</tt> then the intrinsic operates in reverse mode. Otherwise it
-operates in forward mode.</p>
-<p>In forward mode, this intrinsic is the equivalent of shifting <tt>%val</tt>
-right by <tt>%loBit</tt> bits and then ANDing it with a mask with
-only the <tt>%hiBit - %loBit</tt> bits set, as follows:</p>
-<ol>
- <li>The <tt>%val</tt> is shifted right (LSHR) by the number of bits specified
- by <tt>%loBits</tt>. This normalizes the value to the low order bits.</li>
- <li>The <tt>%loBits</tt> value is subtracted from the <tt>%hiBits</tt> value
- to determine the number of bits to retain.</li>
- <li>A mask of the retained bits is created by shifting a -1 value.</li>
- <li>The mask is ANDed with <tt>%val</tt> to produce the result.
-</ol>
-<p>In reverse mode, a similar computation is made except that the bits are
-returned in the reverse order. So, for example, if <tt>X</tt> has the value
-<tt>i16 0x0ACF (101011001111)</tt> and we apply
-<tt>part.select(i16 X, 8, 3)</tt> to it, we get back the value
-<tt>i16 0x0026 (000000100110)</tt>.</p>
-</div>
-
-<div class="doc_subsubsection">
- <a name="int_part_set">'<tt>llvm.part.set.*</tt>' Intrinsic</a>
-</div>
-
-<div class="doc_text">
-
-<h5>Syntax:</h5>
-<p>This is an overloaded intrinsic. You can use <tt>llvm.part.set</tt>
-on any integer bit width.
-<pre>
- declare i17 @llvm.part.set.i17.i9 (i17 %val, i9 %repl, i32 %lo, i32 %hi)
- declare i29 @llvm.part.set.i29.i9 (i29 %val, i9 %repl, i32 %lo, i32 %hi)
-</pre>
-
-<h5>Overview:</h5>
-<p>The '<tt>llvm.part.set</tt>' family of intrinsic functions replaces a range
-of bits in an integer value with another integer value. It returns the integer
-with the replaced bits.</p>
-
-<h5>Arguments:</h5>
-<p>The first argument, <tt>%val</tt> and the result may be integer types of
-any bit width but they must have the same bit width. <tt>%val</tt> is the value
-whose bits will be replaced. The second argument, <tt>%repl</tt> may be an
-integer of any bit width. The third and fourth arguments must be <tt>i32</tt>
-type since they specify only a bit index.</p>
-
-<h5>Semantics:</h5>
-<p>The operation of the '<tt>llvm.part.set</tt>' intrinsic has two modes
-of operation: forwards and reverse. If <tt>%lo</tt> is greater than
-<tt>%hi</tt> then the intrinsic operates in reverse mode. Otherwise it
-operates in forward mode.</p>
-<p>For both modes, the <tt>%repl</tt> value is prepared for use by either
-truncating it down to the size of the replacement area or zero extending it
-up to that size.</p>
-<p>In forward mode, the bits between <tt>%lo</tt> and <tt>%hi</tt> (inclusive)
-are replaced with corresponding bits from <tt>%repl</tt>. That is the 0th bit
-in <tt>%repl</tt> replaces the <tt>%lo</tt>th bit in <tt>%val</tt> and etc. up
-to the <tt>%hi</tt>th bit.
-<p>In reverse mode, a similar computation is made except that the bits are
-reversed. That is, the <tt>0</tt>th bit in <tt>%repl</tt> replaces the
-<tt>%hi</tt> bit in <tt>%val</tt> and etc. down to the <tt>%lo</tt>th bit.
-<h5>Examples:</h5>
-<pre>
- llvm.part.set(0xFFFF, 0, 4, 7) -&gt; 0xFF0F
- llvm.part.set(0xFFFF, 0, 7, 4) -&gt; 0xFF0F
- llvm.part.set(0xFFFF, 1, 7, 4) -&gt; 0xFF8F
- llvm.part.set(0xFFFF, F, 8, 3) -&gt; 0xFFE7
- llvm.part.set(0xFFFF, 0, 3, 8) -&gt; 0xFE07
-</pre>
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="int_debugger">Debugger Intrinsics</a>
-</div>
-
-<div class="doc_text">
-<p>
-The LLVM debugger intrinsics (which all start with <tt>llvm.dbg.</tt> prefix),
-are described in the <a
-href="SourceLevelDebugging.html#format_common_intrinsics">LLVM Source Level
-Debugging</a> document.
-</p>
-</div>
-
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="int_eh">Exception Handling Intrinsics</a>
-</div>
-
-<div class="doc_text">
-<p> The LLVM exception handling intrinsics (which all start with
-<tt>llvm.eh.</tt> prefix), are described in the <a
-href="ExceptionHandling.html#format_common_intrinsics">LLVM Exception
-Handling</a> document. </p>
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="int_trampoline">Trampoline Intrinsic</a>
-</div>
-
-<div class="doc_text">
-<p>
- This intrinsic makes it possible to excise one parameter, marked with
- the <tt>nest</tt> attribute, from a function. The result is a callable
- function pointer lacking the nest parameter - the caller does not need
- to provide a value for it. Instead, the value to use is stored in
- advance in a "trampoline", a block of memory usually allocated
- on the stack, which also contains code to splice the nest value into the
- argument list. This is used to implement the GCC nested function address
- extension.
-</p>
-<p>
- For example, if the function is
- <tt>i32 f(i8* nest %c, i32 %x, i32 %y)</tt> then the resulting function
- pointer has signature <tt>i32 (i32, i32)*</tt>. It can be created as follows:</p>
-<pre>
- %tramp = alloca [10 x i8], align 4 ; size and alignment only correct for X86
- %tramp1 = getelementptr [10 x i8]* %tramp, i32 0, i32 0
- %p = call i8* @llvm.init.trampoline( i8* %tramp1, i8* bitcast (i32 (i8* nest , i32, i32)* @f to i8*), i8* %nval )
- %fp = bitcast i8* %p to i32 (i32, i32)*
-</pre>
- <p>The call <tt>%val = call i32 %fp( i32 %x, i32 %y )</tt> is then equivalent
- to <tt>%val = call i32 %f( i8* %nval, i32 %x, i32 %y )</tt>.</p>
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="int_it">'<tt>llvm.init.trampoline</tt>' Intrinsic</a>
-</div>
-<div class="doc_text">
-<h5>Syntax:</h5>
-<pre>
-declare i8* @llvm.init.trampoline(i8* &lt;tramp&gt;, i8* &lt;func&gt;, i8* &lt;nval&gt;)
-</pre>
-<h5>Overview:</h5>
-<p>
- This fills the memory pointed to by <tt>tramp</tt> with code
- and returns a function pointer suitable for executing it.
-</p>
-<h5>Arguments:</h5>
-<p>
- The <tt>llvm.init.trampoline</tt> intrinsic takes three arguments, all
- pointers. The <tt>tramp</tt> argument must point to a sufficiently large
- and sufficiently aligned block of memory; this memory is written to by the
- intrinsic. Note that the size and the alignment are target-specific - LLVM
- currently provides no portable way of determining them, so a front-end that
- generates this intrinsic needs to have some target-specific knowledge.
- The <tt>func</tt> argument must hold a function bitcast to an <tt>i8*</tt>.
-</p>
-<h5>Semantics:</h5>
-<p>
- The block of memory pointed to by <tt>tramp</tt> is filled with target
- dependent code, turning it into a function. A pointer to this function is
- returned, but needs to be bitcast to an
- <a href="#int_trampoline">appropriate function pointer type</a>
- before being called. The new function's signature is the same as that of
- <tt>func</tt> with any arguments marked with the <tt>nest</tt> attribute
- removed. At most one such <tt>nest</tt> argument is allowed, and it must be
- of pointer type. Calling the new function is equivalent to calling
- <tt>func</tt> with the same argument list, but with <tt>nval</tt> used for the
- missing <tt>nest</tt> argument. If, after calling
- <tt>llvm.init.trampoline</tt>, the memory pointed to by <tt>tramp</tt> is
- modified, then the effect of any later call to the returned function pointer is
- undefined.
-</p>
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="int_atomics">Atomic Operations and Synchronization Intrinsics</a>
-</div>
-
-<div class="doc_text">
-<p>
- These intrinsic functions expand the "universal IR" of LLVM to represent
- hardware constructs for atomic operations and memory synchronization. This
- provides an interface to the hardware, not an interface to the programmer. It
- is aimed at a low enough level to allow any programming models or APIs which
- need atomic behaviors to map cleanly onto it. It is also modeled primarily on
- hardware behavior. Just as hardware provides a "universal IR" for source
- languages, it also provides a starting point for developing a "universal"
- atomic operation and synchronization IR.
-</p>
-<p>
- These do <em>not</em> form an API such as high-level threading libraries,
- software transaction memory systems, atomic primitives, and intrinsic
- functions as found in BSD, GNU libc, atomic_ops, APR, and other system and
- application libraries. The hardware interface provided by LLVM should allow
- a clean implementation of all of these APIs and parallel programming models.
- No one model or paradigm should be selected above others unless the hardware
- itself ubiquitously does so.
-
-</p>
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="int_memory_barrier">'<tt>llvm.memory.barrier</tt>' Intrinsic</a>
-</div>
-<div class="doc_text">
-<h5>Syntax:</h5>
-<pre>
-declare void @llvm.memory.barrier( i1 &lt;ll&gt;, i1 &lt;ls&gt;, i1 &lt;sl&gt;, i1 &lt;ss&gt;,
-i1 &lt;device&gt; )
-
-</pre>
-<h5>Overview:</h5>
-<p>
- The <tt>llvm.memory.barrier</tt> intrinsic guarantees ordering between
- specific pairs of memory access types.
-</p>
-<h5>Arguments:</h5>
-<p>
- The <tt>llvm.memory.barrier</tt> intrinsic requires five boolean arguments.
- The first four arguments enables a specific barrier as listed below. The fith
- argument specifies that the barrier applies to io or device or uncached memory.
-
-</p>
- <ul>
- <li><tt>ll</tt>: load-load barrier</li>
- <li><tt>ls</tt>: load-store barrier</li>
- <li><tt>sl</tt>: store-load barrier</li>
- <li><tt>ss</tt>: store-store barrier</li>
- <li><tt>device</tt>: barrier applies to device and uncached memory also.
- </ul>
-<h5>Semantics:</h5>
-<p>
- This intrinsic causes the system to enforce some ordering constraints upon
- the loads and stores of the program. This barrier does not indicate
- <em>when</em> any events will occur, it only enforces an <em>order</em> in
- which they occur. For any of the specified pairs of load and store operations
- (f.ex. load-load, or store-load), all of the first operations preceding the
- barrier will complete before any of the second operations succeeding the
- barrier begin. Specifically the semantics for each pairing is as follows:
-</p>
- <ul>
- <li><tt>ll</tt>: All loads before the barrier must complete before any load
- after the barrier begins.</li>
-
- <li><tt>ls</tt>: All loads before the barrier must complete before any
- store after the barrier begins.</li>
- <li><tt>ss</tt>: All stores before the barrier must complete before any
- store after the barrier begins.</li>
- <li><tt>sl</tt>: All stores before the barrier must complete before any
- load after the barrier begins.</li>
- </ul>
-<p>
- These semantics are applied with a logical "and" behavior when more than one
- is enabled in a single memory barrier intrinsic.
-</p>
-<p>
- Backends may implement stronger barriers than those requested when they do not
- support as fine grained a barrier as requested. Some architectures do not
- need all types of barriers and on such architectures, these become noops.
-</p>
-<h5>Example:</h5>
-<pre>
-%ptr = malloc i32
- store i32 4, %ptr
-
-%result1 = load i32* %ptr <i>; yields {i32}:result1 = 4</i>
- call void @llvm.memory.barrier( i1 false, i1 true, i1 false, i1 false )
- <i>; guarantee the above finishes</i>
- store i32 8, %ptr <i>; before this begins</i>
-</pre>
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="int_atomic_lcs">'<tt>llvm.atomic.lcs.*</tt>' Intrinsic</a>
-</div>
-<div class="doc_text">
-<h5>Syntax:</h5>
-<p>
- This is an overloaded intrinsic. You can use <tt>llvm.atomic.lcs</tt> on any
- integer bit width. Not all targets support all bit widths however.</p>
-
-<pre>
-declare i8 @llvm.atomic.lcs.i8( i8* &lt;ptr&gt;, i8 &lt;cmp&gt;, i8 &lt;val&gt; )
-declare i16 @llvm.atomic.lcs.i16( i16* &lt;ptr&gt;, i16 &lt;cmp&gt;, i16 &lt;val&gt; )
-declare i32 @llvm.atomic.lcs.i32( i32* &lt;ptr&gt;, i32 &lt;cmp&gt;, i32 &lt;val&gt; )
-declare i64 @llvm.atomic.lcs.i64( i64* &lt;ptr&gt;, i64 &lt;cmp&gt;, i64 &lt;val&gt; )
-
-</pre>
-<h5>Overview:</h5>
-<p>
- This loads a value in memory and compares it to a given value. If they are
- equal, it stores a new value into the memory.
-</p>
-<h5>Arguments:</h5>
-<p>
- The <tt>llvm.atomic.lcs</tt> intrinsic takes three arguments. The result as
- well as both <tt>cmp</tt> and <tt>val</tt> must be integer values with the
- same bit width. The <tt>ptr</tt> argument must be a pointer to a value of
- this integer type. While any bit width integer may be used, targets may only
- lower representations they support in hardware.
-
-</p>
-<h5>Semantics:</h5>
-<p>
- This entire intrinsic must be executed atomically. It first loads the value
- in memory pointed to by <tt>ptr</tt> and compares it with the value
- <tt>cmp</tt>. If they are equal, <tt>val</tt> is stored into the memory. The
- loaded value is yielded in all cases. This provides the equivalent of an
- atomic compare-and-swap operation within the SSA framework.
-</p>
-<h5>Examples:</h5>
-
-<pre>
-%ptr = malloc i32
- store i32 4, %ptr
-
-%val1 = add i32 4, 4
-%result1 = call i32 @llvm.atomic.lcs.i32( i32* %ptr, i32 4, %val1 )
- <i>; yields {i32}:result1 = 4</i>
-%stored1 = icmp eq i32 %result1, 4 <i>; yields {i1}:stored1 = true</i>
-%memval1 = load i32* %ptr <i>; yields {i32}:memval1 = 8</i>
-
-%val2 = add i32 1, 1
-%result2 = call i32 @llvm.atomic.lcs.i32( i32* %ptr, i32 5, %val2 )
- <i>; yields {i32}:result2 = 8</i>
-%stored2 = icmp eq i32 %result2, 5 <i>; yields {i1}:stored2 = false</i>
-
-%memval2 = load i32* %ptr <i>; yields {i32}:memval2 = 8</i>
-</pre>
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="int_atomic_swap">'<tt>llvm.atomic.swap.*</tt>' Intrinsic</a>
-</div>
-<div class="doc_text">
-<h5>Syntax:</h5>
-
-<p>
- This is an overloaded intrinsic. You can use <tt>llvm.atomic.swap</tt> on any
- integer bit width. Not all targets support all bit widths however.</p>
-<pre>
-declare i8 @llvm.atomic.swap.i8( i8* &lt;ptr&gt;, i8 &lt;val&gt; )
-declare i16 @llvm.atomic.swap.i16( i16* &lt;ptr&gt;, i16 &lt;val&gt; )
-declare i32 @llvm.atomic.swap.i32( i32* &lt;ptr&gt;, i32 &lt;val&gt; )
-declare i64 @llvm.atomic.swap.i64( i64* &lt;ptr&gt;, i64 &lt;val&gt; )
-
-</pre>
-<h5>Overview:</h5>
-<p>
- This intrinsic loads the value stored in memory at <tt>ptr</tt> and yields
- the value from memory. It then stores the value in <tt>val</tt> in the memory
- at <tt>ptr</tt>.
-</p>
-<h5>Arguments:</h5>
-
-<p>
- The <tt>llvm.atomic.ls</tt> intrinsic takes two arguments. Both the
- <tt>val</tt> argument and the result must be integers of the same bit width.
- The first argument, <tt>ptr</tt>, must be a pointer to a value of this
- integer type. The targets may only lower integer representations they
- support.
-</p>
-<h5>Semantics:</h5>
-<p>
- This intrinsic loads the value pointed to by <tt>ptr</tt>, yields it, and
- stores <tt>val</tt> back into <tt>ptr</tt> atomically. This provides the
- equivalent of an atomic swap operation within the SSA framework.
-
-</p>
-<h5>Examples:</h5>
-<pre>
-%ptr = malloc i32
- store i32 4, %ptr
-
-%val1 = add i32 4, 4
-%result1 = call i32 @llvm.atomic.swap.i32( i32* %ptr, i32 %val1 )
- <i>; yields {i32}:result1 = 4</i>
-%stored1 = icmp eq i32 %result1, 4 <i>; yields {i1}:stored1 = true</i>
-%memval1 = load i32* %ptr <i>; yields {i32}:memval1 = 8</i>
-
-%val2 = add i32 1, 1
-%result2 = call i32 @llvm.atomic.swap.i32( i32* %ptr, i32 %val2 )
- <i>; yields {i32}:result2 = 8</i>
-
-%stored2 = icmp eq i32 %result2, 8 <i>; yields {i1}:stored2 = true</i>
-%memval2 = load i32* %ptr <i>; yields {i32}:memval2 = 2</i>
-</pre>
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="int_atomic_las">'<tt>llvm.atomic.las.*</tt>' Intrinsic</a>
-
-</div>
-<div class="doc_text">
-<h5>Syntax:</h5>
-<p>
- This is an overloaded intrinsic. You can use <tt>llvm.atomic.las</tt> on any
- integer bit width. Not all targets support all bit widths however.</p>
-<pre>
-declare i8 @llvm.atomic.las.i8.( i8* &lt;ptr&gt;, i8 &lt;delta&gt; )
-declare i16 @llvm.atomic.las.i16.( i16* &lt;ptr&gt;, i16 &lt;delta&gt; )
-declare i32 @llvm.atomic.las.i32.( i32* &lt;ptr&gt;, i32 &lt;delta&gt; )
-declare i64 @llvm.atomic.las.i64.( i64* &lt;ptr&gt;, i64 &lt;delta&gt; )
-
-</pre>
-<h5>Overview:</h5>
-<p>
- This intrinsic adds <tt>delta</tt> to the value stored in memory at
- <tt>ptr</tt>. It yields the original value at <tt>ptr</tt>.
-</p>
-<h5>Arguments:</h5>
-<p>
-
- The intrinsic takes two arguments, the first a pointer to an integer value
- and the second an integer value. The result is also an integer value. These
- integer types can have any bit width, but they must all have the same bit
- width. The targets may only lower integer representations they support.
-</p>
-<h5>Semantics:</h5>
-<p>
- This intrinsic does a series of operations atomically. It first loads the
- value stored at <tt>ptr</tt>. It then adds <tt>delta</tt>, stores the result
- to <tt>ptr</tt>. It yields the original value stored at <tt>ptr</tt>.
-</p>
-
-<h5>Examples:</h5>
-<pre>
-%ptr = malloc i32
- store i32 4, %ptr
-%result1 = call i32 @llvm.atomic.las.i32( i32* %ptr, i32 4 )
- <i>; yields {i32}:result1 = 4</i>
-%result2 = call i32 @llvm.atomic.las.i32( i32* %ptr, i32 2 )
- <i>; yields {i32}:result2 = 8</i>
-%result3 = call i32 @llvm.atomic.las.i32( i32* %ptr, i32 5 )
- <i>; yields {i32}:result3 = 10</i>
-%memval = load i32* %ptr <i>; yields {i32}:memval1 = 15</i>
-</pre>
-</div>
-
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="int_general">General Intrinsics</a>
-</div>
-
-<div class="doc_text">
-<p> This class of intrinsics is designed to be generic and has
-no specific purpose. </p>
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="int_var_annotation">'<tt>llvm.var.annotation</tt>' Intrinsic</a>
-</div>
-
-<div class="doc_text">
-
-<h5>Syntax:</h5>
-<pre>
- declare void @llvm.var.annotation(i8* &lt;val&gt;, i8* &lt;str&gt;, i8* &lt;str&gt;, i32 &lt;int&gt; )
-</pre>
-
-<h5>Overview:</h5>
-
-<p>
-The '<tt>llvm.var.annotation</tt>' intrinsic
-</p>
-
-<h5>Arguments:</h5>
-
-<p>
-The first argument is a pointer to a value, the second is a pointer to a
-global string, the third is a pointer to a global string which is the source
-file name, and the last argument is the line number.
-</p>
-
-<h5>Semantics:</h5>
-
-<p>
-This intrinsic allows annotation of local variables with arbitrary strings.
-This can be useful for special purpose optimizations that want to look for these
-annotations. These have no other defined use, they are ignored by code
-generation and optimization.
-</p>
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="int_annotation">'<tt>llvm.annotation.*</tt>' Intrinsic</a>
-</div>
-
-<div class="doc_text">
-
-<h5>Syntax:</h5>
-<p>This is an overloaded intrinsic. You can use '<tt>llvm.annotation</tt>' on
-any integer bit width.
-</p>
-<pre>
- declare i8 @llvm.annotation.i8(i8 &lt;val&gt;, i8* &lt;str&gt;, i8* &lt;str&gt;, i32 &lt;int&gt; )
- declare i16 @llvm.annotation.i16(i16 &lt;val&gt;, i8* &lt;str&gt;, i8* &lt;str&gt;, i32 &lt;int&gt; )
- declare i32 @llvm.annotation.i32(i32 &lt;val&gt;, i8* &lt;str&gt;, i8* &lt;str&gt;, i32 &lt;int&gt; )
- declare i64 @llvm.annotation.i64(i64 &lt;val&gt;, i8* &lt;str&gt;, i8* &lt;str&gt;, i32 &lt;int&gt; )
- declare i256 @llvm.annotation.i256(i256 &lt;val&gt;, i8* &lt;str&gt;, i8* &lt;str&gt;, i32 &lt;int&gt; )
-</pre>
-
-<h5>Overview:</h5>
-
-<p>
-The '<tt>llvm.annotation</tt>' intrinsic.
-</p>
-
-<h5>Arguments:</h5>
-
-<p>
-The first argument is an integer value (result of some expression),
-the second is a pointer to a global string, the third is a pointer to a global
-string which is the source file name, and the last argument is the line number.
-It returns the value of the first argument.
-</p>
-
-<h5>Semantics:</h5>
-
-<p>
-This intrinsic allows annotations to be put on arbitrary expressions
-with arbitrary strings. This can be useful for special purpose optimizations
-that want to look for these annotations. These have no other defined use, they
-are ignored by code generation and optimization.
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="int_trap">'<tt>llvm.trap</tt>' Intrinsic</a>
-</div>
-
-<div class="doc_text">
-
-<h5>Syntax:</h5>
-<pre>
- declare void @llvm.trap()
-</pre>
-
-<h5>Overview:</h5>
-
-<p>
-The '<tt>llvm.trap</tt>' intrinsic
-</p>
-
-<h5>Arguments:</h5>
-
-<p>
-None
-</p>
-
-<h5>Semantics:</h5>
-
-<p>
-This intrinsics is lowered to the target dependent trap instruction. If the
-target does not have a trap instruction, this intrinsic will be lowered to the
-call of the abort() function.
-</p>
-</div>
-
-<!-- *********************************************************************** -->
-<hr>
-<address>
- <a href="http://jigsaw.w3.org/css-validator/check/referer"><img
- src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"></a>
- <a href="http://validator.w3.org/check/referer"><img
- src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!"></a>
-
- <a href="mailto:sabre@nondot.org">Chris Lattner</a><br>
- <a href="http://llvm.org">The LLVM Compiler Infrastructure</a><br>
- Last modified: $Date$
-</address>
-
-</body>
-</html>
diff --git a/release_23/docs/Lexicon.html b/release_23/docs/Lexicon.html
deleted file mode 100644
index fbe09564c759..000000000000
--- a/release_23/docs/Lexicon.html
+++ /dev/null
@@ -1,254 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
-<html>
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <title>The LLVM Lexicon</title>
- <link rel="stylesheet" href="llvm.css" type="text/css">
- <meta name="author" content="Various">
- <meta name="description"
- content="A glossary of terms used with the LLVM project.">
-</head>
-<body>
-<div class="doc_title">The LLVM Lexicon</div>
-<p class="doc_warning">NOTE: This document is a work in progress!</p>
-<!-- *********************************************************************** -->
-<div class="doc_section">Table Of Contents</div>
-<!-- *********************************************************************** -->
-<div class="doc_text">
- <table>
- <tr><th colspan="8"><b>- <a href="#A">A</a> -</b></th></tr>
- <tr>
- <td><a href="#ADCE">ADCE</a></td>
- </tr>
- <tr><th colspan="8"><b>- <a href="#B">B</a> -</b></th></tr>
- <tr>
- <td><a href="#BURS">BURS</a></td>
- </tr>
- <tr><th colspan="8"><b>- <a href="#C">C</a> -</b></th></tr>
- <tr>
- <td><a href="#CSE">CSE</a></td>
- </tr>
- <tr><th colspan="8"><b>- <a href="#D">D</a> -</b></th></tr>
- <tr>
- <td><a href="#DAG">DAG</a></td>
- <td><a href="#Derived_Pointer">Derived Pointer</a></td>
- <td><a href="#DSA">DSA</a></td>
- <td><a href="#DSE">DSE</a></td>
- </tr>
- <tr><th colspan="8"><b>- <a href="#G">G</a> -</b></th></tr>
- <td><a href="#GC">GC</a></td>
- </tr>
- <tr><th colspan="8"><b>- <a href="#I">I</a> -</b></th></tr>
- <tr>
- <td><a href="#IPA">IPA</a></td>
- <td><a href="#IPO">IPO</a></td>
- <td><a href="#ISel">ISel</a></td>
- </tr>
- <tr><th colspan="8"><b>- <a href="#L">L</a> -</b></th></tr>
- <tr>
- <td><a href="#LCSSA">LCSSA</a></td>
- <td><a href="#LICM">LICM</a></td>
- <td><a href="#Load-VN">Load-VN</a></td>
- </tr>
- <tr><th colspan="8"><b>- <a href="#O">O</a> -</b></th></tr>
- <tr>
- <td><a href="#Object_Pointer">Object Pointer</a></td>
- </tr>
- <tr><th colspan="8"><b>- <a href="#P">P</a> -</b></th></tr>
- <tr>
- <td><a href="#PRE">PRE</a></td>
- </tr>
- <tr><th colspan="8"><b>- <a href="#R">R</a> -</b></th></tr>
- <tr>
- <td><a href="#Reassociation">Reassociation</a></td>
- <td><a href="#Root">Root</a></td>
- </tr>
- <tr><th colspan="8"><b>- <a href="#S">S</a> -</b></th></tr>
- <tr>
- <td><a href="#Safe_Point">Safe Point</a></td>
- <td><a href="#SCC">SCC</a></td>
- <td><a href="#SCCP">SCCP</a></td>
- <td><a href="#SDISel">SDISel</a></td>
- <td><a href="#SRoA">SRoA</a></td>
- <td><a href="#Stack_Map">Stack Map</a></td>
- </tr>
- </table>
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section">Definitions</div>
-<!-- *********************************************************************** -->
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsection"><a name="A">- A -</a></div>
-<div class="doc_text">
- <dl>
- <dt><a name="ADCE"><b>ADCE</b></a></dt>
- <dd>Aggressive Dead Code Elimination</dd>
- </dl>
-</div>
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsection"><a name="B">- B -</a></div>
-<div class="doc_text">
- <dl>
- <dt><a name="BURS"><b>BURS</b></a></dt>
- <dd>Bottom Up Rewriting System - A method of instruction selection for
- code generation. An example is the <a
-href="http://www.program-transformation.org/Transform/BURG">BURG</a> tool.</dd>
- </dl>
-</div>
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsection"><a name="C">- C -</a></div>
-<div class="doc_text">
- <dl>
- <dt><a name="CSE"><b>CSE</b></a></dt>
- <dd>Common Subexpression Elimination. An optimization that removes common
- subexpression compuation. For example <tt>(a+b)*(a+b)</tt> has two
- subexpressions that are the same: <tt>(a+b)</tt>. This optimization would
- perform the addition only once and then perform the multiply (but only if
- it's compulationally correct/safe).
- </dl>
-</div>
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsection"><a name="D">- D -</a></div>
-<div class="doc_text">
- <dl>
- <dt><a name="DAG"><b>DAG</b></a></dt>
- <dd>Directed Acyclic Graph</dd>
- <dt><a name="Derived_Pointer"><b>Derived Pointer</b></a></dt>
- <dd>A pointer to the interior of an object, such that a garbage collector
- is unable to use the pointer for reachability analysis. While a derived
- pointer is live, the corresponding object pointer must be kept in a root,
- otherwise the collector might free the referenced object. With copying
- collectors, derived pointers pose an additional hazard that they may be
- invalidated at any <a href="Safe_Point">safe point</a>. This term is used in
- opposition to <a href="#Object_Pointer">object pointer</a>.</dd>
- <dt><a name="DSA"><b>DSA</b></a></dt>
- <dd>Data Structure Analysis</dd>
- <dt><a name="DSE"><b>DSE</b></a></dt>
- <dd>Dead Store Elimination</dd>
- </dl>
-</div>
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsection"><a name="G">- G -</a></div>
-<div class="doc_text">
- <dl>
- <dt><a name="GC"><b>GC</b></a></dt>
- <dd>Garbage Collection. The practice of using reachability analysis instead
- of explicit memory management to reclaim unused memory.</dd>
- </dl>
-</div>
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsection"><a name="H">- H -</a></div>
-<div class="doc_text">
- <dl>
- <dt><a name="Heap"><b>Heap</b></a></dt>
- <dd>In garbage collection, the region of memory which is managed using
- reachability analysis.</dd>
- </dl>
-</div>
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsection"><a name="I">- I -</a></div>
-<div class="doc_text">
- <dl>
- <dt><a name="IPA"><b>IPA</b></a></dt>
- <dd>Inter-Procedural Analysis. Refers to any variety of code analysis that
- occurs between procedures, functions or compilation units (modules).</dd>
- <dt><a name="IPO"><b>IPO</b></a></dt>
- <dd>Inter-Procedural Optimization. Refers to any variety of code
- optimization that occurs between procedures, functions or compilation units
- (modules).</dd>
- <dt><a name="IPO"><b>ISel</b></a></dt>
- <dd>Instruction Selection.</dd>
- </dl>
-</div>
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsection"><a name="L">- L -</a></div>
-<div class="doc_text">
- <dl>
- <dt><a name="LCSSA"><b>LCSSA</b></a></dt>
- <dd>Loop-Closed Static Single Assignment Form</dd>
- <dt><a name="LICM"><b>LICM</b></a></dt>
- <dd>Loop Invariant Code Motion</dd>
- <dt><a name="Load-VN"><b>Load-VN</b></a></dt>
- <dd>Load Value Numbering</dd>
- </dl>
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsection"><a name="P">- O -</a></div>
-<div class="doc_text">
- <dl>
- <dt><a name="Object_Pointer"><b>Object Pointer</b></a></dt>
- <dd>A pointer to an object such that the garbage collector is able to trace
- references contained within the object. This term is used in opposition to
- <a href="#Derived_Pointer">derived pointer</a>.</dd>
- </dl>
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsection"><a name="P">- P -</a></div>
-<div class="doc_text">
- <dl>
- <dt><a name="PRE"><b>PRE</b></a></dt>
- <dd>Partial Redundancy Elimination</dd>
- </dl>
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsection"><a name="R">- R -</a></div>
-<div class="doc_text">
- <dl>
- <dt><a name="Reassociation"><b>Reassociation</b></a></dt> <dd>Rearranging
- associative expressions to promote better redundancy elimination and other
- optimization. For example, changing (A+B-A) into (B+A-A), permitting it to
- be optimized into (B+0) then (B).</dd>
- <dt><a name="Root"><b>Root</b></a></dt> <dd>In garbage collection, a
- pointer variable lying outside of the <a href="#Heap">heap</a> from which
- the collector begins its reachability analysis. In the context of code
- generation, "root" almost always refers to a "stack root"&#151;a local or
- temporary variable within an executing function.</dd>
- </dl>
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsection"><a name="S">- S -</a></div>
-<div class="doc_text">
- <dl>
- <dt><a name="SCC"><b>Safe Point</b></a></dt>
- <dd>In garbage collection, it is necessary to identify <a href="#Root">stack
- roots</a> so that reachability analysis may proceed. It may be infeasible to
- provide this information for every instruction, so instead the information
- may is calculated only at designated safe points. With a copying collector,
- <a href="#Derived_Pointers">derived pointers</a> must not be retained across
- safe points and <a href="#Object_Pointers">object pointers</a> must be
- reloaded from stack roots.</dd>
- <dt><a name="SDISel"><b>SDISel</b></a></dt>
- <dd>Selection DAG Instruction Selection.</dd>
- <dt><a name="SCC"><b>SCC</b></a></dt>
- <dd>Strongly Connected Component</dd>
- <dt><a name="SCCP"><b>SCCP</b></a></dt>
- <dd>Sparse Conditional Constant Propagation</dd>
- <dt><a name="SRoA"><b>SRoA</b></a></dt>
- <dd>Scalar Replacement of Aggregates</dd>
- <dt><a name="SSA"><b>SSA</b></a></dt>
- <dd>Static Single Assignment</dd>
- <dt><a name="Stack_Map"><b>Stack Map</b></a></dt>
- <dd>In garbage collection, metadata emitted by the code generator which
- identifies <a href="#Root">roots</a> within the stack frame of an executing
- function.</dd>
- </dl>
-</div>
-<!-- *********************************************************************** -->
-<hr>
-<address> <a href="http://jigsaw.w3.org/css-validator/check/referer"><img
- src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"></a><a
- href="http://validator.w3.org/check/referer"><img
- src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!"></a><a
- href="http://llvm.org/">The LLVM Team</a><br>
-<a href="http://llvm.org">The LLVM Compiler Infrastructure</a><br>
-Last modified: $Date$
-</address>
-<!-- vim: sw=2
--->
-</body>
-</html>
diff --git a/release_23/docs/LinkTimeOptimization.html b/release_23/docs/LinkTimeOptimization.html
deleted file mode 100644
index 3ca00d8f85da..000000000000
--- a/release_23/docs/LinkTimeOptimization.html
+++ /dev/null
@@ -1,356 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
- "http://www.w3.org/TR/html4/strict.dtd">
-<html>
-<head>
- <title>LLVM Link Time Optimization: Design and Implementation</title>
- <link rel="stylesheet" href="llvm.css" type="text/css">
-</head>
-
-<div class="doc_title">
- LLVM Link Time Optimization: Design and Implementation
-</div>
-
-<ul>
- <li><a href="#desc">Description</a></li>
- <li><a href="#design">Design Philosophy</a>
- <ul>
- <li><a href="#example1">Example of link time optimization</a></li>
- <li><a href="#alternative_approaches">Alternative Approaches</a></li>
- </ul></li>
- <li><a href="#multiphase">Multi-phase communication between LLVM and linker</a>
- <ul>
- <li><a href="#phase1">Phase 1 : Read LLVM Bytecode Files</a></li>
- <li><a href="#phase2">Phase 2 : Symbol Resolution</a></li>
- <li><a href="#phase3">Phase 3 : Optimize Bitcode Files</a></li>
- <li><a href="#phase4">Phase 4 : Symbol Resolution after optimization</a></li>
- </ul></li>
- <li><a href="#lto">libLTO</a>
- <ul>
- <li><a href="#lto_module_t">lto_module_t</a></li>
- <li><a href="#lto_code_gen_t">lto_code_gen_t</a></li>
- </ul>
-</ul>
-
-<div class="doc_author">
-<p>Written by Devang Patel and Nick Kledzik</p>
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section">
-<a name="desc">Description</a>
-</div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-<p>
-LLVM features powerful intermodular optimizations which can be used at link
-time. Link Time Optimization (LTO) is another name for intermodular optimization
-when performed during the link stage. This document describes the interface
-and design between the LTO optimizer and the linker.</p>
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section">
-<a name="design">Design Philosophy</a>
-</div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-<p>
-The LLVM Link Time Optimizer provides complete transparency, while doing
-intermodular optimization, in the compiler tool chain. Its main goal is to let
-the developer take advantage of intermodular optimizations without making any
-significant changes to the developer's makefiles or build system. This is
-achieved through tight integration with the linker. In this model, the linker
-treates LLVM bitcode files like native object files and allows mixing and
-matching among them. The linker uses <a href="#lto">libLTO</a>, a shared
-object, to handle LLVM bitcode files. This tight integration between
-the linker and LLVM optimizer helps to do optimizations that are not possible
-in other models. The linker input allows the optimizer to avoid relying on
-conservative escape analysis.
-</p>
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="example1">Example of link time optimization</a>
-</div>
-
-<div class="doc_text">
- <p>The following example illustrates the advantages of LTO's integrated
- approach and clean interface. This example requires a system linker which
- supports LTO through the interface described in this document. Here,
- llvm-gcc transparently invokes system linker. </p>
- <ul>
- <li> Input source file <tt>a.c</tt> is compiled into LLVM bitcode form.
- <li> Input source file <tt>main.c</tt> is compiled into native object code.
- </ul>
-<div class="doc_code"><pre>
---- a.h ---
-extern int foo1(void);
-extern void foo2(void);
-extern void foo4(void);
---- a.c ---
-#include "a.h"
-
-static signed int i = 0;
-
-void foo2(void) {
- i = -1;
-}
-
-static int foo3() {
-foo4();
-return 10;
-}
-
-int foo1(void) {
-int data = 0;
-
-if (i &lt; 0) { data = foo3(); }
-
-data = data + 42;
-return data;
-}
-
---- main.c ---
-#include &lt;stdio.h&gt;
-#include "a.h"
-
-void foo4(void) {
- printf ("Hi\n");
-}
-
-int main() {
- return foo1();
-}
-
---- command lines ---
-$ llvm-gcc --emit-llvm -c a.c -o a.o # &lt;-- a.o is LLVM bitcode file
-$ llvm-gcc -c main.c -o main.o # &lt;-- main.o is native object file
-$ llvm-gcc a.o main.o -o main # &lt;-- standard link command without any modifications
-</pre></div>
- <p>In this example, the linker recognizes that <tt>foo2()</tt> is an
- externally visible symbol defined in LLVM bitcode file. The linker completes
- its usual symbol resolution
- pass and finds that <tt>foo2()</tt> is not used anywhere. This information
- is used by the LLVM optimizer and it removes <tt>foo2()</tt>. As soon as
- <tt>foo2()</tt> is removed, the optimizer recognizes that condition
- <tt>i &lt; 0</tt> is always false, which means <tt>foo3()</tt> is never
- used. Hence, the optimizer removes <tt>foo3()</tt>, also. And this in turn,
- enables linker to remove <tt>foo4()</tt>. This example illustrates the
- advantage of tight integration with the linker. Here, the optimizer can not
- remove <tt>foo3()</tt> without the linker's input.
- </p>
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="alternative_approaches">Alternative Approaches</a>
-</div>
-
-<div class="doc_text">
- <dl>
- <dt><b>Compiler driver invokes link time optimizer separately.</b></dt>
- <dd>In this model the link time optimizer is not able to take advantage of
- information collected during the linker's normal symbol resolution phase.
- In the above example, the optimizer can not remove <tt>foo2()</tt> without
- the linker's input because it is externally visible. This in turn prohibits
- the optimizer from removing <tt>foo3()</tt>.</dd>
- <dt><b>Use separate tool to collect symbol information from all object
- files.</b></dt>
- <dd>In this model, a new, separate, tool or library replicates the linker's
- capability to collect information for link time optimization. Not only is
- this code duplication difficult to justify, but it also has several other
- disadvantages. For example, the linking semantics and the features
- provided by the linker on various platform are not unique. This means,
- this new tool needs to support all such features and platforms in one
- super tool or a separate tool per platform is required. This increases
- maintance cost for link time optimizer significantly, which is not
- necessary. This approach also requires staying synchronized with linker
- developements on various platforms, which is not the main focus of the link
- time optimizer. Finally, this approach increases end user's build time due
- to the duplication of work done by this separate tool and the linker itself.
- </dd>
- </dl>
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section">
- <a name="multiphase">Multi-phase communication between libLTO and linker</a>
-</div>
-
-<div class="doc_text">
- <p>The linker collects information about symbol defininitions and uses in
- various link objects which is more accurate than any information collected
- by other tools during typical build cycles. The linker collects this
- information by looking at the definitions and uses of symbols in native .o
- files and using symbol visibility information. The linker also uses
- user-supplied information, such as a list of exported symbols. LLVM
- optimizer collects control flow information, data flow information and knows
- much more about program structure from the optimizer's point of view.
- Our goal is to take advantage of tight intergration between the linker and
- the optimizer by sharing this information during various linking phases.
-</p>
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="phase1">Phase 1 : Read LLVM Bitcode Files</a>
-</div>
-
-<div class="doc_text">
- <p>The linker first reads all object files in natural order and collects
- symbol information. This includes native object files as well as LLVM bitcode
- files. To minimize the cost to the linker in the case that all .o files
- are native object files, the linker only calls <tt>lto_module_create()</tt>
- when a supplied object file is found to not be a native object file. If
- <tt>lto_module_create()</tt> returns that the file is an LLVM bitcode file,
- the linker
- then iterates over the module using <tt>lto_module_get_symbol_name()</tt> and
- <tt>lto_module_get_symbol_attribute()</tt> to get all symbols defined and
- referenced.
- This information is added to the linker's global symbol table.
-</p>
- <p>The lto* functions are all implemented in a shared object libLTO. This
- allows the LLVM LTO code to be updated independently of the linker tool.
- On platforms that support it, the shared object is lazily loaded.
-</p>
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="phase2">Phase 2 : Symbol Resolution</a>
-</div>
-
-<div class="doc_text">
- <p>In this stage, the linker resolves symbols using global symbol table.
- It may report undefined symbol errors, read archive members, replace
- weak symbols, etc. The linker is able to do this seamlessly even though it
- does not know the exact content of input LLVM bitcode files. If dead code
- stripping is enabled then the linker collects the list of live symbols.
- </p>
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="phase3">Phase 3 : Optimize Bitcode Files</a>
-</div>
-<div class="doc_text">
- <p>After symbol resolution, the linker tells the LTO shared object which
- symbols are needed by native object files. In the example above, the linker
- reports that only <tt>foo1()</tt> is used by native object files using
- <tt>lto_codegen_add_must_preserve_symbol()</tt>. Next the linker invokes
- the LLVM optimizer and code generators using <tt>lto_codegen_compile()</tt>
- which returns a native object file creating by merging the LLVM bitcode files
- and applying various optimization passes.
-</p>
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="phase4">Phase 4 : Symbol Resolution after optimization</a>
-</div>
-
-<div class="doc_text">
- <p>In this phase, the linker reads optimized a native object file and
- updates the internal global symbol table to reflect any changes. The linker
- also collects information about any changes in use of external symbols by
- LLVM bitcode files. In the examle above, the linker notes that
- <tt>foo4()</tt> is not used any more. If dead code stripping is enabled then
- the linker refreshes the live symbol information appropriately and performs
- dead code stripping.</p>
- <p>After this phase, the linker continues linking as if it never saw LLVM
- bitcode files.</p>
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section">
-<a name="lto">libLTO</a>
-</div>
-
-<div class="doc_text">
- <p><tt>libLTO</tt> is a shared object that is part of the LLVM tools, and
- is intended for use by a linker. <tt>libLTO</tt> provides an abstract C
- interface to use the LLVM interprocedural optimizer without exposing details
- of LLVM's internals. The intention is to keep the interface as stable as
- possible even when the LLVM optimizer continues to evolve. It should even
- be possible for a completely different compilation technology to provide
- a different libLTO that works with their object files and the standard
- linker tool.</p>
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="lto_module_t">lto_module_t</a>
-</div>
-
-<div class="doc_text">
- <p>A non-native object file is handled via an <tt>lto_module_t</tt>.
- The following functions allow the linker to check if a file (on disk
- or in a memory buffer) is a file which libLTO can process: <pre>
- lto_module_is_object_file(const char*)
- lto_module_is_object_file_for_target(const char*, const char*)
- lto_module_is_object_file_in_memory(const void*, size_t)
- lto_module_is_object_file_in_memory_for_target(const void*, size_t, const char*)</pre>
- If the object file can be processed by libLTO, the linker creates a
- <tt>lto_module_t</tt> by using one of <pre>
- lto_module_create(const char*)
- lto_module_create_from_memory(const void*, size_t)</pre>
- and when done, the handle is released via<pre>
- lto_module_dispose(lto_module_t)</pre>
- The linker can introspect the non-native object file by getting the number
- of symbols and getting the name and attributes of each symbol via: <pre>
- lto_module_get_num_symbols(lto_module_t)
- lto_module_get_symbol_name(lto_module_t, unsigned int)
- lto_module_get_symbol_attribute(lto_module_t, unsigned int)</pre>
- The attributes of a symbol include the alignment, visibility, and kind.
-</p>
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="lto_code_gen_t">lto_code_gen_t</a>
-</div>
-
-<div class="doc_text">
- <p>Once the linker has loaded each non-native object files into an
- <tt>lto_module_t</tt>, it can request libLTO to process them all and
- generate a native object file. This is done in a couple of steps.
- First a code generator is created with:<pre>
- lto_codegen_create() </pre>
- then each non-native object file is added to the code generator with:<pre>
- lto_codegen_add_module(lto_code_gen_t, lto_module_t)</pre>
- The linker then has the option of setting some codegen options. Whether
- or not to generate DWARF debug info is set with: <pre>
- lto_codegen_set_debug_model(lto_code_gen_t) </pre>
- Which kind of position independence is set with: <pre>
- lto_codegen_set_pic_model(lto_code_gen_t) </pre>
- And each symbol that is referenced by a native object file or otherwise
- must not be optimized away is set with: <pre>
- lto_codegen_add_must_preserve_symbol(lto_code_gen_t, const char*)</pre>
- After all these settings are done, the linker requests that a native
- object file be created from the modules with the settings using:
- lto_codegen_compile(lto_code_gen_t, size*)</pre>
- which returns a pointer to a buffer containing the generated native
- object file. The linker then parses that and links it with the rest
- of the native object files.
-</div>
-
-<!-- *********************************************************************** -->
-
-<hr>
-<address>
- <a href="http://jigsaw.w3.org/css-validator/check/referer"><img
- src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"></a>
- <a href="http://validator.w3.org/check/referer"><img
- src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!"></a>
-
- Devang Patel and Nick Kledzik<br>
- <a href="http://llvm.org">LLVM Compiler Infrastructure</a><br>
- Last modified: $Date$
-</address>
-
-</body>
-</html>
-
diff --git a/release_23/docs/Makefile b/release_23/docs/Makefile
deleted file mode 100644
index 310c4bd5fd3f..000000000000
--- a/release_23/docs/Makefile
+++ /dev/null
@@ -1,125 +0,0 @@
-##===- docs/Makefile ---------------------------------------*- Makefile -*-===##
-#
-# The LLVM Compiler Infrastructure
-#
-# This file is distributed under the University of Illinois Open Source
-# License. See LICENSE.TXT for details.
-#
-##===----------------------------------------------------------------------===##
-
-LEVEL := ..
-DIRS := CommandGuide tutorial
-
-ifdef BUILD_FOR_WEBSITE
-PROJ_OBJ_DIR = .
-DOXYGEN = doxygen
-
-$(PROJ_OBJ_DIR)/doxygen.cfg: doxygen.cfg.in
- cat $< | sed \
- -e 's/@abs_top_srcdir@/../g' \
- -e 's/@DOT@/dot/g' \
- -e 's/@PACKAGE_VERSION@/mainline/' \
- -e 's/@abs_top_builddir@/../g' > $@
-endif
-
-include $(LEVEL)/Makefile.common
-
-HTML := $(wildcard $(PROJ_SRC_DIR)/*.html) \
- $(wildcard $(PROJ_SRC_DIR)/*.css)
-IMAGES := $(wildcard $(PROJ_SRC_DIR)/img/*.*)
-DOXYFILES := doxygen.cfg.in doxygen.css doxygen.footer doxygen.header \
- doxygen.intro
-EXTRA_DIST := $(HTML) $(DOXYFILES) llvm.css CommandGuide img
-
-.PHONY: install-html install-doxygen doxygen install-ocamldoc ocamldoc generated
-
-install_targets := install-html
-ifeq ($(ENABLE_DOXYGEN),1)
-install_targets += install-doxygen
-endif
-ifneq (,$(filter ocaml,$(BINDINGS_TO_BUILD)))
-install_targets += install-ocamldoc
-endif
-install-local:: $(install_targets)
-
-# Live documentation is generated for the web site using this target:
-# 'make generated BUILD_FOR_WEBSITE=1'
-generated:: doxygen ocamldoc
-
-install-html: $(PROJ_OBJ_DIR)/html.tar.gz
- $(Echo) Installing HTML documentation
- $(Verb) $(MKDIR) $(PROJ_docsdir)/html
- $(Verb) $(MKDIR) $(PROJ_docsdir)/html/img
- $(Verb) $(DataInstall) $(HTML) $(PROJ_docsdir)/html
- $(Verb) $(DataInstall) $(IMAGES) $(PROJ_docsdir)/html/img
- $(Verb) $(DataInstall) $(PROJ_OBJ_DIR)/html.tar.gz $(PROJ_docsdir)
-
-$(PROJ_OBJ_DIR)/html.tar.gz: $(HTML)
- $(Echo) Packaging HTML documentation
- $(Verb) $(RM) -rf $@ $(PROJ_OBJ_DIR)/html.tar
- $(Verb) cd $(PROJ_SRC_DIR) && \
- $(TAR) cf $(PROJ_OBJ_DIR)/html.tar *.html
- $(Verb) $(GZIP) $(PROJ_OBJ_DIR)/html.tar
-
-install-doxygen: doxygen
- $(Echo) Installing doxygen documentation
- $(Verb) $(MKDIR) $(PROJ_docsdir)/html/doxygen
- $(Verb) $(DataInstall) $(PROJ_OBJ_DIR)/doxygen.tar.gz $(PROJ_docsdir)
- $(Verb) cd $(PROJ_OBJ_DIR)/doxygen && \
- $(FIND) . -type f -exec \
- $(DataInstall) {} $(PROJ_docsdir)/html/doxygen \;
-
-doxygen: regendoc $(PROJ_OBJ_DIR)/doxygen.tar.gz
-
-regendoc:
- $(Echo) Building doxygen documentation
- $(Verb) if test -e $(PROJ_OBJ_DIR)/doxygen ; then \
- $(RM) -rf $(PROJ_OBJ_DIR)/doxygen ; \
- fi
- $(Verb) $(DOXYGEN) $(PROJ_OBJ_DIR)/doxygen.cfg
-
-$(PROJ_OBJ_DIR)/doxygen.tar.gz: $(DOXYFILES) $(PROJ_OBJ_DIR)/doxygen.cfg
- $(Echo) Packaging doxygen documentation
- $(Verb) $(RM) -rf $@ $(PROJ_OBJ_DIR)/doxygen.tar
- $(Verb) $(TAR) cf $(PROJ_OBJ_DIR)/doxygen.tar doxygen
- $(Verb) $(GZIP) $(PROJ_OBJ_DIR)/doxygen.tar
- $(Verb) $(CP) $(PROJ_OBJ_DIR)/doxygen.tar.gz $(PROJ_OBJ_DIR)/doxygen/html/
-
-userloc: $(LLVM_SRC_ROOT)/docs/userloc.html
-
-$(LLVM_SRC_ROOT)/docs/userloc.html:
- $(Echo) Making User LOC Table
- $(Verb) cd $(LLVM_SRC_ROOT) ; ./utils/userloc.pl -details -recurse \
- -html lib include tools runtime utils examples autoconf test > docs/userloc.html
-
-install-ocamldoc: ocamldoc
- $(Echo) Installing ocamldoc documentation
- $(Verb) $(MKDIR) $(PROJ_docsdir)/ocamldoc/html
- $(Verb) $(DataInstall) $(PROJ_OBJ_DIR)/ocamldoc.tar.gz $(PROJ_docsdir)
- $(Verb) cd $(PROJ_OBJ_DIR)/ocamldoc && \
- $(FIND) . -type f -exec \
- $(DataInstall) {} $(PROJ_docsdir)/ocamldoc/html \;
-
-ocamldoc: regen-ocamldoc $(PROJ_OBJ_DIR)/ocamldoc.tar.gz
-
-regen-ocamldoc:
- $(Echo) Building ocamldoc documentation
- $(Verb) if test -e $(PROJ_OBJ_DIR)/ocamldoc ; then \
- $(RM) -rf $(PROJ_OBJ_DIR)/ocamldoc ; \
- fi
- $(Verb) $(MAKE) -C $(LEVEL)/bindings/ocaml ocamldoc
- $(Verb) $(MKDIR) $(PROJ_OBJ_DIR)/ocamldoc/html
- $(Verb) \
- $(OCAMLDOC) -d $(PROJ_OBJ_DIR)/ocamldoc/html -sort -colorize-code -html \
- `$(FIND) $(LEVEL)/bindings/ocaml -name "*.odoc" -exec echo -load '{}' ';'`
-
-$(PROJ_OBJ_DIR)/ocamldoc.tar.gz:
- $(Echo) Packaging ocamldoc documentation
- $(Verb) $(RM) -rf $@ $(PROJ_OBJ_DIR)/ocamldoc.tar
- $(Verb) $(TAR) cf $(PROJ_OBJ_DIR)/ocamldoc.tar ocamldoc
- $(Verb) $(GZIP) $(PROJ_OBJ_DIR)/ocamldoc.tar
- $(Verb) $(CP) $(PROJ_OBJ_DIR)/ocamldoc.tar.gz $(PROJ_OBJ_DIR)/ocamldoc/html/
-
-uninstall-local::
- $(Echo) Uninstalling Documentation
- $(Verb) $(RM) -rf $(PROJ_docsdir)
diff --git a/release_23/docs/MakefileGuide.html b/release_23/docs/MakefileGuide.html
deleted file mode 100644
index 7b4b7552c1de..000000000000
--- a/release_23/docs/MakefileGuide.html
+++ /dev/null
@@ -1,1041 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
-<html>
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <title>LLVM Makefile Guide</title>
- <link rel="stylesheet" href="llvm.css" type="text/css">
-</head>
-<body>
-
-<div class="doc_title">LLVM Makefile Guide</div>
-
-<ol>
- <li><a href="#introduction">Introduction</a></li>
- <li><a href="#general">General Concepts</a>
- <ol>
- <li><a href="#projects">Projects</a></li>
- <li><a href="#varvals">Variable Values</a></li>
- <li><a href="#including">Including Makefiles</a>
- <ol>
- <li><a href="#Makefile">Makefile</a></li>
- <li><a href="#Makefile.common">Makefile.common</a></li>
- <li><a href="#Makefile.config">Makefile.config</a></li>
- <li><a href="#Makefile.rules">Makefile.rules</a></li>
- </ol>
- </li>
- <li><a href="#Comments">Comments</a></li>
- </ol>
- </li>
- <li><a href="#tutorial">Tutorial</a>
- <ol>
- <li><a href="#libraries">Libraries</a>
- <ol>
- <li><a href="#BCModules">Bitcode Modules</a></li>
- <li><a href="#LoadableModules">Loadable Modules</a></li>
- </ol>
- </li>
- <li><a href="#tools">Tools</a>
- <ol>
- <li><a href="#JIT">JIT Tools</a></li>
- </ol>
- </li>
- <li><a href="#projects">Projects</a></li>
- </ol>
- </li>
- <li><a href="#targets">Targets Supported</a>
- <ol>
- <li><a href="#all">all</a></li>
- <li><a href="#all-local">all-local</a></li>
- <li><a href="#check">check</a></li>
- <li><a href="#check-local">check-local</a></li>
- <li><a href="#clean">clean</a></li>
- <li><a href="#clean-local">clean-local</a></li>
- <li><a href="#dist">dist</a></li>
- <li><a href="#dist-check">dist-check</a></li>
- <li><a href="#dist-clean">dist-clean</a></li>
- <li><a href="#install">install</a></li>
- <li><a href="#preconditions">preconditions</a></li>
- <li><a href="#printvars">printvars</a></li>
- <li><a href="#reconfigure">reconfigure</a></li>
- <li><a href="#spotless">spotless</a></li>
- <li><a href="#tags">tags</a></li>
- <li><a href="#uninstall">uninstall</a></li>
- </ol>
- </li>
- <li><a href="#variables">Using Variables</a>
- <ol>
- <li><a href="#setvars">Control Variables</a></li>
- <li><a href="#overvars">Override Variables</a></li>
- <li><a href="#getvars">Readable Variables</a></li>
- <li><a href="#intvars">Internal Variables</a></li>
- </ol>
- </li>
-</ol>
-
-<div class="doc_author">
- <p>Written by <a href="mailto:reid@x10sys.com">Reid Spencer</a></p>
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section"><a name="introduction">Introduction </a></div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
- <p>This document provides <em>usage</em> information about the LLVM makefile
- system. While loosely patterned after the BSD makefile system, LLVM has taken
- a departure from BSD in order to implement additional features needed by LLVM.
- Although makefile systems such as automake were attempted at one point, it
- has become clear that the features needed by LLVM and the Makefile norm are
- too great to use a more limited tool. Consequently, LLVM requires simply GNU
- Make 3.79, a widely portable makefile processor. LLVM unabashedly makes heavy
- use of the features of GNU Make so the dependency on GNU Make is firm. If
- you're not familiar with <tt>make</tt>, it is recommended that you read the
- <a href="http://www.gnu.org/software/make/manual/make.html">GNU Makefile
- Manual</a>.</p>
- <p>While this document is rightly part of the
- <a href="ProgrammersManual.html">LLVM Programmer's Manual</a>, it is treated
- separately here because of the volume of content and because it is often an
- early source of bewilderment for new developers.</p>
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section"><a name="general">General Concepts</a></div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
- <p>The LLVM Makefile System is the component of LLVM that is responsible for
- building the software, testing it, generating distributions, checking those
- distributions, installing and uninstalling, etc. It consists of a several
- files throughout the source tree. These files and other general concepts are
- described in this section.</p>
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection"><a name="projects">Projects</a></div>
-<div class="doc_text">
- <p>The LLVM Makefile System is quite generous. It not only builds its own
- software, but it can build yours too. Built into the system is knowledge of
- the <tt>llvm/projects</tt> directory. Any directory under <tt>projects</tt>
- that has both a <tt>configure</tt> script and a <tt>Makefile</tt> is assumed
- to be a project that uses the LLVM Makefile system. Building software that
- uses LLVM does not require the LLVM Makefile System nor even placement in the
- <tt>llvm/projects</tt> directory. However, doing so will allow your project
- to get up and running quickly by utilizing the built-in features that are used
- to compile LLVM. LLVM compiles itself using the same features of the makefile
- system as used for projects.</p>
- <p>For complete details on setting up your projects configuration, simply
- mimic the <tt>llvm/projects/sample</tt> project or for further details,
- consult the <a href="Projects.html">Projects.html</a> page.</p>
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection"><a name="varvalues">Variable Values</a></div>
-<div class="doc_text">
- <p>To use the makefile system, you simply create a file named
- <tt>Makefile</tt> in your directory and declare values for certain variables.
- The variables and values that you select determine what the makefile system
- will do. These variables enable rules and processing in the makefile system
- that automatically Do The Right Thing&trade;.
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection"><a name="including">Including Makefiles</a></div>
-<div class="doc_text">
- <p>Setting variables alone is not enough. You must include into your Makefile
- additional files that provide the rules of the LLVM Makefile system. The
- various files involved are described in the sections that follow.</p>
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsubsection"><a name="Makefile">Makefile</a></div>
-<div class="doc_text">
- <p>Each directory to participate in the build needs to have a file named
- <tt>Makefile</tt>. This is the file first read by <tt>make</tt>. It has three
- sections:</p>
- <ol>
- <li><a href="#setvars">Settable Variables</a> - Required that must be set
- first.</li>
- <li><a href="#Makefile.common">include <tt>$(LEVEL)/Makefile.common</tt></a>
- - include the LLVM Makefile system.
- <li><a href="#overvars">Override Variables</a> - Override variables set by
- the LLVM Makefile system.
- </ol>
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsubsection"><a name="Makefile.common">Makefile.common</a>
-</div>
-<div class="doc_text">
- <p>Every project must have a <tt>Makefile.common</tt> file at its top source
- directory. This file serves three purposes:</p>
- <ol>
- <li>It includes the project's configuration makefile to obtain values
- determined by the <tt>configure</tt> script. This is done by including the
- <a href="#Makefile.config"><tt>$(LEVEL)/Makefile.config</tt></a> file.</li>
- <li>It specifies any other (static) values that are needed throughout the
- project. Only values that are used in all or a large proportion of the
- project's directories should be placed here.</li>
- <li>It includes the standard rules for the LLVM Makefile system,
- <a href="#Makefile.rules"><tt>$(LLVM_SRC_ROOT)/Makefile.rules</tt></a>.
- This file is the "guts" of the LLVM Makefile system.</li>
- </ol>
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsubsection"><a name="Makefile.config">Makefile.config</a>
-</div>
-<div class="doc_text">
- <p>Every project must have a <tt>Makefile.config</tt> at the top of its
- <em>build</em> directory. This file is <b>generated</b> by the
- <tt>configure</tt> script from the pattern provided by the
- <tt>Makefile.config.in</tt> file located at the top of the project's
- <em>source</em> directory. The contents of this file depend largely on what
- configuration items the project uses, however most projects can get what they
- need by just relying on LLVM's configuration found in
- <tt>$(LLVM_OBJ_ROOT)/Makefile.config</tt>.
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsubsection"><a name="Makefile.rules">Makefile.rules</a></div>
-<div class="doc_text">
- <p>This file, located at <tt>$(LLVM_SRC_ROOT)/Makefile.rules</tt> is the heart
- of the LLVM Makefile System. It provides all the logic, dependencies, and
- rules for building the targets supported by the system. What it does largely
- depends on the values of <tt>make</tt> <a href="#variables">variables</a> that
- have been set <em>before</em> <tt>Makefile.rules</tt> is included.
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection"><a name="Comments">Comments</a></div>
-<div class="doc_text">
- <p>User Makefiles need not have comments in them unless the construction is
- unusual or it does not strictly follow the rules and patterns of the LLVM
- makefile system. Makefile comments are invoked with the pound (#) character.
- The # character and any text following it, to the end of the line, are ignored
- by <tt>make</tt>.</p>
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section"><a name="tutorial">Tutorial</a></div>
-<!-- *********************************************************************** -->
-<div class="doc_text">
- <p>This section provides some examples of the different kinds of modules you
- can build with the LLVM makefile system. In general, each directory you
- provide will build a single object although that object may be composed of
- additionally compiled components.</p>
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection"><a name="libraries">Libraries</a></div>
-<div class="doc_text">
- <p>Only a few variable definitions are needed to build a regular library.
- Normally, the makefile system will build all the software into a single
- <tt>libname.o</tt> (pre-linked) object. This means the library is not
- searchable and that the distinction between compilation units has been
- dissolved. Optionally, you can ask for a shared library (.so), archive library
- (.a) or to not have the default (relinked) library built. For example:</p>
- <pre><tt>
- LIBRARYNAME = mylib
- SHARED_LIBRARY = 1
- ARCHIVE_LIBRARY = 1
- DONT_BUILD_RELINKED = 1
- </tt></pre>
- <p>says to build a library named "mylib" with both a shared library
- (<tt>mylib.so</tt>) and an archive library (<tt>mylib.a</tt>) version but
- not to build the relinked object (<tt>mylib.o</tt>). The contents of all the
- libraries produced will be the same, they are just constructed differently.
- Note that you normally do not need to specify the sources involved. The LLVM
- Makefile system will infer the source files from the contents of the source
- directory.</p>
- <p>The <tt>LOADABLE_MODULE=1</tt> directive can be used in conjunction with
- <tt>SHARED_LIBRARY=1</tt> to indicate that the resulting shared library should
- be openable with the <tt>dlopen</tt> function and searchable with the
- <tt>dlsym</tt> function (or your operating system's equivalents). While this
- isn't strictly necessary on Linux and a few other platforms, it is required
- on systems like HP-UX and Darwin. You should use <tt>LOADABLE_MODULE</tt> for
- any shared library that you intend to be loaded into an tool via the
- <tt>-load</tt> option. See the
- <a href="WritingAnLLVMPass.html#makefile">WritingAnLLVMPass.html</a> document
- for an example of why you might want to do this.
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsubsection"><a name="BCModules">Bitcode Modules</a></div>
-<div class="doc_text">
- <p>In some situations, it is desireable to build a single bitcode module from
- a variety of sources, instead of an archive, shared library, or bitcode
- library. Bitcode modules can be specified in addition to any of the other
- types of libraries by defining the <a href="#MODULE_NAME">MODULE_NAME</a>
- variable. For example:</p>
- <pre><tt>
- LIBRARYNAME = mylib
- BYTECODE_LIBRARY = 1
- MODULE_NAME = mymod
- </tt></pre>
- <p>will build a module named <tt>mymod.bc</tt> from the sources in the
- directory. This module will be an aggregation of all the bitcode modules
- derived from the sources. The example will also build a bitcode archive
- containing a bitcode module for each compiled source file. The difference is
- subtle, but important depending on how the module or library is to be linked.
- </p>
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsubsection">
- <a name="LoadableModules">Loadable Modules</a>
-</div>
-<div class="doc_text">
- <p>In some situations, you need to create a loadable module. Loadable modules
- can be loaded into programs like <tt>opt</tt> or <tt>llc</tt> to specify
- additional passes to run or targets to support. Loadable modules are also
- useful for debugging a pass or providing a pass with another package if that
- pass can't be included in LLVM.</p>
- <p>LLVM provides complete support for building such a module. All you need to
- do is use the LOADABLE_MODULE variable in your Makefile. For example, to
- build a loadable module named <tt>MyMod</tt> that uses the LLVM libraries
- <tt>LLVMSupport.a</tt> and <tt>LLVMSystem.a</tt>, you would specify:</p>
- <pre><tt>
- LIBRARYNAME := MyMod
- LOADABLE_MODULE := 1
- LINK_COMPONENTS := support system
- </tt></pre>
- <p>Use of the <tt>LOADABLE_MODULE</tt> facility implies several things:</p>
- <ol>
- <li>There will be no "lib" prefix on the module. This differentiates it from
- a standard shared library of the same name.</li>
- <li>The <a href="#SHARED_LIBRARY">SHARED_LIBRARY</a> variable is turned
- on.</li>
- <li>The <a href="#LINK_LIBS_IN_SHARED">LINK_LIBS_IN_SHARED</a> variable
- is turned on.</li>
- <li>The <a href="#DONT_BUILD_RELINKED">DONT_BUILD_RELINKED</a> variable
- is turned on.</li>
- </ol>
- <p>A loadable module is loaded by LLVM via the facilities of libtool's libltdl
- library which is part of <tt>lib/System</tt> implementation.</p>
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection"><a name="tools">Tools</a></div>
-<div class="doc_text">
- <p>For building executable programs (tools), you must provide the name of the
- tool and the names of the libraries you wish to link with the tool. For
- example:</p>
- <pre><tt>
- TOOLNAME = mytool
- USEDLIBS = mylib
- LINK_COMPONENTS = support system
- </tt></pre>
- <p>says that we are to build a tool name <tt>mytool</tt> and that it requires
- three libraries: <tt>mylib</tt>, <tt>LLVMSupport.a</tt> and
- <tt>LLVMSystem.a</tt>.</p>
- <p>Note that two different variables are use to indicate which libraries are
- linked: <tt>USEDLIBS</tt> and <tt>LLVMLIBS</tt>. This distinction is necessary
- to support projects. <tt>LLVMLIBS</tt> refers to the LLVM libraries found in
- the LLVM object directory. <tt>USEDLIBS</tt> refers to the libraries built by
- your project. In the case of building LLVM tools, <tt>USEDLIBS</tt> and
- <tt>LLVMLIBS</tt> can be used interchangeably since the "project" is LLVM
- itself and <tt>USEDLIBS</tt> refers to the same place as <tt>LLVMLIBS</tt>.
- </p>
- <p>Also note that there are two different ways of specifying a library: with a
- <tt>.a</tt> suffix and without. Without the suffix, the entry refers to the
- re-linked (.o) file which will include <em>all</em> symbols of the library.
- This is useful, for example, to include all passes from a library of passes.
- If the <tt>.a</tt> suffix is used then the library is linked as a searchable
- library (with the <tt>-l</tt> option). In this case, only the symbols that are
- unresolved <em>at that point</em> will be resolved from the library, if they
- exist. Other (unreferenced) symbols will not be included when the <tt>.a</tt>
- syntax is used. Note that in order to use the <tt>.a</tt> suffix, the library
- in question must have been built with the <tt>ARCHIVE_LIBRARY</tt> option set.
- </p>
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsubsection"><a name="JIT">JIT Tools</a></div>
-<div class="doc_text">
- <p>Many tools will want to use the JIT features of LLVM. To do this, you
- simply specify that you want an execution 'engine', and the makefiles will
- automatically link in the appropriate JIT for the host or an interpreter
- if none is available:</p>
- <pre><tt>
- TOOLNAME = my_jit_tool
- USEDLIBS = mylib
- LINK_COMPONENTS = engine
- </tt></pre>
- <p>Of course, any additional libraries may be listed as other components. To
- get a full understanding of how this changes the linker command, it is
- recommended that you:</p>
- <pre><tt>
- cd examples/Fibonacci
- make VERBOSE=1
- </tt></pre>
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section"><a name="targets">Targets Supported</a></div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
- <p>This section describes each of the targets that can be built using the LLVM
- Makefile system. Any target can be invoked from any directory but not all are
- applicable to a given directory (e.g. "check", "dist" and "install" will
- always operate as if invoked from the top level directory).</p>
-
- <table style="text-align:left">
- <tr>
- <th>Target Name</th><th>Implied Targets</th><th>Target Description</th>
- </tr>
- <tr><td><a href="#all"><tt>all</tt></a></td><td></td>
- <td>Compile the software recursively. Default target.
- </td></tr>
- <tr><td><a href="#all-local"><tt>all-local</tt></a></td><td></td>
- <td>Compile the software in the local directory only.
- </td></tr>
- <tr><td><a href="#check"><tt>check</tt></a></td><td></td>
- <td>Change to the <tt>test</tt> directory in a project and run the
- test suite there.
- </td></tr>
- <tr><td><a href="#check-local"><tt>check-local</tt></a></td><td></td>
- <td>Run a local test suite. Generally this is only defined in the
- <tt>Makefile</tt> of the project's <tt>test</tt> directory.
- </td></tr>
- <tr><td><a href="#clean"><tt>clean</tt></a></td><td></td>
- <td>Remove built objects recursively.
- </td></tr>
- <tr><td><a href="#clean-local"><tt>clean-local</tt></a></td><td></td>
- <td>Remove built objects from the local directory only.
- </td></tr>
- <tr><td><a href="#dist"><tt>dist</tt></a></td><td>all</td>
- <td>Prepare a source distribution tarball.
- </td></tr>
- <tr><td><a href="#dist-check"><tt>dist-check</tt></a></td><td>all</td>
- <td>Prepare a source distribution tarball and check that it builds.
- </td></tr>
- <tr><td><a href="#dist-clean"><tt>dist-clean</tt></a></td><td>clean</td>
- <td>Clean source distribution tarball temporary files.
- </td></tr>
- <tr><td><a href="#install"><tt>install</tt></a></td><td>all</td>
- <td>Copy built objects to installation directory.
- </td></tr>
- <tr><td><a href="#preconditions"><tt>preconditions</tt></a></td><td>all</td>
- <td>Check to make sure configuration and makefiles are up to date.
- </td></tr>
- <tr><td><a href="#printvars"><tt>printvars</tt></a></td><td>all</td>
- <td>Prints variables defined by the makefile system (for debugging).
- </td></tr>
- <tr><td><a href="#tags"><tt>tags</tt></a></td><td></td>
- <td>Make C and C++ tags files for emacs and vi.
- </td></tr>
- <tr><td><a href="#uninstall"><tt>uninstall</tt></a></td><td></td>
- <td>Remove built objects from installation directory.
- </td></tr>
- </table>
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection"><a name="all">all (default)</a></div>
-<div class="doc_text">
- <p>When you invoke <tt>make</tt> with no arguments, you are implicitly
- instructing it to seek the "all" target (goal). This target is used for
- building the software recursively and will do different things in different
- directories. For example, in a <tt>lib</tt> directory, the "all" target will
- compile source files and generate libraries. But, in a <tt>tools</tt>
- directory, it will link libraries and generate executables.</p>
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection"><a name="all-local">all-local</a></div>
-<div class="doc_text">
- <p>This target is the same as <a href="#all">all</a> but it operates only on
- the current directory instead of recursively.</p>
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection"><a name="check">check</a></div>
-<div class="doc_text">
- <p>This target can be invoked from anywhere within a project's directories
- but always invokes the <a href="#check-local"><tt>check-local</tt></a> target
- in the project's <tt>test</tt> directory, if it exists and has a
- <tt>Makefile</tt>. A warning is produced otherwise. If
- <a href="#TESTSUITE"><tt>TESTSUITE</tt></a> is defined on the <tt>make</tt>
- command line, it will be passed down to the invocation of
- <tt>make check-local</tt> in the <tt>test</tt> directory. The intended usage
- for this is to assist in running specific suites of tests. If
- <tt>TESTSUITE</tt> is not set, the implementation of <tt>check-local</tt>
- should run all normal tests. It is up to the project to define what
- different values for <tt>TESTSUTE</tt> will do. See the
- <a href="TestingGuide.html">TestingGuide</a> for further details.</p>
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection"><a name="check-local">check-local</a></div>
-<div class="doc_text">
- <p>This target should be implemented by the <tt>Makefile</tt> in the project's
- <tt>test</tt> directory. It is invoked by the <tt>check</tt> target elsewhere.
- Each project is free to define the actions of <tt>check-local</tt> as
- appropriate for that project. The LLVM project itself uses dejagnu to run a
- suite of feature and regresson tests. Other projects may choose to use
- dejagnu or any other testing mechanism.</p>
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection"><a name="clean">clean</a></div>
-<div class="doc_text">
- <p>This target cleans the build directory, recursively removing all things
- that the Makefile builds. The cleaning rules have been made guarded so they
- shouldn't go awry (via <tt>rm -f $(UNSET_VARIABLE)/*</tt> which will attempt
- to erase the entire directory structure.</p>
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection"><a name="clean-local">clean-local</a></div>
-<div class="doc_text">
- <p>This target does the same thing as <tt>clean</tt> but only for the current
- (local) directory.</p>
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection"><a name="dist">dist</a></div>
-<div class="doc_text">
- <p>This target builds a distribution tarball. It first builds the entire
- project using the <tt>all</tt> target and then tars up the necessary files and
- compresses it. The generated tarball is sufficient for a casual source
- distribution, but probably not for a release (see <tt>dist-check</tt>).</p>
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection"><a name="dist-check">dist-check</a></div>
-<div class="doc_text">
- <p>This target does the same thing as the <tt>dist</tt> target but also checks
- the distribution tarball. The check is made by unpacking the tarball to a new
- directory, configuring it, building it, installing it, and then verifying that
- the installation results are correct (by comparing to the original build).
- This target can take a long time to run but should be done before a release
- goes out to make sure that the distributed tarball can actually be built into
- a working release.</p>
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection"><a name="dist-clean">dist-clean</a></div>
-<div class="doc_text">
- <p>This is a special form of the <tt>clean</tt> clean target. It performs a
- normal <tt>clean</tt> but also removes things pertaining to building the
- distribution.</p>
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection"><a name="install">install</a></div>
-<div class="doc_text">
- <p>This target finalizes shared objects and executables and copies all
- libraries, headers, executables and documentation to the directory given
- with the <tt>--prefix</tt> option to <tt>configure</tt>. When completed,
- the prefix directory will have everything needed to <b>use</b> LLVM. </p>
- <p>The LLVM makefiles can generate complete <b>internal</b> documentation
- for all the classes by using <tt>doxygen</tt>. By default, this feature is
- <b>not</b> enabled because it takes a long time and generates a massive
- amount of data (>100MB). If you want this feature, you must configure LLVM
- with the --enable-doxygen switch and ensure that a modern version of doxygen
- (1.3.7 or later) is available in your <tt>PATH</tt>. You can download
- doxygen from
- <a href="http://www.stack.nl/~dimitri/doxygen/download.html#latestsrc">
- here</a>.
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection"><a name="preconditions">preconditions</a></div>
-<div class="doc_text">
- <p>This utility target checks to see if the <tt>Makefile</tt> in the object
- directory is older than the <tt>Makefile</tt> in the source directory and
- copies it if so. It also reruns the <tt>configure</tt> script if that needs to
- be done and rebuilds the <tt>Makefile.config</tt> file similarly. Users may
- overload this target to ensure that sanity checks are run <em>before</em> any
- building of targets as all the targets depend on <tt>preconditions</tt>.</p>
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection"><a name="printvars">printvars</a></div>
-<div class="doc_text">
- <p>This utility target just causes the LLVM makefiles to print out some of
- the makefile variables so that you can double check how things are set. </p>
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection"><a name="reconfigure">reconfigure</a></div>
-<div class="doc_text">
- <p>This utility target will force a reconfigure of LLVM or your project. It
- simply runs <tt>$(PROJ_OBJ_ROOT)/config.status --recheck</tt> to rerun the
- configuration tests and rebuild the configured files. This isn't generally
- useful as the makefiles will reconfigure themselves whenever its necessary.
- </p>
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection"><a name="spotless">spotless</a></div>
-<div class="doc_text">
- <p>This utility target, only available when <tt>$(PROJ_OBJ_ROOT)</tt> is not
- the same as <tt>$(PROJ_SRC_ROOT)</tt>, will completely clean the
- <tt>$(PROJ_OBJ_ROOT)</tt> directory by removing its content entirely and
- reconfiguring the directory. This returns the <tt>$(PROJ_OBJ_ROOT)</tt>
- directory to a completely fresh state. All content in the directory except
- configured files and top-level makefiles will be lost.</p>
- <div class="doc_warning"><p>Use with caution.</p></div>
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection"><a name="tags">tags</a></div>
-<div class="doc_text">
- <p>This target will generate a <tt>TAGS</tt> file in the top-level source
- directory. It is meant for use with emacs, XEmacs, or ViM. The TAGS file
- provides an index of symbol definitions so that the editor can jump you to the
- definition quickly. </p>
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection"><a name="uninstall">uninstall</a></div>
-<div class="doc_text">
- <p>This target is the opposite of the <tt>install</tt> target. It removes the
- header, library and executable files from the installation directories. Note
- that the directories themselves are not removed because it is not guaranteed
- that LLVM is the only thing installing there (e.g. --prefix=/usr).</p>
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section"><a name="variables">Variables</a></div>
-<!-- *********************************************************************** -->
-<div class="doc_text">
- <p>Variables are used to tell the LLVM Makefile System what to do and to
- obtain information from it. Variables are also used internally by the LLVM
- Makefile System. Variable names that contain only the upper case alphabetic
- letters and underscore are intended for use by the end user. All other
- variables are internal to the LLVM Makefile System and should not be relied
- upon nor modified. The sections below describe how to use the LLVM Makefile
- variables.</p>
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection"><a name="setvars">Control Variables</a></div>
-<div class="doc_text">
- <p>Variables listed in the table below should be set <em>before</em> the
- inclusion of <a href="#Makefile.common"><tt>$(LEVEL)/Makefile.common</tt></a>.
- These variables provide input to the LLVM make system that tell it what to do
- for the current directory.</p>
- <dl>
- <dt><a name="BUILD_ARCHIVE"><tt>BUILD_ARCHIVE</tt></a></dt>
- <dd>If set to any value, causes an archive (.a) library to be built.</dd>
- <dt><a name="BUILT_SOURCES"><tt>BUILT_SOURCES</tt></a></dt>
- <dd>Specifies a set of source files that are generated from other source
- files. These sources will be built before any other target processing to
- ensure they are present.</dd>
- <dt><a name="BYTECODE_LIBRARY"><tt>BYTECODE_LIBRARY</tt></a></dt>
- <dd>If set to any value, causes a bitcode library (.bc) to be built.</dd>
- <dt><a name="CONFIG_FILES"><tt>CONFIG_FILES</tt></a></dt>
- <dd>Specifies a set of configuration files to be installed.</dd>
- <dt><a name="DIRS"><tt>DIRS</tt></a></dt>
- <dd>Specifies a set of directories, usually children of the current
- directory, that should also be made using the same goal. These directories
- will be built serially.</dd>
- <dt><a name="DISABLE_AUTO_DEPENDENCIES"><tt>DISABLE_AUTO_DEPENDENCIES</tt></a></dt>
- <dd>If set to any value, causes the makefiles to <b>not</b> automatically
- generate dependencies when running the compiler. Use of this feature is
- discouraged and it may be removed at a later date.</dd>
- <dt><a name="DONT_BUILD_RELINKED"><tt>DONT_BUILD_RELINKED</tt></a></dt>
- <dd>If set to any value, causes a relinked library (.o) not to be built. By
- default, libraries are built as re-linked since most LLVM libraries are
- needed in their entirety and re-linked libraries will be linked more quickly
- than equivalent archive libraries.</dd>
- <dt><a name="ENABLE_OPTIMIZED"><tt>ENABLE_OPTIMIZED</tt></a></dt>
- <dd>If set to any value, causes the build to generate optimized objects,
- libraries and executables. This alters the flags specified to the compilers
- and linkers. Generally debugging won't be a fun experience with an optimized
- build.</dd>
- <dt><a name="ENABLE_PROFILING"><tt>ENABLE_PROFILING</tt></a></dt>
- <dd>If set to any value, causes the build to generate both optimized and
- profiled objects, libraries and executables. This alters the flags specified
- to the compilers and linkers to ensure that profile data can be collected
- from the tools built. Use the <tt>gprof</tt> tool to analyze the output from
- the profiled tools (<tt>gmon.out</tt>).</dd>
- <dt><a name="DISABLE_ASSERTIONS"><tt>DISABLE_ASSERTIONS</tt></a></dt>
- <dd>If set to any value, causes the build to disable assertions, even if
- building a release or profile build. This will exclude all assertion check
- code from the build. LLVM will execute faster, but with little help when
- things go wrong.</dd>
- <dt><a name="EXPERIMENTAL_DIRS"><tt>EXPERIMENTAL_DIRS</tt></a></dt>
- <dd>Specify a set of directories that should be built, but if they fail, it
- should not cause the build to fail. Note that this should only be used
- temporarily while code is being written.</dd>
- <dt><a name="EXPORTED_SYMBOL_FILE"><tt>EXPORTED_SYMBOL_FILE</tt></a></dt>
- <dd>Specifies the name of a single file that contains a list of the
- symbols to be exported by the linker. One symbol per line.</dd>
- <dt><a name="EXPORTED_SYMBOL_LIST"><tt>EXPORTED_SYMBOL_LIST</tt></a></dt>
- <dd>Specifies a set of symbols to be exported by the linker.</dd>
- <dt><a name="EXTRA_DIST"><tt>EXTRA_DIST</tt></a></dt>
- <dd>Specifies additional files that should be distributed with LLVM. All
- source files, all built sources, all Makefiles, and most documentation files
- will be automatically distributed. Use this variable to distribute any
- files that are not automatically distributed.</dd>
- <dt><a name="KEEP_SYMBOLS"><tt>KEEP_SYMBOLS</tt></a></dt>
- <dd>If set to any value, specifies that when linking executables the
- makefiles should retain debug symbols in the executable. Normally, symbols
- are stripped from the executable.</dd>
- <dt><a name="LEVEL"><tt>LEVEL</tt></a><small>(required)</small></dt>
- <dd>Specify the level of nesting from the top level. This variable must be
- set in each makefile as it is used to find the top level and thus the other
- makefiles.</dd>
- <dt><a name="LIBRARYNAME"><tt>LIBRARYNAME</tt></a></dt>
- <dd>Specify the name of the library to be built. (Required For
- Libraries)</dd>
- <dt><a name="LINK_COMPONENTS"><tt>LINK_COMPONENTS</tt></a></dt>
- <dd>When specified for building a tool, the value of this variable will be
- passed to the <tt>llvm-config</tt> tool to generate a link line for the
- tool. Unlike <tt>USEDLIBS</tt> and <tt>LLVMLIBS</tt>, not all libraries need
- to be specified. The <tt>llvm-config</tt> tool will figure out the library
- dependencies and add any libraries that are needed. The <tt>USEDLIBS</tt>
- variable can still be used in conjunction with <tt>LINK_COMPONENTS</tt> so
- that additional project-specific libraries can be linked with the LLVM
- libraries specified by <tt>LINK_COMPONENTS</tt></dd>
- <dt><a name="LINK_LIBS_IN_SHARED"><tt>LINK_LIBS_IN_SHARED</tt></a></dt>
- <dd>By default, shared library linking will ignore any libraries specified
- with the <a href="LLVMLIBS">LLVMLIBS</a> or <a href="USEDLIBS">USEDLIBS</a>.
- This prevents shared libs from including things that will be in the LLVM
- tool the shared library will be loaded into. However, sometimes it is useful
- to link certain libraries into your shared library and this option enables
- that feature.</dd>
- <dt><a name="LLVMLIBS"><tt>LLVMLIBS</tt></a></dt>
- <dd>Specifies the set of libraries from the LLVM $(ObjDir) that will be
- linked into the tool or library.</dd>
- <dt><a name="LOADABLE_MODULE"><tt>LOADABLE_MODULE</tt></a></dt>
- <dd>If set to any value, causes the shared library being built to also be
- a loadable module. Loadable modules can be opened with the dlopen() function
- and searched with dlsym (or the operating system's equivalent). Note that
- setting this variable without also setting <tt>SHARED_LIBRARY</tt> will have
- no effect.</dd>
- <dt><a name="MODULE_NAME"><tt>MODULE_NAME</tt></a></dt>
- <dd>Specifies the name of a bitcode module to be created. A bitcode
- module can be specified in conjunction with other kinds of library builds
- or by itself. It constructs from the sources a single linked bitcode
- file.</dd>
- <dt><a name="NO_INSTALL"><tt>NO_INSTALL</tt></a></dt>
- <dd>Specifies that the build products of the directory should not be
- installed but should be built even if the <tt>install</tt> target is given.
- This is handy for directories that build libraries or tools that are only
- used as part of the build process, such as code generators (e.g.
- <tt>tblgen</tt>).</dd>
- <dt><a name="OPTIONAL_DIRS"><tt>OPTIONAL_DIRS</tt></a></dt>
- <dd>Specify a set of directories that may be built, if they exist, but its
- not an error for them not to exist.</dd>
- <dt><a name="PARALLEL_DIRS"><tt>PARALLEL_DIRS</tt></a></dt>
- <dd>Specify a set of directories to build recursively and in parallel if
- the -j option was used with <tt>make</tt>.</dd>
- <dt><a name="SHARED_LIBRARY"><tt>SHARED_LIBRARY</tt></a></dt>
- <dd>If set to any value, causes a shared library (.so) to be built in
- addition to any other kinds of libraries. Note that this option will cause
- all source files to be built twice: once with options for position
- independent code and once without. Use it only where you really need a
- shared library.</dd>
- <dt><a name="SOURCES"><tt>SOURCES</tt><small>(optional)</small></a></dt>
- <dd>Specifies the list of source files in the current directory to be
- built. Source files of any type may be specified (programs, documentation,
- config files, etc.). If not specified, the makefile system will infer the
- set of source files from the files present in the current directory.</dd>
- <dt><a name="SUFFIXES"><tt>SUFFIXES</tt></a></dt>
- <dd>Specifies a set of filename suffixes that occur in suffix match rules.
- Only set this if your local <tt>Makefile</tt> specifies additional suffix
- match rules.</dd>
- <dt><a name="TARGET"><tt>TARGET</tt></a></dt>
- <dd>Specifies the name of the LLVM code generation target that the
- current directory builds. Setting this variable enables additional rules to
- build <tt>.inc</tt> files from <tt>.td</tt> files. </dd>
- <dt><a name="TESTSUITE"><tt>TESTSUITE</tt></a></dt>
- <dd>Specifies the directory of tests to run in <tt>llvm/test</tt>.</dd>
- <dt><a name="TOOLNAME"><tt>TOOLNAME</tt></a></dt>
- <dd>Specifies the name of the tool that the current directory should
- build.</dd>
- <dt><a name="TOOL_VERBOSE"><tt>TOOL_VERBOSE</tt></a></dt>
- <dd>Implies VERBOSE and also tells each tool invoked to be verbose. This is
- handy when you're trying to see the sub-tools invoked by each tool invoked
- by the makefile. For example, this will pass <tt>-v</tt> to the GCC
- compilers which causes it to print out the command lines it uses to invoke
- sub-tools (compiler, assembler, linker).</dd>
- <dt><a name="USEDLIBS"><tt>USEDLIBS</tt></a></dt>
- <dd>Specifies the list of project libraries that will be linked into the
- tool or library.</dd>
- <dt><a name="VERBOSE"><tt>VERBOSE</tt></a></dt>
- <dd>Tells the Makefile system to produce detailed output of what it is doing
- instead of just summary comments. This will generate a LOT of output.</dd>
- </dl>
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection"><a name="overvars">Override Variables</a></div>
-<div class="doc_text">
- <p>Override variables can be used to override the default
- values provided by the LLVM makefile system. These variables can be set in
- several ways:</p>
- <ul>
- <li>In the environment (e.g. setenv, export) -- not recommended.</li>
- <li>On the <tt>make</tt> command line -- recommended.</li>
- <li>On the <tt>configure</tt> command line</li>
- <li>In the Makefile (only <em>after</em> the inclusion of <a
- href="#Makefile.common"><tt>$(LEVEL)/Makefile.common</tt></a>).</li>
- </ul>
- <p>The override variables are given below:</p>
- <dl>
- <dt><a name="AR"><tt>AR</tt></a> <small>(defaulted)</small></dt>
- <dd>Specifies the path to the <tt>ar</tt> tool.</dd>
- <dt><a name="BISON"><tt>BISON</tt></a><small>(configured)</small></dt>
- <dd>Specifies the path to the <tt>bison</tt> tool.</dd>
- <dt><a name="PROJ_OBJ_DIR"><tt>PROJ_OBJ_DIR</tt></a></dt>
- <dd>The directory into which the products of build rules will be placed.
- This might be the same as
- <a href="#PROJ_SRC_DIR"><tt>PROJ_SRC_DIR</tt></a> but typically is
- not.</dd>
- <dt><a name="PROJ_SRC_DIR"><tt>PROJ_SRC_DIR</tt></a></dt>
- <dd>The directory which contains the source files to be built.</dd>
- <dt><a name="BZIP2"><tt>BZIP2</tt></a><small>(configured)</small></dt>
- <dd>The path to the <tt>bzip2</tt> tool.</dd>
- <dt><a name="CC"><tt>CC</tt></a><small>(configured)</small></dt>
- <dd>The path to the 'C' compiler.</dd>
- <dt><a name="CFLAGS"><tt>CFLAGS</tt></a></dt>
- <dd>Additional flags to be passed to the 'C' compiler.</dd>
- <dt><a name="CXX"><tt>CXX</tt></a></dt>
- <dd>Specifies the path to the C++ compiler.</dd>
- <dt><a name="CXXFLAGS"><tt>CXXFLAGS</tt></a></dt>
- <dd>Additional flags to be passed to the C++ compiler.</dd>
- <dt><a name="DATE"><tt>DATE<small>(configured)</small></tt></a></dt>
- <dd>Specifies the path to the <tt>date</tt> program or any program that can
- generate the current date and time on its standard output</dd>
- <dt><a name="DOT"><tt>DOT</tt></a><small>(configured)</small></dt>
- <dd>Specifies the path to the <tt>dot</tt> tool or <tt>false</tt> if there
- isn't one.</dd>
- <dt><a name="ECHO"><tt>ECHO</tt></a><small>(configured)</small></dt>
- <dd>Specifies the path to the <tt>echo</tt> tool for printing output.</dd>
- <dt><a name="EXEEXT"><tt>EXEEXT</tt></a><small>(configured)</small></dt>
- <dd>Provides the extension to be used on executables built by the makefiles.
- The value may be empty on platforms that do not use file extensions for
- executables (e.g. Unix).</dd>
- <dt><a name="FLEX"><tt>FLEX</tt></a><small>(configured)</small></dt>
- <dd>Specifies the path to the <tt>flex</tt> tool.</dd>
- <dt><a name="INSTALL"><tt>INSTALL</tt></a><small>(configured)</small></dt>
- <dd>Specifies the path to the <tt>install</tt> tool.</dd>
- <dt><a name="LDFLAGS"><tt>LDFLAGS</tt></a><small>(configured)</small></dt>
- <dd>Allows users to specify additional flags to pass to the linker.</dd>
- <dt><a name="LIBS"><tt>LIBS</tt></a><small>(configured)</small></dt>
- <dd>The list of libraries that should be linked with each tool.</dd>
- <dt><a name="LIBTOOL"><tt>LIBTOOL</tt></a><small>(configured)</small></dt>
- <dd>Specifies the path to the <tt>libtool</tt> tool. This tool is renamed
- <tt>mklib</tt> by the <tt>configure</tt> script and always located in the
- <dt><a name="LLVMAS"><tt>LLVMAS</tt></a><small>(defaulted)</small></dt>
- <dd>Specifies the path to the <tt>llvm-as</tt> tool.</dd>
- <dt><a name="LLVMGCC"><tt>LLVMGCC</tt></a><small>(defaulted)</small></dt>
- <dd>Specifies the path to the LLVM version of the GCC 'C' Compiler</dd>
- <dt><a name="LLVMGXX"><tt>LLVMGXX</tt></a><small>(defaulted)</small></dt>
- <dd>Specifies the path to the LLVM version of the GCC C++ Compiler</dd>
- <dt><a name="LLVMLD"><tt>LLVMLD</tt></a><small>(defaulted)</small></dt>
- <dd>Specifies the path to the LLVM bitcode linker tool</dd>
- <dt><a name="LLVM_OBJ_ROOT"><tt>LLVM_OBJ_ROOT</tt></a><small>(configured)
- </small></dt>
- <dd>Specifies the top directory into which the output of the build is
- placed.</dd>
- <dt><a name="LLVM_SRC_ROOT"><tt>LLVM_SRC_ROOT</tt></a><small>(configured)
- </small></dt>
- <dd>Specifies the top directory in which the sources are found.</dd>
- <dt><a name="LLVM_TARBALL_NAME"><tt>LLVM_TARBALL_NAME</tt></a>
- <small>(configured)</small></dt>
- <dd>Specifies the name of the distribution tarball to create. This is
- configured from the name of the project and its version number.</dd>
- <dt><a name="MKDIR"><tt>MKDIR</tt></a><small>(defaulted)</small></dt>
- <dd>Specifies the path to the <tt>mkdir</tt> tool that creates
- directories.</dd>
- <dt><a name="PLATFORMSTRIPOPTS"><tt>PLATFORMSTRIPOPTS</tt></a></dt>
- <dd>The options to provide to the linker to specify that a stripped (no
- symbols) executable should be built.</dd>
- <dt><a name="RANLIB"><tt>RANLIB</tt></a><small>(defaulted)</small></dt>
- <dd>Specifies the path to the <tt>ranlib</tt> tool.</dd>
- <dt><a name="RM"><tt>RM</tt></a><small>(defaulted)</small></dt>
- <dd>Specifies the path to the <tt>rm</tt> tool.</dd>
- <dt><a name="SED"><tt>SED</tt></a><small>(defaulted)</small></dt>
- <dd>Specifies the path to the <tt>sed</tt> tool.</dd>
- <dt><a name="SHLIBEXT"><tt>SHLIBEXT</tt></a><small>(configured)</small></dt>
- <dd>Provides the filename extension to use for shared libraries.</dd>
- <dt><a name="TBLGEN"><tt>TBLGEN</tt></a><small>(defaulted)</small></dt>
- <dd>Specifies the path to the <tt>tblgen</tt> tool.</dd>
- <dt><a name="TAR"><tt>TAR</tt></a><small>(defaulted)</small></dt>
- <dd>Specifies the path to the <tt>tar</tt> tool.</dd>
- <dt><a name="ZIP"><tt>ZIP</tt></a><small>(defaulted)</small></dt>
- <dd>Specifies the path to the <tt>zip</tt> tool.</dd>
- </dl>
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection"><a name="getvars">Readable Variables</a></div>
-<div class="doc_text">
- <p>Variables listed in the table below can be used by the user's Makefile but
- should not be changed. Changing the value will generally cause the build to go
- wrong, so don't do it.</p>
- <dl>
- <dt><a name="bindir"><tt>bindir</tt></a></dt>
- <dd>The directory into which executables will ultimately be installed. This
- value is derived from the <tt>--prefix</tt> option given to
- <tt>configure</tt>.</dd>
- <dt><a name="BuildMode"><tt>BuildMode</tt></a></dt>
- <dd>The name of the type of build being performed: Debug, Release, or
- Profile</dd>
- <dt><a name="bitcode_libdir"><tt>bytecode_libdir</tt></a></dt>
- <dd>The directory into which bitcode libraries will ultimately be
- installed. This value is derived from the <tt>--prefix</tt> option given to
- <tt>configure</tt>.</dd>
- <dt><a name="ConfigureScriptFLAGS"><tt>ConfigureScriptFLAGS</tt></a></dt>
- <dd>Additional flags given to the <tt>configure</tt> script when
- reconfiguring.</dd>
- <dt><a name="DistDir"><tt>DistDir</tt></a></dt>
- <dd>The <em>current</em> directory for which a distribution copy is being
- made.</dd>
- <dt><a name="Echo"><tt>Echo</tt></a></dt>
- <dd>The LLVM Makefile System output command. This provides the
- <tt>llvm[n]</tt> prefix and starts with @ so the command itself is not
- printed by <tt>make</tt>.</dd>
- <dt><a name="EchoCmd"><tt>EchoCmd</tt></a></dt>
- <dd> Same as <a href="#Echo"><tt>Echo</tt></a> but without the leading @.
- </dd>
- <dt><a name="includedir"><tt>includedir</tt></a></dt>
- <dd>The directory into which include files will ultimately be installed.
- This value is derived from the <tt>--prefix</tt> option given to
- <tt>configure</tt>.</dd>
- <dt><a name="libdir"><tt>libdir</tt></a></dt><dd></dd>
- <dd>The directory into which native libraries will ultimately be installed.
- This value is derived from the <tt>--prefix</tt> option given to
- <tt>configure</tt>.</dd>
- <dt><a name="LibDir"><tt>LibDir</tt></a></dt>
- <dd>The configuration specific directory into which libraries are placed
- before installation.</dd>
- <dt><a name="MakefileConfig"><tt>MakefileConfig</tt></a></dt>
- <dd>Full path of the <tt>Makefile.config</tt> file.</dd>
- <dt><a name="MakefileConfigIn"><tt>MakefileConfigIn</tt></a></dt>
- <dd>Full path of the <tt>Makefile.config.in</tt> file.</dd>
- <dt><a name="ObjDir"><tt>ObjDir</tt></a></dt>
- <dd>The configuration and directory specific directory where build objects
- (compilation results) are placed.</dd>
- <dt><a name="SubDirs"><tt>SubDirs</tt></a></dt>
- <dd>The complete list of sub-directories of the current directory as
- specified by other variables.</dd>
- <dt><a name="Sources"><tt>Sources</tt></a></dt>
- <dd>The complete list of source files.</dd>
- <dt><a name="sysconfdir"><tt>sysconfdir</tt></a></dt>
- <dd>The directory into which configuration files will ultimately be
- installed. This value is derived from the <tt>--prefix</tt> option given to
- <tt>configure</tt>.</dd>
- <dt><a name="ToolDir"><tt>ToolDir</tt></a></dt>
- <dd>The configuration specific directory into which executables are placed
- before they are installed.</dd>
- <dt><a name="TopDistDir"><tt>TopDistDir</tt></a></dt>
- <dd>The top most directory into which the distribution files are copied.
- </dd>
- <dt><a name="Verb"><tt>Verb</tt></a></dt>
- <dd>Use this as the first thing on your build script lines to enable or
- disable verbose mode. It expands to either an @ (quiet mode) or nothing
- (verbose mode). </dd>
- </dl>
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection"><a name="intvars">Internal Variables</a></div>
-<div class="doc_text">
- <p>Variables listed below are used by the LLVM Makefile System
- and considered internal. You should not use these variables under any
- circumstances.</p>
- <p><tt>
- Archive
- AR.Flags
- BaseNameSources
- BCCompile.C
- BCCompile.CXX
- BCLinkLib
- C.Flags
- Compile.C
- CompileCommonOpts
- Compile.CXX
- ConfigStatusScript
- ConfigureScript
- CPP.Flags
- CPP.Flags
- CXX.Flags
- DependFiles
- DestArchiveLib
- DestBitcodeLib
- DestModule
- DestRelinkedLib
- DestSharedLib
- DestTool
- DistAlways
- DistCheckDir
- DistCheckTop
- DistFiles
- DistName
- DistOther
- DistSources
- DistSubDirs
- DistTarBZ2
- DistTarGZip
- DistZip
- ExtraLibs
- FakeSources
- INCFiles
- InternalTargets
- LD.Flags
- LexFiles
- LexOutput
- LibName.A
- LibName.BC
- LibName.LA
- LibName.O
- LibTool.Flags
- Link
- LinkModule
- LLVMLibDir
- LLVMLibsOptions
- LLVMLibsPaths
- LLVMToolDir
- LLVMUsedLibs
- LocalTargets
- LTCompile.C
- LTCompile.CXX
- LTInstall
- Module
- ObjectsBC
- ObjectsLO
- ObjectsO
- ObjMakefiles
- ParallelTargets
- PreConditions
- ProjLibsOptions
- ProjLibsPaths
- ProjUsedLibs
- Ranlib
- RecursiveTargets
- Relink
- SrcMakefiles
- Strip
- StripWarnMsg
- TableGen
- TDFiles
- ToolBuildPath
- TopLevelTargets
- UserTargets
- YaccFiles
- YaccOutput
- </tt></p>
-</div>
-
-<!-- *********************************************************************** -->
-<hr>
-<address>
- <a href="http://jigsaw.w3.org/css-validator/check/referer"><img
- src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"></a>
- <a href="http://validator.w3.org/check/referer"><img
- src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!" /></a>
-
- <a href="mailto:rspencer@x10sys.com">Reid Spencer</a><br>
- <a href="http://llvm.org">The LLVM Compiler Infrastructure</a><br>
- Last modified: $Date$
-</address>
-</body>
-</html>
diff --git a/release_23/docs/Passes.html b/release_23/docs/Passes.html
deleted file mode 100644
index 21b03f539978..000000000000
--- a/release_23/docs/Passes.html
+++ /dev/null
@@ -1,1952 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
- "http://www.w3.org/TR/html4/strict.dtd">
-<html>
-<head>
- <title>LLVM's Analysis and Transform Passes</title>
- <link rel="stylesheet" href="llvm.css" type="text/css">
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
-</head>
-<body>
-
-<!--
-
-If Passes.html is up to date, the following "one-liner" should print
-an empty diff.
-
-egrep -e '^<tr><td><a href="#.*">-.*</a></td><td>.*</td></tr>$' \
- -e '^ <a name=".*">.*</a>$' < Passes.html >html; \
-perl >help <<'EOT' && diff -u help html; rm -f help html
-open HTML, "<Passes.html" or die "open: Passes.html: $!\n";
-while (<HTML>) {
- m:^<tr><td><a href="#(.*)">-.*</a></td><td>.*</td></tr>$: or next;
- $order{$1} = sprintf("%03d", 1 + int %order);
-}
-open HELP, "../Release/bin/opt -help|" or die "open: opt -help: $!\n";
-while (<HELP>) {
- m:^ -([^ ]+) +- (.*)$: or next;
- my $o = $order{$1};
- $o = "000" unless defined $o;
- push @x, "$o<tr><td><a href=\"#$1\">-$1</a></td><td>$2</td></tr>\n";
- push @y, "$o <a name=\"$1\">$2</a>\n";
-}
-@x = map { s/^\d\d\d//; $_ } sort @x;
-@y = map { s/^\d\d\d//; $_ } sort @y;
-print @x, @y;
-EOT
-
-This (real) one-liner can also be helpful when converting comments to HTML:
-
-perl -e '$/ = undef; for (split(/\n/, <>)) { s:^ *///? ?::; print " <p>\n" if !$on && $_ =~ /\S/; print " </p>\n" if $on && $_ =~ /^\s*$/; print " $_\n"; $on = ($_ =~ /\S/); } print " </p>\n" if $on'
-
- -->
-
-<div class="doc_title">LLVM's Analysis and Transform Passes</div>
-
-<ol>
- <li><a href="#intro">Introduction</a></li>
- <li><a href="#analyses">Analysis Passes</a>
- <li><a href="#transforms">Transform Passes</a></li>
- <li><a href="#utilities">Utility Passes</a></li>
-</ol>
-
-<div class="doc_author">
- <p>Written by <a href="mailto:rspencer@x10sys.com">Reid Spencer</a>
- and Gordon Henriksen</p>
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_section"> <a name="intro">Introduction</a> </div>
-<div class="doc_text">
- <p>This document serves as a high level summary of the optimization features
- that LLVM provides. Optimizations are implemented as Passes that traverse some
- portion of a program to either collect information or transform the program.
- The table below divides the passes that LLVM provides into three categories.
- Analysis passes compute information that other passes can use or for debugging
- or program visualization purposes. Transform passes can use (or invalidate)
- the analysis passes. Transform passes all mutate the program in some way.
- Utility passes provides some utility but don't otherwise fit categorization.
- For example passes to extract functions to bitcode or write a module to
- bitcode are neither analysis nor transform passes.
- <p>The table below provides a quick summary of each pass and links to the more
- complete pass description later in the document.</p>
-</div>
-<div class="doc_text" >
-<table>
-<tr><th colspan="2"><b>ANALYSIS PASSES</b></th></tr>
-<tr><th>Option</th><th>Name</th></tr>
-<tr><td><a href="#aa-eval">-aa-eval</a></td><td>Exhaustive Alias Analysis Precision Evaluator</td></tr>
-<tr><td><a href="#anders-aa">-anders-aa</a></td><td>Andersen's Interprocedural Alias Analysis</td></tr>
-<tr><td><a href="#basicaa">-basicaa</a></td><td>Basic Alias Analysis (default AA impl)</td></tr>
-<tr><td><a href="#basiccg">-basiccg</a></td><td>Basic CallGraph Construction</td></tr>
-<tr><td><a href="#basicvn">-basicvn</a></td><td>Basic Value Numbering (default GVN impl)</td></tr>
-<tr><td><a href="#callgraph">-callgraph</a></td><td>Print a call graph</td></tr>
-<tr><td><a href="#callscc">-callscc</a></td><td>Print SCCs of the Call Graph</td></tr>
-<tr><td><a href="#cfgscc">-cfgscc</a></td><td>Print SCCs of each function CFG</td></tr>
-<tr><td><a href="#codegenprepare">-codegenprepare</a></td><td>Optimize for code generation</td></tr>
-<tr><td><a href="#count-aa">-count-aa</a></td><td>Count Alias Analysis Query Responses</td></tr>
-<tr><td><a href="#debug-aa">-debug-aa</a></td><td>AA use debugger</td></tr>
-<tr><td><a href="#domfrontier">-domfrontier</a></td><td>Dominance Frontier Construction</td></tr>
-<tr><td><a href="#domtree">-domtree</a></td><td>Dominator Tree Construction</td></tr>
-<tr><td><a href="#externalfnconstants">-externalfnconstants</a></td><td>Print external fn callsites passed constants</td></tr>
-<tr><td><a href="#globalsmodref-aa">-globalsmodref-aa</a></td><td>Simple mod/ref analysis for globals</td></tr>
-<tr><td><a href="#instcount">-instcount</a></td><td>Counts the various types of Instructions</td></tr>
-<tr><td><a href="#intervals">-intervals</a></td><td>Interval Partition Construction</td></tr>
-<tr><td><a href="#load-vn">-load-vn</a></td><td>Load Value Numbering</td></tr>
-<tr><td><a href="#loops">-loops</a></td><td>Natural Loop Construction</td></tr>
-<tr><td><a href="#memdep">-memdep</a></td><td>Memory Dependence Analysis</td></tr>
-<tr><td><a href="#no-aa">-no-aa</a></td><td>No Alias Analysis (always returns 'may' alias)</td></tr>
-<tr><td><a href="#no-profile">-no-profile</a></td><td>No Profile Information</td></tr>
-<tr><td><a href="#postdomfrontier">-postdomfrontier</a></td><td>Post-Dominance Frontier Construction</td></tr>
-<tr><td><a href="#postdomtree">-postdomtree</a></td><td>Post-Dominator Tree Construction</td></tr>
-<tr><td><a href="#print">-print</a></td><td>Print function to stderr</td></tr>
-<tr><td><a href="#print-alias-sets">-print-alias-sets</a></td><td>Alias Set Printer</td></tr>
-<tr><td><a href="#print-callgraph">-print-callgraph</a></td><td>Print Call Graph to 'dot' file</td></tr>
-<tr><td><a href="#print-cfg">-print-cfg</a></td><td>Print CFG of function to 'dot' file</td></tr>
-<tr><td><a href="#print-cfg-only">-print-cfg-only</a></td><td>Print CFG of function to 'dot' file (with no function bodies)</td></tr>
-<tr><td><a href="#printm">-printm</a></td><td>Print module to stderr</td></tr>
-<tr><td><a href="#printusedtypes">-printusedtypes</a></td><td>Find Used Types</td></tr>
-<tr><td><a href="#profile-loader">-profile-loader</a></td><td>Load profile information from llvmprof.out</td></tr>
-<tr><td><a href="#scalar-evolution">-scalar-evolution</a></td><td>Scalar Evolution Analysis</td></tr>
-<tr><td><a href="#targetdata">-targetdata</a></td><td>Target Data Layout</td></tr>
-
-
-<tr><th colspan="2"><b>TRANSFORM PASSES</b></th></tr>
-<tr><th>Option</th><th>Name</th></tr>
-<tr><td><a href="#adce">-adce</a></td><td>Aggressive Dead Code Elimination</td></tr>
-<tr><td><a href="#argpromotion">-argpromotion</a></td><td>Promote 'by reference' arguments to scalars</td></tr>
-<tr><td><a href="#block-placement">-block-placement</a></td><td>Profile Guided Basic Block Placement</td></tr>
-<tr><td><a href="#break-crit-edges">-break-crit-edges</a></td><td>Break critical edges in CFG</td></tr>
-<tr><td><a href="#codegenprepare">-codegenprepare</a></td><td>Prepare a function for code generation </td></tr>
-<tr><td><a href="#condprop">-condprop</a></td><td>Conditional Propagation</td></tr>
-<tr><td><a href="#constmerge">-constmerge</a></td><td>Merge Duplicate Global Constants</td></tr>
-<tr><td><a href="#constprop">-constprop</a></td><td>Simple constant propagation</td></tr>
-<tr><td><a href="#dce">-dce</a></td><td>Dead Code Elimination</td></tr>
-<tr><td><a href="#deadargelim">-deadargelim</a></td><td>Dead Argument Elimination</td></tr>
-<tr><td><a href="#deadtypeelim">-deadtypeelim</a></td><td>Dead Type Elimination</td></tr>
-<tr><td><a href="#die">-die</a></td><td>Dead Instruction Elimination</td></tr>
-<tr><td><a href="#dse">-dse</a></td><td>Dead Store Elimination</td></tr>
-<tr><td><a href="#gcse">-gcse</a></td><td>Global Common Subexpression Elimination</td></tr>
-<tr><td><a href="#globaldce">-globaldce</a></td><td>Dead Global Elimination</td></tr>
-<tr><td><a href="#globalopt">-globalopt</a></td><td>Global Variable Optimizer</td></tr>
-<tr><td><a href="#gvn">-gvn</a></td><td>Global Value Numbering</td></tr>
-<tr><td><a href="#gvnpre">-gvnpre</a></td><td>Global Value Numbering/Partial Redundancy Elimination</td></tr>
-<tr><td><a href="#indmemrem">-indmemrem</a></td><td>Indirect Malloc and Free Removal</td></tr>
-<tr><td><a href="#indvars">-indvars</a></td><td>Canonicalize Induction Variables</td></tr>
-<tr><td><a href="#inline">-inline</a></td><td>Function Integration/Inlining</td></tr>
-<tr><td><a href="#insert-block-profiling">-insert-block-profiling</a></td><td>Insert instrumentation for block profiling</td></tr>
-<tr><td><a href="#insert-edge-profiling">-insert-edge-profiling</a></td><td>Insert instrumentation for edge profiling</td></tr>
-<tr><td><a href="#insert-function-profiling">-insert-function-profiling</a></td><td>Insert instrumentation for function profiling</td></tr>
-<tr><td><a href="#insert-null-profiling-rs">-insert-null-profiling-rs</a></td><td>Measure profiling framework overhead</td></tr>
-<tr><td><a href="#insert-rs-profiling-framework">-insert-rs-profiling-framework</a></td><td>Insert random sampling instrumentation framework</td></tr>
-<tr><td><a href="#instcombine">-instcombine</a></td><td>Combine redundant instructions</td></tr>
-<tr><td><a href="#internalize">-internalize</a></td><td>Internalize Global Symbols</td></tr>
-<tr><td><a href="#ipconstprop">-ipconstprop</a></td><td>Interprocedural constant propagation</td></tr>
-<tr><td><a href="#ipsccp">-ipsccp</a></td><td>Interprocedural Sparse Conditional Constant Propagation</td></tr>
-<tr><td><a href="#jump-threading">-jump-threading</a></td><td>Thread control through conditional blocks </td></tr>
-<tr><td><a href="#lcssa">-lcssa</a></td><td>Loop-Closed SSA Form Pass</td></tr>
-<tr><td><a href="#licm">-licm</a></td><td>Loop Invariant Code Motion</td></tr>
-<tr><td><a href="#loop-deletion">-loop-deletion</a></td><td>Dead Loop Deletion Pass </td></tr>
-<tr><td><a href="#loop-extract">-loop-extract</a></td><td>Extract loops into new functions</td></tr>
-<tr><td><a href="#loop-extract-single">-loop-extract-single</a></td><td>Extract at most one loop into a new function</td></tr>
-<tr><td><a href="#loop-index-split">-loop-index-split</a></td><td>Index Split Loops</td></tr>
-<tr><td><a href="#loop-reduce">-loop-reduce</a></td><td>Loop Strength Reduction</td></tr>
-<tr><td><a href="#loop-rotate">-loop-rotate</a></td><td>Rotate Loops</td></tr>
-<tr><td><a href="#loop-unroll">-loop-unroll</a></td><td>Unroll loops</td></tr>
-<tr><td><a href="#loop-unswitch">-loop-unswitch</a></td><td>Unswitch loops</td></tr>
-<tr><td><a href="#loopsimplify">-loopsimplify</a></td><td>Canonicalize natural loops</td></tr>
-<tr><td><a href="#lowerallocs">-lowerallocs</a></td><td>Lower allocations from instructions to calls</td></tr>
-<tr><td><a href="#lowerinvoke">-lowerinvoke</a></td><td>Lower invoke and unwind, for unwindless code generators</td></tr>
-<tr><td><a href="#lowersetjmp">-lowersetjmp</a></td><td>Lower Set Jump</td></tr>
-<tr><td><a href="#lowerswitch">-lowerswitch</a></td><td>Lower SwitchInst's to branches</td></tr>
-<tr><td><a href="#mem2reg">-mem2reg</a></td><td>Promote Memory to Register</td></tr>
-<tr><td><a href="#memcpyopt">-memcpyopt</a></td><td>Optimize use of memcpy and friends</td></tr>
-<tr><td><a href="#mergereturn">-mergereturn</a></td><td>Unify function exit nodes</td></tr>
-<tr><td><a href="#predsimplify">-predsimplify</a></td><td>Predicate Simplifier</td></tr>
-<tr><td><a href="#prune-eh">-prune-eh</a></td><td>Remove unused exception handling info</td></tr>
-<tr><td><a href="#raiseallocs">-raiseallocs</a></td><td>Raise allocations from calls to instructions</td></tr>
-<tr><td><a href="#reassociate">-reassociate</a></td><td>Reassociate expressions</td></tr>
-<tr><td><a href="#reg2mem">-reg2mem</a></td><td>Demote all values to stack slots</td></tr>
-<tr><td><a href="#scalarrepl">-scalarrepl</a></td><td>Scalar Replacement of Aggregates</td></tr>
-<tr><td><a href="#sccp">-sccp</a></td><td>Sparse Conditional Constant Propagation</td></tr>
-<tr><td><a href="#simplify-libcalls">-simplify-libcalls</a></td><td>Simplify well-known library calls</td></tr>
-<tr><td><a href="#simplifycfg">-simplifycfg</a></td><td>Simplify the CFG</td></tr>
-<tr><td><a href="#strip">-strip</a></td><td>Strip all symbols from a module</td></tr>
-<tr><td><a href="#strip-dead-prototypes">-strip-dead-prototypes</a></td><td>Remove unused function declarations</td></tr>
-<tr><td><a href="#sretpromotion">-sretpromotion</a></td><td>Promote sret arguments</td></tr>
-<tr><td><a href="#tailcallelim">-tailcallelim</a></td><td>Tail Call Elimination</td></tr>
-<tr><td><a href="#tailduplicate">-tailduplicate</a></td><td>Tail Duplication</td></tr>
-
-
-<tr><th colspan="2"><b>UTILITY PASSES</b></th></tr>
-<tr><th>Option</th><th>Name</th></tr>
-<tr><td><a href="#deadarghaX0r">-deadarghaX0r</a></td><td>Dead Argument Hacking (BUGPOINT USE ONLY; DO NOT USE)</td></tr>
-<tr><td><a href="#extract-blocks">-extract-blocks</a></td><td>Extract Basic Blocks From Module (for bugpoint use)</td></tr>
-<tr><td><a href="#preverify">-preverify</a></td><td>Preliminary module verification</td></tr>
-<tr><td><a href="#verify">-verify</a></td><td>Module Verifier</td></tr>
-<tr><td><a href="#view-cfg">-view-cfg</a></td><td>View CFG of function</td></tr>
-<tr><td><a href="#view-cfg-only">-view-cfg-only</a></td><td>View CFG of function (with no function bodies)</td></tr>
-</table>
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_section"> <a name="example">Analysis Passes</a></div>
-<div class="doc_text">
- <p>This section describes the LLVM Analysis Passes.</p>
-</div>
-
-<!-------------------------------------------------------------------------- -->
-<div class="doc_subsection">
- <a name="aa-eval">Exhaustive Alias Analysis Precision Evaluator</a>
-</div>
-<div class="doc_text">
- <p>This is a simple N^2 alias analysis accuracy evaluator.
- Basically, for each function in the program, it simply queries to see how the
- alias analysis implementation answers alias queries between each pair of
- pointers in the function.</p>
-
- <p>This is inspired and adapted from code by: Naveen Neelakantam, Francesco
- Spadini, and Wojciech Stryjewski.</p>
-</div>
-
-<!-------------------------------------------------------------------------- -->
-<div class="doc_subsection">
- <a name="anders-aa">Andersen's Interprocedural Alias Analysis</a>
-</div>
-<div class="doc_text">
- <p>
- This is an implementation of Andersen's interprocedural alias
- analysis
- </p>
-
- <p>
- In pointer analysis terms, this is a subset-based, flow-insensitive,
- field-sensitive, and context-insensitive algorithm pointer algorithm.
- </p>
-
- <p>
- This algorithm is implemented as three stages:
- </p>
-
- <ol>
- <li>Object identification.</li>
- <li>Inclusion constraint identification.</li>
- <li>Offline constraint graph optimization.</li>
- <li>Inclusion constraint solving.</li>
- </ol>
-
- <p>
- The object identification stage identifies all of the memory objects in the
- program, which includes globals, heap allocated objects, and stack allocated
- objects.
- </p>
-
- <p>
- The inclusion constraint identification stage finds all inclusion constraints
- in the program by scanning the program, looking for pointer assignments and
- other statements that effect the points-to graph. For a statement like
- <code><var>A</var> = <var>B</var></code>, this statement is processed to
- indicate that <var>A</var> can point to anything that <var>B</var> can point
- to. Constraints can handle copies, loads, and stores, and address taking.
- </p>
-
- <p>
- The offline constraint graph optimization portion includes offline variable
- substitution algorithms intended to computer pointer and location
- equivalences. Pointer equivalences are those pointers that will have the
- same points-to sets, and location equivalences are those variables that
- always appear together in points-to sets.
- </p>
-
- <p>
- The inclusion constraint solving phase iteratively propagates the inclusion
- constraints until a fixed point is reached. This is an O(<var>n</var>³)
- algorithm.
- </p>
-
- <p>
- Function constraints are handled as if they were structs with <var>X</var>
- fields. Thus, an access to argument <var>X</var> of function <var>Y</var> is
- an access to node index <code>getNode(<var>Y</var>) + <var>X</var></code>.
- This representation allows handling of indirect calls without any issues. To
- wit, an indirect call <code><var>Y</var>(<var>a</var>,<var>b</var>)</code> is
- equivalent to <code>*(<var>Y</var> + 1) = <var>a</var>, *(<var>Y</var> + 2) =
- <var>b</var></code>. The return node for a function <var>F</var> is always
- located at <code>getNode(<var>F</var>) + CallReturnPos</code>. The arguments
- start at <code>getNode(<var>F</var>) + CallArgPos</code>.
- </p>
-</div>
-
-<!-------------------------------------------------------------------------- -->
-<div class="doc_subsection">
- <a name="basicaa">Basic Alias Analysis (default AA impl)</a>
-</div>
-<div class="doc_text">
- <p>
- This is the default implementation of the Alias Analysis interface
- that simply implements a few identities (two different globals cannot alias,
- etc), but otherwise does no analysis.
- </p>
-</div>
-
-<!-------------------------------------------------------------------------- -->
-<div class="doc_subsection">
- <a name="basiccg">Basic CallGraph Construction</a>
-</div>
-<div class="doc_text">
- <p>Yet to be written.</p>
-</div>
-
-<!-------------------------------------------------------------------------- -->
-<div class="doc_subsection">
- <a name="basicvn">Basic Value Numbering (default GVN impl)</a>
-</div>
-<div class="doc_text">
- <p>
- This is the default implementation of the <code>ValueNumbering</code>
- interface. It walks the SSA def-use chains to trivially identify
- lexically identical expressions. This does not require any ahead of time
- analysis, so it is a very fast default implementation.
- </p>
-</div>
-
-<!-------------------------------------------------------------------------- -->
-<div class="doc_subsection">
- <a name="callgraph">Print a call graph</a>
-</div>
-<div class="doc_text">
- <p>
- This pass, only available in <code>opt</code>, prints the call graph to
- standard output in a human-readable form.
- </p>
-</div>
-
-<!-------------------------------------------------------------------------- -->
-<div class="doc_subsection">
- <a name="callscc">Print SCCs of the Call Graph</a>
-</div>
-<div class="doc_text">
- <p>
- This pass, only available in <code>opt</code>, prints the SCCs of the call
- graph to standard output in a human-readable form.
- </p>
-</div>
-
-<!-------------------------------------------------------------------------- -->
-<div class="doc_subsection">
- <a name="cfgscc">Print SCCs of each function CFG</a>
-</div>
-<div class="doc_text">
- <p>
- This pass, only available in <code>opt</code>, prints the SCCs of each
- function CFG to standard output in a human-readable form.
- </p>
-</div>
-
-<!-------------------------------------------------------------------------- -->
-<div class="doc_subsection">
- <a name="codegenprepare">Optimize for code generation</a>
-</div>
-<div class="doc_text">
- <p>
- This pass munges the code in the input function to better prepare it for
- SelectionDAG-based code generation. This works around limitations in it's
- basic-block-at-a-time approach. It should eventually be removed.
- </p>
-</div>
-
-<!-------------------------------------------------------------------------- -->
-<div class="doc_subsection">
- <a name="count-aa">Count Alias Analysis Query Responses</a>
-</div>
-<div class="doc_text">
- <p>
- A pass which can be used to count how many alias queries
- are being made and how the alias analysis implementation being used responds.
- </p>
-</div>
-
-<!-------------------------------------------------------------------------- -->
-<div class="doc_subsection">
- <a name="debug-aa">AA use debugger</a>
-</div>
-<div class="doc_text">
- <p>
- This simple pass checks alias analysis users to ensure that if they
- create a new value, they do not query AA without informing it of the value.
- It acts as a shim over any other AA pass you want.
- </p>
-
- <p>
- Yes keeping track of every value in the program is expensive, but this is
- a debugging pass.
- </p>
-</div>
-
-<!-------------------------------------------------------------------------- -->
-<div class="doc_subsection">
- <a name="domfrontier">Dominance Frontier Construction</a>
-</div>
-<div class="doc_text">
- <p>
- This pass is a simple dominator construction algorithm for finding forward
- dominator frontiers.
- </p>
-</div>
-
-<!-------------------------------------------------------------------------- -->
-<div class="doc_subsection">
- <a name="domtree">Dominator Tree Construction</a>
-</div>
-<div class="doc_text">
- <p>
- This pass is a simple dominator construction algorithm for finding forward
- dominators.
- </p>
-</div>
-
-<!-------------------------------------------------------------------------- -->
-<div class="doc_subsection">
- <a name="externalfnconstants">Print external fn callsites passed constants</a>
-</div>
-<div class="doc_text">
- <p>
- This pass, only available in <code>opt</code>, prints out call sites to
- external functions that are called with constant arguments. This can be
- useful when looking for standard library functions we should constant fold
- or handle in alias analyses.
- </p>
-</div>
-
-<!-------------------------------------------------------------------------- -->
-<div class="doc_subsection">
- <a name="globalsmodref-aa">Simple mod/ref analysis for globals</a>
-</div>
-<div class="doc_text">
- <p>
- This simple pass provides alias and mod/ref information for global values
- that do not have their address taken, and keeps track of whether functions
- read or write memory (are "pure"). For this simple (but very common) case,
- we can provide pretty accurate and useful information.
- </p>
-</div>
-
-<!-------------------------------------------------------------------------- -->
-<div class="doc_subsection">
- <a name="instcount">Counts the various types of Instructions</a>
-</div>
-<div class="doc_text">
- <p>
- This pass collects the count of all instructions and reports them
- </p>
-</div>
-
-<!-------------------------------------------------------------------------- -->
-<div class="doc_subsection">
- <a name="intervals">Interval Partition Construction</a>
-</div>
-<div class="doc_text">
- <p>
- This analysis calculates and represents the interval partition of a function,
- or a preexisting interval partition.
- </p>
-
- <p>
- In this way, the interval partition may be used to reduce a flow graph down
- to its degenerate single node interval partition (unless it is irreducible).
- </p>
-</div>
-
-<!-------------------------------------------------------------------------- -->
-<div class="doc_subsection">
- <a name="load-vn">Load Value Numbering</a>
-</div>
-<div class="doc_text">
- <p>
- This pass value numbers load and call instructions. To do this, it finds
- lexically identical load instructions, and uses alias analysis to determine
- which loads are guaranteed to produce the same value. To value number call
- instructions, it looks for calls to functions that do not write to memory
- which do not have intervening instructions that clobber the memory that is
- read from.
- </p>
-
- <p>
- This pass builds off of another value numbering pass to implement value
- numbering for non-load and non-call instructions. It uses Alias Analysis so
- that it can disambiguate the load instructions. The more powerful these base
- analyses are, the more powerful the resultant value numbering will be.
- </p>
-</div>
-
-<!-------------------------------------------------------------------------- -->
-<div class="doc_subsection">
- <a name="loops">Natural Loop Construction</a>
-</div>
-<div class="doc_text">
- <p>
- This analysis is used to identify natural loops and determine the loop depth
- of various nodes of the CFG. Note that the loops identified may actually be
- several natural loops that share the same header node... not just a single
- natural loop.
- </p>
-</div>
-
-<!-------------------------------------------------------------------------- -->
-<div class="doc_subsection">
- <a name="memdep">Memory Dependence Analysis</a>
-</div>
-<div class="doc_text">
- <p>
- An analysis that determines, for a given memory operation, what preceding
- memory operations it depends on. It builds on alias analysis information, and
- tries to provide a lazy, caching interface to a common kind of alias
- information query.
- </p>
-</div>
-
-<!-------------------------------------------------------------------------- -->
-<div class="doc_subsection">
- <a name="no-aa">No Alias Analysis (always returns 'may' alias)</a>
-</div>
-<div class="doc_text">
- <p>
- Always returns "I don't know" for alias queries. NoAA is unlike other alias
- analysis implementations, in that it does not chain to a previous analysis. As
- such it doesn't follow many of the rules that other alias analyses must.
- </p>
-</div>
-
-<!-------------------------------------------------------------------------- -->
-<div class="doc_subsection">
- <a name="no-profile">No Profile Information</a>
-</div>
-<div class="doc_text">
- <p>
- The default "no profile" implementation of the abstract
- <code>ProfileInfo</code> interface.
- </p>
-</div>
-
-<!-------------------------------------------------------------------------- -->
-<div class="doc_subsection">
- <a name="postdomfrontier">Post-Dominance Frontier Construction</a>
-</div>
-<div class="doc_text">
- <p>
- This pass is a simple post-dominator construction algorithm for finding
- post-dominator frontiers.
- </p>
-</div>
-
-<!-------------------------------------------------------------------------- -->
-<div class="doc_subsection">
- <a name="postdomtree">Post-Dominator Tree Construction</a>
-</div>
-<div class="doc_text">
- <p>
- This pass is a simple post-dominator construction algorithm for finding
- post-dominators.
- </p>
-</div>
-
-<!-------------------------------------------------------------------------- -->
-<div class="doc_subsection">
- <a name="print">Print function to stderr</a>
-</div>
-<div class="doc_text">
- <p>
- The <code>PrintFunctionPass</code> class is designed to be pipelined with
- other <code>FunctionPass</code>es, and prints out the functions of the module
- as they are processed.
- </p>
-</div>
-
-<!-------------------------------------------------------------------------- -->
-<div class="doc_subsection">
- <a name="print-alias-sets">Alias Set Printer</a>
-</div>
-<div class="doc_text">
- <p>Yet to be written.</p>
-</div>
-
-<!-------------------------------------------------------------------------- -->
-<div class="doc_subsection">
- <a name="print-callgraph">Print Call Graph to 'dot' file</a>
-</div>
-<div class="doc_text">
- <p>
- This pass, only available in <code>opt</code>, prints the call graph into a
- <code>.dot</code> graph. This graph can then be processed with the "dot" tool
- to convert it to postscript or some other suitable format.
- </p>
-</div>
-
-<!-------------------------------------------------------------------------- -->
-<div class="doc_subsection">
- <a name="print-cfg">Print CFG of function to 'dot' file</a>
-</div>
-<div class="doc_text">
- <p>
- This pass, only available in <code>opt</code>, prints the control flow graph
- into a <code>.dot</code> graph. This graph can then be processed with the
- "dot" tool to convert it to postscript or some other suitable format.
- </p>
-</div>
-
-<!-------------------------------------------------------------------------- -->
-<div class="doc_subsection">
- <a name="print-cfg-only">Print CFG of function to 'dot' file (with no function bodies)</a>
-</div>
-<div class="doc_text">
- <p>
- This pass, only available in <code>opt</code>, prints the control flow graph
- into a <code>.dot</code> graph, omitting the function bodies. This graph can
- then be processed with the "dot" tool to convert it to postscript or some
- other suitable format.
- </p>
-</div>
-
-<!-------------------------------------------------------------------------- -->
-<div class="doc_subsection">
- <a name="printm">Print module to stderr</a>
-</div>
-<div class="doc_text">
- <p>
- This pass simply prints out the entire module when it is executed.
- </p>
-</div>
-
-<!-------------------------------------------------------------------------- -->
-<div class="doc_subsection">
- <a name="printusedtypes">Find Used Types</a>
-</div>
-<div class="doc_text">
- <p>
- This pass is used to seek out all of the types in use by the program. Note
- that this analysis explicitly does not include types only used by the symbol
- table.
-</div>
-
-<!-------------------------------------------------------------------------- -->
-<div class="doc_subsection">
- <a name="profile-loader">Load profile information from llvmprof.out</a>
-</div>
-<div class="doc_text">
- <p>
- A concrete implementation of profiling information that loads the information
- from a profile dump file.
- </p>
-</div>
-
-<!-------------------------------------------------------------------------- -->
-<div class="doc_subsection">
- <a name="scalar-evolution">Scalar Evolution Analysis</a>
-</div>
-<div class="doc_text">
- <p>
- The <code>ScalarEvolution</code> analysis can be used to analyze and
- catagorize scalar expressions in loops. It specializes in recognizing general
- induction variables, representing them with the abstract and opaque
- <code>SCEV</code> class. Given this analysis, trip counts of loops and other
- important properties can be obtained.
- </p>
-
- <p>
- This analysis is primarily useful for induction variable substitution and
- strength reduction.
- </p>
-</div>
-
-<!-------------------------------------------------------------------------- -->
-<div class="doc_subsection">
- <a name="targetdata">Target Data Layout</a>
-</div>
-<div class="doc_text">
- <p>Provides other passes access to information on how the size and alignment
- required by the the target ABI for various data types.</p>
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_section"> <a name="transform">Transform Passes</a></div>
-<div class="doc_text">
- <p>This section describes the LLVM Transform Passes.</p>
-</div>
-
-<!-------------------------------------------------------------------------- -->
-<div class="doc_subsection">
- <a name="adce">Aggressive Dead Code Elimination</a>
-</div>
-<div class="doc_text">
- <p>ADCE aggressively tries to eliminate code. This pass is similar to
- <a href="#dce">DCE</a> but it assumes that values are dead until proven
- otherwise. This is similar to <a href="#sccp">SCCP</a>, except applied to
- the liveness of values.</p>
-</div>
-
-<!-------------------------------------------------------------------------- -->
-<div class="doc_subsection">
- <a name="argpromotion">Promote 'by reference' arguments to scalars</a>
-</div>
-<div class="doc_text">
- <p>
- This pass promotes "by reference" arguments to be "by value" arguments. In
- practice, this means looking for internal functions that have pointer
- arguments. If it can prove, through the use of alias analysis, that an
- argument is *only* loaded, then it can pass the value into the function
- instead of the address of the value. This can cause recursive simplification
- of code and lead to the elimination of allocas (especially in C++ template
- code like the STL).
- </p>
-
- <p>
- This pass also handles aggregate arguments that are passed into a function,
- scalarizing them if the elements of the aggregate are only loaded. Note that
- it refuses to scalarize aggregates which would require passing in more than
- three operands to the function, because passing thousands of operands for a
- large array or structure is unprofitable!
- </p>
-
- <p>
- Note that this transformation could also be done for arguments that are only
- stored to (returning the value instead), but does not currently. This case
- would be best handled when and if LLVM starts supporting multiple return
- values from functions.
- </p>
-</div>
-
-<!-------------------------------------------------------------------------- -->
-<div class="doc_subsection">
- <a name="block-placement">Profile Guided Basic Block Placement</a>
-</div>
-<div class="doc_text">
- <p>This pass is a very simple profile guided basic block placement algorithm.
- The idea is to put frequently executed blocks together at the start of the
- function and hopefully increase the number of fall-through conditional
- branches. If there is no profile information for a particular function, this
- pass basically orders blocks in depth-first order.</p>
-</div>
-
-<!-------------------------------------------------------------------------- -->
-<div class="doc_subsection">
- <a name="break-crit-edges">Break critical edges in CFG</a>
-</div>
-<div class="doc_text">
- <p>
- Break all of the critical edges in the CFG by inserting a dummy basic block.
- It may be "required" by passes that cannot deal with critical edges. This
- transformation obviously invalidates the CFG, but can update forward dominator
- (set, immediate dominators, tree, and frontier) information.
- </p>
-</div>
-
-<!-------------------------------------------------------------------------- -->
-<div class="doc_subsection">
- <a name="codegenprepare">Prepare a function for code generation</a>
-</div>
-<div class="doc_text">
- This pass munges the code in the input function to better prepare it for
- SelectionDAG-based code generation. This works around limitations in it's
- basic-block-at-a-time approach. It should eventually be removed.
-</div>
-
-<!-------------------------------------------------------------------------- -->
-<div class="doc_subsection">
- <a name="condprop">Conditional Propagation</a>
-</div>
-<div class="doc_text">
- <p>This pass propagates information about conditional expressions through the
- program, allowing it to eliminate conditional branches in some cases.</p>
-</div>
-
-<!-------------------------------------------------------------------------- -->
-<div class="doc_subsection">
- <a name="constmerge">Merge Duplicate Global Constants</a>
-</div>
-<div class="doc_text">
- <p>
- Merges duplicate global constants together into a single constant that is
- shared. This is useful because some passes (ie TraceValues) insert a lot of
- string constants into the program, regardless of whether or not an existing
- string is available.
- </p>
-</div>
-
-<!-------------------------------------------------------------------------- -->
-<div class="doc_subsection">
- <a name="constprop">Simple constant propagation</a>
-</div>
-<div class="doc_text">
- <p>This file implements constant propagation and merging. It looks for
- instructions involving only constant operands and replaces them with a
- constant value instead of an instruction. For example:</p>
- <blockquote><pre>add i32 1, 2</pre></blockquote>
- <p>becomes</p>
- <blockquote><pre>i32 3</pre></blockquote>
- <p>NOTE: this pass has a habit of making definitions be dead. It is a good
- idea to to run a <a href="#die">DIE</a> (Dead Instruction Elimination) pass
- sometime after running this pass.</p>
-</div>
-
-<!-------------------------------------------------------------------------- -->
-<div class="doc_subsection">
- <a name="dce">Dead Code Elimination</a>
-</div>
-<div class="doc_text">
- <p>
- Dead code elimination is similar to <a href="#die">dead instruction
- elimination</a>, but it rechecks instructions that were used by removed
- instructions to see if they are newly dead.
- </p>
-</div>
-
-<!-------------------------------------------------------------------------- -->
-<div class="doc_subsection">
- <a name="deadargelim">Dead Argument Elimination</a>
-</div>
-<div class="doc_text">
- <p>
- This pass deletes dead arguments from internal functions. Dead argument
- elimination removes arguments which are directly dead, as well as arguments
- only passed into function calls as dead arguments of other functions. This
- pass also deletes dead arguments in a similar way.
- </p>
-
- <p>
- This pass is often useful as a cleanup pass to run after aggressive
- interprocedural passes, which add possibly-dead arguments.
- </p>
-</div>
-
-<!-------------------------------------------------------------------------- -->
-<div class="doc_subsection">
- <a name="deadtypeelim">Dead Type Elimination</a>
-</div>
-<div class="doc_text">
- <p>
- This pass is used to cleanup the output of GCC. It eliminate names for types
- that are unused in the entire translation unit, using the <a
- href="#findusedtypes">find used types</a> pass.
- </p>
-</div>
-
-<!-------------------------------------------------------------------------- -->
-<div class="doc_subsection">
- <a name="die">Dead Instruction Elimination</a>
-</div>
-<div class="doc_text">
- <p>
- Dead instruction elimination performs a single pass over the function,
- removing instructions that are obviously dead.
- </p>
-</div>
-
-<!-------------------------------------------------------------------------- -->
-<div class="doc_subsection">
- <a name="dse">Dead Store Elimination</a>
-</div>
-<div class="doc_text">
- <p>
- A trivial dead store elimination that only considers basic-block local
- redundant stores.
- </p>
-</div>
-
-<!-------------------------------------------------------------------------- -->
-<div class="doc_subsection">
- <a name="gcse">Global Common Subexpression Elimination</a>
-</div>
-<div class="doc_text">
- <p>
- This pass is designed to be a very quick global transformation that
- eliminates global common subexpressions from a function. It does this by
- using an existing value numbering implementation to identify the common
- subexpressions, eliminating them when possible.
- </p>
-</div>
-
-<!-------------------------------------------------------------------------- -->
-<div class="doc_subsection">
- <a name="globaldce">Dead Global Elimination</a>
-</div>
-<div class="doc_text">
- <p>
- This transform is designed to eliminate unreachable internal globals from the
- program. It uses an aggressive algorithm, searching out globals that are
- known to be alive. After it finds all of the globals which are needed, it
- deletes whatever is left over. This allows it to delete recursive chunks of
- the program which are unreachable.
- </p>
-</div>
-
-<!-------------------------------------------------------------------------- -->
-<div class="doc_subsection">
- <a name="globalopt">Global Variable Optimizer</a>
-</div>
-<div class="doc_text">
- <p>
- This pass transforms simple global variables that never have their address
- taken. If obviously true, it marks read/write globals as constant, deletes
- variables only stored to, etc.
- </p>
-</div>
-
-<!-------------------------------------------------------------------------- -->
-<div class="doc_subsection">
- <a name="gvn">Global Value Numbering</a>
-</div>
-<div class="doc_text">
- <p>
- This pass performs global value numbering to eliminate fully redundant
- instructions. It also performs simple dead load elimination.
- </p>
-</div>
-
-<!-------------------------------------------------------------------------- -->
-<div class="doc_subsection">
- <a name="gvnpre">Global Value Numbering/Partial Redundancy Elimination</a>
-</div>
-<div class="doc_text">
- <p>
- This pass performs a hybrid of global value numbering and partial redundancy
- elimination, known as GVN-PRE. It performs partial redundancy elimination on
- values, rather than lexical expressions, allowing a more comprehensive view
- the optimization. It replaces redundant values with uses of earlier
- occurences of the same value. While this is beneficial in that it eliminates
- unneeded computation, it also increases register pressure by creating large
- live ranges, and should be used with caution on platforms that are very
- sensitive to register pressure.
- </p>
-</div>
-
-<!-------------------------------------------------------------------------- -->
-<div class="doc_subsection">
- <a name="indmemrem">Indirect Malloc and Free Removal</a>
-</div>
-<div class="doc_text">
- <p>
- This pass finds places where memory allocation functions may escape into
- indirect land. Some transforms are much easier (aka possible) only if free
- or malloc are not called indirectly.
- </p>
-
- <p>
- Thus find places where the address of memory functions are taken and construct
- bounce functions with direct calls of those functions.
- </p>
-</div>
-
-<!-------------------------------------------------------------------------- -->
-<div class="doc_subsection">
- <a name="indvars">Canonicalize Induction Variables</a>
-</div>
-<div class="doc_text">
- <p>
- This transformation analyzes and transforms the induction variables (and
- computations derived from them) into simpler forms suitable for subsequent
- analysis and transformation.
- </p>
-
- <p>
- This transformation makes the following changes to each loop with an
- identifiable induction variable:
- </p>
-
- <ol>
- <li>All loops are transformed to have a <em>single</em> canonical
- induction variable which starts at zero and steps by one.</li>
- <li>The canonical induction variable is guaranteed to be the first PHI node
- in the loop header block.</li>
- <li>Any pointer arithmetic recurrences are raised to use array
- subscripts.</li>
- </ol>
-
- <p>
- If the trip count of a loop is computable, this pass also makes the following
- changes:
- </p>
-
- <ol>
- <li>The exit condition for the loop is canonicalized to compare the
- induction value against the exit value. This turns loops like:
- <blockquote><pre>for (i = 7; i*i < 1000; ++i)</pre></blockquote>
- into
- <blockquote><pre>for (i = 0; i != 25; ++i)</pre></blockquote></li>
- <li>Any use outside of the loop of an expression derived from the indvar
- is changed to compute the derived value outside of the loop, eliminating
- the dependence on the exit value of the induction variable. If the only
- purpose of the loop is to compute the exit value of some derived
- expression, this transformation will make the loop dead.</li>
- </ol>
-
- <p>
- This transformation should be followed by strength reduction after all of the
- desired loop transformations have been performed. Additionally, on targets
- where it is profitable, the loop could be transformed to count down to zero
- (the "do loop" optimization).
- </p>
-</div>
-
-<!-------------------------------------------------------------------------- -->
-<div class="doc_subsection">
- <a name="inline">Function Integration/Inlining</a>
-</div>
-<div class="doc_text">
- <p>
- Bottom-up inlining of functions into callees.
- </p>
-</div>
-
-<!-------------------------------------------------------------------------- -->
-<div class="doc_subsection">
- <a name="insert-block-profiling">Insert instrumentation for block profiling</a>
-</div>
-<div class="doc_text">
- <p>
- This pass instruments the specified program with counters for basic block
- profiling, which counts the number of times each basic block executes. This
- is the most basic form of profiling, which can tell which blocks are hot, but
- cannot reliably detect hot paths through the CFG.
- </p>
-
- <p>
- Note that this implementation is very naïve. Control equivalent regions of
- the CFG should not require duplicate counters, but it does put duplicate
- counters in.
- </p>
-</div>
-
-<!-------------------------------------------------------------------------- -->
-<div class="doc_subsection">
- <a name="insert-edge-profiling">Insert instrumentation for edge profiling</a>
-</div>
-<div class="doc_text">
- <p>
- This pass instruments the specified program with counters for edge profiling.
- Edge profiling can give a reasonable approximation of the hot paths through a
- program, and is used for a wide variety of program transformations.
- </p>
-
- <p>
- Note that this implementation is very naïve. It inserts a counter for
- <em>every</em> edge in the program, instead of using control flow information
- to prune the number of counters inserted.
- </p>
-</div>
-
-<!-------------------------------------------------------------------------- -->
-<div class="doc_subsection">
- <a name="insert-function-profiling">Insert instrumentation for function profiling</a>
-</div>
-<div class="doc_text">
- <p>
- This pass instruments the specified program with counters for function
- profiling, which counts the number of times each function is called.
- </p>
-</div>
-
-<!-------------------------------------------------------------------------- -->
-<div class="doc_subsection">
- <a name="insert-null-profiling-rs">Measure profiling framework overhead</a>
-</div>
-<div class="doc_text">
- <p>
- The basic profiler that does nothing. It is the default profiler and thus
- terminates <code>RSProfiler</code> chains. It is useful for measuring
- framework overhead.
- </p>
-</div>
-
-<!-------------------------------------------------------------------------- -->
-<div class="doc_subsection">
- <a name="insert-rs-profiling-framework">Insert random sampling instrumentation framework</a>
-</div>
-<div class="doc_text">
- <p>
- The second stage of the random-sampling instrumentation framework, duplicates
- all instructions in a function, ignoring the profiling code, then connects the
- two versions together at the entry and at backedges. At each connection point
- a choice is made as to whether to jump to the profiled code (take a sample) or
- execute the unprofiled code.
- </p>
-
- <p>
- After this pass, it is highly recommended to run<a href="#mem2reg">mem2reg</a>
- and <a href="#adce">adce</a>. <a href="#instcombine">instcombine</a>,
- <a href="#load-vn">load-vn</a>, <a href="#gdce">gdce</a>, and
- <a href="#dse">dse</a> also are good to run afterwards.
- </p>
-</div>
-
-<!-------------------------------------------------------------------------- -->
-<div class="doc_subsection">
- <a name="instcombine">Combine redundant instructions</a>
-</div>
-<div class="doc_text">
- <p>
- Combine instructions to form fewer, simple
- instructions. This pass does not modify the CFG This pass is where algebraic
- simplification happens.
- </p>
-
- <p>
- This pass combines things like:
- </p>
-
-<blockquote><pre
->%Y = add i32 %X, 1
-%Z = add i32 %Y, 1</pre></blockquote>
-
- <p>
- into:
- </p>
-
-<blockquote><pre
->%Z = add i32 %X, 2</pre></blockquote>
-
- <p>
- This is a simple worklist driven algorithm.
- </p>
-
- <p>
- This pass guarantees that the following canonicalizations are performed on
- the program:
- </p>
-
- <ul>
- <li>If a binary operator has a constant operand, it is moved to the right-
- hand side.</li>
- <li>Bitwise operators with constant operands are always grouped so that
- shifts are performed first, then <code>or</code>s, then
- <code>and</code>s, then <code>xor</code>s.</li>
- <li>Compare instructions are converted from <code>&lt;</code>,
- <code>&gt;</code>, <code>≤</code>, or <code>≥</code> to
- <code>=</code> or <code>≠</code> if possible.</li>
- <li>All <code>cmp</code> instructions on boolean values are replaced with
- logical operations.</li>
- <li><code>add <var>X</var>, <var>X</var></code> is represented as
- <code>mul <var>X</var>, 2</code> ⇒ <code>shl <var>X</var>, 1</code></li>
- <li>Multiplies with a constant power-of-two argument are transformed into
- shifts.</li>
- <li>… etc.</li>
- </ul>
-</div>
-
-<!-------------------------------------------------------------------------- -->
-<div class="doc_subsection">
- <a name="internalize">Internalize Global Symbols</a>
-</div>
-<div class="doc_text">
- <p>
- This pass loops over all of the functions in the input module, looking for a
- main function. If a main function is found, all other functions and all
- global variables with initializers are marked as internal.
- </p>
-</div>
-
-<!-------------------------------------------------------------------------- -->
-<div class="doc_subsection">
- <a name="ipconstprop">Interprocedural constant propagation</a>
-</div>
-<div class="doc_text">
- <p>
- This pass implements an <em>extremely</em> simple interprocedural constant
- propagation pass. It could certainly be improved in many different ways,
- like using a worklist. This pass makes arguments dead, but does not remove
- them. The existing dead argument elimination pass should be run after this
- to clean up the mess.
- </p>
-</div>
-
-<!-------------------------------------------------------------------------- -->
-<div class="doc_subsection">
- <a name="ipsccp">Interprocedural Sparse Conditional Constant Propagation</a>
-</div>
-<div class="doc_text">
- <p>
- An interprocedural variant of <a href="#sccp">Sparse Conditional Constant
- Propagation</a>.
- </p>
-</div>
-
-<!-------------------------------------------------------------------------- -->
-<div class="doc_subsection">
- <a name="jump-threading">Thread control through conditional blocks</a>
-</div>
-<div class="doc_text">
- <p>
- Jump threading tries to find distinct threads of control flow running through
- a basic block. This pass looks at blocks that have multiple predecessors and
- multiple successors. If one or more of the predecessors of the block can be
- proven to always cause a jump to one of the successors, we forward the edge
- from the predecessor to the successor by duplicating the contents of this
- block.
- </p>
- <p>
- An example of when this can occur is code like this:
- </p>
-
- <pre
->if () { ...
- X = 4;
-}
-if (X &lt; 3) {</pre>
-
- <p>
- In this case, the unconditional branch at the end of the first if can be
- revectored to the false side of the second if.
- </p>
-</div>
-
-<!-------------------------------------------------------------------------- -->
-<div class="doc_subsection">
- <a name="lcssa">Loop-Closed SSA Form Pass</a>
-</div>
-<div class="doc_text">
- <p>
- This pass transforms loops by placing phi nodes at the end of the loops for
- all values that are live across the loop boundary. For example, it turns
- the left into the right code:
- </p>
-
- <pre
->for (...) for (...)
- if (c) if (c)
- X1 = ... X1 = ...
- else else
- X2 = ... X2 = ...
- X3 = phi(X1, X2) X3 = phi(X1, X2)
-... = X3 + 4 X4 = phi(X3)
- ... = X4 + 4</pre>
-
- <p>
- This is still valid LLVM; the extra phi nodes are purely redundant, and will
- be trivially eliminated by <code>InstCombine</code>. The major benefit of
- this transformation is that it makes many other loop optimizations, such as
- LoopUnswitching, simpler.
- </p>
-</div>
-
-<!-------------------------------------------------------------------------- -->
-<div class="doc_subsection">
- <a name="licm">Loop Invariant Code Motion</a>
-</div>
-<div class="doc_text">
- <p>
- This pass performs loop invariant code motion, attempting to remove as much
- code from the body of a loop as possible. It does this by either hoisting
- code into the preheader block, or by sinking code to the exit blocks if it is
- safe. This pass also promotes must-aliased memory locations in the loop to
- live in registers, thus hoisting and sinking "invariant" loads and stores.
- </p>
-
- <p>
- This pass uses alias analysis for two purposes:
- </p>
-
- <ul>
- <li>Moving loop invariant loads and calls out of loops. If we can determine
- that a load or call inside of a loop never aliases anything stored to,
- we can hoist it or sink it like any other instruction.</li>
- <li>Scalar Promotion of Memory - If there is a store instruction inside of
- the loop, we try to move the store to happen AFTER the loop instead of
- inside of the loop. This can only happen if a few conditions are true:
- <ul>
- <li>The pointer stored through is loop invariant.</li>
- <li>There are no stores or loads in the loop which <em>may</em> alias
- the pointer. There are no calls in the loop which mod/ref the
- pointer.</li>
- </ul>
- If these conditions are true, we can promote the loads and stores in the
- loop of the pointer to use a temporary alloca'd variable. We then use
- the mem2reg functionality to construct the appropriate SSA form for the
- variable.</li>
- </ul>
-</div>
-<!-------------------------------------------------------------------------- -->
-<div class="doc_subsection">
- <a name="loop-deletion">Dead Loop Deletion Pass</a>
-</div>
-<div class="doc_text">
- <p>
- This file implements the Dead Loop Deletion Pass. This pass is responsible
- for eliminating loops with non-infinite computable trip counts that have no
- side effects or volatile instructions, and do not contribute to the
- computation of the function's return value.
- </p>
-</div>
-
-<!-------------------------------------------------------------------------- -->
-<div class="doc_subsection">
- <a name="loop-extract">Extract loops into new functions</a>
-</div>
-<div class="doc_text">
- <p>
- A pass wrapper around the <code>ExtractLoop()</code> scalar transformation to
- extract each top-level loop into its own new function. If the loop is the
- <em>only</em> loop in a given function, it is not touched. This is a pass most
- useful for debugging via bugpoint.
- </p>
-</div>
-
-<!-------------------------------------------------------------------------- -->
-<div class="doc_subsection">
- <a name="loop-extract-single">Extract at most one loop into a new function</a>
-</div>
-<div class="doc_text">
- <p>
- Similar to <a href="#loop-extract">Extract loops into new functions</a>,
- this pass extracts one natural loop from the program into a function if it
- can. This is used by bugpoint.
- </p>
-</div>
-
-<!-------------------------------------------------------------------------- -->
-<div class="doc_subsection">
- <a name="loop-index-split">Index Split Loops</a>
-</div>
-<div class="doc_text">
- <p>
- This pass divides loop's iteration range by spliting loop such that each
- individual loop is executed efficiently.
- </p>
-</div>
-
-<!-------------------------------------------------------------------------- -->
-<div class="doc_subsection">
- <a name="loop-reduce">Loop Strength Reduction</a>
-</div>
-<div class="doc_text">
- <p>
- This pass performs a strength reduction on array references inside loops that
- have as one or more of their components the loop induction variable. This is
- accomplished by creating a new value to hold the initial value of the array
- access for the first iteration, and then creating a new GEP instruction in
- the loop to increment the value by the appropriate amount.
- </p>
-</div>
-
-<!-------------------------------------------------------------------------- -->
-<div class="doc_subsection">
- <a name="loop-rotate">Rotate Loops</a>
-</div>
-<div class="doc_text">
- <p>A simple loop rotation transformation.</p>
-</div>
-
-<!-------------------------------------------------------------------------- -->
-<div class="doc_subsection">
- <a name="loop-unroll">Unroll loops</a>
-</div>
-<div class="doc_text">
- <p>
- This pass implements a simple loop unroller. It works best when loops have
- been canonicalized by the <a href="#indvars"><tt>-indvars</tt></a> pass,
- allowing it to determine the trip counts of loops easily.
- </p>
-</div>
-
-<!-------------------------------------------------------------------------- -->
-<div class="doc_subsection">
- <a name="loop-unswitch">Unswitch loops</a>
-</div>
-<div class="doc_text">
- <p>
- This pass transforms loops that contain branches on loop-invariant conditions
- to have multiple loops. For example, it turns the left into the right code:
- </p>
-
- <pre
->for (...) if (lic)
- A for (...)
- if (lic) A; B; C
- B else
- C for (...)
- A; C</pre>
-
- <p>
- This can increase the size of the code exponentially (doubling it every time
- a loop is unswitched) so we only unswitch if the resultant code will be
- smaller than a threshold.
- </p>
-
- <p>
- This pass expects LICM to be run before it to hoist invariant conditions out
- of the loop, to make the unswitching opportunity obvious.
- </p>
-</div>
-
-<!-------------------------------------------------------------------------- -->
-<div class="doc_subsection">
- <a name="loopsimplify">Canonicalize natural loops</a>
-</div>
-<div class="doc_text">
- <p>
- This pass performs several transformations to transform natural loops into a
- simpler form, which makes subsequent analyses and transformations simpler and
- more effective.
- </p>
-
- <p>
- Loop pre-header insertion guarantees that there is a single, non-critical
- entry edge from outside of the loop to the loop header. This simplifies a
- number of analyses and transformations, such as LICM.
- </p>
-
- <p>
- Loop exit-block insertion guarantees that all exit blocks from the loop
- (blocks which are outside of the loop that have predecessors inside of the
- loop) only have predecessors from inside of the loop (and are thus dominated
- by the loop header). This simplifies transformations such as store-sinking
- that are built into LICM.
- </p>
-
- <p>
- This pass also guarantees that loops will have exactly one backedge.
- </p>
-
- <p>
- Note that the simplifycfg pass will clean up blocks which are split out but
- end up being unnecessary, so usage of this pass should not pessimize
- generated code.
- </p>
-
- <p>
- This pass obviously modifies the CFG, but updates loop information and
- dominator information.
- </p>
-</div>
-
-<!-------------------------------------------------------------------------- -->
-<div class="doc_subsection">
- <a name="lowerallocs">Lower allocations from instructions to calls</a>
-</div>
-<div class="doc_text">
- <p>
- Turn <tt>malloc</tt> and <tt>free</tt> instructions into <tt>@malloc</tt> and
- <tt>@free</tt> calls.
- </p>
-
- <p>
- This is a target-dependent tranformation because it depends on the size of
- data types and alignment constraints.
- </p>
-</div>
-
-<!-------------------------------------------------------------------------- -->
-<div class="doc_subsection">
- <a name="lowerinvoke">Lower invoke and unwind, for unwindless code generators</a>
-</div>
-<div class="doc_text">
- <p>
- This transformation is designed for use by code generators which do not yet
- support stack unwinding. This pass supports two models of exception handling
- lowering, the 'cheap' support and the 'expensive' support.
- </p>
-
- <p>
- 'Cheap' exception handling support gives the program the ability to execute
- any program which does not "throw an exception", by turning 'invoke'
- instructions into calls and by turning 'unwind' instructions into calls to
- abort(). If the program does dynamically use the unwind instruction, the
- program will print a message then abort.
- </p>
-
- <p>
- 'Expensive' exception handling support gives the full exception handling
- support to the program at the cost of making the 'invoke' instruction
- really expensive. It basically inserts setjmp/longjmp calls to emulate the
- exception handling as necessary.
- </p>
-
- <p>
- Because the 'expensive' support slows down programs a lot, and EH is only
- used for a subset of the programs, it must be specifically enabled by the
- <tt>-enable-correct-eh-support</tt> option.
- </p>
-
- <p>
- Note that after this pass runs the CFG is not entirely accurate (exceptional
- control flow edges are not correct anymore) so only very simple things should
- be done after the lowerinvoke pass has run (like generation of native code).
- This should not be used as a general purpose "my LLVM-to-LLVM pass doesn't
- support the invoke instruction yet" lowering pass.
- </p>
-</div>
-
-<!-------------------------------------------------------------------------- -->
-<div class="doc_subsection">
- <a name="lowersetjmp">Lower Set Jump</a>
-</div>
-<div class="doc_text">
- <p>
- Lowers <tt>setjmp</tt> and <tt>longjmp</tt> to use the LLVM invoke and unwind
- instructions as necessary.
- </p>
-
- <p>
- Lowering of <tt>longjmp</tt> is fairly trivial. We replace the call with a
- call to the LLVM library function <tt>__llvm_sjljeh_throw_longjmp()</tt>.
- This unwinds the stack for us calling all of the destructors for
- objects allocated on the stack.
- </p>
-
- <p>
- At a <tt>setjmp</tt> call, the basic block is split and the <tt>setjmp</tt>
- removed. The calls in a function that have a <tt>setjmp</tt> are converted to
- invoke where the except part checks to see if it's a <tt>longjmp</tt>
- exception and, if so, if it's handled in the function. If it is, then it gets
- the value returned by the <tt>longjmp</tt> and goes to where the basic block
- was split. <tt>invoke</tt> instructions are handled in a similar fashion with
- the original except block being executed if it isn't a <tt>longjmp</tt>
- except that is handled by that function.
- </p>
-</div>
-
-<!-------------------------------------------------------------------------- -->
-<div class="doc_subsection">
- <a name="lowerswitch">Lower SwitchInst's to branches</a>
-</div>
-<div class="doc_text">
- <p>
- Rewrites <tt>switch</tt> instructions with a sequence of branches, which
- allows targets to get away with not implementing the switch instruction until
- it is convenient.
- </p>
-</div>
-
-<!-------------------------------------------------------------------------- -->
-<div class="doc_subsection">
- <a name="mem2reg">Promote Memory to Register</a>
-</div>
-<div class="doc_text">
- <p>
- This file promotes memory references to be register references. It promotes
- <tt>alloca</tt> instructions which only have <tt>load</tt>s and
- <tt>store</tt>s as uses. An <tt>alloca</tt> is transformed by using dominator
- frontiers to place <tt>phi</tt> nodes, then traversing the function in
- depth-first order to rewrite <tt>load</tt>s and <tt>store</tt>s as
- appropriate. This is just the standard SSA construction algorithm to construct
- "pruned" SSA form.
- </p>
-</div>
-
-<!-------------------------------------------------------------------------- -->
-<div class="doc_subsection">
- <a name="memcpyopt">Optimize use of memcpy and friend</a>
-</div>
-<div class="doc_text">
- <p>
- This pass performs various transformations related to eliminating memcpy
- calls, or transforming sets of stores into memset's.
- </p>
-</div>
-
-<!-------------------------------------------------------------------------- -->
-<div class="doc_subsection">
- <a name="mergereturn">Unify function exit nodes</a>
-</div>
-<div class="doc_text">
- <p>
- Ensure that functions have at most one <tt>ret</tt> instruction in them.
- Additionally, it keeps track of which node is the new exit node of the CFG.
- </p>
-</div>
-
-<!-------------------------------------------------------------------------- -->
-<div class="doc_subsection">
- <a name="predsimplify">Predicate Simplifier</a>
-</div>
-<div class="doc_text">
- <p>
- Path-sensitive optimizer. In a branch where <tt>x == y</tt>, replace uses of
- <tt>x</tt> with <tt>y</tt>. Permits further optimization, such as the
- elimination of the unreachable call:
- </p>
-
-<blockquote><pre
->void test(int *p, int *q)
-{
- if (p != q)
- return;
-
- if (*p != *q)
- foo(); // unreachable
-}</pre></blockquote>
-</div>
-
-<!-------------------------------------------------------------------------- -->
-<div class="doc_subsection">
- <a name="prune-eh">Remove unused exception handling info</a>
-</div>
-<div class="doc_text">
- <p>
- This file implements a simple interprocedural pass which walks the call-graph,
- turning <tt>invoke</tt> instructions into <tt>call</tt> instructions if and
- only if the callee cannot throw an exception. It implements this as a
- bottom-up traversal of the call-graph.
- </p>
-</div>
-
-<!-------------------------------------------------------------------------- -->
-<div class="doc_subsection">
- <a name="raiseallocs">Raise allocations from calls to instructions</a>
-</div>
-<div class="doc_text">
- <p>
- Converts <tt>@malloc</tt> and <tt>@free</tt> calls to <tt>malloc</tt> and
- <tt>free</tt> instructions.
- </p>
-</div>
-
-<!-------------------------------------------------------------------------- -->
-<div class="doc_subsection">
- <a name="reassociate">Reassociate expressions</a>
-</div>
-<div class="doc_text">
- <p>
- This pass reassociates commutative expressions in an order that is designed
- to promote better constant propagation, GCSE, LICM, PRE, etc.
- </p>
-
- <p>
- For example: 4 + (<var>x</var> + 5) ⇒ <var>x</var> + (4 + 5)
- </p>
-
- <p>
- In the implementation of this algorithm, constants are assigned rank = 0,
- function arguments are rank = 1, and other values are assigned ranks
- corresponding to the reverse post order traversal of current function
- (starting at 2), which effectively gives values in deep loops higher rank
- than values not in loops.
- </p>
-</div>
-
-<!-------------------------------------------------------------------------- -->
-<div class="doc_subsection">
- <a name="reg2mem">Demote all values to stack slots</a>
-</div>
-<div class="doc_text">
- <p>
- This file demotes all registers to memory references. It is intented to be
- the inverse of <a href="#mem2reg"><tt>-mem2reg</tt></a>. By converting to
- <tt>load</tt> instructions, the only values live accross basic blocks are
- <tt>alloca</tt> instructions and <tt>load</tt> instructions before
- <tt>phi</tt> nodes. It is intended that this should make CFG hacking much
- easier. To make later hacking easier, the entry block is split into two, such
- that all introduced <tt>alloca</tt> instructions (and nothing else) are in the
- entry block.
- </p>
-</div>
-
-<!-------------------------------------------------------------------------- -->
-<div class="doc_subsection">
- <a name="scalarrepl">Scalar Replacement of Aggregates</a>
-</div>
-<div class="doc_text">
- <p>
- The well-known scalar replacement of aggregates transformation. This
- transform breaks up <tt>alloca</tt> instructions of aggregate type (structure
- or array) into individual <tt>alloca</tt> instructions for each member if
- possible. Then, if possible, it transforms the individual <tt>alloca</tt>
- instructions into nice clean scalar SSA form.
- </p>
-
- <p>
- This combines a simple scalar replacement of aggregates algorithm with the <a
- href="#mem2reg"><tt>mem2reg</tt></a> algorithm because often interact,
- especially for C++ programs. As such, iterating between <tt>scalarrepl</tt>,
- then <a href="#mem2reg"><tt>mem2reg</tt></a> until we run out of things to
- promote works well.
- </p>
-</div>
-
-<!-------------------------------------------------------------------------- -->
-<div class="doc_subsection">
- <a name="sccp">Sparse Conditional Constant Propagation</a>
-</div>
-<div class="doc_text">
- <p>
- Sparse conditional constant propagation and merging, which can be summarized
- as:
- </p>
-
- <ol>
- <li>Assumes values are constant unless proven otherwise</li>
- <li>Assumes BasicBlocks are dead unless proven otherwise</li>
- <li>Proves values to be constant, and replaces them with constants</li>
- <li>Proves conditional branches to be unconditional</li>
- </ol>
-
- <p>
- Note that this pass has a habit of making definitions be dead. It is a good
- idea to to run a DCE pass sometime after running this pass.
- </p>
-</div>
-
-<!-------------------------------------------------------------------------- -->
-<div class="doc_subsection">
- <a name="simplify-libcalls">Simplify well-known library calls</a>
-</div>
-<div class="doc_text">
- <p>
- Applies a variety of small optimizations for calls to specific well-known
- function calls (e.g. runtime library functions). For example, a call
- <tt>exit(3)</tt> that occurs within the <tt>main()</tt> function can be
- transformed into simply <tt>return 3</tt>.
- </p>
-</div>
-
-<!-------------------------------------------------------------------------- -->
-<div class="doc_subsection">
- <a name="simplifycfg">Simplify the CFG</a>
-</div>
-<div class="doc_text">
- <p>
- Performs dead code elimination and basic block merging. Specifically:
- </p>
-
- <ol>
- <li>Removes basic blocks with no predecessors.</li>
- <li>Merges a basic block into its predecessor if there is only one and the
- predecessor only has one successor.</li>
- <li>Eliminates PHI nodes for basic blocks with a single predecessor.</li>
- <li>Eliminates a basic block that only contains an unconditional
- branch.</li>
- </ol>
-</div>
-
-<!-------------------------------------------------------------------------- -->
-<div class="doc_subsection">
- <a name="strip">Strip all symbols from a module</a>
-</div>
-<div class="doc_text">
- <p>
- Performs code stripping. This transformation can delete:
- </p>
-
- <ol>
- <li>names for virtual registers</li>
- <li>symbols for internal globals and functions</li>
- <li>debug information</li>
- </ol>
-
- <p>
- Note that this transformation makes code much less readable, so it should
- only be used in situations where the <tt>strip</tt> utility would be used,
- such as reducing code size or making it harder to reverse engineer code.
- </p>
-</div>
-
-<!-------------------------------------------------------------------------- -->
-<div class="doc_subsection">
- <a name="strip-dead-prototypes">Remove unused function declarations</a>
-</div>
-<div class="doc_text">
- <p>
- This pass loops over all of the functions in the input module, looking for
- dead declarations and removes them. Dead declarations are declarations of
- functions for which no implementation is available (i.e., declarations for
- unused library functions).
- </p>
-</div>
-
-<!-------------------------------------------------------------------------- -->
-<div class="doc_subsection">
- <a name="sretpromotion">Promote sret arguments</a>
-</div>
-<div class="doc_text">
- <p>
- This pass finds functions that return a struct (using a pointer to the struct
- as the first argument of the function, marked with the '<tt>sret</tt>' attribute) and
- replaces them with a new function that simply returns each of the elements of
- that struct (using multiple return values).
- </p>
-
- <p>
- This pass works under a number of conditions:
- </p>
-
- <ul>
- <li>The returned struct must not contain other structs</li>
- <li>The returned struct must only be used to load values from</li>
- <li>The placeholder struct passed in is the result of an <tt>alloca</tt></li>
- </ul>
-</div>
-
-<!-------------------------------------------------------------------------- -->
-<div class="doc_subsection">
- <a name="tailcallelim">Tail Call Elimination</a>
-</div>
-<div class="doc_text">
- <p>
- This file transforms calls of the current function (self recursion) followed
- by a return instruction with a branch to the entry of the function, creating
- a loop. This pass also implements the following extensions to the basic
- algorithm:
- </p>
-
- <ul>
- <li>Trivial instructions between the call and return do not prevent the
- transformation from taking place, though currently the analysis cannot
- support moving any really useful instructions (only dead ones).
- <li>This pass transforms functions that are prevented from being tail
- recursive by an associative expression to use an accumulator variable,
- thus compiling the typical naive factorial or <tt>fib</tt> implementation
- into efficient code.
- <li>TRE is performed if the function returns void, if the return
- returns the result returned by the call, or if the function returns a
- run-time constant on all exits from the function. It is possible, though
- unlikely, that the return returns something else (like constant 0), and
- can still be TRE'd. It can be TRE'd if <em>all other</em> return
- instructions in the function return the exact same value.
- <li>If it can prove that callees do not access theier caller stack frame,
- they are marked as eligible for tail call elimination (by the code
- generator).
- </ul>
-</div>
-
-<!-------------------------------------------------------------------------- -->
-<div class="doc_subsection">
- <a name="tailduplicate">Tail Duplication</a>
-</div>
-<div class="doc_text">
- <p>
- This pass performs a limited form of tail duplication, intended to simplify
- CFGs by removing some unconditional branches. This pass is necessary to
- straighten out loops created by the C front-end, but also is capable of
- making other code nicer. After this pass is run, the CFG simplify pass
- should be run to clean up the mess.
- </p>
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_section"> <a name="transform">Utility Passes</a></div>
-<div class="doc_text">
- <p>This section describes the LLVM Utility Passes.</p>
-</div>
-
-<!-------------------------------------------------------------------------- -->
-<div class="doc_subsection">
- <a name="deadarghaX0r">Dead Argument Hacking (BUGPOINT USE ONLY; DO NOT USE)</a>
-</div>
-<div class="doc_text">
- <p>
- Same as dead argument elimination, but deletes arguments to functions which
- are external. This is only for use by <a
- href="Bugpoint.html">bugpoint</a>.</p>
-</div>
-
-<!-------------------------------------------------------------------------- -->
-<div class="doc_subsection">
- <a name="extract-blocks">Extract Basic Blocks From Module (for bugpoint use)</a>
-</div>
-<div class="doc_text">
- <p>
- This pass is used by bugpoint to extract all blocks from the module into their
- own functions.</p>
-</div>
-
-<!-------------------------------------------------------------------------- -->
-<div class="doc_subsection">
- <a name="preverify">Preliminary module verification</a>
-</div>
-<div class="doc_text">
- <p>
- Ensures that the module is in the form required by the <a
- href="#verifier">Module Verifier</a> pass.
- </p>
-
- <p>
- Running the verifier runs this pass automatically, so there should be no need
- to use it directly.
- </p>
-</div>
-
-<!-------------------------------------------------------------------------- -->
-<div class="doc_subsection">
- <a name="verify">Module Verifier</a>
-</div>
-<div class="doc_text">
- <p>
- Verifies an LLVM IR code. This is useful to run after an optimization which is
- undergoing testing. Note that <tt>llvm-as</tt> verifies its input before
- emitting bitcode, and also that malformed bitcode is likely to make LLVM
- crash. All language front-ends are therefore encouraged to verify their output
- before performing optimizing transformations.
- </p>
-
- <ul>
- <li>Both of a binary operator's parameters are of the same type.</li>
- <li>Verify that the indices of mem access instructions match other
- operands.</li>
- <li>Verify that arithmetic and other things are only performed on
- first-class types. Verify that shifts and logicals only happen on
- integrals f.e.</li>
- <li>All of the constants in a switch statement are of the correct type.</li>
- <li>The code is in valid SSA form.</li>
- <li>It should be illegal to put a label into any other type (like a
- structure) or to return one. [except constant arrays!]</li>
- <li>Only phi nodes can be self referential: <tt>%x = add i32 %x, %x</tt> is
- invalid.</li>
- <li>PHI nodes must have an entry for each predecessor, with no extras.</li>
- <li>PHI nodes must be the first thing in a basic block, all grouped
- together.</li>
- <li>PHI nodes must have at least one entry.</li>
- <li>All basic blocks should only end with terminator insts, not contain
- them.</li>
- <li>The entry node to a function must not have predecessors.</li>
- <li>All Instructions must be embedded into a basic block.</li>
- <li>Functions cannot take a void-typed parameter.</li>
- <li>Verify that a function's argument list agrees with its declared
- type.</li>
- <li>It is illegal to specify a name for a void value.</li>
- <li>It is illegal to have a internal global value with no initializer.</li>
- <li>It is illegal to have a ret instruction that returns a value that does
- not agree with the function return value type.</li>
- <li>Function call argument types match the function prototype.</li>
- <li>All other things that are tested by asserts spread about the code.</li>
- </ul>
-
- <p>
- Note that this does not provide full security verification (like Java), but
- instead just tries to ensure that code is well-formed.
- </p>
-</div>
-
-<!-------------------------------------------------------------------------- -->
-<div class="doc_subsection">
- <a name="view-cfg">View CFG of function</a>
-</div>
-<div class="doc_text">
- <p>
- Displays the control flow graph using the GraphViz tool.
- </p>
-</div>
-
-<!-------------------------------------------------------------------------- -->
-<div class="doc_subsection">
- <a name="view-cfg-only">View CFG of function (with no function bodies)</a>
-</div>
-<div class="doc_text">
- <p>
- Displays the control flow graph using the GraphViz tool, but omitting function
- bodies.
- </p>
-</div>
-
-<!-- *********************************************************************** -->
-
-<hr>
-<address>
- <a href="http://jigsaw.w3.org/css-validator/check/referer"><img
- src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"></a>
- <a href="http://validator.w3.org/check/referer"><img
- src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!"></a>
-
- <a href="mailto:rspencer@x10sys.com">Reid Spencer</a><br>
- <a href="http://llvm.org">LLVM Compiler Infrastructure</a><br>
- Last modified: $Date$
-</address>
-
-</body>
-</html>
diff --git a/release_23/docs/ProgrammersManual.html b/release_23/docs/ProgrammersManual.html
deleted file mode 100644
index 5932aaf727f2..000000000000
--- a/release_23/docs/ProgrammersManual.html
+++ /dev/null
@@ -1,3195 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
- "http://www.w3.org/TR/html4/strict.dtd">
-<html>
-<head>
- <title>LLVM Programmer's Manual</title>
- <link rel="stylesheet" href="llvm.css" type="text/css">
-</head>
-<body>
-
-<div class="doc_title">
- LLVM Programmer's Manual
-</div>
-
-<ol>
- <li><a href="#introduction">Introduction</a></li>
- <li><a href="#general">General Information</a>
- <ul>
- <li><a href="#stl">The C++ Standard Template Library</a></li>
-<!--
- <li>The <tt>-time-passes</tt> option</li>
- <li>How to use the LLVM Makefile system</li>
- <li>How to write a regression test</li>
-
--->
- </ul>
- </li>
- <li><a href="#apis">Important and useful LLVM APIs</a>
- <ul>
- <li><a href="#isa">The <tt>isa&lt;&gt;</tt>, <tt>cast&lt;&gt;</tt>
-and <tt>dyn_cast&lt;&gt;</tt> templates</a> </li>
- <li><a href="#DEBUG">The <tt>DEBUG()</tt> macro and <tt>-debug</tt>
-option</a>
- <ul>
- <li><a href="#DEBUG_TYPE">Fine grained debug info with <tt>DEBUG_TYPE</tt>
-and the <tt>-debug-only</tt> option</a> </li>
- </ul>
- </li>
- <li><a href="#Statistic">The <tt>Statistic</tt> class &amp; <tt>-stats</tt>
-option</a></li>
-<!--
- <li>The <tt>InstVisitor</tt> template
- <li>The general graph API
--->
- <li><a href="#ViewGraph">Viewing graphs while debugging code</a></li>
- </ul>
- </li>
- <li><a href="#datastructure">Picking the Right Data Structure for a Task</a>
- <ul>
- <li><a href="#ds_sequential">Sequential Containers (std::vector, std::list, etc)</a>
- <ul>
- <li><a href="#dss_fixedarrays">Fixed Size Arrays</a></li>
- <li><a href="#dss_heaparrays">Heap Allocated Arrays</a></li>
- <li><a href="#dss_smallvector">"llvm/ADT/SmallVector.h"</a></li>
- <li><a href="#dss_vector">&lt;vector&gt;</a></li>
- <li><a href="#dss_deque">&lt;deque&gt;</a></li>
- <li><a href="#dss_list">&lt;list&gt;</a></li>
- <li><a href="#dss_ilist">llvm/ADT/ilist</a></li>
- <li><a href="#dss_other">Other Sequential Container Options</a></li>
- </ul></li>
- <li><a href="#ds_set">Set-Like Containers (std::set, SmallSet, SetVector, etc)</a>
- <ul>
- <li><a href="#dss_sortedvectorset">A sorted 'vector'</a></li>
- <li><a href="#dss_smallset">"llvm/ADT/SmallSet.h"</a></li>
- <li><a href="#dss_smallptrset">"llvm/ADT/SmallPtrSet.h"</a></li>
- <li><a href="#dss_denseset">"llvm/ADT/DenseSet.h"</a></li>
- <li><a href="#dss_FoldingSet">"llvm/ADT/FoldingSet.h"</a></li>
- <li><a href="#dss_set">&lt;set&gt;</a></li>
- <li><a href="#dss_setvector">"llvm/ADT/SetVector.h"</a></li>
- <li><a href="#dss_uniquevector">"llvm/ADT/UniqueVector.h"</a></li>
- <li><a href="#dss_otherset">Other Set-Like ContainerOptions</a></li>
- </ul></li>
- <li><a href="#ds_map">Map-Like Containers (std::map, DenseMap, etc)</a>
- <ul>
- <li><a href="#dss_sortedvectormap">A sorted 'vector'</a></li>
- <li><a href="#dss_stringmap">"llvm/ADT/StringMap.h"</a></li>
- <li><a href="#dss_indexedmap">"llvm/ADT/IndexedMap.h"</a></li>
- <li><a href="#dss_densemap">"llvm/ADT/DenseMap.h"</a></li>
- <li><a href="#dss_map">&lt;map&gt;</a></li>
- <li><a href="#dss_othermap">Other Map-Like Container Options</a></li>
- </ul></li>
- <li><a href="#ds_bit">BitVector-like containers</a>
- <ul>
- <li><a href="#dss_bitvector">A dense bitvector</a></li>
- <li><a href="#dss_sparsebitvector">A sparse bitvector</a></li>
- </ul></li>
- </ul>
- </li>
- <li><a href="#common">Helpful Hints for Common Operations</a>
- <ul>
- <li><a href="#inspection">Basic Inspection and Traversal Routines</a>
- <ul>
- <li><a href="#iterate_function">Iterating over the <tt>BasicBlock</tt>s
-in a <tt>Function</tt></a> </li>
- <li><a href="#iterate_basicblock">Iterating over the <tt>Instruction</tt>s
-in a <tt>BasicBlock</tt></a> </li>
- <li><a href="#iterate_institer">Iterating over the <tt>Instruction</tt>s
-in a <tt>Function</tt></a> </li>
- <li><a href="#iterate_convert">Turning an iterator into a
-class pointer</a> </li>
- <li><a href="#iterate_complex">Finding call sites: a more
-complex example</a> </li>
- <li><a href="#calls_and_invokes">Treating calls and invokes
-the same way</a> </li>
- <li><a href="#iterate_chains">Iterating over def-use &amp;
-use-def chains</a> </li>
- <li><a href="#iterate_preds">Iterating over predecessors &amp;
-successors of blocks</a></li>
- </ul>
- </li>
- <li><a href="#simplechanges">Making simple changes</a>
- <ul>
- <li><a href="#schanges_creating">Creating and inserting new
- <tt>Instruction</tt>s</a> </li>
- <li><a href="#schanges_deleting">Deleting <tt>Instruction</tt>s</a> </li>
- <li><a href="#schanges_replacing">Replacing an <tt>Instruction</tt>
-with another <tt>Value</tt></a> </li>
- <li><a href="#schanges_deletingGV">Deleting <tt>GlobalVariable</tt>s</a> </li>
- </ul>
- </li>
-<!--
- <li>Working with the Control Flow Graph
- <ul>
- <li>Accessing predecessors and successors of a <tt>BasicBlock</tt>
- <li>
- <li>
- </ul>
--->
- </ul>
- </li>
-
- <li><a href="#advanced">Advanced Topics</a>
- <ul>
- <li><a href="#TypeResolve">LLVM Type Resolution</a>
- <ul>
- <li><a href="#BuildRecType">Basic Recursive Type Construction</a></li>
- <li><a href="#refineAbstractTypeTo">The <tt>refineAbstractTypeTo</tt> method</a></li>
- <li><a href="#PATypeHolder">The PATypeHolder Class</a></li>
- <li><a href="#AbstractTypeUser">The AbstractTypeUser Class</a></li>
- </ul></li>
-
- <li><a href="#SymbolTable">The <tt>ValueSymbolTable</tt> and <tt>TypeSymbolTable</tt> classes </a></li>
- </ul></li>
-
- <li><a href="#coreclasses">The Core LLVM Class Hierarchy Reference</a>
- <ul>
- <li><a href="#Type">The <tt>Type</tt> class</a> </li>
- <li><a href="#Module">The <tt>Module</tt> class</a></li>
- <li><a href="#Value">The <tt>Value</tt> class</a>
- <ul>
- <li><a href="#User">The <tt>User</tt> class</a>
- <ul>
- <li><a href="#Instruction">The <tt>Instruction</tt> class</a></li>
- <li><a href="#Constant">The <tt>Constant</tt> class</a>
- <ul>
- <li><a href="#GlobalValue">The <tt>GlobalValue</tt> class</a>
- <ul>
- <li><a href="#Function">The <tt>Function</tt> class</a></li>
- <li><a href="#GlobalVariable">The <tt>GlobalVariable</tt> class</a></li>
- </ul>
- </li>
- </ul>
- </li>
- </ul>
- </li>
- <li><a href="#BasicBlock">The <tt>BasicBlock</tt> class</a></li>
- <li><a href="#Argument">The <tt>Argument</tt> class</a></li>
- </ul>
- </li>
- </ul>
- </li>
-</ol>
-
-<div class="doc_author">
- <p>Written by <a href="mailto:sabre@nondot.org">Chris Lattner</a>,
- <a href="mailto:dhurjati@cs.uiuc.edu">Dinakar Dhurjati</a>,
- <a href="mailto:jstanley@cs.uiuc.edu">Joel Stanley</a>, and
- <a href="mailto:rspencer@x10sys.com">Reid Spencer</a></p>
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section">
- <a name="introduction">Introduction </a>
-</div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>This document is meant to highlight some of the important classes and
-interfaces available in the LLVM source-base. This manual is not
-intended to explain what LLVM is, how it works, and what LLVM code looks
-like. It assumes that you know the basics of LLVM and are interested
-in writing transformations or otherwise analyzing or manipulating the
-code.</p>
-
-<p>This document should get you oriented so that you can find your
-way in the continuously growing source code that makes up the LLVM
-infrastructure. Note that this manual is not intended to serve as a
-replacement for reading the source code, so if you think there should be
-a method in one of these classes to do something, but it's not listed,
-check the source. Links to the <a href="/doxygen/">doxygen</a> sources
-are provided to make this as easy as possible.</p>
-
-<p>The first section of this document describes general information that is
-useful to know when working in the LLVM infrastructure, and the second describes
-the Core LLVM classes. In the future this manual will be extended with
-information describing how to use extension libraries, such as dominator
-information, CFG traversal routines, and useful utilities like the <tt><a
-href="/doxygen/InstVisitor_8h-source.html">InstVisitor</a></tt> template.</p>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section">
- <a name="general">General Information</a>
-</div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>This section contains general information that is useful if you are working
-in the LLVM source-base, but that isn't specific to any particular API.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="stl">The C++ Standard Template Library</a>
-</div>
-
-<div class="doc_text">
-
-<p>LLVM makes heavy use of the C++ Standard Template Library (STL),
-perhaps much more than you are used to, or have seen before. Because of
-this, you might want to do a little background reading in the
-techniques used and capabilities of the library. There are many good
-pages that discuss the STL, and several books on the subject that you
-can get, so it will not be discussed in this document.</p>
-
-<p>Here are some useful links:</p>
-
-<ol>
-
-<li><a href="http://www.dinkumware.com/refxcpp.html">Dinkumware C++ Library
-reference</a> - an excellent reference for the STL and other parts of the
-standard C++ library.</li>
-
-<li><a href="http://www.tempest-sw.com/cpp/">C++ In a Nutshell</a> - This is an
-O'Reilly book in the making. It has a decent
-Standard Library
-Reference that rivals Dinkumware's, and is unfortunately no longer free since the book has been
-published.</li>
-
-<li><a href="http://www.parashift.com/c++-faq-lite/">C++ Frequently Asked
-Questions</a></li>
-
-<li><a href="http://www.sgi.com/tech/stl/">SGI's STL Programmer's Guide</a> -
-Contains a useful <a
-href="http://www.sgi.com/tech/stl/stl_introduction.html">Introduction to the
-STL</a>.</li>
-
-<li><a href="http://www.research.att.com/%7Ebs/C++.html">Bjarne Stroustrup's C++
-Page</a></li>
-
-<li><a href="http://64.78.49.204/">
-Bruce Eckel's Thinking in C++, 2nd ed. Volume 2 Revision 4.0 (even better, get
-the book).</a></li>
-
-</ol>
-
-<p>You are also encouraged to take a look at the <a
-href="CodingStandards.html">LLVM Coding Standards</a> guide which focuses on how
-to write maintainable code more than where to put your curly braces.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="stl">Other useful references</a>
-</div>
-
-<div class="doc_text">
-
-<ol>
-<li><a href="http://www.psc.edu/%7Esemke/cvs_branches.html">CVS
-Branch and Tag Primer</a></li>
-<li><a href="http://www.fortran-2000.com/ArnaudRecipes/sharedlib.html">Using
-static and shared libraries across platforms</a></li>
-</ol>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section">
- <a name="apis">Important and useful LLVM APIs</a>
-</div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>Here we highlight some LLVM APIs that are generally useful and good to
-know about when writing transformations.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="isa">The <tt>isa&lt;&gt;</tt>, <tt>cast&lt;&gt;</tt> and
- <tt>dyn_cast&lt;&gt;</tt> templates</a>
-</div>
-
-<div class="doc_text">
-
-<p>The LLVM source-base makes extensive use of a custom form of RTTI.
-These templates have many similarities to the C++ <tt>dynamic_cast&lt;&gt;</tt>
-operator, but they don't have some drawbacks (primarily stemming from
-the fact that <tt>dynamic_cast&lt;&gt;</tt> only works on classes that
-have a v-table). Because they are used so often, you must know what they
-do and how they work. All of these templates are defined in the <a
- href="/doxygen/Casting_8h-source.html"><tt>llvm/Support/Casting.h</tt></a>
-file (note that you very rarely have to include this file directly).</p>
-
-<dl>
- <dt><tt>isa&lt;&gt;</tt>: </dt>
-
- <dd><p>The <tt>isa&lt;&gt;</tt> operator works exactly like the Java
- "<tt>instanceof</tt>" operator. It returns true or false depending on whether
- a reference or pointer points to an instance of the specified class. This can
- be very useful for constraint checking of various sorts (example below).</p>
- </dd>
-
- <dt><tt>cast&lt;&gt;</tt>: </dt>
-
- <dd><p>The <tt>cast&lt;&gt;</tt> operator is a "checked cast" operation. It
- converts a pointer or reference from a base class to a derived cast, causing
- an assertion failure if it is not really an instance of the right type. This
- should be used in cases where you have some information that makes you believe
- that something is of the right type. An example of the <tt>isa&lt;&gt;</tt>
- and <tt>cast&lt;&gt;</tt> template is:</p>
-
-<div class="doc_code">
-<pre>
-static bool isLoopInvariant(const <a href="#Value">Value</a> *V, const Loop *L) {
- if (isa&lt;<a href="#Constant">Constant</a>&gt;(V) || isa&lt;<a href="#Argument">Argument</a>&gt;(V) || isa&lt;<a href="#GlobalValue">GlobalValue</a>&gt;(V))
- return true;
-
- // <i>Otherwise, it must be an instruction...</i>
- return !L-&gt;contains(cast&lt;<a href="#Instruction">Instruction</a>&gt;(V)-&gt;getParent());
-}
-</pre>
-</div>
-
- <p>Note that you should <b>not</b> use an <tt>isa&lt;&gt;</tt> test followed
- by a <tt>cast&lt;&gt;</tt>, for that use the <tt>dyn_cast&lt;&gt;</tt>
- operator.</p>
-
- </dd>
-
- <dt><tt>dyn_cast&lt;&gt;</tt>:</dt>
-
- <dd><p>The <tt>dyn_cast&lt;&gt;</tt> operator is a "checking cast" operation.
- It checks to see if the operand is of the specified type, and if so, returns a
- pointer to it (this operator does not work with references). If the operand is
- not of the correct type, a null pointer is returned. Thus, this works very
- much like the <tt>dynamic_cast&lt;&gt;</tt> operator in C++, and should be
- used in the same circumstances. Typically, the <tt>dyn_cast&lt;&gt;</tt>
- operator is used in an <tt>if</tt> statement or some other flow control
- statement like this:</p>
-
-<div class="doc_code">
-<pre>
-if (<a href="#AllocationInst">AllocationInst</a> *AI = dyn_cast&lt;<a href="#AllocationInst">AllocationInst</a>&gt;(Val)) {
- // <i>...</i>
-}
-</pre>
-</div>
-
- <p>This form of the <tt>if</tt> statement effectively combines together a call
- to <tt>isa&lt;&gt;</tt> and a call to <tt>cast&lt;&gt;</tt> into one
- statement, which is very convenient.</p>
-
- <p>Note that the <tt>dyn_cast&lt;&gt;</tt> operator, like C++'s
- <tt>dynamic_cast&lt;&gt;</tt> or Java's <tt>instanceof</tt> operator, can be
- abused. In particular, you should not use big chained <tt>if/then/else</tt>
- blocks to check for lots of different variants of classes. If you find
- yourself wanting to do this, it is much cleaner and more efficient to use the
- <tt>InstVisitor</tt> class to dispatch over the instruction type directly.</p>
-
- </dd>
-
- <dt><tt>cast_or_null&lt;&gt;</tt>: </dt>
-
- <dd><p>The <tt>cast_or_null&lt;&gt;</tt> operator works just like the
- <tt>cast&lt;&gt;</tt> operator, except that it allows for a null pointer as an
- argument (which it then propagates). This can sometimes be useful, allowing
- you to combine several null checks into one.</p></dd>
-
- <dt><tt>dyn_cast_or_null&lt;&gt;</tt>: </dt>
-
- <dd><p>The <tt>dyn_cast_or_null&lt;&gt;</tt> operator works just like the
- <tt>dyn_cast&lt;&gt;</tt> operator, except that it allows for a null pointer
- as an argument (which it then propagates). This can sometimes be useful,
- allowing you to combine several null checks into one.</p></dd>
-
-</dl>
-
-<p>These five templates can be used with any classes, whether they have a
-v-table or not. To add support for these templates, you simply need to add
-<tt>classof</tt> static methods to the class you are interested casting
-to. Describing this is currently outside the scope of this document, but there
-are lots of examples in the LLVM source base.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="DEBUG">The <tt>DEBUG()</tt> macro and <tt>-debug</tt> option</a>
-</div>
-
-<div class="doc_text">
-
-<p>Often when working on your pass you will put a bunch of debugging printouts
-and other code into your pass. After you get it working, you want to remove
-it, but you may need it again in the future (to work out new bugs that you run
-across).</p>
-
-<p> Naturally, because of this, you don't want to delete the debug printouts,
-but you don't want them to always be noisy. A standard compromise is to comment
-them out, allowing you to enable them if you need them in the future.</p>
-
-<p>The "<tt><a href="/doxygen/Debug_8h-source.html">llvm/Support/Debug.h</a></tt>"
-file provides a macro named <tt>DEBUG()</tt> that is a much nicer solution to
-this problem. Basically, you can put arbitrary code into the argument of the
-<tt>DEBUG</tt> macro, and it is only executed if '<tt>opt</tt>' (or any other
-tool) is run with the '<tt>-debug</tt>' command line argument:</p>
-
-<div class="doc_code">
-<pre>
-DOUT &lt;&lt; "I am here!\n";
-</pre>
-</div>
-
-<p>Then you can run your pass like this:</p>
-
-<div class="doc_code">
-<pre>
-$ opt &lt; a.bc &gt; /dev/null -mypass
-<i>&lt;no output&gt;</i>
-$ opt &lt; a.bc &gt; /dev/null -mypass -debug
-I am here!
-</pre>
-</div>
-
-<p>Using the <tt>DEBUG()</tt> macro instead of a home-brewed solution allows you
-to not have to create "yet another" command line option for the debug output for
-your pass. Note that <tt>DEBUG()</tt> macros are disabled for optimized builds,
-so they do not cause a performance impact at all (for the same reason, they
-should also not contain side-effects!).</p>
-
-<p>One additional nice thing about the <tt>DEBUG()</tt> macro is that you can
-enable or disable it directly in gdb. Just use "<tt>set DebugFlag=0</tt>" or
-"<tt>set DebugFlag=1</tt>" from the gdb if the program is running. If the
-program hasn't been started yet, you can always just run it with
-<tt>-debug</tt>.</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="DEBUG_TYPE">Fine grained debug info with <tt>DEBUG_TYPE</tt> and
- the <tt>-debug-only</tt> option</a>
-</div>
-
-<div class="doc_text">
-
-<p>Sometimes you may find yourself in a situation where enabling <tt>-debug</tt>
-just turns on <b>too much</b> information (such as when working on the code
-generator). If you want to enable debug information with more fine-grained
-control, you define the <tt>DEBUG_TYPE</tt> macro and the <tt>-debug</tt> only
-option as follows:</p>
-
-<div class="doc_code">
-<pre>
-DOUT &lt;&lt; "No debug type\n";
-#undef DEBUG_TYPE
-#define DEBUG_TYPE "foo"
-DOUT &lt;&lt; "'foo' debug type\n";
-#undef DEBUG_TYPE
-#define DEBUG_TYPE "bar"
-DOUT &lt;&lt; "'bar' debug type\n";
-#undef DEBUG_TYPE
-#define DEBUG_TYPE ""
-DOUT &lt;&lt; "No debug type (2)\n";
-</pre>
-</div>
-
-<p>Then you can run your pass like this:</p>
-
-<div class="doc_code">
-<pre>
-$ opt &lt; a.bc &gt; /dev/null -mypass
-<i>&lt;no output&gt;</i>
-$ opt &lt; a.bc &gt; /dev/null -mypass -debug
-No debug type
-'foo' debug type
-'bar' debug type
-No debug type (2)
-$ opt &lt; a.bc &gt; /dev/null -mypass -debug-only=foo
-'foo' debug type
-$ opt &lt; a.bc &gt; /dev/null -mypass -debug-only=bar
-'bar' debug type
-</pre>
-</div>
-
-<p>Of course, in practice, you should only set <tt>DEBUG_TYPE</tt> at the top of
-a file, to specify the debug type for the entire module (if you do this before
-you <tt>#include "llvm/Support/Debug.h"</tt>, you don't have to insert the ugly
-<tt>#undef</tt>'s). Also, you should use names more meaningful than "foo" and
-"bar", because there is no system in place to ensure that names do not
-conflict. If two different modules use the same string, they will all be turned
-on when the name is specified. This allows, for example, all debug information
-for instruction scheduling to be enabled with <tt>-debug-type=InstrSched</tt>,
-even if the source lives in multiple files.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="Statistic">The <tt>Statistic</tt> class &amp; <tt>-stats</tt>
- option</a>
-</div>
-
-<div class="doc_text">
-
-<p>The "<tt><a
-href="/doxygen/Statistic_8h-source.html">llvm/ADT/Statistic.h</a></tt>" file
-provides a class named <tt>Statistic</tt> that is used as a unified way to
-keep track of what the LLVM compiler is doing and how effective various
-optimizations are. It is useful to see what optimizations are contributing to
-making a particular program run faster.</p>
-
-<p>Often you may run your pass on some big program, and you're interested to see
-how many times it makes a certain transformation. Although you can do this with
-hand inspection, or some ad-hoc method, this is a real pain and not very useful
-for big programs. Using the <tt>Statistic</tt> class makes it very easy to
-keep track of this information, and the calculated information is presented in a
-uniform manner with the rest of the passes being executed.</p>
-
-<p>There are many examples of <tt>Statistic</tt> uses, but the basics of using
-it are as follows:</p>
-
-<ol>
- <li><p>Define your statistic like this:</p>
-
-<div class="doc_code">
-<pre>
-#define <a href="#DEBUG_TYPE">DEBUG_TYPE</a> "mypassname" <i>// This goes before any #includes.</i>
-STATISTIC(NumXForms, "The # of times I did stuff");
-</pre>
-</div>
-
- <p>The <tt>STATISTIC</tt> macro defines a static variable, whose name is
- specified by the first argument. The pass name is taken from the DEBUG_TYPE
- macro, and the description is taken from the second argument. The variable
- defined ("NumXForms" in this case) acts like an unsigned integer.</p></li>
-
- <li><p>Whenever you make a transformation, bump the counter:</p>
-
-<div class="doc_code">
-<pre>
-++NumXForms; // <i>I did stuff!</i>
-</pre>
-</div>
-
- </li>
- </ol>
-
- <p>That's all you have to do. To get '<tt>opt</tt>' to print out the
- statistics gathered, use the '<tt>-stats</tt>' option:</p>
-
-<div class="doc_code">
-<pre>
-$ opt -stats -mypassname &lt; program.bc &gt; /dev/null
-<i>... statistics output ...</i>
-</pre>
-</div>
-
- <p> When running <tt>opt</tt> on a C file from the SPEC benchmark
-suite, it gives a report that looks like this:</p>
-
-<div class="doc_code">
-<pre>
- 7646 bitcodewriter - Number of normal instructions
- 725 bitcodewriter - Number of oversized instructions
- 129996 bitcodewriter - Number of bitcode bytes written
- 2817 raise - Number of insts DCEd or constprop'd
- 3213 raise - Number of cast-of-self removed
- 5046 raise - Number of expression trees converted
- 75 raise - Number of other getelementptr's formed
- 138 raise - Number of load/store peepholes
- 42 deadtypeelim - Number of unused typenames removed from symtab
- 392 funcresolve - Number of varargs functions resolved
- 27 globaldce - Number of global variables removed
- 2 adce - Number of basic blocks removed
- 134 cee - Number of branches revectored
- 49 cee - Number of setcc instruction eliminated
- 532 gcse - Number of loads removed
- 2919 gcse - Number of instructions removed
- 86 indvars - Number of canonical indvars added
- 87 indvars - Number of aux indvars removed
- 25 instcombine - Number of dead inst eliminate
- 434 instcombine - Number of insts combined
- 248 licm - Number of load insts hoisted
- 1298 licm - Number of insts hoisted to a loop pre-header
- 3 licm - Number of insts hoisted to multiple loop preds (bad, no loop pre-header)
- 75 mem2reg - Number of alloca's promoted
- 1444 cfgsimplify - Number of blocks simplified
-</pre>
-</div>
-
-<p>Obviously, with so many optimizations, having a unified framework for this
-stuff is very nice. Making your pass fit well into the framework makes it more
-maintainable and useful.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="ViewGraph">Viewing graphs while debugging code</a>
-</div>
-
-<div class="doc_text">
-
-<p>Several of the important data structures in LLVM are graphs: for example
-CFGs made out of LLVM <a href="#BasicBlock">BasicBlock</a>s, CFGs made out of
-LLVM <a href="CodeGenerator.html#machinebasicblock">MachineBasicBlock</a>s, and
-<a href="CodeGenerator.html#selectiondag_intro">Instruction Selection
-DAGs</a>. In many cases, while debugging various parts of the compiler, it is
-nice to instantly visualize these graphs.</p>
-
-<p>LLVM provides several callbacks that are available in a debug build to do
-exactly that. If you call the <tt>Function::viewCFG()</tt> method, for example,
-the current LLVM tool will pop up a window containing the CFG for the function
-where each basic block is a node in the graph, and each node contains the
-instructions in the block. Similarly, there also exists
-<tt>Function::viewCFGOnly()</tt> (does not include the instructions), the
-<tt>MachineFunction::viewCFG()</tt> and <tt>MachineFunction::viewCFGOnly()</tt>,
-and the <tt>SelectionDAG::viewGraph()</tt> methods. Within GDB, for example,
-you can usually use something like <tt>call DAG.viewGraph()</tt> to pop
-up a window. Alternatively, you can sprinkle calls to these functions in your
-code in places you want to debug.</p>
-
-<p>Getting this to work requires a small amount of configuration. On Unix
-systems with X11, install the <a href="http://www.graphviz.org">graphviz</a>
-toolkit, and make sure 'dot' and 'gv' are in your path. If you are running on
-Mac OS/X, download and install the Mac OS/X <a
-href="http://www.pixelglow.com/graphviz/">Graphviz program</a>, and add
-<tt>/Applications/Graphviz.app/Contents/MacOS/</tt> (or wherever you install
-it) to your path. Once in your system and path are set up, rerun the LLVM
-configure script and rebuild LLVM to enable this functionality.</p>
-
-<p><tt>SelectionDAG</tt> has been extended to make it easier to locate
-<i>interesting</i> nodes in large complex graphs. From gdb, if you
-<tt>call DAG.setGraphColor(<i>node</i>, "<i>color</i>")</tt>, then the
-next <tt>call DAG.viewGraph()</tt> would highlight the node in the
-specified color (choices of colors can be found at <a
-href="http://www.graphviz.org/doc/info/colors.html">colors</a>.) More
-complex node attributes can be provided with <tt>call
-DAG.setGraphAttrs(<i>node</i>, "<i>attributes</i>")</tt> (choices can be
-found at <a href="http://www.graphviz.org/doc/info/attrs.html">Graph
-Attributes</a>.) If you want to restart and clear all the current graph
-attributes, then you can <tt>call DAG.clearGraphAttrs()</tt>. </p>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section">
- <a name="datastructure">Picking the Right Data Structure for a Task</a>
-</div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>LLVM has a plethora of data structures in the <tt>llvm/ADT/</tt> directory,
- and we commonly use STL data structures. This section describes the trade-offs
- you should consider when you pick one.</p>
-
-<p>
-The first step is a choose your own adventure: do you want a sequential
-container, a set-like container, or a map-like container? The most important
-thing when choosing a container is the algorithmic properties of how you plan to
-access the container. Based on that, you should use:</p>
-
-<ul>
-<li>a <a href="#ds_map">map-like</a> container if you need efficient look-up
- of an value based on another value. Map-like containers also support
- efficient queries for containment (whether a key is in the map). Map-like
- containers generally do not support efficient reverse mapping (values to
- keys). If you need that, use two maps. Some map-like containers also
- support efficient iteration through the keys in sorted order. Map-like
- containers are the most expensive sort, only use them if you need one of
- these capabilities.</li>
-
-<li>a <a href="#ds_set">set-like</a> container if you need to put a bunch of
- stuff into a container that automatically eliminates duplicates. Some
- set-like containers support efficient iteration through the elements in
- sorted order. Set-like containers are more expensive than sequential
- containers.
-</li>
-
-<li>a <a href="#ds_sequential">sequential</a> container provides
- the most efficient way to add elements and keeps track of the order they are
- added to the collection. They permit duplicates and support efficient
- iteration, but do not support efficient look-up based on a key.
-</li>
-
-<li>a <a href="#ds_bit">bit</a> container provides an efficient way to store and
- perform set operations on sets of numeric id's, while automatically
- eliminating duplicates. Bit containers require a maximum of 1 bit for each
- identifier you want to store.
-</li>
-</ul>
-
-<p>
-Once the proper category of container is determined, you can fine tune the
-memory use, constant factors, and cache behaviors of access by intelligently
-picking a member of the category. Note that constant factors and cache behavior
-can be a big deal. If you have a vector that usually only contains a few
-elements (but could contain many), for example, it's much better to use
-<a href="#dss_smallvector">SmallVector</a> than <a href="#dss_vector">vector</a>
-. Doing so avoids (relatively) expensive malloc/free calls, which dwarf the
-cost of adding the elements to the container. </p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="ds_sequential">Sequential Containers (std::vector, std::list, etc)</a>
-</div>
-
-<div class="doc_text">
-There are a variety of sequential containers available for you, based on your
-needs. Pick the first in this section that will do what you want.
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="dss_fixedarrays">Fixed Size Arrays</a>
-</div>
-
-<div class="doc_text">
-<p>Fixed size arrays are very simple and very fast. They are good if you know
-exactly how many elements you have, or you have a (low) upper bound on how many
-you have.</p>
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="dss_heaparrays">Heap Allocated Arrays</a>
-</div>
-
-<div class="doc_text">
-<p>Heap allocated arrays (new[] + delete[]) are also simple. They are good if
-the number of elements is variable, if you know how many elements you will need
-before the array is allocated, and if the array is usually large (if not,
-consider a <a href="#dss_smallvector">SmallVector</a>). The cost of a heap
-allocated array is the cost of the new/delete (aka malloc/free). Also note that
-if you are allocating an array of a type with a constructor, the constructor and
-destructors will be run for every element in the array (re-sizable vectors only
-construct those elements actually used).</p>
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="dss_smallvector">"llvm/ADT/SmallVector.h"</a>
-</div>
-
-<div class="doc_text">
-<p><tt>SmallVector&lt;Type, N&gt;</tt> is a simple class that looks and smells
-just like <tt>vector&lt;Type&gt;</tt>:
-it supports efficient iteration, lays out elements in memory order (so you can
-do pointer arithmetic between elements), supports efficient push_back/pop_back
-operations, supports efficient random access to its elements, etc.</p>
-
-<p>The advantage of SmallVector is that it allocates space for
-some number of elements (N) <b>in the object itself</b>. Because of this, if
-the SmallVector is dynamically smaller than N, no malloc is performed. This can
-be a big win in cases where the malloc/free call is far more expensive than the
-code that fiddles around with the elements.</p>
-
-<p>This is good for vectors that are "usually small" (e.g. the number of
-predecessors/successors of a block is usually less than 8). On the other hand,
-this makes the size of the SmallVector itself large, so you don't want to
-allocate lots of them (doing so will waste a lot of space). As such,
-SmallVectors are most useful when on the stack.</p>
-
-<p>SmallVector also provides a nice portable and efficient replacement for
-<tt>alloca</tt>.</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="dss_vector">&lt;vector&gt;</a>
-</div>
-
-<div class="doc_text">
-<p>
-std::vector is well loved and respected. It is useful when SmallVector isn't:
-when the size of the vector is often large (thus the small optimization will
-rarely be a benefit) or if you will be allocating many instances of the vector
-itself (which would waste space for elements that aren't in the container).
-vector is also useful when interfacing with code that expects vectors :).
-</p>
-
-<p>One worthwhile note about std::vector: avoid code like this:</p>
-
-<div class="doc_code">
-<pre>
-for ( ... ) {
- std::vector&lt;foo&gt; V;
- use V;
-}
-</pre>
-</div>
-
-<p>Instead, write this as:</p>
-
-<div class="doc_code">
-<pre>
-std::vector&lt;foo&gt; V;
-for ( ... ) {
- use V;
- V.clear();
-}
-</pre>
-</div>
-
-<p>Doing so will save (at least) one heap allocation and free per iteration of
-the loop.</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="dss_deque">&lt;deque&gt;</a>
-</div>
-
-<div class="doc_text">
-<p>std::deque is, in some senses, a generalized version of std::vector. Like
-std::vector, it provides constant time random access and other similar
-properties, but it also provides efficient access to the front of the list. It
-does not guarantee continuity of elements within memory.</p>
-
-<p>In exchange for this extra flexibility, std::deque has significantly higher
-constant factor costs than std::vector. If possible, use std::vector or
-something cheaper.</p>
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="dss_list">&lt;list&gt;</a>
-</div>
-
-<div class="doc_text">
-<p>std::list is an extremely inefficient class that is rarely useful.
-It performs a heap allocation for every element inserted into it, thus having an
-extremely high constant factor, particularly for small data types. std::list
-also only supports bidirectional iteration, not random access iteration.</p>
-
-<p>In exchange for this high cost, std::list supports efficient access to both
-ends of the list (like std::deque, but unlike std::vector or SmallVector). In
-addition, the iterator invalidation characteristics of std::list are stronger
-than that of a vector class: inserting or removing an element into the list does
-not invalidate iterator or pointers to other elements in the list.</p>
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="dss_ilist">llvm/ADT/ilist</a>
-</div>
-
-<div class="doc_text">
-<p><tt>ilist&lt;T&gt;</tt> implements an 'intrusive' doubly-linked list. It is
-intrusive, because it requires the element to store and provide access to the
-prev/next pointers for the list.</p>
-
-<p>ilist has the same drawbacks as std::list, and additionally requires an
-ilist_traits implementation for the element type, but it provides some novel
-characteristics. In particular, it can efficiently store polymorphic objects,
-the traits class is informed when an element is inserted or removed from the
-list, and ilists are guaranteed to support a constant-time splice operation.
-</p>
-
-<p>These properties are exactly what we want for things like Instructions and
-basic blocks, which is why these are implemented with ilists.</p>
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="dss_other">Other Sequential Container options</a>
-</div>
-
-<div class="doc_text">
-<p>Other STL containers are available, such as std::string.</p>
-
-<p>There are also various STL adapter classes such as std::queue,
-std::priority_queue, std::stack, etc. These provide simplified access to an
-underlying container but don't affect the cost of the container itself.</p>
-
-</div>
-
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="ds_set">Set-Like Containers (std::set, SmallSet, SetVector, etc)</a>
-</div>
-
-<div class="doc_text">
-
-<p>Set-like containers are useful when you need to canonicalize multiple values
-into a single representation. There are several different choices for how to do
-this, providing various trade-offs.</p>
-
-</div>
-
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="dss_sortedvectorset">A sorted 'vector'</a>
-</div>
-
-<div class="doc_text">
-
-<p>If you intend to insert a lot of elements, then do a lot of queries, a
-great approach is to use a vector (or other sequential container) with
-std::sort+std::unique to remove duplicates. This approach works really well if
-your usage pattern has these two distinct phases (insert then query), and can be
-coupled with a good choice of <a href="#ds_sequential">sequential container</a>.
-</p>
-
-<p>
-This combination provides the several nice properties: the result data is
-contiguous in memory (good for cache locality), has few allocations, is easy to
-address (iterators in the final vector are just indices or pointers), and can be
-efficiently queried with a standard binary or radix search.</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="dss_smallset">"llvm/ADT/SmallSet.h"</a>
-</div>
-
-<div class="doc_text">
-
-<p>If you have a set-like data structure that is usually small and whose elements
-are reasonably small, a <tt>SmallSet&lt;Type, N&gt;</tt> is a good choice. This set
-has space for N elements in place (thus, if the set is dynamically smaller than
-N, no malloc traffic is required) and accesses them with a simple linear search.
-When the set grows beyond 'N' elements, it allocates a more expensive representation that
-guarantees efficient access (for most types, it falls back to std::set, but for
-pointers it uses something far better, <a
-href="#dss_smallptrset">SmallPtrSet</a>).</p>
-
-<p>The magic of this class is that it handles small sets extremely efficiently,
-but gracefully handles extremely large sets without loss of efficiency. The
-drawback is that the interface is quite small: it supports insertion, queries
-and erasing, but does not support iteration.</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="dss_smallptrset">"llvm/ADT/SmallPtrSet.h"</a>
-</div>
-
-<div class="doc_text">
-
-<p>SmallPtrSet has all the advantages of SmallSet (and a SmallSet of pointers is
-transparently implemented with a SmallPtrSet), but also supports iterators. If
-more than 'N' insertions are performed, a single quadratically
-probed hash table is allocated and grows as needed, providing extremely
-efficient access (constant time insertion/deleting/queries with low constant
-factors) and is very stingy with malloc traffic.</p>
-
-<p>Note that, unlike std::set, the iterators of SmallPtrSet are invalidated
-whenever an insertion occurs. Also, the values visited by the iterators are not
-visited in sorted order.</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="dss_denseset">"llvm/ADT/DenseSet.h"</a>
-</div>
-
-<div class="doc_text">
-
-<p>
-DenseSet is a simple quadratically probed hash table. It excels at supporting
-small values: it uses a single allocation to hold all of the pairs that
-are currently inserted in the set. DenseSet is a great way to unique small
-values that are not simple pointers (use <a
-href="#dss_smallptrset">SmallPtrSet</a> for pointers). Note that DenseSet has
-the same requirements for the value type that <a
-href="#dss_densemap">DenseMap</a> has.
-</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="dss_FoldingSet">"llvm/ADT/FoldingSet.h"</a>
-</div>
-
-<div class="doc_text">
-
-<p>
-FoldingSet is an aggregate class that is really good at uniquing
-expensive-to-create or polymorphic objects. It is a combination of a chained
-hash table with intrusive links (uniqued objects are required to inherit from
-FoldingSetNode) that uses <a href="#dss_smallvector">SmallVector</a> as part of
-its ID process.</p>
-
-<p>Consider a case where you want to implement a "getOrCreateFoo" method for
-a complex object (for example, a node in the code generator). The client has a
-description of *what* it wants to generate (it knows the opcode and all the
-operands), but we don't want to 'new' a node, then try inserting it into a set
-only to find out it already exists, at which point we would have to delete it
-and return the node that already exists.
-</p>
-
-<p>To support this style of client, FoldingSet perform a query with a
-FoldingSetNodeID (which wraps SmallVector) that can be used to describe the
-element that we want to query for. The query either returns the element
-matching the ID or it returns an opaque ID that indicates where insertion should
-take place. Construction of the ID usually does not require heap traffic.</p>
-
-<p>Because FoldingSet uses intrusive links, it can support polymorphic objects
-in the set (for example, you can have SDNode instances mixed with LoadSDNodes).
-Because the elements are individually allocated, pointers to the elements are
-stable: inserting or removing elements does not invalidate any pointers to other
-elements.
-</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="dss_set">&lt;set&gt;</a>
-</div>
-
-<div class="doc_text">
-
-<p><tt>std::set</tt> is a reasonable all-around set class, which is decent at
-many things but great at nothing. std::set allocates memory for each element
-inserted (thus it is very malloc intensive) and typically stores three pointers
-per element in the set (thus adding a large amount of per-element space
-overhead). It offers guaranteed log(n) performance, which is not particularly
-fast from a complexity standpoint (particularly if the elements of the set are
-expensive to compare, like strings), and has extremely high constant factors for
-lookup, insertion and removal.</p>
-
-<p>The advantages of std::set are that its iterators are stable (deleting or
-inserting an element from the set does not affect iterators or pointers to other
-elements) and that iteration over the set is guaranteed to be in sorted order.
-If the elements in the set are large, then the relative overhead of the pointers
-and malloc traffic is not a big deal, but if the elements of the set are small,
-std::set is almost never a good choice.</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="dss_setvector">"llvm/ADT/SetVector.h"</a>
-</div>
-
-<div class="doc_text">
-<p>LLVM's SetVector&lt;Type&gt; is an adapter class that combines your choice of
-a set-like container along with a <a href="#ds_sequential">Sequential
-Container</a>. The important property
-that this provides is efficient insertion with uniquing (duplicate elements are
-ignored) with iteration support. It implements this by inserting elements into
-both a set-like container and the sequential container, using the set-like
-container for uniquing and the sequential container for iteration.
-</p>
-
-<p>The difference between SetVector and other sets is that the order of
-iteration is guaranteed to match the order of insertion into the SetVector.
-This property is really important for things like sets of pointers. Because
-pointer values are non-deterministic (e.g. vary across runs of the program on
-different machines), iterating over the pointers in the set will
-not be in a well-defined order.</p>
-
-<p>
-The drawback of SetVector is that it requires twice as much space as a normal
-set and has the sum of constant factors from the set-like container and the
-sequential container that it uses. Use it *only* if you need to iterate over
-the elements in a deterministic order. SetVector is also expensive to delete
-elements out of (linear time), unless you use it's "pop_back" method, which is
-faster.
-</p>
-
-<p>SetVector is an adapter class that defaults to using std::vector and std::set
-for the underlying containers, so it is quite expensive. However,
-<tt>"llvm/ADT/SetVector.h"</tt> also provides a SmallSetVector class, which
-defaults to using a SmallVector and SmallSet of a specified size. If you use
-this, and if your sets are dynamically smaller than N, you will save a lot of
-heap traffic.</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="dss_uniquevector">"llvm/ADT/UniqueVector.h"</a>
-</div>
-
-<div class="doc_text">
-
-<p>
-UniqueVector is similar to <a href="#dss_setvector">SetVector</a>, but it
-retains a unique ID for each element inserted into the set. It internally
-contains a map and a vector, and it assigns a unique ID for each value inserted
-into the set.</p>
-
-<p>UniqueVector is very expensive: its cost is the sum of the cost of
-maintaining both the map and vector, it has high complexity, high constant
-factors, and produces a lot of malloc traffic. It should be avoided.</p>
-
-</div>
-
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="dss_otherset">Other Set-Like Container Options</a>
-</div>
-
-<div class="doc_text">
-
-<p>
-The STL provides several other options, such as std::multiset and the various
-"hash_set" like containers (whether from C++ TR1 or from the SGI library).</p>
-
-<p>std::multiset is useful if you're not interested in elimination of
-duplicates, but has all the drawbacks of std::set. A sorted vector (where you
-don't delete duplicate entries) or some other approach is almost always
-better.</p>
-
-<p>The various hash_set implementations (exposed portably by
-"llvm/ADT/hash_set") is a simple chained hashtable. This algorithm is as malloc
-intensive as std::set (performing an allocation for each element inserted,
-thus having really high constant factors) but (usually) provides O(1)
-insertion/deletion of elements. This can be useful if your elements are large
-(thus making the constant-factor cost relatively low) or if comparisons are
-expensive. Element iteration does not visit elements in a useful order.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="ds_map">Map-Like Containers (std::map, DenseMap, etc)</a>
-</div>
-
-<div class="doc_text">
-Map-like containers are useful when you want to associate data to a key. As
-usual, there are a lot of different ways to do this. :)
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="dss_sortedvectormap">A sorted 'vector'</a>
-</div>
-
-<div class="doc_text">
-
-<p>
-If your usage pattern follows a strict insert-then-query approach, you can
-trivially use the same approach as <a href="#dss_sortedvectorset">sorted vectors
-for set-like containers</a>. The only difference is that your query function
-(which uses std::lower_bound to get efficient log(n) lookup) should only compare
-the key, not both the key and value. This yields the same advantages as sorted
-vectors for sets.
-</p>
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="dss_stringmap">"llvm/ADT/StringMap.h"</a>
-</div>
-
-<div class="doc_text">
-
-<p>
-Strings are commonly used as keys in maps, and they are difficult to support
-efficiently: they are variable length, inefficient to hash and compare when
-long, expensive to copy, etc. StringMap is a specialized container designed to
-cope with these issues. It supports mapping an arbitrary range of bytes to an
-arbitrary other object.</p>
-
-<p>The StringMap implementation uses a quadratically-probed hash table, where
-the buckets store a pointer to the heap allocated entries (and some other
-stuff). The entries in the map must be heap allocated because the strings are
-variable length. The string data (key) and the element object (value) are
-stored in the same allocation with the string data immediately after the element
-object. This container guarantees the "<tt>(char*)(&amp;Value+1)</tt>" points
-to the key string for a value.</p>
-
-<p>The StringMap is very fast for several reasons: quadratic probing is very
-cache efficient for lookups, the hash value of strings in buckets is not
-recomputed when lookup up an element, StringMap rarely has to touch the
-memory for unrelated objects when looking up a value (even when hash collisions
-happen), hash table growth does not recompute the hash values for strings
-already in the table, and each pair in the map is store in a single allocation
-(the string data is stored in the same allocation as the Value of a pair).</p>
-
-<p>StringMap also provides query methods that take byte ranges, so it only ever
-copies a string if a value is inserted into the table.</p>
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="dss_indexedmap">"llvm/ADT/IndexedMap.h"</a>
-</div>
-
-<div class="doc_text">
-<p>
-IndexedMap is a specialized container for mapping small dense integers (or
-values that can be mapped to small dense integers) to some other type. It is
-internally implemented as a vector with a mapping function that maps the keys to
-the dense integer range.
-</p>
-
-<p>
-This is useful for cases like virtual registers in the LLVM code generator: they
-have a dense mapping that is offset by a compile-time constant (the first
-virtual register ID).</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="dss_densemap">"llvm/ADT/DenseMap.h"</a>
-</div>
-
-<div class="doc_text">
-
-<p>
-DenseMap is a simple quadratically probed hash table. It excels at supporting
-small keys and values: it uses a single allocation to hold all of the pairs that
-are currently inserted in the map. DenseMap is a great way to map pointers to
-pointers, or map other small types to each other.
-</p>
-
-<p>
-There are several aspects of DenseMap that you should be aware of, however. The
-iterators in a densemap are invalidated whenever an insertion occurs, unlike
-map. Also, because DenseMap allocates space for a large number of key/value
-pairs (it starts with 64 by default), it will waste a lot of space if your keys
-or values are large. Finally, you must implement a partial specialization of
-DenseMapInfo for the key that you want, if it isn't already supported. This
-is required to tell DenseMap about two special marker values (which can never be
-inserted into the map) that it needs internally.</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="dss_map">&lt;map&gt;</a>
-</div>
-
-<div class="doc_text">
-
-<p>
-std::map has similar characteristics to <a href="#dss_set">std::set</a>: it uses
-a single allocation per pair inserted into the map, it offers log(n) lookup with
-an extremely large constant factor, imposes a space penalty of 3 pointers per
-pair in the map, etc.</p>
-
-<p>std::map is most useful when your keys or values are very large, if you need
-to iterate over the collection in sorted order, or if you need stable iterators
-into the map (i.e. they don't get invalidated if an insertion or deletion of
-another element takes place).</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="dss_othermap">Other Map-Like Container Options</a>
-</div>
-
-<div class="doc_text">
-
-<p>
-The STL provides several other options, such as std::multimap and the various
-"hash_map" like containers (whether from C++ TR1 or from the SGI library).</p>
-
-<p>std::multimap is useful if you want to map a key to multiple values, but has
-all the drawbacks of std::map. A sorted vector or some other approach is almost
-always better.</p>
-
-<p>The various hash_map implementations (exposed portably by
-"llvm/ADT/hash_map") are simple chained hash tables. This algorithm is as
-malloc intensive as std::map (performing an allocation for each element
-inserted, thus having really high constant factors) but (usually) provides O(1)
-insertion/deletion of elements. This can be useful if your elements are large
-(thus making the constant-factor cost relatively low) or if comparisons are
-expensive. Element iteration does not visit elements in a useful order.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="ds_bit">Bit storage containers (BitVector, SparseBitVector)</a>
-</div>
-
-<div class="doc_text">
-<p>Unlike the other containers, there are only two bit storage containers, and
-choosing when to use each is relatively straightforward.</p>
-
-<p>One additional option is
-<tt>std::vector&lt;bool&gt;</tt>: we discourage its use for two reasons 1) the
-implementation in many common compilers (e.g. commonly available versions of
-GCC) is extremely inefficient and 2) the C++ standards committee is likely to
-deprecate this container and/or change it significantly somehow. In any case,
-please don't use it.</p>
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="dss_bitvector">BitVector</a>
-</div>
-
-<div class="doc_text">
-<p> The BitVector container provides a fixed size set of bits for manipulation.
-It supports individual bit setting/testing, as well as set operations. The set
-operations take time O(size of bitvector), but operations are performed one word
-at a time, instead of one bit at a time. This makes the BitVector very fast for
-set operations compared to other containers. Use the BitVector when you expect
-the number of set bits to be high (IE a dense set).
-</p>
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="dss_sparsebitvector">SparseBitVector</a>
-</div>
-
-<div class="doc_text">
-<p> The SparseBitVector container is much like BitVector, with one major
-difference: Only the bits that are set, are stored. This makes the
-SparseBitVector much more space efficient than BitVector when the set is sparse,
-as well as making set operations O(number of set bits) instead of O(size of
-universe). The downside to the SparseBitVector is that setting and testing of random bits is O(N), and on large SparseBitVectors, this can be slower than BitVector. In our implementation, setting or testing bits in sorted order
-(either forwards or reverse) is O(1) worst case. Testing and setting bits within 128 bits (depends on size) of the current bit is also O(1). As a general statement, testing/setting bits in a SparseBitVector is O(distance away from last set bit).
-</p>
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section">
- <a name="common">Helpful Hints for Common Operations</a>
-</div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>This section describes how to perform some very simple transformations of
-LLVM code. This is meant to give examples of common idioms used, showing the
-practical side of LLVM transformations. <p> Because this is a "how-to" section,
-you should also read about the main classes that you will be working with. The
-<a href="#coreclasses">Core LLVM Class Hierarchy Reference</a> contains details
-and descriptions of the main classes that you should know about.</p>
-
-</div>
-
-<!-- NOTE: this section should be heavy on example code -->
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="inspection">Basic Inspection and Traversal Routines</a>
-</div>
-
-<div class="doc_text">
-
-<p>The LLVM compiler infrastructure have many different data structures that may
-be traversed. Following the example of the C++ standard template library, the
-techniques used to traverse these various data structures are all basically the
-same. For a enumerable sequence of values, the <tt>XXXbegin()</tt> function (or
-method) returns an iterator to the start of the sequence, the <tt>XXXend()</tt>
-function returns an iterator pointing to one past the last valid element of the
-sequence, and there is some <tt>XXXiterator</tt> data type that is common
-between the two operations.</p>
-
-<p>Because the pattern for iteration is common across many different aspects of
-the program representation, the standard template library algorithms may be used
-on them, and it is easier to remember how to iterate. First we show a few common
-examples of the data structures that need to be traversed. Other data
-structures are traversed in very similar ways.</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="iterate_function">Iterating over the </a><a
- href="#BasicBlock"><tt>BasicBlock</tt></a>s in a <a
- href="#Function"><tt>Function</tt></a>
-</div>
-
-<div class="doc_text">
-
-<p>It's quite common to have a <tt>Function</tt> instance that you'd like to
-transform in some way; in particular, you'd like to manipulate its
-<tt>BasicBlock</tt>s. To facilitate this, you'll need to iterate over all of
-the <tt>BasicBlock</tt>s that constitute the <tt>Function</tt>. The following is
-an example that prints the name of a <tt>BasicBlock</tt> and the number of
-<tt>Instruction</tt>s it contains:</p>
-
-<div class="doc_code">
-<pre>
-// <i>func is a pointer to a Function instance</i>
-for (Function::iterator i = func-&gt;begin(), e = func-&gt;end(); i != e; ++i)
- // <i>Print out the name of the basic block if it has one, and then the</i>
- // <i>number of instructions that it contains</i>
- llvm::cerr &lt;&lt; "Basic block (name=" &lt;&lt; i-&gt;getName() &lt;&lt; ") has "
- &lt;&lt; i-&gt;size() &lt;&lt; " instructions.\n";
-</pre>
-</div>
-
-<p>Note that i can be used as if it were a pointer for the purposes of
-invoking member functions of the <tt>Instruction</tt> class. This is
-because the indirection operator is overloaded for the iterator
-classes. In the above code, the expression <tt>i-&gt;size()</tt> is
-exactly equivalent to <tt>(*i).size()</tt> just like you'd expect.</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="iterate_basicblock">Iterating over the </a><a
- href="#Instruction"><tt>Instruction</tt></a>s in a <a
- href="#BasicBlock"><tt>BasicBlock</tt></a>
-</div>
-
-<div class="doc_text">
-
-<p>Just like when dealing with <tt>BasicBlock</tt>s in <tt>Function</tt>s, it's
-easy to iterate over the individual instructions that make up
-<tt>BasicBlock</tt>s. Here's a code snippet that prints out each instruction in
-a <tt>BasicBlock</tt>:</p>
-
-<div class="doc_code">
-<pre>
-// <i>blk is a pointer to a BasicBlock instance</i>
-for (BasicBlock::iterator i = blk-&gt;begin(), e = blk-&gt;end(); i != e; ++i)
- // <i>The next statement works since operator&lt;&lt;(ostream&amp;,...)</i>
- // <i>is overloaded for Instruction&amp;</i>
- llvm::cerr &lt;&lt; *i &lt;&lt; "\n";
-</pre>
-</div>
-
-<p>However, this isn't really the best way to print out the contents of a
-<tt>BasicBlock</tt>! Since the ostream operators are overloaded for virtually
-anything you'll care about, you could have just invoked the print routine on the
-basic block itself: <tt>llvm::cerr &lt;&lt; *blk &lt;&lt; "\n";</tt>.</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="iterate_institer">Iterating over the </a><a
- href="#Instruction"><tt>Instruction</tt></a>s in a <a
- href="#Function"><tt>Function</tt></a>
-</div>
-
-<div class="doc_text">
-
-<p>If you're finding that you commonly iterate over a <tt>Function</tt>'s
-<tt>BasicBlock</tt>s and then that <tt>BasicBlock</tt>'s <tt>Instruction</tt>s,
-<tt>InstIterator</tt> should be used instead. You'll need to include <a
-href="/doxygen/InstIterator_8h-source.html"><tt>llvm/Support/InstIterator.h</tt></a>,
-and then instantiate <tt>InstIterator</tt>s explicitly in your code. Here's a
-small example that shows how to dump all instructions in a function to the standard error stream:<p>
-
-<div class="doc_code">
-<pre>
-#include "<a href="/doxygen/InstIterator_8h-source.html">llvm/Support/InstIterator.h</a>"
-
-// <i>F is a pointer to a Function instance</i>
-for (inst_iterator i = inst_begin(F), e = inst_end(F); i != e; ++i)
- llvm::cerr &lt;&lt; *i &lt;&lt; "\n";
-</pre>
-</div>
-
-<p>Easy, isn't it? You can also use <tt>InstIterator</tt>s to fill a
-work list with its initial contents. For example, if you wanted to
-initialize a work list to contain all instructions in a <tt>Function</tt>
-F, all you would need to do is something like:</p>
-
-<div class="doc_code">
-<pre>
-std::set&lt;Instruction*&gt; worklist;
-worklist.insert(inst_begin(F), inst_end(F));
-</pre>
-</div>
-
-<p>The STL set <tt>worklist</tt> would now contain all instructions in the
-<tt>Function</tt> pointed to by F.</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="iterate_convert">Turning an iterator into a class pointer (and
- vice-versa)</a>
-</div>
-
-<div class="doc_text">
-
-<p>Sometimes, it'll be useful to grab a reference (or pointer) to a class
-instance when all you've got at hand is an iterator. Well, extracting
-a reference or a pointer from an iterator is very straight-forward.
-Assuming that <tt>i</tt> is a <tt>BasicBlock::iterator</tt> and <tt>j</tt>
-is a <tt>BasicBlock::const_iterator</tt>:</p>
-
-<div class="doc_code">
-<pre>
-Instruction&amp; inst = *i; // <i>Grab reference to instruction reference</i>
-Instruction* pinst = &amp;*i; // <i>Grab pointer to instruction reference</i>
-const Instruction&amp; inst = *j;
-</pre>
-</div>
-
-<p>However, the iterators you'll be working with in the LLVM framework are
-special: they will automatically convert to a ptr-to-instance type whenever they
-need to. Instead of dereferencing the iterator and then taking the address of
-the result, you can simply assign the iterator to the proper pointer type and
-you get the dereference and address-of operation as a result of the assignment
-(behind the scenes, this is a result of overloading casting mechanisms). Thus
-the last line of the last example,</p>
-
-<div class="doc_code">
-<pre>
-Instruction *pinst = &amp;*i;
-</pre>
-</div>
-
-<p>is semantically equivalent to</p>
-
-<div class="doc_code">
-<pre>
-Instruction *pinst = i;
-</pre>
-</div>
-
-<p>It's also possible to turn a class pointer into the corresponding iterator,
-and this is a constant time operation (very efficient). The following code
-snippet illustrates use of the conversion constructors provided by LLVM
-iterators. By using these, you can explicitly grab the iterator of something
-without actually obtaining it via iteration over some structure:</p>
-
-<div class="doc_code">
-<pre>
-void printNextInstruction(Instruction* inst) {
- BasicBlock::iterator it(inst);
- ++it; // <i>After this line, it refers to the instruction after *inst</i>
- if (it != inst-&gt;getParent()-&gt;end()) llvm::cerr &lt;&lt; *it &lt;&lt; "\n";
-}
-</pre>
-</div>
-
-</div>
-
-<!--_______________________________________________________________________-->
-<div class="doc_subsubsection">
- <a name="iterate_complex">Finding call sites: a slightly more complex
- example</a>
-</div>
-
-<div class="doc_text">
-
-<p>Say that you're writing a FunctionPass and would like to count all the
-locations in the entire module (that is, across every <tt>Function</tt>) where a
-certain function (i.e., some <tt>Function</tt>*) is already in scope. As you'll
-learn later, you may want to use an <tt>InstVisitor</tt> to accomplish this in a
-much more straight-forward manner, but this example will allow us to explore how
-you'd do it if you didn't have <tt>InstVisitor</tt> around. In pseudo-code, this
-is what we want to do:</p>
-
-<div class="doc_code">
-<pre>
-initialize callCounter to zero
-for each Function f in the Module
- for each BasicBlock b in f
- for each Instruction i in b
- if (i is a CallInst and calls the given function)
- increment callCounter
-</pre>
-</div>
-
-<p>And the actual code is (remember, because we're writing a
-<tt>FunctionPass</tt>, our <tt>FunctionPass</tt>-derived class simply has to
-override the <tt>runOnFunction</tt> method):</p>
-
-<div class="doc_code">
-<pre>
-Function* targetFunc = ...;
-
-class OurFunctionPass : public FunctionPass {
- public:
- OurFunctionPass(): callCounter(0) { }
-
- virtual runOnFunction(Function&amp; F) {
- for (Function::iterator b = F.begin(), be = F.end(); b != be; ++b) {
- for (BasicBlock::iterator i = b-&gt;begin(); ie = b-&gt;end(); i != ie; ++i) {
- if (<a href="#CallInst">CallInst</a>* callInst = <a href="#isa">dyn_cast</a>&lt;<a
- href="#CallInst">CallInst</a>&gt;(&amp;*i)) {
- // <i>We know we've encountered a call instruction, so we</i>
- // <i>need to determine if it's a call to the</i>
- // <i>function pointed to by m_func or not.</i>
- if (callInst-&gt;getCalledFunction() == targetFunc)
- ++callCounter;
- }
- }
- }
- }
-
- private:
- unsigned callCounter;
-};
-</pre>
-</div>
-
-</div>
-
-<!--_______________________________________________________________________-->
-<div class="doc_subsubsection">
- <a name="calls_and_invokes">Treating calls and invokes the same way</a>
-</div>
-
-<div class="doc_text">
-
-<p>You may have noticed that the previous example was a bit oversimplified in
-that it did not deal with call sites generated by 'invoke' instructions. In
-this, and in other situations, you may find that you want to treat
-<tt>CallInst</tt>s and <tt>InvokeInst</tt>s the same way, even though their
-most-specific common base class is <tt>Instruction</tt>, which includes lots of
-less closely-related things. For these cases, LLVM provides a handy wrapper
-class called <a
-href="http://llvm.org/doxygen/classllvm_1_1CallSite.html"><tt>CallSite</tt></a>.
-It is essentially a wrapper around an <tt>Instruction</tt> pointer, with some
-methods that provide functionality common to <tt>CallInst</tt>s and
-<tt>InvokeInst</tt>s.</p>
-
-<p>This class has "value semantics": it should be passed by value, not by
-reference and it should not be dynamically allocated or deallocated using
-<tt>operator new</tt> or <tt>operator delete</tt>. It is efficiently copyable,
-assignable and constructable, with costs equivalents to that of a bare pointer.
-If you look at its definition, it has only a single pointer member.</p>
-
-</div>
-
-<!--_______________________________________________________________________-->
-<div class="doc_subsubsection">
- <a name="iterate_chains">Iterating over def-use &amp; use-def chains</a>
-</div>
-
-<div class="doc_text">
-
-<p>Frequently, we might have an instance of the <a
-href="/doxygen/classllvm_1_1Value.html">Value Class</a> and we want to
-determine which <tt>User</tt>s use the <tt>Value</tt>. The list of all
-<tt>User</tt>s of a particular <tt>Value</tt> is called a <i>def-use</i> chain.
-For example, let's say we have a <tt>Function*</tt> named <tt>F</tt> to a
-particular function <tt>foo</tt>. Finding all of the instructions that
-<i>use</i> <tt>foo</tt> is as simple as iterating over the <i>def-use</i> chain
-of <tt>F</tt>:</p>
-
-<div class="doc_code">
-<pre>
-Function *F = ...;
-
-for (Value::use_iterator i = F-&gt;use_begin(), e = F-&gt;use_end(); i != e; ++i)
- if (Instruction *Inst = dyn_cast&lt;Instruction&gt;(*i)) {
- llvm::cerr &lt;&lt; "F is used in instruction:\n";
- llvm::cerr &lt;&lt; *Inst &lt;&lt; "\n";
- }
-</pre>
-</div>
-
-<p>Alternately, it's common to have an instance of the <a
-href="/doxygen/classllvm_1_1User.html">User Class</a> and need to know what
-<tt>Value</tt>s are used by it. The list of all <tt>Value</tt>s used by a
-<tt>User</tt> is known as a <i>use-def</i> chain. Instances of class
-<tt>Instruction</tt> are common <tt>User</tt>s, so we might want to iterate over
-all of the values that a particular instruction uses (that is, the operands of
-the particular <tt>Instruction</tt>):</p>
-
-<div class="doc_code">
-<pre>
-Instruction *pi = ...;
-
-for (User::op_iterator i = pi-&gt;op_begin(), e = pi-&gt;op_end(); i != e; ++i) {
- Value *v = *i;
- // <i>...</i>
-}
-</pre>
-</div>
-
-<!--
- def-use chains ("finding all users of"): Value::use_begin/use_end
- use-def chains ("finding all values used"): User::op_begin/op_end [op=operand]
--->
-
-</div>
-
-<!--_______________________________________________________________________-->
-<div class="doc_subsubsection">
- <a name="iterate_preds">Iterating over predecessors &amp;
-successors of blocks</a>
-</div>
-
-<div class="doc_text">
-
-<p>Iterating over the predecessors and successors of a block is quite easy
-with the routines defined in <tt>"llvm/Support/CFG.h"</tt>. Just use code like
-this to iterate over all predecessors of BB:</p>
-
-<div class="doc_code">
-<pre>
-#include "llvm/Support/CFG.h"
-BasicBlock *BB = ...;
-
-for (pred_iterator PI = pred_begin(BB), E = pred_end(BB); PI != E; ++PI) {
- BasicBlock *Pred = *PI;
- // <i>...</i>
-}
-</pre>
-</div>
-
-<p>Similarly, to iterate over successors use
-succ_iterator/succ_begin/succ_end.</p>
-
-</div>
-
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="simplechanges">Making simple changes</a>
-</div>
-
-<div class="doc_text">
-
-<p>There are some primitive transformation operations present in the LLVM
-infrastructure that are worth knowing about. When performing
-transformations, it's fairly common to manipulate the contents of basic
-blocks. This section describes some of the common methods for doing so
-and gives example code.</p>
-
-</div>
-
-<!--_______________________________________________________________________-->
-<div class="doc_subsubsection">
- <a name="schanges_creating">Creating and inserting new
- <tt>Instruction</tt>s</a>
-</div>
-
-<div class="doc_text">
-
-<p><i>Instantiating Instructions</i></p>
-
-<p>Creation of <tt>Instruction</tt>s is straight-forward: simply call the
-constructor for the kind of instruction to instantiate and provide the necessary
-parameters. For example, an <tt>AllocaInst</tt> only <i>requires</i> a
-(const-ptr-to) <tt>Type</tt>. Thus:</p>
-
-<div class="doc_code">
-<pre>
-AllocaInst* ai = new AllocaInst(Type::Int32Ty);
-</pre>
-</div>
-
-<p>will create an <tt>AllocaInst</tt> instance that represents the allocation of
-one integer in the current stack frame, at run time. Each <tt>Instruction</tt>
-subclass is likely to have varying default parameters which change the semantics
-of the instruction, so refer to the <a
-href="/doxygen/classllvm_1_1Instruction.html">doxygen documentation for the subclass of
-Instruction</a> that you're interested in instantiating.</p>
-
-<p><i>Naming values</i></p>
-
-<p>It is very useful to name the values of instructions when you're able to, as
-this facilitates the debugging of your transformations. If you end up looking
-at generated LLVM machine code, you definitely want to have logical names
-associated with the results of instructions! By supplying a value for the
-<tt>Name</tt> (default) parameter of the <tt>Instruction</tt> constructor, you
-associate a logical name with the result of the instruction's execution at
-run time. For example, say that I'm writing a transformation that dynamically
-allocates space for an integer on the stack, and that integer is going to be
-used as some kind of index by some other code. To accomplish this, I place an
-<tt>AllocaInst</tt> at the first point in the first <tt>BasicBlock</tt> of some
-<tt>Function</tt>, and I'm intending to use it within the same
-<tt>Function</tt>. I might do:</p>
-
-<div class="doc_code">
-<pre>
-AllocaInst* pa = new AllocaInst(Type::Int32Ty, 0, "indexLoc");
-</pre>
-</div>
-
-<p>where <tt>indexLoc</tt> is now the logical name of the instruction's
-execution value, which is a pointer to an integer on the run time stack.</p>
-
-<p><i>Inserting instructions</i></p>
-
-<p>There are essentially two ways to insert an <tt>Instruction</tt>
-into an existing sequence of instructions that form a <tt>BasicBlock</tt>:</p>
-
-<ul>
- <li>Insertion into an explicit instruction list
-
- <p>Given a <tt>BasicBlock* pb</tt>, an <tt>Instruction* pi</tt> within that
- <tt>BasicBlock</tt>, and a newly-created instruction we wish to insert
- before <tt>*pi</tt>, we do the following: </p>
-
-<div class="doc_code">
-<pre>
-BasicBlock *pb = ...;
-Instruction *pi = ...;
-Instruction *newInst = new Instruction(...);
-
-pb-&gt;getInstList().insert(pi, newInst); // <i>Inserts newInst before pi in pb</i>
-</pre>
-</div>
-
- <p>Appending to the end of a <tt>BasicBlock</tt> is so common that
- the <tt>Instruction</tt> class and <tt>Instruction</tt>-derived
- classes provide constructors which take a pointer to a
- <tt>BasicBlock</tt> to be appended to. For example code that
- looked like: </p>
-
-<div class="doc_code">
-<pre>
-BasicBlock *pb = ...;
-Instruction *newInst = new Instruction(...);
-
-pb-&gt;getInstList().push_back(newInst); // <i>Appends newInst to pb</i>
-</pre>
-</div>
-
- <p>becomes: </p>
-
-<div class="doc_code">
-<pre>
-BasicBlock *pb = ...;
-Instruction *newInst = new Instruction(..., pb);
-</pre>
-</div>
-
- <p>which is much cleaner, especially if you are creating
- long instruction streams.</p></li>
-
- <li>Insertion into an implicit instruction list
-
- <p><tt>Instruction</tt> instances that are already in <tt>BasicBlock</tt>s
- are implicitly associated with an existing instruction list: the instruction
- list of the enclosing basic block. Thus, we could have accomplished the same
- thing as the above code without being given a <tt>BasicBlock</tt> by doing:
- </p>
-
-<div class="doc_code">
-<pre>
-Instruction *pi = ...;
-Instruction *newInst = new Instruction(...);
-
-pi-&gt;getParent()-&gt;getInstList().insert(pi, newInst);
-</pre>
-</div>
-
- <p>In fact, this sequence of steps occurs so frequently that the
- <tt>Instruction</tt> class and <tt>Instruction</tt>-derived classes provide
- constructors which take (as a default parameter) a pointer to an
- <tt>Instruction</tt> which the newly-created <tt>Instruction</tt> should
- precede. That is, <tt>Instruction</tt> constructors are capable of
- inserting the newly-created instance into the <tt>BasicBlock</tt> of a
- provided instruction, immediately before that instruction. Using an
- <tt>Instruction</tt> constructor with a <tt>insertBefore</tt> (default)
- parameter, the above code becomes:</p>
-
-<div class="doc_code">
-<pre>
-Instruction* pi = ...;
-Instruction* newInst = new Instruction(..., pi);
-</pre>
-</div>
-
- <p>which is much cleaner, especially if you're creating a lot of
- instructions and adding them to <tt>BasicBlock</tt>s.</p></li>
-</ul>
-
-</div>
-
-<!--_______________________________________________________________________-->
-<div class="doc_subsubsection">
- <a name="schanges_deleting">Deleting <tt>Instruction</tt>s</a>
-</div>
-
-<div class="doc_text">
-
-<p>Deleting an instruction from an existing sequence of instructions that form a
-<a href="#BasicBlock"><tt>BasicBlock</tt></a> is very straight-forward. First,
-you must have a pointer to the instruction that you wish to delete. Second, you
-need to obtain the pointer to that instruction's basic block. You use the
-pointer to the basic block to get its list of instructions and then use the
-erase function to remove your instruction. For example:</p>
-
-<div class="doc_code">
-<pre>
-<a href="#Instruction">Instruction</a> *I = .. ;
-I-&gt;eraseFromParent();
-</pre>
-</div>
-
-</div>
-
-<!--_______________________________________________________________________-->
-<div class="doc_subsubsection">
- <a name="schanges_replacing">Replacing an <tt>Instruction</tt> with another
- <tt>Value</tt></a>
-</div>
-
-<div class="doc_text">
-
-<p><i>Replacing individual instructions</i></p>
-
-<p>Including "<a href="/doxygen/BasicBlockUtils_8h-source.html">llvm/Transforms/Utils/BasicBlockUtils.h</a>"
-permits use of two very useful replace functions: <tt>ReplaceInstWithValue</tt>
-and <tt>ReplaceInstWithInst</tt>.</p>
-
-<h4><a name="schanges_deleting">Deleting <tt>Instruction</tt>s</a></h4>
-
-<ul>
- <li><tt>ReplaceInstWithValue</tt>
-
- <p>This function replaces all uses (within a basic block) of a given
- instruction with a value, and then removes the original instruction. The
- following example illustrates the replacement of the result of a particular
- <tt>AllocaInst</tt> that allocates memory for a single integer with a null
- pointer to an integer.</p>
-
-<div class="doc_code">
-<pre>
-AllocaInst* instToReplace = ...;
-BasicBlock::iterator ii(instToReplace);
-
-ReplaceInstWithValue(instToReplace-&gt;getParent()-&gt;getInstList(), ii,
- Constant::getNullValue(PointerType::get(Type::Int32Ty)));
-</pre></div></li>
-
- <li><tt>ReplaceInstWithInst</tt>
-
- <p>This function replaces a particular instruction with another
- instruction. The following example illustrates the replacement of one
- <tt>AllocaInst</tt> with another.</p>
-
-<div class="doc_code">
-<pre>
-AllocaInst* instToReplace = ...;
-BasicBlock::iterator ii(instToReplace);
-
-ReplaceInstWithInst(instToReplace-&gt;getParent()-&gt;getInstList(), ii,
- new AllocaInst(Type::Int32Ty, 0, "ptrToReplacedInt"));
-</pre></div></li>
-</ul>
-
-<p><i>Replacing multiple uses of <tt>User</tt>s and <tt>Value</tt>s</i></p>
-
-<p>You can use <tt>Value::replaceAllUsesWith</tt> and
-<tt>User::replaceUsesOfWith</tt> to change more than one use at a time. See the
-doxygen documentation for the <a href="/doxygen/classllvm_1_1Value.html">Value Class</a>
-and <a href="/doxygen/classllvm_1_1User.html">User Class</a>, respectively, for more
-information.</p>
-
-<!-- Value::replaceAllUsesWith User::replaceUsesOfWith Point out:
-include/llvm/Transforms/Utils/ especially BasicBlockUtils.h with:
-ReplaceInstWithValue, ReplaceInstWithInst -->
-
-</div>
-
-<!--_______________________________________________________________________-->
-<div class="doc_subsubsection">
- <a name="schanges_deletingGV">Deleting <tt>GlobalVariable</tt>s</a>
-</div>
-
-<div class="doc_text">
-
-<p>Deleting a global variable from a module is just as easy as deleting an
-Instruction. First, you must have a pointer to the global variable that you wish
- to delete. You use this pointer to erase it from its parent, the module.
- For example:</p>
-
-<div class="doc_code">
-<pre>
-<a href="#GlobalVariable">GlobalVariable</a> *GV = .. ;
-
-GV-&gt;eraseFromParent();
-</pre>
-</div>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section">
- <a name="advanced">Advanced Topics</a>
-</div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-<p>
-This section describes some of the advanced or obscure API's that most clients
-do not need to be aware of. These API's tend manage the inner workings of the
-LLVM system, and only need to be accessed in unusual circumstances.
-</p>
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="TypeResolve">LLVM Type Resolution</a>
-</div>
-
-<div class="doc_text">
-
-<p>
-The LLVM type system has a very simple goal: allow clients to compare types for
-structural equality with a simple pointer comparison (aka a shallow compare).
-This goal makes clients much simpler and faster, and is used throughout the LLVM
-system.
-</p>
-
-<p>
-Unfortunately achieving this goal is not a simple matter. In particular,
-recursive types and late resolution of opaque types makes the situation very
-difficult to handle. Fortunately, for the most part, our implementation makes
-most clients able to be completely unaware of the nasty internal details. The
-primary case where clients are exposed to the inner workings of it are when
-building a recursive type. In addition to this case, the LLVM bitcode reader,
-assembly parser, and linker also have to be aware of the inner workings of this
-system.
-</p>
-
-<p>
-For our purposes below, we need three concepts. First, an "Opaque Type" is
-exactly as defined in the <a href="LangRef.html#t_opaque">language
-reference</a>. Second an "Abstract Type" is any type which includes an
-opaque type as part of its type graph (for example "<tt>{ opaque, i32 }</tt>").
-Third, a concrete type is a type that is not an abstract type (e.g. "<tt>{ i32,
-float }</tt>").
-</p>
-
-</div>
-
-<!-- ______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="BuildRecType">Basic Recursive Type Construction</a>
-</div>
-
-<div class="doc_text">
-
-<p>
-Because the most common question is "how do I build a recursive type with LLVM",
-we answer it now and explain it as we go. Here we include enough to cause this
-to be emitted to an output .ll file:
-</p>
-
-<div class="doc_code">
-<pre>
-%mylist = type { %mylist*, i32 }
-</pre>
-</div>
-
-<p>
-To build this, use the following LLVM APIs:
-</p>
-
-<div class="doc_code">
-<pre>
-// <i>Create the initial outer struct</i>
-<a href="#PATypeHolder">PATypeHolder</a> StructTy = OpaqueType::get();
-std::vector&lt;const Type*&gt; Elts;
-Elts.push_back(PointerType::get(StructTy));
-Elts.push_back(Type::Int32Ty);
-StructType *NewSTy = StructType::get(Elts);
-
-// <i>At this point, NewSTy = "{ opaque*, i32 }". Tell VMCore that</i>
-// <i>the struct and the opaque type are actually the same.</i>
-cast&lt;OpaqueType&gt;(StructTy.get())-&gt;<a href="#refineAbstractTypeTo">refineAbstractTypeTo</a>(NewSTy);
-
-// <i>NewSTy is potentially invalidated, but StructTy (a <a href="#PATypeHolder">PATypeHolder</a>) is</i>
-// <i>kept up-to-date</i>
-NewSTy = cast&lt;StructType&gt;(StructTy.get());
-
-// <i>Add a name for the type to the module symbol table (optional)</i>
-MyModule-&gt;addTypeName("mylist", NewSTy);
-</pre>
-</div>
-
-<p>
-This code shows the basic approach used to build recursive types: build a
-non-recursive type using 'opaque', then use type unification to close the cycle.
-The type unification step is performed by the <tt><a
-href="#refineAbstractTypeTo">refineAbstractTypeTo</a></tt> method, which is
-described next. After that, we describe the <a
-href="#PATypeHolder">PATypeHolder class</a>.
-</p>
-
-</div>
-
-<!-- ______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="refineAbstractTypeTo">The <tt>refineAbstractTypeTo</tt> method</a>
-</div>
-
-<div class="doc_text">
-<p>
-The <tt>refineAbstractTypeTo</tt> method starts the type unification process.
-While this method is actually a member of the DerivedType class, it is most
-often used on OpaqueType instances. Type unification is actually a recursive
-process. After unification, types can become structurally isomorphic to
-existing types, and all duplicates are deleted (to preserve pointer equality).
-</p>
-
-<p>
-In the example above, the OpaqueType object is definitely deleted.
-Additionally, if there is an "{ \2*, i32}" type already created in the system,
-the pointer and struct type created are <b>also</b> deleted. Obviously whenever
-a type is deleted, any "Type*" pointers in the program are invalidated. As
-such, it is safest to avoid having <i>any</i> "Type*" pointers to abstract types
-live across a call to <tt>refineAbstractTypeTo</tt> (note that non-abstract
-types can never move or be deleted). To deal with this, the <a
-href="#PATypeHolder">PATypeHolder</a> class is used to maintain a stable
-reference to a possibly refined type, and the <a
-href="#AbstractTypeUser">AbstractTypeUser</a> class is used to update more
-complex datastructures.
-</p>
-
-</div>
-
-<!-- ______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="PATypeHolder">The PATypeHolder Class</a>
-</div>
-
-<div class="doc_text">
-<p>
-PATypeHolder is a form of a "smart pointer" for Type objects. When VMCore
-happily goes about nuking types that become isomorphic to existing types, it
-automatically updates all PATypeHolder objects to point to the new type. In the
-example above, this allows the code to maintain a pointer to the resultant
-resolved recursive type, even though the Type*'s are potentially invalidated.
-</p>
-
-<p>
-PATypeHolder is an extremely light-weight object that uses a lazy union-find
-implementation to update pointers. For example the pointer from a Value to its
-Type is maintained by PATypeHolder objects.
-</p>
-
-</div>
-
-<!-- ______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="AbstractTypeUser">The AbstractTypeUser Class</a>
-</div>
-
-<div class="doc_text">
-
-<p>
-Some data structures need more to perform more complex updates when types get
-resolved. To support this, a class can derive from the AbstractTypeUser class.
-This class
-allows it to get callbacks when certain types are resolved. To register to get
-callbacks for a particular type, the DerivedType::{add/remove}AbstractTypeUser
-methods can be called on a type. Note that these methods only work for <i>
- abstract</i> types. Concrete types (those that do not include any opaque
-objects) can never be refined.
-</p>
-</div>
-
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="SymbolTable">The <tt>ValueSymbolTable</tt> and
- <tt>TypeSymbolTable</tt> classes</a>
-</div>
-
-<div class="doc_text">
-<p>The <tt><a href="http://llvm.org/doxygen/classllvm_1_1ValueSymbolTable.html">
-ValueSymbolTable</a></tt> class provides a symbol table that the <a
-href="#Function"><tt>Function</tt></a> and <a href="#Module">
-<tt>Module</tt></a> classes use for naming value definitions. The symbol table
-can provide a name for any <a href="#Value"><tt>Value</tt></a>.
-The <tt><a href="http://llvm.org/doxygen/classllvm_1_1TypeSymbolTable.html">
-TypeSymbolTable</a></tt> class is used by the <tt>Module</tt> class to store
-names for types.</p>
-
-<p>Note that the <tt>SymbolTable</tt> class should not be directly accessed
-by most clients. It should only be used when iteration over the symbol table
-names themselves are required, which is very special purpose. Note that not
-all LLVM
-<a href="#Value">Value</a>s have names, and those without names (i.e. they have
-an empty name) do not exist in the symbol table.
-</p>
-
-<p>These symbol tables support iteration over the values/types in the symbol
-table with <tt>begin/end/iterator</tt> and supports querying to see if a
-specific name is in the symbol table (with <tt>lookup</tt>). The
-<tt>ValueSymbolTable</tt> class exposes no public mutator methods, instead,
-simply call <tt>setName</tt> on a value, which will autoinsert it into the
-appropriate symbol table. For types, use the Module::addTypeName method to
-insert entries into the symbol table.</p>
-
-</div>
-
-
-
-<!-- *********************************************************************** -->
-<div class="doc_section">
- <a name="coreclasses">The Core LLVM Class Hierarchy Reference </a>
-</div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-<p><tt>#include "<a href="/doxygen/Type_8h-source.html">llvm/Type.h</a>"</tt>
-<br>doxygen info: <a href="/doxygen/classllvm_1_1Type.html">Type Class</a></p>
-
-<p>The Core LLVM classes are the primary means of representing the program
-being inspected or transformed. The core LLVM classes are defined in
-header files in the <tt>include/llvm/</tt> directory, and implemented in
-the <tt>lib/VMCore</tt> directory.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="Type">The <tt>Type</tt> class and Derived Types</a>
-</div>
-
-<div class="doc_text">
-
- <p><tt>Type</tt> is a superclass of all type classes. Every <tt>Value</tt> has
- a <tt>Type</tt>. <tt>Type</tt> cannot be instantiated directly but only
- through its subclasses. Certain primitive types (<tt>VoidType</tt>,
- <tt>LabelType</tt>, <tt>FloatType</tt> and <tt>DoubleType</tt>) have hidden
- subclasses. They are hidden because they offer no useful functionality beyond
- what the <tt>Type</tt> class offers except to distinguish themselves from
- other subclasses of <tt>Type</tt>.</p>
- <p>All other types are subclasses of <tt>DerivedType</tt>. Types can be
- named, but this is not a requirement. There exists exactly
- one instance of a given shape at any one time. This allows type equality to
- be performed with address equality of the Type Instance. That is, given two
- <tt>Type*</tt> values, the types are identical if the pointers are identical.
- </p>
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="m_Value">Important Public Methods</a>
-</div>
-
-<div class="doc_text">
-
-<ul>
- <li><tt>bool isInteger() const</tt>: Returns true for any integer type.</li>
-
- <li><tt>bool isFloatingPoint()</tt>: Return true if this is one of the two
- floating point types.</li>
-
- <li><tt>bool isAbstract()</tt>: Return true if the type is abstract (contains
- an OpaqueType anywhere in its definition).</li>
-
- <li><tt>bool isSized()</tt>: Return true if the type has known size. Things
- that don't have a size are abstract types, labels and void.</li>
-
-</ul>
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="m_Value">Important Derived Types</a>
-</div>
-<div class="doc_text">
-<dl>
- <dt><tt>IntegerType</tt></dt>
- <dd>Subclass of DerivedType that represents integer types of any bit width.
- Any bit width between <tt>IntegerType::MIN_INT_BITS</tt> (1) and
- <tt>IntegerType::MAX_INT_BITS</tt> (~8 million) can be represented.
- <ul>
- <li><tt>static const IntegerType* get(unsigned NumBits)</tt>: get an integer
- type of a specific bit width.</li>
- <li><tt>unsigned getBitWidth() const</tt>: Get the bit width of an integer
- type.</li>
- </ul>
- </dd>
- <dt><tt>SequentialType</tt></dt>
- <dd>This is subclassed by ArrayType and PointerType
- <ul>
- <li><tt>const Type * getElementType() const</tt>: Returns the type of each
- of the elements in the sequential type. </li>
- </ul>
- </dd>
- <dt><tt>ArrayType</tt></dt>
- <dd>This is a subclass of SequentialType and defines the interface for array
- types.
- <ul>
- <li><tt>unsigned getNumElements() const</tt>: Returns the number of
- elements in the array. </li>
- </ul>
- </dd>
- <dt><tt>PointerType</tt></dt>
- <dd>Subclass of SequentialType for pointer types.</dd>
- <dt><tt>VectorType</tt></dt>
- <dd>Subclass of SequentialType for vector types. A
- vector type is similar to an ArrayType but is distinguished because it is
- a first class type wherease ArrayType is not. Vector types are used for
- vector operations and are usually small vectors of of an integer or floating
- point type.</dd>
- <dt><tt>StructType</tt></dt>
- <dd>Subclass of DerivedTypes for struct types.</dd>
- <dt><tt><a name="FunctionType">FunctionType</a></tt></dt>
- <dd>Subclass of DerivedTypes for function types.
- <ul>
- <li><tt>bool isVarArg() const</tt>: Returns true if its a vararg
- function</li>
- <li><tt> const Type * getReturnType() const</tt>: Returns the
- return type of the function.</li>
- <li><tt>const Type * getParamType (unsigned i)</tt>: Returns
- the type of the ith parameter.</li>
- <li><tt> const unsigned getNumParams() const</tt>: Returns the
- number of formal parameters.</li>
- </ul>
- </dd>
- <dt><tt>OpaqueType</tt></dt>
- <dd>Sublcass of DerivedType for abstract types. This class
- defines no content and is used as a placeholder for some other type. Note
- that OpaqueType is used (temporarily) during type resolution for forward
- references of types. Once the referenced type is resolved, the OpaqueType
- is replaced with the actual type. OpaqueType can also be used for data
- abstraction. At link time opaque types can be resolved to actual types
- of the same name.</dd>
-</dl>
-</div>
-
-
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="Module">The <tt>Module</tt> class</a>
-</div>
-
-<div class="doc_text">
-
-<p><tt>#include "<a
-href="/doxygen/Module_8h-source.html">llvm/Module.h</a>"</tt><br> doxygen info:
-<a href="/doxygen/classllvm_1_1Module.html">Module Class</a></p>
-
-<p>The <tt>Module</tt> class represents the top level structure present in LLVM
-programs. An LLVM module is effectively either a translation unit of the
-original program or a combination of several translation units merged by the
-linker. The <tt>Module</tt> class keeps track of a list of <a
-href="#Function"><tt>Function</tt></a>s, a list of <a
-href="#GlobalVariable"><tt>GlobalVariable</tt></a>s, and a <a
-href="#SymbolTable"><tt>SymbolTable</tt></a>. Additionally, it contains a few
-helpful member functions that try to make common operations easy.</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="m_Module">Important Public Members of the <tt>Module</tt> class</a>
-</div>
-
-<div class="doc_text">
-
-<ul>
- <li><tt>Module::Module(std::string name = "")</tt></li>
-</ul>
-
-<p>Constructing a <a href="#Module">Module</a> is easy. You can optionally
-provide a name for it (probably based on the name of the translation unit).</p>
-
-<ul>
- <li><tt>Module::iterator</tt> - Typedef for function list iterator<br>
- <tt>Module::const_iterator</tt> - Typedef for const_iterator.<br>
-
- <tt>begin()</tt>, <tt>end()</tt>
- <tt>size()</tt>, <tt>empty()</tt>
-
- <p>These are forwarding methods that make it easy to access the contents of
- a <tt>Module</tt> object's <a href="#Function"><tt>Function</tt></a>
- list.</p></li>
-
- <li><tt>Module::FunctionListType &amp;getFunctionList()</tt>
-
- <p> Returns the list of <a href="#Function"><tt>Function</tt></a>s. This is
- necessary to use when you need to update the list or perform a complex
- action that doesn't have a forwarding method.</p>
-
- <p><!-- Global Variable --></p></li>
-</ul>
-
-<hr>
-
-<ul>
- <li><tt>Module::global_iterator</tt> - Typedef for global variable list iterator<br>
-
- <tt>Module::const_global_iterator</tt> - Typedef for const_iterator.<br>
-
- <tt>global_begin()</tt>, <tt>global_end()</tt>
- <tt>global_size()</tt>, <tt>global_empty()</tt>
-
- <p> These are forwarding methods that make it easy to access the contents of
- a <tt>Module</tt> object's <a
- href="#GlobalVariable"><tt>GlobalVariable</tt></a> list.</p></li>
-
- <li><tt>Module::GlobalListType &amp;getGlobalList()</tt>
-
- <p>Returns the list of <a
- href="#GlobalVariable"><tt>GlobalVariable</tt></a>s. This is necessary to
- use when you need to update the list or perform a complex action that
- doesn't have a forwarding method.</p>
-
- <p><!-- Symbol table stuff --> </p></li>
-</ul>
-
-<hr>
-
-<ul>
- <li><tt><a href="#SymbolTable">SymbolTable</a> *getSymbolTable()</tt>
-
- <p>Return a reference to the <a href="#SymbolTable"><tt>SymbolTable</tt></a>
- for this <tt>Module</tt>.</p>
-
- <p><!-- Convenience methods --></p></li>
-</ul>
-
-<hr>
-
-<ul>
- <li><tt><a href="#Function">Function</a> *getFunction(const std::string
- &amp;Name, const <a href="#FunctionType">FunctionType</a> *Ty)</tt>
-
- <p>Look up the specified function in the <tt>Module</tt> <a
- href="#SymbolTable"><tt>SymbolTable</tt></a>. If it does not exist, return
- <tt>null</tt>.</p></li>
-
- <li><tt><a href="#Function">Function</a> *getOrInsertFunction(const
- std::string &amp;Name, const <a href="#FunctionType">FunctionType</a> *T)</tt>
-
- <p>Look up the specified function in the <tt>Module</tt> <a
- href="#SymbolTable"><tt>SymbolTable</tt></a>. If it does not exist, add an
- external declaration for the function and return it.</p></li>
-
- <li><tt>std::string getTypeName(const <a href="#Type">Type</a> *Ty)</tt>
-
- <p>If there is at least one entry in the <a
- href="#SymbolTable"><tt>SymbolTable</tt></a> for the specified <a
- href="#Type"><tt>Type</tt></a>, return it. Otherwise return the empty
- string.</p></li>
-
- <li><tt>bool addTypeName(const std::string &amp;Name, const <a
- href="#Type">Type</a> *Ty)</tt>
-
- <p>Insert an entry in the <a href="#SymbolTable"><tt>SymbolTable</tt></a>
- mapping <tt>Name</tt> to <tt>Ty</tt>. If there is already an entry for this
- name, true is returned and the <a
- href="#SymbolTable"><tt>SymbolTable</tt></a> is not modified.</p></li>
-</ul>
-
-</div>
-
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="Value">The <tt>Value</tt> class</a>
-</div>
-
-<div class="doc_text">
-
-<p><tt>#include "<a href="/doxygen/Value_8h-source.html">llvm/Value.h</a>"</tt>
-<br>
-doxygen info: <a href="/doxygen/classllvm_1_1Value.html">Value Class</a></p>
-
-<p>The <tt>Value</tt> class is the most important class in the LLVM Source
-base. It represents a typed value that may be used (among other things) as an
-operand to an instruction. There are many different types of <tt>Value</tt>s,
-such as <a href="#Constant"><tt>Constant</tt></a>s,<a
-href="#Argument"><tt>Argument</tt></a>s. Even <a
-href="#Instruction"><tt>Instruction</tt></a>s and <a
-href="#Function"><tt>Function</tt></a>s are <tt>Value</tt>s.</p>
-
-<p>A particular <tt>Value</tt> may be used many times in the LLVM representation
-for a program. For example, an incoming argument to a function (represented
-with an instance of the <a href="#Argument">Argument</a> class) is "used" by
-every instruction in the function that references the argument. To keep track
-of this relationship, the <tt>Value</tt> class keeps a list of all of the <a
-href="#User"><tt>User</tt></a>s that is using it (the <a
-href="#User"><tt>User</tt></a> class is a base class for all nodes in the LLVM
-graph that can refer to <tt>Value</tt>s). This use list is how LLVM represents
-def-use information in the program, and is accessible through the <tt>use_</tt>*
-methods, shown below.</p>
-
-<p>Because LLVM is a typed representation, every LLVM <tt>Value</tt> is typed,
-and this <a href="#Type">Type</a> is available through the <tt>getType()</tt>
-method. In addition, all LLVM values can be named. The "name" of the
-<tt>Value</tt> is a symbolic string printed in the LLVM code:</p>
-
-<div class="doc_code">
-<pre>
-%<b>foo</b> = add i32 1, 2
-</pre>
-</div>
-
-<p><a name="nameWarning">The name of this instruction is "foo".</a> <b>NOTE</b>
-that the name of any value may be missing (an empty string), so names should
-<b>ONLY</b> be used for debugging (making the source code easier to read,
-debugging printouts), they should not be used to keep track of values or map
-between them. For this purpose, use a <tt>std::map</tt> of pointers to the
-<tt>Value</tt> itself instead.</p>
-
-<p>One important aspect of LLVM is that there is no distinction between an SSA
-variable and the operation that produces it. Because of this, any reference to
-the value produced by an instruction (or the value available as an incoming
-argument, for example) is represented as a direct pointer to the instance of
-the class that
-represents this value. Although this may take some getting used to, it
-simplifies the representation and makes it easier to manipulate.</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="m_Value">Important Public Members of the <tt>Value</tt> class</a>
-</div>
-
-<div class="doc_text">
-
-<ul>
- <li><tt>Value::use_iterator</tt> - Typedef for iterator over the
-use-list<br>
- <tt>Value::use_const_iterator</tt> - Typedef for const_iterator over
-the use-list<br>
- <tt>unsigned use_size()</tt> - Returns the number of users of the
-value.<br>
- <tt>bool use_empty()</tt> - Returns true if there are no users.<br>
- <tt>use_iterator use_begin()</tt> - Get an iterator to the start of
-the use-list.<br>
- <tt>use_iterator use_end()</tt> - Get an iterator to the end of the
-use-list.<br>
- <tt><a href="#User">User</a> *use_back()</tt> - Returns the last
-element in the list.
- <p> These methods are the interface to access the def-use
-information in LLVM. As with all other iterators in LLVM, the naming
-conventions follow the conventions defined by the <a href="#stl">STL</a>.</p>
- </li>
- <li><tt><a href="#Type">Type</a> *getType() const</tt>
- <p>This method returns the Type of the Value.</p>
- </li>
- <li><tt>bool hasName() const</tt><br>
- <tt>std::string getName() const</tt><br>
- <tt>void setName(const std::string &amp;Name)</tt>
- <p> This family of methods is used to access and assign a name to a <tt>Value</tt>,
-be aware of the <a href="#nameWarning">precaution above</a>.</p>
- </li>
- <li><tt>void replaceAllUsesWith(Value *V)</tt>
-
- <p>This method traverses the use list of a <tt>Value</tt> changing all <a
- href="#User"><tt>User</tt>s</a> of the current value to refer to
- "<tt>V</tt>" instead. For example, if you detect that an instruction always
- produces a constant value (for example through constant folding), you can
- replace all uses of the instruction with the constant like this:</p>
-
-<div class="doc_code">
-<pre>
-Inst-&gt;replaceAllUsesWith(ConstVal);
-</pre>
-</div>
-
-</ul>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="User">The <tt>User</tt> class</a>
-</div>
-
-<div class="doc_text">
-
-<p>
-<tt>#include "<a href="/doxygen/User_8h-source.html">llvm/User.h</a>"</tt><br>
-doxygen info: <a href="/doxygen/classllvm_1_1User.html">User Class</a><br>
-Superclass: <a href="#Value"><tt>Value</tt></a></p>
-
-<p>The <tt>User</tt> class is the common base class of all LLVM nodes that may
-refer to <a href="#Value"><tt>Value</tt></a>s. It exposes a list of "Operands"
-that are all of the <a href="#Value"><tt>Value</tt></a>s that the User is
-referring to. The <tt>User</tt> class itself is a subclass of
-<tt>Value</tt>.</p>
-
-<p>The operands of a <tt>User</tt> point directly to the LLVM <a
-href="#Value"><tt>Value</tt></a> that it refers to. Because LLVM uses Static
-Single Assignment (SSA) form, there can only be one definition referred to,
-allowing this direct connection. This connection provides the use-def
-information in LLVM.</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="m_User">Important Public Members of the <tt>User</tt> class</a>
-</div>
-
-<div class="doc_text">
-
-<p>The <tt>User</tt> class exposes the operand list in two ways: through
-an index access interface and through an iterator based interface.</p>
-
-<ul>
- <li><tt>Value *getOperand(unsigned i)</tt><br>
- <tt>unsigned getNumOperands()</tt>
- <p> These two methods expose the operands of the <tt>User</tt> in a
-convenient form for direct access.</p></li>
-
- <li><tt>User::op_iterator</tt> - Typedef for iterator over the operand
-list<br>
- <tt>op_iterator op_begin()</tt> - Get an iterator to the start of
-the operand list.<br>
- <tt>op_iterator op_end()</tt> - Get an iterator to the end of the
-operand list.
- <p> Together, these methods make up the iterator based interface to
-the operands of a <tt>User</tt>.</p></li>
-</ul>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="Instruction">The <tt>Instruction</tt> class</a>
-</div>
-
-<div class="doc_text">
-
-<p><tt>#include "</tt><tt><a
-href="/doxygen/Instruction_8h-source.html">llvm/Instruction.h</a>"</tt><br>
-doxygen info: <a href="/doxygen/classllvm_1_1Instruction.html">Instruction Class</a><br>
-Superclasses: <a href="#User"><tt>User</tt></a>, <a
-href="#Value"><tt>Value</tt></a></p>
-
-<p>The <tt>Instruction</tt> class is the common base class for all LLVM
-instructions. It provides only a few methods, but is a very commonly used
-class. The primary data tracked by the <tt>Instruction</tt> class itself is the
-opcode (instruction type) and the parent <a
-href="#BasicBlock"><tt>BasicBlock</tt></a> the <tt>Instruction</tt> is embedded
-into. To represent a specific type of instruction, one of many subclasses of
-<tt>Instruction</tt> are used.</p>
-
-<p> Because the <tt>Instruction</tt> class subclasses the <a
-href="#User"><tt>User</tt></a> class, its operands can be accessed in the same
-way as for other <a href="#User"><tt>User</tt></a>s (with the
-<tt>getOperand()</tt>/<tt>getNumOperands()</tt> and
-<tt>op_begin()</tt>/<tt>op_end()</tt> methods).</p> <p> An important file for
-the <tt>Instruction</tt> class is the <tt>llvm/Instruction.def</tt> file. This
-file contains some meta-data about the various different types of instructions
-in LLVM. It describes the enum values that are used as opcodes (for example
-<tt>Instruction::Add</tt> and <tt>Instruction::ICmp</tt>), as well as the
-concrete sub-classes of <tt>Instruction</tt> that implement the instruction (for
-example <tt><a href="#BinaryOperator">BinaryOperator</a></tt> and <tt><a
-href="#CmpInst">CmpInst</a></tt>). Unfortunately, the use of macros in
-this file confuses doxygen, so these enum values don't show up correctly in the
-<a href="/doxygen/classllvm_1_1Instruction.html">doxygen output</a>.</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="s_Instruction">Important Subclasses of the <tt>Instruction</tt>
- class</a>
-</div>
-<div class="doc_text">
- <ul>
- <li><tt><a name="BinaryOperator">BinaryOperator</a></tt>
- <p>This subclasses represents all two operand instructions whose operands
- must be the same type, except for the comparison instructions.</p></li>
- <li><tt><a name="CastInst">CastInst</a></tt>
- <p>This subclass is the parent of the 12 casting instructions. It provides
- common operations on cast instructions.</p>
- <li><tt><a name="CmpInst">CmpInst</a></tt>
- <p>This subclass respresents the two comparison instructions,
- <a href="LangRef.html#i_icmp">ICmpInst</a> (integer opreands), and
- <a href="LangRef.html#i_fcmp">FCmpInst</a> (floating point operands).</p>
- <li><tt><a name="TerminatorInst">TerminatorInst</a></tt>
- <p>This subclass is the parent of all terminator instructions (those which
- can terminate a block).</p>
- </ul>
- </div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="m_Instruction">Important Public Members of the <tt>Instruction</tt>
- class</a>
-</div>
-
-<div class="doc_text">
-
-<ul>
- <li><tt><a href="#BasicBlock">BasicBlock</a> *getParent()</tt>
- <p>Returns the <a href="#BasicBlock"><tt>BasicBlock</tt></a> that
-this <tt>Instruction</tt> is embedded into.</p></li>
- <li><tt>bool mayWriteToMemory()</tt>
- <p>Returns true if the instruction writes to memory, i.e. it is a
- <tt>call</tt>,<tt>free</tt>,<tt>invoke</tt>, or <tt>store</tt>.</p></li>
- <li><tt>unsigned getOpcode()</tt>
- <p>Returns the opcode for the <tt>Instruction</tt>.</p></li>
- <li><tt><a href="#Instruction">Instruction</a> *clone() const</tt>
- <p>Returns another instance of the specified instruction, identical
-in all ways to the original except that the instruction has no parent
-(ie it's not embedded into a <a href="#BasicBlock"><tt>BasicBlock</tt></a>),
-and it has no name</p></li>
-</ul>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="Constant">The <tt>Constant</tt> class and subclasses</a>
-</div>
-
-<div class="doc_text">
-
-<p>Constant represents a base class for different types of constants. It
-is subclassed by ConstantInt, ConstantArray, etc. for representing
-the various types of Constants. <a href="#GlobalValue">GlobalValue</a> is also
-a subclass, which represents the address of a global variable or function.
-</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">Important Subclasses of Constant </div>
-<div class="doc_text">
-<ul>
- <li>ConstantInt : This subclass of Constant represents an integer constant of
- any width.
- <ul>
- <li><tt>const APInt&amp; getValue() const</tt>: Returns the underlying
- value of this constant, an APInt value.</li>
- <li><tt>int64_t getSExtValue() const</tt>: Converts the underlying APInt
- value to an int64_t via sign extension. If the value (not the bit width)
- of the APInt is too large to fit in an int64_t, an assertion will result.
- For this reason, use of this method is discouraged.</li>
- <li><tt>uint64_t getZExtValue() const</tt>: Converts the underlying APInt
- value to a uint64_t via zero extension. IF the value (not the bit width)
- of the APInt is too large to fit in a uint64_t, an assertion will result.
- For this reason, use of this method is discouraged.</li>
- <li><tt>static ConstantInt* get(const APInt&amp; Val)</tt>: Returns the
- ConstantInt object that represents the value provided by <tt>Val</tt>.
- The type is implied as the IntegerType that corresponds to the bit width
- of <tt>Val</tt>.</li>
- <li><tt>static ConstantInt* get(const Type *Ty, uint64_t Val)</tt>:
- Returns the ConstantInt object that represents the value provided by
- <tt>Val</tt> for integer type <tt>Ty</tt>.</li>
- </ul>
- </li>
- <li>ConstantFP : This class represents a floating point constant.
- <ul>
- <li><tt>double getValue() const</tt>: Returns the underlying value of
- this constant. </li>
- </ul>
- </li>
- <li>ConstantArray : This represents a constant array.
- <ul>
- <li><tt>const std::vector&lt;Use&gt; &amp;getValues() const</tt>: Returns
- a vector of component constants that makeup this array. </li>
- </ul>
- </li>
- <li>ConstantStruct : This represents a constant struct.
- <ul>
- <li><tt>const std::vector&lt;Use&gt; &amp;getValues() const</tt>: Returns
- a vector of component constants that makeup this array. </li>
- </ul>
- </li>
- <li>GlobalValue : This represents either a global variable or a function. In
- either case, the value is a constant fixed address (after linking).
- </li>
-</ul>
-</div>
-
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="GlobalValue">The <tt>GlobalValue</tt> class</a>
-</div>
-
-<div class="doc_text">
-
-<p><tt>#include "<a
-href="/doxygen/GlobalValue_8h-source.html">llvm/GlobalValue.h</a>"</tt><br>
-doxygen info: <a href="/doxygen/classllvm_1_1GlobalValue.html">GlobalValue
-Class</a><br>
-Superclasses: <a href="#Constant"><tt>Constant</tt></a>,
-<a href="#User"><tt>User</tt></a>, <a href="#Value"><tt>Value</tt></a></p>
-
-<p>Global values (<a href="#GlobalVariable"><tt>GlobalVariable</tt></a>s or <a
-href="#Function"><tt>Function</tt></a>s) are the only LLVM values that are
-visible in the bodies of all <a href="#Function"><tt>Function</tt></a>s.
-Because they are visible at global scope, they are also subject to linking with
-other globals defined in different translation units. To control the linking
-process, <tt>GlobalValue</tt>s know their linkage rules. Specifically,
-<tt>GlobalValue</tt>s know whether they have internal or external linkage, as
-defined by the <tt>LinkageTypes</tt> enumeration.</p>
-
-<p>If a <tt>GlobalValue</tt> has internal linkage (equivalent to being
-<tt>static</tt> in C), it is not visible to code outside the current translation
-unit, and does not participate in linking. If it has external linkage, it is
-visible to external code, and does participate in linking. In addition to
-linkage information, <tt>GlobalValue</tt>s keep track of which <a
-href="#Module"><tt>Module</tt></a> they are currently part of.</p>
-
-<p>Because <tt>GlobalValue</tt>s are memory objects, they are always referred to
-by their <b>address</b>. As such, the <a href="#Type"><tt>Type</tt></a> of a
-global is always a pointer to its contents. It is important to remember this
-when using the <tt>GetElementPtrInst</tt> instruction because this pointer must
-be dereferenced first. For example, if you have a <tt>GlobalVariable</tt> (a
-subclass of <tt>GlobalValue)</tt> that is an array of 24 ints, type <tt>[24 x
-i32]</tt>, then the <tt>GlobalVariable</tt> is a pointer to that array. Although
-the address of the first element of this array and the value of the
-<tt>GlobalVariable</tt> are the same, they have different types. The
-<tt>GlobalVariable</tt>'s type is <tt>[24 x i32]</tt>. The first element's type
-is <tt>i32.</tt> Because of this, accessing a global value requires you to
-dereference the pointer with <tt>GetElementPtrInst</tt> first, then its elements
-can be accessed. This is explained in the <a href="LangRef.html#globalvars">LLVM
-Language Reference Manual</a>.</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="m_GlobalValue">Important Public Members of the <tt>GlobalValue</tt>
- class</a>
-</div>
-
-<div class="doc_text">
-
-<ul>
- <li><tt>bool hasInternalLinkage() const</tt><br>
- <tt>bool hasExternalLinkage() const</tt><br>
- <tt>void setInternalLinkage(bool HasInternalLinkage)</tt>
- <p> These methods manipulate the linkage characteristics of the <tt>GlobalValue</tt>.</p>
- <p> </p>
- </li>
- <li><tt><a href="#Module">Module</a> *getParent()</tt>
- <p> This returns the <a href="#Module"><tt>Module</tt></a> that the
-GlobalValue is currently embedded into.</p></li>
-</ul>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="Function">The <tt>Function</tt> class</a>
-</div>
-
-<div class="doc_text">
-
-<p><tt>#include "<a
-href="/doxygen/Function_8h-source.html">llvm/Function.h</a>"</tt><br> doxygen
-info: <a href="/doxygen/classllvm_1_1Function.html">Function Class</a><br>
-Superclasses: <a href="#GlobalValue"><tt>GlobalValue</tt></a>,
-<a href="#Constant"><tt>Constant</tt></a>,
-<a href="#User"><tt>User</tt></a>,
-<a href="#Value"><tt>Value</tt></a></p>
-
-<p>The <tt>Function</tt> class represents a single procedure in LLVM. It is
-actually one of the more complex classes in the LLVM heirarchy because it must
-keep track of a large amount of data. The <tt>Function</tt> class keeps track
-of a list of <a href="#BasicBlock"><tt>BasicBlock</tt></a>s, a list of formal
-<a href="#Argument"><tt>Argument</tt></a>s, and a
-<a href="#SymbolTable"><tt>SymbolTable</tt></a>.</p>
-
-<p>The list of <a href="#BasicBlock"><tt>BasicBlock</tt></a>s is the most
-commonly used part of <tt>Function</tt> objects. The list imposes an implicit
-ordering of the blocks in the function, which indicate how the code will be
-layed out by the backend. Additionally, the first <a
-href="#BasicBlock"><tt>BasicBlock</tt></a> is the implicit entry node for the
-<tt>Function</tt>. It is not legal in LLVM to explicitly branch to this initial
-block. There are no implicit exit nodes, and in fact there may be multiple exit
-nodes from a single <tt>Function</tt>. If the <a
-href="#BasicBlock"><tt>BasicBlock</tt></a> list is empty, this indicates that
-the <tt>Function</tt> is actually a function declaration: the actual body of the
-function hasn't been linked in yet.</p>
-
-<p>In addition to a list of <a href="#BasicBlock"><tt>BasicBlock</tt></a>s, the
-<tt>Function</tt> class also keeps track of the list of formal <a
-href="#Argument"><tt>Argument</tt></a>s that the function receives. This
-container manages the lifetime of the <a href="#Argument"><tt>Argument</tt></a>
-nodes, just like the <a href="#BasicBlock"><tt>BasicBlock</tt></a> list does for
-the <a href="#BasicBlock"><tt>BasicBlock</tt></a>s.</p>
-
-<p>The <a href="#SymbolTable"><tt>SymbolTable</tt></a> is a very rarely used
-LLVM feature that is only used when you have to look up a value by name. Aside
-from that, the <a href="#SymbolTable"><tt>SymbolTable</tt></a> is used
-internally to make sure that there are not conflicts between the names of <a
-href="#Instruction"><tt>Instruction</tt></a>s, <a
-href="#BasicBlock"><tt>BasicBlock</tt></a>s, or <a
-href="#Argument"><tt>Argument</tt></a>s in the function body.</p>
-
-<p>Note that <tt>Function</tt> is a <a href="#GlobalValue">GlobalValue</a>
-and therefore also a <a href="#Constant">Constant</a>. The value of the function
-is its address (after linking) which is guaranteed to be constant.</p>
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="m_Function">Important Public Members of the <tt>Function</tt>
- class</a>
-</div>
-
-<div class="doc_text">
-
-<ul>
- <li><tt>Function(const </tt><tt><a href="#FunctionType">FunctionType</a>
- *Ty, LinkageTypes Linkage, const std::string &amp;N = "", Module* Parent = 0)</tt>
-
- <p>Constructor used when you need to create new <tt>Function</tt>s to add
- the the program. The constructor must specify the type of the function to
- create and what type of linkage the function should have. The <a
- href="#FunctionType"><tt>FunctionType</tt></a> argument
- specifies the formal arguments and return value for the function. The same
- <a href="#FunctionType"><tt>FunctionType</tt></a> value can be used to
- create multiple functions. The <tt>Parent</tt> argument specifies the Module
- in which the function is defined. If this argument is provided, the function
- will automatically be inserted into that module's list of
- functions.</p></li>
-
- <li><tt>bool isExternal()</tt>
-
- <p>Return whether or not the <tt>Function</tt> has a body defined. If the
- function is "external", it does not have a body, and thus must be resolved
- by linking with a function defined in a different translation unit.</p></li>
-
- <li><tt>Function::iterator</tt> - Typedef for basic block list iterator<br>
- <tt>Function::const_iterator</tt> - Typedef for const_iterator.<br>
-
- <tt>begin()</tt>, <tt>end()</tt>
- <tt>size()</tt>, <tt>empty()</tt>
-
- <p>These are forwarding methods that make it easy to access the contents of
- a <tt>Function</tt> object's <a href="#BasicBlock"><tt>BasicBlock</tt></a>
- list.</p></li>
-
- <li><tt>Function::BasicBlockListType &amp;getBasicBlockList()</tt>
-
- <p>Returns the list of <a href="#BasicBlock"><tt>BasicBlock</tt></a>s. This
- is necessary to use when you need to update the list or perform a complex
- action that doesn't have a forwarding method.</p></li>
-
- <li><tt>Function::arg_iterator</tt> - Typedef for the argument list
-iterator<br>
- <tt>Function::const_arg_iterator</tt> - Typedef for const_iterator.<br>
-
- <tt>arg_begin()</tt>, <tt>arg_end()</tt>
- <tt>arg_size()</tt>, <tt>arg_empty()</tt>
-
- <p>These are forwarding methods that make it easy to access the contents of
- a <tt>Function</tt> object's <a href="#Argument"><tt>Argument</tt></a>
- list.</p></li>
-
- <li><tt>Function::ArgumentListType &amp;getArgumentList()</tt>
-
- <p>Returns the list of <a href="#Argument"><tt>Argument</tt></a>s. This is
- necessary to use when you need to update the list or perform a complex
- action that doesn't have a forwarding method.</p></li>
-
- <li><tt><a href="#BasicBlock">BasicBlock</a> &amp;getEntryBlock()</tt>
-
- <p>Returns the entry <a href="#BasicBlock"><tt>BasicBlock</tt></a> for the
- function. Because the entry block for the function is always the first
- block, this returns the first block of the <tt>Function</tt>.</p></li>
-
- <li><tt><a href="#Type">Type</a> *getReturnType()</tt><br>
- <tt><a href="#FunctionType">FunctionType</a> *getFunctionType()</tt>
-
- <p>This traverses the <a href="#Type"><tt>Type</tt></a> of the
- <tt>Function</tt> and returns the return type of the function, or the <a
- href="#FunctionType"><tt>FunctionType</tt></a> of the actual
- function.</p></li>
-
- <li><tt><a href="#SymbolTable">SymbolTable</a> *getSymbolTable()</tt>
-
- <p> Return a pointer to the <a href="#SymbolTable"><tt>SymbolTable</tt></a>
- for this <tt>Function</tt>.</p></li>
-</ul>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="GlobalVariable">The <tt>GlobalVariable</tt> class</a>
-</div>
-
-<div class="doc_text">
-
-<p><tt>#include "<a
-href="/doxygen/GlobalVariable_8h-source.html">llvm/GlobalVariable.h</a>"</tt>
-<br>
-doxygen info: <a href="/doxygen/classllvm_1_1GlobalVariable.html">GlobalVariable
- Class</a><br>
-Superclasses: <a href="#GlobalValue"><tt>GlobalValue</tt></a>,
-<a href="#Constant"><tt>Constant</tt></a>,
-<a href="#User"><tt>User</tt></a>,
-<a href="#Value"><tt>Value</tt></a></p>
-
-<p>Global variables are represented with the (suprise suprise)
-<tt>GlobalVariable</tt> class. Like functions, <tt>GlobalVariable</tt>s are also
-subclasses of <a href="#GlobalValue"><tt>GlobalValue</tt></a>, and as such are
-always referenced by their address (global values must live in memory, so their
-"name" refers to their constant address). See
-<a href="#GlobalValue"><tt>GlobalValue</tt></a> for more on this. Global
-variables may have an initial value (which must be a
-<a href="#Constant"><tt>Constant</tt></a>), and if they have an initializer,
-they may be marked as "constant" themselves (indicating that their contents
-never change at runtime).</p>
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="m_GlobalVariable">Important Public Members of the
- <tt>GlobalVariable</tt> class</a>
-</div>
-
-<div class="doc_text">
-
-<ul>
- <li><tt>GlobalVariable(const </tt><tt><a href="#Type">Type</a> *Ty, bool
- isConstant, LinkageTypes&amp; Linkage, <a href="#Constant">Constant</a>
- *Initializer = 0, const std::string &amp;Name = "", Module* Parent = 0)</tt>
-
- <p>Create a new global variable of the specified type. If
- <tt>isConstant</tt> is true then the global variable will be marked as
- unchanging for the program. The Linkage parameter specifies the type of
- linkage (internal, external, weak, linkonce, appending) for the variable. If
- the linkage is InternalLinkage, WeakLinkage, or LinkOnceLinkage,&nbsp; then
- the resultant global variable will have internal linkage. AppendingLinkage
- concatenates together all instances (in different translation units) of the
- variable into a single variable but is only applicable to arrays. &nbsp;See
- the <a href="LangRef.html#modulestructure">LLVM Language Reference</a> for
- further details on linkage types. Optionally an initializer, a name, and the
- module to put the variable into may be specified for the global variable as
- well.</p></li>
-
- <li><tt>bool isConstant() const</tt>
-
- <p>Returns true if this is a global variable that is known not to
- be modified at runtime.</p></li>
-
- <li><tt>bool hasInitializer()</tt>
-
- <p>Returns true if this <tt>GlobalVariable</tt> has an intializer.</p></li>
-
- <li><tt><a href="#Constant">Constant</a> *getInitializer()</tt>
-
- <p>Returns the intial value for a <tt>GlobalVariable</tt>. It is not legal
- to call this method if there is no initializer.</p></li>
-</ul>
-
-</div>
-
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="BasicBlock">The <tt>BasicBlock</tt> class</a>
-</div>
-
-<div class="doc_text">
-
-<p><tt>#include "<a
-href="/doxygen/BasicBlock_8h-source.html">llvm/BasicBlock.h</a>"</tt><br>
-doxygen info: <a href="/doxygen/structllvm_1_1BasicBlock.html">BasicBlock
-Class</a><br>
-Superclass: <a href="#Value"><tt>Value</tt></a></p>
-
-<p>This class represents a single entry multiple exit section of the code,
-commonly known as a basic block by the compiler community. The
-<tt>BasicBlock</tt> class maintains a list of <a
-href="#Instruction"><tt>Instruction</tt></a>s, which form the body of the block.
-Matching the language definition, the last element of this list of instructions
-is always a terminator instruction (a subclass of the <a
-href="#TerminatorInst"><tt>TerminatorInst</tt></a> class).</p>
-
-<p>In addition to tracking the list of instructions that make up the block, the
-<tt>BasicBlock</tt> class also keeps track of the <a
-href="#Function"><tt>Function</tt></a> that it is embedded into.</p>
-
-<p>Note that <tt>BasicBlock</tt>s themselves are <a
-href="#Value"><tt>Value</tt></a>s, because they are referenced by instructions
-like branches and can go in the switch tables. <tt>BasicBlock</tt>s have type
-<tt>label</tt>.</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="m_BasicBlock">Important Public Members of the <tt>BasicBlock</tt>
- class</a>
-</div>
-
-<div class="doc_text">
-<ul>
-
-<li><tt>BasicBlock(const std::string &amp;Name = "", </tt><tt><a
- href="#Function">Function</a> *Parent = 0)</tt>
-
-<p>The <tt>BasicBlock</tt> constructor is used to create new basic blocks for
-insertion into a function. The constructor optionally takes a name for the new
-block, and a <a href="#Function"><tt>Function</tt></a> to insert it into. If
-the <tt>Parent</tt> parameter is specified, the new <tt>BasicBlock</tt> is
-automatically inserted at the end of the specified <a
-href="#Function"><tt>Function</tt></a>, if not specified, the BasicBlock must be
-manually inserted into the <a href="#Function"><tt>Function</tt></a>.</p></li>
-
-<li><tt>BasicBlock::iterator</tt> - Typedef for instruction list iterator<br>
-<tt>BasicBlock::const_iterator</tt> - Typedef for const_iterator.<br>
-<tt>begin()</tt>, <tt>end()</tt>, <tt>front()</tt>, <tt>back()</tt>,
-<tt>size()</tt>, <tt>empty()</tt>
-STL-style functions for accessing the instruction list.
-
-<p>These methods and typedefs are forwarding functions that have the same
-semantics as the standard library methods of the same names. These methods
-expose the underlying instruction list of a basic block in a way that is easy to
-manipulate. To get the full complement of container operations (including
-operations to update the list), you must use the <tt>getInstList()</tt>
-method.</p></li>
-
-<li><tt>BasicBlock::InstListType &amp;getInstList()</tt>
-
-<p>This method is used to get access to the underlying container that actually
-holds the Instructions. This method must be used when there isn't a forwarding
-function in the <tt>BasicBlock</tt> class for the operation that you would like
-to perform. Because there are no forwarding functions for "updating"
-operations, you need to use this if you want to update the contents of a
-<tt>BasicBlock</tt>.</p></li>
-
-<li><tt><a href="#Function">Function</a> *getParent()</tt>
-
-<p> Returns a pointer to <a href="#Function"><tt>Function</tt></a> the block is
-embedded into, or a null pointer if it is homeless.</p></li>
-
-<li><tt><a href="#TerminatorInst">TerminatorInst</a> *getTerminator()</tt>
-
-<p> Returns a pointer to the terminator instruction that appears at the end of
-the <tt>BasicBlock</tt>. If there is no terminator instruction, or if the last
-instruction in the block is not a terminator, then a null pointer is
-returned.</p></li>
-
-</ul>
-
-</div>
-
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="Argument">The <tt>Argument</tt> class</a>
-</div>
-
-<div class="doc_text">
-
-<p>This subclass of Value defines the interface for incoming formal
-arguments to a function. A Function maintains a list of its formal
-arguments. An argument has a pointer to the parent Function.</p>
-
-</div>
-
-<!-- *********************************************************************** -->
-<hr>
-<address>
- <a href="http://jigsaw.w3.org/css-validator/check/referer"><img
- src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"></a>
- <a href="http://validator.w3.org/check/referer"><img
- src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!" /></a>
-
- <a href="mailto:dhurjati@cs.uiuc.edu">Dinakar Dhurjati</a> and
- <a href="mailto:sabre@nondot.org">Chris Lattner</a><br>
- <a href="http://llvm.org">The LLVM Compiler Infrastructure</a><br>
- Last modified: $Date$
-</address>
-
-</body>
-</html>
diff --git a/release_23/docs/Projects.html b/release_23/docs/Projects.html
deleted file mode 100644
index cb7a7c1bcfaa..000000000000
--- a/release_23/docs/Projects.html
+++ /dev/null
@@ -1,460 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
- "http://www.w3.org/TR/html4/strict.dtd">
-<html>
-<head>
- <title>Creating an LLVM Project</title>
- <link rel="stylesheet" href="llvm.css" type="text/css">
-</head>
-<body>
-
-<div class="doc_title">Creating an LLVM Project</div>
-
-<ol>
-<li><a href="#overview">Overview</a></li>
-<li><a href="#create">Create a project from the Sample Project</a></li>
-<li><a href="#source">Source tree layout</a></li>
-<li><a href="#makefiles">Writing LLVM-style Makefiles</a>
- <ol>
- <li><a href="#reqVars">Required Variables</a></li>
- <li><a href="#varsBuildDir">Variables for Building Subdirectories</a></li>
- <li><a href="#varsBuildLib">Variables for Building Libraries</a></li>
- <li><a href="#varsBuildProg">Variables for Building Programs</a></li>
- <li><a href="#miscVars">Miscellaneous Variables</a></li>
- </ol></li>
-<li><a href="#objcode">Placement of object code</a></li>
-<li><a href="#help">Further help</a></li>
-</ol>
-
-<div class="doc_author">
- <p>Written by John Criswell</p>
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section"><a name="overview">Overview</a></div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>The LLVM build system is designed to facilitate the building of third party
-projects that use LLVM header files, libraries, and tools. In order to use
-these facilities, a Makefile from a project must do the following things:</p>
-
-<ol>
- <li>Set <tt>make</tt> variables. There are several variables that a Makefile
- needs to set to use the LLVM build system:
- <ul>
- <li><tt>PROJECT_NAME</tt> - The name by which your project is known.</li>
- <li><tt>LLVM_SRC_ROOT</tt> - The root of the LLVM source tree.</li>
- <li><tt>LLVM_OBJ_ROOT</tt> - The root of the LLVM object tree.</li>
- <li><tt>PROJ_SRC_ROOT</tt> - The root of the project's source tree.</li>
- <li><tt>PROJ_OBJ_ROOT</tt> - The root of the project's object tree.</li>
- <li><tt>PROJ_INSTALL_ROOT</tt> - The root installation directory.</li>
- <li><tt>LEVEL</tt> - The relative path from the current directory to the
- project's root ($PROJ_OBJ_ROOT).</li>
- </ul></li>
- <li>Include <tt>Makefile.config</tt> from <tt>$(LLVM_OBJ_ROOT)</tt>.</li>
- <li>Include <tt>Makefile.rules</tt> from <tt>$(LLVM_SRC_ROOT)</tt>.</li>
-</ol>
-
-<p>There are two ways that you can set all of these variables:</p>
-<ol>
- <li>You can write your own Makefiles which hard-code these values.</li>
- <li>You can use the pre-made LLVM sample project. This sample project
- includes Makefiles, a configure script that can be used to configure the
- location of LLVM, and the ability to support multiple object directories
- from a single source directory.</li>
-</ol>
-
-<p>This document assumes that you will base your project on the LLVM sample
-project found in <tt>llvm/projects/sample</tt>. If you want to devise your own
-build system, studying the sample project and LLVM Makefiles will probably
-provide enough information on how to write your own Makefiles.</p>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section">
- <a name="create">Create a Project from the Sample Project</a>
-</div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>Follow these simple steps to start your project:</p>
-
-<ol>
-<li>Copy the <tt>llvm/projects/sample</tt> directory to any place of your
-choosing. You can place it anywhere you like. Rename the directory to match
-the name of your project.</li>
-
-<li>
-If you downloaded LLVM using Subversion, remove all the directories named .svn
-(and all the files therein) from your project's new source tree. This will
-keep Subversion from thinking that your project is inside
-<tt>llvm/trunk/projects/sample</tt>.</li>
-
-<li>Add your source code and Makefiles to your source tree.</li>
-
-<li>If you want your project to be configured with the <tt>configure</tt> script
-then you need to edit <tt>autoconf/configure.ac</tt> as follows:
- <ul>
- <li><b>AC_INIT</b>. Place the name of your project, its version number and
- a contact email address for your project as the arguments to this macro</li>
- <li><b>AC_CONFIG_AUX_DIR</b>. If your project isn't in the
- <tt>llvm/projects</tt> directory then you might need to adjust this so that
- it specifies a relative path to the <tt>llvm/autoconf</tt> directory.</li>
- <li><b>LLVM_CONFIG_PROJECT</b>. Just leave this alone.</li>
- <li><b>AC_CONFIG_SRCDIR</b>. Specify a path to a file name that identifies
- your project; or just leave it at <tt>Makefile.common.in</tt></li>
- <li><b>AC_CONFIG_FILES</b>. Do not change.</li>
- <li><b>AC_CONFIG_MAKEFILE</b>. Use one of these macros for each Makefile
- that your project uses. This macro arranges for your makefiles to be copied
- from the source directory, unmodified, to the build directory.</li>
- </ul>
-</li>
-
-<li>After updating <tt>autoconf/configure.ac</tt>, regenerate the
-configure script with these commands:
-
-<div class="doc_code">
-<p><tt>% cd autoconf<br>
- % AutoRegen.sh</tt></p>
-</div>
-
-<p>You must be using Autoconf version 2.59 or later and your aclocal version
-should 1.9 or later.</p></li>
-
-<li>Run <tt>configure</tt> in the directory in which you want to place
-object code. Use the following options to tell your project where it
-can find LLVM:
-
- <dl>
- <dt><tt>--with-llvmsrc=&lt;directory&gt;</tt></dt>
- <dd>Tell your project where the LLVM source tree is located.</dd>
- <dt><br/><tt>--with-llvmobj=&lt;directory&gt;</tt></dt>
- <dd>Tell your project where the LLVM object tree is located.</dd>
- <dt><br/><tt>--prefix=&lt;directory&gt;</tt></dt>
- <dd>Tell your project where it should get installed.</dd>
- </dl>
-</ol>
-
-<p>That's it! Now all you have to do is type <tt>gmake</tt> (or <tt>make</tt>
-if your on a GNU/Linux system) in the root of your object directory, and your
-project should build.</p>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section">
- <a name="source">Source Tree Layout</a>
-</div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>In order to use the LLVM build system, you will want to organize your
-source code so that it can benefit from the build system's features.
-Mainly, you want your source tree layout to look similar to the LLVM
-source tree layout. The best way to do this is to just copy the
-project tree from <tt>llvm/projects/sample</tt> and modify it to meet
-your needs, but you can certainly add to it if you want.</p>
-
-<p>Underneath your top level directory, you should have the following
-directories:</p>
-
-<dl>
- <dt><b>lib</b>
- <dd>
- This subdirectory should contain all of your library source
- code. For each library that you build, you will have one
- directory in <b>lib</b> that will contain that library's source
- code.
-
- <p>
- Libraries can be object files, archives, or dynamic libraries.
- The <b>lib</b> directory is just a convenient place for libraries
- as it places them all in a directory from which they can be linked
- later.
-
- <dt><b>include</b>
- <dd>
- This subdirectory should contain any header files that are
- global to your project. By global, we mean that they are used
- by more than one library or executable of your project.
- <p>
- By placing your header files in <b>include</b>, they will be
- found automatically by the LLVM build system. For example, if
- you have a file <b>include/jazz/note.h</b>, then your source
- files can include it simply with <b>#include "jazz/note.h"</b>.
-
- <dt><b>tools</b>
- <dd>
- This subdirectory should contain all of your source
- code for executables. For each program that you build, you
- will have one directory in <b>tools</b> that will contain that
- program's source code.
- <p>
-
- <dt><b>test</b>
- <dd>
- This subdirectory should contain tests that verify that your code
- works correctly. Automated tests are especially useful.
- <p>
- Currently, the LLVM build system provides basic support for tests.
- The LLVM system provides the following:
- <ul>
- <li>
- LLVM provides a tcl procedure that is used by Dejagnu to run
- tests. It can be found in <tt>llvm/lib/llvm-dg.exp</tt>. This
- test procedure uses RUN lines in the actual test case to determine
- how to run the test. See the <a
- href="TestingGuide.html">TestingGuide</a> for more details. You
- can easily write Makefile support similar to the Makefiles in
- <tt>llvm/test</tt> to use Dejagnu to run your project's tests.<br/></li>
- <li>
- LLVM contains an optional package called <tt>llvm-test</tt>
- which provides benchmarks and programs that are known to compile with the
- LLVM GCC front ends. You can use these
- programs to test your code, gather statistics information, and
- compare it to the current LLVM performance statistics.
- <br/>Currently, there is no way to hook your tests directly into the
- <tt>llvm/test</tt> testing harness. You will simply
- need to find a way to use the source provided within that directory
- on your own.
- </ul>
-</dl>
-
-<p>Typically, you will want to build your <b>lib</b> directory first followed by
-your <b>tools</b> directory.</p>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section">
- <a name="makefiles">Writing LLVM Style Makefiles</a>
-</div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>The LLVM build system provides a convenient way to build libraries and
-executables. Most of your project Makefiles will only need to define a few
-variables. Below is a list of the variables one can set and what they can
-do:</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="reqVars">Required Variables</a>
-</div>
-
-<div class="doc_text">
-
-<dl>
- <dt>LEVEL
- <dd>
- This variable is the relative path from this Makefile to the
- top directory of your project's source code. For example, if
- your source code is in <tt>/tmp/src</tt>, then the Makefile in
- <tt>/tmp/src/jump/high</tt> would set <tt>LEVEL</tt> to <tt>"../.."</tt>.
-</dl>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="varsBuildDir">Variables for Building Subdirectories</a>
-</div>
-
-<div class="doc_text">
-
-<dl>
- <dt>DIRS
- <dd>
- This is a space separated list of subdirectories that should be
- built. They will be built, one at a time, in the order
- specified.
- <p>
-
- <dt>PARALLEL_DIRS
- <dd>
- This is a list of directories that can be built in parallel.
- These will be built after the directories in DIRS have been
- built.
- <p>
-
- <dt>OPTIONAL_DIRS
- <dd>
- This is a list of directories that can be built if they exist,
- but will not cause an error if they do not exist. They are
- built serially in the order in which they are listed.
-</dl>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="varsBuildLib">Variables for Building Libraries</a>
-</div>
-
-<div class="doc_text">
-
-<dl>
- <dt>LIBRARYNAME
- <dd>
- This variable contains the base name of the library that will
- be built. For example, to build a library named
- <tt>libsample.a</tt>, LIBRARYNAME should be set to
- <tt>sample</tt>.
- <p>
-
- <dt>BUILD_ARCHIVE
- <dd>
- By default, a library is a <tt>.o</tt> file that is linked
- directly into a program. To build an archive (also known as
- a static library), set the BUILD_ARCHIVE variable.
- <p>
-
- <dt>SHARED_LIBRARY
- <dd>
- If SHARED_LIBRARY is defined in your Makefile, a shared
- (or dynamic) library will be built.
-</dl>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="varsBuildProg">Variables for Building Programs</a>
-</div>
-
-<div class="doc_text">
-
-<dl>
- <dt>TOOLNAME
- <dd>
- This variable contains the name of the program that will
- be built. For example, to build an executable named
- <tt>sample</tt>, TOOLNAME should be set to <tt>sample</tt>.
- <p>
-
- <dt>USEDLIBS
- <dd>
- This variable holds a space separated list of libraries that
- should be linked into the program. These libraries must either
- be LLVM libraries or libraries that come from your <b>lib</b>
- directory. The libraries must be specified by their base name.
- For example, to link libsample.a, you would set USEDLIBS to
- <tt>sample</tt>.
- <p>
- Note that this works only for statically linked libraries.
- <p>
-
- <dt>LIBS
- <dd>
- To link dynamic libraries, add <tt>-l&lt;library base name&gt;</tt> to
- the LIBS variable. The LLVM build system will look in the same places
- for dynamic libraries as it does for static libraries.
- <p>
- For example, to link <tt>libsample.so</tt>, you would have the
- following line in your <tt>Makefile</tt>:
- <p>
- <tt>
- LIBS += -lsample
- </tt>
-</dl>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="miscVars">Miscellaneous Variables</a>
-</div>
-
-<div class="doc_text">
-
-<dl>
- <dt>ExtraSource
- <dd>
- This variable contains a space separated list of extra source
- files that need to be built. It is useful for including the
- output of Lex and Yacc programs.
- <p>
-
- <dt>CFLAGS
- <dt>CPPFLAGS
- <dd>
- This variable can be used to add options to the C and C++
- compiler, respectively. It is typically used to add options
- that tell the compiler the location of additional directories
- to search for header files.
- <p>
- It is highly suggested that you append to CFLAGS and CPPFLAGS as
- opposed to overwriting them. The master Makefiles may already
- have useful options in them that you may not want to overwrite.
- <p>
-</dl>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section">
- <a name="objcode">Placement of Object Code</a>
-</div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>The final location of built libraries and executables will depend upon
-whether you do a Debug, Release, or Profile build.</p>
-
-<dl>
- <dt>Libraries
- <dd>
- All libraries (static and dynamic) will be stored in
- <tt>PROJ_OBJ_ROOT/&lt;type&gt;/lib</tt>, where type is <tt>Debug</tt>,
- <tt>Release</tt>, or <tt>Profile</tt> for a debug, optimized, or
- profiled build, respectively.<p>
-
- <dt>Executables
- <dd>All executables will be stored in
- <tt>PROJ_OBJ_ROOT/&lt;type&gt;/bin</tt>, where type is <tt>Debug</tt>,
- <tt>Release</tt>, or <tt>Profile</tt> for a debug, optimized, or profiled
- build, respectively.
-</dl>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section">
- <a name="help">Further Help</a>
-</div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>If you have any questions or need any help creating an LLVM project,
-the LLVM team would be more than happy to help. You can always post your
-questions to the <a
-href="http://mail.cs.uiuc.edu/mailman/listinfo/llvmdev">LLVM Developers
-Mailing List</a>.</p>
-
-</div>
-
-<!-- *********************************************************************** -->
-<hr>
-<address>
- <a href="http://jigsaw.w3.org/css-validator/check/referer"><img
- src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"></a>
- <a href="http://validator.w3.org/check/referer"><img
- src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!" /></a>
-
- <a href="mailto:criswell@uiuc.edu">John Criswell</a><br>
- <a href="http://llvm.org">The LLVM Compiler Infrastructure</a>
- <br>
- Last modified: $Date$
-</address>
-
-</body>
-</html>
diff --git a/release_23/docs/ReleaseNotes.html b/release_23/docs/ReleaseNotes.html
deleted file mode 100644
index 2f40e47d7566..000000000000
--- a/release_23/docs/ReleaseNotes.html
+++ /dev/null
@@ -1,842 +0,0 @@
-
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
- "http://www.w3.org/TR/html4/strict.dtd">
-<html>
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <link rel="stylesheet" href="llvm.css" type="text/css">
- <title>LLVM 2.3 Release Notes</title>
-</head>
-<body>
-
-<div class="doc_title">LLVM 2.3 Release Notes</div>
-
-<ol>
- <li><a href="#intro">Introduction</a></li>
- <li><a href="#changes">Major Changes and Sub-project Status</a></li>
- <li><a href="#whatsnew">What's New?</a></li>
- <li><a href="GettingStarted.html">Installation Instructions</a></li>
- <li><a href="#portability">Portability and Supported Platforms</a></li>
- <li><a href="#knownproblems">Known Problems</a>
- <li><a href="#additionalinfo">Additional Information</a></li>
-</ol>
-
-<div class="doc_author">
- <p>Written by the <a href="http://llvm.org">LLVM Team</a><p>
-</div>
-
-<!-- Done through Week-of-Mon-20080324.txt -->
-
-<!-- *********************************************************************** -->
-<div class="doc_section">
- <a name="intro">Introduction</a>
-</div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>This document contains the release notes for the LLVM compiler
-infrastructure, release 2.3. Here we describe the status of LLVM, including
-major improvements from the previous release and any known problems. All LLVM
-releases may be downloaded from the <a href="http://llvm.org/releases/">LLVM
-releases web site</a>.</p>
-
-<p>For more information about LLVM, including information about the latest
-release, please check out the <a href="http://llvm.org/">main LLVM
-web site</a>. If you have questions or comments, the <a
-href="http://mail.cs.uiuc.edu/mailman/listinfo/llvmdev">LLVM developer's mailing
-list</a> is a good place to send them.</p>
-
-<p>Note that if you are reading this file from a Subversion checkout or the
-main LLVM web page, this document applies to the <i>next</i> release, not the
-current one. To see the release notes for a specific releases, please see the
-<a href="http://llvm.org/releases/">releases page</a>.</p>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section">
- <a name="changes">Major Changes and Sub-project Status</a>
-</div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>This is the fourteenth public release of the LLVM Compiler Infrastructure.
-It includes a large number of features and refinements from LLVM 2.2.</p>
-
-</div>
-
-<!-- Unfinished features in 2.3:
- Machine LICM
- Machine Sinking
- LegalizeDAGTypes
- -->
-
-<!--=========================================================================-->
-<div class="doc_subsection">
-<a name="changes">Major Changes in LLVM 2.3</a>
-</div>
-
-<div class="doc_text">
-
-<p>LLVM 2.3 no longer supports llvm-gcc 4.0, it has been replaced with
- llvm-gcc 4.2.</p>
-
-<p>LLVM 2.3 no longer includes the <tt>llvm-upgrade</tt> tool. It was useful
- for upgrading LLVM 1.9 files to LLVM 2.x syntax, but you can always use a
- previous LLVM release to do this. One nice impact of this is that the LLVM
- regression test suite no longer depends on llvm-upgrade, which makes it run
- faster.</p>
-
-<p>The <tt>llvm2cpp</tt> tool has been folded into llc, use
- <tt>llc -march=cpp</tt> instead of <tt>llvm2cpp</tt>.</p>
-
-<p>LLVM API Changes:</p>
-
-<ul>
-<li>Several core LLVM IR classes have migrated to use the
- '<tt>FOOCLASS::Create(...)</tt>' pattern instead of '<tt>new
- FOOCLASS(...)</tt>' (e.g. where FOOCLASS=<tt>BasicBlock</tt>). We hope to
- standardize on <tt>FOOCLASS::Create</tt> for all IR classes in the future,
- but not all of them have been moved over yet.</li>
-<li>LLVM 2.3 renames the LLVMBuilder and LLVMFoldingBuilder classes to
- <a href="http://llvm.org/doxygen/classllvm_1_1IRBuilder.html">IRBuilder</a>.
- </li>
-<li>MRegisterInfo was renamed to
- <a href="http://llvm.org/doxygen/classllvm_1_1TargetRegisterInfo.html">
- TargetRegisterInfo</a>.</li>
-<li>The MappedFile class is gone, please use
- <a href="http://llvm.org/doxygen/classllvm_1_1MemoryBuffer.html">
- MemoryBuffer</a> instead.</li>
-<li>The '<tt>-enable-eh</tt>' flag to llc has been removed. Now code should
- encode whether it is safe to omit unwind information for a function by
- tagging the Function object with the '<tt>nounwind</tt>' attribute.</li>
-<li>The ConstantFP::get method that uses APFloat now takes one argument
- instead of two. The type argument has been removed, and the type is
- now inferred from the size of the given APFloat value.</li>
-
-</ul>
-</div>
-
-<!--=========================================================================-->
-<div class="doc_subsection">
-<a name="otherprojects">Other LLVM Sub-Projects</a>
-</div>
-
-<div class="doc_text">
-<p>
-The core LLVM 2.3 distribution currently consists of code from the core LLVM
-repository (which roughly contains the LLVM optimizer, code generators and
-supporting tools) and the llvm-gcc repository. In addition to this code, the
-LLVM Project includes other sub-projects that are in development. The two which
-are the most actively developed are the new <a href="#vmkit">vmkit Project</a>
-and the <a href="#clang">Clang Project</a>.
-</p>
-</div>
-
-<!--=========================================================================-->
-<div class="doc_subsubsection">
-<a name="vmkit">vmkit</a>
-</div>
-
-<div class="doc_text">
-<p>
-The "vmkit" project is a new addition to the LLVM family. It is an
-implementation of a JVM and a CLI Virtual Machines (Microsoft .NET is an
-implementation of the CLI) using the Just-In-Time compiler of LLVM.</p>
-
-<p>The JVM, called JnJVM, executes real-world applications such as Apache
-projects (e.g. Felix and Tomcat) and the SpecJVM98 benchmark. It uses the GNU
-Classpath project for the base classes. The CLI implementation, called N3, is
-its in early stages but can execute simple applications and the "pnetmark"
-benchmark. It uses the pnetlib project as its core library.</p>
-
-<p>The 'vmkit' VMs compare in performance with industrial and top open-source
-VMs on scientific applications. Besides the JIT, the VMs use many features of
-the LLVM framework, including the standard set of optimizations, atomic
-operations, custom function provider and memory manager for JITed methods, and
-specific virtual machine optimizations. vmkit is not an official part of LLVM
-2.3 release. It is publicly available under the LLVM license and can be
-downloaded from:
-</p>
-
-<p>
-<tt>svn co http://llvm.org/svn/llvm-project/vmkit/trunk vmkit</tt>
-</p>
-
-</div>
-
-<!--=========================================================================-->
-<div class="doc_subsubsection">
-<a name="clang">Clang</a>
-</div>
-
-<div class="doc_text">
-
-<p>The <a href="http://clang.llvm.org/">Clang project</a> is an effort to build
-a set of new 'LLVM native' front-end technologies for the LLVM optimizer
-and code generator. Clang is continuing to make major strides forward in all
-areas. Its C and Objective-C parsing support is very solid, and the code
-generation support is far enough along to build many C applications. While not
-yet production quality, it is progressing very nicely. In addition, C++
-front-end work has started to make significant progress.</p>
-
-<p>At this point, Clang is most useful if you are interested in source-to-source
-transformations (such as refactoring) and other source-level tools for C and
-Objective-C. Clang now also includes tools for turning C code into pretty HTML,
-and includes a new <a href="http://clang.llvm.org/StaticAnalysis.html">static
-analysis tool</a> in development. This tool focuses on automatically finding
-bugs in C and Objective-C code.</p>
-
-</div>
-
-
-<!-- *********************************************************************** -->
-<div class="doc_section">
- <a name="whatsnew">What's New?</a>
-</div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>LLVM 2.3 includes a huge number of bug fixes, performance tweaks and minor
-improvements. Some of the major improvements and new features are listed in
-this section.
-</p>
-</div>
-
-<!--=========================================================================-->
-<div class="doc_subsection">
-<a name="majorfeatures">Major New Features</a>
-</div>
-
-<div class="doc_text">
-
-<p>LLVM 2.3 includes several major new capabilities:</p>
-
-<ul>
-<li><p>The biggest change in LLVM 2.3 is Multiple Return Value (MRV) support.
- MRVs allow LLVM IR to directly represent functions that return multiple
- values without having to pass them "by reference" in the LLVM IR. This
- allows a front-end to generate more efficient code, as MRVs are generally
- returned in registers if a target supports them. See the <a
- href="LangRef.html#i_getresult">LLVM IR Reference</a> for more details.</p>
-
- <p>MRVs are fully supported in the LLVM IR, but are not yet fully supported in
- on all targets. However, it is generally safe to return up to 2 values from
- a function: most targets should be able to handle at least that. MRV
- support is a critical requirement for X86-64 ABI support, as X86-64 requires
- the ability to return multiple registers from functions, and we use MRVs to
- accomplish this in a direct way.</p></li>
-
-<li><p>LLVM 2.3 includes a complete reimplementation of the "<tt>llvmc</tt>"
- tool. It is designed to overcome several problems with the original
- <tt>llvmc</tt> and to provide a superset of the features of the
- '<tt>gcc</tt>' driver.</p>
-
- <p>The main features of <tt>llvmc2</tt> are:
- <ul>
- <li>Extended handling of command line options and smart rules for
- dispatching them to different tools.</li>
- <li>Flexible (and extensible) rules for defining different tools.</li>
- <li>The different intermediate steps performed by tools are represented
- as edges in the abstract graph.</li>
- <li>The 'language' for driver behavior definition is tablegen and thus
- it's relatively easy to add new features.</li>
- <li>The definition of driver is transformed into set of C++ classes, thus
- no runtime interpretation is needed.</li>
- </ul>
-</li>
-
-<li><p>LLVM 2.3 includes a completely rewritten interface for <a
- href="LinkTimeOptimization.html">Link Time Optimization</a>. This interface
- is written in C, which allows for easier integration with C code bases, and
- incorporates improvements we learned about from the first incarnation of the
- interface.</p></li>
-
-<li><p>The <a href="tutorial/LangImpl1.html">Kaleidoscope tutorial</a> now
- includes a "port" of the tutorial that <a
- href="tutorial/OCamlLangImpl1.html">uses the Ocaml bindings</a> to implement
- the Kaleidoscope language.</p></li>
-
-</ul>
-
-</div>
-
-
-<!--=========================================================================-->
-<div class="doc_subsection">
-<a name="llvm-gcc">llvm-gcc 4.2 Improvements</a>
-</div>
-
-<div class="doc_text">
-
-<p>LLVM 2.3 fully supports the llvm-gcc 4.2 front-end, and includes support
-for the C, C++, Objective-C, Ada, and Fortran front-ends.</p>
-
-<p>
-<ul>
-<li>llvm-gcc 4.2 includes numerous fixes to better support the Objective-C
-front-end. Objective-C now works very well on Mac OS/X.</li>
-
-<li>Fortran EQUIVALENCEs are now supported by the gfortran front-end.</li>
-
-<li>llvm-gcc 4.2 includes many other fixes which improve conformance with the
-relevant parts of the GCC testsuite.</li>
-
-</ul>
-
-</div>
-
-
-<!--=========================================================================-->
-<div class="doc_subsection">
-<a name="coreimprovements">LLVM Core Improvements</a>
-</div>
-
-<div class="doc_text">
-<p>New features include:
-</p>
-
-<ul>
-<li>LLVM IR now directly represents "common" linkage, instead of representing it
-as a form of weak linkage.</li>
-
-<li>LLVM IR now has support for atomic operations, and this functionality can
-be accessed through the llvm-gcc "__sync_synchronize",
-"__sync_val_compare_and_swap", and related builtins. Support for atomics are
-available in the Alpha, X86, X86-64, and PowerPC backends.</li>
-
-<li>The C and Ocaml bindings have extended to cover pass managers, several
-transformation passes, iteration over the LLVM IR, target data, and parameter
-attribute lists.</li>
-</ul>
-
-</div>
-
-<!--=========================================================================-->
-<div class="doc_subsection">
-<a name="optimizer">Optimizer Improvements</a>
-</div>
-
-<div class="doc_text">
-
-<p>In addition to a huge array of bug fixes and minor performance tweaks, the
-LLVM 2.3 optimizers support a few major enhancements:</p>
-
-<ul>
-
-<li><p>Loop index set splitting on by default.
-This transformation hoists conditions from loop bodies and reduces a loop's
-iteration space to improve performance. For example,</p>
-
-<pre>
-for (i = LB; i &lt; UB; ++i)
- if (i &lt;= NV)
- LOOP_BODY
-</pre>
-
-<p>is transformed into:</p>
-
-<pre>
-NUB = min(NV+1, UB)
-for (i = LB; i &lt; NUB; ++i)
- LOOP_BODY
-</pre>
-</li>
-
-<li>LLVM now includes a new <tt>memcpy</tt> optimization pass which removes
-dead <tt>memcpy</tt> calls, unneeded copies of aggregates, and performs
-return slot optimization. The LLVM optimizer now notices long sequences of
-consecutive stores and merges them into <tt>memcpy</tt>'s where profitable.</li>
-
-<li>Alignment detection for vector memory references and for <tt>memcpy</tt> and
-<tt>memset</tt> is now more aggressive.</li>
-
-<li>The Aggressive Dead Code Elimination (ADCE) optimization has been rewritten
-to make it both faster and safer in the presence of code containing infinite
-loops. Some of its prior functionality has been factored out into the loop
-deletion pass, which <em>is</em> safe for infinite loops. The new ADCE pass is
-no longer based on control dependence, making it run faster.</li>
-
-<li>The 'SimplifyLibCalls' pass, which optimizes calls to libc and libm
- functions for C-based languages, has been rewritten to be a FunctionPass
- instead a ModulePass. This allows it to be run more often and to be
- included at -O1 in llvm-gcc. It was also extended to include more
- optimizations and several corner case bugs were fixed.</li>
-
-<li>LLVM now includes a simple 'Jump Threading' pass, which attempts to simplify
- conditional branches using information about predecessor blocks, simplifying
- the control flow graph. This pass is pretty basic at this point, but
- catches some important cases and provides a foundation to build on.</li>
-
-<li>Several corner case bugs which could lead to deleting volatile memory
- accesses have been fixed.</li>
-
-<li>Several optimizations have been sped up, leading to faster code generation
- with the same code quality.</li>
-
-</ul>
-
-</div>
-
-<!--=========================================================================-->
-<div class="doc_subsection">
-<a name="codegen">Code Generator Improvements</a>
-</div>
-
-<div class="doc_text">
-
-<p>We put a significant amount of work into the code generator infrastructure,
-which allows us to implement more aggressive algorithms and make it run
-faster:</p>
-
-<ul>
-<li>The code generator now has support for carrying information about memory
- references throughout the entire code generation process, via the
- <a href="http://llvm.org/doxygen/classllvm_1_1MachineMemOperand.html">
- MachineMemOperand</a> class. In the future this will be used to improve
- both pre-pass and post-pass scheduling, and to improve compiler-debugging
- output.</li>
-
-<li>The target-independent code generator infrastructure now uses LLVM's
- <a href="http://llvm.org/doxygen/classllvm_1_1APInt.html">APInt</a>
- class to handle integer values, which allows it to support integer types
- larger than 64 bits (for example i128). Note that support for such types is
- also dependent on target-specific support. Use of APInt is also a step
- toward support for non-power-of-2 integer sizes.</li>
-
-<li>LLVM 2.3 includes several compile time speedups for code with large basic
- blocks, particularly in the instruction selection phase, register
- allocation, scheduling, and tail merging/jump threading.</li>
-
-<li>LLVM 2.3 includes several improvements which make llc's
- <tt>--view-sunit-dags</tt> visualization of scheduling dependency graphs
- easier to understand.</li>
-
-<li>The code generator allows targets to write patterns that generate subreg
- references directly in .td files now.</li>
-
-<li><tt>memcpy</tt> lowering in the backend is more aggressive, particularly for
- <tt>memcpy</tt> calls introduced by the code generator when handling
- pass-by-value structure argument copies.</li>
-
-<li>Inline assembly with multiple register results now returns those results
- directly in the appropriate registers, rather than going through memory.
- Inline assembly that uses constraints like "ir" with immediates now use the
- 'i' form when possible instead of always loading the value in a register.
- This saves an instruction and reduces register use.</li>
-
-<li>Added support for PIC/GOT style <a
- href="CodeGenerator.html#tailcallopt">tail calls</a> on X86/32 and initial
- support for tail calls on PowerPC 32 (it may also work on PowerPC 64 but is
- not thoroughly tested).</li>
-</ul>
-
-</div>
-
-
-<!--=========================================================================-->
-<div class="doc_subsection">
-<a name="x86specific">X86/X86-64 Specific Improvements</a>
-</div>
-
-<div class="doc_text">
-<p>New target-specific features include:
-</p>
-
-<ul>
-<li>llvm-gcc's X86-64 ABI conformance is far improved, particularly in the
- area of passing and returning structures by value. llvm-gcc compiled code
- now interoperates very well on X86-64 systems with other compilers.</li>
-
-<li>Support for Win64 was added. This includes code generation itself, JIT
- support, and necessary changes to llvm-gcc.</li>
-
-<li>The LLVM X86 backend now supports the support SSE 4.1 instruction set, and
- the llvm-gcc 4.2 front-end supports the SSE 4.1 compiler builtins. Various
- generic vector operations (insert/extract/shuffle) are much more efficient
- when SSE 4.1 is enabled. The JIT automatically takes advantage of these
- instructions, but llvm-gcc must be explicitly told to use them, e.g. with
- <tt>-march=penryn</tt>.</li>
-
-<li>The X86 backend now does a number of optimizations that aim to avoid
- converting numbers back and forth from SSE registers to the X87 floating
- point stack. This is important because most X86 ABIs require return values
- to be on the X87 Floating Point stack, but most CPUs prefer computation in
- the SSE units.</li>
-
-<li>The X86 backend supports stack realignment, which is particularly useful for
- vector code on OS's without 16-byte aligned stacks, such as Linux and
- Windows.</li>
-
-<li>The X86 backend now supports the "sseregparm" options in GCC, which allow
- functions to be tagged as passing floating point values in SSE
- registers.</li>
-
-<li>Trampolines (taking the address of a nested function) now work on
- Linux/X86-64.</li>
-
-<li><tt>__builtin_prefetch</tt> is now compiled into the appropriate prefetch
- instructions instead of being ignored.</li>
-
-<li>128-bit integers are now supported on X86-64 targets. This can be used
- through <tt>__attribute__((TImode))</tt> in llvm-gcc.</li>
-
-<li>The register allocator can now rematerialize PIC-base computations, which is
- an important optimization for register use.</li>
-
-<li>The "t" and "f" inline assembly constraints for the X87 floating point stack
- now work. However, the "u" constraint is still not fully supported.</li>
-
-</ul>
-
-</div>
-
-<!--=========================================================================-->
-<div class="doc_subsection">
-<a name="targetspecific">Other Target Specific Improvements</a>
-</div>
-
-<div class="doc_text">
-<p>New target-specific features include:
-</p>
-
-<ul>
-<li>The LLVM C backend now supports vector code.</li>
-<li>The Cell SPU backend includes a number of improvements. It generates better
- code and its stability/completeness is improving.</li>
-</ul>
-
-</div>
-
-
-
-<!--=========================================================================-->
-<div class="doc_subsection">
-<a name="otherimprovements">Other Improvements</a>
-</div>
-
-<div class="doc_text">
-<p>New features include:
-</p>
-
-<ul>
-<li>LLVM now builds with GCC 4.3.</li>
-<li>Bugpoint now supports running custom scripts (with the <tt>-run-custom</tt>
- option) to determine how to execute the command and whether it is making
- forward process.</li>
-</ul>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section">
- <a name="portability">Portability and Supported Platforms</a>
-</div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>LLVM is known to work on the following platforms:</p>
-
-<ul>
-<li>Intel and AMD machines (IA32) running Red Hat Linux, Fedora Core and FreeBSD
- (and probably other unix-like systems).</li>
-<li>PowerPC and X86-based Mac OS X systems, running 10.3 and above in 32-bit and
- 64-bit modes.</li>
-<li>Intel and AMD machines running on Win32 using MinGW libraries (native).</li>
-<li>Intel and AMD machines running on Win32 with the Cygwin libraries (limited
- support is available for native builds with Visual C++).</li>
-<li>Sun UltraSPARC workstations running Solaris 10.</li>
-<li>Alpha-based machines running Debian GNU/Linux.</li>
-<li>Itanium-based (IA64) machines running Linux and HP-UX.</li>
-</ul>
-
-<p>The core LLVM infrastructure uses GNU autoconf to adapt itself
-to the machine and operating system on which it is built. However, minor
-porting may be required to get LLVM to work on new platforms. We welcome your
-portability patches and reports of successful builds or error messages.</p>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section">
- <a name="knownproblems">Known Problems</a>
-</div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>This section contains all known problems with the LLVM system, listed by
-component. As new problems are discovered, they will be added to these
-sections. If you run into a problem, please check the <a
-href="http://llvm.org/bugs/">LLVM bug database</a> and submit a bug if
-there isn't already one.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="experimental">Experimental features included with this release</a>
-</div>
-
-<div class="doc_text">
-
-<p>The following components of this LLVM release are either untested, known to
-be broken or unreliable, or are in early development. These components should
-not be relied on, and bugs should not be filed against them, but they may be
-useful to some people. In particular, if you would like to work on one of these
-components, please contact us on the <a
-href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev">LLVMdev list</a>.</p>
-
-<ul>
-<li>The MSIL, IA64, Alpha, SPU, and MIPS backends are experimental.</li>
-<li>The llc "<tt>-filetype=asm</tt>" (the default) is the only supported
- value for this option.</li>
-</ul>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="x86-be">Known problems with the X86 back-end</a>
-</div>
-
-<div class="doc_text">
-
-<ul>
- <li>The X86 backend does not yet support
- all <a href="http://llvm.org/PR879">inline assembly that uses the X86
- floating point stack</a>. It supports the 'f' and 't' constraints, but not
- 'u'.</li>
- <li>The X86 backend generates inefficient floating point code when configured
- to generate code for systems that don't have SSE2.</li>
- <li>Win64 code generation wasn't widely tested. Everything should work, but we
- expect small issues to happen. Also, llvm-gcc cannot build mingw64 runtime
- currently due
- to <a href="http://llvm.org/PR2255">several</a>
- <a href="http://llvm.org/PR2257">bugs</a> due to lack of support for the
- 'u' inline assembly constraint and X87 floating point inline assembly.</li>
- <li>The X86-64 backend does not yet support position-independent code (PIC)
- generation on Linux targets.</li>
- <li>The X86-64 backend does not yet support the LLVM IR instruction
- <tt>va_arg</tt>. Currently, the llvm-gcc front-end supports variadic
- argument constructs on X86-64 by lowering them manually.</li>
-</ul>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="ppc-be">Known problems with the PowerPC back-end</a>
-</div>
-
-<div class="doc_text">
-
-<ul>
-<li>The Linux PPC32/ABI support needs testing for the interpreter and static
-compilation, and lacks support for debug information.</li>
-</ul>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="arm-be">Known problems with the ARM back-end</a>
-</div>
-
-<div class="doc_text">
-
-<ul>
-<li>Thumb mode works only on ARMv6 or higher processors. On sub-ARMv6
-processors, thumb programs can crash or produce wrong
-results (<a href="http://llvm.org/PR1388">PR1388</a>).</li>
-<li>Compilation for ARM Linux OABI (old ABI) is supported, but not fully tested.
-</li>
-<li>There is a bug in QEMU-ARM (&lt;= 0.9.0) which causes it to incorrectly
- execute
-programs compiled with LLVM. Please use more recent versions of QEMU.</li>
-</ul>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="sparc-be">Known problems with the SPARC back-end</a>
-</div>
-
-<div class="doc_text">
-
-<ul>
-<li>The SPARC backend only supports the 32-bit SPARC ABI (-m32), it does not
- support the 64-bit SPARC ABI (-m64).</li>
-</ul>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="alpha-be">Known problems with the Alpha back-end</a>
-</div>
-
-<div class="doc_text">
-
-<ul>
-
-<li>On 21164s, some rare FP arithmetic sequences which may trap do not have the
-appropriate nops inserted to ensure restartability.</li>
-
-</ul>
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="ia64-be">Known problems with the IA64 back-end</a>
-</div>
-
-<div class="doc_text">
-
-<ul>
-<li>The Itanium backend is highly experimental, and has a number of known
- issues. We are looking for a maintainer for the Itanium backend. If you
- are interested, please contact the llvmdev mailing list.</li>
-</ul>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="c-be">Known problems with the C back-end</a>
-</div>
-
-<div class="doc_text">
-
-<ul>
-<li><a href="http://llvm.org/PR802">The C backend has only basic support for
- inline assembly code</a>.</li>
-<li><a href="http://llvm.org/PR1658">The C backend violates the ABI of common
- C++ programs</a>, preventing intermixing between C++ compiled by the CBE and
- C++ code compiled with llc or native compilers.</li>
-<li>The C backend does not support all exception handling constructs.</li>
-</ul>
-
-</div>
-
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="c-fe">Known problems with the llvm-gcc C front-end</a>
-</div>
-
-<div class="doc_text">
-
-<p>llvm-gcc does not currently support <a href="http://llvm.org/PR869">Link-Time
-Optimization</a> on most platforms "out-of-the-box". Please inquire on the
-llvmdev mailing list if you are interested.</p>
-
-<p>The only major language feature of GCC not supported by llvm-gcc is
- the <tt>__builtin_apply</tt> family of builtins. However, some extensions
- are only supported on some targets. For example, trampolines are only
- supported on some targets (these are used when you take the address of a
- nested function).</p>
-
-<p>If you run into GCC extensions which are not supported, please let us know.
-</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="c++-fe">Known problems with the llvm-gcc C++ front-end</a>
-</div>
-
-<div class="doc_text">
-
-<p>The C++ front-end is considered to be fully
-tested and works for a number of non-trivial programs, including LLVM
-itself, Qt, Mozilla, etc.</p>
-
-<ul>
-<li>Exception handling works well on the X86 and PowerPC targets, including
-X86-64 darwin. This works when linking to a libstdc++ compiled by GCC. It is
-supported on X86-64 linux, but that is disabled by default in this release.</li>
-</ul>
-
-</div>
-
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="ada-fe">Known problems with the llvm-gcc Ada front-end</a>
-</div>
-
-<div class="doc_text">
-The llvm-gcc 4.2 Ada compiler works fairly well, however this is not a mature
-technology and problems should be expected.
-<ul>
-<li>The Ada front-end currently only builds on X86-32. This is mainly due
-to lack of trampoline support (pointers to nested functions) on other platforms,
-however it <a href="http://llvm.org/PR2006">also fails to build on X86-64</a>
-which does support trampolines.</li>
-<li>The Ada front-end <a href="http://llvm.org/PR2007">fails to bootstrap</a>.
-Workaround: configure with --disable-bootstrap.</li>
-<li>The c380004 and <a href="http://llvm.org/PR2010">c393010</a> ACATS tests
-fail (c380004 also fails with gcc-4.2 mainline). When built at -O3, the
-<a href="http://llvm.org/PR2421">cxg2021</a> ACATS test also fails.</li>
-<li>Some gcc specific Ada tests continue to crash the compiler. The testsuite
-reports most tests as having failed even though they pass.</li>
-<li>The -E binder option (exception backtraces)
-<a href="http://llvm.org/PR1982">does not work</a> and will result in programs
-crashing if an exception is raised. Workaround: do not use -E.</li>
-<li>Only discrete types <a href="http://llvm.org/PR1981">are allowed to start
-or finish at a non-byte offset</a> in a record. Workaround: do not pack records
-or use representation clauses that result in a field of a non-discrete type
-starting or finishing in the middle of a byte.</li>
-<li>The <tt>lli</tt> interpreter <a href="http://llvm.org/PR2009">considers
-'main' as generated by the Ada binder to be invalid</a>.
-Workaround: hand edit the file to use pointers for <tt>argv</tt> and
-<tt>envp</tt> rather than integers.</li>
-<li>The <tt>-fstack-check</tt> option <a href="http://llvm.org/PR2008">is
-ignored</a>.</li>
-</ul>
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section">
- <a name="additionalinfo">Additional Information</a>
-</div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>A wide variety of additional information is available on the <a
-href="http://llvm.org">LLVM web page</a>, in particular in the <a
-href="http://llvm.org/docs/">documentation</a> section. The web page also
-contains versions of the API documentation which is up-to-date with the
-Subversion version of the source code.
-You can access versions of these documents specific to this release by going
-into the "<tt>llvm/doc/</tt>" directory in the LLVM tree.</p>
-
-<p>If you have any questions or comments about LLVM, please feel free to contact
-us via the <a href="http://llvm.org/docs/#maillist"> mailing
-lists</a>.</p>
-
-</div>
-
-<!-- *********************************************************************** -->
-
-<hr>
-<address>
- <a href="http://jigsaw.w3.org/css-validator/check/referer"><img
- src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"></a>
- <a href="http://validator.w3.org/check/referer"><img
- src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!"></a>
-
- <a href="http://llvm.org/">LLVM Compiler Infrastructure</a><br>
- Last modified: $Date$
-</address>
-
-</body>
-</html>
diff --git a/release_23/docs/SourceLevelDebugging.html b/release_23/docs/SourceLevelDebugging.html
deleted file mode 100644
index 172ede02e6af..000000000000
--- a/release_23/docs/SourceLevelDebugging.html
+++ /dev/null
@@ -1,1785 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
- "http://www.w3.org/TR/html4/strict.dtd">
-<html>
-<head>
- <title>Source Level Debugging with LLVM</title>
- <link rel="stylesheet" href="llvm.css" type="text/css">
-</head>
-<body>
-
-<div class="doc_title">Source Level Debugging with LLVM</div>
-
-<table class="layout" style="width:100%">
- <tr class="layout">
- <td class="left">
-<ul>
- <li><a href="#introduction">Introduction</a>
- <ol>
- <li><a href="#phil">Philosophy behind LLVM debugging information</a></li>
- <li><a href="#consumers">Debug information consumers</a></li>
- <li><a href="#debugopt">Debugging optimized code</a></li>
- </ol></li>
- <li><a href="#format">Debugging information format</a>
- <ol>
- <li><a href="#debug_info_descriptors">Debug information descriptors</a>
- <ul>
- <li><a href="#format_anchors">Anchor descriptors</a></li>
- <li><a href="#format_compile_units">Compile unit descriptors</a></li>
- <li><a href="#format_global_variables">Global variable descriptors</a></li>
- <li><a href="#format_subprograms">Subprogram descriptors</a></li>
- <li><a href="#format_blocks">Block descriptors</a></li>
- <li><a href="#format_basic_type">Basic type descriptors</a></li>
- <li><a href="#format_derived_type">Derived type descriptors</a></li>
- <li><a href="#format_composite_type">Composite type descriptors</a></li>
- <li><a href="#format_subrange">Subrange descriptors</a></li>
- <li><a href="#format_enumeration">Enumerator descriptors</a></li>
- <li><a href="#format_variables">Local variables</a></li>
- </ul></li>
- <li><a href="#format_common_intrinsics">Debugger intrinsic functions</a>
- <ul>
- <li><a href="#format_common_stoppoint">llvm.dbg.stoppoint</a></li>
- <li><a href="#format_common_func_start">llvm.dbg.func.start</a></li>
- <li><a href="#format_common_region_start">llvm.dbg.region.start</a></li>
- <li><a href="#format_common_region_end">llvm.dbg.region.end</a></li>
- <li><a href="#format_common_declare">llvm.dbg.declare</a></li>
- </ul></li>
- <li><a href="#format_common_stoppoints">Representing stopping points in the
- source program</a></li>
- </ol></li>
- <li><a href="#ccxx_frontend">C/C++ front-end specific debug information</a>
- <ol>
- <li><a href="#ccxx_compile_units">C/C++ source file information</a></li>
- <li><a href="#ccxx_global_variable">C/C++ global variable information</a></li>
- <li><a href="#ccxx_subprogram">C/C++ function information</a></li>
- <li><a href="#ccxx_basic_types">C/C++ basic types</a></li>
- <li><a href="#ccxx_derived_types">C/C++ derived types</a></li>
- <li><a href="#ccxx_composite_types">C/C++ struct/union types</a></li>
- <li><a href="#ccxx_enumeration_types">C/C++ enumeration types</a></li>
- </ol></li>
-</ul>
-</td>
-<td class="right">
-<img src="img/venusflytrap.jpg" alt="A leafy and green bug eater" width="247"
-height="369">
-</td>
-</tr></table>
-
-<div class="doc_author">
- <p>Written by <a href="mailto:sabre@nondot.org">Chris Lattner</a>
- and <a href="mailto:jlaskey@mac.com">Jim Laskey</a></p>
-</div>
-
-
-<!-- *********************************************************************** -->
-<div class="doc_section"><a name="introduction">Introduction</a></div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>This document is the central repository for all information pertaining to
-debug information in LLVM. It describes the <a href="#format">actual format
-that the LLVM debug information</a> takes, which is useful for those interested
-in creating front-ends or dealing directly with the information. Further, this
-document provides specifc examples of what debug information for C/C++.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="phil">Philosophy behind LLVM debugging information</a>
-</div>
-
-<div class="doc_text">
-
-<p>The idea of the LLVM debugging information is to capture how the important
-pieces of the source-language's Abstract Syntax Tree map onto LLVM code.
-Several design aspects have shaped the solution that appears here. The
-important ones are:</p>
-
-<ul>
-<li>Debugging information should have very little impact on the rest of the
-compiler. No transformations, analyses, or code generators should need to be
-modified because of debugging information.</li>
-
-<li>LLVM optimizations should interact in <a href="#debugopt">well-defined and
-easily described ways</a> with the debugging information.</li>
-
-<li>Because LLVM is designed to support arbitrary programming languages,
-LLVM-to-LLVM tools should not need to know anything about the semantics of the
-source-level-language.</li>
-
-<li>Source-level languages are often <b>widely</b> different from one another.
-LLVM should not put any restrictions of the flavor of the source-language, and
-the debugging information should work with any language.</li>
-
-<li>With code generator support, it should be possible to use an LLVM compiler
-to compile a program to native machine code and standard debugging formats.
-This allows compatibility with traditional machine-code level debuggers, like
-GDB or DBX.</li>
-
-</ul>
-
-<p>The approach used by the LLVM implementation is to use a small set of <a
-href="#format_common_intrinsics">intrinsic functions</a> to define a mapping
-between LLVM program objects and the source-level objects. The description of
-the source-level program is maintained in LLVM global variables in an <a
-href="#ccxx_frontend">implementation-defined format</a> (the C/C++ front-end
-currently uses working draft 7 of the <a
-href="http://www.eagercon.com/dwarf/dwarf3std.htm">Dwarf 3 standard</a>).</p>
-
-<p>When a program is being debugged, a debugger interacts with the user and
-turns the stored debug information into source-language specific information.
-As such, a debugger must be aware of the source-language, and is thus tied to
-a specific language or family of languages.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="consumers">Debug information consumers</a>
-</div>
-
-<div class="doc_text">
-<p>The role of debug information is to provide meta information normally
-stripped away during the compilation process. This meta information provides an
-LLVM user a relationship between generated code and the original program source
-code.</p>
-
-<p>Currently, debug information is consumed by the DwarfWriter to produce dwarf
-information used by the gdb debugger. Other targets could use the same
-information to produce stabs or other debug forms.</p>
-
-<p>It would also be reasonable to use debug information to feed profiling tools
-for analysis of generated code, or, tools for reconstructing the original source
-from generated code.</p>
-
-<p>TODO - expound a bit more.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="debugopt">Debugging optimized code</a>
-</div>
-
-<div class="doc_text">
-
-<p>An extremely high priority of LLVM debugging information is to make it
-interact well with optimizations and analysis. In particular, the LLVM debug
-information provides the following guarantees:</p>
-
-<ul>
-
-<li>LLVM debug information <b>always provides information to accurately read the
-source-level state of the program</b>, regardless of which LLVM optimizations
-have been run, and without any modification to the optimizations themselves.
-However, some optimizations may impact the ability to modify the current state
-of the program with a debugger, such as setting program variables, or calling
-functions that have been deleted.</li>
-
-<li>LLVM optimizations gracefully interact with debugging information. If they
-are not aware of debug information, they are automatically disabled as necessary
-in the cases that would invalidate the debug info. This retains the LLVM
-features, making it easy to write new transformations.</li>
-
-<li>As desired, LLVM optimizations can be upgraded to be aware of the LLVM
-debugging information, allowing them to update the debugging information as they
-perform aggressive optimizations. This means that, with effort, the LLVM
-optimizers could optimize debug code just as well as non-debug code.</li>
-
-<li>LLVM debug information does not prevent many important optimizations from
-happening (for example inlining, basic block reordering/merging/cleanup, tail
-duplication, etc), further reducing the amount of the compiler that eventually
-is "aware" of debugging information.</li>
-
-<li>LLVM debug information is automatically optimized along with the rest of the
-program, using existing facilities. For example, duplicate information is
-automatically merged by the linker, and unused information is automatically
-removed.</li>
-
-</ul>
-
-<p>Basically, the debug information allows you to compile a program with
-"<tt>-O0 -g</tt>" and get full debug information, allowing you to arbitrarily
-modify the program as it executes from a debugger. Compiling a program with
-"<tt>-O3 -g</tt>" gives you full debug information that is always available and
-accurate for reading (e.g., you get accurate stack traces despite tail call
-elimination and inlining), but you might lose the ability to modify the program
-and call functions where were optimized out of the program, or inlined away
-completely.</p>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section">
- <a name="format">Debugging information format</a>
-</div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>LLVM debugging information has been carefully designed to make it possible
-for the optimizer to optimize the program and debugging information without
-necessarily having to know anything about debugging information. In particular,
-the global constant merging pass automatically eliminates duplicated debugging
-information (often caused by header files), the global dead code elimination
-pass automatically deletes debugging information for a function if it decides to
-delete the function, and the linker eliminates debug information when it merges
-<tt>linkonce</tt> functions.</p>
-
-<p>To do this, most of the debugging information (descriptors for types,
-variables, functions, source files, etc) is inserted by the language front-end
-in the form of LLVM global variables. These LLVM global variables are no
-different from any other global variables, except that they have a web of LLVM
-intrinsic functions that point to them. If the last references to a particular
-piece of debugging information are deleted (for example, by the
-<tt>-globaldce</tt> pass), the extraneous debug information will automatically
-become dead and be removed by the optimizer.</p>
-
-<p>Debug information is designed to be agnostic about the target debugger and
-debugging information representation (e.g. DWARF/Stabs/etc). It uses a generic
-machine debug information pass to decode the information that represents
-variables, types, functions, namespaces, etc: this allows for arbitrary
-source-language semantics and type-systems to be used, as long as there is a
-module written for the target debugger to interpret the information. In
-addition, debug global variables are declared in the <tt>"llvm.metadata"</tt>
-section. All values declared in this section are stripped away after target
-debug information is constructed and before the program object is emitted.</p>
-
-<p>To provide basic functionality, the LLVM debugger does have to make some
-assumptions about the source-level language being debugged, though it keeps
-these to a minimum. The only common features that the LLVM debugger assumes
-exist are <a href="#format_compile_units">source files</a>, and <a
-href="#format_global_variables">program objects</a>. These abstract objects are
-used by a debugger to form stack traces, show information about local
-variables, etc.</p>
-
-<p>This section of the documentation first describes the representation aspects
-common to any source-language. The <a href="#ccxx_frontend">next section</a>
-describes the data layout conventions used by the C and C++ front-ends.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="debug_info_descriptors">Debug information descriptors</a>
-</div>
-
-<div class="doc_text">
-<p>In consideration of the complexity and volume of debug information, LLVM
-provides a specification for well formed debug global variables. The constant
-value of each of these globals is one of a limited set of structures, known as
-debug descriptors.</p>
-
-<p>Consumers of LLVM debug information expect the descriptors for program
-objects to start in a canonical format, but the descriptors can include
-additional information appended at the end that is source-language specific. All
-LLVM debugging information is versioned, allowing backwards compatibility in the
-case that the core structures need to change in some way. Also, all debugging
-information objects start with a tag to indicate what type of object it is. The
-source-language is allowed to define its own objects, by using unreserved tag
-numbers. We recommend using with tags in the range 0x1000 thru 0x2000 (there is
-a defined enum DW_TAG_user_base = 0x1000.)</p>
-
-<p>The fields of debug descriptors used internally by LLVM (MachineModuleInfo)
-are restricted to only the simple data types <tt>int</tt>, <tt>uint</tt>,
-<tt>bool</tt>, <tt>float</tt>, <tt>double</tt>, <tt>sbyte*</tt> and <tt> { }*
-</tt>. References to arbitrary values are handled using a <tt> { }* </tt> and a
-cast to <tt> { }* </tt> expression; typically references to other field
-descriptors, arrays of descriptors or global variables.</p>
-
-<pre>
- %llvm.dbg.object.type = type {
- uint, ;; A tag
- ...
- }
-</pre>
-
-<p><a name="LLVMDebugVersion">The first field of a descriptor is always an
-<tt>uint</tt> containing a tag value identifying the content of the descriptor.
-The remaining fields are specific to the descriptor. The values of tags are
-loosely bound to the tag values of Dwarf information entries. However, that
-does not restrict the use of the information supplied to Dwarf targets. To
-facilitate versioning of debug information, the tag is augmented with the
-current debug version (LLVMDebugVersion = 4 << 16 or 0x40000 or 262144.)</a></p>
-
-<p>The details of the various descriptors follow.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsubsection">
- <a name="format_anchors">Anchor descriptors</a>
-</div>
-
-<div class="doc_text">
-
-<pre>
- %<a href="#format_anchors">llvm.dbg.anchor.type</a> = type {
- uint, ;; Tag = 0 + <a href="#LLVMDebugVersion">LLVMDebugVersion</a>
- uint ;; Tag of descriptors grouped by the anchor
- }
-</pre>
-
-<p>One important aspect of the LLVM debug representation is that it allows the
-LLVM debugger to efficiently index all of the global objects without having the
-scan the program. To do this, all of the global objects use "anchor"
-descriptors with designated names. All of the global objects of a particular
-type (e.g., compile units) contain a pointer to the anchor. This pointer allows
-a debugger to use def-use chains to find all global objects of that type.</p>
-
-<p>The following names are recognized as anchors by LLVM:</p>
-
-<pre>
- %<a href="#format_compile_units">llvm.dbg.compile_units</a> = linkonce constant %<a href="#format_anchors">llvm.dbg.anchor.type</a> { uint 0, uint 17 } ;; DW_TAG_compile_unit
- %<a href="#format_global_variables">llvm.dbg.global_variables</a> = linkonce constant %<a href="#format_anchors">llvm.dbg.anchor.type</a> { uint 0, uint 52 } ;; DW_TAG_variable
- %<a href="#format_subprograms">llvm.dbg.subprograms</a> = linkonce constant %<a href="#format_anchors">llvm.dbg.anchor.type</a> { uint 0, uint 46 } ;; DW_TAG_subprogram
-</pre>
-
-<p>Using anchors in this way (where the compile unit descriptor points to the
-anchors, as opposed to having a list of compile unit descriptors) allows for the
-standard dead global elimination and merging passes to automatically remove
-unused debugging information. If the globals were kept track of through lists,
-there would always be an object pointing to the descriptors, thus would never be
-deleted.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsubsection">
- <a name="format_compile_units">Compile unit descriptors</a>
-</div>
-
-<div class="doc_text">
-
-<pre>
- %<a href="#format_compile_units">llvm.dbg.compile_unit.type</a> = type {
- uint, ;; Tag = 17 + <a href="#LLVMDebugVersion">LLVMDebugVersion</a> (DW_TAG_compile_unit)
- { }*, ;; Compile unit anchor = cast = (%<a href="#format_anchors">llvm.dbg.anchor.type</a>* %<a href="#format_compile_units">llvm.dbg.compile_units</a> to { }*)
- uint, ;; Dwarf language identifier (ex. DW_LANG_C89)
- sbyte*, ;; Source file name
- sbyte*, ;; Source file directory (includes trailing slash)
- sbyte* ;; Producer (ex. "4.0.1 LLVM (LLVM research group)")
- }
-</pre>
-
-<p>These descriptors contain a source language ID for the file (we use the Dwarf
-3.0 ID numbers, such as <tt>DW_LANG_C89</tt>, <tt>DW_LANG_C_plus_plus</tt>,
-<tt>DW_LANG_Cobol74</tt>, etc), three strings describing the filename, working
-directory of the compiler, and an identifier string for the compiler that
-produced it.</p>
-
-<p> Compile unit descriptors provide the root context for objects declared in a
-specific source file. Global variables and top level functions would be defined
-using this context. Compile unit descriptors also provide context for source
-line correspondence.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsubsection">
- <a name="format_global_variables">Global variable descriptors</a>
-</div>
-
-<div class="doc_text">
-
-<pre>
- %<a href="#format_global_variables">llvm.dbg.global_variable.type</a> = type {
- uint, ;; Tag = 52 + <a href="#LLVMDebugVersion">LLVMDebugVersion</a> (DW_TAG_variable)
- { }*, ;; Global variable anchor = cast (%<a href="#format_anchors">llvm.dbg.anchor.type</a>* %<a href="#format_global_variables">llvm.dbg.global_variables</a> to { }*),
- { }*, ;; Reference to context descriptor
- sbyte*, ;; Name
- sbyte*, ;; Display name (fully qualified C++ name)
- sbyte*, ;; MIPS linkage name (for C++)
- { }*, ;; Reference to compile unit where defined
- uint, ;; Line number where defined
- { }*, ;; Reference to type descriptor
- bool, ;; True if the global is local to compile unit (static)
- bool, ;; True if the global is defined in the compile unit (not extern)
- { }* ;; Reference to the global variable
- }
-</pre>
-
-<p>These descriptors provide debug information about globals variables. The
-provide details such as name, type and where the variable is defined.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsubsection">
- <a name="format_subprograms">Subprogram descriptors</a>
-</div>
-
-<div class="doc_text">
-
-<pre>
- %<a href="#format_subprograms">llvm.dbg.subprogram.type</a> = type {
- uint, ;; Tag = 46 + <a href="#LLVMDebugVersion">LLVMDebugVersion</a> (DW_TAG_subprogram)
- { }*, ;; Subprogram anchor = cast (%<a href="#format_anchors">llvm.dbg.anchor.type</a>* %<a href="#format_subprograms">llvm.dbg.subprograms</a> to { }*),
- { }*, ;; Reference to context descriptor
- sbyte*, ;; Name
- sbyte*, ;; Display name (fully qualified C++ name)
- sbyte*, ;; MIPS linkage name (for C++)
- { }*, ;; Reference to compile unit where defined
- uint, ;; Line number where defined
- { }*, ;; Reference to type descriptor
- bool, ;; True if the global is local to compile unit (static)
- bool ;; True if the global is defined in the compile unit (not extern)
- }
-</pre>
-
-<p>These descriptors provide debug information about functions, methods and
-subprograms. They provide details such as name, return types and the source
-location where the subprogram is defined.</p>
-
-</div>
-<!-- ======================================================================= -->
-<div class="doc_subsubsection">
- <a name="format_blocks">Block descriptors</a>
-</div>
-
-<div class="doc_text">
-
-<pre>
- %<a href="#format_blocks">llvm.dbg.block</a> = type {
- uint, ;; Tag = 13 + <a href="#LLVMDebugVersion">LLVMDebugVersion</a> (DW_TAG_lexical_block)
- { }* ;; Reference to context descriptor
- }
-</pre>
-
-<p>These descriptors provide debug information about nested blocks within a
-subprogram. The array of member descriptors is used to define local variables
-and deeper nested blocks.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsubsection">
- <a name="format_basic_type">Basic type descriptors</a>
-</div>
-
-<div class="doc_text">
-
-<pre>
- %<a href="#format_basic_type">llvm.dbg.basictype.type</a> = type {
- uint, ;; Tag = 36 + <a href="#LLVMDebugVersion">LLVMDebugVersion</a> (DW_TAG_base_type)
- { }*, ;; Reference to context (typically a compile unit)
- sbyte*, ;; Name (may be "" for anonymous types)
- { }*, ;; Reference to compile unit where defined (may be NULL)
- uint, ;; Line number where defined (may be 0)
- uint, ;; Size in bits
- uint, ;; Alignment in bits
- uint, ;; Offset in bits
- uint ;; Dwarf type encoding
- }
-</pre>
-
-<p>These descriptors define primitive types used in the code. Example int, bool
-and float. The context provides the scope of the type, which is usually the top
-level. Since basic types are not usually user defined the compile unit and line
-number can be left as NULL and 0. The size, alignment and offset are expressed
-in bits and can be 64 bit values. The alignment is used to round the offset
-when embedded in a <a href="#format_composite_type">composite type</a>
-(example to keep float doubles on 64 bit boundaries.) The offset is the bit
-offset if embedded in a <a href="#format_composite_type">composite
-type</a>.</p>
-
-<p>The type encoding provides the details of the type. The values are typically
-one of the following;</p>
-
-<pre>
- DW_ATE_address = 1
- DW_ATE_boolean = 2
- DW_ATE_float = 4
- DW_ATE_signed = 5
- DW_ATE_signed_char = 6
- DW_ATE_unsigned = 7
- DW_ATE_unsigned_char = 8
-</pre>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsubsection">
- <a name="format_derived_type">Derived type descriptors</a>
-</div>
-
-<div class="doc_text">
-
-<pre>
- %<a href="#format_derived_type">llvm.dbg.derivedtype.type</a> = type {
- uint, ;; Tag (see below)
- { }*, ;; Reference to context
- sbyte*, ;; Name (may be "" for anonymous types)
- { }*, ;; Reference to compile unit where defined (may be NULL)
- uint, ;; Line number where defined (may be 0)
- uint, ;; Size in bits
- uint, ;; Alignment in bits
- uint, ;; Offset in bits
- { }* ;; Reference to type derived from
- }
-</pre>
-
-<p>These descriptors are used to define types derived from other types. The
-value of the tag varies depending on the meaning. The following are possible
-tag values;</p>
-
-<pre>
- DW_TAG_formal_parameter = 5
- DW_TAG_member = 13
- DW_TAG_pointer_type = 15
- DW_TAG_reference_type = 16
- DW_TAG_typedef = 22
- DW_TAG_const_type = 38
- DW_TAG_volatile_type = 53
- DW_TAG_restrict_type = 55
-</pre>
-
-<p> <tt>DW_TAG_member</tt> is used to define a member of a <a
-href="#format_composite_type">composite type</a> or <a
-href="#format_subprograms">subprogram</a>. The type of the member is the <a
-href="#format_derived_type">derived type</a>. <tt>DW_TAG_formal_parameter</tt>
-is used to define a member which is a formal argument of a subprogram.</p>
-
-<p><tt>DW_TAG_typedef</tt> is used to
-provide a name for the derived type.</p>
-
-<p><tt>DW_TAG_pointer_type</tt>,
-<tt>DW_TAG_reference_type</tt>, <tt>DW_TAG_const_type</tt>,
-<tt>DW_TAG_volatile_type</tt> and <tt>DW_TAG_restrict_type</tt> are used to
-qualify the <a href="#format_derived_type">derived type</a>. </p>
-
-<p><a href="#format_derived_type">Derived type</a> location can be determined
-from the compile unit and line number. The size, alignment and offset are
-expressed in bits and can be 64 bit values. The alignment is used to round the
-offset when embedded in a <a href="#format_composite_type">composite type</a>
-(example to keep float doubles on 64 bit boundaries.) The offset is the bit
-offset if embedded in a <a href="#format_composite_type">composite
-type</a>.</p>
-
-<p>Note that the <tt>void *</tt> type is expressed as a
-<tt>llvm.dbg.derivedtype.type</tt> with tag of <tt>DW_TAG_pointer_type</tt> and
-NULL derived type.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsubsection">
- <a name="format_composite_type">Composite type descriptors</a>
-</div>
-
-<div class="doc_text">
-
-<pre>
- %<a href="#format_composite_type">llvm.dbg.compositetype.type</a> = type {
- uint, ;; Tag (see below)
- { }*, ;; Reference to context
- sbyte*, ;; Name (may be "" for anonymous types)
- { }*, ;; Reference to compile unit where defined (may be NULL)
- uint, ;; Line number where defined (may be 0)
- uint, ;; Size in bits
- uint, ;; Alignment in bits
- uint, ;; Offset in bits
- { }* ;; Reference to array of member descriptors
- }
-</pre>
-
-<p>These descriptors are used to define types that are composed of 0 or more
-elements. The value of the tag varies depending on the meaning. The following
-are possible tag values;</p>
-
-<pre>
- DW_TAG_array_type = 1
- DW_TAG_enumeration_type = 4
- DW_TAG_structure_type = 19
- DW_TAG_union_type = 23
- DW_TAG_vector_type = 259
- DW_TAG_subroutine_type = 46
- DW_TAG_inheritance = 26
-</pre>
-
-<p>The vector flag indicates that an array type is a native packed vector.</p>
-
-<p>The members of array types (tag = <tt>DW_TAG_array_type</tt>) or vector types
-(tag = <tt>DW_TAG_vector_type</tt>) are <a href="#format_subrange">subrange
-descriptors</a>, each representing the range of subscripts at that level of
-indexing.</p>
-
-<p>The members of enumeration types (tag = <tt>DW_TAG_enumeration_type</tt>) are
-<a href="#format_enumeration">enumerator descriptors</a>, each representing the
-definition of enumeration value
-for the set.</p>
-
-<p>The members of structure (tag = <tt>DW_TAG_structure_type</tt>) or union (tag
-= <tt>DW_TAG_union_type</tt>) types are any one of the <a
-href="#format_basic_type">basic</a>, <a href="#format_derived_type">derived</a>
-or <a href="#format_composite_type">composite</a> type descriptors, each
-representing a field member of the structure or union.</p>
-
-<p>For C++ classes (tag = <tt>DW_TAG_structure_type</tt>), member descriptors
-provide information about base classes, static members and member functions. If
-a member is a <a href="#format_derived_type">derived type descriptor</a> and has
-a tag of <tt>DW_TAG_inheritance</tt>, then the type represents a base class. If
-the member of is a <a href="#format_global_variables">global variable
-descriptor</a> then it represents a static member. And, if the member is a <a
-href="#format_subprograms">subprogram descriptor</a> then it represents a member
-function. For static members and member functions, <tt>getName()</tt> returns
-the members link or the C++ mangled name. <tt>getDisplayName()</tt> the
-simplied version of the name.</p>
-
-<p>The first member of subroutine (tag = <tt>DW_TAG_subroutine_type</tt>)
-type elements is the return type for the subroutine. The remaining
-elements are the formal arguments to the subroutine.</p>
-
-<p><a href="#format_composite_type">Composite type</a> location can be
-determined from the compile unit and line number. The size, alignment and
-offset are expressed in bits and can be 64 bit values. The alignment is used to
-round the offset when embedded in a <a href="#format_composite_type">composite
-type</a> (as an example, to keep float doubles on 64 bit boundaries.) The offset
-is the bit offset if embedded in a <a href="#format_composite_type">composite
-type</a>.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsubsection">
- <a name="format_subrange">Subrange descriptors</a>
-</div>
-
-<div class="doc_text">
-
-<pre>
- %<a href="#format_subrange">llvm.dbg.subrange.type</a> = type {
- uint, ;; Tag = 33 + <a href="#LLVMDebugVersion">LLVMDebugVersion</a> (DW_TAG_subrange_type)
- uint, ;; Low value
- uint ;; High value
- }
-</pre>
-
-<p>These descriptors are used to define ranges of array subscripts for an array
-<a href="#format_composite_type">composite type</a>. The low value defines the
-lower bounds typically zero for C/C++. The high value is the upper bounds.
-Values are 64 bit. High - low + 1 is the size of the array. If
-low == high the array will be unbounded.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsubsection">
- <a name="format_enumeration">Enumerator descriptors</a>
-</div>
-
-<div class="doc_text">
-
-<pre>
- %<a href="#format_enumeration">llvm.dbg.enumerator.type</a> = type {
- uint, ;; Tag = 40 + <a href="#LLVMDebugVersion">LLVMDebugVersion</a> (DW_TAG_enumerator)
- sbyte*, ;; Name
- uint ;; Value
- }
-</pre>
-
-<p>These descriptors are used to define members of an enumeration <a
-href="#format_composite_type">composite type</a>, it associates the name to the
-value.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsubsection">
- <a name="format_variables">Local variables</a>
-</div>
-
-<div class="doc_text">
-<pre>
- %<a href="#format_variables">llvm.dbg.variable.type</a> = type {
- uint, ;; Tag (see below)
- { }*, ;; Context
- sbyte*, ;; Name
- { }*, ;; Reference to compile unit where defined
- uint, ;; Line number where defined
- { }* ;; Type descriptor
- }
-</pre>
-
-<p>These descriptors are used to define variables local to a sub program. The
-value of the tag depends on the usage of the variable;</p>
-
-<pre>
- DW_TAG_auto_variable = 256
- DW_TAG_arg_variable = 257
- DW_TAG_return_variable = 258
-</pre>
-
-<p>An auto variable is any variable declared in the body of the function. An
-argument variable is any variable that appears as a formal argument to the
-function. A return variable is used to track the result of a function and has
-no source correspondent.</p>
-
-<p>The context is either the subprogram or block where the variable is defined.
-Name the source variable name. Compile unit and line indicate where the
-variable was defined. Type descriptor defines the declared type of the
-variable.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="format_common_intrinsics">Debugger intrinsic functions</a>
-</div>
-
-<div class="doc_text">
-
-<p>LLVM uses several intrinsic functions (name prefixed with "llvm.dbg") to
-provide debug information at various points in generated code.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsubsection">
- <a name="format_common_stoppoint">llvm.dbg.stoppoint</a>
-</div>
-
-<div class="doc_text">
-<pre>
- void %<a href="#format_common_stoppoint">llvm.dbg.stoppoint</a>( uint, uint, { }* )
-</pre>
-
-<p>This intrinsic is used to provide correspondence between the source file and
-the generated code. The first argument is the line number (base 1), second
-argument is the column number (0 if unknown) and the third argument the source
-<tt>%<a href="#format_compile_units">llvm.dbg.compile_unit</a>*</tt> cast to a
-<tt>{ }*</tt>. Code following a call to this intrinsic will have been defined
-in close proximity of the line, column and file. This information holds until
-the next call to <tt>%<a
-href="#format_common_stoppoint">lvm.dbg.stoppoint</a></tt>.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsubsection">
- <a name="format_common_func_start">llvm.dbg.func.start</a>
-</div>
-
-<div class="doc_text">
-<pre>
- void %<a href="#format_common_func_start">llvm.dbg.func.start</a>( { }* )
-</pre>
-
-<p>This intrinsic is used to link the debug information in <tt>%<a
-href="#format_subprograms">llvm.dbg.subprogram</a></tt> to the function. It
-defines the beginning of the function's declarative region (scope). It also
-implies a call to %<tt><a
-href="#format_common_stoppoint">llvm.dbg.stoppoint</a></tt> which defines a
-source line "stop point". The intrinsic should be called early in the function
-after the all the alloca instructions. It should be paired off with a closing
-<tt>%<a
-href="#format_common_region_end">llvm.dbg.region.end</a></tt>. The function's
-single argument is the <tt>%<a
-href="#format_subprograms">llvm.dbg.subprogram.type</a></tt>.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsubsection">
- <a name="format_common_region_start">llvm.dbg.region.start</a>
-</div>
-
-<div class="doc_text">
-<pre>
- void %<a href="#format_common_region_start">llvm.dbg.region.start</a>( { }* )
-</pre>
-
-<p>This intrinsic is used to define the beginning of a declarative scope (ex.
-block) for local language elements. It should be paired off with a closing
-<tt>%<a href="#format_common_region_end">llvm.dbg.region.end</a></tt>. The
-function's single argument is the <tt>%<a
-href="#format_blocks">llvm.dbg.block</a></tt> which is starting.</p>
-
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsubsection">
- <a name="format_common_region_end">llvm.dbg.region.end</a>
-</div>
-
-<div class="doc_text">
-<pre>
- void %<a href="#format_common_region_end">llvm.dbg.region.end</a>( { }* )
-</pre>
-
-<p>This intrinsic is used to define the end of a declarative scope (ex. block)
-for local language elements. It should be paired off with an opening <tt>%<a
-href="#format_common_region_start">llvm.dbg.region.start</a></tt> or <tt>%<a
-href="#format_common_func_start">llvm.dbg.func.start</a></tt>. The function's
-single argument is either the <tt>%<a
-href="#format_blocks">llvm.dbg.block</a></tt> or the <tt>%<a
-href="#format_subprograms">llvm.dbg.subprogram.type</a></tt> which is
-ending.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsubsection">
- <a name="format_common_declare">llvm.dbg.declare</a>
-</div>
-
-<div class="doc_text">
-<pre>
- void %<a href="#format_common_declare">llvm.dbg.declare</a>( { } *, { }* )
-</pre>
-
-<p>This intrinsic provides information about a local element (ex. variable.) The
-first argument is the alloca for the variable, cast to a <tt>{ }*</tt>. The
-second argument is the <tt>%<a
-href="#format_variables">llvm.dbg.variable</a></tt> containing the description
-of the variable, also cast to a <tt>{ }*</tt>.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="format_common_stoppoints">
- Representing stopping points in the source program
- </a>
-</div>
-
-<div class="doc_text">
-
-<p>LLVM debugger "stop points" are a key part of the debugging representation
-that allows the LLVM to maintain simple semantics for <a
-href="#debugopt">debugging optimized code</a>. The basic idea is that the
-front-end inserts calls to the <a
-href="#format_common_stoppoint">%<tt>llvm.dbg.stoppoint</tt></a> intrinsic
-function at every point in the program where a debugger should be able to
-inspect the program (these correspond to places a debugger stops when you
-"<tt>step</tt>" through it). The front-end can choose to place these as
-fine-grained as it would like (for example, before every subexpression
-evaluated), but it is recommended to only put them after every source statement
-that includes executable code.</p>
-
-<p>Using calls to this intrinsic function to demark legal points for the
-debugger to inspect the program automatically disables any optimizations that
-could potentially confuse debugging information. To non-debug-information-aware
-transformations, these calls simply look like calls to an external function,
-which they must assume to do anything (including reading or writing to any part
-of reachable memory). On the other hand, it does not impact many optimizations,
-such as code motion of non-trapping instructions, nor does it impact
-optimization of subexpressions, code duplication transformations, or basic-block
-reordering transformations.</p>
-
-</div>
-
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="format_common_lifetime">Object lifetimes and scoping</a>
-</div>
-
-<div class="doc_text">
-<p>In many languages, the local variables in functions can have their lifetime
-or scope limited to a subset of a function. In the C family of languages, for
-example, variables are only live (readable and writable) within the source block
-that they are defined in. In functional languages, values are only readable
-after they have been defined. Though this is a very obvious concept, it is also
-non-trivial to model in LLVM, because it has no notion of scoping in this sense,
-and does not want to be tied to a language's scoping rules.</p>
-
-<p>In order to handle this, the LLVM debug format uses the notion of "regions"
-of a function, delineated by calls to intrinsic functions. These intrinsic
-functions define new regions of the program and indicate when the region
-lifetime expires. Consider the following C fragment, for example:</p>
-
-<pre>
-1. void foo() {
-2. int X = ...;
-3. int Y = ...;
-4. {
-5. int Z = ...;
-6. ...
-7. }
-8. ...
-9. }
-</pre>
-
-<p>Compiled to LLVM, this function would be represented like this:</p>
-
-<pre>
-void %foo() {
-entry:
- %X = alloca int
- %Y = alloca int
- %Z = alloca int
-
- ...
-
- call void %<a href="#format_common_func_start">llvm.dbg.func.start</a>( %<a href="#format_subprograms">llvm.dbg.subprogram.type</a>* %llvm.dbg.subprogram )
-
- call void %<a href="#format_common_stoppoint">llvm.dbg.stoppoint</a>( uint 2, uint 2, %<a href="#format_compile_units">llvm.dbg.compile_unit</a>* %llvm.dbg.compile_unit )
-
- call void %<a href="#format_common_declare">llvm.dbg.declare</a>({}* %X, ...)
- call void %<a href="#format_common_declare">llvm.dbg.declare</a>({}* %Y, ...)
-
- <i>;; Evaluate expression on line 2, assigning to X.</i>
-
- call void %<a href="#format_common_stoppoint">llvm.dbg.stoppoint</a>( uint 3, uint 2, %<a href="#format_compile_units">llvm.dbg.compile_unit</a>* %llvm.dbg.compile_unit )
-
- <i>;; Evaluate expression on line 3, assigning to Y.</i>
-
- call void %<a href="#format_common_stoppoint">llvm.region.start</a>()
- call void %<a href="#format_common_stoppoint">llvm.dbg.stoppoint</a>( uint 5, uint 4, %<a href="#format_compile_units">llvm.dbg.compile_unit</a>* %llvm.dbg.compile_unit )
- call void %<a href="#format_common_declare">llvm.dbg.declare</a>({}* %X, ...)
-
- <i>;; Evaluate expression on line 5, assigning to Z.</i>
-
- call void %<a href="#format_common_stoppoint">llvm.dbg.stoppoint</a>( uint 7, uint 2, %<a href="#format_compile_units">llvm.dbg.compile_unit</a>* %llvm.dbg.compile_unit )
- call void %<a href="#format_common_region_end">llvm.region.end</a>()
-
- call void %<a href="#format_common_stoppoint">llvm.dbg.stoppoint</a>( uint 9, uint 2, %<a href="#format_compile_units">llvm.dbg.compile_unit</a>* %llvm.dbg.compile_unit )
-
- call void %<a href="#format_common_region_end">llvm.region.end</a>()
-
- ret void
-}
-</pre>
-
-<p>This example illustrates a few important details about the LLVM debugging
-information. In particular, it shows how the various intrinsics are applied
-together to allow a debugger to analyze the relationship between statements,
-variable definitions, and the code used to implement the function.</p>
-
-<p>The first intrinsic <tt>%<a
-href="#format_common_func_start">llvm.dbg.func.start</a></tt> provides
-a link with the <a href="#format_subprograms">subprogram descriptor</a>
-containing the details of this function. This call also defines the beginning
-of the function region, bounded by the <tt>%<a
-href="#format_common_region_end">llvm.region.end</a></tt> at the end of
-the function. This region is used to bracket the lifetime of variables declared
-within. For a function, this outer region defines a new stack frame whose
-lifetime ends when the region is ended.</p>
-
-<p>It is possible to define inner regions for short term variables by using the
-%<a href="#format_common_stoppoint"><tt>llvm.region.start</tt></a> and <a
-href="#format_common_region_end"><tt>%llvm.region.end</tt></a> to bound a
-region. The inner region in this example would be for the block containing the
-declaration of Z.</p>
-
-<p>Using regions to represent the boundaries of source-level functions allow
-LLVM interprocedural optimizations to arbitrarily modify LLVM functions without
-having to worry about breaking mapping information between the LLVM code and the
-and source-level program. In particular, the inliner requires no modification
-to support inlining with debugging information: there is no explicit correlation
-drawn between LLVM functions and their source-level counterparts (note however,
-that if the inliner inlines all instances of a non-strong-linkage function into
-its caller that it will not be possible for the user to manually invoke the
-inlined function from a debugger).</p>
-
-<p>Once the function has been defined, the <a
-href="#format_common_stoppoint"><tt>stopping point</tt></a> corresponding to
-line #2 (column #2) of the function is encountered. At this point in the
-function, <b>no</b> local variables are live. As lines 2 and 3 of the example
-are executed, their variable definitions are introduced into the program using
-%<a href="#format_common_declare"><tt>llvm.dbg.declare</tt></a>, without the
-need to specify a new region. These variables do not require new regions to be
-introduced because they go out of scope at the same point in the program: line
-9.</p>
-
-<p>In contrast, the <tt>Z</tt> variable goes out of scope at a different time,
-on line 7. For this reason, it is defined within the inner region, which kills
-the availability of <tt>Z</tt> before the code for line 8 is executed. In this
-way, regions can support arbitrary source-language scoping rules, as long as
-they can only be nested (ie, one scope cannot partially overlap with a part of
-another scope).</p>
-
-<p>It is worth noting that this scoping mechanism is used to control scoping of
-all declarations, not just variable declarations. For example, the scope of a
-C++ using declaration is controlled with this and could change how name lookup is
-performed.</p>
-
-</div>
-
-
-
-<!-- *********************************************************************** -->
-<div class="doc_section">
- <a name="ccxx_frontend">C/C++ front-end specific debug information</a>
-</div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>The C and C++ front-ends represent information about the program in a format
-that is effectively identical to <a
-href="http://www.eagercon.com/dwarf/dwarf3std.htm">Dwarf 3.0</a> in terms of
-information content. This allows code generators to trivially support native
-debuggers by generating standard dwarf information, and contains enough
-information for non-dwarf targets to translate it as needed.</p>
-
-<p>This section describes the forms used to represent C and C++ programs. Other
-languages could pattern themselves after this (which itself is tuned to
-representing programs in the same way that Dwarf 3 does), or they could choose
-to provide completely different forms if they don't fit into the Dwarf model.
-As support for debugging information gets added to the various LLVM
-source-language front-ends, the information used should be documented here.</p>
-
-<p>The following sections provide examples of various C/C++ constructs and the
-debug information that would best describe those constructs.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="ccxx_compile_units">C/C++ source file information</a>
-</div>
-
-<div class="doc_text">
-
-<p>Given the source files "MySource.cpp" and "MyHeader.h" located in the
-directory "/Users/mine/sources", the following code;</p>
-
-<pre>
-#include "MyHeader.h"
-
-int main(int argc, char *argv[]) {
- return 0;
-}
-</pre>
-
-<p>a C/C++ front-end would generate the following descriptors;</p>
-
-<pre>
-...
-;;
-;; Define types used. In this case we need one for compile unit anchors and one
-;; for compile units.
-;;
-%<a href="#format_anchors">llvm.dbg.anchor.type</a> = type { uint, uint }
-%<a href="#format_compile_units">llvm.dbg.compile_unit.type</a> = type { uint, { }*, uint, uint, sbyte*, sbyte*, sbyte* }
-...
-;;
-;; Define the anchor for compile units. Note that the second field of the
-;; anchor is 17, which is the same as the tag for compile units
-;; (17 = DW_TAG_compile_unit.)
-;;
-%<a href="#format_compile_units">llvm.dbg.compile_units</a> = linkonce constant %<a href="#format_anchors">llvm.dbg.anchor.type</a> { uint 0, uint 17 }, section "llvm.metadata"
-
-;;
-;; Define the compile unit for the source file "/Users/mine/sources/MySource.cpp".
-;;
-%<a href="#format_compile_units">llvm.dbg.compile_unit1</a> = internal constant %<a href="#format_compile_units">llvm.dbg.compile_unit.type</a> {
- uint add(uint 17, uint 262144),
- { }* cast (%<a href="#format_anchors">llvm.dbg.anchor.type</a>* %<a href="#format_compile_units">llvm.dbg.compile_units</a> to { }*),
- uint 1,
- uint 1,
- sbyte* getelementptr ([13 x sbyte]* %str1, int 0, int 0),
- sbyte* getelementptr ([21 x sbyte]* %str2, int 0, int 0),
- sbyte* getelementptr ([33 x sbyte]* %str3, int 0, int 0) }, section "llvm.metadata"
-
-;;
-;; Define the compile unit for the header file "/Users/mine/sources/MyHeader.h".
-;;
-%<a href="#format_compile_units">llvm.dbg.compile_unit2</a> = internal constant %<a href="#format_compile_units">llvm.dbg.compile_unit.type</a> {
- uint add(uint 17, uint 262144),
- { }* cast (%<a href="#format_anchors">llvm.dbg.anchor.type</a>* %<a href="#format_compile_units">llvm.dbg.compile_units</a> to { }*),
- uint 1,
- uint 1,
- sbyte* getelementptr ([11 x sbyte]* %str4, int 0, int 0),
- sbyte* getelementptr ([21 x sbyte]* %str2, int 0, int 0),
- sbyte* getelementptr ([33 x sbyte]* %str3, int 0, int 0) }, section "llvm.metadata"
-
-;;
-;; Define each of the strings used in the compile units.
-;;
-%str1 = internal constant [13 x sbyte] c"MySource.cpp\00", section "llvm.metadata";
-%str2 = internal constant [21 x sbyte] c"/Users/mine/sources/\00", section "llvm.metadata";
-%str3 = internal constant [33 x sbyte] c"4.0.1 LLVM (LLVM research group)\00", section "llvm.metadata";
-%str4 = internal constant [11 x sbyte] c"MyHeader.h\00", section "llvm.metadata";
-...
-</pre>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="ccxx_global_variable">C/C++ global variable information</a>
-</div>
-
-<div class="doc_text">
-
-<p>Given an integer global variable declared as follows;</p>
-
-<pre>
-int MyGlobal = 100;
-</pre>
-
-<p>a C/C++ front-end would generate the following descriptors;</p>
-
-<pre>
-;;
-;; Define types used. One for global variable anchors, one for the global
-;; variable descriptor, one for the global's basic type and one for the global's
-;; compile unit.
-;;
-%<a href="#format_anchors">llvm.dbg.anchor.type</a> = type { uint, uint }
-%<a href="#format_global_variables">llvm.dbg.global_variable.type</a> = type { uint, { }*, { }*, sbyte*, { }*, uint, { }*, bool, bool, { }*, uint }
-%<a href="#format_basic_type">llvm.dbg.basictype.type</a> = type { uint, { }*, sbyte*, { }*, int, uint, uint, uint, uint }
-%<a href="#format_compile_units">llvm.dbg.compile_unit.type</a> = ...
-...
-;;
-;; Define the global itself.
-;;
-%MyGlobal = global int 100
-...
-;;
-;; Define the anchor for global variables. Note that the second field of the
-;; anchor is 52, which is the same as the tag for global variables
-;; (52 = DW_TAG_variable.)
-;;
-%<a href="#format_global_variables">llvm.dbg.global_variables</a> = linkonce constant %<a href="#format_anchors">llvm.dbg.anchor.type</a> { uint 0, uint 52 }, section "llvm.metadata"
-
-;;
-;; Define the global variable descriptor. Note the reference to the global
-;; variable anchor and the global variable itself.
-;;
-%<a href="#format_global_variables">llvm.dbg.global_variable</a> = internal constant %<a href="#format_global_variables">llvm.dbg.global_variable.type</a> {
- uint add(uint 52, uint 262144),
- { }* cast (%<a href="#format_anchors">llvm.dbg.anchor.type</a>* %<a href="#format_global_variables">llvm.dbg.global_variables</a> to { }*),
- { }* cast (%<a href="#format_compile_units">llvm.dbg.compile_unit.type</a>* %<a href="#format_compile_units">llvm.dbg.compile_unit</a> to { }*),
- sbyte* getelementptr ([9 x sbyte]* %str1, int 0, int 0),
- sbyte* getelementptr ([1 x sbyte]* %str2, int 0, int 0),
- { }* cast (%<a href="#format_compile_units">llvm.dbg.compile_unit.type</a>* %<a href="#format_compile_units">llvm.dbg.compile_unit</a> to { }*),
- uint 1,
- { }* cast (%<a href="#format_basic_type">llvm.dbg.basictype.type</a>* %<a href="#format_basic_type">llvm.dbg.basictype</a> to { }*),
- bool false,
- bool true,
- { }* cast (int* %MyGlobal to { }*) }, section "llvm.metadata"
-
-;;
-;; Define the basic type of 32 bit signed integer. Note that since int is an
-;; intrinsic type the source file is NULL and line 0.
-;;
-%<a href="#format_basic_type">llvm.dbg.basictype</a> = internal constant %<a href="#format_basic_type">llvm.dbg.basictype.type</a> {
- uint add(uint 36, uint 262144),
- { }* cast (%<a href="#format_compile_units">llvm.dbg.compile_unit.type</a>* %<a href="#format_compile_units">llvm.dbg.compile_unit</a> to { }*),
- sbyte* getelementptr ([4 x sbyte]* %str3, int 0, int 0),
- { }* null,
- int 0,
- uint 32,
- uint 32,
- uint 0,
- uint 5 }, section "llvm.metadata"
-
-;;
-;; Define the names of the global variable and basic type.
-;;
-%str1 = internal constant [9 x sbyte] c"MyGlobal\00", section "llvm.metadata"
-%str2 = internal constant [1 x sbyte] c"\00", section "llvm.metadata"
-%str3 = internal constant [4 x sbyte] c"int\00", section "llvm.metadata"
-</pre>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="ccxx_subprogram">C/C++ function information</a>
-</div>
-
-<div class="doc_text">
-
-<p>Given a function declared as follows;</p>
-
-<pre>
-int main(int argc, char *argv[]) {
- return 0;
-}
-</pre>
-
-<p>a C/C++ front-end would generate the following descriptors;</p>
-
-<pre>
-;;
-;; Define types used. One for subprogram anchors, one for the subprogram
-;; descriptor, one for the global's basic type and one for the subprogram's
-;; compile unit.
-;;
-%<a href="#format_subprograms">llvm.dbg.subprogram.type</a> = type { uint, { }*, { }*, sbyte*, { }*, bool, bool }
-%<a href="#format_anchors">llvm.dbg.anchor.type</a> = type { uint, uint }
-%<a href="#format_compile_units">llvm.dbg.compile_unit.type</a> = ...
-
-;;
-;; Define the anchor for subprograms. Note that the second field of the
-;; anchor is 46, which is the same as the tag for subprograms
-;; (46 = DW_TAG_subprogram.)
-;;
-%<a href="#format_subprograms">llvm.dbg.subprograms</a> = linkonce constant %<a href="#format_anchors">llvm.dbg.anchor.type</a> { uint 0, uint 46 }, section "llvm.metadata"
-
-;;
-;; Define the descriptor for the subprogram. TODO - more details.
-;;
-%<a href="#format_subprograms">llvm.dbg.subprogram</a> = internal constant %<a href="#format_subprograms">llvm.dbg.subprogram.type</a> {
- uint add(uint 46, uint 262144),
- { }* cast (%<a href="#format_anchors">llvm.dbg.anchor.type</a>* %<a href="#format_subprograms">llvm.dbg.subprograms</a> to { }*),
- { }* cast (%<a href="#format_compile_units">llvm.dbg.compile_unit.type</a>* %<a href="#format_compile_units">llvm.dbg.compile_unit</a> to { }*),
- sbyte* getelementptr ([5 x sbyte]* %str1, int 0, int 0),
- sbyte* getelementptr ([1 x sbyte]* %str2, int 0, int 0),
- { }* cast (%<a href="#format_compile_units">llvm.dbg.compile_unit.type</a>* %<a href="#format_compile_units">llvm.dbg.compile_unit</a> to { }*),
- uint 1,
- { }* null,
- bool false,
- bool true }, section "llvm.metadata"
-
-;;
-;; Define the name of the subprogram.
-;;
-%str1 = internal constant [5 x sbyte] c"main\00", section "llvm.metadata"
-%str2 = internal constant [1 x sbyte] c"\00", section "llvm.metadata"
-
-;;
-;; Define the subprogram itself.
-;;
-int %main(int %argc, sbyte** %argv) {
-...
-}
-</pre>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="ccxx_basic_types">C/C++ basic types</a>
-</div>
-
-<div class="doc_text">
-
-<p>The following are the basic type descriptors for C/C++ core types;</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsubsection">
- <a name="ccxx_basic_type_bool">bool</a>
-</div>
-
-<div class="doc_text">
-
-<pre>
-%<a href="#format_basic_type">llvm.dbg.basictype</a> = internal constant %<a href="#format_basic_type">llvm.dbg.basictype.type</a> {
- uint add(uint 36, uint 262144),
- { }* cast (%<a href="#format_compile_units">llvm.dbg.compile_unit.type</a>* %<a href="#format_compile_units">llvm.dbg.compile_unit</a> to { }*),
- sbyte* getelementptr ([5 x sbyte]* %str1, int 0, int 0),
- { }* null,
- int 0,
- uint 32,
- uint 32,
- uint 0,
- uint 2 }, section "llvm.metadata"
-%str1 = internal constant [5 x sbyte] c"bool\00", section "llvm.metadata"
-</pre>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsubsection">
- <a name="ccxx_basic_char">char</a>
-</div>
-
-<div class="doc_text">
-
-<pre>
-%<a href="#format_basic_type">llvm.dbg.basictype</a> = internal constant %<a href="#format_basic_type">llvm.dbg.basictype.type</a> {
- uint add(uint 36, uint 262144),
- { }* cast (%<a href="#format_compile_units">llvm.dbg.compile_unit.type</a>* %<a href="#format_compile_units">llvm.dbg.compile_unit</a> to { }*),
- sbyte* getelementptr ([5 x sbyte]* %str1, int 0, int 0),
- { }* null,
- int 0,
- uint 8,
- uint 8,
- uint 0,
- uint 6 }, section "llvm.metadata"
-%str1 = internal constant [5 x sbyte] c"char\00", section "llvm.metadata"
-</pre>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsubsection">
- <a name="ccxx_basic_unsigned_char">unsigned char</a>
-</div>
-
-<div class="doc_text">
-
-<pre>
-%<a href="#format_basic_type">llvm.dbg.basictype</a> = internal constant %<a href="#format_basic_type">llvm.dbg.basictype.type</a> {
- uint add(uint 36, uint 262144),
- { }* cast (%<a href="#format_compile_units">llvm.dbg.compile_unit.type</a>* %<a href="#format_compile_units">llvm.dbg.compile_unit</a> to { }*),
- sbyte* getelementptr ([14 x sbyte]* %str1, int 0, int 0),
- { }* null,
- int 0,
- uint 8,
- uint 8,
- uint 0,
- uint 8 }, section "llvm.metadata"
-%str1 = internal constant [14 x sbyte] c"unsigned char\00", section "llvm.metadata"
-</pre>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsubsection">
- <a name="ccxx_basic_short">short</a>
-</div>
-
-<div class="doc_text">
-
-<pre>
-%<a href="#format_basic_type">llvm.dbg.basictype</a> = internal constant %<a href="#format_basic_type">llvm.dbg.basictype.type</a> {
- uint add(uint 36, uint 262144),
- { }* cast (%<a href="#format_compile_units">llvm.dbg.compile_unit.type</a>* %<a href="#format_compile_units">llvm.dbg.compile_unit</a> to { }*),
- sbyte* getelementptr ([10 x sbyte]* %str1, int 0, int 0),
- { }* null,
- int 0,
- uint 16,
- uint 16,
- uint 0,
- uint 5 }, section "llvm.metadata"
-%str1 = internal constant [10 x sbyte] c"short int\00", section "llvm.metadata"
-</pre>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsubsection">
- <a name="ccxx_basic_unsigned_short">unsigned short</a>
-</div>
-
-<div class="doc_text">
-
-<pre>
-%<a href="#format_basic_type">llvm.dbg.basictype</a> = internal constant %<a href="#format_basic_type">llvm.dbg.basictype.type</a> {
- uint add(uint 36, uint 262144),
- { }* cast (%<a href="#format_compile_units">llvm.dbg.compile_unit.type</a>* %<a href="#format_compile_units">llvm.dbg.compile_unit</a> to { }*),
- sbyte* getelementptr ([19 x sbyte]* %str1, int 0, int 0),
- { }* null,
- int 0,
- uint 16,
- uint 16,
- uint 0,
- uint 7 }, section "llvm.metadata"
-%str1 = internal constant [19 x sbyte] c"short unsigned int\00", section "llvm.metadata"
-</pre>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsubsection">
- <a name="ccxx_basic_int">int</a>
-</div>
-
-<div class="doc_text">
-
-<pre>
-%<a href="#format_basic_type">llvm.dbg.basictype</a> = internal constant %<a href="#format_basic_type">llvm.dbg.basictype.type</a> {
- uint add(uint 36, uint 262144),
- { }* cast (%<a href="#format_compile_units">llvm.dbg.compile_unit.type</a>* %<a href="#format_compile_units">llvm.dbg.compile_unit</a> to { }*),
- sbyte* getelementptr ([4 x sbyte]* %str1, int 0, int 0),
- { }* null,
- int 0,
- uint 32,
- uint 32,
- uint 0,
- uint 5 }, section "llvm.metadata"
-%str1 = internal constant [4 x sbyte] c"int\00", section "llvm.metadata"
-</pre>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsubsection">
- <a name="ccxx_basic_unsigned_int">unsigned int</a>
-</div>
-
-<div class="doc_text">
-
-<pre>
-%<a href="#format_basic_type">llvm.dbg.basictype</a> = internal constant %<a href="#format_basic_type">llvm.dbg.basictype.type</a> {
- uint add(uint 36, uint 262144),
- { }* cast (%<a href="#format_compile_units">llvm.dbg.compile_unit.type</a>* %<a href="#format_compile_units">llvm.dbg.compile_unit</a> to { }*),
- sbyte* getelementptr ([13 x sbyte]* %str1, int 0, int 0),
- { }* null,
- int 0,
- uint 32,
- uint 32,
- uint 0,
- uint 7 }, section "llvm.metadata"
-%str1 = internal constant [13 x sbyte] c"unsigned int\00", section "llvm.metadata"
-</pre>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsubsection">
- <a name="ccxx_basic_long_long">long long</a>
-</div>
-
-<div class="doc_text">
-
-<pre>
-%<a href="#format_basic_type">llvm.dbg.basictype</a> = internal constant %<a href="#format_basic_type">llvm.dbg.basictype.type</a> {
- uint add(uint 36, uint 262144),
- { }* cast (%<a href="#format_compile_units">llvm.dbg.compile_unit.type</a>* %<a href="#format_compile_units">llvm.dbg.compile_unit</a> to { }*),
- sbyte* getelementptr ([14 x sbyte]* %str1, int 0, int 0),
- { }* null,
- int 0,
- uint 64,
- uint 64,
- uint 0,
- uint 5 }, section "llvm.metadata"
-%str1 = internal constant [14 x sbyte] c"long long int\00", section "llvm.metadata"
-</pre>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsubsection">
- <a name="ccxx_basic_unsigned_long_long">unsigned long long</a>
-</div>
-
-<div class="doc_text">
-
-<pre>
-%<a href="#format_basic_type">llvm.dbg.basictype</a> = internal constant %<a href="#format_basic_type">llvm.dbg.basictype.type</a> {
- uint add(uint 36, uint 262144),
- { }* cast (%<a href="#format_compile_units">llvm.dbg.compile_unit.type</a>* %<a href="#format_compile_units">llvm.dbg.compile_unit</a> to { }*),
- sbyte* getelementptr ([23 x sbyte]* %str1, int 0, int 0),
- { }* null,
- int 0,
- uint 64,
- uint 64,
- uint 0,
- uint 7 }, section "llvm.metadata"
-%str1 = internal constant [23 x sbyte] c"long long unsigned int\00", section "llvm.metadata"
-</pre>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsubsection">
- <a name="ccxx_basic_float">float</a>
-</div>
-
-<div class="doc_text">
-
-<pre>
-%<a href="#format_basic_type">llvm.dbg.basictype</a> = internal constant %<a href="#format_basic_type">llvm.dbg.basictype.type</a> {
- uint add(uint 36, uint 262144),
- { }* cast (%<a href="#format_compile_units">llvm.dbg.compile_unit.type</a>* %<a href="#format_compile_units">llvm.dbg.compile_unit</a> to { }*),
- sbyte* getelementptr ([6 x sbyte]* %str1, int 0, int 0),
- { }* null,
- int 0,
- uint 32,
- uint 32,
- uint 0,
- uint 4 }, section "llvm.metadata"
-%str1 = internal constant [6 x sbyte] c"float\00", section "llvm.metadata"
-</pre>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsubsection">
- <a name="ccxx_basic_double">double</a>
-</div>
-
-<div class="doc_text">
-
-<pre>
-%<a href="#format_basic_type">llvm.dbg.basictype</a> = internal constant %<a href="#format_basic_type">llvm.dbg.basictype.type</a> {
- uint add(uint 36, uint 262144),
- { }* cast (%<a href="#format_compile_units">llvm.dbg.compile_unit.type</a>* %<a href="#format_compile_units">llvm.dbg.compile_unit</a> to { }*),
- sbyte* getelementptr ([7 x sbyte]* %str1, int 0, int 0),
- { }* null,
- int 0,
- uint 64,
- uint 64,
- uint 0,
- uint 4 }, section "llvm.metadata"
-%str1 = internal constant [7 x sbyte] c"double\00", section "llvm.metadata"
-</pre>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="ccxx_derived_types">C/C++ derived types</a>
-</div>
-
-<div class="doc_text">
-
-<p>Given the following as an example of C/C++ derived type;</p>
-
-<pre>
-typedef const int *IntPtr;
-</pre>
-
-<p>a C/C++ front-end would generate the following descriptors;</p>
-
-<pre>
-;;
-;; Define the typedef "IntPtr".
-;;
-%<a href="#format_derived_type">llvm.dbg.derivedtype1</a> = internal constant %<a href="#format_derived_type">llvm.dbg.derivedtype.type</a> {
- uint add(uint 22, uint 262144),
- { }* cast (%<a href="#format_compile_units">llvm.dbg.compile_unit.type</a>* %<a href="#format_compile_units">llvm.dbg.compile_unit</a> to { }*),
- sbyte* getelementptr ([7 x sbyte]* %str1, int 0, int 0),
- { }* cast (%<a href="#format_compile_units">llvm.dbg.compile_unit.type</a>* %<a href="#format_compile_units">llvm.dbg.compile_unit</a> to { }*),
- int 1,
- uint 0,
- uint 0,
- uint 0,
- { }* cast (%<a href="#format_derived_type">llvm.dbg.derivedtype.type</a>* %<a href="#format_derived_type">llvm.dbg.derivedtype2</a> to { }*) }, section "llvm.metadata"
-%str1 = internal constant [7 x sbyte] c"IntPtr\00", section "llvm.metadata"
-
-;;
-;; Define the pointer type.
-;;
-%<a href="#format_derived_type">llvm.dbg.derivedtype2</a> = internal constant %<a href="#format_derived_type">llvm.dbg.derivedtype.type</a> {
- uint add(uint 15, uint 262144),
- { }* cast (%<a href="#format_compile_units">llvm.dbg.compile_unit.type</a>* %<a href="#format_compile_units">llvm.dbg.compile_unit</a> to { }*),
- sbyte* null,
- { }* null,
- int 0,
- uint 32,
- uint 32,
- uint 0,
- { }* cast (%<a href="#format_derived_type">llvm.dbg.derivedtype.type</a>* %<a href="#format_derived_type">llvm.dbg.derivedtype3</a> to { }*) }, section "llvm.metadata"
-
-;;
-;; Define the const type.
-;;
-%<a href="#format_derived_type">llvm.dbg.derivedtype3</a> = internal constant %<a href="#format_derived_type">llvm.dbg.derivedtype.type</a> {
- uint add(uint 38, uint 262144),
- { }* cast (%<a href="#format_compile_units">llvm.dbg.compile_unit.type</a>* %<a href="#format_compile_units">llvm.dbg.compile_unit</a> to { }*),
- sbyte* null,
- { }* null,
- int 0,
- uint 0,
- uint 0,
- uint 0,
- { }* cast (%<a href="#format_basic_type">llvm.dbg.basictype.type</a>* %<a href="#format_basic_type">llvm.dbg.basictype1</a> to { }*) }, section "llvm.metadata"
-
-;;
-;; Define the int type.
-;;
-%<a href="#format_basic_type">llvm.dbg.basictype1</a> = internal constant %<a href="#format_basic_type">llvm.dbg.basictype.type</a> {
- uint add(uint 36, uint 262144),
- { }* cast (%<a href="#format_compile_units">llvm.dbg.compile_unit.type</a>* %<a href="#format_compile_units">llvm.dbg.compile_unit</a> to { }*),
- sbyte* getelementptr ([4 x sbyte]* %str2, int 0, int 0),
- { }* null,
- int 0,
- uint 32,
- uint 32,
- uint 0,
- uint 5 }, section "llvm.metadata"
-%str2 = internal constant [4 x sbyte] c"int\00", section "llvm.metadata"
-</pre>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="ccxx_composite_types">C/C++ struct/union types</a>
-</div>
-
-<div class="doc_text">
-
-<p>Given the following as an example of C/C++ struct type;</p>
-
-<pre>
-struct Color {
- unsigned Red;
- unsigned Green;
- unsigned Blue;
-};
-</pre>
-
-<p>a C/C++ front-end would generate the following descriptors;</p>
-
-<pre>
-;;
-;; Define basic type for unsigned int.
-;;
-%<a href="#format_basic_type">llvm.dbg.basictype</a> = internal constant %<a href="#format_basic_type">llvm.dbg.basictype.type</a> {
- uint add(uint 36, uint 262144),
- { }* cast (%<a href="#format_compile_units">llvm.dbg.compile_unit.type</a>* %<a href="#format_compile_units">llvm.dbg.compile_unit</a> to { }*),
- sbyte* getelementptr ([13 x sbyte]* %str1, int 0, int 0),
- { }* null,
- int 0,
- uint 32,
- uint 32,
- uint 0,
- uint 7 }, section "llvm.metadata"
-%str1 = internal constant [13 x sbyte] c"unsigned int\00", section "llvm.metadata"
-
-;;
-;; Define composite type for struct Color.
-;;
-%<a href="#format_composite_type">llvm.dbg.compositetype</a> = internal constant %<a href="#format_composite_type">llvm.dbg.compositetype.type</a> {
- uint add(uint 19, uint 262144),
- { }* cast (%<a href="#format_compile_units">llvm.dbg.compile_unit.type</a>* %<a href="#format_compile_units">llvm.dbg.compile_unit</a> to { }*),
- sbyte* getelementptr ([6 x sbyte]* %str2, int 0, int 0),
- { }* cast (%<a href="#format_compile_units">llvm.dbg.compile_unit.type</a>* %<a href="#format_compile_units">llvm.dbg.compile_unit</a> to { }*),
- int 1,
- uint 96,
- uint 32,
- uint 0,
- { }* null,
- { }* cast ([3 x { }*]* %llvm.dbg.array to { }*) }, section "llvm.metadata"
-%str2 = internal constant [6 x sbyte] c"Color\00", section "llvm.metadata"
-
-;;
-;; Define the Red field.
-;;
-%<a href="#format_derived_type">llvm.dbg.derivedtype1</a> = internal constant %<a href="#format_derived_type">llvm.dbg.derivedtype.type</a> {
- uint add(uint 13, uint 262144),
- { }* null,
- sbyte* getelementptr ([4 x sbyte]* %str3, int 0, int 0),
- { }* cast (%<a href="#format_compile_units">llvm.dbg.compile_unit.type</a>* %<a href="#format_compile_units">llvm.dbg.compile_unit</a> to { }*),
- int 2,
- uint 32,
- uint 32,
- uint 0,
- { }* cast (%<a href="#format_basic_type">llvm.dbg.basictype.type</a>* %<a href="#format_basic_type">llvm.dbg.basictype</a> to { }*) }, section "llvm.metadata"
-%str3 = internal constant [4 x sbyte] c"Red\00", section "llvm.metadata"
-
-;;
-;; Define the Green field.
-;;
-%<a href="#format_derived_type">llvm.dbg.derivedtype2</a> = internal constant %<a href="#format_derived_type">llvm.dbg.derivedtype.type</a> {
- uint add(uint 13, uint 262144),
- { }* null,
- sbyte* getelementptr ([6 x sbyte]* %str4, int 0, int 0),
- { }* cast (%<a href="#format_compile_units">llvm.dbg.compile_unit.type</a>* %<a href="#format_compile_units">llvm.dbg.compile_unit</a> to { }*),
- int 3,
- uint 32,
- uint 32,
- uint 32,
- { }* cast (%<a href="#format_basic_type">llvm.dbg.basictype.type</a>* %<a href="#format_basic_type">llvm.dbg.basictype</a> to { }*) }, section "llvm.metadata"
-%str4 = internal constant [6 x sbyte] c"Green\00", section "llvm.metadata"
-
-;;
-;; Define the Blue field.
-;;
-%<a href="#format_derived_type">llvm.dbg.derivedtype3</a> = internal constant %<a href="#format_derived_type">llvm.dbg.derivedtype.type</a> {
- uint add(uint 13, uint 262144),
- { }* null,
- sbyte* getelementptr ([5 x sbyte]* %str5, int 0, int 0),
- { }* cast (%<a href="#format_compile_units">llvm.dbg.compile_unit.type</a>* %<a href="#format_compile_units">llvm.dbg.compile_unit</a> to { }*),
- int 4,
- uint 32,
- uint 32,
- uint 64,
- { }* cast (%<a href="#format_basic_type">llvm.dbg.basictype.type</a>* %<a href="#format_basic_type">llvm.dbg.basictype</a> to { }*) }, section "llvm.metadata"
-%str5 = internal constant [5 x sbyte] c"Blue\00", section "llvm.metadata"
-
-;;
-;; Define the array of fields used by the composite type Color.
-;;
-%llvm.dbg.array = internal constant [3 x { }*] [
- { }* cast (%<a href="#format_derived_type">llvm.dbg.derivedtype.type</a>* %<a href="#format_derived_type">llvm.dbg.derivedtype1</a> to { }*),
- { }* cast (%<a href="#format_derived_type">llvm.dbg.derivedtype.type</a>* %<a href="#format_derived_type">llvm.dbg.derivedtype2</a> to { }*),
- { }* cast (%<a href="#format_derived_type">llvm.dbg.derivedtype.type</a>* %<a href="#format_derived_type">llvm.dbg.derivedtype3</a> to { }*) ], section "llvm.metadata"
-</pre>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="ccxx_enumeration_types">C/C++ enumeration types</a>
-</div>
-
-<div class="doc_text">
-
-<p>Given the following as an example of C/C++ enumeration type;</p>
-
-<pre>
-enum Trees {
- Spruce = 100,
- Oak = 200,
- Maple = 300
-};
-</pre>
-
-<p>a C/C++ front-end would generate the following descriptors;</p>
-
-<pre>
-;;
-;; Define composite type for enum Trees
-;;
-%<a href="#format_composite_type">llvm.dbg.compositetype</a> = internal constant %<a href="#format_composite_type">llvm.dbg.compositetype.type</a> {
- uint add(uint 4, uint 262144),
- { }* cast (%<a href="#format_compile_units">llvm.dbg.compile_unit.type</a>* %<a href="#format_compile_units">llvm.dbg.compile_unit</a> to { }*),
- sbyte* getelementptr ([6 x sbyte]* %str1, int 0, int 0),
- { }* cast (%<a href="#format_compile_units">llvm.dbg.compile_unit.type</a>* %<a href="#format_compile_units">llvm.dbg.compile_unit</a> to { }*),
- int 1,
- uint 32,
- uint 32,
- uint 0,
- { }* null,
- { }* cast ([3 x { }*]* %llvm.dbg.array to { }*) }, section "llvm.metadata"
-%str1 = internal constant [6 x sbyte] c"Trees\00", section "llvm.metadata"
-
-;;
-;; Define Spruce enumerator.
-;;
-%<a href="#format_enumeration">llvm.dbg.enumerator1</a> = internal constant %<a href="#format_enumeration">llvm.dbg.enumerator.type</a> {
- uint add(uint 40, uint 262144),
- sbyte* getelementptr ([7 x sbyte]* %str2, int 0, int 0),
- int 100 }, section "llvm.metadata"
-%str2 = internal constant [7 x sbyte] c"Spruce\00", section "llvm.metadata"
-
-;;
-;; Define Oak enumerator.
-;;
-%<a href="#format_enumeration">llvm.dbg.enumerator2</a> = internal constant %<a href="#format_enumeration">llvm.dbg.enumerator.type</a> {
- uint add(uint 40, uint 262144),
- sbyte* getelementptr ([4 x sbyte]* %str3, int 0, int 0),
- int 200 }, section "llvm.metadata"
-%str3 = internal constant [4 x sbyte] c"Oak\00", section "llvm.metadata"
-
-;;
-;; Define Maple enumerator.
-;;
-%<a href="#format_enumeration">llvm.dbg.enumerator3</a> = internal constant %<a href="#format_enumeration">llvm.dbg.enumerator.type</a> {
- uint add(uint 40, uint 262144),
- sbyte* getelementptr ([6 x sbyte]* %str4, int 0, int 0),
- int 300 }, section "llvm.metadata"
-%str4 = internal constant [6 x sbyte] c"Maple\00", section "llvm.metadata"
-
-;;
-;; Define the array of enumerators used by composite type Trees.
-;;
-%llvm.dbg.array = internal constant [3 x { }*] [
- { }* cast (%<a href="#format_enumeration">llvm.dbg.enumerator.type</a>* %<a href="#format_enumeration">llvm.dbg.enumerator1</a> to { }*),
- { }* cast (%<a href="#format_enumeration">llvm.dbg.enumerator.type</a>* %<a href="#format_enumeration">llvm.dbg.enumerator2</a> to { }*),
- { }* cast (%<a href="#format_enumeration">llvm.dbg.enumerator.type</a>* %<a href="#format_enumeration">llvm.dbg.enumerator3</a> to { }*) ], section "llvm.metadata"
-</pre>
-
-</div>
-
-<!-- *********************************************************************** -->
-
-<hr>
-<address>
- <a href="http://jigsaw.w3.org/css-validator/check/referer"><img
- src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"></a>
- <a href="http://validator.w3.org/check/referer"><img
- src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!"></a>
-
- <a href="mailto:sabre@nondot.org">Chris Lattner</a><br>
- <a href="http://llvm.org">LLVM Compiler Infrastructure</a><br>
- Last modified: $Date$
-</address>
-
-</body>
-</html>
diff --git a/release_23/docs/Stacker.html b/release_23/docs/Stacker.html
deleted file mode 100644
index 81b623efa9a1..000000000000
--- a/release_23/docs/Stacker.html
+++ /dev/null
@@ -1,1428 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
- "http://www.w3.org/TR/html4/strict.dtd">
-<html>
-<head>
- <title>Stacker: An Example Of Using LLVM</title>
- <link rel="stylesheet" href="llvm.css" type="text/css">
-</head>
-<body>
-
-<div class="doc_title">Stacker: An Example Of Using LLVM</div>
-
-<ol>
- <li><a href="#abstract">Abstract</a></li>
- <li><a href="#introduction">Introduction</a></li>
- <li><a href="#lessons">Lessons I Learned About LLVM</a>
- <ol>
- <li><a href="#value">Everything's a Value!</a></li>
- <li><a href="#terminate">Terminate Those Blocks!</a></li>
- <li><a href="#blocks">Concrete Blocks</a></li>
- <li><a href="#push_back">push_back Is Your Friend</a></li>
- <li><a href="#gep">The Wily GetElementPtrInst</a></li>
- <li><a href="#linkage">Getting Linkage Types Right</a></li>
- <li><a href="#constants">Constants Are Easier Than That!</a></li>
- </ol></li>
- <li><a href="#lexicon">The Stacker Lexicon</a>
- <ol>
- <li><a href="#stack">The Stack</a></li>
- <li><a href="#punctuation">Punctuation</a></li>
- <li><a href="#comments">Comments</a></li>
- <li><a href="#literals">Literals</a></li>
- <li><a href="#words">Words</a></li>
- <li><a href="#style">Standard Style</a></li>
- <li><a href="#builtins">Built-Ins</a></li>
- </ol></li>
- <li><a href="#example">Prime: A Complete Example</a></li>
- <li><a href="#internal">Internal Code Details</a>
- <ol>
- <li><a href="#directory">The Directory Structure </a></li>
- <li><a href="#lexer">The Lexer</a></li>
- <li><a href="#parser">The Parser</a></li>
- <li><a href="#compiler">The Compiler</a></li>
- <li><a href="#runtime">The Runtime</a></li>
- <li><a href="#driver">Compiler Driver</a></li>
- <li><a href="#tests">Test Programs</a></li>
- <li><a href="#exercise">Exercise</a></li>
- <li><a href="#todo">Things Remaining To Be Done</a></li>
- </ol></li>
-</ol>
-
-<div class="doc_author">
- <p>Written by <a href="mailto:rspencer@x10sys.com">Reid Spencer</a></p>
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_section"><a name="abstract">Abstract</a></div>
-<div class="doc_text">
-<p>This document is another way to learn about LLVM. Unlike the
-<a href="LangRef.html">LLVM Reference Manual</a> or
-<a href="ProgrammersManual.html">LLVM Programmer's Manual</a>, here we learn
-about LLVM through the experience of creating a simple programming language
-named Stacker. Stacker was invented specifically as a demonstration of
-LLVM. The emphasis in this document is not on describing the
-intricacies of LLVM itself but on how to use it to build your own
-compiler system.</p>
-</div>
-<!-- ======================================================================= -->
-<div class="doc_section"> <a name="introduction">Introduction</a> </div>
-<div class="doc_text">
-<p>Amongst other things, LLVM is a platform for compiler writers.
-Because of its exceptionally clean and small IR (intermediate
-representation), compiler writing with LLVM is much easier than with
-other system. As proof, I wrote the entire compiler (language definition,
-lexer, parser, code generator, etc.) in about <em>four days</em>!
-That's important to know because it shows how quickly you can get a new
-language running when using LLVM. Furthermore, this was the <em >first</em>
-language the author ever created using LLVM. The learning curve is
-included in that four days.</p>
-<p>The language described here, Stacker, is Forth-like. Programs
-are simple collections of word definitions, and the only thing definitions
-can do is manipulate a stack or generate I/O. Stacker is not a "real"
-programming language; it's very simple. Although it is computationally
-complete, you wouldn't use it for your next big project. However,
-the fact that it is complete, it's simple, and it <em>doesn't</em> have
-a C-like syntax make it useful for demonstration purposes. It shows
-that LLVM could be applied to a wide variety of languages.</p>
-<p>The basic notions behind stacker is very simple. There's a stack of
-integers (or character pointers) that the program manipulates. Pretty
-much the only thing the program can do is manipulate the stack and do
-some limited I/O operations. The language provides you with several
-built-in words that manipulate the stack in interesting ways. To get
-your feet wet, here's how you write the traditional "Hello, World"
-program in Stacker:</p>
-<p><code>: hello_world "Hello, World!" &gt;s DROP CR ;<br>
-: MAIN hello_world ;<br></code></p>
-<p>This has two "definitions" (Stacker manipulates words, not
-functions and words have definitions): <code>MAIN</code> and <code>
-hello_world</code>. The <code>MAIN</code> definition is standard; it
-tells Stacker where to start. Here, <code>MAIN</code> is defined to
-simply invoke the word <code>hello_world</code>. The
-<code>hello_world</code> definition tells stacker to push the
-<code>"Hello, World!"</code> string on to the stack, print it out
-(<code>&gt;s</code>), pop it off the stack (<code>DROP</code>), and
-finally print a carriage return (<code>CR</code>). Although
-<code>hello_world</code> uses the stack, its net effect is null. Well
-written Stacker definitions have that characteristic. </p>
-<p>Exercise for the reader: how could you make this a one line program?</p>
-</div>
-<!-- ======================================================================= -->
-<div class="doc_section"><a name="lessons"></a>Lessons I Learned About LLVM</div>
-<div class="doc_text">
-<p>Stacker was written for two purposes: </p>
-<ol>
- <li>to get the author over the learning curve, and</li>
- <li>to provide a simple example of how to write a compiler using LLVM.</li>
-</ol>
-<p>During the development of Stacker, many lessons about LLVM were
-learned. Those lessons are described in the following subsections.<p>
-</div>
-<!-- ======================================================================= -->
-<div class="doc_subsection"><a name="value"></a>Everything's a Value!</div>
-<div class="doc_text">
-<p>Although I knew that LLVM uses a Single Static Assignment (SSA) format,
-it wasn't obvious to me how prevalent this idea was in LLVM until I really
-started using it. Reading the <a href="ProgrammersManual.html">
-Programmer's Manual</a> and <a href="LangRef.html">Language Reference</a>,
-I noted that most of the important LLVM IR (Intermediate Representation) C++
-classes were derived from the Value class. The full power of that simple
-design only became fully understood once I started constructing executable
-expressions for Stacker.</p>
-
-<p>This really makes your programming go faster. Think about compiling code
-for the following C/C++ expression: <code>(a|b)*((x+1)/(y+1))</code>. Assuming
-the values are on the stack in the order a, b, x, y, this could be
-expressed in stacker as: <code>1 + SWAP 1 + / ROT2 OR *</code>.
-You could write a function using LLVM that computes this expression like
-this: </p>
-
-<div class="doc_code"><pre>
-Value*
-expression(BasicBlock* bb, Value* a, Value* b, Value* x, Value* y )
-{
- ConstantInt* one = ConstantInt::get(Type::IntTy, 1);
- BinaryOperator* or1 = BinaryOperator::createOr(a, b, "", bb);
- BinaryOperator* add1 = BinaryOperator::createAdd(x, one, "", bb);
- BinaryOperator* add2 = BinaryOperator::createAdd(y, one, "", bb);
- BinaryOperator* div1 = BinaryOperator::createDiv(add1, add2, "", bb);
- BinaryOperator* mult1 = BinaryOperator::createMul(or1, div1, "", bb);
- return mult1;
-}
-</pre></div>
-
-<p>"Okay, big deal," you say? It is a big deal. Here's why. Note that I didn't
-have to tell this function which kinds of Values are being passed in. They could be
-<code>Instruction</code>s, <code>Constant</code>s, <code>GlobalVariable</code>s, or
-any of the other subclasses of <code>Value</code> that LLVM supports.
-Furthermore, if you specify Values that are incorrect for this sequence of
-operations, LLVM will either notice right away (at compilation time) or the LLVM
-Verifier will pick up the inconsistency when the compiler runs. In either case
-LLVM prevents you from making a type error that gets passed through to the
-generated program. This <em>really</em> helps you write a compiler that
-always generates correct code!<p>
-<p>The second point is that we don't have to worry about branching, registers,
-stack variables, saving partial results, etc. The instructions we create
-<em>are</em> the values we use. Note that all that was created in the above
-code is a Constant value and five operators. Each of the instructions <em>is</em>
-the resulting value of that instruction. This saves a lot of time.</p>
-<p>The lesson is this: <em>SSA form is very powerful: there is no difference
-between a value and the instruction that created it.</em> This is fully
-enforced by the LLVM IR. Use it to your best advantage.</p>
-</div>
-<!-- ======================================================================= -->
-<div class="doc_subsection"><a name="terminate"></a>Terminate Those Blocks!</div>
-<div class="doc_text">
-<p>I had to learn about terminating blocks the hard way: using the debugger
-to figure out what the LLVM verifier was trying to tell me and begging for
-help on the LLVMdev mailing list. I hope you avoid this experience.</p>
-<p>Emblazon this rule in your mind:</p>
-<ul>
- <li><em>All</em> <code>BasicBlock</code>s in your compiler <b>must</b> be
- terminated with a terminating instruction (branch, return, etc.).
- </li>
-</ul>
-<p>Terminating instructions are a semantic requirement of the LLVM IR. There
-is no facility for implicitly chaining together blocks placed into a function
-in the order they occur. Indeed, in the general case, blocks will not be
-added to the function in the order of execution because of the recursive
-way compilers are written.</p>
-<p>Furthermore, if you don't terminate your blocks, your compiler code will
-compile just fine. You won't find out about the problem until you're running
-the compiler and the module you just created fails on the LLVM Verifier.</p>
-</div>
-<!-- ======================================================================= -->
-<div class="doc_subsection"><a name="blocks"></a>Concrete Blocks</div>
-<div class="doc_text">
-<p>After a little initial fumbling around, I quickly caught on to how blocks
-should be constructed. In general, here's what I learned:
-<ol>
- <li><em>Create your blocks early.</em> While writing your compiler, you
- will encounter several situations where you know apriori that you will
- need several blocks. For example, if-then-else, switch, while, and for
- statements in C/C++ all need multiple blocks for expression in LLVM.
- The rule is, create them early.</li>
- <li><em>Terminate your blocks early.</em> This just reduces the chances
- that you forget to terminate your blocks which is required (go
- <a href="#terminate">here</a> for more).
- <li><em>Use getTerminator() for instruction insertion.</em> I noticed early on
- that many of the constructors for the Instruction classes take an optional
- <code>insert_before</code> argument. At first, I thought this was a mistake
- because clearly the normal mode of inserting instructions would be one at
- a time <em>after</em> some other instruction, not <em>before</em>. However,
- if you hold on to your terminating instruction (or use the handy dandy
- <code>getTerminator()</code> method on a <code>BasicBlock</code>), it can
- always be used as the <code>insert_before</code> argument to your instruction
- constructors. This causes the instruction to automatically be inserted in
- the RightPlace&trade; place, just before the terminating instruction. The
- nice thing about this design is that you can pass blocks around and insert
- new instructions into them without ever knowing what instructions came
- before. This makes for some very clean compiler design.</li>
-</ol>
-<p>The foregoing is such an important principal, its worth making an idiom:</p>
-<pre>
-BasicBlock* bb = BasicBlock::Create();
-bb->getInstList().push_back( BranchInst::Create( ... ) );
-new Instruction(..., bb->getTerminator() );
-</pre>
-<p>To make this clear, consider the typical if-then-else statement
-(see StackerCompiler::handle_if() method). We can set this up
-in a single function using LLVM in the following way: </p>
-<pre>
-using namespace llvm;
-BasicBlock*
-MyCompiler::handle_if( BasicBlock* bb, ICmpInst* condition )
-{
- // Create the blocks to contain code in the structure of if/then/else
- BasicBlock* then_bb = BasicBlock::Create();
- BasicBlock* else_bb = BasicBlock::Create();
- BasicBlock* exit_bb = BasicBlock::Create();
-
- // Insert the branch instruction for the "if"
- bb->getInstList().push_back( BranchInst::Create( then_bb, else_bb, condition ) );
-
- // Set up the terminating instructions
- then->getInstList().push_back( BranchInst::Create( exit_bb ) );
- else->getInstList().push_back( BranchInst::Create( exit_bb ) );
-
- // Fill in the then part .. details excised for brevity
- this->fill_in( then_bb );
-
- // Fill in the else part .. details excised for brevity
- this->fill_in( else_bb );
-
- // Return a block to the caller that can be filled in with the code
- // that follows the if/then/else construct.
- return exit_bb;
-}
-</pre>
-<p>Presumably in the foregoing, the calls to the "fill_in" method would add
-the instructions for the "then" and "else" parts. They would use the third part
-of the idiom almost exclusively (inserting new instructions before the
-terminator). Furthermore, they could even recurse back to <code>handle_if</code>
-should they encounter another if/then/else statement, and it will just work.</p>
-<p>Note how cleanly this all works out. In particular, the push_back methods on
-the <code>BasicBlock</code>'s instruction list. These are lists of type
-<code>Instruction</code> (which is also of type <code>Value</code>). To create
-the "if" branch we merely instantiate a <code>BranchInst</code> that takes as
-arguments the blocks to branch to and the condition to branch on. The
-<code>BasicBlock</code> objects act like branch labels! This new
-<code>BranchInst</code> terminates the <code>BasicBlock</code> provided
-as an argument. To give the caller a way to keep inserting after calling
-<code>handle_if</code>, we create an <code>exit_bb</code> block which is
-returned
-to the caller. Note that the <code>exit_bb</code> block is used as the
-terminator for both the <code>then_bb</code> and the <code>else_bb</code>
-blocks. This guarantees that no matter what else <code>handle_if</code>
-or <code>fill_in</code> does, they end up at the <code>exit_bb</code> block.
-</p>
-</div>
-<!-- ======================================================================= -->
-<div class="doc_subsection"><a name="push_back"></a>push_back Is Your Friend</div>
-<div class="doc_text">
-<p>
-One of the first things I noticed is the frequent use of the "push_back"
-method on the various lists. This is so common that it is worth mentioning.
-The "push_back" inserts a value into an STL list, vector, array, etc. at the
-end. The method might have also been named "insert_tail" or "append".
-Although I've used STL quite frequently, my use of push_back wasn't very
-high in other programs. In LLVM, you'll use it all the time.
-</p>
-</div>
-<!-- ======================================================================= -->
-<div class="doc_subsection"><a name="gep"></a>The Wily GetElementPtrInst</div>
-<div class="doc_text">
-<p>
-It took a little getting used to and several rounds of postings to the LLVM
-mailing list to wrap my head around this instruction correctly. Even though I had
-read the Language Reference and Programmer's Manual a couple times each, I still
-missed a few <em>very</em> key points:
-</p>
-<ul>
-<li>GetElementPtrInst gives you back a Value for the last thing indexed.</li>
-<li>All global variables in LLVM are <em>pointers</em>.</li>
-<li>Pointers must also be dereferenced with the GetElementPtrInst
-instruction.</li>
-</ul>
-<p>This means that when you look up an element in the global variable (assuming
-it's a struct or array), you <em>must</em> deference the pointer first! For many
-things, this leads to the idiom:
-</p>
-<pre>
-std::vector&lt;Value*&gt; index_vector;
-index_vector.push_back( ConstantInt::get( Type::LongTy, 0 );
-// ... push other indices ...
-GetElementPtrInst* gep = GetElementPtrInst::Create( ptr, index_vector );
-</pre>
-<p>For example, suppose we have a global variable whose type is [24 x int]. The
-variable itself represents a <em>pointer</em> to that array. To subscript the
-array, we need two indices, not just one. The first index (0) dereferences the
-pointer. The second index subscripts the array. If you're a "C" programmer, this
-will run against your grain because you'll naturally think of the global array
-variable and the address of its first element as the same. That tripped me up
-for a while until I realized that they really do differ .. by <em>type</em>.
-Remember that LLVM is strongly typed. Everything has a type.
-The "type" of the global variable is [24 x int]*. That is, it's
-a pointer to an array of 24 ints. When you dereference that global variable with
-a single (0) index, you now have a "[24 x int]" type. Although
-the pointer value of the dereferenced global and the address of the zero'th element
-in the array will be the same, they differ in their type. The zero'th element has
-type "int" while the pointer value has type "[24 x int]".</p>
-<p>Get this one aspect of LLVM right in your head, and you'll save yourself
-a lot of compiler writing headaches down the road.</p>
-</div>
-<!-- ======================================================================= -->
-<div class="doc_subsection"><a name="linkage"></a>Getting Linkage Types Right</div>
-<div class="doc_text">
-<p>Linkage types in LLVM can be a little confusing, especially if your compiler
-writing mind has affixed firm concepts to particular words like "weak",
-"external", "global", "linkonce", etc. LLVM does <em>not</em> use the precise
-definitions of, say, ELF or GCC, even though they share common terms. To be fair,
-the concepts are related and similar but not precisely the same. This can lead
-you to think you know what a linkage type represents but in fact it is slightly
-different. I recommend you read the
-<a href="LangRef.html#linkage"> Language Reference on this topic</a> very
-carefully. Then, read it again.<p>
-<p>Here are some handy tips that I discovered along the way:</p>
-<ul>
- <li><em>Uninitialized means external.</em> That is, the symbol is declared in the current
- module and can be used by that module, but it is not defined by that module.</li>
- <li><em>Setting an initializer changes a global' linkage type.</em> Setting an
- initializer changes a global's linkage type from whatever it was to a normal,
- defined global (not external). You'll need to call the setLinkage() method to
- reset it if you specify the initializer after the GlobalValue has been constructed.
- This is important for LinkOnce and Weak linkage types.</li>
- <li><em>Appending linkage can keep track of things.</em> Appending linkage can
- be used to keep track of compilation information at runtime. It could be used,
- for example, to build a full table of all the C++ virtual tables or hold the
- C++ RTTI data, or whatever. Appending linkage can only be applied to arrays.
- All arrays with the same name in each module are concatenated together at link
- time.</li>
-</ul>
-</div>
-<!-- ======================================================================= -->
-<div class="doc_subsection"><a name="constants"></a>Constants Are Easier Than That!</div>
-<div class="doc_text">
-<p>
-Constants in LLVM took a little getting used to until I discovered a few utility
-functions in the LLVM IR that make things easier. Here's what I learned: </p>
-<ul>
- <li>Constants are Values like anything else and can be operands of instructions</li>
- <li>Integer constants, frequently needed, can be created using the static "get"
- methods of the ConstantInt class. The nice thing about these is that you can
- "get" any kind of integer quickly.</li>
- <li>There's a special method on Constant class which allows you to get the null
- constant for <em>any</em> type. This is really handy for initializing large
- arrays or structures, etc.</li>
-</ul>
-</div>
-<!-- ======================================================================= -->
-<div class="doc_section"> <a name="lexicon">The Stacker Lexicon</a></div>
-<div class="doc_text"><p>This section describes the Stacker language</p></div>
-<div class="doc_subsection"><a name="stack"></a>The Stack</div>
-<div class="doc_text">
-<p>Stacker definitions define what they do to the global stack. Before
-proceeding, a few words about the stack are in order. The stack is simply
-a global array of 32-bit integers or pointers. A global index keeps track
-of the location of the top of the stack. All of this is hidden from the
-programmer, but it needs to be noted because it is the foundation of the
-conceptual programming model for Stacker. When you write a definition,
-you are, essentially, saying how you want that definition to manipulate
-the global stack.</p>
-<p>Manipulating the stack can be quite hazardous. There is no distinction
-given and no checking for the various types of values that can be placed
-on the stack. Automatic coercion between types is performed. In many
-cases, this is useful. For example, a boolean value placed on the stack
-can be interpreted as an integer with good results. However, using a
-word that interprets that boolean value as a pointer to a string to
-print out will almost always yield a crash. Stacker simply leaves it
-to the programmer to get it right without any interference or hindering
-on interpretation of the stack values. You've been warned. :) </p>
-</div>
-<!-- ======================================================================= -->
-<div class="doc_subsection"> <a name="punctuation"></a>Punctuation</div>
-<div class="doc_text">
-<p>Punctuation in Stacker is very simple. The colon and semi-colon
-characters are used to introduce and terminate a definition
-(respectively). Except for <em>FORWARD</em> declarations, definitions
-are all you can specify in Stacker. Definitions are read left to right.
-Immediately after the colon comes the name of the word being defined.
-The remaining words in the definition specify what the word does. The definition
-is terminated by a semi-colon.</p>
-<p>So, your typical definition will have the form:</p>
-<pre><code>: name ... ;</code></pre>
-<p>The <code>name</code> is up to you but it must start with a letter and contain
-only letters, numbers, and underscore. Names are case sensitive and must not be
-the same as the name of a built-in word. The <code>...</code> is replaced by
-the stack manipulating words that you wish to define <code>name</code> as. <p>
-</div>
-<!-- ======================================================================= -->
-<div class="doc_subsection"><a name="comments"></a>Comments</div>
-<div class="doc_text">
- <p>Stacker supports two types of comments. A hash mark (#) starts a comment
- that extends to the end of the line. It is identical to the kind of comments
- commonly used in shell scripts. A pair of parentheses also surround a comment.
- In both cases, the content of the comment is ignored by the Stacker compiler. The
- following does nothing in Stacker.
- </p>
-<pre><code>
-# This is a comment to end of line
-( This is an enclosed comment )
-</code></pre>
-<p>See the <a href="#example">example</a> program to see comments in use in
-a real program.</p>
-</div>
-<!-- ======================================================================= -->
-<div class="doc_subsection"><a name="literals"></a>Literals</div>
-<div class="doc_text">
- <p>There are three kinds of literal values in Stacker: Integers, Strings,
- and Booleans. In each case, the stack operation is to simply push the
- value on to the stack. So, for example:<br/>
- <code> 42 " is the answer." TRUE </code><br/>
- will push three values on to the stack: the integer 42, the
- string " is the answer.", and the boolean TRUE.</p>
-</div>
-<!-- ======================================================================= -->
-<div class="doc_subsection"><a name="words"></a>Words</div>
-<div class="doc_text">
-<p>Each definition in Stacker is composed of a set of words. Words are
-read and executed in order from left to right. There is very little
-checking in Stacker to make sure you're doing the right thing with
-the stack. It is assumed that the programmer knows how the stack
-transformation he applies will affect the program.</p>
-<p>Words in a definition come in two flavors: built-in and programmer
-defined. Simply mentioning the name of a previously defined or declared
-programmer-defined word causes that word's stack actions to be invoked. It
-is somewhat like a function call in other languages. The built-in
-words have various effects, described <a href="#builtins">below</a>.</p>
-<p>Sometimes you need to call a word before it is defined. For this, you can
-use the <code>FORWARD</code> declaration. It looks like this:</p>
-<p><code>FORWARD name ;</code></p>
-<p>This simply states to Stacker that "name" is the name of a definition
-that is defined elsewhere. Generally it means the definition can be found
-"forward" in the file. But, it doesn't have to be in the current compilation
-unit. Anything declared with <code>FORWARD</code> is an external symbol for
-linking.</p>
-</div>
-<!-- ======================================================================= -->
-<div class="doc_subsection"><a name="style"></a>Standard Style</div>
-<div class="doc_text">
-<p>TODO</p>
-</div>
-<!-- ======================================================================= -->
-<div class="doc_subsection"><a name="builtins"></a>Built In Words</div>
-<div class="doc_text">
-<p>The built-in words of the Stacker language are put in several groups
-depending on what they do. The groups are as follows:</p>
-<ol>
- <li><em>Logical</em>: These words provide the logical operations for
- comparing stack operands.<br/>The words are: &lt; &gt; &lt;= &gt;=
- = &lt;&gt; true false.</li>
- <li><em>Bitwise</em>: These words perform bitwise computations on
- their operands. <br/> The words are: &lt;&lt; &gt;&gt; XOR AND NOT</li>
- <li><em>Arithmetic</em>: These words perform arithmetic computations on
- their operands. <br/> The words are: ABS NEG + - * / MOD */ ++ -- MIN MAX</li>
- <li><em>Stack</em>These words manipulate the stack directly by moving
- its elements around.<br/> The words are: DROP DROP2 NIP NIP2 DUP DUP2
- SWAP SWAP2 OVER OVER2 ROT ROT2 RROT RROT2 TUCK TUCK2 PICK SELECT ROLL</li>
- <li><em>Memory</em>These words allocate, free, and manipulate memory
- areas outside the stack.<br/>The words are: MALLOC FREE GET PUT</li>
- <li><em>Control</em>: These words alter the normal left to right flow
- of execution.<br/>The words are: IF ELSE ENDIF WHILE END RETURN EXIT RECURSE</li>
- <li><em>I/O</em>: These words perform output on the standard output
- and input on the standard input. No other I/O is possible in Stacker.
- <br/>The words are: SPACE TAB CR &gt;s &gt;d &gt;c &lt;s &lt;d &lt;c.</li>
-</ol>
-<p>While you may be familiar with many of these operations from other
-programming languages, a careful review of their semantics is important
-for correct programming in Stacker. Of most importance is the effect
-that each of these built-in words has on the global stack. The effect is
-not always intuitive. To better describe the effects, we'll borrow from Forth the idiom of
-describing the effect on the stack with:</p>
-<p><code> BEFORE -- AFTER </code></p>
-<p>That is, to the left of the -- is a representation of the stack before
-the operation. To the right of the -- is a representation of the stack
-after the operation. In the table below that describes the operation of
-each of the built in words, we will denote the elements of the stack
-using the following construction:</p>
-<ol>
- <li><em>b</em> - a boolean truth value</li>
- <li><em>w</em> - a normal integer valued word.</li>
- <li><em>s</em> - a pointer to a string value</li>
- <li><em>p</em> - a pointer to a malloc'd memory block</li>
-</ol>
-</div>
-<div class="doc_text" >
- <table>
-<tr><th colspan="4">Definition Of Operation Of Built In Words</th></tr>
-<tr><th colspan="4"><b>LOGICAL OPERATIONS</b></th></tr>
-<tr>
- <td>Word</td>
- <td>Name</td>
- <td>Operation</td>
- <td>Description</td>
-</tr>
-<tr>
- <td>&lt;</td>
- <td>LT</td>
- <td>w1 w2 -- b</td>
- <td>Two values (w1 and w2) are popped off the stack and
- compared. If w1 is less than w2, TRUE is pushed back on
- the stack, otherwise FALSE is pushed back on the stack.</td>
-</tr>
-<tr><td>&gt;</td>
- <td>GT</td>
- <td>w1 w2 -- b</td>
- <td>Two values (w1 and w2) are popped off the stack and
- compared. If w1 is greater than w2, TRUE is pushed back on
- the stack, otherwise FALSE is pushed back on the stack.</td>
-</tr>
-<tr><td>&gt;=</td>
- <td>GE</td>
- <td>w1 w2 -- b</td>
- <td>Two values (w1 and w2) are popped off the stack and
- compared. If w1 is greater than or equal to w2, TRUE is
- pushed back on the stack, otherwise FALSE is pushed back
- on the stack.</td>
-</tr>
-<tr><td>&lt;=</td>
- <td>LE</td>
- <td>w1 w2 -- b</td>
- <td>Two values (w1 and w2) are popped off the stack and
- compared. If w1 is less than or equal to w2, TRUE is
- pushed back on the stack, otherwise FALSE is pushed back
- on the stack.</td>
-</tr>
-<tr><td>=</td>
- <td>EQ</td>
- <td>w1 w2 -- b</td>
- <td>Two values (w1 and w2) are popped off the stack and
- compared. If w1 is equal to w2, TRUE is
- pushed back on the stack, otherwise FALSE is pushed back
- </td>
-</tr>
-<tr><td>&lt;&gt;</td>
- <td>NE</td>
- <td>w1 w2 -- b</td>
- <td>Two values (w1 and w2) are popped off the stack and
- compared. If w1 is equal to w2, TRUE is
- pushed back on the stack, otherwise FALSE is pushed back
- </td>
-</tr>
-<tr><td>FALSE</td>
- <td>FALSE</td>
- <td> -- b</td>
- <td>The boolean value FALSE (0) is pushed on to the stack.</td>
-</tr>
-<tr><td>TRUE</td>
- <td>TRUE</td>
- <td> -- b</td>
- <td>The boolean value TRUE (-1) is pushed on to the stack.</td>
-</tr>
-<tr><th colspan="4"><b>BITWISE OPERATORS</b></th></tr>
-<tr>
- <td>Word</td>
- <td>Name</td>
- <td>Operation</td>
- <td>Description</td>
-</tr>
-<tr><td>&lt;&lt;</td>
- <td>SHL</td>
- <td>w1 w2 -- w1&lt;&lt;w2</td>
- <td>Two values (w1 and w2) are popped off the stack. The w2
- operand is shifted left by the number of bits given by the
- w1 operand. The result is pushed back to the stack.</td>
-</tr>
-<tr><td>&gt;&gt;</td>
- <td>SHR</td>
- <td>w1 w2 -- w1&gt;&gt;w2</td>
- <td>Two values (w1 and w2) are popped off the stack. The w2
- operand is shifted right by the number of bits given by the
- w1 operand. The result is pushed back to the stack.</td>
-</tr>
-<tr><td>OR</td>
- <td>OR</td>
- <td>w1 w2 -- w2|w1</td>
- <td>Two values (w1 and w2) are popped off the stack. The values
- are bitwise OR'd together and pushed back on the stack. This is
- not a logical OR. The sequence 1 2 OR yields 3 not 1.</td>
-</tr>
-<tr><td>AND</td>
- <td>AND</td>
- <td>w1 w2 -- w2&amp;w1</td>
- <td>Two values (w1 and w2) are popped off the stack. The values
- are bitwise AND'd together and pushed back on the stack. This is
- not a logical AND. The sequence 1 2 AND yields 0 not 1.</td>
-</tr>
-<tr><td>XOR</td>
- <td>XOR</td>
- <td>w1 w2 -- w2^w1</td>
- <td>Two values (w1 and w2) are popped off the stack. The values
- are bitwise exclusive OR'd together and pushed back on the stack.
- For example, The sequence 1 3 XOR yields 2.</td>
-</tr>
-<tr><th colspan="4"><b>ARITHMETIC OPERATORS</b></th></tr>
-<tr>
- <td>Word</td>
- <td>Name</td>
- <td>Operation</td>
- <td>Description</td>
-</tr>
-<tr><td>ABS</td>
- <td>ABS</td>
- <td>w -- |w|</td>
- <td>One value s popped off the stack; its absolute value is computed
- and then pushed on to the stack. If w1 is -1 then w2 is 1. If w1 is
- 1 then w2 is also 1.</td>
-</tr>
-<tr><td>NEG</td>
- <td>NEG</td>
- <td>w -- -w</td>
- <td>One value is popped off the stack which is negated and then
- pushed back on to the stack. If w1 is -1 then w2 is 1. If w1 is
- 1 then w2 is -1.</td>
-</tr>
-<tr><td> + </td>
- <td>ADD</td>
- <td>w1 w2 -- w2+w1</td>
- <td>Two values are popped off the stack. Their sum is pushed back
- on to the stack</td>
-</tr>
-<tr><td> - </td>
- <td>SUB</td>
- <td>w1 w2 -- w2-w1</td>
- <td>Two values are popped off the stack. Their difference is pushed back
- on to the stack</td>
-</tr>
-<tr><td> * </td>
- <td>MUL</td>
- <td>w1 w2 -- w2*w1</td>
- <td>Two values are popped off the stack. Their product is pushed back
- on to the stack</td>
-</tr>
-<tr><td> / </td>
- <td>DIV</td>
- <td>w1 w2 -- w2/w1</td>
- <td>Two values are popped off the stack. Their quotient is pushed back
- on to the stack</td>
-</tr>
-<tr><td>MOD</td>
- <td>MOD</td>
- <td>w1 w2 -- w2%w1</td>
- <td>Two values are popped off the stack. Their remainder after division
- of w1 by w2 is pushed back on to the stack</td>
-</tr>
-<tr><td> */ </td>
- <td>STAR_SLAH</td>
- <td>w1 w2 w3 -- (w3*w2)/w1</td>
- <td>Three values are popped off the stack. The product of w1 and w2 is
- divided by w3. The result is pushed back on to the stack.</td>
-</tr>
-<tr><td> ++ </td>
- <td>INCR</td>
- <td>w -- w+1</td>
- <td>One value is popped off the stack. It is incremented by one and then
- pushed back on to the stack.</td>
-</tr>
-<tr><td> -- </td>
- <td>DECR</td>
- <td>w -- w-1</td>
- <td>One value is popped off the stack. It is decremented by one and then
- pushed back on to the stack.</td>
-</tr>
-<tr><td>MIN</td>
- <td>MIN</td>
- <td>w1 w2 -- (w2&lt;w1?w2:w1)</td>
- <td>Two values are popped off the stack. The larger one is pushed back
- on to the stack.</td>
-</tr>
-<tr><td>MAX</td>
- <td>MAX</td>
- <td>w1 w2 -- (w2&gt;w1?w2:w1)</td>
- <td>Two values are popped off the stack. The larger value is pushed back
- on to the stack.</td>
-</tr>
-<tr><th colspan="4"><b>STACK MANIPULATION OPERATORS</b></th></tr>
-<tr>
- <td>Word</td>
- <td>Name</td>
- <td>Operation</td>
- <td>Description</td>
-</tr>
-<tr><td>DROP</td>
- <td>DROP</td>
- <td>w -- </td>
- <td>One value is popped off the stack.</td>
-</tr>
-<tr><td>DROP2</td>
- <td>DROP2</td>
- <td>w1 w2 -- </td>
- <td>Two values are popped off the stack.</td>
-</tr>
-<tr><td>NIP</td>
- <td>NIP</td>
- <td>w1 w2 -- w2</td>
- <td>The second value on the stack is removed from the stack. That is,
- a value is popped off the stack and retained. Then a second value is
- popped and the retained value is pushed.</td>
-</tr>
-<tr><td>NIP2</td>
- <td>NIP2</td>
- <td>w1 w2 w3 w4 -- w3 w4</td>
- <td>The third and fourth values on the stack are removed from it. That is,
- two values are popped and retained. Then two more values are popped and
- the two retained values are pushed back on.</td>
-</tr>
-<tr><td>DUP</td>
- <td>DUP</td>
- <td>w1 -- w1 w1</td>
- <td>One value is popped off the stack. That value is then pushed on to
- the stack twice to duplicate the top stack vaue.</td>
-</tr>
-<tr><td>DUP2</td>
- <td>DUP2</td>
- <td>w1 w2 -- w1 w2 w1 w2</td>
- <td>The top two values on the stack are duplicated. That is, two vaues
- are popped off the stack. They are alternately pushed back on the
- stack twice each.</td>
-</tr>
-<tr><td>SWAP</td>
- <td>SWAP</td>
- <td>w1 w2 -- w2 w1</td>
- <td>The top two stack items are reversed in their order. That is, two
- values are popped off the stack and pushed back on to the stack in
- the opposite order they were popped.</td>
-</tr>
-<tr><td>SWAP2</td>
- <td>SWAP2</td>
- <td>w1 w2 w3 w4 -- w3 w4 w2 w1</td>
- <td>The top four stack items are swapped in pairs. That is, two values
- are popped and retained. Then, two more values are popped and retained.
- The values are pushed back on to the stack in the reverse order but
- in pairs.</td>
-</tr>
-<tr><td>OVER</td>
- <td>OVER</td>
- <td>w1 w2-- w1 w2 w1</td>
- <td>Two values are popped from the stack. They are pushed back
- on to the stack in the order w1 w2 w1. This seems to cause the
- top stack element to be duplicated "over" the next value.</td>
-</tr>
-<tr><td>OVER2</td>
- <td>OVER2</td>
- <td>w1 w2 w3 w4 -- w1 w2 w3 w4 w1 w2</td>
- <td>The third and fourth values on the stack are replicated on to the
- top of the stack</td>
-</tr>
-<tr><td>ROT</td>
- <td>ROT</td>
- <td>w1 w2 w3 -- w2 w3 w1</td>
- <td>The top three values are rotated. That is, three value are popped
- off the stack. They are pushed back on to the stack in the order
- w1 w3 w2.</td>
-</tr>
-<tr><td>ROT2</td>
- <td>ROT2</td>
- <td>w1 w2 w3 w4 w5 w6 -- w3 w4 w5 w6 w1 w2</td>
- <td>Like ROT but the rotation is done using three pairs instead of
- three singles.</td>
-</tr>
-<tr><td>RROT</td>
- <td>RROT</td>
- <td>w1 w2 w3 -- w3 w1 w2</td>
- <td>Reverse rotation. Like ROT, but it rotates the other way around.
- Essentially, the third element on the stack is moved to the top
- of the stack.</td>
-</tr>
-<tr><td>RROT2</td>
- <td>RROT2</td>
- <td>w1 w2 w3 w4 w5 w6 -- w3 w4 w5 w6 w1 w2</td>
- <td>Double reverse rotation. Like RROT but the rotation is done using
- three pairs instead of three singles. The fifth and sixth stack
- elements are moved to the first and second positions</td>
-</tr>
-<tr><td>TUCK</td>
- <td>TUCK</td>
- <td>w1 w2 -- w2 w1 w2</td>
- <td>Similar to OVER except that the second operand is being
- replicated. Essentially, the first operand is being "tucked"
- in between two instances of the second operand. Logically, two
- values are popped off the stack. They are placed back on the
- stack in the order w2 w1 w2.</td>
-</tr>
-<tr><td>TUCK2</td>
- <td>TUCK2</td>
- <td>w1 w2 w3 w4 -- w3 w4 w1 w2 w3 w4</td>
- <td>Like TUCK but a pair of elements is tucked over two pairs.
- That is, the top two elements of the stack are duplicated and
- inserted into the stack at the fifth and positions.</td>
-</tr>
-<tr><td>PICK</td>
- <td>PICK</td>
- <td>x0 ... Xn n -- x0 ... Xn x0</td>
- <td>The top of the stack is used as an index into the remainder of
- the stack. The element at the nth position replaces the index
- (top of stack). This is useful for cycling through a set of
- values. Note that indexing is zero based. So, if n=0 then you
- get the second item on the stack. If n=1 you get the third, etc.
- Note also that the index is replaced by the n'th value. </td>
-</tr>
-<tr><td>SELECT</td>
- <td>SELECT</td>
- <td>m n X0..Xm Xm+1 .. Xn -- Xm</td>
- <td>This is like PICK but the list is removed and you need to specify
- both the index and the size of the list. Careful with this one,
- the wrong value for n can blow away a huge amount of the stack.</td>
-</tr>
-<tr><td>ROLL</td>
- <td>ROLL</td>
- <td>x0 x1 .. xn n -- x1 .. xn x0</td>
- <td><b>Not Implemented</b>. This one has been left as an exercise to
- the student. See <a href="#exercise">Exercise</a>. ROLL requires
- a value, "n", to be on the top of the stack. This value specifies how
- far into the stack to "roll". The n'th value is <em>moved</em> (not
- copied) from its location and replaces the "n" value on the top of the
- stack. In this way, all the values between "n" and x0 roll up the stack.
- The operation of ROLL is a generalized ROT. The "n" value specifies
- how much to rotate. That is, ROLL with n=1 is the same as ROT and
- ROLL with n=2 is the same as ROT2.</td>
-</tr>
-<tr><th colspan="4"><b>MEMORY OPERATORS</b></th></tr>
-<tr>
- <td>Word</td>
- <td>Name</td>
- <td>Operation</td>
- <td>Description</td>
-</tr>
-<tr><td>MALLOC</td>
- <td>MALLOC</td>
- <td>w1 -- p</td>
- <td>One value is popped off the stack. The value is used as the size
- of a memory block to allocate. The size is in bytes, not words.
- The memory allocation is completed and the address of the memory
- block is pushed on to the stack.</td>
-</tr>
-<tr><td>FREE</td>
- <td>FREE</td>
- <td>p -- </td>
- <td>One pointer value is popped off the stack. The value should be
- the address of a memory block created by the MALLOC operation. The
- associated memory block is freed. Nothing is pushed back on the
- stack. Many bugs can be created by attempting to FREE something
- that isn't a pointer to a MALLOC allocated memory block. Make
- sure you know what's on the stack. One way to do this is with
- the following idiom:<br/>
- <code>64 MALLOC DUP DUP (use ptr) DUP (use ptr) ... FREE</code>
- <br/>This ensures that an extra copy of the pointer is placed on
- the stack (for the FREE at the end) and that every use of the
- pointer is preceded by a DUP to retain the copy for FREE.</td>
-</tr>
-<tr><td>GET</td>
- <td>GET</td>
- <td>w1 p -- w2 p</td>
- <td>An integer index and a pointer to a memory block are popped of
- the block. The index is used to index one byte from the memory
- block. That byte value is retained, the pointer is pushed again
- and the retained value is pushed. Note that the pointer value
- s essentially retained in its position so this doesn't count
- as a "use ptr" in the FREE idiom.</td>
-</tr>
-<tr><td>PUT</td>
- <td>PUT</td>
- <td>w1 w2 p -- p </td>
- <td>An integer value is popped of the stack. This is the value to
- be put into a memory block. Another integer value is popped of
- the stack. This is the indexed byte in the memory block. A
- pointer to the memory block is popped off the stack. The
- first value (w1) is then converted to a byte and written
- to the element of the memory block(p) at the index given
- by the second value (w2). The pointer to the memory block is
- pushed back on the stack so this doesn't count as a "use ptr"
- in the FREE idiom.</td>
-</tr>
-<tr><th colspan="4"><b>CONTROL FLOW OPERATORS</b></th></tr>
-<tr>
- <td>Word</td>
- <td>Name</td>
- <td>Operation</td>
- <td>Description</td>
-</tr>
-<tr><td>RETURN</td>
- <td>RETURN</td>
- <td> -- </td>
- <td>The currently executing definition returns immediately to its caller.
- Note that there is an implicit <code>RETURN</code> at the end of each
- definition, logically located at the semi-colon. The sequence
- <code>RETURN ;</code> is valid but redundant.</td>
-</tr>
-<tr><td>EXIT</td>
- <td>EXIT</td>
- <td>w1 -- </td>
- <td>A return value for the program is popped off the stack. The program is
- then immediately terminated. This is normally an abnormal exit from the
- program. For a normal exit (when <code>MAIN</code> finishes), the exit
- code will always be zero in accordance with UNIX conventions.</td>
-</tr>
-<tr><td>RECURSE</td>
- <td>RECURSE</td>
- <td> -- </td>
- <td>The currently executed definition is called again. This operation is
- needed since the definition of a word doesn't exist until the semi colon
- is reacher. Attempting something like:<br/>
- <code> : recurser recurser ; </code><br/> will yield and error saying that
- "recurser" is not defined yet. To accomplish the same thing, change this
- to:<br/>
- <code> : recurser RECURSE ; </code></td>
-</tr>
-<tr><td>IF (words...) ENDIF</td>
- <td>IF (words...) ENDIF</td>
- <td>b -- </td>
- <td>A boolean value is popped of the stack. If it is non-zero then the "words..."
- are executed. Otherwise, execution continues immediately following the ENDIF.</td>
-</tr>
-<tr><td>IF (words...) ELSE (words...) ENDIF</td>
- <td>IF (words...) ELSE (words...) ENDIF</td>
- <td>b -- </td>
- <td>A boolean value is popped of the stack. If it is non-zero then the "words..."
- between IF and ELSE are executed. Otherwise the words between ELSE and ENDIF are
- executed. In either case, after the (words....) have executed, execution continues
- immediately following the ENDIF. </td>
-</tr>
-<tr><td>WHILE word END</td>
- <td>WHILE word END</td>
- <td>b -- b </td>
- <td>The boolean value on the top of the stack is examined (not popped). If
- it is non-zero then the "word" between WHILE and END is executed.
- Execution then begins again at the WHILE where the boolean on the top of
- the stack is examined again. The stack is not modified by the WHILE...END
- loop, only examined. It is imperative that the "word" in the body of the
- loop ensure that the top of the stack contains the next boolean to examine
- when it completes. Note that since booleans and integers can be coerced
- you can use the following "for loop" idiom:<br/>
- <code>(push count) WHILE word -- END</code><br/>
- For example:<br/>
- <code>10 WHILE &gt;d -- END</code><br/>
- This will print the numbers from 10 down to 1. 10 is pushed on the
- stack. Since that is non-zero, the while loop is entered. The top of
- the stack (10) is printed out with &gt;d. The top of the stack is
- decremented, yielding 9 and control is transfered back to the WHILE
- keyword. The process starts all over again and repeats until
- the top of stack is decremented to 0 at which point the WHILE test
- fails and control is transfered to the word after the END.
- </td>
-</tr>
-<tr><th colspan="4"><b>INPUT &amp; OUTPUT OPERATORS</b></th></tr>
-<tr>
- <td>Word</td>
- <td>Name</td>
- <td>Operation</td>
- <td>Description</td>
-</tr>
-<tr><td>SPACE</td>
- <td>SPACE</td>
- <td> -- </td>
- <td>A space character is put out. There is no stack effect.</td>
-</tr>
-<tr><td>TAB</td>
- <td>TAB</td>
- <td> -- </td>
- <td>A tab character is put out. There is no stack effect.</td>
-</tr>
-<tr><td>CR</td>
- <td>CR</td>
- <td> -- </td>
- <td>A carriage return character is put out. There is no stack effect.</td>
-</tr>
-<tr><td>&gt;s</td>
- <td>OUT_STR</td>
- <td> -- </td>
- <td>A string pointer is popped from the stack. It is put out.</td>
-</tr>
-<tr><td>&gt;d</td>
- <td>OUT_STR</td>
- <td> -- </td>
- <td>A value is popped from the stack. It is put out as a decimal
- integer.</td>
-</tr>
-<tr><td>&gt;c</td>
- <td>OUT_CHR</td>
- <td> -- </td>
- <td>A value is popped from the stack. It is put out as an ASCII
- character.</td>
-</tr>
-<tr><td>&lt;s</td>
- <td>IN_STR</td>
- <td> -- s </td>
- <td>A string is read from the input via the scanf(3) format string " %as".
- The resulting string is pushed on to the stack.</td>
-</tr>
-<tr><td>&lt;d</td>
- <td>IN_STR</td>
- <td> -- w </td>
- <td>An integer is read from the input via the scanf(3) format string " %d".
- The resulting value is pushed on to the stack</td>
-</tr>
-<tr><td>&lt;c</td>
- <td>IN_CHR</td>
- <td> -- w </td>
- <td>A single character is read from the input via the scanf(3) format string
- " %c". The value is converted to an integer and pushed on to the stack.</td>
-</tr>
-<tr><td>DUMP</td>
- <td>DUMP</td>
- <td> -- </td>
- <td>The stack contents are dumped to standard output. This is useful for
- debugging your definitions. Put DUMP at the beginning and end of a definition
- to see instantly the net effect of the definition.</td>
-</tr>
-</table>
-
-</div>
-<!-- ======================================================================= -->
-<div class="doc_section"> <a name="example">Prime: A Complete Example</a></div>
-<div class="doc_text">
-<p>The following fully documented program highlights many features of both
-the Stacker language and what is possible with LLVM. The program has two modes
-of operation. If you provide numeric arguments to the program, it checks to see
-if those arguments are prime numbers and prints out the results. Without any
-arguments, the program prints out any prime numbers it finds between 1 and one
-million (there's a lot of them!). The source code comments below tell the
-remainder of the story.
-</p>
-</div>
-<div class="doc_text">
-<pre><code>
-################################################################################
-#
-# Brute force prime number generator
-#
-# This program is written in classic Stacker style, that being the style of a
-# stack. Start at the bottom and read your way up !
-#
-# Reid Spencer - Nov 2003
-################################################################################
-# Utility definitions
-################################################################################
-: print &gt;d CR ;
-: it_is_a_prime TRUE ;
-: it_is_not_a_prime FALSE ;
-: continue_loop TRUE ;
-: exit_loop FALSE;
-
-################################################################################
-# This definition tries an actual division of a candidate prime number. It
-# determines whether the division loop on this candidate should continue or
-# not.
-# STACK&lt;:
-# div - the divisor to try
-# p - the prime number we are working on
-# STACK&gt;:
-# cont - should we continue the loop ?
-# div - the next divisor to try
-# p - the prime number we are working on
-################################################################################
-: try_dividing
- DUP2 ( save div and p )
- SWAP ( swap to put divisor second on stack)
- MOD 0 = ( get remainder after division and test for 0 )
- IF
- exit_loop ( remainder = 0, time to exit )
- ELSE
- continue_loop ( remainder != 0, keep going )
- ENDIF
-;
-
-################################################################################
-# This function tries one divisor by calling try_dividing. But, before doing
-# that it checks to see if the value is 1. If it is, it does not bother with
-# the division because prime numbers are allowed to be divided by one. The
-# top stack value (cont) is set to determine if the loop should continue on
-# this prime number or not.
-# STACK<:
-# cont - should we continue the loop (ignored)?
-# div - the divisor to try
-# p - the prime number we are working on
-# STACK&gt;:
-# cont - should we continue the loop ?
-# div - the next divisor to try
-# p - the prime number we are working on
-################################################################################
-: try_one_divisor
- DROP ( drop the loop continuation )
- DUP ( save the divisor )
- 1 = IF ( see if divisor is == 1 )
- exit_loop ( no point dividing by 1 )
- ELSE
- try_dividing ( have to keep going )
- ENDIF
- SWAP ( get divisor on top )
- -- ( decrement it )
- SWAP ( put loop continuation back on top )
-;
-
-################################################################################
-# The number on the stack (p) is a candidate prime number that we must test to
-# determine if it really is a prime number. To do this, we divide it by every
-# number from one p-1 to 1. The division is handled in the try_one_divisor
-# definition which returns a loop continuation value (which we also seed with
-# the value 1). After the loop, we check the divisor. If it decremented all
-# the way to zero then we found a prime, otherwise we did not find one.
-# STACK&lt;:
-# p - the prime number to check
-# STACK&gt;:
-# yn - boolean indicating if its a prime or not
-# p - the prime number checked
-################################################################################
-: try_harder
- DUP ( duplicate to get divisor value ) )
- -- ( first divisor is one less than p )
- 1 ( continue the loop )
- WHILE
- try_one_divisor ( see if its prime )
- END
- DROP ( drop the continuation value )
- 0 = IF ( test for divisor == 1 )
- it_is_a_prime ( we found one )
- ELSE
- it_is_not_a_prime ( nope, this one is not a prime )
- ENDIF
-;
-
-################################################################################
-# This definition determines if the number on the top of the stack is a prime
-# or not. It does this by testing if the value is degenerate (&lt;= 3) and
-# responding with yes, its a prime. Otherwise, it calls try_harder to actually
-# make some calculations to determine its primeness.
-# STACK&lt;:
-# p - the prime number to check
-# STACK&gt;:
-# yn - boolean indicating if its a prime or not
-# p - the prime number checked
-################################################################################
-: is_prime
- DUP ( save the prime number )
- 3 &gt;= IF ( see if its &lt;= 3 )
- it_is_a_prime ( its <= 3 just indicate its prime )
- ELSE
- try_harder ( have to do a little more work )
- ENDIF
-;
-
-################################################################################
-# This definition is called when it is time to exit the program, after we have
-# found a sufficiently large number of primes.
-# STACK&lt;: ignored
-# STACK&gt;: exits
-################################################################################
-: done
- "Finished" &gt;s CR ( say we are finished )
- 0 EXIT ( exit nicely )
-;
-
-################################################################################
-# This definition checks to see if the candidate is greater than the limit. If
-# it is, it terminates the program by calling done. Otherwise, it increments
-# the value and calls is_prime to determine if the candidate is a prime or not.
-# If it is a prime, it prints it. Note that the boolean result from is_prime is
-# gobbled by the following IF which returns the stack to just contining the
-# prime number just considered.
-# STACK&lt;:
-# p - one less than the prime number to consider
-# STAC&gt;K
-# p+1 - the prime number considered
-################################################################################
-: consider_prime
- DUP ( save the prime number to consider )
- 1000000 &lt; IF ( check to see if we are done yet )
- done ( we are done, call "done" )
- ENDIF
- ++ ( increment to next prime number )
- is_prime ( see if it is a prime )
- IF
- print ( it is, print it )
- ENDIF
-;
-
-################################################################################
-# This definition starts at one, prints it out and continues into a loop calling
-# consider_prime on each iteration. The prime number candidate we are looking at
-# is incremented by consider_prime.
-# STACK&lt;: empty
-# STACK&gt;: empty
-################################################################################
-: find_primes
- "Prime Numbers: " &gt;s CR ( say hello )
- DROP ( get rid of that pesky string )
- 1 ( stoke the fires )
- print ( print the first one, we know its prime )
- WHILE ( loop while the prime to consider is non zero )
- consider_prime ( consider one prime number )
- END
-;
-
-################################################################################
-#
-################################################################################
-: say_yes
- &gt;d ( Print the prime number )
- " is prime." ( push string to output )
- &gt;s ( output it )
- CR ( print carriage return )
- DROP ( pop string )
-;
-
-: say_no
- &gt;d ( Print the prime number )
- " is NOT prime." ( push string to put out )
- &gt;s ( put out the string )
- CR ( print carriage return )
- DROP ( pop string )
-;
-
-################################################################################
-# This definition processes a single command line argument and determines if it
-# is a prime number or not.
-# STACK&lt;:
-# n - number of arguments
-# arg1 - the prime numbers to examine
-# STACK&gt;:
-# n-1 - one less than number of arguments
-# arg2 - we processed one argument
-################################################################################
-: do_one_argument
- -- ( decrement loop counter )
- SWAP ( get the argument value )
- is_prime IF ( determine if its prime )
- say_yes ( uhuh )
- ELSE
- say_no ( nope )
- ENDIF
- DROP ( done with that argument )
-;
-
-################################################################################
-# The MAIN program just prints a banner and processes its arguments.
-# STACK&lt;:
-# n - number of arguments
-# ... - the arguments
-################################################################################
-: process_arguments
- WHILE ( while there are more arguments )
- do_one_argument ( process one argument )
- END
-;
-
-################################################################################
-# The MAIN program just prints a banner and processes its arguments.
-# STACK&lt;: arguments
-################################################################################
-: MAIN
- NIP ( get rid of the program name )
- -- ( reduce number of arguments )
- DUP ( save the arg counter )
- 1 &lt;= IF ( See if we got an argument )
- process_arguments ( tell user if they are prime )
- ELSE
- find_primes ( see how many we can find )
- ENDIF
- 0 ( push return code )
-;
-</code>
-</pre>
-</div>
-<!-- ======================================================================= -->
-<div class="doc_section"> <a name="internal">Internals</a></div>
-<div class="doc_text">
- <p><b>This section is under construction.</b>
- <p>In the mean time, you can always read the code! It has comments!</p>
-</div>
-<!-- ======================================================================= -->
-<div class="doc_subsection"> <a name="directory">Directory Structure</a></div>
-
-<div class="doc_text">
-<p>The source code, test programs, and sample programs can all be found
-in the LLVM repository named <tt>llvm-stacker</tt> This should be checked out to
-the <tt>projects</tt> directory so that it will auto-configure. To do that, make
-sure you have the llvm sources in <tt><i>llvm</i></tt>
-(see <a href="GettingStarted.html">Getting Started</a>) and then use these
-commands:</p>
-
-<div class="doc_code">
-<pre>
-% svn co http://llvm.org/svn/llvm-project/llvm-top/trunk llvm-top
-% cd llvm-top
-% make build MODULE=stacker
-</pre>
-</div>
-
-<p>Under the <tt>projects/llvm-stacker</tt> directory you will find the
-implementation of the Stacker compiler, as follows:</p>
-
-<ul>
- <li><em>lib</em> - contains most of the source code
- <ul>
- <li><em>lib/compiler</em> - contains the compiler library
- <li><em>lib/runtime</em> - contains the runtime library
- </ul></li>
- <li><em>test</em> - contains the test programs</li>
- <li><em>tools</em> - contains the Stacker compiler main program, stkrc
- <ul>
- <li><em>lib/stkrc</em> - contains the Stacker compiler main program
- </ul</li>
- <li><em>sample</em> - contains the sample programs</li>
-</ul>
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection"><a name="lexer"></a>The Lexer</div>
-
-<div class="doc_text">
-<p>See projects/llvm-stacker/lib/compiler/Lexer.l</p>
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection"><a name="parser"></a>The Parser</div>
-<div class="doc_text">
-<p>See projects/llvm-stacker/lib/compiler/StackerParser.y</p>
-</div>
-<!-- ======================================================================= -->
-<div class="doc_subsection"><a name="compiler"></a>The Compiler</div>
-<div class="doc_text">
-<p>See projects/llvm-stacker/lib/compiler/StackerCompiler.cpp</p>
-</div>
-<!-- ======================================================================= -->
-<div class="doc_subsection"><a name="runtime"></a>The Runtime</div>
-<div class="doc_text">
-<p>See projects/llvm-stacker/lib/runtime/stacker_rt.c</p>
-</div>
-<!-- ======================================================================= -->
-<div class="doc_subsection"><a name="driver"></a>Compiler Driver</div>
-<div class="doc_text">
-<p>See projects/llvm-stacker/tools/stkrc/stkrc.cpp</p>
-</div>
-<!-- ======================================================================= -->
-<div class="doc_subsection"><a name="tests"></a>Test Programs</div>
-<div class="doc_text">
-<p>See projects/llvm-stacker/test/*.st</p>
-</div>
-<!-- ======================================================================= -->
-<div class="doc_subsection"> <a name="exercise">Exercise</a></div>
-<div class="doc_text">
-<p>As you may have noted from a careful inspection of the Built-In word
-definitions, the ROLL word is not implemented. This word was left out of
-Stacker on purpose so that it can be an exercise for the student. The exercise
-is to implement the ROLL functionality (in your own workspace) and build a test
-program for it. If you can implement ROLL, you understand Stacker and probably
-a fair amount about LLVM since this is one of the more complicated Stacker
-operations. The work will almost be completely limited to the
-<a href="#compiler">compiler</a>.
-<p>The ROLL word is already recognized by both the lexer and parser but ignored
-by the compiler. That means you don't have to futz around with figuring out how
-to get the keyword recognized. It already is. The part of the compiler that
-you need to implement is the <code>ROLL</code> case in the
-<code>StackerCompiler::handle_word(int)</code> method.</p> See the
-implementations of PICK and SELECT in the same method to get some hints about
-how to complete this exercise.<p>
-<p>Good luck!</p>
-</div>
-<!-- ======================================================================= -->
-<div class="doc_subsection"><a name="todo">Things Remaining To Be Done</a></div>
-<div class="doc_text">
-<p>The initial implementation of Stacker has several deficiencies. If you're
-interested, here are some things that could be implemented better:</p>
-<ol>
- <li>Write an LLVM pass to compute the correct stack depth needed by the
- program. Currently the stack is set to a fixed number which means programs
- with large numbers of definitions might fail.</li>
- <li>Write an LLVM pass to optimize the use of the global stack. The code
- emitted currently is somewhat wasteful. It gets cleaned up a lot by existing
- passes but more could be done.</li>
- <li>Make the compiler driver use the LLVM linking facilities (with IPO)
- before depending on GCC to do the final link.</li>
- <li>Clean up parsing. It doesn't handle errors very well.</li>
- <li>Rearrange the StackerCompiler.cpp code to make better use of inserting
- instructions before a block's terminating instruction. I didn't figure this
- technique out until I was nearly done with LLVM. As it is, its a bad example
- of how to insert instructions!</li>
- <li>Provide for I/O to arbitrary files instead of just stdin/stdout.</li>
- <li>Write additional built-in words; with inspiration from FORTH</li>
- <li>Write additional sample Stacker programs.</li>
- <li>Add your own compiler writing experiences and tips in the
- <a href="#lessons">Lessons I Learned About LLVM</a> section.</li>
-</ol>
-</div>
-
-<!-- *********************************************************************** -->
-
-<hr>
-<address>
- <a href="http://jigsaw.w3.org/css-validator/check/referer"><img
- src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"></a>
- <a href="http://validator.w3.org/check/referer"><img
- src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!"></a>
-
- <a href="mailto:rspencer@x10sys.com">Reid Spencer</a><br>
- <a href="http://llvm.org">LLVM Compiler Infrastructure</a><br>
- Last modified: $Date$
-</address>
-
-</body>
-</html>
diff --git a/release_23/docs/SystemLibrary.html b/release_23/docs/SystemLibrary.html
deleted file mode 100644
index b02c7869d773..000000000000
--- a/release_23/docs/SystemLibrary.html
+++ /dev/null
@@ -1,344 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
- "http://www.w3.org/TR/html4/strict.dtd">
-<html>
-<head>
- <title>System Library</title>
- <link rel="stylesheet" href="llvm.css" type="text/css">
-</head>
-<body>
-
-<div class="doc_title">System Library</div>
-<ul>
- <li><a href="#abstract">Abstract</a></li>
- <li><a href="#requirements">Keeping LLVM Portable</a>
- <ol>
- <li><a href="#headers">Don't Include System Headers</a></li>
- <li><a href="#expose">Don't Expose System Headers</a></li>
- <li><a href="#c_headers">Allow Standard C Header Files</a></li>
- <li><a href="#cpp_headers">Allow Standard C++ Header Files</a></li>
- <li><a href="#highlev">High-Level Interface</a></li>
- <li><a href="#nofunc">No Exposed Functions</a></li>
- <li><a href="#nodata">No Exposed Data</a></li>
- <li><a href="#nodupl">No Duplicate Implementations</a></li>
- <li><a href="#nounused">No Unused Functionality</a></li>
- <li><a href="#virtuals">No Virtual Methods</a></li>
- <li><a href="#softerrors">Minimize Soft Errors</a></li>
- <li><a href="#throw">Throw Only std::string</a></li>
- <li><a href="#throw_spec">No throw() Specifications</a></li>
- <li><a href="#organization">Code Organization</a></li>
- <li><a href="#semantics">Consistent Semantics</a></li>
- <li><a href="#bug">Tracking Bugzilla Bug: 351</a></li>
- </ol></li>
-</ul>
-
-<div class="doc_author">
- <p>Written by <a href="mailto:rspencer@x10sys.com">Reid Spencer</a></p>
-</div>
-
-
-<!-- *********************************************************************** -->
-<div class="doc_section"><a name="abstract">Abstract</a></div>
-<div class="doc_text">
- <p>This document provides some details on LLVM's System Library, located in
- the source at <tt>lib/System</tt> and <tt>include/llvm/System</tt>. The
- library's purpose is to shield LLVM from the differences between operating
- systems for the few services LLVM needs from the operating system. Much of
- LLVM is written using portability features of standard C++. However, in a few
- areas, system dependent facilities are needed and the System Library is the
- wrapper around those system calls.</p>
- <p>By centralizing LLVM's use of operating system interfaces, we make it
- possible for the LLVM tool chain and runtime libraries to be more easily
- ported to new platforms since (theoretically) only <tt>lib/System</tt> needs
- to be ported. This library also unclutters the rest of LLVM from #ifdef use
- and special cases for specific operating systems. Such uses are replaced
- with simple calls to the interfaces provided in <tt>include/llvm/System</tt>.
- </p>
- <p>Note that the System Library is not intended to be a complete operating
- system wrapper (such as the Adaptive Communications Environment (ACE) or
- Apache Portable Runtime (APR)), but only provides the functionality necessary
- to support LLVM.
- <p>The System Library was written by Reid Spencer who formulated the
- design based on similar work originating from the eXtensible Programming
- System (XPS). Several people helped with the effort; especially,
- Jeff Cohen and Henrik Bach on the Win32 port.</p>
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section">
- <a name="requirements">Keeping LLVM Portable</a>
-</div>
-<div class="doc_text">
- <p>In order to keep LLVM portable, LLVM developers should adhere to a set of
- portability rules associated with the System Library. Adherence to these rules
- should help the System Library achieve its goal of shielding LLVM from the
- variations in operating system interfaces and doing so efficiently. The
- following sections define the rules needed to fulfill this objective.</p>
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection"><a name="headers">Don't Inlcude System Headers</a>
-</div>
-<div class="doc_text">
- <p>Except in <tt>lib/System</tt>, no LLVM source code should directly
- <tt>#include</tt> a system header. Care has been taken to remove all such
- <tt>#includes</tt> from LLVM while <tt>lib/System</tt> was being
- developed. Specifically this means that header files like "unistd.h",
- "windows.h", "stdio.h", and "string.h" are forbidden to be included by LLVM
- source code outside the implementation of <tt>lib/System</tt>.</p>
- <p>To obtain system-dependent functionality, existing interfaces to the system
- found in <tt>include/llvm/System</tt> should be used. If an appropriate
- interface is not available, it should be added to <tt>include/llvm/System</tt>
- and implemented in <tt>lib/System</tt> for all supported platforms.</p>
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection"><a name="expose">Don't Expose System Headers</a>
-</div>
-<div class="doc_text">
- <p>The System Library must shield LLVM from <em>all</em> system headers. To
- obtain system level functionality, LLVM source must
- <tt>#include "llvm/System/Thing.h"</tt> and nothing else. This means that
- <tt>Thing.h</tt> cannot expose any system header files. This protects LLVM
- from accidentally using system specific functionality and only allows it
- via the <tt>lib/System</tt> interface.</p>
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection"><a name="c_headers">Use Standard C Headers</a></div>
-<div class="doc_text">
- <p>The <em>standard</em> C headers (the ones beginning with "c") are allowed
- to be exposed through the <tt>lib/System</tt> interface. These headers and
- the things they declare are considered to be platform agnostic. LLVM source
- files may include them directly or obtain their inclusion through
- <tt>lib/System</tt> interfaces.</p>
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection"><a name="cpp_headers">Use Standard C++ Headers</a>
-</div>
-<div class="doc_text">
- <p>The <em>standard</em> C++ headers from the standard C++ library and
- standard template library may be exposed through the <tt>lib/System</tt>
- interface. These headers and the things they declare are considered to be
- platform agnostic. LLVM source files may include them or obtain their
- inclusion through lib/System interfaces.</p>
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection"><a name="highlev">High Level Interface</a></div>
-<div class="doc_text">
- <p>The entry points specified in the interface of lib/System must be aimed at
- completing some reasonably high level task needed by LLVM. We do not want to
- simply wrap each operating system call. It would be preferable to wrap several
- operating system calls that are always used in conjunction with one another by
- LLVM.</p>
- <p>For example, consider what is needed to execute a program, wait for it to
- complete, and return its result code. On Unix, this involves the following
- operating system calls: <tt>getenv, fork, execve,</tt> and <tt>wait</tt>. The
- correct thing for lib/System to provide is a function, say
- <tt>ExecuteProgramAndWait</tt>, that implements the functionality completely.
- what we don't want is wrappers for the operating system calls involved.</p>
- <p>There must <em>not</em> be a one-to-one relationship between operating
- system calls and the System library's interface. Any such interface function
- will be suspicious.</p>
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection"><a name="nounused">No Unused Functionality</a></div>
-<div class="doc_text">
- <p>There must be no functionality specified in the interface of lib/System
- that isn't actually used by LLVM. We're not writing a general purpose
- operating system wrapper here, just enough to satisfy LLVM's needs. And, LLVM
- doesn't need much. This design goal aims to keep the lib/System interface
- small and understandable which should foster its actual use and adoption.</p>
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection"><a name="nodupl">No Duplicate Implementations</a>
-</div>
-<div class="doc_text">
- <p>The implementation of a function for a given platform must be written
- exactly once. This implies that it must be possible to apply a function's
- implementation to multiple operating systems if those operating systems can
- share the same implementation. This rule applies to the set of operating
- systems supported for a given class of operating system (e.g. Unix, Win32).
- </p>
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection"><a name="virtuals">No Virtual Methods</a></div>
-<div class="doc_text">
- <p>The System Library interfaces can be called quite frequently by LLVM. In
- order to make those calls as efficient as possible, we discourage the use of
- virtual methods. There is no need to use inheritance for implementation
- differences, it just adds complexity. The <tt>#include</tt> mechanism works
- just fine.</p>
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection"><a name="nofunc">No Exposed Functions</a></div>
-<div class="doc_text">
- <p>Any functions defined by system libraries (i.e. not defined by lib/System)
- must not be exposed through the lib/System interface, even if the header file
- for that function is not exposed. This prevents inadvertent use of system
- specific functionality.</p>
- <p>For example, the <tt>stat</tt> system call is notorious for having
- variations in the data it provides. <tt>lib/System</tt> must not declare
- <tt>stat</tt> nor allow it to be declared. Instead it should provide its own
- interface to discovering information about files and directories. Those
- interfaces may be implemented in terms of <tt>stat</tt> but that is strictly
- an implementation detail. The interface provided by the System Library must
- be implemented on all platforms (even those without <tt>stat</tt>).</p>
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection"><a name="nodata">No Exposed Data</a></div>
-<div class="doc_text">
- <p>Any data defined by system libraries (i.e. not defined by lib/System) must
- not be exposed through the lib/System interface, even if the header file for
- that function is not exposed. As with functions, this prevents inadvertent use
- of data that might not exist on all platforms.</p>
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection"><a name="softerrors">Minimize Soft Errors</a></div>
-<div class="doc_text">
- <p>Operating system interfaces will generally provide error results for every
- little thing that could go wrong. In almost all cases, you can divide these
- error results into two groups: normal/good/soft and abnormal/bad/hard. That
- is, some of the errors are simply information like "file not found",
- "insufficient privileges", etc. while other errors are much harder like
- "out of space", "bad disk sector", or "system call interrupted". We'll call
- the first group "<i>soft</i>" errors and the second group "<i>hard</i>"
- errors.<p>
- <p>lib/System must always attempt to minimize soft errors and always just
- throw a std::string on hard errors. This is a design requirement because the
- minimization of soft errors can affect the granularity and the nature of the
- interface. In general, if you find that you're wanting to throw soft errors,
- you must review the granularity of the interface because it is likely you're
- trying to implement something that is too low level. The rule of thumb is to
- provide interface functions that <em>can't</em> fail, except when faced with
- hard errors.</p>
- <p>For a trivial example, suppose we wanted to add an "OpenFileForWriting"
- function. For many operating systems, if the file doesn't exist, attempting
- to open the file will produce an error. However, lib/System should not
- simply throw that error if it occurs because its a soft error. The problem
- is that the interface function, OpenFileForWriting is too low level. It should
- be OpenOrCreateFileForWriting. In the case of the soft "doesn't exist" error,
- this function would just create it and then open it for writing.</p>
- <p>This design principle needs to be maintained in lib/System because it
- avoids the propagation of soft error handling throughout the rest of LLVM.
- Hard errors will generally just cause a termination for an LLVM tool so don't
- be bashful about throwing them.</p>
- <p>Rules of thumb:</p>
- <ol>
- <li>Don't throw soft errors, only hard errors.</li>
- <li>If you're tempted to throw a soft error, re-think the interface.</li>
- <li>Handle internally the most common normal/good/soft error conditions
- so the rest of LLVM doesn't have to.</li>
- </ol>
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection"><a name="throw">Throw Only std::string</a></div>
-<div class="doc_text">
- <p>If an error occurs that lib/System cannot handle, the only action taken by
- lib/System is to throw an instance of std:string. The contents of the string
- must explain both what happened and the context in which it happened. The
- format of the string should be a (possibly empty) list of contexts each
- terminated with a : and a space, followed by the error message, optionally
- followed by a reason, and optionally followed by a suggestion.</p>
- <p>For example, failure to open a file named "foo" could result in a message
- like:</p>
- <ul><li>foo: Unable to open file because it doesn't exist."</li></ul>
- <p>The "foo:" part is the context. The "Unable to open file" part is the error
- message. The "because it doesn't exist." part is the reason. This message has
- no suggestion. Where possible, the implementation of lib/System should use
- operating system specific facilities for converting the error code returned by
- a system call into an error message. This will help to make the error message
- more familiar to users of that type of operating system.</p>
- <p>Note that this requirement precludes the throwing of any other exceptions.
- For example, various C++ standard library functions can cause exceptions to be
- thrown (e.g. out of memory situation). In all cases, if there is a possibility
- that non-string exceptions could be thrown, the lib/System library must ensure
- that the exceptions are translated to std::string form.</p>
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection"><a name="throw_spec">No throw Specifications</a>
-</div>
-<div class="doc_text">
- <p>None of the lib/System interface functions may be declared with C++
- <tt>throw()</tt> specifications on them. This requirement makes sure that the
- compiler does not insert additional exception handling code into the interface
- functions. This is a performance consideration: lib/System functions are at
- the bottom of many call chains and as such can be frequently called. We
- need them to be as efficient as possible.</p>
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection"><a name="organization">Code Organization</a></div>
-<div class="doc_text">
- <p>Implementations of the System Library interface are separated by their
- general class of operating system. Currently only Unix and Win32 classes are
- defined but more could be added for other operating system classifications.
- To distinguish which implementation to compile, the code in lib/System uses
- the LLVM_ON_UNIX and LLVM_ON_WIN32 #defines provided via configure through the
- llvm/Config/config.h file. Each source file in lib/System, after implementing
- the generic (operating system independent) functionality needs to include the
- correct implementation using a set of <tt>#if defined(LLVM_ON_XYZ)</tt>
- directives. For example, if we had lib/System/File.cpp, we'd expect to see in
- that file:</p>
- <pre><tt>
- #if defined(LLVM_ON_UNIX)
- #include "Unix/File.cpp"
- #endif
- #if defined(LLVM_ON_WIN32)
- #include "Win32/File.cpp"
- #endif
- </tt></pre>
- <p>The implementation in lib/System/Unix/File.cpp should handle all Unix
- variants. The implementation in lib/System/Win32/File.cpp should handle all
- Win32 variants. What this does is quickly differentiate the basic class of
- operating system that will provide the implementation. The specific details
- for a given platform must still be determined through the use of
- <tt>#ifdef</tt>.</p>
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection"><a name="semantics">Consistent Semantics</a></div>
-<div class="doc_text">
- <p>The implementation of a lib/System interface can vary drastically between
- platforms. That's okay as long as the end result of the interface function
- is the same. For example, a function to create a directory is pretty straight
- forward on all operating system. System V IPC on the other hand isn't even
- supported on all platforms. Instead of "supporting" System V IPC, lib/System
- should provide an interface to the basic concept of inter-process
- communications. The implementations might use System V IPC if that was
- available or named pipes, or whatever gets the job done effectively for a
- given operating system. In all cases, the interface and the implementation
- must be semantically consistent. </p>
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection"><a name="bug">Bug 351</a></div>
-<div class="doc_text">
- <p>See <a href="http://llvm.org/PR351">bug 351</a>
- for further details on the progress of this work</p>
-</div>
-
-<!-- *********************************************************************** -->
-
-<hr>
-<address>
- <a href="http://jigsaw.w3.org/css-validator/check/referer"><img
- src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"></a>
- <a href="http://validator.w3.org/check/referer"><img
- src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!"></a>
-
- <a href="mailto:rspencer@x10sys.com">Reid Spencer</a><br>
- <a href="http://llvm.org">LLVM Compiler Infrastructure</a><br>
- Last modified: $Date$
-</address>
-</body>
-</html>
diff --git a/release_23/docs/TableGenFundamentals.html b/release_23/docs/TableGenFundamentals.html
deleted file mode 100644
index aaa555119661..000000000000
--- a/release_23/docs/TableGenFundamentals.html
+++ /dev/null
@@ -1,753 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
- "http://www.w3.org/TR/html4/strict.dtd">
-<html>
-<head>
- <title>TableGen Fundamentals</title>
- <link rel="stylesheet" href="llvm.css" type="text/css">
-</head>
-<body>
-
-<div class="doc_title">TableGen Fundamentals</div>
-
-<div class="doc_text">
-<ul>
- <li><a href="#introduction">Introduction</a>
- <ol>
- <li><a href="#concepts">Basic concepts</a></li>
- <li><a href="#example">An example record</a></li>
- <li><a href="#running">Running TableGen</a></li>
- </ol></li>
- <li><a href="#syntax">TableGen syntax</a>
- <ol>
- <li><a href="#primitives">TableGen primitives</a>
- <ol>
- <li><a href="#comments">TableGen comments</a></li>
- <li><a href="#types">The TableGen type system</a></li>
- <li><a href="#values">TableGen values and expressions</a></li>
- </ol></li>
- <li><a href="#classesdefs">Classes and definitions</a>
- <ol>
- <li><a href="#valuedef">Value definitions</a></li>
- <li><a href="#recordlet">'let' expressions</a></li>
- <li><a href="#templateargs">Class template arguments</a></li>
- <li><a href="#multiclass">Multiclass definitions and instances</a></li>
- </ol></li>
- <li><a href="#filescope">File scope entities</a>
- <ol>
- <li><a href="#include">File inclusion</a></li>
- <li><a href="#globallet">'let' expressions</a></li>
- </ol></li>
- </ol></li>
- <li><a href="#backends">TableGen backends</a>
- <ol>
- <li><a href="#">todo</a></li>
- </ol></li>
-</ul>
-</div>
-
-<div class="doc_author">
- <p>Written by <a href="mailto:sabre@nondot.org">Chris Lattner</a></p>
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section"><a name="introduction">Introduction</a></div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>TableGen's purpose is to help a human develop and maintain records of
-domain-specific information. Because there may be a large number of these
-records, it is specifically designed to allow writing flexible descriptions and
-for common features of these records to be factored out. This reduces the
-amount of duplication in the description, reduces the chance of error, and
-makes it easier to structure domain specific information.</p>
-
-<p>The core part of TableGen <a href="#syntax">parses a file</a>, instantiates
-the declarations, and hands the result off to a domain-specific "<a
-href="#backends">TableGen backend</a>" for processing. The current major user
-of TableGen is the <a href="CodeGenerator.html">LLVM code generator</a>.</p>
-
-<p>Note that if you work on TableGen much, and use emacs or vim, that you can
-find an emacs "TableGen mode" and a vim language file in the
-<tt>llvm/utils/emacs</tt> and <tt>llvm/utils/vim</tt> directories of your LLVM
-distribution, respectively.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection"><a name="concepts">Basic concepts</a></div>
-
-<div class="doc_text">
-
-<p>TableGen files consist of two key parts: 'classes' and 'definitions', both
-of which are considered 'records'.</p>
-
-<p><b>TableGen records</b> have a unique name, a list of values, and a list of
-superclasses. The list of values is the main data that TableGen builds for each
-record; it is this that holds the domain specific information for the
-application. The interpretation of this data is left to a specific <a
-href="#backends">TableGen backend</a>, but the structure and format rules are
-taken care of and are fixed by TableGen.</p>
-
-<p><b>TableGen definitions</b> are the concrete form of 'records'. These
-generally do not have any undefined values, and are marked with the
-'<tt>def</tt>' keyword.</p>
-
-<p><b>TableGen classes</b> are abstract records that are used to build and
-describe other records. These 'classes' allow the end-user to build
-abstractions for either the domain they are targeting (such as "Register",
-"RegisterClass", and "Instruction" in the LLVM code generator) or for the
-implementor to help factor out common properties of records (such as "FPInst",
-which is used to represent floating point instructions in the X86 backend).
-TableGen keeps track of all of the classes that are used to build up a
-definition, so the backend can find all definitions of a particular class, such
-as "Instruction".</p>
-
-<p><b>TableGen multiclasses</b> are groups of abstract records that are
-instantiated all at once. Each instantiation can result in multiple TableGen
-definitions.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection"><a name="example">An example record</a></div>
-
-<div class="doc_text">
-
-<p>With no other arguments, TableGen parses the specified file and prints out
-all of the classes, then all of the definitions. This is a good way to see what
-the various definitions expand to fully. Running this on the <tt>X86.td</tt>
-file prints this (at the time of this writing):</p>
-
-<div class="doc_code">
-<pre>
-...
-<b>def</b> ADD32rr { <i>// Instruction X86Inst I</i>
- <b>string</b> Namespace = "X86";
- <b>dag</b> OutOperandList = (outs GR32:$dst);
- <b>dag</b> InOperandList = (ins GR32:$src1, GR32:$src2);
- <b>string</b> AsmString = "add{l}\t{$src2, $dst|$dst, $src2}";
- <b>list</b>&lt;dag&gt; Pattern = [(set GR32:$dst, (add GR32:$src1, GR32:$src2))];
- <b>list</b>&lt;Register&gt; Uses = [];
- <b>list</b>&lt;Register&gt; Defs = [EFLAGS];
- <b>list</b>&lt;Predicate&gt; Predicates = [];
- <b>int</b> CodeSize = 3;
- <b>int</b> AddedComplexity = 0;
- <b>bit</b> isReturn = 0;
- <b>bit</b> isBranch = 0;
- <b>bit</b> isIndirectBranch = 0;
- <b>bit</b> isBarrier = 0;
- <b>bit</b> isCall = 0;
- <b>bit</b> isSimpleLoad = 0;
- <b>bit</b> mayLoad = 0;
- <b>bit</b> mayStore = 0;
- <b>bit</b> isImplicitDef = 0;
- <b>bit</b> isTwoAddress = 1;
- <b>bit</b> isConvertibleToThreeAddress = 1;
- <b>bit</b> isCommutable = 1;
- <b>bit</b> isTerminator = 0;
- <b>bit</b> isReMaterializable = 0;
- <b>bit</b> isPredicable = 0;
- <b>bit</b> hasDelaySlot = 0;
- <b>bit</b> usesCustomDAGSchedInserter = 0;
- <b>bit</b> hasCtrlDep = 0;
- <b>bit</b> isNotDuplicable = 0;
- <b>bit</b> hasSideEffects = 0;
- <b>bit</b> mayHaveSideEffects = 0;
- <b>bit</b> neverHasSideEffects = 0;
- InstrItinClass Itinerary = NoItinerary;
- <b>string</b> Constraints = "";
- <b>string</b> DisableEncoding = "";
- <b>bits</b>&lt;8&gt; Opcode = { 0, 0, 0, 0, 0, 0, 0, 1 };
- Format Form = MRMDestReg;
- <b>bits</b>&lt;6&gt; FormBits = { 0, 0, 0, 0, 1, 1 };
- ImmType ImmT = NoImm;
- <b>bits</b>&lt;3&gt; ImmTypeBits = { 0, 0, 0 };
- <b>bit</b> hasOpSizePrefix = 0;
- <b>bit</b> hasAdSizePrefix = 0;
- <b>bits</b>&lt;4&gt; Prefix = { 0, 0, 0, 0 };
- <b>bit</b> hasREX_WPrefix = 0;
- FPFormat FPForm = ?;
- <b>bits</b>&lt;3&gt; FPFormBits = { 0, 0, 0 };
-}
-...
-</pre>
-</div>
-
-<p>This definition corresponds to a 32-bit register-register add instruction in
-the X86. The string after the '<tt>def</tt>' string indicates the name of the
-record&mdash;"<tt>ADD32rr</tt>" in this case&mdash;and the comment at the end of
-the line indicates the superclasses of the definition. The body of the record
-contains all of the data that TableGen assembled for the record, indicating that
-the instruction is part of the "X86" namespace, the pattern indicating how the
-the instruction should be emitted into the assembly file, that it is a
-two-address instruction, has a particular encoding, etc. The contents and
-semantics of the information in the record is specific to the needs of the X86
-backend, and is only shown as an example.</p>
-
-<p>As you can see, a lot of information is needed for every instruction
-supported by the code generator, and specifying it all manually would be
-unmaintainble, prone to bugs, and tiring to do in the first place. Because we
-are using TableGen, all of the information was derived from the following
-definition:</p>
-
-<div class="doc_code">
-<pre>
-let Defs = [EFLAGS],
- isCommutable = 1, <i>// X = ADD Y,Z --&gt; X = ADD Z,Y</i>
- isConvertibleToThreeAddress = 1 <b>in</b> <i>// Can transform into LEA.</i>
-def ADD32rr : I&lt;0x01, MRMDestReg, (outs GR32:$dst),
- (ins GR32:$src1, GR32:$src2),
- "add{l}\t{$src2, $dst|$dst, $src2}",
- [(set GR32:$dst, (add GR32:$src1, GR32:$src2))]&gt;;
-</pre>
-</div>
-
-<p>This definition makes use of the custom class <tt>I</tt> (extended from the
-custom class <tt>X86Inst</tt>), which is defined in the X86-specific TableGen
-file, to factor out the common features that instructions of its class share. A
-key feature of TableGen is that it allows the end-user to define the
-abstractions they prefer to use when describing their information.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection"><a name="running">Running TableGen</a></div>
-
-<div class="doc_text">
-
-<p>TableGen runs just like any other LLVM tool. The first (optional) argument
-specifies the file to read. If a filename is not specified, <tt>tblgen</tt>
-reads from standard input.</p>
-
-<p>To be useful, one of the <a href="#backends">TableGen backends</a> must be
-used. These backends are selectable on the command line (type '<tt>tblgen
--help</tt>' for a list). For example, to get a list of all of the definitions
-that subclass a particular type (which can be useful for building up an enum
-list of these records), use the <tt>-print-enums</tt> option:</p>
-
-<div class="doc_code">
-<pre>
-$ tblgen X86.td -print-enums -class=Register
-AH, AL, AX, BH, BL, BP, BPL, BX, CH, CL, CX, DH, DI, DIL, DL, DX, EAX, EBP, EBX,
-ECX, EDI, EDX, EFLAGS, EIP, ESI, ESP, FP0, FP1, FP2, FP3, FP4, FP5, FP6, IP,
-MM0, MM1, MM2, MM3, MM4, MM5, MM6, MM7, R10, R10B, R10D, R10W, R11, R11B, R11D,
-R11W, R12, R12B, R12D, R12W, R13, R13B, R13D, R13W, R14, R14B, R14D, R14W, R15,
-R15B, R15D, R15W, R8, R8B, R8D, R8W, R9, R9B, R9D, R9W, RAX, RBP, RBX, RCX, RDI,
-RDX, RIP, RSI, RSP, SI, SIL, SP, SPL, ST0, ST1, ST2, ST3, ST4, ST5, ST6, ST7,
-XMM0, XMM1, XMM10, XMM11, XMM12, XMM13, XMM14, XMM15, XMM2, XMM3, XMM4, XMM5,
-XMM6, XMM7, XMM8, XMM9,
-
-$ tblgen X86.td -print-enums -class=Instruction
-ABS_F, ABS_Fp32, ABS_Fp64, ABS_Fp80, ADC32mi, ADC32mi8, ADC32mr, ADC32ri,
-ADC32ri8, ADC32rm, ADC32rr, ADC64mi32, ADC64mi8, ADC64mr, ADC64ri32, ADC64ri8,
-ADC64rm, ADC64rr, ADD16mi, ADD16mi8, ADD16mr, ADD16ri, ADD16ri8, ADD16rm,
-ADD16rr, ADD32mi, ADD32mi8, ADD32mr, ADD32ri, ADD32ri8, ADD32rm, ADD32rr,
-ADD64mi32, ADD64mi8, ADD64mr, ADD64ri32, ...
-</pre>
-</div>
-
-<p>The default backend prints out all of the records, as described <a
-href="#example">above</a>.</p>
-
-<p>If you plan to use TableGen, you will most likely have to <a
-href="#backends">write a backend</a> that extracts the information specific to
-what you need and formats it in the appropriate way.</p>
-
-</div>
-
-
-<!-- *********************************************************************** -->
-<div class="doc_section"><a name="syntax">TableGen syntax</a></div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>TableGen doesn't care about the meaning of data (that is up to the backend to
-define), but it does care about syntax, and it enforces a simple type system.
-This section describes the syntax and the constructs allowed in a TableGen file.
-</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection"><a name="primitives">TableGen primitives</a></div>
-
-<!-- -------------------------------------------------------------------------->
-<div class="doc_subsubsection"><a name="comments">TableGen comments</a></div>
-
-<div class="doc_text">
-
-<p>TableGen supports BCPL style "<tt>//</tt>" comments, which run to the end of
-the line, and it also supports <b>nestable</b> "<tt>/* */</tt>" comments.</p>
-
-</div>
-
-<!-- -------------------------------------------------------------------------->
-<div class="doc_subsubsection">
- <a name="types">The TableGen type system</a>
-</div>
-
-<div class="doc_text">
-
-<p>TableGen files are strongly typed, in a simple (but complete) type-system.
-These types are used to perform automatic conversions, check for errors, and to
-help interface designers constrain the input that they allow. Every <a
-href="#valuedef">value definition</a> is required to have an associated type.
-</p>
-
-<p>TableGen supports a mixture of very low-level types (such as <tt>bit</tt>)
-and very high-level types (such as <tt>dag</tt>). This flexibility is what
-allows it to describe a wide range of information conveniently and compactly.
-The TableGen types are:</p>
-
-<dl>
-<dt><tt><b>bit</b></tt></dt>
- <dd>A 'bit' is a boolean value that can hold either 0 or 1.</dd>
-
-<dt><tt><b>int</b></tt></dt>
- <dd>The 'int' type represents a simple 32-bit integer value, such as 5.</dd>
-
-<dt><tt><b>string</b></tt></dt>
- <dd>The 'string' type represents an ordered sequence of characters of
- arbitrary length.</dd>
-
-<dt><tt><b>bits</b>&lt;n&gt;</tt></dt>
- <dd>A 'bits' type is an arbitrary, but fixed, size integer that is broken up
- into individual bits. This type is useful because it can handle some bits
- being defined while others are undefined.</dd>
-
-<dt><tt><b>list</b>&lt;ty&gt;</tt></dt>
- <dd>This type represents a list whose elements are some other type. The
- contained type is arbitrary: it can even be another list type.</dd>
-
-<dt>Class type</dt>
- <dd>Specifying a class name in a type context means that the defined value
- must be a subclass of the specified class. This is useful in conjunction with
- the <b><tt>list</tt></b> type, for example, to constrain the elements of the
- list to a common base class (e.g., a <tt><b>list</b>&lt;Register&gt;</tt> can
- only contain definitions derived from the "<tt>Register</tt>" class).</dd>
-
-<dt><tt><b>dag</b></tt></dt>
- <dd>This type represents a nestable directed graph of elements.</dd>
-
-<dt><tt><b>code</b></tt></dt>
- <dd>This represents a big hunk of text. NOTE: I don't remember why this is
- distinct from string!</dd>
-</dl>
-
-<p>To date, these types have been sufficient for describing things that
-TableGen has been used for, but it is straight-forward to extend this list if
-needed.</p>
-
-</div>
-
-<!-- -------------------------------------------------------------------------->
-<div class="doc_subsubsection">
- <a name="values">TableGen values and expressions</a>
-</div>
-
-<div class="doc_text">
-
-<p>TableGen allows for a pretty reasonable number of different expression forms
-when building up values. These forms allow the TableGen file to be written in a
-natural syntax and flavor for the application. The current expression forms
-supported include:</p>
-
-<dl>
-<dt><tt>?</tt></dt>
- <dd>uninitialized field</dd>
-<dt><tt>0b1001011</tt></dt>
- <dd>binary integer value</dd>
-<dt><tt>07654321</tt></dt>
- <dd>octal integer value (indicated by a leading 0)</dd>
-<dt><tt>7</tt></dt>
- <dd>decimal integer value</dd>
-<dt><tt>0x7F</tt></dt>
- <dd>hexadecimal integer value</dd>
-<dt><tt>"foo"</tt></dt>
- <dd>string value</dd>
-<dt><tt>[{ ... }]</tt></dt>
- <dd>code fragment</dd>
-<dt><tt>[ X, Y, Z ]</tt></dt>
- <dd>list value.</dd>
-<dt><tt>{ a, b, c }</tt></dt>
- <dd>initializer for a "bits&lt;3&gt;" value</dd>
-<dt><tt>value</tt></dt>
- <dd>value reference</dd>
-<dt><tt>value{17}</tt></dt>
- <dd>access to one bit of a value</dd>
-<dt><tt>value{15-17}</tt></dt>
- <dd>access to multiple bits of a value</dd>
-<dt><tt>DEF</tt></dt>
- <dd>reference to a record definition</dd>
-<dt><tt>CLASS&lt;val list&gt;</tt></dt>
- <dd>reference to a new anonymous definition of CLASS with the specified
- template arguments.</dd>
-<dt><tt>X.Y</tt></dt>
- <dd>reference to the subfield of a value</dd>
-<dt><tt>list[4-7,17,2-3]</tt></dt>
- <dd>A slice of the 'list' list, including elements 4,5,6,7,17,2, and 3 from
- it. Elements may be included multiple times.</dd>
-<dt><tt>(DEF a, b)</tt></dt>
- <dd>a dag value. The first element is required to be a record definition, the
- remaining elements in the list may be arbitrary other values, including nested
- `<tt>dag</tt>' values.</dd>
-<dt><tt>!strconcat(a, b)</tt></dt>
- <dd>A string value that is the result of concatenating the 'a' and 'b'
- strings.</dd>
-</dl>
-
-<p>Note that all of the values have rules specifying how they convert to values
-for different types. These rules allow you to assign a value like "<tt>7</tt>"
-to a "<tt>bits&lt;4&gt;</tt>" value, for example.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="classesdefs">Classes and definitions</a>
-</div>
-
-<div class="doc_text">
-
-<p>As mentioned in the <a href="#concepts">intro</a>, classes and definitions
-(collectively known as 'records') in TableGen are the main high-level unit of
-information that TableGen collects. Records are defined with a <tt>def</tt> or
-<tt>class</tt> keyword, the record name, and an optional list of "<a
-href="#templateargs">template arguments</a>". If the record has superclasses,
-they are specified as a comma separated list that starts with a colon character
-("<tt>:</tt>"). If <a href="#valuedef">value definitions</a> or <a
-href="#recordlet">let expressions</a> are needed for the class, they are
-enclosed in curly braces ("<tt>{}</tt>"); otherwise, the record ends with a
-semicolon.</p>
-
-<p>Here is a simple TableGen file:</p>
-
-<div class="doc_code">
-<pre>
-<b>class</b> C { <b>bit</b> V = 1; }
-<b>def</b> X : C;
-<b>def</b> Y : C {
- <b>string</b> Greeting = "hello";
-}
-</pre>
-</div>
-
-<p>This example defines two definitions, <tt>X</tt> and <tt>Y</tt>, both of
-which derive from the <tt>C</tt> class. Because of this, they both get the
-<tt>V</tt> bit value. The <tt>Y</tt> definition also gets the Greeting member
-as well.</p>
-
-<p>In general, classes are useful for collecting together the commonality
-between a group of records and isolating it in a single place. Also, classes
-permit the specification of default values for their subclasses, allowing the
-subclasses to override them as they wish.</p>
-
-</div>
-
-<!---------------------------------------------------------------------------->
-<div class="doc_subsubsection">
- <a name="valuedef">Value definitions</a>
-</div>
-
-<div class="doc_text">
-
-<p>Value definitions define named entries in records. A value must be defined
-before it can be referred to as the operand for another value definition or
-before the value is reset with a <a href="#recordlet">let expression</a>. A
-value is defined by specifying a <a href="#types">TableGen type</a> and a name.
-If an initial value is available, it may be specified after the type with an
-equal sign. Value definitions require terminating semicolons.</p>
-
-</div>
-
-<!-- -------------------------------------------------------------------------->
-<div class="doc_subsubsection">
- <a name="recordlet">'let' expressions</a>
-</div>
-
-<div class="doc_text">
-
-<p>A record-level let expression is used to change the value of a value
-definition in a record. This is primarily useful when a superclass defines a
-value that a derived class or definition wants to override. Let expressions
-consist of the '<tt>let</tt>' keyword followed by a value name, an equal sign
-("<tt>=</tt>"), and a new value. For example, a new class could be added to the
-example above, redefining the <tt>V</tt> field for all of its subclasses:</p>
-
-<div class="doc_code">
-<pre>
-<b>class</b> D : C { let V = 0; }
-<b>def</b> Z : D;
-</pre>
-</div>
-
-<p>In this case, the <tt>Z</tt> definition will have a zero value for its "V"
-value, despite the fact that it derives (indirectly) from the <tt>C</tt> class,
-because the <tt>D</tt> class overrode its value.</p>
-
-</div>
-
-<!-- -------------------------------------------------------------------------->
-<div class="doc_subsubsection">
- <a name="templateargs">Class template arguments</a>
-</div>
-
-<div class="doc_text">
-
-<p>TableGen permits the definition of parameterized classes as well as normal
-concrete classes. Parameterized TableGen classes specify a list of variable
-bindings (which may optionally have defaults) that are bound when used. Here is
-a simple example:</p>
-
-<div class="doc_code">
-<pre>
-<b>class</b> FPFormat&lt;<b>bits</b>&lt;3&gt; val&gt; {
- <b>bits</b>&lt;3&gt; Value = val;
-}
-<b>def</b> NotFP : FPFormat&lt;0&gt;;
-<b>def</b> ZeroArgFP : FPFormat&lt;1&gt;;
-<b>def</b> OneArgFP : FPFormat&lt;2&gt;;
-<b>def</b> OneArgFPRW : FPFormat&lt;3&gt;;
-<b>def</b> TwoArgFP : FPFormat&lt;4&gt;;
-<b>def</b> CompareFP : FPFormat&lt;5&gt;;
-<b>def</b> CondMovFP : FPFormat&lt;6&gt;;
-<b>def</b> SpecialFP : FPFormat&lt;7&gt;;
-</pre>
-</div>
-
-<p>In this case, template arguments are used as a space efficient way to specify
-a list of "enumeration values", each with a "<tt>Value</tt>" field set to the
-specified integer.</p>
-
-<p>The more esoteric forms of <a href="#values">TableGen expressions</a> are
-useful in conjunction with template arguments. As an example:</p>
-
-<div class="doc_code">
-<pre>
-<b>class</b> ModRefVal&lt;<b>bits</b>&lt;2&gt; val&gt; {
- <b>bits</b>&lt;2&gt; Value = val;
-}
-
-<b>def</b> None : ModRefVal&lt;0&gt;;
-<b>def</b> Mod : ModRefVal&lt;1&gt;;
-<b>def</b> Ref : ModRefVal&lt;2&gt;;
-<b>def</b> ModRef : ModRefVal&lt;3&gt;;
-
-<b>class</b> Value&lt;ModRefVal MR&gt; {
- <i>// Decode some information into a more convenient format, while providing
- // a nice interface to the user of the "Value" class.</i>
- <b>bit</b> isMod = MR.Value{0};
- <b>bit</b> isRef = MR.Value{1};
-
- <i>// other stuff...</i>
-}
-
-<i>// Example uses</i>
-<b>def</b> bork : Value&lt;Mod&gt;;
-<b>def</b> zork : Value&lt;Ref&gt;;
-<b>def</b> hork : Value&lt;ModRef&gt;;
-</pre>
-</div>
-
-<p>This is obviously a contrived example, but it shows how template arguments
-can be used to decouple the interface provided to the user of the class from the
-actual internal data representation expected by the class. In this case,
-running <tt>tblgen</tt> on the example prints the following definitions:</p>
-
-<div class="doc_code">
-<pre>
-<b>def</b> bork { <i>// Value</i>
- <b>bit</b> isMod = 1;
- <b>bit</b> isRef = 0;
-}
-<b>def</b> hork { <i>// Value</i>
- <b>bit</b> isMod = 1;
- <b>bit</b> isRef = 1;
-}
-<b>def</b> zork { <i>// Value</i>
- <b>bit</b> isMod = 0;
- <b>bit</b> isRef = 1;
-}
-</pre>
-</div>
-
-<p> This shows that TableGen was able to dig into the argument and extract a
-piece of information that was requested by the designer of the "Value" class.
-For more realistic examples, please see existing users of TableGen, such as the
-X86 backend.</p>
-
-</div>
-
-<!-- -------------------------------------------------------------------------->
-<div class="doc_subsubsection">
- <a name="multiclass">Multiclass definitions and instances</a>
-</div>
-
-<div class="doc_text">
-
-<p>
-While classes with template arguments are a good way to factor commonality
-between two instances of a definition, multiclasses allow a convenient notation
-for defining multiple definitions at once (instances of implicitly constructed
-classes). For example, consider an 3-address instruction set whose instructions
-come in two forms: "<tt>reg = reg op reg</tt>" and "<tt>reg = reg op imm</tt>"
-(e.g. SPARC). In this case, you'd like to specify in one place that this
-commonality exists, then in a separate place indicate what all the ops are.
-</p>
-
-<p>
-Here is an example TableGen fragment that shows this idea:
-</p>
-
-<div class="doc_code">
-<pre>
-<b>def</b> ops;
-<b>def</b> GPR;
-<b>def</b> Imm;
-<b>class</b> inst&lt;<b>int</b> opc, <b>string</b> asmstr, <b>dag</b> operandlist&gt;;
-
-<b>multiclass</b> ri_inst&lt;<b>int</b> opc, <b>string</b> asmstr&gt; {
- def _rr : inst&lt;opc, !strconcat(asmstr, " $dst, $src1, $src2"),
- (ops GPR:$dst, GPR:$src1, GPR:$src2)&gt;;
- def _ri : inst&lt;opc, !strconcat(asmstr, " $dst, $src1, $src2"),
- (ops GPR:$dst, GPR:$src1, Imm:$src2)&gt;;
-}
-
-<i>// Instantiations of the ri_inst multiclass.</i>
-<b>defm</b> ADD : ri_inst&lt;0b111, "add"&gt;;
-<b>defm</b> SUB : ri_inst&lt;0b101, "sub"&gt;;
-<b>defm</b> MUL : ri_inst&lt;0b100, "mul"&gt;;
-...
-</pre>
-</div>
-
-<p>The name of the resultant definitions has the multidef fragment names
- appended to them, so this defines <tt>ADD_rr</tt>, <tt>ADD_ri</tt>,
- <tt>SUB_rr</tt>, etc. Using a multiclass this way is exactly equivalent to
- instantiating the classes multiple times yourself, e.g. by writing:</p>
-
-<div class="doc_code">
-<pre>
-<b>def</b> ops;
-<b>def</b> GPR;
-<b>def</b> Imm;
-<b>class</b> inst&lt;<b>int</b> opc, <b>string</b> asmstr, <b>dag</b> operandlist&gt;;
-
-<b>class</b> rrinst&lt;<b>int</b> opc, <b>string</b> asmstr&gt;
- : inst&lt;opc, !strconcat(asmstr, " $dst, $src1, $src2"),
- (ops GPR:$dst, GPR:$src1, GPR:$src2)&gt;;
-
-<b>class</b> riinst&lt;<b>int</b> opc, <b>string</b> asmstr&gt;
- : inst&lt;opc, !strconcat(asmstr, " $dst, $src1, $src2"),
- (ops GPR:$dst, GPR:$src1, Imm:$src2)&gt;;
-
-<i>// Instantiations of the ri_inst multiclass.</i>
-<b>def</b> ADD_rr : rrinst&lt;0b111, "add"&gt;;
-<b>def</b> ADD_ri : riinst&lt;0b111, "add"&gt;;
-<b>def</b> SUB_rr : rrinst&lt;0b101, "sub"&gt;;
-<b>def</b> SUB_ri : riinst&lt;0b101, "sub"&gt;;
-<b>def</b> MUL_rr : rrinst&lt;0b100, "mul"&gt;;
-<b>def</b> MUL_ri : riinst&lt;0b100, "mul"&gt;;
-...
-</pre>
-</div>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="filescope">File scope entities</a>
-</div>
-
-<!-- -------------------------------------------------------------------------->
-<div class="doc_subsubsection">
- <a name="include">File inclusion</a>
-</div>
-
-<div class="doc_text">
-<p>TableGen supports the '<tt>include</tt>' token, which textually substitutes
-the specified file in place of the include directive. The filename should be
-specified as a double quoted string immediately after the '<tt>include</tt>'
-keyword. Example:</p>
-
-<div class="doc_code">
-<pre>
-<b>include</b> "foo.td"
-</pre>
-</div>
-
-</div>
-
-<!-- -------------------------------------------------------------------------->
-<div class="doc_subsubsection">
- <a name="globallet">'let' expressions</a>
-</div>
-
-<div class="doc_text">
-
-<p>"Let" expressions at file scope are similar to <a href="#recordlet">"let"
-expressions within a record</a>, except they can specify a value binding for
-multiple records at a time, and may be useful in certain other cases.
-File-scope let expressions are really just another way that TableGen allows the
-end-user to factor out commonality from the records.</p>
-
-<p>File-scope "let" expressions take a comma-separated list of bindings to
-apply, and one of more records to bind the values in. Here are some
-examples:</p>
-
-<div class="doc_code">
-<pre>
-<b>let</b> isTerminator = 1, isReturn = 1, isBarrier = 1, hasCtrlDep = 1 <b>in</b>
- <b>def</b> RET : I&lt;0xC3, RawFrm, (outs), (ins), "ret", [(X86retflag 0)]&gt;;
-
-<b>let</b> isCall = 1 <b>in</b>
- <i>// All calls clobber the non-callee saved registers...</i>
- <b>let</b> Defs = [EAX, ECX, EDX, FP0, FP1, FP2, FP3, FP4, FP5, FP6, ST0,
- MM0, MM1, MM2, MM3, MM4, MM5, MM6, MM7,
- XMM0, XMM1, XMM2, XMM3, XMM4, XMM5, XMM6, XMM7, EFLAGS] <b>in</b> {
- <b>def</b> CALLpcrel32 : Ii32<0xE8, RawFrm, (outs), (ins i32imm:$dst,variable_ops),
- "call\t${dst:call}", []>;
- <b>def</b> CALL32r : I<0xFF, MRM2r, (outs), (ins GR32:$dst, variable_ops),
- "call\t{*}$dst", [(X86call GR32:$dst)]>;
- <b>def</b> CALL32m : I<0xFF, MRM2m, (outs), (ins i32mem:$dst, variable_ops),
- "call\t{*}$dst", []>;
- }
-</pre>
-</div>
-
-<p>File-scope "let" expressions are often useful when a couple of definitions
-need to be added to several records, and the records do not otherwise need to be
-opened, as in the case with the <tt>CALL*</tt> instructions above.</p>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section"><a name="backends">TableGen backends</a></div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>TODO: How they work, how to write one. This section should not contain
-details about any particular backend, except maybe -print-enums as an example.
-This should highlight the APIs in <tt>TableGen/Record.h</tt>.</p>
-
-</div>
-
-<!-- *********************************************************************** -->
-
-<hr>
-<address>
- <a href="http://jigsaw.w3.org/css-validator/check/referer"><img
- src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"></a>
- <a href="http://validator.w3.org/check/referer"><img
- src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!"></a>
-
- <a href="mailto:sabre@nondot.org">Chris Lattner</a><br>
- <a href="http://llvm.org">LLVM Compiler Infrastructure</a><br>
- Last modified: $Date$
-</address>
-
-</body>
-</html>
diff --git a/release_23/docs/TestingGuide.html b/release_23/docs/TestingGuide.html
deleted file mode 100644
index b279405103e5..000000000000
--- a/release_23/docs/TestingGuide.html
+++ /dev/null
@@ -1,894 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
- "http://www.w3.org/TR/html4/strict.dtd">
-<html>
-<head>
- <title>LLVM Test Suite Guide</title>
- <link rel="stylesheet" href="llvm.css" type="text/css">
-</head>
-<body>
-
-<div class="doc_title">
- LLVM Test Suite Guide
-</div>
-
-<ol>
- <li><a href="#overview">Overview</a></li>
- <li><a href="#Requirements">Requirements</a></li>
- <li><a href="#quick">Quick Start</a></li>
- <li><a href="#org">LLVM Test Suite Organization</a>
- <ul>
- <li><a href="#codefragments">Code Fragments</a></li>
- <li><a href="#wholeprograms">Whole Programs</a></li>
- </ul>
- </li>
- <li><a href="#tree">LLVM Test Suite Tree</a></li>
- <li><a href="#dgstructure">DejaGNU Structure</a></li>
- <li><a href="#progstructure"><tt>llvm-test</tt> Structure</a></li>
- <li><a href="#run">Running the LLVM Tests</a>
- <ul>
- <li><a href="#customtest">Writing custom tests for llvm-test</a></li>
- </ul>
- </li>
- <li><a href="#nightly">Running the nightly tester</a></li>
-</ol>
-
-<div class="doc_author">
- <p>Written by John T. Criswell, <a
- href="http://llvm.x10sys.com/rspencer">Reid Spencer</a>, and Tanya Lattner</p>
-</div>
-
-<!--=========================================================================-->
-<div class="doc_section"><a name="overview">Overview</a></div>
-<!--=========================================================================-->
-
-<div class="doc_text">
-
-<p>This document is the reference manual for the LLVM test suite. It documents
-the structure of the LLVM test suite, the tools needed to use it, and how to add
-and run tests.</p>
-
-</div>
-
-<!--=========================================================================-->
-<div class="doc_section"><a name="Requirements">Requirements</a></div>
-<!--=========================================================================-->
-
-<div class="doc_text">
-
-<p>In order to use the LLVM test suite, you will need all of the software
-required to build LLVM, plus the following:</p>
-
-<dl>
-<dt><a href="http://www.gnu.org/software/dejagnu/">DejaGNU</a></dt>
-<dd>The Feature and Regressions tests are organized and run by DejaGNU.</dd>
-<dt><a href="http://expect.nist.gov/">Expect</a></dt>
-<dd>Expect is required by DejaGNU.</dd>
-<dt><a href="http://www.tcl.tk/software/tcltk/">tcl</a></dt>
-<dd>Tcl is required by DejaGNU. </dd>
-
-<dt><a href="http://www.netlib.org/f2c">F2C</a></dt>
-<dd>For now, LLVM does not have a Fortran front-end, but using F2C, we can run
-Fortran benchmarks. F2C support must be enabled via <tt>configure</tt> if not
-installed in a standard place. F2C requires three items: the <tt>f2c</tt>
-executable, <tt>f2c.h</tt> to compile the generated code, and <tt>libf2c.a</tt>
-to link generated code. By default, given an F2C directory <tt>$DIR</tt>, the
-configure script will search <tt>$DIR/bin</tt> for <tt>f2c</tt>,
-<tt>$DIR/include</tt> for <tt>f2c.h</tt>, and <tt>$DIR/lib</tt> for
-<tt>libf2c.a</tt>. The default <tt>$DIR</tt> values are: <tt>/usr</tt>,
-<tt>/usr/local</tt>, <tt>/sw</tt>, and <tt>/opt</tt>. If you installed F2C in a
-different location, you must tell <tt>configure</tt>:
-
-<ul>
-<li><tt>./configure --with-f2c=$DIR</tt><br>
-This will specify a new <tt>$DIR</tt> for the above-described search
-process. This will only work if the binary, header, and library are in their
-respective subdirectories of <tt>$DIR</tt>.</li>
-
-<li><tt>./configure --with-f2c-bin=/binary/path --with-f2c-inc=/include/path
---with-f2c-lib=/lib/path</tt><br>
-This allows you to specify the F2C components separately. Note: if you choose
-this route, you MUST specify all three components, and you need to only specify
-<em>directories</em> where the files are located; do NOT include the
-filenames themselves on the <tt>configure</tt> line.</li>
-</ul></dd>
-</dl>
-
-<p>Darwin (Mac OS X) developers can simplify the installation of Expect and tcl
-by using fink. <tt>fink install expect</tt> will install both. Alternatively,
-Darwinports users can use <tt>sudo port install expect</tt> to install Expect
-and tcl.</p>
-
-</div>
-
-<!--=========================================================================-->
-<div class="doc_section"><a name="quick">Quick Start</a></div>
-<!--=========================================================================-->
-
-<div class="doc_text">
-
- <p>The tests are located in two separate Subversion modules. The basic feature
- and regression tests are in the main "llvm" module under the directory
- <tt>llvm/test</tt>. A more comprehensive test suite that includes whole
-programs in C and C++ is in the <tt>test-suite</tt> module. This module should
-be checked out to the <tt>llvm/projects</tt> directory as llvm-test (for
-historical purpose). When you <tt>configure</tt> the <tt>llvm</tt> module,
-the <tt>llvm-test</tt> directory will be automatically configured.
-Alternatively, you can configure the <tt>test-suite</tt> module manually.</p>
-<p>To run all of the simple tests in LLVM using DejaGNU, use the master Makefile
- in the <tt>llvm/test</tt> directory:</p>
-
-<div class="doc_code">
-<pre>
-% gmake -C llvm/test
-</pre>
-</div>
-
-<p>or</p>
-
-<div class="doc_code">
-<pre>
-% gmake check
-</pre>
-</div>
-
-<p>To run only a subdirectory of tests in llvm/test using DejaGNU (ie.
-Regression/Transforms), just set the TESTSUITE variable to the path of the
-subdirectory (relative to <tt>llvm/test</tt>):</p>
-
-<div class="doc_code">
-<pre>
-% gmake -C llvm/test TESTSUITE=Regression/Transforms
-</pre>
-</div>
-
-<p><b>Note: If you are running the tests with <tt>objdir != subdir</tt>, you
-must have run the complete testsuite before you can specify a
-subdirectory.</b></p>
-
-<p>To run the comprehensive test suite (tests that compile and execute whole
-programs), run the <tt>llvm-test</tt> tests:</p>
-
-<div class="doc_code">
-<pre>
-% cd llvm/projects
-% svn co http://llvm.org/svn/llvm-project/test-suite/trunk llvm-test
-% cd ..
-% ./configure --with-llvmgccdir=$LLVM_GCC_DIR
-% cd projects/llvm-test
-% gmake
-</pre>
-</div>
-
-</div>
-
-<!--=========================================================================-->
-<div class="doc_section"><a name="org">LLVM Test Suite Organization</a></div>
-<!--=========================================================================-->
-
-<div class="doc_text">
-
-<p>The LLVM test suite contains two major categories of tests: code
-fragments and whole programs. Code fragments are in the <tt>llvm</tt> module
-under the <tt>llvm/test</tt> directory. The whole programs
-test suite is in the <tt>llvm-test</tt> module under the main directory.</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsection"><a name="codefragments">Code Fragments</a></div>
-<!-- _______________________________________________________________________ -->
-
-<div class="doc_text">
-
-<p>Code fragments are small pieces of code that test a specific feature of LLVM
-or trigger a specific bug in LLVM. They are usually written in LLVM assembly
-language, but can be written in other languages if the test targets a particular
-language front end.</p>
-
-<p>Code fragments are not complete programs, and they are never executed to
-determine correct behavior.</p>
-
-<p>These code fragment tests are located in the <tt>llvm/test/Features</tt> and
-<tt>llvm/test/Regression</tt> directories.</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsection"><a name="wholeprograms">Whole Programs</a></div>
-<!-- _______________________________________________________________________ -->
-
-<div class="doc_text">
-
-<p>Whole Programs are pieces of code which can be compiled and linked into a
-stand-alone program that can be executed. These programs are generally written
-in high level languages such as C or C++, but sometimes they are written
-straight in LLVM assembly.</p>
-
-<p>These programs are compiled and then executed using several different
-methods (native compiler, LLVM C backend, LLVM JIT, LLVM native code generation,
-etc). The output of these programs is compared to ensure that LLVM is compiling
-the program correctly.</p>
-
-<p>In addition to compiling and executing programs, whole program tests serve as
-a way of benchmarking LLVM performance, both in terms of the efficiency of the
-programs generated as well as the speed with which LLVM compiles, optimizes, and
-generates code.</p>
-
-<p>All "whole program" tests are located in the <tt>test-suite</tt> Subversion
-module.</p>
-
-</div>
-
-<!--=========================================================================-->
-<div class="doc_section"><a name="tree">LLVM Test Suite Tree</a></div>
-<!--=========================================================================-->
-
-<div class="doc_text">
-
-<p>Each type of test in the LLVM test suite has its own directory. The major
-subtrees of the test suite directory tree are as follows:</p>
-
-<ul>
- <li><tt>llvm/test</tt>
- <p>This directory contains a large array of small tests
- that exercise various features of LLVM and to ensure that regressions do not
- occur. The directory is broken into several sub-directories, each focused on
- a particular area of LLVM. A few of the important ones are:</p>
- <ul>
- <li><tt>Analysis</tt>: checks Analysis passes.</li>
- <li><tt>Archive</tt>: checks the Archive library.</li>
- <li><tt>Assembler</tt>: checks Assembly reader/writer functionality.</li>
- <li><tt>Bitcode</tt>: checks Bitcode reader/writer functionality.</li>
- <li><tt>CodeGen</tt>: checks code generation and each target.</li>
- <li><tt>Features</tt>: checks various features of the LLVM language.</li>
- <li><tt>Linker</tt>: tests bitcode linking.</li>
- <li><tt>Transforms</tt>: tests each of the scalar, IPO, and utility
- transforms to ensure they make the right transformations.</li>
- <li><tt>Verifier</tt>: tests the IR verifier.</li>
- </ul>
- <p>Typically when a bug is found in LLVM, a regression test containing
- just enough code to reproduce the problem should be written and placed
- somewhere underneath this directory. In most cases, this will be a small
- piece of LLVM assembly language code, often distilled from an actual
- application or benchmark.</p></li>
-
-<li><tt>test-suite</tt>
-<p>The <tt>test-suite</tt> module contains programs that can be compiled
-with LLVM and executed. These programs are compiled using the native compiler
-and various LLVM backends. The output from the program compiled with the
-native compiler is assumed correct; the results from the other programs are
-compared to the native program output and pass if they match.</p>
-
-<p>In addition for testing correctness, the <tt>llvm-test</tt> directory also
-performs timing tests of various LLVM optimizations. It also records
-compilation times for the compilers and the JIT. This information can be
-used to compare the effectiveness of LLVM's optimizations and code
-generation.</p></li>
-
-<li><tt>llvm-test/SingleSource</tt>
-<p>The SingleSource directory contains test programs that are only a single
-source file in size. These are usually small benchmark programs or small
-programs that calculate a particular value. Several such programs are grouped
-together in each directory.</p></li>
-
-<li><tt>llvm-test/MultiSource</tt>
-<p>The MultiSource directory contains subdirectories which contain entire
-programs with multiple source files. Large benchmarks and whole applications
-go here.</p></li>
-
-<li><tt>llvm-test/External</tt>
-<p>The External directory contains Makefiles for building code that is external
-to (i.e., not distributed with) LLVM. The most prominent members of this
-directory are the SPEC 95 and SPEC 2000 benchmark suites. The presence and
-location of these external programs is configured by the llvm-test
-<tt>configure</tt> script.</p></li>
-
-</ul>
-
-</div>
-<!--=========================================================================-->
-<div class="doc_section"><a name="dgstructure">DejaGNU Structure</a></div>
-<!--=========================================================================-->
-<div class="doc_text">
- <p>The LLVM test suite is partially driven by DejaGNU and partially driven by
- GNU Make. Specifically, the Features and Regression tests are all driven by
- DejaGNU. The <tt>llvm-test</tt> module is currently driven by a set of
- Makefiles.</p>
-
- <p>The DejaGNU structure is very simple, but does require some information to
- be set. This information is gathered via <tt>configure</tt> and is written
- to a file, <tt>site.exp</tt> in <tt>llvm/test</tt>. The <tt>llvm/test</tt>
- Makefile does this work for you.</p>
-
- <p>In order for DejaGNU to work, each directory of tests must have a
- <tt>dg.exp</tt> file. DejaGNU looks for this file to determine how to run the
- tests. This file is just a Tcl script and it can do anything you want, but
- we've standardized it for the LLVM regression tests. It simply loads a Tcl
- library (<tt>test/lib/llvm.exp</tt>) and calls the <tt>llvm_runtests</tt>
- function defined in that library with a list of file names to run. The names
- are obtained by using Tcl's glob command. Any directory that contains only
- directories does not need the <tt>dg.exp</tt> file.</p>
-
- <p>The <tt>llvm-runtests</tt> function lookas at each file that is passed to
- it and gathers any lines together that match "RUN:". This are the "RUN" lines
- that specify how the test is to be run. So, each test script must contain
- RUN lines if it is to do anything. If there are no RUN lines, the
- <tt>llvm-runtests</tt> function will issue an error and the test will
- fail.</p>
-
- <p>RUN lines are specified in the comments of the test program using the
- keyword <tt>RUN</tt> followed by a colon, and lastly the command (pipeline)
- to execute. Together, these lines form the "script" that
- <tt>llvm-runtests</tt> executes to run the test case. The syntax of the
- RUN lines is similar to a shell's syntax for pipelines including I/O
- redirection and variable substitution. However, even though these lines
- may <i>look</i> like a shell script, they are not. RUN lines are interpreted
- directly by the Tcl <tt>exec</tt> command. They are never executed by a
- shell. Consequently the syntax differs from normal shell script syntax in a
- few ways. You can specify as many RUN lines as needed.</p>
-
- <p>Each RUN line is executed on its own, distinct from other lines unless
- its last character is <tt>\</tt>. This continuation character causes the RUN
- line to be concatenated with the next one. In this way you can build up long
- pipelines of commands without making huge line lengths. The lines ending in
- <tt>\</tt> are concatenated until a RUN line that doesn't end in <tt>\</tt> is
- found. This concatenated set or RUN lines then constitutes one execution.
- Tcl will substitute variables and arrange for the pipeline to be executed. If
- any process in the pipeline fails, the entire line (and test case) fails too.
- </p>
-
- <p> Below is an example of legal RUN lines in a <tt>.ll</tt> file:</p>
-
-<div class="doc_code">
-<pre>
-; RUN: llvm-as &lt; %s | llvm-dis &gt; %t1
-; RUN: llvm-dis &lt; %s.bc-13 &gt; %t2
-; RUN: diff %t1 %t2
-</pre>
-</div>
-
- <p>As with a Unix shell, the RUN: lines permit pipelines and I/O redirection
- to be used. However, the usage is slightly different than for Bash. To check
- what's legal, see the documentation for the
- <a href="http://www.tcl.tk/man/tcl8.5/TclCmd/exec.htm#M2">Tcl exec</a>
- command and the
- <a href="http://www.tcl.tk/man/tcl8.5/tutorial/Tcl26.html">tutorial</a>.
- The major differences are:</p>
- <ul>
- <li>You can't do <tt>2&gt;&amp;1</tt>. That will cause Tcl to write to a
- file named <tt>&amp;1</tt>. Usually this is done to get stderr to go through
- a pipe. You can do that in tcl with <tt>|&amp;</tt> so replace this idiom:
- <tt>... 2&gt;&amp;1 | grep</tt> with <tt>... |&amp; grep</tt></li>
- <li>You can only redirect to a file, not to another descriptor and not from
- a here document.</li>
- <li>tcl supports redirecting to open files with the @ syntax but you
- shouldn't use that here.</li>
- </ul>
-
- <p>There are some quoting rules that you must pay attention to when writing
- your RUN lines. In general nothing needs to be quoted. Tcl won't strip off any
- ' or " so they will get passed to the invoked program. For example:</p>
-
-<div class="doc_code">
-<pre>
-... | grep 'find this string'
-</pre>
-</div>
-
- <p>This will fail because the ' characters are passed to grep. This would
- instruction grep to look for <tt>'find</tt> in the files <tt>this</tt> and
- <tt>string'</tt>. To avoid this use curly braces to tell Tcl that it should
- treat everything enclosed as one value. So our example would become:</p>
-
-<div class="doc_code">
-<pre>
-... | grep {find this string}
-</pre>
-</div>
-
- <p>Additionally, the characters <tt>[</tt> and <tt>]</tt> are treated
- specially by Tcl. They tell Tcl to interpret the content as a command to
- execute. Since these characters are often used in regular expressions this can
- have disastrous results and cause the entire test run in a directory to fail.
- For example, a common idiom is to look for some basicblock number:</p>
-
-<div class="doc_code">
-<pre>
-... | grep bb[2-8]
-</pre>
-</div>
-
- <p>This, however, will cause Tcl to fail because its going to try to execute
- a program named "2-8". Instead, what you want is this:</p>
-
-<div class="doc_code">
-<pre>
-... | grep {bb\[2-8\]}
-</pre>
-</div>
-
- <p>Finally, if you need to pass the <tt>\</tt> character down to a program,
- then it must be doubled. This is another Tcl special character. So, suppose
- you had:
-
-<div class="doc_code">
-<pre>
-... | grep 'i32\*'
-</pre>
-</div>
-
- <p>This will fail to match what you want (a pointer to i32). First, the
- <tt>'</tt> do not get stripped off. Second, the <tt>\</tt> gets stripped off
- by Tcl so what grep sees is: <tt>'i32*'</tt>. That's not likely to match
- anything. To resolve this you must use <tt>\\</tt> and the <tt>{}</tt>, like
- this:</p>
-
-<div class="doc_code">
-<pre>
-... | grep {i32\\*}
-</pre>
-</div>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsection"><a name="dgvars">Vars And Substitutions</a></div>
-<div class="doc_text">
- <p>With a RUN line there are a number of substitutions that are permitted. In
- general, any Tcl variable that is available in the <tt>substitute</tt>
- function (in <tt>test/lib/llvm.exp</tt>) can be substituted into a RUN line.
- To make a substitution just write the variable's name preceded by a $.
- Additionally, for compatibility reasons with previous versions of the test
- library, certain names can be accessed with an alternate syntax: a % prefix.
- These alternates are deprecated and may go away in a future version.
- </p>
- <p>Here are the available variable names. The alternate syntax is listed in
- parentheses.</p>
-
- <dl style="margin-left: 25px">
- <dt><b>$test</b> (%s)</dt>
- <dd>The full path to the test case's source. This is suitable for passing
- on the command line as the input to an llvm tool.</dd>
-
- <dt><b>$srcdir</b></dt>
- <dd>The source directory from where the "<tt>make check</tt>" was run.</dd>
-
- <dt><b>objdir</b></dt>
- <dd>The object directory that corresponds to the <tt>$srcdir</tt>.</dd>
-
- <dt><b>subdir</b></dt>
- <dd>A partial path from the <tt>test</tt> directory that contains the
- sub-directory that contains the test source being executed.</dd>
-
- <dt><b>srcroot</b></dt>
- <dd>The root directory of the LLVM src tree.</dd>
-
- <dt><b>objroot</b></dt>
- <dd>The root directory of the LLVM object tree. This could be the same
- as the srcroot.</dd>
-
- <dt><b>path</b><dt>
- <dd>The path to the directory that contains the test case source. This is
- for locating any supporting files that are not generated by the test, but
- used by the test.</dd>
-
- <dt><b>tmp</b></dt>
- <dd>The path to a temporary file name that could be used for this test case.
- The file name won't conflict with other test cases. You can append to it if
- you need multiple temporaries. This is useful as the destination of some
- redirected output.</dd>
-
- <dt><b>llvmlibsdir</b> (%llvmlibsdir)</dt>
- <dd>The directory where the LLVM libraries are located.</dd>
-
- <dt><b>target_triplet</b> (%target_triplet)</dt>
- <dd>The target triplet that corresponds to the current host machine (the one
- running the test cases). This should probably be called "host".<dd>
-
- <dt><b>prcontext</b> (%prcontext)</dt>
- <dd>Path to the prcontext tcl script that prints some context around a
- line that matches a pattern. This isn't strictly necessary as the test suite
- is run with its PATH altered to include the test/Scripts directory where
- the prcontext script is located. Note that this script is similar to
- <tt>grep -C</tt> but you should use the <tt>prcontext</tt> script because
- not all platforms support <tt>grep -C</tt>.</dd>
-
- <dt><b>llvmgcc</b> (%llvmgcc)</dt>
- <dd>The full path to the <tt>llvm-gcc</tt> executable as specified in the
- configured LLVM environment</dd>
-
- <dt><b>llvmgxx</b> (%llvmgxx)</dt>
- <dd>The full path to the <tt>llvm-gxx</tt> executable as specified in the
- configured LLVM environment</dd>
-
- <dt><b>llvmgcc_version</b> (%llvmgcc_version)</dt>
- <dd>The full version number of the <tt>llvm-gcc</tt> executable.</dd>
-
- <dt><b>llvmgccmajvers</b> (%llvmgccmajvers)</dt>
- <dd>The major version number of the <tt>llvm-gcc</tt> executable.</dd>
-
- <dt><b>gccpath</b></dt>
- <dd>The full path to the C compiler used to <i>build </i> LLVM. Note that
- this might not be gcc.</dd>
-
- <dt><b>gxxpath</b></dt>
- <dd>The full path to the C++ compiler used to <i>build </i> LLVM. Note that
- this might not be g++.</dd>
-
- <dt><b>compile_c</b> (%compile_c)</dt>
- <dd>The full command line used to compile LLVM C source code. This has all
- the configured -I, -D and optimization options.</dd>
-
- <dt><b>compile_cxx</b> (%compile_cxx)</dt>
- <dd>The full command used to compile LLVM C++ source code. This has
- all the configured -I, -D and optimization options.</dd>
-
- <dt><b>link</b> (%link)</dt>
- <dd>This full link command used to link LLVM executables. This has all the
- configured -I, -L and -l options.</dd>
-
- <dt><b>shlibext</b> (%shlibext)</dt>
- <dd>The suffix for the host platforms share library (dll) files. This
- includes the period as the first character.</dd>
- </dl>
- <p>To add more variables, two things need to be changed. First, add a line in
- the <tt>test/Makefile</tt> that creates the <tt>site.exp</tt> file. This will
- "set" the variable as a global in the site.exp file. Second, in the
- <tt>test/lib/llvm.exp</tt> file, in the substitute proc, add the variable name
- to the list of "global" declarations at the beginning of the proc. That's it,
- the variable can then be used in test scripts.</p>
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsection"><a name="dgfeatures">Other Features</a></div>
-<div class="doc_text">
- <p>To make RUN line writing easier, there are several shell scripts located
- in the <tt>llvm/test/Scripts</tt> directory. For example:</p>
- <dl>
- <dt><b>ignore</b></dt>
- <dd>This script runs its arguments and then always returns 0. This is useful
- in cases where the test needs to cause a tool to generate an error (e.g. to
- check the error output). However, any program in a pipeline that returns a
- non-zero result will cause the test to fail. This script overcomes that
- issue and nicely documents that the test case is purposefully ignoring the
- result code of the tool</dd>
-
- <dt><b>not</b></dt>
- <dd>This script runs its arguments and then inverts the result code from
- it. Zero result codes become 1. Non-zero result codes become 0. This is
- useful to invert the result of a grep. For example "not grep X" means
- succeed only if you don't find X in the input.</dd>
- </dl>
-
- <p>Sometimes it is necessary to mark a test case as "expected fail" or XFAIL.
- You can easily mark a test as XFAIL just by including <tt>XFAIL: </tt> on a
- line near the top of the file. This signals that the test case should succeed
- if the test fails. Such test cases are counted separately by DejaGnu. To
- specify an expected fail, use the XFAIL keyword in the comments of the test
- program followed by a colon and one or more regular expressions (separated by
- a comma). The regular expressions allow you to XFAIL the test conditionally
- by host platform. The regular expressions following the : are matched against
- the target triplet or llvmgcc version number for the host machine. If there is
- a match, the test is expected to fail. If not, the test is expected to
- succeed. To XFAIL everywhere just specify <tt>XFAIL: *</tt>. When matching
- the llvm-gcc version, you can specify the major (e.g. 3) or full version
- (i.e. 3.4) number. Here is an example of an <tt>XFAIL</tt> line:</p>
-
-<div class="doc_code">
-<pre>
-; XFAIL: darwin,sun,llvmgcc4
-</pre>
-</div>
-
- <p>To make the output more useful, the <tt>llvm_runtest</tt> function wil
- scan the lines of the test case for ones that contain a pattern that matches
- PR[0-9]+. This is the syntax for specifying a PR (Problem Report) number that
- is related to the test case. The numer after "PR" specifies the LLVM bugzilla
- number. When a PR number is specified, it will be used in the pass/fail
- reporting. This is useful to quickly get some context when a test fails.</p>
-
- <p>Finally, any line that contains "END." will cause the special
- interpretation of lines to terminate. This is generally done right after the
- last RUN: line. This has two side effects: (a) it prevents special
- interpretation of lines that are part of the test program, not the
- instructions to the test case, and (b) it speeds things up for really big test
- cases by avoiding interpretation of the remainder of the file.</p>
-
-</div>
-
-<!--=========================================================================-->
-<div class="doc_section"><a name="progstructure"><tt>llvm-test</tt>
-Structure</a></div>
-<!--=========================================================================-->
-
-<div class="doc_text">
-
-<p>As mentioned previously, the <tt>llvm-test</tt> module provides three types
-of tests: MultiSource, SingleSource, and External. Each tree is then subdivided
-into several categories, including applications, benchmarks, regression tests,
-code that is strange grammatically, etc. These organizations should be
-relatively self explanatory.</p>
-
-<p>In addition to the regular "whole program" tests, the <tt>llvm-test</tt>
-module also provides a mechanism for compiling the programs in different ways.
-If the variable TEST is defined on the gmake command line, the test system will
-include a Makefile named <tt>TEST.&lt;value of TEST variable&gt;.Makefile</tt>.
-This Makefile can modify build rules to yield different results.</p>
-
-<p>For example, the LLVM nightly tester uses <tt>TEST.nightly.Makefile</tt> to
-create the nightly test reports. To run the nightly tests, run <tt>gmake
-TEST=nightly</tt>.</p>
-
-<p>There are several TEST Makefiles available in the tree. Some of them are
-designed for internal LLVM research and will not work outside of the LLVM
-research group. They may still be valuable, however, as a guide to writing your
-own TEST Makefile for any optimization or analysis passes that you develop with
-LLVM.</p>
-
-<p>Note, when configuring the <tt>llvm-test</tt> module, you might want to
-specify the following configuration options:</p>
-<dl>
- <dt><i>--enable-spec2000</i>
- <dt><i>--enable-spec2000=&lt;<tt>directory</tt>&gt;</i>
- <dd>
- Enable the use of SPEC2000 when testing LLVM. This is disabled by default
- (unless <tt>configure</tt> finds SPEC2000 installed). By specifying
- <tt>directory</tt>, you can tell configure where to find the SPEC2000
- benchmarks. If <tt>directory</tt> is left unspecified, <tt>configure</tt>
- uses the default value
- <tt>/home/vadve/shared/benchmarks/speccpu2000/benchspec</tt>.
- <p>
-
- <dt><i>--enable-spec95</i>
- <dt><i>--enable-spec95=&lt;<tt>directory</tt>&gt;</i>
- <dd>
- Enable the use of SPEC95 when testing LLVM. It is similar to the
- <i>--enable-spec2000</i> option.
- <p>
-
- <dt><i>--enable-povray</i>
- <dt><i>--enable-povray=&lt;<tt>directory</tt>&gt;</i>
- <dd>
- Enable the use of Povray as an external test. Versions of Povray written
- in C should work. This option is similar to the <i>--enable-spec2000</i>
- option.
-</dl>
-</div>
-
-<!--=========================================================================-->
-<div class="doc_section"><a name="run">Running the LLVM Tests</a></div>
-<!--=========================================================================-->
-
-<div class="doc_text">
-
-<p>First, all tests are executed within the LLVM object directory tree. They
-<i>are not</i> executed inside of the LLVM source tree. This is because the
-test suite creates temporary files during execution.</p>
-
-<p>The master Makefile in <tt>llvm/test</tt> is capable of running only the
-DejaGNU driven tests. By default, it will run all of these tests.</p>
-
-<p>To run only the DejaGNU driven tests, run <tt>gmake</tt> at the
-command line in <tt>llvm/test</tt>. To run a specific directory of tests, use
-the <tt>TESTSUITE</tt> variable.
-</p>
-
-<p>For example, to run the Regression tests, type
-<tt>gmake TESTSUITE=Regression</tt> in <tt>llvm/tests</tt>.</p>
-
-<p>Note that there are no Makefiles in <tt>llvm/test/Features</tt> and
-<tt>llvm/test/Regression</tt>. You must use DejaGNU from the <tt>llvm/test</tt>
-directory to run them.</p>
-
-<p>To run the <tt>llvm-test</tt> suite, you need to use the following steps:</p>
-
-<ol>
- <li><tt>cd</tt> into the <tt>llvm/projects</tt> directory</li>
-
- <li><p>Check out the <tt>test-suite</tt> module with:</p>
-
-<div class="doc_code">
-<pre>
-% svn co http://llvm.org/svn/llvm-project/test-suite/trunk llvm-test
-</pre>
-</div>
-
- <p>This will get the test suite into <tt>llvm/projects/llvm-test</tt></p>
-
- <li><p>Configure the test suite using llvm configure. This will automatically configure llvm-test.
- You must do it from the top level otherwise llvm-gcc will not be set which is required to
- run llvm-test:</p>
-<div class="doc_code">
-<pre>
-% cd $LLVM_OBJ_ROOT ; $LLVM_SRC_ROOT/configure --with-llvmgccdir=$LLVM_GCC_DIR
-</pre>
-</div>
- <li><tt>gmake</tt></li>
-</ol>
-<p>Note that the second and third steps only need to be done once. After you
-have the suite checked out and configured, you don't need to do it again (unless
-the test code or configure script changes). $LLVM_GCC_DIR is the path to the LLVM
-C/C++ FrontEnd</p>
-
-<p>To make a specialized test (use one of the
-<tt>llvm-test/TEST.&lt;type&gt;.Makefile</tt>s), just run:</p>
-
-<div class="doc_code">
-<pre>
-% gmake TEST=&lt;type&gt; test
-</pre>
-</div>
-
-<p>For example, you could run the nightly tester tests using the following
-commands:</p>
-
-<div class="doc_code">
-<pre>
-% cd llvm/projects/llvm-test
-% gmake TEST=nightly test
-</pre>
-</div>
-
-<p>Regardless of which test you're running, the results are printed on standard
-output and standard error. You can redirect these results to a file if you
-choose.</p>
-
-<p>Some tests are known to fail. Some are bugs that we have not fixed yet;
-others are features that we haven't added yet (or may never add). In DejaGNU,
-the result for such tests will be XFAIL (eXpected FAILure). In this way, you
-can tell the difference between an expected and unexpected failure.</p>
-
-<p>The tests in <tt>llvm-test</tt> have no such feature at this time. If the
-test passes, only warnings and other miscellaneous output will be generated. If
-a test fails, a large &lt;program&gt; FAILED message will be displayed. This
-will help you separate benign warnings from actual test failures.</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsection">
-<a name="customtest">Writing custom tests for llvm-test</a></div>
-<!-- _______________________________________________________________________ -->
-
-<div class="doc_text">
-
-<p>Assuming you can run llvm-test, (e.g. "<tt>gmake TEST=nightly report</tt>"
-should work), it is really easy to run optimizations or code generator
-components against every program in the tree, collecting statistics or running
-custom checks for correctness. At base, this is how the nightly tester works,
-it's just one example of a general framework.</p>
-
-<p>Lets say that you have an LLVM optimization pass, and you want to see how
-many times it triggers. First thing you should do is add an LLVM
-<a href="ProgrammersManual.html#Statistic">statistic</a> to your pass, which
-will tally counts of things you care about.</p>
-
-<p>Following this, you can set up a test and a report that collects these and
-formats them for easy viewing. This consists of two files, an
-"<tt>llvm-test/TEST.XXX.Makefile</tt>" fragment (where XXX is the name of your
-test) and an "<tt>llvm-test/TEST.XXX.report</tt>" file that indicates how to
-format the output into a table. There are many example reports of various
-levels of sophistication included with llvm-test, and the framework is very
-general.</p>
-
-<p>If you are interested in testing an optimization pass, check out the
-"libcalls" test as an example. It can be run like this:<p>
-
-<div class="doc_code">
-<pre>
-% cd llvm/projects/llvm-test/MultiSource/Benchmarks # or some other level
-% make TEST=libcalls report
-</pre>
-</div>
-
-<p>This will do a bunch of stuff, then eventually print a table like this:</p>
-
-<div class="doc_code">
-<pre>
-Name | total | #exit |
-...
-FreeBench/analyzer/analyzer | 51 | 6 |
-FreeBench/fourinarow/fourinarow | 1 | 1 |
-FreeBench/neural/neural | 19 | 9 |
-FreeBench/pifft/pifft | 5 | 3 |
-MallocBench/cfrac/cfrac | 1 | * |
-MallocBench/espresso/espresso | 52 | 12 |
-MallocBench/gs/gs | 4 | * |
-Prolangs-C/TimberWolfMC/timberwolfmc | 302 | * |
-Prolangs-C/agrep/agrep | 33 | 12 |
-Prolangs-C/allroots/allroots | * | * |
-Prolangs-C/assembler/assembler | 47 | * |
-Prolangs-C/bison/mybison | 74 | * |
-...
-</pre>
-</div>
-
-<p>This basically is grepping the -stats output and displaying it in a table.
-You can also use the "TEST=libcalls report.html" target to get the table in HTML
-form, similarly for report.csv and report.tex.</p>
-
-<p>The source for this is in llvm-test/TEST.libcalls.*. The format is pretty
-simple: the Makefile indicates how to run the test (in this case,
-"<tt>opt -simplify-libcalls -stats</tt>"), and the report contains one line for
-each column of the output. The first value is the header for the column and the
-second is the regex to grep the output of the command for. There are lots of
-example reports that can do fancy stuff.</p>
-
-</div>
-
-
-<!--=========================================================================-->
-<div class="doc_section"><a name="nightly">Running the nightly tester</a></div>
-<!--=========================================================================-->
-
-<div class="doc_text">
-
-<p>
-The <a href="http://llvm.org/nightlytest/">LLVM Nightly Testers</a>
-automatically check out an LLVM tree, build it, run the "nightly"
-program test (described above), run all of the feature and regression tests,
-delete the checked out tree, and then submit the results to
-<a href="http://llvm.org/nightlytest/">http://llvm.org/nightlytest/</a>.
-After test results are submitted to
-<a href="http://llvm.org/nightlytest/">http://llvm.org/nightlytest/</a>,
-they are processed and displayed on the tests page. An email to
-<a href="http://lists.cs.uiuc.edu/pipermail/llvm-testresults/">
-llvm-testresults@cs.uiuc.edu</a> summarizing the results is also generated.
-This testing scheme is designed to ensure that programs don't break as well
-as keep track of LLVM's progress over time.</p>
-
-<p>If you'd like to set up an instance of the nightly tester to run on your
-machine, take a look at the comments at the top of the
-<tt>utils/NewNightlyTest.pl</tt> file. If you decide to set up a nightly tester
-please choose a unique nickname and invoke <tt>utils/NewNightlyTest.pl</tt>
-with the "-nickname [yournickname]" command line option.
-
-<p>You can create a shell script to encapsulate the running of the script.
-The optimized x86 Linux nightly test is run from just such a script:</p>
-
-<div class="doc_code">
-<pre>
-#!/bin/bash
-BASE=/proj/work/llvm/nightlytest
-export BUILDDIR=$BASE/build
-export WEBDIR=$BASE/testresults
-export LLVMGCCDIR=/proj/work/llvm/cfrontend/install
-export PATH=/proj/install/bin:$LLVMGCCDIR/bin:$PATH
-export LD_LIBRARY_PATH=/proj/install/lib
-cd $BASE
-cp /proj/work/llvm/llvm/utils/NewNightlyTest.pl .
-nice ./NewNightlyTest.pl -nice -release -verbose -parallel -enable-linscan \
- -nickname NightlyTester -noexternals &gt; output.log 2&gt;&amp;1
-</pre>
-</div>
-
-<p>It is also possible to specify the the location your nightly test results
-are submitted. You can do this by passing the command line option
-"-submit-server [server_address]" and "-submit-script [script_on_server]" to
-<tt>utils/NewNightlyTest.pl</tt>. For example, to submit to the llvm.org
-nightly test results page, you would invoke the nightly test script with
-"-submit-server llvm.org -submit-script /nightlytest/NightlyTestAccept.cgi".
-If these options are not specified, the nightly test script sends the results
-to the llvm.org nightly test results page.</p>
-
-<p>Take a look at the <tt>NewNightlyTest.pl</tt> file to see what all of the
-flags and strings do. If you start running the nightly tests, please let us
-know. Thanks!</p>
-
-</div>
-
-<!-- *********************************************************************** -->
-
-<hr>
-<address>
- <a href="http://jigsaw.w3.org/css-validator/check/referer"><img
- src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"></a>
- <a href="http://validator.w3.org/check/referer"><img
- src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!" /></a>
-
- John T. Criswell, Reid Spencer, and Tanya Lattner<br>
- <a href="http://llvm.org">The LLVM Compiler Infrastructure</a><br/>
- Last modified: $Date$
-</address>
-</body>
-</html>
diff --git a/release_23/docs/UsingLibraries.html b/release_23/docs/UsingLibraries.html
deleted file mode 100644
index af57907ef66a..000000000000
--- a/release_23/docs/UsingLibraries.html
+++ /dev/null
@@ -1,449 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
-<html>
-<head>
- <title>Using The LLVM Libraries</title>
- <link rel="stylesheet" href="llvm.css" type="text/css">
-</head>
-<body>
-<div class="doc_title">Using The LLVM Libraries</div>
-<ol>
- <li><a href="#abstract">Abstract</a></li>
- <li><a href="#introduction">Introduction</a></li>
- <li><a href="#descriptions">Library Descriptions</a></li>
- <li><a href="#dependencies">Library Dependencies</a></li>
- <li><a href="#rot">Linkage Rules Of Thumb</a>
- <ol>
- <li><a href="#always">Always link LLVMCore, LLVMSupport, LLVMSystem</a>
- <li><a href="#onlyone">Never link both archive and re-linked</a>
- </ol>
- </li>
-</ol>
-
-<div class="doc_author">
- <p>Written by <a href="mailto:rspencer@x10sys.com">Reid Spencer</a></p>
-</div>
-
-<p class="doc_warning">Warning: This document is out of date, please see <a href="CommandGuide/html/llvm-config.html">llvm-config</a> for more information.</p>
-
-<!-- ======================================================================= -->
-<div class="doc_section"><a name="abstract">Abstract</a></div>
-<div class="doc_text">
- <p>Amongst other things, LLVM is a toolkit for building compilers, linkers,
- runtime executives, virtual machines, and other program execution related
- tools. In addition to the LLVM tool set, the functionality of LLVM is
- available through a set of libraries. To use LLVM as a toolkit for
- constructing tools, a developer needs to understand what is contained in the
- various libraries, what they depend on, and how to use them. Fortunately,
- there is a tool, <tt>llvm-config</tt> to aid with this. This document
- describes the contents of the libraries and how to use <tt>llvm-config</tt>
- to generate command line options.
-</p>
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_section"> <a name="introduction">Introduction</a></div>
-<div class="doc_text">
- <p>If you're writing a compiler, virtual machine, or any other utility based
- on LLVM, you'll need to figure out which of the many libraries files you will
- need to link with to be successful. An understanding of the contents of these
- libraries will be useful in coming up with an optimal specification for the
- libraries to link with. The purpose of this document is to reduce some of
- the trial and error that the author experienced in using LLVM.</p>
- <p>LLVM produces two types of libraries: archives (ending in <tt>.a</tt>) and
- objects (ending in <tt>.o</tt>). However, both are libraries. Libraries ending
- in <tt>.o</tt> are known as re-linked libraries because they contain all the
- compilation units of the library linked together as a single <tt>.o</tt> file.
- Furthermore, several of the libraries have <em>both</em> forms of library. The
- re-linked libraries are used whenever you want to include all symbols from the
- library. The archive libraries are used whenever you want to only resolve
- outstanding symbols at that point in the link without including everything in
- the library. </p>
- <p>If you're using the LLVM Makefile system to link your tools,you will use
- the <tt>LLVMLIBS</tt> make variable.
- (see the <a href="MakefileGuide.html#LLVMLIBS">Makefile Guide</a> for
- details). This variable specifies which LLVM libraries to link into your tool
- and the order in which they will be linked. You specify re-linked libraries by
- naming the library without a suffix. You specify archive libraries by naming
- the library with a <tt>.a</tt> suffix but without the <tt>lib</tt> prefix. The
- order in which the libraries appear in the <tt>LLVMLIBS</tt> variable
- definition is the order in which they will be linked. Getting this order
- correct for your tool can sometimes be challenging.
-</div>
-<!-- ======================================================================= -->
-<div class="doc_section"><a name="descriptions"></a>Library Descriptions</div>
-<div class="doc_text">
- <p>The table below categorizes each library
-<table style="text-align:left">
- <tr><th>Library</th><th>Forms</th><th>Description</th></tr>
- <tr><th colspan="3">Core Libraries</th></tr>
- <tr><td>LLVMArchive</td><td><tt>.a</tt></td>
- <td>LLVM archive reading and writing</td></tr>
- <tr><td>LLVMAsmParser</td><td><tt>.a</tt></td>
- <td>LLVM assembly parsing</td></tr>
- <tr><td>LLVMBCReader</td><td><tt>.a</tt></td>
- <td>LLVM bitcode reading</td></tr>
- <tr><td>LLVMBCWriter</td><td><tt>.a</tt></td>
- <td>LLVM bitcode writing</td></tr>
- <tr><td>LLVMCore</td><td><tt>.a</tt></td>
- <td>LLVM core intermediate representation</td></tr>
- <tr><td>LLVMDebugger</td><td><tt>.a</tt></td>
- <td>Source level debugging support</td></tr>
- <tr><td>LLVMLinker</td><td><tt>.a</tt></td>
- <td>Bitcode and archive linking interface</td></tr>
- <tr><td>LLVMSupport</td><td><tt>.a</tt></td>
- <td>General support utilities</td></tr>
- <tr><td>LLVMSystem</td><td><tt>.a</tt></td>
- <td>Operating system abstraction layer</td></tr>
- <tr><td>LLVMbzip2</td><td><tt>.a</tt></td>
- <td>BZip2 compression library</td></tr>
-
- <tr><th colspan="3">Analysis Libraries</th></tr>
- <tr><td>LLVMAnalysis</td><td><tt>.a</tt></td>
- <td>Various analysis passes.</td></tr>
- <tr><td>LLVMDataStructure</td><td><tt>.o</tt></td>
- <td>Data structure analysis passes.</td></tr>
- <tr><td>LLVMipa</td><td><tt>.a</tt></td>
- <td>Inter-procedural analysis passes.</td></tr>
-
- <tr><th colspan="3">Transformation Libraries</th></tr>
- <tr><td>LLVMInstrumentation</td><td><tt>.a</tt></td>
- <td>Instrumentation passes.</td></tr>
- <tr><td>LLVMipo</td><td><tt>.a</tt></td>
- <td>All inter-procedural optimization passes.</td></tr>
- <tr><td>LLVMScalarOpts</td><td><tt>.a</tt></td>
- <td>All scalar optimization passes.</td></tr>
- <tr><td>LLVMTransformUtils</td><td><tt>.a</tt></td>
- <td>Transformation utilities used by many passes.</td></tr>
-
- <tr><th colspan="3">Code Generation Libraries </th></tr>
- <tr><td>LLVMCodeGen</td><td><tt>.o</tt></td>
- <td>Native code generation infrastructure</td></tr>
- <tr><td>LLVMSelectionDAG</td><td><tt>.o</tt></td>
- <td>Aggressive instruction selector for directed acyclic graphs</td></tr>
-
- <tr><th colspan="3">Target Libraries</th></tr>
- <tr><td>LLVMAlpha</td><td><tt>.o</tt></td>
- <td>Code generation for Alpha architecture</td></tr>
- <tr><td>LLVMARM</td><td><tt>.o</tt></td>
- <td>Code generation for ARM architecture</td></tr>
- <tr><td>LLVMCBackend</td><td><tt>.o</tt></td>
- <td>'C' language code generator.</td></tr>
- <tr><td>LLVMIA64</td><td><tt>.o</tt></td>
- <td>Code generation for IA64 architecture</td></tr>
- <tr><td>LLVMPowerPC</td><td><tt>.o</tt></td>
- <td>Code generation for PowerPC architecture</td></tr>
- <tr><td>LLVMSparc</td><td><tt>.o</tt></td>
- <td>Code generation for Sparc architecture</td></tr>
- <tr><td>LLVMTarget</td><td><tt>.a</tt></td>
- <td>Generic code generation utilities.</td></tr>
- <tr><td>LLVMX86</td><td><tt>.o</tt></td>
- <td>Code generation for Intel x86 architecture</td></tr>
-
- <tr><th colspan="3">Runtime Libraries</th></tr>
- <tr><td>LLVMInterpreter</td><td><tt>.o</tt></td>
- <td>Bitcode Interpreter</td></tr>
- <tr><td>LLVMJIT</td><td><tt>.o</tt></td>
- <td>Bitcode JIT Compiler</td></tr>
- <tr><td>LLVMExecutionEngine</td><td><tt>.o</tt></td>
- <td>Virtual machine engine</td></tr>
-</table>
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_section"><a name="dependencies"></a>Using llvm-config</div>
-<div class="doc_text">
- <p>The <tt>llvm-config</tt> tool is a perl script that produces on its output
- various kinds of information. For example, the source or object directories
- used to build LLVM can be accessed by passing options to <tt>llvm-config</tt>.
- For complete details on this tool, please see the
- <a href="CommandGuide/html/llvm-config.html">manual page</a>.</p>
- <p>To understand the relationships between libraries, the <tt>llvm-config</tt>
- can be very useful. If all you know is that you want certain libraries to
- be available, you can generate the complete set of libraries to link with
- using one of four options, as below:</p>
- <ol>
- <li><tt>--ldflags</tt>. This generates the command line options necessary to
- be passed to the <tt>ld</tt> tool in order to link with LLVM. Most notably,
- the <tt>-L</tt> option is provided to specify a library search directory
- that contains the LLVM libraries.</li>
- <li><tt>--libs</tt>. This generates command line options suitable for
- use with a gcc-style linker. That is, libraries are given with a -l option
- and object files are given with a full path.</li>
- <li><tt>--libnames</tt>. This generates a list of just the library file
- names. If you know the directory in which these files reside (see --ldflags)
- then you can find the libraries there.</li>
- <li><tt>--libfiles</tt>. This generates the full path names of the
- LLVM library files.</li>
- </ol>
- <p>If you wish to delve further into how <tt>llvm-config</tt> generates the
- correct order (based on library dependencies), please see the tool named
- <tt>GenLibDeps.pl</tt> in the <tt>utils</tt> source directory of LLVM.</p>
-
- <!-- =======NOTE: =========================================================-->
- <!-- === The following graphs and <dl> list are generated automatically ===-->
- <!-- === by the util named GenLibDeps.pl in the llvm/utils directory. ===-->
- <!-- === This should be updated whenever new libraries are added, ===-->
- <!-- === removed, or changed ===-->
- <!-- =======NOTE: =========================================================-->
- <h2>Dependency Relationships Of Libraries</h2>
- <p>This graph shows the dependency of archive libraries on other archive
- libraries or objects. Where a library has both archive and object forms, only
- the archive form is shown.</p>
- <img src="img/libdeps.gif" alt="Library Dependencies"/>
- <h2>Dependency Relationships Of Object Files</h2>
- <p>This graph shows the dependency of object files on archive libraries or
- other objects. Where a library has both object and archive forms, only the
- dependency to the archive form is shown.</p>
- <img src="img/objdeps.gif" alt="Object File Dependencies"/>
- <p>The following list shows the dependency relationships between libraries in
- textual form. The information is the same as shown on the graphs but arranged
- alphabetically.</p>
-<dl>
- <dt><b>libLLVMAnalysis.a</b</dt><dd><ul>
- <li>libLLVMCore.a</li>
- <li>libLLVMSupport.a</li>
- <li>libLLVMSystem.a</li>
- <li>libLLVMTarget.a</li>
- </ul></dd>
- <dt><b>libLLVMArchive.a</b</dt><dd><ul>
- <li>libLLVMBCReader.a</li>
- <li>libLLVMCore.a</li>
- <li>libLLVMSupport.a</li>
- <li>libLLVMSystem.a</li>
- </ul></dd>
- <dt><b>libLLVMAsmParser.a</b</dt><dd><ul>
- <li>libLLVMCore.a</li>
- <li>libLLVMSystem.a</li>
- </ul></dd>
- <dt><b>libLLVMBCReader.a</b</dt><dd><ul>
- <li>libLLVMCore.a</li>
- <li>libLLVMSupport.a</li>
- <li>libLLVMSystem.a</li>
- </ul></dd>
- <dt><b>libLLVMBCWriter.a</b</dt><dd><ul>
- <li>libLLVMCore.a</li>
- <li>libLLVMSupport.a</li>
- <li>libLLVMSystem.a</li>
- </ul></dd>
- <dt><b>libLLVMCodeGen.a</b</dt><dd><ul>
- <li>libLLVMAnalysis.a</li>
- <li>libLLVMCore.a</li>
- <li>libLLVMScalarOpts.a</li>
- <li>libLLVMSupport.a</li>
- <li>libLLVMSystem.a</li>
- <li>libLLVMTarget.a</li>
- <li>libLLVMTransformUtils.a</li>
- </ul></dd>
- <dt><b>libLLVMCore.a</b</dt><dd><ul>
- <li>libLLVMSupport.a</li>
- <li>libLLVMSystem.a</li>
- </ul></dd>
- <dt><b>libLLVMDebugger.a</b</dt><dd><ul>
- <li>libLLVMBCReader.a</li>
- <li>libLLVMCore.a</li>
- <li>libLLVMSupport.a</li>
- <li>libLLVMSystem.a</li>
- </ul></dd>
- <dt><b>libLLVMInstrumentation.a</b</dt><dd><ul>
- <li>libLLVMCore.a</li>
- <li>libLLVMScalarOpts.a</li>
- <li>libLLVMSupport.a</li>
- <li>libLLVMTransformUtils.a</li>
- </ul></dd>
- <dt><b>libLLVMLinker.a</b</dt><dd><ul>
- <li>libLLVMArchive.a</li>
- <li>libLLVMBCReader.a</li>
- <li>libLLVMCore.a</li>
- <li>libLLVMSupport.a</li>
- <li>libLLVMSystem.a</li>
- </ul></dd>
- <dt><b>libLLVMScalarOpts.a</b</dt><dd><ul>
- <li>libLLVMAnalysis.a</li>
- <li>libLLVMCore.a</li>
- <li>libLLVMSupport.a</li>
- <li>libLLVMSystem.a</li>
- <li>libLLVMTarget.a</li>
- <li>libLLVMTransformUtils.a</li>
- </ul></dd>
- <dt><b>libLLVMSelectionDAG.a</b</dt><dd><ul>
- <li>libLLVMAnalysis.a</li>
- <li>libLLVMCodeGen.a</li>
- <li>libLLVMCore.a</li>
- <li>libLLVMSupport.a</li>
- <li>libLLVMSystem.a</li>
- <li>libLLVMTarget.a</li>
- <li>libLLVMTransformUtils.a</li>
- </ul></dd>
- <dt><b>libLLVMSupport.a</b</dt><dd><ul>
- <li>libLLVMSystem.a</li>
- <li>libLLVMbzip2.a</li>
- </ul></dd>
- <dt><b>libLLVMSystem.a</b</dt><dd><ul>
- </ul></dd>
- <dt><b>libLLVMTarget.a</b</dt><dd><ul>
- <li>libLLVMCore.a</li>
- <li>libLLVMSupport.a</li>
- <li>libLLVMSystem.a</li>
- </ul></dd>
- <dt><b>libLLVMTransformUtils.a</b</dt><dd><ul>
- <li>libLLVMAnalysis.a</li>
- <li>libLLVMCore.a</li>
- <li>libLLVMSupport.a</li>
- <li>libLLVMSystem.a</li>
- <li>libLLVMTarget.a</li>
- <li>libLLVMipa.a</li>
- </ul></dd>
- <dt><b>libLLVMbzip2.a</b</dt><dd><ul>
- </ul></dd>
- <dt><b>libLLVMipa.a</b</dt><dd><ul>
- <li>libLLVMAnalysis.a</li>
- <li>libLLVMCore.a</li>
- <li>libLLVMSupport.a</li>
- <li>libLLVMSystem.a</li>
- </ul></dd>
- <dt><b>libLLVMipo.a</b</dt><dd><ul>
- <li>libLLVMAnalysis.a</li>
- <li>libLLVMCore.a</li>
- <li>libLLVMSupport.a</li>
- <li>libLLVMSystem.a</li>
- <li>libLLVMTarget.a</li>
- <li>libLLVMTransformUtils.a</li>
- <li>libLLVMipa.a</li>
- </ul></dd>
- <dt><b>libLLVMlto.a</b</dt><dd><ul>
- <li>libLLVMAnalysis.a</li>
- <li>libLLVMBCReader.a</li>
- <li>libLLVMBCWriter.a</li>
- <li>libLLVMCore.a</li>
- <li>libLLVMLinker.a</li>
- <li>libLLVMScalarOpts.a</li>
- <li>libLLVMSupport.a</li>
- <li>libLLVMSystem.a</li>
- <li>libLLVMTarget.a</li>
- <li>libLLVMipa.a</li>
- <li>libLLVMipo.a</li>
- </ul></dd>
- <dt><b>LLVMARM.o</b</dt><dd><ul>
- <li>libLLVMCodeGen.a</li>
- <li>libLLVMCore.a</li>
- <li>libLLVMSelectionDAG.a</li>
- <li>libLLVMSupport.a</li>
- <li>libLLVMSystem.a</li>
- <li>libLLVMTarget.a</li>
- </ul></dd>
- <dt><b>LLVMAlpha.o</b</dt><dd><ul>
- <li>libLLVMCodeGen.a</li>
- <li>libLLVMCore.a</li>
- <li>libLLVMSelectionDAG.a</li>
- <li>libLLVMSupport.a</li>
- <li>libLLVMSystem.a</li>
- <li>libLLVMTarget.a</li>
- </ul></dd>
- <dt><b>LLVMCBackend.o</b</dt><dd><ul>
- <li>libLLVMAnalysis.a</li>
- <li>libLLVMCodeGen.a</li>
- <li>libLLVMCore.a</li>
- <li>libLLVMScalarOpts.a</li>
- <li>libLLVMSupport.a</li>
- <li>libLLVMSystem.a</li>
- <li>libLLVMTarget.a</li>
- <li>libLLVMTransformUtils.a</li>
- <li>libLLVMipa.a</li>
- </ul></dd>
- <dt><b>LLVMExecutionEngine.o</b</dt><dd><ul>
- <li>libLLVMCore.a</li>
- <li>libLLVMSupport.a</li>
- <li>libLLVMSystem.a</li>
- <li>libLLVMTarget.a</li>
- </ul></dd>
- <dt><b>LLVMIA64.o</b</dt><dd><ul>
- <li>libLLVMCodeGen.a</li>
- <li>libLLVMCore.a</li>
- <li>libLLVMSelectionDAG.a</li>
- <li>libLLVMSupport.a</li>
- <li>libLLVMSystem.a</li>
- <li>libLLVMTarget.a</li>
- </ul></dd>
- <dt><b>LLVMInterpreter.o</b</dt><dd><ul>
- <li>LLVMExecutionEngine.o</li>
- <li>libLLVMCodeGen.a</li>
- <li>libLLVMCore.a</li>
- <li>libLLVMSupport.a</li>
- <li>libLLVMSystem.a</li>
- <li>libLLVMTarget.a</li>
- </ul></dd>
- <dt><b>LLVMJIT.o</b</dt><dd><ul>
- <li>LLVMExecutionEngine.o</li>
- <li>libLLVMCore.a</li>
- <li>libLLVMSupport.a</li>
- <li>libLLVMSystem.a</li>
- <li>libLLVMTarget.a</li>
- </ul></dd>
- <dt><b>LLVMPowerPC.o</b</dt><dd><ul>
- <li>libLLVMCodeGen.a</li>
- <li>libLLVMCore.a</li>
- <li>libLLVMSelectionDAG.a</li>
- <li>libLLVMSupport.a</li>
- <li>libLLVMSystem.a</li>
- <li>libLLVMTarget.a</li>
- </ul></dd>
- <dt><b>LLVMSparc.o</b</dt><dd><ul>
- <li>libLLVMCodeGen.a</li>
- <li>libLLVMCore.a</li>
- <li>libLLVMSelectionDAG.a</li>
- <li>libLLVMSupport.a</li>
- <li>libLLVMSystem.a</li>
- <li>libLLVMTarget.a</li>
- </ul></dd>
- <dt><b>LLVMX86.o</b</dt><dd><ul>
- <li>libLLVMCodeGen.a</li>
- <li>libLLVMCore.a</li>
- <li>libLLVMSelectionDAG.a</li>
- <li>libLLVMSupport.a</li>
- <li>libLLVMSystem.a</li>
- <li>libLLVMTarget.a</li>
- </ul></dd>
-</dl>
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_section"><a name="rot">Linkage Rules Of Thumb</a></div>
-<div class="doc_text">
- <p>This section contains various "rules of thumb" about what files you
- should link into your programs.</p>
-</div>
-<!-- ======================================================================= -->
-<div class="doc_subsection"><a name="always">Always Link LLVMCore, LLVMSupport,
- and LLVMSystem</a></div>
-<div class="doc_text">
- <p>No matter what you do with LLVM, the last three entries in the value of
- your LLVMLIBS make variable should always be:
- <tt>LLVMCore LLVMSupport.a LLVMSystem.a</tt>. There are no <tt>LLVM</tt>
- programs that don't depend on these three.</p>
-</div>
-<!-- ======================================================================= -->
-<div class="doc_subsection"><a name="onlyone">Never link both archive and
- re-linked library</a></div>
-<div class="doc_text">
- <p>There is never any point to linking both the re-linked (<tt>.o</tt>) and
- the archive (<tt>.a</tt>) versions of a library. Since the re-linked version
- includes the entire library, the archive version will not resolve any symbols.
- You could even end up with link error if you place the archive version before
- the re-linked version on the linker's command line.</p>
-</div>
-<!-- ======================================================================= -->
-<hr>
-<div class="doc_footer">
-<address>
- <a href="http://jigsaw.w3.org/css-validator/check/referer"><img
- src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"/></a>
- <a href="http://validator.w3.org/check/referer"><img
- src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!" /></a>
- <a href="mailto:rspencer@x10sys.com">Reid Spencer</a>
-</address>
-<a href="http://llvm.org">The LLVM Compiler Infrastructure</a>
-<br>Last modified: $Date$ </div>
-</body>
-</html>
-<!-- vim: sw=2 ts=2 ai
--->
diff --git a/release_23/docs/WritingAnLLVMBackend.html b/release_23/docs/WritingAnLLVMBackend.html
deleted file mode 100644
index 909432ef453d..000000000000
--- a/release_23/docs/WritingAnLLVMBackend.html
+++ /dev/null
@@ -1,260 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
- "http://www.w3.org/TR/html4/strict.dtd">
-<html>
-<head>
- <title>Writing an LLVM backend</title>
- <link rel="stylesheet" href="llvm.css" type="text/css">
-</head>
-
-<body>
-
-<div class="doc_title">
- Writing an LLVM backend
-</div>
-
-<ol>
- <li><a href="#intro">Introduction</a>
- <li><a href="#backends">Writing a backend</a>
- <ol>
- <li><a href="#machine">Machine backends</a>
- <ol>
- <li><a href="#machineTOC">Outline</a></li>
- <li><a href="#machineDetails">Implementation details</a></li>
- </ol></li>
- <li><a href="#lang">Language backends</a></li>
- </ol></li>
- <li><a href="#related">Related reading material</a>
-</ol>
-
-<div class="doc_author">
- <p>Written by <a href="http://misha.brukman.net">Misha Brukman</a></p>
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section">
- <a name="intro">Introduction</a>
-</div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>This document describes techniques for writing backends for LLVM which
-convert the LLVM representation to machine assembly code or other languages.</p>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section">
- <a name="backends">Writing a backend</a>
-</div>
-<!-- *********************************************************************** -->
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="machine">Machine backends</a>
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="machineTOC">Outline</a>
-</div>
-
-<div class="doc_text">
-
-<p>In general, you want to follow the format of SPARC, X86 or PowerPC (in
-<tt>lib/Target</tt>). SPARC is the simplest backend, and is RISC, so if
-you're working on a RISC target, it is a good one to start with.</p>
-
-<p>To create a static compiler (one that emits text assembly), you need to
-implement the following:</p>
-
-<ul>
-<li>Describe the register set.
- <ul>
- <li>Create a <a href="TableGenFundamentals.html">TableGen</a> description of
- the register set and register classes</li>
- <li>Implement a subclass of <tt><a
- href="CodeGenerator.html#targetregisterinfo">TargetRegisterInfo</a></tt></li>
- </ul></li>
-<li>Describe the instruction set.
- <ul>
- <li>Create a <a href="TableGenFundamentals.html">TableGen</a> description of
- the instruction set</li>
- <li>Implement a subclass of <tt><a
- href="CodeGenerator.html#targetinstrinfo">TargetInstrInfo</a></tt></li>
- </ul></li>
-<li>Describe the target machine.
- <ul>
- <li>Create a <a href="TableGenFundamentals.html">TableGen</a> description of
- the target that describes the pointer size and references the instruction
- set</li>
- <li>Implement a subclass of <tt><a
- href="CodeGenerator.html#targetmachine">TargetMachine</a></tt>, which
- configures <tt><a href="CodeGenerator.html#targetdata">TargetData</a></tt>
- correctly</li>
- <li>Register your new target using the <tt>RegisterTarget</tt>
- template:<br><br>
-<div class="doc_code"><pre>
-RegisterTarget&lt;<em>MyTargetMachine</em>&gt; M("short_name", " Target name");
-</pre></div>
- <br>Here, <em>MyTargetMachine</em> is the name of your implemented
- subclass of <tt><a
- href="CodeGenerator.html#targetmachine">TargetMachine</a></tt>,
- <em>short_name</em> is the option that will be active following
- <tt>-march=</tt> to select a target in llc and lli, and the last string
- is the description of your target to appear in <tt>-help</tt>
- listing.</li>
- </ul></li>
-<li>Implement the assembly printer for the architecture.
- <ul>
- <li>Define all of the assembly strings for your target, adding them to the
- instructions in your *InstrInfo.td file.</li>
- <li>Implement the <tt>llvm::AsmPrinter</tt> interface.</li>
- </ul>
-</li>
-<li>Implement an instruction selector for the architecture.
- <ul>
- <li>The recommended method is the <a href="CodeGenerator.html#instselect">
- pattern-matching DAG-to-DAG instruction selector</a> (for example, see
- the PowerPC backend in PPCISelDAGtoDAG.cpp). Parts of instruction
- selector creation can be performed by adding patterns to the instructions
- in your <tt>.td</tt> file.</li>
- </ul>
-</li>
-<li>Optionally, add subtarget support.
-<ul>
- <li>If your target has multiple subtargets (e.g. variants with different
- capabilities), implement the <tt>llvm::TargetSubtarget</tt> interface
- for your architecture. This allows you to add <tt>-mcpu=</tt> and
- <tt>-mattr=</tt> options.</li>
-</ul>
-<li>Optionally, add JIT support.
- <ul>
- <li>Create a subclass of <tt><a
- href="CodeGenerator.html#targetjitinfo">TargetJITInfo</a></tt></li>
- <li>Create a machine code emitter that will be used to emit binary code
- directly into memory, given <tt>MachineInstr</tt>s</li>
- </ul>
-</ul>
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="machineDetails">Implementation details</a>
-</div>
-
-<div class="doc_text">
-
-<ul>
-
-<li><p><b>TableGen register info description</b> - describe a class which
-will store the register's number in the binary encoding of the instruction
-(e.g., for JIT purposes).</p>
-
-<p>You also need to define register classes to contain these registers, such as
-the integer register class and floating-point register class, so that you can
-allocate virtual registers to instructions from these sets, and let the
-target-independent register allocator automatically choose the actual
-architected registers.</p>
-
-<div class="doc_code">
-<pre>
-// class Register is defined in Target.td
-<b>class</b> <em>Target</em>Reg&lt;string name&gt; : Register&lt;name&gt; {
- <b>let</b> Namespace = "<em>Target</em>";
-}
-
-<b>class</b> IntReg&lt;<b>bits</b>&lt;5&gt; num, string name&gt; : <em>Target</em>Reg&lt;name&gt; {
- <b>field</b> <b>bits</b>&lt;5&gt; Num = num;
-}
-
-<b>def</b> R0 : IntReg&lt;0, "%R0"&gt;;
-...
-
-// class RegisterClass is defined in Target.td
-<b>def</b> IReg : RegisterClass&lt;i64, 64, [R0, ... ]&gt;;
-</pre>
-</div>
-</li>
-
-<li><p><b>TableGen instruction info description</b> - break up instructions into
-classes, usually that's already done by the manufacturer (see instruction
-manual). Define a class for each instruction category. Define each opcode as a
-subclass of the category, with appropriate parameters such as the fixed binary
-encoding of opcodes and extended opcodes, and map the register bits to the bits
-of the instruction which they are encoded in (for the JIT). Also specify how
-the instruction should be printed so it can use the automatic assembly printer,
-e.g.:</p>
-
-<div class="doc_code">
-<pre>
-// class Instruction is defined in Target.td
-<b>class</b> Form&lt;<b>bits</b>&lt;6&gt; opcode, <b>dag</b> OL, <b>string</b> asmstr&gt; : Instruction {
- <b>field</b> <b>bits</b>&lt;42&gt; Inst;
-
- <b>let</b> Namespace = "<em>Target</em>";
- <b>let</b> Inst{0-6} = opcode;
- <b>let</b> OperandList = OL;
- <b>let</b> AsmString = asmstr;
-}
-
-<b>def</b> ADD : Form&lt;42, (ops IReg:$rD, IReg:$rA, IReg:$rB), "add $rD, $rA, $rB"&gt;;
-</pre>
-</div>
-</li>
-
-</ul>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="lang">Language backends</a>
-</div>
-
-<div class="doc_text">
-
-<p>For now, just take a look at <tt>lib/Target/CBackend</tt> for an example of
-how the C backend is written.</p>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section">
- <a name="related">Related reading material</a>
-</div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<ul>
-<li><a href="CodeGenerator.html">Code generator</a> -
- describes some of the classes in code generation at a high level, but
- it is not (yet) complete</li>
-<li><a href="TableGenFundamentals.html">TableGen fundamentals</a> -
- describes how to use TableGen to describe your target information
- succinctly</li>
-<li><a href="HowToSubmitABug.html#codegen">Debugging code generation with
- bugpoint</a> - shows bugpoint usage scenarios to simplify backend
- development</li>
-</ul>
-
-</div>
-
-<!-- *********************************************************************** -->
-
-<hr>
-<address>
- <a href="http://jigsaw.w3.org/css-validator/check/referer"><img
- src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"></a>
- <a href="http://validator.w3.org/check/referer"><img
- src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!" /></a>
-
- <a href="http://misha.brukman.net">Misha Brukman</a><br>
- <a href="http://llvm.org">The LLVM Compiler Infrastructure</a>
- <br>
- Last modified: $Date$
-</address>
-
-</body>
-</html>
diff --git a/release_23/docs/WritingAnLLVMPass.html b/release_23/docs/WritingAnLLVMPass.html
deleted file mode 100644
index 07e736da691e..000000000000
--- a/release_23/docs/WritingAnLLVMPass.html
+++ /dev/null
@@ -1,1825 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
- "http://www.w3.org/TR/html4/strict.dtd">
-<html>
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <title>Writing an LLVM Pass</title>
- <link rel="stylesheet" href="llvm.css" type="text/css">
-</head>
-<body>
-
-<div class="doc_title">
- Writing an LLVM Pass
-</div>
-
-<ol>
- <li><a href="#introduction">Introduction - What is a pass?</a></li>
- <li><a href="#quickstart">Quick Start - Writing hello world</a>
- <ul>
- <li><a href="#makefile">Setting up the build environment</a></li>
- <li><a href="#basiccode">Basic code required</a></li>
- <li><a href="#running">Running a pass with <tt>opt</tt></a></li>
- </ul></li>
- <li><a href="#passtype">Pass classes and requirements</a>
- <ul>
- <li><a href="#ImmutablePass">The <tt>ImmutablePass</tt> class</a></li>
- <li><a href="#ModulePass">The <tt>ModulePass</tt> class</a>
- <ul>
- <li><a href="#runOnModule">The <tt>runOnModule</tt> method</a></li>
- </ul></li>
- <li><a href="#CallGraphSCCPass">The <tt>CallGraphSCCPass</tt> class</a>
- <ul>
- <li><a href="#doInitialization_scc">The <tt>doInitialization(CallGraph
- &amp;)</tt> method</a></li>
- <li><a href="#runOnSCC">The <tt>runOnSCC</tt> method</a></li>
- <li><a href="#doFinalization_scc">The <tt>doFinalization(CallGraph
- &amp;)</tt> method</a></li>
- </ul></li>
- <li><a href="#FunctionPass">The <tt>FunctionPass</tt> class</a>
- <ul>
- <li><a href="#doInitialization_mod">The <tt>doInitialization(Module
- &amp;)</tt> method</a></li>
- <li><a href="#runOnFunction">The <tt>runOnFunction</tt> method</a></li>
- <li><a href="#doFinalization_mod">The <tt>doFinalization(Module
- &amp;)</tt> method</a></li>
- </ul></li>
- <li><a href="#LoopPass">The <tt>LoopPass</tt> class</a>
- <ul>
- <li><a href="#doInitialization_loop">The <tt>doInitialization(Loop *,
- LPPassManager &amp;)</tt> method</a></li>
- <li><a href="#runOnLoop">The <tt>runOnLoop</tt> method</a></li>
- <li><a href="#doFinalization_loop">The <tt>doFinalization()
- </tt> method</a></li>
- </ul></li>
- <li><a href="#BasicBlockPass">The <tt>BasicBlockPass</tt> class</a>
- <ul>
- <li><a href="#doInitialization_fn">The <tt>doInitialization(Function
- &amp;)</tt> method</a></li>
- <li><a href="#runOnBasicBlock">The <tt>runOnBasicBlock</tt>
- method</a></li>
- <li><a href="#doFinalization_fn">The <tt>doFinalization(Function
- &amp;)</tt> method</a></li>
- </ul></li>
- <li><a href="#MachineFunctionPass">The <tt>MachineFunctionPass</tt>
- class</a>
- <ul>
- <li><a href="#runOnMachineFunction">The
- <tt>runOnMachineFunction(MachineFunction &amp;)</tt> method</a></li>
- </ul></li>
- </ul>
- <li><a href="#registration">Pass Registration</a>
- <ul>
- <li><a href="#print">The <tt>print</tt> method</a></li>
- </ul></li>
- <li><a href="#interaction">Specifying interactions between passes</a>
- <ul>
- <li><a href="#getAnalysisUsage">The <tt>getAnalysisUsage</tt>
- method</a></li>
- <li><a href="#AU::addRequired">The <tt>AnalysisUsage::addRequired&lt;&gt;</tt> and <tt>AnalysisUsage::addRequiredTransitive&lt;&gt;</tt> methods</a></li>
- <li><a href="#AU::addPreserved">The <tt>AnalysisUsage::addPreserved&lt;&gt;</tt> method</a></li>
- <li><a href="#AU::examples">Example implementations of <tt>getAnalysisUsage</tt></a></li>
- <li><a href="#getAnalysis">The <tt>getAnalysis&lt;&gt;</tt> and <tt>getAnalysisToUpdate&lt;&gt;</tt> methods</a></li>
- </ul></li>
- <li><a href="#analysisgroup">Implementing Analysis Groups</a>
- <ul>
- <li><a href="#agconcepts">Analysis Group Concepts</a></li>
- <li><a href="#registerag">Using <tt>RegisterAnalysisGroup</tt></a></li>
- </ul></li>
- <li><a href="#passStatistics">Pass Statistics</a>
- <li><a href="#passmanager">What PassManager does</a>
- <ul>
- <li><a href="#releaseMemory">The <tt>releaseMemory</tt> method</a></li>
- </ul></li>
- <li><a href="#registering">Registering dynamically loaded passes</a>
- <ul>
- <li><a href="#registering_existing">Using existing registries</a></li>
- <li><a href="#registering_new">Creating new registries</a></li>
- </ul></li>
- <li><a href="#debughints">Using GDB with dynamically loaded passes</a>
- <ul>
- <li><a href="#breakpoint">Setting a breakpoint in your pass</a></li>
- <li><a href="#debugmisc">Miscellaneous Problems</a></li>
- </ul></li>
- <li><a href="#future">Future extensions planned</a>
- <ul>
- <li><a href="#SMP">Multithreaded LLVM</a></li>
- </ul></li>
-</ol>
-
-<div class="doc_author">
- <p>Written by <a href="mailto:sabre@nondot.org">Chris Lattner</a> and
- <a href="mailto:jlaskey@mac.com">Jim Laskey</a></p>
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section">
- <a name="introduction">Introduction - What is a pass?</a>
-</div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>The LLVM Pass Framework is an important part of the LLVM system, because LLVM
-passes are where most of the interesting parts of the compiler exist. Passes
-perform the transformations and optimizations that make up the compiler, they
-build the analysis results that are used by these transformations, and they are,
-above all, a structuring technique for compiler code.</p>
-
-<p>All LLVM passes are subclasses of the <tt><a
-href="http://llvm.org/doxygen/classllvm_1_1Pass.html">Pass</a></tt>
-class, which implement functionality by overriding virtual methods inherited
-from <tt>Pass</tt>. Depending on how your pass works, you should inherit from
-the <tt><a href="#ModulePass">ModulePass</a></tt>, <tt><a
-href="#CallGraphSCCPass">CallGraphSCCPass</a></tt>, <tt><a
-href="#FunctionPass">FunctionPass</a></tt>, or <tt><a
-href="#LoopPass">LoopPass</a></tt>, or <tt><a
-href="#BasicBlockPass">BasicBlockPass</a></tt> classes, which gives the system
-more information about what your pass does, and how it can be combined with
-other passes. One of the main features of the LLVM Pass Framework is that it
-schedules passes to run in an efficient way based on the constraints that your
-pass meets (which are indicated by which class they derive from).</p>
-
-<p>We start by showing you how to construct a pass, everything from setting up
-the code, to compiling, loading, and executing it. After the basics are down,
-more advanced features are discussed.</p>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section">
- <a name="quickstart">Quick Start - Writing hello world</a>
-</div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>Here we describe how to write the "hello world" of passes. The "Hello" pass
-is designed to simply print out the name of non-external functions that exist in
-the program being compiled. It does not modify the program at all, it just
-inspects it. The source code and files for this pass are available in the LLVM
-source tree in the <tt>lib/Transforms/Hello</tt> directory.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="makefile">Setting up the build environment</a>
-</div>
-
-<div class="doc_text">
-
- <p>First, you need to create a new directory somewhere in the LLVM source
- base. For this example, we'll assume that you made
- <tt>lib/Transforms/Hello</tt>. Next, you must set up a build script
- (Makefile) that will compile the source code for the new pass. To do this,
- copy the following into <tt>Makefile</tt>:</p>
- <hr/>
-
-<div class="doc_code"><pre>
-# Makefile for hello pass
-
-# Path to top level of LLVM heirarchy
-LEVEL = ../../..
-
-# Name of the library to build
-LIBRARYNAME = Hello
-
-# Make the shared library become a loadable module so the tools can
-# dlopen/dlsym on the resulting library.
-LOADABLE_MODULE = 1
-
-# Tell the build system which LLVM libraries your pass needs. You'll probably
-# need at least LLVMSystem.a, LLVMSupport.a, LLVMCore.a but possibly several
-# others too.
-LLVMLIBS = LLVMCore.a LLVMSupport.a LLVMSystem.a
-
-# Include the makefile implementation stuff
-include $(LEVEL)/Makefile.common
-</pre></div>
-
-<p>This makefile specifies that all of the <tt>.cpp</tt> files in the current
-directory are to be compiled and linked together into a
-<tt>Debug/lib/Hello.so</tt> shared object that can be dynamically loaded by
-the <tt>opt</tt> or <tt>bugpoint</tt> tools via their <tt>-load</tt> options.
-If your operating system uses a suffix other than .so (such as windows or
-Mac OS/X), the appropriate extension will be used.</p>
-
-<p>Now that we have the build scripts set up, we just need to write the code for
-the pass itself.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="basiccode">Basic code required</a>
-</div>
-
-<div class="doc_text">
-
-<p>Now that we have a way to compile our new pass, we just have to write it.
-Start out with:</p>
-
-<div class="doc_code"><pre>
-<b>#include</b> "<a href="http://llvm.org/doxygen/Pass_8h-source.html">llvm/Pass.h</a>"
-<b>#include</b> "<a href="http://llvm.org/doxygen/Function_8h-source.html">llvm/Function.h</a>"
-</pre></div>
-
-<p>Which are needed because we are writing a <tt><a
-href="http://llvm.org/doxygen/classllvm_1_1Pass.html">Pass</a></tt>, and
-we are operating on <tt><a
-href="http://llvm.org/doxygen/classllvm_1_1Function.html">Function</a></tt>'s.</p>
-
-<p>Next we have:</p>
-<div class="doc_code"><pre>
-<b>using namespace llvm;</b>
-</pre></div>
-<p>... which is required because the functions from the include files
-live in the llvm namespace.
-</p>
-
-<p>Next we have:</p>
-
-<div class="doc_code"><pre>
-<b>namespace</b> {
-</pre></div>
-
-<p>... which starts out an anonymous namespace. Anonymous namespaces are to C++
-what the "<tt>static</tt>" keyword is to C (at global scope). It makes the
-things declared inside of the anonymous namespace only visible to the current
-file. If you're not familiar with them, consult a decent C++ book for more
-information.</p>
-
-<p>Next, we declare our pass itself:</p>
-
-<div class="doc_code"><pre>
- <b>struct</b> Hello : <b>public</b> <a href="#FunctionPass">FunctionPass</a> {
-</pre></div><p>
-
-<p>This declares a "<tt>Hello</tt>" class that is a subclass of <tt><a
-href="http://llvm.org/doxygen/classllvm_1_1FunctionPass.html">FunctionPass</a></tt>.
-The different builtin pass subclasses are described in detail <a
-href="#passtype">later</a>, but for now, know that <a
-href="#FunctionPass"><tt>FunctionPass</tt></a>'s operate a function at a
-time.</p>
-
-<div class="doc_code"><pre>
- static char ID;
- Hello() : FunctionPass((intptr_t)&amp;ID) {}
-</pre></div><p>
-
-<p> This declares pass identifier used by LLVM to identify pass. This allows LLVM to
-avoid using expensive C++ runtime information.</p>
-
-<div class="doc_code"><pre>
- <b>virtual bool</b> <a href="#runOnFunction">runOnFunction</a>(Function &amp;F) {
- llvm::cerr &lt;&lt; "<i>Hello: </i>" &lt;&lt; F.getName() &lt;&lt; "\n";
- <b>return false</b>;
- }
- }; <i>// end of struct Hello</i>
-</pre></div>
-
-<p>We declare a "<a href="#runOnFunction"><tt>runOnFunction</tt></a>" method,
-which overloads an abstract virtual method inherited from <a
-href="#FunctionPass"><tt>FunctionPass</tt></a>. This is where we are supposed
-to do our thing, so we just print out our message with the name of each
-function.</p>
-
-<div class="doc_code"><pre>
- char Hello::ID = 0;
-</pre></div>
-
-<p> We initialize pass ID here. LLVM uses ID's address to identify pass so
-initialization value is not important.</p>
-
-<div class="doc_code"><pre>
- RegisterPass&lt;Hello&gt; X("<i>hello</i>", "<i>Hello World Pass</i>",
- false /* Only looks at CFG */,
- false /* Analysis Pass */);
-} <i>// end of anonymous namespace</i>
-</pre></div>
-
-<p>Lastly, we <a href="#registration">register our class</a> <tt>Hello</tt>,
-giving it a command line
-argument "<tt>hello</tt>", and a name "<tt>Hello World Pass</tt>".
-Last two RegisterPass arguments are optional. Their default value is false.
-If a pass walks CFG without modifying it then third argument is set to true.
-If a pass is an analysis pass, for example dominator tree pass, then true
-is supplied as fourth argument. </p>
-
-<p>As a whole, the <tt>.cpp</tt> file looks like:</p>
-
-<div class="doc_code"><pre>
-<b>#include</b> "<a href="http://llvm.org/doxygen/Pass_8h-source.html">llvm/Pass.h</a>"
-<b>#include</b> "<a href="http://llvm.org/doxygen/Function_8h-source.html">llvm/Function.h</a>"
-
-<b>using namespace llvm;</b>
-
-<b>namespace</b> {
- <b>struct Hello</b> : <b>public</b> <a href="#FunctionPass">FunctionPass</a> {
-
- static char ID;
- Hello() : FunctionPass((intptr_t)&amp;ID) {}
-
- <b>virtual bool</b> <a href="#runOnFunction">runOnFunction</a>(Function &amp;F) {
- llvm::cerr &lt;&lt; "<i>Hello: </i>" &lt;&lt; F.getName() &lt;&lt; "\n";
- <b>return false</b>;
- }
- };
-
- char Hello::ID = 0;
- RegisterPass&lt;Hello&gt; X("<i>hello</i>", "<i>Hello World Pass</i>");
-}
-</pre></div>
-
-<p>Now that it's all together, compile the file with a simple "<tt>gmake</tt>"
-command in the local directory and you should get a new
-"<tt>Debug/lib/Hello.so</tt> file. Note that everything in this file is
-contained in an anonymous namespace: this reflects the fact that passes are self
-contained units that do not need external interfaces (although they can have
-them) to be useful.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="running">Running a pass with <tt>opt</tt></a>
-</div>
-
-<div class="doc_text">
-
-<p>Now that you have a brand new shiny shared object file, we can use the
-<tt>opt</tt> command to run an LLVM program through your pass. Because you
-registered your pass with the <tt>RegisterPass</tt> template, you will be able to
-use the <tt>opt</tt> tool to access it, once loaded.</p>
-
-<p>To test it, follow the example at the end of the <a
-href="GettingStarted.html">Getting Started Guide</a> to compile "Hello World" to
-LLVM. We can now run the bitcode file (<tt>hello.bc</tt>) for the program
-through our transformation like this (or course, any bitcode file will
-work):</p>
-
-<div class="doc_code"><pre>
-$ opt -load ../../../Debug/lib/Hello.so -hello &lt; hello.bc &gt; /dev/null
-Hello: __main
-Hello: puts
-Hello: main
-</pre></div>
-
-<p>The '<tt>-load</tt>' option specifies that '<tt>opt</tt>' should load your
-pass as a shared object, which makes '<tt>-hello</tt>' a valid command line
-argument (which is one reason you need to <a href="#registration">register your
-pass</a>). Because the hello pass does not modify the program in any
-interesting way, we just throw away the result of <tt>opt</tt> (sending it to
-<tt>/dev/null</tt>).</p>
-
-<p>To see what happened to the other string you registered, try running
-<tt>opt</tt> with the <tt>--help</tt> option:</p>
-
-<div class="doc_code"><pre>
-$ opt -load ../../../Debug/lib/Hello.so --help
-OVERVIEW: llvm .bc -&gt; .bc modular optimizer
-
-USAGE: opt [options] &lt;input bitcode&gt;
-
-OPTIONS:
- Optimizations available:
-...
- -funcresolve - Resolve Functions
- -gcse - Global Common Subexpression Elimination
- -globaldce - Dead Global Elimination
- <b>-hello - Hello World Pass</b>
- -indvars - Canonicalize Induction Variables
- -inline - Function Integration/Inlining
- -instcombine - Combine redundant instructions
-...
-</pre></div>
-
-<p>The pass name get added as the information string for your pass, giving some
-documentation to users of <tt>opt</tt>. Now that you have a working pass, you
-would go ahead and make it do the cool transformations you want. Once you get
-it all working and tested, it may become useful to find out how fast your pass
-is. The <a href="#passManager"><tt>PassManager</tt></a> provides a nice command
-line option (<tt>--time-passes</tt>) that allows you to get information about
-the execution time of your pass along with the other passes you queue up. For
-example:</p>
-
-<div class="doc_code"><pre>
-$ opt -load ../../../Debug/lib/Hello.so -hello -time-passes &lt; hello.bc &gt; /dev/null
-Hello: __main
-Hello: puts
-Hello: main
-===============================================================================
- ... Pass execution timing report ...
-===============================================================================
- Total Execution Time: 0.02 seconds (0.0479059 wall clock)
-
- ---User Time--- --System Time-- --User+System-- ---Wall Time--- --- Pass Name ---
- 0.0100 (100.0%) 0.0000 ( 0.0%) 0.0100 ( 50.0%) 0.0402 ( 84.0%) Bitcode Writer
- 0.0000 ( 0.0%) 0.0100 (100.0%) 0.0100 ( 50.0%) 0.0031 ( 6.4%) Dominator Set Construction
- 0.0000 ( 0.0%) 0.0000 ( 0.0%) 0.0000 ( 0.0%) 0.0013 ( 2.7%) Module Verifier
- <b> 0.0000 ( 0.0%) 0.0000 ( 0.0%) 0.0000 ( 0.0%) 0.0033 ( 6.9%) Hello World Pass</b>
- 0.0100 (100.0%) 0.0100 (100.0%) 0.0200 (100.0%) 0.0479 (100.0%) TOTAL
-</pre></div>
-
-<p>As you can see, our implementation above is pretty fast :). The additional
-passes listed are automatically inserted by the '<tt>opt</tt>' tool to verify
-that the LLVM emitted by your pass is still valid and well formed LLVM, which
-hasn't been broken somehow.</p>
-
-<p>Now that you have seen the basics of the mechanics behind passes, we can talk
-about some more details of how they work and how to use them.</p>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section">
- <a name="passtype">Pass classes and requirements</a>
-</div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>One of the first things that you should do when designing a new pass is to
-decide what class you should subclass for your pass. The <a
-href="#basiccode">Hello World</a> example uses the <tt><a
-href="#FunctionPass">FunctionPass</a></tt> class for its implementation, but we
-did not discuss why or when this should occur. Here we talk about the classes
-available, from the most general to the most specific.</p>
-
-<p>When choosing a superclass for your Pass, you should choose the <b>most
-specific</b> class possible, while still being able to meet the requirements
-listed. This gives the LLVM Pass Infrastructure information necessary to
-optimize how passes are run, so that the resultant compiler isn't unneccesarily
-slow.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="ImmutablePass">The <tt>ImmutablePass</tt> class</a>
-</div>
-
-<div class="doc_text">
-
-<p>The most plain and boring type of pass is the "<tt><a
-href="http://llvm.org/doxygen/classllvm_1_1ImmutablePass.html">ImmutablePass</a></tt>"
-class. This pass type is used for passes that do not have to be run, do not
-change state, and never need to be updated. This is not a normal type of
-transformation or analysis, but can provide information about the current
-compiler configuration.</p>
-
-<p>Although this pass class is very infrequently used, it is important for
-providing information about the current target machine being compiled for, and
-other static information that can affect the various transformations.</p>
-
-<p><tt>ImmutablePass</tt>es never invalidate other transformations, are never
-invalidated, and are never "run".</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="ModulePass">The <tt>ModulePass</tt> class</a>
-</div>
-
-<div class="doc_text">
-
-<p>The "<tt><a
-href="http://llvm.org/doxygen/classllvm_1_1ModulePass.html">ModulePass</a></tt>"
-class is the most general of all superclasses that you can use. Deriving from
-<tt>ModulePass</tt> indicates that your pass uses the entire program as a unit,
-refering to function bodies in no predictable order, or adding and removing
-functions. Because nothing is known about the behavior of <tt>ModulePass</tt>
-subclasses, no optimization can be done for their execution. A module pass
-can use function level passes (e.g. dominators) using getAnalysis interface
-<tt> getAnalysis&lt;DominatorTree&gt;(Function)</tt>. </p>
-
-<p>To write a correct <tt>ModulePass</tt> subclass, derive from
-<tt>ModulePass</tt> and overload the <tt>runOnModule</tt> method with the
-following signature:</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="runOnModule">The <tt>runOnModule</tt> method</a>
-</div>
-
-<div class="doc_text">
-
-<div class="doc_code"><pre>
- <b>virtual bool</b> runOnModule(Module &amp;M) = 0;
-</pre></div>
-
-<p>The <tt>runOnModule</tt> method performs the interesting work of the pass.
-It should return true if the module was modified by the transformation and
-false otherwise.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="CallGraphSCCPass">The <tt>CallGraphSCCPass</tt> class</a>
-</div>
-
-<div class="doc_text">
-
-<p>The "<tt><a
-href="http://llvm.org/doxygen/classllvm_1_1CallGraphSCCPass.html">CallGraphSCCPass</a></tt>"
-is used by passes that need to traverse the program bottom-up on the call graph
-(callees before callers). Deriving from CallGraphSCCPass provides some
-mechanics for building and traversing the CallGraph, but also allows the system
-to optimize execution of CallGraphSCCPass's. If your pass meets the
-requirements outlined below, and doesn't meet the requirements of a <tt><a
-href="#FunctionPass">FunctionPass</a></tt> or <tt><a
-href="#BasicBlockPass">BasicBlockPass</a></tt>, you should derive from
-<tt>CallGraphSCCPass</tt>.</p>
-
-<p><b>TODO</b>: explain briefly what SCC, Tarjan's algo, and B-U mean.</p>
-
-<p>To be explicit, <tt>CallGraphSCCPass</tt> subclasses are:</p>
-
-<ol>
-
-<li>... <em>not allowed</em> to modify any <tt>Function</tt>s that are not in
-the current SCC.</li>
-
-<li>... <em>not allowed</em> to inspect any Function's other than those in the
-current SCC and the direct callees of the SCC.</li>
-
-<li>... <em>required</em> to preserve the current CallGraph object, updating it
-to reflect any changes made to the program.</li>
-
-<li>... <em>not allowed</em> to add or remove SCC's from the current Module,
-though they may change the contents of an SCC.</li>
-
-<li>... <em>allowed</em> to add or remove global variables from the current
-Module.</li>
-
-<li>... <em>allowed</em> to maintain state across invocations of
- <a href="#runOnSCC"><tt>runOnSCC</tt></a> (including global data).</li>
-</ol>
-
-<p>Implementing a <tt>CallGraphSCCPass</tt> is slightly tricky in some cases
-because it has to handle SCCs with more than one node in it. All of the virtual
-methods described below should return true if they modified the program, or
-false if they didn't.</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="doInitialization_scc">The <tt>doInitialization(CallGraph &amp;)</tt>
- method</a>
-</div>
-
-<div class="doc_text">
-
-<div class="doc_code"><pre>
- <b>virtual bool</b> doInitialization(CallGraph &amp;CG);
-</pre></div>
-
-<p>The <tt>doIninitialize</tt> method is allowed to do most of the things that
-<tt>CallGraphSCCPass</tt>'s are not allowed to do. They can add and remove
-functions, get pointers to functions, etc. The <tt>doInitialization</tt> method
-is designed to do simple initialization type of stuff that does not depend on
-the SCCs being processed. The <tt>doInitialization</tt> method call is not
-scheduled to overlap with any other pass executions (thus it should be very
-fast).</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="runOnSCC">The <tt>runOnSCC</tt> method</a>
-</div>
-
-<div class="doc_text">
-
-<div class="doc_code"><pre>
- <b>virtual bool</b> runOnSCC(const std::vector&lt;CallGraphNode *&gt; &amp;SCCM) = 0;
-</pre></div>
-
-<p>The <tt>runOnSCC</tt> method performs the interesting work of the pass, and
-should return true if the module was modified by the transformation, false
-otherwise.</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="doFinalization_scc">The <tt>doFinalization(CallGraph
- &amp;)</tt> method</a>
-</div>
-
-<div class="doc_text">
-
-<div class="doc_code"><pre>
- <b>virtual bool</b> doFinalization(CallGraph &amp;CG);
-</pre></div>
-
-<p>The <tt>doFinalization</tt> method is an infrequently used method that is
-called when the pass framework has finished calling <a
-href="#runOnFunction"><tt>runOnFunction</tt></a> for every function in the
-program being compiled.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="FunctionPass">The <tt>FunctionPass</tt> class</a>
-</div>
-
-<div class="doc_text">
-
-<p>In contrast to <tt>ModulePass</tt> subclasses, <tt><a
-href="http://llvm.org/doxygen/classllvm_1_1Pass.html">FunctionPass</a></tt>
-subclasses do have a predictable, local behavior that can be expected by the
-system. All <tt>FunctionPass</tt> execute on each function in the program
-independent of all of the other functions in the program.
-<tt>FunctionPass</tt>'s do not require that they are executed in a particular
-order, and <tt>FunctionPass</tt>'s do not modify external functions.</p>
-
-<p>To be explicit, <tt>FunctionPass</tt> subclasses are not allowed to:</p>
-
-<ol>
-<li>Modify a Function other than the one currently being processed.</li>
-<li>Add or remove Function's from the current Module.</li>
-<li>Add or remove global variables from the current Module.</li>
-<li>Maintain state across invocations of
- <a href="#runOnFunction"><tt>runOnFunction</tt></a> (including global data)</li>
-</ol>
-
-<p>Implementing a <tt>FunctionPass</tt> is usually straightforward (See the <a
-href="#basiccode">Hello World</a> pass for example). <tt>FunctionPass</tt>'s
-may overload three virtual methods to do their work. All of these methods
-should return true if they modified the program, or false if they didn't.</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="doInitialization_mod">The <tt>doInitialization(Module &amp;)</tt>
- method</a>
-</div>
-
-<div class="doc_text">
-
-<div class="doc_code"><pre>
- <b>virtual bool</b> doInitialization(Module &amp;M);
-</pre></div>
-
-<p>The <tt>doIninitialize</tt> method is allowed to do most of the things that
-<tt>FunctionPass</tt>'s are not allowed to do. They can add and remove
-functions, get pointers to functions, etc. The <tt>doInitialization</tt> method
-is designed to do simple initialization type of stuff that does not depend on
-the functions being processed. The <tt>doInitialization</tt> method call is not
-scheduled to overlap with any other pass executions (thus it should be very
-fast).</p>
-
-<p>A good example of how this method should be used is the <a
-href="http://llvm.org/doxygen/LowerAllocations_8cpp-source.html">LowerAllocations</a>
-pass. This pass converts <tt>malloc</tt> and <tt>free</tt> instructions into
-platform dependent <tt>malloc()</tt> and <tt>free()</tt> function calls. It
-uses the <tt>doInitialization</tt> method to get a reference to the malloc and
-free functions that it needs, adding prototypes to the module if necessary.</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="runOnFunction">The <tt>runOnFunction</tt> method</a>
-</div>
-
-<div class="doc_text">
-
-<div class="doc_code"><pre>
- <b>virtual bool</b> runOnFunction(Function &amp;F) = 0;
-</pre></div><p>
-
-<p>The <tt>runOnFunction</tt> method must be implemented by your subclass to do
-the transformation or analysis work of your pass. As usual, a true value should
-be returned if the function is modified.</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="doFinalization_mod">The <tt>doFinalization(Module
- &amp;)</tt> method</a>
-</div>
-
-<div class="doc_text">
-
-<div class="doc_code"><pre>
- <b>virtual bool</b> doFinalization(Module &amp;M);
-</pre></div>
-
-<p>The <tt>doFinalization</tt> method is an infrequently used method that is
-called when the pass framework has finished calling <a
-href="#runOnFunction"><tt>runOnFunction</tt></a> for every function in the
-program being compiled.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="LoopPass">The <tt>LoopPass</tt> class </a>
-</div>
-
-<div class="doc_text">
-
-<p> All <tt>LoopPass</tt> execute on each loop in the function independent of
-all of the other loops in the function. <tt>LoopPass</tt> processes loops in
-loop nest order such that outer most loop is processed last. </p>
-
-<p> <tt>LoopPass</tt> subclasses are allowed to update loop nest using
-<tt>LPPassManager</tt> interface. Implementing a loop pass is usually
-straightforward. <tt>Looppass</tt>'s may overload three virtual methods to
-do their work. All these methods should return true if they modified the
-program, or false if they didn't. </p>
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="doInitialization_loop">The <tt>doInitialization(Loop *,
- LPPassManager &amp;)</tt>
- method</a>
-</div>
-
-<div class="doc_text">
-
-<div class="doc_code"><pre>
- <b>virtual bool</b> doInitialization(Loop *, LPPassManager &amp;LPM);
-</pre></div>
-
-<p>The <tt>doInitialization</tt> method is designed to do simple initialization
-type of stuff that does not depend on the functions being processed. The
-<tt>doInitialization</tt> method call is not scheduled to overlap with any
-other pass executions (thus it should be very fast). LPPassManager
-interface should be used to access Function or Module level analysis
-information.</p>
-
-</div>
-
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="runOnLoop">The <tt>runOnLoop</tt> method</a>
-</div>
-
-<div class="doc_text">
-
-<div class="doc_code"><pre>
- <b>virtual bool</b> runOnLoop(Loop *, LPPassManager &amp;LPM) = 0;
-</pre></div><p>
-
-<p>The <tt>runOnLoop</tt> method must be implemented by your subclass to do
-the transformation or analysis work of your pass. As usual, a true value should
-be returned if the function is modified. <tt>LPPassManager</tt> interface
-should be used to update loop nest.</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="doFinalization_loop">The <tt>doFinalization()</tt> method</a>
-</div>
-
-<div class="doc_text">
-
-<div class="doc_code"><pre>
- <b>virtual bool</b> doFinalization();
-</pre></div>
-
-<p>The <tt>doFinalization</tt> method is an infrequently used method that is
-called when the pass framework has finished calling <a
-href="#runOnLoop"><tt>runOnLoop</tt></a> for every loop in the
-program being compiled. </p>
-
-</div>
-
-
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="BasicBlockPass">The <tt>BasicBlockPass</tt> class</a>
-</div>
-
-<div class="doc_text">
-
-<p><tt>BasicBlockPass</tt>'s are just like <a
-href="#FunctionPass"><tt>FunctionPass</tt></a>'s, except that they must limit
-their scope of inspection and modification to a single basic block at a time.
-As such, they are <b>not</b> allowed to do any of the following:</p>
-
-<ol>
-<li>Modify or inspect any basic blocks outside of the current one</li>
-<li>Maintain state across invocations of
- <a href="#runOnBasicBlock"><tt>runOnBasicBlock</tt></a></li>
-<li>Modify the control flow graph (by altering terminator instructions)</li>
-<li>Any of the things forbidden for
- <a href="#FunctionPass"><tt>FunctionPass</tt></a>es.</li>
-</ol>
-
-<p><tt>BasicBlockPass</tt>es are useful for traditional local and "peephole"
-optimizations. They may override the same <a
-href="#doInitialization_mod"><tt>doInitialization(Module &amp;)</tt></a> and <a
-href="#doFinalization_mod"><tt>doFinalization(Module &amp;)</tt></a> methods that <a
-href="#FunctionPass"><tt>FunctionPass</tt></a>'s have, but also have the following virtual methods that may also be implemented:</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="doInitialization_fn">The <tt>doInitialization(Function
- &amp;)</tt> method</a>
-</div>
-
-<div class="doc_text">
-
-<div class="doc_code"><pre>
- <b>virtual bool</b> doInitialization(Function &amp;F);
-</pre></div>
-
-<p>The <tt>doIninitialize</tt> method is allowed to do most of the things that
-<tt>BasicBlockPass</tt>'s are not allowed to do, but that
-<tt>FunctionPass</tt>'s can. The <tt>doInitialization</tt> method is designed
-to do simple initialization that does not depend on the
-BasicBlocks being processed. The <tt>doInitialization</tt> method call is not
-scheduled to overlap with any other pass executions (thus it should be very
-fast).</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="runOnBasicBlock">The <tt>runOnBasicBlock</tt> method</a>
-</div>
-
-<div class="doc_text">
-
-<div class="doc_code"><pre>
- <b>virtual bool</b> runOnBasicBlock(BasicBlock &amp;BB) = 0;
-</pre></div>
-
-<p>Override this function to do the work of the <tt>BasicBlockPass</tt>. This
-function is not allowed to inspect or modify basic blocks other than the
-parameter, and are not allowed to modify the CFG. A true value must be returned
-if the basic block is modified.</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="doFinalization_fn">The <tt>doFinalization(Function &amp;)</tt>
- method</a>
-</div>
-
-<div class="doc_text">
-
-<div class="doc_code"><pre>
- <b>virtual bool</b> doFinalization(Function &amp;F);
-</pre></div>
-
-<p>The <tt>doFinalization</tt> method is an infrequently used method that is
-called when the pass framework has finished calling <a
-href="#runOnBasicBlock"><tt>runOnBasicBlock</tt></a> for every BasicBlock in the
-program being compiled. This can be used to perform per-function
-finalization.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsection">
- <a name="MachineFunctionPass">The <tt>MachineFunctionPass</tt> class</a>
-</div>
-
-<div class="doc_text">
-
-<p>A <tt>MachineFunctionPass</tt> is a part of the LLVM code generator that
-executes on the machine-dependent representation of each LLVM function in the
-program. A <tt>MachineFunctionPass</tt> is also a <tt>FunctionPass</tt>, so all
-the restrictions that apply to a <tt>FunctionPass</tt> also apply to it.
-<tt>MachineFunctionPass</tt>es also have additional restrictions. In particular,
-<tt>MachineFunctionPass</tt>es are not allowed to do any of the following:</p>
-
-<ol>
-<li>Modify any LLVM Instructions, BasicBlocks or Functions.</li>
-<li>Modify a MachineFunction other than the one currently being processed.</li>
-<li>Add or remove MachineFunctions from the current Module.</li>
-<li>Add or remove global variables from the current Module.</li>
-<li>Maintain state across invocations of <a
-href="#runOnMachineFunction"><tt>runOnMachineFunction</tt></a> (including global
-data)</li>
-</ol>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="runOnMachineFunction">The <tt>runOnMachineFunction(MachineFunction
- &amp;MF)</tt> method</a>
-</div>
-
-<div class="doc_text">
-
-<div class="doc_code"><pre>
- <b>virtual bool</b> runOnMachineFunction(MachineFunction &amp;MF) = 0;
-</pre></div>
-
-<p><tt>runOnMachineFunction</tt> can be considered the main entry point of a
-<tt>MachineFunctionPass</tt>; that is, you should override this method to do the
-work of your <tt>MachineFunctionPass</tt>.</p>
-
-<p>The <tt>runOnMachineFunction</tt> method is called on every
-<tt>MachineFunction</tt> in a <tt>Module</tt>, so that the
-<tt>MachineFunctionPass</tt> may perform optimizations on the machine-dependent
-representation of the function. If you want to get at the LLVM <tt>Function</tt>
-for the <tt>MachineFunction</tt> you're working on, use
-<tt>MachineFunction</tt>'s <tt>getFunction()</tt> accessor method -- but
-remember, you may not modify the LLVM <tt>Function</tt> or its contents from a
-<tt>MachineFunctionPass</tt>.</p>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section">
- <a name="registration">Pass registration</a>
-</div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>In the <a href="#basiccode">Hello World</a> example pass we illustrated how
-pass registration works, and discussed some of the reasons that it is used and
-what it does. Here we discuss how and why passes are registered.</p>
-
-<p>As we saw above, passes are registered with the <b><tt>RegisterPass</tt></b>
-template, which requires you to pass at least two
-parameters. The first parameter is the name of the pass that is to be used on
-the command line to specify that the pass should be added to a program (for
-example, with <tt>opt</tt> or <tt>bugpoint</tt>). The second argument is the
-name of the pass, which is to be used for the <tt>--help</tt> output of
-programs, as
-well as for debug output generated by the <tt>--debug-pass</tt> option.</p>
-
-<p>If you want your pass to be easily dumpable, you should
-implement the virtual <tt>print</tt> method:</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="print">The <tt>print</tt> method</a>
-</div>
-
-<div class="doc_text">
-
-<div class="doc_code"><pre>
- <b>virtual void</b> print(llvm::OStream &amp;O, <b>const</b> Module *M) <b>const</b>;
-</pre></div>
-
-<p>The <tt>print</tt> method must be implemented by "analyses" in order to print
-a human readable version of the analysis results. This is useful for debugging
-an analysis itself, as well as for other people to figure out how an analysis
-works. Use the <tt>opt -analyze</tt> argument to invoke this method.</p>
-
-<p>The <tt>llvm::OStream</tt> parameter specifies the stream to write the results on,
-and the <tt>Module</tt> parameter gives a pointer to the top level module of the
-program that has been analyzed. Note however that this pointer may be null in
-certain circumstances (such as calling the <tt>Pass::dump()</tt> from a
-debugger), so it should only be used to enhance debug output, it should not be
-depended on.</p>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section">
- <a name="interaction">Specifying interactions between passes</a>
-</div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>One of the main responsibilities of the <tt>PassManager</tt> is to make sure
-that passes interact with each other correctly. Because <tt>PassManager</tt>
-tries to <a href="#passmanager">optimize the execution of passes</a> it must
-know how the passes interact with each other and what dependencies exist between
-the various passes. To track this, each pass can declare the set of passes that
-are required to be executed before the current pass, and the passes which are
-invalidated by the current pass.</p>
-
-<p>Typically this functionality is used to require that analysis results are
-computed before your pass is run. Running arbitrary transformation passes can
-invalidate the computed analysis results, which is what the invalidation set
-specifies. If a pass does not implement the <tt><a
-href="#getAnalysisUsage">getAnalysisUsage</a></tt> method, it defaults to not
-having any prerequisite passes, and invalidating <b>all</b> other passes.</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="getAnalysisUsage">The <tt>getAnalysisUsage</tt> method</a>
-</div>
-
-<div class="doc_text">
-
-<div class="doc_code"><pre>
- <b>virtual void</b> getAnalysisUsage(AnalysisUsage &amp;Info) <b>const</b>;
-</pre></div>
-
-<p>By implementing the <tt>getAnalysisUsage</tt> method, the required and
-invalidated sets may be specified for your transformation. The implementation
-should fill in the <tt><a
-href="http://llvm.org/doxygen/classllvm_1_1AnalysisUsage.html">AnalysisUsage</a></tt>
-object with information about which passes are required and not invalidated. To
-do this, a pass may call any of the following methods on the AnalysisUsage
-object:</p>
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="AU::addRequired">The <tt>AnalysisUsage::addRequired&lt;&gt;</tt> and <tt>AnalysisUsage::addRequiredTransitive&lt;&gt;</tt> methods</a>
-</div>
-
-<div class="doc_text">
-<p>
-If your pass requires a previous pass to be executed (an analysis for example),
-it can use one of these methods to arrange for it to be run before your pass.
-LLVM has many different types of analyses and passes that can be required,
-spanning the range from <tt>DominatorSet</tt> to <tt>BreakCriticalEdges</tt>.
-Requiring <tt>BreakCriticalEdges</tt>, for example, guarantees that there will
-be no critical edges in the CFG when your pass has been run.
-</p>
-
-<p>
-Some analyses chain to other analyses to do their job. For example, an <a
-href="AliasAnalysis.html">AliasAnalysis</a> implementation is required to <a
-href="AliasAnalysis.html#chaining">chain</a> to other alias analysis passes. In
-cases where analyses chain, the <tt>addRequiredTransitive</tt> method should be
-used instead of the <tt>addRequired</tt> method. This informs the PassManager
-that the transitively required pass should be alive as long as the requiring
-pass is.
-</p>
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="AU::addPreserved">The <tt>AnalysisUsage::addPreserved&lt;&gt;</tt> method</a>
-</div>
-
-<div class="doc_text">
-<p>
-One of the jobs of the PassManager is to optimize how and when analyses are run.
-In particular, it attempts to avoid recomputing data unless it needs to. For
-this reason, passes are allowed to declare that they preserve (i.e., they don't
-invalidate) an existing analysis if it's available. For example, a simple
-constant folding pass would not modify the CFG, so it can't possibly affect the
-results of dominator analysis. By default, all passes are assumed to invalidate
-all others.
-</p>
-
-<p>
-The <tt>AnalysisUsage</tt> class provides several methods which are useful in
-certain circumstances that are related to <tt>addPreserved</tt>. In particular,
-the <tt>setPreservesAll</tt> method can be called to indicate that the pass does
-not modify the LLVM program at all (which is true for analyses), and the
-<tt>setPreservesCFG</tt> method can be used by transformations that change
-instructions in the program but do not modify the CFG or terminator instructions
-(note that this property is implicitly set for <a
-href="#BasicBlockPass">BasicBlockPass</a>'s).
-</p>
-
-<p>
-<tt>addPreserved</tt> is particularly useful for transformations like
-<tt>BreakCriticalEdges</tt>. This pass knows how to update a small set of loop
-and dominator related analyses if they exist, so it can preserve them, despite
-the fact that it hacks on the CFG.
-</p>
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="AU::examples">Example implementations of <tt>getAnalysisUsage</tt></a>
-</div>
-
-<div class="doc_text">
-
-<div class="doc_code"><pre>
- <i>// This is an example implementation from an analysis, which does not modify
- // the program at all, yet has a prerequisite.</i>
- <b>void</b> <a href="http://llvm.org/doxygen/classllvm_1_1PostDominanceFrontier.html">PostDominanceFrontier</a>::getAnalysisUsage(AnalysisUsage &amp;AU) <b>const</b> {
- AU.setPreservesAll();
- AU.addRequired&lt;<a href="http://llvm.org/doxygen/classllvm_1_1PostDominatorTree.html">PostDominatorTree</a>&gt;();
- }
-</pre></div>
-
-<p>and:</p>
-
-<div class="doc_code"><pre>
- <i>// This example modifies the program, but does not modify the CFG</i>
- <b>void</b> <a href="http://llvm.org/doxygen/structLICM.html">LICM</a>::getAnalysisUsage(AnalysisUsage &amp;AU) <b>const</b> {
- AU.setPreservesCFG();
- AU.addRequired&lt;<a href="http://llvm.org/doxygen/classllvm_1_1LoopInfo.html">LoopInfo</a>&gt;();
- }
-</pre></div>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="getAnalysis">The <tt>getAnalysis&lt;&gt;</tt> and <tt>getAnalysisToUpdate&lt;&gt;</tt> methods</a>
-</div>
-
-<div class="doc_text">
-
-<p>The <tt>Pass::getAnalysis&lt;&gt;</tt> method is automatically inherited by
-your class, providing you with access to the passes that you declared that you
-required with the <a href="#getAnalysisUsage"><tt>getAnalysisUsage</tt></a>
-method. It takes a single template argument that specifies which pass class you
-want, and returns a reference to that pass. For example:</p>
-
-<div class="doc_code"><pre>
- bool LICM::runOnFunction(Function &amp;F) {
- LoopInfo &amp;LI = getAnalysis&lt;LoopInfo&gt;();
- ...
- }
-</pre></div>
-
-<p>This method call returns a reference to the pass desired. You may get a
-runtime assertion failure if you attempt to get an analysis that you did not
-declare as required in your <a
-href="#getAnalysisUsage"><tt>getAnalysisUsage</tt></a> implementation. This
-method can be called by your <tt>run*</tt> method implementation, or by any
-other local method invoked by your <tt>run*</tt> method.
-
-A module level pass can use function level analysis info using this interface.
-For example:</p>
-
-<div class="doc_code"><pre>
- bool ModuleLevelPass::runOnModule(Module &amp;M) {
- ...
- DominatorTree &amp;DT = getAnalysis&lt;DominatorTree&gt;(Func);
- ...
- }
-</pre></div>
-
-<p>In above example, runOnFunction for DominatorTree is called by pass manager
-before returning a reference to the desired pass.</p>
-
-<p>
-If your pass is capable of updating analyses if they exist (e.g.,
-<tt>BreakCriticalEdges</tt>, as described above), you can use the
-<tt>getAnalysisToUpdate</tt> method, which returns a pointer to the analysis if
-it is active. For example:</p>
-
-<div class="doc_code"><pre>
- ...
- if (DominatorSet *DS = getAnalysisToUpdate&lt;DominatorSet&gt;()) {
- <i>// A DominatorSet is active. This code will update it.</i>
- }
- ...
-</pre></div>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section">
- <a name="analysisgroup">Implementing Analysis Groups</a>
-</div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>Now that we understand the basics of how passes are defined, how they are
-used, and how they are required from other passes, it's time to get a little bit
-fancier. All of the pass relationships that we have seen so far are very
-simple: one pass depends on one other specific pass to be run before it can run.
-For many applications, this is great, for others, more flexibility is
-required.</p>
-
-<p>In particular, some analyses are defined such that there is a single simple
-interface to the analysis results, but multiple ways of calculating them.
-Consider alias analysis for example. The most trivial alias analysis returns
-"may alias" for any alias query. The most sophisticated analysis a
-flow-sensitive, context-sensitive interprocedural analysis that can take a
-significant amount of time to execute (and obviously, there is a lot of room
-between these two extremes for other implementations). To cleanly support
-situations like this, the LLVM Pass Infrastructure supports the notion of
-Analysis Groups.</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="agconcepts">Analysis Group Concepts</a>
-</div>
-
-<div class="doc_text">
-
-<p>An Analysis Group is a single simple interface that may be implemented by
-multiple different passes. Analysis Groups can be given human readable names
-just like passes, but unlike passes, they need not derive from the <tt>Pass</tt>
-class. An analysis group may have one or more implementations, one of which is
-the "default" implementation.</p>
-
-<p>Analysis groups are used by client passes just like other passes are: the
-<tt>AnalysisUsage::addRequired()</tt> and <tt>Pass::getAnalysis()</tt> methods.
-In order to resolve this requirement, the <a href="#passmanager">PassManager</a>
-scans the available passes to see if any implementations of the analysis group
-are available. If none is available, the default implementation is created for
-the pass to use. All standard rules for <A href="#interaction">interaction
-between passes</a> still apply.</p>
-
-<p>Although <a href="#registration">Pass Registration</a> is optional for normal
-passes, all analysis group implementations must be registered, and must use the
-<A href="#registerag"><tt>RegisterAnalysisGroup</tt></a> template to join the
-implementation pool. Also, a default implementation of the interface
-<b>must</b> be registered with <A
-href="#registerag"><tt>RegisterAnalysisGroup</tt></a>.</p>
-
-<p>As a concrete example of an Analysis Group in action, consider the <a
-href="http://llvm.org/doxygen/classllvm_1_1AliasAnalysis.html">AliasAnalysis</a>
-analysis group. The default implementation of the alias analysis interface (the
-<tt><a
-href="http://llvm.org/doxygen/structBasicAliasAnalysis.html">basicaa</a></tt>
-pass) just does a few simple checks that don't require significant analysis to
-compute (such as: two different globals can never alias each other, etc).
-Passes that use the <tt><a
-href="http://llvm.org/doxygen/classllvm_1_1AliasAnalysis.html">AliasAnalysis</a></tt>
-interface (for example the <tt><a
-href="http://llvm.org/doxygen/structGCSE.html">gcse</a></tt> pass), do
-not care which implementation of alias analysis is actually provided, they just
-use the designated interface.</p>
-
-<p>From the user's perspective, commands work just like normal. Issuing the
-command '<tt>opt -gcse ...</tt>' will cause the <tt>basicaa</tt> class to be
-instantiated and added to the pass sequence. Issuing the command '<tt>opt
--somefancyaa -gcse ...</tt>' will cause the <tt>gcse</tt> pass to use the
-<tt>somefancyaa</tt> alias analysis (which doesn't actually exist, it's just a
-hypothetical example) instead.</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="registerag">Using <tt>RegisterAnalysisGroup</tt></a>
-</div>
-
-<div class="doc_text">
-
-<p>The <tt>RegisterAnalysisGroup</tt> template is used to register the analysis
-group itself as well as add pass implementations to the analysis group. First,
-an analysis should be registered, with a human readable name provided for it.
-Unlike registration of passes, there is no command line argument to be specified
-for the Analysis Group Interface itself, because it is "abstract":</p>
-
-<div class="doc_code"><pre>
- <b>static</b> RegisterAnalysisGroup&lt;<a href="http://llvm.org/doxygen/classllvm_1_1AliasAnalysis.html">AliasAnalysis</a>&gt; A("<i>Alias Analysis</i>");
-</pre></div>
-
-<p>Once the analysis is registered, passes can declare that they are valid
-implementations of the interface by using the following code:</p>
-
-<div class="doc_code"><pre>
-<b>namespace</b> {
- //<i> Analysis Group implementations <b>must</b> be registered normally...</i>
- RegisterPass&lt;FancyAA&gt;
- B("<i>somefancyaa</i>", "<i>A more complex alias analysis implementation</i>");
-
- //<i> Declare that we implement the AliasAnalysis interface</i>
- RegisterAnalysisGroup&lt;<a href="http://llvm.org/doxygen/classllvm_1_1AliasAnalysis.html">AliasAnalysis</a>&gt; C(B);
-}
-</pre></div>
-
-<p>This just shows a class <tt>FancyAA</tt> that is registered normally, then
-uses the <tt>RegisterAnalysisGroup</tt> template to "join" the <tt><a
-href="http://llvm.org/doxygen/classllvm_1_1AliasAnalysis.html">AliasAnalysis</a></tt>
-analysis group. Every implementation of an analysis group should join using
-this template. A single pass may join multiple different analysis groups with
-no problem.</p>
-
-<div class="doc_code"><pre>
-<b>namespace</b> {
- //<i> Analysis Group implementations <b>must</b> be registered normally...</i>
- RegisterPass&lt;<a href="http://llvm.org/doxygen/structBasicAliasAnalysis.html">BasicAliasAnalysis</a>&gt;
- D("<i>basicaa</i>", "<i>Basic Alias Analysis (default AA impl)</i>");
-
- //<i> Declare that we implement the AliasAnalysis interface</i>
- RegisterAnalysisGroup&lt;<a href="http://llvm.org/doxygen/classllvm_1_1AliasAnalysis.html">AliasAnalysis</a>, <b>true</b>&gt; E(D);
-}
-</pre></div>
-
-<p>Here we show how the default implementation is specified (using the extra
-argument to the <tt>RegisterAnalysisGroup</tt> template). There must be exactly
-one default implementation available at all times for an Analysis Group to be
-used. Only default implementation can derive from <tt>ImmutablePass</tt>.
-Here we declare that the
- <tt><a href="http://llvm.org/doxygen/structBasicAliasAnalysis.html">BasicAliasAnalysis</a></tt>
-pass is the default implementation for the interface.</p>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section">
- <a name="passStatistics">Pass Statistics</a>
-</div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-<p>The <a
-href="http://llvm.org/doxygen/Statistic_8h-source.html"><tt>Statistic</tt></a>
-class is designed to be an easy way to expose various success
-metrics from passes. These statistics are printed at the end of a
-run, when the -stats command line option is enabled on the command
-line. See the <a href="http://llvm.org/docs/ProgrammersManual.html#Statistic">Statistics section</a> in the Programmer's Manual for details.
-
-</div>
-
-
-<!-- *********************************************************************** -->
-<div class="doc_section">
- <a name="passmanager">What PassManager does</a>
-</div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>The <a
-href="http://llvm.org/doxygen/PassManager_8h-source.html"><tt>PassManager</tt></a>
-<a
-href="http://llvm.org/doxygen/classllvm_1_1PassManager.html">class</a>
-takes a list of passes, ensures their <a href="#interaction">prerequisites</a>
-are set up correctly, and then schedules passes to run efficiently. All of the
-LLVM tools that run passes use the <tt>PassManager</tt> for execution of these
-passes.</p>
-
-<p>The <tt>PassManager</tt> does two main things to try to reduce the execution
-time of a series of passes:</p>
-
-<ol>
-<li><b>Share analysis results</b> - The PassManager attempts to avoid
-recomputing analysis results as much as possible. This means keeping track of
-which analyses are available already, which analyses get invalidated, and which
-analyses are needed to be run for a pass. An important part of work is that the
-<tt>PassManager</tt> tracks the exact lifetime of all analysis results, allowing
-it to <a href="#releaseMemory">free memory</a> allocated to holding analysis
-results as soon as they are no longer needed.</li>
-
-<li><b>Pipeline the execution of passes on the program</b> - The
-<tt>PassManager</tt> attempts to get better cache and memory usage behavior out
-of a series of passes by pipelining the passes together. This means that, given
-a series of consequtive <a href="#FunctionPass"><tt>FunctionPass</tt></a>'s, it
-will execute all of the <a href="#FunctionPass"><tt>FunctionPass</tt></a>'s on
-the first function, then all of the <a
-href="#FunctionPass"><tt>FunctionPass</tt></a>es on the second function,
-etc... until the entire program has been run through the passes.
-
-<p>This improves the cache behavior of the compiler, because it is only touching
-the LLVM program representation for a single function at a time, instead of
-traversing the entire program. It reduces the memory consumption of compiler,
-because, for example, only one <a
-href="http://llvm.org/doxygen/classllvm_1_1DominatorSet.html"><tt>DominatorSet</tt></a>
-needs to be calculated at a time. This also makes it possible to implement
-some <a
-href="#SMP">interesting enhancements</a> in the future.</p></li>
-
-</ol>
-
-<p>The effectiveness of the <tt>PassManager</tt> is influenced directly by how
-much information it has about the behaviors of the passes it is scheduling. For
-example, the "preserved" set is intentionally conservative in the face of an
-unimplemented <a href="#getAnalysisUsage"><tt>getAnalysisUsage</tt></a> method.
-Not implementing when it should be implemented will have the effect of not
-allowing any analysis results to live across the execution of your pass.</p>
-
-<p>The <tt>PassManager</tt> class exposes a <tt>--debug-pass</tt> command line
-options that is useful for debugging pass execution, seeing how things work, and
-diagnosing when you should be preserving more analyses than you currently are
-(To get information about all of the variants of the <tt>--debug-pass</tt>
-option, just type '<tt>opt --help-hidden</tt>').</p>
-
-<p>By using the <tt>--debug-pass=Structure</tt> option, for example, we can see
-how our <a href="#basiccode">Hello World</a> pass interacts with other passes.
-Lets try it out with the <tt>gcse</tt> and <tt>licm</tt> passes:</p>
-
-<div class="doc_code"><pre>
-$ opt -load ../../../Debug/lib/Hello.so -gcse -licm --debug-pass=Structure &lt; hello.bc &gt; /dev/null
-Module Pass Manager
- Function Pass Manager
- Dominator Set Construction
- Immediate Dominators Construction
- Global Common Subexpression Elimination
--- Immediate Dominators Construction
--- Global Common Subexpression Elimination
- Natural Loop Construction
- Loop Invariant Code Motion
--- Natural Loop Construction
--- Loop Invariant Code Motion
- Module Verifier
--- Dominator Set Construction
--- Module Verifier
- Bitcode Writer
---Bitcode Writer
-</pre></div>
-
-<p>This output shows us when passes are constructed and when the analysis
-results are known to be dead (prefixed with '<tt>--</tt>'). Here we see that
-GCSE uses dominator and immediate dominator information to do its job. The LICM
-pass uses natural loop information, which uses dominator sets, but not immediate
-dominators. Because immediate dominators are no longer useful after the GCSE
-pass, it is immediately destroyed. The dominator sets are then reused to
-compute natural loop information, which is then used by the LICM pass.</p>
-
-<p>After the LICM pass, the module verifier runs (which is automatically added
-by the '<tt>opt</tt>' tool), which uses the dominator set to check that the
-resultant LLVM code is well formed. After it finishes, the dominator set
-information is destroyed, after being computed once, and shared by three
-passes.</p>
-
-<p>Lets see how this changes when we run the <a href="#basiccode">Hello
-World</a> pass in between the two passes:</p>
-
-<div class="doc_code"><pre>
-$ opt -load ../../../Debug/lib/Hello.so -gcse -hello -licm --debug-pass=Structure &lt; hello.bc &gt; /dev/null
-Module Pass Manager
- Function Pass Manager
- Dominator Set Construction
- Immediate Dominators Construction
- Global Common Subexpression Elimination
-<b>-- Dominator Set Construction</b>
--- Immediate Dominators Construction
--- Global Common Subexpression Elimination
-<b> Hello World Pass
--- Hello World Pass
- Dominator Set Construction</b>
- Natural Loop Construction
- Loop Invariant Code Motion
--- Natural Loop Construction
--- Loop Invariant Code Motion
- Module Verifier
--- Dominator Set Construction
--- Module Verifier
- Bitcode Writer
---Bitcode Writer
-Hello: __main
-Hello: puts
-Hello: main
-</pre></div>
-
-<p>Here we see that the <a href="#basiccode">Hello World</a> pass has killed the
-Dominator Set pass, even though it doesn't modify the code at all! To fix this,
-we need to add the following <a
-href="#getAnalysisUsage"><tt>getAnalysisUsage</tt></a> method to our pass:</p>
-
-<div class="doc_code"><pre>
- <i>// We don't modify the program, so we preserve all analyses</i>
- <b>virtual void</b> getAnalysisUsage(AnalysisUsage &amp;AU) <b>const</b> {
- AU.setPreservesAll();
- }
-</pre></div>
-
-<p>Now when we run our pass, we get this output:</p>
-
-<div class="doc_code"><pre>
-$ opt -load ../../../Debug/lib/Hello.so -gcse -hello -licm --debug-pass=Structure &lt; hello.bc &gt; /dev/null
-Pass Arguments: -gcse -hello -licm
-Module Pass Manager
- Function Pass Manager
- Dominator Set Construction
- Immediate Dominators Construction
- Global Common Subexpression Elimination
--- Immediate Dominators Construction
--- Global Common Subexpression Elimination
- Hello World Pass
--- Hello World Pass
- Natural Loop Construction
- Loop Invariant Code Motion
--- Loop Invariant Code Motion
--- Natural Loop Construction
- Module Verifier
--- Dominator Set Construction
--- Module Verifier
- Bitcode Writer
---Bitcode Writer
-Hello: __main
-Hello: puts
-Hello: main
-</pre></div>
-
-<p>Which shows that we don't accidentally invalidate dominator information
-anymore, and therefore do not have to compute it twice.</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="releaseMemory">The <tt>releaseMemory</tt> method</a>
-</div>
-
-<div class="doc_text">
-
-<div class="doc_code"><pre>
- <b>virtual void</b> releaseMemory();
-</pre></div>
-
-<p>The <tt>PassManager</tt> automatically determines when to compute analysis
-results, and how long to keep them around for. Because the lifetime of the pass
-object itself is effectively the entire duration of the compilation process, we
-need some way to free analysis results when they are no longer useful. The
-<tt>releaseMemory</tt> virtual method is the way to do this.</p>
-
-<p>If you are writing an analysis or any other pass that retains a significant
-amount of state (for use by another pass which "requires" your pass and uses the
-<a href="#getAnalysis">getAnalysis</a> method) you should implement
-<tt>releaseMEmory</tt> to, well, release the memory allocated to maintain this
-internal state. This method is called after the <tt>run*</tt> method for the
-class, before the next call of <tt>run*</tt> in your pass.</p>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section">
- <a name="registering">Registering dynamically loaded passes</a>
-</div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p><i>Size matters</i> when constructing production quality tools using llvm,
-both for the purposes of distribution, and for regulating the resident code size
-when running on the target system. Therefore, it becomes desirable to
-selectively use some passes, while omitting others and maintain the flexibility
-to change configurations later on. You want to be able to do all this, and,
-provide feedback to the user. This is where pass registration comes into
-play.</p>
-
-<p>The fundamental mechanisms for pass registration are the
-<tt>MachinePassRegistry</tt> class and subclasses of
-<tt>MachinePassRegistryNode</tt>.</p>
-
-<p>An instance of <tt>MachinePassRegistry</tt> is used to maintain a list of
-<tt>MachinePassRegistryNode</tt> objects. This instance maintains the list and
-communicates additions and deletions to the command line interface.</p>
-
-<p>An instance of <tt>MachinePassRegistryNode</tt> subclass is used to maintain
-information provided about a particular pass. This information includes the
-command line name, the command help string and the address of the function used
-to create an instance of the pass. A global static constructor of one of these
-instances <i>registers</i> with a corresponding <tt>MachinePassRegistry</tt>,
-the static destructor <i>unregisters</i>. Thus a pass that is statically linked
-in the tool will be registered at start up. A dynamically loaded pass will
-register on load and unregister at unload.</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsection">
- <a name="registering_existing">Using existing registries</a>
-</div>
-
-<div class="doc_text">
-
-<p>There are predefined registries to track instruction scheduling
-(<tt>RegisterScheduler</tt>) and register allocation (<tt>RegisterRegAlloc</tt>)
-machine passes. Here we will describe how to <i>register</i> a register
-allocator machine pass.</p>
-
-<p>Implement your register allocator machine pass. In your register allocator
-.cpp file add the following include;</p>
-
-<div class="doc_code"><pre>
- #include "llvm/CodeGen/RegAllocRegistry.h"
-</pre></div>
-
-<p>Also in your register allocator .cpp file, define a creator function in the
-form; </p>
-
-<div class="doc_code"><pre>
- FunctionPass *createMyRegisterAllocator() {
- return new MyRegisterAllocator();
- }
-</pre></div>
-
-<p>Note that the signature of this function should match the type of
-<tt>RegisterRegAlloc::FunctionPassCtor</tt>. In the same file add the
-"installing" declaration, in the form;</p>
-
-<div class="doc_code"><pre>
- static RegisterRegAlloc myRegAlloc("myregalloc",
- " my register allocator help string",
- createMyRegisterAllocator);
-</pre></div>
-
-<p>Note the two spaces prior to the help string produces a tidy result on the
---help query.</p>
-
-<div class="doc_code"><pre>
-$ llc --help
- ...
- -regalloc - Register allocator to use: (default = linearscan)
- =linearscan - linear scan register allocator
- =local - local register allocator
- =simple - simple register allocator
- =myregalloc - my register allocator help string
- ...
-</pre></div>
-
-<p>And that's it. The user is now free to use <tt>-regalloc=myregalloc</tt> as
-an option. Registering instruction schedulers is similar except use the
-<tt>RegisterScheduler</tt> class. Note that the
-<tt>RegisterScheduler::FunctionPassCtor</tt> is significantly different from
-<tt>RegisterRegAlloc::FunctionPassCtor</tt>.</p>
-
-<p>To force the load/linking of your register allocator into the llc/lli tools,
-add your creator function's global declaration to "Passes.h" and add a "pseudo"
-call line to <tt>llvm/Codegen/LinkAllCodegenComponents.h</tt>.</p>
-
-</div>
-
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsection">
- <a name="registering_new">Creating new registries</a>
-</div>
-
-<div class="doc_text">
-
-<p>The easiest way to get started is to clone one of the existing registries; we
-recommend <tt>llvm/CodeGen/RegAllocRegistry.h</tt>. The key things to modify
-are the class name and the <tt>FunctionPassCtor</tt> type.</p>
-
-<p>Then you need to declare the registry. Example: if your pass registry is
-<tt>RegisterMyPasses</tt> then define;</p>
-
-<div class="doc_code"><pre>
-MachinePassRegistry RegisterMyPasses::Registry;
-</pre></div>
-
-<p>And finally, declare the command line option for your passes. Example:</p>
-
-<div class="doc_code"><pre>
- cl::opt&lt;RegisterMyPasses::FunctionPassCtor, false,
- RegisterPassParser&lt;RegisterMyPasses&gt &gt
- MyPassOpt("mypass",
- cl::init(&amp;createDefaultMyPass),
- cl::desc("my pass option help"));
-</pre></div>
-
-<p>Here the command option is "mypass", with createDefaultMyPass as the default
-creator.</p>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section">
- <a name="debughints">Using GDB with dynamically loaded passes</a>
-</div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>Unfortunately, using GDB with dynamically loaded passes is not as easy as it
-should be. First of all, you can't set a breakpoint in a shared object that has
-not been loaded yet, and second of all there are problems with inlined functions
-in shared objects. Here are some suggestions to debugging your pass with
-GDB.</p>
-
-<p>For sake of discussion, I'm going to assume that you are debugging a
-transformation invoked by <tt>opt</tt>, although nothing described here depends
-on that.</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="breakpoint">Setting a breakpoint in your pass</a>
-</div>
-
-<div class="doc_text">
-
-<p>First thing you do is start <tt>gdb</tt> on the <tt>opt</tt> process:</p>
-
-<div class="doc_code"><pre>
-$ <b>gdb opt</b>
-GNU gdb 5.0
-Copyright 2000 Free Software Foundation, Inc.
-GDB is free software, covered by the GNU General Public License, and you are
-welcome to change it and/or distribute copies of it under certain conditions.
-Type "show copying" to see the conditions.
-There is absolutely no warranty for GDB. Type "show warranty" for details.
-This GDB was configured as "sparc-sun-solaris2.6"...
-(gdb)
-</pre></div>
-
-<p>Note that <tt>opt</tt> has a lot of debugging information in it, so it takes
-time to load. Be patient. Since we cannot set a breakpoint in our pass yet
-(the shared object isn't loaded until runtime), we must execute the process, and
-have it stop before it invokes our pass, but after it has loaded the shared
-object. The most foolproof way of doing this is to set a breakpoint in
-<tt>PassManager::run</tt> and then run the process with the arguments you
-want:</p>
-
-<div class="doc_code"><pre>
-(gdb) <b>break llvm::PassManager::run</b>
-Breakpoint 1 at 0x2413bc: file Pass.cpp, line 70.
-(gdb) <b>run test.bc -load $(LLVMTOP)/llvm/Debug/lib/[libname].so -[passoption]</b>
-Starting program: opt test.bc -load $(LLVMTOP)/llvm/Debug/lib/[libname].so -[passoption]
-Breakpoint 1, PassManager::run (this=0xffbef174, M=@0x70b298) at Pass.cpp:70
-70 bool PassManager::run(Module &amp;M) { return PM-&gt;run(M); }
-(gdb)
-</pre></div>
-
-<p>Once the <tt>opt</tt> stops in the <tt>PassManager::run</tt> method you are
-now free to set breakpoints in your pass so that you can trace through execution
-or do other standard debugging stuff.</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="debugmisc">Miscellaneous Problems</a>
-</div>
-
-<div class="doc_text">
-
-<p>Once you have the basics down, there are a couple of problems that GDB has,
-some with solutions, some without.</p>
-
-<ul>
-<li>Inline functions have bogus stack information. In general, GDB does a
-pretty good job getting stack traces and stepping through inline functions.
-When a pass is dynamically loaded however, it somehow completely loses this
-capability. The only solution I know of is to de-inline a function (move it
-from the body of a class to a .cpp file).</li>
-
-<li>Restarting the program breaks breakpoints. After following the information
-above, you have succeeded in getting some breakpoints planted in your pass. Nex
-thing you know, you restart the program (i.e., you type '<tt>run</tt>' again),
-and you start getting errors about breakpoints being unsettable. The only way I
-have found to "fix" this problem is to <tt>delete</tt> the breakpoints that are
-already set in your pass, run the program, and re-set the breakpoints once
-execution stops in <tt>PassManager::run</tt>.</li>
-
-</ul>
-
-<p>Hopefully these tips will help with common case debugging situations. If
-you'd like to contribute some tips of your own, just contact <a
-href="mailto:sabre@nondot.org">Chris</a>.</p>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section">
- <a name="future">Future extensions planned</a>
-</div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>Although the LLVM Pass Infrastructure is very capable as it stands, and does
-some nifty stuff, there are things we'd like to add in the future. Here is
-where we are going:</p>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
- <a name="SMP">Multithreaded LLVM</a>
-</div>
-
-<div class="doc_text">
-
-<p>Multiple CPU machines are becoming more common and compilation can never be
-fast enough: obviously we should allow for a multithreaded compiler. Because of
-the semantics defined for passes above (specifically they cannot maintain state
-across invocations of their <tt>run*</tt> methods), a nice clean way to
-implement a multithreaded compiler would be for the <tt>PassManager</tt> class
-to create multiple instances of each pass object, and allow the separate
-instances to be hacking on different parts of the program at the same time.</p>
-
-<p>This implementation would prevent each of the passes from having to implement
-multithreaded constructs, requiring only the LLVM core to have locking in a few
-places (for global resources). Although this is a simple extension, we simply
-haven't had time (or multiprocessor machines, thus a reason) to implement this.
-Despite that, we have kept the LLVM passes SMP ready, and you should too.</p>
-
-</div>
-
-<!-- *********************************************************************** -->
-<hr>
-<address>
- <a href="http://jigsaw.w3.org/css-validator/check/referer"><img
- src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"></a>
- <a href="http://validator.w3.org/check/referer"><img
- src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!" /></a>
-
- <a href="mailto:sabre@nondot.org">Chris Lattner</a><br>
- <a href="http://llvm.org">The LLVM Compiler Infrastructure</a><br>
- Last modified: $Date$
-</address>
-
-</body>
-</html>
diff --git a/release_23/docs/doxygen.cfg.in b/release_23/docs/doxygen.cfg.in
deleted file mode 100644
index 67498bd8f282..000000000000
--- a/release_23/docs/doxygen.cfg.in
+++ /dev/null
@@ -1,1230 +0,0 @@
-# Doxyfile 1.4.4
-
-# This file describes the settings to be used by the documentation system
-# doxygen (www.doxygen.org) for a project
-#
-# All text after a hash (#) is considered a comment and will be ignored
-# The format is:
-# TAG = value [value, ...]
-# For lists items can also be appended using:
-# TAG += value [value, ...]
-# Values that contain spaces should be placed between quotes (" ")
-
-#---------------------------------------------------------------------------
-# Project related configuration options
-#---------------------------------------------------------------------------
-
-# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
-# by quotes) that should identify the project.
-
-PROJECT_NAME = LLVM
-
-# The PROJECT_NUMBER tag can be used to enter a project or revision number.
-# This could be handy for archiving the generated documentation or
-# if some version control system is used.
-
-PROJECT_NUMBER = @PACKAGE_VERSION@
-
-# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
-# base path where the generated documentation will be put.
-# If a relative path is entered, it will be relative to the location
-# where doxygen was started. If left blank the current directory will be used.
-
-OUTPUT_DIRECTORY = @abs_top_builddir@/docs/doxygen
-
-# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create
-# 4096 sub-directories (in 2 levels) under the output directory of each output
-# format and will distribute the generated files over these directories.
-# Enabling this option can be useful when feeding doxygen a huge amount of
-# source files, where putting all generated files in the same directory would
-# otherwise cause performance problems for the file system.
-
-CREATE_SUBDIRS = NO
-
-# The OUTPUT_LANGUAGE tag is used to specify the language in which all
-# documentation generated by doxygen is written. Doxygen will use this
-# information to generate all constant output in the proper language.
-# The default language is English, other supported languages are:
-# Brazilian, Catalan, Chinese, Chinese-Traditional, Croatian, Czech, Danish,
-# Dutch, Finnish, French, German, Greek, Hungarian, Italian, Japanese,
-# Japanese-en (Japanese with English messages), Korean, Korean-en, Norwegian,
-# Polish, Portuguese, Romanian, Russian, Serbian, Slovak, Slovene, Spanish,
-# Swedish, and Ukrainian.
-
-OUTPUT_LANGUAGE = English
-
-# This tag can be used to specify the encoding used in the generated output.
-# The encoding is not always determined by the language that is chosen,
-# but also whether or not the output is meant for Windows or non-Windows users.
-# In case there is a difference, setting the USE_WINDOWS_ENCODING tag to YES
-# forces the Windows encoding (this is the default for the Windows binary),
-# whereas setting the tag to NO uses a Unix-style encoding (the default for
-# all platforms other than Windows).
-
-USE_WINDOWS_ENCODING = NO
-
-# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
-# include brief member descriptions after the members that are listed in
-# the file and class documentation (similar to JavaDoc).
-# Set to NO to disable this.
-
-BRIEF_MEMBER_DESC = YES
-
-# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend
-# the brief description of a member or function before the detailed description.
-# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
-# brief descriptions will be completely suppressed.
-
-REPEAT_BRIEF = YES
-
-# This tag implements a quasi-intelligent brief description abbreviator
-# that is used to form the text in various listings. Each string
-# in this list, if found as the leading text of the brief description, will be
-# stripped from the text and the result after processing the whole list, is
-# used as the annotated text. Otherwise, the brief description is used as-is.
-# If left blank, the following values are used ("$name" is automatically
-# replaced with the name of the entity): "The $name class" "The $name widget"
-# "The $name file" "is" "provides" "specifies" "contains"
-# "represents" "a" "an" "the"
-
-ABBREVIATE_BRIEF =
-
-# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
-# Doxygen will generate a detailed section even if there is only a brief
-# description.
-
-ALWAYS_DETAILED_SEC = NO
-
-# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
-# inherited members of a class in the documentation of that class as if those
-# members were ordinary class members. Constructors, destructors and assignment
-# operators of the base classes will not be shown.
-
-INLINE_INHERITED_MEMB = NO
-
-# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full
-# path before files name in the file list and in the header files. If set
-# to NO the shortest path that makes the file name unique will be used.
-
-FULL_PATH_NAMES = NO
-
-# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
-# can be used to strip a user-defined part of the path. Stripping is
-# only done if one of the specified strings matches the left-hand part of
-# the path. The tag can be used to show relative paths in the file list.
-# If left blank the directory from which doxygen is run is used as the
-# path to strip.
-
-STRIP_FROM_PATH = ../..
-
-# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of
-# the path mentioned in the documentation of a class, which tells
-# the reader which header file to include in order to use a class.
-# If left blank only the name of the header file containing the class
-# definition is used. Otherwise one should specify the include paths that
-# are normally passed to the compiler using the -I flag.
-
-STRIP_FROM_INC_PATH =
-
-# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter
-# (but less readable) file names. This can be useful is your file systems
-# doesn't support long names like on DOS, Mac, or CD-ROM.
-
-SHORT_NAMES = NO
-
-# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
-# will interpret the first line (until the first dot) of a JavaDoc-style
-# comment as the brief description. If set to NO, the JavaDoc
-# comments will behave just like the Qt-style comments (thus requiring an
-# explicit @brief command for a brief description.
-
-JAVADOC_AUTOBRIEF = NO
-
-# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen
-# treat a multi-line C++ special comment block (i.e. a block of //! or ///
-# comments) as a brief description. This used to be the default behaviour.
-# The new default is to treat a multi-line C++ comment block as a detailed
-# description. Set this tag to YES if you prefer the old behaviour instead.
-
-MULTILINE_CPP_IS_BRIEF = NO
-
-# If the DETAILS_AT_TOP tag is set to YES then Doxygen
-# will output the detailed description near the top, like JavaDoc.
-# If set to NO, the detailed description appears after the member
-# documentation.
-
-DETAILS_AT_TOP = NO
-
-# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
-# member inherits the documentation from any documented member that it
-# re-implements.
-
-INHERIT_DOCS = YES
-
-# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
-# tag is set to YES, then doxygen will reuse the documentation of the first
-# member in the group (if any) for the other members of the group. By default
-# all members of a group must be documented explicitly.
-
-DISTRIBUTE_GROUP_DOC = NO
-
-# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce
-# a new page for each member. If set to NO, the documentation of a member will
-# be part of the file/class/namespace that contains it.
-
-#SEPARATE_MEMBER_PAGES = NO
-
-# The TAB_SIZE tag can be used to set the number of spaces in a tab.
-# Doxygen uses this value to replace tabs by spaces in code fragments.
-
-TAB_SIZE = 2
-
-# This tag can be used to specify a number of aliases that acts
-# as commands in the documentation. An alias has the form "name=value".
-# For example adding "sideeffect=\par Side Effects:\n" will allow you to
-# put the command \sideeffect (or @sideeffect) in the documentation, which
-# will result in a user-defined paragraph with heading "Side Effects:".
-# You can put \n's in the value part of an alias to insert newlines.
-
-ALIASES =
-
-# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C
-# sources only. Doxygen will then generate output that is more tailored for C.
-# For instance, some of the names that are used will be different. The list
-# of all members will be omitted, etc.
-
-OPTIMIZE_OUTPUT_FOR_C = NO
-
-# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java sources
-# only. Doxygen will then generate output that is more tailored for Java.
-# For instance, namespaces will be presented as packages, qualified scopes
-# will look different, etc.
-
-OPTIMIZE_OUTPUT_JAVA = NO
-
-# Set the SUBGROUPING tag to YES (the default) to allow class member groups of
-# the same type (for instance a group of public functions) to be put as a
-# subgroup of that type (e.g. under the Public Functions section). Set it to
-# NO to prevent subgrouping. Alternatively, this can be done per class using
-# the \nosubgrouping command.
-
-SUBGROUPING = YES
-
-#---------------------------------------------------------------------------
-# Build related configuration options
-#---------------------------------------------------------------------------
-
-# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
-# documentation are documented, even if no documentation was available.
-# Private class members and static file members will be hidden unless
-# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
-
-EXTRACT_ALL = YES
-
-# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
-# will be included in the documentation.
-
-EXTRACT_PRIVATE = NO
-
-# If the EXTRACT_STATIC tag is set to YES all static members of a file
-# will be included in the documentation.
-
-EXTRACT_STATIC = YES
-
-# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs)
-# defined locally in source files will be included in the documentation.
-# If set to NO only classes defined in header files are included.
-
-EXTRACT_LOCAL_CLASSES = YES
-
-# This flag is only useful for Objective-C code. When set to YES local
-# methods, which are defined in the implementation section but not in
-# the interface are included in the documentation.
-# If set to NO (the default) only methods in the interface are included.
-
-EXTRACT_LOCAL_METHODS = NO
-
-# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
-# undocumented members of documented classes, files or namespaces.
-# If set to NO (the default) these members will be included in the
-# various overviews, but no documentation section is generated.
-# This option has no effect if EXTRACT_ALL is enabled.
-
-HIDE_UNDOC_MEMBERS = NO
-
-# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all
-# undocumented classes that are normally visible in the class hierarchy.
-# If set to NO (the default) these classes will be included in the various
-# overviews. This option has no effect if EXTRACT_ALL is enabled.
-
-HIDE_UNDOC_CLASSES = NO
-
-# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all
-# friend (class|struct|union) declarations.
-# If set to NO (the default) these declarations will be included in the
-# documentation.
-
-HIDE_FRIEND_COMPOUNDS = NO
-
-# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any
-# documentation blocks found inside the body of a function.
-# If set to NO (the default) these blocks will be appended to the
-# function's detailed documentation block.
-
-HIDE_IN_BODY_DOCS = NO
-
-# The INTERNAL_DOCS tag determines if documentation
-# that is typed after a \internal command is included. If the tag is set
-# to NO (the default) then the documentation will be excluded.
-# Set it to YES to include the internal documentation.
-
-INTERNAL_DOCS = NO
-
-# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate
-# file names in lower-case letters. If set to YES upper-case letters are also
-# allowed. This is useful if you have classes or files whose names only differ
-# in case and if your file system supports case sensitive file names. Windows
-# and Mac users are advised to set this option to NO.
-
-CASE_SENSE_NAMES = YES
-
-# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen
-# will show members with their full class and namespace scopes in the
-# documentation. If set to YES the scope will be hidden.
-
-HIDE_SCOPE_NAMES = NO
-
-# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
-# will put a list of the files that are included by a file in the documentation
-# of that file.
-
-SHOW_INCLUDE_FILES = YES
-
-# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
-# is inserted in the documentation for inline members.
-
-INLINE_INFO = YES
-
-# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen
-# will sort the (detailed) documentation of file and class members
-# alphabetically by member name. If set to NO the members will appear in
-# declaration order.
-
-SORT_MEMBER_DOCS = YES
-
-# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the
-# brief documentation of file, namespace and class members alphabetically
-# by member name. If set to NO (the default) the members will appear in
-# declaration order.
-
-SORT_BRIEF_DOCS = NO
-
-# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be
-# sorted by fully-qualified names, including namespaces. If set to
-# NO (the default), the class list will be sorted only by class name,
-# not including the namespace part.
-# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
-# Note: This option applies only to the class list, not to the
-# alphabetical list.
-
-SORT_BY_SCOPE_NAME = NO
-
-# The GENERATE_TODOLIST tag can be used to enable (YES) or
-# disable (NO) the todo list. This list is created by putting \todo
-# commands in the documentation.
-
-GENERATE_TODOLIST = YES
-
-# The GENERATE_TESTLIST tag can be used to enable (YES) or
-# disable (NO) the test list. This list is created by putting \test
-# commands in the documentation.
-
-GENERATE_TESTLIST = YES
-
-# The GENERATE_BUGLIST tag can be used to enable (YES) or
-# disable (NO) the bug list. This list is created by putting \bug
-# commands in the documentation.
-
-GENERATE_BUGLIST = YES
-
-# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or
-# disable (NO) the deprecated list. This list is created by putting
-# \deprecated commands in the documentation.
-
-GENERATE_DEPRECATEDLIST= YES
-
-# The ENABLED_SECTIONS tag can be used to enable conditional
-# documentation sections, marked by \if sectionname ... \endif.
-
-ENABLED_SECTIONS =
-
-# The MAX_INITIALIZER_LINES tag determines the maximum number of lines
-# the initial value of a variable or define consists of for it to appear in
-# the documentation. If the initializer consists of more lines than specified
-# here it will be hidden. Use a value of 0 to hide initializers completely.
-# The appearance of the initializer of individual variables and defines in the
-# documentation can be controlled using \showinitializer or \hideinitializer
-# command in the documentation regardless of this setting.
-
-MAX_INITIALIZER_LINES = 30
-
-# Set the SHOW_USED_FILES tag to NO to disable the list of files generated
-# at the bottom of the documentation of classes and structs. If set to YES the
-# list will mention the files that were used to generate the documentation.
-
-SHOW_USED_FILES = YES
-
-# If the sources in your project are distributed over multiple directories
-# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy
-# in the documentation. The default is YES.
-
-SHOW_DIRECTORIES = YES
-
-# The FILE_VERSION_FILTER tag can be used to specify a program or script that
-# doxygen should invoke to get the current version for each file (typically from the
-# version control system). Doxygen will invoke the program by executing (via
-# popen()) the command <command> <input-file>, where <command> is the value of
-# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file
-# provided by doxygen. Whatever the progam writes to standard output
-# is used as the file version. See the manual for examples.
-
-#FILE_VERSION_FILTER =
-
-#---------------------------------------------------------------------------
-# configuration options related to warning and progress messages
-#---------------------------------------------------------------------------
-
-# The QUIET tag can be used to turn on/off the messages that are generated
-# by doxygen. Possible values are YES and NO. If left blank NO is used.
-
-QUIET = NO
-
-# The WARNINGS tag can be used to turn on/off the warning messages that are
-# generated by doxygen. Possible values are YES and NO. If left blank
-# NO is used.
-
-WARNINGS = NO
-
-# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings
-# for undocumented members. If EXTRACT_ALL is set to YES then this flag will
-# automatically be disabled.
-
-WARN_IF_UNDOCUMENTED = NO
-
-# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for
-# potential errors in the documentation, such as not documenting some
-# parameters in a documented function, or documenting parameters that
-# don't exist or using markup commands wrongly.
-
-WARN_IF_DOC_ERROR = YES
-
-# This WARN_NO_PARAMDOC option can be abled to get warnings for
-# functions that are documented, but have no documentation for their parameters
-# or return value. If set to NO (the default) doxygen will only warn about
-# wrong or incomplete parameter documentation, but not about the absence of
-# documentation.
-
-#WARN_NO_PARAMDOC = NO
-
-# The WARN_FORMAT tag determines the format of the warning messages that
-# doxygen can produce. The string should contain the $file, $line, and $text
-# tags, which will be replaced by the file and line number from which the
-# warning originated and the warning text. Optionally the format may contain
-# $version, which will be replaced by the version of the file (if it could
-# be obtained via FILE_VERSION_FILTER)
-
-WARN_FORMAT =
-
-# The WARN_LOGFILE tag can be used to specify a file to which warning
-# and error messages should be written. If left blank the output is written
-# to stderr.
-
-WARN_LOGFILE =
-
-#---------------------------------------------------------------------------
-# configuration options related to the input files
-#---------------------------------------------------------------------------
-
-# The INPUT tag can be used to specify the files and/or directories that contain
-# documented source files. You may enter file names like "myfile.cpp" or
-# directories like "/usr/src/myproject". Separate the files or directories
-# with spaces.
-
-INPUT = @abs_top_srcdir@/include \
- @abs_top_srcdir@/lib \
- @abs_top_srcdir@/docs/doxygen.intro
-
-# If the value of the INPUT tag contains directories, you can use the
-# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
-# and *.h) to filter out the source-files in the directories. If left
-# blank the following patterns are tested:
-# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx
-# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm
-
-FILE_PATTERNS =
-
-# The RECURSIVE tag can be used to turn specify whether or not subdirectories
-# should be searched for input files as well. Possible values are YES and NO.
-# If left blank NO is used.
-
-RECURSIVE = YES
-
-# The EXCLUDE tag can be used to specify files and/or directories that should
-# excluded from the INPUT source files. This way you can easily exclude a
-# subdirectory from a directory tree whose root is specified with the INPUT tag.
-
-EXCLUDE =
-
-# The EXCLUDE_SYMLINKS tag can be used select whether or not files or
-# directories that are symbolic links (a Unix filesystem feature) are excluded
-# from the input.
-
-EXCLUDE_SYMLINKS = NO
-
-# If the value of the INPUT tag contains directories, you can use the
-# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
-# certain files from those directories. Note that the wildcards are matched
-# against the file with absolute path, so to exclude all test directories
-# for example use the pattern */test/*
-
-EXCLUDE_PATTERNS =
-
-# The EXAMPLE_PATH tag can be used to specify one or more files or
-# directories that contain example code fragments that are included (see
-# the \include command).
-
-EXAMPLE_PATH = @abs_top_srcdir@/examples
-
-# If the value of the EXAMPLE_PATH tag contains directories, you can use the
-# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
-# and *.h) to filter out the source-files in the directories. If left
-# blank all files are included.
-
-EXAMPLE_PATTERNS =
-
-# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
-# searched for input files to be used with the \include or \dontinclude
-# commands irrespective of the value of the RECURSIVE tag.
-# Possible values are YES and NO. If left blank NO is used.
-
-EXAMPLE_RECURSIVE = YES
-
-# The IMAGE_PATH tag can be used to specify one or more files or
-# directories that contain image that are included in the documentation (see
-# the \image command).
-
-IMAGE_PATH = @abs_top_srcdir@/docs/img
-
-# The INPUT_FILTER tag can be used to specify a program that doxygen should
-# invoke to filter for each input file. Doxygen will invoke the filter program
-# by executing (via popen()) the command <filter> <input-file>, where <filter>
-# is the value of the INPUT_FILTER tag, and <input-file> is the name of an
-# input file. Doxygen will then use the output that the filter program writes
-# to standard output. If FILTER_PATTERNS is specified, this tag will be
-# ignored.
-
-INPUT_FILTER =
-
-# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
-# basis. Doxygen will compare the file name with each pattern and apply the
-# filter if there is a match. The filters are a list of the form:
-# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further
-# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER
-# is applied to all files.
-
-FILTER_PATTERNS =
-
-# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
-# INPUT_FILTER) will be used to filter the input files when producing source
-# files to browse (i.e. when SOURCE_BROWSER is set to YES).
-
-FILTER_SOURCE_FILES = NO
-
-#---------------------------------------------------------------------------
-# configuration options related to source browsing
-#---------------------------------------------------------------------------
-
-# If the SOURCE_BROWSER tag is set to YES then a list of source files will
-# be generated. Documented entities will be cross-referenced with these sources.
-# Note: To get rid of all source code in the generated output, make sure also
-# VERBATIM_HEADERS is set to NO.
-
-SOURCE_BROWSER = YES
-
-# Setting the INLINE_SOURCES tag to YES will include the body
-# of functions and classes directly in the documentation.
-
-INLINE_SOURCES = NO
-
-# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
-# doxygen to hide any special comment blocks from generated source code
-# fragments. Normal C and C++ comments will always remain visible.
-
-STRIP_CODE_COMMENTS = NO
-
-# If the REFERENCED_BY_RELATION tag is set to YES (the default)
-# then for each documented function all documented
-# functions referencing it will be listed.
-
-REFERENCED_BY_RELATION = YES
-
-# If the REFERENCES_RELATION tag is set to YES (the default)
-# then for each documented function all documented entities
-# called/used by that function will be listed.
-
-REFERENCES_RELATION = YES
-
-# If the USE_HTAGS tag is set to YES then the references to source code
-# will point to the HTML generated by the htags(1) tool instead of doxygen
-# built-in source browser. The htags tool is part of GNU's global source
-# tagging system (see http://www.gnu.org/software/global/global.html). You
-# will need version 4.8.6 or higher.
-
-#USE_HTAGS = NO
-
-# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen
-# will generate a verbatim copy of the header file for each class for
-# which an include is specified. Set to NO to disable this.
-
-VERBATIM_HEADERS = YES
-
-#---------------------------------------------------------------------------
-# configuration options related to the alphabetical class index
-#---------------------------------------------------------------------------
-
-# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index
-# of all compounds will be generated. Enable this if the project
-# contains a lot of classes, structs, unions or interfaces.
-
-ALPHABETICAL_INDEX = YES
-
-# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
-# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
-# in which this list will be split (can be a number in the range [1..20])
-
-COLS_IN_ALPHA_INDEX = 4
-
-# In case all classes in a project start with a common prefix, all
-# classes will be put under the same header in the alphabetical index.
-# The IGNORE_PREFIX tag can be used to specify one or more prefixes that
-# should be ignored while generating the index headers.
-
-IGNORE_PREFIX = llvm::
-
-#---------------------------------------------------------------------------
-# configuration options related to the HTML output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_HTML tag is set to YES (the default) Doxygen will
-# generate HTML output.
-
-GENERATE_HTML = YES
-
-# The HTML_OUTPUT tag is used to specify where the HTML docs will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
-# put in front of it. If left blank `html' will be used as the default path.
-
-HTML_OUTPUT = html
-
-# The HTML_FILE_EXTENSION tag can be used to specify the file extension for
-# each generated HTML page (for example: .htm,.php,.asp). If it is left blank
-# doxygen will generate files with .html extension.
-
-HTML_FILE_EXTENSION = .html
-
-# The HTML_HEADER tag can be used to specify a personal HTML header for
-# each generated HTML page. If it is left blank doxygen will generate a
-# standard header.
-
-HTML_HEADER = @abs_top_srcdir@/docs/doxygen.header
-
-# The HTML_FOOTER tag can be used to specify a personal HTML footer for
-# each generated HTML page. If it is left blank doxygen will generate a
-# standard footer.
-
-HTML_FOOTER = @abs_top_srcdir@/docs/doxygen.footer
-
-# The HTML_STYLESHEET tag can be used to specify a user-defined cascading
-# style sheet that is used by each HTML page. It can be used to
-# fine-tune the look of the HTML output. If the tag is left blank doxygen
-# will generate a default style sheet. Note that doxygen will try to copy
-# the style sheet file to the HTML output directory, so don't put your own
-# stylesheet in the HTML output directory as well, or it will be erased!
-
-HTML_STYLESHEET = @abs_top_srcdir@/docs/doxygen.css
-
-# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,
-# files or namespaces will be aligned in HTML using tables. If set to
-# NO a bullet list will be used.
-
-HTML_ALIGN_MEMBERS = YES
-
-# If the GENERATE_HTMLHELP tag is set to YES, additional index files
-# will be generated that can be used as input for tools like the
-# Microsoft HTML help workshop to generate a compressed HTML help file (.chm)
-# of the generated HTML documentation.
-
-GENERATE_HTMLHELP = NO
-
-# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can
-# be used to specify the file name of the resulting .chm file. You
-# can add a path in front of the file if the result should not be
-# written to the html output directory.
-
-CHM_FILE =
-
-# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can
-# be used to specify the location (absolute path including file name) of
-# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run
-# the HTML help compiler on the generated index.hhp.
-
-HHC_LOCATION =
-
-# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag
-# controls if a separate .chi index file is generated (YES) or that
-# it should be included in the master .chm file (NO).
-
-GENERATE_CHI = NO
-
-# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag
-# controls whether a binary table of contents is generated (YES) or a
-# normal table of contents (NO) in the .chm file.
-
-BINARY_TOC = NO
-
-# The TOC_EXPAND flag can be set to YES to add extra items for group members
-# to the contents of the HTML help documentation and to the tree view.
-
-TOC_EXPAND = NO
-
-# The DISABLE_INDEX tag can be used to turn on/off the condensed index at
-# top of each HTML page. The value NO (the default) enables the index and
-# the value YES disables it.
-
-DISABLE_INDEX = NO
-
-# This tag can be used to set the number of enum values (range [1..20])
-# that doxygen will group on one line in the generated HTML documentation.
-
-ENUM_VALUES_PER_LINE = 4
-
-# If the GENERATE_TREEVIEW tag is set to YES, a side panel will be
-# generated containing a tree-like index structure (just like the one that
-# is generated for HTML Help). For this to work a browser that supports
-# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+,
-# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are
-# probably better off using the HTML help feature.
-
-GENERATE_TREEVIEW = NO
-
-# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
-# used to set the initial width (in pixels) of the frame in which the tree
-# is shown.
-
-TREEVIEW_WIDTH = 250
-
-#---------------------------------------------------------------------------
-# configuration options related to the LaTeX output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
-# generate Latex output.
-
-GENERATE_LATEX = NO
-
-# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
-# put in front of it. If left blank `latex' will be used as the default path.
-
-LATEX_OUTPUT =
-
-# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
-# invoked. If left blank `latex' will be used as the default command name.
-
-LATEX_CMD_NAME = latex
-
-# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to
-# generate index for LaTeX. If left blank `makeindex' will be used as the
-# default command name.
-
-MAKEINDEX_CMD_NAME = makeindex
-
-# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact
-# LaTeX documents. This may be useful for small projects and may help to
-# save some trees in general.
-
-COMPACT_LATEX = NO
-
-# The PAPER_TYPE tag can be used to set the paper type that is used
-# by the printer. Possible values are: a4, a4wide, letter, legal and
-# executive. If left blank a4wide will be used.
-
-PAPER_TYPE = letter
-
-# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
-# packages that should be included in the LaTeX output.
-
-EXTRA_PACKAGES =
-
-# The LATEX_HEADER tag can be used to specify a personal LaTeX header for
-# the generated latex document. The header should contain everything until
-# the first chapter. If it is left blank doxygen will generate a
-# standard header. Notice: only use this tag if you know what you are doing!
-
-LATEX_HEADER =
-
-# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
-# is prepared for conversion to pdf (using ps2pdf). The pdf file will
-# contain links (just like the HTML output) instead of page references
-# This makes the output suitable for online browsing using a pdf viewer.
-
-PDF_HYPERLINKS = NO
-
-# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of
-# plain latex in the generated Makefile. Set this option to YES to get a
-# higher quality PDF documentation.
-
-USE_PDFLATEX = NO
-
-# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
-# command to the generated LaTeX files. This will instruct LaTeX to keep
-# running if errors occur, instead of asking the user for help.
-# This option is also used when generating formulas in HTML.
-
-LATEX_BATCHMODE = NO
-
-# If LATEX_HIDE_INDICES is set to YES then doxygen will not
-# include the index chapters (such as File Index, Compound Index, etc.)
-# in the output.
-
-LATEX_HIDE_INDICES = NO
-
-#---------------------------------------------------------------------------
-# configuration options related to the RTF output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output
-# The RTF output is optimized for Word 97 and may not look very pretty with
-# other RTF readers or editors.
-
-GENERATE_RTF = NO
-
-# The RTF_OUTPUT tag is used to specify where the RTF docs will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
-# put in front of it. If left blank `rtf' will be used as the default path.
-
-RTF_OUTPUT =
-
-# If the COMPACT_RTF tag is set to YES Doxygen generates more compact
-# RTF documents. This may be useful for small projects and may help to
-# save some trees in general.
-
-COMPACT_RTF = NO
-
-# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated
-# will contain hyperlink fields. The RTF file will
-# contain links (just like the HTML output) instead of page references.
-# This makes the output suitable for online browsing using WORD or other
-# programs which support those fields.
-# Note: wordpad (write) and others do not support links.
-
-RTF_HYPERLINKS = NO
-
-# Load stylesheet definitions from file. Syntax is similar to doxygen's
-# config file, i.e. a series of assignments. You only have to provide
-# replacements, missing definitions are set to their default value.
-
-RTF_STYLESHEET_FILE =
-
-# Set optional variables used in the generation of an rtf document.
-# Syntax is similar to doxygen's config file.
-
-RTF_EXTENSIONS_FILE =
-
-#---------------------------------------------------------------------------
-# configuration options related to the man page output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_MAN tag is set to YES (the default) Doxygen will
-# generate man pages
-
-GENERATE_MAN = NO
-
-# The MAN_OUTPUT tag is used to specify where the man pages will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
-# put in front of it. If left blank `man' will be used as the default path.
-
-MAN_OUTPUT =
-
-# The MAN_EXTENSION tag determines the extension that is added to
-# the generated man pages (default is the subroutine's section .3)
-
-MAN_EXTENSION =
-
-# If the MAN_LINKS tag is set to YES and Doxygen generates man output,
-# then it will generate one additional man file for each entity
-# documented in the real man page(s). These additional files
-# only source the real man page, but without them the man command
-# would be unable to find the correct page. The default is NO.
-
-MAN_LINKS = NO
-
-#---------------------------------------------------------------------------
-# configuration options related to the XML output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_XML tag is set to YES Doxygen will
-# generate an XML file that captures the structure of
-# the code including all documentation.
-
-GENERATE_XML = NO
-
-# The XML_OUTPUT tag is used to specify where the XML pages will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
-# put in front of it. If left blank `xml' will be used as the default path.
-
-XML_OUTPUT = xml
-
-# The XML_SCHEMA tag can be used to specify an XML schema,
-# which can be used by a validating XML parser to check the
-# syntax of the XML files.
-
-XML_SCHEMA =
-
-# The XML_DTD tag can be used to specify an XML DTD,
-# which can be used by a validating XML parser to check the
-# syntax of the XML files.
-
-XML_DTD =
-
-# If the XML_PROGRAMLISTING tag is set to YES Doxygen will
-# dump the program listings (including syntax highlighting
-# and cross-referencing information) to the XML output. Note that
-# enabling this will significantly increase the size of the XML output.
-
-XML_PROGRAMLISTING = YES
-
-#---------------------------------------------------------------------------
-# configuration options for the AutoGen Definitions output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will
-# generate an AutoGen Definitions (see autogen.sf.net) file
-# that captures the structure of the code including all
-# documentation. Note that this feature is still experimental
-# and incomplete at the moment.
-
-GENERATE_AUTOGEN_DEF = NO
-
-#---------------------------------------------------------------------------
-# configuration options related to the Perl module output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_PERLMOD tag is set to YES Doxygen will
-# generate a Perl module file that captures the structure of
-# the code including all documentation. Note that this
-# feature is still experimental and incomplete at the
-# moment.
-
-GENERATE_PERLMOD = NO
-
-# If the PERLMOD_LATEX tag is set to YES Doxygen will generate
-# the necessary Makefile rules, Perl scripts and LaTeX code to be able
-# to generate PDF and DVI output from the Perl module output.
-
-PERLMOD_LATEX = NO
-
-# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be
-# nicely formatted so it can be parsed by a human reader. This is useful
-# if you want to understand what is going on. On the other hand, if this
-# tag is set to NO the size of the Perl module output will be much smaller
-# and Perl will parse it just the same.
-
-PERLMOD_PRETTY = YES
-
-# The names of the make variables in the generated doxyrules.make file
-# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX.
-# This is useful so different doxyrules.make files included by the same
-# Makefile don't overwrite each other's variables.
-
-PERLMOD_MAKEVAR_PREFIX =
-
-#---------------------------------------------------------------------------
-# Configuration options related to the preprocessor
-#---------------------------------------------------------------------------
-
-# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will
-# evaluate all C-preprocessor directives found in the sources and include
-# files.
-
-ENABLE_PREPROCESSING = YES
-
-# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro
-# names in the source code. If set to NO (the default) only conditional
-# compilation will be performed. Macro expansion can be done in a controlled
-# way by setting EXPAND_ONLY_PREDEF to YES.
-
-MACRO_EXPANSION = NO
-
-# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
-# then the macro expansion is limited to the macros specified with the
-# PREDEFINED and EXPAND_AS_PREDEFINED tags.
-
-EXPAND_ONLY_PREDEF = NO
-
-# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
-# in the INCLUDE_PATH (see below) will be search if a #include is found.
-
-SEARCH_INCLUDES = YES
-
-# The INCLUDE_PATH tag can be used to specify one or more directories that
-# contain include files that are not input files but should be processed by
-# the preprocessor.
-
-INCLUDE_PATH = ../include
-
-# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
-# patterns (like *.h and *.hpp) to filter out the header-files in the
-# directories. If left blank, the patterns specified with FILE_PATTERNS will
-# be used.
-
-INCLUDE_FILE_PATTERNS =
-
-# The PREDEFINED tag can be used to specify one or more macro names that
-# are defined before the preprocessor is started (similar to the -D option of
-# gcc). The argument of the tag is a list of macros of the form: name
-# or name=definition (no spaces). If the definition and the = are
-# omitted =1 is assumed. To prevent a macro definition from being
-# undefined via #undef or recursively expanded use the := operator
-# instead of the = operator.
-
-PREDEFINED =
-
-# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
-# this tag can be used to specify a list of macro names that should be expanded.
-# The macro definition that is found in the sources will be used.
-# Use the PREDEFINED tag if you want to use a different macro definition.
-
-EXPAND_AS_DEFINED =
-
-# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
-# doxygen's preprocessor will remove all function-like macros that are alone
-# on a line, have an all uppercase name, and do not end with a semicolon. Such
-# function macros are typically used for boiler-plate code, and will confuse
-# the parser if not removed.
-
-SKIP_FUNCTION_MACROS = YES
-
-#---------------------------------------------------------------------------
-# Configuration::additions related to external references
-#---------------------------------------------------------------------------
-
-# The TAGFILES option can be used to specify one or more tagfiles.
-# Optionally an initial location of the external documentation
-# can be added for each tagfile. The format of a tag file without
-# this location is as follows:
-# TAGFILES = file1 file2 ...
-# Adding location for the tag files is done as follows:
-# TAGFILES = file1=loc1 "file2 = loc2" ...
-# where "loc1" and "loc2" can be relative or absolute paths or
-# URLs. If a location is present for each tag, the installdox tool
-# does not have to be run to correct the links.
-# Note that each tag file must have a unique name
-# (where the name does NOT include the path)
-# If a tag file is not located in the directory in which doxygen
-# is run, you must also specify the path to the tagfile here.
-
-TAGFILES =
-
-# When a file name is specified after GENERATE_TAGFILE, doxygen will create
-# a tag file that is based on the input files it reads.
-
-GENERATE_TAGFILE =
-
-# If the ALLEXTERNALS tag is set to YES all external classes will be listed
-# in the class index. If set to NO only the inherited external classes
-# will be listed.
-
-ALLEXTERNALS = YES
-
-# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed
-# in the modules index. If set to NO, only the current project's groups will
-# be listed.
-
-EXTERNAL_GROUPS = YES
-
-# The PERL_PATH should be the absolute path and name of the perl script
-# interpreter (i.e. the result of `which perl').
-
-PERL_PATH =
-
-#---------------------------------------------------------------------------
-# Configuration options related to the dot tool
-#---------------------------------------------------------------------------
-
-# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
-# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base
-# or super classes. Setting the tag to NO turns the diagrams off. Note that
-# this option is superseded by the HAVE_DOT option below. This is only a
-# fallback. It is recommended to install and use dot, since it yields more
-# powerful graphs.
-
-CLASS_DIAGRAMS = YES
-
-# If set to YES, the inheritance and collaboration graphs will hide
-# inheritance and usage relations if the target is undocumented
-# or is not a class.
-
-HIDE_UNDOC_RELATIONS = NO
-
-# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
-# available from the path. This tool is part of Graphviz, a graph visualization
-# toolkit from AT&T and Lucent Bell Labs. The other options in this section
-# have no effect if this option is set to NO (the default)
-
-HAVE_DOT = YES
-
-# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
-# will generate a graph for each documented class showing the direct and
-# indirect inheritance relations. Setting this tag to YES will force the
-# the CLASS_DIAGRAMS tag to NO.
-
-CLASS_GRAPH = YES
-
-# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen
-# will generate a graph for each documented class showing the direct and
-# indirect implementation dependencies (inheritance, containment, and
-# class references variables) of the class with other documented classes.
-
-COLLABORATION_GRAPH = YES
-
-# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen
-# will generate a graph for groups, showing the direct groups dependencies
-
-#GROUP_GRAPHS = YES
-
-# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
-# collaboration diagrams in a style similar to the OMG's Unified Modeling
-# Language.
-
-UML_LOOK = NO
-
-# If set to YES, the inheritance and collaboration graphs will show the
-# relations between templates and their instances.
-
-TEMPLATE_RELATIONS = YES
-
-# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT
-# tags are set to YES then doxygen will generate a graph for each documented
-# file showing the direct and indirect include dependencies of the file with
-# other documented files.
-
-INCLUDE_GRAPH = YES
-
-# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and
-# HAVE_DOT tags are set to YES then doxygen will generate a graph for each
-# documented header file showing the documented files that directly or
-# indirectly include this file.
-
-INCLUDED_BY_GRAPH = YES
-
-# If the CALL_GRAPH and HAVE_DOT tags are set to YES then doxygen will
-# generate a call dependency graph for every global function or class method.
-# Note that enabling this option will significantly increase the time of a run.
-# So in most cases it will be better to enable call graphs for selected
-# functions only using the \callgraph command.
-
-CALL_GRAPH = NO
-
-# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
-# will graphical hierarchy of all classes instead of a textual one.
-
-GRAPHICAL_HIERARCHY = YES
-
-# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES
-# then doxygen will show the dependencies a directory has on other directories
-# in a graphical way. The dependency relations are determined by the #include
-# relations between the files in the directories.
-
-#DIRECTORY_GRAPH = YES
-
-# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
-# generated by dot. Possible values are png, jpg, or gif
-# If left blank png will be used.
-
-DOT_IMAGE_FORMAT = png
-
-# The tag DOT_PATH can be used to specify the path where the dot tool can be
-# found. If left blank, it is assumed the dot tool can be found in the path.
-
-DOT_PATH = @DOT@
-
-# The DOTFILE_DIRS tag can be used to specify one or more directories that
-# contain dot files that are included in the documentation (see the
-# \dotfile command).
-
-DOTFILE_DIRS =
-
-# The MAX_DOT_GRAPH_WIDTH tag can be used to set the maximum allowed width
-# (in pixels) of the graphs generated by dot. If a graph becomes larger than
-# this value, doxygen will try to truncate the graph, so that it fits within
-# the specified constraint. Beware that most browsers cannot cope with very
-# large images.
-
-MAX_DOT_GRAPH_WIDTH = 1024
-
-# The MAX_DOT_GRAPH_HEIGHT tag can be used to set the maximum allows height
-# (in pixels) of the graphs generated by dot. If a graph becomes larger than
-# this value, doxygen will try to truncate the graph, so that it fits within
-# the specified constraint. Beware that most browsers cannot cope with very
-# large images.
-
-MAX_DOT_GRAPH_HEIGHT = 1024
-
-# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the
-# graphs generated by dot. A depth value of 3 means that only nodes reachable
-# from the root by following a path via at most 3 edges will be shown. Nodes
-# that lay further from the root node will be omitted. Note that setting this
-# option to 1 or 2 may greatly reduce the computation time needed for large
-# code bases. Also note that a graph may be further truncated if the graph's
-# image dimensions are not sufficient to fit the graph (see MAX_DOT_GRAPH_WIDTH
-# and MAX_DOT_GRAPH_HEIGHT). If 0 is used for the depth value (the default),
-# the graph is not depth-constrained.
-
-MAX_DOT_GRAPH_DEPTH = 0
-
-# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
-# background. This is disabled by default, which results in a white background.
-# Warning: Depending on the platform used, enabling this option may lead to
-# badly anti-aliased labels on the edges of a graph (i.e. they become hard to
-# read).
-
-#DOT_TRANSPARENT = NO
-
-# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output
-# files in one run (i.e. multiple -o and -T options on the command line). This
-# makes dot run faster, but since only newer versions of dot (>1.8.10)
-# support this, this feature is disabled by default.
-
-#DOT_MULTI_TARGETS = NO
-
-# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will
-# generate a legend page explaining the meaning of the various boxes and
-# arrows in the dot generated graphs.
-
-GENERATE_LEGEND = YES
-
-# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will
-# remove the intermediate dot files that are used to generate
-# the various graphs.
-
-DOT_CLEANUP = YES
-
-#---------------------------------------------------------------------------
-# Configuration::additions related to the search engine
-#---------------------------------------------------------------------------
-
-# The SEARCHENGINE tag specifies whether or not a search engine should be
-# used. If set to NO the values of all tags below this one will be ignored.
-
-SEARCHENGINE = NO
diff --git a/release_23/docs/doxygen.css b/release_23/docs/doxygen.css
deleted file mode 100644
index 83b049b5f1b7..000000000000
--- a/release_23/docs/doxygen.css
+++ /dev/null
@@ -1,378 +0,0 @@
-BODY,H1,H2,H3,H4,H5,H6,P,CENTER,TD,TH,UL,DL,DIV {
- font-family: Verdana,Geneva,Arial,Helvetica,sans-serif;
-}
-BODY,TD {
- font-size: 90%;
-}
-H1 {
- text-align: center;
- font-size: 140%;
- font-weight: bold;
-}
-H2 {
- font-size: 120%;
- font-style: italic;
-}
-H3 {
- font-size: 100%;
-}
-CAPTION { font-weight: bold }
-DIV.qindex {
- width: 100%;
- background-color: #eeeeff;
- border: 1px solid #b0b0b0;
- text-align: center;
- margin: 2px;
- padding: 2px;
- line-height: 140%;
-}
-DIV.nav {
- width: 100%;
- background-color: #eeeeff;
- border: 1px solid #b0b0b0;
- text-align: center;
- margin: 2px;
- padding: 2px;
- line-height: 140%;
-}
-DIV.navtab {
- background-color: #eeeeff;
- border: 1px solid #b0b0b0;
- text-align: center;
- margin: 2px;
- margin-right: 15px;
- padding: 2px;
-}
-TD.navtab {
- font-size: 70%;
-}
-A.qindex {
- text-decoration: none;
- font-weight: bold;
- color: #1A419D;
-}
-A.qindex:visited {
- text-decoration: none;
- font-weight: bold;
- color: #1A419D
-}
-A.qindex:hover {
- text-decoration: none;
- background-color: #ddddff;
-}
-A.qindexHL {
- text-decoration: none;
- font-weight: bold;
- background-color: #6666cc;
- color: #ffffff;
- border: 1px double #9295C2;
-}
-A.qindexHL:hover {
- text-decoration: none;
- background-color: #6666cc;
- color: #ffffff;
-}
-A.qindexHL:visited {
- text-decoration: none; background-color: #6666cc; color: #ffffff }
-A.el { text-decoration: none; font-weight: bold }
-A.elRef { font-weight: bold }
-A.code:link { text-decoration: none; font-weight: normal; color: #0000FF}
-A.code:visited { text-decoration: none; font-weight: normal; color: #0000FF}
-A.codeRef:link { font-weight: normal; color: #0000FF}
-A.codeRef:visited { font-weight: normal; color: #0000FF}
-A:hover { text-decoration: none; background-color: #f2f2ff }
-DL.el { margin-left: -1cm }
-.fragment {
- font-family: Fixed, monospace;
- font-size: 95%;
-}
-PRE.fragment {
- border: 1px solid #CCCCCC;
- background-color: #f5f5f5;
- margin-top: 4px;
- margin-bottom: 4px;
- margin-left: 2px;
- margin-right: 8px;
- padding-left: 6px;
- padding-right: 6px;
- padding-top: 4px;
- padding-bottom: 4px;
-}
-DIV.ah { background-color: black; font-weight: bold; color: #ffffff; margin-bottom: 3px; margin-top: 3px }
-TD.md { background-color: #F4F4FB; font-weight: bold; }
-TD.mdPrefix {
- background-color: #F4F4FB;
- color: #606060;
- font-size: 80%;
-}
-TD.mdname1 { background-color: #F4F4FB; font-weight: bold; color: #602020; }
-TD.mdname { background-color: #F4F4FB; font-weight: bold; color: #602020; width: 600px; }
-DIV.groupHeader {
- margin-left: 16px;
- margin-top: 12px;
- margin-bottom: 6px;
- font-weight: bold;
-}
-DIV.groupText { margin-left: 16px; font-style: italic; font-size: 90% }
-BODY {
- background: white;
- color: black;
- margin-right: 20px;
- margin-left: 20px;
-}
-TD.indexkey {
- background-color: #eeeeff;
- font-weight: bold;
- padding-right : 10px;
- padding-top : 2px;
- padding-left : 10px;
- padding-bottom : 2px;
- margin-left : 0px;
- margin-right : 0px;
- margin-top : 2px;
- margin-bottom : 2px;
- border: 1px solid #CCCCCC;
-}
-TD.indexvalue {
- background-color: #eeeeff;
- font-style: italic;
- padding-right : 10px;
- padding-top : 2px;
- padding-left : 10px;
- padding-bottom : 2px;
- margin-left : 0px;
- margin-right : 0px;
- margin-top : 2px;
- margin-bottom : 2px;
- border: 1px solid #CCCCCC;
-}
-TR.memlist {
- background-color: #f0f0f0;
-}
-P.formulaDsp { text-align: center; }
-IMG.formulaDsp { }
-IMG.formulaInl { vertical-align: middle; }
-SPAN.keyword { color: #008000 }
-SPAN.keywordtype { color: #604020 }
-SPAN.keywordflow { color: #e08000 }
-SPAN.comment { color: #800000 }
-SPAN.preprocessor { color: #806020 }
-SPAN.stringliteral { color: #002080 }
-SPAN.charliteral { color: #008080 }
-.mdTable {
- border: 1px solid #868686;
- background-color: #F4F4FB;
-}
-.mdRow {
- padding: 8px 10px;
-}
-.mdescLeft {
- padding: 0px 8px 4px 8px;
- font-size: 80%;
- font-style: italic;
- background-color: #FAFAFA;
- border-top: 1px none #E0E0E0;
- border-right: 1px none #E0E0E0;
- border-bottom: 1px none #E0E0E0;
- border-left: 1px none #E0E0E0;
- margin: 0px;
-}
-.mdescRight {
- padding: 0px 8px 4px 8px;
- font-size: 80%;
- font-style: italic;
- background-color: #FAFAFA;
- border-top: 1px none #E0E0E0;
- border-right: 1px none #E0E0E0;
- border-bottom: 1px none #E0E0E0;
- border-left: 1px none #E0E0E0;
- margin: 0px;
-}
-.memItemLeft {
- padding: 1px 0px 0px 8px;
- margin: 4px;
- border-top-width: 1px;
- border-right-width: 1px;
- border-bottom-width: 1px;
- border-left-width: 1px;
- border-top-color: #E0E0E0;
- border-right-color: #E0E0E0;
- border-bottom-color: #E0E0E0;
- border-left-color: #E0E0E0;
- border-top-style: solid;
- border-right-style: none;
- border-bottom-style: none;
- border-left-style: none;
- background-color: #FAFAFA;
- font-size: 80%;
-}
-.memItemRight {
- padding: 1px 8px 0px 8px;
- margin: 4px;
- border-top-width: 1px;
- border-right-width: 1px;
- border-bottom-width: 1px;
- border-left-width: 1px;
- border-top-color: #E0E0E0;
- border-right-color: #E0E0E0;
- border-bottom-color: #E0E0E0;
- border-left-color: #E0E0E0;
- border-top-style: solid;
- border-right-style: none;
- border-bottom-style: none;
- border-left-style: none;
- background-color: #FAFAFA;
- font-size: 80%;
-}
-.memTemplItemLeft {
- padding: 1px 0px 0px 8px;
- margin: 4px;
- border-top-width: 1px;
- border-right-width: 1px;
- border-bottom-width: 1px;
- border-left-width: 1px;
- border-top-color: #E0E0E0;
- border-right-color: #E0E0E0;
- border-bottom-color: #E0E0E0;
- border-left-color: #E0E0E0;
- border-top-style: none;
- border-right-style: none;
- border-bottom-style: none;
- border-left-style: none;
- background-color: #FAFAFA;
- font-size: 80%;
-}
-.memTemplItemRight {
- padding: 1px 8px 0px 8px;
- margin: 4px;
- border-top-width: 1px;
- border-right-width: 1px;
- border-bottom-width: 1px;
- border-left-width: 1px;
- border-top-color: #E0E0E0;
- border-right-color: #E0E0E0;
- border-bottom-color: #E0E0E0;
- border-left-color: #E0E0E0;
- border-top-style: none;
- border-right-style: none;
- border-bottom-style: none;
- border-left-style: none;
- background-color: #FAFAFA;
- font-size: 80%;
-}
-.memTemplParams {
- padding: 1px 0px 0px 8px;
- margin: 4px;
- border-top-width: 1px;
- border-right-width: 1px;
- border-bottom-width: 1px;
- border-left-width: 1px;
- border-top-color: #E0E0E0;
- border-right-color: #E0E0E0;
- border-bottom-color: #E0E0E0;
- border-left-color: #E0E0E0;
- border-top-style: solid;
- border-right-style: none;
- border-bottom-style: none;
- border-left-style: none;
- color: #606060;
- background-color: #FAFAFA;
- font-size: 80%;
-}
-.search { color: #003399;
- font-weight: bold;
-}
-FORM.search {
- margin-bottom: 0px;
- margin-top: 0px;
-}
-INPUT.search { font-size: 75%;
- color: #000080;
- font-weight: normal;
- background-color: #eeeeff;
-}
-TD.tiny { font-size: 75%;
-}
-a {
- color: #252E78;
-}
-a:visited {
- color: #3D2185;
-}
-.dirtab { padding: 4px;
- border-collapse: collapse;
- border: 1px solid #b0b0b0;
-}
-TH.dirtab { background: #eeeeff;
- font-weight: bold;
-}
-HR { height: 1px;
- border: none;
- border-top: 1px solid black;
-}
-
-/*
- * LLVM Modifications.
- * Note: Everything above here is generated with "doxygen -w htlm" command. See
- * "doxygen --help" for details. What follows are CSS overrides for LLVM
- * specific formatting. We want to keep the above so it can be replaced with
- * subsequent doxygen upgrades.
- */
-
-.footer {
- font-size: 80%;
- font-weight: bold;
- text-align: center;
- vertical-align: middle;
-}
-.title {
- font-size: 25pt;
- color: black; background: url("../img/lines.gif");
- font-weight: bold;
- border-width: 1px;
- border-style: solid none solid none;
- text-align: center;
- vertical-align: middle;
- padding-left: 8pt;
- padding-top: 1px;
- padding-bottom: 2px
-}
-A:link {
- cursor: pointer;
- text-decoration: none;
- font-weight: bolder;
-}
-A:visited {
- cursor: pointer;
- text-decoration: underline;
- font-weight: bolder;
-}
-A:hover {
- cursor: pointer;
- text-decoration: underline;
- font-weight: bolder;
-}
-A:active {
- cursor: pointer;
- text-decoration: underline;
- font-weight: bolder;
- font-style: italic;
-}
-H1 {
- text-align: center;
- font-size: 140%;
- font-weight: bold;
-}
-H2 {
- font-size: 120%;
- font-style: italic;
-}
-H3 {
- font-size: 100%;
-}
-A.qindex {}
-A.qindexRef {}
-A.el { text-decoration: none; font-weight: bold }
-A.elRef { font-weight: bold }
-A.code { text-decoration: none; font-weight: normal; color: #4444ee }
-A.codeRef { font-weight: normal; color: #4444ee }
diff --git a/release_23/docs/doxygen.footer b/release_23/docs/doxygen.footer
deleted file mode 100644
index ddf752379cbc..000000000000
--- a/release_23/docs/doxygen.footer
+++ /dev/null
@@ -1,13 +0,0 @@
-<hr>
-<p class="footer">
-Generated on $datetime for <a href="http://llvm.org">$projectname</a> by
-<a href="http://www.doxygen.org"><img src="doxygen.png" alt="Doxygen"
-align="middle" border="0"/>$doxygenversion</a><br/>
-Copyright &copy; 2003-2007 University of Illinois at Urbana-Champaign.
-All Rights Reserved.</p>
-
-<hr>
-<!--#include virtual="/attrib.incl" -->
-
-</body>
-</html>
diff --git a/release_23/docs/doxygen.header b/release_23/docs/doxygen.header
deleted file mode 100644
index a520434d6c25..000000000000
--- a/release_23/docs/doxygen.header
+++ /dev/null
@@ -1,9 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
-<html><head>
-<meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"/>
-<meta name="keywords" content="LLVM,Low Level Virtual Machine,C++,doxygen,API,documentation"/>
-<meta name="description" content="C++ source code API documentation for the Low Level Virtual Machine (LLVM)."/>
-<title>LLVM: $title</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css"/>
-</head><body>
-<p class="title">LLVM API Documentation</p>
diff --git a/release_23/docs/doxygen.intro b/release_23/docs/doxygen.intro
deleted file mode 100644
index 547730cba79c..000000000000
--- a/release_23/docs/doxygen.intro
+++ /dev/null
@@ -1,18 +0,0 @@
-/// @mainpage Low Level Virtual Machine
-///
-/// @section main_intro Introduction
-/// Welcome to the Low Level Virtual Machine (LLVM).
-///
-/// This documentation describes the @b internal software that makes
-/// up LLVM, not the @b external use of LLVM. There are no instructions
-/// here on how to use LLVM, only the APIs that make up the software. For usage
-/// instructions, please see the programmer's guide or reference manual.
-///
-/// @section main_caveat Caveat
-/// This documentation is generated directly from the source code with doxygen.
-/// Since LLVM is constantly under active development, what you're about to
-/// read is out of date! However, it may still be useful since certain portions
-/// of LLVM are very stable.
-///
-/// @section main_changelog Change Log
-/// - Original content written 12/30/2003 by Reid Spencer
diff --git a/release_23/docs/img/Debugging.gif b/release_23/docs/img/Debugging.gif
deleted file mode 100644
index 662d35a6735d..000000000000
--- a/release_23/docs/img/Debugging.gif
+++ /dev/null
Binary files differ
diff --git a/release_23/docs/img/libdeps.gif b/release_23/docs/img/libdeps.gif
deleted file mode 100644
index c5c0ed4c403f..000000000000
--- a/release_23/docs/img/libdeps.gif
+++ /dev/null
Binary files differ
diff --git a/release_23/docs/img/lines.gif b/release_23/docs/img/lines.gif
deleted file mode 100644
index 88f491edc302..000000000000
--- a/release_23/docs/img/lines.gif
+++ /dev/null
Binary files differ
diff --git a/release_23/docs/img/objdeps.gif b/release_23/docs/img/objdeps.gif
deleted file mode 100644
index 57c3e2e60d4e..000000000000
--- a/release_23/docs/img/objdeps.gif
+++ /dev/null
Binary files differ
diff --git a/release_23/docs/img/venusflytrap.jpg b/release_23/docs/img/venusflytrap.jpg
deleted file mode 100644
index 59340ef3ee12..000000000000
--- a/release_23/docs/img/venusflytrap.jpg
+++ /dev/null
Binary files differ
diff --git a/release_23/docs/index.html b/release_23/docs/index.html
deleted file mode 100644
index 15247ee57507..000000000000
--- a/release_23/docs/index.html
+++ /dev/null
@@ -1,279 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
- "http://www.w3.org/TR/html4/strict.dtd">
-<html>
-<head>
- <title>Documentation for the LLVM System</title>
- <link rel="stylesheet" href="llvm.css" type="text/css">
-</head>
-<body>
-
-<div class="doc_title">Documentation for the LLVM System</div>
-
-<div class="doc_text">
-<table class="layout" width="95%"><tr class="layout"><td class="left">
-<ul>
- <li><a href="#llvmdesign">LLVM Design</a></li>
- <li><a href="/pubs/">LLVM Publications</a></li>
- <li><a href="#userguide">LLVM User Guides</a></li>
- <li><a href="#llvmprog">General LLVM Programming Documentation</a></li>
- <li><a href="#subsystems">LLVM Subsystem Documentation</a></li>
- <li><a href="#maillist">LLVM Mailing Lists</a></li>
-</ul>
-</td><td class="right">
- <form action="http://www.google.com/search" method=get>
- <input type="hidden" name="sitesearch" value="llvm.org/docs">
- <input type=text name=q size=25><br>
- <input type=submit value="Search the LLVM Docs" name="submit">
- </form>
-</td></tr></table>
-</div>
-
-<div class="doc_author">
- <p>Written by <a href="http://llvm.org">The LLVM Team</a></p>
-</div>
-
-<!--=======================================================================-->
-<div class="doc_section"><a name="llvmdesign">LLVM Design &amp; Overview</a></div>
-<!--=======================================================================-->
-
-<ul>
-<li><a href="LangRef.html">LLVM Language Reference Manual</a> - Defines the LLVM
-intermediate representation.</li>
-<li><a href="http://llvm.org/pubs/2006-04-25-GelatoLLVMIntro.html">Introduction to the LLVM Compiler Infrastructure</a> - Presentation describing LLVM.</li>
-<li><a href="http://llvm.org/pubs/2004-09-22-LCPCLLVMTutorial.html">The LLVM Compiler Framework and
-Infrastructure Tutorial</a> - Tutorial for writing passes, exploring the system.</li>
-<li><a href="http://llvm.org/pubs/2004-01-30-CGO-LLVM.html">LLVM: A Compilation Framework for
-Lifelong Program Analysis &amp; Transformation</a> - Design overview.</li>
-<li><a href="http://llvm.org/pubs/2002-12-LattnerMSThesis.html">LLVM: An Infrastructure for
-Multi-Stage Optimization</a> - More details (somewhat old now).</li>
-<li><a href="GetElementPtr.html">GetElementPtr FAQ</a> - Answers to some very
-frequent questions about LLVM's most frequently misunderstood instruction.</li>
-</ul>
-
-<!--=======================================================================-->
-<div class="doc_section"><a name="userguide">LLVM User Guides</a></div>
-<!--=======================================================================-->
-
-<ul>
-<li><a href="GettingStarted.html">The LLVM Getting Started Guide</a> -
-Discusses how to get up and running quickly with the LLVM infrastructure.
-Everything from unpacking and compilation of the distribution to execution of
-some tools.</li>
-
-<li><a href="GettingStartedVS.html">Getting Started with the LLVM System using
-Microsoft Visual Studio</a> - An addendum to the main Getting Started guide for
-those using Visual Studio on Windows.</li>
-
-<li><a href="tutorial/">LLVM Tutorial</a> - A walk through the process of using
-LLVM for a custom language, and the facilities LLVM offers in tutorial form.</li>
-<li><a href="DeveloperPolicy.html">Developer Policy</a> - The LLVM project's
-policy towards developers and their contributions.</li>
-
-<li><a href="/docs/CommandGuide/index.html">LLVM Command Guide</a> - A reference
-manual for the LLVM command line utilities ("man" pages for LLVM tools).<br/>
-Current tools:
- <a href="/cmds/llvm-ar.html">llvm-ar</a>,
- <a href="/cmds/llvm-as.html">llvm-as</a>,
- <a href="/cmds/llvm-dis.html">llvm-dis</a>,
- <a href="/cmds/llvm-extract.html">llvm-extract</a>,
- <a href="/cmds/llvm-ld.html">llvm-ld</a>,
- <a href="/cmds/llvm-link.html">llvm-link</a>,
- <a href="/cmds/llvm-nm.html">llvm-nm</a>,
- <a href="/cmds/llvm-prof.html">llvm-prof</a>,
- <a href="/cmds/llvm-ranlib.html">llvm-ranlib</a>,
- <a href="/cmds/opt.html">opt</a>,
- <a href="/cmds/llc.html">llc</a>,
- <a href="/cmds/lli.html">lli</a>,
- <a href="/cmds/llvmc.html">llvmc</a>
- <a href="/cmds/llvmgcc.html">llvm-gcc</a>,
- <a href="/cmds/llvmgxx.html">llvm-g++</a>,
- <a href="/cmds/stkrc.html">stkrc</a>,
- <a href="/cmds/bugpoint.html">bugpoint</a>,
- <a href="/cmds/llvm-bcanalyzer.html">llvm-bcanalyzer</a>,
-</li>
-
-<li><a href="Passes.html">LLVM's Analysis and Transform Passes</a> - A list of
-optimizations and analyses implemented in LLVM.</li>
-
-<li><a href="FAQ.html">Frequently Asked Questions</a> - A list of common
-questions and problems and their solutions.</li>
-
-<li><a href="ReleaseNotes.html">Release notes for the current release</a>
-- This describes new features, known bugs, and other limitations.</li>
-
-<li><a href="HowToSubmitABug.html">How to Submit A Bug Report</a> -
-Instructions for properly submitting information about any bugs you run into in
-the LLVM system.</li>
-
-<li><a href="TestingGuide.html">LLVM Test Suite Guide</a> - A reference
-manual for using the LLVM test suite.</li>
-
-<li><a href="GCCFEBuildInstrs.html">How to build the C/C++ front-end</a> -
-Instructions for building the front-end from source.</li>
-
-<li><a href="Lexicon.html">The LLVM Lexicon</a> - Definition of acronyms, terms
-and concepts used in LLVM.</li>
-
-<li><a name="irc">You can probably find help on the unofficial LLVM IRC
-channel</a>. We often are on irc.oftc.net in the #llvm channel. If you are
-using the mozilla browser, and have chatzilla installed, you can <a
-href="irc://irc.oftc.net/llvm">join #llvm on irc.oftc.net</a> directly.</li>
-
-</ul>
-
-
-<!--=======================================================================-->
-<div class="doc_section"><a name="llvmprog">General LLVM Programming Documentation</a></div>
-<!--=======================================================================-->
-
-<ul>
-<li><a href="LangRef.html">LLVM Language Reference Manual</a> - Defines the LLVM
-intermediate representation and the assembly form of the different nodes.</li>
-
-<li><a href="ProgrammersManual.html">The LLVM Programmers Manual</a> -
-Introduction to the general layout of the LLVM sourcebase, important classes
-and APIs, and some tips &amp; tricks.</li>
-
-<li><a href="Projects.html">LLVM Project Guide</a> - How-to guide and
-templates for new projects that <em>use</em> the LLVM infrastructure. The
-templates (directory organization, Makefiles, and test tree) allow the project
-code to be located outside (or inside) the <tt>llvm/</tt> tree, while using LLVM
-header files and libraries.</li>
-
-<li><a href="MakefileGuide.html">LLVM Makefile Guide</a> - Describes how the
-LLVM makefiles work and how to use them.</li>
-
-<li><a href="CommandLine.html">CommandLine library Reference Manual</a> -
-Provides information on using the command line parsing library.</li>
-
-<li><a href="CodingStandards.html">LLVM Coding standards</a> -
-Details the LLVM coding standards and provides useful information on writing
-efficient C++ code.</li>
-
-<li><a href="ExtendingLLVM.html">Extending LLVM</a> - Look here to see how
-to add instructions and intrinsics to LLVM.</li>
-
-<li><a href="UsingLibraries.html">Using LLVM Libraries</a> - Look here to
-understand how to use the libraries produced when LLVM is compiled.</li>
-
-<li><a href="HowToReleaseLLVM.html">How To Release LLVM To The Public</a> - This
-is a guide to preparing LLVM releases. Most developers can ignore it.</li>
-
-<li><a href="http://llvm.org/doxygen/">Doxygen generated
-documentation</a> (<a
-href="http://llvm.org/doxygen/inherits.html">classes</a>)
-
-(<a href="http://llvm.org/doxygen/doxygen.tar.gz">tarball</a>)
-</li>
-
-<li><a href="http://llvm.org/viewvc/">ViewVC Repository Browser</a></li>
-
-</ul>
-
-<!--=======================================================================-->
-<div class="doc_section"><a name="subsystems">LLVM Subsystem Documentation</a></div>
-<!--=======================================================================-->
-
-<ul>
-
-<li><a href="WritingAnLLVMPass.html">Writing an LLVM Pass</a> - Information
-on how to write LLVM transformations and analyses.</li>
-
-<li><a href="WritingAnLLVMBackend.html">Writing an LLVM Backend</a> - Information
-on how to write LLVM backends for machine targets.</li>
-
-<li><a href="CodeGenerator.html">The LLVM Target-Independent Code
-Generator</a> - The design and implementation of the LLVM code generator.
-Useful if you are working on retargetting LLVM to a new architecture, designing
-a new codegen pass, or enhancing existing components.</li>
-
-<li><a href="TableGenFundamentals.html">TableGen Fundamentals</a> -
-Describes the TableGen tool, which is used heavily by the LLVM code
-generator.</li>
-
-<li><a href="AliasAnalysis.html">Alias Analysis in LLVM</a> - Information
-on how to write a new alias analysis implementation or how to use existing
-analyses.</li>
-
-<li><a href="Stacker.html">The Stacker Chronicles</a> - This document
-describes both the Stacker language and LLVM frontend, but also some details
-about LLVM useful for those writing front-ends.</li>
-
-<li><a href="GarbageCollection.html">Accurate Garbage Collection with
-LLVM</a> - The interfaces source-language compilers should use for compiling
-GC'd programs.</li>
-
-<li><a href="SourceLevelDebugging.html">Source Level Debugging with
-LLVM</a> - This document describes the design and philosophy behind the LLVM
-source-level debugger.</li>
-
-<li><a href="ExceptionHandling.html">Zero Cost Exception handling in LLVM</a>
-- This document describes the design and implementation of exception handling
-in LLVM.</li>
-
-<li><a href="Bugpoint.html">Bugpoint</a> - automatic bug finder and test-case
-reducer description and usage information.</li>
-
-<li><a href="CompilerDriver.html">Compiler Driver (llvmc)</a> - This document
-describes the design and configuration of the LLVM compiler driver tool,
-<tt>llvmc</tt>.</li>
-
-<li><a href="BitCodeFormat.html">LLVM Bitcode File Format</a></li>
-
-<li><a href="SystemLibrary.html">System Library</a> - This document describes
-the LLVM System Library (<tt>lib/System</tt>) and how to keep LLVM source code
-portable</li>
-
-<li><a href="LinkTimeOptimization.html">Link Time Optimization</a> - This
-document describes the interface between LLVM intermodular optimizer and
-the linker and its design</li>
-
-</ul>
-
-
-<!--=======================================================================-->
-<div class="doc_section"><a name="maillist">LLVM Mailing Lists</a></div>
-<!--=======================================================================-->
-
-<ul>
-<li>The <a href="http://mail.cs.uiuc.edu/mailman/listinfo/llvm-announce">
-LLVM Announcements List</a>: This is a low volume list that provides important
-announcements regarding LLVM. It gets email about once a month.</li>
-
-<li>The <a href="http://mail.cs.uiuc.edu/mailman/listinfo/llvmdev">Developer's
-List</a>: This list is for people who want to be included in technical
-discussions of LLVM. People post to this list when they have questions about
-writing code for or using the LLVM tools. It is relatively low volume.</li>
-
-<li>The <a href="http://mail.cs.uiuc.edu/pipermail/llvmbugs/">Bugs &amp;
-Patches Archive</a>: This list gets emailed every time a bug is opened and
-closed, and when people submit patches to be included in LLVM. It is higher
-volume than the LLVMdev list.</li>
-
-<li>The <a href="http://mail.cs.uiuc.edu/pipermail/llvm-commits/">Commits
-Archive</a>: This list contains all commit messages that are made when LLVM
-developers commit code changes to the repository. It is useful for those who
-want to stay on the bleeding edge of LLVM development. This list is very high
-volume.</li>
-
-<li>The <a href="http://mail.cs.uiuc.edu/pipermail/llvm-testresults/">
-Test Results Archive</a>: A message is automatically sent to this list by every
-active nightly tester when it completes. As such, this list gets email several
-times each day, making it a high volume list.</li>
-
-</ul>
-
-<!-- *********************************************************************** -->
-
-<hr>
-<address>
- <a href="http://jigsaw.w3.org/css-validator/check/referer"><img
- src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"></a>
- <a href="http://validator.w3.org/check/referer"><img
- src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!"></a>
-
- <a href="http://llvm.org">LLVM Compiler Infrastructure</a><br>
- Last modified: $Date$
-</address>
-</body></html>
-
diff --git a/release_23/docs/llvm.css b/release_23/docs/llvm.css
deleted file mode 100644
index 3564171126d6..000000000000
--- a/release_23/docs/llvm.css
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * LLVM documentation style sheet
- */
-
-/* Common styles */
-.body { color: black; background: white; margin: 0 0 0 0 }
-
-/* No borders on image links */
-a:link img, a:visited img {border-style: none}
-
-address img { float: right; width: 88px; height: 31px; }
-address { clear: right; }
-
-TR, TD { border: 2px solid gray; padding: 4pt 4pt 2pt 2pt; }
-TH { border: 2px solid gray; font-weight: bold; font-size: 105%;
- background: url("img/lines.gif");
- font-family: "Georgia,Palatino,Times,Roman,SanSerif"; text-align:center;
- vertical-align: middle; }
-TABLE { text-align: center; border: 2px solid black;
- border-collapse: collapse; margin-top: 1em; margin-left: 1em;
- margin-right: 1em; margin-bottom: 1em; }
-/*
- * Documentation
- */
-/* Common for title and header */
-.doc_title, .doc_section, .doc_subsection {
- color: black; background: url("img/lines.gif");
- font-family: "Georgia,Palatino,Times,Roman,SanSerif"; font-weight: bold;
- border-width: 1px;
- border-style: solid none solid none;
- text-align: center;
- vertical-align: middle;
- padding-left: 8pt;
- padding-top: 1px;
- padding-bottom: 2px
-}
-
-.doc_title { text-align: left; font-size: 25pt }
-.doc_section { text-align: center; font-size: 22pt;
- margin: 20pt 0pt 5pt 0pt; }
-.doc_subsection { width: 75%;
- text-align: left; font-size: 12pt; padding: 4pt 4pt 4pt 4pt;
- margin: 1.5em 0.5em 0.5em 0.5em }
-
-.doc_subsubsection { margin: 2.0em 0.5em 0.5em 0.5em;
- font-weight: bold; font-style: oblique;
- border-bottom: 1px solid #999999; font-size: 12pt;
- width: 75%; }
-.doc_author { text-align: left; font-weight: bold; padding-left: 20pt }
-.doc_text { text-align: left; padding-left: 20pt; padding-right: 10pt }
-
-.doc_footer { text-align: left; padding: 0 0 0 0 }
-
-.doc_hilite { color: blue; font-weight: bold; }
-
-.doc_table { text-align: center; width: 90%;
- padding: 1px 1px 1px 1px; border: 1px; }
-
-.doc_table_nw { text-align: center; border: 1px;
- padding: 1px 1px 1px 1px; }
-
-.doc_warning { color: red; font-weight: bold }
-
-.doc_code { border: solid 1px gray; background: #eeeeee;
- margin: 0 1em 0 1em;
- padding: 0 1em 0 1em;
- display:table;
- }
-.doc_notes { background: #fafafa; border: 1px solid #cecece; padding: 0.1em }
-
-TABLE.layout { text-align: left; border: none; border-collapse: collapse;
- padding: 4px 4px 4px 4px; }
-TR.layout { border: none; padding: 4pt 4pt 2pt 2pt; }
-TD.layout { border: none; padding: 4pt 4pt 2pt 2pt;
- vertical-align: top;}
-TD.left { border: none; padding: 4pt 4pt 2pt 2pt; text-align: left;
- vertical-align: top;}
-TD.right { border: none; padding: 4pt 4pt 2pt 2pt; text-align: right;
- vertical-align: top;}
-TH.layout { border: none; font-weight: bold; font-size: 105%;
- text-align:center; vertical-align: middle; }
-
-/* Left align table cell */
-.td_left { border: 2px solid gray; text-align: left; }
diff --git a/release_23/docs/tutorial/JITTutorial1.html b/release_23/docs/tutorial/JITTutorial1.html
deleted file mode 100644
index e280d927aca0..000000000000
--- a/release_23/docs/tutorial/JITTutorial1.html
+++ /dev/null
@@ -1,196 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
- "http://www.w3.org/TR/html4/strict.dtd">
-
-<html>
-<head>
- <title>LLVM Tutorial 1: A First Function</title>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <meta name="author" content="Owen Anderson">
- <meta name="description"
- content="LLVM Tutorial 1: A First Function.">
- <link rel="stylesheet" href="../llvm.css" type="text/css">
-</head>
-
-<body>
-
-<div class="doc_title"> LLVM Tutorial 1: A First Function </div>
-
-<div class="doc_author">
- <p>Written by <a href="mailto:owen@apple.com">Owen Anderson</a></p>
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section"><a name="intro">A First Function</a></div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>For starters, let's consider a relatively straightforward function that takes three integer parameters and returns an arithmetic combination of them. This is nice and simple, especially since it involves no control flow:</p>
-
-<div class="doc_code">
-<pre>
-int mul_add(int x, int y, int z) {
- return x * y + z;
-}
-</pre>
-</div>
-
-<p>As a preview, the LLVM IR we’re going to end up generating for this function will look like:</p>
-
-<div class="doc_code">
-<pre>
-define i32 @mul_add(i32 %x, i32 %y, i32 %z) {
-entry:
- %tmp = mul i32 %x, %y
- %tmp2 = add i32 %tmp, %z
- ret i32 %tmp2
-}
-</pre>
-</div>
-
-<p>If you're unsure what the above code says, skim through the <a href="../LangRef.html">LLVM Language Reference Manual</a> and convince yourself that the above LLVM IR is actually equivalent to the original function. Once you’re satisfied with that, let’s move on to actually generating it programmatically!</p>
-
-<p>Of course, before we can start, we need to <code>#include</code> the appropriate LLVM header files:</p>
-
-<div class="doc_code">
-<pre>
-#include &lt;llvm/Module.h&gt;
-#include &lt;llvm/Function.h&gt;
-#include &lt;llvm/PassManager.h&gt;
-#include &lt;llvm/CallingConv.h&gt;
-#include &lt;llvm/Analysis/Verifier.h&gt;
-#include &lt;llvm/Assembly/PrintModulePass.h&gt;
-#include &lt;llvm/Support/IRBuilder.h&gt;
-</pre>
-</div>
-
-<p>Now, let’s get started on our real program. Here’s what our basic <code>main()</code> will look like:</p>
-
-<div class="doc_code">
-<pre>
-using namespace llvm;
-
-Module* makeLLVMModule();
-
-int main(int argc, char**argv) {
- Module* Mod = makeLLVMModule();
-
- verifyModule(*Mod, PrintMessageAction);
-
- PassManager PM;
- PM.add(new PrintModulePass(&amp;llvm::cout));
- PM.run(*Mod);
-
- return 0;
-}
-</pre>
-</div>
-
-<p>The first segment is pretty simple: it creates an LLVM “module.†In LLVM, a module represents a single unit of code that is to be processed together. A module contains things like global variables, function declarations, and implementations. Here we’ve declared a <code>makeLLVMModule()</code> function to do the real work of creating the module. Don’t worry, we’ll be looking at that one next!</p>
-
-<p>The second segment runs the LLVM module verifier on our newly created module. While this probably isn’t really necessary for a simple module like this one, it’s always a good idea, especially if you’re generating LLVM IR based on some input. The verifier will print an error message if your LLVM module is malformed in any way.</p>
-
-<p>Finally, we instantiate an LLVM <code>PassManager</code> and run the <code>PrintModulePass</code> on our module. LLVM uses an explicit pass infrastructure to manage optimizations and various other things. A <code>PassManager</code>, as should be obvious from its name, manages passes: it is responsible for scheduling them, invoking them, and insuring the proper disposal after we’re done with them. For this example, we’re just using a trivial pass that prints out our module in textual form.</p>
-
-<p>Now onto the interesting part: creating and populating a module. Here’s the first chunk of our <code>makeLLVMModule()</code>:</p>
-
-<div class="doc_code">
-<pre>
-Module* makeLLVMModule() {
- // Module Construction
- Module* mod = new Module("test");
-</pre>
-</div>
-
-<p>Exciting, isn’t it!? All we’re doing here is instantiating a module and giving it a name. The name isn’t particularly important unless you’re going to be dealing with multiple modules at once.</p>
-
-<div class="doc_code">
-<pre>
- Constant* c = mod-&gt;getOrInsertFunction("mul_add",
- /*ret type*/ IntegerType::get(32),
- /*args*/ IntegerType::get(32),
- IntegerType::get(32),
- IntegerType::get(32),
- /*varargs terminated with null*/ NULL);
-
- Function* mul_add = cast&lt;Function&gt;(c);
- mul_add-&gt;setCallingConv(CallingConv::C);
-</pre>
-</div>
-
-<p>We construct our <code>Function</code> by calling <code>getOrInsertFunction()</code> on our module, passing in the name, return type, and argument types of the function. In the case of our <code>mul_add</code> function, that means one 32-bit integer for the return value and three 32-bit integers for the arguments.</p>
-
-<p>You'll notice that <code>getOrInsertFunction()</code> doesn't actually return a <code>Function*</code>. This is because <code>getOrInsertFunction()</code> will return a cast of the existing function if the function already existed with a different prototype. Since we know that there's not already a <code>mul_add</code> function, we can safely just cast <code>c</code> to a <code>Function*</code>.
-
-<p>In addition, we set the calling convention for our new function to be the C calling convention. This isn’t strictly necessary, but it insures that our new function will interoperate properly with C code, which is a good thing.</p>
-
-<div class="doc_code">
-<pre>
- Function::arg_iterator args = mul_add-&gt;arg_begin();
- Value* x = args++;
- x-&gt;setName("x");
- Value* y = args++;
- y-&gt;setName("y");
- Value* z = args++;
- z-&gt;setName("z");
-</pre>
-</div>
-
-<p>While we’re setting up our function, let’s also give names to the parameters. This also isn’t strictly necessary (LLVM will generate names for them if you don’t specify them), but it’ll make looking at our output somewhat more pleasant. To name the parameters, we iterate over the arguments of our function and call <code>setName()</code> on them. We’ll also keep the pointer to <code>x</code>, <code>y</code>, and <code>z</code> around, since we’ll need them when we get around to creating instructions.</p>
-
-<p>Great! We have a function now. But what good is a function if it has no body? Before we start working on a body for our new function, we need to recall some details of the LLVM IR. The IR, being an abstract assembly language, represents control flow using jumps (we call them branches), both conditional and unconditional. The straight-line sequences of code between branches are called basic blocks, or just blocks. To create a body for our function, we fill it with blocks:</p>
-
-<div class="doc_code">
-<pre>
- BasicBlock* block = BasicBlock::Create("entry", mul_add);
- IRBuilder builder(block);
-</pre>
-</div>
-
-<p>We create a new basic block, as you might expect, by calling its constructor. All we need to tell it is its name and the function to which it belongs. In addition, we’re creating an <code>IRBuilder</code> object, which is a convenience interface for creating instructions and appending them to the end of a block. Instructions can be created through their constructors as well, but some of their interfaces are quite complicated. Unless you need a lot of control, using <code>IRBuilder</code> will make your life simpler.</p>
-
-<div class="doc_code">
-<pre>
- Value* tmp = builder.CreateBinOp(Instruction::Mul,
- x, y, "tmp");
- Value* tmp2 = builder.CreateBinOp(Instruction::Add,
- tmp, z, "tmp2");
-
- builder.CreateRet(tmp2);
-
- return mod;
-}
-</pre>
-</div>
-
-<p>The final step in creating our function is to create the instructions that make it up. Our <code>mul_add</code> function is composed of just three instructions: a multiply, an add, and a return. <code>IRBuilder</code> gives us a simple interface for constructing these instructions and appending them to the “entry†block. Each of the calls to <code>IRBuilder</code> returns a <code>Value*</code> that represents the value yielded by the instruction. You’ll also notice that, above, <code>x</code>, <code>y</code>, and <code>z</code> are also <code>Value*</code>’s, so it’s clear that instructions operate on <code>Value*</code>’s.</p>
-
-<p>And that’s it! Now you can compile and run your code, and get a wonderful textual print out of the LLVM IR we saw at the beginning. To compile, use the following command line as a guide:</p>
-
-<div class="doc_code">
-<pre>
-# c++ -g tut1.cpp `llvm-config --cxxflags --ldflags --libs core` -o tut1
-# ./tut1
-</pre>
-</div>
-
-<p>The <code>llvm-config</code> utility is used to obtain the necessary GCC-compatible compiler flags for linking with LLVM. For this example, we only need the 'core' library. We'll use others once we start adding optimizers and the JIT engine.</p>
-
-<a href="JITTutorial2.html">Next: A More Complicated Function</a>
-</div>
-
-<!-- *********************************************************************** -->
-<hr>
-<address>
- <a href="http://jigsaw.w3.org/css-validator/check/referer"><img
- src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"></a>
- <a href="http://validator.w3.org/check/referer"><img
- src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!"></a>
-
- <a href="mailto:owen@apple.com">Owen Anderson</a><br>
- <a href="http://llvm.org">The LLVM Compiler Infrastructure</a><br>
- Last modified: $Date: 2007-10-17 11:05:13 -0700 (Wed, 17 Oct 2007) $
-</address>
-
-</body>
-</html>
diff --git a/release_23/docs/tutorial/JITTutorial2-1.png b/release_23/docs/tutorial/JITTutorial2-1.png
deleted file mode 100644
index eb21695f684a..000000000000
--- a/release_23/docs/tutorial/JITTutorial2-1.png
+++ /dev/null
Binary files differ
diff --git a/release_23/docs/tutorial/JITTutorial2.html b/release_23/docs/tutorial/JITTutorial2.html
deleted file mode 100644
index 1a4b05d45859..000000000000
--- a/release_23/docs/tutorial/JITTutorial2.html
+++ /dev/null
@@ -1,190 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
- "http://www.w3.org/TR/html4/strict.dtd">
-
-<html>
-<head>
- <title>LLVM Tutorial 2: A More Complicated Function</title>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <meta name="author" content="Owen Anderson">
- <meta name="description"
- content="LLVM Tutorial 2: A More Complicated Function.">
- <link rel="stylesheet" href="../llvm.css" type="text/css">
-</head>
-
-<body>
-
-<div class="doc_title"> LLVM Tutorial 2: A More Complicated Function </div>
-
-<div class="doc_author">
- <p>Written by <a href="mailto:owen@apple.com">Owen Anderson</a></p>
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section"><a name="intro">A First Function</a></div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>Now that we understand the basics of creating functions in LLVM, let's move on to a more complicated example: something with control flow. As an example, let's consider Euclid's Greatest Common Denominator (GCD) algorithm:</p>
-
-<div class="doc_code">
-<pre>
-unsigned gcd(unsigned x, unsigned y) {
- if(x == y) {
- return x;
- } else if(x &lt; y) {
- return gcd(x, y - x);
- } else {
- return gcd(x - y, y);
- }
-}
-</pre>
-</div>
-
-<p>With this example, we'll learn how to create functions with multiple blocks and control flow, and how to make function calls within your LLVM code. For starters, consider the diagram below.</p>
-
-<div style="text-align: center;"><img src="JITTutorial2-1.png" alt="GCD CFG" width="60%"></div>
-
-<p>This is a graphical representation of a program in LLVM IR. It places each basic block on a node of a graph and uses directed edges to indicate flow control. These blocks will be serialized when written to a text or bitcode file, but it is often useful conceptually to think of them as a graph. Again, if you are unsure about the code in the diagram, you should skim through the <a href="../LangRef.html">LLVM Language Reference Manual</a> and convince yourself that it is, in fact, the GCD algorithm.</p>
-
-<p>The first part of our code is practically the same as from the first tutorial. The same basic setup is required: creating a module, verifying it, and running the <code>PrintModulePass</code> on it. Even the first segment of <code>makeLLVMModule()</code> looks essentially the same, except that <code>gcd</code> takes one fewer parameter than <code>mul_add</code>.</p>
-
-<div class="doc_code">
-<pre>
-#include &lt;llvm/Module.h&gt;
-#include &lt;llvm/Function.h&gt;
-#include &lt;llvm/PassManager.h&gt;
-#include &lt;llvm/Analysis/Verifier.h&gt;
-#include &lt;llvm/Assembly/PrintModulePass.h&gt;
-#include &lt;llvm/Support/IRBuilder.h&gt;
-
-using namespace llvm;
-
-Module* makeLLVMModule();
-
-int main(int argc, char**argv) {
- Module* Mod = makeLLVMModule();
-
- verifyModule(*Mod, PrintMessageAction);
-
- PassManager PM;
- PM.add(new PrintModulePass(&amp;llvm::cout));
- PM.run(*Mod);
-
- return 0;
-}
-
-Module* makeLLVMModule() {
- Module* mod = new Module(&quot;tut2&quot;);
-
- Constant* c = mod-&gt;getOrInsertFunction(&quot;gcd&quot;,
- IntegerType::get(32),
- IntegerType::get(32),
- IntegerType::get(32),
- NULL);
- Function* gcd = cast&lt;Function&gt;(c);
-
- Function::arg_iterator args = gcd-&gt;arg_begin();
- Value* x = args++;
- x-&gt;setName(&quot;x&quot;);
- Value* y = args++;
- y-&gt;setName(&quot;y&quot;);
-</pre>
-</div>
-
-<p>Here, however, is where our code begins to diverge from the first tutorial. Because <code>gcd</code> has control flow, it is composed of multiple blocks interconnected by branching (<code>br</code>) instructions. For those familiar with assembly language, a block is similar to a labeled set of instructions. For those not familiar with assembly language, a block is basically a set of instructions that can be branched to and is executed linearly until the block is terminated by one of a small number of control flow instructions, such as <code>br</code> or <code>ret</code>.</p>
-
-<p>Blocks correspond to the nodes in the diagram we looked at in the beginning of this tutorial. From the diagram, we can see that this function contains five blocks, so we'll go ahead and create them. Note that we're making use of LLVM's automatic name uniquing in this code sample, since we're giving two blocks the same name.</p>
-
-<div class="doc_code">
-<pre>
- BasicBlock* entry = BasicBlock::Create(&quot;entry&quot;, gcd);
- BasicBlock* ret = BasicBlock::Create(&quot;return&quot;, gcd);
- BasicBlock* cond_false = BasicBlock::Create(&quot;cond_false&quot;, gcd);
- BasicBlock* cond_true = BasicBlock::Create(&quot;cond_true&quot;, gcd);
- BasicBlock* cond_false_2 = BasicBlock::Create(&quot;cond_false&quot;, gcd);
-</pre>
-</div>
-
-<p>Now we're ready to begin generating code! We'll start with the <code>entry</code> block. This block corresponds to the top-level if-statement in the original C code, so we need to compare <code>x</code> and <code>y</code>. To achieve this, we perform an explicit comparison using <code>ICmpEQ</code>. <code>ICmpEQ</code> stands for an <em>integer comparison for equality</em> and returns a 1-bit integer result. This 1-bit result is then used as the input to a conditional branch, with <code>ret</code> as the <code>true</code> and <code>cond_false</code> as the <code>false</code> case.</p>
-
-<div class="doc_code">
-<pre>
- IRBuilder builder(entry);
- Value* xEqualsY = builder.CreateICmpEQ(x, y, &quot;tmp&quot;);
- builder.CreateCondBr(xEqualsY, ret, cond_false);
-</pre>
-</div>
-
-<p>Our next block, <code>ret</code>, is pretty simple: it just returns the value of <code>x</code>. Recall that this block is only reached if <code>x == y</code>, so this is the correct behavior. Notice that instead of creating a new <code>IRBuilder</code> for each block, we can use <code>SetInsertPoint</code> to retarget our existing one. This saves on construction and memory allocation costs.</p>
-
-<div class="doc_code">
-<pre>
- builder.SetInsertPoint(ret);
- builder.CreateRet(x);
-</pre>
-</div>
-
-<p><code>cond_false</code> is a more interesting block: we now know that <code>x != y</code>, so we must branch again to determine which of <code>x</code> and <code>y</code> is larger. This is achieved using the <code>ICmpULT</code> instruction, which stands for <em>integer comparison for unsigned less-than</em>. In LLVM, integer types do not carry sign; a 32-bit integer pseudo-register can interpreted as signed or unsigned without casting. Whether a signed or unsigned interpretation is desired is specified in the instruction. This is why several instructions in the LLVM IR, such as integer less-than, include a specifier for signed or unsigned.</p>
-
-<p>Also note that we're again making use of LLVM's automatic name uniquing, this time at a register level. We've deliberately chosen to name every instruction "tmp" to illustrate that LLVM will give them all unique names without getting confused.</p>
-
-<div class="doc_code">
-<pre>
- builder.SetInsertPoint(cond_false);
- Value* xLessThanY = builder.CreateICmpULT(x, y, &quot;tmp&quot;);
- builder.CreateCondBr(xLessThanY, cond_true, cond_false_2);
-</pre>
-</div>
-
-<p>Our last two blocks are quite similar; they're both recursive calls to <code>gcd</code> with different parameters. To create a call instruction, we have to create a <code>vector</code> (or any other container with <code>InputInterator</code>s) to hold the arguments. We then pass in the beginning and ending iterators for this vector.</p>
-
-<div class="doc_code">
-<pre>
- builder.SetInsertPoint(cond_true);
- Value* yMinusX = builder.CreateSub(y, x, &quot;tmp&quot;);
- std::vector&lt;Value*&gt; args1;
- args1.push_back(x);
- args1.push_back(yMinusX);
- Value* recur_1 = builder.CreateCall(gcd, args1.begin(), args1.end(), &quot;tmp&quot;);
- builder.CreateRet(recur_1);
-
- builder.SetInsertPoint(cond_false_2);
- Value* xMinusY = builder.CreateSub(x, y, &quot;tmp&quot;);
- std::vector&lt;Value*&gt; args2;
- args2.push_back(xMinusY);
- args2.push_back(y);
- Value* recur_2 = builder.CreateCall(gcd, args2.begin(), args2.end(), &quot;tmp&quot;);
- builder.CreateRet(recur_2);
-
- return mod;
-}
-</pre>
-</div>
-
-<p>And that's it! You can compile and execute your code in the same way as before, by doing:</p>
-
-<div class="doc_code">
-<pre>
-# c++ -g tut2.cpp `llvm-config --cxxflags --ldflags --libs core` -o tut2
-# ./tut2
-</pre>
-</div>
-
-</div>
-
-<!-- *********************************************************************** -->
-<hr>
-<address>
- <a href="http://jigsaw.w3.org/css-validator/check/referer"><img
- src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"></a>
- <a href="http://validator.w3.org/check/referer"><img
- src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!"></a>
-
- <a href="mailto:owen@apple.com">Owen Anderson</a><br>
- <a href="http://llvm.org">The LLVM Compiler Infrastructure</a><br>
- Last modified: $Date: 2007-10-17 11:05:13 -0700 (Wed, 17 Oct 2007) $
-</address>
-
-</body>
-</html>
diff --git a/release_23/docs/tutorial/LangImpl1.html b/release_23/docs/tutorial/LangImpl1.html
deleted file mode 100644
index 5e1786cb00be..000000000000
--- a/release_23/docs/tutorial/LangImpl1.html
+++ /dev/null
@@ -1,348 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
- "http://www.w3.org/TR/html4/strict.dtd">
-
-<html>
-<head>
- <title>Kaleidoscope: Tutorial Introduction and the Lexer</title>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <meta name="author" content="Chris Lattner">
- <link rel="stylesheet" href="../llvm.css" type="text/css">
-</head>
-
-<body>
-
-<div class="doc_title">Kaleidoscope: Tutorial Introduction and the Lexer</div>
-
-<ul>
-<li><a href="index.html">Up to Tutorial Index</a></li>
-<li>Chapter 1
- <ol>
- <li><a href="#intro">Tutorial Introduction</a></li>
- <li><a href="#language">The Basic Language</a></li>
- <li><a href="#lexer">The Lexer</a></li>
- </ol>
-</li>
-<li><a href="LangImpl2.html">Chapter 2</a>: Implementing a Parser and AST</li>
-</ul>
-
-<div class="doc_author">
- <p>Written by <a href="mailto:sabre@nondot.org">Chris Lattner</a></p>
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section"><a name="intro">Tutorial Introduction</a></div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>Welcome to the "Implementing a language with LLVM" tutorial. This tutorial
-runs through the implementation of a simple language, showing how fun and
-easy it can be. This tutorial will get you up and started as well as help to
-build a framework you can extend to other languages. The code in this tutorial
-can also be used as a playground to hack on other LLVM specific things.
-</p>
-
-<p>
-The goal of this tutorial is to progressively unveil our language, describing
-how it is built up over time. This will let us cover a fairly broad range of
-language design and LLVM-specific usage issues, showing and explaining the code
-for it all along the way, without overwhelming you with tons of details up
-front.</p>
-
-<p>It is useful to point out ahead of time that this tutorial is really about
-teaching compiler techniques and LLVM specifically, <em>not</em> about teaching
-modern and sane software engineering principles. In practice, this means that
-we'll take a number of shortcuts to simplify the exposition. For example, the
-code leaks memory, uses global variables all over the place, doesn't use nice
-design patterns like <a
-href="http://en.wikipedia.org/wiki/Visitor_pattern">visitors</a>, etc... but it
-is very simple. If you dig in and use the code as a basis for future projects,
-fixing these deficiencies shouldn't be hard.</p>
-
-<p>I've tried to put this tutorial together in a way that makes chapters easy to
-skip over if you are already familiar with or are uninterested in the various
-pieces. The structure of the tutorial is:
-</p>
-
-<ul>
-<li><b><a href="#language">Chapter #1</a>: Introduction to the Kaleidoscope
-language, and the definition of its Lexer</b> - This shows where we are going
-and the basic functionality that we want it to do. In order to make this
-tutorial maximally understandable and hackable, we choose to implement
-everything in C++ instead of using lexer and parser generators. LLVM obviously
-works just fine with such tools, feel free to use one if you prefer.</li>
-<li><b><a href="LangImpl2.html">Chapter #2</a>: Implementing a Parser and
-AST</b> - With the lexer in place, we can talk about parsing techniques and
-basic AST construction. This tutorial describes recursive descent parsing and
-operator precedence parsing. Nothing in Chapters 1 or 2 is LLVM-specific,
-the code doesn't even link in LLVM at this point. :)</li>
-<li><b><a href="LangImpl3.html">Chapter #3</a>: Code generation to LLVM IR</b> -
-With the AST ready, we can show off how easy generation of LLVM IR really
-is.</li>
-<li><b><a href="LangImpl4.html">Chapter #4</a>: Adding JIT and Optimizer
-Support</b> - Because a lot of people are interested in using LLVM as a JIT,
-we'll dive right into it and show you the 3 lines it takes to add JIT support.
-LLVM is also useful in many other ways, but this is one simple and "sexy" way
-to shows off its power. :)</li>
-<li><b><a href="LangImpl5.html">Chapter #5</a>: Extending the Language: Control
-Flow</b> - With the language up and running, we show how to extend it with
-control flow operations (if/then/else and a 'for' loop). This gives us a chance
-to talk about simple SSA construction and control flow.</li>
-<li><b><a href="LangImpl6.html">Chapter #6</a>: Extending the Language:
-User-defined Operators</b> - This is a silly but fun chapter that talks about
-extending the language to let the user program define their own arbitrary
-unary and binary operators (with assignable precedence!). This lets us build a
-significant piece of the "language" as library routines.</li>
-<li><b><a href="LangImpl7.html">Chapter #7</a>: Extending the Language: Mutable
-Variables</b> - This chapter talks about adding user-defined local variables
-along with an assignment operator. The interesting part about this is how
-easy and trivial it is to construct SSA form in LLVM: no, LLVM does <em>not</em>
-require your front-end to construct SSA form!</li>
-<li><b><a href="LangImpl8.html">Chapter #8</a>: Conclusion and other useful LLVM
-tidbits</b> - This chapter wraps up the series by talking about potential
-ways to extend the language, but also includes a bunch of pointers to info about
-"special topics" like adding garbage collection support, exceptions, debugging,
-support for "spaghetti stacks", and a bunch of other tips and tricks.</li>
-
-</ul>
-
-<p>By the end of the tutorial, we'll have written a bit less than 700 lines of
-non-comment, non-blank, lines of code. With this small amount of code, we'll
-have built up a very reasonable compiler for a non-trivial language including
-a hand-written lexer, parser, AST, as well as code generation support with a JIT
-compiler. While other systems may have interesting "hello world" tutorials,
-I think the breadth of this tutorial is a great testament to the strengths of
-LLVM and why you should consider it if you're interested in language or compiler
-design.</p>
-
-<p>A note about this tutorial: we expect you to extend the language and play
-with it on your own. Take the code and go crazy hacking away at it, compilers
-don't need to be scary creatures - it can be a lot of fun to play with
-languages!</p>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section"><a name="language">The Basic Language</a></div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>This tutorial will be illustrated with a toy language that we'll call
-"<a href="http://en.wikipedia.org/wiki/Kaleidoscope">Kaleidoscope</a>" (derived
-from "meaning beautiful, form, and view").
-Kaleidoscope is a procedural language that allows you to define functions, use
-conditionals, math, etc. Over the course of the tutorial, we'll extend
-Kaleidoscope to support the if/then/else construct, a for loop, user defined
-operators, JIT compilation with a simple command line interface, etc.</p>
-
-<p>Because we want to keep things simple, the only datatype in Kaleidoscope is a
-64-bit floating point type (aka 'double' in C parlance). As such, all values
-are implicitly double precision and the language doesn't require type
-declarations. This gives the language a very nice and simple syntax. For
-example, the following simple example computes <a
-href="http://en.wikipedia.org/wiki/Fibonacci_number">Fibonacci numbers:</a></p>
-
-<div class="doc_code">
-<pre>
-# Compute the x'th fibonacci number.
-def fib(x)
- if x &lt; 3 then
- 1
- else
- fib(x-1)+fib(x-2)
-
-# This expression will compute the 40th number.
-fib(40)
-</pre>
-</div>
-
-<p>We also allow Kaleidoscope to call into standard library functions (the LLVM
-JIT makes this completely trivial). This means that you can use the 'extern'
-keyword to define a function before you use it (this is also useful for mutually
-recursive functions). For example:</p>
-
-<div class="doc_code">
-<pre>
-extern sin(arg);
-extern cos(arg);
-extern atan2(arg1 arg2);
-
-atan2(sin(.4), cos(42))
-</pre>
-</div>
-
-<p>A more interesting example is included in Chapter 6 where we write a little
-Kaleidoscope application that <a href="LangImpl6.html#example">displays
-a Mandelbrot Set</a> at various levels of magnification.</p>
-
-<p>Lets dive into the implementation of this language!</p>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section"><a name="lexer">The Lexer</a></div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>When it comes to implementing a language, the first thing needed is
-the ability to process a text file and recognize what it says. The traditional
-way to do this is to use a "<a
-href="http://en.wikipedia.org/wiki/Lexical_analysis">lexer</a>" (aka 'scanner')
-to break the input up into "tokens". Each token returned by the lexer includes
-a token code and potentially some metadata (e.g. the numeric value of a number).
-First, we define the possibilities:
-</p>
-
-<div class="doc_code">
-<pre>
-// The lexer returns tokens [0-255] if it is an unknown character, otherwise one
-// of these for known things.
-enum Token {
- tok_eof = -1,
-
- // commands
- tok_def = -2, tok_extern = -3,
-
- // primary
- tok_identifier = -4, tok_number = -5,
-};
-
-static std::string IdentifierStr; // Filled in if tok_identifier
-static double NumVal; // Filled in if tok_number
-</pre>
-</div>
-
-<p>Each token returned by our lexer will either be one of the Token enum values
-or it will be an 'unknown' character like '+', which is returned as its ASCII
-value. If the current token is an identifier, the <tt>IdentifierStr</tt>
-global variable holds the name of the identifier. If the current token is a
-numeric literal (like 1.0), <tt>NumVal</tt> holds its value. Note that we use
-global variables for simplicity, this is not the best choice for a real language
-implementation :).
-</p>
-
-<p>The actual implementation of the lexer is a single function named
-<tt>gettok</tt>. The <tt>gettok</tt> function is called to return the next token
-from standard input. Its definition starts as:</p>
-
-<div class="doc_code">
-<pre>
-/// gettok - Return the next token from standard input.
-static int gettok() {
- static int LastChar = ' ';
-
- // Skip any whitespace.
- while (isspace(LastChar))
- LastChar = getchar();
-</pre>
-</div>
-
-<p>
-<tt>gettok</tt> works by calling the C <tt>getchar()</tt> function to read
-characters one at a time from standard input. It eats them as it recognizes
-them and stores the last character read, but not processed, in LastChar. The
-first thing that it has to do is ignore whitespace between tokens. This is
-accomplished with the loop above.</p>
-
-<p>The next thing <tt>gettok</tt> needs to do is recognize identifiers and
-specific keywords like "def". Kaleidoscope does this with this simple loop:</p>
-
-<div class="doc_code">
-<pre>
- if (isalpha(LastChar)) { // identifier: [a-zA-Z][a-zA-Z0-9]*
- IdentifierStr = LastChar;
- while (isalnum((LastChar = getchar())))
- IdentifierStr += LastChar;
-
- if (IdentifierStr == "def") return tok_def;
- if (IdentifierStr == "extern") return tok_extern;
- return tok_identifier;
- }
-</pre>
-</div>
-
-<p>Note that this code sets the '<tt>IdentifierStr</tt>' global whenever it
-lexes an identifier. Also, since language keywords are matched by the same
-loop, we handle them here inline. Numeric values are similar:</p>
-
-<div class="doc_code">
-<pre>
- if (isdigit(LastChar) || LastChar == '.') { // Number: [0-9.]+
- std::string NumStr;
- do {
- NumStr += LastChar;
- LastChar = getchar();
- } while (isdigit(LastChar) || LastChar == '.');
-
- NumVal = strtod(NumStr.c_str(), 0);
- return tok_number;
- }
-</pre>
-</div>
-
-<p>This is all pretty straight-forward code for processing input. When reading
-a numeric value from input, we use the C <tt>strtod</tt> function to convert it
-to a numeric value that we store in <tt>NumVal</tt>. Note that this isn't doing
-sufficient error checking: it will incorrectly read "1.23.45.67" and handle it as
-if you typed in "1.23". Feel free to extend it :). Next we handle comments:
-</p>
-
-<div class="doc_code">
-<pre>
- if (LastChar == '#') {
- // Comment until end of line.
- do LastChar = getchar();
- while (LastChar != EOF &amp;&amp; LastChar != '\n' &amp;&amp; LastChar != '\r');
-
- if (LastChar != EOF)
- return gettok();
- }
-</pre>
-</div>
-
-<p>We handle comments by skipping to the end of the line and then return the
-next token. Finally, if the input doesn't match one of the above cases, it is
-either an operator character like '+' or the end of the file. These are handled
-with this code:</p>
-
-<div class="doc_code">
-<pre>
- // Check for end of file. Don't eat the EOF.
- if (LastChar == EOF)
- return tok_eof;
-
- // Otherwise, just return the character as its ascii value.
- int ThisChar = LastChar;
- LastChar = getchar();
- return ThisChar;
-}
-</pre>
-</div>
-
-<p>With this, we have the complete lexer for the basic Kaleidoscope language
-(the <a href="LangImpl2.html#code">full code listing</a> for the Lexer is
-available in the <a href="LangImpl2.html">next chapter</a> of the tutorial).
-Next we'll <a href="LangImpl2.html">build a simple parser that uses this to
-build an Abstract Syntax Tree</a>. When we have that, we'll include a driver
-so that you can use the lexer and parser together.
-</p>
-
-<a href="LangImpl2.html">Next: Implementing a Parser and AST</a>
-</div>
-
-<!-- *********************************************************************** -->
-<hr>
-<address>
- <a href="http://jigsaw.w3.org/css-validator/check/referer"><img
- src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"></a>
- <a href="http://validator.w3.org/check/referer"><img
- src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!"></a>
-
- <a href="mailto:sabre@nondot.org">Chris Lattner</a><br>
- <a href="http://llvm.org">The LLVM Compiler Infrastructure</a><br>
- Last modified: $Date: 2007-10-17 11:05:13 -0700 (Wed, 17 Oct 2007) $
-</address>
-</body>
-</html>
diff --git a/release_23/docs/tutorial/LangImpl2.html b/release_23/docs/tutorial/LangImpl2.html
deleted file mode 100644
index 018d0be76032..000000000000
--- a/release_23/docs/tutorial/LangImpl2.html
+++ /dev/null
@@ -1,1230 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
- "http://www.w3.org/TR/html4/strict.dtd">
-
-<html>
-<head>
- <title>Kaleidoscope: Implementing a Parser and AST</title>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <meta name="author" content="Chris Lattner">
- <link rel="stylesheet" href="../llvm.css" type="text/css">
-</head>
-
-<body>
-
-<div class="doc_title">Kaleidoscope: Implementing a Parser and AST</div>
-
-<ul>
-<li><a href="index.html">Up to Tutorial Index</a></li>
-<li>Chapter 2
- <ol>
- <li><a href="#intro">Chapter 2 Introduction</a></li>
- <li><a href="#ast">The Abstract Syntax Tree (AST)</a></li>
- <li><a href="#parserbasics">Parser Basics</a></li>
- <li><a href="#parserprimexprs">Basic Expression Parsing</a></li>
- <li><a href="#parserbinops">Binary Expression Parsing</a></li>
- <li><a href="#parsertop">Parsing the Rest</a></li>
- <li><a href="#driver">The Driver</a></li>
- <li><a href="#conclusions">Conclusions</a></li>
- <li><a href="#code">Full Code Listing</a></li>
- </ol>
-</li>
-<li><a href="LangImpl3.html">Chapter 3</a>: Code generation to LLVM IR</li>
-</ul>
-
-<div class="doc_author">
- <p>Written by <a href="mailto:sabre@nondot.org">Chris Lattner</a></p>
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section"><a name="intro">Chapter 2 Introduction</a></div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>Welcome to Chapter 2 of the "<a href="index.html">Implementing a language
-with LLVM</a>" tutorial. This chapter shows you how to use the lexer, built in
-<a href="LangImpl1.html">Chapter 1</a>, to build a full <a
-href="http://en.wikipedia.org/wiki/Parsing">parser</a> for
-our Kaleidoscope language. Once we have a parser, we'll define and build an <a
-href="http://en.wikipedia.org/wiki/Abstract_syntax_tree">Abstract Syntax
-Tree</a> (AST).</p>
-
-<p>The parser we will build uses a combination of <a
-href="http://en.wikipedia.org/wiki/Recursive_descent_parser">Recursive Descent
-Parsing</a> and <a href=
-"http://en.wikipedia.org/wiki/Operator-precedence_parser">Operator-Precedence
-Parsing</a> to parse the Kaleidoscope language (the latter for
-binary expressions and the former for everything else). Before we get to
-parsing though, lets talk about the output of the parser: the Abstract Syntax
-Tree.</p>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section"><a name="ast">The Abstract Syntax Tree (AST)</a></div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>The AST for a program captures its behavior in such a way that it is easy for
-later stages of the compiler (e.g. code generation) to interpret. We basically
-want one object for each construct in the language, and the AST should closely
-model the language. In Kaleidoscope, we have expressions, a prototype, and a
-function object. We'll start with expressions first:</p>
-
-<div class="doc_code">
-<pre>
-/// ExprAST - Base class for all expression nodes.
-class ExprAST {
-public:
- virtual ~ExprAST() {}
-};
-
-/// NumberExprAST - Expression class for numeric literals like "1.0".
-class NumberExprAST : public ExprAST {
- double Val;
-public:
- explicit NumberExprAST(double val) : Val(val) {}
-};
-</pre>
-</div>
-
-<p>The code above shows the definition of the base ExprAST class and one
-subclass which we use for numeric literals. The important thing to note about
-this code is that the NumberExprAST class captures the numeric value of the
-literal as an instance variable. This allows later phases of the compiler to
-know what the stored numeric value is.</p>
-
-<p>Right now we only create the AST, so there are no useful accessor methods on
-them. It would be very easy to add a virtual method to pretty print the code,
-for example. Here are the other expression AST node definitions that we'll use
-in the basic form of the Kaleidoscope language:
-</p>
-
-<div class="doc_code">
-<pre>
-/// VariableExprAST - Expression class for referencing a variable, like "a".
-class VariableExprAST : public ExprAST {
- std::string Name;
-public:
- explicit VariableExprAST(const std::string &amp;name) : Name(name) {}
-};
-
-/// BinaryExprAST - Expression class for a binary operator.
-class BinaryExprAST : public ExprAST {
- char Op;
- ExprAST *LHS, *RHS;
-public:
- BinaryExprAST(char op, ExprAST *lhs, ExprAST *rhs)
- : Op(op), LHS(lhs), RHS(rhs) {}
-};
-
-/// CallExprAST - Expression class for function calls.
-class CallExprAST : public ExprAST {
- std::string Callee;
- std::vector&lt;ExprAST*&gt; Args;
-public:
- CallExprAST(const std::string &amp;callee, std::vector&lt;ExprAST*&gt; &amp;args)
- : Callee(callee), Args(args) {}
-};
-</pre>
-</div>
-
-<p>This is all (intentionally) rather straight-forward: variables capture the
-variable name, binary operators capture their opcode (e.g. '+'), and calls
-capture a function name as well as a list of any argument expressions. One thing
-that is nice about our AST is that it captures the language features without
-talking about the syntax of the language. Note that there is no discussion about
-precedence of binary operators, lexical structure, etc.</p>
-
-<p>For our basic language, these are all of the expression nodes we'll define.
-Because it doesn't have conditional control flow, it isn't Turing-complete;
-we'll fix that in a later installment. The two things we need next are a way
-to talk about the interface to a function, and a way to talk about functions
-themselves:</p>
-
-<div class="doc_code">
-<pre>
-/// PrototypeAST - This class represents the "prototype" for a function,
-/// which captures its name, and its argument names (thus implicitly the number
-/// of arguments the function takes).
-class PrototypeAST {
- std::string Name;
- std::vector&lt;std::string&gt; Args;
-public:
- PrototypeAST(const std::string &amp;name, const std::vector&lt;std::string&gt; &amp;args)
- : Name(name), Args(args) {}
-};
-
-/// FunctionAST - This class represents a function definition itself.
-class FunctionAST {
- PrototypeAST *Proto;
- ExprAST *Body;
-public:
- FunctionAST(PrototypeAST *proto, ExprAST *body)
- : Proto(proto), Body(body) {}
-};
-</pre>
-</div>
-
-<p>In Kaleidoscope, functions are typed with just a count of their arguments.
-Since all values are double precision floating point, the type of each argument
-doesn't need to be stored anywhere. In a more aggressive and realistic
-language, the "ExprAST" class would probably have a type field.</p>
-
-<p>With this scaffolding, we can now talk about parsing expressions and function
-bodies in Kaleidoscope.</p>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section"><a name="parserbasics">Parser Basics</a></div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>Now that we have an AST to build, we need to define the parser code to build
-it. The idea here is that we want to parse something like "x+y" (which is
-returned as three tokens by the lexer) into an AST that could be generated with
-calls like this:</p>
-
-<div class="doc_code">
-<pre>
- ExprAST *X = new VariableExprAST("x");
- ExprAST *Y = new VariableExprAST("y");
- ExprAST *Result = new BinaryExprAST('+', X, Y);
-</pre>
-</div>
-
-<p>In order to do this, we'll start by defining some basic helper routines:</p>
-
-<div class="doc_code">
-<pre>
-/// CurTok/getNextToken - Provide a simple token buffer. CurTok is the current
-/// token the parser is looking at. getNextToken reads another token from the
-/// lexer and updates CurTok with its results.
-static int CurTok;
-static int getNextToken() {
- return CurTok = gettok();
-}
-</pre>
-</div>
-
-<p>
-This implements a simple token buffer around the lexer. This allows
-us to look one token ahead at what the lexer is returning. Every function in
-our parser will assume that CurTok is the current token that needs to be
-parsed.</p>
-
-<div class="doc_code">
-<pre>
-
-/// Error* - These are little helper functions for error handling.
-ExprAST *Error(const char *Str) { fprintf(stderr, "Error: %s\n", Str);return 0;}
-PrototypeAST *ErrorP(const char *Str) { Error(Str); return 0; }
-FunctionAST *ErrorF(const char *Str) { Error(Str); return 0; }
-</pre>
-</div>
-
-<p>
-The <tt>Error</tt> routines are simple helper routines that our parser will use
-to handle errors. The error recovery in our parser will not be the best and
-is not particular user-friendly, but it will be enough for our tutorial. These
-routines make it easier to handle errors in routines that have various return
-types: they always return null.</p>
-
-<p>With these basic helper functions, we can implement the first
-piece of our grammar: numeric literals.</p>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section"><a name="parserprimexprs">Basic Expression
- Parsing</a></div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>We start with numeric literals, because they are the simplest to process.
-For each production in our grammar, we'll define a function which parses that
-production. For numeric literals, we have:
-</p>
-
-<div class="doc_code">
-<pre>
-/// numberexpr ::= number
-static ExprAST *ParseNumberExpr() {
- ExprAST *Result = new NumberExprAST(NumVal);
- getNextToken(); // consume the number
- return Result;
-}
-</pre>
-</div>
-
-<p>This routine is very simple: it expects to be called when the current token
-is a <tt>tok_number</tt> token. It takes the current number value, creates
-a <tt>NumberExprAST</tt> node, advances the lexer to the next token, and finally
-returns.</p>
-
-<p>There are some interesting aspects to this. The most important one is that
-this routine eats all of the tokens that correspond to the production and
-returns the lexer buffer with the next token (which is not part of the grammar
-production) ready to go. This is a fairly standard way to go for recursive
-descent parsers. For a better example, the parenthesis operator is defined like
-this:</p>
-
-<div class="doc_code">
-<pre>
-/// parenexpr ::= '(' expression ')'
-static ExprAST *ParseParenExpr() {
- getNextToken(); // eat (.
- ExprAST *V = ParseExpression();
- if (!V) return 0;
-
- if (CurTok != ')')
- return Error("expected ')'");
- getNextToken(); // eat ).
- return V;
-}
-</pre>
-</div>
-
-<p>This function illustrates a number of interesting things about the
-parser:</p>
-
-<p>
-1) It shows how we use the Error routines. When called, this function expects
-that the current token is a '(' token, but after parsing the subexpression, it
-is possible that there is no ')' waiting. For example, if the user types in
-"(4 x" instead of "(4)", the parser should emit an error. Because errors can
-occur, the parser needs a way to indicate that they happened: in our parser, we
-return null on an error.</p>
-
-<p>2) Another interesting aspect of this function is that it uses recursion by
-calling <tt>ParseExpression</tt> (we will soon see that <tt>ParseExpression</tt> can call
-<tt>ParseParenExpr</tt>). This is powerful because it allows us to handle
-recursive grammars, and keeps each production very simple. Note that
-parentheses do not cause construction of AST nodes themselves. While we could
-do it this way, the most important role of parentheses are to guide the parser
-and provide grouping. Once the parser constructs the AST, parentheses are not
-needed.</p>
-
-<p>The next simple production is for handling variable references and function
-calls:</p>
-
-<div class="doc_code">
-<pre>
-/// identifierexpr
-/// ::= identifier
-/// ::= identifier '(' expression* ')'
-static ExprAST *ParseIdentifierExpr() {
- std::string IdName = IdentifierStr;
-
- getNextToken(); // eat identifier.
-
- if (CurTok != '(') // Simple variable ref.
- return new VariableExprAST(IdName);
-
- // Call.
- getNextToken(); // eat (
- std::vector&lt;ExprAST*&gt; Args;
- if (CurTok != ')') {
- while (1) {
- ExprAST *Arg = ParseExpression();
- if (!Arg) return 0;
- Args.push_back(Arg);
-
- if (CurTok == ')') break;
-
- if (CurTok != ',')
- return Error("Expected ')' or ',' in argument list");
- getNextToken();
- }
- }
-
- // Eat the ')'.
- getNextToken();
-
- return new CallExprAST(IdName, Args);
-}
-</pre>
-</div>
-
-<p>This routine follows the same style as the other routines. (It expects to be
-called if the current token is a <tt>tok_identifier</tt> token). It also has
-recursion and error handling. One interesting aspect of this is that it uses
-<em>look-ahead</em> to determine if the current identifier is a stand alone
-variable reference or if it is a function call expression. It handles this by
-checking to see if the token after the identifier is a '(' token, constructing
-either a <tt>VariableExprAST</tt> or <tt>CallExprAST</tt> node as appropriate.
-</p>
-
-<p>Now that we have all of our simple expression-parsing logic in place, we can
-define a helper function to wrap it together into one entry point. We call this
-class of expressions "primary" expressions, for reasons that will become more
-clear <a href="LangImpl6.html#unary">later in the tutorial</a>. In order to
-parse an arbitrary primary expression, we need to determine what sort of
-expression it is:</p>
-
-<div class="doc_code">
-<pre>
-/// primary
-/// ::= identifierexpr
-/// ::= numberexpr
-/// ::= parenexpr
-static ExprAST *ParsePrimary() {
- switch (CurTok) {
- default: return Error("unknown token when expecting an expression");
- case tok_identifier: return ParseIdentifierExpr();
- case tok_number: return ParseNumberExpr();
- case '(': return ParseParenExpr();
- }
-}
-</pre>
-</div>
-
-<p>Now that you see the definition of this function, it is more obvious why we
-can assume the state of CurTok in the various functions. This uses look-ahead
-to determine which sort of expression is being inspected, and then parses it
-with a function call.</p>
-
-<p>Now that basic expressions are handled, we need to handle binary expressions.
-They are a bit more complex.</p>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section"><a name="parserbinops">Binary Expression
- Parsing</a></div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>Binary expressions are significantly harder to parse because they are often
-ambiguous. For example, when given the string "x+y*z", the parser can choose
-to parse it as either "(x+y)*z" or "x+(y*z)". With common definitions from
-mathematics, we expect the later parse, because "*" (multiplication) has
-higher <em>precedence</em> than "+" (addition).</p>
-
-<p>There are many ways to handle this, but an elegant and efficient way is to
-use <a href=
-"http://en.wikipedia.org/wiki/Operator-precedence_parser">Operator-Precedence
-Parsing</a>. This parsing technique uses the precedence of binary operators to
-guide recursion. To start with, we need a table of precedences:</p>
-
-<div class="doc_code">
-<pre>
-/// BinopPrecedence - This holds the precedence for each binary operator that is
-/// defined.
-static std::map&lt;char, int&gt; BinopPrecedence;
-
-/// GetTokPrecedence - Get the precedence of the pending binary operator token.
-static int GetTokPrecedence() {
- if (!isascii(CurTok))
- return -1;
-
- // Make sure it's a declared binop.
- int TokPrec = BinopPrecedence[CurTok];
- if (TokPrec &lt;= 0) return -1;
- return TokPrec;
-}
-
-int main() {
- // Install standard binary operators.
- // 1 is lowest precedence.
- BinopPrecedence['&lt;'] = 10;
- BinopPrecedence['+'] = 20;
- BinopPrecedence['-'] = 20;
- BinopPrecedence['*'] = 40; // highest.
- ...
-}
-</pre>
-</div>
-
-<p>For the basic form of Kaleidoscope, we will only support 4 binary operators
-(this can obviously be extended by you, our brave and intrepid reader). The
-<tt>GetTokPrecedence</tt> function returns the precedence for the current token,
-or -1 if the token is not a binary operator. Having a map makes it easy to add
-new operators and makes it clear that the algorithm doesn't depend on the
-specific operators involved, but it would be easy enough to eliminate the map
-and do the comparisons in the <tt>GetTokPrecedence</tt> function. (Or just use
-a fixed-size array).</p>
-
-<p>With the helper above defined, we can now start parsing binary expressions.
-The basic idea of operator precedence parsing is to break down an expression
-with potentially ambiguous binary operators into pieces. Consider ,for example,
-the expression "a+b+(c+d)*e*f+g". Operator precedence parsing considers this
-as a stream of primary expressions separated by binary operators. As such,
-it will first parse the leading primary expression "a", then it will see the
-pairs [+, b] [+, (c+d)] [*, e] [*, f] and [+, g]. Note that because parentheses
-are primary expressions, the binary expression parser doesn't need to worry
-about nested subexpressions like (c+d) at all.
-</p>
-
-<p>
-To start, an expression is a primary expression potentially followed by a
-sequence of [binop,primaryexpr] pairs:</p>
-
-<div class="doc_code">
-<pre>
-/// expression
-/// ::= primary binoprhs
-///
-static ExprAST *ParseExpression() {
- ExprAST *LHS = ParsePrimary();
- if (!LHS) return 0;
-
- return ParseBinOpRHS(0, LHS);
-}
-</pre>
-</div>
-
-<p><tt>ParseBinOpRHS</tt> is the function that parses the sequence of pairs for
-us. It takes a precedence and a pointer to an expression for the part that has been
-parsed so far. Note that "x" is a perfectly valid expression: As such, "binoprhs" is
-allowed to be empty, in which case it returns the expression that is passed into
-it. In our example above, the code passes the expression for "a" into
-<tt>ParseBinOpRHS</tt> and the current token is "+".</p>
-
-<p>The precedence value passed into <tt>ParseBinOpRHS</tt> indicates the <em>
-minimal operator precedence</em> that the function is allowed to eat. For
-example, if the current pair stream is [+, x] and <tt>ParseBinOpRHS</tt> is
-passed in a precedence of 40, it will not consume any tokens (because the
-precedence of '+' is only 20). With this in mind, <tt>ParseBinOpRHS</tt> starts
-with:</p>
-
-<div class="doc_code">
-<pre>
-/// binoprhs
-/// ::= ('+' primary)*
-static ExprAST *ParseBinOpRHS(int ExprPrec, ExprAST *LHS) {
- // If this is a binop, find its precedence.
- while (1) {
- int TokPrec = GetTokPrecedence();
-
- // If this is a binop that binds at least as tightly as the current binop,
- // consume it, otherwise we are done.
- if (TokPrec &lt; ExprPrec)
- return LHS;
-</pre>
-</div>
-
-<p>This code gets the precedence of the current token and checks to see if if is
-too low. Because we defined invalid tokens to have a precedence of -1, this
-check implicitly knows that the pair-stream ends when the token stream runs out
-of binary operators. If this check succeeds, we know that the token is a binary
-operator and that it will be included in this expression:</p>
-
-<div class="doc_code">
-<pre>
- // Okay, we know this is a binop.
- int BinOp = CurTok;
- getNextToken(); // eat binop
-
- // Parse the primary expression after the binary operator.
- ExprAST *RHS = ParsePrimary();
- if (!RHS) return 0;
-</pre>
-</div>
-
-<p>As such, this code eats (and remembers) the binary operator and then parses
-the primary expression that follows. This builds up the whole pair, the first of
-which is [+, b] for the running example.</p>
-
-<p>Now that we parsed the left-hand side of an expression and one pair of the
-RHS sequence, we have to decide which way the expression associates. In
-particular, we could have "(a+b) binop unparsed" or "a + (b binop unparsed)".
-To determine this, we look ahead at "binop" to determine its precedence and
-compare it to BinOp's precedence (which is '+' in this case):</p>
-
-<div class="doc_code">
-<pre>
- // If BinOp binds less tightly with RHS than the operator after RHS, let
- // the pending operator take RHS as its LHS.
- int NextPrec = GetTokPrecedence();
- if (TokPrec &lt; NextPrec) {
-</pre>
-</div>
-
-<p>If the precedence of the binop to the right of "RHS" is lower or equal to the
-precedence of our current operator, then we know that the parentheses associate
-as "(a+b) binop ...". In our example, the current operator is "+" and the next
-operator is "+", we know that they have the same precedence. In this case we'll
-create the AST node for "a+b", and then continue parsing:</p>
-
-<div class="doc_code">
-<pre>
- ... if body omitted ...
- }
-
- // Merge LHS/RHS.
- LHS = new BinaryExprAST(BinOp, LHS, RHS);
- } // loop around to the top of the while loop.
-}
-</pre>
-</div>
-
-<p>In our example above, this will turn "a+b+" into "(a+b)" and execute the next
-iteration of the loop, with "+" as the current token. The code above will eat,
-remember, and parse "(c+d)" as the primary expression, which makes the
-current pair equal to [+, (c+d)]. It will then evaluate the 'if' conditional above with
-"*" as the binop to the right of the primary. In this case, the precedence of "*" is
-higher than the precedence of "+" so the if condition will be entered.</p>
-
-<p>The critical question left here is "how can the if condition parse the right
-hand side in full"? In particular, to build the AST correctly for our example,
-it needs to get all of "(c+d)*e*f" as the RHS expression variable. The code to
-do this is surprisingly simple (code from the above two blocks duplicated for
-context):</p>
-
-<div class="doc_code">
-<pre>
- // If BinOp binds less tightly with RHS than the operator after RHS, let
- // the pending operator take RHS as its LHS.
- int NextPrec = GetTokPrecedence();
- if (TokPrec &lt; NextPrec) {
- <b>RHS = ParseBinOpRHS(TokPrec+1, RHS);
- if (RHS == 0) return 0;</b>
- }
- // Merge LHS/RHS.
- LHS = new BinaryExprAST(BinOp, LHS, RHS);
- } // loop around to the top of the while loop.
-}
-</pre>
-</div>
-
-<p>At this point, we know that the binary operator to the RHS of our primary
-has higher precedence than the binop we are currently parsing. As such, we know
-that any sequence of pairs whose operators are all higher precedence than "+"
-should be parsed together and returned as "RHS". To do this, we recursively
-invoke the <tt>ParseBinOpRHS</tt> function specifying "TokPrec+1" as the minimum
-precedence required for it to continue. In our example above, this will cause
-it to return the AST node for "(c+d)*e*f" as RHS, which is then set as the RHS
-of the '+' expression.</p>
-
-<p>Finally, on the next iteration of the while loop, the "+g" piece is parsed
-and added to the AST. With this little bit of code (14 non-trivial lines), we
-correctly handle fully general binary expression parsing in a very elegant way.
-This was a whirlwind tour of this code, and it is somewhat subtle. I recommend
-running through it with a few tough examples to see how it works.
-</p>
-
-<p>This wraps up handling of expressions. At this point, we can point the
-parser at an arbitrary token stream and build an expression from it, stopping
-at the first token that is not part of the expression. Next up we need to
-handle function definitions, etc.</p>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section"><a name="parsertop">Parsing the Rest</a></div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>
-The next thing missing is handling of function prototypes. In Kaleidoscope,
-these are used both for 'extern' function declarations as well as function body
-definitions. The code to do this is straight-forward and not very interesting
-(once you've survived expressions):
-</p>
-
-<div class="doc_code">
-<pre>
-/// prototype
-/// ::= id '(' id* ')'
-static PrototypeAST *ParsePrototype() {
- if (CurTok != tok_identifier)
- return ErrorP("Expected function name in prototype");
-
- std::string FnName = IdentifierStr;
- getNextToken();
-
- if (CurTok != '(')
- return ErrorP("Expected '(' in prototype");
-
- // Read the list of argument names.
- std::vector&lt;std::string&gt; ArgNames;
- while (getNextToken() == tok_identifier)
- ArgNames.push_back(IdentifierStr);
- if (CurTok != ')')
- return ErrorP("Expected ')' in prototype");
-
- // success.
- getNextToken(); // eat ')'.
-
- return new PrototypeAST(FnName, ArgNames);
-}
-</pre>
-</div>
-
-<p>Given this, a function definition is very simple, just a prototype plus
-an expression to implement the body:</p>
-
-<div class="doc_code">
-<pre>
-/// definition ::= 'def' prototype expression
-static FunctionAST *ParseDefinition() {
- getNextToken(); // eat def.
- PrototypeAST *Proto = ParsePrototype();
- if (Proto == 0) return 0;
-
- if (ExprAST *E = ParseExpression())
- return new FunctionAST(Proto, E);
- return 0;
-}
-</pre>
-</div>
-
-<p>In addition, we support 'extern' to declare functions like 'sin' and 'cos' as
-well as to support forward declaration of user functions. These 'extern's are just
-prototypes with no body:</p>
-
-<div class="doc_code">
-<pre>
-/// external ::= 'extern' prototype
-static PrototypeAST *ParseExtern() {
- getNextToken(); // eat extern.
- return ParsePrototype();
-}
-</pre>
-</div>
-
-<p>Finally, we'll also let the user type in arbitrary top-level expressions and
-evaluate them on the fly. We will handle this by defining anonymous nullary
-(zero argument) functions for them:</p>
-
-<div class="doc_code">
-<pre>
-/// toplevelexpr ::= expression
-static FunctionAST *ParseTopLevelExpr() {
- if (ExprAST *E = ParseExpression()) {
- // Make an anonymous proto.
- PrototypeAST *Proto = new PrototypeAST("", std::vector&lt;std::string&gt;());
- return new FunctionAST(Proto, E);
- }
- return 0;
-}
-</pre>
-</div>
-
-<p>Now that we have all the pieces, let's build a little driver that will let us
-actually <em>execute</em> this code we've built!</p>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section"><a name="driver">The Driver</a></div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>The driver for this simply invokes all of the parsing pieces with a top-level
-dispatch loop. There isn't much interesting here, so I'll just include the
-top-level loop. See <a href="#code">below</a> for full code in the "Top-Level
-Parsing" section.</p>
-
-<div class="doc_code">
-<pre>
-/// top ::= definition | external | expression | ';'
-static void MainLoop() {
- while (1) {
- fprintf(stderr, "ready&gt; ");
- switch (CurTok) {
- case tok_eof: return;
- case ';': getNextToken(); break; // ignore top-level semicolons.
- case tok_def: HandleDefinition(); break;
- case tok_extern: HandleExtern(); break;
- default: HandleTopLevelExpression(); break;
- }
- }
-}
-</pre>
-</div>
-
-<p>The most interesting part of this is that we ignore top-level semicolons.
-Why is this, you ask? The basic reason is that if you type "4 + 5" at the
-command line, the parser doesn't know whether that is the end of what you will type
-or not. For example, on the next line you could type "def foo..." in which case
-4+5 is the end of a top-level expression. Alternatively you could type "* 6",
-which would continue the expression. Having top-level semicolons allows you to
-type "4+5;", and the parser will know you are done.</p>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section"><a name="conclusions">Conclusions</a></div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>With just under 400 lines of commented code (240 lines of non-comment,
-non-blank code), we fully defined our minimal language, including a lexer,
-parser, and AST builder. With this done, the executable will validate
-Kaleidoscope code and tell us if it is grammatically invalid. For
-example, here is a sample interaction:</p>
-
-<div class="doc_code">
-<pre>
-$ <b>./a.out</b>
-ready&gt; <b>def foo(x y) x+foo(y, 4.0);</b>
-Parsed a function definition.
-ready&gt; <b>def foo(x y) x+y y;</b>
-Parsed a function definition.
-Parsed a top-level expr
-ready&gt; <b>def foo(x y) x+y );</b>
-Parsed a function definition.
-Error: unknown token when expecting an expression
-ready&gt; <b>extern sin(a);</b>
-ready&gt; Parsed an extern
-ready&gt; <b>^D</b>
-$
-</pre>
-</div>
-
-<p>There is a lot of room for extension here. You can define new AST nodes,
-extend the language in many ways, etc. In the <a href="LangImpl3.html">next
-installment</a>, we will describe how to generate LLVM Intermediate
-Representation (IR) from the AST.</p>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section"><a name="code">Full Code Listing</a></div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>
-Here is the complete code listing for this and the previous chapter.
-Note that it is fully self-contained: you don't need LLVM or any external
-libraries at all for this. (Besides the C and C++ standard libraries, of
-course.) To build this, just compile with:</p>
-
-<div class="doc_code">
-<pre>
- # Compile
- g++ -g -O3 toy.cpp
- # Run
- ./a.out
-</pre>
-</div>
-
-<p>Here is the code:</p>
-
-<div class="doc_code">
-<pre>
-#include &lt;cstdio&gt;
-#include &lt;string&gt;
-#include &lt;map&gt;
-#include &lt;vector&gt;
-
-//===----------------------------------------------------------------------===//
-// Lexer
-//===----------------------------------------------------------------------===//
-
-// The lexer returns tokens [0-255] if it is an unknown character, otherwise one
-// of these for known things.
-enum Token {
- tok_eof = -1,
-
- // commands
- tok_def = -2, tok_extern = -3,
-
- // primary
- tok_identifier = -4, tok_number = -5,
-};
-
-static std::string IdentifierStr; // Filled in if tok_identifier
-static double NumVal; // Filled in if tok_number
-
-/// gettok - Return the next token from standard input.
-static int gettok() {
- static int LastChar = ' ';
-
- // Skip any whitespace.
- while (isspace(LastChar))
- LastChar = getchar();
-
- if (isalpha(LastChar)) { // identifier: [a-zA-Z][a-zA-Z0-9]*
- IdentifierStr = LastChar;
- while (isalnum((LastChar = getchar())))
- IdentifierStr += LastChar;
-
- if (IdentifierStr == "def") return tok_def;
- if (IdentifierStr == "extern") return tok_extern;
- return tok_identifier;
- }
-
- if (isdigit(LastChar) || LastChar == '.') { // Number: [0-9.]+
- std::string NumStr;
- do {
- NumStr += LastChar;
- LastChar = getchar();
- } while (isdigit(LastChar) || LastChar == '.');
-
- NumVal = strtod(NumStr.c_str(), 0);
- return tok_number;
- }
-
- if (LastChar == '#') {
- // Comment until end of line.
- do LastChar = getchar();
- while (LastChar != EOF &amp;&amp; LastChar != '\n' &amp;&amp; LastChar != '\r');
-
- if (LastChar != EOF)
- return gettok();
- }
-
- // Check for end of file. Don't eat the EOF.
- if (LastChar == EOF)
- return tok_eof;
-
- // Otherwise, just return the character as its ascii value.
- int ThisChar = LastChar;
- LastChar = getchar();
- return ThisChar;
-}
-
-//===----------------------------------------------------------------------===//
-// Abstract Syntax Tree (aka Parse Tree)
-//===----------------------------------------------------------------------===//
-
-/// ExprAST - Base class for all expression nodes.
-class ExprAST {
-public:
- virtual ~ExprAST() {}
-};
-
-/// NumberExprAST - Expression class for numeric literals like "1.0".
-class NumberExprAST : public ExprAST {
- double Val;
-public:
- explicit NumberExprAST(double val) : Val(val) {}
-};
-
-/// VariableExprAST - Expression class for referencing a variable, like "a".
-class VariableExprAST : public ExprAST {
- std::string Name;
-public:
- explicit VariableExprAST(const std::string &amp;name) : Name(name) {}
-};
-
-/// BinaryExprAST - Expression class for a binary operator.
-class BinaryExprAST : public ExprAST {
- char Op;
- ExprAST *LHS, *RHS;
-public:
- BinaryExprAST(char op, ExprAST *lhs, ExprAST *rhs)
- : Op(op), LHS(lhs), RHS(rhs) {}
-};
-
-/// CallExprAST - Expression class for function calls.
-class CallExprAST : public ExprAST {
- std::string Callee;
- std::vector&lt;ExprAST*&gt; Args;
-public:
- CallExprAST(const std::string &amp;callee, std::vector&lt;ExprAST*&gt; &amp;args)
- : Callee(callee), Args(args) {}
-};
-
-/// PrototypeAST - This class represents the "prototype" for a function,
-/// which captures its name, and its argument names (thus implicitly the number
-/// of arguments the function takes).
-class PrototypeAST {
- std::string Name;
- std::vector&lt;std::string&gt; Args;
-public:
- PrototypeAST(const std::string &amp;name, const std::vector&lt;std::string&gt; &amp;args)
- : Name(name), Args(args) {}
-
-};
-
-/// FunctionAST - This class represents a function definition itself.
-class FunctionAST {
- PrototypeAST *Proto;
- ExprAST *Body;
-public:
- FunctionAST(PrototypeAST *proto, ExprAST *body)
- : Proto(proto), Body(body) {}
-
-};
-
-//===----------------------------------------------------------------------===//
-// Parser
-//===----------------------------------------------------------------------===//
-
-/// CurTok/getNextToken - Provide a simple token buffer. CurTok is the current
-/// token the parser is looking at. getNextToken reads another token from the
-/// lexer and updates CurTok with its results.
-static int CurTok;
-static int getNextToken() {
- return CurTok = gettok();
-}
-
-/// BinopPrecedence - This holds the precedence for each binary operator that is
-/// defined.
-static std::map&lt;char, int&gt; BinopPrecedence;
-
-/// GetTokPrecedence - Get the precedence of the pending binary operator token.
-static int GetTokPrecedence() {
- if (!isascii(CurTok))
- return -1;
-
- // Make sure it's a declared binop.
- int TokPrec = BinopPrecedence[CurTok];
- if (TokPrec &lt;= 0) return -1;
- return TokPrec;
-}
-
-/// Error* - These are little helper functions for error handling.
-ExprAST *Error(const char *Str) { fprintf(stderr, "Error: %s\n", Str);return 0;}
-PrototypeAST *ErrorP(const char *Str) { Error(Str); return 0; }
-FunctionAST *ErrorF(const char *Str) { Error(Str); return 0; }
-
-static ExprAST *ParseExpression();
-
-/// identifierexpr
-/// ::= identifier
-/// ::= identifier '(' expression* ')'
-static ExprAST *ParseIdentifierExpr() {
- std::string IdName = IdentifierStr;
-
- getNextToken(); // eat identifier.
-
- if (CurTok != '(') // Simple variable ref.
- return new VariableExprAST(IdName);
-
- // Call.
- getNextToken(); // eat (
- std::vector&lt;ExprAST*&gt; Args;
- if (CurTok != ')') {
- while (1) {
- ExprAST *Arg = ParseExpression();
- if (!Arg) return 0;
- Args.push_back(Arg);
-
- if (CurTok == ')') break;
-
- if (CurTok != ',')
- return Error("Expected ')' or ',' in argument list");
- getNextToken();
- }
- }
-
- // Eat the ')'.
- getNextToken();
-
- return new CallExprAST(IdName, Args);
-}
-
-/// numberexpr ::= number
-static ExprAST *ParseNumberExpr() {
- ExprAST *Result = new NumberExprAST(NumVal);
- getNextToken(); // consume the number
- return Result;
-}
-
-/// parenexpr ::= '(' expression ')'
-static ExprAST *ParseParenExpr() {
- getNextToken(); // eat (.
- ExprAST *V = ParseExpression();
- if (!V) return 0;
-
- if (CurTok != ')')
- return Error("expected ')'");
- getNextToken(); // eat ).
- return V;
-}
-
-/// primary
-/// ::= identifierexpr
-/// ::= numberexpr
-/// ::= parenexpr
-static ExprAST *ParsePrimary() {
- switch (CurTok) {
- default: return Error("unknown token when expecting an expression");
- case tok_identifier: return ParseIdentifierExpr();
- case tok_number: return ParseNumberExpr();
- case '(': return ParseParenExpr();
- }
-}
-
-/// binoprhs
-/// ::= ('+' primary)*
-static ExprAST *ParseBinOpRHS(int ExprPrec, ExprAST *LHS) {
- // If this is a binop, find its precedence.
- while (1) {
- int TokPrec = GetTokPrecedence();
-
- // If this is a binop that binds at least as tightly as the current binop,
- // consume it, otherwise we are done.
- if (TokPrec &lt; ExprPrec)
- return LHS;
-
- // Okay, we know this is a binop.
- int BinOp = CurTok;
- getNextToken(); // eat binop
-
- // Parse the primary expression after the binary operator.
- ExprAST *RHS = ParsePrimary();
- if (!RHS) return 0;
-
- // If BinOp binds less tightly with RHS than the operator after RHS, let
- // the pending operator take RHS as its LHS.
- int NextPrec = GetTokPrecedence();
- if (TokPrec &lt; NextPrec) {
- RHS = ParseBinOpRHS(TokPrec+1, RHS);
- if (RHS == 0) return 0;
- }
-
- // Merge LHS/RHS.
- LHS = new BinaryExprAST(BinOp, LHS, RHS);
- }
-}
-
-/// expression
-/// ::= primary binoprhs
-///
-static ExprAST *ParseExpression() {
- ExprAST *LHS = ParsePrimary();
- if (!LHS) return 0;
-
- return ParseBinOpRHS(0, LHS);
-}
-
-/// prototype
-/// ::= id '(' id* ')'
-static PrototypeAST *ParsePrototype() {
- if (CurTok != tok_identifier)
- return ErrorP("Expected function name in prototype");
-
- std::string FnName = IdentifierStr;
- getNextToken();
-
- if (CurTok != '(')
- return ErrorP("Expected '(' in prototype");
-
- std::vector&lt;std::string&gt; ArgNames;
- while (getNextToken() == tok_identifier)
- ArgNames.push_back(IdentifierStr);
- if (CurTok != ')')
- return ErrorP("Expected ')' in prototype");
-
- // success.
- getNextToken(); // eat ')'.
-
- return new PrototypeAST(FnName, ArgNames);
-}
-
-/// definition ::= 'def' prototype expression
-static FunctionAST *ParseDefinition() {
- getNextToken(); // eat def.
- PrototypeAST *Proto = ParsePrototype();
- if (Proto == 0) return 0;
-
- if (ExprAST *E = ParseExpression())
- return new FunctionAST(Proto, E);
- return 0;
-}
-
-/// toplevelexpr ::= expression
-static FunctionAST *ParseTopLevelExpr() {
- if (ExprAST *E = ParseExpression()) {
- // Make an anonymous proto.
- PrototypeAST *Proto = new PrototypeAST("", std::vector&lt;std::string&gt;());
- return new FunctionAST(Proto, E);
- }
- return 0;
-}
-
-/// external ::= 'extern' prototype
-static PrototypeAST *ParseExtern() {
- getNextToken(); // eat extern.
- return ParsePrototype();
-}
-
-//===----------------------------------------------------------------------===//
-// Top-Level parsing
-//===----------------------------------------------------------------------===//
-
-static void HandleDefinition() {
- if (FunctionAST *F = ParseDefinition()) {
- fprintf(stderr, "Parsed a function definition.\n");
- } else {
- // Skip token for error recovery.
- getNextToken();
- }
-}
-
-static void HandleExtern() {
- if (PrototypeAST *P = ParseExtern()) {
- fprintf(stderr, "Parsed an extern\n");
- } else {
- // Skip token for error recovery.
- getNextToken();
- }
-}
-
-static void HandleTopLevelExpression() {
- // Evaluate a top-level expression into an anonymous function.
- if (FunctionAST *F = ParseTopLevelExpr()) {
- fprintf(stderr, "Parsed a top-level expr\n");
- } else {
- // Skip token for error recovery.
- getNextToken();
- }
-}
-
-/// top ::= definition | external | expression | ';'
-static void MainLoop() {
- while (1) {
- fprintf(stderr, "ready&gt; ");
- switch (CurTok) {
- case tok_eof: return;
- case ';': getNextToken(); break; // ignore top-level semicolons.
- case tok_def: HandleDefinition(); break;
- case tok_extern: HandleExtern(); break;
- default: HandleTopLevelExpression(); break;
- }
- }
-}
-
-//===----------------------------------------------------------------------===//
-// Main driver code.
-//===----------------------------------------------------------------------===//
-
-int main() {
- // Install standard binary operators.
- // 1 is lowest precedence.
- BinopPrecedence['&lt;'] = 10;
- BinopPrecedence['+'] = 20;
- BinopPrecedence['-'] = 20;
- BinopPrecedence['*'] = 40; // highest.
-
- // Prime the first token.
- fprintf(stderr, "ready&gt; ");
- getNextToken();
-
- MainLoop();
- return 0;
-}
-</pre>
-</div>
-<a href="LangImpl3.html">Next: Implementing Code Generation to LLVM IR</a>
-</div>
-
-<!-- *********************************************************************** -->
-<hr>
-<address>
- <a href="http://jigsaw.w3.org/css-validator/check/referer"><img
- src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"></a>
- <a href="http://validator.w3.org/check/referer"><img
- src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!"></a>
-
- <a href="mailto:sabre@nondot.org">Chris Lattner</a><br>
- <a href="http://llvm.org">The LLVM Compiler Infrastructure</a><br>
- Last modified: $Date: 2007-10-17 11:05:13 -0700 (Wed, 17 Oct 2007) $
-</address>
-</body>
-</html>
diff --git a/release_23/docs/tutorial/LangImpl3.html b/release_23/docs/tutorial/LangImpl3.html
deleted file mode 100644
index f77f8f83032c..000000000000
--- a/release_23/docs/tutorial/LangImpl3.html
+++ /dev/null
@@ -1,1250 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
- "http://www.w3.org/TR/html4/strict.dtd">
-
-<html>
-<head>
- <title>Kaleidoscope: Implementing code generation to LLVM IR</title>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <meta name="author" content="Chris Lattner">
- <link rel="stylesheet" href="../llvm.css" type="text/css">
-</head>
-
-<body>
-
-<div class="doc_title">Kaleidoscope: Code generation to LLVM IR</div>
-
-<ul>
-<li><a href="index.html">Up to Tutorial Index</a></li>
-<li>Chapter 3
- <ol>
- <li><a href="#intro">Chapter 3 Introduction</a></li>
- <li><a href="#basics">Code Generation Setup</a></li>
- <li><a href="#exprs">Expression Code Generation</a></li>
- <li><a href="#funcs">Function Code Generation</a></li>
- <li><a href="#driver">Driver Changes and Closing Thoughts</a></li>
- <li><a href="#code">Full Code Listing</a></li>
- </ol>
-</li>
-<li><a href="LangImpl4.html">Chapter 4</a>: Adding JIT and Optimizer
-Support</li>
-</ul>
-
-<div class="doc_author">
- <p>Written by <a href="mailto:sabre@nondot.org">Chris Lattner</a></p>
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section"><a name="intro">Chapter 3 Introduction</a></div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>Welcome to Chapter 3 of the "<a href="index.html">Implementing a language
-with LLVM</a>" tutorial. This chapter shows you how to transform the <a
-href="LangImpl2.html">Abstract Syntax Tree</a>, built in Chapter 2, into LLVM IR.
-This will teach you a little bit about how LLVM does things, as well as
-demonstrate how easy it is to use. It's much more work to build a lexer and
-parser than it is to generate LLVM IR code. :)
-</p>
-
-<p><b>Please note</b>: the code in this chapter and later require LLVM 2.2 or
-LLVM SVN to work. LLVM 2.1 and before will not work with it.</p>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section"><a name="basics">Code Generation Setup</a></div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>
-In order to generate LLVM IR, we want some simple setup to get started. First
-we define virtual code generation (codegen) methods in each AST class:</p>
-
-<div class="doc_code">
-<pre>
-/// ExprAST - Base class for all expression nodes.
-class ExprAST {
-public:
- virtual ~ExprAST() {}
- <b>virtual Value *Codegen() = 0;</b>
-};
-
-/// NumberExprAST - Expression class for numeric literals like "1.0".
-class NumberExprAST : public ExprAST {
- double Val;
-public:
- explicit NumberExprAST(double val) : Val(val) {}
- <b>virtual Value *Codegen();</b>
-};
-...
-</pre>
-</div>
-
-<p>The Codegen() method says to emit IR for that AST node along with all the things it
-depends on, and they all return an LLVM Value object.
-"Value" is the class used to represent a "<a
-href="http://en.wikipedia.org/wiki/Static_single_assignment_form">Static Single
-Assignment (SSA)</a> register" or "SSA value" in LLVM. The most distinct aspect
-of SSA values is that their value is computed as the related instruction
-executes, and it does not get a new value until (and if) the instruction
-re-executes. In other words, there is no way to "change" an SSA value. For
-more information, please read up on <a
-href="http://en.wikipedia.org/wiki/Static_single_assignment_form">Static Single
-Assignment</a> - the concepts are really quite natural once you grok them.</p>
-
-<p>Note that instead of adding virtual methods to the ExprAST class hierarchy,
-it could also make sense to use a <a
-href="http://en.wikipedia.org/wiki/Visitor_pattern">visitor pattern</a> or some
-other way to model this. Again, this tutorial won't dwell on good software
-engineering practices: for our purposes, adding a virtual method is
-simplest.</p>
-
-<p>The
-second thing we want is an "Error" method like we used for the parser, which will
-be used to report errors found during code generation (for example, use of an
-undeclared parameter):</p>
-
-<div class="doc_code">
-<pre>
-Value *ErrorV(const char *Str) { Error(Str); return 0; }
-
-static Module *TheModule;
-static IRBuilder Builder;
-static std::map&lt;std::string, Value*&gt; NamedValues;
-</pre>
-</div>
-
-<p>The static variables will be used during code generation. <tt>TheModule</tt>
-is the LLVM construct that contains all of the functions and global variables in
-a chunk of code. In many ways, it is the top-level structure that the LLVM IR
-uses to contain code.</p>
-
-<p>The <tt>Builder</tt> object is a helper object that makes it easy to generate
-LLVM instructions. Instances of the <a
-href="http://llvm.org/doxygen/IRBuilder_8h-source.html"><tt>IRBuilder</tt></a>
-class keep track of the current place to insert instructions and has methods to
-create new instructions.</p>
-
-<p>The <tt>NamedValues</tt> map keeps track of which values are defined in the
-current scope and what their LLVM representation is. (In other words, it is a
-symbol table for the code). In this form of Kaleidoscope, the only things that
-can be referenced are function parameters. As such, function parameters will
-be in this map when generating code for their function body.</p>
-
-<p>
-With these basics in place, we can start talking about how to generate code for
-each expression. Note that this assumes that the <tt>Builder</tt> has been set
-up to generate code <em>into</em> something. For now, we'll assume that this
-has already been done, and we'll just use it to emit code.
-</p>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section"><a name="exprs">Expression Code Generation</a></div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>Generating LLVM code for expression nodes is very straightforward: less
-than 45 lines of commented code for all four of our expression nodes. First
-we'll do numeric literals:</p>
-
-<div class="doc_code">
-<pre>
-Value *NumberExprAST::Codegen() {
- return ConstantFP::get(Type::DoubleTy, APFloat(Val));
-}
-</pre>
-</div>
-
-<p>In the LLVM IR, numeric constants are represented with the
-<tt>ConstantFP</tt> class, which holds the numeric value in an <tt>APFloat</tt>
-internally (<tt>APFloat</tt> has the capability of holding floating point
-constants of <em>A</em>rbitrary <em>P</em>recision). This code basically just
-creates and returns a <tt>ConstantFP</tt>. Note that in the LLVM IR
-that constants are all uniqued together and shared. For this reason, the API
-uses "the foo::get(..)" idiom instead of "new foo(..)" or "foo::create(..)".</p>
-
-<div class="doc_code">
-<pre>
-Value *VariableExprAST::Codegen() {
- // Look this variable up in the function.
- Value *V = NamedValues[Name];
- return V ? V : ErrorV("Unknown variable name");
-}
-</pre>
-</div>
-
-<p>References to variables are also quite simple using LLVM. In the simple version
-of Kaleidoscope, we assume that the variable has already been emited somewhere
-and its value is available. In practice, the only values that can be in the
-<tt>NamedValues</tt> map are function arguments. This
-code simply checks to see that the specified name is in the map (if not, an
-unknown variable is being referenced) and returns the value for it. In future
-chapters, we'll add support for <a href="LangImpl5.html#for">loop induction
-variables</a> in the symbol table, and for <a
-href="LangImpl7.html#localvars">local variables</a>.</p>
-
-<div class="doc_code">
-<pre>
-Value *BinaryExprAST::Codegen() {
- Value *L = LHS-&gt;Codegen();
- Value *R = RHS-&gt;Codegen();
- if (L == 0 || R == 0) return 0;
-
- switch (Op) {
- case '+': return Builder.CreateAdd(L, R, "addtmp");
- case '-': return Builder.CreateSub(L, R, "subtmp");
- case '*': return Builder.CreateMul(L, R, "multmp");
- case '&lt;':
- L = Builder.CreateFCmpULT(L, R, "cmptmp");
- // Convert bool 0/1 to double 0.0 or 1.0
- return Builder.CreateUIToFP(L, Type::DoubleTy, "booltmp");
- default: return ErrorV("invalid binary operator");
- }
-}
-</pre>
-</div>
-
-<p>Binary operators start to get more interesting. The basic idea here is that
-we recursively emit code for the left-hand side of the expression, then the
-right-hand side, then we compute the result of the binary expression. In this
-code, we do a simple switch on the opcode to create the right LLVM instruction.
-</p>
-
-<p>In the example above, the LLVM builder class is starting to show its value.
-IRBuilder knows where to insert the newly created instruction, all you have to
-do is specify what instruction to create (e.g. with <tt>CreateAdd</tt>), which
-operands to use (<tt>L</tt> and <tt>R</tt> here) and optionally provide a name
-for the generated instruction.</p>
-
-<p>One nice thing about LLVM is that the name is just a hint. For instance, if
-the code above emits multiple "addtmp" variables, LLVM will automatically
-provide each one with an increasing, unique numeric suffix. Local value names
-for instructions are purely optional, but it makes it much easier to read the
-IR dumps.</p>
-
-<p><a href="../LangRef.html#instref">LLVM instructions</a> are constrained by
-strict rules: for example, the Left and Right operators of
-an <a href="../LangRef.html#i_add">add instruction</a> must have the same
-type, and the result type of the add must match the operand types. Because
-all values in Kaleidoscope are doubles, this makes for very simple code for add,
-sub and mul.</p>
-
-<p>On the other hand, LLVM specifies that the <a
-href="../LangRef.html#i_fcmp">fcmp instruction</a> always returns an 'i1' value
-(a one bit integer). The problem with this is that Kaleidoscope wants the value to be a 0.0 or 1.0 value. In order to get these semantics, we combine the fcmp instruction with
-a <a href="../LangRef.html#i_uitofp">uitofp instruction</a>. This instruction
-converts its input integer into a floating point value by treating the input
-as an unsigned value. In contrast, if we used the <a
-href="../LangRef.html#i_sitofp">sitofp instruction</a>, the Kaleidoscope '&lt;'
-operator would return 0.0 and -1.0, depending on the input value.</p>
-
-<div class="doc_code">
-<pre>
-Value *CallExprAST::Codegen() {
- // Look up the name in the global module table.
- Function *CalleeF = TheModule-&gt;getFunction(Callee);
- if (CalleeF == 0)
- return ErrorV("Unknown function referenced");
-
- // If argument mismatch error.
- if (CalleeF-&gt;arg_size() != Args.size())
- return ErrorV("Incorrect # arguments passed");
-
- std::vector&lt;Value*&gt; ArgsV;
- for (unsigned i = 0, e = Args.size(); i != e; ++i) {
- ArgsV.push_back(Args[i]-&gt;Codegen());
- if (ArgsV.back() == 0) return 0;
- }
-
- return Builder.CreateCall(CalleeF, ArgsV.begin(), ArgsV.end(), "calltmp");
-}
-</pre>
-</div>
-
-<p>Code generation for function calls is quite straightforward with LLVM. The
-code above initially does a function name lookup in the LLVM Module's symbol
-table. Recall that the LLVM Module is the container that holds all of the
-functions we are JIT'ing. By giving each function the same name as what the
-user specifies, we can use the LLVM symbol table to resolve function names for
-us.</p>
-
-<p>Once we have the function to call, we recursively codegen each argument that
-is to be passed in, and create an LLVM <a href="../LangRef.html#i_call">call
-instruction</a>. Note that LLVM uses the native C calling conventions by
-default, allowing these calls to also call into standard library functions like
-"sin" and "cos", with no additional effort.</p>
-
-<p>This wraps up our handling of the four basic expressions that we have so far
-in Kaleidoscope. Feel free to go in and add some more. For example, by
-browsing the <a href="../LangRef.html">LLVM language reference</a> you'll find
-several other interesting instructions that are really easy to plug into our
-basic framework.</p>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section"><a name="funcs">Function Code Generation</a></div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>Code generation for prototypes and functions must handle a number of
-details, which make their code less beautiful than expression code
-generation, but allows us to illustrate some important points. First, lets
-talk about code generation for prototypes: they are used both for function
-bodies and external function declarations. The code starts with:</p>
-
-<div class="doc_code">
-<pre>
-Function *PrototypeAST::Codegen() {
- // Make the function type: double(double,double) etc.
- std::vector&lt;const Type*&gt; Doubles(Args.size(), Type::DoubleTy);
- FunctionType *FT = FunctionType::get(Type::DoubleTy, Doubles, false);
-
- Function *F = Function::Create(FT, Function::ExternalLinkage, Name, TheModule);
-</pre>
-</div>
-
-<p>This code packs a lot of power into a few lines. Note first that this
-function returns a "Function*" instead of a "Value*". Because a "prototype"
-really talks about the external interface for a function (not the value computed
-by an expression), it makes sense for it to return the LLVM Function it
-corresponds to when codegen'd.</p>
-
-<p>The call to <tt>FunctionType::get</tt> creates
-the <tt>FunctionType</tt> that should be used for a given Prototype. Since all
-function arguments in Kaleidoscope are of type double, the first line creates
-a vector of "N" LLVM double types. It then uses the <tt>FunctionType::get</tt>
-method to create a function type that takes "N" doubles as arguments, returns
-one double as a result, and that is not vararg (the false parameter indicates
-this). Note that Types in LLVM are uniqued just like Constants are, so you
-don't "new" a type, you "get" it.</p>
-
-<p>The final line above actually creates the function that the prototype will
-correspond to. This indicates the type, linkage and name to use, as well as which
-module to insert into. "<a href="../LangRef.html#linkage">external linkage</a>"
-means that the function may be defined outside the current module and/or that it
-is callable by functions outside the module. The Name passed in is the name the
-user specified: since "<tt>TheModule</tt>" is specified, this name is registered
-in "<tt>TheModule</tt>"s symbol table, which is used by the function call code
-above.</p>
-
-<div class="doc_code">
-<pre>
- // If F conflicted, there was already something named 'Name'. If it has a
- // body, don't allow redefinition or reextern.
- if (F-&gt;getName() != Name) {
- // Delete the one we just made and get the existing one.
- F-&gt;eraseFromParent();
- F = TheModule-&gt;getFunction(Name);
-</pre>
-</div>
-
-<p>The Module symbol table works just like the Function symbol table when it
-comes to name conflicts: if a new function is created with a name was previously
-added to the symbol table, it will get implicitly renamed when added to the
-Module. The code above exploits this fact to determine if there was a previous
-definition of this function.</p>
-
-<p>In Kaleidoscope, I choose to allow redefinitions of functions in two cases:
-first, we want to allow 'extern'ing a function more than once, as long as the
-prototypes for the externs match (since all arguments have the same type, we
-just have to check that the number of arguments match). Second, we want to
-allow 'extern'ing a function and then definining a body for it. This is useful
-when defining mutually recursive functions.</p>
-
-<p>In order to implement this, the code above first checks to see if there is
-a collision on the name of the function. If so, it deletes the function we just
-created (by calling <tt>eraseFromParent</tt>) and then calling
-<tt>getFunction</tt> to get the existing function with the specified name. Note
-that many APIs in LLVM have "erase" forms and "remove" forms. The "remove" form
-unlinks the object from its parent (e.g. a Function from a Module) and returns
-it. The "erase" form unlinks the object and then deletes it.</p>
-
-<div class="doc_code">
-<pre>
- // If F already has a body, reject this.
- if (!F-&gt;empty()) {
- ErrorF("redefinition of function");
- return 0;
- }
-
- // If F took a different number of args, reject.
- if (F-&gt;arg_size() != Args.size()) {
- ErrorF("redefinition of function with different # args");
- return 0;
- }
- }
-</pre>
-</div>
-
-<p>In order to verify the logic above, we first check to see if the pre-existing
-function is "empty". In this case, empty means that it has no basic blocks in
-it, which means it has no body. If it has no body, it is a forward
-declaration. Since we don't allow anything after a full definition of the
-function, the code rejects this case. If the previous reference to a function
-was an 'extern', we simply verify that the number of arguments for that
-definition and this one match up. If not, we emit an error.</p>
-
-<div class="doc_code">
-<pre>
- // Set names for all arguments.
- unsigned Idx = 0;
- for (Function::arg_iterator AI = F-&gt;arg_begin(); Idx != Args.size();
- ++AI, ++Idx) {
- AI-&gt;setName(Args[Idx]);
-
- // Add arguments to variable symbol table.
- NamedValues[Args[Idx]] = AI;
- }
- return F;
-}
-</pre>
-</div>
-
-<p>The last bit of code for prototypes loops over all of the arguments in the
-function, setting the name of the LLVM Argument objects to match, and registering
-the arguments in the <tt>NamedValues</tt> map for future use by the
-<tt>VariableExprAST</tt> AST node. Once this is set up, it returns the Function
-object to the caller. Note that we don't check for conflicting
-argument names here (e.g. "extern foo(a b a)"). Doing so would be very
-straight-forward with the mechanics we have already used above.</p>
-
-<div class="doc_code">
-<pre>
-Function *FunctionAST::Codegen() {
- NamedValues.clear();
-
- Function *TheFunction = Proto-&gt;Codegen();
- if (TheFunction == 0)
- return 0;
-</pre>
-</div>
-
-<p>Code generation for function definitions starts out simply enough: we just
-codegen the prototype (Proto) and verify that it is ok. We then clear out the
-<tt>NamedValues</tt> map to make sure that there isn't anything in it from the
-last function we compiled. Code generation of the prototype ensures that there
-is an LLVM Function object that is ready to go for us.</p>
-
-<div class="doc_code">
-<pre>
- // Create a new basic block to start insertion into.
- BasicBlock *BB = BasicBlock::Create("entry", TheFunction);
- Builder.SetInsertPoint(BB);
-
- if (Value *RetVal = Body-&gt;Codegen()) {
-</pre>
-</div>
-
-<p>Now we get to the point where the <tt>Builder</tt> is set up. The first
-line creates a new <a href="http://en.wikipedia.org/wiki/Basic_block">basic
-block</a> (named "entry"), which is inserted into <tt>TheFunction</tt>. The
-second line then tells the builder that new instructions should be inserted into
-the end of the new basic block. Basic blocks in LLVM are an important part
-of functions that define the <a
-href="http://en.wikipedia.org/wiki/Control_flow_graph">Control Flow Graph</a>.
-Since we don't have any control flow, our functions will only contain one
-block at this point. We'll fix this in <a href="LangImpl5.html">Chapter 5</a> :).</p>
-
-<div class="doc_code">
-<pre>
- if (Value *RetVal = Body-&gt;Codegen()) {
- // Finish off the function.
- Builder.CreateRet(RetVal);
-
- // Validate the generated code, checking for consistency.
- verifyFunction(*TheFunction);
- return TheFunction;
- }
-</pre>
-</div>
-
-<p>Once the insertion point is set up, we call the <tt>CodeGen()</tt> method for
-the root expression of the function. If no error happens, this emits code to
-compute the expression into the entry block and returns the value that was
-computed. Assuming no error, we then create an LLVM <a
-href="../LangRef.html#i_ret">ret instruction</a>, which completes the function.
-Once the function is built, we call <tt>verifyFunction</tt>, which
-is provided by LLVM. This function does a variety of consistency checks on the
-generated code, to determine if our compiler is doing everything right. Using
-this is important: it can catch a lot of bugs. Once the function is finished
-and validated, we return it.</p>
-
-<div class="doc_code">
-<pre>
- // Error reading body, remove function.
- TheFunction-&gt;eraseFromParent();
- return 0;
-}
-</pre>
-</div>
-
-<p>The only piece left here is handling of the error case. For simplicity, we
-handle this by merely deleting the function we produced with the
-<tt>eraseFromParent</tt> method. This allows the user to redefine a function
-that they incorrectly typed in before: if we didn't delete it, it would live in
-the symbol table, with a body, preventing future redefinition.</p>
-
-<p>This code does have a bug, though. Since the <tt>PrototypeAST::Codegen</tt>
-can return a previously defined forward declaration, our code can actually delete
-a forward declaration. There are a number of ways to fix this bug, see what you
-can come up with! Here is a testcase:</p>
-
-<div class="doc_code">
-<pre>
-extern foo(a b); # ok, defines foo.
-def foo(a b) c; # error, 'c' is invalid.
-def bar() foo(1, 2); # error, unknown function "foo"
-</pre>
-</div>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section"><a name="driver">Driver Changes and
-Closing Thoughts</a></div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>
-For now, code generation to LLVM doesn't really get us much, except that we can
-look at the pretty IR calls. The sample code inserts calls to Codegen into the
-"<tt>HandleDefinition</tt>", "<tt>HandleExtern</tt>" etc functions, and then
-dumps out the LLVM IR. This gives a nice way to look at the LLVM IR for simple
-functions. For example:
-</p>
-
-<div class="doc_code">
-<pre>
-ready> <b>4+5</b>;
-Read top-level expression:
-define double @""() {
-entry:
- %addtmp = add double 4.000000e+00, 5.000000e+00
- ret double %addtmp
-}
-</pre>
-</div>
-
-<p>Note how the parser turns the top-level expression into anonymous functions
-for us. This will be handy when we add <a href="LangImpl4.html#jit">JIT
-support</a> in the next chapter. Also note that the code is very literally
-transcribed, no optimizations are being performed. We will
-<a href="LangImpl4.html#trivialconstfold">add optimizations</a> explicitly in
-the next chapter.</p>
-
-<div class="doc_code">
-<pre>
-ready&gt; <b>def foo(a b) a*a + 2*a*b + b*b;</b>
-Read function definition:
-define double @foo(double %a, double %b) {
-entry:
- %multmp = mul double %a, %a
- %multmp1 = mul double 2.000000e+00, %a
- %multmp2 = mul double %multmp1, %b
- %addtmp = add double %multmp, %multmp2
- %multmp3 = mul double %b, %b
- %addtmp4 = add double %addtmp, %multmp3
- ret double %addtmp4
-}
-</pre>
-</div>
-
-<p>This shows some simple arithmetic. Notice the striking similarity to the
-LLVM builder calls that we use to create the instructions.</p>
-
-<div class="doc_code">
-<pre>
-ready&gt; <b>def bar(a) foo(a, 4.0) + bar(31337);</b>
-Read function definition:
-define double @bar(double %a) {
-entry:
- %calltmp = call double @foo( double %a, double 4.000000e+00 )
- %calltmp1 = call double @bar( double 3.133700e+04 )
- %addtmp = add double %calltmp, %calltmp1
- ret double %addtmp
-}
-</pre>
-</div>
-
-<p>This shows some function calls. Note that this function will take a long
-time to execute if you call it. In the future we'll add conditional control
-flow to actually make recursion useful :).</p>
-
-<div class="doc_code">
-<pre>
-ready&gt; <b>extern cos(x);</b>
-Read extern:
-declare double @cos(double)
-
-ready&gt; <b>cos(1.234);</b>
-Read top-level expression:
-define double @""() {
-entry:
- %calltmp = call double @cos( double 1.234000e+00 )
- ret double %calltmp
-}
-</pre>
-</div>
-
-<p>This shows an extern for the libm "cos" function, and a call to it.</p>
-
-
-<div class="doc_code">
-<pre>
-ready&gt; <b>^D</b>
-; ModuleID = 'my cool jit'
-
-define double @""() {
-entry:
- %addtmp = add double 4.000000e+00, 5.000000e+00
- ret double %addtmp
-}
-
-define double @foo(double %a, double %b) {
-entry:
- %multmp = mul double %a, %a
- %multmp1 = mul double 2.000000e+00, %a
- %multmp2 = mul double %multmp1, %b
- %addtmp = add double %multmp, %multmp2
- %multmp3 = mul double %b, %b
- %addtmp4 = add double %addtmp, %multmp3
- ret double %addtmp4
-}
-
-define double @bar(double %a) {
-entry:
- %calltmp = call double @foo( double %a, double 4.000000e+00 )
- %calltmp1 = call double @bar( double 3.133700e+04 )
- %addtmp = add double %calltmp, %calltmp1
- ret double %addtmp
-}
-
-declare double @cos(double)
-
-define double @""() {
-entry:
- %calltmp = call double @cos( double 1.234000e+00 )
- ret double %calltmp
-}
-</pre>
-</div>
-
-<p>When you quit the current demo, it dumps out the IR for the entire module
-generated. Here you can see the big picture with all the functions referencing
-each other.</p>
-
-<p>This wraps up the third chapter of the Kaleidoscope tutorial. Up next, we'll
-describe how to <a href="LangImpl4.html">add JIT codegen and optimizer
-support</a> to this so we can actually start running code!</p>
-
-</div>
-
-
-<!-- *********************************************************************** -->
-<div class="doc_section"><a name="code">Full Code Listing</a></div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>
-Here is the complete code listing for our running example, enhanced with the
-LLVM code generator. Because this uses the LLVM libraries, we need to link
-them in. To do this, we use the <a
-href="http://llvm.org/cmds/llvm-config.html">llvm-config</a> tool to inform
-our makefile/command line about which options to use:</p>
-
-<div class="doc_code">
-<pre>
- # Compile
- g++ -g -O3 toy.cpp `llvm-config --cppflags --ldflags --libs core` -o toy
- # Run
- ./toy
-</pre>
-</div>
-
-<p>Here is the code:</p>
-
-<div class="doc_code">
-<pre>
-// To build this:
-// See example below.
-
-#include "llvm/DerivedTypes.h"
-#include "llvm/Module.h"
-#include "llvm/Analysis/Verifier.h"
-#include "llvm/Support/IRBuilder.h"
-#include &lt;cstdio&gt;
-#include &lt;string&gt;
-#include &lt;map&gt;
-#include &lt;vector&gt;
-using namespace llvm;
-
-//===----------------------------------------------------------------------===//
-// Lexer
-//===----------------------------------------------------------------------===//
-
-// The lexer returns tokens [0-255] if it is an unknown character, otherwise one
-// of these for known things.
-enum Token {
- tok_eof = -1,
-
- // commands
- tok_def = -2, tok_extern = -3,
-
- // primary
- tok_identifier = -4, tok_number = -5,
-};
-
-static std::string IdentifierStr; // Filled in if tok_identifier
-static double NumVal; // Filled in if tok_number
-
-/// gettok - Return the next token from standard input.
-static int gettok() {
- static int LastChar = ' ';
-
- // Skip any whitespace.
- while (isspace(LastChar))
- LastChar = getchar();
-
- if (isalpha(LastChar)) { // identifier: [a-zA-Z][a-zA-Z0-9]*
- IdentifierStr = LastChar;
- while (isalnum((LastChar = getchar())))
- IdentifierStr += LastChar;
-
- if (IdentifierStr == "def") return tok_def;
- if (IdentifierStr == "extern") return tok_extern;
- return tok_identifier;
- }
-
- if (isdigit(LastChar) || LastChar == '.') { // Number: [0-9.]+
- std::string NumStr;
- do {
- NumStr += LastChar;
- LastChar = getchar();
- } while (isdigit(LastChar) || LastChar == '.');
-
- NumVal = strtod(NumStr.c_str(), 0);
- return tok_number;
- }
-
- if (LastChar == '#') {
- // Comment until end of line.
- do LastChar = getchar();
- while (LastChar != EOF &amp;&amp; LastChar != '\n' &amp;&amp; LastChar != '\r');
-
- if (LastChar != EOF)
- return gettok();
- }
-
- // Check for end of file. Don't eat the EOF.
- if (LastChar == EOF)
- return tok_eof;
-
- // Otherwise, just return the character as its ascii value.
- int ThisChar = LastChar;
- LastChar = getchar();
- return ThisChar;
-}
-
-//===----------------------------------------------------------------------===//
-// Abstract Syntax Tree (aka Parse Tree)
-//===----------------------------------------------------------------------===//
-
-/// ExprAST - Base class for all expression nodes.
-class ExprAST {
-public:
- virtual ~ExprAST() {}
- virtual Value *Codegen() = 0;
-};
-
-/// NumberExprAST - Expression class for numeric literals like "1.0".
-class NumberExprAST : public ExprAST {
- double Val;
-public:
- explicit NumberExprAST(double val) : Val(val) {}
- virtual Value *Codegen();
-};
-
-/// VariableExprAST - Expression class for referencing a variable, like "a".
-class VariableExprAST : public ExprAST {
- std::string Name;
-public:
- explicit VariableExprAST(const std::string &amp;name) : Name(name) {}
- virtual Value *Codegen();
-};
-
-/// BinaryExprAST - Expression class for a binary operator.
-class BinaryExprAST : public ExprAST {
- char Op;
- ExprAST *LHS, *RHS;
-public:
- BinaryExprAST(char op, ExprAST *lhs, ExprAST *rhs)
- : Op(op), LHS(lhs), RHS(rhs) {}
- virtual Value *Codegen();
-};
-
-/// CallExprAST - Expression class for function calls.
-class CallExprAST : public ExprAST {
- std::string Callee;
- std::vector&lt;ExprAST*&gt; Args;
-public:
- CallExprAST(const std::string &amp;callee, std::vector&lt;ExprAST*&gt; &amp;args)
- : Callee(callee), Args(args) {}
- virtual Value *Codegen();
-};
-
-/// PrototypeAST - This class represents the "prototype" for a function,
-/// which captures its argument names as well as if it is an operator.
-class PrototypeAST {
- std::string Name;
- std::vector&lt;std::string&gt; Args;
-public:
- PrototypeAST(const std::string &amp;name, const std::vector&lt;std::string&gt; &amp;args)
- : Name(name), Args(args) {}
-
- Function *Codegen();
-};
-
-/// FunctionAST - This class represents a function definition itself.
-class FunctionAST {
- PrototypeAST *Proto;
- ExprAST *Body;
-public:
- FunctionAST(PrototypeAST *proto, ExprAST *body)
- : Proto(proto), Body(body) {}
-
- Function *Codegen();
-};
-
-//===----------------------------------------------------------------------===//
-// Parser
-//===----------------------------------------------------------------------===//
-
-/// CurTok/getNextToken - Provide a simple token buffer. CurTok is the current
-/// token the parser it looking at. getNextToken reads another token from the
-/// lexer and updates CurTok with its results.
-static int CurTok;
-static int getNextToken() {
- return CurTok = gettok();
-}
-
-/// BinopPrecedence - This holds the precedence for each binary operator that is
-/// defined.
-static std::map&lt;char, int&gt; BinopPrecedence;
-
-/// GetTokPrecedence - Get the precedence of the pending binary operator token.
-static int GetTokPrecedence() {
- if (!isascii(CurTok))
- return -1;
-
- // Make sure it's a declared binop.
- int TokPrec = BinopPrecedence[CurTok];
- if (TokPrec &lt;= 0) return -1;
- return TokPrec;
-}
-
-/// Error* - These are little helper functions for error handling.
-ExprAST *Error(const char *Str) { fprintf(stderr, "Error: %s\n", Str);return 0;}
-PrototypeAST *ErrorP(const char *Str) { Error(Str); return 0; }
-FunctionAST *ErrorF(const char *Str) { Error(Str); return 0; }
-
-static ExprAST *ParseExpression();
-
-/// identifierexpr
-/// ::= identifier
-/// ::= identifier '(' expression* ')'
-static ExprAST *ParseIdentifierExpr() {
- std::string IdName = IdentifierStr;
-
- getNextToken(); // eat identifier.
-
- if (CurTok != '(') // Simple variable ref.
- return new VariableExprAST(IdName);
-
- // Call.
- getNextToken(); // eat (
- std::vector&lt;ExprAST*&gt; Args;
- if (CurTok != ')') {
- while (1) {
- ExprAST *Arg = ParseExpression();
- if (!Arg) return 0;
- Args.push_back(Arg);
-
- if (CurTok == ')') break;
-
- if (CurTok != ',')
- return Error("Expected ')' or ',' in argument list");
- getNextToken();
- }
- }
-
- // Eat the ')'.
- getNextToken();
-
- return new CallExprAST(IdName, Args);
-}
-
-/// numberexpr ::= number
-static ExprAST *ParseNumberExpr() {
- ExprAST *Result = new NumberExprAST(NumVal);
- getNextToken(); // consume the number
- return Result;
-}
-
-/// parenexpr ::= '(' expression ')'
-static ExprAST *ParseParenExpr() {
- getNextToken(); // eat (.
- ExprAST *V = ParseExpression();
- if (!V) return 0;
-
- if (CurTok != ')')
- return Error("expected ')'");
- getNextToken(); // eat ).
- return V;
-}
-
-/// primary
-/// ::= identifierexpr
-/// ::= numberexpr
-/// ::= parenexpr
-static ExprAST *ParsePrimary() {
- switch (CurTok) {
- default: return Error("unknown token when expecting an expression");
- case tok_identifier: return ParseIdentifierExpr();
- case tok_number: return ParseNumberExpr();
- case '(': return ParseParenExpr();
- }
-}
-
-/// binoprhs
-/// ::= ('+' primary)*
-static ExprAST *ParseBinOpRHS(int ExprPrec, ExprAST *LHS) {
- // If this is a binop, find its precedence.
- while (1) {
- int TokPrec = GetTokPrecedence();
-
- // If this is a binop that binds at least as tightly as the current binop,
- // consume it, otherwise we are done.
- if (TokPrec &lt; ExprPrec)
- return LHS;
-
- // Okay, we know this is a binop.
- int BinOp = CurTok;
- getNextToken(); // eat binop
-
- // Parse the primary expression after the binary operator.
- ExprAST *RHS = ParsePrimary();
- if (!RHS) return 0;
-
- // If BinOp binds less tightly with RHS than the operator after RHS, let
- // the pending operator take RHS as its LHS.
- int NextPrec = GetTokPrecedence();
- if (TokPrec &lt; NextPrec) {
- RHS = ParseBinOpRHS(TokPrec+1, RHS);
- if (RHS == 0) return 0;
- }
-
- // Merge LHS/RHS.
- LHS = new BinaryExprAST(BinOp, LHS, RHS);
- }
-}
-
-/// expression
-/// ::= primary binoprhs
-///
-static ExprAST *ParseExpression() {
- ExprAST *LHS = ParsePrimary();
- if (!LHS) return 0;
-
- return ParseBinOpRHS(0, LHS);
-}
-
-/// prototype
-/// ::= id '(' id* ')'
-static PrototypeAST *ParsePrototype() {
- if (CurTok != tok_identifier)
- return ErrorP("Expected function name in prototype");
-
- std::string FnName = IdentifierStr;
- getNextToken();
-
- if (CurTok != '(')
- return ErrorP("Expected '(' in prototype");
-
- std::vector&lt;std::string&gt; ArgNames;
- while (getNextToken() == tok_identifier)
- ArgNames.push_back(IdentifierStr);
- if (CurTok != ')')
- return ErrorP("Expected ')' in prototype");
-
- // success.
- getNextToken(); // eat ')'.
-
- return new PrototypeAST(FnName, ArgNames);
-}
-
-/// definition ::= 'def' prototype expression
-static FunctionAST *ParseDefinition() {
- getNextToken(); // eat def.
- PrototypeAST *Proto = ParsePrototype();
- if (Proto == 0) return 0;
-
- if (ExprAST *E = ParseExpression())
- return new FunctionAST(Proto, E);
- return 0;
-}
-
-/// toplevelexpr ::= expression
-static FunctionAST *ParseTopLevelExpr() {
- if (ExprAST *E = ParseExpression()) {
- // Make an anonymous proto.
- PrototypeAST *Proto = new PrototypeAST("", std::vector&lt;std::string&gt;());
- return new FunctionAST(Proto, E);
- }
- return 0;
-}
-
-/// external ::= 'extern' prototype
-static PrototypeAST *ParseExtern() {
- getNextToken(); // eat extern.
- return ParsePrototype();
-}
-
-//===----------------------------------------------------------------------===//
-// Code Generation
-//===----------------------------------------------------------------------===//
-
-static Module *TheModule;
-static IRBuilder Builder;
-static std::map&lt;std::string, Value*&gt; NamedValues;
-
-Value *ErrorV(const char *Str) { Error(Str); return 0; }
-
-Value *NumberExprAST::Codegen() {
- return ConstantFP::get(Type::DoubleTy, APFloat(Val));
-}
-
-Value *VariableExprAST::Codegen() {
- // Look this variable up in the function.
- Value *V = NamedValues[Name];
- return V ? V : ErrorV("Unknown variable name");
-}
-
-Value *BinaryExprAST::Codegen() {
- Value *L = LHS-&gt;Codegen();
- Value *R = RHS-&gt;Codegen();
- if (L == 0 || R == 0) return 0;
-
- switch (Op) {
- case '+': return Builder.CreateAdd(L, R, "addtmp");
- case '-': return Builder.CreateSub(L, R, "subtmp");
- case '*': return Builder.CreateMul(L, R, "multmp");
- case '&lt;':
- L = Builder.CreateFCmpULT(L, R, "cmptmp");
- // Convert bool 0/1 to double 0.0 or 1.0
- return Builder.CreateUIToFP(L, Type::DoubleTy, "booltmp");
- default: return ErrorV("invalid binary operator");
- }
-}
-
-Value *CallExprAST::Codegen() {
- // Look up the name in the global module table.
- Function *CalleeF = TheModule-&gt;getFunction(Callee);
- if (CalleeF == 0)
- return ErrorV("Unknown function referenced");
-
- // If argument mismatch error.
- if (CalleeF-&gt;arg_size() != Args.size())
- return ErrorV("Incorrect # arguments passed");
-
- std::vector&lt;Value*&gt; ArgsV;
- for (unsigned i = 0, e = Args.size(); i != e; ++i) {
- ArgsV.push_back(Args[i]-&gt;Codegen());
- if (ArgsV.back() == 0) return 0;
- }
-
- return Builder.CreateCall(CalleeF, ArgsV.begin(), ArgsV.end(), "calltmp");
-}
-
-Function *PrototypeAST::Codegen() {
- // Make the function type: double(double,double) etc.
- std::vector&lt;const Type*&gt; Doubles(Args.size(), Type::DoubleTy);
- FunctionType *FT = FunctionType::get(Type::DoubleTy, Doubles, false);
-
- Function *F = Function::Create(FT, Function::ExternalLinkage, Name, TheModule);
-
- // If F conflicted, there was already something named 'Name'. If it has a
- // body, don't allow redefinition or reextern.
- if (F-&gt;getName() != Name) {
- // Delete the one we just made and get the existing one.
- F-&gt;eraseFromParent();
- F = TheModule-&gt;getFunction(Name);
-
- // If F already has a body, reject this.
- if (!F-&gt;empty()) {
- ErrorF("redefinition of function");
- return 0;
- }
-
- // If F took a different number of args, reject.
- if (F-&gt;arg_size() != Args.size()) {
- ErrorF("redefinition of function with different # args");
- return 0;
- }
- }
-
- // Set names for all arguments.
- unsigned Idx = 0;
- for (Function::arg_iterator AI = F-&gt;arg_begin(); Idx != Args.size();
- ++AI, ++Idx) {
- AI-&gt;setName(Args[Idx]);
-
- // Add arguments to variable symbol table.
- NamedValues[Args[Idx]] = AI;
- }
-
- return F;
-}
-
-Function *FunctionAST::Codegen() {
- NamedValues.clear();
-
- Function *TheFunction = Proto-&gt;Codegen();
- if (TheFunction == 0)
- return 0;
-
- // Create a new basic block to start insertion into.
- BasicBlock *BB = BasicBlock::Create("entry", TheFunction);
- Builder.SetInsertPoint(BB);
-
- if (Value *RetVal = Body-&gt;Codegen()) {
- // Finish off the function.
- Builder.CreateRet(RetVal);
-
- // Validate the generated code, checking for consistency.
- verifyFunction(*TheFunction);
- return TheFunction;
- }
-
- // Error reading body, remove function.
- TheFunction-&gt;eraseFromParent();
- return 0;
-}
-
-//===----------------------------------------------------------------------===//
-// Top-Level parsing and JIT Driver
-//===----------------------------------------------------------------------===//
-
-static void HandleDefinition() {
- if (FunctionAST *F = ParseDefinition()) {
- if (Function *LF = F-&gt;Codegen()) {
- fprintf(stderr, "Read function definition:");
- LF-&gt;dump();
- }
- } else {
- // Skip token for error recovery.
- getNextToken();
- }
-}
-
-static void HandleExtern() {
- if (PrototypeAST *P = ParseExtern()) {
- if (Function *F = P-&gt;Codegen()) {
- fprintf(stderr, "Read extern: ");
- F-&gt;dump();
- }
- } else {
- // Skip token for error recovery.
- getNextToken();
- }
-}
-
-static void HandleTopLevelExpression() {
- // Evaluate a top level expression into an anonymous function.
- if (FunctionAST *F = ParseTopLevelExpr()) {
- if (Function *LF = F-&gt;Codegen()) {
- fprintf(stderr, "Read top-level expression:");
- LF-&gt;dump();
- }
- } else {
- // Skip token for error recovery.
- getNextToken();
- }
-}
-
-/// top ::= definition | external | expression | ';'
-static void MainLoop() {
- while (1) {
- fprintf(stderr, "ready&gt; ");
- switch (CurTok) {
- case tok_eof: return;
- case ';': getNextToken(); break; // ignore top level semicolons.
- case tok_def: HandleDefinition(); break;
- case tok_extern: HandleExtern(); break;
- default: HandleTopLevelExpression(); break;
- }
- }
-}
-
-
-
-//===----------------------------------------------------------------------===//
-// "Library" functions that can be "extern'd" from user code.
-//===----------------------------------------------------------------------===//
-
-/// putchard - putchar that takes a double and returns 0.
-extern "C"
-double putchard(double X) {
- putchar((char)X);
- return 0;
-}
-
-//===----------------------------------------------------------------------===//
-// Main driver code.
-//===----------------------------------------------------------------------===//
-
-int main() {
- TheModule = new Module("my cool jit");
-
- // Install standard binary operators.
- // 1 is lowest precedence.
- BinopPrecedence['&lt;'] = 10;
- BinopPrecedence['+'] = 20;
- BinopPrecedence['-'] = 20;
- BinopPrecedence['*'] = 40; // highest.
-
- // Prime the first token.
- fprintf(stderr, "ready&gt; ");
- getNextToken();
-
- MainLoop();
- TheModule-&gt;dump();
- return 0;
-}
-</pre>
-</div>
-<a href="LangImpl4.html">Next: Adding JIT and Optimizer Support</a>
-</div>
-
-<!-- *********************************************************************** -->
-<hr>
-<address>
- <a href="http://jigsaw.w3.org/css-validator/check/referer"><img
- src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"></a>
- <a href="http://validator.w3.org/check/referer"><img
- src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!"></a>
-
- <a href="mailto:sabre@nondot.org">Chris Lattner</a><br>
- <a href="http://llvm.org">The LLVM Compiler Infrastructure</a><br>
- Last modified: $Date: 2007-10-17 11:05:13 -0700 (Wed, 17 Oct 2007) $
-</address>
-</body>
-</html>
diff --git a/release_23/docs/tutorial/LangImpl4.html b/release_23/docs/tutorial/LangImpl4.html
deleted file mode 100644
index b95626062883..000000000000
--- a/release_23/docs/tutorial/LangImpl4.html
+++ /dev/null
@@ -1,1126 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
- "http://www.w3.org/TR/html4/strict.dtd">
-
-<html>
-<head>
- <title>Kaleidoscope: Adding JIT and Optimizer Support</title>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <meta name="author" content="Chris Lattner">
- <link rel="stylesheet" href="../llvm.css" type="text/css">
-</head>
-
-<body>
-
-<div class="doc_title">Kaleidoscope: Adding JIT and Optimizer Support</div>
-
-<ul>
-<li><a href="index.html">Up to Tutorial Index</a></li>
-<li>Chapter 4
- <ol>
- <li><a href="#intro">Chapter 4 Introduction</a></li>
- <li><a href="#trivialconstfold">Trivial Constant Folding</a></li>
- <li><a href="#optimizerpasses">LLVM Optimization Passes</a></li>
- <li><a href="#jit">Adding a JIT Compiler</a></li>
- <li><a href="#code">Full Code Listing</a></li>
- </ol>
-</li>
-<li><a href="LangImpl5.html">Chapter 5</a>: Extending the Language: Control
-Flow</li>
-</ul>
-
-<div class="doc_author">
- <p>Written by <a href="mailto:sabre@nondot.org">Chris Lattner</a></p>
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section"><a name="intro">Chapter 4 Introduction</a></div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>Welcome to Chapter 4 of the "<a href="index.html">Implementing a language
-with LLVM</a>" tutorial. Chapters 1-3 described the implementation of a simple
-language and added support for generating LLVM IR. This chapter describes
-two new techniques: adding optimizer support to your language, and adding JIT
-compiler support. These additions will demonstrate how to get nice, efficient code
-for the Kaleidoscope language.</p>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section"><a name="trivialconstfold">Trivial Constant
-Folding</a></div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>
-Our demonstration for Chapter 3 is elegant and easy to extend. Unfortunately,
-it does not produce wonderful code. The IRBuilder, however, does give us
-obvious optimizations when compiling simple code:</p>
-
-<div class="doc_code">
-<pre>
-ready&gt; <b>def test(x) 1+2+x;</b>
-Read function definition:
-define double @test(double %x) {
-entry:
- %addtmp = add double 3.000000e+00, %x
- ret double %addtmp
-}
-</pre>
-</div>
-
-<p>This code is not a literal transcription of the AST built by parsing the
-input. That would be:
-
-<div class="doc_code">
-<pre>
-ready&gt; <b>def test(x) 1+2+x;</b>
-Read function definition:
-define double @test(double %x) {
-entry:
- %addtmp = add double 2.000000e+00, 1.000000e+00
- %addtmp1 = add double %addtmp, %x
- ret double %addtmp1
-}
-</pre>
-</div>
-
-Constant folding, as seen above, in particular, is a very common and very
-important optimization: so much so that many language implementors implement
-constant folding support in their AST representation.</p>
-
-<p>With LLVM, you don't need this support in the AST. Since all calls to build
-LLVM IR go through the LLVM IR builder, the builder itself checked to see if
-there was a constant folding opportunity when you call it. If so, it just does
-the constant fold and return the constant instead of creating an instruction.
-
-<p>Well, that was easy :). In practice, we recommend always using
-<tt>IRBuilder</tt> when generating code like this. It has no
-"syntactic overhead" for its use (you don't have to uglify your compiler with
-constant checks everywhere) and it can dramatically reduce the amount of
-LLVM IR that is generated in some cases (particular for languages with a macro
-preprocessor or that use a lot of constants).</p>
-
-<p>On the other hand, the <tt>IRBuilder</tt> is limited by the fact
-that it does all of its analysis inline with the code as it is built. If you
-take a slightly more complex example:</p>
-
-<div class="doc_code">
-<pre>
-ready&gt; <b>def test(x) (1+2+x)*(x+(1+2));</b>
-ready> Read function definition:
-define double @test(double %x) {
-entry:
- %addtmp = add double 3.000000e+00, %x
- %addtmp1 = add double %x, 3.000000e+00
- %multmp = mul double %addtmp, %addtmp1
- ret double %multmp
-}
-</pre>
-</div>
-
-<p>In this case, the LHS and RHS of the multiplication are the same value. We'd
-really like to see this generate "<tt>tmp = x+3; result = tmp*tmp;</tt>" instead
-of computing "<tt>x+3</tt>" twice.</p>
-
-<p>Unfortunately, no amount of local analysis will be able to detect and correct
-this. This requires two transformations: reassociation of expressions (to
-make the add's lexically identical) and Common Subexpression Elimination (CSE)
-to delete the redundant add instruction. Fortunately, LLVM provides a broad
-range of optimizations that you can use, in the form of "passes".</p>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section"><a name="optimizerpasses">LLVM Optimization
- Passes</a></div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>LLVM provides many optimization passes, which do many different sorts of
-things and have different tradeoffs. Unlike other systems, LLVM doesn't hold
-to the mistaken notion that one set of optimizations is right for all languages
-and for all situations. LLVM allows a compiler implementor to make complete
-decisions about what optimizations to use, in which order, and in what
-situation.</p>
-
-<p>As a concrete example, LLVM supports both "whole module" passes, which look
-across as large of body of code as they can (often a whole file, but if run
-at link time, this can be a substantial portion of the whole program). It also
-supports and includes "per-function" passes which just operate on a single
-function at a time, without looking at other functions. For more information
-on passes and how they are run, see the <a href="../WritingAnLLVMPass.html">How
-to Write a Pass</a> document and the <a href="../Passes.html">List of LLVM
-Passes</a>.</p>
-
-<p>For Kaleidoscope, we are currently generating functions on the fly, one at
-a time, as the user types them in. We aren't shooting for the ultimate
-optimization experience in this setting, but we also want to catch the easy and
-quick stuff where possible. As such, we will choose to run a few per-function
-optimizations as the user types the function in. If we wanted to make a "static
-Kaleidoscope compiler", we would use exactly the code we have now, except that
-we would defer running the optimizer until the entire file has been parsed.</p>
-
-<p>In order to get per-function optimizations going, we need to set up a
-<a href="../WritingAnLLVMPass.html#passmanager">FunctionPassManager</a> to hold and
-organize the LLVM optimizations that we want to run. Once we have that, we can
-add a set of optimizations to run. The code looks like this:</p>
-
-<div class="doc_code">
-<pre>
- ExistingModuleProvider OurModuleProvider(TheModule);
- FunctionPassManager OurFPM(&amp;OurModuleProvider);
-
- // Set up the optimizer pipeline. Start with registering info about how the
- // target lays out data structures.
- OurFPM.add(new TargetData(*TheExecutionEngine->getTargetData()));
- // Do simple "peephole" optimizations and bit-twiddling optzns.
- OurFPM.add(createInstructionCombiningPass());
- // Reassociate expressions.
- OurFPM.add(createReassociatePass());
- // Eliminate Common SubExpressions.
- OurFPM.add(createGVNPass());
- // Simplify the control flow graph (deleting unreachable blocks, etc).
- OurFPM.add(createCFGSimplificationPass());
-
- // Set the global so the code gen can use this.
- TheFPM = &amp;OurFPM;
-
- // Run the main "interpreter loop" now.
- MainLoop();
-</pre>
-</div>
-
-<p>This code defines two objects, an <tt>ExistingModuleProvider</tt> and a
-<tt>FunctionPassManager</tt>. The former is basically a wrapper around our
-<tt>Module</tt> that the PassManager requires. It provides certain flexibility
-that we're not going to take advantage of here, so I won't dive into any details
-about it.</p>
-
-<p>The meat of the matter here, is the definition of "<tt>OurFPM</tt>". It
-requires a pointer to the <tt>Module</tt> (through the <tt>ModuleProvider</tt>)
-to construct itself. Once it is set up, we use a series of "add" calls to add
-a bunch of LLVM passes. The first pass is basically boilerplate, it adds a pass
-so that later optimizations know how the data structures in the program are
-layed out. The "<tt>TheExecutionEngine</tt>" variable is related to the JIT,
-which we will get to in the next section.</p>
-
-<p>In this case, we choose to add 4 optimization passes. The passes we chose
-here are a pretty standard set of "cleanup" optimizations that are useful for
-a wide variety of code. I won't delve into what they do but, believe me,
-they are a good starting place :).</p>
-
-<p>Once the PassManager is set up, we need to make use of it. We do this by
-running it after our newly created function is constructed (in
-<tt>FunctionAST::Codegen</tt>), but before it is returned to the client:</p>
-
-<div class="doc_code">
-<pre>
- if (Value *RetVal = Body->Codegen()) {
- // Finish off the function.
- Builder.CreateRet(RetVal);
-
- // Validate the generated code, checking for consistency.
- verifyFunction(*TheFunction);
-
- <b>// Optimize the function.
- TheFPM-&gt;run(*TheFunction);</b>
-
- return TheFunction;
- }
-</pre>
-</div>
-
-<p>As you can see, this is pretty straightforward. The
-<tt>FunctionPassManager</tt> optimizes and updates the LLVM Function* in place,
-improving (hopefully) its body. With this in place, we can try our test above
-again:</p>
-
-<div class="doc_code">
-<pre>
-ready&gt; <b>def test(x) (1+2+x)*(x+(1+2));</b>
-ready> Read function definition:
-define double @test(double %x) {
-entry:
- %addtmp = add double %x, 3.000000e+00
- %multmp = mul double %addtmp, %addtmp
- ret double %multmp
-}
-</pre>
-</div>
-
-<p>As expected, we now get our nicely optimized code, saving a floating point
-add instruction from every execution of this function.</p>
-
-<p>LLVM provides a wide variety of optimizations that can be used in certain
-circumstances. Some <a href="../Passes.html">documentation about the various
-passes</a> is available, but it isn't very complete. Another good source of
-ideas can come from looking at the passes that <tt>llvm-gcc</tt> or
-<tt>llvm-ld</tt> run to get started. The "<tt>opt</tt>" tool allows you to
-experiment with passes from the command line, so you can see if they do
-anything.</p>
-
-<p>Now that we have reasonable code coming out of our front-end, lets talk about
-executing it!</p>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section"><a name="jit">Adding a JIT Compiler</a></div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>Code that is available in LLVM IR can have a wide variety of tools
-applied to it. For example, you can run optimizations on it (as we did above),
-you can dump it out in textual or binary forms, you can compile the code to an
-assembly file (.s) for some target, or you can JIT compile it. The nice thing
-about the LLVM IR representation is that it is the "common currency" between
-many different parts of the compiler.
-</p>
-
-<p>In this section, we'll add JIT compiler support to our interpreter. The
-basic idea that we want for Kaleidoscope is to have the user enter function
-bodies as they do now, but immediately evaluate the top-level expressions they
-type in. For example, if they type in "1 + 2;", we should evaluate and print
-out 3. If they define a function, they should be able to call it from the
-command line.</p>
-
-<p>In order to do this, we first declare and initialize the JIT. This is done
-by adding a global variable and a call in <tt>main</tt>:</p>
-
-<div class="doc_code">
-<pre>
-<b>static ExecutionEngine *TheExecutionEngine;</b>
-...
-int main() {
- ..
- <b>// Create the JIT.
- TheExecutionEngine = ExecutionEngine::create(TheModule);</b>
- ..
-}
-</pre>
-</div>
-
-<p>This creates an abstract "Execution Engine" which can be either a JIT
-compiler or the LLVM interpreter. LLVM will automatically pick a JIT compiler
-for you if one is available for your platform, otherwise it will fall back to
-the interpreter.</p>
-
-<p>Once the <tt>ExecutionEngine</tt> is created, the JIT is ready to be used.
-There are a variety of APIs that are useful, but the simplest one is the
-"<tt>getPointerToFunction(F)</tt>" method. This method JIT compiles the
-specified LLVM Function and returns a function pointer to the generated machine
-code. In our case, this means that we can change the code that parses a
-top-level expression to look like this:</p>
-
-<div class="doc_code">
-<pre>
-static void HandleTopLevelExpression() {
- // Evaluate a top level expression into an anonymous function.
- if (FunctionAST *F = ParseTopLevelExpr()) {
- if (Function *LF = F-&gt;Codegen()) {
- LF->dump(); // Dump the function for exposition purposes.
-
- <b>// JIT the function, returning a function pointer.
- void *FPtr = TheExecutionEngine-&gt;getPointerToFunction(LF);
-
- // Cast it to the right type (takes no arguments, returns a double) so we
- // can call it as a native function.
- double (*FP)() = (double (*)())FPtr;
- fprintf(stderr, "Evaluated to %f\n", FP());</b>
- }
-</pre>
-</div>
-
-<p>Recall that we compile top-level expressions into a self-contained LLVM
-function that takes no arguments and returns the computed double. Because the
-LLVM JIT compiler matches the native platform ABI, this means that you can just
-cast the result pointer to a function pointer of that type and call it directly.
-This means, there is no difference between JIT compiled code and native machine
-code that is statically linked into your application.</p>
-
-<p>With just these two changes, lets see how Kaleidoscope works now!</p>
-
-<div class="doc_code">
-<pre>
-ready&gt; <b>4+5;</b>
-define double @""() {
-entry:
- ret double 9.000000e+00
-}
-
-<em>Evaluated to 9.000000</em>
-</pre>
-</div>
-
-<p>Well this looks like it is basically working. The dump of the function
-shows the "no argument function that always returns double" that we synthesize
-for each top level expression that is typed in. This demonstrates very basic
-functionality, but can we do more?</p>
-
-<div class="doc_code">
-<pre>
-ready&gt; <b>def testfunc(x y) x + y*2; </b>
-Read function definition:
-define double @testfunc(double %x, double %y) {
-entry:
- %multmp = mul double %y, 2.000000e+00
- %addtmp = add double %multmp, %x
- ret double %addtmp
-}
-
-ready&gt; <b>testfunc(4, 10);</b>
-define double @""() {
-entry:
- %calltmp = call double @testfunc( double 4.000000e+00, double 1.000000e+01 )
- ret double %calltmp
-}
-
-<em>Evaluated to 24.000000</em>
-</pre>
-</div>
-
-<p>This illustrates that we can now call user code, but there is something a bit subtle
-going on here. Note that we only invoke the JIT on the anonymous functions
-that <em>call testfunc</em>, but we never invoked it on <em>testfunc
-</em>itself.</p>
-
-<p>What actually happened here is that the anonymous function was
-JIT'd when requested. When the Kaleidoscope app calls through the function
-pointer that is returned, the anonymous function starts executing. It ends up
-making the call to the "testfunc" function, and ends up in a stub that invokes
-the JIT, lazily, on testfunc. Once the JIT finishes lazily compiling testfunc,
-it returns and the code re-executes the call.</p>
-
-<p>In summary, the JIT will lazily JIT code, on the fly, as it is needed. The
-JIT provides a number of other more advanced interfaces for things like freeing
-allocated machine code, rejit'ing functions to update them, etc. However, even
-with this simple code, we get some surprisingly powerful capabilities - check
-this out (I removed the dump of the anonymous functions, you should get the idea
-by now :) :</p>
-
-<div class="doc_code">
-<pre>
-ready&gt; <b>extern sin(x);</b>
-Read extern:
-declare double @sin(double)
-
-ready&gt; <b>extern cos(x);</b>
-Read extern:
-declare double @cos(double)
-
-ready&gt; <b>sin(1.0);</b>
-<em>Evaluated to 0.841471</em>
-
-ready&gt; <b>def foo(x) sin(x)*sin(x) + cos(x)*cos(x);</b>
-Read function definition:
-define double @foo(double %x) {
-entry:
- %calltmp = call double @sin( double %x )
- %multmp = mul double %calltmp, %calltmp
- %calltmp2 = call double @cos( double %x )
- %multmp4 = mul double %calltmp2, %calltmp2
- %addtmp = add double %multmp, %multmp4
- ret double %addtmp
-}
-
-ready&gt; <b>foo(4.0);</b>
-<em>Evaluated to 1.000000</em>
-</pre>
-</div>
-
-<p>Whoa, how does the JIT know about sin and cos? The answer is surprisingly
-simple: in this
-example, the JIT started execution of a function and got to a function call. It
-realized that the function was not yet JIT compiled and invoked the standard set
-of routines to resolve the function. In this case, there is no body defined
-for the function, so the JIT ended up calling "<tt>dlsym("sin")</tt>" on the
-Kaleidoscope process itself.
-Since "<tt>sin</tt>" is defined within the JIT's address space, it simply
-patches up calls in the module to call the libm version of <tt>sin</tt>
-directly.</p>
-
-<p>The LLVM JIT provides a number of interfaces (look in the
-<tt>ExecutionEngine.h</tt> file) for controlling how unknown functions get
-resolved. It allows you to establish explicit mappings between IR objects and
-addresses (useful for LLVM global variables that you want to map to static
-tables, for example), allows you to dynamically decide on the fly based on the
-function name, and even allows you to have the JIT abort itself if any lazy
-compilation is attempted.</p>
-
-<p>One interesting application of this is that we can now extend the language
-by writing arbitrary C++ code to implement operations. For example, if we add:
-</p>
-
-<div class="doc_code">
-<pre>
-/// putchard - putchar that takes a double and returns 0.
-extern "C"
-double putchard(double X) {
- putchar((char)X);
- return 0;
-}
-</pre>
-</div>
-
-<p>Now we can produce simple output to the console by using things like:
-"<tt>extern putchard(x); putchard(120);</tt>", which prints a lowercase 'x' on
-the console (120 is the ASCII code for 'x'). Similar code could be used to
-implement file I/O, console input, and many other capabilities in
-Kaleidoscope.</p>
-
-<p>This completes the JIT and optimizer chapter of the Kaleidoscope tutorial. At
-this point, we can compile a non-Turing-complete programming language, optimize
-and JIT compile it in a user-driven way. Next up we'll look into <a
-href="LangImpl5.html">extending the language with control flow constructs</a>,
-tackling some interesting LLVM IR issues along the way.</p>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section"><a name="code">Full Code Listing</a></div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>
-Here is the complete code listing for our running example, enhanced with the
-LLVM JIT and optimizer. To build this example, use:
-</p>
-
-<div class="doc_code">
-<pre>
- # Compile
- g++ -g toy.cpp `llvm-config --cppflags --ldflags --libs core jit native` -O3 -o toy
- # Run
- ./toy
-</pre>
-</div>
-
-<p>Here is the code:</p>
-
-<div class="doc_code">
-<pre>
-#include "llvm/DerivedTypes.h"
-#include "llvm/ExecutionEngine/ExecutionEngine.h"
-#include "llvm/Module.h"
-#include "llvm/ModuleProvider.h"
-#include "llvm/PassManager.h"
-#include "llvm/Analysis/Verifier.h"
-#include "llvm/Target/TargetData.h"
-#include "llvm/Transforms/Scalar.h"
-#include "llvm/Support/IRBuilder.h"
-#include &lt;cstdio&gt;
-#include &lt;string&gt;
-#include &lt;map&gt;
-#include &lt;vector&gt;
-using namespace llvm;
-
-//===----------------------------------------------------------------------===//
-// Lexer
-//===----------------------------------------------------------------------===//
-
-// The lexer returns tokens [0-255] if it is an unknown character, otherwise one
-// of these for known things.
-enum Token {
- tok_eof = -1,
-
- // commands
- tok_def = -2, tok_extern = -3,
-
- // primary
- tok_identifier = -4, tok_number = -5,
-};
-
-static std::string IdentifierStr; // Filled in if tok_identifier
-static double NumVal; // Filled in if tok_number
-
-/// gettok - Return the next token from standard input.
-static int gettok() {
- static int LastChar = ' ';
-
- // Skip any whitespace.
- while (isspace(LastChar))
- LastChar = getchar();
-
- if (isalpha(LastChar)) { // identifier: [a-zA-Z][a-zA-Z0-9]*
- IdentifierStr = LastChar;
- while (isalnum((LastChar = getchar())))
- IdentifierStr += LastChar;
-
- if (IdentifierStr == "def") return tok_def;
- if (IdentifierStr == "extern") return tok_extern;
- return tok_identifier;
- }
-
- if (isdigit(LastChar) || LastChar == '.') { // Number: [0-9.]+
- std::string NumStr;
- do {
- NumStr += LastChar;
- LastChar = getchar();
- } while (isdigit(LastChar) || LastChar == '.');
-
- NumVal = strtod(NumStr.c_str(), 0);
- return tok_number;
- }
-
- if (LastChar == '#') {
- // Comment until end of line.
- do LastChar = getchar();
- while (LastChar != EOF &amp;&amp; LastChar != '\n' &amp;&amp; LastChar != '\r');
-
- if (LastChar != EOF)
- return gettok();
- }
-
- // Check for end of file. Don't eat the EOF.
- if (LastChar == EOF)
- return tok_eof;
-
- // Otherwise, just return the character as its ascii value.
- int ThisChar = LastChar;
- LastChar = getchar();
- return ThisChar;
-}
-
-//===----------------------------------------------------------------------===//
-// Abstract Syntax Tree (aka Parse Tree)
-//===----------------------------------------------------------------------===//
-
-/// ExprAST - Base class for all expression nodes.
-class ExprAST {
-public:
- virtual ~ExprAST() {}
- virtual Value *Codegen() = 0;
-};
-
-/// NumberExprAST - Expression class for numeric literals like "1.0".
-class NumberExprAST : public ExprAST {
- double Val;
-public:
- NumberExprAST(double val) : Val(val) {}
- virtual Value *Codegen();
-};
-
-/// VariableExprAST - Expression class for referencing a variable, like "a".
-class VariableExprAST : public ExprAST {
- std::string Name;
-public:
- VariableExprAST(const std::string &amp;name) : Name(name) {}
- virtual Value *Codegen();
-};
-
-/// BinaryExprAST - Expression class for a binary operator.
-class BinaryExprAST : public ExprAST {
- char Op;
- ExprAST *LHS, *RHS;
-public:
- BinaryExprAST(char op, ExprAST *lhs, ExprAST *rhs)
- : Op(op), LHS(lhs), RHS(rhs) {}
- virtual Value *Codegen();
-};
-
-/// CallExprAST - Expression class for function calls.
-class CallExprAST : public ExprAST {
- std::string Callee;
- std::vector&lt;ExprAST*&gt; Args;
-public:
- CallExprAST(const std::string &amp;callee, std::vector&lt;ExprAST*&gt; &amp;args)
- : Callee(callee), Args(args) {}
- virtual Value *Codegen();
-};
-
-/// PrototypeAST - This class represents the "prototype" for a function,
-/// which captures its argument names as well as if it is an operator.
-class PrototypeAST {
- std::string Name;
- std::vector&lt;std::string&gt; Args;
-public:
- PrototypeAST(const std::string &amp;name, const std::vector&lt;std::string&gt; &amp;args)
- : Name(name), Args(args) {}
-
- Function *Codegen();
-};
-
-/// FunctionAST - This class represents a function definition itself.
-class FunctionAST {
- PrototypeAST *Proto;
- ExprAST *Body;
-public:
- FunctionAST(PrototypeAST *proto, ExprAST *body)
- : Proto(proto), Body(body) {}
-
- Function *Codegen();
-};
-
-//===----------------------------------------------------------------------===//
-// Parser
-//===----------------------------------------------------------------------===//
-
-/// CurTok/getNextToken - Provide a simple token buffer. CurTok is the current
-/// token the parser it looking at. getNextToken reads another token from the
-/// lexer and updates CurTok with its results.
-static int CurTok;
-static int getNextToken() {
- return CurTok = gettok();
-}
-
-/// BinopPrecedence - This holds the precedence for each binary operator that is
-/// defined.
-static std::map&lt;char, int&gt; BinopPrecedence;
-
-/// GetTokPrecedence - Get the precedence of the pending binary operator token.
-static int GetTokPrecedence() {
- if (!isascii(CurTok))
- return -1;
-
- // Make sure it's a declared binop.
- int TokPrec = BinopPrecedence[CurTok];
- if (TokPrec &lt;= 0) return -1;
- return TokPrec;
-}
-
-/// Error* - These are little helper functions for error handling.
-ExprAST *Error(const char *Str) { fprintf(stderr, "Error: %s\n", Str);return 0;}
-PrototypeAST *ErrorP(const char *Str) { Error(Str); return 0; }
-FunctionAST *ErrorF(const char *Str) { Error(Str); return 0; }
-
-static ExprAST *ParseExpression();
-
-/// identifierexpr
-/// ::= identifier
-/// ::= identifier '(' expression* ')'
-static ExprAST *ParseIdentifierExpr() {
- std::string IdName = IdentifierStr;
-
- getNextToken(); // eat identifier.
-
- if (CurTok != '(') // Simple variable ref.
- return new VariableExprAST(IdName);
-
- // Call.
- getNextToken(); // eat (
- std::vector&lt;ExprAST*&gt; Args;
- if (CurTok != ')') {
- while (1) {
- ExprAST *Arg = ParseExpression();
- if (!Arg) return 0;
- Args.push_back(Arg);
-
- if (CurTok == ')') break;
-
- if (CurTok != ',')
- return Error("Expected ')' or ',' in argument list");
- getNextToken();
- }
- }
-
- // Eat the ')'.
- getNextToken();
-
- return new CallExprAST(IdName, Args);
-}
-
-/// numberexpr ::= number
-static ExprAST *ParseNumberExpr() {
- ExprAST *Result = new NumberExprAST(NumVal);
- getNextToken(); // consume the number
- return Result;
-}
-
-/// parenexpr ::= '(' expression ')'
-static ExprAST *ParseParenExpr() {
- getNextToken(); // eat (.
- ExprAST *V = ParseExpression();
- if (!V) return 0;
-
- if (CurTok != ')')
- return Error("expected ')'");
- getNextToken(); // eat ).
- return V;
-}
-
-/// primary
-/// ::= identifierexpr
-/// ::= numberexpr
-/// ::= parenexpr
-static ExprAST *ParsePrimary() {
- switch (CurTok) {
- default: return Error("unknown token when expecting an expression");
- case tok_identifier: return ParseIdentifierExpr();
- case tok_number: return ParseNumberExpr();
- case '(': return ParseParenExpr();
- }
-}
-
-/// binoprhs
-/// ::= ('+' primary)*
-static ExprAST *ParseBinOpRHS(int ExprPrec, ExprAST *LHS) {
- // If this is a binop, find its precedence.
- while (1) {
- int TokPrec = GetTokPrecedence();
-
- // If this is a binop that binds at least as tightly as the current binop,
- // consume it, otherwise we are done.
- if (TokPrec &lt; ExprPrec)
- return LHS;
-
- // Okay, we know this is a binop.
- int BinOp = CurTok;
- getNextToken(); // eat binop
-
- // Parse the primary expression after the binary operator.
- ExprAST *RHS = ParsePrimary();
- if (!RHS) return 0;
-
- // If BinOp binds less tightly with RHS than the operator after RHS, let
- // the pending operator take RHS as its LHS.
- int NextPrec = GetTokPrecedence();
- if (TokPrec &lt; NextPrec) {
- RHS = ParseBinOpRHS(TokPrec+1, RHS);
- if (RHS == 0) return 0;
- }
-
- // Merge LHS/RHS.
- LHS = new BinaryExprAST(BinOp, LHS, RHS);
- }
-}
-
-/// expression
-/// ::= primary binoprhs
-///
-static ExprAST *ParseExpression() {
- ExprAST *LHS = ParsePrimary();
- if (!LHS) return 0;
-
- return ParseBinOpRHS(0, LHS);
-}
-
-/// prototype
-/// ::= id '(' id* ')'
-static PrototypeAST *ParsePrototype() {
- if (CurTok != tok_identifier)
- return ErrorP("Expected function name in prototype");
-
- std::string FnName = IdentifierStr;
- getNextToken();
-
- if (CurTok != '(')
- return ErrorP("Expected '(' in prototype");
-
- std::vector&lt;std::string&gt; ArgNames;
- while (getNextToken() == tok_identifier)
- ArgNames.push_back(IdentifierStr);
- if (CurTok != ')')
- return ErrorP("Expected ')' in prototype");
-
- // success.
- getNextToken(); // eat ')'.
-
- return new PrototypeAST(FnName, ArgNames);
-}
-
-/// definition ::= 'def' prototype expression
-static FunctionAST *ParseDefinition() {
- getNextToken(); // eat def.
- PrototypeAST *Proto = ParsePrototype();
- if (Proto == 0) return 0;
-
- if (ExprAST *E = ParseExpression())
- return new FunctionAST(Proto, E);
- return 0;
-}
-
-/// toplevelexpr ::= expression
-static FunctionAST *ParseTopLevelExpr() {
- if (ExprAST *E = ParseExpression()) {
- // Make an anonymous proto.
- PrototypeAST *Proto = new PrototypeAST("", std::vector&lt;std::string&gt;());
- return new FunctionAST(Proto, E);
- }
- return 0;
-}
-
-/// external ::= 'extern' prototype
-static PrototypeAST *ParseExtern() {
- getNextToken(); // eat extern.
- return ParsePrototype();
-}
-
-//===----------------------------------------------------------------------===//
-// Code Generation
-//===----------------------------------------------------------------------===//
-
-static Module *TheModule;
-static IRBuilder Builder;
-static std::map&lt;std::string, Value*&gt; NamedValues;
-static FunctionPassManager *TheFPM;
-
-Value *ErrorV(const char *Str) { Error(Str); return 0; }
-
-Value *NumberExprAST::Codegen() {
- return ConstantFP::get(Type::DoubleTy, APFloat(Val));
-}
-
-Value *VariableExprAST::Codegen() {
- // Look this variable up in the function.
- Value *V = NamedValues[Name];
- return V ? V : ErrorV("Unknown variable name");
-}
-
-Value *BinaryExprAST::Codegen() {
- Value *L = LHS-&gt;Codegen();
- Value *R = RHS-&gt;Codegen();
- if (L == 0 || R == 0) return 0;
-
- switch (Op) {
- case '+': return Builder.CreateAdd(L, R, "addtmp");
- case '-': return Builder.CreateSub(L, R, "subtmp");
- case '*': return Builder.CreateMul(L, R, "multmp");
- case '&lt;':
- L = Builder.CreateFCmpULT(L, R, "cmptmp");
- // Convert bool 0/1 to double 0.0 or 1.0
- return Builder.CreateUIToFP(L, Type::DoubleTy, "booltmp");
- default: return ErrorV("invalid binary operator");
- }
-}
-
-Value *CallExprAST::Codegen() {
- // Look up the name in the global module table.
- Function *CalleeF = TheModule-&gt;getFunction(Callee);
- if (CalleeF == 0)
- return ErrorV("Unknown function referenced");
-
- // If argument mismatch error.
- if (CalleeF-&gt;arg_size() != Args.size())
- return ErrorV("Incorrect # arguments passed");
-
- std::vector&lt;Value*&gt; ArgsV;
- for (unsigned i = 0, e = Args.size(); i != e; ++i) {
- ArgsV.push_back(Args[i]-&gt;Codegen());
- if (ArgsV.back() == 0) return 0;
- }
-
- return Builder.CreateCall(CalleeF, ArgsV.begin(), ArgsV.end(), "calltmp");
-}
-
-Function *PrototypeAST::Codegen() {
- // Make the function type: double(double,double) etc.
- std::vector&lt;const Type*&gt; Doubles(Args.size(), Type::DoubleTy);
- FunctionType *FT = FunctionType::get(Type::DoubleTy, Doubles, false);
-
- Function *F = Function::Create(FT, Function::ExternalLinkage, Name, TheModule);
-
- // If F conflicted, there was already something named 'Name'. If it has a
- // body, don't allow redefinition or reextern.
- if (F-&gt;getName() != Name) {
- // Delete the one we just made and get the existing one.
- F-&gt;eraseFromParent();
- F = TheModule-&gt;getFunction(Name);
-
- // If F already has a body, reject this.
- if (!F-&gt;empty()) {
- ErrorF("redefinition of function");
- return 0;
- }
-
- // If F took a different number of args, reject.
- if (F-&gt;arg_size() != Args.size()) {
- ErrorF("redefinition of function with different # args");
- return 0;
- }
- }
-
- // Set names for all arguments.
- unsigned Idx = 0;
- for (Function::arg_iterator AI = F-&gt;arg_begin(); Idx != Args.size();
- ++AI, ++Idx) {
- AI-&gt;setName(Args[Idx]);
-
- // Add arguments to variable symbol table.
- NamedValues[Args[Idx]] = AI;
- }
-
- return F;
-}
-
-Function *FunctionAST::Codegen() {
- NamedValues.clear();
-
- Function *TheFunction = Proto-&gt;Codegen();
- if (TheFunction == 0)
- return 0;
-
- // Create a new basic block to start insertion into.
- BasicBlock *BB = BasicBlock::Create("entry", TheFunction);
- Builder.SetInsertPoint(BB);
-
- if (Value *RetVal = Body-&gt;Codegen()) {
- // Finish off the function.
- Builder.CreateRet(RetVal);
-
- // Validate the generated code, checking for consistency.
- verifyFunction(*TheFunction);
-
- // Optimize the function.
- TheFPM-&gt;run(*TheFunction);
-
- return TheFunction;
- }
-
- // Error reading body, remove function.
- TheFunction-&gt;eraseFromParent();
- return 0;
-}
-
-//===----------------------------------------------------------------------===//
-// Top-Level parsing and JIT Driver
-//===----------------------------------------------------------------------===//
-
-static ExecutionEngine *TheExecutionEngine;
-
-static void HandleDefinition() {
- if (FunctionAST *F = ParseDefinition()) {
- if (Function *LF = F-&gt;Codegen()) {
- fprintf(stderr, "Read function definition:");
- LF-&gt;dump();
- }
- } else {
- // Skip token for error recovery.
- getNextToken();
- }
-}
-
-static void HandleExtern() {
- if (PrototypeAST *P = ParseExtern()) {
- if (Function *F = P-&gt;Codegen()) {
- fprintf(stderr, "Read extern: ");
- F-&gt;dump();
- }
- } else {
- // Skip token for error recovery.
- getNextToken();
- }
-}
-
-static void HandleTopLevelExpression() {
- // Evaluate a top level expression into an anonymous function.
- if (FunctionAST *F = ParseTopLevelExpr()) {
- if (Function *LF = F-&gt;Codegen()) {
- // JIT the function, returning a function pointer.
- void *FPtr = TheExecutionEngine-&gt;getPointerToFunction(LF);
-
- // Cast it to the right type (takes no arguments, returns a double) so we
- // can call it as a native function.
- double (*FP)() = (double (*)())FPtr;
- fprintf(stderr, "Evaluated to %f\n", FP());
- }
- } else {
- // Skip token for error recovery.
- getNextToken();
- }
-}
-
-/// top ::= definition | external | expression | ';'
-static void MainLoop() {
- while (1) {
- fprintf(stderr, "ready&gt; ");
- switch (CurTok) {
- case tok_eof: return;
- case ';': getNextToken(); break; // ignore top level semicolons.
- case tok_def: HandleDefinition(); break;
- case tok_extern: HandleExtern(); break;
- default: HandleTopLevelExpression(); break;
- }
- }
-}
-
-
-
-//===----------------------------------------------------------------------===//
-// "Library" functions that can be "extern'd" from user code.
-//===----------------------------------------------------------------------===//
-
-/// putchard - putchar that takes a double and returns 0.
-extern "C"
-double putchard(double X) {
- putchar((char)X);
- return 0;
-}
-
-//===----------------------------------------------------------------------===//
-// Main driver code.
-//===----------------------------------------------------------------------===//
-
-int main() {
- // Install standard binary operators.
- // 1 is lowest precedence.
- BinopPrecedence['&lt;'] = 10;
- BinopPrecedence['+'] = 20;
- BinopPrecedence['-'] = 20;
- BinopPrecedence['*'] = 40; // highest.
-
- // Prime the first token.
- fprintf(stderr, "ready&gt; ");
- getNextToken();
-
- // Make the module, which holds all the code.
- TheModule = new Module("my cool jit");
-
- // Create the JIT.
- TheExecutionEngine = ExecutionEngine::create(TheModule);
-
- {
- ExistingModuleProvider OurModuleProvider(TheModule);
- FunctionPassManager OurFPM(&amp;OurModuleProvider);
-
- // Set up the optimizer pipeline. Start with registering info about how the
- // target lays out data structures.
- OurFPM.add(new TargetData(*TheExecutionEngine-&gt;getTargetData()));
- // Do simple "peephole" optimizations and bit-twiddling optzns.
- OurFPM.add(createInstructionCombiningPass());
- // Reassociate expressions.
- OurFPM.add(createReassociatePass());
- // Eliminate Common SubExpressions.
- OurFPM.add(createGVNPass());
- // Simplify the control flow graph (deleting unreachable blocks, etc).
- OurFPM.add(createCFGSimplificationPass());
-
- // Set the global so the code gen can use this.
- TheFPM = &amp;OurFPM;
-
- // Run the main "interpreter loop" now.
- MainLoop();
-
- TheFPM = 0;
-
- // Print out all of the generated code.
- TheModule-&gt;dump();
- } // Free module provider (and thus the module) and pass manager.
-
- return 0;
-}
-</pre>
-</div>
-
-<a href="LangImpl5.html">Next: Extending the language: control flow</a>
-</div>
-
-<!-- *********************************************************************** -->
-<hr>
-<address>
- <a href="http://jigsaw.w3.org/css-validator/check/referer"><img
- src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"></a>
- <a href="http://validator.w3.org/check/referer"><img
- src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!"></a>
-
- <a href="mailto:sabre@nondot.org">Chris Lattner</a><br>
- <a href="http://llvm.org">The LLVM Compiler Infrastructure</a><br>
- Last modified: $Date: 2007-10-17 11:05:13 -0700 (Wed, 17 Oct 2007) $
-</address>
-</body>
-</html>
diff --git a/release_23/docs/tutorial/LangImpl5-cfg.png b/release_23/docs/tutorial/LangImpl5-cfg.png
deleted file mode 100644
index cdba92ff6c5c..000000000000
--- a/release_23/docs/tutorial/LangImpl5-cfg.png
+++ /dev/null
Binary files differ
diff --git a/release_23/docs/tutorial/LangImpl5.html b/release_23/docs/tutorial/LangImpl5.html
deleted file mode 100644
index 1ff4e65b4fd3..000000000000
--- a/release_23/docs/tutorial/LangImpl5.html
+++ /dev/null
@@ -1,1764 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
- "http://www.w3.org/TR/html4/strict.dtd">
-
-<html>
-<head>
- <title>Kaleidoscope: Extending the Language: Control Flow</title>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <meta name="author" content="Chris Lattner">
- <link rel="stylesheet" href="../llvm.css" type="text/css">
-</head>
-
-<body>
-
-<div class="doc_title">Kaleidoscope: Extending the Language: Control Flow</div>
-
-<ul>
-<li><a href="index.html">Up to Tutorial Index</a></li>
-<li>Chapter 5
- <ol>
- <li><a href="#intro">Chapter 5 Introduction</a></li>
- <li><a href="#ifthen">If/Then/Else</a>
- <ol>
- <li><a href="#iflexer">Lexer Extensions</a></li>
- <li><a href="#ifast">AST Extensions</a></li>
- <li><a href="#ifparser">Parser Extensions</a></li>
- <li><a href="#ifir">LLVM IR</a></li>
- <li><a href="#ifcodegen">Code Generation</a></li>
- </ol>
- </li>
- <li><a href="#for">'for' Loop Expression</a>
- <ol>
- <li><a href="#forlexer">Lexer Extensions</a></li>
- <li><a href="#forast">AST Extensions</a></li>
- <li><a href="#forparser">Parser Extensions</a></li>
- <li><a href="#forir">LLVM IR</a></li>
- <li><a href="#forcodegen">Code Generation</a></li>
- </ol>
- </li>
- <li><a href="#code">Full Code Listing</a></li>
- </ol>
-</li>
-<li><a href="LangImpl6.html">Chapter 6</a>: Extending the Language:
-User-defined Operators</li>
-</ul>
-
-<div class="doc_author">
- <p>Written by <a href="mailto:sabre@nondot.org">Chris Lattner</a></p>
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section"><a name="intro">Chapter 5 Introduction</a></div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>Welcome to Chapter 5 of the "<a href="index.html">Implementing a language
-with LLVM</a>" tutorial. Parts 1-4 described the implementation of the simple
-Kaleidoscope language and included support for generating LLVM IR, followed by
-optimizations and a JIT compiler. Unfortunately, as presented, Kaleidoscope is
-mostly useless: it has no control flow other than call and return. This means
-that you can't have conditional branches in the code, significantly limiting its
-power. In this episode of "build that compiler", we'll extend Kaleidoscope to
-have an if/then/else expression plus a simple 'for' loop.</p>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section"><a name="ifthen">If/Then/Else</a></div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>
-Extending Kaleidoscope to support if/then/else is quite straightforward. It
-basically requires adding lexer support for this "new" concept to the lexer,
-parser, AST, and LLVM code emitter. This example is nice, because it shows how
-easy it is to "grow" a language over time, incrementally extending it as new
-ideas are discovered.</p>
-
-<p>Before we get going on "how" we add this extension, lets talk about "what" we
-want. The basic idea is that we want to be able to write this sort of thing:
-</p>
-
-<div class="doc_code">
-<pre>
-def fib(x)
- if x &lt; 3 then
- 1
- else
- fib(x-1)+fib(x-2);
-</pre>
-</div>
-
-<p>In Kaleidoscope, every construct is an expression: there are no statements.
-As such, the if/then/else expression needs to return a value like any other.
-Since we're using a mostly functional form, we'll have it evaluate its
-conditional, then return the 'then' or 'else' value based on how the condition
-was resolved. This is very similar to the C "?:" expression.</p>
-
-<p>The semantics of the if/then/else expression is that it evaluates the
-condition to a boolean equality value: 0.0 is considered to be false and
-everything else is considered to be true.
-If the condition is true, the first subexpression is evaluated and returned, if
-the condition is false, the second subexpression is evaluated and returned.
-Since Kaleidoscope allows side-effects, this behavior is important to nail down.
-</p>
-
-<p>Now that we know what we "want", lets break this down into its constituent
-pieces.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsubsection"><a name="iflexer">Lexer Extensions for
-If/Then/Else</a></div>
-<!-- ======================================================================= -->
-
-
-<div class="doc_text">
-
-<p>The lexer extensions are straightforward. First we add new enum values
-for the relevant tokens:</p>
-
-<div class="doc_code">
-<pre>
- // control
- tok_if = -6, tok_then = -7, tok_else = -8,
-</pre>
-</div>
-
-<p>Once we have that, we recognize the new keywords in the lexer. This is pretty simple
-stuff:</p>
-
-<div class="doc_code">
-<pre>
- ...
- if (IdentifierStr == "def") return tok_def;
- if (IdentifierStr == "extern") return tok_extern;
- <b>if (IdentifierStr == "if") return tok_if;
- if (IdentifierStr == "then") return tok_then;
- if (IdentifierStr == "else") return tok_else;</b>
- return tok_identifier;
-</pre>
-</div>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsubsection"><a name="ifast">AST Extensions for
- If/Then/Else</a></div>
-<!-- ======================================================================= -->
-
-<div class="doc_text">
-
-<p>To represent the new expression we add a new AST node for it:</p>
-
-<div class="doc_code">
-<pre>
-/// IfExprAST - Expression class for if/then/else.
-class IfExprAST : public ExprAST {
- ExprAST *Cond, *Then, *Else;
-public:
- IfExprAST(ExprAST *cond, ExprAST *then, ExprAST *_else)
- : Cond(cond), Then(then), Else(_else) {}
- virtual Value *Codegen();
-};
-</pre>
-</div>
-
-<p>The AST node just has pointers to the various subexpressions.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsubsection"><a name="ifparser">Parser Extensions for
-If/Then/Else</a></div>
-<!-- ======================================================================= -->
-
-<div class="doc_text">
-
-<p>Now that we have the relevant tokens coming from the lexer and we have the
-AST node to build, our parsing logic is relatively straightforward. First we
-define a new parsing function:</p>
-
-<div class="doc_code">
-<pre>
-/// ifexpr ::= 'if' expression 'then' expression 'else' expression
-static ExprAST *ParseIfExpr() {
- getNextToken(); // eat the if.
-
- // condition.
- ExprAST *Cond = ParseExpression();
- if (!Cond) return 0;
-
- if (CurTok != tok_then)
- return Error("expected then");
- getNextToken(); // eat the then
-
- ExprAST *Then = ParseExpression();
- if (Then == 0) return 0;
-
- if (CurTok != tok_else)
- return Error("expected else");
-
- getNextToken();
-
- ExprAST *Else = ParseExpression();
- if (!Else) return 0;
-
- return new IfExprAST(Cond, Then, Else);
-}
-</pre>
-</div>
-
-<p>Next we hook it up as a primary expression:</p>
-
-<div class="doc_code">
-<pre>
-static ExprAST *ParsePrimary() {
- switch (CurTok) {
- default: return Error("unknown token when expecting an expression");
- case tok_identifier: return ParseIdentifierExpr();
- case tok_number: return ParseNumberExpr();
- case '(': return ParseParenExpr();
- <b>case tok_if: return ParseIfExpr();</b>
- }
-}
-</pre>
-</div>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsubsection"><a name="ifir">LLVM IR for If/Then/Else</a></div>
-<!-- ======================================================================= -->
-
-<div class="doc_text">
-
-<p>Now that we have it parsing and building the AST, the final piece is adding
-LLVM code generation support. This is the most interesting part of the
-if/then/else example, because this is where it starts to introduce new concepts.
-All of the code above has been thoroughly described in previous chapters.
-</p>
-
-<p>To motivate the code we want to produce, lets take a look at a simple
-example. Consider:</p>
-
-<div class="doc_code">
-<pre>
-extern foo();
-extern bar();
-def baz(x) if x then foo() else bar();
-</pre>
-</div>
-
-<p>If you disable optimizations, the code you'll (soon) get from Kaleidoscope
-looks like this:</p>
-
-<div class="doc_code">
-<pre>
-declare double @foo()
-
-declare double @bar()
-
-define double @baz(double %x) {
-entry:
- %ifcond = fcmp one double %x, 0.000000e+00
- br i1 %ifcond, label %then, label %else
-
-then: ; preds = %entry
- %calltmp = call double @foo()
- br label %ifcont
-
-else: ; preds = %entry
- %calltmp1 = call double @bar()
- br label %ifcont
-
-ifcont: ; preds = %else, %then
- %iftmp = phi double [ %calltmp, %then ], [ %calltmp1, %else ]
- ret double %iftmp
-}
-</pre>
-</div>
-
-<p>To visualize the control flow graph, you can use a nifty feature of the LLVM
-'<a href="http://llvm.org/cmds/opt.html">opt</a>' tool. If you put this LLVM IR
-into "t.ll" and run "<tt>llvm-as &lt; t.ll | opt -analyze -view-cfg</tt>", <a
-href="../ProgrammersManual.html#ViewGraph">a window will pop up</a> and you'll
-see this graph:</p>
-
-<center><img src="LangImpl5-cfg.png" alt="Example CFG" width="423"
-height="315"></center>
-
-<p>Another way to get this is to call "<tt>F-&gt;viewCFG()</tt>" or
-"<tt>F-&gt;viewCFGOnly()</tt>" (where F is a "<tt>Function*</tt>") either by
-inserting actual calls into the code and recompiling or by calling these in the
-debugger. LLVM has many nice features for visualizing various graphs.</p>
-
-<p>Getting back to the generated code, it is fairly simple: the entry block
-evaluates the conditional expression ("x" in our case here) and compares the
-result to 0.0 with the "<tt><a href="../LangRef.html#i_fcmp">fcmp</a> one</tt>"
-instruction ('one' is "Ordered and Not Equal"). Based on the result of this
-expression, the code jumps to either the "then" or "else" blocks, which contain
-the expressions for the true/false cases.</p>
-
-<p>Once the then/else blocks are finished executing, they both branch back to the
-'ifcont' block to execute the code that happens after the if/then/else. In this
-case the only thing left to do is to return to the caller of the function. The
-question then becomes: how does the code know which expression to return?</p>
-
-<p>The answer to this question involves an important SSA operation: the
-<a href="http://en.wikipedia.org/wiki/Static_single_assignment_form">Phi
-operation</a>. If you're not familiar with SSA, <a
-href="http://en.wikipedia.org/wiki/Static_single_assignment_form">the wikipedia
-article</a> is a good introduction and there are various other introductions to
-it available on your favorite search engine. The short version is that
-"execution" of the Phi operation requires "remembering" which block control came
-from. The Phi operation takes on the value corresponding to the input control
-block. In this case, if control comes in from the "then" block, it gets the
-value of "calltmp". If control comes from the "else" block, it gets the value
-of "calltmp1".</p>
-
-<p>At this point, you are probably starting to think "Oh no! This means my
-simple and elegant front-end will have to start generating SSA form in order to
-use LLVM!". Fortunately, this is not the case, and we strongly advise
-<em>not</em> implementing an SSA construction algorithm in your front-end
-unless there is an amazingly good reason to do so. In practice, there are two
-sorts of values that float around in code written for your average imperative
-programming language that might need Phi nodes:</p>
-
-<ol>
-<li>Code that involves user variables: <tt>x = 1; x = x + 1; </tt></li>
-<li>Values that are implicit in the structure of your AST, such as the Phi node
-in this case.</li>
-</ol>
-
-<p>In <a href="LangImpl7.html">Chapter 7</a> of this tutorial ("mutable
-variables"), we'll talk about #1
-in depth. For now, just believe me that you don't need SSA construction to
-handle this case. For #2, you have the choice of using the techniques that we will
-describe for #1, or you can insert Phi nodes directly, if convenient. In this
-case, it is really really easy to generate the Phi node, so we choose to do it
-directly.</p>
-
-<p>Okay, enough of the motivation and overview, lets generate code!</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsubsection"><a name="ifcodegen">Code Generation for
-If/Then/Else</a></div>
-<!-- ======================================================================= -->
-
-<div class="doc_text">
-
-<p>In order to generate code for this, we implement the <tt>Codegen</tt> method
-for <tt>IfExprAST</tt>:</p>
-
-<div class="doc_code">
-<pre>
-Value *IfExprAST::Codegen() {
- Value *CondV = Cond-&gt;Codegen();
- if (CondV == 0) return 0;
-
- // Convert condition to a bool by comparing equal to 0.0.
- CondV = Builder.CreateFCmpONE(CondV,
- ConstantFP::get(Type::DoubleTy, APFloat(0.0)),
- "ifcond");
-</pre>
-</div>
-
-<p>This code is straightforward and similar to what we saw before. We emit the
-expression for the condition, then compare that value to zero to get a truth
-value as a 1-bit (bool) value.</p>
-
-<div class="doc_code">
-<pre>
- Function *TheFunction = Builder.GetInsertBlock()-&gt;getParent();
-
- // Create blocks for the then and else cases. Insert the 'then' block at the
- // end of the function.
- BasicBlock *ThenBB = BasicBlock::Create("then", TheFunction);
- BasicBlock *ElseBB = BasicBlock::Create("else");
- BasicBlock *MergeBB = BasicBlock::Create("ifcont");
-
- Builder.CreateCondBr(CondV, ThenBB, ElseBB);
-</pre>
-</div>
-
-<p>This code creates the basic blocks that are related to the if/then/else
-statement, and correspond directly to the blocks in the example above. The
-first line gets the current Function object that is being built. It
-gets this by asking the builder for the current BasicBlock, and asking that
-block for its "parent" (the function it is currently embedded into).</p>
-
-<p>Once it has that, it creates three blocks. Note that it passes "TheFunction"
-into the constructor for the "then" block. This causes the constructor to
-automatically insert the new block into the end of the specified function. The
-other two blocks are created, but aren't yet inserted into the function.</p>
-
-<p>Once the blocks are created, we can emit the conditional branch that chooses
-between them. Note that creating new blocks does not implicitly affect the
-IRBuilder, so it is still inserting into the block that the condition
-went into. Also note that it is creating a branch to the "then" block and the
-"else" block, even though the "else" block isn't inserted into the function yet.
-This is all ok: it is the standard way that LLVM supports forward
-references.</p>
-
-<div class="doc_code">
-<pre>
- // Emit then value.
- Builder.SetInsertPoint(ThenBB);
-
- Value *ThenV = Then-&gt;Codegen();
- if (ThenV == 0) return 0;
-
- Builder.CreateBr(MergeBB);
- // Codegen of 'Then' can change the current block, update ThenBB for the PHI.
- ThenBB = Builder.GetInsertBlock();
-</pre>
-</div>
-
-<p>After the conditional branch is inserted, we move the builder to start
-inserting into the "then" block. Strictly speaking, this call moves the
-insertion point to be at the end of the specified block. However, since the
-"then" block is empty, it also starts out by inserting at the beginning of the
-block. :)</p>
-
-<p>Once the insertion point is set, we recursively codegen the "then" expression
-from the AST. To finish off the "then" block, we create an unconditional branch
-to the merge block. One interesting (and very important) aspect of the LLVM IR
-is that it <a href="../LangRef.html#functionstructure">requires all basic blocks
-to be "terminated"</a> with a <a href="../LangRef.html#terminators">control flow
-instruction</a> such as return or branch. This means that all control flow,
-<em>including fall throughs</em> must be made explicit in the LLVM IR. If you
-violate this rule, the verifier will emit an error.</p>
-
-<p>The final line here is quite subtle, but is very important. The basic issue
-is that when we create the Phi node in the merge block, we need to set up the
-block/value pairs that indicate how the Phi will work. Importantly, the Phi
-node expects to have an entry for each predecessor of the block in the CFG. Why
-then, are we getting the current block when we just set it to ThenBB 5 lines
-above? The problem is that the "Then" expression may actually itself change the
-block that the Builder is emitting into if, for example, it contains a nested
-"if/then/else" expression. Because calling Codegen recursively could
-arbitrarily change the notion of the current block, we are required to get an
-up-to-date value for code that will set up the Phi node.</p>
-
-<div class="doc_code">
-<pre>
- // Emit else block.
- TheFunction-&gt;getBasicBlockList().push_back(ElseBB);
- Builder.SetInsertPoint(ElseBB);
-
- Value *ElseV = Else-&gt;Codegen();
- if (ElseV == 0) return 0;
-
- Builder.CreateBr(MergeBB);
- // Codegen of 'Else' can change the current block, update ElseBB for the PHI.
- ElseBB = Builder.GetInsertBlock();
-</pre>
-</div>
-
-<p>Code generation for the 'else' block is basically identical to codegen for
-the 'then' block. The only significant difference is the first line, which adds
-the 'else' block to the function. Recall previously that the 'else' block was
-created, but not added to the function. Now that the 'then' and 'else' blocks
-are emitted, we can finish up with the merge code:</p>
-
-<div class="doc_code">
-<pre>
- // Emit merge block.
- TheFunction->getBasicBlockList().push_back(MergeBB);
- Builder.SetInsertPoint(MergeBB);
- PHINode *PN = Builder.CreatePHI(Type::DoubleTy, "iftmp");
-
- PN->addIncoming(ThenV, ThenBB);
- PN->addIncoming(ElseV, ElseBB);
- return PN;
-}
-</pre>
-</div>
-
-<p>The first two lines here are now familiar: the first adds the "merge" block
-to the Function object (it was previously floating, like the else block above).
-The second block changes the insertion point so that newly created code will go
-into the "merge" block. Once that is done, we need to create the PHI node and
-set up the block/value pairs for the PHI.</p>
-
-<p>Finally, the CodeGen function returns the phi node as the value computed by
-the if/then/else expression. In our example above, this returned value will
-feed into the code for the top-level function, which will create the return
-instruction.</p>
-
-<p>Overall, we now have the ability to execute conditional code in
-Kaleidoscope. With this extension, Kaleidoscope is a fairly complete language
-that can calculate a wide variety of numeric functions. Next up we'll add
-another useful expression that is familiar from non-functional languages...</p>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section"><a name="for">'for' Loop Expression</a></div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>Now that we know how to add basic control flow constructs to the language,
-we have the tools to add more powerful things. Lets add something more
-aggressive, a 'for' expression:</p>
-
-<div class="doc_code">
-<pre>
- extern putchard(char)
- def printstar(n)
- for i = 1, i &lt; n, 1.0 in
- putchard(42); # ascii 42 = '*'
-
- # print 100 '*' characters
- printstar(100);
-</pre>
-</div>
-
-<p>This expression defines a new variable ("i" in this case) which iterates from
-a starting value, while the condition ("i &lt; n" in this case) is true,
-incrementing by an optional step value ("1.0" in this case). If the step value
-is omitted, it defaults to 1.0. While the loop is true, it executes its
-body expression. Because we don't have anything better to return, we'll just
-define the loop as always returning 0.0. In the future when we have mutable
-variables, it will get more useful.</p>
-
-<p>As before, lets talk about the changes that we need to Kaleidoscope to
-support this.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsubsection"><a name="forlexer">Lexer Extensions for
-the 'for' Loop</a></div>
-<!-- ======================================================================= -->
-
-<div class="doc_text">
-
-<p>The lexer extensions are the same sort of thing as for if/then/else:</p>
-
-<div class="doc_code">
-<pre>
- ... in enum Token ...
- // control
- tok_if = -6, tok_then = -7, tok_else = -8,
-<b> tok_for = -9, tok_in = -10</b>
-
- ... in gettok ...
- if (IdentifierStr == "def") return tok_def;
- if (IdentifierStr == "extern") return tok_extern;
- if (IdentifierStr == "if") return tok_if;
- if (IdentifierStr == "then") return tok_then;
- if (IdentifierStr == "else") return tok_else;
- <b>if (IdentifierStr == "for") return tok_for;
- if (IdentifierStr == "in") return tok_in;</b>
- return tok_identifier;
-</pre>
-</div>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsubsection"><a name="forast">AST Extensions for
-the 'for' Loop</a></div>
-<!-- ======================================================================= -->
-
-<div class="doc_text">
-
-<p>The AST node is just as simple. It basically boils down to capturing
-the variable name and the constituent expressions in the node.</p>
-
-<div class="doc_code">
-<pre>
-/// ForExprAST - Expression class for for/in.
-class ForExprAST : public ExprAST {
- std::string VarName;
- ExprAST *Start, *End, *Step, *Body;
-public:
- ForExprAST(const std::string &amp;varname, ExprAST *start, ExprAST *end,
- ExprAST *step, ExprAST *body)
- : VarName(varname), Start(start), End(end), Step(step), Body(body) {}
- virtual Value *Codegen();
-};
-</pre>
-</div>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsubsection"><a name="forparser">Parser Extensions for
-the 'for' Loop</a></div>
-<!-- ======================================================================= -->
-
-<div class="doc_text">
-
-<p>The parser code is also fairly standard. The only interesting thing here is
-handling of the optional step value. The parser code handles it by checking to
-see if the second comma is present. If not, it sets the step value to null in
-the AST node:</p>
-
-<div class="doc_code">
-<pre>
-/// forexpr ::= 'for' identifier '=' expr ',' expr (',' expr)? 'in' expression
-static ExprAST *ParseForExpr() {
- getNextToken(); // eat the for.
-
- if (CurTok != tok_identifier)
- return Error("expected identifier after for");
-
- std::string IdName = IdentifierStr;
- getNextToken(); // eat identifier.
-
- if (CurTok != '=')
- return Error("expected '=' after for");
- getNextToken(); // eat '='.
-
-
- ExprAST *Start = ParseExpression();
- if (Start == 0) return 0;
- if (CurTok != ',')
- return Error("expected ',' after for start value");
- getNextToken();
-
- ExprAST *End = ParseExpression();
- if (End == 0) return 0;
-
- // The step value is optional.
- ExprAST *Step = 0;
- if (CurTok == ',') {
- getNextToken();
- Step = ParseExpression();
- if (Step == 0) return 0;
- }
-
- if (CurTok != tok_in)
- return Error("expected 'in' after for");
- getNextToken(); // eat 'in'.
-
- ExprAST *Body = ParseExpression();
- if (Body == 0) return 0;
-
- return new ForExprAST(IdName, Start, End, Step, Body);
-}
-</pre>
-</div>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsubsection"><a name="forir">LLVM IR for
-the 'for' Loop</a></div>
-<!-- ======================================================================= -->
-
-<div class="doc_text">
-
-<p>Now we get to the good part: the LLVM IR we want to generate for this thing.
-With the simple example above, we get this LLVM IR (note that this dump is
-generated with optimizations disabled for clarity):
-</p>
-
-<div class="doc_code">
-<pre>
-declare double @putchard(double)
-
-define double @printstar(double %n) {
-entry:
- ; initial value = 1.0 (inlined into phi)
- br label %loop
-
-loop: ; preds = %loop, %entry
- %i = phi double [ 1.000000e+00, %entry ], [ %nextvar, %loop ]
- ; body
- %calltmp = call double @putchard( double 4.200000e+01 )
- ; increment
- %nextvar = add double %i, 1.000000e+00
-
- ; termination test
- %cmptmp = fcmp ult double %i, %n
- %booltmp = uitofp i1 %cmptmp to double
- %loopcond = fcmp one double %booltmp, 0.000000e+00
- br i1 %loopcond, label %loop, label %afterloop
-
-afterloop: ; preds = %loop
- ; loop always returns 0.0
- ret double 0.000000e+00
-}
-</pre>
-</div>
-
-<p>This loop contains all the same constructs we saw before: a phi node, several
-expressions, and some basic blocks. Lets see how this fits together.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsubsection"><a name="forcodegen">Code Generation for
-the 'for' Loop</a></div>
-<!-- ======================================================================= -->
-
-<div class="doc_text">
-
-<p>The first part of Codegen is very simple: we just output the start expression
-for the loop value:</p>
-
-<div class="doc_code">
-<pre>
-Value *ForExprAST::Codegen() {
- // Emit the start code first, without 'variable' in scope.
- Value *StartVal = Start-&gt;Codegen();
- if (StartVal == 0) return 0;
-</pre>
-</div>
-
-<p>With this out of the way, the next step is to set up the LLVM basic block
-for the start of the loop body. In the case above, the whole loop body is one
-block, but remember that the body code itself could consist of multiple blocks
-(e.g. if it contains an if/then/else or a for/in expression).</p>
-
-<div class="doc_code">
-<pre>
- // Make the new basic block for the loop header, inserting after current
- // block.
- Function *TheFunction = Builder.GetInsertBlock()-&gt;getParent();
- BasicBlock *PreheaderBB = Builder.GetInsertBlock();
- BasicBlock *LoopBB = BasicBlock::Create("loop", TheFunction);
-
- // Insert an explicit fall through from the current block to the LoopBB.
- Builder.CreateBr(LoopBB);
-</pre>
-</div>
-
-<p>This code is similar to what we saw for if/then/else. Because we will need
-it to create the Phi node, we remember the block that falls through into the
-loop. Once we have that, we create the actual block that starts the loop and
-create an unconditional branch for the fall-through between the two blocks.</p>
-
-<div class="doc_code">
-<pre>
- // Start insertion in LoopBB.
- Builder.SetInsertPoint(LoopBB);
-
- // Start the PHI node with an entry for Start.
- PHINode *Variable = Builder.CreatePHI(Type::DoubleTy, VarName.c_str());
- Variable-&gt;addIncoming(StartVal, PreheaderBB);
-</pre>
-</div>
-
-<p>Now that the "preheader" for the loop is set up, we switch to emitting code
-for the loop body. To begin with, we move the insertion point and create the
-PHI node for the loop induction variable. Since we already know the incoming
-value for the starting value, we add it to the Phi node. Note that the Phi will
-eventually get a second value for the backedge, but we can't set it up yet
-(because it doesn't exist!).</p>
-
-<div class="doc_code">
-<pre>
- // Within the loop, the variable is defined equal to the PHI node. If it
- // shadows an existing variable, we have to restore it, so save it now.
- Value *OldVal = NamedValues[VarName];
- NamedValues[VarName] = Variable;
-
- // Emit the body of the loop. This, like any other expr, can change the
- // current BB. Note that we ignore the value computed by the body, but don't
- // allow an error.
- if (Body-&gt;Codegen() == 0)
- return 0;
-</pre>
-</div>
-
-<p>Now the code starts to get more interesting. Our 'for' loop introduces a new
-variable to the symbol table. This means that our symbol table can now contain
-either function arguments or loop variables. To handle this, before we codegen
-the body of the loop, we add the loop variable as the current value for its
-name. Note that it is possible that there is a variable of the same name in the
-outer scope. It would be easy to make this an error (emit an error and return
-null if there is already an entry for VarName) but we choose to allow shadowing
-of variables. In order to handle this correctly, we remember the Value that
-we are potentially shadowing in <tt>OldVal</tt> (which will be null if there is
-no shadowed variable).</p>
-
-<p>Once the loop variable is set into the symbol table, the code recursively
-codegen's the body. This allows the body to use the loop variable: any
-references to it will naturally find it in the symbol table.</p>
-
-<div class="doc_code">
-<pre>
- // Emit the step value.
- Value *StepVal;
- if (Step) {
- StepVal = Step-&gt;Codegen();
- if (StepVal == 0) return 0;
- } else {
- // If not specified, use 1.0.
- StepVal = ConstantFP::get(Type::DoubleTy, APFloat(1.0));
- }
-
- Value *NextVar = Builder.CreateAdd(Variable, StepVal, "nextvar");
-</pre>
-</div>
-
-<p>Now that the body is emitted, we compute the next value of the iteration
-variable by adding the step value, or 1.0 if it isn't present. '<tt>NextVar</tt>'
-will be the value of the loop variable on the next iteration of the loop.</p>
-
-<div class="doc_code">
-<pre>
- // Compute the end condition.
- Value *EndCond = End-&gt;Codegen();
- if (EndCond == 0) return EndCond;
-
- // Convert condition to a bool by comparing equal to 0.0.
- EndCond = Builder.CreateFCmpONE(EndCond,
- ConstantFP::get(Type::DoubleTy, APFloat(0.0)),
- "loopcond");
-</pre>
-</div>
-
-<p>Finally, we evaluate the exit value of the loop, to determine whether the
-loop should exit. This mirrors the condition evaluation for the if/then/else
-statement.</p>
-
-<div class="doc_code">
-<pre>
- // Create the "after loop" block and insert it.
- BasicBlock *LoopEndBB = Builder.GetInsertBlock();
- BasicBlock *AfterBB = BasicBlock::Create("afterloop", TheFunction);
-
- // Insert the conditional branch into the end of LoopEndBB.
- Builder.CreateCondBr(EndCond, LoopBB, AfterBB);
-
- // Any new code will be inserted in AfterBB.
- Builder.SetInsertPoint(AfterBB);
-</pre>
-</div>
-
-<p>With the code for the body of the loop complete, we just need to finish up
-the control flow for it. This code remembers the end block (for the phi node), then creates the block for the loop exit ("afterloop"). Based on the value of the
-exit condition, it creates a conditional branch that chooses between executing
-the loop again and exiting the loop. Any future code is emitted in the
-"afterloop" block, so it sets the insertion position to it.</p>
-
-<div class="doc_code">
-<pre>
- // Add a new entry to the PHI node for the backedge.
- Variable-&gt;addIncoming(NextVar, LoopEndBB);
-
- // Restore the unshadowed variable.
- if (OldVal)
- NamedValues[VarName] = OldVal;
- else
- NamedValues.erase(VarName);
-
- // for expr always returns 0.0.
- return Constant::getNullValue(Type::DoubleTy);
-}
-</pre>
-</div>
-
-<p>The final code handles various cleanups: now that we have the "NextVar"
-value, we can add the incoming value to the loop PHI node. After that, we
-remove the loop variable from the symbol table, so that it isn't in scope after
-the for loop. Finally, code generation of the for loop always returns 0.0, so
-that is what we return from <tt>ForExprAST::Codegen</tt>.</p>
-
-<p>With this, we conclude the "adding control flow to Kaleidoscope" chapter of
-the tutorial. In this chapter we added two control flow constructs, and used them to motivate a couple of aspects of the LLVM IR that are important for front-end implementors
-to know. In the next chapter of our saga, we will get a bit crazier and add
-<a href="LangImpl6.html">user-defined operators</a> to our poor innocent
-language.</p>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section"><a name="code">Full Code Listing</a></div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>
-Here is the complete code listing for our running example, enhanced with the
-if/then/else and for expressions.. To build this example, use:
-</p>
-
-<div class="doc_code">
-<pre>
- # Compile
- g++ -g toy.cpp `llvm-config --cppflags --ldflags --libs core jit native` -O3 -o toy
- # Run
- ./toy
-</pre>
-</div>
-
-<p>Here is the code:</p>
-
-<div class="doc_code">
-<pre>
-#include "llvm/DerivedTypes.h"
-#include "llvm/ExecutionEngine/ExecutionEngine.h"
-#include "llvm/Module.h"
-#include "llvm/ModuleProvider.h"
-#include "llvm/PassManager.h"
-#include "llvm/Analysis/Verifier.h"
-#include "llvm/Target/TargetData.h"
-#include "llvm/Transforms/Scalar.h"
-#include "llvm/Support/IRBuilder.h"
-#include &lt;cstdio&gt;
-#include &lt;string&gt;
-#include &lt;map&gt;
-#include &lt;vector&gt;
-using namespace llvm;
-
-//===----------------------------------------------------------------------===//
-// Lexer
-//===----------------------------------------------------------------------===//
-
-// The lexer returns tokens [0-255] if it is an unknown character, otherwise one
-// of these for known things.
-enum Token {
- tok_eof = -1,
-
- // commands
- tok_def = -2, tok_extern = -3,
-
- // primary
- tok_identifier = -4, tok_number = -5,
-
- // control
- tok_if = -6, tok_then = -7, tok_else = -8,
- tok_for = -9, tok_in = -10
-};
-
-static std::string IdentifierStr; // Filled in if tok_identifier
-static double NumVal; // Filled in if tok_number
-
-/// gettok - Return the next token from standard input.
-static int gettok() {
- static int LastChar = ' ';
-
- // Skip any whitespace.
- while (isspace(LastChar))
- LastChar = getchar();
-
- if (isalpha(LastChar)) { // identifier: [a-zA-Z][a-zA-Z0-9]*
- IdentifierStr = LastChar;
- while (isalnum((LastChar = getchar())))
- IdentifierStr += LastChar;
-
- if (IdentifierStr == "def") return tok_def;
- if (IdentifierStr == "extern") return tok_extern;
- if (IdentifierStr == "if") return tok_if;
- if (IdentifierStr == "then") return tok_then;
- if (IdentifierStr == "else") return tok_else;
- if (IdentifierStr == "for") return tok_for;
- if (IdentifierStr == "in") return tok_in;
- return tok_identifier;
- }
-
- if (isdigit(LastChar) || LastChar == '.') { // Number: [0-9.]+
- std::string NumStr;
- do {
- NumStr += LastChar;
- LastChar = getchar();
- } while (isdigit(LastChar) || LastChar == '.');
-
- NumVal = strtod(NumStr.c_str(), 0);
- return tok_number;
- }
-
- if (LastChar == '#') {
- // Comment until end of line.
- do LastChar = getchar();
- while (LastChar != EOF &amp;&amp; LastChar != '\n' &amp;&amp; LastChar != '\r');
-
- if (LastChar != EOF)
- return gettok();
- }
-
- // Check for end of file. Don't eat the EOF.
- if (LastChar == EOF)
- return tok_eof;
-
- // Otherwise, just return the character as its ascii value.
- int ThisChar = LastChar;
- LastChar = getchar();
- return ThisChar;
-}
-
-//===----------------------------------------------------------------------===//
-// Abstract Syntax Tree (aka Parse Tree)
-//===----------------------------------------------------------------------===//
-
-/// ExprAST - Base class for all expression nodes.
-class ExprAST {
-public:
- virtual ~ExprAST() {}
- virtual Value *Codegen() = 0;
-};
-
-/// NumberExprAST - Expression class for numeric literals like "1.0".
-class NumberExprAST : public ExprAST {
- double Val;
-public:
- NumberExprAST(double val) : Val(val) {}
- virtual Value *Codegen();
-};
-
-/// VariableExprAST - Expression class for referencing a variable, like "a".
-class VariableExprAST : public ExprAST {
- std::string Name;
-public:
- VariableExprAST(const std::string &amp;name) : Name(name) {}
- virtual Value *Codegen();
-};
-
-/// BinaryExprAST - Expression class for a binary operator.
-class BinaryExprAST : public ExprAST {
- char Op;
- ExprAST *LHS, *RHS;
-public:
- BinaryExprAST(char op, ExprAST *lhs, ExprAST *rhs)
- : Op(op), LHS(lhs), RHS(rhs) {}
- virtual Value *Codegen();
-};
-
-/// CallExprAST - Expression class for function calls.
-class CallExprAST : public ExprAST {
- std::string Callee;
- std::vector&lt;ExprAST*&gt; Args;
-public:
- CallExprAST(const std::string &amp;callee, std::vector&lt;ExprAST*&gt; &amp;args)
- : Callee(callee), Args(args) {}
- virtual Value *Codegen();
-};
-
-/// IfExprAST - Expression class for if/then/else.
-class IfExprAST : public ExprAST {
- ExprAST *Cond, *Then, *Else;
-public:
- IfExprAST(ExprAST *cond, ExprAST *then, ExprAST *_else)
- : Cond(cond), Then(then), Else(_else) {}
- virtual Value *Codegen();
-};
-
-/// ForExprAST - Expression class for for/in.
-class ForExprAST : public ExprAST {
- std::string VarName;
- ExprAST *Start, *End, *Step, *Body;
-public:
- ForExprAST(const std::string &amp;varname, ExprAST *start, ExprAST *end,
- ExprAST *step, ExprAST *body)
- : VarName(varname), Start(start), End(end), Step(step), Body(body) {}
- virtual Value *Codegen();
-};
-
-/// PrototypeAST - This class represents the "prototype" for a function,
-/// which captures its argument names as well as if it is an operator.
-class PrototypeAST {
- std::string Name;
- std::vector&lt;std::string&gt; Args;
-public:
- PrototypeAST(const std::string &amp;name, const std::vector&lt;std::string&gt; &amp;args)
- : Name(name), Args(args) {}
-
- Function *Codegen();
-};
-
-/// FunctionAST - This class represents a function definition itself.
-class FunctionAST {
- PrototypeAST *Proto;
- ExprAST *Body;
-public:
- FunctionAST(PrototypeAST *proto, ExprAST *body)
- : Proto(proto), Body(body) {}
-
- Function *Codegen();
-};
-
-//===----------------------------------------------------------------------===//
-// Parser
-//===----------------------------------------------------------------------===//
-
-/// CurTok/getNextToken - Provide a simple token buffer. CurTok is the current
-/// token the parser it looking at. getNextToken reads another token from the
-/// lexer and updates CurTok with its results.
-static int CurTok;
-static int getNextToken() {
- return CurTok = gettok();
-}
-
-/// BinopPrecedence - This holds the precedence for each binary operator that is
-/// defined.
-static std::map&lt;char, int&gt; BinopPrecedence;
-
-/// GetTokPrecedence - Get the precedence of the pending binary operator token.
-static int GetTokPrecedence() {
- if (!isascii(CurTok))
- return -1;
-
- // Make sure it's a declared binop.
- int TokPrec = BinopPrecedence[CurTok];
- if (TokPrec &lt;= 0) return -1;
- return TokPrec;
-}
-
-/// Error* - These are little helper functions for error handling.
-ExprAST *Error(const char *Str) { fprintf(stderr, "Error: %s\n", Str);return 0;}
-PrototypeAST *ErrorP(const char *Str) { Error(Str); return 0; }
-FunctionAST *ErrorF(const char *Str) { Error(Str); return 0; }
-
-static ExprAST *ParseExpression();
-
-/// identifierexpr
-/// ::= identifier
-/// ::= identifier '(' expression* ')'
-static ExprAST *ParseIdentifierExpr() {
- std::string IdName = IdentifierStr;
-
- getNextToken(); // eat identifier.
-
- if (CurTok != '(') // Simple variable ref.
- return new VariableExprAST(IdName);
-
- // Call.
- getNextToken(); // eat (
- std::vector&lt;ExprAST*&gt; Args;
- if (CurTok != ')') {
- while (1) {
- ExprAST *Arg = ParseExpression();
- if (!Arg) return 0;
- Args.push_back(Arg);
-
- if (CurTok == ')') break;
-
- if (CurTok != ',')
- return Error("Expected ')' or ',' in argument list");
- getNextToken();
- }
- }
-
- // Eat the ')'.
- getNextToken();
-
- return new CallExprAST(IdName, Args);
-}
-
-/// numberexpr ::= number
-static ExprAST *ParseNumberExpr() {
- ExprAST *Result = new NumberExprAST(NumVal);
- getNextToken(); // consume the number
- return Result;
-}
-
-/// parenexpr ::= '(' expression ')'
-static ExprAST *ParseParenExpr() {
- getNextToken(); // eat (.
- ExprAST *V = ParseExpression();
- if (!V) return 0;
-
- if (CurTok != ')')
- return Error("expected ')'");
- getNextToken(); // eat ).
- return V;
-}
-
-/// ifexpr ::= 'if' expression 'then' expression 'else' expression
-static ExprAST *ParseIfExpr() {
- getNextToken(); // eat the if.
-
- // condition.
- ExprAST *Cond = ParseExpression();
- if (!Cond) return 0;
-
- if (CurTok != tok_then)
- return Error("expected then");
- getNextToken(); // eat the then
-
- ExprAST *Then = ParseExpression();
- if (Then == 0) return 0;
-
- if (CurTok != tok_else)
- return Error("expected else");
-
- getNextToken();
-
- ExprAST *Else = ParseExpression();
- if (!Else) return 0;
-
- return new IfExprAST(Cond, Then, Else);
-}
-
-/// forexpr ::= 'for' identifier '=' expr ',' expr (',' expr)? 'in' expression
-static ExprAST *ParseForExpr() {
- getNextToken(); // eat the for.
-
- if (CurTok != tok_identifier)
- return Error("expected identifier after for");
-
- std::string IdName = IdentifierStr;
- getNextToken(); // eat identifier.
-
- if (CurTok != '=')
- return Error("expected '=' after for");
- getNextToken(); // eat '='.
-
-
- ExprAST *Start = ParseExpression();
- if (Start == 0) return 0;
- if (CurTok != ',')
- return Error("expected ',' after for start value");
- getNextToken();
-
- ExprAST *End = ParseExpression();
- if (End == 0) return 0;
-
- // The step value is optional.
- ExprAST *Step = 0;
- if (CurTok == ',') {
- getNextToken();
- Step = ParseExpression();
- if (Step == 0) return 0;
- }
-
- if (CurTok != tok_in)
- return Error("expected 'in' after for");
- getNextToken(); // eat 'in'.
-
- ExprAST *Body = ParseExpression();
- if (Body == 0) return 0;
-
- return new ForExprAST(IdName, Start, End, Step, Body);
-}
-
-
-/// primary
-/// ::= identifierexpr
-/// ::= numberexpr
-/// ::= parenexpr
-/// ::= ifexpr
-/// ::= forexpr
-static ExprAST *ParsePrimary() {
- switch (CurTok) {
- default: return Error("unknown token when expecting an expression");
- case tok_identifier: return ParseIdentifierExpr();
- case tok_number: return ParseNumberExpr();
- case '(': return ParseParenExpr();
- case tok_if: return ParseIfExpr();
- case tok_for: return ParseForExpr();
- }
-}
-
-/// binoprhs
-/// ::= ('+' primary)*
-static ExprAST *ParseBinOpRHS(int ExprPrec, ExprAST *LHS) {
- // If this is a binop, find its precedence.
- while (1) {
- int TokPrec = GetTokPrecedence();
-
- // If this is a binop that binds at least as tightly as the current binop,
- // consume it, otherwise we are done.
- if (TokPrec &lt; ExprPrec)
- return LHS;
-
- // Okay, we know this is a binop.
- int BinOp = CurTok;
- getNextToken(); // eat binop
-
- // Parse the primary expression after the binary operator.
- ExprAST *RHS = ParsePrimary();
- if (!RHS) return 0;
-
- // If BinOp binds less tightly with RHS than the operator after RHS, let
- // the pending operator take RHS as its LHS.
- int NextPrec = GetTokPrecedence();
- if (TokPrec &lt; NextPrec) {
- RHS = ParseBinOpRHS(TokPrec+1, RHS);
- if (RHS == 0) return 0;
- }
-
- // Merge LHS/RHS.
- LHS = new BinaryExprAST(BinOp, LHS, RHS);
- }
-}
-
-/// expression
-/// ::= primary binoprhs
-///
-static ExprAST *ParseExpression() {
- ExprAST *LHS = ParsePrimary();
- if (!LHS) return 0;
-
- return ParseBinOpRHS(0, LHS);
-}
-
-/// prototype
-/// ::= id '(' id* ')'
-static PrototypeAST *ParsePrototype() {
- if (CurTok != tok_identifier)
- return ErrorP("Expected function name in prototype");
-
- std::string FnName = IdentifierStr;
- getNextToken();
-
- if (CurTok != '(')
- return ErrorP("Expected '(' in prototype");
-
- std::vector&lt;std::string&gt; ArgNames;
- while (getNextToken() == tok_identifier)
- ArgNames.push_back(IdentifierStr);
- if (CurTok != ')')
- return ErrorP("Expected ')' in prototype");
-
- // success.
- getNextToken(); // eat ')'.
-
- return new PrototypeAST(FnName, ArgNames);
-}
-
-/// definition ::= 'def' prototype expression
-static FunctionAST *ParseDefinition() {
- getNextToken(); // eat def.
- PrototypeAST *Proto = ParsePrototype();
- if (Proto == 0) return 0;
-
- if (ExprAST *E = ParseExpression())
- return new FunctionAST(Proto, E);
- return 0;
-}
-
-/// toplevelexpr ::= expression
-static FunctionAST *ParseTopLevelExpr() {
- if (ExprAST *E = ParseExpression()) {
- // Make an anonymous proto.
- PrototypeAST *Proto = new PrototypeAST("", std::vector&lt;std::string&gt;());
- return new FunctionAST(Proto, E);
- }
- return 0;
-}
-
-/// external ::= 'extern' prototype
-static PrototypeAST *ParseExtern() {
- getNextToken(); // eat extern.
- return ParsePrototype();
-}
-
-//===----------------------------------------------------------------------===//
-// Code Generation
-//===----------------------------------------------------------------------===//
-
-static Module *TheModule;
-static IRBuilder Builder;
-static std::map&lt;std::string, Value*&gt; NamedValues;
-static FunctionPassManager *TheFPM;
-
-Value *ErrorV(const char *Str) { Error(Str); return 0; }
-
-Value *NumberExprAST::Codegen() {
- return ConstantFP::get(Type::DoubleTy, APFloat(Val));
-}
-
-Value *VariableExprAST::Codegen() {
- // Look this variable up in the function.
- Value *V = NamedValues[Name];
- return V ? V : ErrorV("Unknown variable name");
-}
-
-Value *BinaryExprAST::Codegen() {
- Value *L = LHS-&gt;Codegen();
- Value *R = RHS-&gt;Codegen();
- if (L == 0 || R == 0) return 0;
-
- switch (Op) {
- case '+': return Builder.CreateAdd(L, R, "addtmp");
- case '-': return Builder.CreateSub(L, R, "subtmp");
- case '*': return Builder.CreateMul(L, R, "multmp");
- case '&lt;':
- L = Builder.CreateFCmpULT(L, R, "cmptmp");
- // Convert bool 0/1 to double 0.0 or 1.0
- return Builder.CreateUIToFP(L, Type::DoubleTy, "booltmp");
- default: return ErrorV("invalid binary operator");
- }
-}
-
-Value *CallExprAST::Codegen() {
- // Look up the name in the global module table.
- Function *CalleeF = TheModule-&gt;getFunction(Callee);
- if (CalleeF == 0)
- return ErrorV("Unknown function referenced");
-
- // If argument mismatch error.
- if (CalleeF-&gt;arg_size() != Args.size())
- return ErrorV("Incorrect # arguments passed");
-
- std::vector&lt;Value*&gt; ArgsV;
- for (unsigned i = 0, e = Args.size(); i != e; ++i) {
- ArgsV.push_back(Args[i]-&gt;Codegen());
- if (ArgsV.back() == 0) return 0;
- }
-
- return Builder.CreateCall(CalleeF, ArgsV.begin(), ArgsV.end(), "calltmp");
-}
-
-Value *IfExprAST::Codegen() {
- Value *CondV = Cond-&gt;Codegen();
- if (CondV == 0) return 0;
-
- // Convert condition to a bool by comparing equal to 0.0.
- CondV = Builder.CreateFCmpONE(CondV,
- ConstantFP::get(Type::DoubleTy, APFloat(0.0)),
- "ifcond");
-
- Function *TheFunction = Builder.GetInsertBlock()-&gt;getParent();
-
- // Create blocks for the then and else cases. Insert the 'then' block at the
- // end of the function.
- BasicBlock *ThenBB = BasicBlock::Create("then", TheFunction);
- BasicBlock *ElseBB = BasicBlock::Create("else");
- BasicBlock *MergeBB = BasicBlock::Create("ifcont");
-
- Builder.CreateCondBr(CondV, ThenBB, ElseBB);
-
- // Emit then value.
- Builder.SetInsertPoint(ThenBB);
-
- Value *ThenV = Then-&gt;Codegen();
- if (ThenV == 0) return 0;
-
- Builder.CreateBr(MergeBB);
- // Codegen of 'Then' can change the current block, update ThenBB for the PHI.
- ThenBB = Builder.GetInsertBlock();
-
- // Emit else block.
- TheFunction-&gt;getBasicBlockList().push_back(ElseBB);
- Builder.SetInsertPoint(ElseBB);
-
- Value *ElseV = Else-&gt;Codegen();
- if (ElseV == 0) return 0;
-
- Builder.CreateBr(MergeBB);
- // Codegen of 'Else' can change the current block, update ElseBB for the PHI.
- ElseBB = Builder.GetInsertBlock();
-
- // Emit merge block.
- TheFunction-&gt;getBasicBlockList().push_back(MergeBB);
- Builder.SetInsertPoint(MergeBB);
- PHINode *PN = Builder.CreatePHI(Type::DoubleTy, "iftmp");
-
- PN-&gt;addIncoming(ThenV, ThenBB);
- PN-&gt;addIncoming(ElseV, ElseBB);
- return PN;
-}
-
-Value *ForExprAST::Codegen() {
- // Output this as:
- // ...
- // start = startexpr
- // goto loop
- // loop:
- // variable = phi [start, loopheader], [nextvariable, loopend]
- // ...
- // bodyexpr
- // ...
- // loopend:
- // step = stepexpr
- // nextvariable = variable + step
- // endcond = endexpr
- // br endcond, loop, endloop
- // outloop:
-
- // Emit the start code first, without 'variable' in scope.
- Value *StartVal = Start-&gt;Codegen();
- if (StartVal == 0) return 0;
-
- // Make the new basic block for the loop header, inserting after current
- // block.
- Function *TheFunction = Builder.GetInsertBlock()-&gt;getParent();
- BasicBlock *PreheaderBB = Builder.GetInsertBlock();
- BasicBlock *LoopBB = BasicBlock::Create("loop", TheFunction);
-
- // Insert an explicit fall through from the current block to the LoopBB.
- Builder.CreateBr(LoopBB);
-
- // Start insertion in LoopBB.
- Builder.SetInsertPoint(LoopBB);
-
- // Start the PHI node with an entry for Start.
- PHINode *Variable = Builder.CreatePHI(Type::DoubleTy, VarName.c_str());
- Variable-&gt;addIncoming(StartVal, PreheaderBB);
-
- // Within the loop, the variable is defined equal to the PHI node. If it
- // shadows an existing variable, we have to restore it, so save it now.
- Value *OldVal = NamedValues[VarName];
- NamedValues[VarName] = Variable;
-
- // Emit the body of the loop. This, like any other expr, can change the
- // current BB. Note that we ignore the value computed by the body, but don't
- // allow an error.
- if (Body-&gt;Codegen() == 0)
- return 0;
-
- // Emit the step value.
- Value *StepVal;
- if (Step) {
- StepVal = Step-&gt;Codegen();
- if (StepVal == 0) return 0;
- } else {
- // If not specified, use 1.0.
- StepVal = ConstantFP::get(Type::DoubleTy, APFloat(1.0));
- }
-
- Value *NextVar = Builder.CreateAdd(Variable, StepVal, "nextvar");
-
- // Compute the end condition.
- Value *EndCond = End-&gt;Codegen();
- if (EndCond == 0) return EndCond;
-
- // Convert condition to a bool by comparing equal to 0.0.
- EndCond = Builder.CreateFCmpONE(EndCond,
- ConstantFP::get(Type::DoubleTy, APFloat(0.0)),
- "loopcond");
-
- // Create the "after loop" block and insert it.
- BasicBlock *LoopEndBB = Builder.GetInsertBlock();
- BasicBlock *AfterBB = BasicBlock::Create("afterloop", TheFunction);
-
- // Insert the conditional branch into the end of LoopEndBB.
- Builder.CreateCondBr(EndCond, LoopBB, AfterBB);
-
- // Any new code will be inserted in AfterBB.
- Builder.SetInsertPoint(AfterBB);
-
- // Add a new entry to the PHI node for the backedge.
- Variable-&gt;addIncoming(NextVar, LoopEndBB);
-
- // Restore the unshadowed variable.
- if (OldVal)
- NamedValues[VarName] = OldVal;
- else
- NamedValues.erase(VarName);
-
-
- // for expr always returns 0.0.
- return Constant::getNullValue(Type::DoubleTy);
-}
-
-Function *PrototypeAST::Codegen() {
- // Make the function type: double(double,double) etc.
- std::vector&lt;const Type*&gt; Doubles(Args.size(), Type::DoubleTy);
- FunctionType *FT = FunctionType::get(Type::DoubleTy, Doubles, false);
-
- Function *F = Function::Create(FT, Function::ExternalLinkage, Name, TheModule);
-
- // If F conflicted, there was already something named 'Name'. If it has a
- // body, don't allow redefinition or reextern.
- if (F-&gt;getName() != Name) {
- // Delete the one we just made and get the existing one.
- F-&gt;eraseFromParent();
- F = TheModule-&gt;getFunction(Name);
-
- // If F already has a body, reject this.
- if (!F-&gt;empty()) {
- ErrorF("redefinition of function");
- return 0;
- }
-
- // If F took a different number of args, reject.
- if (F-&gt;arg_size() != Args.size()) {
- ErrorF("redefinition of function with different # args");
- return 0;
- }
- }
-
- // Set names for all arguments.
- unsigned Idx = 0;
- for (Function::arg_iterator AI = F-&gt;arg_begin(); Idx != Args.size();
- ++AI, ++Idx) {
- AI-&gt;setName(Args[Idx]);
-
- // Add arguments to variable symbol table.
- NamedValues[Args[Idx]] = AI;
- }
-
- return F;
-}
-
-Function *FunctionAST::Codegen() {
- NamedValues.clear();
-
- Function *TheFunction = Proto-&gt;Codegen();
- if (TheFunction == 0)
- return 0;
-
- // Create a new basic block to start insertion into.
- BasicBlock *BB = BasicBlock::Create("entry", TheFunction);
- Builder.SetInsertPoint(BB);
-
- if (Value *RetVal = Body-&gt;Codegen()) {
- // Finish off the function.
- Builder.CreateRet(RetVal);
-
- // Validate the generated code, checking for consistency.
- verifyFunction(*TheFunction);
-
- // Optimize the function.
- TheFPM-&gt;run(*TheFunction);
-
- return TheFunction;
- }
-
- // Error reading body, remove function.
- TheFunction-&gt;eraseFromParent();
- return 0;
-}
-
-//===----------------------------------------------------------------------===//
-// Top-Level parsing and JIT Driver
-//===----------------------------------------------------------------------===//
-
-static ExecutionEngine *TheExecutionEngine;
-
-static void HandleDefinition() {
- if (FunctionAST *F = ParseDefinition()) {
- if (Function *LF = F-&gt;Codegen()) {
- fprintf(stderr, "Read function definition:");
- LF-&gt;dump();
- }
- } else {
- // Skip token for error recovery.
- getNextToken();
- }
-}
-
-static void HandleExtern() {
- if (PrototypeAST *P = ParseExtern()) {
- if (Function *F = P-&gt;Codegen()) {
- fprintf(stderr, "Read extern: ");
- F-&gt;dump();
- }
- } else {
- // Skip token for error recovery.
- getNextToken();
- }
-}
-
-static void HandleTopLevelExpression() {
- // Evaluate a top level expression into an anonymous function.
- if (FunctionAST *F = ParseTopLevelExpr()) {
- if (Function *LF = F-&gt;Codegen()) {
- // JIT the function, returning a function pointer.
- void *FPtr = TheExecutionEngine-&gt;getPointerToFunction(LF);
-
- // Cast it to the right type (takes no arguments, returns a double) so we
- // can call it as a native function.
- double (*FP)() = (double (*)())FPtr;
- fprintf(stderr, "Evaluated to %f\n", FP());
- }
- } else {
- // Skip token for error recovery.
- getNextToken();
- }
-}
-
-/// top ::= definition | external | expression | ';'
-static void MainLoop() {
- while (1) {
- fprintf(stderr, "ready&gt; ");
- switch (CurTok) {
- case tok_eof: return;
- case ';': getNextToken(); break; // ignore top level semicolons.
- case tok_def: HandleDefinition(); break;
- case tok_extern: HandleExtern(); break;
- default: HandleTopLevelExpression(); break;
- }
- }
-}
-
-
-
-//===----------------------------------------------------------------------===//
-// "Library" functions that can be "extern'd" from user code.
-//===----------------------------------------------------------------------===//
-
-/// putchard - putchar that takes a double and returns 0.
-extern "C"
-double putchard(double X) {
- putchar((char)X);
- return 0;
-}
-
-//===----------------------------------------------------------------------===//
-// Main driver code.
-//===----------------------------------------------------------------------===//
-
-int main() {
- // Install standard binary operators.
- // 1 is lowest precedence.
- BinopPrecedence['&lt;'] = 10;
- BinopPrecedence['+'] = 20;
- BinopPrecedence['-'] = 20;
- BinopPrecedence['*'] = 40; // highest.
-
- // Prime the first token.
- fprintf(stderr, "ready&gt; ");
- getNextToken();
-
- // Make the module, which holds all the code.
- TheModule = new Module("my cool jit");
-
- // Create the JIT.
- TheExecutionEngine = ExecutionEngine::create(TheModule);
-
- {
- ExistingModuleProvider OurModuleProvider(TheModule);
- FunctionPassManager OurFPM(&amp;OurModuleProvider);
-
- // Set up the optimizer pipeline. Start with registering info about how the
- // target lays out data structures.
- OurFPM.add(new TargetData(*TheExecutionEngine-&gt;getTargetData()));
- // Do simple "peephole" optimizations and bit-twiddling optzns.
- OurFPM.add(createInstructionCombiningPass());
- // Reassociate expressions.
- OurFPM.add(createReassociatePass());
- // Eliminate Common SubExpressions.
- OurFPM.add(createGVNPass());
- // Simplify the control flow graph (deleting unreachable blocks, etc).
- OurFPM.add(createCFGSimplificationPass());
- // Set the global so the code gen can use this.
- TheFPM = &amp;OurFPM;
-
- // Run the main "interpreter loop" now.
- MainLoop();
-
- TheFPM = 0;
-
- // Print out all of the generated code.
- TheModule-&gt;dump();
- } // Free module provider (and thus the module) and pass manager.
-
- return 0;
-}
-</pre>
-</div>
-
-<a href="LangImpl6.html">Next: Extending the language: user-defined operators</a>
-</div>
-
-<!-- *********************************************************************** -->
-<hr>
-<address>
- <a href="http://jigsaw.w3.org/css-validator/check/referer"><img
- src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"></a>
- <a href="http://validator.w3.org/check/referer"><img
- src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!"></a>
-
- <a href="mailto:sabre@nondot.org">Chris Lattner</a><br>
- <a href="http://llvm.org">The LLVM Compiler Infrastructure</a><br>
- Last modified: $Date: 2007-10-17 11:05:13 -0700 (Wed, 17 Oct 2007) $
-</address>
-</body>
-</html>
diff --git a/release_23/docs/tutorial/LangImpl6.html b/release_23/docs/tutorial/LangImpl6.html
deleted file mode 100644
index 97eba53ed4fe..000000000000
--- a/release_23/docs/tutorial/LangImpl6.html
+++ /dev/null
@@ -1,1803 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
- "http://www.w3.org/TR/html4/strict.dtd">
-
-<html>
-<head>
- <title>Kaleidoscope: Extending the Language: User-defined Operators</title>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <meta name="author" content="Chris Lattner">
- <link rel="stylesheet" href="../llvm.css" type="text/css">
-</head>
-
-<body>
-
-<div class="doc_title">Kaleidoscope: Extending the Language: User-defined Operators</div>
-
-<ul>
-<li><a href="index.html">Up to Tutorial Index</a></li>
-<li>Chapter 6
- <ol>
- <li><a href="#intro">Chapter 6 Introduction</a></li>
- <li><a href="#idea">User-defined Operators: the Idea</a></li>
- <li><a href="#binary">User-defined Binary Operators</a></li>
- <li><a href="#unary">User-defined Unary Operators</a></li>
- <li><a href="#example">Kicking the Tires</a></li>
- <li><a href="#code">Full Code Listing</a></li>
- </ol>
-</li>
-<li><a href="LangImpl7.html">Chapter 7</a>: Extending the Language: Mutable
-Variables / SSA Construction</li>
-</ul>
-
-<div class="doc_author">
- <p>Written by <a href="mailto:sabre@nondot.org">Chris Lattner</a></p>
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section"><a name="intro">Chapter 6 Introduction</a></div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>Welcome to Chapter 6 of the "<a href="index.html">Implementing a language
-with LLVM</a>" tutorial. At this point in our tutorial, we now have a fully
-functional language that is fairly minimal, but also useful. There
-is still one big problem with it, however. Our language doesn't have many
-useful operators (like division, logical negation, or even any comparisons
-besides less-than).</p>
-
-<p>This chapter of the tutorial takes a wild digression into adding user-defined
-operators to the simple and beautiful Kaleidoscope language. This digression now gives
-us a simple and ugly language in some ways, but also a powerful one at the same time.
-One of the great things about creating your own language is that you get to
-decide what is good or bad. In this tutorial we'll assume that it is okay to
-use this as a way to show some interesting parsing techniques.</p>
-
-<p>At the end of this tutorial, we'll run through an example Kaleidoscope
-application that <a href="#example">renders the Mandelbrot set</a>. This gives
-an example of what you can build with Kaleidoscope and its feature set.</p>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section"><a name="idea">User-defined Operators: the Idea</a></div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>
-The "operator overloading" that we will add to Kaleidoscope is more general than
-languages like C++. In C++, you are only allowed to redefine existing
-operators: you can't programatically change the grammar, introduce new
-operators, change precedence levels, etc. In this chapter, we will add this
-capability to Kaleidoscope, which will let the user round out the set of
-operators that are supported.</p>
-
-<p>The point of going into user-defined operators in a tutorial like this is to
-show the power and flexibility of using a hand-written parser. Thus far, the parser
-we have been implementing uses recursive descent for most parts of the grammar and
-operator precedence parsing for the expressions. See <a
-href="LangImpl2.html">Chapter 2</a> for details. Without using operator
-precedence parsing, it would be very difficult to allow the programmer to
-introduce new operators into the grammar: the grammar is dynamically extensible
-as the JIT runs.</p>
-
-<p>The two specific features we'll add are programmable unary operators (right
-now, Kaleidoscope has no unary operators at all) as well as binary operators.
-An example of this is:</p>
-
-<div class="doc_code">
-<pre>
-# Logical unary not.
-def unary!(v)
- if v then
- 0
- else
- 1;
-
-# Define &gt; with the same precedence as &lt;.
-def binary&gt; 10 (LHS RHS)
- RHS &lt; LHS;
-
-# Binary "logical or", (note that it does not "short circuit")
-def binary| 5 (LHS RHS)
- if LHS then
- 1
- else if RHS then
- 1
- else
- 0;
-
-# Define = with slightly lower precedence than relationals.
-def binary= 9 (LHS RHS)
- !(LHS &lt; RHS | LHS &gt; RHS);
-</pre>
-</div>
-
-<p>Many languages aspire to being able to implement their standard runtime
-library in the language itself. In Kaleidoscope, we can implement significant
-parts of the language in the library!</p>
-
-<p>We will break down implementation of these features into two parts:
-implementing support for user-defined binary operators and adding unary
-operators.</p>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section"><a name="binary">User-defined Binary Operators</a></div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>Adding support for user-defined binary operators is pretty simple with our
-current framework. We'll first add support for the unary/binary keywords:</p>
-
-<div class="doc_code">
-<pre>
-enum Token {
- ...
- <b>// operators
- tok_binary = -11, tok_unary = -12</b>
-};
-...
-static int gettok() {
-...
- if (IdentifierStr == "for") return tok_for;
- if (IdentifierStr == "in") return tok_in;
- <b>if (IdentifierStr == "binary") return tok_binary;
- if (IdentifierStr == "unary") return tok_unary;</b>
- return tok_identifier;
-</pre>
-</div>
-
-<p>This just adds lexer support for the unary and binary keywords, like we
-did in <a href="LangImpl5.html#iflexer">previous chapters</a>. One nice thing
-about our current AST, is that we represent binary operators with full generalisation
-by using their ASCII code as the opcode. For our extended operators, we'll use this
-same representation, so we don't need any new AST or parser support.</p>
-
-<p>On the other hand, we have to be able to represent the definitions of these
-new operators, in the "def binary| 5" part of the function definition. In our
-grammar so far, the "name" for the function definition is parsed as the
-"prototype" production and into the <tt>PrototypeAST</tt> AST node. To
-represent our new user-defined operators as prototypes, we have to extend
-the <tt>PrototypeAST</tt> AST node like this:</p>
-
-<div class="doc_code">
-<pre>
-/// PrototypeAST - This class represents the "prototype" for a function,
-/// which captures its argument names as well as if it is an operator.
-class PrototypeAST {
- std::string Name;
- std::vector&lt;std::string&gt; Args;
- <b>bool isOperator;
- unsigned Precedence; // Precedence if a binary op.</b>
-public:
- PrototypeAST(const std::string &amp;name, const std::vector&lt;std::string&gt; &amp;args,
- <b>bool isoperator = false, unsigned prec = 0</b>)
- : Name(name), Args(args), <b>isOperator(isoperator), Precedence(prec)</b> {}
-
- <b>bool isUnaryOp() const { return isOperator &amp;&amp; Args.size() == 1; }
- bool isBinaryOp() const { return isOperator &amp;&amp; Args.size() == 2; }
-
- char getOperatorName() const {
- assert(isUnaryOp() || isBinaryOp());
- return Name[Name.size()-1];
- }
-
- unsigned getBinaryPrecedence() const { return Precedence; }</b>
-
- Function *Codegen();
-};
-</pre>
-</div>
-
-<p>Basically, in addition to knowing a name for the prototype, we now keep track
-of whether it was an operator, and if it was, what precedence level the operator
-is at. The precedence is only used for binary operators (as you'll see below,
-it just doesn't apply for unary operators). Now that we have a way to represent
-the prototype for a user-defined operator, we need to parse it:</p>
-
-<div class="doc_code">
-<pre>
-/// prototype
-/// ::= id '(' id* ')'
-<b>/// ::= binary LETTER number? (id, id)</b>
-static PrototypeAST *ParsePrototype() {
- std::string FnName;
-
- <b>int Kind = 0; // 0 = identifier, 1 = unary, 2 = binary.
- unsigned BinaryPrecedence = 30;</b>
-
- switch (CurTok) {
- default:
- return ErrorP("Expected function name in prototype");
- case tok_identifier:
- FnName = IdentifierStr;
- Kind = 0;
- getNextToken();
- break;
- <b>case tok_binary:
- getNextToken();
- if (!isascii(CurTok))
- return ErrorP("Expected binary operator");
- FnName = "binary";
- FnName += (char)CurTok;
- Kind = 2;
- getNextToken();
-
- // Read the precedence if present.
- if (CurTok == tok_number) {
- if (NumVal &lt; 1 || NumVal &gt; 100)
- return ErrorP("Invalid precedecnce: must be 1..100");
- BinaryPrecedence = (unsigned)NumVal;
- getNextToken();
- }
- break;</b>
- }
-
- if (CurTok != '(')
- return ErrorP("Expected '(' in prototype");
-
- std::vector&lt;std::string&gt; ArgNames;
- while (getNextToken() == tok_identifier)
- ArgNames.push_back(IdentifierStr);
- if (CurTok != ')')
- return ErrorP("Expected ')' in prototype");
-
- // success.
- getNextToken(); // eat ')'.
-
- <b>// Verify right number of names for operator.
- if (Kind &amp;&amp; ArgNames.size() != Kind)
- return ErrorP("Invalid number of operands for operator");
-
- return new PrototypeAST(FnName, ArgNames, Kind != 0, BinaryPrecedence);</b>
-}
-</pre>
-</div>
-
-<p>This is all fairly straightforward parsing code, and we have already seen
-a lot of similar code in the past. One interesting part about the code above is
-the couple lines that set up <tt>FnName</tt> for binary operators. This builds names
-like "binary@" for a newly defined "@" operator. This then takes advantage of the
-fact that symbol names in the LLVM symbol table are allowed to have any character in
-them, including embedded nul characters.</p>
-
-<p>The next interesting thing to add, is codegen support for these binary operators.
-Given our current structure, this is a simple addition of a default case for our
-existing binary operator node:</p>
-
-<div class="doc_code">
-<pre>
-Value *BinaryExprAST::Codegen() {
- Value *L = LHS-&gt;Codegen();
- Value *R = RHS-&gt;Codegen();
- if (L == 0 || R == 0) return 0;
-
- switch (Op) {
- case '+': return Builder.CreateAdd(L, R, "addtmp");
- case '-': return Builder.CreateSub(L, R, "subtmp");
- case '*': return Builder.CreateMul(L, R, "multmp");
- case '&lt;':
- L = Builder.CreateFCmpULT(L, R, "cmptmp");
- // Convert bool 0/1 to double 0.0 or 1.0
- return Builder.CreateUIToFP(L, Type::DoubleTy, "booltmp");
- <b>default: break;</b>
- }
-
- <b>// If it wasn't a builtin binary operator, it must be a user defined one. Emit
- // a call to it.
- Function *F = TheModule-&gt;getFunction(std::string("binary")+Op);
- assert(F &amp;&amp; "binary operator not found!");
-
- Value *Ops[] = { L, R };
- return Builder.CreateCall(F, Ops, Ops+2, "binop");</b>
-}
-
-</pre>
-</div>
-
-<p>As you can see above, the new code is actually really simple. It just does
-a lookup for the appropriate operator in the symbol table and generates a
-function call to it. Since user-defined operators are just built as normal
-functions (because the "prototype" boils down to a function with the right
-name) everything falls into place.</p>
-
-<p>The final piece of code we are missing, is a bit of top level magic:</p>
-
-<div class="doc_code">
-<pre>
-Function *FunctionAST::Codegen() {
- NamedValues.clear();
-
- Function *TheFunction = Proto->Codegen();
- if (TheFunction == 0)
- return 0;
-
- <b>// If this is an operator, install it.
- if (Proto-&gt;isBinaryOp())
- BinopPrecedence[Proto->getOperatorName()] = Proto->getBinaryPrecedence();</b>
-
- // Create a new basic block to start insertion into.
- BasicBlock *BB = BasicBlock::Create("entry", TheFunction);
- Builder.SetInsertPoint(BB);
-
- if (Value *RetVal = Body-&gt;Codegen()) {
- ...
-</pre>
-</div>
-
-<p>Basically, before codegening a function, if it is a user-defined operator, we
-register it in the precedence table. This allows the binary operator parsing
-logic we already have in place to handle it. Since we are working on a fully-general operator precedence parser, this is all we need to do to "extend the grammar".</p>
-
-<p>Now we have useful user-defined binary operators. This builds a lot
-on the previous framework we built for other operators. Adding unary operators
-is a bit more challenging, because we don't have any framework for it yet - lets
-see what it takes.</p>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section"><a name="unary">User-defined Unary Operators</a></div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>Since we don't currently support unary operators in the Kaleidoscope
-language, we'll need to add everything to support them. Above, we added simple
-support for the 'unary' keyword to the lexer. In addition to that, we need an
-AST node:</p>
-
-<div class="doc_code">
-<pre>
-/// UnaryExprAST - Expression class for a unary operator.
-class UnaryExprAST : public ExprAST {
- char Opcode;
- ExprAST *Operand;
-public:
- UnaryExprAST(char opcode, ExprAST *operand)
- : Opcode(opcode), Operand(operand) {}
- virtual Value *Codegen();
-};
-</pre>
-</div>
-
-<p>This AST node is very simple and obvious by now. It directly mirrors the
-binary operator AST node, except that it only has one child. With this, we
-need to add the parsing logic. Parsing a unary operator is pretty simple: we'll
-add a new function to do it:</p>
-
-<div class="doc_code">
-<pre>
-/// unary
-/// ::= primary
-/// ::= '!' unary
-static ExprAST *ParseUnary() {
- // If the current token is not an operator, it must be a primary expr.
- if (!isascii(CurTok) || CurTok == '(' || CurTok == ',')
- return ParsePrimary();
-
- // If this is a unary operator, read it.
- int Opc = CurTok;
- getNextToken();
- if (ExprAST *Operand = ParseUnary())
- return new UnaryExprAST(Opc, Operand);
- return 0;
-}
-</pre>
-</div>
-
-<p>The grammar we add is pretty straightforward here. If we see a unary
-operator when parsing a primary operator, we eat the operator as a prefix and
-parse the remaining piece as another unary operator. This allows us to handle
-multiple unary operators (e.g. "!!x"). Note that unary operators can't have
-ambiguous parses like binary operators can, so there is no need for precedence
-information.</p>
-
-<p>The problem with this function, is that we need to call ParseUnary from somewhere.
-To do this, we change previous callers of ParsePrimary to call ParseUnary
-instead:</p>
-
-<div class="doc_code">
-<pre>
-/// binoprhs
-/// ::= ('+' unary)*
-static ExprAST *ParseBinOpRHS(int ExprPrec, ExprAST *LHS) {
- ...
- <b>// Parse the unary expression after the binary operator.
- ExprAST *RHS = ParseUnary();
- if (!RHS) return 0;</b>
- ...
-}
-/// expression
-/// ::= unary binoprhs
-///
-static ExprAST *ParseExpression() {
- <b>ExprAST *LHS = ParseUnary();</b>
- if (!LHS) return 0;
-
- return ParseBinOpRHS(0, LHS);
-}
-</pre>
-</div>
-
-<p>With these two simple changes, we are now able to parse unary operators and build the
-AST for them. Next up, we need to add parser support for prototypes, to parse
-the unary operator prototype. We extend the binary operator code above
-with:</p>
-
-<div class="doc_code">
-<pre>
-/// prototype
-/// ::= id '(' id* ')'
-/// ::= binary LETTER number? (id, id)
-<b>/// ::= unary LETTER (id)</b>
-static PrototypeAST *ParsePrototype() {
- std::string FnName;
-
- int Kind = 0; // 0 = identifier, 1 = unary, 2 = binary.
- unsigned BinaryPrecedence = 30;
-
- switch (CurTok) {
- default:
- return ErrorP("Expected function name in prototype");
- case tok_identifier:
- FnName = IdentifierStr;
- Kind = 0;
- getNextToken();
- break;
- <b>case tok_unary:
- getNextToken();
- if (!isascii(CurTok))
- return ErrorP("Expected unary operator");
- FnName = "unary";
- FnName += (char)CurTok;
- Kind = 1;
- getNextToken();
- break;</b>
- case tok_binary:
- ...
-</pre>
-</div>
-
-<p>As with binary operators, we name unary operators with a name that includes
-the operator character. This assists us at code generation time. Speaking of,
-the final piece we need to add is codegen support for unary operators. It looks
-like this:</p>
-
-<div class="doc_code">
-<pre>
-Value *UnaryExprAST::Codegen() {
- Value *OperandV = Operand->Codegen();
- if (OperandV == 0) return 0;
-
- Function *F = TheModule->getFunction(std::string("unary")+Opcode);
- if (F == 0)
- return ErrorV("Unknown unary operator");
-
- return Builder.CreateCall(F, OperandV, "unop");
-}
-</pre>
-</div>
-
-<p>This code is similar to, but simpler than, the code for binary operators. It
-is simpler primarily because it doesn't need to handle any predefined operators.
-</p>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section"><a name="example">Kicking the Tires</a></div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>It is somewhat hard to believe, but with a few simple extensions we've
-covered in the last chapters, we have grown a real-ish language. With this, we
-can do a lot of interesting things, including I/O, math, and a bunch of other
-things. For example, we can now add a nice sequencing operator (printd is
-defined to print out the specified value and a newline):</p>
-
-<div class="doc_code">
-<pre>
-ready&gt; <b>extern printd(x);</b>
-Read extern: declare double @printd(double)
-ready&gt; <b>def binary : 1 (x y) 0; # Low-precedence operator that ignores operands.</b>
-..
-ready&gt; <b>printd(123) : printd(456) : printd(789);</b>
-123.000000
-456.000000
-789.000000
-Evaluated to 0.000000
-</pre>
-</div>
-
-<p>We can also define a bunch of other "primitive" operations, such as:</p>
-
-<div class="doc_code">
-<pre>
-# Logical unary not.
-def unary!(v)
- if v then
- 0
- else
- 1;
-
-# Unary negate.
-def unary-(v)
- 0-v;
-
-# Define &gt; with the same precedence as &gt;.
-def binary&gt; 10 (LHS RHS)
- RHS &lt; LHS;
-
-# Binary logical or, which does not short circuit.
-def binary| 5 (LHS RHS)
- if LHS then
- 1
- else if RHS then
- 1
- else
- 0;
-
-# Binary logical and, which does not short circuit.
-def binary&amp; 6 (LHS RHS)
- if !LHS then
- 0
- else
- !!RHS;
-
-# Define = with slightly lower precedence than relationals.
-def binary = 9 (LHS RHS)
- !(LHS &lt; RHS | LHS &gt; RHS);
-
-</pre>
-</div>
-
-
-<p>Given the previous if/then/else support, we can also define interesting
-functions for I/O. For example, the following prints out a character whose
-"density" reflects the value passed in: the lower the value, the denser the
-character:</p>
-
-<div class="doc_code">
-<pre>
-ready&gt;
-<b>
-extern putchard(char)
-def printdensity(d)
- if d &gt; 8 then
- putchard(32) # ' '
- else if d &gt; 4 then
- putchard(46) # '.'
- else if d &gt; 2 then
- putchard(43) # '+'
- else
- putchard(42); # '*'</b>
-...
-ready&gt; <b>printdensity(1): printdensity(2): printdensity(3) :
- printdensity(4): printdensity(5): printdensity(9): putchard(10);</b>
-*++..
-Evaluated to 0.000000
-</pre>
-</div>
-
-<p>Based on these simple primitive operations, we can start to define more
-interesting things. For example, here's a little function that solves for the
-number of iterations it takes a function in the complex plane to
-converge:</p>
-
-<div class="doc_code">
-<pre>
-# determine whether the specific location diverges.
-# Solve for z = z^2 + c in the complex plane.
-def mandleconverger(real imag iters creal cimag)
- if iters &gt; 255 | (real*real + imag*imag &gt; 4) then
- iters
- else
- mandleconverger(real*real - imag*imag + creal,
- 2*real*imag + cimag,
- iters+1, creal, cimag);
-
-# return the number of iterations required for the iteration to escape
-def mandleconverge(real imag)
- mandleconverger(real, imag, 0, real, imag);
-</pre>
-</div>
-
-<p>This "z = z<sup>2</sup> + c" function is a beautiful little creature that is the basis
-for computation of the <a
-href="http://en.wikipedia.org/wiki/Mandelbrot_set">Mandelbrot Set</a>. Our
-<tt>mandelconverge</tt> function returns the number of iterations that it takes
-for a complex orbit to escape, saturating to 255. This is not a very useful
-function by itself, but if you plot its value over a two-dimensional plane,
-you can see the Mandelbrot set. Given that we are limited to using putchard
-here, our amazing graphical output is limited, but we can whip together
-something using the density plotter above:</p>
-
-<div class="doc_code">
-<pre>
-# compute and plot the mandlebrot set with the specified 2 dimensional range
-# info.
-def mandelhelp(xmin xmax xstep ymin ymax ystep)
- for y = ymin, y &lt; ymax, ystep in (
- (for x = xmin, x &lt; xmax, xstep in
- printdensity(mandleconverge(x,y)))
- : putchard(10)
- )
-
-# mandel - This is a convenient helper function for ploting the mandelbrot set
-# from the specified position with the specified Magnification.
-def mandel(realstart imagstart realmag imagmag)
- mandelhelp(realstart, realstart+realmag*78, realmag,
- imagstart, imagstart+imagmag*40, imagmag);
-</pre>
-</div>
-
-<p>Given this, we can try plotting out the mandlebrot set! Lets try it out:</p>
-
-<div class="doc_code">
-<pre>
-ready&gt; <b>mandel(-2.3, -1.3, 0.05, 0.07);</b>
-*******************************+++++++++++*************************************
-*************************+++++++++++++++++++++++*******************************
-**********************+++++++++++++++++++++++++++++****************************
-*******************+++++++++++++++++++++.. ...++++++++*************************
-*****************++++++++++++++++++++++.... ...+++++++++***********************
-***************+++++++++++++++++++++++..... ...+++++++++*********************
-**************+++++++++++++++++++++++.... ....+++++++++********************
-*************++++++++++++++++++++++...... .....++++++++*******************
-************+++++++++++++++++++++....... .......+++++++******************
-***********+++++++++++++++++++.... ... .+++++++*****************
-**********+++++++++++++++++....... .+++++++****************
-*********++++++++++++++........... ...+++++++***************
-********++++++++++++............ ...++++++++**************
-********++++++++++... .......... .++++++++**************
-*******+++++++++..... .+++++++++*************
-*******++++++++...... ..+++++++++*************
-*******++++++....... ..+++++++++*************
-*******+++++...... ..+++++++++*************
-*******.... .... ...+++++++++*************
-*******.... . ...+++++++++*************
-*******+++++...... ...+++++++++*************
-*******++++++....... ..+++++++++*************
-*******++++++++...... .+++++++++*************
-*******+++++++++..... ..+++++++++*************
-********++++++++++... .......... .++++++++**************
-********++++++++++++............ ...++++++++**************
-*********++++++++++++++.......... ...+++++++***************
-**********++++++++++++++++........ .+++++++****************
-**********++++++++++++++++++++.... ... ..+++++++****************
-***********++++++++++++++++++++++....... .......++++++++*****************
-************+++++++++++++++++++++++...... ......++++++++******************
-**************+++++++++++++++++++++++.... ....++++++++********************
-***************+++++++++++++++++++++++..... ...+++++++++*********************
-*****************++++++++++++++++++++++.... ...++++++++***********************
-*******************+++++++++++++++++++++......++++++++*************************
-*********************++++++++++++++++++++++.++++++++***************************
-*************************+++++++++++++++++++++++*******************************
-******************************+++++++++++++************************************
-*******************************************************************************
-*******************************************************************************
-*******************************************************************************
-Evaluated to 0.000000
-ready&gt; <b>mandel(-2, -1, 0.02, 0.04);</b>
-**************************+++++++++++++++++++++++++++++++++++++++++++++++++++++
-***********************++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-*********************+++++++++++++++++++++++++++++++++++++++++++++++++++++++++.
-*******************+++++++++++++++++++++++++++++++++++++++++++++++++++++++++...
-*****************+++++++++++++++++++++++++++++++++++++++++++++++++++++++++.....
-***************++++++++++++++++++++++++++++++++++++++++++++++++++++++++........
-**************++++++++++++++++++++++++++++++++++++++++++++++++++++++...........
-************+++++++++++++++++++++++++++++++++++++++++++++++++++++..............
-***********++++++++++++++++++++++++++++++++++++++++++++++++++........ .
-**********++++++++++++++++++++++++++++++++++++++++++++++.............
-********+++++++++++++++++++++++++++++++++++++++++++..................
-*******+++++++++++++++++++++++++++++++++++++++.......................
-******+++++++++++++++++++++++++++++++++++...........................
-*****++++++++++++++++++++++++++++++++............................
-*****++++++++++++++++++++++++++++...............................
-****++++++++++++++++++++++++++...... .........................
-***++++++++++++++++++++++++......... ...... ...........
-***++++++++++++++++++++++............
-**+++++++++++++++++++++..............
-**+++++++++++++++++++................
-*++++++++++++++++++.................
-*++++++++++++++++............ ...
-*++++++++++++++..............
-*+++....++++................
-*.......... ...........
-*
-*.......... ...........
-*+++....++++................
-*++++++++++++++..............
-*++++++++++++++++............ ...
-*++++++++++++++++++.................
-**+++++++++++++++++++................
-**+++++++++++++++++++++..............
-***++++++++++++++++++++++............
-***++++++++++++++++++++++++......... ...... ...........
-****++++++++++++++++++++++++++...... .........................
-*****++++++++++++++++++++++++++++...............................
-*****++++++++++++++++++++++++++++++++............................
-******+++++++++++++++++++++++++++++++++++...........................
-*******+++++++++++++++++++++++++++++++++++++++.......................
-********+++++++++++++++++++++++++++++++++++++++++++..................
-Evaluated to 0.000000
-ready&gt; <b>mandel(-0.9, -1.4, 0.02, 0.03);</b>
-*******************************************************************************
-*******************************************************************************
-*******************************************************************************
-**********+++++++++++++++++++++************************************************
-*+++++++++++++++++++++++++++++++++++++++***************************************
-+++++++++++++++++++++++++++++++++++++++++++++**********************************
-++++++++++++++++++++++++++++++++++++++++++++++++++*****************************
-++++++++++++++++++++++++++++++++++++++++++++++++++++++*************************
-+++++++++++++++++++++++++++++++++++++++++++++++++++++++++**********************
-+++++++++++++++++++++++++++++++++.........++++++++++++++++++*******************
-+++++++++++++++++++++++++++++++.... ......+++++++++++++++++++****************
-+++++++++++++++++++++++++++++....... ........+++++++++++++++++++**************
-++++++++++++++++++++++++++++........ ........++++++++++++++++++++************
-+++++++++++++++++++++++++++......... .. ...+++++++++++++++++++++**********
-++++++++++++++++++++++++++........... ....++++++++++++++++++++++********
-++++++++++++++++++++++++............. .......++++++++++++++++++++++******
-+++++++++++++++++++++++............. ........+++++++++++++++++++++++****
-++++++++++++++++++++++........... ..........++++++++++++++++++++++***
-++++++++++++++++++++........... .........++++++++++++++++++++++*
-++++++++++++++++++............ ...........++++++++++++++++++++
-++++++++++++++++............... .............++++++++++++++++++
-++++++++++++++................. ...............++++++++++++++++
-++++++++++++.................. .................++++++++++++++
-+++++++++.................. .................+++++++++++++
-++++++........ . ......... ..++++++++++++
-++............ ...... ....++++++++++
-.............. ...++++++++++
-.............. ....+++++++++
-.............. .....++++++++
-............. ......++++++++
-........... .......++++++++
-......... ........+++++++
-......... ........+++++++
-......... ....+++++++
-........ ...+++++++
-....... ...+++++++
- ....+++++++
- .....+++++++
- ....+++++++
- ....+++++++
- ....+++++++
-Evaluated to 0.000000
-ready&gt; <b>^D</b>
-</pre>
-</div>
-
-<p>At this point, you may be starting to realize that Kaleidoscope is a real
-and powerful language. It may not be self-similar :), but it can be used to
-plot things that are!</p>
-
-<p>With this, we conclude the "adding user-defined operators" chapter of the
-tutorial. We have successfully augmented our language, adding the ability to extend the
-language in the library, and we have shown how this can be used to build a simple but
-interesting end-user application in Kaleidoscope. At this point, Kaleidoscope
-can build a variety of applications that are functional and can call functions
-with side-effects, but it can't actually define and mutate a variable itself.
-</p>
-
-<p>Strikingly, variable mutation is an important feature of some
-languages, and it is not at all obvious how to <a href="LangImpl7.html">add
-support for mutable variables</a> without having to add an "SSA construction"
-phase to your front-end. In the next chapter, we will describe how you can
-add variable mutation without building SSA in your front-end.</p>
-
-</div>
-
-
-<!-- *********************************************************************** -->
-<div class="doc_section"><a name="code">Full Code Listing</a></div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>
-Here is the complete code listing for our running example, enhanced with the
-if/then/else and for expressions.. To build this example, use:
-</p>
-
-<div class="doc_code">
-<pre>
- # Compile
- g++ -g toy.cpp `llvm-config --cppflags --ldflags --libs core jit native` -O3 -o toy
- # Run
- ./toy
-</pre>
-</div>
-
-<p>Here is the code:</p>
-
-<div class="doc_code">
-<pre>
-#include "llvm/DerivedTypes.h"
-#include "llvm/ExecutionEngine/ExecutionEngine.h"
-#include "llvm/Module.h"
-#include "llvm/ModuleProvider.h"
-#include "llvm/PassManager.h"
-#include "llvm/Analysis/Verifier.h"
-#include "llvm/Target/TargetData.h"
-#include "llvm/Transforms/Scalar.h"
-#include "llvm/Support/IRBuilder.h"
-#include &lt;cstdio&gt;
-#include &lt;string&gt;
-#include &lt;map&gt;
-#include &lt;vector&gt;
-using namespace llvm;
-
-//===----------------------------------------------------------------------===//
-// Lexer
-//===----------------------------------------------------------------------===//
-
-// The lexer returns tokens [0-255] if it is an unknown character, otherwise one
-// of these for known things.
-enum Token {
- tok_eof = -1,
-
- // commands
- tok_def = -2, tok_extern = -3,
-
- // primary
- tok_identifier = -4, tok_number = -5,
-
- // control
- tok_if = -6, tok_then = -7, tok_else = -8,
- tok_for = -9, tok_in = -10,
-
- // operators
- tok_binary = -11, tok_unary = -12
-};
-
-static std::string IdentifierStr; // Filled in if tok_identifier
-static double NumVal; // Filled in if tok_number
-
-/// gettok - Return the next token from standard input.
-static int gettok() {
- static int LastChar = ' ';
-
- // Skip any whitespace.
- while (isspace(LastChar))
- LastChar = getchar();
-
- if (isalpha(LastChar)) { // identifier: [a-zA-Z][a-zA-Z0-9]*
- IdentifierStr = LastChar;
- while (isalnum((LastChar = getchar())))
- IdentifierStr += LastChar;
-
- if (IdentifierStr == "def") return tok_def;
- if (IdentifierStr == "extern") return tok_extern;
- if (IdentifierStr == "if") return tok_if;
- if (IdentifierStr == "then") return tok_then;
- if (IdentifierStr == "else") return tok_else;
- if (IdentifierStr == "for") return tok_for;
- if (IdentifierStr == "in") return tok_in;
- if (IdentifierStr == "binary") return tok_binary;
- if (IdentifierStr == "unary") return tok_unary;
- return tok_identifier;
- }
-
- if (isdigit(LastChar) || LastChar == '.') { // Number: [0-9.]+
- std::string NumStr;
- do {
- NumStr += LastChar;
- LastChar = getchar();
- } while (isdigit(LastChar) || LastChar == '.');
-
- NumVal = strtod(NumStr.c_str(), 0);
- return tok_number;
- }
-
- if (LastChar == '#') {
- // Comment until end of line.
- do LastChar = getchar();
- while (LastChar != EOF &amp;&amp; LastChar != '\n' &amp;&amp; LastChar != '\r');
-
- if (LastChar != EOF)
- return gettok();
- }
-
- // Check for end of file. Don't eat the EOF.
- if (LastChar == EOF)
- return tok_eof;
-
- // Otherwise, just return the character as its ascii value.
- int ThisChar = LastChar;
- LastChar = getchar();
- return ThisChar;
-}
-
-//===----------------------------------------------------------------------===//
-// Abstract Syntax Tree (aka Parse Tree)
-//===----------------------------------------------------------------------===//
-
-/// ExprAST - Base class for all expression nodes.
-class ExprAST {
-public:
- virtual ~ExprAST() {}
- virtual Value *Codegen() = 0;
-};
-
-/// NumberExprAST - Expression class for numeric literals like "1.0".
-class NumberExprAST : public ExprAST {
- double Val;
-public:
- NumberExprAST(double val) : Val(val) {}
- virtual Value *Codegen();
-};
-
-/// VariableExprAST - Expression class for referencing a variable, like "a".
-class VariableExprAST : public ExprAST {
- std::string Name;
-public:
- VariableExprAST(const std::string &amp;name) : Name(name) {}
- virtual Value *Codegen();
-};
-
-/// UnaryExprAST - Expression class for a unary operator.
-class UnaryExprAST : public ExprAST {
- char Opcode;
- ExprAST *Operand;
-public:
- UnaryExprAST(char opcode, ExprAST *operand)
- : Opcode(opcode), Operand(operand) {}
- virtual Value *Codegen();
-};
-
-/// BinaryExprAST - Expression class for a binary operator.
-class BinaryExprAST : public ExprAST {
- char Op;
- ExprAST *LHS, *RHS;
-public:
- BinaryExprAST(char op, ExprAST *lhs, ExprAST *rhs)
- : Op(op), LHS(lhs), RHS(rhs) {}
- virtual Value *Codegen();
-};
-
-/// CallExprAST - Expression class for function calls.
-class CallExprAST : public ExprAST {
- std::string Callee;
- std::vector&lt;ExprAST*&gt; Args;
-public:
- CallExprAST(const std::string &amp;callee, std::vector&lt;ExprAST*&gt; &amp;args)
- : Callee(callee), Args(args) {}
- virtual Value *Codegen();
-};
-
-/// IfExprAST - Expression class for if/then/else.
-class IfExprAST : public ExprAST {
- ExprAST *Cond, *Then, *Else;
-public:
- IfExprAST(ExprAST *cond, ExprAST *then, ExprAST *_else)
- : Cond(cond), Then(then), Else(_else) {}
- virtual Value *Codegen();
-};
-
-/// ForExprAST - Expression class for for/in.
-class ForExprAST : public ExprAST {
- std::string VarName;
- ExprAST *Start, *End, *Step, *Body;
-public:
- ForExprAST(const std::string &amp;varname, ExprAST *start, ExprAST *end,
- ExprAST *step, ExprAST *body)
- : VarName(varname), Start(start), End(end), Step(step), Body(body) {}
- virtual Value *Codegen();
-};
-
-/// PrototypeAST - This class represents the "prototype" for a function,
-/// which captures its argument names as well as if it is an operator.
-class PrototypeAST {
- std::string Name;
- std::vector&lt;std::string&gt; Args;
- bool isOperator;
- unsigned Precedence; // Precedence if a binary op.
-public:
- PrototypeAST(const std::string &amp;name, const std::vector&lt;std::string&gt; &amp;args,
- bool isoperator = false, unsigned prec = 0)
- : Name(name), Args(args), isOperator(isoperator), Precedence(prec) {}
-
- bool isUnaryOp() const { return isOperator &amp;&amp; Args.size() == 1; }
- bool isBinaryOp() const { return isOperator &amp;&amp; Args.size() == 2; }
-
- char getOperatorName() const {
- assert(isUnaryOp() || isBinaryOp());
- return Name[Name.size()-1];
- }
-
- unsigned getBinaryPrecedence() const { return Precedence; }
-
- Function *Codegen();
-};
-
-/// FunctionAST - This class represents a function definition itself.
-class FunctionAST {
- PrototypeAST *Proto;
- ExprAST *Body;
-public:
- FunctionAST(PrototypeAST *proto, ExprAST *body)
- : Proto(proto), Body(body) {}
-
- Function *Codegen();
-};
-
-//===----------------------------------------------------------------------===//
-// Parser
-//===----------------------------------------------------------------------===//
-
-/// CurTok/getNextToken - Provide a simple token buffer. CurTok is the current
-/// token the parser it looking at. getNextToken reads another token from the
-/// lexer and updates CurTok with its results.
-static int CurTok;
-static int getNextToken() {
- return CurTok = gettok();
-}
-
-/// BinopPrecedence - This holds the precedence for each binary operator that is
-/// defined.
-static std::map&lt;char, int&gt; BinopPrecedence;
-
-/// GetTokPrecedence - Get the precedence of the pending binary operator token.
-static int GetTokPrecedence() {
- if (!isascii(CurTok))
- return -1;
-
- // Make sure it's a declared binop.
- int TokPrec = BinopPrecedence[CurTok];
- if (TokPrec &lt;= 0) return -1;
- return TokPrec;
-}
-
-/// Error* - These are little helper functions for error handling.
-ExprAST *Error(const char *Str) { fprintf(stderr, "Error: %s\n", Str);return 0;}
-PrototypeAST *ErrorP(const char *Str) { Error(Str); return 0; }
-FunctionAST *ErrorF(const char *Str) { Error(Str); return 0; }
-
-static ExprAST *ParseExpression();
-
-/// identifierexpr
-/// ::= identifier
-/// ::= identifier '(' expression* ')'
-static ExprAST *ParseIdentifierExpr() {
- std::string IdName = IdentifierStr;
-
- getNextToken(); // eat identifier.
-
- if (CurTok != '(') // Simple variable ref.
- return new VariableExprAST(IdName);
-
- // Call.
- getNextToken(); // eat (
- std::vector&lt;ExprAST*&gt; Args;
- if (CurTok != ')') {
- while (1) {
- ExprAST *Arg = ParseExpression();
- if (!Arg) return 0;
- Args.push_back(Arg);
-
- if (CurTok == ')') break;
-
- if (CurTok != ',')
- return Error("Expected ')' or ',' in argument list");
- getNextToken();
- }
- }
-
- // Eat the ')'.
- getNextToken();
-
- return new CallExprAST(IdName, Args);
-}
-
-/// numberexpr ::= number
-static ExprAST *ParseNumberExpr() {
- ExprAST *Result = new NumberExprAST(NumVal);
- getNextToken(); // consume the number
- return Result;
-}
-
-/// parenexpr ::= '(' expression ')'
-static ExprAST *ParseParenExpr() {
- getNextToken(); // eat (.
- ExprAST *V = ParseExpression();
- if (!V) return 0;
-
- if (CurTok != ')')
- return Error("expected ')'");
- getNextToken(); // eat ).
- return V;
-}
-
-/// ifexpr ::= 'if' expression 'then' expression 'else' expression
-static ExprAST *ParseIfExpr() {
- getNextToken(); // eat the if.
-
- // condition.
- ExprAST *Cond = ParseExpression();
- if (!Cond) return 0;
-
- if (CurTok != tok_then)
- return Error("expected then");
- getNextToken(); // eat the then
-
- ExprAST *Then = ParseExpression();
- if (Then == 0) return 0;
-
- if (CurTok != tok_else)
- return Error("expected else");
-
- getNextToken();
-
- ExprAST *Else = ParseExpression();
- if (!Else) return 0;
-
- return new IfExprAST(Cond, Then, Else);
-}
-
-/// forexpr ::= 'for' identifier '=' expr ',' expr (',' expr)? 'in' expression
-static ExprAST *ParseForExpr() {
- getNextToken(); // eat the for.
-
- if (CurTok != tok_identifier)
- return Error("expected identifier after for");
-
- std::string IdName = IdentifierStr;
- getNextToken(); // eat identifier.
-
- if (CurTok != '=')
- return Error("expected '=' after for");
- getNextToken(); // eat '='.
-
-
- ExprAST *Start = ParseExpression();
- if (Start == 0) return 0;
- if (CurTok != ',')
- return Error("expected ',' after for start value");
- getNextToken();
-
- ExprAST *End = ParseExpression();
- if (End == 0) return 0;
-
- // The step value is optional.
- ExprAST *Step = 0;
- if (CurTok == ',') {
- getNextToken();
- Step = ParseExpression();
- if (Step == 0) return 0;
- }
-
- if (CurTok != tok_in)
- return Error("expected 'in' after for");
- getNextToken(); // eat 'in'.
-
- ExprAST *Body = ParseExpression();
- if (Body == 0) return 0;
-
- return new ForExprAST(IdName, Start, End, Step, Body);
-}
-
-
-/// primary
-/// ::= identifierexpr
-/// ::= numberexpr
-/// ::= parenexpr
-/// ::= ifexpr
-/// ::= forexpr
-static ExprAST *ParsePrimary() {
- switch (CurTok) {
- default: return Error("unknown token when expecting an expression");
- case tok_identifier: return ParseIdentifierExpr();
- case tok_number: return ParseNumberExpr();
- case '(': return ParseParenExpr();
- case tok_if: return ParseIfExpr();
- case tok_for: return ParseForExpr();
- }
-}
-
-/// unary
-/// ::= primary
-/// ::= '!' unary
-static ExprAST *ParseUnary() {
- // If the current token is not an operator, it must be a primary expr.
- if (!isascii(CurTok) || CurTok == '(' || CurTok == ',')
- return ParsePrimary();
-
- // If this is a unary operator, read it.
- int Opc = CurTok;
- getNextToken();
- if (ExprAST *Operand = ParseUnary())
- return new UnaryExprAST(Opc, Operand);
- return 0;
-}
-
-/// binoprhs
-/// ::= ('+' unary)*
-static ExprAST *ParseBinOpRHS(int ExprPrec, ExprAST *LHS) {
- // If this is a binop, find its precedence.
- while (1) {
- int TokPrec = GetTokPrecedence();
-
- // If this is a binop that binds at least as tightly as the current binop,
- // consume it, otherwise we are done.
- if (TokPrec &lt; ExprPrec)
- return LHS;
-
- // Okay, we know this is a binop.
- int BinOp = CurTok;
- getNextToken(); // eat binop
-
- // Parse the unary expression after the binary operator.
- ExprAST *RHS = ParseUnary();
- if (!RHS) return 0;
-
- // If BinOp binds less tightly with RHS than the operator after RHS, let
- // the pending operator take RHS as its LHS.
- int NextPrec = GetTokPrecedence();
- if (TokPrec &lt; NextPrec) {
- RHS = ParseBinOpRHS(TokPrec+1, RHS);
- if (RHS == 0) return 0;
- }
-
- // Merge LHS/RHS.
- LHS = new BinaryExprAST(BinOp, LHS, RHS);
- }
-}
-
-/// expression
-/// ::= unary binoprhs
-///
-static ExprAST *ParseExpression() {
- ExprAST *LHS = ParseUnary();
- if (!LHS) return 0;
-
- return ParseBinOpRHS(0, LHS);
-}
-
-/// prototype
-/// ::= id '(' id* ')'
-/// ::= binary LETTER number? (id, id)
-/// ::= unary LETTER (id)
-static PrototypeAST *ParsePrototype() {
- std::string FnName;
-
- int Kind = 0; // 0 = identifier, 1 = unary, 2 = binary.
- unsigned BinaryPrecedence = 30;
-
- switch (CurTok) {
- default:
- return ErrorP("Expected function name in prototype");
- case tok_identifier:
- FnName = IdentifierStr;
- Kind = 0;
- getNextToken();
- break;
- case tok_unary:
- getNextToken();
- if (!isascii(CurTok))
- return ErrorP("Expected unary operator");
- FnName = "unary";
- FnName += (char)CurTok;
- Kind = 1;
- getNextToken();
- break;
- case tok_binary:
- getNextToken();
- if (!isascii(CurTok))
- return ErrorP("Expected binary operator");
- FnName = "binary";
- FnName += (char)CurTok;
- Kind = 2;
- getNextToken();
-
- // Read the precedence if present.
- if (CurTok == tok_number) {
- if (NumVal &lt; 1 || NumVal &gt; 100)
- return ErrorP("Invalid precedecnce: must be 1..100");
- BinaryPrecedence = (unsigned)NumVal;
- getNextToken();
- }
- break;
- }
-
- if (CurTok != '(')
- return ErrorP("Expected '(' in prototype");
-
- std::vector&lt;std::string&gt; ArgNames;
- while (getNextToken() == tok_identifier)
- ArgNames.push_back(IdentifierStr);
- if (CurTok != ')')
- return ErrorP("Expected ')' in prototype");
-
- // success.
- getNextToken(); // eat ')'.
-
- // Verify right number of names for operator.
- if (Kind &amp;&amp; ArgNames.size() != Kind)
- return ErrorP("Invalid number of operands for operator");
-
- return new PrototypeAST(FnName, ArgNames, Kind != 0, BinaryPrecedence);
-}
-
-/// definition ::= 'def' prototype expression
-static FunctionAST *ParseDefinition() {
- getNextToken(); // eat def.
- PrototypeAST *Proto = ParsePrototype();
- if (Proto == 0) return 0;
-
- if (ExprAST *E = ParseExpression())
- return new FunctionAST(Proto, E);
- return 0;
-}
-
-/// toplevelexpr ::= expression
-static FunctionAST *ParseTopLevelExpr() {
- if (ExprAST *E = ParseExpression()) {
- // Make an anonymous proto.
- PrototypeAST *Proto = new PrototypeAST("", std::vector&lt;std::string&gt;());
- return new FunctionAST(Proto, E);
- }
- return 0;
-}
-
-/// external ::= 'extern' prototype
-static PrototypeAST *ParseExtern() {
- getNextToken(); // eat extern.
- return ParsePrototype();
-}
-
-//===----------------------------------------------------------------------===//
-// Code Generation
-//===----------------------------------------------------------------------===//
-
-static Module *TheModule;
-static IRBuilder Builder;
-static std::map&lt;std::string, Value*&gt; NamedValues;
-static FunctionPassManager *TheFPM;
-
-Value *ErrorV(const char *Str) { Error(Str); return 0; }
-
-Value *NumberExprAST::Codegen() {
- return ConstantFP::get(Type::DoubleTy, APFloat(Val));
-}
-
-Value *VariableExprAST::Codegen() {
- // Look this variable up in the function.
- Value *V = NamedValues[Name];
- return V ? V : ErrorV("Unknown variable name");
-}
-
-Value *UnaryExprAST::Codegen() {
- Value *OperandV = Operand-&gt;Codegen();
- if (OperandV == 0) return 0;
-
- Function *F = TheModule-&gt;getFunction(std::string("unary")+Opcode);
- if (F == 0)
- return ErrorV("Unknown unary operator");
-
- return Builder.CreateCall(F, OperandV, "unop");
-}
-
-
-Value *BinaryExprAST::Codegen() {
- Value *L = LHS-&gt;Codegen();
- Value *R = RHS-&gt;Codegen();
- if (L == 0 || R == 0) return 0;
-
- switch (Op) {
- case '+': return Builder.CreateAdd(L, R, "addtmp");
- case '-': return Builder.CreateSub(L, R, "subtmp");
- case '*': return Builder.CreateMul(L, R, "multmp");
- case '&lt;':
- L = Builder.CreateFCmpULT(L, R, "cmptmp");
- // Convert bool 0/1 to double 0.0 or 1.0
- return Builder.CreateUIToFP(L, Type::DoubleTy, "booltmp");
- default: break;
- }
-
- // If it wasn't a builtin binary operator, it must be a user defined one. Emit
- // a call to it.
- Function *F = TheModule-&gt;getFunction(std::string("binary")+Op);
- assert(F &amp;&amp; "binary operator not found!");
-
- Value *Ops[] = { L, R };
- return Builder.CreateCall(F, Ops, Ops+2, "binop");
-}
-
-Value *CallExprAST::Codegen() {
- // Look up the name in the global module table.
- Function *CalleeF = TheModule-&gt;getFunction(Callee);
- if (CalleeF == 0)
- return ErrorV("Unknown function referenced");
-
- // If argument mismatch error.
- if (CalleeF-&gt;arg_size() != Args.size())
- return ErrorV("Incorrect # arguments passed");
-
- std::vector&lt;Value*&gt; ArgsV;
- for (unsigned i = 0, e = Args.size(); i != e; ++i) {
- ArgsV.push_back(Args[i]-&gt;Codegen());
- if (ArgsV.back() == 0) return 0;
- }
-
- return Builder.CreateCall(CalleeF, ArgsV.begin(), ArgsV.end(), "calltmp");
-}
-
-Value *IfExprAST::Codegen() {
- Value *CondV = Cond-&gt;Codegen();
- if (CondV == 0) return 0;
-
- // Convert condition to a bool by comparing equal to 0.0.
- CondV = Builder.CreateFCmpONE(CondV,
- ConstantFP::get(Type::DoubleTy, APFloat(0.0)),
- "ifcond");
-
- Function *TheFunction = Builder.GetInsertBlock()-&gt;getParent();
-
- // Create blocks for the then and else cases. Insert the 'then' block at the
- // end of the function.
- BasicBlock *ThenBB = BasicBlock::Create("then", TheFunction);
- BasicBlock *ElseBB = BasicBlock::Create("else");
- BasicBlock *MergeBB = BasicBlock::Create("ifcont");
-
- Builder.CreateCondBr(CondV, ThenBB, ElseBB);
-
- // Emit then value.
- Builder.SetInsertPoint(ThenBB);
-
- Value *ThenV = Then-&gt;Codegen();
- if (ThenV == 0) return 0;
-
- Builder.CreateBr(MergeBB);
- // Codegen of 'Then' can change the current block, update ThenBB for the PHI.
- ThenBB = Builder.GetInsertBlock();
-
- // Emit else block.
- TheFunction-&gt;getBasicBlockList().push_back(ElseBB);
- Builder.SetInsertPoint(ElseBB);
-
- Value *ElseV = Else-&gt;Codegen();
- if (ElseV == 0) return 0;
-
- Builder.CreateBr(MergeBB);
- // Codegen of 'Else' can change the current block, update ElseBB for the PHI.
- ElseBB = Builder.GetInsertBlock();
-
- // Emit merge block.
- TheFunction-&gt;getBasicBlockList().push_back(MergeBB);
- Builder.SetInsertPoint(MergeBB);
- PHINode *PN = Builder.CreatePHI(Type::DoubleTy, "iftmp");
-
- PN-&gt;addIncoming(ThenV, ThenBB);
- PN-&gt;addIncoming(ElseV, ElseBB);
- return PN;
-}
-
-Value *ForExprAST::Codegen() {
- // Output this as:
- // ...
- // start = startexpr
- // goto loop
- // loop:
- // variable = phi [start, loopheader], [nextvariable, loopend]
- // ...
- // bodyexpr
- // ...
- // loopend:
- // step = stepexpr
- // nextvariable = variable + step
- // endcond = endexpr
- // br endcond, loop, endloop
- // outloop:
-
- // Emit the start code first, without 'variable' in scope.
- Value *StartVal = Start-&gt;Codegen();
- if (StartVal == 0) return 0;
-
- // Make the new basic block for the loop header, inserting after current
- // block.
- Function *TheFunction = Builder.GetInsertBlock()-&gt;getParent();
- BasicBlock *PreheaderBB = Builder.GetInsertBlock();
- BasicBlock *LoopBB = BasicBlock::Create("loop", TheFunction);
-
- // Insert an explicit fall through from the current block to the LoopBB.
- Builder.CreateBr(LoopBB);
-
- // Start insertion in LoopBB.
- Builder.SetInsertPoint(LoopBB);
-
- // Start the PHI node with an entry for Start.
- PHINode *Variable = Builder.CreatePHI(Type::DoubleTy, VarName.c_str());
- Variable-&gt;addIncoming(StartVal, PreheaderBB);
-
- // Within the loop, the variable is defined equal to the PHI node. If it
- // shadows an existing variable, we have to restore it, so save it now.
- Value *OldVal = NamedValues[VarName];
- NamedValues[VarName] = Variable;
-
- // Emit the body of the loop. This, like any other expr, can change the
- // current BB. Note that we ignore the value computed by the body, but don't
- // allow an error.
- if (Body-&gt;Codegen() == 0)
- return 0;
-
- // Emit the step value.
- Value *StepVal;
- if (Step) {
- StepVal = Step-&gt;Codegen();
- if (StepVal == 0) return 0;
- } else {
- // If not specified, use 1.0.
- StepVal = ConstantFP::get(Type::DoubleTy, APFloat(1.0));
- }
-
- Value *NextVar = Builder.CreateAdd(Variable, StepVal, "nextvar");
-
- // Compute the end condition.
- Value *EndCond = End-&gt;Codegen();
- if (EndCond == 0) return EndCond;
-
- // Convert condition to a bool by comparing equal to 0.0.
- EndCond = Builder.CreateFCmpONE(EndCond,
- ConstantFP::get(Type::DoubleTy, APFloat(0.0)),
- "loopcond");
-
- // Create the "after loop" block and insert it.
- BasicBlock *LoopEndBB = Builder.GetInsertBlock();
- BasicBlock *AfterBB = BasicBlock::Create("afterloop", TheFunction);
-
- // Insert the conditional branch into the end of LoopEndBB.
- Builder.CreateCondBr(EndCond, LoopBB, AfterBB);
-
- // Any new code will be inserted in AfterBB.
- Builder.SetInsertPoint(AfterBB);
-
- // Add a new entry to the PHI node for the backedge.
- Variable-&gt;addIncoming(NextVar, LoopEndBB);
-
- // Restore the unshadowed variable.
- if (OldVal)
- NamedValues[VarName] = OldVal;
- else
- NamedValues.erase(VarName);
-
-
- // for expr always returns 0.0.
- return Constant::getNullValue(Type::DoubleTy);
-}
-
-Function *PrototypeAST::Codegen() {
- // Make the function type: double(double,double) etc.
- std::vector&lt;const Type*&gt; Doubles(Args.size(), Type::DoubleTy);
- FunctionType *FT = FunctionType::get(Type::DoubleTy, Doubles, false);
-
- Function *F = Function::Create(FT, Function::ExternalLinkage, Name, TheModule);
-
- // If F conflicted, there was already something named 'Name'. If it has a
- // body, don't allow redefinition or reextern.
- if (F-&gt;getName() != Name) {
- // Delete the one we just made and get the existing one.
- F-&gt;eraseFromParent();
- F = TheModule-&gt;getFunction(Name);
-
- // If F already has a body, reject this.
- if (!F-&gt;empty()) {
- ErrorF("redefinition of function");
- return 0;
- }
-
- // If F took a different number of args, reject.
- if (F-&gt;arg_size() != Args.size()) {
- ErrorF("redefinition of function with different # args");
- return 0;
- }
- }
-
- // Set names for all arguments.
- unsigned Idx = 0;
- for (Function::arg_iterator AI = F-&gt;arg_begin(); Idx != Args.size();
- ++AI, ++Idx) {
- AI-&gt;setName(Args[Idx]);
-
- // Add arguments to variable symbol table.
- NamedValues[Args[Idx]] = AI;
- }
-
- return F;
-}
-
-Function *FunctionAST::Codegen() {
- NamedValues.clear();
-
- Function *TheFunction = Proto-&gt;Codegen();
- if (TheFunction == 0)
- return 0;
-
- // If this is an operator, install it.
- if (Proto-&gt;isBinaryOp())
- BinopPrecedence[Proto-&gt;getOperatorName()] = Proto-&gt;getBinaryPrecedence();
-
- // Create a new basic block to start insertion into.
- BasicBlock *BB = BasicBlock::Create("entry", TheFunction);
- Builder.SetInsertPoint(BB);
-
- if (Value *RetVal = Body-&gt;Codegen()) {
- // Finish off the function.
- Builder.CreateRet(RetVal);
-
- // Validate the generated code, checking for consistency.
- verifyFunction(*TheFunction);
-
- // Optimize the function.
- TheFPM-&gt;run(*TheFunction);
-
- return TheFunction;
- }
-
- // Error reading body, remove function.
- TheFunction-&gt;eraseFromParent();
-
- if (Proto-&gt;isBinaryOp())
- BinopPrecedence.erase(Proto-&gt;getOperatorName());
- return 0;
-}
-
-//===----------------------------------------------------------------------===//
-// Top-Level parsing and JIT Driver
-//===----------------------------------------------------------------------===//
-
-static ExecutionEngine *TheExecutionEngine;
-
-static void HandleDefinition() {
- if (FunctionAST *F = ParseDefinition()) {
- if (Function *LF = F-&gt;Codegen()) {
- fprintf(stderr, "Read function definition:");
- LF-&gt;dump();
- }
- } else {
- // Skip token for error recovery.
- getNextToken();
- }
-}
-
-static void HandleExtern() {
- if (PrototypeAST *P = ParseExtern()) {
- if (Function *F = P-&gt;Codegen()) {
- fprintf(stderr, "Read extern: ");
- F-&gt;dump();
- }
- } else {
- // Skip token for error recovery.
- getNextToken();
- }
-}
-
-static void HandleTopLevelExpression() {
- // Evaluate a top level expression into an anonymous function.
- if (FunctionAST *F = ParseTopLevelExpr()) {
- if (Function *LF = F-&gt;Codegen()) {
- // JIT the function, returning a function pointer.
- void *FPtr = TheExecutionEngine-&gt;getPointerToFunction(LF);
-
- // Cast it to the right type (takes no arguments, returns a double) so we
- // can call it as a native function.
- double (*FP)() = (double (*)())FPtr;
- fprintf(stderr, "Evaluated to %f\n", FP());
- }
- } else {
- // Skip token for error recovery.
- getNextToken();
- }
-}
-
-/// top ::= definition | external | expression | ';'
-static void MainLoop() {
- while (1) {
- fprintf(stderr, "ready&gt; ");
- switch (CurTok) {
- case tok_eof: return;
- case ';': getNextToken(); break; // ignore top level semicolons.
- case tok_def: HandleDefinition(); break;
- case tok_extern: HandleExtern(); break;
- default: HandleTopLevelExpression(); break;
- }
- }
-}
-
-
-
-//===----------------------------------------------------------------------===//
-// "Library" functions that can be "extern'd" from user code.
-//===----------------------------------------------------------------------===//
-
-/// putchard - putchar that takes a double and returns 0.
-extern "C"
-double putchard(double X) {
- putchar((char)X);
- return 0;
-}
-
-/// printd - printf that takes a double prints it as "%f\n", returning 0.
-extern "C"
-double printd(double X) {
- printf("%f\n", X);
- return 0;
-}
-
-//===----------------------------------------------------------------------===//
-// Main driver code.
-//===----------------------------------------------------------------------===//
-
-int main() {
- // Install standard binary operators.
- // 1 is lowest precedence.
- BinopPrecedence['&lt;'] = 10;
- BinopPrecedence['+'] = 20;
- BinopPrecedence['-'] = 20;
- BinopPrecedence['*'] = 40; // highest.
-
- // Prime the first token.
- fprintf(stderr, "ready&gt; ");
- getNextToken();
-
- // Make the module, which holds all the code.
- TheModule = new Module("my cool jit");
-
- // Create the JIT.
- TheExecutionEngine = ExecutionEngine::create(TheModule);
-
- {
- ExistingModuleProvider OurModuleProvider(TheModule);
- FunctionPassManager OurFPM(&amp;OurModuleProvider);
-
- // Set up the optimizer pipeline. Start with registering info about how the
- // target lays out data structures.
- OurFPM.add(new TargetData(*TheExecutionEngine-&gt;getTargetData()));
- // Do simple "peephole" optimizations and bit-twiddling optzns.
- OurFPM.add(createInstructionCombiningPass());
- // Reassociate expressions.
- OurFPM.add(createReassociatePass());
- // Eliminate Common SubExpressions.
- OurFPM.add(createGVNPass());
- // Simplify the control flow graph (deleting unreachable blocks, etc).
- OurFPM.add(createCFGSimplificationPass());
- // Set the global so the code gen can use this.
- TheFPM = &amp;OurFPM;
-
- // Run the main "interpreter loop" now.
- MainLoop();
-
- TheFPM = 0;
-
- // Print out all of the generated code.
- TheModule-&gt;dump();
- } // Free module provider (and thus the module) and pass manager.
-
- return 0;
-}
-</pre>
-</div>
-
-<a href="LangImpl7.html">Next: Extending the language: mutable variables / SSA construction</a>
-</div>
-
-<!-- *********************************************************************** -->
-<hr>
-<address>
- <a href="http://jigsaw.w3.org/css-validator/check/referer"><img
- src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"></a>
- <a href="http://validator.w3.org/check/referer"><img
- src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!"></a>
-
- <a href="mailto:sabre@nondot.org">Chris Lattner</a><br>
- <a href="http://llvm.org">The LLVM Compiler Infrastructure</a><br>
- Last modified: $Date: 2007-10-17 11:05:13 -0700 (Wed, 17 Oct 2007) $
-</address>
-</body>
-</html>
diff --git a/release_23/docs/tutorial/LangImpl7.html b/release_23/docs/tutorial/LangImpl7.html
deleted file mode 100644
index be09f859b28c..000000000000
--- a/release_23/docs/tutorial/LangImpl7.html
+++ /dev/null
@@ -1,2159 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
- "http://www.w3.org/TR/html4/strict.dtd">
-
-<html>
-<head>
- <title>Kaleidoscope: Extending the Language: Mutable Variables / SSA
- construction</title>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <meta name="author" content="Chris Lattner">
- <link rel="stylesheet" href="../llvm.css" type="text/css">
-</head>
-
-<body>
-
-<div class="doc_title">Kaleidoscope: Extending the Language: Mutable Variables</div>
-
-<ul>
-<li><a href="index.html">Up to Tutorial Index</a></li>
-<li>Chapter 7
- <ol>
- <li><a href="#intro">Chapter 7 Introduction</a></li>
- <li><a href="#why">Why is this a hard problem?</a></li>
- <li><a href="#memory">Memory in LLVM</a></li>
- <li><a href="#kalvars">Mutable Variables in Kaleidoscope</a></li>
- <li><a href="#adjustments">Adjusting Existing Variables for
- Mutation</a></li>
- <li><a href="#assignment">New Assignment Operator</a></li>
- <li><a href="#localvars">User-defined Local Variables</a></li>
- <li><a href="#code">Full Code Listing</a></li>
- </ol>
-</li>
-<li><a href="LangImpl8.html">Chapter 8</a>: Conclusion and other useful LLVM
- tidbits</li>
-</ul>
-
-<div class="doc_author">
- <p>Written by <a href="mailto:sabre@nondot.org">Chris Lattner</a></p>
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section"><a name="intro">Chapter 7 Introduction</a></div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>Welcome to Chapter 7 of the "<a href="index.html">Implementing a language
-with LLVM</a>" tutorial. In chapters 1 through 6, we've built a very
-respectable, albeit simple, <a
-href="http://en.wikipedia.org/wiki/Functional_programming">functional
-programming language</a>. In our journey, we learned some parsing techniques,
-how to build and represent an AST, how to build LLVM IR, and how to optimize
-the resultant code as well as JIT compile it.</p>
-
-<p>While Kaleidoscope is interesting as a functional language, the fact that it
-is functional makes it "too easy" to generate LLVM IR for it. In particular, a
-functional language makes it very easy to build LLVM IR directly in <a
-href="http://en.wikipedia.org/wiki/Static_single_assignment_form">SSA form</a>.
-Since LLVM requires that the input code be in SSA form, this is a very nice
-property and it is often unclear to newcomers how to generate code for an
-imperative language with mutable variables.</p>
-
-<p>The short (and happy) summary of this chapter is that there is no need for
-your front-end to build SSA form: LLVM provides highly tuned and well tested
-support for this, though the way it works is a bit unexpected for some.</p>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section"><a name="why">Why is this a hard problem?</a></div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>
-To understand why mutable variables cause complexities in SSA construction,
-consider this extremely simple C example:
-</p>
-
-<div class="doc_code">
-<pre>
-int G, H;
-int test(_Bool Condition) {
- int X;
- if (Condition)
- X = G;
- else
- X = H;
- return X;
-}
-</pre>
-</div>
-
-<p>In this case, we have the variable "X", whose value depends on the path
-executed in the program. Because there are two different possible values for X
-before the return instruction, a PHI node is inserted to merge the two values.
-The LLVM IR that we want for this example looks like this:</p>
-
-<div class="doc_code">
-<pre>
-@G = weak global i32 0 ; type of @G is i32*
-@H = weak global i32 0 ; type of @H is i32*
-
-define i32 @test(i1 %Condition) {
-entry:
- br i1 %Condition, label %cond_true, label %cond_false
-
-cond_true:
- %X.0 = load i32* @G
- br label %cond_next
-
-cond_false:
- %X.1 = load i32* @H
- br label %cond_next
-
-cond_next:
- %X.2 = phi i32 [ %X.1, %cond_false ], [ %X.0, %cond_true ]
- ret i32 %X.2
-}
-</pre>
-</div>
-
-<p>In this example, the loads from the G and H global variables are explicit in
-the LLVM IR, and they live in the then/else branches of the if statement
-(cond_true/cond_false). In order to merge the incoming values, the X.2 phi node
-in the cond_next block selects the right value to use based on where control
-flow is coming from: if control flow comes from the cond_false block, X.2 gets
-the value of X.1. Alternatively, if control flow comes from cond_true, it gets
-the value of X.0. The intent of this chapter is not to explain the details of
-SSA form. For more information, see one of the many <a
-href="http://en.wikipedia.org/wiki/Static_single_assignment_form">online
-references</a>.</p>
-
-<p>The question for this article is "who places the phi nodes when lowering
-assignments to mutable variables?". The issue here is that LLVM
-<em>requires</em> that its IR be in SSA form: there is no "non-ssa" mode for it.
-However, SSA construction requires non-trivial algorithms and data structures,
-so it is inconvenient and wasteful for every front-end to have to reproduce this
-logic.</p>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section"><a name="memory">Memory in LLVM</a></div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>The 'trick' here is that while LLVM does require all register values to be
-in SSA form, it does not require (or permit) memory objects to be in SSA form.
-In the example above, note that the loads from G and H are direct accesses to
-G and H: they are not renamed or versioned. This differs from some other
-compiler systems, which do try to version memory objects. In LLVM, instead of
-encoding dataflow analysis of memory into the LLVM IR, it is handled with <a
-href="../WritingAnLLVMPass.html">Analysis Passes</a> which are computed on
-demand.</p>
-
-<p>
-With this in mind, the high-level idea is that we want to make a stack variable
-(which lives in memory, because it is on the stack) for each mutable object in
-a function. To take advantage of this trick, we need to talk about how LLVM
-represents stack variables.
-</p>
-
-<p>In LLVM, all memory accesses are explicit with load/store instructions, and
-it is carefully designed not to have (or need) an "address-of" operator. Notice
-how the type of the @G/@H global variables is actually "i32*" even though the
-variable is defined as "i32". What this means is that @G defines <em>space</em>
-for an i32 in the global data area, but its <em>name</em> actually refers to the
-address for that space. Stack variables work the same way, except that instead of
-being declared with global variable definitions, they are declared with the
-<a href="../LangRef.html#i_alloca">LLVM alloca instruction</a>:</p>
-
-<div class="doc_code">
-<pre>
-define i32 @example() {
-entry:
- %X = alloca i32 ; type of %X is i32*.
- ...
- %tmp = load i32* %X ; load the stack value %X from the stack.
- %tmp2 = add i32 %tmp, 1 ; increment it
- store i32 %tmp2, i32* %X ; store it back
- ...
-</pre>
-</div>
-
-<p>This code shows an example of how you can declare and manipulate a stack
-variable in the LLVM IR. Stack memory allocated with the alloca instruction is
-fully general: you can pass the address of the stack slot to functions, you can
-store it in other variables, etc. In our example above, we could rewrite the
-example to use the alloca technique to avoid using a PHI node:</p>
-
-<div class="doc_code">
-<pre>
-@G = weak global i32 0 ; type of @G is i32*
-@H = weak global i32 0 ; type of @H is i32*
-
-define i32 @test(i1 %Condition) {
-entry:
- %X = alloca i32 ; type of %X is i32*.
- br i1 %Condition, label %cond_true, label %cond_false
-
-cond_true:
- %X.0 = load i32* @G
- store i32 %X.0, i32* %X ; Update X
- br label %cond_next
-
-cond_false:
- %X.1 = load i32* @H
- store i32 %X.1, i32* %X ; Update X
- br label %cond_next
-
-cond_next:
- %X.2 = load i32* %X ; Read X
- ret i32 %X.2
-}
-</pre>
-</div>
-
-<p>With this, we have discovered a way to handle arbitrary mutable variables
-without the need to create Phi nodes at all:</p>
-
-<ol>
-<li>Each mutable variable becomes a stack allocation.</li>
-<li>Each read of the variable becomes a load from the stack.</li>
-<li>Each update of the variable becomes a store to the stack.</li>
-<li>Taking the address of a variable just uses the stack address directly.</li>
-</ol>
-
-<p>While this solution has solved our immediate problem, it introduced another
-one: we have now apparently introduced a lot of stack traffic for very simple
-and common operations, a major performance problem. Fortunately for us, the
-LLVM optimizer has a highly-tuned optimization pass named "mem2reg" that handles
-this case, promoting allocas like this into SSA registers, inserting Phi nodes
-as appropriate. If you run this example through the pass, for example, you'll
-get:</p>
-
-<div class="doc_code">
-<pre>
-$ <b>llvm-as &lt; example.ll | opt -mem2reg | llvm-dis</b>
-@G = weak global i32 0
-@H = weak global i32 0
-
-define i32 @test(i1 %Condition) {
-entry:
- br i1 %Condition, label %cond_true, label %cond_false
-
-cond_true:
- %X.0 = load i32* @G
- br label %cond_next
-
-cond_false:
- %X.1 = load i32* @H
- br label %cond_next
-
-cond_next:
- %X.01 = phi i32 [ %X.1, %cond_false ], [ %X.0, %cond_true ]
- ret i32 %X.01
-}
-</pre>
-</div>
-
-<p>The mem2reg pass implements the standard "iterated dominance frontier"
-algorithm for constructing SSA form and has a number of optimizations that speed
-up (very common) degenerate cases. The mem2reg optimization pass is the answer to dealing
-with mutable variables, and we highly recommend that you depend on it. Note that
-mem2reg only works on variables in certain circumstances:</p>
-
-<ol>
-<li>mem2reg is alloca-driven: it looks for allocas and if it can handle them, it
-promotes them. It does not apply to global variables or heap allocations.</li>
-
-<li>mem2reg only looks for alloca instructions in the entry block of the
-function. Being in the entry block guarantees that the alloca is only executed
-once, which makes analysis simpler.</li>
-
-<li>mem2reg only promotes allocas whose uses are direct loads and stores. If
-the address of the stack object is passed to a function, or if any funny pointer
-arithmetic is involved, the alloca will not be promoted.</li>
-
-<li>mem2reg only works on allocas of <a
-href="../LangRef.html#t_classifications">first class</a>
-values (such as pointers, scalars and vectors), and only if the array size
-of the allocation is 1 (or missing in the .ll file). mem2reg is not capable of
-promoting structs or arrays to registers. Note that the "scalarrepl" pass is
-more powerful and can promote structs, "unions", and arrays in many cases.</li>
-
-</ol>
-
-<p>
-All of these properties are easy to satisfy for most imperative languages, and
-we'll illustrate it below with Kaleidoscope. The final question you may be
-asking is: should I bother with this nonsense for my front-end? Wouldn't it be
-better if I just did SSA construction directly, avoiding use of the mem2reg
-optimization pass? In short, we strongly recommend that you use this technique
-for building SSA form, unless there is an extremely good reason not to. Using
-this technique is:</p>
-
-<ul>
-<li>Proven and well tested: llvm-gcc and clang both use this technique for local
-mutable variables. As such, the most common clients of LLVM are using this to
-handle a bulk of their variables. You can be sure that bugs are found fast and
-fixed early.</li>
-
-<li>Extremely Fast: mem2reg has a number of special cases that make it fast in
-common cases as well as fully general. For example, it has fast-paths for
-variables that are only used in a single block, variables that only have one
-assignment point, good heuristics to avoid insertion of unneeded phi nodes, etc.
-</li>
-
-<li>Needed for debug info generation: <a href="../SourceLevelDebugging.html">
-Debug information in LLVM</a> relies on having the address of the variable
-exposed so that debug info can be attached to it. This technique dovetails
-very naturally with this style of debug info.</li>
-</ul>
-
-<p>If nothing else, this makes it much easier to get your front-end up and
-running, and is very simple to implement. Lets extend Kaleidoscope with mutable
-variables now!
-</p>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section"><a name="kalvars">Mutable Variables in
-Kaleidoscope</a></div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>Now that we know the sort of problem we want to tackle, lets see what this
-looks like in the context of our little Kaleidoscope language. We're going to
-add two features:</p>
-
-<ol>
-<li>The ability to mutate variables with the '=' operator.</li>
-<li>The ability to define new variables.</li>
-</ol>
-
-<p>While the first item is really what this is about, we only have variables
-for incoming arguments as well as for induction variables, and redefining those only
-goes so far :). Also, the ability to define new variables is a
-useful thing regardless of whether you will be mutating them. Here's a
-motivating example that shows how we could use these:</p>
-
-<div class="doc_code">
-<pre>
-# Define ':' for sequencing: as a low-precedence operator that ignores operands
-# and just returns the RHS.
-def binary : 1 (x y) y;
-
-# Recursive fib, we could do this before.
-def fib(x)
- if (x &lt; 3) then
- 1
- else
- fib(x-1)+fib(x-2);
-
-# Iterative fib.
-def fibi(x)
- <b>var a = 1, b = 1, c in</b>
- (for i = 3, i &lt; x in
- <b>c = a + b</b> :
- <b>a = b</b> :
- <b>b = c</b>) :
- b;
-
-# Call it.
-fibi(10);
-</pre>
-</div>
-
-<p>
-In order to mutate variables, we have to change our existing variables to use
-the "alloca trick". Once we have that, we'll add our new operator, then extend
-Kaleidoscope to support new variable definitions.
-</p>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section"><a name="adjustments">Adjusting Existing Variables for
-Mutation</a></div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>
-The symbol table in Kaleidoscope is managed at code generation time by the
-'<tt>NamedValues</tt>' map. This map currently keeps track of the LLVM "Value*"
-that holds the double value for the named variable. In order to support
-mutation, we need to change this slightly, so that it <tt>NamedValues</tt> holds
-the <em>memory location</em> of the variable in question. Note that this
-change is a refactoring: it changes the structure of the code, but does not
-(by itself) change the behavior of the compiler. All of these changes are
-isolated in the Kaleidoscope code generator.</p>
-
-<p>
-At this point in Kaleidoscope's development, it only supports variables for two
-things: incoming arguments to functions and the induction variable of 'for'
-loops. For consistency, we'll allow mutation of these variables in addition to
-other user-defined variables. This means that these will both need memory
-locations.
-</p>
-
-<p>To start our transformation of Kaleidoscope, we'll change the NamedValues
-map so that it maps to AllocaInst* instead of Value*. Once we do this, the C++
-compiler will tell us what parts of the code we need to update:</p>
-
-<div class="doc_code">
-<pre>
-static std::map&lt;std::string, AllocaInst*&gt; NamedValues;
-</pre>
-</div>
-
-<p>Also, since we will need to create these alloca's, we'll use a helper
-function that ensures that the allocas are created in the entry block of the
-function:</p>
-
-<div class="doc_code">
-<pre>
-/// CreateEntryBlockAlloca - Create an alloca instruction in the entry block of
-/// the function. This is used for mutable variables etc.
-static AllocaInst *CreateEntryBlockAlloca(Function *TheFunction,
- const std::string &amp;VarName) {
- IRBuilder TmpB(&amp;TheFunction-&gt;getEntryBlock(),
- TheFunction-&gt;getEntryBlock().begin());
- return TmpB.CreateAlloca(Type::DoubleTy, 0, VarName.c_str());
-}
-</pre>
-</div>
-
-<p>This funny looking code creates an IRBuilder object that is pointing at
-the first instruction (.begin()) of the entry block. It then creates an alloca
-with the expected name and returns it. Because all values in Kaleidoscope are
-doubles, there is no need to pass in a type to use.</p>
-
-<p>With this in place, the first functionality change we want to make is to
-variable references. In our new scheme, variables live on the stack, so code
-generating a reference to them actually needs to produce a load from the stack
-slot:</p>
-
-<div class="doc_code">
-<pre>
-Value *VariableExprAST::Codegen() {
- // Look this variable up in the function.
- Value *V = NamedValues[Name];
- if (V == 0) return ErrorV("Unknown variable name");
-
- <b>// Load the value.
- return Builder.CreateLoad(V, Name.c_str());</b>
-}
-</pre>
-</div>
-
-<p>As you can see, this is pretty straightforward. Now we need to update the
-things that define the variables to set up the alloca. We'll start with
-<tt>ForExprAST::Codegen</tt> (see the <a href="#code">full code listing</a> for
-the unabridged code):</p>
-
-<div class="doc_code">
-<pre>
- Function *TheFunction = Builder.GetInsertBlock()->getParent();
-
- <b>// Create an alloca for the variable in the entry block.
- AllocaInst *Alloca = CreateEntryBlockAlloca(TheFunction, VarName);</b>
-
- // Emit the start code first, without 'variable' in scope.
- Value *StartVal = Start-&gt;Codegen();
- if (StartVal == 0) return 0;
-
- <b>// Store the value into the alloca.
- Builder.CreateStore(StartVal, Alloca);</b>
- ...
-
- // Compute the end condition.
- Value *EndCond = End-&gt;Codegen();
- if (EndCond == 0) return EndCond;
-
- <b>// Reload, increment, and restore the alloca. This handles the case where
- // the body of the loop mutates the variable.
- Value *CurVar = Builder.CreateLoad(Alloca);
- Value *NextVar = Builder.CreateAdd(CurVar, StepVal, "nextvar");
- Builder.CreateStore(NextVar, Alloca);</b>
- ...
-</pre>
-</div>
-
-<p>This code is virtually identical to the code <a
-href="LangImpl5.html#forcodegen">before we allowed mutable variables</a>. The
-big difference is that we no longer have to construct a PHI node, and we use
-load/store to access the variable as needed.</p>
-
-<p>To support mutable argument variables, we need to also make allocas for them.
-The code for this is also pretty simple:</p>
-
-<div class="doc_code">
-<pre>
-/// CreateArgumentAllocas - Create an alloca for each argument and register the
-/// argument in the symbol table so that references to it will succeed.
-void PrototypeAST::CreateArgumentAllocas(Function *F) {
- Function::arg_iterator AI = F-&gt;arg_begin();
- for (unsigned Idx = 0, e = Args.size(); Idx != e; ++Idx, ++AI) {
- // Create an alloca for this variable.
- AllocaInst *Alloca = CreateEntryBlockAlloca(F, Args[Idx]);
-
- // Store the initial value into the alloca.
- Builder.CreateStore(AI, Alloca);
-
- // Add arguments to variable symbol table.
- NamedValues[Args[Idx]] = Alloca;
- }
-}
-</pre>
-</div>
-
-<p>For each argument, we make an alloca, store the input value to the function
-into the alloca, and register the alloca as the memory location for the
-argument. This method gets invoked by <tt>FunctionAST::Codegen</tt> right after
-it sets up the entry block for the function.</p>
-
-<p>The final missing piece is adding the mem2reg pass, which allows us to get
-good codegen once again:</p>
-
-<div class="doc_code">
-<pre>
- // Set up the optimizer pipeline. Start with registering info about how the
- // target lays out data structures.
- OurFPM.add(new TargetData(*TheExecutionEngine-&gt;getTargetData()));
- <b>// Promote allocas to registers.
- OurFPM.add(createPromoteMemoryToRegisterPass());</b>
- // Do simple "peephole" optimizations and bit-twiddling optzns.
- OurFPM.add(createInstructionCombiningPass());
- // Reassociate expressions.
- OurFPM.add(createReassociatePass());
-</pre>
-</div>
-
-<p>It is interesting to see what the code looks like before and after the
-mem2reg optimization runs. For example, this is the before/after code for our
-recursive fib function. Before the optimization:</p>
-
-<div class="doc_code">
-<pre>
-define double @fib(double %x) {
-entry:
- <b>%x1 = alloca double
- store double %x, double* %x1
- %x2 = load double* %x1</b>
- %cmptmp = fcmp ult double %x2, 3.000000e+00
- %booltmp = uitofp i1 %cmptmp to double
- %ifcond = fcmp one double %booltmp, 0.000000e+00
- br i1 %ifcond, label %then, label %else
-
-then: ; preds = %entry
- br label %ifcont
-
-else: ; preds = %entry
- <b>%x3 = load double* %x1</b>
- %subtmp = sub double %x3, 1.000000e+00
- %calltmp = call double @fib( double %subtmp )
- <b>%x4 = load double* %x1</b>
- %subtmp5 = sub double %x4, 2.000000e+00
- %calltmp6 = call double @fib( double %subtmp5 )
- %addtmp = add double %calltmp, %calltmp6
- br label %ifcont
-
-ifcont: ; preds = %else, %then
- %iftmp = phi double [ 1.000000e+00, %then ], [ %addtmp, %else ]
- ret double %iftmp
-}
-</pre>
-</div>
-
-<p>Here there is only one variable (x, the input argument) but you can still
-see the extremely simple-minded code generation strategy we are using. In the
-entry block, an alloca is created, and the initial input value is stored into
-it. Each reference to the variable does a reload from the stack. Also, note
-that we didn't modify the if/then/else expression, so it still inserts a PHI
-node. While we could make an alloca for it, it is actually easier to create a
-PHI node for it, so we still just make the PHI.</p>
-
-<p>Here is the code after the mem2reg pass runs:</p>
-
-<div class="doc_code">
-<pre>
-define double @fib(double %x) {
-entry:
- %cmptmp = fcmp ult double <b>%x</b>, 3.000000e+00
- %booltmp = uitofp i1 %cmptmp to double
- %ifcond = fcmp one double %booltmp, 0.000000e+00
- br i1 %ifcond, label %then, label %else
-
-then:
- br label %ifcont
-
-else:
- %subtmp = sub double <b>%x</b>, 1.000000e+00
- %calltmp = call double @fib( double %subtmp )
- %subtmp5 = sub double <b>%x</b>, 2.000000e+00
- %calltmp6 = call double @fib( double %subtmp5 )
- %addtmp = add double %calltmp, %calltmp6
- br label %ifcont
-
-ifcont: ; preds = %else, %then
- %iftmp = phi double [ 1.000000e+00, %then ], [ %addtmp, %else ]
- ret double %iftmp
-}
-</pre>
-</div>
-
-<p>This is a trivial case for mem2reg, since there are no redefinitions of the
-variable. The point of showing this is to calm your tension about inserting
-such blatent inefficiencies :).</p>
-
-<p>After the rest of the optimizers run, we get:</p>
-
-<div class="doc_code">
-<pre>
-define double @fib(double %x) {
-entry:
- %cmptmp = fcmp ult double %x, 3.000000e+00
- %booltmp = uitofp i1 %cmptmp to double
- %ifcond = fcmp ueq double %booltmp, 0.000000e+00
- br i1 %ifcond, label %else, label %ifcont
-
-else:
- %subtmp = sub double %x, 1.000000e+00
- %calltmp = call double @fib( double %subtmp )
- %subtmp5 = sub double %x, 2.000000e+00
- %calltmp6 = call double @fib( double %subtmp5 )
- %addtmp = add double %calltmp, %calltmp6
- ret double %addtmp
-
-ifcont:
- ret double 1.000000e+00
-}
-</pre>
-</div>
-
-<p>Here we see that the simplifycfg pass decided to clone the return instruction
-into the end of the 'else' block. This allowed it to eliminate some branches
-and the PHI node.</p>
-
-<p>Now that all symbol table references are updated to use stack variables,
-we'll add the assignment operator.</p>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section"><a name="assignment">New Assignment Operator</a></div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>With our current framework, adding a new assignment operator is really
-simple. We will parse it just like any other binary operator, but handle it
-internally (instead of allowing the user to define it). The first step is to
-set a precedence:</p>
-
-<div class="doc_code">
-<pre>
- int main() {
- // Install standard binary operators.
- // 1 is lowest precedence.
- <b>BinopPrecedence['='] = 2;</b>
- BinopPrecedence['&lt;'] = 10;
- BinopPrecedence['+'] = 20;
- BinopPrecedence['-'] = 20;
-</pre>
-</div>
-
-<p>Now that the parser knows the precedence of the binary operator, it takes
-care of all the parsing and AST generation. We just need to implement codegen
-for the assignment operator. This looks like:</p>
-
-<div class="doc_code">
-<pre>
-Value *BinaryExprAST::Codegen() {
- // Special case '=' because we don't want to emit the LHS as an expression.
- if (Op == '=') {
- // Assignment requires the LHS to be an identifier.
- VariableExprAST *LHSE = dynamic_cast&lt;VariableExprAST*&gt;(LHS);
- if (!LHSE)
- return ErrorV("destination of '=' must be a variable");
-</pre>
-</div>
-
-<p>Unlike the rest of the binary operators, our assignment operator doesn't
-follow the "emit LHS, emit RHS, do computation" model. As such, it is handled
-as a special case before the other binary operators are handled. The other
-strange thing is that it requires the LHS to be a variable. It is invalid to
-have "(x+1) = expr" - only things like "x = expr" are allowed.
-</p>
-
-<div class="doc_code">
-<pre>
- // Codegen the RHS.
- Value *Val = RHS-&gt;Codegen();
- if (Val == 0) return 0;
-
- // Look up the name.
- Value *Variable = NamedValues[LHSE-&gt;getName()];
- if (Variable == 0) return ErrorV("Unknown variable name");
-
- Builder.CreateStore(Val, Variable);
- return Val;
- }
- ...
-</pre>
-</div>
-
-<p>Once we have the variable, codegen'ing the assignment is straightforward:
-we emit the RHS of the assignment, create a store, and return the computed
-value. Returning a value allows for chained assignments like "X = (Y = Z)".</p>
-
-<p>Now that we have an assignment operator, we can mutate loop variables and
-arguments. For example, we can now run code like this:</p>
-
-<div class="doc_code">
-<pre>
-# Function to print a double.
-extern printd(x);
-
-# Define ':' for sequencing: as a low-precedence operator that ignores operands
-# and just returns the RHS.
-def binary : 1 (x y) y;
-
-def test(x)
- printd(x) :
- x = 4 :
- printd(x);
-
-test(123);
-</pre>
-</div>
-
-<p>When run, this example prints "123" and then "4", showing that we did
-actually mutate the value! Okay, we have now officially implemented our goal:
-getting this to work requires SSA construction in the general case. However,
-to be really useful, we want the ability to define our own local variables, lets
-add this next!
-</p>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section"><a name="localvars">User-defined Local
-Variables</a></div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>Adding var/in is just like any other other extensions we made to
-Kaleidoscope: we extend the lexer, the parser, the AST and the code generator.
-The first step for adding our new 'var/in' construct is to extend the lexer.
-As before, this is pretty trivial, the code looks like this:</p>
-
-<div class="doc_code">
-<pre>
-enum Token {
- ...
- <b>// var definition
- tok_var = -13</b>
-...
-}
-...
-static int gettok() {
-...
- if (IdentifierStr == "in") return tok_in;
- if (IdentifierStr == "binary") return tok_binary;
- if (IdentifierStr == "unary") return tok_unary;
- <b>if (IdentifierStr == "var") return tok_var;</b>
- return tok_identifier;
-...
-</pre>
-</div>
-
-<p>The next step is to define the AST node that we will construct. For var/in,
-it looks like this:</p>
-
-<div class="doc_code">
-<pre>
-/// VarExprAST - Expression class for var/in
-class VarExprAST : public ExprAST {
- std::vector&lt;std::pair&lt;std::string, ExprAST*&gt; &gt; VarNames;
- ExprAST *Body;
-public:
- VarExprAST(const std::vector&lt;std::pair&lt;std::string, ExprAST*&gt; &gt; &amp;varnames,
- ExprAST *body)
- : VarNames(varnames), Body(body) {}
-
- virtual Value *Codegen();
-};
-</pre>
-</div>
-
-<p>var/in allows a list of names to be defined all at once, and each name can
-optionally have an initializer value. As such, we capture this information in
-the VarNames vector. Also, var/in has a body, this body is allowed to access
-the variables defined by the var/in.</p>
-
-<p>With this in place, we can define the parser pieces. The first thing we do is add
-it as a primary expression:</p>
-
-<div class="doc_code">
-<pre>
-/// primary
-/// ::= identifierexpr
-/// ::= numberexpr
-/// ::= parenexpr
-/// ::= ifexpr
-/// ::= forexpr
-<b>/// ::= varexpr</b>
-static ExprAST *ParsePrimary() {
- switch (CurTok) {
- default: return Error("unknown token when expecting an expression");
- case tok_identifier: return ParseIdentifierExpr();
- case tok_number: return ParseNumberExpr();
- case '(': return ParseParenExpr();
- case tok_if: return ParseIfExpr();
- case tok_for: return ParseForExpr();
- <b>case tok_var: return ParseVarExpr();</b>
- }
-}
-</pre>
-</div>
-
-<p>Next we define ParseVarExpr:</p>
-
-<div class="doc_code">
-<pre>
-/// varexpr ::= 'var' identifier ('=' expression)?
-// (',' identifier ('=' expression)?)* 'in' expression
-static ExprAST *ParseVarExpr() {
- getNextToken(); // eat the var.
-
- std::vector&lt;std::pair&lt;std::string, ExprAST*&gt; &gt; VarNames;
-
- // At least one variable name is required.
- if (CurTok != tok_identifier)
- return Error("expected identifier after var");
-</pre>
-</div>
-
-<p>The first part of this code parses the list of identifier/expr pairs into the
-local <tt>VarNames</tt> vector.
-
-<div class="doc_code">
-<pre>
- while (1) {
- std::string Name = IdentifierStr;
- getNextToken(); // eat identifier.
-
- // Read the optional initializer.
- ExprAST *Init = 0;
- if (CurTok == '=') {
- getNextToken(); // eat the '='.
-
- Init = ParseExpression();
- if (Init == 0) return 0;
- }
-
- VarNames.push_back(std::make_pair(Name, Init));
-
- // End of var list, exit loop.
- if (CurTok != ',') break;
- getNextToken(); // eat the ','.
-
- if (CurTok != tok_identifier)
- return Error("expected identifier list after var");
- }
-</pre>
-</div>
-
-<p>Once all the variables are parsed, we then parse the body and create the
-AST node:</p>
-
-<div class="doc_code">
-<pre>
- // At this point, we have to have 'in'.
- if (CurTok != tok_in)
- return Error("expected 'in' keyword after 'var'");
- getNextToken(); // eat 'in'.
-
- ExprAST *Body = ParseExpression();
- if (Body == 0) return 0;
-
- return new VarExprAST(VarNames, Body);
-}
-</pre>
-</div>
-
-<p>Now that we can parse and represent the code, we need to support emission of
-LLVM IR for it. This code starts out with:</p>
-
-<div class="doc_code">
-<pre>
-Value *VarExprAST::Codegen() {
- std::vector&lt;AllocaInst *&gt; OldBindings;
-
- Function *TheFunction = Builder.GetInsertBlock()-&gt;getParent();
-
- // Register all variables and emit their initializer.
- for (unsigned i = 0, e = VarNames.size(); i != e; ++i) {
- const std::string &amp;VarName = VarNames[i].first;
- ExprAST *Init = VarNames[i].second;
-</pre>
-</div>
-
-<p>Basically it loops over all the variables, installing them one at a time.
-For each variable we put into the symbol table, we remember the previous value
-that we replace in OldBindings.</p>
-
-<div class="doc_code">
-<pre>
- // Emit the initializer before adding the variable to scope, this prevents
- // the initializer from referencing the variable itself, and permits stuff
- // like this:
- // var a = 1 in
- // var a = a in ... # refers to outer 'a'.
- Value *InitVal;
- if (Init) {
- InitVal = Init-&gt;Codegen();
- if (InitVal == 0) return 0;
- } else { // If not specified, use 0.0.
- InitVal = ConstantFP::get(Type::DoubleTy, APFloat(0.0));
- }
-
- AllocaInst *Alloca = CreateEntryBlockAlloca(TheFunction, VarName);
- Builder.CreateStore(InitVal, Alloca);
-
- // Remember the old variable binding so that we can restore the binding when
- // we unrecurse.
- OldBindings.push_back(NamedValues[VarName]);
-
- // Remember this binding.
- NamedValues[VarName] = Alloca;
- }
-</pre>
-</div>
-
-<p>There are more comments here than code. The basic idea is that we emit the
-initializer, create the alloca, then update the symbol table to point to it.
-Once all the variables are installed in the symbol table, we evaluate the body
-of the var/in expression:</p>
-
-<div class="doc_code">
-<pre>
- // Codegen the body, now that all vars are in scope.
- Value *BodyVal = Body-&gt;Codegen();
- if (BodyVal == 0) return 0;
-</pre>
-</div>
-
-<p>Finally, before returning, we restore the previous variable bindings:</p>
-
-<div class="doc_code">
-<pre>
- // Pop all our variables from scope.
- for (unsigned i = 0, e = VarNames.size(); i != e; ++i)
- NamedValues[VarNames[i].first] = OldBindings[i];
-
- // Return the body computation.
- return BodyVal;
-}
-</pre>
-</div>
-
-<p>The end result of all of this is that we get properly scoped variable
-definitions, and we even (trivially) allow mutation of them :).</p>
-
-<p>With this, we completed what we set out to do. Our nice iterative fib
-example from the intro compiles and runs just fine. The mem2reg pass optimizes
-all of our stack variables into SSA registers, inserting PHI nodes where needed,
-and our front-end remains simple: no "iterated dominance frontier" computation
-anywhere in sight.</p>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section"><a name="code">Full Code Listing</a></div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>
-Here is the complete code listing for our running example, enhanced with mutable
-variables and var/in support. To build this example, use:
-</p>
-
-<div class="doc_code">
-<pre>
- # Compile
- g++ -g toy.cpp `llvm-config --cppflags --ldflags --libs core jit native` -O3 -o toy
- # Run
- ./toy
-</pre>
-</div>
-
-<p>Here is the code:</p>
-
-<div class="doc_code">
-<pre>
-#include "llvm/DerivedTypes.h"
-#include "llvm/ExecutionEngine/ExecutionEngine.h"
-#include "llvm/Module.h"
-#include "llvm/ModuleProvider.h"
-#include "llvm/PassManager.h"
-#include "llvm/Analysis/Verifier.h"
-#include "llvm/Target/TargetData.h"
-#include "llvm/Transforms/Scalar.h"
-#include "llvm/Support/IRBuilder.h"
-#include &lt;cstdio&gt;
-#include &lt;string&gt;
-#include &lt;map&gt;
-#include &lt;vector&gt;
-using namespace llvm;
-
-//===----------------------------------------------------------------------===//
-// Lexer
-//===----------------------------------------------------------------------===//
-
-// The lexer returns tokens [0-255] if it is an unknown character, otherwise one
-// of these for known things.
-enum Token {
- tok_eof = -1,
-
- // commands
- tok_def = -2, tok_extern = -3,
-
- // primary
- tok_identifier = -4, tok_number = -5,
-
- // control
- tok_if = -6, tok_then = -7, tok_else = -8,
- tok_for = -9, tok_in = -10,
-
- // operators
- tok_binary = -11, tok_unary = -12,
-
- // var definition
- tok_var = -13
-};
-
-static std::string IdentifierStr; // Filled in if tok_identifier
-static double NumVal; // Filled in if tok_number
-
-/// gettok - Return the next token from standard input.
-static int gettok() {
- static int LastChar = ' ';
-
- // Skip any whitespace.
- while (isspace(LastChar))
- LastChar = getchar();
-
- if (isalpha(LastChar)) { // identifier: [a-zA-Z][a-zA-Z0-9]*
- IdentifierStr = LastChar;
- while (isalnum((LastChar = getchar())))
- IdentifierStr += LastChar;
-
- if (IdentifierStr == "def") return tok_def;
- if (IdentifierStr == "extern") return tok_extern;
- if (IdentifierStr == "if") return tok_if;
- if (IdentifierStr == "then") return tok_then;
- if (IdentifierStr == "else") return tok_else;
- if (IdentifierStr == "for") return tok_for;
- if (IdentifierStr == "in") return tok_in;
- if (IdentifierStr == "binary") return tok_binary;
- if (IdentifierStr == "unary") return tok_unary;
- if (IdentifierStr == "var") return tok_var;
- return tok_identifier;
- }
-
- if (isdigit(LastChar) || LastChar == '.') { // Number: [0-9.]+
- std::string NumStr;
- do {
- NumStr += LastChar;
- LastChar = getchar();
- } while (isdigit(LastChar) || LastChar == '.');
-
- NumVal = strtod(NumStr.c_str(), 0);
- return tok_number;
- }
-
- if (LastChar == '#') {
- // Comment until end of line.
- do LastChar = getchar();
- while (LastChar != EOF &amp;&amp; LastChar != '\n' &amp;&amp; LastChar != '\r');
-
- if (LastChar != EOF)
- return gettok();
- }
-
- // Check for end of file. Don't eat the EOF.
- if (LastChar == EOF)
- return tok_eof;
-
- // Otherwise, just return the character as its ascii value.
- int ThisChar = LastChar;
- LastChar = getchar();
- return ThisChar;
-}
-
-//===----------------------------------------------------------------------===//
-// Abstract Syntax Tree (aka Parse Tree)
-//===----------------------------------------------------------------------===//
-
-/// ExprAST - Base class for all expression nodes.
-class ExprAST {
-public:
- virtual ~ExprAST() {}
- virtual Value *Codegen() = 0;
-};
-
-/// NumberExprAST - Expression class for numeric literals like "1.0".
-class NumberExprAST : public ExprAST {
- double Val;
-public:
- NumberExprAST(double val) : Val(val) {}
- virtual Value *Codegen();
-};
-
-/// VariableExprAST - Expression class for referencing a variable, like "a".
-class VariableExprAST : public ExprAST {
- std::string Name;
-public:
- VariableExprAST(const std::string &amp;name) : Name(name) {}
- const std::string &amp;getName() const { return Name; }
- virtual Value *Codegen();
-};
-
-/// UnaryExprAST - Expression class for a unary operator.
-class UnaryExprAST : public ExprAST {
- char Opcode;
- ExprAST *Operand;
-public:
- UnaryExprAST(char opcode, ExprAST *operand)
- : Opcode(opcode), Operand(operand) {}
- virtual Value *Codegen();
-};
-
-/// BinaryExprAST - Expression class for a binary operator.
-class BinaryExprAST : public ExprAST {
- char Op;
- ExprAST *LHS, *RHS;
-public:
- BinaryExprAST(char op, ExprAST *lhs, ExprAST *rhs)
- : Op(op), LHS(lhs), RHS(rhs) {}
- virtual Value *Codegen();
-};
-
-/// CallExprAST - Expression class for function calls.
-class CallExprAST : public ExprAST {
- std::string Callee;
- std::vector&lt;ExprAST*&gt; Args;
-public:
- CallExprAST(const std::string &amp;callee, std::vector&lt;ExprAST*&gt; &amp;args)
- : Callee(callee), Args(args) {}
- virtual Value *Codegen();
-};
-
-/// IfExprAST - Expression class for if/then/else.
-class IfExprAST : public ExprAST {
- ExprAST *Cond, *Then, *Else;
-public:
- IfExprAST(ExprAST *cond, ExprAST *then, ExprAST *_else)
- : Cond(cond), Then(then), Else(_else) {}
- virtual Value *Codegen();
-};
-
-/// ForExprAST - Expression class for for/in.
-class ForExprAST : public ExprAST {
- std::string VarName;
- ExprAST *Start, *End, *Step, *Body;
-public:
- ForExprAST(const std::string &amp;varname, ExprAST *start, ExprAST *end,
- ExprAST *step, ExprAST *body)
- : VarName(varname), Start(start), End(end), Step(step), Body(body) {}
- virtual Value *Codegen();
-};
-
-/// VarExprAST - Expression class for var/in
-class VarExprAST : public ExprAST {
- std::vector&lt;std::pair&lt;std::string, ExprAST*&gt; &gt; VarNames;
- ExprAST *Body;
-public:
- VarExprAST(const std::vector&lt;std::pair&lt;std::string, ExprAST*&gt; &gt; &amp;varnames,
- ExprAST *body)
- : VarNames(varnames), Body(body) {}
-
- virtual Value *Codegen();
-};
-
-/// PrototypeAST - This class represents the "prototype" for a function,
-/// which captures its argument names as well as if it is an operator.
-class PrototypeAST {
- std::string Name;
- std::vector&lt;std::string&gt; Args;
- bool isOperator;
- unsigned Precedence; // Precedence if a binary op.
-public:
- PrototypeAST(const std::string &amp;name, const std::vector&lt;std::string&gt; &amp;args,
- bool isoperator = false, unsigned prec = 0)
- : Name(name), Args(args), isOperator(isoperator), Precedence(prec) {}
-
- bool isUnaryOp() const { return isOperator &amp;&amp; Args.size() == 1; }
- bool isBinaryOp() const { return isOperator &amp;&amp; Args.size() == 2; }
-
- char getOperatorName() const {
- assert(isUnaryOp() || isBinaryOp());
- return Name[Name.size()-1];
- }
-
- unsigned getBinaryPrecedence() const { return Precedence; }
-
- Function *Codegen();
-
- void CreateArgumentAllocas(Function *F);
-};
-
-/// FunctionAST - This class represents a function definition itself.
-class FunctionAST {
- PrototypeAST *Proto;
- ExprAST *Body;
-public:
- FunctionAST(PrototypeAST *proto, ExprAST *body)
- : Proto(proto), Body(body) {}
-
- Function *Codegen();
-};
-
-//===----------------------------------------------------------------------===//
-// Parser
-//===----------------------------------------------------------------------===//
-
-/// CurTok/getNextToken - Provide a simple token buffer. CurTok is the current
-/// token the parser it looking at. getNextToken reads another token from the
-/// lexer and updates CurTok with its results.
-static int CurTok;
-static int getNextToken() {
- return CurTok = gettok();
-}
-
-/// BinopPrecedence - This holds the precedence for each binary operator that is
-/// defined.
-static std::map&lt;char, int&gt; BinopPrecedence;
-
-/// GetTokPrecedence - Get the precedence of the pending binary operator token.
-static int GetTokPrecedence() {
- if (!isascii(CurTok))
- return -1;
-
- // Make sure it's a declared binop.
- int TokPrec = BinopPrecedence[CurTok];
- if (TokPrec &lt;= 0) return -1;
- return TokPrec;
-}
-
-/// Error* - These are little helper functions for error handling.
-ExprAST *Error(const char *Str) { fprintf(stderr, "Error: %s\n", Str);return 0;}
-PrototypeAST *ErrorP(const char *Str) { Error(Str); return 0; }
-FunctionAST *ErrorF(const char *Str) { Error(Str); return 0; }
-
-static ExprAST *ParseExpression();
-
-/// identifierexpr
-/// ::= identifier
-/// ::= identifier '(' expression* ')'
-static ExprAST *ParseIdentifierExpr() {
- std::string IdName = IdentifierStr;
-
- getNextToken(); // eat identifier.
-
- if (CurTok != '(') // Simple variable ref.
- return new VariableExprAST(IdName);
-
- // Call.
- getNextToken(); // eat (
- std::vector&lt;ExprAST*&gt; Args;
- if (CurTok != ')') {
- while (1) {
- ExprAST *Arg = ParseExpression();
- if (!Arg) return 0;
- Args.push_back(Arg);
-
- if (CurTok == ')') break;
-
- if (CurTok != ',')
- return Error("Expected ')' or ',' in argument list");
- getNextToken();
- }
- }
-
- // Eat the ')'.
- getNextToken();
-
- return new CallExprAST(IdName, Args);
-}
-
-/// numberexpr ::= number
-static ExprAST *ParseNumberExpr() {
- ExprAST *Result = new NumberExprAST(NumVal);
- getNextToken(); // consume the number
- return Result;
-}
-
-/// parenexpr ::= '(' expression ')'
-static ExprAST *ParseParenExpr() {
- getNextToken(); // eat (.
- ExprAST *V = ParseExpression();
- if (!V) return 0;
-
- if (CurTok != ')')
- return Error("expected ')'");
- getNextToken(); // eat ).
- return V;
-}
-
-/// ifexpr ::= 'if' expression 'then' expression 'else' expression
-static ExprAST *ParseIfExpr() {
- getNextToken(); // eat the if.
-
- // condition.
- ExprAST *Cond = ParseExpression();
- if (!Cond) return 0;
-
- if (CurTok != tok_then)
- return Error("expected then");
- getNextToken(); // eat the then
-
- ExprAST *Then = ParseExpression();
- if (Then == 0) return 0;
-
- if (CurTok != tok_else)
- return Error("expected else");
-
- getNextToken();
-
- ExprAST *Else = ParseExpression();
- if (!Else) return 0;
-
- return new IfExprAST(Cond, Then, Else);
-}
-
-/// forexpr ::= 'for' identifier '=' expr ',' expr (',' expr)? 'in' expression
-static ExprAST *ParseForExpr() {
- getNextToken(); // eat the for.
-
- if (CurTok != tok_identifier)
- return Error("expected identifier after for");
-
- std::string IdName = IdentifierStr;
- getNextToken(); // eat identifier.
-
- if (CurTok != '=')
- return Error("expected '=' after for");
- getNextToken(); // eat '='.
-
-
- ExprAST *Start = ParseExpression();
- if (Start == 0) return 0;
- if (CurTok != ',')
- return Error("expected ',' after for start value");
- getNextToken();
-
- ExprAST *End = ParseExpression();
- if (End == 0) return 0;
-
- // The step value is optional.
- ExprAST *Step = 0;
- if (CurTok == ',') {
- getNextToken();
- Step = ParseExpression();
- if (Step == 0) return 0;
- }
-
- if (CurTok != tok_in)
- return Error("expected 'in' after for");
- getNextToken(); // eat 'in'.
-
- ExprAST *Body = ParseExpression();
- if (Body == 0) return 0;
-
- return new ForExprAST(IdName, Start, End, Step, Body);
-}
-
-/// varexpr ::= 'var' identifier ('=' expression)?
-// (',' identifier ('=' expression)?)* 'in' expression
-static ExprAST *ParseVarExpr() {
- getNextToken(); // eat the var.
-
- std::vector&lt;std::pair&lt;std::string, ExprAST*&gt; &gt; VarNames;
-
- // At least one variable name is required.
- if (CurTok != tok_identifier)
- return Error("expected identifier after var");
-
- while (1) {
- std::string Name = IdentifierStr;
- getNextToken(); // eat identifier.
-
- // Read the optional initializer.
- ExprAST *Init = 0;
- if (CurTok == '=') {
- getNextToken(); // eat the '='.
-
- Init = ParseExpression();
- if (Init == 0) return 0;
- }
-
- VarNames.push_back(std::make_pair(Name, Init));
-
- // End of var list, exit loop.
- if (CurTok != ',') break;
- getNextToken(); // eat the ','.
-
- if (CurTok != tok_identifier)
- return Error("expected identifier list after var");
- }
-
- // At this point, we have to have 'in'.
- if (CurTok != tok_in)
- return Error("expected 'in' keyword after 'var'");
- getNextToken(); // eat 'in'.
-
- ExprAST *Body = ParseExpression();
- if (Body == 0) return 0;
-
- return new VarExprAST(VarNames, Body);
-}
-
-
-/// primary
-/// ::= identifierexpr
-/// ::= numberexpr
-/// ::= parenexpr
-/// ::= ifexpr
-/// ::= forexpr
-/// ::= varexpr
-static ExprAST *ParsePrimary() {
- switch (CurTok) {
- default: return Error("unknown token when expecting an expression");
- case tok_identifier: return ParseIdentifierExpr();
- case tok_number: return ParseNumberExpr();
- case '(': return ParseParenExpr();
- case tok_if: return ParseIfExpr();
- case tok_for: return ParseForExpr();
- case tok_var: return ParseVarExpr();
- }
-}
-
-/// unary
-/// ::= primary
-/// ::= '!' unary
-static ExprAST *ParseUnary() {
- // If the current token is not an operator, it must be a primary expr.
- if (!isascii(CurTok) || CurTok == '(' || CurTok == ',')
- return ParsePrimary();
-
- // If this is a unary operator, read it.
- int Opc = CurTok;
- getNextToken();
- if (ExprAST *Operand = ParseUnary())
- return new UnaryExprAST(Opc, Operand);
- return 0;
-}
-
-/// binoprhs
-/// ::= ('+' unary)*
-static ExprAST *ParseBinOpRHS(int ExprPrec, ExprAST *LHS) {
- // If this is a binop, find its precedence.
- while (1) {
- int TokPrec = GetTokPrecedence();
-
- // If this is a binop that binds at least as tightly as the current binop,
- // consume it, otherwise we are done.
- if (TokPrec &lt; ExprPrec)
- return LHS;
-
- // Okay, we know this is a binop.
- int BinOp = CurTok;
- getNextToken(); // eat binop
-
- // Parse the unary expression after the binary operator.
- ExprAST *RHS = ParseUnary();
- if (!RHS) return 0;
-
- // If BinOp binds less tightly with RHS than the operator after RHS, let
- // the pending operator take RHS as its LHS.
- int NextPrec = GetTokPrecedence();
- if (TokPrec &lt; NextPrec) {
- RHS = ParseBinOpRHS(TokPrec+1, RHS);
- if (RHS == 0) return 0;
- }
-
- // Merge LHS/RHS.
- LHS = new BinaryExprAST(BinOp, LHS, RHS);
- }
-}
-
-/// expression
-/// ::= unary binoprhs
-///
-static ExprAST *ParseExpression() {
- ExprAST *LHS = ParseUnary();
- if (!LHS) return 0;
-
- return ParseBinOpRHS(0, LHS);
-}
-
-/// prototype
-/// ::= id '(' id* ')'
-/// ::= binary LETTER number? (id, id)
-/// ::= unary LETTER (id)
-static PrototypeAST *ParsePrototype() {
- std::string FnName;
-
- int Kind = 0; // 0 = identifier, 1 = unary, 2 = binary.
- unsigned BinaryPrecedence = 30;
-
- switch (CurTok) {
- default:
- return ErrorP("Expected function name in prototype");
- case tok_identifier:
- FnName = IdentifierStr;
- Kind = 0;
- getNextToken();
- break;
- case tok_unary:
- getNextToken();
- if (!isascii(CurTok))
- return ErrorP("Expected unary operator");
- FnName = "unary";
- FnName += (char)CurTok;
- Kind = 1;
- getNextToken();
- break;
- case tok_binary:
- getNextToken();
- if (!isascii(CurTok))
- return ErrorP("Expected binary operator");
- FnName = "binary";
- FnName += (char)CurTok;
- Kind = 2;
- getNextToken();
-
- // Read the precedence if present.
- if (CurTok == tok_number) {
- if (NumVal &lt; 1 || NumVal &gt; 100)
- return ErrorP("Invalid precedecnce: must be 1..100");
- BinaryPrecedence = (unsigned)NumVal;
- getNextToken();
- }
- break;
- }
-
- if (CurTok != '(')
- return ErrorP("Expected '(' in prototype");
-
- std::vector&lt;std::string&gt; ArgNames;
- while (getNextToken() == tok_identifier)
- ArgNames.push_back(IdentifierStr);
- if (CurTok != ')')
- return ErrorP("Expected ')' in prototype");
-
- // success.
- getNextToken(); // eat ')'.
-
- // Verify right number of names for operator.
- if (Kind &amp;&amp; ArgNames.size() != Kind)
- return ErrorP("Invalid number of operands for operator");
-
- return new PrototypeAST(FnName, ArgNames, Kind != 0, BinaryPrecedence);
-}
-
-/// definition ::= 'def' prototype expression
-static FunctionAST *ParseDefinition() {
- getNextToken(); // eat def.
- PrototypeAST *Proto = ParsePrototype();
- if (Proto == 0) return 0;
-
- if (ExprAST *E = ParseExpression())
- return new FunctionAST(Proto, E);
- return 0;
-}
-
-/// toplevelexpr ::= expression
-static FunctionAST *ParseTopLevelExpr() {
- if (ExprAST *E = ParseExpression()) {
- // Make an anonymous proto.
- PrototypeAST *Proto = new PrototypeAST("", std::vector&lt;std::string&gt;());
- return new FunctionAST(Proto, E);
- }
- return 0;
-}
-
-/// external ::= 'extern' prototype
-static PrototypeAST *ParseExtern() {
- getNextToken(); // eat extern.
- return ParsePrototype();
-}
-
-//===----------------------------------------------------------------------===//
-// Code Generation
-//===----------------------------------------------------------------------===//
-
-static Module *TheModule;
-static IRBuilder Builder;
-static std::map&lt;std::string, AllocaInst*&gt; NamedValues;
-static FunctionPassManager *TheFPM;
-
-Value *ErrorV(const char *Str) { Error(Str); return 0; }
-
-/// CreateEntryBlockAlloca - Create an alloca instruction in the entry block of
-/// the function. This is used for mutable variables etc.
-static AllocaInst *CreateEntryBlockAlloca(Function *TheFunction,
- const std::string &amp;VarName) {
- IRBuilder TmpB(&amp;TheFunction-&gt;getEntryBlock(),
- TheFunction-&gt;getEntryBlock().begin());
- return TmpB.CreateAlloca(Type::DoubleTy, 0, VarName.c_str());
-}
-
-
-Value *NumberExprAST::Codegen() {
- return ConstantFP::get(Type::DoubleTy, APFloat(Val));
-}
-
-Value *VariableExprAST::Codegen() {
- // Look this variable up in the function.
- Value *V = NamedValues[Name];
- if (V == 0) return ErrorV("Unknown variable name");
-
- // Load the value.
- return Builder.CreateLoad(V, Name.c_str());
-}
-
-Value *UnaryExprAST::Codegen() {
- Value *OperandV = Operand-&gt;Codegen();
- if (OperandV == 0) return 0;
-
- Function *F = TheModule-&gt;getFunction(std::string("unary")+Opcode);
- if (F == 0)
- return ErrorV("Unknown unary operator");
-
- return Builder.CreateCall(F, OperandV, "unop");
-}
-
-
-Value *BinaryExprAST::Codegen() {
- // Special case '=' because we don't want to emit the LHS as an expression.
- if (Op == '=') {
- // Assignment requires the LHS to be an identifier.
- VariableExprAST *LHSE = dynamic_cast&lt;VariableExprAST*&gt;(LHS);
- if (!LHSE)
- return ErrorV("destination of '=' must be a variable");
- // Codegen the RHS.
- Value *Val = RHS-&gt;Codegen();
- if (Val == 0) return 0;
-
- // Look up the name.
- Value *Variable = NamedValues[LHSE-&gt;getName()];
- if (Variable == 0) return ErrorV("Unknown variable name");
-
- Builder.CreateStore(Val, Variable);
- return Val;
- }
-
-
- Value *L = LHS-&gt;Codegen();
- Value *R = RHS-&gt;Codegen();
- if (L == 0 || R == 0) return 0;
-
- switch (Op) {
- case '+': return Builder.CreateAdd(L, R, "addtmp");
- case '-': return Builder.CreateSub(L, R, "subtmp");
- case '*': return Builder.CreateMul(L, R, "multmp");
- case '&lt;':
- L = Builder.CreateFCmpULT(L, R, "cmptmp");
- // Convert bool 0/1 to double 0.0 or 1.0
- return Builder.CreateUIToFP(L, Type::DoubleTy, "booltmp");
- default: break;
- }
-
- // If it wasn't a builtin binary operator, it must be a user defined one. Emit
- // a call to it.
- Function *F = TheModule-&gt;getFunction(std::string("binary")+Op);
- assert(F &amp;&amp; "binary operator not found!");
-
- Value *Ops[] = { L, R };
- return Builder.CreateCall(F, Ops, Ops+2, "binop");
-}
-
-Value *CallExprAST::Codegen() {
- // Look up the name in the global module table.
- Function *CalleeF = TheModule-&gt;getFunction(Callee);
- if (CalleeF == 0)
- return ErrorV("Unknown function referenced");
-
- // If argument mismatch error.
- if (CalleeF-&gt;arg_size() != Args.size())
- return ErrorV("Incorrect # arguments passed");
-
- std::vector&lt;Value*&gt; ArgsV;
- for (unsigned i = 0, e = Args.size(); i != e; ++i) {
- ArgsV.push_back(Args[i]-&gt;Codegen());
- if (ArgsV.back() == 0) return 0;
- }
-
- return Builder.CreateCall(CalleeF, ArgsV.begin(), ArgsV.end(), "calltmp");
-}
-
-Value *IfExprAST::Codegen() {
- Value *CondV = Cond-&gt;Codegen();
- if (CondV == 0) return 0;
-
- // Convert condition to a bool by comparing equal to 0.0.
- CondV = Builder.CreateFCmpONE(CondV,
- ConstantFP::get(Type::DoubleTy, APFloat(0.0)),
- "ifcond");
-
- Function *TheFunction = Builder.GetInsertBlock()-&gt;getParent();
-
- // Create blocks for the then and else cases. Insert the 'then' block at the
- // end of the function.
- BasicBlock *ThenBB = BasicBlock::Create("then", TheFunction);
- BasicBlock *ElseBB = BasicBlock::Create("else");
- BasicBlock *MergeBB = BasicBlock::Create("ifcont");
-
- Builder.CreateCondBr(CondV, ThenBB, ElseBB);
-
- // Emit then value.
- Builder.SetInsertPoint(ThenBB);
-
- Value *ThenV = Then-&gt;Codegen();
- if (ThenV == 0) return 0;
-
- Builder.CreateBr(MergeBB);
- // Codegen of 'Then' can change the current block, update ThenBB for the PHI.
- ThenBB = Builder.GetInsertBlock();
-
- // Emit else block.
- TheFunction-&gt;getBasicBlockList().push_back(ElseBB);
- Builder.SetInsertPoint(ElseBB);
-
- Value *ElseV = Else-&gt;Codegen();
- if (ElseV == 0) return 0;
-
- Builder.CreateBr(MergeBB);
- // Codegen of 'Else' can change the current block, update ElseBB for the PHI.
- ElseBB = Builder.GetInsertBlock();
-
- // Emit merge block.
- TheFunction-&gt;getBasicBlockList().push_back(MergeBB);
- Builder.SetInsertPoint(MergeBB);
- PHINode *PN = Builder.CreatePHI(Type::DoubleTy, "iftmp");
-
- PN-&gt;addIncoming(ThenV, ThenBB);
- PN-&gt;addIncoming(ElseV, ElseBB);
- return PN;
-}
-
-Value *ForExprAST::Codegen() {
- // Output this as:
- // var = alloca double
- // ...
- // start = startexpr
- // store start -&gt; var
- // goto loop
- // loop:
- // ...
- // bodyexpr
- // ...
- // loopend:
- // step = stepexpr
- // endcond = endexpr
- //
- // curvar = load var
- // nextvar = curvar + step
- // store nextvar -&gt; var
- // br endcond, loop, endloop
- // outloop:
-
- Function *TheFunction = Builder.GetInsertBlock()-&gt;getParent();
-
- // Create an alloca for the variable in the entry block.
- AllocaInst *Alloca = CreateEntryBlockAlloca(TheFunction, VarName);
-
- // Emit the start code first, without 'variable' in scope.
- Value *StartVal = Start-&gt;Codegen();
- if (StartVal == 0) return 0;
-
- // Store the value into the alloca.
- Builder.CreateStore(StartVal, Alloca);
-
- // Make the new basic block for the loop header, inserting after current
- // block.
- BasicBlock *PreheaderBB = Builder.GetInsertBlock();
- BasicBlock *LoopBB = BasicBlock::Create("loop", TheFunction);
-
- // Insert an explicit fall through from the current block to the LoopBB.
- Builder.CreateBr(LoopBB);
-
- // Start insertion in LoopBB.
- Builder.SetInsertPoint(LoopBB);
-
- // Within the loop, the variable is defined equal to the PHI node. If it
- // shadows an existing variable, we have to restore it, so save it now.
- AllocaInst *OldVal = NamedValues[VarName];
- NamedValues[VarName] = Alloca;
-
- // Emit the body of the loop. This, like any other expr, can change the
- // current BB. Note that we ignore the value computed by the body, but don't
- // allow an error.
- if (Body-&gt;Codegen() == 0)
- return 0;
-
- // Emit the step value.
- Value *StepVal;
- if (Step) {
- StepVal = Step-&gt;Codegen();
- if (StepVal == 0) return 0;
- } else {
- // If not specified, use 1.0.
- StepVal = ConstantFP::get(Type::DoubleTy, APFloat(1.0));
- }
-
- // Compute the end condition.
- Value *EndCond = End-&gt;Codegen();
- if (EndCond == 0) return EndCond;
-
- // Reload, increment, and restore the alloca. This handles the case where
- // the body of the loop mutates the variable.
- Value *CurVar = Builder.CreateLoad(Alloca, VarName.c_str());
- Value *NextVar = Builder.CreateAdd(CurVar, StepVal, "nextvar");
- Builder.CreateStore(NextVar, Alloca);
-
- // Convert condition to a bool by comparing equal to 0.0.
- EndCond = Builder.CreateFCmpONE(EndCond,
- ConstantFP::get(Type::DoubleTy, APFloat(0.0)),
- "loopcond");
-
- // Create the "after loop" block and insert it.
- BasicBlock *LoopEndBB = Builder.GetInsertBlock();
- BasicBlock *AfterBB = BasicBlock::Create("afterloop", TheFunction);
-
- // Insert the conditional branch into the end of LoopEndBB.
- Builder.CreateCondBr(EndCond, LoopBB, AfterBB);
-
- // Any new code will be inserted in AfterBB.
- Builder.SetInsertPoint(AfterBB);
-
- // Restore the unshadowed variable.
- if (OldVal)
- NamedValues[VarName] = OldVal;
- else
- NamedValues.erase(VarName);
-
-
- // for expr always returns 0.0.
- return Constant::getNullValue(Type::DoubleTy);
-}
-
-Value *VarExprAST::Codegen() {
- std::vector&lt;AllocaInst *&gt; OldBindings;
-
- Function *TheFunction = Builder.GetInsertBlock()-&gt;getParent();
-
- // Register all variables and emit their initializer.
- for (unsigned i = 0, e = VarNames.size(); i != e; ++i) {
- const std::string &amp;VarName = VarNames[i].first;
- ExprAST *Init = VarNames[i].second;
-
- // Emit the initializer before adding the variable to scope, this prevents
- // the initializer from referencing the variable itself, and permits stuff
- // like this:
- // var a = 1 in
- // var a = a in ... # refers to outer 'a'.
- Value *InitVal;
- if (Init) {
- InitVal = Init-&gt;Codegen();
- if (InitVal == 0) return 0;
- } else { // If not specified, use 0.0.
- InitVal = ConstantFP::get(Type::DoubleTy, APFloat(0.0));
- }
-
- AllocaInst *Alloca = CreateEntryBlockAlloca(TheFunction, VarName);
- Builder.CreateStore(InitVal, Alloca);
-
- // Remember the old variable binding so that we can restore the binding when
- // we unrecurse.
- OldBindings.push_back(NamedValues[VarName]);
-
- // Remember this binding.
- NamedValues[VarName] = Alloca;
- }
-
- // Codegen the body, now that all vars are in scope.
- Value *BodyVal = Body-&gt;Codegen();
- if (BodyVal == 0) return 0;
-
- // Pop all our variables from scope.
- for (unsigned i = 0, e = VarNames.size(); i != e; ++i)
- NamedValues[VarNames[i].first] = OldBindings[i];
-
- // Return the body computation.
- return BodyVal;
-}
-
-
-Function *PrototypeAST::Codegen() {
- // Make the function type: double(double,double) etc.
- std::vector&lt;const Type*&gt; Doubles(Args.size(), Type::DoubleTy);
- FunctionType *FT = FunctionType::get(Type::DoubleTy, Doubles, false);
-
- Function *F = Function::Create(FT, Function::ExternalLinkage, Name, TheModule);
-
- // If F conflicted, there was already something named 'Name'. If it has a
- // body, don't allow redefinition or reextern.
- if (F-&gt;getName() != Name) {
- // Delete the one we just made and get the existing one.
- F-&gt;eraseFromParent();
- F = TheModule-&gt;getFunction(Name);
-
- // If F already has a body, reject this.
- if (!F-&gt;empty()) {
- ErrorF("redefinition of function");
- return 0;
- }
-
- // If F took a different number of args, reject.
- if (F-&gt;arg_size() != Args.size()) {
- ErrorF("redefinition of function with different # args");
- return 0;
- }
- }
-
- // Set names for all arguments.
- unsigned Idx = 0;
- for (Function::arg_iterator AI = F-&gt;arg_begin(); Idx != Args.size();
- ++AI, ++Idx)
- AI-&gt;setName(Args[Idx]);
-
- return F;
-}
-
-/// CreateArgumentAllocas - Create an alloca for each argument and register the
-/// argument in the symbol table so that references to it will succeed.
-void PrototypeAST::CreateArgumentAllocas(Function *F) {
- Function::arg_iterator AI = F-&gt;arg_begin();
- for (unsigned Idx = 0, e = Args.size(); Idx != e; ++Idx, ++AI) {
- // Create an alloca for this variable.
- AllocaInst *Alloca = CreateEntryBlockAlloca(F, Args[Idx]);
-
- // Store the initial value into the alloca.
- Builder.CreateStore(AI, Alloca);
-
- // Add arguments to variable symbol table.
- NamedValues[Args[Idx]] = Alloca;
- }
-}
-
-
-Function *FunctionAST::Codegen() {
- NamedValues.clear();
-
- Function *TheFunction = Proto-&gt;Codegen();
- if (TheFunction == 0)
- return 0;
-
- // If this is an operator, install it.
- if (Proto-&gt;isBinaryOp())
- BinopPrecedence[Proto-&gt;getOperatorName()] = Proto-&gt;getBinaryPrecedence();
-
- // Create a new basic block to start insertion into.
- BasicBlock *BB = BasicBlock::Create("entry", TheFunction);
- Builder.SetInsertPoint(BB);
-
- // Add all arguments to the symbol table and create their allocas.
- Proto-&gt;CreateArgumentAllocas(TheFunction);
-
- if (Value *RetVal = Body-&gt;Codegen()) {
- // Finish off the function.
- Builder.CreateRet(RetVal);
-
- // Validate the generated code, checking for consistency.
- verifyFunction(*TheFunction);
-
- // Optimize the function.
- TheFPM-&gt;run(*TheFunction);
-
- return TheFunction;
- }
-
- // Error reading body, remove function.
- TheFunction-&gt;eraseFromParent();
-
- if (Proto-&gt;isBinaryOp())
- BinopPrecedence.erase(Proto-&gt;getOperatorName());
- return 0;
-}
-
-//===----------------------------------------------------------------------===//
-// Top-Level parsing and JIT Driver
-//===----------------------------------------------------------------------===//
-
-static ExecutionEngine *TheExecutionEngine;
-
-static void HandleDefinition() {
- if (FunctionAST *F = ParseDefinition()) {
- if (Function *LF = F-&gt;Codegen()) {
- fprintf(stderr, "Read function definition:");
- LF-&gt;dump();
- }
- } else {
- // Skip token for error recovery.
- getNextToken();
- }
-}
-
-static void HandleExtern() {
- if (PrototypeAST *P = ParseExtern()) {
- if (Function *F = P-&gt;Codegen()) {
- fprintf(stderr, "Read extern: ");
- F-&gt;dump();
- }
- } else {
- // Skip token for error recovery.
- getNextToken();
- }
-}
-
-static void HandleTopLevelExpression() {
- // Evaluate a top level expression into an anonymous function.
- if (FunctionAST *F = ParseTopLevelExpr()) {
- if (Function *LF = F-&gt;Codegen()) {
- // JIT the function, returning a function pointer.
- void *FPtr = TheExecutionEngine-&gt;getPointerToFunction(LF);
-
- // Cast it to the right type (takes no arguments, returns a double) so we
- // can call it as a native function.
- double (*FP)() = (double (*)())FPtr;
- fprintf(stderr, "Evaluated to %f\n", FP());
- }
- } else {
- // Skip token for error recovery.
- getNextToken();
- }
-}
-
-/// top ::= definition | external | expression | ';'
-static void MainLoop() {
- while (1) {
- fprintf(stderr, "ready&gt; ");
- switch (CurTok) {
- case tok_eof: return;
- case ';': getNextToken(); break; // ignore top level semicolons.
- case tok_def: HandleDefinition(); break;
- case tok_extern: HandleExtern(); break;
- default: HandleTopLevelExpression(); break;
- }
- }
-}
-
-
-
-//===----------------------------------------------------------------------===//
-// "Library" functions that can be "extern'd" from user code.
-//===----------------------------------------------------------------------===//
-
-/// putchard - putchar that takes a double and returns 0.
-extern "C"
-double putchard(double X) {
- putchar((char)X);
- return 0;
-}
-
-/// printd - printf that takes a double prints it as "%f\n", returning 0.
-extern "C"
-double printd(double X) {
- printf("%f\n", X);
- return 0;
-}
-
-//===----------------------------------------------------------------------===//
-// Main driver code.
-//===----------------------------------------------------------------------===//
-
-int main() {
- // Install standard binary operators.
- // 1 is lowest precedence.
- BinopPrecedence['='] = 2;
- BinopPrecedence['&lt;'] = 10;
- BinopPrecedence['+'] = 20;
- BinopPrecedence['-'] = 20;
- BinopPrecedence['*'] = 40; // highest.
-
- // Prime the first token.
- fprintf(stderr, "ready&gt; ");
- getNextToken();
-
- // Make the module, which holds all the code.
- TheModule = new Module("my cool jit");
-
- // Create the JIT.
- TheExecutionEngine = ExecutionEngine::create(TheModule);
-
- {
- ExistingModuleProvider OurModuleProvider(TheModule);
- FunctionPassManager OurFPM(&amp;OurModuleProvider);
-
- // Set up the optimizer pipeline. Start with registering info about how the
- // target lays out data structures.
- OurFPM.add(new TargetData(*TheExecutionEngine-&gt;getTargetData()));
- // Promote allocas to registers.
- OurFPM.add(createPromoteMemoryToRegisterPass());
- // Do simple "peephole" optimizations and bit-twiddling optzns.
- OurFPM.add(createInstructionCombiningPass());
- // Reassociate expressions.
- OurFPM.add(createReassociatePass());
- // Eliminate Common SubExpressions.
- OurFPM.add(createGVNPass());
- // Simplify the control flow graph (deleting unreachable blocks, etc).
- OurFPM.add(createCFGSimplificationPass());
-
- // Set the global so the code gen can use this.
- TheFPM = &amp;OurFPM;
-
- // Run the main "interpreter loop" now.
- MainLoop();
-
- TheFPM = 0;
-
- // Print out all of the generated code.
- TheModule-&gt;dump();
-
- } // Free module provider (and thus the module) and pass manager.
-
- return 0;
-}
-</pre>
-</div>
-
-<a href="LangImpl8.html">Next: Conclusion and other useful LLVM tidbits</a>
-</div>
-
-<!-- *********************************************************************** -->
-<hr>
-<address>
- <a href="http://jigsaw.w3.org/css-validator/check/referer"><img
- src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"></a>
- <a href="http://validator.w3.org/check/referer"><img
- src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!"></a>
-
- <a href="mailto:sabre@nondot.org">Chris Lattner</a><br>
- <a href="http://llvm.org">The LLVM Compiler Infrastructure</a><br>
- Last modified: $Date: 2007-10-17 11:05:13 -0700 (Wed, 17 Oct 2007) $
-</address>
-</body>
-</html>
diff --git a/release_23/docs/tutorial/LangImpl8.html b/release_23/docs/tutorial/LangImpl8.html
deleted file mode 100644
index 855b8f3692bf..000000000000
--- a/release_23/docs/tutorial/LangImpl8.html
+++ /dev/null
@@ -1,365 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
- "http://www.w3.org/TR/html4/strict.dtd">
-
-<html>
-<head>
- <title>Kaleidoscope: Conclusion and other useful LLVM tidbits</title>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <meta name="author" content="Chris Lattner">
- <link rel="stylesheet" href="../llvm.css" type="text/css">
-</head>
-
-<body>
-
-<div class="doc_title">Kaleidoscope: Conclusion and other useful LLVM
- tidbits</div>
-
-<ul>
-<li><a href="index.html">Up to Tutorial Index</a></li>
-<li>Chapter 8
- <ol>
- <li><a href="#conclusion">Tutorial Conclusion</a></li>
- <li><a href="#llvmirproperties">Properties of LLVM IR</a>
- <ul>
- <li><a href="#targetindep">Target Independence</a></li>
- <li><a href="#safety">Safety Guarantees</a></li>
- <li><a href="#langspecific">Language-Specific Optimizations</a></li>
- </ul>
- </li>
- <li><a href="#tipsandtricks">Tips and Tricks</a>
- <ul>
- <li><a href="#offsetofsizeof">Implementing portable
- offsetof/sizeof</a></li>
- <li><a href="#gcstack">Garbage Collected Stack Frames</a></li>
- </ul>
- </li>
- </ol>
-</li>
-</ul>
-
-
-<div class="doc_author">
- <p>Written by <a href="mailto:sabre@nondot.org">Chris Lattner</a></p>
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section"><a name="conclusion">Tutorial Conclusion</a></div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>Welcome to the the final chapter of the "<a href="index.html">Implementing a
-language with LLVM</a>" tutorial. In the course of this tutorial, we have grown
-our little Kaleidoscope language from being a useless toy, to being a
-semi-interesting (but probably still useless) toy. :)</p>
-
-<p>It is interesting to see how far we've come, and how little code it has
-taken. We built the entire lexer, parser, AST, code generator, and an
-interactive run-loop (with a JIT!) by-hand in under 700 lines of
-(non-comment/non-blank) code.</p>
-
-<p>Our little language supports a couple of interesting features: it supports
-user defined binary and unary operators, it uses JIT compilation for immediate
-evaluation, and it supports a few control flow constructs with SSA construction.
-</p>
-
-<p>Part of the idea of this tutorial was to show you how easy and fun it can be
-to define, build, and play with languages. Building a compiler need not be a
-scary or mystical process! Now that you've seen some of the basics, I strongly
-encourage you to take the code and hack on it. For example, try adding:</p>
-
-<ul>
-<li><b>global variables</b> - While global variables have questional value in
-modern software engineering, they are often useful when putting together quick
-little hacks like the Kaleidoscope compiler itself. Fortunately, our current
-setup makes it very easy to add global variables: just have value lookup check
-to see if an unresolved variable is in the global variable symbol table before
-rejecting it. To create a new global variable, make an instance of the LLVM
-<tt>GlobalVariable</tt> class.</li>
-
-<li><b>typed variables</b> - Kaleidoscope currently only supports variables of
-type double. This gives the language a very nice elegance, because only
-supporting one type means that you never have to specify types. Different
-languages have different ways of handling this. The easiest way is to require
-the user to specify types for every variable definition, and record the type
-of the variable in the symbol table along with its Value*.</li>
-
-<li><b>arrays, structs, vectors, etc</b> - Once you add types, you can start
-extending the type system in all sorts of interesting ways. Simple arrays are
-very easy and are quite useful for many different applications. Adding them is
-mostly an exercise in learning how the LLVM <a
-href="../LangRef.html#i_getelementptr">getelementptr</a> instruction works: it
-is so nifty/unconventional, it <a
-href="../GetElementPtr.html">has its own FAQ</a>! If you add support
-for recursive types (e.g. linked lists), make sure to read the <a
-href="../ProgrammersManual.html#TypeResolve">section in the LLVM
-Programmer's Manual</a> that describes how to construct them.</li>
-
-<li><b>standard runtime</b> - Our current language allows the user to access
-arbitrary external functions, and we use it for things like "printd" and
-"putchard". As you extend the language to add higher-level constructs, often
-these constructs make the most sense if they are lowered to calls into a
-language-supplied runtime. For example, if you add hash tables to the language,
-it would probably make sense to add the routines to a runtime, instead of
-inlining them all the way.</li>
-
-<li><b>memory management</b> - Currently we can only access the stack in
-Kaleidoscope. It would also be useful to be able to allocate heap memory,
-either with calls to the standard libc malloc/free interface or with a garbage
-collector. If you would like to use garbage collection, note that LLVM fully
-supports <a href="../GarbageCollection.html">Accurate Garbage Collection</a>
-including algorithms that move objects and need to scan/update the stack.</li>
-
-<li><b>debugger support</b> - LLVM supports generation of <a
-href="../SourceLevelDebugging.html">DWARF Debug info</a> which is understood by
-common debuggers like GDB. Adding support for debug info is fairly
-straightforward. The best way to understand it is to compile some C/C++ code
-with "<tt>llvm-gcc -g -O0</tt>" and taking a look at what it produces.</li>
-
-<li><b>exception handling support</b> - LLVM supports generation of <a
-href="../ExceptionHandling.html">zero cost exceptions</a> which interoperate
-with code compiled in other languages. You could also generate code by
-implicitly making every function return an error value and checking it. You
-could also make explicit use of setjmp/longjmp. There are many different ways
-to go here.</li>
-
-<li><b>object orientation, generics, database access, complex numbers,
-geometric programming, ...</b> - Really, there is
-no end of crazy features that you can add to the language.</li>
-
-<li><b>unusual domains</b> - We've been talking about applying LLVM to a domain
-that many people are interested in: building a compiler for a specific language.
-However, there are many other domains that can use compiler technology that are
-not typically considered. For example, LLVM has been used to implement OpenGL
-graphics acceleration, translate C++ code to ActionScript, and many other
-cute and clever things. Maybe you will be the first to JIT compile a regular
-expression interpreter into native code with LLVM?</li>
-
-</ul>
-
-<p>
-Have fun - try doing something crazy and unusual. Building a language like
-everyone else always has, is much less fun than trying something a little crazy
-or off the wall and seeing how it turns out. If you get stuck or want to talk
-about it, feel free to email the <a
-href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev">llvmdev mailing
-list</a>: it has lots of people who are interested in languages and are often
-willing to help out.
-</p>
-
-<p>Before we end this tutorial, I want to talk about some "tips and tricks" for generating
-LLVM IR. These are some of the more subtle things that may not be obvious, but
-are very useful if you want to take advantage of LLVM's capabilities.</p>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section"><a name="llvmirproperties">Properties of the LLVM
-IR</a></div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>We have a couple common questions about code in the LLVM IR form - lets just
-get these out of the way right now, shall we?</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsubsection"><a name="targetindep">Target
-Independence</a></div>
-<!-- ======================================================================= -->
-
-<div class="doc_text">
-
-<p>Kaleidoscope is an example of a "portable language": any program written in
-Kaleidoscope will work the same way on any target that it runs on. Many other
-languages have this property, e.g. lisp, java, haskell, javascript, python, etc
-(note that while these languages are portable, not all their libraries are).</p>
-
-<p>One nice aspect of LLVM is that it is often capable of preserving target
-independence in the IR: you can take the LLVM IR for a Kaleidoscope-compiled
-program and run it on any target that LLVM supports, even emitting C code and
-compiling that on targets that LLVM doesn't support natively. You can trivially
-tell that the Kaleidoscope compiler generates target-independent code because it
-never queries for any target-specific information when generating code.</p>
-
-<p>The fact that LLVM provides a compact, target-independent, representation for
-code gets a lot of people excited. Unfortunately, these people are usually
-thinking about C or a language from the C family when they are asking questions
-about language portability. I say "unfortunately", because there is really no
-way to make (fully general) C code portable, other than shipping the source code
-around (and of course, C source code is not actually portable in general
-either - ever port a really old application from 32- to 64-bits?).</p>
-
-<p>The problem with C (again, in its full generality) is that it is heavily
-laden with target specific assumptions. As one simple example, the preprocessor
-often destructively removes target-independence from the code when it processes
-the input text:</p>
-
-<div class="doc_code">
-<pre>
-#ifdef __i386__
- int X = 1;
-#else
- int X = 42;
-#endif
-</pre>
-</div>
-
-<p>While it is possible to engineer more and more complex solutions to problems
-like this, it cannot be solved in full generality in a way that is better than shipping
-the actual source code.</p>
-
-<p>That said, there are interesting subsets of C that can be made portable. If
-you are willing to fix primitive types to a fixed size (say int = 32-bits,
-and long = 64-bits), don't care about ABI compatibility with existing binaries,
-and are willing to give up some other minor features, you can have portable
-code. This can make sense for specialized domains such as an
-in-kernel language.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsubsection"><a name="safety">Safety Guarantees</a></div>
-<!-- ======================================================================= -->
-
-<div class="doc_text">
-
-<p>Many of the languages above are also "safe" languages: it is impossible for
-a program written in Java to corrupt its address space and crash the process
-(assuming the JVM has no bugs).
-Safety is an interesting property that requires a combination of language
-design, runtime support, and often operating system support.</p>
-
-<p>It is certainly possible to implement a safe language in LLVM, but LLVM IR
-does not itself guarantee safety. The LLVM IR allows unsafe pointer casts,
-use after free bugs, buffer over-runs, and a variety of other problems. Safety
-needs to be implemented as a layer on top of LLVM and, conveniently, several
-groups have investigated this. Ask on the <a
-href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev">llvmdev mailing
-list</a> if you are interested in more details.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsubsection"><a name="langspecific">Language-Specific
-Optimizations</a></div>
-<!-- ======================================================================= -->
-
-<div class="doc_text">
-
-<p>One thing about LLVM that turns off many people is that it does not solve all
-the world's problems in one system (sorry 'world hunger', someone else will have
-to solve you some other day). One specific complaint is that people perceive
-LLVM as being incapable of performing high-level language-specific optimization:
-LLVM "loses too much information".</p>
-
-<p>Unfortunately, this is really not the place to give you a full and unified
-version of "Chris Lattner's theory of compiler design". Instead, I'll make a
-few observations:</p>
-
-<p>First, you're right that LLVM does lose information. For example, as of this
-writing, there is no way to distinguish in the LLVM IR whether an SSA-value came
-from a C "int" or a C "long" on an ILP32 machine (other than debug info). Both
-get compiled down to an 'i32' value and the information about what it came from
-is lost. The more general issue here, is that the LLVM type system uses
-"structural equivalence" instead of "name equivalence". Another place this
-surprises people is if you have two types in a high-level language that have the
-same structure (e.g. two different structs that have a single int field): these
-types will compile down into a single LLVM type and it will be impossible to
-tell what it came from.</p>
-
-<p>Second, while LLVM does lose information, LLVM is not a fixed target: we
-continue to enhance and improve it in many different ways. In addition to
-adding new features (LLVM did not always support exceptions or debug info), we
-also extend the IR to capture important information for optimization (e.g.
-whether an argument is sign or zero extended, information about pointers
-aliasing, etc). Many of the enhancements are user-driven: people want LLVM to
-include some specific feature, so they go ahead and extend it.</p>
-
-<p>Third, it is <em>possible and easy</em> to add language-specific
-optimizations, and you have a number of choices in how to do it. As one trivial
-example, it is easy to add language-specific optimization passes that
-"know" things about code compiled for a language. In the case of the C family,
-there is an optimization pass that "knows" about the standard C library
-functions. If you call "exit(0)" in main(), it knows that it is safe to
-optimize that into "return 0;" because C specifies what the 'exit'
-function does.</p>
-
-<p>In addition to simple library knowledge, it is possible to embed a variety of
-other language-specific information into the LLVM IR. If you have a specific
-need and run into a wall, please bring the topic up on the llvmdev list. At the
-very worst, you can always treat LLVM as if it were a "dumb code generator" and
-implement the high-level optimizations you desire in your front-end, on the
-language-specific AST.
-</p>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section"><a name="tipsandtricks">Tips and Tricks</a></div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>There is a variety of useful tips and tricks that you come to know after
-working on/with LLVM that aren't obvious at first glance. Instead of letting
-everyone rediscover them, this section talks about some of these issues.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsubsection"><a name="offsetofsizeof">Implementing portable
-offsetof/sizeof</a></div>
-<!-- ======================================================================= -->
-
-<div class="doc_text">
-
-<p>One interesting thing that comes up, if you are trying to keep the code
-generated by your compiler "target independent", is that you often need to know
-the size of some LLVM type or the offset of some field in an llvm structure.
-For example, you might need to pass the size of a type into a function that
-allocates memory.</p>
-
-<p>Unfortunately, this can vary widely across targets: for example the width of
-a pointer is trivially target-specific. However, there is a <a
-href="http://nondot.org/sabre/LLVMNotes/SizeOf-OffsetOf-VariableSizedStructs.txt">clever
-way to use the getelementptr instruction</a> that allows you to compute this
-in a portable way.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsubsection"><a name="gcstack">Garbage Collected
-Stack Frames</a></div>
-<!-- ======================================================================= -->
-
-<div class="doc_text">
-
-<p>Some languages want to explicitly manage their stack frames, often so that
-they are garbage collected or to allow easy implementation of closures. There
-are often better ways to implement these features than explicit stack frames,
-but <a
-href="http://nondot.org/sabre/LLVMNotes/ExplicitlyManagedStackFrames.txt">LLVM
-does support them,</a> if you want. It requires your front-end to convert the
-code into <a
-href="http://en.wikipedia.org/wiki/Continuation-passing_style">Continuation
-Passing Style</a> and the use of tail calls (which LLVM also supports).</p>
-
-</div>
-
-<!-- *********************************************************************** -->
-<hr>
-<address>
- <a href="http://jigsaw.w3.org/css-validator/check/referer"><img
- src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"></a>
- <a href="http://validator.w3.org/check/referer"><img
- src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!"></a>
-
- <a href="mailto:sabre@nondot.org">Chris Lattner</a><br>
- <a href="http://llvm.org">The LLVM Compiler Infrastructure</a><br>
- Last modified: $Date: 2007-10-17 11:05:13 -0700 (Wed, 17 Oct 2007) $
-</address>
-</body>
-</html>
diff --git a/release_23/docs/tutorial/Makefile b/release_23/docs/tutorial/Makefile
deleted file mode 100644
index 6169bb82416b..000000000000
--- a/release_23/docs/tutorial/Makefile
+++ /dev/null
@@ -1,28 +0,0 @@
-##===- docs/tutorial/Makefile ------------------------------*- Makefile -*-===##
-#
-# The LLVM Compiler Infrastructure
-#
-# This file is distributed under the University of Illinois Open Source
-# License. See LICENSE.TXT for details.
-#
-##===----------------------------------------------------------------------===##
-
-LEVEL := ../..
-include $(LEVEL)/Makefile.common
-
-HTML := $(wildcard $(PROJ_SRC_DIR)/*.html)
-EXTRA_DIST := $(HTML) index.html
-HTML_DIR := $(PROJ_docsdir)/html/tutorial
-
-install-local:: $(HTML)
- $(Echo) Installing HTML Tutorial Documentation
- $(Verb) $(MKDIR) $(HTML_DIR)
- $(Verb) $(DataInstall) $(HTML) $(HTML_DIR)
- $(Verb) $(DataInstall) $(PROJ_SRC_DIR)/index.html $(HTML_DIR)
-
-uninstall-local::
- $(Echo) Uninstalling Tutorial Documentation
- $(Verb) $(RM) -rf $(HTML_DIR)
-
-printvars::
- $(Echo) "HTML : " '$(HTML)'
diff --git a/release_23/docs/tutorial/OCamlLangImpl1.html b/release_23/docs/tutorial/OCamlLangImpl1.html
deleted file mode 100644
index c7b0954021e3..000000000000
--- a/release_23/docs/tutorial/OCamlLangImpl1.html
+++ /dev/null
@@ -1,365 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
- "http://www.w3.org/TR/html4/strict.dtd">
-
-<html>
-<head>
- <title>Kaleidoscope: Tutorial Introduction and the Lexer</title>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <meta name="author" content="Chris Lattner">
- <meta name="author" content="Erick Tryzelaar">
- <link rel="stylesheet" href="../llvm.css" type="text/css">
-</head>
-
-<body>
-
-<div class="doc_title">Kaleidoscope: Tutorial Introduction and the Lexer</div>
-
-<ul>
-<li><a href="index.html">Up to Tutorial Index</a></li>
-<li>Chapter 1
- <ol>
- <li><a href="#intro">Tutorial Introduction</a></li>
- <li><a href="#language">The Basic Language</a></li>
- <li><a href="#lexer">The Lexer</a></li>
- </ol>
-</li>
-<li><a href="OCamlLangImpl2.html">Chapter 2</a>: Implementing a Parser and
-AST</li>
-</ul>
-
-<div class="doc_author">
- <p>
- Written by <a href="mailto:sabre@nondot.org">Chris Lattner</a>
- and <a href="mailto:idadesub@users.sourceforge.net">Erick Tryzelaar</a>
- </p>
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section"><a name="intro">Tutorial Introduction</a></div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>Welcome to the "Implementing a language with LLVM" tutorial. This tutorial
-runs through the implementation of a simple language, showing how fun and
-easy it can be. This tutorial will get you up and started as well as help to
-build a framework you can extend to other languages. The code in this tutorial
-can also be used as a playground to hack on other LLVM specific things.
-</p>
-
-<p>
-The goal of this tutorial is to progressively unveil our language, describing
-how it is built up over time. This will let us cover a fairly broad range of
-language design and LLVM-specific usage issues, showing and explaining the code
-for it all along the way, without overwhelming you with tons of details up
-front.</p>
-
-<p>It is useful to point out ahead of time that this tutorial is really about
-teaching compiler techniques and LLVM specifically, <em>not</em> about teaching
-modern and sane software engineering principles. In practice, this means that
-we'll take a number of shortcuts to simplify the exposition. For example, the
-code leaks memory, uses global variables all over the place, doesn't use nice
-design patterns like <a
-href="http://en.wikipedia.org/wiki/Visitor_pattern">visitors</a>, etc... but it
-is very simple. If you dig in and use the code as a basis for future projects,
-fixing these deficiencies shouldn't be hard.</p>
-
-<p>I've tried to put this tutorial together in a way that makes chapters easy to
-skip over if you are already familiar with or are uninterested in the various
-pieces. The structure of the tutorial is:
-</p>
-
-<ul>
-<li><b><a href="#language">Chapter #1</a>: Introduction to the Kaleidoscope
-language, and the definition of its Lexer</b> - This shows where we are going
-and the basic functionality that we want it to do. In order to make this
-tutorial maximally understandable and hackable, we choose to implement
-everything in Objective Caml instead of using lexer and parser generators.
-LLVM obviously works just fine with such tools, feel free to use one if you
-prefer.</li>
-<li><b><a href="OCamlLangImpl2.html">Chapter #2</a>: Implementing a Parser and
-AST</b> - With the lexer in place, we can talk about parsing techniques and
-basic AST construction. This tutorial describes recursive descent parsing and
-operator precedence parsing. Nothing in Chapters 1 or 2 is LLVM-specific,
-the code doesn't even link in LLVM at this point. :)</li>
-<li><b><a href="OCamlLangImpl3.html">Chapter #3</a>: Code generation to LLVM
-IR</b> - With the AST ready, we can show off how easy generation of LLVM IR
-really is.</li>
-<li><b><a href="OCamlLangImpl4.html">Chapter #4</a>: Adding JIT and Optimizer
-Support</b> - Because a lot of people are interested in using LLVM as a JIT,
-we'll dive right into it and show you the 3 lines it takes to add JIT support.
-LLVM is also useful in many other ways, but this is one simple and "sexy" way
-to shows off its power. :)</li>
-<li><b><a href="OCamlLangImpl5.html">Chapter #5</a>: Extending the Language:
-Control Flow</b> - With the language up and running, we show how to extend it
-with control flow operations (if/then/else and a 'for' loop). This gives us a
-chance to talk about simple SSA construction and control flow.</li>
-<li><b><a href="OCamlLangImpl6.html">Chapter #6</a>: Extending the Language:
-User-defined Operators</b> - This is a silly but fun chapter that talks about
-extending the language to let the user program define their own arbitrary
-unary and binary operators (with assignable precedence!). This lets us build a
-significant piece of the "language" as library routines.</li>
-<li><b><a href="OCamlLangImpl7.html">Chapter #7</a>: Extending the Language:
-Mutable Variables</b> - This chapter talks about adding user-defined local
-variables along with an assignment operator. The interesting part about this
-is how easy and trivial it is to construct SSA form in LLVM: no, LLVM does
-<em>not</em> require your front-end to construct SSA form!</li>
-<li><b><a href="OCamlLangImpl8.html">Chapter #8</a>: Conclusion and other
-useful LLVM tidbits</b> - This chapter wraps up the series by talking about
-potential ways to extend the language, but also includes a bunch of pointers to
-info about "special topics" like adding garbage collection support, exceptions,
-debugging, support for "spaghetti stacks", and a bunch of other tips and
-tricks.</li>
-
-</ul>
-
-<p>By the end of the tutorial, we'll have written a bit less than 700 lines of
-non-comment, non-blank, lines of code. With this small amount of code, we'll
-have built up a very reasonable compiler for a non-trivial language including
-a hand-written lexer, parser, AST, as well as code generation support with a JIT
-compiler. While other systems may have interesting "hello world" tutorials,
-I think the breadth of this tutorial is a great testament to the strengths of
-LLVM and why you should consider it if you're interested in language or compiler
-design.</p>
-
-<p>A note about this tutorial: we expect you to extend the language and play
-with it on your own. Take the code and go crazy hacking away at it, compilers
-don't need to be scary creatures - it can be a lot of fun to play with
-languages!</p>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section"><a name="language">The Basic Language</a></div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>This tutorial will be illustrated with a toy language that we'll call
-"<a href="http://en.wikipedia.org/wiki/Kaleidoscope">Kaleidoscope</a>" (derived
-from "meaning beautiful, form, and view").
-Kaleidoscope is a procedural language that allows you to define functions, use
-conditionals, math, etc. Over the course of the tutorial, we'll extend
-Kaleidoscope to support the if/then/else construct, a for loop, user defined
-operators, JIT compilation with a simple command line interface, etc.</p>
-
-<p>Because we want to keep things simple, the only datatype in Kaleidoscope is a
-64-bit floating point type (aka 'float' in O'Caml parlance). As such, all
-values are implicitly double precision and the language doesn't require type
-declarations. This gives the language a very nice and simple syntax. For
-example, the following simple example computes <a
-href="http://en.wikipedia.org/wiki/Fibonacci_number">Fibonacci numbers:</a></p>
-
-<div class="doc_code">
-<pre>
-# Compute the x'th fibonacci number.
-def fib(x)
- if x &lt; 3 then
- 1
- else
- fib(x-1)+fib(x-2)
-
-# This expression will compute the 40th number.
-fib(40)
-</pre>
-</div>
-
-<p>We also allow Kaleidoscope to call into standard library functions (the LLVM
-JIT makes this completely trivial). This means that you can use the 'extern'
-keyword to define a function before you use it (this is also useful for mutually
-recursive functions). For example:</p>
-
-<div class="doc_code">
-<pre>
-extern sin(arg);
-extern cos(arg);
-extern atan2(arg1 arg2);
-
-atan2(sin(.4), cos(42))
-</pre>
-</div>
-
-<p>A more interesting example is included in Chapter 6 where we write a little
-Kaleidoscope application that <a href="OCamlLangImpl6.html#example">displays
-a Mandelbrot Set</a> at various levels of magnification.</p>
-
-<p>Lets dive into the implementation of this language!</p>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section"><a name="lexer">The Lexer</a></div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>When it comes to implementing a language, the first thing needed is
-the ability to process a text file and recognize what it says. The traditional
-way to do this is to use a "<a
-href="http://en.wikipedia.org/wiki/Lexical_analysis">lexer</a>" (aka 'scanner')
-to break the input up into "tokens". Each token returned by the lexer includes
-a token code and potentially some metadata (e.g. the numeric value of a number).
-First, we define the possibilities:
-</p>
-
-<div class="doc_code">
-<pre>
-(* The lexer returns these 'Kwd' if it is an unknown character, otherwise one of
- * these others for known things. *)
-type token =
- (* commands *)
- | Def | Extern
-
- (* primary *)
- | Ident of string | Number of float
-
- (* unknown *)
- | Kwd of char
-</pre>
-</div>
-
-<p>Each token returned by our lexer will be one of the token variant values.
-An unknown character like '+' will be returned as <tt>Token.Kwd '+'</tt>. If
-the curr token is an identifier, the value will be <tt>Token.Ident s</tt>. If
-the current token is a numeric literal (like 1.0), the value will be
-<tt>Token.Number 1.0</tt>.
-</p>
-
-<p>The actual implementation of the lexer is a collection of functions driven
-by a function named <tt>Lexer.lex</tt>. The <tt>Lexer.lex</tt> function is
-called to return the next token from standard input. We will use
-<a href="http://caml.inria.fr/pub/docs/manual-camlp4/index.html">Camlp4</a>
-to simplify the tokenization of the standard input. Its definition starts
-as:</p>
-
-<div class="doc_code">
-<pre>
-(*===----------------------------------------------------------------------===
- * Lexer
- *===----------------------------------------------------------------------===*)
-
-let rec lex = parser
- (* Skip any whitespace. *)
- | [&lt; ' (' ' | '\n' | '\r' | '\t'); stream &gt;] -&gt; lex stream
-</pre>
-</div>
-
-<p>
-<tt>Lexer.lex</tt> works by recursing over a <tt>char Stream.t</tt> to read
-characters one at a time from the standard input. It eats them as it recognizes
-them and stores them in in a <tt>Token.token</tt> variant. The first thing that
-it has to do is ignore whitespace between tokens. This is accomplished with the
-recursive call above.</p>
-
-<p>The next thing <tt>Lexer.lex</tt> needs to do is recognize identifiers and
-specific keywords like "def". Kaleidoscope does this with this a pattern match
-and a helper function.<p>
-
-<div class="doc_code">
-<pre>
- (* identifier: [a-zA-Z][a-zA-Z0-9] *)
- | [&lt; ' ('A' .. 'Z' | 'a' .. 'z' as c); stream &gt;] -&gt;
- let buffer = Buffer.create 1 in
- Buffer.add_char buffer c;
- lex_ident buffer stream
-
-...
-
-and lex_ident buffer = parser
- | [&lt; ' ('A' .. 'Z' | 'a' .. 'z' | '0' .. '9' as c); stream &gt;] -&gt;
- Buffer.add_char buffer c;
- lex_ident buffer stream
- | [&lt; stream=lex &gt;] -&gt;
- match Buffer.contents buffer with
- | "def" -&gt; [&lt; 'Token.Def; stream &gt;]
- | "extern" -&gt; [&lt; 'Token.Extern; stream &gt;]
- | id -&gt; [&lt; 'Token.Ident id; stream &gt;]
-</pre>
-</div>
-
-Numeric values are similar:</p>
-
-<div class="doc_code">
-<pre>
- (* number: [0-9.]+ *)
- | [&lt; ' ('0' .. '9' as c); stream &gt;] -&gt;
- let buffer = Buffer.create 1 in
- Buffer.add_char buffer c;
- lex_number buffer stream
-
-...
-
-and lex_number buffer = parser
- | [&lt; ' ('0' .. '9' | '.' as c); stream &gt;] -&gt;
- Buffer.add_char buffer c;
- lex_number buffer stream
- | [&lt; stream=lex &gt;] -&gt;
- [&lt; 'Token.Number (float_of_string (Buffer.contents buffer)); stream &gt;]
-</pre>
-</div>
-
-<p>This is all pretty straight-forward code for processing input. When reading
-a numeric value from input, we use the ocaml <tt>float_of_string</tt> function
-to convert it to a numeric value that we store in <tt>Token.Number</tt>. Note
-that this isn't doing sufficient error checking: it will raise <tt>Failure</tt>
-if the string "1.23.45.67". Feel free to extend it :). Next we handle
-comments:
-</p>
-
-<div class="doc_code">
-<pre>
- (* Comment until end of line. *)
- | [&lt; ' ('#'); stream &gt;] -&gt;
- lex_comment stream
-
-...
-
-and lex_comment = parser
- | [&lt; ' ('\n'); stream=lex &gt;] -&gt; stream
- | [&lt; 'c; e=lex_comment &gt;] -&gt; e
- | [&lt; &gt;] -&gt; [&lt; &gt;]
-</pre>
-</div>
-
-<p>We handle comments by skipping to the end of the line and then return the
-next token. Finally, if the input doesn't match one of the above cases, it is
-either an operator character like '+' or the end of the file. These are handled
-with this code:</p>
-
-<div class="doc_code">
-<pre>
- (* Otherwise, just return the character as its ascii value. *)
- | [&lt; 'c; stream &gt;] -&gt;
- [&lt; 'Token.Kwd c; lex stream &gt;]
-
- (* end of stream. *)
- | [&lt; &gt;] -&gt; [&lt; &gt;]
-</pre>
-</div>
-
-<p>With this, we have the complete lexer for the basic Kaleidoscope language
-(the <a href="OCamlLangImpl2.html#code">full code listing</a> for the Lexer is
-available in the <a href="OCamlLangImpl2.html">next chapter</a> of the
-tutorial). Next we'll <a href="OCamlLangImpl2.html">build a simple parser that
-uses this to build an Abstract Syntax Tree</a>. When we have that, we'll
-include a driver so that you can use the lexer and parser together.
-</p>
-
-<a href="OCamlLangImpl2.html">Next: Implementing a Parser and AST</a>
-</div>
-
-<!-- *********************************************************************** -->
-<hr>
-<address>
- <a href="http://jigsaw.w3.org/css-validator/check/referer"><img
- src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"></a>
- <a href="http://validator.w3.org/check/referer"><img
- src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!"></a>
-
- <a href="mailto:sabre@nondot.org">Chris Lattner</a><br>
- <a href="mailto:idadesub@users.sourceforge.net">Erick Tryzelaar</a><br>
- <a href="http://llvm.org">The LLVM Compiler Infrastructure</a><br>
- Last modified: $Date: 2007-10-17 11:05:13 -0700 (Wed, 17 Oct 2007) $
-</address>
-</body>
-</html>
diff --git a/release_23/docs/tutorial/OCamlLangImpl2.html b/release_23/docs/tutorial/OCamlLangImpl2.html
deleted file mode 100644
index 7d60aa6f9fdf..000000000000
--- a/release_23/docs/tutorial/OCamlLangImpl2.html
+++ /dev/null
@@ -1,1045 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
- "http://www.w3.org/TR/html4/strict.dtd">
-
-<html>
-<head>
- <title>Kaleidoscope: Implementing a Parser and AST</title>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <meta name="author" content="Chris Lattner">
- <meta name="author" content="Erick Tryzelaar">
- <link rel="stylesheet" href="../llvm.css" type="text/css">
-</head>
-
-<body>
-
-<div class="doc_title">Kaleidoscope: Implementing a Parser and AST</div>
-
-<ul>
-<li><a href="index.html">Up to Tutorial Index</a></li>
-<li>Chapter 2
- <ol>
- <li><a href="#intro">Chapter 2 Introduction</a></li>
- <li><a href="#ast">The Abstract Syntax Tree (AST)</a></li>
- <li><a href="#parserbasics">Parser Basics</a></li>
- <li><a href="#parserprimexprs">Basic Expression Parsing</a></li>
- <li><a href="#parserbinops">Binary Expression Parsing</a></li>
- <li><a href="#parsertop">Parsing the Rest</a></li>
- <li><a href="#driver">The Driver</a></li>
- <li><a href="#conclusions">Conclusions</a></li>
- <li><a href="#code">Full Code Listing</a></li>
- </ol>
-</li>
-<li><a href="OCamlLangImpl3.html">Chapter 3</a>: Code generation to LLVM IR</li>
-</ul>
-
-<div class="doc_author">
- <p>
- Written by <a href="mailto:sabre@nondot.org">Chris Lattner</a>
- and <a href="mailto:idadesub@users.sourceforge.net">Erick Tryzelaar</a>
- </p>
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section"><a name="intro">Chapter 2 Introduction</a></div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>Welcome to Chapter 2 of the "<a href="index.html">Implementing a language
-with LLVM in Objective Caml</a>" tutorial. This chapter shows you how to use
-the lexer, built in <a href="OCamlLangImpl1.html">Chapter 1</a>, to build a
-full <a href="http://en.wikipedia.org/wiki/Parsing">parser</a> for our
-Kaleidoscope language. Once we have a parser, we'll define and build an <a
-href="http://en.wikipedia.org/wiki/Abstract_syntax_tree">Abstract Syntax
-Tree</a> (AST).</p>
-
-<p>The parser we will build uses a combination of <a
-href="http://en.wikipedia.org/wiki/Recursive_descent_parser">Recursive Descent
-Parsing</a> and <a href=
-"http://en.wikipedia.org/wiki/Operator-precedence_parser">Operator-Precedence
-Parsing</a> to parse the Kaleidoscope language (the latter for
-binary expressions and the former for everything else). Before we get to
-parsing though, lets talk about the output of the parser: the Abstract Syntax
-Tree.</p>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section"><a name="ast">The Abstract Syntax Tree (AST)</a></div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>The AST for a program captures its behavior in such a way that it is easy for
-later stages of the compiler (e.g. code generation) to interpret. We basically
-want one object for each construct in the language, and the AST should closely
-model the language. In Kaleidoscope, we have expressions, a prototype, and a
-function object. We'll start with expressions first:</p>
-
-<div class="doc_code">
-<pre>
-(* expr - Base type for all expression nodes. *)
-type expr =
- (* variant for numeric literals like "1.0". *)
- | Number of float
-</pre>
-</div>
-
-<p>The code above shows the definition of the base ExprAST class and one
-subclass which we use for numeric literals. The important thing to note about
-this code is that the Number variant captures the numeric value of the
-literal as an instance variable. This allows later phases of the compiler to
-know what the stored numeric value is.</p>
-
-<p>Right now we only create the AST, so there are no useful functions on
-them. It would be very easy to add a function to pretty print the code,
-for example. Here are the other expression AST node definitions that we'll use
-in the basic form of the Kaleidoscope language:
-</p>
-
-<div class="doc_code">
-<pre>
- (* variant for referencing a variable, like "a". *)
- | Variable of string
-
- (* variant for a binary operator. *)
- | Binary of char * expr * expr
-
- (* variant for function calls. *)
- | Call of string * expr array
-</pre>
-</div>
-
-<p>This is all (intentionally) rather straight-forward: variables capture the
-variable name, binary operators capture their opcode (e.g. '+'), and calls
-capture a function name as well as a list of any argument expressions. One thing
-that is nice about our AST is that it captures the language features without
-talking about the syntax of the language. Note that there is no discussion about
-precedence of binary operators, lexical structure, etc.</p>
-
-<p>For our basic language, these are all of the expression nodes we'll define.
-Because it doesn't have conditional control flow, it isn't Turing-complete;
-we'll fix that in a later installment. The two things we need next are a way
-to talk about the interface to a function, and a way to talk about functions
-themselves:</p>
-
-<div class="doc_code">
-<pre>
-(* proto - This type represents the "prototype" for a function, which captures
- * its name, and its argument names (thus implicitly the number of arguments the
- * function takes). *)
-type proto = Prototype of string * string array
-
-(* func - This type represents a function definition itself. *)
-type func = Function of proto * expr
-</pre>
-</div>
-
-<p>In Kaleidoscope, functions are typed with just a count of their arguments.
-Since all values are double precision floating point, the type of each argument
-doesn't need to be stored anywhere. In a more aggressive and realistic
-language, the "expr" variants would probably have a type field.</p>
-
-<p>With this scaffolding, we can now talk about parsing expressions and function
-bodies in Kaleidoscope.</p>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section"><a name="parserbasics">Parser Basics</a></div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>Now that we have an AST to build, we need to define the parser code to build
-it. The idea here is that we want to parse something like "x+y" (which is
-returned as three tokens by the lexer) into an AST that could be generated with
-calls like this:</p>
-
-<div class="doc_code">
-<pre>
- let x = Variable "x" in
- let y = Variable "y" in
- let result = Binary ('+', x, y) in
- ...
-</pre>
-</div>
-
-<p>
-The error handling routines make use of the builtin <tt>Stream.Failure</tt> and
-<tt>Stream.Error</tt>s. <tt>Stream.Failure</tt> is raised when the parser is
-unable to find any matching token in the first position of a pattern.
-<tt>Stream.Error</tt> is raised when the first token matches, but the rest do
-not. The error recovery in our parser will not be the best and is not
-particular user-friendly, but it will be enough for our tutorial. These
-exceptions make it easier to handle errors in routines that have various return
-types.</p>
-
-<p>With these basic types and exceptions, we can implement the first
-piece of our grammar: numeric literals.</p>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section"><a name="parserprimexprs">Basic Expression
- Parsing</a></div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>We start with numeric literals, because they are the simplest to process.
-For each production in our grammar, we'll define a function which parses that
-production. We call this class of expressions "primary" expressions, for
-reasons that will become more clear <a href="OCamlLangImpl6.html#unary">
-later in the tutorial</a>. In order to parse an arbitrary primary expression,
-we need to determine what sort of expression it is. For numeric literals, we
-have:</p>
-
-<div class="doc_code">
-<pre>
-(* primary
- * ::= identifier
- * ::= numberexpr
- * ::= parenexpr *)
-parse_primary = parser
- (* numberexpr ::= number *)
- | [&lt; 'Token.Number n &gt;] -&gt; Ast.Number n
-</pre>
-</div>
-
-<p>This routine is very simple: it expects to be called when the current token
-is a <tt>Token.Number</tt> token. It takes the current number value, creates
-a <tt>Ast.Number</tt> node, advances the lexer to the next token, and finally
-returns.</p>
-
-<p>There are some interesting aspects to this. The most important one is that
-this routine eats all of the tokens that correspond to the production and
-returns the lexer buffer with the next token (which is not part of the grammar
-production) ready to go. This is a fairly standard way to go for recursive
-descent parsers. For a better example, the parenthesis operator is defined like
-this:</p>
-
-<div class="doc_code">
-<pre>
- (* parenexpr ::= '(' expression ')' *)
- | [&lt; 'Token.Kwd '('; e=parse_expr; 'Token.Kwd ')' ?? "expected ')'" &gt;] -&gt; e
-</pre>
-</div>
-
-<p>This function illustrates a number of interesting things about the
-parser:</p>
-
-<p>
-1) It shows how we use the <tt>Stream.Error</tt> exception. When called, this
-function expects that the current token is a '(' token, but after parsing the
-subexpression, it is possible that there is no ')' waiting. For example, if
-the user types in "(4 x" instead of "(4)", the parser should emit an error.
-Because errors can occur, the parser needs a way to indicate that they
-happened. In our parser, we use the camlp4 shortcut syntax <tt>token ?? "parse
-error"</tt>, where if the token before the <tt>??</tt> does not match, then
-<tt>Stream.Error "parse error"</tt> will be raised.</p>
-
-<p>2) Another interesting aspect of this function is that it uses recursion by
-calling <tt>Parser.parse_primary</tt> (we will soon see that
-<tt>Parser.parse_primary</tt> can call <tt>Parser.parse_primary</tt>). This is
-powerful because it allows us to handle recursive grammars, and keeps each
-production very simple. Note that parentheses do not cause construction of AST
-nodes themselves. While we could do it this way, the most important role of
-parentheses are to guide the parser and provide grouping. Once the parser
-constructs the AST, parentheses are not needed.</p>
-
-<p>The next simple production is for handling variable references and function
-calls:</p>
-
-<div class="doc_code">
-<pre>
- (* identifierexpr
- * ::= identifier
- * ::= identifier '(' argumentexpr ')' *)
- | [&lt; 'Token.Ident id; stream &gt;] -&gt;
- let rec parse_args accumulator = parser
- | [&lt; e=parse_expr; stream &gt;] -&gt;
- begin parser
- | [&lt; 'Token.Kwd ','; e=parse_args (e :: accumulator) &gt;] -&gt; e
- | [&lt; &gt;] -&gt; e :: accumulator
- end stream
- | [&lt; &gt;] -&gt; accumulator
- in
- let rec parse_ident id = parser
- (* Call. *)
- | [&lt; 'Token.Kwd '(';
- args=parse_args [];
- 'Token.Kwd ')' ?? "expected ')'"&gt;] -&gt;
- Ast.Call (id, Array.of_list (List.rev args))
-
- (* Simple variable ref. *)
- | [&lt; &gt;] -&gt; Ast.Variable id
- in
- parse_ident id stream
-</pre>
-</div>
-
-<p>This routine follows the same style as the other routines. (It expects to be
-called if the current token is a <tt>Token.Ident</tt> token). It also has
-recursion and error handling. One interesting aspect of this is that it uses
-<em>look-ahead</em> to determine if the current identifier is a stand alone
-variable reference or if it is a function call expression. It handles this by
-checking to see if the token after the identifier is a '(' token, constructing
-either a <tt>Ast.Variable</tt> or <tt>Ast.Call</tt> node as appropriate.
-</p>
-
-<p>We finish up by raising an exception if we received a token we didn't
-expect:</p>
-
-<div class="doc_code">
-<pre>
- | [&lt; &gt;] -&gt; raise (Stream.Error "unknown token when expecting an expression.")
-</pre>
-</div>
-
-<p>Now that basic expressions are handled, we need to handle binary expressions.
-They are a bit more complex.</p>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section"><a name="parserbinops">Binary Expression
- Parsing</a></div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>Binary expressions are significantly harder to parse because they are often
-ambiguous. For example, when given the string "x+y*z", the parser can choose
-to parse it as either "(x+y)*z" or "x+(y*z)". With common definitions from
-mathematics, we expect the later parse, because "*" (multiplication) has
-higher <em>precedence</em> than "+" (addition).</p>
-
-<p>There are many ways to handle this, but an elegant and efficient way is to
-use <a href=
-"http://en.wikipedia.org/wiki/Operator-precedence_parser">Operator-Precedence
-Parsing</a>. This parsing technique uses the precedence of binary operators to
-guide recursion. To start with, we need a table of precedences:</p>
-
-<div class="doc_code">
-<pre>
-(* binop_precedence - This holds the precedence for each binary operator that is
- * defined *)
-let binop_precedence:(char, int) Hashtbl.t = Hashtbl.create 10
-
-(* precedence - Get the precedence of the pending binary operator token. *)
-let precedence c = try Hashtbl.find binop_precedence c with Not_found -&gt; -1
-
-...
-
-let main () =
- (* Install standard binary operators.
- * 1 is the lowest precedence. *)
- Hashtbl.add Parser.binop_precedence '&lt;' 10;
- Hashtbl.add Parser.binop_precedence '+' 20;
- Hashtbl.add Parser.binop_precedence '-' 20;
- Hashtbl.add Parser.binop_precedence '*' 40; (* highest. *)
- ...
-</pre>
-</div>
-
-<p>For the basic form of Kaleidoscope, we will only support 4 binary operators
-(this can obviously be extended by you, our brave and intrepid reader). The
-<tt>Parser.precedence</tt> function returns the precedence for the current
-token, or -1 if the token is not a binary operator. Having a <tt>Hashtbl.t</tt>
-makes it easy to add new operators and makes it clear that the algorithm doesn't
-depend on the specific operators involved, but it would be easy enough to
-eliminate the <tt>Hashtbl.t</tt> and do the comparisons in the
-<tt>Parser.precedence</tt> function. (Or just use a fixed-size array).</p>
-
-<p>With the helper above defined, we can now start parsing binary expressions.
-The basic idea of operator precedence parsing is to break down an expression
-with potentially ambiguous binary operators into pieces. Consider ,for example,
-the expression "a+b+(c+d)*e*f+g". Operator precedence parsing considers this
-as a stream of primary expressions separated by binary operators. As such,
-it will first parse the leading primary expression "a", then it will see the
-pairs [+, b] [+, (c+d)] [*, e] [*, f] and [+, g]. Note that because parentheses
-are primary expressions, the binary expression parser doesn't need to worry
-about nested subexpressions like (c+d) at all.
-</p>
-
-<p>
-To start, an expression is a primary expression potentially followed by a
-sequence of [binop,primaryexpr] pairs:</p>
-
-<div class="doc_code">
-<pre>
-(* expression
- * ::= primary binoprhs *)
-and parse_expr = parser
- | [&lt; lhs=parse_primary; stream &gt;] -&gt; parse_bin_rhs 0 lhs stream
-</pre>
-</div>
-
-<p><tt>Parser.parse_bin_rhs</tt> is the function that parses the sequence of
-pairs for us. It takes a precedence and a pointer to an expression for the part
-that has been parsed so far. Note that "x" is a perfectly valid expression: As
-such, "binoprhs" is allowed to be empty, in which case it returns the expression
-that is passed into it. In our example above, the code passes the expression for
-"a" into <tt>Parser.parse_bin_rhs</tt> and the current token is "+".</p>
-
-<p>The precedence value passed into <tt>Parser.parse_bin_rhs</tt> indicates the
-<em>minimal operator precedence</em> that the function is allowed to eat. For
-example, if the current pair stream is [+, x] and <tt>Parser.parse_bin_rhs</tt>
-is passed in a precedence of 40, it will not consume any tokens (because the
-precedence of '+' is only 20). With this in mind, <tt>Parser.parse_bin_rhs</tt>
-starts with:</p>
-
-<div class="doc_code">
-<pre>
-(* binoprhs
- * ::= ('+' primary)* *)
-and parse_bin_rhs expr_prec lhs stream =
- match Stream.peek stream with
- (* If this is a binop, find its precedence. *)
- | Some (Token.Kwd c) when Hashtbl.mem binop_precedence c -&gt;
- let token_prec = precedence c in
-
- (* If this is a binop that binds at least as tightly as the current binop,
- * consume it, otherwise we are done. *)
- if token_prec &lt; expr_prec then lhs else begin
-</pre>
-</div>
-
-<p>This code gets the precedence of the current token and checks to see if if is
-too low. Because we defined invalid tokens to have a precedence of -1, this
-check implicitly knows that the pair-stream ends when the token stream runs out
-of binary operators. If this check succeeds, we know that the token is a binary
-operator and that it will be included in this expression:</p>
-
-<div class="doc_code">
-<pre>
- (* Eat the binop. *)
- Stream.junk stream;
-
- (* Okay, we know this is a binop. *)
- let rhs =
- match Stream.peek stream with
- | Some (Token.Kwd c2) -&gt;
-</pre>
-</div>
-
-<p>As such, this code eats (and remembers) the binary operator and then parses
-the primary expression that follows. This builds up the whole pair, the first of
-which is [+, b] for the running example.</p>
-
-<p>Now that we parsed the left-hand side of an expression and one pair of the
-RHS sequence, we have to decide which way the expression associates. In
-particular, we could have "(a+b) binop unparsed" or "a + (b binop unparsed)".
-To determine this, we look ahead at "binop" to determine its precedence and
-compare it to BinOp's precedence (which is '+' in this case):</p>
-
-<div class="doc_code">
-<pre>
- (* If BinOp binds less tightly with rhs than the operator after
- * rhs, let the pending operator take rhs as its lhs. *)
- let next_prec = precedence c2 in
- if token_prec &lt; next_prec
-</pre>
-</div>
-
-<p>If the precedence of the binop to the right of "RHS" is lower or equal to the
-precedence of our current operator, then we know that the parentheses associate
-as "(a+b) binop ...". In our example, the current operator is "+" and the next
-operator is "+", we know that they have the same precedence. In this case we'll
-create the AST node for "a+b", and then continue parsing:</p>
-
-<div class="doc_code">
-<pre>
- ... if body omitted ...
- in
-
- (* Merge lhs/rhs. *)
- let lhs = Ast.Binary (c, lhs, rhs) in
- parse_bin_rhs expr_prec lhs stream
- end
-</pre>
-</div>
-
-<p>In our example above, this will turn "a+b+" into "(a+b)" and execute the next
-iteration of the loop, with "+" as the current token. The code above will eat,
-remember, and parse "(c+d)" as the primary expression, which makes the
-current pair equal to [+, (c+d)]. It will then evaluate the 'if' conditional above with
-"*" as the binop to the right of the primary. In this case, the precedence of "*" is
-higher than the precedence of "+" so the if condition will be entered.</p>
-
-<p>The critical question left here is "how can the if condition parse the right
-hand side in full"? In particular, to build the AST correctly for our example,
-it needs to get all of "(c+d)*e*f" as the RHS expression variable. The code to
-do this is surprisingly simple (code from the above two blocks duplicated for
-context):</p>
-
-<div class="doc_code">
-<pre>
- match Stream.peek stream with
- | Some (Token.Kwd c2) -&gt;
- (* If BinOp binds less tightly with rhs than the operator after
- * rhs, let the pending operator take rhs as its lhs. *)
- if token_prec &lt; precedence c2
- then <b>parse_bin_rhs (token_prec + 1) rhs stream</b>
- else rhs
- | _ -&gt; rhs
- in
-
- (* Merge lhs/rhs. *)
- let lhs = Ast.Binary (c, lhs, rhs) in
- parse_bin_rhs expr_prec lhs stream
- end
-</pre>
-</div>
-
-<p>At this point, we know that the binary operator to the RHS of our primary
-has higher precedence than the binop we are currently parsing. As such, we know
-that any sequence of pairs whose operators are all higher precedence than "+"
-should be parsed together and returned as "RHS". To do this, we recursively
-invoke the <tt>Parser.parse_bin_rhs</tt> function specifying "token_prec+1" as
-the minimum precedence required for it to continue. In our example above, this
-will cause it to return the AST node for "(c+d)*e*f" as RHS, which is then set
-as the RHS of the '+' expression.</p>
-
-<p>Finally, on the next iteration of the while loop, the "+g" piece is parsed
-and added to the AST. With this little bit of code (14 non-trivial lines), we
-correctly handle fully general binary expression parsing in a very elegant way.
-This was a whirlwind tour of this code, and it is somewhat subtle. I recommend
-running through it with a few tough examples to see how it works.
-</p>
-
-<p>This wraps up handling of expressions. At this point, we can point the
-parser at an arbitrary token stream and build an expression from it, stopping
-at the first token that is not part of the expression. Next up we need to
-handle function definitions, etc.</p>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section"><a name="parsertop">Parsing the Rest</a></div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>
-The next thing missing is handling of function prototypes. In Kaleidoscope,
-these are used both for 'extern' function declarations as well as function body
-definitions. The code to do this is straight-forward and not very interesting
-(once you've survived expressions):
-</p>
-
-<div class="doc_code">
-<pre>
-(* prototype
- * ::= id '(' id* ')' *)
-let parse_prototype =
- let rec parse_args accumulator = parser
- | [&lt; 'Token.Ident id; e=parse_args (id::accumulator) &gt;] -&gt; e
- | [&lt; &gt;] -&gt; accumulator
- in
-
- parser
- | [&lt; 'Token.Ident id;
- 'Token.Kwd '(' ?? "expected '(' in prototype";
- args=parse_args [];
- 'Token.Kwd ')' ?? "expected ')' in prototype" &gt;] -&gt;
- (* success. *)
- Ast.Prototype (id, Array.of_list (List.rev args))
-
- | [&lt; &gt;] -&gt;
- raise (Stream.Error "expected function name in prototype")
-</pre>
-</div>
-
-<p>Given this, a function definition is very simple, just a prototype plus
-an expression to implement the body:</p>
-
-<div class="doc_code">
-<pre>
-(* definition ::= 'def' prototype expression *)
-let parse_definition = parser
- | [&lt; 'Token.Def; p=parse_prototype; e=parse_expr &gt;] -&gt;
- Ast.Function (p, e)
-</pre>
-</div>
-
-<p>In addition, we support 'extern' to declare functions like 'sin' and 'cos' as
-well as to support forward declaration of user functions. These 'extern's are just
-prototypes with no body:</p>
-
-<div class="doc_code">
-<pre>
-(* external ::= 'extern' prototype *)
-let parse_extern = parser
- | [&lt; 'Token.Extern; e=parse_prototype &gt;] -&gt; e
-</pre>
-</div>
-
-<p>Finally, we'll also let the user type in arbitrary top-level expressions and
-evaluate them on the fly. We will handle this by defining anonymous nullary
-(zero argument) functions for them:</p>
-
-<div class="doc_code">
-<pre>
-(* toplevelexpr ::= expression *)
-let parse_toplevel = parser
- | [&lt; e=parse_expr &gt;] -&gt;
- (* Make an anonymous proto. *)
- Ast.Function (Ast.Prototype ("", [||]), e)
-</pre>
-</div>
-
-<p>Now that we have all the pieces, let's build a little driver that will let us
-actually <em>execute</em> this code we've built!</p>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section"><a name="driver">The Driver</a></div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>The driver for this simply invokes all of the parsing pieces with a top-level
-dispatch loop. There isn't much interesting here, so I'll just include the
-top-level loop. See <a href="#code">below</a> for full code in the "Top-Level
-Parsing" section.</p>
-
-<div class="doc_code">
-<pre>
-(* top ::= definition | external | expression | ';' *)
-let rec main_loop stream =
- match Stream.peek stream with
- | None -&gt; ()
-
- (* ignore top-level semicolons. *)
- | Some (Token.Kwd ';') -&gt;
- Stream.junk stream;
- main_loop stream
-
- | Some token -&gt;
- begin
- try match token with
- | Token.Def -&gt;
- ignore(Parser.parse_definition stream);
- print_endline "parsed a function definition.";
- | Token.Extern -&gt;
- ignore(Parser.parse_extern stream);
- print_endline "parsed an extern.";
- | _ -&gt;
- (* Evaluate a top-level expression into an anonymous function. *)
- ignore(Parser.parse_toplevel stream);
- print_endline "parsed a top-level expr";
- with Stream.Error s -&gt;
- (* Skip token for error recovery. *)
- Stream.junk stream;
- print_endline s;
- end;
- print_string "ready&gt; "; flush stdout;
- main_loop stream
-</pre>
-</div>
-
-<p>The most interesting part of this is that we ignore top-level semicolons.
-Why is this, you ask? The basic reason is that if you type "4 + 5" at the
-command line, the parser doesn't know whether that is the end of what you will type
-or not. For example, on the next line you could type "def foo..." in which case
-4+5 is the end of a top-level expression. Alternatively you could type "* 6",
-which would continue the expression. Having top-level semicolons allows you to
-type "4+5;", and the parser will know you are done.</p>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section"><a name="conclusions">Conclusions</a></div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>With just under 300 lines of commented code (240 lines of non-comment,
-non-blank code), we fully defined our minimal language, including a lexer,
-parser, and AST builder. With this done, the executable will validate
-Kaleidoscope code and tell us if it is grammatically invalid. For
-example, here is a sample interaction:</p>
-
-<div class="doc_code">
-<pre>
-$ <b>./toy.byte</b>
-ready&gt; <b>def foo(x y) x+foo(y, 4.0);</b>
-Parsed a function definition.
-ready&gt; <b>def foo(x y) x+y y;</b>
-Parsed a function definition.
-Parsed a top-level expr
-ready&gt; <b>def foo(x y) x+y );</b>
-Parsed a function definition.
-Error: unknown token when expecting an expression
-ready&gt; <b>extern sin(a);</b>
-ready&gt; Parsed an extern
-ready&gt; <b>^D</b>
-$
-</pre>
-</div>
-
-<p>There is a lot of room for extension here. You can define new AST nodes,
-extend the language in many ways, etc. In the <a href="OCamlLangImpl3.html">
-next installment</a>, we will describe how to generate LLVM Intermediate
-Representation (IR) from the AST.</p>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section"><a name="code">Full Code Listing</a></div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>
-Here is the complete code listing for this and the previous chapter.
-Note that it is fully self-contained: you don't need LLVM or any external
-libraries at all for this. (Besides the ocaml standard libraries, of
-course.) To build this, just compile with:</p>
-
-<div class="doc_code">
-<pre>
-# Compile
-ocamlbuild toy.byte
-# Run
-./toy.byte
-</pre>
-</div>
-
-<p>Here is the code:</p>
-
-<dl>
-<dt>_tags:</dt>
-<dd class="doc_code">
-<pre>
-&lt;{lexer,parser}.ml&gt;: use_camlp4, pp(camlp4of)
-</pre>
-</dd>
-
-<dt>token.ml:</dt>
-<dd class="doc_code">
-<pre>
-(*===----------------------------------------------------------------------===
- * Lexer Tokens
- *===----------------------------------------------------------------------===*)
-
-(* The lexer returns these 'Kwd' if it is an unknown character, otherwise one of
- * these others for known things. *)
-type token =
- (* commands *)
- | Def | Extern
-
- (* primary *)
- | Ident of string | Number of float
-
- (* unknown *)
- | Kwd of char
-</pre>
-</dd>
-
-<dt>lexer.ml:</dt>
-<dd class="doc_code">
-<pre>
-(*===----------------------------------------------------------------------===
- * Lexer
- *===----------------------------------------------------------------------===*)
-
-let rec lex = parser
- (* Skip any whitespace. *)
- | [&lt; ' (' ' | '\n' | '\r' | '\t'); stream &gt;] -&gt; lex stream
-
- (* identifier: [a-zA-Z][a-zA-Z0-9] *)
- | [&lt; ' ('A' .. 'Z' | 'a' .. 'z' as c); stream &gt;] -&gt;
- let buffer = Buffer.create 1 in
- Buffer.add_char buffer c;
- lex_ident buffer stream
-
- (* number: [0-9.]+ *)
- | [&lt; ' ('0' .. '9' as c); stream &gt;] -&gt;
- let buffer = Buffer.create 1 in
- Buffer.add_char buffer c;
- lex_number buffer stream
-
- (* Comment until end of line. *)
- | [&lt; ' ('#'); stream &gt;] -&gt;
- lex_comment stream
-
- (* Otherwise, just return the character as its ascii value. *)
- | [&lt; 'c; stream &gt;] -&gt;
- [&lt; 'Token.Kwd c; lex stream &gt;]
-
- (* end of stream. *)
- | [&lt; &gt;] -&gt; [&lt; &gt;]
-
-and lex_number buffer = parser
- | [&lt; ' ('0' .. '9' | '.' as c); stream &gt;] -&gt;
- Buffer.add_char buffer c;
- lex_number buffer stream
- | [&lt; stream=lex &gt;] -&gt;
- [&lt; 'Token.Number (float_of_string (Buffer.contents buffer)); stream &gt;]
-
-and lex_ident buffer = parser
- | [&lt; ' ('A' .. 'Z' | 'a' .. 'z' | '0' .. '9' as c); stream &gt;] -&gt;
- Buffer.add_char buffer c;
- lex_ident buffer stream
- | [&lt; stream=lex &gt;] -&gt;
- match Buffer.contents buffer with
- | "def" -&gt; [&lt; 'Token.Def; stream &gt;]
- | "extern" -&gt; [&lt; 'Token.Extern; stream &gt;]
- | id -&gt; [&lt; 'Token.Ident id; stream &gt;]
-
-and lex_comment = parser
- | [&lt; ' ('\n'); stream=lex &gt;] -&gt; stream
- | [&lt; 'c; e=lex_comment &gt;] -&gt; e
- | [&lt; &gt;] -&gt; [&lt; &gt;]
-</pre>
-</dd>
-
-<dt>ast.ml:</dt>
-<dd class="doc_code">
-<pre>
-(*===----------------------------------------------------------------------===
- * Abstract Syntax Tree (aka Parse Tree)
- *===----------------------------------------------------------------------===*)
-
-(* expr - Base type for all expression nodes. *)
-type expr =
- (* variant for numeric literals like "1.0". *)
- | Number of float
-
- (* variant for referencing a variable, like "a". *)
- | Variable of string
-
- (* variant for a binary operator. *)
- | Binary of char * expr * expr
-
- (* variant for function calls. *)
- | Call of string * expr array
-
-(* proto - This type represents the "prototype" for a function, which captures
- * its name, and its argument names (thus implicitly the number of arguments the
- * function takes). *)
-type proto = Prototype of string * string array
-
-(* func - This type represents a function definition itself. *)
-type func = Function of proto * expr
-</pre>
-</dd>
-
-<dt>parser.ml:</dt>
-<dd class="doc_code">
-<pre>
-(*===---------------------------------------------------------------------===
- * Parser
- *===---------------------------------------------------------------------===*)
-
-(* binop_precedence - This holds the precedence for each binary operator that is
- * defined *)
-let binop_precedence:(char, int) Hashtbl.t = Hashtbl.create 10
-
-(* precedence - Get the precedence of the pending binary operator token. *)
-let precedence c = try Hashtbl.find binop_precedence c with Not_found -&gt; -1
-
-(* primary
- * ::= identifier
- * ::= numberexpr
- * ::= parenexpr *)
-let rec parse_primary = parser
- (* numberexpr ::= number *)
- | [&lt; 'Token.Number n &gt;] -&gt; Ast.Number n
-
- (* parenexpr ::= '(' expression ')' *)
- | [&lt; 'Token.Kwd '('; e=parse_expr; 'Token.Kwd ')' ?? "expected ')'" &gt;] -&gt; e
-
- (* identifierexpr
- * ::= identifier
- * ::= identifier '(' argumentexpr ')' *)
- | [&lt; 'Token.Ident id; stream &gt;] -&gt;
- let rec parse_args accumulator = parser
- | [&lt; e=parse_expr; stream &gt;] -&gt;
- begin parser
- | [&lt; 'Token.Kwd ','; e=parse_args (e :: accumulator) &gt;] -&gt; e
- | [&lt; &gt;] -&gt; e :: accumulator
- end stream
- | [&lt; &gt;] -&gt; accumulator
- in
- let rec parse_ident id = parser
- (* Call. *)
- | [&lt; 'Token.Kwd '(';
- args=parse_args [];
- 'Token.Kwd ')' ?? "expected ')'"&gt;] -&gt;
- Ast.Call (id, Array.of_list (List.rev args))
-
- (* Simple variable ref. *)
- | [&lt; &gt;] -&gt; Ast.Variable id
- in
- parse_ident id stream
-
- | [&lt; &gt;] -&gt; raise (Stream.Error "unknown token when expecting an expression.")
-
-(* binoprhs
- * ::= ('+' primary)* *)
-and parse_bin_rhs expr_prec lhs stream =
- match Stream.peek stream with
- (* If this is a binop, find its precedence. *)
- | Some (Token.Kwd c) when Hashtbl.mem binop_precedence c -&gt;
- let token_prec = precedence c in
-
- (* If this is a binop that binds at least as tightly as the current binop,
- * consume it, otherwise we are done. *)
- if token_prec &lt; expr_prec then lhs else begin
- (* Eat the binop. *)
- Stream.junk stream;
-
- (* Parse the primary expression after the binary operator. *)
- let rhs = parse_primary stream in
-
- (* Okay, we know this is a binop. *)
- let rhs =
- match Stream.peek stream with
- | Some (Token.Kwd c2) -&gt;
- (* If BinOp binds less tightly with rhs than the operator after
- * rhs, let the pending operator take rhs as its lhs. *)
- let next_prec = precedence c2 in
- if token_prec &lt; next_prec
- then parse_bin_rhs (token_prec + 1) rhs stream
- else rhs
- | _ -&gt; rhs
- in
-
- (* Merge lhs/rhs. *)
- let lhs = Ast.Binary (c, lhs, rhs) in
- parse_bin_rhs expr_prec lhs stream
- end
- | _ -&gt; lhs
-
-(* expression
- * ::= primary binoprhs *)
-and parse_expr = parser
- | [&lt; lhs=parse_primary; stream &gt;] -&gt; parse_bin_rhs 0 lhs stream
-
-(* prototype
- * ::= id '(' id* ')' *)
-let parse_prototype =
- let rec parse_args accumulator = parser
- | [&lt; 'Token.Ident id; e=parse_args (id::accumulator) &gt;] -&gt; e
- | [&lt; &gt;] -&gt; accumulator
- in
-
- parser
- | [&lt; 'Token.Ident id;
- 'Token.Kwd '(' ?? "expected '(' in prototype";
- args=parse_args [];
- 'Token.Kwd ')' ?? "expected ')' in prototype" &gt;] -&gt;
- (* success. *)
- Ast.Prototype (id, Array.of_list (List.rev args))
-
- | [&lt; &gt;] -&gt;
- raise (Stream.Error "expected function name in prototype")
-
-(* definition ::= 'def' prototype expression *)
-let parse_definition = parser
- | [&lt; 'Token.Def; p=parse_prototype; e=parse_expr &gt;] -&gt;
- Ast.Function (p, e)
-
-(* toplevelexpr ::= expression *)
-let parse_toplevel = parser
- | [&lt; e=parse_expr &gt;] -&gt;
- (* Make an anonymous proto. *)
- Ast.Function (Ast.Prototype ("", [||]), e)
-
-(* external ::= 'extern' prototype *)
-let parse_extern = parser
- | [&lt; 'Token.Extern; e=parse_prototype &gt;] -&gt; e
-</pre>
-</dd>
-
-<dt>toplevel.ml:</dt>
-<dd class="doc_code">
-<pre>
-(*===----------------------------------------------------------------------===
- * Top-Level parsing and JIT Driver
- *===----------------------------------------------------------------------===*)
-
-(* top ::= definition | external | expression | ';' *)
-let rec main_loop stream =
- match Stream.peek stream with
- | None -&gt; ()
-
- (* ignore top-level semicolons. *)
- | Some (Token.Kwd ';') -&gt;
- Stream.junk stream;
- main_loop stream
-
- | Some token -&gt;
- begin
- try match token with
- | Token.Def -&gt;
- ignore(Parser.parse_definition stream);
- print_endline "parsed a function definition.";
- | Token.Extern -&gt;
- ignore(Parser.parse_extern stream);
- print_endline "parsed an extern.";
- | _ -&gt;
- (* Evaluate a top-level expression into an anonymous function. *)
- ignore(Parser.parse_toplevel stream);
- print_endline "parsed a top-level expr";
- with Stream.Error s -&gt;
- (* Skip token for error recovery. *)
- Stream.junk stream;
- print_endline s;
- end;
- print_string "ready&gt; "; flush stdout;
- main_loop stream
-</pre>
-</dd>
-
-<dt>toy.ml:</dt>
-<dd class="doc_code">
-<pre>
-(*===----------------------------------------------------------------------===
- * Main driver code.
- *===----------------------------------------------------------------------===*)
-
-let main () =
- (* Install standard binary operators.
- * 1 is the lowest precedence. *)
- Hashtbl.add Parser.binop_precedence '&lt;' 10;
- Hashtbl.add Parser.binop_precedence '+' 20;
- Hashtbl.add Parser.binop_precedence '-' 20;
- Hashtbl.add Parser.binop_precedence '*' 40; (* highest. *)
-
- (* Prime the first token. *)
- print_string "ready&gt; "; flush stdout;
- let stream = Lexer.lex (Stream.of_channel stdin) in
-
- (* Run the main "interpreter loop" now. *)
- Toplevel.main_loop stream;
-;;
-
-main ()
-</pre>
-</dd>
-</dl>
-
-<a href="OCamlLangImpl3.html">Next: Implementing Code Generation to LLVM IR</a>
-</div>
-
-<!-- *********************************************************************** -->
-<hr>
-<address>
- <a href="http://jigsaw.w3.org/css-validator/check/referer"><img
- src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"></a>
- <a href="http://validator.w3.org/check/referer"><img
- src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!"></a>
-
- <a href="mailto:sabre@nondot.org">Chris Lattner</a>
- <a href="mailto:erickt@users.sourceforge.net">Erick Tryzelaar</a><br>
- <a href="http://llvm.org">The LLVM Compiler Infrastructure</a><br>
- Last modified: $Date: 2007-10-17 11:05:13 -0700 (Wed, 17 Oct 2007) $
-</address>
-</body>
-</html>
diff --git a/release_23/docs/tutorial/OCamlLangImpl3.html b/release_23/docs/tutorial/OCamlLangImpl3.html
deleted file mode 100644
index b396ef07ae5c..000000000000
--- a/release_23/docs/tutorial/OCamlLangImpl3.html
+++ /dev/null
@@ -1,1090 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
- "http://www.w3.org/TR/html4/strict.dtd">
-
-<html>
-<head>
- <title>Kaleidoscope: Implementing code generation to LLVM IR</title>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <meta name="author" content="Chris Lattner">
- <meta name="author" content="Erick Tryzelaar">
- <link rel="stylesheet" href="../llvm.css" type="text/css">
-</head>
-
-<body>
-
-<div class="doc_title">Kaleidoscope: Code generation to LLVM IR</div>
-
-<ul>
-<li><a href="index.html">Up to Tutorial Index</a></li>
-<li>Chapter 3
- <ol>
- <li><a href="#intro">Chapter 3 Introduction</a></li>
- <li><a href="#basics">Code Generation Setup</a></li>
- <li><a href="#exprs">Expression Code Generation</a></li>
- <li><a href="#funcs">Function Code Generation</a></li>
- <li><a href="#driver">Driver Changes and Closing Thoughts</a></li>
- <li><a href="#code">Full Code Listing</a></li>
- </ol>
-</li>
-<li><a href="LangImpl4.html">Chapter 4</a>: Adding JIT and Optimizer
-Support</li>
-</ul>
-
-<div class="doc_author">
- <p>
- Written by <a href="mailto:sabre@nondot.org">Chris Lattner</a>
- and <a href="mailto:idadesub@users.sourceforge.net">Erick Tryzelaar</a>
- </p>
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section"><a name="intro">Chapter 3 Introduction</a></div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>Welcome to Chapter 3 of the "<a href="index.html">Implementing a language
-with LLVM</a>" tutorial. This chapter shows you how to transform the <a
-href="OCamlLangImpl2.html">Abstract Syntax Tree</a>, built in Chapter 2, into
-LLVM IR. This will teach you a little bit about how LLVM does things, as well
-as demonstrate how easy it is to use. It's much more work to build a lexer and
-parser than it is to generate LLVM IR code. :)
-</p>
-
-<p><b>Please note</b>: the code in this chapter and later require LLVM 2.3 or
-LLVM SVN to work. LLVM 2.2 and before will not work with it.</p>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section"><a name="basics">Code Generation Setup</a></div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>
-In order to generate LLVM IR, we want some simple setup to get started. First
-we define virtual code generation (codegen) methods in each AST class:</p>
-
-<div class="doc_code">
-<pre>
-let rec codegen_expr = function
- | Ast.Number n -&gt; ...
- | Ast.Variable name -&gt; ...
-</pre>
-</div>
-
-<p>The <tt>Codegen.codegen_expr</tt> function says to emit IR for that AST node
-along with all the things it depends on, and they all return an LLVM Value
-object. "Value" is the class used to represent a "<a
-href="http://en.wikipedia.org/wiki/Static_single_assignment_form">Static Single
-Assignment (SSA)</a> register" or "SSA value" in LLVM. The most distinct aspect
-of SSA values is that their value is computed as the related instruction
-executes, and it does not get a new value until (and if) the instruction
-re-executes. In other words, there is no way to "change" an SSA value. For
-more information, please read up on <a
-href="http://en.wikipedia.org/wiki/Static_single_assignment_form">Static Single
-Assignment</a> - the concepts are really quite natural once you grok them.</p>
-
-<p>The
-second thing we want is an "Error" exception like we used for the parser, which
-will be used to report errors found during code generation (for example, use of
-an undeclared parameter):</p>
-
-<div class="doc_code">
-<pre>
-exception Error of string
-
-let the_module = create_module "my cool jit"
-let builder = builder ()
-let named_values:(string, llvalue) Hashtbl.t = Hashtbl.create 10
-</pre>
-</div>
-
-<p>The static variables will be used during code generation.
-<tt>Codgen.the_module</tt> is the LLVM construct that contains all of the
-functions and global variables in a chunk of code. In many ways, it is the
-top-level structure that the LLVM IR uses to contain code.</p>
-
-<p>The <tt>Codegen.builder</tt> object is a helper object that makes it easy to
-generate LLVM instructions. Instances of the <a
-href="http://llvm.org/doxygen/IRBuilder_8h-source.html"><tt>IRBuilder</tt></a>
-class keep track of the current place to insert instructions and has methods to
-create new instructions.</p>
-
-<p>The <tt>Codegen.named_values</tt> map keeps track of which values are defined
-in the current scope and what their LLVM representation is. (In other words, it
-is a symbol table for the code). In this form of Kaleidoscope, the only things
-that can be referenced are function parameters. As such, function parameters
-will be in this map when generating code for their function body.</p>
-
-<p>
-With these basics in place, we can start talking about how to generate code for
-each expression. Note that this assumes that the <tt>Codgen.builder</tt> has
-been set up to generate code <em>into</em> something. For now, we'll assume
-that this has already been done, and we'll just use it to emit code.</p>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section"><a name="exprs">Expression Code Generation</a></div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>Generating LLVM code for expression nodes is very straightforward: less
-than 30 lines of commented code for all four of our expression nodes. First
-we'll do numeric literals:</p>
-
-<div class="doc_code">
-<pre>
- | Ast.Number n -&gt; const_float double_type n
-</pre>
-</div>
-
-<p>In the LLVM IR, numeric constants are represented with the
-<tt>ConstantFP</tt> class, which holds the numeric value in an <tt>APFloat</tt>
-internally (<tt>APFloat</tt> has the capability of holding floating point
-constants of <em>A</em>rbitrary <em>P</em>recision). This code basically just
-creates and returns a <tt>ConstantFP</tt>. Note that in the LLVM IR
-that constants are all uniqued together and shared. For this reason, the API
-uses "the foo::get(..)" idiom instead of "new foo(..)" or "foo::create(..)".</p>
-
-<div class="doc_code">
-<pre>
- | Ast.Variable name -&gt;
- (try Hashtbl.find named_values name with
- | Not_found -&gt; raise (Error "unknown variable name"))
-</pre>
-</div>
-
-<p>References to variables are also quite simple using LLVM. In the simple
-version of Kaleidoscope, we assume that the variable has already been emited
-somewhere and its value is available. In practice, the only values that can be
-in the <tt>Codegen.named_values</tt> map are function arguments. This code
-simply checks to see that the specified name is in the map (if not, an unknown
-variable is being referenced) and returns the value for it. In future chapters,
-we'll add support for <a href="LangImpl5.html#for">loop induction variables</a>
-in the symbol table, and for <a href="LangImpl7.html#localvars">local
-variables</a>.</p>
-
-<div class="doc_code">
-<pre>
- | Ast.Binary (op, lhs, rhs) -&gt;
- let lhs_val = codegen_expr lhs in
- let rhs_val = codegen_expr rhs in
- begin
- match op with
- | '+' -&gt; build_add lhs_val rhs_val "addtmp" builder
- | '-' -&gt; build_sub lhs_val rhs_val "subtmp" builder
- | '*' -&gt; build_mul lhs_val rhs_val "multmp" builder
- | '&lt;' -&gt;
- (* Convert bool 0/1 to double 0.0 or 1.0 *)
- let i = build_fcmp Fcmp.Ult lhs_val rhs_val "cmptmp" builder in
- build_uitofp i double_type "booltmp" builder
- | _ -&gt; raise (Error "invalid binary operator")
- end
-</pre>
-</div>
-
-<p>Binary operators start to get more interesting. The basic idea here is that
-we recursively emit code for the left-hand side of the expression, then the
-right-hand side, then we compute the result of the binary expression. In this
-code, we do a simple switch on the opcode to create the right LLVM instruction.
-</p>
-
-<p>In the example above, the LLVM builder class is starting to show its value.
-IRBuilder knows where to insert the newly created instruction, all you have to
-do is specify what instruction to create (e.g. with <tt>Llvm.create_add</tt>),
-which operands to use (<tt>lhs</tt> and <tt>rhs</tt> here) and optionally
-provide a name for the generated instruction.</p>
-
-<p>One nice thing about LLVM is that the name is just a hint. For instance, if
-the code above emits multiple "addtmp" variables, LLVM will automatically
-provide each one with an increasing, unique numeric suffix. Local value names
-for instructions are purely optional, but it makes it much easier to read the
-IR dumps.</p>
-
-<p><a href="../LangRef.html#instref">LLVM instructions</a> are constrained by
-strict rules: for example, the Left and Right operators of
-an <a href="../LangRef.html#i_add">add instruction</a> must have the same
-type, and the result type of the add must match the operand types. Because
-all values in Kaleidoscope are doubles, this makes for very simple code for add,
-sub and mul.</p>
-
-<p>On the other hand, LLVM specifies that the <a
-href="../LangRef.html#i_fcmp">fcmp instruction</a> always returns an 'i1' value
-(a one bit integer). The problem with this is that Kaleidoscope wants the value to be a 0.0 or 1.0 value. In order to get these semantics, we combine the fcmp instruction with
-a <a href="../LangRef.html#i_uitofp">uitofp instruction</a>. This instruction
-converts its input integer into a floating point value by treating the input
-as an unsigned value. In contrast, if we used the <a
-href="../LangRef.html#i_sitofp">sitofp instruction</a>, the Kaleidoscope '&lt;'
-operator would return 0.0 and -1.0, depending on the input value.</p>
-
-<div class="doc_code">
-<pre>
- | Ast.Call (callee, args) -&gt;
- (* Look up the name in the module table. *)
- let callee =
- match lookup_function callee the_module with
- | Some callee -&gt; callee
- | None -&gt; raise (Error "unknown function referenced")
- in
- let params = params callee in
-
- (* If argument mismatch error. *)
- if Array.length params == Array.length args then () else
- raise (Error "incorrect # arguments passed");
- let args = Array.map codegen_expr args in
- build_call callee args "calltmp" builder
-</pre>
-</div>
-
-<p>Code generation for function calls is quite straightforward with LLVM. The
-code above initially does a function name lookup in the LLVM Module's symbol
-table. Recall that the LLVM Module is the container that holds all of the
-functions we are JIT'ing. By giving each function the same name as what the
-user specifies, we can use the LLVM symbol table to resolve function names for
-us.</p>
-
-<p>Once we have the function to call, we recursively codegen each argument that
-is to be passed in, and create an LLVM <a href="../LangRef.html#i_call">call
-instruction</a>. Note that LLVM uses the native C calling conventions by
-default, allowing these calls to also call into standard library functions like
-"sin" and "cos", with no additional effort.</p>
-
-<p>This wraps up our handling of the four basic expressions that we have so far
-in Kaleidoscope. Feel free to go in and add some more. For example, by
-browsing the <a href="../LangRef.html">LLVM language reference</a> you'll find
-several other interesting instructions that are really easy to plug into our
-basic framework.</p>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section"><a name="funcs">Function Code Generation</a></div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>Code generation for prototypes and functions must handle a number of
-details, which make their code less beautiful than expression code
-generation, but allows us to illustrate some important points. First, lets
-talk about code generation for prototypes: they are used both for function
-bodies and external function declarations. The code starts with:</p>
-
-<div class="doc_code">
-<pre>
-let codegen_proto = function
- | Ast.Prototype (name, args) -&gt;
- (* Make the function type: double(double,double) etc. *)
- let doubles = Array.make (Array.length args) double_type in
- let ft = function_type double_type doubles in
- let f =
- match lookup_function name the_module with
-</pre>
-</div>
-
-<p>This code packs a lot of power into a few lines. Note first that this
-function returns a "Function*" instead of a "Value*" (although at the moment
-they both are modeled by <tt>llvalue</tt> in ocaml). Because a "prototype"
-really talks about the external interface for a function (not the value computed
-by an expression), it makes sense for it to return the LLVM Function it
-corresponds to when codegen'd.</p>
-
-<p>The call to <tt>Llvm.function_type</tt> creates the <tt>Llvm.llvalue</tt>
-that should be used for a given Prototype. Since all function arguments in
-Kaleidoscope are of type double, the first line creates a vector of "N" LLVM
-double types. It then uses the <tt>Llvm.function_type</tt> method to create a
-function type that takes "N" doubles as arguments, returns one double as a
-result, and that is not vararg (that uses the function
-<tt>Llvm.var_arg_function_type</tt>). Note that Types in LLVM are uniqued just
-like <tt>Constant</tt>s are, so you don't "new" a type, you "get" it.</p>
-
-<p>The final line above checks if the function has already been defined in
-<tt>Codegen.the_module</tt>. If not, we will create it.</p>
-
-<div class="doc_code">
-<pre>
- | None -&gt; declare_function name ft the_module
-</pre>
-</div>
-
-<p>This indicates the type and name to use, as well as which module to insert
-into. By default we assume a function has
-<tt>Llvm.Linkage.ExternalLinkage</tt>. "<a href="LangRef.html#linkage">external
-linkage</a>" means that the function may be defined outside the current module
-and/or that it is callable by functions outside the module. The "<tt>name</tt>"
-passed in is the name the user specified: this name is registered in
-"<tt>Codegen.the_module</tt>"s symbol table, which is used by the function call
-code above.</p>
-
-<p>In Kaleidoscope, I choose to allow redefinitions of functions in two cases:
-first, we want to allow 'extern'ing a function more than once, as long as the
-prototypes for the externs match (since all arguments have the same type, we
-just have to check that the number of arguments match). Second, we want to
-allow 'extern'ing a function and then definining a body for it. This is useful
-when defining mutually recursive functions.</p>
-
-<div class="doc_code">
-<pre>
- (* If 'f' conflicted, there was already something named 'name'. If it
- * has a body, don't allow redefinition or reextern. *)
- | Some f -&gt;
- (* If 'f' already has a body, reject this. *)
- if Array.length (basic_blocks f) == 0 then () else
- raise (Error "redefinition of function");
-
- (* If 'f' took a different number of arguments, reject. *)
- if Array.length (params f) == Array.length args then () else
- raise (Error "redefinition of function with different # args");
- f
- in
-</pre>
-</div>
-
-<p>In order to verify the logic above, we first check to see if the pre-existing
-function is "empty". In this case, empty means that it has no basic blocks in
-it, which means it has no body. If it has no body, it is a forward
-declaration. Since we don't allow anything after a full definition of the
-function, the code rejects this case. If the previous reference to a function
-was an 'extern', we simply verify that the number of arguments for that
-definition and this one match up. If not, we emit an error.</p>
-
-<div class="doc_code">
-<pre>
- (* Set names for all arguments. *)
- Array.iteri (fun i a -&gt;
- let n = args.(i) in
- set_value_name n a;
- Hashtbl.add named_values n a;
- ) (params f);
- f
-</pre>
-</div>
-
-<p>The last bit of code for prototypes loops over all of the arguments in the
-function, setting the name of the LLVM Argument objects to match, and registering
-the arguments in the <tt>Codegen.named_values</tt> map for future use by the
-<tt>Ast.Variable</tt> variant. Once this is set up, it returns the Function
-object to the caller. Note that we don't check for conflicting
-argument names here (e.g. "extern foo(a b a)"). Doing so would be very
-straight-forward with the mechanics we have already used above.</p>
-
-<div class="doc_code">
-<pre>
-let codegen_func = function
- | Ast.Function (proto, body) -&gt;
- Hashtbl.clear named_values;
- let the_function = codegen_proto proto in
-</pre>
-</div>
-
-<p>Code generation for function definitions starts out simply enough: we just
-codegen the prototype (Proto) and verify that it is ok. We then clear out the
-<tt>Codegen.named_values</tt> map to make sure that there isn't anything in it
-from the last function we compiled. Code generation of the prototype ensures
-that there is an LLVM Function object that is ready to go for us.</p>
-
-<div class="doc_code">
-<pre>
- (* Create a new basic block to start insertion into. *)
- let bb = append_block "entry" the_function in
- position_at_end bb builder;
-
- try
- let ret_val = codegen_expr body in
-</pre>
-</div>
-
-<p>Now we get to the point where the <tt>Codegen.builder</tt> is set up. The
-first line creates a new
-<a href="http://en.wikipedia.org/wiki/Basic_block">basic block</a> (named
-"entry"), which is inserted into <tt>the_function</tt>. The second line then
-tells the builder that new instructions should be inserted into the end of the
-new basic block. Basic blocks in LLVM are an important part of functions that
-define the <a
-href="http://en.wikipedia.org/wiki/Control_flow_graph">Control Flow Graph</a>.
-Since we don't have any control flow, our functions will only contain one
-block at this point. We'll fix this in <a href="OCamlLangImpl5.html">Chapter
-5</a> :).</p>
-
-<div class="doc_code">
-<pre>
- let ret_val = codegen_expr body in
-
- (* Finish off the function. *)
- let _ = build_ret ret_val builder in
-
- (* Validate the generated code, checking for consistency. *)
- Llvm_analysis.assert_valid_function the_function;
-
- the_function
-</pre>
-</div>
-
-<p>Once the insertion point is set up, we call the <tt>Codegen.codegen_func</tt>
-method for the root expression of the function. If no error happens, this emits
-code to compute the expression into the entry block and returns the value that
-was computed. Assuming no error, we then create an LLVM <a
-href="../LangRef.html#i_ret">ret instruction</a>, which completes the function.
-Once the function is built, we call
-<tt>Llvm_analysis.assert_valid_function</tt>, which is provided by LLVM. This
-function does a variety of consistency checks on the generated code, to
-determine if our compiler is doing everything right. Using this is important:
-it can catch a lot of bugs. Once the function is finished and validated, we
-return it.</p>
-
-<div class="doc_code">
-<pre>
- with e -&gt;
- delete_function the_function;
- raise e
-</pre>
-</div>
-
-<p>The only piece left here is handling of the error case. For simplicity, we
-handle this by merely deleting the function we produced with the
-<tt>Llvm.delete_function</tt> method. This allows the user to redefine a
-function that they incorrectly typed in before: if we didn't delete it, it
-would live in the symbol table, with a body, preventing future redefinition.</p>
-
-<p>This code does have a bug, though. Since the <tt>Codegen.codegen_proto</tt>
-can return a previously defined forward declaration, our code can actually delete
-a forward declaration. There are a number of ways to fix this bug, see what you
-can come up with! Here is a testcase:</p>
-
-<div class="doc_code">
-<pre>
-extern foo(a b); # ok, defines foo.
-def foo(a b) c; # error, 'c' is invalid.
-def bar() foo(1, 2); # error, unknown function "foo"
-</pre>
-</div>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section"><a name="driver">Driver Changes and
-Closing Thoughts</a></div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>
-For now, code generation to LLVM doesn't really get us much, except that we can
-look at the pretty IR calls. The sample code inserts calls to Codegen into the
-"<tt>Toplevel.main_loop</tt>", and then dumps out the LLVM IR. This gives a
-nice way to look at the LLVM IR for simple functions. For example:
-</p>
-
-<div class="doc_code">
-<pre>
-ready&gt; <b>4+5</b>;
-Read top-level expression:
-define double @""() {
-entry:
- %addtmp = add double 4.000000e+00, 5.000000e+00
- ret double %addtmp
-}
-</pre>
-</div>
-
-<p>Note how the parser turns the top-level expression into anonymous functions
-for us. This will be handy when we add <a href="LangImpl4.html#jit">JIT
-support</a> in the next chapter. Also note that the code is very literally
-transcribed, no optimizations are being performed. We will
-<a href="OCamlLangImpl4.html#trivialconstfold">add optimizations</a> explicitly
-in the next chapter.</p>
-
-<div class="doc_code">
-<pre>
-ready&gt; <b>def foo(a b) a*a + 2*a*b + b*b;</b>
-Read function definition:
-define double @foo(double %a, double %b) {
-entry:
- %multmp = mul double %a, %a
- %multmp1 = mul double 2.000000e+00, %a
- %multmp2 = mul double %multmp1, %b
- %addtmp = add double %multmp, %multmp2
- %multmp3 = mul double %b, %b
- %addtmp4 = add double %addtmp, %multmp3
- ret double %addtmp4
-}
-</pre>
-</div>
-
-<p>This shows some simple arithmetic. Notice the striking similarity to the
-LLVM builder calls that we use to create the instructions.</p>
-
-<div class="doc_code">
-<pre>
-ready&gt; <b>def bar(a) foo(a, 4.0) + bar(31337);</b>
-Read function definition:
-define double @bar(double %a) {
-entry:
- %calltmp = call double @foo( double %a, double 4.000000e+00 )
- %calltmp1 = call double @bar( double 3.133700e+04 )
- %addtmp = add double %calltmp, %calltmp1
- ret double %addtmp
-}
-</pre>
-</div>
-
-<p>This shows some function calls. Note that this function will take a long
-time to execute if you call it. In the future we'll add conditional control
-flow to actually make recursion useful :).</p>
-
-<div class="doc_code">
-<pre>
-ready&gt; <b>extern cos(x);</b>
-Read extern:
-declare double @cos(double)
-
-ready&gt; <b>cos(1.234);</b>
-Read top-level expression:
-define double @""() {
-entry:
- %calltmp = call double @cos( double 1.234000e+00 )
- ret double %calltmp
-}
-</pre>
-</div>
-
-<p>This shows an extern for the libm "cos" function, and a call to it.</p>
-
-
-<div class="doc_code">
-<pre>
-ready&gt; <b>^D</b>
-; ModuleID = 'my cool jit'
-
-define double @""() {
-entry:
- %addtmp = add double 4.000000e+00, 5.000000e+00
- ret double %addtmp
-}
-
-define double @foo(double %a, double %b) {
-entry:
- %multmp = mul double %a, %a
- %multmp1 = mul double 2.000000e+00, %a
- %multmp2 = mul double %multmp1, %b
- %addtmp = add double %multmp, %multmp2
- %multmp3 = mul double %b, %b
- %addtmp4 = add double %addtmp, %multmp3
- ret double %addtmp4
-}
-
-define double @bar(double %a) {
-entry:
- %calltmp = call double @foo( double %a, double 4.000000e+00 )
- %calltmp1 = call double @bar( double 3.133700e+04 )
- %addtmp = add double %calltmp, %calltmp1
- ret double %addtmp
-}
-
-declare double @cos(double)
-
-define double @""() {
-entry:
- %calltmp = call double @cos( double 1.234000e+00 )
- ret double %calltmp
-}
-</pre>
-</div>
-
-<p>When you quit the current demo, it dumps out the IR for the entire module
-generated. Here you can see the big picture with all the functions referencing
-each other.</p>
-
-<p>This wraps up the third chapter of the Kaleidoscope tutorial. Up next, we'll
-describe how to <a href="LangImpl4.html">add JIT codegen and optimizer
-support</a> to this so we can actually start running code!</p>
-
-</div>
-
-
-<!-- *********************************************************************** -->
-<div class="doc_section"><a name="code">Full Code Listing</a></div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>
-Here is the complete code listing for our running example, enhanced with the
-LLVM code generator. Because this uses the LLVM libraries, we need to link
-them in. To do this, we use the <a
-href="http://llvm.org/cmds/llvm-config.html">llvm-config</a> tool to inform
-our makefile/command line about which options to use:</p>
-
-<div class="doc_code">
-<pre>
-# Compile
-ocamlbuild toy.byte
-# Run
-./toy.byte
-</pre>
-</div>
-
-<p>Here is the code:</p>
-
-<dl>
-<dt>_tags:</dt>
-<dd class="doc_code">
-<pre>
-&lt;{lexer,parser}.ml&gt;: use_camlp4, pp(camlp4of)
-&lt;*.{byte,native}&gt;: g++, use_llvm, use_llvm_analysis
-</pre>
-</dd>
-
-<dt>myocamlbuild.ml:</dt>
-<dd class="doc_code">
-<pre>
-open Ocamlbuild_plugin;;
-
-ocaml_lib ~extern:true "llvm";;
-ocaml_lib ~extern:true "llvm_analysis";;
-
-flag ["link"; "ocaml"; "g++"] (S[A"-cc"; A"g++"]);;
-</pre>
-</dd>
-
-<dt>token.ml:</dt>
-<dd class="doc_code">
-<pre>
-(*===----------------------------------------------------------------------===
- * Lexer Tokens
- *===----------------------------------------------------------------------===*)
-
-(* The lexer returns these 'Kwd' if it is an unknown character, otherwise one of
- * these others for known things. *)
-type token =
- (* commands *)
- | Def | Extern
-
- (* primary *)
- | Ident of string | Number of float
-
- (* unknown *)
- | Kwd of char
-</pre>
-</dd>
-
-<dt>lexer.ml:</dt>
-<dd class="doc_code">
-<pre>
-(*===----------------------------------------------------------------------===
- * Lexer
- *===----------------------------------------------------------------------===*)
-
-let rec lex = parser
- (* Skip any whitespace. *)
- | [&lt; ' (' ' | '\n' | '\r' | '\t'); stream &gt;] -&gt; lex stream
-
- (* identifier: [a-zA-Z][a-zA-Z0-9] *)
- | [&lt; ' ('A' .. 'Z' | 'a' .. 'z' as c); stream &gt;] -&gt;
- let buffer = Buffer.create 1 in
- Buffer.add_char buffer c;
- lex_ident buffer stream
-
- (* number: [0-9.]+ *)
- | [&lt; ' ('0' .. '9' as c); stream &gt;] -&gt;
- let buffer = Buffer.create 1 in
- Buffer.add_char buffer c;
- lex_number buffer stream
-
- (* Comment until end of line. *)
- | [&lt; ' ('#'); stream &gt;] -&gt;
- lex_comment stream
-
- (* Otherwise, just return the character as its ascii value. *)
- | [&lt; 'c; stream &gt;] -&gt;
- [&lt; 'Token.Kwd c; lex stream &gt;]
-
- (* end of stream. *)
- | [&lt; &gt;] -&gt; [&lt; &gt;]
-
-and lex_number buffer = parser
- | [&lt; ' ('0' .. '9' | '.' as c); stream &gt;] -&gt;
- Buffer.add_char buffer c;
- lex_number buffer stream
- | [&lt; stream=lex &gt;] -&gt;
- [&lt; 'Token.Number (float_of_string (Buffer.contents buffer)); stream &gt;]
-
-and lex_ident buffer = parser
- | [&lt; ' ('A' .. 'Z' | 'a' .. 'z' | '0' .. '9' as c); stream &gt;] -&gt;
- Buffer.add_char buffer c;
- lex_ident buffer stream
- | [&lt; stream=lex &gt;] -&gt;
- match Buffer.contents buffer with
- | "def" -&gt; [&lt; 'Token.Def; stream &gt;]
- | "extern" -&gt; [&lt; 'Token.Extern; stream &gt;]
- | id -&gt; [&lt; 'Token.Ident id; stream &gt;]
-
-and lex_comment = parser
- | [&lt; ' ('\n'); stream=lex &gt;] -&gt; stream
- | [&lt; 'c; e=lex_comment &gt;] -&gt; e
- | [&lt; &gt;] -&gt; [&lt; &gt;]
-</pre>
-</dd>
-
-<dt>ast.ml:</dt>
-<dd class="doc_code">
-<pre>
-(*===----------------------------------------------------------------------===
- * Abstract Syntax Tree (aka Parse Tree)
- *===----------------------------------------------------------------------===*)
-
-(* expr - Base type for all expression nodes. *)
-type expr =
- (* variant for numeric literals like "1.0". *)
- | Number of float
-
- (* variant for referencing a variable, like "a". *)
- | Variable of string
-
- (* variant for a binary operator. *)
- | Binary of char * expr * expr
-
- (* variant for function calls. *)
- | Call of string * expr array
-
-(* proto - This type represents the "prototype" for a function, which captures
- * its name, and its argument names (thus implicitly the number of arguments the
- * function takes). *)
-type proto = Prototype of string * string array
-
-(* func - This type represents a function definition itself. *)
-type func = Function of proto * expr
-</pre>
-</dd>
-
-<dt>parser.ml:</dt>
-<dd class="doc_code">
-<pre>
-(*===---------------------------------------------------------------------===
- * Parser
- *===---------------------------------------------------------------------===*)
-
-(* binop_precedence - This holds the precedence for each binary operator that is
- * defined *)
-let binop_precedence:(char, int) Hashtbl.t = Hashtbl.create 10
-
-(* precedence - Get the precedence of the pending binary operator token. *)
-let precedence c = try Hashtbl.find binop_precedence c with Not_found -&gt; -1
-
-(* primary
- * ::= identifier
- * ::= numberexpr
- * ::= parenexpr *)
-let rec parse_primary = parser
- (* numberexpr ::= number *)
- | [&lt; 'Token.Number n &gt;] -&gt; Ast.Number n
-
- (* parenexpr ::= '(' expression ')' *)
- | [&lt; 'Token.Kwd '('; e=parse_expr; 'Token.Kwd ')' ?? "expected ')'" &gt;] -&gt; e
-
- (* identifierexpr
- * ::= identifier
- * ::= identifier '(' argumentexpr ')' *)
- | [&lt; 'Token.Ident id; stream &gt;] -&gt;
- let rec parse_args accumulator = parser
- | [&lt; e=parse_expr; stream &gt;] -&gt;
- begin parser
- | [&lt; 'Token.Kwd ','; e=parse_args (e :: accumulator) &gt;] -&gt; e
- | [&lt; &gt;] -&gt; e :: accumulator
- end stream
- | [&lt; &gt;] -&gt; accumulator
- in
- let rec parse_ident id = parser
- (* Call. *)
- | [&lt; 'Token.Kwd '(';
- args=parse_args [];
- 'Token.Kwd ')' ?? "expected ')'"&gt;] -&gt;
- Ast.Call (id, Array.of_list (List.rev args))
-
- (* Simple variable ref. *)
- | [&lt; &gt;] -&gt; Ast.Variable id
- in
- parse_ident id stream
-
- | [&lt; &gt;] -&gt; raise (Stream.Error "unknown token when expecting an expression.")
-
-(* binoprhs
- * ::= ('+' primary)* *)
-and parse_bin_rhs expr_prec lhs stream =
- match Stream.peek stream with
- (* If this is a binop, find its precedence. *)
- | Some (Token.Kwd c) when Hashtbl.mem binop_precedence c -&gt;
- let token_prec = precedence c in
-
- (* If this is a binop that binds at least as tightly as the current binop,
- * consume it, otherwise we are done. *)
- if token_prec &lt; expr_prec then lhs else begin
- (* Eat the binop. *)
- Stream.junk stream;
-
- (* Parse the primary expression after the binary operator. *)
- let rhs = parse_primary stream in
-
- (* Okay, we know this is a binop. *)
- let rhs =
- match Stream.peek stream with
- | Some (Token.Kwd c2) -&gt;
- (* If BinOp binds less tightly with rhs than the operator after
- * rhs, let the pending operator take rhs as its lhs. *)
- let next_prec = precedence c2 in
- if token_prec &lt; next_prec
- then parse_bin_rhs (token_prec + 1) rhs stream
- else rhs
- | _ -&gt; rhs
- in
-
- (* Merge lhs/rhs. *)
- let lhs = Ast.Binary (c, lhs, rhs) in
- parse_bin_rhs expr_prec lhs stream
- end
- | _ -&gt; lhs
-
-(* expression
- * ::= primary binoprhs *)
-and parse_expr = parser
- | [&lt; lhs=parse_primary; stream &gt;] -&gt; parse_bin_rhs 0 lhs stream
-
-(* prototype
- * ::= id '(' id* ')' *)
-let parse_prototype =
- let rec parse_args accumulator = parser
- | [&lt; 'Token.Ident id; e=parse_args (id::accumulator) &gt;] -&gt; e
- | [&lt; &gt;] -&gt; accumulator
- in
-
- parser
- | [&lt; 'Token.Ident id;
- 'Token.Kwd '(' ?? "expected '(' in prototype";
- args=parse_args [];
- 'Token.Kwd ')' ?? "expected ')' in prototype" &gt;] -&gt;
- (* success. *)
- Ast.Prototype (id, Array.of_list (List.rev args))
-
- | [&lt; &gt;] -&gt;
- raise (Stream.Error "expected function name in prototype")
-
-(* definition ::= 'def' prototype expression *)
-let parse_definition = parser
- | [&lt; 'Token.Def; p=parse_prototype; e=parse_expr &gt;] -&gt;
- Ast.Function (p, e)
-
-(* toplevelexpr ::= expression *)
-let parse_toplevel = parser
- | [&lt; e=parse_expr &gt;] -&gt;
- (* Make an anonymous proto. *)
- Ast.Function (Ast.Prototype ("", [||]), e)
-
-(* external ::= 'extern' prototype *)
-let parse_extern = parser
- | [&lt; 'Token.Extern; e=parse_prototype &gt;] -&gt; e
-</pre>
-</dd>
-
-<dt>codegen.ml:</dt>
-<dd class="doc_code">
-<pre>
-(*===----------------------------------------------------------------------===
- * Code Generation
- *===----------------------------------------------------------------------===*)
-
-open Llvm
-
-exception Error of string
-
-let the_module = create_module "my cool jit"
-let builder = builder ()
-let named_values:(string, llvalue) Hashtbl.t = Hashtbl.create 10
-
-let rec codegen_expr = function
- | Ast.Number n -&gt; const_float double_type n
- | Ast.Variable name -&gt;
- (try Hashtbl.find named_values name with
- | Not_found -&gt; raise (Error "unknown variable name"))
- | Ast.Binary (op, lhs, rhs) -&gt;
- let lhs_val = codegen_expr lhs in
- let rhs_val = codegen_expr rhs in
- begin
- match op with
- | '+' -&gt; build_add lhs_val rhs_val "addtmp" builder
- | '-' -&gt; build_sub lhs_val rhs_val "subtmp" builder
- | '*' -&gt; build_mul lhs_val rhs_val "multmp" builder
- | '&lt;' -&gt;
- (* Convert bool 0/1 to double 0.0 or 1.0 *)
- let i = build_fcmp Fcmp.Ult lhs_val rhs_val "cmptmp" builder in
- build_uitofp i double_type "booltmp" builder
- | _ -&gt; raise (Error "invalid binary operator")
- end
- | Ast.Call (callee, args) -&gt;
- (* Look up the name in the module table. *)
- let callee =
- match lookup_function callee the_module with
- | Some callee -&gt; callee
- | None -&gt; raise (Error "unknown function referenced")
- in
- let params = params callee in
-
- (* If argument mismatch error. *)
- if Array.length params == Array.length args then () else
- raise (Error "incorrect # arguments passed");
- let args = Array.map codegen_expr args in
- build_call callee args "calltmp" builder
-
-let codegen_proto = function
- | Ast.Prototype (name, args) -&gt;
- (* Make the function type: double(double,double) etc. *)
- let doubles = Array.make (Array.length args) double_type in
- let ft = function_type double_type doubles in
- let f =
- match lookup_function name the_module with
- | None -&gt; declare_function name ft the_module
-
- (* If 'f' conflicted, there was already something named 'name'. If it
- * has a body, don't allow redefinition or reextern. *)
- | Some f -&gt;
- (* If 'f' already has a body, reject this. *)
- if block_begin f &lt;&gt; At_end f then
- raise (Error "redefinition of function");
-
- (* If 'f' took a different number of arguments, reject. *)
- if element_type (type_of f) &lt;&gt; ft then
- raise (Error "redefinition of function with different # args");
- f
- in
-
- (* Set names for all arguments. *)
- Array.iteri (fun i a -&gt;
- let n = args.(i) in
- set_value_name n a;
- Hashtbl.add named_values n a;
- ) (params f);
- f
-
-let codegen_func = function
- | Ast.Function (proto, body) -&gt;
- Hashtbl.clear named_values;
- let the_function = codegen_proto proto in
-
- (* Create a new basic block to start insertion into. *)
- let bb = append_block "entry" the_function in
- position_at_end bb builder;
-
- try
- let ret_val = codegen_expr body in
-
- (* Finish off the function. *)
- let _ = build_ret ret_val builder in
-
- (* Validate the generated code, checking for consistency. *)
- Llvm_analysis.assert_valid_function the_function;
-
- the_function
- with e -&gt;
- delete_function the_function;
- raise e
-</pre>
-</dd>
-
-<dt>toplevel.ml:</dt>
-<dd class="doc_code">
-<pre>
-(*===----------------------------------------------------------------------===
- * Top-Level parsing and JIT Driver
- *===----------------------------------------------------------------------===*)
-
-open Llvm
-
-(* top ::= definition | external | expression | ';' *)
-let rec main_loop stream =
- match Stream.peek stream with
- | None -&gt; ()
-
- (* ignore top-level semicolons. *)
- | Some (Token.Kwd ';') -&gt;
- Stream.junk stream;
- main_loop stream
-
- | Some token -&gt;
- begin
- try match token with
- | Token.Def -&gt;
- let e = Parser.parse_definition stream in
- print_endline "parsed a function definition.";
- dump_value (Codegen.codegen_func e);
- | Token.Extern -&gt;
- let e = Parser.parse_extern stream in
- print_endline "parsed an extern.";
- dump_value (Codegen.codegen_proto e);
- | _ -&gt;
- (* Evaluate a top-level expression into an anonymous function. *)
- let e = Parser.parse_toplevel stream in
- print_endline "parsed a top-level expr";
- dump_value (Codegen.codegen_func e);
- with Stream.Error s | Codegen.Error s -&gt;
- (* Skip token for error recovery. *)
- Stream.junk stream;
- print_endline s;
- end;
- print_string "ready&gt; "; flush stdout;
- main_loop stream
-</pre>
-</dd>
-
-<dt>toy.ml:</dt>
-<dd class="doc_code">
-<pre>
-(*===----------------------------------------------------------------------===
- * Main driver code.
- *===----------------------------------------------------------------------===*)
-
-open Llvm
-
-let main () =
- (* Install standard binary operators.
- * 1 is the lowest precedence. *)
- Hashtbl.add Parser.binop_precedence '&lt;' 10;
- Hashtbl.add Parser.binop_precedence '+' 20;
- Hashtbl.add Parser.binop_precedence '-' 20;
- Hashtbl.add Parser.binop_precedence '*' 40; (* highest. *)
-
- (* Prime the first token. *)
- print_string "ready&gt; "; flush stdout;
- let stream = Lexer.lex (Stream.of_channel stdin) in
-
- (* Run the main "interpreter loop" now. *)
- Toplevel.main_loop stream;
-
- (* Print out all the generated code. *)
- dump_module Codegen.the_module
-;;
-
-main ()
-</pre>
-</dd>
-</dl>
-
-<a href="OCamlLangImpl4.html">Next: Adding JIT and Optimizer Support</a>
-</div>
-
-<!-- *********************************************************************** -->
-<hr>
-<address>
- <a href="http://jigsaw.w3.org/css-validator/check/referer"><img
- src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"></a>
- <a href="http://validator.w3.org/check/referer"><img
- src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!"></a>
-
- <a href="mailto:sabre@nondot.org">Chris Lattner</a><br>
- <a href="mailto:idadesub@users.sourceforge.net">Erick Tryzelaar</a><br>
- <a href="http://llvm.org">The LLVM Compiler Infrastructure</a><br>
- Last modified: $Date: 2007-10-17 11:05:13 -0700 (Wed, 17 Oct 2007) $
-</address>
-</body>
-</html>
diff --git a/release_23/docs/tutorial/OCamlLangImpl4.html b/release_23/docs/tutorial/OCamlLangImpl4.html
deleted file mode 100644
index ffa85d51dfb7..000000000000
--- a/release_23/docs/tutorial/OCamlLangImpl4.html
+++ /dev/null
@@ -1,1036 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
- "http://www.w3.org/TR/html4/strict.dtd">
-
-<html>
-<head>
- <title>Kaleidoscope: Adding JIT and Optimizer Support</title>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <meta name="author" content="Chris Lattner">
- <meta name="author" content="Erick Tryzelaar">
- <link rel="stylesheet" href="../llvm.css" type="text/css">
-</head>
-
-<body>
-
-<div class="doc_title">Kaleidoscope: Adding JIT and Optimizer Support</div>
-
-<ul>
-<li><a href="index.html">Up to Tutorial Index</a></li>
-<li>Chapter 4
- <ol>
- <li><a href="#intro">Chapter 4 Introduction</a></li>
- <li><a href="#trivialconstfold">Trivial Constant Folding</a></li>
- <li><a href="#optimizerpasses">LLVM Optimization Passes</a></li>
- <li><a href="#jit">Adding a JIT Compiler</a></li>
- <li><a href="#code">Full Code Listing</a></li>
- </ol>
-</li>
-<li><a href="OCamlLangImpl5.html">Chapter 5</a>: Extending the Language: Control
-Flow</li>
-</ul>
-
-<div class="doc_author">
- <p>
- Written by <a href="mailto:sabre@nondot.org">Chris Lattner</a>
- and <a href="mailto:idadesub@users.sourceforge.net">Erick Tryzelaar</a>
- </p>
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section"><a name="intro">Chapter 4 Introduction</a></div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>Welcome to Chapter 4 of the "<a href="index.html">Implementing a language
-with LLVM</a>" tutorial. Chapters 1-3 described the implementation of a simple
-language and added support for generating LLVM IR. This chapter describes
-two new techniques: adding optimizer support to your language, and adding JIT
-compiler support. These additions will demonstrate how to get nice, efficient code
-for the Kaleidoscope language.</p>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section"><a name="trivialconstfold">Trivial Constant
-Folding</a></div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p><b>Note:</b> the default <tt>IRBuilder</tt> now always includes the constant
-folding optimisations below.<p>
-
-<p>
-Our demonstration for Chapter 3 is elegant and easy to extend. Unfortunately,
-it does not produce wonderful code. For example, when compiling simple code,
-we don't get obvious optimizations:</p>
-
-<div class="doc_code">
-<pre>
-ready&gt; <b>def test(x) 1+2+x;</b>
-Read function definition:
-define double @test(double %x) {
-entry:
- %addtmp = add double 1.000000e+00, 2.000000e+00
- %addtmp1 = add double %addtmp, %x
- ret double %addtmp1
-}
-</pre>
-</div>
-
-<p>This code is a very, very literal transcription of the AST built by parsing
-the input. As such, this transcription lacks optimizations like constant folding
-(we'd like to get "<tt>add x, 3.0</tt>" in the example above) as well as other
-more important optimizations. Constant folding, in particular, is a very common
-and very important optimization: so much so that many language implementors
-implement constant folding support in their AST representation.</p>
-
-<p>With LLVM, you don't need this support in the AST. Since all calls to build
-LLVM IR go through the LLVM builder, it would be nice if the builder itself
-checked to see if there was a constant folding opportunity when you call it.
-If so, it could just do the constant fold and return the constant instead of
-creating an instruction. This is exactly what the <tt>LLVMFoldingBuilder</tt>
-class does.
-
-<p>All we did was switch from <tt>LLVMBuilder</tt> to
-<tt>LLVMFoldingBuilder</tt>. Though we change no other code, we now have all of our
-instructions implicitly constant folded without us having to do anything
-about it. For example, the input above now compiles to:</p>
-
-<div class="doc_code">
-<pre>
-ready&gt; <b>def test(x) 1+2+x;</b>
-Read function definition:
-define double @test(double %x) {
-entry:
- %addtmp = add double 3.000000e+00, %x
- ret double %addtmp
-}
-</pre>
-</div>
-
-<p>Well, that was easy :). In practice, we recommend always using
-<tt>LLVMFoldingBuilder</tt> when generating code like this. It has no
-"syntactic overhead" for its use (you don't have to uglify your compiler with
-constant checks everywhere) and it can dramatically reduce the amount of
-LLVM IR that is generated in some cases (particular for languages with a macro
-preprocessor or that use a lot of constants).</p>
-
-<p>On the other hand, the <tt>LLVMFoldingBuilder</tt> is limited by the fact
-that it does all of its analysis inline with the code as it is built. If you
-take a slightly more complex example:</p>
-
-<div class="doc_code">
-<pre>
-ready&gt; <b>def test(x) (1+2+x)*(x+(1+2));</b>
-ready&gt; Read function definition:
-define double @test(double %x) {
-entry:
- %addtmp = add double 3.000000e+00, %x
- %addtmp1 = add double %x, 3.000000e+00
- %multmp = mul double %addtmp, %addtmp1
- ret double %multmp
-}
-</pre>
-</div>
-
-<p>In this case, the LHS and RHS of the multiplication are the same value. We'd
-really like to see this generate "<tt>tmp = x+3; result = tmp*tmp;</tt>" instead
-of computing "<tt>x*3</tt>" twice.</p>
-
-<p>Unfortunately, no amount of local analysis will be able to detect and correct
-this. This requires two transformations: reassociation of expressions (to
-make the add's lexically identical) and Common Subexpression Elimination (CSE)
-to delete the redundant add instruction. Fortunately, LLVM provides a broad
-range of optimizations that you can use, in the form of "passes".</p>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section"><a name="optimizerpasses">LLVM Optimization
- Passes</a></div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>LLVM provides many optimization passes, which do many different sorts of
-things and have different tradeoffs. Unlike other systems, LLVM doesn't hold
-to the mistaken notion that one set of optimizations is right for all languages
-and for all situations. LLVM allows a compiler implementor to make complete
-decisions about what optimizations to use, in which order, and in what
-situation.</p>
-
-<p>As a concrete example, LLVM supports both "whole module" passes, which look
-across as large of body of code as they can (often a whole file, but if run
-at link time, this can be a substantial portion of the whole program). It also
-supports and includes "per-function" passes which just operate on a single
-function at a time, without looking at other functions. For more information
-on passes and how they are run, see the <a href="../WritingAnLLVMPass.html">How
-to Write a Pass</a> document and the <a href="../Passes.html">List of LLVM
-Passes</a>.</p>
-
-<p>For Kaleidoscope, we are currently generating functions on the fly, one at
-a time, as the user types them in. We aren't shooting for the ultimate
-optimization experience in this setting, but we also want to catch the easy and
-quick stuff where possible. As such, we will choose to run a few per-function
-optimizations as the user types the function in. If we wanted to make a "static
-Kaleidoscope compiler", we would use exactly the code we have now, except that
-we would defer running the optimizer until the entire file has been parsed.</p>
-
-<p>In order to get per-function optimizations going, we need to set up a
-<a href="../WritingAnLLVMPass.html#passmanager">Llvm.PassManager</a> to hold and
-organize the LLVM optimizations that we want to run. Once we have that, we can
-add a set of optimizations to run. The code looks like this:</p>
-
-<div class="doc_code">
-<pre>
- (* Create the JIT. *)
- let the_module_provider = ModuleProvider.create Codegen.the_module in
- let the_execution_engine = ExecutionEngine.create the_module_provider in
- let the_fpm = PassManager.create_function the_module_provider in
-
- (* Set up the optimizer pipeline. Start with registering info about how the
- * target lays out data structures. *)
- TargetData.add (ExecutionEngine.target_data the_execution_engine) the_fpm;
-
- (* Do simple "peephole" optimizations and bit-twiddling optzn. *)
- add_instruction_combining the_fpm;
-
- (* reassociate expressions. *)
- add_reassociation the_fpm;
-
- (* Eliminate Common SubExpressions. *)
- add_gvn the_fpm;
-
- (* Simplify the control flow graph (deleting unreachable blocks, etc). *)
- add_cfg_simplification the_fpm;
-
- (* Run the main "interpreter loop" now. *)
- Toplevel.main_loop the_fpm the_execution_engine stream;
-</pre>
-</div>
-
-<p>This code defines two values, an <tt>Llvm.llmoduleprovider</tt> and a
-<tt>Llvm.PassManager.t</tt>. The former is basically a wrapper around our
-<tt>Llvm.llmodule</tt> that the <tt>Llvm.PassManager.t</tt> requires. It
-provides certain flexibility that we're not going to take advantage of here,
-so I won't dive into any details about it.</p>
-
-<p>The meat of the matter here, is the definition of "<tt>the_fpm</tt>". It
-requires a pointer to the <tt>the_module</tt> (through the
-<tt>the_module_provider</tt>) to construct itself. Once it is set up, we use a
-series of "add" calls to add a bunch of LLVM passes. The first pass is
-basically boilerplate, it adds a pass so that later optimizations know how the
-data structures in the program are layed out. The
-"<tt>the_execution_engine</tt>" variable is related to the JIT, which we will
-get to in the next section.</p>
-
-<p>In this case, we choose to add 4 optimization passes. The passes we chose
-here are a pretty standard set of "cleanup" optimizations that are useful for
-a wide variety of code. I won't delve into what they do but, believe me,
-they are a good starting place :).</p>
-
-<p>Once the <tt>Llvm.PassManager.</tt> is set up, we need to make use of it.
-We do this by running it after our newly created function is constructed (in
-<tt>Codegen.codegen_func</tt>), but before it is returned to the client:</p>
-
-<div class="doc_code">
-<pre>
-let codegen_func the_fpm = function
- ...
- try
- let ret_val = codegen_expr body in
-
- (* Finish off the function. *)
- let _ = build_ret ret_val builder in
-
- (* Validate the generated code, checking for consistency. *)
- Llvm_analysis.assert_valid_function the_function;
-
- (* Optimize the function. *)
- let _ = PassManager.run_function the_function the_fpm in
-
- the_function
-</pre>
-</div>
-
-<p>As you can see, this is pretty straightforward. The <tt>the_fpm</tt>
-optimizes and updates the LLVM Function* in place, improving (hopefully) its
-body. With this in place, we can try our test above again:</p>
-
-<div class="doc_code">
-<pre>
-ready&gt; <b>def test(x) (1+2+x)*(x+(1+2));</b>
-ready&gt; Read function definition:
-define double @test(double %x) {
-entry:
- %addtmp = add double %x, 3.000000e+00
- %multmp = mul double %addtmp, %addtmp
- ret double %multmp
-}
-</pre>
-</div>
-
-<p>As expected, we now get our nicely optimized code, saving a floating point
-add instruction from every execution of this function.</p>
-
-<p>LLVM provides a wide variety of optimizations that can be used in certain
-circumstances. Some <a href="../Passes.html">documentation about the various
-passes</a> is available, but it isn't very complete. Another good source of
-ideas can come from looking at the passes that <tt>llvm-gcc</tt> or
-<tt>llvm-ld</tt> run to get started. The "<tt>opt</tt>" tool allows you to
-experiment with passes from the command line, so you can see if they do
-anything.</p>
-
-<p>Now that we have reasonable code coming out of our front-end, lets talk about
-executing it!</p>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section"><a name="jit">Adding a JIT Compiler</a></div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>Code that is available in LLVM IR can have a wide variety of tools
-applied to it. For example, you can run optimizations on it (as we did above),
-you can dump it out in textual or binary forms, you can compile the code to an
-assembly file (.s) for some target, or you can JIT compile it. The nice thing
-about the LLVM IR representation is that it is the "common currency" between
-many different parts of the compiler.
-</p>
-
-<p>In this section, we'll add JIT compiler support to our interpreter. The
-basic idea that we want for Kaleidoscope is to have the user enter function
-bodies as they do now, but immediately evaluate the top-level expressions they
-type in. For example, if they type in "1 + 2;", we should evaluate and print
-out 3. If they define a function, they should be able to call it from the
-command line.</p>
-
-<p>In order to do this, we first declare and initialize the JIT. This is done
-by adding a global variable and a call in <tt>main</tt>:</p>
-
-<div class="doc_code">
-<pre>
-...
-let main () =
- ...
- <b>(* Create the JIT. *)
- let the_module_provider = ModuleProvider.create Codegen.the_module in
- let the_execution_engine = ExecutionEngine.create the_module_provider in</b>
- ...
-</pre>
-</div>
-
-<p>This creates an abstract "Execution Engine" which can be either a JIT
-compiler or the LLVM interpreter. LLVM will automatically pick a JIT compiler
-for you if one is available for your platform, otherwise it will fall back to
-the interpreter.</p>
-
-<p>Once the <tt>Llvm_executionengine.ExecutionEngine.t</tt> is created, the JIT
-is ready to be used. There are a variety of APIs that are useful, but the
-simplest one is the "<tt>Llvm_executionengine.ExecutionEngine.run_function</tt>"
-function. This method JIT compiles the specified LLVM Function and returns a
-function pointer to the generated machine code. In our case, this means that we
-can change the code that parses a top-level expression to look like this:</p>
-
-<div class="doc_code">
-<pre>
- (* Evaluate a top-level expression into an anonymous function. *)
- let e = Parser.parse_toplevel stream in
- print_endline "parsed a top-level expr";
- let the_function = Codegen.codegen_func the_fpm e in
- dump_value the_function;
-
- (* JIT the function, returning a function pointer. *)
- let result = ExecutionEngine.run_function the_function [||]
- the_execution_engine in
-
- print_string "Evaluated to ";
- print_float (GenericValue.as_float double_type result);
- print_newline ();
-</pre>
-</div>
-
-<p>Recall that we compile top-level expressions into a self-contained LLVM
-function that takes no arguments and returns the computed double. Because the
-LLVM JIT compiler matches the native platform ABI, this means that you can just
-cast the result pointer to a function pointer of that type and call it directly.
-This means, there is no difference between JIT compiled code and native machine
-code that is statically linked into your application.</p>
-
-<p>With just these two changes, lets see how Kaleidoscope works now!</p>
-
-<div class="doc_code">
-<pre>
-ready&gt; <b>4+5;</b>
-define double @""() {
-entry:
- ret double 9.000000e+00
-}
-
-<em>Evaluated to 9.000000</em>
-</pre>
-</div>
-
-<p>Well this looks like it is basically working. The dump of the function
-shows the "no argument function that always returns double" that we synthesize
-for each top level expression that is typed in. This demonstrates very basic
-functionality, but can we do more?</p>
-
-<div class="doc_code">
-<pre>
-ready&gt; <b>def testfunc(x y) x + y*2; </b>
-Read function definition:
-define double @testfunc(double %x, double %y) {
-entry:
- %multmp = mul double %y, 2.000000e+00
- %addtmp = add double %multmp, %x
- ret double %addtmp
-}
-
-ready&gt; <b>testfunc(4, 10);</b>
-define double @""() {
-entry:
- %calltmp = call double @testfunc( double 4.000000e+00, double 1.000000e+01 )
- ret double %calltmp
-}
-
-<em>Evaluated to 24.000000</em>
-</pre>
-</div>
-
-<p>This illustrates that we can now call user code, but there is something a bit
-subtle going on here. Note that we only invoke the JIT on the anonymous
-functions that <em>call testfunc</em>, but we never invoked it on <em>testfunc
-</em>itself.</p>
-
-<p>What actually happened here is that the anonymous function was JIT'd when
-requested. When the Kaleidoscope app calls through the function pointer that is
-returned, the anonymous function starts executing. It ends up making the call
-to the "testfunc" function, and ends up in a stub that invokes the JIT, lazily,
-on testfunc. Once the JIT finishes lazily compiling testfunc,
-it returns and the code re-executes the call.</p>
-
-<p>In summary, the JIT will lazily JIT code, on the fly, as it is needed. The
-JIT provides a number of other more advanced interfaces for things like freeing
-allocated machine code, rejit'ing functions to update them, etc. However, even
-with this simple code, we get some surprisingly powerful capabilities - check
-this out (I removed the dump of the anonymous functions, you should get the idea
-by now :) :</p>
-
-<div class="doc_code">
-<pre>
-ready&gt; <b>extern sin(x);</b>
-Read extern:
-declare double @sin(double)
-
-ready&gt; <b>extern cos(x);</b>
-Read extern:
-declare double @cos(double)
-
-ready&gt; <b>sin(1.0);</b>
-<em>Evaluated to 0.841471</em>
-
-ready&gt; <b>def foo(x) sin(x)*sin(x) + cos(x)*cos(x);</b>
-Read function definition:
-define double @foo(double %x) {
-entry:
- %calltmp = call double @sin( double %x )
- %multmp = mul double %calltmp, %calltmp
- %calltmp2 = call double @cos( double %x )
- %multmp4 = mul double %calltmp2, %calltmp2
- %addtmp = add double %multmp, %multmp4
- ret double %addtmp
-}
-
-ready&gt; <b>foo(4.0);</b>
-<em>Evaluated to 1.000000</em>
-</pre>
-</div>
-
-<p>Whoa, how does the JIT know about sin and cos? The answer is surprisingly
-simple: in this example, the JIT started execution of a function and got to a
-function call. It realized that the function was not yet JIT compiled and
-invoked the standard set of routines to resolve the function. In this case,
-there is no body defined for the function, so the JIT ended up calling
-"<tt>dlsym("sin")</tt>" on the Kaleidoscope process itself. Since
-"<tt>sin</tt>" is defined within the JIT's address space, it simply patches up
-calls in the module to call the libm version of <tt>sin</tt> directly.</p>
-
-<p>The LLVM JIT provides a number of interfaces (look in the
-<tt>llvm_executionengine.mli</tt> file) for controlling how unknown functions
-get resolved. It allows you to establish explicit mappings between IR objects
-and addresses (useful for LLVM global variables that you want to map to static
-tables, for example), allows you to dynamically decide on the fly based on the
-function name, and even allows you to have the JIT abort itself if any lazy
-compilation is attempted.</p>
-
-<p>One interesting application of this is that we can now extend the language
-by writing arbitrary C code to implement operations. For example, if we add:
-</p>
-
-<div class="doc_code">
-<pre>
-/* putchard - putchar that takes a double and returns 0. */
-extern "C"
-double putchard(double X) {
- putchar((char)X);
- return 0;
-}
-</pre>
-</div>
-
-<p>Now we can produce simple output to the console by using things like:
-"<tt>extern putchard(x); putchard(120);</tt>", which prints a lowercase 'x' on
-the console (120 is the ASCII code for 'x'). Similar code could be used to
-implement file I/O, console input, and many other capabilities in
-Kaleidoscope.</p>
-
-<p>This completes the JIT and optimizer chapter of the Kaleidoscope tutorial. At
-this point, we can compile a non-Turing-complete programming language, optimize
-and JIT compile it in a user-driven way. Next up we'll look into <a
-href="OCamlLangImpl5.html">extending the language with control flow
-constructs</a>, tackling some interesting LLVM IR issues along the way.</p>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section"><a name="code">Full Code Listing</a></div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>
-Here is the complete code listing for our running example, enhanced with the
-LLVM JIT and optimizer. To build this example, use:
-</p>
-
-<div class="doc_code">
-<pre>
-# Compile
-ocamlbuild toy.byte
-# Run
-./toy.byte
-</pre>
-</div>
-
-<p>Here is the code:</p>
-
-<dl>
-<dt>_tags:</dt>
-<dd class="doc_code">
-<pre>
-&lt;{lexer,parser}.ml&gt;: use_camlp4, pp(camlp4of)
-&lt;*.{byte,native}&gt;: g++, use_llvm, use_llvm_analysis
-&lt;*.{byte,native}&gt;: use_llvm_executionengine, use_llvm_target
-&lt;*.{byte,native}&gt;: use_llvm_scalar_opts, use_bindings
-</pre>
-</dd>
-
-<dt>myocamlbuild.ml:</dt>
-<dd class="doc_code">
-<pre>
-open Ocamlbuild_plugin;;
-
-ocaml_lib ~extern:true "llvm";;
-ocaml_lib ~extern:true "llvm_analysis";;
-ocaml_lib ~extern:true "llvm_executionengine";;
-ocaml_lib ~extern:true "llvm_target";;
-ocaml_lib ~extern:true "llvm_scalar_opts";;
-
-flag ["link"; "ocaml"; "g++"] (S[A"-cc"; A"g++"]);;
-dep ["link"; "ocaml"; "use_bindings"] ["bindings.o"];;
-</pre>
-</dd>
-
-<dt>token.ml:</dt>
-<dd class="doc_code">
-<pre>
-(*===----------------------------------------------------------------------===
- * Lexer Tokens
- *===----------------------------------------------------------------------===*)
-
-(* The lexer returns these 'Kwd' if it is an unknown character, otherwise one of
- * these others for known things. *)
-type token =
- (* commands *)
- | Def | Extern
-
- (* primary *)
- | Ident of string | Number of float
-
- (* unknown *)
- | Kwd of char
-</pre>
-</dd>
-
-<dt>lexer.ml:</dt>
-<dd class="doc_code">
-<pre>
-(*===----------------------------------------------------------------------===
- * Lexer
- *===----------------------------------------------------------------------===*)
-
-let rec lex = parser
- (* Skip any whitespace. *)
- | [&lt; ' (' ' | '\n' | '\r' | '\t'); stream &gt;] -&gt; lex stream
-
- (* identifier: [a-zA-Z][a-zA-Z0-9] *)
- | [&lt; ' ('A' .. 'Z' | 'a' .. 'z' as c); stream &gt;] -&gt;
- let buffer = Buffer.create 1 in
- Buffer.add_char buffer c;
- lex_ident buffer stream
-
- (* number: [0-9.]+ *)
- | [&lt; ' ('0' .. '9' as c); stream &gt;] -&gt;
- let buffer = Buffer.create 1 in
- Buffer.add_char buffer c;
- lex_number buffer stream
-
- (* Comment until end of line. *)
- | [&lt; ' ('#'); stream &gt;] -&gt;
- lex_comment stream
-
- (* Otherwise, just return the character as its ascii value. *)
- | [&lt; 'c; stream &gt;] -&gt;
- [&lt; 'Token.Kwd c; lex stream &gt;]
-
- (* end of stream. *)
- | [&lt; &gt;] -&gt; [&lt; &gt;]
-
-and lex_number buffer = parser
- | [&lt; ' ('0' .. '9' | '.' as c); stream &gt;] -&gt;
- Buffer.add_char buffer c;
- lex_number buffer stream
- | [&lt; stream=lex &gt;] -&gt;
- [&lt; 'Token.Number (float_of_string (Buffer.contents buffer)); stream &gt;]
-
-and lex_ident buffer = parser
- | [&lt; ' ('A' .. 'Z' | 'a' .. 'z' | '0' .. '9' as c); stream &gt;] -&gt;
- Buffer.add_char buffer c;
- lex_ident buffer stream
- | [&lt; stream=lex &gt;] -&gt;
- match Buffer.contents buffer with
- | "def" -&gt; [&lt; 'Token.Def; stream &gt;]
- | "extern" -&gt; [&lt; 'Token.Extern; stream &gt;]
- | id -&gt; [&lt; 'Token.Ident id; stream &gt;]
-
-and lex_comment = parser
- | [&lt; ' ('\n'); stream=lex &gt;] -&gt; stream
- | [&lt; 'c; e=lex_comment &gt;] -&gt; e
- | [&lt; &gt;] -&gt; [&lt; &gt;]
-</pre>
-</dd>
-
-<dt>ast.ml:</dt>
-<dd class="doc_code">
-<pre>
-(*===----------------------------------------------------------------------===
- * Abstract Syntax Tree (aka Parse Tree)
- *===----------------------------------------------------------------------===*)
-
-(* expr - Base type for all expression nodes. *)
-type expr =
- (* variant for numeric literals like "1.0". *)
- | Number of float
-
- (* variant for referencing a variable, like "a". *)
- | Variable of string
-
- (* variant for a binary operator. *)
- | Binary of char * expr * expr
-
- (* variant for function calls. *)
- | Call of string * expr array
-
-(* proto - This type represents the "prototype" for a function, which captures
- * its name, and its argument names (thus implicitly the number of arguments the
- * function takes). *)
-type proto = Prototype of string * string array
-
-(* func - This type represents a function definition itself. *)
-type func = Function of proto * expr
-</pre>
-</dd>
-
-<dt>parser.ml:</dt>
-<dd class="doc_code">
-<pre>
-(*===---------------------------------------------------------------------===
- * Parser
- *===---------------------------------------------------------------------===*)
-
-(* binop_precedence - This holds the precedence for each binary operator that is
- * defined *)
-let binop_precedence:(char, int) Hashtbl.t = Hashtbl.create 10
-
-(* precedence - Get the precedence of the pending binary operator token. *)
-let precedence c = try Hashtbl.find binop_precedence c with Not_found -&gt; -1
-
-(* primary
- * ::= identifier
- * ::= numberexpr
- * ::= parenexpr *)
-let rec parse_primary = parser
- (* numberexpr ::= number *)
- | [&lt; 'Token.Number n &gt;] -&gt; Ast.Number n
-
- (* parenexpr ::= '(' expression ')' *)
- | [&lt; 'Token.Kwd '('; e=parse_expr; 'Token.Kwd ')' ?? "expected ')'" &gt;] -&gt; e
-
- (* identifierexpr
- * ::= identifier
- * ::= identifier '(' argumentexpr ')' *)
- | [&lt; 'Token.Ident id; stream &gt;] -&gt;
- let rec parse_args accumulator = parser
- | [&lt; e=parse_expr; stream &gt;] -&gt;
- begin parser
- | [&lt; 'Token.Kwd ','; e=parse_args (e :: accumulator) &gt;] -&gt; e
- | [&lt; &gt;] -&gt; e :: accumulator
- end stream
- | [&lt; &gt;] -&gt; accumulator
- in
- let rec parse_ident id = parser
- (* Call. *)
- | [&lt; 'Token.Kwd '(';
- args=parse_args [];
- 'Token.Kwd ')' ?? "expected ')'"&gt;] -&gt;
- Ast.Call (id, Array.of_list (List.rev args))
-
- (* Simple variable ref. *)
- | [&lt; &gt;] -&gt; Ast.Variable id
- in
- parse_ident id stream
-
- | [&lt; &gt;] -&gt; raise (Stream.Error "unknown token when expecting an expression.")
-
-(* binoprhs
- * ::= ('+' primary)* *)
-and parse_bin_rhs expr_prec lhs stream =
- match Stream.peek stream with
- (* If this is a binop, find its precedence. *)
- | Some (Token.Kwd c) when Hashtbl.mem binop_precedence c -&gt;
- let token_prec = precedence c in
-
- (* If this is a binop that binds at least as tightly as the current binop,
- * consume it, otherwise we are done. *)
- if token_prec &lt; expr_prec then lhs else begin
- (* Eat the binop. *)
- Stream.junk stream;
-
- (* Parse the primary expression after the binary operator. *)
- let rhs = parse_primary stream in
-
- (* Okay, we know this is a binop. *)
- let rhs =
- match Stream.peek stream with
- | Some (Token.Kwd c2) -&gt;
- (* If BinOp binds less tightly with rhs than the operator after
- * rhs, let the pending operator take rhs as its lhs. *)
- let next_prec = precedence c2 in
- if token_prec &lt; next_prec
- then parse_bin_rhs (token_prec + 1) rhs stream
- else rhs
- | _ -&gt; rhs
- in
-
- (* Merge lhs/rhs. *)
- let lhs = Ast.Binary (c, lhs, rhs) in
- parse_bin_rhs expr_prec lhs stream
- end
- | _ -&gt; lhs
-
-(* expression
- * ::= primary binoprhs *)
-and parse_expr = parser
- | [&lt; lhs=parse_primary; stream &gt;] -&gt; parse_bin_rhs 0 lhs stream
-
-(* prototype
- * ::= id '(' id* ')' *)
-let parse_prototype =
- let rec parse_args accumulator = parser
- | [&lt; 'Token.Ident id; e=parse_args (id::accumulator) &gt;] -&gt; e
- | [&lt; &gt;] -&gt; accumulator
- in
-
- parser
- | [&lt; 'Token.Ident id;
- 'Token.Kwd '(' ?? "expected '(' in prototype";
- args=parse_args [];
- 'Token.Kwd ')' ?? "expected ')' in prototype" &gt;] -&gt;
- (* success. *)
- Ast.Prototype (id, Array.of_list (List.rev args))
-
- | [&lt; &gt;] -&gt;
- raise (Stream.Error "expected function name in prototype")
-
-(* definition ::= 'def' prototype expression *)
-let parse_definition = parser
- | [&lt; 'Token.Def; p=parse_prototype; e=parse_expr &gt;] -&gt;
- Ast.Function (p, e)
-
-(* toplevelexpr ::= expression *)
-let parse_toplevel = parser
- | [&lt; e=parse_expr &gt;] -&gt;
- (* Make an anonymous proto. *)
- Ast.Function (Ast.Prototype ("", [||]), e)
-
-(* external ::= 'extern' prototype *)
-let parse_extern = parser
- | [&lt; 'Token.Extern; e=parse_prototype &gt;] -&gt; e
-</pre>
-</dd>
-
-<dt>codegen.ml:</dt>
-<dd class="doc_code">
-<pre>
-(*===----------------------------------------------------------------------===
- * Code Generation
- *===----------------------------------------------------------------------===*)
-
-open Llvm
-
-exception Error of string
-
-let the_module = create_module "my cool jit"
-let builder = builder ()
-let named_values:(string, llvalue) Hashtbl.t = Hashtbl.create 10
-
-let rec codegen_expr = function
- | Ast.Number n -&gt; const_float double_type n
- | Ast.Variable name -&gt;
- (try Hashtbl.find named_values name with
- | Not_found -&gt; raise (Error "unknown variable name"))
- | Ast.Binary (op, lhs, rhs) -&gt;
- let lhs_val = codegen_expr lhs in
- let rhs_val = codegen_expr rhs in
- begin
- match op with
- | '+' -&gt; build_add lhs_val rhs_val "addtmp" builder
- | '-' -&gt; build_sub lhs_val rhs_val "subtmp" builder
- | '*' -&gt; build_mul lhs_val rhs_val "multmp" builder
- | '&lt;' -&gt;
- (* Convert bool 0/1 to double 0.0 or 1.0 *)
- let i = build_fcmp Fcmp.Ult lhs_val rhs_val "cmptmp" builder in
- build_uitofp i double_type "booltmp" builder
- | _ -&gt; raise (Error "invalid binary operator")
- end
- | Ast.Call (callee, args) -&gt;
- (* Look up the name in the module table. *)
- let callee =
- match lookup_function callee the_module with
- | Some callee -&gt; callee
- | None -&gt; raise (Error "unknown function referenced")
- in
- let params = params callee in
-
- (* If argument mismatch error. *)
- if Array.length params == Array.length args then () else
- raise (Error "incorrect # arguments passed");
- let args = Array.map codegen_expr args in
- build_call callee args "calltmp" builder
-
-let codegen_proto = function
- | Ast.Prototype (name, args) -&gt;
- (* Make the function type: double(double,double) etc. *)
- let doubles = Array.make (Array.length args) double_type in
- let ft = function_type double_type doubles in
- let f =
- match lookup_function name the_module with
- | None -&gt; declare_function name ft the_module
-
- (* If 'f' conflicted, there was already something named 'name'. If it
- * has a body, don't allow redefinition or reextern. *)
- | Some f -&gt;
- (* If 'f' already has a body, reject this. *)
- if block_begin f &lt;&gt; At_end f then
- raise (Error "redefinition of function");
-
- (* If 'f' took a different number of arguments, reject. *)
- if element_type (type_of f) &lt;&gt; ft then
- raise (Error "redefinition of function with different # args");
- f
- in
-
- (* Set names for all arguments. *)
- Array.iteri (fun i a -&gt;
- let n = args.(i) in
- set_value_name n a;
- Hashtbl.add named_values n a;
- ) (params f);
- f
-
-let codegen_func the_fpm = function
- | Ast.Function (proto, body) -&gt;
- Hashtbl.clear named_values;
- let the_function = codegen_proto proto in
-
- (* Create a new basic block to start insertion into. *)
- let bb = append_block "entry" the_function in
- position_at_end bb builder;
-
- try
- let ret_val = codegen_expr body in
-
- (* Finish off the function. *)
- let _ = build_ret ret_val builder in
-
- (* Validate the generated code, checking for consistency. *)
- Llvm_analysis.assert_valid_function the_function;
-
- (* Optimize the function. *)
- let _ = PassManager.run_function the_function the_fpm in
-
- the_function
- with e -&gt;
- delete_function the_function;
- raise e
-</pre>
-</dd>
-
-<dt>toplevel.ml:</dt>
-<dd class="doc_code">
-<pre>
-(*===----------------------------------------------------------------------===
- * Top-Level parsing and JIT Driver
- *===----------------------------------------------------------------------===*)
-
-open Llvm
-open Llvm_executionengine
-
-(* top ::= definition | external | expression | ';' *)
-let rec main_loop the_fpm the_execution_engine stream =
- match Stream.peek stream with
- | None -&gt; ()
-
- (* ignore top-level semicolons. *)
- | Some (Token.Kwd ';') -&gt;
- Stream.junk stream;
- main_loop the_fpm the_execution_engine stream
-
- | Some token -&gt;
- begin
- try match token with
- | Token.Def -&gt;
- let e = Parser.parse_definition stream in
- print_endline "parsed a function definition.";
- dump_value (Codegen.codegen_func the_fpm e);
- | Token.Extern -&gt;
- let e = Parser.parse_extern stream in
- print_endline "parsed an extern.";
- dump_value (Codegen.codegen_proto e);
- | _ -&gt;
- (* Evaluate a top-level expression into an anonymous function. *)
- let e = Parser.parse_toplevel stream in
- print_endline "parsed a top-level expr";
- let the_function = Codegen.codegen_func the_fpm e in
- dump_value the_function;
-
- (* JIT the function, returning a function pointer. *)
- let result = ExecutionEngine.run_function the_function [||]
- the_execution_engine in
-
- print_string "Evaluated to ";
- print_float (GenericValue.as_float double_type result);
- print_newline ();
- with Stream.Error s | Codegen.Error s -&gt;
- (* Skip token for error recovery. *)
- Stream.junk stream;
- print_endline s;
- end;
- print_string "ready&gt; "; flush stdout;
- main_loop the_fpm the_execution_engine stream
-</pre>
-</dd>
-
-<dt>toy.ml:</dt>
-<dd class="doc_code">
-<pre>
-(*===----------------------------------------------------------------------===
- * Main driver code.
- *===----------------------------------------------------------------------===*)
-
-open Llvm
-open Llvm_executionengine
-open Llvm_target
-open Llvm_scalar_opts
-
-let main () =
- (* Install standard binary operators.
- * 1 is the lowest precedence. *)
- Hashtbl.add Parser.binop_precedence '&lt;' 10;
- Hashtbl.add Parser.binop_precedence '+' 20;
- Hashtbl.add Parser.binop_precedence '-' 20;
- Hashtbl.add Parser.binop_precedence '*' 40; (* highest. *)
-
- (* Prime the first token. *)
- print_string "ready&gt; "; flush stdout;
- let stream = Lexer.lex (Stream.of_channel stdin) in
-
- (* Create the JIT. *)
- let the_module_provider = ModuleProvider.create Codegen.the_module in
- let the_execution_engine = ExecutionEngine.create the_module_provider in
- let the_fpm = PassManager.create_function the_module_provider in
-
- (* Set up the optimizer pipeline. Start with registering info about how the
- * target lays out data structures. *)
- TargetData.add (ExecutionEngine.target_data the_execution_engine) the_fpm;
-
- (* Do simple "peephole" optimizations and bit-twiddling optzn. *)
- add_instruction_combining the_fpm;
-
- (* reassociate expressions. *)
- add_reassociation the_fpm;
-
- (* Eliminate Common SubExpressions. *)
- add_gvn the_fpm;
-
- (* Simplify the control flow graph (deleting unreachable blocks, etc). *)
- add_cfg_simplification the_fpm;
-
- (* Run the main "interpreter loop" now. *)
- Toplevel.main_loop the_fpm the_execution_engine stream;
-
- (* Print out all the generated code. *)
- dump_module Codegen.the_module
-;;
-
-main ()
-</pre>
-</dd>
-
-<dt>bindings.c</dt>
-<dd class="doc_code">
-<pre>
-#include &lt;stdio.h&gt;
-
-/* putchard - putchar that takes a double and returns 0. */
-extern double putchard(double X) {
- putchar((char)X);
- return 0;
-}
-</pre>
-</dd>
-</dl>
-
-<a href="OCamlLangImpl5.html">Next: Extending the language: control flow</a>
-</div>
-
-<!-- *********************************************************************** -->
-<hr>
-<address>
- <a href="http://jigsaw.w3.org/css-validator/check/referer"><img
- src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"></a>
- <a href="http://validator.w3.org/check/referer"><img
- src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!"></a>
-
- <a href="mailto:sabre@nondot.org">Chris Lattner</a><br>
- <a href="mailto:idadesub@users.sourceforge.net">Erick Tryzelaar</a><br>
- <a href="http://llvm.org">The LLVM Compiler Infrastructure</a><br>
- Last modified: $Date: 2007-10-17 11:05:13 -0700 (Wed, 17 Oct 2007) $
-</address>
-</body>
-</html>
diff --git a/release_23/docs/tutorial/OCamlLangImpl5.html b/release_23/docs/tutorial/OCamlLangImpl5.html
deleted file mode 100644
index 594a77d16480..000000000000
--- a/release_23/docs/tutorial/OCamlLangImpl5.html
+++ /dev/null
@@ -1,1564 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
- "http://www.w3.org/TR/html4/strict.dtd">
-
-<html>
-<head>
- <title>Kaleidoscope: Extending the Language: Control Flow</title>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <meta name="author" content="Chris Lattner">
- <meta name="author" content="Erick Tryzelaar">
- <link rel="stylesheet" href="../llvm.css" type="text/css">
-</head>
-
-<body>
-
-<div class="doc_title">Kaleidoscope: Extending the Language: Control Flow</div>
-
-<ul>
-<li><a href="index.html">Up to Tutorial Index</a></li>
-<li>Chapter 5
- <ol>
- <li><a href="#intro">Chapter 5 Introduction</a></li>
- <li><a href="#ifthen">If/Then/Else</a>
- <ol>
- <li><a href="#iflexer">Lexer Extensions</a></li>
- <li><a href="#ifast">AST Extensions</a></li>
- <li><a href="#ifparser">Parser Extensions</a></li>
- <li><a href="#ifir">LLVM IR</a></li>
- <li><a href="#ifcodegen">Code Generation</a></li>
- </ol>
- </li>
- <li><a href="#for">'for' Loop Expression</a>
- <ol>
- <li><a href="#forlexer">Lexer Extensions</a></li>
- <li><a href="#forast">AST Extensions</a></li>
- <li><a href="#forparser">Parser Extensions</a></li>
- <li><a href="#forir">LLVM IR</a></li>
- <li><a href="#forcodegen">Code Generation</a></li>
- </ol>
- </li>
- <li><a href="#code">Full Code Listing</a></li>
- </ol>
-</li>
-<li><a href="OCamlLangImpl6.html">Chapter 6</a>: Extending the Language:
-User-defined Operators</li>
-</ul>
-
-<div class="doc_author">
- <p>
- Written by <a href="mailto:sabre@nondot.org">Chris Lattner</a>
- and <a href="mailto:idadesub@users.sourceforge.net">Erick Tryzelaar</a>
- </p>
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section"><a name="intro">Chapter 5 Introduction</a></div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>Welcome to Chapter 5 of the "<a href="index.html">Implementing a language
-with LLVM</a>" tutorial. Parts 1-4 described the implementation of the simple
-Kaleidoscope language and included support for generating LLVM IR, followed by
-optimizations and a JIT compiler. Unfortunately, as presented, Kaleidoscope is
-mostly useless: it has no control flow other than call and return. This means
-that you can't have conditional branches in the code, significantly limiting its
-power. In this episode of "build that compiler", we'll extend Kaleidoscope to
-have an if/then/else expression plus a simple 'for' loop.</p>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section"><a name="ifthen">If/Then/Else</a></div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>
-Extending Kaleidoscope to support if/then/else is quite straightforward. It
-basically requires adding lexer support for this "new" concept to the lexer,
-parser, AST, and LLVM code emitter. This example is nice, because it shows how
-easy it is to "grow" a language over time, incrementally extending it as new
-ideas are discovered.</p>
-
-<p>Before we get going on "how" we add this extension, lets talk about "what" we
-want. The basic idea is that we want to be able to write this sort of thing:
-</p>
-
-<div class="doc_code">
-<pre>
-def fib(x)
- if x &lt; 3 then
- 1
- else
- fib(x-1)+fib(x-2);
-</pre>
-</div>
-
-<p>In Kaleidoscope, every construct is an expression: there are no statements.
-As such, the if/then/else expression needs to return a value like any other.
-Since we're using a mostly functional form, we'll have it evaluate its
-conditional, then return the 'then' or 'else' value based on how the condition
-was resolved. This is very similar to the C "?:" expression.</p>
-
-<p>The semantics of the if/then/else expression is that it evaluates the
-condition to a boolean equality value: 0.0 is considered to be false and
-everything else is considered to be true.
-If the condition is true, the first subexpression is evaluated and returned, if
-the condition is false, the second subexpression is evaluated and returned.
-Since Kaleidoscope allows side-effects, this behavior is important to nail down.
-</p>
-
-<p>Now that we know what we "want", lets break this down into its constituent
-pieces.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsubsection"><a name="iflexer">Lexer Extensions for
-If/Then/Else</a></div>
-<!-- ======================================================================= -->
-
-
-<div class="doc_text">
-
-<p>The lexer extensions are straightforward. First we add new variants
-for the relevant tokens:</p>
-
-<div class="doc_code">
-<pre>
- (* control *)
- | If | Then | Else | For | In
-</pre>
-</div>
-
-<p>Once we have that, we recognize the new keywords in the lexer. This is pretty simple
-stuff:</p>
-
-<div class="doc_code">
-<pre>
- ...
- match Buffer.contents buffer with
- | "def" -&gt; [&lt; 'Token.Def; stream &gt;]
- | "extern" -&gt; [&lt; 'Token.Extern; stream &gt;]
- | "if" -&gt; [&lt; 'Token.If; stream &gt;]
- | "then" -&gt; [&lt; 'Token.Then; stream &gt;]
- | "else" -&gt; [&lt; 'Token.Else; stream &gt;]
- | "for" -&gt; [&lt; 'Token.For; stream &gt;]
- | "in" -&gt; [&lt; 'Token.In; stream &gt;]
- | id -&gt; [&lt; 'Token.Ident id; stream &gt;]
-</pre>
-</div>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsubsection"><a name="ifast">AST Extensions for
- If/Then/Else</a></div>
-<!-- ======================================================================= -->
-
-<div class="doc_text">
-
-<p>To represent the new expression we add a new AST variant for it:</p>
-
-<div class="doc_code">
-<pre>
-type expr =
- ...
- (* variant for if/then/else. *)
- | If of expr * expr * expr
-</pre>
-</div>
-
-<p>The AST variant just has pointers to the various subexpressions.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsubsection"><a name="ifparser">Parser Extensions for
-If/Then/Else</a></div>
-<!-- ======================================================================= -->
-
-<div class="doc_text">
-
-<p>Now that we have the relevant tokens coming from the lexer and we have the
-AST node to build, our parsing logic is relatively straightforward. First we
-define a new parsing function:</p>
-
-<div class="doc_code">
-<pre>
-let rec parse_primary = parser
- ...
- (* ifexpr ::= 'if' expr 'then' expr 'else' expr *)
- | [&lt; 'Token.If; c=parse_expr;
- 'Token.Then ?? "expected 'then'"; t=parse_expr;
- 'Token.Else ?? "expected 'else'"; e=parse_expr &gt;] -&gt;
- Ast.If (c, t, e)
-</pre>
-</div>
-
-<p>Next we hook it up as a primary expression:</p>
-
-<div class="doc_code">
-<pre>
-let rec parse_primary = parser
- ...
- (* ifexpr ::= 'if' expr 'then' expr 'else' expr *)
- | [&lt; 'Token.If; c=parse_expr;
- 'Token.Then ?? "expected 'then'"; t=parse_expr;
- 'Token.Else ?? "expected 'else'"; e=parse_expr &gt;] -&gt;
- Ast.If (c, t, e)
-</pre>
-</div>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsubsection"><a name="ifir">LLVM IR for If/Then/Else</a></div>
-<!-- ======================================================================= -->
-
-<div class="doc_text">
-
-<p>Now that we have it parsing and building the AST, the final piece is adding
-LLVM code generation support. This is the most interesting part of the
-if/then/else example, because this is where it starts to introduce new concepts.
-All of the code above has been thoroughly described in previous chapters.
-</p>
-
-<p>To motivate the code we want to produce, lets take a look at a simple
-example. Consider:</p>
-
-<div class="doc_code">
-<pre>
-extern foo();
-extern bar();
-def baz(x) if x then foo() else bar();
-</pre>
-</div>
-
-<p>If you disable optimizations, the code you'll (soon) get from Kaleidoscope
-looks like this:</p>
-
-<div class="doc_code">
-<pre>
-declare double @foo()
-
-declare double @bar()
-
-define double @baz(double %x) {
-entry:
- %ifcond = fcmp one double %x, 0.000000e+00
- br i1 %ifcond, label %then, label %else
-
-then: ; preds = %entry
- %calltmp = call double @foo()
- br label %ifcont
-
-else: ; preds = %entry
- %calltmp1 = call double @bar()
- br label %ifcont
-
-ifcont: ; preds = %else, %then
- %iftmp = phi double [ %calltmp, %then ], [ %calltmp1, %else ]
- ret double %iftmp
-}
-</pre>
-</div>
-
-<p>To visualize the control flow graph, you can use a nifty feature of the LLVM
-'<a href="http://llvm.org/cmds/opt.html">opt</a>' tool. If you put this LLVM IR
-into "t.ll" and run "<tt>llvm-as &lt; t.ll | opt -analyze -view-cfg</tt>", <a
-href="../ProgrammersManual.html#ViewGraph">a window will pop up</a> and you'll
-see this graph:</p>
-
-<center><img src="LangImpl5-cfg.png" alt="Example CFG" width="423"
-height="315"></center>
-
-<p>Another way to get this is to call "<tt>Llvm_analysis.view_function_cfg
-f</tt>" or "<tt>Llvm_analysis.view_function_cfg_only f</tt>" (where <tt>f</tt>
-is a "<tt>Function</tt>") either by inserting actual calls into the code and
-recompiling or by calling these in the debugger. LLVM has many nice features
-for visualizing various graphs.</p>
-
-<p>Getting back to the generated code, it is fairly simple: the entry block
-evaluates the conditional expression ("x" in our case here) and compares the
-result to 0.0 with the "<tt><a href="../LangRef.html#i_fcmp">fcmp</a> one</tt>"
-instruction ('one' is "Ordered and Not Equal"). Based on the result of this
-expression, the code jumps to either the "then" or "else" blocks, which contain
-the expressions for the true/false cases.</p>
-
-<p>Once the then/else blocks are finished executing, they both branch back to the
-'ifcont' block to execute the code that happens after the if/then/else. In this
-case the only thing left to do is to return to the caller of the function. The
-question then becomes: how does the code know which expression to return?</p>
-
-<p>The answer to this question involves an important SSA operation: the
-<a href="http://en.wikipedia.org/wiki/Static_single_assignment_form">Phi
-operation</a>. If you're not familiar with SSA, <a
-href="http://en.wikipedia.org/wiki/Static_single_assignment_form">the wikipedia
-article</a> is a good introduction and there are various other introductions to
-it available on your favorite search engine. The short version is that
-"execution" of the Phi operation requires "remembering" which block control came
-from. The Phi operation takes on the value corresponding to the input control
-block. In this case, if control comes in from the "then" block, it gets the
-value of "calltmp". If control comes from the "else" block, it gets the value
-of "calltmp1".</p>
-
-<p>At this point, you are probably starting to think "Oh no! This means my
-simple and elegant front-end will have to start generating SSA form in order to
-use LLVM!". Fortunately, this is not the case, and we strongly advise
-<em>not</em> implementing an SSA construction algorithm in your front-end
-unless there is an amazingly good reason to do so. In practice, there are two
-sorts of values that float around in code written for your average imperative
-programming language that might need Phi nodes:</p>
-
-<ol>
-<li>Code that involves user variables: <tt>x = 1; x = x + 1; </tt></li>
-<li>Values that are implicit in the structure of your AST, such as the Phi node
-in this case.</li>
-</ol>
-
-<p>In <a href="OCamlLangImpl7.html">Chapter 7</a> of this tutorial ("mutable
-variables"), we'll talk about #1
-in depth. For now, just believe me that you don't need SSA construction to
-handle this case. For #2, you have the choice of using the techniques that we will
-describe for #1, or you can insert Phi nodes directly, if convenient. In this
-case, it is really really easy to generate the Phi node, so we choose to do it
-directly.</p>
-
-<p>Okay, enough of the motivation and overview, lets generate code!</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsubsection"><a name="ifcodegen">Code Generation for
-If/Then/Else</a></div>
-<!-- ======================================================================= -->
-
-<div class="doc_text">
-
-<p>In order to generate code for this, we implement the <tt>Codegen</tt> method
-for <tt>IfExprAST</tt>:</p>
-
-<div class="doc_code">
-<pre>
-let rec codegen_expr = function
- ...
- | Ast.If (cond, then_, else_) -&gt;
- let cond = codegen_expr cond in
-
- (* Convert condition to a bool by comparing equal to 0.0 *)
- let zero = const_float double_type 0.0 in
- let cond_val = build_fcmp Fcmp.One cond zero "ifcond" builder in
-</pre>
-</div>
-
-<p>This code is straightforward and similar to what we saw before. We emit the
-expression for the condition, then compare that value to zero to get a truth
-value as a 1-bit (bool) value.</p>
-
-<div class="doc_code">
-<pre>
- (* Grab the first block so that we might later add the conditional branch
- * to it at the end of the function. *)
- let start_bb = insertion_block builder in
- let the_function = block_parent start_bb in
-
- let then_bb = append_block "then" the_function in
- position_at_end then_bb builder;
-</pre>
-</div>
-
-<p>
-As opposed to the <a href="LangImpl5.html">C++ tutorial</a>, we have to build
-our basic blocks bottom up since we can't have dangling BasicBlocks. We start
-off by saving a pointer to the first block (which might not be the entry
-block), which we'll need to build a conditional branch later. We do this by
-asking the <tt>builder</tt> for the current BasicBlock. The fourth line
-gets the current Function object that is being built. It gets this by the
-<tt>start_bb</tt> for its "parent" (the function it is currently embedded
-into).</p>
-
-<p>Once it has that, it creates one block. It is automatically appended into
-the function's list of blocks.</p>
-
-<div class="doc_code">
-<pre>
- (* Emit 'then' value. *)
- position_at_end then_bb builder;
- let then_val = codegen_expr then_ in
-
- (* Codegen of 'then' can change the current block, update then_bb for the
- * phi. We create a new name because one is used for the phi node, and the
- * other is used for the conditional branch. *)
- let new_then_bb = insertion_block builder in
-</pre>
-</div>
-
-<p>We move the builder to start inserting into the "then" block. Strictly
-speaking, this call moves the insertion point to be at the end of the specified
-block. However, since the "then" block is empty, it also starts out by
-inserting at the beginning of the block. :)</p>
-
-<p>Once the insertion point is set, we recursively codegen the "then" expression
-from the AST.</p>
-
-<p>The final line here is quite subtle, but is very important. The basic issue
-is that when we create the Phi node in the merge block, we need to set up the
-block/value pairs that indicate how the Phi will work. Importantly, the Phi
-node expects to have an entry for each predecessor of the block in the CFG. Why
-then, are we getting the current block when we just set it to ThenBB 5 lines
-above? The problem is that the "Then" expression may actually itself change the
-block that the Builder is emitting into if, for example, it contains a nested
-"if/then/else" expression. Because calling Codegen recursively could
-arbitrarily change the notion of the current block, we are required to get an
-up-to-date value for code that will set up the Phi node.</p>
-
-<div class="doc_code">
-<pre>
- (* Emit 'else' value. *)
- let else_bb = append_block "else" the_function in
- position_at_end else_bb builder;
- let else_val = codegen_expr else_ in
-
- (* Codegen of 'else' can change the current block, update else_bb for the
- * phi. *)
- let new_else_bb = insertion_block builder in
-</pre>
-</div>
-
-<p>Code generation for the 'else' block is basically identical to codegen for
-the 'then' block.</p>
-
-<div class="doc_code">
-<pre>
- (* Emit merge block. *)
- let merge_bb = append_block "ifcont" the_function in
- position_at_end merge_bb builder;
- let incoming = [(then_val, new_then_bb); (else_val, new_else_bb)] in
- let phi = build_phi incoming "iftmp" builder in
-</pre>
-</div>
-
-<p>The first two lines here are now familiar: the first adds the "merge" block
-to the Function object. The second block changes the insertion point so that
-newly created code will go into the "merge" block. Once that is done, we need
-to create the PHI node and set up the block/value pairs for the PHI.</p>
-
-<div class="doc_code">
-<pre>
- (* Return to the start block to add the conditional branch. *)
- position_at_end start_bb builder;
- ignore (build_cond_br cond_val then_bb else_bb builder);
-</pre>
-</div>
-
-<p>Once the blocks are created, we can emit the conditional branch that chooses
-between them. Note that creating new blocks does not implicitly affect the
-IRBuilder, so it is still inserting into the block that the condition
-went into. This is why we needed to save the "start" block.</p>
-
-<div class="doc_code">
-<pre>
- (* Set a unconditional branch at the end of the 'then' block and the
- * 'else' block to the 'merge' block. *)
- position_at_end new_then_bb builder; ignore (build_br merge_bb builder);
- position_at_end new_else_bb builder; ignore (build_br merge_bb builder);
-
- (* Finally, set the builder to the end of the merge block. *)
- position_at_end merge_bb builder;
-
- phi
-</pre>
-</div>
-
-<p>To finish off the blocks, we create an unconditional branch
-to the merge block. One interesting (and very important) aspect of the LLVM IR
-is that it <a href="../LangRef.html#functionstructure">requires all basic blocks
-to be "terminated"</a> with a <a href="../LangRef.html#terminators">control flow
-instruction</a> such as return or branch. This means that all control flow,
-<em>including fall throughs</em> must be made explicit in the LLVM IR. If you
-violate this rule, the verifier will emit an error.
-
-<p>Finally, the CodeGen function returns the phi node as the value computed by
-the if/then/else expression. In our example above, this returned value will
-feed into the code for the top-level function, which will create the return
-instruction.</p>
-
-<p>Overall, we now have the ability to execute conditional code in
-Kaleidoscope. With this extension, Kaleidoscope is a fairly complete language
-that can calculate a wide variety of numeric functions. Next up we'll add
-another useful expression that is familiar from non-functional languages...</p>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section"><a name="for">'for' Loop Expression</a></div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>Now that we know how to add basic control flow constructs to the language,
-we have the tools to add more powerful things. Lets add something more
-aggressive, a 'for' expression:</p>
-
-<div class="doc_code">
-<pre>
- extern putchard(char);
- def printstar(n)
- for i = 1, i &lt; n, 1.0 in
- putchard(42); # ascii 42 = '*'
-
- # print 100 '*' characters
- printstar(100);
-</pre>
-</div>
-
-<p>This expression defines a new variable ("i" in this case) which iterates from
-a starting value, while the condition ("i &lt; n" in this case) is true,
-incrementing by an optional step value ("1.0" in this case). If the step value
-is omitted, it defaults to 1.0. While the loop is true, it executes its
-body expression. Because we don't have anything better to return, we'll just
-define the loop as always returning 0.0. In the future when we have mutable
-variables, it will get more useful.</p>
-
-<p>As before, lets talk about the changes that we need to Kaleidoscope to
-support this.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsubsection"><a name="forlexer">Lexer Extensions for
-the 'for' Loop</a></div>
-<!-- ======================================================================= -->
-
-<div class="doc_text">
-
-<p>The lexer extensions are the same sort of thing as for if/then/else:</p>
-
-<div class="doc_code">
-<pre>
- ... in Token.token ...
- (* control *)
- | If | Then | Else
- <b>| For | In</b>
-
- ... in Lexer.lex_ident...
- match Buffer.contents buffer with
- | "def" -&gt; [&lt; 'Token.Def; stream &gt;]
- | "extern" -&gt; [&lt; 'Token.Extern; stream &gt;]
- | "if" -&gt; [&lt; 'Token.If; stream &gt;]
- | "then" -&gt; [&lt; 'Token.Then; stream &gt;]
- | "else" -&gt; [&lt; 'Token.Else; stream &gt;]
- <b>| "for" -&gt; [&lt; 'Token.For; stream &gt;]
- | "in" -&gt; [&lt; 'Token.In; stream &gt;]</b>
- | id -&gt; [&lt; 'Token.Ident id; stream &gt;]
-</pre>
-</div>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsubsection"><a name="forast">AST Extensions for
-the 'for' Loop</a></div>
-<!-- ======================================================================= -->
-
-<div class="doc_text">
-
-<p>The AST variant is just as simple. It basically boils down to capturing
-the variable name and the constituent expressions in the node.</p>
-
-<div class="doc_code">
-<pre>
-type expr =
- ...
- (* variant for for/in. *)
- | For of string * expr * expr * expr option * expr
-</pre>
-</div>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsubsection"><a name="forparser">Parser Extensions for
-the 'for' Loop</a></div>
-<!-- ======================================================================= -->
-
-<div class="doc_text">
-
-<p>The parser code is also fairly standard. The only interesting thing here is
-handling of the optional step value. The parser code handles it by checking to
-see if the second comma is present. If not, it sets the step value to null in
-the AST node:</p>
-
-<div class="doc_code">
-<pre>
-let rec parse_primary = parser
- ...
- (* forexpr
- ::= 'for' identifier '=' expr ',' expr (',' expr)? 'in' expression *)
- | [&lt; 'Token.For;
- 'Token.Ident id ?? "expected identifier after for";
- 'Token.Kwd '=' ?? "expected '=' after for";
- stream &gt;] -&gt;
- begin parser
- | [&lt;
- start=parse_expr;
- 'Token.Kwd ',' ?? "expected ',' after for";
- end_=parse_expr;
- stream &gt;] -&gt;
- let step =
- begin parser
- | [&lt; 'Token.Kwd ','; step=parse_expr &gt;] -&gt; Some step
- | [&lt; &gt;] -&gt; None
- end stream
- in
- begin parser
- | [&lt; 'Token.In; body=parse_expr &gt;] -&gt;
- Ast.For (id, start, end_, step, body)
- | [&lt; &gt;] -&gt;
- raise (Stream.Error "expected 'in' after for")
- end stream
- | [&lt; &gt;] -&gt;
- raise (Stream.Error "expected '=' after for")
- end stream
-</pre>
-</div>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsubsection"><a name="forir">LLVM IR for
-the 'for' Loop</a></div>
-<!-- ======================================================================= -->
-
-<div class="doc_text">
-
-<p>Now we get to the good part: the LLVM IR we want to generate for this thing.
-With the simple example above, we get this LLVM IR (note that this dump is
-generated with optimizations disabled for clarity):
-</p>
-
-<div class="doc_code">
-<pre>
-declare double @putchard(double)
-
-define double @printstar(double %n) {
-entry:
- ; initial value = 1.0 (inlined into phi)
- br label %loop
-
-loop: ; preds = %loop, %entry
- %i = phi double [ 1.000000e+00, %entry ], [ %nextvar, %loop ]
- ; body
- %calltmp = call double @putchard( double 4.200000e+01 )
- ; increment
- %nextvar = add double %i, 1.000000e+00
-
- ; termination test
- %cmptmp = fcmp ult double %i, %n
- %booltmp = uitofp i1 %cmptmp to double
- %loopcond = fcmp one double %booltmp, 0.000000e+00
- br i1 %loopcond, label %loop, label %afterloop
-
-afterloop: ; preds = %loop
- ; loop always returns 0.0
- ret double 0.000000e+00
-}
-</pre>
-</div>
-
-<p>This loop contains all the same constructs we saw before: a phi node, several
-expressions, and some basic blocks. Lets see how this fits together.</p>
-
-</div>
-
-<!-- ======================================================================= -->
-<div class="doc_subsubsection"><a name="forcodegen">Code Generation for
-the 'for' Loop</a></div>
-<!-- ======================================================================= -->
-
-<div class="doc_text">
-
-<p>The first part of Codegen is very simple: we just output the start expression
-for the loop value:</p>
-
-<div class="doc_code">
-<pre>
-let rec codegen_expr = function
- ...
- | Ast.For (var_name, start, end_, step, body) -&gt;
- (* Emit the start code first, without 'variable' in scope. *)
- let start_val = codegen_expr start in
-</pre>
-</div>
-
-<p>With this out of the way, the next step is to set up the LLVM basic block
-for the start of the loop body. In the case above, the whole loop body is one
-block, but remember that the body code itself could consist of multiple blocks
-(e.g. if it contains an if/then/else or a for/in expression).</p>
-
-<div class="doc_code">
-<pre>
- (* Make the new basic block for the loop header, inserting after current
- * block. *)
- let preheader_bb = insertion_block builder in
- let the_function = block_parent preheader_bb in
- let loop_bb = append_block "loop" the_function in
-
- (* Insert an explicit fall through from the current block to the
- * loop_bb. *)
- ignore (build_br loop_bb builder);
-</pre>
-</div>
-
-<p>This code is similar to what we saw for if/then/else. Because we will need
-it to create the Phi node, we remember the block that falls through into the
-loop. Once we have that, we create the actual block that starts the loop and
-create an unconditional branch for the fall-through between the two blocks.</p>
-
-<div class="doc_code">
-<pre>
- (* Start insertion in loop_bb. *)
- position_at_end loop_bb builder;
-
- (* Start the PHI node with an entry for start. *)
- let variable = build_phi [(start_val, preheader_bb)] var_name builder in
-</pre>
-</div>
-
-<p>Now that the "preheader" for the loop is set up, we switch to emitting code
-for the loop body. To begin with, we move the insertion point and create the
-PHI node for the loop induction variable. Since we already know the incoming
-value for the starting value, we add it to the Phi node. Note that the Phi will
-eventually get a second value for the backedge, but we can't set it up yet
-(because it doesn't exist!).</p>
-
-<div class="doc_code">
-<pre>
- (* Within the loop, the variable is defined equal to the PHI node. If it
- * shadows an existing variable, we have to restore it, so save it
- * now. *)
- let old_val =
- try Some (Hashtbl.find named_values var_name) with Not_found -&gt; None
- in
- Hashtbl.add named_values var_name variable;
-
- (* Emit the body of the loop. This, like any other expr, can change the
- * current BB. Note that we ignore the value computed by the body, but
- * don't allow an error *)
- ignore (codegen_expr body);
-</pre>
-</div>
-
-<p>Now the code starts to get more interesting. Our 'for' loop introduces a new
-variable to the symbol table. This means that our symbol table can now contain
-either function arguments or loop variables. To handle this, before we codegen
-the body of the loop, we add the loop variable as the current value for its
-name. Note that it is possible that there is a variable of the same name in the
-outer scope. It would be easy to make this an error (emit an error and return
-null if there is already an entry for VarName) but we choose to allow shadowing
-of variables. In order to handle this correctly, we remember the Value that
-we are potentially shadowing in <tt>old_val</tt> (which will be None if there is
-no shadowed variable).</p>
-
-<p>Once the loop variable is set into the symbol table, the code recursively
-codegen's the body. This allows the body to use the loop variable: any
-references to it will naturally find it in the symbol table.</p>
-
-<div class="doc_code">
-<pre>
- (* Emit the step value. *)
- let step_val =
- match step with
- | Some step -&gt; codegen_expr step
- (* If not specified, use 1.0. *)
- | None -&gt; const_float double_type 1.0
- in
-
- let next_var = build_add variable step_val "nextvar" builder in
-</pre>
-</div>
-
-<p>Now that the body is emitted, we compute the next value of the iteration
-variable by adding the step value, or 1.0 if it isn't present.
-'<tt>next_var</tt>' will be the value of the loop variable on the next iteration
-of the loop.</p>
-
-<div class="doc_code">
-<pre>
- (* Compute the end condition. *)
- let end_cond = codegen_expr end_ in
-
- (* Convert condition to a bool by comparing equal to 0.0. *)
- let zero = const_float double_type 0.0 in
- let end_cond = build_fcmp Fcmp.One end_cond zero "loopcond" builder in
-</pre>
-</div>
-
-<p>Finally, we evaluate the exit value of the loop, to determine whether the
-loop should exit. This mirrors the condition evaluation for the if/then/else
-statement.</p>
-
-<div class="doc_code">
-<pre>
- (* Create the "after loop" block and insert it. *)
- let loop_end_bb = insertion_block builder in
- let after_bb = append_block "afterloop" the_function in
-
- (* Insert the conditional branch into the end of loop_end_bb. *)
- ignore (build_cond_br end_cond loop_bb after_bb builder);
-
- (* Any new code will be inserted in after_bb. *)
- position_at_end after_bb builder;
-</pre>
-</div>
-
-<p>With the code for the body of the loop complete, we just need to finish up
-the control flow for it. This code remembers the end block (for the phi node), then creates the block for the loop exit ("afterloop"). Based on the value of the
-exit condition, it creates a conditional branch that chooses between executing
-the loop again and exiting the loop. Any future code is emitted in the
-"afterloop" block, so it sets the insertion position to it.</p>
-
-<div class="doc_code">
-<pre>
- (* Add a new entry to the PHI node for the backedge. *)
- add_incoming (next_var, loop_end_bb) variable;
-
- (* Restore the unshadowed variable. *)
- begin match old_val with
- | Some old_val -&gt; Hashtbl.add named_values var_name old_val
- | None -&gt; ()
- end;
-
- (* for expr always returns 0.0. *)
- const_null double_type
-</pre>
-</div>
-
-<p>The final code handles various cleanups: now that we have the
-"<tt>next_var</tt>" value, we can add the incoming value to the loop PHI node.
-After that, we remove the loop variable from the symbol table, so that it isn't
-in scope after the for loop. Finally, code generation of the for loop always
-returns 0.0, so that is what we return from <tt>Codegen.codegen_expr</tt>.</p>
-
-<p>With this, we conclude the "adding control flow to Kaleidoscope" chapter of
-the tutorial. In this chapter we added two control flow constructs, and used
-them to motivate a couple of aspects of the LLVM IR that are important for
-front-end implementors to know. In the next chapter of our saga, we will get
-a bit crazier and add <a href="OCamlLangImpl6.html">user-defined operators</a>
-to our poor innocent language.</p>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section"><a name="code">Full Code Listing</a></div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>
-Here is the complete code listing for our running example, enhanced with the
-if/then/else and for expressions.. To build this example, use:
-</p>
-
-<div class="doc_code">
-<pre>
-# Compile
-ocamlbuild toy.byte
-# Run
-./toy.byte
-</pre>
-</div>
-
-<p>Here is the code:</p>
-
-<dl>
-<dt>_tags:</dt>
-<dd class="doc_code">
-<pre>
-&lt;{lexer,parser}.ml&gt;: use_camlp4, pp(camlp4of)
-&lt;*.{byte,native}&gt;: g++, use_llvm, use_llvm_analysis
-&lt;*.{byte,native}&gt;: use_llvm_executionengine, use_llvm_target
-&lt;*.{byte,native}&gt;: use_llvm_scalar_opts, use_bindings
-</pre>
-</dd>
-
-<dt>myocamlbuild.ml:</dt>
-<dd class="doc_code">
-<pre>
-open Ocamlbuild_plugin;;
-
-ocaml_lib ~extern:true "llvm";;
-ocaml_lib ~extern:true "llvm_analysis";;
-ocaml_lib ~extern:true "llvm_executionengine";;
-ocaml_lib ~extern:true "llvm_target";;
-ocaml_lib ~extern:true "llvm_scalar_opts";;
-
-flag ["link"; "ocaml"; "g++"] (S[A"-cc"; A"g++"]);;
-dep ["link"; "ocaml"; "use_bindings"] ["bindings.o"];;
-</pre>
-</dd>
-
-<dt>token.ml:</dt>
-<dd class="doc_code">
-<pre>
-(*===----------------------------------------------------------------------===
- * Lexer Tokens
- *===----------------------------------------------------------------------===*)
-
-(* The lexer returns these 'Kwd' if it is an unknown character, otherwise one of
- * these others for known things. *)
-type token =
- (* commands *)
- | Def | Extern
-
- (* primary *)
- | Ident of string | Number of float
-
- (* unknown *)
- | Kwd of char
-
- (* control *)
- | If | Then | Else
- | For | In
-</pre>
-</dd>
-
-<dt>lexer.ml:</dt>
-<dd class="doc_code">
-<pre>
-(*===----------------------------------------------------------------------===
- * Lexer
- *===----------------------------------------------------------------------===*)
-
-let rec lex = parser
- (* Skip any whitespace. *)
- | [&lt; ' (' ' | '\n' | '\r' | '\t'); stream &gt;] -&gt; lex stream
-
- (* identifier: [a-zA-Z][a-zA-Z0-9] *)
- | [&lt; ' ('A' .. 'Z' | 'a' .. 'z' as c); stream &gt;] -&gt;
- let buffer = Buffer.create 1 in
- Buffer.add_char buffer c;
- lex_ident buffer stream
-
- (* number: [0-9.]+ *)
- | [&lt; ' ('0' .. '9' as c); stream &gt;] -&gt;
- let buffer = Buffer.create 1 in
- Buffer.add_char buffer c;
- lex_number buffer stream
-
- (* Comment until end of line. *)
- | [&lt; ' ('#'); stream &gt;] -&gt;
- lex_comment stream
-
- (* Otherwise, just return the character as its ascii value. *)
- | [&lt; 'c; stream &gt;] -&gt;
- [&lt; 'Token.Kwd c; lex stream &gt;]
-
- (* end of stream. *)
- | [&lt; &gt;] -&gt; [&lt; &gt;]
-
-and lex_number buffer = parser
- | [&lt; ' ('0' .. '9' | '.' as c); stream &gt;] -&gt;
- Buffer.add_char buffer c;
- lex_number buffer stream
- | [&lt; stream=lex &gt;] -&gt;
- [&lt; 'Token.Number (float_of_string (Buffer.contents buffer)); stream &gt;]
-
-and lex_ident buffer = parser
- | [&lt; ' ('A' .. 'Z' | 'a' .. 'z' | '0' .. '9' as c); stream &gt;] -&gt;
- Buffer.add_char buffer c;
- lex_ident buffer stream
- | [&lt; stream=lex &gt;] -&gt;
- match Buffer.contents buffer with
- | "def" -&gt; [&lt; 'Token.Def; stream &gt;]
- | "extern" -&gt; [&lt; 'Token.Extern; stream &gt;]
- | "if" -&gt; [&lt; 'Token.If; stream &gt;]
- | "then" -&gt; [&lt; 'Token.Then; stream &gt;]
- | "else" -&gt; [&lt; 'Token.Else; stream &gt;]
- | "for" -&gt; [&lt; 'Token.For; stream &gt;]
- | "in" -&gt; [&lt; 'Token.In; stream &gt;]
- | id -&gt; [&lt; 'Token.Ident id; stream &gt;]
-
-and lex_comment = parser
- | [&lt; ' ('\n'); stream=lex &gt;] -&gt; stream
- | [&lt; 'c; e=lex_comment &gt;] -&gt; e
- | [&lt; &gt;] -&gt; [&lt; &gt;]
-</pre>
-</dd>
-
-<dt>ast.ml:</dt>
-<dd class="doc_code">
-<pre>
-(*===----------------------------------------------------------------------===
- * Abstract Syntax Tree (aka Parse Tree)
- *===----------------------------------------------------------------------===*)
-
-(* expr - Base type for all expression nodes. *)
-type expr =
- (* variant for numeric literals like "1.0". *)
- | Number of float
-
- (* variant for referencing a variable, like "a". *)
- | Variable of string
-
- (* variant for a binary operator. *)
- | Binary of char * expr * expr
-
- (* variant for function calls. *)
- | Call of string * expr array
-
- (* variant for if/then/else. *)
- | If of expr * expr * expr
-
- (* variant for for/in. *)
- | For of string * expr * expr * expr option * expr
-
-(* proto - This type represents the "prototype" for a function, which captures
- * its name, and its argument names (thus implicitly the number of arguments the
- * function takes). *)
-type proto = Prototype of string * string array
-
-(* func - This type represents a function definition itself. *)
-type func = Function of proto * expr
-</pre>
-</dd>
-
-<dt>parser.ml:</dt>
-<dd class="doc_code">
-<pre>
-(*===---------------------------------------------------------------------===
- * Parser
- *===---------------------------------------------------------------------===*)
-
-(* binop_precedence - This holds the precedence for each binary operator that is
- * defined *)
-let binop_precedence:(char, int) Hashtbl.t = Hashtbl.create 10
-
-(* precedence - Get the precedence of the pending binary operator token. *)
-let precedence c = try Hashtbl.find binop_precedence c with Not_found -&gt; -1
-
-(* primary
- * ::= identifier
- * ::= numberexpr
- * ::= parenexpr
- * ::= ifexpr
- * ::= forexpr *)
-let rec parse_primary = parser
- (* numberexpr ::= number *)
- | [&lt; 'Token.Number n &gt;] -&gt; Ast.Number n
-
- (* parenexpr ::= '(' expression ')' *)
- | [&lt; 'Token.Kwd '('; e=parse_expr; 'Token.Kwd ')' ?? "expected ')'" &gt;] -&gt; e
-
- (* identifierexpr
- * ::= identifier
- * ::= identifier '(' argumentexpr ')' *)
- | [&lt; 'Token.Ident id; stream &gt;] -&gt;
- let rec parse_args accumulator = parser
- | [&lt; e=parse_expr; stream &gt;] -&gt;
- begin parser
- | [&lt; 'Token.Kwd ','; e=parse_args (e :: accumulator) &gt;] -&gt; e
- | [&lt; &gt;] -&gt; e :: accumulator
- end stream
- | [&lt; &gt;] -&gt; accumulator
- in
- let rec parse_ident id = parser
- (* Call. *)
- | [&lt; 'Token.Kwd '(';
- args=parse_args [];
- 'Token.Kwd ')' ?? "expected ')'"&gt;] -&gt;
- Ast.Call (id, Array.of_list (List.rev args))
-
- (* Simple variable ref. *)
- | [&lt; &gt;] -&gt; Ast.Variable id
- in
- parse_ident id stream
-
- (* ifexpr ::= 'if' expr 'then' expr 'else' expr *)
- | [&lt; 'Token.If; c=parse_expr;
- 'Token.Then ?? "expected 'then'"; t=parse_expr;
- 'Token.Else ?? "expected 'else'"; e=parse_expr &gt;] -&gt;
- Ast.If (c, t, e)
-
- (* forexpr
- ::= 'for' identifier '=' expr ',' expr (',' expr)? 'in' expression *)
- | [&lt; 'Token.For;
- 'Token.Ident id ?? "expected identifier after for";
- 'Token.Kwd '=' ?? "expected '=' after for";
- stream &gt;] -&gt;
- begin parser
- | [&lt;
- start=parse_expr;
- 'Token.Kwd ',' ?? "expected ',' after for";
- end_=parse_expr;
- stream &gt;] -&gt;
- let step =
- begin parser
- | [&lt; 'Token.Kwd ','; step=parse_expr &gt;] -&gt; Some step
- | [&lt; &gt;] -&gt; None
- end stream
- in
- begin parser
- | [&lt; 'Token.In; body=parse_expr &gt;] -&gt;
- Ast.For (id, start, end_, step, body)
- | [&lt; &gt;] -&gt;
- raise (Stream.Error "expected 'in' after for")
- end stream
- | [&lt; &gt;] -&gt;
- raise (Stream.Error "expected '=' after for")
- end stream
-
- | [&lt; &gt;] -&gt; raise (Stream.Error "unknown token when expecting an expression.")
-
-(* binoprhs
- * ::= ('+' primary)* *)
-and parse_bin_rhs expr_prec lhs stream =
- match Stream.peek stream with
- (* If this is a binop, find its precedence. *)
- | Some (Token.Kwd c) when Hashtbl.mem binop_precedence c -&gt;
- let token_prec = precedence c in
-
- (* If this is a binop that binds at least as tightly as the current binop,
- * consume it, otherwise we are done. *)
- if token_prec &lt; expr_prec then lhs else begin
- (* Eat the binop. *)
- Stream.junk stream;
-
- (* Parse the primary expression after the binary operator. *)
- let rhs = parse_primary stream in
-
- (* Okay, we know this is a binop. *)
- let rhs =
- match Stream.peek stream with
- | Some (Token.Kwd c2) -&gt;
- (* If BinOp binds less tightly with rhs than the operator after
- * rhs, let the pending operator take rhs as its lhs. *)
- let next_prec = precedence c2 in
- if token_prec &lt; next_prec
- then parse_bin_rhs (token_prec + 1) rhs stream
- else rhs
- | _ -&gt; rhs
- in
-
- (* Merge lhs/rhs. *)
- let lhs = Ast.Binary (c, lhs, rhs) in
- parse_bin_rhs expr_prec lhs stream
- end
- | _ -&gt; lhs
-
-(* expression
- * ::= primary binoprhs *)
-and parse_expr = parser
- | [&lt; lhs=parse_primary; stream &gt;] -&gt; parse_bin_rhs 0 lhs stream
-
-(* prototype
- * ::= id '(' id* ')' *)
-let parse_prototype =
- let rec parse_args accumulator = parser
- | [&lt; 'Token.Ident id; e=parse_args (id::accumulator) &gt;] -&gt; e
- | [&lt; &gt;] -&gt; accumulator
- in
-
- parser
- | [&lt; 'Token.Ident id;
- 'Token.Kwd '(' ?? "expected '(' in prototype";
- args=parse_args [];
- 'Token.Kwd ')' ?? "expected ')' in prototype" &gt;] -&gt;
- (* success. *)
- Ast.Prototype (id, Array.of_list (List.rev args))
-
- | [&lt; &gt;] -&gt;
- raise (Stream.Error "expected function name in prototype")
-
-(* definition ::= 'def' prototype expression *)
-let parse_definition = parser
- | [&lt; 'Token.Def; p=parse_prototype; e=parse_expr &gt;] -&gt;
- Ast.Function (p, e)
-
-(* toplevelexpr ::= expression *)
-let parse_toplevel = parser
- | [&lt; e=parse_expr &gt;] -&gt;
- (* Make an anonymous proto. *)
- Ast.Function (Ast.Prototype ("", [||]), e)
-
-(* external ::= 'extern' prototype *)
-let parse_extern = parser
- | [&lt; 'Token.Extern; e=parse_prototype &gt;] -&gt; e
-</pre>
-</dd>
-
-<dt>codegen.ml:</dt>
-<dd class="doc_code">
-<pre>
-(*===----------------------------------------------------------------------===
- * Code Generation
- *===----------------------------------------------------------------------===*)
-
-open Llvm
-
-exception Error of string
-
-let the_module = create_module "my cool jit"
-let builder = builder ()
-let named_values:(string, llvalue) Hashtbl.t = Hashtbl.create 10
-
-let rec codegen_expr = function
- | Ast.Number n -&gt; const_float double_type n
- | Ast.Variable name -&gt;
- (try Hashtbl.find named_values name with
- | Not_found -&gt; raise (Error "unknown variable name"))
- | Ast.Binary (op, lhs, rhs) -&gt;
- let lhs_val = codegen_expr lhs in
- let rhs_val = codegen_expr rhs in
- begin
- match op with
- | '+' -&gt; build_add lhs_val rhs_val "addtmp" builder
- | '-' -&gt; build_sub lhs_val rhs_val "subtmp" builder
- | '*' -&gt; build_mul lhs_val rhs_val "multmp" builder
- | '&lt;' -&gt;
- (* Convert bool 0/1 to double 0.0 or 1.0 *)
- let i = build_fcmp Fcmp.Ult lhs_val rhs_val "cmptmp" builder in
- build_uitofp i double_type "booltmp" builder
- | _ -&gt; raise (Error "invalid binary operator")
- end
- | Ast.Call (callee, args) -&gt;
- (* Look up the name in the module table. *)
- let callee =
- match lookup_function callee the_module with
- | Some callee -&gt; callee
- | None -&gt; raise (Error "unknown function referenced")
- in
- let params = params callee in
-
- (* If argument mismatch error. *)
- if Array.length params == Array.length args then () else
- raise (Error "incorrect # arguments passed");
- let args = Array.map codegen_expr args in
- build_call callee args "calltmp" builder
- | Ast.If (cond, then_, else_) -&gt;
- let cond = codegen_expr cond in
-
- (* Convert condition to a bool by comparing equal to 0.0 *)
- let zero = const_float double_type 0.0 in
- let cond_val = build_fcmp Fcmp.One cond zero "ifcond" builder in
-
- (* Grab the first block so that we might later add the conditional branch
- * to it at the end of the function. *)
- let start_bb = insertion_block builder in
- let the_function = block_parent start_bb in
-
- let then_bb = append_block "then" the_function in
-
- (* Emit 'then' value. *)
- position_at_end then_bb builder;
- let then_val = codegen_expr then_ in
-
- (* Codegen of 'then' can change the current block, update then_bb for the
- * phi. We create a new name because one is used for the phi node, and the
- * other is used for the conditional branch. *)
- let new_then_bb = insertion_block builder in
-
- (* Emit 'else' value. *)
- let else_bb = append_block "else" the_function in
- position_at_end else_bb builder;
- let else_val = codegen_expr else_ in
-
- (* Codegen of 'else' can change the current block, update else_bb for the
- * phi. *)
- let new_else_bb = insertion_block builder in
-
- (* Emit merge block. *)
- let merge_bb = append_block "ifcont" the_function in
- position_at_end merge_bb builder;
- let incoming = [(then_val, new_then_bb); (else_val, new_else_bb)] in
- let phi = build_phi incoming "iftmp" builder in
-
- (* Return to the start block to add the conditional branch. *)
- position_at_end start_bb builder;
- ignore (build_cond_br cond_val then_bb else_bb builder);
-
- (* Set a unconditional branch at the end of the 'then' block and the
- * 'else' block to the 'merge' block. *)
- position_at_end new_then_bb builder; ignore (build_br merge_bb builder);
- position_at_end new_else_bb builder; ignore (build_br merge_bb builder);
-
- (* Finally, set the builder to the end of the merge block. *)
- position_at_end merge_bb builder;
-
- phi
- | Ast.For (var_name, start, end_, step, body) -&gt;
- (* Emit the start code first, without 'variable' in scope. *)
- let start_val = codegen_expr start in
-
- (* Make the new basic block for the loop header, inserting after current
- * block. *)
- let preheader_bb = insertion_block builder in
- let the_function = block_parent preheader_bb in
- let loop_bb = append_block "loop" the_function in
-
- (* Insert an explicit fall through from the current block to the
- * loop_bb. *)
- ignore (build_br loop_bb builder);
-
- (* Start insertion in loop_bb. *)
- position_at_end loop_bb builder;
-
- (* Start the PHI node with an entry for start. *)
- let variable = build_phi [(start_val, preheader_bb)] var_name builder in
-
- (* Within the loop, the variable is defined equal to the PHI node. If it
- * shadows an existing variable, we have to restore it, so save it
- * now. *)
- let old_val =
- try Some (Hashtbl.find named_values var_name) with Not_found -&gt; None
- in
- Hashtbl.add named_values var_name variable;
-
- (* Emit the body of the loop. This, like any other expr, can change the
- * current BB. Note that we ignore the value computed by the body, but
- * don't allow an error *)
- ignore (codegen_expr body);
-
- (* Emit the step value. *)
- let step_val =
- match step with
- | Some step -&gt; codegen_expr step
- (* If not specified, use 1.0. *)
- | None -&gt; const_float double_type 1.0
- in
-
- let next_var = build_add variable step_val "nextvar" builder in
-
- (* Compute the end condition. *)
- let end_cond = codegen_expr end_ in
-
- (* Convert condition to a bool by comparing equal to 0.0. *)
- let zero = const_float double_type 0.0 in
- let end_cond = build_fcmp Fcmp.One end_cond zero "loopcond" builder in
-
- (* Create the "after loop" block and insert it. *)
- let loop_end_bb = insertion_block builder in
- let after_bb = append_block "afterloop" the_function in
-
- (* Insert the conditional branch into the end of loop_end_bb. *)
- ignore (build_cond_br end_cond loop_bb after_bb builder);
-
- (* Any new code will be inserted in after_bb. *)
- position_at_end after_bb builder;
-
- (* Add a new entry to the PHI node for the backedge. *)
- add_incoming (next_var, loop_end_bb) variable;
-
- (* Restore the unshadowed variable. *)
- begin match old_val with
- | Some old_val -&gt; Hashtbl.add named_values var_name old_val
- | None -&gt; ()
- end;
-
- (* for expr always returns 0.0. *)
- const_null double_type
-
-let codegen_proto = function
- | Ast.Prototype (name, args) -&gt;
- (* Make the function type: double(double,double) etc. *)
- let doubles = Array.make (Array.length args) double_type in
- let ft = function_type double_type doubles in
- let f =
- match lookup_function name the_module with
- | None -&gt; declare_function name ft the_module
-
- (* If 'f' conflicted, there was already something named 'name'. If it
- * has a body, don't allow redefinition or reextern. *)
- | Some f -&gt;
- (* If 'f' already has a body, reject this. *)
- if block_begin f &lt;&gt; At_end f then
- raise (Error "redefinition of function");
-
- (* If 'f' took a different number of arguments, reject. *)
- if element_type (type_of f) &lt;&gt; ft then
- raise (Error "redefinition of function with different # args");
- f
- in
-
- (* Set names for all arguments. *)
- Array.iteri (fun i a -&gt;
- let n = args.(i) in
- set_value_name n a;
- Hashtbl.add named_values n a;
- ) (params f);
- f
-
-let codegen_func the_fpm = function
- | Ast.Function (proto, body) -&gt;
- Hashtbl.clear named_values;
- let the_function = codegen_proto proto in
-
- (* Create a new basic block to start insertion into. *)
- let bb = append_block "entry" the_function in
- position_at_end bb builder;
-
- try
- let ret_val = codegen_expr body in
-
- (* Finish off the function. *)
- let _ = build_ret ret_val builder in
-
- (* Validate the generated code, checking for consistency. *)
- Llvm_analysis.assert_valid_function the_function;
-
- (* Optimize the function. *)
- let _ = PassManager.run_function the_function the_fpm in
-
- the_function
- with e -&gt;
- delete_function the_function;
- raise e
-</pre>
-</dd>
-
-<dt>toplevel.ml:</dt>
-<dd class="doc_code">
-<pre>
-(*===----------------------------------------------------------------------===
- * Top-Level parsing and JIT Driver
- *===----------------------------------------------------------------------===*)
-
-open Llvm
-open Llvm_executionengine
-
-(* top ::= definition | external | expression | ';' *)
-let rec main_loop the_fpm the_execution_engine stream =
- match Stream.peek stream with
- | None -&gt; ()
-
- (* ignore top-level semicolons. *)
- | Some (Token.Kwd ';') -&gt;
- Stream.junk stream;
- main_loop the_fpm the_execution_engine stream
-
- | Some token -&gt;
- begin
- try match token with
- | Token.Def -&gt;
- let e = Parser.parse_definition stream in
- print_endline "parsed a function definition.";
- dump_value (Codegen.codegen_func the_fpm e);
- | Token.Extern -&gt;
- let e = Parser.parse_extern stream in
- print_endline "parsed an extern.";
- dump_value (Codegen.codegen_proto e);
- | _ -&gt;
- (* Evaluate a top-level expression into an anonymous function. *)
- let e = Parser.parse_toplevel stream in
- print_endline "parsed a top-level expr";
- let the_function = Codegen.codegen_func the_fpm e in
- dump_value the_function;
-
- (* JIT the function, returning a function pointer. *)
- let result = ExecutionEngine.run_function the_function [||]
- the_execution_engine in
-
- print_string "Evaluated to ";
- print_float (GenericValue.as_float double_type result);
- print_newline ();
- with Stream.Error s | Codegen.Error s -&gt;
- (* Skip token for error recovery. *)
- Stream.junk stream;
- print_endline s;
- end;
- print_string "ready&gt; "; flush stdout;
- main_loop the_fpm the_execution_engine stream
-</pre>
-</dd>
-
-<dt>toy.ml:</dt>
-<dd class="doc_code">
-<pre>
-(*===----------------------------------------------------------------------===
- * Main driver code.
- *===----------------------------------------------------------------------===*)
-
-open Llvm
-open Llvm_executionengine
-open Llvm_target
-open Llvm_scalar_opts
-
-let main () =
- (* Install standard binary operators.
- * 1 is the lowest precedence. *)
- Hashtbl.add Parser.binop_precedence '&lt;' 10;
- Hashtbl.add Parser.binop_precedence '+' 20;
- Hashtbl.add Parser.binop_precedence '-' 20;
- Hashtbl.add Parser.binop_precedence '*' 40; (* highest. *)
-
- (* Prime the first token. *)
- print_string "ready&gt; "; flush stdout;
- let stream = Lexer.lex (Stream.of_channel stdin) in
-
- (* Create the JIT. *)
- let the_module_provider = ModuleProvider.create Codegen.the_module in
- let the_execution_engine = ExecutionEngine.create the_module_provider in
- let the_fpm = PassManager.create_function the_module_provider in
-
- (* Set up the optimizer pipeline. Start with registering info about how the
- * target lays out data structures. *)
- TargetData.add (ExecutionEngine.target_data the_execution_engine) the_fpm;
-
- (* Do simple "peephole" optimizations and bit-twiddling optzn. *)
- add_instruction_combining the_fpm;
-
- (* reassociate expressions. *)
- add_reassociation the_fpm;
-
- (* Eliminate Common SubExpressions. *)
- add_gvn the_fpm;
-
- (* Simplify the control flow graph (deleting unreachable blocks, etc). *)
- add_cfg_simplification the_fpm;
-
- (* Run the main "interpreter loop" now. *)
- Toplevel.main_loop the_fpm the_execution_engine stream;
-
- (* Print out all the generated code. *)
- dump_module Codegen.the_module
-;;
-
-main ()
-</pre>
-</dd>
-
-<dt>bindings.c</dt>
-<dd class="doc_code">
-<pre>
-#include &lt;stdio.h&gt;
-
-/* putchard - putchar that takes a double and returns 0. */
-extern double putchard(double X) {
- putchar((char)X);
- return 0;
-}
-</pre>
-</dd>
-</dl>
-
-<a href="OCamlLangImpl6.html">Next: Extending the language: user-defined
-operators</a>
-</div>
-
-<!-- *********************************************************************** -->
-<hr>
-<address>
- <a href="http://jigsaw.w3.org/css-validator/check/referer"><img
- src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"></a>
- <a href="http://validator.w3.org/check/referer"><img
- src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!"></a>
-
- <a href="mailto:sabre@nondot.org">Chris Lattner</a><br>
- <a href="mailto:idadesub@users.sourceforge.net">Erick Tryzelaar</a><br>
- <a href="http://llvm.org">The LLVM Compiler Infrastructure</a><br>
- Last modified: $Date: 2007-10-17 11:05:13 -0700 (Wed, 17 Oct 2007) $
-</address>
-</body>
-</html>
diff --git a/release_23/docs/tutorial/OCamlLangImpl6.html b/release_23/docs/tutorial/OCamlLangImpl6.html
deleted file mode 100644
index 780cab819142..000000000000
--- a/release_23/docs/tutorial/OCamlLangImpl6.html
+++ /dev/null
@@ -1,1569 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
- "http://www.w3.org/TR/html4/strict.dtd">
-
-<html>
-<head>
- <title>Kaleidoscope: Extending the Language: User-defined Operators</title>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <meta name="author" content="Chris Lattner">
- <meta name="author" content="Erick Tryzelaar">
- <link rel="stylesheet" href="../llvm.css" type="text/css">
-</head>
-
-<body>
-
-<div class="doc_title">Kaleidoscope: Extending the Language: User-defined Operators</div>
-
-<ul>
-<li><a href="index.html">Up to Tutorial Index</a></li>
-<li>Chapter 6
- <ol>
- <li><a href="#intro">Chapter 6 Introduction</a></li>
- <li><a href="#idea">User-defined Operators: the Idea</a></li>
- <li><a href="#binary">User-defined Binary Operators</a></li>
- <li><a href="#unary">User-defined Unary Operators</a></li>
- <li><a href="#example">Kicking the Tires</a></li>
- <li><a href="#code">Full Code Listing</a></li>
- </ol>
-</li>
-<li><a href="OCamlLangImpl7.html">Chapter 7</a>: Extending the Language: Mutable
-Variables / SSA Construction</li>
-</ul>
-
-<div class="doc_author">
- <p>
- Written by <a href="mailto:sabre@nondot.org">Chris Lattner</a>
- and <a href="mailto:idadesub@users.sourceforge.net">Erick Tryzelaar</a>
- </p>
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section"><a name="intro">Chapter 6 Introduction</a></div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>Welcome to Chapter 6 of the "<a href="index.html">Implementing a language
-with LLVM</a>" tutorial. At this point in our tutorial, we now have a fully
-functional language that is fairly minimal, but also useful. There
-is still one big problem with it, however. Our language doesn't have many
-useful operators (like division, logical negation, or even any comparisons
-besides less-than).</p>
-
-<p>This chapter of the tutorial takes a wild digression into adding user-defined
-operators to the simple and beautiful Kaleidoscope language. This digression now
-gives us a simple and ugly language in some ways, but also a powerful one at the
-same time. One of the great things about creating your own language is that you
-get to decide what is good or bad. In this tutorial we'll assume that it is
-okay to use this as a way to show some interesting parsing techniques.</p>
-
-<p>At the end of this tutorial, we'll run through an example Kaleidoscope
-application that <a href="#example">renders the Mandelbrot set</a>. This gives
-an example of what you can build with Kaleidoscope and its feature set.</p>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section"><a name="idea">User-defined Operators: the Idea</a></div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>
-The "operator overloading" that we will add to Kaleidoscope is more general than
-languages like C++. In C++, you are only allowed to redefine existing
-operators: you can't programatically change the grammar, introduce new
-operators, change precedence levels, etc. In this chapter, we will add this
-capability to Kaleidoscope, which will let the user round out the set of
-operators that are supported.</p>
-
-<p>The point of going into user-defined operators in a tutorial like this is to
-show the power and flexibility of using a hand-written parser. Thus far, the parser
-we have been implementing uses recursive descent for most parts of the grammar and
-operator precedence parsing for the expressions. See <a
-href="OCamlLangImpl2.html">Chapter 2</a> for details. Without using operator
-precedence parsing, it would be very difficult to allow the programmer to
-introduce new operators into the grammar: the grammar is dynamically extensible
-as the JIT runs.</p>
-
-<p>The two specific features we'll add are programmable unary operators (right
-now, Kaleidoscope has no unary operators at all) as well as binary operators.
-An example of this is:</p>
-
-<div class="doc_code">
-<pre>
-# Logical unary not.
-def unary!(v)
- if v then
- 0
- else
- 1;
-
-# Define &gt; with the same precedence as &lt;.
-def binary&gt; 10 (LHS RHS)
- RHS &lt; LHS;
-
-# Binary "logical or", (note that it does not "short circuit")
-def binary| 5 (LHS RHS)
- if LHS then
- 1
- else if RHS then
- 1
- else
- 0;
-
-# Define = with slightly lower precedence than relationals.
-def binary= 9 (LHS RHS)
- !(LHS &lt; RHS | LHS &gt; RHS);
-</pre>
-</div>
-
-<p>Many languages aspire to being able to implement their standard runtime
-library in the language itself. In Kaleidoscope, we can implement significant
-parts of the language in the library!</p>
-
-<p>We will break down implementation of these features into two parts:
-implementing support for user-defined binary operators and adding unary
-operators.</p>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section"><a name="binary">User-defined Binary Operators</a></div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>Adding support for user-defined binary operators is pretty simple with our
-current framework. We'll first add support for the unary/binary keywords:</p>
-
-<div class="doc_code">
-<pre>
-type token =
- ...
- <b>(* operators *)
- | Binary | Unary</b>
-
-...
-
-and lex_ident buffer = parser
- ...
- | "for" -&gt; [&lt; 'Token.For; stream &gt;]
- | "in" -&gt; [&lt; 'Token.In; stream &gt;]
- <b>| "binary" -&gt; [&lt; 'Token.Binary; stream &gt;]
- | "unary" -&gt; [&lt; 'Token.Unary; stream &gt;]</b>
-</pre>
-</div>
-
-<p>This just adds lexer support for the unary and binary keywords, like we
-did in <a href="OCamlLangImpl5.html#iflexer">previous chapters</a>. One nice
-thing about our current AST, is that we represent binary operators with full
-generalisation by using their ASCII code as the opcode. For our extended
-operators, we'll use this same representation, so we don't need any new AST or
-parser support.</p>
-
-<p>On the other hand, we have to be able to represent the definitions of these
-new operators, in the "def binary| 5" part of the function definition. In our
-grammar so far, the "name" for the function definition is parsed as the
-"prototype" production and into the <tt>Ast.Prototype</tt> AST node. To
-represent our new user-defined operators as prototypes, we have to extend
-the <tt>Ast.Prototype</tt> AST node like this:</p>
-
-<div class="doc_code">
-<pre>
-(* proto - This type represents the "prototype" for a function, which captures
- * its name, and its argument names (thus implicitly the number of arguments the
- * function takes). *)
-type proto =
- | Prototype of string * string array
- <b>| BinOpPrototype of string * string array * int</b>
-</pre>
-</div>
-
-<p>Basically, in addition to knowing a name for the prototype, we now keep track
-of whether it was an operator, and if it was, what precedence level the operator
-is at. The precedence is only used for binary operators (as you'll see below,
-it just doesn't apply for unary operators). Now that we have a way to represent
-the prototype for a user-defined operator, we need to parse it:</p>
-
-<div class="doc_code">
-<pre>
-(* prototype
- * ::= id '(' id* ')'
- <b>* ::= binary LETTER number? (id, id)
- * ::= unary LETTER number? (id) *)</b>
-let parse_prototype =
- let rec parse_args accumulator = parser
- | [&lt; 'Token.Ident id; e=parse_args (id::accumulator) &gt;] -&gt; e
- | [&lt; &gt;] -&gt; accumulator
- in
- let parse_operator = parser
- | [&lt; 'Token.Unary &gt;] -&gt; "unary", 1
- | [&lt; 'Token.Binary &gt;] -&gt; "binary", 2
- in
- let parse_binary_precedence = parser
- | [&lt; 'Token.Number n &gt;] -&gt; int_of_float n
- | [&lt; &gt;] -&gt; 30
- in
- parser
- | [&lt; 'Token.Ident id;
- 'Token.Kwd '(' ?? "expected '(' in prototype";
- args=parse_args [];
- 'Token.Kwd ')' ?? "expected ')' in prototype" &gt;] -&gt;
- (* success. *)
- Ast.Prototype (id, Array.of_list (List.rev args))
- <b>| [&lt; (prefix, kind)=parse_operator;
- 'Token.Kwd op ?? "expected an operator";
- (* Read the precedence if present. *)
- binary_precedence=parse_binary_precedence;
- 'Token.Kwd '(' ?? "expected '(' in prototype";
- args=parse_args [];
- 'Token.Kwd ')' ?? "expected ')' in prototype" &gt;] -&gt;
- let name = prefix ^ (String.make 1 op) in
- let args = Array.of_list (List.rev args) in
-
- (* Verify right number of arguments for operator. *)
- if Array.length args != kind
- then raise (Stream.Error "invalid number of operands for operator")
- else
- if kind == 1 then
- Ast.Prototype (name, args)
- else
- Ast.BinOpPrototype (name, args, binary_precedence)</b>
- | [&lt; &gt;] -&gt;
- raise (Stream.Error "expected function name in prototype")
-</pre>
-</div>
-
-<p>This is all fairly straightforward parsing code, and we have already seen
-a lot of similar code in the past. One interesting part about the code above is
-the couple lines that set up <tt>name</tt> for binary operators. This builds
-names like "binary@" for a newly defined "@" operator. This then takes
-advantage of the fact that symbol names in the LLVM symbol table are allowed to
-have any character in them, including embedded nul characters.</p>
-
-<p>The next interesting thing to add, is codegen support for these binary
-operators. Given our current structure, this is a simple addition of a default
-case for our existing binary operator node:</p>
-
-<div class="doc_code">
-<pre>
-let codegen_expr = function
- ...
- | Ast.Binary (op, lhs, rhs) -&gt;
- let lhs_val = codegen_expr lhs in
- let rhs_val = codegen_expr rhs in
- begin
- match op with
- | '+' -&gt; build_add lhs_val rhs_val "addtmp" builder
- | '-' -&gt; build_sub lhs_val rhs_val "subtmp" builder
- | '*' -&gt; build_mul lhs_val rhs_val "multmp" builder
- | '&lt;' -&gt;
- (* Convert bool 0/1 to double 0.0 or 1.0 *)
- let i = build_fcmp Fcmp.Ult lhs_val rhs_val "cmptmp" builder in
- build_uitofp i double_type "booltmp" builder
- <b>| _ -&gt;
- (* If it wasn't a builtin binary operator, it must be a user defined
- * one. Emit a call to it. *)
- let callee = "binary" ^ (String.make 1 op) in
- let callee =
- match lookup_function callee the_module with
- | Some callee -&gt; callee
- | None -&gt; raise (Error "binary operator not found!")
- in
- build_call callee [|lhs_val; rhs_val|] "binop" builder</b>
- end
-</pre>
-</div>
-
-<p>As you can see above, the new code is actually really simple. It just does
-a lookup for the appropriate operator in the symbol table and generates a
-function call to it. Since user-defined operators are just built as normal
-functions (because the "prototype" boils down to a function with the right
-name) everything falls into place.</p>
-
-<p>The final piece of code we are missing, is a bit of top level magic:</p>
-
-<div class="doc_code">
-<pre>
-let codegen_func the_fpm = function
- | Ast.Function (proto, body) -&gt;
- Hashtbl.clear named_values;
- let the_function = codegen_proto proto in
-
- <b>(* If this is an operator, install it. *)
- begin match proto with
- | Ast.BinOpPrototype (name, args, prec) -&gt;
- let op = name.[String.length name - 1] in
- Hashtbl.add Parser.binop_precedence op prec;
- | _ -&gt; ()
- end;</b>
-
- (* Create a new basic block to start insertion into. *)
- let bb = append_block "entry" the_function in
- position_at_end bb builder;
- ...
-</pre>
-</div>
-
-<p>Basically, before codegening a function, if it is a user-defined operator, we
-register it in the precedence table. This allows the binary operator parsing
-logic we already have in place to handle it. Since we are working on a
-fully-general operator precedence parser, this is all we need to do to "extend
-the grammar".</p>
-
-<p>Now we have useful user-defined binary operators. This builds a lot
-on the previous framework we built for other operators. Adding unary operators
-is a bit more challenging, because we don't have any framework for it yet - lets
-see what it takes.</p>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section"><a name="unary">User-defined Unary Operators</a></div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>Since we don't currently support unary operators in the Kaleidoscope
-language, we'll need to add everything to support them. Above, we added simple
-support for the 'unary' keyword to the lexer. In addition to that, we need an
-AST node:</p>
-
-<div class="doc_code">
-<pre>
-type expr =
- ...
- (* variant for a unary operator. *)
- | Unary of char * expr
- ...
-</pre>
-</div>
-
-<p>This AST node is very simple and obvious by now. It directly mirrors the
-binary operator AST node, except that it only has one child. With this, we
-need to add the parsing logic. Parsing a unary operator is pretty simple: we'll
-add a new function to do it:</p>
-
-<div class="doc_code">
-<pre>
-(* unary
- * ::= primary
- * ::= '!' unary *)
-and parse_unary = parser
- (* If this is a unary operator, read it. *)
- | [&lt; 'Token.Kwd op when op != '(' &amp;&amp; op != ')'; operand=parse_expr &gt;] -&gt;
- Ast.Unary (op, operand)
-
- (* If the current token is not an operator, it must be a primary expr. *)
- | [&lt; stream &gt;] -&gt; parse_primary stream
-</pre>
-</div>
-
-<p>The grammar we add is pretty straightforward here. If we see a unary
-operator when parsing a primary operator, we eat the operator as a prefix and
-parse the remaining piece as another unary operator. This allows us to handle
-multiple unary operators (e.g. "!!x"). Note that unary operators can't have
-ambiguous parses like binary operators can, so there is no need for precedence
-information.</p>
-
-<p>The problem with this function, is that we need to call ParseUnary from
-somewhere. To do this, we change previous callers of ParsePrimary to call
-<tt>parse_unary</tt> instead:</p>
-
-<div class="doc_code">
-<pre>
-(* binoprhs
- * ::= ('+' primary)* *)
-and parse_bin_rhs expr_prec lhs stream =
- ...
- <b>(* Parse the unary expression after the binary operator. *)
- let rhs = parse_unary stream in</b>
- ...
-
-...
-
-(* expression
- * ::= primary binoprhs *)
-and parse_expr = parser
- | [&lt; lhs=<b>parse_unary</b>; stream &gt;] -&gt; parse_bin_rhs 0 lhs stream
-</pre>
-</div>
-
-<p>With these two simple changes, we are now able to parse unary operators and build the
-AST for them. Next up, we need to add parser support for prototypes, to parse
-the unary operator prototype. We extend the binary operator code above
-with:</p>
-
-<div class="doc_code">
-<pre>
-(* prototype
- * ::= id '(' id* ')'
- * ::= binary LETTER number? (id, id)
- <b>* ::= unary LETTER number? (id)</b> *)
-let parse_prototype =
- let rec parse_args accumulator = parser
- | [&lt; 'Token.Ident id; e=parse_args (id::accumulator) &gt;] -&gt; e
- | [&lt; &gt;] -&gt; accumulator
- in
- <b>let parse_operator = parser
- | [&lt; 'Token.Unary &gt;] -&gt; "unary", 1
- | [&lt; 'Token.Binary &gt;] -&gt; "binary", 2
- in</b>
- let parse_binary_precedence = parser
- | [&lt; 'Token.Number n &gt;] -&gt; int_of_float n
- | [&lt; &gt;] -&gt; 30
- in
- parser
- | [&lt; 'Token.Ident id;
- 'Token.Kwd '(' ?? "expected '(' in prototype";
- args=parse_args [];
- 'Token.Kwd ')' ?? "expected ')' in prototype" &gt;] -&gt;
- (* success. *)
- Ast.Prototype (id, Array.of_list (List.rev args))
- <b>| [&lt; (prefix, kind)=parse_operator;
- 'Token.Kwd op ?? "expected an operator";
- (* Read the precedence if present. *)
- binary_precedence=parse_binary_precedence;
- 'Token.Kwd '(' ?? "expected '(' in prototype";
- args=parse_args [];
- 'Token.Kwd ')' ?? "expected ')' in prototype" &gt;] -&gt;
- let name = prefix ^ (String.make 1 op) in
- let args = Array.of_list (List.rev args) in
-
- (* Verify right number of arguments for operator. *)
- if Array.length args != kind
- then raise (Stream.Error "invalid number of operands for operator")
- else
- if kind == 1 then
- Ast.Prototype (name, args)
- else
- Ast.BinOpPrototype (name, args, binary_precedence)</b>
- | [&lt; &gt;] -&gt;
- raise (Stream.Error "expected function name in prototype")
-</pre>
-</div>
-
-<p>As with binary operators, we name unary operators with a name that includes
-the operator character. This assists us at code generation time. Speaking of,
-the final piece we need to add is codegen support for unary operators. It looks
-like this:</p>
-
-<div class="doc_code">
-<pre>
-let rec codegen_expr = function
- ...
- | Ast.Unary (op, operand) -&gt;
- let operand = codegen_expr operand in
- let callee = "unary" ^ (String.make 1 op) in
- let callee =
- match lookup_function callee the_module with
- | Some callee -&gt; callee
- | None -&gt; raise (Error "unknown unary operator")
- in
- build_call callee [|operand|] "unop" builder
-</pre>
-</div>
-
-<p>This code is similar to, but simpler than, the code for binary operators. It
-is simpler primarily because it doesn't need to handle any predefined operators.
-</p>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section"><a name="example">Kicking the Tires</a></div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>It is somewhat hard to believe, but with a few simple extensions we've
-covered in the last chapters, we have grown a real-ish language. With this, we
-can do a lot of interesting things, including I/O, math, and a bunch of other
-things. For example, we can now add a nice sequencing operator (printd is
-defined to print out the specified value and a newline):</p>
-
-<div class="doc_code">
-<pre>
-ready&gt; <b>extern printd(x);</b>
-Read extern: declare double @printd(double)
-ready&gt; <b>def binary : 1 (x y) 0; # Low-precedence operator that ignores operands.</b>
-..
-ready&gt; <b>printd(123) : printd(456) : printd(789);</b>
-123.000000
-456.000000
-789.000000
-Evaluated to 0.000000
-</pre>
-</div>
-
-<p>We can also define a bunch of other "primitive" operations, such as:</p>
-
-<div class="doc_code">
-<pre>
-# Logical unary not.
-def unary!(v)
- if v then
- 0
- else
- 1;
-
-# Unary negate.
-def unary-(v)
- 0-v;
-
-# Define &gt; with the same precedence as &gt;.
-def binary&gt; 10 (LHS RHS)
- RHS &lt; LHS;
-
-# Binary logical or, which does not short circuit.
-def binary| 5 (LHS RHS)
- if LHS then
- 1
- else if RHS then
- 1
- else
- 0;
-
-# Binary logical and, which does not short circuit.
-def binary&amp; 6 (LHS RHS)
- if !LHS then
- 0
- else
- !!RHS;
-
-# Define = with slightly lower precedence than relationals.
-def binary = 9 (LHS RHS)
- !(LHS &lt; RHS | LHS &gt; RHS);
-
-</pre>
-</div>
-
-
-<p>Given the previous if/then/else support, we can also define interesting
-functions for I/O. For example, the following prints out a character whose
-"density" reflects the value passed in: the lower the value, the denser the
-character:</p>
-
-<div class="doc_code">
-<pre>
-ready&gt;
-<b>
-extern putchard(char)
-def printdensity(d)
- if d &gt; 8 then
- putchard(32) # ' '
- else if d &gt; 4 then
- putchard(46) # '.'
- else if d &gt; 2 then
- putchard(43) # '+'
- else
- putchard(42); # '*'</b>
-...
-ready&gt; <b>printdensity(1): printdensity(2): printdensity(3) :
- printdensity(4): printdensity(5): printdensity(9): putchard(10);</b>
-*++..
-Evaluated to 0.000000
-</pre>
-</div>
-
-<p>Based on these simple primitive operations, we can start to define more
-interesting things. For example, here's a little function that solves for the
-number of iterations it takes a function in the complex plane to
-converge:</p>
-
-<div class="doc_code">
-<pre>
-# determine whether the specific location diverges.
-# Solve for z = z^2 + c in the complex plane.
-def mandleconverger(real imag iters creal cimag)
- if iters &gt; 255 | (real*real + imag*imag &gt; 4) then
- iters
- else
- mandleconverger(real*real - imag*imag + creal,
- 2*real*imag + cimag,
- iters+1, creal, cimag);
-
-# return the number of iterations required for the iteration to escape
-def mandleconverge(real imag)
- mandleconverger(real, imag, 0, real, imag);
-</pre>
-</div>
-
-<p>This "z = z<sup>2</sup> + c" function is a beautiful little creature that is the basis
-for computation of the <a
-href="http://en.wikipedia.org/wiki/Mandelbrot_set">Mandelbrot Set</a>. Our
-<tt>mandelconverge</tt> function returns the number of iterations that it takes
-for a complex orbit to escape, saturating to 255. This is not a very useful
-function by itself, but if you plot its value over a two-dimensional plane,
-you can see the Mandelbrot set. Given that we are limited to using putchard
-here, our amazing graphical output is limited, but we can whip together
-something using the density plotter above:</p>
-
-<div class="doc_code">
-<pre>
-# compute and plot the mandlebrot set with the specified 2 dimensional range
-# info.
-def mandelhelp(xmin xmax xstep ymin ymax ystep)
- for y = ymin, y &lt; ymax, ystep in (
- (for x = xmin, x &lt; xmax, xstep in
- printdensity(mandleconverge(x,y)))
- : putchard(10)
- )
-
-# mandel - This is a convenient helper function for ploting the mandelbrot set
-# from the specified position with the specified Magnification.
-def mandel(realstart imagstart realmag imagmag)
- mandelhelp(realstart, realstart+realmag*78, realmag,
- imagstart, imagstart+imagmag*40, imagmag);
-</pre>
-</div>
-
-<p>Given this, we can try plotting out the mandlebrot set! Lets try it out:</p>
-
-<div class="doc_code">
-<pre>
-ready&gt; <b>mandel(-2.3, -1.3, 0.05, 0.07);</b>
-*******************************+++++++++++*************************************
-*************************+++++++++++++++++++++++*******************************
-**********************+++++++++++++++++++++++++++++****************************
-*******************+++++++++++++++++++++.. ...++++++++*************************
-*****************++++++++++++++++++++++.... ...+++++++++***********************
-***************+++++++++++++++++++++++..... ...+++++++++*********************
-**************+++++++++++++++++++++++.... ....+++++++++********************
-*************++++++++++++++++++++++...... .....++++++++*******************
-************+++++++++++++++++++++....... .......+++++++******************
-***********+++++++++++++++++++.... ... .+++++++*****************
-**********+++++++++++++++++....... .+++++++****************
-*********++++++++++++++........... ...+++++++***************
-********++++++++++++............ ...++++++++**************
-********++++++++++... .......... .++++++++**************
-*******+++++++++..... .+++++++++*************
-*******++++++++...... ..+++++++++*************
-*******++++++....... ..+++++++++*************
-*******+++++...... ..+++++++++*************
-*******.... .... ...+++++++++*************
-*******.... . ...+++++++++*************
-*******+++++...... ...+++++++++*************
-*******++++++....... ..+++++++++*************
-*******++++++++...... .+++++++++*************
-*******+++++++++..... ..+++++++++*************
-********++++++++++... .......... .++++++++**************
-********++++++++++++............ ...++++++++**************
-*********++++++++++++++.......... ...+++++++***************
-**********++++++++++++++++........ .+++++++****************
-**********++++++++++++++++++++.... ... ..+++++++****************
-***********++++++++++++++++++++++....... .......++++++++*****************
-************+++++++++++++++++++++++...... ......++++++++******************
-**************+++++++++++++++++++++++.... ....++++++++********************
-***************+++++++++++++++++++++++..... ...+++++++++*********************
-*****************++++++++++++++++++++++.... ...++++++++***********************
-*******************+++++++++++++++++++++......++++++++*************************
-*********************++++++++++++++++++++++.++++++++***************************
-*************************+++++++++++++++++++++++*******************************
-******************************+++++++++++++************************************
-*******************************************************************************
-*******************************************************************************
-*******************************************************************************
-Evaluated to 0.000000
-ready&gt; <b>mandel(-2, -1, 0.02, 0.04);</b>
-**************************+++++++++++++++++++++++++++++++++++++++++++++++++++++
-***********************++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-*********************+++++++++++++++++++++++++++++++++++++++++++++++++++++++++.
-*******************+++++++++++++++++++++++++++++++++++++++++++++++++++++++++...
-*****************+++++++++++++++++++++++++++++++++++++++++++++++++++++++++.....
-***************++++++++++++++++++++++++++++++++++++++++++++++++++++++++........
-**************++++++++++++++++++++++++++++++++++++++++++++++++++++++...........
-************+++++++++++++++++++++++++++++++++++++++++++++++++++++..............
-***********++++++++++++++++++++++++++++++++++++++++++++++++++........ .
-**********++++++++++++++++++++++++++++++++++++++++++++++.............
-********+++++++++++++++++++++++++++++++++++++++++++..................
-*******+++++++++++++++++++++++++++++++++++++++.......................
-******+++++++++++++++++++++++++++++++++++...........................
-*****++++++++++++++++++++++++++++++++............................
-*****++++++++++++++++++++++++++++...............................
-****++++++++++++++++++++++++++...... .........................
-***++++++++++++++++++++++++......... ...... ...........
-***++++++++++++++++++++++............
-**+++++++++++++++++++++..............
-**+++++++++++++++++++................
-*++++++++++++++++++.................
-*++++++++++++++++............ ...
-*++++++++++++++..............
-*+++....++++................
-*.......... ...........
-*
-*.......... ...........
-*+++....++++................
-*++++++++++++++..............
-*++++++++++++++++............ ...
-*++++++++++++++++++.................
-**+++++++++++++++++++................
-**+++++++++++++++++++++..............
-***++++++++++++++++++++++............
-***++++++++++++++++++++++++......... ...... ...........
-****++++++++++++++++++++++++++...... .........................
-*****++++++++++++++++++++++++++++...............................
-*****++++++++++++++++++++++++++++++++............................
-******+++++++++++++++++++++++++++++++++++...........................
-*******+++++++++++++++++++++++++++++++++++++++.......................
-********+++++++++++++++++++++++++++++++++++++++++++..................
-Evaluated to 0.000000
-ready&gt; <b>mandel(-0.9, -1.4, 0.02, 0.03);</b>
-*******************************************************************************
-*******************************************************************************
-*******************************************************************************
-**********+++++++++++++++++++++************************************************
-*+++++++++++++++++++++++++++++++++++++++***************************************
-+++++++++++++++++++++++++++++++++++++++++++++**********************************
-++++++++++++++++++++++++++++++++++++++++++++++++++*****************************
-++++++++++++++++++++++++++++++++++++++++++++++++++++++*************************
-+++++++++++++++++++++++++++++++++++++++++++++++++++++++++**********************
-+++++++++++++++++++++++++++++++++.........++++++++++++++++++*******************
-+++++++++++++++++++++++++++++++.... ......+++++++++++++++++++****************
-+++++++++++++++++++++++++++++....... ........+++++++++++++++++++**************
-++++++++++++++++++++++++++++........ ........++++++++++++++++++++************
-+++++++++++++++++++++++++++......... .. ...+++++++++++++++++++++**********
-++++++++++++++++++++++++++........... ....++++++++++++++++++++++********
-++++++++++++++++++++++++............. .......++++++++++++++++++++++******
-+++++++++++++++++++++++............. ........+++++++++++++++++++++++****
-++++++++++++++++++++++........... ..........++++++++++++++++++++++***
-++++++++++++++++++++........... .........++++++++++++++++++++++*
-++++++++++++++++++............ ...........++++++++++++++++++++
-++++++++++++++++............... .............++++++++++++++++++
-++++++++++++++................. ...............++++++++++++++++
-++++++++++++.................. .................++++++++++++++
-+++++++++.................. .................+++++++++++++
-++++++........ . ......... ..++++++++++++
-++............ ...... ....++++++++++
-.............. ...++++++++++
-.............. ....+++++++++
-.............. .....++++++++
-............. ......++++++++
-........... .......++++++++
-......... ........+++++++
-......... ........+++++++
-......... ....+++++++
-........ ...+++++++
-....... ...+++++++
- ....+++++++
- .....+++++++
- ....+++++++
- ....+++++++
- ....+++++++
-Evaluated to 0.000000
-ready&gt; <b>^D</b>
-</pre>
-</div>
-
-<p>At this point, you may be starting to realize that Kaleidoscope is a real
-and powerful language. It may not be self-similar :), but it can be used to
-plot things that are!</p>
-
-<p>With this, we conclude the "adding user-defined operators" chapter of the
-tutorial. We have successfully augmented our language, adding the ability to
-extend the language in the library, and we have shown how this can be used to
-build a simple but interesting end-user application in Kaleidoscope. At this
-point, Kaleidoscope can build a variety of applications that are functional and
-can call functions with side-effects, but it can't actually define and mutate a
-variable itself.</p>
-
-<p>Strikingly, variable mutation is an important feature of some
-languages, and it is not at all obvious how to <a href="OCamlLangImpl7.html">add
-support for mutable variables</a> without having to add an "SSA construction"
-phase to your front-end. In the next chapter, we will describe how you can
-add variable mutation without building SSA in your front-end.</p>
-
-</div>
-
-
-<!-- *********************************************************************** -->
-<div class="doc_section"><a name="code">Full Code Listing</a></div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>
-Here is the complete code listing for our running example, enhanced with the
-if/then/else and for expressions.. To build this example, use:
-</p>
-
-<div class="doc_code">
-<pre>
-# Compile
-ocamlbuild toy.byte
-# Run
-./toy.byte
-</pre>
-</div>
-
-<p>Here is the code:</p>
-
-<dl>
-<dt>_tags:</dt>
-<dd class="doc_code">
-<pre>
-&lt;{lexer,parser}.ml&gt;: use_camlp4, pp(camlp4of)
-&lt;*.{byte,native}&gt;: g++, use_llvm, use_llvm_analysis
-&lt;*.{byte,native}&gt;: use_llvm_executionengine, use_llvm_target
-&lt;*.{byte,native}&gt;: use_llvm_scalar_opts, use_bindings
-</pre>
-</dd>
-
-<dt>myocamlbuild.ml:</dt>
-<dd class="doc_code">
-<pre>
-open Ocamlbuild_plugin;;
-
-ocaml_lib ~extern:true "llvm";;
-ocaml_lib ~extern:true "llvm_analysis";;
-ocaml_lib ~extern:true "llvm_executionengine";;
-ocaml_lib ~extern:true "llvm_target";;
-ocaml_lib ~extern:true "llvm_scalar_opts";;
-
-flag ["link"; "ocaml"; "g++"] (S[A"-cc"; A"g++"]);;
-dep ["link"; "ocaml"; "use_bindings"] ["bindings.o"];;
-</pre>
-</dd>
-
-<dt>token.ml:</dt>
-<dd class="doc_code">
-<pre>
-(*===----------------------------------------------------------------------===
- * Lexer Tokens
- *===----------------------------------------------------------------------===*)
-
-(* The lexer returns these 'Kwd' if it is an unknown character, otherwise one of
- * these others for known things. *)
-type token =
- (* commands *)
- | Def | Extern
-
- (* primary *)
- | Ident of string | Number of float
-
- (* unknown *)
- | Kwd of char
-
- (* control *)
- | If | Then | Else
- | For | In
-
- (* operators *)
- | Binary | Unary
-</pre>
-</dd>
-
-<dt>lexer.ml:</dt>
-<dd class="doc_code">
-<pre>
-(*===----------------------------------------------------------------------===
- * Lexer
- *===----------------------------------------------------------------------===*)
-
-let rec lex = parser
- (* Skip any whitespace. *)
- | [&lt; ' (' ' | '\n' | '\r' | '\t'); stream &gt;] -&gt; lex stream
-
- (* identifier: [a-zA-Z][a-zA-Z0-9] *)
- | [&lt; ' ('A' .. 'Z' | 'a' .. 'z' as c); stream &gt;] -&gt;
- let buffer = Buffer.create 1 in
- Buffer.add_char buffer c;
- lex_ident buffer stream
-
- (* number: [0-9.]+ *)
- | [&lt; ' ('0' .. '9' as c); stream &gt;] -&gt;
- let buffer = Buffer.create 1 in
- Buffer.add_char buffer c;
- lex_number buffer stream
-
- (* Comment until end of line. *)
- | [&lt; ' ('#'); stream &gt;] -&gt;
- lex_comment stream
-
- (* Otherwise, just return the character as its ascii value. *)
- | [&lt; 'c; stream &gt;] -&gt;
- [&lt; 'Token.Kwd c; lex stream &gt;]
-
- (* end of stream. *)
- | [&lt; &gt;] -&gt; [&lt; &gt;]
-
-and lex_number buffer = parser
- | [&lt; ' ('0' .. '9' | '.' as c); stream &gt;] -&gt;
- Buffer.add_char buffer c;
- lex_number buffer stream
- | [&lt; stream=lex &gt;] -&gt;
- [&lt; 'Token.Number (float_of_string (Buffer.contents buffer)); stream &gt;]
-
-and lex_ident buffer = parser
- | [&lt; ' ('A' .. 'Z' | 'a' .. 'z' | '0' .. '9' as c); stream &gt;] -&gt;
- Buffer.add_char buffer c;
- lex_ident buffer stream
- | [&lt; stream=lex &gt;] -&gt;
- match Buffer.contents buffer with
- | "def" -&gt; [&lt; 'Token.Def; stream &gt;]
- | "extern" -&gt; [&lt; 'Token.Extern; stream &gt;]
- | "if" -&gt; [&lt; 'Token.If; stream &gt;]
- | "then" -&gt; [&lt; 'Token.Then; stream &gt;]
- | "else" -&gt; [&lt; 'Token.Else; stream &gt;]
- | "for" -&gt; [&lt; 'Token.For; stream &gt;]
- | "in" -&gt; [&lt; 'Token.In; stream &gt;]
- | "binary" -&gt; [&lt; 'Token.Binary; stream &gt;]
- | "unary" -&gt; [&lt; 'Token.Unary; stream &gt;]
- | id -&gt; [&lt; 'Token.Ident id; stream &gt;]
-
-and lex_comment = parser
- | [&lt; ' ('\n'); stream=lex &gt;] -&gt; stream
- | [&lt; 'c; e=lex_comment &gt;] -&gt; e
- | [&lt; &gt;] -&gt; [&lt; &gt;]
-</pre>
-</dd>
-
-<dt>ast.ml:</dt>
-<dd class="doc_code">
-<pre>
-(*===----------------------------------------------------------------------===
- * Abstract Syntax Tree (aka Parse Tree)
- *===----------------------------------------------------------------------===*)
-
-(* expr - Base type for all expression nodes. *)
-type expr =
- (* variant for numeric literals like "1.0". *)
- | Number of float
-
- (* variant for referencing a variable, like "a". *)
- | Variable of string
-
- (* variant for a unary operator. *)
- | Unary of char * expr
-
- (* variant for a binary operator. *)
- | Binary of char * expr * expr
-
- (* variant for function calls. *)
- | Call of string * expr array
-
- (* variant for if/then/else. *)
- | If of expr * expr * expr
-
- (* variant for for/in. *)
- | For of string * expr * expr * expr option * expr
-
-(* proto - This type represents the "prototype" for a function, which captures
- * its name, and its argument names (thus implicitly the number of arguments the
- * function takes). *)
-type proto =
- | Prototype of string * string array
- | BinOpPrototype of string * string array * int
-
-(* func - This type represents a function definition itself. *)
-type func = Function of proto * expr
-</pre>
-</dd>
-
-<dt>parser.ml:</dt>
-<dd class="doc_code">
-<pre>
-(*===---------------------------------------------------------------------===
- * Parser
- *===---------------------------------------------------------------------===*)
-
-(* binop_precedence - This holds the precedence for each binary operator that is
- * defined *)
-let binop_precedence:(char, int) Hashtbl.t = Hashtbl.create 10
-
-(* precedence - Get the precedence of the pending binary operator token. *)
-let precedence c = try Hashtbl.find binop_precedence c with Not_found -&gt; -1
-
-(* primary
- * ::= identifier
- * ::= numberexpr
- * ::= parenexpr
- * ::= ifexpr
- * ::= forexpr *)
-let rec parse_primary = parser
- (* numberexpr ::= number *)
- | [&lt; 'Token.Number n &gt;] -&gt; Ast.Number n
-
- (* parenexpr ::= '(' expression ')' *)
- | [&lt; 'Token.Kwd '('; e=parse_expr; 'Token.Kwd ')' ?? "expected ')'" &gt;] -&gt; e
-
- (* identifierexpr
- * ::= identifier
- * ::= identifier '(' argumentexpr ')' *)
- | [&lt; 'Token.Ident id; stream &gt;] -&gt;
- let rec parse_args accumulator = parser
- | [&lt; e=parse_expr; stream &gt;] -&gt;
- begin parser
- | [&lt; 'Token.Kwd ','; e=parse_args (e :: accumulator) &gt;] -&gt; e
- | [&lt; &gt;] -&gt; e :: accumulator
- end stream
- | [&lt; &gt;] -&gt; accumulator
- in
- let rec parse_ident id = parser
- (* Call. *)
- | [&lt; 'Token.Kwd '(';
- args=parse_args [];
- 'Token.Kwd ')' ?? "expected ')'"&gt;] -&gt;
- Ast.Call (id, Array.of_list (List.rev args))
-
- (* Simple variable ref. *)
- | [&lt; &gt;] -&gt; Ast.Variable id
- in
- parse_ident id stream
-
- (* ifexpr ::= 'if' expr 'then' expr 'else' expr *)
- | [&lt; 'Token.If; c=parse_expr;
- 'Token.Then ?? "expected 'then'"; t=parse_expr;
- 'Token.Else ?? "expected 'else'"; e=parse_expr &gt;] -&gt;
- Ast.If (c, t, e)
-
- (* forexpr
- ::= 'for' identifier '=' expr ',' expr (',' expr)? 'in' expression *)
- | [&lt; 'Token.For;
- 'Token.Ident id ?? "expected identifier after for";
- 'Token.Kwd '=' ?? "expected '=' after for";
- stream &gt;] -&gt;
- begin parser
- | [&lt;
- start=parse_expr;
- 'Token.Kwd ',' ?? "expected ',' after for";
- end_=parse_expr;
- stream &gt;] -&gt;
- let step =
- begin parser
- | [&lt; 'Token.Kwd ','; step=parse_expr &gt;] -&gt; Some step
- | [&lt; &gt;] -&gt; None
- end stream
- in
- begin parser
- | [&lt; 'Token.In; body=parse_expr &gt;] -&gt;
- Ast.For (id, start, end_, step, body)
- | [&lt; &gt;] -&gt;
- raise (Stream.Error "expected 'in' after for")
- end stream
- | [&lt; &gt;] -&gt;
- raise (Stream.Error "expected '=' after for")
- end stream
-
- | [&lt; &gt;] -&gt; raise (Stream.Error "unknown token when expecting an expression.")
-
-(* unary
- * ::= primary
- * ::= '!' unary *)
-and parse_unary = parser
- (* If this is a unary operator, read it. *)
- | [&lt; 'Token.Kwd op when op != '(' &amp;&amp; op != ')'; operand=parse_expr &gt;] -&gt;
- Ast.Unary (op, operand)
-
- (* If the current token is not an operator, it must be a primary expr. *)
- | [&lt; stream &gt;] -&gt; parse_primary stream
-
-(* binoprhs
- * ::= ('+' primary)* *)
-and parse_bin_rhs expr_prec lhs stream =
- match Stream.peek stream with
- (* If this is a binop, find its precedence. *)
- | Some (Token.Kwd c) when Hashtbl.mem binop_precedence c -&gt;
- let token_prec = precedence c in
-
- (* If this is a binop that binds at least as tightly as the current binop,
- * consume it, otherwise we are done. *)
- if token_prec &lt; expr_prec then lhs else begin
- (* Eat the binop. *)
- Stream.junk stream;
-
- (* Parse the unary expression after the binary operator. *)
- let rhs = parse_unary stream in
-
- (* Okay, we know this is a binop. *)
- let rhs =
- match Stream.peek stream with
- | Some (Token.Kwd c2) -&gt;
- (* If BinOp binds less tightly with rhs than the operator after
- * rhs, let the pending operator take rhs as its lhs. *)
- let next_prec = precedence c2 in
- if token_prec &lt; next_prec
- then parse_bin_rhs (token_prec + 1) rhs stream
- else rhs
- | _ -&gt; rhs
- in
-
- (* Merge lhs/rhs. *)
- let lhs = Ast.Binary (c, lhs, rhs) in
- parse_bin_rhs expr_prec lhs stream
- end
- | _ -&gt; lhs
-
-(* expression
- * ::= primary binoprhs *)
-and parse_expr = parser
- | [&lt; lhs=parse_unary; stream &gt;] -&gt; parse_bin_rhs 0 lhs stream
-
-(* prototype
- * ::= id '(' id* ')'
- * ::= binary LETTER number? (id, id)
- * ::= unary LETTER number? (id) *)
-let parse_prototype =
- let rec parse_args accumulator = parser
- | [&lt; 'Token.Ident id; e=parse_args (id::accumulator) &gt;] -&gt; e
- | [&lt; &gt;] -&gt; accumulator
- in
- let parse_operator = parser
- | [&lt; 'Token.Unary &gt;] -&gt; "unary", 1
- | [&lt; 'Token.Binary &gt;] -&gt; "binary", 2
- in
- let parse_binary_precedence = parser
- | [&lt; 'Token.Number n &gt;] -&gt; int_of_float n
- | [&lt; &gt;] -&gt; 30
- in
- parser
- | [&lt; 'Token.Ident id;
- 'Token.Kwd '(' ?? "expected '(' in prototype";
- args=parse_args [];
- 'Token.Kwd ')' ?? "expected ')' in prototype" &gt;] -&gt;
- (* success. *)
- Ast.Prototype (id, Array.of_list (List.rev args))
- | [&lt; (prefix, kind)=parse_operator;
- 'Token.Kwd op ?? "expected an operator";
- (* Read the precedence if present. *)
- binary_precedence=parse_binary_precedence;
- 'Token.Kwd '(' ?? "expected '(' in prototype";
- args=parse_args [];
- 'Token.Kwd ')' ?? "expected ')' in prototype" &gt;] -&gt;
- let name = prefix ^ (String.make 1 op) in
- let args = Array.of_list (List.rev args) in
-
- (* Verify right number of arguments for operator. *)
- if Array.length args != kind
- then raise (Stream.Error "invalid number of operands for operator")
- else
- if kind == 1 then
- Ast.Prototype (name, args)
- else
- Ast.BinOpPrototype (name, args, binary_precedence)
- | [&lt; &gt;] -&gt;
- raise (Stream.Error "expected function name in prototype")
-
-(* definition ::= 'def' prototype expression *)
-let parse_definition = parser
- | [&lt; 'Token.Def; p=parse_prototype; e=parse_expr &gt;] -&gt;
- Ast.Function (p, e)
-
-(* toplevelexpr ::= expression *)
-let parse_toplevel = parser
- | [&lt; e=parse_expr &gt;] -&gt;
- (* Make an anonymous proto. *)
- Ast.Function (Ast.Prototype ("", [||]), e)
-
-(* external ::= 'extern' prototype *)
-let parse_extern = parser
- | [&lt; 'Token.Extern; e=parse_prototype &gt;] -&gt; e
-</pre>
-</dd>
-
-<dt>codegen.ml:</dt>
-<dd class="doc_code">
-<pre>
-(*===----------------------------------------------------------------------===
- * Code Generation
- *===----------------------------------------------------------------------===*)
-
-open Llvm
-
-exception Error of string
-
-let the_module = create_module "my cool jit"
-let builder = builder ()
-let named_values:(string, llvalue) Hashtbl.t = Hashtbl.create 10
-
-let rec codegen_expr = function
- | Ast.Number n -&gt; const_float double_type n
- | Ast.Variable name -&gt;
- (try Hashtbl.find named_values name with
- | Not_found -&gt; raise (Error "unknown variable name"))
- | Ast.Unary (op, operand) -&gt;
- let operand = codegen_expr operand in
- let callee = "unary" ^ (String.make 1 op) in
- let callee =
- match lookup_function callee the_module with
- | Some callee -&gt; callee
- | None -&gt; raise (Error "unknown unary operator")
- in
- build_call callee [|operand|] "unop" builder
- | Ast.Binary (op, lhs, rhs) -&gt;
- let lhs_val = codegen_expr lhs in
- let rhs_val = codegen_expr rhs in
- begin
- match op with
- | '+' -&gt; build_add lhs_val rhs_val "addtmp" builder
- | '-' -&gt; build_sub lhs_val rhs_val "subtmp" builder
- | '*' -&gt; build_mul lhs_val rhs_val "multmp" builder
- | '&lt;' -&gt;
- (* Convert bool 0/1 to double 0.0 or 1.0 *)
- let i = build_fcmp Fcmp.Ult lhs_val rhs_val "cmptmp" builder in
- build_uitofp i double_type "booltmp" builder
- | _ -&gt;
- (* If it wasn't a builtin binary operator, it must be a user defined
- * one. Emit a call to it. *)
- let callee = "binary" ^ (String.make 1 op) in
- let callee =
- match lookup_function callee the_module with
- | Some callee -&gt; callee
- | None -&gt; raise (Error "binary operator not found!")
- in
- build_call callee [|lhs_val; rhs_val|] "binop" builder
- end
- | Ast.Call (callee, args) -&gt;
- (* Look up the name in the module table. *)
- let callee =
- match lookup_function callee the_module with
- | Some callee -&gt; callee
- | None -&gt; raise (Error "unknown function referenced")
- in
- let params = params callee in
-
- (* If argument mismatch error. *)
- if Array.length params == Array.length args then () else
- raise (Error "incorrect # arguments passed");
- let args = Array.map codegen_expr args in
- build_call callee args "calltmp" builder
- | Ast.If (cond, then_, else_) -&gt;
- let cond = codegen_expr cond in
-
- (* Convert condition to a bool by comparing equal to 0.0 *)
- let zero = const_float double_type 0.0 in
- let cond_val = build_fcmp Fcmp.One cond zero "ifcond" builder in
-
- (* Grab the first block so that we might later add the conditional branch
- * to it at the end of the function. *)
- let start_bb = insertion_block builder in
- let the_function = block_parent start_bb in
-
- let then_bb = append_block "then" the_function in
-
- (* Emit 'then' value. *)
- position_at_end then_bb builder;
- let then_val = codegen_expr then_ in
-
- (* Codegen of 'then' can change the current block, update then_bb for the
- * phi. We create a new name because one is used for the phi node, and the
- * other is used for the conditional branch. *)
- let new_then_bb = insertion_block builder in
-
- (* Emit 'else' value. *)
- let else_bb = append_block "else" the_function in
- position_at_end else_bb builder;
- let else_val = codegen_expr else_ in
-
- (* Codegen of 'else' can change the current block, update else_bb for the
- * phi. *)
- let new_else_bb = insertion_block builder in
-
- (* Emit merge block. *)
- let merge_bb = append_block "ifcont" the_function in
- position_at_end merge_bb builder;
- let incoming = [(then_val, new_then_bb); (else_val, new_else_bb)] in
- let phi = build_phi incoming "iftmp" builder in
-
- (* Return to the start block to add the conditional branch. *)
- position_at_end start_bb builder;
- ignore (build_cond_br cond_val then_bb else_bb builder);
-
- (* Set a unconditional branch at the end of the 'then' block and the
- * 'else' block to the 'merge' block. *)
- position_at_end new_then_bb builder; ignore (build_br merge_bb builder);
- position_at_end new_else_bb builder; ignore (build_br merge_bb builder);
-
- (* Finally, set the builder to the end of the merge block. *)
- position_at_end merge_bb builder;
-
- phi
- | Ast.For (var_name, start, end_, step, body) -&gt;
- (* Emit the start code first, without 'variable' in scope. *)
- let start_val = codegen_expr start in
-
- (* Make the new basic block for the loop header, inserting after current
- * block. *)
- let preheader_bb = insertion_block builder in
- let the_function = block_parent preheader_bb in
- let loop_bb = append_block "loop" the_function in
-
- (* Insert an explicit fall through from the current block to the
- * loop_bb. *)
- ignore (build_br loop_bb builder);
-
- (* Start insertion in loop_bb. *)
- position_at_end loop_bb builder;
-
- (* Start the PHI node with an entry for start. *)
- let variable = build_phi [(start_val, preheader_bb)] var_name builder in
-
- (* Within the loop, the variable is defined equal to the PHI node. If it
- * shadows an existing variable, we have to restore it, so save it
- * now. *)
- let old_val =
- try Some (Hashtbl.find named_values var_name) with Not_found -&gt; None
- in
- Hashtbl.add named_values var_name variable;
-
- (* Emit the body of the loop. This, like any other expr, can change the
- * current BB. Note that we ignore the value computed by the body, but
- * don't allow an error *)
- ignore (codegen_expr body);
-
- (* Emit the step value. *)
- let step_val =
- match step with
- | Some step -&gt; codegen_expr step
- (* If not specified, use 1.0. *)
- | None -&gt; const_float double_type 1.0
- in
-
- let next_var = build_add variable step_val "nextvar" builder in
-
- (* Compute the end condition. *)
- let end_cond = codegen_expr end_ in
-
- (* Convert condition to a bool by comparing equal to 0.0. *)
- let zero = const_float double_type 0.0 in
- let end_cond = build_fcmp Fcmp.One end_cond zero "loopcond" builder in
-
- (* Create the "after loop" block and insert it. *)
- let loop_end_bb = insertion_block builder in
- let after_bb = append_block "afterloop" the_function in
-
- (* Insert the conditional branch into the end of loop_end_bb. *)
- ignore (build_cond_br end_cond loop_bb after_bb builder);
-
- (* Any new code will be inserted in after_bb. *)
- position_at_end after_bb builder;
-
- (* Add a new entry to the PHI node for the backedge. *)
- add_incoming (next_var, loop_end_bb) variable;
-
- (* Restore the unshadowed variable. *)
- begin match old_val with
- | Some old_val -&gt; Hashtbl.add named_values var_name old_val
- | None -&gt; ()
- end;
-
- (* for expr always returns 0.0. *)
- const_null double_type
-
-let codegen_proto = function
- | Ast.Prototype (name, args) | Ast.BinOpPrototype (name, args, _) -&gt;
- (* Make the function type: double(double,double) etc. *)
- let doubles = Array.make (Array.length args) double_type in
- let ft = function_type double_type doubles in
- let f =
- match lookup_function name the_module with
- | None -&gt; declare_function name ft the_module
-
- (* If 'f' conflicted, there was already something named 'name'. If it
- * has a body, don't allow redefinition or reextern. *)
- | Some f -&gt;
- (* If 'f' already has a body, reject this. *)
- if block_begin f &lt;&gt; At_end f then
- raise (Error "redefinition of function");
-
- (* If 'f' took a different number of arguments, reject. *)
- if element_type (type_of f) &lt;&gt; ft then
- raise (Error "redefinition of function with different # args");
- f
- in
-
- (* Set names for all arguments. *)
- Array.iteri (fun i a -&gt;
- let n = args.(i) in
- set_value_name n a;
- Hashtbl.add named_values n a;
- ) (params f);
- f
-
-let codegen_func the_fpm = function
- | Ast.Function (proto, body) -&gt;
- Hashtbl.clear named_values;
- let the_function = codegen_proto proto in
-
- (* If this is an operator, install it. *)
- begin match proto with
- | Ast.BinOpPrototype (name, args, prec) -&gt;
- let op = name.[String.length name - 1] in
- Hashtbl.add Parser.binop_precedence op prec;
- | _ -&gt; ()
- end;
-
- (* Create a new basic block to start insertion into. *)
- let bb = append_block "entry" the_function in
- position_at_end bb builder;
-
- try
- let ret_val = codegen_expr body in
-
- (* Finish off the function. *)
- let _ = build_ret ret_val builder in
-
- (* Validate the generated code, checking for consistency. *)
- Llvm_analysis.assert_valid_function the_function;
-
- (* Optimize the function. *)
- let _ = PassManager.run_function the_function the_fpm in
-
- the_function
- with e -&gt;
- delete_function the_function;
- raise e
-</pre>
-</dd>
-
-<dt>toplevel.ml:</dt>
-<dd class="doc_code">
-<pre>
-(*===----------------------------------------------------------------------===
- * Top-Level parsing and JIT Driver
- *===----------------------------------------------------------------------===*)
-
-open Llvm
-open Llvm_executionengine
-
-(* top ::= definition | external | expression | ';' *)
-let rec main_loop the_fpm the_execution_engine stream =
- match Stream.peek stream with
- | None -&gt; ()
-
- (* ignore top-level semicolons. *)
- | Some (Token.Kwd ';') -&gt;
- Stream.junk stream;
- main_loop the_fpm the_execution_engine stream
-
- | Some token -&gt;
- begin
- try match token with
- | Token.Def -&gt;
- let e = Parser.parse_definition stream in
- print_endline "parsed a function definition.";
- dump_value (Codegen.codegen_func the_fpm e);
- | Token.Extern -&gt;
- let e = Parser.parse_extern stream in
- print_endline "parsed an extern.";
- dump_value (Codegen.codegen_proto e);
- | _ -&gt;
- (* Evaluate a top-level expression into an anonymous function. *)
- let e = Parser.parse_toplevel stream in
- print_endline "parsed a top-level expr";
- let the_function = Codegen.codegen_func the_fpm e in
- dump_value the_function;
-
- (* JIT the function, returning a function pointer. *)
- let result = ExecutionEngine.run_function the_function [||]
- the_execution_engine in
-
- print_string "Evaluated to ";
- print_float (GenericValue.as_float double_type result);
- print_newline ();
- with Stream.Error s | Codegen.Error s -&gt;
- (* Skip token for error recovery. *)
- Stream.junk stream;
- print_endline s;
- end;
- print_string "ready&gt; "; flush stdout;
- main_loop the_fpm the_execution_engine stream
-</pre>
-</dd>
-
-<dt>toy.ml:</dt>
-<dd class="doc_code">
-<pre>
-(*===----------------------------------------------------------------------===
- * Main driver code.
- *===----------------------------------------------------------------------===*)
-
-open Llvm
-open Llvm_executionengine
-open Llvm_target
-open Llvm_scalar_opts
-
-let main () =
- (* Install standard binary operators.
- * 1 is the lowest precedence. *)
- Hashtbl.add Parser.binop_precedence '&lt;' 10;
- Hashtbl.add Parser.binop_precedence '+' 20;
- Hashtbl.add Parser.binop_precedence '-' 20;
- Hashtbl.add Parser.binop_precedence '*' 40; (* highest. *)
-
- (* Prime the first token. *)
- print_string "ready&gt; "; flush stdout;
- let stream = Lexer.lex (Stream.of_channel stdin) in
-
- (* Create the JIT. *)
- let the_module_provider = ModuleProvider.create Codegen.the_module in
- let the_execution_engine = ExecutionEngine.create the_module_provider in
- let the_fpm = PassManager.create_function the_module_provider in
-
- (* Set up the optimizer pipeline. Start with registering info about how the
- * target lays out data structures. *)
- TargetData.add (ExecutionEngine.target_data the_execution_engine) the_fpm;
-
- (* Do simple "peephole" optimizations and bit-twiddling optzn. *)
- add_instruction_combining the_fpm;
-
- (* reassociate expressions. *)
- add_reassociation the_fpm;
-
- (* Eliminate Common SubExpressions. *)
- add_gvn the_fpm;
-
- (* Simplify the control flow graph (deleting unreachable blocks, etc). *)
- add_cfg_simplification the_fpm;
-
- (* Run the main "interpreter loop" now. *)
- Toplevel.main_loop the_fpm the_execution_engine stream;
-
- (* Print out all the generated code. *)
- dump_module Codegen.the_module
-;;
-
-main ()
-</pre>
-</dd>
-
-<dt>bindings.c</dt>
-<dd class="doc_code">
-<pre>
-#include &lt;stdio.h&gt;
-
-/* putchard - putchar that takes a double and returns 0. */
-extern double putchard(double X) {
- putchar((char)X);
- return 0;
-}
-
-/* printd - printf that takes a double prints it as "%f\n", returning 0. */
-extern double printd(double X) {
- printf("%f\n", X);
- return 0;
-}
-</pre>
-</dd>
-</dl>
-
-<a href="OCamlLangImpl7.html">Next: Extending the language: mutable variables /
-SSA construction</a>
-</div>
-
-<!-- *********************************************************************** -->
-<hr>
-<address>
- <a href="http://jigsaw.w3.org/css-validator/check/referer"><img
- src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"></a>
- <a href="http://validator.w3.org/check/referer"><img
- src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!"></a>
-
- <a href="mailto:sabre@nondot.org">Chris Lattner</a><br>
- <a href="mailto:idadesub@users.sourceforge.net">Erick Tryzelaar</a><br>
- <a href="http://llvm.org">The LLVM Compiler Infrastructure</a><br>
- Last modified: $Date: 2007-10-17 11:05:13 -0700 (Wed, 17 Oct 2007) $
-</address>
-</body>
-</html>
diff --git a/release_23/docs/tutorial/OCamlLangImpl7.html b/release_23/docs/tutorial/OCamlLangImpl7.html
deleted file mode 100644
index abda44011cab..000000000000
--- a/release_23/docs/tutorial/OCamlLangImpl7.html
+++ /dev/null
@@ -1,1902 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
- "http://www.w3.org/TR/html4/strict.dtd">
-
-<html>
-<head>
- <title>Kaleidoscope: Extending the Language: Mutable Variables / SSA
- construction</title>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <meta name="author" content="Chris Lattner">
- <meta name="author" content="Erick Tryzelaar">
- <link rel="stylesheet" href="../llvm.css" type="text/css">
-</head>
-
-<body>
-
-<div class="doc_title">Kaleidoscope: Extending the Language: Mutable Variables</div>
-
-<ul>
-<li><a href="index.html">Up to Tutorial Index</a></li>
-<li>Chapter 7
- <ol>
- <li><a href="#intro">Chapter 7 Introduction</a></li>
- <li><a href="#why">Why is this a hard problem?</a></li>
- <li><a href="#memory">Memory in LLVM</a></li>
- <li><a href="#kalvars">Mutable Variables in Kaleidoscope</a></li>
- <li><a href="#adjustments">Adjusting Existing Variables for
- Mutation</a></li>
- <li><a href="#assignment">New Assignment Operator</a></li>
- <li><a href="#localvars">User-defined Local Variables</a></li>
- <li><a href="#code">Full Code Listing</a></li>
- </ol>
-</li>
-<li><a href="LangImpl8.html">Chapter 8</a>: Conclusion and other useful LLVM
- tidbits</li>
-</ul>
-
-<div class="doc_author">
- <p>
- Written by <a href="mailto:sabre@nondot.org">Chris Lattner</a>
- and <a href="mailto:idadesub@users.sourceforge.net">Erick Tryzelaar</a>
- </p>
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section"><a name="intro">Chapter 7 Introduction</a></div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>Welcome to Chapter 7 of the "<a href="index.html">Implementing a language
-with LLVM</a>" tutorial. In chapters 1 through 6, we've built a very
-respectable, albeit simple, <a
-href="http://en.wikipedia.org/wiki/Functional_programming">functional
-programming language</a>. In our journey, we learned some parsing techniques,
-how to build and represent an AST, how to build LLVM IR, and how to optimize
-the resultant code as well as JIT compile it.</p>
-
-<p>While Kaleidoscope is interesting as a functional language, the fact that it
-is functional makes it "too easy" to generate LLVM IR for it. In particular, a
-functional language makes it very easy to build LLVM IR directly in <a
-href="http://en.wikipedia.org/wiki/Static_single_assignment_form">SSA form</a>.
-Since LLVM requires that the input code be in SSA form, this is a very nice
-property and it is often unclear to newcomers how to generate code for an
-imperative language with mutable variables.</p>
-
-<p>The short (and happy) summary of this chapter is that there is no need for
-your front-end to build SSA form: LLVM provides highly tuned and well tested
-support for this, though the way it works is a bit unexpected for some.</p>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section"><a name="why">Why is this a hard problem?</a></div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>
-To understand why mutable variables cause complexities in SSA construction,
-consider this extremely simple C example:
-</p>
-
-<div class="doc_code">
-<pre>
-int G, H;
-int test(_Bool Condition) {
- int X;
- if (Condition)
- X = G;
- else
- X = H;
- return X;
-}
-</pre>
-</div>
-
-<p>In this case, we have the variable "X", whose value depends on the path
-executed in the program. Because there are two different possible values for X
-before the return instruction, a PHI node is inserted to merge the two values.
-The LLVM IR that we want for this example looks like this:</p>
-
-<div class="doc_code">
-<pre>
-@G = weak global i32 0 ; type of @G is i32*
-@H = weak global i32 0 ; type of @H is i32*
-
-define i32 @test(i1 %Condition) {
-entry:
- br i1 %Condition, label %cond_true, label %cond_false
-
-cond_true:
- %X.0 = load i32* @G
- br label %cond_next
-
-cond_false:
- %X.1 = load i32* @H
- br label %cond_next
-
-cond_next:
- %X.2 = phi i32 [ %X.1, %cond_false ], [ %X.0, %cond_true ]
- ret i32 %X.2
-}
-</pre>
-</div>
-
-<p>In this example, the loads from the G and H global variables are explicit in
-the LLVM IR, and they live in the then/else branches of the if statement
-(cond_true/cond_false). In order to merge the incoming values, the X.2 phi node
-in the cond_next block selects the right value to use based on where control
-flow is coming from: if control flow comes from the cond_false block, X.2 gets
-the value of X.1. Alternatively, if control flow comes from cond_true, it gets
-the value of X.0. The intent of this chapter is not to explain the details of
-SSA form. For more information, see one of the many <a
-href="http://en.wikipedia.org/wiki/Static_single_assignment_form">online
-references</a>.</p>
-
-<p>The question for this article is "who places the phi nodes when lowering
-assignments to mutable variables?". The issue here is that LLVM
-<em>requires</em> that its IR be in SSA form: there is no "non-ssa" mode for it.
-However, SSA construction requires non-trivial algorithms and data structures,
-so it is inconvenient and wasteful for every front-end to have to reproduce this
-logic.</p>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section"><a name="memory">Memory in LLVM</a></div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>The 'trick' here is that while LLVM does require all register values to be
-in SSA form, it does not require (or permit) memory objects to be in SSA form.
-In the example above, note that the loads from G and H are direct accesses to
-G and H: they are not renamed or versioned. This differs from some other
-compiler systems, which do try to version memory objects. In LLVM, instead of
-encoding dataflow analysis of memory into the LLVM IR, it is handled with <a
-href="../WritingAnLLVMPass.html">Analysis Passes</a> which are computed on
-demand.</p>
-
-<p>
-With this in mind, the high-level idea is that we want to make a stack variable
-(which lives in memory, because it is on the stack) for each mutable object in
-a function. To take advantage of this trick, we need to talk about how LLVM
-represents stack variables.
-</p>
-
-<p>In LLVM, all memory accesses are explicit with load/store instructions, and
-it is carefully designed not to have (or need) an "address-of" operator. Notice
-how the type of the @G/@H global variables is actually "i32*" even though the
-variable is defined as "i32". What this means is that @G defines <em>space</em>
-for an i32 in the global data area, but its <em>name</em> actually refers to the
-address for that space. Stack variables work the same way, except that instead of
-being declared with global variable definitions, they are declared with the
-<a href="../LangRef.html#i_alloca">LLVM alloca instruction</a>:</p>
-
-<div class="doc_code">
-<pre>
-define i32 @example() {
-entry:
- %X = alloca i32 ; type of %X is i32*.
- ...
- %tmp = load i32* %X ; load the stack value %X from the stack.
- %tmp2 = add i32 %tmp, 1 ; increment it
- store i32 %tmp2, i32* %X ; store it back
- ...
-</pre>
-</div>
-
-<p>This code shows an example of how you can declare and manipulate a stack
-variable in the LLVM IR. Stack memory allocated with the alloca instruction is
-fully general: you can pass the address of the stack slot to functions, you can
-store it in other variables, etc. In our example above, we could rewrite the
-example to use the alloca technique to avoid using a PHI node:</p>
-
-<div class="doc_code">
-<pre>
-@G = weak global i32 0 ; type of @G is i32*
-@H = weak global i32 0 ; type of @H is i32*
-
-define i32 @test(i1 %Condition) {
-entry:
- %X = alloca i32 ; type of %X is i32*.
- br i1 %Condition, label %cond_true, label %cond_false
-
-cond_true:
- %X.0 = load i32* @G
- store i32 %X.0, i32* %X ; Update X
- br label %cond_next
-
-cond_false:
- %X.1 = load i32* @H
- store i32 %X.1, i32* %X ; Update X
- br label %cond_next
-
-cond_next:
- %X.2 = load i32* %X ; Read X
- ret i32 %X.2
-}
-</pre>
-</div>
-
-<p>With this, we have discovered a way to handle arbitrary mutable variables
-without the need to create Phi nodes at all:</p>
-
-<ol>
-<li>Each mutable variable becomes a stack allocation.</li>
-<li>Each read of the variable becomes a load from the stack.</li>
-<li>Each update of the variable becomes a store to the stack.</li>
-<li>Taking the address of a variable just uses the stack address directly.</li>
-</ol>
-
-<p>While this solution has solved our immediate problem, it introduced another
-one: we have now apparently introduced a lot of stack traffic for very simple
-and common operations, a major performance problem. Fortunately for us, the
-LLVM optimizer has a highly-tuned optimization pass named "mem2reg" that handles
-this case, promoting allocas like this into SSA registers, inserting Phi nodes
-as appropriate. If you run this example through the pass, for example, you'll
-get:</p>
-
-<div class="doc_code">
-<pre>
-$ <b>llvm-as &lt; example.ll | opt -mem2reg | llvm-dis</b>
-@G = weak global i32 0
-@H = weak global i32 0
-
-define i32 @test(i1 %Condition) {
-entry:
- br i1 %Condition, label %cond_true, label %cond_false
-
-cond_true:
- %X.0 = load i32* @G
- br label %cond_next
-
-cond_false:
- %X.1 = load i32* @H
- br label %cond_next
-
-cond_next:
- %X.01 = phi i32 [ %X.1, %cond_false ], [ %X.0, %cond_true ]
- ret i32 %X.01
-}
-</pre>
-</div>
-
-<p>The mem2reg pass implements the standard "iterated dominance frontier"
-algorithm for constructing SSA form and has a number of optimizations that speed
-up (very common) degenerate cases. The mem2reg optimization pass is the answer
-to dealing with mutable variables, and we highly recommend that you depend on
-it. Note that mem2reg only works on variables in certain circumstances:</p>
-
-<ol>
-<li>mem2reg is alloca-driven: it looks for allocas and if it can handle them, it
-promotes them. It does not apply to global variables or heap allocations.</li>
-
-<li>mem2reg only looks for alloca instructions in the entry block of the
-function. Being in the entry block guarantees that the alloca is only executed
-once, which makes analysis simpler.</li>
-
-<li>mem2reg only promotes allocas whose uses are direct loads and stores. If
-the address of the stack object is passed to a function, or if any funny pointer
-arithmetic is involved, the alloca will not be promoted.</li>
-
-<li>mem2reg only works on allocas of <a
-href="../LangRef.html#t_classifications">first class</a>
-values (such as pointers, scalars and vectors), and only if the array size
-of the allocation is 1 (or missing in the .ll file). mem2reg is not capable of
-promoting structs or arrays to registers. Note that the "scalarrepl" pass is
-more powerful and can promote structs, "unions", and arrays in many cases.</li>
-
-</ol>
-
-<p>
-All of these properties are easy to satisfy for most imperative languages, and
-we'll illustrate it below with Kaleidoscope. The final question you may be
-asking is: should I bother with this nonsense for my front-end? Wouldn't it be
-better if I just did SSA construction directly, avoiding use of the mem2reg
-optimization pass? In short, we strongly recommend that you use this technique
-for building SSA form, unless there is an extremely good reason not to. Using
-this technique is:</p>
-
-<ul>
-<li>Proven and well tested: llvm-gcc and clang both use this technique for local
-mutable variables. As such, the most common clients of LLVM are using this to
-handle a bulk of their variables. You can be sure that bugs are found fast and
-fixed early.</li>
-
-<li>Extremely Fast: mem2reg has a number of special cases that make it fast in
-common cases as well as fully general. For example, it has fast-paths for
-variables that are only used in a single block, variables that only have one
-assignment point, good heuristics to avoid insertion of unneeded phi nodes, etc.
-</li>
-
-<li>Needed for debug info generation: <a href="../SourceLevelDebugging.html">
-Debug information in LLVM</a> relies on having the address of the variable
-exposed so that debug info can be attached to it. This technique dovetails
-very naturally with this style of debug info.</li>
-</ul>
-
-<p>If nothing else, this makes it much easier to get your front-end up and
-running, and is very simple to implement. Lets extend Kaleidoscope with mutable
-variables now!
-</p>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section"><a name="kalvars">Mutable Variables in
-Kaleidoscope</a></div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>Now that we know the sort of problem we want to tackle, lets see what this
-looks like in the context of our little Kaleidoscope language. We're going to
-add two features:</p>
-
-<ol>
-<li>The ability to mutate variables with the '=' operator.</li>
-<li>The ability to define new variables.</li>
-</ol>
-
-<p>While the first item is really what this is about, we only have variables
-for incoming arguments as well as for induction variables, and redefining those only
-goes so far :). Also, the ability to define new variables is a
-useful thing regardless of whether you will be mutating them. Here's a
-motivating example that shows how we could use these:</p>
-
-<div class="doc_code">
-<pre>
-# Define ':' for sequencing: as a low-precedence operator that ignores operands
-# and just returns the RHS.
-def binary : 1 (x y) y;
-
-# Recursive fib, we could do this before.
-def fib(x)
- if (x &lt; 3) then
- 1
- else
- fib(x-1)+fib(x-2);
-
-# Iterative fib.
-def fibi(x)
- <b>var a = 1, b = 1, c in</b>
- (for i = 3, i &lt; x in
- <b>c = a + b</b> :
- <b>a = b</b> :
- <b>b = c</b>) :
- b;
-
-# Call it.
-fibi(10);
-</pre>
-</div>
-
-<p>
-In order to mutate variables, we have to change our existing variables to use
-the "alloca trick". Once we have that, we'll add our new operator, then extend
-Kaleidoscope to support new variable definitions.
-</p>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section"><a name="adjustments">Adjusting Existing Variables for
-Mutation</a></div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>
-The symbol table in Kaleidoscope is managed at code generation time by the
-'<tt>named_values</tt>' map. This map currently keeps track of the LLVM
-"Value*" that holds the double value for the named variable. In order to
-support mutation, we need to change this slightly, so that it
-<tt>named_values</tt> holds the <em>memory location</em> of the variable in
-question. Note that this change is a refactoring: it changes the structure of
-the code, but does not (by itself) change the behavior of the compiler. All of
-these changes are isolated in the Kaleidoscope code generator.</p>
-
-<p>
-At this point in Kaleidoscope's development, it only supports variables for two
-things: incoming arguments to functions and the induction variable of 'for'
-loops. For consistency, we'll allow mutation of these variables in addition to
-other user-defined variables. This means that these will both need memory
-locations.
-</p>
-
-<p>To start our transformation of Kaleidoscope, we'll change the
-<tt>named_values</tt> map so that it maps to AllocaInst* instead of Value*.
-Once we do this, the C++ compiler will tell us what parts of the code we need to
-update:</p>
-
-<p><b>Note:</b> the ocaml bindings currently model both <tt>Value*</tt>s and
-<tt>AllocInst*</tt>s as <tt>Llvm.llvalue</tt>s, but this may change in the
-future to be more type safe.</p>
-
-<div class="doc_code">
-<pre>
-let named_values:(string, llvalue) Hashtbl.t = Hashtbl.create 10
-</pre>
-</div>
-
-<p>Also, since we will need to create these alloca's, we'll use a helper
-function that ensures that the allocas are created in the entry block of the
-function:</p>
-
-<div class="doc_code">
-<pre>
-(* Create an alloca instruction in the entry block of the function. This
- * is used for mutable variables etc. *)
-let create_entry_block_alloca the_function var_name =
- let builder = builder_at (instr_begin (entry_block the_function)) in
- build_alloca double_type var_name builder
-</pre>
-</div>
-
-<p>This funny looking code creates an <tt>Llvm.llbuilder</tt> object that is
-pointing at the first instruction of the entry block. It then creates an alloca
-with the expected name and returns it. Because all values in Kaleidoscope are
-doubles, there is no need to pass in a type to use.</p>
-
-<p>With this in place, the first functionality change we want to make is to
-variable references. In our new scheme, variables live on the stack, so code
-generating a reference to them actually needs to produce a load from the stack
-slot:</p>
-
-<div class="doc_code">
-<pre>
-let rec codegen_expr = function
- ...
- | Ast.Variable name -&gt;
- let v = try Hashtbl.find named_values name with
- | Not_found -&gt; raise (Error "unknown variable name")
- in
- <b>(* Load the value. *)
- build_load v name builder</b>
-</pre>
-</div>
-
-<p>As you can see, this is pretty straightforward. Now we need to update the
-things that define the variables to set up the alloca. We'll start with
-<tt>codegen_expr Ast.For ...</tt> (see the <a href="#code">full code listing</a>
-for the unabridged code):</p>
-
-<div class="doc_code">
-<pre>
- | Ast.For (var_name, start, end_, step, body) -&gt;
- let the_function = block_parent (insertion_block builder) in
-
- (* Create an alloca for the variable in the entry block. *)
- <b>let alloca = create_entry_block_alloca the_function var_name in</b>
-
- (* Emit the start code first, without 'variable' in scope. *)
- let start_val = codegen_expr start in
-
- <b>(* Store the value into the alloca. *)
- ignore(build_store start_val alloca builder);</b>
-
- ...
-
- (* Within the loop, the variable is defined equal to the PHI node. If it
- * shadows an existing variable, we have to restore it, so save it
- * now. *)
- let old_val =
- try Some (Hashtbl.find named_values var_name) with Not_found -&gt; None
- in
- <b>Hashtbl.add named_values var_name alloca;</b>
-
- ...
-
- (* Compute the end condition. *)
- let end_cond = codegen_expr end_ in
-
- <b>(* Reload, increment, and restore the alloca. This handles the case where
- * the body of the loop mutates the variable. *)
- let cur_var = build_load alloca var_name builder in
- let next_var = build_add cur_var step_val "nextvar" builder in
- ignore(build_store next_var alloca builder);</b>
- ...
-</pre>
-</div>
-
-<p>This code is virtually identical to the code <a
-href="OCamlLangImpl5.html#forcodegen">before we allowed mutable variables</a>.
-The big difference is that we no longer have to construct a PHI node, and we use
-load/store to access the variable as needed.</p>
-
-<p>To support mutable argument variables, we need to also make allocas for them.
-The code for this is also pretty simple:</p>
-
-<div class="doc_code">
-<pre>
-(* Create an alloca for each argument and register the argument in the symbol
- * table so that references to it will succeed. *)
-let create_argument_allocas the_function proto =
- let args = match proto with
- | Ast.Prototype (_, args) | Ast.BinOpPrototype (_, args, _) -&gt; args
- in
- Array.iteri (fun i ai -&gt;
- let var_name = args.(i) in
- (* Create an alloca for this variable. *)
- let alloca = create_entry_block_alloca the_function var_name in
-
- (* Store the initial value into the alloca. *)
- ignore(build_store ai alloca builder);
-
- (* Add arguments to variable symbol table. *)
- Hashtbl.add named_values var_name alloca;
- ) (params the_function)
-</pre>
-</div>
-
-<p>For each argument, we make an alloca, store the input value to the function
-into the alloca, and register the alloca as the memory location for the
-argument. This method gets invoked by <tt>Codegen.codegen_func</tt> right after
-it sets up the entry block for the function.</p>
-
-<p>The final missing piece is adding the mem2reg pass, which allows us to get
-good codegen once again:</p>
-
-<div class="doc_code">
-<pre>
-let main () =
- ...
- let the_fpm = PassManager.create_function the_module_provider in
-
- (* Set up the optimizer pipeline. Start with registering info about how the
- * target lays out data structures. *)
- TargetData.add (ExecutionEngine.target_data the_execution_engine) the_fpm;
-
- <b>(* Promote allocas to registers. *)
- add_memory_to_register_promotion the_fpm;</b>
-
- (* Do simple "peephole" optimizations and bit-twiddling optzn. *)
- add_instruction_combining the_fpm;
-
- (* reassociate expressions. *)
- add_reassociation the_fpm;
-</pre>
-</div>
-
-<p>It is interesting to see what the code looks like before and after the
-mem2reg optimization runs. For example, this is the before/after code for our
-recursive fib function. Before the optimization:</p>
-
-<div class="doc_code">
-<pre>
-define double @fib(double %x) {
-entry:
- <b>%x1 = alloca double
- store double %x, double* %x1
- %x2 = load double* %x1</b>
- %cmptmp = fcmp ult double %x2, 3.000000e+00
- %booltmp = uitofp i1 %cmptmp to double
- %ifcond = fcmp one double %booltmp, 0.000000e+00
- br i1 %ifcond, label %then, label %else
-
-then: ; preds = %entry
- br label %ifcont
-
-else: ; preds = %entry
- <b>%x3 = load double* %x1</b>
- %subtmp = sub double %x3, 1.000000e+00
- %calltmp = call double @fib( double %subtmp )
- <b>%x4 = load double* %x1</b>
- %subtmp5 = sub double %x4, 2.000000e+00
- %calltmp6 = call double @fib( double %subtmp5 )
- %addtmp = add double %calltmp, %calltmp6
- br label %ifcont
-
-ifcont: ; preds = %else, %then
- %iftmp = phi double [ 1.000000e+00, %then ], [ %addtmp, %else ]
- ret double %iftmp
-}
-</pre>
-</div>
-
-<p>Here there is only one variable (x, the input argument) but you can still
-see the extremely simple-minded code generation strategy we are using. In the
-entry block, an alloca is created, and the initial input value is stored into
-it. Each reference to the variable does a reload from the stack. Also, note
-that we didn't modify the if/then/else expression, so it still inserts a PHI
-node. While we could make an alloca for it, it is actually easier to create a
-PHI node for it, so we still just make the PHI.</p>
-
-<p>Here is the code after the mem2reg pass runs:</p>
-
-<div class="doc_code">
-<pre>
-define double @fib(double %x) {
-entry:
- %cmptmp = fcmp ult double <b>%x</b>, 3.000000e+00
- %booltmp = uitofp i1 %cmptmp to double
- %ifcond = fcmp one double %booltmp, 0.000000e+00
- br i1 %ifcond, label %then, label %else
-
-then:
- br label %ifcont
-
-else:
- %subtmp = sub double <b>%x</b>, 1.000000e+00
- %calltmp = call double @fib( double %subtmp )
- %subtmp5 = sub double <b>%x</b>, 2.000000e+00
- %calltmp6 = call double @fib( double %subtmp5 )
- %addtmp = add double %calltmp, %calltmp6
- br label %ifcont
-
-ifcont: ; preds = %else, %then
- %iftmp = phi double [ 1.000000e+00, %then ], [ %addtmp, %else ]
- ret double %iftmp
-}
-</pre>
-</div>
-
-<p>This is a trivial case for mem2reg, since there are no redefinitions of the
-variable. The point of showing this is to calm your tension about inserting
-such blatent inefficiencies :).</p>
-
-<p>After the rest of the optimizers run, we get:</p>
-
-<div class="doc_code">
-<pre>
-define double @fib(double %x) {
-entry:
- %cmptmp = fcmp ult double %x, 3.000000e+00
- %booltmp = uitofp i1 %cmptmp to double
- %ifcond = fcmp ueq double %booltmp, 0.000000e+00
- br i1 %ifcond, label %else, label %ifcont
-
-else:
- %subtmp = sub double %x, 1.000000e+00
- %calltmp = call double @fib( double %subtmp )
- %subtmp5 = sub double %x, 2.000000e+00
- %calltmp6 = call double @fib( double %subtmp5 )
- %addtmp = add double %calltmp, %calltmp6
- ret double %addtmp
-
-ifcont:
- ret double 1.000000e+00
-}
-</pre>
-</div>
-
-<p>Here we see that the simplifycfg pass decided to clone the return instruction
-into the end of the 'else' block. This allowed it to eliminate some branches
-and the PHI node.</p>
-
-<p>Now that all symbol table references are updated to use stack variables,
-we'll add the assignment operator.</p>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section"><a name="assignment">New Assignment Operator</a></div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>With our current framework, adding a new assignment operator is really
-simple. We will parse it just like any other binary operator, but handle it
-internally (instead of allowing the user to define it). The first step is to
-set a precedence:</p>
-
-<div class="doc_code">
-<pre>
-let main () =
- (* Install standard binary operators.
- * 1 is the lowest precedence. *)
- <b>Hashtbl.add Parser.binop_precedence '=' 2;</b>
- Hashtbl.add Parser.binop_precedence '&lt;' 10;
- Hashtbl.add Parser.binop_precedence '+' 20;
- Hashtbl.add Parser.binop_precedence '-' 20;
- ...
-</pre>
-</div>
-
-<p>Now that the parser knows the precedence of the binary operator, it takes
-care of all the parsing and AST generation. We just need to implement codegen
-for the assignment operator. This looks like:</p>
-
-<div class="doc_code">
-<pre>
-let rec codegen_expr = function
- begin match op with
- | '=' -&gt;
- (* Special case '=' because we don't want to emit the LHS as an
- * expression. *)
- let name =
- match lhs with
- | Ast.Variable name -&gt; name
- | _ -&gt; raise (Error "destination of '=' must be a variable")
- in
-</pre>
-</div>
-
-<p>Unlike the rest of the binary operators, our assignment operator doesn't
-follow the "emit LHS, emit RHS, do computation" model. As such, it is handled
-as a special case before the other binary operators are handled. The other
-strange thing is that it requires the LHS to be a variable. It is invalid to
-have "(x+1) = expr" - only things like "x = expr" are allowed.
-</p>
-
-
-<div class="doc_code">
-<pre>
- (* Codegen the rhs. *)
- let val_ = codegen_expr rhs in
-
- (* Lookup the name. *)
- let variable = try Hashtbl.find named_values name with
- | Not_found -&gt; raise (Error "unknown variable name")
- in
- ignore(build_store val_ variable builder);
- val_
- | _ -&gt;
- ...
-</pre>
-</div>
-
-<p>Once we have the variable, codegen'ing the assignment is straightforward:
-we emit the RHS of the assignment, create a store, and return the computed
-value. Returning a value allows for chained assignments like "X = (Y = Z)".</p>
-
-<p>Now that we have an assignment operator, we can mutate loop variables and
-arguments. For example, we can now run code like this:</p>
-
-<div class="doc_code">
-<pre>
-# Function to print a double.
-extern printd(x);
-
-# Define ':' for sequencing: as a low-precedence operator that ignores operands
-# and just returns the RHS.
-def binary : 1 (x y) y;
-
-def test(x)
- printd(x) :
- x = 4 :
- printd(x);
-
-test(123);
-</pre>
-</div>
-
-<p>When run, this example prints "123" and then "4", showing that we did
-actually mutate the value! Okay, we have now officially implemented our goal:
-getting this to work requires SSA construction in the general case. However,
-to be really useful, we want the ability to define our own local variables, lets
-add this next!
-</p>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section"><a name="localvars">User-defined Local
-Variables</a></div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>Adding var/in is just like any other other extensions we made to
-Kaleidoscope: we extend the lexer, the parser, the AST and the code generator.
-The first step for adding our new 'var/in' construct is to extend the lexer.
-As before, this is pretty trivial, the code looks like this:</p>
-
-<div class="doc_code">
-<pre>
-type token =
- ...
- <b>(* var definition *)
- | Var</b>
-
-...
-
-and lex_ident buffer = parser
- ...
- | "in" -&gt; [&lt; 'Token.In; stream &gt;]
- | "binary" -&gt; [&lt; 'Token.Binary; stream &gt;]
- | "unary" -&gt; [&lt; 'Token.Unary; stream &gt;]
- <b>| "var" -&gt; [&lt; 'Token.Var; stream &gt;]</b>
- ...
-</pre>
-</div>
-
-<p>The next step is to define the AST node that we will construct. For var/in,
-it looks like this:</p>
-
-<div class="doc_code">
-<pre>
-type expr =
- ...
- (* variant for var/in. *)
- | Var of (string * expr option) array * expr
- ...
-</pre>
-</div>
-
-<p>var/in allows a list of names to be defined all at once, and each name can
-optionally have an initializer value. As such, we capture this information in
-the VarNames vector. Also, var/in has a body, this body is allowed to access
-the variables defined by the var/in.</p>
-
-<p>With this in place, we can define the parser pieces. The first thing we do
-is add it as a primary expression:</p>
-
-<div class="doc_code">
-<pre>
-(* primary
- * ::= identifier
- * ::= numberexpr
- * ::= parenexpr
- * ::= ifexpr
- * ::= forexpr
- <b>* ::= varexpr</b> *)
-let rec parse_primary = parser
- ...
- <b>(* varexpr
- * ::= 'var' identifier ('=' expression?
- * (',' identifier ('=' expression)?)* 'in' expression *)
- | [&lt; 'Token.Var;
- (* At least one variable name is required. *)
- 'Token.Ident id ?? "expected identifier after var";
- init=parse_var_init;
- var_names=parse_var_names [(id, init)];
- (* At this point, we have to have 'in'. *)
- 'Token.In ?? "expected 'in' keyword after 'var'";
- body=parse_expr &gt;] -&gt;
- Ast.Var (Array.of_list (List.rev var_names), body)</b>
-
-...
-
-and parse_var_init = parser
- (* read in the optional initializer. *)
- | [&lt; 'Token.Kwd '='; e=parse_expr &gt;] -&gt; Some e
- | [&lt; &gt;] -&gt; None
-
-and parse_var_names accumulator = parser
- | [&lt; 'Token.Kwd ',';
- 'Token.Ident id ?? "expected identifier list after var";
- init=parse_var_init;
- e=parse_var_names ((id, init) :: accumulator) &gt;] -&gt; e
- | [&lt; &gt;] -&gt; accumulator
-</pre>
-</div>
-
-<p>Now that we can parse and represent the code, we need to support emission of
-LLVM IR for it. This code starts out with:</p>
-
-<div class="doc_code">
-<pre>
-let rec codegen_expr = function
- ...
- | Ast.Var (var_names, body)
- let old_bindings = ref [] in
-
- let the_function = block_parent (insertion_block builder) in
-
- (* Register all variables and emit their initializer. *)
- Array.iter (fun (var_name, init) -&gt;
-</pre>
-</div>
-
-<p>Basically it loops over all the variables, installing them one at a time.
-For each variable we put into the symbol table, we remember the previous value
-that we replace in OldBindings.</p>
-
-<div class="doc_code">
-<pre>
- (* Emit the initializer before adding the variable to scope, this
- * prevents the initializer from referencing the variable itself, and
- * permits stuff like this:
- * var a = 1 in
- * var a = a in ... # refers to outer 'a'. *)
- let init_val =
- match init with
- | Some init -&gt; codegen_expr init
- (* If not specified, use 0.0. *)
- | None -&gt; const_float double_type 0.0
- in
-
- let alloca = create_entry_block_alloca the_function var_name in
- ignore(build_store init_val alloca builder);
-
- (* Remember the old variable binding so that we can restore the binding
- * when we unrecurse. *)
-
- begin
- try
- let old_value = Hashtbl.find named_values var_name in
- old_bindings := (var_name, old_value) :: !old_bindings;
- with Not_found &gt; ()
- end;
-
- (* Remember this binding. *)
- Hashtbl.add named_values var_name alloca;
- ) var_names;
-</pre>
-</div>
-
-<p>There are more comments here than code. The basic idea is that we emit the
-initializer, create the alloca, then update the symbol table to point to it.
-Once all the variables are installed in the symbol table, we evaluate the body
-of the var/in expression:</p>
-
-<div class="doc_code">
-<pre>
- (* Codegen the body, now that all vars are in scope. *)
- let body_val = codegen_expr body in
-</pre>
-</div>
-
-<p>Finally, before returning, we restore the previous variable bindings:</p>
-
-<div class="doc_code">
-<pre>
- (* Pop all our variables from scope. *)
- List.iter (fun (var_name, old_value) -&gt;
- Hashtbl.add named_values var_name old_value
- ) !old_bindings;
-
- (* Return the body computation. *)
- body_val
-</pre>
-</div>
-
-<p>The end result of all of this is that we get properly scoped variable
-definitions, and we even (trivially) allow mutation of them :).</p>
-
-<p>With this, we completed what we set out to do. Our nice iterative fib
-example from the intro compiles and runs just fine. The mem2reg pass optimizes
-all of our stack variables into SSA registers, inserting PHI nodes where needed,
-and our front-end remains simple: no "iterated dominance frontier" computation
-anywhere in sight.</p>
-
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section"><a name="code">Full Code Listing</a></div>
-<!-- *********************************************************************** -->
-
-<div class="doc_text">
-
-<p>
-Here is the complete code listing for our running example, enhanced with mutable
-variables and var/in support. To build this example, use:
-</p>
-
-<div class="doc_code">
-<pre>
-# Compile
-ocamlbuild toy.byte
-# Run
-./toy.byte
-</pre>
-</div>
-
-<p>Here is the code:</p>
-
-<dl>
-<dt>_tags:</dt>
-<dd class="doc_code">
-<pre>
-&lt;{lexer,parser}.ml&gt;: use_camlp4, pp(camlp4of)
-&lt;*.{byte,native}&gt;: g++, use_llvm, use_llvm_analysis
-&lt;*.{byte,native}&gt;: use_llvm_executionengine, use_llvm_target
-&lt;*.{byte,native}&gt;: use_llvm_scalar_opts, use_bindings
-</pre>
-</dd>
-
-<dt>myocamlbuild.ml:</dt>
-<dd class="doc_code">
-<pre>
-open Ocamlbuild_plugin;;
-
-ocaml_lib ~extern:true "llvm";;
-ocaml_lib ~extern:true "llvm_analysis";;
-ocaml_lib ~extern:true "llvm_executionengine";;
-ocaml_lib ~extern:true "llvm_target";;
-ocaml_lib ~extern:true "llvm_scalar_opts";;
-
-flag ["link"; "ocaml"; "g++"] (S[A"-cc"; A"g++"]);;
-dep ["link"; "ocaml"; "use_bindings"] ["bindings.o"];;
-</pre>
-</dd>
-
-<dt>token.ml:</dt>
-<dd class="doc_code">
-<pre>
-(*===----------------------------------------------------------------------===
- * Lexer Tokens
- *===----------------------------------------------------------------------===*)
-
-(* The lexer returns these 'Kwd' if it is an unknown character, otherwise one of
- * these others for known things. *)
-type token =
- (* commands *)
- | Def | Extern
-
- (* primary *)
- | Ident of string | Number of float
-
- (* unknown *)
- | Kwd of char
-
- (* control *)
- | If | Then | Else
- | For | In
-
- (* operators *)
- | Binary | Unary
-
- (* var definition *)
- | Var
-</pre>
-</dd>
-
-<dt>lexer.ml:</dt>
-<dd class="doc_code">
-<pre>
-(*===----------------------------------------------------------------------===
- * Lexer
- *===----------------------------------------------------------------------===*)
-
-let rec lex = parser
- (* Skip any whitespace. *)
- | [&lt; ' (' ' | '\n' | '\r' | '\t'); stream &gt;] -&gt; lex stream
-
- (* identifier: [a-zA-Z][a-zA-Z0-9] *)
- | [&lt; ' ('A' .. 'Z' | 'a' .. 'z' as c); stream &gt;] -&gt;
- let buffer = Buffer.create 1 in
- Buffer.add_char buffer c;
- lex_ident buffer stream
-
- (* number: [0-9.]+ *)
- | [&lt; ' ('0' .. '9' as c); stream &gt;] -&gt;
- let buffer = Buffer.create 1 in
- Buffer.add_char buffer c;
- lex_number buffer stream
-
- (* Comment until end of line. *)
- | [&lt; ' ('#'); stream &gt;] -&gt;
- lex_comment stream
-
- (* Otherwise, just return the character as its ascii value. *)
- | [&lt; 'c; stream &gt;] -&gt;
- [&lt; 'Token.Kwd c; lex stream &gt;]
-
- (* end of stream. *)
- | [&lt; &gt;] -&gt; [&lt; &gt;]
-
-and lex_number buffer = parser
- | [&lt; ' ('0' .. '9' | '.' as c); stream &gt;] -&gt;
- Buffer.add_char buffer c;
- lex_number buffer stream
- | [&lt; stream=lex &gt;] -&gt;
- [&lt; 'Token.Number (float_of_string (Buffer.contents buffer)); stream &gt;]
-
-and lex_ident buffer = parser
- | [&lt; ' ('A' .. 'Z' | 'a' .. 'z' | '0' .. '9' as c); stream &gt;] -&gt;
- Buffer.add_char buffer c;
- lex_ident buffer stream
- | [&lt; stream=lex &gt;] -&gt;
- match Buffer.contents buffer with
- | "def" -&gt; [&lt; 'Token.Def; stream &gt;]
- | "extern" -&gt; [&lt; 'Token.Extern; stream &gt;]
- | "if" -&gt; [&lt; 'Token.If; stream &gt;]
- | "then" -&gt; [&lt; 'Token.Then; stream &gt;]
- | "else" -&gt; [&lt; 'Token.Else; stream &gt;]
- | "for" -&gt; [&lt; 'Token.For; stream &gt;]
- | "in" -&gt; [&lt; 'Token.In; stream &gt;]
- | "binary" -&gt; [&lt; 'Token.Binary; stream &gt;]
- | "unary" -&gt; [&lt; 'Token.Unary; stream &gt;]
- | "var" -&gt; [&lt; 'Token.Var; stream &gt;]
- | id -&gt; [&lt; 'Token.Ident id; stream &gt;]
-
-and lex_comment = parser
- | [&lt; ' ('\n'); stream=lex &gt;] -&gt; stream
- | [&lt; 'c; e=lex_comment &gt;] -&gt; e
- | [&lt; &gt;] -&gt; [&lt; &gt;]
-</pre>
-</dd>
-
-<dt>ast.ml:</dt>
-<dd class="doc_code">
-<pre>
-(*===----------------------------------------------------------------------===
- * Abstract Syntax Tree (aka Parse Tree)
- *===----------------------------------------------------------------------===*)
-
-(* expr - Base type for all expression nodes. *)
-type expr =
- (* variant for numeric literals like "1.0". *)
- | Number of float
-
- (* variant for referencing a variable, like "a". *)
- | Variable of string
-
- (* variant for a unary operator. *)
- | Unary of char * expr
-
- (* variant for a binary operator. *)
- | Binary of char * expr * expr
-
- (* variant for function calls. *)
- | Call of string * expr array
-
- (* variant for if/then/else. *)
- | If of expr * expr * expr
-
- (* variant for for/in. *)
- | For of string * expr * expr * expr option * expr
-
- (* variant for var/in. *)
- | Var of (string * expr option) array * expr
-
-(* proto - This type represents the "prototype" for a function, which captures
- * its name, and its argument names (thus implicitly the number of arguments the
- * function takes). *)
-type proto =
- | Prototype of string * string array
- | BinOpPrototype of string * string array * int
-
-(* func - This type represents a function definition itself. *)
-type func = Function of proto * expr
-</pre>
-</dd>
-
-<dt>parser.ml:</dt>
-<dd class="doc_code">
-<pre>
-(*===---------------------------------------------------------------------===
- * Parser
- *===---------------------------------------------------------------------===*)
-
-(* binop_precedence - This holds the precedence for each binary operator that is
- * defined *)
-let binop_precedence:(char, int) Hashtbl.t = Hashtbl.create 10
-
-(* precedence - Get the precedence of the pending binary operator token. *)
-let precedence c = try Hashtbl.find binop_precedence c with Not_found -&gt; -1
-
-(* primary
- * ::= identifier
- * ::= numberexpr
- * ::= parenexpr
- * ::= ifexpr
- * ::= forexpr
- * ::= varexpr *)
-let rec parse_primary = parser
- (* numberexpr ::= number *)
- | [&lt; 'Token.Number n &gt;] -&gt; Ast.Number n
-
- (* parenexpr ::= '(' expression ')' *)
- | [&lt; 'Token.Kwd '('; e=parse_expr; 'Token.Kwd ')' ?? "expected ')'" &gt;] -&gt; e
-
- (* identifierexpr
- * ::= identifier
- * ::= identifier '(' argumentexpr ')' *)
- | [&lt; 'Token.Ident id; stream &gt;] -&gt;
- let rec parse_args accumulator = parser
- | [&lt; e=parse_expr; stream &gt;] -&gt;
- begin parser
- | [&lt; 'Token.Kwd ','; e=parse_args (e :: accumulator) &gt;] -&gt; e
- | [&lt; &gt;] -&gt; e :: accumulator
- end stream
- | [&lt; &gt;] -&gt; accumulator
- in
- let rec parse_ident id = parser
- (* Call. *)
- | [&lt; 'Token.Kwd '(';
- args=parse_args [];
- 'Token.Kwd ')' ?? "expected ')'"&gt;] -&gt;
- Ast.Call (id, Array.of_list (List.rev args))
-
- (* Simple variable ref. *)
- | [&lt; &gt;] -&gt; Ast.Variable id
- in
- parse_ident id stream
-
- (* ifexpr ::= 'if' expr 'then' expr 'else' expr *)
- | [&lt; 'Token.If; c=parse_expr;
- 'Token.Then ?? "expected 'then'"; t=parse_expr;
- 'Token.Else ?? "expected 'else'"; e=parse_expr &gt;] -&gt;
- Ast.If (c, t, e)
-
- (* forexpr
- ::= 'for' identifier '=' expr ',' expr (',' expr)? 'in' expression *)
- | [&lt; 'Token.For;
- 'Token.Ident id ?? "expected identifier after for";
- 'Token.Kwd '=' ?? "expected '=' after for";
- stream &gt;] -&gt;
- begin parser
- | [&lt;
- start=parse_expr;
- 'Token.Kwd ',' ?? "expected ',' after for";
- end_=parse_expr;
- stream &gt;] -&gt;
- let step =
- begin parser
- | [&lt; 'Token.Kwd ','; step=parse_expr &gt;] -&gt; Some step
- | [&lt; &gt;] -&gt; None
- end stream
- in
- begin parser
- | [&lt; 'Token.In; body=parse_expr &gt;] -&gt;
- Ast.For (id, start, end_, step, body)
- | [&lt; &gt;] -&gt;
- raise (Stream.Error "expected 'in' after for")
- end stream
- | [&lt; &gt;] -&gt;
- raise (Stream.Error "expected '=' after for")
- end stream
-
- (* varexpr
- * ::= 'var' identifier ('=' expression?
- * (',' identifier ('=' expression)?)* 'in' expression *)
- | [&lt; 'Token.Var;
- (* At least one variable name is required. *)
- 'Token.Ident id ?? "expected identifier after var";
- init=parse_var_init;
- var_names=parse_var_names [(id, init)];
- (* At this point, we have to have 'in'. *)
- 'Token.In ?? "expected 'in' keyword after 'var'";
- body=parse_expr &gt;] -&gt;
- Ast.Var (Array.of_list (List.rev var_names), body)
-
- | [&lt; &gt;] -&gt; raise (Stream.Error "unknown token when expecting an expression.")
-
-(* unary
- * ::= primary
- * ::= '!' unary *)
-and parse_unary = parser
- (* If this is a unary operator, read it. *)
- | [&lt; 'Token.Kwd op when op != '(' &amp;&amp; op != ')'; operand=parse_expr &gt;] -&gt;
- Ast.Unary (op, operand)
-
- (* If the current token is not an operator, it must be a primary expr. *)
- | [&lt; stream &gt;] -&gt; parse_primary stream
-
-(* binoprhs
- * ::= ('+' primary)* *)
-and parse_bin_rhs expr_prec lhs stream =
- match Stream.peek stream with
- (* If this is a binop, find its precedence. *)
- | Some (Token.Kwd c) when Hashtbl.mem binop_precedence c -&gt;
- let token_prec = precedence c in
-
- (* If this is a binop that binds at least as tightly as the current binop,
- * consume it, otherwise we are done. *)
- if token_prec &lt; expr_prec then lhs else begin
- (* Eat the binop. *)
- Stream.junk stream;
-
- (* Parse the primary expression after the binary operator. *)
- let rhs = parse_unary stream in
-
- (* Okay, we know this is a binop. *)
- let rhs =
- match Stream.peek stream with
- | Some (Token.Kwd c2) -&gt;
- (* If BinOp binds less tightly with rhs than the operator after
- * rhs, let the pending operator take rhs as its lhs. *)
- let next_prec = precedence c2 in
- if token_prec &lt; next_prec
- then parse_bin_rhs (token_prec + 1) rhs stream
- else rhs
- | _ -&gt; rhs
- in
-
- (* Merge lhs/rhs. *)
- let lhs = Ast.Binary (c, lhs, rhs) in
- parse_bin_rhs expr_prec lhs stream
- end
- | _ -&gt; lhs
-
-and parse_var_init = parser
- (* read in the optional initializer. *)
- | [&lt; 'Token.Kwd '='; e=parse_expr &gt;] -&gt; Some e
- | [&lt; &gt;] -&gt; None
-
-and parse_var_names accumulator = parser
- | [&lt; 'Token.Kwd ',';
- 'Token.Ident id ?? "expected identifier list after var";
- init=parse_var_init;
- e=parse_var_names ((id, init) :: accumulator) &gt;] -&gt; e
- | [&lt; &gt;] -&gt; accumulator
-
-(* expression
- * ::= primary binoprhs *)
-and parse_expr = parser
- | [&lt; lhs=parse_unary; stream &gt;] -&gt; parse_bin_rhs 0 lhs stream
-
-(* prototype
- * ::= id '(' id* ')'
- * ::= binary LETTER number? (id, id)
- * ::= unary LETTER number? (id) *)
-let parse_prototype =
- let rec parse_args accumulator = parser
- | [&lt; 'Token.Ident id; e=parse_args (id::accumulator) &gt;] -&gt; e
- | [&lt; &gt;] -&gt; accumulator
- in
- let parse_operator = parser
- | [&lt; 'Token.Unary &gt;] -&gt; "unary", 1
- | [&lt; 'Token.Binary &gt;] -&gt; "binary", 2
- in
- let parse_binary_precedence = parser
- | [&lt; 'Token.Number n &gt;] -&gt; int_of_float n
- | [&lt; &gt;] -&gt; 30
- in
- parser
- | [&lt; 'Token.Ident id;
- 'Token.Kwd '(' ?? "expected '(' in prototype";
- args=parse_args [];
- 'Token.Kwd ')' ?? "expected ')' in prototype" &gt;] -&gt;
- (* success. *)
- Ast.Prototype (id, Array.of_list (List.rev args))
- | [&lt; (prefix, kind)=parse_operator;
- 'Token.Kwd op ?? "expected an operator";
- (* Read the precedence if present. *)
- binary_precedence=parse_binary_precedence;
- 'Token.Kwd '(' ?? "expected '(' in prototype";
- args=parse_args [];
- 'Token.Kwd ')' ?? "expected ')' in prototype" &gt;] -&gt;
- let name = prefix ^ (String.make 1 op) in
- let args = Array.of_list (List.rev args) in
-
- (* Verify right number of arguments for operator. *)
- if Array.length args != kind
- then raise (Stream.Error "invalid number of operands for operator")
- else
- if kind == 1 then
- Ast.Prototype (name, args)
- else
- Ast.BinOpPrototype (name, args, binary_precedence)
- | [&lt; &gt;] -&gt;
- raise (Stream.Error "expected function name in prototype")
-
-(* definition ::= 'def' prototype expression *)
-let parse_definition = parser
- | [&lt; 'Token.Def; p=parse_prototype; e=parse_expr &gt;] -&gt;
- Ast.Function (p, e)
-
-(* toplevelexpr ::= expression *)
-let parse_toplevel = parser
- | [&lt; e=parse_expr &gt;] -&gt;
- (* Make an anonymous proto. *)
- Ast.Function (Ast.Prototype ("", [||]), e)
-
-(* external ::= 'extern' prototype *)
-let parse_extern = parser
- | [&lt; 'Token.Extern; e=parse_prototype &gt;] -&gt; e
-</pre>
-</dd>
-
-<dt>codegen.ml:</dt>
-<dd class="doc_code">
-<pre>
-(*===----------------------------------------------------------------------===
- * Code Generation
- *===----------------------------------------------------------------------===*)
-
-open Llvm
-
-exception Error of string
-
-let the_module = create_module "my cool jit"
-let builder = builder ()
-let named_values:(string, llvalue) Hashtbl.t = Hashtbl.create 10
-
-(* Create an alloca instruction in the entry block of the function. This
- * is used for mutable variables etc. *)
-let create_entry_block_alloca the_function var_name =
- let builder = builder_at (instr_begin (entry_block the_function)) in
- build_alloca double_type var_name builder
-
-let rec codegen_expr = function
- | Ast.Number n -&gt; const_float double_type n
- | Ast.Variable name -&gt;
- let v = try Hashtbl.find named_values name with
- | Not_found -&gt; raise (Error "unknown variable name")
- in
- (* Load the value. *)
- build_load v name builder
- | Ast.Unary (op, operand) -&gt;
- let operand = codegen_expr operand in
- let callee = "unary" ^ (String.make 1 op) in
- let callee =
- match lookup_function callee the_module with
- | Some callee -&gt; callee
- | None -&gt; raise (Error "unknown unary operator")
- in
- build_call callee [|operand|] "unop" builder
- | Ast.Binary (op, lhs, rhs) -&gt;
- begin match op with
- | '=' -&gt;
- (* Special case '=' because we don't want to emit the LHS as an
- * expression. *)
- let name =
- match lhs with
- | Ast.Variable name -&gt; name
- | _ -&gt; raise (Error "destination of '=' must be a variable")
- in
-
- (* Codegen the rhs. *)
- let val_ = codegen_expr rhs in
-
- (* Lookup the name. *)
- let variable = try Hashtbl.find named_values name with
- | Not_found -&gt; raise (Error "unknown variable name")
- in
- ignore(build_store val_ variable builder);
- val_
- | _ -&gt;
- let lhs_val = codegen_expr lhs in
- let rhs_val = codegen_expr rhs in
- begin
- match op with
- | '+' -&gt; build_add lhs_val rhs_val "addtmp" builder
- | '-' -&gt; build_sub lhs_val rhs_val "subtmp" builder
- | '*' -&gt; build_mul lhs_val rhs_val "multmp" builder
- | '&lt;' -&gt;
- (* Convert bool 0/1 to double 0.0 or 1.0 *)
- let i = build_fcmp Fcmp.Ult lhs_val rhs_val "cmptmp" builder in
- build_uitofp i double_type "booltmp" builder
- | _ -&gt;
- (* If it wasn't a builtin binary operator, it must be a user defined
- * one. Emit a call to it. *)
- let callee = "binary" ^ (String.make 1 op) in
- let callee =
- match lookup_function callee the_module with
- | Some callee -&gt; callee
- | None -&gt; raise (Error "binary operator not found!")
- in
- build_call callee [|lhs_val; rhs_val|] "binop" builder
- end
- end
- | Ast.Call (callee, args) -&gt;
- (* Look up the name in the module table. *)
- let callee =
- match lookup_function callee the_module with
- | Some callee -&gt; callee
- | None -&gt; raise (Error "unknown function referenced")
- in
- let params = params callee in
-
- (* If argument mismatch error. *)
- if Array.length params == Array.length args then () else
- raise (Error "incorrect # arguments passed");
- let args = Array.map codegen_expr args in
- build_call callee args "calltmp" builder
- | Ast.If (cond, then_, else_) -&gt;
- let cond = codegen_expr cond in
-
- (* Convert condition to a bool by comparing equal to 0.0 *)
- let zero = const_float double_type 0.0 in
- let cond_val = build_fcmp Fcmp.One cond zero "ifcond" builder in
-
- (* Grab the first block so that we might later add the conditional branch
- * to it at the end of the function. *)
- let start_bb = insertion_block builder in
- let the_function = block_parent start_bb in
-
- let then_bb = append_block "then" the_function in
-
- (* Emit 'then' value. *)
- position_at_end then_bb builder;
- let then_val = codegen_expr then_ in
-
- (* Codegen of 'then' can change the current block, update then_bb for the
- * phi. We create a new name because one is used for the phi node, and the
- * other is used for the conditional branch. *)
- let new_then_bb = insertion_block builder in
-
- (* Emit 'else' value. *)
- let else_bb = append_block "else" the_function in
- position_at_end else_bb builder;
- let else_val = codegen_expr else_ in
-
- (* Codegen of 'else' can change the current block, update else_bb for the
- * phi. *)
- let new_else_bb = insertion_block builder in
-
- (* Emit merge block. *)
- let merge_bb = append_block "ifcont" the_function in
- position_at_end merge_bb builder;
- let incoming = [(then_val, new_then_bb); (else_val, new_else_bb)] in
- let phi = build_phi incoming "iftmp" builder in
-
- (* Return to the start block to add the conditional branch. *)
- position_at_end start_bb builder;
- ignore (build_cond_br cond_val then_bb else_bb builder);
-
- (* Set a unconditional branch at the end of the 'then' block and the
- * 'else' block to the 'merge' block. *)
- position_at_end new_then_bb builder; ignore (build_br merge_bb builder);
- position_at_end new_else_bb builder; ignore (build_br merge_bb builder);
-
- (* Finally, set the builder to the end of the merge block. *)
- position_at_end merge_bb builder;
-
- phi
- | Ast.For (var_name, start, end_, step, body) -&gt;
- (* Output this as:
- * var = alloca double
- * ...
- * start = startexpr
- * store start -&gt; var
- * goto loop
- * loop:
- * ...
- * bodyexpr
- * ...
- * loopend:
- * step = stepexpr
- * endcond = endexpr
- *
- * curvar = load var
- * nextvar = curvar + step
- * store nextvar -&gt; var
- * br endcond, loop, endloop
- * outloop: *)
-
- let the_function = block_parent (insertion_block builder) in
-
- (* Create an alloca for the variable in the entry block. *)
- let alloca = create_entry_block_alloca the_function var_name in
-
- (* Emit the start code first, without 'variable' in scope. *)
- let start_val = codegen_expr start in
-
- (* Store the value into the alloca. *)
- ignore(build_store start_val alloca builder);
-
- (* Make the new basic block for the loop header, inserting after current
- * block. *)
- let loop_bb = append_block "loop" the_function in
-
- (* Insert an explicit fall through from the current block to the
- * loop_bb. *)
- ignore (build_br loop_bb builder);
-
- (* Start insertion in loop_bb. *)
- position_at_end loop_bb builder;
-
- (* Within the loop, the variable is defined equal to the PHI node. If it
- * shadows an existing variable, we have to restore it, so save it
- * now. *)
- let old_val =
- try Some (Hashtbl.find named_values var_name) with Not_found -&gt; None
- in
- Hashtbl.add named_values var_name alloca;
-
- (* Emit the body of the loop. This, like any other expr, can change the
- * current BB. Note that we ignore the value computed by the body, but
- * don't allow an error *)
- ignore (codegen_expr body);
-
- (* Emit the step value. *)
- let step_val =
- match step with
- | Some step -&gt; codegen_expr step
- (* If not specified, use 1.0. *)
- | None -&gt; const_float double_type 1.0
- in
-
- (* Compute the end condition. *)
- let end_cond = codegen_expr end_ in
-
- (* Reload, increment, and restore the alloca. This handles the case where
- * the body of the loop mutates the variable. *)
- let cur_var = build_load alloca var_name builder in
- let next_var = build_add cur_var step_val "nextvar" builder in
- ignore(build_store next_var alloca builder);
-
- (* Convert condition to a bool by comparing equal to 0.0. *)
- let zero = const_float double_type 0.0 in
- let end_cond = build_fcmp Fcmp.One end_cond zero "loopcond" builder in
-
- (* Create the "after loop" block and insert it. *)
- let after_bb = append_block "afterloop" the_function in
-
- (* Insert the conditional branch into the end of loop_end_bb. *)
- ignore (build_cond_br end_cond loop_bb after_bb builder);
-
- (* Any new code will be inserted in after_bb. *)
- position_at_end after_bb builder;
-
- (* Restore the unshadowed variable. *)
- begin match old_val with
- | Some old_val -&gt; Hashtbl.add named_values var_name old_val
- | None -&gt; ()
- end;
-
- (* for expr always returns 0.0. *)
- const_null double_type
- | Ast.Var (var_names, body) -&gt;
- let old_bindings = ref [] in
-
- let the_function = block_parent (insertion_block builder) in
-
- (* Register all variables and emit their initializer. *)
- Array.iter (fun (var_name, init) -&gt;
- (* Emit the initializer before adding the variable to scope, this
- * prevents the initializer from referencing the variable itself, and
- * permits stuff like this:
- * var a = 1 in
- * var a = a in ... # refers to outer 'a'. *)
- let init_val =
- match init with
- | Some init -&gt; codegen_expr init
- (* If not specified, use 0.0. *)
- | None -&gt; const_float double_type 0.0
- in
-
- let alloca = create_entry_block_alloca the_function var_name in
- ignore(build_store init_val alloca builder);
-
- (* Remember the old variable binding so that we can restore the binding
- * when we unrecurse. *)
- begin
- try
- let old_value = Hashtbl.find named_values var_name in
- old_bindings := (var_name, old_value) :: !old_bindings;
- with Not_found -&gt; ()
- end;
-
- (* Remember this binding. *)
- Hashtbl.add named_values var_name alloca;
- ) var_names;
-
- (* Codegen the body, now that all vars are in scope. *)
- let body_val = codegen_expr body in
-
- (* Pop all our variables from scope. *)
- List.iter (fun (var_name, old_value) -&gt;
- Hashtbl.add named_values var_name old_value
- ) !old_bindings;
-
- (* Return the body computation. *)
- body_val
-
-let codegen_proto = function
- | Ast.Prototype (name, args) | Ast.BinOpPrototype (name, args, _) -&gt;
- (* Make the function type: double(double,double) etc. *)
- let doubles = Array.make (Array.length args) double_type in
- let ft = function_type double_type doubles in
- let f =
- match lookup_function name the_module with
- | None -&gt; declare_function name ft the_module
-
- (* If 'f' conflicted, there was already something named 'name'. If it
- * has a body, don't allow redefinition or reextern. *)
- | Some f -&gt;
- (* If 'f' already has a body, reject this. *)
- if block_begin f &lt;&gt; At_end f then
- raise (Error "redefinition of function");
-
- (* If 'f' took a different number of arguments, reject. *)
- if element_type (type_of f) &lt;&gt; ft then
- raise (Error "redefinition of function with different # args");
- f
- in
-
- (* Set names for all arguments. *)
- Array.iteri (fun i a -&gt;
- let n = args.(i) in
- set_value_name n a;
- Hashtbl.add named_values n a;
- ) (params f);
- f
-
-(* Create an alloca for each argument and register the argument in the symbol
- * table so that references to it will succeed. *)
-let create_argument_allocas the_function proto =
- let args = match proto with
- | Ast.Prototype (_, args) | Ast.BinOpPrototype (_, args, _) -&gt; args
- in
- Array.iteri (fun i ai -&gt;
- let var_name = args.(i) in
- (* Create an alloca for this variable. *)
- let alloca = create_entry_block_alloca the_function var_name in
-
- (* Store the initial value into the alloca. *)
- ignore(build_store ai alloca builder);
-
- (* Add arguments to variable symbol table. *)
- Hashtbl.add named_values var_name alloca;
- ) (params the_function)
-
-let codegen_func the_fpm = function
- | Ast.Function (proto, body) -&gt;
- Hashtbl.clear named_values;
- let the_function = codegen_proto proto in
-
- (* If this is an operator, install it. *)
- begin match proto with
- | Ast.BinOpPrototype (name, args, prec) -&gt;
- let op = name.[String.length name - 1] in
- Hashtbl.add Parser.binop_precedence op prec;
- | _ -&gt; ()
- end;
-
- (* Create a new basic block to start insertion into. *)
- let bb = append_block "entry" the_function in
- position_at_end bb builder;
-
- try
- (* Add all arguments to the symbol table and create their allocas. *)
- create_argument_allocas the_function proto;
-
- let ret_val = codegen_expr body in
-
- (* Finish off the function. *)
- let _ = build_ret ret_val builder in
-
- (* Validate the generated code, checking for consistency. *)
- Llvm_analysis.assert_valid_function the_function;
-
- (* Optimize the function. *)
- let _ = PassManager.run_function the_function the_fpm in
-
- the_function
- with e -&gt;
- delete_function the_function;
- raise e
-</pre>
-</dd>
-
-<dt>toplevel.ml:</dt>
-<dd class="doc_code">
-<pre>
-(*===----------------------------------------------------------------------===
- * Top-Level parsing and JIT Driver
- *===----------------------------------------------------------------------===*)
-
-open Llvm
-open Llvm_executionengine
-
-(* top ::= definition | external | expression | ';' *)
-let rec main_loop the_fpm the_execution_engine stream =
- match Stream.peek stream with
- | None -&gt; ()
-
- (* ignore top-level semicolons. *)
- | Some (Token.Kwd ';') -&gt;
- Stream.junk stream;
- main_loop the_fpm the_execution_engine stream
-
- | Some token -&gt;
- begin
- try match token with
- | Token.Def -&gt;
- let e = Parser.parse_definition stream in
- print_endline "parsed a function definition.";
- dump_value (Codegen.codegen_func the_fpm e);
- | Token.Extern -&gt;
- let e = Parser.parse_extern stream in
- print_endline "parsed an extern.";
- dump_value (Codegen.codegen_proto e);
- | _ -&gt;
- (* Evaluate a top-level expression into an anonymous function. *)
- let e = Parser.parse_toplevel stream in
- print_endline "parsed a top-level expr";
- let the_function = Codegen.codegen_func the_fpm e in
- dump_value the_function;
-
- (* JIT the function, returning a function pointer. *)
- let result = ExecutionEngine.run_function the_function [||]
- the_execution_engine in
-
- print_string "Evaluated to ";
- print_float (GenericValue.as_float double_type result);
- print_newline ();
- with Stream.Error s | Codegen.Error s -&gt;
- (* Skip token for error recovery. *)
- Stream.junk stream;
- print_endline s;
- end;
- print_string "ready&gt; "; flush stdout;
- main_loop the_fpm the_execution_engine stream
-</pre>
-</dd>
-
-<dt>toy.ml:</dt>
-<dd class="doc_code">
-<pre>
-(*===----------------------------------------------------------------------===
- * Main driver code.
- *===----------------------------------------------------------------------===*)
-
-open Llvm
-open Llvm_executionengine
-open Llvm_target
-open Llvm_scalar_opts
-
-let main () =
- (* Install standard binary operators.
- * 1 is the lowest precedence. *)
- Hashtbl.add Parser.binop_precedence '=' 2;
- Hashtbl.add Parser.binop_precedence '&lt;' 10;
- Hashtbl.add Parser.binop_precedence '+' 20;
- Hashtbl.add Parser.binop_precedence '-' 20;
- Hashtbl.add Parser.binop_precedence '*' 40; (* highest. *)
-
- (* Prime the first token. *)
- print_string "ready&gt; "; flush stdout;
- let stream = Lexer.lex (Stream.of_channel stdin) in
-
- (* Create the JIT. *)
- let the_module_provider = ModuleProvider.create Codegen.the_module in
- let the_execution_engine = ExecutionEngine.create the_module_provider in
- let the_fpm = PassManager.create_function the_module_provider in
-
- (* Set up the optimizer pipeline. Start with registering info about how the
- * target lays out data structures. *)
- TargetData.add (ExecutionEngine.target_data the_execution_engine) the_fpm;
-
- (* Promote allocas to registers. *)
- add_memory_to_register_promotion the_fpm;
-
- (* Do simple "peephole" optimizations and bit-twiddling optzn. *)
- add_instruction_combining the_fpm;
-
- (* reassociate expressions. *)
- add_reassociation the_fpm;
-
- (* Eliminate Common SubExpressions. *)
- add_gvn the_fpm;
-
- (* Simplify the control flow graph (deleting unreachable blocks, etc). *)
- add_cfg_simplification the_fpm;
-
- (* Run the main "interpreter loop" now. *)
- Toplevel.main_loop the_fpm the_execution_engine stream;
-
- (* Print out all the generated code. *)
- dump_module Codegen.the_module
-;;
-
-main ()
-</pre>
-</dd>
-
-<dt>bindings.c</dt>
-<dd class="doc_code">
-<pre>
-#include &lt;stdio.h&gt;
-
-/* putchard - putchar that takes a double and returns 0. */
-extern double putchard(double X) {
- putchar((char)X);
- return 0;
-}
-
-/* printd - printf that takes a double prints it as "%f\n", returning 0. */
-extern double printd(double X) {
- printf("%f\n", X);
- return 0;
-}
-</pre>
-</dd>
-</dl>
-
-<a href="LangImpl8.html">Next: Conclusion and other useful LLVM tidbits</a>
-</div>
-
-<!-- *********************************************************************** -->
-<hr>
-<address>
- <a href="http://jigsaw.w3.org/css-validator/check/referer"><img
- src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"></a>
- <a href="http://validator.w3.org/check/referer"><img
- src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!"></a>
-
- <a href="mailto:sabre@nondot.org">Chris Lattner</a><br>
- <a href="http://llvm.org">The LLVM Compiler Infrastructure</a><br>
- <a href="mailto:idadesub@users.sourceforge.net">Erick Tryzelaar</a><br>
- Last modified: $Date: 2007-10-17 11:05:13 -0700 (Wed, 17 Oct 2007) $
-</address>
-</body>
-</html>
diff --git a/release_23/docs/tutorial/index.html b/release_23/docs/tutorial/index.html
deleted file mode 100644
index bfaafe7265f3..000000000000
--- a/release_23/docs/tutorial/index.html
+++ /dev/null
@@ -1,58 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
- "http://www.w3.org/TR/html4/strict.dtd">
-<html>
-<head>
- <title>LLVM Tutorial: Table of Contents</title>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <meta name="author" content="Owen Anderson">
- <meta name="description"
- content="LLVM Tutorial: Table of Contents.">
- <link rel="stylesheet" href="../llvm.css" type="text/css">
-</head>
-
-<body>
-
-<div class="doc_title"> LLVM Tutorial: Table of Contents </div>
-
-<ol>
- <li><!--<a href="Introduction.html">-->An Introduction to LLVM: Basic Concepts and Design</li>
- <li>Simple JIT Tutorials
- <ol>
- <li><a href="JITTutorial1.html">A First Function</a></li>
- <li><a href="JITTutorial2.html">A More Complicated Function</a></li>
- <li><!--<a href="Tutorial3.html">-->Running Optimizations</li>
- <li><!--<a href="Tutorial4.html">-->Reading and Writing Bitcode</li>
- <li><!--<a href="Tutorial5.html">-->Invoking the JIT</li>
- </ol>
- </li>
- <li>Kaleidoscope: Implementing a Language with LLVM
- <ol>
- <li><a href="LangImpl1.html">Tutorial Introduction and the Lexer</a></li>
- <li><a href="LangImpl2.html">Implementing a Parser and AST</a></li>
- <li><a href="LangImpl3.html">Implementing Code Generation to LLVM IR</a></li>
- <li><a href="LangImpl4.html">Adding JIT and Optimizer Support</a></li>
- <li><a href="LangImpl5.html">Extending the language: control flow</a></li>
- <li><a href="LangImpl6.html">Extending the language: user-defined operators</a></li>
- <li><a href="LangImpl7.html">Extending the language: mutable variables / SSA construction</a></li>
- <li><a href="LangImpl8.html">Conclusion and other useful LLVM tidbits</a></li>
- </ol></li>
- <li>Kaleidoscope: Implementing a Language with LLVM in Objective Caml
- <ol>
- <li><a href="OCamlLangImpl1.html">Tutorial Introduction and the Lexer</a></li>
- <li><a href="OCamlLangImpl2.html">Implementing a Parser and AST</a></li>
- <li><a href="OCamlLangImpl3.html">Implementing Code Generation to LLVM IR</a></li>
- <li><a href="OCamlLangImpl4.html">Adding JIT and Optimizer Support</a></li>
- <li><a href="OCamlLangImpl5.html">Extending the language: control flow</a></li>
- <li><a href="OCamlLangImpl6.html">Extending the language: user-defined operators</a></li>
- <li><a href="OCamlLangImpl7.html">Extending the language: mutable variables / SSA construction</a></li>
- <li><a href="LangImpl8.html">Conclusion and other useful LLVM tidbits</a></li>
- </ol></li>
- <li>Advanced Topics
- <ol>
- <li><a href="http://llvm.org/pubs/2004-09-22-LCPCLLVMTutorial.html">Writing
- an Optimization for LLVM</a></li>
- </ol></li>
-</ol>
-
-</body>
-</html>
diff --git a/release_23/examples/BrainF/BrainF.cpp b/release_23/examples/BrainF/BrainF.cpp
deleted file mode 100644
index bd6d5f2e56c2..000000000000
--- a/release_23/examples/BrainF/BrainF.cpp
+++ /dev/null
@@ -1,455 +0,0 @@
-//===-- BrainF.cpp - BrainF compiler example ----------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===--------------------------------------------------------------------===//
-//
-// This class compiles the BrainF language into LLVM assembly.
-//
-// The BrainF language has 8 commands:
-// Command Equivalent C Action
-// ------- ------------ ------
-// , *h=getchar(); Read a character from stdin, 255 on EOF
-// . putchar(*h); Write a character to stdout
-// - --*h; Decrement tape
-// + ++*h; Increment tape
-// < --h; Move head left
-// > ++h; Move head right
-// [ while(*h) { Start loop
-// ] } End loop
-//
-//===--------------------------------------------------------------------===//
-
-#include "BrainF.h"
-#include "llvm/Constants.h"
-#include "llvm/Intrinsics.h"
-#include "llvm/ADT/STLExtras.h"
-
-using namespace llvm;
-
-//Set the constants for naming
-const char *BrainF::tapereg = "tape";
-const char *BrainF::headreg = "head";
-const char *BrainF::label = "brainf";
-const char *BrainF::testreg = "test";
-
-Module *BrainF::parse(std::istream *in1, int mem, CompileFlags cf) {
- in = in1;
- memtotal = mem;
- comflag = cf;
-
- header();
- readloop(0, 0, 0);
- delete builder;
- return module;
-}
-
-void BrainF::header() {
- module = new Module("BrainF");
-
- //Function prototypes
-
- //declare void @llvm.memset.i32(i8 *, i8, i32, i32)
- Function *memset_func = Intrinsic::getDeclaration(module, Intrinsic::memset_i32);
-
- //declare i32 @getchar()
- getchar_func = cast<Function>(module->
- getOrInsertFunction("getchar", IntegerType::Int32Ty, NULL));
-
- //declare i32 @putchar(i32)
- putchar_func = cast<Function>(module->
- getOrInsertFunction("putchar", IntegerType::Int32Ty,
- IntegerType::Int32Ty, NULL));
-
-
- //Function header
-
- //define void @brainf()
- brainf_func = cast<Function>(module->
- getOrInsertFunction("brainf", Type::VoidTy, NULL));
-
- builder = new IRBuilder(BasicBlock::Create(label, brainf_func));
-
- //%arr = malloc i8, i32 %d
- ConstantInt *val_mem = ConstantInt::get(APInt(32, memtotal));
- ptr_arr = builder->CreateMalloc(IntegerType::Int8Ty, val_mem, "arr");
-
- //call void @llvm.memset.i32(i8 *%arr, i8 0, i32 %d, i32 1)
- {
- Value *memset_params[] = {
- ptr_arr,
- ConstantInt::get(APInt(8, 0)),
- val_mem,
- ConstantInt::get(APInt(32, 1))
- };
-
- CallInst *memset_call = builder->
- CreateCall(memset_func, memset_params, array_endof(memset_params));
- memset_call->setTailCall(false);
- }
-
- //%arrmax = getelementptr i8 *%arr, i32 %d
- if (comflag & flag_arraybounds) {
- ptr_arrmax = builder->
- CreateGEP(ptr_arr, ConstantInt::get(APInt(32, memtotal)), "arrmax");
- }
-
- //%head.%d = getelementptr i8 *%arr, i32 %d
- curhead = builder->CreateGEP(ptr_arr,
- ConstantInt::get(APInt(32, memtotal/2)),
- headreg);
-
-
-
- //Function footer
-
- //brainf.end:
- endbb = BasicBlock::Create(label, brainf_func);
-
- //free i8 *%arr
- new FreeInst(ptr_arr, endbb);
-
- //ret void
- ReturnInst::Create(endbb);
-
-
-
- //Error block for array out of bounds
- if (comflag & flag_arraybounds)
- {
- //@aberrormsg = internal constant [%d x i8] c"\00"
- Constant *msg_0 = ConstantArray::
- get("Error: The head has left the tape.", true);
-
- GlobalVariable *aberrormsg = new GlobalVariable(
- msg_0->getType(),
- true,
- GlobalValue::InternalLinkage,
- msg_0,
- "aberrormsg",
- module);
-
- //declare i32 @puts(i8 *)
- Function *puts_func = cast<Function>(module->
- getOrInsertFunction("puts", IntegerType::Int32Ty,
- PointerType::getUnqual(IntegerType::Int8Ty), NULL));
-
- //brainf.aberror:
- aberrorbb = BasicBlock::Create(label, brainf_func);
-
- //call i32 @puts(i8 *getelementptr([%d x i8] *@aberrormsg, i32 0, i32 0))
- {
- Constant *zero_32 = Constant::getNullValue(IntegerType::Int32Ty);
-
- Constant *gep_params[] = {
- zero_32,
- zero_32
- };
-
- Constant *msgptr = ConstantExpr::
- getGetElementPtr(aberrormsg, gep_params,
- array_lengthof(gep_params));
-
- Value *puts_params[] = {
- msgptr
- };
-
- CallInst *puts_call =
- CallInst::Create(puts_func,
- puts_params, array_endof(puts_params),
- "", aberrorbb);
- puts_call->setTailCall(false);
- }
-
- //br label %brainf.end
- BranchInst::Create(endbb, aberrorbb);
- }
-}
-
-void BrainF::readloop(PHINode *phi, BasicBlock *oldbb, BasicBlock *testbb) {
- Symbol cursym = SYM_NONE;
- int curvalue = 0;
- Symbol nextsym = SYM_NONE;
- int nextvalue = 0;
- char c;
- int loop;
- int direction;
-
- while(cursym != SYM_EOF && cursym != SYM_ENDLOOP) {
- // Write out commands
- switch(cursym) {
- case SYM_NONE:
- // Do nothing
- break;
-
- case SYM_READ:
- {
- //%tape.%d = call i32 @getchar()
- CallInst *getchar_call = builder->CreateCall(getchar_func, tapereg);
- getchar_call->setTailCall(false);
- Value *tape_0 = getchar_call;
-
- //%tape.%d = trunc i32 %tape.%d to i8
- Value *tape_1 = builder->
- CreateTrunc(tape_0, IntegerType::Int8Ty, tapereg);
-
- //store i8 %tape.%d, i8 *%head.%d
- builder->CreateStore(tape_1, curhead);
- }
- break;
-
- case SYM_WRITE:
- {
- //%tape.%d = load i8 *%head.%d
- LoadInst *tape_0 = builder->CreateLoad(curhead, tapereg);
-
- //%tape.%d = sext i8 %tape.%d to i32
- Value *tape_1 = builder->
- CreateSExt(tape_0, IntegerType::Int32Ty, tapereg);
-
- //call i32 @putchar(i32 %tape.%d)
- Value *putchar_params[] = {
- tape_1
- };
- CallInst *putchar_call = builder->
- CreateCall(putchar_func,
- putchar_params, array_endof(putchar_params));
- putchar_call->setTailCall(false);
- }
- break;
-
- case SYM_MOVE:
- {
- //%head.%d = getelementptr i8 *%head.%d, i32 %d
- curhead = builder->
- CreateGEP(curhead, ConstantInt::get(APInt(32, curvalue)),
- headreg);
-
- //Error block for array out of bounds
- if (comflag & flag_arraybounds)
- {
- //%test.%d = icmp uge i8 *%head.%d, %arrmax
- Value *test_0 = builder->
- CreateICmpUGE(curhead, ptr_arrmax, testreg);
-
- //%test.%d = icmp ult i8 *%head.%d, %arr
- Value *test_1 = builder->
- CreateICmpULT(curhead, ptr_arr, testreg);
-
- //%test.%d = or i1 %test.%d, %test.%d
- Value *test_2 = builder->
- CreateOr(test_0, test_1, testreg);
-
- //br i1 %test.%d, label %main.%d, label %main.%d
- BasicBlock *nextbb = BasicBlock::Create(label, brainf_func);
- builder->CreateCondBr(test_2, aberrorbb, nextbb);
-
- //main.%d:
- builder->SetInsertPoint(nextbb);
- }
- }
- break;
-
- case SYM_CHANGE:
- {
- //%tape.%d = load i8 *%head.%d
- LoadInst *tape_0 = builder->CreateLoad(curhead, tapereg);
-
- //%tape.%d = add i8 %tape.%d, %d
- Value *tape_1 = builder->
- CreateAdd(tape_0, ConstantInt::get(APInt(8, curvalue)), tapereg);
-
- //store i8 %tape.%d, i8 *%head.%d\n"
- builder->CreateStore(tape_1, curhead);
- }
- break;
-
- case SYM_LOOP:
- {
- //br label %main.%d
- BasicBlock *testbb = BasicBlock::Create(label, brainf_func);
- builder->CreateBr(testbb);
-
- //main.%d:
- BasicBlock *bb_0 = builder->GetInsertBlock();
- BasicBlock *bb_1 = BasicBlock::Create(label, brainf_func);
- builder->SetInsertPoint(bb_1);
-
- //Make part of PHI instruction now, wait until end of loop to finish
- PHINode *phi_0 = PHINode::Create(PointerType::getUnqual(IntegerType::Int8Ty),
- headreg, testbb);
- phi_0->reserveOperandSpace(2);
- phi_0->addIncoming(curhead, bb_0);
- curhead = phi_0;
-
- readloop(phi_0, bb_1, testbb);
- }
- break;
-
- default:
- cerr<<"Error: Unknown symbol.\n";
- abort();
- break;
- }
-
- cursym = nextsym;
- curvalue = nextvalue;
- nextsym = SYM_NONE;
-
- // Reading stdin loop
- loop = (cursym == SYM_NONE)
- || (cursym == SYM_MOVE)
- || (cursym == SYM_CHANGE);
- while(loop) {
- *in>>c;
- if (in->eof()) {
- if (cursym == SYM_NONE) {
- cursym = SYM_EOF;
- } else {
- nextsym = SYM_EOF;
- }
- loop = 0;
- } else {
- direction = 1;
- switch(c) {
- case '-':
- direction = -1;
- // Fall through
-
- case '+':
- if (cursym == SYM_CHANGE) {
- curvalue += direction;
- // loop = 1
- } else {
- if (cursym == SYM_NONE) {
- cursym = SYM_CHANGE;
- curvalue = direction;
- // loop = 1
- } else {
- nextsym = SYM_CHANGE;
- nextvalue = direction;
- loop = 0;
- }
- }
- break;
-
- case '<':
- direction = -1;
- // Fall through
-
- case '>':
- if (cursym == SYM_MOVE) {
- curvalue += direction;
- // loop = 1
- } else {
- if (cursym == SYM_NONE) {
- cursym = SYM_MOVE;
- curvalue = direction;
- // loop = 1
- } else {
- nextsym = SYM_MOVE;
- nextvalue = direction;
- loop = 0;
- }
- }
- break;
-
- case ',':
- if (cursym == SYM_NONE) {
- cursym = SYM_READ;
- } else {
- nextsym = SYM_READ;
- }
- loop = 0;
- break;
-
- case '.':
- if (cursym == SYM_NONE) {
- cursym = SYM_WRITE;
- } else {
- nextsym = SYM_WRITE;
- }
- loop = 0;
- break;
-
- case '[':
- if (cursym == SYM_NONE) {
- cursym = SYM_LOOP;
- } else {
- nextsym = SYM_LOOP;
- }
- loop = 0;
- break;
-
- case ']':
- if (cursym == SYM_NONE) {
- cursym = SYM_ENDLOOP;
- } else {
- nextsym = SYM_ENDLOOP;
- }
- loop = 0;
- break;
-
- // Ignore other characters
- default:
- break;
- }
- }
- }
- }
-
- if (cursym == SYM_ENDLOOP) {
- if (!phi) {
- cerr<<"Error: Extra ']'\n";
- abort();
- }
-
- // Write loop test
- {
- //br label %main.%d
- builder->CreateBr(testbb);
-
- //main.%d:
-
- //%head.%d = phi i8 *[%head.%d, %main.%d], [%head.%d, %main.%d]
- //Finish phi made at beginning of loop
- phi->addIncoming(curhead, builder->GetInsertBlock());
- Value *head_0 = phi;
-
- //%tape.%d = load i8 *%head.%d
- LoadInst *tape_0 = new LoadInst(head_0, tapereg, testbb);
-
- //%test.%d = icmp eq i8 %tape.%d, 0
- ICmpInst *test_0 = new ICmpInst(ICmpInst::ICMP_EQ, tape_0,
- ConstantInt::get(APInt(8, 0)), testreg,
- testbb);
-
- //br i1 %test.%d, label %main.%d, label %main.%d
- BasicBlock *bb_0 = BasicBlock::Create(label, brainf_func);
- BranchInst::Create(bb_0, oldbb, test_0, testbb);
-
- //main.%d:
- builder->SetInsertPoint(bb_0);
-
- //%head.%d = phi i8 *[%head.%d, %main.%d]
- PHINode *phi_1 = builder->
- CreatePHI(PointerType::getUnqual(IntegerType::Int8Ty), headreg);
- phi_1->reserveOperandSpace(1);
- phi_1->addIncoming(head_0, testbb);
- curhead = phi_1;
- }
-
- return;
- }
-
- //End of the program, so go to return block
- builder->CreateBr(endbb);
-
- if (phi) {
- cerr<<"Error: Missing ']'\n";
- abort();
- }
-}
diff --git a/release_23/examples/BrainF/BrainF.h b/release_23/examples/BrainF/BrainF.h
deleted file mode 100644
index e6aef82095da..000000000000
--- a/release_23/examples/BrainF/BrainF.h
+++ /dev/null
@@ -1,91 +0,0 @@
-//===-- BrainF.h - BrainF compiler class ----------------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===--------------------------------------------------------------------===//
-//
-// This class stores the data for the BrainF compiler so it doesn't have
-// to pass all of it around. The main method is parse.
-//
-//===--------------------------------------------------------------------===//
-
-#ifndef BRAINF_H
-#define BRAINF_H
-
-#include "llvm/Module.h"
-#include "llvm/Support/IRBuilder.h"
-
-using namespace llvm;
-
-/// This class provides a parser for the BrainF language.
-/// The class itself is made to store values during
-/// parsing so they don't have to be passed around
-/// as much.
-class BrainF {
- public:
- /// Options for how BrainF should compile
- enum CompileFlags {
- flag_off = 0,
- flag_arraybounds = 1
- };
-
- /// This is the main method. It parses BrainF from in1
- /// and returns the module with a function
- /// void brainf()
- /// containing the resulting code.
- /// On error, it calls abort.
- /// The caller must delete the returned module.
- Module *parse(std::istream *in1, int mem, CompileFlags cf);
-
- protected:
- /// The different symbols in the BrainF language
- enum Symbol {
- SYM_NONE,
- SYM_READ,
- SYM_WRITE,
- SYM_MOVE,
- SYM_CHANGE,
- SYM_LOOP,
- SYM_ENDLOOP,
- SYM_EOF
- };
-
- /// Names of the different parts of the language.
- /// Tape is used for reading and writing the tape.
- /// headreg is used for the position of the head.
- /// label is used for the labels for the BasicBlocks.
- /// testreg is used for testing the loop exit condition.
- static const char *tapereg;
- static const char *headreg;
- static const char *label;
- static const char *testreg;
-
- /// Put the brainf function preamble and other fixed pieces of code
- void header();
-
- /// The main loop for parsing. It calls itself recursively
- /// to handle the depth of nesting of "[]".
- void readloop(PHINode *phi, BasicBlock *oldbb, BasicBlock *testbb);
-
- /// Constants during parsing
- int memtotal;
- CompileFlags comflag;
- std::istream *in;
- Module *module;
- Function *brainf_func;
- Function *getchar_func;
- Function *putchar_func;
- Value *ptr_arr;
- Value *ptr_arrmax;
- BasicBlock *endbb;
- BasicBlock *aberrorbb;
-
- /// Variables
- IRBuilder *builder;
- Value *curhead;
-};
-
-#endif
diff --git a/release_23/examples/BrainF/BrainFDriver.cpp b/release_23/examples/BrainF/BrainFDriver.cpp
deleted file mode 100644
index 0a24d7b665f8..000000000000
--- a/release_23/examples/BrainF/BrainFDriver.cpp
+++ /dev/null
@@ -1,156 +0,0 @@
-//===-- BrainFDriver.cpp - BrainF compiler driver -----------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===--------------------------------------------------------------------===//
-//
-// This program converts the BrainF language into LLVM assembly,
-// which it can then run using the JIT or output as BitCode.
-//
-// This implementation has a tape of 65536 bytes,
-// with the head starting in the middle.
-// Range checking is off by default, so be careful.
-// It can be enabled with -abc.
-//
-// Use:
-// ./BrainF -jit prog.bf #Run program now
-// ./BrainF -jit -abc prog.bf #Run program now safely
-// ./BrainF prog.bf #Write as BitCode
-//
-// lli prog.bf.bc #Run generated BitCode
-// llvm-ld -native -o=prog prog.bf.bc #Compile BitCode into native executable
-//
-//===--------------------------------------------------------------------===//
-
-#include "BrainF.h"
-#include "llvm/Constants.h"
-#include "llvm/ModuleProvider.h"
-#include "llvm/Analysis/Verifier.h"
-#include "llvm/Bitcode/ReaderWriter.h"
-#include "llvm/ExecutionEngine/GenericValue.h"
-#include "llvm/ExecutionEngine/JIT.h"
-#include "llvm/Support/CommandLine.h"
-#include "llvm/Support/ManagedStatic.h"
-#include <fstream>
-#include <iostream>
-
-using namespace llvm;
-
-//Command line options
-
-static cl::opt<std::string>
-InputFilename(cl::Positional, cl::desc("<input brainf>"));
-
-static cl::opt<std::string>
-OutputFilename("o", cl::desc("Output filename"), cl::value_desc("filename"));
-
-static cl::opt<bool>
-ArrayBoundsChecking("abc", cl::desc("Enable array bounds checking"));
-
-static cl::opt<bool>
-JIT("jit", cl::desc("Run program Just-In-Time"));
-
-
-//Add main function so can be fully compiled
-void addMainFunction(Module *mod) {
- //define i32 @main(i32 %argc, i8 **%argv)
- Function *main_func = cast<Function>(mod->
- getOrInsertFunction("main", IntegerType::Int32Ty, IntegerType::Int32Ty,
- PointerType::getUnqual(PointerType::getUnqual(
- IntegerType::Int8Ty)), NULL));
- {
- Function::arg_iterator args = main_func->arg_begin();
- Value *arg_0 = args++;
- arg_0->setName("argc");
- Value *arg_1 = args++;
- arg_1->setName("argv");
- }
-
- //main.0:
- BasicBlock *bb = BasicBlock::Create("main.0", main_func);
-
- //call void @brainf()
- {
- CallInst *brainf_call = CallInst::Create(mod->getFunction("brainf"),
- "", bb);
- brainf_call->setTailCall(false);
- }
-
- //ret i32 0
- ReturnInst::Create(ConstantInt::get(APInt(32, 0)), bb);
-}
-
-int main(int argc, char **argv) {
- cl::ParseCommandLineOptions(argc, argv, " BrainF compiler\n");
-
- if (InputFilename == "") {
- cerr<<"Error: You must specify the filename of the program to "
- "be compiled. Use --help to see the options.\n";
- abort();
- }
-
- //Get the output stream
- std::ostream *out = &std::cout;
- if (!JIT) {
- if (OutputFilename == "") {
- std::string base = InputFilename;
- if (InputFilename == "-") {base = "a";}
-
- //Use default filename
- const char *suffix = ".bc";
- OutputFilename = base+suffix;
- }
- if (OutputFilename != "-") {
- out = new std::
- ofstream(OutputFilename.c_str(),
- std::ios::out | std::ios::trunc | std::ios::binary);
- }
- }
-
- //Get the input stream
- std::istream *in = &std::cin;
- if (InputFilename != "-") {
- in = new std::ifstream(InputFilename.c_str());
- }
-
- //Gather the compile flags
- BrainF::CompileFlags cf = BrainF::flag_off;
- if (ArrayBoundsChecking) {
- cf = BrainF::CompileFlags(cf | BrainF::flag_arraybounds);
- }
-
- //Read the BrainF program
- BrainF bf;
- Module *mod = bf.parse(in, 65536, cf); //64 KiB
- if (in != &std::cin) {delete in;}
- addMainFunction(mod);
-
- //Verify generated code
- if (verifyModule(*mod)) {
- cerr<<"Error: module failed verification. This shouldn't happen.\n";
- abort();
- }
-
- //Write it out
- if (JIT) {
- cout<<"------- Running JIT -------\n";
- ExistingModuleProvider *mp = new ExistingModuleProvider(mod);
- ExecutionEngine *ee = ExecutionEngine::create(mp, false);
- std::vector<GenericValue> args;
- Function *brainf_func = mod->getFunction("brainf");
- GenericValue gv = ee->runFunction(brainf_func, args);
- } else {
- WriteBitcodeToFile(mod, *out);
- }
-
- //Clean up
- if (out != &std::cout) {delete out;}
- delete mod;
-
- llvm_shutdown();
-
- return 0;
-}
diff --git a/release_23/examples/BrainF/Makefile b/release_23/examples/BrainF/Makefile
deleted file mode 100644
index b1d2a61261f8..000000000000
--- a/release_23/examples/BrainF/Makefile
+++ /dev/null
@@ -1,15 +0,0 @@
-##===- examples/BrainF/Makefile ----------------------------*- Makefile -*-===##
-#
-# The LLVM Compiler Infrastructure
-#
-# This file is distributed under the University of Illinois Open Source
-# License. See LICENSE.TXT for details.
-#
-##===----------------------------------------------------------------------===##
-LEVEL = ../..
-TOOLNAME = BrainF
-EXAMPLE_TOOL = 1
-
-LINK_COMPONENTS := jit bitwriter native interpreter
-
-include $(LEVEL)/Makefile.common
diff --git a/release_23/examples/Fibonacci/Makefile b/release_23/examples/Fibonacci/Makefile
deleted file mode 100644
index 04d9caef3d77..000000000000
--- a/release_23/examples/Fibonacci/Makefile
+++ /dev/null
@@ -1,17 +0,0 @@
-##===- examples/Fibonacci/Makefile -------------------------*- Makefile -*-===##
-#
-# The LLVM Compiler Infrastructure
-#
-# This file is distributed under the University of Illinois Open Source
-# License. See LICENSE.TXT for details.
-#
-##===----------------------------------------------------------------------===##
-
-LEVEL = ../..
-TOOLNAME = Fibonacci
-EXAMPLE_TOOL = 1
-
-# Link in JIT support
-LINK_COMPONENTS := jit interpreter native
-
-include $(LEVEL)/Makefile.common
diff --git a/release_23/examples/Fibonacci/fibonacci.cpp b/release_23/examples/Fibonacci/fibonacci.cpp
deleted file mode 100644
index f5ef0d02a8fb..000000000000
--- a/release_23/examples/Fibonacci/fibonacci.cpp
+++ /dev/null
@@ -1,121 +0,0 @@
-//===--- examples/Fibonacci/fibonacci.cpp - An example use of the JIT -----===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This small program provides an example of how to build quickly a small module
-// with function Fibonacci and execute it with the JIT.
-//
-// The goal of this snippet is to create in the memory the LLVM module
-// consisting of one function as follow:
-//
-// int fib(int x) {
-// if(x<=2) return 1;
-// return fib(x-1)+fib(x-2);
-// }
-//
-// Once we have this, we compile the module via JIT, then execute the `fib'
-// function and return result to a driver, i.e. to a "host program".
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Module.h"
-#include "llvm/DerivedTypes.h"
-#include "llvm/Constants.h"
-#include "llvm/Instructions.h"
-#include "llvm/ModuleProvider.h"
-#include "llvm/Analysis/Verifier.h"
-#include "llvm/ExecutionEngine/JIT.h"
-#include "llvm/ExecutionEngine/Interpreter.h"
-#include "llvm/ExecutionEngine/GenericValue.h"
-#include <iostream>
-using namespace llvm;
-
-static Function *CreateFibFunction(Module *M) {
- // Create the fib function and insert it into module M. This function is said
- // to return an int and take an int parameter.
- Function *FibF =
- cast<Function>(M->getOrInsertFunction("fib", Type::Int32Ty, Type::Int32Ty,
- (Type *)0));
-
- // Add a basic block to the function.
- BasicBlock *BB = BasicBlock::Create("EntryBlock", FibF);
-
- // Get pointers to the constants.
- Value *One = ConstantInt::get(Type::Int32Ty, 1);
- Value *Two = ConstantInt::get(Type::Int32Ty, 2);
-
- // Get pointer to the integer argument of the add1 function...
- Argument *ArgX = FibF->arg_begin(); // Get the arg.
- ArgX->setName("AnArg"); // Give it a nice symbolic name for fun.
-
- // Create the true_block.
- BasicBlock *RetBB = BasicBlock::Create("return", FibF);
- // Create an exit block.
- BasicBlock* RecurseBB = BasicBlock::Create("recurse", FibF);
-
- // Create the "if (arg <= 2) goto exitbb"
- Value *CondInst = new ICmpInst(ICmpInst::ICMP_SLE, ArgX, Two, "cond", BB);
- BranchInst::Create(RetBB, RecurseBB, CondInst, BB);
-
- // Create: ret int 1
- ReturnInst::Create(One, RetBB);
-
- // create fib(x-1)
- Value *Sub = BinaryOperator::createSub(ArgX, One, "arg", RecurseBB);
- CallInst *CallFibX1 = CallInst::Create(FibF, Sub, "fibx1", RecurseBB);
- CallFibX1->setTailCall();
-
- // create fib(x-2)
- Sub = BinaryOperator::createSub(ArgX, Two, "arg", RecurseBB);
- CallInst *CallFibX2 = CallInst::Create(FibF, Sub, "fibx2", RecurseBB);
- CallFibX2->setTailCall();
-
-
- // fib(x-1)+fib(x-2)
- Value *Sum = BinaryOperator::createAdd(CallFibX1, CallFibX2,
- "addresult", RecurseBB);
-
- // Create the return instruction and add it to the basic block
- ReturnInst::Create(Sum, RecurseBB);
-
- return FibF;
-}
-
-
-int main(int argc, char **argv) {
- int n = argc > 1 ? atol(argv[1]) : 24;
-
- // Create some module to put our function into it.
- Module *M = new Module("test");
-
- // We are about to create the "fib" function:
- Function *FibF = CreateFibFunction(M);
-
- // Now we going to create JIT
- ExistingModuleProvider *MP = new ExistingModuleProvider(M);
- ExecutionEngine *EE = ExecutionEngine::create(MP, false);
-
- std::cerr << "verifying... ";
- if (verifyModule(*M)) {
- std::cerr << argv[0] << ": Error constructing function!\n";
- return 1;
- }
-
- std::cerr << "OK\n";
- std::cerr << "We just constructed this LLVM module:\n\n---------\n" << *M;
- std::cerr << "---------\nstarting fibonacci(" << n << ") with JIT...\n";
-
- // Call the Fibonacci function with argument n:
- std::vector<GenericValue> Args(1);
- Args[0].IntVal = APInt(32, n);
- GenericValue GV = EE->runFunction(FibF, Args);
-
- // import result of execution
- std::cout << "Result: " << GV.IntVal.toStringUnsigned(10) << "\n";
- return 0;
-}
diff --git a/release_23/examples/HowToUseJIT/HowToUseJIT.cpp b/release_23/examples/HowToUseJIT/HowToUseJIT.cpp
deleted file mode 100644
index 2aba8e1128a2..000000000000
--- a/release_23/examples/HowToUseJIT/HowToUseJIT.cpp
+++ /dev/null
@@ -1,112 +0,0 @@
-//===-- examples/HowToUseJIT/HowToUseJIT.cpp - An example use of the JIT --===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This small program provides an example of how to quickly build a small
-// module with two functions and execute it with the JIT.
-//
-// Goal:
-// The goal of this snippet is to create in the memory
-// the LLVM module consisting of two functions as follow:
-//
-// int add1(int x) {
-// return x+1;
-// }
-//
-// int foo() {
-// return add1(10);
-// }
-//
-// then compile the module via JIT, then execute the `foo'
-// function and return result to a driver, i.e. to a "host program".
-//
-// Some remarks and questions:
-//
-// - could we invoke some code using noname functions too?
-// e.g. evaluate "foo()+foo()" without fears to introduce
-// conflict of temporary function name with some real
-// existing function name?
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Module.h"
-#include "llvm/Constants.h"
-#include "llvm/DerivedTypes.h"
-#include "llvm/Instructions.h"
-#include "llvm/ModuleProvider.h"
-#include "llvm/ExecutionEngine/JIT.h"
-#include "llvm/ExecutionEngine/Interpreter.h"
-#include "llvm/ExecutionEngine/GenericValue.h"
-#include <iostream>
-using namespace llvm;
-
-int main() {
- // Create some module to put our function into it.
- Module *M = new Module("test");
-
- // Create the add1 function entry and insert this entry into module M. The
- // function will have a return type of "int" and take an argument of "int".
- // The '0' terminates the list of argument types.
- Function *Add1F =
- cast<Function>(M->getOrInsertFunction("add1", Type::Int32Ty, Type::Int32Ty,
- (Type *)0));
-
- // Add a basic block to the function. As before, it automatically inserts
- // because of the last argument.
- BasicBlock *BB = BasicBlock::Create("EntryBlock", Add1F);
-
- // Get pointers to the constant `1'.
- Value *One = ConstantInt::get(Type::Int32Ty, 1);
-
- // Get pointers to the integer argument of the add1 function...
- assert(Add1F->arg_begin() != Add1F->arg_end()); // Make sure there's an arg
- Argument *ArgX = Add1F->arg_begin(); // Get the arg
- ArgX->setName("AnArg"); // Give it a nice symbolic name for fun.
-
- // Create the add instruction, inserting it into the end of BB.
- Instruction *Add = BinaryOperator::createAdd(One, ArgX, "addresult", BB);
-
- // Create the return instruction and add it to the basic block
- ReturnInst::Create(Add, BB);
-
- // Now, function add1 is ready.
-
-
- // Now we going to create function `foo', which returns an int and takes no
- // arguments.
- Function *FooF =
- cast<Function>(M->getOrInsertFunction("foo", Type::Int32Ty, (Type *)0));
-
- // Add a basic block to the FooF function.
- BB = BasicBlock::Create("EntryBlock", FooF);
-
- // Get pointers to the constant `10'.
- Value *Ten = ConstantInt::get(Type::Int32Ty, 10);
-
- // Pass Ten to the call call:
- CallInst *Add1CallRes = CallInst::Create(Add1F, Ten, "add1", BB);
- Add1CallRes->setTailCall(true);
-
- // Create the return instruction and add it to the basic block.
- ReturnInst::Create(Add1CallRes, BB);
-
- // Now we create the JIT.
- ExistingModuleProvider* MP = new ExistingModuleProvider(M);
- ExecutionEngine* EE = ExecutionEngine::create(MP, false);
-
- std::cout << "We just constructed this LLVM module:\n\n" << *M;
- std::cout << "\n\nRunning foo: " << std::flush;
-
- // Call the `foo' function with no arguments:
- std::vector<GenericValue> noargs;
- GenericValue gv = EE->runFunction(FooF, noargs);
-
- // Import result of execution:
- std::cout << "Result: " << gv.IntVal.toStringUnsigned(10) << "\n";
- return 0;
-}
diff --git a/release_23/examples/HowToUseJIT/Makefile b/release_23/examples/HowToUseJIT/Makefile
deleted file mode 100644
index 14dfa61c652e..000000000000
--- a/release_23/examples/HowToUseJIT/Makefile
+++ /dev/null
@@ -1,15 +0,0 @@
-##===- examples/HowToUseJIT/Makefile -----------------------*- Makefile -*-===##
-#
-# The LLVM Compiler Infrastructure
-#
-# This file is distributed under the University of Illinois Open Source
-# License. See LICENSE.TXT for details.
-#
-##===----------------------------------------------------------------------===##
-LEVEL = ../..
-TOOLNAME = HowToUseJIT
-EXAMPLE_TOOL = 1
-
-LINK_COMPONENTS := jit interpreter native
-
-include $(LEVEL)/Makefile.common
diff --git a/release_23/examples/Makefile b/release_23/examples/Makefile
deleted file mode 100644
index 39118f7ed176..000000000000
--- a/release_23/examples/Makefile
+++ /dev/null
@@ -1,19 +0,0 @@
-##===- examples/Makefile -----------------------------------*- Makefile -*-===##
-#
-# The LLVM Compiler Infrastructure
-#
-# This file is distributed under the University of Illinois Open Source
-# License. See LICENSE.TXT for details.
-#
-##===----------------------------------------------------------------------===##
-LEVEL=..
-
-include $(LEVEL)/Makefile.config
-
-PARALLEL_DIRS:= BrainF Fibonacci HowToUseJIT ModuleMaker
-
-ifeq ($(HAVE_PTHREAD),1)
-PARALLEL_DIRS += ParallelJIT
-endif
-
-include $(LEVEL)/Makefile.common
diff --git a/release_23/examples/ModuleMaker/Makefile b/release_23/examples/ModuleMaker/Makefile
deleted file mode 100644
index 9454cf514dc1..000000000000
--- a/release_23/examples/ModuleMaker/Makefile
+++ /dev/null
@@ -1,14 +0,0 @@
-##===- examples/ModuleMaker/Makefile -----------------------*- Makefile -*-===##
-#
-# The LLVM Compiler Infrastructure
-#
-# This file is distributed under the University of Illinois Open Source
-# License. See LICENSE.TXT for details.
-#
-##===----------------------------------------------------------------------===##
-LEVEL=../..
-TOOLNAME=ModuleMaker
-EXAMPLE_TOOL = 1
-LINK_COMPONENTS := bitwriter
-
-include $(LEVEL)/Makefile.common
diff --git a/release_23/examples/ModuleMaker/ModuleMaker.cpp b/release_23/examples/ModuleMaker/ModuleMaker.cpp
deleted file mode 100644
index 40d2fa99f4f0..000000000000
--- a/release_23/examples/ModuleMaker/ModuleMaker.cpp
+++ /dev/null
@@ -1,61 +0,0 @@
-//===- examples/ModuleMaker/ModuleMaker.cpp - Example project ---*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This programs is a simple example that creates an LLVM module "from scratch",
-// emitting it as a bitcode file to standard out. This is just to show how
-// LLVM projects work and to demonstrate some of the LLVM APIs.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Module.h"
-#include "llvm/DerivedTypes.h"
-#include "llvm/Constants.h"
-#include "llvm/Instructions.h"
-#include "llvm/Bitcode/ReaderWriter.h"
-#include <iostream>
-using namespace llvm;
-
-int main() {
- // Create the "module" or "program" or "translation unit" to hold the
- // function
- Module *M = new Module("test");
-
- // Create the main function: first create the type 'int ()'
- FunctionType *FT = FunctionType::get(Type::Int32Ty, std::vector<const Type*>(),
- /*not vararg*/false);
-
- // By passing a module as the last parameter to the Function constructor,
- // it automatically gets appended to the Module.
- Function *F = Function::Create(FT, Function::ExternalLinkage, "main", M);
-
- // Add a basic block to the function... again, it automatically inserts
- // because of the last argument.
- BasicBlock *BB = BasicBlock::Create("EntryBlock", F);
-
- // Get pointers to the constant integers...
- Value *Two = ConstantInt::get(Type::Int32Ty, 2);
- Value *Three = ConstantInt::get(Type::Int32Ty, 3);
-
- // Create the add instruction... does not insert...
- Instruction *Add = BinaryOperator::create(Instruction::Add, Two, Three,
- "addresult");
-
- // explicitly insert it into the basic block...
- BB->getInstList().push_back(Add);
-
- // Create the return instruction and add it to the basic block
- BB->getInstList().push_back(ReturnInst::Create(Add));
-
- // Output the bitcode file to stdout
- WriteBitcodeToFile(M, std::cout);
-
- // Delete the module and all of its contents.
- delete M;
- return 0;
-}
diff --git a/release_23/examples/ModuleMaker/README.txt b/release_23/examples/ModuleMaker/README.txt
deleted file mode 100644
index ecbe30e4cfe8..000000000000
--- a/release_23/examples/ModuleMaker/README.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-//===----------------------------------------------------------------------===//
-// ModuleMaker Sample project
-//===----------------------------------------------------------------------===//
-
-This project is an extremely simple example of using some simple pieces of the
-LLVM API. The actual executable generated by this project simply emits an
-LLVM bytecode file to standard output. It is designed to show some basic
-usage of LLVM APIs, and how to link to LLVM libraries.
diff --git a/release_23/examples/ParallelJIT/Makefile b/release_23/examples/ParallelJIT/Makefile
deleted file mode 100644
index 5031eca9ac51..000000000000
--- a/release_23/examples/ParallelJIT/Makefile
+++ /dev/null
@@ -1,17 +0,0 @@
-##===- examples/ParallelJIT/Makefile -----------------------*- Makefile -*-===##
-#
-# The LLVM Compiler Infrastructure
-#
-# This file is distributed under the University of Illinois Open Source
-# License. See LICENSE.TXT for details.
-#
-##===----------------------------------------------------------------------===##
-LEVEL = ../..
-TOOLNAME = ParallelJIT
-EXAMPLE_TOOL = 1
-
-LINK_COMPONENTS := jit interpreter native
-
-include $(LEVEL)/Makefile.common
-
-LIBS += -lpthread
diff --git a/release_23/examples/ParallelJIT/ParallelJIT.cpp b/release_23/examples/ParallelJIT/ParallelJIT.cpp
deleted file mode 100644
index 634bffa1261c..000000000000
--- a/release_23/examples/ParallelJIT/ParallelJIT.cpp
+++ /dev/null
@@ -1,298 +0,0 @@
-//===-- examples/ParallelJIT/ParallelJIT.cpp - Exercise threaded-safe JIT -===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// Parallel JIT
-//
-// This test program creates two LLVM functions then calls them from three
-// separate threads. It requires the pthreads library.
-// The three threads are created and then block waiting on a condition variable.
-// Once all threads are blocked on the conditional variable, the main thread
-// wakes them up. This complicated work is performed so that all three threads
-// call into the JIT at the same time (or the best possible approximation of the
-// same time). This test had assertion errors until I got the locking right.
-
-#include <pthread.h>
-#include "llvm/Module.h"
-#include "llvm/Constants.h"
-#include "llvm/DerivedTypes.h"
-#include "llvm/Instructions.h"
-#include "llvm/ModuleProvider.h"
-#include "llvm/ExecutionEngine/JIT.h"
-#include "llvm/ExecutionEngine/Interpreter.h"
-#include "llvm/ExecutionEngine/GenericValue.h"
-#include <iostream>
-using namespace llvm;
-
-static Function* createAdd1(Module *M) {
- // Create the add1 function entry and insert this entry into module M. The
- // function will have a return type of "int" and take an argument of "int".
- // The '0' terminates the list of argument types.
- Function *Add1F =
- cast<Function>(M->getOrInsertFunction("add1", Type::Int32Ty, Type::Int32Ty,
- (Type *)0));
-
- // Add a basic block to the function. As before, it automatically inserts
- // because of the last argument.
- BasicBlock *BB = BasicBlock::Create("EntryBlock", Add1F);
-
- // Get pointers to the constant `1'.
- Value *One = ConstantInt::get(Type::Int32Ty, 1);
-
- // Get pointers to the integer argument of the add1 function...
- assert(Add1F->arg_begin() != Add1F->arg_end()); // Make sure there's an arg
- Argument *ArgX = Add1F->arg_begin(); // Get the arg
- ArgX->setName("AnArg"); // Give it a nice symbolic name for fun.
-
- // Create the add instruction, inserting it into the end of BB.
- Instruction *Add = BinaryOperator::createAdd(One, ArgX, "addresult", BB);
-
- // Create the return instruction and add it to the basic block
- ReturnInst::Create(Add, BB);
-
- // Now, function add1 is ready.
- return Add1F;
-}
-
-static Function *CreateFibFunction(Module *M) {
- // Create the fib function and insert it into module M. This function is said
- // to return an int and take an int parameter.
- Function *FibF =
- cast<Function>(M->getOrInsertFunction("fib", Type::Int32Ty, Type::Int32Ty,
- (Type *)0));
-
- // Add a basic block to the function.
- BasicBlock *BB = BasicBlock::Create("EntryBlock", FibF);
-
- // Get pointers to the constants.
- Value *One = ConstantInt::get(Type::Int32Ty, 1);
- Value *Two = ConstantInt::get(Type::Int32Ty, 2);
-
- // Get pointer to the integer argument of the add1 function...
- Argument *ArgX = FibF->arg_begin(); // Get the arg.
- ArgX->setName("AnArg"); // Give it a nice symbolic name for fun.
-
- // Create the true_block.
- BasicBlock *RetBB = BasicBlock::Create("return", FibF);
- // Create an exit block.
- BasicBlock* RecurseBB = BasicBlock::Create("recurse", FibF);
-
- // Create the "if (arg < 2) goto exitbb"
- Value *CondInst = new ICmpInst(ICmpInst::ICMP_SLE, ArgX, Two, "cond", BB);
- BranchInst::Create(RetBB, RecurseBB, CondInst, BB);
-
- // Create: ret int 1
- ReturnInst::Create(One, RetBB);
-
- // create fib(x-1)
- Value *Sub = BinaryOperator::createSub(ArgX, One, "arg", RecurseBB);
- Value *CallFibX1 = CallInst::Create(FibF, Sub, "fibx1", RecurseBB);
-
- // create fib(x-2)
- Sub = BinaryOperator::createSub(ArgX, Two, "arg", RecurseBB);
- Value *CallFibX2 = CallInst::Create(FibF, Sub, "fibx2", RecurseBB);
-
- // fib(x-1)+fib(x-2)
- Value *Sum =
- BinaryOperator::createAdd(CallFibX1, CallFibX2, "addresult", RecurseBB);
-
- // Create the return instruction and add it to the basic block
- ReturnInst::Create(Sum, RecurseBB);
-
- return FibF;
-}
-
-struct threadParams {
- ExecutionEngine* EE;
- Function* F;
- int value;
-};
-
-// We block the subthreads just before they begin to execute:
-// we want all of them to call into the JIT at the same time,
-// to verify that the locking is working correctly.
-class WaitForThreads
-{
-public:
- WaitForThreads()
- {
- n = 0;
- waitFor = 0;
-
- int result = pthread_cond_init( &condition, NULL );
- assert( result == 0 );
-
- result = pthread_mutex_init( &mutex, NULL );
- assert( result == 0 );
- }
-
- ~WaitForThreads()
- {
- int result = pthread_cond_destroy( &condition );
- assert( result == 0 );
-
- result = pthread_mutex_destroy( &mutex );
- assert( result == 0 );
- }
-
- // All threads will stop here until another thread calls releaseThreads
- void block()
- {
- int result = pthread_mutex_lock( &mutex );
- assert( result == 0 );
- n ++;
- //~ std::cout << "block() n " << n << " waitFor " << waitFor << std::endl;
-
- assert( waitFor == 0 || n <= waitFor );
- if ( waitFor > 0 && n == waitFor )
- {
- // There are enough threads blocked that we can release all of them
- std::cout << "Unblocking threads from block()" << std::endl;
- unblockThreads();
- }
- else
- {
- // We just need to wait until someone unblocks us
- result = pthread_cond_wait( &condition, &mutex );
- assert( result == 0 );
- }
-
- // unlock the mutex before returning
- result = pthread_mutex_unlock( &mutex );
- assert( result == 0 );
- }
-
- // If there are num or more threads blocked, it will signal them all
- // Otherwise, this thread blocks until there are enough OTHER threads
- // blocked
- void releaseThreads( size_t num )
- {
- int result = pthread_mutex_lock( &mutex );
- assert( result == 0 );
-
- if ( n >= num ) {
- std::cout << "Unblocking threads from releaseThreads()" << std::endl;
- unblockThreads();
- }
- else
- {
- waitFor = num;
- pthread_cond_wait( &condition, &mutex );
- }
-
- // unlock the mutex before returning
- result = pthread_mutex_unlock( &mutex );
- assert( result == 0 );
- }
-
-private:
- void unblockThreads()
- {
- // Reset the counters to zero: this way, if any new threads
- // enter while threads are exiting, they will block instead
- // of triggering a new release of threads
- n = 0;
-
- // Reset waitFor to zero: this way, if waitFor threads enter
- // while threads are exiting, they will block instead of
- // triggering a new release of threads
- waitFor = 0;
-
- int result = pthread_cond_broadcast( &condition );
- assert(result == 0); result=result;
- }
-
- size_t n;
- size_t waitFor;
- pthread_cond_t condition;
- pthread_mutex_t mutex;
-};
-
-static WaitForThreads synchronize;
-
-void* callFunc( void* param )
-{
- struct threadParams* p = (struct threadParams*) param;
-
- // Call the `foo' function with no arguments:
- std::vector<GenericValue> Args(1);
- Args[0].IntVal = APInt(32, p->value);
-
- synchronize.block(); // wait until other threads are at this point
- GenericValue gv = p->EE->runFunction(p->F, Args);
-
- return (void*)(intptr_t)gv.IntVal.getZExtValue();
-}
-
-int main()
-{
- // Create some module to put our function into it.
- Module *M = new Module("test");
-
- Function* add1F = createAdd1( M );
- Function* fibF = CreateFibFunction( M );
-
- // Now we create the JIT.
- ExistingModuleProvider* MP = new ExistingModuleProvider(M);
- ExecutionEngine* EE = ExecutionEngine::create(MP, false);
-
- //~ std::cout << "We just constructed this LLVM module:\n\n" << *M;
- //~ std::cout << "\n\nRunning foo: " << std::flush;
-
- // Create one thread for add1 and two threads for fib
- struct threadParams add1 = { EE, add1F, 1000 };
- struct threadParams fib1 = { EE, fibF, 39 };
- struct threadParams fib2 = { EE, fibF, 42 };
-
- pthread_t add1Thread;
- int result = pthread_create( &add1Thread, NULL, callFunc, &add1 );
- if ( result != 0 ) {
- std::cerr << "Could not create thread" << std::endl;
- return 1;
- }
-
- pthread_t fibThread1;
- result = pthread_create( &fibThread1, NULL, callFunc, &fib1 );
- if ( result != 0 ) {
- std::cerr << "Could not create thread" << std::endl;
- return 1;
- }
-
- pthread_t fibThread2;
- result = pthread_create( &fibThread2, NULL, callFunc, &fib2 );
- if ( result != 0 ) {
- std::cerr << "Could not create thread" << std::endl;
- return 1;
- }
-
- synchronize.releaseThreads(3); // wait until other threads are at this point
-
- void* returnValue;
- result = pthread_join( add1Thread, &returnValue );
- if ( result != 0 ) {
- std::cerr << "Could not join thread" << std::endl;
- return 1;
- }
- std::cout << "Add1 returned " << intptr_t(returnValue) << std::endl;
-
- result = pthread_join( fibThread1, &returnValue );
- if ( result != 0 ) {
- std::cerr << "Could not join thread" << std::endl;
- return 1;
- }
- std::cout << "Fib1 returned " << intptr_t(returnValue) << std::endl;
-
- result = pthread_join( fibThread2, &returnValue );
- if ( result != 0 ) {
- std::cerr << "Could not join thread" << std::endl;
- return 1;
- }
- std::cout << "Fib2 returned " << intptr_t(returnValue) << std::endl;
-
- return 0;
-}
diff --git a/release_23/include/llvm-c/Analysis.h b/release_23/include/llvm-c/Analysis.h
deleted file mode 100644
index 68d8e65db49e..000000000000
--- a/release_23/include/llvm-c/Analysis.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/*===-- llvm-c/Analysis.h - Analysis Library C Interface --------*- C++ -*-===*\
-|* *|
-|* The LLVM Compiler Infrastructure *|
-|* *|
-|* This file is distributed under the University of Illinois Open Source *|
-|* License. See LICENSE.TXT for details. *|
-|* *|
-|*===----------------------------------------------------------------------===*|
-|* *|
-|* This header declares the C interface to libLLVMAnalysis.a, which *|
-|* implements various analyses of the LLVM IR. *|
-|* *|
-|* Many exotic languages can interoperate with C code but have a harder time *|
-|* with C++ due to name mangling. So in addition to C, this interface enables *|
-|* tools written in such languages. *|
-|* *|
-\*===----------------------------------------------------------------------===*/
-
-#ifndef LLVM_C_ANALYSIS_H
-#define LLVM_C_ANALYSIS_H
-
-#include "llvm-c/Core.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-typedef enum {
- LLVMAbortProcessAction, /* verifier will print to stderr and abort() */
- LLVMPrintMessageAction, /* verifier will print to stderr and return 1 */
- LLVMReturnStatusAction /* verifier will just return 1 */
-} LLVMVerifierFailureAction;
-
-
-/* Verifies that a module is valid, taking the specified action if not.
- Optionally returns a human-readable description of any invalid constructs.
- OutMessage must be disposed with LLVMDisposeMessage. */
-int LLVMVerifyModule(LLVMModuleRef M, LLVMVerifierFailureAction Action,
- char **OutMessage);
-
-/* Verifies that a single function is valid, taking the specified action. Useful
- for debugging. */
-int LLVMVerifyFunction(LLVMValueRef Fn, LLVMVerifierFailureAction Action);
-
-/* Open up a ghostview window that displays the CFG of the current function.
- Useful for debugging. */
-void LLVMViewFunctionCFG(LLVMValueRef Fn);
-void LLVMViewFunctionCFGOnly(LLVMValueRef Fn);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/release_23/include/llvm-c/BitReader.h b/release_23/include/llvm-c/BitReader.h
deleted file mode 100644
index e30b431d8872..000000000000
--- a/release_23/include/llvm-c/BitReader.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/*===-- llvm-c/BitReader.h - BitReader Library C Interface ------*- C++ -*-===*\
-|* *|
-|* The LLVM Compiler Infrastructure *|
-|* *|
-|* This file is distributed under the University of Illinois Open Source *|
-|* License. See LICENSE.TXT for details. *|
-|* *|
-|*===----------------------------------------------------------------------===*|
-|* *|
-|* This header declares the C interface to libLLVMBitReader.a, which *|
-|* implements input of the LLVM bitcode format. *|
-|* *|
-|* Many exotic languages can interoperate with C code but have a harder time *|
-|* with C++ due to name mangling. So in addition to C, this interface enables *|
-|* tools written in such languages. *|
-|* *|
-\*===----------------------------------------------------------------------===*/
-
-#ifndef LLVM_C_BITCODEREADER_H
-#define LLVM_C_BITCODEREADER_H
-
-#include "llvm-c/Core.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/* Builds a module from the bitcode in the specified memory buffer, returning a
- reference to the module via the OutModule parameter. Returns 0 on success.
- Optionally returns a human-readable error message via OutMessage. */
-int LLVMParseBitcode(LLVMMemoryBufferRef MemBuf,
- LLVMModuleRef *OutModule, char **OutMessage);
-
-/* Reads a module from the specified path, returning via the OutMP parameter
- a module provider which performs lazy deserialization. Returns 0 on success.
- Optionally returns a human-readable error message via OutMessage. */
-int LLVMGetBitcodeModuleProvider(LLVMMemoryBufferRef MemBuf,
- LLVMModuleProviderRef *OutMP,
- char **OutMessage);
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/release_23/include/llvm-c/BitWriter.h b/release_23/include/llvm-c/BitWriter.h
deleted file mode 100644
index 008ff9f2c106..000000000000
--- a/release_23/include/llvm-c/BitWriter.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/*===-- llvm-c/BitWriter.h - BitWriter Library C Interface ------*- C++ -*-===*\
-|* *|
-|* The LLVM Compiler Infrastructure *|
-|* *|
-|* This file is distributed under the University of Illinois Open Source *|
-|* License. See LICENSE.TXT for details. *|
-|* *|
-|*===----------------------------------------------------------------------===*|
-|* *|
-|* This header declares the C interface to libLLVMBitWriter.a, which *|
-|* implements output of the LLVM bitcode format. *|
-|* *|
-|* Many exotic languages can interoperate with C code but have a harder time *|
-|* with C++ due to name mangling. So in addition to C, this interface enables *|
-|* tools written in such languages. *|
-|* *|
-\*===----------------------------------------------------------------------===*/
-
-#ifndef LLVM_C_BITCODEWRITER_H
-#define LLVM_C_BITCODEWRITER_H
-
-#include "llvm-c/Core.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*===-- Operations on modules ---------------------------------------------===*/
-
-/* Writes a module to an open file descriptor. Returns 0 on success.
- Closes the Handle. Use dup first if this is not what you want. */
-int LLVMWriteBitcodeToFileHandle(LLVMModuleRef M, int Handle);
-
-/* Writes a module to the specified path. Returns 0 on success. */
-int LLVMWriteBitcodeToFile(LLVMModuleRef M, const char *Path);
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/release_23/include/llvm-c/Core.h b/release_23/include/llvm-c/Core.h
deleted file mode 100644
index d3e7a08d9031..000000000000
--- a/release_23/include/llvm-c/Core.h
+++ /dev/null
@@ -1,756 +0,0 @@
-/*===-- llvm-c/Core.h - Core Library C Interface ------------------*- C -*-===*\
-|* *|
-|* The LLVM Compiler Infrastructure *|
-|* *|
-|* This file is distributed under the University of Illinois Open Source *|
-|* License. See LICENSE.TXT for details. *|
-|* *|
-|*===----------------------------------------------------------------------===*|
-|* *|
-|* This header declares the C interface to libLLVMCore.a, which implements *|
-|* the LLVM intermediate representation. *|
-|* *|
-|* LLVM uses a polymorphic type hierarchy which C cannot represent, therefore *|
-|* parameters must be passed as base types. Despite the declared types, most *|
-|* of the functions provided operate only on branches of the type hierarchy. *|
-|* The declared parameter names are descriptive and specify which type is *|
-|* required. Additionally, each type hierarchy is documented along with the *|
-|* functions that operate upon it. For more detail, refer to LLVM's C++ code. *|
-|* If in doubt, refer to Core.cpp, which performs paramter downcasts in the *|
-|* form unwrap<RequiredType>(Param). *|
-|* *|
-|* Many exotic languages can interoperate with C code but have a harder time *|
-|* with C++ due to name mangling. So in addition to C, this interface enables *|
-|* tools written in such languages. *|
-|* *|
-|* When included into a C++ source file, also declares 'wrap' and 'unwrap' *|
-|* helpers to perform opaque reference<-->pointer conversions. These helpers *|
-|* are shorter and more tightly typed than writing the casts by hand when *|
-|* authoring bindings. In assert builds, they will do runtime type checking. *|
-|* *|
-\*===----------------------------------------------------------------------===*/
-
-#ifndef LLVM_C_CORE_H
-#define LLVM_C_CORE_H
-
-#ifdef __cplusplus
-
-/* Need these includes to support the LLVM 'cast' template for the C++ 'wrap'
- and 'unwrap' conversion functions. */
-#include "llvm/Module.h"
-#include "llvm/Support/IRBuilder.h"
-
-extern "C" {
-#endif
-
-
-/* Opaque types. */
-
-/**
- * The top-level container for all other LLVM Intermediate Representation (IR)
- * objects. See the llvm::Module class.
- */
-typedef struct LLVMOpaqueModule *LLVMModuleRef;
-
-/**
- * Each value in the LLVM IR has a type, an LLVMTypeRef. See the llvm::Type
- * class.
- */
-typedef struct LLVMOpaqueType *LLVMTypeRef;
-
-/**
- * When building recursive types using LLVMRefineType, LLVMTypeRef values may
- * become invalid; use LLVMTypeHandleRef to resolve this problem. See the
- * llvm::AbstractTypeHolder class.
- */
-typedef struct LLVMOpaqueTypeHandle *LLVMTypeHandleRef;
-
-typedef struct LLVMOpaqueValue *LLVMValueRef;
-typedef struct LLVMOpaqueBasicBlock *LLVMBasicBlockRef;
-typedef struct LLVMOpaqueBuilder *LLVMBuilderRef;
-
-/* Used to provide a module to JIT or interpreter.
- * See the llvm::ModuleProvider class.
- */
-typedef struct LLVMOpaqueModuleProvider *LLVMModuleProviderRef;
-
-/* Used to provide a module to JIT or interpreter.
- * See the llvm::MemoryBuffer class.
- */
-typedef struct LLVMOpaqueMemoryBuffer *LLVMMemoryBufferRef;
-
-/** See the llvm::PassManagerBase class. */
-typedef struct LLVMOpaquePassManager *LLVMPassManagerRef;
-
-typedef enum {
- LLVMZExtParamAttr = 1<<0,
- LLVMSExtParamAttr = 1<<1,
- LLVMNoReturnParamAttr = 1<<2,
- LLVMInRegParamAttr = 1<<3,
- LLVMStructRetParamAttr = 1<<4,
- LLVMNoUnwindParamAttr = 1<<5,
- LLVMNoAliasParamAttr = 1<<6,
- LLVMByValParamAttr = 1<<7,
- LLVMNestParamAttr = 1<<8,
- LLVMReadNoneParamAttr = 1<<9,
- LLVMReadOnlyParamAttr = 1<<10
-} LLVMParamAttr;
-
-typedef enum {
- LLVMVoidTypeKind, /**< type with no size */
- LLVMFloatTypeKind, /**< 32 bit floating point type */
- LLVMDoubleTypeKind, /**< 64 bit floating point type */
- LLVMX86_FP80TypeKind, /**< 80 bit floating point type (X87) */
- LLVMFP128TypeKind, /**< 128 bit floating point type (112-bit mantissa)*/
- LLVMPPC_FP128TypeKind, /**< 128 bit floating point type (two 64-bits) */
- LLVMLabelTypeKind, /**< Labels */
- LLVMIntegerTypeKind, /**< Arbitrary bit width integers */
- LLVMFunctionTypeKind, /**< Functions */
- LLVMStructTypeKind, /**< Structures */
- LLVMArrayTypeKind, /**< Arrays */
- LLVMPointerTypeKind, /**< Pointers */
- LLVMOpaqueTypeKind, /**< Opaque: type with unknown structure */
- LLVMVectorTypeKind /**< SIMD 'packed' format, or other vector type */
-} LLVMTypeKind;
-
-typedef enum {
- LLVMExternalLinkage, /**< Externally visible function */
- LLVMLinkOnceLinkage, /**< Keep one copy of function when linking (inline)*/
- LLVMWeakLinkage, /**< Keep one copy of function when linking (weak) */
- LLVMAppendingLinkage, /**< Special purpose, only applies to global arrays */
- LLVMInternalLinkage, /**< Rename collisions when linking (static
- functions) */
- LLVMDLLImportLinkage, /**< Function to be imported from DLL */
- LLVMDLLExportLinkage, /**< Function to be accessible from DLL */
- LLVMExternalWeakLinkage,/**< ExternalWeak linkage description */
- LLVMGhostLinkage /**< Stand-in functions for streaming fns from
- bitcode */
-} LLVMLinkage;
-
-typedef enum {
- LLVMDefaultVisibility, /**< The GV is visible */
- LLVMHiddenVisibility, /**< The GV is hidden */
- LLVMProtectedVisibility /**< The GV is protected */
-} LLVMVisibility;
-
-typedef enum {
- LLVMCCallConv = 0,
- LLVMFastCallConv = 8,
- LLVMColdCallConv = 9,
- LLVMX86StdcallCallConv = 64,
- LLVMX86FastcallCallConv = 65
-} LLVMCallConv;
-
-typedef enum {
- LLVMIntEQ = 32, /**< equal */
- LLVMIntNE, /**< not equal */
- LLVMIntUGT, /**< unsigned greater than */
- LLVMIntUGE, /**< unsigned greater or equal */
- LLVMIntULT, /**< unsigned less than */
- LLVMIntULE, /**< unsigned less or equal */
- LLVMIntSGT, /**< signed greater than */
- LLVMIntSGE, /**< signed greater or equal */
- LLVMIntSLT, /**< signed less than */
- LLVMIntSLE /**< signed less or equal */
-} LLVMIntPredicate;
-
-typedef enum {
- LLVMRealPredicateFalse, /**< Always false (always folded) */
- LLVMRealOEQ, /**< True if ordered and equal */
- LLVMRealOGT, /**< True if ordered and greater than */
- LLVMRealOGE, /**< True if ordered and greater than or equal */
- LLVMRealOLT, /**< True if ordered and less than */
- LLVMRealOLE, /**< True if ordered and less than or equal */
- LLVMRealONE, /**< True if ordered and operands are unequal */
- LLVMRealORD, /**< True if ordered (no nans) */
- LLVMRealUNO, /**< True if unordered: isnan(X) | isnan(Y) */
- LLVMRealUEQ, /**< True if unordered or equal */
- LLVMRealUGT, /**< True if unordered or greater than */
- LLVMRealUGE, /**< True if unordered, greater than, or equal */
- LLVMRealULT, /**< True if unordered or less than */
- LLVMRealULE, /**< True if unordered, less than, or equal */
- LLVMRealUNE, /**< True if unordered or not equal */
- LLVMRealPredicateTrue /**< Always true (always folded) */
-} LLVMRealPredicate;
-
-
-/*===-- Error handling ----------------------------------------------------===*/
-
-void LLVMDisposeMessage(char *Message);
-
-
-/*===-- Modules -----------------------------------------------------------===*/
-
-/* Create and destroy modules. */
-/** See llvm::Module::Module. */
-LLVMModuleRef LLVMModuleCreateWithName(const char *ModuleID);
-
-/** See llvm::Module::~Module. */
-void LLVMDisposeModule(LLVMModuleRef M);
-
-/** Data layout. See Module::getDataLayout. */
-const char *LLVMGetDataLayout(LLVMModuleRef M);
-void LLVMSetDataLayout(LLVMModuleRef M, const char *Triple);
-
-/** Target triple. See Module::getTargetTriple. */
-const char *LLVMGetTarget(LLVMModuleRef M);
-void LLVMSetTarget(LLVMModuleRef M, const char *Triple);
-
-/** See Module::addTypeName. */
-int LLVMAddTypeName(LLVMModuleRef M, const char *Name, LLVMTypeRef Ty);
-void LLVMDeleteTypeName(LLVMModuleRef M, const char *Name);
-
-/** See Module::dump. */
-void LLVMDumpModule(LLVMModuleRef M);
-
-
-/*===-- Types -------------------------------------------------------------===*/
-
-/* LLVM types conform to the following hierarchy:
- *
- * types:
- * integer type
- * real type
- * function type
- * sequence types:
- * array type
- * pointer type
- * vector type
- * void type
- * label type
- * opaque type
- */
-
-/** See llvm::LLVMTypeKind::getTypeID. */
-LLVMTypeKind LLVMGetTypeKind(LLVMTypeRef Ty);
-
-/** See llvm::DerivedType::refineAbstractTypeTo. */
-void LLVMRefineAbstractType(LLVMTypeRef AbstractType, LLVMTypeRef ConcreteType);
-
-/* Operations on integer types */
-LLVMTypeRef LLVMInt1Type(void);
-LLVMTypeRef LLVMInt8Type(void);
-LLVMTypeRef LLVMInt16Type(void);
-LLVMTypeRef LLVMInt32Type(void);
-LLVMTypeRef LLVMInt64Type(void);
-LLVMTypeRef LLVMIntType(unsigned NumBits);
-unsigned LLVMGetIntTypeWidth(LLVMTypeRef IntegerTy);
-
-/* Operations on real types */
-LLVMTypeRef LLVMFloatType(void);
-LLVMTypeRef LLVMDoubleType(void);
-LLVMTypeRef LLVMX86FP80Type(void);
-LLVMTypeRef LLVMFP128Type(void);
-LLVMTypeRef LLVMPPCFP128Type(void);
-
-/* Operations on function types */
-LLVMTypeRef LLVMFunctionType(LLVMTypeRef ReturnType,
- LLVMTypeRef *ParamTypes, unsigned ParamCount,
- int IsVarArg);
-int LLVMIsFunctionVarArg(LLVMTypeRef FunctionTy);
-LLVMTypeRef LLVMGetReturnType(LLVMTypeRef FunctionTy);
-unsigned LLVMCountParamTypes(LLVMTypeRef FunctionTy);
-void LLVMGetParamTypes(LLVMTypeRef FunctionTy, LLVMTypeRef *Dest);
-
-/* Operations on struct types */
-LLVMTypeRef LLVMStructType(LLVMTypeRef *ElementTypes, unsigned ElementCount,
- int Packed);
-unsigned LLVMCountStructElementTypes(LLVMTypeRef StructTy);
-void LLVMGetStructElementTypes(LLVMTypeRef StructTy, LLVMTypeRef *Dest);
-int LLVMIsPackedStruct(LLVMTypeRef StructTy);
-
-/* Operations on array, pointer, and vector types (sequence types) */
-LLVMTypeRef LLVMArrayType(LLVMTypeRef ElementType, unsigned ElementCount);
-LLVMTypeRef LLVMPointerType(LLVMTypeRef ElementType, unsigned AddressSpace);
-LLVMTypeRef LLVMVectorType(LLVMTypeRef ElementType, unsigned ElementCount);
-
-LLVMTypeRef LLVMGetElementType(LLVMTypeRef Ty);
-unsigned LLVMGetArrayLength(LLVMTypeRef ArrayTy);
-unsigned LLVMGetPointerAddressSpace(LLVMTypeRef PointerTy);
-unsigned LLVMGetVectorSize(LLVMTypeRef VectorTy);
-
-/* Operations on other types */
-LLVMTypeRef LLVMVoidType(void);
-LLVMTypeRef LLVMLabelType(void);
-LLVMTypeRef LLVMOpaqueType(void);
-
-/* Operations on type handles */
-LLVMTypeHandleRef LLVMCreateTypeHandle(LLVMTypeRef PotentiallyAbstractTy);
-void LLVMRefineType(LLVMTypeRef AbstractTy, LLVMTypeRef ConcreteTy);
-LLVMTypeRef LLVMResolveTypeHandle(LLVMTypeHandleRef TypeHandle);
-void LLVMDisposeTypeHandle(LLVMTypeHandleRef TypeHandle);
-
-
-/*===-- Values ------------------------------------------------------------===*/
-
-/* The bulk of LLVM's object model consists of values, which comprise a very
- * rich type hierarchy.
- *
- * values:
- * constants:
- * scalar constants
- * composite contants
- * globals:
- * global variable
- * function
- * alias
- * basic blocks
- */
-
-/* Operations on all values */
-LLVMTypeRef LLVMTypeOf(LLVMValueRef Val);
-const char *LLVMGetValueName(LLVMValueRef Val);
-void LLVMSetValueName(LLVMValueRef Val, const char *Name);
-void LLVMDumpValue(LLVMValueRef Val);
-
-/* Operations on constants of any type */
-LLVMValueRef LLVMConstNull(LLVMTypeRef Ty); /* all zeroes */
-LLVMValueRef LLVMConstAllOnes(LLVMTypeRef Ty); /* only for int/vector */
-LLVMValueRef LLVMGetUndef(LLVMTypeRef Ty);
-int LLVMIsConstant(LLVMValueRef Val);
-int LLVMIsNull(LLVMValueRef Val);
-int LLVMIsUndef(LLVMValueRef Val);
-
-/* Operations on scalar constants */
-LLVMValueRef LLVMConstInt(LLVMTypeRef IntTy, unsigned long long N,
- int SignExtend);
-LLVMValueRef LLVMConstReal(LLVMTypeRef RealTy, double N);
-LLVMValueRef LLVMConstRealOfString(LLVMTypeRef RealTy, const char *Text);
-
-/* Operations on composite constants */
-LLVMValueRef LLVMConstString(const char *Str, unsigned Length,
- int DontNullTerminate);
-LLVMValueRef LLVMConstArray(LLVMTypeRef ElementTy,
- LLVMValueRef *ConstantVals, unsigned Length);
-LLVMValueRef LLVMConstStruct(LLVMValueRef *ConstantVals, unsigned Count,
- int packed);
-LLVMValueRef LLVMConstVector(LLVMValueRef *ScalarConstantVals, unsigned Size);
-
-/* Constant expressions */
-LLVMValueRef LLVMSizeOf(LLVMTypeRef Ty);
-LLVMValueRef LLVMConstNeg(LLVMValueRef ConstantVal);
-LLVMValueRef LLVMConstNot(LLVMValueRef ConstantVal);
-LLVMValueRef LLVMConstAdd(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
-LLVMValueRef LLVMConstSub(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
-LLVMValueRef LLVMConstMul(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
-LLVMValueRef LLVMConstUDiv(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
-LLVMValueRef LLVMConstSDiv(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
-LLVMValueRef LLVMConstFDiv(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
-LLVMValueRef LLVMConstURem(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
-LLVMValueRef LLVMConstSRem(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
-LLVMValueRef LLVMConstFRem(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
-LLVMValueRef LLVMConstAnd(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
-LLVMValueRef LLVMConstOr(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
-LLVMValueRef LLVMConstXor(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
-LLVMValueRef LLVMConstICmp(LLVMIntPredicate Predicate,
- LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
-LLVMValueRef LLVMConstFCmp(LLVMRealPredicate Predicate,
- LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
-LLVMValueRef LLVMConstShl(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
-LLVMValueRef LLVMConstLShr(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
-LLVMValueRef LLVMConstAShr(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
-LLVMValueRef LLVMConstGEP(LLVMValueRef ConstantVal,
- LLVMValueRef *ConstantIndices, unsigned NumIndices);
-LLVMValueRef LLVMConstTrunc(LLVMValueRef ConstantVal, LLVMTypeRef ToType);
-LLVMValueRef LLVMConstSExt(LLVMValueRef ConstantVal, LLVMTypeRef ToType);
-LLVMValueRef LLVMConstZExt(LLVMValueRef ConstantVal, LLVMTypeRef ToType);
-LLVMValueRef LLVMConstFPTrunc(LLVMValueRef ConstantVal, LLVMTypeRef ToType);
-LLVMValueRef LLVMConstFPExt(LLVMValueRef ConstantVal, LLVMTypeRef ToType);
-LLVMValueRef LLVMConstUIToFP(LLVMValueRef ConstantVal, LLVMTypeRef ToType);
-LLVMValueRef LLVMConstSIToFP(LLVMValueRef ConstantVal, LLVMTypeRef ToType);
-LLVMValueRef LLVMConstFPToUI(LLVMValueRef ConstantVal, LLVMTypeRef ToType);
-LLVMValueRef LLVMConstFPToSI(LLVMValueRef ConstantVal, LLVMTypeRef ToType);
-LLVMValueRef LLVMConstPtrToInt(LLVMValueRef ConstantVal, LLVMTypeRef ToType);
-LLVMValueRef LLVMConstIntToPtr(LLVMValueRef ConstantVal, LLVMTypeRef ToType);
-LLVMValueRef LLVMConstBitCast(LLVMValueRef ConstantVal, LLVMTypeRef ToType);
-LLVMValueRef LLVMConstSelect(LLVMValueRef ConstantCondition,
- LLVMValueRef ConstantIfTrue,
- LLVMValueRef ConstantIfFalse);
-LLVMValueRef LLVMConstExtractElement(LLVMValueRef VectorConstant,
- LLVMValueRef IndexConstant);
-LLVMValueRef LLVMConstInsertElement(LLVMValueRef VectorConstant,
- LLVMValueRef ElementValueConstant,
- LLVMValueRef IndexConstant);
-LLVMValueRef LLVMConstShuffleVector(LLVMValueRef VectorAConstant,
- LLVMValueRef VectorBConstant,
- LLVMValueRef MaskConstant);
-
-/* Operations on global variables, functions, and aliases (globals) */
-LLVMModuleRef LLVMGetGlobalParent(LLVMValueRef Global);
-int LLVMIsDeclaration(LLVMValueRef Global);
-LLVMLinkage LLVMGetLinkage(LLVMValueRef Global);
-void LLVMSetLinkage(LLVMValueRef Global, LLVMLinkage Linkage);
-const char *LLVMGetSection(LLVMValueRef Global);
-void LLVMSetSection(LLVMValueRef Global, const char *Section);
-LLVMVisibility LLVMGetVisibility(LLVMValueRef Global);
-void LLVMSetVisibility(LLVMValueRef Global, LLVMVisibility Viz);
-unsigned LLVMGetAlignment(LLVMValueRef Global);
-void LLVMSetAlignment(LLVMValueRef Global, unsigned Bytes);
-
-/* Operations on global variables */
-LLVMValueRef LLVMAddGlobal(LLVMModuleRef M, LLVMTypeRef Ty, const char *Name);
-LLVMValueRef LLVMGetNamedGlobal(LLVMModuleRef M, const char *Name);
-LLVMValueRef LLVMGetFirstGlobal(LLVMModuleRef M);
-LLVMValueRef LLVMGetLastGlobal(LLVMModuleRef M);
-LLVMValueRef LLVMGetNextGlobal(LLVMValueRef GlobalVar);
-LLVMValueRef LLVMGetPreviousGlobal(LLVMValueRef GlobalVar);
-void LLVMDeleteGlobal(LLVMValueRef GlobalVar);
-int LLVMHasInitializer(LLVMValueRef GlobalVar);
-LLVMValueRef LLVMGetInitializer(LLVMValueRef GlobalVar);
-void LLVMSetInitializer(LLVMValueRef GlobalVar, LLVMValueRef ConstantVal);
-int LLVMIsThreadLocal(LLVMValueRef GlobalVar);
-void LLVMSetThreadLocal(LLVMValueRef GlobalVar, int IsThreadLocal);
-int LLVMIsGlobalConstant(LLVMValueRef GlobalVar);
-void LLVMSetGlobalConstant(LLVMValueRef GlobalVar, int IsConstant);
-
-/* Operations on functions */
-LLVMValueRef LLVMAddFunction(LLVMModuleRef M, const char *Name,
- LLVMTypeRef FunctionTy);
-LLVMValueRef LLVMGetNamedFunction(LLVMModuleRef M, const char *Name);
-LLVMValueRef LLVMGetFirstFunction(LLVMModuleRef M);
-LLVMValueRef LLVMGetLastFunction(LLVMModuleRef M);
-LLVMValueRef LLVMGetNextFunction(LLVMValueRef Fn);
-LLVMValueRef LLVMGetPreviousFunction(LLVMValueRef Fn);
-void LLVMDeleteFunction(LLVMValueRef Fn);
-unsigned LLVMGetIntrinsicID(LLVMValueRef Fn);
-unsigned LLVMGetFunctionCallConv(LLVMValueRef Fn);
-void LLVMSetFunctionCallConv(LLVMValueRef Fn, unsigned CC);
-const char *LLVMGetCollector(LLVMValueRef Fn);
-void LLVMSetCollector(LLVMValueRef Fn, const char *Coll);
-
-/* Operations on parameters */
-unsigned LLVMCountParams(LLVMValueRef Fn);
-void LLVMGetParams(LLVMValueRef Fn, LLVMValueRef *Params);
-LLVMValueRef LLVMGetParam(LLVMValueRef Fn, unsigned Index);
-LLVMValueRef LLVMGetParamParent(LLVMValueRef Inst);
-LLVMValueRef LLVMGetFirstParam(LLVMValueRef Fn);
-LLVMValueRef LLVMGetLastParam(LLVMValueRef Fn);
-LLVMValueRef LLVMGetNextParam(LLVMValueRef Arg);
-LLVMValueRef LLVMGetPreviousParam(LLVMValueRef Arg);
-void LLVMAddParamAttr(LLVMValueRef Arg, LLVMParamAttr PA);
-void LLVMRemoveParamAttr(LLVMValueRef Arg, LLVMParamAttr PA);
-void LLVMSetParamAlignment(LLVMValueRef Arg, unsigned align);
-
-/* Operations on basic blocks */
-LLVMValueRef LLVMBasicBlockAsValue(LLVMBasicBlockRef BB);
-int LLVMValueIsBasicBlock(LLVMValueRef Val);
-LLVMBasicBlockRef LLVMValueAsBasicBlock(LLVMValueRef Val);
-LLVMValueRef LLVMGetBasicBlockParent(LLVMBasicBlockRef BB);
-unsigned LLVMCountBasicBlocks(LLVMValueRef Fn);
-void LLVMGetBasicBlocks(LLVMValueRef Fn, LLVMBasicBlockRef *BasicBlocks);
-LLVMBasicBlockRef LLVMGetFirstBasicBlock(LLVMValueRef Fn);
-LLVMBasicBlockRef LLVMGetLastBasicBlock(LLVMValueRef Fn);
-LLVMBasicBlockRef LLVMGetNextBasicBlock(LLVMBasicBlockRef BB);
-LLVMBasicBlockRef LLVMGetPreviousBasicBlock(LLVMBasicBlockRef BB);
-LLVMBasicBlockRef LLVMGetEntryBasicBlock(LLVMValueRef Fn);
-LLVMBasicBlockRef LLVMAppendBasicBlock(LLVMValueRef Fn, const char *Name);
-LLVMBasicBlockRef LLVMInsertBasicBlock(LLVMBasicBlockRef InsertBeforeBB,
- const char *Name);
-void LLVMDeleteBasicBlock(LLVMBasicBlockRef BB);
-
-/* Operations on instructions */
-LLVMBasicBlockRef LLVMGetInstructionParent(LLVMValueRef Inst);
-LLVMValueRef LLVMGetFirstInstruction(LLVMBasicBlockRef BB);
-LLVMValueRef LLVMGetLastInstruction(LLVMBasicBlockRef BB);
-LLVMValueRef LLVMGetNextInstruction(LLVMValueRef Inst);
-LLVMValueRef LLVMGetPreviousInstruction(LLVMValueRef Inst);
-
-/* Operations on call sites */
-void LLVMSetInstructionCallConv(LLVMValueRef Instr, unsigned CC);
-unsigned LLVMGetInstructionCallConv(LLVMValueRef Instr);
-void LLVMAddInstrParamAttr(LLVMValueRef Instr, unsigned index, LLVMParamAttr);
-void LLVMRemoveInstrParamAttr(LLVMValueRef Instr, unsigned index,
- LLVMParamAttr);
-void LLVMSetInstrParamAlignment(LLVMValueRef Instr, unsigned index,
- unsigned align);
-
-/* Operations on phi nodes */
-void LLVMAddIncoming(LLVMValueRef PhiNode, LLVMValueRef *IncomingValues,
- LLVMBasicBlockRef *IncomingBlocks, unsigned Count);
-unsigned LLVMCountIncoming(LLVMValueRef PhiNode);
-LLVMValueRef LLVMGetIncomingValue(LLVMValueRef PhiNode, unsigned Index);
-LLVMBasicBlockRef LLVMGetIncomingBlock(LLVMValueRef PhiNode, unsigned Index);
-
-/*===-- Instruction builders ----------------------------------------------===*/
-
-/* An instruction builder represents a point within a basic block, and is the
- * exclusive means of building instructions using the C interface.
- */
-
-LLVMBuilderRef LLVMCreateBuilder(void);
-void LLVMPositionBuilder(LLVMBuilderRef Builder, LLVMBasicBlockRef Block,
- LLVMValueRef Instr);
-void LLVMPositionBuilderBefore(LLVMBuilderRef Builder, LLVMValueRef Instr);
-void LLVMPositionBuilderAtEnd(LLVMBuilderRef Builder, LLVMBasicBlockRef Block);
-LLVMBasicBlockRef LLVMGetInsertBlock(LLVMBuilderRef Builder);
-void LLVMDisposeBuilder(LLVMBuilderRef Builder);
-
-/* Terminators */
-LLVMValueRef LLVMBuildRetVoid(LLVMBuilderRef);
-LLVMValueRef LLVMBuildRet(LLVMBuilderRef, LLVMValueRef V);
-LLVMValueRef LLVMBuildBr(LLVMBuilderRef, LLVMBasicBlockRef Dest);
-LLVMValueRef LLVMBuildCondBr(LLVMBuilderRef, LLVMValueRef If,
- LLVMBasicBlockRef Then, LLVMBasicBlockRef Else);
-LLVMValueRef LLVMBuildSwitch(LLVMBuilderRef, LLVMValueRef V,
- LLVMBasicBlockRef Else, unsigned NumCases);
-LLVMValueRef LLVMBuildInvoke(LLVMBuilderRef, LLVMValueRef Fn,
- LLVMValueRef *Args, unsigned NumArgs,
- LLVMBasicBlockRef Then, LLVMBasicBlockRef Catch,
- const char *Name);
-LLVMValueRef LLVMBuildUnwind(LLVMBuilderRef);
-LLVMValueRef LLVMBuildUnreachable(LLVMBuilderRef);
-
-/* Add a case to the switch instruction */
-void LLVMAddCase(LLVMValueRef Switch, LLVMValueRef OnVal,
- LLVMBasicBlockRef Dest);
-
-/* Arithmetic */
-LLVMValueRef LLVMBuildAdd(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS,
- const char *Name);
-LLVMValueRef LLVMBuildSub(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS,
- const char *Name);
-LLVMValueRef LLVMBuildMul(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS,
- const char *Name);
-LLVMValueRef LLVMBuildUDiv(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS,
- const char *Name);
-LLVMValueRef LLVMBuildSDiv(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS,
- const char *Name);
-LLVMValueRef LLVMBuildFDiv(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS,
- const char *Name);
-LLVMValueRef LLVMBuildURem(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS,
- const char *Name);
-LLVMValueRef LLVMBuildSRem(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS,
- const char *Name);
-LLVMValueRef LLVMBuildFRem(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS,
- const char *Name);
-LLVMValueRef LLVMBuildShl(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS,
- const char *Name);
-LLVMValueRef LLVMBuildLShr(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS,
- const char *Name);
-LLVMValueRef LLVMBuildAShr(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS,
- const char *Name);
-LLVMValueRef LLVMBuildAnd(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS,
- const char *Name);
-LLVMValueRef LLVMBuildOr(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS,
- const char *Name);
-LLVMValueRef LLVMBuildXor(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS,
- const char *Name);
-LLVMValueRef LLVMBuildNeg(LLVMBuilderRef, LLVMValueRef V, const char *Name);
-LLVMValueRef LLVMBuildNot(LLVMBuilderRef, LLVMValueRef V, const char *Name);
-
-/* Memory */
-LLVMValueRef LLVMBuildMalloc(LLVMBuilderRef, LLVMTypeRef Ty, const char *Name);
-LLVMValueRef LLVMBuildArrayMalloc(LLVMBuilderRef, LLVMTypeRef Ty,
- LLVMValueRef Val, const char *Name);
-LLVMValueRef LLVMBuildAlloca(LLVMBuilderRef, LLVMTypeRef Ty, const char *Name);
-LLVMValueRef LLVMBuildArrayAlloca(LLVMBuilderRef, LLVMTypeRef Ty,
- LLVMValueRef Val, const char *Name);
-LLVMValueRef LLVMBuildFree(LLVMBuilderRef, LLVMValueRef PointerVal);
-LLVMValueRef LLVMBuildLoad(LLVMBuilderRef, LLVMValueRef PointerVal,
- const char *Name);
-LLVMValueRef LLVMBuildStore(LLVMBuilderRef, LLVMValueRef Val, LLVMValueRef Ptr);
-LLVMValueRef LLVMBuildGEP(LLVMBuilderRef B, LLVMValueRef Pointer,
- LLVMValueRef *Indices, unsigned NumIndices,
- const char *Name);
-
-/* Casts */
-LLVMValueRef LLVMBuildTrunc(LLVMBuilderRef, LLVMValueRef Val,
- LLVMTypeRef DestTy, const char *Name);
-LLVMValueRef LLVMBuildZExt(LLVMBuilderRef, LLVMValueRef Val,
- LLVMTypeRef DestTy, const char *Name);
-LLVMValueRef LLVMBuildSExt(LLVMBuilderRef, LLVMValueRef Val,
- LLVMTypeRef DestTy, const char *Name);
-LLVMValueRef LLVMBuildFPToUI(LLVMBuilderRef, LLVMValueRef Val,
- LLVMTypeRef DestTy, const char *Name);
-LLVMValueRef LLVMBuildFPToSI(LLVMBuilderRef, LLVMValueRef Val,
- LLVMTypeRef DestTy, const char *Name);
-LLVMValueRef LLVMBuildUIToFP(LLVMBuilderRef, LLVMValueRef Val,
- LLVMTypeRef DestTy, const char *Name);
-LLVMValueRef LLVMBuildSIToFP(LLVMBuilderRef, LLVMValueRef Val,
- LLVMTypeRef DestTy, const char *Name);
-LLVMValueRef LLVMBuildFPTrunc(LLVMBuilderRef, LLVMValueRef Val,
- LLVMTypeRef DestTy, const char *Name);
-LLVMValueRef LLVMBuildFPExt(LLVMBuilderRef, LLVMValueRef Val,
- LLVMTypeRef DestTy, const char *Name);
-LLVMValueRef LLVMBuildPtrToInt(LLVMBuilderRef, LLVMValueRef Val,
- LLVMTypeRef DestTy, const char *Name);
-LLVMValueRef LLVMBuildIntToPtr(LLVMBuilderRef, LLVMValueRef Val,
- LLVMTypeRef DestTy, const char *Name);
-LLVMValueRef LLVMBuildBitCast(LLVMBuilderRef, LLVMValueRef Val,
- LLVMTypeRef DestTy, const char *Name);
-
-/* Comparisons */
-LLVMValueRef LLVMBuildICmp(LLVMBuilderRef, LLVMIntPredicate Op,
- LLVMValueRef LHS, LLVMValueRef RHS,
- const char *Name);
-LLVMValueRef LLVMBuildFCmp(LLVMBuilderRef, LLVMRealPredicate Op,
- LLVMValueRef LHS, LLVMValueRef RHS,
- const char *Name);
-
-/* Miscellaneous instructions */
-LLVMValueRef LLVMBuildPhi(LLVMBuilderRef, LLVMTypeRef Ty, const char *Name);
-LLVMValueRef LLVMBuildCall(LLVMBuilderRef, LLVMValueRef Fn,
- LLVMValueRef *Args, unsigned NumArgs,
- const char *Name);
-LLVMValueRef LLVMBuildSelect(LLVMBuilderRef, LLVMValueRef If,
- LLVMValueRef Then, LLVMValueRef Else,
- const char *Name);
-LLVMValueRef LLVMBuildVAArg(LLVMBuilderRef, LLVMValueRef List, LLVMTypeRef Ty,
- const char *Name);
-LLVMValueRef LLVMBuildExtractElement(LLVMBuilderRef, LLVMValueRef VecVal,
- LLVMValueRef Index, const char *Name);
-LLVMValueRef LLVMBuildInsertElement(LLVMBuilderRef, LLVMValueRef VecVal,
- LLVMValueRef EltVal, LLVMValueRef Index,
- const char *Name);
-LLVMValueRef LLVMBuildShuffleVector(LLVMBuilderRef, LLVMValueRef V1,
- LLVMValueRef V2, LLVMValueRef Mask,
- const char *Name);
-
-
-/*===-- Module providers --------------------------------------------------===*/
-
-/* Encapsulates the module M in a module provider, taking ownership of the
- * module.
- * See the constructor llvm::ExistingModuleProvider::ExistingModuleProvider.
- */
-LLVMModuleProviderRef
-LLVMCreateModuleProviderForExistingModule(LLVMModuleRef M);
-
-/* Destroys the module provider MP as well as the contained module.
- * See the destructor llvm::ModuleProvider::~ModuleProvider.
- */
-void LLVMDisposeModuleProvider(LLVMModuleProviderRef MP);
-
-
-/*===-- Memory buffers ----------------------------------------------------===*/
-
-int LLVMCreateMemoryBufferWithContentsOfFile(const char *Path,
- LLVMMemoryBufferRef *OutMemBuf,
- char **OutMessage);
-int LLVMCreateMemoryBufferWithSTDIN(LLVMMemoryBufferRef *OutMemBuf,
- char **OutMessage);
-void LLVMDisposeMemoryBuffer(LLVMMemoryBufferRef MemBuf);
-
-
-/*===-- Pass Managers -----------------------------------------------------===*/
-
-/** Constructs a new whole-module pass pipeline. This type of pipeline is
- suitable for link-time optimization and whole-module transformations.
- See llvm::PassManager::PassManager. */
-LLVMPassManagerRef LLVMCreatePassManager(void);
-
-/** Constructs a new function-by-function pass pipeline over the module
- provider. It does not take ownership of the module provider. This type of
- pipeline is suitable for code generation and JIT compilation tasks.
- See llvm::FunctionPassManager::FunctionPassManager. */
-LLVMPassManagerRef LLVMCreateFunctionPassManager(LLVMModuleProviderRef MP);
-
-/** Initializes, executes on the provided module, and finalizes all of the
- passes scheduled in the pass manager. Returns 1 if any of the passes
- modified the module, 0 otherwise. See llvm::PassManager::run(Module&). */
-int LLVMRunPassManager(LLVMPassManagerRef PM, LLVMModuleRef M);
-
-/** Initializes all of the function passes scheduled in the function pass
- manager. Returns 1 if any of the passes modified the module, 0 otherwise.
- See llvm::FunctionPassManager::doInitialization. */
-int LLVMInitializeFunctionPassManager(LLVMPassManagerRef FPM);
-
-/** Executes all of the function passes scheduled in the function pass manager
- on the provided function. Returns 1 if any of the passes modified the
- function, false otherwise.
- See llvm::FunctionPassManager::run(Function&). */
-int LLVMRunFunctionPassManager(LLVMPassManagerRef FPM, LLVMValueRef F);
-
-/** Finalizes all of the function passes scheduled in in the function pass
- manager. Returns 1 if any of the passes modified the module, 0 otherwise.
- See llvm::FunctionPassManager::doFinalization. */
-int LLVMFinalizeFunctionPassManager(LLVMPassManagerRef FPM);
-
-/** Frees the memory of a pass pipeline. For function pipelines, does not free
- the module provider.
- See llvm::PassManagerBase::~PassManagerBase. */
-void LLVMDisposePassManager(LLVMPassManagerRef PM);
-
-
-#ifdef __cplusplus
-}
-
-namespace llvm {
- class ModuleProvider;
- class MemoryBuffer;
- class PassManagerBase;
-
- #define DEFINE_SIMPLE_CONVERSION_FUNCTIONS(ty, ref) \
- inline ty *unwrap(ref P) { \
- return reinterpret_cast<ty*>(P); \
- } \
- \
- inline ref wrap(const ty *P) { \
- return reinterpret_cast<ref>(const_cast<ty*>(P)); \
- }
-
- #define DEFINE_ISA_CONVERSION_FUNCTIONS(ty, ref) \
- DEFINE_SIMPLE_CONVERSION_FUNCTIONS(ty, ref) \
- \
- template<typename T> \
- inline T *unwrap(ref P) { \
- return cast<T>(unwrap(P)); \
- }
-
- #define DEFINE_STDCXX_CONVERSION_FUNCTIONS(ty, ref) \
- DEFINE_SIMPLE_CONVERSION_FUNCTIONS(ty, ref) \
- \
- template<typename T> \
- inline T *unwrap(ref P) { \
- T *Q = dynamic_cast<T*>(unwrap(P)); \
- assert(Q && "Invalid cast!"); \
- return Q; \
- }
-
- DEFINE_ISA_CONVERSION_FUNCTIONS (Type, LLVMTypeRef )
- DEFINE_ISA_CONVERSION_FUNCTIONS (Value, LLVMValueRef )
- DEFINE_SIMPLE_CONVERSION_FUNCTIONS(Module, LLVMModuleRef )
- DEFINE_SIMPLE_CONVERSION_FUNCTIONS(BasicBlock, LLVMBasicBlockRef )
- DEFINE_SIMPLE_CONVERSION_FUNCTIONS(IRBuilder, LLVMBuilderRef )
- DEFINE_SIMPLE_CONVERSION_FUNCTIONS(PATypeHolder, LLVMTypeHandleRef )
- DEFINE_SIMPLE_CONVERSION_FUNCTIONS(ModuleProvider, LLVMModuleProviderRef)
- DEFINE_SIMPLE_CONVERSION_FUNCTIONS(MemoryBuffer, LLVMMemoryBufferRef )
- DEFINE_STDCXX_CONVERSION_FUNCTIONS(PassManagerBase, LLVMPassManagerRef )
-
- #undef DEFINE_STDCXX_CONVERSION_FUNCTIONS
- #undef DEFINE_ISA_CONVERSION_FUNCTIONS
- #undef DEFINE_SIMPLE_CONVERSION_FUNCTIONS
-
- /* Specialized opaque type conversions.
- */
- inline Type **unwrap(LLVMTypeRef* Tys) {
- return reinterpret_cast<Type**>(Tys);
- }
-
- inline LLVMTypeRef *wrap(const Type **Tys) {
- return reinterpret_cast<LLVMTypeRef*>(const_cast<Type**>(Tys));
- }
-
- /* Specialized opaque value conversions.
- */
- inline Value **unwrap(LLVMValueRef *Vals) {
- return reinterpret_cast<Value**>(Vals);
- }
-
- template<typename T>
- inline T **unwrap(LLVMValueRef *Vals, unsigned Length) {
- #if DEBUG
- for (LLVMValueRef *I = Vals, E = Vals + Length; I != E; ++I)
- cast<T>(*I);
- #endif
- return reinterpret_cast<T**>(Vals);
- }
-
- inline LLVMValueRef *wrap(const Value **Vals) {
- return reinterpret_cast<LLVMValueRef*>(const_cast<Value**>(Vals));
- }
-}
-
-#endif /* !defined(__cplusplus) */
-
-#endif /* !defined(LLVM_C_CORE_H) */
diff --git a/release_23/include/llvm-c/ExecutionEngine.h b/release_23/include/llvm-c/ExecutionEngine.h
deleted file mode 100644
index b1d130c20fe7..000000000000
--- a/release_23/include/llvm-c/ExecutionEngine.h
+++ /dev/null
@@ -1,118 +0,0 @@
-/*===-- llvm-c/ExecutionEngine.h - ExecutionEngine Lib C Iface --*- C++ -*-===*\
-|* *|
-|* The LLVM Compiler Infrastructure *|
-|* *|
-|* This file is distributed under the University of Illinois Open Source *|
-|* License. See LICENSE.TXT for details. *|
-|* *|
-|*===----------------------------------------------------------------------===*|
-|* *|
-|* This header declares the C interface to libLLVMExecutionEngine.o, which *|
-|* implements various analyses of the LLVM IR. *|
-|* *|
-|* Many exotic languages can interoperate with C code but have a harder time *|
-|* with C++ due to name mangling. So in addition to C, this interface enables *|
-|* tools written in such languages. *|
-|* *|
-\*===----------------------------------------------------------------------===*/
-
-#ifndef LLVM_C_EXECUTIONENGINE_H
-#define LLVM_C_EXECUTIONENGINE_H
-
-#include "llvm-c/Core.h"
-#include "llvm-c/Target.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef struct LLVMOpaqueGenericValue *LLVMGenericValueRef;
-typedef struct LLVMOpaqueExecutionEngine *LLVMExecutionEngineRef;
-
-/*===-- Operations on generic values --------------------------------------===*/
-
-LLVMGenericValueRef LLVMCreateGenericValueOfInt(LLVMTypeRef Ty,
- unsigned long long N,
- int IsSigned);
-
-LLVMGenericValueRef LLVMCreateGenericValueOfPointer(void *P);
-
-LLVMGenericValueRef LLVMCreateGenericValueOfFloat(LLVMTypeRef Ty, double N);
-
-unsigned LLVMGenericValueIntWidth(LLVMGenericValueRef GenValRef);
-
-unsigned long long LLVMGenericValueToInt(LLVMGenericValueRef GenVal,
- int IsSigned);
-
-void *LLVMGenericValueToPointer(LLVMGenericValueRef GenVal);
-
-double LLVMGenericValueToFloat(LLVMTypeRef TyRef, LLVMGenericValueRef GenVal);
-
-void LLVMDisposeGenericValue(LLVMGenericValueRef GenVal);
-
-/*===-- Operations on execution engines -----------------------------------===*/
-
-int LLVMCreateExecutionEngine(LLVMExecutionEngineRef *OutEE,
- LLVMModuleProviderRef MP,
- char **OutError);
-
-int LLVMCreateInterpreter(LLVMExecutionEngineRef *OutInterp,
- LLVMModuleProviderRef MP,
- char **OutError);
-
-int LLVMCreateJITCompiler(LLVMExecutionEngineRef *OutJIT,
- LLVMModuleProviderRef MP,
- char **OutError);
-
-void LLVMDisposeExecutionEngine(LLVMExecutionEngineRef EE);
-
-void LLVMRunStaticConstructors(LLVMExecutionEngineRef EE);
-
-void LLVMRunStaticDestructors(LLVMExecutionEngineRef EE);
-
-int LLVMRunFunctionAsMain(LLVMExecutionEngineRef EE, LLVMValueRef F,
- unsigned ArgC, const char * const *ArgV,
- const char * const *EnvP);
-
-LLVMGenericValueRef LLVMRunFunction(LLVMExecutionEngineRef EE, LLVMValueRef F,
- unsigned NumArgs,
- LLVMGenericValueRef *Args);
-
-void LLVMFreeMachineCodeForFunction(LLVMExecutionEngineRef EE, LLVMValueRef F);
-
-void LLVMAddModuleProvider(LLVMExecutionEngineRef EE, LLVMModuleProviderRef MP);
-
-int LLVMRemoveModuleProvider(LLVMExecutionEngineRef EE,
- LLVMModuleProviderRef MP,
- LLVMModuleRef *OutMod, char **OutError);
-
-int LLVMFindFunction(LLVMExecutionEngineRef EE, const char *Name,
- LLVMValueRef *OutFn);
-
-LLVMTargetDataRef LLVMGetExecutionEngineTargetData(LLVMExecutionEngineRef EE);
-
-#ifdef __cplusplus
-}
-
-namespace llvm {
- class GenericValue;
- class ExecutionEngine;
-
- #define DEFINE_SIMPLE_CONVERSION_FUNCTIONS(ty, ref) \
- inline ty *unwrap(ref P) { \
- return reinterpret_cast<ty*>(P); \
- } \
- \
- inline ref wrap(const ty *P) { \
- return reinterpret_cast<ref>(const_cast<ty*>(P)); \
- }
-
- DEFINE_SIMPLE_CONVERSION_FUNCTIONS(GenericValue, LLVMGenericValueRef )
- DEFINE_SIMPLE_CONVERSION_FUNCTIONS(ExecutionEngine, LLVMExecutionEngineRef)
-
- #undef DEFINE_SIMPLE_CONVERSION_FUNCTIONS
-}
-
-#endif /* defined(__cplusplus) */
-
-#endif
diff --git a/release_23/include/llvm-c/LinkTimeOptimizer.h b/release_23/include/llvm-c/LinkTimeOptimizer.h
deleted file mode 100644
index ccfdceed0264..000000000000
--- a/release_23/include/llvm-c/LinkTimeOptimizer.h
+++ /dev/null
@@ -1,58 +0,0 @@
-//===-- llvm/LinkTimeOptimizer.h - LTO Public C Interface -------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This header provides a C API to use the LLVM link time optimization
-// library. This is inteded to be used by linkers which are C-only in
-// their implementation for performing LTO.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef __LTO_CAPI_H__
-#define __LTO_CAPI_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
- /// This provides a dummy type for pointers to the LTO object.
- typedef void* llvm_lto_t;
-
- /// This provides a C-visible enumerator to manage status codes.
- /// This should map exactly onto the C++ enumerator LTOStatus.
- typedef enum llvm_lto_status {
- LLVM_LTO_UNKNOWN,
- LLVM_LTO_OPT_SUCCESS,
- LLVM_LTO_READ_SUCCESS,
- LLVM_LTO_READ_FAILURE,
- LLVM_LTO_WRITE_FAILURE,
- LLVM_LTO_NO_TARGET,
- LLVM_LTO_NO_WORK,
- LLVM_LTO_MODULE_MERGE_FAILURE,
- LLVM_LTO_ASM_FAILURE,
-
- // Added C-specific error codes
- LLVM_LTO_NULL_OBJECT
- } llvm_lto_status_t;
-
- /// This provides C interface to initialize link time optimizer. This allows
- /// linker to use dlopen() interface to dynamically load LinkTimeOptimizer.
- /// extern "C" helps, because dlopen() interface uses name to find the symbol.
- extern llvm_lto_t llvm_create_optimizer(void);
- extern void llvm_destroy_optimizer(llvm_lto_t lto);
-
- extern llvm_lto_status_t llvm_read_object_file
- (llvm_lto_t lto, const char* input_filename);
- extern llvm_lto_status_t llvm_optimize_modules
- (llvm_lto_t lto, const char* output_filename);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/release_23/include/llvm-c/Target.h b/release_23/include/llvm-c/Target.h
deleted file mode 100644
index d3b4e2f3f7f6..000000000000
--- a/release_23/include/llvm-c/Target.h
+++ /dev/null
@@ -1,131 +0,0 @@
-/*===-- llvm-c/Target.h - Target Lib C Iface --------------------*- C++ -*-===*\
-|* *|
-|* The LLVM Compiler Infrastructure *|
-|* *|
-|* This file is distributed under the University of Illinois Open Source *|
-|* License. See LICENSE.TXT for details. *|
-|* *|
-|*===----------------------------------------------------------------------===*|
-|* *|
-|* This header declares the C interface to libLLVMTarget.a, which *|
-|* implements target information. *|
-|* *|
-|* Many exotic languages can interoperate with C code but have a harder time *|
-|* with C++ due to name mangling. So in addition to C, this interface enables *|
-|* tools written in such languages. *|
-|* *|
-\*===----------------------------------------------------------------------===*/
-
-#ifndef LLVM_C_TARGET_H
-#define LLVM_C_TARGET_H
-
-#include "llvm-c/Core.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-enum { LLVMBigEndian, LLVMLittleEndian };
-typedef int LLVMByteOrdering;
-
-typedef struct LLVMOpaqueTargetData *LLVMTargetDataRef;
-typedef struct LLVMStructLayout *LLVMStructLayoutRef;
-
-
-/*===-- Target Data -------------------------------------------------------===*/
-
-/** Creates target data from a target layout string.
- See the constructor llvm::TargetData::TargetData. */
-LLVMTargetDataRef LLVMCreateTargetData(const char *StringRep);
-
-/** Adds target data information to a pass manager. This does not take ownership
- of the target data.
- See the method llvm::PassManagerBase::add. */
-void LLVMAddTargetData(LLVMTargetDataRef, LLVMPassManagerRef);
-
-/** Converts target data to a target layout string. The string must be disposed
- with LLVMDisposeMessage.
- See the constructor llvm::TargetData::TargetData. */
-char *LLVMCopyStringRepOfTargetData(LLVMTargetDataRef);
-
-/** Returns the byte order of a target, either LLVMBigEndian or
- LLVMLittleEndian.
- See the method llvm::TargetData::isLittleEndian. */
-LLVMByteOrdering LLVMByteOrder(LLVMTargetDataRef);
-
-/** Returns the pointer size in bytes for a target.
- See the method llvm::TargetData::getPointerSize. */
-unsigned LLVMPointerSize(LLVMTargetDataRef);
-
-/** Returns the integer type that is the same size as a pointer on a target.
- See the method llvm::TargetData::getIntPtrType. */
-LLVMTypeRef LLVMIntPtrType(LLVMTargetDataRef);
-
-/** Computes the size of a type in bytes for a target.
- See the method llvm::TargetData::getTypeSizeInBits. */
-unsigned long long LLVMSizeOfTypeInBits(LLVMTargetDataRef, LLVMTypeRef);
-
-/** Computes the storage size of a type in bytes for a target.
- See the method llvm::TargetData::getTypeStoreSize. */
-unsigned long long LLVMStoreSizeOfType(LLVMTargetDataRef, LLVMTypeRef);
-
-/** Computes the ABI size of a type in bytes for a target.
- See the method llvm::TargetData::getABITypeSize. */
-unsigned long long LLVMABISizeOfType(LLVMTargetDataRef, LLVMTypeRef);
-
-/** Computes the ABI alignment of a type in bytes for a target.
- See the method llvm::TargetData::getTypeABISize. */
-unsigned LLVMABIAlignmentOfType(LLVMTargetDataRef, LLVMTypeRef);
-
-/** Computes the call frame alignment of a type in bytes for a target.
- See the method llvm::TargetData::getTypeABISize. */
-unsigned LLVMCallFrameAlignmentOfType(LLVMTargetDataRef, LLVMTypeRef);
-
-/** Computes the preferred alignment of a type in bytes for a target.
- See the method llvm::TargetData::getTypeABISize. */
-unsigned LLVMPreferredAlignmentOfType(LLVMTargetDataRef, LLVMTypeRef);
-
-/** Computes the preferred alignment of a global variable in bytes for a target.
- See the method llvm::TargetData::getPreferredAlignment. */
-unsigned LLVMPreferredAlignmentOfGlobal(LLVMTargetDataRef,
- LLVMValueRef GlobalVar);
-
-/** Computes the structure element that contains the byte offset for a target.
- See the method llvm::StructLayout::getElementContainingOffset. */
-unsigned LLVMElementAtOffset(LLVMTargetDataRef, LLVMTypeRef StructTy,
- unsigned long long Offset);
-
-/** Computes the byte offset of the indexed struct element for a target.
- See the method llvm::StructLayout::getElementContainingOffset. */
-unsigned long long LLVMOffsetOfElement(LLVMTargetDataRef, LLVMTypeRef StructTy,
- unsigned Element);
-
-/** Struct layouts are speculatively cached. If a TargetDataRef is alive when
- types are being refined and removed, this method must be called whenever a
- struct type is removed to avoid a dangling pointer in this cache.
- See the method llvm::TargetData::InvalidateStructLayoutInfo. */
-void LLVMInvalidateStructLayout(LLVMTargetDataRef, LLVMTypeRef StructTy);
-
-/** Deallocates a TargetData.
- See the destructor llvm::TargetData::~TargetData. */
-void LLVMDisposeTargetData(LLVMTargetDataRef);
-
-
-#ifdef __cplusplus
-}
-
-namespace llvm {
- class TargetData;
-
- inline TargetData *unwrap(LLVMTargetDataRef P) {
- return reinterpret_cast<TargetData*>(P);
- }
-
- inline LLVMTargetDataRef wrap(const TargetData *P) {
- return reinterpret_cast<LLVMTargetDataRef>(const_cast<TargetData*>(P));
- }
-}
-
-#endif /* defined(__cplusplus) */
-
-#endif
diff --git a/release_23/include/llvm-c/Transforms/Scalar.h b/release_23/include/llvm-c/Transforms/Scalar.h
deleted file mode 100644
index 6e0ff12c5f69..000000000000
--- a/release_23/include/llvm-c/Transforms/Scalar.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/*===-- Scalar.h - Scalar Transformation Library C Interface ----*- C++ -*-===*\
-|* *|
-|* The LLVM Compiler Infrastructure *|
-|* *|
-|* This file is distributed under the University of Illinois Open Source *|
-|* License. See LICENSE.TXT for details. *|
-|* *|
-|*===----------------------------------------------------------------------===*|
-|* *|
-|* This header declares the C interface to libLLVMScalarOpts.a, which *|
-|* implements various scalar transformations of the LLVM IR. *|
-|* *|
-|* Many exotic languages can interoperate with C code but have a harder time *|
-|* with C++ due to name mangling. So in addition to C, this interface enables *|
-|* tools written in such languages. *|
-|* *|
-\*===----------------------------------------------------------------------===*/
-
-#ifndef LLVM_C_TRANSFORMS_SCALAR_H
-#define LLVM_C_TRANSFORMS_SCALAR_H
-
-#include "llvm-c/Core.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/** See llvm::createConstantPropagationPass function. */
-void LLVMAddConstantPropagationPass(LLVMPassManagerRef PM);
-
-/** See llvm::createInstructionCombiningPass function. */
-void LLVMAddInstructionCombiningPass(LLVMPassManagerRef PM);
-
-/** See llvm::createPromoteMemoryToRegisterPass function. */
-void LLVMAddPromoteMemoryToRegisterPass(LLVMPassManagerRef PM);
-
-/** See llvm::demotePromoteMemoryToRegisterPass function. */
-void LLVMAddDemoteMemoryToRegisterPass(LLVMPassManagerRef PM);
-
-/** See llvm::createReassociatePass function. */
-void LLVMAddReassociatePass(LLVMPassManagerRef PM);
-
-/** See llvm::createGVNPass function. */
-void LLVMAddGVNPass(LLVMPassManagerRef PM);
-
-/** See llvm::createCFGSimplificationPass function. */
-void LLVMAddCFGSimplificationPass(LLVMPassManagerRef PM);
-
-#ifdef __cplusplus
-}
-#endif /* defined(__cplusplus) */
-
-#endif
diff --git a/release_23/include/llvm-c/lto.h b/release_23/include/llvm-c/lto.h
deleted file mode 100644
index 508e871ec4cb..000000000000
--- a/release_23/include/llvm-c/lto.h
+++ /dev/null
@@ -1,235 +0,0 @@
-/*===-- llvm-c/lto.h - LTO Public C Interface ---------------------*- C -*-===*\
-|* *|
-|* The LLVM Compiler Infrastructure *|
-|* *|
-|* This file is distributed under the University of Illinois Open Source *|
-|* License. See LICENSE.TXT for details. *|
-|* *|
-|*===----------------------------------------------------------------------===*|
-|* *|
-|* This header provides public interface to an abstract link time optimization*|
-|* library. LLVM provides an implementation of this interface for use with *|
-|* llvm bitcode files. *|
-|* *|
-\*===----------------------------------------------------------------------===*/
-
-#ifndef LTO_H
-#define LTO_H 1
-
-#include <stdbool.h>
-#include <stddef.h>
-
-typedef enum {
- LTO_SYMBOL_ALIGNMENT_MASK = 0x0000001F, /* log2 of alignment */
- LTO_SYMBOL_PERMISSIONS_MASK = 0x000000E0,
- LTO_SYMBOL_PERMISSIONS_CODE = 0x000000A0,
- LTO_SYMBOL_PERMISSIONS_DATA = 0x000000C0,
- LTO_SYMBOL_PERMISSIONS_RODATA = 0x00000080,
- LTO_SYMBOL_DEFINITION_MASK = 0x00000700,
- LTO_SYMBOL_DEFINITION_REGULAR = 0x00000100,
- LTO_SYMBOL_DEFINITION_TENTATIVE = 0x00000200,
- LTO_SYMBOL_DEFINITION_WEAK = 0x00000300,
- LTO_SYMBOL_DEFINITION_UNDEFINED = 0x00000400,
- LTO_SYMBOL_SCOPE_MASK = 0x00001800,
- LTO_SYMBOL_SCOPE_INTERNAL = 0x00000800,
- LTO_SYMBOL_SCOPE_HIDDEN = 0x00001000,
- LTO_SYMBOL_SCOPE_DEFAULT = 0x00001800
-} lto_symbol_attributes;
-
-typedef enum {
- LTO_DEBUG_MODEL_NONE = 0,
- LTO_DEBUG_MODEL_DWARF = 1
-} lto_debug_model;
-
-typedef enum {
- LTO_CODEGEN_PIC_MODEL_STATIC = 0,
- LTO_CODEGEN_PIC_MODEL_DYNAMIC = 1,
- LTO_CODEGEN_PIC_MODEL_DYNAMIC_NO_PIC = 2
-} lto_codegen_model;
-
-
-/** opaque reference to a loaded object module */
-typedef struct LTOModule* lto_module_t;
-
-/** opaque reference to a code generator */
-typedef struct LTOCodeGenerator* lto_code_gen_t;
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * Returns a printable string.
- */
-extern const char*
-lto_get_version(void);
-
-
-/**
- * Returns the last error string or NULL if last operation was sucessful.
- */
-extern const char*
-lto_get_error_message(void);
-
-
-/**
- * Checks if a file is a loadable object file.
- */
-extern bool
-lto_module_is_object_file(const char* path);
-
-
-/**
- * Checks if a file is a loadable object compiled for requested target.
- */
-extern bool
-lto_module_is_object_file_for_target(const char* path,
- const char* target_triple_prefix);
-
-
-/**
- * Checks if a buffer is a loadable object file.
- */
-extern bool
-lto_module_is_object_file_in_memory(const void* mem, size_t length);
-
-
-/**
- * Checks if a buffer is a loadable object compiled for requested target.
- */
-extern bool
-lto_module_is_object_file_in_memory_for_target(const void* mem, size_t length,
- const char* target_triple_prefix);
-
-
-/**
- * Loads an object file from disk.
- * Returns NULL on error (check lto_get_error_message() for details).
- */
-extern lto_module_t
-lto_module_create(const char* path);
-
-
-/**
- * Loads an object file from memory.
- * Returns NULL on error (check lto_get_error_message() for details).
- */
-extern lto_module_t
-lto_module_create_from_memory(const void* mem, size_t length);
-
-
-/**
- * Frees all memory internally allocated by the module.
- * Upon return the lto_module_t is no longer valid.
- */
-extern void
-lto_module_dispose(lto_module_t mod);
-
-
-/**
- * Returns triple string which the object module was compiled under.
- */
-extern const char*
-lto_module_get_target_triple(lto_module_t mod);
-
-
-/**
- * Returns the number of symbols in the object module.
- */
-extern unsigned int
-lto_module_get_num_symbols(lto_module_t mod);
-
-
-/**
- * Returns the name of the ith symbol in the object module.
- */
-extern const char*
-lto_module_get_symbol_name(lto_module_t mod, unsigned int index);
-
-
-/**
- * Returns the attributes of the ith symbol in the object module.
- */
-extern lto_symbol_attributes
-lto_module_get_symbol_attribute(lto_module_t mod, unsigned int index);
-
-
-/**
- * Instantiates a code generator.
- * Returns NULL on error (check lto_get_error_message() for details).
- */
-extern lto_code_gen_t
-lto_codegen_create(void);
-
-
-/**
- * Frees all code generator and all memory it internally allocated.
- * Upon return the lto_code_gen_t is no longer valid.
- */
-extern void
-lto_codegen_dispose(lto_code_gen_t);
-
-
-
-/**
- * Add an object module to the set of modules for which code will be generated.
- * Returns true on error (check lto_get_error_message() for details).
- */
-extern bool
-lto_codegen_add_module(lto_code_gen_t cg, lto_module_t mod);
-
-
-
-/**
- * Sets if debug info should be generated.
- * Returns true on error (check lto_get_error_message() for details).
- */
-extern bool
-lto_codegen_set_debug_model(lto_code_gen_t cg, lto_debug_model);
-
-
-/**
- * Sets which PIC code model to generated.
- * Returns true on error (check lto_get_error_message() for details).
- */
-extern bool
-lto_codegen_set_pic_model(lto_code_gen_t cg, lto_codegen_model);
-
-
-/**
- * Adds to a list of all global symbols that must exist in the final
- * generated code. If a function is not listed, it might be
- * inlined into every usage and optimized away.
- */
-extern void
-lto_codegen_add_must_preserve_symbol(lto_code_gen_t cg, const char* symbol);
-
-
-/**
- * Writes a new object file at the specified path that contains the
- * merged contents of all modules added so far.
- * Returns true on error (check lto_get_error_message() for details).
- */
-extern bool
-lto_codegen_write_merged_modules(lto_code_gen_t cg, const char* path);
-
-
-/**
- * Generates code for all added modules into one native object file.
- * On sucess returns a pointer to a generated mach-o/ELF buffer and
- * length set to the buffer size. The buffer is owned by the
- * lto_code_gen_t and will be freed when lto_codegen_dispose()
- * is called, or lto_codegen_compile() is called again.
- * On failure, returns NULL (check lto_get_error_message() for details).
- */
-extern const void*
-lto_codegen_compile(lto_code_gen_t cg, size_t* length);
-
-
-#ifdef __cplusplus
-}
-#endif
-
-
-#endif
diff --git a/release_23/include/llvm/ADT/APFloat.h b/release_23/include/llvm/ADT/APFloat.h
deleted file mode 100644
index 411d8add25f6..000000000000
--- a/release_23/include/llvm/ADT/APFloat.h
+++ /dev/null
@@ -1,345 +0,0 @@
-//== llvm/Support/APFloat.h - Arbitrary Precision Floating Point -*- C++ -*-==//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file declares a class to represent arbitrary precision floating
-// point values and provide a variety of arithmetic operations on them.
-//
-//===----------------------------------------------------------------------===//
-
-/* A self-contained host- and target-independent arbitrary-precision
- floating-point software implementation. It uses bignum integer
- arithmetic as provided by static functions in the APInt class.
- The library will work with bignum integers whose parts are any
- unsigned type at least 16 bits wide, but 64 bits is recommended.
-
- Written for clarity rather than speed, in particular with a view
- to use in the front-end of a cross compiler so that target
- arithmetic can be correctly performed on the host. Performance
- should nonetheless be reasonable, particularly for its intended
- use. It may be useful as a base implementation for a run-time
- library during development of a faster target-specific one.
-
- All 5 rounding modes in the IEEE-754R draft are handled correctly
- for all implemented operations. Currently implemented operations
- are add, subtract, multiply, divide, fused-multiply-add,
- conversion-to-float, conversion-to-integer and
- conversion-from-integer. New rounding modes (e.g. away from zero)
- can be added with three or four lines of code.
-
- Four formats are built-in: IEEE single precision, double
- precision, quadruple precision, and x87 80-bit extended double
- (when operating with full extended precision). Adding a new
- format that obeys IEEE semantics only requires adding two lines of
- code: a declaration and definition of the format.
-
- All operations return the status of that operation as an exception
- bit-mask, so multiple operations can be done consecutively with
- their results or-ed together. The returned status can be useful
- for compiler diagnostics; e.g., inexact, underflow and overflow
- can be easily diagnosed on constant folding, and compiler
- optimizers can determine what exceptions would be raised by
- folding operations and optimize, or perhaps not optimize,
- accordingly.
-
- At present, underflow tininess is detected after rounding; it
- should be straight forward to add support for the before-rounding
- case too.
-
- The library reads hexadecimal floating point numbers as per C99,
- and correctly rounds if necessary according to the specified
- rounding mode. Syntax is required to have been validated by the
- caller. It also converts floating point numbers to hexadecimal
- text as per the C99 %a and %A conversions. The output precision
- (or alternatively the natural minimal precision) can be specified;
- if the requested precision is less than the natural precision the
- output is correctly rounded for the specified rounding mode.
-
- It also reads decimal floating point numbers and correctly rounds
- according to the specified rounding mode.
-
- Conversion to decimal text is not currently implemented.
-
- Non-zero finite numbers are represented internally as a sign bit,
- a 16-bit signed exponent, and the significand as an array of
- integer parts. After normalization of a number of precision P the
- exponent is within the range of the format, and if the number is
- not denormal the P-th bit of the significand is set as an explicit
- integer bit. For denormals the most significant bit is shifted
- right so that the exponent is maintained at the format's minimum,
- so that the smallest denormal has just the least significant bit
- of the significand set. The sign of zeroes and infinities is
- significant; the exponent and significand of such numbers is not
- stored, but has a known implicit (deterministic) value: 0 for the
- significands, 0 for zero exponent, all 1 bits for infinity
- exponent. For NaNs the sign and significand are deterministic,
- although not really meaningful, and preserved in non-conversion
- operations. The exponent is implicitly all 1 bits.
-
- TODO
- ====
-
- Some features that may or may not be worth adding:
-
- Binary to decimal conversion (hard).
-
- Optional ability to detect underflow tininess before rounding.
-
- New formats: x87 in single and double precision mode (IEEE apart
- from extended exponent range) (hard).
-
- New operations: sqrt, IEEE remainder, C90 fmod, nextafter,
- nexttoward.
-*/
-
-#ifndef LLVM_FLOAT_H
-#define LLVM_FLOAT_H
-
-// APInt contains static functions implementing bignum arithmetic.
-#include "llvm/ADT/APInt.h"
-
-namespace llvm {
-
- /* Exponents are stored as signed numbers. */
- typedef signed short exponent_t;
-
- struct fltSemantics;
-
- /* When bits of a floating point number are truncated, this enum is
- used to indicate what fraction of the LSB those bits represented.
- It essentially combines the roles of guard and sticky bits. */
- enum lostFraction { // Example of truncated bits:
- lfExactlyZero, // 000000
- lfLessThanHalf, // 0xxxxx x's not all zero
- lfExactlyHalf, // 100000
- lfMoreThanHalf // 1xxxxx x's not all zero
- };
-
- class APFloat {
- public:
-
- /* We support the following floating point semantics. */
- static const fltSemantics IEEEsingle;
- static const fltSemantics IEEEdouble;
- static const fltSemantics IEEEquad;
- static const fltSemantics PPCDoubleDouble;
- static const fltSemantics x87DoubleExtended;
- /* And this psuedo, used to construct APFloats that cannot
- conflict with anything real. */
- static const fltSemantics Bogus;
-
- static unsigned int semanticsPrecision(const fltSemantics &);
-
- /* Floating point numbers have a four-state comparison relation. */
- enum cmpResult {
- cmpLessThan,
- cmpEqual,
- cmpGreaterThan,
- cmpUnordered
- };
-
- /* IEEE-754R gives five rounding modes. */
- enum roundingMode {
- rmNearestTiesToEven,
- rmTowardPositive,
- rmTowardNegative,
- rmTowardZero,
- rmNearestTiesToAway
- };
-
- /* Operation status. opUnderflow or opOverflow are always returned
- or-ed with opInexact. */
- enum opStatus {
- opOK = 0x00,
- opInvalidOp = 0x01,
- opDivByZero = 0x02,
- opOverflow = 0x04,
- opUnderflow = 0x08,
- opInexact = 0x10
- };
-
- /* Category of internally-represented number. */
- enum fltCategory {
- fcInfinity,
- fcNaN,
- fcNormal,
- fcZero
- };
-
- /* Constructors. */
- APFloat(const fltSemantics &, const char *);
- APFloat(const fltSemantics &, integerPart);
- APFloat(const fltSemantics &, fltCategory, bool negative);
- explicit APFloat(double d);
- explicit APFloat(float f);
- explicit APFloat(const APInt &, bool isIEEE = false);
- APFloat(const APFloat &);
- ~APFloat();
-
- /// Profile - Used to insert APFloat objects, or objects that contain
- /// APFloat objects, into FoldingSets.
- void Profile(FoldingSetNodeID& NID) const;
-
- /// @brief Used by the Bitcode serializer to emit APInts to Bitcode.
- void Emit(Serializer& S) const;
-
- /// @brief Used by the Bitcode deserializer to deserialize APInts.
- static APFloat ReadVal(Deserializer& D);
-
- /* Arithmetic. */
- opStatus add(const APFloat &, roundingMode);
- opStatus subtract(const APFloat &, roundingMode);
- opStatus multiply(const APFloat &, roundingMode);
- opStatus divide(const APFloat &, roundingMode);
- opStatus mod(const APFloat &, roundingMode);
- opStatus fusedMultiplyAdd(const APFloat &, const APFloat &, roundingMode);
-
- /* Sign operations. */
- void changeSign();
- void clearSign();
- void copySign(const APFloat &);
-
- /* Conversions. */
- opStatus convert(const fltSemantics &, roundingMode);
- opStatus convertToInteger(integerPart *, unsigned int, bool,
- roundingMode) const;
- opStatus convertFromAPInt(const APInt &,
- bool, roundingMode);
- opStatus convertFromSignExtendedInteger(const integerPart *, unsigned int,
- bool, roundingMode);
- opStatus convertFromZeroExtendedInteger(const integerPart *, unsigned int,
- bool, roundingMode);
- opStatus convertFromString(const char *, roundingMode);
- APInt convertToAPInt() const;
- double convertToDouble() const;
- float convertToFloat() const;
-
- /* The definition of equality is not straightforward for floating point,
- so we won't use operator==. Use one of the following, or write
- whatever it is you really mean. */
- // bool operator==(const APFloat &) const; // DO NOT IMPLEMENT
-
- /* IEEE comparison with another floating point number (NaNs
- compare unordered, 0==-0). */
- cmpResult compare(const APFloat &) const;
-
- /* Write out a hexadecimal representation of the floating point
- value to DST, which must be of sufficient size, in the C99 form
- [-]0xh.hhhhp[+-]d. Return the number of characters written,
- excluding the terminating NUL. */
- unsigned int convertToHexString(char *dst, unsigned int hexDigits,
- bool upperCase, roundingMode) const;
-
- /* Bitwise comparison for equality (QNaNs compare equal, 0!=-0). */
- bool bitwiseIsEqual(const APFloat &) const;
-
- /* Simple queries. */
- fltCategory getCategory() const { return category; }
- const fltSemantics &getSemantics() const { return *semantics; }
- bool isZero() const { return category == fcZero; }
- bool isNonZero() const { return category != fcZero; }
- bool isNaN() const { return category == fcNaN; }
- bool isNegative() const { return sign; }
- bool isPosZero() const { return isZero() && !isNegative(); }
- bool isNegZero() const { return isZero() && isNegative(); }
-
- APFloat& operator=(const APFloat &);
-
- /* Return an arbitrary integer value usable for hashing. */
- uint32_t getHashValue() const;
-
- private:
-
- /* Trivial queries. */
- integerPart *significandParts();
- const integerPart *significandParts() const;
- unsigned int partCount() const;
-
- /* Significand operations. */
- integerPart addSignificand(const APFloat &);
- integerPart subtractSignificand(const APFloat &, integerPart);
- lostFraction addOrSubtractSignificand(const APFloat &, bool subtract);
- lostFraction multiplySignificand(const APFloat &, const APFloat *);
- lostFraction divideSignificand(const APFloat &);
- void incrementSignificand();
- void initialize(const fltSemantics *);
- void shiftSignificandLeft(unsigned int);
- lostFraction shiftSignificandRight(unsigned int);
- unsigned int significandLSB() const;
- unsigned int significandMSB() const;
- void zeroSignificand();
-
- /* Arithmetic on special values. */
- opStatus addOrSubtractSpecials(const APFloat &, bool subtract);
- opStatus divideSpecials(const APFloat &);
- opStatus multiplySpecials(const APFloat &);
-
- /* Miscellany. */
- void makeNaN(void);
- opStatus normalize(roundingMode, lostFraction);
- opStatus addOrSubtract(const APFloat &, roundingMode, bool subtract);
- cmpResult compareAbsoluteValue(const APFloat &) const;
- opStatus handleOverflow(roundingMode);
- bool roundAwayFromZero(roundingMode, lostFraction, unsigned int) const;
- opStatus convertToSignExtendedInteger(integerPart *, unsigned int, bool,
- roundingMode) const;
- opStatus convertFromUnsignedParts(const integerPart *, unsigned int,
- roundingMode);
- opStatus convertFromHexadecimalString(const char *, roundingMode);
- opStatus convertFromDecimalString (const char *, roundingMode);
- char *convertNormalToHexString(char *, unsigned int, bool,
- roundingMode) const;
- opStatus roundSignificandWithExponent(const integerPart *, unsigned int,
- int, roundingMode);
-
- APInt convertFloatAPFloatToAPInt() const;
- APInt convertDoubleAPFloatToAPInt() const;
- APInt convertF80LongDoubleAPFloatToAPInt() const;
- APInt convertPPCDoubleDoubleAPFloatToAPInt() const;
- void initFromAPInt(const APInt& api, bool isIEEE = false);
- void initFromFloatAPInt(const APInt& api);
- void initFromDoubleAPInt(const APInt& api);
- void initFromF80LongDoubleAPInt(const APInt& api);
- void initFromPPCDoubleDoubleAPInt(const APInt& api);
-
- void assign(const APFloat &);
- void copySignificand(const APFloat &);
- void freeSignificand();
-
- /* What kind of semantics does this value obey? */
- const fltSemantics *semantics;
-
- /* Significand - the fraction with an explicit integer bit. Must be
- at least one bit wider than the target precision. */
- union Significand
- {
- integerPart part;
- integerPart *parts;
- } significand;
-
- /* The exponent - a signed number. */
- exponent_t exponent;
-
- /* What kind of floating point number this is. */
- /* Only 2 bits are required, but VisualStudio incorrectly sign extends
- it. Using the extra bit keeps it from failing under VisualStudio */
- fltCategory category: 3;
-
- /* The sign bit of this number. */
- unsigned int sign: 1;
-
- /* For PPCDoubleDouble, we have a second exponent and sign (the second
- significand is appended to the first one, although it would be wrong to
- regard these as a single number for arithmetic purposes). These fields
- are not meaningful for any other type. */
- exponent_t exponent2 : 11;
- unsigned int sign2: 1;
- };
-} /* namespace llvm */
-
-#endif /* LLVM_FLOAT_H */
diff --git a/release_23/include/llvm/ADT/APInt.h b/release_23/include/llvm/ADT/APInt.h
deleted file mode 100644
index 49b243bf3465..000000000000
--- a/release_23/include/llvm/ADT/APInt.h
+++ /dev/null
@@ -1,1432 +0,0 @@
-//===-- llvm/ADT/APInt.h - For Arbitrary Precision Integer -----*- C++ -*--===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements a class to represent arbitrary precision integral
-// constant values and operations on them.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_APINT_H
-#define LLVM_APINT_H
-
-#include "llvm/Support/DataTypes.h"
-#include <cassert>
-#include <string>
-
-#define COMPILE_TIME_ASSERT(cond) extern int CTAssert[(cond) ? 1 : -1]
-
-namespace llvm {
- class Serializer;
- class Deserializer;
- class FoldingSetNodeID;
-
- /* An unsigned host type used as a single part of a multi-part
- bignum. */
- typedef uint64_t integerPart;
-
- const unsigned int host_char_bit = 8;
- const unsigned int integerPartWidth = host_char_bit *
- static_cast<unsigned int>(sizeof(integerPart));
-
-//===----------------------------------------------------------------------===//
-// APInt Class
-//===----------------------------------------------------------------------===//
-
-/// APInt - This class represents arbitrary precision constant integral values.
-/// It is a functional replacement for common case unsigned integer type like
-/// "unsigned", "unsigned long" or "uint64_t", but also allows non-byte-width
-/// integer sizes and large integer value types such as 3-bits, 15-bits, or more
-/// than 64-bits of precision. APInt provides a variety of arithmetic operators
-/// and methods to manipulate integer values of any bit-width. It supports both
-/// the typical integer arithmetic and comparison operations as well as bitwise
-/// manipulation.
-///
-/// The class has several invariants worth noting:
-/// * All bit, byte, and word positions are zero-based.
-/// * Once the bit width is set, it doesn't change except by the Truncate,
-/// SignExtend, or ZeroExtend operations.
-/// * All binary operators must be on APInt instances of the same bit width.
-/// Attempting to use these operators on instances with different bit
-/// widths will yield an assertion.
-/// * The value is stored canonically as an unsigned value. For operations
-/// where it makes a difference, there are both signed and unsigned variants
-/// of the operation. For example, sdiv and udiv. However, because the bit
-/// widths must be the same, operations such as Mul and Add produce the same
-/// results regardless of whether the values are interpreted as signed or
-/// not.
-/// * In general, the class tries to follow the style of computation that LLVM
-/// uses in its IR. This simplifies its use for LLVM.
-///
-/// @brief Class for arbitrary precision integers.
-class APInt {
-
- uint32_t BitWidth; ///< The number of bits in this APInt.
-
- /// This union is used to store the integer value. When the
- /// integer bit-width <= 64, it uses VAL, otherwise it uses pVal.
- union {
- uint64_t VAL; ///< Used to store the <= 64 bits integer value.
- uint64_t *pVal; ///< Used to store the >64 bits integer value.
- };
-
- /// This enum is used to hold the constants we needed for APInt.
- enum {
- /// Bits in a word
- APINT_BITS_PER_WORD = static_cast<unsigned int>(sizeof(uint64_t)) * 8,
- /// Byte size of a word
- APINT_WORD_SIZE = static_cast<unsigned int>(sizeof(uint64_t))
- };
-
- /// This constructor is used only internally for speed of construction of
- /// temporaries. It is unsafe for general use so it is not public.
- /// @brief Fast internal constructor
- APInt(uint64_t* val, uint32_t bits) : BitWidth(bits), pVal(val) { }
-
- /// @returns true if the number of bits <= 64, false otherwise.
- /// @brief Determine if this APInt just has one word to store value.
- bool isSingleWord() const {
- return BitWidth <= APINT_BITS_PER_WORD;
- }
-
- /// @returns the word position for the specified bit position.
- /// @brief Determine which word a bit is in.
- static uint32_t whichWord(uint32_t bitPosition) {
- return bitPosition / APINT_BITS_PER_WORD;
- }
-
- /// @returns the bit position in a word for the specified bit position
- /// in the APInt.
- /// @brief Determine which bit in a word a bit is in.
- static uint32_t whichBit(uint32_t bitPosition) {
- return bitPosition % APINT_BITS_PER_WORD;
- }
-
- /// This method generates and returns a uint64_t (word) mask for a single
- /// bit at a specific bit position. This is used to mask the bit in the
- /// corresponding word.
- /// @returns a uint64_t with only bit at "whichBit(bitPosition)" set
- /// @brief Get a single bit mask.
- static uint64_t maskBit(uint32_t bitPosition) {
- return 1ULL << whichBit(bitPosition);
- }
-
- /// This method is used internally to clear the to "N" bits in the high order
- /// word that are not used by the APInt. This is needed after the most
- /// significant word is assigned a value to ensure that those bits are
- /// zero'd out.
- /// @brief Clear unused high order bits
- APInt& clearUnusedBits() {
- // Compute how many bits are used in the final word
- uint32_t wordBits = BitWidth % APINT_BITS_PER_WORD;
- if (wordBits == 0)
- // If all bits are used, we want to leave the value alone. This also
- // avoids the undefined behavior of >> when the shift is the same size as
- // the word size (64).
- return *this;
-
- // Mask out the hight bits.
- uint64_t mask = ~uint64_t(0ULL) >> (APINT_BITS_PER_WORD - wordBits);
- if (isSingleWord())
- VAL &= mask;
- else
- pVal[getNumWords() - 1] &= mask;
- return *this;
- }
-
- /// @returns the corresponding word for the specified bit position.
- /// @brief Get the word corresponding to a bit position
- uint64_t getWord(uint32_t bitPosition) const {
- return isSingleWord() ? VAL : pVal[whichWord(bitPosition)];
- }
-
- /// This is used by the constructors that take string arguments.
- /// @brief Convert a char array into an APInt
- void fromString(uint32_t numBits, const char *strStart, uint32_t slen,
- uint8_t radix);
-
- /// This is used by the toString method to divide by the radix. It simply
- /// provides a more convenient form of divide for internal use since KnuthDiv
- /// has specific constraints on its inputs. If those constraints are not met
- /// then it provides a simpler form of divide.
- /// @brief An internal division function for dividing APInts.
- static void divide(const APInt LHS, uint32_t lhsWords,
- const APInt &RHS, uint32_t rhsWords,
- APInt *Quotient, APInt *Remainder);
-
-public:
- /// @name Constructors
- /// @{
- /// If isSigned is true then val is treated as if it were a signed value
- /// (i.e. as an int64_t) and the appropriate sign extension to the bit width
- /// will be done. Otherwise, no sign extension occurs (high order bits beyond
- /// the range of val are zero filled).
- /// @param numBits the bit width of the constructed APInt
- /// @param val the initial value of the APInt
- /// @param isSigned how to treat signedness of val
- /// @brief Create a new APInt of numBits width, initialized as val.
- APInt(uint32_t numBits, uint64_t val, bool isSigned = false);
-
- /// Note that numWords can be smaller or larger than the corresponding bit
- /// width but any extraneous bits will be dropped.
- /// @param numBits the bit width of the constructed APInt
- /// @param numWords the number of words in bigVal
- /// @param bigVal a sequence of words to form the initial value of the APInt
- /// @brief Construct an APInt of numBits width, initialized as bigVal[].
- APInt(uint32_t numBits, uint32_t numWords, const uint64_t bigVal[]);
-
- /// This constructor interprets Val as a string in the given radix. The
- /// interpretation stops when the first charater that is not suitable for the
- /// radix is encountered. Acceptable radix values are 2, 8, 10 and 16. It is
- /// an error for the value implied by the string to require more bits than
- /// numBits.
- /// @param numBits the bit width of the constructed APInt
- /// @param val the string to be interpreted
- /// @param radix the radix of Val to use for the intepretation
- /// @brief Construct an APInt from a string representation.
- APInt(uint32_t numBits, const std::string& val, uint8_t radix);
-
- /// This constructor interprets the slen characters starting at StrStart as
- /// a string in the given radix. The interpretation stops when the first
- /// character that is not suitable for the radix is encountered. Acceptable
- /// radix values are 2, 8, 10 and 16. It is an error for the value implied by
- /// the string to require more bits than numBits.
- /// @param numBits the bit width of the constructed APInt
- /// @param strStart the start of the string to be interpreted
- /// @param slen the maximum number of characters to interpret
- /// @param radix the radix to use for the conversion
- /// @brief Construct an APInt from a string representation.
- APInt(uint32_t numBits, const char strStart[], uint32_t slen, uint8_t radix);
-
- /// Simply makes *this a copy of that.
- /// @brief Copy Constructor.
- APInt(const APInt& that);
-
- /// @brief Destructor.
- ~APInt();
-
- /// Default constructor that creates an uninitialized APInt. This is useful
- /// for object deserialization (pair this with the static method Read).
- explicit APInt() : BitWidth(1) {}
-
- /// Profile - Used to insert APInt objects, or objects that contain APInt
- /// objects, into FoldingSets.
- void Profile(FoldingSetNodeID& id) const;
-
- /// @brief Used by the Bitcode serializer to emit APInts to Bitcode.
- void Emit(Serializer& S) const;
-
- /// @brief Used by the Bitcode deserializer to deserialize APInts.
- void Read(Deserializer& D);
-
- /// @}
- /// @name Value Tests
- /// @{
- /// This tests the high bit of this APInt to determine if it is set.
- /// @returns true if this APInt is negative, false otherwise
- /// @brief Determine sign of this APInt.
- bool isNegative() const {
- return (*this)[BitWidth - 1];
- }
-
- /// This tests the high bit of the APInt to determine if it is unset.
- /// @brief Determine if this APInt Value is non-negative (>= 0)
- bool isNonNegative() const {
- return !isNegative();
- }
-
- /// This tests if the value of this APInt is positive (> 0). Note
- /// that 0 is not a positive value.
- /// @returns true if this APInt is positive.
- /// @brief Determine if this APInt Value is positive.
- bool isStrictlyPositive() const {
- return isNonNegative() && (*this) != 0;
- }
-
- /// This checks to see if the value has all bits of the APInt are set or not.
- /// @brief Determine if all bits are set
- bool isAllOnesValue() const {
- return countPopulation() == BitWidth;
- }
-
- /// This checks to see if the value of this APInt is the maximum unsigned
- /// value for the APInt's bit width.
- /// @brief Determine if this is the largest unsigned value.
- bool isMaxValue() const {
- return countPopulation() == BitWidth;
- }
-
- /// This checks to see if the value of this APInt is the maximum signed
- /// value for the APInt's bit width.
- /// @brief Determine if this is the largest signed value.
- bool isMaxSignedValue() const {
- return BitWidth == 1 ? VAL == 0 :
- !isNegative() && countPopulation() == BitWidth - 1;
- }
-
- /// This checks to see if the value of this APInt is the minimum unsigned
- /// value for the APInt's bit width.
- /// @brief Determine if this is the smallest unsigned value.
- bool isMinValue() const {
- return countPopulation() == 0;
- }
-
- /// This checks to see if the value of this APInt is the minimum signed
- /// value for the APInt's bit width.
- /// @brief Determine if this is the smallest signed value.
- bool isMinSignedValue() const {
- return BitWidth == 1 ? VAL == 1 :
- isNegative() && countPopulation() == 1;
- }
-
- /// @brief Check if this APInt has an N-bits unsigned integer value.
- bool isIntN(uint32_t N) const {
- assert(N && "N == 0 ???");
- if (isSingleWord()) {
- return VAL == (VAL & (~0ULL >> (64 - N)));
- } else {
- APInt Tmp(N, getNumWords(), pVal);
- return Tmp == (*this);
- }
- }
-
- /// @brief Check if this APInt has an N-bits signed integer value.
- bool isSignedIntN(uint32_t N) const {
- assert(N && "N == 0 ???");
- return getMinSignedBits() <= N;
- }
-
- /// @returns true if the argument APInt value is a power of two > 0.
- bool isPowerOf2() const;
-
- /// isSignBit - Return true if this is the value returned by getSignBit.
- bool isSignBit() const { return isMinSignedValue(); }
-
- /// This converts the APInt to a boolean value as a test against zero.
- /// @brief Boolean conversion function.
- bool getBoolValue() const {
- return *this != 0;
- }
-
- /// getLimitedValue - If this value is smaller than the specified limit,
- /// return it, otherwise return the limit value. This causes the value
- /// to saturate to the limit.
- uint64_t getLimitedValue(uint64_t Limit = ~0ULL) const {
- return (getActiveBits() > 64 || getZExtValue() > Limit) ?
- Limit : getZExtValue();
- }
-
- /// @}
- /// @name Value Generators
- /// @{
- /// @brief Gets maximum unsigned value of APInt for specific bit width.
- static APInt getMaxValue(uint32_t numBits) {
- return APInt(numBits, 0).set();
- }
-
- /// @brief Gets maximum signed value of APInt for a specific bit width.
- static APInt getSignedMaxValue(uint32_t numBits) {
- return APInt(numBits, 0).set().clear(numBits - 1);
- }
-
- /// @brief Gets minimum unsigned value of APInt for a specific bit width.
- static APInt getMinValue(uint32_t numBits) {
- return APInt(numBits, 0);
- }
-
- /// @brief Gets minimum signed value of APInt for a specific bit width.
- static APInt getSignedMinValue(uint32_t numBits) {
- return APInt(numBits, 0).set(numBits - 1);
- }
-
- /// getSignBit - This is just a wrapper function of getSignedMinValue(), and
- /// it helps code readability when we want to get a SignBit.
- /// @brief Get the SignBit for a specific bit width.
- static APInt getSignBit(uint32_t BitWidth) {
- return getSignedMinValue(BitWidth);
- }
-
- /// @returns the all-ones value for an APInt of the specified bit-width.
- /// @brief Get the all-ones value.
- static APInt getAllOnesValue(uint32_t numBits) {
- return APInt(numBits, 0).set();
- }
-
- /// @returns the '0' value for an APInt of the specified bit-width.
- /// @brief Get the '0' value.
- static APInt getNullValue(uint32_t numBits) {
- return APInt(numBits, 0);
- }
-
- /// Get an APInt with the same BitWidth as this APInt, just zero mask
- /// the low bits and right shift to the least significant bit.
- /// @returns the high "numBits" bits of this APInt.
- APInt getHiBits(uint32_t numBits) const;
-
- /// Get an APInt with the same BitWidth as this APInt, just zero mask
- /// the high bits.
- /// @returns the low "numBits" bits of this APInt.
- APInt getLoBits(uint32_t numBits) const;
-
- /// Constructs an APInt value that has a contiguous range of bits set. The
- /// bits from loBit (inclusive) to hiBit (exclusive) will be set. All other
- /// bits will be zero. For example, with parameters(32, 0, 16) you would get
- /// 0x0000FFFF. If hiBit is less than loBit then the set bits "wrap". For
- /// example, with parameters (32, 28, 4), you would get 0xF000000F.
- /// @param numBits the intended bit width of the result
- /// @param loBit the index of the lowest bit set.
- /// @param hiBit the index of the highest bit set.
- /// @returns An APInt value with the requested bits set.
- /// @brief Get a value with a block of bits set.
- static APInt getBitsSet(uint32_t numBits, uint32_t loBit, uint32_t hiBit) {
- assert(hiBit <= numBits && "hiBit out of range");
- assert(loBit < numBits && "loBit out of range");
- if (hiBit < loBit)
- return getLowBitsSet(numBits, hiBit) |
- getHighBitsSet(numBits, numBits-loBit);
- return getLowBitsSet(numBits, hiBit-loBit).shl(loBit);
- }
-
- /// Constructs an APInt value that has the top hiBitsSet bits set.
- /// @param numBits the bitwidth of the result
- /// @param hiBitsSet the number of high-order bits set in the result.
- /// @brief Get a value with high bits set
- static APInt getHighBitsSet(uint32_t numBits, uint32_t hiBitsSet) {
- assert(hiBitsSet <= numBits && "Too many bits to set!");
- // Handle a degenerate case, to avoid shifting by word size
- if (hiBitsSet == 0)
- return APInt(numBits, 0);
- uint32_t shiftAmt = numBits - hiBitsSet;
- // For small values, return quickly
- if (numBits <= APINT_BITS_PER_WORD)
- return APInt(numBits, ~0ULL << shiftAmt);
- return (~APInt(numBits, 0)).shl(shiftAmt);
- }
-
- /// Constructs an APInt value that has the bottom loBitsSet bits set.
- /// @param numBits the bitwidth of the result
- /// @param loBitsSet the number of low-order bits set in the result.
- /// @brief Get a value with low bits set
- static APInt getLowBitsSet(uint32_t numBits, uint32_t loBitsSet) {
- assert(loBitsSet <= numBits && "Too many bits to set!");
- // Handle a degenerate case, to avoid shifting by word size
- if (loBitsSet == 0)
- return APInt(numBits, 0);
- if (loBitsSet == APINT_BITS_PER_WORD)
- return APInt(numBits, -1ULL);
- // For small values, return quickly
- if (numBits < APINT_BITS_PER_WORD)
- return APInt(numBits, (1ULL << loBitsSet) - 1);
- return (~APInt(numBits, 0)).lshr(numBits - loBitsSet);
- }
-
- /// The hash value is computed as the sum of the words and the bit width.
- /// @returns A hash value computed from the sum of the APInt words.
- /// @brief Get a hash value based on this APInt
- uint64_t getHashValue() const;
-
- /// This function returns a pointer to the internal storage of the APInt.
- /// This is useful for writing out the APInt in binary form without any
- /// conversions.
- const uint64_t* getRawData() const {
- if (isSingleWord())
- return &VAL;
- return &pVal[0];
- }
-
- /// @}
- /// @name Unary Operators
- /// @{
- /// @returns a new APInt value representing *this incremented by one
- /// @brief Postfix increment operator.
- const APInt operator++(int) {
- APInt API(*this);
- ++(*this);
- return API;
- }
-
- /// @returns *this incremented by one
- /// @brief Prefix increment operator.
- APInt& operator++();
-
- /// @returns a new APInt representing *this decremented by one.
- /// @brief Postfix decrement operator.
- const APInt operator--(int) {
- APInt API(*this);
- --(*this);
- return API;
- }
-
- /// @returns *this decremented by one.
- /// @brief Prefix decrement operator.
- APInt& operator--();
-
- /// Performs a bitwise complement operation on this APInt.
- /// @returns an APInt that is the bitwise complement of *this
- /// @brief Unary bitwise complement operator.
- APInt operator~() const;
-
- /// Negates *this using two's complement logic.
- /// @returns An APInt value representing the negation of *this.
- /// @brief Unary negation operator
- APInt operator-() const {
- return APInt(BitWidth, 0) - (*this);
- }
-
- /// Performs logical negation operation on this APInt.
- /// @returns true if *this is zero, false otherwise.
- /// @brief Logical negation operator.
- bool operator !() const;
-
- /// @}
- /// @name Assignment Operators
- /// @{
- /// @returns *this after assignment of RHS.
- /// @brief Copy assignment operator.
- APInt& operator=(const APInt& RHS);
-
- /// The RHS value is assigned to *this. If the significant bits in RHS exceed
- /// the bit width, the excess bits are truncated. If the bit width is larger
- /// than 64, the value is zero filled in the unspecified high order bits.
- /// @returns *this after assignment of RHS value.
- /// @brief Assignment operator.
- APInt& operator=(uint64_t RHS);
-
- /// Performs a bitwise AND operation on this APInt and RHS. The result is
- /// assigned to *this.
- /// @returns *this after ANDing with RHS.
- /// @brief Bitwise AND assignment operator.
- APInt& operator&=(const APInt& RHS);
-
- /// Performs a bitwise OR operation on this APInt and RHS. The result is
- /// assigned *this;
- /// @returns *this after ORing with RHS.
- /// @brief Bitwise OR assignment operator.
- APInt& operator|=(const APInt& RHS);
-
- /// Performs a bitwise XOR operation on this APInt and RHS. The result is
- /// assigned to *this.
- /// @returns *this after XORing with RHS.
- /// @brief Bitwise XOR assignment operator.
- APInt& operator^=(const APInt& RHS);
-
- /// Multiplies this APInt by RHS and assigns the result to *this.
- /// @returns *this
- /// @brief Multiplication assignment operator.
- APInt& operator*=(const APInt& RHS);
-
- /// Adds RHS to *this and assigns the result to *this.
- /// @returns *this
- /// @brief Addition assignment operator.
- APInt& operator+=(const APInt& RHS);
-
- /// Subtracts RHS from *this and assigns the result to *this.
- /// @returns *this
- /// @brief Subtraction assignment operator.
- APInt& operator-=(const APInt& RHS);
-
- /// Shifts *this left by shiftAmt and assigns the result to *this.
- /// @returns *this after shifting left by shiftAmt
- /// @brief Left-shift assignment function.
- APInt& operator<<=(uint32_t shiftAmt) {
- *this = shl(shiftAmt);
- return *this;
- }
-
- /// @}
- /// @name Binary Operators
- /// @{
- /// Performs a bitwise AND operation on *this and RHS.
- /// @returns An APInt value representing the bitwise AND of *this and RHS.
- /// @brief Bitwise AND operator.
- APInt operator&(const APInt& RHS) const;
- APInt And(const APInt& RHS) const {
- return this->operator&(RHS);
- }
-
- /// Performs a bitwise OR operation on *this and RHS.
- /// @returns An APInt value representing the bitwise OR of *this and RHS.
- /// @brief Bitwise OR operator.
- APInt operator|(const APInt& RHS) const;
- APInt Or(const APInt& RHS) const {
- return this->operator|(RHS);
- }
-
- /// Performs a bitwise XOR operation on *this and RHS.
- /// @returns An APInt value representing the bitwise XOR of *this and RHS.
- /// @brief Bitwise XOR operator.
- APInt operator^(const APInt& RHS) const;
- APInt Xor(const APInt& RHS) const {
- return this->operator^(RHS);
- }
-
- /// Multiplies this APInt by RHS and returns the result.
- /// @brief Multiplication operator.
- APInt operator*(const APInt& RHS) const;
-
- /// Adds RHS to this APInt and returns the result.
- /// @brief Addition operator.
- APInt operator+(const APInt& RHS) const;
- APInt operator+(uint64_t RHS) const {
- return (*this) + APInt(BitWidth, RHS);
- }
-
- /// Subtracts RHS from this APInt and returns the result.
- /// @brief Subtraction operator.
- APInt operator-(const APInt& RHS) const;
- APInt operator-(uint64_t RHS) const {
- return (*this) - APInt(BitWidth, RHS);
- }
-
- APInt operator<<(unsigned Bits) const {
- return shl(Bits);
- }
-
- APInt operator<<(const APInt &Bits) const {
- return shl(Bits);
- }
-
- /// Arithmetic right-shift this APInt by shiftAmt.
- /// @brief Arithmetic right-shift function.
- APInt ashr(uint32_t shiftAmt) const;
-
- /// Logical right-shift this APInt by shiftAmt.
- /// @brief Logical right-shift function.
- APInt lshr(uint32_t shiftAmt) const;
-
- /// Left-shift this APInt by shiftAmt.
- /// @brief Left-shift function.
- APInt shl(uint32_t shiftAmt) const;
-
- /// @brief Rotate left by rotateAmt.
- APInt rotl(uint32_t rotateAmt) const;
-
- /// @brief Rotate right by rotateAmt.
- APInt rotr(uint32_t rotateAmt) const;
-
- /// Arithmetic right-shift this APInt by shiftAmt.
- /// @brief Arithmetic right-shift function.
- APInt ashr(const APInt &shiftAmt) const;
-
- /// Logical right-shift this APInt by shiftAmt.
- /// @brief Logical right-shift function.
- APInt lshr(const APInt &shiftAmt) const;
-
- /// Left-shift this APInt by shiftAmt.
- /// @brief Left-shift function.
- APInt shl(const APInt &shiftAmt) const;
-
- /// @brief Rotate left by rotateAmt.
- APInt rotl(const APInt &rotateAmt) const;
-
- /// @brief Rotate right by rotateAmt.
- APInt rotr(const APInt &rotateAmt) const;
-
- /// Perform an unsigned divide operation on this APInt by RHS. Both this and
- /// RHS are treated as unsigned quantities for purposes of this division.
- /// @returns a new APInt value containing the division result
- /// @brief Unsigned division operation.
- APInt udiv(const APInt& RHS) const;
-
- /// Signed divide this APInt by APInt RHS.
- /// @brief Signed division function for APInt.
- APInt sdiv(const APInt& RHS) const {
- if (isNegative())
- if (RHS.isNegative())
- return (-(*this)).udiv(-RHS);
- else
- return -((-(*this)).udiv(RHS));
- else if (RHS.isNegative())
- return -(this->udiv(-RHS));
- return this->udiv(RHS);
- }
-
- /// Perform an unsigned remainder operation on this APInt with RHS being the
- /// divisor. Both this and RHS are treated as unsigned quantities for purposes
- /// of this operation. Note that this is a true remainder operation and not
- /// a modulo operation because the sign follows the sign of the dividend
- /// which is *this.
- /// @returns a new APInt value containing the remainder result
- /// @brief Unsigned remainder operation.
- APInt urem(const APInt& RHS) const;
-
- /// Signed remainder operation on APInt.
- /// @brief Function for signed remainder operation.
- APInt srem(const APInt& RHS) const {
- if (isNegative())
- if (RHS.isNegative())
- return -((-(*this)).urem(-RHS));
- else
- return -((-(*this)).urem(RHS));
- else if (RHS.isNegative())
- return this->urem(-RHS);
- return this->urem(RHS);
- }
-
- /// Sometimes it is convenient to divide two APInt values and obtain both
- /// the quotient and remainder. This function does both operations in the
- /// same computation making it a little more efficient.
- /// @brief Dual division/remainder interface.
- static void udivrem(const APInt &LHS, const APInt &RHS,
- APInt &Quotient, APInt &Remainder);
-
- static void sdivrem(const APInt &LHS, const APInt &RHS,
- APInt &Quotient, APInt &Remainder)
- {
- if (LHS.isNegative()) {
- if (RHS.isNegative())
- APInt::udivrem(-LHS, -RHS, Quotient, Remainder);
- else
- APInt::udivrem(-LHS, RHS, Quotient, Remainder);
- Quotient = -Quotient;
- Remainder = -Remainder;
- } else if (RHS.isNegative()) {
- APInt::udivrem(LHS, -RHS, Quotient, Remainder);
- Quotient = -Quotient;
- } else {
- APInt::udivrem(LHS, RHS, Quotient, Remainder);
- }
- }
-
- /// @returns the bit value at bitPosition
- /// @brief Array-indexing support.
- bool operator[](uint32_t bitPosition) const;
-
- /// @}
- /// @name Comparison Operators
- /// @{
- /// Compares this APInt with RHS for the validity of the equality
- /// relationship.
- /// @brief Equality operator.
- bool operator==(const APInt& RHS) const;
-
- /// Compares this APInt with a uint64_t for the validity of the equality
- /// relationship.
- /// @returns true if *this == Val
- /// @brief Equality operator.
- bool operator==(uint64_t Val) const;
-
- /// Compares this APInt with RHS for the validity of the equality
- /// relationship.
- /// @returns true if *this == Val
- /// @brief Equality comparison.
- bool eq(const APInt &RHS) const {
- return (*this) == RHS;
- }
-
- /// Compares this APInt with RHS for the validity of the inequality
- /// relationship.
- /// @returns true if *this != Val
- /// @brief Inequality operator.
- bool operator!=(const APInt& RHS) const {
- return !((*this) == RHS);
- }
-
- /// Compares this APInt with a uint64_t for the validity of the inequality
- /// relationship.
- /// @returns true if *this != Val
- /// @brief Inequality operator.
- bool operator!=(uint64_t Val) const {
- return !((*this) == Val);
- }
-
- /// Compares this APInt with RHS for the validity of the inequality
- /// relationship.
- /// @returns true if *this != Val
- /// @brief Inequality comparison
- bool ne(const APInt &RHS) const {
- return !((*this) == RHS);
- }
-
- /// Regards both *this and RHS as unsigned quantities and compares them for
- /// the validity of the less-than relationship.
- /// @returns true if *this < RHS when both are considered unsigned.
- /// @brief Unsigned less than comparison
- bool ult(const APInt& RHS) const;
-
- /// Regards both *this and RHS as signed quantities and compares them for
- /// validity of the less-than relationship.
- /// @returns true if *this < RHS when both are considered signed.
- /// @brief Signed less than comparison
- bool slt(const APInt& RHS) const;
-
- /// Regards both *this and RHS as unsigned quantities and compares them for
- /// validity of the less-or-equal relationship.
- /// @returns true if *this <= RHS when both are considered unsigned.
- /// @brief Unsigned less or equal comparison
- bool ule(const APInt& RHS) const {
- return ult(RHS) || eq(RHS);
- }
-
- /// Regards both *this and RHS as signed quantities and compares them for
- /// validity of the less-or-equal relationship.
- /// @returns true if *this <= RHS when both are considered signed.
- /// @brief Signed less or equal comparison
- bool sle(const APInt& RHS) const {
- return slt(RHS) || eq(RHS);
- }
-
- /// Regards both *this and RHS as unsigned quantities and compares them for
- /// the validity of the greater-than relationship.
- /// @returns true if *this > RHS when both are considered unsigned.
- /// @brief Unsigned greather than comparison
- bool ugt(const APInt& RHS) const {
- return !ult(RHS) && !eq(RHS);
- }
-
- /// Regards both *this and RHS as signed quantities and compares them for
- /// the validity of the greater-than relationship.
- /// @returns true if *this > RHS when both are considered signed.
- /// @brief Signed greather than comparison
- bool sgt(const APInt& RHS) const {
- return !slt(RHS) && !eq(RHS);
- }
-
- /// Regards both *this and RHS as unsigned quantities and compares them for
- /// validity of the greater-or-equal relationship.
- /// @returns true if *this >= RHS when both are considered unsigned.
- /// @brief Unsigned greater or equal comparison
- bool uge(const APInt& RHS) const {
- return !ult(RHS);
- }
-
- /// Regards both *this and RHS as signed quantities and compares them for
- /// validity of the greater-or-equal relationship.
- /// @returns true if *this >= RHS when both are considered signed.
- /// @brief Signed greather or equal comparison
- bool sge(const APInt& RHS) const {
- return !slt(RHS);
- }
-
- /// This operation tests if there are any pairs of corresponding bits
- /// between this APInt and RHS that are both set.
- bool intersects(const APInt &RHS) const {
- return (*this & RHS) != 0;
- }
-
- /// @}
- /// @name Resizing Operators
- /// @{
- /// Truncate the APInt to a specified width. It is an error to specify a width
- /// that is greater than or equal to the current width.
- /// @brief Truncate to new width.
- APInt &trunc(uint32_t width);
-
- /// This operation sign extends the APInt to a new width. If the high order
- /// bit is set, the fill on the left will be done with 1 bits, otherwise zero.
- /// It is an error to specify a width that is less than or equal to the
- /// current width.
- /// @brief Sign extend to a new width.
- APInt &sext(uint32_t width);
-
- /// This operation zero extends the APInt to a new width. The high order bits
- /// are filled with 0 bits. It is an error to specify a width that is less
- /// than or equal to the current width.
- /// @brief Zero extend to a new width.
- APInt &zext(uint32_t width);
-
- /// Make this APInt have the bit width given by \p width. The value is sign
- /// extended, truncated, or left alone to make it that width.
- /// @brief Sign extend or truncate to width
- APInt &sextOrTrunc(uint32_t width);
-
- /// Make this APInt have the bit width given by \p width. The value is zero
- /// extended, truncated, or left alone to make it that width.
- /// @brief Zero extend or truncate to width
- APInt &zextOrTrunc(uint32_t width);
-
- /// @}
- /// @name Bit Manipulation Operators
- /// @{
- /// @brief Set every bit to 1.
- APInt& set();
-
- /// Set the given bit to 1 whose position is given as "bitPosition".
- /// @brief Set a given bit to 1.
- APInt& set(uint32_t bitPosition);
-
- /// @brief Set every bit to 0.
- APInt& clear();
-
- /// Set the given bit to 0 whose position is given as "bitPosition".
- /// @brief Set a given bit to 0.
- APInt& clear(uint32_t bitPosition);
-
- /// @brief Toggle every bit to its opposite value.
- APInt& flip();
-
- /// Toggle a given bit to its opposite value whose position is given
- /// as "bitPosition".
- /// @brief Toggles a given bit to its opposite value.
- APInt& flip(uint32_t bitPosition);
-
- /// @}
- /// @name Value Characterization Functions
- /// @{
-
- /// @returns the total number of bits.
- uint32_t getBitWidth() const {
- return BitWidth;
- }
-
- /// Here one word's bitwidth equals to that of uint64_t.
- /// @returns the number of words to hold the integer value of this APInt.
- /// @brief Get the number of words.
- uint32_t getNumWords() const {
- return (BitWidth + APINT_BITS_PER_WORD - 1) / APINT_BITS_PER_WORD;
- }
-
- /// This function returns the number of active bits which is defined as the
- /// bit width minus the number of leading zeros. This is used in several
- /// computations to see how "wide" the value is.
- /// @brief Compute the number of active bits in the value
- uint32_t getActiveBits() const {
- return BitWidth - countLeadingZeros();
- }
-
- /// This function returns the number of active words in the value of this
- /// APInt. This is used in conjunction with getActiveData to extract the raw
- /// value of the APInt.
- uint32_t getActiveWords() const {
- return whichWord(getActiveBits()-1) + 1;
- }
-
- /// Computes the minimum bit width for this APInt while considering it to be
- /// a signed (and probably negative) value. If the value is not negative,
- /// this function returns the same value as getActiveBits(). Otherwise, it
- /// returns the smallest bit width that will retain the negative value. For
- /// example, -1 can be written as 0b1 or 0xFFFFFFFFFF. 0b1 is shorter and so
- /// for -1, this function will always return 1.
- /// @brief Get the minimum bit size for this signed APInt
- uint32_t getMinSignedBits() const {
- if (isNegative())
- return BitWidth - countLeadingOnes() + 1;
- return getActiveBits()+1;
- }
-
- /// This method attempts to return the value of this APInt as a zero extended
- /// uint64_t. The bitwidth must be <= 64 or the value must fit within a
- /// uint64_t. Otherwise an assertion will result.
- /// @brief Get zero extended value
- uint64_t getZExtValue() const {
- if (isSingleWord())
- return VAL;
- assert(getActiveBits() <= 64 && "Too many bits for uint64_t");
- return pVal[0];
- }
-
- /// This method attempts to return the value of this APInt as a sign extended
- /// int64_t. The bit width must be <= 64 or the value must fit within an
- /// int64_t. Otherwise an assertion will result.
- /// @brief Get sign extended value
- int64_t getSExtValue() const {
- if (isSingleWord())
- return int64_t(VAL << (APINT_BITS_PER_WORD - BitWidth)) >>
- (APINT_BITS_PER_WORD - BitWidth);
- assert(getActiveBits() <= 64 && "Too many bits for int64_t");
- return int64_t(pVal[0]);
- }
-
- /// This method determines how many bits are required to hold the APInt
- /// equivalent of the string given by \p str of length \p slen.
- /// @brief Get bits required for string value.
- static uint32_t getBitsNeeded(const char* str, uint32_t slen, uint8_t radix);
-
- /// countLeadingZeros - This function is an APInt version of the
- /// countLeadingZeros_{32,64} functions in MathExtras.h. It counts the number
- /// of zeros from the most significant bit to the first one bit.
- /// @returns BitWidth if the value is zero.
- /// @returns the number of zeros from the most significant bit to the first
- /// one bits.
- uint32_t countLeadingZeros() const;
-
- /// countLeadingOnes - This function is an APInt version of the
- /// countLeadingOnes_{32,64} functions in MathExtras.h. It counts the number
- /// of ones from the most significant bit to the first zero bit.
- /// @returns 0 if the high order bit is not set
- /// @returns the number of 1 bits from the most significant to the least
- /// @brief Count the number of leading one bits.
- uint32_t countLeadingOnes() const;
-
- /// countTrailingZeros - This function is an APInt version of the
- /// countTrailingZeros_{32,64} functions in MathExtras.h. It counts
- /// the number of zeros from the least significant bit to the first set bit.
- /// @returns BitWidth if the value is zero.
- /// @returns the number of zeros from the least significant bit to the first
- /// one bit.
- /// @brief Count the number of trailing zero bits.
- uint32_t countTrailingZeros() const;
-
- /// countTrailingOnes - This function is an APInt version of the
- /// countTrailingOnes_{32,64} functions in MathExtras.h. It counts
- /// the number of ones from the least significant bit to the first zero bit.
- /// @returns BitWidth if the value is all ones.
- /// @returns the number of ones from the least significant bit to the first
- /// zero bit.
- /// @brief Count the number of trailing one bits.
- uint32_t countTrailingOnes() const;
-
- /// countPopulation - This function is an APInt version of the
- /// countPopulation_{32,64} functions in MathExtras.h. It counts the number
- /// of 1 bits in the APInt value.
- /// @returns 0 if the value is zero.
- /// @returns the number of set bits.
- /// @brief Count the number of bits set.
- uint32_t countPopulation() const;
-
- /// @}
- /// @name Conversion Functions
- /// @{
-
- /// This is used internally to convert an APInt to a string.
- /// @brief Converts an APInt to a std::string
- std::string toString(uint8_t radix, bool wantSigned) const;
-
- /// Considers the APInt to be unsigned and converts it into a string in the
- /// radix given. The radix can be 2, 8, 10 or 16.
- /// @returns a character interpretation of the APInt
- /// @brief Convert unsigned APInt to string representation.
- std::string toStringUnsigned(uint8_t radix = 10) const {
- return toString(radix, false);
- }
-
- /// Considers the APInt to be unsigned and converts it into a string in the
- /// radix given. The radix can be 2, 8, 10 or 16.
- /// @returns a character interpretation of the APInt
- /// @brief Convert unsigned APInt to string representation.
- std::string toStringSigned(uint8_t radix = 10) const {
- return toString(radix, true);
- }
-
- /// @returns a byte-swapped representation of this APInt Value.
- APInt byteSwap() const;
-
- /// @brief Converts this APInt to a double value.
- double roundToDouble(bool isSigned) const;
-
- /// @brief Converts this unsigned APInt to a double value.
- double roundToDouble() const {
- return roundToDouble(false);
- }
-
- /// @brief Converts this signed APInt to a double value.
- double signedRoundToDouble() const {
- return roundToDouble(true);
- }
-
- /// The conversion does not do a translation from integer to double, it just
- /// re-interprets the bits as a double. Note that it is valid to do this on
- /// any bit width. Exactly 64 bits will be translated.
- /// @brief Converts APInt bits to a double
- double bitsToDouble() const {
- union {
- uint64_t I;
- double D;
- } T;
- T.I = (isSingleWord() ? VAL : pVal[0]);
- return T.D;
- }
-
- /// The conversion does not do a translation from integer to float, it just
- /// re-interprets the bits as a float. Note that it is valid to do this on
- /// any bit width. Exactly 32 bits will be translated.
- /// @brief Converts APInt bits to a double
- float bitsToFloat() const {
- union {
- uint32_t I;
- float F;
- } T;
- T.I = uint32_t((isSingleWord() ? VAL : pVal[0]));
- return T.F;
- }
-
- /// The conversion does not do a translation from double to integer, it just
- /// re-interprets the bits of the double. Note that it is valid to do this on
- /// any bit width but bits from V may get truncated.
- /// @brief Converts a double to APInt bits.
- APInt& doubleToBits(double V) {
- union {
- uint64_t I;
- double D;
- } T;
- T.D = V;
- if (isSingleWord())
- VAL = T.I;
- else
- pVal[0] = T.I;
- return clearUnusedBits();
- }
-
- /// The conversion does not do a translation from float to integer, it just
- /// re-interprets the bits of the float. Note that it is valid to do this on
- /// any bit width but bits from V may get truncated.
- /// @brief Converts a float to APInt bits.
- APInt& floatToBits(float V) {
- union {
- uint32_t I;
- float F;
- } T;
- T.F = V;
- if (isSingleWord())
- VAL = T.I;
- else
- pVal[0] = T.I;
- return clearUnusedBits();
- }
-
- /// @}
- /// @name Mathematics Operations
- /// @{
-
- /// @returns the floor log base 2 of this APInt.
- uint32_t logBase2() const {
- return BitWidth - 1 - countLeadingZeros();
- }
-
- /// @returns the log base 2 of this APInt if its an exact power of two, -1
- /// otherwise
- int32_t exactLogBase2() const {
- if (!isPowerOf2())
- return -1;
- return logBase2();
- }
-
- /// @brief Compute the square root
- APInt sqrt() const;
-
- /// If *this is < 0 then return -(*this), otherwise *this;
- /// @brief Get the absolute value;
- APInt abs() const {
- if (isNegative())
- return -(*this);
- return *this;
- }
-
- /// @}
-
- /// @}
- /// @name Building-block Operations for APInt and APFloat
- /// @{
-
- // These building block operations operate on a representation of
- // arbitrary precision, two's-complement, bignum integer values.
- // They should be sufficient to implement APInt and APFloat bignum
- // requirements. Inputs are generally a pointer to the base of an
- // array of integer parts, representing an unsigned bignum, and a
- // count of how many parts there are.
-
- /// Sets the least significant part of a bignum to the input value,
- /// and zeroes out higher parts. */
- static void tcSet(integerPart *, integerPart, unsigned int);
-
- /// Assign one bignum to another.
- static void tcAssign(integerPart *, const integerPart *, unsigned int);
-
- /// Returns true if a bignum is zero, false otherwise.
- static bool tcIsZero(const integerPart *, unsigned int);
-
- /// Extract the given bit of a bignum; returns 0 or 1. Zero-based.
- static int tcExtractBit(const integerPart *, unsigned int bit);
-
- /// Copy the bit vector of width srcBITS from SRC, starting at bit
- /// srcLSB, to DST, of dstCOUNT parts, such that the bit srcLSB
- /// becomes the least significant bit of DST. All high bits above
- /// srcBITS in DST are zero-filled.
- static void tcExtract(integerPart *, unsigned int dstCount, const integerPart *,
- unsigned int srcBits, unsigned int srcLSB);
-
- /// Set the given bit of a bignum. Zero-based.
- static void tcSetBit(integerPart *, unsigned int bit);
-
- /// Returns the bit number of the least or most significant set bit
- /// of a number. If the input number has no bits set -1U is
- /// returned.
- static unsigned int tcLSB(const integerPart *, unsigned int);
- static unsigned int tcMSB(const integerPart *, unsigned int);
-
- /// Negate a bignum in-place.
- static void tcNegate(integerPart *, unsigned int);
-
- /// DST += RHS + CARRY where CARRY is zero or one. Returns the
- /// carry flag.
- static integerPart tcAdd(integerPart *, const integerPart *,
- integerPart carry, unsigned);
-
- /// DST -= RHS + CARRY where CARRY is zero or one. Returns the
- /// carry flag.
- static integerPart tcSubtract(integerPart *, const integerPart *,
- integerPart carry, unsigned);
-
- /// DST += SRC * MULTIPLIER + PART if add is true
- /// DST = SRC * MULTIPLIER + PART if add is false
- ///
- /// Requires 0 <= DSTPARTS <= SRCPARTS + 1. If DST overlaps SRC
- /// they must start at the same point, i.e. DST == SRC.
- ///
- /// If DSTPARTS == SRC_PARTS + 1 no overflow occurs and zero is
- /// returned. Otherwise DST is filled with the least significant
- /// DSTPARTS parts of the result, and if all of the omitted higher
- /// parts were zero return zero, otherwise overflow occurred and
- /// return one.
- static int tcMultiplyPart(integerPart *dst, const integerPart *src,
- integerPart multiplier, integerPart carry,
- unsigned int srcParts, unsigned int dstParts,
- bool add);
-
- /// DST = LHS * RHS, where DST has the same width as the operands
- /// and is filled with the least significant parts of the result.
- /// Returns one if overflow occurred, otherwise zero. DST must be
- /// disjoint from both operands.
- static int tcMultiply(integerPart *, const integerPart *,
- const integerPart *, unsigned);
-
- /// DST = LHS * RHS, where DST has width the sum of the widths of
- /// the operands. No overflow occurs. DST must be disjoint from
- /// both operands. Returns the number of parts required to hold the
- /// result.
- static unsigned int tcFullMultiply(integerPart *, const integerPart *,
- const integerPart *, unsigned, unsigned);
-
- /// If RHS is zero LHS and REMAINDER are left unchanged, return one.
- /// Otherwise set LHS to LHS / RHS with the fractional part
- /// discarded, set REMAINDER to the remainder, return zero. i.e.
- ///
- /// OLD_LHS = RHS * LHS + REMAINDER
- ///
- /// SCRATCH is a bignum of the same size as the operands and result
- /// for use by the routine; its contents need not be initialized
- /// and are destroyed. LHS, REMAINDER and SCRATCH must be
- /// distinct.
- static int tcDivide(integerPart *lhs, const integerPart *rhs,
- integerPart *remainder, integerPart *scratch,
- unsigned int parts);
-
- /// Shift a bignum left COUNT bits. Shifted in bits are zero.
- /// There are no restrictions on COUNT.
- static void tcShiftLeft(integerPart *, unsigned int parts,
- unsigned int count);
-
- /// Shift a bignum right COUNT bits. Shifted in bits are zero.
- /// There are no restrictions on COUNT.
- static void tcShiftRight(integerPart *, unsigned int parts,
- unsigned int count);
-
- /// The obvious AND, OR and XOR and complement operations.
- static void tcAnd(integerPart *, const integerPart *, unsigned int);
- static void tcOr(integerPart *, const integerPart *, unsigned int);
- static void tcXor(integerPart *, const integerPart *, unsigned int);
- static void tcComplement(integerPart *, unsigned int);
-
- /// Comparison (unsigned) of two bignums.
- static int tcCompare(const integerPart *, const integerPart *,
- unsigned int);
-
- /// Increment a bignum in-place. Return the carry flag.
- static integerPart tcIncrement(integerPart *, unsigned int);
-
- /// Set the least significant BITS and clear the rest.
- static void tcSetLeastSignificantBits(integerPart *, unsigned int,
- unsigned int bits);
-
- /// @brief debug method
- void dump() const;
-
- /// @}
-};
-
-inline bool operator==(uint64_t V1, const APInt& V2) {
- return V2 == V1;
-}
-
-inline bool operator!=(uint64_t V1, const APInt& V2) {
- return V2 != V1;
-}
-
-namespace APIntOps {
-
-/// @brief Determine the smaller of two APInts considered to be signed.
-inline APInt smin(const APInt &A, const APInt &B) {
- return A.slt(B) ? A : B;
-}
-
-/// @brief Determine the larger of two APInts considered to be signed.
-inline APInt smax(const APInt &A, const APInt &B) {
- return A.sgt(B) ? A : B;
-}
-
-/// @brief Determine the smaller of two APInts considered to be signed.
-inline APInt umin(const APInt &A, const APInt &B) {
- return A.ult(B) ? A : B;
-}
-
-/// @brief Determine the larger of two APInts considered to be unsigned.
-inline APInt umax(const APInt &A, const APInt &B) {
- return A.ugt(B) ? A : B;
-}
-
-/// @brief Check if the specified APInt has a N-bits unsigned integer value.
-inline bool isIntN(uint32_t N, const APInt& APIVal) {
- return APIVal.isIntN(N);
-}
-
-/// @brief Check if the specified APInt has a N-bits signed integer value.
-inline bool isSignedIntN(uint32_t N, const APInt& APIVal) {
- return APIVal.isSignedIntN(N);
-}
-
-/// @returns true if the argument APInt value is a sequence of ones
-/// starting at the least significant bit with the remainder zero.
-inline bool isMask(uint32_t numBits, const APInt& APIVal) {
- return APIVal.getBoolValue() && ((APIVal + APInt(numBits,1)) & APIVal) == 0;
-}
-
-/// @returns true if the argument APInt value contains a sequence of ones
-/// with the remainder zero.
-inline bool isShiftedMask(uint32_t numBits, const APInt& APIVal) {
- return isMask(numBits, (APIVal - APInt(numBits,1)) | APIVal);
-}
-
-/// @returns a byte-swapped representation of the specified APInt Value.
-inline APInt byteSwap(const APInt& APIVal) {
- return APIVal.byteSwap();
-}
-
-/// @returns the floor log base 2 of the specified APInt value.
-inline uint32_t logBase2(const APInt& APIVal) {
- return APIVal.logBase2();
-}
-
-/// GreatestCommonDivisor - This function returns the greatest common
-/// divisor of the two APInt values using Enclid's algorithm.
-/// @returns the greatest common divisor of Val1 and Val2
-/// @brief Compute GCD of two APInt values.
-APInt GreatestCommonDivisor(const APInt& Val1, const APInt& Val2);
-
-/// Treats the APInt as an unsigned value for conversion purposes.
-/// @brief Converts the given APInt to a double value.
-inline double RoundAPIntToDouble(const APInt& APIVal) {
- return APIVal.roundToDouble();
-}
-
-/// Treats the APInt as a signed value for conversion purposes.
-/// @brief Converts the given APInt to a double value.
-inline double RoundSignedAPIntToDouble(const APInt& APIVal) {
- return APIVal.signedRoundToDouble();
-}
-
-/// @brief Converts the given APInt to a float vlalue.
-inline float RoundAPIntToFloat(const APInt& APIVal) {
- return float(RoundAPIntToDouble(APIVal));
-}
-
-/// Treast the APInt as a signed value for conversion purposes.
-/// @brief Converts the given APInt to a float value.
-inline float RoundSignedAPIntToFloat(const APInt& APIVal) {
- return float(APIVal.signedRoundToDouble());
-}
-
-/// RoundDoubleToAPInt - This function convert a double value to an APInt value.
-/// @brief Converts the given double value into a APInt.
-APInt RoundDoubleToAPInt(double Double, uint32_t width);
-
-/// RoundFloatToAPInt - Converts a float value into an APInt value.
-/// @brief Converts a float value into a APInt.
-inline APInt RoundFloatToAPInt(float Float, uint32_t width) {
- return RoundDoubleToAPInt(double(Float), width);
-}
-
-/// Arithmetic right-shift the APInt by shiftAmt.
-/// @brief Arithmetic right-shift function.
-inline APInt ashr(const APInt& LHS, uint32_t shiftAmt) {
- return LHS.ashr(shiftAmt);
-}
-
-/// Logical right-shift the APInt by shiftAmt.
-/// @brief Logical right-shift function.
-inline APInt lshr(const APInt& LHS, uint32_t shiftAmt) {
- return LHS.lshr(shiftAmt);
-}
-
-/// Left-shift the APInt by shiftAmt.
-/// @brief Left-shift function.
-inline APInt shl(const APInt& LHS, uint32_t shiftAmt) {
- return LHS.shl(shiftAmt);
-}
-
-/// Signed divide APInt LHS by APInt RHS.
-/// @brief Signed division function for APInt.
-inline APInt sdiv(const APInt& LHS, const APInt& RHS) {
- return LHS.sdiv(RHS);
-}
-
-/// Unsigned divide APInt LHS by APInt RHS.
-/// @brief Unsigned division function for APInt.
-inline APInt udiv(const APInt& LHS, const APInt& RHS) {
- return LHS.udiv(RHS);
-}
-
-/// Signed remainder operation on APInt.
-/// @brief Function for signed remainder operation.
-inline APInt srem(const APInt& LHS, const APInt& RHS) {
- return LHS.srem(RHS);
-}
-
-/// Unsigned remainder operation on APInt.
-/// @brief Function for unsigned remainder operation.
-inline APInt urem(const APInt& LHS, const APInt& RHS) {
- return LHS.urem(RHS);
-}
-
-/// Performs multiplication on APInt values.
-/// @brief Function for multiplication operation.
-inline APInt mul(const APInt& LHS, const APInt& RHS) {
- return LHS * RHS;
-}
-
-/// Performs addition on APInt values.
-/// @brief Function for addition operation.
-inline APInt add(const APInt& LHS, const APInt& RHS) {
- return LHS + RHS;
-}
-
-/// Performs subtraction on APInt values.
-/// @brief Function for subtraction operation.
-inline APInt sub(const APInt& LHS, const APInt& RHS) {
- return LHS - RHS;
-}
-
-/// Performs bitwise AND operation on APInt LHS and
-/// APInt RHS.
-/// @brief Bitwise AND function for APInt.
-inline APInt And(const APInt& LHS, const APInt& RHS) {
- return LHS & RHS;
-}
-
-/// Performs bitwise OR operation on APInt LHS and APInt RHS.
-/// @brief Bitwise OR function for APInt.
-inline APInt Or(const APInt& LHS, const APInt& RHS) {
- return LHS | RHS;
-}
-
-/// Performs bitwise XOR operation on APInt.
-/// @brief Bitwise XOR function for APInt.
-inline APInt Xor(const APInt& LHS, const APInt& RHS) {
- return LHS ^ RHS;
-}
-
-/// Performs a bitwise complement operation on APInt.
-/// @brief Bitwise complement function.
-inline APInt Not(const APInt& APIVal) {
- return ~APIVal;
-}
-
-} // End of APIntOps namespace
-
-} // End of llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/ADT/APSInt.h b/release_23/include/llvm/ADT/APSInt.h
deleted file mode 100644
index 705585c8a0c9..000000000000
--- a/release_23/include/llvm/ADT/APSInt.h
+++ /dev/null
@@ -1,237 +0,0 @@
-//===-- llvm/ADT/APSInt.h - Arbitrary Precision Signed Int -----*- C++ -*--===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the APSInt class, which is a simple class that
-// represents an arbitrary sized integer that knows its signedness.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_APSINT_H
-#define LLVM_APSINT_H
-
-#include "llvm/ADT/APInt.h"
-
-namespace llvm {
-
-
-class APSInt : public APInt {
- bool IsUnsigned;
-public:
- /// APSInt ctor - Create an APSInt with the specified width, default to
- /// unsigned.
- explicit APSInt(uint32_t BitWidth, bool isUnsigned = true)
- : APInt(BitWidth, 0), IsUnsigned(isUnsigned) {}
-
- explicit APSInt(const APInt &I, bool isUnsigned = true)
- : APInt(I), IsUnsigned(isUnsigned) {}
-
- APSInt &operator=(const APSInt &RHS) {
- APInt::operator=(RHS);
- IsUnsigned = RHS.IsUnsigned;
- return *this;
- }
-
- APSInt &operator=(const APInt &RHS) {
- // Retain our current sign.
- APInt::operator=(RHS);
- return *this;
- }
-
- APSInt &operator=(uint64_t RHS) {
- // Retain our current sign.
- APInt::operator=(RHS);
- return *this;
- }
-
- // Query sign information.
- bool isSigned() const { return !IsUnsigned; }
- bool isUnsigned() const { return IsUnsigned; }
- void setIsUnsigned(bool Val) { IsUnsigned = Val; }
- void setIsSigned(bool Val) { IsUnsigned = !Val; }
-
- /// This is used internally to convert an APInt to a string.
- /// @brief Converts an APInt to a std::string
- std::string toString(uint8_t Radix = 10) const {
- return APInt::toString(Radix, isSigned());
- }
-
- APSInt& extend(uint32_t width) {
- if (IsUnsigned)
- zext(width);
- else
- sext(width);
- return *this;
- }
-
- APSInt& extOrTrunc(uint32_t width) {
- if (IsUnsigned)
- zextOrTrunc(width);
- else
- sextOrTrunc(width);
- return *this;
- }
-
- const APSInt &operator%=(const APSInt &RHS) {
- assert(IsUnsigned == RHS.IsUnsigned && "Signedness mismatch!");
- if (IsUnsigned)
- *this = urem(RHS);
- else
- *this = srem(RHS);
- return *this;
- }
- const APSInt &operator/=(const APSInt &RHS) {
- assert(IsUnsigned == RHS.IsUnsigned && "Signedness mismatch!");
- if (IsUnsigned)
- *this = udiv(RHS);
- else
- *this = sdiv(RHS);
- return *this;
- }
- APSInt operator%(const APSInt &RHS) const {
- assert(IsUnsigned == RHS.IsUnsigned && "Signedness mismatch!");
- return IsUnsigned ? APSInt(urem(RHS), true) : APSInt(srem(RHS), false);
- }
- APSInt operator/(const APSInt &RHS) const {
- assert(IsUnsigned == RHS.IsUnsigned && "Signedness mismatch!");
- return IsUnsigned ? APSInt(udiv(RHS), true) : APSInt(sdiv(RHS), false);
- }
-
- APSInt operator>>(unsigned Amt) const {
- return IsUnsigned ? APSInt(lshr(Amt), true) : APSInt(ashr(Amt), false);
- }
- APSInt& operator>>=(unsigned Amt) {
- *this = *this >> Amt;
- return *this;
- }
-
- inline bool operator<(const APSInt& RHS) const {
- assert(IsUnsigned == RHS.IsUnsigned && "Signedness mismatch!");
- return IsUnsigned ? ult(RHS) : slt(RHS);
- }
- inline bool operator>(const APSInt& RHS) const {
- assert(IsUnsigned == RHS.IsUnsigned && "Signedness mismatch!");
- return IsUnsigned ? ugt(RHS) : sgt(RHS);
- }
- inline bool operator<=(const APSInt& RHS) const {
- assert(IsUnsigned == RHS.IsUnsigned && "Signedness mismatch!");
- return IsUnsigned ? ule(RHS) : sle(RHS);
- }
- inline bool operator>=(const APSInt& RHS) const {
- assert(IsUnsigned == RHS.IsUnsigned && "Signedness mismatch!");
- return IsUnsigned ? uge(RHS) : sge(RHS);
- }
-
- // The remaining operators just wrap the logic of APInt, but retain the
- // signedness information.
-
- APSInt operator<<(unsigned Bits) const {
- return APSInt(static_cast<const APInt&>(*this) << Bits, IsUnsigned);
- }
- APSInt& operator<<=(unsigned Amt) {
- *this = *this << Amt;
- return *this;
- }
-
- APSInt& operator++() {
- static_cast<APInt&>(*this)++;
- return *this;
- }
- APSInt& operator--() {
- static_cast<APInt&>(*this)++;
- return *this;
- }
- APSInt operator++(int) {
- return APSInt(++static_cast<APInt&>(*this), IsUnsigned);
- }
- APSInt operator--(int) {
- return APSInt(--static_cast<APInt&>(*this), IsUnsigned);
- }
- APSInt operator-() const {
- return APSInt(-static_cast<const APInt&>(*this), IsUnsigned);
- }
- APSInt& operator+=(const APSInt& RHS) {
- assert(IsUnsigned == RHS.IsUnsigned && "Signedness mismatch!");
- static_cast<APInt&>(*this) += RHS;
- return *this;
- }
- APSInt& operator-=(const APSInt& RHS) {
- assert(IsUnsigned == RHS.IsUnsigned && "Signedness mismatch!");
- static_cast<APInt&>(*this) -= RHS;
- return *this;
- }
- APSInt& operator*=(const APSInt& RHS) {
- assert(IsUnsigned == RHS.IsUnsigned && "Signedness mismatch!");
- static_cast<APInt&>(*this) *= RHS;
- return *this;
- }
- APSInt& operator&=(const APSInt& RHS) {
- assert(IsUnsigned == RHS.IsUnsigned && "Signedness mismatch!");
- static_cast<APInt&>(*this) &= RHS;
- return *this;
- }
- APSInt& operator|=(const APSInt& RHS) {
- assert(IsUnsigned == RHS.IsUnsigned && "Signedness mismatch!");
- static_cast<APInt&>(*this) |= RHS;
- return *this;
- }
- APSInt& operator^=(const APSInt& RHS) {
- assert(IsUnsigned == RHS.IsUnsigned && "Signedness mismatch!");
- static_cast<APInt&>(*this) ^= RHS;
- return *this;
- }
-
- APSInt operator&(const APSInt& RHS) const {
- assert(IsUnsigned == RHS.IsUnsigned && "Signedness mismatch!");
- return APSInt(static_cast<const APInt&>(*this) & RHS, IsUnsigned);
- }
- APSInt And(const APSInt& RHS) const {
- return this->operator&(RHS);
- }
-
- APSInt operator|(const APSInt& RHS) const {
- assert(IsUnsigned == RHS.IsUnsigned && "Signedness mismatch!");
- return APSInt(static_cast<const APInt&>(*this) | RHS, IsUnsigned);
- }
- APSInt Or(const APSInt& RHS) const {
- return this->operator|(RHS);
- }
-
-
- APSInt operator^(const APSInt& RHS) const {
- assert(IsUnsigned == RHS.IsUnsigned && "Signedness mismatch!");
- return APSInt(static_cast<const APInt&>(*this) ^ RHS, IsUnsigned);
- }
- APSInt Xor(const APSInt& RHS) const {
- return this->operator^(RHS);
- }
-
- APSInt operator*(const APSInt& RHS) const {
- assert(IsUnsigned == RHS.IsUnsigned && "Signedness mismatch!");
- return APSInt(static_cast<const APInt&>(*this) * RHS, IsUnsigned);
- }
- APSInt operator+(const APSInt& RHS) const {
- assert(IsUnsigned == RHS.IsUnsigned && "Signedness mismatch!");
- return APSInt(static_cast<const APInt&>(*this) + RHS, IsUnsigned);
- }
- APSInt operator-(const APSInt& RHS) const {
- assert(IsUnsigned == RHS.IsUnsigned && "Signedness mismatch!");
- return APSInt(static_cast<const APInt&>(*this) - RHS, IsUnsigned);
- }
- APSInt operator~() const {
- return APSInt(~static_cast<const APInt&>(*this), IsUnsigned);
- }
-
- /// Profile - Used to insert APSInt objects, or objects that contain APSInt
- /// objects, into FoldingSets.
- void Profile(FoldingSetNodeID& ID) const;
-};
-
-} // end namespace llvm
-
-#endif
diff --git a/release_23/include/llvm/ADT/BitVector.h b/release_23/include/llvm/ADT/BitVector.h
deleted file mode 100644
index fccb1c6e8aba..000000000000
--- a/release_23/include/llvm/ADT/BitVector.h
+++ /dev/null
@@ -1,409 +0,0 @@
-//===- llvm/ADT/BitVector.h - Bit vectors -----------------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the BitVector class.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_ADT_BITVECTOR_H
-#define LLVM_ADT_BITVECTOR_H
-
-#include "llvm/Support/MathExtras.h"
-#include <algorithm>
-#include <cassert>
-#include <cstdlib>
-#include <cstring>
-
-namespace llvm {
-
-class BitVector {
- typedef unsigned long BitWord;
-
- enum { BITWORD_SIZE = (unsigned)sizeof(BitWord) * 8 };
-
- BitWord *Bits; // Actual bits.
- unsigned Size; // Size of bitvector in bits.
- unsigned Capacity; // Size of allocated memory in BitWord.
-
-public:
- // Encapsulation of a single bit.
- class reference {
- friend class BitVector;
-
- BitWord *WordRef;
- unsigned BitPos;
-
- reference(); // Undefined
-
- public:
- reference(BitVector &b, unsigned Idx) {
- WordRef = &b.Bits[Idx / BITWORD_SIZE];
- BitPos = Idx % BITWORD_SIZE;
- }
-
- ~reference() {}
-
- reference& operator=(bool t) {
- if (t)
- *WordRef |= 1L << BitPos;
- else
- *WordRef &= ~(1L << BitPos);
- return *this;
- }
-
- operator bool() const {
- return ((*WordRef) & (1L << BitPos)) ? true : false;
- }
- };
-
-
- /// BitVector default ctor - Creates an empty bitvector.
- BitVector() : Size(0), Capacity(0) {
- Bits = NULL;
- }
-
- /// BitVector ctor - Creates a bitvector of specified number of bits. All
- /// bits are initialized to the specified value.
- explicit BitVector(unsigned s, bool t = false) : Size(s) {
- Capacity = NumBitWords(s);
- Bits = new BitWord[Capacity];
- init_words(Bits, Capacity, t);
- if (t)
- clear_unused_bits();
- }
-
- /// BitVector copy ctor.
- BitVector(const BitVector &RHS) : Size(RHS.size()) {
- if (Size == 0) {
- Bits = NULL;
- Capacity = 0;
- return;
- }
-
- Capacity = NumBitWords(RHS.size());
- Bits = new BitWord[Capacity];
- std::copy(RHS.Bits, &RHS.Bits[Capacity], Bits);
- }
-
- ~BitVector() {
- delete[] Bits;
- }
-
- /// size - Returns the number of bits in this bitvector.
- unsigned size() const { return Size; }
-
- /// count - Returns the number of bits which are set.
- unsigned count() const {
- unsigned NumBits = 0;
- for (unsigned i = 0; i < NumBitWords(size()); ++i)
- if (sizeof(BitWord) == 4)
- NumBits += CountPopulation_32((uint32_t)Bits[i]);
- else if (sizeof(BitWord) == 8)
- NumBits += CountPopulation_64(Bits[i]);
- else
- assert(0 && "Unsupported!");
- return NumBits;
- }
-
- /// any - Returns true if any bit is set.
- bool any() const {
- for (unsigned i = 0; i < NumBitWords(size()); ++i)
- if (Bits[i] != 0)
- return true;
- return false;
- }
-
- /// none - Returns true if none of the bits are set.
- bool none() const {
- return !any();
- }
-
- /// find_first - Returns the index of the first set bit, -1 if none
- /// of the bits are set.
- int find_first() const {
- for (unsigned i = 0; i < NumBitWords(size()); ++i)
- if (Bits[i] != 0) {
- if (sizeof(BitWord) == 4)
- return i * BITWORD_SIZE + CountTrailingZeros_32((uint32_t)Bits[i]);
- else if (sizeof(BitWord) == 8)
- return i * BITWORD_SIZE + CountTrailingZeros_64(Bits[i]);
- else
- assert(0 && "Unsupported!");
- }
- return -1;
- }
-
- /// find_next - Returns the index of the next set bit following the
- /// "Prev" bit. Returns -1 if the next set bit is not found.
- int find_next(unsigned Prev) const {
- ++Prev;
- if (Prev >= Size)
- return -1;
-
- unsigned WordPos = Prev / BITWORD_SIZE;
- unsigned BitPos = Prev % BITWORD_SIZE;
- BitWord Copy = Bits[WordPos];
- // Mask off previous bits.
- Copy &= ~0L << BitPos;
-
- if (Copy != 0) {
- if (sizeof(BitWord) == 4)
- return WordPos * BITWORD_SIZE + CountTrailingZeros_32((uint32_t)Copy);
- else if (sizeof(BitWord) == 8)
- return WordPos * BITWORD_SIZE + CountTrailingZeros_64(Copy);
- else
- assert(0 && "Unsupported!");
- }
-
- // Check subsequent words.
- for (unsigned i = WordPos+1; i < NumBitWords(size()); ++i)
- if (Bits[i] != 0) {
- if (sizeof(BitWord) == 4)
- return i * BITWORD_SIZE + CountTrailingZeros_32((uint32_t)Bits[i]);
- else if (sizeof(BitWord) == 8)
- return i * BITWORD_SIZE + CountTrailingZeros_64(Bits[i]);
- else
- assert(0 && "Unsupported!");
- }
- return -1;
- }
-
- /// clear - Clear all bits.
- void clear() {
- Size = 0;
- }
-
- /// resize - Grow or shrink the bitvector.
- void resize(unsigned N, bool t = false) {
- if (N > Capacity * BITWORD_SIZE) {
- unsigned OldCapacity = Capacity;
- grow(N);
- init_words(&Bits[OldCapacity], (Capacity-OldCapacity), t);
- }
-
- // Set any old unused bits that are now included in the BitVector. This
- // may set bits that are not included in the new vector, but we will clear
- // them back out below.
- if (N > Size)
- set_unused_bits(t);
-
- // Update the size, and clear out any bits that are now unused
- unsigned OldSize = Size;
- Size = N;
- if (t || N < OldSize)
- clear_unused_bits();
- }
-
- void reserve(unsigned N) {
- if (N > Capacity * BITWORD_SIZE)
- grow(N);
- }
-
- // Set, reset, flip
- BitVector &set() {
- init_words(Bits, Capacity, true);
- clear_unused_bits();
- return *this;
- }
-
- BitVector &set(unsigned Idx) {
- Bits[Idx / BITWORD_SIZE] |= 1L << (Idx % BITWORD_SIZE);
- return *this;
- }
-
- BitVector &reset() {
- init_words(Bits, Capacity, false);
- return *this;
- }
-
- BitVector &reset(unsigned Idx) {
- Bits[Idx / BITWORD_SIZE] &= ~(1L << (Idx % BITWORD_SIZE));
- return *this;
- }
-
- BitVector &flip() {
- for (unsigned i = 0; i < NumBitWords(size()); ++i)
- Bits[i] = ~Bits[i];
- clear_unused_bits();
- return *this;
- }
-
- BitVector &flip(unsigned Idx) {
- Bits[Idx / BITWORD_SIZE] ^= 1L << (Idx % BITWORD_SIZE);
- return *this;
- }
-
- // No argument flip.
- BitVector operator~() const {
- return BitVector(*this).flip();
- }
-
- // Indexing.
- reference operator[](unsigned Idx) {
- assert (Idx < Size && "Out-of-bounds Bit access.");
- return reference(*this, Idx);
- }
-
- bool operator[](unsigned Idx) const {
- assert (Idx < Size && "Out-of-bounds Bit access.");
- BitWord Mask = 1L << (Idx % BITWORD_SIZE);
- return (Bits[Idx / BITWORD_SIZE] & Mask) != 0;
- }
-
- bool test(unsigned Idx) const {
- return (*this)[Idx];
- }
-
- // Comparison operators.
- bool operator==(const BitVector &RHS) const {
- unsigned ThisWords = NumBitWords(size());
- unsigned RHSWords = NumBitWords(RHS.size());
- unsigned i;
- for (i = 0; i != std::min(ThisWords, RHSWords); ++i)
- if (Bits[i] != RHS.Bits[i])
- return false;
-
- // Verify that any extra words are all zeros.
- if (i != ThisWords) {
- for (; i != ThisWords; ++i)
- if (Bits[i])
- return false;
- } else if (i != RHSWords) {
- for (; i != RHSWords; ++i)
- if (RHS.Bits[i])
- return false;
- }
- return true;
- }
-
- bool operator!=(const BitVector &RHS) const {
- return !(*this == RHS);
- }
-
- // Intersection, union, disjoint union.
- BitVector operator&=(const BitVector &RHS) {
- unsigned ThisWords = NumBitWords(size());
- unsigned RHSWords = NumBitWords(RHS.size());
- unsigned i;
- for (i = 0; i != std::min(ThisWords, RHSWords); ++i)
- Bits[i] &= RHS.Bits[i];
-
- // Any bits that are just in this bitvector become zero, because they aren't
- // in the RHS bit vector. Any words only in RHS are ignored because they
- // are already zero in the LHS.
- for (; i != ThisWords; ++i)
- Bits[i] = 0;
-
- return *this;
- }
-
- BitVector operator|=(const BitVector &RHS) {
- assert(Size == RHS.Size && "Illegal operation!");
- for (unsigned i = 0; i < NumBitWords(size()); ++i)
- Bits[i] |= RHS.Bits[i];
- return *this;
- }
-
- BitVector operator^=(const BitVector &RHS) {
- assert(Size == RHS.Size && "Illegal operation!");
- for (unsigned i = 0; i < NumBitWords(size()); ++i)
- Bits[i] ^= RHS.Bits[i];
- return *this;
- }
-
- // Assignment operator.
- const BitVector &operator=(const BitVector &RHS) {
- if (this == &RHS) return *this;
-
- Size = RHS.size();
- unsigned RHSWords = NumBitWords(Size);
- if (Size <= Capacity * BITWORD_SIZE) {
- std::copy(RHS.Bits, &RHS.Bits[RHSWords], Bits);
- clear_unused_bits();
- return *this;
- }
-
- // Grow the bitvector to have enough elements.
- Capacity = RHSWords;
- BitWord *NewBits = new BitWord[Capacity];
- std::copy(RHS.Bits, &RHS.Bits[RHSWords], NewBits);
-
- // Destroy the old bits.
- delete[] Bits;
- Bits = NewBits;
-
- return *this;
- }
-
-private:
- unsigned NumBitWords(unsigned S) const {
- return (S + BITWORD_SIZE-1) / BITWORD_SIZE;
- }
-
- // Set the unused bits in the high words.
- void set_unused_bits(bool t = true) {
- // Set high words first.
- unsigned UsedWords = NumBitWords(Size);
- if (Capacity > UsedWords)
- init_words(&Bits[UsedWords], (Capacity-UsedWords), t);
-
- // Then set any stray high bits of the last used word.
- unsigned ExtraBits = Size % BITWORD_SIZE;
- if (ExtraBits) {
- Bits[UsedWords-1] &= ~(~0L << ExtraBits);
- Bits[UsedWords-1] |= (0 - (BitWord)t) << ExtraBits;
- }
- }
-
- // Clear the unused bits in the high words.
- void clear_unused_bits() {
- set_unused_bits(false);
- }
-
- void grow(unsigned NewSize) {
- unsigned OldCapacity = Capacity;
- Capacity = NumBitWords(NewSize);
- BitWord *NewBits = new BitWord[Capacity];
-
- // Copy the old bits over.
- if (OldCapacity != 0)
- std::copy(Bits, &Bits[OldCapacity], NewBits);
-
- // Destroy the old bits.
- delete[] Bits;
- Bits = NewBits;
-
- clear_unused_bits();
- }
-
- void init_words(BitWord *B, unsigned NumWords, bool t) {
- memset(B, 0 - (int)t, NumWords*sizeof(BitWord));
- }
-};
-
-inline BitVector operator&(const BitVector &LHS, const BitVector &RHS) {
- BitVector Result(LHS);
- Result &= RHS;
- return Result;
-}
-
-inline BitVector operator|(const BitVector &LHS, const BitVector &RHS) {
- BitVector Result(LHS);
- Result |= RHS;
- return Result;
-}
-
-inline BitVector operator^(const BitVector &LHS, const BitVector &RHS) {
- BitVector Result(LHS);
- Result ^= RHS;
- return Result;
-}
-
-} // End llvm namespace
-#endif
diff --git a/release_23/include/llvm/ADT/DenseMap.h b/release_23/include/llvm/ADT/DenseMap.h
deleted file mode 100644
index b29c69156277..000000000000
--- a/release_23/include/llvm/ADT/DenseMap.h
+++ /dev/null
@@ -1,458 +0,0 @@
-//===- llvm/ADT/DenseMap.h - Dense probed hash table ------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines the DenseMap class.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_ADT_DENSEMAP_H
-#define LLVM_ADT_DENSEMAP_H
-
-#include "llvm/Support/DataTypes.h"
-#include "llvm/Support/MathExtras.h"
-#include <cassert>
-#include <utility>
-
-namespace llvm {
-
-template<typename T>
-struct DenseMapInfo {
- //static inline T getEmptyKey();
- //static inline T getTombstoneKey();
- //static unsigned getHashValue(const T &Val);
- //static bool isEqual(const T &LHS, const T &RHS);
- //static bool isPod()
-};
-
-// Provide DenseMapInfo for all pointers.
-template<typename T>
-struct DenseMapInfo<T*> {
- static inline T* getEmptyKey() { return reinterpret_cast<T*>(-1); }
- static inline T* getTombstoneKey() { return reinterpret_cast<T*>(-2); }
- static unsigned getHashValue(const T *PtrVal) {
- return (unsigned((uintptr_t)PtrVal) >> 4) ^
- (unsigned((uintptr_t)PtrVal) >> 9);
- }
- static bool isEqual(const T *LHS, const T *RHS) { return LHS == RHS; }
- static bool isPod() { return true; }
-};
-
-template<typename KeyT, typename ValueT,
- typename KeyInfoT = DenseMapInfo<KeyT>,
- typename ValueInfoT = DenseMapInfo<ValueT> >
-class DenseMapIterator;
-template<typename KeyT, typename ValueT,
- typename KeyInfoT = DenseMapInfo<KeyT>,
- typename ValueInfoT = DenseMapInfo<ValueT> >
-class DenseMapConstIterator;
-
-template<typename KeyT, typename ValueT,
- typename KeyInfoT = DenseMapInfo<KeyT>,
- typename ValueInfoT = DenseMapInfo<ValueT> >
-class DenseMap {
- typedef std::pair<KeyT, ValueT> BucketT;
- unsigned NumBuckets;
- BucketT *Buckets;
-
- unsigned NumEntries;
- unsigned NumTombstones;
-public:
- typedef BucketT value_type;
-
- DenseMap(const DenseMap& other) {
- NumBuckets = 0;
- CopyFrom(other);
- }
-
- explicit DenseMap(unsigned NumInitBuckets = 64) {
- init(NumInitBuckets);
- }
-
- ~DenseMap() {
- const KeyT EmptyKey = getEmptyKey(), TombstoneKey = getTombstoneKey();
- for (BucketT *P = Buckets, *E = Buckets+NumBuckets; P != E; ++P) {
- if (!KeyInfoT::isEqual(P->first, EmptyKey) &&
- !KeyInfoT::isEqual(P->first, TombstoneKey))
- P->second.~ValueT();
- P->first.~KeyT();
- }
- delete[] reinterpret_cast<char*>(Buckets);
- }
-
- typedef DenseMapIterator<KeyT, ValueT, KeyInfoT> iterator;
- typedef DenseMapConstIterator<KeyT, ValueT, KeyInfoT> const_iterator;
- inline iterator begin() {
- return iterator(Buckets, Buckets+NumBuckets);
- }
- inline iterator end() {
- return iterator(Buckets+NumBuckets, Buckets+NumBuckets);
- }
- inline const_iterator begin() const {
- return const_iterator(Buckets, Buckets+NumBuckets);
- }
- inline const_iterator end() const {
- return const_iterator(Buckets+NumBuckets, Buckets+NumBuckets);
- }
-
- bool empty() const { return NumEntries == 0; }
- unsigned size() const { return NumEntries; }
-
- /// Grow the densemap so that it has at least Size buckets. Does not shrink
- void resize(size_t Size) { grow(Size); }
-
- void clear() {
- // If the capacity of the array is huge, and the # elements used is small,
- // shrink the array.
- if (NumEntries * 4 < NumBuckets && NumBuckets > 64) {
- shrink_and_clear();
- return;
- }
-
- const KeyT EmptyKey = getEmptyKey(), TombstoneKey = getTombstoneKey();
- for (BucketT *P = Buckets, *E = Buckets+NumBuckets; P != E; ++P) {
- if (!KeyInfoT::isEqual(P->first, EmptyKey)) {
- if (!KeyInfoT::isEqual(P->first, TombstoneKey)) {
- P->second.~ValueT();
- --NumEntries;
- }
- P->first = EmptyKey;
- }
- }
- assert(NumEntries == 0 && "Node count imbalance!");
- NumTombstones = 0;
- }
-
- /// count - Return true if the specified key is in the map.
- bool count(const KeyT &Val) const {
- BucketT *TheBucket;
- return LookupBucketFor(Val, TheBucket);
- }
-
- iterator find(const KeyT &Val) {
- BucketT *TheBucket;
- if (LookupBucketFor(Val, TheBucket))
- return iterator(TheBucket, Buckets+NumBuckets);
- return end();
- }
- const_iterator find(const KeyT &Val) const {
- BucketT *TheBucket;
- if (LookupBucketFor(Val, TheBucket))
- return const_iterator(TheBucket, Buckets+NumBuckets);
- return end();
- }
-
- bool insert(const std::pair<KeyT, ValueT> &KV) {
- BucketT *TheBucket;
- if (LookupBucketFor(KV.first, TheBucket))
- return false; // Already in map.
-
- // Otherwise, insert the new element.
- InsertIntoBucket(KV.first, KV.second, TheBucket);
- return true;
- }
-
- bool erase(const KeyT &Val) {
- BucketT *TheBucket;
- if (!LookupBucketFor(Val, TheBucket))
- return false; // not in map.
-
- TheBucket->second.~ValueT();
- TheBucket->first = getTombstoneKey();
- --NumEntries;
- ++NumTombstones;
- return true;
- }
- bool erase(iterator I) {
- BucketT *TheBucket = &*I;
- TheBucket->second.~ValueT();
- TheBucket->first = getTombstoneKey();
- --NumEntries;
- ++NumTombstones;
- return true;
- }
-
- value_type& FindAndConstruct(const KeyT &Key) {
- BucketT *TheBucket;
- if (LookupBucketFor(Key, TheBucket))
- return *TheBucket;
-
- return *InsertIntoBucket(Key, ValueT(), TheBucket);
- }
-
- ValueT &operator[](const KeyT &Key) {
- return FindAndConstruct(Key).second;
- }
-
- DenseMap& operator=(const DenseMap& other) {
- CopyFrom(other);
- return *this;
- }
-
-private:
- void CopyFrom(const DenseMap& other) {
- if (NumBuckets != 0 && (!KeyInfoT::isPod() || !ValueInfoT::isPod())) {
- const KeyT EmptyKey = getEmptyKey(), TombstoneKey = getTombstoneKey();
- for (BucketT *P = Buckets, *E = Buckets+NumBuckets; P != E; ++P) {
- if (!KeyInfoT::isEqual(P->first, EmptyKey) &&
- !KeyInfoT::isEqual(P->first, TombstoneKey))
- P->second.~ValueT();
- P->first.~KeyT();
- }
- }
-
- NumEntries = other.NumEntries;
- NumTombstones = other.NumTombstones;
-
- if (NumBuckets)
- delete[] reinterpret_cast<char*>(Buckets);
- Buckets = reinterpret_cast<BucketT*>(new char[sizeof(BucketT) *
- other.NumBuckets]);
-
- if (KeyInfoT::isPod() && ValueInfoT::isPod())
- memcpy(Buckets, other.Buckets, other.NumBuckets * sizeof(BucketT));
- else
- for (size_t i = 0; i < other.NumBuckets; ++i) {
- new (Buckets[i].first) KeyT(other.Buckets[i].first);
- if (!KeyInfoT::isEqual(Buckets[i].first, getEmptyKey()) &&
- !KeyInfoT::isEqual(Buckets[i].first, getTombstoneKey()))
- new (&Buckets[i].second) ValueT(other.Buckets[i].second);
- }
- NumBuckets = other.NumBuckets;
- }
-
- BucketT *InsertIntoBucket(const KeyT &Key, const ValueT &Value,
- BucketT *TheBucket) {
- // If the load of the hash table is more than 3/4, or if fewer than 1/8 of
- // the buckets are empty (meaning that many are filled with tombstones),
- // grow the table.
- //
- // The later case is tricky. For example, if we had one empty bucket with
- // tons of tombstones, failing lookups (e.g. for insertion) would have to
- // probe almost the entire table until it found the empty bucket. If the
- // table completely filled with tombstones, no lookup would ever succeed,
- // causing infinite loops in lookup.
- if (NumEntries*4 >= NumBuckets*3 ||
- NumBuckets-(NumEntries+NumTombstones) < NumBuckets/8) {
- this->grow(NumBuckets * 2);
- LookupBucketFor(Key, TheBucket);
- }
- ++NumEntries;
-
- // If we are writing over a tombstone, remember this.
- if (!KeyInfoT::isEqual(TheBucket->first, getEmptyKey()))
- --NumTombstones;
-
- TheBucket->first = Key;
- new (&TheBucket->second) ValueT(Value);
- return TheBucket;
- }
-
- static unsigned getHashValue(const KeyT &Val) {
- return KeyInfoT::getHashValue(Val);
- }
- static const KeyT getEmptyKey() {
- return KeyInfoT::getEmptyKey();
- }
- static const KeyT getTombstoneKey() {
- return KeyInfoT::getTombstoneKey();
- }
-
- /// LookupBucketFor - Lookup the appropriate bucket for Val, returning it in
- /// FoundBucket. If the bucket contains the key and a value, this returns
- /// true, otherwise it returns a bucket with an empty marker or tombstone and
- /// returns false.
- bool LookupBucketFor(const KeyT &Val, BucketT *&FoundBucket) const {
- unsigned BucketNo = getHashValue(Val);
- unsigned ProbeAmt = 1;
- BucketT *BucketsPtr = Buckets;
-
- // FoundTombstone - Keep track of whether we find a tombstone while probing.
- BucketT *FoundTombstone = 0;
- const KeyT EmptyKey = getEmptyKey();
- const KeyT TombstoneKey = getTombstoneKey();
- assert(!KeyInfoT::isEqual(Val, EmptyKey) &&
- !KeyInfoT::isEqual(Val, TombstoneKey) &&
- "Empty/Tombstone value shouldn't be inserted into map!");
-
- while (1) {
- BucketT *ThisBucket = BucketsPtr + (BucketNo & (NumBuckets-1));
- // Found Val's bucket? If so, return it.
- if (KeyInfoT::isEqual(ThisBucket->first, Val)) {
- FoundBucket = ThisBucket;
- return true;
- }
-
- // If we found an empty bucket, the key doesn't exist in the set.
- // Insert it and return the default value.
- if (KeyInfoT::isEqual(ThisBucket->first, EmptyKey)) {
- // If we've already seen a tombstone while probing, fill it in instead
- // of the empty bucket we eventually probed to.
- if (FoundTombstone) ThisBucket = FoundTombstone;
- FoundBucket = FoundTombstone ? FoundTombstone : ThisBucket;
- return false;
- }
-
- // If this is a tombstone, remember it. If Val ends up not in the map, we
- // prefer to return it than something that would require more probing.
- if (KeyInfoT::isEqual(ThisBucket->first, TombstoneKey) && !FoundTombstone)
- FoundTombstone = ThisBucket; // Remember the first tombstone found.
-
- // Otherwise, it's a hash collision or a tombstone, continue quadratic
- // probing.
- BucketNo += ProbeAmt++;
- }
- }
-
- void init(unsigned InitBuckets) {
- NumEntries = 0;
- NumTombstones = 0;
- NumBuckets = InitBuckets;
- assert(InitBuckets && (InitBuckets & (InitBuckets-1)) == 0 &&
- "# initial buckets must be a power of two!");
- Buckets = reinterpret_cast<BucketT*>(new char[sizeof(BucketT)*InitBuckets]);
- // Initialize all the keys to EmptyKey.
- const KeyT EmptyKey = getEmptyKey();
- for (unsigned i = 0; i != InitBuckets; ++i)
- new (&Buckets[i].first) KeyT(EmptyKey);
- }
-
- void grow(unsigned AtLeast) {
- unsigned OldNumBuckets = NumBuckets;
- BucketT *OldBuckets = Buckets;
-
- // Double the number of buckets.
- while (NumBuckets <= AtLeast)
- NumBuckets <<= 1;
- NumTombstones = 0;
- Buckets = reinterpret_cast<BucketT*>(new char[sizeof(BucketT)*NumBuckets]);
-
- // Initialize all the keys to EmptyKey.
- const KeyT EmptyKey = getEmptyKey();
- for (unsigned i = 0, e = NumBuckets; i != e; ++i)
- new (&Buckets[i].first) KeyT(EmptyKey);
-
- // Insert all the old elements.
- const KeyT TombstoneKey = getTombstoneKey();
- for (BucketT *B = OldBuckets, *E = OldBuckets+OldNumBuckets; B != E; ++B) {
- if (!KeyInfoT::isEqual(B->first, EmptyKey) &&
- !KeyInfoT::isEqual(B->first, TombstoneKey)) {
- // Insert the key/value into the new table.
- BucketT *DestBucket;
- bool FoundVal = LookupBucketFor(B->first, DestBucket);
- FoundVal = FoundVal; // silence warning.
- assert(!FoundVal && "Key already in new map?");
- DestBucket->first = B->first;
- new (&DestBucket->second) ValueT(B->second);
-
- // Free the value.
- B->second.~ValueT();
- }
- B->first.~KeyT();
- }
-
- // Free the old table.
- delete[] reinterpret_cast<char*>(OldBuckets);
- }
-
- void shrink_and_clear() {
- unsigned OldNumBuckets = NumBuckets;
- BucketT *OldBuckets = Buckets;
-
- // Reduce the number of buckets.
- NumBuckets = NumEntries > 32 ? 1 << (Log2_32_Ceil(NumEntries) + 1)
- : 64;
- NumTombstones = 0;
- Buckets = reinterpret_cast<BucketT*>(new char[sizeof(BucketT)*NumBuckets]);
-
- // Initialize all the keys to EmptyKey.
- const KeyT EmptyKey = getEmptyKey();
- for (unsigned i = 0, e = NumBuckets; i != e; ++i)
- new (&Buckets[i].first) KeyT(EmptyKey);
-
- // Free the old buckets.
- const KeyT TombstoneKey = getTombstoneKey();
- for (BucketT *B = OldBuckets, *E = OldBuckets+OldNumBuckets; B != E; ++B) {
- if (!KeyInfoT::isEqual(B->first, EmptyKey) &&
- !KeyInfoT::isEqual(B->first, TombstoneKey)) {
- // Free the value.
- B->second.~ValueT();
- }
- B->first.~KeyT();
- }
-
- // Free the old table.
- delete[] reinterpret_cast<char*>(OldBuckets);
-
- NumEntries = 0;
- }
-};
-
-template<typename KeyT, typename ValueT, typename KeyInfoT, typename ValueInfoT>
-class DenseMapIterator {
- typedef std::pair<KeyT, ValueT> BucketT;
-protected:
- const BucketT *Ptr, *End;
-public:
- DenseMapIterator(const BucketT *Pos, const BucketT *E) : Ptr(Pos), End(E) {
- AdvancePastEmptyBuckets();
- }
-
- std::pair<KeyT, ValueT> &operator*() const {
- return *const_cast<BucketT*>(Ptr);
- }
- std::pair<KeyT, ValueT> *operator->() const {
- return const_cast<BucketT*>(Ptr);
- }
-
- bool operator==(const DenseMapIterator &RHS) const {
- return Ptr == RHS.Ptr;
- }
- bool operator!=(const DenseMapIterator &RHS) const {
- return Ptr != RHS.Ptr;
- }
-
- inline DenseMapIterator& operator++() { // Preincrement
- ++Ptr;
- AdvancePastEmptyBuckets();
- return *this;
- }
- DenseMapIterator operator++(int) { // Postincrement
- DenseMapIterator tmp = *this; ++*this; return tmp;
- }
-
-private:
- void AdvancePastEmptyBuckets() {
- const KeyT Empty = KeyInfoT::getEmptyKey();
- const KeyT Tombstone = KeyInfoT::getTombstoneKey();
-
- while (Ptr != End &&
- (KeyInfoT::isEqual(Ptr->first, Empty) ||
- KeyInfoT::isEqual(Ptr->first, Tombstone)))
- ++Ptr;
- }
-};
-
-template<typename KeyT, typename ValueT, typename KeyInfoT, typename ValueInfoT>
-class DenseMapConstIterator : public DenseMapIterator<KeyT, ValueT, KeyInfoT> {
-public:
- DenseMapConstIterator(const std::pair<KeyT, ValueT> *Pos,
- const std::pair<KeyT, ValueT> *E)
- : DenseMapIterator<KeyT, ValueT, KeyInfoT>(Pos, E) {
- }
- const std::pair<KeyT, ValueT> &operator*() const {
- return *this->Ptr;
- }
- const std::pair<KeyT, ValueT> *operator->() const {
- return this->Ptr;
- }
-};
-
-} // end namespace llvm
-
-#endif
diff --git a/release_23/include/llvm/ADT/DenseSet.h b/release_23/include/llvm/ADT/DenseSet.h
deleted file mode 100644
index f1510a9a2039..000000000000
--- a/release_23/include/llvm/ADT/DenseSet.h
+++ /dev/null
@@ -1,97 +0,0 @@
-//===- llvm/ADT/DenseSet.h - Dense probed hash table ------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines the DenseSet class.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_ADT_DENSESET_H
-#define LLVM_ADT_DENSESET_H
-
-#include "llvm/ADT/DenseMap.h"
-
-namespace llvm {
-
-/// DenseSet - This implements a dense probed hash-table based set.
-///
-/// FIXME: This is currently implemented directly in terms of DenseMap, this
-/// should be optimized later if there is a need.
-template<typename ValueT, typename ValueInfoT = DenseMapInfo<ValueT> >
-class DenseSet {
- typedef DenseMap<ValueT, char, ValueInfoT> MapTy;
- MapTy TheMap;
-public:
- DenseSet(const DenseSet &Other) : TheMap(Other.TheMap) {}
- explicit DenseSet(unsigned NumInitBuckets = 64) : TheMap(NumInitBuckets) {}
-
- bool empty() const { return TheMap.empty(); }
- unsigned size() const { return TheMap.size(); }
-
- void clear() {
- TheMap.clear();
- }
-
- bool count(const ValueT &V) const {
- return TheMap.count(V);
- }
-
- void insert(const ValueT &V) {
- TheMap[V] = 0;
- }
-
- void erase(const ValueT &V) {
- TheMap.erase(V);
- }
-
- DenseSet &operator=(const DenseSet &RHS) {
- TheMap = RHS.TheMap;
- return *this;
- }
-
- // Iterators.
-
- class Iterator {
- typename MapTy::iterator I;
- public:
- Iterator(const typename MapTy::iterator &i) : I(i) {}
-
- ValueT& operator*() { return I->first; }
- ValueT* operator->() { return &I->first; }
-
- Iterator& operator++() { ++I; return *this; };
- bool operator==(const Iterator& X) const { return I == X.I; }
- bool operator!=(const Iterator& X) const { return I != X.I; }
- };
-
- class ConstIterator {
- typename MapTy::const_iterator I;
- public:
- ConstIterator(const typename MapTy::const_iterator &i) : I(i) {}
-
- const ValueT& operator*() { return I->first; }
- const ValueT* operator->() { return &I->first; }
-
- ConstIterator& operator++() { ++I; return *this; };
- bool operator==(const ConstIterator& X) const { return I == X.I; }
- bool operator!=(const ConstIterator& X) const { return I != X.I; }
- };
-
- typedef Iterator iterator;
- typedef ConstIterator const_iterator;
-
- iterator begin() { return Iterator(TheMap.begin()); }
- iterator end() { return Iterator(TheMap.end()); }
-
- const_iterator begin() const { return ConstIterator(TheMap.begin()); }
- const_iterator end() const { return ConstIterator(TheMap.end()); }
-};
-
-} // end namespace llvm
-
-#endif
diff --git a/release_23/include/llvm/ADT/DepthFirstIterator.h b/release_23/include/llvm/ADT/DepthFirstIterator.h
deleted file mode 100644
index 7dba378cf14a..000000000000
--- a/release_23/include/llvm/ADT/DepthFirstIterator.h
+++ /dev/null
@@ -1,236 +0,0 @@
-//===- llvm/ADT/DepthFirstIterator.h - Depth First iterator -----*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file builds on the ADT/GraphTraits.h file to build generic depth
-// first graph iterator. This file exposes the following functions/types:
-//
-// df_begin/df_end/df_iterator
-// * Normal depth-first iteration - visit a node and then all of its children.
-//
-// idf_begin/idf_end/idf_iterator
-// * Depth-first iteration on the 'inverse' graph.
-//
-// df_ext_begin/df_ext_end/df_ext_iterator
-// * Normal depth-first iteration - visit a node and then all of its children.
-// This iterator stores the 'visited' set in an external set, which allows
-// it to be more efficient, and allows external clients to use the set for
-// other purposes.
-//
-// idf_ext_begin/idf_ext_end/idf_ext_iterator
-// * Depth-first iteration on the 'inverse' graph.
-// This iterator stores the 'visited' set in an external set, which allows
-// it to be more efficient, and allows external clients to use the set for
-// other purposes.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_ADT_DEPTHFIRSTITERATOR_H
-#define LLVM_ADT_DEPTHFIRSTITERATOR_H
-
-#include "llvm/ADT/GraphTraits.h"
-#include "llvm/ADT/iterator"
-#include "llvm/ADT/SmallPtrSet.h"
-#include <vector>
-#include <set>
-
-namespace llvm {
-
-// df_iterator_storage - A private class which is used to figure out where to
-// store the visited set.
-template<class SetType, bool External> // Non-external set
-class df_iterator_storage {
-public:
- SetType Visited;
-};
-
-template<class SetType>
-class df_iterator_storage<SetType, true> {
-public:
- df_iterator_storage(SetType &VSet) : Visited(VSet) {}
- df_iterator_storage(const df_iterator_storage &S) : Visited(S.Visited) {}
- SetType &Visited;
-};
-
-
-// Generic Depth First Iterator
-template<class GraphT,
-class SetType = llvm::SmallPtrSet<typename GraphTraits<GraphT>::NodeType*, 8>,
- bool ExtStorage = false, class GT = GraphTraits<GraphT> >
-class df_iterator : public forward_iterator<typename GT::NodeType, ptrdiff_t>,
- public df_iterator_storage<SetType, ExtStorage> {
- typedef forward_iterator<typename GT::NodeType, ptrdiff_t> super;
-
- typedef typename GT::NodeType NodeType;
- typedef typename GT::ChildIteratorType ChildItTy;
-
- // VisitStack - Used to maintain the ordering. Top = current block
- // First element is node pointer, second is the 'next child' to visit
- std::vector<std::pair<NodeType *, ChildItTy> > VisitStack;
-private:
- inline df_iterator(NodeType *Node) {
- this->Visited.insert(Node);
- VisitStack.push_back(std::make_pair(Node, GT::child_begin(Node)));
- }
- inline df_iterator() { /* End is when stack is empty */ }
-
- inline df_iterator(NodeType *Node, SetType &S)
- : df_iterator_storage<SetType, ExtStorage>(S) {
- if (!S.count(Node)) {
- this->Visited.insert(Node);
- VisitStack.push_back(std::make_pair(Node, GT::child_begin(Node)));
- }
- }
- inline df_iterator(SetType &S)
- : df_iterator_storage<SetType, ExtStorage>(S) {
- // End is when stack is empty
- }
-
-public:
- typedef typename super::pointer pointer;
- typedef df_iterator<GraphT, SetType, ExtStorage, GT> _Self;
-
- // Provide static begin and end methods as our public "constructors"
- static inline _Self begin(const GraphT& G) {
- return _Self(GT::getEntryNode(G));
- }
- static inline _Self end(const GraphT& G) { return _Self(); }
-
- // Static begin and end methods as our public ctors for external iterators
- static inline _Self begin(const GraphT& G, SetType &S) {
- return _Self(GT::getEntryNode(G), S);
- }
- static inline _Self end(const GraphT& G, SetType &S) { return _Self(S); }
-
- inline bool operator==(const _Self& x) const {
- return VisitStack.size() == x.VisitStack.size() &&
- VisitStack == x.VisitStack;
- }
- inline bool operator!=(const _Self& x) const { return !operator==(x); }
-
- inline pointer operator*() const {
- return VisitStack.back().first;
- }
-
- // This is a nonstandard operator-> that dereferences the pointer an extra
- // time... so that you can actually call methods ON the Node, because
- // the contained type is a pointer. This allows BBIt->getTerminator() f.e.
- //
- inline NodeType *operator->() const { return operator*(); }
-
- inline _Self& operator++() { // Preincrement
- do {
- std::pair<NodeType *, ChildItTy> &Top = VisitStack.back();
- NodeType *Node = Top.first;
- ChildItTy &It = Top.second;
-
- while (It != GT::child_end(Node)) {
- NodeType *Next = *It++;
- if (!this->Visited.count(Next)) { // Has our next sibling been visited?
- // No, do it now.
- this->Visited.insert(Next);
- VisitStack.push_back(std::make_pair(Next, GT::child_begin(Next)));
- return *this;
- }
- }
-
- // Oops, ran out of successors... go up a level on the stack.
- VisitStack.pop_back();
- } while (!VisitStack.empty());
- return *this;
- }
-
- inline _Self operator++(int) { // Postincrement
- _Self tmp = *this; ++*this; return tmp;
- }
-
- // nodeVisited - return true if this iterator has already visited the
- // specified node. This is public, and will probably be used to iterate over
- // nodes that a depth first iteration did not find: ie unreachable nodes.
- //
- inline bool nodeVisited(NodeType *Node) const {
- return this->Visited.count(Node) != 0;
- }
-};
-
-
-// Provide global constructors that automatically figure out correct types...
-//
-template <class T>
-df_iterator<T> df_begin(const T& G) {
- return df_iterator<T>::begin(G);
-}
-
-template <class T>
-df_iterator<T> df_end(const T& G) {
- return df_iterator<T>::end(G);
-}
-
-// Provide global definitions of external depth first iterators...
-template <class T, class SetTy = std::set<typename GraphTraits<T>::NodeType*> >
-struct df_ext_iterator : public df_iterator<T, SetTy, true> {
- df_ext_iterator(const df_iterator<T, SetTy, true> &V)
- : df_iterator<T, SetTy, true>(V) {}
-};
-
-template <class T, class SetTy>
-df_ext_iterator<T, SetTy> df_ext_begin(const T& G, SetTy &S) {
- return df_ext_iterator<T, SetTy>::begin(G, S);
-}
-
-template <class T, class SetTy>
-df_ext_iterator<T, SetTy> df_ext_end(const T& G, SetTy &S) {
- return df_ext_iterator<T, SetTy>::end(G, S);
-}
-
-
-// Provide global definitions of inverse depth first iterators...
-template <class T,
- class SetTy = llvm::SmallPtrSet<typename GraphTraits<T>::NodeType*, 8>,
- bool External = false>
-struct idf_iterator : public df_iterator<Inverse<T>, SetTy, External> {
- idf_iterator(const df_iterator<Inverse<T>, SetTy, External> &V)
- : df_iterator<Inverse<T>, SetTy, External>(V) {}
-};
-
-template <class T>
-idf_iterator<T> idf_begin(const T& G) {
- Inverse<T> DummyG;
- return idf_iterator<T>::begin(DummyG);
-}
-
-template <class T>
-idf_iterator<T> idf_end(const T& G){
- Inverse<T> DummyG;
- return idf_iterator<T>::end(DummyG);
-}
-
-// Provide global definitions of external inverse depth first iterators...
-template <class T, class SetTy = std::set<typename GraphTraits<T>::NodeType*> >
-struct idf_ext_iterator : public idf_iterator<T, SetTy, true> {
- idf_ext_iterator(const idf_iterator<T, SetTy, true> &V)
- : idf_iterator<T, SetTy, true>(V) {}
- idf_ext_iterator(const df_iterator<Inverse<T>, SetTy, true> &V)
- : idf_iterator<T, SetTy, true>(V) {}
-};
-
-template <class T, class SetTy>
-idf_ext_iterator<T, SetTy> idf_ext_begin(const T& G, SetTy &S) {
- Inverse<T> DummyG(G);
- return idf_ext_iterator<T, SetTy>::begin(DummyG, S);
-}
-
-template <class T, class SetTy>
-idf_ext_iterator<T, SetTy> idf_ext_end(const T& G, SetTy &S) {
- Inverse<T> DummyG(G);
- return idf_ext_iterator<T, SetTy>::end(DummyG, S);
-}
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/ADT/EquivalenceClasses.h b/release_23/include/llvm/ADT/EquivalenceClasses.h
deleted file mode 100644
index 28aacfeccfc1..000000000000
--- a/release_23/include/llvm/ADT/EquivalenceClasses.h
+++ /dev/null
@@ -1,279 +0,0 @@
-//===-- llvm/ADT/EquivalenceClasses.h - Generic Equiv. Classes --*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// Generic implementation of equivalence classes through the use Tarjan's
-// efficient union-find algorithm.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_ADT_EQUIVALENCECLASSES_H
-#define LLVM_ADT_EQUIVALENCECLASSES_H
-
-#include "llvm/ADT/iterator"
-#include "llvm/Support/DataTypes.h"
-#include <set>
-
-namespace llvm {
-
-/// EquivalenceClasses - This represents a collection of equivalence classes and
-/// supports three efficient operations: insert an element into a class of its
-/// own, union two classes, and find the class for a given element. In
-/// addition to these modification methods, it is possible to iterate over all
-/// of the equivalence classes and all of the elements in a class.
-///
-/// This implementation is an efficient implementation that only stores one copy
-/// of the element being indexed per entry in the set, and allows any arbitrary
-/// type to be indexed (as long as it can be ordered with operator<).
-///
-/// Here is a simple example using integers:
-///
-/// EquivalenceClasses<int> EC;
-/// EC.unionSets(1, 2); // insert 1, 2 into the same set
-/// EC.insert(4); EC.insert(5); // insert 4, 5 into own sets
-/// EC.unionSets(5, 1); // merge the set for 1 with 5's set.
-///
-/// for (EquivalenceClasses<int>::iterator I = EC.begin(), E = EC.end();
-/// I != E; ++I) { // Iterate over all of the equivalence sets.
-/// if (!I->isLeader()) continue; // Ignore non-leader sets.
-/// for (EquivalenceClasses<int>::member_iterator MI = EC.member_begin(I);
-/// MI != EC.member_end(); ++MI) // Loop over members in this set.
-/// cerr << *MI << " "; // Print member.
-/// cerr << "\n"; // Finish set.
-/// }
-///
-/// This example prints:
-/// 4
-/// 5 1 2
-///
-template <class ElemTy>
-class EquivalenceClasses {
- /// ECValue - The EquivalenceClasses data structure is just a set of these.
- /// Each of these represents a relation for a value. First it stores the
- /// value itself, which provides the ordering that the set queries. Next, it
- /// provides a "next pointer", which is used to enumerate all of the elements
- /// in the unioned set. Finally, it defines either a "end of list pointer" or
- /// "leader pointer" depending on whether the value itself is a leader. A
- /// "leader pointer" points to the node that is the leader for this element,
- /// if the node is not a leader. A "end of list pointer" points to the last
- /// node in the list of members of this list. Whether or not a node is a
- /// leader is determined by a bit stolen from one of the pointers.
- class ECValue {
- friend class EquivalenceClasses;
- mutable const ECValue *Leader, *Next;
- ElemTy Data;
- // ECValue ctor - Start out with EndOfList pointing to this node, Next is
- // Null, isLeader = true.
- ECValue(const ElemTy &Elt)
- : Leader(this), Next((ECValue*)(intptr_t)1), Data(Elt) {}
-
- const ECValue *getLeader() const {
- if (isLeader()) return this;
- if (Leader->isLeader()) return Leader;
- // Path compression.
- return Leader = Leader->getLeader();
- }
- const ECValue *getEndOfList() const {
- assert(isLeader() && "Cannot get the end of a list for a non-leader!");
- return Leader;
- }
-
- void setNext(const ECValue *NewNext) const {
- assert(getNext() == 0 && "Already has a next pointer!");
- Next = (const ECValue*)((intptr_t)NewNext | (intptr_t)isLeader());
- }
- public:
- ECValue(const ECValue &RHS) : Leader(this), Next((ECValue*)(intptr_t)1),
- Data(RHS.Data) {
- // Only support copying of singleton nodes.
- assert(RHS.isLeader() && RHS.getNext() == 0 && "Not a singleton!");
- }
-
- bool operator<(const ECValue &UFN) const { return Data < UFN.Data; }
-
- bool isLeader() const { return (intptr_t)Next & 1; }
- const ElemTy &getData() const { return Data; }
-
- const ECValue *getNext() const {
- return (ECValue*)((intptr_t)Next & ~(intptr_t)1);
- }
-
- template<typename T>
- bool operator<(const T &Val) const { return Data < Val; }
- };
-
- /// TheMapping - This implicitly provides a mapping from ElemTy values to the
- /// ECValues, it just keeps the key as part of the value.
- std::set<ECValue> TheMapping;
-
-public:
- EquivalenceClasses() {}
- EquivalenceClasses(const EquivalenceClasses &RHS) {
- operator=(RHS);
- }
-
- const EquivalenceClasses &operator=(const EquivalenceClasses &RHS) {
- TheMapping.clear();
- for (iterator I = RHS.begin(), E = RHS.end(); I != E; ++I)
- if (I->isLeader()) {
- member_iterator MI = RHS.member_begin(I);
- member_iterator LeaderIt = member_begin(insert(*MI));
- for (++MI; MI != member_end(); ++MI)
- unionSets(LeaderIt, member_begin(insert(*MI)));
- }
- return *this;
- }
-
- //===--------------------------------------------------------------------===//
- // Inspection methods
- //
-
- /// iterator* - Provides a way to iterate over all values in the set.
- typedef typename std::set<ECValue>::const_iterator iterator;
- iterator begin() const { return TheMapping.begin(); }
- iterator end() const { return TheMapping.end(); }
-
- bool empty() const { return TheMapping.empty(); }
-
- /// member_* Iterate over the members of an equivalence class.
- ///
- class member_iterator;
- member_iterator member_begin(iterator I) const {
- // Only leaders provide anything to iterate over.
- return member_iterator(I->isLeader() ? &*I : 0);
- }
- member_iterator member_end() const {
- return member_iterator(0);
- }
-
- /// findValue - Return an iterator to the specified value. If it does not
- /// exist, end() is returned.
- iterator findValue(const ElemTy &V) const {
- return TheMapping.find(V);
- }
-
- /// getLeaderValue - Return the leader for the specified value that is in the
- /// set. It is an error to call this method for a value that is not yet in
- /// the set. For that, call getOrInsertLeaderValue(V).
- const ElemTy &getLeaderValue(const ElemTy &V) const {
- member_iterator MI = findLeader(V);
- assert(MI != member_end() && "Value is not in the set!");
- return *MI;
- }
-
- /// getOrInsertLeaderValue - Return the leader for the specified value that is
- /// in the set. If the member is not in the set, it is inserted, then
- /// returned.
- const ElemTy &getOrInsertLeaderValue(const ElemTy &V) const {
- member_iterator MI = findLeader(insert(V));
- assert(MI != member_end() && "Value is not in the set!");
- return *MI;
- }
-
- /// getNumClasses - Return the number of equivalence classes in this set.
- /// Note that this is a linear time operation.
- unsigned getNumClasses() const {
- unsigned NC = 0;
- for (iterator I = begin(), E = end(); I != E; ++I)
- if (I->isLeader()) ++NC;
- return NC;
- }
-
-
- //===--------------------------------------------------------------------===//
- // Mutation methods
-
- /// insert - Insert a new value into the union/find set, ignoring the request
- /// if the value already exists.
- iterator insert(const ElemTy &Data) {
- return TheMapping.insert(Data).first;
- }
-
- /// findLeader - Given a value in the set, return a member iterator for the
- /// equivalence class it is in. This does the path-compression part that
- /// makes union-find "union findy". This returns an end iterator if the value
- /// is not in the equivalence class.
- ///
- member_iterator findLeader(iterator I) const {
- if (I == TheMapping.end()) return member_end();
- return member_iterator(I->getLeader());
- }
- member_iterator findLeader(const ElemTy &V) const {
- return findLeader(TheMapping.find(V));
- }
-
-
- /// union - Merge the two equivalence sets for the specified values, inserting
- /// them if they do not already exist in the equivalence set.
- member_iterator unionSets(const ElemTy &V1, const ElemTy &V2) {
- iterator V1I = insert(V1), V2I = insert(V2);
- return unionSets(findLeader(V1I), findLeader(V2I));
- }
- member_iterator unionSets(member_iterator L1, member_iterator L2) {
- assert(L1 != member_end() && L2 != member_end() && "Illegal inputs!");
- if (L1 == L2) return L1; // Unifying the same two sets, noop.
-
- // Otherwise, this is a real union operation. Set the end of the L1 list to
- // point to the L2 leader node.
- const ECValue &L1LV = *L1.Node, &L2LV = *L2.Node;
- L1LV.getEndOfList()->setNext(&L2LV);
-
- // Update L1LV's end of list pointer.
- L1LV.Leader = L2LV.getEndOfList();
-
- // Clear L2's leader flag:
- L2LV.Next = L2LV.getNext();
-
- // L2's leader is now L1.
- L2LV.Leader = &L1LV;
- return L1;
- }
-
- class member_iterator : public forward_iterator<ElemTy, ptrdiff_t> {
- typedef forward_iterator<const ElemTy, ptrdiff_t> super;
- const ECValue *Node;
- friend class EquivalenceClasses;
- public:
- typedef size_t size_type;
- typedef typename super::pointer pointer;
- typedef typename super::reference reference;
-
- explicit member_iterator() {}
- explicit member_iterator(const ECValue *N) : Node(N) {}
- member_iterator(const member_iterator &I) : Node(I.Node) {}
-
- reference operator*() const {
- assert(Node != 0 && "Dereferencing end()!");
- return Node->getData();
- }
- reference operator->() const { return operator*(); }
-
- member_iterator &operator++() {
- assert(Node != 0 && "++'d off the end of the list!");
- Node = Node->getNext();
- return *this;
- }
-
- member_iterator operator++(int) { // postincrement operators.
- member_iterator tmp = *this;
- ++*this;
- return tmp;
- }
-
- bool operator==(const member_iterator &RHS) const {
- return Node == RHS.Node;
- }
- bool operator!=(const member_iterator &RHS) const {
- return Node != RHS.Node;
- }
- };
-};
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/ADT/FoldingSet.h b/release_23/include/llvm/ADT/FoldingSet.h
deleted file mode 100644
index c6696b303444..000000000000
--- a/release_23/include/llvm/ADT/FoldingSet.h
+++ /dev/null
@@ -1,435 +0,0 @@
-//===-- llvm/ADT/FoldingSet.h - Uniquing Hash Set ---------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines a hash set that can be used to remove duplication of nodes
-// in a graph. This code was originally created by Chris Lattner for use with
-// SelectionDAGCSEMap, but was isolated to provide use across the llvm code set.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_ADT_FOLDINGSET_H
-#define LLVM_ADT_FOLDINGSET_H
-
-#include "llvm/Support/DataTypes.h"
-#include "llvm/ADT/SmallVector.h"
-#include <string>
-
-namespace llvm {
- class APFloat;
- class APInt;
-
-/// This folding set used for two purposes:
-/// 1. Given information about a node we want to create, look up the unique
-/// instance of the node in the set. If the node already exists, return
-/// it, otherwise return the bucket it should be inserted into.
-/// 2. Given a node that has already been created, remove it from the set.
-///
-/// This class is implemented as a single-link chained hash table, where the
-/// "buckets" are actually the nodes themselves (the next pointer is in the
-/// node). The last node points back to the bucket to simplify node removal.
-///
-/// Any node that is to be included in the folding set must be a subclass of
-/// FoldingSetNode. The node class must also define a Profile method used to
-/// establish the unique bits of data for the node. The Profile method is
-/// passed a FoldingSetNodeID object which is used to gather the bits. Just
-/// call one of the Add* functions defined in the FoldingSetImpl::NodeID class.
-/// NOTE: That the folding set does not own the nodes and it is the
-/// responsibility of the user to dispose of the nodes.
-///
-/// Eg.
-/// class MyNode : public FoldingSetNode {
-/// private:
-/// std::string Name;
-/// unsigned Value;
-/// public:
-/// MyNode(const char *N, unsigned V) : Name(N), Value(V) {}
-/// ...
-/// void Profile(FoldingSetNodeID &ID) {
-/// ID.AddString(Name);
-/// ID.AddInteger(Value);
-/// }
-/// ...
-/// };
-///
-/// To define the folding set itself use the FoldingSet template;
-///
-/// Eg.
-/// FoldingSet<MyNode> MyFoldingSet;
-///
-/// Four public methods are available to manipulate the folding set;
-///
-/// 1) If you have an existing node that you want add to the set but unsure
-/// that the node might already exist then call;
-///
-/// MyNode *M = MyFoldingSet.GetOrInsertNode(N);
-///
-/// If The result is equal to the input then the node has been inserted.
-/// Otherwise, the result is the node existing in the folding set, and the
-/// input can be discarded (use the result instead.)
-///
-/// 2) If you are ready to construct a node but want to check if it already
-/// exists, then call FindNodeOrInsertPos with a FoldingSetNodeID of the bits to
-/// check;
-///
-/// FoldingSetNodeID ID;
-/// ID.AddString(Name);
-/// ID.AddInteger(Value);
-/// void *InsertPoint;
-///
-/// MyNode *M = MyFoldingSet.FindNodeOrInsertPos(ID, InsertPoint);
-///
-/// If found then M with be non-NULL, else InsertPoint will point to where it
-/// should be inserted using InsertNode.
-///
-/// 3) If you get a NULL result from FindNodeOrInsertPos then you can as a new
-/// node with FindNodeOrInsertPos;
-///
-/// InsertNode(N, InsertPoint);
-///
-/// 4) Finally, if you want to remove a node from the folding set call;
-///
-/// bool WasRemoved = RemoveNode(N);
-///
-/// The result indicates whether the node existed in the folding set.
-
-class FoldingSetNodeID;
-
-//===----------------------------------------------------------------------===//
-/// FoldingSetImpl - Implements the folding set functionality. The main
-/// structure is an array of buckets. Each bucket is indexed by the hash of
-/// the nodes it contains. The bucket itself points to the nodes contained
-/// in the bucket via a singly linked list. The last node in the list points
-/// back to the bucket to facilitate node removal.
-///
-class FoldingSetImpl {
-protected:
- /// Buckets - Array of bucket chains.
- ///
- void **Buckets;
-
- /// NumBuckets - Length of the Buckets array. Always a power of 2.
- ///
- unsigned NumBuckets;
-
- /// NumNodes - Number of nodes in the folding set. Growth occurs when NumNodes
- /// is greater than twice the number of buckets.
- unsigned NumNodes;
-
-public:
- explicit FoldingSetImpl(unsigned Log2InitSize = 6);
- virtual ~FoldingSetImpl();
-
- //===--------------------------------------------------------------------===//
- /// Node - This class is used to maintain the singly linked bucket list in
- /// a folding set.
- ///
- class Node {
- private:
- // NextInFoldingSetBucket - next link in the bucket list.
- void *NextInFoldingSetBucket;
-
- public:
-
- Node() : NextInFoldingSetBucket(0) {}
-
- // Accessors
- void *getNextInBucket() const { return NextInFoldingSetBucket; }
- void SetNextInBucket(void *N) { NextInFoldingSetBucket = N; }
- };
-
- /// RemoveNode - Remove a node from the folding set, returning true if one
- /// was removed or false if the node was not in the folding set.
- bool RemoveNode(Node *N);
-
- /// GetOrInsertNode - If there is an existing simple Node exactly
- /// equal to the specified node, return it. Otherwise, insert 'N' and return
- /// it instead.
- Node *GetOrInsertNode(Node *N);
-
- /// FindNodeOrInsertPos - Look up the node specified by ID. If it exists,
- /// return it. If not, return the insertion token that will make insertion
- /// faster.
- Node *FindNodeOrInsertPos(const FoldingSetNodeID &ID, void *&InsertPos);
-
- /// InsertNode - Insert the specified node into the folding set, knowing that
- /// it is not already in the folding set. InsertPos must be obtained from
- /// FindNodeOrInsertPos.
- void InsertNode(Node *N, void *InsertPos);
-
- /// size - Returns the number of nodes in the folding set.
- unsigned size() const { return NumNodes; }
-
-private:
-
- /// GrowHashTable - Double the size of the hash table and rehash everything.
- ///
- void GrowHashTable();
-
-protected:
-
- /// GetNodeProfile - Instantiations of the FoldingSet template implement
- /// this function to gather data bits for the given node.
- virtual void GetNodeProfile(FoldingSetNodeID &ID, Node *N) const = 0;
-};
-
-//===----------------------------------------------------------------------===//
-/// FoldingSetTrait - This trait class is used to define behavior of how
-/// to "profile" (in the FoldingSet parlance) an object of a given type.
-/// The default behavior is to invoke a 'Profile' method on an object, but
-/// through template specialization the behavior can be tailored for specific
-/// types. Combined with the FoldingSetNodeWrapper classs, one can add objects
-/// to FoldingSets that were not originally designed to have that behavior.
-///
-template<typename T> struct FoldingSetTrait {
- static inline void Profile(const T& X, FoldingSetNodeID& ID) { X.Profile(ID);}
- static inline void Profile(T& X, FoldingSetNodeID& ID) { X.Profile(ID); }
-};
-
-//===--------------------------------------------------------------------===//
-/// FoldingSetNodeID - This class is used to gather all the unique data bits of
-/// a node. When all the bits are gathered this class is used to produce a
-/// hash value for the node.
-///
-class FoldingSetNodeID {
- /// Bits - Vector of all the data bits that make the node unique.
- /// Use a SmallVector to avoid a heap allocation in the common case.
- SmallVector<unsigned, 32> Bits;
-
-public:
- FoldingSetNodeID() {}
-
- /// getRawData - Return the ith entry in the Bits data.
- ///
- unsigned getRawData(unsigned i) const {
- return Bits[i];
- }
-
- /// Add* - Add various data types to Bit data.
- ///
- void AddPointer(const void *Ptr);
- void AddInteger(signed I);
- void AddInteger(unsigned I);
- void AddInteger(int64_t I);
- void AddInteger(uint64_t I);
- void AddFloat(float F);
- void AddDouble(double D);
- void AddString(const std::string &String);
-
- template <typename T>
- inline void Add(const T& x) { FoldingSetTrait<T>::Profile(x, *this); }
-
- /// clear - Clear the accumulated profile, allowing this FoldingSetNodeID
- /// object to be used to compute a new profile.
- inline void clear() { Bits.clear(); }
-
- /// ComputeHash - Compute a strong hash value for this FoldingSetNodeID, used
- /// to lookup the node in the FoldingSetImpl.
- unsigned ComputeHash() const;
-
- /// operator== - Used to compare two nodes to each other.
- ///
- bool operator==(const FoldingSetNodeID &RHS) const;
-};
-
-// Convenience type to hide the implementation of the folding set.
-typedef FoldingSetImpl::Node FoldingSetNode;
-template<class T> class FoldingSetIterator;
-template<class T> class FoldingSetBucketIterator;
-
-//===----------------------------------------------------------------------===//
-/// FoldingSet - This template class is used to instantiate a specialized
-/// implementation of the folding set to the node class T. T must be a
-/// subclass of FoldingSetNode and implement a Profile function.
-///
-template<class T> class FoldingSet : public FoldingSetImpl {
-private:
- /// GetNodeProfile - Each instantiatation of the FoldingSet needs to provide a
- /// way to convert nodes into a unique specifier.
- virtual void GetNodeProfile(FoldingSetNodeID &ID, Node *N) const {
- T *TN = static_cast<T *>(N);
- FoldingSetTrait<T>::Profile(*TN,ID);
- }
-
-public:
- explicit FoldingSet(unsigned Log2InitSize = 6)
- : FoldingSetImpl(Log2InitSize)
- {}
-
- typedef FoldingSetIterator<T> iterator;
- iterator begin() { return iterator(Buckets); }
- iterator end() { return iterator(Buckets+NumBuckets); }
-
- typedef FoldingSetIterator<const T> const_iterator;
- const_iterator begin() const { return const_iterator(Buckets); }
- const_iterator end() const { return const_iterator(Buckets+NumBuckets); }
-
- typedef FoldingSetBucketIterator<T> bucket_iterator;
-
- bucket_iterator bucket_begin(unsigned hash) {
- return bucket_iterator(Buckets + (hash & (NumBuckets-1)));
- }
-
- bucket_iterator bucket_end(unsigned hash) {
- return bucket_iterator(Buckets + (hash & (NumBuckets-1)), true);
- }
-
- /// GetOrInsertNode - If there is an existing simple Node exactly
- /// equal to the specified node, return it. Otherwise, insert 'N' and
- /// return it instead.
- T *GetOrInsertNode(Node *N) {
- return static_cast<T *>(FoldingSetImpl::GetOrInsertNode(N));
- }
-
- /// FindNodeOrInsertPos - Look up the node specified by ID. If it exists,
- /// return it. If not, return the insertion token that will make insertion
- /// faster.
- T *FindNodeOrInsertPos(const FoldingSetNodeID &ID, void *&InsertPos) {
- return static_cast<T *>(FoldingSetImpl::FindNodeOrInsertPos(ID, InsertPos));
- }
-};
-
-//===----------------------------------------------------------------------===//
-/// FoldingSetIteratorImpl - This is the common iterator support shared by all
-/// folding sets, which knows how to walk the folding set hash table.
-class FoldingSetIteratorImpl {
-protected:
- FoldingSetNode *NodePtr;
- FoldingSetIteratorImpl(void **Bucket);
- void advance();
-
-public:
- bool operator==(const FoldingSetIteratorImpl &RHS) const {
- return NodePtr == RHS.NodePtr;
- }
- bool operator!=(const FoldingSetIteratorImpl &RHS) const {
- return NodePtr != RHS.NodePtr;
- }
-};
-
-
-template<class T>
-class FoldingSetIterator : public FoldingSetIteratorImpl {
-public:
- FoldingSetIterator(void **Bucket) : FoldingSetIteratorImpl(Bucket) {}
-
- T &operator*() const {
- return *static_cast<T*>(NodePtr);
- }
-
- T *operator->() const {
- return static_cast<T*>(NodePtr);
- }
-
- inline FoldingSetIterator& operator++() { // Preincrement
- advance();
- return *this;
- }
- FoldingSetIterator operator++(int) { // Postincrement
- FoldingSetIterator tmp = *this; ++*this; return tmp;
- }
-};
-
-//===----------------------------------------------------------------------===//
-/// FoldingSetBucketIteratorImpl - This is the common bucket iterator support
-/// shared by all folding sets, which knows how to walk a particular bucket
-/// of a folding set hash table.
-
-class FoldingSetBucketIteratorImpl {
-protected:
- void *Ptr;
-
- FoldingSetBucketIteratorImpl(void **Bucket);
-
- FoldingSetBucketIteratorImpl(void **Bucket, bool)
- : Ptr(reinterpret_cast<void*>(Bucket)) {}
-
- void advance() {
- void *Probe = static_cast<FoldingSetNode*>(Ptr)->getNextInBucket();
- uintptr_t x = reinterpret_cast<uintptr_t>(Probe) & ~0x1;
- Ptr = reinterpret_cast<void*>(x);
- }
-
-public:
- bool operator==(const FoldingSetBucketIteratorImpl &RHS) const {
- return Ptr == RHS.Ptr;
- }
- bool operator!=(const FoldingSetBucketIteratorImpl &RHS) const {
- return Ptr != RHS.Ptr;
- }
-};
-
-
-template<class T>
-class FoldingSetBucketIterator : public FoldingSetBucketIteratorImpl {
-public:
- FoldingSetBucketIterator(void **Bucket) :
- FoldingSetBucketIteratorImpl(Bucket) {}
-
- FoldingSetBucketIterator(void **Bucket, bool) :
- FoldingSetBucketIteratorImpl(Bucket, true) {}
-
- T& operator*() const { return *static_cast<T*>(Ptr); }
- T* operator->() const { return static_cast<T*>(Ptr); }
-
- inline FoldingSetBucketIterator& operator++() { // Preincrement
- advance();
- return *this;
- }
- FoldingSetBucketIterator operator++(int) { // Postincrement
- FoldingSetBucketIterator tmp = *this; ++*this; return tmp;
- }
-};
-
-//===----------------------------------------------------------------------===//
-/// FoldingSetNodeWrapper - This template class is used to "wrap" arbitrary
-/// types in an enclosing object so that they can be inserted into FoldingSets.
-template <typename T>
-class FoldingSetNodeWrapper : public FoldingSetNode {
- T data;
-public:
- FoldingSetNodeWrapper(const T& x) : data(x) {}
- virtual ~FoldingSetNodeWrapper() {}
-
- template<typename A1>
- explicit FoldingSetNodeWrapper(const A1& a1)
- : data(a1) {}
-
- template <typename A1, typename A2>
- explicit FoldingSetNodeWrapper(const A1& a1, const A2& a2)
- : data(a1,a2) {}
-
- template <typename A1, typename A2, typename A3>
- explicit FoldingSetNodeWrapper(const A1& a1, const A2& a2, const A3& a3)
- : data(a1,a2,a3) {}
-
- template <typename A1, typename A2, typename A3, typename A4>
- explicit FoldingSetNodeWrapper(const A1& a1, const A2& a2, const A3& a3,
- const A4& a4)
- : data(a1,a2,a3,a4) {}
-
- template <typename A1, typename A2, typename A3, typename A4, typename A5>
- explicit FoldingSetNodeWrapper(const A1& a1, const A2& a2, const A3& a3,
- const A4& a4, const A5& a5)
- : data(a1,a2,a3,a4,a5) {}
-
-
- void Profile(FoldingSetNodeID& ID) { FoldingSetTrait<T>::Profile(data, ID); }
-
- T& getValue() { return data; }
- const T& getValue() const { return data; }
-
- operator T&() { return data; }
- operator const T&() const { return data; }
-};
-
-} // End of namespace llvm.
-
-
-#endif
-
diff --git a/release_23/include/llvm/ADT/GraphTraits.h b/release_23/include/llvm/ADT/GraphTraits.h
deleted file mode 100644
index 566956dfeecc..000000000000
--- a/release_23/include/llvm/ADT/GraphTraits.h
+++ /dev/null
@@ -1,103 +0,0 @@
-//===-- llvm/ADT/GraphTraits.h - Graph traits template ----------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines the little GraphTraits<X> template class that should be
-// specialized by classes that want to be iteratable by generic graph iterators.
-//
-// This file also defines the marker class Inverse that is used to iterate over
-// graphs in a graph defined, inverse ordering...
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_ADT_GRAPHTRAITS_H
-#define LLVM_ADT_GRAPHTRAITS_H
-
-namespace llvm {
-
-// GraphTraits - This class should be specialized by different graph types...
-// which is why the default version is empty.
-//
-template<class GraphType>
-struct GraphTraits {
- // Elements to provide:
-
- // typedef NodeType - Type of Node in the graph
- // typedef ChildIteratorType - Type used to iterate over children in graph
-
- // static NodeType *getEntryNode(GraphType *)
- // Return the entry node of the graph
-
- // static ChildIteratorType child_begin(NodeType *)
- // static ChildIteratorType child_end (NodeType *)
- // Return iterators that point to the beginning and ending of the child
- // node list for the specified node.
- //
-
-
- // typedef ...iterator nodes_iterator;
- // static nodes_iterator nodes_begin(GraphType *G)
- // static nodes_iterator nodes_end (GraphType *G)
- //
- // nodes_iterator/begin/end - Allow iteration over all nodes in the graph
-
-
- // If anyone tries to use this class without having an appropriate
- // specialization, make an error. If you get this error, it's because you
- // need to include the appropriate specialization of GraphTraits<> for your
- // graph, or you need to define it for a new graph type. Either that or
- // your argument to XXX_begin(...) is unknown or needs to have the proper .h
- // file #include'd.
- //
- typedef typename GraphType::UnknownGraphTypeError NodeType;
-};
-
-
-// Inverse - This class is used as a little marker class to tell the graph
-// iterator to iterate over the graph in a graph defined "Inverse" ordering.
-// Not all graphs define an inverse ordering, and if they do, it depends on
-// the graph exactly what that is. Here's an example of usage with the
-// df_iterator:
-//
-// idf_iterator<Method*> I = idf_begin(M), E = idf_end(M);
-// for (; I != E; ++I) { ... }
-//
-// Which is equivalent to:
-// df_iterator<Inverse<Method*> > I = idf_begin(M), E = idf_end(M);
-// for (; I != E; ++I) { ... }
-//
-template <class GraphType>
-struct Inverse {
- const GraphType &Graph;
-
- inline Inverse(const GraphType &G) : Graph(G) {}
-};
-
-// Provide a partial specialization of GraphTraits so that the inverse of an inverse
-// falls back to the original graph.
-template<class T>
-struct GraphTraits<Inverse<Inverse<T> > > {
- typedef typename GraphTraits<T>::NodeType NodeType;
- typedef typename GraphTraits<T>::ChildIteratorType ChildIteratorType;
-
- static NodeType *getEntryNode(Inverse<Inverse<T> > *G) {
- return GraphTraits<T>::getEntryNode(G->Graph.Graph);
- }
-
- static ChildIteratorType child_begin(NodeType* N) {
- return GraphTraits<T>::child_begin(N);
- }
-
- static ChildIteratorType child_end(NodeType* N) {
- return GraphTraits<T>::child_end(N);
- }
-};
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/ADT/HashExtras.h b/release_23/include/llvm/ADT/HashExtras.h
deleted file mode 100644
index 2912df264be6..000000000000
--- a/release_23/include/llvm/ADT/HashExtras.h
+++ /dev/null
@@ -1,41 +0,0 @@
-//===-- llvm/ADT/HashExtras.h - Useful functions for STL hash ---*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains some templates that are useful if you are working with the
-// STL Hashed containers.
-//
-// No library is required when using these functinons.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_ADT_HASHEXTRAS_H
-#define LLVM_ADT_HASHEXTRAS_H
-
-#include "llvm/ADT/hash_map"
-#include <string>
-
-// Cannot specialize hash template from outside of the std namespace.
-namespace HASH_NAMESPACE {
-
-// Provide a hash function for arbitrary pointers...
-template <class T> struct hash<T *> {
- inline size_t operator()(const T *Val) const {
- return reinterpret_cast<size_t>(Val);
- }
-};
-
-template <> struct hash<std::string> {
- size_t operator()(std::string const &str) const {
- return hash<char const *>()(str.c_str());
- }
-};
-
-} // End namespace std
-
-#endif
diff --git a/release_23/include/llvm/ADT/ImmutableMap.h b/release_23/include/llvm/ADT/ImmutableMap.h
deleted file mode 100644
index 6a551db6902f..000000000000
--- a/release_23/include/llvm/ADT/ImmutableMap.h
+++ /dev/null
@@ -1,225 +0,0 @@
-//===--- ImmutableMap.h - Immutable (functional) map interface --*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines the ImmutableMap class.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_ADT_IMMAP_H
-#define LLVM_ADT_IMMAP_H
-
-#include "llvm/ADT/ImmutableSet.h"
-
-namespace llvm {
-
-/// ImutKeyValueInfo -Traits class used by ImmutableMap. While both the first and
-/// second elements in a pair are used to generate profile information,
-/// only the first element (the key) is used by isEqual and isLess.
-template <typename T, typename S>
-struct ImutKeyValueInfo {
- typedef const std::pair<T,S> value_type;
- typedef const value_type& value_type_ref;
- typedef const T key_type;
- typedef const T& key_type_ref;
- typedef const S data_type;
- typedef const S& data_type_ref;
-
- static inline key_type_ref KeyOfValue(value_type_ref V) {
- return V.first;
- }
-
- static inline data_type_ref DataOfValue(value_type_ref V) {
- return V.second;
- }
-
- static inline bool isEqual(key_type_ref L, key_type_ref R) {
- return ImutContainerInfo<T>::isEqual(L,R);
- }
- static inline bool isLess(key_type_ref L, key_type_ref R) {
- return ImutContainerInfo<T>::isLess(L,R);
- }
-
- static inline bool isDataEqual(data_type_ref L, data_type_ref R) {
- return ImutContainerInfo<S>::isEqual(L,R);
- }
-
- static inline void Profile(FoldingSetNodeID& ID, value_type_ref V) {
- ImutContainerInfo<T>::Profile(ID, V.first);
- ImutContainerInfo<S>::Profile(ID, V.second);
- }
-};
-
-
-template <typename KeyT, typename ValT,
- typename ValInfo = ImutKeyValueInfo<KeyT,ValT> >
-class ImmutableMap {
-public:
- typedef typename ValInfo::value_type value_type;
- typedef typename ValInfo::value_type_ref value_type_ref;
- typedef typename ValInfo::key_type key_type;
- typedef typename ValInfo::key_type_ref key_type_ref;
- typedef typename ValInfo::data_type data_type;
- typedef typename ValInfo::data_type_ref data_type_ref;
- typedef ImutAVLTree<ValInfo> TreeTy;
-
-private:
- TreeTy* Root;
-
-public:
- /// Constructs a map from a pointer to a tree root. In general one
- /// should use a Factory object to create maps instead of directly
- /// invoking the constructor, but there are cases where make this
- /// constructor public is useful.
- explicit ImmutableMap(TreeTy* R) : Root(R) {}
-
- class Factory {
- typename TreeTy::Factory F;
-
- public:
- Factory() {}
-
- Factory(BumpPtrAllocator& Alloc)
- : F(Alloc) {}
-
- ImmutableMap GetEmptyMap() { return ImmutableMap(F.GetEmptyTree()); }
-
- ImmutableMap Add(ImmutableMap Old, key_type_ref K, data_type_ref D) {
- return ImmutableMap(F.Add(Old.Root,
- std::make_pair<key_type,data_type>(K,D)));
- }
-
- ImmutableMap Remove(ImmutableMap Old, key_type_ref K) {
- return ImmutableMap(F.Remove(Old.Root,K));
- }
-
- private:
- Factory(const Factory& RHS) {};
- void operator=(const Factory& RHS) {};
- };
-
- friend class Factory;
-
- bool contains(key_type_ref K) const {
- return Root ? Root->contains(K) : false;
- }
-
-
- bool operator==(ImmutableMap RHS) const {
- return Root && RHS.Root ? Root->isEqual(*RHS.Root) : Root == RHS.Root;
- }
-
- bool operator!=(ImmutableMap RHS) const {
- return Root && RHS.Root ? Root->isNotEqual(*RHS.Root) : Root != RHS.Root;
- }
-
- TreeTy* getRoot() const { return Root; }
-
- bool isEmpty() const { return !Root; }
-
- //===--------------------------------------------------===//
- // Foreach - A limited form of map iteration.
- //===--------------------------------------------------===//
-
-private:
- template <typename Callback>
- struct CBWrapper {
- Callback C;
- void operator()(value_type_ref V) { C(V.first,V.second); }
- };
-
- template <typename Callback>
- struct CBWrapperRef {
- Callback &C;
- CBWrapperRef(Callback& c) : C(c) {}
-
- void operator()(value_type_ref V) { C(V.first,V.second); }
- };
-
-public:
- template <typename Callback>
- void foreach(Callback& C) {
- if (Root) {
- CBWrapperRef<Callback> CB(C);
- Root->foreach(CB);
- }
- }
-
- template <typename Callback>
- void foreach() {
- if (Root) {
- CBWrapper<Callback> CB;
- Root->foreach(CB);
- }
- }
-
- //===--------------------------------------------------===//
- // For testing.
- //===--------------------------------------------------===//
-
- void verify() const { if (Root) Root->verify(); }
-
- //===--------------------------------------------------===//
- // Iterators.
- //===--------------------------------------------------===//
-
- class iterator {
- typename TreeTy::iterator itr;
-
- iterator() {}
- iterator(TreeTy* t) : itr(t) {}
- friend class ImmutableMap;
-
- public:
- value_type_ref operator*() const { return itr->getValue(); }
- value_type* operator->() const { return &itr->getValue(); }
-
- key_type_ref getKey() const { return itr->getValue().first; }
- data_type_ref getData() const { return itr->getValue().second; }
-
-
- iterator& operator++() { ++itr; return *this; }
- iterator operator++(int) { iterator tmp(*this); ++itr; return tmp; }
- iterator& operator--() { --itr; return *this; }
- iterator operator--(int) { iterator tmp(*this); --itr; return tmp; }
- bool operator==(const iterator& RHS) const { return RHS.itr == itr; }
- bool operator!=(const iterator& RHS) const { return RHS.itr != itr; }
- };
-
- iterator begin() const { return iterator(Root); }
- iterator end() const { return iterator(); }
-
- TreeTy* SlimFind(key_type_ref K) const {
- if (Root) {
- TreeTy* T = Root->find(K);
- if (T) return T;
- }
-
- return NULL;
- }
-
- // FIXME: Add 'find' that returns an iterator instead of a TreeTy*.
-
- //===--------------------------------------------------===//
- // Utility methods.
- //===--------------------------------------------------===//
-
- inline unsigned getHeight() const { return Root ? Root->getHeight() : 0; }
-
- static inline void Profile(FoldingSetNodeID& ID, const ImmutableMap& M) {
- ID.AddPointer(M.Root);
- }
-
- inline void Profile(FoldingSetNodeID& ID) const {
- return Profile(ID,*this);
- }
-};
-
-} // end namespace llvm
-
-#endif
diff --git a/release_23/include/llvm/ADT/ImmutableSet.h b/release_23/include/llvm/ADT/ImmutableSet.h
deleted file mode 100644
index c351771c6da2..000000000000
--- a/release_23/include/llvm/ADT/ImmutableSet.h
+++ /dev/null
@@ -1,1057 +0,0 @@
-//===--- ImmutableSet.h - Immutable (functional) set interface --*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines the ImutAVLTree and ImmutableSet classes.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_ADT_IMSET_H
-#define LLVM_ADT_IMSET_H
-
-#include "llvm/Support/Allocator.h"
-#include "llvm/ADT/FoldingSet.h"
-#include "llvm/Support/DataTypes.h"
-#include <cassert>
-#include <functional>
-
-namespace llvm {
-
-//===----------------------------------------------------------------------===//
-// Immutable AVL-Tree Definition.
-//===----------------------------------------------------------------------===//
-
-template <typename ImutInfo> class ImutAVLFactory;
-template <typename ImutInfo> class ImutAVLTreeInOrderIterator;
-template <typename ImutInfo> class ImutAVLTreeGenericIterator;
-
-template <typename ImutInfo >
-class ImutAVLTree : public FoldingSetNode {
-public:
- typedef typename ImutInfo::key_type_ref key_type_ref;
- typedef typename ImutInfo::value_type value_type;
- typedef typename ImutInfo::value_type_ref value_type_ref;
-
- typedef ImutAVLFactory<ImutInfo> Factory;
- friend class ImutAVLFactory<ImutInfo>;
-
- friend class ImutAVLTreeGenericIterator<ImutInfo>;
- friend class FoldingSet<ImutAVLTree>;
-
- typedef ImutAVLTreeInOrderIterator<ImutInfo> iterator;
-
- //===----------------------------------------------------===//
- // Public Interface.
- //===----------------------------------------------------===//
-
- /// getLeft - Returns a pointer to the left subtree. This value
- /// is NULL if there is no left subtree.
- ImutAVLTree* getLeft() const {
- assert (!isMutable() && "Node is incorrectly marked mutable.");
-
- return reinterpret_cast<ImutAVLTree*>(Left);
- }
-
- /// getRight - Returns a pointer to the right subtree. This value is
- /// NULL if there is no right subtree.
- ImutAVLTree* getRight() const { return Right; }
-
-
- /// getHeight - Returns the height of the tree. A tree with no subtrees
- /// has a height of 1.
- unsigned getHeight() const { return Height; }
-
- /// getValue - Returns the data value associated with the tree node.
- const value_type& getValue() const { return Value; }
-
- /// find - Finds the subtree associated with the specified key value.
- /// This method returns NULL if no matching subtree is found.
- ImutAVLTree* find(key_type_ref K) {
- ImutAVLTree *T = this;
-
- while (T) {
- key_type_ref CurrentKey = ImutInfo::KeyOfValue(T->getValue());
-
- if (ImutInfo::isEqual(K,CurrentKey))
- return T;
- else if (ImutInfo::isLess(K,CurrentKey))
- T = T->getLeft();
- else
- T = T->getRight();
- }
-
- return NULL;
- }
-
- /// size - Returns the number of nodes in the tree, which includes
- /// both leaves and non-leaf nodes.
- unsigned size() const {
- unsigned n = 1;
-
- if (const ImutAVLTree* L = getLeft()) n += L->size();
- if (const ImutAVLTree* R = getRight()) n += R->size();
-
- return n;
- }
-
- /// begin - Returns an iterator that iterates over the nodes of the tree
- /// in an inorder traversal. The returned iterator thus refers to the
- /// the tree node with the minimum data element.
- iterator begin() const { return iterator(this); }
-
- /// end - Returns an iterator for the tree that denotes the end of an
- /// inorder traversal.
- iterator end() const { return iterator(); }
-
- bool ElementEqual(value_type_ref V) const {
- // Compare the keys.
- if (!ImutInfo::isEqual(ImutInfo::KeyOfValue(getValue()),
- ImutInfo::KeyOfValue(V)))
- return false;
-
- // Also compare the data values.
- if (!ImutInfo::isDataEqual(ImutInfo::DataOfValue(getValue()),
- ImutInfo::DataOfValue(V)))
- return false;
-
- return true;
- }
-
- bool ElementEqual(const ImutAVLTree* RHS) const {
- return ElementEqual(RHS->getValue());
- }
-
- /// isEqual - Compares two trees for structural equality and returns true
- /// if they are equal. This worst case performance of this operation is
- // linear in the sizes of the trees.
- bool isEqual(const ImutAVLTree& RHS) const {
- if (&RHS == this)
- return true;
-
- iterator LItr = begin(), LEnd = end();
- iterator RItr = RHS.begin(), REnd = RHS.end();
-
- while (LItr != LEnd && RItr != REnd) {
- if (*LItr == *RItr) {
- LItr.SkipSubTree();
- RItr.SkipSubTree();
- continue;
- }
-
- if (!LItr->ElementEqual(*RItr))
- return false;
-
- ++LItr;
- ++RItr;
- }
-
- return LItr == LEnd && RItr == REnd;
- }
-
- /// isNotEqual - Compares two trees for structural inequality. Performance
- /// is the same is isEqual.
- bool isNotEqual(const ImutAVLTree& RHS) const { return !isEqual(RHS); }
-
- /// contains - Returns true if this tree contains a subtree (node) that
- /// has an data element that matches the specified key. Complexity
- /// is logarithmic in the size of the tree.
- bool contains(const key_type_ref K) { return (bool) find(K); }
-
- /// foreach - A member template the accepts invokes operator() on a functor
- /// object (specifed by Callback) for every node/subtree in the tree.
- /// Nodes are visited using an inorder traversal.
- template <typename Callback>
- void foreach(Callback& C) {
- if (ImutAVLTree* L = getLeft()) L->foreach(C);
-
- C(Value);
-
- if (ImutAVLTree* R = getRight()) R->foreach(C);
- }
-
- /// verify - A utility method that checks that the balancing and
- /// ordering invariants of the tree are satisifed. It is a recursive
- /// method that returns the height of the tree, which is then consumed
- /// by the enclosing verify call. External callers should ignore the
- /// return value. An invalid tree will cause an assertion to fire in
- /// a debug build.
- unsigned verify() const {
- unsigned HL = getLeft() ? getLeft()->verify() : 0;
- unsigned HR = getRight() ? getRight()->verify() : 0;
-
- assert (getHeight() == ( HL > HR ? HL : HR ) + 1
- && "Height calculation wrong.");
-
- assert ((HL > HR ? HL-HR : HR-HL) <= 2
- && "Balancing invariant violated.");
-
-
- assert (!getLeft()
- || ImutInfo::isLess(ImutInfo::KeyOfValue(getLeft()->getValue()),
- ImutInfo::KeyOfValue(getValue()))
- && "Value in left child is not less that current value.");
-
-
- assert (!getRight()
- || ImutInfo::isLess(ImutInfo::KeyOfValue(getValue()),
- ImutInfo::KeyOfValue(getRight()->getValue()))
- && "Current value is not less that value of right child.");
-
- return getHeight();
- }
-
- /// Profile - Profiling for ImutAVLTree.
- void Profile(llvm::FoldingSetNodeID& ID) {
- ID.AddInteger(ComputeDigest());
- }
-
- //===----------------------------------------------------===//
- // Internal Values.
- //===----------------------------------------------------===//
-
-private:
- uintptr_t Left;
- ImutAVLTree* Right;
- unsigned Height;
- value_type Value;
- unsigned Digest;
-
- //===----------------------------------------------------===//
- // Internal methods (node manipulation; used by Factory).
- //===----------------------------------------------------===//
-
-private:
-
- enum { Mutable = 0x1 };
-
- /// ImutAVLTree - Internal constructor that is only called by
- /// ImutAVLFactory.
- ImutAVLTree(ImutAVLTree* l, ImutAVLTree* r, value_type_ref v, unsigned height)
- : Left(reinterpret_cast<uintptr_t>(l) | Mutable),
- Right(r), Height(height), Value(v), Digest(0) {}
-
-
- /// isMutable - Returns true if the left and right subtree references
- /// (as well as height) can be changed. If this method returns false,
- /// the tree is truly immutable. Trees returned from an ImutAVLFactory
- /// object should always have this method return true. Further, if this
- /// method returns false for an instance of ImutAVLTree, all subtrees
- /// will also have this method return false. The converse is not true.
- bool isMutable() const { return Left & Mutable; }
-
- /// getSafeLeft - Returns the pointer to the left tree by always masking
- /// out the mutable bit. This is used internally by ImutAVLFactory,
- /// as no trees returned to the client should have the mutable flag set.
- ImutAVLTree* getSafeLeft() const {
- return reinterpret_cast<ImutAVLTree*>(Left & ~Mutable);
- }
-
- //===----------------------------------------------------===//
- // Mutating operations. A tree root can be manipulated as
- // long as its reference has not "escaped" from internal
- // methods of a factory object (see below). When a tree
- // pointer is externally viewable by client code, the
- // internal "mutable bit" is cleared to mark the tree
- // immutable. Note that a tree that still has its mutable
- // bit set may have children (subtrees) that are themselves
- // immutable.
- //===----------------------------------------------------===//
-
-
- /// MarkImmutable - Clears the mutable flag for a tree. After this happens,
- /// it is an error to call setLeft(), setRight(), and setHeight(). It
- /// is also then safe to call getLeft() instead of getSafeLeft().
- void MarkImmutable() {
- assert (isMutable() && "Mutable flag already removed.");
- Left &= ~Mutable;
- }
-
- /// setLeft - Changes the reference of the left subtree. Used internally
- /// by ImutAVLFactory.
- void setLeft(ImutAVLTree* NewLeft) {
- assert (isMutable() &&
- "Only a mutable tree can have its left subtree changed.");
-
- Left = reinterpret_cast<uintptr_t>(NewLeft) | Mutable;
- }
-
- /// setRight - Changes the reference of the right subtree. Used internally
- /// by ImutAVLFactory.
- void setRight(ImutAVLTree* NewRight) {
- assert (isMutable() &&
- "Only a mutable tree can have its right subtree changed.");
-
- Right = NewRight;
- }
-
- /// setHeight - Changes the height of the tree. Used internally by
- /// ImutAVLFactory.
- void setHeight(unsigned h) {
- assert (isMutable() && "Only a mutable tree can have its height changed.");
- Height = h;
- }
-
-
- static inline
- unsigned ComputeDigest(ImutAVLTree* L, ImutAVLTree* R, value_type_ref V) {
- unsigned digest = 0;
-
- if (L) digest += L->ComputeDigest();
-
- { // Compute digest of stored data.
- FoldingSetNodeID ID;
- ImutInfo::Profile(ID,V);
- digest += ID.ComputeHash();
- }
-
- if (R) digest += R->ComputeDigest();
-
- return digest;
- }
-
- inline unsigned ComputeDigest() {
- if (Digest) return Digest;
-
- unsigned X = ComputeDigest(getSafeLeft(), getRight(), getValue());
- if (!isMutable()) Digest = X;
-
- return X;
- }
-};
-
-//===----------------------------------------------------------------------===//
-// Immutable AVL-Tree Factory class.
-//===----------------------------------------------------------------------===//
-
-template <typename ImutInfo >
-class ImutAVLFactory {
- typedef ImutAVLTree<ImutInfo> TreeTy;
- typedef typename TreeTy::value_type_ref value_type_ref;
- typedef typename TreeTy::key_type_ref key_type_ref;
-
- typedef FoldingSet<TreeTy> CacheTy;
-
- CacheTy Cache;
- uintptr_t Allocator;
-
- bool ownsAllocator() const {
- return Allocator & 0x1 ? false : true;
- }
-
- BumpPtrAllocator& getAllocator() const {
- return *reinterpret_cast<BumpPtrAllocator*>(Allocator & ~0x1);
- }
-
- //===--------------------------------------------------===//
- // Public interface.
- //===--------------------------------------------------===//
-
-public:
- ImutAVLFactory()
- : Allocator(reinterpret_cast<uintptr_t>(new BumpPtrAllocator())) {}
-
- ImutAVLFactory(BumpPtrAllocator& Alloc)
- : Allocator(reinterpret_cast<uintptr_t>(&Alloc) | 0x1) {}
-
- ~ImutAVLFactory() {
- if (ownsAllocator()) delete &getAllocator();
- }
-
- TreeTy* Add(TreeTy* T, value_type_ref V) {
- T = Add_internal(V,T);
- MarkImmutable(T);
- return T;
- }
-
- TreeTy* Remove(TreeTy* T, key_type_ref V) {
- T = Remove_internal(V,T);
- MarkImmutable(T);
- return T;
- }
-
- TreeTy* GetEmptyTree() const { return NULL; }
-
- //===--------------------------------------------------===//
- // A bunch of quick helper functions used for reasoning
- // about the properties of trees and their children.
- // These have succinct names so that the balancing code
- // is as terse (and readable) as possible.
- //===--------------------------------------------------===//
-private:
-
- bool isEmpty(TreeTy* T) const { return !T; }
- unsigned Height(TreeTy* T) const { return T ? T->getHeight() : 0; }
- TreeTy* Left(TreeTy* T) const { return T->getSafeLeft(); }
- TreeTy* Right(TreeTy* T) const { return T->getRight(); }
- value_type_ref Value(TreeTy* T) const { return T->Value; }
-
- unsigned IncrementHeight(TreeTy* L, TreeTy* R) const {
- unsigned hl = Height(L);
- unsigned hr = Height(R);
- return ( hl > hr ? hl : hr ) + 1;
- }
-
-
- static bool CompareTreeWithSection(TreeTy* T,
- typename TreeTy::iterator& TI,
- typename TreeTy::iterator& TE) {
-
- typename TreeTy::iterator I = T->begin(), E = T->end();
-
- for ( ; I!=E ; ++I, ++TI)
- if (TI == TE || !I->ElementEqual(*TI))
- return false;
-
- return true;
- }
-
- //===--------------------------------------------------===//
- // "CreateNode" is used to generate new tree roots that link
- // to other trees. The functon may also simply move links
- // in an existing root if that root is still marked mutable.
- // This is necessary because otherwise our balancing code
- // would leak memory as it would create nodes that are
- // then discarded later before the finished tree is
- // returned to the caller.
- //===--------------------------------------------------===//
-
- TreeTy* CreateNode(TreeTy* L, value_type_ref V, TreeTy* R) {
- // Search the FoldingSet bucket for a Tree with the same digest.
- FoldingSetNodeID ID;
- unsigned digest = TreeTy::ComputeDigest(L, R, V);
- ID.AddInteger(digest);
- unsigned hash = ID.ComputeHash();
-
- typename CacheTy::bucket_iterator I = Cache.bucket_begin(hash);
- typename CacheTy::bucket_iterator E = Cache.bucket_end(hash);
-
- for (; I != E; ++I) {
- TreeTy* T = &*I;
-
- if (T->ComputeDigest() != digest)
- continue;
-
- // We found a collision. Perform a comparison of Contents('T')
- // with Contents('L')+'V'+Contents('R').
-
- typename TreeTy::iterator TI = T->begin(), TE = T->end();
-
- // First compare Contents('L') with the (initial) contents of T.
- if (!CompareTreeWithSection(L, TI, TE))
- continue;
-
- // Now compare the new data element.
- if (TI == TE || !TI->ElementEqual(V))
- continue;
-
- ++TI;
-
- // Now compare the remainder of 'T' with 'R'.
- if (!CompareTreeWithSection(R, TI, TE))
- continue;
-
- if (TI != TE) // Contents('R') did not match suffix of 'T'.
- continue;
-
- // Trees did match! Return 'T'.
- return T;
- }
-
- // No tree with the contents: Contents('L')+'V'+Contents('R').
- // Create it.
-
- // Allocate the new tree node and insert it into the cache.
- BumpPtrAllocator& A = getAllocator();
- TreeTy* T = (TreeTy*) A.Allocate<TreeTy>();
- new (T) TreeTy(L,R,V,IncrementHeight(L,R));
-
- // We do not insert 'T' into the FoldingSet here. This is because
- // this tree is still mutable and things may get rebalanced.
- // Because our digest is associative and based on the contents of
- // the set, this should hopefully not cause any strange bugs.
- // 'T' is inserted by 'MarkImmutable'.
-
- return T;
- }
-
- TreeTy* CreateNode(TreeTy* L, TreeTy* OldTree, TreeTy* R) {
- assert (!isEmpty(OldTree));
-
- if (OldTree->isMutable()) {
- OldTree->setLeft(L);
- OldTree->setRight(R);
- OldTree->setHeight(IncrementHeight(L,R));
- return OldTree;
- }
- else return CreateNode(L, Value(OldTree), R);
- }
-
- /// Balance - Used by Add_internal and Remove_internal to
- /// balance a newly created tree.
- TreeTy* Balance(TreeTy* L, value_type_ref V, TreeTy* R) {
-
- unsigned hl = Height(L);
- unsigned hr = Height(R);
-
- if (hl > hr + 2) {
- assert (!isEmpty(L) &&
- "Left tree cannot be empty to have a height >= 2.");
-
- TreeTy* LL = Left(L);
- TreeTy* LR = Right(L);
-
- if (Height(LL) >= Height(LR))
- return CreateNode(LL, L, CreateNode(LR,V,R));
-
- assert (!isEmpty(LR) &&
- "LR cannot be empty because it has a height >= 1.");
-
- TreeTy* LRL = Left(LR);
- TreeTy* LRR = Right(LR);
-
- return CreateNode(CreateNode(LL,L,LRL), LR, CreateNode(LRR,V,R));
- }
- else if (hr > hl + 2) {
- assert (!isEmpty(R) &&
- "Right tree cannot be empty to have a height >= 2.");
-
- TreeTy* RL = Left(R);
- TreeTy* RR = Right(R);
-
- if (Height(RR) >= Height(RL))
- return CreateNode(CreateNode(L,V,RL), R, RR);
-
- assert (!isEmpty(RL) &&
- "RL cannot be empty because it has a height >= 1.");
-
- TreeTy* RLL = Left(RL);
- TreeTy* RLR = Right(RL);
-
- return CreateNode(CreateNode(L,V,RLL), RL, CreateNode(RLR,R,RR));
- }
- else
- return CreateNode(L,V,R);
- }
-
- /// Add_internal - Creates a new tree that includes the specified
- /// data and the data from the original tree. If the original tree
- /// already contained the data item, the original tree is returned.
- TreeTy* Add_internal(value_type_ref V, TreeTy* T) {
- if (isEmpty(T))
- return CreateNode(T, V, T);
-
- assert (!T->isMutable());
-
- key_type_ref K = ImutInfo::KeyOfValue(V);
- key_type_ref KCurrent = ImutInfo::KeyOfValue(Value(T));
-
- if (ImutInfo::isEqual(K,KCurrent))
- return CreateNode(Left(T), V, Right(T));
- else if (ImutInfo::isLess(K,KCurrent))
- return Balance(Add_internal(V,Left(T)), Value(T), Right(T));
- else
- return Balance(Left(T), Value(T), Add_internal(V,Right(T)));
- }
-
- /// Remove_interal - Creates a new tree that includes all the data
- /// from the original tree except the specified data. If the
- /// specified data did not exist in the original tree, the original
- /// tree is returned.
- TreeTy* Remove_internal(key_type_ref K, TreeTy* T) {
- if (isEmpty(T))
- return T;
-
- assert (!T->isMutable());
-
- key_type_ref KCurrent = ImutInfo::KeyOfValue(Value(T));
-
- if (ImutInfo::isEqual(K,KCurrent))
- return CombineLeftRightTrees(Left(T),Right(T));
- else if (ImutInfo::isLess(K,KCurrent))
- return Balance(Remove_internal(K,Left(T)), Value(T), Right(T));
- else
- return Balance(Left(T), Value(T), Remove_internal(K,Right(T)));
- }
-
- TreeTy* CombineLeftRightTrees(TreeTy* L, TreeTy* R) {
- if (isEmpty(L)) return R;
- if (isEmpty(R)) return L;
-
- TreeTy* OldNode;
- TreeTy* NewRight = RemoveMinBinding(R,OldNode);
- return Balance(L,Value(OldNode),NewRight);
- }
-
- TreeTy* RemoveMinBinding(TreeTy* T, TreeTy*& NodeRemoved) {
- assert (!isEmpty(T));
-
- if (isEmpty(Left(T))) {
- NodeRemoved = T;
- return Right(T);
- }
-
- return Balance(RemoveMinBinding(Left(T),NodeRemoved),Value(T),Right(T));
- }
-
- /// MarkImmutable - Clears the mutable bits of a root and all of its
- /// descendants.
- void MarkImmutable(TreeTy* T) {
- if (!T || !T->isMutable())
- return;
-
- T->MarkImmutable();
- MarkImmutable(Left(T));
- MarkImmutable(Right(T));
-
- // Now that the node is immutable it can safely be inserted
- // into the node cache.
- llvm::FoldingSetNodeID ID;
- ID.AddInteger(T->ComputeDigest());
- Cache.InsertNode(T, (void*) &*Cache.bucket_end(ID.ComputeHash()));
- }
-};
-
-
-//===----------------------------------------------------------------------===//
-// Immutable AVL-Tree Iterators.
-//===----------------------------------------------------------------------===//
-
-template <typename ImutInfo>
-class ImutAVLTreeGenericIterator {
- SmallVector<uintptr_t,20> stack;
-public:
- enum VisitFlag { VisitedNone=0x0, VisitedLeft=0x1, VisitedRight=0x3,
- Flags=0x3 };
-
- typedef ImutAVLTree<ImutInfo> TreeTy;
- typedef ImutAVLTreeGenericIterator<ImutInfo> _Self;
-
- inline ImutAVLTreeGenericIterator() {}
- inline ImutAVLTreeGenericIterator(const TreeTy* Root) {
- if (Root) stack.push_back(reinterpret_cast<uintptr_t>(Root));
- }
-
- TreeTy* operator*() const {
- assert (!stack.empty());
- return reinterpret_cast<TreeTy*>(stack.back() & ~Flags);
- }
-
- uintptr_t getVisitState() {
- assert (!stack.empty());
- return stack.back() & Flags;
- }
-
-
- bool AtEnd() const { return stack.empty(); }
-
- bool AtBeginning() const {
- return stack.size() == 1 && getVisitState() == VisitedNone;
- }
-
- void SkipToParent() {
- assert (!stack.empty());
- stack.pop_back();
-
- if (stack.empty())
- return;
-
- switch (getVisitState()) {
- case VisitedNone:
- stack.back() |= VisitedLeft;
- break;
- case VisitedLeft:
- stack.back() |= VisitedRight;
- break;
- default:
- assert (false && "Unreachable.");
- }
- }
-
- inline bool operator==(const _Self& x) const {
- if (stack.size() != x.stack.size())
- return false;
-
- for (unsigned i = 0 ; i < stack.size(); i++)
- if (stack[i] != x.stack[i])
- return false;
-
- return true;
- }
-
- inline bool operator!=(const _Self& x) const { return !operator==(x); }
-
- _Self& operator++() {
- assert (!stack.empty());
-
- TreeTy* Current = reinterpret_cast<TreeTy*>(stack.back() & ~Flags);
- assert (Current);
-
- switch (getVisitState()) {
- case VisitedNone:
- if (TreeTy* L = Current->getSafeLeft())
- stack.push_back(reinterpret_cast<uintptr_t>(L));
- else
- stack.back() |= VisitedLeft;
-
- break;
-
- case VisitedLeft:
- if (TreeTy* R = Current->getRight())
- stack.push_back(reinterpret_cast<uintptr_t>(R));
- else
- stack.back() |= VisitedRight;
-
- break;
-
- case VisitedRight:
- SkipToParent();
- break;
-
- default:
- assert (false && "Unreachable.");
- }
-
- return *this;
- }
-
- _Self& operator--() {
- assert (!stack.empty());
-
- TreeTy* Current = reinterpret_cast<TreeTy*>(stack.back() & ~Flags);
- assert (Current);
-
- switch (getVisitState()) {
- case VisitedNone:
- stack.pop_back();
- break;
-
- case VisitedLeft:
- stack.back() &= ~Flags; // Set state to "VisitedNone."
-
- if (TreeTy* L = Current->getLeft())
- stack.push_back(reinterpret_cast<uintptr_t>(L) | VisitedRight);
-
- break;
-
- case VisitedRight:
- stack.back() &= ~Flags;
- stack.back() |= VisitedLeft;
-
- if (TreeTy* R = Current->getRight())
- stack.push_back(reinterpret_cast<uintptr_t>(R) | VisitedRight);
-
- break;
-
- default:
- assert (false && "Unreachable.");
- }
-
- return *this;
- }
-};
-
-template <typename ImutInfo>
-class ImutAVLTreeInOrderIterator {
- typedef ImutAVLTreeGenericIterator<ImutInfo> InternalIteratorTy;
- InternalIteratorTy InternalItr;
-
-public:
- typedef ImutAVLTree<ImutInfo> TreeTy;
- typedef ImutAVLTreeInOrderIterator<ImutInfo> _Self;
-
- ImutAVLTreeInOrderIterator(const TreeTy* Root) : InternalItr(Root) {
- if (Root) operator++(); // Advance to first element.
- }
-
- ImutAVLTreeInOrderIterator() : InternalItr() {}
-
- inline bool operator==(const _Self& x) const {
- return InternalItr == x.InternalItr;
- }
-
- inline bool operator!=(const _Self& x) const { return !operator==(x); }
-
- inline TreeTy* operator*() const { return *InternalItr; }
- inline TreeTy* operator->() const { return *InternalItr; }
-
- inline _Self& operator++() {
- do ++InternalItr;
- while (!InternalItr.AtEnd() &&
- InternalItr.getVisitState() != InternalIteratorTy::VisitedLeft);
-
- return *this;
- }
-
- inline _Self& operator--() {
- do --InternalItr;
- while (!InternalItr.AtBeginning() &&
- InternalItr.getVisitState() != InternalIteratorTy::VisitedLeft);
-
- return *this;
- }
-
- inline void SkipSubTree() {
- InternalItr.SkipToParent();
-
- while (!InternalItr.AtEnd() &&
- InternalItr.getVisitState() != InternalIteratorTy::VisitedLeft)
- ++InternalItr;
- }
-};
-
-//===----------------------------------------------------------------------===//
-// Trait classes for Profile information.
-//===----------------------------------------------------------------------===//
-
-/// Generic profile template. The default behavior is to invoke the
-/// profile method of an object. Specializations for primitive integers
-/// and generic handling of pointers is done below.
-template <typename T>
-struct ImutProfileInfo {
- typedef const T value_type;
- typedef const T& value_type_ref;
-
- static inline void Profile(FoldingSetNodeID& ID, value_type_ref X) {
- FoldingSetTrait<T>::Profile(X,ID);
- }
-};
-
-/// Profile traits for integers.
-template <typename T>
-struct ImutProfileInteger {
- typedef const T value_type;
- typedef const T& value_type_ref;
-
- static inline void Profile(FoldingSetNodeID& ID, value_type_ref X) {
- ID.AddInteger(X);
- }
-};
-
-#define PROFILE_INTEGER_INFO(X)\
-template<> struct ImutProfileInfo<X> : ImutProfileInteger<X> {};
-
-PROFILE_INTEGER_INFO(char)
-PROFILE_INTEGER_INFO(unsigned char)
-PROFILE_INTEGER_INFO(short)
-PROFILE_INTEGER_INFO(unsigned short)
-PROFILE_INTEGER_INFO(unsigned)
-PROFILE_INTEGER_INFO(signed)
-PROFILE_INTEGER_INFO(long)
-PROFILE_INTEGER_INFO(unsigned long)
-PROFILE_INTEGER_INFO(long long)
-PROFILE_INTEGER_INFO(unsigned long long)
-
-#undef PROFILE_INTEGER_INFO
-
-/// Generic profile trait for pointer types. We treat pointers as
-/// references to unique objects.
-template <typename T>
-struct ImutProfileInfo<T*> {
- typedef const T* value_type;
- typedef value_type value_type_ref;
-
- static inline void Profile(FoldingSetNodeID &ID, value_type_ref X) {
- ID.AddPointer(X);
- }
-};
-
-//===----------------------------------------------------------------------===//
-// Trait classes that contain element comparison operators and type
-// definitions used by ImutAVLTree, ImmutableSet, and ImmutableMap. These
-// inherit from the profile traits (ImutProfileInfo) to include operations
-// for element profiling.
-//===----------------------------------------------------------------------===//
-
-
-/// ImutContainerInfo - Generic definition of comparison operations for
-/// elements of immutable containers that defaults to using
-/// std::equal_to<> and std::less<> to perform comparison of elements.
-template <typename T>
-struct ImutContainerInfo : public ImutProfileInfo<T> {
- typedef typename ImutProfileInfo<T>::value_type value_type;
- typedef typename ImutProfileInfo<T>::value_type_ref value_type_ref;
- typedef value_type key_type;
- typedef value_type_ref key_type_ref;
- typedef bool data_type;
- typedef bool data_type_ref;
-
- static inline key_type_ref KeyOfValue(value_type_ref D) { return D; }
- static inline data_type_ref DataOfValue(value_type_ref) { return true; }
-
- static inline bool isEqual(key_type_ref LHS, key_type_ref RHS) {
- return std::equal_to<key_type>()(LHS,RHS);
- }
-
- static inline bool isLess(key_type_ref LHS, key_type_ref RHS) {
- return std::less<key_type>()(LHS,RHS);
- }
-
- static inline bool isDataEqual(data_type_ref,data_type_ref) { return true; }
-};
-
-/// ImutContainerInfo - Specialization for pointer values to treat pointers
-/// as references to unique objects. Pointers are thus compared by
-/// their addresses.
-template <typename T>
-struct ImutContainerInfo<T*> : public ImutProfileInfo<T*> {
- typedef typename ImutProfileInfo<T*>::value_type value_type;
- typedef typename ImutProfileInfo<T*>::value_type_ref value_type_ref;
- typedef value_type key_type;
- typedef value_type_ref key_type_ref;
- typedef bool data_type;
- typedef bool data_type_ref;
-
- static inline key_type_ref KeyOfValue(value_type_ref D) { return D; }
- static inline data_type_ref DataOfValue(value_type_ref) { return true; }
-
- static inline bool isEqual(key_type_ref LHS, key_type_ref RHS) {
- return LHS == RHS;
- }
-
- static inline bool isLess(key_type_ref LHS, key_type_ref RHS) {
- return LHS < RHS;
- }
-
- static inline bool isDataEqual(data_type_ref,data_type_ref) { return true; }
-};
-
-//===----------------------------------------------------------------------===//
-// Immutable Set
-//===----------------------------------------------------------------------===//
-
-template <typename ValT, typename ValInfo = ImutContainerInfo<ValT> >
-class ImmutableSet {
-public:
- typedef typename ValInfo::value_type value_type;
- typedef typename ValInfo::value_type_ref value_type_ref;
- typedef ImutAVLTree<ValInfo> TreeTy;
-
-private:
- TreeTy* Root;
-
-public:
- /// Constructs a set from a pointer to a tree root. In general one
- /// should use a Factory object to create sets instead of directly
- /// invoking the constructor, but there are cases where make this
- /// constructor public is useful.
- explicit ImmutableSet(TreeTy* R) : Root(R) {}
-
- class Factory {
- typename TreeTy::Factory F;
-
- public:
- Factory() {}
-
- Factory(BumpPtrAllocator& Alloc)
- : F(Alloc) {}
-
- /// GetEmptySet - Returns an immutable set that contains no elements.
- ImmutableSet GetEmptySet() { return ImmutableSet(F.GetEmptyTree()); }
-
- /// Add - Creates a new immutable set that contains all of the values
- /// of the original set with the addition of the specified value. If
- /// the original set already included the value, then the original set is
- /// returned and no memory is allocated. The time and space complexity
- /// of this operation is logarithmic in the size of the original set.
- /// The memory allocated to represent the set is released when the
- /// factory object that created the set is destroyed.
- ImmutableSet Add(ImmutableSet Old, value_type_ref V) {
- return ImmutableSet(F.Add(Old.Root,V));
- }
-
- /// Remove - Creates a new immutable set that contains all of the values
- /// of the original set with the exception of the specified value. If
- /// the original set did not contain the value, the original set is
- /// returned and no memory is allocated. The time and space complexity
- /// of this operation is logarithmic in the size of the original set.
- /// The memory allocated to represent the set is released when the
- /// factory object that created the set is destroyed.
- ImmutableSet Remove(ImmutableSet Old, value_type_ref V) {
- return ImmutableSet(F.Remove(Old.Root,V));
- }
-
- BumpPtrAllocator& getAllocator() { return F.getAllocator(); }
-
- private:
- Factory(const Factory& RHS) {};
- void operator=(const Factory& RHS) {};
- };
-
- friend class Factory;
-
- /// contains - Returns true if the set contains the specified value.
- bool contains(const value_type_ref V) const {
- return Root ? Root->contains(V) : false;
- }
-
- bool operator==(ImmutableSet RHS) const {
- return Root && RHS.Root ? Root->isEqual(*RHS.Root) : Root == RHS.Root;
- }
-
- bool operator!=(ImmutableSet RHS) const {
- return Root && RHS.Root ? Root->isNotEqual(*RHS.Root) : Root != RHS.Root;
- }
-
- TreeTy* getRoot() const { return Root; }
-
- /// isEmpty - Return true if the set contains no elements.
- bool isEmpty() const { return !Root; }
-
- template <typename Callback>
- void foreach(Callback& C) { if (Root) Root->foreach(C); }
-
- template <typename Callback>
- void foreach() { if (Root) { Callback C; Root->foreach(C); } }
-
- //===--------------------------------------------------===//
- // Iterators.
- //===--------------------------------------------------===//
-
- class iterator {
- typename TreeTy::iterator itr;
-
- iterator() {}
- iterator(TreeTy* t) : itr(t) {}
- friend class ImmutableSet<ValT,ValInfo>;
- public:
- inline value_type_ref operator*() const { return itr->getValue(); }
- inline iterator& operator++() { ++itr; return *this; }
- inline iterator operator++(int) { iterator tmp(*this); ++itr; return tmp; }
- inline iterator& operator--() { --itr; return *this; }
- inline iterator operator--(int) { iterator tmp(*this); --itr; return tmp; }
- inline bool operator==(const iterator& RHS) const { return RHS.itr == itr; }
- inline bool operator!=(const iterator& RHS) const { return RHS.itr != itr; }
- };
-
- iterator begin() const { return iterator(Root); }
- iterator end() const { return iterator(); }
-
- //===--------------------------------------------------===//
- // Utility methods.
- //===--------------------------------------------------===//
-
- inline unsigned getHeight() const { return Root ? Root->getHeight() : 0; }
-
- static inline void Profile(FoldingSetNodeID& ID, const ImmutableSet& S) {
- ID.AddPointer(S.Root);
- }
-
- inline void Profile(FoldingSetNodeID& ID) const {
- return Profile(ID,*this);
- }
-
- //===--------------------------------------------------===//
- // For testing.
- //===--------------------------------------------------===//
-
- void verify() const { if (Root) Root->verify(); }
-};
-
-} // end namespace llvm
-
-#endif
diff --git a/release_23/include/llvm/ADT/IndexedMap.h b/release_23/include/llvm/ADT/IndexedMap.h
deleted file mode 100644
index ad95bdba018c..000000000000
--- a/release_23/include/llvm/ADT/IndexedMap.h
+++ /dev/null
@@ -1,75 +0,0 @@
-//===- llvm/ADT/IndexedMap.h - An index map implementation ------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements an indexed map. The index map template takes two
-// types. The first is the mapped type and the second is a functor
-// that maps its argument to a size_t. On instantiation a "null" value
-// can be provided to be used as a "does not exist" indicator in the
-// map. A member function grow() is provided that given the value of
-// the maximally indexed key (the argument of the functor) makes sure
-// the map has enough space for it.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_ADT_INDEXEDMAP_H
-#define LLVM_ADT_INDEXEDMAP_H
-
-#include <functional>
-#include <vector>
-#include <cassert>
-
-namespace llvm {
-
- struct IdentityFunctor : std::unary_function<unsigned, unsigned> {
- unsigned operator()(unsigned Index) const {
- return Index;
- }
- };
-
- template <typename T, typename ToIndexT = IdentityFunctor>
- class IndexedMap {
- typedef typename ToIndexT::argument_type IndexT;
- typedef std::vector<T> StorageT;
- StorageT storage_;
- T nullVal_;
- ToIndexT toIndex_;
-
- public:
- IndexedMap() : nullVal_(T()) { }
-
- explicit IndexedMap(const T& val) : nullVal_(val) { }
-
- typename StorageT::reference operator[](IndexT n) {
- assert(toIndex_(n) < storage_.size() && "index out of bounds!");
- return storage_[toIndex_(n)];
- }
-
- typename StorageT::const_reference operator[](IndexT n) const {
- assert(toIndex_(n) < storage_.size() && "index out of bounds!");
- return storage_[toIndex_(n)];
- }
-
- void clear() {
- storage_.clear();
- }
-
- void grow(IndexT n) {
- unsigned NewSize = toIndex_(n) + 1;
- if (NewSize > storage_.size())
- storage_.resize(NewSize, nullVal_);
- }
-
- typename StorageT::size_type size() const {
- return storage_.size();
- }
- };
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/ADT/IntrusiveRefCntPtr.h b/release_23/include/llvm/ADT/IntrusiveRefCntPtr.h
deleted file mode 100644
index ad2138b10e09..000000000000
--- a/release_23/include/llvm/ADT/IntrusiveRefCntPtr.h
+++ /dev/null
@@ -1,230 +0,0 @@
-//== llvm/ADT/IntrusiveRefCntPtr.h - Smart Refcounting Pointer ----*- C++ -*-==//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines IntrusiveRefCntPtr, a template class that
-// implements a "smart" pointer for objects that maintain their own
-// internal reference count, and RefCountedBase/RefCountedBaseVPTR, two
-// generic base classes for objects that wish to have their lifetimes
-// managed using reference counting.
-//
-// IntrusiveRefCntPtr is similar to Boost's intrusive_ptr with added
-// LLVM-style casting.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_ADT_INTRUSIVE_REF_CNT_PTR
-#define LLVM_ADT_INTRUSIVE_REF_CNT_PTR
-
-#include <cassert>
-
-#include "llvm/Support/Casting.h"
-
-namespace llvm {
-
- template <class T>
- class IntrusiveRefCntPtr;
-
-//===----------------------------------------------------------------------===//
-/// RefCountedBase - A generic base class for objects that wish to
-/// have their lifetimes managed using reference counts. Classes
-/// subclass RefCountedBase to obtain such functionality, and are
-/// typically handled with IntrusivePtr "smart pointers" (see below)
-/// which automatically handle the management of reference counts.
-/// Objects that subclass RefCountedBase should not be allocated on
-/// the stack, as invoking "delete" (which is called when the
-/// reference count hits 0) on such objects is an error.
-//===----------------------------------------------------------------------===//
- template <class Derived>
- class RefCountedBase {
- unsigned ref_cnt;
-
- protected:
- RefCountedBase() : ref_cnt(0) {}
-
- void Retain() { ++ref_cnt; }
- void Release() {
- assert (ref_cnt > 0 && "Reference count is already zero.");
- if (--ref_cnt == 0) delete static_cast<Derived*>(this);
- }
-
- friend class IntrusiveRefCntPtr<Derived>;
- };
-
-//===----------------------------------------------------------------------===//
-/// RefCountedBaseVPTR - A class that has the same function as
-/// RefCountedBase, but with a virtual destructor. Should be used
-/// instead of RefCountedBase for classes that already have virtual
-/// methods to enforce dynamic allocation via 'new'. Classes that
-/// inherit from RefCountedBaseVPTR can't be allocated on stack -
-/// attempting to do this will produce a compile error.
-//===----------------------------------------------------------------------===//
- template <class Derived>
- class RefCountedBaseVPTR {
- unsigned ref_cnt;
-
- protected:
- RefCountedBaseVPTR() : ref_cnt(0) {}
- virtual ~RefCountedBaseVPTR() {}
-
- void Retain() { ++ref_cnt; }
- void Release() {
- assert (ref_cnt > 0 && "Reference count is already zero.");
- if (--ref_cnt == 0) delete this;
- }
-
- friend class IntrusiveRefCntPtr<Derived>;
- };
-
-//===----------------------------------------------------------------------===//
-/// IntrusiveRefCntPtr - A template class that implements a "smart pointer"
-/// that assumes the wrapped object has a reference count associated
-/// with it that can be managed via calls to
-/// IntrusivePtrAddRef/IntrusivePtrRelease. The smart pointers
-/// manage reference counts via the RAII idiom: upon creation of
-/// smart pointer the reference count of the wrapped object is
-/// incremented and upon destruction of the smart pointer the
-/// reference count is decremented. This class also safely handles
-/// wrapping NULL pointers.
-///
-/// Reference counting is implemented via calls to
-/// Obj->Retain()/Obj->Release(). Release() is required to destroy
-/// the object when the reference count reaches zero. Inheriting from
-/// RefCountedBase/RefCountedBaseVPTR takes care of this
-/// automatically.
-//===----------------------------------------------------------------------===//
- template <typename T>
- class IntrusiveRefCntPtr {
- T* Obj;
- typedef IntrusiveRefCntPtr this_type;
- public:
- typedef T element_type;
-
- explicit IntrusiveRefCntPtr() : Obj(0) {}
-
- explicit IntrusiveRefCntPtr(T* obj) : Obj(obj) {
- retain();
- }
-
- IntrusiveRefCntPtr(const IntrusiveRefCntPtr& S) : Obj(S.Obj) {
- retain();
- }
-
- template <class X>
- IntrusiveRefCntPtr(const IntrusiveRefCntPtr<X>& S)
- : Obj(S.getPtr()) {
- retain();
- }
-
- IntrusiveRefCntPtr& operator=(const IntrusiveRefCntPtr& S) {
- replace(S.getPtr());
- return *this;
- }
-
- template <class X>
- IntrusiveRefCntPtr& operator=(const IntrusiveRefCntPtr<X>& S) {
- replace(S.getPtr());
- return *this;
- }
-
- IntrusiveRefCntPtr& operator=(T * S) {
- replace(S);
- return *this;
- }
-
- ~IntrusiveRefCntPtr() { release(); }
-
- T& operator*() const { return *Obj; }
-
- T* operator->() const { return Obj; }
-
- T* getPtr() const { return Obj; }
-
- typedef T* (IntrusiveRefCntPtr::*unspecified_bool_type) () const;
- operator unspecified_bool_type() const {
- return Obj == 0 ? 0 : &IntrusiveRefCntPtr::getPtr;
- }
-
- void swap(IntrusiveRefCntPtr& other) {
- T* tmp = other.Obj;
- other.Obj = Obj;
- Obj = tmp;
- }
-
- private:
- void retain() { if (Obj) Obj->Retain(); }
- void release() { if (Obj) Obj->Release(); }
-
- void replace(T* S) {
- this_type(S).swap(*this);
- }
- };
-
- template<class T, class U>
- inline bool operator==(const IntrusiveRefCntPtr<T>& A,
- const IntrusiveRefCntPtr<U>& B)
- {
- return A.getPtr() == B.getPtr();
- }
-
- template<class T, class U>
- inline bool operator!=(const IntrusiveRefCntPtr<T>& A,
- const IntrusiveRefCntPtr<U>& B)
- {
- return A.getPtr() != B.getPtr();
- }
-
- template<class T, class U>
- inline bool operator==(const IntrusiveRefCntPtr<T>& A,
- U* B)
- {
- return A.getPtr() == B;
- }
-
- template<class T, class U>
- inline bool operator!=(const IntrusiveRefCntPtr<T>& A,
- U* B)
- {
- return A.getPtr() != B;
- }
-
- template<class T, class U>
- inline bool operator==(T* A,
- const IntrusiveRefCntPtr<U>& B)
- {
- return A == B.getPtr();
- }
-
- template<class T, class U>
- inline bool operator!=(T* A,
- const IntrusiveRefCntPtr<U>& B)
- {
- return A != B.getPtr();
- }
-
-//===----------------------------------------------------------------------===//
-// LLVM-style downcasting support for IntrusiveRefCntPtr objects
-//===----------------------------------------------------------------------===//
-
- template<class T> struct simplify_type<IntrusiveRefCntPtr<T> > {
- typedef T* SimpleType;
- static SimpleType getSimplifiedValue(const IntrusiveRefCntPtr<T>& Val) {
- return Val.getPtr();
- }
- };
-
- template<class T> struct simplify_type<const IntrusiveRefCntPtr<T> > {
- typedef T* SimpleType;
- static SimpleType getSimplifiedValue(const IntrusiveRefCntPtr<T>& Val) {
- return Val.getPtr();
- }
- };
-
-} // end namespace llvm
-
-#endif // LLVM_ADT_INTRUSIVE_REF_CNT_PTR
diff --git a/release_23/include/llvm/ADT/OwningPtr.h b/release_23/include/llvm/ADT/OwningPtr.h
deleted file mode 100644
index 95d7db17b912..000000000000
--- a/release_23/include/llvm/ADT/OwningPtr.h
+++ /dev/null
@@ -1,134 +0,0 @@
-//===- llvm/ADT/OwningPtr.h - Smart ptr that owns the pointee ---*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines and implements the OwningPtr class.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_ADT_OWNING_PTR_H
-#define LLVM_ADT_OWNING_PTR_H
-
-#include <cassert>
-#include <cstddef>
-
-namespace llvm {
-
-/// OwningPtr smart pointer - OwningPtr mimics a built-in pointer except that it
-/// guarantees deletion of the object pointed to, either on destruction of the
-/// OwningPtr or via an explicit reset(). Once created, ownership of the
-/// pointee object can be taken away from OwningPtr by using the take method.
-template<class T>
-class OwningPtr {
- OwningPtr(OwningPtr const &); // DO NOT IMPLEMENT
- OwningPtr &operator=(OwningPtr const &); // DO NOT IMPLEMENT
- T *Ptr;
-public:
- explicit OwningPtr(T *P = 0) : Ptr(P) {}
-
- ~OwningPtr() {
- delete Ptr;
- }
-
- /// reset - Change the current pointee to the specified pointer. Note that
- /// calling this with any pointer (including a null pointer) deletes the
- /// current pointer.
- void reset(T *P = 0) {
- if (P == Ptr) return;
- T *Tmp = Ptr;
- Ptr = P;
- delete Tmp;
- }
-
- /// take - Reset the owning pointer to null and return its pointer. This does
- /// not delete the pointer before returning it.
- T *take() {
- T *Tmp = Ptr;
- Ptr = 0;
- return Tmp;
- }
-
- T &operator*() const {
- assert(Ptr && "Cannot dereference null pointer");
- return *Ptr;
- }
-
- T *operator->() const { return Ptr; }
- T *get() const { return Ptr; }
- operator bool() const { return Ptr != 0; }
- bool operator!() const { return Ptr == 0; }
-
- void swap(OwningPtr &RHS) {
- T *Tmp = RHS.Ptr;
- RHS.Ptr = Ptr;
- Ptr = Tmp;
- }
-};
-
-template<class T>
-inline void swap(OwningPtr<T> &a, OwningPtr<T> &b) {
- a.swap(b);
-}
-
-/// OwningArrayPtr smart pointer - OwningArrayPtr provides the same
-/// functionality as OwningPtr, except that it works for array types.
-template<class T>
-class OwningArrayPtr {
- OwningArrayPtr(OwningArrayPtr const &); // DO NOT IMPLEMENT
- OwningArrayPtr &operator=(OwningArrayPtr const &); // DO NOT IMPLEMENT
- T *Ptr;
-public:
- explicit OwningArrayPtr(T *P = 0) : Ptr(P) {}
-
- ~OwningArrayPtr() {
- delete [] Ptr;
- }
-
- /// reset - Change the current pointee to the specified pointer. Note that
- /// calling this with any pointer (including a null pointer) deletes the
- /// current pointer.
- void reset(T *P = 0) {
- if (P == Ptr) return;
- T *Tmp = Ptr;
- Ptr = P;
- delete Tmp;
- }
-
- /// take - Reset the owning pointer to null and return its pointer. This does
- /// not delete the pointer before returning it.
- T *take() {
- T *Tmp = Ptr;
- Ptr = 0;
- return Tmp;
- }
-
- T &operator[](std::ptrdiff_t i) const {
- assert(Ptr && "Cannot dereference null pointer");
- return Ptr[i];
- }
-
- T *get() const { return Ptr; }
- operator bool() const { return Ptr != 0; }
- bool operator!() const { return Ptr == 0; }
-
- void swap(OwningArrayPtr &RHS) {
- T *Tmp = RHS.Ptr;
- RHS.Ptr = Ptr;
- Ptr = Tmp;
- }
-};
-
-template<class T>
-inline void swap(OwningArrayPtr<T> &a, OwningArrayPtr<T> &b) {
- a.swap(b);
-}
-
-
-} // end namespace llvm
-
-#endif
diff --git a/release_23/include/llvm/ADT/PostOrderIterator.h b/release_23/include/llvm/ADT/PostOrderIterator.h
deleted file mode 100644
index f68de30ff610..000000000000
--- a/release_23/include/llvm/ADT/PostOrderIterator.h
+++ /dev/null
@@ -1,230 +0,0 @@
-//===- llvm/ADT/PostOrderIterator.h - PostOrder iterator --------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file builds on the ADT/GraphTraits.h file to build a generic graph
-// post order iterator. This should work over any graph type that has a
-// GraphTraits specialization.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_ADT_POSTORDERITERATOR_H
-#define LLVM_ADT_POSTORDERITERATOR_H
-
-#include "llvm/ADT/GraphTraits.h"
-#include "llvm/ADT/iterator"
-#include <stack>
-#include <set>
-#include <vector>
-
-namespace llvm {
-
-template<class SetType, bool External> // Non-external set
-class po_iterator_storage {
-public:
- SetType Visited;
-};
-
-template<class SetType>
-class po_iterator_storage<SetType, true> {
-public:
- po_iterator_storage(SetType &VSet) : Visited(VSet) {}
- po_iterator_storage(const po_iterator_storage &S) : Visited(S.Visited) {}
- SetType &Visited;
-};
-
-template<class GraphT,
- class SetType = std::set<typename GraphTraits<GraphT>::NodeType*>,
- bool ExtStorage = false,
- class GT = GraphTraits<GraphT> >
-class po_iterator : public forward_iterator<typename GT::NodeType, ptrdiff_t>,
- public po_iterator_storage<SetType, ExtStorage> {
- typedef forward_iterator<typename GT::NodeType, ptrdiff_t> super;
- typedef typename GT::NodeType NodeType;
- typedef typename GT::ChildIteratorType ChildItTy;
-
- // VisitStack - Used to maintain the ordering. Top = current block
- // First element is basic block pointer, second is the 'next child' to visit
- std::stack<std::pair<NodeType *, ChildItTy> > VisitStack;
-
- void traverseChild() {
- while (VisitStack.top().second != GT::child_end(VisitStack.top().first)) {
- NodeType *BB = *VisitStack.top().second++;
- if (!this->Visited.count(BB)) { // If the block is not visited...
- this->Visited.insert(BB);
- VisitStack.push(std::make_pair(BB, GT::child_begin(BB)));
- }
- }
- }
-
- inline po_iterator(NodeType *BB) {
- this->Visited.insert(BB);
- VisitStack.push(std::make_pair(BB, GT::child_begin(BB)));
- traverseChild();
- }
- inline po_iterator() {} // End is when stack is empty.
-
- inline po_iterator(NodeType *BB, SetType &S) :
- po_iterator_storage<SetType, ExtStorage>(&S) {
- if(!S.count(BB)) {
- this->Visited.insert(BB);
- VisitStack.push(std::make_pair(BB, GT::child_begin(BB)));
- traverseChild();
- }
- }
-
- inline po_iterator(SetType &S) :
- po_iterator_storage<SetType, ExtStorage>(&S) {
- } // End is when stack is empty.
-public:
- typedef typename super::pointer pointer;
- typedef po_iterator<GraphT, SetType, ExtStorage, GT> _Self;
-
- // Provide static "constructors"...
- static inline _Self begin(GraphT G) { return _Self(GT::getEntryNode(G)); }
- static inline _Self end (GraphT G) { return _Self(); }
-
- static inline _Self begin(GraphT G, SetType &S) {
- return _Self(GT::getEntryNode(G), S);
- }
- static inline _Self end (GraphT G, SetType &S) { return _Self(S); }
-
- inline bool operator==(const _Self& x) const {
- return VisitStack == x.VisitStack;
- }
- inline bool operator!=(const _Self& x) const { return !operator==(x); }
-
- inline pointer operator*() const {
- return VisitStack.top().first;
- }
-
- // This is a nonstandard operator-> that dereferences the pointer an extra
- // time... so that you can actually call methods ON the BasicBlock, because
- // the contained type is a pointer. This allows BBIt->getTerminator() f.e.
- //
- inline NodeType *operator->() const { return operator*(); }
-
- inline _Self& operator++() { // Preincrement
- VisitStack.pop();
- if (!VisitStack.empty())
- traverseChild();
- return *this;
- }
-
- inline _Self operator++(int) { // Postincrement
- _Self tmp = *this; ++*this; return tmp;
- }
-};
-
-// Provide global constructors that automatically figure out correct types...
-//
-template <class T>
-po_iterator<T> po_begin(T G) { return po_iterator<T>::begin(G); }
-template <class T>
-po_iterator<T> po_end (T G) { return po_iterator<T>::end(G); }
-
-// Provide global definitions of external postorder iterators...
-template<class T, class SetType=std::set<typename GraphTraits<T>::NodeType*> >
-struct po_ext_iterator : public po_iterator<T, SetType, true> {
- po_ext_iterator(const po_iterator<T, SetType, true> &V) :
- po_iterator<T, SetType, true>(V) {}
-};
-
-template<class T, class SetType>
-po_ext_iterator<T, SetType> po_ext_begin(T G, SetType &S) {
- return po_ext_iterator<T, SetType>::begin(G, S);
-}
-
-template<class T, class SetType>
-po_ext_iterator<T, SetType> po_ext_end(T G, SetType &S) {
- return po_ext_iterator<T, SetType>::end(G, S);
-}
-
-// Provide global definitions of inverse post order iterators...
-template <class T,
- class SetType = std::set<typename GraphTraits<T>::NodeType*>,
- bool External = false>
-struct ipo_iterator : public po_iterator<Inverse<T>, SetType, External > {
- ipo_iterator(const po_iterator<Inverse<T>, SetType, External> &V) :
- po_iterator<Inverse<T>, SetType, External> (V) {}
-};
-
-template <class T>
-ipo_iterator<T> ipo_begin(T G, bool Reverse = false) {
- return ipo_iterator<T>::begin(G, Reverse);
-}
-
-template <class T>
-ipo_iterator<T> ipo_end(T G){
- return ipo_iterator<T>::end(G);
-}
-
-//Provide global definitions of external inverse postorder iterators...
-template <class T, class SetType = std::set<typename GraphTraits<T>::NodeType*> >
-struct ipo_ext_iterator : public ipo_iterator<T, SetType, true> {
- ipo_ext_iterator(const ipo_iterator<T, SetType, true> &V) :
- ipo_iterator<T, SetType, true>(&V) {}
- ipo_ext_iterator(const po_iterator<Inverse<T>, SetType, true> &V) :
- ipo_iterator<T, SetType, true>(&V) {}
-};
-
-template <class T, class SetType>
-ipo_ext_iterator<T, SetType> ipo_ext_begin(T G, SetType &S) {
- return ipo_ext_iterator<T, SetType>::begin(G, S);
-}
-
-template <class T, class SetType>
-ipo_ext_iterator<T, SetType> ipo_ext_end(T G, SetType &S) {
- return ipo_ext_iterator<T, SetType>::end(G, S);
-}
-
-//===--------------------------------------------------------------------===//
-// Reverse Post Order CFG iterator code
-//===--------------------------------------------------------------------===//
-//
-// This is used to visit basic blocks in a method in reverse post order. This
-// class is awkward to use because I don't know a good incremental algorithm to
-// computer RPO from a graph. Because of this, the construction of the
-// ReversePostOrderTraversal object is expensive (it must walk the entire graph
-// with a postorder iterator to build the data structures). The moral of this
-// story is: Don't create more ReversePostOrderTraversal classes than necessary.
-//
-// This class should be used like this:
-// {
-// ReversePostOrderTraversal<Function*> RPOT(FuncPtr); // Expensive to create
-// for (rpo_iterator I = RPOT.begin(); I != RPOT.end(); ++I) {
-// ...
-// }
-// for (rpo_iterator I = RPOT.begin(); I != RPOT.end(); ++I) {
-// ...
-// }
-// }
-//
-
-template<class GraphT, class GT = GraphTraits<GraphT> >
-class ReversePostOrderTraversal {
- typedef typename GT::NodeType NodeType;
- std::vector<NodeType*> Blocks; // Block list in normal PO order
- inline void Initialize(NodeType *BB) {
- copy(po_begin(BB), po_end(BB), back_inserter(Blocks));
- }
-public:
- typedef typename std::vector<NodeType*>::reverse_iterator rpo_iterator;
-
- inline ReversePostOrderTraversal(GraphT G) {
- Initialize(GT::getEntryNode(G));
- }
-
- // Because we want a reverse post order, use reverse iterators from the vector
- inline rpo_iterator begin() { return Blocks.rbegin(); }
- inline rpo_iterator end() { return Blocks.rend(); }
-};
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/ADT/SCCIterator.h b/release_23/include/llvm/ADT/SCCIterator.h
deleted file mode 100644
index bd18f13ada99..000000000000
--- a/release_23/include/llvm/ADT/SCCIterator.h
+++ /dev/null
@@ -1,199 +0,0 @@
-//===-- Support/SCCIterator.h - Strongly Connected Comp. Iter. --*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This builds on the llvm/ADT/GraphTraits.h file to find the strongly connected
-// components (SCCs) of a graph in O(N+E) time using Tarjan's DFS algorithm.
-//
-// The SCC iterator has the important property that if a node in SCC S1 has an
-// edge to a node in SCC S2, then it visits S1 *after* S2.
-//
-// To visit S1 *before* S2, use the scc_iterator on the Inverse graph.
-// (NOTE: This requires some simple wrappers and is not supported yet.)
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_ADT_SCCITERATOR_H
-#define LLVM_ADT_SCCITERATOR_H
-
-#include "llvm/ADT/GraphTraits.h"
-#include "llvm/ADT/iterator"
-#include <vector>
-#include <map>
-
-namespace llvm {
-
-//===----------------------------------------------------------------------===//
-///
-/// scc_iterator - Enumerate the SCCs of a directed graph, in
-/// reverse topological order of the SCC DAG.
-///
-template<class GraphT, class GT = GraphTraits<GraphT> >
-class scc_iterator
- : public forward_iterator<std::vector<typename GT::NodeType>, ptrdiff_t> {
- typedef typename GT::NodeType NodeType;
- typedef typename GT::ChildIteratorType ChildItTy;
- typedef std::vector<NodeType*> SccTy;
- typedef forward_iterator<SccTy, ptrdiff_t> super;
- typedef typename super::reference reference;
- typedef typename super::pointer pointer;
-
- // The visit counters used to detect when a complete SCC is on the stack.
- // visitNum is the global counter.
- // nodeVisitNumbers are per-node visit numbers, also used as DFS flags.
- unsigned visitNum;
- std::map<NodeType *, unsigned> nodeVisitNumbers;
-
- // SCCNodeStack - Stack holding nodes of the SCC.
- std::vector<NodeType *> SCCNodeStack;
-
- // CurrentSCC - The current SCC, retrieved using operator*().
- SccTy CurrentSCC;
-
- // VisitStack - Used to maintain the ordering. Top = current block
- // First element is basic block pointer, second is the 'next child' to visit
- std::vector<std::pair<NodeType *, ChildItTy> > VisitStack;
-
- // MinVistNumStack - Stack holding the "min" values for each node in the DFS.
- // This is used to track the minimum uplink values for all children of
- // the corresponding node on the VisitStack.
- std::vector<unsigned> MinVisitNumStack;
-
- // A single "visit" within the non-recursive DFS traversal.
- void DFSVisitOne(NodeType* N) {
- ++visitNum; // Global counter for the visit order
- nodeVisitNumbers[N] = visitNum;
- SCCNodeStack.push_back(N);
- MinVisitNumStack.push_back(visitNum);
- VisitStack.push_back(std::make_pair(N, GT::child_begin(N)));
- //DOUT << "TarjanSCC: Node " << N <<
- // " : visitNum = " << visitNum << "\n";
- }
-
- // The stack-based DFS traversal; defined below.
- void DFSVisitChildren() {
- assert(!VisitStack.empty());
- while (VisitStack.back().second != GT::child_end(VisitStack.back().first)) {
- // TOS has at least one more child so continue DFS
- NodeType *childN = *VisitStack.back().second++;
- if (!nodeVisitNumbers.count(childN)) {
- // this node has never been seen
- DFSVisitOne(childN);
- } else {
- unsigned childNum = nodeVisitNumbers[childN];
- if (MinVisitNumStack.back() > childNum)
- MinVisitNumStack.back() = childNum;
- }
- }
- }
-
- // Compute the next SCC using the DFS traversal.
- void GetNextSCC() {
- assert(VisitStack.size() == MinVisitNumStack.size());
- CurrentSCC.clear(); // Prepare to compute the next SCC
- while (!VisitStack.empty()) {
- DFSVisitChildren();
- assert(VisitStack.back().second ==GT::child_end(VisitStack.back().first));
- NodeType* visitingN = VisitStack.back().first;
- unsigned minVisitNum = MinVisitNumStack.back();
- VisitStack.pop_back();
- MinVisitNumStack.pop_back();
- if (!MinVisitNumStack.empty() && MinVisitNumStack.back() > minVisitNum)
- MinVisitNumStack.back() = minVisitNum;
-
- //DOUT << "TarjanSCC: Popped node " << visitingN <<
- // " : minVisitNum = " << minVisitNum << "; Node visit num = " <<
- // nodeVisitNumbers[visitingN] << "\n";
-
- if (minVisitNum == nodeVisitNumbers[visitingN]) {
- // A full SCC is on the SCCNodeStack! It includes all nodes below
- // visitingN on the stack. Copy those nodes to CurrentSCC,
- // reset their minVisit values, and return (this suspends
- // the DFS traversal till the next ++).
- do {
- CurrentSCC.push_back(SCCNodeStack.back());
- SCCNodeStack.pop_back();
- nodeVisitNumbers[CurrentSCC.back()] = ~0U;
- } while (CurrentSCC.back() != visitingN);
- return;
- }
- }
- }
-
- inline scc_iterator(NodeType *entryN) : visitNum(0) {
- DFSVisitOne(entryN);
- GetNextSCC();
- }
- inline scc_iterator() { /* End is when DFS stack is empty */ }
-
-public:
- typedef scc_iterator<GraphT, GT> _Self;
-
- // Provide static "constructors"...
- static inline _Self begin(GraphT& G) { return _Self(GT::getEntryNode(G)); }
- static inline _Self end (GraphT& G) { return _Self(); }
-
- // Direct loop termination test (I.fini() is more efficient than I == end())
- inline bool fini() const {
- assert(!CurrentSCC.empty() || VisitStack.empty());
- return CurrentSCC.empty();
- }
-
- inline bool operator==(const _Self& x) const {
- return VisitStack == x.VisitStack && CurrentSCC == x.CurrentSCC;
- }
- inline bool operator!=(const _Self& x) const { return !operator==(x); }
-
- // Iterator traversal: forward iteration only
- inline _Self& operator++() { // Preincrement
- GetNextSCC();
- return *this;
- }
- inline _Self operator++(int) { // Postincrement
- _Self tmp = *this; ++*this; return tmp;
- }
-
- // Retrieve a reference to the current SCC
- inline const SccTy &operator*() const {
- assert(!CurrentSCC.empty() && "Dereferencing END SCC iterator!");
- return CurrentSCC;
- }
- inline SccTy &operator*() {
- assert(!CurrentSCC.empty() && "Dereferencing END SCC iterator!");
- return CurrentSCC;
- }
-
- // hasLoop() -- Test if the current SCC has a loop. If it has more than one
- // node, this is trivially true. If not, it may still contain a loop if the
- // node has an edge back to itself.
- bool hasLoop() const {
- assert(!CurrentSCC.empty() && "Dereferencing END SCC iterator!");
- if (CurrentSCC.size() > 1) return true;
- NodeType *N = CurrentSCC.front();
- for (ChildItTy CI = GT::child_begin(N), CE=GT::child_end(N); CI != CE; ++CI)
- if (*CI == N)
- return true;
- return false;
- }
-};
-
-
-// Global constructor for the SCC iterator.
-template <class T>
-scc_iterator<T> scc_begin(T G) {
- return scc_iterator<T>::begin(G);
-}
-
-template <class T>
-scc_iterator<T> scc_end(T G) {
- return scc_iterator<T>::end(G);
-}
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/ADT/STLExtras.h b/release_23/include/llvm/ADT/STLExtras.h
deleted file mode 100644
index dd1b5416330d..000000000000
--- a/release_23/include/llvm/ADT/STLExtras.h
+++ /dev/null
@@ -1,223 +0,0 @@
-//===- llvm/ADT/STLExtras.h - Useful STL related functions ------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains some templates that are useful if you are working with the
-// STL at all.
-//
-// No library is required when using these functinons.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_ADT_STLEXTRAS_H
-#define LLVM_ADT_STLEXTRAS_H
-
-#include <functional>
-#include <utility> // for std::pair
-#include <cstring> // for std::size_t
-#include "llvm/ADT/iterator"
-
-namespace llvm {
-
-//===----------------------------------------------------------------------===//
-// Extra additions to <functional>
-//===----------------------------------------------------------------------===//
-
-template<class Ty>
-struct greater_ptr : public std::binary_function<Ty, Ty, bool> {
- bool operator()(const Ty* left, const Ty* right) const {
- return *right < *left;
- }
-};
-
-// deleter - Very very very simple method that is used to invoke operator
-// delete on something. It is used like this:
-//
-// for_each(V.begin(), B.end(), deleter<Interval>);
-//
-template <class T>
-static inline void deleter(T *Ptr) {
- delete Ptr;
-}
-
-
-
-//===----------------------------------------------------------------------===//
-// Extra additions to <iterator>
-//===----------------------------------------------------------------------===//
-
-// mapped_iterator - This is a simple iterator adapter that causes a function to
-// be dereferenced whenever operator* is invoked on the iterator.
-//
-template <class RootIt, class UnaryFunc>
-class mapped_iterator {
- RootIt current;
- UnaryFunc Fn;
-public:
- typedef typename std::iterator_traits<RootIt>::iterator_category
- iterator_category;
- typedef typename std::iterator_traits<RootIt>::difference_type
- difference_type;
- typedef typename UnaryFunc::result_type value_type;
-
- typedef void pointer;
- //typedef typename UnaryFunc::result_type *pointer;
- typedef void reference; // Can't modify value returned by fn
-
- typedef RootIt iterator_type;
- typedef mapped_iterator<RootIt, UnaryFunc> _Self;
-
- inline const RootIt &getCurrent() const { return current; }
-
- inline explicit mapped_iterator(const RootIt &I, UnaryFunc F)
- : current(I), Fn(F) {}
- inline mapped_iterator(const mapped_iterator &It)
- : current(It.current), Fn(It.Fn) {}
-
- inline value_type operator*() const { // All this work to do this
- return Fn(*current); // little change
- }
-
- _Self& operator++() { ++current; return *this; }
- _Self& operator--() { --current; return *this; }
- _Self operator++(int) { _Self __tmp = *this; ++current; return __tmp; }
- _Self operator--(int) { _Self __tmp = *this; --current; return __tmp; }
- _Self operator+ (difference_type n) const { return _Self(current + n); }
- _Self& operator+= (difference_type n) { current += n; return *this; }
- _Self operator- (difference_type n) const { return _Self(current - n); }
- _Self& operator-= (difference_type n) { current -= n; return *this; }
- reference operator[](difference_type n) const { return *(*this + n); }
-
- inline bool operator!=(const _Self &X) const { return !operator==(X); }
- inline bool operator==(const _Self &X) const { return current == X.current; }
- inline bool operator< (const _Self &X) const { return current < X.current; }
-
- inline difference_type operator-(const _Self &X) const {
- return current - X.current;
- }
-};
-
-template <class _Iterator, class Func>
-inline mapped_iterator<_Iterator, Func>
-operator+(typename mapped_iterator<_Iterator, Func>::difference_type N,
- const mapped_iterator<_Iterator, Func>& X) {
- return mapped_iterator<_Iterator, Func>(X.getCurrent() - N);
-}
-
-
-// map_iterator - Provide a convenient way to create mapped_iterators, just like
-// make_pair is useful for creating pairs...
-//
-template <class ItTy, class FuncTy>
-inline mapped_iterator<ItTy, FuncTy> map_iterator(const ItTy &I, FuncTy F) {
- return mapped_iterator<ItTy, FuncTy>(I, F);
-}
-
-
-// next/prior - These functions unlike std::advance do not modify the
-// passed iterator but return a copy.
-//
-// next(myIt) returns copy of myIt incremented once
-// next(myIt, n) returns copy of myIt incremented n times
-// prior(myIt) returns copy of myIt decremented once
-// prior(myIt, n) returns copy of myIt decremented n times
-
-template <typename ItTy, typename Dist>
-inline ItTy next(ItTy it, Dist n)
-{
- std::advance(it, n);
- return it;
-}
-
-template <typename ItTy>
-inline ItTy next(ItTy it)
-{
- std::advance(it, 1);
- return it;
-}
-
-template <typename ItTy, typename Dist>
-inline ItTy prior(ItTy it, Dist n)
-{
- std::advance(it, -n);
- return it;
-}
-
-template <typename ItTy>
-inline ItTy prior(ItTy it)
-{
- std::advance(it, -1);
- return it;
-}
-
-//===----------------------------------------------------------------------===//
-// Extra additions to <utility>
-//===----------------------------------------------------------------------===//
-
-// tie - this function ties two objects and returns a temporary object
-// that is assignable from a std::pair. This can be used to make code
-// more readable when using values returned from functions bundled in
-// a std::pair. Since an example is worth 1000 words:
-//
-// typedef std::map<int, int> Int2IntMap;
-//
-// Int2IntMap myMap;
-// Int2IntMap::iterator where;
-// bool inserted;
-// tie(where, inserted) = myMap.insert(std::make_pair(123,456));
-//
-// if (inserted)
-// // do stuff
-// else
-// // do other stuff
-
-namespace
-{
- template <typename T1, typename T2>
- struct tier {
- typedef T1 &first_type;
- typedef T2 &second_type;
-
- first_type first;
- second_type second;
-
- tier(first_type f, second_type s) : first(f), second(s) { }
- tier& operator=(const std::pair<T1, T2>& p) {
- first = p.first;
- second = p.second;
- return *this;
- }
- };
-}
-
-template <typename T1, typename T2>
-inline tier<T1, T2> tie(T1& f, T2& s) {
- return tier<T1, T2>(f, s);
-}
-
-//===----------------------------------------------------------------------===//
-// Extra additions to arrays
-//===----------------------------------------------------------------------===//
-
-/// Find where an array ends (for ending iterators)
-/// This returns a pointer to the byte immediately
-/// after the end of an array.
-template<class T, std::size_t N>
-inline T *array_endof(T (&x)[N]) {
- return x+N;
-}
-
-/// Find the length of an array.
-template<class T, std::size_t N>
-inline size_t array_lengthof(T (&x)[N]) {
- return N;
-}
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/ADT/SetOperations.h b/release_23/include/llvm/ADT/SetOperations.h
deleted file mode 100644
index 71f5db380f6e..000000000000
--- a/release_23/include/llvm/ADT/SetOperations.h
+++ /dev/null
@@ -1,71 +0,0 @@
-//===-- llvm/ADT/SetOperations.h - Generic Set Operations -------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines generic set operations that may be used on set's of
-// different types, and different element types.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_ADT_SETOPERATIONS_H
-#define LLVM_ADT_SETOPERATIONS_H
-
-namespace llvm {
-
-/// set_union(A, B) - Compute A := A u B, return whether A changed.
-///
-template <class S1Ty, class S2Ty>
-bool set_union(S1Ty &S1, const S2Ty &S2) {
- bool Changed = false;
-
- for (typename S2Ty::const_iterator SI = S2.begin(), SE = S2.end();
- SI != SE; ++SI)
- if (S1.insert(*SI).second)
- Changed = true;
-
- return Changed;
-}
-
-/// set_intersect(A, B) - Compute A := A ^ B
-/// Identical to set_intersection, except that it works on set<>'s and
-/// is nicer to use. Functionally, this iterates through S1, removing
-/// elements that are not contained in S2.
-///
-template <class S1Ty, class S2Ty>
-void set_intersect(S1Ty &S1, const S2Ty &S2) {
- for (typename S1Ty::iterator I = S1.begin(); I != S1.end();) {
- const typename S1Ty::key_type &E = *I;
- ++I;
- if (!S2.count(E)) S1.erase(E); // Erase element if not in S2
- }
-}
-
-/// set_difference(A, B) - Return A - B
-///
-template <class S1Ty, class S2Ty>
-S1Ty set_difference(const S1Ty &S1, const S2Ty &S2) {
- S1Ty Result;
- for (typename S1Ty::const_iterator SI = S1.begin(), SE = S1.end();
- SI != SE; ++SI)
- if (!S2.count(*SI)) // if the element is not in set2
- Result.insert(*SI);
- return Result;
-}
-
-/// set_subtract(A, B) - Compute A := A - B
-///
-template <class S1Ty, class S2Ty>
-void set_subtract(S1Ty &S1, const S2Ty &S2) {
- for (typename S2Ty::const_iterator SI = S2.begin(), SE = S2.end();
- SI != SE; ++SI)
- S1.erase(*SI);
-}
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/ADT/SetVector.h b/release_23/include/llvm/ADT/SetVector.h
deleted file mode 100644
index 7d6bbc78af3c..000000000000
--- a/release_23/include/llvm/ADT/SetVector.h
+++ /dev/null
@@ -1,168 +0,0 @@
-//===- llvm/ADT/SetVector.h - Set with insert order iteration ---*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements a set that has insertion order iteration
-// characteristics. This is useful for keeping a set of things that need to be
-// visited later but in a deterministic order (insertion order). The interface
-// is purposefully minimal.
-//
-// This file defines SetVector and SmallSetVector, which performs no allocations
-// if the SetVector has less than a certain number of elements.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_ADT_SETVECTOR_H
-#define LLVM_ADT_SETVECTOR_H
-
-#include "llvm/ADT/SmallSet.h"
-#include <vector>
-#include <cassert>
-#include <algorithm>
-
-namespace llvm {
-
-/// This adapter class provides a way to keep a set of things that also has the
-/// property of a deterministic iteration order. The order of iteration is the
-/// order of insertion.
-/// @brief A vector that has set insertion semantics.
-template <typename T, typename Vector = std::vector<T>,
- typename Set = SmallSet<T, 16> >
-class SetVector {
-public:
- typedef T value_type;
- typedef T key_type;
- typedef T& reference;
- typedef const T& const_reference;
- typedef Set set_type;
- typedef Vector vector_type;
- typedef typename vector_type::const_iterator iterator;
- typedef typename vector_type::const_iterator const_iterator;
- typedef typename vector_type::size_type size_type;
-
- /// @brief Construct an empty SetVector
- SetVector() {}
-
- /// @brief Initialize a SetVector with a range of elements
- template<typename It>
- SetVector(It Start, It End) {
- insert(Start, End);
- }
-
- /// @brief Determine if the SetVector is empty or not.
- bool empty() const {
- return vector_.empty();
- }
-
- /// @brief Determine the number of elements in the SetVector.
- size_type size() const {
- return vector_.size();
- }
-
- /// @brief Get an iterator to the beginning of the SetVector.
- iterator begin() {
- return vector_.begin();
- }
-
- /// @brief Get a const_iterator to the beginning of the SetVector.
- const_iterator begin() const {
- return vector_.begin();
- }
-
- /// @brief Get an iterator to the end of the SetVector.
- iterator end() {
- return vector_.end();
- }
-
- /// @brief Get a const_iterator to the end of the SetVector.
- const_iterator end() const {
- return vector_.end();
- }
-
- /// @brief Return the last element of the SetVector.
- const T &back() const {
- assert(!empty() && "Cannot call back() on empty SetVector!");
- return vector_.back();
- }
-
- /// @brief Index into the SetVector.
- const_reference operator[](size_type n) const {
- assert(n < vector_.size() && "SetVector access out of range!");
- return vector_[n];
- }
-
- /// @returns true iff the element was inserted into the SetVector.
- /// @brief Insert a new element into the SetVector.
- bool insert(const value_type &X) {
- bool result = set_.insert(X);
- if (result)
- vector_.push_back(X);
- return result;
- }
-
- /// @brief Insert a range of elements into the SetVector.
- template<typename It>
- void insert(It Start, It End) {
- for (; Start != End; ++Start)
- if (set_.insert(*Start))
- vector_.push_back(*Start);
- }
-
- /// @brief Remove an item from the set vector.
- void remove(const value_type& X) {
- if (set_.erase(X)) {
- typename vector_type::iterator I =
- std::find(vector_.begin(), vector_.end(), X);
- assert(I != vector_.end() && "Corrupted SetVector instances!");
- vector_.erase(I);
- }
- }
-
-
- /// @returns 0 if the element is not in the SetVector, 1 if it is.
- /// @brief Count the number of elements of a given key in the SetVector.
- size_type count(const key_type &key) const {
- return set_.count(key);
- }
-
- /// @brief Completely clear the SetVector
- void clear() {
- set_.clear();
- vector_.clear();
- }
-
- /// @brief Remove the last element of the SetVector.
- void pop_back() {
- assert(!empty() && "Cannot remove an element from an empty SetVector!");
- set_.erase(back());
- vector_.pop_back();
- }
-
-private:
- set_type set_; ///< The set.
- vector_type vector_; ///< The vector.
-};
-
-/// SmallSetVector - A SetVector that performs no allocations if smaller than
-/// a certain size.
-template <typename T, unsigned N>
-class SmallSetVector : public SetVector<T, SmallVector<T, N>, SmallSet<T, N> > {
-public:
- SmallSetVector() {}
-
- /// @brief Initialize a SmallSetVector with a range of elements
- template<typename It>
- SmallSetVector(It Start, It End) {
- this->insert(Start, End);
- }
-};
-
-} // End llvm namespace
-
-// vim: sw=2 ai
-#endif
diff --git a/release_23/include/llvm/ADT/SmallPtrSet.h b/release_23/include/llvm/ADT/SmallPtrSet.h
deleted file mode 100644
index f73a4a9bc4ca..000000000000
--- a/release_23/include/llvm/ADT/SmallPtrSet.h
+++ /dev/null
@@ -1,272 +0,0 @@
-//===- llvm/ADT/SmallPtrSet.h - 'Normally small' pointer set ----*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines the SmallPtrSet class. See the doxygen comment for
-// SmallPtrSetImpl for more details on the algorithm used.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_ADT_SMALLPTRSET_H
-#define LLVM_ADT_SMALLPTRSET_H
-
-#include <cassert>
-#include <cstring>
-#include "llvm/Support/DataTypes.h"
-
-namespace llvm {
-
-/// SmallPtrSetImpl - This is the common code shared among all the
-/// SmallPtrSet<>'s, which is almost everything. SmallPtrSet has two modes, one
-/// for small and one for large sets.
-///
-/// Small sets use an array of pointers allocated in the SmallPtrSet object,
-/// which is treated as a simple array of pointers. When a pointer is added to
-/// the set, the array is scanned to see if the element already exists, if not
-/// the element is 'pushed back' onto the array. If we run out of space in the
-/// array, we grow into the 'large set' case. SmallSet should be used when the
-/// sets are often small. In this case, no memory allocation is used, and only
-/// light-weight and cache-efficient scanning is used.
-///
-/// Large sets use a classic exponentially-probed hash table. Empty buckets are
-/// represented with an illegal pointer value (-1) to allow null pointers to be
-/// inserted. Tombstones are represented with another illegal pointer value
-/// (-2), to allow deletion. The hash table is resized when the table is 3/4 or
-/// more. When this happens, the table is doubled in size.
-///
-class SmallPtrSetImpl {
-protected:
- /// CurArray - This is the current set of buckets. If it points to
- /// SmallArray, then the set is in 'small mode'.
- const void **CurArray;
- /// CurArraySize - The allocated size of CurArray, always a power of two.
- /// Note that CurArray points to an array that has CurArraySize+1 elements in
- /// it, so that the end iterator actually points to valid memory.
- unsigned CurArraySize;
-
- // If small, this is # elts allocated consequtively
- unsigned NumElements;
- unsigned NumTombstones;
- const void *SmallArray[1]; // Must be last ivar.
-
- // Helper to copy construct a SmallPtrSet.
- SmallPtrSetImpl(const SmallPtrSetImpl& that);
-public:
- explicit SmallPtrSetImpl(unsigned SmallSize) {
- assert(SmallSize && (SmallSize & (SmallSize-1)) == 0 &&
- "Initial size must be a power of two!");
- CurArray = &SmallArray[0];
- CurArraySize = SmallSize;
- // The end pointer, always valid, is set to a valid element to help the
- // iterator.
- CurArray[SmallSize] = 0;
- clear();
- }
- ~SmallPtrSetImpl();
-
- bool empty() const { return size() == 0; }
- unsigned size() const { return NumElements; }
-
- static void *getTombstoneMarker() { return reinterpret_cast<void*>(-2); }
- static void *getEmptyMarker() {
- // Note that -1 is chosen to make clear() efficiently implementable with
- // memset and because it's not a valid pointer value.
- return reinterpret_cast<void*>(-1);
- }
-
- void clear() {
- // If the capacity of the array is huge, and the # elements used is small,
- // shrink the array.
- if (!isSmall() && NumElements*4 < CurArraySize && CurArraySize > 32)
- return shrink_and_clear();
-
- // Fill the array with empty markers.
- memset(CurArray, -1, CurArraySize*sizeof(void*));
- NumElements = 0;
- NumTombstones = 0;
- }
-
-protected:
- /// insert_imp - This returns true if the pointer was new to the set, false if
- /// it was already in the set. This is hidden from the client so that the
- /// derived class can check that the right type of pointer is passed in.
- bool insert_imp(const void * Ptr);
-
- /// erase_imp - If the set contains the specified pointer, remove it and
- /// return true, otherwise return false. This is hidden from the client so
- /// that the derived class can check that the right type of pointer is passed
- /// in.
- bool erase_imp(const void * Ptr);
-
- bool count_imp(const void * Ptr) const {
- if (isSmall()) {
- // Linear search for the item.
- for (const void *const *APtr = SmallArray,
- *const *E = SmallArray+NumElements; APtr != E; ++APtr)
- if (*APtr == Ptr)
- return true;
- return false;
- }
-
- // Big set case.
- return *FindBucketFor(Ptr) == Ptr;
- }
-
-private:
- bool isSmall() const { return CurArray == &SmallArray[0]; }
-
- unsigned Hash(const void *Ptr) const {
- return static_cast<unsigned>(((uintptr_t)Ptr >> 4) & (CurArraySize-1));
- }
- const void * const *FindBucketFor(const void *Ptr) const;
- void shrink_and_clear();
-
- /// Grow - Allocate a larger backing store for the buckets and move it over.
- void Grow();
-
- void operator=(const SmallPtrSetImpl &RHS); // DO NOT IMPLEMENT.
-protected:
- void CopyFrom(const SmallPtrSetImpl &RHS);
-};
-
-/// SmallPtrSetIteratorImpl - This is the common base class shared between all
-/// instances of SmallPtrSetIterator.
-class SmallPtrSetIteratorImpl {
-protected:
- const void *const *Bucket;
-public:
- explicit SmallPtrSetIteratorImpl(const void *const *BP) : Bucket(BP) {
- AdvanceIfNotValid();
- }
-
- bool operator==(const SmallPtrSetIteratorImpl &RHS) const {
- return Bucket == RHS.Bucket;
- }
- bool operator!=(const SmallPtrSetIteratorImpl &RHS) const {
- return Bucket != RHS.Bucket;
- }
-
-protected:
- /// AdvanceIfNotValid - If the current bucket isn't valid, advance to a bucket
- /// that is. This is guaranteed to stop because the end() bucket is marked
- /// valid.
- void AdvanceIfNotValid() {
- while (*Bucket == SmallPtrSetImpl::getEmptyMarker() ||
- *Bucket == SmallPtrSetImpl::getTombstoneMarker())
- ++Bucket;
- }
-};
-
-/// SmallPtrSetIterator - This implements a const_iterator for SmallPtrSet.
-template<typename PtrTy>
-class SmallPtrSetIterator : public SmallPtrSetIteratorImpl {
-public:
- explicit SmallPtrSetIterator(const void *const *BP)
- : SmallPtrSetIteratorImpl(BP) {}
-
- // Most methods provided by baseclass.
-
- const PtrTy operator*() const {
- return static_cast<const PtrTy>(const_cast<void*>(*Bucket));
- }
-
- inline SmallPtrSetIterator& operator++() { // Preincrement
- ++Bucket;
- AdvanceIfNotValid();
- return *this;
- }
-
- SmallPtrSetIterator operator++(int) { // Postincrement
- SmallPtrSetIterator tmp = *this; ++*this; return tmp;
- }
-};
-
-/// NextPowerOfTwo - This is a helper template that rounds N up to the next
-/// power of two.
-template<unsigned N>
-struct NextPowerOfTwo;
-
-/// NextPowerOfTwoH - If N is not a power of two, increase it. This is a helper
-/// template used to implement NextPowerOfTwo.
-template<unsigned N, bool isPowerTwo>
-struct NextPowerOfTwoH {
- enum { Val = N };
-};
-template<unsigned N>
-struct NextPowerOfTwoH<N, false> {
- enum {
- // We could just use NextVal = N+1, but this converges faster. N|(N-1) sets
- // the right-most zero bits to one all at once, e.g. 0b0011000 -> 0b0011111.
- Val = NextPowerOfTwo<(N|(N-1)) + 1>::Val
- };
-};
-
-template<unsigned N>
-struct NextPowerOfTwo {
- enum { Val = NextPowerOfTwoH<N, (N&(N-1)) == 0>::Val };
-};
-
-
-/// SmallPtrSet - This class implements a set which is optimizer for holding
-/// SmallSize or less elements. This internally rounds up SmallSize to the next
-/// power of two if it is not already a power of two. See the comments above
-/// SmallPtrSetImpl for details of the algorithm.
-template<class PtrType, unsigned SmallSize>
-class SmallPtrSet : public SmallPtrSetImpl {
- // Make sure that SmallSize is a power of two, round up if not.
- enum { SmallSizePowTwo = NextPowerOfTwo<SmallSize>::Val };
- void *SmallArray[SmallSizePowTwo];
-public:
- SmallPtrSet() : SmallPtrSetImpl(NextPowerOfTwo<SmallSizePowTwo>::Val) {}
- SmallPtrSet(const SmallPtrSet &that) : SmallPtrSetImpl(that) {}
-
- template<typename It>
- SmallPtrSet(It I, It E)
- : SmallPtrSetImpl(NextPowerOfTwo<SmallSizePowTwo>::Val) {
- insert(I, E);
- }
-
- /// insert - This returns true if the pointer was new to the set, false if it
- /// was already in the set.
- bool insert(PtrType Ptr) { return insert_imp(Ptr); }
-
- /// erase - If the set contains the specified pointer, remove it and return
- /// true, otherwise return false.
- bool erase(PtrType Ptr) { return erase_imp(Ptr); }
-
- /// count - Return true if the specified pointer is in the set.
- bool count(PtrType Ptr) const { return count_imp(Ptr); }
-
- template <typename IterT>
- void insert(IterT I, IterT E) {
- for (; I != E; ++I)
- insert(*I);
- }
-
- typedef SmallPtrSetIterator<PtrType> iterator;
- typedef SmallPtrSetIterator<PtrType> const_iterator;
- inline iterator begin() const {
- return iterator(CurArray);
- }
- inline iterator end() const {
- return iterator(CurArray+CurArraySize);
- }
-
- // Allow assignment from any smallptrset with the same element type even if it
- // doesn't have the same smallsize.
- const SmallPtrSet<PtrType, SmallSize>&
- operator=(const SmallPtrSet<PtrType, SmallSize> &RHS) {
- CopyFrom(RHS);
- return *this;
- }
-
-};
-
-}
-
-#endif
diff --git a/release_23/include/llvm/ADT/SmallSet.h b/release_23/include/llvm/ADT/SmallSet.h
deleted file mode 100644
index 51efad8e38c0..000000000000
--- a/release_23/include/llvm/ADT/SmallSet.h
+++ /dev/null
@@ -1,112 +0,0 @@
-//===- llvm/ADT/SmallSet.h - 'Normally small' sets --------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines the SmallSet class.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_ADT_SMALLSET_H
-#define LLVM_ADT_SMALLSET_H
-
-#include "llvm/ADT/SmallVector.h"
-#include "llvm/ADT/SmallPtrSet.h"
-#include <set>
-
-namespace llvm {
-
-/// SmallSet - This maintains a set of unique values, optimizing for the case
-/// when the set is small (less than N). In this case, the set can be
-/// maintained with no mallocs. If the set gets large, we expand to using an
-/// std::set to maintain reasonable lookup times.
-///
-/// Note that this set does not provide a way to iterate over members in the
-/// set.
-template <typename T, unsigned N>
-class SmallSet {
- /// Use a SmallVector to hold the elements here (even though it will never
- /// reach it's 'large' stage) to avoid calling the default ctors of elements
- /// we will never use.
- SmallVector<T, N> Vector;
- std::set<T> Set;
- typedef typename SmallVector<T, N>::const_iterator VIterator;
- typedef typename SmallVector<T, N>::iterator mutable_iterator;
-public:
- SmallSet() {}
-
- bool empty() const { return Vector.empty() && Set.empty(); }
- unsigned size() const {
- return isSmall() ? Vector.size() : Set.size();
- }
-
- /// count - Return true if the element is in the set.
- bool count(const T &V) const {
- if (isSmall()) {
- // Since the collection is small, just do a linear search.
- return vfind(V) != Vector.end();
- } else {
- return Set.count(V);
- }
- }
-
- /// insert - Insert an element into the set if it isn't already there.
- bool insert(const T &V) {
- if (!isSmall())
- return Set.insert(V).second;
-
- VIterator I = vfind(V);
- if (I != Vector.end()) // Don't reinsert if it already exists.
- return false;
- if (Vector.size() < N) {
- Vector.push_back(V);
- return true;
- }
-
- // Otherwise, grow from vector to set.
- while (!Vector.empty()) {
- Set.insert(Vector.back());
- Vector.pop_back();
- }
- Set.insert(V);
- return true;
- }
-
- bool erase(const T &V) {
- if (!isSmall())
- return Set.erase(V);
- for (mutable_iterator I = Vector.begin(), E = Vector.end(); I != E; ++I)
- if (*I == V) {
- Vector.erase(I);
- return true;
- }
- return false;
- }
-
- void clear() {
- Vector.clear();
- Set.clear();
- }
-private:
- bool isSmall() const { return Set.empty(); }
-
- VIterator vfind(const T &V) const {
- for (VIterator I = Vector.begin(), E = Vector.end(); I != E; ++I)
- if (*I == V)
- return I;
- return Vector.end();
- }
-};
-
-/// If this set is of pointer values, transparently switch over to using
-/// SmallPtrSet for performance.
-template <typename PointeeType, unsigned N>
-class SmallSet<PointeeType*, N> : public SmallPtrSet<PointeeType*, N> {};
-
-} // end namespace llvm
-
-#endif
diff --git a/release_23/include/llvm/ADT/SmallString.h b/release_23/include/llvm/ADT/SmallString.h
deleted file mode 100644
index b25d1eee30b1..000000000000
--- a/release_23/include/llvm/ADT/SmallString.h
+++ /dev/null
@@ -1,104 +0,0 @@
-//===- llvm/ADT/SmallString.h - 'Normally small' strings --------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines the SmallString class.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_ADT_SMALLSTRING_H
-#define LLVM_ADT_SMALLSTRING_H
-
-#include "llvm/ADT/SmallVector.h"
-#include "llvm/Support/DataTypes.h"
-#include <cstring>
-
-namespace llvm {
-
-/// SmallString - A SmallString is just a SmallVector with methods and accessors
-/// that make it work better as a string (e.g. operator+ etc).
-template<unsigned InternalLen>
-class SmallString : public SmallVector<char, InternalLen> {
-public:
- // Default ctor - Initialize to empty.
- SmallString() {}
-
- // Initialize with a range.
- template<typename ItTy>
- SmallString(ItTy S, ItTy E) : SmallVector<char, InternalLen>(S, E) {}
-
- // Copy ctor.
- SmallString(const SmallString &RHS) : SmallVector<char, InternalLen>(RHS) {}
-
-
- // Extra methods.
- const char *c_str() const {
- SmallString *This = const_cast<SmallString*>(this);
- // Ensure that there is a \0 at the end of the string.
- This->reserve(this->size()+1);
- This->End[0] = 0;
- return this->begin();
- }
-
- // Extra operators.
- SmallString &operator+=(const char *RHS) {
- this->append(RHS, RHS+strlen(RHS));
- return *this;
- }
- SmallString &operator+=(char C) {
- this->push_back(C);
- return *this;
- }
-
- SmallString &append_uint_32(uint32_t N) {
- char Buffer[20];
- char *BufPtr = Buffer+20;
-
- if (N == 0) *--BufPtr = '0'; // Handle special case.
-
- while (N) {
- *--BufPtr = '0' + char(N % 10);
- N /= 10;
- }
- this->append(BufPtr, Buffer+20);
- return *this;
- }
-
- SmallString &append_uint(uint64_t N) {
- if (N == uint32_t(N))
- return append_uint_32(uint32_t(N));
-
- char Buffer[40];
- char *BufPtr = Buffer+40;
-
- if (N == 0) *--BufPtr = '0'; // Handle special case...
-
- while (N) {
- *--BufPtr = '0' + char(N % 10);
- N /= 10;
- }
-
- this->append(BufPtr, Buffer+40);
- return *this;
- }
-
- SmallString &append_sint(int64_t N) {
- // TODO, wrong for minint64.
- if (N < 0) {
- this->push_back('-');
- N = -N;
- }
- return append_uint(N);
- }
-
-};
-
-
-}
-
-#endif
diff --git a/release_23/include/llvm/ADT/SmallVector.h b/release_23/include/llvm/ADT/SmallVector.h
deleted file mode 100644
index 2da6a788ebac..000000000000
--- a/release_23/include/llvm/ADT/SmallVector.h
+++ /dev/null
@@ -1,522 +0,0 @@
-//===- llvm/ADT/SmallVector.h - 'Normally small' vectors --------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines the SmallVector class.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_ADT_SMALLVECTOR_H
-#define LLVM_ADT_SMALLVECTOR_H
-
-#include "llvm/ADT/iterator"
-#include <algorithm>
-#include <memory>
-
-#ifdef _MSC_VER
-namespace std {
-#if _MSC_VER <= 1310
- // Work around flawed VC++ implementation of std::uninitialized_copy. Define
- // additional overloads so that elements with pointer types are recognized as
- // scalars and not objects, causing bizarre type conversion errors.
- template<class T1, class T2>
- inline _Scalar_ptr_iterator_tag _Ptr_cat(T1 **, T2 **) {
- _Scalar_ptr_iterator_tag _Cat;
- return _Cat;
- }
-
- template<class T1, class T2>
- inline _Scalar_ptr_iterator_tag _Ptr_cat(T1* const *, T2 **) {
- _Scalar_ptr_iterator_tag _Cat;
- return _Cat;
- }
-#else
-// FIXME: It is not clear if the problem is fixed in VS 2005. What is clear
-// is that the above hack won't work if it wasn't fixed.
-#endif
-}
-#endif
-
-namespace llvm {
-
-/// SmallVectorImpl - This class consists of common code factored out of the
-/// SmallVector class to reduce code duplication based on the SmallVector 'N'
-/// template parameter.
-template <typename T>
-class SmallVectorImpl {
-protected:
- T *Begin, *End, *Capacity;
-
- // Allocate raw space for N elements of type T. If T has a ctor or dtor, we
- // don't want it to be automatically run, so we need to represent the space as
- // something else. An array of char would work great, but might not be
- // aligned sufficiently. Instead, we either use GCC extensions, or some
- // number of union instances for the space, which guarantee maximal alignment.
-protected:
-#ifdef __GNUC__
- typedef char U;
- U FirstEl __attribute__((aligned));
-#else
- union U {
- double D;
- long double LD;
- long long L;
- void *P;
- } FirstEl;
-#endif
- // Space after 'FirstEl' is clobbered, do not add any instance vars after it.
-public:
- // Default ctor - Initialize to empty.
- SmallVectorImpl(unsigned N)
- : Begin(reinterpret_cast<T*>(&FirstEl)),
- End(reinterpret_cast<T*>(&FirstEl)),
- Capacity(reinterpret_cast<T*>(&FirstEl)+N) {
- }
-
- ~SmallVectorImpl() {
- // Destroy the constructed elements in the vector.
- destroy_range(Begin, End);
-
- // If this wasn't grown from the inline copy, deallocate the old space.
- if (!isSmall())
- delete[] reinterpret_cast<char*>(Begin);
- }
-
- typedef size_t size_type;
- typedef T* iterator;
- typedef const T* const_iterator;
-
- typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
- typedef std::reverse_iterator<iterator> reverse_iterator;
-
- typedef T& reference;
- typedef const T& const_reference;
-
- bool empty() const { return Begin == End; }
- size_type size() const { return End-Begin; }
-
- // forward iterator creation methods.
- iterator begin() { return Begin; }
- const_iterator begin() const { return Begin; }
- iterator end() { return End; }
- const_iterator end() const { return End; }
-
- // reverse iterator creation methods.
- reverse_iterator rbegin() { return reverse_iterator(end()); }
- const_reverse_iterator rbegin() const{ return const_reverse_iterator(end()); }
- reverse_iterator rend() { return reverse_iterator(begin()); }
- const_reverse_iterator rend() const { return const_reverse_iterator(begin());}
-
-
- reference operator[](unsigned idx) {
- return Begin[idx];
- }
- const_reference operator[](unsigned idx) const {
- return Begin[idx];
- }
-
- reference front() {
- return begin()[0];
- }
- const_reference front() const {
- return begin()[0];
- }
-
- reference back() {
- return end()[-1];
- }
- const_reference back() const {
- return end()[-1];
- }
-
- void push_back(const_reference Elt) {
- if (End < Capacity) {
- Retry:
- new (End) T(Elt);
- ++End;
- return;
- }
- grow();
- goto Retry;
- }
-
- void pop_back() {
- --End;
- End->~T();
- }
-
- void clear() {
- destroy_range(Begin, End);
- End = Begin;
- }
-
- void resize(unsigned N) {
- if (N < size()) {
- destroy_range(Begin+N, End);
- End = Begin+N;
- } else if (N > size()) {
- if (unsigned(Capacity-Begin) < N)
- grow(N);
- construct_range(End, Begin+N, T());
- End = Begin+N;
- }
- }
-
- void resize(unsigned N, const T &NV) {
- if (N < size()) {
- destroy_range(Begin+N, End);
- End = Begin+N;
- } else if (N > size()) {
- if (unsigned(Capacity-Begin) < N)
- grow(N);
- construct_range(End, Begin+N, NV);
- End = Begin+N;
- }
- }
-
- void reserve(unsigned N) {
- if (unsigned(Capacity-Begin) < N)
- grow(N);
- }
-
- void swap(SmallVectorImpl &RHS);
-
- /// append - Add the specified range to the end of the SmallVector.
- ///
- template<typename in_iter>
- void append(in_iter in_start, in_iter in_end) {
- size_type NumInputs = std::distance(in_start, in_end);
- // Grow allocated space if needed.
- if (End+NumInputs > Capacity)
- grow(size()+NumInputs);
-
- // Copy the new elements over.
- std::uninitialized_copy(in_start, in_end, End);
- End += NumInputs;
- }
-
- void assign(unsigned NumElts, const T &Elt) {
- clear();
- if (unsigned(Capacity-Begin) < NumElts)
- grow(NumElts);
- End = Begin+NumElts;
- construct_range(Begin, End, Elt);
- }
-
- iterator erase(iterator I) {
- iterator N = I;
- // Shift all elts down one.
- std::copy(I+1, End, I);
- // Drop the last elt.
- pop_back();
- return(N);
- }
-
- iterator erase(iterator S, iterator E) {
- iterator N = S;
- // Shift all elts down.
- iterator I = std::copy(E, End, S);
- // Drop the last elts.
- destroy_range(I, End);
- End = I;
- return(N);
- }
-
- iterator insert(iterator I, const T &Elt) {
- if (I == End) { // Important special case for empty vector.
- push_back(Elt);
- return end()-1;
- }
-
- if (End < Capacity) {
- Retry:
- new (End) T(back());
- ++End;
- // Push everything else over.
- std::copy_backward(I, End-1, End);
- *I = Elt;
- return I;
- }
- size_t EltNo = I-Begin;
- grow();
- I = Begin+EltNo;
- goto Retry;
- }
-
- template<typename ItTy>
- iterator insert(iterator I, ItTy From, ItTy To) {
- if (I == End) { // Important special case for empty vector.
- append(From, To);
- return end()-1;
- }
-
- size_t NumToInsert = std::distance(From, To);
- // Convert iterator to elt# to avoid invalidating iterator when we reserve()
- size_t InsertElt = I-begin();
-
- // Ensure there is enough space.
- reserve(static_cast<unsigned>(size() + NumToInsert));
-
- // Uninvalidate the iterator.
- I = begin()+InsertElt;
-
- // If we already have this many elements in the collection, append the
- // dest elements at the end, then copy over the appropriate elements. Since
- // we already reserved space, we know that this won't reallocate the vector.
- if (size() >= NumToInsert) {
- T *OldEnd = End;
- append(End-NumToInsert, End);
-
- // Copy the existing elements that get replaced.
- std::copy(I, OldEnd-NumToInsert, I+NumToInsert);
-
- std::copy(From, To, I);
- return I;
- }
-
- // Otherwise, we're inserting more elements than exist already, and we're
- // not inserting at the end.
-
- // Copy over the elements that we're about to overwrite.
- T *OldEnd = End;
- End += NumToInsert;
- size_t NumOverwritten = OldEnd-I;
- std::uninitialized_copy(I, OldEnd, End-NumOverwritten);
-
- // Replace the overwritten part.
- std::copy(From, From+NumOverwritten, I);
-
- // Insert the non-overwritten middle part.
- std::uninitialized_copy(From+NumOverwritten, To, OldEnd);
- return I;
- }
-
- const SmallVectorImpl &operator=(const SmallVectorImpl &RHS);
-
- bool operator==(const SmallVectorImpl &RHS) const {
- if (size() != RHS.size()) return false;
- for (T *This = Begin, *That = RHS.Begin, *End = Begin+size();
- This != End; ++This, ++That)
- if (*This != *That)
- return false;
- return true;
- }
- bool operator!=(const SmallVectorImpl &RHS) const { return !(*this == RHS); }
-
-private:
- /// isSmall - Return true if this is a smallvector which has not had dynamic
- /// memory allocated for it.
- bool isSmall() const {
- return reinterpret_cast<const void*>(Begin) ==
- reinterpret_cast<const void*>(&FirstEl);
- }
-
- /// grow - double the size of the allocated memory, guaranteeing space for at
- /// least one more element or MinSize if specified.
- void grow(size_type MinSize = 0);
-
- void construct_range(T *S, T *E, const T &Elt) {
- for (; S != E; ++S)
- new (S) T(Elt);
- }
-
- void destroy_range(T *S, T *E) {
- while (S != E) {
- --E;
- E->~T();
- }
- }
-};
-
-// Define this out-of-line to dissuade the C++ compiler from inlining it.
-template <typename T>
-void SmallVectorImpl<T>::grow(size_t MinSize) {
- size_t CurCapacity = Capacity-Begin;
- size_t CurSize = size();
- size_t NewCapacity = 2*CurCapacity;
- if (NewCapacity < MinSize)
- NewCapacity = MinSize;
- T *NewElts = reinterpret_cast<T*>(new char[NewCapacity*sizeof(T)]);
-
- // Copy the elements over.
- std::uninitialized_copy(Begin, End, NewElts);
-
- // Destroy the original elements.
- destroy_range(Begin, End);
-
- // If this wasn't grown from the inline copy, deallocate the old space.
- if (!isSmall())
- delete[] reinterpret_cast<char*>(Begin);
-
- Begin = NewElts;
- End = NewElts+CurSize;
- Capacity = Begin+NewCapacity;
-}
-
-template <typename T>
-void SmallVectorImpl<T>::swap(SmallVectorImpl<T> &RHS) {
- if (this == &RHS) return;
-
- // We can only avoid copying elements if neither vector is small.
- if (!isSmall() && !RHS.isSmall()) {
- std::swap(Begin, RHS.Begin);
- std::swap(End, RHS.End);
- std::swap(Capacity, RHS.Capacity);
- return;
- }
- if (Begin+RHS.size() > Capacity)
- grow(RHS.size());
- if (RHS.begin()+size() > RHS.Capacity)
- RHS.grow(size());
-
- // Swap the shared elements.
- size_t NumShared = size();
- if (NumShared > RHS.size()) NumShared = RHS.size();
- for (unsigned i = 0; i != static_cast<unsigned>(NumShared); ++i)
- std::swap(Begin[i], RHS[i]);
-
- // Copy over the extra elts.
- if (size() > RHS.size()) {
- size_t EltDiff = size() - RHS.size();
- std::uninitialized_copy(Begin+NumShared, End, RHS.End);
- RHS.End += EltDiff;
- destroy_range(Begin+NumShared, End);
- End = Begin+NumShared;
- } else if (RHS.size() > size()) {
- size_t EltDiff = RHS.size() - size();
- std::uninitialized_copy(RHS.Begin+NumShared, RHS.End, End);
- End += EltDiff;
- destroy_range(RHS.Begin+NumShared, RHS.End);
- RHS.End = RHS.Begin+NumShared;
- }
-}
-
-template <typename T>
-const SmallVectorImpl<T> &
-SmallVectorImpl<T>::operator=(const SmallVectorImpl<T> &RHS) {
- // Avoid self-assignment.
- if (this == &RHS) return *this;
-
- // If we already have sufficient space, assign the common elements, then
- // destroy any excess.
- unsigned RHSSize = unsigned(RHS.size());
- unsigned CurSize = unsigned(size());
- if (CurSize >= RHSSize) {
- // Assign common elements.
- iterator NewEnd;
- if (RHSSize)
- NewEnd = std::copy(RHS.Begin, RHS.Begin+RHSSize, Begin);
- else
- NewEnd = Begin;
-
- // Destroy excess elements.
- destroy_range(NewEnd, End);
-
- // Trim.
- End = NewEnd;
- return *this;
- }
-
- // If we have to grow to have enough elements, destroy the current elements.
- // This allows us to avoid copying them during the grow.
- if (unsigned(Capacity-Begin) < RHSSize) {
- // Destroy current elements.
- destroy_range(Begin, End);
- End = Begin;
- CurSize = 0;
- grow(RHSSize);
- } else if (CurSize) {
- // Otherwise, use assignment for the already-constructed elements.
- std::copy(RHS.Begin, RHS.Begin+CurSize, Begin);
- }
-
- // Copy construct the new elements in place.
- std::uninitialized_copy(RHS.Begin+CurSize, RHS.End, Begin+CurSize);
-
- // Set end.
- End = Begin+RHSSize;
- return *this;
-}
-
-/// SmallVector - This is a 'vector' (really, a variable-sized array), optimized
-/// for the case when the array is small. It contains some number of elements
-/// in-place, which allows it to avoid heap allocation when the actual number of
-/// elements is below that threshold. This allows normal "small" cases to be
-/// fast without losing generality for large inputs.
-///
-/// Note that this does not attempt to be exception safe.
-///
-template <typename T, unsigned N>
-class SmallVector : public SmallVectorImpl<T> {
- /// InlineElts - These are 'N-1' elements that are stored inline in the body
- /// of the vector. The extra '1' element is stored in SmallVectorImpl.
- typedef typename SmallVectorImpl<T>::U U;
- enum {
- // MinUs - The number of U's require to cover N T's.
- MinUs = (static_cast<unsigned int>(sizeof(T))*N +
- static_cast<unsigned int>(sizeof(U)) - 1) /
- static_cast<unsigned int>(sizeof(U)),
-
- // NumInlineEltsElts - The number of elements actually in this array. There
- // is already one in the parent class, and we have to round up to avoid
- // having a zero-element array.
- NumInlineEltsElts = (MinUs - 1) > 0 ? (MinUs - 1) : 1,
-
- // NumTsAvailable - The number of T's we actually have space for, which may
- // be more than N due to rounding.
- NumTsAvailable = (NumInlineEltsElts+1)*static_cast<unsigned int>(sizeof(U))/
- static_cast<unsigned int>(sizeof(T))
- };
- U InlineElts[NumInlineEltsElts];
-public:
- SmallVector() : SmallVectorImpl<T>(NumTsAvailable) {
- }
-
- explicit SmallVector(unsigned Size, const T &Value = T())
- : SmallVectorImpl<T>(NumTsAvailable) {
- this->reserve(Size);
- while (Size--)
- push_back(Value);
- }
-
- template<typename ItTy>
- SmallVector(ItTy S, ItTy E) : SmallVectorImpl<T>(NumTsAvailable) {
- append(S, E);
- }
-
- SmallVector(const SmallVector &RHS) : SmallVectorImpl<T>(NumTsAvailable) {
- if (!RHS.empty())
- operator=(RHS);
- }
-
- const SmallVector &operator=(const SmallVector &RHS) {
- SmallVectorImpl<T>::operator=(RHS);
- return *this;
- }
-
-};
-
-} // End llvm namespace
-
-namespace std {
- /// Implement std::swap in terms of SmallVector swap.
- template<typename T>
- inline void
- swap(llvm::SmallVectorImpl<T> &LHS, llvm::SmallVectorImpl<T> &RHS) {
- LHS.swap(RHS);
- }
-
- /// Implement std::swap in terms of SmallVector swap.
- template<typename T, unsigned N>
- inline void
- swap(llvm::SmallVector<T, N> &LHS, llvm::SmallVector<T, N> &RHS) {
- LHS.swap(RHS);
- }
-}
-
-#endif
diff --git a/release_23/include/llvm/ADT/SparseBitVector.h b/release_23/include/llvm/ADT/SparseBitVector.h
deleted file mode 100644
index 4c28682d3998..000000000000
--- a/release_23/include/llvm/ADT/SparseBitVector.h
+++ /dev/null
@@ -1,890 +0,0 @@
-//===- llvm/ADT/SparseBitVector.h - Efficient Sparse BitVector -*- C++ -*- ===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines the SparseBitVector class. See the doxygen comment for
-// SparseBitVector for more details on the algorithm used.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_ADT_SPARSEBITVECTOR_H
-#define LLVM_ADT_SPARSEBITVECTOR_H
-
-#include <cassert>
-#include <cstring>
-#include <algorithm>
-#include "llvm/Support/DataTypes.h"
-#include "llvm/ADT/STLExtras.h"
-#include "llvm/Support/MathExtras.h"
-#include "llvm/ADT/ilist"
-namespace llvm {
-
-/// SparseBitVector is an implementation of a bitvector that is sparse by only
-/// storing the elements that have non-zero bits set. In order to make this
-/// fast for the most common cases, SparseBitVector is implemented as a linked
-/// list of SparseBitVectorElements. We maintain a pointer to the last
-/// SparseBitVectorElement accessed (in the form of a list iterator), in order
-/// to make multiple in-order test/set constant time after the first one is
-/// executed. Note that using vectors to store SparseBitVectorElement's does
-/// not work out very well because it causes insertion in the middle to take
-/// enormous amounts of time with a large amount of bits. Other structures that
-/// have better worst cases for insertion in the middle (various balanced trees,
-/// etc) do not perform as well in practice as a linked list with this iterator
-/// kept up to date. They are also significantly more memory intensive.
-
-
-template <unsigned ElementSize = 128>
-struct SparseBitVectorElement {
-public:
- typedef unsigned long BitWord;
- enum {
- BITWORD_SIZE = sizeof(BitWord) * 8,
- BITWORDS_PER_ELEMENT = (ElementSize + BITWORD_SIZE - 1) / BITWORD_SIZE,
- BITS_PER_ELEMENT = ElementSize
- };
-
- SparseBitVectorElement<ElementSize> *getNext() const {
- return Next;
- }
- SparseBitVectorElement<ElementSize> *getPrev() const {
- return Prev;
- }
-
- void setNext(SparseBitVectorElement<ElementSize> *RHS) {
- Next = RHS;
- }
- void setPrev(SparseBitVectorElement<ElementSize> *RHS) {
- Prev = RHS;
- }
-
-private:
- SparseBitVectorElement<ElementSize> *Next;
- SparseBitVectorElement<ElementSize> *Prev;
- // Index of Element in terms of where first bit starts.
- unsigned ElementIndex;
- BitWord Bits[BITWORDS_PER_ELEMENT];
- // Needed for sentinels
- SparseBitVectorElement() {
- ElementIndex = ~0U;
- memset(&Bits[0], 0, sizeof (BitWord) * BITWORDS_PER_ELEMENT);
- }
-
- friend struct ilist_traits<SparseBitVectorElement<ElementSize> >;
-public:
- explicit SparseBitVectorElement(unsigned Idx) {
- ElementIndex = Idx;
- memset(&Bits[0], 0, sizeof (BitWord) * BITWORDS_PER_ELEMENT);
- }
-
- ~SparseBitVectorElement() {
- }
-
- // Copy ctor.
- SparseBitVectorElement(const SparseBitVectorElement &RHS) {
- ElementIndex = RHS.ElementIndex;
- std::copy(&RHS.Bits[0], &RHS.Bits[BITWORDS_PER_ELEMENT], Bits);
- }
-
- // Assignment
- SparseBitVectorElement& operator=(const SparseBitVectorElement& RHS) {
- ElementIndex = RHS.ElementIndex;
- std::copy(&RHS.Bits[0], &RHS.Bits[BITWORDS_PER_ELEMENT], Bits);
-
- return *this;
- }
-
- // Comparison.
- bool operator==(const SparseBitVectorElement &RHS) const {
- if (ElementIndex != RHS.ElementIndex)
- return false;
- for (unsigned i = 0; i < BITWORDS_PER_ELEMENT; ++i)
- if (Bits[i] != RHS.Bits[i])
- return false;
- return true;
- }
-
- bool operator!=(const SparseBitVectorElement &RHS) const {
- return !(*this == RHS);
- }
-
- // Return the bits that make up word Idx in our element.
- BitWord word(unsigned Idx) const {
- assert (Idx < BITWORDS_PER_ELEMENT);
- return Bits[Idx];
- }
-
- unsigned index() const {
- return ElementIndex;
- }
-
- bool empty() const {
- for (unsigned i = 0; i < BITWORDS_PER_ELEMENT; ++i)
- if (Bits[i])
- return false;
- return true;
- }
-
- void set(unsigned Idx) {
- Bits[Idx / BITWORD_SIZE] |= 1L << (Idx % BITWORD_SIZE);
- }
-
- bool test_and_set (unsigned Idx) {
- bool old = test(Idx);
- if (!old) {
- set(Idx);
- return true;
- }
- return false;
- }
-
- void reset(unsigned Idx) {
- Bits[Idx / BITWORD_SIZE] &= ~(1L << (Idx % BITWORD_SIZE));
- }
-
- bool test(unsigned Idx) const {
- return Bits[Idx / BITWORD_SIZE] & (1L << (Idx % BITWORD_SIZE));
- }
-
- unsigned count() const {
- unsigned NumBits = 0;
- for (unsigned i = 0; i < BITWORDS_PER_ELEMENT; ++i)
- if (sizeof(BitWord) == 4)
- NumBits += CountPopulation_32(Bits[i]);
- else if (sizeof(BitWord) == 8)
- NumBits += CountPopulation_64(Bits[i]);
- else
- assert(0 && "Unsupported!");
- return NumBits;
- }
-
- /// find_first - Returns the index of the first set bit.
- int find_first() const {
- for (unsigned i = 0; i < BITWORDS_PER_ELEMENT; ++i)
- if (Bits[i] != 0) {
- if (sizeof(BitWord) == 4)
- return i * BITWORD_SIZE + CountTrailingZeros_32(Bits[i]);
- else if (sizeof(BitWord) == 8)
- return i * BITWORD_SIZE + CountTrailingZeros_64(Bits[i]);
- else
- assert(0 && "Unsupported!");
- }
- assert(0 && "Illegal empty element");
- return 0; // Not reached
- }
-
- /// find_next - Returns the index of the next set bit starting from the
- /// "Curr" bit. Returns -1 if the next set bit is not found.
- int find_next(unsigned Curr) const {
- if (Curr >= BITS_PER_ELEMENT)
- return -1;
-
- unsigned WordPos = Curr / BITWORD_SIZE;
- unsigned BitPos = Curr % BITWORD_SIZE;
- BitWord Copy = Bits[WordPos];
- assert (WordPos <= BITWORDS_PER_ELEMENT
- && "Word Position outside of element");
-
- // Mask off previous bits.
- Copy &= ~0L << BitPos;
-
- if (Copy != 0) {
- if (sizeof(BitWord) == 4)
- return WordPos * BITWORD_SIZE + CountTrailingZeros_32(Copy);
- else if (sizeof(BitWord) == 8)
- return WordPos * BITWORD_SIZE + CountTrailingZeros_64(Copy);
- else
- assert(0 && "Unsupported!");
- }
-
- // Check subsequent words.
- for (unsigned i = WordPos+1; i < BITWORDS_PER_ELEMENT; ++i)
- if (Bits[i] != 0) {
- if (sizeof(BitWord) == 4)
- return i * BITWORD_SIZE + CountTrailingZeros_32(Bits[i]);
- else if (sizeof(BitWord) == 8)
- return i * BITWORD_SIZE + CountTrailingZeros_64(Bits[i]);
- else
- assert(0 && "Unsupported!");
- }
- return -1;
- }
-
- // Union this element with RHS and return true if this one changed.
- bool unionWith(const SparseBitVectorElement &RHS) {
- bool changed = false;
- for (unsigned i = 0; i < BITWORDS_PER_ELEMENT; ++i) {
- BitWord old = changed ? 0 : Bits[i];
-
- Bits[i] |= RHS.Bits[i];
- if (!changed && old != Bits[i])
- changed = true;
- }
- return changed;
- }
-
- // Return true if we have any bits in common with RHS
- bool intersects(const SparseBitVectorElement &RHS) const {
- for (unsigned i = 0; i < BITWORDS_PER_ELEMENT; ++i) {
- if (RHS.Bits[i] & Bits[i])
- return true;
- }
- return false;
- }
-
- // Intersect this Element with RHS and return true if this one changed.
- // BecameZero is set to true if this element became all-zero bits.
- bool intersectWith(const SparseBitVectorElement &RHS,
- bool &BecameZero) {
- bool changed = false;
- bool allzero = true;
-
- BecameZero = false;
- for (unsigned i = 0; i < BITWORDS_PER_ELEMENT; ++i) {
- BitWord old = changed ? 0 : Bits[i];
-
- Bits[i] &= RHS.Bits[i];
- if (Bits[i] != 0)
- allzero = false;
-
- if (!changed && old != Bits[i])
- changed = true;
- }
- BecameZero = allzero;
- return changed;
- }
- // Intersect this Element with the complement of RHS and return true if this
- // one changed. BecameZero is set to true if this element became all-zero
- // bits.
- bool intersectWithComplement(const SparseBitVectorElement &RHS,
- bool &BecameZero) {
- bool changed = false;
- bool allzero = true;
-
- BecameZero = false;
- for (unsigned i = 0; i < BITWORDS_PER_ELEMENT; ++i) {
- BitWord old = changed ? 0 : Bits[i];
-
- Bits[i] &= ~RHS.Bits[i];
- if (Bits[i] != 0)
- allzero = false;
-
- if (!changed && old != Bits[i])
- changed = true;
- }
- BecameZero = allzero;
- return changed;
- }
- // Three argument version of intersectWithComplement that intersects
- // RHS1 & ~RHS2 into this element
- void intersectWithComplement(const SparseBitVectorElement &RHS1,
- const SparseBitVectorElement &RHS2,
- bool &BecameZero) {
- bool allzero = true;
-
- BecameZero = false;
- for (unsigned i = 0; i < BITWORDS_PER_ELEMENT; ++i) {
- Bits[i] = RHS1.Bits[i] & ~RHS2.Bits[i];
- if (Bits[i] != 0)
- allzero = false;
- }
- BecameZero = allzero;
- }
-
- // Get a hash value for this element;
- uint64_t getHashValue() const {
- uint64_t HashVal = 0;
- for (unsigned i = 0; i < BITWORDS_PER_ELEMENT; ++i) {
- HashVal ^= Bits[i];
- }
- return HashVal;
- }
-};
-
-template <unsigned ElementSize = 128>
-class SparseBitVector {
- typedef ilist<SparseBitVectorElement<ElementSize> > ElementList;
- typedef typename ElementList::iterator ElementListIter;
- typedef typename ElementList::const_iterator ElementListConstIter;
- enum {
- BITWORD_SIZE = SparseBitVectorElement<ElementSize>::BITWORD_SIZE
- };
-
- // Pointer to our current Element.
- ElementListIter CurrElementIter;
- ElementList Elements;
-
- // This is like std::lower_bound, except we do linear searching from the
- // current position.
- ElementListIter FindLowerBound(unsigned ElementIndex) {
-
- if (Elements.empty()) {
- CurrElementIter = Elements.begin();
- return Elements.begin();
- }
-
- // Make sure our current iterator is valid.
- if (CurrElementIter == Elements.end())
- --CurrElementIter;
-
- // Search from our current iterator, either backwards or forwards,
- // depending on what element we are looking for.
- ElementListIter ElementIter = CurrElementIter;
- if (CurrElementIter->index() == ElementIndex) {
- return ElementIter;
- } else if (CurrElementIter->index() > ElementIndex) {
- while (ElementIter != Elements.begin()
- && ElementIter->index() > ElementIndex)
- --ElementIter;
- } else {
- while (ElementIter != Elements.end() &&
- ElementIter->index() < ElementIndex)
- ++ElementIter;
- }
- CurrElementIter = ElementIter;
- return ElementIter;
- }
-
- // Iterator to walk set bits in the bitmap. This iterator is a lot uglier
- // than it would be, in order to be efficient.
- class SparseBitVectorIterator {
- private:
- bool AtEnd;
-
- const SparseBitVector<ElementSize> *BitVector;
-
- // Current element inside of bitmap.
- ElementListConstIter Iter;
-
- // Current bit number inside of our bitmap.
- unsigned BitNumber;
-
- // Current word number inside of our element.
- unsigned WordNumber;
-
- // Current bits from the element.
- typename SparseBitVectorElement<ElementSize>::BitWord Bits;
-
- // Move our iterator to the first non-zero bit in the bitmap.
- void AdvanceToFirstNonZero() {
- if (AtEnd)
- return;
- if (BitVector->Elements.empty()) {
- AtEnd = true;
- return;
- }
- Iter = BitVector->Elements.begin();
- BitNumber = Iter->index() * ElementSize;
- unsigned BitPos = Iter->find_first();
- BitNumber += BitPos;
- WordNumber = (BitNumber % ElementSize) / BITWORD_SIZE;
- Bits = Iter->word(WordNumber);
- Bits >>= BitPos % BITWORD_SIZE;
- }
-
- // Move our iterator to the next non-zero bit.
- void AdvanceToNextNonZero() {
- if (AtEnd)
- return;
-
- while (Bits && !(Bits & 1)) {
- Bits >>= 1;
- BitNumber += 1;
- }
-
- // See if we ran out of Bits in this word.
- if (!Bits) {
- int NextSetBitNumber = Iter->find_next(BitNumber % ElementSize) ;
- // If we ran out of set bits in this element, move to next element.
- if (NextSetBitNumber == -1 || (BitNumber % ElementSize == 0)) {
- ++Iter;
- WordNumber = 0;
-
- // We may run out of elements in the bitmap.
- if (Iter == BitVector->Elements.end()) {
- AtEnd = true;
- return;
- }
- // Set up for next non zero word in bitmap.
- BitNumber = Iter->index() * ElementSize;
- NextSetBitNumber = Iter->find_first();
- BitNumber += NextSetBitNumber;
- WordNumber = (BitNumber % ElementSize) / BITWORD_SIZE;
- Bits = Iter->word(WordNumber);
- Bits >>= NextSetBitNumber % BITWORD_SIZE;
- } else {
- WordNumber = (NextSetBitNumber % ElementSize) / BITWORD_SIZE;
- Bits = Iter->word(WordNumber);
- Bits >>= NextSetBitNumber % BITWORD_SIZE;
- BitNumber = Iter->index() * ElementSize;
- BitNumber += NextSetBitNumber;
- }
- }
- }
- public:
- // Preincrement.
- inline SparseBitVectorIterator& operator++() {
- ++BitNumber;
- Bits >>= 1;
- AdvanceToNextNonZero();
- return *this;
- }
-
- // Postincrement.
- inline SparseBitVectorIterator operator++(int) {
- SparseBitVectorIterator tmp = *this;
- ++*this;
- return tmp;
- }
-
- // Return the current set bit number.
- unsigned operator*() const {
- return BitNumber;
- }
-
- bool operator==(const SparseBitVectorIterator &RHS) const {
- // If they are both at the end, ignore the rest of the fields.
- if (AtEnd && RHS.AtEnd)
- return true;
- // Otherwise they are the same if they have the same bit number and
- // bitmap.
- return AtEnd == RHS.AtEnd && RHS.BitNumber == BitNumber;
- }
- bool operator!=(const SparseBitVectorIterator &RHS) const {
- return !(*this == RHS);
- }
- SparseBitVectorIterator(): BitVector(NULL) {
- }
-
-
- SparseBitVectorIterator(const SparseBitVector<ElementSize> *RHS,
- bool end = false):BitVector(RHS) {
- Iter = BitVector->Elements.begin();
- BitNumber = 0;
- Bits = 0;
- WordNumber = ~0;
- AtEnd = end;
- AdvanceToFirstNonZero();
- }
- };
-public:
- typedef SparseBitVectorIterator iterator;
-
- SparseBitVector () {
- CurrElementIter = Elements.begin ();
- }
-
- ~SparseBitVector() {
- }
-
- // SparseBitVector copy ctor.
- SparseBitVector(const SparseBitVector &RHS) {
- ElementListConstIter ElementIter = RHS.Elements.begin();
- while (ElementIter != RHS.Elements.end()) {
- Elements.push_back(SparseBitVectorElement<ElementSize>(*ElementIter));
- ++ElementIter;
- }
-
- CurrElementIter = Elements.begin ();
- }
-
- // Assignment
- SparseBitVector& operator=(const SparseBitVector& RHS) {
- Elements.clear();
-
- ElementListConstIter ElementIter = RHS.Elements.begin();
- while (ElementIter != RHS.Elements.end()) {
- Elements.push_back(SparseBitVectorElement<ElementSize>(*ElementIter));
- ++ElementIter;
- }
-
- CurrElementIter = Elements.begin ();
-
- return *this;
- }
-
- // Test, Reset, and Set a bit in the bitmap.
- bool test(unsigned Idx) {
- if (Elements.empty())
- return false;
-
- unsigned ElementIndex = Idx / ElementSize;
- ElementListIter ElementIter = FindLowerBound(ElementIndex);
-
- // If we can't find an element that is supposed to contain this bit, there
- // is nothing more to do.
- if (ElementIter == Elements.end() ||
- ElementIter->index() != ElementIndex)
- return false;
- return ElementIter->test(Idx % ElementSize);
- }
-
- void reset(unsigned Idx) {
- if (Elements.empty())
- return;
-
- unsigned ElementIndex = Idx / ElementSize;
- ElementListIter ElementIter = FindLowerBound(ElementIndex);
-
- // If we can't find an element that is supposed to contain this bit, there
- // is nothing more to do.
- if (ElementIter == Elements.end() ||
- ElementIter->index() != ElementIndex)
- return;
- ElementIter->reset(Idx % ElementSize);
-
- // When the element is zeroed out, delete it.
- if (ElementIter->empty()) {
- ++CurrElementIter;
- Elements.erase(ElementIter);
- }
- }
-
- void set(unsigned Idx) {
- unsigned ElementIndex = Idx / ElementSize;
- SparseBitVectorElement<ElementSize> *Element;
- ElementListIter ElementIter;
- if (Elements.empty()) {
- Element = new SparseBitVectorElement<ElementSize>(ElementIndex);
- ElementIter = Elements.insert(Elements.end(), Element);
-
- } else {
- ElementIter = FindLowerBound(ElementIndex);
-
- if (ElementIter == Elements.end() ||
- ElementIter->index() != ElementIndex) {
- Element = new SparseBitVectorElement<ElementSize>(ElementIndex);
- // We may have hit the beginning of our SparseBitVector, in which case,
- // we may need to insert right after this element, which requires moving
- // the current iterator forward one, because insert does insert before.
- if (ElementIter != Elements.end() &&
- ElementIter->index() < ElementIndex)
- ElementIter = Elements.insert(++ElementIter, Element);
- else
- ElementIter = Elements.insert(ElementIter, Element);
- }
- }
- CurrElementIter = ElementIter;
-
- ElementIter->set(Idx % ElementSize);
- }
-
- bool test_and_set (unsigned Idx) {
- bool old = test(Idx);
- if (!old) {
- set(Idx);
- return true;
- }
- return false;
- }
-
- bool operator!=(const SparseBitVector &RHS) const {
- return !(*this == RHS);
- }
-
- bool operator==(const SparseBitVector &RHS) const {
- ElementListConstIter Iter1 = Elements.begin();
- ElementListConstIter Iter2 = RHS.Elements.begin();
-
- for (; Iter1 != Elements.end() && Iter2 != RHS.Elements.end();
- ++Iter1, ++Iter2) {
- if (*Iter1 != *Iter2)
- return false;
- }
- return Iter1 == Elements.end() && Iter2 == RHS.Elements.end();
- }
-
- // Union our bitmap with the RHS and return true if we changed.
- bool operator|=(const SparseBitVector &RHS) {
- bool changed = false;
- ElementListIter Iter1 = Elements.begin();
- ElementListConstIter Iter2 = RHS.Elements.begin();
-
- // If RHS is empty, we are done
- if (RHS.Elements.empty())
- return false;
-
- while (Iter2 != RHS.Elements.end()) {
- if (Iter1 == Elements.end() || Iter1->index() > Iter2->index()) {
- Elements.insert(Iter1,
- new SparseBitVectorElement<ElementSize>(*Iter2));
- ++Iter2;
- changed = true;
- } else if (Iter1->index() == Iter2->index()) {
- changed |= Iter1->unionWith(*Iter2);
- ++Iter1;
- ++Iter2;
- } else {
- ++Iter1;
- }
- }
- CurrElementIter = Elements.begin();
- return changed;
- }
-
- // Intersect our bitmap with the RHS and return true if ours changed.
- bool operator&=(const SparseBitVector &RHS) {
- bool changed = false;
- ElementListIter Iter1 = Elements.begin();
- ElementListConstIter Iter2 = RHS.Elements.begin();
-
- // Check if both bitmaps are empty.
- if (Elements.empty() && RHS.Elements.empty())
- return false;
-
- // Loop through, intersecting as we go, erasing elements when necessary.
- while (Iter2 != RHS.Elements.end()) {
- if (Iter1 == Elements.end()) {
- CurrElementIter = Elements.begin();
- return changed;
- }
-
- if (Iter1->index() > Iter2->index()) {
- ++Iter2;
- } else if (Iter1->index() == Iter2->index()) {
- bool BecameZero;
- changed |= Iter1->intersectWith(*Iter2, BecameZero);
- if (BecameZero) {
- ElementListIter IterTmp = Iter1;
- ++Iter1;
- Elements.erase(IterTmp);
- } else {
- ++Iter1;
- }
- ++Iter2;
- } else {
- ElementListIter IterTmp = Iter1;
- ++Iter1;
- Elements.erase(IterTmp);
- }
- }
- Elements.erase(Iter1, Elements.end());
- CurrElementIter = Elements.begin();
- return changed;
- }
-
- // Intersect our bitmap with the complement of the RHS and return true if ours
- // changed.
- bool intersectWithComplement(const SparseBitVector &RHS) {
- bool changed = false;
- ElementListIter Iter1 = Elements.begin();
- ElementListConstIter Iter2 = RHS.Elements.begin();
-
- // If either our bitmap or RHS is empty, we are done
- if (Elements.empty() || RHS.Elements.empty())
- return false;
-
- // Loop through, intersecting as we go, erasing elements when necessary.
- while (Iter2 != RHS.Elements.end()) {
- if (Iter1 == Elements.end()) {
- CurrElementIter = Elements.begin();
- return changed;
- }
-
- if (Iter1->index() > Iter2->index()) {
- ++Iter2;
- } else if (Iter1->index() == Iter2->index()) {
- bool BecameZero;
- changed |= Iter1->intersectWithComplement(*Iter2, BecameZero);
- if (BecameZero) {
- ElementListIter IterTmp = Iter1;
- ++Iter1;
- Elements.erase(IterTmp);
- } else {
- ++Iter1;
- }
- ++Iter2;
- } else {
- ++Iter1;
- }
- }
- CurrElementIter = Elements.begin();
- return changed;
- }
-
- bool intersectWithComplement(const SparseBitVector<ElementSize> *RHS) const {
- return intersectWithComplement(*RHS);
- }
-
-
- // Three argument version of intersectWithComplement. Result of RHS1 & ~RHS2
- // is stored into this bitmap.
- void intersectWithComplement(const SparseBitVector<ElementSize> &RHS1,
- const SparseBitVector<ElementSize> &RHS2)
- {
- Elements.clear();
- CurrElementIter = Elements.begin();
- ElementListConstIter Iter1 = RHS1.Elements.begin();
- ElementListConstIter Iter2 = RHS2.Elements.begin();
-
- // If RHS1 is empty, we are done
- // If RHS2 is empty, we still have to copy RHS1
- if (RHS1.Elements.empty())
- return;
-
- // Loop through, intersecting as we go, erasing elements when necessary.
- while (Iter2 != RHS2.Elements.end()) {
- if (Iter1 == RHS1.Elements.end())
- return;
-
- if (Iter1->index() > Iter2->index()) {
- ++Iter2;
- } else if (Iter1->index() == Iter2->index()) {
- bool BecameZero = false;
- SparseBitVectorElement<ElementSize> *NewElement =
- new SparseBitVectorElement<ElementSize>(Iter1->index());
- NewElement->intersectWithComplement(*Iter1, *Iter2, BecameZero);
- if (!BecameZero) {
- Elements.push_back(NewElement);
- }
- else
- delete NewElement;
- ++Iter1;
- ++Iter2;
- } else {
- SparseBitVectorElement<ElementSize> *NewElement =
- new SparseBitVectorElement<ElementSize>(*Iter1);
- Elements.push_back(NewElement);
- ++Iter1;
- }
- }
-
- // copy the remaining elements
- while (Iter1 != RHS1.Elements.end()) {
- SparseBitVectorElement<ElementSize> *NewElement =
- new SparseBitVectorElement<ElementSize>(*Iter1);
- Elements.push_back(NewElement);
- ++Iter1;
- }
-
- return;
- }
-
- void intersectWithComplement(const SparseBitVector<ElementSize> *RHS1,
- const SparseBitVector<ElementSize> *RHS2) {
- intersectWithComplement(*RHS1, *RHS2);
- }
-
- bool intersects(const SparseBitVector<ElementSize> *RHS) const {
- return intersects(*RHS);
- }
-
- // Return true if we share any bits in common with RHS
- bool intersects(const SparseBitVector<ElementSize> &RHS) const {
- ElementListConstIter Iter1 = Elements.begin();
- ElementListConstIter Iter2 = RHS.Elements.begin();
-
- // Check if both bitmaps are empty.
- if (Elements.empty() && RHS.Elements.empty())
- return false;
-
- // Loop through, intersecting stopping when we hit bits in common.
- while (Iter2 != RHS.Elements.end()) {
- if (Iter1 == Elements.end())
- return false;
-
- if (Iter1->index() > Iter2->index()) {
- ++Iter2;
- } else if (Iter1->index() == Iter2->index()) {
- if (Iter1->intersects(*Iter2))
- return true;
- ++Iter1;
- ++Iter2;
- } else {
- ++Iter1;
- }
- }
- return false;
- }
-
- // Return the first set bit in the bitmap. Return -1 if no bits are set.
- int find_first() const {
- if (Elements.empty())
- return -1;
- const SparseBitVectorElement<ElementSize> &First = *(Elements.begin());
- return (First.index() * ElementSize) + First.find_first();
- }
-
- // Return true if the SparseBitVector is empty
- bool empty() const {
- return Elements.empty();
- }
-
- unsigned count() const {
- unsigned BitCount = 0;
- for (ElementListConstIter Iter = Elements.begin();
- Iter != Elements.end();
- ++Iter)
- BitCount += Iter->count();
-
- return BitCount;
- }
- iterator begin() const {
- return iterator(this);
- }
-
- iterator end() const {
- return iterator(this, true);
- }
-
- // Get a hash value for this bitmap.
- uint64_t getHashValue() const {
- uint64_t HashVal = 0;
- for (ElementListConstIter Iter = Elements.begin();
- Iter != Elements.end();
- ++Iter) {
- HashVal ^= Iter->index();
- HashVal ^= Iter->getHashValue();
- }
- return HashVal;
- }
-};
-
-// Convenience functions to allow Or and And without dereferencing in the user
-// code.
-
-template <unsigned ElementSize>
-inline bool operator |=(SparseBitVector<ElementSize> &LHS,
- const SparseBitVector<ElementSize> *RHS) {
- return LHS |= *RHS;
-}
-
-template <unsigned ElementSize>
-inline bool operator |=(SparseBitVector<ElementSize> *LHS,
- const SparseBitVector<ElementSize> &RHS) {
- return LHS->operator|=(RHS);
-}
-
-template <unsigned ElementSize>
-inline bool operator &=(SparseBitVector<ElementSize> *LHS,
- const SparseBitVector<ElementSize> &RHS) {
- return LHS->operator&=(RHS);
-}
-
-template <unsigned ElementSize>
-inline bool operator &=(SparseBitVector<ElementSize> &LHS,
- const SparseBitVector<ElementSize> *RHS) {
- return LHS &= (*RHS);
-}
-
-
-// Dump a SparseBitVector to a stream
-template <unsigned ElementSize>
-void dump(const SparseBitVector<ElementSize> &LHS, llvm::OStream &out) {
- out << "[ ";
-
- typename SparseBitVector<ElementSize>::iterator bi;
- for (bi = LHS.begin(); bi != LHS.end(); ++bi) {
- out << *bi << " ";
- }
- out << " ]\n";
-}
-}
-
-
-
-#endif
diff --git a/release_23/include/llvm/ADT/Statistic.h b/release_23/include/llvm/ADT/Statistic.h
deleted file mode 100644
index 6610198df106..000000000000
--- a/release_23/include/llvm/ADT/Statistic.h
+++ /dev/null
@@ -1,75 +0,0 @@
-//===-- llvm/ADT/Statistic.h - Easy way to expose stats ---------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines the 'Statistic' class, which is designed to be an easy way
-// to expose various metrics from passes. These statistics are printed at the
-// end of a run (from llvm_shutdown), when the -stats command line option is
-// passed on the command line.
-//
-// This is useful for reporting information like the number of instructions
-// simplified, optimized or removed by various transformations, like this:
-//
-// static Statistic NumInstsKilled("gcse", "Number of instructions killed");
-//
-// Later, in the code: ++NumInstsKilled;
-//
-// NOTE: Statistics *must* be declared as global variables.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_ADT_STATISTIC_H
-#define LLVM_ADT_STATISTIC_H
-
-namespace llvm {
-
-class Statistic {
-public:
- const char *Name;
- const char *Desc;
- unsigned Value : 31;
- bool Initialized : 1;
-
- unsigned getValue() const { return Value; }
- const char *getName() const { return Name; }
- const char *getDesc() const { return Desc; }
-
- /// construct - This should only be called for non-global statistics.
- void construct(const char *name, const char *desc) {
- Name = name; Desc = desc;
- Value = 0; Initialized = 0;
- }
-
- // Allow use of this class as the value itself.
- operator unsigned() const { return Value; }
- const Statistic &operator=(unsigned Val) { Value = Val; return init(); }
- const Statistic &operator++() { ++Value; return init(); }
- unsigned operator++(int) { init(); return Value++; }
- const Statistic &operator--() { --Value; return init(); }
- unsigned operator--(int) { init(); return Value--; }
- const Statistic &operator+=(const unsigned &V) { Value += V; return init(); }
- const Statistic &operator-=(const unsigned &V) { Value -= V; return init(); }
- const Statistic &operator*=(const unsigned &V) { Value *= V; return init(); }
- const Statistic &operator/=(const unsigned &V) { Value /= V; return init(); }
-
-protected:
- Statistic &init() {
- if (!Initialized) RegisterStatistic();
- return *this;
- }
- void RegisterStatistic();
-};
-
-// STATISTIC - A macro to make definition of statistics really simple. This
-// automatically passes the DEBUG_TYPE of the file into the statistic.
-#define STATISTIC(VARNAME, DESC) \
- static Statistic VARNAME = { DEBUG_TYPE, DESC, 0, 0 }
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/ADT/StringExtras.h b/release_23/include/llvm/ADT/StringExtras.h
deleted file mode 100644
index 87b8ba6596a1..000000000000
--- a/release_23/include/llvm/ADT/StringExtras.h
+++ /dev/null
@@ -1,197 +0,0 @@
-//===-- llvm/ADT/StringExtras.h - Useful string functions -------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains some functions that are useful when dealing with strings.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_ADT_STRINGEXTRAS_H
-#define LLVM_ADT_STRINGEXTRAS_H
-
-#include "llvm/Support/DataTypes.h"
-#include "llvm/ADT/APFloat.h"
-#include <cctype>
-#include <cstdio>
-#include <string>
-#include <vector>
-
-namespace llvm {
-
-static inline std::string utohexstr(uint64_t X) {
- char Buffer[40];
- char *BufPtr = Buffer+39;
-
- *BufPtr = 0; // Null terminate buffer...
- if (X == 0) *--BufPtr = '0'; // Handle special case...
-
- while (X) {
- unsigned char Mod = static_cast<unsigned char>(X) & 15;
- if (Mod < 10)
- *--BufPtr = '0' + Mod;
- else
- *--BufPtr = 'A' + Mod-10;
- X >>= 4;
- }
- return std::string(BufPtr);
-}
-
-static inline std::string utostr_32(uint32_t X, bool isNeg = false) {
- char Buffer[20];
- char *BufPtr = Buffer+19;
-
- *BufPtr = 0; // Null terminate buffer...
- if (X == 0) *--BufPtr = '0'; // Handle special case...
-
- while (X) {
- *--BufPtr = '0' + char(X % 10);
- X /= 10;
- }
-
- if (isNeg) *--BufPtr = '-'; // Add negative sign...
-
- return std::string(BufPtr);
-}
-
-static inline std::string utostr(uint64_t X, bool isNeg = false) {
- if (X == uint32_t(X))
- return utostr_32(uint32_t(X), isNeg);
-
- char Buffer[40];
- char *BufPtr = Buffer+39;
-
- *BufPtr = 0; // Null terminate buffer...
- if (X == 0) *--BufPtr = '0'; // Handle special case...
-
- while (X) {
- *--BufPtr = '0' + char(X % 10);
- X /= 10;
- }
-
- if (isNeg) *--BufPtr = '-'; // Add negative sign...
- return std::string(BufPtr);
-}
-
-
-static inline std::string itostr(int64_t X) {
- if (X < 0)
- return utostr(static_cast<uint64_t>(-X), true);
- else
- return utostr(static_cast<uint64_t>(X));
-}
-
-static inline std::string itohexstr(int64_t X) {
- return utohexstr(static_cast<uint64_t>(X));
-}
-
-static inline std::string ftostr(double V) {
- char Buffer[200];
- sprintf(Buffer, "%20.6e", V);
- char *B = Buffer;
- while (*B == ' ') ++B;
- return B;
-}
-
-static inline std::string ftostr(const APFloat& V) {
- if (&V.getSemantics() == &APFloat::IEEEdouble)
- return ftostr(V.convertToDouble());
- else if (&V.getSemantics() == &APFloat::IEEEsingle)
- return ftostr((double)V.convertToFloat());
- return "<unknown format in ftostr>"; // error
-}
-
-static inline std::string LowercaseString(const std::string &S) {
- std::string result(S);
- for (unsigned i = 0; i < S.length(); ++i)
- if (isupper(result[i]))
- result[i] = char(tolower(result[i]));
- return result;
-}
-
-static inline std::string UppercaseString(const std::string &S) {
- std::string result(S);
- for (unsigned i = 0; i < S.length(); ++i)
- if (islower(result[i]))
- result[i] = char(toupper(result[i]));
- return result;
-}
-
-/// StringsEqualNoCase - Return true if the two strings are equal, ignoring
-/// case.
-static inline bool StringsEqualNoCase(const std::string &LHS,
- const std::string &RHS) {
- if (LHS.size() != RHS.size()) return false;
- for (unsigned i = 0, e = static_cast<unsigned>(LHS.size()); i != e; ++i)
- if (tolower(LHS[i]) != tolower(RHS[i])) return false;
- return true;
-}
-
-/// StringsEqualNoCase - Return true if the two strings are equal, ignoring
-/// case.
-static inline bool StringsEqualNoCase(const std::string &LHS,
- const char *RHS) {
- for (unsigned i = 0, e = static_cast<unsigned>(LHS.size()); i != e; ++i) {
- if (RHS[i] == 0) return false; // RHS too short.
- if (tolower(LHS[i]) != tolower(RHS[i])) return false;
- }
- return RHS[LHS.size()] == 0; // Not too long?
-}
-
-/// CStrInCStrNoCase - Portable version of strcasestr. Locates the first
-/// occurance of c-string 's2' in string 's1', ignoring case. Returns
-/// NULL if 's2' cannot be found.
-static inline const char* CStrInCStrNoCase(const char *s1, const char *s2) {
-
- // Are either strings NULL or empty?
- if (!s1 || !s2 || s1[0] == '\0' || s2[0] == '\0')
- return 0;
-
- if (s1 == s2)
- return s1;
-
- const char *I1=s1, *I2=s2;
-
- while (*I1 != '\0' || *I2 != '\0' )
- if (tolower(*I1) != tolower(*I2)) { // No match. Start over.
- ++s1; I1 = s1; I2 = s2;
- }
- else { // Character match. Advance to the next character.
- ++I1; ++I2;
- }
-
- // If we exhausted all of the characters in 's2', then 's2' appears in 's1'.
- return *I2 == '\0' ? s1 : 0;
-}
-
-/// getToken - This function extracts one token from source, ignoring any
-/// leading characters that appear in the Delimiters string, and ending the
-/// token at any of the characters that appear in the Delimiters string. If
-/// there are no tokens in the source string, an empty string is returned.
-/// The Source source string is updated in place to remove the returned string
-/// and any delimiter prefix from it.
-std::string getToken(std::string &Source,
- const char *Delimiters = " \t\n\v\f\r");
-
-/// SplitString - Split up the specified string according to the specified
-/// delimiters, appending the result fragments to the output list.
-void SplitString(const std::string &Source,
- std::vector<std::string> &OutFragments,
- const char *Delimiters = " \t\n\v\f\r");
-
-/// UnescapeString - Modify the argument string, turning two character sequences
-/// like '\\' 'n' into '\n'. This handles: \e \a \b \f \n \r \t \v \' \\ and
-/// \num (where num is a 1-3 byte octal value).
-void UnescapeString(std::string &Str);
-
-/// EscapeString - Modify the argument string, turning '\\' and anything that
-/// doesn't satisfy std::isprint into an escape sequence.
-void EscapeString(std::string &Str);
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/ADT/StringMap.h b/release_23/include/llvm/ADT/StringMap.h
deleted file mode 100644
index 869a87fdced3..000000000000
--- a/release_23/include/llvm/ADT/StringMap.h
+++ /dev/null
@@ -1,451 +0,0 @@
-//===--- StringMap.h - String Hash table map interface ----------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines the StringMap class.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_ADT_STRINGMAP_H
-#define LLVM_ADT_STRINGMAP_H
-
-#include "llvm/Support/Allocator.h"
-#include <cstring>
-#include <string>
-
-namespace llvm {
- template<typename ValueT>
- class StringMapConstIterator;
- template<typename ValueT>
- class StringMapIterator;
- template<typename ValueTy>
- class StringMapEntry;
-
-/// StringMapEntryInitializer - This datatype can be partially specialized for
-/// various datatypes in a stringmap to allow them to be initialized when an
-/// entry is default constructed for the map.
-template<typename ValueTy>
-class StringMapEntryInitializer {
-public:
- template <typename InitTy>
- static void Initialize(StringMapEntry<ValueTy> &T, InitTy InitVal) {
- }
-};
-
-
-/// StringMapEntryBase - Shared base class of StringMapEntry instances.
-class StringMapEntryBase {
- unsigned StrLen;
-public:
- explicit StringMapEntryBase(unsigned Len) : StrLen(Len) {}
-
- unsigned getKeyLength() const { return StrLen; }
-};
-
-/// StringMapImpl - This is the base class of StringMap that is shared among
-/// all of its instantiations.
-class StringMapImpl {
-public:
- /// ItemBucket - The hash table consists of an array of these. If Item is
- /// non-null, this is an extant entry, otherwise, it is a hole.
- struct ItemBucket {
- /// FullHashValue - This remembers the full hash value of the key for
- /// easy scanning.
- unsigned FullHashValue;
-
- /// Item - This is a pointer to the actual item object.
- StringMapEntryBase *Item;
- };
-
-protected:
- ItemBucket *TheTable;
- unsigned NumBuckets;
- unsigned NumItems;
- unsigned NumTombstones;
- unsigned ItemSize;
-protected:
- explicit StringMapImpl(unsigned itemSize) : ItemSize(itemSize) {
- // Initialize the map with zero buckets to allocation.
- TheTable = 0;
- NumBuckets = 0;
- NumItems = 0;
- NumTombstones = 0;
- }
- StringMapImpl(unsigned InitSize, unsigned ItemSize);
- void RehashTable();
-
- /// ShouldRehash - Return true if the table should be rehashed after a new
- /// element was recently inserted.
- bool ShouldRehash() const {
- // If the hash table is now more than 3/4 full, or if fewer than 1/8 of
- // the buckets are empty (meaning that many are filled with tombstones),
- // grow the table.
- return NumItems*4 > NumBuckets*3 ||
- NumBuckets-(NumItems+NumTombstones) < NumBuckets/8;
- }
-
- /// LookupBucketFor - Look up the bucket that the specified string should end
- /// up in. If it already exists as a key in the map, the Item pointer for the
- /// specified bucket will be non-null. Otherwise, it will be null. In either
- /// case, the FullHashValue field of the bucket will be set to the hash value
- /// of the string.
- unsigned LookupBucketFor(const char *KeyStart, const char *KeyEnd);
-
- /// FindKey - Look up the bucket that contains the specified key. If it exists
- /// in the map, return the bucket number of the key. Otherwise return -1.
- /// This does not modify the map.
- int FindKey(const char *KeyStart, const char *KeyEnd) const;
-
- /// RemoveKey - Remove the specified StringMapEntry from the table, but do not
- /// delete it. This aborts if the value isn't in the table.
- void RemoveKey(StringMapEntryBase *V);
-
- /// RemoveKey - Remove the StringMapEntry for the specified key from the
- /// table, returning it. If the key is not in the table, this returns null.
- StringMapEntryBase *RemoveKey(const char *KeyStart, const char *KeyEnd);
-private:
- void init(unsigned Size);
-public:
- static StringMapEntryBase *getTombstoneVal() {
- return (StringMapEntryBase*)-1;
- }
-
- unsigned getNumBuckets() const { return NumBuckets; }
- unsigned getNumItems() const { return NumItems; }
-
- bool empty() const { return NumItems == 0; }
- unsigned size() const { return NumItems; }
-};
-
-/// StringMapEntry - This is used to represent one value that is inserted into
-/// a StringMap. It contains the Value itself and the key: the string length
-/// and data.
-template<typename ValueTy>
-class StringMapEntry : public StringMapEntryBase {
-public:
- ValueTy second;
-
- explicit StringMapEntry(unsigned StrLen)
- : StringMapEntryBase(StrLen), second() {}
- StringMapEntry(unsigned StrLen, const ValueTy &V)
- : StringMapEntryBase(StrLen), second(V) {}
-
- const ValueTy &getValue() const { return second; }
- ValueTy &getValue() { return second; }
-
- void setValue(const ValueTy &V) { second = V; }
-
- /// getKeyData - Return the start of the string data that is the key for this
- /// value. The string data is always stored immediately after the
- /// StringMapEntry object.
- const char *getKeyData() const {return reinterpret_cast<const char*>(this+1);}
-
- const char *first() const { return getKeyData(); }
-
- /// Create - Create a StringMapEntry for the specified key and default
- /// construct the value.
- template<typename AllocatorTy, typename InitType>
- static StringMapEntry *Create(const char *KeyStart, const char *KeyEnd,
- AllocatorTy &Allocator,
- InitType InitVal) {
- unsigned KeyLength = static_cast<unsigned>(KeyEnd-KeyStart);
-
- // Okay, the item doesn't already exist, and 'Bucket' is the bucket to fill
- // in. Allocate a new item with space for the string at the end and a null
- // terminator.
-
- unsigned AllocSize = static_cast<unsigned>(sizeof(StringMapEntry))+
- KeyLength+1;
- unsigned Alignment = alignof<StringMapEntry>();
-
- StringMapEntry *NewItem =
- static_cast<StringMapEntry*>(Allocator.Allocate(AllocSize,Alignment));
-
- // Default construct the value.
- new (NewItem) StringMapEntry(KeyLength);
-
- // Copy the string information.
- char *StrBuffer = const_cast<char*>(NewItem->getKeyData());
- memcpy(StrBuffer, KeyStart, KeyLength);
- StrBuffer[KeyLength] = 0; // Null terminate for convenience of clients.
-
- // Initialize the value if the client wants to.
- StringMapEntryInitializer<ValueTy>::Initialize(*NewItem, InitVal);
- return NewItem;
- }
-
- template<typename AllocatorTy>
- static StringMapEntry *Create(const char *KeyStart, const char *KeyEnd,
- AllocatorTy &Allocator) {
- return Create(KeyStart, KeyEnd, Allocator, (void*)0);
- }
-
-
- /// Create - Create a StringMapEntry with normal malloc/free.
- template<typename InitType>
- static StringMapEntry *Create(const char *KeyStart, const char *KeyEnd,
- InitType InitVal) {
- MallocAllocator A;
- return Create(KeyStart, KeyEnd, A, InitVal);
- }
-
- static StringMapEntry *Create(const char *KeyStart, const char *KeyEnd) {
- return Create(KeyStart, KeyEnd, (void*)0);
- }
-
- /// GetStringMapEntryFromValue - Given a value that is known to be embedded
- /// into a StringMapEntry, return the StringMapEntry itself.
- static StringMapEntry &GetStringMapEntryFromValue(ValueTy &V) {
- StringMapEntry *EPtr = 0;
- char *Ptr = reinterpret_cast<char*>(&V) -
- (reinterpret_cast<char*>(&EPtr->second) -
- reinterpret_cast<char*>(EPtr));
- return *reinterpret_cast<StringMapEntry*>(Ptr);
- }
- static const StringMapEntry &GetStringMapEntryFromValue(const ValueTy &V) {
- return GetStringMapEntryFromValue(const_cast<ValueTy&>(V));
- }
-
- /// Destroy - Destroy this StringMapEntry, releasing memory back to the
- /// specified allocator.
- template<typename AllocatorTy>
- void Destroy(AllocatorTy &Allocator) {
- // Free memory referenced by the item.
- this->~StringMapEntry();
- Allocator.Deallocate(this);
- }
-
- /// Destroy this object, releasing memory back to the malloc allocator.
- void Destroy() {
- MallocAllocator A;
- Destroy(A);
- }
-};
-
-
-/// StringMap - This is an unconventional map that is specialized for handling
-/// keys that are "strings", which are basically ranges of bytes. This does some
-/// funky memory allocation and hashing things to make it extremely efficient,
-/// storing the string data *after* the value in the map.
-template<typename ValueTy, typename AllocatorTy = MallocAllocator>
-class StringMap : public StringMapImpl {
- AllocatorTy Allocator;
- typedef StringMapEntry<ValueTy> MapEntryTy;
-public:
- StringMap() : StringMapImpl(static_cast<unsigned>(sizeof(MapEntryTy))) {}
- explicit StringMap(unsigned InitialSize)
- : StringMapImpl(InitialSize, static_cast<unsigned>(sizeof(MapEntryTy))) {}
-
- AllocatorTy &getAllocator() { return Allocator; }
- const AllocatorTy &getAllocator() const { return Allocator; }
-
- typedef const char* key_type;
- typedef ValueTy mapped_type;
- typedef StringMapEntry<ValueTy> value_type;
- typedef size_t size_type;
-
- typedef StringMapConstIterator<ValueTy> const_iterator;
- typedef StringMapIterator<ValueTy> iterator;
-
- iterator begin() {
- return iterator(TheTable, NumBuckets == 0);
- }
- iterator end() {
- return iterator(TheTable+NumBuckets, true);
- }
- const_iterator begin() const {
- return const_iterator(TheTable, NumBuckets == 0);
- }
- const_iterator end() const {
- return const_iterator(TheTable+NumBuckets, true);
- }
-
- iterator find(const char *KeyStart, const char *KeyEnd) {
- int Bucket = FindKey(KeyStart, KeyEnd);
- if (Bucket == -1) return end();
- return iterator(TheTable+Bucket);
- }
- iterator find(const char *Key) {
- return find(Key, Key + strlen(Key));
- }
- iterator find(const std::string &Key) {
- const char* key_start = (Key.empty() ? NULL : &Key[0]);
- return find(key_start, key_start + Key.size());
- }
-
- const_iterator find(const char *KeyStart, const char *KeyEnd) const {
- int Bucket = FindKey(KeyStart, KeyEnd);
- if (Bucket == -1) return end();
- return const_iterator(TheTable+Bucket);
- }
- const_iterator find(const char *Key) const {
- return find(Key, Key + strlen(Key));
- }
- const_iterator find(const std::string &Key) const {
- const char* key_start = (Key.empty() ? NULL : &Key[0]);
- return find(key_start, key_start + Key.size());
- }
-
- ValueTy& operator[](const char *Key) {
- value_type& entry = GetOrCreateValue(Key, Key + strlen(Key));
- return entry.getValue();
- }
- ValueTy& operator[](const std::string &Key) {
- const char* key_start = (Key.empty() ? NULL : &Key[0]);
- value_type& entry = GetOrCreateValue(key_start, key_start + Key.size());
- return entry.getValue();
- }
-
- size_type count(const char *KeyStart, const char *KeyEnd) const {
- return find(KeyStart, KeyEnd) == end() ? 0 : 1;
- }
- size_type count(const char *Key) const {
- return count(Key, Key + strlen(Key));
- }
- size_type count(const std::string &Key) const {
- const char* key_start = (Key.empty() ? NULL : &Key[0]);
- return count(key_start, key_start + Key.size());
- }
-
- /// insert - Insert the specified key/value pair into the map. If the key
- /// already exists in the map, return false and ignore the request, otherwise
- /// insert it and return true.
- bool insert(MapEntryTy *KeyValue) {
- unsigned BucketNo =
- LookupBucketFor(KeyValue->getKeyData(),
- KeyValue->getKeyData()+KeyValue->getKeyLength());
- ItemBucket &Bucket = TheTable[BucketNo];
- if (Bucket.Item && Bucket.Item != getTombstoneVal())
- return false; // Already exists in map.
-
- if (Bucket.Item == getTombstoneVal())
- --NumTombstones;
- Bucket.Item = KeyValue;
- ++NumItems;
-
- if (ShouldRehash())
- RehashTable();
- return true;
- }
-
- /// GetOrCreateValue - Look up the specified key in the table. If a value
- /// exists, return it. Otherwise, default construct a value, insert it, and
- /// return.
- template <typename InitTy>
- StringMapEntry<ValueTy> &GetOrCreateValue(const char *KeyStart,
- const char *KeyEnd,
- InitTy Val) {
- unsigned BucketNo = LookupBucketFor(KeyStart, KeyEnd);
- ItemBucket &Bucket = TheTable[BucketNo];
- if (Bucket.Item && Bucket.Item != getTombstoneVal())
- return *static_cast<MapEntryTy*>(Bucket.Item);
-
- MapEntryTy *NewItem = MapEntryTy::Create(KeyStart, KeyEnd, Allocator, Val);
-
- if (Bucket.Item == getTombstoneVal())
- --NumTombstones;
- ++NumItems;
-
- // Fill in the bucket for the hash table. The FullHashValue was already
- // filled in by LookupBucketFor.
- Bucket.Item = NewItem;
-
- if (ShouldRehash())
- RehashTable();
- return *NewItem;
- }
-
- StringMapEntry<ValueTy> &GetOrCreateValue(const char *KeyStart,
- const char *KeyEnd) {
- return GetOrCreateValue(KeyStart, KeyEnd, (void*)0);
- }
-
- /// remove - Remove the specified key/value pair from the map, but do not
- /// erase it. This aborts if the key is not in the map.
- void remove(MapEntryTy *KeyValue) {
- RemoveKey(KeyValue);
- }
-
- void erase(iterator I) {
- MapEntryTy &V = *I;
- remove(&V);
- V.Destroy(Allocator);
- }
-
- ~StringMap() {
- for (ItemBucket *I = TheTable, *E = TheTable+NumBuckets; I != E; ++I) {
- if (I->Item && I->Item != getTombstoneVal())
- static_cast<MapEntryTy*>(I->Item)->Destroy(Allocator);
- }
- free(TheTable);
- }
-private:
- StringMap(const StringMap &); // FIXME: Implement.
- void operator=(const StringMap &); // FIXME: Implement.
-};
-
-
-template<typename ValueTy>
-class StringMapConstIterator {
-protected:
- StringMapImpl::ItemBucket *Ptr;
-public:
- explicit StringMapConstIterator(StringMapImpl::ItemBucket *Bucket,
- bool NoAdvance = false)
- : Ptr(Bucket) {
- if (!NoAdvance) AdvancePastEmptyBuckets();
- }
-
- const StringMapEntry<ValueTy> &operator*() const {
- return *static_cast<StringMapEntry<ValueTy>*>(Ptr->Item);
- }
- const StringMapEntry<ValueTy> *operator->() const {
- return static_cast<StringMapEntry<ValueTy>*>(Ptr->Item);
- }
-
- bool operator==(const StringMapConstIterator &RHS) const {
- return Ptr == RHS.Ptr;
- }
- bool operator!=(const StringMapConstIterator &RHS) const {
- return Ptr != RHS.Ptr;
- }
-
- inline StringMapConstIterator& operator++() { // Preincrement
- ++Ptr;
- AdvancePastEmptyBuckets();
- return *this;
- }
- StringMapConstIterator operator++(int) { // Postincrement
- StringMapConstIterator tmp = *this; ++*this; return tmp;
- }
-
-private:
- void AdvancePastEmptyBuckets() {
- while (Ptr->Item == 0 || Ptr->Item == StringMapImpl::getTombstoneVal())
- ++Ptr;
- }
-};
-
-template<typename ValueTy>
-class StringMapIterator : public StringMapConstIterator<ValueTy> {
-public:
- explicit StringMapIterator(StringMapImpl::ItemBucket *Bucket,
- bool NoAdvance = false)
- : StringMapConstIterator<ValueTy>(Bucket, NoAdvance) {
- }
- StringMapEntry<ValueTy> &operator*() const {
- return *static_cast<StringMapEntry<ValueTy>*>(this->Ptr->Item);
- }
- StringMapEntry<ValueTy> *operator->() const {
- return static_cast<StringMapEntry<ValueTy>*>(this->Ptr->Item);
- }
-};
-
-}
-
-#endif
diff --git a/release_23/include/llvm/ADT/Tree.h b/release_23/include/llvm/ADT/Tree.h
deleted file mode 100644
index 6b3751fe6e56..000000000000
--- a/release_23/include/llvm/ADT/Tree.h
+++ /dev/null
@@ -1,62 +0,0 @@
-//===- llvm/ADT/Tree.h - Generic n-way tree structure -----------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This class defines a generic N way tree node structure. The tree structure
-// is immutable after creation, but the payload contained within it is not.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_ADT_TREE_H
-#define LLVM_ADT_TREE_H
-
-#include <vector>
-
-namespace llvm {
-
-template<class ConcreteTreeNode, class Payload>
-class Tree {
- std::vector<ConcreteTreeNode*> Children; // This nodes children, if any
- ConcreteTreeNode *Parent; // Parent of this node...
- Payload Data; // Data held in this node...
-
-protected:
- void setChildren(const std::vector<ConcreteTreeNode*> &children) {
- Children = children;
- }
-public:
- inline Tree(ConcreteTreeNode *parent) : Parent(parent) {}
- inline Tree(const std::vector<ConcreteTreeNode*> &children,
- ConcreteTreeNode *par) : Children(children), Parent(par) {}
-
- inline Tree(const std::vector<ConcreteTreeNode*> &children,
- ConcreteTreeNode *par, const Payload &data)
- : Children(children), Parent(par), Data(data) {}
-
- // Tree dtor - Free all children
- inline ~Tree() {
- for (unsigned i = Children.size(); i > 0; --i)
- delete Children[i-1];
- }
-
- // Tree manipulation/walking routines...
- inline ConcreteTreeNode *getParent() const { return Parent; }
- inline unsigned getNumChildren() const { return Children.size(); }
- inline ConcreteTreeNode *getChild(unsigned i) const {
- assert(i < Children.size() && "Tree::getChild with index out of range!");
- return Children[i];
- }
-
- // Payload access...
- inline Payload &getTreeData() { return Data; }
- inline const Payload &getTreeData() const { return Data; }
-};
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/ADT/Trie.h b/release_23/include/llvm/ADT/Trie.h
deleted file mode 100644
index 8a868e53c114..000000000000
--- a/release_23/include/llvm/ADT/Trie.h
+++ /dev/null
@@ -1,331 +0,0 @@
-//===- llvm/ADT/Trie.h ---- Generic trie structure --------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This class defines a generic trie structure. The trie structure
-// is immutable after creation, but the payload contained within it is not.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_ADT_TRIE_H
-#define LLVM_ADT_TRIE_H
-
-#include "llvm/ADT/GraphTraits.h"
-#include "llvm/Support/DOTGraphTraits.h"
-
-#include <vector>
-
-namespace llvm {
-
-// FIXME:
-// - Labels are usually small, maybe it's better to use SmallString
-// - Should we use char* during construction?
-// - Should we templatize Empty with traits-like interface?
-
-template<class Payload>
-class Trie {
- friend class GraphTraits<Trie<Payload> >;
- friend class DOTGraphTraits<Trie<Payload> >;
-public:
- class Node {
- friend class Trie;
-
- public:
- typedef std::vector<Node*> NodeVectorType;
- typedef typename NodeVectorType::iterator iterator;
- typedef typename NodeVectorType::const_iterator const_iterator;
-
- private:
- enum QueryResult {
- Same = -3,
- StringIsPrefix = -2,
- LabelIsPrefix = -1,
- DontMatch = 0,
- HaveCommonPart
- };
-
- struct NodeCmp {
- bool operator() (Node* N1, Node* N2) {
- return (N1->Label[0] < N2->Label[0]);
- }
- bool operator() (Node* N, char Id) {
- return (N->Label[0] < Id);
- }
- };
-
- std::string Label;
- Payload Data;
- NodeVectorType Children;
-
- // Do not implement
- Node(const Node&);
- Node& operator=(const Node&);
-
- inline void addEdge(Node* N) {
- if (Children.empty())
- Children.push_back(N);
- else {
- iterator I = std::lower_bound(Children.begin(), Children.end(),
- N, NodeCmp());
- // FIXME: no dups are allowed
- Children.insert(I, N);
- }
- }
-
- inline void setEdge(Node* N) {
- char Id = N->Label[0];
- iterator I = std::lower_bound(Children.begin(), Children.end(),
- Id, NodeCmp());
- assert(I != Children.end() && "Node does not exists!");
- *I = N;
- }
-
- QueryResult query(const std::string& s) const {
- unsigned i, l;
- unsigned l1 = s.length();
- unsigned l2 = Label.length();
-
- // Find the length of common part
- l = std::min(l1, l2);
- i = 0;
- while ((i < l) && (s[i] == Label[i]))
- ++i;
-
- if (i == l) { // One is prefix of another, find who is who
- if (l1 == l2)
- return Same;
- else if (i == l1)
- return StringIsPrefix;
- else
- return LabelIsPrefix;
- } else // s and Label have common (possible empty) part, return its length
- return (QueryResult)i;
- }
-
- public:
- inline explicit Node(const Payload& data, const std::string& label = ""):
- Label(label), Data(data) { }
-
- inline const Payload& data() const { return Data; }
- inline void setData(const Payload& data) { Data = data; }
-
- inline const std::string& label() const { return Label; }
-
-#if 0
- inline void dump() {
- std::cerr << "Node: " << this << "\n"
- << "Label: " << Label << "\n"
- << "Children:\n";
-
- for (iterator I = Children.begin(), E = Children.end(); I != E; ++I)
- std::cerr << (*I)->Label << "\n";
- }
-#endif
-
- inline Node* getEdge(char Id) {
- Node* fNode = NULL;
- iterator I = std::lower_bound(Children.begin(), Children.end(),
- Id, NodeCmp());
- if (I != Children.end() && (*I)->Label[0] == Id)
- fNode = *I;
-
- return fNode;
- }
-
- inline iterator begin() { return Children.begin(); }
- inline const_iterator begin() const { return Children.begin(); }
- inline iterator end () { return Children.end(); }
- inline const_iterator end () const { return Children.end(); }
-
- inline size_t size () const { return Children.size(); }
- inline bool empty() const { return Children.empty(); }
- inline const Node* &front() const { return Children.front(); }
- inline Node* &front() { return Children.front(); }
- inline const Node* &back() const { return Children.back(); }
- inline Node* &back() { return Children.back(); }
-
- };
-
-private:
- std::vector<Node*> Nodes;
- Payload Empty;
-
- inline Node* addNode(const Payload& data, const std::string label = "") {
- Node* N = new Node(data, label);
- Nodes.push_back(N);
- return N;
- }
-
- inline Node* splitEdge(Node* N, char Id, size_t index) {
- Node* eNode = N->getEdge(Id);
- assert(eNode && "Node doesn't exist");
-
- const std::string &l = eNode->Label;
- assert(index > 0 && index < l.length() && "Trying to split too far!");
- std::string l1 = l.substr(0, index);
- std::string l2 = l.substr(index);
-
- Node* nNode = addNode(Empty, l1);
- N->setEdge(nNode);
-
- eNode->Label = l2;
- nNode->addEdge(eNode);
-
- return nNode;
- }
-
- // Do not implement
- Trie(const Trie&);
- Trie& operator=(const Trie&);
-
-public:
- inline explicit Trie(const Payload& empty):Empty(empty) {
- addNode(Empty);
- }
- inline ~Trie() {
- for (unsigned i = 0, e = Nodes.size(); i != e; ++i)
- delete Nodes[i];
- }
-
- inline Node* getRoot() const { return Nodes[0]; }
-
- bool addString(const std::string& s, const Payload& data);
- const Payload& lookup(const std::string& s) const;
-
-};
-
-// Define this out-of-line to dissuade the C++ compiler from inlining it.
-template<class Payload>
-bool Trie<Payload>::addString(const std::string& s, const Payload& data) {
- Node* cNode = getRoot();
- Node* tNode = NULL;
- std::string s1(s);
-
- while (tNode == NULL) {
- char Id = s1[0];
- if (Node* nNode = cNode->getEdge(Id)) {
- typename Node::QueryResult r = nNode->query(s1);
-
- switch (r) {
- case Node::Same:
- case Node::StringIsPrefix:
- // Currently we don't allow to have two strings in the trie one
- // being a prefix of another. This should be fixed.
- assert(0 && "FIXME!");
- return false;
- case Node::DontMatch:
- assert(0 && "Impossible!");
- return false;
- case Node::LabelIsPrefix:
- s1 = s1.substr(nNode->label().length());
- cNode = nNode;
- break;
- default:
- nNode = splitEdge(cNode, Id, r);
- tNode = addNode(data, s1.substr(r));
- nNode->addEdge(tNode);
- }
- } else {
- tNode = addNode(data, s1);
- cNode->addEdge(tNode);
- }
- }
-
- return true;
-}
-
-template<class Payload>
-const Payload& Trie<Payload>::lookup(const std::string& s) const {
- Node* cNode = getRoot();
- Node* tNode = NULL;
- std::string s1(s);
-
- while (tNode == NULL) {
- char Id = s1[0];
- if (Node* nNode = cNode->getEdge(Id)) {
- typename Node::QueryResult r = nNode->query(s1);
-
- switch (r) {
- case Node::Same:
- tNode = nNode;
- break;
- case Node::StringIsPrefix:
- return Empty;
- case Node::DontMatch:
- assert(0 && "Impossible!");
- return Empty;
- case Node::LabelIsPrefix:
- s1 = s1.substr(nNode->label().length());
- cNode = nNode;
- break;
- default:
- return Empty;
- }
- } else
- return Empty;
- }
-
- return tNode->data();
-}
-
-template<class Payload>
-struct GraphTraits<Trie<Payload> > {
- typedef Trie<Payload> TrieType;
- typedef typename TrieType::Node NodeType;
- typedef typename NodeType::iterator ChildIteratorType;
-
- static inline NodeType *getEntryNode(const TrieType& T) { return T.getRoot(); }
-
- static inline ChildIteratorType child_begin(NodeType *N) { return N->begin(); }
- static inline ChildIteratorType child_end(NodeType *N) { return N->end(); }
-
- typedef typename std::vector<NodeType*>::const_iterator nodes_iterator;
-
- static inline nodes_iterator nodes_begin(const TrieType& G) {
- return G.Nodes.begin();
- }
- static inline nodes_iterator nodes_end(const TrieType& G) {
- return G.Nodes.end();
- }
-
-};
-
-template<class Payload>
-struct DOTGraphTraits<Trie<Payload> > : public DefaultDOTGraphTraits {
- typedef typename Trie<Payload>::Node NodeType;
- typedef typename GraphTraits<Trie<Payload> >::ChildIteratorType EdgeIter;
-
- static std::string getGraphName(const Trie<Payload>& T) {
- return "Trie";
- }
-
- static std::string getNodeLabel(NodeType* Node, const Trie<Payload>& T) {
- if (T.getRoot() == Node)
- return "<Root>";
- else
- return Node->label();
- }
-
- static std::string getEdgeSourceLabel(NodeType* Node, EdgeIter I) {
- NodeType* N = *I;
- return N->label().substr(0, 1);
- }
-
- static std::string getNodeAttributes(const NodeType* Node,
- const Trie<Payload>& T) {
- if (Node->data() != T.Empty)
- return "color=blue";
-
- return "";
- }
-
-};
-
-} // end of llvm namespace
-
-#endif // LLVM_ADT_TRIE_H
diff --git a/release_23/include/llvm/ADT/UniqueVector.h b/release_23/include/llvm/ADT/UniqueVector.h
deleted file mode 100644
index b114b8231efa..000000000000
--- a/release_23/include/llvm/ADT/UniqueVector.h
+++ /dev/null
@@ -1,89 +0,0 @@
-//===-- llvm/ADT/UniqueVector.h ---------------------------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_ADT_UNIQUEVECTOR_H
-#define LLVM_ADT_UNIQUEVECTOR_H
-
-#include <cassert>
-#include <map>
-#include <vector>
-
-namespace llvm {
-
-//===----------------------------------------------------------------------===//
-/// UniqueVector - This class produces a sequential ID number (base 1) for each
-/// unique entry that is added. T is the type of entries in the vector. This
-/// class should have an implementation of operator== and of operator<.
-/// Entries can be fetched using operator[] with the entry ID.
-template<class T> class UniqueVector {
-private:
- // Map - Used to handle the correspondence of entry to ID.
- std::map<T, unsigned> Map;
-
- // Vector - ID ordered vector of entries. Entries can be indexed by ID - 1.
- //
- std::vector<T> Vector;
-
-public:
- /// insert - Append entry to the vector if it doesn't already exist. Returns
- /// the entry's index + 1 to be used as a unique ID.
- unsigned insert(const T &Entry) {
- // Check if the entry is already in the map.
- unsigned &Val = Map[Entry];
-
- // See if entry exists, if so return prior ID.
- if (Val) return Val;
-
- // Compute ID for entry.
- Val = static_cast<unsigned>(Vector.size()) + 1;
-
- // Insert in vector.
- Vector.push_back(Entry);
- return Val;
- }
-
- /// idFor - return the ID for an existing entry. Returns 0 if the entry is
- /// not found.
- unsigned idFor(const T &Entry) const {
- // Search for entry in the map.
- typename std::map<T, unsigned>::const_iterator MI = Map.find(Entry);
-
- // See if entry exists, if so return ID.
- if (MI != Map.end()) return MI->second;
-
- // No luck.
- return 0;
- }
-
- /// operator[] - Returns a reference to the entry with the specified ID.
- ///
- const T &operator[](unsigned ID) const {
- assert(ID-1 < size() && "ID is 0 or out of range!");
- return Vector[ID - 1];
- }
-
- /// size - Returns the number of entries in the vector.
- ///
- size_t size() const { return Vector.size(); }
-
- /// empty - Returns true if the vector is empty.
- ///
- bool empty() const { return Vector.empty(); }
-
- /// reset - Clears all the entries.
- ///
- void reset() {
- Map.clear();
- Vector.resize(0, 0);
- }
-};
-
-} // End of namespace llvm
-
-#endif // LLVM_ADT_UNIQUEVECTOR_H
diff --git a/release_23/include/llvm/ADT/VectorExtras.h b/release_23/include/llvm/ADT/VectorExtras.h
deleted file mode 100644
index e05f585996f9..000000000000
--- a/release_23/include/llvm/ADT/VectorExtras.h
+++ /dev/null
@@ -1,41 +0,0 @@
-//===-- llvm/ADT/VectorExtras.h - Helpers for std::vector -------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains helper functions which are useful for working with the
-// std::vector class.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_ADT_VECTOREXTRAS_H
-#define LLVM_ADT_VECTOREXTRAS_H
-
-#include <cstdarg>
-#include <vector>
-
-namespace llvm {
-
-/// make_vector - Helper function which is useful for building temporary vectors
-/// to pass into type construction of CallInst ctors. This turns a null
-/// terminated list of pointers (or other value types) into a real live vector.
-///
-template<typename T>
-inline std::vector<T> make_vector(T A, ...) {
- va_list Args;
- va_start(Args, A);
- std::vector<T> Result;
- Result.push_back(A);
- while (T Val = va_arg(Args, T))
- Result.push_back(Val);
- va_end(Args);
- return Result;
-}
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/ADT/hash_map.in b/release_23/include/llvm/ADT/hash_map.in
deleted file mode 100644
index b5c785f1a419..000000000000
--- a/release_23/include/llvm/ADT/hash_map.in
+++ /dev/null
@@ -1,150 +0,0 @@
-//===-- llvm/ADT/hash_map - "Portable" wrapper around hash_map --*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file provides a wrapper around the mysterious <hash_map> header file
-// that seems to move around between GCC releases into and out of namespaces at
-// will. #including this header will cause hash_map to be available in the
-// global namespace.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_ADT_HASH_MAP
-#define LLVM_ADT_HASH_MAP
-
-// Compiler Support Matrix
-//
-// Version Namespace Header File
-// 2.95.x :: hash_map
-// 3.0.4 std ext/hash_map
-// 3.1 __gnu_cxx ext/hash_map
-// HP aCC6 std stdex/rw/hashm*ap.h
-// MS VC++ stdext hash_map
-
-#undef HAVE_GNU_EXT_HASH_MAP
-#undef HAVE_STD_EXT_HASH_MAP
-#undef HAVE_GLOBAL_HASH_MAP
-#undef HAVE_RW_STDEX_HASH_MAP_H
-
-#if HAVE_GNU_EXT_HASH_MAP
-// This is for GCC-3.1+ which puts hash in ext/hash_map
-# include <ext/hash_map>
-# ifndef HASH_NAMESPACE
-# define HASH_NAMESPACE __gnu_cxx
-# endif
-
-// GCC 3.0.x puts hash_map in <ext/hash_map> and in the std namespace.
-#elif HAVE_STD_EXT_HASH_MAP
-# include <ext/hash_map>
-# ifndef HASH_NAMESPACE
-# define HASH_NAMESPACE std
-# endif
-
-// Older compilers such as GCC before version 3.0 do not keep
-// extensions in the `ext' directory, and ignore the `std' namespace.
-#elif HAVE_GLOBAL_HASH_MAP
-# include <hash_map>
-# ifndef HASH_NAMESPACE
-# define HASH_NAMESPACE std
-# endif
-
-// HP aCC doesn't include an SGI-like hash_map. For this platform (or
-// any others using Rogue Wave Software's Tools.h++ library), we wrap
-// around them in std::
-#elif HAVE_RW_STDEX_HASH_MAP_H
-# include <rw/stdex/hashmap.h>
-# include <rw/stdex/hashmmap.h>
-# ifndef HASH_NAMESPACE
-# define HASH_NAMESPACE std
-# endif
-
-// Support Microsoft VC++.
-#elif defined(_MSC_VER)
-# include <hash_map>
-# ifndef HASH_NAMESPACE
-# define HASH_NAMESPACE stdext
- using std::_Distance;
-# endif
-
-// Give a warning if we couldn't find it, instead of (or in addition to)
-// randomly doing something dumb.
-#else
-# warning "Autoconfiguration failed to find the hash_map header file."
-#endif
-
-// we wrap Rogue Wave Tools.h++ rw_hashmap into something SGI-looking, here:
-#ifdef HAVE_RW_STDEX_HASH_MAP_H
-namespace HASH_NAMESPACE {
-
-template <class DataType> struct hash {
- unsigned int operator()(const unsigned int& x) const {
- return x;
- }
-};
-
-template <typename KeyType,
- typename ValueType,
- class _HashFcn = hash<KeyType>,
- class _EqualKey = equal_to<KeyType>,
- class _A = allocator <ValueType> >
-class hash_map : public rw_hashmap<KeyType, ValueType, class _HashFcn,
- class _EqualKey, class _A> {
-};
-
-template <typename KeyType,
- typename ValueType,
- class _HashFcn = hash<KeyType>,
- class _EqualKey = equal_to<KeyType>,
- class _A = allocator <ValueType> >
-class hash_multimap : public rw_hashmultimap<KeyType, ValueType, class _HashFcn,
- class _EqualKey, class _A> {
-};
-
-} // end HASH_NAMESPACE;
-#endif
-
-// Include vector because ext/hash_map includes stl_vector.h and leaves
-// out specializations like stl_bvector.h, causing link conflicts.
-#include <vector>
-
-#ifdef _MSC_VER
-
-// GCC and VC++ have differing ways of implementing hash_maps. As it's not
-// standardized, that's to be expected. This adapter class allows VC++
-// hash_map to use GCC's hash classes.
-namespace stdext {
- template<class Key> struct hash;
-
- // Provide a hash function for unsigned ints...
- template<> struct hash<unsigned int> {
- inline size_t operator()(unsigned int Val) const {
- return Val;
- }
- };
-
- template<class Key> class hash_compare<Key, std::less<Key> > {
- std::less<Key> comp;
- public:
- enum { bucket_size = 4 };
- enum { min_buckets = 8 };
- hash_compare() {}
- hash_compare(std::less<Key> pred) : comp(pred) {}
- size_t operator()(const Key& key) const { return hash<Key>()(key); }
- bool operator()(const Key& k1, const Key& k2) const { return comp(k1, k2); }
- };
-}
-
-#endif
-
-using HASH_NAMESPACE::hash_map;
-using HASH_NAMESPACE::hash_multimap;
-using HASH_NAMESPACE::hash;
-
-#include "llvm/ADT/HashExtras.h"
-
-#endif
diff --git a/release_23/include/llvm/ADT/hash_set.in b/release_23/include/llvm/ADT/hash_set.in
deleted file mode 100644
index a0945ce4ac7a..000000000000
--- a/release_23/include/llvm/ADT/hash_set.in
+++ /dev/null
@@ -1,111 +0,0 @@
-//===-- llvm/ADT/hash_set - "Portable" wrapper around hash_set --*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-// vim:ft=cpp
-//
-// This file provides a wrapper around the mysterious <hash_set> header file
-// that seems to move around between GCC releases into and out of namespaces at
-// will. #including this header will cause hash_set to be available in the
-// global namespace.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_ADT_HASH_SET
-#define LLVM_ADT_HASH_SET
-
-// Compiler Support Matrix
-//
-// Version Namespace Header File
-// 2.95.x :: hash_set
-// 3.0.4 std ext/hash_set
-// 3.1 __gnu_cxx ext/hash_set
-// HP aCC6 std stdex/rw/hashset.h
-// MS VC++ stdext hash_set
-
-#undef HAVE_GNU_EXT_HASH_SET
-#undef HAVE_STD_EXT_HASH_SET
-#undef HAVE_GLOBAL_HASH_SET
-#undef HAVE_RW_STDEX_HASH_SET_H
-
-// GCC versions 3.1 and later put hash_set in <ext/hash_set> and in
-// the __gnu_cxx namespace.
-#if HAVE_GNU_EXT_HASH_SET
-# include <ext/hash_set>
-# ifndef HASH_NAMESPACE
-# define HASH_NAMESPACE __gnu_cxx
-# endif
-
-// GCC 3.0.x puts hash_set in <ext/hash_set> and in the std namespace.
-#elif HAVE_STD_EXT_HASH_SET
-# include <ext/hash_set>
-# ifndef HASH_NAMESPACE
-# define HASH_NAMESPACE std
-# endif
-
-// Older compilers such as GCC before version 3.0 do not keep
-// extensions in the `ext' directory, and ignore the `std' namespace.
-#elif HAVE_GLOBAL_HASH_SET
-# include <hash_set>
-# ifndef HASH_NAMESPACE
-# define HASH_NAMESPACE std
-# endif
-
-// HP aCC doesn't include an SGI-like hash_set. For this platform (or
-// any others using Rogue Wave Software's Tools.h++ library), we wrap
-// around them in std::
-#elif HAVE_RW_STDEX_HASH_SET_H
-# include <rw/stdex/hashset.h>
-# ifndef HASH_NAMESPACE
-# define HASH_NAMESPACE std
-# endif
-
-// Support Microsoft VC++.
-#elif defined(_MSC_VER)
-# include <hash_set>
-# ifndef HASH_NAMESPACE
-# define HASH_NAMESPACE stdext
-# endif
-
-// Give a warning if we couldn't find it, instead of (or in addition to)
-// randomly doing something dumb.
-#else
-# warning "Autoconfiguration failed to find the hash_set header file."
-#endif
-
-// we wrap Rogue Wave Tools.h++ rw_hashset into something SGI-looking, here:
-#ifdef HAVE_RW_STDEX_HASH_SET_H
-namespace HASH_NAMESPACE {
-
-/*
-template <class DataType> struct hash {
- unsigned int operator()(const unsigned int& x) const {
- return x;
- }
-};
-*/
-
-template <typename ValueType,
- class _HashFcn = hash<ValueType>,
- class _EqualKey = equal_to<ValueType>,
- class _A = allocator <ValueType> >
-class hash_set :
- public rw_hashset<ValueType, class _HashFcn, class _EqualKey, class _A> {
-};
-
-} // end HASH_NAMESPACE;
-#endif
-
-using HASH_NAMESPACE::hash_set;
-
-// Include vector because ext/hash_set includes stl_vector.h and leaves
-// out specializations like stl_bvector.h, causing link conflicts.
-#include <vector>
-
-#include "llvm/ADT/HashExtras.h"
-
-#endif
diff --git a/release_23/include/llvm/ADT/ilist b/release_23/include/llvm/ADT/ilist
deleted file mode 100644
index d465cbfc7152..000000000000
--- a/release_23/include/llvm/ADT/ilist
+++ /dev/null
@@ -1,634 +0,0 @@
-//===-- llvm/ADT/ilist - Intrusive Linked List Template ---------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines classes to implement an intrusive doubly linked list class
-// (i.e. each node of the list must contain a next and previous field for the
-// list.
-//
-// The ilist_traits trait class is used to gain access to the next and previous
-// fields of the node type that the list is instantiated with. If it is not
-// specialized, the list defaults to using the getPrev(), getNext() method calls
-// to get the next and previous pointers.
-//
-// The ilist class itself, should be a plug in replacement for list, assuming
-// that the nodes contain next/prev pointers. This list replacement does not
-// provide a constant time size() method, so be careful to use empty() when you
-// really want to know if it's empty.
-//
-// The ilist class is implemented by allocating a 'tail' node when the list is
-// created (using ilist_traits<>::createSentinel()). This tail node is
-// absolutely required because the user must be able to compute end()-1. Because
-// of this, users of the direct next/prev links will see an extra link on the
-// end of the list, which should be ignored.
-//
-// Requirements for a user of this list:
-//
-// 1. The user must provide {g|s}et{Next|Prev} methods, or specialize
-// ilist_traits to provide an alternate way of getting and setting next and
-// prev links.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_ADT_ILIST
-#define LLVM_ADT_ILIST
-
-#include "llvm/ADT/iterator"
-#include <cassert>
-#include <cstdlib>
-
-namespace llvm {
-
-template<typename NodeTy, typename Traits> class iplist;
-template<typename NodeTy> class ilist_iterator;
-
-// Template traits for intrusive list. By specializing this template class, you
-// can change what next/prev fields are used to store the links...
-template<typename NodeTy>
-struct ilist_traits {
- static NodeTy *getPrev(NodeTy *N) { return N->getPrev(); }
- static NodeTy *getNext(NodeTy *N) { return N->getNext(); }
- static const NodeTy *getPrev(const NodeTy *N) { return N->getPrev(); }
- static const NodeTy *getNext(const NodeTy *N) { return N->getNext(); }
-
- static void setPrev(NodeTy *N, NodeTy *Prev) { N->setPrev(Prev); }
- static void setNext(NodeTy *N, NodeTy *Next) { N->setNext(Next); }
-
- static NodeTy *createNode(const NodeTy &V) { return new NodeTy(V); }
-
- static NodeTy *createSentinel() { return new NodeTy(); }
- static void destroySentinel(NodeTy *N) { delete N; }
-
- void addNodeToList(NodeTy *NTy) {}
- void removeNodeFromList(NodeTy *NTy) {}
- void transferNodesFromList(iplist<NodeTy, ilist_traits> &L2,
- ilist_iterator<NodeTy> first,
- ilist_iterator<NodeTy> last) {}
-};
-
-// Const traits are the same as nonconst traits...
-template<typename Ty>
-struct ilist_traits<const Ty> : public ilist_traits<Ty> {};
-
-
-//===----------------------------------------------------------------------===//
-// ilist_iterator<Node> - Iterator for intrusive list.
-//
-template<typename NodeTy>
-class ilist_iterator
- : public bidirectional_iterator<NodeTy, ptrdiff_t> {
- typedef ilist_traits<NodeTy> Traits;
- typedef bidirectional_iterator<NodeTy, ptrdiff_t> super;
-
-public:
- typedef size_t size_type;
- typedef typename super::pointer pointer;
- typedef typename super::reference reference;
-private:
- pointer NodePtr;
-public:
-
- ilist_iterator(pointer NP) : NodePtr(NP) {}
- ilist_iterator(reference NR) : NodePtr(&NR) {}
- ilist_iterator() : NodePtr(0) {}
-
- // This is templated so that we can allow constructing a const iterator from
- // a nonconst iterator...
- template<class node_ty>
- ilist_iterator(const ilist_iterator<node_ty> &RHS)
- : NodePtr(RHS.getNodePtrUnchecked()) {}
-
- // This is templated so that we can allow assigning to a const iterator from
- // a nonconst iterator...
- template<class node_ty>
- const ilist_iterator &operator=(const ilist_iterator<node_ty> &RHS) {
- NodePtr = RHS.getNodePtrUnchecked();
- return *this;
- }
-
- // Accessors...
- operator pointer() const {
- assert(Traits::getNext(NodePtr) != 0 && "Dereferencing end()!");
- return NodePtr;
- }
-
- reference operator*() const {
- assert(Traits::getNext(NodePtr) != 0 && "Dereferencing end()!");
- return *NodePtr;
- }
- pointer operator->() { return &operator*(); }
- const pointer operator->() const { return &operator*(); }
-
- // Comparison operators
- bool operator==(const ilist_iterator &RHS) const {
- return NodePtr == RHS.NodePtr;
- }
- bool operator!=(const ilist_iterator &RHS) const {
- return NodePtr != RHS.NodePtr;
- }
-
- // Increment and decrement operators...
- ilist_iterator &operator--() { // predecrement - Back up
- NodePtr = Traits::getPrev(NodePtr);
- assert(Traits::getNext(NodePtr) && "--'d off the beginning of an ilist!");
- return *this;
- }
- ilist_iterator &operator++() { // preincrement - Advance
- NodePtr = Traits::getNext(NodePtr);
- assert(NodePtr && "++'d off the end of an ilist!");
- return *this;
- }
- ilist_iterator operator--(int) { // postdecrement operators...
- ilist_iterator tmp = *this;
- --*this;
- return tmp;
- }
- ilist_iterator operator++(int) { // postincrement operators...
- ilist_iterator tmp = *this;
- ++*this;
- return tmp;
- }
-
- // Internal interface, do not use...
- pointer getNodePtrUnchecked() const { return NodePtr; }
-};
-
-// do not implement. this is to catch errors when people try to use
-// them as random access iterators
-template<typename T>
-void operator-(int, ilist_iterator<T>);
-template<typename T>
-void operator-(ilist_iterator<T>,int);
-
-template<typename T>
-void operator+(int, ilist_iterator<T>);
-template<typename T>
-void operator+(ilist_iterator<T>,int);
-
-// operator!=/operator== - Allow mixed comparisons without dereferencing
-// the iterator, which could very likely be pointing to end().
-template<typename T>
-bool operator!=(const T* LHS, const ilist_iterator<const T> &RHS) {
- return LHS != RHS.getNodePtrUnchecked();
-}
-template<typename T>
-bool operator==(const T* LHS, const ilist_iterator<const T> &RHS) {
- return LHS == RHS.getNodePtrUnchecked();
-}
-template<typename T>
-bool operator!=(T* LHS, const ilist_iterator<T> &RHS) {
- return LHS != RHS.getNodePtrUnchecked();
-}
-template<typename T>
-bool operator==(T* LHS, const ilist_iterator<T> &RHS) {
- return LHS == RHS.getNodePtrUnchecked();
-}
-
-
-// Allow ilist_iterators to convert into pointers to a node automatically when
-// used by the dyn_cast, cast, isa mechanisms...
-
-template<typename From> struct simplify_type;
-
-template<typename NodeTy> struct simplify_type<ilist_iterator<NodeTy> > {
- typedef NodeTy* SimpleType;
-
- static SimpleType getSimplifiedValue(const ilist_iterator<NodeTy> &Node) {
- return &*Node;
- }
-};
-template<typename NodeTy> struct simplify_type<const ilist_iterator<NodeTy> > {
- typedef NodeTy* SimpleType;
-
- static SimpleType getSimplifiedValue(const ilist_iterator<NodeTy> &Node) {
- return &*Node;
- }
-};
-
-
-//===----------------------------------------------------------------------===//
-//
-/// iplist - The subset of list functionality that can safely be used on nodes
-/// of polymorphic types, i.e. a heterogenous list with a common base class that
-/// holds the next/prev pointers. The only state of the list itself is a single
-/// pointer to the head of the list.
-///
-/// This list can be in one of three interesting states:
-/// 1. The list may be completely unconstructed. In this case, the head
-/// pointer is null. When in this form, any query for an iterator (e.g.
-/// begin() or end()) causes the list to transparently change to state #2.
-/// 2. The list may be empty, but contain a sentinal for the end iterator. This
-/// sentinal is created by the Traits::createSentinel method and is a link
-/// in the list. When the list is empty, the pointer in the iplist points
-/// to the sentinal. Once the sentinal is constructed, it
-/// is not destroyed until the list is.
-/// 3. The list may contain actual objects in it, which are stored as a doubly
-/// linked list of nodes. One invariant of the list is that the predecessor
-/// of the first node in the list always points to the last node in the list,
-/// and the successor pointer for the sentinal (which always stays at the
-/// end of the list) is always null.
-///
-template<typename NodeTy, typename Traits=ilist_traits<NodeTy> >
-class iplist : public Traits {
- mutable NodeTy *Head;
-
- // Use the prev node pointer of 'head' as the tail pointer. This is really a
- // circularly linked list where we snip the 'next' link from the sentinel node
- // back to the first node in the list (to preserve assertions about going off
- // the end of the list).
- NodeTy *getTail() { return getPrev(Head); }
- const NodeTy *getTail() const { return getPrev(Head); }
- void setTail(NodeTy *N) const { setPrev(Head, N); }
-
- /// CreateLazySentinal - This method verifies whether the sentinal for the
- /// list has been created and lazily makes it if not.
- void CreateLazySentinal() const {
- if (Head != 0) return;
- Head = Traits::createSentinel();
- setNext(Head, 0);
- setTail(Head);
- }
-
- static bool op_less(NodeTy &L, NodeTy &R) { return L < R; }
- static bool op_equal(NodeTy &L, NodeTy &R) { return L == R; }
-public:
- typedef NodeTy *pointer;
- typedef const NodeTy *const_pointer;
- typedef NodeTy &reference;
- typedef const NodeTy &const_reference;
- typedef NodeTy value_type;
- typedef ilist_iterator<NodeTy> iterator;
- typedef ilist_iterator<const NodeTy> const_iterator;
- typedef size_t size_type;
- typedef ptrdiff_t difference_type;
- typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
- typedef std::reverse_iterator<iterator> reverse_iterator;
-
- iplist() : Head(0) {}
- ~iplist() {
- if (!Head) return;
- clear();
- Traits::destroySentinel(getTail());
- }
-
- // Iterator creation methods.
- iterator begin() {
- CreateLazySentinal();
- return iterator(Head);
- }
- const_iterator begin() const {
- CreateLazySentinal();
- return const_iterator(Head);
- }
- iterator end() {
- CreateLazySentinal();
- return iterator(getTail());
- }
- const_iterator end() const {
- CreateLazySentinal();
- return const_iterator(getTail());
- }
-
- // reverse iterator creation methods.
- reverse_iterator rbegin() { return reverse_iterator(end()); }
- const_reverse_iterator rbegin() const{ return const_reverse_iterator(end()); }
- reverse_iterator rend() { return reverse_iterator(begin()); }
- const_reverse_iterator rend() const { return const_reverse_iterator(begin());}
-
-
- // Miscellaneous inspection routines.
- size_type max_size() const { return size_type(-1); }
- bool empty() const { return Head == 0 || Head == getTail(); }
-
- // Front and back accessor functions...
- reference front() {
- assert(!empty() && "Called front() on empty list!");
- return *Head;
- }
- const_reference front() const {
- assert(!empty() && "Called front() on empty list!");
- return *Head;
- }
- reference back() {
- assert(!empty() && "Called back() on empty list!");
- return *getPrev(getTail());
- }
- const_reference back() const {
- assert(!empty() && "Called back() on empty list!");
- return *getPrev(getTail());
- }
-
- void swap(iplist &RHS) {
- abort(); // Swap does not use list traits callback correctly yet!
- std::swap(Head, RHS.Head);
- }
-
- iterator insert(iterator where, NodeTy *New) {
- NodeTy *CurNode = where.getNodePtrUnchecked(), *PrevNode = getPrev(CurNode);
- setNext(New, CurNode);
- setPrev(New, PrevNode);
-
- if (CurNode != Head) // Is PrevNode off the beginning of the list?
- setNext(PrevNode, New);
- else
- Head = New;
- setPrev(CurNode, New);
-
- addNodeToList(New); // Notify traits that we added a node...
- return New;
- }
-
- NodeTy *remove(iterator &IT) {
- assert(IT != end() && "Cannot remove end of list!");
- NodeTy *Node = &*IT;
- NodeTy *NextNode = getNext(Node);
- NodeTy *PrevNode = getPrev(Node);
-
- if (Node != Head) // Is PrevNode off the beginning of the list?
- setNext(PrevNode, NextNode);
- else
- Head = NextNode;
- setPrev(NextNode, PrevNode);
- IT = NextNode;
- removeNodeFromList(Node); // Notify traits that we removed a node...
-
- // Set the next/prev pointers of the current node to null. This isn't
- // strictly required, but this catches errors where a node is removed from
- // an ilist (and potentially deleted) with iterators still pointing at it.
- // When those iterators are incremented or decremented, they will assert on
- // the null next/prev pointer instead of "usually working".
- setNext(Node, 0);
- setPrev(Node, 0);
- return Node;
- }
-
- NodeTy *remove(const iterator &IT) {
- iterator MutIt = IT;
- return remove(MutIt);
- }
-
- // erase - remove a node from the controlled sequence... and delete it.
- iterator erase(iterator where) {
- delete remove(where);
- return where;
- }
-
-
-private:
- // transfer - The heart of the splice function. Move linked list nodes from
- // [first, last) into position.
- //
- void transfer(iterator position, iplist &L2, iterator first, iterator last) {
- assert(first != last && "Should be checked by callers");
-
- if (position != last) {
- // Note: we have to be careful about the case when we move the first node
- // in the list. This node is the list sentinel node and we can't move it.
- NodeTy *ThisSentinel = getTail();
- setTail(0);
- NodeTy *L2Sentinel = L2.getTail();
- L2.setTail(0);
-
- // Remove [first, last) from its old position.
- NodeTy *First = &*first, *Prev = getPrev(First);
- NodeTy *Next = last.getNodePtrUnchecked(), *Last = getPrev(Next);
- if (Prev)
- setNext(Prev, Next);
- else
- L2.Head = Next;
- setPrev(Next, Prev);
-
- // Splice [first, last) into its new position.
- NodeTy *PosNext = position.getNodePtrUnchecked();
- NodeTy *PosPrev = getPrev(PosNext);
-
- // Fix head of list...
- if (PosPrev)
- setNext(PosPrev, First);
- else
- Head = First;
- setPrev(First, PosPrev);
-
- // Fix end of list...
- setNext(Last, PosNext);
- setPrev(PosNext, Last);
-
- transferNodesFromList(L2, First, PosNext);
-
- // Now that everything is set, restore the pointers to the list sentinals.
- L2.setTail(L2Sentinel);
- setTail(ThisSentinel);
- }
- }
-
-public:
-
- //===----------------------------------------------------------------------===
- // Functionality derived from other functions defined above...
- //
-
- size_type size() const {
- if (Head == 0) return 0; // Don't require construction of sentinal if empty.
-#if __GNUC__ == 2
- // GCC 2.95 has a broken std::distance
- size_type Result = 0;
- std::distance(begin(), end(), Result);
- return Result;
-#else
- return std::distance(begin(), end());
-#endif
- }
-
- iterator erase(iterator first, iterator last) {
- while (first != last)
- first = erase(first);
- return last;
- }
-
- void clear() { if (Head) erase(begin(), end()); }
-
- // Front and back inserters...
- void push_front(NodeTy *val) { insert(begin(), val); }
- void push_back(NodeTy *val) { insert(end(), val); }
- void pop_front() {
- assert(!empty() && "pop_front() on empty list!");
- erase(begin());
- }
- void pop_back() {
- assert(!empty() && "pop_back() on empty list!");
- iterator t = end(); erase(--t);
- }
-
- // Special forms of insert...
- template<class InIt> void insert(iterator where, InIt first, InIt last) {
- for (; first != last; ++first) insert(where, *first);
- }
-
- // Splice members - defined in terms of transfer...
- void splice(iterator where, iplist &L2) {
- if (!L2.empty())
- transfer(where, L2, L2.begin(), L2.end());
- }
- void splice(iterator where, iplist &L2, iterator first) {
- iterator last = first; ++last;
- if (where == first || where == last) return; // No change
- transfer(where, L2, first, last);
- }
- void splice(iterator where, iplist &L2, iterator first, iterator last) {
- if (first != last) transfer(where, L2, first, last);
- }
-
-
-
- //===----------------------------------------------------------------------===
- // High-Level Functionality that shouldn't really be here, but is part of list
- //
-
- // These two functions are actually called remove/remove_if in list<>, but
- // they actually do the job of erase, rename them accordingly.
- //
- void erase(const NodeTy &val) {
- for (iterator I = begin(), E = end(); I != E; ) {
- iterator next = I; ++next;
- if (*I == val) erase(I);
- I = next;
- }
- }
- template<class Pr1> void erase_if(Pr1 pred) {
- for (iterator I = begin(), E = end(); I != E; ) {
- iterator next = I; ++next;
- if (pred(*I)) erase(I);
- I = next;
- }
- }
-
- template<class Pr2> void unique(Pr2 pred) {
- if (empty()) return;
- for (iterator I = begin(), E = end(), Next = begin(); ++Next != E;) {
- if (pred(*I))
- erase(Next);
- else
- I = Next;
- Next = I;
- }
- }
- void unique() { unique(op_equal); }
-
- template<class Pr3> void merge(iplist &right, Pr3 pred) {
- iterator first1 = begin(), last1 = end();
- iterator first2 = right.begin(), last2 = right.end();
- while (first1 != last1 && first2 != last2)
- if (pred(*first2, *first1)) {
- iterator next = first2;
- transfer(first1, right, first2, ++next);
- first2 = next;
- } else {
- ++first1;
- }
- if (first2 != last2) transfer(last1, right, first2, last2);
- }
- void merge(iplist &right) { return merge(right, op_less); }
-
- template<class Pr3> void sort(Pr3 pred);
- void sort() { sort(op_less); }
- void reverse();
-};
-
-
-template<typename NodeTy>
-struct ilist : public iplist<NodeTy> {
- typedef typename iplist<NodeTy>::size_type size_type;
- typedef typename iplist<NodeTy>::iterator iterator;
-
- ilist() {}
- ilist(const ilist &right) {
- insert(this->begin(), right.begin(), right.end());
- }
- explicit ilist(size_type count) {
- insert(this->begin(), count, NodeTy());
- }
- ilist(size_type count, const NodeTy &val) {
- insert(this->begin(), count, val);
- }
- template<class InIt> ilist(InIt first, InIt last) {
- insert(this->begin(), first, last);
- }
-
-
- // Forwarding functions: A workaround for GCC 2.95 which does not correctly
- // support 'using' declarations to bring a hidden member into scope.
- //
- iterator insert(iterator a, NodeTy *b){ return iplist<NodeTy>::insert(a, b); }
- void push_front(NodeTy *a) { iplist<NodeTy>::push_front(a); }
- void push_back(NodeTy *a) { iplist<NodeTy>::push_back(a); }
-
-
- // Main implementation here - Insert for a node passed by value...
- iterator insert(iterator where, const NodeTy &val) {
- return insert(where, createNode(val));
- }
-
-
- // Front and back inserters...
- void push_front(const NodeTy &val) { insert(this->begin(), val); }
- void push_back(const NodeTy &val) { insert(this->end(), val); }
-
- // Special forms of insert...
- template<class InIt> void insert(iterator where, InIt first, InIt last) {
- for (; first != last; ++first) insert(where, *first);
- }
- void insert(iterator where, size_type count, const NodeTy &val) {
- for (; count != 0; --count) insert(where, val);
- }
-
- // Assign special forms...
- void assign(size_type count, const NodeTy &val) {
- iterator I = this->begin();
- for (; I != this->end() && count != 0; ++I, --count)
- *I = val;
- if (count != 0)
- insert(this->end(), val, val);
- else
- erase(I, this->end());
- }
- template<class InIt> void assign(InIt first1, InIt last1) {
- iterator first2 = this->begin(), last2 = this->end();
- for ( ; first1 != last1 && first2 != last2; ++first1, ++first2)
- *first1 = *first2;
- if (first2 == last2)
- erase(first1, last1);
- else
- insert(last1, first2, last2);
- }
-
-
- // Resize members...
- void resize(size_type newsize, NodeTy val) {
- iterator i = this->begin();
- size_type len = 0;
- for ( ; i != this->end() && len < newsize; ++i, ++len) /* empty*/ ;
-
- if (len == newsize)
- erase(i, this->end());
- else // i == end()
- insert(this->end(), newsize - len, val);
- }
- void resize(size_type newsize) { resize(newsize, NodeTy()); }
-};
-
-} // End llvm namespace
-
-namespace std {
- // Ensure that swap uses the fast list swap...
- template<class Ty>
- void swap(llvm::iplist<Ty> &Left, llvm::iplist<Ty> &Right) {
- Left.swap(Right);
- }
-} // End 'std' extensions...
-
-#endif
diff --git a/release_23/include/llvm/ADT/iterator.in b/release_23/include/llvm/ADT/iterator.in
deleted file mode 100644
index 3494c7102126..000000000000
--- a/release_23/include/llvm/ADT/iterator.in
+++ /dev/null
@@ -1,76 +0,0 @@
-//===-- llvm/ADT/iterator - Portable wrapper around <iterator> --*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file provides a wrapper around the mysterious <iterator> header file.
-// In GCC 2.95.3, the file defines a bidirectional_iterator class (and other
-// friends), instead of the standard iterator class. In GCC 3.1, the
-// bidirectional_iterator class got moved out and the new, standards compliant,
-// iterator<> class was added. Because there is nothing that we can do to get
-// correct behavior on both compilers, we have this header with #ifdef's. Gross
-// huh?
-//
-// By #includ'ing this file, you get the contents of <iterator> plus the
-// following classes in the global namespace:
-//
-// 1. bidirectional_iterator
-// 2. forward_iterator
-//
-// The #if directives' expressions are filled in by Autoconf.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_ADT_ITERATOR
-#define LLVM_ADT_ITERATOR
-
-#include <iterator>
-
-#undef HAVE_BI_ITERATOR
-#undef HAVE_STD_ITERATOR
-#undef HAVE_FWD_ITERATOR
-
-#ifdef _MSC_VER
-# define HAVE_BI_ITERATOR 0
-# define HAVE_STD_ITERATOR 1
-# define HAVE_FWD_ITERATOR 0
-#endif
-
-#if !HAVE_BI_ITERATOR
-# if HAVE_STD_ITERATOR
-/// If the bidirectional iterator is not defined, we attempt to define it in
-/// terms of the C++ standard iterator. Otherwise, we import it with a "using"
-/// statement.
-///
-template<class Ty, class PtrDiffTy>
-struct bidirectional_iterator
- : public std::iterator<std::bidirectional_iterator_tag, Ty, PtrDiffTy> {
-};
-# else
-# error "Need to have standard iterator to define bidirectional iterator!"
-# endif
-#else
-using std::bidirectional_iterator;
-#endif
-
-#if !HAVE_FWD_ITERATOR
-# if HAVE_STD_ITERATOR
-/// If the forward iterator is not defined, attempt to define it in terms of
-/// the C++ standard iterator. Otherwise, we import it with a "using" statement.
-///
-template<class Ty, class PtrDiffTy>
-struct forward_iterator
- : public std::iterator<std::forward_iterator_tag, Ty, PtrDiffTy> {
-};
-# else
-# error "Need to have standard iterator to define forward iterator!"
-# endif
-#else
-using std::forward_iterator;
-#endif
-
-#endif
diff --git a/release_23/include/llvm/AbstractTypeUser.h b/release_23/include/llvm/AbstractTypeUser.h
deleted file mode 100644
index f7fabfcb2fe4..000000000000
--- a/release_23/include/llvm/AbstractTypeUser.h
+++ /dev/null
@@ -1,179 +0,0 @@
-//===-- llvm/AbstractTypeUser.h - AbstractTypeUser Interface ----*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file declares the AbstractTypeUser class.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_ABSTRACT_TYPE_USER_H
-#define LLVM_ABSTRACT_TYPE_USER_H
-
-#if !defined(LLVM_TYPE_H) && !defined(LLVM_VALUE_H)
-#error Do not include this file directly. Include Type.h instead.
-#error Some versions of GCC (e.g. 3.4 and 4.1) can not handle the inlined method
-#error PATypeHolder::dropRef() correctly otherwise.
-#endif
-
-// This is the "master" include for <cassert> Whether this file needs it or not,
-// it must always include <cassert> for the files which include
-// llvm/AbstractTypeUser.h
-//
-// In this way, most every LLVM source file will have access to the assert()
-// macro without having to #include <cassert> directly.
-//
-#include <cassert>
-
-namespace llvm {
-
-class Type;
-class DerivedType;
-
-/// The AbstractTypeUser class is an interface to be implemented by classes who
-/// could possibly use an abstract type. Abstract types are denoted by the
-/// isAbstract flag set to true in the Type class. These are classes that
-/// contain an Opaque type in their structure somewhere.
-///
-/// Classes must implement this interface so that they may be notified when an
-/// abstract type is resolved. Abstract types may be resolved into more
-/// concrete types through: linking, parsing, and bitcode reading. When this
-/// happens, all of the users of the type must be updated to reference the new,
-/// more concrete type. They are notified through the AbstractTypeUser
-/// interface.
-///
-/// In addition to this, AbstractTypeUsers must keep the use list of the
-/// potentially abstract type that they reference up-to-date. To do this in a
-/// nice, transparent way, the PATypeHandle class is used to hold "Potentially
-/// Abstract Types", and keep the use list of the abstract types up-to-date.
-/// @brief LLVM Abstract Type User Representation
-class AbstractTypeUser {
-protected:
- virtual ~AbstractTypeUser(); // Derive from me
-public:
-
- /// refineAbstractType - The callback method invoked when an abstract type is
- /// resolved to another type. An object must override this method to update
- /// its internal state to reference NewType instead of OldType.
- ///
- virtual void refineAbstractType(const DerivedType *OldTy,
- const Type *NewTy) = 0;
-
- /// The other case which AbstractTypeUsers must be aware of is when a type
- /// makes the transition from being abstract (where it has clients on it's
- /// AbstractTypeUsers list) to concrete (where it does not). This method
- /// notifies ATU's when this occurs for a type.
- ///
- virtual void typeBecameConcrete(const DerivedType *AbsTy) = 0;
-
- // for debugging...
- virtual void dump() const = 0;
-};
-
-
-/// PATypeHandle - Handle to a Type subclass. This class is used to keep the
-/// use list of abstract types up-to-date.
-///
-class PATypeHandle {
- const Type *Ty;
- AbstractTypeUser * const User;
-
- // These functions are defined at the bottom of Type.h. See the comment there
- // for justification.
- void addUser();
- void removeUser();
-public:
- // ctor - Add use to type if abstract. Note that Ty must not be null
- inline PATypeHandle(const Type *ty, AbstractTypeUser *user)
- : Ty(ty), User(user) {
- addUser();
- }
-
- // ctor - Add use to type if abstract.
- inline PATypeHandle(const PATypeHandle &T) : Ty(T.Ty), User(T.User) {
- addUser();
- }
-
- // dtor - Remove reference to type...
- inline ~PATypeHandle() { removeUser(); }
-
- // Automatic casting operator so that the handle may be used naturally
- inline operator Type *() const { return const_cast<Type*>(Ty); }
- inline Type *get() const { return const_cast<Type*>(Ty); }
-
- // operator= - Allow assignment to handle
- inline Type *operator=(const Type *ty) {
- if (Ty != ty) { // Ensure we don't accidentally drop last ref to Ty
- removeUser();
- Ty = ty;
- addUser();
- }
- return get();
- }
-
- // operator= - Allow assignment to handle
- inline const Type *operator=(const PATypeHandle &T) {
- return operator=(T.Ty);
- }
-
- inline bool operator==(const Type *ty) {
- return Ty == ty;
- }
-
- // operator-> - Allow user to dereference handle naturally...
- inline const Type *operator->() const { return Ty; }
-};
-
-
-/// PATypeHolder - Holder class for a potentially abstract type. This uses
-/// efficient union-find techniques to handle dynamic type resolution. Unless
-/// you need to do custom processing when types are resolved, you should always
-/// use PATypeHolders in preference to PATypeHandles.
-///
-class PATypeHolder {
- mutable const Type *Ty;
-public:
- PATypeHolder(const Type *ty) : Ty(ty) {
- addRef();
- }
- PATypeHolder(const PATypeHolder &T) : Ty(T.Ty) {
- addRef();
- }
-
- ~PATypeHolder() { dropRef(); }
-
- operator Type *() const { return get(); }
- Type *get() const;
-
- // operator-> - Allow user to dereference handle naturally...
- Type *operator->() const { return get(); }
-
- // operator= - Allow assignment to handle
- Type *operator=(const Type *ty) {
- if (Ty != ty) { // Don't accidentally drop last ref to Ty.
- dropRef();
- Ty = ty;
- addRef();
- }
- return get();
- }
- Type *operator=(const PATypeHolder &H) {
- return operator=(H.Ty);
- }
-
- /// getRawType - This should only be used to implement the vmcore library.
- ///
- const Type *getRawType() const { return Ty; }
-
-private:
- void addRef();
- void dropRef();
-};
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/Analysis/AliasAnalysis.h b/release_23/include/llvm/Analysis/AliasAnalysis.h
deleted file mode 100644
index efd23e328c8e..000000000000
--- a/release_23/include/llvm/Analysis/AliasAnalysis.h
+++ /dev/null
@@ -1,357 +0,0 @@
-//===- llvm/Analysis/AliasAnalysis.h - Alias Analysis Interface -*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines the generic AliasAnalysis interface, which is used as the
-// common interface used by all clients of alias analysis information, and
-// implemented by all alias analysis implementations. Mod/Ref information is
-// also captured by this interface.
-//
-// Implementations of this interface must implement the various virtual methods,
-// which automatically provides functionality for the entire suite of client
-// APIs.
-//
-// This API represents memory as a (Pointer, Size) pair. The Pointer component
-// specifies the base memory address of the region, the Size specifies how large
-// of an area is being queried. If Size is 0, two pointers only alias if they
-// are exactly equal. If size is greater than zero, but small, the two pointers
-// alias if the areas pointed to overlap. If the size is very large (ie, ~0U),
-// then the two pointers alias if they may be pointing to components of the same
-// memory object. Pointers that point to two completely different objects in
-// memory never alias, regardless of the value of the Size component.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_ANALYSIS_ALIAS_ANALYSIS_H
-#define LLVM_ANALYSIS_ALIAS_ANALYSIS_H
-
-#include "llvm/Support/CallSite.h"
-#include "llvm/System/IncludeFile.h"
-#include <vector>
-
-namespace llvm {
-
-class LoadInst;
-class StoreInst;
-class VAArgInst;
-class TargetData;
-class Pass;
-class AnalysisUsage;
-
-class AliasAnalysis {
-protected:
- const TargetData *TD;
- AliasAnalysis *AA; // Previous Alias Analysis to chain to.
-
- /// InitializeAliasAnalysis - Subclasses must call this method to initialize
- /// the AliasAnalysis interface before any other methods are called. This is
- /// typically called by the run* methods of these subclasses. This may be
- /// called multiple times.
- ///
- void InitializeAliasAnalysis(Pass *P);
-
- // getAnalysisUsage - All alias analysis implementations should invoke this
- // directly (using AliasAnalysis::getAnalysisUsage(AU)) to make sure that
- // TargetData is required by the pass.
- virtual void getAnalysisUsage(AnalysisUsage &AU) const;
-
-public:
- static char ID; // Class identification, replacement for typeinfo
- AliasAnalysis() : TD(0), AA(0) {}
- virtual ~AliasAnalysis(); // We want to be subclassed
-
- /// getTargetData - Every alias analysis implementation depends on the size of
- /// data items in the current Target. This provides a uniform way to handle
- /// it.
- ///
- const TargetData &getTargetData() const { return *TD; }
-
- //===--------------------------------------------------------------------===//
- /// Alias Queries...
- ///
-
- /// Alias analysis result - Either we know for sure that it does not alias, we
- /// know for sure it must alias, or we don't know anything: The two pointers
- /// _might_ alias. This enum is designed so you can do things like:
- /// if (AA.alias(P1, P2)) { ... }
- /// to check to see if two pointers might alias.
- ///
- enum AliasResult { NoAlias = 0, MayAlias = 1, MustAlias = 2 };
-
- /// alias - The main low level interface to the alias analysis implementation.
- /// Returns a Result indicating whether the two pointers are aliased to each
- /// other. This is the interface that must be implemented by specific alias
- /// analysis implementations.
- ///
- virtual AliasResult alias(const Value *V1, unsigned V1Size,
- const Value *V2, unsigned V2Size);
-
- /// getMustAliases - If there are any pointers known that must alias this
- /// pointer, return them now. This allows alias-set based alias analyses to
- /// perform a form a value numbering (which is exposed by load-vn). If an
- /// alias analysis supports this, it should ADD any must aliased pointers to
- /// the specified vector.
- ///
- virtual void getMustAliases(Value *P, std::vector<Value*> &RetVals);
-
- /// pointsToConstantMemory - If the specified pointer is known to point into
- /// constant global memory, return true. This allows disambiguation of store
- /// instructions from constant pointers.
- ///
- virtual bool pointsToConstantMemory(const Value *P);
-
- //===--------------------------------------------------------------------===//
- /// Simple mod/ref information...
- ///
-
- /// ModRefResult - Represent the result of a mod/ref query. Mod and Ref are
- /// bits which may be or'd together.
- ///
- enum ModRefResult { NoModRef = 0, Ref = 1, Mod = 2, ModRef = 3 };
-
-
- /// ModRefBehavior - Summary of how a function affects memory in the program.
- /// Loads from constant globals are not considered memory accesses for this
- /// interface. Also, functions may freely modify stack space local to their
- /// invocation without having to report it through these interfaces.
- enum ModRefBehavior {
- // DoesNotAccessMemory - This function does not perform any non-local loads
- // or stores to memory.
- //
- // This property corresponds to the GCC 'const' attribute.
- DoesNotAccessMemory,
-
- // AccessesArguments - This function accesses function arguments in
- // non-volatile and well known ways, but does not access any other memory.
- //
- // Clients may call getArgumentAccesses to get specific information about
- // how pointer arguments are used.
- AccessesArguments,
-
- // AccessesArgumentsAndGlobals - This function has accesses function
- // arguments and global variables in non-volatile and well-known ways, but
- // does not access any other memory.
- //
- // Clients may call getArgumentAccesses to get specific information about
- // how pointer arguments and globals are used.
- AccessesArgumentsAndGlobals,
-
- // OnlyReadsMemory - This function does not perform any non-local stores or
- // volatile loads, but may read from any memory location.
- //
- // This property corresponds to the GCC 'pure' attribute.
- OnlyReadsMemory,
-
- // UnknownModRefBehavior - This indicates that the function could not be
- // classified into one of the behaviors above.
- UnknownModRefBehavior
- };
-
- /// PointerAccessInfo - This struct is used to return results for pointers,
- /// globals, and the return value of a function.
- struct PointerAccessInfo {
- /// V - The value this record corresponds to. This may be an Argument for
- /// the function, a GlobalVariable, or null, corresponding to the return
- /// value for the function.
- Value *V;
-
- /// ModRefInfo - Whether the pointer is loaded or stored to/from.
- ///
- ModRefResult ModRefInfo;
-
- /// AccessType - Specific fine-grained access information for the argument.
- /// If none of these classifications is general enough, the
- /// getModRefBehavior method should not return AccessesArguments*. If a
- /// record is not returned for a particular argument, the argument is never
- /// dead and never dereferenced.
- enum AccessType {
- /// ScalarAccess - The pointer is dereferenced.
- ///
- ScalarAccess,
-
- /// ArrayAccess - The pointer is indexed through as an array of elements.
- ///
- ArrayAccess,
-
- /// ElementAccess ?? P->F only?
-
- /// CallsThrough - Indirect calls are made through the specified function
- /// pointer.
- CallsThrough
- };
- };
-
- /// getModRefBehavior - Return the behavior when calling the given call site.
- ModRefBehavior getModRefBehavior(CallSite CS,
- std::vector<PointerAccessInfo> *Info = 0);
-
- /// getModRefBehavior - Return the behavior when calling the given function.
- /// For use when the call site is not known.
- ModRefBehavior getModRefBehavior(Function *F,
- std::vector<PointerAccessInfo> *Info = 0);
-
- /// doesNotAccessMemory - If the specified call is known to never read or
- /// write memory, return true. If the call only reads from known-constant
- /// memory, it is also legal to return true. Calls that unwind the stack
- /// are legal for this predicate.
- ///
- /// Many optimizations (such as CSE and LICM) can be performed on such calls
- /// without worrying about aliasing properties, and many calls have this
- /// property (e.g. calls to 'sin' and 'cos').
- ///
- /// This property corresponds to the GCC 'const' attribute.
- ///
- bool doesNotAccessMemory(CallSite CS) {
- return getModRefBehavior(CS) == DoesNotAccessMemory;
- }
-
- /// doesNotAccessMemory - If the specified function is known to never read or
- /// write memory, return true. For use when the call site is not known.
- ///
- bool doesNotAccessMemory(Function *F) {
- return getModRefBehavior(F) == DoesNotAccessMemory;
- }
-
- /// onlyReadsMemory - If the specified call is known to only read from
- /// non-volatile memory (or not access memory at all), return true. Calls
- /// that unwind the stack are legal for this predicate.
- ///
- /// This property allows many common optimizations to be performed in the
- /// absence of interfering store instructions, such as CSE of strlen calls.
- ///
- /// This property corresponds to the GCC 'pure' attribute.
- ///
- bool onlyReadsMemory(CallSite CS) {
- ModRefBehavior MRB = getModRefBehavior(CS);
- return MRB == DoesNotAccessMemory || MRB == OnlyReadsMemory;
- }
-
- /// onlyReadsMemory - If the specified function is known to only read from
- /// non-volatile memory (or not access memory at all), return true. For use
- /// when the call site is not known.
- ///
- bool onlyReadsMemory(Function *F) {
- ModRefBehavior MRB = getModRefBehavior(F);
- return MRB == DoesNotAccessMemory || MRB == OnlyReadsMemory;
- }
-
-
- /// getModRefInfo - Return information about whether or not an instruction may
- /// read or write memory specified by the pointer operand. An instruction
- /// that doesn't read or write memory may be trivially LICM'd for example.
-
- /// getModRefInfo (for call sites) - Return whether information about whether
- /// a particular call site modifies or reads the memory specified by the
- /// pointer.
- ///
- virtual ModRefResult getModRefInfo(CallSite CS, Value *P, unsigned Size);
-
- /// getModRefInfo - Return information about whether two call sites may refer
- /// to the same set of memory locations. This function returns NoModRef if
- /// the two calls refer to disjoint memory locations, Ref if CS1 reads memory
- /// written by CS2, Mod if CS1 writes to memory read or written by CS2, or
- /// ModRef if CS1 might read or write memory accessed by CS2.
- ///
- virtual ModRefResult getModRefInfo(CallSite CS1, CallSite CS2);
-
- /// hasNoModRefInfoForCalls - Return true if the analysis has no mod/ref
- /// information for pairs of function calls (other than "pure" and "const"
- /// functions). This can be used by clients to avoid many pointless queries.
- /// Remember that if you override this and chain to another analysis, you must
- /// make sure that it doesn't have mod/ref info either.
- ///
- virtual bool hasNoModRefInfoForCalls() const;
-
-protected:
- /// getModRefBehavior - Return the behavior of the specified function if
- /// called from the specified call site. The call site may be null in which
- /// case the most generic behavior of this function should be returned.
- virtual ModRefBehavior getModRefBehavior(Function *F, CallSite CS,
- std::vector<PointerAccessInfo> *Info = 0);
-
-public:
- /// Convenience functions...
- ModRefResult getModRefInfo(LoadInst *L, Value *P, unsigned Size);
- ModRefResult getModRefInfo(StoreInst *S, Value *P, unsigned Size);
- ModRefResult getModRefInfo(CallInst *C, Value *P, unsigned Size) {
- return getModRefInfo(CallSite(C), P, Size);
- }
- ModRefResult getModRefInfo(InvokeInst *I, Value *P, unsigned Size) {
- return getModRefInfo(CallSite(I), P, Size);
- }
- ModRefResult getModRefInfo(VAArgInst* I, Value* P, unsigned Size) {
- return AliasAnalysis::ModRef;
- }
- ModRefResult getModRefInfo(Instruction *I, Value *P, unsigned Size) {
- switch (I->getOpcode()) {
- case Instruction::VAArg: return getModRefInfo((VAArgInst*)I, P, Size);
- case Instruction::Load: return getModRefInfo((LoadInst*)I, P, Size);
- case Instruction::Store: return getModRefInfo((StoreInst*)I, P, Size);
- case Instruction::Call: return getModRefInfo((CallInst*)I, P, Size);
- case Instruction::Invoke: return getModRefInfo((InvokeInst*)I, P, Size);
- default: return NoModRef;
- }
- }
-
- //===--------------------------------------------------------------------===//
- /// Higher level methods for querying mod/ref information.
- ///
-
- /// canBasicBlockModify - Return true if it is possible for execution of the
- /// specified basic block to modify the value pointed to by Ptr.
- ///
- bool canBasicBlockModify(const BasicBlock &BB, const Value *P, unsigned Size);
-
- /// canInstructionRangeModify - Return true if it is possible for the
- /// execution of the specified instructions to modify the value pointed to by
- /// Ptr. The instructions to consider are all of the instructions in the
- /// range of [I1,I2] INCLUSIVE. I1 and I2 must be in the same basic block.
- ///
- bool canInstructionRangeModify(const Instruction &I1, const Instruction &I2,
- const Value *Ptr, unsigned Size);
-
- //===--------------------------------------------------------------------===//
- /// Methods that clients should call when they transform the program to allow
- /// alias analyses to update their internal data structures. Note that these
- /// methods may be called on any instruction, regardless of whether or not
- /// they have pointer-analysis implications.
- ///
-
- /// deleteValue - This method should be called whenever an LLVM Value is
- /// deleted from the program, for example when an instruction is found to be
- /// redundant and is eliminated.
- ///
- virtual void deleteValue(Value *V);
-
- /// copyValue - This method should be used whenever a preexisting value in the
- /// program is copied or cloned, introducing a new value. Note that analysis
- /// implementations should tolerate clients that use this method to introduce
- /// the same value multiple times: if the analysis already knows about a
- /// value, it should ignore the request.
- ///
- virtual void copyValue(Value *From, Value *To);
-
- /// replaceWithNewValue - This method is the obvious combination of the two
- /// above, and it provided as a helper to simplify client code.
- ///
- void replaceWithNewValue(Value *Old, Value *New) {
- copyValue(Old, New);
- deleteValue(Old);
- }
-};
-
-} // End llvm namespace
-
-// Because of the way .a files work, we must force the BasicAA implementation to
-// be pulled in if the AliasAnalysis header is included. Otherwise we run
-// the risk of AliasAnalysis being used, but the default implementation not
-// being linked into the tool that uses it.
-FORCE_DEFINING_FILE_TO_BE_LINKED(AliasAnalysis)
-FORCE_DEFINING_FILE_TO_BE_LINKED(BasicAliasAnalysis)
-
-#endif
diff --git a/release_23/include/llvm/Analysis/AliasSetTracker.h b/release_23/include/llvm/Analysis/AliasSetTracker.h
deleted file mode 100644
index 70c25b0680b5..000000000000
--- a/release_23/include/llvm/Analysis/AliasSetTracker.h
+++ /dev/null
@@ -1,396 +0,0 @@
-//===- llvm/Analysis/AliasSetTracker.h - Build Alias Sets -------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines two classes: AliasSetTracker and AliasSet. These interface
-// are used to classify a collection of pointer references into a maximal number
-// of disjoint sets. Each AliasSet object constructed by the AliasSetTracker
-// object refers to memory disjoint from the other sets.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_ANALYSIS_ALIASSETTRACKER_H
-#define LLVM_ANALYSIS_ALIASSETTRACKER_H
-
-#include "llvm/Support/CallSite.h"
-#include "llvm/Support/Streams.h"
-#include "llvm/ADT/iterator"
-#include "llvm/ADT/hash_map"
-#include "llvm/ADT/ilist"
-
-namespace llvm {
-
-class AliasAnalysis;
-class LoadInst;
-class StoreInst;
-class FreeInst;
-class VAArgInst;
-class AliasSetTracker;
-class AliasSet;
-
-class AliasSet {
- friend class AliasSetTracker;
-
- class PointerRec;
- typedef std::pair<Value* const, PointerRec> HashNodePair;
-
- class PointerRec {
- HashNodePair **PrevInList, *NextInList;
- AliasSet *AS;
- unsigned Size;
- public:
- PointerRec() : PrevInList(0), NextInList(0), AS(0), Size(0) {}
-
- HashNodePair *getNext() const { return NextInList; }
- bool hasAliasSet() const { return AS != 0; }
-
- HashNodePair** setPrevInList(HashNodePair **PIL) {
- PrevInList = PIL;
- return &NextInList;
- }
-
- void updateSize(unsigned NewSize) {
- if (NewSize > Size) Size = NewSize;
- }
-
- unsigned getSize() const { return Size; }
-
- AliasSet *getAliasSet(AliasSetTracker &AST) {
- assert(AS && "No AliasSet yet!");
- if (AS->Forward) {
- AliasSet *OldAS = AS;
- AS = OldAS->getForwardedTarget(AST);
- AS->addRef();
- OldAS->dropRef(AST);
- }
- return AS;
- }
-
- void setAliasSet(AliasSet *as) {
- assert(AS == 0 && "Already have an alias set!");
- AS = as;
- }
-
- void removeFromList() {
- if (NextInList) NextInList->second.PrevInList = PrevInList;
- *PrevInList = NextInList;
- if (AS->PtrListEnd == &NextInList) {
- AS->PtrListEnd = PrevInList;
- assert(*AS->PtrListEnd == 0 && "List not terminated right!");
- }
- }
- };
-
- HashNodePair *PtrList, **PtrListEnd; // Doubly linked list of nodes
- AliasSet *Forward; // Forwarding pointer
- AliasSet *Next, *Prev; // Doubly linked list of AliasSets
-
- std::vector<CallSite> CallSites; // All calls & invokes in this node
-
- // RefCount - Number of nodes pointing to this AliasSet plus the number of
- // AliasSets forwarding to it.
- unsigned RefCount : 28;
-
- /// AccessType - Keep track of whether this alias set merely refers to the
- /// locations of memory, whether it modifies the memory, or whether it does
- /// both. The lattice goes from "NoModRef" to either Refs or Mods, then to
- /// ModRef as necessary.
- ///
- enum AccessType {
- NoModRef = 0, Refs = 1, // Ref = bit 1
- Mods = 2, ModRef = 3 // Mod = bit 2
- };
- unsigned AccessTy : 2;
-
- /// AliasType - Keep track the relationships between the pointers in the set.
- /// Lattice goes from MustAlias to MayAlias.
- ///
- enum AliasType {
- MustAlias = 0, MayAlias = 1
- };
- unsigned AliasTy : 1;
-
- // Volatile - True if this alias set contains volatile loads or stores.
- bool Volatile : 1;
-
- friend struct ilist_traits<AliasSet>;
- AliasSet *getPrev() const { return Prev; }
- AliasSet *getNext() const { return Next; }
- void setPrev(AliasSet *P) { Prev = P; }
- void setNext(AliasSet *N) { Next = N; }
-
- void addRef() { ++RefCount; }
- void dropRef(AliasSetTracker &AST) {
- assert(RefCount >= 1 && "Invalid reference count detected!");
- if (--RefCount == 0)
- removeFromTracker(AST);
- }
-
-public:
- /// Accessors...
- bool isRef() const { return AccessTy & Refs; }
- bool isMod() const { return AccessTy & Mods; }
- bool isMustAlias() const { return AliasTy == MustAlias; }
- bool isMayAlias() const { return AliasTy == MayAlias; }
-
- // isVolatile - Return true if this alias set contains volatile loads or
- // stores.
- bool isVolatile() const { return Volatile; }
-
- /// isForwardingAliasSet - Return true if this alias set should be ignored as
- /// part of the AliasSetTracker object.
- bool isForwardingAliasSet() const { return Forward; }
-
- /// mergeSetIn - Merge the specified alias set into this alias set...
- ///
- void mergeSetIn(AliasSet &AS, AliasSetTracker &AST);
-
- // Alias Set iteration - Allow access to all of the pointer which are part of
- // this alias set...
- class iterator;
- iterator begin() const { return iterator(PtrList); }
- iterator end() const { return iterator(); }
- bool empty() const { return PtrList == 0; }
-
- void print(std::ostream &OS) const;
- void print(std::ostream *OS) const { if (OS) print(*OS); }
- void dump() const;
-
- /// Define an iterator for alias sets... this is just a forward iterator.
- class iterator : public forward_iterator<HashNodePair, ptrdiff_t> {
- HashNodePair *CurNode;
- public:
- explicit iterator(HashNodePair *CN = 0) : CurNode(CN) {}
-
- bool operator==(const iterator& x) const {
- return CurNode == x.CurNode;
- }
- bool operator!=(const iterator& x) const { return !operator==(x); }
-
- const iterator &operator=(const iterator &I) {
- CurNode = I.CurNode;
- return *this;
- }
-
- value_type &operator*() const {
- assert(CurNode && "Dereferencing AliasSet.end()!");
- return *CurNode;
- }
- value_type *operator->() const { return &operator*(); }
-
- Value *getPointer() const { return CurNode->first; }
- unsigned getSize() const { return CurNode->second.getSize(); }
-
- iterator& operator++() { // Preincrement
- assert(CurNode && "Advancing past AliasSet.end()!");
- CurNode = CurNode->second.getNext();
- return *this;
- }
- iterator operator++(int) { // Postincrement
- iterator tmp = *this; ++*this; return tmp;
- }
- };
-
-private:
- // Can only be created by AliasSetTracker
- AliasSet() : PtrList(0), PtrListEnd(&PtrList), Forward(0), RefCount(0),
- AccessTy(NoModRef), AliasTy(MustAlias), Volatile(false) {
- }
-
- AliasSet(const AliasSet &AS) {
- assert(0 && "Copy ctor called!?!?!");
- abort();
- }
-
- HashNodePair *getSomePointer() const {
- return PtrList;
- }
-
- /// getForwardedTarget - Return the real alias set this represents. If this
- /// has been merged with another set and is forwarding, return the ultimate
- /// destination set. This also implements the union-find collapsing as well.
- AliasSet *getForwardedTarget(AliasSetTracker &AST) {
- if (!Forward) return this;
-
- AliasSet *Dest = Forward->getForwardedTarget(AST);
- if (Dest != Forward) {
- Dest->addRef();
- Forward->dropRef(AST);
- Forward = Dest;
- }
- return Dest;
- }
-
- void removeFromTracker(AliasSetTracker &AST);
-
- void addPointer(AliasSetTracker &AST, HashNodePair &Entry, unsigned Size,
- bool KnownMustAlias = false);
- void addCallSite(CallSite CS, AliasAnalysis &AA);
- void removeCallSite(CallSite CS) {
- for (size_t i = 0, e = CallSites.size(); i != e; ++i)
- if (CallSites[i].getInstruction() == CS.getInstruction()) {
- CallSites[i] = CallSites.back();
- CallSites.pop_back();
- }
- }
- void setVolatile() { Volatile = true; }
-
- /// aliasesPointer - Return true if the specified pointer "may" (or must)
- /// alias one of the members in the set.
- ///
- bool aliasesPointer(const Value *Ptr, unsigned Size, AliasAnalysis &AA) const;
- bool aliasesCallSite(CallSite CS, AliasAnalysis &AA) const;
-};
-
-inline std::ostream& operator<<(std::ostream &OS, const AliasSet &AS) {
- AS.print(OS);
- return OS;
-}
-
-
-class AliasSetTracker {
- AliasAnalysis &AA;
- ilist<AliasSet> AliasSets;
-
- // Map from pointers to their node
- hash_map<Value*, AliasSet::PointerRec> PointerMap;
-public:
- /// AliasSetTracker ctor - Create an empty collection of AliasSets, and use
- /// the specified alias analysis object to disambiguate load and store
- /// addresses.
- explicit AliasSetTracker(AliasAnalysis &aa) : AA(aa) {}
- ~AliasSetTracker() { clear(); }
-
- /// add methods - These methods are used to add different types of
- /// instructions to the alias sets. Adding a new instruction can result in
- /// one of three actions happening:
- ///
- /// 1. If the instruction doesn't alias any other sets, create a new set.
- /// 2. If the instruction aliases exactly one set, add it to the set
- /// 3. If the instruction aliases multiple sets, merge the sets, and add
- /// the instruction to the result.
- ///
- /// These methods return true if inserting the instruction resulted in the
- /// addition of a new alias set (i.e., the pointer did not alias anything).
- ///
- bool add(Value *Ptr, unsigned Size); // Add a location
- bool add(LoadInst *LI);
- bool add(StoreInst *SI);
- bool add(FreeInst *FI);
- bool add(VAArgInst *VAAI);
- bool add(CallSite CS); // Call/Invoke instructions
- bool add(CallInst *CI) { return add(CallSite(CI)); }
- bool add(InvokeInst *II) { return add(CallSite(II)); }
- bool add(Instruction *I); // Dispatch to one of the other add methods...
- void add(BasicBlock &BB); // Add all instructions in basic block
- void add(const AliasSetTracker &AST); // Add alias relations from another AST
-
- /// remove methods - These methods are used to remove all entries that might
- /// be aliased by the specified instruction. These methods return true if any
- /// alias sets were eliminated.
- bool remove(Value *Ptr, unsigned Size); // Remove a location
- bool remove(LoadInst *LI);
- bool remove(StoreInst *SI);
- bool remove(FreeInst *FI);
- bool remove(VAArgInst *VAAI);
- bool remove(CallSite CS);
- bool remove(CallInst *CI) { return remove(CallSite(CI)); }
- bool remove(InvokeInst *II) { return remove(CallSite(II)); }
- bool remove(Instruction *I);
- void remove(AliasSet &AS);
-
- void clear() {
- PointerMap.clear();
- AliasSets.clear();
- }
-
- /// getAliasSets - Return the alias sets that are active.
- ///
- const ilist<AliasSet> &getAliasSets() const { return AliasSets; }
-
- /// getAliasSetForPointer - Return the alias set that the specified pointer
- /// lives in. If the New argument is non-null, this method sets the value to
- /// true if a new alias set is created to contain the pointer (because the
- /// pointer didn't alias anything).
- AliasSet &getAliasSetForPointer(Value *P, unsigned Size, bool *New = 0);
-
- /// getAliasSetForPointerIfExists - Return the alias set containing the
- /// location specified if one exists, otherwise return null.
- AliasSet *getAliasSetForPointerIfExists(Value *P, unsigned Size) {
- return findAliasSetForPointer(P, Size);
- }
-
- /// containsPointer - Return true if the specified location is represented by
- /// this alias set, false otherwise. This does not modify the AST object or
- /// alias sets.
- bool containsPointer(Value *P, unsigned Size) const;
-
- /// getAliasAnalysis - Return the underlying alias analysis object used by
- /// this tracker.
- AliasAnalysis &getAliasAnalysis() const { return AA; }
-
- /// deleteValue method - This method is used to remove a pointer value from
- /// the AliasSetTracker entirely. It should be used when an instruction is
- /// deleted from the program to update the AST. If you don't use this, you
- /// would have dangling pointers to deleted instructions.
- ///
- void deleteValue(Value *PtrVal);
-
- /// copyValue - This method should be used whenever a preexisting value in the
- /// program is copied or cloned, introducing a new value. Note that it is ok
- /// for clients that use this method to introduce the same value multiple
- /// times: if the tracker already knows about a value, it will ignore the
- /// request.
- ///
- void copyValue(Value *From, Value *To);
-
-
- typedef ilist<AliasSet>::iterator iterator;
- typedef ilist<AliasSet>::const_iterator const_iterator;
-
- const_iterator begin() const { return AliasSets.begin(); }
- const_iterator end() const { return AliasSets.end(); }
-
- iterator begin() { return AliasSets.begin(); }
- iterator end() { return AliasSets.end(); }
-
- void print(std::ostream &OS) const;
- void print(std::ostream *OS) const { if (OS) print(*OS); }
- void dump() const;
-
-private:
- friend class AliasSet;
- void removeAliasSet(AliasSet *AS);
-
- AliasSet::HashNodePair &getEntryFor(Value *V) {
- // Standard operator[], except that it returns the whole pair, not just
- // ->second.
- return *PointerMap.insert(AliasSet::HashNodePair(V,
- AliasSet::PointerRec())).first;
- }
-
- AliasSet &addPointer(Value *P, unsigned Size, AliasSet::AccessType E,
- bool &NewSet) {
- NewSet = false;
- AliasSet &AS = getAliasSetForPointer(P, Size, &NewSet);
- AS.AccessTy |= E;
- return AS;
- }
- AliasSet *findAliasSetForPointer(const Value *Ptr, unsigned Size);
-
- AliasSet *findAliasSetForCallSite(CallSite CS);
-};
-
-inline std::ostream& operator<<(std::ostream &OS, const AliasSetTracker &AST) {
- AST.print(OS);
- return OS;
-}
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/Analysis/CFGPrinter.h b/release_23/include/llvm/Analysis/CFGPrinter.h
deleted file mode 100644
index 6a479d199c8e..000000000000
--- a/release_23/include/llvm/Analysis/CFGPrinter.h
+++ /dev/null
@@ -1,24 +0,0 @@
-//===-- CFGPrinter.h - CFG printer external interface ------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines external functions that can be called to explicitly
-// instantiate the CFG printer.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_ANALYSIS_CFGPRINTER_H
-#define LLVM_ANALYSIS_CFGPRINTER_H
-
-namespace llvm {
- class FunctionPass;
- FunctionPass *createCFGPrinterPass ();
- FunctionPass *createCFGOnlyPrinterPass ();
-} // End llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/Analysis/CallGraph.h b/release_23/include/llvm/Analysis/CallGraph.h
deleted file mode 100644
index 3fe03b5e74c9..000000000000
--- a/release_23/include/llvm/Analysis/CallGraph.h
+++ /dev/null
@@ -1,320 +0,0 @@
-//===- CallGraph.h - Build a Module's call graph ----------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This interface is used to build and manipulate a call graph, which is a very
-// useful tool for interprocedural optimization.
-//
-// Every function in a module is represented as a node in the call graph. The
-// callgraph node keeps track of which functions the are called by the function
-// corresponding to the node.
-//
-// A call graph may contain nodes where the function that they correspond to is
-// null. These 'external' nodes are used to represent control flow that is not
-// represented (or analyzable) in the module. In particular, this analysis
-// builds one external node such that:
-// 1. All functions in the module without internal linkage will have edges
-// from this external node, indicating that they could be called by
-// functions outside of the module.
-// 2. All functions whose address is used for something more than a direct
-// call, for example being stored into a memory location will also have an
-// edge from this external node. Since they may be called by an unknown
-// caller later, they must be tracked as such.
-//
-// There is a second external node added for calls that leave this module.
-// Functions have a call edge to the external node iff:
-// 1. The function is external, reflecting the fact that they could call
-// anything without internal linkage or that has its address taken.
-// 2. The function contains an indirect function call.
-//
-// As an extension in the future, there may be multiple nodes with a null
-// function. These will be used when we can prove (through pointer analysis)
-// that an indirect call site can call only a specific set of functions.
-//
-// Because of these properties, the CallGraph captures a conservative superset
-// of all of the caller-callee relationships, which is useful for
-// transformations.
-//
-// The CallGraph class also attempts to figure out what the root of the
-// CallGraph is, which it currently does by looking for a function named 'main'.
-// If no function named 'main' is found, the external node is used as the entry
-// node, reflecting the fact that any function without internal linkage could
-// be called into (which is common for libraries).
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_ANALYSIS_CALLGRAPH_H
-#define LLVM_ANALYSIS_CALLGRAPH_H
-
-#include "llvm/ADT/GraphTraits.h"
-#include "llvm/ADT/STLExtras.h"
-#include "llvm/Pass.h"
-#include "llvm/Support/CallSite.h"
-#include "llvm/System/IncludeFile.h"
-#include <map>
-
-namespace llvm {
-
-class Function;
-class Module;
-class CallGraphNode;
-
-//===----------------------------------------------------------------------===//
-// CallGraph class definition
-//
-class CallGraph {
-protected:
- Module *Mod; // The module this call graph represents
-
- typedef std::map<const Function *, CallGraphNode *> FunctionMapTy;
- FunctionMapTy FunctionMap; // Map from a function to its node
-
-public:
- static char ID; // Class identification, replacement for typeinfo
- //===---------------------------------------------------------------------
- // Accessors...
- //
- typedef FunctionMapTy::iterator iterator;
- typedef FunctionMapTy::const_iterator const_iterator;
-
- /// getModule - Return the module the call graph corresponds to.
- ///
- Module &getModule() const { return *Mod; }
-
- inline iterator begin() { return FunctionMap.begin(); }
- inline iterator end() { return FunctionMap.end(); }
- inline const_iterator begin() const { return FunctionMap.begin(); }
- inline const_iterator end() const { return FunctionMap.end(); }
-
- // Subscripting operators, return the call graph node for the provided
- // function
- inline const CallGraphNode *operator[](const Function *F) const {
- const_iterator I = FunctionMap.find(F);
- assert(I != FunctionMap.end() && "Function not in callgraph!");
- return I->second;
- }
- inline CallGraphNode *operator[](const Function *F) {
- const_iterator I = FunctionMap.find(F);
- assert(I != FunctionMap.end() && "Function not in callgraph!");
- return I->second;
- }
-
- /// Returns the CallGraphNode which is used to represent undetermined calls
- /// into the callgraph. Override this if you want behavioral inheritance.
- virtual CallGraphNode* getExternalCallingNode() const { return 0; }
-
- /// Return the root/main method in the module, or some other root node, such
- /// as the externalcallingnode. Overload these if you behavioral
- /// inheritance.
- virtual CallGraphNode* getRoot() { return 0; }
- virtual const CallGraphNode* getRoot() const { return 0; }
-
- //===---------------------------------------------------------------------
- // Functions to keep a call graph up to date with a function that has been
- // modified.
- //
-
- /// removeFunctionFromModule - Unlink the function from this module, returning
- /// it. Because this removes the function from the module, the call graph
- /// node is destroyed. This is only valid if the function does not call any
- /// other functions (ie, there are no edges in it's CGN). The easiest way to
- /// do this is to dropAllReferences before calling this.
- ///
- Function *removeFunctionFromModule(CallGraphNode *CGN);
- Function *removeFunctionFromModule(Function *F) {
- return removeFunctionFromModule((*this)[F]);
- }
-
- /// changeFunction - This method changes the function associated with this
- /// CallGraphNode, for use by transformations that need to change the
- /// prototype of a Function (thus they must create a new Function and move the
- /// old code over).
- void changeFunction(Function *OldF, Function *NewF);
-
- /// getOrInsertFunction - This method is identical to calling operator[], but
- /// it will insert a new CallGraphNode for the specified function if one does
- /// not already exist.
- CallGraphNode *getOrInsertFunction(const Function *F);
-
- //===---------------------------------------------------------------------
- // Pass infrastructure interface glue code...
- //
-protected:
- CallGraph() {}
-
-public:
- virtual ~CallGraph() { destroy(); }
-
- /// initialize - Call this method before calling other methods,
- /// re/initializes the state of the CallGraph.
- ///
- void initialize(Module &M);
-
- virtual void print(std::ostream &o, const Module *M) const;
- void print(std::ostream *o, const Module *M) const { if (o) print(*o, M); }
- void dump() const;
-
-protected:
- // destroy - Release memory for the call graph
- virtual void destroy();
-};
-
-//===----------------------------------------------------------------------===//
-// CallGraphNode class definition
-//
-class CallGraphNode {
- Function *F;
- typedef std::pair<CallSite,CallGraphNode*> CallRecord;
- std::vector<CallRecord> CalledFunctions;
-
- CallGraphNode(const CallGraphNode &); // Do not implement
-public:
- //===---------------------------------------------------------------------
- // Accessor methods...
- //
-
- typedef std::vector<CallRecord>::iterator iterator;
- typedef std::vector<CallRecord>::const_iterator const_iterator;
-
- // getFunction - Return the function that this call graph node represents...
- Function *getFunction() const { return F; }
-
- inline iterator begin() { return CalledFunctions.begin(); }
- inline iterator end() { return CalledFunctions.end(); }
- inline const_iterator begin() const { return CalledFunctions.begin(); }
- inline const_iterator end() const { return CalledFunctions.end(); }
- inline bool empty() const { return CalledFunctions.empty(); }
- inline unsigned size() const { return (unsigned)CalledFunctions.size(); }
-
- // Subscripting operator - Return the i'th called function...
- //
- CallGraphNode *operator[](unsigned i) const {
- return CalledFunctions[i].second;
- }
-
- /// dump - Print out this call graph node.
- ///
- void dump() const;
- void print(std::ostream &OS) const;
- void print(std::ostream *OS) const { if (OS) print(*OS); }
-
- //===---------------------------------------------------------------------
- // Methods to keep a call graph up to date with a function that has been
- // modified
- //
-
- /// removeAllCalledFunctions - As the name implies, this removes all edges
- /// from this CallGraphNode to any functions it calls.
- void removeAllCalledFunctions() {
- CalledFunctions.clear();
- }
-
- /// addCalledFunction add a function to the list of functions called by this
- /// one.
- void addCalledFunction(CallSite CS, CallGraphNode *M) {
- CalledFunctions.push_back(std::make_pair(CS, M));
- }
-
- /// removeCallEdgeTo - This method removes a *single* edge to the specified
- /// callee function. Note that this method takes linear time, so it should be
- /// used sparingly.
- void removeCallEdgeTo(CallGraphNode *Callee);
-
- /// removeCallEdgeFor - This method removes the edge in the node for the
- /// specified call site. Note that this method takes linear time, so it
- /// should be used sparingly.
- void removeCallEdgeFor(CallSite CS);
-
- /// removeAnyCallEdgeTo - This method removes any call edges from this node to
- /// the specified callee function. This takes more time to execute than
- /// removeCallEdgeTo, so it should not be used unless necessary.
- void removeAnyCallEdgeTo(CallGraphNode *Callee);
-
- friend class CallGraph;
-
- // CallGraphNode ctor - Create a node for the specified function.
- inline CallGraphNode(Function *f) : F(f) {}
-};
-
-//===----------------------------------------------------------------------===//
-// GraphTraits specializations for call graphs so that they can be treated as
-// graphs by the generic graph algorithms.
-//
-
-// Provide graph traits for tranversing call graphs using standard graph
-// traversals.
-template <> struct GraphTraits<CallGraphNode*> {
- typedef CallGraphNode NodeType;
-
- typedef std::pair<CallSite, CallGraphNode*> CGNPairTy;
- typedef std::pointer_to_unary_function<CGNPairTy, CallGraphNode*> CGNDerefFun;
-
- static NodeType *getEntryNode(CallGraphNode *CGN) { return CGN; }
-
- typedef mapped_iterator<NodeType::iterator, CGNDerefFun> ChildIteratorType;
-
- static inline ChildIteratorType child_begin(NodeType *N) {
- return map_iterator(N->begin(), CGNDerefFun(CGNDeref));
- }
- static inline ChildIteratorType child_end (NodeType *N) {
- return map_iterator(N->end(), CGNDerefFun(CGNDeref));
- }
-
- static CallGraphNode *CGNDeref(CGNPairTy P) {
- return P.second;
- }
-
-};
-
-template <> struct GraphTraits<const CallGraphNode*> {
- typedef const CallGraphNode NodeType;
- typedef NodeType::const_iterator ChildIteratorType;
-
- static NodeType *getEntryNode(const CallGraphNode *CGN) { return CGN; }
- static inline ChildIteratorType child_begin(NodeType *N) { return N->begin();}
- static inline ChildIteratorType child_end (NodeType *N) { return N->end(); }
-};
-
-template<> struct GraphTraits<CallGraph*> : public GraphTraits<CallGraphNode*> {
- static NodeType *getEntryNode(CallGraph *CGN) {
- return CGN->getExternalCallingNode(); // Start at the external node!
- }
- typedef std::pair<const Function*, CallGraphNode*> PairTy;
- typedef std::pointer_to_unary_function<PairTy, CallGraphNode&> DerefFun;
-
- // nodes_iterator/begin/end - Allow iteration over all nodes in the graph
- typedef mapped_iterator<CallGraph::iterator, DerefFun> nodes_iterator;
- static nodes_iterator nodes_begin(CallGraph *CG) {
- return map_iterator(CG->begin(), DerefFun(CGdereference));
- }
- static nodes_iterator nodes_end (CallGraph *CG) {
- return map_iterator(CG->end(), DerefFun(CGdereference));
- }
-
- static CallGraphNode &CGdereference(PairTy P) {
- return *P.second;
- }
-};
-
-template<> struct GraphTraits<const CallGraph*> :
- public GraphTraits<const CallGraphNode*> {
- static NodeType *getEntryNode(const CallGraph *CGN) {
- return CGN->getExternalCallingNode();
- }
- // nodes_iterator/begin/end - Allow iteration over all nodes in the graph
- typedef CallGraph::const_iterator nodes_iterator;
- static nodes_iterator nodes_begin(const CallGraph *CG) { return CG->begin(); }
- static nodes_iterator nodes_end (const CallGraph *CG) { return CG->end(); }
-};
-
-} // End llvm namespace
-
-// Make sure that any clients of this file link in CallGraph.cpp
-FORCE_DEFINING_FILE_TO_BE_LINKED(CallGraph)
-
-#endif
diff --git a/release_23/include/llvm/Analysis/ConstantFolding.h b/release_23/include/llvm/Analysis/ConstantFolding.h
deleted file mode 100644
index a22913a0b902..000000000000
--- a/release_23/include/llvm/Analysis/ConstantFolding.h
+++ /dev/null
@@ -1,67 +0,0 @@
-//===-- ConstantFolding.h - Analyze constant folding possibilities --------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This family of functions determines the possibility of performing constant
-// folding.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_ANALYSIS_CONSTANTFOLDING_H
-#define LLVM_ANALYSIS_CONSTANTFOLDING_H
-
-namespace llvm {
- class Constant;
- class ConstantExpr;
- class Instruction;
- class TargetData;
- class Function;
- class Type;
-
-/// ConstantFoldInstruction - Attempt to constant fold the specified
-/// instruction. If successful, the constant result is returned, if not, null
-/// is returned. Note that this function can only fail when attempting to fold
-/// instructions like loads and stores, which have no constant expression form.
-///
-Constant *ConstantFoldInstruction(Instruction *I, const TargetData *TD = 0);
-
-/// ConstantFoldInstOperands - Attempt to constant fold an instruction with the
-/// specified operands. If successful, the constant result is returned, if not,
-/// null is returned. Note that this function can fail when attempting to
-/// fold instructions like loads and stores, which have no constant expression
-/// form.
-///
-Constant *ConstantFoldInstOperands(unsigned Opcode, const Type *DestTy,
- Constant*const * Ops, unsigned NumOps,
- const TargetData *TD = 0);
-
-/// ConstantFoldCompareInstOperands - Attempt to constant fold a compare
-/// instruction (icmp/fcmp) with the specified operands. If it fails, it
-/// returns a constant expression of the specified operands.
-///
-Constant *ConstantFoldCompareInstOperands(unsigned Predicate,
- Constant*const * Ops, unsigned NumOps,
- const TargetData *TD = 0);
-
-
-/// ConstantFoldLoadThroughGEPConstantExpr - Given a constant and a
-/// getelementptr constantexpr, return the constant value being addressed by the
-/// constant expression, or null if something is funny and we can't decide.
-Constant *ConstantFoldLoadThroughGEPConstantExpr(Constant *C, ConstantExpr *CE);
-
-/// canConstantFoldCallTo - Return true if its even possible to fold a call to
-/// the specified function.
-bool canConstantFoldCallTo(const Function *F);
-
-/// ConstantFoldCall - Attempt to constant fold a call to the specified function
-/// with the specified arguments, returning null if unsuccessful.
-Constant *
-ConstantFoldCall(Function *F, Constant* const* Operands, unsigned NumOperands);
-}
-
-#endif
diff --git a/release_23/include/llvm/Analysis/ConstantsScanner.h b/release_23/include/llvm/Analysis/ConstantsScanner.h
deleted file mode 100644
index 0be54bbfce55..000000000000
--- a/release_23/include/llvm/Analysis/ConstantsScanner.h
+++ /dev/null
@@ -1,94 +0,0 @@
-//==- llvm/Analysis/ConstantsScanner.h - Iterate over constants -*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This class implements an iterator to walk through the constants referenced by
-// a method. This is used by the Bitcode & Assembly writers to build constant
-// pools.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_ANALYSIS_CONSTANTSSCANNER_H
-#define LLVM_ANALYSIS_CONSTANTSSCANNER_H
-
-#include "llvm/Support/InstIterator.h"
-#include "llvm/Instruction.h"
-#include "llvm/ADT/iterator"
-
-namespace llvm {
-
-class Constant;
-
-class constant_iterator : public forward_iterator<const Constant, ptrdiff_t> {
- const_inst_iterator InstI; // Method instruction iterator
- unsigned OpIdx; // Operand index
-
- typedef constant_iterator _Self;
-
- inline bool isAtConstant() const {
- assert(!InstI.atEnd() && OpIdx < InstI->getNumOperands() &&
- "isAtConstant called with invalid arguments!");
- return isa<Constant>(InstI->getOperand(OpIdx));
- }
-
-public:
- inline constant_iterator(const Function *F) : InstI(inst_begin(F)), OpIdx(0) {
- // Advance to first constant... if we are not already at constant or end
- if (InstI != inst_end(F) && // InstI is valid?
- (InstI->getNumOperands() == 0 || !isAtConstant())) // Not at constant?
- operator++();
- }
-
- inline constant_iterator(const Function *F, bool) // end ctor
- : InstI(inst_end(F)), OpIdx(0) {
- }
-
- inline bool operator==(const _Self& x) const { return OpIdx == x.OpIdx &&
- InstI == x.InstI; }
- inline bool operator!=(const _Self& x) const { return !operator==(x); }
-
- inline pointer operator*() const {
- assert(isAtConstant() && "Dereferenced an iterator at the end!");
- return cast<Constant>(InstI->getOperand(OpIdx));
- }
- inline pointer operator->() const { return operator*(); }
-
- inline _Self& operator++() { // Preincrement implementation
- ++OpIdx;
- do {
- unsigned NumOperands = InstI->getNumOperands();
- while (OpIdx < NumOperands && !isAtConstant()) {
- ++OpIdx;
- }
-
- if (OpIdx < NumOperands) return *this; // Found a constant!
- ++InstI;
- OpIdx = 0;
- } while (!InstI.atEnd());
-
- return *this; // At the end of the method
- }
-
- inline _Self operator++(int) { // Postincrement
- _Self tmp = *this; ++*this; return tmp;
- }
-
- inline bool atEnd() const { return InstI.atEnd(); }
-};
-
-inline constant_iterator constant_begin(const Function *F) {
- return constant_iterator(F);
-}
-
-inline constant_iterator constant_end(const Function *F) {
- return constant_iterator(F, true);
-}
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/Analysis/DominatorInternals.h b/release_23/include/llvm/Analysis/DominatorInternals.h
deleted file mode 100644
index 1564774adaec..000000000000
--- a/release_23/include/llvm/Analysis/DominatorInternals.h
+++ /dev/null
@@ -1,363 +0,0 @@
-//=== llvm/Analysis/DominatorInternals.h - Dominator Calculation -*- C++ -*-==//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_ANALYSIS_DOMINATOR_INTERNALS_H
-#define LLVM_ANALYSIS_DOMINATOR_INTERNALS_H
-
-#include "llvm/Analysis/Dominators.h"
-#include "llvm/ADT/DenseMap.h"
-#include "llvm/ADT/SmallPtrSet.h"
-//===----------------------------------------------------------------------===//
-//
-// DominatorTree construction - This pass constructs immediate dominator
-// information for a flow-graph based on the algorithm described in this
-// document:
-//
-// A Fast Algorithm for Finding Dominators in a Flowgraph
-// T. Lengauer & R. Tarjan, ACM TOPLAS July 1979, pgs 121-141.
-//
-// This implements both the O(n*ack(n)) and the O(n*log(n)) versions of EVAL and
-// LINK, but it turns out that the theoretically slower O(n*log(n))
-// implementation is actually faster than the "efficient" algorithm (even for
-// large CFGs) because the constant overheads are substantially smaller. The
-// lower-complexity version can be enabled with the following #define:
-//
-#define BALANCE_IDOM_TREE 0
-//
-//===----------------------------------------------------------------------===//
-
-namespace llvm {
-
-template<class GraphT>
-unsigned DFSPass(DominatorTreeBase<typename GraphT::NodeType>& DT,
- typename GraphT::NodeType* V, unsigned N) {
- // This is more understandable as a recursive algorithm, but we can't use the
- // recursive algorithm due to stack depth issues. Keep it here for
- // documentation purposes.
-#if 0
- InfoRec &VInfo = DT.Info[DT.Roots[i]];
- VInfo.DFSNum = VInfo.Semi = ++N;
- VInfo.Label = V;
-
- Vertex.push_back(V); // Vertex[n] = V;
- //Info[V].Ancestor = 0; // Ancestor[n] = 0
- //Info[V].Child = 0; // Child[v] = 0
- VInfo.Size = 1; // Size[v] = 1
-
- for (succ_iterator SI = succ_begin(V), E = succ_end(V); SI != E; ++SI) {
- InfoRec &SuccVInfo = DT.Info[*SI];
- if (SuccVInfo.Semi == 0) {
- SuccVInfo.Parent = V;
- N = DTDFSPass(DT, *SI, N);
- }
- }
-#else
- bool IsChilOfArtificialExit = (N != 0);
-
- std::vector<std::pair<typename GraphT::NodeType*,
- typename GraphT::ChildIteratorType> > Worklist;
- Worklist.push_back(std::make_pair(V, GraphT::child_begin(V)));
- while (!Worklist.empty()) {
- typename GraphT::NodeType* BB = Worklist.back().first;
- typename GraphT::ChildIteratorType NextSucc = Worklist.back().second;
-
- typename DominatorTreeBase<typename GraphT::NodeType>::InfoRec &BBInfo =
- DT.Info[BB];
-
- // First time we visited this BB?
- if (NextSucc == GraphT::child_begin(BB)) {
- BBInfo.DFSNum = BBInfo.Semi = ++N;
- BBInfo.Label = BB;
-
- DT.Vertex.push_back(BB); // Vertex[n] = V;
- //BBInfo[V].Ancestor = 0; // Ancestor[n] = 0
- //BBInfo[V].Child = 0; // Child[v] = 0
- BBInfo.Size = 1; // Size[v] = 1
-
- if (IsChilOfArtificialExit)
- BBInfo.Parent = 1;
-
- IsChilOfArtificialExit = false;
- }
-
- // store the DFS number of the current BB - the reference to BBInfo might
- // get invalidated when processing the successors.
- unsigned BBDFSNum = BBInfo.DFSNum;
-
- // If we are done with this block, remove it from the worklist.
- if (NextSucc == GraphT::child_end(BB)) {
- Worklist.pop_back();
- continue;
- }
-
- // Increment the successor number for the next time we get to it.
- ++Worklist.back().second;
-
- // Visit the successor next, if it isn't already visited.
- typename GraphT::NodeType* Succ = *NextSucc;
-
- typename DominatorTreeBase<typename GraphT::NodeType>::InfoRec &SuccVInfo =
- DT.Info[Succ];
- if (SuccVInfo.Semi == 0) {
- SuccVInfo.Parent = BBDFSNum;
- Worklist.push_back(std::make_pair(Succ, GraphT::child_begin(Succ)));
- }
- }
-#endif
- return N;
-}
-
-template<class GraphT>
-void Compress(DominatorTreeBase<typename GraphT::NodeType>& DT,
- typename GraphT::NodeType *VIn) {
- std::vector<typename GraphT::NodeType*> Work;
- SmallPtrSet<typename GraphT::NodeType*, 32> Visited;
- typename DominatorTreeBase<typename GraphT::NodeType>::InfoRec &VInVAInfo =
- DT.Info[DT.Vertex[DT.Info[VIn].Ancestor]];
-
- if (VInVAInfo.Ancestor != 0)
- Work.push_back(VIn);
-
- while (!Work.empty()) {
- typename GraphT::NodeType* V = Work.back();
- typename DominatorTreeBase<typename GraphT::NodeType>::InfoRec &VInfo =
- DT.Info[V];
- typename GraphT::NodeType* VAncestor = DT.Vertex[VInfo.Ancestor];
- typename DominatorTreeBase<typename GraphT::NodeType>::InfoRec &VAInfo =
- DT.Info[VAncestor];
-
- // Process Ancestor first
- if (Visited.insert(VAncestor) &&
- VAInfo.Ancestor != 0) {
- Work.push_back(VAncestor);
- continue;
- }
- Work.pop_back();
-
- // Update VInfo based on Ancestor info
- if (VAInfo.Ancestor == 0)
- continue;
- typename GraphT::NodeType* VAncestorLabel = VAInfo.Label;
- typename GraphT::NodeType* VLabel = VInfo.Label;
- if (DT.Info[VAncestorLabel].Semi < DT.Info[VLabel].Semi)
- VInfo.Label = VAncestorLabel;
- VInfo.Ancestor = VAInfo.Ancestor;
- }
-}
-
-template<class GraphT>
-typename GraphT::NodeType* Eval(DominatorTreeBase<typename GraphT::NodeType>& DT,
- typename GraphT::NodeType *V) {
- typename DominatorTreeBase<typename GraphT::NodeType>::InfoRec &VInfo =
- DT.Info[V];
-#if !BALANCE_IDOM_TREE
- // Higher-complexity but faster implementation
- if (VInfo.Ancestor == 0)
- return V;
- Compress<GraphT>(DT, V);
- return VInfo.Label;
-#else
- // Lower-complexity but slower implementation
- if (VInfo.Ancestor == 0)
- return VInfo.Label;
- Compress<GraphT>(DT, V);
- GraphT::NodeType* VLabel = VInfo.Label;
-
- GraphT::NodeType* VAncestorLabel = DT.Info[VInfo.Ancestor].Label;
- if (DT.Info[VAncestorLabel].Semi >= DT.Info[VLabel].Semi)
- return VLabel;
- else
- return VAncestorLabel;
-#endif
-}
-
-template<class GraphT>
-void Link(DominatorTreeBase<typename GraphT::NodeType>& DT,
- unsigned DFSNumV, typename GraphT::NodeType* W,
- typename DominatorTreeBase<typename GraphT::NodeType>::InfoRec &WInfo) {
-#if !BALANCE_IDOM_TREE
- // Higher-complexity but faster implementation
- WInfo.Ancestor = DFSNumV;
-#else
- // Lower-complexity but slower implementation
- GraphT::NodeType* WLabel = WInfo.Label;
- unsigned WLabelSemi = DT.Info[WLabel].Semi;
- GraphT::NodeType* S = W;
- InfoRec *SInfo = &DT.Info[S];
-
- GraphT::NodeType* SChild = SInfo->Child;
- InfoRec *SChildInfo = &DT.Info[SChild];
-
- while (WLabelSemi < DT.Info[SChildInfo->Label].Semi) {
- GraphT::NodeType* SChildChild = SChildInfo->Child;
- if (SInfo->Size+DT.Info[SChildChild].Size >= 2*SChildInfo->Size) {
- SChildInfo->Ancestor = S;
- SInfo->Child = SChild = SChildChild;
- SChildInfo = &DT.Info[SChild];
- } else {
- SChildInfo->Size = SInfo->Size;
- S = SInfo->Ancestor = SChild;
- SInfo = SChildInfo;
- SChild = SChildChild;
- SChildInfo = &DT.Info[SChild];
- }
- }
-
- DominatorTreeBase::InfoRec &VInfo = DT.Info[V];
- SInfo->Label = WLabel;
-
- assert(V != W && "The optimization here will not work in this case!");
- unsigned WSize = WInfo.Size;
- unsigned VSize = (VInfo.Size += WSize);
-
- if (VSize < 2*WSize)
- std::swap(S, VInfo.Child);
-
- while (S) {
- SInfo = &DT.Info[S];
- SInfo->Ancestor = V;
- S = SInfo->Child;
- }
-#endif
-}
-
-template<class FuncT, class NodeT>
-void Calculate(DominatorTreeBase<typename GraphTraits<NodeT>::NodeType>& DT,
- FuncT& F) {
- typedef GraphTraits<NodeT> GraphT;
-
- unsigned N = 0;
- bool MultipleRoots = (DT.Roots.size() > 1);
- if (MultipleRoots) {
- typename DominatorTreeBase<typename GraphT::NodeType>::InfoRec &BBInfo =
- DT.Info[NULL];
- BBInfo.DFSNum = BBInfo.Semi = ++N;
- BBInfo.Label = NULL;
-
- DT.Vertex.push_back(NULL); // Vertex[n] = V;
- //BBInfo[V].Ancestor = 0; // Ancestor[n] = 0
- //BBInfo[V].Child = 0; // Child[v] = 0
- BBInfo.Size = 1; // Size[v] = 1
- }
-
- // Step #1: Number blocks in depth-first order and initialize variables used
- // in later stages of the algorithm.
- for (unsigned i = 0, e = static_cast<unsigned>(DT.Roots.size());
- i != e; ++i)
- N = DFSPass<GraphT>(DT, DT.Roots[i], N);
-
- // it might be that some blocks did not get a DFS number (e.g., blocks of
- // infinite loops). In these cases an artificial exit node is required.
- MultipleRoots |= (DT.isPostDominator() && N != F.size());
-
- for (unsigned i = N; i >= 2; --i) {
- typename GraphT::NodeType* W = DT.Vertex[i];
- typename DominatorTreeBase<typename GraphT::NodeType>::InfoRec &WInfo =
- DT.Info[W];
-
- // Step #2: Calculate the semidominators of all vertices
- bool HasChildOutsideDFS = false;
-
- // initialize the semi dominator to point to the parent node
- WInfo.Semi = WInfo.Parent;
- for (typename GraphTraits<Inverse<NodeT> >::ChildIteratorType CI =
- GraphTraits<Inverse<NodeT> >::child_begin(W),
- E = GraphTraits<Inverse<NodeT> >::child_end(W); CI != E; ++CI) {
- if (DT.Info.count(*CI)) { // Only if this predecessor is reachable!
- unsigned SemiU = DT.Info[Eval<GraphT>(DT, *CI)].Semi;
- if (SemiU < WInfo.Semi)
- WInfo.Semi = SemiU;
- }
- else {
- // if the child has no DFS number it is not post-dominated by any exit,
- // and so is the current block.
- HasChildOutsideDFS = true;
- }
- }
-
- // if some child has no DFS number it is not post-dominated by any exit,
- // and so is the current block.
- if (DT.isPostDominator() && HasChildOutsideDFS)
- WInfo.Semi = 0;
-
- DT.Info[DT.Vertex[WInfo.Semi]].Bucket.push_back(W);
-
- typename GraphT::NodeType* WParent = DT.Vertex[WInfo.Parent];
- Link<GraphT>(DT, WInfo.Parent, W, WInfo);
-
- // Step #3: Implicitly define the immediate dominator of vertices
- std::vector<typename GraphT::NodeType*> &WParentBucket =
- DT.Info[WParent].Bucket;
- while (!WParentBucket.empty()) {
- typename GraphT::NodeType* V = WParentBucket.back();
- WParentBucket.pop_back();
- typename GraphT::NodeType* U = Eval<GraphT>(DT, V);
- DT.IDoms[V] = DT.Info[U].Semi < DT.Info[V].Semi ? U : WParent;
- }
- }
-
- // Step #4: Explicitly define the immediate dominator of each vertex
- for (unsigned i = 2; i <= N; ++i) {
- typename GraphT::NodeType* W = DT.Vertex[i];
- typename GraphT::NodeType*& WIDom = DT.IDoms[W];
- if (WIDom != DT.Vertex[DT.Info[W].Semi])
- WIDom = DT.IDoms[WIDom];
- }
-
- if (DT.Roots.empty()) return;
-
- // Add a node for the root. This node might be the actual root, if there is
- // one exit block, or it may be the virtual exit (denoted by (BasicBlock *)0)
- // which postdominates all real exits if there are multiple exit blocks, or
- // an infinite loop.
- typename GraphT::NodeType* Root = !MultipleRoots ? DT.Roots[0] : 0;
-
- DT.DomTreeNodes[Root] = DT.RootNode =
- new DomTreeNodeBase<typename GraphT::NodeType>(Root, 0);
-
- // Loop over all of the reachable blocks in the function...
- for (unsigned i = 2; i <= N; ++i) {
- typename GraphT::NodeType* W = DT.Vertex[i];
-
- DomTreeNodeBase<typename GraphT::NodeType> *BBNode = DT.DomTreeNodes[W];
- if (BBNode) continue; // Haven't calculated this node yet?
-
- typename GraphT::NodeType* ImmDom = DT.getIDom(W);
-
- assert(ImmDom || DT.DomTreeNodes[NULL]);
-
- // Get or calculate the node for the immediate dominator
- DomTreeNodeBase<typename GraphT::NodeType> *IDomNode =
- DT.getNodeForBlock(ImmDom);
-
- // Add a new tree node for this BasicBlock, and link it as a child of
- // IDomNode
- DomTreeNodeBase<typename GraphT::NodeType> *C =
- new DomTreeNodeBase<typename GraphT::NodeType>(W, IDomNode);
- DT.DomTreeNodes[W] = IDomNode->addChild(C);
- }
-
- // Free temporary memory used to construct idom's
- DT.IDoms.clear();
- DT.Info.clear();
- std::vector<typename GraphT::NodeType*>().swap(DT.Vertex);
-
- // FIXME: This does not work on PostDomTrees. It seems likely that this is
- // due to an error in the algorithm for post-dominators. This really should
- // be investigated and fixed at some point.
- // DT.updateDFSNumbers();
-
- // Start out with the DFS numbers being invalid. Let them be computed if
- // demanded.
- DT.DFSInfoValid = false;
-}
-
-}
-
-#endif
diff --git a/release_23/include/llvm/Analysis/Dominators.h b/release_23/include/llvm/Analysis/Dominators.h
deleted file mode 100644
index 6ce3260b8f52..000000000000
--- a/release_23/include/llvm/Analysis/Dominators.h
+++ /dev/null
@@ -1,966 +0,0 @@
-//===- llvm/Analysis/Dominators.h - Dominator Info Calculation --*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines the following classes:
-// 1. DominatorTree: Represent dominators as an explicit tree structure.
-// 2. DominanceFrontier: Calculate and hold the dominance frontier for a
-// function.
-//
-// These data structures are listed in increasing order of complexity. It
-// takes longer to calculate the dominator frontier, for example, than the
-// DominatorTree mapping.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_ANALYSIS_DOMINATORS_H
-#define LLVM_ANALYSIS_DOMINATORS_H
-
-#include "llvm/Pass.h"
-#include "llvm/BasicBlock.h"
-#include "llvm/Function.h"
-#include "llvm/Instruction.h"
-#include "llvm/Instructions.h"
-#include "llvm/ADT/DenseMap.h"
-#include "llvm/ADT/GraphTraits.h"
-#include "llvm/ADT/SmallPtrSet.h"
-#include "llvm/ADT/SmallVector.h"
-#include "llvm/Assembly/Writer.h"
-#include "llvm/Support/CFG.h"
-#include "llvm/Support/Compiler.h"
-#include <algorithm>
-#include <map>
-#include <set>
-
-namespace llvm {
-
-//===----------------------------------------------------------------------===//
-/// DominatorBase - Base class that other, more interesting dominator analyses
-/// inherit from.
-///
-template <class NodeT>
-class DominatorBase {
-protected:
- std::vector<NodeT*> Roots;
- const bool IsPostDominators;
- inline explicit DominatorBase(bool isPostDom) :
- Roots(), IsPostDominators(isPostDom) {}
-public:
-
- /// getRoots - Return the root blocks of the current CFG. This may include
- /// multiple blocks if we are computing post dominators. For forward
- /// dominators, this will always be a single block (the entry node).
- ///
- inline const std::vector<NodeT*> &getRoots() const { return Roots; }
-
- /// isPostDominator - Returns true if analysis based of postdoms
- ///
- bool isPostDominator() const { return IsPostDominators; }
-};
-
-
-//===----------------------------------------------------------------------===//
-// DomTreeNode - Dominator Tree Node
-template<class NodeT> class DominatorTreeBase;
-struct PostDominatorTree;
-class MachineBasicBlock;
-
-template <class NodeT>
-class DomTreeNodeBase {
- NodeT *TheBB;
- DomTreeNodeBase<NodeT> *IDom;
- std::vector<DomTreeNodeBase<NodeT> *> Children;
- int DFSNumIn, DFSNumOut;
-
- template<class N> friend class DominatorTreeBase;
- friend struct PostDominatorTree;
-public:
- typedef typename std::vector<DomTreeNodeBase<NodeT> *>::iterator iterator;
- typedef typename std::vector<DomTreeNodeBase<NodeT> *>::const_iterator
- const_iterator;
-
- iterator begin() { return Children.begin(); }
- iterator end() { return Children.end(); }
- const_iterator begin() const { return Children.begin(); }
- const_iterator end() const { return Children.end(); }
-
- NodeT *getBlock() const { return TheBB; }
- DomTreeNodeBase<NodeT> *getIDom() const { return IDom; }
- const std::vector<DomTreeNodeBase<NodeT>*> &getChildren() const {
- return Children;
- }
-
- DomTreeNodeBase(NodeT *BB, DomTreeNodeBase<NodeT> *iDom)
- : TheBB(BB), IDom(iDom), DFSNumIn(-1), DFSNumOut(-1) { }
-
- DomTreeNodeBase<NodeT> *addChild(DomTreeNodeBase<NodeT> *C) {
- Children.push_back(C);
- return C;
- }
-
- size_t getNumChildren() const {
- return Children.size();
- }
-
- void setIDom(DomTreeNodeBase<NodeT> *NewIDom) {
- assert(IDom && "No immediate dominator?");
- if (IDom != NewIDom) {
- typename std::vector<DomTreeNodeBase<NodeT>*>::iterator I =
- std::find(IDom->Children.begin(), IDom->Children.end(), this);
- assert(I != IDom->Children.end() &&
- "Not in immediate dominator children set!");
- // I am no longer your child...
- IDom->Children.erase(I);
-
- // Switch to new dominator
- IDom = NewIDom;
- IDom->Children.push_back(this);
- }
- }
-
- /// getDFSNumIn/getDFSNumOut - These are an internal implementation detail, do
- /// not call them.
- unsigned getDFSNumIn() const { return DFSNumIn; }
- unsigned getDFSNumOut() const { return DFSNumOut; }
-private:
- // Return true if this node is dominated by other. Use this only if DFS info
- // is valid.
- bool DominatedBy(const DomTreeNodeBase<NodeT> *other) const {
- return this->DFSNumIn >= other->DFSNumIn &&
- this->DFSNumOut <= other->DFSNumOut;
- }
-};
-
-EXTERN_TEMPLATE_INSTANTIATION(class DomTreeNodeBase<BasicBlock>);
-EXTERN_TEMPLATE_INSTANTIATION(class DomTreeNodeBase<MachineBasicBlock>);
-
-template<class NodeT>
-static std::ostream &operator<<(std::ostream &o,
- const DomTreeNodeBase<NodeT> *Node) {
- if (Node->getBlock())
- WriteAsOperand(o, Node->getBlock(), false);
- else
- o << " <<exit node>>";
-
- o << " {" << Node->getDFSNumIn() << "," << Node->getDFSNumOut() << "}";
-
- return o << "\n";
-}
-
-template<class NodeT>
-static void PrintDomTree(const DomTreeNodeBase<NodeT> *N, std::ostream &o,
- unsigned Lev) {
- o << std::string(2*Lev, ' ') << "[" << Lev << "] " << N;
- for (typename DomTreeNodeBase<NodeT>::const_iterator I = N->begin(),
- E = N->end(); I != E; ++I)
- PrintDomTree<NodeT>(*I, o, Lev+1);
-}
-
-typedef DomTreeNodeBase<BasicBlock> DomTreeNode;
-
-//===----------------------------------------------------------------------===//
-/// DominatorTree - Calculate the immediate dominator tree for a function.
-///
-
-template<class FuncT, class N>
-void Calculate(DominatorTreeBase<typename GraphTraits<N>::NodeType>& DT,
- FuncT& F);
-
-template<class NodeT>
-class DominatorTreeBase : public DominatorBase<NodeT> {
-protected:
- typedef DenseMap<NodeT*, DomTreeNodeBase<NodeT>*> DomTreeNodeMapType;
- DomTreeNodeMapType DomTreeNodes;
- DomTreeNodeBase<NodeT> *RootNode;
-
- bool DFSInfoValid;
- unsigned int SlowQueries;
- // Information record used during immediate dominators computation.
- struct InfoRec {
- unsigned DFSNum;
- unsigned Semi;
- unsigned Size;
- NodeT *Label, *Child;
- unsigned Parent, Ancestor;
-
- std::vector<NodeT*> Bucket;
-
- InfoRec() : DFSNum(0), Semi(0), Size(0), Label(0), Child(0), Parent(0),
- Ancestor(0) {}
- };
-
- DenseMap<NodeT*, NodeT*> IDoms;
-
- // Vertex - Map the DFS number to the BasicBlock*
- std::vector<NodeT*> Vertex;
-
- // Info - Collection of information used during the computation of idoms.
- DenseMap<NodeT*, InfoRec> Info;
-
- void reset() {
- for (typename DomTreeNodeMapType::iterator I = this->DomTreeNodes.begin(),
- E = DomTreeNodes.end(); I != E; ++I)
- delete I->second;
- DomTreeNodes.clear();
- IDoms.clear();
- this->Roots.clear();
- Vertex.clear();
- RootNode = 0;
- }
-
- // NewBB is split and now it has one successor. Update dominator tree to
- // reflect this change.
- template<class N, class GraphT>
- void Split(DominatorTreeBase<typename GraphT::NodeType>& DT,
- typename GraphT::NodeType* NewBB) {
- assert(std::distance(GraphT::child_begin(NewBB), GraphT::child_end(NewBB)) == 1
- && "NewBB should have a single successor!");
- typename GraphT::NodeType* NewBBSucc = *GraphT::child_begin(NewBB);
-
- std::vector<typename GraphT::NodeType*> PredBlocks;
- for (typename GraphTraits<Inverse<N> >::ChildIteratorType PI =
- GraphTraits<Inverse<N> >::child_begin(NewBB),
- PE = GraphTraits<Inverse<N> >::child_end(NewBB); PI != PE; ++PI)
- PredBlocks.push_back(*PI);
-
- assert(!PredBlocks.empty() && "No predblocks??");
-
- // The newly inserted basic block will dominate existing basic blocks iff the
- // PredBlocks dominate all of the non-pred blocks. If all predblocks dominate
- // the non-pred blocks, then they all must be the same block!
- //
- bool NewBBDominatesNewBBSucc = true;
- {
- typename GraphT::NodeType* OnePred = PredBlocks[0];
- size_t i = 1, e = PredBlocks.size();
- for (i = 1; !DT.isReachableFromEntry(OnePred); ++i) {
- assert(i != e && "Didn't find reachable pred?");
- OnePred = PredBlocks[i];
- }
-
- for (; i != e; ++i)
- if (PredBlocks[i] != OnePred && DT.isReachableFromEntry(OnePred)) {
- NewBBDominatesNewBBSucc = false;
- break;
- }
-
- if (NewBBDominatesNewBBSucc)
- for (typename GraphTraits<Inverse<N> >::ChildIteratorType PI =
- GraphTraits<Inverse<N> >::child_begin(NewBBSucc),
- E = GraphTraits<Inverse<N> >::child_end(NewBBSucc); PI != E; ++PI)
- if (*PI != NewBB && !DT.dominates(NewBBSucc, *PI)) {
- NewBBDominatesNewBBSucc = false;
- break;
- }
- }
-
- // The other scenario where the new block can dominate its successors are when
- // all predecessors of NewBBSucc that are not NewBB are dominated by NewBBSucc
- // already.
- if (!NewBBDominatesNewBBSucc) {
- NewBBDominatesNewBBSucc = true;
- for (typename GraphTraits<Inverse<N> >::ChildIteratorType PI =
- GraphTraits<Inverse<N> >::child_begin(NewBBSucc),
- E = GraphTraits<Inverse<N> >::child_end(NewBBSucc); PI != E; ++PI)
- if (*PI != NewBB && !DT.dominates(NewBBSucc, *PI)) {
- NewBBDominatesNewBBSucc = false;
- break;
- }
- }
-
- // Find NewBB's immediate dominator and create new dominator tree node for
- // NewBB.
- NodeT *NewBBIDom = 0;
- unsigned i = 0;
- for (i = 0; i < PredBlocks.size(); ++i)
- if (DT.isReachableFromEntry(PredBlocks[i])) {
- NewBBIDom = PredBlocks[i];
- break;
- }
- assert(i != PredBlocks.size() && "No reachable preds?");
- for (i = i + 1; i < PredBlocks.size(); ++i) {
- if (DT.isReachableFromEntry(PredBlocks[i]))
- NewBBIDom = DT.findNearestCommonDominator(NewBBIDom, PredBlocks[i]);
- }
- assert(NewBBIDom && "No immediate dominator found??");
-
- // Create the new dominator tree node... and set the idom of NewBB.
- DomTreeNodeBase<NodeT> *NewBBNode = DT.addNewBlock(NewBB, NewBBIDom);
-
- // If NewBB strictly dominates other blocks, then it is now the immediate
- // dominator of NewBBSucc. Update the dominator tree as appropriate.
- if (NewBBDominatesNewBBSucc) {
- DomTreeNodeBase<NodeT> *NewBBSuccNode = DT.getNode(NewBBSucc);
- DT.changeImmediateDominator(NewBBSuccNode, NewBBNode);
- }
- }
-
-public:
- explicit DominatorTreeBase(bool isPostDom)
- : DominatorBase<NodeT>(isPostDom), DFSInfoValid(false), SlowQueries(0) {}
- virtual ~DominatorTreeBase() { reset(); }
-
- // FIXME: Should remove this
- virtual bool runOnFunction(Function &F) { return false; }
-
- virtual void releaseMemory() { reset(); }
-
- /// getNode - return the (Post)DominatorTree node for the specified basic
- /// block. This is the same as using operator[] on this class.
- ///
- inline DomTreeNodeBase<NodeT> *getNode(NodeT *BB) const {
- typename DomTreeNodeMapType::const_iterator I = DomTreeNodes.find(BB);
- return I != DomTreeNodes.end() ? I->second : 0;
- }
-
- /// getRootNode - This returns the entry node for the CFG of the function. If
- /// this tree represents the post-dominance relations for a function, however,
- /// this root may be a node with the block == NULL. This is the case when
- /// there are multiple exit nodes from a particular function. Consumers of
- /// post-dominance information must be capable of dealing with this
- /// possibility.
- ///
- DomTreeNodeBase<NodeT> *getRootNode() { return RootNode; }
- const DomTreeNodeBase<NodeT> *getRootNode() const { return RootNode; }
-
- /// properlyDominates - Returns true iff this dominates N and this != N.
- /// Note that this is not a constant time operation!
- ///
- bool properlyDominates(const DomTreeNodeBase<NodeT> *A,
- DomTreeNodeBase<NodeT> *B) const {
- if (A == 0 || B == 0) return false;
- return dominatedBySlowTreeWalk(A, B);
- }
-
- inline bool properlyDominates(NodeT *A, NodeT *B) {
- return properlyDominates(getNode(A), getNode(B));
- }
-
- bool dominatedBySlowTreeWalk(const DomTreeNodeBase<NodeT> *A,
- const DomTreeNodeBase<NodeT> *B) const {
- const DomTreeNodeBase<NodeT> *IDom;
- if (A == 0 || B == 0) return false;
- while ((IDom = B->getIDom()) != 0 && IDom != A && IDom != B)
- B = IDom; // Walk up the tree
- return IDom != 0;
- }
-
-
- /// isReachableFromEntry - Return true if A is dominated by the entry
- /// block of the function containing it.
- bool isReachableFromEntry(NodeT* A) {
- assert (!this->isPostDominator()
- && "This is not implemented for post dominators");
- return dominates(&A->getParent()->front(), A);
- }
-
- /// dominates - Returns true iff A dominates B. Note that this is not a
- /// constant time operation!
- ///
- inline bool dominates(const DomTreeNodeBase<NodeT> *A,
- DomTreeNodeBase<NodeT> *B) {
- if (B == A)
- return true; // A node trivially dominates itself.
-
- if (A == 0 || B == 0)
- return false;
-
- if (DFSInfoValid)
- return B->DominatedBy(A);
-
- // If we end up with too many slow queries, just update the
- // DFS numbers on the theory that we are going to keep querying.
- SlowQueries++;
- if (SlowQueries > 32) {
- updateDFSNumbers();
- return B->DominatedBy(A);
- }
-
- return dominatedBySlowTreeWalk(A, B);
- }
-
- inline bool dominates(NodeT *A, NodeT *B) {
- if (A == B)
- return true;
-
- return dominates(getNode(A), getNode(B));
- }
-
- NodeT *getRoot() const {
- assert(this->Roots.size() == 1 && "Should always have entry node!");
- return this->Roots[0];
- }
-
- /// findNearestCommonDominator - Find nearest common dominator basic block
- /// for basic block A and B. If there is no such block then return NULL.
- NodeT *findNearestCommonDominator(NodeT *A, NodeT *B) {
-
- assert (!this->isPostDominator()
- && "This is not implemented for post dominators");
- assert (A->getParent() == B->getParent()
- && "Two blocks are not in same function");
-
- // If either A or B is a entry block then it is nearest common dominator.
- NodeT &Entry = A->getParent()->front();
- if (A == &Entry || B == &Entry)
- return &Entry;
-
- // If B dominates A then B is nearest common dominator.
- if (dominates(B, A))
- return B;
-
- // If A dominates B then A is nearest common dominator.
- if (dominates(A, B))
- return A;
-
- DomTreeNodeBase<NodeT> *NodeA = getNode(A);
- DomTreeNodeBase<NodeT> *NodeB = getNode(B);
-
- // Collect NodeA dominators set.
- SmallPtrSet<DomTreeNodeBase<NodeT>*, 16> NodeADoms;
- NodeADoms.insert(NodeA);
- DomTreeNodeBase<NodeT> *IDomA = NodeA->getIDom();
- while (IDomA) {
- NodeADoms.insert(IDomA);
- IDomA = IDomA->getIDom();
- }
-
- // Walk NodeB immediate dominators chain and find common dominator node.
- DomTreeNodeBase<NodeT> *IDomB = NodeB->getIDom();
- while(IDomB) {
- if (NodeADoms.count(IDomB) != 0)
- return IDomB->getBlock();
-
- IDomB = IDomB->getIDom();
- }
-
- return NULL;
- }
-
- //===--------------------------------------------------------------------===//
- // API to update (Post)DominatorTree information based on modifications to
- // the CFG...
-
- /// addNewBlock - Add a new node to the dominator tree information. This
- /// creates a new node as a child of DomBB dominator node,linking it into
- /// the children list of the immediate dominator.
- DomTreeNodeBase<NodeT> *addNewBlock(NodeT *BB, NodeT *DomBB) {
- assert(getNode(BB) == 0 && "Block already in dominator tree!");
- DomTreeNodeBase<NodeT> *IDomNode = getNode(DomBB);
- assert(IDomNode && "Not immediate dominator specified for block!");
- DFSInfoValid = false;
- return DomTreeNodes[BB] =
- IDomNode->addChild(new DomTreeNodeBase<NodeT>(BB, IDomNode));
- }
-
- /// changeImmediateDominator - This method is used to update the dominator
- /// tree information when a node's immediate dominator changes.
- ///
- void changeImmediateDominator(DomTreeNodeBase<NodeT> *N,
- DomTreeNodeBase<NodeT> *NewIDom) {
- assert(N && NewIDom && "Cannot change null node pointers!");
- DFSInfoValid = false;
- N->setIDom(NewIDom);
- }
-
- void changeImmediateDominator(NodeT *BB, NodeT *NewBB) {
- changeImmediateDominator(getNode(BB), getNode(NewBB));
- }
-
- /// eraseNode - Removes a node from the dominator tree. Block must not
- /// domiante any other blocks. Removes node from its immediate dominator's
- /// children list. Deletes dominator node associated with basic block BB.
- void eraseNode(NodeT *BB) {
- DomTreeNodeBase<NodeT> *Node = getNode(BB);
- assert (Node && "Removing node that isn't in dominator tree.");
- assert (Node->getChildren().empty() && "Node is not a leaf node.");
-
- // Remove node from immediate dominator's children list.
- DomTreeNodeBase<NodeT> *IDom = Node->getIDom();
- if (IDom) {
- typename std::vector<DomTreeNodeBase<NodeT>*>::iterator I =
- std::find(IDom->Children.begin(), IDom->Children.end(), Node);
- assert(I != IDom->Children.end() &&
- "Not in immediate dominator children set!");
- // I am no longer your child...
- IDom->Children.erase(I);
- }
-
- DomTreeNodes.erase(BB);
- delete Node;
- }
-
- /// removeNode - Removes a node from the dominator tree. Block must not
- /// dominate any other blocks. Invalidates any node pointing to removed
- /// block.
- void removeNode(NodeT *BB) {
- assert(getNode(BB) && "Removing node that isn't in dominator tree.");
- DomTreeNodes.erase(BB);
- }
-
- /// splitBlock - BB is split and now it has one successor. Update dominator
- /// tree to reflect this change.
- void splitBlock(NodeT* NewBB) {
- if (this->IsPostDominators)
- this->Split<Inverse<NodeT*>, GraphTraits<Inverse<NodeT*> > >(*this, NewBB);
- else
- this->Split<NodeT*, GraphTraits<NodeT*> >(*this, NewBB);
- }
-
- /// print - Convert to human readable form
- ///
- virtual void print(std::ostream &o, const Module* ) const {
- o << "=============================--------------------------------\n";
- if (this->isPostDominator())
- o << "Inorder PostDominator Tree: ";
- else
- o << "Inorder Dominator Tree: ";
- if (this->DFSInfoValid)
- o << "DFSNumbers invalid: " << SlowQueries << " slow queries.";
- o << "\n";
-
- PrintDomTree<NodeT>(getRootNode(), o, 1);
- }
-
- void print(std::ostream *OS, const Module* M = 0) const {
- if (OS) print(*OS, M);
- }
-
- virtual void dump() {
- print(llvm::cerr);
- }
-
-protected:
- template<class GraphT>
- friend void Compress(DominatorTreeBase<typename GraphT::NodeType>& DT,
- typename GraphT::NodeType* VIn);
-
- template<class GraphT>
- friend typename GraphT::NodeType* Eval(
- DominatorTreeBase<typename GraphT::NodeType>& DT,
- typename GraphT::NodeType* V);
-
- template<class GraphT>
- friend void Link(DominatorTreeBase<typename GraphT::NodeType>& DT,
- unsigned DFSNumV, typename GraphT::NodeType* W,
- typename DominatorTreeBase<typename GraphT::NodeType>::InfoRec &WInfo);
-
- template<class GraphT>
- friend unsigned DFSPass(DominatorTreeBase<typename GraphT::NodeType>& DT,
- typename GraphT::NodeType* V,
- unsigned N);
-
- template<class FuncT, class N>
- friend void Calculate(DominatorTreeBase<typename GraphTraits<N>::NodeType>& DT,
- FuncT& F);
-
- /// updateDFSNumbers - Assign In and Out numbers to the nodes while walking
- /// dominator tree in dfs order.
- void updateDFSNumbers() {
- unsigned DFSNum = 0;
-
- SmallVector<std::pair<DomTreeNodeBase<NodeT>*,
- typename DomTreeNodeBase<NodeT>::iterator>, 32> WorkStack;
-
- for (unsigned i = 0, e = (unsigned)this->Roots.size(); i != e; ++i) {
- DomTreeNodeBase<NodeT> *ThisRoot = getNode(this->Roots[i]);
- WorkStack.push_back(std::make_pair(ThisRoot, ThisRoot->begin()));
- ThisRoot->DFSNumIn = DFSNum++;
-
- while (!WorkStack.empty()) {
- DomTreeNodeBase<NodeT> *Node = WorkStack.back().first;
- typename DomTreeNodeBase<NodeT>::iterator ChildIt =
- WorkStack.back().second;
-
- // If we visited all of the children of this node, "recurse" back up the
- // stack setting the DFOutNum.
- if (ChildIt == Node->end()) {
- Node->DFSNumOut = DFSNum++;
- WorkStack.pop_back();
- } else {
- // Otherwise, recursively visit this child.
- DomTreeNodeBase<NodeT> *Child = *ChildIt;
- ++WorkStack.back().second;
-
- WorkStack.push_back(std::make_pair(Child, Child->begin()));
- Child->DFSNumIn = DFSNum++;
- }
- }
- }
-
- SlowQueries = 0;
- DFSInfoValid = true;
- }
-
- DomTreeNodeBase<NodeT> *getNodeForBlock(NodeT *BB) {
- if (DomTreeNodeBase<NodeT> *BBNode = this->DomTreeNodes[BB])
- return BBNode;
-
- // Haven't calculated this node yet? Get or calculate the node for the
- // immediate dominator.
- NodeT *IDom = getIDom(BB);
-
- assert(IDom || this->DomTreeNodes[NULL]);
- DomTreeNodeBase<NodeT> *IDomNode = getNodeForBlock(IDom);
-
- // Add a new tree node for this BasicBlock, and link it as a child of
- // IDomNode
- DomTreeNodeBase<NodeT> *C = new DomTreeNodeBase<NodeT>(BB, IDomNode);
- return this->DomTreeNodes[BB] = IDomNode->addChild(C);
- }
-
- inline NodeT *getIDom(NodeT *BB) const {
- typename DenseMap<NodeT*, NodeT*>::const_iterator I = IDoms.find(BB);
- return I != IDoms.end() ? I->second : 0;
- }
-
- inline void addRoot(NodeT* BB) {
- this->Roots.push_back(BB);
- }
-
-public:
- /// recalculate - compute a dominator tree for the given function
- template<class FT>
- void recalculate(FT& F) {
- if (!this->IsPostDominators) {
- reset();
-
- // Initialize roots
- this->Roots.push_back(&F.front());
- this->IDoms[&F.front()] = 0;
- this->DomTreeNodes[&F.front()] = 0;
- this->Vertex.push_back(0);
-
- Calculate<FT, NodeT*>(*this, F);
-
- updateDFSNumbers();
- } else {
- reset(); // Reset from the last time we were run...
-
- // Initialize the roots list
- for (typename FT::iterator I = F.begin(), E = F.end(); I != E; ++I) {
- if (std::distance(GraphTraits<FT*>::child_begin(I),
- GraphTraits<FT*>::child_end(I)) == 0)
- addRoot(I);
-
- // Prepopulate maps so that we don't get iterator invalidation issues later.
- this->IDoms[I] = 0;
- this->DomTreeNodes[I] = 0;
- }
-
- this->Vertex.push_back(0);
-
- Calculate<FT, Inverse<NodeT*> >(*this, F);
- }
- }
-};
-
-EXTERN_TEMPLATE_INSTANTIATION(class DominatorTreeBase<BasicBlock>);
-
-//===-------------------------------------
-/// DominatorTree Class - Concrete subclass of DominatorTreeBase that is used to
-/// compute a normal dominator tree.
-///
-class DominatorTree : public FunctionPass {
-public:
- static char ID; // Pass ID, replacement for typeid
- DominatorTreeBase<BasicBlock>* DT;
-
- DominatorTree() : FunctionPass(intptr_t(&ID)) {
- DT = new DominatorTreeBase<BasicBlock>(false);
- }
-
- ~DominatorTree() {
- DT->releaseMemory();
- delete DT;
- }
-
- DominatorTreeBase<BasicBlock>& getBase() { return *DT; }
-
- /// getRoots - Return the root blocks of the current CFG. This may include
- /// multiple blocks if we are computing post dominators. For forward
- /// dominators, this will always be a single block (the entry node).
- ///
- inline const std::vector<BasicBlock*> &getRoots() const {
- return DT->getRoots();
- }
-
- inline BasicBlock *getRoot() const {
- return DT->getRoot();
- }
-
- inline DomTreeNode *getRootNode() const {
- return DT->getRootNode();
- }
-
- virtual bool runOnFunction(Function &F);
-
- virtual void getAnalysisUsage(AnalysisUsage &AU) const {
- AU.setPreservesAll();
- }
-
- inline bool dominates(DomTreeNode* A, DomTreeNode* B) const {
- return DT->dominates(A, B);
- }
-
- inline bool dominates(BasicBlock* A, BasicBlock* B) const {
- return DT->dominates(A, B);
- }
-
- // dominates - Return true if A dominates B. This performs the
- // special checks necessary if A and B are in the same basic block.
- bool dominates(Instruction *A, Instruction *B) const {
- BasicBlock *BBA = A->getParent(), *BBB = B->getParent();
- if (BBA != BBB) return DT->dominates(BBA, BBB);
-
- // It is not possible to determine dominance between two PHI nodes
- // based on their ordering.
- if (isa<PHINode>(A) && isa<PHINode>(B))
- return false;
-
- // Loop through the basic block until we find A or B.
- BasicBlock::iterator I = BBA->begin();
- for (; &*I != A && &*I != B; ++I) /*empty*/;
-
- //if(!DT.IsPostDominators) {
- // A dominates B if it is found first in the basic block.
- return &*I == A;
- //} else {
- // // A post-dominates B if B is found first in the basic block.
- // return &*I == B;
- //}
- }
-
- inline bool properlyDominates(const DomTreeNode* A, DomTreeNode* B) const {
- return DT->properlyDominates(A, B);
- }
-
- inline bool properlyDominates(BasicBlock* A, BasicBlock* B) const {
- return DT->properlyDominates(A, B);
- }
-
- /// findNearestCommonDominator - Find nearest common dominator basic block
- /// for basic block A and B. If there is no such block then return NULL.
- inline BasicBlock *findNearestCommonDominator(BasicBlock *A, BasicBlock *B) {
- return DT->findNearestCommonDominator(A, B);
- }
-
- inline DomTreeNode *operator[](BasicBlock *BB) const {
- return DT->getNode(BB);
- }
-
- /// getNode - return the (Post)DominatorTree node for the specified basic
- /// block. This is the same as using operator[] on this class.
- ///
- inline DomTreeNode *getNode(BasicBlock *BB) const {
- return DT->getNode(BB);
- }
-
- /// addNewBlock - Add a new node to the dominator tree information. This
- /// creates a new node as a child of DomBB dominator node,linking it into
- /// the children list of the immediate dominator.
- inline DomTreeNode *addNewBlock(BasicBlock *BB, BasicBlock *DomBB) {
- return DT->addNewBlock(BB, DomBB);
- }
-
- /// changeImmediateDominator - This method is used to update the dominator
- /// tree information when a node's immediate dominator changes.
- ///
- inline void changeImmediateDominator(BasicBlock *N, BasicBlock* NewIDom) {
- DT->changeImmediateDominator(N, NewIDom);
- }
-
- inline void changeImmediateDominator(DomTreeNode *N, DomTreeNode* NewIDom) {
- DT->changeImmediateDominator(N, NewIDom);
- }
-
- /// eraseNode - Removes a node from the dominator tree. Block must not
- /// domiante any other blocks. Removes node from its immediate dominator's
- /// children list. Deletes dominator node associated with basic block BB.
- inline void eraseNode(BasicBlock *BB) {
- DT->eraseNode(BB);
- }
-
- /// splitBlock - BB is split and now it has one successor. Update dominator
- /// tree to reflect this change.
- inline void splitBlock(BasicBlock* NewBB) {
- DT->splitBlock(NewBB);
- }
-
-
- virtual void releaseMemory() {
- DT->releaseMemory();
- }
-
- virtual void print(std::ostream &OS, const Module* M= 0) const {
- DT->print(OS, M);
- }
-};
-
-//===-------------------------------------
-/// DominatorTree GraphTraits specialization so the DominatorTree can be
-/// iterable by generic graph iterators.
-///
-template <> struct GraphTraits<DomTreeNode *> {
- typedef DomTreeNode NodeType;
- typedef NodeType::iterator ChildIteratorType;
-
- static NodeType *getEntryNode(NodeType *N) {
- return N;
- }
- static inline ChildIteratorType child_begin(NodeType* N) {
- return N->begin();
- }
- static inline ChildIteratorType child_end(NodeType* N) {
- return N->end();
- }
-};
-
-template <> struct GraphTraits<DominatorTree*>
- : public GraphTraits<DomTreeNode *> {
- static NodeType *getEntryNode(DominatorTree *DT) {
- return DT->getRootNode();
- }
-};
-
-
-//===----------------------------------------------------------------------===//
-/// DominanceFrontierBase - Common base class for computing forward and inverse
-/// dominance frontiers for a function.
-///
-class DominanceFrontierBase : public FunctionPass {
-public:
- typedef std::set<BasicBlock*> DomSetType; // Dom set for a bb
- typedef std::map<BasicBlock*, DomSetType> DomSetMapType; // Dom set map
-protected:
- DomSetMapType Frontiers;
- std::vector<BasicBlock*> Roots;
- const bool IsPostDominators;
-
-public:
- DominanceFrontierBase(intptr_t ID, bool isPostDom)
- : FunctionPass(ID), IsPostDominators(isPostDom) {}
-
- /// getRoots - Return the root blocks of the current CFG. This may include
- /// multiple blocks if we are computing post dominators. For forward
- /// dominators, this will always be a single block (the entry node).
- ///
- inline const std::vector<BasicBlock*> &getRoots() const { return Roots; }
-
- /// isPostDominator - Returns true if analysis based of postdoms
- ///
- bool isPostDominator() const { return IsPostDominators; }
-
- virtual void releaseMemory() { Frontiers.clear(); }
-
- // Accessor interface:
- typedef DomSetMapType::iterator iterator;
- typedef DomSetMapType::const_iterator const_iterator;
- iterator begin() { return Frontiers.begin(); }
- const_iterator begin() const { return Frontiers.begin(); }
- iterator end() { return Frontiers.end(); }
- const_iterator end() const { return Frontiers.end(); }
- iterator find(BasicBlock *B) { return Frontiers.find(B); }
- const_iterator find(BasicBlock *B) const { return Frontiers.find(B); }
-
- void addBasicBlock(BasicBlock *BB, const DomSetType &frontier) {
- assert(find(BB) == end() && "Block already in DominanceFrontier!");
- Frontiers.insert(std::make_pair(BB, frontier));
- }
-
- /// removeBlock - Remove basic block BB's frontier.
- void removeBlock(BasicBlock *BB) {
- assert(find(BB) != end() && "Block is not in DominanceFrontier!");
- for (iterator I = begin(), E = end(); I != E; ++I)
- I->second.erase(BB);
- Frontiers.erase(BB);
- }
-
- void addToFrontier(iterator I, BasicBlock *Node) {
- assert(I != end() && "BB is not in DominanceFrontier!");
- I->second.insert(Node);
- }
-
- void removeFromFrontier(iterator I, BasicBlock *Node) {
- assert(I != end() && "BB is not in DominanceFrontier!");
- assert(I->second.count(Node) && "Node is not in DominanceFrontier of BB");
- I->second.erase(Node);
- }
-
- /// print - Convert to human readable form
- ///
- virtual void print(std::ostream &OS, const Module* = 0) const;
- void print(std::ostream *OS, const Module* M = 0) const {
- if (OS) print(*OS, M);
- }
- virtual void dump();
-};
-
-
-//===-------------------------------------
-/// DominanceFrontier Class - Concrete subclass of DominanceFrontierBase that is
-/// used to compute a forward dominator frontiers.
-///
-class DominanceFrontier : public DominanceFrontierBase {
-public:
- static char ID; // Pass ID, replacement for typeid
- DominanceFrontier() :
- DominanceFrontierBase(intptr_t(&ID), false) {}
-
- BasicBlock *getRoot() const {
- assert(Roots.size() == 1 && "Should always have entry node!");
- return Roots[0];
- }
-
- virtual bool runOnFunction(Function &) {
- Frontiers.clear();
- DominatorTree &DT = getAnalysis<DominatorTree>();
- Roots = DT.getRoots();
- assert(Roots.size() == 1 && "Only one entry block for forward domfronts!");
- calculate(DT, DT[Roots[0]]);
- return false;
- }
-
- virtual void getAnalysisUsage(AnalysisUsage &AU) const {
- AU.setPreservesAll();
- AU.addRequired<DominatorTree>();
- }
-
- /// splitBlock - BB is split and now it has one successor. Update dominance
- /// frontier to reflect this change.
- void splitBlock(BasicBlock *BB);
-
- /// BasicBlock BB's new dominator is NewBB. Update BB's dominance frontier
- /// to reflect this change.
- void changeImmediateDominator(BasicBlock *BB, BasicBlock *NewBB,
- DominatorTree *DT) {
- // NewBB is now dominating BB. Which means BB's dominance
- // frontier is now part of NewBB's dominance frontier. However, BB
- // itself is not member of NewBB's dominance frontier.
- DominanceFrontier::iterator NewDFI = find(NewBB);
- DominanceFrontier::iterator DFI = find(BB);
- DominanceFrontier::DomSetType BBSet = DFI->second;
- for (DominanceFrontier::DomSetType::iterator BBSetI = BBSet.begin(),
- BBSetE = BBSet.end(); BBSetI != BBSetE; ++BBSetI) {
- BasicBlock *DFMember = *BBSetI;
- // Insert only if NewBB dominates DFMember.
- if (!DT->dominates(NewBB, DFMember))
- NewDFI->second.insert(DFMember);
- }
- NewDFI->second.erase(BB);
- }
-
-private:
- const DomSetType &calculate(const DominatorTree &DT,
- const DomTreeNode *Node);
-};
-
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/Analysis/FindUsedTypes.h b/release_23/include/llvm/Analysis/FindUsedTypes.h
deleted file mode 100644
index d3e62e269654..000000000000
--- a/release_23/include/llvm/Analysis/FindUsedTypes.h
+++ /dev/null
@@ -1,64 +0,0 @@
-//===- llvm/Analysis/FindUsedTypes.h - Find all Types in use ----*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This pass is used to seek out all of the types in use by the program.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_ANALYSIS_FINDUSEDTYPES_H
-#define LLVM_ANALYSIS_FINDUSEDTYPES_H
-
-#include "llvm/Pass.h"
-#include <set>
-
-namespace llvm {
-
-class Type;
-
-class FindUsedTypes : public ModulePass {
- std::set<const Type *> UsedTypes;
-public:
- static char ID; // Pass identification, replacement for typeid
- FindUsedTypes() : ModulePass((intptr_t)&ID) {}
-
- /// getTypes - After the pass has been run, return the set containing all of
- /// the types used in the module.
- ///
- const std::set<const Type *> &getTypes() const { return UsedTypes; }
-
- /// Print the types found in the module. If the optional Module parameter is
- /// passed in, then the types are printed symbolically if possible, using the
- /// symbol table from the module.
- ///
- void print(std::ostream &o, const Module *M) const;
- void print(std::ostream *o, const Module *M) const { if (o) print(*o, M); }
-
-private:
- /// IncorporateType - Incorporate one type and all of its subtypes into the
- /// collection of used types.
- ///
- void IncorporateType(const Type *Ty);
-
- /// IncorporateValue - Incorporate all of the types used by this value.
- ///
- void IncorporateValue(const Value *V);
-
-public:
- /// run - This incorporates all types used by the specified module
- bool runOnModule(Module &M);
-
- /// getAnalysisUsage - We do not modify anything.
- virtual void getAnalysisUsage(AnalysisUsage &AU) const {
- AU.setPreservesAll();
- }
-};
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/Analysis/Interval.h b/release_23/include/llvm/Analysis/Interval.h
deleted file mode 100644
index 1da2022f6961..000000000000
--- a/release_23/include/llvm/Analysis/Interval.h
+++ /dev/null
@@ -1,154 +0,0 @@
-//===- llvm/Analysis/Interval.h - Interval Class Declaration ----*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains the declaration of the Interval class, which
-// represents a set of CFG nodes and is a portion of an interval partition.
-//
-// Intervals have some interesting and useful properties, including the
-// following:
-// 1. The header node of an interval dominates all of the elements of the
-// interval
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_INTERVAL_H
-#define LLVM_INTERVAL_H
-
-#include "llvm/ADT/GraphTraits.h"
-#include <vector>
-#include <iosfwd>
-
-namespace llvm {
-
-class BasicBlock;
-
-//===----------------------------------------------------------------------===//
-//
-/// Interval Class - An Interval is a set of nodes defined such that every node
-/// in the interval has all of its predecessors in the interval (except for the
-/// header)
-///
-class Interval {
- /// HeaderNode - The header BasicBlock, which dominates all BasicBlocks in this
- /// interval. Also, any loops in this interval must go through the HeaderNode.
- ///
- BasicBlock *HeaderNode;
-public:
- typedef std::vector<BasicBlock*>::iterator succ_iterator;
- typedef std::vector<BasicBlock*>::iterator pred_iterator;
- typedef std::vector<BasicBlock*>::iterator node_iterator;
-
- inline Interval(BasicBlock *Header) : HeaderNode(Header) {
- Nodes.push_back(Header);
- }
-
- inline Interval(const Interval &I) // copy ctor
- : HeaderNode(I.HeaderNode), Nodes(I.Nodes), Successors(I.Successors) {}
-
- inline BasicBlock *getHeaderNode() const { return HeaderNode; }
-
- /// Nodes - The basic blocks in this interval.
- ///
- std::vector<BasicBlock*> Nodes;
-
- /// Successors - List of BasicBlocks that are reachable directly from nodes in
- /// this interval, but are not in the interval themselves.
- /// These nodes necessarily must be header nodes for other intervals.
- ///
- std::vector<BasicBlock*> Successors;
-
- /// Predecessors - List of BasicBlocks that have this Interval's header block
- /// as one of their successors.
- ///
- std::vector<BasicBlock*> Predecessors;
-
- /// contains - Find out if a basic block is in this interval
- inline bool contains(BasicBlock *BB) const {
- for (unsigned i = 0; i < Nodes.size(); ++i)
- if (Nodes[i] == BB) return true;
- return false;
- // I don't want the dependency on <algorithm>
- //return find(Nodes.begin(), Nodes.end(), BB) != Nodes.end();
- }
-
- /// isSuccessor - find out if a basic block is a successor of this Interval
- inline bool isSuccessor(BasicBlock *BB) const {
- for (unsigned i = 0; i < Successors.size(); ++i)
- if (Successors[i] == BB) return true;
- return false;
- // I don't want the dependency on <algorithm>
- //return find(Successors.begin(), Successors.end(), BB) != Successors.end();
- }
-
- /// Equality operator. It is only valid to compare two intervals from the
- /// same partition, because of this, all we have to check is the header node
- /// for equality.
- ///
- inline bool operator==(const Interval &I) const {
- return HeaderNode == I.HeaderNode;
- }
-
- /// isLoop - Find out if there is a back edge in this interval...
- bool isLoop() const;
-
- /// print - Show contents in human readable format...
- void print(std::ostream &O) const;
- void print(std::ostream *O) const { if (O) print(*O); }
-};
-
-/// succ_begin/succ_end - define methods so that Intervals may be used
-/// just like BasicBlocks can with the succ_* functions, and *::succ_iterator.
-///
-inline Interval::succ_iterator succ_begin(Interval *I) {
- return I->Successors.begin();
-}
-inline Interval::succ_iterator succ_end(Interval *I) {
- return I->Successors.end();
-}
-
-/// pred_begin/pred_end - define methods so that Intervals may be used
-/// just like BasicBlocks can with the pred_* functions, and *::pred_iterator.
-///
-inline Interval::pred_iterator pred_begin(Interval *I) {
- return I->Predecessors.begin();
-}
-inline Interval::pred_iterator pred_end(Interval *I) {
- return I->Predecessors.end();
-}
-
-template <> struct GraphTraits<Interval*> {
- typedef Interval NodeType;
- typedef Interval::succ_iterator ChildIteratorType;
-
- static NodeType *getEntryNode(Interval *I) { return I; }
-
- /// nodes_iterator/begin/end - Allow iteration over all nodes in the graph
- static inline ChildIteratorType child_begin(NodeType *N) {
- return succ_begin(N);
- }
- static inline ChildIteratorType child_end(NodeType *N) {
- return succ_end(N);
- }
-};
-
-template <> struct GraphTraits<Inverse<Interval*> > {
- typedef Interval NodeType;
- typedef Interval::pred_iterator ChildIteratorType;
- static NodeType *getEntryNode(Inverse<Interval *> G) { return G.Graph; }
- static inline ChildIteratorType child_begin(NodeType *N) {
- return pred_begin(N);
- }
- static inline ChildIteratorType child_end(NodeType *N) {
- return pred_end(N);
- }
-};
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/Analysis/IntervalIterator.h b/release_23/include/llvm/Analysis/IntervalIterator.h
deleted file mode 100644
index 551bb7243798..000000000000
--- a/release_23/include/llvm/Analysis/IntervalIterator.h
+++ /dev/null
@@ -1,258 +0,0 @@
-//===- IntervalIterator.h - Interval Iterator Declaration -------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines an iterator that enumerates the intervals in a control flow
-// graph of some sort. This iterator is parametric, allowing iterator over the
-// following types of graphs:
-//
-// 1. A Function* object, composed of BasicBlock nodes.
-// 2. An IntervalPartition& object, composed of Interval nodes.
-//
-// This iterator is defined to walk the control flow graph, returning intervals
-// in depth first order. These intervals are completely filled in except for
-// the predecessor fields (the successor information is filled in however).
-//
-// By default, the intervals created by this iterator are deleted after they
-// are no longer any use to the iterator. This behavior can be changed by
-// passing a false value into the intervals_begin() function. This causes the
-// IOwnMem member to be set, and the intervals to not be deleted.
-//
-// It is only safe to use this if all of the intervals are deleted by the caller
-// and all of the intervals are processed. However, the user of the iterator is
-// not allowed to modify or delete the intervals until after the iterator has
-// been used completely. The IntervalPartition class uses this functionality.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_INTERVAL_ITERATOR_H
-#define LLVM_INTERVAL_ITERATOR_H
-
-#include "llvm/Analysis/IntervalPartition.h"
-#include "llvm/Function.h"
-#include "llvm/Support/CFG.h"
-#include <stack>
-#include <set>
-#include <algorithm>
-
-namespace llvm {
-
-// getNodeHeader - Given a source graph node and the source graph, return the
-// BasicBlock that is the header node. This is the opposite of
-// getSourceGraphNode.
-//
-inline BasicBlock *getNodeHeader(BasicBlock *BB) { return BB; }
-inline BasicBlock *getNodeHeader(Interval *I) { return I->getHeaderNode(); }
-
-// getSourceGraphNode - Given a BasicBlock and the source graph, return the
-// source graph node that corresponds to the BasicBlock. This is the opposite
-// of getNodeHeader.
-//
-inline BasicBlock *getSourceGraphNode(Function *, BasicBlock *BB) {
- return BB;
-}
-inline Interval *getSourceGraphNode(IntervalPartition *IP, BasicBlock *BB) {
- return IP->getBlockInterval(BB);
-}
-
-// addNodeToInterval - This method exists to assist the generic ProcessNode
-// with the task of adding a node to the new interval, depending on the
-// type of the source node. In the case of a CFG source graph (BasicBlock
-// case), the BasicBlock itself is added to the interval.
-//
-inline void addNodeToInterval(Interval *Int, BasicBlock *BB) {
- Int->Nodes.push_back(BB);
-}
-
-// addNodeToInterval - This method exists to assist the generic ProcessNode
-// with the task of adding a node to the new interval, depending on the
-// type of the source node. In the case of a CFG source graph (BasicBlock
-// case), the BasicBlock itself is added to the interval. In the case of
-// an IntervalPartition source graph (Interval case), all of the member
-// BasicBlocks are added to the interval.
-//
-inline void addNodeToInterval(Interval *Int, Interval *I) {
- // Add all of the nodes in I as new nodes in Int.
- copy(I->Nodes.begin(), I->Nodes.end(), back_inserter(Int->Nodes));
-}
-
-
-
-
-
-template<class NodeTy, class OrigContainer_t, class GT = GraphTraits<NodeTy*>,
- class IGT = GraphTraits<Inverse<NodeTy*> > >
-class IntervalIterator {
- std::stack<std::pair<Interval*, typename Interval::succ_iterator> > IntStack;
- std::set<BasicBlock*> Visited;
- OrigContainer_t *OrigContainer;
- bool IOwnMem; // If True, delete intervals when done with them
- // See file header for conditions of use
-public:
- typedef IntervalIterator<NodeTy, OrigContainer_t> _Self;
- typedef std::forward_iterator_tag iterator_category;
-
- IntervalIterator() {} // End iterator, empty stack
- IntervalIterator(Function *M, bool OwnMemory) : IOwnMem(OwnMemory) {
- OrigContainer = M;
- if (!ProcessInterval(&M->front())) {
- assert(0 && "ProcessInterval should never fail for first interval!");
- }
- }
-
- IntervalIterator(IntervalPartition &IP, bool OwnMemory) : IOwnMem(OwnMemory) {
- OrigContainer = &IP;
- if (!ProcessInterval(IP.getRootInterval())) {
- assert(0 && "ProcessInterval should never fail for first interval!");
- }
- }
-
- inline ~IntervalIterator() {
- if (IOwnMem)
- while (!IntStack.empty()) {
- delete operator*();
- IntStack.pop();
- }
- }
-
- inline bool operator==(const _Self& x) const { return IntStack == x.IntStack;}
- inline bool operator!=(const _Self& x) const { return !operator==(x); }
-
- inline const Interval *operator*() const { return IntStack.top().first; }
- inline Interval *operator*() { return IntStack.top().first; }
- inline const Interval *operator->() const { return operator*(); }
- inline Interval *operator->() { return operator*(); }
-
- _Self& operator++() { // Preincrement
- assert(!IntStack.empty() && "Attempting to use interval iterator at end!");
- do {
- // All of the intervals on the stack have been visited. Try visiting
- // their successors now.
- Interval::succ_iterator &SuccIt = IntStack.top().second,
- EndIt = succ_end(IntStack.top().first);
- while (SuccIt != EndIt) { // Loop over all interval succs
- bool Done = ProcessInterval(getSourceGraphNode(OrigContainer, *SuccIt));
- ++SuccIt; // Increment iterator
- if (Done) return *this; // Found a new interval! Use it!
- }
-
- // Free interval memory... if necessary
- if (IOwnMem) delete IntStack.top().first;
-
- // We ran out of successors for this interval... pop off the stack
- IntStack.pop();
- } while (!IntStack.empty());
-
- return *this;
- }
- inline _Self operator++(int) { // Postincrement
- _Self tmp = *this; ++*this; return tmp;
- }
-
-private:
- // ProcessInterval - This method is used during the construction of the
- // interval graph. It walks through the source graph, recursively creating
- // an interval per invokation until the entire graph is covered. This uses
- // the ProcessNode method to add all of the nodes to the interval.
- //
- // This method is templated because it may operate on two different source
- // graphs: a basic block graph, or a preexisting interval graph.
- //
- bool ProcessInterval(NodeTy *Node) {
- BasicBlock *Header = getNodeHeader(Node);
- if (Visited.count(Header)) return false;
-
- Interval *Int = new Interval(Header);
- Visited.insert(Header); // The header has now been visited!
-
- // Check all of our successors to see if they are in the interval...
- for (typename GT::ChildIteratorType I = GT::child_begin(Node),
- E = GT::child_end(Node); I != E; ++I)
- ProcessNode(Int, getSourceGraphNode(OrigContainer, *I));
-
- IntStack.push(std::make_pair(Int, succ_begin(Int)));
- return true;
- }
-
- // ProcessNode - This method is called by ProcessInterval to add nodes to the
- // interval being constructed, and it is also called recursively as it walks
- // the source graph. A node is added to the current interval only if all of
- // its predecessors are already in the graph. This also takes care of keeping
- // the successor set of an interval up to date.
- //
- // This method is templated because it may operate on two different source
- // graphs: a basic block graph, or a preexisting interval graph.
- //
- void ProcessNode(Interval *Int, NodeTy *Node) {
- assert(Int && "Null interval == bad!");
- assert(Node && "Null Node == bad!");
-
- BasicBlock *NodeHeader = getNodeHeader(Node);
-
- if (Visited.count(NodeHeader)) { // Node already been visited?
- if (Int->contains(NodeHeader)) { // Already in this interval...
- return;
- } else { // In other interval, add as successor
- if (!Int->isSuccessor(NodeHeader)) // Add only if not already in set
- Int->Successors.push_back(NodeHeader);
- }
- } else { // Otherwise, not in interval yet
- for (typename IGT::ChildIteratorType I = IGT::child_begin(Node),
- E = IGT::child_end(Node); I != E; ++I) {
- if (!Int->contains(*I)) { // If pred not in interval, we can't be
- if (!Int->isSuccessor(NodeHeader)) // Add only if not already in set
- Int->Successors.push_back(NodeHeader);
- return; // See you later
- }
- }
-
- // If we get here, then all of the predecessors of BB are in the interval
- // already. In this case, we must add BB to the interval!
- addNodeToInterval(Int, Node);
- Visited.insert(NodeHeader); // The node has now been visited!
-
- if (Int->isSuccessor(NodeHeader)) {
- // If we were in the successor list from before... remove from succ list
- Int->Successors.erase(std::remove(Int->Successors.begin(),
- Int->Successors.end(), NodeHeader),
- Int->Successors.end());
- }
-
- // Now that we have discovered that Node is in the interval, perhaps some
- // of its successors are as well?
- for (typename GT::ChildIteratorType It = GT::child_begin(Node),
- End = GT::child_end(Node); It != End; ++It)
- ProcessNode(Int, getSourceGraphNode(OrigContainer, *It));
- }
- }
-};
-
-typedef IntervalIterator<BasicBlock, Function> function_interval_iterator;
-typedef IntervalIterator<Interval, IntervalPartition> interval_part_interval_iterator;
-
-
-inline function_interval_iterator intervals_begin(Function *F,
- bool DeleteInts = true) {
- return function_interval_iterator(F, DeleteInts);
-}
-inline function_interval_iterator intervals_end(Function *) {
- return function_interval_iterator();
-}
-
-inline interval_part_interval_iterator
- intervals_begin(IntervalPartition &IP, bool DeleteIntervals = true) {
- return interval_part_interval_iterator(IP, DeleteIntervals);
-}
-
-inline interval_part_interval_iterator intervals_end(IntervalPartition &IP) {
- return interval_part_interval_iterator();
-}
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/Analysis/IntervalPartition.h b/release_23/include/llvm/Analysis/IntervalPartition.h
deleted file mode 100644
index 793f7d5c27ad..000000000000
--- a/release_23/include/llvm/Analysis/IntervalPartition.h
+++ /dev/null
@@ -1,115 +0,0 @@
-//===- IntervalPartition.h - Interval partition Calculation -----*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains the declaration of the IntervalPartition class, which
-// calculates and represents the interval partition of a function, or a
-// preexisting interval partition.
-//
-// In this way, the interval partition may be used to reduce a flow graph down
-// to its degenerate single node interval partition (unless it is irreducible).
-//
-// TODO: The IntervalPartition class should take a bool parameter that tells
-// whether it should add the "tails" of an interval to an interval itself or if
-// they should be represented as distinct intervals.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_INTERVAL_PARTITION_H
-#define LLVM_INTERVAL_PARTITION_H
-
-#include "llvm/Analysis/Interval.h"
-#include "llvm/Pass.h"
-#include <map>
-
-namespace llvm {
-
-//===----------------------------------------------------------------------===//
-//
-// IntervalPartition - This class builds and holds an "interval partition" for
-// a function. This partition divides the control flow graph into a set of
-// maximal intervals, as defined with the properties above. Intuitively, a
-// BasicBlock is a (possibly nonexistent) loop with a "tail" of non looping
-// nodes following it.
-//
-class IntervalPartition : public FunctionPass {
- typedef std::map<BasicBlock*, Interval*> IntervalMapTy;
- IntervalMapTy IntervalMap;
-
- typedef std::vector<Interval*> IntervalListTy;
- Interval *RootInterval;
- std::vector<Interval*> Intervals;
-
-public:
- static char ID; // Pass identification, replacement for typeid
-
- IntervalPartition() : FunctionPass((intptr_t)&ID), RootInterval(0) {}
-
- // run - Calculate the interval partition for this function
- virtual bool runOnFunction(Function &F);
-
- // IntervalPartition ctor - Build a reduced interval partition from an
- // existing interval graph. This takes an additional boolean parameter to
- // distinguish it from a copy constructor. Always pass in false for now.
- //
- IntervalPartition(IntervalPartition &I, bool);
-
- // Destructor - Free memory
- ~IntervalPartition() { destroy(); }
-
- // print - Show contents in human readable format...
- virtual void print(std::ostream &O, const Module* = 0) const;
- void print(std::ostream *O, const Module* M = 0) const {
- if (O) print(*O, M);
- }
-
- // getRootInterval() - Return the root interval that contains the starting
- // block of the function.
- inline Interval *getRootInterval() { return RootInterval; }
-
- // isDegeneratePartition() - Returns true if the interval partition contains
- // a single interval, and thus cannot be simplified anymore.
- bool isDegeneratePartition() { return Intervals.size() == 1; }
-
- // TODO: isIrreducible - look for triangle graph.
-
- // getBlockInterval - Return the interval that a basic block exists in.
- inline Interval *getBlockInterval(BasicBlock *BB) {
- IntervalMapTy::iterator I = IntervalMap.find(BB);
- return I != IntervalMap.end() ? I->second : 0;
- }
-
- // getAnalysisUsage - Implement the Pass API
- virtual void getAnalysisUsage(AnalysisUsage &AU) const {
- AU.setPreservesAll();
- }
-
- // Interface to Intervals vector...
- const std::vector<Interval*> &getIntervals() const { return Intervals; }
-
-private:
- // destroy - Reset state back to before function was analyzed
- void destroy();
-
- // addIntervalToPartition - Add an interval to the internal list of intervals,
- // and then add mappings from all of the basic blocks in the interval to the
- // interval itself (in the IntervalMap).
- //
- void addIntervalToPartition(Interval *I);
-
- // updatePredecessors - Interval generation only sets the successor fields of
- // the interval data structures. After interval generation is complete,
- // run through all of the intervals and propagate successor info as
- // predecessor info.
- //
- void updatePredecessors(Interval *Int);
-};
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/Analysis/LibCallSemantics.h b/release_23/include/llvm/Analysis/LibCallSemantics.h
deleted file mode 100644
index 74e8401a1fe6..000000000000
--- a/release_23/include/llvm/Analysis/LibCallSemantics.h
+++ /dev/null
@@ -1,166 +0,0 @@
-//===- LibCallSemantics.h - Describe library semantics --------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines interfaces that can be used to describe language specific
-// runtime library interfaces (e.g. libc, libm, etc) to LLVM optimizers.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_ANALYSIS_LIBCALLSEMANTICS_H
-#define LLVM_ANALYSIS_LIBCALLSEMANTICS_H
-
-#include "llvm/Analysis/AliasAnalysis.h"
-
-namespace llvm {
-
- /// LibCallLocationInfo - This struct describes a set of memory locations that
- /// are accessed by libcalls. Identification of a location is doing with a
- /// simple callback function.
- ///
- /// For example, the LibCallInfo may be set up to model the behavior of
- /// standard libm functions. The location that they may be interested in is
- /// an abstract location that represents errno for the current target. In
- /// this case, a location for errno is anything such that the predicate
- /// returns true. On Mac OS/X, this predicate would return true if the
- /// pointer is the result of a call to "__error()".
- ///
- /// Locations can also be defined in a constant-sensitive way. For example,
- /// it is possible to define a location that returns true iff it is passed
- /// into the call as a specific argument. This is useful for modeling things
- /// like "printf", which can store to memory, but only through pointers passed
- /// with a '%n' constraint.
- ///
- struct LibCallLocationInfo {
- // TODO: Flags: isContextSensitive etc.
-
- /// isLocation - Return a LocResult if the specified pointer refers to this
- /// location for the specified call site. This returns "Yes" if we can tell
- /// that the pointer *does definitely* refer to the location, "No" if we can
- /// tell that the location *definitely does not* refer to the location, and
- /// returns "Unknown" if we cannot tell for certain.
- enum LocResult {
- Yes, No, Unknown
- };
- LocResult (*isLocation)(CallSite CS, const Value *Ptr, unsigned Size);
- };
-
- /// LibCallFunctionInfo - Each record in the array of FunctionInfo structs
- /// records the behavior of one libcall that is known by the optimizer. This
- /// captures things like the side effects of the call. Side effects are
- /// modeled both universally (in the readnone/readonly) sense, but also
- /// potentially against a set of abstract locations defined by the optimizer.
- /// This allows an optimizer to define that some libcall (e.g. sqrt) is
- /// side-effect free except that it might modify errno (thus, the call is
- /// *not* universally readonly). Or it might say that the side effects
- /// are unknown other than to say that errno is not modified.
- ///
- struct LibCallFunctionInfo {
- /// Name - This is the name of the libcall this describes.
- const char *Name;
-
- /// TODO: Constant folding function: Constant* vector -> Constant*.
-
- /// UniversalBehavior - This captures the absolute mod/ref behavior without
- /// any specific context knowledge. For example, if the function is known
- /// to be readonly, this would be set to 'ref'. If known to be readnone,
- /// this is set to NoModRef.
- AliasAnalysis::ModRefResult UniversalBehavior;
-
- /// LocationMRInfo - This pair captures info about whether a specific
- /// location is modified or referenced by a libcall.
- struct LocationMRInfo {
- /// LocationID - ID # of the accessed location or ~0U for array end.
- unsigned LocationID;
- /// MRInfo - Mod/Ref info for this location.
- AliasAnalysis::ModRefResult MRInfo;
- };
-
- /// DetailsType - Indicate the sense of the LocationDetails array. This
- /// controls how the LocationDetails array is interpreted.
- enum {
- /// DoesOnly - If DetailsType is set to DoesOnly, then we know that the
- /// *only* mod/ref behavior of this function is captured by the
- /// LocationDetails array. If we are trying to say that 'sqrt' can only
- /// modify errno, we'd have the {errnoloc,mod} in the LocationDetails
- /// array and have DetailsType set to DoesOnly.
- DoesOnly,
-
- /// DoesNot - If DetailsType is set to DoesNot, then the sense of the
- /// LocationDetails array is completely inverted. This means that we *do
- /// not* know everything about the side effects of this libcall, but we do
- /// know things that the libcall cannot do. This is useful for complex
- /// functions like 'ctime' which have crazy mod/ref behavior, but are
- /// known to never read or write errno. In this case, we'd have
- /// {errnoloc,modref} in the LocationDetails array and DetailsType would
- /// be set to DoesNot, indicating that ctime does not read or write the
- /// errno location.
- DoesNot
- } DetailsType;
-
- /// LocationDetails - This is a pointer to an array of LocationMRInfo
- /// structs which indicates the behavior of the libcall w.r.t. specific
- /// locations. For example, if this libcall is known to only modify
- /// 'errno', it would have a LocationDetails array with the errno ID and
- /// 'mod' in it. See the DetailsType field for how this is interpreted.
- ///
- /// In the "DoesOnly" case, this information is 'may' information for: there
- /// is no guarantee that the specified side effect actually does happen,
- /// just that it could. In the "DoesNot" case, this is 'must not' info.
- ///
- /// If this pointer is null, no details are known.
- ///
- const LocationMRInfo *LocationDetails;
- };
-
-
- /// LibCallInfo - Abstract interface to query about library call information.
- /// Instances of this class return known information about some set of
- /// libcalls.
- ///
- class LibCallInfo {
- // Implementation details of this object, private.
- mutable void *Impl;
- mutable const LibCallLocationInfo *Locations;
- mutable unsigned NumLocations;
- public:
- LibCallInfo() : Impl(0), Locations(0), NumLocations(0) {}
- virtual ~LibCallInfo();
-
- //===------------------------------------------------------------------===//
- // Accessor Methods: Efficient access to contained data.
- //===------------------------------------------------------------------===//
-
- /// getLocationInfo - Return information about the specified LocationID.
- const LibCallLocationInfo &getLocationInfo(unsigned LocID) const;
-
-
- /// getFunctionInfo - Return the LibCallFunctionInfo object corresponding to
- /// the specified function if we have it. If not, return null.
- const LibCallFunctionInfo *getFunctionInfo(Function *F) const;
-
-
- //===------------------------------------------------------------------===//
- // Implementation Methods: Subclasses should implement these.
- //===------------------------------------------------------------------===//
-
- /// getLocationInfo - Return descriptors for the locations referenced by
- /// this set of libcalls.
- virtual unsigned getLocationInfo(const LibCallLocationInfo *&Array) const {
- return 0;
- }
-
- /// getFunctionInfoArray - Return an array of descriptors that describe the
- /// set of libcalls represented by this LibCallInfo object. This array is
- /// terminated by an entry with a NULL name.
- virtual const LibCallFunctionInfo *getFunctionInfoArray() const = 0;
- };
-
-} // end namespace llvm
-
-#endif
diff --git a/release_23/include/llvm/Analysis/LoadValueNumbering.h b/release_23/include/llvm/Analysis/LoadValueNumbering.h
deleted file mode 100644
index 340a193e0a43..000000000000
--- a/release_23/include/llvm/Analysis/LoadValueNumbering.h
+++ /dev/null
@@ -1,35 +0,0 @@
-//===- llvm/Analysis/LoadValueNumbering.h - Value # Load Insts --*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines a value numbering pass that value #'s load instructions.
-// To do this, it finds lexically identical load instructions, and uses alias
-// analysis to determine which loads are guaranteed to produce the same value.
-//
-// This pass builds off of another value numbering pass to implement value
-// numbering for non-load instructions. It uses Alias Analysis so that it can
-// disambiguate the load instructions. The more powerful these base analyses
-// are, the more powerful the resultant analysis will be.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_ANALYSIS_LOAD_VALUE_NUMBERING_H
-#define LLVM_ANALYSIS_LOAD_VALUE_NUMBERING_H
-
-namespace llvm {
-
-class FunctionPass;
-
-/// createLoadValueNumberingPass - Create and return a new pass that implements
-/// the ValueNumbering interface.
-///
-FunctionPass *createLoadValueNumberingPass();
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/Analysis/LoopInfo.h b/release_23/include/llvm/Analysis/LoopInfo.h
deleted file mode 100644
index 28748b0e541e..000000000000
--- a/release_23/include/llvm/Analysis/LoopInfo.h
+++ /dev/null
@@ -1,1016 +0,0 @@
-//===- llvm/Analysis/LoopInfo.h - Natural Loop Calculator -------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines the LoopInfo class that is used to identify natural loops
-// and determine the loop depth of various nodes of the CFG. Note that natural
-// loops may actually be several loops that share the same header node.
-//
-// This analysis calculates the nesting structure of loops in a function. For
-// each natural loop identified, this analysis identifies natural loops
-// contained entirely within the loop and the basic blocks the make up the loop.
-//
-// It can calculate on the fly various bits of information, for example:
-//
-// * whether there is a preheader for the loop
-// * the number of back edges to the header
-// * whether or not a particular block branches out of the loop
-// * the successor blocks of the loop
-// * the loop depth
-// * the trip count
-// * etc...
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_ANALYSIS_LOOP_INFO_H
-#define LLVM_ANALYSIS_LOOP_INFO_H
-
-#include "llvm/Pass.h"
-#include "llvm/Constants.h"
-#include "llvm/Instructions.h"
-#include "llvm/ADT/DepthFirstIterator.h"
-#include "llvm/ADT/GraphTraits.h"
-#include "llvm/ADT/SmallPtrSet.h"
-#include "llvm/ADT/SmallVector.h"
-#include "llvm/Analysis/Dominators.h"
-#include "llvm/Support/CFG.h"
-#include "llvm/Support/Streams.h"
-#include <algorithm>
-#include <ostream>
-
-template<typename T>
-static void RemoveFromVector(std::vector<T*> &V, T *N) {
- typename std::vector<T*>::iterator I = std::find(V.begin(), V.end(), N);
- assert(I != V.end() && "N is not in this list!");
- V.erase(I);
-}
-
-namespace llvm {
-
-class DominatorTree;
-class LoopInfo;
-class PHINode;
-class Instruction;
-template<class N> class LoopInfoBase;
-template<class N> class LoopBase;
-
-typedef LoopBase<BasicBlock> Loop;
-
-//===----------------------------------------------------------------------===//
-/// LoopBase class - Instances of this class are used to represent loops that
-/// are detected in the flow graph
-///
-template<class BlockT>
-class LoopBase {
- LoopBase<BlockT> *ParentLoop;
- // SubLoops - Loops contained entirely within this one.
- std::vector<LoopBase<BlockT>*> SubLoops;
-
- // Blocks - The list of blocks in this loop. First entry is the header node.
- std::vector<BlockT*> Blocks;
-
- LoopBase(const LoopBase<BlockT> &); // DO NOT IMPLEMENT
- const LoopBase<BlockT>&operator=(const LoopBase<BlockT> &);// DO NOT IMPLEMENT
-public:
- /// Loop ctor - This creates an empty loop.
- LoopBase() : ParentLoop(0) {}
- ~LoopBase() {
- for (size_t i = 0, e = SubLoops.size(); i != e; ++i)
- delete SubLoops[i];
- }
-
- /// getLoopDepth - Return the nesting level of this loop. An outer-most
- /// loop has depth 1, for consistency with loop depth values used for basic
- /// blocks, where depth 0 is used for blocks not inside any loops.
- unsigned getLoopDepth() const {
- unsigned D = 1;
- for (const LoopBase<BlockT> *CurLoop = ParentLoop; CurLoop;
- CurLoop = CurLoop->ParentLoop)
- ++D;
- return D;
- }
- BlockT *getHeader() const { return Blocks.front(); }
- LoopBase<BlockT> *getParentLoop() const { return ParentLoop; }
-
- /// contains - Return true if the specified basic block is in this loop
- ///
- bool contains(const BlockT *BB) const {
- return std::find(Blocks.begin(), Blocks.end(), BB) != Blocks.end();
- }
-
- /// iterator/begin/end - Return the loops contained entirely within this loop.
- ///
- const std::vector<LoopBase<BlockT>*> &getSubLoops() const { return SubLoops; }
- typedef typename std::vector<LoopBase<BlockT>*>::const_iterator iterator;
- iterator begin() const { return SubLoops.begin(); }
- iterator end() const { return SubLoops.end(); }
- bool empty() const { return SubLoops.empty(); }
-
- /// getBlocks - Get a list of the basic blocks which make up this loop.
- ///
- const std::vector<BlockT*> &getBlocks() const { return Blocks; }
- typedef typename std::vector<BlockT*>::const_iterator block_iterator;
- block_iterator block_begin() const { return Blocks.begin(); }
- block_iterator block_end() const { return Blocks.end(); }
-
- /// isLoopExit - True if terminator in the block can branch to another block
- /// that is outside of the current loop.
- ///
- bool isLoopExit(const BlockT *BB) const {
- typedef GraphTraits<BlockT*> BlockTraits;
- for (typename BlockTraits::ChildIteratorType SI =
- BlockTraits::child_begin(const_cast<BlockT*>(BB)),
- SE = BlockTraits::child_end(const_cast<BlockT*>(BB)); SI != SE; ++SI) {
- if (!contains(*SI))
- return true;
- }
- return false;
- }
-
- /// getNumBackEdges - Calculate the number of back edges to the loop header
- ///
- unsigned getNumBackEdges() const {
- unsigned NumBackEdges = 0;
- BlockT *H = getHeader();
-
- typedef GraphTraits<Inverse<BlockT*> > InvBlockTraits;
- for (typename InvBlockTraits::ChildIteratorType I =
- InvBlockTraits::child_begin(const_cast<BlockT*>(H)),
- E = InvBlockTraits::child_end(const_cast<BlockT*>(H)); I != E; ++I)
- if (contains(*I))
- ++NumBackEdges;
-
- return NumBackEdges;
- }
-
- /// isLoopInvariant - Return true if the specified value is loop invariant
- ///
- inline bool isLoopInvariant(Value *V) const {
- if (Instruction *I = dyn_cast<Instruction>(V))
- return !contains(I->getParent());
- return true; // All non-instructions are loop invariant
- }
-
- //===--------------------------------------------------------------------===//
- // APIs for simple analysis of the loop.
- //
- // Note that all of these methods can fail on general loops (ie, there may not
- // be a preheader, etc). For best success, the loop simplification and
- // induction variable canonicalization pass should be used to normalize loops
- // for easy analysis. These methods assume canonical loops.
-
- /// getExitingBlocks - Return all blocks inside the loop that have successors
- /// outside of the loop. These are the blocks _inside of the current loop_
- /// which branch out. The returned list is always unique.
- ///
- void getExitingBlocks(SmallVectorImpl<BlockT *> &ExitingBlocks) const {
- // Sort the blocks vector so that we can use binary search to do quick
- // lookups.
- SmallVector<BlockT*, 128> LoopBBs(block_begin(), block_end());
- std::sort(LoopBBs.begin(), LoopBBs.end());
-
- typedef GraphTraits<BlockT*> BlockTraits;
- for (typename std::vector<BlockT*>::const_iterator BI = Blocks.begin(),
- BE = Blocks.end(); BI != BE; ++BI)
- for (typename BlockTraits::ChildIteratorType I =
- BlockTraits::child_begin(*BI), E = BlockTraits::child_end(*BI);
- I != E; ++I)
- if (!std::binary_search(LoopBBs.begin(), LoopBBs.end(), *I)) {
- // Not in current loop? It must be an exit block.
- ExitingBlocks.push_back(*BI);
- break;
- }
- }
-
- /// getExitBlocks - Return all of the successor blocks of this loop. These
- /// are the blocks _outside of the current loop_ which are branched to.
- ///
- void getExitBlocks(SmallVectorImpl<BlockT*> &ExitBlocks) const {
- // Sort the blocks vector so that we can use binary search to do quick
- // lookups.
- SmallVector<BlockT*, 128> LoopBBs(block_begin(), block_end());
- std::sort(LoopBBs.begin(), LoopBBs.end());
-
- typedef GraphTraits<BlockT*> BlockTraits;
- for (typename std::vector<BlockT*>::const_iterator BI = Blocks.begin(),
- BE = Blocks.end(); BI != BE; ++BI)
- for (typename BlockTraits::ChildIteratorType I =
- BlockTraits::child_begin(*BI), E = BlockTraits::child_end(*BI);
- I != E; ++I)
- if (!std::binary_search(LoopBBs.begin(), LoopBBs.end(), *I))
- // Not in current loop? It must be an exit block.
- ExitBlocks.push_back(*I);
- }
-
- /// getUniqueExitBlocks - Return all unique successor blocks of this loop.
- /// These are the blocks _outside of the current loop_ which are branched to.
- /// This assumes that loop is in canonical form.
- ///
- void getUniqueExitBlocks(SmallVectorImpl<BlockT*> &ExitBlocks) const {
- // Sort the blocks vector so that we can use binary search to do quick
- // lookups.
- SmallVector<BlockT*, 128> LoopBBs(block_begin(), block_end());
- std::sort(LoopBBs.begin(), LoopBBs.end());
-
- std::vector<BlockT*> switchExitBlocks;
-
- for (typename std::vector<BlockT*>::const_iterator BI = Blocks.begin(),
- BE = Blocks.end(); BI != BE; ++BI) {
-
- BlockT *current = *BI;
- switchExitBlocks.clear();
-
- typedef GraphTraits<BlockT*> BlockTraits;
- typedef GraphTraits<Inverse<BlockT*> > InvBlockTraits;
- for (typename BlockTraits::ChildIteratorType I =
- BlockTraits::child_begin(*BI), E = BlockTraits::child_end(*BI);
- I != E; ++I) {
- if (std::binary_search(LoopBBs.begin(), LoopBBs.end(), *I))
- // If block is inside the loop then it is not a exit block.
- continue;
-
- typename InvBlockTraits::ChildIteratorType PI =
- InvBlockTraits::child_begin(*I);
- BlockT *firstPred = *PI;
-
- // If current basic block is this exit block's first predecessor
- // then only insert exit block in to the output ExitBlocks vector.
- // This ensures that same exit block is not inserted twice into
- // ExitBlocks vector.
- if (current != firstPred)
- continue;
-
- // If a terminator has more then two successors, for example SwitchInst,
- // then it is possible that there are multiple edges from current block
- // to one exit block.
- if (std::distance(BlockTraits::child_begin(current),
- BlockTraits::child_end(current)) <= 2) {
- ExitBlocks.push_back(*I);
- continue;
- }
-
- // In case of multiple edges from current block to exit block, collect
- // only one edge in ExitBlocks. Use switchExitBlocks to keep track of
- // duplicate edges.
- if (std::find(switchExitBlocks.begin(), switchExitBlocks.end(), *I)
- == switchExitBlocks.end()) {
- switchExitBlocks.push_back(*I);
- ExitBlocks.push_back(*I);
- }
- }
- }
- }
-
- /// getLoopPreheader - If there is a preheader for this loop, return it. A
- /// loop has a preheader if there is only one edge to the header of the loop
- /// from outside of the loop. If this is the case, the block branching to the
- /// header of the loop is the preheader node.
- ///
- /// This method returns null if there is no preheader for the loop.
- ///
- BlockT *getLoopPreheader() const {
- // Keep track of nodes outside the loop branching to the header...
- BlockT *Out = 0;
-
- // Loop over the predecessors of the header node...
- BlockT *Header = getHeader();
- typedef GraphTraits<BlockT*> BlockTraits;
- typedef GraphTraits<Inverse<BlockT*> > InvBlockTraits;
- for (typename InvBlockTraits::ChildIteratorType PI =
- InvBlockTraits::child_begin(Header),
- PE = InvBlockTraits::child_end(Header); PI != PE; ++PI)
- if (!contains(*PI)) { // If the block is not in the loop...
- if (Out && Out != *PI)
- return 0; // Multiple predecessors outside the loop
- Out = *PI;
- }
-
- // Make sure there is only one exit out of the preheader.
- assert(Out && "Header of loop has no predecessors from outside loop?");
- typename BlockTraits::ChildIteratorType SI = BlockTraits::child_begin(Out);
- ++SI;
- if (SI != BlockTraits::child_end(Out))
- return 0; // Multiple exits from the block, must not be a preheader.
-
- // If there is exactly one preheader, return it. If there was zero, then
- // Out is still null.
- return Out;
- }
-
- /// getLoopLatch - If there is a latch block for this loop, return it. A
- /// latch block is the canonical backedge for a loop. A loop header in normal
- /// form has two edges into it: one from a preheader and one from a latch
- /// block.
- BlockT *getLoopLatch() const {
- BlockT *Header = getHeader();
- typedef GraphTraits<Inverse<BlockT*> > InvBlockTraits;
- typename InvBlockTraits::ChildIteratorType PI =
- InvBlockTraits::child_begin(Header);
- typename InvBlockTraits::ChildIteratorType PE =
- InvBlockTraits::child_end(Header);
- if (PI == PE) return 0; // no preds?
-
- BlockT *Latch = 0;
- if (contains(*PI))
- Latch = *PI;
- ++PI;
- if (PI == PE) return 0; // only one pred?
-
- if (contains(*PI)) {
- if (Latch) return 0; // multiple backedges
- Latch = *PI;
- }
- ++PI;
- if (PI != PE) return 0; // more than two preds
-
- return Latch;
- }
-
- /// getCanonicalInductionVariable - Check to see if the loop has a canonical
- /// induction variable: an integer recurrence that starts at 0 and increments
- /// by one each time through the loop. If so, return the phi node that
- /// corresponds to it.
- ///
- inline PHINode *getCanonicalInductionVariable() const {
- BlockT *H = getHeader();
-
- BlockT *Incoming = 0, *Backedge = 0;
- typedef GraphTraits<Inverse<BlockT*> > InvBlockTraits;
- typename InvBlockTraits::ChildIteratorType PI =
- InvBlockTraits::child_begin(H);
- assert(PI != InvBlockTraits::child_end(H) &&
- "Loop must have at least one backedge!");
- Backedge = *PI++;
- if (PI == InvBlockTraits::child_end(H)) return 0; // dead loop
- Incoming = *PI++;
- if (PI != InvBlockTraits::child_end(H)) return 0; // multiple backedges?
-
- if (contains(Incoming)) {
- if (contains(Backedge))
- return 0;
- std::swap(Incoming, Backedge);
- } else if (!contains(Backedge))
- return 0;
-
- // Loop over all of the PHI nodes, looking for a canonical indvar.
- for (typename BlockT::iterator I = H->begin(); isa<PHINode>(I); ++I) {
- PHINode *PN = cast<PHINode>(I);
- if (ConstantInt *CI =
- dyn_cast<ConstantInt>(PN->getIncomingValueForBlock(Incoming)))
- if (CI->isNullValue())
- if (Instruction *Inc =
- dyn_cast<Instruction>(PN->getIncomingValueForBlock(Backedge)))
- if (Inc->getOpcode() == Instruction::Add &&
- Inc->getOperand(0) == PN)
- if (ConstantInt *CI = dyn_cast<ConstantInt>(Inc->getOperand(1)))
- if (CI->equalsInt(1))
- return PN;
- }
- return 0;
- }
-
- /// getCanonicalInductionVariableIncrement - Return the LLVM value that holds
- /// the canonical induction variable value for the "next" iteration of the
- /// loop. This always succeeds if getCanonicalInductionVariable succeeds.
- ///
- inline Instruction *getCanonicalInductionVariableIncrement() const {
- if (PHINode *PN = getCanonicalInductionVariable()) {
- bool P1InLoop = contains(PN->getIncomingBlock(1));
- return cast<Instruction>(PN->getIncomingValue(P1InLoop));
- }
- return 0;
- }
-
- /// getTripCount - Return a loop-invariant LLVM value indicating the number of
- /// times the loop will be executed. Note that this means that the backedge
- /// of the loop executes N-1 times. If the trip-count cannot be determined,
- /// this returns null.
- ///
- inline Value *getTripCount() const {
- // Canonical loops will end with a 'cmp ne I, V', where I is the incremented
- // canonical induction variable and V is the trip count of the loop.
- Instruction *Inc = getCanonicalInductionVariableIncrement();
- if (Inc == 0) return 0;
- PHINode *IV = cast<PHINode>(Inc->getOperand(0));
-
- BlockT *BackedgeBlock =
- IV->getIncomingBlock(contains(IV->getIncomingBlock(1)));
-
- if (BranchInst *BI = dyn_cast<BranchInst>(BackedgeBlock->getTerminator()))
- if (BI->isConditional()) {
- if (ICmpInst *ICI = dyn_cast<ICmpInst>(BI->getCondition())) {
- if (ICI->getOperand(0) == Inc) {
- if (BI->getSuccessor(0) == getHeader()) {
- if (ICI->getPredicate() == ICmpInst::ICMP_NE)
- return ICI->getOperand(1);
- } else if (ICI->getPredicate() == ICmpInst::ICMP_EQ) {
- return ICI->getOperand(1);
- }
- }
- }
- }
-
- return 0;
- }
-
- /// isLCSSAForm - Return true if the Loop is in LCSSA form
- inline bool isLCSSAForm() const {
- // Sort the blocks vector so that we can use binary search to do quick
- // lookups.
- SmallPtrSet<BlockT*, 16> LoopBBs(block_begin(), block_end());
-
- for (block_iterator BI = block_begin(), E = block_end(); BI != E; ++BI) {
- BlockT *BB = *BI;
- for (typename BlockT::iterator I = BB->begin(), E = BB->end(); I != E;++I)
- for (Value::use_iterator UI = I->use_begin(), E = I->use_end(); UI != E;
- ++UI) {
- BlockT *UserBB = cast<Instruction>(*UI)->getParent();
- if (PHINode *P = dyn_cast<PHINode>(*UI)) {
- unsigned OperandNo = UI.getOperandNo();
- UserBB = P->getIncomingBlock(OperandNo/2);
- }
-
- // Check the current block, as a fast-path. Most values are used in
- // the same block they are defined in.
- if (UserBB != BB && !LoopBBs.count(UserBB))
- return false;
- }
- }
-
- return true;
- }
-
- //===--------------------------------------------------------------------===//
- // APIs for updating loop information after changing the CFG
- //
-
- /// addBasicBlockToLoop - This method is used by other analyses to update loop
- /// information. NewBB is set to be a new member of the current loop.
- /// Because of this, it is added as a member of all parent loops, and is added
- /// to the specified LoopInfo object as being in the current basic block. It
- /// is not valid to replace the loop header with this method.
- ///
- void addBasicBlockToLoop(BlockT *NewBB, LoopInfoBase<BlockT> &LI);
-
- /// replaceChildLoopWith - This is used when splitting loops up. It replaces
- /// the OldChild entry in our children list with NewChild, and updates the
- /// parent pointer of OldChild to be null and the NewChild to be this loop.
- /// This updates the loop depth of the new child.
- void replaceChildLoopWith(LoopBase<BlockT> *OldChild,
- LoopBase<BlockT> *NewChild) {
- assert(OldChild->ParentLoop == this && "This loop is already broken!");
- assert(NewChild->ParentLoop == 0 && "NewChild already has a parent!");
- typename std::vector<LoopBase<BlockT>*>::iterator I =
- std::find(SubLoops.begin(), SubLoops.end(), OldChild);
- assert(I != SubLoops.end() && "OldChild not in loop!");
- *I = NewChild;
- OldChild->ParentLoop = 0;
- NewChild->ParentLoop = this;
- }
-
- /// addChildLoop - Add the specified loop to be a child of this loop. This
- /// updates the loop depth of the new child.
- ///
- void addChildLoop(LoopBase<BlockT> *NewChild) {
- assert(NewChild->ParentLoop == 0 && "NewChild already has a parent!");
- NewChild->ParentLoop = this;
- SubLoops.push_back(NewChild);
- }
-
- /// removeChildLoop - This removes the specified child from being a subloop of
- /// this loop. The loop is not deleted, as it will presumably be inserted
- /// into another loop.
- LoopBase<BlockT> *removeChildLoop(iterator I) {
- assert(I != SubLoops.end() && "Cannot remove end iterator!");
- LoopBase<BlockT> *Child = *I;
- assert(Child->ParentLoop == this && "Child is not a child of this loop!");
- SubLoops.erase(SubLoops.begin()+(I-begin()));
- Child->ParentLoop = 0;
- return Child;
- }
-
- /// addBlockEntry - This adds a basic block directly to the basic block list.
- /// This should only be used by transformations that create new loops. Other
- /// transformations should use addBasicBlockToLoop.
- void addBlockEntry(BlockT *BB) {
- Blocks.push_back(BB);
- }
-
- /// moveToHeader - This method is used to move BB (which must be part of this
- /// loop) to be the loop header of the loop (the block that dominates all
- /// others).
- void moveToHeader(BlockT *BB) {
- if (Blocks[0] == BB) return;
- for (unsigned i = 0; ; ++i) {
- assert(i != Blocks.size() && "Loop does not contain BB!");
- if (Blocks[i] == BB) {
- Blocks[i] = Blocks[0];
- Blocks[0] = BB;
- return;
- }
- }
- }
-
- /// removeBlockFromLoop - This removes the specified basic block from the
- /// current loop, updating the Blocks as appropriate. This does not update
- /// the mapping in the LoopInfo class.
- void removeBlockFromLoop(BlockT *BB) {
- RemoveFromVector(Blocks, BB);
- }
-
- /// verifyLoop - Verify loop structure
- void verifyLoop() const {
-#ifndef NDEBUG
- assert (getHeader() && "Loop header is missing");
- assert (getLoopPreheader() && "Loop preheader is missing");
- assert (getLoopLatch() && "Loop latch is missing");
- for (typename std::vector<LoopBase<BlockT>*>::const_iterator I =
- SubLoops.begin(), E = SubLoops.end(); I != E; ++I)
- (*I)->verifyLoop();
-#endif
- }
-
- void print(std::ostream &OS, unsigned Depth = 0) const {
- OS << std::string(Depth*2, ' ') << "Loop Containing: ";
-
- for (unsigned i = 0; i < getBlocks().size(); ++i) {
- if (i) OS << ",";
- WriteAsOperand(OS, getBlocks()[i], false);
- }
- OS << "\n";
-
- for (iterator I = begin(), E = end(); I != E; ++I)
- (*I)->print(OS, Depth+2);
- }
-
- void print(std::ostream *O, unsigned Depth = 0) const {
- if (O) print(*O, Depth);
- }
-
- void dump() const {
- print(cerr);
- }
-
-private:
- friend class LoopInfoBase<BlockT>;
- LoopBase(BlockT *BB) : ParentLoop(0) {
- Blocks.push_back(BB);
- }
-};
-
-
-//===----------------------------------------------------------------------===//
-/// LoopInfo - This class builds and contains all of the top level loop
-/// structures in the specified function.
-///
-
-template<class BlockT>
-class LoopInfoBase {
- // BBMap - Mapping of basic blocks to the inner most loop they occur in
- std::map<BlockT*, LoopBase<BlockT>*> BBMap;
- std::vector<LoopBase<BlockT>*> TopLevelLoops;
- friend class LoopBase<BlockT>;
-
-public:
- LoopInfoBase() { }
- ~LoopInfoBase() { releaseMemory(); }
-
- void releaseMemory() {
- for (typename std::vector<LoopBase<BlockT>* >::iterator I =
- TopLevelLoops.begin(), E = TopLevelLoops.end(); I != E; ++I)
- delete *I; // Delete all of the loops...
-
- BBMap.clear(); // Reset internal state of analysis
- TopLevelLoops.clear();
- }
-
- /// iterator/begin/end - The interface to the top-level loops in the current
- /// function.
- ///
- typedef typename std::vector<LoopBase<BlockT>*>::const_iterator iterator;
- iterator begin() const { return TopLevelLoops.begin(); }
- iterator end() const { return TopLevelLoops.end(); }
-
- /// getLoopFor - Return the inner most loop that BB lives in. If a basic
- /// block is in no loop (for example the entry node), null is returned.
- ///
- LoopBase<BlockT> *getLoopFor(const BlockT *BB) const {
- typename std::map<BlockT *, LoopBase<BlockT>*>::const_iterator I=
- BBMap.find(const_cast<BlockT*>(BB));
- return I != BBMap.end() ? I->second : 0;
- }
-
- /// operator[] - same as getLoopFor...
- ///
- const LoopBase<BlockT> *operator[](const BlockT *BB) const {
- return getLoopFor(BB);
- }
-
- /// getLoopDepth - Return the loop nesting level of the specified block. A
- /// depth of 0 means the block is not inside any loop.
- ///
- unsigned getLoopDepth(const BlockT *BB) const {
- const LoopBase<BlockT> *L = getLoopFor(BB);
- return L ? L->getLoopDepth() : 0;
- }
-
- // isLoopHeader - True if the block is a loop header node
- bool isLoopHeader(BlockT *BB) const {
- const LoopBase<BlockT> *L = getLoopFor(BB);
- return L && L->getHeader() == BB;
- }
-
- /// removeLoop - This removes the specified top-level loop from this loop info
- /// object. The loop is not deleted, as it will presumably be inserted into
- /// another loop.
- LoopBase<BlockT> *removeLoop(iterator I) {
- assert(I != end() && "Cannot remove end iterator!");
- LoopBase<BlockT> *L = *I;
- assert(L->getParentLoop() == 0 && "Not a top-level loop!");
- TopLevelLoops.erase(TopLevelLoops.begin() + (I-begin()));
- return L;
- }
-
- /// changeLoopFor - Change the top-level loop that contains BB to the
- /// specified loop. This should be used by transformations that restructure
- /// the loop hierarchy tree.
- void changeLoopFor(BlockT *BB, LoopBase<BlockT> *L) {
- LoopBase<BlockT> *&OldLoop = BBMap[BB];
- assert(OldLoop && "Block not in a loop yet!");
- OldLoop = L;
- }
-
- /// changeTopLevelLoop - Replace the specified loop in the top-level loops
- /// list with the indicated loop.
- void changeTopLevelLoop(LoopBase<BlockT> *OldLoop,
- LoopBase<BlockT> *NewLoop) {
- typename std::vector<LoopBase<BlockT>*>::iterator I =
- std::find(TopLevelLoops.begin(), TopLevelLoops.end(), OldLoop);
- assert(I != TopLevelLoops.end() && "Old loop not at top level!");
- *I = NewLoop;
- assert(NewLoop->ParentLoop == 0 && OldLoop->ParentLoop == 0 &&
- "Loops already embedded into a subloop!");
- }
-
- /// addTopLevelLoop - This adds the specified loop to the collection of
- /// top-level loops.
- void addTopLevelLoop(LoopBase<BlockT> *New) {
- assert(New->getParentLoop() == 0 && "Loop already in subloop!");
- TopLevelLoops.push_back(New);
- }
-
- /// removeBlock - This method completely removes BB from all data structures,
- /// including all of the Loop objects it is nested in and our mapping from
- /// BasicBlocks to loops.
- void removeBlock(BlockT *BB) {
- typename std::map<BlockT *, LoopBase<BlockT>*>::iterator I = BBMap.find(BB);
- if (I != BBMap.end()) {
- for (LoopBase<BlockT> *L = I->second; L; L = L->getParentLoop())
- L->removeBlockFromLoop(BB);
-
- BBMap.erase(I);
- }
- }
-
- // Internals
-
- static bool isNotAlreadyContainedIn(LoopBase<BlockT> *SubLoop,
- LoopBase<BlockT> *ParentLoop) {
- if (SubLoop == 0) return true;
- if (SubLoop == ParentLoop) return false;
- return isNotAlreadyContainedIn(SubLoop->getParentLoop(), ParentLoop);
- }
-
- void Calculate(DominatorTreeBase<BlockT> &DT) {
- BlockT *RootNode = DT.getRootNode()->getBlock();
-
- for (df_iterator<BlockT*> NI = df_begin(RootNode),
- NE = df_end(RootNode); NI != NE; ++NI)
- if (LoopBase<BlockT> *L = ConsiderForLoop(*NI, DT))
- TopLevelLoops.push_back(L);
- }
-
- LoopBase<BlockT> *ConsiderForLoop(BlockT *BB, DominatorTreeBase<BlockT> &DT) {
- if (BBMap.find(BB) != BBMap.end()) return 0;// Haven't processed this node?
-
- std::vector<BlockT *> TodoStack;
-
- // Scan the predecessors of BB, checking to see if BB dominates any of
- // them. This identifies backedges which target this node...
- typedef GraphTraits<Inverse<BlockT*> > InvBlockTraits;
- for (typename InvBlockTraits::ChildIteratorType I =
- InvBlockTraits::child_begin(BB), E = InvBlockTraits::child_end(BB);
- I != E; ++I)
- if (DT.dominates(BB, *I)) // If BB dominates it's predecessor...
- TodoStack.push_back(*I);
-
- if (TodoStack.empty()) return 0; // No backedges to this block...
-
- // Create a new loop to represent this basic block...
- LoopBase<BlockT> *L = new LoopBase<BlockT>(BB);
- BBMap[BB] = L;
-
- BlockT *EntryBlock = BB->getParent()->begin();
-
- while (!TodoStack.empty()) { // Process all the nodes in the loop
- BlockT *X = TodoStack.back();
- TodoStack.pop_back();
-
- if (!L->contains(X) && // As of yet unprocessed??
- DT.dominates(EntryBlock, X)) { // X is reachable from entry block?
- // Check to see if this block already belongs to a loop. If this occurs
- // then we have a case where a loop that is supposed to be a child of
- // the current loop was processed before the current loop. When this
- // occurs, this child loop gets added to a part of the current loop,
- // making it a sibling to the current loop. We have to reparent this
- // loop.
- if (LoopBase<BlockT> *SubLoop =
- const_cast<LoopBase<BlockT>*>(getLoopFor(X)))
- if (SubLoop->getHeader() == X && isNotAlreadyContainedIn(SubLoop, L)){
- // Remove the subloop from it's current parent...
- assert(SubLoop->ParentLoop && SubLoop->ParentLoop != L);
- LoopBase<BlockT> *SLP = SubLoop->ParentLoop; // SubLoopParent
- typename std::vector<LoopBase<BlockT>*>::iterator I =
- std::find(SLP->SubLoops.begin(), SLP->SubLoops.end(), SubLoop);
- assert(I != SLP->SubLoops.end() &&"SubLoop not a child of parent?");
- SLP->SubLoops.erase(I); // Remove from parent...
-
- // Add the subloop to THIS loop...
- SubLoop->ParentLoop = L;
- L->SubLoops.push_back(SubLoop);
- }
-
- // Normal case, add the block to our loop...
- L->Blocks.push_back(X);
-
- typedef GraphTraits<Inverse<BlockT*> > InvBlockTraits;
-
- // Add all of the predecessors of X to the end of the work stack...
- TodoStack.insert(TodoStack.end(), InvBlockTraits::child_begin(X),
- InvBlockTraits::child_end(X));
- }
- }
-
- // If there are any loops nested within this loop, create them now!
- for (typename std::vector<BlockT*>::iterator I = L->Blocks.begin(),
- E = L->Blocks.end(); I != E; ++I)
- if (LoopBase<BlockT> *NewLoop = ConsiderForLoop(*I, DT)) {
- L->SubLoops.push_back(NewLoop);
- NewLoop->ParentLoop = L;
- }
-
- // Add the basic blocks that comprise this loop to the BBMap so that this
- // loop can be found for them.
- //
- for (typename std::vector<BlockT*>::iterator I = L->Blocks.begin(),
- E = L->Blocks.end(); I != E; ++I) {
- typename std::map<BlockT*, LoopBase<BlockT>*>::iterator BBMI =
- BBMap.lower_bound(*I);
- if (BBMI == BBMap.end() || BBMI->first != *I) // Not in map yet...
- BBMap.insert(BBMI, std::make_pair(*I, L)); // Must be at this level
- }
-
- // Now that we have a list of all of the child loops of this loop, check to
- // see if any of them should actually be nested inside of each other. We
- // can accidentally pull loops our of their parents, so we must make sure to
- // organize the loop nests correctly now.
- {
- std::map<BlockT*, LoopBase<BlockT>*> ContainingLoops;
- for (unsigned i = 0; i != L->SubLoops.size(); ++i) {
- LoopBase<BlockT> *Child = L->SubLoops[i];
- assert(Child->getParentLoop() == L && "Not proper child loop?");
-
- if (LoopBase<BlockT> *ContainingLoop =
- ContainingLoops[Child->getHeader()]) {
- // If there is already a loop which contains this loop, move this loop
- // into the containing loop.
- MoveSiblingLoopInto(Child, ContainingLoop);
- --i; // The loop got removed from the SubLoops list.
- } else {
- // This is currently considered to be a top-level loop. Check to see
- // if any of the contained blocks are loop headers for subloops we
- // have already processed.
- for (unsigned b = 0, e = Child->Blocks.size(); b != e; ++b) {
- LoopBase<BlockT> *&BlockLoop = ContainingLoops[Child->Blocks[b]];
- if (BlockLoop == 0) { // Child block not processed yet...
- BlockLoop = Child;
- } else if (BlockLoop != Child) {
- LoopBase<BlockT> *SubLoop = BlockLoop;
- // Reparent all of the blocks which used to belong to BlockLoops
- for (unsigned j = 0, e = SubLoop->Blocks.size(); j != e; ++j)
- ContainingLoops[SubLoop->Blocks[j]] = Child;
-
- // There is already a loop which contains this block, that means
- // that we should reparent the loop which the block is currently
- // considered to belong to to be a child of this loop.
- MoveSiblingLoopInto(SubLoop, Child);
- --i; // We just shrunk the SubLoops list.
- }
- }
- }
- }
- }
-
- return L;
- }
-
- /// MoveSiblingLoopInto - This method moves the NewChild loop to live inside
- /// of the NewParent Loop, instead of being a sibling of it.
- void MoveSiblingLoopInto(LoopBase<BlockT> *NewChild,
- LoopBase<BlockT> *NewParent) {
- LoopBase<BlockT> *OldParent = NewChild->getParentLoop();
- assert(OldParent && OldParent == NewParent->getParentLoop() &&
- NewChild != NewParent && "Not sibling loops!");
-
- // Remove NewChild from being a child of OldParent
- typename std::vector<LoopBase<BlockT>*>::iterator I =
- std::find(OldParent->SubLoops.begin(), OldParent->SubLoops.end(),
- NewChild);
- assert(I != OldParent->SubLoops.end() && "Parent fields incorrect??");
- OldParent->SubLoops.erase(I); // Remove from parent's subloops list
- NewChild->ParentLoop = 0;
-
- InsertLoopInto(NewChild, NewParent);
- }
-
- /// InsertLoopInto - This inserts loop L into the specified parent loop. If
- /// the parent loop contains a loop which should contain L, the loop gets
- /// inserted into L instead.
- void InsertLoopInto(LoopBase<BlockT> *L, LoopBase<BlockT> *Parent) {
- BlockT *LHeader = L->getHeader();
- assert(Parent->contains(LHeader) &&
- "This loop should not be inserted here!");
-
- // Check to see if it belongs in a child loop...
- for (unsigned i = 0, e = static_cast<unsigned>(Parent->SubLoops.size());
- i != e; ++i)
- if (Parent->SubLoops[i]->contains(LHeader)) {
- InsertLoopInto(L, Parent->SubLoops[i]);
- return;
- }
-
- // If not, insert it here!
- Parent->SubLoops.push_back(L);
- L->ParentLoop = Parent;
- }
-
- // Debugging
-
- void print(std::ostream &OS, const Module* ) const {
- for (unsigned i = 0; i < TopLevelLoops.size(); ++i)
- TopLevelLoops[i]->print(OS);
- #if 0
- for (std::map<BasicBlock*, Loop*>::const_iterator I = BBMap.begin(),
- E = BBMap.end(); I != E; ++I)
- OS << "BB '" << I->first->getName() << "' level = "
- << I->second->getLoopDepth() << "\n";
- #endif
- }
-};
-
-class LoopInfo : public FunctionPass {
- LoopInfoBase<BasicBlock>* LI;
- friend class LoopBase<BasicBlock>;
-
-public:
- static char ID; // Pass identification, replacement for typeid
-
- LoopInfo() : FunctionPass(intptr_t(&ID)) {
- LI = new LoopInfoBase<BasicBlock>();
- }
-
- ~LoopInfo() { delete LI; }
-
- LoopInfoBase<BasicBlock>& getBase() { return *LI; }
-
- /// iterator/begin/end - The interface to the top-level loops in the current
- /// function.
- ///
- typedef std::vector<Loop*>::const_iterator iterator;
- inline iterator begin() const { return LI->begin(); }
- inline iterator end() const { return LI->end(); }
-
- /// getLoopFor - Return the inner most loop that BB lives in. If a basic
- /// block is in no loop (for example the entry node), null is returned.
- ///
- inline Loop *getLoopFor(const BasicBlock *BB) const {
- return LI->getLoopFor(BB);
- }
-
- /// operator[] - same as getLoopFor...
- ///
- inline const Loop *operator[](const BasicBlock *BB) const {
- return LI->getLoopFor(BB);
- }
-
- /// getLoopDepth - Return the loop nesting level of the specified block. A
- /// depth of 0 means the block is not inside any loop.
- ///
- inline unsigned getLoopDepth(const BasicBlock *BB) const {
- return LI->getLoopDepth(BB);
- }
-
- // isLoopHeader - True if the block is a loop header node
- inline bool isLoopHeader(BasicBlock *BB) const {
- return LI->isLoopHeader(BB);
- }
-
- /// runOnFunction - Calculate the natural loop information.
- ///
- virtual bool runOnFunction(Function &F);
-
- virtual void releaseMemory() { LI->releaseMemory(); }
-
- virtual void print(std::ostream &O, const Module* M = 0) const {
- if (O) LI->print(O, M);
- }
-
- virtual void getAnalysisUsage(AnalysisUsage &AU) const;
-
- /// removeLoop - This removes the specified top-level loop from this loop info
- /// object. The loop is not deleted, as it will presumably be inserted into
- /// another loop.
- inline Loop *removeLoop(iterator I) { return LI->removeLoop(I); }
-
- /// changeLoopFor - Change the top-level loop that contains BB to the
- /// specified loop. This should be used by transformations that restructure
- /// the loop hierarchy tree.
- inline void changeLoopFor(BasicBlock *BB, Loop *L) {
- LI->changeLoopFor(BB, L);
- }
-
- /// changeTopLevelLoop - Replace the specified loop in the top-level loops
- /// list with the indicated loop.
- inline void changeTopLevelLoop(Loop *OldLoop, Loop *NewLoop) {
- LI->changeTopLevelLoop(OldLoop, NewLoop);
- }
-
- /// addTopLevelLoop - This adds the specified loop to the collection of
- /// top-level loops.
- inline void addTopLevelLoop(Loop *New) {
- LI->addTopLevelLoop(New);
- }
-
- /// removeBlock - This method completely removes BB from all data structures,
- /// including all of the Loop objects it is nested in and our mapping from
- /// BasicBlocks to loops.
- void removeBlock(BasicBlock *BB) {
- LI->removeBlock(BB);
- }
-};
-
-
-// Allow clients to walk the list of nested loops...
-template <> struct GraphTraits<const Loop*> {
- typedef const Loop NodeType;
- typedef std::vector<Loop*>::const_iterator ChildIteratorType;
-
- static NodeType *getEntryNode(const Loop *L) { return L; }
- static inline ChildIteratorType child_begin(NodeType *N) {
- return N->begin();
- }
- static inline ChildIteratorType child_end(NodeType *N) {
- return N->end();
- }
-};
-
-template <> struct GraphTraits<Loop*> {
- typedef Loop NodeType;
- typedef std::vector<Loop*>::const_iterator ChildIteratorType;
-
- static NodeType *getEntryNode(Loop *L) { return L; }
- static inline ChildIteratorType child_begin(NodeType *N) {
- return N->begin();
- }
- static inline ChildIteratorType child_end(NodeType *N) {
- return N->end();
- }
-};
-
-template<class BlockT>
-void LoopBase<BlockT>::addBasicBlockToLoop(BlockT *NewBB,
- LoopInfoBase<BlockT> &LIB) {
- assert((Blocks.empty() || LIB[getHeader()] == this) &&
- "Incorrect LI specified for this loop!");
- assert(NewBB && "Cannot add a null basic block to the loop!");
- assert(LIB[NewBB] == 0 && "BasicBlock already in the loop!");
-
- // Add the loop mapping to the LoopInfo object...
- LIB.BBMap[NewBB] = this;
-
- // Add the basic block to this loop and all parent loops...
- LoopBase<BlockT> *L = this;
- while (L) {
- L->Blocks.push_back(NewBB);
- L = L->getParentLoop();
- }
-}
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/Analysis/LoopPass.h b/release_23/include/llvm/Analysis/LoopPass.h
deleted file mode 100644
index c0cdce2f1a5f..000000000000
--- a/release_23/include/llvm/Analysis/LoopPass.h
+++ /dev/null
@@ -1,157 +0,0 @@
-//===- LoopPass.h - LoopPass class ----------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines LoopPass class. All loop optimization
-// and transformation passes are derived from LoopPass.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_LOOP_PASS_H
-#define LLVM_LOOP_PASS_H
-
-#include "llvm/Analysis/LoopInfo.h"
-#include "llvm/Pass.h"
-#include "llvm/PassManagers.h"
-#include "llvm/Function.h"
-
-namespace llvm {
-
-class LPPassManager;
-class Function;
-class PMStack;
-
-class LoopPass : public Pass {
-
- public:
- explicit LoopPass(intptr_t pid) : Pass(pid) {}
-
- // runOnLoop - This method should be implemented by the subclass to perform
- // whatever action is necessary for the specfied Loop.
- virtual bool runOnLoop (Loop *L, LPPassManager &LPM) = 0;
- virtual bool runOnFunctionBody (Function &F, LPPassManager &LPM) {
- return false;
- }
-
- // Initialization and finalization hooks.
- virtual bool doInitialization(Loop *L, LPPassManager &LPM) {
- return false;
- }
-
- // Finalization hook does not supply Loop because at this time
- // loop nest is completely different.
- virtual bool doFinalization() { return false; }
-
- // Check if this pass is suitable for the current LPPassManager, if
- // available. This pass P is not suitable for a LPPassManager if P
- // is not preserving higher level analysis info used by other
- // LPPassManager passes. In such case, pop LPPassManager from the
- // stack. This will force assignPassManager() to create new
- // LPPassManger as expected.
- void preparePassManager(PMStack &PMS);
-
- /// Assign pass manager to manager this pass
- virtual void assignPassManager(PMStack &PMS,
- PassManagerType PMT = PMT_LoopPassManager);
-
- /// Return what kind of Pass Manager can manage this pass.
- virtual PassManagerType getPotentialPassManagerType() const {
- return PMT_LoopPassManager;
- }
-
- //===--------------------------------------------------------------------===//
- /// SimpleAnalysis - Provides simple interface to update analysis info
- /// maintained by various passes. Note, if required this interface can
- /// be extracted into a separate abstract class but it would require
- /// additional use of multiple inheritance in Pass class hierarcy, someting
- /// we are trying to avoid.
-
- /// Each loop pass can override these simple analysis hookss to update
- /// desired analysis information.
- /// cloneBasicBlockAnalysis - Clone analysis info associated with basic block.
- virtual void cloneBasicBlockAnalysis(BasicBlock *F, BasicBlock *T, Loop *L) {}
-
- /// deletekAnalysisValue - Delete analysis info associated with value V.
- virtual void deleteAnalysisValue(Value *V, Loop *L) {}
-};
-
-class LPPassManager : public FunctionPass, public PMDataManager {
-
-public:
- static char ID;
- explicit LPPassManager(int Depth);
-
- /// run - Execute all of the passes scheduled for execution. Keep track of
- /// whether any of the passes modifies the module, and if so, return true.
- bool runOnFunction(Function &F);
-
- /// Pass Manager itself does not invalidate any analysis info.
- // LPPassManager needs LoopInfo.
- void getAnalysisUsage(AnalysisUsage &Info) const;
-
- virtual const char *getPassName() const {
- return "Loop Pass Manager";
- }
-
- // Print passes managed by this manager
- void dumpPassStructure(unsigned Offset) {
- llvm::cerr << std::string(Offset*2, ' ') << "Loop Pass Manager\n";
- for (unsigned Index = 0; Index < getNumContainedPasses(); ++Index) {
- Pass *P = getContainedPass(Index);
- P->dumpPassStructure(Offset + 1);
- dumpLastUses(P, Offset+1);
- }
- }
-
- Pass *getContainedPass(unsigned N) {
- assert ( N < PassVector.size() && "Pass number out of range!");
- Pass *FP = static_cast<Pass *>(PassVector[N]);
- return FP;
- }
-
- virtual PassManagerType getPassManagerType() const {
- return PMT_LoopPassManager;
- }
-
-public:
- // Delete loop from the loop queue and loop nest (LoopInfo).
- void deleteLoopFromQueue(Loop *L);
-
- // Inset loop into the loop nest(LoopInfo) and loop queue(LQ).
- void insertLoop(Loop *L, Loop *ParentLoop);
-
- // Reoptimize this loop. LPPassManager will re-insert this loop into the
- // queue. This allows LoopPass to change loop nest for the loop. This
- // utility may send LPPassManager into infinite loops so use caution.
- void redoLoop(Loop *L);
-
- //===--------------------------------------------------------------------===//
- /// SimpleAnalysis - Provides simple interface to update analysis info
- /// maintained by various passes. Note, if required this interface can
- /// be extracted into a separate abstract class but it would require
- /// additional use of multiple inheritance in Pass class hierarcy, someting
- /// we are trying to avoid.
-
- /// cloneBasicBlockSimpleAnalysis - Invoke cloneBasicBlockAnalysis hook for
- /// all passes that implement simple analysis interface.
- void cloneBasicBlockSimpleAnalysis(BasicBlock *From, BasicBlock *To, Loop *L);
-
- /// deleteSimpleAnalysisValue - Invoke deleteAnalysisValue hook for all passes
- /// that implement simple analysis interface.
- void deleteSimpleAnalysisValue(Value *V, Loop *L);
-private:
- std::deque<Loop *> LQ;
- bool skipThisLoop;
- bool redoThisLoop;
- LoopInfo *LI;
- Loop *CurrentLoop;
-};
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/Analysis/MemoryDependenceAnalysis.h b/release_23/include/llvm/Analysis/MemoryDependenceAnalysis.h
deleted file mode 100644
index c6ef41ff2404..000000000000
--- a/release_23/include/llvm/Analysis/MemoryDependenceAnalysis.h
+++ /dev/null
@@ -1,117 +0,0 @@
-//===- llvm/Analysis/MemoryDependenceAnalysis.h - Memory Deps --*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines an analysis that determines, for a given memory operation,
-// what preceding memory operations it depends on. It builds on alias analysis
-// information, and tries to provide a lazy, caching interface to a common kind
-// of alias information query.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_ANALYSIS_MEMORY_DEPENDENCE_H
-#define LLVM_ANALYSIS_MEMORY_DEPENDENCE_H
-
-#include "llvm/Pass.h"
-#include "llvm/Support/CallSite.h"
-#include "llvm/ADT/DenseMap.h"
-#include "llvm/ADT/SmallPtrSet.h"
-#include "llvm/Support/Compiler.h"
-
-namespace llvm {
-
-class Function;
-class FunctionPass;
-class Instruction;
-
-class MemoryDependenceAnalysis : public FunctionPass {
- private:
- // A map from instructions to their dependency, with a boolean
- // flags for whether this mapping is confirmed or not
- typedef DenseMap<Instruction*, std::pair<Instruction*, bool> >
- depMapType;
- depMapType depGraphLocal;
-
- // A map from instructions to their non-local dependencies.
- typedef DenseMap<Instruction*, DenseMap<BasicBlock*, Value*> >
- nonLocalDepMapType;
- nonLocalDepMapType depGraphNonLocal;
-
- // A reverse mapping form dependencies to the dependees. This is
- // used when removing instructions to keep the cache coherent.
- typedef DenseMap<Value*, SmallPtrSet<Instruction*, 4> >
- reverseDepMapType;
- reverseDepMapType reverseDep;
-
- // A reverse mapping form dependencies to the non-local dependees.
- reverseDepMapType reverseDepNonLocal;
-
- public:
- void ping(Instruction* D);
-
- // Special marker indicating that the query has no dependency
- // in the specified block.
- static Instruction* const NonLocal;
-
- // Special marker indicating that the query has no dependency at all
- static Instruction* const None;
-
-
- // Special marker indicating a dirty cache entry
- static Instruction* const Dirty;
-
- static char ID; // Class identification, replacement for typeinfo
- MemoryDependenceAnalysis() : FunctionPass((intptr_t)&ID) {}
-
- /// Pass Implementation stuff. This doesn't do any analysis.
- ///
- bool runOnFunction(Function &) {return false; }
-
- /// Clean up memory in between runs
- void releaseMemory() {
- depGraphLocal.clear();
- depGraphNonLocal.clear();
- reverseDep.clear();
- reverseDepNonLocal.clear();
- }
-
- /// getAnalysisUsage - Does not modify anything. It uses Value Numbering
- /// and Alias Analysis.
- ///
- virtual void getAnalysisUsage(AnalysisUsage &AU) const;
-
- /// getDependency - Return the instruction on which a memory operation
- /// depends, starting with start.
- Instruction* getDependency(Instruction* query, Instruction* start = 0,
- BasicBlock* block = 0);
-
- /// getNonLocalDependency - Fills the passed-in map with the non-local
- /// dependencies of the queries. The map will contain NonLocal for
- /// blocks between the query and its dependencies.
- void getNonLocalDependency(Instruction* query,
- DenseMap<BasicBlock*, Value*>& resp);
-
- /// removeInstruction - Remove an instruction from the dependence analysis,
- /// updating the dependence of instructions that previously depended on it.
- void removeInstruction(Instruction* rem);
-
- /// dropInstruction - Remove an instruction from the analysis, making
- /// absolutely conservative assumptions when updating the cache. This is
- /// useful, for example when an instruction is changed rather than removed.
- void dropInstruction(Instruction* drop);
-
- private:
- Instruction* getCallSiteDependency(CallSite C, Instruction* start,
- BasicBlock* block);
- void nonLocalHelper(Instruction* query, BasicBlock* block,
- DenseMap<BasicBlock*, Value*>& resp);
- };
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/Analysis/Passes.h b/release_23/include/llvm/Analysis/Passes.h
deleted file mode 100644
index 7843aea2aea1..000000000000
--- a/release_23/include/llvm/Analysis/Passes.h
+++ /dev/null
@@ -1,126 +0,0 @@
-//===-- llvm/Analysis/Passes.h - Constructors for analyses ------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This header file defines prototypes for accessor functions that expose passes
-// in the analysis libraries.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_ANALYSIS_PASSES_H
-#define LLVM_ANALYSIS_PASSES_H
-
-namespace llvm {
- class FunctionPass;
- class ImmutablePass;
- class ModulePass;
- class Pass;
- class LibCallInfo;
-
- //===--------------------------------------------------------------------===//
- //
- // createGlobalsModRefPass - This pass provides alias and mod/ref info for
- // global values that do not have their addresses taken.
- //
- Pass *createGlobalsModRefPass();
-
- //===--------------------------------------------------------------------===//
- //
- // createAliasDebugger - This pass helps debug clients of AA
- //
- Pass *createAliasDebugger();
-
- //===--------------------------------------------------------------------===//
- //
- // createAliasAnalysisCounterPass - This pass counts alias queries and how the
- // alias analysis implementation responds.
- //
- ModulePass *createAliasAnalysisCounterPass();
-
- //===--------------------------------------------------------------------===//
- //
- // createAAEvalPass - This pass implements a simple N^2 alias analysis
- // accuracy evaluator.
- //
- FunctionPass *createAAEvalPass();
-
- //===--------------------------------------------------------------------===//
- //
- // createNoAAPass - This pass implements a "I don't know" alias analysis.
- //
- ImmutablePass *createNoAAPass();
-
- //===--------------------------------------------------------------------===//
- //
- // createBasicAliasAnalysisPass - This pass implements the default alias
- // analysis.
- //
- ImmutablePass *createBasicAliasAnalysisPass();
-
- //===--------------------------------------------------------------------===//
- //
- /// createLibCallAliasAnalysisPass - Create an alias analysis pass that knows
- /// about the semantics of a set of libcalls specified by LCI. The newly
- /// constructed pass takes ownership of the pointer that is provided.
- ///
- FunctionPass *createLibCallAliasAnalysisPass(LibCallInfo *LCI);
-
- //===--------------------------------------------------------------------===//
- //
- // createAndersensPass - This pass implements Andersen's interprocedural alias
- // analysis.
- //
- ModulePass *createAndersensPass();
-
- //===--------------------------------------------------------------------===//
- //
- // createBasicVNPass - This pass walks SSA def-use chains to trivially
- // identify lexically identical expressions.
- //
- ImmutablePass *createBasicVNPass();
-
- //===--------------------------------------------------------------------===//
- //
- // createProfileLoaderPass - This pass loads information from a profile dump
- // file.
- //
- ModulePass *createProfileLoaderPass();
-
- //===--------------------------------------------------------------------===//
- //
- // createNoProfileInfoPass - This pass implements the default "no profile".
- //
- ImmutablePass *createNoProfileInfoPass();
-
- //===--------------------------------------------------------------------===//
- //
- // createDSAAPass - This pass implements simple context sensitive alias
- // analysis.
- //
- ModulePass *createDSAAPass();
-
- //===--------------------------------------------------------------------===//
- //
- // createDSOptPass - This pass uses DSA to do a series of simple
- // optimizations.
- //
- ModulePass *createDSOptPass();
-
- //===--------------------------------------------------------------------===//
- //
- // createSteensgaardPass - This pass uses the data structure graphs to do a
- // simple context insensitive alias analysis.
- //
- ModulePass *createSteensgaardPass();
-
- // Minor pass prototypes, allowing us to expose them through bugpoint and
- // analyze.
- FunctionPass *createInstCountPass();
-}
-
-#endif
diff --git a/release_23/include/llvm/Analysis/PostDominators.h b/release_23/include/llvm/Analysis/PostDominators.h
deleted file mode 100644
index 51b3e807d8b4..000000000000
--- a/release_23/include/llvm/Analysis/PostDominators.h
+++ /dev/null
@@ -1,95 +0,0 @@
-//=- llvm/Analysis/PostDominators.h - Post Dominator Calculation-*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file exposes interfaces to post dominance information.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_ANALYSIS_POST_DOMINATORS_H
-#define LLVM_ANALYSIS_POST_DOMINATORS_H
-
-#include "llvm/Analysis/Dominators.h"
-
-namespace llvm {
-
-/// PostDominatorTree Class - Concrete subclass of DominatorTree that is used to
-/// compute the a post-dominator tree.
-///
-struct PostDominatorTree : public FunctionPass {
- static char ID; // Pass identification, replacement for typeid
- DominatorTreeBase<BasicBlock>* DT;
-
- PostDominatorTree() : FunctionPass((intptr_t)&ID) {
- DT = new DominatorTreeBase<BasicBlock>(true);
- }
-
- ~PostDominatorTree();
-
- virtual bool runOnFunction(Function &F);
-
- virtual void getAnalysisUsage(AnalysisUsage &AU) const {
- AU.setPreservesAll();
- }
-
- inline const std::vector<BasicBlock*> &getRoots() const {
- return DT->getRoots();
- }
-
- inline DomTreeNode *getRootNode() const {
- return DT->getRootNode();
- }
-
- inline DomTreeNode *operator[](BasicBlock *BB) const {
- return DT->getNode(BB);
- }
-
- inline bool properlyDominates(const DomTreeNode* A, DomTreeNode* B) const {
- return DT->properlyDominates(A, B);
- }
-
- inline bool properlyDominates(BasicBlock* A, BasicBlock* B) const {
- return DT->properlyDominates(A, B);
- }
-
- virtual void print(std::ostream &OS, const Module* M= 0) const {
- DT->print(OS, M);
- }
-};
-
-
-/// PostDominanceFrontier Class - Concrete subclass of DominanceFrontier that is
-/// used to compute the a post-dominance frontier.
-///
-struct PostDominanceFrontier : public DominanceFrontierBase {
- static char ID;
- PostDominanceFrontier()
- : DominanceFrontierBase((intptr_t) &ID, true) {}
-
- virtual bool runOnFunction(Function &) {
- Frontiers.clear();
- PostDominatorTree &DT = getAnalysis<PostDominatorTree>();
- Roots = DT.getRoots();
- if (const DomTreeNode *Root = DT.getRootNode())
- calculate(DT, Root);
- return false;
- }
-
- virtual void getAnalysisUsage(AnalysisUsage &AU) const {
- AU.setPreservesAll();
- AU.addRequired<PostDominatorTree>();
- }
-
-private:
- const DomSetType &calculate(const PostDominatorTree &DT,
- const DomTreeNode *Node);
-};
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/Analysis/ProfileInfo.h b/release_23/include/llvm/Analysis/ProfileInfo.h
deleted file mode 100644
index ff83f97ee042..000000000000
--- a/release_23/include/llvm/Analysis/ProfileInfo.h
+++ /dev/null
@@ -1,67 +0,0 @@
-//===- llvm/Analysis/ProfileInfo.h - Profile Info Interface -----*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines the generic ProfileInfo interface, which is used as the
-// common interface used by all clients of profiling information, and
-// implemented either by making static guestimations, or by actually reading in
-// profiling information gathered by running the program.
-//
-// Note that to be useful, all profile-based optimizations should preserve
-// ProfileInfo, which requires that they notify it when changes to the CFG are
-// made.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_ANALYSIS_PROFILEINFO_H
-#define LLVM_ANALYSIS_PROFILEINFO_H
-
-#include <string>
-#include <map>
-
-namespace llvm {
- class BasicBlock;
- class Pass;
-
- /// ProfileInfo Class - This class holds and maintains edge profiling
- /// information for some unit of code.
- class ProfileInfo {
- protected:
- // EdgeCounts - Count the number of times a transition between two blocks is
- // executed. As a special case, we also hold an edge from the null
- // BasicBlock to the entry block to indicate how many times the function was
- // entered.
- std::map<std::pair<BasicBlock*, BasicBlock*>, unsigned> EdgeCounts;
- public:
- static char ID; // Class identification, replacement for typeinfo
- virtual ~ProfileInfo(); // We want to be subclassed
-
- //===------------------------------------------------------------------===//
- /// Profile Information Queries
- ///
- unsigned getExecutionCount(BasicBlock *BB) const;
-
- unsigned getEdgeWeight(BasicBlock *Src, BasicBlock *Dest) const {
- std::map<std::pair<BasicBlock*, BasicBlock*>, unsigned>::const_iterator I=
- EdgeCounts.find(std::make_pair(Src, Dest));
- return I != EdgeCounts.end() ? I->second : 0;
- }
-
- //===------------------------------------------------------------------===//
- /// Analysis Update Methods
- ///
-
- };
-
- /// createProfileLoaderPass - This function returns a Pass that loads the
- /// profiling information for the module from the specified filename, making
- /// it available to the optimizers.
- Pass *createProfileLoaderPass(const std::string &Filename);
-} // End llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/Analysis/ProfileInfoLoader.h b/release_23/include/llvm/Analysis/ProfileInfoLoader.h
deleted file mode 100644
index 8a5141ab2352..000000000000
--- a/release_23/include/llvm/Analysis/ProfileInfoLoader.h
+++ /dev/null
@@ -1,89 +0,0 @@
-//===- ProfileInfoLoader.h - Load & convert profile information -*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// The ProfileInfoLoader class is used to load and represent profiling
-// information read in from the dump file. If conversions between formats are
-// needed, it can also do this.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_ANALYSIS_PROFILEINFOLOADER_H
-#define LLVM_ANALYSIS_PROFILEINFOLOADER_H
-
-#include <vector>
-#include <string>
-#include <utility>
-
-namespace llvm {
-
-class Module;
-class Function;
-class BasicBlock;
-
-class ProfileInfoLoader {
- Module &M;
- std::vector<std::string> CommandLines;
- std::vector<unsigned> FunctionCounts;
- std::vector<unsigned> BlockCounts;
- std::vector<unsigned> EdgeCounts;
- std::vector<unsigned> BBTrace;
-public:
- // ProfileInfoLoader ctor - Read the specified profiling data file, exiting
- // the program if the file is invalid or broken.
- ProfileInfoLoader(const char *ToolName, const std::string &Filename,
- Module &M);
-
- unsigned getNumExecutions() const { return CommandLines.size(); }
- const std::string &getExecution(unsigned i) const { return CommandLines[i]; }
-
- // getFunctionCounts - This method is used by consumers of function counting
- // information. If we do not directly have function count information, we
- // compute it from other, more refined, types of profile information.
- //
- void getFunctionCounts(std::vector<std::pair<Function*, unsigned> > &Counts);
-
- // hasAccurateBlockCounts - Return true if we can synthesize accurate block
- // frequency information from whatever we have.
- //
- bool hasAccurateBlockCounts() const {
- return !BlockCounts.empty() || !EdgeCounts.empty();
- }
-
- // hasAccurateEdgeCounts - Return true if we can synthesize accurate edge
- // frequency information from whatever we have.
- //
- bool hasAccurateEdgeCounts() const {
- return !EdgeCounts.empty();
- }
-
- // getBlockCounts - This method is used by consumers of block counting
- // information. If we do not directly have block count information, we
- // compute it from other, more refined, types of profile information.
- //
- void getBlockCounts(std::vector<std::pair<BasicBlock*, unsigned> > &Counts);
-
- // getEdgeCounts - This method is used by consumers of edge counting
- // information. If we do not directly have edge count information, we compute
- // it from other, more refined, types of profile information.
- //
- // Edges are represented as a pair, where the first element is the basic block
- // and the second element is the successor number.
- //
- typedef std::pair<BasicBlock*, unsigned> Edge;
- void getEdgeCounts(std::vector<std::pair<Edge, unsigned> > &Counts);
-
- // getBBTrace - This method is used by consumers of basic-block trace
- // information.
- //
- void getBBTrace(std::vector<BasicBlock *> &Trace);
-};
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/Analysis/ProfileInfoTypes.h b/release_23/include/llvm/Analysis/ProfileInfoTypes.h
deleted file mode 100644
index f311f8cb90c5..000000000000
--- a/release_23/include/llvm/Analysis/ProfileInfoTypes.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/*===-- ProfileInfoTypes.h - Profiling info shared constants ------*- C -*-===*\
-|*
-|* The LLVM Compiler Infrastructure
-|*
-|* This file is distributed under the University of Illinois Open Source
-|* License. See LICENSE.TXT for details.
-|*
-|*===----------------------------------------------------------------------===*|
-|*
-|* This file defines constants shared by the various different profiling
-|* runtime libraries and the LLVM C++ profile info loader. It must be a
-|* C header because, at present, the profiling runtimes are written in C.
-|*
-\*===----------------------------------------------------------------------===*/
-
-#ifndef LLVM_ANALYSIS_PROFILEINFOTYPES_H
-#define LLVM_ANALYSIS_PROFILEINFOTYPES_H
-
-enum ProfilingType {
- ArgumentInfo = 1, /* The command line argument block */
- FunctionInfo = 2, /* Function profiling information */
- BlockInfo = 3, /* Block profiling information */
- EdgeInfo = 4, /* Edge profiling information */
- PathInfo = 5, /* Path profiling information */
- BBTraceInfo = 6 /* Basic block trace information */
-};
-
-#endif /* LLVM_ANALYSIS_PROFILEINFOTYPES_H */
diff --git a/release_23/include/llvm/Analysis/ScalarEvolution.h b/release_23/include/llvm/Analysis/ScalarEvolution.h
deleted file mode 100644
index 4d9d5e5fc044..000000000000
--- a/release_23/include/llvm/Analysis/ScalarEvolution.h
+++ /dev/null
@@ -1,304 +0,0 @@
-//===- llvm/Analysis/ScalarEvolution.h - Scalar Evolution -------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// The ScalarEvolution class is an LLVM pass which can be used to analyze and
-// catagorize scalar expressions in loops. It specializes in recognizing
-// general induction variables, representing them with the abstract and opaque
-// SCEV class. Given this analysis, trip counts of loops and other important
-// properties can be obtained.
-//
-// This analysis is primarily useful for induction variable substitution and
-// strength reduction.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_ANALYSIS_SCALAREVOLUTION_H
-#define LLVM_ANALYSIS_SCALAREVOLUTION_H
-
-#include "llvm/Pass.h"
-#include "llvm/Analysis/LoopInfo.h"
-#include "llvm/Support/DataTypes.h"
-#include "llvm/Support/Streams.h"
-#include <set>
-
-namespace llvm {
- class APInt;
- class ConstantInt;
- class Instruction;
- class Type;
- class ConstantRange;
- class SCEVHandle;
- class ScalarEvolution;
-
- /// SCEV - This class represent an analyzed expression in the program. These
- /// are reference counted opaque objects that the client is not allowed to
- /// do much with directly.
- ///
- class SCEV {
- const unsigned SCEVType; // The SCEV baseclass this node corresponds to
- mutable unsigned RefCount;
-
- friend class SCEVHandle;
- void addRef() const { ++RefCount; }
- void dropRef() const {
- if (--RefCount == 0)
- delete this;
- }
-
- SCEV(const SCEV &); // DO NOT IMPLEMENT
- void operator=(const SCEV &); // DO NOT IMPLEMENT
- protected:
- virtual ~SCEV();
- public:
- explicit SCEV(unsigned SCEVTy) : SCEVType(SCEVTy), RefCount(0) {}
-
- unsigned getSCEVType() const { return SCEVType; }
-
- /// getValueRange - Return the tightest constant bounds that this value is
- /// known to have. This method is only valid on integer SCEV objects.
- virtual ConstantRange getValueRange() const;
-
- /// isLoopInvariant - Return true if the value of this SCEV is unchanging in
- /// the specified loop.
- virtual bool isLoopInvariant(const Loop *L) const = 0;
-
- /// hasComputableLoopEvolution - Return true if this SCEV changes value in a
- /// known way in the specified loop. This property being true implies that
- /// the value is variant in the loop AND that we can emit an expression to
- /// compute the value of the expression at any particular loop iteration.
- virtual bool hasComputableLoopEvolution(const Loop *L) const = 0;
-
- /// getType - Return the LLVM type of this SCEV expression.
- ///
- virtual const Type *getType() const = 0;
-
- /// getBitWidth - Get the bit width of the type, if it has one, 0 otherwise.
- ///
- uint32_t getBitWidth() const;
-
- /// replaceSymbolicValuesWithConcrete - If this SCEV internally references
- /// the symbolic value "Sym", construct and return a new SCEV that produces
- /// the same value, but which uses the concrete value Conc instead of the
- /// symbolic value. If this SCEV does not use the symbolic value, it
- /// returns itself.
- virtual SCEVHandle
- replaceSymbolicValuesWithConcrete(const SCEVHandle &Sym,
- const SCEVHandle &Conc,
- ScalarEvolution &SE) const = 0;
-
- /// print - Print out the internal representation of this scalar to the
- /// specified stream. This should really only be used for debugging
- /// purposes.
- virtual void print(std::ostream &OS) const = 0;
- void print(std::ostream *OS) const { if (OS) print(*OS); }
-
- /// dump - This method is used for debugging.
- ///
- void dump() const;
- };
-
- inline std::ostream &operator<<(std::ostream &OS, const SCEV &S) {
- S.print(OS);
- return OS;
- }
-
- /// SCEVCouldNotCompute - An object of this class is returned by queries that
- /// could not be answered. For example, if you ask for the number of
- /// iterations of a linked-list traversal loop, you will get one of these.
- /// None of the standard SCEV operations are valid on this class, it is just a
- /// marker.
- struct SCEVCouldNotCompute : public SCEV {
- SCEVCouldNotCompute();
-
- // None of these methods are valid for this object.
- virtual bool isLoopInvariant(const Loop *L) const;
- virtual const Type *getType() const;
- virtual bool hasComputableLoopEvolution(const Loop *L) const;
- virtual void print(std::ostream &OS) const;
- void print(std::ostream *OS) const { if (OS) print(*OS); }
- virtual SCEVHandle
- replaceSymbolicValuesWithConcrete(const SCEVHandle &Sym,
- const SCEVHandle &Conc,
- ScalarEvolution &SE) const;
-
- /// Methods for support type inquiry through isa, cast, and dyn_cast:
- static inline bool classof(const SCEVCouldNotCompute *S) { return true; }
- static bool classof(const SCEV *S);
- };
-
- /// SCEVHandle - This class is used to maintain the SCEV object's refcounts,
- /// freeing the objects when the last reference is dropped.
- class SCEVHandle {
- SCEV *S;
- SCEVHandle(); // DO NOT IMPLEMENT
- public:
- SCEVHandle(const SCEV *s) : S(const_cast<SCEV*>(s)) {
- assert(S && "Cannot create a handle to a null SCEV!");
- S->addRef();
- }
- SCEVHandle(const SCEVHandle &RHS) : S(RHS.S) {
- S->addRef();
- }
- ~SCEVHandle() { S->dropRef(); }
-
- operator SCEV*() const { return S; }
-
- SCEV &operator*() const { return *S; }
- SCEV *operator->() const { return S; }
-
- bool operator==(SCEV *RHS) const { return S == RHS; }
- bool operator!=(SCEV *RHS) const { return S != RHS; }
-
- const SCEVHandle &operator=(SCEV *RHS) {
- if (S != RHS) {
- S->dropRef();
- S = RHS;
- S->addRef();
- }
- return *this;
- }
-
- const SCEVHandle &operator=(const SCEVHandle &RHS) {
- if (S != RHS.S) {
- S->dropRef();
- S = RHS.S;
- S->addRef();
- }
- return *this;
- }
- };
-
- template<typename From> struct simplify_type;
- template<> struct simplify_type<const SCEVHandle> {
- typedef SCEV* SimpleType;
- static SimpleType getSimplifiedValue(const SCEVHandle &Node) {
- return Node;
- }
- };
- template<> struct simplify_type<SCEVHandle>
- : public simplify_type<const SCEVHandle> {};
-
- /// ScalarEvolution - This class is the main scalar evolution driver. Because
- /// client code (intentionally) can't do much with the SCEV objects directly,
- /// they must ask this class for services.
- ///
- class ScalarEvolution : public FunctionPass {
- void *Impl; // ScalarEvolution uses the pimpl pattern
- public:
- static char ID; // Pass identification, replacement for typeid
- ScalarEvolution() : FunctionPass((intptr_t)&ID), Impl(0) {}
-
- /// getSCEV - Return a SCEV expression handle for the full generality of the
- /// specified expression.
- SCEVHandle getSCEV(Value *V) const;
-
- SCEVHandle getConstant(ConstantInt *V);
- SCEVHandle getConstant(const APInt& Val);
- SCEVHandle getTruncateExpr(const SCEVHandle &Op, const Type *Ty);
- SCEVHandle getZeroExtendExpr(const SCEVHandle &Op, const Type *Ty);
- SCEVHandle getSignExtendExpr(const SCEVHandle &Op, const Type *Ty);
- SCEVHandle getAddExpr(std::vector<SCEVHandle> &Ops);
- SCEVHandle getAddExpr(const SCEVHandle &LHS, const SCEVHandle &RHS) {
- std::vector<SCEVHandle> Ops;
- Ops.push_back(LHS);
- Ops.push_back(RHS);
- return getAddExpr(Ops);
- }
- SCEVHandle getAddExpr(const SCEVHandle &Op0, const SCEVHandle &Op1,
- const SCEVHandle &Op2) {
- std::vector<SCEVHandle> Ops;
- Ops.push_back(Op0);
- Ops.push_back(Op1);
- Ops.push_back(Op2);
- return getAddExpr(Ops);
- }
- SCEVHandle getMulExpr(std::vector<SCEVHandle> &Ops);
- SCEVHandle getMulExpr(const SCEVHandle &LHS, const SCEVHandle &RHS) {
- std::vector<SCEVHandle> Ops;
- Ops.push_back(LHS);
- Ops.push_back(RHS);
- return getMulExpr(Ops);
- }
- SCEVHandle getUDivExpr(const SCEVHandle &LHS, const SCEVHandle &RHS);
- SCEVHandle getAddRecExpr(const SCEVHandle &Start, const SCEVHandle &Step,
- const Loop *L);
- SCEVHandle getAddRecExpr(std::vector<SCEVHandle> &Operands,
- const Loop *L);
- SCEVHandle getAddRecExpr(const std::vector<SCEVHandle> &Operands,
- const Loop *L) {
- std::vector<SCEVHandle> NewOp(Operands);
- return getAddRecExpr(NewOp, L);
- }
- SCEVHandle getSMaxExpr(const SCEVHandle &LHS, const SCEVHandle &RHS);
- SCEVHandle getSMaxExpr(std::vector<SCEVHandle> Operands);
- SCEVHandle getUMaxExpr(const SCEVHandle &LHS, const SCEVHandle &RHS);
- SCEVHandle getUMaxExpr(std::vector<SCEVHandle> Operands);
- SCEVHandle getUnknown(Value *V);
-
- /// getNegativeSCEV - Return the SCEV object corresponding to -V.
- ///
- SCEVHandle getNegativeSCEV(const SCEVHandle &V);
-
- /// getNotSCEV - Return the SCEV object corresponding to ~V.
- ///
- SCEVHandle getNotSCEV(const SCEVHandle &V);
-
- /// getMinusSCEV - Return LHS-RHS.
- ///
- SCEVHandle getMinusSCEV(const SCEVHandle &LHS,
- const SCEVHandle &RHS);
-
- /// getIntegerSCEV - Given an integer or FP type, create a constant for the
- /// specified signed integer value and return a SCEV for the constant.
- SCEVHandle getIntegerSCEV(int Val, const Type *Ty);
-
- /// hasSCEV - Return true if the SCEV for this value has already been
- /// computed.
- bool hasSCEV(Value *V) const;
-
- /// setSCEV - Insert the specified SCEV into the map of current SCEVs for
- /// the specified value.
- void setSCEV(Value *V, const SCEVHandle &H);
-
- /// getSCEVAtScope - Return a SCEV expression handle for the specified value
- /// at the specified scope in the program. The L value specifies a loop
- /// nest to evaluate the expression at, where null is the top-level or a
- /// specified loop is immediately inside of the loop.
- ///
- /// This method can be used to compute the exit value for a variable defined
- /// in a loop by querying what the value will hold in the parent loop.
- ///
- /// If this value is not computable at this scope, a SCEVCouldNotCompute
- /// object is returned.
- SCEVHandle getSCEVAtScope(Value *V, const Loop *L) const;
-
- /// getIterationCount - If the specified loop has a predictable iteration
- /// count, return it, otherwise return a SCEVCouldNotCompute object.
- SCEVHandle getIterationCount(const Loop *L) const;
-
- /// hasLoopInvariantIterationCount - Return true if the specified loop has
- /// an analyzable loop-invariant iteration count.
- bool hasLoopInvariantIterationCount(const Loop *L) const;
-
- /// deleteValueFromRecords - This method should be called by the
- /// client before it removes a Value from the program, to make sure
- /// that no dangling references are left around.
- void deleteValueFromRecords(Value *V) const;
-
- virtual bool runOnFunction(Function &F);
- virtual void releaseMemory();
- virtual void getAnalysisUsage(AnalysisUsage &AU) const;
- virtual void print(std::ostream &OS, const Module* = 0) const;
- void print(std::ostream *OS, const Module* M = 0) const {
- if (OS) print(*OS, M);
- }
- };
-}
-
-#endif
diff --git a/release_23/include/llvm/Analysis/ScalarEvolutionExpander.h b/release_23/include/llvm/Analysis/ScalarEvolutionExpander.h
deleted file mode 100644
index 584e488f6427..000000000000
--- a/release_23/include/llvm/Analysis/ScalarEvolutionExpander.h
+++ /dev/null
@@ -1,148 +0,0 @@
-//===---- llvm/Analysis/ScalarEvolutionExpander.h - SCEV Exprs --*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines the classes used to generate code from scalar expressions.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_ANALYSIS_SCALAREVOLUTION_EXPANDER_H
-#define LLVM_ANALYSIS_SCALAREVOLUTION_EXPANDER_H
-
-#include "llvm/BasicBlock.h"
-#include "llvm/Constants.h"
-#include "llvm/Instructions.h"
-#include "llvm/Type.h"
-#include "llvm/Analysis/ScalarEvolution.h"
-#include "llvm/Analysis/ScalarEvolutionExpressions.h"
-#include "llvm/Support/CFG.h"
-
-namespace llvm {
- /// SCEVExpander - This class uses information about analyze scalars to
- /// rewrite expressions in canonical form.
- ///
- /// Clients should create an instance of this class when rewriting is needed,
- /// and destroy it when finished to allow the release of the associated
- /// memory.
- struct SCEVExpander : public SCEVVisitor<SCEVExpander, Value*> {
- ScalarEvolution &SE;
- LoopInfo &LI;
- std::map<SCEVHandle, Value*> InsertedExpressions;
- std::set<Instruction*> InsertedInstructions;
-
- Instruction *InsertPt;
-
- friend struct SCEVVisitor<SCEVExpander, Value*>;
- public:
- SCEVExpander(ScalarEvolution &se, LoopInfo &li) : SE(se), LI(li) {}
-
- LoopInfo &getLoopInfo() const { return LI; }
-
- /// clear - Erase the contents of the InsertedExpressions map so that users
- /// trying to expand the same expression into multiple BasicBlocks or
- /// different places within the same BasicBlock can do so.
- void clear() { InsertedExpressions.clear(); }
-
- /// isInsertedInstruction - Return true if the specified instruction was
- /// inserted by the code rewriter. If so, the client should not modify the
- /// instruction.
- bool isInsertedInstruction(Instruction *I) const {
- return InsertedInstructions.count(I);
- }
-
- /// getOrInsertCanonicalInductionVariable - This method returns the
- /// canonical induction variable of the specified type for the specified
- /// loop (inserting one if there is none). A canonical induction variable
- /// starts at zero and steps by one on each iteration.
- Value *getOrInsertCanonicalInductionVariable(const Loop *L, const Type *Ty){
- assert(Ty->isInteger() && "Can only insert integer induction variables!");
- SCEVHandle H = SE.getAddRecExpr(SE.getIntegerSCEV(0, Ty),
- SE.getIntegerSCEV(1, Ty), L);
- return expand(H);
- }
-
- /// addInsertedValue - Remember the specified instruction as being the
- /// canonical form for the specified SCEV.
- void addInsertedValue(Instruction *I, SCEV *S) {
- InsertedExpressions[S] = (Value*)I;
- InsertedInstructions.insert(I);
- }
-
- Instruction *getInsertionPoint() const { return InsertPt; }
-
- /// expandCodeFor - Insert code to directly compute the specified SCEV
- /// expression into the program. The inserted code is inserted into the
- /// specified block.
- Value *expandCodeFor(SCEVHandle SH, Instruction *IP) {
- // Expand the code for this SCEV.
- this->InsertPt = IP;
- return expand(SH);
- }
-
- /// InsertCastOfTo - Insert a cast of V to the specified type, doing what
- /// we can to share the casts.
- static Value *InsertCastOfTo(Instruction::CastOps opcode, Value *V,
- const Type *Ty);
- /// InsertBinop - Insert the specified binary operator, doing a small amount
- /// of work to avoid inserting an obviously redundant operation.
- static Value *InsertBinop(Instruction::BinaryOps Opcode, Value *LHS,
- Value *RHS, Instruction *&InsertPt);
- protected:
- Value *expand(SCEV *S);
-
- Value *visitConstant(SCEVConstant *S) {
- return S->getValue();
- }
-
- Value *visitTruncateExpr(SCEVTruncateExpr *S) {
- Value *V = expand(S->getOperand());
- return CastInst::createTruncOrBitCast(V, S->getType(), "tmp.", InsertPt);
- }
-
- Value *visitZeroExtendExpr(SCEVZeroExtendExpr *S) {
- Value *V = expand(S->getOperand());
- return CastInst::createZExtOrBitCast(V, S->getType(), "tmp.", InsertPt);
- }
-
- Value *visitSignExtendExpr(SCEVSignExtendExpr *S) {
- Value *V = expand(S->getOperand());
- return CastInst::createSExtOrBitCast(V, S->getType(), "tmp.", InsertPt);
- }
-
- Value *visitAddExpr(SCEVAddExpr *S) {
- Value *V = expand(S->getOperand(S->getNumOperands()-1));
-
- // Emit a bunch of add instructions
- for (int i = S->getNumOperands()-2; i >= 0; --i)
- V = InsertBinop(Instruction::Add, V, expand(S->getOperand(i)),
- InsertPt);
- return V;
- }
-
- Value *visitMulExpr(SCEVMulExpr *S);
-
- Value *visitUDivExpr(SCEVUDivExpr *S) {
- Value *LHS = expand(S->getLHS());
- Value *RHS = expand(S->getRHS());
- return InsertBinop(Instruction::UDiv, LHS, RHS, InsertPt);
- }
-
- Value *visitAddRecExpr(SCEVAddRecExpr *S);
-
- Value *visitSMaxExpr(SCEVSMaxExpr *S);
-
- Value *visitUMaxExpr(SCEVUMaxExpr *S);
-
- Value *visitUnknown(SCEVUnknown *S) {
- return S->getValue();
- }
- };
-}
-
-#endif
-
diff --git a/release_23/include/llvm/Analysis/ScalarEvolutionExpressions.h b/release_23/include/llvm/Analysis/ScalarEvolutionExpressions.h
deleted file mode 100644
index e077cfe2a0ff..000000000000
--- a/release_23/include/llvm/Analysis/ScalarEvolutionExpressions.h
+++ /dev/null
@@ -1,593 +0,0 @@
-//===- llvm/Analysis/ScalarEvolutionExpressions.h - SCEV Exprs --*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines the classes used to represent and build scalar expressions.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_ANALYSIS_SCALAREVOLUTION_EXPRESSIONS_H
-#define LLVM_ANALYSIS_SCALAREVOLUTION_EXPRESSIONS_H
-
-#include "llvm/Analysis/ScalarEvolution.h"
-
-namespace llvm {
- class ConstantInt;
- class ConstantRange;
- class APInt;
-
- enum SCEVTypes {
- // These should be ordered in terms of increasing complexity to make the
- // folders simpler.
- scConstant, scTruncate, scZeroExtend, scSignExtend, scAddExpr, scMulExpr,
- scUDivExpr, scAddRecExpr, scUMaxExpr, scSMaxExpr, scUnknown,
- scCouldNotCompute
- };
-
- //===--------------------------------------------------------------------===//
- /// SCEVConstant - This class represents a constant integer value.
- ///
- class SCEVConstant : public SCEV {
- friend class ScalarEvolution;
-
- ConstantInt *V;
- explicit SCEVConstant(ConstantInt *v) : SCEV(scConstant), V(v) {}
-
- virtual ~SCEVConstant();
- public:
- ConstantInt *getValue() const { return V; }
-
- /// getValueRange - Return the tightest constant bounds that this value is
- /// known to have. This method is only valid on integer SCEV objects.
- virtual ConstantRange getValueRange() const;
-
- virtual bool isLoopInvariant(const Loop *L) const {
- return true;
- }
-
- virtual bool hasComputableLoopEvolution(const Loop *L) const {
- return false; // Not loop variant
- }
-
- virtual const Type *getType() const;
-
- SCEVHandle replaceSymbolicValuesWithConcrete(const SCEVHandle &Sym,
- const SCEVHandle &Conc,
- ScalarEvolution &SE) const {
- return this;
- }
-
- virtual void print(std::ostream &OS) const;
- void print(std::ostream *OS) const { if (OS) print(*OS); }
-
- /// Methods for support type inquiry through isa, cast, and dyn_cast:
- static inline bool classof(const SCEVConstant *S) { return true; }
- static inline bool classof(const SCEV *S) {
- return S->getSCEVType() == scConstant;
- }
- };
-
- //===--------------------------------------------------------------------===//
- /// SCEVTruncateExpr - This class represents a truncation of an integer value
- /// to a smaller integer value.
- ///
- class SCEVTruncateExpr : public SCEV {
- friend class ScalarEvolution;
-
- SCEVHandle Op;
- const Type *Ty;
- SCEVTruncateExpr(const SCEVHandle &op, const Type *ty);
- virtual ~SCEVTruncateExpr();
- public:
- const SCEVHandle &getOperand() const { return Op; }
- virtual const Type *getType() const { return Ty; }
-
- virtual bool isLoopInvariant(const Loop *L) const {
- return Op->isLoopInvariant(L);
- }
-
- virtual bool hasComputableLoopEvolution(const Loop *L) const {
- return Op->hasComputableLoopEvolution(L);
- }
-
- SCEVHandle replaceSymbolicValuesWithConcrete(const SCEVHandle &Sym,
- const SCEVHandle &Conc,
- ScalarEvolution &SE) const {
- SCEVHandle H = Op->replaceSymbolicValuesWithConcrete(Sym, Conc, SE);
- if (H == Op)
- return this;
- return SE.getTruncateExpr(H, Ty);
- }
-
- /// getValueRange - Return the tightest constant bounds that this value is
- /// known to have. This method is only valid on integer SCEV objects.
- virtual ConstantRange getValueRange() const;
-
- virtual void print(std::ostream &OS) const;
- void print(std::ostream *OS) const { if (OS) print(*OS); }
-
- /// Methods for support type inquiry through isa, cast, and dyn_cast:
- static inline bool classof(const SCEVTruncateExpr *S) { return true; }
- static inline bool classof(const SCEV *S) {
- return S->getSCEVType() == scTruncate;
- }
- };
-
- //===--------------------------------------------------------------------===//
- /// SCEVZeroExtendExpr - This class represents a zero extension of a small
- /// integer value to a larger integer value.
- ///
- class SCEVZeroExtendExpr : public SCEV {
- friend class ScalarEvolution;
-
- SCEVHandle Op;
- const Type *Ty;
- SCEVZeroExtendExpr(const SCEVHandle &op, const Type *ty);
- virtual ~SCEVZeroExtendExpr();
- public:
- const SCEVHandle &getOperand() const { return Op; }
- virtual const Type *getType() const { return Ty; }
-
- virtual bool isLoopInvariant(const Loop *L) const {
- return Op->isLoopInvariant(L);
- }
-
- virtual bool hasComputableLoopEvolution(const Loop *L) const {
- return Op->hasComputableLoopEvolution(L);
- }
-
- /// getValueRange - Return the tightest constant bounds that this value is
- /// known to have. This method is only valid on integer SCEV objects.
- virtual ConstantRange getValueRange() const;
-
- SCEVHandle replaceSymbolicValuesWithConcrete(const SCEVHandle &Sym,
- const SCEVHandle &Conc,
- ScalarEvolution &SE) const {
- SCEVHandle H = Op->replaceSymbolicValuesWithConcrete(Sym, Conc, SE);
- if (H == Op)
- return this;
- return SE.getZeroExtendExpr(H, Ty);
- }
-
- virtual void print(std::ostream &OS) const;
- void print(std::ostream *OS) const { if (OS) print(*OS); }
-
- /// Methods for support type inquiry through isa, cast, and dyn_cast:
- static inline bool classof(const SCEVZeroExtendExpr *S) { return true; }
- static inline bool classof(const SCEV *S) {
- return S->getSCEVType() == scZeroExtend;
- }
- };
-
- //===--------------------------------------------------------------------===//
- /// SCEVSignExtendExpr - This class represents a sign extension of a small
- /// integer value to a larger integer value.
- ///
- class SCEVSignExtendExpr : public SCEV {
- friend class ScalarEvolution;
-
- SCEVHandle Op;
- const Type *Ty;
- SCEVSignExtendExpr(const SCEVHandle &op, const Type *ty);
- virtual ~SCEVSignExtendExpr();
- public:
- const SCEVHandle &getOperand() const { return Op; }
- virtual const Type *getType() const { return Ty; }
-
- virtual bool isLoopInvariant(const Loop *L) const {
- return Op->isLoopInvariant(L);
- }
-
- virtual bool hasComputableLoopEvolution(const Loop *L) const {
- return Op->hasComputableLoopEvolution(L);
- }
-
- /// getValueRange - Return the tightest constant bounds that this value is
- /// known to have. This method is only valid on integer SCEV objects.
- virtual ConstantRange getValueRange() const;
-
- SCEVHandle replaceSymbolicValuesWithConcrete(const SCEVHandle &Sym,
- const SCEVHandle &Conc,
- ScalarEvolution &SE) const {
- SCEVHandle H = Op->replaceSymbolicValuesWithConcrete(Sym, Conc, SE);
- if (H == Op)
- return this;
- return SE.getSignExtendExpr(H, Ty);
- }
-
- virtual void print(std::ostream &OS) const;
- void print(std::ostream *OS) const { if (OS) print(*OS); }
-
- /// Methods for support type inquiry through isa, cast, and dyn_cast:
- static inline bool classof(const SCEVSignExtendExpr *S) { return true; }
- static inline bool classof(const SCEV *S) {
- return S->getSCEVType() == scSignExtend;
- }
- };
-
-
- //===--------------------------------------------------------------------===//
- /// SCEVCommutativeExpr - This node is the base class for n'ary commutative
- /// operators.
- ///
- class SCEVCommutativeExpr : public SCEV {
- friend class ScalarEvolution;
-
- std::vector<SCEVHandle> Operands;
-
- protected:
- SCEVCommutativeExpr(enum SCEVTypes T, const std::vector<SCEVHandle> &ops)
- : SCEV(T) {
- Operands.reserve(ops.size());
- Operands.insert(Operands.end(), ops.begin(), ops.end());
- }
- ~SCEVCommutativeExpr();
-
- public:
- unsigned getNumOperands() const { return (unsigned)Operands.size(); }
- const SCEVHandle &getOperand(unsigned i) const {
- assert(i < Operands.size() && "Operand index out of range!");
- return Operands[i];
- }
-
- const std::vector<SCEVHandle> &getOperands() const { return Operands; }
- typedef std::vector<SCEVHandle>::const_iterator op_iterator;
- op_iterator op_begin() const { return Operands.begin(); }
- op_iterator op_end() const { return Operands.end(); }
-
-
- virtual bool isLoopInvariant(const Loop *L) const {
- for (unsigned i = 0, e = getNumOperands(); i != e; ++i)
- if (!getOperand(i)->isLoopInvariant(L)) return false;
- return true;
- }
-
- // hasComputableLoopEvolution - Commutative expressions have computable loop
- // evolutions iff they have at least one operand that varies with the loop,
- // but that all varying operands are computable.
- virtual bool hasComputableLoopEvolution(const Loop *L) const {
- bool HasVarying = false;
- for (unsigned i = 0, e = getNumOperands(); i != e; ++i)
- if (!getOperand(i)->isLoopInvariant(L)) {
- if (getOperand(i)->hasComputableLoopEvolution(L))
- HasVarying = true;
- else
- return false;
- }
- return HasVarying;
- }
-
- SCEVHandle replaceSymbolicValuesWithConcrete(const SCEVHandle &Sym,
- const SCEVHandle &Conc,
- ScalarEvolution &SE) const;
-
- virtual const char *getOperationStr() const = 0;
-
- virtual const Type *getType() const { return getOperand(0)->getType(); }
- virtual void print(std::ostream &OS) const;
- void print(std::ostream *OS) const { if (OS) print(*OS); }
-
- /// Methods for support type inquiry through isa, cast, and dyn_cast:
- static inline bool classof(const SCEVCommutativeExpr *S) { return true; }
- static inline bool classof(const SCEV *S) {
- return S->getSCEVType() == scAddExpr ||
- S->getSCEVType() == scMulExpr ||
- S->getSCEVType() == scSMaxExpr ||
- S->getSCEVType() == scUMaxExpr;
- }
- };
-
-
- //===--------------------------------------------------------------------===//
- /// SCEVAddExpr - This node represents an addition of some number of SCEVs.
- ///
- class SCEVAddExpr : public SCEVCommutativeExpr {
- friend class ScalarEvolution;
-
- explicit SCEVAddExpr(const std::vector<SCEVHandle> &ops)
- : SCEVCommutativeExpr(scAddExpr, ops) {
- }
-
- public:
- virtual const char *getOperationStr() const { return " + "; }
-
- /// Methods for support type inquiry through isa, cast, and dyn_cast:
- static inline bool classof(const SCEVAddExpr *S) { return true; }
- static inline bool classof(const SCEV *S) {
- return S->getSCEVType() == scAddExpr;
- }
- };
-
- //===--------------------------------------------------------------------===//
- /// SCEVMulExpr - This node represents multiplication of some number of SCEVs.
- ///
- class SCEVMulExpr : public SCEVCommutativeExpr {
- friend class ScalarEvolution;
-
- explicit SCEVMulExpr(const std::vector<SCEVHandle> &ops)
- : SCEVCommutativeExpr(scMulExpr, ops) {
- }
-
- public:
- virtual const char *getOperationStr() const { return " * "; }
-
- /// Methods for support type inquiry through isa, cast, and dyn_cast:
- static inline bool classof(const SCEVMulExpr *S) { return true; }
- static inline bool classof(const SCEV *S) {
- return S->getSCEVType() == scMulExpr;
- }
- };
-
-
- //===--------------------------------------------------------------------===//
- /// SCEVUDivExpr - This class represents a binary unsigned division operation.
- ///
- class SCEVUDivExpr : public SCEV {
- friend class ScalarEvolution;
-
- SCEVHandle LHS, RHS;
- SCEVUDivExpr(const SCEVHandle &lhs, const SCEVHandle &rhs)
- : SCEV(scUDivExpr), LHS(lhs), RHS(rhs) {}
-
- virtual ~SCEVUDivExpr();
- public:
- const SCEVHandle &getLHS() const { return LHS; }
- const SCEVHandle &getRHS() const { return RHS; }
-
- virtual bool isLoopInvariant(const Loop *L) const {
- return LHS->isLoopInvariant(L) && RHS->isLoopInvariant(L);
- }
-
- virtual bool hasComputableLoopEvolution(const Loop *L) const {
- return LHS->hasComputableLoopEvolution(L) &&
- RHS->hasComputableLoopEvolution(L);
- }
-
- SCEVHandle replaceSymbolicValuesWithConcrete(const SCEVHandle &Sym,
- const SCEVHandle &Conc,
- ScalarEvolution &SE) const {
- SCEVHandle L = LHS->replaceSymbolicValuesWithConcrete(Sym, Conc, SE);
- SCEVHandle R = RHS->replaceSymbolicValuesWithConcrete(Sym, Conc, SE);
- if (L == LHS && R == RHS)
- return this;
- else
- return SE.getUDivExpr(L, R);
- }
-
-
- virtual const Type *getType() const;
-
- void print(std::ostream &OS) const;
- void print(std::ostream *OS) const { if (OS) print(*OS); }
-
- /// Methods for support type inquiry through isa, cast, and dyn_cast:
- static inline bool classof(const SCEVUDivExpr *S) { return true; }
- static inline bool classof(const SCEV *S) {
- return S->getSCEVType() == scUDivExpr;
- }
- };
-
-
- //===--------------------------------------------------------------------===//
- /// SCEVAddRecExpr - This node represents a polynomial recurrence on the trip
- /// count of the specified loop.
- ///
- /// All operands of an AddRec are required to be loop invariant.
- ///
- class SCEVAddRecExpr : public SCEV {
- friend class ScalarEvolution;
-
- std::vector<SCEVHandle> Operands;
- const Loop *L;
-
- SCEVAddRecExpr(const std::vector<SCEVHandle> &ops, const Loop *l)
- : SCEV(scAddRecExpr), Operands(ops), L(l) {
- for (size_t i = 0, e = Operands.size(); i != e; ++i)
- assert(Operands[i]->isLoopInvariant(l) &&
- "Operands of AddRec must be loop-invariant!");
- }
- ~SCEVAddRecExpr();
- public:
- typedef std::vector<SCEVHandle>::const_iterator op_iterator;
- op_iterator op_begin() const { return Operands.begin(); }
- op_iterator op_end() const { return Operands.end(); }
-
- unsigned getNumOperands() const { return (unsigned)Operands.size(); }
- const SCEVHandle &getOperand(unsigned i) const { return Operands[i]; }
- const SCEVHandle &getStart() const { return Operands[0]; }
- const Loop *getLoop() const { return L; }
-
-
- /// getStepRecurrence - This method constructs and returns the recurrence
- /// indicating how much this expression steps by. If this is a polynomial
- /// of degree N, it returns a chrec of degree N-1.
- SCEVHandle getStepRecurrence(ScalarEvolution &SE) const {
- if (getNumOperands() == 2) return getOperand(1);
- return SE.getAddRecExpr(std::vector<SCEVHandle>(op_begin()+1,op_end()),
- getLoop());
- }
-
- virtual bool hasComputableLoopEvolution(const Loop *QL) const {
- if (L == QL) return true;
- return false;
- }
-
- virtual bool isLoopInvariant(const Loop *QueryLoop) const;
-
- virtual const Type *getType() const { return Operands[0]->getType(); }
-
- /// isAffine - Return true if this is an affine AddRec (i.e., it represents
- /// an expressions A+B*x where A and B are loop invariant values.
- bool isAffine() const {
- // We know that the start value is invariant. This expression is thus
- // affine iff the step is also invariant.
- return getNumOperands() == 2;
- }
-
- /// isQuadratic - Return true if this is an quadratic AddRec (i.e., it
- /// represents an expressions A+B*x+C*x^2 where A, B and C are loop
- /// invariant values. This corresponds to an addrec of the form {L,+,M,+,N}
- bool isQuadratic() const {
- return getNumOperands() == 3;
- }
-
- /// evaluateAtIteration - Return the value of this chain of recurrences at
- /// the specified iteration number.
- SCEVHandle evaluateAtIteration(SCEVHandle It, ScalarEvolution &SE) const;
-
- /// getNumIterationsInRange - Return the number of iterations of this loop
- /// that produce values in the specified constant range. Another way of
- /// looking at this is that it returns the first iteration number where the
- /// value is not in the condition, thus computing the exit count. If the
- /// iteration count can't be computed, an instance of SCEVCouldNotCompute is
- /// returned.
- SCEVHandle getNumIterationsInRange(ConstantRange Range,
- ScalarEvolution &SE) const;
-
- SCEVHandle replaceSymbolicValuesWithConcrete(const SCEVHandle &Sym,
- const SCEVHandle &Conc,
- ScalarEvolution &SE) const;
-
- virtual void print(std::ostream &OS) const;
- void print(std::ostream *OS) const { if (OS) print(*OS); }
-
- /// Methods for support type inquiry through isa, cast, and dyn_cast:
- static inline bool classof(const SCEVAddRecExpr *S) { return true; }
- static inline bool classof(const SCEV *S) {
- return S->getSCEVType() == scAddRecExpr;
- }
- };
-
-
- //===--------------------------------------------------------------------===//
- /// SCEVSMaxExpr - This class represents a signed maximum selection.
- ///
- class SCEVSMaxExpr : public SCEVCommutativeExpr {
- friend class ScalarEvolution;
-
- explicit SCEVSMaxExpr(const std::vector<SCEVHandle> &ops)
- : SCEVCommutativeExpr(scSMaxExpr, ops) {
- }
-
- public:
- virtual const char *getOperationStr() const { return " smax "; }
-
- /// Methods for support type inquiry through isa, cast, and dyn_cast:
- static inline bool classof(const SCEVSMaxExpr *S) { return true; }
- static inline bool classof(const SCEV *S) {
- return S->getSCEVType() == scSMaxExpr;
- }
- };
-
-
- //===--------------------------------------------------------------------===//
- /// SCEVUMaxExpr - This class represents an unsigned maximum selection.
- ///
- class SCEVUMaxExpr : public SCEVCommutativeExpr {
- friend class ScalarEvolution;
-
- explicit SCEVUMaxExpr(const std::vector<SCEVHandle> &ops)
- : SCEVCommutativeExpr(scUMaxExpr, ops) {
- }
-
- public:
- virtual const char *getOperationStr() const { return " umax "; }
-
- /// Methods for support type inquiry through isa, cast, and dyn_cast:
- static inline bool classof(const SCEVUMaxExpr *S) { return true; }
- static inline bool classof(const SCEV *S) {
- return S->getSCEVType() == scUMaxExpr;
- }
- };
-
-
- //===--------------------------------------------------------------------===//
- /// SCEVUnknown - This means that we are dealing with an entirely unknown SCEV
- /// value, and only represent it as it's LLVM Value. This is the "bottom"
- /// value for the analysis.
- ///
- class SCEVUnknown : public SCEV {
- friend class ScalarEvolution;
-
- Value *V;
- explicit SCEVUnknown(Value *v) : SCEV(scUnknown), V(v) {}
-
- protected:
- ~SCEVUnknown();
- public:
- Value *getValue() const { return V; }
-
- virtual bool isLoopInvariant(const Loop *L) const;
- virtual bool hasComputableLoopEvolution(const Loop *QL) const {
- return false; // not computable
- }
-
- SCEVHandle replaceSymbolicValuesWithConcrete(const SCEVHandle &Sym,
- const SCEVHandle &Conc,
- ScalarEvolution &SE) const {
- if (&*Sym == this) return Conc;
- return this;
- }
-
- virtual const Type *getType() const;
-
- virtual void print(std::ostream &OS) const;
- void print(std::ostream *OS) const { if (OS) print(*OS); }
-
- /// Methods for support type inquiry through isa, cast, and dyn_cast:
- static inline bool classof(const SCEVUnknown *S) { return true; }
- static inline bool classof(const SCEV *S) {
- return S->getSCEVType() == scUnknown;
- }
- };
-
- /// SCEVVisitor - This class defines a simple visitor class that may be used
- /// for various SCEV analysis purposes.
- template<typename SC, typename RetVal=void>
- struct SCEVVisitor {
- RetVal visit(SCEV *S) {
- switch (S->getSCEVType()) {
- case scConstant:
- return ((SC*)this)->visitConstant((SCEVConstant*)S);
- case scTruncate:
- return ((SC*)this)->visitTruncateExpr((SCEVTruncateExpr*)S);
- case scZeroExtend:
- return ((SC*)this)->visitZeroExtendExpr((SCEVZeroExtendExpr*)S);
- case scSignExtend:
- return ((SC*)this)->visitSignExtendExpr((SCEVSignExtendExpr*)S);
- case scAddExpr:
- return ((SC*)this)->visitAddExpr((SCEVAddExpr*)S);
- case scMulExpr:
- return ((SC*)this)->visitMulExpr((SCEVMulExpr*)S);
- case scUDivExpr:
- return ((SC*)this)->visitUDivExpr((SCEVUDivExpr*)S);
- case scAddRecExpr:
- return ((SC*)this)->visitAddRecExpr((SCEVAddRecExpr*)S);
- case scSMaxExpr:
- return ((SC*)this)->visitSMaxExpr((SCEVSMaxExpr*)S);
- case scUMaxExpr:
- return ((SC*)this)->visitUMaxExpr((SCEVUMaxExpr*)S);
- case scUnknown:
- return ((SC*)this)->visitUnknown((SCEVUnknown*)S);
- case scCouldNotCompute:
- return ((SC*)this)->visitCouldNotCompute((SCEVCouldNotCompute*)S);
- default:
- assert(0 && "Unknown SCEV type!");
- abort();
- }
- }
-
- RetVal visitCouldNotCompute(SCEVCouldNotCompute *S) {
- assert(0 && "Invalid use of SCEVCouldNotCompute!");
- abort();
- return RetVal();
- }
- };
-}
-
-#endif
diff --git a/release_23/include/llvm/Analysis/Trace.h b/release_23/include/llvm/Analysis/Trace.h
deleted file mode 100644
index fd615fcdae08..000000000000
--- a/release_23/include/llvm/Analysis/Trace.h
+++ /dev/null
@@ -1,120 +0,0 @@
-//===- llvm/Analysis/Trace.h - Represent one trace of LLVM code -*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This class represents a single trace of LLVM basic blocks. A trace is a
-// single entry, multiple exit, region of code that is often hot. Trace-based
-// optimizations treat traces almost like they are a large, strange, basic
-// block: because the trace path is assumed to be hot, optimizations for the
-// fall-through path are made at the expense of the non-fall-through paths.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_ANALYSIS_TRACE_H
-#define LLVM_ANALYSIS_TRACE_H
-
-#include "llvm/Support/Streams.h"
-#include <vector>
-#include <cassert>
-
-namespace llvm {
- class BasicBlock;
- class Function;
- class Module;
-
-class Trace {
- typedef std::vector<BasicBlock *> BasicBlockListType;
- BasicBlockListType BasicBlocks;
-
-public:
- /// Trace ctor - Make a new trace from a vector of basic blocks,
- /// residing in the function which is the parent of the first
- /// basic block in the vector.
- ///
- Trace(const std::vector<BasicBlock *> &vBB) : BasicBlocks (vBB) {}
-
- /// getEntryBasicBlock - Return the entry basic block (first block)
- /// of the trace.
- ///
- BasicBlock *getEntryBasicBlock () const { return BasicBlocks[0]; }
-
- /// operator[]/getBlock - Return basic block N in the trace.
- ///
- BasicBlock *operator[](unsigned i) const { return BasicBlocks[i]; }
- BasicBlock *getBlock(unsigned i) const { return BasicBlocks[i]; }
-
- /// getFunction - Return this trace's parent function.
- ///
- Function *getFunction () const;
-
- /// getModule - Return this Module that contains this trace's parent
- /// function.
- ///
- Module *getModule () const;
-
- /// getBlockIndex - Return the index of the specified basic block in the
- /// trace, or -1 if it is not in the trace.
- int getBlockIndex(const BasicBlock *X) const {
- for (unsigned i = 0, e = BasicBlocks.size(); i != e; ++i)
- if (BasicBlocks[i] == X)
- return i;
- return -1;
- }
-
- /// contains - Returns true if this trace contains the given basic
- /// block.
- ///
- bool contains(const BasicBlock *X) const {
- return getBlockIndex(X) != -1;
- }
-
- /// Returns true if B1 occurs before B2 in the trace, or if it is the same
- /// block as B2.. Both blocks must be in the trace.
- ///
- bool dominates(const BasicBlock *B1, const BasicBlock *B2) const {
- int B1Idx = getBlockIndex(B1), B2Idx = getBlockIndex(B2);
- assert(B1Idx != -1 && B2Idx != -1 && "Block is not in the trace!");
- return B1Idx <= B2Idx;
- }
-
- // BasicBlock iterators...
- typedef BasicBlockListType::iterator iterator;
- typedef BasicBlockListType::const_iterator const_iterator;
- typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
- typedef std::reverse_iterator<iterator> reverse_iterator;
-
- iterator begin() { return BasicBlocks.begin(); }
- const_iterator begin() const { return BasicBlocks.begin(); }
- iterator end () { return BasicBlocks.end(); }
- const_iterator end () const { return BasicBlocks.end(); }
-
- reverse_iterator rbegin() { return BasicBlocks.rbegin(); }
- const_reverse_iterator rbegin() const { return BasicBlocks.rbegin(); }
- reverse_iterator rend () { return BasicBlocks.rend(); }
- const_reverse_iterator rend () const { return BasicBlocks.rend(); }
-
- unsigned size() const { return BasicBlocks.size(); }
- bool empty() const { return BasicBlocks.empty(); }
-
- iterator erase(iterator q) { return BasicBlocks.erase (q); }
- iterator erase(iterator q1, iterator q2) { return BasicBlocks.erase (q1, q2); }
-
- /// print - Write trace to output stream.
- ///
- void print (std::ostream &O) const;
- void print (std::ostream *O) const { if (O) print(*O); }
-
- /// dump - Debugger convenience method; writes trace to standard error
- /// output stream.
- ///
- void dump () const;
-};
-
-} // end namespace llvm
-
-#endif // TRACE_H
diff --git a/release_23/include/llvm/Analysis/ValueNumbering.h b/release_23/include/llvm/Analysis/ValueNumbering.h
deleted file mode 100644
index 72452acda15b..000000000000
--- a/release_23/include/llvm/Analysis/ValueNumbering.h
+++ /dev/null
@@ -1,75 +0,0 @@
-//===- llvm/Analysis/ValueNumbering.h - Value #'ing Interface ---*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines the abstract ValueNumbering interface, which is used as the
-// common interface used by all clients of value numbering information, and
-// implemented by all value numbering implementations.
-//
-// Implementations of this interface must implement the various virtual methods,
-// which automatically provides functionality for the entire suite of client
-// APIs.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_ANALYSIS_VALUE_NUMBERING_H
-#define LLVM_ANALYSIS_VALUE_NUMBERING_H
-
-#include <vector>
-#include "llvm/Pass.h"
-#include "llvm/System/IncludeFile.h"
-
-namespace llvm {
-
-class Value;
-class Instruction;
-
-struct ValueNumbering {
- static char ID; // Class identification, replacement for typeinfo
- virtual ~ValueNumbering(); // We want to be subclassed
-
- /// getEqualNumberNodes - Return nodes with the same value number as the
- /// specified Value. This fills in the argument vector with any equal values.
- ///
- virtual void getEqualNumberNodes(Value *V1,
- std::vector<Value*> &RetVals) const = 0;
-
- ///===-------------------------------------------------------------------===//
- /// Interfaces to update value numbering analysis information as the client
- /// changes the program.
- ///
-
- /// deleteValue - This method should be called whenever an LLVM Value is
- /// deleted from the program, for example when an instruction is found to be
- /// redundant and is eliminated.
- ///
- virtual void deleteValue(Value *V) {}
-
- /// copyValue - This method should be used whenever a preexisting value in the
- /// program is copied or cloned, introducing a new value. Note that analysis
- /// implementations should tolerate clients that use this method to introduce
- /// the same value multiple times: if the analysis already knows about a
- /// value, it should ignore the request.
- ///
- virtual void copyValue(Value *From, Value *To) {}
-
- /// replaceWithNewValue - This method is the obvious combination of the two
- /// above, and it provided as a helper to simplify client code.
- ///
- void replaceWithNewValue(Value *Old, Value *New) {
- copyValue(Old, New);
- deleteValue(Old);
- }
-};
-
-} // End llvm namespace
-
-// Force any file including this header to get the implementation as well
-FORCE_DEFINING_FILE_TO_BE_LINKED(BasicValueNumbering)
-
-#endif
diff --git a/release_23/include/llvm/Analysis/Verifier.h b/release_23/include/llvm/Analysis/Verifier.h
deleted file mode 100644
index a6b2a6df21af..000000000000
--- a/release_23/include/llvm/Analysis/Verifier.h
+++ /dev/null
@@ -1,75 +0,0 @@
-//===-- llvm/Analysis/Verifier.h - Module Verifier --------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines the function verifier interface, that can be used for some
-// sanity checking of input to the system, and for checking that transformations
-// haven't done something bad.
-//
-// Note that this does not provide full 'java style' security and verifications,
-// instead it just tries to ensure that code is well formed.
-//
-// To see what specifically is checked, look at the top of Verifier.cpp
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_ANALYSIS_VERIFIER_H
-#define LLVM_ANALYSIS_VERIFIER_H
-
-#include <string>
-
-namespace llvm {
-
-class FunctionPass;
-class Module;
-class Function;
-
-/// @brief An enumeration to specify the action to be taken if errors found.
-///
-/// This enumeration is used in the functions below to indicate what should
-/// happen if the verifier finds errors. Each of the functions that uses
-/// this enumeration as an argument provides a default value for it. The
-/// actions are listed below.
-enum VerifierFailureAction {
- AbortProcessAction, ///< verifyModule will print to stderr and abort()
- PrintMessageAction, ///< verifyModule will print to stderr and return true
- ReturnStatusAction ///< verifyModule will just return true
-};
-
-/// @brief Create a verifier pass.
-///
-/// Check a module or function for validity. When the pass is used, the
-/// action indicated by the \p action argument will be used if errors are
-/// found.
-FunctionPass *createVerifierPass(
- VerifierFailureAction action = AbortProcessAction ///< Action to take
-);
-
-/// @brief Check a module for errors.
-///
-/// If there are no errors, the function returns false. If an error is found,
-/// the action taken depends on the \p action parameter.
-/// This should only be used for debugging, because it plays games with
-/// PassManagers and stuff.
-
-bool verifyModule(
- const Module &M, ///< The module to be verified
- VerifierFailureAction action = AbortProcessAction, ///< Action to take
- std::string *ErrorInfo = 0 ///< Information about failures.
-);
-
-// verifyFunction - Check a function for errors, useful for use when debugging a
-// pass.
-bool verifyFunction(
- const Function &F, ///< The function to be verified
- VerifierFailureAction action = AbortProcessAction ///< Action to take
-);
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/Argument.h b/release_23/include/llvm/Argument.h
deleted file mode 100644
index d203a935bd1b..000000000000
--- a/release_23/include/llvm/Argument.h
+++ /dev/null
@@ -1,94 +0,0 @@
-//===-- llvm/Argument.h - Definition of the Argument class ------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file declares the Argument class.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_ARGUMENT_H
-#define LLVM_ARGUMENT_H
-
-#include "llvm/Value.h"
-#include "llvm/ParameterAttributes.h"
-
-namespace llvm {
-
-template<typename ValueSubClass, typename ItemParentClass>
- class SymbolTableListTraits;
-
-/// A class to represent an incoming formal argument to a Function. An argument
-/// is a very simple Value. It is essentially a named (optional) type. When used
-/// in the body of a function, it represents the value of the actual argument
-/// the function was called with.
-/// @brief LLVM Argument representation
-class Argument : public Value { // Defined in the Function.cpp file
- Function *Parent;
-
- Argument *Prev, *Next; // Next and Prev links for our intrusive linked list
- void setNext(Argument *N) { Next = N; }
- void setPrev(Argument *N) { Prev = N; }
- friend class SymbolTableListTraits<Argument, Function>;
- void setParent(Function *parent);
-
-public:
- /// Argument ctor - If Function argument is specified, this argument is
- /// inserted at the end of the argument list for the function.
- ///
- explicit Argument(const Type *Ty, const std::string &Name = "",
- Function *F = 0);
-
- inline const Function *getParent() const { return Parent; }
- inline Function *getParent() { return Parent; }
-
- /// getArgNo - Return the index of this formal argument in its containing
- /// function. For example in "void foo(int a, float b)" a is 0 and b is 1.
- unsigned getArgNo() const;
-
- /// hasByValAttr - Return true if this argument has the byval attribute on it
- /// in its containing function.
- bool hasByValAttr() const;
-
- /// hasNoAliasAttr - Return true if this argument has the noalias attribute on
- /// it in its containing function.
- bool hasNoAliasAttr() const;
-
- /// hasSRetAttr - Return true if this argument has the sret attribute on it in
- /// its containing function.
- bool hasStructRetAttr() const;
-
- /// addAttr - Add a ParamAttr to an argument
- void addAttr(ParameterAttributes);
-
- /// removeAttr - Remove a ParamAttr from an argument
- void removeAttr(ParameterAttributes);
-
- virtual void print(std::ostream &OS) const;
- void print(std::ostream *OS) const {
- if (OS) print(*OS);
- }
-
- /// classof - Methods for support type inquiry through isa, cast, and
- /// dyn_cast:
- ///
- static inline bool classof(const Argument *) { return true; }
- static inline bool classof(const Value *V) {
- return V->getValueID() == ArgumentVal;
- }
-
-private:
- // getNext/Prev - Return the next or previous argument in the list.
- Argument *getNext() { return Next; }
- const Argument *getNext() const { return Next; }
- Argument *getPrev() { return Prev; }
- const Argument *getPrev() const { return Prev; }
-};
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/Assembly/AsmAnnotationWriter.h b/release_23/include/llvm/Assembly/AsmAnnotationWriter.h
deleted file mode 100644
index 62926bb007a2..000000000000
--- a/release_23/include/llvm/Assembly/AsmAnnotationWriter.h
+++ /dev/null
@@ -1,53 +0,0 @@
-//===-- AsmAnnotationWriter.h - Itf for annotation .ll files - --*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// Clients of the assembly writer can use this interface to add their own
-// special-purpose annotations to LLVM assembly language printouts. Note that
-// the assembly parser won't be able to parse these, in general, so
-// implementations are advised to print stuff as LLVM comments.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_ASSEMBLY_ASMANNOTATIONWRITER_H
-#define LLVM_ASSEMBLY_ASMANNOTATIONWRITER_H
-
-#include <iosfwd>
-
-namespace llvm {
-
-class Function;
-class BasicBlock;
-class Instruction;
-
-struct AssemblyAnnotationWriter {
-
- virtual ~AssemblyAnnotationWriter();
-
- // emitFunctionAnnot - This may be implemented to emit a string right before
- // the start of a function.
- virtual void emitFunctionAnnot(const Function *F, std::ostream &OS) {}
-
- // emitBasicBlockStartAnnot - This may be implemented to emit a string right
- // after the basic block label, but before the first instruction in the block.
- virtual void emitBasicBlockStartAnnot(const BasicBlock *BB, std::ostream &OS){
- }
-
- // emitBasicBlockEndAnnot - This may be implemented to emit a string right
- // after the basic block.
- virtual void emitBasicBlockEndAnnot(const BasicBlock *BB, std::ostream &OS){
- }
-
- // emitInstructionAnnot - This may be implemented to emit a string right
- // before an instruction is emitted.
- virtual void emitInstructionAnnot(const Instruction *I, std::ostream &OS) {}
-};
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/Assembly/Parser.h b/release_23/include/llvm/Assembly/Parser.h
deleted file mode 100644
index edca08c46fb6..000000000000
--- a/release_23/include/llvm/Assembly/Parser.h
+++ /dev/null
@@ -1,97 +0,0 @@
-//===-- llvm/Assembly/Parser.h - Parser for VM assembly files ---*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// These classes are implemented by the lib/AsmParser library.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_ASSEMBLY_PARSER_H
-#define LLVM_ASSEMBLY_PARSER_H
-
-#include <string>
-
-namespace llvm {
-
-class Module;
-class ParseError;
-
-
-/// This function is the main interface to the LLVM Assembly Parse. It parses
-/// an ascii file that (presumably) contains LLVM Assembly code. It returns a
-/// Module (intermediate representation) with the corresponding features. Note
-/// that this does not verify that the generated Module is valid, so you should
-/// run the verifier after parsing the file to check that it is okay.
-/// @brief Parse LLVM Assembly from a file
-Module *ParseAssemblyFile(
- const std::string &Filename, ///< The name of the file to parse
- ParseError* Error = 0 ///< If not null, an object to return errors in.
-);
-
-/// The function is a secondary interface to the LLVM Assembly Parse. It parses
-/// an ascii string that (presumably) contains LLVM Assembly code. It returns a
-/// Module (intermediate representation) with the corresponding features. Note
-/// that this does not verify that the generated Module is valid, so you should
-/// run the verifier after parsing the file to check that it is okay.
-/// @brief Parse LLVM Assembly from a string
-Module *ParseAssemblyString(
- const char * AsmString, ///< The string containing assembly
- Module * M, ///< A module to add the assembly too.
- ParseError* Error = 0 ///< If not null, an object to return errors in.
-);
-
-//===------------------------------------------------------------------------===
-// Helper Classes
-//===------------------------------------------------------------------------===
-
-/// An instance of this class can be passed to ParseAssemblyFile or
-/// ParseAssemblyString functions in order to capture error information from
-/// the parser. It provides a standard way to print out the error message
-/// including the file name and line number where the error occurred.
-/// @brief An LLVM Assembly Parsing Error Object
-class ParseError {
-public:
- ParseError() : Filename("unknown"), Message("none"), LineNo(0), ColumnNo(0) {}
- ParseError(const ParseError &E);
-
- // getMessage - Return the message passed in at construction time plus extra
- // information extracted from the options used to parse with...
- //
- const std::string getMessage() const;
-
- inline const std::string &getRawMessage() const { // Just the raw message...
- return Message;
- }
-
- inline const std::string &getFilename() const {
- return Filename;
- }
-
- void setError(const std::string &filename, const std::string &message,
- int LineNo = -1, int ColNo = -1);
-
- // getErrorLocation - Return the line and column number of the error in the
- // input source file. The source filename can be derived from the
- // ParserOptions in effect. If positional information is not applicable,
- // these will return a value of -1.
- //
- inline void getErrorLocation(int &Line, int &Column) const {
- Line = LineNo; Column = ColumnNo;
- }
-
-private :
- std::string Filename;
- std::string Message;
- int LineNo, ColumnNo; // -1 if not relevant
-
- ParseError &operator=(const ParseError &E); // objects by reference
-};
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/Assembly/PrintModulePass.h b/release_23/include/llvm/Assembly/PrintModulePass.h
deleted file mode 100644
index ee5cff509aaa..000000000000
--- a/release_23/include/llvm/Assembly/PrintModulePass.h
+++ /dev/null
@@ -1,82 +0,0 @@
-//===- llvm/Assembly/PrintModulePass.h - Printing Pass ----------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines two passes to print out a module. The PrintModulePass pass
-// simply prints out the entire module when it is executed. The
-// PrintFunctionPass class is designed to be pipelined with other
-// FunctionPass's, and prints out the functions of the module as they are
-// processed.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_ASSEMBLY_PRINTMODULEPASS_H
-#define LLVM_ASSEMBLY_PRINTMODULEPASS_H
-
-#include "llvm/Pass.h"
-#include "llvm/Module.h"
-#include "llvm/Support/Streams.h"
-
-namespace llvm {
-
-class PrintModulePass : public ModulePass {
- OStream *Out; // ostream to print on
- bool DeleteStream; // Delete the ostream in our dtor?
-public:
- static char ID;
- PrintModulePass() : ModulePass(intptr_t(&ID)), Out(&cerr),
- DeleteStream(false) {}
- PrintModulePass(OStream *o, bool DS = false)
- : ModulePass(intptr_t(&ID)), Out(o), DeleteStream(DS) {}
-
- ~PrintModulePass() {
- if (DeleteStream) delete Out;
- }
-
- bool runOnModule(Module &M) {
- (*Out) << M << std::flush;
- return false;
- }
-
- virtual void getAnalysisUsage(AnalysisUsage &AU) const {
- AU.setPreservesAll();
- }
-};
-
-class PrintFunctionPass : public FunctionPass {
- std::string Banner; // String to print before each function
- OStream *Out; // ostream to print on
- bool DeleteStream; // Delete the ostream in our dtor?
-public:
- static char ID;
- PrintFunctionPass() : FunctionPass(intptr_t(&ID)), Banner(""), Out(&cerr),
- DeleteStream(false) {}
- PrintFunctionPass(const std::string &B, OStream *o = &cout,
- bool DS = false)
- : FunctionPass(intptr_t(&ID)), Banner(B), Out(o), DeleteStream(DS) {}
-
- inline ~PrintFunctionPass() {
- if (DeleteStream) delete Out;
- }
-
- // runOnFunction - This pass just prints a banner followed by the function as
- // it's processed.
- //
- bool runOnFunction(Function &F) {
- (*Out) << Banner << static_cast<Value&>(F);
- return false;
- }
-
- virtual void getAnalysisUsage(AnalysisUsage &AU) const {
- AU.setPreservesAll();
- }
-};
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/Assembly/Writer.h b/release_23/include/llvm/Assembly/Writer.h
deleted file mode 100644
index 1e062c478146..000000000000
--- a/release_23/include/llvm/Assembly/Writer.h
+++ /dev/null
@@ -1,45 +0,0 @@
-//===-- llvm/Assembly/Writer.h - Printer for LLVM assembly files --*- C++ -*-=//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This functionality is implemented by lib/VMCore/AsmWriter.cpp.
-// This library is used to print LLVM assembly language files to an iostream. It
-// can print LLVM code at a variety of granularities, including Modules,
-// BasicBlocks, and Instructions. This makes it useful for debugging.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_ASSEMBLY_WRITER_H
-#define LLVM_ASSEMBLY_WRITER_H
-
-#include <iosfwd>
-
-namespace llvm {
-
-class Type;
-class Module;
-class Value;
-
-// WriteTypeSymbolic - This attempts to write the specified type as a symbolic
-// type, iff there is an entry in the Module's symbol table for the specified
-// type or one of its component types. This is slower than a simple x << Type;
-//
-std::ostream &WriteTypeSymbolic(std::ostream &, const Type *, const Module *M);
-
-// WriteAsOperand - Write the name of the specified value out to the specified
-// ostream. This can be useful when you just want to print int %reg126, not the
-// whole instruction that generated it. If you specify a Module for context,
-// then even constants get pretty-printed; for example, the type of a null
-// pointer is printed symbolically.
-//
-std::ostream &WriteAsOperand(std::ostream &, const Value *, bool PrintTy = true,
- const Module *Context = 0);
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/AutoUpgrade.h b/release_23/include/llvm/AutoUpgrade.h
deleted file mode 100644
index 3a97353ac92e..000000000000
--- a/release_23/include/llvm/AutoUpgrade.h
+++ /dev/null
@@ -1,40 +0,0 @@
-//===-- llvm/AutoUpgrade.h - AutoUpgrade Helpers ----------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// These functions are implemented by lib/VMCore/AutoUpgrade.cpp.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_AUTOUPGRADE_H
-#define LLVM_AUTOUPGRADE_H
-
-namespace llvm {
- class Function;
- class CallInst;
- class BasicBlock;
-
- /// This is a more granular function that simply checks an intrinsic function
- /// for upgrading, and returns true if it requires upgrading. It may return
- /// null in NewFn if the all calls to the original intrinsic function
- /// should be transformed to non-function-call instructions.
- bool UpgradeIntrinsicFunction(Function *F, Function *&NewFn);
-
- /// This is the complement to the above, replacing a specific call to an
- /// intrinsic function with a call to the specified new function.
- void UpgradeIntrinsicCall(CallInst *CI, Function *NewFn);
-
- /// This is an auto-upgrade hook for any old intrinsic function syntaxes
- /// which need to have both the function updated as well as all calls updated
- /// to the new function. This should only be run in a post-processing fashion
- /// so that it can update all calls to the old function.
- void UpgradeCallsToIntrinsic(Function* F);
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/BasicBlock.h b/release_23/include/llvm/BasicBlock.h
deleted file mode 100644
index b569a7aeaf0c..000000000000
--- a/release_23/include/llvm/BasicBlock.h
+++ /dev/null
@@ -1,221 +0,0 @@
-//===-- llvm/BasicBlock.h - Represent a basic block in the VM ---*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-//
-// This file contains the declaration of the BasicBlock class.
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_BASICBLOCK_H
-#define LLVM_BASICBLOCK_H
-
-#include "llvm/Instruction.h"
-#include "llvm/SymbolTableListTraits.h"
-#include "llvm/ADT/ilist"
-#include "llvm/Support/DataTypes.h"
-
-namespace llvm {
-
-class TerminatorInst;
-template <class Term, class BB> class SuccIterator; // Successor Iterator
-template <class Ptr, class USE_iterator> class PredIterator;
-
-template<> struct ilist_traits<Instruction>
- : public SymbolTableListTraits<Instruction, BasicBlock> {
- // createSentinel is used to create a node that marks the end of the list...
- static Instruction *createSentinel();
- static void destroySentinel(Instruction *I) { delete I; }
- static iplist<Instruction> &getList(BasicBlock *BB);
- static ValueSymbolTable *getSymTab(BasicBlock *ItemParent);
- static int getListOffset();
-};
-
-/// This represents a single basic block in LLVM. A basic block is simply a
-/// container of instructions that execute sequentially. Basic blocks are Values
-/// because they are referenced by instructions such as branches and switch
-/// tables. The type of a BasicBlock is "Type::LabelTy" because the basic block
-/// represents a label to which a branch can jump.
-///
-/// A well formed basic block is formed of a list of non-terminating
-/// instructions followed by a single TerminatorInst instruction.
-/// TerminatorInst's may not occur in the middle of basic blocks, and must
-/// terminate the blocks. The BasicBlock class allows malformed basic blocks to
-/// occur because it may be useful in the intermediate stage of constructing or
-/// modifying a program. However, the verifier will ensure that basic blocks
-/// are "well formed".
-/// @brief LLVM Basic Block Representation
-class BasicBlock : public Value { // Basic blocks are data objects also
-public:
- typedef iplist<Instruction> InstListType;
-private :
- InstListType InstList;
- BasicBlock *Prev, *Next; // Next and Prev links for our intrusive linked list
- Function *Parent;
-
- void setParent(Function *parent);
- void setNext(BasicBlock *N) { Next = N; }
- void setPrev(BasicBlock *N) { Prev = N; }
- friend class SymbolTableListTraits<BasicBlock, Function>;
-
- BasicBlock(const BasicBlock &); // Do not implement
- void operator=(const BasicBlock &); // Do not implement
-
- /// BasicBlock ctor - If the function parameter is specified, the basic block
- /// is automatically inserted at either the end of the function (if
- /// InsertBefore is null), or before the specified basic block.
- ///
- explicit BasicBlock(const std::string &Name = "", Function *Parent = 0,
- BasicBlock *InsertBefore = 0);
-public:
- /// Instruction iterators...
- typedef InstListType::iterator iterator;
- typedef InstListType::const_iterator const_iterator;
-
- // allocate space for exactly zero operands
- static BasicBlock *Create(const std::string &Name = "", Function *Parent = 0,
- BasicBlock *InsertBefore = 0) {
- return new BasicBlock(Name, Parent, InsertBefore);
- }
- ~BasicBlock();
-
- /// getParent - Return the enclosing method, or null if none
- ///
- const Function *getParent() const { return Parent; }
- Function *getParent() { return Parent; }
-
- /// use_back - Specialize the methods defined in Value, as we know that an
- /// BasicBlock can only be used by Instructions (specifically PHI and terms).
- Instruction *use_back() { return cast<Instruction>(*use_begin());}
- const Instruction *use_back() const { return cast<Instruction>(*use_begin());}
-
- /// getTerminator() - If this is a well formed basic block, then this returns
- /// a pointer to the terminator instruction. If it is not, then you get a
- /// null pointer back.
- ///
- TerminatorInst *getTerminator();
- const TerminatorInst *getTerminator() const;
-
- /// Returns a pointer to the first instructon in this block that is not a
- /// PHINode instruction. When adding instruction to the beginning of the
- /// basic block, they should be added before the returned value, not before
- /// the first instruction, which might be PHI.
- /// Returns 0 is there's no non-PHI instruction.
- Instruction* getFirstNonPHI();
-
- /// removeFromParent - This method unlinks 'this' from the containing
- /// function, but does not delete it.
- ///
- void removeFromParent();
-
- /// eraseFromParent - This method unlinks 'this' from the containing function
- /// and deletes it.
- ///
- void eraseFromParent();
-
- /// moveBefore - Unlink this basic block from its current function and
- /// insert it into the function that MovePos lives in, right before MovePos.
- void moveBefore(BasicBlock *MovePos);
-
- /// moveAfter - Unlink this basic block from its current function and
- /// insert it into the function that MovePos lives in, right after MovePos.
- void moveAfter(BasicBlock *MovePos);
-
-
- /// getSinglePredecessor - If this basic block has a single predecessor block,
- /// return the block, otherwise return a null pointer.
- BasicBlock *getSinglePredecessor();
- const BasicBlock *getSinglePredecessor() const {
- return const_cast<BasicBlock*>(this)->getSinglePredecessor();
- }
-
- //===--------------------------------------------------------------------===//
- /// Instruction iterator methods
- ///
- inline iterator begin() { return InstList.begin(); }
- inline const_iterator begin() const { return InstList.begin(); }
- inline iterator end () { return InstList.end(); }
- inline const_iterator end () const { return InstList.end(); }
-
- inline size_t size() const { return InstList.size(); }
- inline bool empty() const { return InstList.empty(); }
- inline const Instruction &front() const { return InstList.front(); }
- inline Instruction &front() { return InstList.front(); }
- inline const Instruction &back() const { return InstList.back(); }
- inline Instruction &back() { return InstList.back(); }
-
- /// getInstList() - Return the underlying instruction list container. You
- /// need to access it directly if you want to modify it currently.
- ///
- const InstListType &getInstList() const { return InstList; }
- InstListType &getInstList() { return InstList; }
-
- virtual void print(std::ostream &OS) const { print(OS, 0); }
- void print(std::ostream *OS) const { if (OS) print(*OS); }
- void print(std::ostream &OS, AssemblyAnnotationWriter *AAW) const;
-
- /// Methods for support type inquiry through isa, cast, and dyn_cast:
- static inline bool classof(const BasicBlock *) { return true; }
- static inline bool classof(const Value *V) {
- return V->getValueID() == Value::BasicBlockVal;
- }
-
- /// dropAllReferences() - This function causes all the subinstructions to "let
- /// go" of all references that they are maintaining. This allows one to
- /// 'delete' a whole class at a time, even though there may be circular
- /// references... first all references are dropped, and all use counts go to
- /// zero. Then everything is delete'd for real. Note that no operations are
- /// valid on an object that has "dropped all references", except operator
- /// delete.
- ///
- void dropAllReferences();
-
- /// removePredecessor - This method is used to notify a BasicBlock that the
- /// specified Predecessor of the block is no longer able to reach it. This is
- /// actually not used to update the Predecessor list, but is actually used to
- /// update the PHI nodes that reside in the block. Note that this should be
- /// called while the predecessor still refers to this block.
- ///
- void removePredecessor(BasicBlock *Pred, bool DontDeleteUselessPHIs = false);
-
- /// splitBasicBlock - This splits a basic block into two at the specified
- /// instruction. Note that all instructions BEFORE the specified iterator
- /// stay as part of the original basic block, an unconditional branch is added
- /// to the original BB, and the rest of the instructions in the BB are moved
- /// to the new BB, including the old terminator. The newly formed BasicBlock
- /// is returned. This function invalidates the specified iterator.
- ///
- /// Note that this only works on well formed basic blocks (must have a
- /// terminator), and 'I' must not be the end of instruction list (which would
- /// cause a degenerate basic block to be formed, having a terminator inside of
- /// the basic block).
- ///
- BasicBlock *splitBasicBlock(iterator I, const std::string &BBName = "");
-
-
- static unsigned getInstListOffset() {
- BasicBlock *Obj = 0;
- return unsigned(reinterpret_cast<uintptr_t>(&Obj->InstList));
- }
-
-private:
- // getNext/Prev - Return the next or previous basic block in the list. Access
- // these with Function::iterator.
- BasicBlock *getNext() { return Next; }
- const BasicBlock *getNext() const { return Next; }
- BasicBlock *getPrev() { return Prev; }
- const BasicBlock *getPrev() const { return Prev; }
-};
-
-inline int
-ilist_traits<Instruction>::getListOffset() {
- return BasicBlock::getInstListOffset();
-}
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/Bitcode/Archive.h b/release_23/include/llvm/Bitcode/Archive.h
deleted file mode 100644
index 50562e490ff9..000000000000
--- a/release_23/include/llvm/Bitcode/Archive.h
+++ /dev/null
@@ -1,557 +0,0 @@
-//===-- llvm/Bitcode/Archive.h - LLVM Bitcode Archive -----------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This header file declares the Archive and ArchiveMember classes that provide
-// manipulation of LLVM Archive files. The implementation is provided by the
-// lib/Bitcode/Archive library. This library is used to read and write
-// archive (*.a) files that contain LLVM bitcode files (or others).
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_BITCODE_ARCHIVE_H
-#define LLVM_BITCODE_ARCHIVE_H
-
-#include "llvm/ADT/ilist"
-#include "llvm/System/Path.h"
-#include <map>
-#include <set>
-#include <fstream>
-
-namespace llvm {
- class MemoryBuffer;
-
-// Forward declare classes
-class ModuleProvider; // From VMCore
-class Module; // From VMCore
-class Archive; // Declared below
-class ArchiveMemberHeader; // Internal implementation class
-
-/// This class is the main class manipulated by users of the Archive class. It
-/// holds information about one member of the Archive. It is also the element
-/// stored by the Archive's ilist, the Archive's main abstraction. Because of
-/// the special requirements of archive files, users are not permitted to
-/// construct ArchiveMember instances. You should obtain them from the methods
-/// of the Archive class instead.
-/// @brief This class represents a single archive member.
-class ArchiveMember {
- /// @name Types
- /// @{
- public:
- /// These flags are used internally by the archive member to specify various
- /// characteristics of the member. The various "is" methods below provide
- /// access to the flags. The flags are not user settable.
- enum Flags {
- CompressedFlag = 1, ///< Member is a normal compressed file
- SVR4SymbolTableFlag = 2, ///< Member is a SVR4 symbol table
- BSD4SymbolTableFlag = 4, ///< Member is a BSD4 symbol table
- LLVMSymbolTableFlag = 8, ///< Member is an LLVM symbol table
- BitcodeFlag = 16, ///< Member is bitcode
- HasPathFlag = 64, ///< Member has a full or partial path
- HasLongFilenameFlag = 128, ///< Member uses the long filename syntax
- StringTableFlag = 256 ///< Member is an ar(1) format string table
- };
-
- /// @}
- /// @name Accessors
- /// @{
- public:
- /// @returns the parent Archive instance
- /// @brief Get the archive associated with this member
- Archive* getArchive() const { return parent; }
-
- /// @returns the path to the Archive's file
- /// @brief Get the path to the archive member
- const sys::Path& getPath() const { return path; }
-
- /// The "user" is the owner of the file per Unix security. This may not
- /// have any applicability on non-Unix systems but is a required component
- /// of the "ar" file format.
- /// @brief Get the user associated with this archive member.
- unsigned getUser() const { return info.getUser(); }
-
- /// The "group" is the owning group of the file per Unix security. This
- /// may not have any applicability on non-Unix systems but is a required
- /// component of the "ar" file format.
- /// @brief Get the group associated with this archive member.
- unsigned getGroup() const { return info.getGroup(); }
-
- /// The "mode" specifies the access permissions for the file per Unix
- /// security. This may not have any applicabiity on non-Unix systems but is
- /// a required component of the "ar" file format.
- /// @brief Get the permission mode associated with this archive member.
- unsigned getMode() const { return info.getMode(); }
-
- /// This method returns the time at which the archive member was last
- /// modified when it was not in the archive.
- /// @brief Get the time of last modification of the archive member.
- sys::TimeValue getModTime() const { return info.getTimestamp(); }
-
- /// @returns the size of the archive member in bytes.
- /// @brief Get the size of the archive member.
- uint64_t getSize() const { return info.getSize(); }
-
- /// This method returns the total size of the archive member as it
- /// appears on disk. This includes the file content, the header, the
- /// long file name if any, and the padding.
- /// @brief Get total on-disk member size.
- unsigned getMemberSize() const;
-
- /// This method will return a pointer to the in-memory content of the
- /// archive member, if it is available. If the data has not been loaded
- /// into memory, the return value will be null.
- /// @returns a pointer to the member's data.
- /// @brief Get the data content of the archive member
- const void* getData() const { return data; }
-
- /// This method determines if the member is a regular compressed file.
- /// @returns true iff the archive member is a compressed regular file.
- /// @brief Determine if the member is a compressed regular file.
- bool isCompressed() const { return flags&CompressedFlag; }
-
- /// @returns true iff the member is a SVR4 (non-LLVM) symbol table
- /// @brief Determine if this member is a SVR4 symbol table.
- bool isSVR4SymbolTable() const { return flags&SVR4SymbolTableFlag; }
-
- /// @returns true iff the member is a BSD4.4 (non-LLVM) symbol table
- /// @brief Determine if this member is a BSD4.4 symbol table.
- bool isBSD4SymbolTable() const { return flags&BSD4SymbolTableFlag; }
-
- /// @returns true iff the archive member is the LLVM symbol table
- /// @brief Determine if this member is the LLVM symbol table.
- bool isLLVMSymbolTable() const { return flags&LLVMSymbolTableFlag; }
-
- /// @returns true iff the archive member is the ar(1) string table
- /// @brief Determine if this member is the ar(1) string table.
- bool isStringTable() const { return flags&StringTableFlag; }
-
- /// @returns true iff the archive member is a bitcode file.
- /// @brief Determine if this member is a bitcode file.
- bool isBitcode() const { return flags&BitcodeFlag; }
-
- /// @returns true iff the file name contains a path (directory) component.
- /// @brief Determine if the member has a path
- bool hasPath() const { return flags&HasPathFlag; }
-
- /// Long filenames are an artifact of the ar(1) file format which allows
- /// up to sixteen characters in its header and doesn't allow a path
- /// separator character (/). To avoid this, a "long format" member name is
- /// allowed that doesn't have this restriction. This method determines if
- /// that "long format" is used for this member.
- /// @returns true iff the file name uses the long form
- /// @brief Determin if the member has a long file name
- bool hasLongFilename() const { return flags&HasLongFilenameFlag; }
-
- /// This method returns the status info (like Unix stat(2)) for the archive
- /// member. The status info provides the file's size, permissions, and
- /// modification time. The contents of the Path::StatusInfo structure, other
- /// than the size and modification time, may not have utility on non-Unix
- /// systems.
- /// @returns the status info for the archive member
- /// @brief Obtain the status info for the archive member
- const sys::FileStatus &getFileStatus() const { return info; }
-
- /// This method causes the archive member to be replaced with the contents
- /// of the file specified by \p File. The contents of \p this will be
- /// updated to reflect the new data from \p File. The \p File must exist and
- /// be readable on entry to this method.
- /// @returns true if an error occurred, false otherwise
- /// @brief Replace contents of archive member with a new file.
- bool replaceWith(const sys::Path &aFile, std::string* ErrMsg);
-
- /// @}
- /// @name ilist methods - do not use
- /// @{
- public:
- const ArchiveMember *getNext() const { return next; }
- const ArchiveMember *getPrev() const { return prev; }
- ArchiveMember *getNext() { return next; }
- ArchiveMember *getPrev() { return prev; }
- void setPrev(ArchiveMember* p) { prev = p; }
- void setNext(ArchiveMember* n) { next = n; }
-
- /// @}
- /// @name Data
- /// @{
- private:
- ArchiveMember* next; ///< Pointer to next archive member
- ArchiveMember* prev; ///< Pointer to previous archive member
- Archive* parent; ///< Pointer to parent archive
- sys::PathWithStatus path; ///< Path of file containing the member
- sys::FileStatus info; ///< Status info (size,mode,date)
- unsigned flags; ///< Flags about the archive member
- const void* data; ///< Data for the member
-
- /// @}
- /// @name Constructors
- /// @{
- public:
- /// The default constructor is only used by the Archive's iplist when it
- /// constructs the list's sentry node.
- ArchiveMember();
-
- private:
- /// Used internally by the Archive class to construct an ArchiveMember.
- /// The contents of the ArchiveMember are filled out by the Archive class.
- explicit ArchiveMember(Archive *PAR);
-
- // So Archive can construct an ArchiveMember
- friend class llvm::Archive;
- /// @}
-};
-
-/// This class defines the interface to LLVM Archive files. The Archive class
-/// presents the archive file as an ilist of ArchiveMember objects. The members
-/// can be rearranged in any fashion either by directly editing the ilist or by
-/// using editing methods on the Archive class (recommended). The Archive
-/// class also provides several ways of accessing the archive file for various
-/// purposes such as editing and linking. Full symbol table support is provided
-/// for loading only those files that resolve symbols. Note that read
-/// performance of this library is _crucial_ for performance of JIT type
-/// applications and the linkers. Consequently, the implementation of the class
-/// is optimized for reading.
-class Archive {
-
- /// @name Types
- /// @{
- public:
- /// This is the ilist type over which users may iterate to examine
- /// the contents of the archive
- /// @brief The ilist type of ArchiveMembers that Archive contains.
- typedef iplist<ArchiveMember> MembersList;
-
- /// @brief Forward mutable iterator over ArchiveMember
- typedef MembersList::iterator iterator;
-
- /// @brief Forward immutable iterator over ArchiveMember
- typedef MembersList::const_iterator const_iterator;
-
- /// @brief Reverse mutable iterator over ArchiveMember
- typedef std::reverse_iterator<iterator> reverse_iterator;
-
- /// @brief Reverse immutable iterator over ArchiveMember
- typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
-
- /// @brief The in-memory version of the symbol table
- typedef std::map<std::string,unsigned> SymTabType;
-
- /// @}
- /// @name ilist accessor methods
- /// @{
- public:
- inline iterator begin() { return members.begin(); }
- inline const_iterator begin() const { return members.begin(); }
- inline iterator end () { return members.end(); }
- inline const_iterator end () const { return members.end(); }
-
- inline reverse_iterator rbegin() { return members.rbegin(); }
- inline const_reverse_iterator rbegin() const { return members.rbegin(); }
- inline reverse_iterator rend () { return members.rend(); }
- inline const_reverse_iterator rend () const { return members.rend(); }
-
- inline size_t size() const { return members.size(); }
- inline bool empty() const { return members.empty(); }
- inline const ArchiveMember& front() const { return members.front(); }
- inline ArchiveMember& front() { return members.front(); }
- inline const ArchiveMember& back() const { return members.back(); }
- inline ArchiveMember& back() { return members.back(); }
-
- /// @}
- /// @name ilist mutator methods
- /// @{
- public:
- /// This method splices a \p src member from an archive (possibly \p this),
- /// to a position just before the member given by \p dest in \p this. When
- /// the archive is written, \p src will be written in its new location.
- /// @brief Move a member to a new location
- inline void splice(iterator dest, Archive& arch, iterator src)
- { return members.splice(dest,arch.members,src); }
-
- /// This method erases a \p target member from the archive. When the
- /// archive is written, it will no longer contain \p target. The associated
- /// ArchiveMember is deleted.
- /// @brief Erase a member.
- inline iterator erase(iterator target) { return members.erase(target); }
-
- /// @}
- /// @name Constructors
- /// @{
- public:
- /// Create an empty archive file and associate it with the \p Filename. This
- /// method does not actually create the archive disk file. It creates an
- /// empty Archive object. If the writeToDisk method is called, the archive
- /// file \p Filename will be created at that point, with whatever content
- /// the returned Archive object has at that time.
- /// @returns An Archive* that represents the new archive file.
- /// @brief Create an empty Archive.
- static Archive* CreateEmpty(
- const sys::Path& Filename ///< Name of the archive to (eventually) create.
- );
-
- /// Open an existing archive and load its contents in preparation for
- /// editing. After this call, the member ilist is completely populated based
- /// on the contents of the archive file. You should use this form of open if
- /// you intend to modify the archive or traverse its contents (e.g. for
- /// printing).
- /// @brief Open and load an archive file
- static Archive* OpenAndLoad(
- const sys::Path& filePath, ///< The file path to open and load
- std::string* ErrorMessage ///< An optional error string
- );
-
- /// This method opens an existing archive file from \p Filename and reads in
- /// its symbol table without reading in any of the archive's members. This
- /// reduces both I/O and cpu time in opening the archive if it is to be used
- /// solely for symbol lookup (e.g. during linking). The \p Filename must
- /// exist and be an archive file or an exception will be thrown. This form
- /// of opening the archive is intended for read-only operations that need to
- /// locate members via the symbol table for link editing. Since the archve
- /// members are not read by this method, the archive will appear empty upon
- /// return. If editing operations are performed on the archive, they will
- /// completely replace the contents of the archive! It is recommended that
- /// if this form of opening the archive is used that only the symbol table
- /// lookup methods (getSymbolTable, findModuleDefiningSymbol, and
- /// findModulesDefiningSymbols) be used.
- /// @throws std::string if an error occurs opening the file
- /// @returns an Archive* that represents the archive file.
- /// @brief Open an existing archive and load its symbols.
- static Archive* OpenAndLoadSymbols(
- const sys::Path& Filename, ///< Name of the archive file to open
- std::string* ErrorMessage=0 ///< An optional error string
- );
-
- /// This destructor cleans up the Archive object, releases all memory, and
- /// closes files. It does nothing with the archive file on disk. If you
- /// haven't used the writeToDisk method by the time the destructor is
- /// called, all changes to the archive will be lost.
- /// @throws std::string if an error occurs
- /// @brief Destruct in-memory archive
- ~Archive();
-
- /// @}
- /// @name Accessors
- /// @{
- public:
- /// @returns the path to the archive file.
- /// @brief Get the archive path.
- const sys::Path& getPath() { return archPath; }
-
- /// This method is provided so that editing methods can be invoked directly
- /// on the Archive's iplist of ArchiveMember. However, it is recommended
- /// that the usual STL style iterator interface be used instead.
- /// @returns the iplist of ArchiveMember
- /// @brief Get the iplist of the members
- MembersList& getMembers() { return members; }
-
- /// This method allows direct query of the Archive's symbol table. The
- /// symbol table is a std::map of std::string (the symbol) to unsigned (the
- /// file offset). Note that for efficiency reasons, the offset stored in
- /// the symbol table is not the actual offset. It is the offset from the
- /// beginning of the first "real" file member (after the symbol table). Use
- /// the getFirstFileOffset() to obtain that offset and add this value to the
- /// offset in the symbol table to obtain the real file offset. Note that
- /// there is purposefully no interface provided by Archive to look up
- /// members by their offset. Use the findModulesDefiningSymbols and
- /// findModuleDefiningSymbol methods instead.
- /// @returns the Archive's symbol table.
- /// @brief Get the archive's symbol table
- const SymTabType& getSymbolTable() { return symTab; }
-
- /// This method returns the offset in the archive file to the first "real"
- /// file member. Archive files, on disk, have a signature and might have a
- /// symbol table that precedes the first actual file member. This method
- /// allows you to determine what the size of those fields are.
- /// @returns the offset to the first "real" file member in the archive.
- /// @brief Get the offset to the first "real" file member in the archive.
- unsigned getFirstFileOffset() { return firstFileOffset; }
-
- /// This method will scan the archive for bitcode modules, interpret them
- /// and return a vector of the instantiated modules in \p Modules. If an
- /// error occurs, this method will return true. If \p ErrMessage is not null
- /// and an error occurs, \p *ErrMessage will be set to a string explaining
- /// the error that occurred.
- /// @returns true if an error occurred
- /// @brief Instantiate all the bitcode modules located in the archive
- bool getAllModules(std::vector<Module*>& Modules, std::string* ErrMessage);
-
- /// This accessor looks up the \p symbol in the archive's symbol table and
- /// returns the associated module that defines that symbol. This method can
- /// be called as many times as necessary. This is handy for linking the
- /// archive into another module based on unresolved symbols. Note that the
- /// ModuleProvider returned by this accessor should not be deleted by the
- /// caller. It is managed internally by the Archive class. It is possible
- /// that multiple calls to this accessor will return the same ModuleProvider
- /// instance because the associated module defines multiple symbols.
- /// @returns The ModuleProvider* found or null if the archive does not
- /// contain a module that defines the \p symbol.
- /// @brief Look up a module by symbol name.
- ModuleProvider* findModuleDefiningSymbol(
- const std::string& symbol, ///< Symbol to be sought
- std::string* ErrMessage ///< Error message storage, if non-zero
- );
-
- /// This method is similar to findModuleDefiningSymbol but allows lookup of
- /// more than one symbol at a time. If \p symbols contains a list of
- /// undefined symbols in some module, then calling this method is like
- /// making one complete pass through the archive to resolve symbols but is
- /// more efficient than looking at the individual members. Note that on
- /// exit, the symbols resolved by this method will be removed from \p
- /// symbols to ensure they are not re-searched on a subsequent call. If
- /// you need to retain the list of symbols, make a copy.
- /// @brief Look up multiple symbols in the archive.
- bool findModulesDefiningSymbols(
- std::set<std::string>& symbols, ///< Symbols to be sought
- std::set<ModuleProvider*>& modules, ///< The modules matching \p symbols
- std::string* ErrMessage ///< Error msg storage, if non-zero
- );
-
- /// This method determines whether the archive is a properly formed llvm
- /// bitcode archive. It first makes sure the symbol table has been loaded
- /// and has a non-zero size. If it does, then it is an archive. If not,
- /// then it tries to load all the bitcode modules of the archive. Finally,
- /// it returns whether it was successfull.
- /// @returns true if the archive is a proper llvm bitcode archive
- /// @brief Determine whether the archive is a proper llvm bitcode archive.
- bool isBitcodeArchive();
-
- /// @}
- /// @name Mutators
- /// @{
- public:
- /// This method is the only way to get the archive written to disk. It
- /// creates or overwrites the file specified when \p this was created
- /// or opened. The arguments provide options for writing the archive. If
- /// \p CreateSymbolTable is true, the archive is scanned for bitcode files
- /// and a symbol table of the externally visible function and global
- /// variable names is created. If \p TruncateNames is true, the names of the
- /// archive members will have their path component stripped and the file
- /// name will be truncated at 15 characters. If \p Compress is specified,
- /// all archive members will be compressed before being written. If
- /// \p PrintSymTab is true, the symbol table will be printed to std::cout.
- /// @returns true if an error occurred, \p error set to error message
- /// @returns false if the writing succeeded.
- /// @brief Write (possibly modified) archive contents to disk
- bool writeToDisk(
- bool CreateSymbolTable=false, ///< Create Symbol table
- bool TruncateNames=false, ///< Truncate the filename to 15 chars
- bool Compress=false, ///< Compress files
- std::string* ErrMessage=0 ///< If non-null, where error msg is set
- );
-
- /// This method adds a new file to the archive. The \p filename is examined
- /// to determine just enough information to create an ArchiveMember object
- /// which is then inserted into the Archive object's ilist at the location
- /// given by \p where.
- /// @returns true if an error occured, false otherwise
- /// @brief Add a file to the archive.
- bool addFileBefore(
- const sys::Path& filename, ///< The file to be added
- iterator where, ///< Insertion point
- std::string* ErrMsg ///< Optional error message location
- );
-
- /// @}
- /// @name Implementation
- /// @{
- protected:
- /// @brief Construct an Archive for \p filename and optionally map it
- /// into memory.
- explicit Archive(const sys::Path& filename);
-
- /// @param data The symbol table data to be parsed
- /// @param len The length of the symbol table data
- /// @param error Set to address of a std::string to get error messages
- /// @returns false on error
- /// @brief Parse the symbol table at \p data.
- bool parseSymbolTable(const void* data,unsigned len,std::string* error);
-
- /// @returns A fully populated ArchiveMember or 0 if an error occurred.
- /// @brief Parse the header of a member starting at \p At
- ArchiveMember* parseMemberHeader(
- const char*&At, ///< The pointer to the location we're parsing
- const char*End, ///< The pointer to the end of the archive
- std::string* error ///< Optional error message catcher
- );
-
- /// @param ErrMessage Set to address of a std::string to get error messages
- /// @returns false on error
- /// @brief Check that the archive signature is correct
- bool checkSignature(std::string* ErrMessage);
-
- /// @param ErrMessage Set to address of a std::string to get error messages
- /// @returns false on error
- /// @brief Load the entire archive.
- bool loadArchive(std::string* ErrMessage);
-
- /// @param ErrMessage Set to address of a std::string to get error messages
- /// @returns false on error
- /// @brief Load just the symbol table.
- bool loadSymbolTable(std::string* ErrMessage);
-
- /// @brief Write the symbol table to an ofstream.
- void writeSymbolTable(std::ofstream& ARFile);
-
- /// Writes one ArchiveMember to an ofstream. If an error occurs, returns
- /// false, otherwise true. If an error occurs and error is non-null then
- /// it will be set to an error message.
- /// @returns false Writing member succeeded
- /// @returns true Writing member failed, \p error set to error message
- bool writeMember(
- const ArchiveMember& member, ///< The member to be written
- std::ofstream& ARFile, ///< The file to write member onto
- bool CreateSymbolTable, ///< Should symbol table be created?
- bool TruncateNames, ///< Should names be truncated to 11 chars?
- bool ShouldCompress, ///< Should the member be compressed?
- std::string* ErrMessage ///< If non-null, place were error msg is set
- );
-
- /// @brief Fill in an ArchiveMemberHeader from ArchiveMember.
- bool fillHeader(const ArchiveMember&mbr,
- ArchiveMemberHeader& hdr,int sz, bool TruncateNames) const;
-
- /// @brief Maps archive into memory
- bool mapToMemory(std::string* ErrMsg);
-
- /// @brief Frees all the members and unmaps the archive file.
- void cleanUpMemory();
-
- /// This type is used to keep track of bitcode modules loaded from the
- /// symbol table. It maps the file offset to a pair that consists of the
- /// associated ArchiveMember and the ModuleProvider.
- /// @brief Module mapping type
- typedef std::map<unsigned,std::pair<ModuleProvider*,ArchiveMember*> >
- ModuleMap;
-
-
- /// @}
- /// @name Data
- /// @{
- protected:
- sys::Path archPath; ///< Path to the archive file we read/write
- MembersList members; ///< The ilist of ArchiveMember
- MemoryBuffer *mapfile; ///< Raw Archive contents mapped into memory
- const char* base; ///< Base of the memory mapped file data
- SymTabType symTab; ///< The symbol table
- std::string strtab; ///< The string table for long file names
- unsigned symTabSize; ///< Size in bytes of symbol table
- unsigned firstFileOffset; ///< Offset to first normal file.
- ModuleMap modules; ///< The modules loaded via symbol lookup.
- ArchiveMember* foreignST; ///< This holds the foreign symbol table.
- /// @}
- /// @name Hidden
- /// @{
- private:
- Archive(); ///< Do not implement
- Archive(const Archive&); ///< Do not implement
- Archive& operator=(const Archive&); ///< Do not implement
- /// @}
-};
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/Bitcode/BitCodes.h b/release_23/include/llvm/Bitcode/BitCodes.h
deleted file mode 100644
index f140cc3b19d9..000000000000
--- a/release_23/include/llvm/Bitcode/BitCodes.h
+++ /dev/null
@@ -1,181 +0,0 @@
-//===- BitCodes.h - Enum values for the bitcode format ----------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This header Bitcode enum values.
-//
-// The enum values defined in this file should be considered permanent. If
-// new features are added, they should have values added at the end of the
-// respective lists.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_BITCODE_BITCODES_H
-#define LLVM_BITCODE_BITCODES_H
-
-#include "llvm/ADT/SmallVector.h"
-#include "llvm/Support/DataTypes.h"
-#include <cassert>
-
-namespace llvm {
-namespace bitc {
- enum StandardWidths {
- BlockIDWidth = 8, // We use VBR-8 for block IDs.
- CodeLenWidth = 4, // Codelen are VBR-4.
- BlockSizeWidth = 32 // BlockSize up to 2^32 32-bit words = 32GB per block.
- };
-
- // The standard abbrev namespace always has a way to exit a block, enter a
- // nested block, define abbrevs, and define an unabbreviated record.
- enum FixedAbbrevIDs {
- END_BLOCK = 0, // Must be zero to guarantee termination for broken bitcode.
- ENTER_SUBBLOCK = 1,
-
- /// DEFINE_ABBREV - Defines an abbrev for the current block. It consists
- /// of a vbr5 for # operand infos. Each operand info is emitted with a
- /// single bit to indicate if it is a literal encoding. If so, the value is
- /// emitted with a vbr8. If not, the encoding is emitted as 3 bits followed
- /// by the info value as a vbr5 if needed.
- DEFINE_ABBREV = 2,
-
- // UNABBREV_RECORDs are emitted with a vbr6 for the record code, followed by
- // a vbr6 for the # operands, followed by vbr6's for each operand.
- UNABBREV_RECORD = 3,
-
- // This is not a code, this is a marker for the first abbrev assignment.
- FIRST_APPLICATION_ABBREV = 4
- };
-
- /// StandardBlockIDs - All bitcode files can optionally include a BLOCKINFO
- /// block, which contains metadata about other blocks in the file.
- enum StandardBlockIDs {
- /// BLOCKINFO_BLOCK is used to define metadata about blocks, for example,
- /// standard abbrevs that should be available to all blocks of a specified
- /// ID.
- BLOCKINFO_BLOCK_ID = 0,
-
- // Block IDs 1-7 are reserved for future expansion.
- FIRST_APPLICATION_BLOCKID = 8
- };
-
- /// BlockInfoCodes - The blockinfo block contains metadata about user-defined
- /// blocks.
- enum BlockInfoCodes {
- BLOCKINFO_CODE_SETBID = 1 // SETBID: [blockid#]
- // DEFINE_ABBREV has magic semantics here, applying to the current SETBID'd
- // block, instead of the BlockInfo block.
- // BLOCKNAME: give string name to block, if desired.
- };
-
-} // End bitc namespace
-
-/// BitCodeAbbrevOp - This describes one or more operands in an abbreviation.
-/// This is actually a union of two different things:
-/// 1. It could be a literal integer value ("the operand is always 17").
-/// 2. It could be an encoding specification ("this operand encoded like so").
-///
-class BitCodeAbbrevOp {
- uint64_t Val; // A literal value or data for an encoding.
- bool IsLiteral : 1; // Indicate whether this is a literal value or not.
- unsigned Enc : 3; // The encoding to use.
-public:
- enum Encoding {
- Fixed = 1, // A fixed width field, Val specifies number of bits.
- VBR = 2, // A VBR field where Val specifies the width of each chunk.
- Array = 3, // A sequence of fields, next field species elt encoding.
- Char6 = 4 // A 6-bit fixed field which maps to [a-zA-Z0-9._].
- };
-
- explicit BitCodeAbbrevOp(uint64_t V) : Val(V), IsLiteral(true) {}
- explicit BitCodeAbbrevOp(Encoding E, uint64_t Data = 0)
- : Val(Data), IsLiteral(false), Enc(E) {}
-
- bool isLiteral() const { return IsLiteral; }
- bool isEncoding() const { return !IsLiteral; }
-
- // Accessors for literals.
- uint64_t getLiteralValue() const { assert(isLiteral()); return Val; }
-
- // Accessors for encoding info.
- Encoding getEncoding() const { assert(isEncoding()); return (Encoding)Enc; }
- uint64_t getEncodingData() const {
- assert(isEncoding() && hasEncodingData());
- return Val;
- }
-
- bool hasEncodingData() const { return hasEncodingData(getEncoding()); }
- static bool hasEncodingData(Encoding E) {
- switch (E) {
- default: assert(0 && "Unknown encoding");
- case Fixed:
- case VBR:
- return true;
- case Array:
- case Char6:
- return false;
- }
- }
-
- /// isChar6 - Return true if this character is legal in the Char6 encoding.
- static bool isChar6(char C) {
- if (C >= 'a' && C <= 'z') return true;
- if (C >= 'A' && C <= 'Z') return true;
- if (C >= '0' && C <= '9') return true;
- if (C == '.' || C == '_') return true;
- return false;
- }
- static unsigned EncodeChar6(char C) {
- if (C >= 'a' && C <= 'z') return C-'a';
- if (C >= 'A' && C <= 'Z') return C-'A'+26;
- if (C >= '0' && C <= '9') return C-'0'+26+26;
- if (C == '.') return 62;
- if (C == '_') return 63;
- assert(0 && "Not a value Char6 character!");
- return 0;
- }
-
- static char DecodeChar6(unsigned V) {
- assert((V & ~63) == 0 && "Not a Char6 encoded character!");
- if (V < 26) return V+'a';
- if (V < 26+26) return V-26+'A';
- if (V < 26+26+10) return V-26-26+'0';
- if (V == 62) return '.';
- if (V == 63) return '_';
- assert(0 && "Not a value Char6 character!");
- return ' ';
- }
-
-};
-
-/// BitCodeAbbrev - This class represents an abbreviation record. An
-/// abbreviation allows a complex record that has redundancy to be stored in a
-/// specialized format instead of the fully-general, fully-vbr, format.
-class BitCodeAbbrev {
- SmallVector<BitCodeAbbrevOp, 8> OperandList;
- unsigned char RefCount; // Number of things using this.
- ~BitCodeAbbrev() {}
-public:
- BitCodeAbbrev() : RefCount(1) {}
-
- void addRef() { ++RefCount; }
- void dropRef() { if (--RefCount == 0) delete this; }
-
- unsigned getNumOperandInfos() const {
- return static_cast<unsigned>(OperandList.size());
- }
- const BitCodeAbbrevOp &getOperandInfo(unsigned N) const {
- return OperandList[N];
- }
-
- void Add(const BitCodeAbbrevOp &OpInfo) {
- OperandList.push_back(OpInfo);
- }
-};
-} // End llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/Bitcode/BitstreamReader.h b/release_23/include/llvm/Bitcode/BitstreamReader.h
deleted file mode 100644
index 3b7a9b61e6aa..000000000000
--- a/release_23/include/llvm/Bitcode/BitstreamReader.h
+++ /dev/null
@@ -1,482 +0,0 @@
-//===- BitstreamReader.h - Low-level bitstream reader interface -*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This header defines the BitstreamReader class. This class can be used to
-// read an arbitrary bitstream, regardless of its contents.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef BITSTREAM_READER_H
-#define BITSTREAM_READER_H
-
-#include "llvm/Bitcode/BitCodes.h"
-#include <vector>
-
-namespace llvm {
-
- class Deserializer;
-
-class BitstreamReader {
- const unsigned char *NextChar;
- const unsigned char *LastChar;
- friend class Deserializer;
-
- /// CurWord - This is the current data we have pulled from the stream but have
- /// not returned to the client.
- uint32_t CurWord;
-
- /// BitsInCurWord - This is the number of bits in CurWord that are valid. This
- /// is always from [0...31] inclusive.
- unsigned BitsInCurWord;
-
- // CurCodeSize - This is the declared size of code values used for the current
- // block, in bits.
- unsigned CurCodeSize;
-
- /// CurAbbrevs - Abbrevs installed at in this block.
- std::vector<BitCodeAbbrev*> CurAbbrevs;
-
- struct Block {
- unsigned PrevCodeSize;
- std::vector<BitCodeAbbrev*> PrevAbbrevs;
- explicit Block(unsigned PCS) : PrevCodeSize(PCS) {}
- };
-
- /// BlockScope - This tracks the codesize of parent blocks.
- SmallVector<Block, 8> BlockScope;
-
- /// BlockInfo - This contains information emitted to BLOCKINFO_BLOCK blocks.
- /// These describe abbreviations that all blocks of the specified ID inherit.
- struct BlockInfo {
- unsigned BlockID;
- std::vector<BitCodeAbbrev*> Abbrevs;
- };
- std::vector<BlockInfo> BlockInfoRecords;
-
- /// FirstChar - This remembers the first byte of the stream.
- const unsigned char *FirstChar;
-public:
- BitstreamReader() {
- NextChar = FirstChar = LastChar = 0;
- CurWord = 0;
- BitsInCurWord = 0;
- CurCodeSize = 0;
- }
-
- BitstreamReader(const unsigned char *Start, const unsigned char *End) {
- init(Start, End);
- }
-
- void init(const unsigned char *Start, const unsigned char *End) {
- NextChar = FirstChar = Start;
- LastChar = End;
- assert(((End-Start) & 3) == 0 &&"Bitcode stream not a multiple of 4 bytes");
- CurWord = 0;
- BitsInCurWord = 0;
- CurCodeSize = 2;
- }
-
- ~BitstreamReader() {
- // Abbrevs could still exist if the stream was broken. If so, don't leak
- // them.
- for (unsigned i = 0, e = static_cast<unsigned>(CurAbbrevs.size());
- i != e; ++i)
- CurAbbrevs[i]->dropRef();
-
- for (unsigned S = 0, e = static_cast<unsigned>(BlockScope.size());
- S != e; ++S) {
- std::vector<BitCodeAbbrev*> &Abbrevs = BlockScope[S].PrevAbbrevs;
- for (unsigned i = 0, e = static_cast<unsigned>(Abbrevs.size());
- i != e; ++i)
- Abbrevs[i]->dropRef();
- }
-
- // Free the BlockInfoRecords.
- while (!BlockInfoRecords.empty()) {
- BlockInfo &Info = BlockInfoRecords.back();
- // Free blockinfo abbrev info.
- for (unsigned i = 0, e = static_cast<unsigned>(Info.Abbrevs.size());
- i != e; ++i)
- Info.Abbrevs[i]->dropRef();
- BlockInfoRecords.pop_back();
- }
- }
-
- bool AtEndOfStream() const {
- return NextChar == LastChar && BitsInCurWord == 0;
- }
-
- /// GetCurrentBitNo - Return the bit # of the bit we are reading.
- uint64_t GetCurrentBitNo() const {
- return (NextChar-FirstChar)*8 + ((32-BitsInCurWord) & 31);
- }
-
- /// JumpToBit - Reset the stream to the specified bit number.
- void JumpToBit(uint64_t BitNo) {
- uintptr_t ByteNo = uintptr_t(BitNo/8) & ~3;
- uintptr_t WordBitNo = uintptr_t(BitNo) & 31;
- assert(ByteNo < (uintptr_t)(LastChar-FirstChar) && "Invalid location");
-
- // Move the cursor to the right word.
- NextChar = FirstChar+ByteNo;
- BitsInCurWord = 0;
- CurWord = 0;
-
- // Skip over any bits that are already consumed.
- if (WordBitNo) {
- NextChar -= 4;
- Read(static_cast<unsigned>(WordBitNo));
- }
- }
-
- /// GetAbbrevIDWidth - Return the number of bits used to encode an abbrev #.
- unsigned GetAbbrevIDWidth() const { return CurCodeSize; }
-
- uint32_t Read(unsigned NumBits) {
- // If the field is fully contained by CurWord, return it quickly.
- if (BitsInCurWord >= NumBits) {
- uint32_t R = CurWord & ((1U << NumBits)-1);
- CurWord >>= NumBits;
- BitsInCurWord -= NumBits;
- return R;
- }
-
- // If we run out of data, stop at the end of the stream.
- if (LastChar == NextChar) {
- CurWord = 0;
- BitsInCurWord = 0;
- return 0;
- }
-
- unsigned R = CurWord;
-
- // Read the next word from the stream.
- CurWord = (NextChar[0] << 0) | (NextChar[1] << 8) |
- (NextChar[2] << 16) | (NextChar[3] << 24);
- NextChar += 4;
-
- // Extract NumBits-BitsInCurWord from what we just read.
- unsigned BitsLeft = NumBits-BitsInCurWord;
-
- // Be careful here, BitsLeft is in the range [1..32] inclusive.
- R |= (CurWord & (~0U >> (32-BitsLeft))) << BitsInCurWord;
-
- // BitsLeft bits have just been used up from CurWord.
- if (BitsLeft != 32)
- CurWord >>= BitsLeft;
- else
- CurWord = 0;
- BitsInCurWord = 32-BitsLeft;
- return R;
- }
-
- uint64_t Read64(unsigned NumBits) {
- if (NumBits <= 32) return Read(NumBits);
-
- uint64_t V = Read(32);
- return V | (uint64_t)Read(NumBits-32) << 32;
- }
-
- uint32_t ReadVBR(unsigned NumBits) {
- uint32_t Piece = Read(NumBits);
- if ((Piece & (1U << (NumBits-1))) == 0)
- return Piece;
-
- uint32_t Result = 0;
- unsigned NextBit = 0;
- while (1) {
- Result |= (Piece & ((1U << (NumBits-1))-1)) << NextBit;
-
- if ((Piece & (1U << (NumBits-1))) == 0)
- return Result;
-
- NextBit += NumBits-1;
- Piece = Read(NumBits);
- }
- }
-
- uint64_t ReadVBR64(unsigned NumBits) {
- uint64_t Piece = Read(NumBits);
- if ((Piece & (1U << (NumBits-1))) == 0)
- return Piece;
-
- uint64_t Result = 0;
- unsigned NextBit = 0;
- while (1) {
- Result |= (Piece & ((1U << (NumBits-1))-1)) << NextBit;
-
- if ((Piece & (1U << (NumBits-1))) == 0)
- return Result;
-
- NextBit += NumBits-1;
- Piece = Read(NumBits);
- }
- }
-
- void SkipToWord() {
- BitsInCurWord = 0;
- CurWord = 0;
- }
-
-
- unsigned ReadCode() {
- return Read(CurCodeSize);
- }
-
- //===--------------------------------------------------------------------===//
- // Block Manipulation
- //===--------------------------------------------------------------------===//
-
-private:
- /// getBlockInfo - If there is block info for the specified ID, return it,
- /// otherwise return null.
- BlockInfo *getBlockInfo(unsigned BlockID) {
- // Common case, the most recent entry matches BlockID.
- if (!BlockInfoRecords.empty() && BlockInfoRecords.back().BlockID == BlockID)
- return &BlockInfoRecords.back();
-
- for (unsigned i = 0, e = static_cast<unsigned>(BlockInfoRecords.size());
- i != e; ++i)
- if (BlockInfoRecords[i].BlockID == BlockID)
- return &BlockInfoRecords[i];
- return 0;
- }
-public:
-
-
- // Block header:
- // [ENTER_SUBBLOCK, blockid, newcodelen, <align4bytes>, blocklen]
-
- /// ReadSubBlockID - Having read the ENTER_SUBBLOCK code, read the BlockID for
- /// the block.
- unsigned ReadSubBlockID() {
- return ReadVBR(bitc::BlockIDWidth);
- }
-
- /// SkipBlock - Having read the ENTER_SUBBLOCK abbrevid and a BlockID, skip
- /// over the body of this block. If the block record is malformed, return
- /// true.
- bool SkipBlock() {
- // Read and ignore the codelen value. Since we are skipping this block, we
- // don't care what code widths are used inside of it.
- ReadVBR(bitc::CodeLenWidth);
- SkipToWord();
- unsigned NumWords = Read(bitc::BlockSizeWidth);
-
- // Check that the block wasn't partially defined, and that the offset isn't
- // bogus.
- if (AtEndOfStream() || NextChar+NumWords*4 > LastChar)
- return true;
-
- NextChar += NumWords*4;
- return false;
- }
-
- /// EnterSubBlock - Having read the ENTER_SUBBLOCK abbrevid, enter
- /// the block, and return true if the block is valid.
- bool EnterSubBlock(unsigned BlockID, unsigned *NumWordsP = 0) {
- // Save the current block's state on BlockScope.
- BlockScope.push_back(Block(CurCodeSize));
- BlockScope.back().PrevAbbrevs.swap(CurAbbrevs);
-
- // Add the abbrevs specific to this block to the CurAbbrevs list.
- if (BlockInfo *Info = getBlockInfo(BlockID)) {
- for (unsigned i = 0, e = static_cast<unsigned>(Info->Abbrevs.size());
- i != e; ++i) {
- CurAbbrevs.push_back(Info->Abbrevs[i]);
- CurAbbrevs.back()->addRef();
- }
- }
-
- // Get the codesize of this block.
- CurCodeSize = ReadVBR(bitc::CodeLenWidth);
- SkipToWord();
- unsigned NumWords = Read(bitc::BlockSizeWidth);
- if (NumWordsP) *NumWordsP = NumWords;
-
- // Validate that this block is sane.
- if (CurCodeSize == 0 || AtEndOfStream() || NextChar+NumWords*4 > LastChar)
- return true;
-
- return false;
- }
-
- bool ReadBlockEnd() {
- if (BlockScope.empty()) return true;
-
- // Block tail:
- // [END_BLOCK, <align4bytes>]
- SkipToWord();
-
- PopBlockScope();
- return false;
- }
-
-private:
- void PopBlockScope() {
- CurCodeSize = BlockScope.back().PrevCodeSize;
-
- // Delete abbrevs from popped scope.
- for (unsigned i = 0, e = static_cast<unsigned>(CurAbbrevs.size());
- i != e; ++i)
- CurAbbrevs[i]->dropRef();
-
- BlockScope.back().PrevAbbrevs.swap(CurAbbrevs);
- BlockScope.pop_back();
- }
-
- //===--------------------------------------------------------------------===//
- // Record Processing
- //===--------------------------------------------------------------------===//
-
-private:
- void ReadAbbreviatedField(const BitCodeAbbrevOp &Op,
- SmallVectorImpl<uint64_t> &Vals) {
- if (Op.isLiteral()) {
- // If the abbrev specifies the literal value to use, use it.
- Vals.push_back(Op.getLiteralValue());
- } else {
- // Decode the value as we are commanded.
- switch (Op.getEncoding()) {
- default: assert(0 && "Unknown encoding!");
- case BitCodeAbbrevOp::Fixed:
- Vals.push_back(Read((unsigned)Op.getEncodingData()));
- break;
- case BitCodeAbbrevOp::VBR:
- Vals.push_back(ReadVBR64((unsigned)Op.getEncodingData()));
- break;
- case BitCodeAbbrevOp::Char6:
- Vals.push_back(BitCodeAbbrevOp::DecodeChar6(Read(6)));
- break;
- }
- }
- }
-public:
- unsigned ReadRecord(unsigned AbbrevID, SmallVectorImpl<uint64_t> &Vals) {
- if (AbbrevID == bitc::UNABBREV_RECORD) {
- unsigned Code = ReadVBR(6);
- unsigned NumElts = ReadVBR(6);
- for (unsigned i = 0; i != NumElts; ++i)
- Vals.push_back(ReadVBR64(6));
- return Code;
- }
-
- unsigned AbbrevNo = AbbrevID-bitc::FIRST_APPLICATION_ABBREV;
- assert(AbbrevNo < CurAbbrevs.size() && "Invalid abbrev #!");
- BitCodeAbbrev *Abbv = CurAbbrevs[AbbrevNo];
-
- for (unsigned i = 0, e = Abbv->getNumOperandInfos(); i != e; ++i) {
- const BitCodeAbbrevOp &Op = Abbv->getOperandInfo(i);
- if (Op.isLiteral() || Op.getEncoding() != BitCodeAbbrevOp::Array) {
- ReadAbbreviatedField(Op, Vals);
- } else {
- // Array case. Read the number of elements as a vbr6.
- unsigned NumElts = ReadVBR(6);
-
- // Get the element encoding.
- assert(i+2 == e && "array op not second to last?");
- const BitCodeAbbrevOp &EltEnc = Abbv->getOperandInfo(++i);
-
- // Read all the elements.
- for (; NumElts; --NumElts)
- ReadAbbreviatedField(EltEnc, Vals);
- }
- }
-
- unsigned Code = (unsigned)Vals[0];
- Vals.erase(Vals.begin());
- return Code;
- }
-
- //===--------------------------------------------------------------------===//
- // Abbrev Processing
- //===--------------------------------------------------------------------===//
-
- void ReadAbbrevRecord() {
- BitCodeAbbrev *Abbv = new BitCodeAbbrev();
- unsigned NumOpInfo = ReadVBR(5);
- for (unsigned i = 0; i != NumOpInfo; ++i) {
- bool IsLiteral = Read(1) ? true : false;
- if (IsLiteral) {
- Abbv->Add(BitCodeAbbrevOp(ReadVBR64(8)));
- continue;
- }
-
- BitCodeAbbrevOp::Encoding E = (BitCodeAbbrevOp::Encoding)Read(3);
- if (BitCodeAbbrevOp::hasEncodingData(E))
- Abbv->Add(BitCodeAbbrevOp(E, ReadVBR64(5)));
- else
- Abbv->Add(BitCodeAbbrevOp(E));
- }
- CurAbbrevs.push_back(Abbv);
- }
-
- //===--------------------------------------------------------------------===//
- // BlockInfo Block Reading
- //===--------------------------------------------------------------------===//
-
-private:
- BlockInfo &getOrCreateBlockInfo(unsigned BlockID) {
- if (BlockInfo *BI = getBlockInfo(BlockID))
- return *BI;
-
- // Otherwise, add a new record.
- BlockInfoRecords.push_back(BlockInfo());
- BlockInfoRecords.back().BlockID = BlockID;
- return BlockInfoRecords.back();
- }
-
-public:
-
- bool ReadBlockInfoBlock() {
- if (EnterSubBlock(bitc::BLOCKINFO_BLOCK_ID)) return true;
-
- SmallVector<uint64_t, 64> Record;
- BlockInfo *CurBlockInfo = 0;
-
- // Read all the records for this module.
- while (1) {
- unsigned Code = ReadCode();
- if (Code == bitc::END_BLOCK)
- return ReadBlockEnd();
- if (Code == bitc::ENTER_SUBBLOCK) {
- ReadSubBlockID();
- if (SkipBlock()) return true;
- continue;
- }
-
- // Read abbrev records, associate them with CurBID.
- if (Code == bitc::DEFINE_ABBREV) {
- if (!CurBlockInfo) return true;
- ReadAbbrevRecord();
-
- // ReadAbbrevRecord installs the abbrev in CurAbbrevs. Move it to the
- // appropriate BlockInfo.
- BitCodeAbbrev *Abbv = CurAbbrevs.back();
- CurAbbrevs.pop_back();
- CurBlockInfo->Abbrevs.push_back(Abbv);
- continue;
- }
-
- // Read a record.
- Record.clear();
- switch (ReadRecord(Code, Record)) {
- default: break; // Default behavior, ignore unknown content.
- case bitc::BLOCKINFO_CODE_SETBID:
- if (Record.size() < 1) return true;
- CurBlockInfo = &getOrCreateBlockInfo((unsigned)Record[0]);
- break;
- }
- }
- }
-};
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/Bitcode/BitstreamWriter.h b/release_23/include/llvm/Bitcode/BitstreamWriter.h
deleted file mode 100644
index 3b7e40541472..000000000000
--- a/release_23/include/llvm/Bitcode/BitstreamWriter.h
+++ /dev/null
@@ -1,405 +0,0 @@
-//===- BitstreamWriter.h - Low-level bitstream writer interface -*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This header defines the BitstreamWriter class. This class can be used to
-// write an arbitrary bitstream, regardless of its contents.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef BITSTREAM_WRITER_H
-#define BITSTREAM_WRITER_H
-
-#include "llvm/Bitcode/BitCodes.h"
-#include <vector>
-
-namespace llvm {
-
-class BitstreamWriter {
- std::vector<unsigned char> &Out;
-
- /// CurBit - Always between 0 and 31 inclusive, specifies the next bit to use.
- unsigned CurBit;
-
- /// CurValue - The current value. Only bits < CurBit are valid.
- uint32_t CurValue;
-
- /// CurCodeSize - This is the declared size of code values used for the
- /// current block, in bits.
- unsigned CurCodeSize;
-
- /// BlockInfoCurBID - When emitting a BLOCKINFO_BLOCK, this is the currently
- /// selected BLOCK ID.
- unsigned BlockInfoCurBID;
-
- /// CurAbbrevs - Abbrevs installed at in this block.
- std::vector<BitCodeAbbrev*> CurAbbrevs;
-
- struct Block {
- unsigned PrevCodeSize;
- unsigned StartSizeWord;
- std::vector<BitCodeAbbrev*> PrevAbbrevs;
- Block(unsigned PCS, unsigned SSW) : PrevCodeSize(PCS), StartSizeWord(SSW) {}
- };
-
- /// BlockScope - This tracks the current blocks that we have entered.
- std::vector<Block> BlockScope;
-
- /// BlockInfo - This contains information emitted to BLOCKINFO_BLOCK blocks.
- /// These describe abbreviations that all blocks of the specified ID inherit.
- struct BlockInfo {
- unsigned BlockID;
- std::vector<BitCodeAbbrev*> Abbrevs;
- };
- std::vector<BlockInfo> BlockInfoRecords;
-
-public:
- explicit BitstreamWriter(std::vector<unsigned char> &O)
- : Out(O), CurBit(0), CurValue(0), CurCodeSize(2) {}
-
- ~BitstreamWriter() {
- assert(CurBit == 0 && "Unflused data remaining");
- assert(BlockScope.empty() && CurAbbrevs.empty() && "Block imbalance");
-
- // Free the BlockInfoRecords.
- while (!BlockInfoRecords.empty()) {
- BlockInfo &Info = BlockInfoRecords.back();
- // Free blockinfo abbrev info.
- for (unsigned i = 0, e = static_cast<unsigned>(Info.Abbrevs.size());
- i != e; ++i)
- Info.Abbrevs[i]->dropRef();
- BlockInfoRecords.pop_back();
- }
- }
- //===--------------------------------------------------------------------===//
- // Basic Primitives for emitting bits to the stream.
- //===--------------------------------------------------------------------===//
-
- void Emit(uint32_t Val, unsigned NumBits) {
- assert(NumBits <= 32 && "Invalid value size!");
- assert((Val & ~(~0U >> (32-NumBits))) == 0 && "High bits set!");
- CurValue |= Val << CurBit;
- if (CurBit + NumBits < 32) {
- CurBit += NumBits;
- return;
- }
-
- // Add the current word.
- unsigned V = CurValue;
- Out.push_back((unsigned char)(V >> 0));
- Out.push_back((unsigned char)(V >> 8));
- Out.push_back((unsigned char)(V >> 16));
- Out.push_back((unsigned char)(V >> 24));
-
- if (CurBit)
- CurValue = Val >> (32-CurBit);
- else
- CurValue = 0;
- CurBit = (CurBit+NumBits) & 31;
- }
-
- void Emit64(uint64_t Val, unsigned NumBits) {
- if (NumBits <= 32)
- Emit((uint32_t)Val, NumBits);
- else {
- Emit((uint32_t)Val, 32);
- Emit((uint32_t)(Val >> 32), NumBits-32);
- }
- }
-
- void FlushToWord() {
- if (CurBit) {
- unsigned V = CurValue;
- Out.push_back((unsigned char)(V >> 0));
- Out.push_back((unsigned char)(V >> 8));
- Out.push_back((unsigned char)(V >> 16));
- Out.push_back((unsigned char)(V >> 24));
- CurBit = 0;
- CurValue = 0;
- }
- }
-
- void EmitVBR(uint32_t Val, unsigned NumBits) {
- uint32_t Threshold = 1U << (NumBits-1);
-
- // Emit the bits with VBR encoding, NumBits-1 bits at a time.
- while (Val >= Threshold) {
- Emit((Val & ((1 << (NumBits-1))-1)) | (1 << (NumBits-1)), NumBits);
- Val >>= NumBits-1;
- }
-
- Emit(Val, NumBits);
- }
-
- void EmitVBR64(uint64_t Val, unsigned NumBits) {
- if ((uint32_t)Val == Val)
- return EmitVBR((uint32_t)Val, NumBits);
-
- uint64_t Threshold = 1U << (NumBits-1);
-
- // Emit the bits with VBR encoding, NumBits-1 bits at a time.
- while (Val >= Threshold) {
- Emit(((uint32_t)Val & ((1 << (NumBits-1))-1)) |
- (1 << (NumBits-1)), NumBits);
- Val >>= NumBits-1;
- }
-
- Emit((uint32_t)Val, NumBits);
- }
-
- /// EmitCode - Emit the specified code.
- void EmitCode(unsigned Val) {
- Emit(Val, CurCodeSize);
- }
-
- //===--------------------------------------------------------------------===//
- // Block Manipulation
- //===--------------------------------------------------------------------===//
-
- /// getBlockInfo - If there is block info for the specified ID, return it,
- /// otherwise return null.
- BlockInfo *getBlockInfo(unsigned BlockID) {
- // Common case, the most recent entry matches BlockID.
- if (!BlockInfoRecords.empty() && BlockInfoRecords.back().BlockID == BlockID)
- return &BlockInfoRecords.back();
-
- for (unsigned i = 0, e = static_cast<unsigned>(BlockInfoRecords.size());
- i != e; ++i)
- if (BlockInfoRecords[i].BlockID == BlockID)
- return &BlockInfoRecords[i];
- return 0;
- }
-
- void EnterSubblock(unsigned BlockID, unsigned CodeLen) {
- // Block header:
- // [ENTER_SUBBLOCK, blockid, newcodelen, <align4bytes>, blocklen]
- EmitCode(bitc::ENTER_SUBBLOCK);
- EmitVBR(BlockID, bitc::BlockIDWidth);
- EmitVBR(CodeLen, bitc::CodeLenWidth);
- FlushToWord();
-
- unsigned BlockSizeWordLoc = static_cast<unsigned>(Out.size());
- unsigned OldCodeSize = CurCodeSize;
-
- // Emit a placeholder, which will be replaced when the block is popped.
- Emit(0, bitc::BlockSizeWidth);
-
- CurCodeSize = CodeLen;
-
- // Push the outer block's abbrev set onto the stack, start out with an
- // empty abbrev set.
- BlockScope.push_back(Block(OldCodeSize, BlockSizeWordLoc/4));
- BlockScope.back().PrevAbbrevs.swap(CurAbbrevs);
-
- // If there is a blockinfo for this BlockID, add all the predefined abbrevs
- // to the abbrev list.
- if (BlockInfo *Info = getBlockInfo(BlockID)) {
- for (unsigned i = 0, e = static_cast<unsigned>(Info->Abbrevs.size());
- i != e; ++i) {
- CurAbbrevs.push_back(Info->Abbrevs[i]);
- Info->Abbrevs[i]->addRef();
- }
- }
- }
-
- void ExitBlock() {
- assert(!BlockScope.empty() && "Block scope imbalance!");
-
- // Delete all abbrevs.
- for (unsigned i = 0, e = static_cast<unsigned>(CurAbbrevs.size());
- i != e; ++i)
- CurAbbrevs[i]->dropRef();
-
- const Block &B = BlockScope.back();
-
- // Block tail:
- // [END_BLOCK, <align4bytes>]
- EmitCode(bitc::END_BLOCK);
- FlushToWord();
-
- // Compute the size of the block, in words, not counting the size field.
- unsigned SizeInWords= static_cast<unsigned>(Out.size())/4-B.StartSizeWord-1;
- unsigned ByteNo = B.StartSizeWord*4;
-
- // Update the block size field in the header of this sub-block.
- Out[ByteNo++] = (unsigned char)(SizeInWords >> 0);
- Out[ByteNo++] = (unsigned char)(SizeInWords >> 8);
- Out[ByteNo++] = (unsigned char)(SizeInWords >> 16);
- Out[ByteNo++] = (unsigned char)(SizeInWords >> 24);
-
- // Restore the inner block's code size and abbrev table.
- CurCodeSize = B.PrevCodeSize;
- BlockScope.back().PrevAbbrevs.swap(CurAbbrevs);
- BlockScope.pop_back();
- }
-
- //===--------------------------------------------------------------------===//
- // Record Emission
- //===--------------------------------------------------------------------===//
-
-private:
- /// EmitAbbreviatedField - Emit a single scalar field value with the specified
- /// encoding.
- template<typename uintty>
- void EmitAbbreviatedField(const BitCodeAbbrevOp &Op, uintty V) {
- if (Op.isLiteral()) {
- // If the abbrev specifies the literal value to use, don't emit
- // anything.
- assert(V == Op.getLiteralValue() &&
- "Invalid abbrev for record!");
- return;
- }
-
- // Encode the value as we are commanded.
- switch (Op.getEncoding()) {
- default: assert(0 && "Unknown encoding!");
- case BitCodeAbbrevOp::Fixed:
- Emit((unsigned)V, (unsigned)Op.getEncodingData());
- break;
- case BitCodeAbbrevOp::VBR:
- EmitVBR64(V, (unsigned)Op.getEncodingData());
- break;
- case BitCodeAbbrevOp::Char6:
- Emit(BitCodeAbbrevOp::EncodeChar6((char)V), 6);
- break;
- }
- }
-public:
-
- /// EmitRecord - Emit the specified record to the stream, using an abbrev if
- /// we have one to compress the output.
- template<typename uintty>
- void EmitRecord(unsigned Code, SmallVectorImpl<uintty> &Vals,
- unsigned Abbrev = 0) {
- if (Abbrev) {
- unsigned AbbrevNo = Abbrev-bitc::FIRST_APPLICATION_ABBREV;
- assert(AbbrevNo < CurAbbrevs.size() && "Invalid abbrev #!");
- BitCodeAbbrev *Abbv = CurAbbrevs[AbbrevNo];
-
- EmitCode(Abbrev);
-
- // Insert the code into Vals to treat it uniformly.
- Vals.insert(Vals.begin(), Code);
-
- unsigned RecordIdx = 0;
- for (unsigned i = 0, e = static_cast<unsigned>(Abbv->getNumOperandInfos());
- i != e; ++i) {
- const BitCodeAbbrevOp &Op = Abbv->getOperandInfo(i);
- if (Op.isLiteral() || Op.getEncoding() != BitCodeAbbrevOp::Array) {
- assert(RecordIdx < Vals.size() && "Invalid abbrev/record");
- EmitAbbreviatedField(Op, Vals[RecordIdx]);
- ++RecordIdx;
- } else {
- // Array case.
- assert(i+2 == e && "array op not second to last?");
- const BitCodeAbbrevOp &EltEnc = Abbv->getOperandInfo(++i);
-
- // Emit a vbr6 to indicate the number of elements present.
- EmitVBR(static_cast<uint32_t>(Vals.size()-RecordIdx), 6);
-
- // Emit each field.
- for (; RecordIdx != Vals.size(); ++RecordIdx)
- EmitAbbreviatedField(EltEnc, Vals[RecordIdx]);
- }
- }
- assert(RecordIdx == Vals.size() && "Not all record operands emitted!");
- } else {
- // If we don't have an abbrev to use, emit this in its fully unabbreviated
- // form.
- EmitCode(bitc::UNABBREV_RECORD);
- EmitVBR(Code, 6);
- EmitVBR(static_cast<uint32_t>(Vals.size()), 6);
- for (unsigned i = 0, e = static_cast<unsigned>(Vals.size()); i != e; ++i)
- EmitVBR64(Vals[i], 6);
- }
- }
-
- //===--------------------------------------------------------------------===//
- // Abbrev Emission
- //===--------------------------------------------------------------------===//
-
-private:
- // Emit the abbreviation as a DEFINE_ABBREV record.
- void EncodeAbbrev(BitCodeAbbrev *Abbv) {
- EmitCode(bitc::DEFINE_ABBREV);
- EmitVBR(Abbv->getNumOperandInfos(), 5);
- for (unsigned i = 0, e = static_cast<unsigned>(Abbv->getNumOperandInfos());
- i != e; ++i) {
- const BitCodeAbbrevOp &Op = Abbv->getOperandInfo(i);
- Emit(Op.isLiteral(), 1);
- if (Op.isLiteral()) {
- EmitVBR64(Op.getLiteralValue(), 8);
- } else {
- Emit(Op.getEncoding(), 3);
- if (Op.hasEncodingData())
- EmitVBR64(Op.getEncodingData(), 5);
- }
- }
- }
-public:
-
- /// EmitAbbrev - This emits an abbreviation to the stream. Note that this
- /// method takes ownership of the specified abbrev.
- unsigned EmitAbbrev(BitCodeAbbrev *Abbv) {
- // Emit the abbreviation as a record.
- EncodeAbbrev(Abbv);
- CurAbbrevs.push_back(Abbv);
- return static_cast<unsigned>(CurAbbrevs.size())-1 +
- bitc::FIRST_APPLICATION_ABBREV;
- }
-
- //===--------------------------------------------------------------------===//
- // BlockInfo Block Emission
- //===--------------------------------------------------------------------===//
-
- /// EnterBlockInfoBlock - Start emitting the BLOCKINFO_BLOCK.
- void EnterBlockInfoBlock(unsigned CodeWidth) {
- EnterSubblock(bitc::BLOCKINFO_BLOCK_ID, CodeWidth);
- BlockInfoCurBID = -1U;
- }
-private:
- /// SwitchToBlockID - If we aren't already talking about the specified block
- /// ID, emit a BLOCKINFO_CODE_SETBID record.
- void SwitchToBlockID(unsigned BlockID) {
- if (BlockInfoCurBID == BlockID) return;
- SmallVector<unsigned, 2> V;
- V.push_back(BlockID);
- EmitRecord(bitc::BLOCKINFO_CODE_SETBID, V);
- BlockInfoCurBID = BlockID;
- }
-
- BlockInfo &getOrCreateBlockInfo(unsigned BlockID) {
- if (BlockInfo *BI = getBlockInfo(BlockID))
- return *BI;
-
- // Otherwise, add a new record.
- BlockInfoRecords.push_back(BlockInfo());
- BlockInfoRecords.back().BlockID = BlockID;
- return BlockInfoRecords.back();
- }
-
-public:
-
- /// EmitBlockInfoAbbrev - Emit a DEFINE_ABBREV record for the specified
- /// BlockID.
- unsigned EmitBlockInfoAbbrev(unsigned BlockID, BitCodeAbbrev *Abbv) {
- SwitchToBlockID(BlockID);
- EncodeAbbrev(Abbv);
-
- // Add the abbrev to the specified block record.
- BlockInfo &Info = getOrCreateBlockInfo(BlockID);
- Info.Abbrevs.push_back(Abbv);
-
- return Info.Abbrevs.size()-1+bitc::FIRST_APPLICATION_ABBREV;
- }
-};
-
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/Bitcode/Deserialize.h b/release_23/include/llvm/Bitcode/Deserialize.h
deleted file mode 100644
index 8c9ea89d1522..000000000000
--- a/release_23/include/llvm/Bitcode/Deserialize.h
+++ /dev/null
@@ -1,517 +0,0 @@
-//=- Deserialize.h - Generic Object Deserialization from Bitcode --*- C++ -*-=//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines the interface for generic object deserialization from
-// LLVM bitcode.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_BITCODE_SERIALIZE_INPUT
-#define LLVM_BITCODE_SERIALIZE_INPUT
-
-#include "llvm/Bitcode/BitstreamReader.h"
-#include "llvm/Bitcode/Serialization.h"
-#include "llvm/ADT/DenseMap.h"
-#include "llvm/ADT/SmallVector.h"
-#include "llvm/Support/Allocator.h"
-#include "llvm/Support/DataTypes.h"
-#include <vector>
-
-namespace llvm {
-
-class Deserializer {
-
- //===----------------------------------------------------------===//
- // Internal type definitions.
- //===----------------------------------------------------------===//
-
- struct BPNode {
- BPNode* Next;
- uintptr_t& PtrRef;
-
- BPNode(BPNode* n, uintptr_t& pref)
- : Next(n), PtrRef(pref) {
- PtrRef = 0;
- }
- };
-
- struct BPEntry {
- union { BPNode* Head; void* Ptr; };
-
- BPEntry() : Head(NULL) {}
-
- static inline bool isPod() { return true; }
-
- void SetPtr(BPNode*& FreeList, void* P);
- };
-
- class BPKey {
- unsigned Raw;
-
- public:
- BPKey(SerializedPtrID PtrId) : Raw(PtrId << 1) { assert (PtrId > 0); }
- BPKey(unsigned code, unsigned) : Raw(code) {}
-
- void MarkFinal() { Raw |= 0x1; }
- bool hasFinalPtr() const { return Raw & 0x1 ? true : false; }
- SerializedPtrID getID() const { return Raw >> 1; }
-
- static inline BPKey getEmptyKey() { return BPKey(0,0); }
- static inline BPKey getTombstoneKey() { return BPKey(1,0); }
- static inline unsigned getHashValue(const BPKey& K) { return K.Raw & ~0x1; }
-
- static bool isEqual(const BPKey& K1, const BPKey& K2) {
- return (K1.Raw ^ K2.Raw) & ~0x1 ? false : true;
- }
-
- static bool isPod() { return true; }
- };
-
- typedef llvm::DenseMap<BPKey,BPEntry,BPKey,BPEntry> MapTy;
-
- //===----------------------------------------------------------===//
- // Publicly visible types.
- //===----------------------------------------------------------===//
-
-public:
- struct Location {
- uint64_t BitNo;
- unsigned BlockID;
- unsigned NumWords;
-
- Location(uint64_t bit, unsigned bid, unsigned words)
- : BitNo(bit), BlockID(bid), NumWords(words) {}
-
- Location() : BitNo(0), BlockID(0), NumWords(0) {}
-
- Location& operator=(Location& RHS) {
- BitNo = RHS.BitNo;
- BlockID = RHS.BlockID;
- NumWords = RHS.NumWords;
- return *this;
- }
-
- bool operator==(const Location& RHS) const { return BitNo == RHS.BitNo; }
- bool operator!=(const Location& RHS) const { return BitNo != RHS.BitNo; }
-
- bool contains(const Location& RHS) const {
- if (RHS.BitNo < BitNo)
- return false;
-
- if ((RHS.BitNo - BitNo) >> 5 < NumWords)
- return true;
-
- return false;
- }
- };
-
- //===----------------------------------------------------------===//
- // Internal data members.
- //===----------------------------------------------------------===//
-
-private:
- BitstreamReader& Stream;
- SmallVector<uint64_t,20> Record;
- unsigned RecIdx;
- BumpPtrAllocator Allocator;
- BPNode* FreeList;
- MapTy BPatchMap;
- llvm::SmallVector<Location,8> BlockStack;
- unsigned AbbrevNo;
- unsigned RecordCode;
- uint64_t StreamStart;
-
- //===----------------------------------------------------------===//
- // Public Interface.
- //===----------------------------------------------------------===//
-
-public:
- Deserializer(BitstreamReader& stream);
- ~Deserializer();
-
- uint64_t ReadInt();
- int64_t ReadSInt();
- SerializedPtrID ReadPtrID() { return (SerializedPtrID) ReadInt(); }
-
-
- bool ReadBool() {
- return ReadInt() ? true : false;
- }
-
- template <typename T>
- inline T& Read(T& X) {
- SerializeTrait<T>::Read(*this,X);
- return X;
- }
-
- template <typename T>
- inline T* Create() {
- return SerializeTrait<T>::Create(*this);
- }
-
- char* ReadCStr(char* cstr = NULL, unsigned MaxLen=0, bool isNullTerm=true);
- void ReadCStr(std::vector<char>& buff, bool isNullTerm=false, unsigned Idx=0);
-
- template <typename T>
- inline T* ReadOwnedPtr(bool AutoRegister = true) {
- SerializedPtrID PtrID = ReadPtrID();
-
- if (!PtrID)
- return NULL;
-
- T* x = SerializeTrait<T>::Create(*this);
-
- if (AutoRegister)
- RegisterPtr(PtrID,x);
-
- return x;
- }
-
- template <typename T, typename Arg1>
- inline T* ReadOwnedPtr(Arg1& arg1, bool AutoRegister = true) {
- SerializedPtrID PtrID = ReadPtrID();
-
- if (!PtrID)
- return NULL;
-
- T* x = SerializeTrait<T>::Create(*this, arg1);
-
- if (AutoRegister)
- RegisterPtr(PtrID,x);
-
- return x;
- }
-
- template <typename T>
- inline void ReadOwnedPtr(T*& Ptr, bool AutoRegister = true) {
- Ptr = ReadOwnedPtr<T>(AutoRegister);
- }
-
- template <typename T1, typename T2>
- void BatchReadOwnedPtrs(T1*& P1, T2*& P2,
- bool A1=true, bool A2=true) {
-
- SerializedPtrID ID1 = ReadPtrID();
- SerializedPtrID ID2 = ReadPtrID();
-
- P1 = (ID1) ? SerializeTrait<T1>::Create(*this) : NULL;
- if (ID1 && A1) RegisterPtr(ID1,P1);
-
- P2 = (ID2) ? SerializeTrait<T2>::Create(*this) : NULL;
- if (ID2 && A2) RegisterPtr(ID2,P2);
- }
-
- template <typename T1, typename T2, typename Arg1>
- void BatchReadOwnedPtrs(T1*& P1, T2*& P2, Arg1& arg1,
- bool A1=true, bool A2=true) {
-
- SerializedPtrID ID1 = ReadPtrID();
- SerializedPtrID ID2 = ReadPtrID();
-
- P1 = (ID1) ? SerializeTrait<T1>::Create(*this, arg1) : NULL;
- if (ID1 && A1) RegisterPtr(ID1,P1);
-
- P2 = (ID2) ? SerializeTrait<T2>::Create(*this, arg1) : NULL;
- if (ID2 && A2) RegisterPtr(ID2,P2);
- }
-
- template <typename T1, typename T2, typename T3>
- void BatchReadOwnedPtrs(T1*& P1, T2*& P2, T3*& P3,
- bool A1=true, bool A2=true, bool A3=true) {
-
- SerializedPtrID ID1 = ReadPtrID();
- SerializedPtrID ID2 = ReadPtrID();
- SerializedPtrID ID3 = ReadPtrID();
-
- P1 = (ID1) ? SerializeTrait<T1>::Create(*this) : NULL;
- if (ID1 && A1) RegisterPtr(ID1,P1);
-
- P2 = (ID2) ? SerializeTrait<T2>::Create(*this) : NULL;
- if (ID2 && A2) RegisterPtr(ID2,P2);
-
- P3 = (ID3) ? SerializeTrait<T3>::Create(*this) : NULL;
- if (ID3 && A3) RegisterPtr(ID3,P3);
- }
-
- template <typename T1, typename T2, typename T3, typename Arg1>
- void BatchReadOwnedPtrs(T1*& P1, T2*& P2, T3*& P3, Arg1& arg1,
- bool A1=true, bool A2=true, bool A3=true) {
-
- SerializedPtrID ID1 = ReadPtrID();
- SerializedPtrID ID2 = ReadPtrID();
- SerializedPtrID ID3 = ReadPtrID();
-
- P1 = (ID1) ? SerializeTrait<T1>::Create(*this, arg1) : NULL;
- if (ID1 && A1) RegisterPtr(ID1,P1);
-
- P2 = (ID2) ? SerializeTrait<T2>::Create(*this, arg1) : NULL;
- if (ID2 && A2) RegisterPtr(ID2,P2);
-
- P3 = (ID3) ? SerializeTrait<T3>::Create(*this, arg1) : NULL;
- if (ID3 && A3) RegisterPtr(ID3,P3);
- }
-
- template <typename T>
- void BatchReadOwnedPtrs(unsigned NumPtrs, T** Ptrs, bool AutoRegister=true) {
- llvm::SmallVector<SerializedPtrID,10> BatchIDVec;
-
- for (unsigned i = 0; i < NumPtrs; ++i)
- BatchIDVec.push_back(ReadPtrID());
-
- for (unsigned i = 0; i < NumPtrs; ++i) {
- SerializedPtrID& PtrID = BatchIDVec[i];
-
- T* p = PtrID ? SerializeTrait<T>::Create(*this) : NULL;
-
- if (PtrID && AutoRegister)
- RegisterPtr(PtrID,p);
-
- Ptrs[i] = p;
- }
- }
-
- template <typename T, typename Arg1>
- void BatchReadOwnedPtrs(unsigned NumPtrs, T** Ptrs, Arg1& arg1,
- bool AutoRegister=true) {
-
- llvm::SmallVector<SerializedPtrID,10> BatchIDVec;
-
- for (unsigned i = 0; i < NumPtrs; ++i)
- BatchIDVec.push_back(ReadPtrID());
-
- for (unsigned i = 0; i < NumPtrs; ++i) {
- SerializedPtrID& PtrID = BatchIDVec[i];
-
- T* p = PtrID ? SerializeTrait<T>::Create(*this, arg1) : NULL;
-
- if (PtrID && AutoRegister)
- RegisterPtr(PtrID,p);
-
- Ptrs[i] = p;
- }
- }
-
- template <typename T1, typename T2>
- void BatchReadOwnedPtrs(unsigned NumT1Ptrs, T1** Ptrs, T2*& P2,
- bool A1=true, bool A2=true) {
-
- llvm::SmallVector<SerializedPtrID,10> BatchIDVec;
-
- for (unsigned i = 0; i < NumT1Ptrs; ++i)
- BatchIDVec.push_back(ReadPtrID());
-
- SerializedPtrID ID2 = ReadPtrID();
-
- for (unsigned i = 0; i < NumT1Ptrs; ++i) {
- SerializedPtrID& PtrID = BatchIDVec[i];
-
- T1* p = PtrID ? SerializeTrait<T1>::Create(*this) : NULL;
-
- if (PtrID && A1)
- RegisterPtr(PtrID,p);
-
- Ptrs[i] = p;
- }
-
- P2 = (ID2) ? SerializeTrait<T2>::Create(*this) : NULL;
- if (ID2 && A2) RegisterPtr(ID2,P2);
- }
-
- template <typename T1, typename T2, typename Arg1>
- void BatchReadOwnedPtrs(unsigned NumT1Ptrs, T1** Ptrs, T2*& P2, Arg1& arg1,
- bool A1=true, bool A2=true) {
-
- llvm::SmallVector<SerializedPtrID,10> BatchIDVec;
-
- for (unsigned i = 0; i < NumT1Ptrs; ++i)
- BatchIDVec.push_back(ReadPtrID());
-
- SerializedPtrID ID2 = ReadPtrID();
-
- for (unsigned i = 0; i < NumT1Ptrs; ++i) {
- SerializedPtrID& PtrID = BatchIDVec[i];
-
- T1* p = PtrID ? SerializeTrait<T1>::Create(*this, arg1) : NULL;
-
- if (PtrID && A1)
- RegisterPtr(PtrID,p);
-
- Ptrs[i] = p;
- }
-
- P2 = (ID2) ? SerializeTrait<T2>::Create(*this, arg1) : NULL;
- if (ID2 && A2) RegisterPtr(ID2,P2);
- }
-
- template <typename T1, typename T2, typename T3>
- void BatchReadOwnedPtrs(unsigned NumT1Ptrs, T1** Ptrs,
- T2*& P2, T3*& P3,
- bool A1=true, bool A2=true, bool A3=true) {
-
- llvm::SmallVector<SerializedPtrID,10> BatchIDVec;
-
- for (unsigned i = 0; i < NumT1Ptrs; ++i)
- BatchIDVec.push_back(ReadPtrID());
-
- SerializedPtrID ID2 = ReadPtrID();
- SerializedPtrID ID3 = ReadPtrID();
-
- for (unsigned i = 0; i < NumT1Ptrs; ++i) {
- SerializedPtrID& PtrID = BatchIDVec[i];
-
- T1* p = PtrID ? SerializeTrait<T1>::Create(*this) : NULL;
-
- if (PtrID && A1)
- RegisterPtr(PtrID,p);
-
- Ptrs[i] = p;
- }
-
- P2 = (ID2) ? SerializeTrait<T2>::Create(*this) : NULL;
- if (ID2 && A2) RegisterPtr(ID2,P2);
-
- P3 = (ID3) ? SerializeTrait<T3>::Create(*this) : NULL;
- if (ID3 && A3) RegisterPtr(ID3,P3);
- }
-
- template <typename T1, typename T2, typename T3, typename Arg1>
- void BatchReadOwnedPtrs(unsigned NumT1Ptrs, T1** Ptrs,
- T2*& P2, T3*& P3, Arg1& arg1,
- bool A1=true, bool A2=true, bool A3=true) {
-
- llvm::SmallVector<SerializedPtrID,10> BatchIDVec;
-
- for (unsigned i = 0; i < NumT1Ptrs; ++i)
- BatchIDVec.push_back(ReadPtrID());
-
- SerializedPtrID ID2 = ReadPtrID();
- SerializedPtrID ID3 = ReadPtrID();
-
- for (unsigned i = 0; i < NumT1Ptrs; ++i) {
- SerializedPtrID& PtrID = BatchIDVec[i];
-
- T1* p = PtrID ? SerializeTrait<T1>::Create(*this, arg1) : NULL;
-
- if (PtrID && A1)
- RegisterPtr(PtrID,p);
-
- Ptrs[i] = p;
- }
-
- P2 = (ID2) ? SerializeTrait<T2>::Create(*this, arg1) : NULL;
- if (ID2 && A2) RegisterPtr(ID2,P2);
-
- P3 = (ID3) ? SerializeTrait<T3>::Create(*this, arg1) : NULL;
- if (ID3 && A3) RegisterPtr(ID3,P3);
- }
-
- template <typename T>
- void ReadPtr(T*& PtrRef, bool AllowBackpatch = true) {
- ReadUIntPtr(reinterpret_cast<uintptr_t&>(PtrRef), AllowBackpatch);
- }
-
- template <typename T>
- void ReadPtr(const T*& PtrRef, bool AllowBackpatch = true) {
- ReadPtr(const_cast<T*&>(PtrRef), AllowBackpatch);
- }
-
-
- template <typename T>
- void ReadPtr(T*& PtrRef, const SerializedPtrID& PtrID,
- bool AllowBackpatch = true) {
- ReadUIntPtr(reinterpret_cast<uintptr_t&>(PtrRef), PtrID, AllowBackpatch);
- }
-
- template <typename T>
- void ReadPtr(const T*& PtrRef, const SerializedPtrID& PtrID,
- bool AllowBackpatch = true) {
-
- ReadPtr(const_cast<T*&>(PtrRef), PtrID, AllowBackpatch);
- }
-
- template <typename T>
- T* ReadPtr() { T* x = 0; ReadPtr<T>(x,false); return x; }
-
- void ReadUIntPtr(uintptr_t& PtrRef, const SerializedPtrID& PtrID,
- bool AllowBackpatch = true);
-
- void ReadUIntPtr(uintptr_t& PtrRef, bool AllowBackpatch = true) {
- ReadUIntPtr(PtrRef,ReadPtrID(),AllowBackpatch);
- }
-
- template <typename T>
- T& ReadRef() {
- T* p = reinterpret_cast<T*>(ReadInternalRefPtr());
- return *p;
- }
-
- void RegisterPtr(const SerializedPtrID& PtrID, const void* Ptr);
-
- void RegisterPtr(const void* Ptr) {
- RegisterPtr(ReadPtrID(),Ptr);
- }
-
- template<typename T>
- void RegisterRef(const T& x) {
- RegisterPtr(&x);
- }
-
- template<typename T>
- void RegisterRef(const SerializedPtrID& PtrID, const T& x) {
- RegisterPtr(PtrID,&x);
- }
-
- Location getCurrentBlockLocation();
- unsigned getCurrentBlockID();
- unsigned getAbbrevNo();
-
- bool FinishedBlock(Location BlockLoc);
- bool JumpTo(const Location& BlockLoc);
- void Rewind();
-
- bool AtEnd();
- bool inRecord();
- void SkipBlock();
- bool SkipToBlock(unsigned BlockID);
-
- unsigned getRecordCode();
-
- BitstreamReader& getStream() { return Stream; }
-
-private:
- bool AdvanceStream();
- void ReadRecord();
-
- uintptr_t ReadInternalRefPtr();
-
- static inline bool HasFinalPtr(MapTy::value_type& V) {
- return V.first.hasFinalPtr();
- }
-
- static inline uintptr_t GetFinalPtr(MapTy::value_type& V) {
- return reinterpret_cast<uintptr_t>(V.second.Ptr);
- }
-
- static inline BPNode* GetBPNode(MapTy::value_type& V) {
- return V.second.Head;
- }
-
- static inline void SetBPNode(MapTy::value_type& V, BPNode* N) {
- V.second.Head = N;
- }
-
- void SetPtr(MapTy::value_type& V, const void* P) {
- V.first.MarkFinal();
- V.second.SetPtr(FreeList,const_cast<void*>(P));
- }
-};
-
-} // end namespace llvm
-
-#endif
diff --git a/release_23/include/llvm/Bitcode/LLVMBitCodes.h b/release_23/include/llvm/Bitcode/LLVMBitCodes.h
deleted file mode 100644
index 5ef832e187c6..000000000000
--- a/release_23/include/llvm/Bitcode/LLVMBitCodes.h
+++ /dev/null
@@ -1,210 +0,0 @@
-//===- LLVMBitCodes.h - Enum values for the LLVM bitcode format -*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This header defines Bitcode enum values for LLVM IR bitcode files.
-//
-// The enum values defined in this file should be considered permanent. If
-// new features are added, they should have values added at the end of the
-// respective lists.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_BITCODE_LLVMBITCODES_H
-#define LLVM_BITCODE_LLVMBITCODES_H
-
-#include "llvm/Bitcode/BitCodes.h"
-
-namespace llvm {
-namespace bitc {
- // The only top-level block type defined is for a module.
- enum BlockIDs {
- // Blocks
- MODULE_BLOCK_ID = FIRST_APPLICATION_BLOCKID,
-
- // Module sub-block id's.
- PARAMATTR_BLOCK_ID,
- TYPE_BLOCK_ID,
- CONSTANTS_BLOCK_ID,
- FUNCTION_BLOCK_ID,
- TYPE_SYMTAB_BLOCK_ID,
- VALUE_SYMTAB_BLOCK_ID
- };
-
-
- /// MODULE blocks have a number of optional fields and subblocks.
- enum ModuleCodes {
- MODULE_CODE_VERSION = 1, // VERSION: [version#]
- MODULE_CODE_TRIPLE = 2, // TRIPLE: [strchr x N]
- MODULE_CODE_DATALAYOUT = 3, // DATALAYOUT: [strchr x N]
- MODULE_CODE_ASM = 4, // ASM: [strchr x N]
- MODULE_CODE_SECTIONNAME = 5, // SECTIONNAME: [strchr x N]
- MODULE_CODE_DEPLIB = 6, // DEPLIB: [strchr x N]
-
- // GLOBALVAR: [pointer type, isconst, initid,
- // linkage, alignment, section, visibility, threadlocal]
- MODULE_CODE_GLOBALVAR = 7,
-
- // FUNCTION: [type, callingconv, isproto, linkage, paramattrs, alignment,
- // section, visibility]
- MODULE_CODE_FUNCTION = 8,
-
- // ALIAS: [alias type, aliasee val#, linkage]
- MODULE_CODE_ALIAS = 9,
-
- /// MODULE_CODE_PURGEVALS: [numvals]
- MODULE_CODE_PURGEVALS = 10,
-
- MODULE_CODE_COLLECTORNAME = 11 // COLLECTORNAME: [strchr x N]
- };
-
- /// PARAMATTR blocks have code for defining a parameter attribute set.
- enum ParamAttrCodes {
- PARAMATTR_CODE_ENTRY = 1 // ENTRY: [paramidx0, attr0, paramidx1, attr1...]
- };
-
- /// TYPE blocks have codes for each type primitive they use.
- enum TypeCodes {
- TYPE_CODE_NUMENTRY = 1, // NUMENTRY: [numentries]
-
- // Type Codes
- TYPE_CODE_VOID = 2, // VOID
- TYPE_CODE_FLOAT = 3, // FLOAT
- TYPE_CODE_DOUBLE = 4, // DOUBLE
- TYPE_CODE_LABEL = 5, // LABEL
- TYPE_CODE_OPAQUE = 6, // OPAQUE
- TYPE_CODE_INTEGER = 7, // INTEGER: [width]
- TYPE_CODE_POINTER = 8, // POINTER: [pointee type]
- TYPE_CODE_FUNCTION = 9, // FUNCTION: [vararg, retty, paramty x N]
- TYPE_CODE_STRUCT = 10, // STRUCT: [ispacked, eltty x N]
- TYPE_CODE_ARRAY = 11, // ARRAY: [numelts, eltty]
- TYPE_CODE_VECTOR = 12, // VECTOR: [numelts, eltty]
-
- // These are not with the other floating point types because they're
- // a late addition, and putting them in the right place breaks
- // binary compatibility.
- TYPE_CODE_X86_FP80 = 13, // X86 LONG DOUBLE
- TYPE_CODE_FP128 = 14, // LONG DOUBLE (112 bit mantissa)
- TYPE_CODE_PPC_FP128= 15 // PPC LONG DOUBLE (2 doubles)
- // Any other type code is assumed to be an unknown type.
- };
-
- // The type symbol table only has one code (TST_ENTRY_CODE).
- enum TypeSymtabCodes {
- TST_CODE_ENTRY = 1 // TST_ENTRY: [typeid, namechar x N]
- };
-
- // The value symbol table only has one code (VST_ENTRY_CODE).
- enum ValueSymtabCodes {
- VST_CODE_ENTRY = 1, // VST_ENTRY: [valid, namechar x N]
- VST_CODE_BBENTRY = 2 // VST_BBENTRY: [bbid, namechar x N]
- };
-
- // The constants block (CONSTANTS_BLOCK_ID) describes emission for each
- // constant and maintains an implicit current type value.
- enum ConstantsCodes {
- CST_CODE_SETTYPE = 1, // SETTYPE: [typeid]
- CST_CODE_NULL = 2, // NULL
- CST_CODE_UNDEF = 3, // UNDEF
- CST_CODE_INTEGER = 4, // INTEGER: [intval]
- CST_CODE_WIDE_INTEGER = 5, // WIDE_INTEGER: [n x intval]
- CST_CODE_FLOAT = 6, // FLOAT: [fpval]
- CST_CODE_AGGREGATE = 7, // AGGREGATE: [n x value number]
- CST_CODE_STRING = 8, // STRING: [values]
- CST_CODE_CSTRING = 9, // CSTRING: [values]
- CST_CODE_CE_BINOP = 10, // CE_BINOP: [opcode, opval, opval]
- CST_CODE_CE_CAST = 11, // CE_CAST: [opcode, opty, opval]
- CST_CODE_CE_GEP = 12, // CE_GEP: [n x operands]
- CST_CODE_CE_SELECT = 13, // CE_SELECT: [opval, opval, opval]
- CST_CODE_CE_EXTRACTELT = 14, // CE_EXTRACTELT: [opty, opval, opval]
- CST_CODE_CE_INSERTELT = 15, // CE_INSERTELT: [opval, opval, opval]
- CST_CODE_CE_SHUFFLEVEC = 16, // CE_SHUFFLEVEC: [opval, opval, opval]
- CST_CODE_CE_CMP = 17, // CE_CMP: [opty, opval, opval, pred]
- CST_CODE_INLINEASM = 18 // INLINEASM: [sideeffect,asmstr,conststr]
- };
-
- /// CastOpcodes - These are values used in the bitcode files to encode which
- /// cast a CST_CODE_CE_CAST or a XXX refers to. The values of these enums
- /// have no fixed relation to the LLVM IR enum values. Changing these will
- /// break compatibility with old files.
- enum CastOpcodes {
- CAST_TRUNC = 0,
- CAST_ZEXT = 1,
- CAST_SEXT = 2,
- CAST_FPTOUI = 3,
- CAST_FPTOSI = 4,
- CAST_UITOFP = 5,
- CAST_SITOFP = 6,
- CAST_FPTRUNC = 7,
- CAST_FPEXT = 8,
- CAST_PTRTOINT = 9,
- CAST_INTTOPTR = 10,
- CAST_BITCAST = 11
- };
-
- /// BinaryOpcodes - These are values used in the bitcode files to encode which
- /// binop a CST_CODE_CE_BINOP or a XXX refers to. The values of these enums
- /// have no fixed relation to the LLVM IR enum values. Changing these will
- /// break compatibility with old files.
- enum BinaryOpcodes {
- BINOP_ADD = 0,
- BINOP_SUB = 1,
- BINOP_MUL = 2,
- BINOP_UDIV = 3,
- BINOP_SDIV = 4, // overloaded for FP
- BINOP_UREM = 5,
- BINOP_SREM = 6, // overloaded for FP
- BINOP_SHL = 7,
- BINOP_LSHR = 8,
- BINOP_ASHR = 9,
- BINOP_AND = 10,
- BINOP_OR = 11,
- BINOP_XOR = 12
- };
-
-
- // The function body block (FUNCTION_BLOCK_ID) describes function bodies. It
- // can contain a constant block (CONSTANTS_BLOCK_ID).
- enum FunctionCodes {
- FUNC_CODE_DECLAREBLOCKS = 1, // DECLAREBLOCKS: [n]
-
- FUNC_CODE_INST_BINOP = 2, // BINOP: [opcode, ty, opval, opval]
- FUNC_CODE_INST_CAST = 3, // CAST: [opcode, ty, opty, opval]
- FUNC_CODE_INST_GEP = 4, // GEP: [n x operands]
- FUNC_CODE_INST_SELECT = 5, // SELECT: [ty, opval, opval, opval]
- FUNC_CODE_INST_EXTRACTELT = 6, // EXTRACTELT: [opty, opval, opval]
- FUNC_CODE_INST_INSERTELT = 7, // INSERTELT: [ty, opval, opval, opval]
- FUNC_CODE_INST_SHUFFLEVEC = 8, // SHUFFLEVEC: [ty, opval, opval, opval]
- FUNC_CODE_INST_CMP = 9, // CMP: [opty, opval, opval, pred]
-
- FUNC_CODE_INST_RET = 10, // RET: [opty,opval<both optional>]
- FUNC_CODE_INST_BR = 11, // BR: [bb#, bb#, cond] or [bb#]
- FUNC_CODE_INST_SWITCH = 12, // SWITCH: [opty, opval, n, n x ops]
- FUNC_CODE_INST_INVOKE = 13, // INVOKE: [attr, fnty, op0,op1, ...]
- FUNC_CODE_INST_UNWIND = 14, // UNWIND
- FUNC_CODE_INST_UNREACHABLE = 15, // UNREACHABLE
-
- FUNC_CODE_INST_PHI = 16, // PHI: [ty, val0,bb0, ...]
- FUNC_CODE_INST_MALLOC = 17, // MALLOC: [instty, op, align]
- FUNC_CODE_INST_FREE = 18, // FREE: [opty, op]
- FUNC_CODE_INST_ALLOCA = 19, // ALLOCA: [instty, op, align]
- FUNC_CODE_INST_LOAD = 20, // LOAD: [opty, op, align, vol]
- // FIXME: Remove STORE in favor of STORE2 in LLVM 3.0
- FUNC_CODE_INST_STORE = 21, // STORE: [valty,val,ptr, align, vol]
- FUNC_CODE_INST_CALL = 22, // CALL: [attr, fnty, fnid, args...]
- FUNC_CODE_INST_VAARG = 23, // VAARG: [valistty, valist, instty]
- // This store code encodes the pointer type, rather than the value type
- // this is so information only available in the pointer type (e.g. address
- // spaces) is retained.
- FUNC_CODE_INST_STORE2 = 24, // STORE: [ptrty,ptr,val, align, vol]
- FUNC_CODE_INST_GETRESULT = 25 // GETRESULT: [ty, opval, n]
- };
-} // End bitc namespace
-} // End llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/Bitcode/ReaderWriter.h b/release_23/include/llvm/Bitcode/ReaderWriter.h
deleted file mode 100644
index 8cfa693772e4..000000000000
--- a/release_23/include/llvm/Bitcode/ReaderWriter.h
+++ /dev/null
@@ -1,48 +0,0 @@
-//===-- llvm/Bitcode/ReaderWriter.h - Bitcode reader/writers ----*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This header defines interfaces to read and write LLVM bitcode files/streams.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_BITCODE_H
-#define LLVM_BITCODE_H
-
-#include <iosfwd>
-#include <string>
-
-namespace llvm {
- class Module;
- class ModuleProvider;
- class MemoryBuffer;
- class ModulePass;
-
- /// getBitcodeModuleProvider - Read the header of the specified bitcode buffer
- /// and prepare for lazy deserialization of function bodies. If successful,
- /// this takes ownership of 'buffer' and returns a non-null pointer. On
- /// error, this returns null, *does not* take ownership of Buffer, and fills
- /// in *ErrMsg with an error description if ErrMsg is non-null.
- ModuleProvider *getBitcodeModuleProvider(MemoryBuffer *Buffer,
- std::string *ErrMsg = 0);
-
- /// ParseBitcodeFile - Read the specified bitcode file, returning the module.
- /// If an error occurs, this returns null and fills in *ErrMsg if it is
- /// non-null. This method *never* takes ownership of Buffer.
- Module *ParseBitcodeFile(MemoryBuffer *Buffer, std::string *ErrMsg = 0);
-
- /// WriteBitcodeToFile - Write the specified module to the specified output
- /// stream.
- void WriteBitcodeToFile(const Module *M, std::ostream &Out);
-
- /// CreateBitcodeWriterPass - Create and return a pass that writes the module
- /// to the specified ostream.
- ModulePass *CreateBitcodeWriterPass(std::ostream &Str);
-} // End llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/Bitcode/Serialization.h b/release_23/include/llvm/Bitcode/Serialization.h
deleted file mode 100644
index 6b64f5ecb5d6..000000000000
--- a/release_23/include/llvm/Bitcode/Serialization.h
+++ /dev/null
@@ -1,68 +0,0 @@
-//==- Serialization.h - Generic Object Serialization to Bitcode ---*- C++ -*-=//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines traits for primitive types used for both object
-// serialization and deserialization.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_BITCODE_SERIALIZE
-#define LLVM_BITCODE_SERIALIZE
-
-#include "llvm/Bitcode/SerializationFwd.h"
-
-namespace llvm {
-
-/// SerializeTrait - SerializeTrait bridges between the Serializer/Deserializer
-/// and the functions that serialize objects of specific types. The default
-/// behavior is to call static methods of the class for the object being
-/// serialized, but this behavior can be changed by specializing this
-/// template. Classes only need to implement the methods corresponding
-/// to the serialization scheme they want to support. For example, "Read"
-/// and "ReadVal" correspond to different deserialization schemes which make
-/// sense for different types; a class need only implement one of them.
-/// Serialization and deserialization of pointers are specially handled
-/// by the Serializer and Deserializer using the EmitOwnedPtr, etc. methods.
-/// To serialize the actual object referred to by a pointer, the class
-/// of the object either must implement the methods called by the default
-/// behavior of SerializeTrait, or specialize SerializeTrait. This latter
-/// is useful when one cannot add methods to an existing class (for example).
-template <typename T>
-struct SerializeTrait {
- static inline void Emit(Serializer& S, const T& X) { X.Emit(S); }
- static inline void Read(Deserializer& D, T& X) { X.Read(D); }
- static inline T* Create(Deserializer& D) { return T::Create(D); }
-
- template <typename Arg1>
- static inline T* Create(Deserializer& D, Arg1& arg1) {
- return T::Create(D, arg1);
- }
-};
-
-#define SERIALIZE_INT_TRAIT(TYPE)\
-template <> struct SerializeTrait<TYPE> {\
- static void Emit(Serializer& S, TYPE X);\
- static void Read(Deserializer& S, TYPE& X); };
-
-SERIALIZE_INT_TRAIT(bool)
-SERIALIZE_INT_TRAIT(unsigned char)
-SERIALIZE_INT_TRAIT(unsigned short)
-SERIALIZE_INT_TRAIT(unsigned int)
-SERIALIZE_INT_TRAIT(unsigned long)
-
-SERIALIZE_INT_TRAIT(signed char)
-SERIALIZE_INT_TRAIT(signed short)
-SERIALIZE_INT_TRAIT(signed int)
-SERIALIZE_INT_TRAIT(signed long)
-
-#undef SERIALIZE_INT_TRAIT
-
-} // end namespace llvm
-
-#endif
diff --git a/release_23/include/llvm/Bitcode/SerializationFwd.h b/release_23/include/llvm/Bitcode/SerializationFwd.h
deleted file mode 100644
index f15683fb4ae2..000000000000
--- a/release_23/include/llvm/Bitcode/SerializationFwd.h
+++ /dev/null
@@ -1,27 +0,0 @@
-//==- SerializationFwd.h - Forward references for Serialization ---*- C++ -*-=//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file provides forward references for bitcode object serialization.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_BITCODE_SERIALIZE_FWD
-#define LLVM_BITCODE_SERIALIZE_FWD
-
-namespace llvm {
-
-class Serializer;
-class Deserializer;
-template <typename T> struct SerializeTrait;
-
-typedef unsigned SerializedPtrID;
-
-} // end namespace llvm
-
-#endif
diff --git a/release_23/include/llvm/Bitcode/Serialize.h b/release_23/include/llvm/Bitcode/Serialize.h
deleted file mode 100644
index eae9e7cdc891..000000000000
--- a/release_23/include/llvm/Bitcode/Serialize.h
+++ /dev/null
@@ -1,211 +0,0 @@
-//==- Serialize.h - Generic Object Serialization to Bitcode -------*- C++ -*-=//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines the interface for generic object serialization to
-// LLVM bitcode.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_BITCODE_SERIALIZE_OUTPUT
-#define LLVM_BITCODE_SERIALIZE_OUTPUT
-
-#include "llvm/Bitcode/Serialization.h"
-#include "llvm/Bitcode/BitstreamWriter.h"
-#include "llvm/ADT/SmallVector.h"
-#include "llvm/ADT/DenseMap.h"
-
-namespace llvm {
-
-class Serializer {
- BitstreamWriter& Stream;
- SmallVector<uint64_t,10> Record;
- unsigned BlockLevel;
-
- typedef DenseMap<const void*,unsigned> MapTy;
- MapTy PtrMap;
-
-public:
- explicit Serializer(BitstreamWriter& stream);
- ~Serializer();
-
- //==------------------------------------------------==//
- // Template-based dispatch to emit arbitrary types.
- //==------------------------------------------------==//
-
- template <typename T>
- inline void Emit(const T& X) { SerializeTrait<T>::Emit(*this,X); }
-
- //==------------------------------------------------==//
- // Methods to emit primitive types.
- //==------------------------------------------------==//
-
- void EmitInt(uint64_t X);
- void EmitSInt(int64_t X);
-
- inline void EmitBool(bool X) { EmitInt(X); }
- void EmitCStr(const char* beg, const char* end);
- void EmitCStr(const char* cstr);
-
- void EmitPtr(const void* ptr) { EmitInt(getPtrId(ptr)); }
-
- template <typename T>
- inline void EmitRef(const T& ref) { EmitPtr(&ref); }
-
- // Emit a pointer and the object pointed to. (This has no relation to the
- // OwningPtr<> class.)
- template <typename T>
- inline void EmitOwnedPtr(T* ptr) {
- EmitPtr(ptr);
- if (ptr) SerializeTrait<T>::Emit(*this,*ptr);
- }
-
-
- //==------------------------------------------------==//
- // Batch emission of pointers.
- //==------------------------------------------------==//
-
- template <typename T1, typename T2>
- void BatchEmitOwnedPtrs(T1* p1, T2* p2) {
- EmitPtr(p1);
- EmitPtr(p2);
- if (p1) SerializeTrait<T1>::Emit(*this,*p1);
- if (p2) SerializeTrait<T2>::Emit(*this,*p2);
- }
-
- template <typename T1, typename T2, typename T3>
- void BatchEmitOwnedPtrs(T1* p1, T2* p2, T3* p3) {
- EmitPtr(p1);
- EmitPtr(p2);
- EmitPtr(p3);
- if (p1) SerializeTrait<T1>::Emit(*this,*p1);
- if (p2) SerializeTrait<T2>::Emit(*this,*p2);
- if (p3) SerializeTrait<T3>::Emit(*this,*p3);
- }
-
- template <typename T1, typename T2, typename T3, typename T4>
- void BatchEmitOwnedPtrs(T1* p1, T2* p2, T3* p3, T4& p4) {
- EmitPtr(p1);
- EmitPtr(p2);
- EmitPtr(p3);
- EmitPtr(p4);
- if (p1) SerializeTrait<T1>::Emit(*this,*p1);
- if (p2) SerializeTrait<T2>::Emit(*this,*p2);
- if (p3) SerializeTrait<T3>::Emit(*this,*p3);
- if (p4) SerializeTrait<T4>::Emit(*this,*p4);
- }
-
- template <typename T>
- void BatchEmitOwnedPtrs(unsigned NumPtrs, T* const * Ptrs) {
- for (unsigned i = 0; i < NumPtrs; ++i)
- EmitPtr(Ptrs[i]);
-
- for (unsigned i = 0; i < NumPtrs; ++i)
- if (Ptrs[i]) SerializeTrait<T>::Emit(*this,*Ptrs[i]);
- }
-
- template <typename T1, typename T2>
- void BatchEmitOwnedPtrs(unsigned NumT1Ptrs, T1* const * Ptrs, T2* p2) {
-
- for (unsigned i = 0; i < NumT1Ptrs; ++i)
- EmitPtr(Ptrs[i]);
-
- EmitPtr(p2);
-
- for (unsigned i = 0; i < NumT1Ptrs; ++i)
- if (Ptrs[i]) SerializeTrait<T1>::Emit(*this,*Ptrs[i]);
-
- if (p2) SerializeTrait<T2>::Emit(*this,*p2);
- }
-
- template <typename T1, typename T2, typename T3>
- void BatchEmitOwnedPtrs(unsigned NumT1Ptrs, T1* const * Ptrs,
- T2* p2, T3* p3) {
-
- for (unsigned i = 0; i < NumT1Ptrs; ++i)
- EmitPtr(Ptrs[i]);
-
- EmitPtr(p2);
- EmitPtr(p3);
-
- for (unsigned i = 0; i < NumT1Ptrs; ++i)
- if (Ptrs[i]) SerializeTrait<T1>::Emit(*this,*Ptrs[i]);
-
- if (p2) SerializeTrait<T2>::Emit(*this,*p2);
- if (p3) SerializeTrait<T3>::Emit(*this,*p3);
- }
-
- //==------------------------------------------------==//
- // Emitter Functors
- //==------------------------------------------------==//
-
- template <typename T>
- struct Emitter0 {
- Serializer& S;
- Emitter0(Serializer& s) : S(s) {}
- void operator()(const T& x) const {
- SerializeTrait<T>::Emit(S,x);
- }
- };
-
- template <typename T, typename Arg1>
- struct Emitter1 {
- Serializer& S;
- Arg1 A1;
-
- Emitter1(Serializer& s, Arg1 a1) : S(s), A1(a1) {}
- void operator()(const T& x) const {
- SerializeTrait<T>::Emit(S,x,A1);
- }
- };
-
- template <typename T, typename Arg1, typename Arg2>
- struct Emitter2 {
- Serializer& S;
- Arg1 A1;
- Arg2 A2;
-
- Emitter2(Serializer& s, Arg1 a1, Arg2 a2) : S(s), A1(a1), A2(a2) {}
- void operator()(const T& x) const {
- SerializeTrait<T>::Emit(S,x,A1,A2);
- }
- };
-
- template <typename T>
- Emitter0<T> MakeEmitter() {
- return Emitter0<T>(*this);
- }
-
- template <typename T, typename Arg1>
- Emitter1<T,Arg1> MakeEmitter(Arg1 a1) {
- return Emitter1<T,Arg1>(*this,a1);
- }
-
- template <typename T, typename Arg1, typename Arg2>
- Emitter2<T,Arg1,Arg2> MakeEmitter(Arg1 a1, Arg2 a2) {
- return Emitter2<T,Arg1,Arg2>(*this,a1,a2);
- }
-
- //==------------------------------------------------==//
- // Misc. query and block/record manipulation methods.
- //==------------------------------------------------==//
-
- bool isRegistered(const void* p) const;
-
- void FlushRecord() { if (inRecord()) EmitRecord(); }
- void EnterBlock(unsigned BlockID = 8, unsigned CodeLen = 3);
- void ExitBlock();
-
-private:
- void EmitRecord();
- inline bool inRecord() { return Record.size() > 0; }
- SerializedPtrID getPtrId(const void* ptr);
-};
-
-} // end namespace llvm
-#endif
diff --git a/release_23/include/llvm/CallGraphSCCPass.h b/release_23/include/llvm/CallGraphSCCPass.h
deleted file mode 100644
index 26005059dee5..000000000000
--- a/release_23/include/llvm/CallGraphSCCPass.h
+++ /dev/null
@@ -1,72 +0,0 @@
-//===- CallGraphSCCPass.h - Pass that operates BU on call graph -*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines the CallGraphSCCPass class, which is used for passes which
-// are implemented as bottom-up traversals on the call graph. Because there may
-// be cycles in the call graph, passes of this type operate on the call-graph in
-// SCC order: that is, they process function bottom-up, except for recursive
-// functions, which they process all at once.
-//
-// These passes are inherently interprocedural, and are required to keep the
-// call graph up-to-date if they do anything which could modify it.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_CALL_GRAPH_SCC_PASS_H
-#define LLVM_CALL_GRAPH_SCC_PASS_H
-
-#include "llvm/Pass.h"
-
-namespace llvm {
-
-class CallGraphNode;
-class CallGraph;
-class PMStack;
-
-struct CallGraphSCCPass : public Pass {
-
- explicit CallGraphSCCPass(intptr_t pid) : Pass(pid) {}
-
- /// doInitialization - This method is called before the SCC's of the program
- /// has been processed, allowing the pass to do initialization as necessary.
- virtual bool doInitialization(CallGraph &CG) {
- return false;
- }
-
- /// runOnSCC - This method should be implemented by the subclass to perform
- /// whatever action is necessary for the specified SCC. Note that
- /// non-recursive (or only self-recursive) functions will have an SCC size of
- /// 1, where recursive portions of the call graph will have SCC size > 1.
- ///
- virtual bool runOnSCC(const std::vector<CallGraphNode *> &SCC) = 0;
-
- /// doFinalization - This method is called after the SCC's of the program has
- /// been processed, allowing the pass to do final cleanup as necessary.
- virtual bool doFinalization(CallGraph &CG) {
- return false;
- }
-
- /// Assign pass manager to manager this pass
- virtual void assignPassManager(PMStack &PMS,
- PassManagerType PMT = PMT_CallGraphPassManager);
-
- /// Return what kind of Pass Manager can manage this pass.
- virtual PassManagerType getPotentialPassManagerType() const {
- return PMT_CallGraphPassManager;
- }
-
- /// getAnalysisUsage - For this class, we declare that we require and preserve
- /// the call graph. If the derived class implements this method, it should
- /// always explicitly call the implementation here.
- virtual void getAnalysisUsage(AnalysisUsage &Info) const;
-};
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/CallingConv.h b/release_23/include/llvm/CallingConv.h
deleted file mode 100644
index 13dd0f79e782..000000000000
--- a/release_23/include/llvm/CallingConv.h
+++ /dev/null
@@ -1,70 +0,0 @@
-//===-- llvm/CallingConv.h - LLVM Calling Conventions -----------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines LLVM's set of calling conventions.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_CALLINGCONV_H
-#define LLVM_CALLINGCONV_H
-
-namespace llvm {
-
-/// CallingConv Namespace - This namespace contains an enum with a value for
-/// the well-known calling conventions.
-///
-namespace CallingConv {
- /// A set of enums which specify the assigned numeric values for known llvm
- /// calling conventions.
- /// @brief LLVM Calling Convention Representation
- enum ID {
- /// C - The default llvm calling convention, compatible with C. This
- /// convention is the only calling convention that supports varargs calls.
- /// As with typical C calling conventions, the callee/caller have to
- /// tolerate certain amounts of prototype mismatch.
- C = 0,
-
- // Generic LLVM calling conventions. None of these calling conventions
- // support varargs calls, and all assume that the caller and callee
- // prototype exactly match.
-
- /// Fast - This calling convention attempts to make calls as fast as
- /// possible /// (e.g. by passing things in registers).
- Fast = 8,
-
- // Cold - This calling convention attempts to make code in the caller as
- // efficient as possible under the assumption that the call is not commonly
- // executed. As such, these calls often preserve all registers so that the
- // call does not break any live ranges in the caller side.
- Cold = 9,
-
- // Target - This is the start of the target-specific calling conventions,
- // e.g. fastcall and thiscall on X86.
- FirstTargetCC = 64,
-
- /// X86_StdCall - stdcall is the calling conventions mostly used by the
- /// Win32 API. It is basically the same as the C convention with the
- /// difference in that the callee is responsible for popping the arguments
- /// from the stack.
- X86_StdCall = 64,
-
- /// X86_FastCall - 'fast' analog of X86_StdCall. Passes first two arguments
- /// in ECX:EDX registers, others - via stack. Callee is responsible for
- /// stack cleaning.
- X86_FastCall = 65,
-
- /// X86_SSEreg - The standard convention except that float and double
- /// values are returned in XMM0 if SSE support is available.
- X86_SSECall = 66
- };
-} // End CallingConv namespace
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/CodeGen/AsmPrinter.h b/release_23/include/llvm/CodeGen/AsmPrinter.h
deleted file mode 100644
index ddd91620b21c..000000000000
--- a/release_23/include/llvm/CodeGen/AsmPrinter.h
+++ /dev/null
@@ -1,360 +0,0 @@
-//===-- llvm/CodeGen/AsmPrinter.h - AsmPrinter Framework --------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains a class to be used as the base class for target specific
-// asm writers. This class primarily handles common functionality used by
-// all asm writers.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_CODEGEN_ASMPRINTER_H
-#define LLVM_CODEGEN_ASMPRINTER_H
-
-#include "llvm/CodeGen/MachineFunctionPass.h"
-#include "llvm/Support/DataTypes.h"
-#include <set>
-
-namespace llvm {
- class Constant;
- class ConstantArray;
- class GlobalVariable;
- class GlobalAlias;
- class MachineConstantPoolEntry;
- class MachineConstantPoolValue;
- class MachineModuleInfo;
- class Mangler;
- class TargetAsmInfo;
- class Type;
-
- /// AsmPrinter - This class is intended to be used as a driving class for all
- /// asm writers.
- class AsmPrinter : public MachineFunctionPass {
- static char ID;
-
- /// FunctionNumber - This provides a unique ID for each function emitted in
- /// this translation unit. It is autoincremented by SetupMachineFunction,
- /// and can be accessed with getFunctionNumber() and
- /// IncrementFunctionNumber().
- ///
- unsigned FunctionNumber;
-
- /// MachineModuleInfo - This is needed because printDeclare() has to insert
- /// DebugVariable entries into the dwarf table. This is a short term hack
- /// that ought be fixed soon.
- MachineModuleInfo *MMI;
-
- protected:
- // Necessary for external weak linkage support
- std::set<const GlobalValue*> ExtWeakSymbols;
-
- public:
- /// Output stream on which we're printing assembly code.
- ///
- std::ostream &O;
-
- /// Target machine description.
- ///
- TargetMachine &TM;
-
- /// Target Asm Printer information.
- ///
- const TargetAsmInfo *TAI;
-
- /// Target Register Information.
- ///
- const TargetRegisterInfo *TRI;
-
- /// Name-mangler for global names.
- ///
- Mangler *Mang;
-
- /// Cache of mangled name for current function. This is recalculated at the
- /// beginning of each call to runOnMachineFunction().
- ///
- std::string CurrentFnName;
-
- /// CurrentSection - The current section we are emitting to. This is
- /// controlled and used by the SwitchSection method.
- std::string CurrentSection;
-
- /// IsInTextSection - True if the current section we are emitting to is a
- /// text section.
- bool IsInTextSection;
-
- protected:
- AsmPrinter(std::ostream &o, TargetMachine &TM, const TargetAsmInfo *T);
-
- public:
- /// SwitchToTextSection - Switch to the specified section of the executable
- /// if we are not already in it! If GV is non-null and if the global has an
- /// explicitly requested section, we switch to the section indicated for the
- /// global instead of NewSection.
- ///
- /// If the new section is an empty string, this method forgets what the
- /// current section is, but does not emit a .section directive.
- ///
- /// This method is used when about to emit executable code.
- ///
- void SwitchToTextSection(const char *NewSection, const GlobalValue *GV = NULL);
-
- /// SwitchToDataSection - Switch to the specified section of the executable
- /// if we are not already in it! If GV is non-null and if the global has an
- /// explicitly requested section, we switch to the section indicated for the
- /// global instead of NewSection.
- ///
- /// If the new section is an empty string, this method forgets what the
- /// current section is, but does not emit a .section directive.
- ///
- /// This method is used when about to emit data. For most assemblers, this
- /// is the same as the SwitchToTextSection method, but not all assemblers
- /// are the same.
- ///
- void SwitchToDataSection(const char *NewSection, const GlobalValue *GV = NULL);
-
- /// getGlobalLinkName - Returns the asm/link name of of the specified
- /// global variable. Should be overridden by each target asm printer to
- /// generate the appropriate value.
- virtual const std::string getGlobalLinkName(const GlobalVariable *GV) const;
-
- /// EmitExternalGlobal - Emit the external reference to a global variable.
- /// Should be overridden if an indirect reference should be used.
- virtual void EmitExternalGlobal(const GlobalVariable *GV);
-
- /// getCurrentFunctionEHName - Called to return (and cache) the
- /// CurrentFnEHName.
- ///
- std::string getCurrentFunctionEHName(const MachineFunction *MF);
-
- protected:
- /// getAnalysisUsage - Record analysis usage.
- ///
- void getAnalysisUsage(AnalysisUsage &AU) const;
-
- /// doInitialization - Set up the AsmPrinter when we are working on a new
- /// module. If your pass overrides this, it must make sure to explicitly
- /// call this implementation.
- bool doInitialization(Module &M);
-
- /// doFinalization - Shut down the asmprinter. If you override this in your
- /// pass, you must make sure to call it explicitly.
- bool doFinalization(Module &M);
-
- /// PrintSpecial - Print information related to the specified machine instr
- /// that is independent of the operand, and may be independent of the instr
- /// itself. This can be useful for portably encoding the comment character
- /// or other bits of target-specific knowledge into the asmstrings. The
- /// syntax used is ${:comment}. Targets can override this to add support
- /// for their own strange codes.
- virtual void PrintSpecial(const MachineInstr *MI, const char *Code);
-
- /// PrintAsmOperand - Print the specified operand of MI, an INLINEASM
- /// instruction, using the specified assembler variant. Targets should
- /// override this to format as appropriate. This method can return true if
- /// the operand is erroneous.
- virtual bool PrintAsmOperand(const MachineInstr *MI, unsigned OpNo,
- unsigned AsmVariant, const char *ExtraCode);
-
- /// PrintAsmMemoryOperand - Print the specified operand of MI, an INLINEASM
- /// instruction, using the specified assembler variant as an address.
- /// Targets should override this to format as appropriate. This method can
- /// return true if the operand is erroneous.
- virtual bool PrintAsmMemoryOperand(const MachineInstr *MI, unsigned OpNo,
- unsigned AsmVariant,
- const char *ExtraCode);
-
- /// getSectionForFunction - Return the section that we should emit the
- /// specified function body into. This defaults to 'TextSection'. This
- /// should most likely be overridden by the target to put linkonce/weak
- /// functions into special sections.
- virtual std::string getSectionForFunction(const Function &F) const;
-
- /// SetupMachineFunction - This should be called when a new MachineFunction
- /// is being processed from runOnMachineFunction.
- void SetupMachineFunction(MachineFunction &MF);
-
- /// getFunctionNumber - Return a unique ID for the current function.
- ///
- unsigned getFunctionNumber() const { return FunctionNumber; }
-
- /// IncrementFunctionNumber - Increase Function Number. AsmPrinters should
- /// not normally call this, as the counter is automatically bumped by
- /// SetupMachineFunction.
- void IncrementFunctionNumber() { FunctionNumber++; }
-
- /// EmitConstantPool - Print to the current output stream assembly
- /// representations of the constants in the constant pool MCP. This is
- /// used to print out constants which have been "spilled to memory" by
- /// the code generator.
- ///
- void EmitConstantPool(MachineConstantPool *MCP);
-
- /// EmitJumpTableInfo - Print assembly representations of the jump tables
- /// used by the current function to the current output stream.
- ///
- void EmitJumpTableInfo(MachineJumpTableInfo *MJTI, MachineFunction &MF);
-
- /// EmitSpecialLLVMGlobal - Check to see if the specified global is a
- /// special global used by LLVM. If so, emit it and return true, otherwise
- /// do nothing and return false.
- bool EmitSpecialLLVMGlobal(const GlobalVariable *GV);
-
- public:
- //===------------------------------------------------------------------===//
- /// LEB 128 number encoding.
-
- /// PrintULEB128 - Print a series of hexidecimal values(separated by commas)
- /// representing an unsigned leb128 value.
- void PrintULEB128(unsigned Value) const;
-
- /// SizeULEB128 - Compute the number of bytes required for an unsigned
- /// leb128 value.
- static unsigned SizeULEB128(unsigned Value);
-
- /// PrintSLEB128 - Print a series of hexidecimal values(separated by commas)
- /// representing a signed leb128 value.
- void PrintSLEB128(int Value) const;
-
- /// SizeSLEB128 - Compute the number of bytes required for a signed leb128
- /// value.
- static unsigned SizeSLEB128(int Value);
-
- //===------------------------------------------------------------------===//
- // Emission and print routines
- //
-
- /// PrintHex - Print a value as a hexidecimal value.
- ///
- void PrintHex(int Value) const;
-
- /// EOL - Print a newline character to asm stream. If a comment is present
- /// then it will be printed first. Comments should not contain '\n'.
- void EOL() const;
- void EOL(const std::string &Comment) const;
-
- /// EmitULEB128Bytes - Emit an assembler byte data directive to compose an
- /// unsigned leb128 value.
- void EmitULEB128Bytes(unsigned Value) const;
-
- /// EmitSLEB128Bytes - print an assembler byte data directive to compose a
- /// signed leb128 value.
- void EmitSLEB128Bytes(int Value) const;
-
- /// EmitInt8 - Emit a byte directive and value.
- ///
- void EmitInt8(int Value) const;
-
- /// EmitInt16 - Emit a short directive and value.
- ///
- void EmitInt16(int Value) const;
-
- /// EmitInt32 - Emit a long directive and value.
- ///
- void EmitInt32(int Value) const;
-
- /// EmitInt64 - Emit a long long directive and value.
- ///
- void EmitInt64(uint64_t Value) const;
-
- /// EmitString - Emit a string with quotes and a null terminator.
- /// Special characters are emitted properly.
- /// @verbatim (Eg. '\t') @endverbatim
- void EmitString(const std::string &String) const;
-
- /// EmitFile - Emit a .file directive.
- void EmitFile(unsigned Number, const std::string &Name) const;
-
- //===------------------------------------------------------------------===//
-
- /// EmitAlignment - Emit an alignment directive to the specified power of
- /// two boundary. For example, if you pass in 3 here, you will get an 8
- /// byte alignment. If a global value is specified, and if that global has
- /// an explicit alignment requested, it will unconditionally override the
- /// alignment request. However, if ForcedAlignBits is specified, this value
- /// has final say: the ultimate alignment will be the max of ForcedAlignBits
- /// and the alignment computed with NumBits and the global. If UseFillExpr
- /// is true, it also emits an optional second value FillValue which the
- /// assembler uses to fill gaps to match alignment for text sections if the
- /// has specified a non-zero fill value.
- ///
- /// The algorithm is:
- /// Align = NumBits;
- /// if (GV && GV->hasalignment) Align = GV->getalignment();
- /// Align = std::max(Align, ForcedAlignBits);
- ///
- void EmitAlignment(unsigned NumBits, const GlobalValue *GV = 0,
- unsigned ForcedAlignBits = 0,
- bool UseFillExpr = true) const;
-
- /// printLabel - This method prints a local label used by debug and
- /// exception handling tables.
- void printLabel(const MachineInstr *MI) const;
- void printLabel(unsigned Id) const;
-
- /// printDeclare - This method prints a local variable declaration used by
- /// debug tables.
- void printDeclare(const MachineInstr *MI) const;
-
- protected:
- /// EmitZeros - Emit a block of zeros.
- ///
- void EmitZeros(uint64_t NumZeros) const;
-
- /// EmitString - Emit a zero-byte-terminated string constant.
- ///
- virtual void EmitString(const ConstantArray *CVA) const;
-
- /// EmitConstantValueOnly - Print out the specified constant, without a
- /// storage class. Only constants of first-class type are allowed here.
- void EmitConstantValueOnly(const Constant *CV);
-
- /// EmitGlobalConstant - Print a general LLVM constant to the .s file.
- /// If Packed is false, pad to the ABI size.
- void EmitGlobalConstant(const Constant* CV, bool Packed = false);
-
- virtual void EmitMachineConstantPoolValue(MachineConstantPoolValue *MCPV);
-
- /// printInlineAsm - This method formats and prints the specified machine
- /// instruction that is an inline asm.
- void printInlineAsm(const MachineInstr *MI) const;
-
- /// printImplicitDef - This method prints the specified machine instruction
- /// that is an implicit def.
- virtual void printImplicitDef(const MachineInstr *MI) const;
-
- /// printBasicBlockLabel - This method prints the label for the specified
- /// MachineBasicBlock
- virtual void printBasicBlockLabel(const MachineBasicBlock *MBB,
- bool printAlign = false,
- bool printColon = false,
- bool printComment = true) const;
-
- /// printPICJumpTableSetLabel - This method prints a set label for the
- /// specified MachineBasicBlock for a jumptable entry.
- virtual void printPICJumpTableSetLabel(unsigned uid,
- const MachineBasicBlock *MBB) const;
- virtual void printPICJumpTableSetLabel(unsigned uid, unsigned uid2,
- const MachineBasicBlock *MBB) const;
- virtual void printPICJumpTableEntry(const MachineJumpTableInfo *MJTI,
- const MachineBasicBlock *MBB,
- unsigned uid) const;
-
- /// printDataDirective - This method prints the asm directive for the
- /// specified type.
- void printDataDirective(const Type *type);
-
- private:
- void EmitLLVMUsedList(Constant *List);
- void EmitXXStructorList(Constant *List);
- void EmitConstantPool(unsigned Alignment, const char *Section,
- std::vector<std::pair<MachineConstantPoolEntry,unsigned> > &CP);
-
- };
-}
-
-#endif
diff --git a/release_23/include/llvm/CodeGen/BreakCriticalMachineEdge.h b/release_23/include/llvm/CodeGen/BreakCriticalMachineEdge.h
deleted file mode 100644
index a8034275982b..000000000000
--- a/release_23/include/llvm/CodeGen/BreakCriticalMachineEdge.h
+++ /dev/null
@@ -1,109 +0,0 @@
-//===--------- BreakCriticalMachineEdges.h - Break critical edges ---------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===---------------------------------------------------------------------===//
-//
-// Helper function to break a critical machine edge.
-//
-//===---------------------------------------------------------------------===//
-
-#ifndef LLVM_CODEGEN_ASMPRINTER_H
-#define LLVM_CODEGEN_ASMPRINTER_H
-
-#include "llvm/CodeGen/MachineJumpTableInfo.h"
-#include "llvm/Target/TargetInstrInfo.h"
-#include "llvm/Target/TargetMachine.h"
-
-namespace llvm {
-
-MachineBasicBlock* SplitCriticalMachineEdge(MachineBasicBlock* src,
- MachineBasicBlock* dst) {
- const BasicBlock* srcBB = src->getBasicBlock();
-
- MachineBasicBlock* crit_mbb = new MachineBasicBlock(srcBB);
-
- // modify the llvm control flow graph
- src->removeSuccessor(dst);
- src->addSuccessor(crit_mbb);
- crit_mbb->addSuccessor(dst);
-
- // insert the new block into the machine function.
- src->getParent()->getBasicBlockList().insert(src->getParent()->end(),
- crit_mbb);
-
- // insert a unconditional branch linking the new block to dst
- const TargetMachine& TM = src->getParent()->getTarget();
- const TargetInstrInfo* TII = TM.getInstrInfo();
- std::vector<MachineOperand> emptyConditions;
- TII->InsertBranch(*crit_mbb, dst, (MachineBasicBlock*)0,
- emptyConditions);
-
- // modify every branch in src that points to dst to point to the new
- // machine basic block instead:
- MachineBasicBlock::iterator mii = src->end();
- bool found_branch = false;
- while (mii != src->begin()) {
- mii--;
- // if there are no more branches, finish the loop
- if (!mii->getDesc().isTerminator()) {
- break;
- }
-
- // Scan the operands of this branch, replacing any uses of dst with
- // crit_mbb.
- for (unsigned i = 0, e = mii->getNumOperands(); i != e; ++i) {
- MachineOperand & mo = mii->getOperand(i);
- if (mo.isMachineBasicBlock() &&
- mo.getMBB() == dst) {
- found_branch = true;
- mo.setMBB(crit_mbb);
- }
- }
- }
-
- // TODO: This is tentative. It may be necessary to fix this code. Maybe
- // I am inserting too many gotos, but I am trusting that the asm printer
- // will optimize the unnecessary gotos.
- if(!found_branch) {
- TII->InsertBranch(*src, crit_mbb, (MachineBasicBlock*)0,
- emptyConditions);
- }
-
- /// Change all the phi functions in dst, so that the incoming block be
- /// crit_mbb, instead of src
- for(mii = dst->begin(); mii != dst->end(); mii++) {
- /// the first instructions are always phi functions.
- if(mii->getOpcode() != TargetInstrInfo::PHI)
- break;
-
- // Find the operands corresponding to the source block
- std::vector<unsigned> toRemove;
- unsigned reg = 0;
- for (unsigned u = 0; u != mii->getNumOperands(); ++u)
- if (mii->getOperand(u).isMachineBasicBlock() &&
- mii->getOperand(u).getMBB() == src) {
- reg = mii->getOperand(u-1).getReg();
- toRemove.push_back(u-1);
- }
- // Remove all uses of this MBB
- for (std::vector<unsigned>::reverse_iterator I = toRemove.rbegin(),
- E = toRemove.rend(); I != E; ++I) {
- mii->RemoveOperand(*I+1);
- mii->RemoveOperand(*I);
- }
-
- // Add a single use corresponding to the new MBB
- mii->addOperand(MachineOperand::CreateReg(reg, false));
- mii->addOperand(MachineOperand::CreateMBB(crit_mbb));
- }
-
- return crit_mbb;
-}
-
-}
-
-#endif
diff --git a/release_23/include/llvm/CodeGen/CallingConvLower.h b/release_23/include/llvm/CodeGen/CallingConvLower.h
deleted file mode 100644
index 584cb1993901..000000000000
--- a/release_23/include/llvm/CodeGen/CallingConvLower.h
+++ /dev/null
@@ -1,233 +0,0 @@
-//===-- llvm/CallingConvLower.h - Calling Conventions -----------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file declares the CCState and CCValAssign classes, used for lowering
-// and implementing calling conventions.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_CODEGEN_CALLINGCONVLOWER_H
-#define LLVM_CODEGEN_CALLINGCONVLOWER_H
-
-#include "llvm/ADT/SmallVector.h"
-#include "llvm/CodeGen/ValueTypes.h"
-#include "llvm/CodeGen/SelectionDAGNodes.h"
-
-namespace llvm {
- class TargetRegisterInfo;
- class TargetMachine;
- class CCState;
- class SDNode;
-
-/// CCValAssign - Represent assignment of one arg/retval to a location.
-class CCValAssign {
-public:
- enum LocInfo {
- Full, // The value fills the full location.
- SExt, // The value is sign extended in the location.
- ZExt, // The value is zero extended in the location.
- AExt // The value is extended with undefined upper bits.
- // TODO: a subset of the value is in the location.
- };
-private:
- /// ValNo - This is the value number begin assigned (e.g. an argument number).
- unsigned ValNo;
-
- /// Loc is either a stack offset or a register number.
- unsigned Loc;
-
- /// isMem - True if this is a memory loc, false if it is a register loc.
- bool isMem : 1;
-
- /// Information about how the value is assigned.
- LocInfo HTP : 7;
-
- /// ValVT - The type of the value being assigned.
- MVT::ValueType ValVT;
-
- /// LocVT - The type of the location being assigned to.
- MVT::ValueType LocVT;
-public:
-
- static CCValAssign getReg(unsigned ValNo, MVT::ValueType ValVT,
- unsigned RegNo, MVT::ValueType LocVT,
- LocInfo HTP) {
- CCValAssign Ret;
- Ret.ValNo = ValNo;
- Ret.Loc = RegNo;
- Ret.isMem = false;
- Ret.HTP = HTP;
- Ret.ValVT = ValVT;
- Ret.LocVT = LocVT;
- return Ret;
- }
- static CCValAssign getMem(unsigned ValNo, MVT::ValueType ValVT,
- unsigned Offset, MVT::ValueType LocVT,
- LocInfo HTP) {
- CCValAssign Ret;
- Ret.ValNo = ValNo;
- Ret.Loc = Offset;
- Ret.isMem = true;
- Ret.HTP = HTP;
- Ret.ValVT = ValVT;
- Ret.LocVT = LocVT;
- return Ret;
- }
-
- unsigned getValNo() const { return ValNo; }
- MVT::ValueType getValVT() const { return ValVT; }
-
- bool isRegLoc() const { return !isMem; }
- bool isMemLoc() const { return isMem; }
-
- unsigned getLocReg() const { assert(isRegLoc()); return Loc; }
- unsigned getLocMemOffset() const { assert(isMemLoc()); return Loc; }
- MVT::ValueType getLocVT() const { return LocVT; }
-
- LocInfo getLocInfo() const { return HTP; }
-};
-
-
-/// CCAssignFn - This function assigns a location for Val, updating State to
-/// reflect the change.
-typedef bool CCAssignFn(unsigned ValNo, MVT::ValueType ValVT,
- MVT::ValueType LocVT, CCValAssign::LocInfo LocInfo,
- ISD::ArgFlagsTy ArgFlags, CCState &State);
-
-
-/// CCState - This class holds information needed while lowering arguments and
-/// return values. It captures which registers are already assigned and which
-/// stack slots are used. It provides accessors to allocate these values.
-class CCState {
- unsigned CallingConv;
- bool IsVarArg;
- const TargetMachine &TM;
- const TargetRegisterInfo &TRI;
- SmallVector<CCValAssign, 16> &Locs;
-
- unsigned StackOffset;
- SmallVector<uint32_t, 16> UsedRegs;
-public:
- CCState(unsigned CC, bool isVarArg, const TargetMachine &TM,
- SmallVector<CCValAssign, 16> &locs);
-
- void addLoc(const CCValAssign &V) {
- Locs.push_back(V);
- }
-
- const TargetMachine &getTarget() const { return TM; }
- unsigned getCallingConv() const { return CallingConv; }
- bool isVarArg() const { return IsVarArg; }
-
- unsigned getNextStackOffset() const { return StackOffset; }
-
- /// isAllocated - Return true if the specified register (or an alias) is
- /// allocated.
- bool isAllocated(unsigned Reg) const {
- return UsedRegs[Reg/32] & (1 << (Reg&31));
- }
-
- /// AnalyzeFormalArguments - Analyze an ISD::FORMAL_ARGUMENTS node,
- /// incorporating info about the formals into this state.
- void AnalyzeFormalArguments(SDNode *TheArgs, CCAssignFn Fn);
-
- /// AnalyzeReturn - Analyze the returned values of an ISD::RET node,
- /// incorporating info about the result values into this state.
- void AnalyzeReturn(SDNode *TheRet, CCAssignFn Fn);
-
- /// AnalyzeCallOperands - Analyze an ISD::CALL node, incorporating info
- /// about the passed values into this state.
- void AnalyzeCallOperands(SDNode *TheCall, CCAssignFn Fn);
-
- /// AnalyzeCallResult - Analyze the return values of an ISD::CALL node,
- /// incorporating info about the passed values into this state.
- void AnalyzeCallResult(SDNode *TheCall, CCAssignFn Fn);
-
-
- /// getFirstUnallocated - Return the first unallocated register in the set, or
- /// NumRegs if they are all allocated.
- unsigned getFirstUnallocated(const unsigned *Regs, unsigned NumRegs) const {
- for (unsigned i = 0; i != NumRegs; ++i)
- if (!isAllocated(Regs[i]))
- return i;
- return NumRegs;
- }
-
- /// AllocateReg - Attempt to allocate one register. If it is not available,
- /// return zero. Otherwise, return the register, marking it and any aliases
- /// as allocated.
- unsigned AllocateReg(unsigned Reg) {
- if (isAllocated(Reg)) return 0;
- MarkAllocated(Reg);
- return Reg;
- }
-
- /// Version of AllocateReg with extra register to be shadowed.
- unsigned AllocateReg(unsigned Reg, unsigned ShadowReg) {
- if (isAllocated(Reg)) return 0;
- MarkAllocated(Reg);
- MarkAllocated(ShadowReg);
- return Reg;
- }
-
- /// AllocateReg - Attempt to allocate one of the specified registers. If none
- /// are available, return zero. Otherwise, return the first one available,
- /// marking it and any aliases as allocated.
- unsigned AllocateReg(const unsigned *Regs, unsigned NumRegs) {
- unsigned FirstUnalloc = getFirstUnallocated(Regs, NumRegs);
- if (FirstUnalloc == NumRegs)
- return 0; // Didn't find the reg.
-
- // Mark the register and any aliases as allocated.
- unsigned Reg = Regs[FirstUnalloc];
- MarkAllocated(Reg);
- return Reg;
- }
-
- /// Version of AllocateReg with list of registers to be shadowed.
- unsigned AllocateReg(const unsigned *Regs, const unsigned *ShadowRegs,
- unsigned NumRegs) {
- unsigned FirstUnalloc = getFirstUnallocated(Regs, NumRegs);
- if (FirstUnalloc == NumRegs)
- return 0; // Didn't find the reg.
-
- // Mark the register and any aliases as allocated.
- unsigned Reg = Regs[FirstUnalloc], ShadowReg = ShadowRegs[FirstUnalloc];
- MarkAllocated(Reg);
- MarkAllocated(ShadowReg);
- return Reg;
- }
-
- /// AllocateStack - Allocate a chunk of stack space with the specified size
- /// and alignment.
- unsigned AllocateStack(unsigned Size, unsigned Align) {
- assert(Align && ((Align-1) & Align) == 0); // Align is power of 2.
- StackOffset = ((StackOffset + Align-1) & ~(Align-1));
- unsigned Result = StackOffset;
- StackOffset += Size;
- return Result;
- }
-
- // HandleByVal - Allocate a stack slot large enough to pass an argument by
- // value. The size and alignment information of the argument is encoded in its
- // parameter attribute.
- void HandleByVal(unsigned ValNo, MVT::ValueType ValVT,
- MVT::ValueType LocVT, CCValAssign::LocInfo LocInfo,
- int MinSize, int MinAlign, ISD::ArgFlagsTy ArgFlags);
-
-private:
- /// MarkAllocated - Mark a register and all of its aliases as allocated.
- void MarkAllocated(unsigned Reg);
-};
-
-
-
-} // end namespace llvm
-
-#endif
diff --git a/release_23/include/llvm/CodeGen/Collector.h b/release_23/include/llvm/CodeGen/Collector.h
deleted file mode 100644
index 160e5238b4fb..000000000000
--- a/release_23/include/llvm/CodeGen/Collector.h
+++ /dev/null
@@ -1,133 +0,0 @@
-//===-- llvm/CodeGen/Collector.h - Garbage collection -----------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// Collector records sufficient information about a machine function to enable
-// accurate garbage collectors. Specifically:
-//
-// - Safe points
-// Garbage collection is only possible at certain points in code. Code
-// generators should record points:
-//
-// - At and after any call to a subroutine
-// - Before returning from the current function
-// - Before backwards branches (loops)
-//
-// - Roots
-// When a reference to a GC-allocated object exists on the stack, it must be
-// stored in an alloca registered with llvm.gcoot.
-//
-// This generic information should used by ABI-specific passes to emit support
-// tables for the runtime garbage collector.
-//
-// MachineCodeAnalysis identifies the GC safe points in the machine code. (Roots
-// are identified in SelectionDAGISel.)
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_CODEGEN_COLLECTOR_H
-#define LLVM_CODEGEN_COLLECTOR_H
-
-#include "llvm/CodeGen/CollectorMetadata.h"
-#include <iosfwd>
-#include <string>
-
-namespace llvm {
-
- /// Collector describes a garbage collector's code generation requirements,
- /// and provides overridable hooks for those needs which cannot be abstractly
- /// described.
- class Collector {
- public:
- typedef std::vector<CollectorMetadata*> list_type;
- typedef list_type::iterator iterator;
-
- private:
- friend class CollectorModuleMetadata;
- const Module *M;
- std::string Name;
-
- list_type Functions;
-
- protected:
- unsigned NeededSafePoints; //< Bitmask of required safe points.
- bool CustomReadBarriers; //< Default is to insert loads.
- bool CustomWriteBarriers; //< Default is to insert stores.
- bool CustomRoots; //< Default is to pass through to backend.
- bool InitRoots; //< If set, roots are nulled during lowering.
-
- public:
- Collector();
-
- virtual ~Collector();
-
-
- /// getName - The name of the collector, for debugging.
- ///
- const std::string &getName() const { return Name; }
-
- /// getModule - The module upon which the collector is operating.
- ///
- const Module &getModule() const { return *M; }
-
- /// True if this collector requires safe points of any kind. By default,
- /// none are recorded.
- bool needsSafePoints() const { return NeededSafePoints != 0; }
-
- /// True if the collector requires the given kind of safe point. By default,
- /// none are recorded.
- bool needsSafePoint(GC::PointKind Kind) const {
- return (NeededSafePoints & 1 << Kind) != 0;
- }
-
- /// By default, write barriers are replaced with simple store instructions.
- /// If true, then addPassesToCustomLowerIntrinsics must instead process
- /// them.
- bool customWriteBarrier() const { return CustomWriteBarriers; }
-
- /// By default, read barriers are replaced with simple load instructions.
- /// If true, then addPassesToCustomLowerIntrinsics must instead process
- /// them.
- bool customReadBarrier() const { return CustomReadBarriers; }
-
- /// By default, roots are left for the code generator. If Custom, then
- /// addPassesToCustomLowerIntrinsics must add passes to delete them.
- bool customRoots() const { return CustomRoots; }
-
- /// If set, gcroot intrinsics should initialize their allocas to null. This
- /// is necessary for most collectors.
- bool initializeRoots() const { return InitRoots; }
-
-
- /// beginAssembly/finishAssembly - Emit module metadata as assembly code.
- virtual void beginAssembly(std::ostream &OS, AsmPrinter &AP,
- const TargetAsmInfo &TAI);
- virtual void finishAssembly(std::ostream &OS, AsmPrinter &AP,
- const TargetAsmInfo &TAI);
-
- /// begin/end - Iterators for function metadata.
- ///
- iterator begin() { return Functions.begin(); }
- iterator end() { return Functions.end(); }
-
- /// insertFunctionMetadata - Creates metadata for a function.
- ///
- CollectorMetadata *insertFunctionMetadata(const Function &F);
-
- /// initializeCustomLowering/performCustomLowering - If any of the actions
- /// are set to custom, performCustomLowering must be overriden to create a
- /// transform to lower those actions to LLVM IR. initializeCustomLowering
- /// is optional to override. These are the only Collector methods through
- /// which the LLVM IR can be modified.
- virtual bool initializeCustomLowering(Module &F);
- virtual bool performCustomLowering(Function &F);
- };
-
-}
-
-#endif
diff --git a/release_23/include/llvm/CodeGen/CollectorMetadata.h b/release_23/include/llvm/CodeGen/CollectorMetadata.h
deleted file mode 100644
index 1fb3b502eeb7..000000000000
--- a/release_23/include/llvm/CodeGen/CollectorMetadata.h
+++ /dev/null
@@ -1,194 +0,0 @@
-//===-- CollectorMetadata.h - Garbage collector metadata ------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file declares the CollectorMetadata and CollectorModuleMetadata classes,
-// which are used as a communication channel from the target code generator
-// to the target garbage collectors. This interface allows code generators and
-// garbage collectors to be developed independently.
-//
-// The CollectorMetadata class records the data necessary to build a type
-// accurate stack map. Roots are specified in the LLVM IR using the llvm.gcroot
-// intrinsic, which the code generator understands. The code generator records
-// the stack offset for each GC root. Safe points are generated by the code
-// generator according to the collector's declared needs (generally at function
-// calls).
-//
-// Safe points and roots are sufficient to build type-accurate stack maps. As a
-// refinement, liveness analysis calculates the set of live roots at each safe
-// point. Liveness analysis is not presently performed, so all roots are assumed
-// live.
-//
-// CollectorModuleMetadata simply collects CollectorMetadata structures for each
-// Function as it is compiled. This is necessary for collectors which must emit
-// a stack map for the entire compilation unit. CollectorMetadata outlives the
-// MachineFunction from which it is derived, so must not refer to any code
-// generator data structures.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_CODEGEN_COLLECTORMETADATA_H
-#define LLVM_CODEGEN_COLLECTORMETADATA_H
-
-#include "llvm/Pass.h"
-#include "llvm/ADT/DenseMap.h"
-#include "llvm/ADT/StringMap.h"
-
-namespace llvm {
-
- class AsmPrinter;
- class Collector;
- class Constant;
- class TargetAsmInfo;
-
-
- namespace GC {
- /// PointKind - The type of a collector-safe point.
- ///
- enum PointKind {
- Loop, //< Instr is a loop (backwards branch).
- Return, //< Instr is a return instruction.
- PreCall, //< Instr is a call instruction.
- PostCall //< Instr is the return address of a call.
- };
- }
-
- /// GCPoint - Metadata for a collector-safe point in machine code.
- ///
- struct GCPoint {
- GC::PointKind Kind; //< The kind of the safe point.
- unsigned Num; //< Usually a label.
-
- GCPoint(GC::PointKind K, unsigned N) : Kind(K), Num(N) {}
- };
-
- /// GCRoot - Metadata for a pointer to an object managed by the garbage
- /// collector.
- struct GCRoot {
- int Num; //< Usually a frame index.
- int StackOffset; //< Offset from the stack pointer.
- Constant *Metadata; //< Metadata straight from the call to llvm.gcroot.
-
- GCRoot(int N, Constant *MD) : Num(N), StackOffset(-1), Metadata(MD) {}
- };
-
-
- /// CollectorMetadata - Garbage collection metadata for a function.
- ///
- class CollectorMetadata {
- public:
- typedef std::vector<GCPoint>::iterator iterator;
- typedef std::vector<GCRoot>::iterator roots_iterator;
- typedef std::vector<GCRoot>::const_iterator live_iterator;
-
- private:
- const Function &F;
- Collector &C;
- uint64_t FrameSize;
- std::vector<GCRoot> Roots;
- std::vector<GCPoint> SafePoints;
-
- // FIXME: Liveness. A 2D BitVector, perhaps?
- //
- // BitVector Liveness;
- //
- // bool islive(int point, int root) =
- // Liveness[point * SafePoints.size() + root]
- //
- // The bit vector is the more compact representation where >3.2% of roots
- // are live per safe point (1.5% on 64-bit hosts).
-
- public:
- CollectorMetadata(const Function &F, Collector &C);
- ~CollectorMetadata();
-
- /// getFunction - Return the function to which this metadata applies.
- ///
- const Function &getFunction() const { return F; }
-
- /// getCollector - Return the collector for the function.
- ///
- Collector &getCollector() { return C; }
-
- /// addStackRoot - Registers a root that lives on the stack. Num is the
- /// stack object ID for the alloca (if the code generator is using
- /// MachineFrameInfo).
- void addStackRoot(int Num, Constant *Metadata) {
- Roots.push_back(GCRoot(Num, Metadata));
- }
-
- /// addSafePoint - Notes the existence of a safe point. Num is the ID of the
- /// label just prior to the safe point (if the code generator is using
- /// MachineModuleInfo).
- void addSafePoint(GC::PointKind Kind, unsigned Num) {
- SafePoints.push_back(GCPoint(Kind, Num));
- }
-
- /// getFrameSize/setFrameSize - Records the function's frame size.
- ///
- uint64_t getFrameSize() const { return FrameSize; }
- void setFrameSize(uint64_t S) { FrameSize = S; }
-
- /// begin/end - Iterators for safe points.
- ///
- iterator begin() { return SafePoints.begin(); }
- iterator end() { return SafePoints.end(); }
- size_t size() const { return SafePoints.size(); }
-
- /// roots_begin/roots_end - Iterators for all roots in the function.
- ///
- roots_iterator roots_begin() { return Roots.begin(); }
- roots_iterator roots_end () { return Roots.end(); }
- size_t roots_size() const { return Roots.size(); }
-
- /// live_begin/live_end - Iterators for live roots at a given safe point.
- ///
- live_iterator live_begin(const iterator &p) { return roots_begin(); }
- live_iterator live_end (const iterator &p) { return roots_end(); }
- size_t live_size(const iterator &p) const { return roots_size(); }
- };
-
-
- /// CollectorModuleMetadata - Garbage collection metadata for a whole module.
- ///
- class CollectorModuleMetadata : public ImmutablePass {
- typedef StringMap<Collector*> collector_map_type;
- typedef std::vector<Collector*> list_type;
- typedef DenseMap<const Function*,CollectorMetadata*> function_map_type;
-
- collector_map_type NameMap;
- list_type Collectors;
- function_map_type Map;
-
- Collector *getOrCreateCollector(const Module *M, const std::string &Name);
-
- public:
- typedef list_type::const_iterator iterator;
-
- static char ID;
-
- CollectorModuleMetadata();
- ~CollectorModuleMetadata();
-
- /// clear - Used to delete module metadata. The metadata deleter pass calls
- /// this.
- void clear();
-
- /// begin/end - Iterators for collectors.
- ///
- iterator begin() const { return Collectors.begin(); }
- iterator end() const { return Collectors.end(); }
-
- /// get - Look up function metadata.
- ///
- CollectorMetadata &get(const Function &F);
- };
-
-}
-
-#endif
diff --git a/release_23/include/llvm/CodeGen/Collectors.h b/release_23/include/llvm/CodeGen/Collectors.h
deleted file mode 100644
index 0d9e4516106a..000000000000
--- a/release_23/include/llvm/CodeGen/Collectors.h
+++ /dev/null
@@ -1,39 +0,0 @@
-//===-- Collectors.h - Garbage collector registry -------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file declares the CollectorRegistry class, which is used to discover
-// pluggable garbage collectors.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_CODEGEN_COLLECTORS_H
-#define LLVM_CODEGEN_COLLECTORS_H
-
-#include "llvm/Support/Registry.h"
-
-namespace llvm {
-
- class Collector;
-
- /// The collector registry uses all the defaults from Registry.
- ///
- typedef Registry<Collector> CollectorRegistry;
-
- /// FIXME: Collector instances are not useful on their own. These no longer
- /// serve any purpose except to link in the plugins.
-
- /// Creates an ocaml-compatible garbage collector.
- Collector *createOcamlCollector();
-
- /// Creates a shadow stack garbage collector. This collector requires no code
- /// generator support.
- Collector *createShadowStackCollector();
-}
-
-#endif
diff --git a/release_23/include/llvm/CodeGen/DwarfWriter.h b/release_23/include/llvm/CodeGen/DwarfWriter.h
deleted file mode 100644
index a0cfec766a4f..000000000000
--- a/release_23/include/llvm/CodeGen/DwarfWriter.h
+++ /dev/null
@@ -1,82 +0,0 @@
-//===-- llvm/CodeGen/DwarfWriter.h - Dwarf Framework ------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains support for writing Dwarf debug and exception info into
-// asm files. For Details on the Dwarf 3 specfication see DWARF Debugging
-// Information Format V.3 reference manual http://dwarf.freestandards.org ,
-//
-// The role of the Dwarf Writer class is to extract information from the
-// MachineModuleInfo object, organize it in Dwarf form and then emit it into asm
-// the current asm file using data and high level Dwarf directives.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_CODEGEN_DWARFWRITER_H
-#define LLVM_CODEGEN_DWARFWRITER_H
-
-#include <iosfwd>
-
-namespace llvm {
-
-class AsmPrinter;
-class DwarfDebug;
-class DwarfException;
-class MachineModuleInfo;
-class MachineFunction;
-class Module;
-class TargetAsmInfo;
-
-//===----------------------------------------------------------------------===//
-// DwarfWriter - Emits Dwarf debug and exception handling directives.
-//
-
-class DwarfWriter {
-private:
- /// DD - Provides the DwarfWriter debug implementation.
- ///
- DwarfDebug *DD;
-
- /// DE - Provides the DwarfWriter exception implementation.
- ///
- DwarfException *DE;
-
-public:
-
- DwarfWriter(std::ostream &OS, AsmPrinter *A, const TargetAsmInfo *T);
- virtual ~DwarfWriter();
-
- /// SetModuleInfo - Set machine module info when it's known that pass manager
- /// has created it. Set by the target AsmPrinter.
- void SetModuleInfo(MachineModuleInfo *MMI);
-
- //===--------------------------------------------------------------------===//
- // Main entry points.
- //
-
- /// BeginModule - Emit all Dwarf sections that should come prior to the
- /// content.
- void BeginModule(Module *M);
-
- /// EndModule - Emit all Dwarf sections that should come after the content.
- ///
- void EndModule();
-
- /// BeginFunction - Gather pre-function debug information. Assumes being
- /// emitted immediately after the function entry point.
- void BeginFunction(MachineFunction *MF);
-
- /// EndFunction - Gather and emit post-function debug information.
- ///
- void EndFunction();
-};
-
-
-} // end llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/CodeGen/ELFRelocation.h b/release_23/include/llvm/CodeGen/ELFRelocation.h
deleted file mode 100644
index e584e3eb4ef8..000000000000
--- a/release_23/include/llvm/CodeGen/ELFRelocation.h
+++ /dev/null
@@ -1,52 +0,0 @@
-//=== ELFRelocation.h - ELF Relocation Info ---------------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines the ELFRelocation class.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_CODEGEN_ELF_RELOCATION_H
-#define LLVM_CODEGEN_ELF_RELOCATION_H
-
-#include "llvm/Support/DataTypes.h"
-
-namespace llvm {
-
- /// ELFRelocation - This class contains all the information necessary to
- /// to generate any 32-bit or 64-bit ELF relocation entry.
- class ELFRelocation {
- uint64_t r_offset; // offset in the section of the object this applies to
- uint32_t r_symidx; // symbol table index of the symbol to use
- uint32_t r_type; // machine specific relocation type
- int64_t r_add; // explicit relocation addend
- bool r_rela; // if true then the addend is part of the entry
- // otherwise the addend is at the location specified
- // by r_offset
- public:
-
- uint64_t getInfo(bool is64Bit = false) const {
- if (is64Bit)
- return ((uint64_t)r_symidx << 32) + ((uint64_t)r_type & 0xFFFFFFFFL);
- else
- return (r_symidx << 8) + (r_type & 0xFFL);
- }
-
- uint64_t getOffset() const { return r_offset; }
- uint64_t getAddress() const { return r_add; }
-
- ELFRelocation(uint64_t off, uint32_t sym, uint32_t type,
- bool rela = true, int64_t addend = 0) :
- r_offset(off), r_symidx(sym), r_type(type),
- r_add(addend), r_rela(rela) {}
- };
-
-} // end llvm namespace
-
-#endif // LLVM_CODEGEN_ELF_RELOCATION_H
-
diff --git a/release_23/include/llvm/CodeGen/FileWriters.h b/release_23/include/llvm/CodeGen/FileWriters.h
deleted file mode 100644
index ac66b9d0bf55..000000000000
--- a/release_23/include/llvm/CodeGen/FileWriters.h
+++ /dev/null
@@ -1,32 +0,0 @@
-//===-- FileWriters.h - File Writers Creation Functions ---------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// Functions to add the various file writer passes.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_CODEGEN_FILEWRITERS_H
-#define LLVM_CODEGEN_FILEWRITERS_H
-
-#include <iosfwd>
-
-namespace llvm {
-
- class PassManagerBase;
- class MachineCodeEmitter;
- class TargetMachine;
-
- MachineCodeEmitter *AddELFWriter(PassManagerBase &FPM, std::ostream &O,
- TargetMachine &TM);
- MachineCodeEmitter *AddMachOWriter(PassManagerBase &FPM, std::ostream &O,
- TargetMachine &TM);
-
-} // end llvm namespace
-
-#endif // LLVM_CODEGEN_FILEWRITERS_H
diff --git a/release_23/include/llvm/CodeGen/IntrinsicLowering.h b/release_23/include/llvm/CodeGen/IntrinsicLowering.h
deleted file mode 100644
index 6628329895f6..000000000000
--- a/release_23/include/llvm/CodeGen/IntrinsicLowering.h
+++ /dev/null
@@ -1,50 +0,0 @@
-//===-- IntrinsicLowering.h - Intrinsic Function Lowering -------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines the IntrinsicLowering interface. This interface allows
-// addition of domain-specific or front-end specific intrinsics to LLVM without
-// having to modify all of the C backend or interpreter.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_CODEGEN_INTRINSICLOWERING_H
-#define LLVM_CODEGEN_INTRINSICLOWERING_H
-
-#include "llvm/Intrinsics.h"
-
-namespace llvm {
- class CallInst;
- class Module;
- class TargetData;
-
- class IntrinsicLowering {
- const TargetData& TD;
- public:
- explicit IntrinsicLowering(const TargetData &td) : TD(td) {}
-
- /// AddPrototypes - This method, if called, causes all of the prototypes
- /// that might be needed by an intrinsic lowering implementation to be
- /// inserted into the module specified.
- void AddPrototypes(Module &M);
-
- /// LowerIntrinsicCall - This method replaces a call with the LLVM function
- /// which should be used to implement the specified intrinsic function call.
- /// If an intrinsic function must be implemented by the code generator
- /// (such as va_start), this function should print a message and abort.
- ///
- /// Otherwise, if an intrinsic function call can be lowered, the code to
- /// implement it (often a call to a non-intrinsic function) is inserted
- /// _after_ the call instruction and the call is deleted. The caller must
- /// be capable of handling this kind of change.
- ///
- void LowerIntrinsicCall(CallInst *CI);
- };
-}
-
-#endif
diff --git a/release_23/include/llvm/CodeGen/LinkAllCodegenComponents.h b/release_23/include/llvm/CodeGen/LinkAllCodegenComponents.h
deleted file mode 100644
index ac5803559390..000000000000
--- a/release_23/include/llvm/CodeGen/LinkAllCodegenComponents.h
+++ /dev/null
@@ -1,51 +0,0 @@
-//===- llvm/Codegen/LinkAllCodegenComponents.h ------------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This header file pulls in all codegen related passes for tools like lli and
-// llc that need this functionality.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_CODEGEN_LINKALLCODEGENCOMPONENTS_H
-#define LLVM_CODEGEN_LINKALLCODEGENCOMPONENTS_H
-
-#include "llvm/CodeGen/Passes.h"
-#include "llvm/CodeGen/ScheduleDAG.h"
-#include "llvm/CodeGen/Collectors.h"
-
-namespace {
- struct ForceCodegenLinking {
- ForceCodegenLinking() {
- // We must reference the passes in such a way that compilers will not
- // delete it all as dead code, even with whole program optimization,
- // yet is effectively a NO-OP. As the compiler isn't smart enough
- // to know that getenv() never returns -1, this will do the job.
- if (std::getenv("bar") != (char*) -1)
- return;
-
- (void) llvm::createSimpleRegisterAllocator();
- (void) llvm::createLocalRegisterAllocator();
- (void) llvm::createBigBlockRegisterAllocator();
- (void) llvm::createLinearScanRegisterAllocator();
-
- (void) llvm::createSimpleRegisterCoalescer();
-
- (void) llvm::createOcamlCollector();
- (void) llvm::createShadowStackCollector();
-
- (void) llvm::createBURRListDAGScheduler(NULL, NULL, NULL);
- (void) llvm::createTDRRListDAGScheduler(NULL, NULL, NULL);
- (void) llvm::createTDListDAGScheduler(NULL, NULL, NULL);
- (void) llvm::createDefaultScheduler(NULL, NULL, NULL);
-
- }
- } ForceCodegenLinking; // Force link by creating a global definition.
-}
-
-#endif
diff --git a/release_23/include/llvm/CodeGen/LiveInterval.h b/release_23/include/llvm/CodeGen/LiveInterval.h
deleted file mode 100644
index 31d6947a76c8..000000000000
--- a/release_23/include/llvm/CodeGen/LiveInterval.h
+++ /dev/null
@@ -1,383 +0,0 @@
-//===-- llvm/CodeGen/LiveInterval.h - Interval representation ---*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the LiveRange and LiveInterval classes. Given some
-// numbering of each the machine instructions an interval [i, j) is said to be a
-// live interval for register v if there is no instruction with number j' > j
-// such that v is live at j' and there is no instruction with number i' < i such
-// that v is live at i'. In this implementation intervals can have holes,
-// i.e. an interval might look like [1,20), [50,65), [1000,1001). Each
-// individual range is represented as an instance of LiveRange, and the whole
-// interval is represented as an instance of LiveInterval.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_CODEGEN_LIVEINTERVAL_H
-#define LLVM_CODEGEN_LIVEINTERVAL_H
-
-#include "llvm/ADT/SmallVector.h"
-#include "llvm/Support/Allocator.h"
-#include "llvm/Support/Streams.h"
-#include <iosfwd>
-#include <vector>
-#include <cassert>
-
-namespace llvm {
- class MachineInstr;
- class TargetRegisterInfo;
- struct LiveInterval;
-
- /// VNInfo - If the value number definition is undefined (e.g. phi
- /// merge point), it contains ~0u,x. If the value number is not in use, it
- /// contains ~1u,x to indicate that the value # is not used.
- /// def - Instruction # of the definition.
- /// copy - Copy iff val# is defined by a copy; zero otherwise.
- /// hasPHIKill - One or more of the kills are PHI nodes.
- /// kills - Instruction # of the kills.
- struct VNInfo {
- unsigned id;
- unsigned def;
- MachineInstr *copy;
- bool hasPHIKill;
- SmallVector<unsigned, 4> kills;
- VNInfo() : id(~1U), def(~1U), copy(0), hasPHIKill(false) {}
- VNInfo(unsigned i, unsigned d, MachineInstr *c)
- : id(i), def(d), copy(c), hasPHIKill(false) {}
- };
-
- /// LiveRange structure - This represents a simple register range in the
- /// program, with an inclusive start point and an exclusive end point.
- /// These ranges are rendered as [start,end).
- struct LiveRange {
- unsigned start; // Start point of the interval (inclusive)
- unsigned end; // End point of the interval (exclusive)
- VNInfo *valno; // identifier for the value contained in this interval.
-
- LiveRange(unsigned S, unsigned E, VNInfo *V) : start(S), end(E), valno(V) {
- assert(S < E && "Cannot create empty or backwards range");
- }
-
- /// contains - Return true if the index is covered by this range.
- ///
- bool contains(unsigned I) const {
- return start <= I && I < end;
- }
-
- bool operator<(const LiveRange &LR) const {
- return start < LR.start || (start == LR.start && end < LR.end);
- }
- bool operator==(const LiveRange &LR) const {
- return start == LR.start && end == LR.end;
- }
-
- void dump() const;
- void print(std::ostream &os) const;
- void print(std::ostream *os) const { if (os) print(*os); }
-
- private:
- LiveRange(); // DO NOT IMPLEMENT
- };
-
- std::ostream& operator<<(std::ostream& os, const LiveRange &LR);
-
-
- inline bool operator<(unsigned V, const LiveRange &LR) {
- return V < LR.start;
- }
-
- inline bool operator<(const LiveRange &LR, unsigned V) {
- return LR.start < V;
- }
-
- /// LiveInterval - This class represents some number of live ranges for a
- /// register or value. This class also contains a bit of register allocator
- /// state.
- struct LiveInterval {
- typedef SmallVector<LiveRange,4> Ranges;
- typedef SmallVector<VNInfo*,4> VNInfoList;
-
- unsigned reg; // the register of this interval
- unsigned preference; // preferred register to allocate for this interval
- float weight; // weight of this interval
- Ranges ranges; // the ranges in which this register is live
- VNInfoList valnos; // value#'s
-
- public:
- LiveInterval(unsigned Reg, float Weight)
- : reg(Reg), preference(0), weight(Weight) {
- }
-
- typedef Ranges::iterator iterator;
- iterator begin() { return ranges.begin(); }
- iterator end() { return ranges.end(); }
-
- typedef Ranges::const_iterator const_iterator;
- const_iterator begin() const { return ranges.begin(); }
- const_iterator end() const { return ranges.end(); }
-
- typedef VNInfoList::iterator vni_iterator;
- vni_iterator vni_begin() { return valnos.begin(); }
- vni_iterator vni_end() { return valnos.end(); }
-
- typedef VNInfoList::const_iterator const_vni_iterator;
- const_vni_iterator vni_begin() const { return valnos.begin(); }
- const_vni_iterator vni_end() const { return valnos.end(); }
-
- /// advanceTo - Advance the specified iterator to point to the LiveRange
- /// containing the specified position, or end() if the position is past the
- /// end of the interval. If no LiveRange contains this position, but the
- /// position is in a hole, this method returns an iterator pointing the the
- /// LiveRange immediately after the hole.
- iterator advanceTo(iterator I, unsigned Pos) {
- if (Pos >= endNumber())
- return end();
- while (I->end <= Pos) ++I;
- return I;
- }
-
- bool containsOneValue() const { return valnos.size() == 1; }
-
- unsigned getNumValNums() const { return (unsigned)valnos.size(); }
-
- /// getValNumInfo - Returns pointer to the specified val#.
- ///
- inline VNInfo *getValNumInfo(unsigned ValNo) {
- return valnos[ValNo];
- }
- inline const VNInfo *getValNumInfo(unsigned ValNo) const {
- return valnos[ValNo];
- }
-
- /// copyValNumInfo - Copy the value number info for one value number to
- /// another.
- void copyValNumInfo(VNInfo *DstValNo, const VNInfo *SrcValNo) {
- DstValNo->def = SrcValNo->def;
- DstValNo->copy = SrcValNo->copy;
- DstValNo->hasPHIKill = SrcValNo->hasPHIKill;
- DstValNo->kills = SrcValNo->kills;
- }
-
- /// getNextValue - Create a new value number and return it. MIIdx specifies
- /// the instruction that defines the value number.
- VNInfo *getNextValue(unsigned MIIdx, MachineInstr *CopyMI,
- BumpPtrAllocator &VNInfoAllocator) {
-#ifdef __GNUC__
- unsigned Alignment = (unsigned)__alignof__(VNInfo);
-#else
- // FIXME: ugly.
- unsigned Alignment = 8;
-#endif
- VNInfo *VNI =
- static_cast<VNInfo*>(VNInfoAllocator.Allocate((unsigned)sizeof(VNInfo),
- Alignment));
- new (VNI) VNInfo((unsigned)valnos.size(), MIIdx, CopyMI);
- valnos.push_back(VNI);
- return VNI;
- }
-
- /// addKillForValNum - Add a kill instruction index to the specified value
- /// number.
- static void addKill(VNInfo *VNI, unsigned KillIdx) {
- SmallVector<unsigned, 4> &kills = VNI->kills;
- if (kills.empty()) {
- kills.push_back(KillIdx);
- } else {
- SmallVector<unsigned, 4>::iterator
- I = std::lower_bound(kills.begin(), kills.end(), KillIdx);
- kills.insert(I, KillIdx);
- }
- }
-
- /// addKills - Add a number of kills into the VNInfo kill vector. If this
- /// interval is live at a kill point, then the kill is not added.
- void addKills(VNInfo *VNI, const SmallVector<unsigned, 4> &kills) {
- for (unsigned i = 0, e = static_cast<unsigned>(kills.size());
- i != e; ++i) {
- unsigned KillIdx = kills[i];
- if (!liveBeforeAndAt(KillIdx)) {
- SmallVector<unsigned, 4>::iterator
- I = std::lower_bound(VNI->kills.begin(), VNI->kills.end(), KillIdx);
- VNI->kills.insert(I, KillIdx);
- }
- }
- }
-
- /// removeKill - Remove the specified kill from the list of kills of
- /// the specified val#.
- static bool removeKill(VNInfo *VNI, unsigned KillIdx) {
- SmallVector<unsigned, 4> &kills = VNI->kills;
- SmallVector<unsigned, 4>::iterator
- I = std::lower_bound(kills.begin(), kills.end(), KillIdx);
- if (I != kills.end() && *I == KillIdx) {
- kills.erase(I);
- return true;
- }
- return false;
- }
-
- /// removeKills - Remove all the kills in specified range
- /// [Start, End] of the specified val#.
- void removeKills(VNInfo *VNI, unsigned Start, unsigned End) {
- SmallVector<unsigned, 4> &kills = VNI->kills;
- SmallVector<unsigned, 4>::iterator
- I = std::lower_bound(kills.begin(), kills.end(), Start);
- SmallVector<unsigned, 4>::iterator
- E = std::upper_bound(kills.begin(), kills.end(), End);
- kills.erase(I, E);
- }
-
- /// isKill - Return true if the specified index is a kill of the
- /// specified val#.
- bool isKill(const VNInfo *VNI, unsigned KillIdx) const {
- const SmallVector<unsigned, 4> &kills = VNI->kills;
- SmallVector<unsigned, 4>::const_iterator
- I = std::lower_bound(kills.begin(), kills.end(), KillIdx);
- return I != kills.end() && *I == KillIdx;
- }
-
- /// MergeValueNumberInto - This method is called when two value nubmers
- /// are found to be equivalent. This eliminates V1, replacing all
- /// LiveRanges with the V1 value number with the V2 value number. This can
- /// cause merging of V1/V2 values numbers and compaction of the value space.
- void MergeValueNumberInto(VNInfo *V1, VNInfo *V2);
-
- /// MergeInClobberRanges - For any live ranges that are not defined in the
- /// current interval, but are defined in the Clobbers interval, mark them
- /// used with an unknown definition value. Caller must pass in reference to
- /// VNInfoAllocator since it will create a new val#.
- void MergeInClobberRanges(const LiveInterval &Clobbers,
- BumpPtrAllocator &VNInfoAllocator);
-
- /// MergeValueInAsValue - Merge all of the live ranges of a specific val#
- /// in RHS into this live interval as the specified value number.
- /// The LiveRanges in RHS are allowed to overlap with LiveRanges in the
- /// current interval, it will replace the value numbers of the overlaped
- /// live ranges with the specified value number.
- void MergeRangesInAsValue(const LiveInterval &RHS, VNInfo *LHSValNo);
-
- /// MergeValueInAsValue - Merge all of the live ranges of a specific val#
- /// in RHS into this live interval as the specified value number.
- /// The LiveRanges in RHS are allowed to overlap with LiveRanges in the
- /// current interval, but only if the overlapping LiveRanges have the
- /// specified value number.
- void MergeValueInAsValue(const LiveInterval &RHS,
- const VNInfo *RHSValNo, VNInfo *LHSValNo);
-
- /// Copy - Copy the specified live interval. This copies all the fields
- /// except for the register of the interval.
- void Copy(const LiveInterval &RHS, BumpPtrAllocator &VNInfoAllocator);
-
- bool empty() const { return ranges.empty(); }
-
- /// beginNumber - Return the lowest numbered slot covered by interval.
- unsigned beginNumber() const {
- if (empty())
- return 0;
- return ranges.front().start;
- }
-
- /// endNumber - return the maximum point of the interval of the whole,
- /// exclusive.
- unsigned endNumber() const {
- if (empty())
- return 0;
- return ranges.back().end;
- }
-
- bool expiredAt(unsigned index) const {
- return index >= endNumber();
- }
-
- bool liveAt(unsigned index) const;
-
- // liveBeforeAndAt - Check if the interval is live at the index and the
- // index just before it. If index is liveAt, check if it starts a new live
- // range.If it does, then check if the previous live range ends at index-1.
- bool liveBeforeAndAt(unsigned index) const;
-
- /// getLiveRangeContaining - Return the live range that contains the
- /// specified index, or null if there is none.
- const LiveRange *getLiveRangeContaining(unsigned Idx) const {
- const_iterator I = FindLiveRangeContaining(Idx);
- return I == end() ? 0 : &*I;
- }
-
- /// FindLiveRangeContaining - Return an iterator to the live range that
- /// contains the specified index, or end() if there is none.
- const_iterator FindLiveRangeContaining(unsigned Idx) const;
-
- /// FindLiveRangeContaining - Return an iterator to the live range that
- /// contains the specified index, or end() if there is none.
- iterator FindLiveRangeContaining(unsigned Idx);
-
- /// overlaps - Return true if the intersection of the two live intervals is
- /// not empty.
- bool overlaps(const LiveInterval& other) const {
- return overlapsFrom(other, other.begin());
- }
-
- /// overlapsFrom - Return true if the intersection of the two live intervals
- /// is not empty. The specified iterator is a hint that we can begin
- /// scanning the Other interval starting at I.
- bool overlapsFrom(const LiveInterval& other, const_iterator I) const;
-
- /// addRange - Add the specified LiveRange to this interval, merging
- /// intervals as appropriate. This returns an iterator to the inserted live
- /// range (which may have grown since it was inserted.
- void addRange(LiveRange LR) {
- addRangeFrom(LR, ranges.begin());
- }
-
- /// join - Join two live intervals (this, and other) together. This applies
- /// mappings to the value numbers in the LHS/RHS intervals as specified. If
- /// the intervals are not joinable, this aborts.
- void join(LiveInterval &Other, const int *ValNoAssignments,
- const int *RHSValNoAssignments,
- SmallVector<VNInfo*, 16> &NewVNInfo);
-
- /// removeRange - Remove the specified range from this interval. Note that
- /// the range must already be in this interval in its entirety.
- void removeRange(unsigned Start, unsigned End, bool RemoveDeadValNo = false);
-
- void removeRange(LiveRange LR, bool RemoveDeadValNo = false) {
- removeRange(LR.start, LR.end, RemoveDeadValNo);
- }
-
- /// removeValNo - Remove all the ranges defined by the specified value#.
- /// Also remove the value# from value# list.
- void removeValNo(VNInfo *ValNo);
-
- /// getSize - Returns the sum of sizes of all the LiveRange's.
- ///
- unsigned getSize() const;
-
- bool operator<(const LiveInterval& other) const {
- return beginNumber() < other.beginNumber();
- }
-
- void print(std::ostream &OS, const TargetRegisterInfo *TRI = 0) const;
- void print(std::ostream *OS, const TargetRegisterInfo *TRI = 0) const {
- if (OS) print(*OS, TRI);
- }
- void dump() const;
-
- private:
- Ranges::iterator addRangeFrom(LiveRange LR, Ranges::iterator From);
- void extendIntervalEndTo(Ranges::iterator I, unsigned NewEnd);
- Ranges::iterator extendIntervalStartTo(Ranges::iterator I, unsigned NewStr);
- LiveInterval& operator=(const LiveInterval& rhs); // DO NOT IMPLEMENT
- };
-
- inline std::ostream &operator<<(std::ostream &OS, const LiveInterval &LI) {
- LI.print(OS);
- return OS;
- }
-}
-
-#endif
diff --git a/release_23/include/llvm/CodeGen/LiveIntervalAnalysis.h b/release_23/include/llvm/CodeGen/LiveIntervalAnalysis.h
deleted file mode 100644
index c6b5cfaebc44..000000000000
--- a/release_23/include/llvm/CodeGen/LiveIntervalAnalysis.h
+++ /dev/null
@@ -1,440 +0,0 @@
-//===-- LiveIntervalAnalysis.h - Live Interval Analysis ---------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the LiveInterval analysis pass. Given some numbering of
-// each the machine instructions (in this implemention depth-first order) an
-// interval [i, j) is said to be a live interval for register v if there is no
-// instruction with number j' > j such that v is live at j' and there is no
-// instruction with number i' < i such that v is live at i'. In this
-// implementation intervals can have holes, i.e. an interval might look like
-// [1,20), [50,65), [1000,1001).
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_CODEGEN_LIVEINTERVAL_ANALYSIS_H
-#define LLVM_CODEGEN_LIVEINTERVAL_ANALYSIS_H
-
-#include "llvm/CodeGen/MachineFunctionPass.h"
-#include "llvm/CodeGen/LiveInterval.h"
-#include "llvm/ADT/BitVector.h"
-#include "llvm/ADT/DenseMap.h"
-#include "llvm/ADT/SmallPtrSet.h"
-#include "llvm/ADT/SmallVector.h"
-#include "llvm/Support/Allocator.h"
-#include <cmath>
-#include <map>
-
-namespace llvm {
-
- class LiveVariables;
- class MachineLoopInfo;
- class TargetRegisterInfo;
- class MachineRegisterInfo;
- class TargetInstrInfo;
- class TargetRegisterClass;
- class VirtRegMap;
- typedef std::pair<unsigned, MachineBasicBlock*> IdxMBBPair;
-
- inline bool operator<(unsigned V, const IdxMBBPair &IM) {
- return V < IM.first;
- }
-
- inline bool operator<(const IdxMBBPair &IM, unsigned V) {
- return IM.first < V;
- }
-
- struct Idx2MBBCompare {
- bool operator()(const IdxMBBPair &LHS, const IdxMBBPair &RHS) const {
- return LHS.first < RHS.first;
- }
- };
-
- class LiveIntervals : public MachineFunctionPass {
- MachineFunction* mf_;
- MachineRegisterInfo* mri_;
- const TargetMachine* tm_;
- const TargetRegisterInfo* tri_;
- const TargetInstrInfo* tii_;
- LiveVariables* lv_;
-
- /// Special pool allocator for VNInfo's (LiveInterval val#).
- ///
- BumpPtrAllocator VNInfoAllocator;
-
- /// MBB2IdxMap - The indexes of the first and last instructions in the
- /// specified basic block.
- std::vector<std::pair<unsigned, unsigned> > MBB2IdxMap;
-
- /// Idx2MBBMap - Sorted list of pairs of index of first instruction
- /// and MBB id.
- std::vector<IdxMBBPair> Idx2MBBMap;
-
- typedef std::map<MachineInstr*, unsigned> Mi2IndexMap;
- Mi2IndexMap mi2iMap_;
-
- typedef std::vector<MachineInstr*> Index2MiMap;
- Index2MiMap i2miMap_;
-
- typedef std::map<unsigned, LiveInterval> Reg2IntervalMap;
- Reg2IntervalMap r2iMap_;
-
- BitVector allocatableRegs_;
-
- std::vector<MachineInstr*> ClonedMIs;
-
- public:
- static char ID; // Pass identification, replacement for typeid
- LiveIntervals() : MachineFunctionPass((intptr_t)&ID) {}
-
- struct InstrSlots {
- enum {
- LOAD = 0,
- USE = 1,
- DEF = 2,
- STORE = 3,
- NUM = 4
- };
- };
-
- static unsigned getBaseIndex(unsigned index) {
- return index - (index % InstrSlots::NUM);
- }
- static unsigned getBoundaryIndex(unsigned index) {
- return getBaseIndex(index + InstrSlots::NUM - 1);
- }
- static unsigned getLoadIndex(unsigned index) {
- return getBaseIndex(index) + InstrSlots::LOAD;
- }
- static unsigned getUseIndex(unsigned index) {
- return getBaseIndex(index) + InstrSlots::USE;
- }
- static unsigned getDefIndex(unsigned index) {
- return getBaseIndex(index) + InstrSlots::DEF;
- }
- static unsigned getStoreIndex(unsigned index) {
- return getBaseIndex(index) + InstrSlots::STORE;
- }
-
- static float getSpillWeight(bool isDef, bool isUse, unsigned loopDepth) {
- return (isDef + isUse) * powf(10.0F, (float)loopDepth);
- }
-
- typedef Reg2IntervalMap::iterator iterator;
- typedef Reg2IntervalMap::const_iterator const_iterator;
- const_iterator begin() const { return r2iMap_.begin(); }
- const_iterator end() const { return r2iMap_.end(); }
- iterator begin() { return r2iMap_.begin(); }
- iterator end() { return r2iMap_.end(); }
- unsigned getNumIntervals() const { return (unsigned)r2iMap_.size(); }
-
- LiveInterval &getInterval(unsigned reg) {
- Reg2IntervalMap::iterator I = r2iMap_.find(reg);
- assert(I != r2iMap_.end() && "Interval does not exist for register");
- return I->second;
- }
-
- const LiveInterval &getInterval(unsigned reg) const {
- Reg2IntervalMap::const_iterator I = r2iMap_.find(reg);
- assert(I != r2iMap_.end() && "Interval does not exist for register");
- return I->second;
- }
-
- bool hasInterval(unsigned reg) const {
- return r2iMap_.count(reg);
- }
-
- /// getMBBStartIdx - Return the base index of the first instruction in the
- /// specified MachineBasicBlock.
- unsigned getMBBStartIdx(MachineBasicBlock *MBB) const {
- return getMBBStartIdx(MBB->getNumber());
- }
- unsigned getMBBStartIdx(unsigned MBBNo) const {
- assert(MBBNo < MBB2IdxMap.size() && "Invalid MBB number!");
- return MBB2IdxMap[MBBNo].first;
- }
-
- /// getMBBEndIdx - Return the store index of the last instruction in the
- /// specified MachineBasicBlock.
- unsigned getMBBEndIdx(MachineBasicBlock *MBB) const {
- return getMBBEndIdx(MBB->getNumber());
- }
- unsigned getMBBEndIdx(unsigned MBBNo) const {
- assert(MBBNo < MBB2IdxMap.size() && "Invalid MBB number!");
- return MBB2IdxMap[MBBNo].second;
- }
-
- /// getMBBFromIndex - given an index in any instruction of an
- /// MBB return a pointer the MBB
- MachineBasicBlock* getMBBFromIndex(unsigned index) const {
- std::vector<IdxMBBPair>::const_iterator I =
- std::lower_bound(Idx2MBBMap.begin(), Idx2MBBMap.end(), index);
- // Take the pair containing the index
- std::vector<IdxMBBPair>::const_iterator J =
- ((I != Idx2MBBMap.end() && I->first > index) ||
- (I == Idx2MBBMap.end() && Idx2MBBMap.size()>0)) ? (I-1): I;
-
- assert(J != Idx2MBBMap.end() && J->first < index+1 &&
- index <= getMBBEndIdx(J->second) &&
- "index does not correspond to an MBB");
- return J->second;
- }
-
- /// getInstructionIndex - returns the base index of instr
- unsigned getInstructionIndex(MachineInstr* instr) const {
- Mi2IndexMap::const_iterator it = mi2iMap_.find(instr);
- assert(it != mi2iMap_.end() && "Invalid instruction!");
- return it->second;
- }
-
- /// getInstructionFromIndex - given an index in any slot of an
- /// instruction return a pointer the instruction
- MachineInstr* getInstructionFromIndex(unsigned index) const {
- index /= InstrSlots::NUM; // convert index to vector index
- assert(index < i2miMap_.size() &&
- "index does not correspond to an instruction");
- return i2miMap_[index];
- }
-
- /// conflictsWithPhysRegDef - Returns true if the specified register
- /// is defined during the duration of the specified interval.
- bool conflictsWithPhysRegDef(const LiveInterval &li, VirtRegMap &vrm,
- unsigned reg);
-
- /// findLiveInMBBs - Given a live range, if the value of the range
- /// is live in any MBB returns true as well as the list of basic blocks
- /// where the value is live in.
- bool findLiveInMBBs(const LiveRange &LR,
- SmallVectorImpl<MachineBasicBlock*> &MBBs) const;
-
- // Interval creation
-
- LiveInterval &getOrCreateInterval(unsigned reg) {
- Reg2IntervalMap::iterator I = r2iMap_.find(reg);
- if (I == r2iMap_.end())
- I = r2iMap_.insert(I, std::make_pair(reg, createInterval(reg)));
- return I->second;
- }
-
- // Interval removal
-
- void removeInterval(unsigned Reg) {
- r2iMap_.erase(Reg);
- }
-
- /// isRemoved - returns true if the specified machine instr has been
- /// removed.
- bool isRemoved(MachineInstr* instr) const {
- return !mi2iMap_.count(instr);
- }
-
- /// RemoveMachineInstrFromMaps - This marks the specified machine instr as
- /// deleted.
- void RemoveMachineInstrFromMaps(MachineInstr *MI) {
- // remove index -> MachineInstr and
- // MachineInstr -> index mappings
- Mi2IndexMap::iterator mi2i = mi2iMap_.find(MI);
- if (mi2i != mi2iMap_.end()) {
- i2miMap_[mi2i->second/InstrSlots::NUM] = 0;
- mi2iMap_.erase(mi2i);
- }
- }
-
- /// ReplaceMachineInstrInMaps - Replacing a machine instr with a new one in
- /// maps used by register allocator.
- void ReplaceMachineInstrInMaps(MachineInstr *MI, MachineInstr *NewMI) {
- Mi2IndexMap::iterator mi2i = mi2iMap_.find(MI);
- if (mi2i == mi2iMap_.end())
- return;
- i2miMap_[mi2i->second/InstrSlots::NUM] = NewMI;
- Mi2IndexMap::iterator it = mi2iMap_.find(MI);
- assert(it != mi2iMap_.end() && "Invalid instruction!");
- unsigned Index = it->second;
- mi2iMap_.erase(it);
- mi2iMap_[NewMI] = Index;
- }
-
- BumpPtrAllocator& getVNInfoAllocator() { return VNInfoAllocator; }
-
- /// getVNInfoSourceReg - Helper function that parses the specified VNInfo
- /// copy field and returns the source register that defines it.
- unsigned getVNInfoSourceReg(const VNInfo *VNI) const;
-
- virtual void getAnalysisUsage(AnalysisUsage &AU) const;
- virtual void releaseMemory();
-
- /// runOnMachineFunction - pass entry point
- virtual bool runOnMachineFunction(MachineFunction&);
-
- /// print - Implement the dump method.
- virtual void print(std::ostream &O, const Module* = 0) const;
- void print(std::ostream *O, const Module* M = 0) const {
- if (O) print(*O, M);
- }
-
- /// addIntervalsForSpills - Create new intervals for spilled defs / uses of
- /// the given interval.
- std::vector<LiveInterval*>
- addIntervalsForSpills(const LiveInterval& i,
- const MachineLoopInfo *loopInfo, VirtRegMap& vrm);
-
- /// spillPhysRegAroundRegDefsUses - Spill the specified physical register
- /// around all defs and uses of the specified interval.
- void spillPhysRegAroundRegDefsUses(const LiveInterval &li,
- unsigned PhysReg, VirtRegMap &vrm);
-
- /// isReMaterializable - Returns true if every definition of MI of every
- /// val# of the specified interval is re-materializable. Also returns true
- /// by reference if all of the defs are load instructions.
- bool isReMaterializable(const LiveInterval &li, bool &isLoad);
-
- /// getRepresentativeReg - Find the largest super register of the specified
- /// physical register.
- unsigned getRepresentativeReg(unsigned Reg) const;
-
- /// getNumConflictsWithPhysReg - Return the number of uses and defs of the
- /// specified interval that conflicts with the specified physical register.
- unsigned getNumConflictsWithPhysReg(const LiveInterval &li,
- unsigned PhysReg) const;
-
- private:
- /// computeIntervals - Compute live intervals.
- void computeIntervals();
-
- /// handleRegisterDef - update intervals for a register def
- /// (calls handlePhysicalRegisterDef and
- /// handleVirtualRegisterDef)
- void handleRegisterDef(MachineBasicBlock *MBB,
- MachineBasicBlock::iterator MI, unsigned MIIdx,
- unsigned reg);
-
- /// handleVirtualRegisterDef - update intervals for a virtual
- /// register def
- void handleVirtualRegisterDef(MachineBasicBlock *MBB,
- MachineBasicBlock::iterator MI,
- unsigned MIIdx,
- LiveInterval& interval);
-
- /// handlePhysicalRegisterDef - update intervals for a physical register
- /// def.
- void handlePhysicalRegisterDef(MachineBasicBlock* mbb,
- MachineBasicBlock::iterator mi,
- unsigned MIIdx,
- LiveInterval &interval,
- MachineInstr *CopyMI);
-
- /// handleLiveInRegister - Create interval for a livein register.
- void handleLiveInRegister(MachineBasicBlock* mbb,
- unsigned MIIdx,
- LiveInterval &interval, bool isAlias = false);
-
- /// getReMatImplicitUse - If the remat definition MI has one (for now, we
- /// only allow one) virtual register operand, then its uses are implicitly
- /// using the register. Returns the virtual register.
- unsigned getReMatImplicitUse(const LiveInterval &li,
- MachineInstr *MI) const;
-
- /// isValNoAvailableAt - Return true if the val# of the specified interval
- /// which reaches the given instruction also reaches the specified use
- /// index.
- bool isValNoAvailableAt(const LiveInterval &li, MachineInstr *MI,
- unsigned UseIdx) const;
-
- /// isReMaterializable - Returns true if the definition MI of the specified
- /// val# of the specified interval is re-materializable. Also returns true
- /// by reference if the def is a load.
- bool isReMaterializable(const LiveInterval &li, const VNInfo *ValNo,
- MachineInstr *MI, bool &isLoad);
-
- /// tryFoldMemoryOperand - Attempts to fold either a spill / restore from
- /// slot / to reg or any rematerialized load into ith operand of specified
- /// MI. If it is successul, MI is updated with the newly created MI and
- /// returns true.
- bool tryFoldMemoryOperand(MachineInstr* &MI, VirtRegMap &vrm,
- MachineInstr *DefMI, unsigned InstrIdx,
- SmallVector<unsigned, 2> &Ops,
- bool isSS, int Slot, unsigned Reg);
-
- /// canFoldMemoryOperand - Return true if the specified load / store
- /// folding is possible.
- bool canFoldMemoryOperand(MachineInstr *MI,
- SmallVector<unsigned, 2> &Ops,
- bool ReMatLoadSS) const;
-
- /// anyKillInMBBAfterIdx - Returns true if there is a kill of the specified
- /// VNInfo that's after the specified index but is within the basic block.
- bool anyKillInMBBAfterIdx(const LiveInterval &li, const VNInfo *VNI,
- MachineBasicBlock *MBB, unsigned Idx) const;
-
- /// intervalIsInOneMBB - Returns true if the specified interval is entirely
- /// within a single basic block.
- bool intervalIsInOneMBB(const LiveInterval &li) const;
-
- /// hasAllocatableSuperReg - Return true if the specified physical register
- /// has any super register that's allocatable.
- bool hasAllocatableSuperReg(unsigned Reg) const;
-
- /// SRInfo - Spill / restore info.
- struct SRInfo {
- int index;
- unsigned vreg;
- bool canFold;
- SRInfo(int i, unsigned vr, bool f) : index(i), vreg(vr), canFold(f) {};
- };
-
- bool alsoFoldARestore(int Id, int index, unsigned vr,
- BitVector &RestoreMBBs,
- std::map<unsigned,std::vector<SRInfo> >&RestoreIdxes);
- void eraseRestoreInfo(int Id, int index, unsigned vr,
- BitVector &RestoreMBBs,
- std::map<unsigned,std::vector<SRInfo> >&RestoreIdxes);
-
- /// handleSpilledImpDefs - Remove IMPLICIT_DEF instructions which are being
- /// spilled and create empty intervals for their uses.
- void handleSpilledImpDefs(const LiveInterval &li, VirtRegMap &vrm,
- const TargetRegisterClass* rc,
- std::vector<LiveInterval*> &NewLIs);
-
- /// rewriteImplicitOps - Rewrite implicit use operands of MI (i.e. uses of
- /// interval on to-be re-materialized operands of MI) with new register.
- void rewriteImplicitOps(const LiveInterval &li,
- MachineInstr *MI, unsigned NewVReg, VirtRegMap &vrm);
-
- /// rewriteInstructionForSpills, rewriteInstructionsForSpills - Helper
- /// functions for addIntervalsForSpills to rewrite uses / defs for the given
- /// live range.
- bool rewriteInstructionForSpills(const LiveInterval &li, const VNInfo *VNI,
- bool TrySplit, unsigned index, unsigned end, MachineInstr *MI,
- MachineInstr *OrigDefMI, MachineInstr *DefMI, unsigned Slot, int LdSlot,
- bool isLoad, bool isLoadSS, bool DefIsReMat, bool CanDelete,
- VirtRegMap &vrm, const TargetRegisterClass* rc,
- SmallVector<int, 4> &ReMatIds, const MachineLoopInfo *loopInfo,
- unsigned &NewVReg, unsigned ImpUse, bool &HasDef, bool &HasUse,
- std::map<unsigned,unsigned> &MBBVRegsMap,
- std::vector<LiveInterval*> &NewLIs);
- void rewriteInstructionsForSpills(const LiveInterval &li, bool TrySplit,
- LiveInterval::Ranges::const_iterator &I,
- MachineInstr *OrigDefMI, MachineInstr *DefMI, unsigned Slot, int LdSlot,
- bool isLoad, bool isLoadSS, bool DefIsReMat, bool CanDelete,
- VirtRegMap &vrm, const TargetRegisterClass* rc,
- SmallVector<int, 4> &ReMatIds, const MachineLoopInfo *loopInfo,
- BitVector &SpillMBBs,
- std::map<unsigned,std::vector<SRInfo> > &SpillIdxes,
- BitVector &RestoreMBBs,
- std::map<unsigned,std::vector<SRInfo> > &RestoreIdxes,
- std::map<unsigned,unsigned> &MBBVRegsMap,
- std::vector<LiveInterval*> &NewLIs);
-
- static LiveInterval createInterval(unsigned Reg);
-
- void printRegName(unsigned reg) const;
- };
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/CodeGen/LiveVariables.h b/release_23/include/llvm/CodeGen/LiveVariables.h
deleted file mode 100644
index efa5f3c869fd..000000000000
--- a/release_23/include/llvm/CodeGen/LiveVariables.h
+++ /dev/null
@@ -1,289 +0,0 @@
-//===-- llvm/CodeGen/LiveVariables.h - Live Variable Analysis ---*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the LiveVariables analysis pass. For each machine
-// instruction in the function, this pass calculates the set of registers that
-// are immediately dead after the instruction (i.e., the instruction calculates
-// the value, but it is never used) and the set of registers that are used by
-// the instruction, but are never used after the instruction (i.e., they are
-// killed).
-//
-// This class computes live variables using a sparse implementation based on
-// the machine code SSA form. This class computes live variable information for
-// each virtual and _register allocatable_ physical register in a function. It
-// uses the dominance properties of SSA form to efficiently compute live
-// variables for virtual registers, and assumes that physical registers are only
-// live within a single basic block (allowing it to do a single local analysis
-// to resolve physical register lifetimes in each basic block). If a physical
-// register is not register allocatable, it is not tracked. This is useful for
-// things like the stack pointer and condition codes.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_CODEGEN_LIVEVARIABLES_H
-#define LLVM_CODEGEN_LIVEVARIABLES_H
-
-#include "llvm/CodeGen/MachineFunctionPass.h"
-#include "llvm/ADT/BitVector.h"
-#include "llvm/ADT/DenseMap.h"
-#include "llvm/ADT/SmallSet.h"
-#include "llvm/ADT/SmallVector.h"
-
-namespace llvm {
-
-class MachineRegisterInfo;
-class TargetRegisterInfo;
-
-class LiveVariables : public MachineFunctionPass {
-public:
- static char ID; // Pass identification, replacement for typeid
- LiveVariables() : MachineFunctionPass((intptr_t)&ID) {}
-
- /// VarInfo - This represents the regions where a virtual register is live in
- /// the program. We represent this with three different pieces of
- /// information: the instruction that uniquely defines the value, the set of
- /// blocks the instruction is live into and live out of, and the set of
- /// non-phi instructions that are the last users of the value.
- ///
- /// In the common case where a value is defined and killed in the same block,
- /// DefInst is the defining inst, there is one killing instruction, and
- /// AliveBlocks is empty.
- ///
- /// Otherwise, the value is live out of the block. If the value is live
- /// across any blocks, these blocks are listed in AliveBlocks. Blocks where
- /// the liveness range ends are not included in AliveBlocks, instead being
- /// captured by the Kills set. In these blocks, the value is live into the
- /// block (unless the value is defined and killed in the same block) and lives
- /// until the specified instruction. Note that there cannot ever be a value
- /// whose Kills set contains two instructions from the same basic block.
- ///
- /// PHI nodes complicate things a bit. If a PHI node is the last user of a
- /// value in one of its predecessor blocks, it is not listed in the kills set,
- /// but does include the predecessor block in the AliveBlocks set (unless that
- /// block also defines the value). This leads to the (perfectly sensical)
- /// situation where a value is defined in a block, and the last use is a phi
- /// node in the successor. In this case, DefInst will be the defining
- /// instruction, AliveBlocks is empty (the value is not live across any
- /// blocks) and Kills is empty (phi nodes are not included). This is sensical
- /// because the value must be live to the end of the block, but is not live in
- /// any successor blocks.
- struct VarInfo {
- /// DefInst - The machine instruction that defines this register.
- ///
- MachineInstr *DefInst;
-
- /// AliveBlocks - Set of blocks of which this value is alive completely
- /// through. This is a bit set which uses the basic block number as an
- /// index.
- ///
- BitVector AliveBlocks;
-
- /// UsedBlocks - Set of blocks of which this value is actually used. This
- /// is a bit set which uses the basic block number as an index.
- BitVector UsedBlocks;
-
- /// NumUses - Number of uses of this register across the entire function.
- ///
- unsigned NumUses;
-
- /// Kills - List of MachineInstruction's which are the last use of this
- /// virtual register (kill it) in their basic block.
- ///
- std::vector<MachineInstr*> Kills;
-
- VarInfo() : DefInst(0), NumUses(0) {}
-
- /// removeKill - Delete a kill corresponding to the specified
- /// machine instruction. Returns true if there was a kill
- /// corresponding to this instruction, false otherwise.
- bool removeKill(MachineInstr *MI) {
- std::vector<MachineInstr*>::iterator
- I = std::find(Kills.begin(), Kills.end(), MI);
- if (I == Kills.end())
- return false;
- Kills.erase(I);
- return true;
- }
-
- void dump() const;
- };
-
-private:
- /// VirtRegInfo - This list is a mapping from virtual register number to
- /// variable information. FirstVirtualRegister is subtracted from the virtual
- /// register number before indexing into this list.
- ///
- std::vector<VarInfo> VirtRegInfo;
-
- /// ReservedRegisters - This vector keeps track of which registers
- /// are reserved register which are not allocatable by the target machine.
- /// We can not track liveness for values that are in this set.
- ///
- BitVector ReservedRegisters;
-
-private: // Intermediate data structures
- MachineFunction *MF;
-
- MachineRegisterInfo* MRI;
-
- const TargetRegisterInfo *TRI;
-
- // PhysRegInfo - Keep track of which instruction was the last def of a
- // physical register. This is a purely local property, because all physical
- // register references are presumed dead across basic blocks.
- MachineInstr **PhysRegDef;
-
- // PhysRegInfo - Keep track of which instruction was the last use of a
- // physical register. This is a purely local property, because all physical
- // register references are presumed dead across basic blocks.
- MachineInstr **PhysRegUse;
-
- SmallVector<unsigned, 4> *PHIVarInfo;
-
- // DistanceMap - Keep track the distance of a MI from the start of the
- // current basic block.
- DenseMap<MachineInstr*, unsigned> DistanceMap;
-
- /// HandlePhysRegKill - Add kills of Reg and its sub-registers to the
- /// uses. Pay special attention to the sub-register uses which may come below
- /// the last use of the whole register.
- bool HandlePhysRegKill(unsigned Reg);
-
- void HandlePhysRegUse(unsigned Reg, MachineInstr *MI);
- void HandlePhysRegDef(unsigned Reg, MachineInstr *MI);
-
- /// FindLastPartialDef - Return the last partial def of the specified register.
- /// Also returns the sub-register that's defined.
- MachineInstr *FindLastPartialDef(unsigned Reg, unsigned &PartDefReg);
-
- /// hasRegisterUseBelow - Return true if the specified register is used after
- /// the current instruction and before it's next definition.
- bool hasRegisterUseBelow(unsigned Reg, MachineBasicBlock::iterator I,
- MachineBasicBlock *MBB);
-
- /// analyzePHINodes - Gather information about the PHI nodes in here. In
- /// particular, we want to map the variable information of a virtual
- /// register which is used in a PHI node. We map that to the BB the vreg
- /// is coming from.
- void analyzePHINodes(const MachineFunction& Fn);
-public:
-
- virtual bool runOnMachineFunction(MachineFunction &MF);
-
- /// RegisterDefIsDead - Return true if the specified instruction defines the
- /// specified register, but that definition is dead.
- bool RegisterDefIsDead(MachineInstr *MI, unsigned Reg) const;
-
- //===--------------------------------------------------------------------===//
- // API to update live variable information
-
- /// instructionChanged - When the address of an instruction changes, this
- /// method should be called so that live variables can update its internal
- /// data structures. This removes the records for OldMI, transfering them to
- /// the records for NewMI.
- void instructionChanged(MachineInstr *OldMI, MachineInstr *NewMI);
-
- /// addVirtualRegisterKilled - Add information about the fact that the
- /// specified register is killed after being used by the specified
- /// instruction. If AddIfNotFound is true, add a implicit operand if it's
- /// not found.
- void addVirtualRegisterKilled(unsigned IncomingReg, MachineInstr *MI,
- bool AddIfNotFound = false) {
- if (MI->addRegisterKilled(IncomingReg, TRI, AddIfNotFound))
- getVarInfo(IncomingReg).Kills.push_back(MI);
- }
-
- /// removeVirtualRegisterKilled - Remove the specified virtual
- /// register from the live variable information. Returns true if the
- /// variable was marked as killed by the specified instruction,
- /// false otherwise.
- bool removeVirtualRegisterKilled(unsigned reg,
- MachineBasicBlock *MBB,
- MachineInstr *MI) {
- if (!getVarInfo(reg).removeKill(MI))
- return false;
-
- bool Removed = false;
- for (unsigned i = 0, e = MI->getNumOperands(); i != e; ++i) {
- MachineOperand &MO = MI->getOperand(i);
- if (MO.isRegister() && MO.isKill() && MO.getReg() == reg) {
- MO.setIsKill(false);
- Removed = true;
- break;
- }
- }
-
- assert(Removed && "Register is not used by this instruction!");
- return true;
- }
-
- /// removeVirtualRegistersKilled - Remove all killed info for the specified
- /// instruction.
- void removeVirtualRegistersKilled(MachineInstr *MI);
-
- /// addVirtualRegisterDead - Add information about the fact that the specified
- /// register is dead after being used by the specified instruction. If
- /// AddIfNotFound is true, add a implicit operand if it's not found.
- void addVirtualRegisterDead(unsigned IncomingReg, MachineInstr *MI,
- bool AddIfNotFound = false) {
- if (MI->addRegisterDead(IncomingReg, TRI, AddIfNotFound))
- getVarInfo(IncomingReg).Kills.push_back(MI);
- }
-
- /// removeVirtualRegisterDead - Remove the specified virtual
- /// register from the live variable information. Returns true if the
- /// variable was marked dead at the specified instruction, false
- /// otherwise.
- bool removeVirtualRegisterDead(unsigned reg,
- MachineBasicBlock *MBB,
- MachineInstr *MI) {
- if (!getVarInfo(reg).removeKill(MI))
- return false;
-
- bool Removed = false;
- for (unsigned i = 0, e = MI->getNumOperands(); i != e; ++i) {
- MachineOperand &MO = MI->getOperand(i);
- if (MO.isRegister() && MO.isDef() && MO.getReg() == reg) {
- MO.setIsDead(false);
- Removed = true;
- break;
- }
- }
- assert(Removed && "Register is not defined by this instruction!");
- return true;
- }
-
- /// removeVirtualRegistersDead - Remove all of the dead registers for the
- /// specified instruction from the live variable information.
- void removeVirtualRegistersDead(MachineInstr *MI);
-
- virtual void getAnalysisUsage(AnalysisUsage &AU) const {
- AU.setPreservesAll();
- }
-
- virtual void releaseMemory() {
- VirtRegInfo.clear();
- }
-
- /// getVarInfo - Return the VarInfo structure for the specified VIRTUAL
- /// register.
- VarInfo &getVarInfo(unsigned RegIdx);
-
- void MarkVirtRegAliveInBlock(VarInfo& VRInfo, MachineBasicBlock* DefBlock,
- MachineBasicBlock *BB);
- void MarkVirtRegAliveInBlock(VarInfo& VRInfo, MachineBasicBlock* DefBlock,
- MachineBasicBlock *BB,
- std::vector<MachineBasicBlock*> &WorkList);
- void HandleVirtRegUse(unsigned reg, MachineBasicBlock *MBB,
- MachineInstr *MI);
-};
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/CodeGen/MachORelocation.h b/release_23/include/llvm/CodeGen/MachORelocation.h
deleted file mode 100644
index d4027cc0b780..000000000000
--- a/release_23/include/llvm/CodeGen/MachORelocation.h
+++ /dev/null
@@ -1,54 +0,0 @@
-//=== MachORelocation.h - Mach-O Relocation Info ----------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines the MachORelocation class.
-//
-//===----------------------------------------------------------------------===//
-
-
-#ifndef LLVM_CODEGEN_MACHO_RELOCATION_H
-#define LLVM_CODEGEN_MACHO_RELOCATION_H
-
-namespace llvm {
-
- /// MachORelocation - This struct contains information about each relocation
- /// that needs to be emitted to the file.
- /// see <mach-o/reloc.h>
- class MachORelocation {
- uint32_t r_address; // offset in the section to what is being relocated
- uint32_t r_symbolnum; // symbol index if r_extern == 1 else section index
- bool r_pcrel; // was relocated pc-relative already
- uint8_t r_length; // length = 2 ^ r_length
- bool r_extern; //
- uint8_t r_type; // if not 0, machine-specific relocation type.
- bool r_scattered; // 1 = scattered, 0 = non-scattered
- int32_t r_value; // the value the item to be relocated is referring
- // to.
- public:
- uint32_t getPackedFields() const {
- if (r_scattered)
- return (1 << 31) | (r_pcrel << 30) | ((r_length & 3) << 28) |
- ((r_type & 15) << 24) | (r_address & 0x00FFFFFF);
- else
- return (r_symbolnum << 8) | (r_pcrel << 7) | ((r_length & 3) << 5) |
- (r_extern << 4) | (r_type & 15);
- }
- uint32_t getAddress() const { return r_scattered ? r_value : r_address; }
- uint32_t getRawAddress() const { return r_address; }
-
- MachORelocation(uint32_t addr, uint32_t index, bool pcrel, uint8_t len,
- bool ext, uint8_t type, bool scattered = false,
- int32_t value = 0) :
- r_address(addr), r_symbolnum(index), r_pcrel(pcrel), r_length(len),
- r_extern(ext), r_type(type), r_scattered(scattered), r_value(value) {}
- };
-
-} // end llvm namespace
-
-#endif // LLVM_CODEGEN_MACHO_RELOCATION_H
diff --git a/release_23/include/llvm/CodeGen/MachineBasicBlock.h b/release_23/include/llvm/CodeGen/MachineBasicBlock.h
deleted file mode 100644
index 6fbe17005cd0..000000000000
--- a/release_23/include/llvm/CodeGen/MachineBasicBlock.h
+++ /dev/null
@@ -1,397 +0,0 @@
-//===-- llvm/CodeGen/MachineBasicBlock.h ------------------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// Collect the sequence of machine instructions for a basic block.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_CODEGEN_MACHINEBASICBLOCK_H
-#define LLVM_CODEGEN_MACHINEBASICBLOCK_H
-
-#include "llvm/CodeGen/MachineInstr.h"
-#include "llvm/ADT/GraphTraits.h"
-#include "llvm/ADT/ilist"
-#include "llvm/Support/Streams.h"
-
-namespace llvm {
- class MachineFunction;
-
-// ilist_traits
-template <>
-struct ilist_traits<MachineInstr> {
-protected:
- // this is only set by the MachineBasicBlock owning the ilist
- friend class MachineBasicBlock;
- MachineBasicBlock* parent;
-
-public:
- ilist_traits<MachineInstr>() : parent(0) { }
-
- static MachineInstr* getPrev(MachineInstr* N) { return N->Prev; }
- static MachineInstr* getNext(MachineInstr* N) { return N->Next; }
-
- static const MachineInstr*
- getPrev(const MachineInstr* N) { return N->Prev; }
-
- static const MachineInstr*
- getNext(const MachineInstr* N) { return N->Next; }
-
- static void setPrev(MachineInstr* N, MachineInstr* prev) { N->Prev = prev; }
- static void setNext(MachineInstr* N, MachineInstr* next) { N->Next = next; }
-
- static MachineInstr* createSentinel();
- static void destroySentinel(MachineInstr *MI) { delete MI; }
- void addNodeToList(MachineInstr* N);
- void removeNodeFromList(MachineInstr* N);
- void transferNodesFromList(
- iplist<MachineInstr, ilist_traits<MachineInstr> >& toList,
- ilist_iterator<MachineInstr> first,
- ilist_iterator<MachineInstr> last);
-};
-
-class BasicBlock;
-
-class MachineBasicBlock {
- typedef ilist<MachineInstr> Instructions;
- Instructions Insts;
- MachineBasicBlock *Prev, *Next;
- const BasicBlock *BB;
- int Number;
- MachineFunction *xParent;
-
- void setParent(MachineFunction *P) { xParent = P; }
-
- /// Predecessors/Successors - Keep track of the predecessor / successor
- /// basicblocks.
- std::vector<MachineBasicBlock *> Predecessors;
- std::vector<MachineBasicBlock *> Successors;
-
- /// LiveIns - Keep track of the physical registers that are livein of
- /// the basicblock.
- std::vector<unsigned> LiveIns;
-
- /// Alignment - Alignment of the basic block. Zero if the basic block does
- /// not need to be aligned.
- unsigned Alignment;
-
- /// IsLandingPad - Indicate that this basic block is entered via an
- /// exception handler.
- bool IsLandingPad;
-
-public:
- explicit MachineBasicBlock(const BasicBlock *bb = 0)
- : Prev(0), Next(0), BB(bb), Number(-1), xParent(0),
- Alignment(0), IsLandingPad(false) {
- Insts.parent = this;
- }
-
- ~MachineBasicBlock();
-
- /// getBasicBlock - Return the LLVM basic block that this instance
- /// corresponded to originally.
- ///
- const BasicBlock *getBasicBlock() const { return BB; }
-
- /// getParent - Return the MachineFunction containing this basic block.
- ///
- const MachineFunction *getParent() const { return xParent; }
- MachineFunction *getParent() { return xParent; }
-
- typedef ilist<MachineInstr>::iterator iterator;
- typedef ilist<MachineInstr>::const_iterator const_iterator;
- typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
- typedef std::reverse_iterator<iterator> reverse_iterator;
-
- unsigned size() const { return (unsigned)Insts.size(); }
- bool empty() const { return Insts.empty(); }
-
- MachineInstr& front() { return Insts.front(); }
- MachineInstr& back() { return Insts.back(); }
-
- iterator begin() { return Insts.begin(); }
- const_iterator begin() const { return Insts.begin(); }
- iterator end() { return Insts.end(); }
- const_iterator end() const { return Insts.end(); }
- reverse_iterator rbegin() { return Insts.rbegin(); }
- const_reverse_iterator rbegin() const { return Insts.rbegin(); }
- reverse_iterator rend () { return Insts.rend(); }
- const_reverse_iterator rend () const { return Insts.rend(); }
-
- // Machine-CFG iterators
- typedef std::vector<MachineBasicBlock *>::iterator pred_iterator;
- typedef std::vector<MachineBasicBlock *>::const_iterator const_pred_iterator;
- typedef std::vector<MachineBasicBlock *>::iterator succ_iterator;
- typedef std::vector<MachineBasicBlock *>::const_iterator const_succ_iterator;
- typedef std::vector<MachineBasicBlock *>::reverse_iterator
- pred_reverse_iterator;
- typedef std::vector<MachineBasicBlock *>::const_reverse_iterator
- const_pred_reverse_iterator;
- typedef std::vector<MachineBasicBlock *>::reverse_iterator
- succ_reverse_iterator;
- typedef std::vector<MachineBasicBlock *>::const_reverse_iterator
- const_succ_reverse_iterator;
-
- pred_iterator pred_begin() { return Predecessors.begin(); }
- const_pred_iterator pred_begin() const { return Predecessors.begin(); }
- pred_iterator pred_end() { return Predecessors.end(); }
- const_pred_iterator pred_end() const { return Predecessors.end(); }
- pred_reverse_iterator pred_rbegin()
- { return Predecessors.rbegin();}
- const_pred_reverse_iterator pred_rbegin() const
- { return Predecessors.rbegin();}
- pred_reverse_iterator pred_rend()
- { return Predecessors.rend(); }
- const_pred_reverse_iterator pred_rend() const
- { return Predecessors.rend(); }
- unsigned pred_size() const {
- return (unsigned)Predecessors.size();
- }
- bool pred_empty() const { return Predecessors.empty(); }
- succ_iterator succ_begin() { return Successors.begin(); }
- const_succ_iterator succ_begin() const { return Successors.begin(); }
- succ_iterator succ_end() { return Successors.end(); }
- const_succ_iterator succ_end() const { return Successors.end(); }
- succ_reverse_iterator succ_rbegin()
- { return Successors.rbegin(); }
- const_succ_reverse_iterator succ_rbegin() const
- { return Successors.rbegin(); }
- succ_reverse_iterator succ_rend()
- { return Successors.rend(); }
- const_succ_reverse_iterator succ_rend() const
- { return Successors.rend(); }
- unsigned succ_size() const {
- return (unsigned)Successors.size();
- }
- bool succ_empty() const { return Successors.empty(); }
-
- // LiveIn management methods.
-
- /// addLiveIn - Add the specified register as a live in. Note that it
- /// is an error to add the same register to the same set more than once.
- void addLiveIn(unsigned Reg) { LiveIns.push_back(Reg); }
-
- /// removeLiveIn - Remove the specified register from the live in set.
- ///
- void removeLiveIn(unsigned Reg);
-
- /// isLiveIn - Return true if the specified register is in the live in set.
- ///
- bool isLiveIn(unsigned Reg) const;
-
- // Iteration support for live in sets. These sets are kept in sorted
- // order by their register number.
- typedef std::vector<unsigned>::iterator livein_iterator;
- typedef std::vector<unsigned>::const_iterator const_livein_iterator;
- livein_iterator livein_begin() { return LiveIns.begin(); }
- const_livein_iterator livein_begin() const { return LiveIns.begin(); }
- livein_iterator livein_end() { return LiveIns.end(); }
- const_livein_iterator livein_end() const { return LiveIns.end(); }
- bool livein_empty() const { return LiveIns.empty(); }
-
- /// getAlignment - Return alignment of the basic block.
- ///
- unsigned getAlignment() const { return Alignment; }
-
- /// setAlignment - Set alignment of the basic block.
- ///
- void setAlignment(unsigned Align) { Alignment = Align; }
-
- /// isLandingPad - Returns true if the block is a landing pad. That is
- /// this basic block is entered via an exception handler.
- bool isLandingPad() const { return IsLandingPad; }
-
- /// setIsLandingPad - Indicates the block is a landing pad. That is
- /// this basic block is entered via an exception handler.
- void setIsLandingPad() { IsLandingPad = true; }
-
- // Code Layout methods.
-
- /// moveBefore/moveAfter - move 'this' block before or after the specified
- /// block. This only moves the block, it does not modify the CFG or adjust
- /// potential fall-throughs at the end of the block.
- void moveBefore(MachineBasicBlock *NewAfter);
- void moveAfter(MachineBasicBlock *NewBefore);
-
- // Machine-CFG mutators
-
- /// addSuccessor - Add succ as a successor of this MachineBasicBlock.
- /// The Predecessors list of succ is automatically updated.
- ///
- void addSuccessor(MachineBasicBlock *succ);
-
- /// removeSuccessor - Remove successor from the successors list of this
- /// MachineBasicBlock. The Predecessors list of succ is automatically updated.
- ///
- void removeSuccessor(MachineBasicBlock *succ);
-
- /// removeSuccessor - Remove specified successor from the successors list of
- /// this MachineBasicBlock. The Predecessors list of succ is automatically
- /// updated. Return the iterator to the element after the one removed.
- ///
- succ_iterator removeSuccessor(succ_iterator I);
-
- /// transferSuccessors - Transfers all the successors from MBB to this
- /// machine basic block (i.e., copies all the successors fromMBB and
- /// remove all the successors fromBB).
- void transferSuccessors(MachineBasicBlock *fromMBB);
-
- /// isSuccessor - Return true if the specified MBB is a successor of this
- /// block.
- bool isSuccessor(MachineBasicBlock *MBB) const;
-
- /// getFirstTerminator - returns an iterator to the first terminator
- /// instruction of this basic block. If a terminator does not exist,
- /// it returns end()
- iterator getFirstTerminator();
-
- void pop_front() { Insts.pop_front(); }
- void pop_back() { Insts.pop_back(); }
- void push_back(MachineInstr *MI) { Insts.push_back(MI); }
- template<typename IT>
- void insert(iterator I, IT S, IT E) { Insts.insert(I, S, E); }
- iterator insert(iterator I, MachineInstr *M) { return Insts.insert(I, M); }
-
- // erase - Remove the specified element or range from the instruction list.
- // These functions delete any instructions removed.
- //
- iterator erase(iterator I) { return Insts.erase(I); }
- iterator erase(iterator I, iterator E) { return Insts.erase(I, E); }
- MachineInstr *remove(MachineInstr *I) { return Insts.remove(I); }
- void clear() { Insts.clear(); }
-
- /// splice - Take a block of instructions from MBB 'Other' in the range [From,
- /// To), and insert them into this MBB right before 'where'.
- void splice(iterator where, MachineBasicBlock *Other, iterator From,
- iterator To) {
- Insts.splice(where, Other->Insts, From, To);
- }
-
- /// ReplaceUsesOfBlockWith - Given a machine basic block that branched to
- /// 'Old', change the code and CFG so that it branches to 'New' instead.
- void ReplaceUsesOfBlockWith(MachineBasicBlock *Old, MachineBasicBlock *New);
-
- /// CorrectExtraCFGEdges - Various pieces of code can cause excess edges in
- /// the CFG to be inserted. If we have proven that MBB can only branch to
- /// DestA and DestB, remove any other MBB successors from the CFG. DestA and
- /// DestB can be null. Besides DestA and DestB, retain other edges leading
- /// to LandingPads (currently there can be only one; we don't check or require
- /// that here). Note it is possible that DestA and/or DestB are LandingPads.
- bool CorrectExtraCFGEdges(MachineBasicBlock *DestA,
- MachineBasicBlock *DestB,
- bool isCond);
-
- // Debugging methods.
- void dump() const;
- void print(std::ostream &OS) const;
- void print(std::ostream *OS) const { if (OS) print(*OS); }
-
- /// getNumber - MachineBasicBlocks are uniquely numbered at the function
- /// level, unless they're not in a MachineFunction yet, in which case this
- /// will return -1.
- ///
- int getNumber() const { return Number; }
- void setNumber(int N) { Number = N; }
-
-private: // Methods used to maintain doubly linked list of blocks...
- friend struct ilist_traits<MachineBasicBlock>;
-
- MachineBasicBlock *getPrev() const { return Prev; }
- MachineBasicBlock *getNext() const { return Next; }
- void setPrev(MachineBasicBlock *P) { Prev = P; }
- void setNext(MachineBasicBlock *N) { Next = N; }
-
- // Machine-CFG mutators
-
- /// addPredecessor - Remove pred as a predecessor of this MachineBasicBlock.
- /// Don't do this unless you know what you're doing, because it doesn't
- /// update pred's successors list. Use pred->addSuccessor instead.
- ///
- void addPredecessor(MachineBasicBlock *pred);
-
- /// removePredecessor - Remove pred as a predecessor of this
- /// MachineBasicBlock. Don't do this unless you know what you're
- /// doing, because it doesn't update pred's successors list. Use
- /// pred->removeSuccessor instead.
- ///
- void removePredecessor(MachineBasicBlock *pred);
-};
-
-std::ostream& operator<<(std::ostream &OS, const MachineBasicBlock &MBB);
-
-//===--------------------------------------------------------------------===//
-// GraphTraits specializations for machine basic block graphs (machine-CFGs)
-//===--------------------------------------------------------------------===//
-
-// Provide specializations of GraphTraits to be able to treat a
-// MachineFunction as a graph of MachineBasicBlocks...
-//
-
-template <> struct GraphTraits<MachineBasicBlock *> {
- typedef MachineBasicBlock NodeType;
- typedef MachineBasicBlock::succ_iterator ChildIteratorType;
-
- static NodeType *getEntryNode(MachineBasicBlock *BB) { return BB; }
- static inline ChildIteratorType child_begin(NodeType *N) {
- return N->succ_begin();
- }
- static inline ChildIteratorType child_end(NodeType *N) {
- return N->succ_end();
- }
-};
-
-template <> struct GraphTraits<const MachineBasicBlock *> {
- typedef const MachineBasicBlock NodeType;
- typedef MachineBasicBlock::const_succ_iterator ChildIteratorType;
-
- static NodeType *getEntryNode(const MachineBasicBlock *BB) { return BB; }
- static inline ChildIteratorType child_begin(NodeType *N) {
- return N->succ_begin();
- }
- static inline ChildIteratorType child_end(NodeType *N) {
- return N->succ_end();
- }
-};
-
-// Provide specializations of GraphTraits to be able to treat a
-// MachineFunction as a graph of MachineBasicBlocks... and to walk it
-// in inverse order. Inverse order for a function is considered
-// to be when traversing the predecessor edges of a MBB
-// instead of the successor edges.
-//
-template <> struct GraphTraits<Inverse<MachineBasicBlock*> > {
- typedef MachineBasicBlock NodeType;
- typedef MachineBasicBlock::pred_iterator ChildIteratorType;
- static NodeType *getEntryNode(Inverse<MachineBasicBlock *> G) {
- return G.Graph;
- }
- static inline ChildIteratorType child_begin(NodeType *N) {
- return N->pred_begin();
- }
- static inline ChildIteratorType child_end(NodeType *N) {
- return N->pred_end();
- }
-};
-
-template <> struct GraphTraits<Inverse<const MachineBasicBlock*> > {
- typedef const MachineBasicBlock NodeType;
- typedef MachineBasicBlock::const_pred_iterator ChildIteratorType;
- static NodeType *getEntryNode(Inverse<const MachineBasicBlock*> G) {
- return G.Graph;
- }
- static inline ChildIteratorType child_begin(NodeType *N) {
- return N->pred_begin();
- }
- static inline ChildIteratorType child_end(NodeType *N) {
- return N->pred_end();
- }
-};
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/CodeGen/MachineCodeEmitter.h b/release_23/include/llvm/CodeGen/MachineCodeEmitter.h
deleted file mode 100644
index e38eb061baa6..000000000000
--- a/release_23/include/llvm/CodeGen/MachineCodeEmitter.h
+++ /dev/null
@@ -1,279 +0,0 @@
-//===-- llvm/CodeGen/MachineCodeEmitter.h - Code emission -------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines an abstract interface that is used by the machine code
-// emission framework to output the code. This allows machine code emission to
-// be separated from concerns such as resolution of call targets, and where the
-// machine code will be written (memory or disk, f.e.).
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_CODEGEN_MACHINECODEEMITTER_H
-#define LLVM_CODEGEN_MACHINECODEEMITTER_H
-
-#include "llvm/Support/DataTypes.h"
-#include <vector>
-
-namespace llvm {
-
-class MachineBasicBlock;
-class MachineConstantPool;
-class MachineJumpTableInfo;
-class MachineFunction;
-class MachineModuleInfo;
-class MachineRelocation;
-class Value;
-class GlobalValue;
-class Function;
-
-/// MachineCodeEmitter - This class defines two sorts of methods: those for
-/// emitting the actual bytes of machine code, and those for emitting auxillary
-/// structures, such as jump tables, relocations, etc.
-///
-/// Emission of machine code is complicated by the fact that we don't (in
-/// general) know the size of the machine code that we're about to emit before
-/// we emit it. As such, we preallocate a certain amount of memory, and set the
-/// BufferBegin/BufferEnd pointers to the start and end of the buffer. As we
-/// emit machine instructions, we advance the CurBufferPtr to indicate the
-/// location of the next byte to emit. In the case of a buffer overflow (we
-/// need to emit more machine code than we have allocated space for), the
-/// CurBufferPtr will saturate to BufferEnd and ignore stores. Once the entire
-/// function has been emitted, the overflow condition is checked, and if it has
-/// occurred, more memory is allocated, and we reemit the code into it.
-///
-class MachineCodeEmitter {
-protected:
- /// BufferBegin/BufferEnd - Pointers to the start and end of the memory
- /// allocated for this code buffer.
- unsigned char *BufferBegin, *BufferEnd;
-
- /// CurBufferPtr - Pointer to the next byte of memory to fill when emitting
- /// code. This is guranteed to be in the range [BufferBegin,BufferEnd]. If
- /// this pointer is at BufferEnd, it will never move due to code emission, and
- /// all code emission requests will be ignored (this is the buffer overflow
- /// condition).
- unsigned char *CurBufferPtr;
-
-public:
- virtual ~MachineCodeEmitter() {}
-
- /// startFunction - This callback is invoked when the specified function is
- /// about to be code generated. This initializes the BufferBegin/End/Ptr
- /// fields.
- ///
- virtual void startFunction(MachineFunction &F) = 0;
-
- /// finishFunction - This callback is invoked when the specified function has
- /// finished code generation. If a buffer overflow has occurred, this method
- /// returns true (the callee is required to try again), otherwise it returns
- /// false.
- ///
- virtual bool finishFunction(MachineFunction &F) = 0;
-
- /// startFunctionStub - This callback is invoked when the JIT needs the
- /// address of a function that has not been code generated yet. The StubSize
- /// specifies the total size required by the stub. Stubs are not allowed to
- /// have constant pools, the can only use the other emitByte*/emitWord*
- /// methods.
- ///
- virtual void startFunctionStub(const GlobalValue* F, unsigned StubSize,
- unsigned Alignment = 1) = 0;
-
- /// finishFunctionStub - This callback is invoked to terminate a function
- /// stub.
- ///
- virtual void *finishFunctionStub(const GlobalValue* F) = 0;
-
- /// emitByte - This callback is invoked when a byte needs to be written to the
- /// output stream.
- ///
- void emitByte(unsigned char B) {
- if (CurBufferPtr != BufferEnd)
- *CurBufferPtr++ = B;
- }
-
- /// emitWordLE - This callback is invoked when a 32-bit word needs to be
- /// written to the output stream in little-endian format.
- ///
- void emitWordLE(unsigned W) {
- if (CurBufferPtr+4 <= BufferEnd) {
- *CurBufferPtr++ = (unsigned char)(W >> 0);
- *CurBufferPtr++ = (unsigned char)(W >> 8);
- *CurBufferPtr++ = (unsigned char)(W >> 16);
- *CurBufferPtr++ = (unsigned char)(W >> 24);
- } else {
- CurBufferPtr = BufferEnd;
- }
- }
-
- /// emitWordBE - This callback is invoked when a 32-bit word needs to be
- /// written to the output stream in big-endian format.
- ///
- void emitWordBE(unsigned W) {
- if (CurBufferPtr+4 <= BufferEnd) {
- *CurBufferPtr++ = (unsigned char)(W >> 24);
- *CurBufferPtr++ = (unsigned char)(W >> 16);
- *CurBufferPtr++ = (unsigned char)(W >> 8);
- *CurBufferPtr++ = (unsigned char)(W >> 0);
- } else {
- CurBufferPtr = BufferEnd;
- }
- }
-
- /// emitAlignment - Move the CurBufferPtr pointer up the the specified
- /// alignment (saturated to BufferEnd of course).
- void emitAlignment(unsigned Alignment) {
- if (Alignment == 0) Alignment = 1;
- // Move the current buffer ptr up to the specified alignment.
- CurBufferPtr =
- (unsigned char*)(((intptr_t)CurBufferPtr+Alignment-1) &
- ~(intptr_t)(Alignment-1));
- if (CurBufferPtr > BufferEnd)
- CurBufferPtr = BufferEnd;
- }
-
-
- /// emitULEB128Bytes - This callback is invoked when a ULEB128 needs to be
- /// written to the output stream.
- void emitULEB128Bytes(unsigned Value) {
- do {
- unsigned char Byte = Value & 0x7f;
- Value >>= 7;
- if (Value) Byte |= 0x80;
- emitByte(Byte);
- } while (Value);
- }
-
- /// emitSLEB128Bytes - This callback is invoked when a SLEB128 needs to be
- /// written to the output stream.
- void emitSLEB128Bytes(int Value) {
- int Sign = Value >> (8 * sizeof(Value) - 1);
- bool IsMore;
-
- do {
- unsigned char Byte = Value & 0x7f;
- Value >>= 7;
- IsMore = Value != Sign || ((Byte ^ Sign) & 0x40) != 0;
- if (IsMore) Byte |= 0x80;
- emitByte(Byte);
- } while (IsMore);
- }
-
- /// emitString - This callback is invoked when a String needs to be
- /// written to the output stream.
- void emitString(const std::string &String) {
- for (unsigned i = 0, N = static_cast<unsigned>(String.size());
- i < N; ++i) {
- unsigned char C = String[i];
- emitByte(C);
- }
- emitByte(0);
- }
-
- /// emitInt32 - Emit a int32 directive.
- void emitInt32(int Value) {
- if (CurBufferPtr+4 <= BufferEnd) {
- *((uint32_t*)CurBufferPtr) = Value;
- CurBufferPtr += 4;
- } else {
- CurBufferPtr = BufferEnd;
- }
- }
-
- /// emitInt64 - Emit a int64 directive.
- void emitInt64(uint64_t Value) {
- if (CurBufferPtr+8 <= BufferEnd) {
- *((uint64_t*)CurBufferPtr) = Value;
- CurBufferPtr += 8;
- } else {
- CurBufferPtr = BufferEnd;
- }
- }
-
- /// emitAt - Emit Value in Addr
- void emitAt(uintptr_t *Addr, uintptr_t Value) {
- if (Addr >= (uintptr_t*)BufferBegin && Addr < (uintptr_t*)BufferEnd)
- (*Addr) = Value;
- }
-
- /// emitLabel - Emits a label
- virtual void emitLabel(uint64_t LabelID) = 0;
-
- /// allocateSpace - Allocate a block of space in the current output buffer,
- /// returning null (and setting conditions to indicate buffer overflow) on
- /// failure. Alignment is the alignment in bytes of the buffer desired.
- void *allocateSpace(intptr_t Size, unsigned Alignment) {
- emitAlignment(Alignment);
- void *Result = CurBufferPtr;
-
- // Allocate the space.
- CurBufferPtr += Size;
-
- // Check for buffer overflow.
- if (CurBufferPtr >= BufferEnd) {
- CurBufferPtr = BufferEnd;
- Result = 0;
- }
- return Result;
- }
-
- /// StartMachineBasicBlock - This should be called by the target when a new
- /// basic block is about to be emitted. This way the MCE knows where the
- /// start of the block is, and can implement getMachineBasicBlockAddress.
- virtual void StartMachineBasicBlock(MachineBasicBlock *MBB) = 0;
-
- /// getCurrentPCValue - This returns the address that the next emitted byte
- /// will be output to.
- ///
- virtual intptr_t getCurrentPCValue() const {
- return (intptr_t)CurBufferPtr;
- }
-
- /// getCurrentPCOffset - Return the offset from the start of the emitted
- /// buffer that we are currently writing to.
- intptr_t getCurrentPCOffset() const {
- return CurBufferPtr-BufferBegin;
- }
-
- /// addRelocation - Whenever a relocatable address is needed, it should be
- /// noted with this interface.
- virtual void addRelocation(const MachineRelocation &MR) = 0;
-
-
- /// FIXME: These should all be handled with relocations!
-
- /// getConstantPoolEntryAddress - Return the address of the 'Index' entry in
- /// the constant pool that was last emitted with the emitConstantPool method.
- ///
- virtual intptr_t getConstantPoolEntryAddress(unsigned Index) const = 0;
-
- /// getJumpTableEntryAddress - Return the address of the jump table with index
- /// 'Index' in the function that last called initJumpTableInfo.
- ///
- virtual intptr_t getJumpTableEntryAddress(unsigned Index) const = 0;
-
- /// getMachineBasicBlockAddress - Return the address of the specified
- /// MachineBasicBlock, only usable after the label for the MBB has been
- /// emitted.
- ///
- virtual intptr_t getMachineBasicBlockAddress(MachineBasicBlock *MBB) const= 0;
-
- /// getLabelAddress - Return the address of the specified LabelID, only usable
- /// after the LabelID has been emitted.
- ///
- virtual intptr_t getLabelAddress(uint64_t LabelID) const = 0;
-
- /// Specifies the MachineModuleInfo object. This is used for exception handling
- /// purposes.
- virtual void setModuleInfo(MachineModuleInfo* Info) = 0;
-};
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/CodeGen/MachineConstantPool.h b/release_23/include/llvm/CodeGen/MachineConstantPool.h
deleted file mode 100644
index 4144d8ca16ff..000000000000
--- a/release_23/include/llvm/CodeGen/MachineConstantPool.h
+++ /dev/null
@@ -1,150 +0,0 @@
-//===-- CodeGen/MachineConstantPool.h - Abstract Constant Pool --*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-/// @file This file declares the MachineConstantPool class which is an abstract
-/// constant pool to keep track of constants referenced by a function.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_CODEGEN_MACHINECONSTANTPOOL_H
-#define LLVM_CODEGEN_MACHINECONSTANTPOOL_H
-
-#include "llvm/ADT/FoldingSet.h"
-#include "llvm/CodeGen/SelectionDAGNodes.h"
-#include "llvm/Support/Streams.h"
-#include <vector>
-#include <iosfwd>
-
-namespace llvm {
-
-class AsmPrinter;
-class Constant;
-class TargetData;
-class TargetMachine;
-class MachineConstantPool;
-
-/// Abstract base class for all machine specific constantpool value subclasses.
-///
-class MachineConstantPoolValue {
- const Type *Ty;
-
-public:
- explicit MachineConstantPoolValue(const Type *ty) : Ty(ty) {}
- virtual ~MachineConstantPoolValue() {}
-
- /// getType - get type of this MachineConstantPoolValue.
- ///
- inline const Type *getType() const { return Ty; }
-
- virtual int getExistingMachineCPValue(MachineConstantPool *CP,
- unsigned Alignment) = 0;
-
- virtual void AddSelectionDAGCSEId(FoldingSetNodeID &ID) = 0;
-
- /// print - Implement operator<<...
- ///
- virtual void print(std::ostream &O) const = 0;
- void print(std::ostream *O) const { if (O) print(*O); }
-};
-
-inline std::ostream &operator<<(std::ostream &OS,
- const MachineConstantPoolValue &V) {
- V.print(OS);
- return OS;
-}
-
-/// This class is a data container for one entry in a MachineConstantPool.
-/// It contains a pointer to the value and an offset from the start of
-/// the constant pool.
-/// @brief An entry in a MachineConstantPool
-class MachineConstantPoolEntry {
-public:
- /// The constant itself.
- union {
- Constant *ConstVal;
- MachineConstantPoolValue *MachineCPVal;
- } Val;
-
- /// The offset of the constant from the start of the pool. The top bit is set
- /// when Val is a MachineConstantPoolValue.
- unsigned Offset;
-
- MachineConstantPoolEntry(Constant *V, unsigned O)
- : Offset(O) {
- assert((int)Offset >= 0 && "Offset is too large");
- Val.ConstVal = V;
- }
- MachineConstantPoolEntry(MachineConstantPoolValue *V, unsigned O)
- : Offset(O){
- assert((int)Offset >= 0 && "Offset is too large");
- Val.MachineCPVal = V;
- Offset |= 1 << (sizeof(unsigned)*8-1);
- }
-
- bool isMachineConstantPoolEntry() const {
- return (int)Offset < 0;
- }
-
- int getOffset() const {
- return Offset & ~(1 << (sizeof(unsigned)*8-1));
- }
-
- const Type *getType() const;
-};
-
-/// The MachineConstantPool class keeps track of constants referenced by a
-/// function which must be spilled to memory. This is used for constants which
-/// are unable to be used directly as operands to instructions, which typically
-/// include floating point and large integer constants.
-///
-/// Instructions reference the address of these constant pool constants through
-/// the use of MO_ConstantPoolIndex values. When emitting assembly or machine
-/// code, these virtual address references are converted to refer to the
-/// address of the function constant pool values.
-/// @brief The machine constant pool.
-class MachineConstantPool {
- const TargetData *TD; ///< The machine's TargetData.
- unsigned PoolAlignment; ///< The alignment for the pool.
- std::vector<MachineConstantPoolEntry> Constants; ///< The pool of constants.
-public:
- /// @brief The only constructor.
- explicit MachineConstantPool(const TargetData *td)
- : TD(td), PoolAlignment(1) {}
- ~MachineConstantPool();
-
- /// getConstantPoolAlignment - Return the log2 of the alignment required by
- /// the whole constant pool, of which the first element must be aligned.
- unsigned getConstantPoolAlignment() const { return PoolAlignment; }
-
- /// getConstantPoolIndex - Create a new entry in the constant pool or return
- /// an existing one. User must specify an alignment in bytes for the object.
- unsigned getConstantPoolIndex(Constant *C, unsigned Alignment);
- unsigned getConstantPoolIndex(MachineConstantPoolValue *V,unsigned Alignment);
-
- /// isEmpty - Return true if this constant pool contains no constants.
- bool isEmpty() const { return Constants.empty(); }
-
- const std::vector<MachineConstantPoolEntry> &getConstants() const {
- return Constants;
- }
-
- /// print - Used by the MachineFunction printer to print information about
- /// constant pool objects. Implemented in MachineFunction.cpp
- ///
- void print(std::ostream &OS) const;
- void print(std::ostream *OS) const { if (OS) print(*OS); }
-
- /// dump - Call print(std::cerr) to be called from the debugger.
- ///
- void dump() const;
-};
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/CodeGen/MachineDominators.h b/release_23/include/llvm/CodeGen/MachineDominators.h
deleted file mode 100644
index 7d1d9fe9ccf3..000000000000
--- a/release_23/include/llvm/CodeGen/MachineDominators.h
+++ /dev/null
@@ -1,216 +0,0 @@
-//=- llvm/CodeGen/MachineDominators.h - Machine Dom Calculation --*- C++ -*-==//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines classes mirroring those in llvm/Analysis/Dominators.h,
-// but for target-specific code rather than target-independent IR.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_CODEGEN_MACHINEDOMINATORS_H
-#define LLVM_CODEGEN_MACHINEDOMINATORS_H
-
-#include "llvm/CodeGen/MachineFunctionPass.h"
-#include "llvm/CodeGen/MachineBasicBlock.h"
-#include "llvm/CodeGen/MachineFunction.h"
-#include "llvm/CodeGen/MachineInstr.h"
-#include "llvm/Analysis/Dominators.h"
-#include "llvm/Analysis/DominatorInternals.h"
-
-namespace llvm {
-
-inline void WriteAsOperand(std::ostream &, const MachineBasicBlock*, bool t) { }
-
-template<>
-inline void DominatorTreeBase<MachineBasicBlock>::addRoot(MachineBasicBlock* MBB) {
- this->Roots.push_back(MBB);
-}
-
-EXTERN_TEMPLATE_INSTANTIATION(class DomTreeNodeBase<MachineBasicBlock>);
-EXTERN_TEMPLATE_INSTANTIATION(class DominatorTreeBase<MachineBasicBlock>);
-
-typedef DomTreeNodeBase<MachineBasicBlock> MachineDomTreeNode;
-
-//===-------------------------------------
-/// DominatorTree Class - Concrete subclass of DominatorTreeBase that is used to
-/// compute a normal dominator tree.
-///
-class MachineDominatorTree : public MachineFunctionPass {
-public:
- static char ID; // Pass ID, replacement for typeid
- DominatorTreeBase<MachineBasicBlock>* DT;
-
- MachineDominatorTree() : MachineFunctionPass(intptr_t(&ID)) {
- DT = new DominatorTreeBase<MachineBasicBlock>(false);
- }
-
- ~MachineDominatorTree() {
- DT->releaseMemory();
- delete DT;
- }
-
- DominatorTreeBase<MachineBasicBlock>& getBase() { return *DT; }
-
- virtual void getAnalysisUsage(AnalysisUsage &AU) const {
- AU.setPreservesAll();
- MachineFunctionPass::getAnalysisUsage(AU);
- }
-
- /// getRoots - Return the root blocks of the current CFG. This may include
- /// multiple blocks if we are computing post dominators. For forward
- /// dominators, this will always be a single block (the entry node).
- ///
- inline const std::vector<MachineBasicBlock*> &getRoots() const {
- return DT->getRoots();
- }
-
- inline MachineBasicBlock *getRoot() const {
- return DT->getRoot();
- }
-
- inline MachineDomTreeNode *getRootNode() const {
- return DT->getRootNode();
- }
-
- virtual bool runOnMachineFunction(MachineFunction &F) {
- DT->recalculate(F);
-
- return false;
- }
-
- inline bool dominates(MachineDomTreeNode* A, MachineDomTreeNode* B) const {
- return DT->dominates(A, B);
- }
-
- inline bool dominates(MachineBasicBlock* A, MachineBasicBlock* B) const {
- return DT->dominates(A, B);
- }
-
- // dominates - Return true if A dominates B. This performs the
- // special checks necessary if A and B are in the same basic block.
- bool dominates(MachineInstr *A, MachineInstr *B) const {
- MachineBasicBlock *BBA = A->getParent(), *BBB = B->getParent();
- if (BBA != BBB) return DT->dominates(BBA, BBB);
-
- // Loop through the basic block until we find A or B.
- MachineBasicBlock::iterator I = BBA->begin();
- for (; &*I != A && &*I != B; ++I) /*empty*/;
-
- //if(!DT.IsPostDominators) {
- // A dominates B if it is found first in the basic block.
- return &*I == A;
- //} else {
- // // A post-dominates B if B is found first in the basic block.
- // return &*I == B;
- //}
- }
-
- inline bool properlyDominates(const MachineDomTreeNode* A,
- MachineDomTreeNode* B) const {
- return DT->properlyDominates(A, B);
- }
-
- inline bool properlyDominates(MachineBasicBlock* A,
- MachineBasicBlock* B) const {
- return DT->properlyDominates(A, B);
- }
-
- /// findNearestCommonDominator - Find nearest common dominator basic block
- /// for basic block A and B. If there is no such block then return NULL.
- inline MachineBasicBlock *findNearestCommonDominator(MachineBasicBlock *A,
- MachineBasicBlock *B) {
- return DT->findNearestCommonDominator(A, B);
- }
-
- inline MachineDomTreeNode *operator[](MachineBasicBlock *BB) const {
- return DT->getNode(BB);
- }
-
- /// getNode - return the (Post)DominatorTree node for the specified basic
- /// block. This is the same as using operator[] on this class.
- ///
- inline MachineDomTreeNode *getNode(MachineBasicBlock *BB) const {
- return DT->getNode(BB);
- }
-
- /// addNewBlock - Add a new node to the dominator tree information. This
- /// creates a new node as a child of DomBB dominator node,linking it into
- /// the children list of the immediate dominator.
- inline MachineDomTreeNode *addNewBlock(MachineBasicBlock *BB,
- MachineBasicBlock *DomBB) {
- return DT->addNewBlock(BB, DomBB);
- }
-
- /// changeImmediateDominator - This method is used to update the dominator
- /// tree information when a node's immediate dominator changes.
- ///
- inline void changeImmediateDominator(MachineBasicBlock *N,
- MachineBasicBlock* NewIDom) {
- DT->changeImmediateDominator(N, NewIDom);
- }
-
- inline void changeImmediateDominator(MachineDomTreeNode *N,
- MachineDomTreeNode* NewIDom) {
- DT->changeImmediateDominator(N, NewIDom);
- }
-
- /// eraseNode - Removes a node from the dominator tree. Block must not
- /// domiante any other blocks. Removes node from its immediate dominator's
- /// children list. Deletes dominator node associated with basic block BB.
- inline void eraseNode(MachineBasicBlock *BB) {
- DT->eraseNode(BB);
- }
-
- /// splitBlock - BB is split and now it has one successor. Update dominator
- /// tree to reflect this change.
- inline void splitBlock(MachineBasicBlock* NewBB) {
- DT->splitBlock(NewBB);
- }
-
-
- virtual void releaseMemory() {
- DT->releaseMemory();
- }
-
- virtual void print(std::ostream &OS, const Module* M= 0) const {
- DT->print(OS, M);
- }
-};
-
-//===-------------------------------------
-/// DominatorTree GraphTraits specialization so the DominatorTree can be
-/// iterable by generic graph iterators.
-///
-
-template<class T> struct GraphTraits;
-
-template <> struct GraphTraits<MachineDomTreeNode *> {
- typedef MachineDomTreeNode NodeType;
- typedef NodeType::iterator ChildIteratorType;
-
- static NodeType *getEntryNode(NodeType *N) {
- return N;
- }
- static inline ChildIteratorType child_begin(NodeType* N) {
- return N->begin();
- }
- static inline ChildIteratorType child_end(NodeType* N) {
- return N->end();
- }
-};
-
-template <> struct GraphTraits<MachineDominatorTree*>
- : public GraphTraits<MachineDomTreeNode *> {
- static NodeType *getEntryNode(MachineDominatorTree *DT) {
- return DT->getRootNode();
- }
-};
-
-}
-
-#endif
diff --git a/release_23/include/llvm/CodeGen/MachineFrameInfo.h b/release_23/include/llvm/CodeGen/MachineFrameInfo.h
deleted file mode 100644
index 592c17f56b51..000000000000
--- a/release_23/include/llvm/CodeGen/MachineFrameInfo.h
+++ /dev/null
@@ -1,370 +0,0 @@
-//===-- CodeGen/MachineFrameInfo.h - Abstract Stack Frame Rep. --*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// The file defines the MachineFrameInfo class.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_CODEGEN_MACHINEFRAMEINFO_H
-#define LLVM_CODEGEN_MACHINEFRAMEINFO_H
-
-#include <vector>
-
-namespace llvm {
-class TargetData;
-class TargetRegisterClass;
-class Type;
-class MachineModuleInfo;
-class MachineFunction;
-class TargetFrameInfo;
-
-/// The CalleeSavedInfo class tracks the information need to locate where a
-/// callee saved register in the current frame.
-class CalleeSavedInfo {
-
-private:
- unsigned Reg;
- const TargetRegisterClass *RegClass;
- int FrameIdx;
-
-public:
- CalleeSavedInfo(unsigned R, const TargetRegisterClass *RC, int FI = 0)
- : Reg(R)
- , RegClass(RC)
- , FrameIdx(FI)
- {}
-
- // Accessors.
- unsigned getReg() const { return Reg; }
- const TargetRegisterClass *getRegClass() const { return RegClass; }
- int getFrameIdx() const { return FrameIdx; }
- void setFrameIdx(int FI) { FrameIdx = FI; }
-};
-
-/// The MachineFrameInfo class represents an abstract stack frame until
-/// prolog/epilog code is inserted. This class is key to allowing stack frame
-/// representation optimizations, such as frame pointer elimination. It also
-/// allows more mundane (but still important) optimizations, such as reordering
-/// of abstract objects on the stack frame.
-///
-/// To support this, the class assigns unique integer identifiers to stack
-/// objects requested clients. These identifiers are negative integers for
-/// fixed stack objects (such as arguments passed on the stack) or positive
-/// for objects that may be reordered. Instructions which refer to stack
-/// objects use a special MO_FrameIndex operand to represent these frame
-/// indexes.
-///
-/// Because this class keeps track of all references to the stack frame, it
-/// knows when a variable sized object is allocated on the stack. This is the
-/// sole condition which prevents frame pointer elimination, which is an
-/// important optimization on register-poor architectures. Because original
-/// variable sized alloca's in the source program are the only source of
-/// variable sized stack objects, it is safe to decide whether there will be
-/// any variable sized objects before all stack objects are known (for
-/// example, register allocator spill code never needs variable sized
-/// objects).
-///
-/// When prolog/epilog code emission is performed, the final stack frame is
-/// built and the machine instructions are modified to refer to the actual
-/// stack offsets of the object, eliminating all MO_FrameIndex operands from
-/// the program.
-///
-/// @brief Abstract Stack Frame Information
-class MachineFrameInfo {
-
- // StackObject - Represent a single object allocated on the stack.
- struct StackObject {
- // The size of this object on the stack. 0 means a variable sized object,
- // ~0ULL means a dead object.
- uint64_t Size;
-
- // Alignment - The required alignment of this stack slot.
- unsigned Alignment;
-
- // isImmutable - If true, the value of the stack object is set before
- // entering the function and is not modified inside the function. By
- // default, fixed objects are immutable unless marked otherwise.
- bool isImmutable;
-
- // SPOffset - The offset of this object from the stack pointer on entry to
- // the function. This field has no meaning for a variable sized element.
- int64_t SPOffset;
-
- StackObject(uint64_t Sz, unsigned Al, int64_t SP, bool IM = false)
- : Size(Sz), Alignment(Al), isImmutable(IM), SPOffset(SP) {}
- };
-
- /// Objects - The list of stack objects allocated...
- ///
- std::vector<StackObject> Objects;
-
- /// NumFixedObjects - This contains the number of fixed objects contained on
- /// the stack. Because fixed objects are stored at a negative index in the
- /// Objects list, this is also the index to the 0th object in the list.
- ///
- unsigned NumFixedObjects;
-
- /// HasVarSizedObjects - This boolean keeps track of whether any variable
- /// sized objects have been allocated yet.
- ///
- bool HasVarSizedObjects;
-
- /// StackSize - The prolog/epilog code inserter calculates the final stack
- /// offsets for all of the fixed size objects, updating the Objects list
- /// above. It then updates StackSize to contain the number of bytes that need
- /// to be allocated on entry to the function.
- ///
- uint64_t StackSize;
-
- /// OffsetAdjustment - The amount that a frame offset needs to be adjusted to
- /// have the actual offset from the stack/frame pointer. The calculation is
- /// MFI->getObjectOffset(Index) + StackSize - TFI.getOffsetOfLocalArea() +
- /// OffsetAdjustment. If OffsetAdjustment is zero (default) then offsets are
- /// away from TOS. If OffsetAdjustment == StackSize then offsets are toward
- /// TOS.
- int OffsetAdjustment;
-
- /// MaxAlignment - The prolog/epilog code inserter may process objects
- /// that require greater alignment than the default alignment the target
- /// provides. To handle this, MaxAlignment is set to the maximum alignment
- /// needed by the objects on the current frame. If this is greater than the
- /// native alignment maintained by the compiler, dynamic alignment code will
- /// be needed.
- ///
- unsigned MaxAlignment;
-
- /// HasCalls - Set to true if this function has any function calls. This is
- /// only valid during and after prolog/epilog code insertion.
- bool HasCalls;
-
- /// MaxCallFrameSize - This contains the size of the largest call frame if the
- /// target uses frame setup/destroy pseudo instructions (as defined in the
- /// TargetFrameInfo class). This information is important for frame pointer
- /// elimination. If is only valid during and after prolog/epilog code
- /// insertion.
- ///
- unsigned MaxCallFrameSize;
-
- /// CSInfo - The prolog/epilog code inserter fills in this vector with each
- /// callee saved register saved in the frame. Beyond its use by the prolog/
- /// epilog code inserter, this data used for debug info and exception
- /// handling.
- std::vector<CalleeSavedInfo> CSInfo;
-
- /// MMI - This field is set (via setMachineModuleInfo) by a module info
- /// consumer (ex. DwarfWriter) to indicate that frame layout information
- /// should be acquired. Typically, it's the responsibility of the target's
- /// TargetRegisterInfo prologue/epilogue emitting code to inform
- /// MachineModuleInfo of frame layouts.
- MachineModuleInfo *MMI;
-
- /// TargetFrameInfo - Target information about frame layout.
- ///
- const TargetFrameInfo &TFI;
-public:
- MachineFrameInfo(const TargetFrameInfo &tfi) : TFI(tfi) {
- StackSize = NumFixedObjects = OffsetAdjustment = MaxAlignment = 0;
- HasVarSizedObjects = false;
- HasCalls = false;
- MaxCallFrameSize = 0;
- MMI = 0;
- }
-
- /// hasStackObjects - Return true if there are any stack objects in this
- /// function.
- ///
- bool hasStackObjects() const { return !Objects.empty(); }
-
- /// hasVarSizedObjects - This method may be called any time after instruction
- /// selection is complete to determine if the stack frame for this function
- /// contains any variable sized objects.
- ///
- bool hasVarSizedObjects() const { return HasVarSizedObjects; }
-
- /// getObjectIndexBegin - Return the minimum frame object index...
- ///
- int getObjectIndexBegin() const { return -NumFixedObjects; }
-
- /// getObjectIndexEnd - Return one past the maximum frame object index...
- ///
- int getObjectIndexEnd() const { return (int)Objects.size()-NumFixedObjects; }
-
- /// getObjectSize - Return the size of the specified object
- ///
- int64_t getObjectSize(int ObjectIdx) const {
- assert(unsigned(ObjectIdx+NumFixedObjects) < Objects.size() &&
- "Invalid Object Idx!");
- return Objects[ObjectIdx+NumFixedObjects].Size;
- }
-
- /// getObjectAlignment - Return the alignment of the specified stack object...
- unsigned getObjectAlignment(int ObjectIdx) const {
- assert(unsigned(ObjectIdx+NumFixedObjects) < Objects.size() &&
- "Invalid Object Idx!");
- return Objects[ObjectIdx+NumFixedObjects].Alignment;
- }
-
- /// getObjectOffset - Return the assigned stack offset of the specified object
- /// from the incoming stack pointer.
- ///
- int64_t getObjectOffset(int ObjectIdx) const {
- assert(unsigned(ObjectIdx+NumFixedObjects) < Objects.size() &&
- "Invalid Object Idx!");
- assert(!isDeadObjectIndex(ObjectIdx) &&
- "Getting frame offset for a dead object?");
- return Objects[ObjectIdx+NumFixedObjects].SPOffset;
- }
-
- /// setObjectOffset - Set the stack frame offset of the specified object. The
- /// offset is relative to the stack pointer on entry to the function.
- ///
- void setObjectOffset(int ObjectIdx, int64_t SPOffset) {
- assert(unsigned(ObjectIdx+NumFixedObjects) < Objects.size() &&
- "Invalid Object Idx!");
- assert(!isDeadObjectIndex(ObjectIdx) &&
- "Setting frame offset for a dead object?");
- Objects[ObjectIdx+NumFixedObjects].SPOffset = SPOffset;
- }
-
- /// getStackSize - Return the number of bytes that must be allocated to hold
- /// all of the fixed size frame objects. This is only valid after
- /// Prolog/Epilog code insertion has finalized the stack frame layout.
- ///
- uint64_t getStackSize() const { return StackSize; }
-
- /// setStackSize - Set the size of the stack...
- ///
- void setStackSize(uint64_t Size) { StackSize = Size; }
-
- /// getOffsetAdjustment - Return the correction for frame offsets.
- ///
- int getOffsetAdjustment() const { return OffsetAdjustment; }
-
- /// setOffsetAdjustment - Set the correction for frame offsets.
- ///
- void setOffsetAdjustment(int Adj) { OffsetAdjustment = Adj; }
-
- /// getMaxAlignment - Return the alignment in bytes that this function must be
- /// aligned to, which is greater than the default stack alignment provided by
- /// the target.
- ///
- unsigned getMaxAlignment() const { return MaxAlignment; }
-
- /// setMaxAlignment - Set the preferred alignment.
- ///
- void setMaxAlignment(unsigned Align) { MaxAlignment = Align; }
-
- /// hasCalls - Return true if the current function has no function calls.
- /// This is only valid during or after prolog/epilog code emission.
- ///
- bool hasCalls() const { return HasCalls; }
- void setHasCalls(bool V) { HasCalls = V; }
-
- /// getMaxCallFrameSize - Return the maximum size of a call frame that must be
- /// allocated for an outgoing function call. This is only available if
- /// CallFrameSetup/Destroy pseudo instructions are used by the target, and
- /// then only during or after prolog/epilog code insertion.
- ///
- unsigned getMaxCallFrameSize() const { return MaxCallFrameSize; }
- void setMaxCallFrameSize(unsigned S) { MaxCallFrameSize = S; }
-
- /// CreateFixedObject - Create a new object at a fixed location on the stack.
- /// All fixed objects should be created before other objects are created for
- /// efficiency. By default, fixed objects are immutable. This returns an
- /// index with a negative value.
- ///
- int CreateFixedObject(uint64_t Size, int64_t SPOffset,
- bool Immutable = true);
-
-
- /// isFixedObjectIndex - Returns true if the specified index corresponds to a
- /// fixed stack object.
- bool isFixedObjectIndex(int ObjectIdx) const {
- return ObjectIdx < 0 && (ObjectIdx >= -(int)NumFixedObjects);
- }
-
- /// isImmutableObjectIndex - Returns true if the specified index corresponds
- /// to an immutable object.
- bool isImmutableObjectIndex(int ObjectIdx) const {
- assert(unsigned(ObjectIdx+NumFixedObjects) < Objects.size() &&
- "Invalid Object Idx!");
- return Objects[ObjectIdx+NumFixedObjects].isImmutable;
- }
-
- /// isDeadObjectIndex - Returns true if the specified index corresponds to
- /// a dead object.
- bool isDeadObjectIndex(int ObjectIdx) const {
- assert(unsigned(ObjectIdx+NumFixedObjects) < Objects.size() &&
- "Invalid Object Idx!");
- return Objects[ObjectIdx+NumFixedObjects].Size == ~0ULL;
- }
-
- /// CreateStackObject - Create a new statically sized stack object, returning
- /// a postive identifier to represent it.
- ///
- int CreateStackObject(uint64_t Size, unsigned Alignment) {
- assert(Size != 0 && "Cannot allocate zero size stack objects!");
- Objects.push_back(StackObject(Size, Alignment, -1));
- return (int)Objects.size()-NumFixedObjects-1;
- }
-
- /// RemoveStackObject - Remove or mark dead a statically sized stack object.
- ///
- void RemoveStackObject(int ObjectIdx) {
- if (ObjectIdx == (int)(Objects.size()-NumFixedObjects-1))
- // Last object, simply pop it off the list.
- Objects.pop_back();
- else
- // Mark it dead.
- Objects[ObjectIdx+NumFixedObjects].Size = ~0ULL;
- }
-
- /// CreateVariableSizedObject - Notify the MachineFrameInfo object that a
- /// variable sized object has been created. This must be created whenever a
- /// variable sized object is created, whether or not the index returned is
- /// actually used.
- ///
- int CreateVariableSizedObject() {
- HasVarSizedObjects = true;
- Objects.push_back(StackObject(0, 1, -1));
- return (int)Objects.size()-NumFixedObjects-1;
- }
-
- /// getCalleeSavedInfo - Returns a reference to call saved info vector for the
- /// current function.
- const std::vector<CalleeSavedInfo> &getCalleeSavedInfo() const {
- return CSInfo;
- }
-
- /// setCalleeSavedInfo - Used by prolog/epilog inserter to set the function's
- /// callee saved information.
- void setCalleeSavedInfo(const std::vector<CalleeSavedInfo> &CSI) {
- CSInfo = CSI;
- }
-
- /// getMachineModuleInfo - Used by a prologue/epilogue
- /// emitter (TargetRegisterInfo) to provide frame layout information.
- MachineModuleInfo *getMachineModuleInfo() const { return MMI; }
-
- /// setMachineModuleInfo - Used by a meta info consumer (DwarfWriter) to
- /// indicate that frame layout information should be gathered.
- void setMachineModuleInfo(MachineModuleInfo *mmi) { MMI = mmi; }
-
- /// print - Used by the MachineFunction printer to print information about
- /// stack objects. Implemented in MachineFunction.cpp
- ///
- void print(const MachineFunction &MF, std::ostream &OS) const;
-
- /// dump - Call print(MF, std::cerr) to be called from the debugger.
- void dump(const MachineFunction &MF) const;
-};
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/CodeGen/MachineFunction.h b/release_23/include/llvm/CodeGen/MachineFunction.h
deleted file mode 100644
index 97027da7d679..000000000000
--- a/release_23/include/llvm/CodeGen/MachineFunction.h
+++ /dev/null
@@ -1,322 +0,0 @@
-//===-- llvm/CodeGen/MachineFunction.h --------------------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// Collect native machine code for a function. This class contains a list of
-// MachineBasicBlock instances that make up the current compiled function.
-//
-// This class also contains pointers to various classes which hold
-// target-specific information about the generated code.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_CODEGEN_MACHINEFUNCTION_H
-#define LLVM_CODEGEN_MACHINEFUNCTION_H
-
-#include "llvm/CodeGen/MachineBasicBlock.h"
-#include "llvm/Support/Annotation.h"
-
-namespace llvm {
-
-class Function;
-class TargetMachine;
-class MachineRegisterInfo;
-class MachineFrameInfo;
-class MachineConstantPool;
-class MachineJumpTableInfo;
-
-// ilist_traits
-template <>
-struct ilist_traits<MachineBasicBlock> {
- // this is only set by the MachineFunction owning the ilist
- friend class MachineFunction;
- MachineFunction* Parent;
-
-public:
- ilist_traits<MachineBasicBlock>() : Parent(0) { }
-
- static MachineBasicBlock* getPrev(MachineBasicBlock* N) { return N->Prev; }
- static MachineBasicBlock* getNext(MachineBasicBlock* N) { return N->Next; }
-
- static const MachineBasicBlock*
- getPrev(const MachineBasicBlock* N) { return N->Prev; }
-
- static const MachineBasicBlock*
- getNext(const MachineBasicBlock* N) { return N->Next; }
-
- static void setPrev(MachineBasicBlock* N, MachineBasicBlock* prev) {
- N->Prev = prev;
- }
- static void setNext(MachineBasicBlock* N, MachineBasicBlock* next) {
- N->Next = next;
- }
-
- static MachineBasicBlock* createSentinel();
- static void destroySentinel(MachineBasicBlock *MBB) { delete MBB; }
- void addNodeToList(MachineBasicBlock* N);
- void removeNodeFromList(MachineBasicBlock* N);
- void transferNodesFromList(iplist<MachineBasicBlock,
- ilist_traits<MachineBasicBlock> > &toList,
- ilist_iterator<MachineBasicBlock> first,
- ilist_iterator<MachineBasicBlock> last);
-};
-
-/// MachineFunctionInfo - This class can be derived from and used by targets to
-/// hold private target-specific information for each MachineFunction. Objects
-/// of type are accessed/created with MF::getInfo and destroyed when the
-/// MachineFunction is destroyed.
-struct MachineFunctionInfo {
- virtual ~MachineFunctionInfo() {}
-};
-
-class MachineFunction : private Annotation {
- const Function *Fn;
- const TargetMachine &Target;
-
- // List of machine basic blocks in function
- ilist<MachineBasicBlock> BasicBlocks;
-
- // RegInfo - Information about each register in use in the function.
- MachineRegisterInfo *RegInfo;
-
- // Used to keep track of target-specific per-machine function information for
- // the target implementation.
- MachineFunctionInfo *MFInfo;
-
- // Keep track of objects allocated on the stack.
- MachineFrameInfo *FrameInfo;
-
- // Keep track of constants which are spilled to memory
- MachineConstantPool *ConstantPool;
-
- // Keep track of jump tables for switch instructions
- MachineJumpTableInfo *JumpTableInfo;
-
- // Function-level unique numbering for MachineBasicBlocks. When a
- // MachineBasicBlock is inserted into a MachineFunction is it automatically
- // numbered and this vector keeps track of the mapping from ID's to MBB's.
- std::vector<MachineBasicBlock*> MBBNumbering;
-
-public:
- MachineFunction(const Function *Fn, const TargetMachine &TM);
- ~MachineFunction();
-
- /// getFunction - Return the LLVM function that this machine code represents
- ///
- const Function *getFunction() const { return Fn; }
-
- /// getTarget - Return the target machine this machine code is compiled with
- ///
- const TargetMachine &getTarget() const { return Target; }
-
- /// getRegInfo - Return information about the registers currently in use.
- ///
- MachineRegisterInfo &getRegInfo() const { return *RegInfo; }
-
- /// getFrameInfo - Return the frame info object for the current function.
- /// This object contains information about objects allocated on the stack
- /// frame of the current function in an abstract way.
- ///
- MachineFrameInfo *getFrameInfo() const { return FrameInfo; }
-
- /// getJumpTableInfo - Return the jump table info object for the current
- /// function. This object contains information about jump tables for switch
- /// instructions in the current function.
- ///
- MachineJumpTableInfo *getJumpTableInfo() const { return JumpTableInfo; }
-
- /// getConstantPool - Return the constant pool object for the current
- /// function.
- ///
- MachineConstantPool *getConstantPool() const { return ConstantPool; }
-
- /// MachineFunctionInfo - Keep track of various per-function pieces of
- /// information for backends that would like to do so.
- ///
- template<typename Ty>
- Ty *getInfo() {
- if (!MFInfo) MFInfo = new Ty(*this);
-
- assert((void*)dynamic_cast<Ty*>(MFInfo) == (void*)MFInfo &&
- "Invalid concrete type or multiple inheritence for getInfo");
- return static_cast<Ty*>(MFInfo);
- }
-
- template<typename Ty>
- const Ty *getInfo() const {
- return const_cast<MachineFunction*>(this)->getInfo<Ty>();
- }
-
- /// getBlockNumbered - MachineBasicBlocks are automatically numbered when they
- /// are inserted into the machine function. The block number for a machine
- /// basic block can be found by using the MBB::getBlockNumber method, this
- /// method provides the inverse mapping.
- ///
- MachineBasicBlock *getBlockNumbered(unsigned N) {
- assert(N < MBBNumbering.size() && "Illegal block number");
- assert(MBBNumbering[N] && "Block was removed from the machine function!");
- return MBBNumbering[N];
- }
-
- /// getNumBlockIDs - Return the number of MBB ID's allocated.
- ///
- unsigned getNumBlockIDs() const { return (unsigned)MBBNumbering.size(); }
-
- /// RenumberBlocks - This discards all of the MachineBasicBlock numbers and
- /// recomputes them. This guarantees that the MBB numbers are sequential,
- /// dense, and match the ordering of the blocks within the function. If a
- /// specific MachineBasicBlock is specified, only that block and those after
- /// it are renumbered.
- void RenumberBlocks(MachineBasicBlock *MBBFrom = 0);
-
- /// print - Print out the MachineFunction in a format suitable for debugging
- /// to the specified stream.
- ///
- void print(std::ostream &OS) const;
- void print(std::ostream *OS) const { if (OS) print(*OS); }
-
- /// viewCFG - This function is meant for use from the debugger. You can just
- /// say 'call F->viewCFG()' and a ghostview window should pop up from the
- /// program, displaying the CFG of the current function with the code for each
- /// basic block inside. This depends on there being a 'dot' and 'gv' program
- /// in your path.
- ///
- void viewCFG() const;
-
- /// viewCFGOnly - This function is meant for use from the debugger. It works
- /// just like viewCFG, but it does not include the contents of basic blocks
- /// into the nodes, just the label. If you are only interested in the CFG
- /// this can make the graph smaller.
- ///
- void viewCFGOnly() const;
-
- /// dump - Print the current MachineFunction to cerr, useful for debugger use.
- ///
- void dump() const;
-
- /// construct - Allocate and initialize a MachineFunction for a given Function
- /// and Target
- ///
- static MachineFunction& construct(const Function *F, const TargetMachine &TM);
-
- /// destruct - Destroy the MachineFunction corresponding to a given Function
- ///
- static void destruct(const Function *F);
-
- /// get - Return a handle to a MachineFunction corresponding to the given
- /// Function. This should not be called before "construct()" for a given
- /// Function.
- ///
- static MachineFunction& get(const Function *F);
-
- // Provide accessors for the MachineBasicBlock list...
- typedef ilist<MachineBasicBlock> BasicBlockListType;
- typedef BasicBlockListType::iterator iterator;
- typedef BasicBlockListType::const_iterator const_iterator;
- typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
- typedef std::reverse_iterator<iterator> reverse_iterator;
-
- // Provide accessors for basic blocks...
- const BasicBlockListType &getBasicBlockList() const { return BasicBlocks; }
- BasicBlockListType &getBasicBlockList() { return BasicBlocks; }
-
- //===--------------------------------------------------------------------===//
- // BasicBlock iterator forwarding functions
- //
- iterator begin() { return BasicBlocks.begin(); }
- const_iterator begin() const { return BasicBlocks.begin(); }
- iterator end () { return BasicBlocks.end(); }
- const_iterator end () const { return BasicBlocks.end(); }
-
- reverse_iterator rbegin() { return BasicBlocks.rbegin(); }
- const_reverse_iterator rbegin() const { return BasicBlocks.rbegin(); }
- reverse_iterator rend () { return BasicBlocks.rend(); }
- const_reverse_iterator rend () const { return BasicBlocks.rend(); }
-
- unsigned size() const { return (unsigned)BasicBlocks.size();}
- bool empty() const { return BasicBlocks.empty(); }
- const MachineBasicBlock &front() const { return BasicBlocks.front(); }
- MachineBasicBlock &front() { return BasicBlocks.front(); }
- const MachineBasicBlock & back() const { return BasicBlocks.back(); }
- MachineBasicBlock & back() { return BasicBlocks.back(); }
-
- //===--------------------------------------------------------------------===//
- // Internal functions used to automatically number MachineBasicBlocks
- //
-
- /// getNextMBBNumber - Returns the next unique number to be assigned
- /// to a MachineBasicBlock in this MachineFunction.
- ///
- unsigned addToMBBNumbering(MachineBasicBlock *MBB) {
- MBBNumbering.push_back(MBB);
- return (unsigned)MBBNumbering.size()-1;
- }
-
- /// removeFromMBBNumbering - Remove the specific machine basic block from our
- /// tracker, this is only really to be used by the MachineBasicBlock
- /// implementation.
- void removeFromMBBNumbering(unsigned N) {
- assert(N < MBBNumbering.size() && "Illegal basic block #");
- MBBNumbering[N] = 0;
- }
-};
-
-//===--------------------------------------------------------------------===//
-// GraphTraits specializations for function basic block graphs (CFGs)
-//===--------------------------------------------------------------------===//
-
-// Provide specializations of GraphTraits to be able to treat a
-// machine function as a graph of machine basic blocks... these are
-// the same as the machine basic block iterators, except that the root
-// node is implicitly the first node of the function.
-//
-template <> struct GraphTraits<MachineFunction*> :
- public GraphTraits<MachineBasicBlock*> {
- static NodeType *getEntryNode(MachineFunction *F) {
- return &F->front();
- }
-
- // nodes_iterator/begin/end - Allow iteration over all nodes in the graph
- typedef MachineFunction::iterator nodes_iterator;
- static nodes_iterator nodes_begin(MachineFunction *F) { return F->begin(); }
- static nodes_iterator nodes_end (MachineFunction *F) { return F->end(); }
-};
-template <> struct GraphTraits<const MachineFunction*> :
- public GraphTraits<const MachineBasicBlock*> {
- static NodeType *getEntryNode(const MachineFunction *F) {
- return &F->front();
- }
-
- // nodes_iterator/begin/end - Allow iteration over all nodes in the graph
- typedef MachineFunction::const_iterator nodes_iterator;
- static nodes_iterator nodes_begin(const MachineFunction *F) { return F->begin(); }
- static nodes_iterator nodes_end (const MachineFunction *F) { return F->end(); }
-};
-
-
-// Provide specializations of GraphTraits to be able to treat a function as a
-// graph of basic blocks... and to walk it in inverse order. Inverse order for
-// a function is considered to be when traversing the predecessor edges of a BB
-// instead of the successor edges.
-//
-template <> struct GraphTraits<Inverse<MachineFunction*> > :
- public GraphTraits<Inverse<MachineBasicBlock*> > {
- static NodeType *getEntryNode(Inverse<MachineFunction*> G) {
- return &G.Graph->front();
- }
-};
-template <> struct GraphTraits<Inverse<const MachineFunction*> > :
- public GraphTraits<Inverse<const MachineBasicBlock*> > {
- static NodeType *getEntryNode(Inverse<const MachineFunction *> G) {
- return &G.Graph->front();
- }
-};
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/CodeGen/MachineFunctionPass.h b/release_23/include/llvm/CodeGen/MachineFunctionPass.h
deleted file mode 100644
index a72563fb0af5..000000000000
--- a/release_23/include/llvm/CodeGen/MachineFunctionPass.h
+++ /dev/null
@@ -1,50 +0,0 @@
-//===-- MachineFunctionPass.h - Pass for MachineFunctions --------*-C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines the MachineFunctionPass class. MachineFunctionPass's are
-// just FunctionPass's, except they operate on machine code as part of a code
-// generator. Because they operate on machine code, not the LLVM
-// representation, MachineFunctionPass's are not allowed to modify the LLVM
-// representation. Due to this limitation, the MachineFunctionPass class takes
-// care of declaring that no LLVM passes are invalidated.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_CODEGEN_MACHINE_FUNCTION_PASS_H
-#define LLVM_CODEGEN_MACHINE_FUNCTION_PASS_H
-
-#include "llvm/Pass.h"
-#include "llvm/CodeGen/MachineFunction.h"
-
-namespace llvm {
-
-struct MachineFunctionPass : public FunctionPass {
-
- explicit MachineFunctionPass(intptr_t ID) : FunctionPass(ID) {}
-
-protected:
- /// runOnMachineFunction - This method must be overloaded to perform the
- /// desired machine code transformation or analysis.
- ///
- virtual bool runOnMachineFunction(MachineFunction &MF) = 0;
-
-public:
- // FIXME: This pass should declare that the pass does not invalidate any LLVM
- // passes.
- bool runOnFunction(Function &F) {
- return runOnMachineFunction(MachineFunction::get(&F));
- }
-
-private:
- virtual void virtfn(); // out of line virtual fn to give class a home.
-};
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/CodeGen/MachineInstr.h b/release_23/include/llvm/CodeGen/MachineInstr.h
deleted file mode 100644
index 0c657db6dcb9..000000000000
--- a/release_23/include/llvm/CodeGen/MachineInstr.h
+++ /dev/null
@@ -1,307 +0,0 @@
-//===-- llvm/CodeGen/MachineInstr.h - MachineInstr class --------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains the declaration of the MachineInstr class, which is the
-// basic representation for all target dependent machine instructions used by
-// the back end.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_CODEGEN_MACHINEINSTR_H
-#define LLVM_CODEGEN_MACHINEINSTR_H
-
-#include "llvm/CodeGen/MachineOperand.h"
-#include "llvm/CodeGen/MachineMemOperand.h"
-
-namespace llvm {
-
-class TargetInstrDesc;
-class TargetInstrInfo;
-class TargetRegisterInfo;
-
-template <typename T> struct ilist_traits;
-template <typename T> struct ilist;
-
-//===----------------------------------------------------------------------===//
-/// MachineInstr - Representation of each machine instruction.
-///
-class MachineInstr {
- const TargetInstrDesc *TID; // Instruction descriptor.
- unsigned short NumImplicitOps; // Number of implicit operands (which
- // are determined at construction time).
-
- std::vector<MachineOperand> Operands; // the operands
- std::vector<MachineMemOperand> MemOperands;// information on memory references
- MachineInstr *Prev, *Next; // Links for MBB's intrusive list.
- MachineBasicBlock *Parent; // Pointer to the owning basic block.
-
- // OperandComplete - Return true if it's illegal to add a new operand
- bool OperandsComplete() const;
-
- MachineInstr(const MachineInstr&);
- void operator=(const MachineInstr&); // DO NOT IMPLEMENT
-
- // Intrusive list support
- friend struct ilist_traits<MachineInstr>;
- friend struct ilist_traits<MachineBasicBlock>;
- void setParent(MachineBasicBlock *P) { Parent = P; }
-public:
- /// MachineInstr ctor - This constructor creates a dummy MachineInstr with
- /// TID NULL and no operands.
- MachineInstr();
-
- /// MachineInstr ctor - This constructor create a MachineInstr and add the
- /// implicit operands. It reserves space for number of operands specified by
- /// TargetInstrDesc.
- explicit MachineInstr(const TargetInstrDesc &TID, bool NoImp = false);
-
- /// MachineInstr ctor - Work exactly the same as the ctor above, except that
- /// the MachineInstr is created and added to the end of the specified basic
- /// block.
- ///
- MachineInstr(MachineBasicBlock *MBB, const TargetInstrDesc &TID);
-
- ~MachineInstr();
-
- const MachineBasicBlock* getParent() const { return Parent; }
- MachineBasicBlock* getParent() { return Parent; }
-
- /// getDesc - Returns the target instruction descriptor of this
- /// MachineInstr.
- const TargetInstrDesc &getDesc() const { return *TID; }
-
- /// getOpcode - Returns the opcode of this MachineInstr.
- ///
- int getOpcode() const;
-
- /// Access to explicit operands of the instruction.
- ///
- unsigned getNumOperands() const { return (unsigned)Operands.size(); }
-
- const MachineOperand& getOperand(unsigned i) const {
- assert(i < getNumOperands() && "getOperand() out of range!");
- return Operands[i];
- }
- MachineOperand& getOperand(unsigned i) {
- assert(i < getNumOperands() && "getOperand() out of range!");
- return Operands[i];
- }
-
- /// getNumExplicitOperands - Returns the number of non-implicit operands.
- ///
- unsigned getNumExplicitOperands() const;
-
- /// Access to memory operands of the instruction
- unsigned getNumMemOperands() const { return (unsigned)MemOperands.size(); }
-
- const MachineMemOperand& getMemOperand(unsigned i) const {
- assert(i < getNumMemOperands() && "getMemOperand() out of range!");
- return MemOperands[i];
- }
- MachineMemOperand& getMemOperand(unsigned i) {
- assert(i < getNumMemOperands() && "getMemOperand() out of range!");
- return MemOperands[i];
- }
-
- /// isIdenticalTo - Return true if this instruction is identical to (same
- /// opcode and same operands as) the specified instruction.
- bool isIdenticalTo(const MachineInstr *Other) const {
- if (Other->getOpcode() != getOpcode() ||
- Other->getNumOperands() != getNumOperands())
- return false;
- for (unsigned i = 0, e = getNumOperands(); i != e; ++i)
- if (!getOperand(i).isIdenticalTo(Other->getOperand(i)))
- return false;
- return true;
- }
-
- /// clone - Create a copy of 'this' instruction that is identical in
- /// all ways except the the instruction has no parent, prev, or next.
- MachineInstr* clone() const { return new MachineInstr(*this); }
-
- /// removeFromParent - This method unlinks 'this' from the containing basic
- /// block, and returns it, but does not delete it.
- MachineInstr *removeFromParent();
-
- /// eraseFromParent - This method unlinks 'this' from the containing basic
- /// block and deletes it.
- void eraseFromParent() {
- delete removeFromParent();
- }
-
- /// isDebugLabel - Returns true if the MachineInstr represents a debug label.
- ///
- bool isDebugLabel() const;
-
- /// readsRegister - Return true if the MachineInstr reads the specified
- /// register. If TargetRegisterInfo is passed, then it also checks if there
- /// is a read of a super-register.
- bool readsRegister(unsigned Reg, const TargetRegisterInfo *TRI = NULL) const {
- return findRegisterUseOperandIdx(Reg, false, TRI) != -1;
- }
-
- /// killsRegister - Return true if the MachineInstr kills the specified
- /// register. If TargetRegisterInfo is passed, then it also checks if there is
- /// a kill of a super-register.
- bool killsRegister(unsigned Reg, const TargetRegisterInfo *TRI = NULL) const {
- return findRegisterUseOperandIdx(Reg, true, TRI) != -1;
- }
-
- /// modifiesRegister - Return true if the MachineInstr modifies the
- /// specified register. If TargetRegisterInfo is passed, then it also checks
- /// if there is a def of a super-register.
- bool modifiesRegister(unsigned Reg,
- const TargetRegisterInfo *TRI = NULL) const {
- return findRegisterDefOperandIdx(Reg, false, TRI) != -1;
- }
-
- /// registerDefIsDead - Returns true if the register is dead in this machine
- /// instruction. If TargetRegisterInfo is passed, then it also checks
- /// if there is a dead def of a super-register.
- bool registerDefIsDead(unsigned Reg,
- const TargetRegisterInfo *TRI = NULL) const {
- return findRegisterDefOperandIdx(Reg, true, TRI) != -1;
- }
-
- /// findRegisterUseOperandIdx() - Returns the operand index that is a use of
- /// the specific register or -1 if it is not found. It further tightening
- /// the search criteria to a use that kills the register if isKill is true.
- int findRegisterUseOperandIdx(unsigned Reg, bool isKill = false,
- const TargetRegisterInfo *TRI = NULL) const;
-
- /// findRegisterUseOperand - Wrapper for findRegisterUseOperandIdx, it returns
- /// a pointer to the MachineOperand rather than an index.
- MachineOperand *findRegisterUseOperand(unsigned Reg, bool isKill = false,
- const TargetRegisterInfo *TRI = NULL) {
- int Idx = findRegisterUseOperandIdx(Reg, isKill, TRI);
- return (Idx == -1) ? NULL : &getOperand(Idx);
- }
-
- /// findRegisterDefOperandIdx() - Returns the operand index that is a def of
- /// the specified register or -1 if it is not found. If isDead is true, defs
- /// that are not dead are skipped. If TargetRegisterInfo is non-null, then it
- /// also checks if there is a def of a super-register.
- int findRegisterDefOperandIdx(unsigned Reg, bool isDead = false,
- const TargetRegisterInfo *TRI = NULL) const;
-
- /// findRegisterDefOperand - Wrapper for findRegisterDefOperandIdx, it returns
- /// a pointer to the MachineOperand rather than an index.
- MachineOperand *findRegisterDefOperand(unsigned Reg,bool isDead = false,
- const TargetRegisterInfo *TRI = NULL) {
- int Idx = findRegisterDefOperandIdx(Reg, isDead, TRI);
- return (Idx == -1) ? NULL : &getOperand(Idx);
- }
-
- /// findFirstPredOperandIdx() - Find the index of the first operand in the
- /// operand list that is used to represent the predicate. It returns -1 if
- /// none is found.
- int findFirstPredOperandIdx() const;
-
- /// isRegReDefinedByTwoAddr - Returns true if the Reg re-definition is due
- /// to two addr elimination.
- bool isRegReDefinedByTwoAddr(unsigned Reg) const;
-
- /// copyKillDeadInfo - Copies kill / dead operand properties from MI.
- ///
- void copyKillDeadInfo(const MachineInstr *MI);
-
- /// copyPredicates - Copies predicate operand(s) from MI.
- void copyPredicates(const MachineInstr *MI);
-
- /// addRegisterKilled - We have determined MI kills a register. Look for the
- /// operand that uses it and mark it as IsKill. If AddIfNotFound is true,
- /// add a implicit operand if it's not found. Returns true if the operand
- /// exists / is added.
- bool addRegisterKilled(unsigned IncomingReg,
- const TargetRegisterInfo *RegInfo,
- bool AddIfNotFound = false);
-
- /// addRegisterDead - We have determined MI defined a register without a use.
- /// Look for the operand that defines it and mark it as IsDead. If
- /// AddIfNotFound is true, add a implicit operand if it's not found. Returns
- /// true if the operand exists / is added.
- bool addRegisterDead(unsigned IncomingReg, const TargetRegisterInfo *RegInfo,
- bool AddIfNotFound = false);
-
- /// copyKillDeadInfo - Copies killed/dead information from one instr to another
- void copyKillDeadInfo(MachineInstr *OldMI,
- const TargetRegisterInfo *RegInfo);
-
- /// isSafeToMove - Return true if it is safe to this instruction. If SawStore
- /// true, it means there is a store (or call) between the instruction the
- /// localtion and its intended destination.
- bool isSafeToMove(const TargetInstrInfo *TII, bool &SawStore);
-
- //
- // Debugging support
- //
- void print(std::ostream *OS, const TargetMachine *TM) const {
- if (OS) print(*OS, TM);
- }
- void print(std::ostream &OS, const TargetMachine *TM = 0) const;
- void print(std::ostream *OS) const { if (OS) print(*OS); }
- void dump() const;
-
- //===--------------------------------------------------------------------===//
- // Accessors used to build up machine instructions.
-
- /// addOperand - Add the specified operand to the instruction. If it is an
- /// implicit operand, it is added to the end of the operand list. If it is
- /// an explicit operand it is added at the end of the explicit operand list
- /// (before the first implicit operand).
- void addOperand(const MachineOperand &Op);
-
- /// setDesc - Replace the instruction descriptor (thus opcode) of
- /// the current instruction with a new one.
- ///
- void setDesc(const TargetInstrDesc &tid) { TID = &tid; }
-
- /// RemoveOperand - Erase an operand from an instruction, leaving it with one
- /// fewer operand than it started with.
- ///
- void RemoveOperand(unsigned i);
-
- /// addMemOperand - Add a MachineMemOperand to the machine instruction,
- /// referencing arbitrary storage.
- void addMemOperand(const MachineMemOperand &MO) {
- MemOperands.push_back(MO);
- }
-
-private:
- /// getRegInfo - If this instruction is embedded into a MachineFunction,
- /// return the MachineRegisterInfo object for the current function, otherwise
- /// return null.
- MachineRegisterInfo *getRegInfo();
-
- /// addImplicitDefUseOperands - Add all implicit def and use operands to
- /// this instruction.
- void addImplicitDefUseOperands();
-
- /// RemoveRegOperandsFromUseLists - Unlink all of the register operands in
- /// this instruction from their respective use lists. This requires that the
- /// operands already be on their use lists.
- void RemoveRegOperandsFromUseLists();
-
- /// AddRegOperandsToUseLists - Add all of the register operands in
- /// this instruction from their respective use lists. This requires that the
- /// operands not be on their use lists yet.
- void AddRegOperandsToUseLists(MachineRegisterInfo &RegInfo);
-};
-
-//===----------------------------------------------------------------------===//
-// Debugging Support
-
-inline std::ostream& operator<<(std::ostream &OS, const MachineInstr &MI) {
- MI.print(OS);
- return OS;
-}
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/CodeGen/MachineInstrBuilder.h b/release_23/include/llvm/CodeGen/MachineInstrBuilder.h
deleted file mode 100644
index 748a9b400655..000000000000
--- a/release_23/include/llvm/CodeGen/MachineInstrBuilder.h
+++ /dev/null
@@ -1,155 +0,0 @@
-//===-- CodeGen/MachineInstBuilder.h - Simplify creation of MIs -*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file exposes a function named BuildMI, which is useful for dramatically
-// simplifying how MachineInstr's are created. It allows use of code like this:
-//
-// M = BuildMI(X86::ADDrr8, 2).addReg(argVal1).addReg(argVal2);
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_CODEGEN_MACHINEINSTRBUILDER_H
-#define LLVM_CODEGEN_MACHINEINSTRBUILDER_H
-
-#include "llvm/CodeGen/MachineBasicBlock.h"
-#include "llvm/CodeGen/MachineFunction.h"
-
-namespace llvm {
-
-class TargetInstrDesc;
-
-class MachineInstrBuilder {
- MachineInstr *MI;
-public:
- explicit MachineInstrBuilder(MachineInstr *mi) : MI(mi) {}
-
- /// Allow automatic conversion to the machine instruction we are working on.
- ///
- operator MachineInstr*() const { return MI; }
- operator MachineBasicBlock::iterator() const { return MI; }
-
- /// addReg - Add a new virtual register operand...
- ///
- const
- MachineInstrBuilder &addReg(unsigned RegNo, bool isDef = false,
- bool isImp = false, bool isKill = false,
- bool isDead = false, unsigned SubReg = 0) const {
- MI->addOperand(MachineOperand::CreateReg(RegNo, isDef, isImp, isKill,
- isDead, SubReg));
- return *this;
- }
-
- /// addImm - Add a new immediate operand.
- ///
- const MachineInstrBuilder &addImm(int64_t Val) const {
- MI->addOperand(MachineOperand::CreateImm(Val));
- return *this;
- }
-
- const MachineInstrBuilder &addMBB(MachineBasicBlock *MBB) const {
- MI->addOperand(MachineOperand::CreateMBB(MBB));
- return *this;
- }
-
- const MachineInstrBuilder &addFrameIndex(unsigned Idx) const {
- MI->addOperand(MachineOperand::CreateFI(Idx));
- return *this;
- }
-
- const MachineInstrBuilder &addConstantPoolIndex(unsigned Idx,
- int Offset = 0) const {
- MI->addOperand(MachineOperand::CreateCPI(Idx, Offset));
- return *this;
- }
-
- const MachineInstrBuilder &addJumpTableIndex(unsigned Idx) const {
- MI->addOperand(MachineOperand::CreateJTI(Idx));
- return *this;
- }
-
- const MachineInstrBuilder &addGlobalAddress(GlobalValue *GV,
- int Offset = 0) const {
- MI->addOperand(MachineOperand::CreateGA(GV, Offset));
- return *this;
- }
-
- const MachineInstrBuilder &addExternalSymbol(const char *FnName) const{
- MI->addOperand(MachineOperand::CreateES(FnName, 0));
- return *this;
- }
-
- /// addMemOperand - Add a memory operand to the machine instruction.
- const MachineInstrBuilder &addMemOperand(const MachineMemOperand &MO) const {
- MI->addMemOperand(MO);
- return *this;
- }
-};
-
-/// BuildMI - Builder interface. Specify how to create the initial instruction
-/// itself.
-///
-inline MachineInstrBuilder BuildMI(const TargetInstrDesc &TID) {
- return MachineInstrBuilder(new MachineInstr(TID));
-}
-
-/// BuildMI - This version of the builder sets up the first operand as a
-/// destination virtual register.
-///
-inline MachineInstrBuilder BuildMI(const TargetInstrDesc &TID,
- unsigned DestReg) {
- return MachineInstrBuilder(new MachineInstr(TID)).addReg(DestReg, true);
-}
-
-/// BuildMI - This version of the builder inserts the newly-built
-/// instruction before the given position in the given MachineBasicBlock, and
-/// sets up the first operand as a destination virtual register.
-///
-inline MachineInstrBuilder BuildMI(MachineBasicBlock &BB,
- MachineBasicBlock::iterator I,
- const TargetInstrDesc &TID,
- unsigned DestReg) {
- MachineInstr *MI = new MachineInstr(TID);
- BB.insert(I, MI);
- return MachineInstrBuilder(MI).addReg(DestReg, true);
-}
-
-/// BuildMI - This version of the builder inserts the newly-built
-/// instruction before the given position in the given MachineBasicBlock, and
-/// does NOT take a destination register.
-///
-inline MachineInstrBuilder BuildMI(MachineBasicBlock &BB,
- MachineBasicBlock::iterator I,
- const TargetInstrDesc &TID) {
- MachineInstr *MI = new MachineInstr(TID);
- BB.insert(I, MI);
- return MachineInstrBuilder(MI);
-}
-
-/// BuildMI - This version of the builder inserts the newly-built
-/// instruction at the end of the given MachineBasicBlock, and does NOT take a
-/// destination register.
-///
-inline MachineInstrBuilder BuildMI(MachineBasicBlock *BB,
- const TargetInstrDesc &TID) {
- return BuildMI(*BB, BB->end(), TID);
-}
-
-/// BuildMI - This version of the builder inserts the newly-built
-/// instruction at the end of the given MachineBasicBlock, and sets up the first
-/// operand as a destination virtual register.
-///
-inline MachineInstrBuilder BuildMI(MachineBasicBlock *BB,
- const TargetInstrDesc &TID,
- unsigned DestReg) {
- return BuildMI(*BB, BB->end(), TID, DestReg);
-}
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/CodeGen/MachineJumpTableInfo.h b/release_23/include/llvm/CodeGen/MachineJumpTableInfo.h
deleted file mode 100644
index e0acb27f46b5..000000000000
--- a/release_23/include/llvm/CodeGen/MachineJumpTableInfo.h
+++ /dev/null
@@ -1,104 +0,0 @@
-//===-- CodeGen/MachineJumpTableInfo.h - Abstract Jump Tables --*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// The MachineJumpTableInfo class keeps track of jump tables referenced by
-// lowered switch instructions in the MachineFunction.
-//
-// Instructions reference the address of these jump tables through the use of
-// MO_JumpTableIndex values. When emitting assembly or machine code, these
-// virtual address references are converted to refer to the address of the
-// function jump tables.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_CODEGEN_MACHINEJUMPTABLEINFO_H
-#define LLVM_CODEGEN_MACHINEJUMPTABLEINFO_H
-
-#include <vector>
-#include <iosfwd>
-#include <cassert>
-
-namespace llvm {
-
-class MachineBasicBlock;
-class TargetData;
-
-/// MachineJumpTableEntry - One jump table in the jump table info.
-///
-struct MachineJumpTableEntry {
- /// MBBs - The vector of basic blocks from which to create the jump table.
- std::vector<MachineBasicBlock*> MBBs;
-
- explicit MachineJumpTableEntry(const std::vector<MachineBasicBlock*> &M)
- : MBBs(M) {}
-};
-
-class MachineJumpTableInfo {
- unsigned EntrySize;
- unsigned Alignment;
- std::vector<MachineJumpTableEntry> JumpTables;
-public:
- MachineJumpTableInfo(unsigned Size, unsigned Align)
- : EntrySize(Size), Alignment(Align) {}
-
- /// getJumpTableIndex - Create a new jump table or return an existing one.
- ///
- unsigned getJumpTableIndex(const std::vector<MachineBasicBlock*> &DestBBs);
-
- /// isEmpty - Return true if there are no jump tables.
- ///
- bool isEmpty() const { return JumpTables.empty(); }
-
- const std::vector<MachineJumpTableEntry> &getJumpTables() const {
- return JumpTables;
- }
-
- /// RemoveJumpTable - Mark the specific index as being dead. This will cause
- /// it to not be emitted.
- void RemoveJumpTable(unsigned Idx) {
- JumpTables[Idx].MBBs.clear();
- }
-
- /// ReplaceMBBInJumpTables - If Old is the target of any jump tables, update
- /// the jump tables to branch to New instead.
- bool ReplaceMBBInJumpTables(MachineBasicBlock *Old, MachineBasicBlock *New) {
- assert(Old != New && "Not making a change?");
- bool MadeChange = false;
- for (size_t i = 0, e = JumpTables.size(); i != e; ++i) {
- MachineJumpTableEntry &JTE = JumpTables[i];
- for (size_t j = 0, e = JTE.MBBs.size(); j != e; ++j)
- if (JTE.MBBs[j] == Old) {
- JTE.MBBs[j] = New;
- MadeChange = true;
- }
- }
- return MadeChange;
- }
-
- /// getEntrySize - Returns the size of an individual field in a jump table.
- ///
- unsigned getEntrySize() const { return EntrySize; }
-
- /// getAlignment - returns the target's preferred alignment for jump tables
- unsigned getAlignment() const { return Alignment; }
-
- /// print - Used by the MachineFunction printer to print information about
- /// jump tables. Implemented in MachineFunction.cpp
- ///
- void print(std::ostream &OS) const;
- void print(std::ostream *OS) const { if (OS) print(*OS); }
-
- /// dump - Call print(std::cerr) to be called from the debugger.
- ///
- void dump() const;
-};
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/CodeGen/MachineLocation.h b/release_23/include/llvm/CodeGen/MachineLocation.h
deleted file mode 100644
index 51c429597428..000000000000
--- a/release_23/include/llvm/CodeGen/MachineLocation.h
+++ /dev/null
@@ -1,106 +0,0 @@
-//===-- llvm/CodeGen/MachineLocation.h --------------------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-// The MachineLocation class is used to represent a simple location in a machine
-// frame. Locations will be one of two forms; a register or an address formed
-// from a base address plus an offset. Register indirection can be specified by
-// using an offset of zero.
-//
-// The MachineMove class is used to represent abstract move operations in the
-// prolog/epilog of a compiled function. A collection of these objects can be
-// used by a debug consumer to track the location of values when unwinding stack
-// frames.
-//===----------------------------------------------------------------------===//
-
-
-#ifndef LLVM_CODEGEN_MACHINELOCATION_H
-#define LLVM_CODEGEN_MACHINELOCATION_H
-
-namespace llvm {
-
-class MachineLocation {
-private:
- bool IsRegister; // True if location is a register.
- unsigned Register; // gcc/gdb register number.
- int Offset; // Displacement if not register.
-
-public:
- enum {
- // The target register number for an abstract frame pointer. The value is
- // an arbitrary value greater than TargetRegisterInfo::FirstVirtualRegister.
- VirtualFP = ~0U
- };
- MachineLocation()
- : IsRegister(false)
- , Register(0)
- , Offset(0)
- {}
- explicit MachineLocation(unsigned R)
- : IsRegister(true)
- , Register(R)
- , Offset(0)
- {}
- MachineLocation(unsigned R, int O)
- : IsRegister(false)
- , Register(R)
- , Offset(O)
- {}
-
- // Accessors
- bool isRegister() const { return IsRegister; }
- unsigned getRegister() const { return Register; }
- int getOffset() const { return Offset; }
- void setIsRegister(bool Is) { IsRegister = Is; }
- void setRegister(unsigned R) { Register = R; }
- void setOffset(int O) { Offset = O; }
- void set(unsigned R) {
- IsRegister = true;
- Register = R;
- Offset = 0;
- }
- void set(unsigned R, int O) {
- IsRegister = false;
- Register = R;
- Offset = O;
- }
-
-#ifndef NDEBUG
- void dump();
-#endif
-};
-
-class MachineMove {
-private:
- unsigned LabelID; // Label ID number for post-instruction
- // address when result of move takes
- // effect.
- MachineLocation Destination; // Move to location.
- MachineLocation Source; // Move from location.
-
-public:
- MachineMove()
- : LabelID(0)
- , Destination()
- , Source()
- {}
-
- MachineMove(unsigned ID, MachineLocation &D, MachineLocation &S)
- : LabelID(ID)
- , Destination(D)
- , Source(S)
- {}
-
- // Accessors
- unsigned getLabelID() const { return LabelID; }
- const MachineLocation &getDestination() const { return Destination; }
- const MachineLocation &getSource() const { return Source; }
-};
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/CodeGen/MachineLoopInfo.h b/release_23/include/llvm/CodeGen/MachineLoopInfo.h
deleted file mode 100644
index 8b46825f2570..000000000000
--- a/release_23/include/llvm/CodeGen/MachineLoopInfo.h
+++ /dev/null
@@ -1,190 +0,0 @@
-//===- llvm/CodeGen/MachineLoopInfo.h - Natural Loop Calculator -*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines the MachineLoopInfo class that is used to identify natural
-// loops and determine the loop depth of various nodes of the CFG. Note that
-// natural loops may actually be several loops that share the same header node.
-//
-// This analysis calculates the nesting structure of loops in a function. For
-// each natural loop identified, this analysis identifies natural loops
-// contained entirely within the loop and the basic blocks the make up the loop.
-//
-// It can calculate on the fly various bits of information, for example:
-//
-// * whether there is a preheader for the loop
-// * the number of back edges to the header
-// * whether or not a particular block branches out of the loop
-// * the successor blocks of the loop
-// * the loop depth
-// * the trip count
-// * etc...
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_CODEGEN_MACHINE_LOOP_INFO_H
-#define LLVM_CODEGEN_MACHINE_LOOP_INFO_H
-
-#include "llvm/CodeGen/MachineFunctionPass.h"
-#include "llvm/CodeGen/MachineBasicBlock.h"
-#include "llvm/CodeGen/MachineFunction.h"
-#include "llvm/CodeGen/MachineInstr.h"
-#include "llvm/Analysis/LoopInfo.h"
-
-namespace llvm {
-
-// Provide overrides for Loop methods that don't make sense for machine loops.
-template<> inline
-PHINode *LoopBase<MachineBasicBlock>::getCanonicalInductionVariable() const {
- assert(0 && "getCanonicalInductionVariable not supported for machine loops!");
- return 0;
-}
-
-template<> inline Instruction*
-LoopBase<MachineBasicBlock>::getCanonicalInductionVariableIncrement() const {
- assert(0 &&
- "getCanonicalInductionVariableIncrement not supported for machine loops!");
- return 0;
-}
-
-template<>
-inline bool LoopBase<MachineBasicBlock>::isLoopInvariant(Value *V) const {
- assert(0 && "isLoopInvariant not supported for machine loops!");
- return false;
-}
-
-template<>
-inline Value *LoopBase<MachineBasicBlock>::getTripCount() const {
- assert(0 && "getTripCount not supported for machine loops!");
- return 0;
-}
-
-template<>
-inline bool LoopBase<MachineBasicBlock>::isLCSSAForm() const {
- assert(0 && "isLCSSAForm not supported for machine loops");
- return false;
-}
-
-typedef LoopBase<MachineBasicBlock> MachineLoop;
-
-class MachineLoopInfo : public MachineFunctionPass {
- LoopInfoBase<MachineBasicBlock>* LI;
- friend class LoopBase<MachineBasicBlock>;
-
- LoopInfoBase<MachineBasicBlock>& getBase() { return *LI; }
-public:
- static char ID; // Pass identification, replacement for typeid
-
- MachineLoopInfo() : MachineFunctionPass(intptr_t(&ID)) {
- LI = new LoopInfoBase<MachineBasicBlock>();
- }
-
- ~MachineLoopInfo() { delete LI; }
-
- /// iterator/begin/end - The interface to the top-level loops in the current
- /// function.
- ///
- typedef std::vector<MachineLoop*>::const_iterator iterator;
- inline iterator begin() const { return LI->begin(); }
- inline iterator end() const { return LI->end(); }
-
- /// getLoopFor - Return the inner most loop that BB lives in. If a basic
- /// block is in no loop (for example the entry node), null is returned.
- ///
- inline MachineLoop *getLoopFor(const MachineBasicBlock *BB) const {
- return LI->getLoopFor(BB);
- }
-
- /// operator[] - same as getLoopFor...
- ///
- inline const MachineLoop *operator[](const MachineBasicBlock *BB) const {
- return LI->getLoopFor(BB);
- }
-
- /// getLoopDepth - Return the loop nesting level of the specified block...
- ///
- inline unsigned getLoopDepth(const MachineBasicBlock *BB) const {
- return LI->getLoopDepth(BB);
- }
-
- // isLoopHeader - True if the block is a loop header node
- inline bool isLoopHeader(MachineBasicBlock *BB) const {
- return LI->isLoopHeader(BB);
- }
-
- /// runOnFunction - Calculate the natural loop information.
- ///
- virtual bool runOnMachineFunction(MachineFunction &F);
-
- virtual void releaseMemory() { LI->releaseMemory(); }
-
- virtual void getAnalysisUsage(AnalysisUsage &AU) const;
-
- /// removeLoop - This removes the specified top-level loop from this loop info
- /// object. The loop is not deleted, as it will presumably be inserted into
- /// another loop.
- inline MachineLoop *removeLoop(iterator I) { return LI->removeLoop(I); }
-
- /// changeLoopFor - Change the top-level loop that contains BB to the
- /// specified loop. This should be used by transformations that restructure
- /// the loop hierarchy tree.
- inline void changeLoopFor(MachineBasicBlock *BB, MachineLoop *L) {
- LI->changeLoopFor(BB, L);
- }
-
- /// changeTopLevelLoop - Replace the specified loop in the top-level loops
- /// list with the indicated loop.
- inline void changeTopLevelLoop(MachineLoop *OldLoop, MachineLoop *NewLoop) {
- LI->changeTopLevelLoop(OldLoop, NewLoop);
- }
-
- /// addTopLevelLoop - This adds the specified loop to the collection of
- /// top-level loops.
- inline void addTopLevelLoop(MachineLoop *New) {
- LI->addTopLevelLoop(New);
- }
-
- /// removeBlock - This method completely removes BB from all data structures,
- /// including all of the Loop objects it is nested in and our mapping from
- /// MachineBasicBlocks to loops.
- void removeBlock(MachineBasicBlock *BB) {
- LI->removeBlock(BB);
- }
-};
-
-
-// Allow clients to walk the list of nested loops...
-template <> struct GraphTraits<const MachineLoop*> {
- typedef const MachineLoop NodeType;
- typedef std::vector<MachineLoop*>::const_iterator ChildIteratorType;
-
- static NodeType *getEntryNode(const MachineLoop *L) { return L; }
- static inline ChildIteratorType child_begin(NodeType *N) {
- return N->begin();
- }
- static inline ChildIteratorType child_end(NodeType *N) {
- return N->end();
- }
-};
-
-template <> struct GraphTraits<MachineLoop*> {
- typedef MachineLoop NodeType;
- typedef std::vector<MachineLoop*>::const_iterator ChildIteratorType;
-
- static NodeType *getEntryNode(MachineLoop *L) { return L; }
- static inline ChildIteratorType child_begin(NodeType *N) {
- return N->begin();
- }
- static inline ChildIteratorType child_end(NodeType *N) {
- return N->end();
- }
-};
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/CodeGen/MachineMemOperand.h b/release_23/include/llvm/CodeGen/MachineMemOperand.h
deleted file mode 100644
index 404de0689a03..000000000000
--- a/release_23/include/llvm/CodeGen/MachineMemOperand.h
+++ /dev/null
@@ -1,83 +0,0 @@
-//==- llvm/CodeGen/MachineMemOperand.h - MachineMemOperand class -*- C++ -*-==//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains the declaration of the MachineMemOperand class, which is a
-// description of a memory reference. It is used to help track dependencies
-// in the backend.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_CODEGEN_MEMOPERAND_H
-#define LLVM_CODEGEN_MEMOPERAND_H
-
-namespace llvm {
-
-class Value;
-
-//===----------------------------------------------------------------------===//
-/// MachineMemOperand - A description of a memory reference used in the backend.
-/// Instead of holding a StoreInst or LoadInst, this class holds the address
-/// Value of the reference along with a byte size and offset. This allows it
-/// to describe lowered loads and stores. Also, the special PseudoSourceValue
-/// objects can be used to represent loads and stores to memory locations
-/// that aren't explicit in the regular LLVM IR.
-///
-class MachineMemOperand {
- const Value *V;
- unsigned int Flags;
- int64_t Offset;
- uint64_t Size;
- unsigned int Alignment;
-
-public:
- /// Flags values. These may be or'd together.
- enum MemOperandFlags {
- /// The memory access reads data.
- MOLoad = 1,
- /// The memory access writes data.
- MOStore = 2,
- /// The memory access is volatile.
- MOVolatile = 4
- };
-
- /// MachineMemOperand - Construct an MachineMemOperand object with the
- /// specified address Value, flags, offset, size, and alignment.
- MachineMemOperand(const Value *v, unsigned int f, int64_t o, uint64_t s,
- unsigned int a)
- : V(v), Flags(f), Offset(o), Size(s), Alignment(a) {}
-
- /// getValue - Return the base address of the memory access.
- /// Special values are PseudoSourceValue::FPRel, PseudoSourceValue::SPRel,
- /// and the other PseudoSourceValue members which indicate references to
- /// frame/stack pointer relative references and other special references.
- const Value *getValue() const { return V; }
-
- /// getFlags - Return the raw flags of the source value, \see MemOperandFlags.
- unsigned int getFlags() const { return Flags; }
-
- /// getOffset - For normal values, this is a byte offset added to the base
- /// address. For PseudoSourceValue::FPRel values, this is the FrameIndex
- /// number.
- int64_t getOffset() const { return Offset; }
-
- /// getSize - Return the size in bytes of the memory reference.
- uint64_t getSize() const { return Size; }
-
- /// getAlignment - Return the minimum known alignment in bytes of the
- /// memory reference.
- unsigned int getAlignment() const { return Alignment; }
-
- bool isLoad() const { return Flags & MOLoad; }
- bool isStore() const { return Flags & MOStore; }
- bool isVolatile() const { return Flags & MOVolatile; }
-};
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/CodeGen/MachineModuleInfo.h b/release_23/include/llvm/CodeGen/MachineModuleInfo.h
deleted file mode 100644
index b7066f4c6572..000000000000
--- a/release_23/include/llvm/CodeGen/MachineModuleInfo.h
+++ /dev/null
@@ -1,1305 +0,0 @@
-//===-- llvm/CodeGen/MachineModuleInfo.h ------------------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// Collect meta information for a module. This information should be in a
-// neutral form that can be used by different debugging and exception handling
-// schemes.
-//
-// The organization of information is primarily clustered around the source
-// compile units. The main exception is source line correspondence where
-// inlining may interleave code from various compile units.
-//
-// The following information can be retrieved from the MachineModuleInfo.
-//
-// -- Source directories - Directories are uniqued based on their canonical
-// string and assigned a sequential numeric ID (base 1.)
-// -- Source files - Files are also uniqued based on their name and directory
-// ID. A file ID is sequential number (base 1.)
-// -- Source line correspondence - A vector of file ID, line#, column# triples.
-// A DEBUG_LOCATION instruction is generated by the DAG Legalizer
-// corresponding to each entry in the source line list. This allows a debug
-// emitter to generate labels referenced by debug information tables.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_CODEGEN_MACHINEMODULEINFO_H
-#define LLVM_CODEGEN_MACHINEMODULEINFO_H
-
-#include "llvm/Support/Dwarf.h"
-#include "llvm/Support/DataTypes.h"
-#include "llvm/ADT/SmallVector.h"
-#include "llvm/ADT/UniqueVector.h"
-#include "llvm/ADT/SmallPtrSet.h"
-#include "llvm/GlobalValue.h"
-#include "llvm/Pass.h"
-
-namespace llvm {
-
-//===----------------------------------------------------------------------===//
-// Forward declarations.
-class Constant;
-class DebugInfoDesc;
-class GlobalVariable;
-class MachineBasicBlock;
-class MachineFunction;
-class MachineMove;
-class Module;
-class PointerType;
-class StructType;
-
-//===----------------------------------------------------------------------===//
-// Debug info constants.
-
-enum {
- LLVMDebugVersion = (6 << 16), // Current version of debug information.
- LLVMDebugVersion5 = (5 << 16), // Constant for version 5.
- LLVMDebugVersion4 = (4 << 16), // Constant for version 4.
- LLVMDebugVersionMask = 0xffff0000 // Mask for version number.
-};
-
-//===----------------------------------------------------------------------===//
-/// DIVisitor - Subclasses of this class apply steps to each of the fields in
-/// the supplied DebugInfoDesc.
-class DIVisitor {
-public:
- DIVisitor() {}
- virtual ~DIVisitor() {}
-
- /// ApplyToFields - Target the visitor to each field of the debug information
- /// descriptor.
- void ApplyToFields(DebugInfoDesc *DD);
-
- /// Apply - Subclasses override each of these methods to perform the
- /// appropriate action for the type of field.
- virtual void Apply(int &Field) = 0;
- virtual void Apply(unsigned &Field) = 0;
- virtual void Apply(int64_t &Field) = 0;
- virtual void Apply(uint64_t &Field) = 0;
- virtual void Apply(bool &Field) = 0;
- virtual void Apply(std::string &Field) = 0;
- virtual void Apply(DebugInfoDesc *&Field) = 0;
- virtual void Apply(GlobalVariable *&Field) = 0;
- virtual void Apply(std::vector<DebugInfoDesc *> &Field) = 0;
-};
-
-//===----------------------------------------------------------------------===//
-/// DebugInfoDesc - This class is the base class for debug info descriptors.
-///
-class DebugInfoDesc {
-private:
- unsigned Tag; // Content indicator. Dwarf values are
- // used but that does not limit use to
- // Dwarf writers.
-
-protected:
- explicit DebugInfoDesc(unsigned T) : Tag(T | LLVMDebugVersion) {}
-
-public:
- virtual ~DebugInfoDesc() {}
-
- // Accessors
- unsigned getTag() const { return Tag & ~LLVMDebugVersionMask; }
- unsigned getVersion() const { return Tag & LLVMDebugVersionMask; }
- void setTag(unsigned T) { Tag = T | LLVMDebugVersion; }
-
- /// TagFromGlobal - Returns the tag number from a debug info descriptor
- /// GlobalVariable. Return DIIValid if operand is not an unsigned int.
- static unsigned TagFromGlobal(GlobalVariable *GV);
-
- /// VersionFromGlobal - Returns the version number from a debug info
- /// descriptor GlobalVariable. Return DIIValid if operand is not an unsigned
- /// int.
- static unsigned VersionFromGlobal(GlobalVariable *GV);
-
- /// DescFactory - Create an instance of debug info descriptor based on Tag.
- /// Return NULL if not a recognized Tag.
- static DebugInfoDesc *DescFactory(unsigned Tag);
-
- /// getLinkage - get linkage appropriate for this type of descriptor.
- ///
- virtual GlobalValue::LinkageTypes getLinkage() const;
-
- //===--------------------------------------------------------------------===//
- // Subclasses should supply the following static methods.
-
- // Implement isa/cast/dyncast.
- static bool classof(const DebugInfoDesc *) { return true; }
-
- //===--------------------------------------------------------------------===//
- // Subclasses should supply the following virtual methods.
-
- /// ApplyToFields - Target the vistor to the fields of the descriptor.
- ///
- virtual void ApplyToFields(DIVisitor *Visitor);
-
- /// getDescString - Return a string used to compose global names and labels.
- ///
- virtual const char *getDescString() const = 0;
-
- /// getTypeString - Return a string used to label this descriptor's type.
- ///
- virtual const char *getTypeString() const = 0;
-
-#ifndef NDEBUG
- virtual void dump() = 0;
-#endif
-};
-
-//===----------------------------------------------------------------------===//
-/// AnchorDesc - Descriptors of this class act as markers for identifying
-/// descriptors of certain groups.
-class AnchoredDesc;
-class AnchorDesc : public DebugInfoDesc {
-private:
- unsigned AnchorTag; // Tag number of descriptors anchored
- // by this object.
-
-public:
- AnchorDesc();
- explicit AnchorDesc(AnchoredDesc *D);
-
- // Accessors
- unsigned getAnchorTag() const { return AnchorTag; }
-
- // Implement isa/cast/dyncast.
- static bool classof(const AnchorDesc *) { return true; }
- static bool classof(const DebugInfoDesc *D);
-
- /// getLinkage - get linkage appropriate for this type of descriptor.
- ///
- virtual GlobalValue::LinkageTypes getLinkage() const;
-
- /// ApplyToFields - Target the visitor to the fields of the AnchorDesc.
- ///
- virtual void ApplyToFields(DIVisitor *Visitor);
-
- /// getDescString - Return a string used to compose global names and labels.
- ///
- virtual const char *getDescString() const;
-
- /// getTypeString - Return a string used to label this descriptor's type.
- ///
- virtual const char *getTypeString() const;
-
-#ifndef NDEBUG
- virtual void dump();
-#endif
-};
-
-//===----------------------------------------------------------------------===//
-/// AnchoredDesc - This class manages anchors for a variety of top level
-/// descriptors.
-class AnchoredDesc : public DebugInfoDesc {
-private:
- DebugInfoDesc *Anchor; // Anchor for all descriptors of the
- // same type.
-
-protected:
-
- explicit AnchoredDesc(unsigned T);
-
-public:
- // Accessors.
- AnchorDesc *getAnchor() const { return static_cast<AnchorDesc *>(Anchor); }
- void setAnchor(AnchorDesc *A) { Anchor = static_cast<DebugInfoDesc *>(A); }
-
- //===--------------------------------------------------------------------===//
- // Subclasses should supply the following virtual methods.
-
- /// getAnchorString - Return a string used to label descriptor's anchor.
- ///
- virtual const char *getAnchorString() const = 0;
-
- /// ApplyToFields - Target the visitor to the fields of the AnchoredDesc.
- ///
- virtual void ApplyToFields(DIVisitor *Visitor);
-};
-
-//===----------------------------------------------------------------------===//
-/// CompileUnitDesc - This class packages debug information associated with a
-/// source/header file.
-class CompileUnitDesc : public AnchoredDesc {
-private:
- unsigned Language; // Language number (ex. DW_LANG_C89.)
- std::string FileName; // Source file name.
- std::string Directory; // Source file directory.
- std::string Producer; // Compiler string.
-
-public:
- CompileUnitDesc();
-
-
- // Accessors
- unsigned getLanguage() const { return Language; }
- const std::string &getFileName() const { return FileName; }
- const std::string &getDirectory() const { return Directory; }
- const std::string &getProducer() const { return Producer; }
- void setLanguage(unsigned L) { Language = L; }
- void setFileName(const std::string &FN) { FileName = FN; }
- void setDirectory(const std::string &D) { Directory = D; }
- void setProducer(const std::string &P) { Producer = P; }
-
- // FIXME - Need translation unit getter/setter.
-
- // Implement isa/cast/dyncast.
- static bool classof(const CompileUnitDesc *) { return true; }
- static bool classof(const DebugInfoDesc *D);
-
- /// ApplyToFields - Target the visitor to the fields of the CompileUnitDesc.
- ///
- virtual void ApplyToFields(DIVisitor *Visitor);
-
- /// getDescString - Return a string used to compose global names and labels.
- ///
- virtual const char *getDescString() const;
-
- /// getTypeString - Return a string used to label this descriptor's type.
- ///
- virtual const char *getTypeString() const;
-
- /// getAnchorString - Return a string used to label this descriptor's anchor.
- ///
- static const char *const AnchorString;
- virtual const char *getAnchorString() const;
-
-#ifndef NDEBUG
- virtual void dump();
-#endif
-};
-
-//===----------------------------------------------------------------------===//
-/// TypeDesc - This class packages debug information associated with a type.
-///
-class TypeDesc : public DebugInfoDesc {
-private:
- enum {
- FlagPrivate = 1 << 0,
- FlagProtected = 1 << 1
- };
- DebugInfoDesc *Context; // Context debug descriptor.
- std::string Name; // Type name (may be empty.)
- DebugInfoDesc *File; // Defined compile unit (may be NULL.)
- unsigned Line; // Defined line# (may be zero.)
- uint64_t Size; // Type bit size (may be zero.)
- uint64_t Align; // Type bit alignment (may be zero.)
- uint64_t Offset; // Type bit offset (may be zero.)
- unsigned Flags; // Miscellaneous flags.
-
-public:
- explicit TypeDesc(unsigned T);
-
- // Accessors
- DebugInfoDesc *getContext() const { return Context; }
- const std::string &getName() const { return Name; }
- CompileUnitDesc *getFile() const {
- return static_cast<CompileUnitDesc *>(File);
- }
- unsigned getLine() const { return Line; }
- uint64_t getSize() const { return Size; }
- uint64_t getAlign() const { return Align; }
- uint64_t getOffset() const { return Offset; }
- bool isPrivate() const {
- return (Flags & FlagPrivate) != 0;
- }
- bool isProtected() const {
- return (Flags & FlagProtected) != 0;
- }
- void setContext(DebugInfoDesc *C) { Context = C; }
- void setName(const std::string &N) { Name = N; }
- void setFile(CompileUnitDesc *U) {
- File = static_cast<DebugInfoDesc *>(U);
- }
- void setLine(unsigned L) { Line = L; }
- void setSize(uint64_t S) { Size = S; }
- void setAlign(uint64_t A) { Align = A; }
- void setOffset(uint64_t O) { Offset = O; }
- void setIsPrivate() { Flags |= FlagPrivate; }
- void setIsProtected() { Flags |= FlagProtected; }
-
- /// ApplyToFields - Target the visitor to the fields of the TypeDesc.
- ///
- virtual void ApplyToFields(DIVisitor *Visitor);
-
- /// getDescString - Return a string used to compose global names and labels.
- ///
- virtual const char *getDescString() const;
-
- /// getTypeString - Return a string used to label this descriptor's type.
- ///
- virtual const char *getTypeString() const;
-
-#ifndef NDEBUG
- virtual void dump();
-#endif
-};
-
-//===----------------------------------------------------------------------===//
-/// BasicTypeDesc - This class packages debug information associated with a
-/// basic type (eg. int, bool, double.)
-class BasicTypeDesc : public TypeDesc {
-private:
- unsigned Encoding; // Type encoding.
-
-public:
- BasicTypeDesc();
-
- // Accessors
- unsigned getEncoding() const { return Encoding; }
- void setEncoding(unsigned E) { Encoding = E; }
-
- // Implement isa/cast/dyncast.
- static bool classof(const BasicTypeDesc *) { return true; }
- static bool classof(const DebugInfoDesc *D);
-
- /// ApplyToFields - Target the visitor to the fields of the BasicTypeDesc.
- ///
- virtual void ApplyToFields(DIVisitor *Visitor);
-
- /// getDescString - Return a string used to compose global names and labels.
- ///
- virtual const char *getDescString() const;
-
- /// getTypeString - Return a string used to label this descriptor's type.
- ///
- virtual const char *getTypeString() const;
-
-#ifndef NDEBUG
- virtual void dump();
-#endif
-};
-
-
-//===----------------------------------------------------------------------===//
-/// DerivedTypeDesc - This class packages debug information associated with a
-/// derived types (eg., typedef, pointer, reference.)
-class DerivedTypeDesc : public TypeDesc {
-private:
- DebugInfoDesc *FromType; // Type derived from.
-
-public:
- explicit DerivedTypeDesc(unsigned T);
-
- // Accessors
- TypeDesc *getFromType() const {
- return static_cast<TypeDesc *>(FromType);
- }
- void setFromType(TypeDesc *F) {
- FromType = static_cast<DebugInfoDesc *>(F);
- }
-
- // Implement isa/cast/dyncast.
- static bool classof(const DerivedTypeDesc *) { return true; }
- static bool classof(const DebugInfoDesc *D);
-
- /// ApplyToFields - Target the visitor to the fields of the DerivedTypeDesc.
- ///
- virtual void ApplyToFields(DIVisitor *Visitor);
-
- /// getDescString - Return a string used to compose global names and labels.
- ///
- virtual const char *getDescString() const;
-
- /// getTypeString - Return a string used to label this descriptor's type.
- ///
- virtual const char *getTypeString() const;
-
-#ifndef NDEBUG
- virtual void dump();
-#endif
-};
-
-//===----------------------------------------------------------------------===//
-/// CompositeTypeDesc - This class packages debug information associated with a
-/// array/struct types (eg., arrays, struct, union, enums.)
-class CompositeTypeDesc : public DerivedTypeDesc {
-private:
- std::vector<DebugInfoDesc *> Elements;// Information used to compose type.
-
-public:
- explicit CompositeTypeDesc(unsigned T);
-
- // Accessors
- std::vector<DebugInfoDesc *> &getElements() { return Elements; }
-
- // Implement isa/cast/dyncast.
- static bool classof(const CompositeTypeDesc *) { return true; }
- static bool classof(const DebugInfoDesc *D);
-
- /// ApplyToFields - Target the visitor to the fields of the CompositeTypeDesc.
- ///
- virtual void ApplyToFields(DIVisitor *Visitor);
-
- /// getDescString - Return a string used to compose global names and labels.
- ///
- virtual const char *getDescString() const;
-
- /// getTypeString - Return a string used to label this descriptor's type.
- ///
- virtual const char *getTypeString() const;
-
-#ifndef NDEBUG
- virtual void dump();
-#endif
-};
-
-//===----------------------------------------------------------------------===//
-/// SubrangeDesc - This class packages debug information associated with integer
-/// value ranges.
-class SubrangeDesc : public DebugInfoDesc {
-private:
- int64_t Lo; // Low value of range.
- int64_t Hi; // High value of range.
-
-public:
- SubrangeDesc();
-
- // Accessors
- int64_t getLo() const { return Lo; }
- int64_t getHi() const { return Hi; }
- void setLo(int64_t L) { Lo = L; }
- void setHi(int64_t H) { Hi = H; }
-
- // Implement isa/cast/dyncast.
- static bool classof(const SubrangeDesc *) { return true; }
- static bool classof(const DebugInfoDesc *D);
-
- /// ApplyToFields - Target the visitor to the fields of the SubrangeDesc.
- ///
- virtual void ApplyToFields(DIVisitor *Visitor);
-
- /// getDescString - Return a string used to compose global names and labels.
- ///
- virtual const char *getDescString() const;
-
- /// getTypeString - Return a string used to label this descriptor's type.
- ///
- virtual const char *getTypeString() const;
-
-#ifndef NDEBUG
- virtual void dump();
-#endif
-};
-
-//===----------------------------------------------------------------------===//
-/// EnumeratorDesc - This class packages debug information associated with
-/// named integer constants.
-class EnumeratorDesc : public DebugInfoDesc {
-private:
- std::string Name; // Enumerator name.
- int64_t Value; // Enumerator value.
-
-public:
- EnumeratorDesc();
-
- // Accessors
- const std::string &getName() const { return Name; }
- int64_t getValue() const { return Value; }
- void setName(const std::string &N) { Name = N; }
- void setValue(int64_t V) { Value = V; }
-
- // Implement isa/cast/dyncast.
- static bool classof(const EnumeratorDesc *) { return true; }
- static bool classof(const DebugInfoDesc *D);
-
- /// ApplyToFields - Target the visitor to the fields of the EnumeratorDesc.
- ///
- virtual void ApplyToFields(DIVisitor *Visitor);
-
- /// getDescString - Return a string used to compose global names and labels.
- ///
- virtual const char *getDescString() const;
-
- /// getTypeString - Return a string used to label this descriptor's type.
- ///
- virtual const char *getTypeString() const;
-
-#ifndef NDEBUG
- virtual void dump();
-#endif
-};
-
-//===----------------------------------------------------------------------===//
-/// VariableDesc - This class packages debug information associated with a
-/// subprogram variable.
-///
-class VariableDesc : public DebugInfoDesc {
-private:
- DebugInfoDesc *Context; // Context debug descriptor.
- std::string Name; // Type name (may be empty.)
- DebugInfoDesc *File; // Defined compile unit (may be NULL.)
- unsigned Line; // Defined line# (may be zero.)
- DebugInfoDesc *TyDesc; // Type of variable.
-
-public:
- explicit VariableDesc(unsigned T);
-
- // Accessors
- DebugInfoDesc *getContext() const { return Context; }
- const std::string &getName() const { return Name; }
- CompileUnitDesc *getFile() const {
- return static_cast<CompileUnitDesc *>(File);
- }
- unsigned getLine() const { return Line; }
- TypeDesc *getType() const {
- return static_cast<TypeDesc *>(TyDesc);
- }
- void setContext(DebugInfoDesc *C) { Context = C; }
- void setName(const std::string &N) { Name = N; }
- void setFile(CompileUnitDesc *U) {
- File = static_cast<DebugInfoDesc *>(U);
- }
- void setLine(unsigned L) { Line = L; }
- void setType(TypeDesc *T) {
- TyDesc = static_cast<DebugInfoDesc *>(T);
- }
-
- // Implement isa/cast/dyncast.
- static bool classof(const VariableDesc *) { return true; }
- static bool classof(const DebugInfoDesc *D);
-
- /// ApplyToFields - Target the visitor to the fields of the VariableDesc.
- ///
- virtual void ApplyToFields(DIVisitor *Visitor);
-
- /// getDescString - Return a string used to compose global names and labels.
- ///
- virtual const char *getDescString() const;
-
- /// getTypeString - Return a string used to label this descriptor's type.
- ///
- virtual const char *getTypeString() const;
-
-#ifndef NDEBUG
- virtual void dump();
-#endif
-};
-
-//===----------------------------------------------------------------------===//
-/// GlobalDesc - This class is the base descriptor for global functions and
-/// variables.
-class GlobalDesc : public AnchoredDesc {
-private:
- DebugInfoDesc *Context; // Context debug descriptor.
- std::string Name; // Global name.
- std::string FullName; // Fully qualified name.
- std::string LinkageName; // Name for binding to MIPS linkage.
- DebugInfoDesc *File; // Defined compile unit (may be NULL.)
- unsigned Line; // Defined line# (may be zero.)
- DebugInfoDesc *TyDesc; // Type debug descriptor.
- bool IsStatic; // Is the global a static.
- bool IsDefinition; // Is the global defined in context.
-
-protected:
- explicit GlobalDesc(unsigned T);
-
-public:
- // Accessors
- DebugInfoDesc *getContext() const { return Context; }
- const std::string &getName() const { return Name; }
- const std::string &getFullName() const { return FullName; }
- const std::string &getLinkageName() const { return LinkageName; }
- CompileUnitDesc *getFile() const {
- return static_cast<CompileUnitDesc *>(File);
- }
- unsigned getLine() const { return Line; }
- TypeDesc *getType() const {
- return static_cast<TypeDesc *>(TyDesc);
- }
- bool isStatic() const { return IsStatic; }
- bool isDefinition() const { return IsDefinition; }
- void setContext(DebugInfoDesc *C) { Context = C; }
- void setName(const std::string &N) { Name = N; }
- void setFullName(const std::string &N) { FullName = N; }
- void setLinkageName(const std::string &N) { LinkageName = N; }
- void setFile(CompileUnitDesc *U) {
- File = static_cast<DebugInfoDesc *>(U);
- }
- void setLine(unsigned L) { Line = L; }
- void setType(TypeDesc *T) {
- TyDesc = static_cast<DebugInfoDesc *>(T);
- }
- void setIsStatic(bool IS) { IsStatic = IS; }
- void setIsDefinition(bool ID) { IsDefinition = ID; }
-
- /// ApplyToFields - Target the visitor to the fields of the GlobalDesc.
- ///
- virtual void ApplyToFields(DIVisitor *Visitor);
-};
-
-//===----------------------------------------------------------------------===//
-/// GlobalVariableDesc - This class packages debug information associated with a
-/// GlobalVariable.
-class GlobalVariableDesc : public GlobalDesc {
-private:
- GlobalVariable *Global; // llvm global.
-
-public:
- GlobalVariableDesc();
-
- // Accessors.
- GlobalVariable *getGlobalVariable() const { return Global; }
- void setGlobalVariable(GlobalVariable *GV) { Global = GV; }
-
- // Implement isa/cast/dyncast.
- static bool classof(const GlobalVariableDesc *) { return true; }
- static bool classof(const DebugInfoDesc *D);
-
- /// ApplyToFields - Target the visitor to the fields of the
- /// GlobalVariableDesc.
- virtual void ApplyToFields(DIVisitor *Visitor);
-
- /// getDescString - Return a string used to compose global names and labels.
- ///
- virtual const char *getDescString() const;
-
- /// getTypeString - Return a string used to label this descriptor's type.
- ///
- virtual const char *getTypeString() const;
-
- /// getAnchorString - Return a string used to label this descriptor's anchor.
- ///
- static const char *const AnchorString;
- virtual const char *getAnchorString() const;
-
-#ifndef NDEBUG
- virtual void dump();
-#endif
-};
-
-//===----------------------------------------------------------------------===//
-/// SubprogramDesc - This class packages debug information associated with a
-/// subprogram/function.
-class SubprogramDesc : public GlobalDesc {
-private:
-
-public:
- SubprogramDesc();
-
- // Accessors
-
- // Implement isa/cast/dyncast.
- static bool classof(const SubprogramDesc *) { return true; }
- static bool classof(const DebugInfoDesc *D);
-
- /// ApplyToFields - Target the visitor to the fields of the SubprogramDesc.
- ///
- virtual void ApplyToFields(DIVisitor *Visitor);
-
- /// getDescString - Return a string used to compose global names and labels.
- ///
- virtual const char *getDescString() const;
-
- /// getTypeString - Return a string used to label this descriptor's type.
- ///
- virtual const char *getTypeString() const;
-
- /// getAnchorString - Return a string used to label this descriptor's anchor.
- ///
- static const char *const AnchorString;
- virtual const char *getAnchorString() const;
-
-#ifndef NDEBUG
- virtual void dump();
-#endif
-};
-
-//===----------------------------------------------------------------------===//
-/// BlockDesc - This descriptor groups variables and blocks nested in a block.
-///
-class BlockDesc : public DebugInfoDesc {
-private:
- DebugInfoDesc *Context; // Context debug descriptor.
-
-public:
- BlockDesc();
-
- // Accessors
- DebugInfoDesc *getContext() const { return Context; }
- void setContext(DebugInfoDesc *C) { Context = C; }
-
- // Implement isa/cast/dyncast.
- static bool classof(const BlockDesc *) { return true; }
- static bool classof(const DebugInfoDesc *D);
-
- /// ApplyToFields - Target the visitor to the fields of the BlockDesc.
- ///
- virtual void ApplyToFields(DIVisitor *Visitor);
-
- /// getDescString - Return a string used to compose global names and labels.
- ///
- virtual const char *getDescString() const;
-
- /// getTypeString - Return a string used to label this descriptor's type.
- ///
- virtual const char *getTypeString() const;
-
-#ifndef NDEBUG
- virtual void dump();
-#endif
-};
-
-//===----------------------------------------------------------------------===//
-/// DIDeserializer - This class is responsible for casting GlobalVariables
-/// into DebugInfoDesc objects.
-class DIDeserializer {
-private:
- std::map<GlobalVariable *, DebugInfoDesc *> GlobalDescs;
- // Previously defined gloabls.
-
-public:
- DIDeserializer() {}
- ~DIDeserializer() {}
-
- const std::map<GlobalVariable *, DebugInfoDesc *> &getGlobalDescs() const {
- return GlobalDescs;
- }
-
- /// Deserialize - Reconstitute a GlobalVariable into it's component
- /// DebugInfoDesc objects.
- DebugInfoDesc *Deserialize(Value *V);
- DebugInfoDesc *Deserialize(GlobalVariable *GV);
-};
-
-//===----------------------------------------------------------------------===//
-/// DISerializer - This class is responsible for casting DebugInfoDesc objects
-/// into GlobalVariables.
-class DISerializer {
-private:
- Module *M; // Definition space module.
- PointerType *StrPtrTy; // A "i8*" type. Created lazily.
- PointerType *EmptyStructPtrTy; // A "{ }*" type. Created lazily.
- std::map<unsigned, StructType *> TagTypes;
- // Types per Tag. Created lazily.
- std::map<DebugInfoDesc *, GlobalVariable *> DescGlobals;
- // Previously defined descriptors.
- std::map<const std::string, Constant *> StringCache;
- // Previously defined strings.
-
-public:
- DISerializer()
- : M(NULL)
- , StrPtrTy(NULL)
- , EmptyStructPtrTy(NULL)
- , TagTypes()
- , DescGlobals()
- , StringCache()
- {}
- ~DISerializer() {}
-
- // Accessors
- Module *getModule() const { return M; };
- void setModule(Module *module) { M = module; }
-
- /// getStrPtrType - Return a "i8*" type.
- ///
- const PointerType *getStrPtrType();
-
- /// getEmptyStructPtrType - Return a "{ }*" type.
- ///
- const PointerType *getEmptyStructPtrType();
-
- /// getTagType - Return the type describing the specified descriptor (via
- /// tag.)
- const StructType *getTagType(DebugInfoDesc *DD);
-
- /// getString - Construct the string as constant string global.
- ///
- Constant *getString(const std::string &String);
-
- /// Serialize - Recursively cast the specified descriptor into a
- /// GlobalVariable so that it can be serialized to a .bc or .ll file.
- GlobalVariable *Serialize(DebugInfoDesc *DD);
-
- /// addDescriptor - Directly connect DD with existing GV.
- void addDescriptor(DebugInfoDesc *DD, GlobalVariable *GV);
-};
-
-//===----------------------------------------------------------------------===//
-/// DIVerifier - This class is responsible for verifying the given network of
-/// GlobalVariables are valid as DebugInfoDesc objects.
-class DIVerifier {
-private:
- enum {
- Unknown = 0,
- Invalid,
- Valid
- };
- std::map<GlobalVariable *, unsigned> Validity;// Tracks prior results.
- std::map<unsigned, unsigned> Counts; // Count of fields per Tag type.
-
-public:
- DIVerifier()
- : Validity()
- , Counts()
- {}
- ~DIVerifier() {}
-
- /// Verify - Return true if the GlobalVariable appears to be a valid
- /// serialization of a DebugInfoDesc.
- bool Verify(Value *V);
- bool Verify(GlobalVariable *GV);
-
- /// isVerified - Return true if the specified GV has already been
- /// verified as a debug information descriptor.
- bool isVerified(GlobalVariable *GV);
-};
-
-//===----------------------------------------------------------------------===//
-/// SourceLineInfo - This class is used to record source line correspondence.
-///
-class SourceLineInfo {
-private:
- unsigned Line; // Source line number.
- unsigned Column; // Source column.
- unsigned SourceID; // Source ID number.
- unsigned LabelID; // Label in code ID number.
-
-public:
- SourceLineInfo(unsigned L, unsigned C, unsigned S, unsigned I)
- : Line(L), Column(C), SourceID(S), LabelID(I) {}
-
- // Accessors
- unsigned getLine() const { return Line; }
- unsigned getColumn() const { return Column; }
- unsigned getSourceID() const { return SourceID; }
- unsigned getLabelID() const { return LabelID; }
-};
-
-//===----------------------------------------------------------------------===//
-/// SourceFileInfo - This class is used to track source information.
-///
-class SourceFileInfo {
-private:
- unsigned DirectoryID; // Directory ID number.
- std::string Name; // File name (not including directory.)
-
-public:
- SourceFileInfo(unsigned D, const std::string &N) : DirectoryID(D), Name(N) {}
-
- // Accessors
- unsigned getDirectoryID() const { return DirectoryID; }
- const std::string &getName() const { return Name; }
-
- /// operator== - Used by UniqueVector to locate entry.
- ///
- bool operator==(const SourceFileInfo &SI) const {
- return getDirectoryID() == SI.getDirectoryID() && getName() == SI.getName();
- }
-
- /// operator< - Used by UniqueVector to locate entry.
- ///
- bool operator<(const SourceFileInfo &SI) const {
- return getDirectoryID() < SI.getDirectoryID() ||
- (getDirectoryID() == SI.getDirectoryID() && getName() < SI.getName());
- }
-};
-
-//===----------------------------------------------------------------------===//
-/// DebugVariable - This class is used to track local variable information.
-///
-class DebugVariable {
-private:
- VariableDesc *Desc; // Variable Descriptor.
- unsigned FrameIndex; // Variable frame index.
-
-public:
- DebugVariable(VariableDesc *D, unsigned I)
- : Desc(D)
- , FrameIndex(I)
- {}
-
- // Accessors.
- VariableDesc *getDesc() const { return Desc; }
- unsigned getFrameIndex() const { return FrameIndex; }
-};
-
-//===----------------------------------------------------------------------===//
-/// DebugScope - This class is used to track scope information.
-///
-class DebugScope {
-private:
- DebugScope *Parent; // Parent to this scope.
- DebugInfoDesc *Desc; // Debug info descriptor for scope.
- // Either subprogram or block.
- unsigned StartLabelID; // Label ID of the beginning of scope.
- unsigned EndLabelID; // Label ID of the end of scope.
- std::vector<DebugScope *> Scopes; // Scopes defined in scope.
- std::vector<DebugVariable *> Variables;// Variables declared in scope.
-
-public:
- DebugScope(DebugScope *P, DebugInfoDesc *D)
- : Parent(P)
- , Desc(D)
- , StartLabelID(0)
- , EndLabelID(0)
- , Scopes()
- , Variables()
- {}
- ~DebugScope();
-
- // Accessors.
- DebugScope *getParent() const { return Parent; }
- DebugInfoDesc *getDesc() const { return Desc; }
- unsigned getStartLabelID() const { return StartLabelID; }
- unsigned getEndLabelID() const { return EndLabelID; }
- std::vector<DebugScope *> &getScopes() { return Scopes; }
- std::vector<DebugVariable *> &getVariables() { return Variables; }
- void setStartLabelID(unsigned S) { StartLabelID = S; }
- void setEndLabelID(unsigned E) { EndLabelID = E; }
-
- /// AddScope - Add a scope to the scope.
- ///
- void AddScope(DebugScope *S) { Scopes.push_back(S); }
-
- /// AddVariable - Add a variable to the scope.
- ///
- void AddVariable(DebugVariable *V) { Variables.push_back(V); }
-};
-
-//===----------------------------------------------------------------------===//
-/// LandingPadInfo - This structure is used to retain landing pad info for
-/// the current function.
-///
-struct LandingPadInfo {
- MachineBasicBlock *LandingPadBlock; // Landing pad block.
- SmallVector<unsigned, 1> BeginLabels; // Labels prior to invoke.
- SmallVector<unsigned, 1> EndLabels; // Labels after invoke.
- unsigned LandingPadLabel; // Label at beginning of landing pad.
- Function *Personality; // Personality function.
- std::vector<int> TypeIds; // List of type ids (filters negative)
-
- explicit LandingPadInfo(MachineBasicBlock *MBB)
- : LandingPadBlock(MBB)
- , LandingPadLabel(0)
- , Personality(NULL)
- {}
-};
-
-//===----------------------------------------------------------------------===//
-/// MachineModuleInfo - This class contains meta information specific to a
-/// module. Queries can be made by different debugging and exception handling
-/// schemes and reformated for specific use.
-///
-class MachineModuleInfo : public ImmutablePass {
-private:
- // Use the same deserializer/verifier for the module.
- DIDeserializer DR;
- DIVerifier VR;
-
- // CompileUnits - Uniquing vector for compile units.
- UniqueVector<CompileUnitDesc *> CompileUnits;
-
- // Directories - Uniquing vector for directories.
- UniqueVector<std::string> Directories;
-
- // SourceFiles - Uniquing vector for source files.
- UniqueVector<SourceFileInfo> SourceFiles;
-
- // Lines - List of of source line correspondence.
- std::vector<SourceLineInfo> Lines;
-
- // LabelIDList - One entry per assigned label. Normally the entry is equal to
- // the list index(+1). If the entry is zero then the label has been deleted.
- // Any other value indicates the label has been deleted by is mapped to
- // another label.
- std::vector<unsigned> LabelIDList;
-
- // ScopeMap - Tracks the scopes in the current function.
- std::map<DebugInfoDesc *, DebugScope *> ScopeMap;
-
- // RootScope - Top level scope for the current function.
- //
- DebugScope *RootScope;
-
- // FrameMoves - List of moves done by a function's prolog. Used to construct
- // frame maps by debug and exception handling consumers.
- std::vector<MachineMove> FrameMoves;
-
- // LandingPads - List of LandingPadInfo describing the landing pad information
- // in the current function.
- std::vector<LandingPadInfo> LandingPads;
-
- // TypeInfos - List of C++ TypeInfo used in the current function.
- //
- std::vector<GlobalVariable *> TypeInfos;
-
- // FilterIds - List of typeids encoding filters used in the current function.
- //
- std::vector<unsigned> FilterIds;
-
- // FilterEnds - List of the indices in FilterIds corresponding to filter
- // terminators.
- //
- std::vector<unsigned> FilterEnds;
-
- // Personalities - Vector of all personality functions ever seen. Used to emit
- // common EH frames.
- std::vector<Function *> Personalities;
-
- // UsedFunctions - the functions in the llvm.used list in a more easily
- // searchable format.
- SmallPtrSet<const Function *, 32> UsedFunctions;
-
- bool CallsEHReturn;
- bool CallsUnwindInit;
-public:
- static char ID; // Pass identification, replacement for typeid
-
- MachineModuleInfo();
- ~MachineModuleInfo();
-
- /// doInitialization - Initialize the state for a new module.
- ///
- bool doInitialization();
-
- /// doFinalization - Tear down the state after completion of a module.
- ///
- bool doFinalization();
-
- /// BeginFunction - Begin gathering function meta information.
- ///
- void BeginFunction(MachineFunction *MF);
-
- /// EndFunction - Discard function meta information.
- ///
- void EndFunction();
-
- /// getDescFor - Convert a Value to a debug information descriptor.
- ///
- // FIXME - use new Value type when available.
- DebugInfoDesc *getDescFor(Value *V);
-
- /// Verify - Verify that a Value is debug information descriptor.
- ///
- bool Verify(Value *V) { return VR.Verify(V); }
-
- /// isVerified - Return true if the specified GV has already been
- /// verified as a debug information descriptor.
- bool isVerified(GlobalVariable *GV) { return VR.isVerified(GV); }
-
- /// AnalyzeModule - Scan the module for global debug information.
- ///
- void AnalyzeModule(Module &M);
-
- /// hasDebugInfo - Returns true if valid debug info is present.
- ///
- bool hasDebugInfo() const { return !CompileUnits.empty(); }
-
- bool callsEHReturn() const { return CallsEHReturn; }
- void setCallsEHReturn(bool b) { CallsEHReturn = b; }
-
- bool callsUnwindInit() const { return CallsUnwindInit; }
- void setCallsUnwindInit(bool b) { CallsUnwindInit = b; }
-
- /// NextLabelID - Return the next unique label id.
- ///
- unsigned NextLabelID() {
- unsigned ID = (unsigned)LabelIDList.size() + 1;
- LabelIDList.push_back(ID);
- return ID;
- }
-
- /// RecordSourceLine - Records location information and associates it with a
- /// label. Returns a unique label ID used to generate a label and
- /// provide correspondence to the source line list.
- unsigned RecordSourceLine(unsigned Line, unsigned Column, unsigned Source);
-
- /// InvalidateLabel - Inhibit use of the specified label # from
- /// MachineModuleInfo, for example because the code was deleted.
- void InvalidateLabel(unsigned LabelID) {
- // Remap to zero to indicate deletion.
- RemapLabel(LabelID, 0);
- }
-
- /// RemapLabel - Indicate that a label has been merged into another.
- ///
- void RemapLabel(unsigned OldLabelID, unsigned NewLabelID) {
- assert(0 < OldLabelID && OldLabelID <= LabelIDList.size() &&
- "Old label ID out of range.");
- assert(NewLabelID <= LabelIDList.size() &&
- "New label ID out of range.");
- LabelIDList[OldLabelID - 1] = NewLabelID;
- }
-
- /// MappedLabel - Find out the label's final ID. Zero indicates deletion.
- /// ID != Mapped ID indicates that the label was folded into another label.
- unsigned MappedLabel(unsigned LabelID) const {
- assert(LabelID <= LabelIDList.size() && "Debug label ID out of range.");
- return LabelID ? LabelIDList[LabelID - 1] : 0;
- }
-
- /// RecordSource - Register a source file with debug info. Returns an source
- /// ID.
- unsigned RecordSource(const std::string &Directory,
- const std::string &Source);
- unsigned RecordSource(const CompileUnitDesc *CompileUnit);
-
- /// getDirectories - Return the UniqueVector of std::string representing
- /// directories.
- const UniqueVector<std::string> &getDirectories() const {
- return Directories;
- }
-
- /// getSourceFiles - Return the UniqueVector of source files.
- ///
- const UniqueVector<SourceFileInfo> &getSourceFiles() const {
- return SourceFiles;
- }
-
- /// getSourceLines - Return a vector of source lines.
- ///
- const std::vector<SourceLineInfo> &getSourceLines() const {
- return Lines;
- }
-
- /// SetupCompileUnits - Set up the unique vector of compile units.
- ///
- void SetupCompileUnits(Module &M);
-
- /// getCompileUnits - Return a vector of debug compile units.
- ///
- const UniqueVector<CompileUnitDesc *> getCompileUnits() const;
-
- /// getGlobalVariablesUsing - Return all of the GlobalVariables that use the
- /// named GlobalVariable.
- std::vector<GlobalVariable*>
- getGlobalVariablesUsing(Module &M, const std::string &RootName);
-
- /// getAnchoredDescriptors - Return a vector of anchored debug descriptors.
- ///
- template <class T>std::vector<T *> getAnchoredDescriptors(Module &M) {
- T Desc;
- std::vector<GlobalVariable *> Globals =
- getGlobalVariablesUsing(M, Desc.getAnchorString());
- std::vector<T *> AnchoredDescs;
- for (unsigned i = 0, N = Globals.size(); i < N; ++i) {
- GlobalVariable *GV = Globals[i];
-
- // FIXME - In the short term, changes are too drastic to continue.
- if (DebugInfoDesc::TagFromGlobal(GV) == Desc.getTag() &&
- DebugInfoDesc::VersionFromGlobal(GV) == LLVMDebugVersion) {
- AnchoredDescs.push_back(cast<T>(DR.Deserialize(GV)));
- }
- }
-
- return AnchoredDescs;
- }
-
- /// RecordRegionStart - Indicate the start of a region.
- ///
- unsigned RecordRegionStart(Value *V);
-
- /// RecordRegionEnd - Indicate the end of a region.
- ///
- unsigned RecordRegionEnd(Value *V);
-
- /// RecordVariable - Indicate the declaration of a local variable.
- ///
- void RecordVariable(GlobalValue *GV, unsigned FrameIndex);
-
- /// getRootScope - Return current functions root scope.
- ///
- DebugScope *getRootScope() { return RootScope; }
-
- /// getOrCreateScope - Returns the scope associated with the given descriptor.
- ///
- DebugScope *getOrCreateScope(DebugInfoDesc *ScopeDesc);
-
- /// getFrameMoves - Returns a reference to a list of moves done in the current
- /// function's prologue. Used to construct frame maps for debug and exception
- /// handling comsumers.
- std::vector<MachineMove> &getFrameMoves() { return FrameMoves; }
-
- //===-EH-----------------------------------------------------------------===//
-
- /// getOrCreateLandingPadInfo - Find or create an LandingPadInfo for the
- /// specified MachineBasicBlock.
- LandingPadInfo &getOrCreateLandingPadInfo(MachineBasicBlock *LandingPad);
-
- /// addInvoke - Provide the begin and end labels of an invoke style call and
- /// associate it with a try landing pad block.
- void addInvoke(MachineBasicBlock *LandingPad, unsigned BeginLabel,
- unsigned EndLabel);
-
- /// addLandingPad - Add a new panding pad. Returns the label ID for the
- /// landing pad entry.
- unsigned addLandingPad(MachineBasicBlock *LandingPad);
-
- /// addPersonality - Provide the personality function for the exception
- /// information.
- void addPersonality(MachineBasicBlock *LandingPad, Function *Personality);
-
- /// getPersonalityIndex - Get index of the current personality function inside
- /// Personalitites array
- unsigned getPersonalityIndex() const;
-
- /// getPersonalities - Return array of personality functions ever seen.
- const std::vector<Function *>& getPersonalities() const {
- return Personalities;
- }
-
- // UsedFunctions - Return set of the functions in the llvm.used list.
- const SmallPtrSet<const Function *, 32>& getUsedFunctions() const {
- return UsedFunctions;
- }
-
- /// addCatchTypeInfo - Provide the catch typeinfo for a landing pad.
- ///
- void addCatchTypeInfo(MachineBasicBlock *LandingPad,
- std::vector<GlobalVariable *> &TyInfo);
-
- /// addFilterTypeInfo - Provide the filter typeinfo for a landing pad.
- ///
- void addFilterTypeInfo(MachineBasicBlock *LandingPad,
- std::vector<GlobalVariable *> &TyInfo);
-
- /// addCleanup - Add a cleanup action for a landing pad.
- ///
- void addCleanup(MachineBasicBlock *LandingPad);
-
- /// getTypeIDFor - Return the type id for the specified typeinfo. This is
- /// function wide.
- unsigned getTypeIDFor(GlobalVariable *TI);
-
- /// getFilterIDFor - Return the id of the filter encoded by TyIds. This is
- /// function wide.
- int getFilterIDFor(std::vector<unsigned> &TyIds);
-
- /// TidyLandingPads - Remap landing pad labels and remove any deleted landing
- /// pads.
- void TidyLandingPads();
-
- /// getLandingPads - Return a reference to the landing pad info for the
- /// current function.
- const std::vector<LandingPadInfo> &getLandingPads() const {
- return LandingPads;
- }
-
- /// getTypeInfos - Return a reference to the C++ typeinfo for the current
- /// function.
- const std::vector<GlobalVariable *> &getTypeInfos() const {
- return TypeInfos;
- }
-
- /// getFilterIds - Return a reference to the typeids encoding filters used in
- /// the current function.
- const std::vector<unsigned> &getFilterIds() const {
- return FilterIds;
- }
-
- /// getPersonality - Return a personality function if available. The presence
- /// of one is required to emit exception handling info.
- Function *getPersonality() const;
-
- DIDeserializer *getDIDeserializer() { return &DR; }
-}; // End class MachineModuleInfo
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/CodeGen/MachineOperand.h b/release_23/include/llvm/CodeGen/MachineOperand.h
deleted file mode 100644
index d62c8f8b4749..000000000000
--- a/release_23/include/llvm/CodeGen/MachineOperand.h
+++ /dev/null
@@ -1,431 +0,0 @@
-//===-- llvm/CodeGen/MachineOperand.h - MachineOperand class ----*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains the declaration of the MachineOperand class.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_CODEGEN_MACHINEOPERAND_H
-#define LLVM_CODEGEN_MACHINEOPERAND_H
-
-#include "llvm/Support/DataTypes.h"
-#include <vector>
-#include <cassert>
-#include <iosfwd>
-
-namespace llvm {
-
-class ConstantFP;
-class MachineBasicBlock;
-class GlobalValue;
-class MachineInstr;
-class TargetMachine;
-class MachineRegisterInfo;
-
-/// MachineOperand class - Representation of each machine instruction operand.
-///
-class MachineOperand {
-public:
- enum MachineOperandType {
- MO_Register, // Register operand.
- MO_Immediate, // Immediate Operand
- MO_FPImmediate,
- MO_MachineBasicBlock, // MachineBasicBlock reference
- MO_FrameIndex, // Abstract Stack Frame Index
- MO_ConstantPoolIndex, // Address of indexed Constant in Constant Pool
- MO_JumpTableIndex, // Address of indexed Jump Table for switch
- MO_ExternalSymbol, // Name of external global symbol
- MO_GlobalAddress // Address of a global value
- };
-
-private:
- /// OpKind - Specify what kind of operand this is. This discriminates the
- /// union.
- MachineOperandType OpKind : 8;
-
- /// IsDef/IsImp/IsKill/IsDead flags - These are only valid for MO_Register
- /// operands.
-
- /// IsDef - True if this is a def, false if this is a use of the register.
- ///
- bool IsDef : 1;
-
- /// IsImp - True if this is an implicit def or use, false if it is explicit.
- ///
- bool IsImp : 1;
-
- /// IsKill - True if this instruction is the last use of the register on this
- /// path through the function. This is only valid on uses of registers.
- bool IsKill : 1;
-
- /// IsDead - True if this register is never used by a subsequent instruction.
- /// This is only valid on definitions of registers.
- bool IsDead : 1;
-
- /// SubReg - Subregister number, only valid for MO_Register. A value of 0
- /// indicates the MO_Register has no subReg.
- unsigned char SubReg;
-
- /// ParentMI - This is the instruction that this operand is embedded into.
- /// This is valid for all operand types, when the operand is in an instr.
- MachineInstr *ParentMI;
-
- /// Contents union - This contains the payload for the various operand types.
- union {
- MachineBasicBlock *MBB; // For MO_MachineBasicBlock.
- ConstantFP *CFP; // For MO_FPImmediate.
- int64_t ImmVal; // For MO_Immediate.
-
- struct { // For MO_Register.
- unsigned RegNo;
- MachineOperand **Prev; // Access list for register.
- MachineOperand *Next;
- } Reg;
-
- /// OffsetedInfo - This struct contains the offset and an object identifier.
- /// this represent the object as with an optional offset from it.
- struct {
- union {
- int Index; // For MO_*Index - The index itself.
- const char *SymbolName; // For MO_ExternalSymbol.
- GlobalValue *GV; // For MO_GlobalAddress.
- } Val;
- int Offset; // An offset from the object.
- } OffsetedInfo;
- } Contents;
-
- explicit MachineOperand(MachineOperandType K) : OpKind(K), ParentMI(0) {}
-public:
- MachineOperand(const MachineOperand &M) {
- *this = M;
- }
-
- ~MachineOperand() {}
-
- /// getType - Returns the MachineOperandType for this operand.
- ///
- MachineOperandType getType() const { return OpKind; }
-
- /// getParent - Return the instruction that this operand belongs to.
- ///
- MachineInstr *getParent() { return ParentMI; }
- const MachineInstr *getParent() const { return ParentMI; }
-
- void print(std::ostream &os, const TargetMachine *TM = 0) const;
-
- /// Accessors that tell you what kind of MachineOperand you're looking at.
- ///
- bool isRegister() const { return OpKind == MO_Register; }
- bool isImmediate() const { return OpKind == MO_Immediate; }
- bool isFPImmediate() const { return OpKind == MO_FPImmediate; }
- bool isMachineBasicBlock() const { return OpKind == MO_MachineBasicBlock; }
- bool isFrameIndex() const { return OpKind == MO_FrameIndex; }
- bool isConstantPoolIndex() const { return OpKind == MO_ConstantPoolIndex; }
- bool isJumpTableIndex() const { return OpKind == MO_JumpTableIndex; }
- bool isGlobalAddress() const { return OpKind == MO_GlobalAddress; }
- bool isExternalSymbol() const { return OpKind == MO_ExternalSymbol; }
-
- bool isReg() const { return OpKind == MO_Register; }
- bool isImm() const { return OpKind == MO_Immediate; }
- bool isMBB() const { return OpKind == MO_MachineBasicBlock; }
- bool isFI() const { return OpKind == MO_FrameIndex; }
- bool isCPI() const { return OpKind == MO_ConstantPoolIndex; }
- bool isJTI() const { return OpKind == MO_JumpTableIndex; }
- bool isGlobal() const { return OpKind == MO_GlobalAddress; }
- bool isSymbol() const { return OpKind == MO_ExternalSymbol; }
-
- //===--------------------------------------------------------------------===//
- // Accessors for Register Operands
- //===--------------------------------------------------------------------===//
-
- /// getReg - Returns the register number.
- unsigned getReg() const {
- assert(isRegister() && "This is not a register operand!");
- return Contents.Reg.RegNo;
- }
-
- unsigned getSubReg() const {
- assert(isRegister() && "Wrong MachineOperand accessor");
- return (unsigned)SubReg;
- }
-
- bool isUse() const {
- assert(isRegister() && "Wrong MachineOperand accessor");
- return !IsDef;
- }
-
- bool isDef() const {
- assert(isRegister() && "Wrong MachineOperand accessor");
- return IsDef;
- }
-
- bool isImplicit() const {
- assert(isRegister() && "Wrong MachineOperand accessor");
- return IsImp;
- }
-
- bool isDead() const {
- assert(isRegister() && "Wrong MachineOperand accessor");
- return IsDead;
- }
-
- bool isKill() const {
- assert(isRegister() && "Wrong MachineOperand accessor");
- return IsKill;
- }
-
- /// getNextOperandForReg - Return the next MachineOperand in the function that
- /// uses or defines this register.
- MachineOperand *getNextOperandForReg() const {
- assert(isRegister() && "This is not a register operand!");
- return Contents.Reg.Next;
- }
-
- //===--------------------------------------------------------------------===//
- // Mutators for Register Operands
- //===--------------------------------------------------------------------===//
-
- /// Change the register this operand corresponds to.
- ///
- void setReg(unsigned Reg);
-
- void setSubReg(unsigned subReg) {
- assert(isRegister() && "Wrong MachineOperand accessor");
- SubReg = (unsigned char)subReg;
- }
-
- void setIsUse(bool Val = true) {
- assert(isRegister() && "Wrong MachineOperand accessor");
- IsDef = !Val;
- }
-
- void setIsDef(bool Val = true) {
- assert(isRegister() && "Wrong MachineOperand accessor");
- IsDef = Val;
- }
-
- void setImplicit(bool Val = true) {
- assert(isRegister() && "Wrong MachineOperand accessor");
- IsImp = Val;
- }
-
- void setIsKill(bool Val = true) {
- assert(isRegister() && !IsDef && "Wrong MachineOperand accessor");
- IsKill = Val;
- }
-
- void setIsDead(bool Val = true) {
- assert(isRegister() && IsDef && "Wrong MachineOperand accessor");
- IsDead = Val;
- }
-
-
- //===--------------------------------------------------------------------===//
- // Accessors for various operand types.
- //===--------------------------------------------------------------------===//
-
- int64_t getImm() const {
- assert(isImmediate() && "Wrong MachineOperand accessor");
- return Contents.ImmVal;
- }
-
- ConstantFP *getFPImm() const {
- assert(isFPImmediate() && "Wrong MachineOperand accessor");
- return Contents.CFP;
- }
-
- MachineBasicBlock *getMBB() const {
- assert(isMachineBasicBlock() && "Wrong MachineOperand accessor");
- return Contents.MBB;
- }
-
- int getIndex() const {
- assert((isFrameIndex() || isConstantPoolIndex() || isJumpTableIndex()) &&
- "Wrong MachineOperand accessor");
- return Contents.OffsetedInfo.Val.Index;
- }
-
- GlobalValue *getGlobal() const {
- assert(isGlobalAddress() && "Wrong MachineOperand accessor");
- return Contents.OffsetedInfo.Val.GV;
- }
-
- int getOffset() const {
- assert((isGlobalAddress() || isExternalSymbol() || isConstantPoolIndex()) &&
- "Wrong MachineOperand accessor");
- return Contents.OffsetedInfo.Offset;
- }
-
- const char *getSymbolName() const {
- assert(isExternalSymbol() && "Wrong MachineOperand accessor");
- return Contents.OffsetedInfo.Val.SymbolName;
- }
-
- //===--------------------------------------------------------------------===//
- // Mutators for various operand types.
- //===--------------------------------------------------------------------===//
-
- void setImm(int64_t immVal) {
- assert(isImmediate() && "Wrong MachineOperand mutator");
- Contents.ImmVal = immVal;
- }
-
- void setOffset(int Offset) {
- assert((isGlobalAddress() || isExternalSymbol() || isConstantPoolIndex()) &&
- "Wrong MachineOperand accessor");
- Contents.OffsetedInfo.Offset = Offset;
- }
-
- void setIndex(int Idx) {
- assert((isFrameIndex() || isConstantPoolIndex() || isJumpTableIndex()) &&
- "Wrong MachineOperand accessor");
- Contents.OffsetedInfo.Val.Index = Idx;
- }
-
- void setMBB(MachineBasicBlock *MBB) {
- assert(isMachineBasicBlock() && "Wrong MachineOperand accessor");
- Contents.MBB = MBB;
- }
-
- //===--------------------------------------------------------------------===//
- // Other methods.
- //===--------------------------------------------------------------------===//
-
- /// isIdenticalTo - Return true if this operand is identical to the specified
- /// operand. Note: This method ignores isKill and isDead properties.
- bool isIdenticalTo(const MachineOperand &Other) const;
-
- /// ChangeToImmediate - Replace this operand with a new immediate operand of
- /// the specified value. If an operand is known to be an immediate already,
- /// the setImm method should be used.
- void ChangeToImmediate(int64_t ImmVal);
-
- /// ChangeToRegister - Replace this operand with a new register operand of
- /// the specified value. If an operand is known to be an register already,
- /// the setReg method should be used.
- void ChangeToRegister(unsigned Reg, bool isDef, bool isImp = false,
- bool isKill = false, bool isDead = false);
-
- //===--------------------------------------------------------------------===//
- // Construction methods.
- //===--------------------------------------------------------------------===//
-
- static MachineOperand CreateImm(int64_t Val) {
- MachineOperand Op(MachineOperand::MO_Immediate);
- Op.setImm(Val);
- return Op;
- }
-
- static MachineOperand CreateFPImm(ConstantFP *CFP) {
- MachineOperand Op(MachineOperand::MO_FPImmediate);
- Op.Contents.CFP = CFP;
- return Op;
- }
-
- static MachineOperand CreateReg(unsigned Reg, bool isDef, bool isImp = false,
- bool isKill = false, bool isDead = false,
- unsigned SubReg = 0) {
- MachineOperand Op(MachineOperand::MO_Register);
- Op.IsDef = isDef;
- Op.IsImp = isImp;
- Op.IsKill = isKill;
- Op.IsDead = isDead;
- Op.Contents.Reg.RegNo = Reg;
- Op.Contents.Reg.Prev = 0;
- Op.Contents.Reg.Next = 0;
- Op.SubReg = SubReg;
- return Op;
- }
- static MachineOperand CreateMBB(MachineBasicBlock *MBB) {
- MachineOperand Op(MachineOperand::MO_MachineBasicBlock);
- Op.setMBB(MBB);
- return Op;
- }
- static MachineOperand CreateFI(unsigned Idx) {
- MachineOperand Op(MachineOperand::MO_FrameIndex);
- Op.setIndex(Idx);
- return Op;
- }
- static MachineOperand CreateCPI(unsigned Idx, int Offset) {
- MachineOperand Op(MachineOperand::MO_ConstantPoolIndex);
- Op.setIndex(Idx);
- Op.setOffset(Offset);
- return Op;
- }
- static MachineOperand CreateJTI(unsigned Idx) {
- MachineOperand Op(MachineOperand::MO_JumpTableIndex);
- Op.setIndex(Idx);
- return Op;
- }
- static MachineOperand CreateGA(GlobalValue *GV, int Offset) {
- MachineOperand Op(MachineOperand::MO_GlobalAddress);
- Op.Contents.OffsetedInfo.Val.GV = GV;
- Op.setOffset(Offset);
- return Op;
- }
- static MachineOperand CreateES(const char *SymName, int Offset = 0) {
- MachineOperand Op(MachineOperand::MO_ExternalSymbol);
- Op.Contents.OffsetedInfo.Val.SymbolName = SymName;
- Op.setOffset(Offset);
- return Op;
- }
- const MachineOperand &operator=(const MachineOperand &MO) {
- OpKind = MO.OpKind;
- IsDef = MO.IsDef;
- IsImp = MO.IsImp;
- IsKill = MO.IsKill;
- IsDead = MO.IsDead;
- SubReg = MO.SubReg;
- ParentMI = MO.ParentMI;
- Contents = MO.Contents;
- return *this;
- }
-
- friend class MachineInstr;
- friend class MachineRegisterInfo;
-private:
- //===--------------------------------------------------------------------===//
- // Methods for handling register use/def lists.
- //===--------------------------------------------------------------------===//
-
- /// isOnRegUseList - Return true if this operand is on a register use/def list
- /// or false if not. This can only be called for register operands that are
- /// part of a machine instruction.
- bool isOnRegUseList() const {
- assert(isReg() && "Can only add reg operand to use lists");
- return Contents.Reg.Prev != 0;
- }
-
- /// AddRegOperandToRegInfo - Add this register operand to the specified
- /// MachineRegisterInfo. If it is null, then the next/prev fields should be
- /// explicitly nulled out.
- void AddRegOperandToRegInfo(MachineRegisterInfo *RegInfo);
-
- void RemoveRegOperandFromRegInfo() {
- assert(isOnRegUseList() && "Can only add reg operand to use lists");
- // Unlink this from the doubly linked list of operands.
- MachineOperand *NextOp = Contents.Reg.Next;
- *Contents.Reg.Prev = NextOp;
- if (NextOp) {
- assert(NextOp->getReg() == getReg() && "Corrupt reg use/def chain!");
- NextOp->Contents.Reg.Prev = Contents.Reg.Prev;
- }
- Contents.Reg.Prev = 0;
- Contents.Reg.Next = 0;
- }
-};
-
-inline std::ostream &operator<<(std::ostream &OS, const MachineOperand &MO) {
- MO.print(OS, 0);
- return OS;
-}
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/CodeGen/MachinePassRegistry.h b/release_23/include/llvm/CodeGen/MachinePassRegistry.h
deleted file mode 100644
index 680d2b80df74..000000000000
--- a/release_23/include/llvm/CodeGen/MachinePassRegistry.h
+++ /dev/null
@@ -1,156 +0,0 @@
-//===-- llvm/CodeGen/MachinePassRegistry.h ----------------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains the mechanics for machine function pass registries. A
-// function pass registry (MachinePassRegistry) is auto filled by the static
-// constructors of MachinePassRegistryNode. Further there is a command line
-// parser (RegisterPassParser) which listens to each registry for additions
-// and deletions, so that the appropriate command option is updated.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_CODEGEN_MACHINEPASSREGISTRY_H
-#define LLVM_CODEGEN_MACHINEPASSREGISTRY_H
-
-#include "llvm/CodeGen/Passes.h"
-#include "llvm/Support/CommandLine.h"
-
-namespace llvm {
-
-typedef void *(*MachinePassCtor)();
-
-
-//===----------------------------------------------------------------------===//
-///
-/// MachinePassRegistryListener - Listener to adds and removals of nodes in
-/// registration list.
-///
-//===----------------------------------------------------------------------===//
-class MachinePassRegistryListener {
-public:
- MachinePassRegistryListener() {}
- virtual ~MachinePassRegistryListener() {}
- virtual void NotifyAdd(const char *N, MachinePassCtor C, const char *D) = 0;
- virtual void NotifyRemove(const char *N) = 0;
-};
-
-
-//===----------------------------------------------------------------------===//
-///
-/// MachinePassRegistryNode - Machine pass node stored in registration list.
-///
-//===----------------------------------------------------------------------===//
-class MachinePassRegistryNode {
-
-private:
-
- MachinePassRegistryNode *Next; // Next function pass in list.
- const char *Name; // Name of function pass.
- const char *Description; // Description string.
- MachinePassCtor Ctor; // Function pass creator.
-
-public:
-
- MachinePassRegistryNode(const char *N, const char *D, MachinePassCtor C)
- : Next(NULL)
- , Name(N)
- , Description(D)
- , Ctor(C)
- {}
-
- // Accessors
- MachinePassRegistryNode *getNext() const { return Next; }
- MachinePassRegistryNode **getNextAddress() { return &Next; }
- const char *getName() const { return Name; }
- const char *getDescription() const { return Description; }
- MachinePassCtor getCtor() const { return Ctor; }
- void setNext(MachinePassRegistryNode *N) { Next = N; }
-
-};
-
-
-//===----------------------------------------------------------------------===//
-///
-/// MachinePassRegistry - Track the registration of machine passes.
-///
-//===----------------------------------------------------------------------===//
-class MachinePassRegistry {
-
-private:
-
- MachinePassRegistryNode *List; // List of registry nodes.
- MachinePassCtor Default; // Default function pass creator.
- MachinePassRegistryListener* Listener;// Listener for list adds are removes.
-
-public:
-
- // NO CONSTRUCTOR - we don't want static constructor ordering to mess
- // with the registry.
-
- // Accessors.
- //
- MachinePassRegistryNode *getList() { return List; }
- MachinePassCtor getDefault() { return Default; }
- void setDefault(MachinePassCtor C) { Default = C; }
- void setListener(MachinePassRegistryListener *L) { Listener = L; }
-
- /// Add - Adds a function pass to the registration list.
- ///
- void Add(MachinePassRegistryNode *Node);
-
- /// Remove - Removes a function pass from the registration list.
- ///
- void Remove(MachinePassRegistryNode *Node);
-
-};
-
-
-//===----------------------------------------------------------------------===//
-///
-/// RegisterPassParser class - Handle the addition of new machine passes.
-///
-//===----------------------------------------------------------------------===//
-template<class RegistryClass>
-class RegisterPassParser : public MachinePassRegistryListener,
- public cl::parser<typename RegistryClass::FunctionPassCtor> {
-public:
- RegisterPassParser() {}
- ~RegisterPassParser() { RegistryClass::setListener(NULL); }
-
- void initialize(cl::Option &O) {
- cl::parser<typename RegistryClass::FunctionPassCtor>::initialize(O);
-
- // Add existing passes to option.
- for (RegistryClass *Node = RegistryClass::getList();
- Node; Node = Node->getNext()) {
- addLiteralOption(Node->getName(),
- (typename RegistryClass::FunctionPassCtor)Node->getCtor(),
- Node->getDescription());
- }
-
- // Make sure we listen for list changes.
- RegistryClass::setListener(this);
- }
-
- // Implement the MachinePassRegistryListener callbacks.
- //
- virtual void NotifyAdd(const char *N,
- MachinePassCtor C,
- const char *D) {
- this->addLiteralOption(N, (typename RegistryClass::FunctionPassCtor)C, D);
- }
- virtual void NotifyRemove(const char *N) {
- this->removeLiteralOption(N);
- }
-};
-
-
-} // end namespace llvm
-
-#endif
diff --git a/release_23/include/llvm/CodeGen/MachineRegisterInfo.h b/release_23/include/llvm/CodeGen/MachineRegisterInfo.h
deleted file mode 100644
index 665b55c4ca04..000000000000
--- a/release_23/include/llvm/CodeGen/MachineRegisterInfo.h
+++ /dev/null
@@ -1,282 +0,0 @@
-//===-- llvm/CodeGen/MachineRegisterInfo.h ----------------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines the MachineRegisterInfo class.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_CODEGEN_MACHINEREGISTERINFO_H
-#define LLVM_CODEGEN_MACHINEREGISTERINFO_H
-
-#include "llvm/Target/TargetRegisterInfo.h"
-#include "llvm/ADT/BitVector.h"
-#include "llvm/ADT/iterator"
-#include <vector>
-
-namespace llvm {
-
-/// MachineRegisterInfo - Keep track of information for virtual and physical
-/// registers, including vreg register classes, use/def chains for registers,
-/// etc.
-class MachineRegisterInfo {
- /// VRegInfo - Information we keep for each virtual register. The entries in
- /// this vector are actually converted to vreg numbers by adding the
- /// TargetRegisterInfo::FirstVirtualRegister delta to their index.
- ///
- /// Each element in this list contains the register class of the vreg and the
- /// start of the use/def list for the register.
- std::vector<std::pair<const TargetRegisterClass*, MachineOperand*> > VRegInfo;
-
- /// PhysRegUseDefLists - This is an array of the head of the use/def list for
- /// physical registers.
- MachineOperand **PhysRegUseDefLists;
-
- /// UsedPhysRegs - This is a bit vector that is computed and set by the
- /// register allocator, and must be kept up to date by passes that run after
- /// register allocation (though most don't modify this). This is used
- /// so that the code generator knows which callee save registers to save and
- /// for other target specific uses.
- BitVector UsedPhysRegs;
-
- /// LiveIns/LiveOuts - Keep track of the physical registers that are
- /// livein/liveout of the function. Live in values are typically arguments in
- /// registers, live out values are typically return values in registers.
- /// LiveIn values are allowed to have virtual registers associated with them,
- /// stored in the second element.
- std::vector<std::pair<unsigned, unsigned> > LiveIns;
- std::vector<unsigned> LiveOuts;
-
- MachineRegisterInfo(const MachineRegisterInfo&); // DO NOT IMPLEMENT
- void operator=(const MachineRegisterInfo&); // DO NOT IMPLEMENT
-public:
- explicit MachineRegisterInfo(const TargetRegisterInfo &TRI);
- ~MachineRegisterInfo();
-
- //===--------------------------------------------------------------------===//
- // Register Info
- //===--------------------------------------------------------------------===//
-
- /// reg_begin/reg_end - Provide iteration support to walk over all definitions
- /// and uses of a register within the MachineFunction that corresponds to this
- /// MachineRegisterInfo object.
- template<bool Uses, bool Defs>
- class defusechain_iterator;
-
- /// reg_iterator/reg_begin/reg_end - Walk all defs and uses of the specified
- /// register.
- typedef defusechain_iterator<true,true> reg_iterator;
- reg_iterator reg_begin(unsigned RegNo) const {
- return reg_iterator(getRegUseDefListHead(RegNo));
- }
- static reg_iterator reg_end() { return reg_iterator(0); }
-
- /// def_iterator/def_begin/def_end - Walk all defs of the specified register.
- typedef defusechain_iterator<false,true> def_iterator;
- def_iterator def_begin(unsigned RegNo) const {
- return def_iterator(getRegUseDefListHead(RegNo));
- }
- static def_iterator def_end() { return def_iterator(0); }
-
- /// use_iterator/use_begin/use_end - Walk all uses of the specified register.
- typedef defusechain_iterator<true,false> use_iterator;
- use_iterator use_begin(unsigned RegNo) const {
- return use_iterator(getRegUseDefListHead(RegNo));
- }
- static use_iterator use_end() { return use_iterator(0); }
-
-
- /// replaceRegWith - Replace all instances of FromReg with ToReg in the
- /// machine function. This is like llvm-level X->replaceAllUsesWith(Y),
- /// except that it also changes any definitions of the register as well.
- void replaceRegWith(unsigned FromReg, unsigned ToReg);
-
- /// getRegUseDefListHead - Return the head pointer for the register use/def
- /// list for the specified virtual or physical register.
- MachineOperand *&getRegUseDefListHead(unsigned RegNo) {
- if (RegNo < TargetRegisterInfo::FirstVirtualRegister)
- return PhysRegUseDefLists[RegNo];
- RegNo -= TargetRegisterInfo::FirstVirtualRegister;
- return VRegInfo[RegNo].second;
- }
-
- MachineOperand *getRegUseDefListHead(unsigned RegNo) const {
- if (RegNo < TargetRegisterInfo::FirstVirtualRegister)
- return PhysRegUseDefLists[RegNo];
- RegNo -= TargetRegisterInfo::FirstVirtualRegister;
- return VRegInfo[RegNo].second;
- }
-
- /// getVRegDef - Return the machine instr that defines the specified virtual
- /// register or null if none is found. This assumes that the code is in SSA
- /// form, so there should only be one definition.
- MachineInstr *getVRegDef(unsigned Reg) const;
-
-#ifndef NDEBUG
- void dumpUses(unsigned RegNo) const;
-#endif
-
- //===--------------------------------------------------------------------===//
- // Virtual Register Info
- //===--------------------------------------------------------------------===//
-
- /// getRegClass - Return the register class of the specified virtual register.
- const TargetRegisterClass *getRegClass(unsigned Reg) const {
- Reg -= TargetRegisterInfo::FirstVirtualRegister;
- assert(Reg < VRegInfo.size() && "Invalid vreg!");
- return VRegInfo[Reg].first;
- }
-
- /// createVirtualRegister - Create and return a new virtual register in the
- /// function with the specified register class.
- ///
- unsigned createVirtualRegister(const TargetRegisterClass *RegClass) {
- assert(RegClass && "Cannot create register without RegClass!");
- // Add a reg, but keep track of whether the vector reallocated or not.
- void *ArrayBase = VRegInfo.empty() ? 0 : &VRegInfo[0];
- VRegInfo.push_back(std::make_pair(RegClass, (MachineOperand*)0));
-
- if (&VRegInfo[0] == ArrayBase || VRegInfo.size() == 1)
- return getLastVirtReg();
-
- // Otherwise, the vector reallocated, handle this now.
- HandleVRegListReallocation();
- return getLastVirtReg();
- }
-
- /// getLastVirtReg - Return the highest currently assigned virtual register.
- ///
- unsigned getLastVirtReg() const {
- return (unsigned)VRegInfo.size()+TargetRegisterInfo::FirstVirtualRegister-1;
- }
-
-
- //===--------------------------------------------------------------------===//
- // Physical Register Use Info
- //===--------------------------------------------------------------------===//
-
- /// isPhysRegUsed - Return true if the specified register is used in this
- /// function. This only works after register allocation.
- bool isPhysRegUsed(unsigned Reg) const { return UsedPhysRegs[Reg]; }
-
- /// setPhysRegUsed - Mark the specified register used in this function.
- /// This should only be called during and after register allocation.
- void setPhysRegUsed(unsigned Reg) { UsedPhysRegs[Reg] = true; }
-
- /// setPhysRegUnused - Mark the specified register unused in this function.
- /// This should only be called during and after register allocation.
- void setPhysRegUnused(unsigned Reg) { UsedPhysRegs[Reg] = false; }
-
-
- //===--------------------------------------------------------------------===//
- // LiveIn/LiveOut Management
- //===--------------------------------------------------------------------===//
-
- /// addLiveIn/Out - Add the specified register as a live in/out. Note that it
- /// is an error to add the same register to the same set more than once.
- void addLiveIn(unsigned Reg, unsigned vreg = 0) {
- LiveIns.push_back(std::make_pair(Reg, vreg));
- }
- void addLiveOut(unsigned Reg) { LiveOuts.push_back(Reg); }
-
- // Iteration support for live in/out sets. These sets are kept in sorted
- // order by their register number.
- typedef std::vector<std::pair<unsigned,unsigned> >::const_iterator
- livein_iterator;
- typedef std::vector<unsigned>::const_iterator liveout_iterator;
- livein_iterator livein_begin() const { return LiveIns.begin(); }
- livein_iterator livein_end() const { return LiveIns.end(); }
- bool livein_empty() const { return LiveIns.empty(); }
- liveout_iterator liveout_begin() const { return LiveOuts.begin(); }
- liveout_iterator liveout_end() const { return LiveOuts.end(); }
- bool liveout_empty() const { return LiveOuts.empty(); }
-private:
- void HandleVRegListReallocation();
-
-public:
- /// defusechain_iterator - This class provides iterator support for machine
- /// operands in the function that use or define a specific register. If
- /// ReturnUses is true it returns uses of registers, if ReturnDefs is true it
- /// returns defs. If neither are true then you are silly and it always
- /// returns end().
- template<bool ReturnUses, bool ReturnDefs>
- class defusechain_iterator
- : public forward_iterator<MachineInstr, ptrdiff_t> {
- MachineOperand *Op;
- explicit defusechain_iterator(MachineOperand *op) : Op(op) {
- // If the first node isn't one we're interested in, advance to one that
- // we are interested in.
- if (op) {
- if ((!ReturnUses && op->isUse()) ||
- (!ReturnDefs && op->isDef()))
- ++*this;
- }
- }
- friend class MachineRegisterInfo;
- public:
- typedef forward_iterator<MachineInstr, ptrdiff_t>::reference reference;
- typedef forward_iterator<MachineInstr, ptrdiff_t>::pointer pointer;
-
- defusechain_iterator(const defusechain_iterator &I) : Op(I.Op) {}
- defusechain_iterator() : Op(0) {}
-
- bool operator==(const defusechain_iterator &x) const {
- return Op == x.Op;
- }
- bool operator!=(const defusechain_iterator &x) const {
- return !operator==(x);
- }
-
- /// atEnd - return true if this iterator is equal to reg_end() on the value.
- bool atEnd() const { return Op == 0; }
-
- // Iterator traversal: forward iteration only
- defusechain_iterator &operator++() { // Preincrement
- assert(Op && "Cannot increment end iterator!");
- Op = Op->getNextOperandForReg();
-
- // If this is an operand we don't care about, skip it.
- while (Op && ((!ReturnUses && Op->isUse()) ||
- (!ReturnDefs && Op->isDef())))
- Op = Op->getNextOperandForReg();
-
- return *this;
- }
- defusechain_iterator operator++(int) { // Postincrement
- defusechain_iterator tmp = *this; ++*this; return tmp;
- }
-
- MachineOperand &getOperand() const {
- assert(Op && "Cannot dereference end iterator!");
- return *Op;
- }
-
- /// getOperandNo - Return the operand # of this MachineOperand in its
- /// MachineInstr.
- unsigned getOperandNo() const {
- assert(Op && "Cannot dereference end iterator!");
- return Op - &Op->getParent()->getOperand(0);
- }
-
- // Retrieve a reference to the current operand.
- MachineInstr &operator*() const {
- assert(Op && "Cannot dereference end iterator!");
- return *Op->getParent();
- }
-
- MachineInstr *operator->() const {
- assert(Op && "Cannot dereference end iterator!");
- return Op->getParent();
- }
- };
-
-};
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/CodeGen/MachineRelocation.h b/release_23/include/llvm/CodeGen/MachineRelocation.h
deleted file mode 100644
index fa23a4d1c4b0..000000000000
--- a/release_23/include/llvm/CodeGen/MachineRelocation.h
+++ /dev/null
@@ -1,324 +0,0 @@
-//===-- llvm/CodeGen/MachineRelocation.h - Target Relocation ----*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines the MachineRelocation class.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_CODEGEN_MACHINERELOCATION_H
-#define LLVM_CODEGEN_MACHINERELOCATION_H
-
-#include "llvm/Support/DataTypes.h"
-#include <cassert>
-
-namespace llvm {
-class GlobalValue;
-class MachineBasicBlock;
-
-/// MachineRelocation - This represents a target-specific relocation value,
-/// produced by the code emitter. This relocation is resolved after the has
-/// been emitted, either to an object file or to memory, when the target of the
-/// relocation can be resolved.
-///
-/// A relocation is made up of the following logical portions:
-/// 1. An offset in the machine code buffer, the location to modify.
-/// 2. A target specific relocation type (a number from 0 to 63).
-/// 3. A symbol being referenced, either as a GlobalValue* or as a string.
-/// 4. An optional constant value to be added to the reference.
-/// 5. A bit, CanRewrite, which indicates to the JIT that a function stub is
-/// not needed for the relocation.
-/// 6. An index into the GOT, if the target uses a GOT
-///
-class MachineRelocation {
- enum AddressType {
- isResult, // Relocation has be transformed into its result pointer.
- isGV, // The Target.GV field is valid.
- isGVLazyPtr, // Relocation of a lazily resolved GV address.
- isBB, // Relocation of BB address.
- isExtSym, // The Target.ExtSym field is valid.
- isConstPool, // Relocation of constant pool address.
- isJumpTable, // Relocation of jump table address.
- isGOTIndex // The Target.GOTIndex field is valid.
- };
-
- /// Offset - This is the offset from the start of the code buffer of the
- /// relocation to perform.
- intptr_t Offset;
-
- /// ConstantVal - A field that may be used by the target relocation type.
- intptr_t ConstantVal;
-
- union {
- void *Result; // If this has been resolved to a resolved pointer
- GlobalValue *GV; // If this is a pointer to a GV or a GV lazy ptr
- MachineBasicBlock *MBB; // If this is a pointer to a LLVM BB
- const char *ExtSym; // If this is a pointer to a named symbol
- unsigned Index; // Constant pool / jump table index
- unsigned GOTIndex; // Index in the GOT of this symbol/global
- } Target;
-
- unsigned TargetReloType : 6; // The target relocation ID.
- AddressType AddrType : 4; // The field of Target to use.
- bool NeedStub : 1; // True if this relocation requires a stub.
- bool GOTRelative : 1; // Should this relocation be relative to the GOT?
-
-public:
- // Relocation types used in a generic implementation. Currently, relocation
- // entries for all things use the generic VANILLA type until they are refined
- // into target relocation types.
- enum RelocationType {
- VANILLA
- };
-
- /// MachineRelocation::getGV - Return a relocation entry for a GlobalValue.
- ///
- static MachineRelocation getGV(intptr_t offset, unsigned RelocationType,
- GlobalValue *GV, intptr_t cst = 0,
- bool NeedStub = 0,
- bool GOTrelative = 0) {
- assert((RelocationType & ~63) == 0 && "Relocation type too large!");
- MachineRelocation Result;
- Result.Offset = offset;
- Result.ConstantVal = cst;
- Result.TargetReloType = RelocationType;
- Result.AddrType = isGV;
- Result.NeedStub = NeedStub;
- Result.GOTRelative = GOTrelative;
- Result.Target.GV = GV;
- return Result;
- }
-
- /// MachineRelocation::getGVLazyPtr - Return a relocation entry for a
- /// lazily resolved GlobalValue address.
- static MachineRelocation getGVLazyPtr(intptr_t offset,
- unsigned RelocationType,
- GlobalValue *GV, intptr_t cst = 0,
- bool NeedStub = 0,
- bool GOTrelative = 0) {
- assert((RelocationType & ~63) == 0 && "Relocation type too large!");
- MachineRelocation Result;
- Result.Offset = offset;
- Result.ConstantVal = cst;
- Result.TargetReloType = RelocationType;
- Result.AddrType = isGVLazyPtr;
- Result.NeedStub = NeedStub;
- Result.GOTRelative = GOTrelative;
- Result.Target.GV = GV;
- return Result;
- }
-
- /// MachineRelocation::getBB - Return a relocation entry for a BB.
- ///
- static MachineRelocation getBB(intptr_t offset,unsigned RelocationType,
- MachineBasicBlock *MBB, intptr_t cst = 0) {
- assert((RelocationType & ~63) == 0 && "Relocation type too large!");
- MachineRelocation Result;
- Result.Offset = offset;
- Result.ConstantVal = cst;
- Result.TargetReloType = RelocationType;
- Result.AddrType = isBB;
- Result.NeedStub = false;
- Result.GOTRelative = false;
- Result.Target.MBB = MBB;
- return Result;
- }
-
- /// MachineRelocation::getExtSym - Return a relocation entry for an external
- /// symbol, like "free".
- ///
- static MachineRelocation getExtSym(intptr_t offset, unsigned RelocationType,
- const char *ES, intptr_t cst = 0,
- bool GOTrelative = 0) {
- assert((RelocationType & ~63) == 0 && "Relocation type too large!");
- MachineRelocation Result;
- Result.Offset = offset;
- Result.ConstantVal = cst;
- Result.TargetReloType = RelocationType;
- Result.AddrType = isExtSym;
- Result.NeedStub = true;
- Result.GOTRelative = GOTrelative;
- Result.Target.ExtSym = ES;
- return Result;
- }
-
- /// MachineRelocation::getConstPool - Return a relocation entry for a constant
- /// pool entry.
- ///
- static MachineRelocation getConstPool(intptr_t offset,unsigned RelocationType,
- unsigned CPI, intptr_t cst = 0) {
- assert((RelocationType & ~63) == 0 && "Relocation type too large!");
- MachineRelocation Result;
- Result.Offset = offset;
- Result.ConstantVal = cst;
- Result.TargetReloType = RelocationType;
- Result.AddrType = isConstPool;
- Result.NeedStub = false;
- Result.GOTRelative = false;
- Result.Target.Index = CPI;
- return Result;
- }
-
- /// MachineRelocation::getJumpTable - Return a relocation entry for a jump
- /// table entry.
- ///
- static MachineRelocation getJumpTable(intptr_t offset,unsigned RelocationType,
- unsigned JTI, intptr_t cst = 0) {
- assert((RelocationType & ~63) == 0 && "Relocation type too large!");
- MachineRelocation Result;
- Result.Offset = offset;
- Result.ConstantVal = cst;
- Result.TargetReloType = RelocationType;
- Result.AddrType = isJumpTable;
- Result.NeedStub = false;
- Result.GOTRelative = false;
- Result.Target.Index = JTI;
- return Result;
- }
-
- /// getMachineCodeOffset - Return the offset into the code buffer that the
- /// relocation should be performed.
- intptr_t getMachineCodeOffset() const {
- return Offset;
- }
-
- /// getRelocationType - Return the target-specific relocation ID for this
- /// relocation.
- unsigned getRelocationType() const {
- return TargetReloType;
- }
-
- /// getConstantVal - Get the constant value associated with this relocation.
- /// This is often an offset from the symbol.
- ///
- intptr_t getConstantVal() const {
- return ConstantVal;
- }
-
- /// setConstantVal - Set the constant value associated with this relocation.
- /// This is often an offset from the symbol.
- ///
- void setConstantVal(intptr_t val) {
- ConstantVal = val;
- }
-
- /// isGlobalValue - Return true if this relocation is a GlobalValue, as
- /// opposed to a constant string.
- bool isGlobalValue() const {
- return AddrType == isGV;
- }
-
- /// isGlobalValueVLazyPtr - Return true if this relocation is the address
- /// of a lazily resolved GlobalValue.
- bool isGlobalValueLazyPtr() const {
- return AddrType == isGVLazyPtr;
- }
-
- /// isBasicBlock - Return true if this relocation is a basic block reference.
- ///
- bool isBasicBlock() const {
- return AddrType == isBB;
- }
-
- /// isString - Return true if this is a constant string.
- ///
- bool isString() const {
- return AddrType == isExtSym;
- }
-
- /// isConstantPoolIndex - Return true if this is a constant pool reference.
- ///
- bool isConstantPoolIndex() const {
- return AddrType == isConstPool;
- }
-
- /// isJumpTableIndex - Return true if this is a jump table reference.
- ///
- bool isJumpTableIndex() const {
- return AddrType == isJumpTable;
- }
-
- /// isGOTRelative - Return true the target wants the index into the GOT of
- /// the symbol rather than the address of the symbol.
- bool isGOTRelative() const {
- return GOTRelative;
- }
-
- /// doesntNeedStub - This function returns true if the JIT for this target
- /// target is capable of directly handling the relocated GlobalValue reference
- /// without using either a stub function or issuing an extra load to get the
- /// GV address.
- bool doesntNeedStub() const {
- return !NeedStub;
- }
-
- /// getGlobalValue - If this is a global value reference, return the
- /// referenced global.
- GlobalValue *getGlobalValue() const {
- assert((isGlobalValue() || isGlobalValueLazyPtr()) &&
- "This is not a global value reference!");
- return Target.GV;
- }
-
- MachineBasicBlock *getBasicBlock() const {
- assert(isBasicBlock() && "This is not a basic block reference!");
- return Target.MBB;
- }
-
- /// getString - If this is a string value, return the string reference.
- ///
- const char *getString() const {
- assert(isString() && "This is not a string reference!");
- return Target.ExtSym;
- }
-
- /// getConstantPoolIndex - If this is a const pool reference, return
- /// the index into the constant pool.
- unsigned getConstantPoolIndex() const {
- assert(isConstantPoolIndex() && "This is not a constant pool reference!");
- return Target.Index;
- }
-
- /// getJumpTableIndex - If this is a jump table reference, return
- /// the index into the jump table.
- unsigned getJumpTableIndex() const {
- assert(isJumpTableIndex() && "This is not a jump table reference!");
- return Target.Index;
- }
-
- /// getResultPointer - Once this has been resolved to point to an actual
- /// address, this returns the pointer.
- void *getResultPointer() const {
- assert(AddrType == isResult && "Result pointer isn't set yet!");
- return Target.Result;
- }
-
- /// setResultPointer - Set the result to the specified pointer value.
- ///
- void setResultPointer(void *Ptr) {
- Target.Result = Ptr;
- AddrType = isResult;
- }
-
- /// setGOTIndex - Set the GOT index to a specific value.
- void setGOTIndex(unsigned idx) {
- AddrType = isGOTIndex;
- Target.GOTIndex = idx;
- }
-
- /// getGOTIndex - Once this has been resolved to an entry in the GOT,
- /// this returns that index. The index is from the lowest address entry
- /// in the GOT.
- unsigned getGOTIndex() const {
- assert(AddrType == isGOTIndex);
- return Target.GOTIndex;
- }
-};
-}
-
-#endif
diff --git a/release_23/include/llvm/CodeGen/Passes.h b/release_23/include/llvm/CodeGen/Passes.h
deleted file mode 100644
index 5218f7ac26e2..000000000000
--- a/release_23/include/llvm/CodeGen/Passes.h
+++ /dev/null
@@ -1,178 +0,0 @@
-//===-- Passes.h - Target independent code generation passes ----*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines interfaces to access the target independent code generation
-// passes provided by the LLVM backend.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_CODEGEN_PASSES_H
-#define LLVM_CODEGEN_PASSES_H
-
-#include <iosfwd>
-#include <string>
-
-namespace llvm {
-
- class FunctionPass;
- class PassInfo;
- class TargetMachine;
- class RegisterCoalescer;
-
- /// createUnreachableBlockEliminationPass - The LLVM code generator does not
- /// work well with unreachable basic blocks (what live ranges make sense for a
- /// block that cannot be reached?). As such, a code generator should either
- /// not instruction select unreachable blocks, or it can run this pass as it's
- /// last LLVM modifying pass to clean up blocks that are not reachable from
- /// the entry block.
- FunctionPass *createUnreachableBlockEliminationPass();
-
- /// MachineFunctionPrinter pass - This pass prints out the machine function to
- /// standard error, as a debugging tool.
- FunctionPass *createMachineFunctionPrinterPass(std::ostream *OS,
- const std::string &Banner ="");
-
- /// MachineLoopInfo pass - This pass is a loop analysis pass.
- ///
- extern const PassInfo *MachineLoopInfoID;
-
- /// MachineDominators pass - This pass is a machine dominators analysis pass.
- ///
- extern const PassInfo *MachineDominatorsID;
-
- /// PHIElimination pass - This pass eliminates machine instruction PHI nodes
- /// by inserting copy instructions. This destroys SSA information, but is the
- /// desired input for some register allocators. This pass is "required" by
- /// these register allocator like this: AU.addRequiredID(PHIEliminationID);
- ///
- extern const PassInfo *PHIEliminationID;
-
- /// StrongPHIElimination pass - This pass eliminates machine instruction PHI
- /// nodes by inserting copy instructions. This destroys SSA information, but
- /// is the desired input for some register allocators. This pass is
- /// "required" by these register allocator like this:
- /// AU.addRequiredID(PHIEliminationID);
- /// This pass is still in development
- extern const PassInfo *StrongPHIEliminationID;
-
- /// SimpleRegisterCoalescing pass. Aggressively coalesces every register
- /// copy it can.
- ///
- extern const PassInfo *SimpleRegisterCoalescingID;
-
- /// TwoAddressInstruction pass - This pass reduces two-address instructions to
- /// use two operands. This destroys SSA information but it is desired by
- /// register allocators.
- extern const PassInfo *TwoAddressInstructionPassID;
-
- /// Creates a register allocator as the user specified on the command line.
- ///
- FunctionPass *createRegisterAllocator();
-
- /// SimpleRegisterAllocation Pass - This pass converts the input machine code
- /// from SSA form to use explicit registers by spilling every register. Wow,
- /// great policy huh?
- ///
- FunctionPass *createSimpleRegisterAllocator();
-
- /// LocalRegisterAllocation Pass - This pass register allocates the input code
- /// a basic block at a time, yielding code better than the simple register
- /// allocator, but not as good as a global allocator.
- ///
- FunctionPass *createLocalRegisterAllocator();
-
- /// BigBlockRegisterAllocation Pass - The BigBlock register allocator
- /// munches single basic blocks at a time, like the local register
- /// allocator. While the BigBlock allocator is a little slower, and uses
- /// somewhat more memory than the local register allocator, it tends to
- /// yield the best allocations (of any of the allocators) for blocks that
- /// have hundreds or thousands of instructions in sequence.
- ///
- FunctionPass *createBigBlockRegisterAllocator();
-
- /// LinearScanRegisterAllocation Pass - This pass implements the linear scan
- /// register allocation algorithm, a global register allocator.
- ///
- FunctionPass *createLinearScanRegisterAllocator();
-
- /// SimpleRegisterCoalescing Pass - Coalesce all copies possible. Can run
- /// independently of the register allocator.
- ///
- RegisterCoalescer *createSimpleRegisterCoalescer();
-
- /// PrologEpilogCodeInserter Pass - This pass inserts prolog and epilog code,
- /// and eliminates abstract frame references.
- ///
- FunctionPass *createPrologEpilogCodeInserter();
-
- /// LowerSubregs Pass - This pass lowers subregs to register-register copies
- /// which yields suboptimal, but correct code if the register allocator
- /// cannot coalesce all subreg operations during allocation.
- ///
- FunctionPass *createLowerSubregsPass();
-
- /// createPostRAScheduler - under development.
- FunctionPass *createPostRAScheduler();
-
- /// BranchFolding Pass - This pass performs machine code CFG based
- /// optimizations to delete branches to branches, eliminate branches to
- /// successor blocks (creating fall throughs), and eliminating branches over
- /// branches.
- FunctionPass *createBranchFoldingPass(bool DefaultEnableTailMerge);
-
- /// IfConverter Pass - This pass performs machine code if conversion.
- FunctionPass *createIfConverterPass();
-
- /// LoopAligner Pass - This pass aligns loop headers to target specific
- /// alignment boundary.
- FunctionPass *createLoopAlignerPass();
-
- /// DebugLabelFoldingPass - This pass prunes out redundant debug labels. This
- /// allows a debug emitter to determine if the range of two labels is empty,
- /// by seeing if the labels map to the same reduced label.
- FunctionPass *createDebugLabelFoldingPass();
-
- /// MachineCodeDeletion Pass - This pass deletes all of the machine code for
- /// the current function, which should happen after the function has been
- /// emitted to a .s file or to memory.
- FunctionPass *createMachineCodeDeleter();
-
- /// getRegisterAllocator - This creates an instance of the register allocator
- /// for the Sparc.
- FunctionPass *getRegisterAllocator(TargetMachine &T);
-
- /// IntrinsicLowering Pass - Performs target-independent LLVM IR
- /// transformations for highly portable collectors.
- FunctionPass *createGCLoweringPass();
-
- /// MachineCodeAnalysis Pass - Target-independent pass to mark safe points in
- /// machine code. Must be added very late during code generation, just prior
- /// to output, and importantly after all CFG transformations (such as branch
- /// folding).
- FunctionPass *createGCMachineCodeAnalysisPass();
-
- /// Deleter Pass - Releases collector metadata.
- ///
- FunctionPass *createCollectorMetadataDeleter();
-
- /// Creates a pass to print collector metadata.
- ///
- FunctionPass *createCollectorMetadataPrinter(std::ostream &OS);
-
- /// createMachineLICMPass - This pass performs LICM on machine instructions.
- ///
- FunctionPass *createMachineLICMPass();
-
- /// createMachineSinkingPass - This pass performs sinking on machine
- /// instructions.
- FunctionPass *createMachineSinkingPass();
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/CodeGen/PseudoSourceValue.h b/release_23/include/llvm/CodeGen/PseudoSourceValue.h
deleted file mode 100644
index 6d7fb1fa81b2..000000000000
--- a/release_23/include/llvm/CodeGen/PseudoSourceValue.h
+++ /dev/null
@@ -1,58 +0,0 @@
-//===-- llvm/CodeGen/PseudoSourceValue.h ------------------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains the declaration of the PseudoSourceValue class.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_CODEGEN_PSEUDOSOURCEVALUE_H
-#define LLVM_CODEGEN_PSEUDOSOURCEVALUE_H
-
-#include "llvm/Value.h"
-
-namespace llvm {
- /// PseudoSourceValue - Special value supplied for machine level alias
- /// analysis. It indicates that the a memory access references the functions
- /// stack frame (e.g., a spill slot), below the stack frame (e.g., argument
- /// space), or constant pool.
- class PseudoSourceValue : public Value {
- public:
- PseudoSourceValue();
-
- virtual void print(std::ostream &OS) const;
-
- /// classof - Methods for support type inquiry through isa, cast, and
- /// dyn_cast:
- ///
- static inline bool classof(const PseudoSourceValue *) { return true; }
- static inline bool classof(const Value *V) {
- return V->getValueID() == PseudoSourceValueVal;
- }
-
- /// A pseudo source value referencing to the stack frame of a function,
- /// e.g., a spill slot.
- static const PseudoSourceValue *getFixedStack();
-
- /// A source value referencing the area below the stack frame of a function,
- /// e.g., the argument space.
- static const PseudoSourceValue *getStack();
-
- /// A source value referencing the global offset table (or something the
- /// like).
- static const PseudoSourceValue *getGOT();
-
- /// A SV referencing the constant pool
- static const PseudoSourceValue *getConstantPool();
-
- /// A SV referencing the jump table
- static const PseudoSourceValue *getJumpTable();
- };
-} // End llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/CodeGen/RegAllocRegistry.h b/release_23/include/llvm/CodeGen/RegAllocRegistry.h
deleted file mode 100644
index a08e42a5d34b..000000000000
--- a/release_23/include/llvm/CodeGen/RegAllocRegistry.h
+++ /dev/null
@@ -1,64 +0,0 @@
-//===-- llvm/CodeGen/RegAllocRegistry.h -------------------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains the implementation for register allocator function
-// pass registry (RegisterRegAlloc).
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_CODEGENREGALLOCREGISTRY_H
-#define LLVM_CODEGENREGALLOCREGISTRY_H
-
-#include "llvm/CodeGen/MachinePassRegistry.h"
-
-namespace llvm {
-
-//===----------------------------------------------------------------------===//
-///
-/// RegisterRegAlloc class - Track the registration of register allocators.
-///
-//===----------------------------------------------------------------------===//
-class RegisterRegAlloc : public MachinePassRegistryNode {
-
-public:
-
- typedef FunctionPass *(*FunctionPassCtor)();
-
- static MachinePassRegistry Registry;
-
- RegisterRegAlloc(const char *N, const char *D, FunctionPassCtor C)
- : MachinePassRegistryNode(N, D, (MachinePassCtor)C)
- { Registry.Add(this); }
- ~RegisterRegAlloc() { Registry.Remove(this); }
-
-
- // Accessors.
- //
- RegisterRegAlloc *getNext() const {
- return (RegisterRegAlloc *)MachinePassRegistryNode::getNext();
- }
- static RegisterRegAlloc *getList() {
- return (RegisterRegAlloc *)Registry.getList();
- }
- static FunctionPassCtor getDefault() {
- return (FunctionPassCtor)Registry.getDefault();
- }
- static void setDefault(FunctionPassCtor C) {
- Registry.setDefault((MachinePassCtor)C);
- }
- static void setListener(MachinePassRegistryListener *L) {
- Registry.setListener(L);
- }
-
-};
-
-} // end namespace llvm
-
-
-#endif
diff --git a/release_23/include/llvm/CodeGen/RegisterCoalescer.h b/release_23/include/llvm/CodeGen/RegisterCoalescer.h
deleted file mode 100644
index 8ce824a1ae44..000000000000
--- a/release_23/include/llvm/CodeGen/RegisterCoalescer.h
+++ /dev/null
@@ -1,159 +0,0 @@
-//===-- RegisterCoalescer.h - Register Coalescing Interface ------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains the abstract interface for register coalescers,
-// allowing them to interact with and query register allocators.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/System/IncludeFile.h"
-#include "llvm/CodeGen/MachineInstr.h"
-#include "llvm/CodeGen/LiveIntervalAnalysis.h"
-#include "llvm/CodeGen/LiveVariables.h"
-#include "llvm/Target/TargetRegisterInfo.h"
-#include "llvm/Support/Debug.h"
-
-#ifndef LLVM_CODEGEN_REGISTER_COALESCER_H
-#define LLVM_CODEGEN_REGISTER_COALESCER_H
-
-namespace llvm
-{
- class MachineFunction;
- class RegallocQuery;
- class AnalysisUsage;
- class LiveIntervals;
- class MachineInstr;
- class TargetRegisterInfo;
-
- /// An abstract interface for register coalescers. Coalescers must
- /// implement this interface to be part of the coalescer analysis
- /// group.
- class RegisterCoalescer {
- public:
- static char ID; // Class identification, replacement for typeinfo
- RegisterCoalescer() {}
- virtual ~RegisterCoalescer(); // We want to be subclassed
-
- /// Run the coalescer on this function, providing interference
- /// data to query. Return whether we removed any copies.
- virtual bool coalesceFunction(MachineFunction &mf,
- RegallocQuery &ifd) = 0;
-
- /// Reset state. Can be used to allow a coalescer run by
- /// PassManager to be run again by the register allocator.
- virtual void reset(MachineFunction &mf) {};
-
- /// Register allocators must call this from their own
- /// getAnalysisUsage to cover the case where the coalescer is not
- /// a Pass in the proper sense and isn't managed by PassManager.
- /// PassManager needs to know which analyses to make available and
- /// which to invalidate when running the register allocator or any
- /// pass that might call coalescing. The long-term solution is to
- /// allow hierarchies of PassManagers.
- virtual void getAnalysisUsage(AnalysisUsage &AU) const {};
- };
-
- /// An abstract interface for register allocators to interact with
- /// coalescers
- ///
- /// Example:
- ///
- /// This is simply an example of how to use the RegallocQuery
- /// interface. It is not meant to be used in production.
- ///
- /// class LinearScanRegallocQuery : public RegallocQuery {
- /// private:
- /// const LiveIntervals &li;
- ///
- /// public:
- /// LinearScanRegallocQuery(LiveIntervals &intervals)
- /// : li(intervals) {};
- ///
- /// /// This is pretty slow and conservative, but since linear scan
- /// /// allocation doesn't pre-compute interference information it's
- /// /// the best we can do. Coalescers are always free to ignore this
- /// /// and implement their own discovery strategy. See
- /// /// SimpleRegisterCoalescing for an example.
- /// void getInterferences(IntervalSet &interferences,
- /// const LiveInterval &a) const {
- /// for(LiveIntervals::const_iterator iv = li.begin(),
- /// ivend = li.end();
- /// iv != ivend;
- /// ++iv) {
- /// if (interfere(a, iv->second)) {
- /// interferences.insert(&iv->second);
- /// }
- /// }
- /// };
- ///
- /// /// This is *really* slow and stupid. See above.
- /// int getNumberOfInterferences(const LiveInterval &a) const {
- /// IntervalSet intervals;
- /// getInterferences(intervals, a);
- /// return(intervals.size());
- /// };
- /// };
- ///
- /// In the allocator:
- ///
- /// RegisterCoalescer &coalescer = getAnalysis<RegisterCoalescer>();
- ///
- /// // We don't reset the coalescer so if it's already been run this
- /// // takes almost no time.
- /// LinearScanRegallocQuery ifd(*li_);
- /// coalescer.coalesceFunction(fn, ifd);
- ///
- class RegallocQuery {
- public:
- typedef SmallPtrSet<const LiveInterval *, 8> IntervalSet;
-
- virtual ~RegallocQuery() {};
-
- /// Return whether two live ranges interfere.
- virtual bool interfere(const LiveInterval &a,
- const LiveInterval &b) const {
- // A naive test
- return(a.overlaps(b));
- };
-
- /// Return the set of intervals that interfere with this one.
- virtual void getInterferences(IntervalSet &interferences,
- const LiveInterval &a) const = 0;
-
- /// This can often be cheaper than actually returning the
- /// interferences.
- virtual int getNumberOfInterferences(const LiveInterval &a) const = 0;
-
- /// Make any data structure updates necessary to reflect
- /// coalescing or other modifications.
- virtual void updateDataForMerge(const LiveInterval &a,
- const LiveInterval &b,
- const MachineInstr &copy) {};
-
- /// Allow the register allocator to communicate when it doesn't
- /// want a copy coalesced. This may be due to assumptions made by
- /// the allocator about various invariants and so this question is
- /// a matter of legality, not performance. Performance decisions
- /// about which copies to coalesce should be made by the
- /// coalescer.
- virtual bool isLegalToCoalesce(const MachineInstr &inst) const {
- return true;
- }
- };
-}
-
-// Because of the way .a files work, we must force the SimpleRC
-// implementation to be pulled in if the RegisterCoalescing header is
-// included. Otherwise we run the risk of RegisterCoalescing being
-// used, but the default implementation not being linked into the tool
-// that uses it.
-FORCE_DEFINING_FILE_TO_BE_LINKED(RegisterCoalescer)
-FORCE_DEFINING_FILE_TO_BE_LINKED(SimpleRegisterCoalescing)
-
-#endif
diff --git a/release_23/include/llvm/CodeGen/RegisterScavenging.h b/release_23/include/llvm/CodeGen/RegisterScavenging.h
deleted file mode 100644
index 4b1a6a94096c..000000000000
--- a/release_23/include/llvm/CodeGen/RegisterScavenging.h
+++ /dev/null
@@ -1,165 +0,0 @@
-//===-- RegisterScavenging.h - Machine register scavenging ------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file declares the machine register scavenger class. It can provide
-// information such as unused register at any point in a machine basic block.
-// It also provides a mechanism to make registers availbale by evicting them
-// to spill slots.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_CODEGEN_REGISTER_SCAVENGING_H
-#define LLVM_CODEGEN_REGISTER_SCAVENGING_H
-
-#include "llvm/CodeGen/MachineBasicBlock.h"
-#include "llvm/ADT/BitVector.h"
-
-namespace llvm {
-
-class MachineRegisterInfo;
-class TargetRegisterInfo;
-class TargetInstrInfo;
-class TargetRegisterClass;
-
-class RegScavenger {
- MachineBasicBlock *MBB;
- MachineBasicBlock::iterator MBBI;
- unsigned NumPhysRegs;
-
- /// Tracking - True if RegScavenger is currently tracking the liveness of
- /// registers.
- bool Tracking;
-
- /// ScavengingFrameIndex - Special spill slot used for scavenging a register
- /// post register allocation.
- int ScavengingFrameIndex;
-
- /// ScavengedReg - If none zero, the specific register is currently being
- /// scavenged. That is, it is spilled to the special scavenging stack slot.
- unsigned ScavengedReg;
-
- /// ScavengedRC - Register class of the scavenged register.
- ///
- const TargetRegisterClass *ScavengedRC;
-
- /// RegsAvailable - The current state of all the physical registers immediately
- /// before MBBI. One bit per physical register. If bit is set that means it's
- /// available, unset means the register is currently being used.
- BitVector RegsAvailable;
-
- /// ImplicitDefed - If bit is set that means the register is defined by an
- /// implicit_def instructions. That means it can be clobbered at will.
- BitVector ImplicitDefed;
-
-public:
- RegScavenger()
- : MBB(NULL), NumPhysRegs(0), Tracking(false),
- ScavengingFrameIndex(-1), ScavengedReg(0), ScavengedRC(NULL) {}
-
- explicit RegScavenger(MachineBasicBlock *mbb)
- : MBB(mbb), NumPhysRegs(0), Tracking(false),
- ScavengingFrameIndex(-1), ScavengedReg(0), ScavengedRC(NULL) {}
-
- /// enterBasicBlock - Start tracking liveness from the begin of the specific
- /// basic block.
- void enterBasicBlock(MachineBasicBlock *mbb);
-
- /// forward / backward - Move the internal MBB iterator and update register
- /// states.
- void forward();
- void backward();
-
- /// forward / backward - Move the internal MBB iterator and update register
- /// states until it has processed the specific iterator.
- void forward(MachineBasicBlock::iterator I) {
- while (MBBI != I) forward();
- }
- void backward(MachineBasicBlock::iterator I) {
- while (MBBI != I) backward();
- }
-
- /// skipTo - Move the internal MBB iterator but do not update register states.
- ///
- void skipTo(MachineBasicBlock::iterator I) { MBBI = I; }
-
- /// isReserved - Returns true if a register is reserved. It is never "unused".
- bool isReserved(unsigned Reg) const { return ReservedRegs[Reg]; }
-
- /// isUsed / isUsed - Test if a register is currently being used.
- ///
- bool isUsed(unsigned Reg) const { return !RegsAvailable[Reg]; }
- bool isUnused(unsigned Reg) const { return RegsAvailable[Reg]; }
-
- bool isImplicitlyDefined(unsigned Reg) const { return ImplicitDefed[Reg]; }
-
- /// getRegsUsed - return all registers currently in use in used.
- void getRegsUsed(BitVector &used, bool includeReserved);
-
- /// setUsed / setUnused - Mark the state of one or a number of registers.
- ///
- void setUsed(unsigned Reg, bool ImpDef = false);
- void setUsed(BitVector Regs, bool ImpDef = false) {
- RegsAvailable &= ~Regs;
- if (ImpDef)
- ImplicitDefed |= Regs;
- else
- ImplicitDefed &= ~Regs;
- }
- void setUnused(unsigned Reg, const MachineInstr *MI);
- void setUnused(BitVector Regs) {
- RegsAvailable |= Regs;
- ImplicitDefed &= ~Regs;
- }
-
- /// FindUnusedReg - Find a unused register of the specified register class
- /// from the specified set of registers. It return 0 is none is found.
- unsigned FindUnusedReg(const TargetRegisterClass *RegClass,
- const BitVector &Candidates) const;
-
- /// FindUnusedReg - Find a unused register of the specified register class.
- /// Exclude callee saved registers if directed. It return 0 is none is found.
- unsigned FindUnusedReg(const TargetRegisterClass *RegClass,
- bool ExCalleeSaved = false) const;
-
- /// setScavengingFrameIndex / getScavengingFrameIndex - accessor and setter of
- /// ScavengingFrameIndex.
- void setScavengingFrameIndex(int FI) { ScavengingFrameIndex = FI; }
- int getScavengingFrameIndex() const { return ScavengingFrameIndex; }
-
- /// scavengeRegister - Make a register of the specific register class
- /// available and do the appropriate bookkeeping. SPAdj is the stack
- /// adjustment due to call frame, it's passed along to eliminateFrameIndex().
- /// Returns the scavenged register.
- unsigned scavengeRegister(const TargetRegisterClass *RegClass,
- MachineBasicBlock::iterator I, int SPAdj);
- unsigned scavengeRegister(const TargetRegisterClass *RegClass, int SPAdj) {
- return scavengeRegister(RegClass, MBBI, SPAdj);
- }
-
-private:
- const TargetRegisterInfo *TRI;
- const TargetInstrInfo *TII;
- MachineRegisterInfo* MRI;
-
- /// CalleeSavedrRegs - A bitvector of callee saved registers for the target.
- ///
- BitVector CalleeSavedRegs;
-
- /// ReservedRegs - A bitvector of reserved registers.
- ///
- BitVector ReservedRegs;
-
- /// restoreScavengedReg - Restore scavenged by loading it back from the
- /// emergency spill slot. Mark it used.
- void restoreScavengedReg();
-};
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/CodeGen/RuntimeLibcalls.h b/release_23/include/llvm/CodeGen/RuntimeLibcalls.h
deleted file mode 100644
index 92a0b7888665..000000000000
--- a/release_23/include/llvm/CodeGen/RuntimeLibcalls.h
+++ /dev/null
@@ -1,153 +0,0 @@
-//===-- CodeGen/RuntimeLibcall.h - Runtime Library Calls --------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines the enum representing the list of runtime library calls
-// the backend may emit during code generation.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_CODEGEN_RUNTIMELIBCALLS_H
-#define LLVM_CODEGEN_RUNTIMELIBCALLS_H
-
-namespace llvm {
-namespace RTLIB {
- /// RTLIB::Libcall enum - This enum defines all of the runtime library calls
- /// the backend can emit. The various long double types cannot be merged,
- /// because 80-bit library functions use "xf" and 128-bit use "tf".
- ///
- /// When adding PPCF128 functions here, note that their names generally need
- /// to be overridden for Darwin with the xxx$LDBL128 form. See
- /// PPCISelLowering.cpp.
- ///
- enum Libcall {
- // Integer
- SHL_I32,
- SHL_I64,
- SRL_I32,
- SRL_I64,
- SRA_I32,
- SRA_I64,
- MUL_I32,
- MUL_I64,
- SDIV_I32,
- SDIV_I64,
- UDIV_I32,
- UDIV_I64,
- SREM_I32,
- SREM_I64,
- UREM_I32,
- UREM_I64,
- NEG_I32,
- NEG_I64,
-
- // FLOATING POINT
- ADD_F32,
- ADD_F64,
- ADD_F80,
- ADD_PPCF128,
- SUB_F32,
- SUB_F64,
- SUB_F80,
- SUB_PPCF128,
- MUL_F32,
- MUL_F64,
- MUL_F80,
- MUL_PPCF128,
- DIV_F32,
- DIV_F64,
- DIV_F80,
- DIV_PPCF128,
- REM_F32,
- REM_F64,
- REM_F80,
- REM_PPCF128,
- POWI_F32,
- POWI_F64,
- POWI_F80,
- POWI_PPCF128,
- SQRT_F32,
- SQRT_F64,
- SQRT_F80,
- SQRT_PPCF128,
- SIN_F32,
- SIN_F64,
- SIN_F80,
- SIN_PPCF128,
- COS_F32,
- COS_F64,
- COS_F80,
- COS_PPCF128,
- POW_F32,
- POW_F64,
- POW_F80,
- POW_PPCF128,
-
- // CONVERSION
- FPEXT_F32_F64,
- FPROUND_F64_F32,
- FPTOSINT_F32_I32,
- FPTOSINT_F32_I64,
- FPTOSINT_F32_I128,
- FPTOSINT_F64_I32,
- FPTOSINT_F64_I64,
- FPTOSINT_F64_I128,
- FPTOSINT_F80_I64,
- FPTOSINT_F80_I128,
- FPTOSINT_PPCF128_I64,
- FPTOSINT_PPCF128_I128,
- FPTOUINT_F32_I32,
- FPTOUINT_F32_I64,
- FPTOUINT_F32_I128,
- FPTOUINT_F64_I32,
- FPTOUINT_F64_I64,
- FPTOUINT_F64_I128,
- FPTOUINT_F80_I32,
- FPTOUINT_F80_I64,
- FPTOUINT_F80_I128,
- FPTOUINT_PPCF128_I64,
- FPTOUINT_PPCF128_I128,
- SINTTOFP_I32_F32,
- SINTTOFP_I32_F64,
- SINTTOFP_I64_F32,
- SINTTOFP_I64_F64,
- SINTTOFP_I64_F80,
- SINTTOFP_I64_PPCF128,
- SINTTOFP_I128_F32,
- SINTTOFP_I128_F64,
- SINTTOFP_I128_F80,
- SINTTOFP_I128_PPCF128,
- UINTTOFP_I32_F32,
- UINTTOFP_I32_F64,
- UINTTOFP_I64_F32,
- UINTTOFP_I64_F64,
-
- // COMPARISON
- OEQ_F32,
- OEQ_F64,
- UNE_F32,
- UNE_F64,
- OGE_F32,
- OGE_F64,
- OLT_F32,
- OLT_F64,
- OLE_F32,
- OLE_F64,
- OGT_F32,
- OGT_F64,
- UO_F32,
- UO_F64,
- O_F32,
- O_F64,
-
- UNKNOWN_LIBCALL
- };
-}
-}
-
-#endif
diff --git a/release_23/include/llvm/CodeGen/SchedGraphCommon.h b/release_23/include/llvm/CodeGen/SchedGraphCommon.h
deleted file mode 100644
index eeec617a3e78..000000000000
--- a/release_23/include/llvm/CodeGen/SchedGraphCommon.h
+++ /dev/null
@@ -1,289 +0,0 @@
-//===-- SchedGraphCommon.h - Scheduling Base Graph --------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// A common graph class that is based on the SSA graph. It includes
-// extra dependencies that are caused by machine resources.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_CODEGEN_SCHEDGRAPHCOMMON_H
-#define LLVM_CODEGEN_SCHEDGRAPHCOMMON_H
-
-#include "llvm/Value.h"
-#include "llvm/ADT/iterator"
-#include "llvm/Support/Streams.h"
-#include <vector>
-
-namespace llvm {
-
-class SchedGraphEdge;
-class SchedGraphNode;
-
-/******************** Exported Data Types and Constants ********************/
-
-typedef int ResourceId;
-const ResourceId InvalidRID = -1;
-const ResourceId MachineCCRegsRID = -2; // use +ve numbers for actual regs
-const ResourceId MachineIntRegsRID = -3; // use +ve numbers for actual regs
-const ResourceId MachineFPRegsRID = -4; // use +ve numbers for actual regs
-
-
-//*********************** Public Class Declarations ************************/
-class SchedGraphNodeCommon {
-protected:
- unsigned ID;
- std::vector<SchedGraphEdge*> inEdges;
- std::vector<SchedGraphEdge*> outEdges;
- int latency;
- int origIndexInBB; // original position of instr in BB
-
-public:
- typedef std::vector<SchedGraphEdge*>::iterator iterator;
- typedef std::vector<SchedGraphEdge*>::const_iterator const_iterator;
- typedef std::vector<SchedGraphEdge*>::reverse_iterator reverse_iterator;
- typedef std::vector<SchedGraphEdge*>::const_reverse_iterator const_reverse_iterator;
-
- // Accessor methods
- unsigned getNodeId() const { return ID; }
- int getLatency() const { return latency; }
- unsigned getNumInEdges() const { return inEdges.size(); }
- unsigned getNumOutEdges() const { return outEdges.size(); }
- int getOrigIndexInBB() const { return origIndexInBB; }
-
- // Iterators
- iterator beginInEdges() { return inEdges.begin(); }
- iterator endInEdges() { return inEdges.end(); }
- iterator beginOutEdges() { return outEdges.begin(); }
- iterator endOutEdges() { return outEdges.end(); }
-
- const_iterator beginInEdges() const { return inEdges.begin(); }
- const_iterator endInEdges() const { return inEdges.end(); }
- const_iterator beginOutEdges() const { return outEdges.begin(); }
- const_iterator endOutEdges() const { return outEdges.end(); }
-
- void dump(int indent=0) const;
-
- // Debugging support
- virtual void print(std::ostream &os) const = 0;
- void print(std::ostream *os) const { if (os) print(*os); }
-
-protected:
- friend class SchedGraphCommon;
- friend class SchedGraphEdge; // give access for adding edges
-
-
- // disable default constructor and provide a ctor for single-block graphs
- SchedGraphNodeCommon(); // DO NOT IMPLEMENT
-
- inline SchedGraphNodeCommon(unsigned Id, int index, int late=0) : ID(Id), latency(late), origIndexInBB(index) {}
-
- virtual ~SchedGraphNodeCommon();
-
- //Functions to add and remove edges
- inline void addInEdge(SchedGraphEdge* edge) { inEdges.push_back(edge); }
- inline void addOutEdge(SchedGraphEdge* edge) { outEdges.push_back(edge); }
- void removeInEdge(const SchedGraphEdge* edge);
- void removeOutEdge(const SchedGraphEdge* edge);
-
-};
-
-// ostream << operator for SchedGraphNode class
-inline std::ostream &operator<<(std::ostream &os,
- const SchedGraphNodeCommon &node) {
- node.print(os);
- return os;
-}
-
-//
-// SchedGraphEdge - Edge class to represent dependencies
-//
-class SchedGraphEdge {
-public:
- enum SchedGraphEdgeDepType {
- CtrlDep, MemoryDep, ValueDep, MachineRegister, MachineResource
- };
- enum DataDepOrderType {
- TrueDep = 0x1, AntiDep=0x2, OutputDep=0x4, NonDataDep=0x8
- };
-
-protected:
- SchedGraphNodeCommon* src;
- SchedGraphNodeCommon* sink;
- SchedGraphEdgeDepType depType;
- unsigned int depOrderType;
- int minDelay; // cached latency (assumes fixed target arch)
- int iteDiff;
-
- union {
- const Value* val;
- int machineRegNum;
- ResourceId resourceId;
- };
-
-public:
- // For all constructors, if minDelay is unspecified, minDelay is
- // set to _src->getLatency().
-
- // constructor for CtrlDep or MemoryDep edges, selected by 3rd argument
- SchedGraphEdge(SchedGraphNodeCommon* _src, SchedGraphNodeCommon* _sink,
- SchedGraphEdgeDepType _depType, unsigned int _depOrderType,
- int _minDelay = -1);
-
- // constructor for explicit value dependence (may be true/anti/output)
- SchedGraphEdge(SchedGraphNodeCommon* _src, SchedGraphNodeCommon* _sink,
- const Value* _val, unsigned int _depOrderType,
- int _minDelay = -1);
-
- // constructor for machine register dependence
- SchedGraphEdge(SchedGraphNodeCommon* _src,SchedGraphNodeCommon* _sink,
- unsigned int _regNum, unsigned int _depOrderType,
- int _minDelay = -1);
-
- // constructor for any other machine resource dependences.
- // DataDepOrderType is always NonDataDep. It it not an argument to
- // avoid overloading ambiguity with previous constructor.
- SchedGraphEdge(SchedGraphNodeCommon* _src, SchedGraphNodeCommon* _sink,
- ResourceId _resourceId, int _minDelay = -1);
-
- ~SchedGraphEdge() {}
-
- SchedGraphNodeCommon* getSrc() const { return src; }
- SchedGraphNodeCommon* getSink() const { return sink; }
- int getMinDelay() const { return minDelay; }
- SchedGraphEdgeDepType getDepType() const { return depType; }
- unsigned int getDepOrderType() const { return depOrderType; }
-
- const Value* getValue() const {
- assert(depType == ValueDep); return val;
- }
-
- int getMachineReg() const {
- assert(depType == MachineRegister); return machineRegNum;
- }
-
- int getResourceId() const {
- assert(depType == MachineResource); return resourceId;
- }
-
- void setIteDiff(int _iteDiff) {
- iteDiff = _iteDiff;
- }
-
- int getIteDiff() {
- return iteDiff;
- }
-
-public:
- // Debugging support
- void print(std::ostream &os) const;
- void print(std::ostream *os) const { if (os) print(*os); }
- void dump(int indent=0) const;
-
-private:
- // disable default ctor
- SchedGraphEdge(); // DO NOT IMPLEMENT
-};
-
-// ostream << operator for SchedGraphNode class
-inline std::ostream &operator<<(std::ostream &os, const SchedGraphEdge &edge) {
- edge.print(os);
- return os;
-}
-
-class SchedGraphCommon {
-
-protected:
- SchedGraphNodeCommon* graphRoot; // the root and leaf are not inserted
- SchedGraphNodeCommon* graphLeaf; // in the hash_map (see getNumNodes())
-
-public:
- //
- // Accessor methods
- //
- SchedGraphNodeCommon* getRoot() const { return graphRoot; }
- SchedGraphNodeCommon* getLeaf() const { return graphLeaf; }
-
- //
- // Delete nodes or edges from the graph.
- //
- void eraseNode(SchedGraphNodeCommon* node);
- void eraseIncomingEdges(SchedGraphNodeCommon* node, bool addDummyEdges = true);
- void eraseOutgoingEdges(SchedGraphNodeCommon* node, bool addDummyEdges = true);
- void eraseIncidentEdges(SchedGraphNodeCommon* node, bool addDummyEdges = true);
-
- SchedGraphCommon() {}
- ~SchedGraphCommon();
-};
-
-
-//********************** Sched Graph Iterators *****************************/
-
-// Ok to make it a template because it shd get instantiated at most twice:
-// for <SchedGraphNode, SchedGraphNode::iterator> and
-// for <const SchedGraphNode, SchedGraphNode::const_iterator>.
-//
-template <class _NodeType, class _EdgeType, class _EdgeIter>
-class SGPredIterator: public bidirectional_iterator<_NodeType, ptrdiff_t> {
-protected:
- _EdgeIter oi;
-public:
- typedef SGPredIterator<_NodeType, _EdgeType, _EdgeIter> _Self;
-
- inline SGPredIterator(_EdgeIter startEdge) : oi(startEdge) {}
-
- inline bool operator==(const _Self& x) const { return oi == x.oi; }
- inline bool operator!=(const _Self& x) const { return !operator==(x); }
-
- // operator*() differs for pred or succ iterator
- inline _NodeType* operator*() const { return (_NodeType*)(*oi)->getSrc(); }
- inline _NodeType* operator->() const { return operator*(); }
-
- inline _EdgeType* getEdge() const { return *(oi); }
-
- inline _Self &operator++() { ++oi; return *this; } // Preincrement
- inline _Self operator++(int) { // Postincrement
- _Self tmp(*this); ++*this; return tmp;
- }
-
- inline _Self &operator--() { --oi; return *this; } // Predecrement
- inline _Self operator--(int) { // Postdecrement
- _Self tmp = *this; --*this; return tmp;
- }
-};
-
-template <class _NodeType, class _EdgeType, class _EdgeIter>
-class SGSuccIterator : public bidirectional_iterator<_NodeType, ptrdiff_t> {
-protected:
- _EdgeIter oi;
-public:
- typedef SGSuccIterator<_NodeType, _EdgeType, _EdgeIter> _Self;
-
- inline SGSuccIterator(_EdgeIter startEdge) : oi(startEdge) {}
-
- inline bool operator==(const _Self& x) const { return oi == x.oi; }
- inline bool operator!=(const _Self& x) const { return !operator==(x); }
-
- inline _NodeType* operator*() const { return (_NodeType*)(*oi)->getSink(); }
- inline _NodeType* operator->() const { return operator*(); }
-
- inline _EdgeType* getEdge() const { return *(oi); }
-
- inline _Self &operator++() { ++oi; return *this; } // Preincrement
- inline _Self operator++(int) { // Postincrement
- _Self tmp(*this); ++*this; return tmp;
- }
-
- inline _Self &operator--() { --oi; return *this; } // Predecrement
- inline _Self operator--(int) { // Postdecrement
- _Self tmp = *this; --*this; return tmp;
- }
-};
-} // End llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/CodeGen/ScheduleDAG.h b/release_23/include/llvm/CodeGen/ScheduleDAG.h
deleted file mode 100644
index d49c7db6fde6..000000000000
--- a/release_23/include/llvm/CodeGen/ScheduleDAG.h
+++ /dev/null
@@ -1,487 +0,0 @@
-//===------- llvm/CodeGen/ScheduleDAG.h - Common Base Class------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the ScheduleDAG class, which is used as the common
-// base class for SelectionDAG-based instruction scheduler.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_CODEGEN_SCHEDULEDAG_H
-#define LLVM_CODEGEN_SCHEDULEDAG_H
-
-#include "llvm/CodeGen/MachineBasicBlock.h"
-#include "llvm/CodeGen/SelectionDAG.h"
-#include "llvm/ADT/BitVector.h"
-#include "llvm/ADT/DenseMap.h"
-#include "llvm/ADT/GraphTraits.h"
-#include "llvm/ADT/SmallSet.h"
-
-namespace llvm {
- struct InstrStage;
- struct SUnit;
- class MachineConstantPool;
- class MachineFunction;
- class MachineModuleInfo;
- class MachineRegisterInfo;
- class MachineInstr;
- class TargetRegisterInfo;
- class SelectionDAG;
- class SelectionDAGISel;
- class TargetInstrInfo;
- class TargetInstrDesc;
- class TargetLowering;
- class TargetMachine;
- class TargetRegisterClass;
-
- /// HazardRecognizer - This determines whether or not an instruction can be
- /// issued this cycle, and whether or not a noop needs to be inserted to handle
- /// the hazard.
- class HazardRecognizer {
- public:
- virtual ~HazardRecognizer();
-
- enum HazardType {
- NoHazard, // This instruction can be emitted at this cycle.
- Hazard, // This instruction can't be emitted at this cycle.
- NoopHazard // This instruction can't be emitted, and needs noops.
- };
-
- /// getHazardType - Return the hazard type of emitting this node. There are
- /// three possible results. Either:
- /// * NoHazard: it is legal to issue this instruction on this cycle.
- /// * Hazard: issuing this instruction would stall the machine. If some
- /// other instruction is available, issue it first.
- /// * NoopHazard: issuing this instruction would break the program. If
- /// some other instruction can be issued, do so, otherwise issue a noop.
- virtual HazardType getHazardType(SDNode *Node) {
- return NoHazard;
- }
-
- /// EmitInstruction - This callback is invoked when an instruction is
- /// emitted, to advance the hazard state.
- virtual void EmitInstruction(SDNode *Node) {
- }
-
- /// AdvanceCycle - This callback is invoked when no instructions can be
- /// issued on this cycle without a hazard. This should increment the
- /// internal state of the hazard recognizer so that previously "Hazard"
- /// instructions will now not be hazards.
- virtual void AdvanceCycle() {
- }
-
- /// EmitNoop - This callback is invoked when a noop was added to the
- /// instruction stream.
- virtual void EmitNoop() {
- }
- };
-
- /// SDep - Scheduling dependency. It keeps track of dependent nodes,
- /// cost of the depdenency, etc.
- struct SDep {
- SUnit *Dep; // Dependent - either a predecessor or a successor.
- unsigned Reg; // If non-zero, this dep is a phy register dependency.
- int Cost; // Cost of the dependency.
- bool isCtrl : 1; // True iff it's a control dependency.
- bool isSpecial : 1; // True iff it's a special ctrl dep added during sched.
- SDep(SUnit *d, unsigned r, int t, bool c, bool s)
- : Dep(d), Reg(r), Cost(t), isCtrl(c), isSpecial(s) {}
- };
-
- /// SUnit - Scheduling unit. It's an wrapper around either a single SDNode or
- /// a group of nodes flagged together.
- struct SUnit {
- SDNode *Node; // Representative node.
- SmallVector<SDNode*,4> FlaggedNodes;// All nodes flagged to Node.
- unsigned InstanceNo; // Instance#. One SDNode can be multiple
- // SUnit due to cloning.
-
- // Preds/Succs - The SUnits before/after us in the graph. The boolean value
- // is true if the edge is a token chain edge, false if it is a value edge.
- SmallVector<SDep, 4> Preds; // All sunit predecessors.
- SmallVector<SDep, 4> Succs; // All sunit successors.
-
- typedef SmallVector<SDep, 4>::iterator pred_iterator;
- typedef SmallVector<SDep, 4>::iterator succ_iterator;
- typedef SmallVector<SDep, 4>::const_iterator const_pred_iterator;
- typedef SmallVector<SDep, 4>::const_iterator const_succ_iterator;
-
- unsigned NodeNum; // Entry # of node in the node vector.
- unsigned NodeQueueId; // Queue id of node.
- unsigned short Latency; // Node latency.
- short NumPreds; // # of preds.
- short NumSuccs; // # of sucss.
- short NumPredsLeft; // # of preds not scheduled.
- short NumSuccsLeft; // # of succs not scheduled.
- bool isTwoAddress : 1; // Is a two-address instruction.
- bool isCommutable : 1; // Is a commutable instruction.
- bool hasPhysRegDefs : 1; // Has physreg defs that are being used.
- bool isPending : 1; // True once pending.
- bool isAvailable : 1; // True once available.
- bool isScheduled : 1; // True once scheduled.
- unsigned CycleBound; // Upper/lower cycle to be scheduled at.
- unsigned Cycle; // Once scheduled, the cycle of the op.
- unsigned Depth; // Node depth;
- unsigned Height; // Node height;
- const TargetRegisterClass *CopyDstRC; // Is a special copy node if not null.
- const TargetRegisterClass *CopySrcRC;
-
- SUnit(SDNode *node, unsigned nodenum)
- : Node(node), InstanceNo(0), NodeNum(nodenum), NodeQueueId(0), Latency(0),
- NumPreds(0), NumSuccs(0), NumPredsLeft(0), NumSuccsLeft(0),
- isTwoAddress(false), isCommutable(false), hasPhysRegDefs(false),
- isPending(false), isAvailable(false), isScheduled(false),
- CycleBound(0), Cycle(0), Depth(0), Height(0),
- CopyDstRC(NULL), CopySrcRC(NULL) {}
-
- /// addPred - This adds the specified node as a pred of the current node if
- /// not already. This returns true if this is a new pred.
- bool addPred(SUnit *N, bool isCtrl, bool isSpecial,
- unsigned PhyReg = 0, int Cost = 1) {
- for (unsigned i = 0, e = (unsigned)Preds.size(); i != e; ++i)
- if (Preds[i].Dep == N &&
- Preds[i].isCtrl == isCtrl && Preds[i].isSpecial == isSpecial)
- return false;
- Preds.push_back(SDep(N, PhyReg, Cost, isCtrl, isSpecial));
- N->Succs.push_back(SDep(this, PhyReg, Cost, isCtrl, isSpecial));
- if (!isCtrl) {
- ++NumPreds;
- ++N->NumSuccs;
- }
- if (!N->isScheduled)
- ++NumPredsLeft;
- if (!isScheduled)
- ++N->NumSuccsLeft;
- return true;
- }
-
- bool removePred(SUnit *N, bool isCtrl, bool isSpecial) {
- for (SmallVector<SDep, 4>::iterator I = Preds.begin(), E = Preds.end();
- I != E; ++I)
- if (I->Dep == N && I->isCtrl == isCtrl && I->isSpecial == isSpecial) {
- bool FoundSucc = false;
- for (SmallVector<SDep, 4>::iterator II = N->Succs.begin(),
- EE = N->Succs.end(); II != EE; ++II)
- if (II->Dep == this &&
- II->isCtrl == isCtrl && II->isSpecial == isSpecial) {
- FoundSucc = true;
- N->Succs.erase(II);
- break;
- }
- assert(FoundSucc && "Mismatching preds / succs lists!");
- Preds.erase(I);
- if (!isCtrl) {
- --NumPreds;
- --N->NumSuccs;
- }
- if (!N->isScheduled)
- --NumPredsLeft;
- if (!isScheduled)
- --N->NumSuccsLeft;
- return true;
- }
- return false;
- }
-
- bool isPred(SUnit *N) {
- for (unsigned i = 0, e = (unsigned)Preds.size(); i != e; ++i)
- if (Preds[i].Dep == N)
- return true;
- return false;
- }
-
- bool isSucc(SUnit *N) {
- for (unsigned i = 0, e = (unsigned)Succs.size(); i != e; ++i)
- if (Succs[i].Dep == N)
- return true;
- return false;
- }
-
- void dump(const SelectionDAG *G) const;
- void dumpAll(const SelectionDAG *G) const;
- };
-
- //===--------------------------------------------------------------------===//
- /// SchedulingPriorityQueue - This interface is used to plug different
- /// priorities computation algorithms into the list scheduler. It implements
- /// the interface of a standard priority queue, where nodes are inserted in
- /// arbitrary order and returned in priority order. The computation of the
- /// priority and the representation of the queue are totally up to the
- /// implementation to decide.
- ///
- class SchedulingPriorityQueue {
- public:
- virtual ~SchedulingPriorityQueue() {}
-
- virtual void initNodes(DenseMap<SDNode*, std::vector<SUnit*> > &SUMap,
- std::vector<SUnit> &SUnits) = 0;
- virtual void addNode(const SUnit *SU) = 0;
- virtual void updateNode(const SUnit *SU) = 0;
- virtual void releaseState() = 0;
-
- virtual unsigned size() const = 0;
- virtual bool empty() const = 0;
- virtual void push(SUnit *U) = 0;
-
- virtual void push_all(const std::vector<SUnit *> &Nodes) = 0;
- virtual SUnit *pop() = 0;
-
- virtual void remove(SUnit *SU) = 0;
-
- /// ScheduledNode - As each node is scheduled, this method is invoked. This
- /// allows the priority function to adjust the priority of node that have
- /// already been emitted.
- virtual void ScheduledNode(SUnit *Node) {}
-
- virtual void UnscheduledNode(SUnit *Node) {}
- };
-
- class ScheduleDAG {
- public:
- SelectionDAG &DAG; // DAG of the current basic block
- MachineBasicBlock *BB; // Current basic block
- const TargetMachine &TM; // Target processor
- const TargetInstrInfo *TII; // Target instruction information
- const TargetRegisterInfo *TRI; // Target processor register info
- TargetLowering *TLI; // Target lowering info
- MachineFunction *MF; // Machine function
- MachineRegisterInfo &MRI; // Virtual/real register map
- MachineConstantPool *ConstPool; // Target constant pool
- std::vector<SUnit*> Sequence; // The schedule. Null SUnit*'s
- // represent noop instructions.
- DenseMap<SDNode*, std::vector<SUnit*> > SUnitMap;
- // SDNode to SUnit mapping (n -> n).
- std::vector<SUnit> SUnits; // The scheduling units.
- SmallSet<SDNode*, 16> CommuteSet; // Nodes that should be commuted.
-
- ScheduleDAG(SelectionDAG &dag, MachineBasicBlock *bb,
- const TargetMachine &tm);
-
- virtual ~ScheduleDAG() {}
-
- /// viewGraph - Pop up a GraphViz/gv window with the ScheduleDAG rendered
- /// using 'dot'.
- ///
- void viewGraph();
-
- /// Run - perform scheduling.
- ///
- MachineBasicBlock *Run();
-
- /// isPassiveNode - Return true if the node is a non-scheduled leaf.
- ///
- static bool isPassiveNode(SDNode *Node) {
- if (isa<ConstantSDNode>(Node)) return true;
- if (isa<ConstantFPSDNode>(Node)) return true;
- if (isa<RegisterSDNode>(Node)) return true;
- if (isa<GlobalAddressSDNode>(Node)) return true;
- if (isa<BasicBlockSDNode>(Node)) return true;
- if (isa<FrameIndexSDNode>(Node)) return true;
- if (isa<ConstantPoolSDNode>(Node)) return true;
- if (isa<JumpTableSDNode>(Node)) return true;
- if (isa<ExternalSymbolSDNode>(Node)) return true;
- if (isa<MemOperandSDNode>(Node)) return true;
- if (Node->getOpcode() == ISD::EntryToken) return true;
- return false;
- }
-
- /// NewSUnit - Creates a new SUnit and return a ptr to it.
- ///
- SUnit *NewSUnit(SDNode *N) {
- SUnits.push_back(SUnit(N, (unsigned)SUnits.size()));
- return &SUnits.back();
- }
-
- /// Clone - Creates a clone of the specified SUnit. It does not copy the
- /// predecessors / successors info nor the temporary scheduling states.
- SUnit *Clone(SUnit *N);
-
- /// BuildSchedUnits - Build SUnits from the selection dag that we are input.
- /// This SUnit graph is similar to the SelectionDAG, but represents flagged
- /// together nodes with a single SUnit.
- void BuildSchedUnits();
-
- /// ComputeLatency - Compute node latency.
- ///
- void ComputeLatency(SUnit *SU);
-
- /// CalculateDepths, CalculateHeights - Calculate node depth / height.
- ///
- void CalculateDepths();
- void CalculateHeights();
-
- /// CountResults - The results of target nodes have register or immediate
- /// operands first, then an optional chain, and optional flag operands
- /// (which do not go into the machine instrs.)
- static unsigned CountResults(SDNode *Node);
-
- /// CountOperands - The inputs to target nodes have any actual inputs first,
- /// followed by special operands that describe memory references, then an
- /// optional chain operand, then flag operands. Compute the number of
- /// actual operands that will go into the resulting MachineInstr.
- static unsigned CountOperands(SDNode *Node);
-
- /// ComputeMemOperandsEnd - Find the index one past the last
- /// MemOperandSDNode operand
- static unsigned ComputeMemOperandsEnd(SDNode *Node);
-
- /// EmitNode - Generate machine code for an node and needed dependencies.
- /// VRBaseMap contains, for each already emitted node, the first virtual
- /// register number for the results of the node.
- ///
- void EmitNode(SDNode *Node, unsigned InstNo,
- DenseMap<SDOperand, unsigned> &VRBaseMap);
-
- /// EmitNoop - Emit a noop instruction.
- ///
- void EmitNoop();
-
- void EmitSchedule();
-
- void dumpSchedule() const;
-
- /// Schedule - Order nodes according to selected style.
- ///
- virtual void Schedule() {}
-
- private:
- /// EmitSubregNode - Generate machine code for subreg nodes.
- ///
- void EmitSubregNode(SDNode *Node,
- DenseMap<SDOperand, unsigned> &VRBaseMap);
-
- /// getVR - Return the virtual register corresponding to the specified result
- /// of the specified node.
- unsigned getVR(SDOperand Op, DenseMap<SDOperand, unsigned> &VRBaseMap);
-
- /// getDstOfCopyToRegUse - If the only use of the specified result number of
- /// node is a CopyToReg, return its destination register. Return 0 otherwise.
- unsigned getDstOfOnlyCopyToRegUse(SDNode *Node, unsigned ResNo) const;
-
- void AddOperand(MachineInstr *MI, SDOperand Op, unsigned IIOpNum,
- const TargetInstrDesc *II,
- DenseMap<SDOperand, unsigned> &VRBaseMap);
-
- void AddMemOperand(MachineInstr *MI, const MachineMemOperand &MO);
-
- void EmitCrossRCCopy(SUnit *SU, DenseMap<SUnit*, unsigned> &VRBaseMap);
-
- /// EmitCopyFromReg - Generate machine code for an CopyFromReg node or an
- /// implicit physical register output.
- void EmitCopyFromReg(SDNode *Node, unsigned ResNo, unsigned InstNo,
- unsigned SrcReg,
- DenseMap<SDOperand, unsigned> &VRBaseMap);
-
- void CreateVirtualRegisters(SDNode *Node, MachineInstr *MI,
- const TargetInstrDesc &II,
- DenseMap<SDOperand, unsigned> &VRBaseMap);
-
- /// EmitLiveInCopy - Emit a copy for a live in physical register. If the
- /// physical register has only a single copy use, then coalesced the copy
- /// if possible.
- void EmitLiveInCopy(MachineBasicBlock *MBB,
- MachineBasicBlock::iterator &InsertPos,
- unsigned VirtReg, unsigned PhysReg,
- const TargetRegisterClass *RC,
- DenseMap<MachineInstr*, unsigned> &CopyRegMap);
-
- /// EmitLiveInCopies - If this is the first basic block in the function,
- /// and if it has live ins that need to be copied into vregs, emit the
- /// copies into the top of the block.
- void EmitLiveInCopies(MachineBasicBlock *MBB);
- };
-
- /// createBURRListDAGScheduler - This creates a bottom up register usage
- /// reduction list scheduler.
- ScheduleDAG* createBURRListDAGScheduler(SelectionDAGISel *IS,
- SelectionDAG *DAG,
- MachineBasicBlock *BB);
-
- /// createTDRRListDAGScheduler - This creates a top down register usage
- /// reduction list scheduler.
- ScheduleDAG* createTDRRListDAGScheduler(SelectionDAGISel *IS,
- SelectionDAG *DAG,
- MachineBasicBlock *BB);
-
- /// createTDListDAGScheduler - This creates a top-down list scheduler with
- /// a hazard recognizer.
- ScheduleDAG* createTDListDAGScheduler(SelectionDAGISel *IS,
- SelectionDAG *DAG,
- MachineBasicBlock *BB);
-
- /// createDefaultScheduler - This creates an instruction scheduler appropriate
- /// for the target.
- ScheduleDAG* createDefaultScheduler(SelectionDAGISel *IS,
- SelectionDAG *DAG,
- MachineBasicBlock *BB);
-
- class SUnitIterator : public forward_iterator<SUnit, ptrdiff_t> {
- SUnit *Node;
- unsigned Operand;
-
- SUnitIterator(SUnit *N, unsigned Op) : Node(N), Operand(Op) {}
- public:
- bool operator==(const SUnitIterator& x) const {
- return Operand == x.Operand;
- }
- bool operator!=(const SUnitIterator& x) const { return !operator==(x); }
-
- const SUnitIterator &operator=(const SUnitIterator &I) {
- assert(I.Node == Node && "Cannot assign iterators to two different nodes!");
- Operand = I.Operand;
- return *this;
- }
-
- pointer operator*() const {
- return Node->Preds[Operand].Dep;
- }
- pointer operator->() const { return operator*(); }
-
- SUnitIterator& operator++() { // Preincrement
- ++Operand;
- return *this;
- }
- SUnitIterator operator++(int) { // Postincrement
- SUnitIterator tmp = *this; ++*this; return tmp;
- }
-
- static SUnitIterator begin(SUnit *N) { return SUnitIterator(N, 0); }
- static SUnitIterator end (SUnit *N) {
- return SUnitIterator(N, (unsigned)N->Preds.size());
- }
-
- unsigned getOperand() const { return Operand; }
- const SUnit *getNode() const { return Node; }
- bool isCtrlDep() const { return Node->Preds[Operand].isCtrl; }
- bool isSpecialDep() const { return Node->Preds[Operand].isSpecial; }
- };
-
- template <> struct GraphTraits<SUnit*> {
- typedef SUnit NodeType;
- typedef SUnitIterator ChildIteratorType;
- static inline NodeType *getEntryNode(SUnit *N) { return N; }
- static inline ChildIteratorType child_begin(NodeType *N) {
- return SUnitIterator::begin(N);
- }
- static inline ChildIteratorType child_end(NodeType *N) {
- return SUnitIterator::end(N);
- }
- };
-
- template <> struct GraphTraits<ScheduleDAG*> : public GraphTraits<SUnit*> {
- typedef std::vector<SUnit>::iterator nodes_iterator;
- static nodes_iterator nodes_begin(ScheduleDAG *G) {
- return G->SUnits.begin();
- }
- static nodes_iterator nodes_end(ScheduleDAG *G) {
- return G->SUnits.end();
- }
- };
-}
-
-#endif
diff --git a/release_23/include/llvm/CodeGen/SchedulerRegistry.h b/release_23/include/llvm/CodeGen/SchedulerRegistry.h
deleted file mode 100644
index 4c34121d5452..000000000000
--- a/release_23/include/llvm/CodeGen/SchedulerRegistry.h
+++ /dev/null
@@ -1,71 +0,0 @@
-//===-- llvm/CodeGen/SchedulerRegistry.h ------------------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains the implementation for instruction scheduler function
-// pass registry (RegisterScheduler).
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_CODEGENSCHEDULERREGISTRY_H
-#define LLVM_CODEGENSCHEDULERREGISTRY_H
-
-#include "llvm/CodeGen/MachinePassRegistry.h"
-
-namespace llvm {
-
-//===----------------------------------------------------------------------===//
-///
-/// RegisterScheduler class - Track the registration of instruction schedulers.
-///
-//===----------------------------------------------------------------------===//
-
-class SelectionDAGISel;
-class ScheduleDAG;
-class SelectionDAG;
-class MachineBasicBlock;
-
-class RegisterScheduler : public MachinePassRegistryNode {
-
-public:
-
- typedef ScheduleDAG *(*FunctionPassCtor)(SelectionDAGISel*, SelectionDAG*,
- MachineBasicBlock*);
-
- static MachinePassRegistry Registry;
-
- RegisterScheduler(const char *N, const char *D, FunctionPassCtor C)
- : MachinePassRegistryNode(N, D, (MachinePassCtor)C)
- { Registry.Add(this); }
- ~RegisterScheduler() { Registry.Remove(this); }
-
-
- // Accessors.
- //
- RegisterScheduler *getNext() const {
- return (RegisterScheduler *)MachinePassRegistryNode::getNext();
- }
- static RegisterScheduler *getList() {
- return (RegisterScheduler *)Registry.getList();
- }
- static FunctionPassCtor getDefault() {
- return (FunctionPassCtor)Registry.getDefault();
- }
- static void setDefault(FunctionPassCtor C) {
- Registry.setDefault((MachinePassCtor)C);
- }
- static void setListener(MachinePassRegistryListener *L) {
- Registry.setListener(L);
- }
-
-};
-
-} // end namespace llvm
-
-
-#endif
diff --git a/release_23/include/llvm/CodeGen/SelectionDAG.h b/release_23/include/llvm/CodeGen/SelectionDAG.h
deleted file mode 100644
index b36ed86ac96e..000000000000
--- a/release_23/include/llvm/CodeGen/SelectionDAG.h
+++ /dev/null
@@ -1,639 +0,0 @@
-//===-- llvm/CodeGen/SelectionDAG.h - InstSelection DAG ---------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file declares the SelectionDAG class, and transitively defines the
-// SDNode class and subclasses.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_CODEGEN_SELECTIONDAG_H
-#define LLVM_CODEGEN_SELECTIONDAG_H
-
-#include "llvm/ADT/FoldingSet.h"
-#include "llvm/ADT/ilist"
-#include "llvm/CodeGen/SelectionDAGNodes.h"
-
-#include <list>
-#include <vector>
-#include <map>
-#include <set>
-#include <string>
-
-namespace llvm {
- class AliasAnalysis;
- class TargetLowering;
- class TargetMachine;
- class MachineModuleInfo;
- class MachineFunction;
- class MachineConstantPoolValue;
-
-/// SelectionDAG class - This is used to represent a portion of an LLVM function
-/// in a low-level Data Dependence DAG representation suitable for instruction
-/// selection. This DAG is constructed as the first step of instruction
-/// selection in order to allow implementation of machine specific optimizations
-/// and code simplifications.
-///
-/// The representation used by the SelectionDAG is a target-independent
-/// representation, which has some similarities to the GCC RTL representation,
-/// but is significantly more simple, powerful, and is a graph form instead of a
-/// linear form.
-///
-class SelectionDAG {
- TargetLowering &TLI;
- MachineFunction &MF;
- MachineModuleInfo *MMI;
-
- /// Root - The root of the entire DAG. EntryNode - The starting token.
- SDOperand Root, EntryNode;
-
- /// AllNodes - A linked list of nodes in the current DAG.
- ilist<SDNode> AllNodes;
-
- /// CSEMap - This structure is used to memoize nodes, automatically performing
- /// CSE with existing nodes with a duplicate is requested.
- FoldingSet<SDNode> CSEMap;
-
-public:
- SelectionDAG(TargetLowering &tli, MachineFunction &mf, MachineModuleInfo *mmi)
- : TLI(tli), MF(mf), MMI(mmi) {
- EntryNode = Root = getNode(ISD::EntryToken, MVT::Other);
- }
- ~SelectionDAG();
-
- MachineFunction &getMachineFunction() const { return MF; }
- const TargetMachine &getTarget() const;
- TargetLowering &getTargetLoweringInfo() const { return TLI; }
- MachineModuleInfo *getMachineModuleInfo() const { return MMI; }
-
- /// viewGraph - Pop up a GraphViz/gv window with the DAG rendered using 'dot'.
- ///
- void viewGraph();
-
-#ifndef NDEBUG
- std::map<const SDNode *, std::string> NodeGraphAttrs;
-#endif
-
- /// clearGraphAttrs - Clear all previously defined node graph attributes.
- /// Intended to be used from a debugging tool (eg. gdb).
- void clearGraphAttrs();
-
- /// setGraphAttrs - Set graph attributes for a node. (eg. "color=red".)
- ///
- void setGraphAttrs(const SDNode *N, const char *Attrs);
-
- /// getGraphAttrs - Get graph attributes for a node. (eg. "color=red".)
- /// Used from getNodeAttributes.
- const std::string getGraphAttrs(const SDNode *N) const;
-
- /// setGraphColor - Convenience for setting node color attribute.
- ///
- void setGraphColor(const SDNode *N, const char *Color);
-
- typedef ilist<SDNode>::const_iterator allnodes_const_iterator;
- allnodes_const_iterator allnodes_begin() const { return AllNodes.begin(); }
- allnodes_const_iterator allnodes_end() const { return AllNodes.end(); }
- typedef ilist<SDNode>::iterator allnodes_iterator;
- allnodes_iterator allnodes_begin() { return AllNodes.begin(); }
- allnodes_iterator allnodes_end() { return AllNodes.end(); }
-
- /// getRoot - Return the root tag of the SelectionDAG.
- ///
- const SDOperand &getRoot() const { return Root; }
-
- /// getEntryNode - Return the token chain corresponding to the entry of the
- /// function.
- const SDOperand &getEntryNode() const { return EntryNode; }
-
- /// setRoot - Set the current root tag of the SelectionDAG.
- ///
- const SDOperand &setRoot(SDOperand N) { return Root = N; }
-
- /// Combine - This iterates over the nodes in the SelectionDAG, folding
- /// certain types of nodes together, or eliminating superfluous nodes. When
- /// the AfterLegalize argument is set to 'true', Combine takes care not to
- /// generate any nodes that will be illegal on the target.
- void Combine(bool AfterLegalize, AliasAnalysis &AA);
-
- /// LegalizeTypes - This transforms the SelectionDAG into a SelectionDAG that
- /// only uses types natively supported by the target.
- ///
- /// Note that this is an involved process that may invalidate pointers into
- /// the graph.
- void LegalizeTypes();
-
- /// Legalize - This transforms the SelectionDAG into a SelectionDAG that is
- /// compatible with the target instruction selector, as indicated by the
- /// TargetLowering object.
- ///
- /// Note that this is an involved process that may invalidate pointers into
- /// the graph.
- void Legalize();
-
- /// RemoveDeadNodes - This method deletes all unreachable nodes in the
- /// SelectionDAG.
- void RemoveDeadNodes();
-
- /// DeleteNode - Remove the specified node from the system. This node must
- /// have no referrers.
- void DeleteNode(SDNode *N);
-
- /// getVTList - Return an SDVTList that represents the list of values
- /// specified.
- SDVTList getVTList(MVT::ValueType VT);
- SDVTList getVTList(MVT::ValueType VT1, MVT::ValueType VT2);
- SDVTList getVTList(MVT::ValueType VT1, MVT::ValueType VT2,MVT::ValueType VT3);
- SDVTList getVTList(const MVT::ValueType *VTs, unsigned NumVTs);
-
- /// getNodeValueTypes - These are obsolete, use getVTList instead.
- const MVT::ValueType *getNodeValueTypes(MVT::ValueType VT) {
- return getVTList(VT).VTs;
- }
- const MVT::ValueType *getNodeValueTypes(MVT::ValueType VT1,
- MVT::ValueType VT2) {
- return getVTList(VT1, VT2).VTs;
- }
- const MVT::ValueType *getNodeValueTypes(MVT::ValueType VT1,MVT::ValueType VT2,
- MVT::ValueType VT3) {
- return getVTList(VT1, VT2, VT3).VTs;
- }
- const MVT::ValueType *getNodeValueTypes(std::vector<MVT::ValueType> &VTList) {
- return getVTList(&VTList[0], (unsigned)VTList.size()).VTs;
- }
-
-
- //===--------------------------------------------------------------------===//
- // Node creation methods.
- //
- SDOperand getString(const std::string &Val);
- SDOperand getConstant(uint64_t Val, MVT::ValueType VT, bool isTarget = false);
- SDOperand getConstant(const APInt &Val, MVT::ValueType VT, bool isTarget = false);
- SDOperand getIntPtrConstant(uint64_t Val, bool isTarget = false);
- SDOperand getTargetConstant(uint64_t Val, MVT::ValueType VT) {
- return getConstant(Val, VT, true);
- }
- SDOperand getTargetConstant(const APInt &Val, MVT::ValueType VT) {
- return getConstant(Val, VT, true);
- }
- SDOperand getConstantFP(double Val, MVT::ValueType VT, bool isTarget = false);
- SDOperand getConstantFP(const APFloat& Val, MVT::ValueType VT,
- bool isTarget = false);
- SDOperand getTargetConstantFP(double Val, MVT::ValueType VT) {
- return getConstantFP(Val, VT, true);
- }
- SDOperand getTargetConstantFP(const APFloat& Val, MVT::ValueType VT) {
- return getConstantFP(Val, VT, true);
- }
- SDOperand getGlobalAddress(const GlobalValue *GV, MVT::ValueType VT,
- int offset = 0, bool isTargetGA = false);
- SDOperand getTargetGlobalAddress(const GlobalValue *GV, MVT::ValueType VT,
- int offset = 0) {
- return getGlobalAddress(GV, VT, offset, true);
- }
- SDOperand getFrameIndex(int FI, MVT::ValueType VT, bool isTarget = false);
- SDOperand getTargetFrameIndex(int FI, MVT::ValueType VT) {
- return getFrameIndex(FI, VT, true);
- }
- SDOperand getJumpTable(int JTI, MVT::ValueType VT, bool isTarget = false);
- SDOperand getTargetJumpTable(int JTI, MVT::ValueType VT) {
- return getJumpTable(JTI, VT, true);
- }
- SDOperand getConstantPool(Constant *C, MVT::ValueType VT,
- unsigned Align = 0, int Offs = 0, bool isT=false);
- SDOperand getTargetConstantPool(Constant *C, MVT::ValueType VT,
- unsigned Align = 0, int Offset = 0) {
- return getConstantPool(C, VT, Align, Offset, true);
- }
- SDOperand getConstantPool(MachineConstantPoolValue *C, MVT::ValueType VT,
- unsigned Align = 0, int Offs = 0, bool isT=false);
- SDOperand getTargetConstantPool(MachineConstantPoolValue *C,
- MVT::ValueType VT, unsigned Align = 0,
- int Offset = 0) {
- return getConstantPool(C, VT, Align, Offset, true);
- }
- SDOperand getBasicBlock(MachineBasicBlock *MBB);
- SDOperand getExternalSymbol(const char *Sym, MVT::ValueType VT);
- SDOperand getTargetExternalSymbol(const char *Sym, MVT::ValueType VT);
- SDOperand getArgFlags(ISD::ArgFlagsTy Flags);
- SDOperand getValueType(MVT::ValueType);
- SDOperand getRegister(unsigned Reg, MVT::ValueType VT);
-
- SDOperand getCopyToReg(SDOperand Chain, unsigned Reg, SDOperand N) {
- return getNode(ISD::CopyToReg, MVT::Other, Chain,
- getRegister(Reg, N.getValueType()), N);
- }
-
- // This version of the getCopyToReg method takes an extra operand, which
- // indicates that there is potentially an incoming flag value (if Flag is not
- // null) and that there should be a flag result.
- SDOperand getCopyToReg(SDOperand Chain, unsigned Reg, SDOperand N,
- SDOperand Flag) {
- const MVT::ValueType *VTs = getNodeValueTypes(MVT::Other, MVT::Flag);
- SDOperand Ops[] = { Chain, getRegister(Reg, N.getValueType()), N, Flag };
- return getNode(ISD::CopyToReg, VTs, 2, Ops, Flag.Val ? 4 : 3);
- }
-
- // Similar to last getCopyToReg() except parameter Reg is a SDOperand
- SDOperand getCopyToReg(SDOperand Chain, SDOperand Reg, SDOperand N,
- SDOperand Flag) {
- const MVT::ValueType *VTs = getNodeValueTypes(MVT::Other, MVT::Flag);
- SDOperand Ops[] = { Chain, Reg, N, Flag };
- return getNode(ISD::CopyToReg, VTs, 2, Ops, Flag.Val ? 4 : 3);
- }
-
- SDOperand getCopyFromReg(SDOperand Chain, unsigned Reg, MVT::ValueType VT) {
- const MVT::ValueType *VTs = getNodeValueTypes(VT, MVT::Other);
- SDOperand Ops[] = { Chain, getRegister(Reg, VT) };
- return getNode(ISD::CopyFromReg, VTs, 2, Ops, 2);
- }
-
- // This version of the getCopyFromReg method takes an extra operand, which
- // indicates that there is potentially an incoming flag value (if Flag is not
- // null) and that there should be a flag result.
- SDOperand getCopyFromReg(SDOperand Chain, unsigned Reg, MVT::ValueType VT,
- SDOperand Flag) {
- const MVT::ValueType *VTs = getNodeValueTypes(VT, MVT::Other, MVT::Flag);
- SDOperand Ops[] = { Chain, getRegister(Reg, VT), Flag };
- return getNode(ISD::CopyFromReg, VTs, 3, Ops, Flag.Val ? 3 : 2);
- }
-
- SDOperand getCondCode(ISD::CondCode Cond);
-
- /// getZeroExtendInReg - Return the expression required to zero extend the Op
- /// value assuming it was the smaller SrcTy value.
- SDOperand getZeroExtendInReg(SDOperand Op, MVT::ValueType SrcTy);
-
- /// getCALLSEQ_START - Return a new CALLSEQ_START node, which always must have
- /// a flag result (to ensure it's not CSE'd).
- SDOperand getCALLSEQ_START(SDOperand Chain, SDOperand Op) {
- const MVT::ValueType *VTs = getNodeValueTypes(MVT::Other, MVT::Flag);
- SDOperand Ops[] = { Chain, Op };
- return getNode(ISD::CALLSEQ_START, VTs, 2, Ops, 2);
- }
-
- /// getCALLSEQ_END - Return a new CALLSEQ_END node, which always must have a
- /// flag result (to ensure it's not CSE'd).
- SDOperand getCALLSEQ_END(SDOperand Chain, SDOperand Op1, SDOperand Op2,
- SDOperand InFlag) {
- SDVTList NodeTys = getVTList(MVT::Other, MVT::Flag);
- SmallVector<SDOperand, 4> Ops;
- Ops.push_back(Chain);
- Ops.push_back(Op1);
- Ops.push_back(Op2);
- Ops.push_back(InFlag);
- return getNode(ISD::CALLSEQ_END, NodeTys, &Ops[0],
- (unsigned)Ops.size() - (InFlag.Val == 0 ? 1 : 0));
- }
-
- /// getNode - Gets or creates the specified node.
- ///
- SDOperand getNode(unsigned Opcode, MVT::ValueType VT);
- SDOperand getNode(unsigned Opcode, MVT::ValueType VT, SDOperand N);
- SDOperand getNode(unsigned Opcode, MVT::ValueType VT,
- SDOperand N1, SDOperand N2);
- SDOperand getNode(unsigned Opcode, MVT::ValueType VT,
- SDOperand N1, SDOperand N2, SDOperand N3);
- SDOperand getNode(unsigned Opcode, MVT::ValueType VT,
- SDOperand N1, SDOperand N2, SDOperand N3, SDOperand N4);
- SDOperand getNode(unsigned Opcode, MVT::ValueType VT,
- SDOperand N1, SDOperand N2, SDOperand N3, SDOperand N4,
- SDOperand N5);
- SDOperand getNode(unsigned Opcode, MVT::ValueType VT,
- SDOperandPtr Ops, unsigned NumOps);
- SDOperand getNode(unsigned Opcode, std::vector<MVT::ValueType> &ResultTys,
- SDOperandPtr Ops, unsigned NumOps);
- SDOperand getNode(unsigned Opcode, const MVT::ValueType *VTs, unsigned NumVTs,
- SDOperandPtr Ops, unsigned NumOps);
- SDOperand getNode(unsigned Opcode, SDVTList VTs);
- SDOperand getNode(unsigned Opcode, SDVTList VTs, SDOperand N);
- SDOperand getNode(unsigned Opcode, SDVTList VTs,
- SDOperand N1, SDOperand N2);
- SDOperand getNode(unsigned Opcode, SDVTList VTs,
- SDOperand N1, SDOperand N2, SDOperand N3);
- SDOperand getNode(unsigned Opcode, SDVTList VTs,
- SDOperand N1, SDOperand N2, SDOperand N3, SDOperand N4);
- SDOperand getNode(unsigned Opcode, SDVTList VTs,
- SDOperand N1, SDOperand N2, SDOperand N3, SDOperand N4,
- SDOperand N5);
- SDOperand getNode(unsigned Opcode, SDVTList VTs,
- SDOperandPtr Ops, unsigned NumOps);
-
- SDOperand getMemcpy(SDOperand Chain, SDOperand Dst, SDOperand Src,
- SDOperand Size, unsigned Align,
- bool AlwaysInline,
- const Value *DstSV, uint64_t DstSVOff,
- const Value *SrcSV, uint64_t SrcSVOff);
-
- SDOperand getMemmove(SDOperand Chain, SDOperand Dst, SDOperand Src,
- SDOperand Size, unsigned Align,
- const Value *DstSV, uint64_t DstOSVff,
- const Value *SrcSV, uint64_t SrcSVOff);
-
- SDOperand getMemset(SDOperand Chain, SDOperand Dst, SDOperand Src,
- SDOperand Size, unsigned Align,
- const Value *DstSV, uint64_t DstSVOff);
-
- /// getSetCC - Helper function to make it easier to build SetCC's if you just
- /// have an ISD::CondCode instead of an SDOperand.
- ///
- SDOperand getSetCC(MVT::ValueType VT, SDOperand LHS, SDOperand RHS,
- ISD::CondCode Cond) {
- return getNode(ISD::SETCC, VT, LHS, RHS, getCondCode(Cond));
- }
-
- /// getSelectCC - Helper function to make it easier to build SelectCC's if you
- /// just have an ISD::CondCode instead of an SDOperand.
- ///
- SDOperand getSelectCC(SDOperand LHS, SDOperand RHS,
- SDOperand True, SDOperand False, ISD::CondCode Cond) {
- return getNode(ISD::SELECT_CC, True.getValueType(), LHS, RHS, True, False,
- getCondCode(Cond));
- }
-
- /// getVAArg - VAArg produces a result and token chain, and takes a pointer
- /// and a source value as input.
- SDOperand getVAArg(MVT::ValueType VT, SDOperand Chain, SDOperand Ptr,
- SDOperand SV);
-
- /// getAtomic - Gets a node for an atomic op, produces result and chain, takes
- // 3 operands
- SDOperand getAtomic(unsigned Opcode, SDOperand Chain, SDOperand Ptr,
- SDOperand Cmp, SDOperand Swp, MVT::ValueType VT);
-
- /// getAtomic - Gets a node for an atomic op, produces result and chain, takes
- // 2 operands
- SDOperand getAtomic(unsigned Opcode, SDOperand Chain, SDOperand Ptr,
- SDOperand Val, MVT::ValueType VT);
-
- /// getLoad - Loads are not normal binary operators: their result type is not
- /// determined by their operands, and they produce a value AND a token chain.
- ///
- SDOperand getLoad(MVT::ValueType VT, SDOperand Chain, SDOperand Ptr,
- const Value *SV, int SVOffset, bool isVolatile=false,
- unsigned Alignment=0);
- SDOperand getExtLoad(ISD::LoadExtType ExtType, MVT::ValueType VT,
- SDOperand Chain, SDOperand Ptr, const Value *SV,
- int SVOffset, MVT::ValueType EVT, bool isVolatile=false,
- unsigned Alignment=0);
- SDOperand getIndexedLoad(SDOperand OrigLoad, SDOperand Base,
- SDOperand Offset, ISD::MemIndexedMode AM);
- SDOperand getLoad(ISD::MemIndexedMode AM, ISD::LoadExtType ExtType,
- MVT::ValueType VT, SDOperand Chain,
- SDOperand Ptr, SDOperand Offset,
- const Value *SV, int SVOffset, MVT::ValueType EVT,
- bool isVolatile=false, unsigned Alignment=0);
-
- /// getStore - Helper function to build ISD::STORE nodes.
- ///
- SDOperand getStore(SDOperand Chain, SDOperand Val, SDOperand Ptr,
- const Value *SV, int SVOffset, bool isVolatile=false,
- unsigned Alignment=0);
- SDOperand getTruncStore(SDOperand Chain, SDOperand Val, SDOperand Ptr,
- const Value *SV, int SVOffset, MVT::ValueType TVT,
- bool isVolatile=false, unsigned Alignment=0);
- SDOperand getIndexedStore(SDOperand OrigStoe, SDOperand Base,
- SDOperand Offset, ISD::MemIndexedMode AM);
-
- // getSrcValue - Construct a node to track a Value* through the backend.
- SDOperand getSrcValue(const Value *v);
-
- // getMemOperand - Construct a node to track a memory reference
- // through the backend.
- SDOperand getMemOperand(const MachineMemOperand &MO);
-
- /// UpdateNodeOperands - *Mutate* the specified node in-place to have the
- /// specified operands. If the resultant node already exists in the DAG,
- /// this does not modify the specified node, instead it returns the node that
- /// already exists. If the resultant node does not exist in the DAG, the
- /// input node is returned. As a degenerate case, if you specify the same
- /// input operands as the node already has, the input node is returned.
- SDOperand UpdateNodeOperands(SDOperand N, SDOperand Op);
- SDOperand UpdateNodeOperands(SDOperand N, SDOperand Op1, SDOperand Op2);
- SDOperand UpdateNodeOperands(SDOperand N, SDOperand Op1, SDOperand Op2,
- SDOperand Op3);
- SDOperand UpdateNodeOperands(SDOperand N, SDOperand Op1, SDOperand Op2,
- SDOperand Op3, SDOperand Op4);
- SDOperand UpdateNodeOperands(SDOperand N, SDOperand Op1, SDOperand Op2,
- SDOperand Op3, SDOperand Op4, SDOperand Op5);
- SDOperand UpdateNodeOperands(SDOperand N, SDOperandPtr Ops, unsigned NumOps);
-
- /// SelectNodeTo - These are used for target selectors to *mutate* the
- /// specified node to have the specified return type, Target opcode, and
- /// operands. Note that target opcodes are stored as
- /// ISD::BUILTIN_OP_END+TargetOpcode in the node opcode field. The 0th value
- /// of the resultant node is returned.
- SDNode *SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT);
- SDNode *SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT,
- SDOperand Op1);
- SDNode *SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT,
- SDOperand Op1, SDOperand Op2);
- SDNode *SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT,
- SDOperand Op1, SDOperand Op2, SDOperand Op3);
- SDNode *SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT,
- SDOperandPtr Ops, unsigned NumOps);
- SDNode *SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT1,
- MVT::ValueType VT2, SDOperand Op1, SDOperand Op2);
- SDNode *SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT1,
- MVT::ValueType VT2, SDOperand Op1, SDOperand Op2,
- SDOperand Op3);
-
-
- /// getTargetNode - These are used for target selectors to create a new node
- /// with specified return type(s), target opcode, and operands.
- ///
- /// Note that getTargetNode returns the resultant node. If there is already a
- /// node of the specified opcode and operands, it returns that node instead of
- /// the current one.
- SDNode *getTargetNode(unsigned Opcode, MVT::ValueType VT);
- SDNode *getTargetNode(unsigned Opcode, MVT::ValueType VT,
- SDOperand Op1);
- SDNode *getTargetNode(unsigned Opcode, MVT::ValueType VT,
- SDOperand Op1, SDOperand Op2);
- SDNode *getTargetNode(unsigned Opcode, MVT::ValueType VT,
- SDOperand Op1, SDOperand Op2, SDOperand Op3);
- SDNode *getTargetNode(unsigned Opcode, MVT::ValueType VT,
- SDOperandPtr Ops, unsigned NumOps);
- SDNode *getTargetNode(unsigned Opcode, MVT::ValueType VT1,
- MVT::ValueType VT2);
- SDNode *getTargetNode(unsigned Opcode, MVT::ValueType VT1,
- MVT::ValueType VT2, SDOperand Op1);
- SDNode *getTargetNode(unsigned Opcode, MVT::ValueType VT1,
- MVT::ValueType VT2, SDOperand Op1, SDOperand Op2);
- SDNode *getTargetNode(unsigned Opcode, MVT::ValueType VT1,
- MVT::ValueType VT2, SDOperand Op1, SDOperand Op2,
- SDOperand Op3);
- SDNode *getTargetNode(unsigned Opcode, MVT::ValueType VT1,
- MVT::ValueType VT2,
- SDOperandPtr Ops, unsigned NumOps);
- SDNode *getTargetNode(unsigned Opcode, MVT::ValueType VT1,
- MVT::ValueType VT2, MVT::ValueType VT3,
- SDOperand Op1, SDOperand Op2);
- SDNode *getTargetNode(unsigned Opcode, MVT::ValueType VT1,
- MVT::ValueType VT2, MVT::ValueType VT3,
- SDOperand Op1, SDOperand Op2, SDOperand Op3);
- SDNode *getTargetNode(unsigned Opcode, MVT::ValueType VT1,
- MVT::ValueType VT2, MVT::ValueType VT3,
- SDOperandPtr Ops, unsigned NumOps);
- SDNode *getTargetNode(unsigned Opcode, MVT::ValueType VT1,
- MVT::ValueType VT2, MVT::ValueType VT3,
- MVT::ValueType VT4,
- SDOperandPtr Ops, unsigned NumOps);
- SDNode *getTargetNode(unsigned Opcode, std::vector<MVT::ValueType> &ResultTys,
- SDOperandPtr Ops, unsigned NumOps);
-
- /// getNodeIfExists - Get the specified node if it's already available, or
- /// else return NULL.
- SDNode *getNodeIfExists(unsigned Opcode, SDVTList VTs,
- SDOperandPtr Ops, unsigned NumOps);
-
- /// DAGUpdateListener - Clients of various APIs that cause global effects on
- /// the DAG can optionally implement this interface. This allows the clients
- /// to handle the various sorts of updates that happen.
- class DAGUpdateListener {
- public:
- virtual ~DAGUpdateListener();
- virtual void NodeDeleted(SDNode *N) = 0;
- virtual void NodeUpdated(SDNode *N) = 0;
- };
-
- /// RemoveDeadNode - Remove the specified node from the system. If any of its
- /// operands then becomes dead, remove them as well. Inform UpdateListener
- /// for each node deleted.
- void RemoveDeadNode(SDNode *N, DAGUpdateListener *UpdateListener = 0);
-
- /// ReplaceAllUsesWith - Modify anything using 'From' to use 'To' instead.
- /// This can cause recursive merging of nodes in the DAG. Use the first
- /// version if 'From' is known to have a single result, use the second
- /// if you have two nodes with identical results, use the third otherwise.
- ///
- /// These methods all take an optional UpdateListener, which (if not null) is
- /// informed about nodes that are deleted and modified due to recursive
- /// changes in the dag.
- ///
- void ReplaceAllUsesWith(SDOperand From, SDOperand Op,
- DAGUpdateListener *UpdateListener = 0);
- void ReplaceAllUsesWith(SDNode *From, SDNode *To,
- DAGUpdateListener *UpdateListener = 0);
- void ReplaceAllUsesWith(SDNode *From, SDOperandPtr To,
- DAGUpdateListener *UpdateListener = 0);
-
- /// ReplaceAllUsesOfValueWith - Replace any uses of From with To, leaving
- /// uses of other values produced by From.Val alone.
- void ReplaceAllUsesOfValueWith(SDOperand From, SDOperand To,
- DAGUpdateListener *UpdateListener = 0);
-
- /// AssignNodeIds - Assign a unique node id for each node in the DAG based on
- /// their allnodes order. It returns the maximum id.
- unsigned AssignNodeIds();
-
- /// AssignTopologicalOrder - Assign a unique node id for each node in the DAG
- /// based on their topological order. It returns the maximum id and a vector
- /// of the SDNodes* in assigned order by reference.
- unsigned AssignTopologicalOrder(std::vector<SDNode*> &TopOrder);
-
- /// isCommutativeBinOp - Returns true if the opcode is a commutative binary
- /// operation.
- static bool isCommutativeBinOp(unsigned Opcode) {
- // FIXME: This should get its info from the td file, so that we can include
- // target info.
- switch (Opcode) {
- case ISD::ADD:
- case ISD::MUL:
- case ISD::MULHU:
- case ISD::MULHS:
- case ISD::SMUL_LOHI:
- case ISD::UMUL_LOHI:
- case ISD::FADD:
- case ISD::FMUL:
- case ISD::AND:
- case ISD::OR:
- case ISD::XOR:
- case ISD::ADDC:
- case ISD::ADDE: return true;
- default: return false;
- }
- }
-
- void dump() const;
-
- /// CreateStackTemporary - Create a stack temporary, suitable for holding the
- /// specified value type.
- SDOperand CreateStackTemporary(MVT::ValueType VT);
-
- /// FoldSetCC - Constant fold a setcc to true or false.
- SDOperand FoldSetCC(MVT::ValueType VT, SDOperand N1,
- SDOperand N2, ISD::CondCode Cond);
-
- /// SignBitIsZero - Return true if the sign bit of Op is known to be zero. We
- /// use this predicate to simplify operations downstream.
- bool SignBitIsZero(SDOperand Op, unsigned Depth = 0) const;
-
- /// MaskedValueIsZero - Return true if 'Op & Mask' is known to be zero. We
- /// use this predicate to simplify operations downstream. Op and Mask are
- /// known to be the same type.
- bool MaskedValueIsZero(SDOperand Op, const APInt &Mask, unsigned Depth = 0)
- const;
-
- /// ComputeMaskedBits - Determine which of the bits specified in Mask are
- /// known to be either zero or one and return them in the KnownZero/KnownOne
- /// bitsets. This code only analyzes bits in Mask, in order to short-circuit
- /// processing. Targets can implement the computeMaskedBitsForTargetNode
- /// method in the TargetLowering class to allow target nodes to be understood.
- void ComputeMaskedBits(SDOperand Op, const APInt &Mask, APInt &KnownZero,
- APInt &KnownOne, unsigned Depth = 0) const;
-
- /// ComputeNumSignBits - Return the number of times the sign bit of the
- /// register is replicated into the other bits. We know that at least 1 bit
- /// is always equal to the sign bit (itself), but other cases can give us
- /// information. For example, immediately after an "SRA X, 2", we know that
- /// the top 3 bits are all equal to each other, so we return 3. Targets can
- /// implement the ComputeNumSignBitsForTarget method in the TargetLowering
- /// class to allow target nodes to be understood.
- unsigned ComputeNumSignBits(SDOperand Op, unsigned Depth = 0) const;
-
- /// isVerifiedDebugInfoDesc - Returns true if the specified SDOperand has
- /// been verified as a debug information descriptor.
- bool isVerifiedDebugInfoDesc(SDOperand Op) const;
-
-private:
- void RemoveNodeFromCSEMaps(SDNode *N);
- SDNode *AddNonLeafNodeToCSEMaps(SDNode *N);
- SDNode *FindModifiedNodeSlot(SDNode *N, SDOperand Op, void *&InsertPos);
- SDNode *FindModifiedNodeSlot(SDNode *N, SDOperand Op1, SDOperand Op2,
- void *&InsertPos);
- SDNode *FindModifiedNodeSlot(SDNode *N, SDOperandPtr Ops, unsigned NumOps,
- void *&InsertPos);
-
- void DeleteNodeNotInCSEMaps(SDNode *N);
-
- // List of non-single value types.
- std::list<std::vector<MVT::ValueType> > VTList;
-
- // Maps to auto-CSE operations.
- std::vector<CondCodeSDNode*> CondCodeNodes;
-
- std::vector<SDNode*> ValueTypeNodes;
- std::map<MVT::ValueType, SDNode*> ExtendedValueTypeNodes;
- std::map<std::string, SDNode*> ExternalSymbols;
- std::map<std::string, SDNode*> TargetExternalSymbols;
- std::map<std::string, StringSDNode*> StringNodes;
-};
-
-template <> struct GraphTraits<SelectionDAG*> : public GraphTraits<SDNode*> {
- typedef SelectionDAG::allnodes_iterator nodes_iterator;
- static nodes_iterator nodes_begin(SelectionDAG *G) {
- return G->allnodes_begin();
- }
- static nodes_iterator nodes_end(SelectionDAG *G) {
- return G->allnodes_end();
- }
-};
-
-} // end namespace llvm
-
-#endif
diff --git a/release_23/include/llvm/CodeGen/SelectionDAGISel.h b/release_23/include/llvm/CodeGen/SelectionDAGISel.h
deleted file mode 100644
index f9816879342c..000000000000
--- a/release_23/include/llvm/CodeGen/SelectionDAGISel.h
+++ /dev/null
@@ -1,200 +0,0 @@
-//===-- llvm/CodeGen/SelectionDAGISel.h - Common Base Class------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the SelectionDAGISel class, which is used as the common
-// base class for SelectionDAG-based instruction selectors.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_CODEGEN_SELECTIONDAG_ISEL_H
-#define LLVM_CODEGEN_SELECTIONDAG_ISEL_H
-
-#include "llvm/Pass.h"
-#include "llvm/Constant.h"
-#include "llvm/CodeGen/SelectionDAG.h"
-#include "llvm/CodeGen/SelectionDAGNodes.h"
-
-namespace llvm {
- class SelectionDAGLowering;
- class SDOperand;
- class MachineRegisterInfo;
- class MachineBasicBlock;
- class MachineFunction;
- class MachineInstr;
- class TargetLowering;
- class FunctionLoweringInfo;
- class HazardRecognizer;
- class CollectorMetadata;
-
-/// SelectionDAGISel - This is the common base class used for SelectionDAG-based
-/// pattern-matching instruction selectors.
-class SelectionDAGISel : public FunctionPass {
-public:
- TargetLowering &TLI;
- MachineRegisterInfo *RegInfo;
- SelectionDAG *CurDAG;
- MachineBasicBlock *BB;
- AliasAnalysis *AA;
- std::vector<SDNode*> TopOrder;
- unsigned DAGSize;
- CollectorMetadata *GCI;
- static char ID;
-
- explicit SelectionDAGISel(TargetLowering &tli) :
- FunctionPass((intptr_t)&ID), TLI(tli), DAGSize(0), GCI(0) {}
-
- TargetLowering &getTargetLowering() { return TLI; }
-
- virtual void getAnalysisUsage(AnalysisUsage &AU) const;
-
- virtual bool runOnFunction(Function &Fn);
-
- unsigned MakeReg(MVT::ValueType VT);
-
- virtual void EmitFunctionEntryCode(Function &Fn, MachineFunction &MF) {}
- virtual void InstructionSelectBasicBlock(SelectionDAG &SD) = 0;
- virtual void SelectRootInit() {
- DAGSize = CurDAG->AssignTopologicalOrder(TopOrder);
- }
-
- /// SelectInlineAsmMemoryOperand - Select the specified address as a target
- /// addressing mode, according to the specified constraint code. If this does
- /// not match or is not implemented, return true. The resultant operands
- /// (which will appear in the machine instruction) should be added to the
- /// OutOps vector.
- virtual bool SelectInlineAsmMemoryOperand(const SDOperand &Op,
- char ConstraintCode,
- std::vector<SDOperand> &OutOps,
- SelectionDAG &DAG) {
- return true;
- }
-
- /// CanBeFoldedBy - Returns true if the specific operand node N of U can be
- /// folded during instruction selection that starts at Root?
- virtual bool CanBeFoldedBy(SDNode *N, SDNode *U, SDNode *Root) const {
- return true;
- }
-
- /// CreateTargetHazardRecognizer - Return a newly allocated hazard recognizer
- /// to use for this target when scheduling the DAG.
- virtual HazardRecognizer *CreateTargetHazardRecognizer();
-
- /// CaseBlock - This structure is used to communicate between SDLowering and
- /// SDISel for the code generation of additional basic blocks needed by multi-
- /// case switch statements.
- struct CaseBlock {
- CaseBlock(ISD::CondCode cc, Value *cmplhs, Value *cmprhs, Value *cmpmiddle,
- MachineBasicBlock *truebb, MachineBasicBlock *falsebb,
- MachineBasicBlock *me)
- : CC(cc), CmpLHS(cmplhs), CmpMHS(cmpmiddle), CmpRHS(cmprhs),
- TrueBB(truebb), FalseBB(falsebb), ThisBB(me) {}
- // CC - the condition code to use for the case block's setcc node
- ISD::CondCode CC;
- // CmpLHS/CmpRHS/CmpMHS - The LHS/MHS/RHS of the comparison to emit.
- // Emit by default LHS op RHS. MHS is used for range comparisons:
- // If MHS is not null: (LHS <= MHS) and (MHS <= RHS).
- Value *CmpLHS, *CmpMHS, *CmpRHS;
- // TrueBB/FalseBB - the block to branch to if the setcc is true/false.
- MachineBasicBlock *TrueBB, *FalseBB;
- // ThisBB - the block into which to emit the code for the setcc and branches
- MachineBasicBlock *ThisBB;
- };
- struct JumpTable {
- JumpTable(unsigned R, unsigned J, MachineBasicBlock *M,
- MachineBasicBlock *D): Reg(R), JTI(J), MBB(M), Default(D) {}
-
- /// Reg - the virtual register containing the index of the jump table entry
- //. to jump to.
- unsigned Reg;
- /// JTI - the JumpTableIndex for this jump table in the function.
- unsigned JTI;
- /// MBB - the MBB into which to emit the code for the indirect jump.
- MachineBasicBlock *MBB;
- /// Default - the MBB of the default bb, which is a successor of the range
- /// check MBB. This is when updating PHI nodes in successors.
- MachineBasicBlock *Default;
- };
- struct JumpTableHeader {
- JumpTableHeader(uint64_t F, uint64_t L, Value* SV, MachineBasicBlock* H,
- bool E = false):
- First(F), Last(L), SValue(SV), HeaderBB(H), Emitted(E) {}
- uint64_t First;
- uint64_t Last;
- Value *SValue;
- MachineBasicBlock *HeaderBB;
- bool Emitted;
- };
- typedef std::pair<JumpTableHeader, JumpTable> JumpTableBlock;
-
- struct BitTestCase {
- BitTestCase(uint64_t M, MachineBasicBlock* T, MachineBasicBlock* Tr):
- Mask(M), ThisBB(T), TargetBB(Tr) { }
- uint64_t Mask;
- MachineBasicBlock* ThisBB;
- MachineBasicBlock* TargetBB;
- };
-
- typedef SmallVector<BitTestCase, 3> BitTestInfo;
-
- struct BitTestBlock {
- BitTestBlock(uint64_t F, uint64_t R, Value* SV,
- unsigned Rg, bool E,
- MachineBasicBlock* P, MachineBasicBlock* D,
- const BitTestInfo& C):
- First(F), Range(R), SValue(SV), Reg(Rg), Emitted(E),
- Parent(P), Default(D), Cases(C) { }
- uint64_t First;
- uint64_t Range;
- Value *SValue;
- unsigned Reg;
- bool Emitted;
- MachineBasicBlock *Parent;
- MachineBasicBlock *Default;
- BitTestInfo Cases;
- };
-protected:
- /// Pick a safe ordering and emit instructions for each target node in the
- /// graph.
- void ScheduleAndEmitDAG(SelectionDAG &DAG);
-
- /// SelectInlineAsmMemoryOperands - Calls to this are automatically generated
- /// by tblgen. Others should not call it.
- void SelectInlineAsmMemoryOperands(std::vector<SDOperand> &Ops,
- SelectionDAG &DAG);
-
- // Calls to these predicates are generated by tblgen.
- bool CheckAndMask(SDOperand LHS, ConstantSDNode *RHS,
- int64_t DesiredMaskS) const;
- bool CheckOrMask(SDOperand LHS, ConstantSDNode *RHS,
- int64_t DesiredMaskS) const;
-
-private:
- void SelectBasicBlock(BasicBlock *BB, MachineFunction &MF,
- FunctionLoweringInfo &FuncInfo);
-
- void BuildSelectionDAG(SelectionDAG &DAG, BasicBlock *LLVMBB,
- std::vector<std::pair<MachineInstr*, unsigned> > &PHINodesToUpdate,
- FunctionLoweringInfo &FuncInfo);
- void CodeGenAndEmitDAG(SelectionDAG &DAG);
- void LowerArguments(BasicBlock *BB, SelectionDAGLowering &SDL);
-
- /// SwitchCases - Vector of CaseBlock structures used to communicate
- /// SwitchInst code generation information.
- std::vector<CaseBlock> SwitchCases;
-
- /// JTCases - Vector of JumpTable structures which holds necessary information
- /// for emitting a jump tables during SwitchInst code generation.
- std::vector<JumpTableBlock> JTCases;
-
- std::vector<BitTestBlock> BitTestCases;
-};
-
-}
-
-#endif /* LLVM_CODEGEN_SELECTIONDAG_ISEL_H */
diff --git a/release_23/include/llvm/CodeGen/SelectionDAGNodes.h b/release_23/include/llvm/CodeGen/SelectionDAGNodes.h
deleted file mode 100644
index f2ff91abf369..000000000000
--- a/release_23/include/llvm/CodeGen/SelectionDAGNodes.h
+++ /dev/null
@@ -1,2200 +0,0 @@
-//===-- llvm/CodeGen/SelectionDAGNodes.h - SelectionDAG Nodes ---*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file declares the SDNode class and derived classes, which are used to
-// represent the nodes and operations present in a SelectionDAG. These nodes
-// and operations are machine code level operations, with some similarities to
-// the GCC RTL representation.
-//
-// Clients should include the SelectionDAG.h file instead of this file directly.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_CODEGEN_SELECTIONDAGNODES_H
-#define LLVM_CODEGEN_SELECTIONDAGNODES_H
-
-#include "llvm/Value.h"
-#include "llvm/ADT/FoldingSet.h"
-#include "llvm/ADT/GraphTraits.h"
-#include "llvm/ADT/iterator"
-#include "llvm/ADT/APFloat.h"
-#include "llvm/ADT/APInt.h"
-#include "llvm/CodeGen/ValueTypes.h"
-#include "llvm/CodeGen/MachineMemOperand.h"
-#include "llvm/Support/DataTypes.h"
-#include <cassert>
-
-namespace llvm {
-
-class SelectionDAG;
-class GlobalValue;
-class MachineBasicBlock;
-class MachineConstantPoolValue;
-class SDNode;
-template <typename T> struct DenseMapInfo;
-template <typename T> struct simplify_type;
-template <typename T> struct ilist_traits;
-template<typename NodeTy, typename Traits> class iplist;
-template<typename NodeTy> class ilist_iterator;
-
-/// SDVTList - This represents a list of ValueType's that has been intern'd by
-/// a SelectionDAG. Instances of this simple value class are returned by
-/// SelectionDAG::getVTList(...).
-///
-struct SDVTList {
- const MVT::ValueType *VTs;
- unsigned short NumVTs;
-};
-
-/// ISD namespace - This namespace contains an enum which represents all of the
-/// SelectionDAG node types and value types.
-///
-namespace ISD {
-
- //===--------------------------------------------------------------------===//
- /// ISD::NodeType enum - This enum defines all of the operators valid in a
- /// SelectionDAG.
- ///
- enum NodeType {
- // DELETED_NODE - This is an illegal flag value that is used to catch
- // errors. This opcode is not a legal opcode for any node.
- DELETED_NODE,
-
- // EntryToken - This is the marker used to indicate the start of the region.
- EntryToken,
-
- // Token factor - This node takes multiple tokens as input and produces a
- // single token result. This is used to represent the fact that the operand
- // operators are independent of each other.
- TokenFactor,
-
- // AssertSext, AssertZext - These nodes record if a register contains a
- // value that has already been zero or sign extended from a narrower type.
- // These nodes take two operands. The first is the node that has already
- // been extended, and the second is a value type node indicating the width
- // of the extension
- AssertSext, AssertZext,
-
- // Various leaf nodes.
- STRING, BasicBlock, VALUETYPE, ARG_FLAGS, CONDCODE, Register,
- Constant, ConstantFP,
- GlobalAddress, GlobalTLSAddress, FrameIndex,
- JumpTable, ConstantPool, ExternalSymbol,
-
- // The address of the GOT
- GLOBAL_OFFSET_TABLE,
-
- // FRAMEADDR, RETURNADDR - These nodes represent llvm.frameaddress and
- // llvm.returnaddress on the DAG. These nodes take one operand, the index
- // of the frame or return address to return. An index of zero corresponds
- // to the current function's frame or return address, an index of one to the
- // parent's frame or return address, and so on.
- FRAMEADDR, RETURNADDR,
-
- // FRAME_TO_ARGS_OFFSET - This node represents offset from frame pointer to
- // first (possible) on-stack argument. This is needed for correct stack
- // adjustment during unwind.
- FRAME_TO_ARGS_OFFSET,
-
- // RESULT, OUTCHAIN = EXCEPTIONADDR(INCHAIN) - This node represents the
- // address of the exception block on entry to an landing pad block.
- EXCEPTIONADDR,
-
- // RESULT, OUTCHAIN = EHSELECTION(INCHAIN, EXCEPTION) - This node represents
- // the selection index of the exception thrown.
- EHSELECTION,
-
- // OUTCHAIN = EH_RETURN(INCHAIN, OFFSET, HANDLER) - This node represents
- // 'eh_return' gcc dwarf builtin, which is used to return from
- // exception. The general meaning is: adjust stack by OFFSET and pass
- // execution to HANDLER. Many platform-related details also :)
- EH_RETURN,
-
- // TargetConstant* - Like Constant*, but the DAG does not do any folding or
- // simplification of the constant.
- TargetConstant,
- TargetConstantFP,
-
- // TargetGlobalAddress - Like GlobalAddress, but the DAG does no folding or
- // anything else with this node, and this is valid in the target-specific
- // dag, turning into a GlobalAddress operand.
- TargetGlobalAddress,
- TargetGlobalTLSAddress,
- TargetFrameIndex,
- TargetJumpTable,
- TargetConstantPool,
- TargetExternalSymbol,
-
- /// RESULT = INTRINSIC_WO_CHAIN(INTRINSICID, arg1, arg2, ...)
- /// This node represents a target intrinsic function with no side effects.
- /// The first operand is the ID number of the intrinsic from the
- /// llvm::Intrinsic namespace. The operands to the intrinsic follow. The
- /// node has returns the result of the intrinsic.
- INTRINSIC_WO_CHAIN,
-
- /// RESULT,OUTCHAIN = INTRINSIC_W_CHAIN(INCHAIN, INTRINSICID, arg1, ...)
- /// This node represents a target intrinsic function with side effects that
- /// returns a result. The first operand is a chain pointer. The second is
- /// the ID number of the intrinsic from the llvm::Intrinsic namespace. The
- /// operands to the intrinsic follow. The node has two results, the result
- /// of the intrinsic and an output chain.
- INTRINSIC_W_CHAIN,
-
- /// OUTCHAIN = INTRINSIC_VOID(INCHAIN, INTRINSICID, arg1, arg2, ...)
- /// This node represents a target intrinsic function with side effects that
- /// does not return a result. The first operand is a chain pointer. The
- /// second is the ID number of the intrinsic from the llvm::Intrinsic
- /// namespace. The operands to the intrinsic follow.
- INTRINSIC_VOID,
-
- // CopyToReg - This node has three operands: a chain, a register number to
- // set to this value, and a value.
- CopyToReg,
-
- // CopyFromReg - This node indicates that the input value is a virtual or
- // physical register that is defined outside of the scope of this
- // SelectionDAG. The register is available from the RegisterSDNode object.
- CopyFromReg,
-
- // UNDEF - An undefined node
- UNDEF,
-
- /// FORMAL_ARGUMENTS(CHAIN, CC#, ISVARARG, FLAG0, ..., FLAGn) - This node
- /// represents the formal arguments for a function. CC# is a Constant value
- /// indicating the calling convention of the function, and ISVARARG is a
- /// flag that indicates whether the function is varargs or not. This node
- /// has one result value for each incoming argument, plus one for the output
- /// chain. It must be custom legalized. See description of CALL node for
- /// FLAG argument contents explanation.
- ///
- FORMAL_ARGUMENTS,
-
- /// RV1, RV2...RVn, CHAIN = CALL(CHAIN, CC#, ISVARARG, ISTAILCALL, CALLEE,
- /// ARG0, FLAG0, ARG1, FLAG1, ... ARGn, FLAGn)
- /// This node represents a fully general function call, before the legalizer
- /// runs. This has one result value for each argument / flag pair, plus
- /// a chain result. It must be custom legalized. Flag argument indicates
- /// misc. argument attributes. Currently:
- /// Bit 0 - signness
- /// Bit 1 - 'inreg' attribute
- /// Bit 2 - 'sret' attribute
- /// Bit 4 - 'byval' attribute
- /// Bit 5 - 'nest' attribute
- /// Bit 6-9 - alignment of byval structures
- /// Bit 10-26 - size of byval structures
- /// Bits 31:27 - argument ABI alignment in the first argument piece and
- /// alignment '1' in other argument pieces.
- CALL,
-
- // EXTRACT_ELEMENT - This is used to get the lower or upper (determined by
- // a Constant, which is required to be operand #1) half of the integer value
- // specified as operand #0. This is only for use before legalization, for
- // values that will be broken into multiple registers.
- EXTRACT_ELEMENT,
-
- // BUILD_PAIR - This is the opposite of EXTRACT_ELEMENT in some ways. Given
- // two values of the same integer value type, this produces a value twice as
- // big. Like EXTRACT_ELEMENT, this can only be used before legalization.
- BUILD_PAIR,
-
- // MERGE_VALUES - This node takes multiple discrete operands and returns
- // them all as its individual results. This nodes has exactly the same
- // number of inputs and outputs, and is only valid before legalization.
- // This node is useful for some pieces of the code generator that want to
- // think about a single node with multiple results, not multiple nodes.
- MERGE_VALUES,
-
- // Simple integer binary arithmetic operators.
- ADD, SUB, MUL, SDIV, UDIV, SREM, UREM,
-
- // SMUL_LOHI/UMUL_LOHI - Multiply two integers of type iN, producing
- // a signed/unsigned value of type i[2*N], and return the full value as
- // two results, each of type iN.
- SMUL_LOHI, UMUL_LOHI,
-
- // SDIVREM/UDIVREM - Divide two integers and produce both a quotient and
- // remainder result.
- SDIVREM, UDIVREM,
-
- // CARRY_FALSE - This node is used when folding other nodes,
- // like ADDC/SUBC, which indicate the carry result is always false.
- CARRY_FALSE,
-
- // Carry-setting nodes for multiple precision addition and subtraction.
- // These nodes take two operands of the same value type, and produce two
- // results. The first result is the normal add or sub result, the second
- // result is the carry flag result.
- ADDC, SUBC,
-
- // Carry-using nodes for multiple precision addition and subtraction. These
- // nodes take three operands: The first two are the normal lhs and rhs to
- // the add or sub, and the third is the input carry flag. These nodes
- // produce two results; the normal result of the add or sub, and the output
- // carry flag. These nodes both read and write a carry flag to allow them
- // to them to be chained together for add and sub of arbitrarily large
- // values.
- ADDE, SUBE,
-
- // Simple binary floating point operators.
- FADD, FSUB, FMUL, FDIV, FREM,
-
- // FCOPYSIGN(X, Y) - Return the value of X with the sign of Y. NOTE: This
- // DAG node does not require that X and Y have the same type, just that they
- // are both floating point. X and the result must have the same type.
- // FCOPYSIGN(f32, f64) is allowed.
- FCOPYSIGN,
-
- // INT = FGETSIGN(FP) - Return the sign bit of the specified floating point
- // value as an integer 0/1 value.
- FGETSIGN,
-
- /// BUILD_VECTOR(ELT0, ELT1, ELT2, ELT3,...) - Return a vector
- /// with the specified, possibly variable, elements. The number of elements
- /// is required to be a power of two.
- BUILD_VECTOR,
-
- /// INSERT_VECTOR_ELT(VECTOR, VAL, IDX) - Returns VECTOR with the element
- /// at IDX replaced with VAL. If the type of VAL is larger than the vector
- /// element type then VAL is truncated before replacement.
- INSERT_VECTOR_ELT,
-
- /// EXTRACT_VECTOR_ELT(VECTOR, IDX) - Returns a single element from VECTOR
- /// identified by the (potentially variable) element number IDX.
- EXTRACT_VECTOR_ELT,
-
- /// CONCAT_VECTORS(VECTOR0, VECTOR1, ...) - Given a number of values of
- /// vector type with the same length and element type, this produces a
- /// concatenated vector result value, with length equal to the sum of the
- /// lengths of the input vectors.
- CONCAT_VECTORS,
-
- /// EXTRACT_SUBVECTOR(VECTOR, IDX) - Returns a subvector from VECTOR (an
- /// vector value) starting with the (potentially variable) element number
- /// IDX, which must be a multiple of the result vector length.
- EXTRACT_SUBVECTOR,
-
- /// VECTOR_SHUFFLE(VEC1, VEC2, SHUFFLEVEC) - Returns a vector, of the same
- /// type as VEC1/VEC2. SHUFFLEVEC is a BUILD_VECTOR of constant int values
- /// (maybe of an illegal datatype) or undef that indicate which value each
- /// result element will get. The elements of VEC1/VEC2 are enumerated in
- /// order. This is quite similar to the Altivec 'vperm' instruction, except
- /// that the indices must be constants and are in terms of the element size
- /// of VEC1/VEC2, not in terms of bytes.
- VECTOR_SHUFFLE,
-
- /// SCALAR_TO_VECTOR(VAL) - This represents the operation of loading a
- /// scalar value into element 0 of the resultant vector type. The top
- /// elements 1 to N-1 of the N-element vector are undefined.
- SCALAR_TO_VECTOR,
-
- // EXTRACT_SUBREG - This node is used to extract a sub-register value.
- // This node takes a superreg and a constant sub-register index as operands.
- // Note sub-register indices must be increasing. That is, if the
- // sub-register index of a 8-bit sub-register is N, then the index for a
- // 16-bit sub-register must be at least N+1.
- EXTRACT_SUBREG,
-
- // INSERT_SUBREG - This node is used to insert a sub-register value.
- // This node takes a superreg, a subreg value, and a constant sub-register
- // index as operands.
- INSERT_SUBREG,
-
- // MULHU/MULHS - Multiply high - Multiply two integers of type iN, producing
- // an unsigned/signed value of type i[2*N], then return the top part.
- MULHU, MULHS,
-
- // Bitwise operators - logical and, logical or, logical xor, shift left,
- // shift right algebraic (shift in sign bits), shift right logical (shift in
- // zeroes), rotate left, rotate right, and byteswap.
- AND, OR, XOR, SHL, SRA, SRL, ROTL, ROTR, BSWAP,
-
- // Counting operators
- CTTZ, CTLZ, CTPOP,
-
- // Select(COND, TRUEVAL, FALSEVAL)
- SELECT,
-
- // Select with condition operator - This selects between a true value and
- // a false value (ops #2 and #3) based on the boolean result of comparing
- // the lhs and rhs (ops #0 and #1) of a conditional expression with the
- // condition code in op #4, a CondCodeSDNode.
- SELECT_CC,
-
- // SetCC operator - This evaluates to a boolean (i1) true value if the
- // condition is true. The operands to this are the left and right operands
- // to compare (ops #0, and #1) and the condition code to compare them with
- // (op #2) as a CondCodeSDNode.
- SETCC,
-
- // SHL_PARTS/SRA_PARTS/SRL_PARTS - These operators are used for expanded
- // integer shift operations, just like ADD/SUB_PARTS. The operation
- // ordering is:
- // [Lo,Hi] = op [LoLHS,HiLHS], Amt
- SHL_PARTS, SRA_PARTS, SRL_PARTS,
-
- // Conversion operators. These are all single input single output
- // operations. For all of these, the result type must be strictly
- // wider or narrower (depending on the operation) than the source
- // type.
-
- // SIGN_EXTEND - Used for integer types, replicating the sign bit
- // into new bits.
- SIGN_EXTEND,
-
- // ZERO_EXTEND - Used for integer types, zeroing the new bits.
- ZERO_EXTEND,
-
- // ANY_EXTEND - Used for integer types. The high bits are undefined.
- ANY_EXTEND,
-
- // TRUNCATE - Completely drop the high bits.
- TRUNCATE,
-
- // [SU]INT_TO_FP - These operators convert integers (whose interpreted sign
- // depends on the first letter) to floating point.
- SINT_TO_FP,
- UINT_TO_FP,
-
- // SIGN_EXTEND_INREG - This operator atomically performs a SHL/SRA pair to
- // sign extend a small value in a large integer register (e.g. sign
- // extending the low 8 bits of a 32-bit register to fill the top 24 bits
- // with the 7th bit). The size of the smaller type is indicated by the 1th
- // operand, a ValueType node.
- SIGN_EXTEND_INREG,
-
- /// FP_TO_[US]INT - Convert a floating point value to a signed or unsigned
- /// integer.
- FP_TO_SINT,
- FP_TO_UINT,
-
- /// X = FP_ROUND(Y, TRUNC) - Rounding 'Y' from a larger floating point type
- /// down to the precision of the destination VT. TRUNC is a flag, which is
- /// always an integer that is zero or one. If TRUNC is 0, this is a
- /// normal rounding, if it is 1, this FP_ROUND is known to not change the
- /// value of Y.
- ///
- /// The TRUNC = 1 case is used in cases where we know that the value will
- /// not be modified by the node, because Y is not using any of the extra
- /// precision of source type. This allows certain transformations like
- /// FP_EXTEND(FP_ROUND(X,1)) -> X which are not safe for
- /// FP_EXTEND(FP_ROUND(X,0)) because the extra bits aren't removed.
- FP_ROUND,
-
- // FLT_ROUNDS_ - Returns current rounding mode:
- // -1 Undefined
- // 0 Round to 0
- // 1 Round to nearest
- // 2 Round to +inf
- // 3 Round to -inf
- FLT_ROUNDS_,
-
- /// X = FP_ROUND_INREG(Y, VT) - This operator takes an FP register, and
- /// rounds it to a floating point value. It then promotes it and returns it
- /// in a register of the same size. This operation effectively just
- /// discards excess precision. The type to round down to is specified by
- /// the VT operand, a VTSDNode.
- FP_ROUND_INREG,
-
- /// X = FP_EXTEND(Y) - Extend a smaller FP type into a larger FP type.
- FP_EXTEND,
-
- // BIT_CONVERT - Theis operator converts between integer and FP values, as
- // if one was stored to memory as integer and the other was loaded from the
- // same address (or equivalently for vector format conversions, etc). The
- // source and result are required to have the same bit size (e.g.
- // f32 <-> i32). This can also be used for int-to-int or fp-to-fp
- // conversions, but that is a noop, deleted by getNode().
- BIT_CONVERT,
-
- // FNEG, FABS, FSQRT, FSIN, FCOS, FPOWI, FPOW - Perform unary floating point
- // negation, absolute value, square root, sine and cosine, powi, and pow
- // operations.
- FNEG, FABS, FSQRT, FSIN, FCOS, FPOWI, FPOW,
-
- // LOAD and STORE have token chains as their first operand, then the same
- // operands as an LLVM load/store instruction, then an offset node that
- // is added / subtracted from the base pointer to form the address (for
- // indexed memory ops).
- LOAD, STORE,
-
- // DYNAMIC_STACKALLOC - Allocate some number of bytes on the stack aligned
- // to a specified boundary. This node always has two return values: a new
- // stack pointer value and a chain. The first operand is the token chain,
- // the second is the number of bytes to allocate, and the third is the
- // alignment boundary. The size is guaranteed to be a multiple of the stack
- // alignment, and the alignment is guaranteed to be bigger than the stack
- // alignment (if required) or 0 to get standard stack alignment.
- DYNAMIC_STACKALLOC,
-
- // Control flow instructions. These all have token chains.
-
- // BR - Unconditional branch. The first operand is the chain
- // operand, the second is the MBB to branch to.
- BR,
-
- // BRIND - Indirect branch. The first operand is the chain, the second
- // is the value to branch to, which must be of the same type as the target's
- // pointer type.
- BRIND,
-
- // BR_JT - Jumptable branch. The first operand is the chain, the second
- // is the jumptable index, the last one is the jumptable entry index.
- BR_JT,
-
- // BRCOND - Conditional branch. The first operand is the chain,
- // the second is the condition, the third is the block to branch
- // to if the condition is true.
- BRCOND,
-
- // BR_CC - Conditional branch. The behavior is like that of SELECT_CC, in
- // that the condition is represented as condition code, and two nodes to
- // compare, rather than as a combined SetCC node. The operands in order are
- // chain, cc, lhs, rhs, block to branch to if condition is true.
- BR_CC,
-
- // RET - Return from function. The first operand is the chain,
- // and any subsequent operands are pairs of return value and return value
- // signness for the function. This operation can have variable number of
- // operands.
- RET,
-
- // INLINEASM - Represents an inline asm block. This node always has two
- // return values: a chain and a flag result. The inputs are as follows:
- // Operand #0 : Input chain.
- // Operand #1 : a ExternalSymbolSDNode with a pointer to the asm string.
- // Operand #2n+2: A RegisterNode.
- // Operand #2n+3: A TargetConstant, indicating if the reg is a use/def
- // Operand #last: Optional, an incoming flag.
- INLINEASM,
-
- // LABEL - Represents a label in mid basic block used to track
- // locations needed for debug and exception handling tables. This node
- // returns a chain.
- // Operand #0 : input chain.
- // Operand #1 : module unique number use to identify the label.
- // Operand #2 : 0 indicates a debug label (e.g. stoppoint), 1 indicates
- // a EH label, 2 indicates unknown label type.
- LABEL,
-
- // DECLARE - Represents a llvm.dbg.declare intrinsic. It's used to track
- // local variable declarations for debugging information. First operand is
- // a chain, while the next two operands are first two arguments (address
- // and variable) of a llvm.dbg.declare instruction.
- DECLARE,
-
- // STACKSAVE - STACKSAVE has one operand, an input chain. It produces a
- // value, the same type as the pointer type for the system, and an output
- // chain.
- STACKSAVE,
-
- // STACKRESTORE has two operands, an input chain and a pointer to restore to
- // it returns an output chain.
- STACKRESTORE,
-
- // CALLSEQ_START/CALLSEQ_END - These operators mark the beginning and end of
- // a call sequence, and carry arbitrary information that target might want
- // to know. The first operand is a chain, the rest are specified by the
- // target and not touched by the DAG optimizers.
- // CALLSEQ_START..CALLSEQ_END pairs may not be nested.
- CALLSEQ_START, // Beginning of a call sequence
- CALLSEQ_END, // End of a call sequence
-
- // VAARG - VAARG has three operands: an input chain, a pointer, and a
- // SRCVALUE. It returns a pair of values: the vaarg value and a new chain.
- VAARG,
-
- // VACOPY - VACOPY has five operands: an input chain, a destination pointer,
- // a source pointer, a SRCVALUE for the destination, and a SRCVALUE for the
- // source.
- VACOPY,
-
- // VAEND, VASTART - VAEND and VASTART have three operands: an input chain, a
- // pointer, and a SRCVALUE.
- VAEND, VASTART,
-
- // SRCVALUE - This is a node type that holds a Value* that is used to
- // make reference to a value in the LLVM IR.
- SRCVALUE,
-
- // MEMOPERAND - This is a node that contains a MachineMemOperand which
- // records information about a memory reference. This is used to make
- // AliasAnalysis queries from the backend.
- MEMOPERAND,
-
- // PCMARKER - This corresponds to the pcmarker intrinsic.
- PCMARKER,
-
- // READCYCLECOUNTER - This corresponds to the readcyclecounter intrinsic.
- // The only operand is a chain and a value and a chain are produced. The
- // value is the contents of the architecture specific cycle counter like
- // register (or other high accuracy low latency clock source)
- READCYCLECOUNTER,
-
- // HANDLENODE node - Used as a handle for various purposes.
- HANDLENODE,
-
- // LOCATION - This node is used to represent a source location for debug
- // info. It takes token chain as input, then a line number, then a column
- // number, then a filename, then a working dir. It produces a token chain
- // as output.
- LOCATION,
-
- // DEBUG_LOC - This node is used to represent source line information
- // embedded in the code. It takes a token chain as input, then a line
- // number, then a column then a file id (provided by MachineModuleInfo.) It
- // produces a token chain as output.
- DEBUG_LOC,
-
- // TRAMPOLINE - This corresponds to the init_trampoline intrinsic.
- // It takes as input a token chain, the pointer to the trampoline,
- // the pointer to the nested function, the pointer to pass for the
- // 'nest' parameter, a SRCVALUE for the trampoline and another for
- // the nested function (allowing targets to access the original
- // Function*). It produces the result of the intrinsic and a token
- // chain as output.
- TRAMPOLINE,
-
- // TRAP - Trapping instruction
- TRAP,
-
- // PREFETCH - This corresponds to a prefetch intrinsic. It takes chains are
- // their first operand. The other operands are the address to prefetch,
- // read / write specifier, and locality specifier.
- PREFETCH,
-
- // OUTCHAIN = MEMBARRIER(INCHAIN, load-load, load-store, store-load,
- // store-store, device)
- // This corresponds to the memory.barrier intrinsic.
- // it takes an input chain, 4 operands to specify the type of barrier, an
- // operand specifying if the barrier applies to device and uncached memory
- // and produces an output chain.
- MEMBARRIER,
-
- // Val, OUTCHAIN = ATOMIC_LCS(INCHAIN, ptr, cmp, swap)
- // this corresponds to the atomic.lcs intrinsic.
- // cmp is compared to *ptr, and if equal, swap is stored in *ptr.
- // the return is always the original value in *ptr
- ATOMIC_LCS,
-
- // Val, OUTCHAIN = ATOMIC_LAS(INCHAIN, ptr, amt)
- // this corresponds to the atomic.las intrinsic.
- // *ptr + amt is stored to *ptr atomically.
- // the return is always the original value in *ptr
- ATOMIC_LAS,
-
- // Val, OUTCHAIN = ATOMIC_SWAP(INCHAIN, ptr, amt)
- // this corresponds to the atomic.swap intrinsic.
- // amt is stored to *ptr atomically.
- // the return is always the original value in *ptr
- ATOMIC_SWAP,
-
- // Val, OUTCHAIN = ATOMIC_LSS(INCHAIN, ptr, amt)
- // this corresponds to the atomic.lss intrinsic.
- // *ptr - amt is stored to *ptr atomically.
- // the return is always the original value in *ptr
- ATOMIC_LSS,
-
- // Val, OUTCHAIN = ATOMIC_L[OpName]S(INCHAIN, ptr, amt)
- // this corresponds to the atomic.[OpName] intrinsic.
- // op(*ptr, amt) is stored to *ptr atomically.
- // the return is always the original value in *ptr
- ATOMIC_LOAD_AND,
- ATOMIC_LOAD_OR,
- ATOMIC_LOAD_XOR,
- ATOMIC_LOAD_MIN,
- ATOMIC_LOAD_MAX,
- ATOMIC_LOAD_UMIN,
- ATOMIC_LOAD_UMAX,
-
- // BUILTIN_OP_END - This must be the last enum value in this list.
- BUILTIN_OP_END
- };
-
- /// Node predicates
-
- /// isBuildVectorAllOnes - Return true if the specified node is a
- /// BUILD_VECTOR where all of the elements are ~0 or undef.
- bool isBuildVectorAllOnes(const SDNode *N);
-
- /// isBuildVectorAllZeros - Return true if the specified node is a
- /// BUILD_VECTOR where all of the elements are 0 or undef.
- bool isBuildVectorAllZeros(const SDNode *N);
-
- /// isScalarToVector - Return true if the specified node is a
- /// ISD::SCALAR_TO_VECTOR node or a BUILD_VECTOR node where only the low
- /// element is not an undef.
- bool isScalarToVector(const SDNode *N);
-
- /// isDebugLabel - Return true if the specified node represents a debug
- /// label (i.e. ISD::LABEL or TargetInstrInfo::LABEL node and third operand
- /// is 0).
- bool isDebugLabel(const SDNode *N);
-
- //===--------------------------------------------------------------------===//
- /// MemIndexedMode enum - This enum defines the load / store indexed
- /// addressing modes.
- ///
- /// UNINDEXED "Normal" load / store. The effective address is already
- /// computed and is available in the base pointer. The offset
- /// operand is always undefined. In addition to producing a
- /// chain, an unindexed load produces one value (result of the
- /// load); an unindexed store does not produce a value.
- ///
- /// PRE_INC Similar to the unindexed mode where the effective address is
- /// PRE_DEC the value of the base pointer add / subtract the offset.
- /// It considers the computation as being folded into the load /
- /// store operation (i.e. the load / store does the address
- /// computation as well as performing the memory transaction).
- /// The base operand is always undefined. In addition to
- /// producing a chain, pre-indexed load produces two values
- /// (result of the load and the result of the address
- /// computation); a pre-indexed store produces one value (result
- /// of the address computation).
- ///
- /// POST_INC The effective address is the value of the base pointer. The
- /// POST_DEC value of the offset operand is then added to / subtracted
- /// from the base after memory transaction. In addition to
- /// producing a chain, post-indexed load produces two values
- /// (the result of the load and the result of the base +/- offset
- /// computation); a post-indexed store produces one value (the
- /// the result of the base +/- offset computation).
- ///
- enum MemIndexedMode {
- UNINDEXED = 0,
- PRE_INC,
- PRE_DEC,
- POST_INC,
- POST_DEC,
- LAST_INDEXED_MODE
- };
-
- //===--------------------------------------------------------------------===//
- /// LoadExtType enum - This enum defines the three variants of LOADEXT
- /// (load with extension).
- ///
- /// SEXTLOAD loads the integer operand and sign extends it to a larger
- /// integer result type.
- /// ZEXTLOAD loads the integer operand and zero extends it to a larger
- /// integer result type.
- /// EXTLOAD is used for three things: floating point extending loads,
- /// integer extending loads [the top bits are undefined], and vector
- /// extending loads [load into low elt].
- ///
- enum LoadExtType {
- NON_EXTLOAD = 0,
- EXTLOAD,
- SEXTLOAD,
- ZEXTLOAD,
- LAST_LOADX_TYPE
- };
-
- //===--------------------------------------------------------------------===//
- /// ISD::CondCode enum - These are ordered carefully to make the bitfields
- /// below work out, when considering SETFALSE (something that never exists
- /// dynamically) as 0. "U" -> Unsigned (for integer operands) or Unordered
- /// (for floating point), "L" -> Less than, "G" -> Greater than, "E" -> Equal
- /// to. If the "N" column is 1, the result of the comparison is undefined if
- /// the input is a NAN.
- ///
- /// All of these (except for the 'always folded ops') should be handled for
- /// floating point. For integer, only the SETEQ,SETNE,SETLT,SETLE,SETGT,
- /// SETGE,SETULT,SETULE,SETUGT, and SETUGE opcodes are used.
- ///
- /// Note that these are laid out in a specific order to allow bit-twiddling
- /// to transform conditions.
- enum CondCode {
- // Opcode N U L G E Intuitive operation
- SETFALSE, // 0 0 0 0 Always false (always folded)
- SETOEQ, // 0 0 0 1 True if ordered and equal
- SETOGT, // 0 0 1 0 True if ordered and greater than
- SETOGE, // 0 0 1 1 True if ordered and greater than or equal
- SETOLT, // 0 1 0 0 True if ordered and less than
- SETOLE, // 0 1 0 1 True if ordered and less than or equal
- SETONE, // 0 1 1 0 True if ordered and operands are unequal
- SETO, // 0 1 1 1 True if ordered (no nans)
- SETUO, // 1 0 0 0 True if unordered: isnan(X) | isnan(Y)
- SETUEQ, // 1 0 0 1 True if unordered or equal
- SETUGT, // 1 0 1 0 True if unordered or greater than
- SETUGE, // 1 0 1 1 True if unordered, greater than, or equal
- SETULT, // 1 1 0 0 True if unordered or less than
- SETULE, // 1 1 0 1 True if unordered, less than, or equal
- SETUNE, // 1 1 1 0 True if unordered or not equal
- SETTRUE, // 1 1 1 1 Always true (always folded)
- // Don't care operations: undefined if the input is a nan.
- SETFALSE2, // 1 X 0 0 0 Always false (always folded)
- SETEQ, // 1 X 0 0 1 True if equal
- SETGT, // 1 X 0 1 0 True if greater than
- SETGE, // 1 X 0 1 1 True if greater than or equal
- SETLT, // 1 X 1 0 0 True if less than
- SETLE, // 1 X 1 0 1 True if less than or equal
- SETNE, // 1 X 1 1 0 True if not equal
- SETTRUE2, // 1 X 1 1 1 Always true (always folded)
-
- SETCC_INVALID // Marker value.
- };
-
- /// isSignedIntSetCC - Return true if this is a setcc instruction that
- /// performs a signed comparison when used with integer operands.
- inline bool isSignedIntSetCC(CondCode Code) {
- return Code == SETGT || Code == SETGE || Code == SETLT || Code == SETLE;
- }
-
- /// isUnsignedIntSetCC - Return true if this is a setcc instruction that
- /// performs an unsigned comparison when used with integer operands.
- inline bool isUnsignedIntSetCC(CondCode Code) {
- return Code == SETUGT || Code == SETUGE || Code == SETULT || Code == SETULE;
- }
-
- /// isTrueWhenEqual - Return true if the specified condition returns true if
- /// the two operands to the condition are equal. Note that if one of the two
- /// operands is a NaN, this value is meaningless.
- inline bool isTrueWhenEqual(CondCode Cond) {
- return ((int)Cond & 1) != 0;
- }
-
- /// getUnorderedFlavor - This function returns 0 if the condition is always
- /// false if an operand is a NaN, 1 if the condition is always true if the
- /// operand is a NaN, and 2 if the condition is undefined if the operand is a
- /// NaN.
- inline unsigned getUnorderedFlavor(CondCode Cond) {
- return ((int)Cond >> 3) & 3;
- }
-
- /// getSetCCInverse - Return the operation corresponding to !(X op Y), where
- /// 'op' is a valid SetCC operation.
- CondCode getSetCCInverse(CondCode Operation, bool isInteger);
-
- /// getSetCCSwappedOperands - Return the operation corresponding to (Y op X)
- /// when given the operation for (X op Y).
- CondCode getSetCCSwappedOperands(CondCode Operation);
-
- /// getSetCCOrOperation - Return the result of a logical OR between different
- /// comparisons of identical values: ((X op1 Y) | (X op2 Y)). This
- /// function returns SETCC_INVALID if it is not possible to represent the
- /// resultant comparison.
- CondCode getSetCCOrOperation(CondCode Op1, CondCode Op2, bool isInteger);
-
- /// getSetCCAndOperation - Return the result of a logical AND between
- /// different comparisons of identical values: ((X op1 Y) & (X op2 Y)). This
- /// function returns SETCC_INVALID if it is not possible to represent the
- /// resultant comparison.
- CondCode getSetCCAndOperation(CondCode Op1, CondCode Op2, bool isInteger);
-} // end llvm::ISD namespace
-
-
-//===----------------------------------------------------------------------===//
-/// SDOperand - Unlike LLVM values, Selection DAG nodes may return multiple
-/// values as the result of a computation. Many nodes return multiple values,
-/// from loads (which define a token and a return value) to ADDC (which returns
-/// a result and a carry value), to calls (which may return an arbitrary number
-/// of values).
-///
-/// As such, each use of a SelectionDAG computation must indicate the node that
-/// computes it as well as which return value to use from that node. This pair
-/// of information is represented with the SDOperand value type.
-///
-class SDOperand {
-public:
- SDNode *Val; // The node defining the value we are using.
- unsigned ResNo; // Which return value of the node we are using.
-
- SDOperand() : Val(0), ResNo(0) {}
- SDOperand(SDNode *val, unsigned resno) : Val(val), ResNo(resno) {}
-
- bool operator==(const SDOperand &O) const {
- return Val == O.Val && ResNo == O.ResNo;
- }
- bool operator!=(const SDOperand &O) const {
- return !operator==(O);
- }
- bool operator<(const SDOperand &O) const {
- return Val < O.Val || (Val == O.Val && ResNo < O.ResNo);
- }
-
- SDOperand getValue(unsigned R) const {
- return SDOperand(Val, R);
- }
-
- // isOperandOf - Return true if this node is an operand of N.
- bool isOperandOf(SDNode *N) const;
-
- /// getValueType - Return the ValueType of the referenced return value.
- ///
- inline MVT::ValueType getValueType() const;
-
- /// getValueSizeInBits - Returns MVT::getSizeInBits(getValueType()).
- ///
- unsigned getValueSizeInBits() const {
- return MVT::getSizeInBits(getValueType());
- }
-
- // Forwarding methods - These forward to the corresponding methods in SDNode.
- inline unsigned getOpcode() const;
- inline unsigned getNumOperands() const;
- inline const SDOperand &getOperand(unsigned i) const;
- inline uint64_t getConstantOperandVal(unsigned i) const;
- inline bool isTargetOpcode() const;
- inline unsigned getTargetOpcode() const;
-
-
- /// reachesChainWithoutSideEffects - Return true if this operand (which must
- /// be a chain) reaches the specified operand without crossing any
- /// side-effecting instructions. In practice, this looks through token
- /// factors and non-volatile loads. In order to remain efficient, this only
- /// looks a couple of nodes in, it does not do an exhaustive search.
- bool reachesChainWithoutSideEffects(SDOperand Dest,
- unsigned Depth = 2) const;
-
- /// hasOneUse - Return true if there is exactly one operation using this
- /// result value of the defining operator.
- inline bool hasOneUse() const;
-
- /// use_empty - Return true if there are no operations using this
- /// result value of the defining operator.
- inline bool use_empty() const;
-};
-
-
-template<> struct DenseMapInfo<SDOperand> {
- static inline SDOperand getEmptyKey() {
- return SDOperand((SDNode*)-1, -1U);
- }
- static inline SDOperand getTombstoneKey() {
- return SDOperand((SDNode*)-1, 0);
- }
- static unsigned getHashValue(const SDOperand &Val) {
- return ((unsigned)((uintptr_t)Val.Val >> 4) ^
- (unsigned)((uintptr_t)Val.Val >> 9)) + Val.ResNo;
- }
- static bool isEqual(const SDOperand &LHS, const SDOperand &RHS) {
- return LHS == RHS;
- }
- static bool isPod() { return true; }
-};
-
-/// simplify_type specializations - Allow casting operators to work directly on
-/// SDOperands as if they were SDNode*'s.
-template<> struct simplify_type<SDOperand> {
- typedef SDNode* SimpleType;
- static SimpleType getSimplifiedValue(const SDOperand &Val) {
- return static_cast<SimpleType>(Val.Val);
- }
-};
-template<> struct simplify_type<const SDOperand> {
- typedef SDNode* SimpleType;
- static SimpleType getSimplifiedValue(const SDOperand &Val) {
- return static_cast<SimpleType>(Val.Val);
- }
-};
-
-/// SDUse - Represents a use of the SDNode referred by
-/// the SDOperand.
-class SDUse {
- SDOperand Operand;
- /// User - Parent node of this operand.
- SDNode *User;
- /// Prev, next - Pointers to the uses list of the SDNode referred by
- /// this operand.
- SDUse **Prev, *Next;
-public:
- friend class SDNode;
- SDUse(): Operand(), User(NULL), Prev(NULL), Next(NULL) {}
-
- SDUse(SDNode *val, unsigned resno) :
- Operand(val,resno), User(NULL), Prev(NULL), Next(NULL) {}
-
- SDUse& operator= (const SDOperand& Op) {
- Operand = Op;
- Next = NULL;
- Prev = NULL;
- return *this;
- }
-
- SDUse& operator= (const SDUse& Op) {
- Operand = Op;
- Next = NULL;
- Prev = NULL;
- return *this;
- }
-
- SDUse * getNext() { return Next; }
-
- SDNode *getUser() { return User; }
-
- void setUser(SDNode *p) { User = p; }
-
- operator SDOperand() const { return Operand; }
-
- const SDOperand& getSDOperand() const { return Operand; }
-
- SDNode* &getVal () { return Operand.Val; }
-
- bool operator==(const SDOperand &O) const {
- return Operand == O;
- }
-
- bool operator!=(const SDOperand &O) const {
- return !(Operand == O);
- }
-
- bool operator<(const SDOperand &O) const {
- return Operand < O;
- }
-
-protected:
- void addToList(SDUse **List) {
- Next = *List;
- if (Next) Next->Prev = &Next;
- Prev = List;
- *List = this;
- }
-
- void removeFromList() {
- *Prev = Next;
- if (Next) Next->Prev = Prev;
- }
-};
-
-
-/// simplify_type specializations - Allow casting operators to work directly on
-/// SDOperands as if they were SDNode*'s.
-template<> struct simplify_type<SDUse> {
- typedef SDNode* SimpleType;
- static SimpleType getSimplifiedValue(const SDUse &Val) {
- return static_cast<SimpleType>(Val.getSDOperand().Val);
- }
-};
-template<> struct simplify_type<const SDUse> {
- typedef SDNode* SimpleType;
- static SimpleType getSimplifiedValue(const SDUse &Val) {
- return static_cast<SimpleType>(Val.getSDOperand().Val);
- }
-};
-
-
-/// SDOperandPtr - A helper SDOperand pointer class, that can handle
-/// arrays of SDUse and arrays of SDOperand objects. This is required
-/// in many places inside the SelectionDAG.
-///
-class SDOperandPtr {
- const SDOperand *ptr; // The pointer to the SDOperand object
- int object_size; // The size of the object containg the SDOperand
-public:
- SDOperandPtr() : ptr(0), object_size(0) {}
-
- SDOperandPtr(SDUse * use_ptr) {
- ptr = &use_ptr->getSDOperand();
- object_size = (int)sizeof(SDUse);
- }
-
- SDOperandPtr(const SDOperand * op_ptr) {
- ptr = op_ptr;
- object_size = (int)sizeof(SDOperand);
- }
-
- const SDOperand operator *() { return *ptr; }
- const SDOperand *operator ->() { return ptr; }
- SDOperandPtr operator ++ () {
- ptr = (SDOperand*)((char *)ptr + object_size);
- return *this;
- }
-
- SDOperandPtr operator ++ (int) {
- SDOperandPtr tmp = *this;
- ptr = (SDOperand*)((char *)ptr + object_size);
- return tmp;
- }
-
- SDOperand operator[] (int idx) const {
- return *(SDOperand*)((char*) ptr + object_size * idx);
- }
-};
-
-/// SDNode - Represents one node in the SelectionDAG.
-///
-class SDNode : public FoldingSetNode {
-private:
- /// NodeType - The operation that this node performs.
- ///
- unsigned short NodeType;
-
- /// OperandsNeedDelete - This is true if OperandList was new[]'d. If true,
- /// then they will be delete[]'d when the node is destroyed.
- bool OperandsNeedDelete : 1;
-
- /// NodeId - Unique id per SDNode in the DAG.
- int NodeId;
-
- /// OperandList - The values that are used by this operation.
- ///
- SDUse *OperandList;
-
- /// ValueList - The types of the values this node defines. SDNode's may
- /// define multiple values simultaneously.
- const MVT::ValueType *ValueList;
-
- /// NumOperands/NumValues - The number of entries in the Operand/Value list.
- unsigned short NumOperands, NumValues;
-
- /// Prev/Next pointers - These pointers form the linked list of of the
- /// AllNodes list in the current DAG.
- SDNode *Prev, *Next;
- friend struct ilist_traits<SDNode>;
-
- /// UsesSize - The size of the uses list.
- unsigned UsesSize;
-
- /// Uses - List of uses for this SDNode.
- SDUse *Uses;
-
- /// addUse - add SDUse to the list of uses.
- void addUse(SDUse &U) { U.addToList(&Uses); }
-
- // Out-of-line virtual method to give class a home.
- virtual void ANCHOR();
-public:
- virtual ~SDNode() {
- assert(NumOperands == 0 && "Operand list not cleared before deletion");
- NodeType = ISD::DELETED_NODE;
- }
-
- //===--------------------------------------------------------------------===//
- // Accessors
- //
- unsigned getOpcode() const { return NodeType; }
- bool isTargetOpcode() const { return NodeType >= ISD::BUILTIN_OP_END; }
- unsigned getTargetOpcode() const {
- assert(isTargetOpcode() && "Not a target opcode!");
- return NodeType - ISD::BUILTIN_OP_END;
- }
-
- size_t use_size() const { return UsesSize; }
- bool use_empty() const { return Uses == NULL; }
- bool hasOneUse() const { return use_size() == 1; }
-
- /// getNodeId - Return the unique node id.
- ///
- int getNodeId() const { return NodeId; }
-
- /// setNodeId - Set unique node id.
- void setNodeId(int Id) { NodeId = Id; }
-
- /// use_iterator - This class provides iterator support for SDUse
- /// operands that use a specific SDNode.
- class use_iterator
- : public forward_iterator<SDUse, ptrdiff_t> {
- SDUse *Op;
- explicit use_iterator(SDUse *op) : Op(op) {
- }
- friend class SDNode;
- public:
- typedef forward_iterator<SDUse, ptrdiff_t>::reference reference;
- typedef forward_iterator<SDUse, ptrdiff_t>::pointer pointer;
-
- use_iterator(const use_iterator &I) : Op(I.Op) {}
- use_iterator() : Op(0) {}
-
- bool operator==(const use_iterator &x) const {
- return Op == x.Op;
- }
- bool operator!=(const use_iterator &x) const {
- return !operator==(x);
- }
-
- /// atEnd - return true if this iterator is at the end of uses list.
- bool atEnd() const { return Op == 0; }
-
- // Iterator traversal: forward iteration only.
- use_iterator &operator++() { // Preincrement
- assert(Op && "Cannot increment end iterator!");
- Op = Op->getNext();
- return *this;
- }
-
- use_iterator operator++(int) { // Postincrement
- use_iterator tmp = *this; ++*this; return tmp;
- }
-
-
- /// getOperandNum - Retrive a number of a current operand.
- unsigned getOperandNum() const {
- assert(Op && "Cannot dereference end iterator!");
- return (unsigned)(Op - Op->getUser()->OperandList);
- }
-
- /// Retrieve a reference to the current operand.
- SDUse &operator*() const {
- assert(Op && "Cannot dereference end iterator!");
- return *Op;
- }
-
- /// Retrieve a pointer to the current operand.
- SDUse *operator->() const {
- assert(Op && "Cannot dereference end iterator!");
- return Op;
- }
- };
-
- /// use_begin/use_end - Provide iteration support to walk over all uses
- /// of an SDNode.
-
- use_iterator use_begin(SDNode *node) const {
- return use_iterator(node->Uses);
- }
-
- use_iterator use_begin() const {
- return use_iterator(Uses);
- }
-
- static use_iterator use_end() { return use_iterator(0); }
-
-
- /// hasNUsesOfValue - Return true if there are exactly NUSES uses of the
- /// indicated value. This method ignores uses of other values defined by this
- /// operation.
- bool hasNUsesOfValue(unsigned NUses, unsigned Value) const;
-
- /// hasAnyUseOfValue - Return true if there are any use of the indicated
- /// value. This method ignores uses of other values defined by this operation.
- bool hasAnyUseOfValue(unsigned Value) const;
-
- /// isOnlyUseOf - Return true if this node is the only use of N.
- ///
- bool isOnlyUseOf(SDNode *N) const;
-
- /// isOperandOf - Return true if this node is an operand of N.
- ///
- bool isOperandOf(SDNode *N) const;
-
- /// isPredecessorOf - Return true if this node is a predecessor of N. This
- /// node is either an operand of N or it can be reached by recursively
- /// traversing up the operands.
- /// NOTE: this is an expensive method. Use it carefully.
- bool isPredecessorOf(SDNode *N) const;
-
- /// getNumOperands - Return the number of values used by this operation.
- ///
- unsigned getNumOperands() const { return NumOperands; }
-
- /// getConstantOperandVal - Helper method returns the integer value of a
- /// ConstantSDNode operand.
- uint64_t getConstantOperandVal(unsigned Num) const;
-
- const SDOperand &getOperand(unsigned Num) const {
- assert(Num < NumOperands && "Invalid child # of SDNode!");
- return OperandList[Num].getSDOperand();
- }
-
- typedef SDUse* op_iterator;
- op_iterator op_begin() const { return OperandList; }
- op_iterator op_end() const { return OperandList+NumOperands; }
-
-
- SDVTList getVTList() const {
- SDVTList X = { ValueList, NumValues };
- return X;
- };
-
- /// getNumValues - Return the number of values defined/returned by this
- /// operator.
- ///
- unsigned getNumValues() const { return NumValues; }
-
- /// getValueType - Return the type of a specified result.
- ///
- MVT::ValueType getValueType(unsigned ResNo) const {
- assert(ResNo < NumValues && "Illegal result number!");
- return ValueList[ResNo];
- }
-
- /// getValueSizeInBits - Returns MVT::getSizeInBits(getValueType(ResNo)).
- ///
- unsigned getValueSizeInBits(unsigned ResNo) const {
- return MVT::getSizeInBits(getValueType(ResNo));
- }
-
- typedef const MVT::ValueType* value_iterator;
- value_iterator value_begin() const { return ValueList; }
- value_iterator value_end() const { return ValueList+NumValues; }
-
- /// getOperationName - Return the opcode of this operation for printing.
- ///
- std::string getOperationName(const SelectionDAG *G = 0) const;
- static const char* getIndexedModeName(ISD::MemIndexedMode AM);
- void dump() const;
- void dump(const SelectionDAG *G) const;
-
- static bool classof(const SDNode *) { return true; }
-
- /// Profile - Gather unique data for the node.
- ///
- void Profile(FoldingSetNodeID &ID);
-
-protected:
- friend class SelectionDAG;
-
- /// getValueTypeList - Return a pointer to the specified value type.
- ///
- static const MVT::ValueType *getValueTypeList(MVT::ValueType VT);
- static SDVTList getSDVTList(MVT::ValueType VT) {
- SDVTList Ret = { getValueTypeList(VT), 1 };
- return Ret;
- }
-
- SDNode(unsigned Opc, SDVTList VTs, const SDOperand *Ops, unsigned NumOps)
- : NodeType(Opc), NodeId(-1), UsesSize(0), Uses(NULL) {
- OperandsNeedDelete = true;
- NumOperands = NumOps;
- OperandList = NumOps ? new SDUse[NumOperands] : 0;
-
- for (unsigned i = 0; i != NumOps; ++i) {
- OperandList[i] = Ops[i];
- OperandList[i].setUser(this);
- Ops[i].Val->addUse(OperandList[i]);
- ++Ops[i].Val->UsesSize;
- }
-
- ValueList = VTs.VTs;
- NumValues = VTs.NumVTs;
- Prev = 0; Next = 0;
- }
-
- SDNode(unsigned Opc, SDVTList VTs, SDOperandPtr Ops, unsigned NumOps)
- : NodeType(Opc), NodeId(-1), UsesSize(0), Uses(NULL) {
- OperandsNeedDelete = true;
- NumOperands = NumOps;
- OperandList = NumOps ? new SDUse[NumOperands] : 0;
-
- for (unsigned i = 0; i != NumOps; ++i) {
- OperandList[i] = Ops[i];
- OperandList[i].setUser(this);
- Ops[i].Val->addUse(OperandList[i]);
- ++Ops[i].Val->UsesSize;
- }
-
- ValueList = VTs.VTs;
- NumValues = VTs.NumVTs;
- Prev = 0; Next = 0;
- }
-
- SDNode(unsigned Opc, SDVTList VTs)
- : NodeType(Opc), NodeId(-1), UsesSize(0), Uses(NULL) {
- OperandsNeedDelete = false; // Operands set with InitOperands.
- NumOperands = 0;
- OperandList = 0;
- ValueList = VTs.VTs;
- NumValues = VTs.NumVTs;
- Prev = 0; Next = 0;
- }
-
- /// InitOperands - Initialize the operands list of this node with the
- /// specified values, which are part of the node (thus they don't need to be
- /// copied in or allocated).
- void InitOperands(SDUse *Ops, unsigned NumOps) {
- assert(OperandList == 0 && "Operands already set!");
- NumOperands = NumOps;
- OperandList = Ops;
- UsesSize = 0;
- Uses = NULL;
-
- for (unsigned i = 0; i != NumOps; ++i) {
- OperandList[i].setUser(this);
- Ops[i].getVal()->addUse(OperandList[i]);
- ++Ops[i].getVal()->UsesSize;
- }
- }
-
- /// MorphNodeTo - This frees the operands of the current node, resets the
- /// opcode, types, and operands to the specified value. This should only be
- /// used by the SelectionDAG class.
- void MorphNodeTo(unsigned Opc, SDVTList L,
- SDOperandPtr Ops, unsigned NumOps);
-
- void addUser(unsigned i, SDNode *User) {
- assert(User->OperandList[i].getUser() && "Node without parent");
- addUse(User->OperandList[i]);
- ++UsesSize;
- }
-
- void removeUser(unsigned i, SDNode *User) {
- assert(User->OperandList[i].getUser() && "Node without parent");
- SDUse &Op = User->OperandList[i];
- Op.removeFromList();
- --UsesSize;
- }
-};
-
-
-// Define inline functions from the SDOperand class.
-
-inline unsigned SDOperand::getOpcode() const {
- return Val->getOpcode();
-}
-inline MVT::ValueType SDOperand::getValueType() const {
- return Val->getValueType(ResNo);
-}
-inline unsigned SDOperand::getNumOperands() const {
- return Val->getNumOperands();
-}
-inline const SDOperand &SDOperand::getOperand(unsigned i) const {
- return Val->getOperand(i);
-}
-inline uint64_t SDOperand::getConstantOperandVal(unsigned i) const {
- return Val->getConstantOperandVal(i);
-}
-inline bool SDOperand::isTargetOpcode() const {
- return Val->isTargetOpcode();
-}
-inline unsigned SDOperand::getTargetOpcode() const {
- return Val->getTargetOpcode();
-}
-inline bool SDOperand::hasOneUse() const {
- return Val->hasNUsesOfValue(1, ResNo);
-}
-inline bool SDOperand::use_empty() const {
- return !Val->hasAnyUseOfValue(ResNo);
-}
-
-/// UnarySDNode - This class is used for single-operand SDNodes. This is solely
-/// to allow co-allocation of node operands with the node itself.
-class UnarySDNode : public SDNode {
- virtual void ANCHOR(); // Out-of-line virtual method to give class a home.
- SDUse Op;
-public:
- UnarySDNode(unsigned Opc, SDVTList VTs, SDOperand X)
- : SDNode(Opc, VTs) {
- Op = X;
- InitOperands(&Op, 1);
- }
-};
-
-/// BinarySDNode - This class is used for two-operand SDNodes. This is solely
-/// to allow co-allocation of node operands with the node itself.
-class BinarySDNode : public SDNode {
- virtual void ANCHOR(); // Out-of-line virtual method to give class a home.
- SDUse Ops[2];
-public:
- BinarySDNode(unsigned Opc, SDVTList VTs, SDOperand X, SDOperand Y)
- : SDNode(Opc, VTs) {
- Ops[0] = X;
- Ops[1] = Y;
- InitOperands(Ops, 2);
- }
-};
-
-/// TernarySDNode - This class is used for three-operand SDNodes. This is solely
-/// to allow co-allocation of node operands with the node itself.
-class TernarySDNode : public SDNode {
- virtual void ANCHOR(); // Out-of-line virtual method to give class a home.
- SDUse Ops[3];
-public:
- TernarySDNode(unsigned Opc, SDVTList VTs, SDOperand X, SDOperand Y,
- SDOperand Z)
- : SDNode(Opc, VTs) {
- Ops[0] = X;
- Ops[1] = Y;
- Ops[2] = Z;
- InitOperands(Ops, 3);
- }
-};
-
-
-/// HandleSDNode - This class is used to form a handle around another node that
-/// is persistant and is updated across invocations of replaceAllUsesWith on its
-/// operand. This node should be directly created by end-users and not added to
-/// the AllNodes list.
-class HandleSDNode : public SDNode {
- virtual void ANCHOR(); // Out-of-line virtual method to give class a home.
- SDUse Op;
-public:
- // FIXME: Remove the "noinline" attribute once <rdar://problem/5852746> is
- // fixed.
-#ifdef __GNUC__
- explicit __attribute__((__noinline__)) HandleSDNode(SDOperand X)
-#else
- explicit HandleSDNode(SDOperand X)
-#endif
- : SDNode(ISD::HANDLENODE, getSDVTList(MVT::Other)) {
- Op = X;
- InitOperands(&Op, 1);
- }
- ~HandleSDNode();
- SDUse getValue() const { return Op; }
-};
-
-class AtomicSDNode : public SDNode {
- virtual void ANCHOR(); // Out-of-line virtual method to give class a home.
- SDUse Ops[4];
- MVT::ValueType OrigVT;
-public:
- AtomicSDNode(unsigned Opc, SDVTList VTL, SDOperand Chain, SDOperand Ptr,
- SDOperand Cmp, SDOperand Swp, MVT::ValueType VT)
- : SDNode(Opc, VTL) {
- Ops[0] = Chain;
- Ops[1] = Ptr;
- Ops[2] = Swp;
- Ops[3] = Cmp;
- InitOperands(Ops, 4);
- OrigVT=VT;
- }
- AtomicSDNode(unsigned Opc, SDVTList VTL, SDOperand Chain, SDOperand Ptr,
- SDOperand Val, MVT::ValueType VT)
- : SDNode(Opc, VTL) {
- Ops[0] = Chain;
- Ops[1] = Ptr;
- Ops[2] = Val;
- InitOperands(Ops, 3);
- OrigVT=VT;
- }
- MVT::ValueType getVT() const { return OrigVT; }
- bool isCompareAndSwap() const { return getOpcode() == ISD::ATOMIC_LCS; }
-};
-
-class StringSDNode : public SDNode {
- std::string Value;
- virtual void ANCHOR(); // Out-of-line virtual method to give class a home.
-protected:
- friend class SelectionDAG;
- explicit StringSDNode(const std::string &val)
- : SDNode(ISD::STRING, getSDVTList(MVT::Other)), Value(val) {
- }
-public:
- const std::string &getValue() const { return Value; }
- static bool classof(const StringSDNode *) { return true; }
- static bool classof(const SDNode *N) {
- return N->getOpcode() == ISD::STRING;
- }
-};
-
-class ConstantSDNode : public SDNode {
- APInt Value;
- virtual void ANCHOR(); // Out-of-line virtual method to give class a home.
-protected:
- friend class SelectionDAG;
- ConstantSDNode(bool isTarget, const APInt &val, MVT::ValueType VT)
- : SDNode(isTarget ? ISD::TargetConstant : ISD::Constant, getSDVTList(VT)),
- Value(val) {
- }
-public:
-
- const APInt &getAPIntValue() const { return Value; }
- uint64_t getValue() const { return Value.getZExtValue(); }
-
- int64_t getSignExtended() const {
- unsigned Bits = MVT::getSizeInBits(getValueType(0));
- return ((int64_t)Value.getZExtValue() << (64-Bits)) >> (64-Bits);
- }
-
- bool isNullValue() const { return Value == 0; }
- bool isAllOnesValue() const {
- return Value == MVT::getIntVTBitMask(getValueType(0));
- }
-
- static bool classof(const ConstantSDNode *) { return true; }
- static bool classof(const SDNode *N) {
- return N->getOpcode() == ISD::Constant ||
- N->getOpcode() == ISD::TargetConstant;
- }
-};
-
-class ConstantFPSDNode : public SDNode {
- APFloat Value;
- virtual void ANCHOR(); // Out-of-line virtual method to give class a home.
-protected:
- friend class SelectionDAG;
- ConstantFPSDNode(bool isTarget, const APFloat& val, MVT::ValueType VT)
- : SDNode(isTarget ? ISD::TargetConstantFP : ISD::ConstantFP,
- getSDVTList(VT)), Value(val) {
- }
-public:
-
- const APFloat& getValueAPF() const { return Value; }
-
- /// isExactlyValue - We don't rely on operator== working on double values, as
- /// it returns true for things that are clearly not equal, like -0.0 and 0.0.
- /// As such, this method can be used to do an exact bit-for-bit comparison of
- /// two floating point values.
-
- /// We leave the version with the double argument here because it's just so
- /// convenient to write "2.0" and the like. Without this function we'd
- /// have to duplicate its logic everywhere it's called.
- bool isExactlyValue(double V) const {
- // convert is not supported on this type
- if (&Value.getSemantics() == &APFloat::PPCDoubleDouble)
- return false;
- APFloat Tmp(V);
- Tmp.convert(Value.getSemantics(), APFloat::rmNearestTiesToEven);
- return isExactlyValue(Tmp);
- }
- bool isExactlyValue(const APFloat& V) const;
-
- bool isValueValidForType(MVT::ValueType VT, const APFloat& Val);
-
- static bool classof(const ConstantFPSDNode *) { return true; }
- static bool classof(const SDNode *N) {
- return N->getOpcode() == ISD::ConstantFP ||
- N->getOpcode() == ISD::TargetConstantFP;
- }
-};
-
-class GlobalAddressSDNode : public SDNode {
- GlobalValue *TheGlobal;
- int Offset;
- virtual void ANCHOR(); // Out-of-line virtual method to give class a home.
-protected:
- friend class SelectionDAG;
- GlobalAddressSDNode(bool isTarget, const GlobalValue *GA, MVT::ValueType VT,
- int o = 0);
-public:
-
- GlobalValue *getGlobal() const { return TheGlobal; }
- int getOffset() const { return Offset; }
-
- static bool classof(const GlobalAddressSDNode *) { return true; }
- static bool classof(const SDNode *N) {
- return N->getOpcode() == ISD::GlobalAddress ||
- N->getOpcode() == ISD::TargetGlobalAddress ||
- N->getOpcode() == ISD::GlobalTLSAddress ||
- N->getOpcode() == ISD::TargetGlobalTLSAddress;
- }
-};
-
-class FrameIndexSDNode : public SDNode {
- int FI;
- virtual void ANCHOR(); // Out-of-line virtual method to give class a home.
-protected:
- friend class SelectionDAG;
- FrameIndexSDNode(int fi, MVT::ValueType VT, bool isTarg)
- : SDNode(isTarg ? ISD::TargetFrameIndex : ISD::FrameIndex, getSDVTList(VT)),
- FI(fi) {
- }
-public:
-
- int getIndex() const { return FI; }
-
- static bool classof(const FrameIndexSDNode *) { return true; }
- static bool classof(const SDNode *N) {
- return N->getOpcode() == ISD::FrameIndex ||
- N->getOpcode() == ISD::TargetFrameIndex;
- }
-};
-
-class JumpTableSDNode : public SDNode {
- int JTI;
- virtual void ANCHOR(); // Out-of-line virtual method to give class a home.
-protected:
- friend class SelectionDAG;
- JumpTableSDNode(int jti, MVT::ValueType VT, bool isTarg)
- : SDNode(isTarg ? ISD::TargetJumpTable : ISD::JumpTable, getSDVTList(VT)),
- JTI(jti) {
- }
-public:
-
- int getIndex() const { return JTI; }
-
- static bool classof(const JumpTableSDNode *) { return true; }
- static bool classof(const SDNode *N) {
- return N->getOpcode() == ISD::JumpTable ||
- N->getOpcode() == ISD::TargetJumpTable;
- }
-};
-
-class ConstantPoolSDNode : public SDNode {
- union {
- Constant *ConstVal;
- MachineConstantPoolValue *MachineCPVal;
- } Val;
- int Offset; // It's a MachineConstantPoolValue if top bit is set.
- unsigned Alignment;
- virtual void ANCHOR(); // Out-of-line virtual method to give class a home.
-protected:
- friend class SelectionDAG;
- ConstantPoolSDNode(bool isTarget, Constant *c, MVT::ValueType VT,
- int o=0)
- : SDNode(isTarget ? ISD::TargetConstantPool : ISD::ConstantPool,
- getSDVTList(VT)), Offset(o), Alignment(0) {
- assert((int)Offset >= 0 && "Offset is too large");
- Val.ConstVal = c;
- }
- ConstantPoolSDNode(bool isTarget, Constant *c, MVT::ValueType VT, int o,
- unsigned Align)
- : SDNode(isTarget ? ISD::TargetConstantPool : ISD::ConstantPool,
- getSDVTList(VT)), Offset(o), Alignment(Align) {
- assert((int)Offset >= 0 && "Offset is too large");
- Val.ConstVal = c;
- }
- ConstantPoolSDNode(bool isTarget, MachineConstantPoolValue *v,
- MVT::ValueType VT, int o=0)
- : SDNode(isTarget ? ISD::TargetConstantPool : ISD::ConstantPool,
- getSDVTList(VT)), Offset(o), Alignment(0) {
- assert((int)Offset >= 0 && "Offset is too large");
- Val.MachineCPVal = v;
- Offset |= 1 << (sizeof(unsigned)*8-1);
- }
- ConstantPoolSDNode(bool isTarget, MachineConstantPoolValue *v,
- MVT::ValueType VT, int o, unsigned Align)
- : SDNode(isTarget ? ISD::TargetConstantPool : ISD::ConstantPool,
- getSDVTList(VT)), Offset(o), Alignment(Align) {
- assert((int)Offset >= 0 && "Offset is too large");
- Val.MachineCPVal = v;
- Offset |= 1 << (sizeof(unsigned)*8-1);
- }
-public:
-
- bool isMachineConstantPoolEntry() const {
- return (int)Offset < 0;
- }
-
- Constant *getConstVal() const {
- assert(!isMachineConstantPoolEntry() && "Wrong constantpool type");
- return Val.ConstVal;
- }
-
- MachineConstantPoolValue *getMachineCPVal() const {
- assert(isMachineConstantPoolEntry() && "Wrong constantpool type");
- return Val.MachineCPVal;
- }
-
- int getOffset() const {
- return Offset & ~(1 << (sizeof(unsigned)*8-1));
- }
-
- // Return the alignment of this constant pool object, which is either 0 (for
- // default alignment) or log2 of the desired value.
- unsigned getAlignment() const { return Alignment; }
-
- const Type *getType() const;
-
- static bool classof(const ConstantPoolSDNode *) { return true; }
- static bool classof(const SDNode *N) {
- return N->getOpcode() == ISD::ConstantPool ||
- N->getOpcode() == ISD::TargetConstantPool;
- }
-};
-
-class BasicBlockSDNode : public SDNode {
- MachineBasicBlock *MBB;
- virtual void ANCHOR(); // Out-of-line virtual method to give class a home.
-protected:
- friend class SelectionDAG;
- explicit BasicBlockSDNode(MachineBasicBlock *mbb)
- : SDNode(ISD::BasicBlock, getSDVTList(MVT::Other)), MBB(mbb) {
- }
-public:
-
- MachineBasicBlock *getBasicBlock() const { return MBB; }
-
- static bool classof(const BasicBlockSDNode *) { return true; }
- static bool classof(const SDNode *N) {
- return N->getOpcode() == ISD::BasicBlock;
- }
-};
-
-/// SrcValueSDNode - An SDNode that holds an arbitrary LLVM IR Value. This is
-/// used when the SelectionDAG needs to make a simple reference to something
-/// in the LLVM IR representation.
-///
-/// Note that this is not used for carrying alias information; that is done
-/// with MemOperandSDNode, which includes a Value which is required to be a
-/// pointer, and several other fields specific to memory references.
-///
-class SrcValueSDNode : public SDNode {
- const Value *V;
- virtual void ANCHOR(); // Out-of-line virtual method to give class a home.
-protected:
- friend class SelectionDAG;
- /// Create a SrcValue for a general value.
- explicit SrcValueSDNode(const Value *v)
- : SDNode(ISD::SRCVALUE, getSDVTList(MVT::Other)), V(v) {}
-
-public:
- /// getValue - return the contained Value.
- const Value *getValue() const { return V; }
-
- static bool classof(const SrcValueSDNode *) { return true; }
- static bool classof(const SDNode *N) {
- return N->getOpcode() == ISD::SRCVALUE;
- }
-};
-
-
-/// MemOperandSDNode - An SDNode that holds a MachineMemOperand. This is
-/// used to represent a reference to memory after ISD::LOAD
-/// and ISD::STORE have been lowered.
-///
-class MemOperandSDNode : public SDNode {
- virtual void ANCHOR(); // Out-of-line virtual method to give class a home.
-protected:
- friend class SelectionDAG;
- /// Create a MachineMemOperand node
- explicit MemOperandSDNode(const MachineMemOperand &mo)
- : SDNode(ISD::MEMOPERAND, getSDVTList(MVT::Other)), MO(mo) {}
-
-public:
- /// MO - The contained MachineMemOperand.
- const MachineMemOperand MO;
-
- static bool classof(const MemOperandSDNode *) { return true; }
- static bool classof(const SDNode *N) {
- return N->getOpcode() == ISD::MEMOPERAND;
- }
-};
-
-
-class RegisterSDNode : public SDNode {
- unsigned Reg;
- virtual void ANCHOR(); // Out-of-line virtual method to give class a home.
-protected:
- friend class SelectionDAG;
- RegisterSDNode(unsigned reg, MVT::ValueType VT)
- : SDNode(ISD::Register, getSDVTList(VT)), Reg(reg) {
- }
-public:
-
- unsigned getReg() const { return Reg; }
-
- static bool classof(const RegisterSDNode *) { return true; }
- static bool classof(const SDNode *N) {
- return N->getOpcode() == ISD::Register;
- }
-};
-
-class ExternalSymbolSDNode : public SDNode {
- const char *Symbol;
- virtual void ANCHOR(); // Out-of-line virtual method to give class a home.
-protected:
- friend class SelectionDAG;
- ExternalSymbolSDNode(bool isTarget, const char *Sym, MVT::ValueType VT)
- : SDNode(isTarget ? ISD::TargetExternalSymbol : ISD::ExternalSymbol,
- getSDVTList(VT)), Symbol(Sym) {
- }
-public:
-
- const char *getSymbol() const { return Symbol; }
-
- static bool classof(const ExternalSymbolSDNode *) { return true; }
- static bool classof(const SDNode *N) {
- return N->getOpcode() == ISD::ExternalSymbol ||
- N->getOpcode() == ISD::TargetExternalSymbol;
- }
-};
-
-class CondCodeSDNode : public SDNode {
- ISD::CondCode Condition;
- virtual void ANCHOR(); // Out-of-line virtual method to give class a home.
-protected:
- friend class SelectionDAG;
- explicit CondCodeSDNode(ISD::CondCode Cond)
- : SDNode(ISD::CONDCODE, getSDVTList(MVT::Other)), Condition(Cond) {
- }
-public:
-
- ISD::CondCode get() const { return Condition; }
-
- static bool classof(const CondCodeSDNode *) { return true; }
- static bool classof(const SDNode *N) {
- return N->getOpcode() == ISD::CONDCODE;
- }
-};
-
-namespace ISD {
- struct ArgFlagsTy {
- private:
- static const uint64_t NoFlagSet = 0ULL;
- static const uint64_t ZExt = 1ULL<<0; ///< Zero extended
- static const uint64_t ZExtOffs = 0;
- static const uint64_t SExt = 1ULL<<1; ///< Sign extended
- static const uint64_t SExtOffs = 1;
- static const uint64_t InReg = 1ULL<<2; ///< Passed in register
- static const uint64_t InRegOffs = 2;
- static const uint64_t SRet = 1ULL<<3; ///< Hidden struct-ret ptr
- static const uint64_t SRetOffs = 3;
- static const uint64_t ByVal = 1ULL<<4; ///< Struct passed by value
- static const uint64_t ByValOffs = 4;
- static const uint64_t Nest = 1ULL<<5; ///< Nested fn static chain
- static const uint64_t NestOffs = 5;
- static const uint64_t ByValAlign = 0xFULL << 6; //< Struct alignment
- static const uint64_t ByValAlignOffs = 6;
- static const uint64_t Split = 1ULL << 10;
- static const uint64_t SplitOffs = 10;
- static const uint64_t OrigAlign = 0x1FULL<<27;
- static const uint64_t OrigAlignOffs = 27;
- static const uint64_t ByValSize = 0xffffffffULL << 32; //< Struct size
- static const uint64_t ByValSizeOffs = 32;
-
- static const uint64_t One = 1ULL; //< 1 of this type, for shifts
-
- uint64_t Flags;
- public:
- ArgFlagsTy() : Flags(0) { }
-
- bool isZExt() const { return Flags & ZExt; }
- void setZExt() { Flags |= One << ZExtOffs; }
-
- bool isSExt() const { return Flags & SExt; }
- void setSExt() { Flags |= One << SExtOffs; }
-
- bool isInReg() const { return Flags & InReg; }
- void setInReg() { Flags |= One << InRegOffs; }
-
- bool isSRet() const { return Flags & SRet; }
- void setSRet() { Flags |= One << SRetOffs; }
-
- bool isByVal() const { return Flags & ByVal; }
- void setByVal() { Flags |= One << ByValOffs; }
-
- bool isNest() const { return Flags & Nest; }
- void setNest() { Flags |= One << NestOffs; }
-
- unsigned getByValAlign() const {
- return (unsigned)
- ((One << ((Flags & ByValAlign) >> ByValAlignOffs)) / 2);
- }
- void setByValAlign(unsigned A) {
- Flags = (Flags & ~ByValAlign) |
- (uint64_t(Log2_32(A) + 1) << ByValAlignOffs);
- }
-
- bool isSplit() const { return Flags & Split; }
- void setSplit() { Flags |= One << SplitOffs; }
-
- unsigned getOrigAlign() const {
- return (unsigned)
- ((One << ((Flags & OrigAlign) >> OrigAlignOffs)) / 2);
- }
- void setOrigAlign(unsigned A) {
- Flags = (Flags & ~OrigAlign) |
- (uint64_t(Log2_32(A) + 1) << OrigAlignOffs);
- }
-
- unsigned getByValSize() const {
- return (unsigned)((Flags & ByValSize) >> ByValSizeOffs);
- }
- void setByValSize(unsigned S) {
- Flags = (Flags & ~ByValSize) | (uint64_t(S) << ByValSizeOffs);
- }
-
- /// getArgFlagsString - Returns the flags as a string, eg: "zext align:4".
- std::string getArgFlagsString();
-
- /// getRawBits - Represent the flags as a bunch of bits.
- uint64_t getRawBits() const { return Flags; }
- };
-}
-
-/// ARG_FLAGSSDNode - Leaf node holding parameter flags.
-class ARG_FLAGSSDNode : public SDNode {
- ISD::ArgFlagsTy TheFlags;
- virtual void ANCHOR(); // Out-of-line virtual method to give class a home.
-protected:
- friend class SelectionDAG;
- explicit ARG_FLAGSSDNode(ISD::ArgFlagsTy Flags)
- : SDNode(ISD::ARG_FLAGS, getSDVTList(MVT::Other)), TheFlags(Flags) {
- }
-public:
- ISD::ArgFlagsTy getArgFlags() const { return TheFlags; }
-
- static bool classof(const ARG_FLAGSSDNode *) { return true; }
- static bool classof(const SDNode *N) {
- return N->getOpcode() == ISD::ARG_FLAGS;
- }
-};
-
-/// VTSDNode - This class is used to represent MVT::ValueType's, which are used
-/// to parameterize some operations.
-class VTSDNode : public SDNode {
- MVT::ValueType ValueType;
- virtual void ANCHOR(); // Out-of-line virtual method to give class a home.
-protected:
- friend class SelectionDAG;
- explicit VTSDNode(MVT::ValueType VT)
- : SDNode(ISD::VALUETYPE, getSDVTList(MVT::Other)), ValueType(VT) {
- }
-public:
-
- MVT::ValueType getVT() const { return ValueType; }
-
- static bool classof(const VTSDNode *) { return true; }
- static bool classof(const SDNode *N) {
- return N->getOpcode() == ISD::VALUETYPE;
- }
-};
-
-/// LSBaseSDNode - Base class for LoadSDNode and StoreSDNode
-///
-class LSBaseSDNode : public SDNode {
-private:
- // AddrMode - unindexed, pre-indexed, post-indexed.
- ISD::MemIndexedMode AddrMode;
-
- // MemoryVT - VT of in-memory value.
- MVT::ValueType MemoryVT;
-
- //! SrcValue - Memory location for alias analysis.
- const Value *SrcValue;
-
- //! SVOffset - Memory location offset.
- int SVOffset;
-
- //! Alignment - Alignment of memory location in bytes.
- unsigned Alignment;
-
- //! IsVolatile - True if the store is volatile.
- bool IsVolatile;
-protected:
- //! Operand array for load and store
- /*!
- \note Moving this array to the base class captures more
- common functionality shared between LoadSDNode and
- StoreSDNode
- */
- SDUse Ops[4];
-public:
- LSBaseSDNode(ISD::NodeType NodeTy, SDOperand *Operands, unsigned NumOperands,
- SDVTList VTs, ISD::MemIndexedMode AM, MVT::ValueType VT,
- const Value *SV, int SVO, unsigned Align, bool Vol)
- : SDNode(NodeTy, VTs),
- AddrMode(AM), MemoryVT(VT),
- SrcValue(SV), SVOffset(SVO), Alignment(Align), IsVolatile(Vol) {
- for (unsigned i = 0; i != NumOperands; ++i)
- Ops[i] = Operands[i];
- InitOperands(Ops, NumOperands);
- assert(Align != 0 && "Loads and stores should have non-zero aligment");
- assert((getOffset().getOpcode() == ISD::UNDEF || isIndexed()) &&
- "Only indexed loads and stores have a non-undef offset operand");
- }
-
- const SDOperand &getChain() const { return getOperand(0); }
- const SDOperand &getBasePtr() const {
- return getOperand(getOpcode() == ISD::LOAD ? 1 : 2);
- }
- const SDOperand &getOffset() const {
- return getOperand(getOpcode() == ISD::LOAD ? 2 : 3);
- }
-
- const Value *getSrcValue() const { return SrcValue; }
- int getSrcValueOffset() const { return SVOffset; }
- unsigned getAlignment() const { return Alignment; }
- MVT::ValueType getMemoryVT() const { return MemoryVT; }
- bool isVolatile() const { return IsVolatile; }
-
- ISD::MemIndexedMode getAddressingMode() const { return AddrMode; }
-
- /// isIndexed - Return true if this is a pre/post inc/dec load/store.
- bool isIndexed() const { return AddrMode != ISD::UNINDEXED; }
-
- /// isUnindexed - Return true if this is NOT a pre/post inc/dec load/store.
- bool isUnindexed() const { return AddrMode == ISD::UNINDEXED; }
-
- /// getMemOperand - Return a MachineMemOperand object describing the memory
- /// reference performed by this load or store.
- MachineMemOperand getMemOperand() const;
-
- static bool classof(const LSBaseSDNode *N) { return true; }
- static bool classof(const SDNode *N) {
- return N->getOpcode() == ISD::LOAD ||
- N->getOpcode() == ISD::STORE;
- }
-};
-
-/// LoadSDNode - This class is used to represent ISD::LOAD nodes.
-///
-class LoadSDNode : public LSBaseSDNode {
- virtual void ANCHOR(); // Out-of-line virtual method to give class a home.
-
- // ExtType - non-ext, anyext, sext, zext.
- ISD::LoadExtType ExtType;
-
-protected:
- friend class SelectionDAG;
- LoadSDNode(SDOperand *ChainPtrOff, SDVTList VTs,
- ISD::MemIndexedMode AM, ISD::LoadExtType ETy, MVT::ValueType LVT,
- const Value *SV, int O=0, unsigned Align=0, bool Vol=false)
- : LSBaseSDNode(ISD::LOAD, ChainPtrOff, 3,
- VTs, AM, LVT, SV, O, Align, Vol),
- ExtType(ETy) {}
-public:
-
- ISD::LoadExtType getExtensionType() const { return ExtType; }
- const SDOperand &getBasePtr() const { return getOperand(1); }
- const SDOperand &getOffset() const { return getOperand(2); }
-
- static bool classof(const LoadSDNode *) { return true; }
- static bool classof(const SDNode *N) {
- return N->getOpcode() == ISD::LOAD;
- }
-};
-
-/// StoreSDNode - This class is used to represent ISD::STORE nodes.
-///
-class StoreSDNode : public LSBaseSDNode {
- virtual void ANCHOR(); // Out-of-line virtual method to give class a home.
-
- // IsTruncStore - True if the op does a truncation before store.
- bool IsTruncStore;
-protected:
- friend class SelectionDAG;
- StoreSDNode(SDOperand *ChainValuePtrOff, SDVTList VTs,
- ISD::MemIndexedMode AM, bool isTrunc, MVT::ValueType SVT,
- const Value *SV, int O=0, unsigned Align=0, bool Vol=false)
- : LSBaseSDNode(ISD::STORE, ChainValuePtrOff, 4,
- VTs, AM, SVT, SV, O, Align, Vol),
- IsTruncStore(isTrunc) {}
-public:
-
- bool isTruncatingStore() const { return IsTruncStore; }
- const SDOperand &getValue() const { return getOperand(1); }
- const SDOperand &getBasePtr() const { return getOperand(2); }
- const SDOperand &getOffset() const { return getOperand(3); }
-
- static bool classof(const StoreSDNode *) { return true; }
- static bool classof(const SDNode *N) {
- return N->getOpcode() == ISD::STORE;
- }
-};
-
-
-class SDNodeIterator : public forward_iterator<SDNode, ptrdiff_t> {
- SDNode *Node;
- unsigned Operand;
-
- SDNodeIterator(SDNode *N, unsigned Op) : Node(N), Operand(Op) {}
-public:
- bool operator==(const SDNodeIterator& x) const {
- return Operand == x.Operand;
- }
- bool operator!=(const SDNodeIterator& x) const { return !operator==(x); }
-
- const SDNodeIterator &operator=(const SDNodeIterator &I) {
- assert(I.Node == Node && "Cannot assign iterators to two different nodes!");
- Operand = I.Operand;
- return *this;
- }
-
- pointer operator*() const {
- return Node->getOperand(Operand).Val;
- }
- pointer operator->() const { return operator*(); }
-
- SDNodeIterator& operator++() { // Preincrement
- ++Operand;
- return *this;
- }
- SDNodeIterator operator++(int) { // Postincrement
- SDNodeIterator tmp = *this; ++*this; return tmp;
- }
-
- static SDNodeIterator begin(SDNode *N) { return SDNodeIterator(N, 0); }
- static SDNodeIterator end (SDNode *N) {
- return SDNodeIterator(N, N->getNumOperands());
- }
-
- unsigned getOperand() const { return Operand; }
- const SDNode *getNode() const { return Node; }
-};
-
-template <> struct GraphTraits<SDNode*> {
- typedef SDNode NodeType;
- typedef SDNodeIterator ChildIteratorType;
- static inline NodeType *getEntryNode(SDNode *N) { return N; }
- static inline ChildIteratorType child_begin(NodeType *N) {
- return SDNodeIterator::begin(N);
- }
- static inline ChildIteratorType child_end(NodeType *N) {
- return SDNodeIterator::end(N);
- }
-};
-
-template<>
-struct ilist_traits<SDNode> {
- static SDNode *getPrev(const SDNode *N) { return N->Prev; }
- static SDNode *getNext(const SDNode *N) { return N->Next; }
-
- static void setPrev(SDNode *N, SDNode *Prev) { N->Prev = Prev; }
- static void setNext(SDNode *N, SDNode *Next) { N->Next = Next; }
-
- static SDNode *createSentinel() {
- return new SDNode(ISD::EntryToken, SDNode::getSDVTList(MVT::Other));
- }
- static void destroySentinel(SDNode *N) { delete N; }
- //static SDNode *createNode(const SDNode &V) { return new SDNode(V); }
-
-
- void addNodeToList(SDNode *NTy) {}
- void removeNodeFromList(SDNode *NTy) {}
- void transferNodesFromList(iplist<SDNode, ilist_traits> &L2,
- const ilist_iterator<SDNode> &X,
- const ilist_iterator<SDNode> &Y) {}
-};
-
-namespace ISD {
- /// isNormalLoad - Returns true if the specified node is a non-extending
- /// and unindexed load.
- inline bool isNormalLoad(const SDNode *N) {
- if (N->getOpcode() != ISD::LOAD)
- return false;
- const LoadSDNode *Ld = cast<LoadSDNode>(N);
- return Ld->getExtensionType() == ISD::NON_EXTLOAD &&
- Ld->getAddressingMode() == ISD::UNINDEXED;
- }
-
- /// isNON_EXTLoad - Returns true if the specified node is a non-extending
- /// load.
- inline bool isNON_EXTLoad(const SDNode *N) {
- return N->getOpcode() == ISD::LOAD &&
- cast<LoadSDNode>(N)->getExtensionType() == ISD::NON_EXTLOAD;
- }
-
- /// isEXTLoad - Returns true if the specified node is a EXTLOAD.
- ///
- inline bool isEXTLoad(const SDNode *N) {
- return N->getOpcode() == ISD::LOAD &&
- cast<LoadSDNode>(N)->getExtensionType() == ISD::EXTLOAD;
- }
-
- /// isSEXTLoad - Returns true if the specified node is a SEXTLOAD.
- ///
- inline bool isSEXTLoad(const SDNode *N) {
- return N->getOpcode() == ISD::LOAD &&
- cast<LoadSDNode>(N)->getExtensionType() == ISD::SEXTLOAD;
- }
-
- /// isZEXTLoad - Returns true if the specified node is a ZEXTLOAD.
- ///
- inline bool isZEXTLoad(const SDNode *N) {
- return N->getOpcode() == ISD::LOAD &&
- cast<LoadSDNode>(N)->getExtensionType() == ISD::ZEXTLOAD;
- }
-
- /// isUNINDEXEDLoad - Returns true if the specified node is a unindexed load.
- ///
- inline bool isUNINDEXEDLoad(const SDNode *N) {
- return N->getOpcode() == ISD::LOAD &&
- cast<LoadSDNode>(N)->getAddressingMode() == ISD::UNINDEXED;
- }
-
- /// isNON_TRUNCStore - Returns true if the specified node is a non-truncating
- /// store.
- inline bool isNON_TRUNCStore(const SDNode *N) {
- return N->getOpcode() == ISD::STORE &&
- !cast<StoreSDNode>(N)->isTruncatingStore();
- }
-
- /// isTRUNCStore - Returns true if the specified node is a truncating
- /// store.
- inline bool isTRUNCStore(const SDNode *N) {
- return N->getOpcode() == ISD::STORE &&
- cast<StoreSDNode>(N)->isTruncatingStore();
- }
-}
-
-
-} // end llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/CodeGen/ValueTypes.h b/release_23/include/llvm/CodeGen/ValueTypes.h
deleted file mode 100644
index 6b20b7d6a990..000000000000
--- a/release_23/include/llvm/CodeGen/ValueTypes.h
+++ /dev/null
@@ -1,392 +0,0 @@
-//===- CodeGen/ValueTypes.h - Low-Level Target independ. types --*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines the set of low-level target independent types which various
-// values in the code generator are. This allows the target specific behavior
-// of instructions to be described to target independent passes.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_CODEGEN_VALUETYPES_H
-#define LLVM_CODEGEN_VALUETYPES_H
-
-#include <cassert>
-#include <string>
-#include "llvm/Support/DataTypes.h"
-#include "llvm/Support/MathExtras.h"
-
-namespace llvm {
- class Type;
-
-/// MVT namespace - This namespace defines the SimpleValueType enum, which
-/// contains the various low-level value types, and the ValueType typedef.
-///
-namespace MVT { // MVT = Machine Value Types
- enum SimpleValueType {
- // If you change this numbering, you must change the values in ValueTypes.td
- // well!
- Other = 0, // This is a non-standard value
- i1 = 1, // This is a 1 bit integer value
- i8 = 2, // This is an 8 bit integer value
- i16 = 3, // This is a 16 bit integer value
- i32 = 4, // This is a 32 bit integer value
- i64 = 5, // This is a 64 bit integer value
- i128 = 6, // This is a 128 bit integer value
-
- FIRST_INTEGER_VALUETYPE = i1,
- LAST_INTEGER_VALUETYPE = i128,
-
- f32 = 7, // This is a 32 bit floating point value
- f64 = 8, // This is a 64 bit floating point value
- f80 = 9, // This is a 80 bit floating point value
- f128 = 10, // This is a 128 bit floating point value
- ppcf128 = 11, // This is a PPC 128-bit floating point value
- Flag = 12, // This is a condition code or machine flag.
-
- isVoid = 13, // This has no value
-
- v8i8 = 14, // 8 x i8
- v4i16 = 15, // 4 x i16
- v2i32 = 16, // 2 x i32
- v1i64 = 17, // 1 x i64
- v16i8 = 18, // 16 x i8
- v8i16 = 19, // 8 x i16
- v3i32 = 20, // 3 x i32
- v4i32 = 21, // 4 x i32
- v2i64 = 22, // 2 x i64
-
- v2f32 = 23, // 2 x f32
- v3f32 = 24, // 3 x f32
- v4f32 = 25, // 4 x f32
- v2f64 = 26, // 2 x f64
-
- FIRST_VECTOR_VALUETYPE = v8i8,
- LAST_VECTOR_VALUETYPE = v2f64,
-
- LAST_VALUETYPE = 27, // This always remains at the end of the list.
-
- // fAny - Any floating-point or vector floating-point value. This is used
- // for intrinsics that have overloadings based on floating-point types.
- // This is only for tblgen's consumption!
- fAny = 253,
-
- // iAny - An integer or vector integer value of any bit width. This is
- // used for intrinsics that have overloadings based on integer bit widths.
- // This is only for tblgen's consumption!
- iAny = 254,
-
- // iPTR - An int value the size of the pointer of the current
- // target. This should only be used internal to tblgen!
- iPTR = 255
- };
-
- /// MVT::ValueType - This type holds low-level value types. Valid values
- /// include any of the values in the SimpleValueType enum, or any value
- /// returned from a function in the MVT namespace that has a ValueType
- /// return type. Any value type equal to one of the SimpleValueType enum
- /// values is a "simple" value type. All other value types are "extended".
- ///
- /// Note that simple doesn't necessary mean legal for the target machine.
- /// All legal value types must be simple, but often there are some simple
- /// value types that are not legal.
- ///
- /// @internal
- /// Extended types are either vector types or arbitrary precision integers.
- /// Arbitrary precision integers have iAny in the first SimpleTypeBits bits,
- /// and the bit-width in the next PrecisionBits bits, offset by minus one.
- /// Vector types are encoded by having the first SimpleTypeBits+PrecisionBits
- /// bits encode the vector element type (which must be a scalar type, possibly
- /// an arbitrary precision integer) and the remaining VectorBits upper bits
- /// encode the vector length, offset by one.
- ///
- /// 31--------------16-----------8-------------0
- /// | Vector length | Precision | Simple type |
- /// | | Vector element |
- ///
- /// Note that the verifier currently requires the top bit to be zero.
-
- typedef uint32_t ValueType;
-
- static const int SimpleTypeBits = 8;
- static const int PrecisionBits = 8;
- static const int VectorBits = 32 - SimpleTypeBits - PrecisionBits;
-
- static const uint32_t SimpleTypeMask =
- (~uint32_t(0) << (32 - SimpleTypeBits)) >> (32 - SimpleTypeBits);
-
- static const uint32_t PrecisionMask =
- ((~uint32_t(0) << VectorBits) >> (32 - PrecisionBits)) << SimpleTypeBits;
-
- static const uint32_t VectorMask =
- (~uint32_t(0) >> (32 - VectorBits)) << (32 - VectorBits);
-
- static const uint32_t ElementMask =
- (~uint32_t(0) << VectorBits) >> VectorBits;
-
- /// MVT::isExtendedVT - Test if the given ValueType is extended
- /// (as opposed to being simple).
- static inline bool isExtendedVT(ValueType VT) {
- return VT > SimpleTypeMask;
- }
-
- /// MVT::isInteger - Return true if this is an integer, or a vector integer
- /// type.
- static inline bool isInteger(ValueType VT) {
- ValueType SVT = VT & SimpleTypeMask;
- return (SVT >= FIRST_INTEGER_VALUETYPE && SVT <= LAST_INTEGER_VALUETYPE) ||
- (SVT >= v8i8 && SVT <= v2i64) || (SVT == iAny && (VT & PrecisionMask));
- }
-
- /// MVT::isFloatingPoint - Return true if this is an FP, or a vector FP type.
- static inline bool isFloatingPoint(ValueType VT) {
- ValueType SVT = VT & SimpleTypeMask;
- return (SVT >= f32 && SVT <= ppcf128) || (SVT >= v2f32 && SVT <= v2f64);
- }
-
- /// MVT::isVector - Return true if this is a vector value type.
- static inline bool isVector(ValueType VT) {
- return (VT >= FIRST_VECTOR_VALUETYPE && VT <= LAST_VECTOR_VALUETYPE) ||
- (VT & VectorMask);
- }
-
- /// MVT::getVectorElementType - Given a vector type, return the type of
- /// each element.
- static inline ValueType getVectorElementType(ValueType VT) {
- assert(isVector(VT) && "Invalid vector type!");
- switch (VT) {
- default:
- assert(isExtendedVT(VT) && "Unknown simple vector type!");
- return VT & ElementMask;
- case v8i8 :
- case v16i8: return i8;
- case v4i16:
- case v8i16: return i16;
- case v2i32:
- case v3i32:
- case v4i32: return i32;
- case v1i64:
- case v2i64: return i64;
- case v2f32:
- case v3f32:
- case v4f32: return f32;
- case v2f64: return f64;
- }
- }
-
- /// MVT::getVectorNumElements - Given a vector type, return the
- /// number of elements it contains.
- static inline unsigned getVectorNumElements(ValueType VT) {
- assert(isVector(VT) && "Invalid vector type!");
- switch (VT) {
- default:
- assert(isExtendedVT(VT) && "Unknown simple vector type!");
- return ((VT & VectorMask) >> (32 - VectorBits)) - 1;
- case v16i8: return 16;
- case v8i8 :
- case v8i16: return 8;
- case v4i16:
- case v4i32:
- case v4f32: return 4;
- case v3i32:
- case v3f32: return 3;
- case v2i32:
- case v2i64:
- case v2f32:
- case v2f64: return 2;
- case v1i64: return 1;
- }
- }
-
- /// MVT::getSizeInBits - Return the size of the specified value type
- /// in bits.
- ///
- static inline unsigned getSizeInBits(ValueType VT) {
- switch (VT) {
- default:
- assert(isExtendedVT(VT) && "ValueType has no known size!");
- if (isVector(VT))
- return getSizeInBits(getVectorElementType(VT)) *
- getVectorNumElements(VT);
- if (isInteger(VT))
- return ((VT & PrecisionMask) >> SimpleTypeBits) + 1;
- assert(0 && "Unknown value type!");
- case MVT::i1 : return 1;
- case MVT::i8 : return 8;
- case MVT::i16 : return 16;
- case MVT::f32 :
- case MVT::i32 : return 32;
- case MVT::f64 :
- case MVT::i64 :
- case MVT::v8i8:
- case MVT::v4i16:
- case MVT::v2i32:
- case MVT::v1i64:
- case MVT::v2f32: return 64;
- case MVT::f80 : return 80;
- case MVT::v3i32:
- case MVT::v3f32: return 96;
- case MVT::f128:
- case MVT::ppcf128:
- case MVT::i128:
- case MVT::v16i8:
- case MVT::v8i16:
- case MVT::v4i32:
- case MVT::v2i64:
- case MVT::v4f32:
- case MVT::v2f64: return 128;
- }
- }
-
- /// MVT::getStoreSizeInBits - Return the number of bits overwritten by a
- /// store of the specified value type.
- ///
- static inline unsigned getStoreSizeInBits(ValueType VT) {
- return (getSizeInBits(VT) + 7)/8*8;
- }
-
- /// MVT::is64BitVector - Return true if this is a 64-bit vector type.
- static inline bool is64BitVector(ValueType VT) {
- return (VT==v8i8 || VT==v4i16 || VT==v2i32 || VT==v1i64 || VT==v2f32 ||
- (isExtendedVT(VT) && isVector(VT) && getSizeInBits(VT)==64));
- }
-
- /// MVT::is128BitVector - Return true if this is a 128-bit vector type.
- static inline bool is128BitVector(ValueType VT) {
- return (VT==v16i8 || VT==v8i16 || VT==v4i32 || VT==v2i64 ||
- VT==v4f32 || VT==v2f64 ||
- (isExtendedVT(VT) && isVector(VT) && getSizeInBits(VT)==128));
- }
-
- /// MVT::getIntegerType - Returns the ValueType that represents an integer
- /// with the given number of bits.
- ///
- static inline ValueType getIntegerType(unsigned BitWidth) {
- switch (BitWidth) {
- default:
- break;
- case 1:
- return MVT::i1;
- case 8:
- return MVT::i8;
- case 16:
- return MVT::i16;
- case 32:
- return MVT::i32;
- case 64:
- return MVT::i64;
- case 128:
- return MVT::i128;
- }
- ValueType Result = iAny |
- (((BitWidth - 1) << SimpleTypeBits) & PrecisionMask);
- assert(getSizeInBits(Result) == BitWidth && "Bad bit width!");
- return Result;
- }
-
- /// MVT::RoundIntegerType - Rounds the bit-width of the given integer
- /// ValueType up to the nearest power of two (and at least to eight),
- /// and returns the integer ValueType with that number of bits.
- ///
- static inline ValueType RoundIntegerType(ValueType VT) {
- assert(isInteger(VT) && !isVector(VT) && "Invalid integer type!");
- unsigned BitWidth = getSizeInBits(VT);
- if (BitWidth <= 8)
- return MVT::i8;
- else
- return getIntegerType(1 << Log2_32_Ceil(BitWidth));
- }
-
- /// MVT::getVectorType - Returns the ValueType that represents a vector
- /// NumElements in length, where each element is of type VT.
- ///
- static inline ValueType getVectorType(ValueType VT, unsigned NumElements) {
- switch (VT) {
- default:
- break;
- case MVT::i8:
- if (NumElements == 8) return MVT::v8i8;
- if (NumElements == 16) return MVT::v16i8;
- break;
- case MVT::i16:
- if (NumElements == 4) return MVT::v4i16;
- if (NumElements == 8) return MVT::v8i16;
- break;
- case MVT::i32:
- if (NumElements == 2) return MVT::v2i32;
- if (NumElements == 3) return MVT::v3i32;
- if (NumElements == 4) return MVT::v4i32;
- break;
- case MVT::i64:
- if (NumElements == 1) return MVT::v1i64;
- if (NumElements == 2) return MVT::v2i64;
- break;
- case MVT::f32:
- if (NumElements == 2) return MVT::v2f32;
- if (NumElements == 3) return MVT::v3f32;
- if (NumElements == 4) return MVT::v4f32;
- break;
- case MVT::f64:
- if (NumElements == 2) return MVT::v2f64;
- break;
- }
- // Set the length with the top bit forced to zero (needed by the verifier).
- ValueType Result = VT | (((NumElements + 1) << (33 - VectorBits)) >> 1);
- assert(getVectorElementType(Result) == VT &&
- "Bad vector element type!");
- assert(getVectorNumElements(Result) == NumElements &&
- "Bad vector length!");
- return Result;
- }
-
- /// MVT::getIntVectorWithNumElements - Return any integer vector type that has
- /// the specified number of elements.
- static inline ValueType getIntVectorWithNumElements(unsigned NumElts) {
- switch (NumElts) {
- default: return getVectorType(i8, NumElts);
- case 1: return v1i64;
- case 2: return v2i32;
- case 3: return v3i32;
- case 4: return v4i16;
- case 8: return v8i8;
- case 16: return v16i8;
- }
- }
-
-
- /// MVT::getIntVTBitMask - Return an integer with 1's every place there are
- /// bits in the specified integer value type.
- static inline uint64_t getIntVTBitMask(ValueType VT) {
- assert(isInteger(VT) && !isVector(VT) && "Only applies to int scalars!");
- return ~uint64_t(0UL) >> (64-getSizeInBits(VT));
- }
- /// MVT::getIntVTSignBit - Return an integer with a 1 in the position of the
- /// sign bit for the specified integer value type.
- static inline uint64_t getIntVTSignBit(ValueType VT) {
- assert(isInteger(VT) && !isVector(VT) && "Only applies to int scalars!");
- return uint64_t(1UL) << (getSizeInBits(VT)-1);
- }
-
- /// MVT::getValueTypeString - This function returns value type as a string,
- /// e.g. "i32".
- std::string getValueTypeString(ValueType VT);
-
- /// MVT::getTypeForValueType - This method returns an LLVM type corresponding
- /// to the specified ValueType. For integer types, this returns an unsigned
- /// type. Note that this will abort for types that cannot be represented.
- const Type *getTypeForValueType(ValueType VT);
-
- /// MVT::getValueType - Return the value type corresponding to the specified
- /// type. This returns all pointers as MVT::iPTR. If HandleUnknown is true,
- /// unknown types are returned as Other, otherwise they are invalid.
- ValueType getValueType(const Type *Ty, bool HandleUnknown = false);
-}
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/CodeGen/ValueTypes.td b/release_23/include/llvm/CodeGen/ValueTypes.td
deleted file mode 100644
index 8def99abc7b0..000000000000
--- a/release_23/include/llvm/CodeGen/ValueTypes.td
+++ /dev/null
@@ -1,59 +0,0 @@
-//===- ValueTypes.td - ValueType definitions ---------------*- tablegen -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// Value types - These values correspond to the register types defined in the
-// ValueTypes.h file. If you update anything here, you must update it there as
-// well!
-//
-//===----------------------------------------------------------------------===//
-
-class ValueType<int size, int value> {
- string Namespace = "MVT";
- int Size = size;
- int Value = value;
-}
-
-def OtherVT: ValueType<0 , 0>; // "Other" value
-def i1 : ValueType<1 , 1>; // One bit boolean value
-def i8 : ValueType<8 , 2>; // 8-bit integer value
-def i16 : ValueType<16 , 3>; // 16-bit integer value
-def i32 : ValueType<32 , 4>; // 32-bit integer value
-def i64 : ValueType<64 , 5>; // 64-bit integer value
-def i128 : ValueType<128, 6>; // 128-bit integer value
-def f32 : ValueType<32 , 7>; // 32-bit floating point value
-def f64 : ValueType<64 , 8>; // 64-bit floating point value
-def f80 : ValueType<80 , 9>; // 80-bit floating point value
-def f128 : ValueType<128, 10>; // 128-bit floating point value
-def ppcf128: ValueType<128, 11>; // PPC 128-bit floating point value
-def FlagVT : ValueType<0 , 12>; // Condition code or machine flag
-def isVoid : ValueType<0 , 13>; // Produces no value
-def v8i8 : ValueType<64 , 14>; // 8 x i8 vector value
-def v4i16 : ValueType<64 , 15>; // 4 x i16 vector value
-def v2i32 : ValueType<64 , 16>; // 2 x i32 vector value
-def v1i64 : ValueType<64 , 17>; // 1 x i64 vector value
-
-def v16i8 : ValueType<128, 18>; // 16 x i8 vector value
-def v8i16 : ValueType<128, 19>; // 8 x i16 vector value
-def v3i32 : ValueType<96 , 20>; // 3 x i32 vector value
-def v4i32 : ValueType<128, 21>; // 4 x i32 vector value
-def v2i64 : ValueType<128, 22>; // 2 x i64 vector value
-
-def v2f32 : ValueType<64, 23>; // 2 x f32 vector value
-def v3f32 : ValueType<96 , 24>; // 3 x f32 vector value
-def v4f32 : ValueType<128, 25>; // 4 x f32 vector value
-def v2f64 : ValueType<128, 26>; // 2 x f64 vector value
-
-// Pseudo valuetype to represent "float of any format"
-def fAny : ValueType<0 , 253>;
-
-// Pseudo valuetype to represent "integer of any bit width"
-def iAny : ValueType<0 , 254>;
-
-// Pseudo valuetype mapped to the current pointer size.
-def iPTR : ValueType<0 , 255>;
diff --git a/release_23/include/llvm/Config/alloca.h b/release_23/include/llvm/Config/alloca.h
deleted file mode 100644
index 321cec121d97..000000000000
--- a/release_23/include/llvm/Config/alloca.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * The LLVM Compiler Infrastructure
- *
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
- *
- ******************************************************************************
- *
- * Description:
- * This header file includes the infamous alloc.h header file if the
- * autoconf system has found it. It hides all of the autoconf details
- * from the rest of the application source code.
- */
-
-#ifndef _CONFIG_ALLOC_H
-#define _CONFIG_ALLOC_H
-
-#include "llvm/Config/config.h"
-
-/*
- * This is a modified version of that suggested by the Autoconf manual.
- * 1) The #pragma is indented so that pre-ANSI C compilers ignore it.
- * 2) If alloca.h cannot be found, then try stdlib.h. Some platforms
- * (notably FreeBSD) defined alloca() there.
- */
-#ifdef _MSC_VER
-#include <malloc.h>
-#define alloca _alloca
-#elif defined(HAVE_ALLOCA_H)
-#include <alloca.h>
-#elif defined(__MINGW32__) && defined(HAVE_MALLOC_H)
-#include <malloc.h>
-#elif !defined(__GNUC__)
-# ifdef _AIX
-# pragma alloca
-# else
-# ifndef alloca
- char * alloca ();
-# endif
-# endif
-#else
-# ifdef HAVE_STDLIB_H
-# include <stdlib.h>
-# else
-# error "The function alloca() is required but not found!"
-# endif
-#endif
-
-#endif
-
diff --git a/release_23/include/llvm/Config/config.h.in b/release_23/include/llvm/Config/config.h.in
deleted file mode 100644
index b70cfe140f4e..000000000000
--- a/release_23/include/llvm/Config/config.h.in
+++ /dev/null
@@ -1,573 +0,0 @@
-/* include/llvm/Config/config.h.in. Generated from autoconf/configure.ac by autoheader. */
-
-/* Define if dlopen(0) will open the symbols of the program */
-#undef CAN_DLOPEN_SELF
-
-/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP
- systems. This function is required for `alloca.c' support on those systems.
- */
-#undef CRAY_STACKSEG_END
-
-/* Define to 1 if using `alloca.c'. */
-#undef C_ALLOCA
-
-/* Define if CBE is enabled for printf %a output */
-#undef ENABLE_CBE_PRINTF_A
-
-/* Define if position independent code is enabled */
-#undef ENABLE_PIC
-
-/* Define if threads enabled */
-#undef ENABLE_THREADS
-
-/* Define to 1 if you have `alloca', as a function or macro. */
-#undef HAVE_ALLOCA
-
-/* Define to 1 if you have <alloca.h> and it should be used (not on Ultrix).
- */
-#undef HAVE_ALLOCA_H
-
-/* Define to 1 if you have the `argz_append' function. */
-#undef HAVE_ARGZ_APPEND
-
-/* Define to 1 if you have the `argz_create_sep' function. */
-#undef HAVE_ARGZ_CREATE_SEP
-
-/* Define to 1 if you have the <argz.h> header file. */
-#undef HAVE_ARGZ_H
-
-/* Define to 1 if you have the `argz_insert' function. */
-#undef HAVE_ARGZ_INSERT
-
-/* Define to 1 if you have the `argz_next' function. */
-#undef HAVE_ARGZ_NEXT
-
-/* Define to 1 if you have the `argz_stringify' function. */
-#undef HAVE_ARGZ_STRINGIFY
-
-/* Define to 1 if you have the <assert.h> header file. */
-#undef HAVE_ASSERT_H
-
-/* Define to 1 if you have the `backtrace' function. */
-#undef HAVE_BACKTRACE
-
-/* Define to 1 if you have the `bcopy' function. */
-#undef HAVE_BCOPY
-
-/* Does not have bi-directional iterator */
-#undef HAVE_BI_ITERATOR
-
-/* Define to 1 if you have the `ceilf' function. */
-#undef HAVE_CEILF
-
-/* Define to 1 if you have the `closedir' function. */
-#undef HAVE_CLOSEDIR
-
-/* Define to 1 if you have the <ctype.h> header file. */
-#undef HAVE_CTYPE_H
-
-/* Define to 1 if you have the <dirent.h> header file, and it defines `DIR'.
- */
-#undef HAVE_DIRENT_H
-
-/* Define if you have the GNU dld library. */
-#undef HAVE_DLD
-
-/* Define to 1 if you have the <dld.h> header file. */
-#undef HAVE_DLD_H
-
-/* Define to 1 if you have the `dlerror' function. */
-#undef HAVE_DLERROR
-
-/* Define to 1 if you have the <dlfcn.h> header file. */
-#undef HAVE_DLFCN_H
-
-/* Define if dlopen() is available on this platform. */
-#undef HAVE_DLOPEN
-
-/* Define to 1 if you have the <dl.h> header file. */
-#undef HAVE_DL_H
-
-/* Define if the dot program is available */
-#undef HAVE_DOT
-
-/* Define if the dotty program is available */
-#undef HAVE_DOTTY
-
-/* Define if you have the _dyld_func_lookup function. */
-#undef HAVE_DYLD
-
-/* Define to 1 if you have the <errno.h> header file. */
-#undef HAVE_ERRNO_H
-
-/* Define to 1 if the system has the type `error_t'. */
-#undef HAVE_ERROR_T
-
-/* Define to 1 if you have the <execinfo.h> header file. */
-#undef HAVE_EXECINFO_H
-
-/* Define to 1 if you have the <fcntl.h> header file. */
-#undef HAVE_FCNTL_H
-
-/* Set to 1 if the finite function is found in <ieeefp.h> */
-#undef HAVE_FINITE_IN_IEEEFP_H
-
-/* Define to 1 if you have the `floorf' function. */
-#undef HAVE_FLOORF
-
-/* Define to 1 if you have the `fmodf' function. */
-#undef HAVE_FMODF
-
-/* Does not have forward iterator */
-#undef HAVE_FWD_ITERATOR
-
-/* Define to 1 if you have the `getcwd' function. */
-#undef HAVE_GETCWD
-
-/* Define to 1 if you have the `getpagesize' function. */
-#undef HAVE_GETPAGESIZE
-
-/* Define to 1 if you have the `getrlimit' function. */
-#undef HAVE_GETRLIMIT
-
-/* Define to 1 if you have the `getrusage' function. */
-#undef HAVE_GETRUSAGE
-
-/* Define to 1 if you have the `gettimeofday' function. */
-#undef HAVE_GETTIMEOFDAY
-
-/* Does not have <hash_map> */
-#undef HAVE_GLOBAL_HASH_MAP
-
-/* Does not have hash_set in global namespace */
-#undef HAVE_GLOBAL_HASH_SET
-
-/* Does not have ext/hash_map */
-#undef HAVE_GNU_EXT_HASH_MAP
-
-/* Does not have hash_set in gnu namespace */
-#undef HAVE_GNU_EXT_HASH_SET
-
-/* Define if the Graphviz program is available */
-#undef HAVE_GRAPHVIZ
-
-/* Define if the gv program is available */
-#undef HAVE_GV
-
-/* Define to 1 if you have the `index' function. */
-#undef HAVE_INDEX
-
-/* Define to 1 if the system has the type `int64_t'. */
-#undef HAVE_INT64_T
-
-/* Define to 1 if you have the <inttypes.h> header file. */
-#undef HAVE_INTTYPES_H
-
-/* Define to 1 if you have the `isatty' function. */
-#undef HAVE_ISATTY
-
-/* Set to 1 if the isinf function is found in <cmath> */
-#undef HAVE_ISINF_IN_CMATH
-
-/* Set to 1 if the isinf function is found in <math.h> */
-#undef HAVE_ISINF_IN_MATH_H
-
-/* Set to 1 if the isnan function is found in <cmath> */
-#undef HAVE_ISNAN_IN_CMATH
-
-/* Set to 1 if the isnan function is found in <math.h> */
-#undef HAVE_ISNAN_IN_MATH_H
-
-/* Define if you have the libdl library or equivalent. */
-#undef HAVE_LIBDL
-
-/* Define to 1 if you have the `elf' library (-lelf). */
-#undef HAVE_LIBELF
-
-/* Define to 1 if you have the `imagehlp' library (-limagehlp). */
-#undef HAVE_LIBIMAGEHLP
-
-/* Define to 1 if you have the `m' library (-lm). */
-#undef HAVE_LIBM
-
-/* Define to 1 if you have the `psapi' library (-lpsapi). */
-#undef HAVE_LIBPSAPI
-
-/* Define to 1 if you have the `pthread' library (-lpthread). */
-#undef HAVE_LIBPTHREAD
-
-/* Define to 1 if you have the `udis86' library (-ludis86). */
-#undef HAVE_LIBUDIS86
-
-/* Define to 1 if you have the <limits.h> header file. */
-#undef HAVE_LIMITS_H
-
-/* Define to 1 if you have the <link.h> header file. */
-#undef HAVE_LINK_H
-
-/* Define if you can use -Wl,-R. to pass -R. to the linker, in order to add
- the current directory to the dynamic linker search path. */
-#undef HAVE_LINK_R
-
-/* Define to 1 if you have the `longjmp' function. */
-#undef HAVE_LONGJMP
-
-/* Define to 1 if you have the <mach/mach.h> header file. */
-#undef HAVE_MACH_MACH_H
-
-/* Define to 1 if you have the <mach-o/dyld.h> header file. */
-#undef HAVE_MACH_O_DYLD_H
-
-/* Define if mallinfo() is available on this platform. */
-#undef HAVE_MALLINFO
-
-/* Define to 1 if you have the <malloc.h> header file. */
-#undef HAVE_MALLOC_H
-
-/* Define to 1 if you have the <malloc/malloc.h> header file. */
-#undef HAVE_MALLOC_MALLOC_H
-
-/* Define to 1 if you have the `malloc_zone_statistics' function. */
-#undef HAVE_MALLOC_ZONE_STATISTICS
-
-/* Define to 1 if you have the `memcpy' function. */
-#undef HAVE_MEMCPY
-
-/* Define to 1 if you have the `memmove' function. */
-#undef HAVE_MEMMOVE
-
-/* Define to 1 if you have the <memory.h> header file. */
-#undef HAVE_MEMORY_H
-
-/* Define to 1 if you have the `mkdtemp' function. */
-#undef HAVE_MKDTEMP
-
-/* Define to 1 if you have the `mkstemp' function. */
-#undef HAVE_MKSTEMP
-
-/* Define to 1 if you have the `mktemp' function. */
-#undef HAVE_MKTEMP
-
-/* Define to 1 if you have a working `mmap' system call. */
-#undef HAVE_MMAP
-
-/* Define if mmap() uses MAP_ANONYMOUS to map anonymous pages, or undefine if
- it uses MAP_ANON */
-#undef HAVE_MMAP_ANONYMOUS
-
-/* Define if mmap() can map files into memory */
-#undef HAVE_MMAP_FILE
-
-/* define if the compiler implements namespaces */
-#undef HAVE_NAMESPACES
-
-/* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */
-#undef HAVE_NDIR_H
-
-/* Define to 1 if you have the `nearbyintf' function. */
-#undef HAVE_NEARBYINTF
-
-/* Define to 1 if you have the `opendir' function. */
-#undef HAVE_OPENDIR
-
-/* Define to 1 if you have the `powf' function. */
-#undef HAVE_POWF
-
-/* Define if libtool can extract symbol lists from object files. */
-#undef HAVE_PRELOADED_SYMBOLS
-
-/* Define to have the %a format string */
-#undef HAVE_PRINTF_A
-
-/* Define to 1 if you have the <pthread.h> header file. */
-#undef HAVE_PTHREAD_H
-
-/* Have pthread_mutex_lock */
-#undef HAVE_PTHREAD_MUTEX_LOCK
-
-/* Define to 1 if srand48/lrand48/drand48 exist in <stdlib.h> */
-#undef HAVE_RAND48
-
-/* Define to 1 if you have the `readdir' function. */
-#undef HAVE_READDIR
-
-/* Define to 1 if you have the `realpath' function. */
-#undef HAVE_REALPATH
-
-/* Define to 1 if you have the `rindex' function. */
-#undef HAVE_RINDEX
-
-/* Define to 1 if you have the `rintf' function. */
-#undef HAVE_RINTF
-
-/* Define to 1 if you have the `round' function. */
-#undef HAVE_ROUND
-
-/* Define to 1 if you have the `roundf' function. */
-#undef HAVE_ROUNDF
-
-/* Define to 1 if you have the `sbrk' function. */
-#undef HAVE_SBRK
-
-/* Define to 1 if you have the `setjmp' function. */
-#undef HAVE_SETJMP
-
-/* Define to 1 if you have the <setjmp.h> header file. */
-#undef HAVE_SETJMP_H
-
-/* Define to 1 if you have the `setrlimit' function. */
-#undef HAVE_SETRLIMIT
-
-/* Define if you have the shl_load function. */
-#undef HAVE_SHL_LOAD
-
-/* Define to 1 if you have the `siglongjmp' function. */
-#undef HAVE_SIGLONGJMP
-
-/* Define to 1 if you have the <signal.h> header file. */
-#undef HAVE_SIGNAL_H
-
-/* Define to 1 if you have the `sigsetjmp' function. */
-#undef HAVE_SIGSETJMP
-
-/* Define to 1 if you have the <stdint.h> header file. */
-#undef HAVE_STDINT_H
-
-/* Define to 1 if you have the <stdio.h> header file. */
-#undef HAVE_STDIO_H
-
-/* Define to 1 if you have the <stdlib.h> header file. */
-#undef HAVE_STDLIB_H
-
-/* Does not have ext/hash_map> */
-#undef HAVE_STD_EXT_HASH_MAP
-
-/* Does not have hash_set in std namespace */
-#undef HAVE_STD_EXT_HASH_SET
-
-/* Set to 1 if the std::isinf function is found in <cmath> */
-#undef HAVE_STD_ISINF_IN_CMATH
-
-/* Set to 1 if the std::isnan function is found in <cmath> */
-#undef HAVE_STD_ISNAN_IN_CMATH
-
-/* Does not have std namespace iterator */
-#undef HAVE_STD_ITERATOR
-
-/* Define to 1 if you have the `strchr' function. */
-#undef HAVE_STRCHR
-
-/* Define to 1 if you have the `strcmp' function. */
-#undef HAVE_STRCMP
-
-/* Define to 1 if you have the `strdup' function. */
-#undef HAVE_STRDUP
-
-/* Define to 1 if you have the `strerror' function. */
-#undef HAVE_STRERROR
-
-/* Define to 1 if you have the `strerror_r' function. */
-#undef HAVE_STRERROR_R
-
-/* Define to 1 if you have the <strings.h> header file. */
-#undef HAVE_STRINGS_H
-
-/* Define to 1 if you have the <string.h> header file. */
-#undef HAVE_STRING_H
-
-/* Define to 1 if you have the `strrchr' function. */
-#undef HAVE_STRRCHR
-
-/* Define to 1 if you have the `strtof' function. */
-#undef HAVE_STRTOF
-
-/* Define to 1 if you have the `strtoll' function. */
-#undef HAVE_STRTOLL
-
-/* Define to 1 if you have the `strtoq' function. */
-#undef HAVE_STRTOQ
-
-/* Define to 1 if you have the `sysconf' function. */
-#undef HAVE_SYSCONF
-
-/* Define to 1 if you have the <sys/dir.h> header file, and it defines `DIR'.
- */
-#undef HAVE_SYS_DIR_H
-
-/* Define to 1 if you have the <sys/dl.h> header file. */
-#undef HAVE_SYS_DL_H
-
-/* Define to 1 if you have the <sys/mman.h> header file. */
-#undef HAVE_SYS_MMAN_H
-
-/* Define to 1 if you have the <sys/ndir.h> header file, and it defines `DIR'.
- */
-#undef HAVE_SYS_NDIR_H
-
-/* Define to 1 if you have the <sys/param.h> header file. */
-#undef HAVE_SYS_PARAM_H
-
-/* Define to 1 if you have the <sys/resource.h> header file. */
-#undef HAVE_SYS_RESOURCE_H
-
-/* Define to 1 if you have the <sys/stat.h> header file. */
-#undef HAVE_SYS_STAT_H
-
-/* Define to 1 if you have the <sys/time.h> header file. */
-#undef HAVE_SYS_TIME_H
-
-/* Define to 1 if you have the <sys/types.h> header file. */
-#undef HAVE_SYS_TYPES_H
-
-/* Define to 1 if you have <sys/wait.h> that is POSIX.1 compatible. */
-#undef HAVE_SYS_WAIT_H
-
-/* Define to 1 if the system has the type `uint64_t'. */
-#undef HAVE_UINT64_T
-
-/* Define to 1 if you have the <unistd.h> header file. */
-#undef HAVE_UNISTD_H
-
-/* Define to 1 if you have the <utime.h> header file. */
-#undef HAVE_UTIME_H
-
-/* Define to 1 if the system has the type `u_int64_t'. */
-#undef HAVE_U_INT64_T
-
-/* Define to 1 if you have the <windows.h> header file. */
-#undef HAVE_WINDOWS_H
-
-/* Define to 1 if you have the `__dso_handle' function. */
-#undef HAVE___DSO_HANDLE
-
-/* Installation directory for binary executables */
-#undef LLVM_BINDIR
-
-/* Time at which LLVM was configured */
-#undef LLVM_CONFIGTIME
-
-/* Installation directory for data files */
-#undef LLVM_DATADIR
-
-/* Installation directory for documentation */
-#undef LLVM_DOCSDIR
-
-/* Installation directory for config files */
-#undef LLVM_ETCDIR
-
-/* Host triple we were built on */
-#undef LLVM_HOSTTRIPLE
-
-/* Installation directory for include files */
-#undef LLVM_INCLUDEDIR
-
-/* Installation directory for .info files */
-#undef LLVM_INFODIR
-
-/* Installation directory for libraries */
-#undef LLVM_LIBDIR
-
-/* Installation directory for man pages */
-#undef LLVM_MANDIR
-
-/* Define if this is Unixish platform */
-#undef LLVM_ON_UNIX
-
-/* Define if this is Win32ish platform */
-#undef LLVM_ON_WIN32
-
-/* Define to path to dot program if found or 'echo dot' otherwise */
-#undef LLVM_PATH_DOT
-
-/* Define to path to dotty program if found or 'echo dotty' otherwise */
-#undef LLVM_PATH_DOTTY
-
-/* Define to path to Graphviz program if found or 'echo Graphviz' otherwise */
-#undef LLVM_PATH_GRAPHVIZ
-
-/* Define to path to gv program if found or 'echo gv' otherwise */
-#undef LLVM_PATH_GV
-
-/* Installation prefix directory */
-#undef LLVM_PREFIX
-
-/* Define if the OS needs help to load dependent libraries for dlopen(). */
-#undef LTDL_DLOPEN_DEPLIBS
-
-/* Define to the sub-directory in which libtool stores uninstalled libraries.
- */
-#undef LTDL_OBJDIR
-
-/* Define to the name of the environment variable that determines the dynamic
- library search path. */
-#undef LTDL_SHLIBPATH_VAR
-
-/* Define to the extension used for shared libraries, say, ".so". */
-#undef LTDL_SHLIB_EXT
-
-/* Define to the system default library search path. */
-#undef LTDL_SYSSEARCHPATH
-
-/* Define if /dev/zero should be used when mapping RWX memory, or undefine if
- its not necessary */
-#undef NEED_DEV_ZERO_FOR_MMAP
-
-/* Define if dlsym() requires a leading underscore in symbol names. */
-#undef NEED_USCORE
-
-/* Define to the address where bug reports for this package should be sent. */
-#undef PACKAGE_BUGREPORT
-
-/* Define to the full name of this package. */
-#undef PACKAGE_NAME
-
-/* Define to the full name and version of this package. */
-#undef PACKAGE_STRING
-
-/* Define to the one symbol short name of this package. */
-#undef PACKAGE_TARNAME
-
-/* Define to the version of this package. */
-#undef PACKAGE_VERSION
-
-/* Define as the return type of signal handlers (`int' or `void'). */
-#undef RETSIGTYPE
-
-/* If using the C implementation of alloca, define if you know the
- direction of stack growth for your system; otherwise it will be
- automatically deduced at runtime.
- STACK_DIRECTION > 0 => grows toward higher addresses
- STACK_DIRECTION < 0 => grows toward lower addresses
- STACK_DIRECTION = 0 => direction of growth unknown */
-#undef STACK_DIRECTION
-
-/* Define to 1 if the `S_IS*' macros in <sys/stat.h> do not work properly. */
-#undef STAT_MACROS_BROKEN
-
-/* Define to 1 if you have the ANSI C header files. */
-#undef STDC_HEADERS
-
-/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
-#undef TIME_WITH_SYS_TIME
-
-/* Define to 1 if your <sys/time.h> declares `struct tm'. */
-#undef TM_IN_SYS_TIME
-
-/* Define if use udis86 library */
-#undef USE_UDIS86
-
-/* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a
- `char[]'. */
-#undef YYTEXT_POINTER
-
-/* Define to empty if `const' does not conform to ANSI C. */
-#undef const
-
-/* Define to a type to use for `error_t' if it is not otherwise available. */
-#undef error_t
-
-/* Define to `int' if <sys/types.h> does not define. */
-#undef pid_t
-
-/* Define to `unsigned int' if <sys/types.h> does not define. */
-#undef size_t
diff --git a/release_23/include/llvm/Constant.h b/release_23/include/llvm/Constant.h
deleted file mode 100644
index c3373f2513ca..000000000000
--- a/release_23/include/llvm/Constant.h
+++ /dev/null
@@ -1,129 +0,0 @@
-//===-- llvm/Constant.h - Constant class definition -------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains the declaration of the Constant class.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_CONSTANT_H
-#define LLVM_CONSTANT_H
-
-#include "llvm/User.h"
-
-namespace llvm {
-
-/// This is an important base class in LLVM. It provides the common facilities
-/// of all constant values in an LLVM program. A constant is a value that is
-/// immutable at runtime. Functions are constants because their address is
-/// immutable. Same with global variables.
-///
-/// All constants share the capabilities provided in this class. All constants
-/// can have a null value. They can have an operand list. Constants can be
-/// simple (integer and floating point values), complex (arrays and structures),
-/// or expression based (computations yielding a constant value composed of
-/// only certain operators and other constant values).
-///
-/// Note that Constants are immutable (once created they never change)
-/// and are fully shared by structural equivalence. This means that two
-/// structurally equivalent constants will always have the same address.
-/// Constant's are created on demand as needed and never deleted: thus clients
-/// don't have to worry about the lifetime of the objects.
-/// @brief LLVM Constant Representation
-class Constant : public User {
- void operator=(const Constant &); // Do not implement
- Constant(const Constant &); // Do not implement
-protected:
- Constant(const Type *Ty, ValueTy vty, Use *Ops, unsigned NumOps)
- : User(Ty, vty, Ops, NumOps) {}
-
- void destroyConstantImpl();
-public:
- /// Static constructor to get a '0' constant of arbitrary type...
- ///
- static Constant *getNullValue(const Type *Ty);
-
- /// Static constructor to get a '-1' constant. This supports integers and
- /// vectors.
- ///
- static Constant *getAllOnesValue(const Type *Ty);
-
- /// isNullValue - Return true if this is the value that would be returned by
- /// getNullValue.
- virtual bool isNullValue() const = 0;
-
- virtual void print(std::ostream &O) const;
- void print(std::ostream *O) const { if (O) print(*O); }
-
- /// canTrap - Return true if evaluation of this constant could trap. This is
- /// true for things like constant expressions that could divide by zero.
- bool canTrap() const;
-
- /// ContaintsRelocations - Return true if the constant value contains
- /// relocations which cannot be resolved at compile time.
- bool ContainsRelocations() const;
-
- // Specialize get/setOperand for Constant's as their operands are always
- // constants as well.
- Constant *getOperand(unsigned i) {
- return static_cast<Constant*>(User::getOperand(i));
- }
- const Constant *getOperand(unsigned i) const {
- return static_cast<const Constant*>(User::getOperand(i));
- }
- void setOperand(unsigned i, Constant *C) {
- User::setOperand(i, C);
- }
-
- /// destroyConstant - Called if some element of this constant is no longer
- /// valid. At this point only other constants may be on the use_list for this
- /// constant. Any constants on our Use list must also be destroy'd. The
- /// implementation must be sure to remove the constant from the list of
- /// available cached constants. Implementations should call
- /// destroyConstantImpl as the last thing they do, to destroy all users and
- /// delete this.
- virtual void destroyConstant() { assert(0 && "Not reached!"); }
-
- //// Methods for support type inquiry through isa, cast, and dyn_cast:
- static inline bool classof(const Constant *) { return true; }
- static inline bool classof(const GlobalValue *) { return true; }
- static inline bool classof(const Value *V) {
- return V->getValueID() >= ConstantFirstVal &&
- V->getValueID() <= ConstantLastVal;
- }
-
- /// replaceUsesOfWithOnConstant - This method is a special form of
- /// User::replaceUsesOfWith (which does not work on constants) that does work
- /// on constants. Basically this method goes through the trouble of building
- /// a new constant that is equivalent to the current one, with all uses of
- /// From replaced with uses of To. After this construction is completed, all
- /// of the users of 'this' are replaced to use the new constant, and then
- /// 'this' is deleted. In general, you should not call this method, instead,
- /// use Value::replaceAllUsesWith, which automatically dispatches to this
- /// method as needed.
- ///
- virtual void replaceUsesOfWithOnConstant(Value *, Value *, Use *) {
- // Provide a default implementation for constants (like integers) that
- // cannot use any other values. This cannot be called at runtime, but needs
- // to be here to avoid link errors.
- assert(getNumOperands() == 0 && "replaceUsesOfWithOnConstant must be "
- "implemented for all constants that have operands!");
- assert(0 && "Constants that do not have operands cannot be using 'From'!");
- }
-
- /// getStringValue - Turn an LLVM constant pointer that eventually points to a
- /// global into a string value. Return an empty string if we can't do it.
- /// Parameter Chop determines if the result is chopped at the first null
- /// terminator.
- ///
- std::string getStringValue(bool Chop = true, unsigned Offset = 0);
-};
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/Constants.h b/release_23/include/llvm/Constants.h
deleted file mode 100644
index c69a381a6961..000000000000
--- a/release_23/include/llvm/Constants.h
+++ /dev/null
@@ -1,767 +0,0 @@
-//===-- llvm/Constants.h - Constant class subclass definitions --*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-/// @file This file contains the declarations for the subclasses of Constant,
-/// which represent the different flavors of constant values that live in LLVM.
-/// Note that Constants are immutable (once created they never change) and are
-/// fully shared by structural equivalence. This means that two structurally
-/// equivalent constants will always have the same address. Constant's are
-/// created on demand as needed and never deleted: thus clients don't have to
-/// worry about the lifetime of the objects.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_CONSTANTS_H
-#define LLVM_CONSTANTS_H
-
-#include "llvm/Constant.h"
-#include "llvm/Type.h"
-#include "llvm/ADT/APInt.h"
-#include "llvm/ADT/APFloat.h"
-
-namespace llvm {
-
-class ArrayType;
-class StructType;
-class PointerType;
-class VectorType;
-
-template<class ConstantClass, class TypeClass, class ValType>
-struct ConstantCreator;
-template<class ConstantClass, class TypeClass>
-struct ConvertConstantType;
-
-//===----------------------------------------------------------------------===//
-/// This is the shared class of boolean and integer constants. This class
-/// represents both boolean and integral constants.
-/// @brief Class for constant integers.
-class ConstantInt : public Constant {
- static ConstantInt *TheTrueVal, *TheFalseVal;
- void *operator new(size_t, unsigned); // DO NOT IMPLEMENT
- ConstantInt(const ConstantInt &); // DO NOT IMPLEMENT
- ConstantInt(const IntegerType *Ty, const APInt& V);
- APInt Val;
-protected:
- // allocate space for exactly zero operands
- void *operator new(size_t s) {
- return User::operator new(s, 0);
- }
-public:
- /// Return the constant as an APInt value reference. This allows clients to
- /// obtain a copy of the value, with all its precision in tact.
- /// @brief Return the constant's value.
- inline const APInt& getValue() const {
- return Val;
- }
-
- /// getBitWidth - Return the bitwidth of this constant.
- unsigned getBitWidth() const { return Val.getBitWidth(); }
-
- /// Return the constant as a 64-bit unsigned integer value after it
- /// has been zero extended as appropriate for the type of this constant. Note
- /// that this method can assert if the value does not fit in 64 bits.
- /// @deprecated
- /// @brief Return the zero extended value.
- inline uint64_t getZExtValue() const {
- return Val.getZExtValue();
- }
-
- /// Return the constant as a 64-bit integer value after it has been sign
- /// sign extended as appropriate for the type of this constant. Note that
- /// this method can assert if the value does not fit in 64 bits.
- /// @deprecated
- /// @brief Return the sign extended value.
- inline int64_t getSExtValue() const {
- return Val.getSExtValue();
- }
-
- /// A helper method that can be used to determine if the constant contained
- /// within is equal to a constant. This only works for very small values,
- /// because this is all that can be represented with all types.
- /// @brief Determine if this constant's value is same as an unsigned char.
- bool equalsInt(uint64_t V) const {
- return Val == V;
- }
-
- /// getTrue/getFalse - Return the singleton true/false values.
- static inline ConstantInt *getTrue() {
- if (TheTrueVal) return TheTrueVal;
- return CreateTrueFalseVals(true);
- }
- static inline ConstantInt *getFalse() {
- if (TheFalseVal) return TheFalseVal;
- return CreateTrueFalseVals(false);
- }
-
- /// Return a ConstantInt with the specified value for the specified type. The
- /// value V will be canonicalized to a an unsigned APInt. Accessing it with
- /// either getSExtValue() or getZExtValue() will yield a correctly sized and
- /// signed value for the type Ty.
- /// @brief Get a ConstantInt for a specific value.
- static ConstantInt *get(const Type *Ty, uint64_t V, bool isSigned = false);
-
- /// Return a ConstantInt with the specified value and an implied Type. The
- /// type is the integer type that corresponds to the bit width of the value.
- static ConstantInt *get(const APInt &V);
-
- /// getType - Specialize the getType() method to always return an IntegerType,
- /// which reduces the amount of casting needed in parts of the compiler.
- ///
- inline const IntegerType *getType() const {
- return reinterpret_cast<const IntegerType*>(Value::getType());
- }
-
- /// This static method returns true if the type Ty is big enough to
- /// represent the value V. This can be used to avoid having the get method
- /// assert when V is larger than Ty can represent. Note that there are two
- /// versions of this method, one for unsigned and one for signed integers.
- /// Although ConstantInt canonicalizes everything to an unsigned integer,
- /// the signed version avoids callers having to convert a signed quantity
- /// to the appropriate unsigned type before calling the method.
- /// @returns true if V is a valid value for type Ty
- /// @brief Determine if the value is in range for the given type.
- static bool isValueValidForType(const Type *Ty, uint64_t V);
- static bool isValueValidForType(const Type *Ty, int64_t V);
-
- /// This function will return true iff this constant represents the "null"
- /// value that would be returned by the getNullValue method.
- /// @returns true if this is the null integer value.
- /// @brief Determine if the value is null.
- virtual bool isNullValue() const {
- return Val == 0;
- }
-
- /// This is just a convenience method to make client code smaller for a
- /// common code. It also correctly performs the comparison without the
- /// potential for an assertion from getZExtValue().
- bool isZero() const {
- return Val == 0;
- }
-
- /// This is just a convenience method to make client code smaller for a
- /// common case. It also correctly performs the comparison without the
- /// potential for an assertion from getZExtValue().
- /// @brief Determine if the value is one.
- bool isOne() const {
- return Val == 1;
- }
-
- /// This function will return true iff every bit in this constant is set
- /// to true.
- /// @returns true iff this constant's bits are all set to true.
- /// @brief Determine if the value is all ones.
- bool isAllOnesValue() const {
- return Val.isAllOnesValue();
- }
-
- /// This function will return true iff this constant represents the largest
- /// value that may be represented by the constant's type.
- /// @returns true iff this is the largest value that may be represented
- /// by this type.
- /// @brief Determine if the value is maximal.
- bool isMaxValue(bool isSigned) const {
- if (isSigned)
- return Val.isMaxSignedValue();
- else
- return Val.isMaxValue();
- }
-
- /// This function will return true iff this constant represents the smallest
- /// value that may be represented by this constant's type.
- /// @returns true if this is the smallest value that may be represented by
- /// this type.
- /// @brief Determine if the value is minimal.
- bool isMinValue(bool isSigned) const {
- if (isSigned)
- return Val.isMinSignedValue();
- else
- return Val.isMinValue();
- }
-
- /// This function will return true iff this constant represents a value with
- /// active bits bigger than 64 bits or a value greater than the given uint64_t
- /// value.
- /// @returns true iff this constant is greater or equal to the given number.
- /// @brief Determine if the value is greater or equal to the given number.
- bool uge(uint64_t Num) {
- return Val.getActiveBits() > 64 || Val.getZExtValue() >= Num;
- }
-
- /// @returns the 64-bit value of this constant if its active bits number is
- /// not greater than 64, otherwise, just return the given uint64_t number.
- /// @brief Get the constant's value if possible.
- uint64_t getLimitedValue(uint64_t Limit = ~0ULL) const {
- return Val.getLimitedValue(Limit);
- }
-
- /// @returns the value for an integer constant of the given type that has all
- /// its bits set to true.
- /// @brief Get the all ones value
- static ConstantInt *getAllOnesValue(const Type *Ty);
-
- /// @brief Methods to support type inquiry through isa, cast, and dyn_cast.
- static inline bool classof(const ConstantInt *) { return true; }
- static bool classof(const Value *V) {
- return V->getValueID() == ConstantIntVal;
- }
- static void ResetTrueFalse() { TheTrueVal = TheFalseVal = 0; }
-private:
- static ConstantInt *CreateTrueFalseVals(bool WhichOne);
-};
-
-
-//===----------------------------------------------------------------------===//
-/// ConstantFP - Floating Point Values [float, double]
-///
-class ConstantFP : public Constant {
- APFloat Val;
- void *operator new(size_t, unsigned);// DO NOT IMPLEMENT
- ConstantFP(const ConstantFP &); // DO NOT IMPLEMENT
-protected:
- ConstantFP(const Type *Ty, const APFloat& V);
-protected:
- // allocate space for exactly zero operands
- void *operator new(size_t s) {
- return User::operator new(s, 0);
- }
-public:
- /// get() - Static factory methods - Return objects of the specified value
- static ConstantFP *get(const APFloat &V);
-
- /// get() - This returns a constant fp for the specified value in the
- /// specified type. This should only be used for simple constant values like
- /// 2.0/1.0 etc, that are known-valid both as double and as the target format.
- static ConstantFP *get(const Type *Ty, double V);
-
- /// isValueValidForType - return true if Ty is big enough to represent V.
- static bool isValueValidForType(const Type *Ty, const APFloat& V);
- inline const APFloat& getValueAPF() const { return Val; }
-
- /// isNullValue - Return true if this is the value that would be returned by
- /// getNullValue. Don't depend on == for doubles to tell us it's zero, it
- /// considers -0.0 to be null as well as 0.0. :(
- virtual bool isNullValue() const;
-
- // Get a negative zero.
- static ConstantFP *getNegativeZero(const Type* Ty);
-
- /// isExactlyValue - We don't rely on operator== working on double values, as
- /// it returns true for things that are clearly not equal, like -0.0 and 0.0.
- /// As such, this method can be used to do an exact bit-for-bit comparison of
- /// two floating point values. The version with a double operand is retained
- /// because it's so convenient to write isExactlyValue(2.0), but please use
- /// it only for simple constants.
- bool isExactlyValue(const APFloat& V) const;
-
- bool isExactlyValue(double V) const {
- // convert is not supported on this type
- if (&Val.getSemantics() == &APFloat::PPCDoubleDouble)
- return false;
- APFloat FV(V);
- FV.convert(Val.getSemantics(), APFloat::rmNearestTiesToEven);
- return isExactlyValue(FV);
- }
- /// Methods for support type inquiry through isa, cast, and dyn_cast:
- static inline bool classof(const ConstantFP *) { return true; }
- static bool classof(const Value *V) {
- return V->getValueID() == ConstantFPVal;
- }
-};
-
-//===----------------------------------------------------------------------===//
-/// ConstantAggregateZero - All zero aggregate value
-///
-class ConstantAggregateZero : public Constant {
- friend struct ConstantCreator<ConstantAggregateZero, Type, char>;
- void *operator new(size_t, unsigned); // DO NOT IMPLEMENT
- ConstantAggregateZero(const ConstantAggregateZero &); // DO NOT IMPLEMENT
-protected:
- explicit ConstantAggregateZero(const Type *Ty)
- : Constant(Ty, ConstantAggregateZeroVal, 0, 0) {}
-protected:
- // allocate space for exactly zero operands
- void *operator new(size_t s) {
- return User::operator new(s, 0);
- }
-public:
- /// get() - static factory method for creating a null aggregate. It is
- /// illegal to call this method with a non-aggregate type.
- static Constant *get(const Type *Ty);
-
- /// isNullValue - Return true if this is the value that would be returned by
- /// getNullValue.
- virtual bool isNullValue() const { return true; }
-
- virtual void destroyConstant();
-
- /// Methods for support type inquiry through isa, cast, and dyn_cast:
- ///
- static bool classof(const ConstantAggregateZero *) { return true; }
- static bool classof(const Value *V) {
- return V->getValueID() == ConstantAggregateZeroVal;
- }
-};
-
-
-//===----------------------------------------------------------------------===//
-/// ConstantArray - Constant Array Declarations
-///
-class ConstantArray : public Constant {
- friend struct ConstantCreator<ConstantArray, ArrayType,
- std::vector<Constant*> >;
- ConstantArray(const ConstantArray &); // DO NOT IMPLEMENT
-protected:
- ConstantArray(const ArrayType *T, const std::vector<Constant*> &Val);
- ~ConstantArray();
-public:
- /// get() - Static factory methods - Return objects of the specified value
- static Constant *get(const ArrayType *T, const std::vector<Constant*> &);
- static Constant *get(const ArrayType *T,
- Constant*const*Vals, unsigned NumVals) {
- // FIXME: make this the primary ctor method.
- return get(T, std::vector<Constant*>(Vals, Vals+NumVals));
- }
-
- /// This method constructs a ConstantArray and initializes it with a text
- /// string. The default behavior (AddNull==true) causes a null terminator to
- /// be placed at the end of the array. This effectively increases the length
- /// of the array by one (you've been warned). However, in some situations
- /// this is not desired so if AddNull==false then the string is copied without
- /// null termination.
- static Constant *get(const std::string &Initializer, bool AddNull = true);
-
- /// getType - Specialize the getType() method to always return an ArrayType,
- /// which reduces the amount of casting needed in parts of the compiler.
- ///
- inline const ArrayType *getType() const {
- return reinterpret_cast<const ArrayType*>(Value::getType());
- }
-
- /// isString - This method returns true if the array is an array of i8 and
- /// the elements of the array are all ConstantInt's.
- bool isString() const;
-
- /// isCString - This method returns true if the array is a string (see
- /// @verbatim
- /// isString) and it ends in a null byte \0 and does not contains any other
- /// @endverbatim
- /// null bytes except its terminator.
- bool isCString() const;
-
- /// getAsString - If this array is isString(), then this method converts the
- /// array to an std::string and returns it. Otherwise, it asserts out.
- ///
- std::string getAsString() const;
-
- /// isNullValue - Return true if this is the value that would be returned by
- /// getNullValue. This always returns false because zero arrays are always
- /// created as ConstantAggregateZero objects.
- virtual bool isNullValue() const { return false; }
-
- virtual void destroyConstant();
- virtual void replaceUsesOfWithOnConstant(Value *From, Value *To, Use *U);
-
- /// Methods for support type inquiry through isa, cast, and dyn_cast:
- static inline bool classof(const ConstantArray *) { return true; }
- static bool classof(const Value *V) {
- return V->getValueID() == ConstantArrayVal;
- }
-};
-
-
-//===----------------------------------------------------------------------===//
-// ConstantStruct - Constant Struct Declarations
-//
-class ConstantStruct : public Constant {
- friend struct ConstantCreator<ConstantStruct, StructType,
- std::vector<Constant*> >;
- ConstantStruct(const ConstantStruct &); // DO NOT IMPLEMENT
-protected:
- ConstantStruct(const StructType *T, const std::vector<Constant*> &Val);
- ~ConstantStruct();
-public:
- /// get() - Static factory methods - Return objects of the specified value
- ///
- static Constant *get(const StructType *T, const std::vector<Constant*> &V);
- static Constant *get(const std::vector<Constant*> &V, bool Packed = false);
- static Constant *get(Constant*const* Vals, unsigned NumVals,
- bool Packed = false) {
- // FIXME: make this the primary ctor method.
- return get(std::vector<Constant*>(Vals, Vals+NumVals), Packed);
- }
-
- /// getType() specialization - Reduce amount of casting...
- ///
- inline const StructType *getType() const {
- return reinterpret_cast<const StructType*>(Value::getType());
- }
-
- /// isNullValue - Return true if this is the value that would be returned by
- /// getNullValue. This always returns false because zero structs are always
- /// created as ConstantAggregateZero objects.
- virtual bool isNullValue() const {
- return false;
- }
-
- virtual void destroyConstant();
- virtual void replaceUsesOfWithOnConstant(Value *From, Value *To, Use *U);
-
- /// Methods for support type inquiry through isa, cast, and dyn_cast:
- static inline bool classof(const ConstantStruct *) { return true; }
- static bool classof(const Value *V) {
- return V->getValueID() == ConstantStructVal;
- }
-};
-
-//===----------------------------------------------------------------------===//
-/// ConstantVector - Constant Vector Declarations
-///
-class ConstantVector : public Constant {
- friend struct ConstantCreator<ConstantVector, VectorType,
- std::vector<Constant*> >;
- ConstantVector(const ConstantVector &); // DO NOT IMPLEMENT
-protected:
- ConstantVector(const VectorType *T, const std::vector<Constant*> &Val);
- ~ConstantVector();
-public:
- /// get() - Static factory methods - Return objects of the specified value
- static Constant *get(const VectorType *T, const std::vector<Constant*> &);
- static Constant *get(const std::vector<Constant*> &V);
- static Constant *get(Constant*const* Vals, unsigned NumVals) {
- // FIXME: make this the primary ctor method.
- return get(std::vector<Constant*>(Vals, Vals+NumVals));
- }
-
- /// getType - Specialize the getType() method to always return a VectorType,
- /// which reduces the amount of casting needed in parts of the compiler.
- ///
- inline const VectorType *getType() const {
- return reinterpret_cast<const VectorType*>(Value::getType());
- }
-
- /// @returns the value for a vector integer constant of the given type that
- /// has all its bits set to true.
- /// @brief Get the all ones value
- static ConstantVector *getAllOnesValue(const VectorType *Ty);
-
- /// isNullValue - Return true if this is the value that would be returned by
- /// getNullValue. This always returns false because zero vectors are always
- /// created as ConstantAggregateZero objects.
- virtual bool isNullValue() const { return false; }
-
- /// This function will return true iff every element in this vector constant
- /// is set to all ones.
- /// @returns true iff this constant's emements are all set to all ones.
- /// @brief Determine if the value is all ones.
- bool isAllOnesValue() const;
-
- /// getSplatValue - If this is a splat constant, meaning that all of the
- /// elements have the same value, return that value. Otherwise return NULL.
- Constant *getSplatValue();
-
- virtual void destroyConstant();
- virtual void replaceUsesOfWithOnConstant(Value *From, Value *To, Use *U);
-
- /// Methods for support type inquiry through isa, cast, and dyn_cast:
- static inline bool classof(const ConstantVector *) { return true; }
- static bool classof(const Value *V) {
- return V->getValueID() == ConstantVectorVal;
- }
-};
-
-//===----------------------------------------------------------------------===//
-/// ConstantPointerNull - a constant pointer value that points to null
-///
-class ConstantPointerNull : public Constant {
- friend struct ConstantCreator<ConstantPointerNull, PointerType, char>;
- void *operator new(size_t, unsigned); // DO NOT IMPLEMENT
- ConstantPointerNull(const ConstantPointerNull &); // DO NOT IMPLEMENT
-protected:
- explicit ConstantPointerNull(const PointerType *T)
- : Constant(reinterpret_cast<const Type*>(T),
- Value::ConstantPointerNullVal, 0, 0) {}
-
-protected:
- // allocate space for exactly zero operands
- void *operator new(size_t s) {
- return User::operator new(s, 0);
- }
-public:
- /// get() - Static factory methods - Return objects of the specified value
- static ConstantPointerNull *get(const PointerType *T);
-
- /// isNullValue - Return true if this is the value that would be returned by
- /// getNullValue.
- virtual bool isNullValue() const { return true; }
-
- virtual void destroyConstant();
-
- /// getType - Specialize the getType() method to always return an PointerType,
- /// which reduces the amount of casting needed in parts of the compiler.
- ///
- inline const PointerType *getType() const {
- return reinterpret_cast<const PointerType*>(Value::getType());
- }
-
- /// Methods for support type inquiry through isa, cast, and dyn_cast:
- static inline bool classof(const ConstantPointerNull *) { return true; }
- static bool classof(const Value *V) {
- return V->getValueID() == ConstantPointerNullVal;
- }
-};
-
-
-/// ConstantExpr - a constant value that is initialized with an expression using
-/// other constant values.
-///
-/// This class uses the standard Instruction opcodes to define the various
-/// constant expressions. The Opcode field for the ConstantExpr class is
-/// maintained in the Value::SubclassData field.
-class ConstantExpr : public Constant {
- friend struct ConstantCreator<ConstantExpr,Type,
- std::pair<unsigned, std::vector<Constant*> > >;
- friend struct ConvertConstantType<ConstantExpr, Type>;
-
-protected:
- ConstantExpr(const Type *Ty, unsigned Opcode, Use *Ops, unsigned NumOps)
- : Constant(Ty, ConstantExprVal, Ops, NumOps) {
- // Operation type (an Instruction opcode) is stored as the SubclassData.
- SubclassData = Opcode;
- }
-
- // These private methods are used by the type resolution code to create
- // ConstantExprs in intermediate forms.
- static Constant *getTy(const Type *Ty, unsigned Opcode,
- Constant *C1, Constant *C2);
- static Constant *getCompareTy(unsigned short pred, Constant *C1,
- Constant *C2);
- static Constant *getSelectTy(const Type *Ty,
- Constant *C1, Constant *C2, Constant *C3);
- static Constant *getGetElementPtrTy(const Type *Ty, Constant *C,
- Value* const *Idxs, unsigned NumIdxs);
- static Constant *getExtractElementTy(const Type *Ty, Constant *Val,
- Constant *Idx);
- static Constant *getInsertElementTy(const Type *Ty, Constant *Val,
- Constant *Elt, Constant *Idx);
- static Constant *getShuffleVectorTy(const Type *Ty, Constant *V1,
- Constant *V2, Constant *Mask);
-
-public:
- // Static methods to construct a ConstantExpr of different kinds. Note that
- // these methods may return a object that is not an instance of the
- // ConstantExpr class, because they will attempt to fold the constant
- // expression into something simpler if possible.
-
- /// Cast constant expr
- ///
- static Constant *getTrunc (Constant *C, const Type *Ty);
- static Constant *getSExt (Constant *C, const Type *Ty);
- static Constant *getZExt (Constant *C, const Type *Ty);
- static Constant *getFPTrunc (Constant *C, const Type *Ty);
- static Constant *getFPExtend(Constant *C, const Type *Ty);
- static Constant *getUIToFP (Constant *C, const Type *Ty);
- static Constant *getSIToFP (Constant *C, const Type *Ty);
- static Constant *getFPToUI (Constant *C, const Type *Ty);
- static Constant *getFPToSI (Constant *C, const Type *Ty);
- static Constant *getPtrToInt(Constant *C, const Type *Ty);
- static Constant *getIntToPtr(Constant *C, const Type *Ty);
- static Constant *getBitCast (Constant *C, const Type *Ty);
-
- // @brief Convenience function for getting one of the casting operations
- // using a CastOps opcode.
- static Constant *getCast(
- unsigned ops, ///< The opcode for the conversion
- Constant *C, ///< The constant to be converted
- const Type *Ty ///< The type to which the constant is converted
- );
-
- // @brief Create a ZExt or BitCast cast constant expression
- static Constant *getZExtOrBitCast(
- Constant *C, ///< The constant to zext or bitcast
- const Type *Ty ///< The type to zext or bitcast C to
- );
-
- // @brief Create a SExt or BitCast cast constant expression
- static Constant *getSExtOrBitCast(
- Constant *C, ///< The constant to sext or bitcast
- const Type *Ty ///< The type to sext or bitcast C to
- );
-
- // @brief Create a Trunc or BitCast cast constant expression
- static Constant *getTruncOrBitCast(
- Constant *C, ///< The constant to trunc or bitcast
- const Type *Ty ///< The type to trunc or bitcast C to
- );
-
- /// @brief Create a BitCast or a PtrToInt cast constant expression
- static Constant *getPointerCast(
- Constant *C, ///< The pointer value to be casted (operand 0)
- const Type *Ty ///< The type to which cast should be made
- );
-
- /// @brief Create a ZExt, Bitcast or Trunc for integer -> integer casts
- static Constant *getIntegerCast(
- Constant *C, ///< The integer constant to be casted
- const Type *Ty, ///< The integer type to cast to
- bool isSigned ///< Whether C should be treated as signed or not
- );
-
- /// @brief Create a FPExt, Bitcast or FPTrunc for fp -> fp casts
- static Constant *getFPCast(
- Constant *C, ///< The integer constant to be casted
- const Type *Ty ///< The integer type to cast to
- );
-
- /// @brief Return true if this is a convert constant expression
- bool isCast() const;
-
- /// @brief Return true if this is a compare constant expression
- bool isCompare() const;
-
- /// Select constant expr
- ///
- static Constant *getSelect(Constant *C, Constant *V1, Constant *V2) {
- return getSelectTy(V1->getType(), C, V1, V2);
- }
-
- /// getSizeOf constant expr - computes the size of a type in a target
- /// independent way (Note: the return type is an i64).
- ///
- static Constant *getSizeOf(const Type *Ty);
-
- /// ConstantExpr::get - Return a binary or shift operator constant expression,
- /// folding if possible.
- ///
- static Constant *get(unsigned Opcode, Constant *C1, Constant *C2);
-
- /// @brief Return an ICmp or FCmp comparison operator constant expression.
- static Constant *getCompare(unsigned short pred, Constant *C1, Constant *C2);
-
- /// ConstantExpr::get* - Return some common constants without having to
- /// specify the full Instruction::OPCODE identifier.
- ///
- static Constant *getNeg(Constant *C);
- static Constant *getNot(Constant *C);
- static Constant *getAdd(Constant *C1, Constant *C2);
- static Constant *getSub(Constant *C1, Constant *C2);
- static Constant *getMul(Constant *C1, Constant *C2);
- static Constant *getUDiv(Constant *C1, Constant *C2);
- static Constant *getSDiv(Constant *C1, Constant *C2);
- static Constant *getFDiv(Constant *C1, Constant *C2);
- static Constant *getURem(Constant *C1, Constant *C2); // unsigned rem
- static Constant *getSRem(Constant *C1, Constant *C2); // signed rem
- static Constant *getFRem(Constant *C1, Constant *C2);
- static Constant *getAnd(Constant *C1, Constant *C2);
- static Constant *getOr(Constant *C1, Constant *C2);
- static Constant *getXor(Constant *C1, Constant *C2);
- static Constant *getICmp(unsigned short pred, Constant *LHS, Constant *RHS);
- static Constant *getFCmp(unsigned short pred, Constant *LHS, Constant *RHS);
- static Constant *getShl(Constant *C1, Constant *C2);
- static Constant *getLShr(Constant *C1, Constant *C2);
- static Constant *getAShr(Constant *C1, Constant *C2);
-
- /// Getelementptr form. std::vector<Value*> is only accepted for convenience:
- /// all elements must be Constant's.
- ///
- static Constant *getGetElementPtr(Constant *C,
- Constant* const *IdxList, unsigned NumIdx);
- static Constant *getGetElementPtr(Constant *C,
- Value* const *IdxList, unsigned NumIdx);
-
- static Constant *getExtractElement(Constant *Vec, Constant *Idx);
- static Constant *getInsertElement(Constant *Vec, Constant *Elt,Constant *Idx);
- static Constant *getShuffleVector(Constant *V1, Constant *V2, Constant *Mask);
-
- /// Floating point negation must be implemented with f(x) = -0.0 - x. This
- /// method returns the negative zero constant for floating point or vector
- /// floating point types; for all other types, it returns the null value.
- static Constant *getZeroValueForNegationExpr(const Type *Ty);
-
- /// isNullValue - Return true if this is the value that would be returned by
- /// getNullValue.
- virtual bool isNullValue() const { return false; }
-
- /// getOpcode - Return the opcode at the root of this constant expression
- unsigned getOpcode() const { return SubclassData; }
-
- /// getPredicate - Return the ICMP or FCMP predicate value. Assert if this is
- /// not an ICMP or FCMP constant expression.
- unsigned getPredicate() const;
-
- /// getOpcodeName - Return a string representation for an opcode.
- const char *getOpcodeName() const;
-
- /// getWithOperandReplaced - Return a constant expression identical to this
- /// one, but with the specified operand set to the specified value.
- Constant *getWithOperandReplaced(unsigned OpNo, Constant *Op) const;
-
- /// getWithOperands - This returns the current constant expression with the
- /// operands replaced with the specified values. The specified operands must
- /// match count and type with the existing ones.
- Constant *getWithOperands(const std::vector<Constant*> &Ops) const;
-
- virtual void destroyConstant();
- virtual void replaceUsesOfWithOnConstant(Value *From, Value *To, Use *U);
-
- /// Override methods to provide more type information...
- inline Constant *getOperand(unsigned i) {
- return cast<Constant>(User::getOperand(i));
- }
- inline Constant *getOperand(unsigned i) const {
- return const_cast<Constant*>(cast<Constant>(User::getOperand(i)));
- }
-
-
- /// Methods for support type inquiry through isa, cast, and dyn_cast:
- static inline bool classof(const ConstantExpr *) { return true; }
- static inline bool classof(const Value *V) {
- return V->getValueID() == ConstantExprVal;
- }
-};
-
-
-//===----------------------------------------------------------------------===//
-/// UndefValue - 'undef' values are things that do not have specified contents.
-/// These are used for a variety of purposes, including global variable
-/// initializers and operands to instructions. 'undef' values can occur with
-/// any type.
-///
-class UndefValue : public Constant {
- friend struct ConstantCreator<UndefValue, Type, char>;
- void *operator new(size_t, unsigned); // DO NOT IMPLEMENT
- UndefValue(const UndefValue &); // DO NOT IMPLEMENT
-protected:
- explicit UndefValue(const Type *T) : Constant(T, UndefValueVal, 0, 0) {}
-protected:
- // allocate space for exactly zero operands
- void *operator new(size_t s) {
- return User::operator new(s, 0);
- }
-public:
- /// get() - Static factory methods - Return an 'undef' object of the specified
- /// type.
- ///
- static UndefValue *get(const Type *T);
-
- /// isNullValue - Return true if this is the value that would be returned by
- /// getNullValue.
- virtual bool isNullValue() const { return false; }
-
- virtual void destroyConstant();
-
- /// Methods for support type inquiry through isa, cast, and dyn_cast:
- static inline bool classof(const UndefValue *) { return true; }
- static bool classof(const Value *V) {
- return V->getValueID() == UndefValueVal;
- }
-};
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/Debugger/Debugger.h b/release_23/include/llvm/Debugger/Debugger.h
deleted file mode 100644
index 5b0b97addf4a..000000000000
--- a/release_23/include/llvm/Debugger/Debugger.h
+++ /dev/null
@@ -1,175 +0,0 @@
-//===- Debugger.h - LLVM debugger library interface -------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines the LLVM source-level debugger library interface.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_DEBUGGER_DEBUGGER_H
-#define LLVM_DEBUGGER_DEBUGGER_H
-
-#include <string>
-#include <vector>
-
-namespace llvm {
- class Module;
- class InferiorProcess;
-
- /// Debugger class - This class implements the LLVM source-level debugger.
- /// This allows clients to handle the user IO processing without having to
- /// worry about how the debugger itself works.
- ///
- class Debugger {
- // State the debugger needs when starting and stopping the program.
- std::vector<std::string> ProgramArguments;
-
- // The environment to run the program with. This should eventually be
- // changed to vector of strings when we allow the user to edit the
- // environment.
- const char * const *Environment;
-
- // Program - The currently loaded program, or null if none is loaded.
- Module *Program;
-
- // Process - The currently executing inferior process.
- InferiorProcess *Process;
-
- Debugger(const Debugger &); // DO NOT IMPLEMENT
- void operator=(const Debugger &); // DO NOT IMPLEMENT
- public:
- Debugger();
- ~Debugger();
-
- //===------------------------------------------------------------------===//
- // Methods for manipulating and inspecting the execution environment.
- //
-
- /// initializeEnvironment - Specify the environment the program should run
- /// with. This is used to initialize the environment of the program to the
- /// environment of the debugger.
- void initializeEnvironment(const char *const *envp) {
- Environment = envp;
- }
-
- /// setWorkingDirectory - Specify the working directory for the program to
- /// be started from.
- void setWorkingDirectory(const std::string &Dir) {
- // FIXME: implement
- }
-
- template<typename It>
- void setProgramArguments(It I, It E) {
- ProgramArguments.assign(I, E);
- }
- unsigned getNumProgramArguments() const {
- return static_cast<unsigned>(ProgramArguments.size());
- }
- const std::string &getProgramArgument(unsigned i) const {
- return ProgramArguments[i];
- }
-
-
- //===------------------------------------------------------------------===//
- // Methods for manipulating and inspecting the program currently loaded.
- //
-
- /// isProgramLoaded - Return true if there is a program currently loaded.
- ///
- bool isProgramLoaded() const { return Program != 0; }
-
- /// getProgram - Return the LLVM module corresponding to the program.
- ///
- Module *getProgram() const { return Program; }
-
- /// getProgramPath - Get the path of the currently loaded program, or an
- /// empty string if none is loaded.
- std::string getProgramPath() const;
-
- /// loadProgram - If a program is currently loaded, unload it. Then search
- /// the PATH for the specified program, loading it when found. If the
- /// specified program cannot be found, an exception is thrown to indicate
- /// the error.
- void loadProgram(const std::string &Path);
-
- /// unloadProgram - If a program is running, kill it, then unload all traces
- /// of the current program. If no program is loaded, this method silently
- /// succeeds.
- void unloadProgram();
-
- //===------------------------------------------------------------------===//
- // Methods for manipulating and inspecting the program currently running.
- //
- // If the program is running, and the debugger is active, then we know that
- // the program has stopped. This being the case, we can inspect the
- // program, ask it for its source location, set breakpoints, etc.
- //
-
- /// isProgramRunning - Return true if a program is loaded and has a
- /// currently active instance.
- bool isProgramRunning() const { return Process != 0; }
-
- /// getRunningProcess - If there is no program running, throw an exception.
- /// Otherwise return the running process so that it can be inspected by the
- /// debugger.
- const InferiorProcess &getRunningProcess() const {
- if (Process == 0) throw "No process running.";
- return *Process;
- }
-
- /// createProgram - Create an instance of the currently loaded program,
- /// killing off any existing one. This creates the program and stops it at
- /// the first possible moment. If there is no program loaded or if there is
- /// a problem starting the program, this method throws an exception.
- void createProgram();
-
- /// killProgram - If the program is currently executing, kill off the
- /// process and free up any state related to the currently running program.
- /// If there is no program currently running, this just silently succeeds.
- /// If something horrible happens when killing the program, an exception
- /// gets thrown.
- void killProgram();
-
-
- //===------------------------------------------------------------------===//
- // Methods for continuing execution. These methods continue the execution
- // of the program by some amount. If the program is successfully stopped,
- // execution returns, otherwise an exception is thrown.
- //
- // NOTE: These methods should always be used in preference to directly
- // accessing the Dbg object, because these will delete the Process object if
- // the process unexpectedly dies.
- //
-
- /// stepProgram - Implement the 'step' command, continuing execution until
- /// the next possible stop point.
- void stepProgram();
-
- /// nextProgram - Implement the 'next' command, continuing execution until
- /// the next possible stop point that is in the current function.
- void nextProgram();
-
- /// finishProgram - Implement the 'finish' command, continuing execution
- /// until the specified frame ID returns.
- void finishProgram(void *Frame);
-
- /// contProgram - Implement the 'cont' command, continuing execution until
- /// the next breakpoint is encountered.
- void contProgram();
- };
-
- class NonErrorException {
- std::string Message;
- public:
- NonErrorException(const std::string &M) : Message(M) {}
- const std::string &getMessage() const { return Message; }
- };
-
-} // end namespace llvm
-
-#endif
diff --git a/release_23/include/llvm/Debugger/InferiorProcess.h b/release_23/include/llvm/Debugger/InferiorProcess.h
deleted file mode 100644
index a775d89153e0..000000000000
--- a/release_23/include/llvm/Debugger/InferiorProcess.h
+++ /dev/null
@@ -1,138 +0,0 @@
-//===- InferiorProcess.h - Represent the program being debugged -*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines the InferiorProcess class, which is used to represent,
-// inspect, and manipulate a process under the control of the LLVM debugger.
-//
-// This is an abstract class which should allow various different types of
-// implementations. Initially we implement a unix specific debugger backend
-// that does not require code generator support, but we could eventually use
-// code generator support with ptrace, support windows based targets, supported
-// remote targets, etc.
-//
-// If the inferior process unexpectedly dies, an attempt to communicate with it
-// will cause an InferiorProcessDead exception to be thrown, indicating the exit
-// code of the process. When this occurs, no methods on the InferiorProcess
-// class should be called except for the destructor.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_DEBUGGER_INFERIORPROCESS_H
-#define LLVM_DEBUGGER_INFERIORPROCESS_H
-
-#include <string>
-#include <vector>
-
-namespace llvm {
- class Module;
- class GlobalVariable;
-
- /// InferiorProcessDead exception - This class is thrown by methods that
- /// communicate with the interior process if the process unexpectedly exits or
- /// dies. The instance variable indicates what the exit code of the process
- /// was, or -1 if unknown.
- class InferiorProcessDead {
- int ExitCode;
- public:
- InferiorProcessDead(int EC) : ExitCode(EC) {}
- int getExitCode() const { return ExitCode; }
- };
-
- /// InferiorProcess class - This class represents the process being debugged
- /// by the debugger. Objects of this class should not be stack allocated,
- /// because the destructor can throw exceptions.
- ///
- class InferiorProcess {
- Module *M;
- protected:
- InferiorProcess(Module *m) : M(m) {}
- public:
- /// create - Create an inferior process of the specified module, and
- /// stop it at the first opportunity. If there is a problem starting the
- /// program (for example, it has no main), throw an exception.
- static InferiorProcess *create(Module *M,
- const std::vector<std::string> &Arguments,
- const char * const *envp);
-
- // InferiorProcess destructor - Kill the current process. If something
- // terrible happens, we throw an exception from the destructor.
- virtual ~InferiorProcess() {}
-
- //===------------------------------------------------------------------===//
- // Status methods - These methods return information about the currently
- // stopped process.
- //
-
- /// getStatus - Return a status message that is specific to the current type
- /// of inferior process that is created. This can return things like the
- /// PID of the inferior or other potentially interesting things.
- virtual std::string getStatus() const {
- return "";
- }
-
- //===------------------------------------------------------------------===//
- // Methods for inspecting the call stack.
- //
-
- /// getPreviousFrame - Given the descriptor for the current stack frame,
- /// return the descriptor for the caller frame. This returns null when it
- /// runs out of frames. If Frame is null, the initial frame should be
- /// returned.
- virtual void *getPreviousFrame(void *Frame) const = 0;
-
- /// getSubprogramDesc - Return the subprogram descriptor for the current
- /// stack frame.
- virtual const GlobalVariable *getSubprogramDesc(void *Frame) const = 0;
-
- /// getFrameLocation - This method returns the source location where each
- /// stack frame is stopped.
- virtual void getFrameLocation(void *Frame, unsigned &LineNo,
- unsigned &ColNo,
- const GlobalVariable *&SourceDesc) const = 0;
-
- //===------------------------------------------------------------------===//
- // Methods for manipulating breakpoints.
- //
-
- /// addBreakpoint - This method adds a breakpoint at the specified line,
- /// column, and source file, and returns a unique identifier for it.
- ///
- /// It is up to the debugger to determine whether or not there is actually a
- /// stop-point that corresponds with the specified location.
- virtual unsigned addBreakpoint(unsigned LineNo, unsigned ColNo,
- const GlobalVariable *SourceDesc) = 0;
-
- /// removeBreakpoint - This deletes the breakpoint with the specified ID
- /// number.
- virtual void removeBreakpoint(unsigned ID) = 0;
-
-
- //===------------------------------------------------------------------===//
- // Execution methods - These methods cause the program to continue execution
- // by some amount. If the program successfully stops, this returns.
- // Otherwise, if the program unexpectedly terminates, an InferiorProcessDead
- // exception is thrown.
- //
-
- /// stepProgram - Implement the 'step' command, continuing execution until
- /// the next possible stop point.
- virtual void stepProgram() = 0;
-
- /// finishProgram - Implement the 'finish' command, continuing execution
- /// until the current function returns.
- virtual void finishProgram(void *Frame) = 0;
-
- /// contProgram - Implement the 'cont' command, continuing execution until
- /// a breakpoint is encountered.
- virtual void contProgram() = 0;
- };
-} // end namespace llvm
-
-#endif
-
diff --git a/release_23/include/llvm/Debugger/ProgramInfo.h b/release_23/include/llvm/Debugger/ProgramInfo.h
deleted file mode 100644
index 5c07c866c843..000000000000
--- a/release_23/include/llvm/Debugger/ProgramInfo.h
+++ /dev/null
@@ -1,246 +0,0 @@
-//===- ProgramInfo.h - Information about the loaded program -----*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines various pieces of information about the currently loaded
-// program. One instance of this object is created every time a program is
-// loaded, and destroyed every time it is unloaded.
-//
-// The various pieces of information gathered about the source program are all
-// designed to be extended by various SourceLanguage implementations. This
-// allows source languages to keep any extended information that they support in
-// the derived class portions of the class.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_DEBUGGER_PROGRAMINFO_H
-#define LLVM_DEBUGGER_PROGRAMINFO_H
-
-#include "llvm/System/TimeValue.h"
-#include <string>
-#include <map>
-#include <vector>
-
-namespace llvm {
- class GlobalVariable;
- class Module;
- class SourceFile;
- class SourceLanguage;
- class ProgramInfo;
-
- /// SourceLanguageCache - SourceLanguage implementations are allowed to cache
- /// stuff in the ProgramInfo object. The only requirement we have on these
- /// instances is that they are destroyable.
- struct SourceLanguageCache {
- virtual ~SourceLanguageCache() {}
- };
-
- /// SourceFileInfo - One instance of this structure is created for each
- /// source file in the program.
- ///
- class SourceFileInfo {
- /// BaseName - The filename of the source file.
- std::string BaseName;
-
- /// Directory - The working directory of this source file when it was
- /// compiled.
- std::string Directory;
-
- /// Version - The version of the LLVM debug information that this file was
- /// compiled with.
- unsigned Version;
-
- /// Language - The source language that the file was compiled with. This
- /// pointer is never null.
- ///
- const SourceLanguage *Language;
-
- /// Descriptor - The LLVM Global Variable which describes the source file.
- ///
- const GlobalVariable *Descriptor;
-
- /// SourceText - The body of this source file, or null if it has not yet
- /// been loaded.
- mutable SourceFile *SourceText;
- public:
- SourceFileInfo(const GlobalVariable *Desc, const SourceLanguage &Lang);
- ~SourceFileInfo();
-
- const std::string &getBaseName() const { return BaseName; }
- const std::string &getDirectory() const { return Directory; }
- unsigned getDebugVersion() const { return Version; }
- const GlobalVariable *getDescriptor() const { return Descriptor; }
- SourceFile &getSourceText() const;
-
- const SourceLanguage &getLanguage() const { return *Language; }
- };
-
-
- /// SourceFunctionInfo - An instance of this class is used to represent each
- /// source function in the program.
- ///
- class SourceFunctionInfo {
- /// Name - This contains an abstract name that is potentially useful to the
- /// end-user. If there is no explicit support for the current language,
- /// then this string is used to identify the function.
- std::string Name;
-
- /// Descriptor - The descriptor for this function.
- ///
- const GlobalVariable *Descriptor;
-
- /// SourceFile - The file that this function is defined in.
- ///
- const SourceFileInfo *SourceFile;
-
- /// LineNo, ColNo - The location of the first stop-point in the function.
- /// These are computed on demand.
- mutable unsigned LineNo, ColNo;
-
- public:
- SourceFunctionInfo(ProgramInfo &PI, const GlobalVariable *Desc);
- virtual ~SourceFunctionInfo() {}
-
- /// getSymbolicName - Return a human-readable symbolic name to identify the
- /// function (for example, in stack traces).
- virtual std::string getSymbolicName() const { return Name; }
-
- /// getDescriptor - This returns the descriptor for the function.
- ///
- const GlobalVariable *getDescriptor() const { return Descriptor; }
-
- /// getSourceFile - This returns the source file that defines the function.
- ///
- const SourceFileInfo &getSourceFile() const { return *SourceFile; }
-
- /// getSourceLocation - This method returns the location of the first
- /// stopping point in the function. If the body of the function cannot be
- /// found, this returns zeros for both values.
- void getSourceLocation(unsigned &LineNo, unsigned &ColNo) const;
- };
-
-
- /// ProgramInfo - This object contains information about the loaded program.
- /// When a new program is loaded, an instance of this class is created. When
- /// the program is unloaded, the instance is destroyed. This object basically
- /// manages the lazy computation of information useful for the debugger.
- class ProgramInfo {
- Module *M;
-
- /// ProgramTimeStamp - This is the timestamp of the executable file that we
- /// currently have loaded into the debugger.
- sys::TimeValue ProgramTimeStamp;
-
- /// SourceFiles - This map is used to transform source file descriptors into
- /// their corresponding SourceFileInfo objects. This mapping owns the
- /// memory for the SourceFileInfo objects.
- ///
- bool SourceFilesIsComplete;
- std::map<const GlobalVariable*, SourceFileInfo*> SourceFiles;
-
- /// SourceFileIndex - Mapping from source file basenames to the information
- /// about the file. Note that there can be filename collisions, so this is
- /// a multimap. This map is populated incrementally as the user interacts
- /// with the program, through the getSourceFileFromDesc method. If ALL of
- /// the source files are needed, the getSourceFiles() method scans the
- /// entire program looking for them.
- ///
- std::multimap<std::string, SourceFileInfo*> SourceFileIndex;
-
- /// SourceFunctions - This map contains entries functions in the source
- /// program. If SourceFunctionsIsComplete is true, then this is ALL of the
- /// functions in the program are in this map.
- bool SourceFunctionsIsComplete;
- std::map<const GlobalVariable*, SourceFunctionInfo*> SourceFunctions;
-
- /// LanguageCaches - Each source language is permitted to keep a per-program
- /// cache of information specific to whatever it needs. This vector is
- /// effectively a small map from the languages that are active in the
- /// program to their caches. This can be accessed by the language by the
- /// "getLanguageCache" method.
- std::vector<std::pair<const SourceLanguage*,
- SourceLanguageCache*> > LanguageCaches;
- public:
- ProgramInfo(Module *m);
- ~ProgramInfo();
-
- /// getProgramTimeStamp - Return the time-stamp of the program when it was
- /// loaded.
- sys::TimeValue getProgramTimeStamp() const { return ProgramTimeStamp; }
-
- //===------------------------------------------------------------------===//
- // Interfaces to the source code files that make up the program.
- //
-
- /// getSourceFile - Return source file information for the specified source
- /// file descriptor object, adding it to the collection as needed. This
- /// method always succeeds (is unambiguous), and is always efficient.
- ///
- const SourceFileInfo &getSourceFile(const GlobalVariable *Desc);
-
- /// getSourceFile - Look up the file with the specified name. If there is
- /// more than one match for the specified filename, prompt the user to pick
- /// one. If there is no source file that matches the specified name, throw
- /// an exception indicating that we can't find the file. Otherwise, return
- /// the file information for that file.
- ///
- /// If the source file hasn't been discovered yet in the program, this
- /// method might have to index the whole program by calling the
- /// getSourceFiles() method.
- ///
- const SourceFileInfo &getSourceFile(const std::string &Filename);
-
- /// getSourceFiles - Index all of the source files in the program and return
- /// them. This information is lazily computed the first time that it is
- /// requested. Since this information can take a long time to compute, the
- /// user is given a chance to cancel it. If this occurs, an exception is
- /// thrown.
- const std::map<const GlobalVariable*, SourceFileInfo*> &
- getSourceFiles(bool RequiresCompleteMap = true);
-
- //===------------------------------------------------------------------===//
- // Interfaces to the functions that make up the program.
- //
-
- /// getFunction - Return source function information for the specified
- /// function descriptor object, adding it to the collection as needed. This
- /// method always succeeds (is unambiguous), and is always efficient.
- ///
- const SourceFunctionInfo &getFunction(const GlobalVariable *Desc);
-
- /// getSourceFunctions - Index all of the functions in the program and
- /// return them. This information is lazily computed the first time that it
- /// is requested. Since this information can take a long time to compute,
- /// the user is given a chance to cancel it. If this occurs, an exception
- /// is thrown.
- const std::map<const GlobalVariable*, SourceFunctionInfo*> &
- getSourceFunctions(bool RequiresCompleteMap = true);
-
- /// addSourceFunctionsRead - Return true if the source functions map is
- /// complete: that is, all functions in the program have been read in.
- bool allSourceFunctionsRead() const { return SourceFunctionsIsComplete; }
-
- /// getLanguageCache - This method is used to build per-program caches of
- /// information, such as the functions or types visible to the program.
- /// This can be used by SourceLanguage implementations because it requires
- /// an accessible [sl]::CacheType typedef, where [sl] is the C++ type of the
- /// source-language subclass.
- template<typename SL>
- typename SL::CacheType &getLanguageCache(const SL *L) {
- for (unsigned i = 0, e = LanguageCaches.size(); i != e; ++i)
- if (LanguageCaches[i].first == L)
- return *(typename SL::CacheType*)LanguageCaches[i].second;
- typename SL::CacheType *NewCache = L->createSourceLanguageCache(*this);
- LanguageCaches.push_back(std::make_pair(L, NewCache));
- return *NewCache;
- }
- };
-
-} // end namespace llvm
-
-#endif
diff --git a/release_23/include/llvm/Debugger/RuntimeInfo.h b/release_23/include/llvm/Debugger/RuntimeInfo.h
deleted file mode 100644
index c53765123518..000000000000
--- a/release_23/include/llvm/Debugger/RuntimeInfo.h
+++ /dev/null
@@ -1,142 +0,0 @@
-//===- RuntimeInfo.h - Information about running program --------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines classes that capture various pieces of information about
-// the currently executing, but stopped, program. One instance of this object
-// is created every time a program is stopped, and destroyed every time it
-// starts running again. This object's main goal is to make access to runtime
-// information easy and efficient, by caching information as requested.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_DEBUGGER_RUNTIMEINFO_H
-#define LLVM_DEBUGGER_RUNTIMEINFO_H
-
-#include <vector>
-#include <cassert>
-
-namespace llvm {
- class ProgramInfo;
- class RuntimeInfo;
- class InferiorProcess;
- class GlobalVariable;
- class SourceFileInfo;
-
- /// StackFrame - One instance of this structure is created for each stack
- /// frame that is active in the program.
- ///
- class StackFrame {
- RuntimeInfo &RI;
- void *FrameID;
- const GlobalVariable *FunctionDesc;
-
- /// LineNo, ColNo, FileInfo - This information indicates WHERE in the source
- /// code for the program the stack frame is located.
- unsigned LineNo, ColNo;
- const SourceFileInfo *SourceInfo;
- public:
- StackFrame(RuntimeInfo &RI, void *ParentFrameID);
-
- StackFrame &operator=(const StackFrame &RHS) {
- FrameID = RHS.FrameID;
- FunctionDesc = RHS.FunctionDesc;
- return *this;
- }
-
- /// getFrameID - return the low-level opaque frame ID of this stack frame.
- ///
- void *getFrameID() const { return FrameID; }
-
- /// getFunctionDesc - Return the descriptor for the function that contains
- /// this stack frame, or null if it is unknown.
- ///
- const GlobalVariable *getFunctionDesc();
-
- /// getSourceLocation - Return the source location that this stack frame is
- /// sitting at.
- void getSourceLocation(unsigned &LineNo, unsigned &ColNo,
- const SourceFileInfo *&SourceInfo);
- };
-
-
- /// RuntimeInfo - This class collects information about the currently running
- /// process. It is created whenever the program stops execution for the
- /// debugger, and destroyed whenver execution continues.
- class RuntimeInfo {
- /// ProgInfo - This object contains static information about the program.
- ///
- ProgramInfo *ProgInfo;
-
- /// IP - This object contains information about the actual inferior process
- /// that we are communicating with and aggregating information from.
- const InferiorProcess &IP;
-
- /// CallStack - This caches information about the current stack trace of the
- /// program. This is lazily computed as needed.
- std::vector<StackFrame> CallStack;
-
- /// CurrentFrame - The user can traverse the stack frame with the
- /// up/down/frame family of commands. This index indicates the current
- /// stack frame.
- unsigned CurrentFrame;
-
- public:
- RuntimeInfo(ProgramInfo *PI, const InferiorProcess &ip)
- : ProgInfo(PI), IP(ip), CurrentFrame(0) {
- // Make sure that the top of stack has been materialized. If this throws
- // an exception, something is seriously wrong and the RuntimeInfo object
- // would be unusable anyway.
- getStackFrame(0);
- }
-
- ProgramInfo &getProgramInfo() { return *ProgInfo; }
- const InferiorProcess &getInferiorProcess() const { return IP; }
-
- //===------------------------------------------------------------------===//
- // Methods for inspecting the call stack of the program.
- //
-
- /// getStackFrame - Materialize the specified stack frame and return it. If
- /// the specified ID is off of the bottom of the stack, throw an exception
- /// indicating the problem.
- StackFrame &getStackFrame(unsigned ID) {
- if (ID >= CallStack.size())
- materializeFrame(ID);
- return CallStack[ID];
- }
-
- /// getCurrentFrame - Return the current stack frame object that the user is
- /// inspecting.
- StackFrame &getCurrentFrame() {
- assert(CallStack.size() > CurrentFrame &&
- "Must have materialized frame before making it current!");
- return CallStack[CurrentFrame];
- }
-
- /// getCurrentFrameIdx - Return the current frame the user is inspecting.
- ///
- unsigned getCurrentFrameIdx() const { return CurrentFrame; }
-
- /// setCurrentFrameIdx - Set the current frame index to the specified value.
- /// Note that the specified frame must have been materialized with
- /// getStackFrame before it can be made current.
- void setCurrentFrameIdx(unsigned Idx) {
- assert(Idx < CallStack.size() &&
- "Must materialize frame before making it current!");
- CurrentFrame = Idx;
- }
- private:
- /// materializeFrame - Create and process all frames up to and including the
- /// specified frame number. This throws an exception if the specified frame
- /// ID is nonexistant.
- void materializeFrame(unsigned ID);
- };
-}
-
-#endif
diff --git a/release_23/include/llvm/Debugger/SourceFile.h b/release_23/include/llvm/Debugger/SourceFile.h
deleted file mode 100644
index 249435af8b17..000000000000
--- a/release_23/include/llvm/Debugger/SourceFile.h
+++ /dev/null
@@ -1,87 +0,0 @@
-//===- SourceFile.h - Class to represent a source code file -----*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines the SourceFile class which is used to represent a single
-// file of source code in the program, caching data from the file to make access
-// efficient.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_DEBUGGER_SOURCEFILE_H
-#define LLVM_DEBUGGER_SOURCEFILE_H
-
-#include "llvm/System/Path.h"
-#include "llvm/ADT/OwningPtr.h"
-#include <vector>
-
-namespace llvm {
- class GlobalVariable;
- class MemoryBuffer;
-
- class SourceFile {
- /// Filename - This is the full path of the file that is loaded.
- ///
- sys::Path Filename;
-
- /// Descriptor - The debugging descriptor for this source file. If there
- /// are multiple descriptors for the same file, this is just the first one
- /// encountered.
- ///
- const GlobalVariable *Descriptor;
-
- /// This is the memory mapping for the file so we can gain access to it.
- OwningPtr<MemoryBuffer> File;
-
- /// LineOffset - This vector contains a mapping from source line numbers to
- /// their offsets in the file. This data is computed lazily, the first time
- /// it is asked for. If there are zero elements allocated in this vector,
- /// then it has not yet been computed.
- mutable std::vector<unsigned> LineOffset;
-
- public:
- /// SourceFile constructor - Read in the specified source file if it exists,
- /// but do not build the LineOffsets table until it is requested. This will
- /// NOT throw an exception if the file is not found, if there is an error
- /// reading it, or if the user cancels the operation. Instead, it will just
- /// be an empty source file.
- SourceFile(const std::string &fn, const GlobalVariable *Desc);
-
- ~SourceFile();
-
- /// getDescriptor - Return the debugging decriptor for this source file.
- ///
- const GlobalVariable *getDescriptor() const { return Descriptor; }
-
- /// getFilename - Return the fully resolved path that this file was loaded
- /// from.
- const std::string &getFilename() const { return Filename.toString(); }
-
- /// getSourceLine - Given a line number, return the start and end of the
- /// line in the file. If the line number is invalid, or if the file could
- /// not be loaded, null pointers are returned for the start and end of the
- /// file. Note that line numbers start with 0, not 1. This also strips off
- /// any newlines from the end of the line, to ease formatting of the text.
- void getSourceLine(unsigned LineNo, const char *&LineStart,
- const char *&LineEnd) const;
-
- /// getNumLines - Return the number of lines the source file contains.
- ///
- unsigned getNumLines() const {
- if (LineOffset.empty()) calculateLineOffsets();
- return static_cast<unsigned>(LineOffset.size());
- }
-
- private:
- /// calculateLineOffsets - Compute the LineOffset vector for the current
- /// file.
- void calculateLineOffsets() const;
- };
-} // end namespace llvm
-
-#endif
diff --git a/release_23/include/llvm/Debugger/SourceLanguage.h b/release_23/include/llvm/Debugger/SourceLanguage.h
deleted file mode 100644
index a07dd97e4107..000000000000
--- a/release_23/include/llvm/Debugger/SourceLanguage.h
+++ /dev/null
@@ -1,99 +0,0 @@
-//===- SourceLanguage.h - Interact with source languages --------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines the abstract SourceLanguage interface, which is used by the
-// LLVM debugger to parse source-language expressions and render program objects
-// into a human readable string. In general, these classes perform all of the
-// analysis and interpretation of the language-specific debugger information.
-//
-// This interface is designed to be completely stateless, so all methods are
-// const.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_DEBUGGER_SOURCELANGUAGE_H
-#define LLVM_DEBUGGER_SOURCELANGUAGE_H
-
-#include <string>
-
-namespace llvm {
- class GlobalVariable;
- class SourceFileInfo;
- class SourceFunctionInfo;
- class ProgramInfo;
- class RuntimeInfo;
-
- struct SourceLanguage {
- virtual ~SourceLanguage() {}
-
- /// getSourceLanguageName - This method is used to implement the 'show
- /// language' command in the debugger.
- virtual const char *getSourceLanguageName() const = 0;
-
- //===------------------------------------------------------------------===//
- // Methods used to implement debugger hooks.
- //
-
- /// printInfo - Implementing this method allows the debugger to use
- /// language-specific 'info' extensions, e.g., 'info selectors' for objc.
- /// This method should return true if the specified string is recognized.
- ///
- virtual bool printInfo(const std::string &What) const {
- return false;
- }
-
- /// lookupFunction - Given a textual function name, return the
- /// SourceFunctionInfo descriptor for that function, or null if it cannot be
- /// found. If the program is currently running, the RuntimeInfo object
- /// provides information about the current evaluation context, otherwise it
- /// will be null.
- ///
- virtual SourceFunctionInfo *lookupFunction(const std::string &FunctionName,
- ProgramInfo &PI,
- RuntimeInfo *RI = 0) const {
- return 0;
- }
-
-
- //===------------------------------------------------------------------===//
- // Methods used to parse various pieces of program information.
- //
-
- /// createSourceFileInfo - This method can be implemented by the front-end
- /// if it needs to keep track of information beyond what the debugger
- /// requires.
- virtual SourceFileInfo *
- createSourceFileInfo(const GlobalVariable *Desc, ProgramInfo &PI) const;
-
- /// createSourceFunctionInfo - This method can be implemented by the derived
- /// SourceLanguage if it needs to keep track of more information than the
- /// SourceFunctionInfo has.
- virtual SourceFunctionInfo *
- createSourceFunctionInfo(const GlobalVariable *Desc, ProgramInfo &PI) const;
-
-
- //===------------------------------------------------------------------===//
- // Static methods used to get instances of various source languages.
- //
-
- /// get - This method returns a source-language instance for the specified
- /// Dwarf 3 language identifier. If the language is unknown, an object is
- /// returned that can support some minimal operations, but is not terribly
- /// bright.
- static const SourceLanguage &get(unsigned ID);
-
- /// get*Instance() - These methods return specific instances of languages.
- ///
- static const SourceLanguage &getCFamilyInstance();
- static const SourceLanguage &getCPlusPlusInstance();
- static const SourceLanguage &getUnknownLanguageInstance();
- };
-}
-
-#endif
diff --git a/release_23/include/llvm/DerivedTypes.h b/release_23/include/llvm/DerivedTypes.h
deleted file mode 100644
index 533414049fd2..000000000000
--- a/release_23/include/llvm/DerivedTypes.h
+++ /dev/null
@@ -1,429 +0,0 @@
-//===-- llvm/DerivedTypes.h - Classes for handling data types ---*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains the declarations of classes that represent "derived
-// types". These are things like "arrays of x" or "structure of x, y, z" or
-// "method returning x taking (y,z) as parameters", etc...
-//
-// The implementations of these classes live in the Type.cpp file.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_DERIVED_TYPES_H
-#define LLVM_DERIVED_TYPES_H
-
-#include "llvm/Type.h"
-
-namespace llvm {
-
-class Value;
-template<class ValType, class TypeClass> class TypeMap;
-class FunctionValType;
-class ArrayValType;
-class StructValType;
-class PointerValType;
-class VectorValType;
-class IntegerValType;
-class APInt;
-
-class DerivedType : public Type {
- friend class Type;
-
-protected:
- explicit DerivedType(TypeID id) : Type(id) {}
-
- /// notifyUsesThatTypeBecameConcrete - Notify AbstractTypeUsers of this type
- /// that the current type has transitioned from being abstract to being
- /// concrete.
- ///
- void notifyUsesThatTypeBecameConcrete();
-
- /// dropAllTypeUses - When this (abstract) type is resolved to be equal to
- /// another (more concrete) type, we must eliminate all references to other
- /// types, to avoid some circular reference problems.
- ///
- void dropAllTypeUses();
-
-public:
-
- //===--------------------------------------------------------------------===//
- // Abstract Type handling methods - These types have special lifetimes, which
- // are managed by (add|remove)AbstractTypeUser. See comments in
- // AbstractTypeUser.h for more information.
-
- /// refineAbstractTypeTo - This function is used to when it is discovered that
- /// the 'this' abstract type is actually equivalent to the NewType specified.
- /// This causes all users of 'this' to switch to reference the more concrete
- /// type NewType and for 'this' to be deleted.
- ///
- void refineAbstractTypeTo(const Type *NewType);
-
- void dump() const { Type::dump(); }
-
- // Methods for support type inquiry through isa, cast, and dyn_cast:
- static inline bool classof(const DerivedType *T) { return true; }
- static inline bool classof(const Type *T) {
- return T->isDerivedType();
- }
-};
-
-/// Class to represent integer types. Note that this class is also used to
-/// represent the built-in integer types: Int1Ty, Int8Ty, Int16Ty, Int32Ty and
-/// Int64Ty.
-/// @brief Integer representation type
-class IntegerType : public DerivedType {
-protected:
- explicit IntegerType(unsigned NumBits) : DerivedType(IntegerTyID) {
- setSubclassData(NumBits);
- }
- friend class TypeMap<IntegerValType, IntegerType>;
-public:
- /// This enum is just used to hold constants we need for IntegerType.
- enum {
- MIN_INT_BITS = 1, ///< Minimum number of bits that can be specified
- MAX_INT_BITS = (1<<23)-1 ///< Maximum number of bits that can be specified
- ///< Note that bit width is stored in the Type classes SubclassData field
- ///< which has 23 bits. This yields a maximum bit width of 8,388,607 bits.
- };
-
- /// This static method is the primary way of constructing an IntegerType.
- /// If an IntegerType with the same NumBits value was previously instantiated,
- /// that instance will be returned. Otherwise a new one will be created. Only
- /// one instance with a given NumBits value is ever created.
- /// @brief Get or create an IntegerType instance.
- static const IntegerType* get(unsigned NumBits);
-
- /// @brief Get the number of bits in this IntegerType
- unsigned getBitWidth() const { return getSubclassData(); }
-
- /// getBitMask - Return a bitmask with ones set for all of the bits
- /// that can be set by an unsigned version of this type. This is 0xFF for
- /// i8, 0xFFFF for i16, etc.
- uint64_t getBitMask() const {
- return ~uint64_t(0UL) >> (64-getBitWidth());
- }
-
- /// getSignBit - Return a uint64_t with just the most significant bit set (the
- /// sign bit, if the value is treated as a signed number).
- uint64_t getSignBit() const {
- return 1ULL << (getBitWidth()-1);
- }
-
- /// For example, this is 0xFF for an 8 bit integer, 0xFFFF for i16, etc.
- /// @returns a bit mask with ones set for all the bits of this type.
- /// @brief Get a bit mask for this type.
- APInt getMask() const;
-
- /// This method determines if the width of this IntegerType is a power-of-2
- /// in terms of 8 bit bytes.
- /// @returns true if this is a power-of-2 byte width.
- /// @brief Is this a power-of-2 byte-width IntegerType ?
- bool isPowerOf2ByteWidth() const;
-
- // Methods for support type inquiry through isa, cast, and dyn_cast:
- static inline bool classof(const IntegerType *T) { return true; }
- static inline bool classof(const Type *T) {
- return T->getTypeID() == IntegerTyID;
- }
-};
-
-
-/// FunctionType - Class to represent function types
-///
-class FunctionType : public DerivedType {
- friend class TypeMap<FunctionValType, FunctionType>;
- bool isVarArgs;
-
- FunctionType(const FunctionType &); // Do not implement
- const FunctionType &operator=(const FunctionType &); // Do not implement
- FunctionType(const Type *Result, const std::vector<const Type*> &Params,
- bool IsVarArgs);
-
-public:
- /// FunctionType::get - This static method is the primary way of constructing
- /// a FunctionType.
- ///
- static FunctionType *get(
- const Type *Result, ///< The result type
- const std::vector<const Type*> &Params, ///< The types of the parameters
- bool isVarArg ///< Whether this is a variable argument length function
- );
-
- /// isValidReturnType - Return true if the specified type is valid as a return
- /// type.
- static bool isValidReturnType(const Type *RetTy);
-
- inline bool isVarArg() const { return isVarArgs; }
- inline const Type *getReturnType() const { return ContainedTys[0]; }
-
- typedef Type::subtype_iterator param_iterator;
- param_iterator param_begin() const { return ContainedTys + 1; }
- param_iterator param_end() const { return &ContainedTys[NumContainedTys]; }
-
- // Parameter type accessors...
- const Type *getParamType(unsigned i) const { return ContainedTys[i+1]; }
-
- /// getNumParams - Return the number of fixed parameters this function type
- /// requires. This does not consider varargs.
- ///
- unsigned getNumParams() const { return NumContainedTys - 1; }
-
- // Implement the AbstractTypeUser interface.
- virtual void refineAbstractType(const DerivedType *OldTy, const Type *NewTy);
- virtual void typeBecameConcrete(const DerivedType *AbsTy);
-
- // Methods for support type inquiry through isa, cast, and dyn_cast:
- static inline bool classof(const FunctionType *T) { return true; }
- static inline bool classof(const Type *T) {
- return T->getTypeID() == FunctionTyID;
- }
-};
-
-
-/// CompositeType - Common super class of ArrayType, StructType, PointerType
-/// and VectorType
-class CompositeType : public DerivedType {
-protected:
- inline explicit CompositeType(TypeID id) : DerivedType(id) { }
-public:
-
- /// getTypeAtIndex - Given an index value into the type, return the type of
- /// the element.
- ///
- virtual const Type *getTypeAtIndex(const Value *V) const = 0;
- virtual bool indexValid(const Value *V) const = 0;
-
- // Methods for support type inquiry through isa, cast, and dyn_cast:
- static inline bool classof(const CompositeType *T) { return true; }
- static inline bool classof(const Type *T) {
- return T->getTypeID() == ArrayTyID ||
- T->getTypeID() == StructTyID ||
- T->getTypeID() == PointerTyID ||
- T->getTypeID() == VectorTyID;
- }
-};
-
-
-/// StructType - Class to represent struct types
-///
-class StructType : public CompositeType {
- friend class TypeMap<StructValType, StructType>;
- StructType(const StructType &); // Do not implement
- const StructType &operator=(const StructType &); // Do not implement
- StructType(const std::vector<const Type*> &Types, bool isPacked);
-public:
- /// StructType::get - This static method is the primary way to create a
- /// StructType.
- ///
- static StructType *get(const std::vector<const Type*> &Params,
- bool isPacked=false);
-
- /// StructType::get - This static method is a convenience method for
- /// creating structure types by specifying the elements as arguments.
- /// Note that this method always returns a non-packed struct. To get
- /// an empty struct, pass NULL, NULL.
- static StructType *get(const Type *type, ...) END_WITH_NULL;
-
- // Iterator access to the elements
- typedef Type::subtype_iterator element_iterator;
- element_iterator element_begin() const { return ContainedTys; }
- element_iterator element_end() const { return &ContainedTys[NumContainedTys];}
-
- // Random access to the elements
- unsigned getNumElements() const { return NumContainedTys; }
- const Type *getElementType(unsigned N) const {
- assert(N < NumContainedTys && "Element number out of range!");
- return ContainedTys[N];
- }
-
- /// getTypeAtIndex - Given an index value into the type, return the type of
- /// the element. For a structure type, this must be a constant value...
- ///
- virtual const Type *getTypeAtIndex(const Value *V) const ;
- virtual bool indexValid(const Value *V) const;
-
- // Implement the AbstractTypeUser interface.
- virtual void refineAbstractType(const DerivedType *OldTy, const Type *NewTy);
- virtual void typeBecameConcrete(const DerivedType *AbsTy);
-
- // Methods for support type inquiry through isa, cast, and dyn_cast:
- static inline bool classof(const StructType *T) { return true; }
- static inline bool classof(const Type *T) {
- return T->getTypeID() == StructTyID;
- }
-
- bool isPacked() const { return (0 != getSubclassData()) ? true : false; }
-};
-
-
-/// SequentialType - This is the superclass of the array, pointer and vector
-/// type classes. All of these represent "arrays" in memory. The array type
-/// represents a specifically sized array, pointer types are unsized/unknown
-/// size arrays, vector types represent specifically sized arrays that
-/// allow for use of SIMD instructions. SequentialType holds the common
-/// features of all, which stem from the fact that all three lay their
-/// components out in memory identically.
-///
-class SequentialType : public CompositeType {
- PATypeHandle ContainedType; ///< Storage for the single contained type
- SequentialType(const SequentialType &); // Do not implement!
- const SequentialType &operator=(const SequentialType &); // Do not implement!
-
- // avoiding warning: 'this' : used in base member initializer list
- SequentialType* this_() { return this; }
-protected:
- SequentialType(TypeID TID, const Type *ElType)
- : CompositeType(TID), ContainedType(ElType, this_()) {
- ContainedTys = &ContainedType;
- NumContainedTys = 1;
- }
-
-public:
- inline const Type *getElementType() const { return ContainedTys[0]; }
-
- virtual bool indexValid(const Value *V) const;
-
- /// getTypeAtIndex - Given an index value into the type, return the type of
- /// the element. For sequential types, there is only one subtype...
- ///
- virtual const Type *getTypeAtIndex(const Value *V) const {
- return ContainedTys[0];
- }
-
- // Methods for support type inquiry through isa, cast, and dyn_cast:
- static inline bool classof(const SequentialType *T) { return true; }
- static inline bool classof(const Type *T) {
- return T->getTypeID() == ArrayTyID ||
- T->getTypeID() == PointerTyID ||
- T->getTypeID() == VectorTyID;
- }
-};
-
-
-/// ArrayType - Class to represent array types
-///
-class ArrayType : public SequentialType {
- friend class TypeMap<ArrayValType, ArrayType>;
- uint64_t NumElements;
-
- ArrayType(const ArrayType &); // Do not implement
- const ArrayType &operator=(const ArrayType &); // Do not implement
- ArrayType(const Type *ElType, uint64_t NumEl);
-public:
- /// ArrayType::get - This static method is the primary way to construct an
- /// ArrayType
- ///
- static ArrayType *get(const Type *ElementType, uint64_t NumElements);
-
- inline uint64_t getNumElements() const { return NumElements; }
-
- // Implement the AbstractTypeUser interface.
- virtual void refineAbstractType(const DerivedType *OldTy, const Type *NewTy);
- virtual void typeBecameConcrete(const DerivedType *AbsTy);
-
- // Methods for support type inquiry through isa, cast, and dyn_cast:
- static inline bool classof(const ArrayType *T) { return true; }
- static inline bool classof(const Type *T) {
- return T->getTypeID() == ArrayTyID;
- }
-};
-
-/// VectorType - Class to represent vector types
-///
-class VectorType : public SequentialType {
- friend class TypeMap<VectorValType, VectorType>;
- unsigned NumElements;
-
- VectorType(const VectorType &); // Do not implement
- const VectorType &operator=(const VectorType &); // Do not implement
- VectorType(const Type *ElType, unsigned NumEl);
-public:
- /// VectorType::get - This static method is the primary way to construct an
- /// VectorType
- ///
- static VectorType *get(const Type *ElementType, unsigned NumElements);
-
- /// @brief Return the number of elements in the Vector type.
- inline unsigned getNumElements() const { return NumElements; }
-
- /// @brief Return the number of bits in the Vector type.
- inline unsigned getBitWidth() const {
- return NumElements *getElementType()->getPrimitiveSizeInBits();
- }
-
- // Implement the AbstractTypeUser interface.
- virtual void refineAbstractType(const DerivedType *OldTy, const Type *NewTy);
- virtual void typeBecameConcrete(const DerivedType *AbsTy);
-
- // Methods for support type inquiry through isa, cast, and dyn_cast:
- static inline bool classof(const VectorType *T) { return true; }
- static inline bool classof(const Type *T) {
- return T->getTypeID() == VectorTyID;
- }
-};
-
-
-/// PointerType - Class to represent pointers
-///
-class PointerType : public SequentialType {
- friend class TypeMap<PointerValType, PointerType>;
- unsigned AddressSpace;
-
- PointerType(const PointerType &); // Do not implement
- const PointerType &operator=(const PointerType &); // Do not implement
- explicit PointerType(const Type *ElType, unsigned AddrSpace);
-public:
- /// PointerType::get - This constructs a pointer to an object of the specified
- /// type in a numbered address space.
- static PointerType *get(const Type *ElementType, unsigned AddressSpace);
-
- /// PointerType::getUnqual - This constructs a pointer to an object of the
- /// specified type in the generic address space (address space zero).
- static PointerType *getUnqual(const Type *ElementType) {
- return PointerType::get(ElementType, 0);
- }
-
- /// @brief Return the address space of the Pointer type.
- inline unsigned getAddressSpace() const { return AddressSpace; }
-
- // Implement the AbstractTypeUser interface.
- virtual void refineAbstractType(const DerivedType *OldTy, const Type *NewTy);
- virtual void typeBecameConcrete(const DerivedType *AbsTy);
-
- // Implement support type inquiry through isa, cast, and dyn_cast:
- static inline bool classof(const PointerType *T) { return true; }
- static inline bool classof(const Type *T) {
- return T->getTypeID() == PointerTyID;
- }
-};
-
-
-/// OpaqueType - Class to represent abstract types
-///
-class OpaqueType : public DerivedType {
- OpaqueType(const OpaqueType &); // DO NOT IMPLEMENT
- const OpaqueType &operator=(const OpaqueType &); // DO NOT IMPLEMENT
- OpaqueType();
-public:
- /// OpaqueType::get - Static factory method for the OpaqueType class...
- ///
- static OpaqueType *get() {
- return new OpaqueType(); // All opaque types are distinct
- }
-
- // Implement support for type inquiry through isa, cast, and dyn_cast:
- static inline bool classof(const OpaqueType *T) { return true; }
- static inline bool classof(const Type *T) {
- return T->getTypeID() == OpaqueTyID;
- }
-};
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/ExecutionEngine/ExecutionEngine.h b/release_23/include/llvm/ExecutionEngine/ExecutionEngine.h
deleted file mode 100644
index 1a6cdba7ea29..000000000000
--- a/release_23/include/llvm/ExecutionEngine/ExecutionEngine.h
+++ /dev/null
@@ -1,287 +0,0 @@
-//===- ExecutionEngine.h - Abstract Execution Engine Interface --*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines the abstract interface that implements execution support
-// for LLVM.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_EXECUTION_ENGINE_H
-#define LLVM_EXECUTION_ENGINE_H
-
-#include <vector>
-#include <map>
-#include <cassert>
-#include <string>
-#include "llvm/System/Mutex.h"
-#include "llvm/ADT/SmallVector.h"
-
-namespace llvm {
-
-struct GenericValue;
-class Constant;
-class Function;
-class GlobalVariable;
-class GlobalValue;
-class Module;
-class ModuleProvider;
-class TargetData;
-class Type;
-class MutexGuard;
-class JITMemoryManager;
-
-class ExecutionEngineState {
-private:
- /// GlobalAddressMap - A mapping between LLVM global values and their
- /// actualized version...
- std::map<const GlobalValue*, void *> GlobalAddressMap;
-
- /// GlobalAddressReverseMap - This is the reverse mapping of GlobalAddressMap,
- /// used to convert raw addresses into the LLVM global value that is emitted
- /// at the address. This map is not computed unless getGlobalValueAtAddress
- /// is called at some point.
- std::map<void *, const GlobalValue*> GlobalAddressReverseMap;
-
-public:
- std::map<const GlobalValue*, void *> &
- getGlobalAddressMap(const MutexGuard &locked) {
- return GlobalAddressMap;
- }
-
- std::map<void*, const GlobalValue*> &
- getGlobalAddressReverseMap(const MutexGuard& locked) {
- return GlobalAddressReverseMap;
- }
-};
-
-
-class ExecutionEngine {
- const TargetData *TD;
- ExecutionEngineState state;
- bool LazyCompilationDisabled;
-
-protected:
- /// Modules - This is a list of ModuleProvider's that we are JIT'ing from. We
- /// use a smallvector to optimize for the case where there is only one module.
- SmallVector<ModuleProvider*, 1> Modules;
-
- void setTargetData(const TargetData *td) {
- TD = td;
- }
-
- // To avoid having libexecutionengine depend on the JIT and interpreter
- // libraries, the JIT and Interpreter set these functions to ctor pointers
- // at startup time if they are linked in.
- typedef ExecutionEngine *(*EECtorFn)(ModuleProvider*, std::string*);
- static EECtorFn JITCtor, InterpCtor;
-
- /// LazyFunctionCreator - If an unknown function is needed, this function
- /// pointer is invoked to create it. If this returns null, the JIT will abort.
- void* (*LazyFunctionCreator)(const std::string &);
-
- /// ExceptionTableRegister - If Exception Handling is set, the JIT will
- /// register dwarf tables with this function
- typedef void (*EERegisterFn)(void*);
- static EERegisterFn ExceptionTableRegister;
-
-public:
- /// lock - This lock is protects the ExecutionEngine, JIT, JITResolver and
- /// JITEmitter classes. It must be held while changing the internal state of
- /// any of those classes.
- sys::Mutex lock; // Used to make this class and subclasses thread-safe
-
- //===--------------------------------------------------------------------===//
- // ExecutionEngine Startup
- //===--------------------------------------------------------------------===//
-
- virtual ~ExecutionEngine();
-
- /// create - This is the factory method for creating an execution engine which
- /// is appropriate for the current machine. This takes ownership of the
- /// module provider.
- static ExecutionEngine *create(ModuleProvider *MP,
- bool ForceInterpreter = false,
- std::string *ErrorStr = 0);
-
- /// create - This is the factory method for creating an execution engine which
- /// is appropriate for the current machine. This takes ownership of the
- /// module.
- static ExecutionEngine *create(Module *M);
-
- /// createJIT - This is the factory method for creating a JIT for the current
- /// machine, it does not fall back to the interpreter. This takes ownership
- /// of the ModuleProvider and JITMemoryManager if successful.
- static ExecutionEngine *createJIT(ModuleProvider *MP,
- std::string *ErrorStr = 0,
- JITMemoryManager *JMM = 0);
-
-
-
- /// addModuleProvider - Add a ModuleProvider to the list of modules that we
- /// can JIT from. Note that this takes ownership of the ModuleProvider: when
- /// the ExecutionEngine is destroyed, it destroys the MP as well.
- void addModuleProvider(ModuleProvider *P) {
- Modules.push_back(P);
- }
-
- //===----------------------------------------------------------------------===//
-
- const TargetData *getTargetData() const { return TD; }
-
-
- /// removeModuleProvider - Remove a ModuleProvider from the list of modules.
- /// Release module from ModuleProvider.
- Module* removeModuleProvider(ModuleProvider *P, std::string *ErrInfo = 0);
-
- /// FindFunctionNamed - Search all of the active modules to find the one that
- /// defines FnName. This is very slow operation and shouldn't be used for
- /// general code.
- Function *FindFunctionNamed(const char *FnName);
-
- /// runFunction - Execute the specified function with the specified arguments,
- /// and return the result.
- ///
- virtual GenericValue runFunction(Function *F,
- const std::vector<GenericValue> &ArgValues) = 0;
-
- /// runStaticConstructorsDestructors - This method is used to execute all of
- /// the static constructors or destructors for a module, depending on the
- /// value of isDtors.
- void runStaticConstructorsDestructors(bool isDtors);
-
-
- /// runFunctionAsMain - This is a helper function which wraps runFunction to
- /// handle the common task of starting up main with the specified argc, argv,
- /// and envp parameters.
- int runFunctionAsMain(Function *Fn, const std::vector<std::string> &argv,
- const char * const * envp);
-
-
- /// addGlobalMapping - Tell the execution engine that the specified global is
- /// at the specified location. This is used internally as functions are JIT'd
- /// and as global variables are laid out in memory. It can and should also be
- /// used by clients of the EE that want to have an LLVM global overlay
- /// existing data in memory.
- void addGlobalMapping(const GlobalValue *GV, void *Addr);
-
- /// clearAllGlobalMappings - Clear all global mappings and start over again
- /// use in dynamic compilation scenarios when you want to move globals
- void clearAllGlobalMappings();
-
- /// updateGlobalMapping - Replace an existing mapping for GV with a new
- /// address. This updates both maps as required. If "Addr" is null, the
- /// entry for the global is removed from the mappings. This returns the old
- /// value of the pointer, or null if it was not in the map.
- void *updateGlobalMapping(const GlobalValue *GV, void *Addr);
-
- /// getPointerToGlobalIfAvailable - This returns the address of the specified
- /// global value if it is has already been codegen'd, otherwise it returns
- /// null.
- ///
- void *getPointerToGlobalIfAvailable(const GlobalValue *GV);
-
- /// getPointerToGlobal - This returns the address of the specified global
- /// value. This may involve code generation if it's a function.
- ///
- void *getPointerToGlobal(const GlobalValue *GV);
-
- /// getPointerToFunction - The different EE's represent function bodies in
- /// different ways. They should each implement this to say what a function
- /// pointer should look like.
- ///
- virtual void *getPointerToFunction(Function *F) = 0;
-
- /// getPointerToFunctionOrStub - If the specified function has been
- /// code-gen'd, return a pointer to the function. If not, compile it, or use
- /// a stub to implement lazy compilation if available.
- ///
- virtual void *getPointerToFunctionOrStub(Function *F) {
- // Default implementation, just codegen the function.
- return getPointerToFunction(F);
- }
-
- /// getGlobalValueAtAddress - Return the LLVM global value object that starts
- /// at the specified address.
- ///
- const GlobalValue *getGlobalValueAtAddress(void *Addr);
-
-
- void StoreValueToMemory(const GenericValue &Val, GenericValue *Ptr,
- const Type *Ty);
- void InitializeMemory(const Constant *Init, void *Addr);
-
- /// recompileAndRelinkFunction - This method is used to force a function
- /// which has already been compiled to be compiled again, possibly
- /// after it has been modified. Then the entry to the old copy is overwritten
- /// with a branch to the new copy. If there was no old copy, this acts
- /// just like VM::getPointerToFunction().
- ///
- virtual void *recompileAndRelinkFunction(Function *F) = 0;
-
- /// freeMachineCodeForFunction - Release memory in the ExecutionEngine
- /// corresponding to the machine code emitted to execute this function, useful
- /// for garbage-collecting generated code.
- ///
- virtual void freeMachineCodeForFunction(Function *F) = 0;
-
- /// getOrEmitGlobalVariable - Return the address of the specified global
- /// variable, possibly emitting it to memory if needed. This is used by the
- /// Emitter.
- virtual void *getOrEmitGlobalVariable(const GlobalVariable *GV) {
- return getPointerToGlobal((GlobalValue*)GV);
- }
-
- /// DisableLazyCompilation - If called, the JIT will abort if lazy compilation
- // is ever attempted.
- void DisableLazyCompilation() {
- LazyCompilationDisabled = true;
- }
- bool isLazyCompilationDisabled() const {
- return LazyCompilationDisabled;
- }
-
-
- /// InstallLazyFunctionCreator - If an unknown function is needed, the
- /// specified function pointer is invoked to create it. If it returns null,
- /// the JIT will abort.
- void InstallLazyFunctionCreator(void* (*P)(const std::string &)) {
- LazyFunctionCreator = P;
- }
-
- /// InstallExceptionTableRegister - The JIT will use the given function
- /// to register the exception tables it generates.
- static void InstallExceptionTableRegister(void (*F)(void*)) {
- ExceptionTableRegister = F;
- }
-
- /// RegisterTable - Registers the given pointer as an exception table. It uses
- /// the ExceptionTableRegister function.
- static void RegisterTable(void* res) {
- if (ExceptionTableRegister)
- ExceptionTableRegister(res);
- }
-
-protected:
- explicit ExecutionEngine(ModuleProvider *P);
-
- void emitGlobals();
-
- // EmitGlobalVariable - This method emits the specified global variable to the
- // address specified in GlobalAddresses, or allocates new memory if it's not
- // already in the map.
- void EmitGlobalVariable(const GlobalVariable *GV);
-
- GenericValue getConstantValue(const Constant *C);
- void LoadValueFromMemory(GenericValue &Result, GenericValue *Ptr,
- const Type *Ty);
-};
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/ExecutionEngine/GenericValue.h b/release_23/include/llvm/ExecutionEngine/GenericValue.h
deleted file mode 100644
index a2fed98c150e..000000000000
--- a/release_23/include/llvm/ExecutionEngine/GenericValue.h
+++ /dev/null
@@ -1,44 +0,0 @@
-//===-- GenericValue.h - Represent any type of LLVM value -------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// The GenericValue class is used to represent an LLVM value of arbitrary type.
-//
-//===----------------------------------------------------------------------===//
-
-
-#ifndef GENERIC_VALUE_H
-#define GENERIC_VALUE_H
-
-#include "llvm/ADT/APInt.h"
-#include "llvm/Support/DataTypes.h"
-
-namespace llvm {
-
-typedef void* PointerTy;
-class APInt;
-
-struct GenericValue {
- union {
- double DoubleVal;
- float FloatVal;
- PointerTy PointerVal;
- struct { unsigned int first; unsigned int second; } UIntPairVal;
- unsigned char Untyped[8];
- };
- APInt IntVal; // also used for long doubles
-
- GenericValue() : DoubleVal(0.0), IntVal(1,0) {}
- explicit GenericValue(void *V) : PointerVal(V), IntVal(1,0) { }
-};
-
-inline GenericValue PTOGV(void *P) { return GenericValue(P); }
-inline void* GVTOP(const GenericValue &GV) { return GV.PointerVal; }
-
-} // End llvm namespace
-#endif
diff --git a/release_23/include/llvm/ExecutionEngine/Interpreter.h b/release_23/include/llvm/ExecutionEngine/Interpreter.h
deleted file mode 100644
index b2b04645dfe4..000000000000
--- a/release_23/include/llvm/ExecutionEngine/Interpreter.h
+++ /dev/null
@@ -1,40 +0,0 @@
-//===-- Interpreter.h - Abstract Execution Engine Interface -----*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file forces the interpreter to link in on certain operating systems.
-// (Windows).
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef EXECUTION_ENGINE_INTERPRETER_H
-#define EXECUTION_ENGINE_INTERPRETER_H
-
-#include "llvm/ExecutionEngine/ExecutionEngine.h"
-#include <cstdlib>
-
-namespace llvm {
- extern void LinkInInterpreter();
-}
-
-namespace {
- struct ForceInterpreterLinking {
- ForceInterpreterLinking() {
- // We must reference the passes in such a way that compilers will not
- // delete it all as dead code, even with whole program optimization,
- // yet is effectively a NO-OP. As the compiler isn't smart enough
- // to know that getenv() never returns -1, this will do the job.
- if (std::getenv("bar") != (char*) -1)
- return;
-
- llvm::LinkInInterpreter();
- }
- } ForceInterpreterLinking;
-}
-
-#endif
diff --git a/release_23/include/llvm/ExecutionEngine/JIT.h b/release_23/include/llvm/ExecutionEngine/JIT.h
deleted file mode 100644
index d4d1e73d1bac..000000000000
--- a/release_23/include/llvm/ExecutionEngine/JIT.h
+++ /dev/null
@@ -1,40 +0,0 @@
-//===-- JIT.h - Abstract Execution Engine Interface -------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file forces the JIT to link in on certain operating systems.
-// (Windows).
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_EXECUTION_ENGINE_JIT_H
-#define LLVM_EXECUTION_ENGINE_JIT_H
-
-#include "llvm/ExecutionEngine/ExecutionEngine.h"
-#include <cstdlib>
-
-namespace llvm {
- extern void LinkInJIT();
-}
-
-namespace {
- struct ForceJITLinking {
- ForceJITLinking() {
- // We must reference the passes in such a way that compilers will not
- // delete it all as dead code, even with whole program optimization,
- // yet is effectively a NO-OP. As the compiler isn't smart enough
- // to know that getenv() never returns -1, this will do the job.
- if (std::getenv("bar") != (char*) -1)
- return;
-
- llvm::LinkInJIT();
- }
- } ForceJITLinking;
-}
-
-#endif
diff --git a/release_23/include/llvm/ExecutionEngine/JITMemoryManager.h b/release_23/include/llvm/ExecutionEngine/JITMemoryManager.h
deleted file mode 100644
index e1f2763e1db6..000000000000
--- a/release_23/include/llvm/ExecutionEngine/JITMemoryManager.h
+++ /dev/null
@@ -1,115 +0,0 @@
-//===-- JITMemoryManager.h - Interface JIT uses to Allocate Mem -*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines the JITMemoryManagerInterface
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_EXECUTION_ENGINE_JIT_MEMMANAGER_H
-#define LLVM_EXECUTION_ENGINE_JIT_MEMMANAGER_H
-
-#include "llvm/Support/DataTypes.h"
-
-namespace llvm {
- class Function;
-
-/// JITMemoryManager - This interface is used by the JIT to allocate and manage
-/// memory for the code generated by the JIT. This can be reimplemented by
-/// clients that have a strong desire to control how the layout of JIT'd memory
-/// works.
-class JITMemoryManager {
-protected:
- bool HasGOT;
- bool SizeRequired;
-public:
- JITMemoryManager() : HasGOT(false), SizeRequired(false) {}
- virtual ~JITMemoryManager();
-
- /// CreateDefaultMemManager - This is used to create the default
- /// JIT Memory Manager if the client does not provide one to the JIT.
- static JITMemoryManager *CreateDefaultMemManager();
-
- //===--------------------------------------------------------------------===//
- // Global Offset Table Management
- //===--------------------------------------------------------------------===//
-
- /// AllocateGOT - If the current table requires a Global Offset Table, this
- /// method is invoked to allocate it. This method is required to set HasGOT
- /// to true.
- virtual void AllocateGOT() = 0;
-
- /// isManagingGOT - Return true if the AllocateGOT method is called.
- ///
- bool isManagingGOT() const {
- return HasGOT;
- }
-
- /// getGOTBase - If this is managing a Global Offset Table, this method should
- /// return a pointer to its base.
- virtual unsigned char *getGOTBase() const = 0;
-
- /// NeedsExactSize - If the memory manager requires to know the size of the
- /// objects to be emitted
- bool NeedsExactSize() const {
- return SizeRequired;
- }
-
- //===--------------------------------------------------------------------===//
- // Main Allocation Functions
- //===--------------------------------------------------------------------===//
-
- /// startFunctionBody - When we start JITing a function, the JIT calls this
- /// method to allocate a block of free RWX memory, which returns a pointer to
- /// it. The JIT doesn't know ahead of time how much space it will need to
- /// emit the function, so it doesn't pass in the size. Instead, this method
- /// is required to pass back a "valid size". The JIT will be careful to not
- /// write more than the returned ActualSize bytes of memory.
- virtual unsigned char *startFunctionBody(const Function *F,
- uintptr_t &ActualSize) = 0;
-
- /// allocateStub - This method is called by the JIT to allocate space for a
- /// function stub (used to handle limited branch displacements) while it is
- /// JIT compiling a function. For example, if foo calls bar, and if bar
- /// either needs to be lazily compiled or is a native function that exists too
- /// far away from the call site to work, this method will be used to make a
- /// thunk for it. The stub should be "close" to the current function body,
- /// but should not be included in the 'actualsize' returned by
- /// startFunctionBody.
- virtual unsigned char *allocateStub(const GlobalValue* F, unsigned StubSize,
- unsigned Alignment) =0;
-
-
- /// endFunctionBody - This method is called when the JIT is done codegen'ing
- /// the specified function. At this point we know the size of the JIT
- /// compiled function. This passes in FunctionStart (which was returned by
- /// the startFunctionBody method) and FunctionEnd which is a pointer to the
- /// actual end of the function. This method should mark the space allocated
- /// and remember where it is in case the client wants to deallocate it.
- virtual void endFunctionBody(const Function *F, unsigned char *FunctionStart,
- unsigned char *FunctionEnd) = 0;
-
- /// deallocateMemForFunction - Free JIT memory for the specified function.
- /// This is never called when the JIT is currently emitting a function.
- virtual void deallocateMemForFunction(const Function *F) = 0;
-
- /// startExceptionTable - When we finished JITing the function, if exception
- /// handling is set, we emit the exception table.
- virtual unsigned char* startExceptionTable(const Function* F,
- uintptr_t &ActualSize) = 0;
-
- /// endExceptionTable - This method is called when the JIT is done emitting
- /// the exception table.
- virtual void endExceptionTable(const Function *F, unsigned char *TableStart,
- unsigned char *TableEnd,
- unsigned char* FrameRegister) = 0;
-};
-
-} // end namespace llvm.
-
-#endif
diff --git a/release_23/include/llvm/Function.h b/release_23/include/llvm/Function.h
deleted file mode 100644
index 28c301fe2f6f..000000000000
--- a/release_23/include/llvm/Function.h
+++ /dev/null
@@ -1,360 +0,0 @@
-//===-- llvm/Function.h - Class to represent a single function --*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains the declaration of the Function class, which represents a
-// single function/procedure in LLVM.
-//
-// A function basically consists of a list of basic blocks, a list of arguments,
-// and a symbol table.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_FUNCTION_H
-#define LLVM_FUNCTION_H
-
-#include "llvm/GlobalValue.h"
-#include "llvm/BasicBlock.h"
-#include "llvm/Argument.h"
-#include "llvm/Support/Annotation.h"
-#include "llvm/ParameterAttributes.h"
-
-namespace llvm {
-
-class FunctionType;
-
-// Traits for intrusive list of instructions...
-template<> struct ilist_traits<BasicBlock>
- : public SymbolTableListTraits<BasicBlock, Function> {
-
- // createSentinel is used to create a node that marks the end of the list...
- static BasicBlock *createSentinel();
- static void destroySentinel(BasicBlock *BB) { delete BB; }
- static iplist<BasicBlock> &getList(Function *F);
- static ValueSymbolTable *getSymTab(Function *ItemParent);
- static int getListOffset();
-};
-
-template<> struct ilist_traits<Argument>
- : public SymbolTableListTraits<Argument, Function> {
-
- // createSentinel is used to create a node that marks the end of the list...
- static Argument *createSentinel();
- static void destroySentinel(Argument *A) { delete A; }
- static iplist<Argument> &getList(Function *F);
- static ValueSymbolTable *getSymTab(Function *ItemParent);
- static int getListOffset();
-};
-
-class Function : public GlobalValue, public Annotable {
-public:
- typedef iplist<Argument> ArgumentListType;
- typedef iplist<BasicBlock> BasicBlockListType;
-
- // BasicBlock iterators...
- typedef BasicBlockListType::iterator iterator;
- typedef BasicBlockListType::const_iterator const_iterator;
-
- typedef ArgumentListType::iterator arg_iterator;
- typedef ArgumentListType::const_iterator const_arg_iterator;
-
-private:
- // Important things that make up a function!
- BasicBlockListType BasicBlocks; ///< The basic blocks
- mutable ArgumentListType ArgumentList; ///< The formal arguments
- ValueSymbolTable *SymTab; ///< Symbol table of args/instructions
- PAListPtr ParamAttrs; ///< Parameter attributes
-
- // The Calling Convention is stored in Value::SubclassData.
- /*unsigned CallingConvention;*/
-
- friend class SymbolTableListTraits<Function, Module>;
-
- void setParent(Module *parent);
- Function *Prev, *Next;
- void setNext(Function *N) { Next = N; }
- void setPrev(Function *N) { Prev = N; }
-
- // getNext/Prev - Return the next or previous function in the list. These
- // methods should never be used directly, and are only used to implement the
- // function list as part of the module.
- //
- Function *getNext() { return Next; }
- const Function *getNext() const { return Next; }
- Function *getPrev() { return Prev; }
- const Function *getPrev() const { return Prev; }
-
- /// hasLazyArguments/CheckLazyArguments - The argument list of a function is
- /// built on demand, so that the list isn't allocated until the first client
- /// needs it. The hasLazyArguments predicate returns true if the arg list
- /// hasn't been set up yet.
- bool hasLazyArguments() const {
- return SubclassData & 1;
- }
- void CheckLazyArguments() const {
- if (hasLazyArguments())
- BuildLazyArguments();
- }
- void BuildLazyArguments() const;
-
- Function(const Function&); // DO NOT IMPLEMENT
- void operator=(const Function&); // DO NOT IMPLEMENT
-
- /// Function ctor - If the (optional) Module argument is specified, the
- /// function is automatically inserted into the end of the function list for
- /// the module.
- ///
- Function(const FunctionType *Ty, LinkageTypes Linkage,
- const std::string &N = "", Module *M = 0);
-
-public:
- static Function *Create(const FunctionType *Ty, LinkageTypes Linkage,
- const std::string &N = "", Module *M = 0) {
- return new(0) Function(Ty, Linkage, N, M);
- }
-
- ~Function();
-
- const Type *getReturnType() const; // Return the type of the ret val
- const FunctionType *getFunctionType() const; // Return the FunctionType for me
-
- /// isVarArg - Return true if this function takes a variable number of
- /// arguments.
- bool isVarArg() const;
-
- /// isDeclaration - Is the body of this function unknown? (The basic block
- /// list is empty if so.) This is true for function declarations, but not
- /// true for function definitions.
- ///
- virtual bool isDeclaration() const { return BasicBlocks.empty(); }
-
- /// getIntrinsicID - This method returns the ID number of the specified
- /// function, or Intrinsic::not_intrinsic if the function is not an
- /// instrinsic, or if the pointer is null. This value is always defined to be
- /// zero to allow easy checking for whether a function is intrinsic or not.
- /// The particular intrinsic functions which correspond to this value are
- /// defined in llvm/Intrinsics.h.
- ///
- unsigned getIntrinsicID(bool noAssert = false) const;
- bool isIntrinsic() const { return getIntrinsicID() != 0; }
-
- /// getCallingConv()/setCallingConv(uint) - These method get and set the
- /// calling convention of this function. The enum values for the known
- /// calling conventions are defined in CallingConv.h.
- unsigned getCallingConv() const { return SubclassData >> 1; }
- void setCallingConv(unsigned CC) {
- SubclassData = (SubclassData & 1) | (CC << 1);
- }
-
- /// getParamAttrs - Return the parameter attributes for this Function.
- ///
- const PAListPtr &getParamAttrs() const { return ParamAttrs; }
-
- /// setParamAttrs - Set the parameter attributes for this Function.
- ///
- void setParamAttrs(const PAListPtr &attrs) { ParamAttrs = attrs; }
-
- /// hasCollector/getCollector/setCollector/clearCollector - The name of the
- /// garbage collection algorithm to use during code generation.
- bool hasCollector() const;
- const char *getCollector() const;
- void setCollector(const char *Str);
- void clearCollector();
-
- /// @brief Determine whether the function has the given attribute.
- bool paramHasAttr(unsigned i, ParameterAttributes attr) const {
- return ParamAttrs.paramHasAttr(i, attr);
- }
-
- /// @brief Extract the alignment for a call or parameter (0=unknown).
- unsigned getParamAlignment(unsigned i) const {
- return ParamAttrs.getParamAlignment(i);
- }
-
- /// @brief Determine if the function cannot return.
- bool doesNotReturn() const { return paramHasAttr(0, ParamAttr::NoReturn); }
- void setDoesNotThrow(bool doesNotThrow = true);
-
- /// @brief Determine if the function cannot unwind.
- bool doesNotThrow() const {
- return paramHasAttr(0, ParamAttr::NoUnwind);
- }
-
- /// @brief Determine if the function does not access memory.
- bool doesNotAccessMemory() const {
- return paramHasAttr(0, ParamAttr::ReadNone);
- }
-
- /// @brief Determine if the function does not access or only reads memory.
- bool onlyReadsMemory() const {
- return doesNotAccessMemory() || paramHasAttr(0, ParamAttr::ReadOnly);
- }
-
- /// @brief Determine if the function returns a structure through first
- /// pointer argument.
- bool hasStructRetAttr() const {
- return paramHasAttr(1, ParamAttr::StructRet);
- }
-
- /// deleteBody - This method deletes the body of the function, and converts
- /// the linkage to external.
- ///
- void deleteBody() {
- dropAllReferences();
- setLinkage(ExternalLinkage);
- }
-
- /// removeFromParent - This method unlinks 'this' from the containing module,
- /// but does not delete it.
- ///
- void removeFromParent();
-
- /// eraseFromParent - This method unlinks 'this' from the containing module
- /// and deletes it.
- ///
- void eraseFromParent();
-
-
- /// Get the underlying elements of the Function... the basic block list is
- /// empty for external functions.
- ///
- const ArgumentListType &getArgumentList() const {
- CheckLazyArguments();
- return ArgumentList;
- }
- ArgumentListType &getArgumentList() {
- CheckLazyArguments();
- return ArgumentList;
- }
-
- const BasicBlockListType &getBasicBlockList() const { return BasicBlocks; }
- BasicBlockListType &getBasicBlockList() { return BasicBlocks; }
-
- const BasicBlock &getEntryBlock() const { return front(); }
- BasicBlock &getEntryBlock() { return front(); }
-
- //===--------------------------------------------------------------------===//
- // Symbol Table Accessing functions...
-
- /// getSymbolTable() - Return the symbol table...
- ///
- inline ValueSymbolTable &getValueSymbolTable() { return *SymTab; }
- inline const ValueSymbolTable &getValueSymbolTable() const { return *SymTab; }
-
-
- //===--------------------------------------------------------------------===//
- // BasicBlock iterator forwarding functions
- //
- iterator begin() { return BasicBlocks.begin(); }
- const_iterator begin() const { return BasicBlocks.begin(); }
- iterator end () { return BasicBlocks.end(); }
- const_iterator end () const { return BasicBlocks.end(); }
-
- size_t size() const { return BasicBlocks.size(); }
- bool empty() const { return BasicBlocks.empty(); }
- const BasicBlock &front() const { return BasicBlocks.front(); }
- BasicBlock &front() { return BasicBlocks.front(); }
- const BasicBlock &back() const { return BasicBlocks.back(); }
- BasicBlock &back() { return BasicBlocks.back(); }
-
- //===--------------------------------------------------------------------===//
- // Argument iterator forwarding functions
- //
- arg_iterator arg_begin() {
- CheckLazyArguments();
- return ArgumentList.begin();
- }
- const_arg_iterator arg_begin() const {
- CheckLazyArguments();
- return ArgumentList.begin();
- }
- arg_iterator arg_end() {
- CheckLazyArguments();
- return ArgumentList.end();
- }
- const_arg_iterator arg_end() const {
- CheckLazyArguments();
- return ArgumentList.end();
- }
-
- size_t arg_size() const;
- bool arg_empty() const;
-
- virtual void print(std::ostream &OS) const { print(OS, 0); }
- void print(std::ostream *OS) const { if (OS) print(*OS); }
- void print(std::ostream &OS, AssemblyAnnotationWriter *AAW) const;
-
- /// viewCFG - This function is meant for use from the debugger. You can just
- /// say 'call F->viewCFG()' and a ghostview window should pop up from the
- /// program, displaying the CFG of the current function with the code for each
- /// basic block inside. This depends on there being a 'dot' and 'gv' program
- /// in your path.
- ///
- void viewCFG() const;
-
- /// viewCFGOnly - This function is meant for use from the debugger. It works
- /// just like viewCFG, but it does not include the contents of basic blocks
- /// into the nodes, just the label. If you are only interested in the CFG
- /// this can make the graph smaller.
- ///
- void viewCFGOnly() const;
-
- /// Methods for support type inquiry through isa, cast, and dyn_cast:
- static inline bool classof(const Function *) { return true; }
- static inline bool classof(const Value *V) {
- return V->getValueID() == Value::FunctionVal;
- }
-
- /// dropAllReferences() - This method causes all the subinstructions to "let
- /// go" of all references that they are maintaining. This allows one to
- /// 'delete' a whole module at a time, even though there may be circular
- /// references... first all references are dropped, and all use counts go to
- /// zero. Then everything is deleted for real. Note that no operations are
- /// valid on an object that has "dropped all references", except operator
- /// delete.
- ///
- /// Since no other object in the module can have references into the body of a
- /// function, dropping all references deletes the entire body of the function,
- /// including any contained basic blocks.
- ///
- void dropAllReferences();
-
- static unsigned getBasicBlockListOffset() {
- Function *Obj = 0;
- return unsigned(reinterpret_cast<uintptr_t>(&Obj->BasicBlocks));
- }
- static unsigned getArgumentListOffset() {
- Function *Obj = 0;
- return unsigned(reinterpret_cast<uintptr_t>(&Obj->ArgumentList));
- }
-};
-
-inline ValueSymbolTable *
-ilist_traits<BasicBlock>::getSymTab(Function *F) {
- return F ? &F->getValueSymbolTable() : 0;
-}
-
-inline ValueSymbolTable *
-ilist_traits<Argument>::getSymTab(Function *F) {
- return F ? &F->getValueSymbolTable() : 0;
-}
-
-inline int
-ilist_traits<BasicBlock>::getListOffset() {
- return Function::getBasicBlockListOffset();
-}
-
-inline int
-ilist_traits<Argument>::getListOffset() {
- return Function::getArgumentListOffset();
-}
-
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/GlobalAlias.h b/release_23/include/llvm/GlobalAlias.h
deleted file mode 100644
index b59537c9af4d..000000000000
--- a/release_23/include/llvm/GlobalAlias.h
+++ /dev/null
@@ -1,100 +0,0 @@
-//===-------- llvm/GlobalAlias.h - GlobalAlias class ------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains the declaration of the GlobalAlias class, which
-// represents a single function or variable alias in the IR.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_GLOBAL_ALIAS_H
-#define LLVM_GLOBAL_ALIAS_H
-
-#include "llvm/GlobalValue.h"
-
-namespace llvm {
-
-class Module;
-class Constant;
-class PointerType;
-template<typename ValueSubClass, typename ItemParentClass>
- class SymbolTableListTraits;
-
-class GlobalAlias : public GlobalValue {
- friend class SymbolTableListTraits<GlobalAlias, Module>;
- void operator=(const GlobalAlias &); // Do not implement
- GlobalAlias(const GlobalAlias &); // Do not implement
-
- void setParent(Module *parent);
-
- GlobalAlias *Prev, *Next;
- void setNext(GlobalAlias *N) { Next = N; }
- void setPrev(GlobalAlias *N) { Prev = N; }
-
- // getNext/Prev - Return the next or previous alias in the list.
- GlobalAlias *getNext() { return Next; }
- const GlobalAlias *getNext() const { return Next; }
- GlobalAlias *getPrev() { return Prev; }
- const GlobalAlias *getPrev() const { return Prev; }
-
- Use Aliasee;
-public:
- // allocate space for exactly zero operands
- void *operator new(size_t s) {
- return User::operator new(s, 0);
- }
- /// GlobalAlias ctor - If a parent module is specified, the alias is
- /// automatically inserted into the end of the specified module's alias list.
- GlobalAlias(const Type *Ty, LinkageTypes Linkage, const std::string &Name = "",
- Constant* Aliasee = 0, Module *Parent = 0);
-
- /// isDeclaration - Is this global variable lacking an initializer? If so,
- /// the global variable is defined in some other translation unit, and is thus
- /// only a declaration here.
- virtual bool isDeclaration() const;
-
- /// removeFromParent - This method unlinks 'this' from the containing module,
- /// but does not delete it.
- ///
- void removeFromParent();
-
- /// eraseFromParent - This method unlinks 'this' from the containing module
- /// and deletes it.
- ///
- void eraseFromParent();
-
- virtual void print(std::ostream &OS) const;
- void print(std::ostream *OS) const { if (OS) print(*OS); }
-
- /// set/getAliasee - These methods retrive and set alias target.
- void setAliasee(Constant* GV);
- const Constant* getAliasee() const {
- return cast_or_null<Constant>(getOperand(0));
- }
- Constant* getAliasee() {
- return cast_or_null<Constant>(getOperand(0));
- }
- /// getAliasedGlobal() - Aliasee can be either global or bitcast of
- /// global. This method retrives the global for both aliasee flavours.
- const GlobalValue* getAliasedGlobal() const;
-
- /// resolveAliasedGlobal() - This method tries to ultimately resolve the alias
- /// by going through the aliasing chain and trying to find the very last
- /// global. Returns NULL if a cycle was found.
- const GlobalValue* resolveAliasedGlobal() const;
-
- // Methods for support type inquiry through isa, cast, and dyn_cast:
- static inline bool classof(const GlobalAlias *) { return true; }
- static inline bool classof(const Value *V) {
- return V->getValueID() == Value::GlobalAliasVal;
- }
-};
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/GlobalValue.h b/release_23/include/llvm/GlobalValue.h
deleted file mode 100644
index 808471d0a4c3..000000000000
--- a/release_23/include/llvm/GlobalValue.h
+++ /dev/null
@@ -1,151 +0,0 @@
-//===-- llvm/GlobalValue.h - Class to represent a global value --*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file is a common base class of all globally definable objects. As such,
-// it is subclassed by GlobalVariable, GlobalAlias and by Function. This is
-// used because you can do certain things with these global objects that you
-// can't do to anything else. For example, use the address of one as a
-// constant.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_GLOBALVALUE_H
-#define LLVM_GLOBALVALUE_H
-
-#include "llvm/Constant.h"
-
-namespace llvm {
-
-class PointerType;
-class Module;
-
-class GlobalValue : public Constant {
- GlobalValue(const GlobalValue &); // do not implement
-public:
- /// @brief An enumeration for the kinds of linkage for global values.
- enum LinkageTypes {
- ExternalLinkage = 0,///< Externally visible function
- LinkOnceLinkage, ///< Keep one copy of function when linking (inline)
- WeakLinkage, ///< Keep one copy of named function when linking (weak)
- AppendingLinkage, ///< Special purpose, only applies to global arrays
- InternalLinkage, ///< Rename collisions when linking (static functions)
- DLLImportLinkage, ///< Function to be imported from DLL
- DLLExportLinkage, ///< Function to be accessible from DLL
- ExternalWeakLinkage,///< ExternalWeak linkage description
- GhostLinkage ///< Stand-in functions for streaming fns from BC files
- };
-
- /// @brief An enumeration for the kinds of visibility of global values.
- enum VisibilityTypes {
- DefaultVisibility = 0, ///< The GV is visible
- HiddenVisibility, ///< The GV is hidden
- ProtectedVisibility ///< The GV is protected
- };
-
-protected:
- GlobalValue(const Type *Ty, ValueTy vty, Use *Ops, unsigned NumOps,
- LinkageTypes linkage, const std::string &name = "")
- : Constant(Ty, vty, Ops, NumOps), Parent(0),
- Linkage(linkage), Visibility(DefaultVisibility), Alignment(0) {
- if (!name.empty()) setName(name);
- }
-
- Module *Parent;
- // Note: VC++ treats enums as signed, so an extra bit is required to prevent
- // Linkage and Visibility from turning into negative values.
- LinkageTypes Linkage : 5; // The linkage of this global
- unsigned Visibility : 2; // The visibility style of this global
- unsigned Alignment : 16; // Alignment of this symbol, must be power of two
- std::string Section; // Section to emit this into, empty mean default
-public:
- ~GlobalValue() {
- removeDeadConstantUsers(); // remove any dead constants using this.
- }
-
- unsigned getAlignment() const { return Alignment; }
- void setAlignment(unsigned Align) {
- assert((Align & (Align-1)) == 0 && "Alignment is not a power of 2!");
- Alignment = Align;
- }
-
- VisibilityTypes getVisibility() const { return VisibilityTypes(Visibility); }
- bool hasHiddenVisibility() const { return Visibility == HiddenVisibility; }
- bool hasProtectedVisibility() const {
- return Visibility == ProtectedVisibility;
- }
- void setVisibility(VisibilityTypes V) { Visibility = V; }
-
- bool hasSection() const { return !Section.empty(); }
- const std::string &getSection() const { return Section; }
- void setSection(const std::string &S) { Section = S; }
-
- /// If the usage is empty (except transitively dead constants), then this
- /// global value can can be safely deleted since the destructor will
- /// delete the dead constants as well.
- /// @brief Determine if the usage of this global value is empty except
- /// for transitively dead constants.
- bool use_empty_except_constants();
-
- /// getType - Global values are always pointers.
- inline const PointerType *getType() const {
- return reinterpret_cast<const PointerType*>(User::getType());
- }
-
- bool hasExternalLinkage() const { return Linkage == ExternalLinkage; }
- bool hasLinkOnceLinkage() const { return Linkage == LinkOnceLinkage; }
- bool hasWeakLinkage() const { return Linkage == WeakLinkage; }
- bool hasAppendingLinkage() const { return Linkage == AppendingLinkage; }
- bool hasInternalLinkage() const { return Linkage == InternalLinkage; }
- bool hasDLLImportLinkage() const { return Linkage == DLLImportLinkage; }
- bool hasDLLExportLinkage() const { return Linkage == DLLExportLinkage; }
- bool hasExternalWeakLinkage() const { return Linkage == ExternalWeakLinkage; }
- void setLinkage(LinkageTypes LT) { Linkage = LT; }
- LinkageTypes getLinkage() const { return Linkage; }
-
- /// hasNotBeenReadFromBitcode - If a module provider is being used to lazily
- /// stream in functions from disk, this method can be used to check to see if
- /// the function has been read in yet or not. Unless you are working on the
- /// JIT or something else that streams stuff in lazily, you don't need to
- /// worry about this.
- bool hasNotBeenReadFromBitcode() const { return Linkage == GhostLinkage; }
-
- /// Override from Constant class. No GlobalValue's are null values so this
- /// always returns false.
- virtual bool isNullValue() const { return false; }
-
- /// Override from Constant class.
- virtual void destroyConstant();
-
- /// isDeclaration - Return true if the primary definition of this global
- /// value is outside of the current translation unit...
- virtual bool isDeclaration() const = 0;
-
- /// getParent - Get the module that this global value is contained inside
- /// of...
- inline Module *getParent() { return Parent; }
- inline const Module *getParent() const { return Parent; }
-
- /// removeDeadConstantUsers - If there are any dead constant users dangling
- /// off of this global value, remove them. This method is useful for clients
- /// that want to check to see if a global is unused, but don't want to deal
- /// with potentially dead constants hanging off of the globals.
- void removeDeadConstantUsers();
-
- // Methods for support type inquiry through isa, cast, and dyn_cast:
- static inline bool classof(const GlobalValue *) { return true; }
- static inline bool classof(const Value *V) {
- return V->getValueID() == Value::FunctionVal ||
- V->getValueID() == Value::GlobalVariableVal ||
- V->getValueID() == Value::GlobalAliasVal;
- }
-};
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/GlobalVariable.h b/release_23/include/llvm/GlobalVariable.h
deleted file mode 100644
index 8c6d8030c6dc..000000000000
--- a/release_23/include/llvm/GlobalVariable.h
+++ /dev/null
@@ -1,146 +0,0 @@
-//===-- llvm/GlobalVariable.h - GlobalVariable class ------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains the declaration of the GlobalVariable class, which
-// represents a single global variable (or constant) in the VM.
-//
-// Global variables are constant pointers that refer to hunks of space that are
-// allocated by either the VM, or by the linker in a static compiler. A global
-// variable may have an intial value, which is copied into the executables .data
-// area. Global Constants are required to have initializers.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_GLOBAL_VARIABLE_H
-#define LLVM_GLOBAL_VARIABLE_H
-
-#include "llvm/GlobalValue.h"
-
-namespace llvm {
-
-class Module;
-class Constant;
-class PointerType;
-template<typename ValueSubClass, typename ItemParentClass>
- class SymbolTableListTraits;
-
-class GlobalVariable : public GlobalValue {
- friend class SymbolTableListTraits<GlobalVariable, Module>;
- void *operator new(size_t, unsigned); // Do not implement
- void operator=(const GlobalVariable &); // Do not implement
- GlobalVariable(const GlobalVariable &); // Do not implement
-
- void setParent(Module *parent);
-
- GlobalVariable *Prev, *Next;
- void setNext(GlobalVariable *N) { Next = N; }
- void setPrev(GlobalVariable *N) { Prev = N; }
-
- bool isConstantGlobal : 1; // Is this a global constant?
- bool isThreadLocalSymbol : 1; // Is this symbol "Thread Local"?
- Use Initializer;
-
-public:
- // allocate space for exactly zero operands
- void *operator new(size_t s) {
- return User::operator new(s, 0);
- }
- /// GlobalVariable ctor - If a parent module is specified, the global is
- /// automatically inserted into the end of the specified modules global list.
- GlobalVariable(const Type *Ty, bool isConstant, LinkageTypes Linkage,
- Constant *Initializer = 0, const std::string &Name = "",
- Module *Parent = 0, bool ThreadLocal = false,
- unsigned AddressSpace = 0);
- /// GlobalVariable ctor - This creates a global and inserts it before the
- /// specified other global.
- GlobalVariable(const Type *Ty, bool isConstant, LinkageTypes Linkage,
- Constant *Initializer, const std::string &Name,
- GlobalVariable *InsertBefore, bool ThreadLocal = false,
- unsigned AddressSpace = 0);
-
- /// isDeclaration - Is this global variable lacking an initializer? If so,
- /// the global variable is defined in some other translation unit, and is thus
- /// only a declaration here.
- virtual bool isDeclaration() const { return getNumOperands() == 0; }
-
- /// hasInitializer - Unless a global variable isExternal(), it has an
- /// initializer. The initializer for the global variable/constant is held by
- /// Initializer if an initializer is specified.
- ///
- inline bool hasInitializer() const { return !isDeclaration(); }
-
- /// getInitializer - Return the initializer for this global variable. It is
- /// illegal to call this method if the global is external, because we cannot
- /// tell what the value is initialized to!
- ///
- inline Constant *getInitializer() const {
- assert(hasInitializer() && "GV doesn't have initializer!");
- return reinterpret_cast<Constant*>(Initializer.get());
- }
- inline Constant *getInitializer() {
- assert(hasInitializer() && "GV doesn't have initializer!");
- return reinterpret_cast<Constant*>(Initializer.get());
- }
- inline void setInitializer(Constant *CPV) {
- if (CPV == 0) {
- if (hasInitializer()) {
- Initializer.set(0);
- NumOperands = 0;
- }
- } else {
- if (!hasInitializer())
- NumOperands = 1;
- Initializer.set(CPV);
- }
- }
-
- /// If the value is a global constant, its value is immutable throughout the
- /// runtime execution of the program. Assigning a value into the constant
- /// leads to undefined behavior.
- ///
- bool isConstant() const { return isConstantGlobal; }
- void setConstant(bool Value) { isConstantGlobal = Value; }
-
- /// If the value is "Thread Local", its value isn't shared by the threads.
- bool isThreadLocal() const { return isThreadLocalSymbol; }
- void setThreadLocal(bool Value) { isThreadLocalSymbol = Value; }
-
- /// removeFromParent - This method unlinks 'this' from the containing module,
- /// but does not delete it.
- ///
- void removeFromParent();
-
- /// eraseFromParent - This method unlinks 'this' from the containing module
- /// and deletes it.
- ///
- void eraseFromParent();
-
- /// Override Constant's implementation of this method so we can
- /// replace constant initializers.
- virtual void replaceUsesOfWithOnConstant(Value *From, Value *To, Use *U);
-
- virtual void print(std::ostream &OS) const;
- void print(std::ostream *OS) const { if (OS) print(*OS); }
-
- // Methods for support type inquiry through isa, cast, and dyn_cast:
- static inline bool classof(const GlobalVariable *) { return true; }
- static inline bool classof(const Value *V) {
- return V->getValueID() == Value::GlobalVariableVal;
- }
-private:
- // getNext/Prev - Return the next or previous global variable in the list.
- GlobalVariable *getNext() { return Next; }
- const GlobalVariable *getNext() const { return Next; }
- GlobalVariable *getPrev() { return Prev; }
- const GlobalVariable *getPrev() const { return Prev; }
-};
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/InlineAsm.h b/release_23/include/llvm/InlineAsm.h
deleted file mode 100644
index bb046c2a3cb5..000000000000
--- a/release_23/include/llvm/InlineAsm.h
+++ /dev/null
@@ -1,134 +0,0 @@
-//===-- llvm/InlineAsm.h - Class to represent inline asm strings-*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This class represents the inline asm strings, which are Value*'s that are
-// used as the callee operand of call instructions. InlineAsm's are uniqued
-// like constants, and created via InlineAsm::get(...).
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_INLINEASM_H
-#define LLVM_INLINEASM_H
-
-#include "llvm/Value.h"
-#include <vector>
-
-namespace llvm {
-
-struct AssemblyAnnotationWriter;
-class PointerType;
-class FunctionType;
-class Module;
-
-class InlineAsm : public Value {
- InlineAsm(const InlineAsm &); // do not implement
- void operator=(const InlineAsm&); // do not implement
-
- std::string AsmString, Constraints;
- bool HasSideEffects;
-
- InlineAsm(const FunctionType *Ty, const std::string &AsmString,
- const std::string &Constraints, bool hasSideEffects);
- virtual ~InlineAsm();
-public:
-
- /// InlineAsm::get - Return the the specified uniqued inline asm string.
- ///
- static InlineAsm *get(const FunctionType *Ty, const std::string &AsmString,
- const std::string &Constraints, bool hasSideEffects);
-
- bool hasSideEffects() const { return HasSideEffects; }
-
- /// getType - InlineAsm's are always pointers.
- ///
- const PointerType *getType() const {
- return reinterpret_cast<const PointerType*>(Value::getType());
- }
-
- /// getFunctionType - InlineAsm's are always pointers to functions.
- ///
- const FunctionType *getFunctionType() const;
-
- const std::string &getAsmString() const { return AsmString; }
- const std::string &getConstraintString() const { return Constraints; }
-
- virtual void print(std::ostream &O) const { print(O, 0); }
- void print(std::ostream *O) const { if (O) print(*O); }
- void print(std::ostream &OS, AssemblyAnnotationWriter *AAW) const;
-
- /// Verify - This static method can be used by the parser to check to see if
- /// the specified constraint string is legal for the type. This returns true
- /// if legal, false if not.
- ///
- static bool Verify(const FunctionType *Ty, const std::string &Constraints);
-
- // Constraint String Parsing
- enum ConstraintPrefix {
- isInput, // 'x'
- isOutput, // '=x'
- isClobber // '~x'
- };
-
- struct ConstraintInfo {
- /// Type - The basic type of the constraint: input/output/clobber
- ///
- ConstraintPrefix Type;
-
- /// isEarlyClobber - "&": output operand writes result before inputs are all
- /// read. This is only ever set for an output operand.
- bool isEarlyClobber;
-
- /// hasMatchingInput - This is set to true for an output constraint iff
- /// there is an input constraint that is required to match it (e.g. "0").
- bool hasMatchingInput;
-
- /// isCommutative - This is set to true for a constraint that is commutative
- /// with the next operand.
- bool isCommutative;
-
- /// isIndirect - True if this operand is an indirect operand. This means
- /// that the address of the source or destination is present in the call
- /// instruction, instead of it being returned or passed in explicitly. This
- /// is represented with a '*' in the asm string.
- bool isIndirect;
-
- /// Code - The constraint code, either the register name (in braces) or the
- /// constraint letter/number.
- std::vector<std::string> Codes;
-
- /// Parse - Analyze the specified string (e.g. "=*&{eax}") and fill in the
- /// fields in this structure. If the constraint string is not understood,
- /// return true, otherwise return false.
- bool Parse(const std::string &Str,
- std::vector<InlineAsm::ConstraintInfo> &ConstraintsSoFar);
- };
-
- /// ParseConstraints - Split up the constraint string into the specific
- /// constraints and their prefixes. If this returns an empty vector, and if
- /// the constraint string itself isn't empty, there was an error parsing.
- static std::vector<ConstraintInfo>
- ParseConstraints(const std::string &ConstraintString);
-
- /// ParseConstraints - Parse the constraints of this inlineasm object,
- /// returning them the same way that ParseConstraints(str) does.
- std::vector<ConstraintInfo>
- ParseConstraints() const {
- return ParseConstraints(Constraints);
- }
-
- // Methods for support type inquiry through isa, cast, and dyn_cast:
- static inline bool classof(const InlineAsm *) { return true; }
- static inline bool classof(const Value *V) {
- return V->getValueID() == Value::InlineAsmVal;
- }
-};
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/InstrTypes.h b/release_23/include/llvm/InstrTypes.h
deleted file mode 100644
index f735602ca8ce..000000000000
--- a/release_23/include/llvm/InstrTypes.h
+++ /dev/null
@@ -1,603 +0,0 @@
-//===-- llvm/InstrTypes.h - Important Instruction subclasses ----*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines various meta classes of instructions that exist in the VM
-// representation. Specific concrete subclasses of these may be found in the
-// i*.h files...
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_INSTRUCTION_TYPES_H
-#define LLVM_INSTRUCTION_TYPES_H
-
-#include "llvm/Instruction.h"
-
-namespace llvm {
-
-//===----------------------------------------------------------------------===//
-// TerminatorInst Class
-//===----------------------------------------------------------------------===//
-
-/// TerminatorInst - Subclasses of this class are all able to terminate a basic
-/// block. Thus, these are all the flow control type of operations.
-///
-class TerminatorInst : public Instruction {
-protected:
- TerminatorInst(const Type *Ty, Instruction::TermOps iType,
- Use *Ops, unsigned NumOps,
- Instruction *InsertBefore = 0)
- : Instruction(Ty, iType, Ops, NumOps, InsertBefore) {}
-
- TerminatorInst(const Type *Ty, Instruction::TermOps iType,
- Use *Ops, unsigned NumOps, BasicBlock *InsertAtEnd)
- : Instruction(Ty, iType, Ops, NumOps, InsertAtEnd) {}
-
- // Out of line virtual method, so the vtable, etc has a home.
- ~TerminatorInst();
-
- /// Virtual methods - Terminators should overload these and provide inline
- /// overrides of non-V methods.
- virtual BasicBlock *getSuccessorV(unsigned idx) const = 0;
- virtual unsigned getNumSuccessorsV() const = 0;
- virtual void setSuccessorV(unsigned idx, BasicBlock *B) = 0;
-public:
-
- virtual Instruction *clone() const = 0;
-
- /// getNumSuccessors - Return the number of successors that this terminator
- /// has.
- unsigned getNumSuccessors() const {
- return getNumSuccessorsV();
- }
-
- /// getSuccessor - Return the specified successor.
- ///
- BasicBlock *getSuccessor(unsigned idx) const {
- return getSuccessorV(idx);
- }
-
- /// setSuccessor - Update the specified successor to point at the provided
- /// block.
- void setSuccessor(unsigned idx, BasicBlock *B) {
- setSuccessorV(idx, B);
- }
-
- // Methods for support type inquiry through isa, cast, and dyn_cast:
- static inline bool classof(const TerminatorInst *) { return true; }
- static inline bool classof(const Instruction *I) {
- return I->getOpcode() >= TermOpsBegin && I->getOpcode() < TermOpsEnd;
- }
- static inline bool classof(const Value *V) {
- return isa<Instruction>(V) && classof(cast<Instruction>(V));
- }
-};
-
-//===----------------------------------------------------------------------===//
-// UnaryInstruction Class
-//===----------------------------------------------------------------------===//
-
-class UnaryInstruction : public Instruction {
- void *operator new(size_t, unsigned); // Do not implement
- Use Op;
-
- // avoiding warning: 'this' : used in base member initializer list
- UnaryInstruction* this_() { return this; }
-protected:
- UnaryInstruction(const Type *Ty, unsigned iType, Value *V, Instruction *IB =0)
- : Instruction(Ty, iType, &Op, 1, IB), Op(V, this_()) {
- }
- UnaryInstruction(const Type *Ty, unsigned iType, Value *V, BasicBlock *IAE)
- : Instruction(Ty, iType, &Op, 1, IAE), Op(V, this_()) {
- }
-public:
- // allocate space for exactly one operand
- void *operator new(size_t s) {
- return User::operator new(s, 1);
- }
-
- // Out of line virtual method, so the vtable, etc has a home.
- ~UnaryInstruction();
-
- // Transparently provide more efficient getOperand methods.
- Value *getOperand(unsigned i) const {
- assert(i == 0 && "getOperand() out of range!");
- return Op;
- }
- void setOperand(unsigned i, Value *Val) {
- assert(i == 0 && "setOperand() out of range!");
- Op = Val;
- }
- unsigned getNumOperands() const { return 1; }
-
- // Methods for support type inquiry through isa, cast, and dyn_cast:
- static inline bool classof(const UnaryInstruction *) { return true; }
- static inline bool classof(const Instruction *I) {
- return I->getOpcode() == Instruction::Malloc ||
- I->getOpcode() == Instruction::Alloca ||
- I->getOpcode() == Instruction::Free ||
- I->getOpcode() == Instruction::Load ||
- I->getOpcode() == Instruction::VAArg ||
- (I->getOpcode() >= CastOpsBegin && I->getOpcode() < CastOpsEnd);
- }
- static inline bool classof(const Value *V) {
- return isa<Instruction>(V) && classof(cast<Instruction>(V));
- }
-};
-
-//===----------------------------------------------------------------------===//
-// BinaryOperator Class
-//===----------------------------------------------------------------------===//
-
-class BinaryOperator : public Instruction {
- void *operator new(size_t, unsigned); // Do not implement
- Use Ops[2];
-protected:
- void init(BinaryOps iType);
- BinaryOperator(BinaryOps iType, Value *S1, Value *S2, const Type *Ty,
- const std::string &Name, Instruction *InsertBefore);
- BinaryOperator(BinaryOps iType, Value *S1, Value *S2, const Type *Ty,
- const std::string &Name, BasicBlock *InsertAtEnd);
-public:
- // allocate space for exactly two operands
- void *operator new(size_t s) {
- return User::operator new(s, 2);
- }
-
- /// Transparently provide more efficient getOperand methods.
- Value *getOperand(unsigned i) const {
- assert(i < 2 && "getOperand() out of range!");
- return Ops[i];
- }
- void setOperand(unsigned i, Value *Val) {
- assert(i < 2 && "setOperand() out of range!");
- Ops[i] = Val;
- }
- unsigned getNumOperands() const { return 2; }
-
- /// create() - Construct a binary instruction, given the opcode and the two
- /// operands. Optionally (if InstBefore is specified) insert the instruction
- /// into a BasicBlock right before the specified instruction. The specified
- /// Instruction is allowed to be a dereferenced end iterator.
- ///
- static BinaryOperator *create(BinaryOps Op, Value *S1, Value *S2,
- const std::string &Name = "",
- Instruction *InsertBefore = 0);
-
- /// create() - Construct a binary instruction, given the opcode and the two
- /// operands. Also automatically insert this instruction to the end of the
- /// BasicBlock specified.
- ///
- static BinaryOperator *create(BinaryOps Op, Value *S1, Value *S2,
- const std::string &Name,
- BasicBlock *InsertAtEnd);
-
- /// create* - These methods just forward to create, and are useful when you
- /// statically know what type of instruction you're going to create. These
- /// helpers just save some typing.
-#define HANDLE_BINARY_INST(N, OPC, CLASS) \
- static BinaryOperator *create##OPC(Value *V1, Value *V2, \
- const std::string &Name = "") {\
- return create(Instruction::OPC, V1, V2, Name);\
- }
-#include "llvm/Instruction.def"
-#define HANDLE_BINARY_INST(N, OPC, CLASS) \
- static BinaryOperator *create##OPC(Value *V1, Value *V2, \
- const std::string &Name, BasicBlock *BB) {\
- return create(Instruction::OPC, V1, V2, Name, BB);\
- }
-#include "llvm/Instruction.def"
-#define HANDLE_BINARY_INST(N, OPC, CLASS) \
- static BinaryOperator *create##OPC(Value *V1, Value *V2, \
- const std::string &Name, Instruction *I) {\
- return create(Instruction::OPC, V1, V2, Name, I);\
- }
-#include "llvm/Instruction.def"
-
-
- /// Helper functions to construct and inspect unary operations (NEG and NOT)
- /// via binary operators SUB and XOR:
- ///
- /// createNeg, createNot - Create the NEG and NOT
- /// instructions out of SUB and XOR instructions.
- ///
- static BinaryOperator *createNeg(Value *Op, const std::string &Name = "",
- Instruction *InsertBefore = 0);
- static BinaryOperator *createNeg(Value *Op, const std::string &Name,
- BasicBlock *InsertAtEnd);
- static BinaryOperator *createNot(Value *Op, const std::string &Name = "",
- Instruction *InsertBefore = 0);
- static BinaryOperator *createNot(Value *Op, const std::string &Name,
- BasicBlock *InsertAtEnd);
-
- /// isNeg, isNot - Check if the given Value is a NEG or NOT instruction.
- ///
- static bool isNeg(const Value *V);
- static bool isNot(const Value *V);
-
- /// getNegArgument, getNotArgument - Helper functions to extract the
- /// unary argument of a NEG or NOT operation implemented via Sub or Xor.
- ///
- static const Value *getNegArgument(const Value *BinOp);
- static Value *getNegArgument( Value *BinOp);
- static const Value *getNotArgument(const Value *BinOp);
- static Value *getNotArgument( Value *BinOp);
-
- BinaryOps getOpcode() const {
- return static_cast<BinaryOps>(Instruction::getOpcode());
- }
-
- virtual BinaryOperator *clone() const;
-
- /// swapOperands - Exchange the two operands to this instruction.
- /// This instruction is safe to use on any binary instruction and
- /// does not modify the semantics of the instruction. If the instruction
- /// cannot be reversed (ie, it's a Div), then return true.
- ///
- bool swapOperands();
-
- // Methods for support type inquiry through isa, cast, and dyn_cast:
- static inline bool classof(const BinaryOperator *) { return true; }
- static inline bool classof(const Instruction *I) {
- return I->getOpcode() >= BinaryOpsBegin && I->getOpcode() < BinaryOpsEnd;
- }
- static inline bool classof(const Value *V) {
- return isa<Instruction>(V) && classof(cast<Instruction>(V));
- }
-};
-
-//===----------------------------------------------------------------------===//
-// CastInst Class
-//===----------------------------------------------------------------------===//
-
-/// CastInst - This is the base class for all instructions that perform data
-/// casts. It is simply provided so that instruction category testing
-/// can be performed with code like:
-///
-/// if (isa<CastInst>(Instr)) { ... }
-/// @brief Base class of casting instructions.
-class CastInst : public UnaryInstruction {
- /// @brief Copy constructor
- CastInst(const CastInst &CI)
- : UnaryInstruction(CI.getType(), CI.getOpcode(), CI.getOperand(0)) {
- }
- /// @brief Do not allow default construction
- CastInst();
-protected:
- /// @brief Constructor with insert-before-instruction semantics for subclasses
- CastInst(const Type *Ty, unsigned iType, Value *S,
- const std::string &Name = "", Instruction *InsertBefore = 0)
- : UnaryInstruction(Ty, iType, S, InsertBefore) {
- setName(Name);
- }
- /// @brief Constructor with insert-at-end-of-block semantics for subclasses
- CastInst(const Type *Ty, unsigned iType, Value *S,
- const std::string &Name, BasicBlock *InsertAtEnd)
- : UnaryInstruction(Ty, iType, S, InsertAtEnd) {
- setName(Name);
- }
-public:
- /// Provides a way to construct any of the CastInst subclasses using an
- /// opcode instead of the subclass's constructor. The opcode must be in the
- /// CastOps category (Instruction::isCast(opcode) returns true). This
- /// constructor has insert-before-instruction semantics to automatically
- /// insert the new CastInst before InsertBefore (if it is non-null).
- /// @brief Construct any of the CastInst subclasses
- static CastInst *create(
- Instruction::CastOps, ///< The opcode of the cast instruction
- Value *S, ///< The value to be casted (operand 0)
- const Type *Ty, ///< The type to which cast should be made
- const std::string &Name = "", ///< Name for the instruction
- Instruction *InsertBefore = 0 ///< Place to insert the instruction
- );
- /// Provides a way to construct any of the CastInst subclasses using an
- /// opcode instead of the subclass's constructor. The opcode must be in the
- /// CastOps category. This constructor has insert-at-end-of-block semantics
- /// to automatically insert the new CastInst at the end of InsertAtEnd (if
- /// its non-null).
- /// @brief Construct any of the CastInst subclasses
- static CastInst *create(
- Instruction::CastOps, ///< The opcode for the cast instruction
- Value *S, ///< The value to be casted (operand 0)
- const Type *Ty, ///< The type to which operand is casted
- const std::string &Name, ///< The name for the instruction
- BasicBlock *InsertAtEnd ///< The block to insert the instruction into
- );
-
- /// @brief Create a ZExt or BitCast cast instruction
- static CastInst *createZExtOrBitCast(
- Value *S, ///< The value to be casted (operand 0)
- const Type *Ty, ///< The type to which cast should be made
- const std::string &Name = "", ///< Name for the instruction
- Instruction *InsertBefore = 0 ///< Place to insert the instruction
- );
-
- /// @brief Create a ZExt or BitCast cast instruction
- static CastInst *createZExtOrBitCast(
- Value *S, ///< The value to be casted (operand 0)
- const Type *Ty, ///< The type to which operand is casted
- const std::string &Name, ///< The name for the instruction
- BasicBlock *InsertAtEnd ///< The block to insert the instruction into
- );
-
- /// @brief Create a SExt or BitCast cast instruction
- static CastInst *createSExtOrBitCast(
- Value *S, ///< The value to be casted (operand 0)
- const Type *Ty, ///< The type to which cast should be made
- const std::string &Name = "", ///< Name for the instruction
- Instruction *InsertBefore = 0 ///< Place to insert the instruction
- );
-
- /// @brief Create a BitCast or a PtrToInt cast instruction
- static CastInst *createPointerCast(
- Value *S, ///< The pointer value to be casted (operand 0)
- const Type *Ty, ///< The type to which operand is casted
- const std::string &Name, ///< The name for the instruction
- BasicBlock *InsertAtEnd ///< The block to insert the instruction into
- );
-
- /// @brief Create a BitCast or a PtrToInt cast instruction
- static CastInst *createPointerCast(
- Value *S, ///< The pointer value to be casted (operand 0)
- const Type *Ty, ///< The type to which cast should be made
- const std::string &Name = "", ///< Name for the instruction
- Instruction *InsertBefore = 0 ///< Place to insert the instruction
- );
-
- /// @brief Create a ZExt, BitCast, or Trunc for int -> int casts.
- static CastInst *createIntegerCast(
- Value *S, ///< The pointer value to be casted (operand 0)
- const Type *Ty, ///< The type to which cast should be made
- bool isSigned, ///< Whether to regard S as signed or not
- const std::string &Name = "", ///< Name for the instruction
- Instruction *InsertBefore = 0 ///< Place to insert the instruction
- );
-
- /// @brief Create a ZExt, BitCast, or Trunc for int -> int casts.
- static CastInst *createIntegerCast(
- Value *S, ///< The integer value to be casted (operand 0)
- const Type *Ty, ///< The integer type to which operand is casted
- bool isSigned, ///< Whether to regard S as signed or not
- const std::string &Name, ///< The name for the instruction
- BasicBlock *InsertAtEnd ///< The block to insert the instruction into
- );
-
- /// @brief Create an FPExt, BitCast, or FPTrunc for fp -> fp casts
- static CastInst *createFPCast(
- Value *S, ///< The floating point value to be casted
- const Type *Ty, ///< The floating point type to cast to
- const std::string &Name = "", ///< Name for the instruction
- Instruction *InsertBefore = 0 ///< Place to insert the instruction
- );
-
- /// @brief Create an FPExt, BitCast, or FPTrunc for fp -> fp casts
- static CastInst *createFPCast(
- Value *S, ///< The floating point value to be casted
- const Type *Ty, ///< The floating point type to cast to
- const std::string &Name, ///< The name for the instruction
- BasicBlock *InsertAtEnd ///< The block to insert the instruction into
- );
-
- /// @brief Create a SExt or BitCast cast instruction
- static CastInst *createSExtOrBitCast(
- Value *S, ///< The value to be casted (operand 0)
- const Type *Ty, ///< The type to which operand is casted
- const std::string &Name, ///< The name for the instruction
- BasicBlock *InsertAtEnd ///< The block to insert the instruction into
- );
-
- /// @brief Create a Trunc or BitCast cast instruction
- static CastInst *createTruncOrBitCast(
- Value *S, ///< The value to be casted (operand 0)
- const Type *Ty, ///< The type to which cast should be made
- const std::string &Name = "", ///< Name for the instruction
- Instruction *InsertBefore = 0 ///< Place to insert the instruction
- );
-
- /// @brief Create a Trunc or BitCast cast instruction
- static CastInst *createTruncOrBitCast(
- Value *S, ///< The value to be casted (operand 0)
- const Type *Ty, ///< The type to which operand is casted
- const std::string &Name, ///< The name for the instruction
- BasicBlock *InsertAtEnd ///< The block to insert the instruction into
- );
-
- /// @brief Check whether it is valid to call getCastOpcode for these types.
- static bool isCastable(
- const Type *SrcTy, ///< The Type from which the value should be cast.
- const Type *DestTy ///< The Type to which the value should be cast.
- );
-
- /// Returns the opcode necessary to cast Val into Ty using usual casting
- /// rules.
- /// @brief Infer the opcode for cast operand and type
- static Instruction::CastOps getCastOpcode(
- const Value *Val, ///< The value to cast
- bool SrcIsSigned, ///< Whether to treat the source as signed
- const Type *Ty, ///< The Type to which the value should be casted
- bool DstIsSigned ///< Whether to treate the dest. as signed
- );
-
- /// There are several places where we need to know if a cast instruction
- /// only deals with integer source and destination types. To simplify that
- /// logic, this method is provided.
- /// @returns true iff the cast has only integral typed operand and dest type.
- /// @brief Determine if this is an integer-only cast.
- bool isIntegerCast() const;
-
- /// A lossless cast is one that does not alter the basic value. It implies
- /// a no-op cast but is more stringent, preventing things like int->float,
- /// long->double, int->ptr, or vector->anything.
- /// @returns true iff the cast is lossless.
- /// @brief Determine if this is a lossless cast.
- bool isLosslessCast() const;
-
- /// A no-op cast is one that can be effected without changing any bits.
- /// It implies that the source and destination types are the same size. The
- /// IntPtrTy argument is used to make accurate determinations for casts
- /// involving Integer and Pointer types. They are no-op casts if the integer
- /// is the same size as the pointer. However, pointer size varies with
- /// platform. Generally, the result of TargetData::getIntPtrType() should be
- /// passed in. If that's not available, use Type::Int64Ty, which will make
- /// the isNoopCast call conservative.
- /// @brief Determine if this cast is a no-op cast.
- bool isNoopCast(
- const Type *IntPtrTy ///< Integer type corresponding to pointer
- ) const;
-
- /// Determine how a pair of casts can be eliminated, if they can be at all.
- /// This is a helper function for both CastInst and ConstantExpr.
- /// @returns 0 if the CastInst pair can't be eliminated
- /// @returns Instruction::CastOps value for a cast that can replace
- /// the pair, casting SrcTy to DstTy.
- /// @brief Determine if a cast pair is eliminable
- static unsigned isEliminableCastPair(
- Instruction::CastOps firstOpcode, ///< Opcode of first cast
- Instruction::CastOps secondOpcode, ///< Opcode of second cast
- const Type *SrcTy, ///< SrcTy of 1st cast
- const Type *MidTy, ///< DstTy of 1st cast & SrcTy of 2nd cast
- const Type *DstTy, ///< DstTy of 2nd cast
- const Type *IntPtrTy ///< Integer type corresponding to Ptr types
- );
-
- /// @brief Return the opcode of this CastInst
- Instruction::CastOps getOpcode() const {
- return Instruction::CastOps(Instruction::getOpcode());
- }
-
- /// @brief Return the source type, as a convenience
- const Type* getSrcTy() const { return getOperand(0)->getType(); }
- /// @brief Return the destination type, as a convenience
- const Type* getDestTy() const { return getType(); }
-
- /// This method can be used to determine if a cast from S to DstTy using
- /// Opcode op is valid or not.
- /// @returns true iff the proposed cast is valid.
- /// @brief Determine if a cast is valid without creating one.
- static bool castIsValid(Instruction::CastOps op, Value *S, const Type *DstTy);
-
- /// @brief Methods for support type inquiry through isa, cast, and dyn_cast:
- static inline bool classof(const CastInst *) { return true; }
- static inline bool classof(const Instruction *I) {
- return I->getOpcode() >= CastOpsBegin && I->getOpcode() < CastOpsEnd;
- }
- static inline bool classof(const Value *V) {
- return isa<Instruction>(V) && classof(cast<Instruction>(V));
- }
-};
-
-//===----------------------------------------------------------------------===//
-// CmpInst Class
-//===----------------------------------------------------------------------===//
-
-/// This class is the base class for the comparison instructions.
-/// @brief Abstract base class of comparison instructions.
-class CmpInst: public Instruction {
- void *operator new(size_t, unsigned); // DO NOT IMPLEMENT
- CmpInst(); // do not implement
-protected:
- CmpInst(Instruction::OtherOps op, unsigned short pred, Value *LHS, Value *RHS,
- const std::string &Name = "", Instruction *InsertBefore = 0);
-
- CmpInst(Instruction::OtherOps op, unsigned short pred, Value *LHS, Value *RHS,
- const std::string &Name, BasicBlock *InsertAtEnd);
-
- Use Ops[2]; // CmpInst instructions always have 2 operands, optimize
-
-public:
- // allocate space for exactly two operands
- void *operator new(size_t s) {
- return User::operator new(s, 2);
- }
- /// Construct a compare instruction, given the opcode, the predicate and
- /// the two operands. Optionally (if InstBefore is specified) insert the
- /// instruction into a BasicBlock right before the specified instruction.
- /// The specified Instruction is allowed to be a dereferenced end iterator.
- /// @brief Create a CmpInst
- static CmpInst *create(OtherOps Op, unsigned short predicate, Value *S1,
- Value *S2, const std::string &Name = "",
- Instruction *InsertBefore = 0);
-
- /// Construct a compare instruction, given the opcode, the predicate and the
- /// two operands. Also automatically insert this instruction to the end of
- /// the BasicBlock specified.
- /// @brief Create a CmpInst
- static CmpInst *create(OtherOps Op, unsigned short predicate, Value *S1,
- Value *S2, const std::string &Name,
- BasicBlock *InsertAtEnd);
-
- /// @brief Get the opcode casted to the right type
- OtherOps getOpcode() const {
- return static_cast<OtherOps>(Instruction::getOpcode());
- }
-
- /// The predicate for CmpInst is defined by the subclasses but stored in
- /// the SubclassData field (see Value.h). We allow it to be fetched here
- /// as the predicate but there is no enum type for it, just the raw unsigned
- /// short. This facilitates comparison of CmpInst instances without delving
- /// into the subclasses since predicate values are distinct between the
- /// CmpInst subclasses.
- /// @brief Return the predicate for this instruction.
- unsigned short getPredicate() const {
- return SubclassData;
- }
-
- /// @brief Provide more efficient getOperand methods.
- Value *getOperand(unsigned i) const {
- assert(i < 2 && "getOperand() out of range!");
- return Ops[i];
- }
- void setOperand(unsigned i, Value *Val) {
- assert(i < 2 && "setOperand() out of range!");
- Ops[i] = Val;
- }
-
- /// @brief CmpInst instructions always have 2 operands.
- unsigned getNumOperands() const { return 2; }
-
- /// This is just a convenience that dispatches to the subclasses.
- /// @brief Swap the operands and adjust predicate accordingly to retain
- /// the same comparison.
- void swapOperands();
-
- /// This is just a convenience that dispatches to the subclasses.
- /// @brief Determine if this CmpInst is commutative.
- bool isCommutative();
-
- /// This is just a convenience that dispatches to the subclasses.
- /// @brief Determine if this is an equals/not equals predicate.
- bool isEquality();
-
- /// @returns true if the predicate is unsigned, false otherwise.
- /// @brief Determine if the predicate is an unsigned operation.
- static bool isUnsigned(unsigned short predicate);
-
- /// @returns true if the predicate is signed, false otherwise.
- /// @brief Determine if the predicate is an signed operation.
- static bool isSigned(unsigned short predicate);
-
- /// @brief Determine if the predicate is an ordered operation.
- static bool isOrdered(unsigned short predicate);
-
- /// @brief Determine if the predicate is an unordered operation.
- static bool isUnordered(unsigned short predicate);
-
- /// @brief Methods for support type inquiry through isa, cast, and dyn_cast:
- static inline bool classof(const CmpInst *) { return true; }
- static inline bool classof(const Instruction *I) {
- return I->getOpcode() == Instruction::ICmp ||
- I->getOpcode() == Instruction::FCmp;
- }
- static inline bool classof(const Value *V) {
- return isa<Instruction>(V) && classof(cast<Instruction>(V));
- }
-};
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/Instruction.def b/release_23/include/llvm/Instruction.def
deleted file mode 100644
index b8e16da1aca3..000000000000
--- a/release_23/include/llvm/Instruction.def
+++ /dev/null
@@ -1,193 +0,0 @@
-//===-- llvm/Instruction.def - File that describes Instructions -*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains descriptions of the various LLVM instructions. This is
-// used as a central place for enumerating the different instructions and
-// should eventually be the place to put comments about the instructions.
-//
-//===----------------------------------------------------------------------===//
-
-// NOTE: NO INCLUDE GUARD DESIRED!
-
-// Provide definitions of macros so that users of this file do not have to
-// define everything to use it...
-//
-#ifndef FIRST_TERM_INST
-#define FIRST_TERM_INST(num)
-#endif
-#ifndef HANDLE_TERM_INST
-#ifndef HANDLE_INST
-#define HANDLE_TERM_INST(num, opcode, Class)
-#else
-#define HANDLE_TERM_INST(num, opcode, Class) HANDLE_INST(num, opcode, Class)
-#endif
-#endif
-#ifndef LAST_TERM_INST
-#define LAST_TERM_INST(num)
-#endif
-
-#ifndef FIRST_BINARY_INST
-#define FIRST_BINARY_INST(num)
-#endif
-#ifndef HANDLE_BINARY_INST
-#ifndef HANDLE_INST
-#define HANDLE_BINARY_INST(num, opcode, instclass)
-#else
-#define HANDLE_BINARY_INST(num, opcode, Class) HANDLE_INST(num, opcode, Class)
-#endif
-#endif
-#ifndef LAST_BINARY_INST
-#define LAST_BINARY_INST(num)
-#endif
-
-#ifndef FIRST_MEMORY_INST
-#define FIRST_MEMORY_INST(num)
-#endif
-#ifndef HANDLE_MEMORY_INST
-#ifndef HANDLE_INST
-#define HANDLE_MEMORY_INST(num, opcode, Class)
-#else
-#define HANDLE_MEMORY_INST(num, opcode, Class) HANDLE_INST(num, opcode, Class)
-#endif
-#endif
-#ifndef LAST_MEMORY_INST
-#define LAST_MEMORY_INST(num)
-#endif
-
-#ifndef FIRST_CAST_INST
-#define FIRST_CAST_INST(num)
-#endif
-#ifndef HANDLE_CAST_INST
-#ifndef HANDLE_INST
-#define HANDLE_CAST_INST(num, opcode, Class)
-#else
-#define HANDLE_CAST_INST(num, opcode, Class) HANDLE_INST(num, opcode, Class)
-#endif
-#endif
-#ifndef LAST_CAST_INST
-#define LAST_CAST_INST(num)
-#endif
-
-#ifndef FIRST_OTHER_INST
-#define FIRST_OTHER_INST(num)
-#endif
-#ifndef HANDLE_OTHER_INST
-#ifndef HANDLE_INST
-#define HANDLE_OTHER_INST(num, opcode, Class)
-#else
-#define HANDLE_OTHER_INST(num, opcode, Class) HANDLE_INST(num, opcode, Class)
-#endif
-#endif
-#ifndef LAST_OTHER_INST
-#define LAST_OTHER_INST(num)
-#endif
-
-
-// Terminator Instructions - These instructions are used to terminate a basic
-// block of the program. Every basic block must end with one of these
-// instructions for it to be a well formed basic block.
-//
- FIRST_TERM_INST ( 1)
-HANDLE_TERM_INST ( 1, Ret , ReturnInst)
-HANDLE_TERM_INST ( 2, Br , BranchInst)
-HANDLE_TERM_INST ( 3, Switch , SwitchInst)
-HANDLE_TERM_INST ( 4, Invoke , InvokeInst)
-HANDLE_TERM_INST ( 5, Unwind , UnwindInst)
-HANDLE_TERM_INST ( 6, Unreachable, UnreachableInst)
- LAST_TERM_INST ( 6)
-
-// Standard binary operators...
- FIRST_BINARY_INST( 7)
-HANDLE_BINARY_INST( 7, Add , BinaryOperator)
-HANDLE_BINARY_INST( 8, Sub , BinaryOperator)
-HANDLE_BINARY_INST( 9, Mul , BinaryOperator)
-HANDLE_BINARY_INST(10, UDiv , BinaryOperator)
-HANDLE_BINARY_INST(11, SDiv , BinaryOperator)
-HANDLE_BINARY_INST(12, FDiv , BinaryOperator)
-HANDLE_BINARY_INST(13, URem , BinaryOperator)
-HANDLE_BINARY_INST(14, SRem , BinaryOperator)
-HANDLE_BINARY_INST(15, FRem , BinaryOperator)
-
-// Logical operators (integer operands)
-HANDLE_BINARY_INST(16, Shl , BinaryOperator) // Shift left (logical)
-HANDLE_BINARY_INST(17, LShr , BinaryOperator) // Shift right (logical)
-HANDLE_BINARY_INST(18, AShr , BinaryOperator) // shift right (arithmetic)
-HANDLE_BINARY_INST(19, And , BinaryOperator)
-HANDLE_BINARY_INST(20, Or , BinaryOperator)
-HANDLE_BINARY_INST(21, Xor , BinaryOperator)
- LAST_BINARY_INST(21)
-
-// Memory operators...
- FIRST_MEMORY_INST(22)
-HANDLE_MEMORY_INST(22, Malloc, MallocInst) // Heap management instructions
-HANDLE_MEMORY_INST(23, Free , FreeInst )
-HANDLE_MEMORY_INST(24, Alloca, AllocaInst) // Stack management
-HANDLE_MEMORY_INST(25, Load , LoadInst ) // Memory manipulation instrs
-HANDLE_MEMORY_INST(26, Store , StoreInst )
-HANDLE_MEMORY_INST(27, GetElementPtr, GetElementPtrInst)
- LAST_MEMORY_INST(27)
-
-// Cast operators ...
-// NOTE: The order matters here because CastInst::isEliminableCastPair
-// NOTE: (see Instructions.cpp) encodes a table based on this ordering.
- FIRST_CAST_INST(28)
-HANDLE_CAST_INST(28, Trunc , TruncInst ) // Truncate integers
-HANDLE_CAST_INST(29, ZExt , ZExtInst ) // Zero extend integers
-HANDLE_CAST_INST(30, SExt , SExtInst ) // Sign extend integers
-HANDLE_CAST_INST(31, FPToUI , FPToUIInst ) // floating point -> UInt
-HANDLE_CAST_INST(32, FPToSI , FPToSIInst ) // floating point -> SInt
-HANDLE_CAST_INST(33, UIToFP , UIToFPInst ) // UInt -> floating point
-HANDLE_CAST_INST(34, SIToFP , SIToFPInst ) // SInt -> floating point
-HANDLE_CAST_INST(35, FPTrunc , FPTruncInst ) // Truncate floating point
-HANDLE_CAST_INST(36, FPExt , FPExtInst ) // Extend floating point
-HANDLE_CAST_INST(37, PtrToInt, PtrToIntInst) // Pointer -> Integer
-HANDLE_CAST_INST(38, IntToPtr, IntToPtrInst) // Integer -> Pointer
-HANDLE_CAST_INST(39, BitCast , BitCastInst ) // Type cast
- LAST_CAST_INST(39)
-
-// Other operators...
- FIRST_OTHER_INST(40)
-HANDLE_OTHER_INST(40, ICmp , ICmpInst ) // Integer comparison instruction
-HANDLE_OTHER_INST(41, FCmp , FCmpInst ) // Floating point comparison instr.
-HANDLE_OTHER_INST(42, PHI , PHINode ) // PHI node instruction
-HANDLE_OTHER_INST(43, Call , CallInst ) // Call a function
-HANDLE_OTHER_INST(44, Select , SelectInst ) // select instruction
-HANDLE_OTHER_INST(45, UserOp1, Instruction) // May be used internally in a pass
-HANDLE_OTHER_INST(46, UserOp2, Instruction) // Internal to passes only
-HANDLE_OTHER_INST(47, VAArg , VAArgInst ) // vaarg instruction
-HANDLE_OTHER_INST(48, ExtractElement, ExtractElementInst)// extract from vector.
-HANDLE_OTHER_INST(49, InsertElement, InsertElementInst) // insert into vector
-HANDLE_OTHER_INST(50, ShuffleVector, ShuffleVectorInst) // shuffle two vectors.
-HANDLE_OTHER_INST(51, GetResult, GetResultInst) // Extract individual value
- //from aggregate result
- LAST_OTHER_INST(51)
-
-#undef FIRST_TERM_INST
-#undef HANDLE_TERM_INST
-#undef LAST_TERM_INST
-
-#undef FIRST_BINARY_INST
-#undef HANDLE_BINARY_INST
-#undef LAST_BINARY_INST
-
-#undef FIRST_MEMORY_INST
-#undef HANDLE_MEMORY_INST
-#undef LAST_MEMORY_INST
-
-#undef FIRST_CAST_INST
-#undef HANDLE_CAST_INST
-#undef LAST_CAST_INST
-
-#undef FIRST_OTHER_INST
-#undef HANDLE_OTHER_INST
-#undef LAST_OTHER_INST
-
-#ifdef HANDLE_INST
-#undef HANDLE_INST
-#endif
diff --git a/release_23/include/llvm/Instruction.h b/release_23/include/llvm/Instruction.h
deleted file mode 100644
index 29ae5c3cfbf5..000000000000
--- a/release_23/include/llvm/Instruction.h
+++ /dev/null
@@ -1,242 +0,0 @@
-//===-- llvm/Instruction.h - Instruction class definition -------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains the declaration of the Instruction class, which is the
-// base class for all of the LLVM instructions.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_INSTRUCTION_H
-#define LLVM_INSTRUCTION_H
-
-#include "llvm/User.h"
-
-namespace llvm {
-
-struct AssemblyAnnotationWriter;
-class BinaryOperator;
-
-template<typename ValueSubClass, typename ItemParentClass>
- class SymbolTableListTraits;
-
-class Instruction : public User {
- void operator=(const Instruction &); // Do not implement
- Instruction(const Instruction &); // Do not implement
-
- BasicBlock *Parent;
- Instruction *Prev, *Next; // Next and Prev links for our intrusive linked list
-
- void setNext(Instruction *N) { Next = N; }
- void setPrev(Instruction *N) { Prev = N; }
-
- friend class SymbolTableListTraits<Instruction, BasicBlock>;
- void setParent(BasicBlock *P);
-protected:
- Instruction(const Type *Ty, unsigned iType, Use *Ops, unsigned NumOps,
- Instruction *InsertBefore = 0);
- Instruction(const Type *Ty, unsigned iType, Use *Ops, unsigned NumOps,
- BasicBlock *InsertAtEnd);
-public:
- // Out of line virtual method, so the vtable, etc has a home.
- ~Instruction();
-
- /// mayWriteToMemory - Return true if this instruction may modify memory.
- ///
- bool mayWriteToMemory() const;
-
- /// mayReadFromMemory - Return true if this instruction may read memory.
- ///
- bool mayReadFromMemory() const;
-
- /// clone() - Create a copy of 'this' instruction that is identical in all
- /// ways except the following:
- /// * The instruction has no parent
- /// * The instruction has no name
- ///
- virtual Instruction *clone() const = 0;
-
- /// isIdenticalTo - Return true if the specified instruction is exactly
- /// identical to the current one. This means that all operands match and any
- /// extra information (e.g. load is volatile) agree.
- bool isIdenticalTo(Instruction *I) const;
-
- /// This function determines if the specified instruction executes the same
- /// operation as the current one. This means that the opcodes, type, operand
- /// types and any other factors affecting the operation must be the same. This
- /// is similar to isIdenticalTo except the operands themselves don't have to
- /// be identical.
- /// @returns true if the specified instruction is the same operation as
- /// the current one.
- /// @brief Determine if one instruction is the same operation as another.
- bool isSameOperationAs(Instruction *I) const;
-
- /// isUsedOutsideOfBlock - Return true if there are any uses of this
- /// instruction in blocks other than the specified block. Note that PHI nodes
- /// are considered to evaluate their operands in the corresponding predecessor
- /// block.
- bool isUsedOutsideOfBlock(const BasicBlock *BB) const;
-
-
- /// use_back - Specialize the methods defined in Value, as we know that an
- /// instruction can only be used by other instructions.
- Instruction *use_back() { return cast<Instruction>(*use_begin());}
- const Instruction *use_back() const { return cast<Instruction>(*use_begin());}
-
- // Accessor methods...
- //
- inline const BasicBlock *getParent() const { return Parent; }
- inline BasicBlock *getParent() { return Parent; }
-
- /// removeFromParent - This method unlinks 'this' from the containing basic
- /// block, but does not delete it.
- ///
- void removeFromParent();
-
- /// eraseFromParent - This method unlinks 'this' from the containing basic
- /// block and deletes it.
- ///
- void eraseFromParent();
-
- /// moveBefore - Unlink this instruction from its current basic block and
- /// insert it into the basic block that MovePos lives in, right before
- /// MovePos.
- void moveBefore(Instruction *MovePos);
-
- // ---------------------------------------------------------------------------
- /// Subclass classification... getOpcode() returns a member of
- /// one of the enums that is coming soon (down below)...
- ///
- unsigned getOpcode() const { return getValueID() - InstructionVal; }
- const char *getOpcodeName() const { return getOpcodeName(getOpcode()); }
- bool isTerminator() const { return isTerminator(getOpcode()); }
- bool isBinaryOp() const { return isBinaryOp(getOpcode()); }
- bool isShift() { return isShift(getOpcode()); }
- bool isCast() const { return isCast(getOpcode()); }
-
-
-
- static const char* getOpcodeName(unsigned OpCode);
-
- static inline bool isTerminator(unsigned OpCode) {
- return OpCode >= TermOpsBegin && OpCode < TermOpsEnd;
- }
-
- static inline bool isBinaryOp(unsigned Opcode) {
- return Opcode >= BinaryOpsBegin && Opcode < BinaryOpsEnd;
- }
-
- /// @brief Determine if the Opcode is one of the shift instructions.
- static inline bool isShift(unsigned Opcode) {
- return Opcode >= Shl && Opcode <= AShr;
- }
-
- /// isLogicalShift - Return true if this is a logical shift left or a logical
- /// shift right.
- inline bool isLogicalShift() const {
- return getOpcode() == Shl || getOpcode() == LShr;
- }
-
- /// isLogicalShift - Return true if this is a logical shift left or a logical
- /// shift right.
- inline bool isArithmeticShift() const {
- return getOpcode() == AShr;
- }
-
- /// @brief Determine if the OpCode is one of the CastInst instructions.
- static inline bool isCast(unsigned OpCode) {
- return OpCode >= CastOpsBegin && OpCode < CastOpsEnd;
- }
-
- /// isAssociative - Return true if the instruction is associative:
- ///
- /// Associative operators satisfy: x op (y op z) === (x op y) op z
- ///
- /// In LLVM, the Add, Mul, And, Or, and Xor operators are associative, when
- /// not applied to floating point types.
- ///
- bool isAssociative() const { return isAssociative(getOpcode(), getType()); }
- static bool isAssociative(unsigned op, const Type *Ty);
-
- /// isCommutative - Return true if the instruction is commutative:
- ///
- /// Commutative operators satisfy: (x op y) === (y op x)
- ///
- /// In LLVM, these are the associative operators, plus SetEQ and SetNE, when
- /// applied to any type.
- ///
- bool isCommutative() const { return isCommutative(getOpcode()); }
- static bool isCommutative(unsigned op);
-
- /// isTrappingInstruction - Return true if the instruction may trap.
- ///
- bool isTrapping() const {
- return isTrapping(getOpcode());
- }
- static bool isTrapping(unsigned op);
-
- virtual void print(std::ostream &OS) const { print(OS, 0); }
- void print(std::ostream *OS) const { if (OS) print(*OS); }
- void print(std::ostream &OS, AssemblyAnnotationWriter *AAW) const;
-
- /// Methods for support type inquiry through isa, cast, and dyn_cast:
- static inline bool classof(const Instruction *) { return true; }
- static inline bool classof(const Value *V) {
- return V->getValueID() >= Value::InstructionVal;
- }
-
- //----------------------------------------------------------------------
- // Exported enumerations...
- //
- enum TermOps { // These terminate basic blocks
-#define FIRST_TERM_INST(N) TermOpsBegin = N,
-#define HANDLE_TERM_INST(N, OPC, CLASS) OPC = N,
-#define LAST_TERM_INST(N) TermOpsEnd = N+1
-#include "llvm/Instruction.def"
- };
-
- enum BinaryOps {
-#define FIRST_BINARY_INST(N) BinaryOpsBegin = N,
-#define HANDLE_BINARY_INST(N, OPC, CLASS) OPC = N,
-#define LAST_BINARY_INST(N) BinaryOpsEnd = N+1
-#include "llvm/Instruction.def"
- };
-
- enum MemoryOps {
-#define FIRST_MEMORY_INST(N) MemoryOpsBegin = N,
-#define HANDLE_MEMORY_INST(N, OPC, CLASS) OPC = N,
-#define LAST_MEMORY_INST(N) MemoryOpsEnd = N+1
-#include "llvm/Instruction.def"
- };
-
- enum CastOps {
-#define FIRST_CAST_INST(N) CastOpsBegin = N,
-#define HANDLE_CAST_INST(N, OPC, CLASS) OPC = N,
-#define LAST_CAST_INST(N) CastOpsEnd = N+1
-#include "llvm/Instruction.def"
- };
-
- enum OtherOps {
-#define FIRST_OTHER_INST(N) OtherOpsBegin = N,
-#define HANDLE_OTHER_INST(N, OPC, CLASS) OPC = N,
-#define LAST_OTHER_INST(N) OtherOpsEnd = N+1
-#include "llvm/Instruction.def"
- };
-
-private:
- // getNext/Prev - Return the next or previous instruction in the list. The
- // last node in the list is a terminator instruction.
- Instruction *getNext() { return Next; }
- const Instruction *getNext() const { return Next; }
- Instruction *getPrev() { return Prev; }
- const Instruction *getPrev() const { return Prev; }
-};
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/Instructions.h b/release_23/include/llvm/Instructions.h
deleted file mode 100644
index f292a3173feb..000000000000
--- a/release_23/include/llvm/Instructions.h
+++ /dev/null
@@ -1,2624 +0,0 @@
-//===-- llvm/Instructions.h - Instruction subclass definitions --*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file exposes the class definitions of all of the subclasses of the
-// Instruction class. This is meant to be an easy way to get access to all
-// instruction subclasses.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_INSTRUCTIONS_H
-#define LLVM_INSTRUCTIONS_H
-
-#include <iterator>
-
-#include "llvm/InstrTypes.h"
-#include "llvm/DerivedTypes.h"
-#include "llvm/ParameterAttributes.h"
-
-namespace llvm {
-
-class BasicBlock;
-class ConstantInt;
-class PointerType;
-class VectorType;
-class ConstantRange;
-class APInt;
-
-//===----------------------------------------------------------------------===//
-// AllocationInst Class
-//===----------------------------------------------------------------------===//
-
-/// AllocationInst - This class is the common base class of MallocInst and
-/// AllocaInst.
-///
-class AllocationInst : public UnaryInstruction {
-protected:
- AllocationInst(const Type *Ty, Value *ArraySize, unsigned iTy, unsigned Align,
- const std::string &Name = "", Instruction *InsertBefore = 0);
- AllocationInst(const Type *Ty, Value *ArraySize, unsigned iTy, unsigned Align,
- const std::string &Name, BasicBlock *InsertAtEnd);
-public:
- // Out of line virtual method, so the vtable, etc. has a home.
- virtual ~AllocationInst();
-
- /// isArrayAllocation - Return true if there is an allocation size parameter
- /// to the allocation instruction that is not 1.
- ///
- bool isArrayAllocation() const;
-
- /// getArraySize - Get the number of element allocated, for a simple
- /// allocation of a single element, this will return a constant 1 value.
- ///
- const Value *getArraySize() const { return getOperand(0); }
- Value *getArraySize() { return getOperand(0); }
-
- /// getType - Overload to return most specific pointer type
- ///
- const PointerType *getType() const {
- return reinterpret_cast<const PointerType*>(Instruction::getType());
- }
-
- /// getAllocatedType - Return the type that is being allocated by the
- /// instruction.
- ///
- const Type *getAllocatedType() const;
-
- /// getAlignment - Return the alignment of the memory that is being allocated
- /// by the instruction.
- ///
- unsigned getAlignment() const { return (1u << SubclassData) >> 1; }
- void setAlignment(unsigned Align);
-
- virtual Instruction *clone() const = 0;
-
- // Methods for support type inquiry through isa, cast, and dyn_cast:
- static inline bool classof(const AllocationInst *) { return true; }
- static inline bool classof(const Instruction *I) {
- return I->getOpcode() == Instruction::Alloca ||
- I->getOpcode() == Instruction::Malloc;
- }
- static inline bool classof(const Value *V) {
- return isa<Instruction>(V) && classof(cast<Instruction>(V));
- }
-};
-
-
-//===----------------------------------------------------------------------===//
-// MallocInst Class
-//===----------------------------------------------------------------------===//
-
-/// MallocInst - an instruction to allocated memory on the heap
-///
-class MallocInst : public AllocationInst {
- MallocInst(const MallocInst &MI);
-public:
- explicit MallocInst(const Type *Ty, Value *ArraySize = 0,
- const std::string &Name = "",
- Instruction *InsertBefore = 0)
- : AllocationInst(Ty, ArraySize, Malloc, 0, Name, InsertBefore) {}
- MallocInst(const Type *Ty, Value *ArraySize, const std::string &Name,
- BasicBlock *InsertAtEnd)
- : AllocationInst(Ty, ArraySize, Malloc, 0, Name, InsertAtEnd) {}
-
- MallocInst(const Type *Ty, const std::string &Name,
- Instruction *InsertBefore = 0)
- : AllocationInst(Ty, 0, Malloc, 0, Name, InsertBefore) {}
- MallocInst(const Type *Ty, const std::string &Name, BasicBlock *InsertAtEnd)
- : AllocationInst(Ty, 0, Malloc, 0, Name, InsertAtEnd) {}
-
- MallocInst(const Type *Ty, Value *ArraySize, unsigned Align,
- const std::string &Name, BasicBlock *InsertAtEnd)
- : AllocationInst(Ty, ArraySize, Malloc, Align, Name, InsertAtEnd) {}
- MallocInst(const Type *Ty, Value *ArraySize, unsigned Align,
- const std::string &Name = "",
- Instruction *InsertBefore = 0)
- : AllocationInst(Ty, ArraySize, Malloc, Align, Name, InsertBefore) {}
-
- virtual MallocInst *clone() const;
-
- // Methods for support type inquiry through isa, cast, and dyn_cast:
- static inline bool classof(const MallocInst *) { return true; }
- static inline bool classof(const Instruction *I) {
- return (I->getOpcode() == Instruction::Malloc);
- }
- static inline bool classof(const Value *V) {
- return isa<Instruction>(V) && classof(cast<Instruction>(V));
- }
-};
-
-
-//===----------------------------------------------------------------------===//
-// AllocaInst Class
-//===----------------------------------------------------------------------===//
-
-/// AllocaInst - an instruction to allocate memory on the stack
-///
-class AllocaInst : public AllocationInst {
- AllocaInst(const AllocaInst &);
-public:
- explicit AllocaInst(const Type *Ty, Value *ArraySize = 0,
- const std::string &Name = "",
- Instruction *InsertBefore = 0)
- : AllocationInst(Ty, ArraySize, Alloca, 0, Name, InsertBefore) {}
- AllocaInst(const Type *Ty, Value *ArraySize, const std::string &Name,
- BasicBlock *InsertAtEnd)
- : AllocationInst(Ty, ArraySize, Alloca, 0, Name, InsertAtEnd) {}
-
- AllocaInst(const Type *Ty, const std::string &Name,
- Instruction *InsertBefore = 0)
- : AllocationInst(Ty, 0, Alloca, 0, Name, InsertBefore) {}
- AllocaInst(const Type *Ty, const std::string &Name, BasicBlock *InsertAtEnd)
- : AllocationInst(Ty, 0, Alloca, 0, Name, InsertAtEnd) {}
-
- AllocaInst(const Type *Ty, Value *ArraySize, unsigned Align,
- const std::string &Name = "", Instruction *InsertBefore = 0)
- : AllocationInst(Ty, ArraySize, Alloca, Align, Name, InsertBefore) {}
- AllocaInst(const Type *Ty, Value *ArraySize, unsigned Align,
- const std::string &Name, BasicBlock *InsertAtEnd)
- : AllocationInst(Ty, ArraySize, Alloca, Align, Name, InsertAtEnd) {}
-
- virtual AllocaInst *clone() const;
-
- // Methods for support type inquiry through isa, cast, and dyn_cast:
- static inline bool classof(const AllocaInst *) { return true; }
- static inline bool classof(const Instruction *I) {
- return (I->getOpcode() == Instruction::Alloca);
- }
- static inline bool classof(const Value *V) {
- return isa<Instruction>(V) && classof(cast<Instruction>(V));
- }
-};
-
-
-//===----------------------------------------------------------------------===//
-// FreeInst Class
-//===----------------------------------------------------------------------===//
-
-/// FreeInst - an instruction to deallocate memory
-///
-class FreeInst : public UnaryInstruction {
- void AssertOK();
-public:
- explicit FreeInst(Value *Ptr, Instruction *InsertBefore = 0);
- FreeInst(Value *Ptr, BasicBlock *InsertAfter);
-
- virtual FreeInst *clone() const;
-
- // Accessor methods for consistency with other memory operations
- Value *getPointerOperand() { return getOperand(0); }
- const Value *getPointerOperand() const { return getOperand(0); }
-
- // Methods for support type inquiry through isa, cast, and dyn_cast:
- static inline bool classof(const FreeInst *) { return true; }
- static inline bool classof(const Instruction *I) {
- return (I->getOpcode() == Instruction::Free);
- }
- static inline bool classof(const Value *V) {
- return isa<Instruction>(V) && classof(cast<Instruction>(V));
- }
-};
-
-
-//===----------------------------------------------------------------------===//
-// LoadInst Class
-//===----------------------------------------------------------------------===//
-
-/// LoadInst - an instruction for reading from memory. This uses the
-/// SubclassData field in Value to store whether or not the load is volatile.
-///
-class LoadInst : public UnaryInstruction {
-
- LoadInst(const LoadInst &LI)
- : UnaryInstruction(LI.getType(), Load, LI.getOperand(0)) {
- setVolatile(LI.isVolatile());
- setAlignment(LI.getAlignment());
-
-#ifndef NDEBUG
- AssertOK();
-#endif
- }
- void AssertOK();
-public:
- LoadInst(Value *Ptr, const std::string &Name, Instruction *InsertBefore);
- LoadInst(Value *Ptr, const std::string &Name, BasicBlock *InsertAtEnd);
- LoadInst(Value *Ptr, const std::string &Name, bool isVolatile = false,
- Instruction *InsertBefore = 0);
- LoadInst(Value *Ptr, const std::string &Name, bool isVolatile, unsigned Align,
- Instruction *InsertBefore = 0);
- LoadInst(Value *Ptr, const std::string &Name, bool isVolatile,
- BasicBlock *InsertAtEnd);
- LoadInst(Value *Ptr, const std::string &Name, bool isVolatile, unsigned Align,
- BasicBlock *InsertAtEnd);
-
- LoadInst(Value *Ptr, const char *Name, Instruction *InsertBefore);
- LoadInst(Value *Ptr, const char *Name, BasicBlock *InsertAtEnd);
- explicit LoadInst(Value *Ptr, const char *Name = 0, bool isVolatile = false,
- Instruction *InsertBefore = 0);
- LoadInst(Value *Ptr, const char *Name, bool isVolatile,
- BasicBlock *InsertAtEnd);
-
- /// isVolatile - Return true if this is a load from a volatile memory
- /// location.
- ///
- bool isVolatile() const { return SubclassData & 1; }
-
- /// setVolatile - Specify whether this is a volatile load or not.
- ///
- void setVolatile(bool V) {
- SubclassData = (SubclassData & ~1) | (V ? 1 : 0);
- }
-
- virtual LoadInst *clone() const;
-
- /// getAlignment - Return the alignment of the access that is being performed
- ///
- unsigned getAlignment() const {
- return (1 << (SubclassData>>1)) >> 1;
- }
-
- void setAlignment(unsigned Align);
-
- Value *getPointerOperand() { return getOperand(0); }
- const Value *getPointerOperand() const { return getOperand(0); }
- static unsigned getPointerOperandIndex() { return 0U; }
-
- // Methods for support type inquiry through isa, cast, and dyn_cast:
- static inline bool classof(const LoadInst *) { return true; }
- static inline bool classof(const Instruction *I) {
- return I->getOpcode() == Instruction::Load;
- }
- static inline bool classof(const Value *V) {
- return isa<Instruction>(V) && classof(cast<Instruction>(V));
- }
-};
-
-
-//===----------------------------------------------------------------------===//
-// StoreInst Class
-//===----------------------------------------------------------------------===//
-
-/// StoreInst - an instruction for storing to memory
-///
-class StoreInst : public Instruction {
- void *operator new(size_t, unsigned); // DO NOT IMPLEMENT
- Use Ops[2];
-
- StoreInst(const StoreInst &SI) : Instruction(SI.getType(), Store, Ops, 2) {
- Ops[0].init(SI.Ops[0], this);
- Ops[1].init(SI.Ops[1], this);
- setVolatile(SI.isVolatile());
- setAlignment(SI.getAlignment());
-
-#ifndef NDEBUG
- AssertOK();
-#endif
- }
- void AssertOK();
-public:
- // allocate space for exactly two operands
- void *operator new(size_t s) {
- return User::operator new(s, 2);
- }
- StoreInst(Value *Val, Value *Ptr, Instruction *InsertBefore);
- StoreInst(Value *Val, Value *Ptr, BasicBlock *InsertAtEnd);
- StoreInst(Value *Val, Value *Ptr, bool isVolatile = false,
- Instruction *InsertBefore = 0);
- StoreInst(Value *Val, Value *Ptr, bool isVolatile,
- unsigned Align, Instruction *InsertBefore = 0);
- StoreInst(Value *Val, Value *Ptr, bool isVolatile, BasicBlock *InsertAtEnd);
- StoreInst(Value *Val, Value *Ptr, bool isVolatile,
- unsigned Align, BasicBlock *InsertAtEnd);
-
-
- /// isVolatile - Return true if this is a load from a volatile memory
- /// location.
- ///
- bool isVolatile() const { return SubclassData & 1; }
-
- /// setVolatile - Specify whether this is a volatile load or not.
- ///
- void setVolatile(bool V) {
- SubclassData = (SubclassData & ~1) | (V ? 1 : 0);
- }
-
- /// Transparently provide more efficient getOperand methods.
- Value *getOperand(unsigned i) const {
- assert(i < 2 && "getOperand() out of range!");
- return Ops[i];
- }
- void setOperand(unsigned i, Value *Val) {
- assert(i < 2 && "setOperand() out of range!");
- Ops[i] = Val;
- }
- unsigned getNumOperands() const { return 2; }
-
- /// getAlignment - Return the alignment of the access that is being performed
- ///
- unsigned getAlignment() const {
- return (1 << (SubclassData>>1)) >> 1;
- }
-
- void setAlignment(unsigned Align);
-
- virtual StoreInst *clone() const;
-
- Value *getPointerOperand() { return getOperand(1); }
- const Value *getPointerOperand() const { return getOperand(1); }
- static unsigned getPointerOperandIndex() { return 1U; }
-
- // Methods for support type inquiry through isa, cast, and dyn_cast:
- static inline bool classof(const StoreInst *) { return true; }
- static inline bool classof(const Instruction *I) {
- return I->getOpcode() == Instruction::Store;
- }
- static inline bool classof(const Value *V) {
- return isa<Instruction>(V) && classof(cast<Instruction>(V));
- }
-};
-
-
-//===----------------------------------------------------------------------===//
-// GetElementPtrInst Class
-//===----------------------------------------------------------------------===//
-
-// checkType - Simple wrapper function to give a better assertion failure
-// message on bad indexes for a gep instruction.
-//
-static inline const Type *checkType(const Type *Ty) {
- assert(Ty && "Invalid GetElementPtrInst indices for type!");
- return Ty;
-}
-
-/// GetElementPtrInst - an instruction for type-safe pointer arithmetic to
-/// access elements of arrays and structs
-///
-class GetElementPtrInst : public Instruction {
- GetElementPtrInst(const GetElementPtrInst &GEPI)
- : Instruction(reinterpret_cast<const Type*>(GEPI.getType()), GetElementPtr,
- 0, GEPI.getNumOperands()) {
- Use *OL = OperandList = new Use[NumOperands];
- Use *GEPIOL = GEPI.OperandList;
- for (unsigned i = 0, E = NumOperands; i != E; ++i)
- OL[i].init(GEPIOL[i], this);
- }
- void init(Value *Ptr, Value* const *Idx, unsigned NumIdx);
- void init(Value *Ptr, Value *Idx);
-
- template<typename InputIterator>
- void init(Value *Ptr, InputIterator IdxBegin, InputIterator IdxEnd,
- const std::string &Name,
- // This argument ensures that we have an iterator we can
- // do arithmetic on in constant time
- std::random_access_iterator_tag) {
- unsigned NumIdx = static_cast<unsigned>(std::distance(IdxBegin, IdxEnd));
-
- if (NumIdx > 0) {
- // This requires that the itoerator points to contiguous memory.
- init(Ptr, &*IdxBegin, NumIdx);
- }
- else {
- init(Ptr, 0, NumIdx);
- }
-
- setName(Name);
- }
-
- /// getIndexedType - Returns the type of the element that would be loaded with
- /// a load instruction with the specified parameters.
- ///
- /// A null type is returned if the indices are invalid for the specified
- /// pointer type.
- ///
- static const Type *getIndexedType(const Type *Ptr,
- Value* const *Idx, unsigned NumIdx,
- bool AllowStructLeaf = false);
-
- template<typename InputIterator>
- static const Type *getIndexedType(const Type *Ptr,
- InputIterator IdxBegin,
- InputIterator IdxEnd,
- bool AllowStructLeaf,
- // This argument ensures that we
- // have an iterator we can do
- // arithmetic on in constant time
- std::random_access_iterator_tag) {
- unsigned NumIdx = static_cast<unsigned>(std::distance(IdxBegin, IdxEnd));
-
- if (NumIdx > 0) {
- // This requires that the iterator points to contiguous memory.
- return(getIndexedType(Ptr, (Value *const *)&*IdxBegin, NumIdx,
- AllowStructLeaf));
- }
- else {
- return(getIndexedType(Ptr, (Value *const*)0, NumIdx, AllowStructLeaf));
- }
- }
-
- /// Constructors - Create a getelementptr instruction with a base pointer an
- /// list of indices. The first ctor can optionally insert before an existing
- /// instruction, the second appends the new instruction to the specified
- /// BasicBlock.
- template<typename InputIterator>
- GetElementPtrInst(Value *Ptr, InputIterator IdxBegin,
- InputIterator IdxEnd,
- const std::string &Name = "",
- Instruction *InsertBefore = 0)
- : Instruction(PointerType::get(
- checkType(getIndexedType(Ptr->getType(),
- IdxBegin, IdxEnd, true)),
- cast<PointerType>(Ptr->getType())->getAddressSpace()),
- GetElementPtr, 0, 0, InsertBefore) {
- init(Ptr, IdxBegin, IdxEnd, Name,
- typename std::iterator_traits<InputIterator>::iterator_category());
- }
- template<typename InputIterator>
- GetElementPtrInst(Value *Ptr, InputIterator IdxBegin, InputIterator IdxEnd,
- const std::string &Name, BasicBlock *InsertAtEnd)
- : Instruction(PointerType::get(
- checkType(getIndexedType(Ptr->getType(),
- IdxBegin, IdxEnd, true)),
- cast<PointerType>(Ptr->getType())->getAddressSpace()),
- GetElementPtr, 0, 0, InsertAtEnd) {
- init(Ptr, IdxBegin, IdxEnd, Name,
- typename std::iterator_traits<InputIterator>::iterator_category());
- }
-
- /// Constructors - These two constructors are convenience methods because one
- /// and two index getelementptr instructions are so common.
- GetElementPtrInst(Value *Ptr, Value *Idx,
- const std::string &Name = "", Instruction *InsertBefore = 0);
- GetElementPtrInst(Value *Ptr, Value *Idx,
- const std::string &Name, BasicBlock *InsertAtEnd);
-public:
- template<typename InputIterator>
- static GetElementPtrInst *Create(Value *Ptr, InputIterator IdxBegin,
- InputIterator IdxEnd,
- const std::string &Name = "",
- Instruction *InsertBefore = 0) {
- return new(0/*FIXME*/) GetElementPtrInst(Ptr, IdxBegin, IdxEnd, Name, InsertBefore);
- }
- template<typename InputIterator>
- static GetElementPtrInst *Create(Value *Ptr, InputIterator IdxBegin, InputIterator IdxEnd,
- const std::string &Name, BasicBlock *InsertAtEnd) {
- return new(0/*FIXME*/) GetElementPtrInst(Ptr, IdxBegin, IdxEnd, Name, InsertAtEnd);
- }
-
- /// Constructors - These two constructors are convenience methods because one
- /// and two index getelementptr instructions are so common.
- static GetElementPtrInst *Create(Value *Ptr, Value *Idx,
- const std::string &Name = "", Instruction *InsertBefore = 0) {
- return new(2/*FIXME*/) GetElementPtrInst(Ptr, Idx, Name, InsertBefore);
- }
- static GetElementPtrInst *Create(Value *Ptr, Value *Idx,
- const std::string &Name, BasicBlock *InsertAtEnd) {
- return new(2/*FIXME*/) GetElementPtrInst(Ptr, Idx, Name, InsertAtEnd);
- }
- ~GetElementPtrInst();
-
- virtual GetElementPtrInst *clone() const;
-
- // getType - Overload to return most specific pointer type...
- const PointerType *getType() const {
- return reinterpret_cast<const PointerType*>(Instruction::getType());
- }
-
- /// getIndexedType - Returns the type of the element that would be loaded with
- /// a load instruction with the specified parameters.
- ///
- /// A null type is returned if the indices are invalid for the specified
- /// pointer type.
- ///
- template<typename InputIterator>
- static const Type *getIndexedType(const Type *Ptr,
- InputIterator IdxBegin,
- InputIterator IdxEnd,
- bool AllowStructLeaf = false) {
- return(getIndexedType(Ptr, IdxBegin, IdxEnd, AllowStructLeaf,
- typename std::iterator_traits<InputIterator>::
- iterator_category()));
- }
- static const Type *getIndexedType(const Type *Ptr, Value *Idx);
-
- inline op_iterator idx_begin() { return op_begin()+1; }
- inline const_op_iterator idx_begin() const { return op_begin()+1; }
- inline op_iterator idx_end() { return op_end(); }
- inline const_op_iterator idx_end() const { return op_end(); }
-
- Value *getPointerOperand() {
- return getOperand(0);
- }
- const Value *getPointerOperand() const {
- return getOperand(0);
- }
- static unsigned getPointerOperandIndex() {
- return 0U; // get index for modifying correct operand
- }
-
- unsigned getNumIndices() const { // Note: always non-negative
- return getNumOperands() - 1;
- }
-
- bool hasIndices() const {
- return getNumOperands() > 1;
- }
-
- /// hasAllZeroIndices - Return true if all of the indices of this GEP are
- /// zeros. If so, the result pointer and the first operand have the same
- /// value, just potentially different types.
- bool hasAllZeroIndices() const;
-
- /// hasAllConstantIndices - Return true if all of the indices of this GEP are
- /// constant integers. If so, the result pointer and the first operand have
- /// a constant offset between them.
- bool hasAllConstantIndices() const;
-
-
- // Methods for support type inquiry through isa, cast, and dyn_cast:
- static inline bool classof(const GetElementPtrInst *) { return true; }
- static inline bool classof(const Instruction *I) {
- return (I->getOpcode() == Instruction::GetElementPtr);
- }
- static inline bool classof(const Value *V) {
- return isa<Instruction>(V) && classof(cast<Instruction>(V));
- }
-};
-
-//===----------------------------------------------------------------------===//
-// ICmpInst Class
-//===----------------------------------------------------------------------===//
-
-/// This instruction compares its operands according to the predicate given
-/// to the constructor. It only operates on integers, pointers, or packed
-/// vectors of integrals. The two operands must be the same type.
-/// @brief Represent an integer comparison operator.
-class ICmpInst: public CmpInst {
-public:
- /// This enumeration lists the possible predicates for the ICmpInst. The
- /// values in the range 0-31 are reserved for FCmpInst while values in the
- /// range 32-64 are reserved for ICmpInst. This is necessary to ensure the
- /// predicate values are not overlapping between the classes.
- enum Predicate {
- ICMP_EQ = 32, ///< equal
- ICMP_NE = 33, ///< not equal
- ICMP_UGT = 34, ///< unsigned greater than
- ICMP_UGE = 35, ///< unsigned greater or equal
- ICMP_ULT = 36, ///< unsigned less than
- ICMP_ULE = 37, ///< unsigned less or equal
- ICMP_SGT = 38, ///< signed greater than
- ICMP_SGE = 39, ///< signed greater or equal
- ICMP_SLT = 40, ///< signed less than
- ICMP_SLE = 41, ///< signed less or equal
- FIRST_ICMP_PREDICATE = ICMP_EQ,
- LAST_ICMP_PREDICATE = ICMP_SLE,
- BAD_ICMP_PREDICATE = ICMP_SLE + 1
- };
-
- /// @brief Constructor with insert-before-instruction semantics.
- ICmpInst(
- Predicate pred, ///< The predicate to use for the comparison
- Value *LHS, ///< The left-hand-side of the expression
- Value *RHS, ///< The right-hand-side of the expression
- const std::string &Name = "", ///< Name of the instruction
- Instruction *InsertBefore = 0 ///< Where to insert
- ) : CmpInst(Instruction::ICmp, pred, LHS, RHS, Name, InsertBefore) {
- }
-
- /// @brief Constructor with insert-at-block-end semantics.
- ICmpInst(
- Predicate pred, ///< The predicate to use for the comparison
- Value *LHS, ///< The left-hand-side of the expression
- Value *RHS, ///< The right-hand-side of the expression
- const std::string &Name, ///< Name of the instruction
- BasicBlock *InsertAtEnd ///< Block to insert into.
- ) : CmpInst(Instruction::ICmp, pred, LHS, RHS, Name, InsertAtEnd) {
- }
-
- /// @brief Return the predicate for this instruction.
- Predicate getPredicate() const { return Predicate(SubclassData); }
-
- /// @brief Set the predicate for this instruction to the specified value.
- void setPredicate(Predicate P) { SubclassData = P; }
-
- /// For example, EQ -> NE, UGT -> ULE, SLT -> SGE, etc.
- /// @returns the inverse predicate for the instruction's current predicate.
- /// @brief Return the inverse of the instruction's predicate.
- Predicate getInversePredicate() const {
- return getInversePredicate(getPredicate());
- }
-
- /// For example, EQ -> NE, UGT -> ULE, SLT -> SGE, etc.
- /// @returns the inverse predicate for predicate provided in \p pred.
- /// @brief Return the inverse of a given predicate
- static Predicate getInversePredicate(Predicate pred);
-
- /// For example, EQ->EQ, SLE->SGE, ULT->UGT, etc.
- /// @returns the predicate that would be the result of exchanging the two
- /// operands of the ICmpInst instruction without changing the result
- /// produced.
- /// @brief Return the predicate as if the operands were swapped
- Predicate getSwappedPredicate() const {
- return getSwappedPredicate(getPredicate());
- }
-
- /// This is a static version that you can use without an instruction
- /// available.
- /// @brief Return the predicate as if the operands were swapped.
- static Predicate getSwappedPredicate(Predicate pred);
-
- /// For example, EQ->EQ, SLE->SLE, UGT->SGT, etc.
- /// @returns the predicate that would be the result if the operand were
- /// regarded as signed.
- /// @brief Return the signed version of the predicate
- Predicate getSignedPredicate() const {
- return getSignedPredicate(getPredicate());
- }
-
- /// This is a static version that you can use without an instruction.
- /// @brief Return the signed version of the predicate.
- static Predicate getSignedPredicate(Predicate pred);
-
- /// For example, EQ->EQ, SLE->ULE, UGT->UGT, etc.
- /// @returns the predicate that would be the result if the operand were
- /// regarded as unsigned.
- /// @brief Return the unsigned version of the predicate
- Predicate getUnsignedPredicate() const {
- return getUnsignedPredicate(getPredicate());
- }
-
- /// This is a static version that you can use without an instruction.
- /// @brief Return the unsigned version of the predicate.
- static Predicate getUnsignedPredicate(Predicate pred);
-
- /// isEquality - Return true if this predicate is either EQ or NE. This also
- /// tests for commutativity.
- static bool isEquality(Predicate P) {
- return P == ICMP_EQ || P == ICMP_NE;
- }
-
- /// isEquality - Return true if this predicate is either EQ or NE. This also
- /// tests for commutativity.
- bool isEquality() const {
- return isEquality(getPredicate());
- }
-
- /// @returns true if the predicate of this ICmpInst is commutative
- /// @brief Determine if this relation is commutative.
- bool isCommutative() const { return isEquality(); }
-
- /// isRelational - Return true if the predicate is relational (not EQ or NE).
- ///
- bool isRelational() const {
- return !isEquality();
- }
-
- /// isRelational - Return true if the predicate is relational (not EQ or NE).
- ///
- static bool isRelational(Predicate P) {
- return !isEquality(P);
- }
-
- /// @returns true if the predicate of this ICmpInst is signed, false otherwise
- /// @brief Determine if this instruction's predicate is signed.
- bool isSignedPredicate() const { return isSignedPredicate(getPredicate()); }
-
- /// @returns true if the predicate provided is signed, false otherwise
- /// @brief Determine if the predicate is signed.
- static bool isSignedPredicate(Predicate pred);
-
- /// Initialize a set of values that all satisfy the predicate with C.
- /// @brief Make a ConstantRange for a relation with a constant value.
- static ConstantRange makeConstantRange(Predicate pred, const APInt &C);
-
- /// Exchange the two operands to this instruction in such a way that it does
- /// not modify the semantics of the instruction. The predicate value may be
- /// changed to retain the same result if the predicate is order dependent
- /// (e.g. ult).
- /// @brief Swap operands and adjust predicate.
- void swapOperands() {
- SubclassData = getSwappedPredicate();
- std::swap(Ops[0], Ops[1]);
- }
-
- virtual ICmpInst *clone() const;
-
- // Methods for support type inquiry through isa, cast, and dyn_cast:
- static inline bool classof(const ICmpInst *) { return true; }
- static inline bool classof(const Instruction *I) {
- return I->getOpcode() == Instruction::ICmp;
- }
- static inline bool classof(const Value *V) {
- return isa<Instruction>(V) && classof(cast<Instruction>(V));
- }
-};
-
-//===----------------------------------------------------------------------===//
-// FCmpInst Class
-//===----------------------------------------------------------------------===//
-
-/// This instruction compares its operands according to the predicate given
-/// to the constructor. It only operates on floating point values or packed
-/// vectors of floating point values. The operands must be identical types.
-/// @brief Represents a floating point comparison operator.
-class FCmpInst: public CmpInst {
-public:
- /// This enumeration lists the possible predicates for the FCmpInst. Values
- /// in the range 0-31 are reserved for FCmpInst.
- enum Predicate {
- // Opcode U L G E Intuitive operation
- FCMP_FALSE = 0, ///< 0 0 0 0 Always false (always folded)
- FCMP_OEQ = 1, ///< 0 0 0 1 True if ordered and equal
- FCMP_OGT = 2, ///< 0 0 1 0 True if ordered and greater than
- FCMP_OGE = 3, ///< 0 0 1 1 True if ordered and greater than or equal
- FCMP_OLT = 4, ///< 0 1 0 0 True if ordered and less than
- FCMP_OLE = 5, ///< 0 1 0 1 True if ordered and less than or equal
- FCMP_ONE = 6, ///< 0 1 1 0 True if ordered and operands are unequal
- FCMP_ORD = 7, ///< 0 1 1 1 True if ordered (no nans)
- FCMP_UNO = 8, ///< 1 0 0 0 True if unordered: isnan(X) | isnan(Y)
- FCMP_UEQ = 9, ///< 1 0 0 1 True if unordered or equal
- FCMP_UGT =10, ///< 1 0 1 0 True if unordered or greater than
- FCMP_UGE =11, ///< 1 0 1 1 True if unordered, greater than, or equal
- FCMP_ULT =12, ///< 1 1 0 0 True if unordered or less than
- FCMP_ULE =13, ///< 1 1 0 1 True if unordered, less than, or equal
- FCMP_UNE =14, ///< 1 1 1 0 True if unordered or not equal
- FCMP_TRUE =15, ///< 1 1 1 1 Always true (always folded)
- FIRST_FCMP_PREDICATE = FCMP_FALSE,
- LAST_FCMP_PREDICATE = FCMP_TRUE,
- BAD_FCMP_PREDICATE = FCMP_TRUE + 1
- };
-
- /// @brief Constructor with insert-before-instruction semantics.
- FCmpInst(
- Predicate pred, ///< The predicate to use for the comparison
- Value *LHS, ///< The left-hand-side of the expression
- Value *RHS, ///< The right-hand-side of the expression
- const std::string &Name = "", ///< Name of the instruction
- Instruction *InsertBefore = 0 ///< Where to insert
- ) : CmpInst(Instruction::FCmp, pred, LHS, RHS, Name, InsertBefore) {
- }
-
- /// @brief Constructor with insert-at-block-end semantics.
- FCmpInst(
- Predicate pred, ///< The predicate to use for the comparison
- Value *LHS, ///< The left-hand-side of the expression
- Value *RHS, ///< The right-hand-side of the expression
- const std::string &Name, ///< Name of the instruction
- BasicBlock *InsertAtEnd ///< Block to insert into.
- ) : CmpInst(Instruction::FCmp, pred, LHS, RHS, Name, InsertAtEnd) {
- }
-
- /// @brief Return the predicate for this instruction.
- Predicate getPredicate() const { return Predicate(SubclassData); }
-
- /// @brief Set the predicate for this instruction to the specified value.
- void setPredicate(Predicate P) { SubclassData = P; }
-
- /// For example, OEQ -> UNE, UGT -> OLE, OLT -> UGE, etc.
- /// @returns the inverse predicate for the instructions current predicate.
- /// @brief Return the inverse of the predicate
- Predicate getInversePredicate() const {
- return getInversePredicate(getPredicate());
- }
-
- /// For example, OEQ -> UNE, UGT -> OLE, OLT -> UGE, etc.
- /// @returns the inverse predicate for \p pred.
- /// @brief Return the inverse of a given predicate
- static Predicate getInversePredicate(Predicate pred);
-
- /// For example, OEQ->OEQ, ULE->UGE, OLT->OGT, etc.
- /// @returns the predicate that would be the result of exchanging the two
- /// operands of the ICmpInst instruction without changing the result
- /// produced.
- /// @brief Return the predicate as if the operands were swapped
- Predicate getSwappedPredicate() const {
- return getSwappedPredicate(getPredicate());
- }
-
- /// This is a static version that you can use without an instruction
- /// available.
- /// @brief Return the predicate as if the operands were swapped.
- static Predicate getSwappedPredicate(Predicate Opcode);
-
- /// This also tests for commutativity. If isEquality() returns true then
- /// the predicate is also commutative. Only the equality predicates are
- /// commutative.
- /// @returns true if the predicate of this instruction is EQ or NE.
- /// @brief Determine if this is an equality predicate.
- bool isEquality() const {
- return SubclassData == FCMP_OEQ || SubclassData == FCMP_ONE ||
- SubclassData == FCMP_UEQ || SubclassData == FCMP_UNE;
- }
- bool isCommutative() const { return isEquality(); }
-
- /// @returns true if the predicate is relational (not EQ or NE).
- /// @brief Determine if this a relational predicate.
- bool isRelational() const { return !isEquality(); }
-
- /// Exchange the two operands to this instruction in such a way that it does
- /// not modify the semantics of the instruction. The predicate value may be
- /// changed to retain the same result if the predicate is order dependent
- /// (e.g. ult).
- /// @brief Swap operands and adjust predicate.
- void swapOperands() {
- SubclassData = getSwappedPredicate();
- std::swap(Ops[0], Ops[1]);
- }
-
- virtual FCmpInst *clone() const;
-
- /// @brief Methods for support type inquiry through isa, cast, and dyn_cast:
- static inline bool classof(const FCmpInst *) { return true; }
- static inline bool classof(const Instruction *I) {
- return I->getOpcode() == Instruction::FCmp;
- }
- static inline bool classof(const Value *V) {
- return isa<Instruction>(V) && classof(cast<Instruction>(V));
- }
-};
-
-//===----------------------------------------------------------------------===//
-// CallInst Class
-//===----------------------------------------------------------------------===//
-/// CallInst - This class represents a function call, abstracting a target
-/// machine's calling convention. This class uses low bit of the SubClassData
-/// field to indicate whether or not this is a tail call. The rest of the bits
-/// hold the calling convention of the call.
-///
-
-class CallInst : public Instruction {
- PAListPtr ParamAttrs; ///< parameter attributes for call
- CallInst(const CallInst &CI);
- void init(Value *Func, Value* const *Params, unsigned NumParams);
- void init(Value *Func, Value *Actual1, Value *Actual2);
- void init(Value *Func, Value *Actual);
- void init(Value *Func);
-
- template<typename InputIterator>
- void init(Value *Func, InputIterator ArgBegin, InputIterator ArgEnd,
- const std::string &Name,
- // This argument ensures that we have an iterator we can
- // do arithmetic on in constant time
- std::random_access_iterator_tag) {
- unsigned NumArgs = (unsigned)std::distance(ArgBegin, ArgEnd);
-
- // This requires that the iterator points to contiguous memory.
- init(Func, NumArgs ? &*ArgBegin : 0, NumArgs);
- setName(Name);
- }
-
- /// Construct a CallInst given a range of arguments. InputIterator
- /// must be a random-access iterator pointing to contiguous storage
- /// (e.g. a std::vector<>::iterator). Checks are made for
- /// random-accessness but not for contiguous storage as that would
- /// incur runtime overhead.
- /// @brief Construct a CallInst from a range of arguments
- template<typename InputIterator>
- CallInst(Value *Func, InputIterator ArgBegin, InputIterator ArgEnd,
- const std::string &Name = "", Instruction *InsertBefore = 0)
- : Instruction(cast<FunctionType>(cast<PointerType>(Func->getType())
- ->getElementType())->getReturnType(),
- Instruction::Call, 0, 0, InsertBefore) {
- init(Func, ArgBegin, ArgEnd, Name,
- typename std::iterator_traits<InputIterator>::iterator_category());
- }
-
- /// Construct a CallInst given a range of arguments. InputIterator
- /// must be a random-access iterator pointing to contiguous storage
- /// (e.g. a std::vector<>::iterator). Checks are made for
- /// random-accessness but not for contiguous storage as that would
- /// incur runtime overhead.
- /// @brief Construct a CallInst from a range of arguments
- template<typename InputIterator>
- CallInst(Value *Func, InputIterator ArgBegin, InputIterator ArgEnd,
- const std::string &Name, BasicBlock *InsertAtEnd)
- : Instruction(cast<FunctionType>(cast<PointerType>(Func->getType())
- ->getElementType())->getReturnType(),
- Instruction::Call, 0, 0, InsertAtEnd) {
- init(Func, ArgBegin, ArgEnd, Name,
- typename std::iterator_traits<InputIterator>::iterator_category());
- }
-
- CallInst(Value *F, Value *Actual, const std::string& Name = "",
- Instruction *InsertBefore = 0);
- CallInst(Value *F, Value *Actual, const std::string& Name,
- BasicBlock *InsertAtEnd);
- explicit CallInst(Value *F, const std::string &Name = "",
- Instruction *InsertBefore = 0);
- CallInst(Value *F, const std::string &Name, BasicBlock *InsertAtEnd);
-public:
- template<typename InputIterator>
- static CallInst *Create(Value *Func, InputIterator ArgBegin,
- InputIterator ArgEnd,
- const std::string &Name = "",
- Instruction *InsertBefore = 0) {
- return new(ArgEnd - ArgBegin + 1)
- CallInst(Func, ArgBegin, ArgEnd, Name, InsertBefore);
- }
- template<typename InputIterator>
- static CallInst *Create(Value *Func, InputIterator ArgBegin,
- InputIterator ArgEnd, const std::string &Name,
- BasicBlock *InsertAtEnd) {
- return new(ArgEnd - ArgBegin + 1)
- CallInst(Func, ArgBegin, ArgEnd, Name, InsertAtEnd);
- }
- static CallInst *Create(Value *F, Value *Actual, const std::string& Name = "",
- Instruction *InsertBefore = 0) {
- return new(2) CallInst(F, Actual, Name, InsertBefore);
- }
- static CallInst *Create(Value *F, Value *Actual, const std::string& Name,
- BasicBlock *InsertAtEnd) {
- return new(2) CallInst(F, Actual, Name, InsertAtEnd);
- }
- static CallInst *Create(Value *F, const std::string &Name = "",
- Instruction *InsertBefore = 0) {
- return new(1) CallInst(F, Name, InsertBefore);
- }
- static CallInst *Create(Value *F, const std::string &Name,
- BasicBlock *InsertAtEnd) {
- return new(1) CallInst(F, Name, InsertAtEnd);
- }
-
- ~CallInst();
-
- virtual CallInst *clone() const;
-
- bool isTailCall() const { return SubclassData & 1; }
- void setTailCall(bool isTailCall = true) {
- SubclassData = (SubclassData & ~1) | unsigned(isTailCall);
- }
-
- /// getCallingConv/setCallingConv - Get or set the calling convention of this
- /// function call.
- unsigned getCallingConv() const { return SubclassData >> 1; }
- void setCallingConv(unsigned CC) {
- SubclassData = (SubclassData & 1) | (CC << 1);
- }
-
- /// getParamAttrs - Return the parameter attributes for this call.
- ///
- const PAListPtr &getParamAttrs() const { return ParamAttrs; }
-
- /// setParamAttrs - Sets the parameter attributes for this call.
- void setParamAttrs(const PAListPtr &Attrs) { ParamAttrs = Attrs; }
-
- /// @brief Determine whether the call or the callee has the given attribute.
- bool paramHasAttr(unsigned i, unsigned attr) const;
-
- /// @brief Extract the alignment for a call or parameter (0=unknown).
- unsigned getParamAlignment(unsigned i) const {
- return ParamAttrs.getParamAlignment(i);
- }
-
- /// @brief Determine if the call does not access memory.
- bool doesNotAccessMemory() const {
- return paramHasAttr(0, ParamAttr::ReadNone);
- }
-
- /// @brief Determine if the call does not access or only reads memory.
- bool onlyReadsMemory() const {
- return doesNotAccessMemory() || paramHasAttr(0, ParamAttr::ReadOnly);
- }
-
- /// @brief Determine if the call cannot return.
- bool doesNotReturn() const {
- return paramHasAttr(0, ParamAttr::NoReturn);
- }
-
- /// @brief Determine if the call cannot unwind.
- bool doesNotThrow() const {
- return paramHasAttr(0, ParamAttr::NoUnwind);
- }
- void setDoesNotThrow(bool doesNotThrow = true);
-
- /// @brief Determine if the call returns a structure through first
- /// pointer argument.
- bool hasStructRetAttr() const {
- // Be friendly and also check the callee.
- return paramHasAttr(1, ParamAttr::StructRet);
- }
-
- /// @brief Determine if any call argument is an aggregate passed by value.
- bool hasByValArgument() const {
- return ParamAttrs.hasAttrSomewhere(ParamAttr::ByVal);
- }
-
- /// getCalledFunction - Return the function being called by this instruction
- /// if it is a direct call. If it is a call through a function pointer,
- /// return null.
- Function *getCalledFunction() const {
- return dyn_cast<Function>(getOperand(0));
- }
-
- /// getCalledValue - Get a pointer to the function that is invoked by this
- /// instruction
- const Value *getCalledValue() const { return getOperand(0); }
- Value *getCalledValue() { return getOperand(0); }
-
- // Methods for support type inquiry through isa, cast, and dyn_cast:
- static inline bool classof(const CallInst *) { return true; }
- static inline bool classof(const Instruction *I) {
- return I->getOpcode() == Instruction::Call;
- }
- static inline bool classof(const Value *V) {
- return isa<Instruction>(V) && classof(cast<Instruction>(V));
- }
-};
-
-//===----------------------------------------------------------------------===//
-// SelectInst Class
-//===----------------------------------------------------------------------===//
-
-/// SelectInst - This class represents the LLVM 'select' instruction.
-///
-class SelectInst : public Instruction {
- Use Ops[3];
-
- void init(Value *C, Value *S1, Value *S2) {
- Ops[0].init(C, this);
- Ops[1].init(S1, this);
- Ops[2].init(S2, this);
- }
-
- SelectInst(const SelectInst &SI)
- : Instruction(SI.getType(), SI.getOpcode(), Ops, 3) {
- init(SI.Ops[0], SI.Ops[1], SI.Ops[2]);
- }
- SelectInst(Value *C, Value *S1, Value *S2, const std::string &Name = "",
- Instruction *InsertBefore = 0)
- : Instruction(S1->getType(), Instruction::Select, Ops, 3, InsertBefore) {
- init(C, S1, S2);
- setName(Name);
- }
- SelectInst(Value *C, Value *S1, Value *S2, const std::string &Name,
- BasicBlock *InsertAtEnd)
- : Instruction(S1->getType(), Instruction::Select, Ops, 3, InsertAtEnd) {
- init(C, S1, S2);
- setName(Name);
- }
-public:
- static SelectInst *Create(Value *C, Value *S1, Value *S2,
- const std::string &Name = "",
- Instruction *InsertBefore = 0) {
- return new(3) SelectInst(C, S1, S2, Name, InsertBefore);
- }
- static SelectInst *Create(Value *C, Value *S1, Value *S2,
- const std::string &Name, BasicBlock *InsertAtEnd) {
- return new(3) SelectInst(C, S1, S2, Name, InsertAtEnd);
- }
-
- Value *getCondition() const { return Ops[0]; }
- Value *getTrueValue() const { return Ops[1]; }
- Value *getFalseValue() const { return Ops[2]; }
-
- /// Transparently provide more efficient getOperand methods.
- Value *getOperand(unsigned i) const {
- assert(i < 3 && "getOperand() out of range!");
- return Ops[i];
- }
- void setOperand(unsigned i, Value *Val) {
- assert(i < 3 && "setOperand() out of range!");
- Ops[i] = Val;
- }
- unsigned getNumOperands() const { return 3; }
-
- OtherOps getOpcode() const {
- return static_cast<OtherOps>(Instruction::getOpcode());
- }
-
- virtual SelectInst *clone() const;
-
- // Methods for support type inquiry through isa, cast, and dyn_cast:
- static inline bool classof(const SelectInst *) { return true; }
- static inline bool classof(const Instruction *I) {
- return I->getOpcode() == Instruction::Select;
- }
- static inline bool classof(const Value *V) {
- return isa<Instruction>(V) && classof(cast<Instruction>(V));
- }
-};
-
-//===----------------------------------------------------------------------===//
-// VAArgInst Class
-//===----------------------------------------------------------------------===//
-
-/// VAArgInst - This class represents the va_arg llvm instruction, which returns
-/// an argument of the specified type given a va_list and increments that list
-///
-class VAArgInst : public UnaryInstruction {
- VAArgInst(const VAArgInst &VAA)
- : UnaryInstruction(VAA.getType(), VAArg, VAA.getOperand(0)) {}
-public:
- VAArgInst(Value *List, const Type *Ty, const std::string &Name = "",
- Instruction *InsertBefore = 0)
- : UnaryInstruction(Ty, VAArg, List, InsertBefore) {
- setName(Name);
- }
- VAArgInst(Value *List, const Type *Ty, const std::string &Name,
- BasicBlock *InsertAtEnd)
- : UnaryInstruction(Ty, VAArg, List, InsertAtEnd) {
- setName(Name);
- }
-
- virtual VAArgInst *clone() const;
-
- // Methods for support type inquiry through isa, cast, and dyn_cast:
- static inline bool classof(const VAArgInst *) { return true; }
- static inline bool classof(const Instruction *I) {
- return I->getOpcode() == VAArg;
- }
- static inline bool classof(const Value *V) {
- return isa<Instruction>(V) && classof(cast<Instruction>(V));
- }
-};
-
-//===----------------------------------------------------------------------===//
-// ExtractElementInst Class
-//===----------------------------------------------------------------------===//
-
-/// ExtractElementInst - This instruction extracts a single (scalar)
-/// element from a VectorType value
-///
-class ExtractElementInst : public Instruction {
- Use Ops[2];
- ExtractElementInst(const ExtractElementInst &EE) :
- Instruction(EE.getType(), ExtractElement, Ops, 2) {
- Ops[0].init(EE.Ops[0], this);
- Ops[1].init(EE.Ops[1], this);
- }
-
-public:
- // allocate space for exactly two operands
- void *operator new(size_t s) {
- return User::operator new(s, 2); // FIXME: unsigned Idx forms of constructor?
- }
- ExtractElementInst(Value *Vec, Value *Idx, const std::string &Name = "",
- Instruction *InsertBefore = 0);
- ExtractElementInst(Value *Vec, unsigned Idx, const std::string &Name = "",
- Instruction *InsertBefore = 0);
- ExtractElementInst(Value *Vec, Value *Idx, const std::string &Name,
- BasicBlock *InsertAtEnd);
- ExtractElementInst(Value *Vec, unsigned Idx, const std::string &Name,
- BasicBlock *InsertAtEnd);
-
- /// isValidOperands - Return true if an extractelement instruction can be
- /// formed with the specified operands.
- static bool isValidOperands(const Value *Vec, const Value *Idx);
-
- virtual ExtractElementInst *clone() const;
-
- /// Transparently provide more efficient getOperand methods.
- Value *getOperand(unsigned i) const {
- assert(i < 2 && "getOperand() out of range!");
- return Ops[i];
- }
- void setOperand(unsigned i, Value *Val) {
- assert(i < 2 && "setOperand() out of range!");
- Ops[i] = Val;
- }
- unsigned getNumOperands() const { return 2; }
-
- // Methods for support type inquiry through isa, cast, and dyn_cast:
- static inline bool classof(const ExtractElementInst *) { return true; }
- static inline bool classof(const Instruction *I) {
- return I->getOpcode() == Instruction::ExtractElement;
- }
- static inline bool classof(const Value *V) {
- return isa<Instruction>(V) && classof(cast<Instruction>(V));
- }
-};
-
-//===----------------------------------------------------------------------===//
-// InsertElementInst Class
-//===----------------------------------------------------------------------===//
-
-/// InsertElementInst - This instruction inserts a single (scalar)
-/// element into a VectorType value
-///
-class InsertElementInst : public Instruction {
- Use Ops[3];
- InsertElementInst(const InsertElementInst &IE);
- InsertElementInst(Value *Vec, Value *NewElt, Value *Idx,
- const std::string &Name = "",Instruction *InsertBefore = 0);
- InsertElementInst(Value *Vec, Value *NewElt, unsigned Idx,
- const std::string &Name = "",Instruction *InsertBefore = 0);
- InsertElementInst(Value *Vec, Value *NewElt, Value *Idx,
- const std::string &Name, BasicBlock *InsertAtEnd);
- InsertElementInst(Value *Vec, Value *NewElt, unsigned Idx,
- const std::string &Name, BasicBlock *InsertAtEnd);
-public:
- static InsertElementInst *Create(const InsertElementInst &IE) {
- return new(IE.getNumOperands()) InsertElementInst(IE);
- }
- static InsertElementInst *Create(Value *Vec, Value *NewElt, Value *Idx,
- const std::string &Name = "",Instruction *InsertBefore = 0) {
- return new(3) InsertElementInst(Vec, NewElt, Idx, Name, InsertBefore);
- }
- static InsertElementInst *Create(Value *Vec, Value *NewElt, unsigned Idx,
- const std::string &Name = "",
- Instruction *InsertBefore = 0) {
- return new(3/*FIXME*/)
- InsertElementInst(Vec, NewElt, Idx, Name, InsertBefore);
- }
- static InsertElementInst *Create(Value *Vec, Value *NewElt, Value *Idx,
- const std::string &Name,
- BasicBlock *InsertAtEnd) {
- return new(3) InsertElementInst(Vec, NewElt, Idx, Name, InsertAtEnd);
- }
- static InsertElementInst *Create(Value *Vec, Value *NewElt, unsigned Idx,
- const std::string &Name,
- BasicBlock *InsertAtEnd) {
- return new(3/*FIXME*/)
- InsertElementInst(Vec, NewElt, Idx, Name, InsertAtEnd);
- }
-
- /// isValidOperands - Return true if an insertelement instruction can be
- /// formed with the specified operands.
- static bool isValidOperands(const Value *Vec, const Value *NewElt,
- const Value *Idx);
-
- virtual InsertElementInst *clone() const;
-
- /// getType - Overload to return most specific vector type.
- ///
- const VectorType *getType() const {
- return reinterpret_cast<const VectorType*>(Instruction::getType());
- }
-
- /// Transparently provide more efficient getOperand methods.
- Value *getOperand(unsigned i) const {
- assert(i < 3 && "getOperand() out of range!");
- return Ops[i];
- }
- void setOperand(unsigned i, Value *Val) {
- assert(i < 3 && "setOperand() out of range!");
- Ops[i] = Val;
- }
- unsigned getNumOperands() const { return 3; }
-
- // Methods for support type inquiry through isa, cast, and dyn_cast:
- static inline bool classof(const InsertElementInst *) { return true; }
- static inline bool classof(const Instruction *I) {
- return I->getOpcode() == Instruction::InsertElement;
- }
- static inline bool classof(const Value *V) {
- return isa<Instruction>(V) && classof(cast<Instruction>(V));
- }
-};
-
-//===----------------------------------------------------------------------===//
-// ShuffleVectorInst Class
-//===----------------------------------------------------------------------===//
-
-/// ShuffleVectorInst - This instruction constructs a fixed permutation of two
-/// input vectors.
-///
-class ShuffleVectorInst : public Instruction {
- Use Ops[3];
- ShuffleVectorInst(const ShuffleVectorInst &IE);
-public:
- // allocate space for exactly three operands
- void *operator new(size_t s) {
- return User::operator new(s, 3);
- }
- ShuffleVectorInst(Value *V1, Value *V2, Value *Mask,
- const std::string &Name = "", Instruction *InsertBefor = 0);
- ShuffleVectorInst(Value *V1, Value *V2, Value *Mask,
- const std::string &Name, BasicBlock *InsertAtEnd);
-
- /// isValidOperands - Return true if a shufflevector instruction can be
- /// formed with the specified operands.
- static bool isValidOperands(const Value *V1, const Value *V2,
- const Value *Mask);
-
- virtual ShuffleVectorInst *clone() const;
-
- /// getType - Overload to return most specific vector type.
- ///
- const VectorType *getType() const {
- return reinterpret_cast<const VectorType*>(Instruction::getType());
- }
-
- /// Transparently provide more efficient getOperand methods.
- const Value *getOperand(unsigned i) const {
- assert(i < 3 && "getOperand() out of range!");
- return Ops[i];
- }
- Value *getOperand(unsigned i) {
- assert(i < 3 && "getOperand() out of range!");
- return Ops[i];
- }
- void setOperand(unsigned i, Value *Val) {
- assert(i < 3 && "setOperand() out of range!");
- Ops[i] = Val;
- }
- unsigned getNumOperands() const { return 3; }
-
- /// getMaskValue - Return the index from the shuffle mask for the specified
- /// output result. This is either -1 if the element is undef or a number less
- /// than 2*numelements.
- int getMaskValue(unsigned i) const;
-
- // Methods for support type inquiry through isa, cast, and dyn_cast:
- static inline bool classof(const ShuffleVectorInst *) { return true; }
- static inline bool classof(const Instruction *I) {
- return I->getOpcode() == Instruction::ShuffleVector;
- }
- static inline bool classof(const Value *V) {
- return isa<Instruction>(V) && classof(cast<Instruction>(V));
- }
-};
-
-
-//===----------------------------------------------------------------------===//
-// PHINode Class
-//===----------------------------------------------------------------------===//
-
-// PHINode - The PHINode class is used to represent the magical mystical PHI
-// node, that can not exist in nature, but can be synthesized in a computer
-// scientist's overactive imagination.
-//
-class PHINode : public Instruction {
- void *operator new(size_t, unsigned); // DO NOT IMPLEMENT
- /// ReservedSpace - The number of operands actually allocated. NumOperands is
- /// the number actually in use.
- unsigned ReservedSpace;
- PHINode(const PHINode &PN);
- // allocate space for exactly zero operands
- void *operator new(size_t s) {
- return User::operator new(s, 0);
- }
- explicit PHINode(const Type *Ty, const std::string &Name = "",
- Instruction *InsertBefore = 0)
- : Instruction(Ty, Instruction::PHI, 0, 0, InsertBefore),
- ReservedSpace(0) {
- setName(Name);
- }
-
- PHINode(const Type *Ty, const std::string &Name, BasicBlock *InsertAtEnd)
- : Instruction(Ty, Instruction::PHI, 0, 0, InsertAtEnd),
- ReservedSpace(0) {
- setName(Name);
- }
-public:
- static PHINode *Create(const Type *Ty, const std::string &Name = "",
- Instruction *InsertBefore = 0) {
- return new PHINode(Ty, Name, InsertBefore);
- }
- static PHINode *Create(const Type *Ty, const std::string &Name,
- BasicBlock *InsertAtEnd) {
- return new PHINode(Ty, Name, InsertAtEnd);
- }
- ~PHINode();
-
- /// reserveOperandSpace - This method can be used to avoid repeated
- /// reallocation of PHI operand lists by reserving space for the correct
- /// number of operands before adding them. Unlike normal vector reserves,
- /// this method can also be used to trim the operand space.
- void reserveOperandSpace(unsigned NumValues) {
- resizeOperands(NumValues*2);
- }
-
- virtual PHINode *clone() const;
-
- /// getNumIncomingValues - Return the number of incoming edges
- ///
- unsigned getNumIncomingValues() const { return getNumOperands()/2; }
-
- /// getIncomingValue - Return incoming value number x
- ///
- Value *getIncomingValue(unsigned i) const {
- assert(i*2 < getNumOperands() && "Invalid value number!");
- return getOperand(i*2);
- }
- void setIncomingValue(unsigned i, Value *V) {
- assert(i*2 < getNumOperands() && "Invalid value number!");
- setOperand(i*2, V);
- }
- unsigned getOperandNumForIncomingValue(unsigned i) {
- return i*2;
- }
-
- /// getIncomingBlock - Return incoming basic block number x
- ///
- BasicBlock *getIncomingBlock(unsigned i) const {
- return reinterpret_cast<BasicBlock*>(getOperand(i*2+1));
- }
- void setIncomingBlock(unsigned i, BasicBlock *BB) {
- setOperand(i*2+1, reinterpret_cast<Value*>(BB));
- }
- unsigned getOperandNumForIncomingBlock(unsigned i) {
- return i*2+1;
- }
-
- /// addIncoming - Add an incoming value to the end of the PHI list
- ///
- void addIncoming(Value *V, BasicBlock *BB) {
- assert(V && "PHI node got a null value!");
- assert(BB && "PHI node got a null basic block!");
- assert(getType() == V->getType() &&
- "All operands to PHI node must be the same type as the PHI node!");
- unsigned OpNo = NumOperands;
- if (OpNo+2 > ReservedSpace)
- resizeOperands(0); // Get more space!
- // Initialize some new operands.
- NumOperands = OpNo+2;
- OperandList[OpNo].init(V, this);
- OperandList[OpNo+1].init(reinterpret_cast<Value*>(BB), this);
- }
-
- /// removeIncomingValue - Remove an incoming value. This is useful if a
- /// predecessor basic block is deleted. The value removed is returned.
- ///
- /// If the last incoming value for a PHI node is removed (and DeletePHIIfEmpty
- /// is true), the PHI node is destroyed and any uses of it are replaced with
- /// dummy values. The only time there should be zero incoming values to a PHI
- /// node is when the block is dead, so this strategy is sound.
- ///
- Value *removeIncomingValue(unsigned Idx, bool DeletePHIIfEmpty = true);
-
- Value *removeIncomingValue(const BasicBlock *BB, bool DeletePHIIfEmpty =true){
- int Idx = getBasicBlockIndex(BB);
- assert(Idx >= 0 && "Invalid basic block argument to remove!");
- return removeIncomingValue(Idx, DeletePHIIfEmpty);
- }
-
- /// getBasicBlockIndex - Return the first index of the specified basic
- /// block in the value list for this PHI. Returns -1 if no instance.
- ///
- int getBasicBlockIndex(const BasicBlock *BB) const {
- Use *OL = OperandList;
- for (unsigned i = 0, e = getNumOperands(); i != e; i += 2)
- if (OL[i+1] == reinterpret_cast<const Value*>(BB)) return i/2;
- return -1;
- }
-
- Value *getIncomingValueForBlock(const BasicBlock *BB) const {
- return getIncomingValue(getBasicBlockIndex(BB));
- }
-
- /// hasConstantValue - If the specified PHI node always merges together the
- /// same value, return the value, otherwise return null.
- ///
- Value *hasConstantValue(bool AllowNonDominatingInstruction = false) const;
-
- /// Methods for support type inquiry through isa, cast, and dyn_cast:
- static inline bool classof(const PHINode *) { return true; }
- static inline bool classof(const Instruction *I) {
- return I->getOpcode() == Instruction::PHI;
- }
- static inline bool classof(const Value *V) {
- return isa<Instruction>(V) && classof(cast<Instruction>(V));
- }
- private:
- void resizeOperands(unsigned NumOperands);
-};
-
-//===----------------------------------------------------------------------===//
-// ReturnInst Class
-//===----------------------------------------------------------------------===//
-
-//===---------------------------------------------------------------------------
-/// ReturnInst - Return a value (possibly void), from a function. Execution
-/// does not continue in this function any longer.
-///
-class ReturnInst : public TerminatorInst {
- Use RetVal;
- ReturnInst(const ReturnInst &RI);
- void init(Value * const* retVals, unsigned N);
-
-private:
- // ReturnInst constructors:
- // ReturnInst() - 'ret void' instruction
- // ReturnInst( null) - 'ret void' instruction
- // ReturnInst(Value* X) - 'ret X' instruction
- // ReturnInst( null, Inst *) - 'ret void' instruction, insert before I
- // ReturnInst(Value* X, Inst *I) - 'ret X' instruction, insert before I
- // ReturnInst( null, BB *B) - 'ret void' instruction, insert @ end of BB
- // ReturnInst(Value* X, BB *B) - 'ret X' instruction, insert @ end of BB
- // ReturnInst(Value* X, N) - 'ret X,X+1...X+N-1' instruction
- // ReturnInst(Value* X, N, Inst *) - 'ret X,X+1...X+N-1', insert before I
- // ReturnInst(Value* X, N, BB *) - 'ret X,X+1...X+N-1', insert @ end of BB
- //
- // NOTE: If the Value* passed is of type void then the constructor behaves as
- // if it was passed NULL.
- explicit ReturnInst(Value *retVal = 0, Instruction *InsertBefore = 0);
- ReturnInst(Value *retVal, BasicBlock *InsertAtEnd);
- ReturnInst(Value * const* retVals, unsigned N);
- ReturnInst(Value * const* retVals, unsigned N, Instruction *InsertBefore);
- ReturnInst(Value * const* retVals, unsigned N, BasicBlock *InsertAtEnd);
- explicit ReturnInst(BasicBlock *InsertAtEnd);
-public:
- static ReturnInst* Create(Value *retVal = 0, Instruction *InsertBefore = 0) {
- return new(!!retVal) ReturnInst(retVal, InsertBefore);
- }
- static ReturnInst* Create(Value *retVal, BasicBlock *InsertAtEnd) {
- return new(!!retVal) ReturnInst(retVal, InsertAtEnd);
- }
- static ReturnInst* Create(Value * const* retVals, unsigned N) {
- return new(N) ReturnInst(retVals, N);
- }
- static ReturnInst* Create(Value * const* retVals, unsigned N,
- Instruction *InsertBefore) {
- return new(N) ReturnInst(retVals, N, InsertBefore);
- }
- static ReturnInst* Create(Value * const* retVals, unsigned N,
- BasicBlock *InsertAtEnd) {
- return new(N) ReturnInst(retVals, N, InsertAtEnd);
- }
- static ReturnInst* Create(BasicBlock *InsertAtEnd) {
- return new(0) ReturnInst(InsertAtEnd);
- }
- virtual ~ReturnInst();
-
- virtual ReturnInst *clone() const;
-
- Value *getOperand(unsigned n = 0) const {
- if (getNumOperands() > 1)
- return TerminatorInst::getOperand(n);
- else
- return RetVal;
- }
-
- Value *getReturnValue(unsigned n = 0) const {
- return getOperand(n);
- }
-
- unsigned getNumSuccessors() const { return 0; }
-
- // Methods for support type inquiry through isa, cast, and dyn_cast:
- static inline bool classof(const ReturnInst *) { return true; }
- static inline bool classof(const Instruction *I) {
- return (I->getOpcode() == Instruction::Ret);
- }
- static inline bool classof(const Value *V) {
- return isa<Instruction>(V) && classof(cast<Instruction>(V));
- }
- private:
- virtual BasicBlock *getSuccessorV(unsigned idx) const;
- virtual unsigned getNumSuccessorsV() const;
- virtual void setSuccessorV(unsigned idx, BasicBlock *B);
-};
-
-//===----------------------------------------------------------------------===//
-// BranchInst Class
-//===----------------------------------------------------------------------===//
-
-//===---------------------------------------------------------------------------
-/// BranchInst - Conditional or Unconditional Branch instruction.
-///
-class BranchInst : public TerminatorInst {
- /// Ops list - Branches are strange. The operands are ordered:
- /// TrueDest, FalseDest, Cond. This makes some accessors faster because
- /// they don't have to check for cond/uncond branchness.
- Use Ops[3];
- BranchInst(const BranchInst &BI);
- void AssertOK();
- // BranchInst constructors (where {B, T, F} are blocks, and C is a condition):
- // BranchInst(BB *B) - 'br B'
- // BranchInst(BB* T, BB *F, Value *C) - 'br C, T, F'
- // BranchInst(BB* B, Inst *I) - 'br B' insert before I
- // BranchInst(BB* T, BB *F, Value *C, Inst *I) - 'br C, T, F', insert before I
- // BranchInst(BB* B, BB *I) - 'br B' insert at end
- // BranchInst(BB* T, BB *F, Value *C, BB *I) - 'br C, T, F', insert at end
- explicit BranchInst(BasicBlock *IfTrue, Instruction *InsertBefore = 0);
- BranchInst(BasicBlock *IfTrue, BasicBlock *IfFalse, Value *Cond,
- Instruction *InsertBefore = 0);
- BranchInst(BasicBlock *IfTrue, BasicBlock *InsertAtEnd);
- BranchInst(BasicBlock *IfTrue, BasicBlock *IfFalse, Value *Cond,
- BasicBlock *InsertAtEnd);
-public:
- static BranchInst *Create(BasicBlock *IfTrue, Instruction *InsertBefore = 0) {
- return new(1) BranchInst(IfTrue, InsertBefore);
- }
- static BranchInst *Create(BasicBlock *IfTrue, BasicBlock *IfFalse, Value *Cond,
- Instruction *InsertBefore = 0) {
- return new(3) BranchInst(IfTrue, IfFalse, Cond, InsertBefore);
- }
- static BranchInst *Create(BasicBlock *IfTrue, BasicBlock *InsertAtEnd) {
- return new(1) BranchInst(IfTrue, InsertAtEnd);
- }
- static BranchInst *Create(BasicBlock *IfTrue, BasicBlock *IfFalse, Value *Cond,
- BasicBlock *InsertAtEnd) {
- return new(3) BranchInst(IfTrue, IfFalse, Cond, InsertAtEnd);
- }
-
- /// Transparently provide more efficient getOperand methods.
- Value *getOperand(unsigned i) const {
- assert(i < getNumOperands() && "getOperand() out of range!");
- return Ops[i];
- }
- void setOperand(unsigned i, Value *Val) {
- assert(i < getNumOperands() && "setOperand() out of range!");
- Ops[i] = Val;
- }
-
- virtual BranchInst *clone() const;
-
- bool isUnconditional() const { return getNumOperands() == 1; }
- bool isConditional() const { return getNumOperands() == 3; }
-
- Value *getCondition() const {
- assert(isConditional() && "Cannot get condition of an uncond branch!");
- return getOperand(2);
- }
-
- void setCondition(Value *V) {
- assert(isConditional() && "Cannot set condition of unconditional branch!");
- setOperand(2, V);
- }
-
- // setUnconditionalDest - Change the current branch to an unconditional branch
- // targeting the specified block.
- // FIXME: Eliminate this ugly method.
- void setUnconditionalDest(BasicBlock *Dest) {
- if (isConditional()) { // Convert this to an uncond branch.
- NumOperands = 1;
- Ops[1].set(0);
- Ops[2].set(0);
- }
- setOperand(0, reinterpret_cast<Value*>(Dest));
- }
-
- unsigned getNumSuccessors() const { return 1+isConditional(); }
-
- BasicBlock *getSuccessor(unsigned i) const {
- assert(i < getNumSuccessors() && "Successor # out of range for Branch!");
- return cast<BasicBlock>(getOperand(i));
- }
-
- void setSuccessor(unsigned idx, BasicBlock *NewSucc) {
- assert(idx < getNumSuccessors() && "Successor # out of range for Branch!");
- setOperand(idx, reinterpret_cast<Value*>(NewSucc));
- }
-
- // Methods for support type inquiry through isa, cast, and dyn_cast:
- static inline bool classof(const BranchInst *) { return true; }
- static inline bool classof(const Instruction *I) {
- return (I->getOpcode() == Instruction::Br);
- }
- static inline bool classof(const Value *V) {
- return isa<Instruction>(V) && classof(cast<Instruction>(V));
- }
-private:
- virtual BasicBlock *getSuccessorV(unsigned idx) const;
- virtual unsigned getNumSuccessorsV() const;
- virtual void setSuccessorV(unsigned idx, BasicBlock *B);
-};
-
-//===----------------------------------------------------------------------===//
-// SwitchInst Class
-//===----------------------------------------------------------------------===//
-
-//===---------------------------------------------------------------------------
-/// SwitchInst - Multiway switch
-///
-class SwitchInst : public TerminatorInst {
- unsigned ReservedSpace;
- // Operand[0] = Value to switch on
- // Operand[1] = Default basic block destination
- // Operand[2n ] = Value to match
- // Operand[2n+1] = BasicBlock to go to on match
- SwitchInst(const SwitchInst &RI);
- void init(Value *Value, BasicBlock *Default, unsigned NumCases);
- void resizeOperands(unsigned No);
- /// SwitchInst ctor - Create a new switch instruction, specifying a value to
- /// switch on and a default destination. The number of additional cases can
- /// be specified here to make memory allocation more efficient. This
- /// constructor can also autoinsert before another instruction.
- SwitchInst(Value *Value, BasicBlock *Default, unsigned NumCases,
- Instruction *InsertBefore = 0);
-
- /// SwitchInst ctor - Create a new switch instruction, specifying a value to
- /// switch on and a default destination. The number of additional cases can
- /// be specified here to make memory allocation more efficient. This
- /// constructor also autoinserts at the end of the specified BasicBlock.
- SwitchInst(Value *Value, BasicBlock *Default, unsigned NumCases,
- BasicBlock *InsertAtEnd);
-public:
- static SwitchInst *Create(Value *Value, BasicBlock *Default, unsigned NumCases,
- Instruction *InsertBefore = 0) {
- return new(NumCases/*FIXME*/)
- SwitchInst(Value, Default, NumCases, InsertBefore);
- }
- static SwitchInst *Create(Value *Value, BasicBlock *Default, unsigned NumCases,
- BasicBlock *InsertAtEnd) {
- return new(NumCases/*FIXME*/)
- SwitchInst(Value, Default, NumCases, InsertAtEnd);
- }
- ~SwitchInst();
-
- // Accessor Methods for Switch stmt
- Value *getCondition() const { return getOperand(0); }
- void setCondition(Value *V) { setOperand(0, V); }
-
- BasicBlock *getDefaultDest() const {
- return cast<BasicBlock>(getOperand(1));
- }
-
- /// getNumCases - return the number of 'cases' in this switch instruction.
- /// Note that case #0 is always the default case.
- unsigned getNumCases() const {
- return getNumOperands()/2;
- }
-
- /// getCaseValue - Return the specified case value. Note that case #0, the
- /// default destination, does not have a case value.
- ConstantInt *getCaseValue(unsigned i) {
- assert(i && i < getNumCases() && "Illegal case value to get!");
- return getSuccessorValue(i);
- }
-
- /// getCaseValue - Return the specified case value. Note that case #0, the
- /// default destination, does not have a case value.
- const ConstantInt *getCaseValue(unsigned i) const {
- assert(i && i < getNumCases() && "Illegal case value to get!");
- return getSuccessorValue(i);
- }
-
- /// findCaseValue - Search all of the case values for the specified constant.
- /// If it is explicitly handled, return the case number of it, otherwise
- /// return 0 to indicate that it is handled by the default handler.
- unsigned findCaseValue(const ConstantInt *C) const {
- for (unsigned i = 1, e = getNumCases(); i != e; ++i)
- if (getCaseValue(i) == C)
- return i;
- return 0;
- }
-
- /// findCaseDest - Finds the unique case value for a given successor. Returns
- /// null if the successor is not found, not unique, or is the default case.
- ConstantInt *findCaseDest(BasicBlock *BB) {
- if (BB == getDefaultDest()) return NULL;
-
- ConstantInt *CI = NULL;
- for (unsigned i = 1, e = getNumCases(); i != e; ++i) {
- if (getSuccessor(i) == BB) {
- if (CI) return NULL; // Multiple cases lead to BB.
- else CI = getCaseValue(i);
- }
- }
- return CI;
- }
-
- /// addCase - Add an entry to the switch instruction...
- ///
- void addCase(ConstantInt *OnVal, BasicBlock *Dest);
-
- /// removeCase - This method removes the specified successor from the switch
- /// instruction. Note that this cannot be used to remove the default
- /// destination (successor #0).
- ///
- void removeCase(unsigned idx);
-
- virtual SwitchInst *clone() const;
-
- unsigned getNumSuccessors() const { return getNumOperands()/2; }
- BasicBlock *getSuccessor(unsigned idx) const {
- assert(idx < getNumSuccessors() &&"Successor idx out of range for switch!");
- return cast<BasicBlock>(getOperand(idx*2+1));
- }
- void setSuccessor(unsigned idx, BasicBlock *NewSucc) {
- assert(idx < getNumSuccessors() && "Successor # out of range for switch!");
- setOperand(idx*2+1, reinterpret_cast<Value*>(NewSucc));
- }
-
- // getSuccessorValue - Return the value associated with the specified
- // successor.
- ConstantInt *getSuccessorValue(unsigned idx) const {
- assert(idx < getNumSuccessors() && "Successor # out of range!");
- return reinterpret_cast<ConstantInt*>(getOperand(idx*2));
- }
-
- // Methods for support type inquiry through isa, cast, and dyn_cast:
- static inline bool classof(const SwitchInst *) { return true; }
- static inline bool classof(const Instruction *I) {
- return I->getOpcode() == Instruction::Switch;
- }
- static inline bool classof(const Value *V) {
- return isa<Instruction>(V) && classof(cast<Instruction>(V));
- }
-private:
- virtual BasicBlock *getSuccessorV(unsigned idx) const;
- virtual unsigned getNumSuccessorsV() const;
- virtual void setSuccessorV(unsigned idx, BasicBlock *B);
-};
-
-//===----------------------------------------------------------------------===//
-// InvokeInst Class
-//===----------------------------------------------------------------------===//
-
-//===---------------------------------------------------------------------------
-
-/// InvokeInst - Invoke instruction. The SubclassData field is used to hold the
-/// calling convention of the call.
-///
-class InvokeInst : public TerminatorInst {
- PAListPtr ParamAttrs;
- InvokeInst(const InvokeInst &BI);
- void init(Value *Fn, BasicBlock *IfNormal, BasicBlock *IfException,
- Value* const *Args, unsigned NumArgs);
-
- template<typename InputIterator>
- void init(Value *Func, BasicBlock *IfNormal, BasicBlock *IfException,
- InputIterator ArgBegin, InputIterator ArgEnd,
- const std::string &Name,
- // This argument ensures that we have an iterator we can
- // do arithmetic on in constant time
- std::random_access_iterator_tag) {
- unsigned NumArgs = (unsigned)std::distance(ArgBegin, ArgEnd);
-
- // This requires that the iterator points to contiguous memory.
- init(Func, IfNormal, IfException, NumArgs ? &*ArgBegin : 0, NumArgs);
- setName(Name);
- }
-
- /// Construct an InvokeInst given a range of arguments.
- /// InputIterator must be a random-access iterator pointing to
- /// contiguous storage (e.g. a std::vector<>::iterator). Checks are
- /// made for random-accessness but not for contiguous storage as
- /// that would incur runtime overhead.
- ///
- /// @brief Construct an InvokeInst from a range of arguments
- template<typename InputIterator>
- InvokeInst(Value *Func, BasicBlock *IfNormal, BasicBlock *IfException,
- InputIterator ArgBegin, InputIterator ArgEnd,
- const std::string &Name = "", Instruction *InsertBefore = 0)
- : TerminatorInst(cast<FunctionType>(cast<PointerType>(Func->getType())
- ->getElementType())->getReturnType(),
- Instruction::Invoke, 0, 0, InsertBefore) {
- init(Func, IfNormal, IfException, ArgBegin, ArgEnd, Name,
- typename std::iterator_traits<InputIterator>::iterator_category());
- }
-
- /// Construct an InvokeInst given a range of arguments.
- /// InputIterator must be a random-access iterator pointing to
- /// contiguous storage (e.g. a std::vector<>::iterator). Checks are
- /// made for random-accessness but not for contiguous storage as
- /// that would incur runtime overhead.
- ///
- /// @brief Construct an InvokeInst from a range of arguments
- template<typename InputIterator>
- InvokeInst(Value *Func, BasicBlock *IfNormal, BasicBlock *IfException,
- InputIterator ArgBegin, InputIterator ArgEnd,
- const std::string &Name, BasicBlock *InsertAtEnd)
- : TerminatorInst(cast<FunctionType>(cast<PointerType>(Func->getType())
- ->getElementType())->getReturnType(),
- Instruction::Invoke, 0, 0, InsertAtEnd) {
- init(Func, IfNormal, IfException, ArgBegin, ArgEnd, Name,
- typename std::iterator_traits<InputIterator>::iterator_category());
- }
-public:
- template<typename InputIterator>
- static InvokeInst *Create(Value *Func, BasicBlock *IfNormal,
- BasicBlock *IfException,
- InputIterator ArgBegin, InputIterator ArgEnd,
- const std::string &Name = "",
- Instruction *InsertBefore = 0) {
- return new(ArgEnd - ArgBegin + 3)
- InvokeInst(Func, IfNormal, IfException, ArgBegin, ArgEnd, Name, InsertBefore);
- }
- template<typename InputIterator>
- static InvokeInst *Create(Value *Func, BasicBlock *IfNormal,
- BasicBlock *IfException,
- InputIterator ArgBegin, InputIterator ArgEnd,
- const std::string &Name, BasicBlock *InsertAtEnd) {
- return new(ArgEnd - ArgBegin + 3)
- InvokeInst(Func, IfNormal, IfException, ArgBegin, ArgEnd, Name, InsertAtEnd);
- }
-
- ~InvokeInst();
-
- virtual InvokeInst *clone() const;
-
- /// getCallingConv/setCallingConv - Get or set the calling convention of this
- /// function call.
- unsigned getCallingConv() const { return SubclassData; }
- void setCallingConv(unsigned CC) {
- SubclassData = CC;
- }
-
- /// getParamAttrs - Return the parameter attributes for this invoke.
- ///
- const PAListPtr &getParamAttrs() const { return ParamAttrs; }
-
- /// setParamAttrs - Set the parameter attributes for this invoke.
- ///
- void setParamAttrs(const PAListPtr &Attrs) { ParamAttrs = Attrs; }
-
- /// @brief Determine whether the call or the callee has the given attribute.
- bool paramHasAttr(unsigned i, ParameterAttributes attr) const;
-
- /// @brief Extract the alignment for a call or parameter (0=unknown).
- unsigned getParamAlignment(unsigned i) const {
- return ParamAttrs.getParamAlignment(i);
- }
-
- /// @brief Determine if the call does not access memory.
- bool doesNotAccessMemory() const {
- return paramHasAttr(0, ParamAttr::ReadNone);
- }
-
- /// @brief Determine if the call does not access or only reads memory.
- bool onlyReadsMemory() const {
- return doesNotAccessMemory() || paramHasAttr(0, ParamAttr::ReadOnly);
- }
-
- /// @brief Determine if the call cannot return.
- bool doesNotReturn() const {
- return paramHasAttr(0, ParamAttr::NoReturn);
- }
-
- /// @brief Determine if the call cannot unwind.
- bool doesNotThrow() const {
- return paramHasAttr(0, ParamAttr::NoUnwind);
- }
- void setDoesNotThrow(bool doesNotThrow = true);
-
- /// @brief Determine if the call returns a structure through first
- /// pointer argument.
- bool hasStructRetAttr() const {
- // Be friendly and also check the callee.
- return paramHasAttr(1, ParamAttr::StructRet);
- }
-
- /// getCalledFunction - Return the function called, or null if this is an
- /// indirect function invocation.
- ///
- Function *getCalledFunction() const {
- return dyn_cast<Function>(getOperand(0));
- }
-
- // getCalledValue - Get a pointer to a function that is invoked by this inst.
- Value *getCalledValue() const { return getOperand(0); }
-
- // get*Dest - Return the destination basic blocks...
- BasicBlock *getNormalDest() const {
- return cast<BasicBlock>(getOperand(1));
- }
- BasicBlock *getUnwindDest() const {
- return cast<BasicBlock>(getOperand(2));
- }
- void setNormalDest(BasicBlock *B) {
- setOperand(1, reinterpret_cast<Value*>(B));
- }
-
- void setUnwindDest(BasicBlock *B) {
- setOperand(2, reinterpret_cast<Value*>(B));
- }
-
- BasicBlock *getSuccessor(unsigned i) const {
- assert(i < 2 && "Successor # out of range for invoke!");
- return i == 0 ? getNormalDest() : getUnwindDest();
- }
-
- void setSuccessor(unsigned idx, BasicBlock *NewSucc) {
- assert(idx < 2 && "Successor # out of range for invoke!");
- setOperand(idx+1, reinterpret_cast<Value*>(NewSucc));
- }
-
- unsigned getNumSuccessors() const { return 2; }
-
- // Methods for support type inquiry through isa, cast, and dyn_cast:
- static inline bool classof(const InvokeInst *) { return true; }
- static inline bool classof(const Instruction *I) {
- return (I->getOpcode() == Instruction::Invoke);
- }
- static inline bool classof(const Value *V) {
- return isa<Instruction>(V) && classof(cast<Instruction>(V));
- }
-private:
- virtual BasicBlock *getSuccessorV(unsigned idx) const;
- virtual unsigned getNumSuccessorsV() const;
- virtual void setSuccessorV(unsigned idx, BasicBlock *B);
-};
-
-
-//===----------------------------------------------------------------------===//
-// UnwindInst Class
-//===----------------------------------------------------------------------===//
-
-//===---------------------------------------------------------------------------
-/// UnwindInst - Immediately exit the current function, unwinding the stack
-/// until an invoke instruction is found.
-///
-class UnwindInst : public TerminatorInst {
- void *operator new(size_t, unsigned); // DO NOT IMPLEMENT
-public:
- // allocate space for exactly zero operands
- void *operator new(size_t s) {
- return User::operator new(s, 0);
- }
- explicit UnwindInst(Instruction *InsertBefore = 0);
- explicit UnwindInst(BasicBlock *InsertAtEnd);
-
- virtual UnwindInst *clone() const;
-
- unsigned getNumSuccessors() const { return 0; }
-
- // Methods for support type inquiry through isa, cast, and dyn_cast:
- static inline bool classof(const UnwindInst *) { return true; }
- static inline bool classof(const Instruction *I) {
- return I->getOpcode() == Instruction::Unwind;
- }
- static inline bool classof(const Value *V) {
- return isa<Instruction>(V) && classof(cast<Instruction>(V));
- }
-private:
- virtual BasicBlock *getSuccessorV(unsigned idx) const;
- virtual unsigned getNumSuccessorsV() const;
- virtual void setSuccessorV(unsigned idx, BasicBlock *B);
-};
-
-//===----------------------------------------------------------------------===//
-// UnreachableInst Class
-//===----------------------------------------------------------------------===//
-
-//===---------------------------------------------------------------------------
-/// UnreachableInst - This function has undefined behavior. In particular, the
-/// presence of this instruction indicates some higher level knowledge that the
-/// end of the block cannot be reached.
-///
-class UnreachableInst : public TerminatorInst {
- void *operator new(size_t, unsigned); // DO NOT IMPLEMENT
-public:
- // allocate space for exactly zero operands
- void *operator new(size_t s) {
- return User::operator new(s, 0);
- }
- explicit UnreachableInst(Instruction *InsertBefore = 0);
- explicit UnreachableInst(BasicBlock *InsertAtEnd);
-
- virtual UnreachableInst *clone() const;
-
- unsigned getNumSuccessors() const { return 0; }
-
- // Methods for support type inquiry through isa, cast, and dyn_cast:
- static inline bool classof(const UnreachableInst *) { return true; }
- static inline bool classof(const Instruction *I) {
- return I->getOpcode() == Instruction::Unreachable;
- }
- static inline bool classof(const Value *V) {
- return isa<Instruction>(V) && classof(cast<Instruction>(V));
- }
-private:
- virtual BasicBlock *getSuccessorV(unsigned idx) const;
- virtual unsigned getNumSuccessorsV() const;
- virtual void setSuccessorV(unsigned idx, BasicBlock *B);
-};
-
-//===----------------------------------------------------------------------===//
-// TruncInst Class
-//===----------------------------------------------------------------------===//
-
-/// @brief This class represents a truncation of integer types.
-class TruncInst : public CastInst {
- /// Private copy constructor
- TruncInst(const TruncInst &CI)
- : CastInst(CI.getType(), Trunc, CI.getOperand(0)) {
- }
-public:
- /// @brief Constructor with insert-before-instruction semantics
- TruncInst(
- Value *S, ///< The value to be truncated
- const Type *Ty, ///< The (smaller) type to truncate to
- const std::string &Name = "", ///< A name for the new instruction
- Instruction *InsertBefore = 0 ///< Where to insert the new instruction
- );
-
- /// @brief Constructor with insert-at-end-of-block semantics
- TruncInst(
- Value *S, ///< The value to be truncated
- const Type *Ty, ///< The (smaller) type to truncate to
- const std::string &Name, ///< A name for the new instruction
- BasicBlock *InsertAtEnd ///< The block to insert the instruction into
- );
-
- /// @brief Clone an identical TruncInst
- virtual CastInst *clone() const;
-
- /// @brief Methods for support type inquiry through isa, cast, and dyn_cast:
- static inline bool classof(const TruncInst *) { return true; }
- static inline bool classof(const Instruction *I) {
- return I->getOpcode() == Trunc;
- }
- static inline bool classof(const Value *V) {
- return isa<Instruction>(V) && classof(cast<Instruction>(V));
- }
-};
-
-//===----------------------------------------------------------------------===//
-// ZExtInst Class
-//===----------------------------------------------------------------------===//
-
-/// @brief This class represents zero extension of integer types.
-class ZExtInst : public CastInst {
- /// @brief Private copy constructor
- ZExtInst(const ZExtInst &CI)
- : CastInst(CI.getType(), ZExt, CI.getOperand(0)) {
- }
-public:
- /// @brief Constructor with insert-before-instruction semantics
- ZExtInst(
- Value *S, ///< The value to be zero extended
- const Type *Ty, ///< The type to zero extend to
- const std::string &Name = "", ///< A name for the new instruction
- Instruction *InsertBefore = 0 ///< Where to insert the new instruction
- );
-
- /// @brief Constructor with insert-at-end semantics.
- ZExtInst(
- Value *S, ///< The value to be zero extended
- const Type *Ty, ///< The type to zero extend to
- const std::string &Name, ///< A name for the new instruction
- BasicBlock *InsertAtEnd ///< The block to insert the instruction into
- );
-
- /// @brief Clone an identical ZExtInst
- virtual CastInst *clone() const;
-
- /// @brief Methods for support type inquiry through isa, cast, and dyn_cast:
- static inline bool classof(const ZExtInst *) { return true; }
- static inline bool classof(const Instruction *I) {
- return I->getOpcode() == ZExt;
- }
- static inline bool classof(const Value *V) {
- return isa<Instruction>(V) && classof(cast<Instruction>(V));
- }
-};
-
-//===----------------------------------------------------------------------===//
-// SExtInst Class
-//===----------------------------------------------------------------------===//
-
-/// @brief This class represents a sign extension of integer types.
-class SExtInst : public CastInst {
- /// @brief Private copy constructor
- SExtInst(const SExtInst &CI)
- : CastInst(CI.getType(), SExt, CI.getOperand(0)) {
- }
-public:
- /// @brief Constructor with insert-before-instruction semantics
- SExtInst(
- Value *S, ///< The value to be sign extended
- const Type *Ty, ///< The type to sign extend to
- const std::string &Name = "", ///< A name for the new instruction
- Instruction *InsertBefore = 0 ///< Where to insert the new instruction
- );
-
- /// @brief Constructor with insert-at-end-of-block semantics
- SExtInst(
- Value *S, ///< The value to be sign extended
- const Type *Ty, ///< The type to sign extend to
- const std::string &Name, ///< A name for the new instruction
- BasicBlock *InsertAtEnd ///< The block to insert the instruction into
- );
-
- /// @brief Clone an identical SExtInst
- virtual CastInst *clone() const;
-
- /// @brief Methods for support type inquiry through isa, cast, and dyn_cast:
- static inline bool classof(const SExtInst *) { return true; }
- static inline bool classof(const Instruction *I) {
- return I->getOpcode() == SExt;
- }
- static inline bool classof(const Value *V) {
- return isa<Instruction>(V) && classof(cast<Instruction>(V));
- }
-};
-
-//===----------------------------------------------------------------------===//
-// FPTruncInst Class
-//===----------------------------------------------------------------------===//
-
-/// @brief This class represents a truncation of floating point types.
-class FPTruncInst : public CastInst {
- FPTruncInst(const FPTruncInst &CI)
- : CastInst(CI.getType(), FPTrunc, CI.getOperand(0)) {
- }
-public:
- /// @brief Constructor with insert-before-instruction semantics
- FPTruncInst(
- Value *S, ///< The value to be truncated
- const Type *Ty, ///< The type to truncate to
- const std::string &Name = "", ///< A name for the new instruction
- Instruction *InsertBefore = 0 ///< Where to insert the new instruction
- );
-
- /// @brief Constructor with insert-before-instruction semantics
- FPTruncInst(
- Value *S, ///< The value to be truncated
- const Type *Ty, ///< The type to truncate to
- const std::string &Name, ///< A name for the new instruction
- BasicBlock *InsertAtEnd ///< The block to insert the instruction into
- );
-
- /// @brief Clone an identical FPTruncInst
- virtual CastInst *clone() const;
-
- /// @brief Methods for support type inquiry through isa, cast, and dyn_cast:
- static inline bool classof(const FPTruncInst *) { return true; }
- static inline bool classof(const Instruction *I) {
- return I->getOpcode() == FPTrunc;
- }
- static inline bool classof(const Value *V) {
- return isa<Instruction>(V) && classof(cast<Instruction>(V));
- }
-};
-
-//===----------------------------------------------------------------------===//
-// FPExtInst Class
-//===----------------------------------------------------------------------===//
-
-/// @brief This class represents an extension of floating point types.
-class FPExtInst : public CastInst {
- FPExtInst(const FPExtInst &CI)
- : CastInst(CI.getType(), FPExt, CI.getOperand(0)) {
- }
-public:
- /// @brief Constructor with insert-before-instruction semantics
- FPExtInst(
- Value *S, ///< The value to be extended
- const Type *Ty, ///< The type to extend to
- const std::string &Name = "", ///< A name for the new instruction
- Instruction *InsertBefore = 0 ///< Where to insert the new instruction
- );
-
- /// @brief Constructor with insert-at-end-of-block semantics
- FPExtInst(
- Value *S, ///< The value to be extended
- const Type *Ty, ///< The type to extend to
- const std::string &Name, ///< A name for the new instruction
- BasicBlock *InsertAtEnd ///< The block to insert the instruction into
- );
-
- /// @brief Clone an identical FPExtInst
- virtual CastInst *clone() const;
-
- /// @brief Methods for support type inquiry through isa, cast, and dyn_cast:
- static inline bool classof(const FPExtInst *) { return true; }
- static inline bool classof(const Instruction *I) {
- return I->getOpcode() == FPExt;
- }
- static inline bool classof(const Value *V) {
- return isa<Instruction>(V) && classof(cast<Instruction>(V));
- }
-};
-
-//===----------------------------------------------------------------------===//
-// UIToFPInst Class
-//===----------------------------------------------------------------------===//
-
-/// @brief This class represents a cast unsigned integer to floating point.
-class UIToFPInst : public CastInst {
- UIToFPInst(const UIToFPInst &CI)
- : CastInst(CI.getType(), UIToFP, CI.getOperand(0)) {
- }
-public:
- /// @brief Constructor with insert-before-instruction semantics
- UIToFPInst(
- Value *S, ///< The value to be converted
- const Type *Ty, ///< The type to convert to
- const std::string &Name = "", ///< A name for the new instruction
- Instruction *InsertBefore = 0 ///< Where to insert the new instruction
- );
-
- /// @brief Constructor with insert-at-end-of-block semantics
- UIToFPInst(
- Value *S, ///< The value to be converted
- const Type *Ty, ///< The type to convert to
- const std::string &Name, ///< A name for the new instruction
- BasicBlock *InsertAtEnd ///< The block to insert the instruction into
- );
-
- /// @brief Clone an identical UIToFPInst
- virtual CastInst *clone() const;
-
- /// @brief Methods for support type inquiry through isa, cast, and dyn_cast:
- static inline bool classof(const UIToFPInst *) { return true; }
- static inline bool classof(const Instruction *I) {
- return I->getOpcode() == UIToFP;
- }
- static inline bool classof(const Value *V) {
- return isa<Instruction>(V) && classof(cast<Instruction>(V));
- }
-};
-
-//===----------------------------------------------------------------------===//
-// SIToFPInst Class
-//===----------------------------------------------------------------------===//
-
-/// @brief This class represents a cast from signed integer to floating point.
-class SIToFPInst : public CastInst {
- SIToFPInst(const SIToFPInst &CI)
- : CastInst(CI.getType(), SIToFP, CI.getOperand(0)) {
- }
-public:
- /// @brief Constructor with insert-before-instruction semantics
- SIToFPInst(
- Value *S, ///< The value to be converted
- const Type *Ty, ///< The type to convert to
- const std::string &Name = "", ///< A name for the new instruction
- Instruction *InsertBefore = 0 ///< Where to insert the new instruction
- );
-
- /// @brief Constructor with insert-at-end-of-block semantics
- SIToFPInst(
- Value *S, ///< The value to be converted
- const Type *Ty, ///< The type to convert to
- const std::string &Name, ///< A name for the new instruction
- BasicBlock *InsertAtEnd ///< The block to insert the instruction into
- );
-
- /// @brief Clone an identical SIToFPInst
- virtual CastInst *clone() const;
-
- /// @brief Methods for support type inquiry through isa, cast, and dyn_cast:
- static inline bool classof(const SIToFPInst *) { return true; }
- static inline bool classof(const Instruction *I) {
- return I->getOpcode() == SIToFP;
- }
- static inline bool classof(const Value *V) {
- return isa<Instruction>(V) && classof(cast<Instruction>(V));
- }
-};
-
-//===----------------------------------------------------------------------===//
-// FPToUIInst Class
-//===----------------------------------------------------------------------===//
-
-/// @brief This class represents a cast from floating point to unsigned integer
-class FPToUIInst : public CastInst {
- FPToUIInst(const FPToUIInst &CI)
- : CastInst(CI.getType(), FPToUI, CI.getOperand(0)) {
- }
-public:
- /// @brief Constructor with insert-before-instruction semantics
- FPToUIInst(
- Value *S, ///< The value to be converted
- const Type *Ty, ///< The type to convert to
- const std::string &Name = "", ///< A name for the new instruction
- Instruction *InsertBefore = 0 ///< Where to insert the new instruction
- );
-
- /// @brief Constructor with insert-at-end-of-block semantics
- FPToUIInst(
- Value *S, ///< The value to be converted
- const Type *Ty, ///< The type to convert to
- const std::string &Name, ///< A name for the new instruction
- BasicBlock *InsertAtEnd ///< Where to insert the new instruction
- );
-
- /// @brief Clone an identical FPToUIInst
- virtual CastInst *clone() const;
-
- /// @brief Methods for support type inquiry through isa, cast, and dyn_cast:
- static inline bool classof(const FPToUIInst *) { return true; }
- static inline bool classof(const Instruction *I) {
- return I->getOpcode() == FPToUI;
- }
- static inline bool classof(const Value *V) {
- return isa<Instruction>(V) && classof(cast<Instruction>(V));
- }
-};
-
-//===----------------------------------------------------------------------===//
-// FPToSIInst Class
-//===----------------------------------------------------------------------===//
-
-/// @brief This class represents a cast from floating point to signed integer.
-class FPToSIInst : public CastInst {
- FPToSIInst(const FPToSIInst &CI)
- : CastInst(CI.getType(), FPToSI, CI.getOperand(0)) {
- }
-public:
- /// @brief Constructor with insert-before-instruction semantics
- FPToSIInst(
- Value *S, ///< The value to be converted
- const Type *Ty, ///< The type to convert to
- const std::string &Name = "", ///< A name for the new instruction
- Instruction *InsertBefore = 0 ///< Where to insert the new instruction
- );
-
- /// @brief Constructor with insert-at-end-of-block semantics
- FPToSIInst(
- Value *S, ///< The value to be converted
- const Type *Ty, ///< The type to convert to
- const std::string &Name, ///< A name for the new instruction
- BasicBlock *InsertAtEnd ///< The block to insert the instruction into
- );
-
- /// @brief Clone an identical FPToSIInst
- virtual CastInst *clone() const;
-
- /// @brief Methods for support type inquiry through isa, cast, and dyn_cast:
- static inline bool classof(const FPToSIInst *) { return true; }
- static inline bool classof(const Instruction *I) {
- return I->getOpcode() == FPToSI;
- }
- static inline bool classof(const Value *V) {
- return isa<Instruction>(V) && classof(cast<Instruction>(V));
- }
-};
-
-//===----------------------------------------------------------------------===//
-// IntToPtrInst Class
-//===----------------------------------------------------------------------===//
-
-/// @brief This class represents a cast from an integer to a pointer.
-class IntToPtrInst : public CastInst {
- IntToPtrInst(const IntToPtrInst &CI)
- : CastInst(CI.getType(), IntToPtr, CI.getOperand(0)) {
- }
-public:
- /// @brief Constructor with insert-before-instruction semantics
- IntToPtrInst(
- Value *S, ///< The value to be converted
- const Type *Ty, ///< The type to convert to
- const std::string &Name = "", ///< A name for the new instruction
- Instruction *InsertBefore = 0 ///< Where to insert the new instruction
- );
-
- /// @brief Constructor with insert-at-end-of-block semantics
- IntToPtrInst(
- Value *S, ///< The value to be converted
- const Type *Ty, ///< The type to convert to
- const std::string &Name, ///< A name for the new instruction
- BasicBlock *InsertAtEnd ///< The block to insert the instruction into
- );
-
- /// @brief Clone an identical IntToPtrInst
- virtual CastInst *clone() const;
-
- // Methods for support type inquiry through isa, cast, and dyn_cast:
- static inline bool classof(const IntToPtrInst *) { return true; }
- static inline bool classof(const Instruction *I) {
- return I->getOpcode() == IntToPtr;
- }
- static inline bool classof(const Value *V) {
- return isa<Instruction>(V) && classof(cast<Instruction>(V));
- }
-};
-
-//===----------------------------------------------------------------------===//
-// PtrToIntInst Class
-//===----------------------------------------------------------------------===//
-
-/// @brief This class represents a cast from a pointer to an integer
-class PtrToIntInst : public CastInst {
- PtrToIntInst(const PtrToIntInst &CI)
- : CastInst(CI.getType(), PtrToInt, CI.getOperand(0)) {
- }
-public:
- /// @brief Constructor with insert-before-instruction semantics
- PtrToIntInst(
- Value *S, ///< The value to be converted
- const Type *Ty, ///< The type to convert to
- const std::string &Name = "", ///< A name for the new instruction
- Instruction *InsertBefore = 0 ///< Where to insert the new instruction
- );
-
- /// @brief Constructor with insert-at-end-of-block semantics
- PtrToIntInst(
- Value *S, ///< The value to be converted
- const Type *Ty, ///< The type to convert to
- const std::string &Name, ///< A name for the new instruction
- BasicBlock *InsertAtEnd ///< The block to insert the instruction into
- );
-
- /// @brief Clone an identical PtrToIntInst
- virtual CastInst *clone() const;
-
- // Methods for support type inquiry through isa, cast, and dyn_cast:
- static inline bool classof(const PtrToIntInst *) { return true; }
- static inline bool classof(const Instruction *I) {
- return I->getOpcode() == PtrToInt;
- }
- static inline bool classof(const Value *V) {
- return isa<Instruction>(V) && classof(cast<Instruction>(V));
- }
-};
-
-//===----------------------------------------------------------------------===//
-// BitCastInst Class
-//===----------------------------------------------------------------------===//
-
-/// @brief This class represents a no-op cast from one type to another.
-class BitCastInst : public CastInst {
- BitCastInst(const BitCastInst &CI)
- : CastInst(CI.getType(), BitCast, CI.getOperand(0)) {
- }
-public:
- /// @brief Constructor with insert-before-instruction semantics
- BitCastInst(
- Value *S, ///< The value to be casted
- const Type *Ty, ///< The type to casted to
- const std::string &Name = "", ///< A name for the new instruction
- Instruction *InsertBefore = 0 ///< Where to insert the new instruction
- );
-
- /// @brief Constructor with insert-at-end-of-block semantics
- BitCastInst(
- Value *S, ///< The value to be casted
- const Type *Ty, ///< The type to casted to
- const std::string &Name, ///< A name for the new instruction
- BasicBlock *InsertAtEnd ///< The block to insert the instruction into
- );
-
- /// @brief Clone an identical BitCastInst
- virtual CastInst *clone() const;
-
- // Methods for support type inquiry through isa, cast, and dyn_cast:
- static inline bool classof(const BitCastInst *) { return true; }
- static inline bool classof(const Instruction *I) {
- return I->getOpcode() == BitCast;
- }
- static inline bool classof(const Value *V) {
- return isa<Instruction>(V) && classof(cast<Instruction>(V));
- }
-};
-
-//===----------------------------------------------------------------------===//
-// GetResultInst Class
-//===----------------------------------------------------------------------===//
-
-/// GetResultInst - This instruction extracts individual result value from
-/// aggregate value, where aggregate value is returned by CallInst.
-///
-class GetResultInst : public /*FIXME: Unary*/Instruction {
- void *operator new(size_t, unsigned); // DO NOT IMPLEMENT
- Use Aggr;
- unsigned Idx;
- GetResultInst(const GetResultInst &GRI) :
- Instruction(GRI.getType(), Instruction::GetResult, &Aggr, 1) {
- Aggr.init(GRI.Aggr, this);
- Idx = GRI.Idx;
- }
-
-public:
- // allocate space for exactly one operand
- void *operator new(size_t s) {
- return User::operator new(s, 1);
- }
- explicit GetResultInst(Value *Aggr, unsigned index,
- const std::string &Name = "",
- Instruction *InsertBefore = 0);
-
- /// isValidOperands - Return true if an getresult instruction can be
- /// formed with the specified operands.
- static bool isValidOperands(const Value *Aggr, unsigned index);
-
- virtual GetResultInst *clone() const;
-
- Value *getAggregateValue() {
- return getOperand(0);
- }
-
- const Value *getAggregateValue() const {
- return getOperand(0);
- }
-
- unsigned getIndex() const {
- return Idx;
- }
-
- unsigned getNumOperands() const { return 1; }
-
- // Methods for support type inquiry through isa, cast, and dyn_cast:
- static inline bool classof(const GetResultInst *) { return true; }
- static inline bool classof(const Instruction *I) {
- return (I->getOpcode() == Instruction::GetResult);
- }
- static inline bool classof(const Value *V) {
- return isa<Instruction>(V) && classof(cast<Instruction>(V));
- }
-};
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/IntrinsicInst.h b/release_23/include/llvm/IntrinsicInst.h
deleted file mode 100644
index c674e47b3a00..000000000000
--- a/release_23/include/llvm/IntrinsicInst.h
+++ /dev/null
@@ -1,312 +0,0 @@
-//===-- llvm/IntrinsicInst.h - Intrinsic Instruction Wrappers ---*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines classes that make it really easy to deal with intrinsic
-// functions with the isa/dyncast family of functions. In particular, this
-// allows you to do things like:
-//
-// if (MemCpyInst *MCI = dyn_cast<MemCpyInst>(Inst))
-// ... MCI->getDest() ... MCI->getSource() ...
-//
-// All intrinsic function calls are instances of the call instruction, so these
-// are all subclasses of the CallInst class. Note that none of these classes
-// has state or virtual methods, which is an important part of this gross/neat
-// hack working.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_INTRINSICINST_H
-#define LLVM_INTRINSICINST_H
-
-#include "llvm/Constants.h"
-#include "llvm/Function.h"
-#include "llvm/Instructions.h"
-#include "llvm/Intrinsics.h"
-
-namespace llvm {
- /// IntrinsicInst - A useful wrapper class for inspecting calls to intrinsic
- /// functions. This allows the standard isa/dyncast/cast functionality to
- /// work with calls to intrinsic functions.
- class IntrinsicInst : public CallInst {
- IntrinsicInst(); // DO NOT IMPLEMENT
- IntrinsicInst(const IntrinsicInst&); // DO NOT IMPLEMENT
- void operator=(const IntrinsicInst&); // DO NOT IMPLEMENT
- public:
- /// getIntrinsicID - Return the intrinsic ID of this intrinsic.
- ///
- Intrinsic::ID getIntrinsicID() const {
- return (Intrinsic::ID)getCalledFunction()->getIntrinsicID();
- }
-
- // Methods for support type inquiry through isa, cast, and dyn_cast:
- static inline bool classof(const IntrinsicInst *) { return true; }
- static inline bool classof(const CallInst *I) {
- if (const Function *CF = I->getCalledFunction())
- return CF->getIntrinsicID() != 0;
- return false;
- }
- static inline bool classof(const Value *V) {
- return isa<CallInst>(V) && classof(cast<CallInst>(V));
- }
- };
-
- /// DbgInfoIntrinsic - This is the common base class for debug info intrinsics
- ///
- struct DbgInfoIntrinsic : public IntrinsicInst {
-
- // Methods for support type inquiry through isa, cast, and dyn_cast:
- static inline bool classof(const DbgInfoIntrinsic *) { return true; }
- static inline bool classof(const IntrinsicInst *I) {
- switch (I->getIntrinsicID()) {
- case Intrinsic::dbg_stoppoint:
- case Intrinsic::dbg_func_start:
- case Intrinsic::dbg_region_start:
- case Intrinsic::dbg_region_end:
- case Intrinsic::dbg_declare:
- return true;
- default: return false;
- }
- }
- static inline bool classof(const Value *V) {
- return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V));
- }
-
- static Value *StripCast(Value *C);
- };
-
- /// DbgStopPointInst - This represents the llvm.dbg.stoppoint instruction.
- ///
- struct DbgStopPointInst : public DbgInfoIntrinsic {
- Value *getLineValue() const { return const_cast<Value*>(getOperand(1)); }
- Value *getColumnValue() const { return const_cast<Value*>(getOperand(2)); }
- Value *getContext() const {
- return StripCast(getOperand(3));
- }
-
- unsigned getLine() const {
- return unsigned(cast<ConstantInt>(getOperand(1))->getZExtValue());
- }
- unsigned getColumn() const {
- return unsigned(cast<ConstantInt>(getOperand(2))->getZExtValue());
- }
-
- std::string getFileName() const;
- std::string getDirectory() const;
-
- // Methods for support type inquiry through isa, cast, and dyn_cast:
- static inline bool classof(const DbgStopPointInst *) { return true; }
- static inline bool classof(const IntrinsicInst *I) {
- return I->getIntrinsicID() == Intrinsic::dbg_stoppoint;
- }
- static inline bool classof(const Value *V) {
- return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V));
- }
- };
-
- /// DbgFuncStartInst - This represents the llvm.dbg.func.start instruction.
- ///
- struct DbgFuncStartInst : public DbgInfoIntrinsic {
- Value *getSubprogram() const { return StripCast(getOperand(1)); }
-
- // Methods for support type inquiry through isa, cast, and dyn_cast:
- static inline bool classof(const DbgFuncStartInst *) { return true; }
- static inline bool classof(const IntrinsicInst *I) {
- return I->getIntrinsicID() == Intrinsic::dbg_func_start;
- }
- static inline bool classof(const Value *V) {
- return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V));
- }
- };
-
- /// DbgRegionStartInst - This represents the llvm.dbg.region.start
- /// instruction.
- struct DbgRegionStartInst : public DbgInfoIntrinsic {
- Value *getContext() const { return StripCast(getOperand(1)); }
-
- // Methods for support type inquiry through isa, cast, and dyn_cast:
- static inline bool classof(const DbgRegionStartInst *) { return true; }
- static inline bool classof(const IntrinsicInst *I) {
- return I->getIntrinsicID() == Intrinsic::dbg_region_start;
- }
- static inline bool classof(const Value *V) {
- return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V));
- }
- };
-
- /// DbgRegionEndInst - This represents the llvm.dbg.region.end instruction.
- ///
- struct DbgRegionEndInst : public DbgInfoIntrinsic {
- Value *getContext() const { return StripCast(getOperand(1)); }
-
- // Methods for support type inquiry through isa, cast, and dyn_cast:
- static inline bool classof(const DbgRegionEndInst *) { return true; }
- static inline bool classof(const IntrinsicInst *I) {
- return I->getIntrinsicID() == Intrinsic::dbg_region_end;
- }
- static inline bool classof(const Value *V) {
- return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V));
- }
- };
-
- /// DbgDeclareInst - This represents the llvm.dbg.declare instruction.
- ///
- struct DbgDeclareInst : public DbgInfoIntrinsic {
- Value *getAddress() const { return getOperand(1); }
- Value *getVariable() const { return StripCast(getOperand(2)); }
-
- // Methods for support type inquiry through isa, cast, and dyn_cast:
- static inline bool classof(const DbgDeclareInst *) { return true; }
- static inline bool classof(const IntrinsicInst *I) {
- return I->getIntrinsicID() == Intrinsic::dbg_declare;
- }
- static inline bool classof(const Value *V) {
- return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V));
- }
- };
-
- /// MemIntrinsic - This is the common base class for memset/memcpy/memmove.
- ///
- struct MemIntrinsic : public IntrinsicInst {
- Value *getRawDest() const { return const_cast<Value*>(getOperand(1)); }
-
- Value *getLength() const { return const_cast<Value*>(getOperand(3)); }
- ConstantInt *getAlignment() const {
- return cast<ConstantInt>(const_cast<Value*>(getOperand(4)));
- }
-
- /// getDest - This is just like getRawDest, but it strips off any cast
- /// instructions that feed it, giving the original input. The returned
- /// value is guaranteed to be a pointer.
- Value *getDest() const { return getRawDest()->stripPointerCasts(); }
-
- /// set* - Set the specified arguments of the instruction.
- ///
- void setDest(Value *Ptr) {
- assert(getRawDest()->getType() == Ptr->getType() &&
- "setDest called with pointer of wrong type!");
- setOperand(1, Ptr);
- }
-
- void setLength(Value *L) {
- assert(getLength()->getType() == L->getType() &&
- "setLength called with value of wrong type!");
- setOperand(3, L);
- }
- void setAlignment(ConstantInt *A) {
- assert(getAlignment()->getType() == A->getType() &&
- "setAlignment called with value of wrong type!");
- setOperand(4, A);
- }
-
- // Methods for support type inquiry through isa, cast, and dyn_cast:
- static inline bool classof(const MemIntrinsic *) { return true; }
- static inline bool classof(const IntrinsicInst *I) {
- switch (I->getIntrinsicID()) {
- case Intrinsic::memcpy_i32:
- case Intrinsic::memcpy_i64:
- case Intrinsic::memmove_i32:
- case Intrinsic::memmove_i64:
- case Intrinsic::memset_i32:
- case Intrinsic::memset_i64:
- return true;
- default: return false;
- }
- }
- static inline bool classof(const Value *V) {
- return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V));
- }
- };
-
-
- /// MemCpyInst - This class wraps the llvm.memcpy intrinsic.
- ///
- struct MemCpyInst : public MemIntrinsic {
- /// get* - Return the arguments to the instruction.
- ///
- Value *getRawSource() const { return const_cast<Value*>(getOperand(2)); }
-
- /// getSource - This is just like getRawSource, but it strips off any cast
- /// instructions that feed it, giving the original input. The returned
- /// value is guaranteed to be a pointer.
- Value *getSource() const { return getRawSource()->stripPointerCasts(); }
-
-
- void setSource(Value *Ptr) {
- assert(getRawSource()->getType() == Ptr->getType() &&
- "setSource called with pointer of wrong type!");
- setOperand(2, Ptr);
- }
-
- // Methods for support type inquiry through isa, cast, and dyn_cast:
- static inline bool classof(const MemCpyInst *) { return true; }
- static inline bool classof(const IntrinsicInst *I) {
- return I->getIntrinsicID() == Intrinsic::memcpy_i32 ||
- I->getIntrinsicID() == Intrinsic::memcpy_i64;
- }
- static inline bool classof(const Value *V) {
- return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V));
- }
- };
-
- /// MemMoveInst - This class wraps the llvm.memmove intrinsic.
- ///
- struct MemMoveInst : public MemIntrinsic {
- /// get* - Return the arguments to the instruction.
- ///
- Value *getRawSource() const { return const_cast<Value*>(getOperand(2)); }
-
- /// getSource - This is just like getRawSource, but it strips off any cast
- /// instructions that feed it, giving the original input. The returned
- /// value is guaranteed to be a pointer.
- Value *getSource() const { return getRawSource()->stripPointerCasts(); }
-
- void setSource(Value *Ptr) {
- assert(getRawSource()->getType() == Ptr->getType() &&
- "setSource called with pointer of wrong type!");
- setOperand(2, Ptr);
- }
-
- // Methods for support type inquiry through isa, cast, and dyn_cast:
- static inline bool classof(const MemMoveInst *) { return true; }
- static inline bool classof(const IntrinsicInst *I) {
- return I->getIntrinsicID() == Intrinsic::memmove_i32 ||
- I->getIntrinsicID() == Intrinsic::memmove_i64;
- }
- static inline bool classof(const Value *V) {
- return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V));
- }
- };
-
- /// MemSetInst - This class wraps the llvm.memset intrinsic.
- ///
- struct MemSetInst : public MemIntrinsic {
- /// get* - Return the arguments to the instruction.
- ///
- Value *getValue() const { return const_cast<Value*>(getOperand(2)); }
-
- void setValue(Value *Val) {
- assert(getValue()->getType() == Val->getType() &&
- "setSource called with pointer of wrong type!");
- setOperand(2, Val);
- }
-
- // Methods for support type inquiry through isa, cast, and dyn_cast:
- static inline bool classof(const MemSetInst *) { return true; }
- static inline bool classof(const IntrinsicInst *I) {
- return I->getIntrinsicID() == Intrinsic::memset_i32 ||
- I->getIntrinsicID() == Intrinsic::memset_i64;
- }
- static inline bool classof(const Value *V) {
- return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V));
- }
- };
-
-}
-
-#endif
diff --git a/release_23/include/llvm/Intrinsics.h b/release_23/include/llvm/Intrinsics.h
deleted file mode 100644
index 1874d1a29de2..000000000000
--- a/release_23/include/llvm/Intrinsics.h
+++ /dev/null
@@ -1,71 +0,0 @@
-//===-- llvm/Instrinsics.h - LLVM Intrinsic Function Handling ---*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines a set of enums which allow processing of intrinsic
-// functions. Values of these enum types are returned by
-// Function::getIntrinsicID.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_INTRINSICS_H
-#define LLVM_INTRINSICS_H
-
-#include <string>
-
-namespace llvm {
-
-class Type;
-class FunctionType;
-class Function;
-class Module;
-class PAListPtr;
-
-/// Intrinsic Namespace - This namespace contains an enum with a value for
-/// every intrinsic/builtin function known by LLVM. These enum values are
-/// returned by Function::getIntrinsicID().
-///
-namespace Intrinsic {
- enum ID {
- not_intrinsic = 0, // Must be zero
-
- // Get the intrinsic enums generated from Intrinsics.td
-#define GET_INTRINSIC_ENUM_VALUES
-#include "llvm/Intrinsics.gen"
-#undef GET_INTRINSIC_ENUM_VALUES
- , num_intrinsics
- };
-
- /// Intrinsic::getName(ID) - Return the LLVM name for an intrinsic, such as
- /// "llvm.ppc.altivec.lvx".
- std::string getName(ID id, const Type **Tys = 0, unsigned numTys = 0);
-
- /// Intrinsic::getType(ID) - Return the function type for an intrinsic.
- ///
- const FunctionType *getType(ID id, const Type **Tys = 0, unsigned numTys = 0);
-
- /// Intrinsic::getParamAttrs(ID) - Return the attributes for an intrinsic.
- ///
- PAListPtr getParamAttrs(ID id);
-
- /// Intrinsic::getDeclaration(M, ID) - Create or insert an LLVM Function
- /// declaration for an intrinsic, and return it.
- ///
- /// The Tys and numTys parameters are for intrinsics with overloaded types
- /// (i.e., those using iAny or fAny). For a declaration for an overloaded
- /// intrinsic, Tys should point to an array of numTys pointers to Type,
- /// and must provide exactly one type for each overloaded type in the
- /// intrinsic.
- Function *getDeclaration(Module *M, ID id, const Type **Tys = 0,
- unsigned numTys = 0);
-
-} // End Intrinsic namespace
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/Intrinsics.td b/release_23/include/llvm/Intrinsics.td
deleted file mode 100644
index 633063eb48fe..000000000000
--- a/release_23/include/llvm/Intrinsics.td
+++ /dev/null
@@ -1,340 +0,0 @@
-//===- Intrinsics.td - Defines all LLVM intrinsics ---------*- tablegen -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines properties of all LLVM intrinsics.
-//
-//===----------------------------------------------------------------------===//
-
-include "llvm/CodeGen/ValueTypes.td"
-
-//===----------------------------------------------------------------------===//
-// Properties we keep track of for intrinsics.
-//===----------------------------------------------------------------------===//
-
-class IntrinsicProperty;
-
-// Intr*Mem - Memory properties. An intrinsic is allowed to have exactly one of
-// these properties set. They are listed from the most aggressive (best to use
-// if correct) to the least aggressive. If no property is set, the worst case
-// is assumed (IntrWriteMem).
-
-// IntrNoMem - The intrinsic does not access memory or have any other side
-// effects. It may be CSE'd deleted if dead, etc.
-def IntrNoMem : IntrinsicProperty;
-
-// IntrReadArgMem - This intrinsic reads only from memory that one of its
-// arguments points to, but may read an unspecified amount.
-def IntrReadArgMem : IntrinsicProperty;
-
-// IntrReadMem - This intrinsic reads from unspecified memory, so it cannot be
-// moved across stores. However, it can be reordered otherwise and can be
-// deleted if dead.
-def IntrReadMem : IntrinsicProperty;
-
-// IntrWriteArgMem - This intrinsic reads and writes only from memory that one
-// of its arguments points to, but may access an unspecified amount. It has no
-// other side effects. This may only be used if the intrinsic doesn't "capture"
-// the argument pointer (e.g. storing it someplace).
-def IntrWriteArgMem : IntrinsicProperty;
-
-// IntrWriteMem - This intrinsic may read or modify unspecified memory or has
-// other side effects. It cannot be modified by the optimizer. This is the
-// default if the intrinsic has no other Intr*Mem property.
-def IntrWriteMem : IntrinsicProperty;
-
-//===----------------------------------------------------------------------===//
-// Types used by intrinsics.
-//===----------------------------------------------------------------------===//
-
-class LLVMType<ValueType vt> {
- ValueType VT = vt;
-}
-
-class LLVMPointerType<LLVMType elty>
- : LLVMType<iPTR>{
- LLVMType ElTy = elty;
-}
-
-class LLVMMatchType<int num>
- : LLVMType<OtherVT>{
- int Number = num;
-}
-
-def llvm_void_ty : LLVMType<isVoid>;
-def llvm_anyint_ty : LLVMType<iAny>;
-def llvm_anyfloat_ty : LLVMType<fAny>;
-def llvm_i1_ty : LLVMType<i1>;
-def llvm_i8_ty : LLVMType<i8>;
-def llvm_i16_ty : LLVMType<i16>;
-def llvm_i32_ty : LLVMType<i32>;
-def llvm_i64_ty : LLVMType<i64>;
-def llvm_float_ty : LLVMType<f32>;
-def llvm_double_ty : LLVMType<f64>;
-def llvm_f80_ty : LLVMType<f80>;
-def llvm_f128_ty : LLVMType<f128>;
-def llvm_ppcf128_ty : LLVMType<ppcf128>;
-def llvm_ptr_ty : LLVMPointerType<llvm_i8_ty>; // i8*
-def llvm_ptrptr_ty : LLVMPointerType<llvm_ptr_ty>; // i8**
-def llvm_empty_ty : LLVMType<OtherVT>; // { }
-def llvm_descriptor_ty : LLVMPointerType<llvm_empty_ty>; // { }*
-
-def llvm_v16i8_ty : LLVMType<v16i8>; // 16 x i8
-def llvm_v8i16_ty : LLVMType<v8i16>; // 8 x i16
-def llvm_v2i64_ty : LLVMType<v2i64>; // 2 x i64
-def llvm_v2i32_ty : LLVMType<v2i32>; // 2 x i32
-def llvm_v1i64_ty : LLVMType<v1i64>; // 1 x i64
-def llvm_v4i32_ty : LLVMType<v4i32>; // 4 x i32
-def llvm_v4f32_ty : LLVMType<v4f32>; // 4 x float
-def llvm_v2f64_ty : LLVMType<v2f64>; // 2 x double
-
-// MMX Vector Types
-def llvm_v8i8_ty : LLVMType<v8i8>; // 8 x i8
-def llvm_v4i16_ty : LLVMType<v4i16>; // 4 x i16
-
-def llvm_vararg_ty : LLVMType<isVoid>; // this means vararg here
-
-//===----------------------------------------------------------------------===//
-// Intrinsic Definitions.
-//===----------------------------------------------------------------------===//
-
-// Intrinsic class - This is used to define one LLVM intrinsic. The name of the
-// intrinsic definition should start with "int_", then match the LLVM intrinsic
-// name with the "llvm." prefix removed, and all "."s turned into "_"s. For
-// example, llvm.bswap.i16 -> int_bswap_i16.
-//
-// * Types is a list containing the return type and the argument types
-// expected for the intrinsic.
-// * Properties can be set to describe the behavior of the intrinsic.
-//
-class Intrinsic<list<LLVMType> types,
- list<IntrinsicProperty> properties = [],
- string name = ""> {
- string LLVMName = name;
- string TargetPrefix = ""; // Set to a prefix for target-specific intrinsics.
- list<LLVMType> Types = types;
- list<IntrinsicProperty> Properties = properties;
-}
-
-/// GCCBuiltin - If this intrinsic exactly corresponds to a GCC builtin, this
-/// specifies the name of the builtin. This provides automatic CBE and CFE
-/// support.
-class GCCBuiltin<string name> {
- string GCCBuiltinName = name;
-}
-
-
-//===--------------- Variable Argument Handling Intrinsics ----------------===//
-//
-
-def int_vastart : Intrinsic<[llvm_void_ty, llvm_ptr_ty], [], "llvm.va_start">;
-def int_vacopy : Intrinsic<[llvm_void_ty, llvm_ptr_ty, llvm_ptr_ty], [],
- "llvm.va_copy">;
-def int_vaend : Intrinsic<[llvm_void_ty, llvm_ptr_ty], [], "llvm.va_end">;
-
-//===------------------- Garbage Collection Intrinsics --------------------===//
-//
-def int_gcroot : Intrinsic<[llvm_void_ty, llvm_ptrptr_ty, llvm_ptr_ty]>;
-def int_gcread : Intrinsic<[llvm_ptr_ty, llvm_ptr_ty, llvm_ptrptr_ty],
- [IntrReadArgMem]>;
-def int_gcwrite : Intrinsic<[llvm_void_ty, llvm_ptr_ty, llvm_ptr_ty,
- llvm_ptrptr_ty], [IntrWriteArgMem]>;
-
-//===--------------------- Code Generator Intrinsics ----------------------===//
-//
-def int_returnaddress : Intrinsic<[llvm_ptr_ty, llvm_i32_ty], [IntrNoMem]>;
-def int_frameaddress : Intrinsic<[llvm_ptr_ty, llvm_i32_ty], [IntrNoMem]>;
-
-// Note: we treat stacksave/stackrestore as writemem because we don't otherwise
-// model their dependencies on allocas.
-def int_stacksave : Intrinsic<[llvm_ptr_ty]>,
- GCCBuiltin<"__builtin_stack_save">;
-def int_stackrestore : Intrinsic<[llvm_void_ty, llvm_ptr_ty]>,
- GCCBuiltin<"__builtin_stack_restore">;
-// IntrWriteArgMem is more pessimistic than strictly necessary for prefetch,
-// however it does conveniently prevent the prefetch from being reordered
-// with respect to nearby accesses to the same memory.
-def int_prefetch : Intrinsic<[llvm_void_ty, llvm_ptr_ty,
- llvm_i32_ty, llvm_i32_ty],
- [IntrWriteArgMem]>;
-def int_pcmarker : Intrinsic<[llvm_void_ty, llvm_i32_ty]>;
-
-def int_readcyclecounter : Intrinsic<[llvm_i64_ty]>;
-
-//===------------------- Standard C Library Intrinsics --------------------===//
-//
-
-let Properties = [IntrWriteArgMem] in {
- def int_memcpy_i32 : Intrinsic<[llvm_void_ty, llvm_ptr_ty, llvm_ptr_ty,
- llvm_i32_ty, llvm_i32_ty]>;
- def int_memcpy_i64 : Intrinsic<[llvm_void_ty, llvm_ptr_ty, llvm_ptr_ty,
- llvm_i64_ty, llvm_i32_ty]>;
- def int_memmove_i32 : Intrinsic<[llvm_void_ty, llvm_ptr_ty, llvm_ptr_ty,
- llvm_i32_ty, llvm_i32_ty]>;
- def int_memmove_i64 : Intrinsic<[llvm_void_ty, llvm_ptr_ty, llvm_ptr_ty,
- llvm_i64_ty, llvm_i32_ty]>;
- def int_memset_i32 : Intrinsic<[llvm_void_ty, llvm_ptr_ty, llvm_i8_ty,
- llvm_i32_ty, llvm_i32_ty]>;
- def int_memset_i64 : Intrinsic<[llvm_void_ty, llvm_ptr_ty, llvm_i8_ty,
- llvm_i64_ty, llvm_i32_ty]>;
-}
-
-let Properties = [IntrNoMem] in {
- def int_sqrt : Intrinsic<[llvm_anyfloat_ty, LLVMMatchType<0>]>;
- def int_powi : Intrinsic<[llvm_anyfloat_ty, LLVMMatchType<0>, llvm_i32_ty]>;
- def int_sin : Intrinsic<[llvm_anyfloat_ty, LLVMMatchType<0>]>;
- def int_cos : Intrinsic<[llvm_anyfloat_ty, LLVMMatchType<0>]>;
- def int_pow : Intrinsic<[llvm_anyfloat_ty,
- LLVMMatchType<0>, LLVMMatchType<0>]>;
-}
-
-// NOTE: these are internal interfaces.
-def int_setjmp : Intrinsic<[llvm_i32_ty , llvm_ptr_ty]>;
-def int_longjmp : Intrinsic<[llvm_void_ty, llvm_ptr_ty, llvm_i32_ty]>;
-def int_sigsetjmp : Intrinsic<[llvm_i32_ty , llvm_ptr_ty, llvm_i32_ty]>;
-def int_siglongjmp : Intrinsic<[llvm_void_ty, llvm_ptr_ty, llvm_i32_ty]>;
-
-//===-------------------- Bit Manipulation Intrinsics ---------------------===//
-//
-
-// None of these intrinsics accesses memory at all.
-let Properties = [IntrNoMem] in {
- def int_bswap: Intrinsic<[llvm_anyint_ty, LLVMMatchType<0>]>;
- def int_ctpop: Intrinsic<[llvm_anyint_ty, LLVMMatchType<0>]>;
- def int_ctlz : Intrinsic<[llvm_anyint_ty, LLVMMatchType<0>]>;
- def int_cttz : Intrinsic<[llvm_anyint_ty, LLVMMatchType<0>]>;
- def int_part_select :
- Intrinsic<[llvm_anyint_ty, LLVMMatchType<0>, llvm_i32_ty, llvm_i32_ty]>;
- def int_part_set :
- Intrinsic<[llvm_anyint_ty, LLVMMatchType<0>, llvm_anyint_ty, llvm_i32_ty,
- llvm_i32_ty]>;
-}
-
-//===------------------------ Debugger Intrinsics -------------------------===//
-//
-
-def int_dbg_stoppoint : Intrinsic<[llvm_void_ty,
- llvm_i32_ty, llvm_i32_ty,
- llvm_descriptor_ty]>;
-def int_dbg_region_start : Intrinsic<[llvm_void_ty, llvm_descriptor_ty]>;
-def int_dbg_region_end : Intrinsic<[llvm_void_ty, llvm_descriptor_ty]>;
-def int_dbg_func_start : Intrinsic<[llvm_void_ty, llvm_descriptor_ty]>;
-def int_dbg_declare : Intrinsic<[llvm_void_ty, llvm_descriptor_ty,
- llvm_descriptor_ty]>;
-
-//===------------------ Exception Handling Intrinsics----------------------===//
-//
-def int_eh_exception : Intrinsic<[llvm_ptr_ty]>;
-def int_eh_selector_i32 : Intrinsic<[llvm_i32_ty, llvm_ptr_ty, llvm_ptr_ty,
- llvm_vararg_ty]>;
-def int_eh_selector_i64 : Intrinsic<[llvm_i64_ty, llvm_ptr_ty, llvm_ptr_ty,
- llvm_vararg_ty]>;
-
-def int_eh_typeid_for_i32 : Intrinsic<[llvm_i32_ty, llvm_ptr_ty]>;
-def int_eh_typeid_for_i64 : Intrinsic<[llvm_i64_ty, llvm_ptr_ty]>;
-
-def int_eh_return : Intrinsic<[llvm_void_ty, llvm_i32_ty, llvm_ptr_ty]>,
- GCCBuiltin<"__builtin_eh_return">;
-
-def int_eh_unwind_init: Intrinsic<[llvm_void_ty]>,
- GCCBuiltin<"__builtin_unwind_init">;
-
-def int_eh_dwarf_cfa : Intrinsic<[llvm_ptr_ty, llvm_i32_ty]>;
-
-//===---------------- Generic Variable Attribute Intrinsics----------------===//
-//
-def int_var_annotation : Intrinsic<[llvm_void_ty, llvm_ptr_ty, llvm_ptr_ty,
- llvm_ptr_ty, llvm_i32_ty],
- [], "llvm.var.annotation">;
-
-def int_annotation : Intrinsic<[llvm_anyint_ty, LLVMMatchType<0>, llvm_ptr_ty,
- llvm_ptr_ty, llvm_i32_ty],
- [], "llvm.annotation">;
-
-//===------------------------ Trampoline Intrinsics -----------------------===//
-//
-def int_init_trampoline : Intrinsic<[llvm_ptr_ty, llvm_ptr_ty, llvm_ptr_ty,
- llvm_ptr_ty], []>,
- GCCBuiltin<"__builtin_init_trampoline">;
-
-//===------------------------- Atomic Intrinsics --------------------------===//
-//
-def int_memory_barrier : Intrinsic<[llvm_void_ty, llvm_i1_ty, llvm_i1_ty,
- llvm_i1_ty, llvm_i1_ty, llvm_i1_ty], []>;
-
-def int_atomic_lcs : Intrinsic<[llvm_anyint_ty,
- LLVMPointerType<LLVMMatchType<0>>,
- LLVMMatchType<0>, LLVMMatchType<0>],
- [IntrWriteArgMem]>,
- GCCBuiltin<"__sync_val_compare_and_swap">;
-def int_atomic_las : Intrinsic<[llvm_anyint_ty,
- LLVMPointerType<LLVMMatchType<0>>,
- LLVMMatchType<0>],
- [IntrWriteArgMem]>,
- GCCBuiltin<"__sync_fetch_and_add">;
-def int_atomic_swap : Intrinsic<[llvm_anyint_ty,
- LLVMPointerType<LLVMMatchType<0>>,
- LLVMMatchType<0>],
- [IntrWriteArgMem]>,
- GCCBuiltin<"__sync_lock_test_and_set">;
-def int_atomic_lss : Intrinsic<[llvm_anyint_ty,
- LLVMPointerType<LLVMMatchType<0>>,
- LLVMMatchType<0>],
- [IntrWriteArgMem]>,
- GCCBuiltin<"__sync_fetch_and_sub">;
-def int_atomic_load_and : Intrinsic<[llvm_anyint_ty,
- LLVMPointerType<LLVMMatchType<0>>,
- LLVMMatchType<0>],
- [IntrWriteArgMem]>,
- GCCBuiltin<"__sync_fetch_and_and">;
-def int_atomic_load_or : Intrinsic<[llvm_anyint_ty,
- LLVMPointerType<LLVMMatchType<0>>,
- LLVMMatchType<0>],
- [IntrWriteArgMem]>,
- GCCBuiltin<"__sync_fetch_and_or">;
-def int_atomic_load_xor : Intrinsic<[llvm_anyint_ty,
- LLVMPointerType<LLVMMatchType<0>>,
- LLVMMatchType<0>],
- [IntrWriteArgMem]>,
- GCCBuiltin<"__sync_fetch_and_xor">;
-def int_atomic_load_min : Intrinsic<[llvm_anyint_ty,
- LLVMPointerType<LLVMMatchType<0>>,
- LLVMMatchType<0>],
- [IntrWriteArgMem]>,
- GCCBuiltin<"__sync_fetch_and_min">;
-def int_atomic_load_max : Intrinsic<[llvm_anyint_ty,
- LLVMPointerType<LLVMMatchType<0>>,
- LLVMMatchType<0>],
- [IntrWriteArgMem]>,
- GCCBuiltin<"__sync_fetch_and_max">;
-def int_atomic_load_umin : Intrinsic<[llvm_anyint_ty,
- LLVMPointerType<LLVMMatchType<0>>,
- LLVMMatchType<0>],
- [IntrWriteArgMem]>,
- GCCBuiltin<"__sync_fetch_and_umin">;
-def int_atomic_load_umax : Intrinsic<[llvm_anyint_ty,
- LLVMPointerType<LLVMMatchType<0>>,
- LLVMMatchType<0>],
- [IntrWriteArgMem]>,
- GCCBuiltin<"__sync_fetch_and_umax">;
-
-//===-------------------------- Other Intrinsics --------------------------===//
-//
-def int_flt_rounds : Intrinsic<[llvm_i32_ty]>,
- GCCBuiltin<"__builtin_flt_rounds">;
-def int_trap : Intrinsic<[llvm_void_ty]>,
- GCCBuiltin<"__builtin_trap">;
-
-//===----------------------------------------------------------------------===//
-// Target-specific intrinsics
-//===----------------------------------------------------------------------===//
-
-include "llvm/IntrinsicsPowerPC.td"
-include "llvm/IntrinsicsX86.td"
-include "llvm/IntrinsicsARM.td"
-include "llvm/IntrinsicsCellSPU.td"
diff --git a/release_23/include/llvm/IntrinsicsARM.td b/release_23/include/llvm/IntrinsicsARM.td
deleted file mode 100644
index f261fe535162..000000000000
--- a/release_23/include/llvm/IntrinsicsARM.td
+++ /dev/null
@@ -1,21 +0,0 @@
-//===- IntrinsicsARM.td - Defines ARM intrinsics -----------*- tablegen -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines all of the ARM-specific intrinsics.
-//
-//===----------------------------------------------------------------------===//
-
-
-//===----------------------------------------------------------------------===//
-// TLS
-
-let TargetPrefix = "arm" in { // All intrinsics start with "llvm.arm.".
- def int_arm_thread_pointer : GCCBuiltin<"__builtin_thread_pointer">,
- Intrinsic<[llvm_ptr_ty],[IntrNoMem]>;
-}
diff --git a/release_23/include/llvm/IntrinsicsCellSPU.td b/release_23/include/llvm/IntrinsicsCellSPU.td
deleted file mode 100644
index b956bc5d1d66..000000000000
--- a/release_23/include/llvm/IntrinsicsCellSPU.td
+++ /dev/null
@@ -1,242 +0,0 @@
-//==- IntrinsicsCellSPU.td - Cell SDK intrinsics -*- tablegen -*-==//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// Department at The Aerospace Corporation and is distributed under the
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-// Cell SPU Instructions:
-//===----------------------------------------------------------------------===//
-// TODO Items (not urgent today, but would be nice, low priority)
-//
-// ANDBI, ORBI: SPU constructs a 4-byte constant for these instructions by
-// concatenating the byte argument b as "bbbb". Could recognize this bit pattern
-// in 16-bit and 32-bit constants and reduce instruction count.
-//===----------------------------------------------------------------------===//
-
-// 7-bit integer type, used as an immediate:
-def cell_i7_ty: LLVMType<i8>;
-def cell_i8_ty: LLVMType<i8>;
-
-// Keep this here until it's actually supported:
-def llvm_i128_ty : LLVMType<i128>;
-
-class v16i8_u7imm<string builtin_suffix> :
- GCCBuiltin<!strconcat("__builtin_si_", builtin_suffix)>,
- Intrinsic<[llvm_v16i8_ty, llvm_v16i8_ty, cell_i7_ty],
- [IntrNoMem]>;
-
-class v16i8_u8imm<string builtin_suffix> :
- GCCBuiltin<!strconcat("__builtin_si_", builtin_suffix)>,
- Intrinsic<[llvm_v16i8_ty, llvm_v16i8_ty, llvm_i8_ty],
- [IntrNoMem]>;
-
-class v16i8_s10imm<string builtin_suffix> :
- GCCBuiltin<!strconcat("__builtin_si_", builtin_suffix)>,
- Intrinsic<[llvm_v16i8_ty, llvm_v16i8_ty, llvm_i16_ty],
- [IntrNoMem]>;
-
-class v16i8_u16imm<string builtin_suffix> :
- GCCBuiltin<!strconcat("__builtin_si_", builtin_suffix)>,
- Intrinsic<[llvm_v16i8_ty, llvm_v16i8_ty, llvm_i16_ty],
- [IntrNoMem]>;
-
-class v16i8_rr<string builtin_suffix> :
- GCCBuiltin<!strconcat("__builtin_si_", builtin_suffix)>,
- Intrinsic<[llvm_v16i8_ty, llvm_v16i8_ty, llvm_v16i8_ty],
- [IntrNoMem]>;
-
-class v8i16_s10imm<string builtin_suffix> :
- GCCBuiltin<!strconcat("__builtin_si_", builtin_suffix)>,
- Intrinsic<[llvm_v8i16_ty, llvm_v8i16_ty, llvm_i16_ty],
- [IntrNoMem]>;
-
-class v8i16_u16imm<string builtin_suffix> :
- GCCBuiltin<!strconcat("__builtin_si_", builtin_suffix)>,
- Intrinsic<[llvm_v8i16_ty, llvm_v8i16_ty, llvm_i16_ty],
- [IntrNoMem]>;
-
-class v8i16_rr<string builtin_suffix> :
- GCCBuiltin<!strconcat("__builtin_si_", builtin_suffix)>,
- Intrinsic<[llvm_v8i16_ty, llvm_v8i16_ty, llvm_v8i16_ty],
- [IntrNoMem]>;
-
-class v4i32_rr<string builtin_suffix> :
- GCCBuiltin<!strconcat("__builtin_si_", builtin_suffix)>,
- Intrinsic<[llvm_v4i32_ty, llvm_v4i32_ty, llvm_v4i32_ty],
- [IntrNoMem]>;
-
-class v4i32_u7imm<string builtin_suffix> :
- GCCBuiltin<!strconcat("__builtin_si_", builtin_suffix)>,
- Intrinsic<[llvm_v4i32_ty, llvm_v4i32_ty, cell_i7_ty],
- [IntrNoMem]>;
-
-class v4i32_s10imm<string builtin_suffix> :
- GCCBuiltin<!strconcat("__builtin_si_", builtin_suffix)>,
- Intrinsic<[llvm_v4i32_ty, llvm_v4i32_ty, llvm_i16_ty],
- [IntrNoMem]>;
-
-class v4i32_u16imm<string builtin_suffix> :
- GCCBuiltin<!strconcat("__builtin_si_", builtin_suffix)>,
- Intrinsic<[llvm_v4i32_ty, llvm_v4i32_ty, llvm_i16_ty],
- [IntrNoMem]>;
-
-class v4f32_rr<string builtin_suffix> :
- GCCBuiltin<!strconcat("__builtin_si_", builtin_suffix)>,
- Intrinsic<[llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4f32_ty],
- [IntrNoMem]>;
-
-class v4f32_rrr<string builtin_suffix> :
- GCCBuiltin<!strconcat("__builtin_si_", builtin_suffix)>,
- Intrinsic<[llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4f32_ty],
- [IntrNoMem]>;
-
-class v2f64_rr<string builtin_suffix> :
- GCCBuiltin<!strconcat("__builtin_si_", builtin_suffix)>,
- Intrinsic<[llvm_v2f64_ty, llvm_v2f64_ty, llvm_v2f64_ty],
- [IntrNoMem]>;
-
-// All Cell SPU intrinsics start with "llvm.spu.".
-let TargetPrefix = "spu" in {
- def int_spu_si_fsmbi : v8i16_u16imm<"fsmbi">;
- def int_spu_si_ah : v8i16_rr<"ah">;
- def int_spu_si_ahi : v8i16_s10imm<"ahi">;
- def int_spu_si_a : v4i32_rr<"a">;
- def int_spu_si_ai : v4i32_s10imm<"ai">;
- def int_spu_si_sfh : v8i16_rr<"sfh">;
- def int_spu_si_sfhi : v8i16_s10imm<"sfhi">;
- def int_spu_si_sf : v4i32_rr<"sf">;
- def int_spu_si_sfi : v4i32_s10imm<"sfi">;
- def int_spu_si_addx : v4i32_rr<"addx">;
- def int_spu_si_cg : v4i32_rr<"cg">;
- def int_spu_si_cgx : v4i32_rr<"cgx">;
- def int_spu_si_sfx : v4i32_rr<"sfx">;
- def int_spu_si_bg : v4i32_rr<"bg">;
- def int_spu_si_bgx : v4i32_rr<"bgx">;
- def int_spu_si_mpy : // This is special:
- GCCBuiltin<"__builtin_si_mpy">,
- Intrinsic<[llvm_v4i32_ty, llvm_v8i16_ty, llvm_v8i16_ty],
- [IntrNoMem]>;
- def int_spu_si_mpyu : // This is special:
- GCCBuiltin<"__builtin_si_mpyu">,
- Intrinsic<[llvm_v4i32_ty, llvm_v8i16_ty, llvm_v8i16_ty],
- [IntrNoMem]>;
- def int_spu_si_mpyi : // This is special:
- GCCBuiltin<"__builtin_si_mpyi">,
- Intrinsic<[llvm_v4i32_ty, llvm_v8i16_ty, llvm_i16_ty],
- [IntrNoMem]>;
- def int_spu_si_mpyui : // This is special:
- GCCBuiltin<"__builtin_si_mpyui">,
- Intrinsic<[llvm_v4i32_ty, llvm_v8i16_ty, llvm_i16_ty],
- [IntrNoMem]>;
- def int_spu_si_mpya : // This is special:
- GCCBuiltin<"__builtin_si_mpya">,
- Intrinsic<[llvm_v4i32_ty, llvm_v8i16_ty, llvm_v8i16_ty, llvm_v8i16_ty],
- [IntrNoMem]>;
- def int_spu_si_mpyh : // This is special:
- GCCBuiltin<"__builtin_si_mpyh">,
- Intrinsic<[llvm_v4i32_ty, llvm_v4i32_ty, llvm_v8i16_ty],
- [IntrNoMem]>;
- def int_spu_si_mpys : // This is special:
- GCCBuiltin<"__builtin_si_mpys">,
- Intrinsic<[llvm_v4i32_ty, llvm_v8i16_ty, llvm_v8i16_ty],
- [IntrNoMem]>;
- def int_spu_si_mpyhh : // This is special:
- GCCBuiltin<"__builtin_si_mpyhh">,
- Intrinsic<[llvm_v4i32_ty, llvm_v8i16_ty, llvm_v8i16_ty],
- [IntrNoMem]>;
- def int_spu_si_mpyhha : // This is special:
- GCCBuiltin<"__builtin_si_mpyhha">,
- Intrinsic<[llvm_v4i32_ty, llvm_v8i16_ty, llvm_v8i16_ty],
- [IntrNoMem]>;
- def int_spu_si_mpyhhu : // This is special:
- GCCBuiltin<"__builtin_si_mpyhhu">,
- Intrinsic<[llvm_v4i32_ty, llvm_v8i16_ty, llvm_v8i16_ty],
- [IntrNoMem]>;
- def int_spu_si_mpyhhau : // This is special:
- GCCBuiltin<"__builtin_si_mpyhhau">,
- Intrinsic<[llvm_v4i32_ty, llvm_v8i16_ty, llvm_v8i16_ty],
- [IntrNoMem]>;
-
- def int_spu_si_shli: v4i32_u7imm<"shli">;
-
- def int_spu_si_shlqbi:
- GCCBuiltin<!strconcat("__builtin_si_", "shlqbi")>,
- Intrinsic<[llvm_v8i16_ty, llvm_v8i16_ty, llvm_i32_ty],
- [IntrNoMem]>;
-
- def int_spu_si_shlqbii: v16i8_u7imm<"shlqbii">;
- def int_spu_si_shlqby:
- GCCBuiltin<!strconcat("__builtin_si_", "shlqby")>,
- Intrinsic<[llvm_v8i16_ty, llvm_v8i16_ty, llvm_i32_ty],
- [IntrNoMem]>;
- def int_spu_si_shlqbyi: v16i8_u7imm<"shlqbyi">;
-
- def int_spu_si_ceq: v4i32_rr<"ceq">;
- def int_spu_si_ceqi: v4i32_s10imm<"ceqi">;
- def int_spu_si_ceqb: v16i8_rr<"ceqb">;
- def int_spu_si_ceqbi: v16i8_u8imm<"ceqbi">;
- def int_spu_si_ceqh: v8i16_rr<"ceqh">;
- def int_spu_si_ceqhi: v8i16_s10imm<"ceqhi">;
- def int_spu_si_cgt: v4i32_rr<"cgt">;
- def int_spu_si_cgti: v4i32_s10imm<"cgti">;
- def int_spu_si_cgtb: v16i8_rr<"cgtb">;
- def int_spu_si_cgtbi: v16i8_u8imm<"cgtbi">;
- def int_spu_si_cgth: v8i16_rr<"cgth">;
- def int_spu_si_cgthi: v8i16_s10imm<"cgthi">;
- def int_spu_si_clgtb: v16i8_rr<"clgtb">;
- def int_spu_si_clgtbi: v16i8_u8imm<"clgtbi">;
- def int_spu_si_clgth: v8i16_rr<"clgth">;
- def int_spu_si_clgthi: v8i16_s10imm<"clgthi">;
- def int_spu_si_clgt: v4i32_rr<"clgt">;
- def int_spu_si_clgti: v4i32_s10imm<"clgti">;
-
- def int_spu_si_and: v4i32_rr<"and">;
- def int_spu_si_andbi: v16i8_u8imm<"andbi">;
- def int_spu_si_andc: v4i32_rr<"andc">;
- def int_spu_si_andhi: v8i16_s10imm<"andhi">;
- def int_spu_si_andi: v4i32_s10imm<"andi">;
-
- def int_spu_si_or: v4i32_rr<"or">;
- def int_spu_si_orbi: v16i8_u8imm<"orbi">;
- def int_spu_si_orc: v4i32_rr<"orc">;
- def int_spu_si_orhi: v8i16_s10imm<"orhi">;
- def int_spu_si_ori: v4i32_s10imm<"ori">;
-
- def int_spu_si_xor: v4i32_rr<"xor">;
- def int_spu_si_xorbi: v16i8_u8imm<"xorbi">;
- def int_spu_si_xorhi: v8i16_s10imm<"xorhi">;
- def int_spu_si_xori: v4i32_s10imm<"xori">;
-
- def int_spu_si_nor: v4i32_rr<"nor">;
- def int_spu_si_nand: v4i32_rr<"nand">;
-
- def int_spu_si_fa: v4f32_rr<"fa">;
- def int_spu_si_fs: v4f32_rr<"fs">;
- def int_spu_si_fm: v4f32_rr<"fm">;
-
- def int_spu_si_fceq: v4f32_rr<"fceq">;
- def int_spu_si_fcmeq: v4f32_rr<"fcmeq">;
- def int_spu_si_fcgt: v4f32_rr<"fcgt">;
- def int_spu_si_fcmgt: v4f32_rr<"fcmgt">;
-
- def int_spu_si_fma: v4f32_rrr<"fma">;
- def int_spu_si_fnms: v4f32_rrr<"fnms">;
- def int_spu_si_fms: v4f32_rrr<"fms">;
-
- def int_spu_si_dfa: v2f64_rr<"dfa">;
- def int_spu_si_dfs: v2f64_rr<"dfs">;
- def int_spu_si_dfm: v2f64_rr<"dfm">;
-
-//def int_spu_si_dfceq: v2f64_rr<"dfceq">;
-//def int_spu_si_dfcmeq: v2f64_rr<"dfcmeq">;
-//def int_spu_si_dfcgt: v2f64_rr<"dfcgt">;
-//def int_spu_si_dfcmgt: v2f64_rr<"dfcmgt">;
-
- def int_spu_si_dfnma: v2f64_rr<"dfnma">;
- def int_spu_si_dfma: v2f64_rr<"dfma">;
- def int_spu_si_dfnms: v2f64_rr<"dfnms">;
- def int_spu_si_dfms: v2f64_rr<"dfms">;
-}
diff --git a/release_23/include/llvm/IntrinsicsPowerPC.td b/release_23/include/llvm/IntrinsicsPowerPC.td
deleted file mode 100644
index a39f436acade..000000000000
--- a/release_23/include/llvm/IntrinsicsPowerPC.td
+++ /dev/null
@@ -1,462 +0,0 @@
-//===- IntrinsicsPowerPC.td - Defines PowerPC intrinsics ---*- tablegen -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines all of the PowerPC-specific intrinsics.
-//
-//===----------------------------------------------------------------------===//
-
-//===----------------------------------------------------------------------===//
-// Definitions for all PowerPC intrinsics.
-//
-
-// Non-altivec intrinsics.
-let TargetPrefix = "ppc" in { // All intrinsics start with "llvm.ppc.".
- // dcba/dcbf/dcbi/dcbst/dcbt/dcbz/dcbzl(PPC970) instructions.
- def int_ppc_dcba : Intrinsic<[llvm_void_ty, llvm_ptr_ty], [IntrWriteMem]>;
- def int_ppc_dcbf : Intrinsic<[llvm_void_ty, llvm_ptr_ty], [IntrWriteMem]>;
- def int_ppc_dcbi : Intrinsic<[llvm_void_ty, llvm_ptr_ty], [IntrWriteMem]>;
- def int_ppc_dcbst : Intrinsic<[llvm_void_ty, llvm_ptr_ty], [IntrWriteMem]>;
- def int_ppc_dcbt : Intrinsic<[llvm_void_ty, llvm_ptr_ty], [IntrWriteMem]>;
- def int_ppc_dcbtst: Intrinsic<[llvm_void_ty, llvm_ptr_ty], [IntrWriteMem]>;
- def int_ppc_dcbz : Intrinsic<[llvm_void_ty, llvm_ptr_ty], [IntrWriteMem]>;
- def int_ppc_dcbzl : Intrinsic<[llvm_void_ty, llvm_ptr_ty], [IntrWriteMem]>;
-}
-
-
-let TargetPrefix = "ppc" in { // All PPC intrinsics start with "llvm.ppc.".
- /// PowerPC_Vec_Intrinsic - Base class for all altivec intrinsics.
- class PowerPC_Vec_Intrinsic<string GCCIntSuffix, list<LLVMType> types,
- list<IntrinsicProperty> properties>
- : GCCBuiltin<!strconcat("__builtin_altivec_", GCCIntSuffix)>,
- Intrinsic<types, properties>;
-}
-
-//===----------------------------------------------------------------------===//
-// PowerPC Altivec Intrinsic Class Definitions.
-//
-
-/// PowerPC_Vec_FF_Intrinsic - A PowerPC intrinsic that takes one v4f32
-/// vector and returns one. These intrinsics have no side effects.
-class PowerPC_Vec_FF_Intrinsic<string GCCIntSuffix>
- : PowerPC_Vec_Intrinsic<GCCIntSuffix,
- [llvm_v4f32_ty, llvm_v4f32_ty], [IntrNoMem]>;
-
-/// PowerPC_Vec_FFF_Intrinsic - A PowerPC intrinsic that takes two v4f32
-/// vectors and returns one. These intrinsics have no side effects.
-class PowerPC_Vec_FFF_Intrinsic<string GCCIntSuffix>
- : PowerPC_Vec_Intrinsic<GCCIntSuffix,
- [llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4f32_ty],
- [IntrNoMem]>;
-
-/// PowerPC_Vec_BBB_Intrinsic - A PowerPC intrinsic that takes two v16f8
-/// vectors and returns one. These intrinsics have no side effects.
-class PowerPC_Vec_BBB_Intrinsic<string GCCIntSuffix>
- : PowerPC_Vec_Intrinsic<GCCIntSuffix,
- [llvm_v16i8_ty, llvm_v16i8_ty, llvm_v16i8_ty],
- [IntrNoMem]>;
-
-/// PowerPC_Vec_HHH_Intrinsic - A PowerPC intrinsic that takes two v8i16
-/// vectors and returns one. These intrinsics have no side effects.
-class PowerPC_Vec_HHH_Intrinsic<string GCCIntSuffix>
- : PowerPC_Vec_Intrinsic<GCCIntSuffix,
- [llvm_v8i16_ty, llvm_v8i16_ty, llvm_v8i16_ty],
- [IntrNoMem]>;
-
-/// PowerPC_Vec_WWW_Intrinsic - A PowerPC intrinsic that takes two v4i32
-/// vectors and returns one. These intrinsics have no side effects.
-class PowerPC_Vec_WWW_Intrinsic<string GCCIntSuffix>
- : PowerPC_Vec_Intrinsic<GCCIntSuffix,
- [llvm_v4i32_ty, llvm_v4i32_ty, llvm_v4i32_ty],
- [IntrNoMem]>;
-
-
-//===----------------------------------------------------------------------===//
-// PowerPC Altivec Intrinsic Definitions.
-
-let TargetPrefix = "ppc" in { // All intrinsics start with "llvm.ppc.".
- // Data Stream Control.
- def int_ppc_altivec_dss : GCCBuiltin<"__builtin_altivec_dss">,
- Intrinsic<[llvm_void_ty, llvm_i32_ty], [IntrWriteMem]>;
- def int_ppc_altivec_dssall : GCCBuiltin<"__builtin_altivec_dssall">,
- Intrinsic<[llvm_void_ty], [IntrWriteMem]>;
- def int_ppc_altivec_dst : GCCBuiltin<"__builtin_altivec_dst">,
- Intrinsic<[llvm_void_ty, llvm_ptr_ty, llvm_i32_ty, llvm_i32_ty],
- [IntrWriteMem]>;
- def int_ppc_altivec_dstt : GCCBuiltin<"__builtin_altivec_dstt">,
- Intrinsic<[llvm_void_ty, llvm_ptr_ty, llvm_i32_ty, llvm_i32_ty],
- [IntrWriteMem]>;
- def int_ppc_altivec_dstst : GCCBuiltin<"__builtin_altivec_dstst">,
- Intrinsic<[llvm_void_ty, llvm_ptr_ty, llvm_i32_ty, llvm_i32_ty],
- [IntrWriteMem]>;
- def int_ppc_altivec_dststt : GCCBuiltin<"__builtin_altivec_dststt">,
- Intrinsic<[llvm_void_ty, llvm_ptr_ty, llvm_i32_ty, llvm_i32_ty],
- [IntrWriteMem]>;
-
- // VSCR access.
- def int_ppc_altivec_mfvscr : GCCBuiltin<"__builtin_altivec_mfvscr">,
- Intrinsic<[llvm_v8i16_ty], [IntrReadMem]>;
- def int_ppc_altivec_mtvscr : GCCBuiltin<"__builtin_altivec_mtvscr">,
- Intrinsic<[llvm_void_ty, llvm_v4i32_ty], [IntrWriteMem]>;
-
-
- // Loads. These don't map directly to GCC builtins because they represent the
- // source address with a single pointer.
- def int_ppc_altivec_lvx :
- Intrinsic<[llvm_v4i32_ty, llvm_ptr_ty], [IntrReadMem]>;
- def int_ppc_altivec_lvxl :
- Intrinsic<[llvm_v4i32_ty, llvm_ptr_ty], [IntrReadMem]>;
- def int_ppc_altivec_lvebx :
- Intrinsic<[llvm_v16i8_ty, llvm_ptr_ty], [IntrReadMem]>;
- def int_ppc_altivec_lvehx :
- Intrinsic<[llvm_v8i16_ty, llvm_ptr_ty], [IntrReadMem]>;
- def int_ppc_altivec_lvewx :
- Intrinsic<[llvm_v4i32_ty, llvm_ptr_ty], [IntrReadMem]>;
-
- // Stores. These don't map directly to GCC builtins because they represent the
- // source address with a single pointer.
- def int_ppc_altivec_stvx :
- Intrinsic<[llvm_void_ty, llvm_v4i32_ty, llvm_ptr_ty],
- [IntrWriteMem]>;
- def int_ppc_altivec_stvxl :
- Intrinsic<[llvm_void_ty, llvm_v4i32_ty, llvm_ptr_ty],
- [IntrWriteMem]>;
- def int_ppc_altivec_stvebx :
- Intrinsic<[llvm_void_ty, llvm_v16i8_ty, llvm_ptr_ty],
- [IntrWriteMem]>;
- def int_ppc_altivec_stvehx :
- Intrinsic<[llvm_void_ty, llvm_v8i16_ty, llvm_ptr_ty],
- [IntrWriteMem]>;
- def int_ppc_altivec_stvewx :
- Intrinsic<[llvm_void_ty, llvm_v4i32_ty, llvm_ptr_ty],
- [IntrWriteMem]>;
-
- // Comparisons setting a vector.
- def int_ppc_altivec_vcmpbfp : GCCBuiltin<"__builtin_altivec_vcmpbfp">,
- Intrinsic<[llvm_v4i32_ty, llvm_v4f32_ty, llvm_v4f32_ty],
- [IntrNoMem]>;
- def int_ppc_altivec_vcmpeqfp : GCCBuiltin<"__builtin_altivec_vcmpeqfp">,
- Intrinsic<[llvm_v4i32_ty, llvm_v4f32_ty, llvm_v4f32_ty],
- [IntrNoMem]>;
- def int_ppc_altivec_vcmpgefp : GCCBuiltin<"__builtin_altivec_vcmpgefp">,
- Intrinsic<[llvm_v4i32_ty, llvm_v4f32_ty, llvm_v4f32_ty],
- [IntrNoMem]>;
- def int_ppc_altivec_vcmpgtfp : GCCBuiltin<"__builtin_altivec_vcmpgtfp">,
- Intrinsic<[llvm_v4i32_ty, llvm_v4f32_ty, llvm_v4f32_ty],
- [IntrNoMem]>;
-
- def int_ppc_altivec_vcmpequw : GCCBuiltin<"__builtin_altivec_vcmpequw">,
- Intrinsic<[llvm_v4i32_ty, llvm_v4i32_ty, llvm_v4i32_ty],
- [IntrNoMem]>;
- def int_ppc_altivec_vcmpgtsw : GCCBuiltin<"__builtin_altivec_vcmpgtsw">,
- Intrinsic<[llvm_v4i32_ty, llvm_v4i32_ty, llvm_v4i32_ty],
- [IntrNoMem]>;
- def int_ppc_altivec_vcmpgtuw : GCCBuiltin<"__builtin_altivec_vcmpgtuw">,
- Intrinsic<[llvm_v4i32_ty, llvm_v4i32_ty, llvm_v4i32_ty],
- [IntrNoMem]>;
-
- def int_ppc_altivec_vcmpequh : GCCBuiltin<"__builtin_altivec_vcmpequh">,
- Intrinsic<[llvm_v8i16_ty, llvm_v8i16_ty, llvm_v8i16_ty],
- [IntrNoMem]>;
- def int_ppc_altivec_vcmpgtsh : GCCBuiltin<"__builtin_altivec_vcmpgtsh">,
- Intrinsic<[llvm_v8i16_ty, llvm_v8i16_ty, llvm_v8i16_ty],
- [IntrNoMem]>;
- def int_ppc_altivec_vcmpgtuh : GCCBuiltin<"__builtin_altivec_vcmpgtuh">,
- Intrinsic<[llvm_v8i16_ty, llvm_v8i16_ty, llvm_v8i16_ty],
- [IntrNoMem]>;
-
- def int_ppc_altivec_vcmpequb : GCCBuiltin<"__builtin_altivec_vcmpequb">,
- Intrinsic<[llvm_v16i8_ty, llvm_v16i8_ty, llvm_v16i8_ty],
- [IntrNoMem]>;
- def int_ppc_altivec_vcmpgtsb : GCCBuiltin<"__builtin_altivec_vcmpgtsb">,
- Intrinsic<[llvm_v16i8_ty, llvm_v16i8_ty, llvm_v16i8_ty],
- [IntrNoMem]>;
- def int_ppc_altivec_vcmpgtub : GCCBuiltin<"__builtin_altivec_vcmpgtub">,
- Intrinsic<[llvm_v16i8_ty, llvm_v16i8_ty, llvm_v16i8_ty],
- [IntrNoMem]>;
-
- // Predicate Comparisons. The first operand specifies interpretation of CR6.
- def int_ppc_altivec_vcmpbfp_p : GCCBuiltin<"__builtin_altivec_vcmpbfp_p">,
- Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_v4f32_ty,llvm_v4f32_ty],
- [IntrNoMem]>;
- def int_ppc_altivec_vcmpeqfp_p : GCCBuiltin<"__builtin_altivec_vcmpeqfp_p">,
- Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_v4f32_ty,llvm_v4f32_ty],
- [IntrNoMem]>;
- def int_ppc_altivec_vcmpgefp_p : GCCBuiltin<"__builtin_altivec_vcmpgefp_p">,
- Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_v4f32_ty,llvm_v4f32_ty],
- [IntrNoMem]>;
- def int_ppc_altivec_vcmpgtfp_p : GCCBuiltin<"__builtin_altivec_vcmpgtfp_p">,
- Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_v4f32_ty,llvm_v4f32_ty],
- [IntrNoMem]>;
-
- def int_ppc_altivec_vcmpequw_p : GCCBuiltin<"__builtin_altivec_vcmpequw_p">,
- Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_v4i32_ty,llvm_v4i32_ty],
- [IntrNoMem]>;
- def int_ppc_altivec_vcmpgtsw_p : GCCBuiltin<"__builtin_altivec_vcmpgtsw_p">,
- Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_v4i32_ty,llvm_v4i32_ty],
- [IntrNoMem]>;
- def int_ppc_altivec_vcmpgtuw_p : GCCBuiltin<"__builtin_altivec_vcmpgtuw_p">,
- Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_v4i32_ty,llvm_v4i32_ty],
- [IntrNoMem]>;
-
- def int_ppc_altivec_vcmpequh_p : GCCBuiltin<"__builtin_altivec_vcmpequh_p">,
- Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_v8i16_ty,llvm_v8i16_ty],
- [IntrNoMem]>;
- def int_ppc_altivec_vcmpgtsh_p : GCCBuiltin<"__builtin_altivec_vcmpgtsh_p">,
- Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_v8i16_ty,llvm_v8i16_ty],
- [IntrNoMem]>;
- def int_ppc_altivec_vcmpgtuh_p : GCCBuiltin<"__builtin_altivec_vcmpgtuh_p">,
- Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_v8i16_ty,llvm_v8i16_ty],
- [IntrNoMem]>;
-
- def int_ppc_altivec_vcmpequb_p : GCCBuiltin<"__builtin_altivec_vcmpequb_p">,
- Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_v16i8_ty,llvm_v16i8_ty],
- [IntrNoMem]>;
- def int_ppc_altivec_vcmpgtsb_p : GCCBuiltin<"__builtin_altivec_vcmpgtsb_p">,
- Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_v16i8_ty,llvm_v16i8_ty],
- [IntrNoMem]>;
- def int_ppc_altivec_vcmpgtub_p : GCCBuiltin<"__builtin_altivec_vcmpgtub_p">,
- Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_v16i8_ty,llvm_v16i8_ty],
- [IntrNoMem]>;
-}
-
-// Vector average.
-def int_ppc_altivec_vavgsb : PowerPC_Vec_BBB_Intrinsic<"vavgsb">;
-def int_ppc_altivec_vavgsh : PowerPC_Vec_HHH_Intrinsic<"vavgsh">;
-def int_ppc_altivec_vavgsw : PowerPC_Vec_WWW_Intrinsic<"vavgsw">;
-def int_ppc_altivec_vavgub : PowerPC_Vec_BBB_Intrinsic<"vavgub">;
-def int_ppc_altivec_vavguh : PowerPC_Vec_HHH_Intrinsic<"vavguh">;
-def int_ppc_altivec_vavguw : PowerPC_Vec_WWW_Intrinsic<"vavguw">;
-
-// Vector maximum.
-def int_ppc_altivec_vmaxfp : PowerPC_Vec_FFF_Intrinsic<"vmaxfp">;
-def int_ppc_altivec_vmaxsb : PowerPC_Vec_BBB_Intrinsic<"vmaxsb">;
-def int_ppc_altivec_vmaxsh : PowerPC_Vec_HHH_Intrinsic<"vmaxsh">;
-def int_ppc_altivec_vmaxsw : PowerPC_Vec_WWW_Intrinsic<"vmaxsw">;
-def int_ppc_altivec_vmaxub : PowerPC_Vec_BBB_Intrinsic<"vmaxub">;
-def int_ppc_altivec_vmaxuh : PowerPC_Vec_HHH_Intrinsic<"vmaxuh">;
-def int_ppc_altivec_vmaxuw : PowerPC_Vec_WWW_Intrinsic<"vmaxuw">;
-
-// Vector minimum.
-def int_ppc_altivec_vminfp : PowerPC_Vec_FFF_Intrinsic<"vminfp">;
-def int_ppc_altivec_vminsb : PowerPC_Vec_BBB_Intrinsic<"vminsb">;
-def int_ppc_altivec_vminsh : PowerPC_Vec_HHH_Intrinsic<"vminsh">;
-def int_ppc_altivec_vminsw : PowerPC_Vec_WWW_Intrinsic<"vminsw">;
-def int_ppc_altivec_vminub : PowerPC_Vec_BBB_Intrinsic<"vminub">;
-def int_ppc_altivec_vminuh : PowerPC_Vec_HHH_Intrinsic<"vminuh">;
-def int_ppc_altivec_vminuw : PowerPC_Vec_WWW_Intrinsic<"vminuw">;
-
-// Saturating adds.
-def int_ppc_altivec_vaddubs : PowerPC_Vec_BBB_Intrinsic<"vaddubs">;
-def int_ppc_altivec_vaddsbs : PowerPC_Vec_BBB_Intrinsic<"vaddsbs">;
-def int_ppc_altivec_vadduhs : PowerPC_Vec_HHH_Intrinsic<"vadduhs">;
-def int_ppc_altivec_vaddshs : PowerPC_Vec_HHH_Intrinsic<"vaddshs">;
-def int_ppc_altivec_vadduws : PowerPC_Vec_WWW_Intrinsic<"vadduws">;
-def int_ppc_altivec_vaddsws : PowerPC_Vec_WWW_Intrinsic<"vaddsws">;
-def int_ppc_altivec_vaddcuw : PowerPC_Vec_WWW_Intrinsic<"vaddcuw">;
-
-// Saturating subs.
-def int_ppc_altivec_vsububs : PowerPC_Vec_BBB_Intrinsic<"vsububs">;
-def int_ppc_altivec_vsubsbs : PowerPC_Vec_BBB_Intrinsic<"vsubsbs">;
-def int_ppc_altivec_vsubuhs : PowerPC_Vec_HHH_Intrinsic<"vsubuhs">;
-def int_ppc_altivec_vsubshs : PowerPC_Vec_HHH_Intrinsic<"vsubshs">;
-def int_ppc_altivec_vsubuws : PowerPC_Vec_WWW_Intrinsic<"vsubuws">;
-def int_ppc_altivec_vsubsws : PowerPC_Vec_WWW_Intrinsic<"vsubsws">;
-def int_ppc_altivec_vsubcuw : PowerPC_Vec_WWW_Intrinsic<"vsubcuw">;
-
-let TargetPrefix = "ppc" in { // All PPC intrinsics start with "llvm.ppc.".
- // Saturating multiply-adds.
- def int_ppc_altivec_vmhaddshs : GCCBuiltin<"__builtin_altivec_vmhaddshs">,
- Intrinsic<[llvm_v8i16_ty, llvm_v8i16_ty,
- llvm_v8i16_ty, llvm_v8i16_ty], [IntrNoMem]>;
- def int_ppc_altivec_vmhraddshs : GCCBuiltin<"__builtin_altivec_vmhraddshs">,
- Intrinsic<[llvm_v8i16_ty, llvm_v8i16_ty,
- llvm_v8i16_ty, llvm_v8i16_ty], [IntrNoMem]>;
-
- def int_ppc_altivec_vmaddfp : GCCBuiltin<"__builtin_altivec_vmaddfp">,
- Intrinsic<[llvm_v4f32_ty, llvm_v4f32_ty,
- llvm_v4f32_ty, llvm_v4f32_ty], [IntrNoMem]>;
- def int_ppc_altivec_vnmsubfp : GCCBuiltin<"__builtin_altivec_vnmsubfp">,
- Intrinsic<[llvm_v4f32_ty, llvm_v4f32_ty,
- llvm_v4f32_ty, llvm_v4f32_ty], [IntrNoMem]>;
-
- // Vector Multiply Sum Intructions.
- def int_ppc_altivec_vmsummbm : GCCBuiltin<"__builtin_altivec_vmsummbm">,
- Intrinsic<[llvm_v4i32_ty, llvm_v16i8_ty, llvm_v16i8_ty,
- llvm_v4i32_ty], [IntrNoMem]>;
- def int_ppc_altivec_vmsumshm : GCCBuiltin<"__builtin_altivec_vmsumshm">,
- Intrinsic<[llvm_v4i32_ty, llvm_v8i16_ty, llvm_v8i16_ty,
- llvm_v4i32_ty], [IntrNoMem]>;
- def int_ppc_altivec_vmsumshs : GCCBuiltin<"__builtin_altivec_vmsumshs">,
- Intrinsic<[llvm_v4i32_ty, llvm_v8i16_ty, llvm_v8i16_ty,
- llvm_v4i32_ty], [IntrNoMem]>;
- def int_ppc_altivec_vmsumubm : GCCBuiltin<"__builtin_altivec_vmsumubm">,
- Intrinsic<[llvm_v4i32_ty, llvm_v16i8_ty, llvm_v16i8_ty,
- llvm_v4i32_ty], [IntrNoMem]>;
- def int_ppc_altivec_vmsumuhm : GCCBuiltin<"__builtin_altivec_vmsumuhm">,
- Intrinsic<[llvm_v4i32_ty, llvm_v8i16_ty, llvm_v8i16_ty,
- llvm_v4i32_ty], [IntrNoMem]>;
- def int_ppc_altivec_vmsumuhs : GCCBuiltin<"__builtin_altivec_vmsumuhs">,
- Intrinsic<[llvm_v4i32_ty, llvm_v8i16_ty, llvm_v8i16_ty,
- llvm_v4i32_ty], [IntrNoMem]>;
-
- // Vector Multiply Intructions.
- def int_ppc_altivec_vmulesb : GCCBuiltin<"__builtin_altivec_vmulesb">,
- Intrinsic<[llvm_v8i16_ty, llvm_v16i8_ty, llvm_v16i8_ty],
- [IntrNoMem]>;
- def int_ppc_altivec_vmulesh : GCCBuiltin<"__builtin_altivec_vmulesh">,
- Intrinsic<[llvm_v4i32_ty, llvm_v8i16_ty, llvm_v8i16_ty],
- [IntrNoMem]>;
- def int_ppc_altivec_vmuleub : GCCBuiltin<"__builtin_altivec_vmuleub">,
- Intrinsic<[llvm_v8i16_ty, llvm_v16i8_ty, llvm_v16i8_ty],
- [IntrNoMem]>;
- def int_ppc_altivec_vmuleuh : GCCBuiltin<"__builtin_altivec_vmuleuh">,
- Intrinsic<[llvm_v4i32_ty, llvm_v8i16_ty, llvm_v8i16_ty],
- [IntrNoMem]>;
-
- def int_ppc_altivec_vmulosb : GCCBuiltin<"__builtin_altivec_vmulosb">,
- Intrinsic<[llvm_v8i16_ty, llvm_v16i8_ty, llvm_v16i8_ty],
- [IntrNoMem]>;
- def int_ppc_altivec_vmulosh : GCCBuiltin<"__builtin_altivec_vmulosh">,
- Intrinsic<[llvm_v4i32_ty, llvm_v8i16_ty, llvm_v8i16_ty],
- [IntrNoMem]>;
- def int_ppc_altivec_vmuloub : GCCBuiltin<"__builtin_altivec_vmuloub">,
- Intrinsic<[llvm_v8i16_ty, llvm_v16i8_ty, llvm_v16i8_ty],
- [IntrNoMem]>;
- def int_ppc_altivec_vmulouh : GCCBuiltin<"__builtin_altivec_vmulouh">,
- Intrinsic<[llvm_v4i32_ty, llvm_v8i16_ty, llvm_v8i16_ty],
- [IntrNoMem]>;
-
- // Vector Sum Intructions.
- def int_ppc_altivec_vsumsws : GCCBuiltin<"__builtin_altivec_vsumsws">,
- Intrinsic<[llvm_v4i32_ty, llvm_v4i32_ty, llvm_v4i32_ty],
- [IntrNoMem]>;
- def int_ppc_altivec_vsum2sws : GCCBuiltin<"__builtin_altivec_vsum2sws">,
- Intrinsic<[llvm_v4i32_ty, llvm_v4i32_ty, llvm_v4i32_ty],
- [IntrNoMem]>;
- def int_ppc_altivec_vsum4sbs : GCCBuiltin<"__builtin_altivec_vsum4sbs">,
- Intrinsic<[llvm_v4i32_ty, llvm_v16i8_ty, llvm_v4i32_ty],
- [IntrNoMem]>;
- def int_ppc_altivec_vsum4shs : GCCBuiltin<"__builtin_altivec_vsum4shs">,
- Intrinsic<[llvm_v4i32_ty, llvm_v8i16_ty, llvm_v4i32_ty],
- [IntrNoMem]>;
- def int_ppc_altivec_vsum4ubs : GCCBuiltin<"__builtin_altivec_vsum4ubs">,
- Intrinsic<[llvm_v4i32_ty, llvm_v16i8_ty, llvm_v4i32_ty],
- [IntrNoMem]>;
-
- // Other multiplies.
- def int_ppc_altivec_vmladduhm : GCCBuiltin<"__builtin_altivec_vmladduhm">,
- Intrinsic<[llvm_v8i16_ty, llvm_v8i16_ty, llvm_v8i16_ty,
- llvm_v8i16_ty], [IntrNoMem]>;
-
- // Packs.
- def int_ppc_altivec_vpkpx : GCCBuiltin<"__builtin_altivec_vpkpx">,
- Intrinsic<[llvm_v8i16_ty, llvm_v4i32_ty, llvm_v4i32_ty],
- [IntrNoMem]>;
- def int_ppc_altivec_vpkshss : GCCBuiltin<"__builtin_altivec_vpkshss">,
- Intrinsic<[llvm_v16i8_ty, llvm_v8i16_ty, llvm_v8i16_ty],
- [IntrNoMem]>;
- def int_ppc_altivec_vpkshus : GCCBuiltin<"__builtin_altivec_vpkshus">,
- Intrinsic<[llvm_v16i8_ty, llvm_v8i16_ty, llvm_v8i16_ty],
- [IntrNoMem]>;
- def int_ppc_altivec_vpkswss : GCCBuiltin<"__builtin_altivec_vpkswss">,
- Intrinsic<[llvm_v16i8_ty, llvm_v4i32_ty, llvm_v4i32_ty],
- [IntrNoMem]>;
- def int_ppc_altivec_vpkswus : GCCBuiltin<"__builtin_altivec_vpkswus">,
- Intrinsic<[llvm_v8i16_ty, llvm_v4i32_ty, llvm_v4i32_ty],
- [IntrNoMem]>;
- // vpkuhum is lowered to a shuffle.
- def int_ppc_altivec_vpkuhus : GCCBuiltin<"__builtin_altivec_vpkuhus">,
- Intrinsic<[llvm_v16i8_ty, llvm_v8i16_ty, llvm_v8i16_ty],
- [IntrNoMem]>;
- // vpkuwum is lowered to a shuffle.
- def int_ppc_altivec_vpkuwus : GCCBuiltin<"__builtin_altivec_vpkuwus">,
- Intrinsic<[llvm_v8i16_ty, llvm_v4i32_ty, llvm_v4i32_ty],
- [IntrNoMem]>;
-
- // Unpacks.
- def int_ppc_altivec_vupkhpx : GCCBuiltin<"__builtin_altivec_vupkhpx">,
- Intrinsic<[llvm_v4i32_ty, llvm_v8i16_ty], [IntrNoMem]>;
- def int_ppc_altivec_vupkhsb : GCCBuiltin<"__builtin_altivec_vupkhsb">,
- Intrinsic<[llvm_v8i16_ty, llvm_v16i8_ty], [IntrNoMem]>;
- def int_ppc_altivec_vupkhsh : GCCBuiltin<"__builtin_altivec_vupkhsh">,
- Intrinsic<[llvm_v4i32_ty, llvm_v8i16_ty], [IntrNoMem]>;
- def int_ppc_altivec_vupklpx : GCCBuiltin<"__builtin_altivec_vupklpx">,
- Intrinsic<[llvm_v4i32_ty, llvm_v8i16_ty], [IntrNoMem]>;
- def int_ppc_altivec_vupklsb : GCCBuiltin<"__builtin_altivec_vupklsb">,
- Intrinsic<[llvm_v8i16_ty, llvm_v16i8_ty], [IntrNoMem]>;
- def int_ppc_altivec_vupklsh : GCCBuiltin<"__builtin_altivec_vupklsh">,
- Intrinsic<[llvm_v4i32_ty, llvm_v8i16_ty], [IntrNoMem]>;
-
-
- // FP <-> integer conversion.
- def int_ppc_altivec_vcfsx : GCCBuiltin<"__builtin_altivec_vcfsx">,
- Intrinsic<[llvm_v4f32_ty, llvm_v4i32_ty, llvm_i32_ty],
- [IntrNoMem]>;
- def int_ppc_altivec_vcfux : GCCBuiltin<"__builtin_altivec_vcfux">,
- Intrinsic<[llvm_v4f32_ty, llvm_v4i32_ty, llvm_i32_ty],
- [IntrNoMem]>;
- def int_ppc_altivec_vctsxs : GCCBuiltin<"__builtin_altivec_vctsxs">,
- Intrinsic<[llvm_v4i32_ty, llvm_v4f32_ty, llvm_i32_ty],
- [IntrNoMem]>;
- def int_ppc_altivec_vctuxs : GCCBuiltin<"__builtin_altivec_vctuxs">,
- Intrinsic<[llvm_v4i32_ty, llvm_v4f32_ty, llvm_i32_ty],
- [IntrNoMem]>;
-
- def int_ppc_altivec_vrfim : GCCBuiltin<"__builtin_altivec_vrfim">,
- Intrinsic<[llvm_v4f32_ty, llvm_v4f32_ty], [IntrNoMem]>;
- def int_ppc_altivec_vrfin : GCCBuiltin<"__builtin_altivec_vrfin">,
- Intrinsic<[llvm_v4f32_ty, llvm_v4f32_ty], [IntrNoMem]>;
- def int_ppc_altivec_vrfip : GCCBuiltin<"__builtin_altivec_vrfip">,
- Intrinsic<[llvm_v4f32_ty, llvm_v4f32_ty], [IntrNoMem]>;
- def int_ppc_altivec_vrfiz : GCCBuiltin<"__builtin_altivec_vrfiz">,
- Intrinsic<[llvm_v4f32_ty, llvm_v4f32_ty], [IntrNoMem]>;
-}
-
-def int_ppc_altivec_vsl : PowerPC_Vec_WWW_Intrinsic<"vsl">;
-def int_ppc_altivec_vslo : PowerPC_Vec_WWW_Intrinsic<"vslo">;
-
-def int_ppc_altivec_vslb : PowerPC_Vec_BBB_Intrinsic<"vslb">;
-def int_ppc_altivec_vslh : PowerPC_Vec_HHH_Intrinsic<"vslh">;
-def int_ppc_altivec_vslw : PowerPC_Vec_WWW_Intrinsic<"vslw">;
-
-// Right Shifts.
-def int_ppc_altivec_vsr : PowerPC_Vec_WWW_Intrinsic<"vsr">;
-def int_ppc_altivec_vsro : PowerPC_Vec_WWW_Intrinsic<"vsro">;
-
-def int_ppc_altivec_vsrb : PowerPC_Vec_BBB_Intrinsic<"vsrb">;
-def int_ppc_altivec_vsrh : PowerPC_Vec_HHH_Intrinsic<"vsrh">;
-def int_ppc_altivec_vsrw : PowerPC_Vec_WWW_Intrinsic<"vsrw">;
-def int_ppc_altivec_vsrab : PowerPC_Vec_BBB_Intrinsic<"vsrab">;
-def int_ppc_altivec_vsrah : PowerPC_Vec_HHH_Intrinsic<"vsrah">;
-def int_ppc_altivec_vsraw : PowerPC_Vec_WWW_Intrinsic<"vsraw">;
-
-// Rotates.
-def int_ppc_altivec_vrlb : PowerPC_Vec_BBB_Intrinsic<"vrlb">;
-def int_ppc_altivec_vrlh : PowerPC_Vec_HHH_Intrinsic<"vrlh">;
-def int_ppc_altivec_vrlw : PowerPC_Vec_WWW_Intrinsic<"vrlw">;
-
-let TargetPrefix = "ppc" in { // All PPC intrinsics start with "llvm.ppc.".
- // Miscellaneous.
- def int_ppc_altivec_lvsl :
- Intrinsic<[llvm_v16i8_ty, llvm_ptr_ty], [IntrNoMem]>;
- def int_ppc_altivec_lvsr :
- Intrinsic<[llvm_v16i8_ty, llvm_ptr_ty], [IntrNoMem]>;
-
- def int_ppc_altivec_vperm : GCCBuiltin<"__builtin_altivec_vperm_4si">,
- Intrinsic<[llvm_v4i32_ty, llvm_v4i32_ty,
- llvm_v4i32_ty, llvm_v16i8_ty], [IntrNoMem]>;
- def int_ppc_altivec_vsel : GCCBuiltin<"__builtin_altivec_vsel_4si">,
- Intrinsic<[llvm_v4i32_ty, llvm_v4i32_ty,
- llvm_v4i32_ty, llvm_v4i32_ty], [IntrNoMem]>;
-}
-
-def int_ppc_altivec_vexptefp : PowerPC_Vec_FF_Intrinsic<"vexptefp">;
-def int_ppc_altivec_vlogefp : PowerPC_Vec_FF_Intrinsic<"vlogefp">;
-def int_ppc_altivec_vrefp : PowerPC_Vec_FF_Intrinsic<"vrefp">;
-def int_ppc_altivec_vrsqrtefp : PowerPC_Vec_FF_Intrinsic<"vrsqrtefp">;
diff --git a/release_23/include/llvm/IntrinsicsX86.td b/release_23/include/llvm/IntrinsicsX86.td
deleted file mode 100644
index 0484926d0769..000000000000
--- a/release_23/include/llvm/IntrinsicsX86.td
+++ /dev/null
@@ -1,1045 +0,0 @@
-//===- IntrinsicsX86.td - Defines X86 intrinsics -----------*- tablegen -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines all of the X86-specific intrinsics.
-//
-//===----------------------------------------------------------------------===//
-
-
-//===----------------------------------------------------------------------===//
-// SSE1
-
-// Arithmetic ops
-let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
- def int_x86_sse_add_ss : GCCBuiltin<"__builtin_ia32_addss">,
- Intrinsic<[llvm_v4f32_ty, llvm_v4f32_ty,
- llvm_v4f32_ty], [IntrNoMem]>;
- def int_x86_sse_sub_ss : GCCBuiltin<"__builtin_ia32_subss">,
- Intrinsic<[llvm_v4f32_ty, llvm_v4f32_ty,
- llvm_v4f32_ty], [IntrNoMem]>;
- def int_x86_sse_mul_ss : GCCBuiltin<"__builtin_ia32_mulss">,
- Intrinsic<[llvm_v4f32_ty, llvm_v4f32_ty,
- llvm_v4f32_ty], [IntrNoMem]>;
- def int_x86_sse_div_ss : GCCBuiltin<"__builtin_ia32_divss">,
- Intrinsic<[llvm_v4f32_ty, llvm_v4f32_ty,
- llvm_v4f32_ty], [IntrNoMem]>;
- def int_x86_sse_sqrt_ss : GCCBuiltin<"__builtin_ia32_sqrtss">,
- Intrinsic<[llvm_v4f32_ty, llvm_v4f32_ty],
- [IntrNoMem]>;
- def int_x86_sse_sqrt_ps : GCCBuiltin<"__builtin_ia32_sqrtps">,
- Intrinsic<[llvm_v4f32_ty, llvm_v4f32_ty],
- [IntrNoMem]>;
- def int_x86_sse_rcp_ss : GCCBuiltin<"__builtin_ia32_rcpss">,
- Intrinsic<[llvm_v4f32_ty, llvm_v4f32_ty],
- [IntrNoMem]>;
- def int_x86_sse_rcp_ps : GCCBuiltin<"__builtin_ia32_rcpps">,
- Intrinsic<[llvm_v4f32_ty, llvm_v4f32_ty],
- [IntrNoMem]>;
- def int_x86_sse_rsqrt_ss : GCCBuiltin<"__builtin_ia32_rsqrtss">,
- Intrinsic<[llvm_v4f32_ty, llvm_v4f32_ty],
- [IntrNoMem]>;
- def int_x86_sse_rsqrt_ps : GCCBuiltin<"__builtin_ia32_rsqrtps">,
- Intrinsic<[llvm_v4f32_ty, llvm_v4f32_ty],
- [IntrNoMem]>;
- def int_x86_sse_min_ss : GCCBuiltin<"__builtin_ia32_minss">,
- Intrinsic<[llvm_v4f32_ty, llvm_v4f32_ty,
- llvm_v4f32_ty], [IntrNoMem]>;
- def int_x86_sse_min_ps : GCCBuiltin<"__builtin_ia32_minps">,
- Intrinsic<[llvm_v4f32_ty, llvm_v4f32_ty,
- llvm_v4f32_ty], [IntrNoMem]>;
- def int_x86_sse_max_ss : GCCBuiltin<"__builtin_ia32_maxss">,
- Intrinsic<[llvm_v4f32_ty, llvm_v4f32_ty,
- llvm_v4f32_ty], [IntrNoMem]>;
- def int_x86_sse_max_ps : GCCBuiltin<"__builtin_ia32_maxps">,
- Intrinsic<[llvm_v4f32_ty, llvm_v4f32_ty,
- llvm_v4f32_ty], [IntrNoMem]>;
-}
-
-// Comparison ops
-let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
- def int_x86_sse_cmp_ss :
- Intrinsic<[llvm_v4f32_ty, llvm_v4f32_ty,
- llvm_v4f32_ty, llvm_i8_ty], [IntrNoMem]>;
- def int_x86_sse_cmp_ps :
- Intrinsic<[llvm_v4f32_ty, llvm_v4f32_ty,
- llvm_v4f32_ty, llvm_i8_ty], [IntrNoMem]>;
- def int_x86_sse_comieq_ss : GCCBuiltin<"__builtin_ia32_comieq">,
- Intrinsic<[llvm_i32_ty, llvm_v4f32_ty,
- llvm_v4f32_ty], [IntrNoMem]>;
- def int_x86_sse_comilt_ss : GCCBuiltin<"__builtin_ia32_comilt">,
- Intrinsic<[llvm_i32_ty, llvm_v4f32_ty,
- llvm_v4f32_ty], [IntrNoMem]>;
- def int_x86_sse_comile_ss : GCCBuiltin<"__builtin_ia32_comile">,
- Intrinsic<[llvm_i32_ty, llvm_v4f32_ty,
- llvm_v4f32_ty], [IntrNoMem]>;
- def int_x86_sse_comigt_ss : GCCBuiltin<"__builtin_ia32_comigt">,
- Intrinsic<[llvm_i32_ty, llvm_v4f32_ty,
- llvm_v4f32_ty], [IntrNoMem]>;
- def int_x86_sse_comige_ss : GCCBuiltin<"__builtin_ia32_comige">,
- Intrinsic<[llvm_i32_ty, llvm_v4f32_ty,
- llvm_v4f32_ty], [IntrNoMem]>;
- def int_x86_sse_comineq_ss : GCCBuiltin<"__builtin_ia32_comineq">,
- Intrinsic<[llvm_i32_ty, llvm_v4f32_ty,
- llvm_v4f32_ty], [IntrNoMem]>;
- def int_x86_sse_ucomieq_ss : GCCBuiltin<"__builtin_ia32_ucomieq">,
- Intrinsic<[llvm_i32_ty, llvm_v4f32_ty,
- llvm_v4f32_ty], [IntrNoMem]>;
- def int_x86_sse_ucomilt_ss : GCCBuiltin<"__builtin_ia32_ucomilt">,
- Intrinsic<[llvm_i32_ty, llvm_v4f32_ty,
- llvm_v4f32_ty], [IntrNoMem]>;
- def int_x86_sse_ucomile_ss : GCCBuiltin<"__builtin_ia32_ucomile">,
- Intrinsic<[llvm_i32_ty, llvm_v4f32_ty,
- llvm_v4f32_ty], [IntrNoMem]>;
- def int_x86_sse_ucomigt_ss : GCCBuiltin<"__builtin_ia32_ucomigt">,
- Intrinsic<[llvm_i32_ty, llvm_v4f32_ty,
- llvm_v4f32_ty], [IntrNoMem]>;
- def int_x86_sse_ucomige_ss : GCCBuiltin<"__builtin_ia32_ucomige">,
- Intrinsic<[llvm_i32_ty, llvm_v4f32_ty,
- llvm_v4f32_ty], [IntrNoMem]>;
- def int_x86_sse_ucomineq_ss : GCCBuiltin<"__builtin_ia32_ucomineq">,
- Intrinsic<[llvm_i32_ty, llvm_v4f32_ty,
- llvm_v4f32_ty], [IntrNoMem]>;
-}
-
-
-// Conversion ops
-let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
- def int_x86_sse_cvtss2si : GCCBuiltin<"__builtin_ia32_cvtss2si">,
- Intrinsic<[llvm_i32_ty, llvm_v4f32_ty], [IntrNoMem]>;
- def int_x86_sse_cvtss2si64 : GCCBuiltin<"__builtin_ia32_cvtss2si64">,
- Intrinsic<[llvm_i64_ty, llvm_v4f32_ty], [IntrNoMem]>;
- def int_x86_sse_cvttss2si : GCCBuiltin<"__builtin_ia32_cvttss2si">,
- Intrinsic<[llvm_i32_ty, llvm_v4f32_ty], [IntrNoMem]>;
- def int_x86_sse_cvttss2si64 : GCCBuiltin<"__builtin_ia32_cvttss2si64">,
- Intrinsic<[llvm_i64_ty, llvm_v4f32_ty], [IntrNoMem]>;
- def int_x86_sse_cvtsi2ss : GCCBuiltin<"__builtin_ia32_cvtsi2ss">,
- Intrinsic<[llvm_v4f32_ty, llvm_v4f32_ty,
- llvm_i32_ty], [IntrNoMem]>;
- def int_x86_sse_cvtsi642ss : GCCBuiltin<"__builtin_ia32_cvtsi642ss">,
- Intrinsic<[llvm_v4f32_ty, llvm_v4f32_ty,
- llvm_i64_ty], [IntrNoMem]>;
- def int_x86_sse_cvtps2pi : GCCBuiltin<"__builtin_ia32_cvtps2pi">,
- Intrinsic<[llvm_v2i32_ty, llvm_v4f32_ty], [IntrNoMem]>;
- def int_x86_sse_cvttps2pi: GCCBuiltin<"__builtin_ia32_cvttps2pi">,
- Intrinsic<[llvm_v2i32_ty, llvm_v4f32_ty], [IntrNoMem]>;
- def int_x86_sse_cvtpi2ps : GCCBuiltin<"__builtin_ia32_cvtpi2ps">,
- Intrinsic<[llvm_v4f32_ty, llvm_v4f32_ty,
- llvm_v2i32_ty], [IntrNoMem]>;
-}
-
-// SIMD load ops
-let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
- def int_x86_sse_loadu_ps : GCCBuiltin<"__builtin_ia32_loadups">,
- Intrinsic<[llvm_v4f32_ty, llvm_ptr_ty], [IntrReadMem]>;
-}
-
-// SIMD store ops
-let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
- def int_x86_sse_storeu_ps : GCCBuiltin<"__builtin_ia32_storeups">,
- Intrinsic<[llvm_void_ty, llvm_ptr_ty,
- llvm_v4f32_ty], [IntrWriteMem]>;
-}
-
-// Cacheability support ops
-let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
- def int_x86_sse_movnt_ps : GCCBuiltin<"__builtin_ia32_movntps">,
- Intrinsic<[llvm_void_ty, llvm_ptr_ty,
- llvm_v4f32_ty], [IntrWriteMem]>;
- def int_x86_sse_sfence : GCCBuiltin<"__builtin_ia32_sfence">,
- Intrinsic<[llvm_void_ty], [IntrWriteMem]>;
-}
-
-// Control register.
-let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
- def int_x86_sse_stmxcsr :
- Intrinsic<[llvm_void_ty, llvm_ptr_ty], [IntrWriteMem]>;
- def int_x86_sse_ldmxcsr :
- Intrinsic<[llvm_void_ty, llvm_ptr_ty], [IntrWriteMem]>;
-}
-
-// Misc.
-let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
- def int_x86_sse_movmsk_ps : GCCBuiltin<"__builtin_ia32_movmskps">,
- Intrinsic<[llvm_i32_ty, llvm_v4f32_ty], [IntrNoMem]>;
-}
-
-//===----------------------------------------------------------------------===//
-// SSE2
-
-// FP arithmetic ops
-let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
- def int_x86_sse2_add_sd : GCCBuiltin<"__builtin_ia32_addsd">,
- Intrinsic<[llvm_v2f64_ty, llvm_v2f64_ty,
- llvm_v2f64_ty], [IntrNoMem]>;
- def int_x86_sse2_sub_sd : GCCBuiltin<"__builtin_ia32_subsd">,
- Intrinsic<[llvm_v2f64_ty, llvm_v2f64_ty,
- llvm_v2f64_ty], [IntrNoMem]>;
- def int_x86_sse2_mul_sd : GCCBuiltin<"__builtin_ia32_mulsd">,
- Intrinsic<[llvm_v2f64_ty, llvm_v2f64_ty,
- llvm_v2f64_ty], [IntrNoMem]>;
- def int_x86_sse2_div_sd : GCCBuiltin<"__builtin_ia32_divsd">,
- Intrinsic<[llvm_v2f64_ty, llvm_v2f64_ty,
- llvm_v2f64_ty], [IntrNoMem]>;
- def int_x86_sse2_sqrt_sd : GCCBuiltin<"__builtin_ia32_sqrtsd">,
- Intrinsic<[llvm_v2f64_ty, llvm_v2f64_ty],
- [IntrNoMem]>;
- def int_x86_sse2_sqrt_pd : GCCBuiltin<"__builtin_ia32_sqrtpd">,
- Intrinsic<[llvm_v2f64_ty, llvm_v2f64_ty],
- [IntrNoMem]>;
- def int_x86_sse2_min_sd : GCCBuiltin<"__builtin_ia32_minsd">,
- Intrinsic<[llvm_v2f64_ty, llvm_v2f64_ty,
- llvm_v2f64_ty], [IntrNoMem]>;
- def int_x86_sse2_min_pd : GCCBuiltin<"__builtin_ia32_minpd">,
- Intrinsic<[llvm_v2f64_ty, llvm_v2f64_ty,
- llvm_v2f64_ty], [IntrNoMem]>;
- def int_x86_sse2_max_sd : GCCBuiltin<"__builtin_ia32_maxsd">,
- Intrinsic<[llvm_v2f64_ty, llvm_v2f64_ty,
- llvm_v2f64_ty], [IntrNoMem]>;
- def int_x86_sse2_max_pd : GCCBuiltin<"__builtin_ia32_maxpd">,
- Intrinsic<[llvm_v2f64_ty, llvm_v2f64_ty,
- llvm_v2f64_ty], [IntrNoMem]>;
-}
-
-// FP comparison ops
-let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
- def int_x86_sse2_cmp_sd :
- Intrinsic<[llvm_v2f64_ty, llvm_v2f64_ty,
- llvm_v2f64_ty, llvm_i8_ty], [IntrNoMem]>;
- def int_x86_sse2_cmp_pd :
- Intrinsic<[llvm_v2f64_ty, llvm_v2f64_ty,
- llvm_v2f64_ty, llvm_i8_ty], [IntrNoMem]>;
- def int_x86_sse2_comieq_sd : GCCBuiltin<"__builtin_ia32_comisdeq">,
- Intrinsic<[llvm_i32_ty, llvm_v2f64_ty,
- llvm_v2f64_ty], [IntrNoMem]>;
- def int_x86_sse2_comilt_sd : GCCBuiltin<"__builtin_ia32_comisdlt">,
- Intrinsic<[llvm_i32_ty, llvm_v2f64_ty,
- llvm_v2f64_ty], [IntrNoMem]>;
- def int_x86_sse2_comile_sd : GCCBuiltin<"__builtin_ia32_comisdle">,
- Intrinsic<[llvm_i32_ty, llvm_v2f64_ty,
- llvm_v2f64_ty], [IntrNoMem]>;
- def int_x86_sse2_comigt_sd : GCCBuiltin<"__builtin_ia32_comisdgt">,
- Intrinsic<[llvm_i32_ty, llvm_v2f64_ty,
- llvm_v2f64_ty], [IntrNoMem]>;
- def int_x86_sse2_comige_sd : GCCBuiltin<"__builtin_ia32_comisdge">,
- Intrinsic<[llvm_i32_ty, llvm_v2f64_ty,
- llvm_v2f64_ty], [IntrNoMem]>;
- def int_x86_sse2_comineq_sd : GCCBuiltin<"__builtin_ia32_comisdneq">,
- Intrinsic<[llvm_i32_ty, llvm_v2f64_ty,
- llvm_v2f64_ty], [IntrNoMem]>;
- def int_x86_sse2_ucomieq_sd : GCCBuiltin<"__builtin_ia32_ucomisdeq">,
- Intrinsic<[llvm_i32_ty, llvm_v2f64_ty,
- llvm_v2f64_ty], [IntrNoMem]>;
- def int_x86_sse2_ucomilt_sd : GCCBuiltin<"__builtin_ia32_ucomisdlt">,
- Intrinsic<[llvm_i32_ty, llvm_v2f64_ty,
- llvm_v2f64_ty], [IntrNoMem]>;
- def int_x86_sse2_ucomile_sd : GCCBuiltin<"__builtin_ia32_ucomisdle">,
- Intrinsic<[llvm_i32_ty, llvm_v2f64_ty,
- llvm_v2f64_ty], [IntrNoMem]>;
- def int_x86_sse2_ucomigt_sd : GCCBuiltin<"__builtin_ia32_ucomisdgt">,
- Intrinsic<[llvm_i32_ty, llvm_v2f64_ty,
- llvm_v2f64_ty], [IntrNoMem]>;
- def int_x86_sse2_ucomige_sd : GCCBuiltin<"__builtin_ia32_ucomisdge">,
- Intrinsic<[llvm_i32_ty, llvm_v2f64_ty,
- llvm_v2f64_ty], [IntrNoMem]>;
- def int_x86_sse2_ucomineq_sd : GCCBuiltin<"__builtin_ia32_ucomisdneq">,
- Intrinsic<[llvm_i32_ty, llvm_v2f64_ty,
- llvm_v2f64_ty], [IntrNoMem]>;
-}
-
-// Integer arithmetic ops.
-let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
- def int_x86_sse2_padds_b : GCCBuiltin<"__builtin_ia32_paddsb128">,
- Intrinsic<[llvm_v16i8_ty, llvm_v16i8_ty,
- llvm_v16i8_ty], [IntrNoMem]>;
- def int_x86_sse2_padds_w : GCCBuiltin<"__builtin_ia32_paddsw128">,
- Intrinsic<[llvm_v8i16_ty, llvm_v8i16_ty,
- llvm_v8i16_ty], [IntrNoMem]>;
- def int_x86_sse2_paddus_b : GCCBuiltin<"__builtin_ia32_paddusb128">,
- Intrinsic<[llvm_v16i8_ty, llvm_v16i8_ty,
- llvm_v16i8_ty], [IntrNoMem]>;
- def int_x86_sse2_paddus_w : GCCBuiltin<"__builtin_ia32_paddusw128">,
- Intrinsic<[llvm_v8i16_ty, llvm_v8i16_ty,
- llvm_v8i16_ty], [IntrNoMem]>;
- def int_x86_sse2_psubs_b : GCCBuiltin<"__builtin_ia32_psubsb128">,
- Intrinsic<[llvm_v16i8_ty, llvm_v16i8_ty,
- llvm_v16i8_ty], [IntrNoMem]>;
- def int_x86_sse2_psubs_w : GCCBuiltin<"__builtin_ia32_psubsw128">,
- Intrinsic<[llvm_v8i16_ty, llvm_v8i16_ty,
- llvm_v8i16_ty], [IntrNoMem]>;
- def int_x86_sse2_psubus_b : GCCBuiltin<"__builtin_ia32_psubusb128">,
- Intrinsic<[llvm_v16i8_ty, llvm_v16i8_ty,
- llvm_v16i8_ty], [IntrNoMem]>;
- def int_x86_sse2_psubus_w : GCCBuiltin<"__builtin_ia32_psubusw128">,
- Intrinsic<[llvm_v8i16_ty, llvm_v8i16_ty,
- llvm_v8i16_ty], [IntrNoMem]>;
- def int_x86_sse2_pmulhu_w : GCCBuiltin<"__builtin_ia32_pmulhuw128">,
- Intrinsic<[llvm_v8i16_ty, llvm_v8i16_ty,
- llvm_v8i16_ty], [IntrNoMem]>;
- def int_x86_sse2_pmulh_w : GCCBuiltin<"__builtin_ia32_pmulhw128">,
- Intrinsic<[llvm_v8i16_ty, llvm_v8i16_ty,
- llvm_v8i16_ty], [IntrNoMem]>;
- def int_x86_sse2_pmulu_dq : GCCBuiltin<"__builtin_ia32_pmuludq128">,
- Intrinsic<[llvm_v2i64_ty, llvm_v4i32_ty,
- llvm_v4i32_ty], [IntrNoMem]>;
- def int_x86_sse2_pmadd_wd : GCCBuiltin<"__builtin_ia32_pmaddwd128">,
- Intrinsic<[llvm_v4i32_ty, llvm_v8i16_ty,
- llvm_v8i16_ty], [IntrNoMem]>;
- def int_x86_sse2_pavg_b : GCCBuiltin<"__builtin_ia32_pavgb128">,
- Intrinsic<[llvm_v16i8_ty, llvm_v16i8_ty,
- llvm_v16i8_ty], [IntrNoMem]>;
- def int_x86_sse2_pavg_w : GCCBuiltin<"__builtin_ia32_pavgw128">,
- Intrinsic<[llvm_v8i16_ty, llvm_v8i16_ty,
- llvm_v8i16_ty], [IntrNoMem]>;
- def int_x86_sse2_pmaxu_b : GCCBuiltin<"__builtin_ia32_pmaxub128">,
- Intrinsic<[llvm_v16i8_ty, llvm_v16i8_ty,
- llvm_v16i8_ty], [IntrNoMem]>;
- def int_x86_sse2_pmaxs_w : GCCBuiltin<"__builtin_ia32_pmaxsw128">,
- Intrinsic<[llvm_v8i16_ty, llvm_v8i16_ty,
- llvm_v8i16_ty], [IntrNoMem]>;
- def int_x86_sse2_pminu_b : GCCBuiltin<"__builtin_ia32_pminub128">,
- Intrinsic<[llvm_v16i8_ty, llvm_v16i8_ty,
- llvm_v16i8_ty], [IntrNoMem]>;
- def int_x86_sse2_pmins_w : GCCBuiltin<"__builtin_ia32_pminsw128">,
- Intrinsic<[llvm_v8i16_ty, llvm_v8i16_ty,
- llvm_v8i16_ty], [IntrNoMem]>;
- def int_x86_sse2_psad_bw : GCCBuiltin<"__builtin_ia32_psadbw128">,
- Intrinsic<[llvm_v2i64_ty, llvm_v16i8_ty,
- llvm_v16i8_ty], [IntrNoMem]>;
-}
-
-// Integer shift ops.
-let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
- def int_x86_sse2_psll_w : GCCBuiltin<"__builtin_ia32_psllw128">,
- Intrinsic<[llvm_v8i16_ty, llvm_v8i16_ty,
- llvm_v8i16_ty], [IntrNoMem]>;
- def int_x86_sse2_psll_d : GCCBuiltin<"__builtin_ia32_pslld128">,
- Intrinsic<[llvm_v4i32_ty, llvm_v4i32_ty,
- llvm_v4i32_ty], [IntrNoMem]>;
- def int_x86_sse2_psll_q : GCCBuiltin<"__builtin_ia32_psllq128">,
- Intrinsic<[llvm_v2i64_ty, llvm_v2i64_ty,
- llvm_v2i64_ty], [IntrNoMem]>;
- def int_x86_sse2_psrl_w : GCCBuiltin<"__builtin_ia32_psrlw128">,
- Intrinsic<[llvm_v8i16_ty, llvm_v8i16_ty,
- llvm_v8i16_ty], [IntrNoMem]>;
- def int_x86_sse2_psrl_d : GCCBuiltin<"__builtin_ia32_psrld128">,
- Intrinsic<[llvm_v4i32_ty, llvm_v4i32_ty,
- llvm_v4i32_ty], [IntrNoMem]>;
- def int_x86_sse2_psrl_q : GCCBuiltin<"__builtin_ia32_psrlq128">,
- Intrinsic<[llvm_v2i64_ty, llvm_v2i64_ty,
- llvm_v2i64_ty], [IntrNoMem]>;
- def int_x86_sse2_psra_w : GCCBuiltin<"__builtin_ia32_psraw128">,
- Intrinsic<[llvm_v8i16_ty, llvm_v8i16_ty,
- llvm_v8i16_ty], [IntrNoMem]>;
- def int_x86_sse2_psra_d : GCCBuiltin<"__builtin_ia32_psrad128">,
- Intrinsic<[llvm_v4i32_ty, llvm_v4i32_ty,
- llvm_v4i32_ty], [IntrNoMem]>;
-
- def int_x86_sse2_pslli_w : GCCBuiltin<"__builtin_ia32_psllwi128">,
- Intrinsic<[llvm_v8i16_ty, llvm_v8i16_ty,
- llvm_i32_ty], [IntrNoMem]>;
- def int_x86_sse2_pslli_d : GCCBuiltin<"__builtin_ia32_pslldi128">,
- Intrinsic<[llvm_v4i32_ty, llvm_v4i32_ty,
- llvm_i32_ty], [IntrNoMem]>;
- def int_x86_sse2_pslli_q : GCCBuiltin<"__builtin_ia32_psllqi128">,
- Intrinsic<[llvm_v2i64_ty, llvm_v2i64_ty,
- llvm_i32_ty], [IntrNoMem]>;
- def int_x86_sse2_psrli_w : GCCBuiltin<"__builtin_ia32_psrlwi128">,
- Intrinsic<[llvm_v8i16_ty, llvm_v8i16_ty,
- llvm_i32_ty], [IntrNoMem]>;
- def int_x86_sse2_psrli_d : GCCBuiltin<"__builtin_ia32_psrldi128">,
- Intrinsic<[llvm_v4i32_ty, llvm_v4i32_ty,
- llvm_i32_ty], [IntrNoMem]>;
- def int_x86_sse2_psrli_q : GCCBuiltin<"__builtin_ia32_psrlqi128">,
- Intrinsic<[llvm_v2i64_ty, llvm_v2i64_ty,
- llvm_i32_ty], [IntrNoMem]>;
- def int_x86_sse2_psrai_w : GCCBuiltin<"__builtin_ia32_psrawi128">,
- Intrinsic<[llvm_v8i16_ty, llvm_v8i16_ty,
- llvm_i32_ty], [IntrNoMem]>;
- def int_x86_sse2_psrai_d : GCCBuiltin<"__builtin_ia32_psradi128">,
- Intrinsic<[llvm_v4i32_ty, llvm_v4i32_ty,
- llvm_i32_ty], [IntrNoMem]>;
-
- def int_x86_sse2_psll_dq : GCCBuiltin<"__builtin_ia32_pslldqi128">,
- Intrinsic<[llvm_v2i64_ty, llvm_v2i64_ty,
- llvm_i32_ty], [IntrNoMem]>;
- def int_x86_sse2_psrl_dq : GCCBuiltin<"__builtin_ia32_psrldqi128">,
- Intrinsic<[llvm_v2i64_ty, llvm_v2i64_ty,
- llvm_i32_ty], [IntrNoMem]>;
-}
-
-// Integer comparison ops
-let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
- def int_x86_sse2_pcmpeq_b : GCCBuiltin<"__builtin_ia32_pcmpeqb128">,
- Intrinsic<[llvm_v16i8_ty, llvm_v16i8_ty,
- llvm_v16i8_ty], [IntrNoMem]>;
- def int_x86_sse2_pcmpeq_w : GCCBuiltin<"__builtin_ia32_pcmpeqw128">,
- Intrinsic<[llvm_v8i16_ty, llvm_v8i16_ty,
- llvm_v8i16_ty], [IntrNoMem]>;
- def int_x86_sse2_pcmpeq_d : GCCBuiltin<"__builtin_ia32_pcmpeqd128">,
- Intrinsic<[llvm_v4i32_ty, llvm_v4i32_ty,
- llvm_v4i32_ty], [IntrNoMem]>;
- def int_x86_sse2_pcmpgt_b : GCCBuiltin<"__builtin_ia32_pcmpgtb128">,
- Intrinsic<[llvm_v16i8_ty, llvm_v16i8_ty,
- llvm_v16i8_ty], [IntrNoMem]>;
- def int_x86_sse2_pcmpgt_w : GCCBuiltin<"__builtin_ia32_pcmpgtw128">,
- Intrinsic<[llvm_v8i16_ty, llvm_v8i16_ty,
- llvm_v8i16_ty], [IntrNoMem]>;
- def int_x86_sse2_pcmpgt_d : GCCBuiltin<"__builtin_ia32_pcmpgtd128">,
- Intrinsic<[llvm_v4i32_ty, llvm_v4i32_ty,
- llvm_v4i32_ty], [IntrNoMem]>;
-}
-
-// Conversion ops
-let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
- def int_x86_sse2_cvtdq2pd : GCCBuiltin<"__builtin_ia32_cvtdq2pd">,
- Intrinsic<[llvm_v2f64_ty, llvm_v4i32_ty], [IntrNoMem]>;
- def int_x86_sse2_cvtdq2ps : GCCBuiltin<"__builtin_ia32_cvtdq2ps">,
- Intrinsic<[llvm_v4f32_ty, llvm_v4i32_ty], [IntrNoMem]>;
- def int_x86_sse2_cvtpd2dq : GCCBuiltin<"__builtin_ia32_cvtpd2dq">,
- Intrinsic<[llvm_v4i32_ty, llvm_v2f64_ty], [IntrNoMem]>;
- def int_x86_sse2_cvttpd2dq : GCCBuiltin<"__builtin_ia32_cvttpd2dq">,
- Intrinsic<[llvm_v4i32_ty, llvm_v2f64_ty], [IntrNoMem]>;
- def int_x86_sse2_cvtpd2ps : GCCBuiltin<"__builtin_ia32_cvtpd2ps">,
- Intrinsic<[llvm_v4f32_ty, llvm_v2f64_ty], [IntrNoMem]>;
- def int_x86_sse2_cvtps2dq : GCCBuiltin<"__builtin_ia32_cvtps2dq">,
- Intrinsic<[llvm_v4i32_ty, llvm_v4f32_ty], [IntrNoMem]>;
- def int_x86_sse2_cvttps2dq : GCCBuiltin<"__builtin_ia32_cvttps2dq">,
- Intrinsic<[llvm_v4i32_ty, llvm_v4f32_ty], [IntrNoMem]>;
- def int_x86_sse2_cvtps2pd : GCCBuiltin<"__builtin_ia32_cvtps2pd">,
- Intrinsic<[llvm_v2f64_ty, llvm_v4f32_ty], [IntrNoMem]>;
- def int_x86_sse2_cvtsd2si : GCCBuiltin<"__builtin_ia32_cvtsd2si">,
- Intrinsic<[llvm_i32_ty, llvm_v2f64_ty], [IntrNoMem]>;
- def int_x86_sse2_cvtsd2si64 : GCCBuiltin<"__builtin_ia32_cvtsd2si64">,
- Intrinsic<[llvm_i64_ty, llvm_v2f64_ty], [IntrNoMem]>;
- def int_x86_sse2_cvttsd2si : GCCBuiltin<"__builtin_ia32_cvttsd2si">,
- Intrinsic<[llvm_i32_ty, llvm_v2f64_ty], [IntrNoMem]>;
- def int_x86_sse2_cvttsd2si64 : GCCBuiltin<"__builtin_ia32_cvttsd2si64">,
- Intrinsic<[llvm_i64_ty, llvm_v2f64_ty], [IntrNoMem]>;
- def int_x86_sse2_cvtsi2sd : GCCBuiltin<"__builtin_ia32_cvtsi2sd">,
- Intrinsic<[llvm_v2f64_ty, llvm_v2f64_ty,
- llvm_i32_ty], [IntrNoMem]>;
- def int_x86_sse2_cvtsi642sd : GCCBuiltin<"__builtin_ia32_cvtsi642sd">,
- Intrinsic<[llvm_v2f64_ty, llvm_v2f64_ty,
- llvm_i64_ty], [IntrNoMem]>;
- def int_x86_sse2_cvtsd2ss : GCCBuiltin<"__builtin_ia32_cvtsd2ss">,
- Intrinsic<[llvm_v4f32_ty, llvm_v4f32_ty,
- llvm_v2f64_ty], [IntrNoMem]>;
- def int_x86_sse2_cvtss2sd : GCCBuiltin<"__builtin_ia32_cvtss2sd">,
- Intrinsic<[llvm_v2f64_ty, llvm_v2f64_ty,
- llvm_v4f32_ty], [IntrNoMem]>;
- def int_x86_sse_cvtpd2pi : GCCBuiltin<"__builtin_ia32_cvtpd2pi">,
- Intrinsic<[llvm_v2i32_ty, llvm_v2f64_ty], [IntrNoMem]>;
- def int_x86_sse_cvttpd2pi: GCCBuiltin<"__builtin_ia32_cvttpd2pi">,
- Intrinsic<[llvm_v2i32_ty, llvm_v2f64_ty], [IntrNoMem]>;
- def int_x86_sse_cvtpi2pd : GCCBuiltin<"__builtin_ia32_cvtpi2pd">,
- Intrinsic<[llvm_v2f64_ty, llvm_v2i32_ty], [IntrNoMem]>;
-}
-
-// SIMD load ops
-let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
- def int_x86_sse2_loadu_pd : GCCBuiltin<"__builtin_ia32_loadupd">,
- Intrinsic<[llvm_v2f64_ty, llvm_ptr_ty], [IntrReadMem]>;
- def int_x86_sse2_loadu_dq : GCCBuiltin<"__builtin_ia32_loaddqu">,
- Intrinsic<[llvm_v16i8_ty, llvm_ptr_ty], [IntrReadMem]>;
-}
-
-// SIMD store ops
-let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
- def int_x86_sse2_storeu_pd : GCCBuiltin<"__builtin_ia32_storeupd">,
- Intrinsic<[llvm_void_ty, llvm_ptr_ty,
- llvm_v2f64_ty], [IntrWriteMem]>;
- def int_x86_sse2_storeu_dq : GCCBuiltin<"__builtin_ia32_storedqu">,
- Intrinsic<[llvm_void_ty, llvm_ptr_ty,
- llvm_v16i8_ty], [IntrWriteMem]>;
- def int_x86_sse2_storel_dq : GCCBuiltin<"__builtin_ia32_storelv4si">,
- Intrinsic<[llvm_void_ty, llvm_ptr_ty,
- llvm_v4i32_ty], [IntrWriteMem]>;
-}
-
-// Cacheability support ops
-let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
- def int_x86_sse2_movnt_dq : GCCBuiltin<"__builtin_ia32_movntdq">,
- Intrinsic<[llvm_void_ty, llvm_ptr_ty,
- llvm_v2i64_ty], [IntrWriteMem]>;
- def int_x86_sse2_movnt_pd : GCCBuiltin<"__builtin_ia32_movntpd">,
- Intrinsic<[llvm_void_ty, llvm_ptr_ty,
- llvm_v2f64_ty], [IntrWriteMem]>;
- def int_x86_sse2_movnt_i : GCCBuiltin<"__builtin_ia32_movnti">,
- Intrinsic<[llvm_void_ty, llvm_ptr_ty,
- llvm_i32_ty], [IntrWriteMem]>;
-}
-
-// Misc.
-let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
- def int_x86_sse2_packsswb_128 : GCCBuiltin<"__builtin_ia32_packsswb128">,
- Intrinsic<[llvm_v8i16_ty, llvm_v8i16_ty,
- llvm_v8i16_ty], [IntrNoMem]>;
- def int_x86_sse2_packssdw_128 : GCCBuiltin<"__builtin_ia32_packssdw128">,
- Intrinsic<[llvm_v4i32_ty, llvm_v4i32_ty,
- llvm_v4i32_ty], [IntrNoMem]>;
- def int_x86_sse2_packuswb_128 : GCCBuiltin<"__builtin_ia32_packuswb128">,
- Intrinsic<[llvm_v8i16_ty, llvm_v8i16_ty,
- llvm_v8i16_ty], [IntrNoMem]>;
- def int_x86_sse2_movmsk_pd : GCCBuiltin<"__builtin_ia32_movmskpd">,
- Intrinsic<[llvm_i32_ty, llvm_v2f64_ty], [IntrNoMem]>;
- def int_x86_sse2_pmovmskb_128 : GCCBuiltin<"__builtin_ia32_pmovmskb128">,
- Intrinsic<[llvm_i32_ty, llvm_v16i8_ty], [IntrNoMem]>;
- def int_x86_sse2_maskmov_dqu : GCCBuiltin<"__builtin_ia32_maskmovdqu">,
- Intrinsic<[llvm_void_ty, llvm_v16i8_ty,
- llvm_v16i8_ty, llvm_ptr_ty], [IntrWriteMem]>;
- def int_x86_sse2_clflush : GCCBuiltin<"__builtin_ia32_clflush">,
- Intrinsic<[llvm_void_ty, llvm_ptr_ty], [IntrWriteMem]>;
- def int_x86_sse2_lfence : GCCBuiltin<"__builtin_ia32_lfence">,
- Intrinsic<[llvm_void_ty], [IntrWriteMem]>;
- def int_x86_sse2_mfence : GCCBuiltin<"__builtin_ia32_mfence">,
- Intrinsic<[llvm_void_ty], [IntrWriteMem]>;
-}
-
-// Shuffles.
-// FIXME: Temporary workarounds since 2-wide shuffle is broken.
-let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
- def int_x86_sse2_movs_d : GCCBuiltin<"__builtin_ia32_movsd">,
- Intrinsic<[llvm_v2f64_ty, llvm_v2f64_ty,
- llvm_v2f64_ty], [IntrNoMem]>;
- def int_x86_sse2_loadh_pd : GCCBuiltin<"__builtin_ia32_loadhpd">,
- Intrinsic<[llvm_v2f64_ty, llvm_v2f64_ty,
- llvm_ptr_ty], [IntrReadMem]>;
- def int_x86_sse2_loadl_pd : GCCBuiltin<"__builtin_ia32_loadlpd">,
- Intrinsic<[llvm_v2f64_ty, llvm_v2f64_ty,
- llvm_ptr_ty], [IntrReadMem]>;
- def int_x86_sse2_shuf_pd : GCCBuiltin<"__builtin_ia32_shufpd">,
- Intrinsic<[llvm_v2f64_ty, llvm_v2f64_ty,
- llvm_v2f64_ty, llvm_i32_ty], [IntrNoMem]>;
- def int_x86_sse2_unpckh_pd : GCCBuiltin<"__builtin_ia32_unpckhpd">,
- Intrinsic<[llvm_v2f64_ty, llvm_v2f64_ty,
- llvm_v2f64_ty], [IntrNoMem]>;
- def int_x86_sse2_unpckl_pd : GCCBuiltin<"__builtin_ia32_unpcklpd">,
- Intrinsic<[llvm_v2f64_ty, llvm_v2f64_ty,
- llvm_v2f64_ty], [IntrNoMem]>;
- def int_x86_sse2_punpckh_qdq : GCCBuiltin<"__builtin_ia32_punpckhqdq128">,
- Intrinsic<[llvm_v2i64_ty, llvm_v2i64_ty,
- llvm_v2i64_ty], [IntrNoMem]>;
- def int_x86_sse2_punpckl_qdq : GCCBuiltin<"__builtin_ia32_punpcklqdq128">,
- Intrinsic<[llvm_v2i64_ty, llvm_v2i64_ty,
- llvm_v2i64_ty], [IntrNoMem]>;
-}
-
-//===----------------------------------------------------------------------===//
-// SSE3
-
-// Addition / subtraction ops.
-let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
- def int_x86_sse3_addsub_ps : GCCBuiltin<"__builtin_ia32_addsubps">,
- Intrinsic<[llvm_v4f32_ty, llvm_v4f32_ty,
- llvm_v4f32_ty], [IntrNoMem]>;
- def int_x86_sse3_addsub_pd : GCCBuiltin<"__builtin_ia32_addsubpd">,
- Intrinsic<[llvm_v2f64_ty, llvm_v2f64_ty,
- llvm_v2f64_ty], [IntrNoMem]>;
-}
-
-// Horizontal ops.
-let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
- def int_x86_sse3_hadd_ps : GCCBuiltin<"__builtin_ia32_haddps">,
- Intrinsic<[llvm_v4f32_ty, llvm_v4f32_ty,
- llvm_v4f32_ty], [IntrNoMem]>;
- def int_x86_sse3_hadd_pd : GCCBuiltin<"__builtin_ia32_haddpd">,
- Intrinsic<[llvm_v2f64_ty, llvm_v2f64_ty,
- llvm_v2f64_ty], [IntrNoMem]>;
- def int_x86_sse3_hsub_ps : GCCBuiltin<"__builtin_ia32_hsubps">,
- Intrinsic<[llvm_v4f32_ty, llvm_v4f32_ty,
- llvm_v4f32_ty], [IntrNoMem]>;
- def int_x86_sse3_hsub_pd : GCCBuiltin<"__builtin_ia32_hsubpd">,
- Intrinsic<[llvm_v2f64_ty, llvm_v2f64_ty,
- llvm_v2f64_ty], [IntrNoMem]>;
-}
-
-// Specialized unaligned load.
-let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
- def int_x86_sse3_ldu_dq : GCCBuiltin<"__builtin_ia32_lddqu">,
- Intrinsic<[llvm_v16i8_ty, llvm_ptr_ty], [IntrReadMem]>;
-}
-
-// Thread synchronization ops.
-let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
- def int_x86_sse3_monitor : GCCBuiltin<"__builtin_ia32_monitor">,
- Intrinsic<[llvm_void_ty, llvm_ptr_ty,
- llvm_i32_ty, llvm_i32_ty], [IntrWriteMem]>;
- def int_x86_sse3_mwait : GCCBuiltin<"__builtin_ia32_mwait">,
- Intrinsic<[llvm_void_ty, llvm_i32_ty,
- llvm_i32_ty], [IntrWriteMem]>;
-}
-
-//===----------------------------------------------------------------------===//
-// SSSE3
-
-// Horizontal arithmetic ops
-let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
- def int_x86_ssse3_phadd_w : GCCBuiltin<"__builtin_ia32_phaddw">,
- Intrinsic<[llvm_v4i16_ty, llvm_v4i16_ty,
- llvm_v4i16_ty], [IntrNoMem]>;
- def int_x86_ssse3_phadd_w_128 : GCCBuiltin<"__builtin_ia32_phaddw128">,
- Intrinsic<[llvm_v8i16_ty, llvm_v8i16_ty,
- llvm_v8i16_ty], [IntrNoMem]>;
-
- def int_x86_ssse3_phadd_d : GCCBuiltin<"__builtin_ia32_phaddd">,
- Intrinsic<[llvm_v2i32_ty, llvm_v2i32_ty,
- llvm_v2i32_ty], [IntrNoMem]>;
- def int_x86_ssse3_phadd_d_128 : GCCBuiltin<"__builtin_ia32_phaddd128">,
- Intrinsic<[llvm_v4i32_ty, llvm_v4i32_ty,
- llvm_v4i32_ty], [IntrNoMem]>;
-
- def int_x86_ssse3_phadd_sw : GCCBuiltin<"__builtin_ia32_phaddsw">,
- Intrinsic<[llvm_v4i16_ty, llvm_v4i16_ty,
- llvm_v4i16_ty], [IntrNoMem]>;
- def int_x86_ssse3_phadd_sw_128 : GCCBuiltin<"__builtin_ia32_phaddsw128">,
- Intrinsic<[llvm_v4i32_ty, llvm_v4i32_ty,
- llvm_v4i32_ty], [IntrNoMem]>;
-
- def int_x86_ssse3_phsub_w : GCCBuiltin<"__builtin_ia32_phsubw">,
- Intrinsic<[llvm_v4i16_ty, llvm_v4i16_ty,
- llvm_v4i16_ty], [IntrNoMem]>;
- def int_x86_ssse3_phsub_w_128 : GCCBuiltin<"__builtin_ia32_phsubw128">,
- Intrinsic<[llvm_v8i16_ty, llvm_v8i16_ty,
- llvm_v8i16_ty], [IntrNoMem]>;
-
- def int_x86_ssse3_phsub_d : GCCBuiltin<"__builtin_ia32_phsubd">,
- Intrinsic<[llvm_v2i32_ty, llvm_v2i32_ty,
- llvm_v2i32_ty], [IntrNoMem]>;
- def int_x86_ssse3_phsub_d_128 : GCCBuiltin<"__builtin_ia32_phsubd128">,
- Intrinsic<[llvm_v4i32_ty, llvm_v4i32_ty,
- llvm_v4i32_ty], [IntrNoMem]>;
-
- def int_x86_ssse3_phsub_sw : GCCBuiltin<"__builtin_ia32_phsubsw">,
- Intrinsic<[llvm_v4i16_ty, llvm_v4i16_ty,
- llvm_v4i16_ty], [IntrNoMem]>;
- def int_x86_ssse3_phsub_sw_128 : GCCBuiltin<"__builtin_ia32_phsubsw128">,
- Intrinsic<[llvm_v8i16_ty, llvm_v8i16_ty,
- llvm_v8i16_ty], [IntrNoMem]>;
-
- def int_x86_ssse3_pmadd_ub_sw : GCCBuiltin<"__builtin_ia32_pmaddubsw">,
- Intrinsic<[llvm_v4i16_ty, llvm_v4i16_ty,
- llvm_v4i16_ty], [IntrNoMem]>;
- def int_x86_ssse3_pmadd_ub_sw_128 : GCCBuiltin<"__builtin_ia32_pmaddubsw128">,
- Intrinsic<[llvm_v8i16_ty, llvm_v8i16_ty,
- llvm_v8i16_ty], [IntrNoMem]>;
-
- def int_x86_ssse3_pmul_hr_sw : GCCBuiltin<"__builtin_ia32_pmulhrsw">,
- Intrinsic<[llvm_v4i16_ty, llvm_v4i16_ty,
- llvm_v4i16_ty], [IntrNoMem]>;
- def int_x86_ssse3_pmul_hr_sw_128 : GCCBuiltin<"__builtin_ia32_pmulhrsw128">,
- Intrinsic<[llvm_v8i16_ty, llvm_v8i16_ty,
- llvm_v8i16_ty], [IntrNoMem]>;
-}
-
-// Shuffle ops
-let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
- def int_x86_ssse3_pshuf_b : GCCBuiltin<"__builtin_ia32_pshufb">,
- Intrinsic<[llvm_v8i8_ty, llvm_v8i8_ty,
- llvm_v8i8_ty], [IntrNoMem]>;
- def int_x86_ssse3_pshuf_b_128 : GCCBuiltin<"__builtin_ia32_pshufb128">,
- Intrinsic<[llvm_v16i8_ty, llvm_v16i8_ty,
- llvm_v16i8_ty], [IntrNoMem]>;
-}
-
-// Sign ops
-let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
- def int_x86_ssse3_psign_b : GCCBuiltin<"__builtin_ia32_psignb">,
- Intrinsic<[llvm_v8i8_ty, llvm_v8i8_ty,
- llvm_v8i8_ty], [IntrNoMem]>;
- def int_x86_ssse3_psign_b_128 : GCCBuiltin<"__builtin_ia32_psignb128">,
- Intrinsic<[llvm_v16i8_ty, llvm_v16i8_ty,
- llvm_v16i8_ty], [IntrNoMem]>;
-
- def int_x86_ssse3_psign_w : GCCBuiltin<"__builtin_ia32_psignw">,
- Intrinsic<[llvm_v4i16_ty, llvm_v4i16_ty,
- llvm_v4i16_ty], [IntrNoMem]>;
- def int_x86_ssse3_psign_w_128 : GCCBuiltin<"__builtin_ia32_psignw128">,
- Intrinsic<[llvm_v8i16_ty, llvm_v8i16_ty,
- llvm_v8i16_ty], [IntrNoMem]>;
-
- def int_x86_ssse3_psign_d : GCCBuiltin<"__builtin_ia32_psignd">,
- Intrinsic<[llvm_v2i32_ty, llvm_v2i32_ty,
- llvm_v2i32_ty], [IntrNoMem]>;
- def int_x86_ssse3_psign_d_128 : GCCBuiltin<"__builtin_ia32_psignd128">,
- Intrinsic<[llvm_v4i32_ty, llvm_v4i32_ty,
- llvm_v4i32_ty], [IntrNoMem]>;
-}
-
-// Absolute value ops
-let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
- def int_x86_ssse3_pabs_b : GCCBuiltin<"__builtin_ia32_pabsb">,
- Intrinsic<[llvm_v8i8_ty, llvm_v8i8_ty], [IntrNoMem]>;
- def int_x86_ssse3_pabs_b_128 : GCCBuiltin<"__builtin_ia32_pabsb128">,
- Intrinsic<[llvm_v16i8_ty, llvm_v16i8_ty], [IntrNoMem]>;
-
- def int_x86_ssse3_pabs_w : GCCBuiltin<"__builtin_ia32_pabsw">,
- Intrinsic<[llvm_v4i16_ty, llvm_v4i16_ty], [IntrNoMem]>;
- def int_x86_ssse3_pabs_w_128 : GCCBuiltin<"__builtin_ia32_pabsw128">,
- Intrinsic<[llvm_v8i16_ty, llvm_v8i16_ty], [IntrNoMem]>;
-
- def int_x86_ssse3_pabs_d : GCCBuiltin<"__builtin_ia32_pabsd">,
- Intrinsic<[llvm_v2i32_ty, llvm_v2i32_ty], [IntrNoMem]>;
- def int_x86_ssse3_pabs_d_128 : GCCBuiltin<"__builtin_ia32_pabsd128">,
- Intrinsic<[llvm_v4i32_ty, llvm_v4i32_ty], [IntrNoMem]>;
-}
-
-// Align ops
-let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
- def int_x86_ssse3_palign_r : GCCBuiltin<"__builtin_ia32_palignr">,
- Intrinsic<[llvm_v1i64_ty, llvm_v1i64_ty,
- llvm_v1i64_ty, llvm_i16_ty], [IntrNoMem]>;
- def int_x86_ssse3_palign_r_128 : GCCBuiltin<"__builtin_ia32_palignr128">,
- Intrinsic<[llvm_v2i64_ty, llvm_v2i64_ty,
- llvm_v2i64_ty, llvm_i32_ty], [IntrNoMem]>;
-}
-
-//===----------------------------------------------------------------------===//
-// SSE4.1
-
-// FP rounding ops
-let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
- def int_x86_sse41_round_ss : GCCBuiltin<"__builtin_ia32_roundss">,
- Intrinsic<[llvm_v4f32_ty, llvm_v4f32_ty,
- llvm_i32_ty], [IntrNoMem]>;
- def int_x86_sse41_round_ps : GCCBuiltin<"__builtin_ia32_roundps">,
- Intrinsic<[llvm_v4f32_ty, llvm_v4f32_ty,
- llvm_i32_ty], [IntrNoMem]>;
- def int_x86_sse41_round_sd : GCCBuiltin<"__builtin_ia32_roundsd">,
- Intrinsic<[llvm_v2f64_ty, llvm_v2f64_ty,
- llvm_i32_ty], [IntrNoMem]>;
- def int_x86_sse41_round_pd : GCCBuiltin<"__builtin_ia32_roundpd">,
- Intrinsic<[llvm_v2f64_ty, llvm_v2f64_ty,
- llvm_i32_ty], [IntrNoMem]>;
-}
-
-// Vector sign and zero extend
-let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
- def int_x86_sse41_pmovsxbd : GCCBuiltin<"__builtin_ia32_pmovsxbd128">,
- Intrinsic<[llvm_v4i32_ty, llvm_v16i8_ty]>;
- def int_x86_sse41_pmovsxbq : GCCBuiltin<"__builtin_ia32_pmovsxbq128">,
- Intrinsic<[llvm_v2i64_ty, llvm_v16i8_ty]>;
- def int_x86_sse41_pmovsxbw : GCCBuiltin<"__builtin_ia32_pmovsxbw128">,
- Intrinsic<[llvm_v8i16_ty, llvm_v16i8_ty]>;
- def int_x86_sse41_pmovsxdq : GCCBuiltin<"__builtin_ia32_pmovsxdq128">,
- Intrinsic<[llvm_v2i64_ty, llvm_v4i32_ty]>;
- def int_x86_sse41_pmovsxwd : GCCBuiltin<"__builtin_ia32_pmovsxwd128">,
- Intrinsic<[llvm_v4i32_ty, llvm_v8i16_ty]>;
- def int_x86_sse41_pmovsxwq : GCCBuiltin<"__builtin_ia32_pmovsxwq128">,
- Intrinsic<[llvm_v2i64_ty, llvm_v8i16_ty]>;
- def int_x86_sse41_pmovzxbd : GCCBuiltin<"__builtin_ia32_pmovzxbd128">,
- Intrinsic<[llvm_v4i32_ty, llvm_v16i8_ty]>;
- def int_x86_sse41_pmovzxbq : GCCBuiltin<"__builtin_ia32_pmovzxbq128">,
- Intrinsic<[llvm_v2i64_ty, llvm_v16i8_ty]>;
- def int_x86_sse41_pmovzxbw : GCCBuiltin<"__builtin_ia32_pmovzxbw128">,
- Intrinsic<[llvm_v8i16_ty, llvm_v16i8_ty]>;
- def int_x86_sse41_pmovzxdq : GCCBuiltin<"__builtin_ia32_pmovzxdq128">,
- Intrinsic<[llvm_v2i64_ty, llvm_v4i32_ty]>;
- def int_x86_sse41_pmovzxwd : GCCBuiltin<"__builtin_ia32_pmovzxwd128">,
- Intrinsic<[llvm_v4i32_ty, llvm_v8i16_ty]>;
- def int_x86_sse41_pmovzxwq : GCCBuiltin<"__builtin_ia32_pmovzxwq128">,
- Intrinsic<[llvm_v2i64_ty, llvm_v8i16_ty]>;
-}
-
-// Vector min element
-let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
- def int_x86_sse41_phminposuw : GCCBuiltin<"__builtin_ia32_phminposuw128">,
- Intrinsic<[llvm_v8i16_ty, llvm_v8i16_ty]>;
-}
-
-// Vector compare, min, max
-let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
- def int_x86_sse41_pcmpeqq : GCCBuiltin<"__builtin_ia32_pcmpeqq">,
- Intrinsic<[llvm_v2i64_ty, llvm_v2i64_ty, llvm_v2i64_ty]>;
- def int_x86_sse41_pmaxsb : GCCBuiltin<"__builtin_ia32_pmaxsb128">,
- Intrinsic<[llvm_v16i8_ty, llvm_v16i8_ty, llvm_v16i8_ty]>;
- def int_x86_sse41_pmaxsd : GCCBuiltin<"__builtin_ia32_pmaxsd128">,
- Intrinsic<[llvm_v4i32_ty, llvm_v4i32_ty, llvm_v4i32_ty]>;
- def int_x86_sse41_pmaxud : GCCBuiltin<"__builtin_ia32_pmaxud128">,
- Intrinsic<[llvm_v4i32_ty, llvm_v4i32_ty, llvm_v4i32_ty]>;
- def int_x86_sse41_pmaxuw : GCCBuiltin<"__builtin_ia32_pmaxuw128">,
- Intrinsic<[llvm_v8i16_ty, llvm_v8i16_ty, llvm_v8i16_ty]>;
- def int_x86_sse41_pminsb : GCCBuiltin<"__builtin_ia32_pminsb128">,
- Intrinsic<[llvm_v16i8_ty, llvm_v16i8_ty, llvm_v16i8_ty]>;
- def int_x86_sse41_pminsd : GCCBuiltin<"__builtin_ia32_pminsd128">,
- Intrinsic<[llvm_v4i32_ty, llvm_v4i32_ty, llvm_v4i32_ty]>;
- def int_x86_sse41_pminud : GCCBuiltin<"__builtin_ia32_pminud128">,
- Intrinsic<[llvm_v4i32_ty, llvm_v4i32_ty, llvm_v4i32_ty]>;
- def int_x86_sse41_pminuw : GCCBuiltin<"__builtin_ia32_pminuw128">,
- Intrinsic<[llvm_v8i16_ty, llvm_v8i16_ty, llvm_v8i16_ty]>;
-}
-
-// Vector pack
-let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
- def int_x86_sse41_packusdw : GCCBuiltin<"__builtin_ia32_packusdw128">,
- Intrinsic<[llvm_v8i16_ty, llvm_v4i32_ty, llvm_v4i32_ty]>;
-}
-
-// Vector multiply
-let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
- def int_x86_sse41_pmuldq : GCCBuiltin<"__builtin_ia32_pmuldq128">,
- Intrinsic<[llvm_v2i64_ty, llvm_v4i32_ty, llvm_v4i32_ty]>;
- def int_x86_sse41_pmulld : GCCBuiltin<"__builtin_ia32_pmulld128">,
- Intrinsic<[llvm_v4i32_ty, llvm_v4i32_ty, llvm_v4i32_ty]>;
-}
-
-// Vector extract
-let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
- def int_x86_sse41_pextrb :
- Intrinsic<[llvm_i32_ty, llvm_v16i8_ty, llvm_i32_ty]>;
- def int_x86_sse41_pextrd :
- Intrinsic<[llvm_i32_ty, llvm_v4i32_ty, llvm_i32_ty]>;
- def int_x86_sse41_pextrq :
- Intrinsic<[llvm_i64_ty, llvm_v2i64_ty, llvm_i32_ty]>;
- def int_x86_sse41_extractps : GCCBuiltin<"__builtin_ia32_extractps128">,
- Intrinsic<[llvm_i32_ty, llvm_v4f32_ty, llvm_i32_ty]>;
-}
-
-// Vector insert
-let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
- def int_x86_sse41_pinsrb : GCCBuiltin<"__builtin_ia32_vec_set_v16qi">,
- Intrinsic<[llvm_v16i8_ty, llvm_v16i8_ty, llvm_i32_ty, llvm_i32_ty]>;
- def int_x86_sse41_pinsrd : GCCBuiltin<"__builtin_ia32_vec_set_v4si">,
- Intrinsic<[llvm_v4i32_ty, llvm_v4i32_ty, llvm_i32_ty, llvm_i32_ty]>;
- def int_x86_sse41_pinsrq : GCCBuiltin<"__builtin_ia32_vec_set_v2di">,
- Intrinsic<[llvm_v2i64_ty, llvm_v2i64_ty, llvm_i64_ty, llvm_i32_ty]>;
- def int_x86_sse41_insertps : GCCBuiltin<"__builtin_ia32_insertps128">,
- Intrinsic<[llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4f32_ty, llvm_i32_ty]>;
-}
-
-// Vector blend
-let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
- def int_x86_sse41_pblendvb : GCCBuiltin<"__builtin_ia32_pblendvb128">,
- Intrinsic<[llvm_v16i8_ty, llvm_v16i8_ty, llvm_v16i8_ty, llvm_v16i8_ty]>;
- def int_x86_sse41_pblendw : GCCBuiltin<"__builtin_ia32_pblendw128">,
- Intrinsic<[llvm_v8i16_ty, llvm_v8i16_ty, llvm_v8i16_ty, llvm_i32_ty]>;
- def int_x86_sse41_blendpd : GCCBuiltin<"__builtin_ia32_blendpd">,
- Intrinsic<[llvm_v2f64_ty, llvm_v2f64_ty, llvm_v2f64_ty, llvm_i32_ty]>;
- def int_x86_sse41_blendps : GCCBuiltin<"__builtin_ia32_blendps">,
- Intrinsic<[llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4f32_ty, llvm_i32_ty]>;
- def int_x86_sse41_blendvpd : GCCBuiltin<"__builtin_ia32_blendvpd">,
- Intrinsic<[llvm_v2f64_ty, llvm_v2f64_ty, llvm_v2f64_ty, llvm_v2f64_ty]>;
- def int_x86_sse41_blendvps : GCCBuiltin<"__builtin_ia32_blendvps">,
- Intrinsic<[llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4f32_ty]>;
-}
-
-// Vector dot product
-let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
- def int_x86_sse41_dppd : GCCBuiltin<"__builtin_ia32_dppd">,
- Intrinsic<[llvm_v2f64_ty, llvm_v2f64_ty, llvm_v2f64_ty, llvm_i32_ty]>;
- def int_x86_sse41_dpps : GCCBuiltin<"__builtin_ia32_dpps">,
- Intrinsic<[llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4f32_ty, llvm_i32_ty]>;
-}
-
-// Vector sum of absolute differences
-let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
- def int_x86_sse41_mpsadbw : GCCBuiltin<"__builtin_ia32_mpsadbw128">,
- Intrinsic<[llvm_v16i8_ty, llvm_v16i8_ty, llvm_v16i8_ty, llvm_i32_ty]>;
-}
-
-// Vector sum of absolute differences
-let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
- def int_x86_sse41_movntdqa : GCCBuiltin<"__builtin_ia32_movntdqa">,
- Intrinsic<[llvm_v2i64_ty, llvm_ptr_ty], [IntrReadMem]>;
-}
-
-
-//===----------------------------------------------------------------------===//
-// MMX
-
-// Empty MMX state op.
-let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
- def int_x86_mmx_emms : GCCBuiltin<"__builtin_ia32_emms">,
- Intrinsic<[llvm_void_ty], [IntrWriteMem]>;
- def int_x86_mmx_femms : GCCBuiltin<"__builtin_ia32_femms">,
- Intrinsic<[llvm_void_ty], [IntrWriteMem]>;
-}
-
-// Integer arithmetic ops.
-let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
- // Addition
- def int_x86_mmx_padds_b : GCCBuiltin<"__builtin_ia32_paddsb">,
- Intrinsic<[llvm_v8i8_ty, llvm_v8i8_ty,
- llvm_v8i8_ty], [IntrNoMem]>;
- def int_x86_mmx_padds_w : GCCBuiltin<"__builtin_ia32_paddsw">,
- Intrinsic<[llvm_v4i16_ty, llvm_v4i16_ty,
- llvm_v4i16_ty], [IntrNoMem]>;
-
- def int_x86_mmx_paddus_b : GCCBuiltin<"__builtin_ia32_paddusb">,
- Intrinsic<[llvm_v8i8_ty, llvm_v8i8_ty,
- llvm_v8i8_ty], [IntrNoMem]>;
- def int_x86_mmx_paddus_w : GCCBuiltin<"__builtin_ia32_paddusw">,
- Intrinsic<[llvm_v4i16_ty, llvm_v4i16_ty,
- llvm_v4i16_ty], [IntrNoMem]>;
-
- // Subtraction
- def int_x86_mmx_psubs_b : GCCBuiltin<"__builtin_ia32_psubsb">,
- Intrinsic<[llvm_v8i8_ty, llvm_v8i8_ty,
- llvm_v8i8_ty], [IntrNoMem]>;
- def int_x86_mmx_psubs_w : GCCBuiltin<"__builtin_ia32_psubsw">,
- Intrinsic<[llvm_v4i16_ty, llvm_v4i16_ty,
- llvm_v4i16_ty], [IntrNoMem]>;
-
- def int_x86_mmx_psubus_b : GCCBuiltin<"__builtin_ia32_psubusb">,
- Intrinsic<[llvm_v8i8_ty, llvm_v8i8_ty,
- llvm_v8i8_ty], [IntrNoMem]>;
- def int_x86_mmx_psubus_w : GCCBuiltin<"__builtin_ia32_psubusw">,
- Intrinsic<[llvm_v4i16_ty, llvm_v4i16_ty,
- llvm_v4i16_ty], [IntrNoMem]>;
-
- // Multiplication
- def int_x86_mmx_pmulh_w : GCCBuiltin<"__builtin_ia32_pmulhw">,
- Intrinsic<[llvm_v4i16_ty, llvm_v4i16_ty,
- llvm_v4i16_ty], [IntrNoMem]>;
- def int_x86_mmx_pmulhu_w : GCCBuiltin<"__builtin_ia32_pmulhuw">,
- Intrinsic<[llvm_v4i16_ty, llvm_v4i16_ty,
- llvm_v4i16_ty], [IntrNoMem]>;
- def int_x86_mmx_pmulu_dq : GCCBuiltin<"__builtin_ia32_pmuludq">,
- Intrinsic<[llvm_v2i32_ty, llvm_v2i32_ty,
- llvm_v2i32_ty], [IntrNoMem]>;
- def int_x86_mmx_pmadd_wd : GCCBuiltin<"__builtin_ia32_pmaddwd">,
- Intrinsic<[llvm_v2i32_ty, llvm_v4i16_ty,
- llvm_v4i16_ty], [IntrNoMem]>;
-
- // Averages
- def int_x86_mmx_pavg_b : GCCBuiltin<"__builtin_ia32_pavgb">,
- Intrinsic<[llvm_v8i8_ty, llvm_v8i8_ty,
- llvm_v8i8_ty], [IntrNoMem]>;
- def int_x86_mmx_pavg_w : GCCBuiltin<"__builtin_ia32_pavgw">,
- Intrinsic<[llvm_v4i16_ty, llvm_v4i16_ty,
- llvm_v4i16_ty], [IntrNoMem]>;
-
- // Maximum
- def int_x86_mmx_pmaxu_b : GCCBuiltin<"__builtin_ia32_pmaxub">,
- Intrinsic<[llvm_v8i8_ty, llvm_v8i8_ty,
- llvm_v8i8_ty], [IntrNoMem]>;
- def int_x86_mmx_pmaxs_w : GCCBuiltin<"__builtin_ia32_pmaxsw">,
- Intrinsic<[llvm_v4i16_ty, llvm_v4i16_ty,
- llvm_v4i16_ty], [IntrNoMem]>;
-
- // Minimum
- def int_x86_mmx_pminu_b : GCCBuiltin<"__builtin_ia32_pminub">,
- Intrinsic<[llvm_v8i8_ty, llvm_v8i8_ty,
- llvm_v8i8_ty], [IntrNoMem]>;
- def int_x86_mmx_pmins_w : GCCBuiltin<"__builtin_ia32_pminsw">,
- Intrinsic<[llvm_v4i16_ty, llvm_v4i16_ty,
- llvm_v4i16_ty], [IntrNoMem]>;
-
- // Packed sum of absolute differences
- def int_x86_mmx_psad_bw : GCCBuiltin<"__builtin_ia32_psadbw">,
- Intrinsic<[llvm_v4i16_ty, llvm_v8i8_ty,
- llvm_v8i8_ty], [IntrNoMem]>;
-}
-
-// Integer shift ops.
-let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
- // Shift left logical
- def int_x86_mmx_psll_w : GCCBuiltin<"__builtin_ia32_psllw">,
- Intrinsic<[llvm_v4i16_ty, llvm_v4i16_ty,
- llvm_v1i64_ty], [IntrNoMem]>;
- def int_x86_mmx_psll_d : GCCBuiltin<"__builtin_ia32_pslld">,
- Intrinsic<[llvm_v2i32_ty, llvm_v2i32_ty,
- llvm_v1i64_ty], [IntrNoMem]>;
- def int_x86_mmx_psll_q : GCCBuiltin<"__builtin_ia32_psllq">,
- Intrinsic<[llvm_v1i64_ty, llvm_v1i64_ty,
- llvm_v1i64_ty], [IntrNoMem]>;
-
- def int_x86_mmx_psrl_w : GCCBuiltin<"__builtin_ia32_psrlw">,
- Intrinsic<[llvm_v4i16_ty, llvm_v4i16_ty,
- llvm_v1i64_ty], [IntrNoMem]>;
- def int_x86_mmx_psrl_d : GCCBuiltin<"__builtin_ia32_psrld">,
- Intrinsic<[llvm_v2i32_ty, llvm_v2i32_ty,
- llvm_v1i64_ty], [IntrNoMem]>;
- def int_x86_mmx_psrl_q : GCCBuiltin<"__builtin_ia32_psrlq">,
- Intrinsic<[llvm_v1i64_ty, llvm_v1i64_ty,
- llvm_v1i64_ty], [IntrNoMem]>;
-
- def int_x86_mmx_psra_w : GCCBuiltin<"__builtin_ia32_psraw">,
- Intrinsic<[llvm_v4i16_ty, llvm_v4i16_ty,
- llvm_v1i64_ty], [IntrNoMem]>;
- def int_x86_mmx_psra_d : GCCBuiltin<"__builtin_ia32_psrad">,
- Intrinsic<[llvm_v2i32_ty, llvm_v2i32_ty,
- llvm_v1i64_ty], [IntrNoMem]>;
-
- def int_x86_mmx_pslli_w : GCCBuiltin<"__builtin_ia32_psllwi">,
- Intrinsic<[llvm_v4i16_ty, llvm_v4i16_ty,
- llvm_i32_ty], [IntrNoMem]>;
- def int_x86_mmx_pslli_d : GCCBuiltin<"__builtin_ia32_pslldi">,
- Intrinsic<[llvm_v2i32_ty, llvm_v2i32_ty,
- llvm_i32_ty], [IntrNoMem]>;
- def int_x86_mmx_pslli_q : GCCBuiltin<"__builtin_ia32_psllqi">,
- Intrinsic<[llvm_v1i64_ty, llvm_v1i64_ty,
- llvm_i32_ty], [IntrNoMem]>;
-
- def int_x86_mmx_psrli_w : GCCBuiltin<"__builtin_ia32_psrlwi">,
- Intrinsic<[llvm_v4i16_ty, llvm_v4i16_ty,
- llvm_i32_ty], [IntrNoMem]>;
- def int_x86_mmx_psrli_d : GCCBuiltin<"__builtin_ia32_psrldi">,
- Intrinsic<[llvm_v2i32_ty, llvm_v2i32_ty,
- llvm_i32_ty], [IntrNoMem]>;
- def int_x86_mmx_psrli_q : GCCBuiltin<"__builtin_ia32_psrlqi">,
- Intrinsic<[llvm_v1i64_ty, llvm_v1i64_ty,
- llvm_i32_ty], [IntrNoMem]>;
-
- def int_x86_mmx_psrai_w : GCCBuiltin<"__builtin_ia32_psrawi">,
- Intrinsic<[llvm_v4i16_ty, llvm_v4i16_ty,
- llvm_i32_ty], [IntrNoMem]>;
- def int_x86_mmx_psrai_d : GCCBuiltin<"__builtin_ia32_psradi">,
- Intrinsic<[llvm_v2i32_ty, llvm_v2i32_ty,
- llvm_i32_ty], [IntrNoMem]>;
-}
-
-// Pack ops.
-let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
- def int_x86_mmx_packsswb : GCCBuiltin<"__builtin_ia32_packsswb">,
- Intrinsic<[llvm_v8i8_ty, llvm_v4i16_ty,
- llvm_v4i16_ty], [IntrNoMem]>;
- def int_x86_mmx_packssdw : GCCBuiltin<"__builtin_ia32_packssdw">,
- Intrinsic<[llvm_v4i16_ty, llvm_v2i32_ty,
- llvm_v2i32_ty], [IntrNoMem]>;
- def int_x86_mmx_packuswb : GCCBuiltin<"__builtin_ia32_packuswb">,
- Intrinsic<[llvm_v8i8_ty, llvm_v4i16_ty,
- llvm_v4i16_ty], [IntrNoMem]>;
-}
-
-// Integer comparison ops
-let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
- def int_x86_mmx_pcmpeq_b : GCCBuiltin<"__builtin_ia32_pcmpeqb">,
- Intrinsic<[llvm_v8i8_ty, llvm_v8i8_ty,
- llvm_v8i8_ty], [IntrNoMem]>;
- def int_x86_mmx_pcmpeq_w : GCCBuiltin<"__builtin_ia32_pcmpeqw">,
- Intrinsic<[llvm_v4i16_ty, llvm_v4i16_ty,
- llvm_v4i16_ty], [IntrNoMem]>;
- def int_x86_mmx_pcmpeq_d : GCCBuiltin<"__builtin_ia32_pcmpeqd">,
- Intrinsic<[llvm_v2i32_ty, llvm_v2i32_ty,
- llvm_v2i32_ty], [IntrNoMem]>;
-
- def int_x86_mmx_pcmpgt_b : GCCBuiltin<"__builtin_ia32_pcmpgtb">,
- Intrinsic<[llvm_v8i8_ty, llvm_v8i8_ty,
- llvm_v8i8_ty], [IntrNoMem]>;
- def int_x86_mmx_pcmpgt_w : GCCBuiltin<"__builtin_ia32_pcmpgtw">,
- Intrinsic<[llvm_v4i16_ty, llvm_v4i16_ty,
- llvm_v4i16_ty], [IntrNoMem]>;
- def int_x86_mmx_pcmpgt_d : GCCBuiltin<"__builtin_ia32_pcmpgtd">,
- Intrinsic<[llvm_v2i32_ty, llvm_v2i32_ty,
- llvm_v2i32_ty], [IntrNoMem]>;
-}
-
-// Misc.
-let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
- def int_x86_mmx_maskmovq : GCCBuiltin<"__builtin_ia32_maskmovq">,
- Intrinsic<[llvm_void_ty, llvm_v8i8_ty, llvm_v8i8_ty, llvm_ptr_ty],
- [IntrWriteMem]>;
-
- def int_x86_mmx_pmovmskb : GCCBuiltin<"__builtin_ia32_pmovmskb">,
- Intrinsic<[llvm_i32_ty, llvm_v8i8_ty], [IntrNoMem]>;
-
- def int_x86_mmx_movnt_dq : GCCBuiltin<"__builtin_ia32_movntq">,
- Intrinsic<[llvm_void_ty, llvm_ptr_ty,
- llvm_v1i64_ty], [IntrWriteMem]>;
-}
diff --git a/release_23/include/llvm/LinkAllPasses.h b/release_23/include/llvm/LinkAllPasses.h
deleted file mode 100644
index 96f9eaee175a..000000000000
--- a/release_23/include/llvm/LinkAllPasses.h
+++ /dev/null
@@ -1,130 +0,0 @@
-//===- llvm/LinkAllPasses.h ------------ Reference All Passes ---*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This header file pulls in all transformation and analysis passes for tools
-// like opt and bugpoint that need this functionality.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_LINKALLPASSES_H
-#define LLVM_LINKALLPASSES_H
-
-#include "llvm/Analysis/AliasSetTracker.h"
-#include "llvm/Analysis/FindUsedTypes.h"
-#include "llvm/Analysis/IntervalPartition.h"
-#include "llvm/Analysis/LoadValueNumbering.h"
-#include "llvm/Analysis/Passes.h"
-#include "llvm/Analysis/PostDominators.h"
-#include "llvm/Analysis/ScalarEvolution.h"
-#include "llvm/CodeGen/Passes.h"
-#include "llvm/Function.h"
-#include "llvm/Transforms/Instrumentation.h"
-#include "llvm/Transforms/IPO.h"
-#include "llvm/Transforms/Scalar.h"
-#include "llvm/Transforms/Utils/UnifyFunctionExitNodes.h"
-#include <cstdlib>
-
-namespace {
- struct ForcePassLinking {
- ForcePassLinking() {
- // We must reference the passes in such a way that compilers will not
- // delete it all as dead code, even with whole program optimization,
- // yet is effectively a NO-OP. As the compiler isn't smart enough
- // to know that getenv() never returns -1, this will do the job.
- if (std::getenv("bar") != (char*) -1)
- return;
-
- (void) llvm::createAAEvalPass();
- (void) llvm::createAggressiveDCEPass();
- (void) llvm::createAliasAnalysisCounterPass();
- (void) llvm::createAliasDebugger();
- (void) llvm::createAndersensPass();
- (void) llvm::createArgumentPromotionPass();
- (void) llvm::createStructRetPromotionPass();
- (void) llvm::createBasicAliasAnalysisPass();
- (void) llvm::createLibCallAliasAnalysisPass(0);
- (void) llvm::createBasicVNPass();
- (void) llvm::createBlockPlacementPass();
- (void) llvm::createBlockProfilerPass();
- (void) llvm::createBreakCriticalEdgesPass();
- (void) llvm::createCFGSimplificationPass();
- (void) llvm::createConstantMergePass();
- (void) llvm::createConstantPropagationPass();
- (void) llvm::createDeadArgEliminationPass();
- (void) llvm::createDeadCodeEliminationPass();
- (void) llvm::createDeadInstEliminationPass();
- (void) llvm::createDeadStoreEliminationPass();
- (void) llvm::createDeadTypeEliminationPass();
- (void) llvm::createEdgeProfilerPass();
- (void) llvm::createFunctionInliningPass();
- (void) llvm::createFunctionProfilerPass();
- (void) llvm::createGCSEPass();
- (void) llvm::createGlobalDCEPass();
- (void) llvm::createGlobalOptimizerPass();
- (void) llvm::createGlobalsModRefPass();
- (void) llvm::createGVNPREPass();
- (void) llvm::createIPConstantPropagationPass();
- (void) llvm::createIPSCCPPass();
- (void) llvm::createIndVarSimplifyPass();
- (void) llvm::createInstructionCombiningPass();
- (void) llvm::createInternalizePass(false);
- (void) llvm::createLCSSAPass();
- (void) llvm::createLICMPass();
- (void) llvm::createLoadValueNumberingPass();
- (void) llvm::createLoopExtractorPass();
- (void) llvm::createLoopSimplifyPass();
- (void) llvm::createLoopStrengthReducePass();
- (void) llvm::createLoopUnrollPass();
- (void) llvm::createLoopUnswitchPass();
- (void) llvm::createLoopRotatePass();
- (void) llvm::createLoopIndexSplitPass();
- (void) llvm::createLowerAllocationsPass();
- (void) llvm::createLowerInvokePass();
- (void) llvm::createLowerSetJmpPass();
- (void) llvm::createLowerSwitchPass();
- (void) llvm::createNoAAPass();
- (void) llvm::createNoProfileInfoPass();
- (void) llvm::createProfileLoaderPass();
- (void) llvm::createPromoteMemoryToRegisterPass();
- (void) llvm::createDemoteRegisterToMemoryPass();
- (void) llvm::createPruneEHPass();
- (void) llvm::createRaiseAllocationsPass();
- (void) llvm::createReassociatePass();
- (void) llvm::createSCCPPass();
- (void) llvm::createScalarReplAggregatesPass();
- (void) llvm::createSimplifyLibCallsPass();
- (void) llvm::createSingleLoopExtractorPass();
- (void) llvm::createStripSymbolsPass();
- (void) llvm::createStripDeadPrototypesPass();
- (void) llvm::createTailCallEliminationPass();
- (void) llvm::createTailDuplicationPass();
- (void) llvm::createJumpThreadingPass();
- (void) llvm::createUnifyFunctionExitNodesPass();
- (void) llvm::createCondPropagationPass();
- (void) llvm::createNullProfilerRSPass();
- (void) llvm::createRSProfilingPass();
- (void) llvm::createIndMemRemPass();
- (void) llvm::createInstCountPass();
- (void) llvm::createPredicateSimplifierPass();
- (void) llvm::createCodeGenPreparePass();
- (void) llvm::createGVNPass();
- (void) llvm::createMemCpyOptPass();
- (void) llvm::createLoopDeletionPass();
-
- (void)new llvm::IntervalPartition();
- (void)new llvm::FindUsedTypes();
- (void)new llvm::ScalarEvolution();
- ((llvm::Function*)0)->viewCFGOnly();
- llvm::AliasSetTracker X(*(llvm::AliasAnalysis*)0);
- X.add((llvm::Value*)0, 0); // for -print-alias-sets
- }
- } ForcePassLinking; // Force link by creating a global definition.
-}
-
-#endif
diff --git a/release_23/include/llvm/LinkAllVMCore.h b/release_23/include/llvm/LinkAllVMCore.h
deleted file mode 100644
index 2c5b1bc8ced4..000000000000
--- a/release_23/include/llvm/LinkAllVMCore.h
+++ /dev/null
@@ -1,54 +0,0 @@
-//===- LinkAllVMCore.h - Reference All VMCore Code --------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This header file pulls in all the object modules of the VMCore library so
-// that tools like llc, opt, and lli can ensure they are linked with all symbols
-// from libVMCore.a It should only be used from a tool's main program.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_LINKALLVMCORE_H
-#define LLVM_LINKALLVMCORE_H
-
-#include "llvm/Module.h"
-#include "llvm/Instructions.h"
-#include "llvm/IntrinsicInst.h"
-#include "llvm/InlineAsm.h"
-#include "llvm/Analysis/Verifier.h"
-#include "llvm/System/Alarm.h"
-#include "llvm/System/DynamicLibrary.h"
-#include "llvm/System/Memory.h"
-#include "llvm/System/Mutex.h"
-#include "llvm/System/Path.h"
-#include "llvm/System/Process.h"
-#include "llvm/System/Program.h"
-#include "llvm/System/Signals.h"
-#include "llvm/System/TimeValue.h"
-#include "llvm/Support/Dwarf.h"
-#include "llvm/Support/Mangler.h"
-#include "llvm/Support/MathExtras.h"
-#include "llvm/Support/SlowOperationInformer.h"
-
-namespace {
- struct ForceVMCoreLinking {
- ForceVMCoreLinking() {
- // We must reference VMCore in such a way that compilers will not
- // delete it all as dead code, even with whole program optimization,
- // yet is effectively a NO-OP. As the compiler isn't smart enough
- // to know that getenv() never returns -1, this will do the job.
- if (std::getenv("bar") != (char*) -1)
- return;
- (void)new llvm::Module("");
- (void)new llvm::UnreachableInst();
- (void) llvm::createVerifierPass();
- }
- } ForceVMCoreLinking;
-}
-
-#endif
diff --git a/release_23/include/llvm/LinkTimeOptimizer.h b/release_23/include/llvm/LinkTimeOptimizer.h
deleted file mode 100644
index de48aa7f2eaa..000000000000
--- a/release_23/include/llvm/LinkTimeOptimizer.h
+++ /dev/null
@@ -1,178 +0,0 @@
-//===-- llvm/LinkTimeOptimizer.h - Public Interface ------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This header provides public interface to use LLVM link time optimization
-// library. This is intended to be used by linker to do link time optimization.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef __LTO_H__
-#define __LTO_H__
-
-#include <string>
-#include <vector>
-#include <set>
-#include <llvm/ADT/hash_map>
-#include <cstring>
-
-#define LLVM_LTO_VERSION 2
-
-namespace llvm {
-
- class Module;
- class GlobalValue;
- class TargetMachine;
-
- enum LTOStatus {
- LTO_UNKNOWN,
- LTO_OPT_SUCCESS,
- LTO_READ_SUCCESS,
- LTO_READ_FAILURE,
- LTO_WRITE_FAILURE,
- LTO_NO_TARGET,
- LTO_NO_WORK,
- LTO_MODULE_MERGE_FAILURE,
- LTO_ASM_FAILURE
- };
-
- enum LTOLinkageTypes {
- LTOExternalLinkage, // Externally visible function
- LTOLinkOnceLinkage, // Keep one copy of named function when linking (inline)
- LTOWeakLinkage, // Keep one copy of named function when linking (weak)
- LTOInternalLinkage // Rename collisions when linking (static functions)
- };
-
- enum LTOVisibilityTypes {
- LTODefaultVisibility = 0, ///< The GV is visible
- LTOHiddenVisibility, ///< The GV is hidden
- LTOProtectedVisibility ///< The GV is protected
- };
-
-
- enum LTOCodeGenModel {
- LTO_CGM_Static,
- LTO_CGM_Dynamic,
- LTO_CGM_DynamicNoPIC
- };
-
- /// This class represents LLVM symbol information without exposing details
- /// of LLVM global values. It encapsulates symbol linkage information. This
- /// is typically used in hash_map where associated name identifies the
- /// the symbol name.
- class LLVMSymbol {
-
- public:
-
- LTOLinkageTypes getLinkage() const { return linkage; }
- LTOVisibilityTypes getVisibility() const { return visibility; }
- void mayBeNotUsed();
-
- LLVMSymbol (enum LTOLinkageTypes lt, enum LTOVisibilityTypes vis,
- GlobalValue *g, const std::string &n,
- const std::string &m, int a) : linkage(lt), visibility(vis),
- gv(g), name(n),
- mangledName(m), alignment(a) {}
-
- const char *getName() { return name.c_str(); }
- const char *getMangledName() { return mangledName.c_str(); }
- int getAlignment() { return alignment; }
-
- private:
- enum LTOLinkageTypes linkage;
- enum LTOVisibilityTypes visibility;
- GlobalValue *gv;
- std::string name;
- std::string mangledName;
- int alignment;
- };
-
- class string_compare {
- public:
- bool operator()(const char* left, const char* right) const {
- return (strcmp(left, right) == 0);
- }
- };
-
- /// This is abstract class to facilitate dlopen() interface.
- /// See LTO below for more info.
- class LinkTimeOptimizer {
- public:
- typedef hash_map<const char*, LLVMSymbol*, hash<const char*>,
- string_compare> NameToSymbolMap;
- typedef hash_map<const char*, Module*, hash<const char*>,
- string_compare> NameToModuleMap;
- virtual enum LTOStatus readLLVMObjectFile(const std::string &,
- NameToSymbolMap &,
- std::set<std::string> &) = 0;
- virtual enum LTOStatus optimizeModules(const std::string &,
- std::vector<const char*> &exportList,
- std::string &targetTriple,
- bool saveTemps, const char *) = 0;
- virtual void getTargetTriple(const std::string &, std::string &) = 0;
- virtual void removeModule (const std::string &InputFilename) = 0;
- virtual void setCodeGenModel(LTOCodeGenModel CGM) = 0;
- virtual void printVersion () = 0;
- virtual ~LinkTimeOptimizer() = 0;
- };
-
- /// This is the main link time optimization class. It exposes simple API
- /// to perform link time optimization using LLVM intermodular optimizer.
- class LTO : public LinkTimeOptimizer {
-
- public:
- typedef hash_map<const char*, LLVMSymbol*, hash<const char*>,
- string_compare> NameToSymbolMap;
- typedef hash_map<const char*, Module*, hash<const char*>,
- string_compare> NameToModuleMap;
-
- enum LTOStatus readLLVMObjectFile(const std::string &InputFilename,
- NameToSymbolMap &symbols,
- std::set<std::string> &references);
- enum LTOStatus optimizeModules(const std::string &OutputFilename,
- std::vector<const char*> &exportList,
- std::string &targetTriple,
- bool saveTemps, const char *);
- void getTargetTriple(const std::string &InputFilename,
- std::string &targetTriple);
- void removeModule (const std::string &InputFilename);
- void printVersion();
-
- void setCodeGenModel(LTOCodeGenModel CGM) {
- CGModel = CGM;
- }
-
- // Constructors and destructors
- LTO() : Target(NULL), CGModel(LTO_CGM_Dynamic) {
- /// TODO: Use Target info, it is available at this time.
- }
- ~LTO();
-
- private:
- Module *getModule (const std::string &InputFilename);
- enum LTOStatus optimize(Module *, std::ostream &,
- std::vector<const char *> &);
- void getTarget(Module *);
-
- private:
- std::vector<Module *> modules;
- NameToSymbolMap allSymbols;
- NameToModuleMap allModules;
- TargetMachine *Target;
- LTOCodeGenModel CGModel;
- };
-
-} // End llvm namespace
-
-/// This provides C interface to initialize link time optimizer. This allows
-/// linker to use dlopen() interface to dynamically load LinkTimeOptimizer.
-/// extern "C" helps, because dlopen() interface uses name to find the symbol.
-extern "C"
-llvm::LinkTimeOptimizer *createLLVMOptimizer(unsigned VERSION = LLVM_LTO_VERSION);
-
-#endif
diff --git a/release_23/include/llvm/Linker.h b/release_23/include/llvm/Linker.h
deleted file mode 100644
index 1e817b467432..000000000000
--- a/release_23/include/llvm/Linker.h
+++ /dev/null
@@ -1,297 +0,0 @@
-//===- llvm/Linker.h - Module Linker Interface ------------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines the interface to the module/file/archive linker.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_LINKER_H
-#define LLVM_LINKER_H
-
-#include "llvm/System/Path.h"
-#include <vector>
-#include <memory>
-
-namespace llvm {
-
-class Module;
-
-/// This class provides the core functionality of linking in LLVM. It retains a
-/// Module object which is the composite of the modules and libraries linked
-/// into it. The composite Module can be retrieved via the getModule() method.
-/// In this case the Linker still retains ownership of the Module. If the
-/// releaseModule() method is used, the ownership of the Module is transferred
-/// to the caller and the Linker object is only suitable for destruction.
-/// The Linker can link Modules from memory, bitcode files, or bitcode
-/// archives. It retains a set of search paths in which to find any libraries
-/// presented to it. By default, the linker will generate error and warning
-/// messages to std::cerr but this capability can be turned off with the
-/// QuietWarnings and QuietErrors flags. It can also be instructed to verbosely
-/// print out the linking actions it is taking with the Verbose flag.
-/// @brief The LLVM Linker.
-class Linker {
-
- /// @name Types
- /// @{
- public:
- /// This type is used to pass the linkage items (libraries and files) to
- /// the LinkItems function. It is composed of string/bool pairs. The string
- /// provides the name of the file or library (as with the -l option). The
- /// bool should be true for libraries and false for files, signifying
- /// "isLibrary".
- /// @brief A list of linkage items
- typedef std::vector<std::pair<std::string,bool> > ItemList;
-
- /// This enumeration is used to control various optional features of the
- /// linker.
- enum ControlFlags {
- Verbose = 1, ///< Print to std::cerr what steps the linker is taking
- QuietWarnings = 2, ///< Don't print errors and warnings to std::cerr.
- QuietErrors = 4 ///< Indicate that this link is for a native executable
- };
-
- /// @}
- /// @name Constructors
- /// @{
- public:
- /// Construct the Linker with an empty module which will be given the
- /// name \p progname. \p progname will also be used for error messages.
- /// @brief Construct with empty module
- Linker(
- const std::string& progname, ///< name of tool running linker
- const std::string& modulename, ///< name of linker's end-result module
- unsigned Flags = 0 ///< ControlFlags (one or more |'d together)
- );
-
- /// Construct the Linker with a previously defined module, \p aModule. Use
- /// \p progname for the name of the program in error messages.
- /// @brief Construct with existing module
- Linker(const std::string& progname, Module* aModule, unsigned Flags = 0);
-
- /// Destruct the Linker.
- /// @brief Destructor
- ~Linker();
-
- /// @}
- /// @name Accessors
- /// @{
- public:
- /// This method gets the composite module into which linking is being
- /// done. The Composite module starts out empty and accumulates modules
- /// linked into it via the various LinkIn* methods. This method does not
- /// release the Module to the caller. The Linker retains ownership and will
- /// destruct the Module when the Linker is destructed.
- /// @see releaseModule
- /// @brief Get the linked/composite module.
- Module* getModule() const { return Composite; }
-
- /// This method releases the composite Module into which linking is being
- /// done. Ownership of the composite Module is transferred to the caller who
- /// must arrange for its destruct. After this method is called, the Linker
- /// terminates the linking session for the returned Module. It will no
- /// longer utilize the returned Module but instead resets itself for
- /// subsequent linking as if the constructor had been called. The Linker's
- /// LibPaths and flags to be reset, and memory will be released.
- /// @brief Release the linked/composite module.
- Module* releaseModule();
-
- /// This method gets the list of libraries that form the path that the
- /// Linker will search when it is presented with a library name.
- /// @brief Get the Linkers library path
- const std::vector<sys::Path>& getLibPaths() const { return LibPaths; }
-
- /// This method returns an error string suitable for printing to the user.
- /// The return value will be empty unless an error occurred in one of the
- /// LinkIn* methods. In those cases, the LinkIn* methods will have returned
- /// true, indicating an error occurred. At most one error is retained so
- /// this function always returns the last error that occurred. Note that if
- /// the Quiet control flag is not set, the error string will have already
- /// been printed to std::cerr.
- /// @brief Get the text of the last error that occurred.
- const std::string& getLastError() const { return Error; }
-
- /// @}
- /// @name Mutators
- /// @{
- public:
- /// Add a path to the list of paths that the Linker will search. The Linker
- /// accumulates the set of libraries added
- /// library paths for the target platform. The standard libraries will
- /// always be searched last. The added libraries will be searched in the
- /// order added.
- /// @brief Add a path.
- void addPath(const sys::Path& path);
-
- /// Add a set of paths to the list of paths that the linker will search. The
- /// Linker accumulates the set of libraries added. The \p paths will be
- /// added to the end of the Linker's list. Order will be retained.
- /// @brief Add a set of paths.
- void addPaths(const std::vector<std::string>& paths);
-
- /// This method augments the Linker's list of library paths with the system
- /// paths of the host operating system, include LLVM_LIB_SEARCH_PATH.
- /// @brief Add the system paths.
- void addSystemPaths();
-
- /// Control optional linker behavior by setting a group of flags. The flags
- /// are defined in the ControlFlags enumeration.
- /// @see ControlFlags
- /// @brief Set control flags.
- void setFlags(unsigned flags) { Flags = flags; }
-
- /// This method is the main interface to the linker. It can be used to
- /// link a set of linkage items into a module. A linkage item is either a
- /// file name with fully qualified path, or a library for which the Linker's
- /// LibraryPath will be utilized to locate the library. The bool value in
- /// the LinkItemKind should be set to true for libraries. This function
- /// allows linking to preserve the order of specification associated with
- /// the command line, or for other purposes. Each item will be linked in
- /// turn as it occurs in \p Items.
- /// @returns true if an error occurred, false otherwise
- /// @see LinkItemKind
- /// @see getLastError
- /// @throws nothing
- bool LinkInItems (
- const ItemList& Items, ///< Set of libraries/files to link in
- ItemList& NativeItems ///< Output list of native files/libs
- );
-
- /// This function links the bitcode \p Files into the composite module.
- /// Note that this does not do any linking of unresolved symbols. The \p
- /// Files are all completely linked into \p HeadModule regardless of
- /// unresolved symbols. This function just loads each bitcode file and
- /// calls LinkInModule on them.
- /// @returns true if an error occurs, false otherwise
- /// @see getLastError
- /// @brief Link in multiple files.
- bool LinkInFiles (
- const std::vector<sys::Path> & Files ///< Files to link in
- );
-
- /// This function links a single bitcode file, \p File, into the composite
- /// module. Note that this does not attempt to resolve symbols. This method
- /// just loads the bitcode file and calls LinkInModule on it. If an error
- /// occurs, the Linker's error string is set.
- /// @returns true if an error occurs, false otherwise
- /// @see getLastError
- /// @brief Link in a single file.
- bool LinkInFile(
- const sys::Path& File, ///< File to link in.
- bool &is_native ///< Indicates if the file is native object file
- );
-
- /// This function provides a way to selectively link in a set of modules,
- /// found in libraries, based on the unresolved symbols in the composite
- /// module. Each item in \p Libraries should be the base name of a library,
- /// as if given with the -l option of a linker tool. The Linker's LibPaths
- /// are searched for the \p Libraries and any found will be linked in with
- /// LinkInArchive. If an error occurs, the Linker's error string is set.
- /// @see LinkInArchive
- /// @see getLastError
- /// @returns true if an error occurs, false otherwise
- /// @brief Link libraries into the module
- bool LinkInLibraries (
- const std::vector<std::string> & Libraries ///< Libraries to link in
- );
-
- /// This function provides a way to selectively link in a set of modules,
- /// found in one library, based on the unresolved symbols in the composite
- /// module.The \p Library should be the base name of a library, as if given
- /// with the -l option of a linker tool. The Linker's LibPaths are searched
- /// for the \p Library and if found, it will be linked in with via the
- /// LinkInArchive method. If an error occurs, the Linker's error string is
- /// set.
- /// @see LinkInArchive
- /// @see getLastError
- /// @returns true if an error occurs, false otherwise
- /// @brief Link one library into the module
- bool LinkInLibrary (
- const std::string& Library, ///< The library to link in
- bool& is_native ///< Indicates if lib a native library
- );
-
- /// This function links one bitcode archive, \p Filename, into the module.
- /// The archive is searched to resolve outstanding symbols. Any modules in
- /// the archive that resolve outstanding symbols will be linked in. The
- /// library is searched repeatedly until no more modules that resolve
- /// symbols can be found. If an error occurs, the error string is set.
- /// To speed up this function, ensure the the archive has been processed
- /// llvm-ranlib or the S option was given to llvm-ar when the archive was
- /// created. These tools add a symbol table to the archive which makes the
- /// search for undefined symbols much faster.
- /// @see getLastError
- /// @returns true if an error occurs, otherwise false.
- /// @brief Link in one archive.
- bool LinkInArchive(
- const sys::Path& Filename, ///< Filename of the archive to link
- bool& is_native ///< Indicates if archive is a native archive
- );
-
- /// This method links the \p Src module into the Linker's Composite module
- /// by calling LinkModules. All the other LinkIn* methods eventually
- /// result in calling this method to link a Module into the Linker's
- /// composite.
- /// @see LinkModules
- /// @returns True if an error occurs, false otherwise.
- /// @brief Link in a module.
- bool LinkInModule(
- Module* Src, ///< Module linked into \p Dest
- std::string* ErrorMsg = 0 /// Error/diagnostic string
- ) {
- return LinkModules(Composite, Src, ErrorMsg );
- }
-
- /// This is the heart of the linker. This method will take unconditional
- /// control of the \p Src module and link it into the \p Dest module. The
- /// \p Src module will be destructed or subsumed by this method. In either
- /// case it is not usable by the caller after this method is invoked. Only
- /// the \p Dest module will remain. The \p Src module is linked into the
- /// Linker's composite module such that types, global variables, functions,
- /// and etc. are matched and resolved. If an error occurs, this function
- /// returns true and ErrorMsg is set to a descriptive message about the
- /// error.
- /// @returns True if an error occurs, false otherwise.
- /// @brief Generically link two modules together.
- static bool LinkModules(Module* Dest, Module* Src, std::string* ErrorMsg);
-
- /// This function looks through the Linker's LibPaths to find a library with
- /// the name \p Filename. If the library cannot be found, the returned path
- /// will be empty (i.e. sys::Path::isEmpty() will return true).
- /// @returns A sys::Path to the found library
- /// @brief Find a library from its short name.
- sys::Path FindLib(const std::string &Filename);
-
- /// @}
- /// @name Implementation
- /// @{
- private:
- /// Read in and parse the bitcode file named by FN and return the
- /// Module it contains (wrapped in an auto_ptr), or 0 if an error occurs.
- std::auto_ptr<Module> LoadObject(const sys::Path& FN);
-
- bool warning(const std::string& message);
- bool error(const std::string& message);
- void verbose(const std::string& message);
-
- /// @}
- /// @name Data
- /// @{
- private:
- Module* Composite; ///< The composite module linked together
- std::vector<sys::Path> LibPaths; ///< The library search paths
- unsigned Flags; ///< Flags to control optional behavior.
- std::string Error; ///< Text of error that occurred.
- std::string ProgramName; ///< Name of the program being linked
- /// @}
-
-};
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/Module.h b/release_23/include/llvm/Module.h
deleted file mode 100644
index bce671ddb296..000000000000
--- a/release_23/include/llvm/Module.h
+++ /dev/null
@@ -1,423 +0,0 @@
-//===-- llvm/Module.h - C++ class to represent a VM module ------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-/// @file This file contains the declarations for the Module class.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_MODULE_H
-#define LLVM_MODULE_H
-
-#include "llvm/Function.h"
-#include "llvm/GlobalVariable.h"
-#include "llvm/GlobalAlias.h"
-#include "llvm/Support/DataTypes.h"
-#include <vector>
-
-namespace llvm {
-
-class GlobalValueRefMap; // Used by ConstantVals.cpp
-class FunctionType;
-
-template<> struct ilist_traits<Function>
- : public SymbolTableListTraits<Function, Module> {
- // createSentinel is used to create a node that marks the end of the list.
- static Function *createSentinel();
- static void destroySentinel(Function *F) { delete F; }
- static iplist<Function> &getList(Module *M);
- static inline ValueSymbolTable *getSymTab(Module *M);
- static int getListOffset();
-};
-template<> struct ilist_traits<GlobalVariable>
- : public SymbolTableListTraits<GlobalVariable, Module> {
- // createSentinel is used to create a node that marks the end of the list.
- static GlobalVariable *createSentinel();
- static void destroySentinel(GlobalVariable *GV) { delete GV; }
- static iplist<GlobalVariable> &getList(Module *M);
- static inline ValueSymbolTable *getSymTab(Module *M);
- static int getListOffset();
-};
-template<> struct ilist_traits<GlobalAlias>
- : public SymbolTableListTraits<GlobalAlias, Module> {
- // createSentinel is used to create a node that marks the end of the list.
- static GlobalAlias *createSentinel();
- static void destroySentinel(GlobalAlias *GA) { delete GA; }
- static iplist<GlobalAlias> &getList(Module *M);
- static inline ValueSymbolTable *getSymTab(Module *M);
- static int getListOffset();
-};
-
-/// A Module instance is used to store all the information related to an
-/// LLVM module. Modules are the top level container of all other LLVM
-/// Intermediate Representation (IR) objects. Each module directly contains a
-/// list of globals variables, a list of functions, a list of libraries (or
-/// other modules) this module depends on, a symbol table, and various data
-/// about the target's characteristics.
-///
-/// A module maintains a GlobalValRefMap object that is used to hold all
-/// constant references to global variables in the module. When a global
-/// variable is destroyed, it should have no entries in the GlobalValueRefMap.
-/// @brief The main container class for the LLVM Intermediate Representation.
-class Module {
-/// @name Types And Enumerations
-/// @{
-public:
- /// The type for the list of global variables.
- typedef iplist<GlobalVariable> GlobalListType;
- /// The type for the list of functions.
- typedef iplist<Function> FunctionListType;
- /// The type for the list of aliases.
- typedef iplist<GlobalAlias> AliasListType;
-
- /// The type for the list of dependent libraries.
- typedef std::vector<std::string> LibraryListType;
-
- /// The Global Variable iterator.
- typedef GlobalListType::iterator global_iterator;
- /// The Global Variable constant iterator.
- typedef GlobalListType::const_iterator const_global_iterator;
-
- /// The Function iterators.
- typedef FunctionListType::iterator iterator;
- /// The Function constant iterator
- typedef FunctionListType::const_iterator const_iterator;
-
- /// The Global Alias iterators.
- typedef AliasListType::iterator alias_iterator;
- /// The Global Alias constant iterator
- typedef AliasListType::const_iterator const_alias_iterator;
-
- /// The Library list iterator.
- typedef LibraryListType::const_iterator lib_iterator;
-
- /// An enumeration for describing the endianess of the target machine.
- enum Endianness { AnyEndianness, LittleEndian, BigEndian };
-
- /// An enumeration for describing the size of a pointer on the target machine.
- enum PointerSize { AnyPointerSize, Pointer32, Pointer64 };
-
-/// @}
-/// @name Member Variables
-/// @{
-private:
- GlobalListType GlobalList; ///< The Global Variables in the module
- FunctionListType FunctionList; ///< The Functions in the module
- AliasListType AliasList; ///< The Aliases in the module
- LibraryListType LibraryList; ///< The Libraries needed by the module
- std::string GlobalScopeAsm; ///< Inline Asm at global scope.
- ValueSymbolTable *ValSymTab; ///< Symbol table for values
- TypeSymbolTable *TypeSymTab; ///< Symbol table for types
- std::string ModuleID; ///< Human readable identifier for the module
- std::string TargetTriple; ///< Platform target triple Module compiled on
- std::string DataLayout; ///< Target data description
-
- friend class Constant;
-
-/// @}
-/// @name Constructors
-/// @{
-public:
- /// The Module constructor. Note that there is no default constructor. You
- /// must provide a name for the module upon construction.
- explicit Module(const std::string &ModuleID);
- /// The module destructor. This will dropAllReferences.
- ~Module();
-
-/// @}
-/// @name Module Level Accessors
-/// @{
-public:
- /// Get the module identifier which is, essentially, the name of the module.
- /// @returns the module identifier as a string
- const std::string &getModuleIdentifier() const { return ModuleID; }
-
- /// Get the data layout string for the module's target platform. This encodes
- /// the type sizes and alignments expected by this module.
- /// @returns the data layout as a string
- const std::string& getDataLayout() const { return DataLayout; }
-
- /// Get the target triple which is a string describing the target host.
- /// @returns a string containing the target triple.
- const std::string &getTargetTriple() const { return TargetTriple; }
-
- /// Get the target endian information.
- /// @returns Endianess - an enumeration for the endianess of the target
- Endianness getEndianness() const;
-
- /// Get the target pointer size.
- /// @returns PointerSize - an enumeration for the size of the target's pointer
- PointerSize getPointerSize() const;
-
- /// Get any module-scope inline assembly blocks.
- /// @returns a string containing the module-scope inline assembly blocks.
- const std::string &getModuleInlineAsm() const { return GlobalScopeAsm; }
-/// @}
-/// @name Module Level Mutators
-/// @{
-public:
-
- /// Set the module identifier.
- void setModuleIdentifier(const std::string &ID) { ModuleID = ID; }
-
- /// Set the data layout
- void setDataLayout(const std::string& DL) { DataLayout = DL; }
-
- /// Set the target triple.
- void setTargetTriple(const std::string &T) { TargetTriple = T; }
-
- /// Set the module-scope inline assembly blocks.
- void setModuleInlineAsm(const std::string &Asm) { GlobalScopeAsm = Asm; }
-
- /// Append to the module-scope inline assembly blocks, automatically
- /// appending a newline to the end.
- void appendModuleInlineAsm(const std::string &Asm) {
- GlobalScopeAsm += Asm;
- GlobalScopeAsm += '\n';
- }
-
-/// @}
-/// @name Function Accessors
-/// @{
-public:
- /// getOrInsertFunction - Look up the specified function in the module symbol
- /// table. Four possibilities:
- /// 1. If it does not exist, add a prototype for the function and return it.
- /// 2. If it exists, and has internal linkage, the existing function is
- /// renamed and a new one is inserted.
- /// 3. Otherwise, if the existing function has the correct prototype, return
- /// the existing function.
- /// 4. Finally, the function exists but has the wrong prototype: return the
- /// function with a constantexpr cast to the right prototype.
- Constant *getOrInsertFunction(const std::string &Name, const FunctionType *T);
-
- /// getOrInsertFunction - Look up the specified function in the module symbol
- /// table. If it does not exist, add a prototype for the function and return
- /// it. This function guarantees to return a constant of pointer to the
- /// specified function type or a ConstantExpr BitCast of that type if the
- /// named function has a different type. This version of the method takes a
- /// null terminated list of function arguments, which makes it easier for
- /// clients to use.
- Constant *getOrInsertFunction(const std::string &Name, const Type *RetTy,...)
- END_WITH_NULL;
-
- /// getFunction - Look up the specified function in the module symbol table.
- /// If it does not exist, return null.
- Function *getFunction(const std::string &Name) const;
-
-/// @}
-/// @name Global Variable Accessors
-/// @{
-public:
- /// getGlobalVariable - Look up the specified global variable in the module
- /// symbol table. If it does not exist, return null. If AllowInternal is set
- /// to true, this function will return types that have InternalLinkage. By
- /// default, these types are not returned.
- GlobalVariable *getGlobalVariable(const std::string &Name,
- bool AllowInternal = false) const;
-
- /// getNamedGlobal - Return the first global variable in the module with the
- /// specified name, of arbitrary type. This method returns null if a global
- /// with the specified name is not found.
- GlobalVariable *getNamedGlobal(const std::string &Name) const {
- return getGlobalVariable(Name, true);
- }
-
-/// @}
-/// @name Global Alias Accessors
-/// @{
-public:
- /// getNamedAlias - Return the first global alias in the module with the
- /// specified name, of arbitrary type. This method returns null if a global
- /// with the specified name is not found.
- GlobalAlias *getNamedAlias(const std::string &Name) const;
-
-/// @}
-/// @name Type Accessors
-/// @{
-public:
- /// addTypeName - Insert an entry in the symbol table mapping Str to Type. If
- /// there is already an entry for this name, true is returned and the symbol
- /// table is not modified.
- bool addTypeName(const std::string &Name, const Type *Ty);
-
- /// getTypeName - If there is at least one entry in the symbol table for the
- /// specified type, return it.
- std::string getTypeName(const Type *Ty) const;
-
- /// getTypeByName - Return the type with the specified name in this module, or
- /// null if there is none by that name.
- const Type *getTypeByName(const std::string &Name) const;
-
-/// @}
-/// @name Direct access to the globals list, functions list, and symbol table
-/// @{
-public:
- /// Get the Module's list of global variables (constant).
- const GlobalListType &getGlobalList() const { return GlobalList; }
- /// Get the Module's list of global variables.
- GlobalListType &getGlobalList() { return GlobalList; }
- /// Get the Module's list of functions (constant).
- const FunctionListType &getFunctionList() const { return FunctionList; }
- /// Get the Module's list of functions.
- FunctionListType &getFunctionList() { return FunctionList; }
- /// Get the Module's list of aliases (constant).
- const AliasListType &getAliasList() const { return AliasList; }
- /// Get the Module's list of aliases.
- AliasListType &getAliasList() { return AliasList; }
- /// Get the symbol table of global variable and function identifiers
- const ValueSymbolTable &getValueSymbolTable() const { return *ValSymTab; }
- /// Get the Module's symbol table of global variable and function identifiers.
- ValueSymbolTable &getValueSymbolTable() { return *ValSymTab; }
- /// Get the symbol table of types
- const TypeSymbolTable &getTypeSymbolTable() const { return *TypeSymTab; }
- /// Get the Module's symbol table of types
- TypeSymbolTable &getTypeSymbolTable() { return *TypeSymTab; }
-
-/// @}
-/// @name Global Variable Iteration
-/// @{
-public:
- /// Get an iterator to the first global variable
- global_iterator global_begin() { return GlobalList.begin(); }
- /// Get a constant iterator to the first global variable
- const_global_iterator global_begin() const { return GlobalList.begin(); }
- /// Get an iterator to the last global variable
- global_iterator global_end () { return GlobalList.end(); }
- /// Get a constant iterator to the last global variable
- const_global_iterator global_end () const { return GlobalList.end(); }
- /// Determine if the list of globals is empty.
- bool global_empty() const { return GlobalList.empty(); }
-
-/// @}
-/// @name Function Iteration
-/// @{
-public:
- /// Get an iterator to the first function.
- iterator begin() { return FunctionList.begin(); }
- /// Get a constant iterator to the first function.
- const_iterator begin() const { return FunctionList.begin(); }
- /// Get an iterator to the last function.
- iterator end () { return FunctionList.end(); }
- /// Get a constant iterator to the last function.
- const_iterator end () const { return FunctionList.end(); }
- /// Determine how many functions are in the Module's list of functions.
- size_t size() const { return FunctionList.size(); }
- /// Determine if the list of functions is empty.
- bool empty() const { return FunctionList.empty(); }
-
-/// @}
-/// @name Dependent Library Iteration
-/// @{
-public:
- /// @brief Get a constant iterator to beginning of dependent library list.
- inline lib_iterator lib_begin() const { return LibraryList.begin(); }
- /// @brief Get a constant iterator to end of dependent library list.
- inline lib_iterator lib_end() const { return LibraryList.end(); }
- /// @brief Returns the number of items in the list of libraries.
- inline size_t lib_size() const { return LibraryList.size(); }
- /// @brief Add a library to the list of dependent libraries
- void addLibrary(const std::string& Lib);
- /// @brief Remove a library from the list of dependent libraries
- void removeLibrary(const std::string& Lib);
- /// @brief Get all the libraries
- inline const LibraryListType& getLibraries() const { return LibraryList; }
-
-/// @}
-/// @name Alias Iteration
-/// @{
-public:
- /// Get an iterator to the first alias.
- alias_iterator alias_begin() { return AliasList.begin(); }
- /// Get a constant iterator to the first alias.
- const_alias_iterator alias_begin() const { return AliasList.begin(); }
- /// Get an iterator to the last alias.
- alias_iterator alias_end () { return AliasList.end(); }
- /// Get a constant iterator to the last alias.
- const_alias_iterator alias_end () const { return AliasList.end(); }
- /// Determine how many functions are in the Module's list of aliases.
- size_t alias_size () const { return AliasList.size(); }
- /// Determine if the list of aliases is empty.
- bool alias_empty() const { return AliasList.empty(); }
-
-/// @}
-/// @name Utility functions for printing and dumping Module objects
-/// @{
-public:
- /// Print the module to an output stream
- void print(std::ostream &OS) const { print(OS, 0); }
- void print(std::ostream *OS) const { if (OS) print(*OS); }
- /// Print the module to an output stream with AssemblyAnnotationWriter.
- void print(std::ostream &OS, AssemblyAnnotationWriter *AAW) const;
- void print(std::ostream *OS, AssemblyAnnotationWriter *AAW) const {
- if (OS) print(*OS, AAW);
- }
- /// Dump the module to std::cerr (for debugging).
- void dump() const;
- /// This function causes all the subinstructions to "let go" of all references
- /// that they are maintaining. This allows one to 'delete' a whole class at
- /// a time, even though there may be circular references... first all
- /// references are dropped, and all use counts go to zero. Then everything
- /// is delete'd for real. Note that no operations are valid on an object
- /// that has "dropped all references", except operator delete.
- void dropAllReferences();
-/// @}
-
- static unsigned getFunctionListOffset() {
- Module *Obj = 0;
- return unsigned(reinterpret_cast<uintptr_t>(&Obj->FunctionList));
- }
- static unsigned getGlobalVariableListOffset() {
- Module *Obj = 0;
- return unsigned(reinterpret_cast<uintptr_t>(&Obj->GlobalList));
- }
- static unsigned getAliasListOffset() {
- Module *Obj = 0;
- return unsigned(reinterpret_cast<uintptr_t>(&Obj->AliasList));
- }
-};
-
-/// An iostream inserter for modules.
-inline std::ostream &operator<<(std::ostream &O, const Module &M) {
- M.print(O);
- return O;
-}
-
-inline ValueSymbolTable *
-ilist_traits<Function>::getSymTab(Module *M) {
- return M ? &M->getValueSymbolTable() : 0;
-}
-
-inline ValueSymbolTable *
-ilist_traits<GlobalVariable>::getSymTab(Module *M) {
- return M ? &M->getValueSymbolTable() : 0;
-}
-
-inline ValueSymbolTable *
-ilist_traits<GlobalAlias>::getSymTab(Module *M) {
- return M ? &M->getValueSymbolTable() : 0;
-}
-
-inline int
-ilist_traits<Function>::getListOffset() {
- return Module::getFunctionListOffset();
-}
-
-inline int
-ilist_traits<GlobalVariable>::getListOffset() {
- return Module::getGlobalVariableListOffset();
-}
-
-inline int
-ilist_traits<GlobalAlias>::getListOffset() {
- return Module::getAliasListOffset();
-}
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/ModuleProvider.h b/release_23/include/llvm/ModuleProvider.h
deleted file mode 100644
index 65bcc763f1c6..000000000000
--- a/release_23/include/llvm/ModuleProvider.h
+++ /dev/null
@@ -1,88 +0,0 @@
-//===-- llvm/ModuleProvider.h - Interface for module providers --*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file provides an abstract interface for loading a module from some
-// place. This interface allows incremental or random access loading of
-// functions from the file. This is useful for applications like JIT compilers
-// or interprocedural optimizers that do not need the entire program in memory
-// at the same time.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef MODULEPROVIDER_H
-#define MODULEPROVIDER_H
-
-#include <string>
-
-namespace llvm {
-
-class Function;
-class Module;
-
-class ModuleProvider {
-protected:
- Module *TheModule;
- ModuleProvider();
-
-public:
- virtual ~ModuleProvider();
-
- /// getModule - returns the module this provider is encapsulating.
- ///
- Module* getModule() { return TheModule; }
-
- /// materializeFunction - make sure the given function is fully read. If the
- /// module is corrupt, this returns true and fills in the optional string
- /// with information about the problem. If successful, this returns false.
- ///
- virtual bool materializeFunction(Function *F, std::string *ErrInfo = 0) = 0;
-
- /// dematerializeFunction - If the given function is read in, and if the
- /// module provider supports it, release the memory for the function, and set
- /// it up to be materialized lazily. If the provider doesn't support this
- /// capability, this method is a noop.
- ///
- virtual void dematerializeFunction(Function *F) {}
-
- /// materializeModule - make sure the entire Module has been completely read.
- /// On error, return null and fill in the error string if specified.
- ///
- virtual Module* materializeModule(std::string *ErrInfo = 0) = 0;
-
- /// releaseModule - no longer delete the Module* when provider is destroyed.
- /// On error, return null and fill in the error string if specified.
- ///
- virtual Module* releaseModule(std::string *ErrInfo = 0) {
- // Since we're losing control of this Module, we must hand it back complete
- if (!materializeModule(ErrInfo))
- return 0;
- Module *tempM = TheModule;
- TheModule = 0;
- return tempM;
- }
-};
-
-
-/// ExistingModuleProvider - Allow conversion from a fully materialized Module
-/// into a ModuleProvider, allowing code that expects a ModuleProvider to work
-/// if we just have a Module. Note that the ModuleProvider takes ownership of
-/// the Module specified.
-struct ExistingModuleProvider : public ModuleProvider {
- explicit ExistingModuleProvider(Module *M) {
- TheModule = M;
- }
- bool materializeFunction(Function *F, std::string *ErrInfo = 0) {
- return false;
- }
- Module* materializeModule(std::string *ErrInfo = 0) { return TheModule; }
-};
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/ParameterAttributes.h b/release_23/include/llvm/ParameterAttributes.h
deleted file mode 100644
index 22833629f06e..000000000000
--- a/release_23/include/llvm/ParameterAttributes.h
+++ /dev/null
@@ -1,205 +0,0 @@
-//===-- llvm/ParameterAttributes.h - Container for ParamAttrs ---*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains the simple types necessary to represent the parameter
-// attributes associated with functions and their calls.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_PARAMETER_ATTRIBUTES_H
-#define LLVM_PARAMETER_ATTRIBUTES_H
-
-#include <string>
-
-namespace llvm {
-class Type;
-
-/// ParameterAttributes - A bitset of attributes for a parameter.
-typedef unsigned ParameterAttributes;
-
-namespace ParamAttr {
-
-/// Function parameters and results can have attributes to indicate how they
-/// should be treated by optimizations and code generation. This enumeration
-/// lists the attributes that can be associated with parameters or function
-/// results.
-/// @brief Function parameter attributes.
-typedef ParameterAttributes Attributes;
-
-const Attributes None = 0; ///< No attributes have been set
-const Attributes ZExt = 1<<0; ///< Zero extended before/after call
-const Attributes SExt = 1<<1; ///< Sign extended before/after call
-const Attributes NoReturn = 1<<2; ///< Mark the function as not returning
-const Attributes InReg = 1<<3; ///< Force argument to be passed in register
-const Attributes StructRet = 1<<4; ///< Hidden pointer to structure to return
-const Attributes NoUnwind = 1<<5; ///< Function doesn't unwind stack
-const Attributes NoAlias = 1<<6; ///< Considered to not alias after call
-const Attributes ByVal = 1<<7; ///< Pass structure by value
-const Attributes Nest = 1<<8; ///< Nested function static chain
-const Attributes ReadNone = 1<<9; ///< Function does not access memory
-const Attributes ReadOnly = 1<<10; ///< Function only reads from memory
-const Attributes Alignment = 0xffff<<16; ///< Alignment of parameter (16 bits)
- // 0 = unknown, else in clear (not log)
-
-/// @brief Attributes that only apply to function parameters.
-const Attributes ParameterOnly = ByVal | InReg | Nest | StructRet;
-
-/// @brief Attributes that only apply to function return values.
-const Attributes ReturnOnly = NoReturn | NoUnwind | ReadNone | ReadOnly;
-
-/// @brief Parameter attributes that do not apply to vararg call arguments.
-const Attributes VarArgsIncompatible = StructRet;
-
-/// @brief Attributes that are mutually incompatible.
-const Attributes MutuallyIncompatible[3] = {
- ByVal | InReg | Nest | StructRet,
- ZExt | SExt,
- ReadNone | ReadOnly
-};
-
-/// @brief Which attributes cannot be applied to a type.
-Attributes typeIncompatible(const Type *Ty);
-
-/// This turns an int alignment (a power of 2, normally) into the
-/// form used internally in ParameterAttributes.
-ParamAttr::Attributes inline constructAlignmentFromInt(unsigned i) {
- return (i << 16);
-}
-
-/// The set of ParameterAttributes set in Attributes is converted to a
-/// string of equivalent mnemonics. This is, presumably, for writing out
-/// the mnemonics for the assembly writer.
-/// @brief Convert parameter attribute bits to text
-std::string getAsString(ParameterAttributes Attrs);
-} // end namespace ParamAttr
-
-
-/// This is just a pair of values to associate a set of parameter attributes
-/// with a parameter index.
-struct ParamAttrsWithIndex {
- ParameterAttributes Attrs; ///< The attributes that are set, or'd together.
- unsigned Index; ///< Index of the parameter for which the attributes apply.
-
- static ParamAttrsWithIndex get(unsigned Idx, ParameterAttributes Attrs) {
- ParamAttrsWithIndex P;
- P.Index = Idx;
- P.Attrs = Attrs;
- return P;
- }
-};
-
-//===----------------------------------------------------------------------===//
-// PAListPtr Smart Pointer
-//===----------------------------------------------------------------------===//
-
-class ParamAttributeListImpl;
-
-/// PAListPtr - This class manages the ref count for the opaque
-/// ParamAttributeListImpl object and provides accessors for it.
-class PAListPtr {
- /// PAList - The parameter attributes that we are managing. This can be null
- /// to represent the empty parameter attributes list.
- ParamAttributeListImpl *PAList;
-public:
- PAListPtr() : PAList(0) {}
- PAListPtr(const PAListPtr &P);
- const PAListPtr &operator=(const PAListPtr &RHS);
- ~PAListPtr();
-
- //===--------------------------------------------------------------------===//
- // Parameter Attribute List Construction and Mutation
- //===--------------------------------------------------------------------===//
-
- /// get - Return a ParamAttrs list with the specified parameter in it.
- static PAListPtr get(const ParamAttrsWithIndex *Attr, unsigned NumAttrs);
-
- /// get - Return a ParamAttr list with the parameters specified by the
- /// consecutive random access iterator range.
- template <typename Iter>
- static PAListPtr get(const Iter &I, const Iter &E) {
- if (I == E) return PAListPtr(); // Empty list.
- return get(&*I, static_cast<unsigned>(E-I));
- }
-
- /// addAttr - Add the specified attribute at the specified index to this
- /// attribute list. Since parameter attribute lists are immutable, this
- /// returns the new list.
- PAListPtr addAttr(unsigned Idx, ParameterAttributes Attrs) const;
-
- /// removeAttr - Remove the specified attribute at the specified index from
- /// this attribute list. Since parameter attribute lists are immutable, this
- /// returns the new list.
- PAListPtr removeAttr(unsigned Idx, ParameterAttributes Attrs) const;
-
- //===--------------------------------------------------------------------===//
- // Parameter Attribute List Accessors
- //===--------------------------------------------------------------------===//
-
- /// getParamAttrs - The parameter attributes for the specified parameter are
- /// returned. Parameters for the result are denoted with Idx = 0.
- ParameterAttributes getParamAttrs(unsigned Idx) const;
-
- /// paramHasAttr - Return true if the specified parameter index has the
- /// specified attribute set.
- bool paramHasAttr(unsigned Idx, ParameterAttributes Attr) const {
- return getParamAttrs(Idx) & Attr;
- }
-
- /// getParamAlignment - Return the alignment for the specified function
- /// parameter.
- unsigned getParamAlignment(unsigned Idx) const {
- return (getParamAttrs(Idx) & ParamAttr::Alignment) >> 16;
- }
-
- /// hasAttrSomewhere - Return true if the specified attribute is set for at
- /// least one parameter or for the return value.
- bool hasAttrSomewhere(ParameterAttributes Attr) const;
-
- /// operator==/!= - Provide equality predicates.
- bool operator==(const PAListPtr &RHS) const { return PAList == RHS.PAList; }
- bool operator!=(const PAListPtr &RHS) const { return PAList != RHS.PAList; }
-
- void dump() const;
-
- //===--------------------------------------------------------------------===//
- // Parameter Attribute List Introspection
- //===--------------------------------------------------------------------===//
-
- /// getRawPointer - Return a raw pointer that uniquely identifies this
- /// parameter attribute list.
- void *getRawPointer() const {
- return PAList;
- }
-
- // Parameter attributes are stored as a dense set of slots, where there is one
- // slot for each argument that has an attribute. This allows walking over the
- // dense set instead of walking the sparse list of attributes.
-
- /// isEmpty - Return true if no parameters have an attribute.
- ///
- bool isEmpty() const {
- return PAList == 0;
- }
-
- /// getNumSlots - Return the number of slots used in this attribute list.
- /// This is the number of arguments that have an attribute set on them
- /// (including the function itself).
- unsigned getNumSlots() const;
-
- /// getSlot - Return the ParamAttrsWithIndex at the specified slot. This
- /// holds a parameter number plus a set of attributes.
- const ParamAttrsWithIndex &getSlot(unsigned Slot) const;
-
-private:
- explicit PAListPtr(ParamAttributeListImpl *L);
-};
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/Pass.h b/release_23/include/llvm/Pass.h
deleted file mode 100644
index 06a86f1858b4..000000000000
--- a/release_23/include/llvm/Pass.h
+++ /dev/null
@@ -1,383 +0,0 @@
-//===- llvm/Pass.h - Base class for Passes ----------------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines a base class that indicates that a specified class is a
-// transformation pass implementation.
-//
-// Passes are designed this way so that it is possible to run passes in a cache
-// and organizationally optimal order without having to specify it at the front
-// end. This allows arbitrary passes to be strung together and have them
-// executed as effeciently as possible.
-//
-// Passes should extend one of the classes below, depending on the guarantees
-// that it can make about what will be modified as it is run. For example, most
-// global optimizations should derive from FunctionPass, because they do not add
-// or delete functions, they operate on the internals of the function.
-//
-// Note that this file #includes PassSupport.h and PassAnalysisSupport.h (at the
-// bottom), so the APIs exposed by these files are also automatically available
-// to all users of this file.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_PASS_H
-#define LLVM_PASS_H
-
-#include "llvm/Support/DataTypes.h"
-#include "llvm/Support/Streams.h"
-#include <vector>
-#include <utility>
-#include <iosfwd>
-#include <cassert>
-
-namespace llvm {
-
-class Value;
-class BasicBlock;
-class Function;
-class Module;
-class AnalysisUsage;
-class PassInfo;
-class ImmutablePass;
-class PMStack;
-class AnalysisResolver;
-class PMDataManager;
-
-// AnalysisID - Use the PassInfo to identify a pass...
-typedef const PassInfo* AnalysisID;
-
-/// Different types of internal pass managers. External pass managers
-/// (PassManager and FunctionPassManager) are not represented here.
-/// Ordering of pass manager types is important here.
-enum PassManagerType {
- PMT_Unknown = 0,
- PMT_ModulePassManager = 1, /// MPPassManager
- PMT_CallGraphPassManager, /// CGPassManager
- PMT_FunctionPassManager, /// FPPassManager
- PMT_LoopPassManager, /// LPPassManager
- PMT_BasicBlockPassManager, /// BBPassManager
- PMT_Last
-};
-
-//===----------------------------------------------------------------------===//
-/// Pass interface - Implemented by all 'passes'. Subclass this if you are an
-/// interprocedural optimization or you do not fit into any of the more
-/// constrained passes described below.
-///
-class Pass {
- AnalysisResolver *Resolver; // Used to resolve analysis
- intptr_t PassID;
- // AnalysisImpls - This keeps track of which passes implement the interfaces
- // that are required by the current pass (to implement getAnalysis()).
- //
- std::vector<std::pair<const PassInfo*, Pass*> > AnalysisImpls;
-
- void operator=(const Pass&); // DO NOT IMPLEMENT
- Pass(const Pass &); // DO NOT IMPLEMENT
-public:
- explicit Pass(intptr_t pid) : Resolver(0), PassID(pid) {}
- explicit Pass(const void *pid) : Resolver(0),
- PassID((intptr_t)pid) {}
- virtual ~Pass();
-
- /// getPassName - Return a nice clean name for a pass. This usually
- /// implemented in terms of the name that is registered by one of the
- /// Registration templates, but can be overloaded directly.
- ///
- virtual const char *getPassName() const;
-
- /// getPassInfo - Return the PassInfo data structure that corresponds to this
- /// pass... If the pass has not been registered, this will return null.
- ///
- const PassInfo *getPassInfo() const;
-
- /// print - Print out the internal state of the pass. This is called by
- /// Analyze to print out the contents of an analysis. Otherwise it is not
- /// necessary to implement this method. Beware that the module pointer MAY be
- /// null. This automatically forwards to a virtual function that does not
- /// provide the Module* in case the analysis doesn't need it it can just be
- /// ignored.
- ///
- virtual void print(std::ostream &O, const Module *M) const;
- void print(std::ostream *O, const Module *M) const { if (O) print(*O, M); }
- void dump() const; // dump - call print(std::cerr, 0);
-
- /// Each pass is responsible for assigning a pass manager to itself.
- /// PMS is the stack of available pass manager.
- virtual void assignPassManager(PMStack &PMS,
- PassManagerType T = PMT_Unknown) {}
- /// Check if available pass managers are suitable for this pass or not.
- virtual void preparePassManager(PMStack &PMS) {}
-
- /// Return what kind of Pass Manager can manage this pass.
- virtual PassManagerType getPotentialPassManagerType() const {
- return PMT_Unknown;
- }
-
- // Access AnalysisResolver
- inline void setResolver(AnalysisResolver *AR) {
- assert (!Resolver && "Resolver is already set");
- Resolver = AR;
- }
- inline AnalysisResolver *getResolver() {
- assert (Resolver && "Resolver is not set");
- return Resolver;
- }
-
- /// getAnalysisUsage - This function should be overriden by passes that need
- /// analysis information to do their job. If a pass specifies that it uses a
- /// particular analysis result to this function, it can then use the
- /// getAnalysis<AnalysisType>() function, below.
- ///
- virtual void getAnalysisUsage(AnalysisUsage &Info) const {
- // By default, no analysis results are used, all are invalidated.
- }
-
- /// releaseMemory() - This member can be implemented by a pass if it wants to
- /// be able to release its memory when it is no longer needed. The default
- /// behavior of passes is to hold onto memory for the entire duration of their
- /// lifetime (which is the entire compile time). For pipelined passes, this
- /// is not a big deal because that memory gets recycled every time the pass is
- /// invoked on another program unit. For IP passes, it is more important to
- /// free memory when it is unused.
- ///
- /// Optionally implement this function to release pass memory when it is no
- /// longer used.
- ///
- virtual void releaseMemory() {}
-
- /// verifyAnalysis() - This member can be implemented by a analysis pass to
- /// check state of analysis information.
- virtual void verifyAnalysis() const {}
-
- // dumpPassStructure - Implement the -debug-passes=PassStructure option
- virtual void dumpPassStructure(unsigned Offset = 0);
-
- template<typename AnalysisClass>
- static const PassInfo *getClassPassInfo() {
- return lookupPassInfo(intptr_t(&AnalysisClass::ID));
- }
-
- // lookupPassInfo - Return the pass info object for the specified pass class,
- // or null if it is not known.
- static const PassInfo *lookupPassInfo(intptr_t TI);
-
- /// getAnalysisToUpdate<AnalysisType>() - This function is used by subclasses
- /// to get to the analysis information that might be around that needs to be
- /// updated. This is different than getAnalysis in that it can fail (ie the
- /// analysis results haven't been computed), so should only be used if you
- /// provide the capability to update an analysis that exists. This method is
- /// often used by transformation APIs to update analysis results for a pass
- /// automatically as the transform is performed.
- ///
- template<typename AnalysisType>
- AnalysisType *getAnalysisToUpdate() const; // Defined in PassAnalysisSupport.h
-
- /// mustPreserveAnalysisID - This method serves the same function as
- /// getAnalysisToUpdate, but works if you just have an AnalysisID. This
- /// obviously cannot give you a properly typed instance of the class if you
- /// don't have the class name available (use getAnalysisToUpdate if you do),
- /// but it can tell you if you need to preserve the pass at least.
- ///
- bool mustPreserveAnalysisID(const PassInfo *AnalysisID) const;
-
- /// getAnalysis<AnalysisType>() - This function is used by subclasses to get
- /// to the analysis information that they claim to use by overriding the
- /// getAnalysisUsage function.
- ///
- template<typename AnalysisType>
- AnalysisType &getAnalysis() const; // Defined in PassAnalysisSupport.h
-
- template<typename AnalysisType>
- AnalysisType &getAnalysis(Function &F); // Defined in PassanalysisSupport.h
-
- template<typename AnalysisType>
- AnalysisType &getAnalysisID(const PassInfo *PI) const;
-
- template<typename AnalysisType>
- AnalysisType &getAnalysisID(const PassInfo *PI, Function &F);
-};
-
-inline std::ostream &operator<<(std::ostream &OS, const Pass &P) {
- P.print(OS, 0); return OS;
-}
-
-//===----------------------------------------------------------------------===//
-/// ModulePass class - This class is used to implement unstructured
-/// interprocedural optimizations and analyses. ModulePasses may do anything
-/// they want to the program.
-///
-class ModulePass : public Pass {
-public:
- /// runOnModule - Virtual method overriden by subclasses to process the module
- /// being operated on.
- virtual bool runOnModule(Module &M) = 0;
-
- virtual void assignPassManager(PMStack &PMS,
- PassManagerType T = PMT_ModulePassManager);
-
- /// Return what kind of Pass Manager can manage this pass.
- virtual PassManagerType getPotentialPassManagerType() const {
- return PMT_ModulePassManager;
- }
-
- explicit ModulePass(intptr_t pid) : Pass(pid) {}
- explicit ModulePass(const void *pid) : Pass(pid) {}
- // Force out-of-line virtual method.
- virtual ~ModulePass();
-};
-
-
-//===----------------------------------------------------------------------===//
-/// ImmutablePass class - This class is used to provide information that does
-/// not need to be run. This is useful for things like target information and
-/// "basic" versions of AnalysisGroups.
-///
-class ImmutablePass : public ModulePass {
-public:
- /// initializePass - This method may be overriden by immutable passes to allow
- /// them to perform various initialization actions they require. This is
- /// primarily because an ImmutablePass can "require" another ImmutablePass,
- /// and if it does, the overloaded version of initializePass may get access to
- /// these passes with getAnalysis<>.
- ///
- virtual void initializePass() {}
-
- /// ImmutablePasses are never run.
- ///
- bool runOnModule(Module &M) { return false; }
-
- explicit ImmutablePass(intptr_t pid) : ModulePass(pid) {}
- explicit ImmutablePass(const void *pid)
- : ModulePass(pid) {}
-
- // Force out-of-line virtual method.
- virtual ~ImmutablePass();
-};
-
-//===----------------------------------------------------------------------===//
-/// FunctionPass class - This class is used to implement most global
-/// optimizations. Optimizations should subclass this class if they meet the
-/// following constraints:
-///
-/// 1. Optimizations are organized globally, i.e., a function at a time
-/// 2. Optimizing a function does not cause the addition or removal of any
-/// functions in the module
-///
-class FunctionPass : public Pass {
-public:
- explicit FunctionPass(intptr_t pid) : Pass(pid) {}
- explicit FunctionPass(const void *pid) : Pass(pid) {}
-
- /// doInitialization - Virtual method overridden by subclasses to do
- /// any necessary per-module initialization.
- ///
- virtual bool doInitialization(Module &M) { return false; }
-
- /// runOnFunction - Virtual method overriden by subclasses to do the
- /// per-function processing of the pass.
- ///
- virtual bool runOnFunction(Function &F) = 0;
-
- /// doFinalization - Virtual method overriden by subclasses to do any post
- /// processing needed after all passes have run.
- ///
- virtual bool doFinalization(Module &M) { return false; }
-
- /// runOnModule - On a module, we run this pass by initializing,
- /// ronOnFunction'ing once for every function in the module, then by
- /// finalizing.
- ///
- virtual bool runOnModule(Module &M);
-
- /// run - On a function, we simply initialize, run the function, then
- /// finalize.
- ///
- bool run(Function &F);
-
- virtual void assignPassManager(PMStack &PMS,
- PassManagerType T = PMT_FunctionPassManager);
-
- /// Return what kind of Pass Manager can manage this pass.
- virtual PassManagerType getPotentialPassManagerType() const {
- return PMT_FunctionPassManager;
- }
-};
-
-
-
-//===----------------------------------------------------------------------===//
-/// BasicBlockPass class - This class is used to implement most local
-/// optimizations. Optimizations should subclass this class if they
-/// meet the following constraints:
-/// 1. Optimizations are local, operating on either a basic block or
-/// instruction at a time.
-/// 2. Optimizations do not modify the CFG of the contained function, or any
-/// other basic block in the function.
-/// 3. Optimizations conform to all of the constraints of FunctionPasses.
-///
-class BasicBlockPass : public Pass {
-public:
- explicit BasicBlockPass(intptr_t pid) : Pass(pid) {}
- explicit BasicBlockPass(const void *pid) : Pass(pid) {}
-
- /// doInitialization - Virtual method overridden by subclasses to do
- /// any necessary per-module initialization.
- ///
- virtual bool doInitialization(Module &M) { return false; }
-
- /// doInitialization - Virtual method overridden by BasicBlockPass subclasses
- /// to do any necessary per-function initialization.
- ///
- virtual bool doInitialization(Function &F) { return false; }
-
- /// runOnBasicBlock - Virtual method overriden by subclasses to do the
- /// per-basicblock processing of the pass.
- ///
- virtual bool runOnBasicBlock(BasicBlock &BB) = 0;
-
- /// doFinalization - Virtual method overriden by BasicBlockPass subclasses to
- /// do any post processing needed after all passes have run.
- ///
- virtual bool doFinalization(Function &F) { return false; }
-
- /// doFinalization - Virtual method overriden by subclasses to do any post
- /// processing needed after all passes have run.
- ///
- virtual bool doFinalization(Module &M) { return false; }
-
-
- // To run this pass on a function, we simply call runOnBasicBlock once for
- // each function.
- //
- bool runOnFunction(Function &F);
-
- virtual void assignPassManager(PMStack &PMS,
- PassManagerType T = PMT_BasicBlockPassManager);
-
- /// Return what kind of Pass Manager can manage this pass.
- virtual PassManagerType getPotentialPassManagerType() const {
- return PMT_BasicBlockPassManager;
- }
-};
-
-/// If the user specifies the -time-passes argument on an LLVM tool command line
-/// then the value of this boolean will be true, otherwise false.
-/// @brief This is the storage for the -time-passes option.
-extern bool TimePassesIsEnabled;
-
-} // End llvm namespace
-
-// Include support files that contain important APIs commonly used by Passes,
-// but that we want to separate out to make it easier to read the header files.
-//
-#include "llvm/PassSupport.h"
-#include "llvm/PassAnalysisSupport.h"
-
-#endif
diff --git a/release_23/include/llvm/PassAnalysisSupport.h b/release_23/include/llvm/PassAnalysisSupport.h
deleted file mode 100644
index 4d19858bc98d..000000000000
--- a/release_23/include/llvm/PassAnalysisSupport.h
+++ /dev/null
@@ -1,240 +0,0 @@
-//===- llvm/PassAnalysisSupport.h - Analysis Pass Support code --*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines stuff that is used to define and "use" Analysis Passes.
-// This file is automatically #included by Pass.h, so:
-//
-// NO .CPP FILES SHOULD INCLUDE THIS FILE DIRECTLY
-//
-// Instead, #include Pass.h
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_PASS_ANALYSIS_SUPPORT_H
-#define LLVM_PASS_ANALYSIS_SUPPORT_H
-
-#include <vector>
-
-namespace llvm {
-
-// No need to include Pass.h, we are being included by it!
-
-//===----------------------------------------------------------------------===//
-// AnalysisUsage - Represent the analysis usage information of a pass. This
-// tracks analyses that the pass REQUIRES (must be available when the pass
-// runs), REQUIRES TRANSITIVE (must be available throughout the lifetime of the
-// pass), and analyses that the pass PRESERVES (the pass does not invalidate the
-// results of these analyses). This information is provided by a pass to the
-// Pass infrastructure through the getAnalysisUsage virtual function.
-//
-class AnalysisUsage {
- // Sets of analyses required and preserved by a pass
- std::vector<AnalysisID> Required, RequiredTransitive, Preserved;
- bool PreservesAll;
-public:
- AnalysisUsage() : PreservesAll(false) {}
-
- // addRequired - Add the specified ID to the required set of the usage info
- // for a pass.
- //
- AnalysisUsage &addRequiredID(AnalysisID ID) {
- assert(ID && "Pass class not registered!");
- Required.push_back(ID);
- return *this;
- }
- template<class PassClass>
- AnalysisUsage &addRequired() {
- return addRequiredID(Pass::getClassPassInfo<PassClass>());
- }
-
- AnalysisUsage &addRequiredTransitiveID(AnalysisID ID) {
- assert(ID && "Pass class not registered!");
- Required.push_back(ID);
- RequiredTransitive.push_back(ID);
- return *this;
- }
- template<class PassClass>
- AnalysisUsage &addRequiredTransitive() {
- AnalysisID ID = Pass::getClassPassInfo<PassClass>();
- return addRequiredTransitiveID(ID);
- }
-
- // addPreserved - Add the specified ID to the set of analyses preserved by
- // this pass
- //
- AnalysisUsage &addPreservedID(AnalysisID ID) {
- Preserved.push_back(ID);
- return *this;
- }
-
- template<class PassClass>
- AnalysisUsage &addPreserved() {
- assert(Pass::getClassPassInfo<PassClass>() && "Pass class not registered!");
- Preserved.push_back(Pass::getClassPassInfo<PassClass>());
- return *this;
- }
-
- // setPreservesAll - Set by analyses that do not transform their input at all
- void setPreservesAll() { PreservesAll = true; }
- bool getPreservesAll() const { return PreservesAll; }
-
- /// setPreservesCFG - This function should be called by the pass, iff they do
- /// not:
- ///
- /// 1. Add or remove basic blocks from the function
- /// 2. Modify terminator instructions in any way.
- ///
- /// This function annotates the AnalysisUsage info object to say that analyses
- /// that only depend on the CFG are preserved by this pass.
- ///
- void setPreservesCFG();
-
- const std::vector<AnalysisID> &getRequiredSet() const { return Required; }
- const std::vector<AnalysisID> &getRequiredTransitiveSet() const {
- return RequiredTransitive;
- }
- const std::vector<AnalysisID> &getPreservedSet() const { return Preserved; }
-};
-
-//===----------------------------------------------------------------------===//
-// AnalysisResolver - Simple interface used by Pass objects to pull all
-// analysis information out of pass manager that is responsible to manage
-// the pass.
-//
-class PMDataManager;
-class AnalysisResolver {
-private:
- AnalysisResolver(); // DO NOT IMPLEMENT
-
-public:
- explicit AnalysisResolver(PMDataManager &P) : PM(P) { }
-
- inline PMDataManager &getPMDataManager() { return PM; }
-
- // Find pass that is implementing PI.
- Pass *findImplPass(const PassInfo *PI) {
- Pass *ResultPass = 0;
- for (unsigned i = 0; i < AnalysisImpls.size() ; ++i) {
- if (AnalysisImpls[i].first == PI) {
- ResultPass = AnalysisImpls[i].second;
- break;
- }
- }
- return ResultPass;
- }
-
- // Find pass that is implementing PI. Initialize pass for Function F.
- Pass *findImplPass(Pass *P, const PassInfo *PI, Function &F);
-
- void addAnalysisImplsPair(const PassInfo *PI, Pass *P) {
- std::pair<const PassInfo*, Pass*> pir = std::make_pair(PI,P);
- AnalysisImpls.push_back(pir);
- }
-
- // getAnalysisToUpdate - Return an analysis result or null if it doesn't exist
- Pass *getAnalysisToUpdate(AnalysisID ID, bool Direction) const;
-
- // AnalysisImpls - This keeps track of which passes implements the interfaces
- // that are required by the current pass (to implement getAnalysis()).
- // NOTE : Remove AnalysisImpls from class Pass, when AnalysisResolver
- // replaces AnalysisResolver
- std::vector<std::pair<const PassInfo*, Pass*> > AnalysisImpls;
-
-private:
- // PassManager that is used to resolve analysis info
- PMDataManager &PM;
-};
-
-/// getAnalysisToUpdate<AnalysisType>() - This function is used by subclasses
-/// to get to the analysis information that might be around that needs to be
-/// updated. This is different than getAnalysis in that it can fail (ie the
-/// analysis results haven't been computed), so should only be used if you
-/// provide the capability to update an analysis that exists. This method is
-/// often used by transformation APIs to update analysis results for a pass
-/// automatically as the transform is performed.
-///
-template<typename AnalysisType>
-AnalysisType *Pass::getAnalysisToUpdate() const {
- assert(Resolver && "Pass not resident in a PassManager object!");
-
- const PassInfo *PI = getClassPassInfo<AnalysisType>();
- if (PI == 0) return 0;
- return dynamic_cast<AnalysisType*>
- (Resolver->getAnalysisToUpdate(PI, true));
-}
-
-/// getAnalysis<AnalysisType>() - This function is used by subclasses to get
-/// to the analysis information that they claim to use by overriding the
-/// getAnalysisUsage function.
-///
-template<typename AnalysisType>
-AnalysisType &Pass::getAnalysis() const {
- assert(Resolver &&"Pass has not been inserted into a PassManager object!");
-
- return getAnalysisID<AnalysisType>(getClassPassInfo<AnalysisType>());
-}
-
-template<typename AnalysisType>
-AnalysisType &Pass::getAnalysisID(const PassInfo *PI) const {
- assert(PI && "getAnalysis for unregistered pass!");
- assert(Resolver&&"Pass has not been inserted into a PassManager object!");
- // PI *must* appear in AnalysisImpls. Because the number of passes used
- // should be a small number, we just do a linear search over a (dense)
- // vector.
- Pass *ResultPass = Resolver->findImplPass(PI);
- assert (ResultPass &&
- "getAnalysis*() called on an analysis that was not "
- "'required' by pass!");
-
- // Because the AnalysisType may not be a subclass of pass (for
- // AnalysisGroups), we must use dynamic_cast here to potentially adjust the
- // return pointer (because the class may multiply inherit, once from pass,
- // once from AnalysisType).
- //
- AnalysisType *Result = dynamic_cast<AnalysisType*>(ResultPass);
- assert(Result && "Pass does not implement interface required!");
- return *Result;
-}
-
-/// getAnalysis<AnalysisType>() - This function is used by subclasses to get
-/// to the analysis information that they claim to use by overriding the
-/// getAnalysisUsage function.
-///
-template<typename AnalysisType>
-AnalysisType &Pass::getAnalysis(Function &F) {
- assert(Resolver &&"Pass has not been inserted into a PassManager object!");
-
- return getAnalysisID<AnalysisType>(getClassPassInfo<AnalysisType>(), F);
-}
-
-template<typename AnalysisType>
-AnalysisType &Pass::getAnalysisID(const PassInfo *PI, Function &F) {
- assert(PI && "getAnalysis for unregistered pass!");
- assert(Resolver&&"Pass has not been inserted into a PassManager object!");
- // PI *must* appear in AnalysisImpls. Because the number of passes used
- // should be a small number, we just do a linear search over a (dense)
- // vector.
- Pass *ResultPass = Resolver->findImplPass(this, PI, F);
- assert (ResultPass &&
- "getAnalysis*() called on an analysis that was not "
- "'required' by pass!");
-
- // Because the AnalysisType may not be a subclass of pass (for
- // AnalysisGroups), we must use dynamic_cast here to potentially adjust the
- // return pointer (because the class may multiply inherit, once from pass,
- // once from AnalysisType).
- //
- AnalysisType *Result = dynamic_cast<AnalysisType*>(ResultPass);
- assert(Result && "Pass does not implement interface required!");
- return *Result;
-}
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/PassManager.h b/release_23/include/llvm/PassManager.h
deleted file mode 100644
index 294b8453015a..000000000000
--- a/release_23/include/llvm/PassManager.h
+++ /dev/null
@@ -1,106 +0,0 @@
-//===- llvm/PassManager.h - Container for Passes ----------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines the PassManager class. This class is used to hold,
-// maintain, and optimize execution of Passes. The PassManager class ensures
-// that analysis results are available before a pass runs, and that Pass's are
-// destroyed when the PassManager is destroyed.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_PASSMANAGER_H
-#define LLVM_PASSMANAGER_H
-
-#include "llvm/Pass.h"
-
-namespace llvm {
-
-class Pass;
-class ModulePass;
-class Module;
-class ModuleProvider;
-
-class PassManagerImpl;
-class FunctionPassManagerImpl;
-
-/// PassManagerBase - An abstract interface to allow code to add passes to
-/// a pass manager without having to hard-code what kind of pass manager
-/// it is.
-class PassManagerBase {
-public:
- virtual ~PassManagerBase();
-
- /// add - Add a pass to the queue of passes to run. This passes ownership of
- /// the Pass to the PassManager. When the PassManager is destroyed, the pass
- /// will be destroyed as well, so there is no need to delete the pass. This
- /// implies that all passes MUST be allocated with 'new'.
- virtual void add(Pass *P) = 0;
-};
-
-/// PassManager manages ModulePassManagers
-class PassManager : public PassManagerBase {
-public:
-
- PassManager();
- ~PassManager();
-
- /// add - Add a pass to the queue of passes to run. This passes ownership of
- /// the Pass to the PassManager. When the PassManager is destroyed, the pass
- /// will be destroyed as well, so there is no need to delete the pass. This
- /// implies that all passes MUST be allocated with 'new'.
- void add(Pass *P);
-
- /// run - Execute all of the passes scheduled for execution. Keep track of
- /// whether any of the passes modifies the module, and if so, return true.
- bool run(Module &M);
-
-private:
-
- /// PassManagerImpl_New is the actual class. PassManager is just the
- /// wraper to publish simple pass manager interface
- PassManagerImpl *PM;
-};
-
-/// FunctionPassManager manages FunctionPasses and BasicBlockPassManagers.
-class FunctionPassManager : public PassManagerBase {
-public:
- /// FunctionPassManager ctor - This initializes the pass manager. It needs,
- /// but does not take ownership of, the specified module provider.
- explicit FunctionPassManager(ModuleProvider *P);
- ~FunctionPassManager();
-
- /// add - Add a pass to the queue of passes to run. This passes
- /// ownership of the Pass to the PassManager. When the
- /// PassManager_X is destroyed, the pass will be destroyed as well, so
- /// there is no need to delete the pass. (TODO delete passes.)
- /// This implies that all passes MUST be allocated with 'new'.
- void add(Pass *P);
-
- /// run - Execute all of the passes scheduled for execution. Keep
- /// track of whether any of the passes modifies the function, and if
- /// so, return true.
- ///
- bool run(Function &F);
-
- /// doInitialization - Run all of the initializers for the function passes.
- ///
- bool doInitialization();
-
- /// doFinalization - Run all of the finalizers for the function passes.
- ///
- bool doFinalization();
-
-private:
- FunctionPassManagerImpl *FPM;
- ModuleProvider *MP;
-};
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/PassManagers.h b/release_23/include/llvm/PassManagers.h
deleted file mode 100644
index 5bf4dfb0a104..000000000000
--- a/release_23/include/llvm/PassManagers.h
+++ /dev/null
@@ -1,413 +0,0 @@
-//===- llvm/PassManager.h - Pass Inftrastructre classes --------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file declares the LLVM Pass Manager infrastructure.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/PassManager.h"
-#include "llvm/ADT/SmallVector.h"
-#include <deque>
-#include <map>
-
-//===----------------------------------------------------------------------===//
-// Overview:
-// The Pass Manager Infrastructure manages passes. It's responsibilities are:
-//
-// o Manage optimization pass execution order
-// o Make required Analysis information available before pass P is run
-// o Release memory occupied by dead passes
-// o If Analysis information is dirtied by a pass then regenerate Analysis
-// information before it is consumed by another pass.
-//
-// Pass Manager Infrastructure uses multiple pass managers. They are
-// PassManager, FunctionPassManager, MPPassManager, FPPassManager, BBPassManager.
-// This class hierarcy uses multiple inheritance but pass managers do not derive
-// from another pass manager.
-//
-// PassManager and FunctionPassManager are two top-level pass manager that
-// represents the external interface of this entire pass manager infrastucture.
-//
-// Important classes :
-//
-// [o] class PMTopLevelManager;
-//
-// Two top level managers, PassManager and FunctionPassManager, derive from
-// PMTopLevelManager. PMTopLevelManager manages information used by top level
-// managers such as last user info.
-//
-// [o] class PMDataManager;
-//
-// PMDataManager manages information, e.g. list of available analysis info,
-// used by a pass manager to manage execution order of passes. It also provides
-// a place to implement common pass manager APIs. All pass managers derive from
-// PMDataManager.
-//
-// [o] class BBPassManager : public FunctionPass, public PMDataManager;
-//
-// BBPassManager manages BasicBlockPasses.
-//
-// [o] class FunctionPassManager;
-//
-// This is a external interface used by JIT to manage FunctionPasses. This
-// interface relies on FunctionPassManagerImpl to do all the tasks.
-//
-// [o] class FunctionPassManagerImpl : public ModulePass, PMDataManager,
-// public PMTopLevelManager;
-//
-// FunctionPassManagerImpl is a top level manager. It manages FPPassManagers
-//
-// [o] class FPPassManager : public ModulePass, public PMDataManager;
-//
-// FPPassManager manages FunctionPasses and BBPassManagers
-//
-// [o] class MPPassManager : public Pass, public PMDataManager;
-//
-// MPPassManager manages ModulePasses and FPPassManagers
-//
-// [o] class PassManager;
-//
-// This is a external interface used by various tools to manages passes. It
-// relies on PassManagerImpl to do all the tasks.
-//
-// [o] class PassManagerImpl : public Pass, public PMDataManager,
-// public PMDTopLevelManager
-//
-// PassManagerImpl is a top level pass manager responsible for managing
-// MPPassManagers.
-//===----------------------------------------------------------------------===//
-
-#ifndef PASSMANAGERS_H
-#define PASSMANAGERS_H
-
-namespace llvm {
-
-/// FunctionPassManager and PassManager, two top level managers, serve
-/// as the public interface of pass manager infrastructure.
-enum TopLevelManagerType {
- TLM_Function, // FunctionPassManager
- TLM_Pass // PassManager
-};
-
-// enums for debugging strings
-enum PassDebuggingString {
- EXECUTION_MSG, // "Executing Pass '"
- MODIFICATION_MSG, // "' Made Modification '"
- FREEING_MSG, // " Freeing Pass '"
- ON_BASICBLOCK_MSG, // "' on BasicBlock '" + PassName + "'...\n"
- ON_FUNCTION_MSG, // "' on Function '" + FunctionName + "'...\n"
- ON_MODULE_MSG, // "' on Module '" + ModuleName + "'...\n"
- ON_LOOP_MSG, // " 'on Loop ...\n'"
- ON_CG_MSG // "' on Call Graph ...\n'"
-};
-
-//===----------------------------------------------------------------------===//
-// PMStack
-//
-/// PMStack
-/// Top level pass managers (see PassManager.cpp) maintain active Pass Managers
-/// using PMStack. Each Pass implements assignPassManager() to connect itself
-/// with appropriate manager. assignPassManager() walks PMStack to find
-/// suitable manager.
-///
-/// PMStack is just a wrapper around standard deque that overrides pop() and
-/// push() methods.
-class PMStack {
-public:
- typedef std::deque<PMDataManager *>::reverse_iterator iterator;
- iterator begin() { return S.rbegin(); }
- iterator end() { return S.rend(); }
-
- void handleLastUserOverflow();
-
- void pop();
- inline PMDataManager *top() { return S.back(); }
- void push(PMDataManager *PM);
- inline bool empty() { return S.empty(); }
-
- void dump();
-private:
- std::deque<PMDataManager *> S;
-};
-
-
-//===----------------------------------------------------------------------===//
-// PMTopLevelManager
-//
-/// PMTopLevelManager manages LastUser info and collects common APIs used by
-/// top level pass managers.
-class PMTopLevelManager {
-public:
-
- virtual unsigned getNumContainedManagers() {
- return (unsigned)PassManagers.size();
- }
-
- /// Schedule pass P for execution. Make sure that passes required by
- /// P are run before P is run. Update analysis info maintained by
- /// the manager. Remove dead passes. This is a recursive function.
- void schedulePass(Pass *P);
-
- /// This is implemented by top level pass manager and used by
- /// schedulePass() to add analysis info passes that are not available.
- virtual void addTopLevelPass(Pass *P) = 0;
-
- /// Set pass P as the last user of the given analysis passes.
- void setLastUser(SmallVector<Pass *, 12> &AnalysisPasses, Pass *P);
-
- /// Collect passes whose last user is P
- void collectLastUses(SmallVector<Pass *, 12> &LastUses, Pass *P);
-
- /// Find the pass that implements Analysis AID. Search immutable
- /// passes and all pass managers. If desired pass is not found
- /// then return NULL.
- Pass *findAnalysisPass(AnalysisID AID);
-
- explicit PMTopLevelManager(enum TopLevelManagerType t);
- virtual ~PMTopLevelManager();
-
- /// Add immutable pass and initialize it.
- inline void addImmutablePass(ImmutablePass *P) {
- P->initializePass();
- ImmutablePasses.push_back(P);
- }
-
- inline std::vector<ImmutablePass *>& getImmutablePasses() {
- return ImmutablePasses;
- }
-
- void addPassManager(PMDataManager *Manager) {
- PassManagers.push_back(Manager);
- }
-
- // Add Manager into the list of managers that are not directly
- // maintained by this top level pass manager
- inline void addIndirectPassManager(PMDataManager *Manager) {
- IndirectPassManagers.push_back(Manager);
- }
-
- // Print passes managed by this top level manager.
- void dumpPasses() const;
- void dumpArguments() const;
-
- void initializeAllAnalysisInfo();
-
- // Active Pass Managers
- PMStack activeStack;
-
-protected:
-
- /// Collection of pass managers
- std::vector<PMDataManager *> PassManagers;
-
-private:
-
- /// Collection of pass managers that are not directly maintained
- /// by this pass manager
- std::vector<PMDataManager *> IndirectPassManagers;
-
- // Map to keep track of last user of the analysis pass.
- // LastUser->second is the last user of Lastuser->first.
- std::map<Pass *, Pass *> LastUser;
-
- /// Immutable passes are managed by top level manager.
- std::vector<ImmutablePass *> ImmutablePasses;
-};
-
-
-
-//===----------------------------------------------------------------------===//
-// PMDataManager
-
-/// PMDataManager provides the common place to manage the analysis data
-/// used by pass managers.
-class PMDataManager {
-public:
-
- explicit PMDataManager(int Depth) : TPM(NULL), Depth(Depth) {
- initializeAnalysisInfo();
- }
-
- virtual ~PMDataManager();
-
- /// Augment AvailableAnalysis by adding analysis made available by pass P.
- void recordAvailableAnalysis(Pass *P);
-
- /// verifyPreservedAnalysis -- Verify analysis presreved by pass P.
- void verifyPreservedAnalysis(Pass *P);
-
- /// Remove Analysis that is not preserved by the pass
- void removeNotPreservedAnalysis(Pass *P);
-
- /// Remove dead passes
- void removeDeadPasses(Pass *P, const char *Msg, enum PassDebuggingString);
-
- /// Add pass P into the PassVector. Update
- /// AvailableAnalysis appropriately if ProcessAnalysis is true.
- void add(Pass *P, bool ProcessAnalysis = true);
-
- /// Add RequiredPass into list of lower level passes required by pass P.
- /// RequiredPass is run on the fly by Pass Manager when P requests it
- /// through getAnalysis interface.
- virtual void addLowerLevelRequiredPass(Pass *P, Pass *RequiredPass);
-
- virtual Pass * getOnTheFlyPass(Pass *P, const PassInfo *PI, Function &F) {
- assert (0 && "Unable to find on the fly pass");
- return NULL;
- }
-
- /// Initialize available analysis information.
- void initializeAnalysisInfo() {
- AvailableAnalysis.clear();
- for (unsigned i = 0; i < PMT_Last; ++i)
- InheritedAnalysis[i] = NULL;
- }
-
- // Return true if P preserves high level analysis used by other
- // passes that are managed by this manager.
- bool preserveHigherLevelAnalysis(Pass *P);
-
-
- /// Populate RequiredPasses with analysis pass that are required by
- /// pass P and are available. Populate ReqPassNotAvailable with analysis
- /// pass that are required by pass P but are not available.
- void collectRequiredAnalysis(SmallVector<Pass *, 8> &RequiredPasses,
- SmallVector<AnalysisID, 8> &ReqPassNotAvailable,
- Pass *P);
-
- /// All Required analyses should be available to the pass as it runs! Here
- /// we fill in the AnalysisImpls member of the pass so that it can
- /// successfully use the getAnalysis() method to retrieve the
- /// implementations it needs.
- void initializeAnalysisImpl(Pass *P);
-
- /// Find the pass that implements Analysis AID. If desired pass is not found
- /// then return NULL.
- Pass *findAnalysisPass(AnalysisID AID, bool Direction);
-
- // Access toplevel manager
- PMTopLevelManager *getTopLevelManager() { return TPM; }
- void setTopLevelManager(PMTopLevelManager *T) { TPM = T; }
-
- unsigned getDepth() const { return Depth; }
-
- // Print routines used by debug-pass
- void dumpLastUses(Pass *P, unsigned Offset) const;
- void dumpPassArguments() const;
- void dumpPassInfo(Pass *P, enum PassDebuggingString S1,
- enum PassDebuggingString S2, const char *Msg);
- void dumpAnalysisSetInfo(const char *Msg, Pass *P,
- const std::vector<AnalysisID> &Set) const;
-
- virtual unsigned getNumContainedPasses() {
- return (unsigned)PassVector.size();
- }
-
- virtual PassManagerType getPassManagerType() const {
- assert ( 0 && "Invalid use of getPassManagerType");
- return PMT_Unknown;
- }
-
- std::map<AnalysisID, Pass*> *getAvailableAnalysis() {
- return &AvailableAnalysis;
- }
-
- // Collect AvailableAnalysis from all the active Pass Managers.
- void populateInheritedAnalysis(PMStack &PMS) {
- unsigned Index = 0;
- for (PMStack::iterator I = PMS.begin(), E = PMS.end();
- I != E; ++I)
- InheritedAnalysis[Index++] = (*I)->getAvailableAnalysis();
- }
-
-protected:
-
- // Top level manager.
- PMTopLevelManager *TPM;
-
- // Collection of pass that are managed by this manager
- std::vector<Pass *> PassVector;
-
- // Collection of Analysis provided by Parent pass manager and
- // used by current pass manager. At at time there can not be more
- // then PMT_Last active pass mangers.
- std::map<AnalysisID, Pass *> *InheritedAnalysis[PMT_Last];
-
-private:
- // Set of available Analysis. This information is used while scheduling
- // pass. If a pass requires an analysis which is not not available then
- // equired analysis pass is scheduled to run before the pass itself is
- // scheduled to run.
- std::map<AnalysisID, Pass*> AvailableAnalysis;
-
- // Collection of higher level analysis used by the pass managed by
- // this manager.
- std::vector<Pass *> HigherLevelAnalysis;
-
- unsigned Depth;
-};
-
-//===----------------------------------------------------------------------===//
-// FPPassManager
-//
-/// FPPassManager manages BBPassManagers and FunctionPasses.
-/// It batches all function passes and basic block pass managers together and
-/// sequence them to process one function at a time before processing next
-/// function.
-
-class FPPassManager : public ModulePass, public PMDataManager {
-
-public:
- static char ID;
- explicit FPPassManager(int Depth)
- : ModulePass(intptr_t(&ID)), PMDataManager(Depth) { }
-
- /// run - Execute all of the passes scheduled for execution. Keep track of
- /// whether any of the passes modifies the module, and if so, return true.
- bool runOnFunction(Function &F);
- bool runOnModule(Module &M);
-
- /// doInitialization - Run all of the initializers for the function passes.
- ///
- bool doInitialization(Module &M);
-
- /// doFinalization - Run all of the finalizers for the function passes.
- ///
- bool doFinalization(Module &M);
-
- /// Pass Manager itself does not invalidate any analysis info.
- void getAnalysisUsage(AnalysisUsage &Info) const {
- Info.setPreservesAll();
- }
-
- // Print passes managed by this manager
- void dumpPassStructure(unsigned Offset);
-
- virtual const char *getPassName() const {
- return "Function Pass Manager";
- }
-
- FunctionPass *getContainedPass(unsigned N) {
- assert ( N < PassVector.size() && "Pass number out of range!");
- FunctionPass *FP = static_cast<FunctionPass *>(PassVector[N]);
- return FP;
- }
-
- virtual PassManagerType getPassManagerType() const {
- return PMT_FunctionPassManager;
- }
-};
-
-}
-
-extern void StartPassTimer(llvm::Pass *);
-extern void StopPassTimer(llvm::Pass *);
-
-#endif
-
diff --git a/release_23/include/llvm/PassSupport.h b/release_23/include/llvm/PassSupport.h
deleted file mode 100644
index 29e737481537..000000000000
--- a/release_23/include/llvm/PassSupport.h
+++ /dev/null
@@ -1,262 +0,0 @@
-//===- llvm/PassSupport.h - Pass Support code -------------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines stuff that is used to define and "use" Passes. This file
-// is automatically #included by Pass.h, so:
-//
-// NO .CPP FILES SHOULD INCLUDE THIS FILE DIRECTLY
-//
-// Instead, #include Pass.h.
-//
-// This file defines Pass registration code and classes used for it.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_PASS_SUPPORT_H
-#define LLVM_PASS_SUPPORT_H
-
-// No need to include Pass.h, we are being included by it!
-
-namespace llvm {
-
-class TargetMachine;
-
-//===---------------------------------------------------------------------------
-/// PassInfo class - An instance of this class exists for every pass known by
-/// the system, and can be obtained from a live Pass by calling its
-/// getPassInfo() method. These objects are set up by the RegisterPass<>
-/// template, defined below.
-///
-class PassInfo {
- const char *PassName; // Nice name for Pass
- const char *PassArgument; // Command Line argument to run this pass
- intptr_t PassID;
- bool IsCFGOnlyPass; // Pass only looks at the CFG.
- bool IsAnalysis; // True if an analysis pass.
- bool IsAnalysisGroup; // True if an analysis group.
- std::vector<const PassInfo*> ItfImpl;// Interfaces implemented by this pass
-
- Pass *(*NormalCtor)();
-
-public:
- /// PassInfo ctor - Do not call this directly, this should only be invoked
- /// through RegisterPass.
- PassInfo(const char *name, const char *arg, intptr_t pi,
- Pass *(*normal)() = 0, bool isCFGOnly = false, bool isAnalysis = false)
- : PassName(name), PassArgument(arg), PassID(pi),
- IsCFGOnlyPass(isCFGOnly),
- IsAnalysis(isAnalysis), IsAnalysisGroup(false), NormalCtor(normal) {
- }
-
- /// getPassName - Return the friendly name for the pass, never returns null
- ///
- const char *getPassName() const { return PassName; }
- void setPassName(const char *Name) { PassName = Name; }
-
- /// getPassArgument - Return the command line option that may be passed to
- /// 'opt' that will cause this pass to be run. This will return null if there
- /// is no argument.
- ///
- const char *getPassArgument() const { return PassArgument; }
-
- /// getTypeInfo - Return the id object for the pass...
- /// TODO : Rename
- intptr_t getTypeInfo() const { return PassID; }
-
- /// isAnalysisGroup - Return true if this is an analysis group, not a normal
- /// pass.
- ///
- bool isAnalysisGroup() const { return IsAnalysisGroup; }
- bool isAnalysis() const { return IsAnalysis; }
- void SetIsAnalysisGroup() { IsAnalysisGroup = true; }
-
- /// isCFGOnlyPass - return true if this pass only looks at the CFG for the
- /// function.
- bool isCFGOnlyPass() const { return IsCFGOnlyPass; }
-
- /// getNormalCtor - Return a pointer to a function, that when called, creates
- /// an instance of the pass and returns it. This pointer may be null if there
- /// is no default constructor for the pass.
- ///
- Pass *(*getNormalCtor() const)() {
- return NormalCtor;
- }
- void setNormalCtor(Pass *(*Ctor)()) {
- NormalCtor = Ctor;
- }
-
- /// createPass() - Use this method to create an instance of this pass.
- Pass *createPass() const {
- assert((!isAnalysisGroup() || NormalCtor) &&
- "No default implementation found for analysis group!");
- assert(NormalCtor &&
- "Cannot call createPass on PassInfo without default ctor!");
- return NormalCtor();
- }
-
- /// addInterfaceImplemented - This method is called when this pass is
- /// registered as a member of an analysis group with the RegisterAnalysisGroup
- /// template.
- ///
- void addInterfaceImplemented(const PassInfo *ItfPI) {
- ItfImpl.push_back(ItfPI);
- }
-
- /// getInterfacesImplemented - Return a list of all of the analysis group
- /// interfaces implemented by this pass.
- ///
- const std::vector<const PassInfo*> &getInterfacesImplemented() const {
- return ItfImpl;
- }
-};
-
-
-//===---------------------------------------------------------------------------
-/// RegisterPass<t> template - This template class is used to notify the system
-/// that a Pass is available for use, and registers it into the internal
-/// database maintained by the PassManager. Unless this template is used, opt,
-/// for example will not be able to see the pass and attempts to create the pass
-/// will fail. This template is used in the follow manner (at global scope, in
-/// your .cpp file):
-///
-/// static RegisterPass<YourPassClassName> tmp("passopt", "My Pass Name");
-///
-/// This statement will cause your pass to be created by calling the default
-/// constructor exposed by the pass. If you have a different constructor that
-/// must be called, create a global constructor function (which takes the
-/// arguments you need and returns a Pass*) and register your pass like this:
-///
-/// static RegisterPass<PassClassName> tmp("passopt", "My Name");
-///
-struct RegisterPassBase {
- /// getPassInfo - Get the pass info for the registered class...
- ///
- const PassInfo *getPassInfo() const { return &PIObj; }
-
- typedef Pass* (*NormalCtor_t)();
-
- RegisterPassBase(const char *Name, const char *Arg, intptr_t TI,
- NormalCtor_t NormalCtor = 0, bool CFGOnly = false,
- bool IsAnalysis = false)
- : PIObj(Name, Arg, TI, NormalCtor, CFGOnly, IsAnalysis) {
- registerPass();
- }
- explicit RegisterPassBase(intptr_t TI)
- : PIObj("", "", TI) {
- // This ctor may only be used for analysis groups: it does not auto-register
- // the pass.
- PIObj.SetIsAnalysisGroup();
- }
-
-protected:
- PassInfo PIObj; // The PassInfo object for this pass
- void registerPass();
- void unregisterPass();
-};
-
-template<typename PassName>
-Pass *callDefaultCtor() { return new PassName(); }
-
-template<typename PassName>
-struct RegisterPass : public RegisterPassBase {
-
- // Register Pass using default constructor...
- RegisterPass(const char *PassArg, const char *Name, bool CFGOnly = false,
- bool IsAnalysis = false)
- : RegisterPassBase(Name, PassArg, intptr_t(&PassName::ID),
- RegisterPassBase::NormalCtor_t(callDefaultCtor<PassName>),
- CFGOnly, IsAnalysis) {
- }
-};
-
-
-/// RegisterAnalysisGroup - Register a Pass as a member of an analysis _group_.
-/// Analysis groups are used to define an interface (which need not derive from
-/// Pass) that is required by passes to do their job. Analysis Groups differ
-/// from normal analyses because any available implementation of the group will
-/// be used if it is available.
-///
-/// If no analysis implementing the interface is available, a default
-/// implementation is created and added. A pass registers itself as the default
-/// implementation by specifying 'true' as the third template argument of this
-/// class.
-///
-/// In addition to registering itself as an analysis group member, a pass must
-/// register itself normally as well. Passes may be members of multiple groups
-/// and may still be "required" specifically by name.
-///
-/// The actual interface may also be registered as well (by not specifying the
-/// second template argument). The interface should be registered to associate
-/// a nice name with the interface.
-///
-class RegisterAGBase : public RegisterPassBase {
- PassInfo *InterfaceInfo;
- const PassInfo *ImplementationInfo;
- bool isDefaultImplementation;
-protected:
- explicit RegisterAGBase(intptr_t InterfaceID,
- intptr_t PassID = 0,
- bool isDefault = false);
- void setGroupName(const char *Name);
-};
-
-template<typename Interface, bool Default = false>
-struct RegisterAnalysisGroup : public RegisterAGBase {
- explicit RegisterAnalysisGroup(RegisterPassBase &RPB)
- : RegisterAGBase(intptr_t(&Interface::ID), RPB.getPassInfo()->getTypeInfo(),
- Default) {
- }
-
- explicit RegisterAnalysisGroup(const char *Name)
- : RegisterAGBase(intptr_t(&Interface::ID)) {
- setGroupName(Name);
- }
-};
-
-
-
-//===---------------------------------------------------------------------------
-/// PassRegistrationListener class - This class is meant to be derived from by
-/// clients that are interested in which passes get registered and unregistered
-/// at runtime (which can be because of the RegisterPass constructors being run
-/// as the program starts up, or may be because a shared object just got
-/// loaded). Deriving from the PassRegistationListener class automatically
-/// registers your object to receive callbacks indicating when passes are loaded
-/// and removed.
-///
-struct PassRegistrationListener {
-
- /// PassRegistrationListener ctor - Add the current object to the list of
- /// PassRegistrationListeners...
- PassRegistrationListener();
-
- /// dtor - Remove object from list of listeners...
- ///
- virtual ~PassRegistrationListener();
-
- /// Callback functions - These functions are invoked whenever a pass is loaded
- /// or removed from the current executable.
- ///
- virtual void passRegistered(const PassInfo *P) {}
-
- /// enumeratePasses - Iterate over the registered passes, calling the
- /// passEnumerate callback on each PassInfo object.
- ///
- void enumeratePasses();
-
- /// passEnumerate - Callback function invoked when someone calls
- /// enumeratePasses on this PassRegistrationListener object.
- ///
- virtual void passEnumerate(const PassInfo *P) {}
-};
-
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/Support/AIXDataTypesFix.h b/release_23/include/llvm/Support/AIXDataTypesFix.h
deleted file mode 100644
index a9a9147de294..000000000000
--- a/release_23/include/llvm/Support/AIXDataTypesFix.h
+++ /dev/null
@@ -1,25 +0,0 @@
-//===-- llvm/Support/AIXDataTypesFix.h - Fix datatype defs ------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file overrides default system-defined types and limits which cannot be
-// done in DataTypes.h.in because it is processed by autoheader first, which
-// comments out any #undef statement
-//
-//===----------------------------------------------------------------------===//
-
-// No include guards desired!
-
-#ifndef SUPPORT_DATATYPES_H
-#error "AIXDataTypesFix.h must only be included via DataTypes.h!"
-#endif
-
-// GCC is strict about defining large constants: they must have LL modifier.
-// These will be defined properly at the end of DataTypes.h
-#undef INT64_MAX
-#undef INT64_MIN
diff --git a/release_23/include/llvm/Support/AlignOf.h b/release_23/include/llvm/Support/AlignOf.h
deleted file mode 100644
index aecb478eefda..000000000000
--- a/release_23/include/llvm/Support/AlignOf.h
+++ /dev/null
@@ -1,60 +0,0 @@
-//===--- AlignOf.h - Portable calculation of type alignment -----*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines the AlignOf function that computes alignments for
-// arbitrary types.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_SUPPORT_ALIGNOF_H
-#define LLVM_SUPPORT_ALIGNOF_H
-
-namespace llvm {
-
-template <typename T>
-struct AlignmentCalcImpl {
- char x;
- T t;
-private:
- AlignmentCalcImpl() {} // Never instantiate.
-};
-
-/// AlignOf - A templated class that contains an enum value representing
-/// the alignment of the template argument. For example,
-/// AlignOf<int>::Alignment represents the alignment of type "int". The
-/// alignment calculated is the minimum alignment, and not necessarily
-/// the "desired" alignment returned by GCC's __alignof__ (for example). Note
-/// that because the alignment is an enum value, it can be used as a
-/// compile-time constant (e.g., for template instantiation).
-template <typename T>
-struct AlignOf {
- enum { Alignment =
- static_cast<unsigned int>(sizeof(AlignmentCalcImpl<T>) - sizeof(T)) };
-
- enum { Alignment_GreaterEqual_2Bytes = Alignment >= 2 ? 1 : 0 };
- enum { Alignment_GreaterEqual_4Bytes = Alignment >= 4 ? 1 : 0 };
- enum { Alignment_GreaterEqual_8Bytes = Alignment >= 8 ? 1 : 0 };
- enum { Alignment_GreaterEqual_16Bytes = Alignment >= 16 ? 1 : 0 };
-
- enum { Alignment_LessEqual_2Bytes = Alignment <= 2 ? 1 : 0 };
- enum { Alignment_LessEqual_4Bytes = Alignment <= 4 ? 1 : 0 };
- enum { Alignment_LessEqual_8Bytes = Alignment <= 8 ? 1 : 0 };
- enum { Alignment_LessEqual_16Bytes = Alignment <= 16 ? 1 : 0 };
-
-};
-
-/// alignof - A templated function that returns the mininum alignment of
-/// of a type. This provides no extra functionality beyond the AlignOf
-/// class besides some cosmetic cleanliness. Example usage:
-/// alignof<int>() returns the alignment of an int.
-template <typename T>
-static inline unsigned alignof() { return AlignOf<T>::Alignment; }
-
-} // end namespace llvm
-#endif
diff --git a/release_23/include/llvm/Support/Allocator.h b/release_23/include/llvm/Support/Allocator.h
deleted file mode 100644
index 33cdca13e64e..000000000000
--- a/release_23/include/llvm/Support/Allocator.h
+++ /dev/null
@@ -1,62 +0,0 @@
-//===--- Allocator.h - Simple memory allocation abstraction -----*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines the MallocAllocator and BumpPtrAllocator interfaces.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_SUPPORT_ALLOCATOR_H
-#define LLVM_SUPPORT_ALLOCATOR_H
-
-#include "llvm/Support/AlignOf.h"
-#include <cstdlib>
-
-namespace llvm {
-
-class MallocAllocator {
-public:
- MallocAllocator() {}
- ~MallocAllocator() {}
-
- void Reset() {}
- void *Allocate(size_t Size, size_t Alignment) { return malloc(Size); }
-
- template <typename T>
- void *Allocate() { return reinterpret_cast<T*>(malloc(sizeof(T))); }
-
- void Deallocate(void *Ptr) { free(Ptr); }
- void PrintStats() const {}
-};
-
-/// BumpPtrAllocator - This allocator is useful for containers that need very
-/// simple memory allocation strategies. In particular, this just keeps
-/// allocating memory, and never deletes it until the entire block is dead. This
-/// makes allocation speedy, but must only be used when the trade-off is ok.
-class BumpPtrAllocator {
- void *TheMemory;
-public:
- BumpPtrAllocator();
- ~BumpPtrAllocator();
-
- void Reset();
- void *Allocate(size_t Size, size_t Alignment);
-
- template <typename T>
- void *Allocate() {
- return reinterpret_cast<T*>(Allocate(sizeof(T),AlignOf<T>::Alignment));
- }
-
-
- void Deallocate(void *Ptr) {}
- void PrintStats() const;
-};
-
-} // end namespace llvm
-
-#endif
diff --git a/release_23/include/llvm/Support/Annotation.h b/release_23/include/llvm/Support/Annotation.h
deleted file mode 100644
index 2be1c1061690..000000000000
--- a/release_23/include/llvm/Support/Annotation.h
+++ /dev/null
@@ -1,218 +0,0 @@
-//===-- llvm/Support/Annotation.h - Annotation classes ----------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains the declarations for two classes: Annotation & Annotable.
-// Using these two simple classes, anything that derives from Annotable can have
-// Annotation subclasses attached to them, ready for easy retrieval.
-//
-// Annotations are designed to be easily attachable to various classes.
-//
-// The AnnotationManager class is essential for using these classes. It is
-// responsible for turning Annotation name strings into tokens [unique id #'s]
-// that may be used to search for and create annotations.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_SUPPORT_ANNOTATION_H
-#define LLVM_SUPPORT_ANNOTATION_H
-
-#include <string>
-#include <cassert>
-
-namespace llvm {
-
-class AnnotationID;
-class Annotation;
-class Annotable;
-struct AnnotationManager;
-
-//===----------------------------------------------------------------------===//
-//
-// AnnotationID - This class is a thin wrapper around an unsigned integer that
-// is used to hopefully prevent errors using AnnotationID's. They may be copied
-// freely around and passed byvalue with little or no overhead.
-//
-class AnnotationID {
- friend struct AnnotationManager;
- unsigned ID;
-
- AnnotationID(); // Default ctor is disabled
-
- // AnnotationID is only creatable from AnnMgr.
- explicit inline AnnotationID(unsigned i) : ID(i) {}
-public:
- inline AnnotationID(const AnnotationID &A) : ID(A.ID) {}
-
- inline bool operator==(const AnnotationID &A) const {
- return A.ID == ID;
- }
- inline bool operator<(const AnnotationID &A) const {
- return ID < A.ID;
- }
-};
-
-
-//===----------------------------------------------------------------------===//
-//
-// Annotation Class - This class serves as a base class for any specific
-// annotations that you might need. Simply subclass this to add extra
-// information to the annotations.
-//
-class Annotation {
- friend class Annotable; // Annotable manipulates Next list
- AnnotationID ID; // ID number, as obtained from AnnotationManager
- Annotation *Next; // The next annotation in the linked list
-public:
- explicit inline Annotation(AnnotationID id) : ID(id), Next(0) {}
- virtual ~Annotation(); // Designed to be subclassed
-
- // getID - Return the unique ID# of this annotation
- inline AnnotationID getID() const { return ID; }
-
- // getNext - Return the next annotation in the list...
- inline Annotation *getNext() const { return Next; }
-};
-
-
-//===----------------------------------------------------------------------===//
-//
-// Annotable - This class is used as a base class for all objects that would
-// like to have annotation capability.
-//
-// Annotable objects keep their annotation list sorted as annotations are
-// inserted and deleted. This is used to ensure that annotations with identical
-// ID#'s are stored sequentially.
-//
-class Annotable {
- mutable Annotation *AnnotationList;
-
- Annotable(const Annotable &); // Do not implement
- void operator=(const Annotable &); // Do not implement
-public:
- Annotable() : AnnotationList(0) {}
- ~Annotable();
-
- // getAnnotation - Search the list for annotations of the specified ID. The
- // pointer returned is either null (if no annotations of the specified ID
- // exist), or it points to the first element of a potentially list of elements
- // with identical ID #'s.
- //
- Annotation *getAnnotation(AnnotationID ID) const {
- for (Annotation *A = AnnotationList; A; A = A->getNext())
- if (A->getID() == ID) return A;
- return 0;
- }
-
- // getOrCreateAnnotation - Search through the annotation list, if there is
- // no annotation with the specified ID, then use the AnnotationManager to
- // create one.
- //
- inline Annotation *getOrCreateAnnotation(AnnotationID ID) const;
-
- // addAnnotation - Insert the annotation into the list in a sorted location.
- //
- void addAnnotation(Annotation *A) const {
- assert(A->Next == 0 && "Annotation already in list?!?");
-
- Annotation **AL = &AnnotationList;
- while (*AL && (*AL)->ID < A->getID()) // Find where to insert annotation
- AL = &((*AL)->Next);
- A->Next = *AL; // Link the annotation in
- *AL = A;
- }
-
- // unlinkAnnotation - Remove the first annotation of the specified ID... and
- // then return the unlinked annotation. The annotation object is not deleted.
- //
- inline Annotation *unlinkAnnotation(AnnotationID ID) const {
- for (Annotation **A = &AnnotationList; *A; A = &((*A)->Next))
- if ((*A)->getID() == ID) {
- Annotation *Ret = *A;
- *A = Ret->Next;
- Ret->Next = 0;
- return Ret;
- }
- return 0;
- }
-
- // deleteAnnotation - Delete the first annotation of the specified ID in the
- // list. Unlink unlinkAnnotation, this actually deletes the annotation object
- //
- bool deleteAnnotation(AnnotationID ID) const {
- Annotation *A = unlinkAnnotation(ID);
- delete A;
- return A != 0;
- }
-};
-
-
-//===----------------------------------------------------------------------===//
-//
-// AnnotationManager - This class is primarily responsible for maintaining a
-// one-to-one mapping between string Annotation names and Annotation ID numbers.
-//
-// Compared to the rest of the Annotation system, these mapping methods are
-// relatively slow, so they should be avoided by locally caching Annotation
-// ID #'s. These methods are safe to call at any time, even by static ctors, so
-// they should be used by static ctors most of the time.
-//
-// This class also provides support for annotations that are created on demand
-// by the Annotable::getOrCreateAnnotation method. To get this to work, simply
-// register an annotation handler
-//
-struct AnnotationManager {
- typedef Annotation *(*Factory)(AnnotationID, const Annotable *, void*);
-
- //===--------------------------------------------------------------------===//
- // Basic ID <-> Name map functionality
-
- static AnnotationID getID(const std::string &Name); // Name -> ID
- static const std::string &getName(AnnotationID ID); // ID -> Name
-
- // getID - Name -> ID + registration of a factory function for demand driven
- // annotation support.
- static AnnotationID getID(const std::string &Name, Factory Fact,
- void *Data = 0);
-
- //===--------------------------------------------------------------------===//
- // Annotation creation on demand support...
-
- // registerAnnotationFactory - This method is used to register a callback
- // function used to create an annotation on demand if it is needed by the
- // Annotable::getOrCreateAnnotation method.
- //
- static void registerAnnotationFactory(AnnotationID ID, Factory Func,
- void *ExtraData = 0);
-
- // createAnnotation - Create an annotation of the specified ID for the
- // specified object, using a register annotation creation function.
- //
- static Annotation *createAnnotation(AnnotationID ID, const Annotable *Obj);
-};
-
-
-
-// getOrCreateAnnotation - Search through the annotation list, if there is
-// no annotation with the specified ID, then use the AnnotationManager to
-// create one.
-//
-inline Annotation *Annotable::getOrCreateAnnotation(AnnotationID ID) const {
- Annotation *A = getAnnotation(ID); // Fast path, check for preexisting ann
- if (A) return A;
-
- // No annotation found, ask the annotation manager to create an annotation...
- A = AnnotationManager::createAnnotation(ID, this);
- assert(A && "AnnotationManager could not create annotation!");
- addAnnotation(A);
- return A;
-}
-
-} // End namespace llvm
-
-#endif
diff --git a/release_23/include/llvm/Support/CFG.h b/release_23/include/llvm/Support/CFG.h
deleted file mode 100644
index 0d49aecb097b..000000000000
--- a/release_23/include/llvm/Support/CFG.h
+++ /dev/null
@@ -1,265 +0,0 @@
-//===-- llvm/Support/CFG.h - Process LLVM structures as graphs --*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines specializations of GraphTraits that allow Function and
-// BasicBlock graphs to be treated as proper graphs for generic algorithms.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_SUPPORT_CFG_H
-#define LLVM_SUPPORT_CFG_H
-
-#include "llvm/ADT/GraphTraits.h"
-#include "llvm/Function.h"
-#include "llvm/InstrTypes.h"
-#include "llvm/ADT/iterator"
-
-namespace llvm {
-
-//===--------------------------------------------------------------------===//
-// BasicBlock pred_iterator definition
-//===--------------------------------------------------------------------===//
-
-template <class _Ptr, class _USE_iterator> // Predecessor Iterator
-class PredIterator : public forward_iterator<_Ptr, ptrdiff_t> {
- typedef forward_iterator<_Ptr, ptrdiff_t> super;
- _USE_iterator It;
-public:
- typedef PredIterator<_Ptr,_USE_iterator> _Self;
- typedef typename super::pointer pointer;
-
- inline void advancePastNonTerminators() {
- // Loop to ignore non terminator uses (for example PHI nodes)...
- while (!It.atEnd() && !isa<TerminatorInst>(*It))
- ++It;
- }
-
- inline PredIterator(_Ptr *bb) : It(bb->use_begin()) {
- advancePastNonTerminators();
- }
- inline PredIterator(_Ptr *bb, bool) : It(bb->use_end()) {}
-
- inline bool operator==(const _Self& x) const { return It == x.It; }
- inline bool operator!=(const _Self& x) const { return !operator==(x); }
-
- inline pointer operator*() const {
- assert(!It.atEnd() && "pred_iterator out of range!");
- return cast<TerminatorInst>(*It)->getParent();
- }
- inline pointer *operator->() const { return &(operator*()); }
-
- inline _Self& operator++() { // Preincrement
- assert(!It.atEnd() && "pred_iterator out of range!");
- ++It; advancePastNonTerminators();
- return *this;
- }
-
- inline _Self operator++(int) { // Postincrement
- _Self tmp = *this; ++*this; return tmp;
- }
-};
-
-typedef PredIterator<BasicBlock, Value::use_iterator> pred_iterator;
-typedef PredIterator<const BasicBlock,
- Value::use_const_iterator> pred_const_iterator;
-
-inline pred_iterator pred_begin(BasicBlock *BB) { return pred_iterator(BB); }
-inline pred_const_iterator pred_begin(const BasicBlock *BB) {
- return pred_const_iterator(BB);
-}
-inline pred_iterator pred_end(BasicBlock *BB) { return pred_iterator(BB, true);}
-inline pred_const_iterator pred_end(const BasicBlock *BB) {
- return pred_const_iterator(BB, true);
-}
-
-
-
-//===--------------------------------------------------------------------===//
-// BasicBlock succ_iterator definition
-//===--------------------------------------------------------------------===//
-
-template <class Term_, class BB_> // Successor Iterator
-class SuccIterator : public bidirectional_iterator<BB_, ptrdiff_t> {
- const Term_ Term;
- unsigned idx;
- typedef bidirectional_iterator<BB_, ptrdiff_t> super;
-public:
- typedef SuccIterator<Term_, BB_> _Self;
- typedef typename super::pointer pointer;
- // TODO: This can be random access iterator, need operator+ and stuff tho
-
- inline SuccIterator(Term_ T) : Term(T), idx(0) { // begin iterator
- assert(T && "getTerminator returned null!");
- }
- inline SuccIterator(Term_ T, bool) // end iterator
- : Term(T), idx(Term->getNumSuccessors()) {
- assert(T && "getTerminator returned null!");
- }
-
- inline const _Self &operator=(const _Self &I) {
- assert(Term == I.Term &&"Cannot assign iterators to two different blocks!");
- idx = I.idx;
- return *this;
- }
-
- /// getSuccessorIndex - This is used to interface between code that wants to
- /// operate on terminator instructions directly.
- unsigned getSuccessorIndex() const { return idx; }
-
- inline bool operator==(const _Self& x) const { return idx == x.idx; }
- inline bool operator!=(const _Self& x) const { return !operator==(x); }
-
- inline pointer operator*() const { return Term->getSuccessor(idx); }
- inline pointer operator->() const { return operator*(); }
-
- inline _Self& operator++() { ++idx; return *this; } // Preincrement
- inline _Self operator++(int) { // Postincrement
- _Self tmp = *this; ++*this; return tmp;
- }
-
- inline _Self& operator--() { --idx; return *this; } // Predecrement
- inline _Self operator--(int) { // Postdecrement
- _Self tmp = *this; --*this; return tmp;
- }
-};
-
-typedef SuccIterator<TerminatorInst*, BasicBlock> succ_iterator;
-typedef SuccIterator<const TerminatorInst*,
- const BasicBlock> succ_const_iterator;
-
-inline succ_iterator succ_begin(BasicBlock *BB) {
- return succ_iterator(BB->getTerminator());
-}
-inline succ_const_iterator succ_begin(const BasicBlock *BB) {
- return succ_const_iterator(BB->getTerminator());
-}
-inline succ_iterator succ_end(BasicBlock *BB) {
- return succ_iterator(BB->getTerminator(), true);
-}
-inline succ_const_iterator succ_end(const BasicBlock *BB) {
- return succ_const_iterator(BB->getTerminator(), true);
-}
-
-
-
-//===--------------------------------------------------------------------===//
-// GraphTraits specializations for basic block graphs (CFGs)
-//===--------------------------------------------------------------------===//
-
-// Provide specializations of GraphTraits to be able to treat a function as a
-// graph of basic blocks...
-
-template <> struct GraphTraits<BasicBlock*> {
- typedef BasicBlock NodeType;
- typedef succ_iterator ChildIteratorType;
-
- static NodeType *getEntryNode(BasicBlock *BB) { return BB; }
- static inline ChildIteratorType child_begin(NodeType *N) {
- return succ_begin(N);
- }
- static inline ChildIteratorType child_end(NodeType *N) {
- return succ_end(N);
- }
-};
-
-template <> struct GraphTraits<const BasicBlock*> {
- typedef const BasicBlock NodeType;
- typedef succ_const_iterator ChildIteratorType;
-
- static NodeType *getEntryNode(const BasicBlock *BB) { return BB; }
-
- static inline ChildIteratorType child_begin(NodeType *N) {
- return succ_begin(N);
- }
- static inline ChildIteratorType child_end(NodeType *N) {
- return succ_end(N);
- }
-};
-
-// Provide specializations of GraphTraits to be able to treat a function as a
-// graph of basic blocks... and to walk it in inverse order. Inverse order for
-// a function is considered to be when traversing the predecessor edges of a BB
-// instead of the successor edges.
-//
-template <> struct GraphTraits<Inverse<BasicBlock*> > {
- typedef BasicBlock NodeType;
- typedef pred_iterator ChildIteratorType;
- static NodeType *getEntryNode(Inverse<BasicBlock *> G) { return G.Graph; }
- static inline ChildIteratorType child_begin(NodeType *N) {
- return pred_begin(N);
- }
- static inline ChildIteratorType child_end(NodeType *N) {
- return pred_end(N);
- }
-};
-
-template <> struct GraphTraits<Inverse<const BasicBlock*> > {
- typedef const BasicBlock NodeType;
- typedef pred_const_iterator ChildIteratorType;
- static NodeType *getEntryNode(Inverse<const BasicBlock*> G) {
- return G.Graph;
- }
- static inline ChildIteratorType child_begin(NodeType *N) {
- return pred_begin(N);
- }
- static inline ChildIteratorType child_end(NodeType *N) {
- return pred_end(N);
- }
-};
-
-
-
-//===--------------------------------------------------------------------===//
-// GraphTraits specializations for function basic block graphs (CFGs)
-//===--------------------------------------------------------------------===//
-
-// Provide specializations of GraphTraits to be able to treat a function as a
-// graph of basic blocks... these are the same as the basic block iterators,
-// except that the root node is implicitly the first node of the function.
-//
-template <> struct GraphTraits<Function*> : public GraphTraits<BasicBlock*> {
- static NodeType *getEntryNode(Function *F) { return &F->getEntryBlock(); }
-
- // nodes_iterator/begin/end - Allow iteration over all nodes in the graph
- typedef Function::iterator nodes_iterator;
- static nodes_iterator nodes_begin(Function *F) { return F->begin(); }
- static nodes_iterator nodes_end (Function *F) { return F->end(); }
-};
-template <> struct GraphTraits<const Function*> :
- public GraphTraits<const BasicBlock*> {
- static NodeType *getEntryNode(const Function *F) {return &F->getEntryBlock();}
-
- // nodes_iterator/begin/end - Allow iteration over all nodes in the graph
- typedef Function::const_iterator nodes_iterator;
- static nodes_iterator nodes_begin(const Function *F) { return F->begin(); }
- static nodes_iterator nodes_end (const Function *F) { return F->end(); }
-};
-
-
-// Provide specializations of GraphTraits to be able to treat a function as a
-// graph of basic blocks... and to walk it in inverse order. Inverse order for
-// a function is considered to be when traversing the predecessor edges of a BB
-// instead of the successor edges.
-//
-template <> struct GraphTraits<Inverse<Function*> > :
- public GraphTraits<Inverse<BasicBlock*> > {
- static NodeType *getEntryNode(Inverse<Function*> G) {
- return &G.Graph->getEntryBlock();
- }
-};
-template <> struct GraphTraits<Inverse<const Function*> > :
- public GraphTraits<Inverse<const BasicBlock*> > {
- static NodeType *getEntryNode(Inverse<const Function *> G) {
- return &G.Graph->getEntryBlock();
- }
-};
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/Support/CallSite.h b/release_23/include/llvm/Support/CallSite.h
deleted file mode 100644
index f118680d6fc8..000000000000
--- a/release_23/include/llvm/Support/CallSite.h
+++ /dev/null
@@ -1,158 +0,0 @@
-//===-- llvm/Support/CallSite.h - Abstract Call & Invoke instrs -*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines the CallSite class, which is a handy wrapper for code that
-// wants to treat Call and Invoke instructions in a generic way.
-//
-// NOTE: This class is supposed to have "value semantics". So it should be
-// passed by value, not by reference; it should not be "new"ed or "delete"d. It
-// is efficiently copyable, assignable and constructable, with cost equivalent
-// to copying a pointer (notice that it has only a single data member).
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_SUPPORT_CALLSITE_H
-#define LLVM_SUPPORT_CALLSITE_H
-
-#include "llvm/Instruction.h"
-#include "llvm/BasicBlock.h"
-#include "llvm/ParameterAttributes.h"
-
-namespace llvm {
-
-class CallInst;
-class InvokeInst;
-
-class CallSite {
- Instruction *I;
-public:
- CallSite() : I(0) {}
- CallSite(CallInst *CI) : I(reinterpret_cast<Instruction*>(CI)) {}
- CallSite(InvokeInst *II) : I(reinterpret_cast<Instruction*>(II)) {}
- CallSite(Instruction *C);
- CallSite(const CallSite &CS) : I(CS.I) {}
- CallSite &operator=(const CallSite &CS) { I = CS.I; return *this; }
-
- bool operator==(const CallSite &CS) const { return I == CS.I; }
- bool operator!=(const CallSite &CS) const { return I != CS.I; }
-
- /// CallSite::get - This static method is sort of like a constructor. It will
- /// create an appropriate call site for a Call or Invoke instruction, but it
- /// can also create a null initialized CallSite object for something which is
- /// NOT a call site.
- ///
- static CallSite get(Value *V) {
- if (Instruction *I = dyn_cast<Instruction>(V)) {
- if (I->getOpcode() == Instruction::Call)
- return CallSite(reinterpret_cast<CallInst*>(I));
- else if (I->getOpcode() == Instruction::Invoke)
- return CallSite(reinterpret_cast<InvokeInst*>(I));
- }
- return CallSite();
- }
-
- /// getCallingConv/setCallingConv - get or set the calling convention of the
- /// call.
- unsigned getCallingConv() const;
- void setCallingConv(unsigned CC);
-
- /// getParamAttrs/setParamAttrs - get or set the parameter attributes of
- /// the call.
- const PAListPtr &getParamAttrs() const;
- void setParamAttrs(const PAListPtr &PAL);
-
- /// paramHasAttr - whether the call or the callee has the given attribute.
- bool paramHasAttr(uint16_t i, ParameterAttributes attr) const;
-
- /// @brief Extract the alignment for a call or parameter (0=unknown).
- uint16_t getParamAlignment(uint16_t i) const;
-
- /// @brief Determine if the call does not access memory.
- bool doesNotAccessMemory() const;
-
- /// @brief Determine if the call does not access or only reads memory.
- bool onlyReadsMemory() const;
-
- /// @brief Determine if the call cannot unwind.
- bool doesNotThrow() const;
- void setDoesNotThrow(bool doesNotThrow = true);
-
- /// getType - Return the type of the instruction that generated this call site
- ///
- const Type *getType() const { return I->getType(); }
-
- /// getInstruction - Return the instruction this call site corresponds to
- ///
- Instruction *getInstruction() const { return I; }
-
- /// getCaller - Return the caller function for this call site
- ///
- Function *getCaller() const { return I->getParent()->getParent(); }
-
- /// getCalledValue - Return the pointer to function that is being called...
- ///
- Value *getCalledValue() const {
- assert(I && "Not a call or invoke instruction!");
- return I->getOperand(0);
- }
-
- /// getCalledFunction - Return the function being called if this is a direct
- /// call, otherwise return null (if it's an indirect call).
- ///
- Function *getCalledFunction() const {
- return dyn_cast<Function>(getCalledValue());
- }
-
- /// setCalledFunction - Set the callee to the specified value...
- ///
- void setCalledFunction(Value *V) {
- assert(I && "Not a call or invoke instruction!");
- I->setOperand(0, V);
- }
-
- Value *getArgument(unsigned ArgNo) const {
- assert(arg_begin() + ArgNo < arg_end() && "Argument # out of range!");
- return *(arg_begin()+ArgNo);
- }
-
- void setArgument(unsigned ArgNo, Value* newVal) {
- assert(I && "Not a call or invoke instruction!");
- assert(arg_begin() + ArgNo < arg_end() && "Argument # out of range!");
- if (I->getOpcode() == Instruction::Call)
- I->setOperand(ArgNo+1, newVal); // Skip Function
- else
- I->setOperand(ArgNo+3, newVal); // Skip Function, BB, BB
- }
-
- /// arg_iterator - The type of iterator to use when looping over actual
- /// arguments at this call site...
- typedef User::op_iterator arg_iterator;
-
- /// arg_begin/arg_end - Return iterators corresponding to the actual argument
- /// list for a call site.
- ///
- arg_iterator arg_begin() const {
- assert(I && "Not a call or invoke instruction!");
- if (I->getOpcode() == Instruction::Call)
- return I->op_begin()+1; // Skip Function
- else
- return I->op_begin()+3; // Skip Function, BB, BB
- }
- arg_iterator arg_end() const { return I->op_end(); }
- bool arg_empty() const { return arg_end() == arg_begin(); }
- unsigned arg_size() const { return unsigned(arg_end() - arg_begin()); }
-
- bool operator<(const CallSite &CS) const {
- return getInstruction() < CS.getInstruction();
- }
-};
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/Support/Casting.h b/release_23/include/llvm/Support/Casting.h
deleted file mode 100644
index 61b91343cb90..000000000000
--- a/release_23/include/llvm/Support/Casting.h
+++ /dev/null
@@ -1,303 +0,0 @@
-//===-- llvm/Support/Casting.h - Allow flexible, checked, casts -*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines the isa<X>(), cast<X>(), dyn_cast<X>(), cast_or_null<X>(),
-// and dyn_cast_or_null<X>() templates.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_SUPPORT_CASTING_H
-#define LLVM_SUPPORT_CASTING_H
-
-#include <cassert>
-
-namespace llvm {
-
-//===----------------------------------------------------------------------===//
-// isa<x> Support Templates
-//===----------------------------------------------------------------------===//
-
-template<typename FromCl> struct isa_impl_cl;
-
-// Define a template that can be specialized by smart pointers to reflect the
-// fact that they are automatically dereferenced, and are not involved with the
-// template selection process... the default implementation is a noop.
-//
-template<typename From> struct simplify_type {
- typedef From SimpleType; // The real type this represents...
-
- // An accessor to get the real value...
- static SimpleType &getSimplifiedValue(From &Val) { return Val; }
-};
-
-template<typename From> struct simplify_type<const From> {
- typedef const From SimpleType;
- static SimpleType &getSimplifiedValue(const From &Val) {
- return simplify_type<From>::getSimplifiedValue(static_cast<From&>(Val));
- }
-};
-
-
-// isa<X> - Return true if the parameter to the template is an instance of the
-// template type argument. Used like this:
-//
-// if (isa<Type*>(myVal)) { ... }
-//
-template <typename To, typename From>
-inline bool isa_impl(const From &Val) {
- return To::classof(&Val);
-}
-
-template<typename To, typename From, typename SimpleType>
-struct isa_impl_wrap {
- // When From != SimplifiedType, we can simplify the type some more by using
- // the simplify_type template.
- static bool doit(const From &Val) {
- return isa_impl_cl<const SimpleType>::template
- isa<To>(simplify_type<const From>::getSimplifiedValue(Val));
- }
-};
-
-template<typename To, typename FromTy>
-struct isa_impl_wrap<To, const FromTy, const FromTy> {
- // When From == SimpleType, we are as simple as we are going to get.
- static bool doit(const FromTy &Val) {
- return isa_impl<To,FromTy>(Val);
- }
-};
-
-// isa_impl_cl - Use class partial specialization to transform types to a single
-// canonical form for isa_impl.
-//
-template<typename FromCl>
-struct isa_impl_cl {
- template<class ToCl>
- static bool isa(const FromCl &Val) {
- return isa_impl_wrap<ToCl,const FromCl,
- typename simplify_type<const FromCl>::SimpleType>::doit(Val);
- }
-};
-
-// Specialization used to strip const qualifiers off of the FromCl type...
-template<typename FromCl>
-struct isa_impl_cl<const FromCl> {
- template<class ToCl>
- static bool isa(const FromCl &Val) {
- return isa_impl_cl<FromCl>::template isa<ToCl>(Val);
- }
-};
-
-// Define pointer traits in terms of base traits...
-template<class FromCl>
-struct isa_impl_cl<FromCl*> {
- template<class ToCl>
- static bool isa(FromCl *Val) {
- return isa_impl_cl<FromCl>::template isa<ToCl>(*Val);
- }
-};
-
-// Define reference traits in terms of base traits...
-template<class FromCl>
-struct isa_impl_cl<FromCl&> {
- template<class ToCl>
- static bool isa(FromCl &Val) {
- return isa_impl_cl<FromCl>::template isa<ToCl>(&Val);
- }
-};
-
-template <class X, class Y>
-inline bool isa(const Y &Val) {
- return isa_impl_cl<Y>::template isa<X>(Val);
-}
-
-//===----------------------------------------------------------------------===//
-// cast<x> Support Templates
-//===----------------------------------------------------------------------===//
-
-template<class To, class From> struct cast_retty;
-
-
-// Calculate what type the 'cast' function should return, based on a requested
-// type of To and a source type of From.
-template<class To, class From> struct cast_retty_impl {
- typedef To& ret_type; // Normal case, return Ty&
-};
-template<class To, class From> struct cast_retty_impl<To, const From> {
- typedef const To &ret_type; // Normal case, return Ty&
-};
-
-template<class To, class From> struct cast_retty_impl<To, From*> {
- typedef To* ret_type; // Pointer arg case, return Ty*
-};
-
-template<class To, class From> struct cast_retty_impl<To, const From*> {
- typedef const To* ret_type; // Constant pointer arg case, return const Ty*
-};
-
-template<class To, class From> struct cast_retty_impl<To, const From*const> {
- typedef const To* ret_type; // Constant pointer arg case, return const Ty*
-};
-
-
-template<class To, class From, class SimpleFrom>
-struct cast_retty_wrap {
- // When the simplified type and the from type are not the same, use the type
- // simplifier to reduce the type, then reuse cast_retty_impl to get the
- // resultant type.
- typedef typename cast_retty<To, SimpleFrom>::ret_type ret_type;
-};
-
-template<class To, class FromTy>
-struct cast_retty_wrap<To, FromTy, FromTy> {
- // When the simplified type is equal to the from type, use it directly.
- typedef typename cast_retty_impl<To,FromTy>::ret_type ret_type;
-};
-
-template<class To, class From>
-struct cast_retty {
- typedef typename cast_retty_wrap<To, From,
- typename simplify_type<From>::SimpleType>::ret_type ret_type;
-};
-
-// Ensure the non-simple values are converted using the simplify_type template
-// that may be specialized by smart pointers...
-//
-template<class To, class From, class SimpleFrom> struct cast_convert_val {
- // This is not a simple type, use the template to simplify it...
- static typename cast_retty<To, From>::ret_type doit(const From &Val) {
- return cast_convert_val<To, SimpleFrom,
- typename simplify_type<SimpleFrom>::SimpleType>::doit(
- simplify_type<From>::getSimplifiedValue(Val));
- }
-};
-
-template<class To, class FromTy> struct cast_convert_val<To,FromTy,FromTy> {
- // This _is_ a simple type, just cast it.
- static typename cast_retty<To, FromTy>::ret_type doit(const FromTy &Val) {
- return reinterpret_cast<typename cast_retty<To, FromTy>::ret_type>(
- const_cast<FromTy&>(Val));
- }
-};
-
-
-
-// cast<X> - Return the argument parameter cast to the specified type. This
-// casting operator asserts that the type is correct, so it does not return null
-// on failure. But it will correctly return NULL when the input is NULL.
-// Used Like this:
-//
-// cast<Instruction>(myVal)->getParent()
-//
-template <class X, class Y>
-inline typename cast_retty<X, Y>::ret_type cast(const Y &Val) {
- assert(isa<X>(Val) && "cast<Ty>() argument of incompatible type!");
- return cast_convert_val<X, Y,
- typename simplify_type<Y>::SimpleType>::doit(Val);
-}
-
-// cast_or_null<X> - Functionally identical to cast, except that a null value is
-// accepted.
-//
-template <class X, class Y>
-inline typename cast_retty<X, Y*>::ret_type cast_or_null(Y *Val) {
- if (Val == 0) return 0;
- assert(isa<X>(Val) && "cast_or_null<Ty>() argument of incompatible type!");
- return cast<X>(Val);
-}
-
-
-// dyn_cast<X> - Return the argument parameter cast to the specified type. This
-// casting operator returns null if the argument is of the wrong type, so it can
-// be used to test for a type as well as cast if successful. This should be
-// used in the context of an if statement like this:
-//
-// if (const Instruction *I = dyn_cast<Instruction>(myVal)) { ... }
-//
-
-template <class X, class Y>
-inline typename cast_retty<X, Y>::ret_type dyn_cast(const Y &Val) {
- return isa<X>(Val) ? cast<X, Y>(Val) : 0;
-}
-
-// dyn_cast_or_null<X> - Functionally identical to dyn_cast, except that a null
-// value is accepted.
-//
-template <class X, class Y>
-inline typename cast_retty<X, Y>::ret_type dyn_cast_or_null(const Y &Val) {
- return (Val && isa<X>(Val)) ? cast<X, Y>(Val) : 0;
-}
-
-
-#ifdef DEBUG_CAST_OPERATORS
-#include "llvm/Support/Debug.h"
-
-struct bar {
- bar() {}
-private:
- bar(const bar &);
-};
-struct foo {
- void ext() const;
- /* static bool classof(const bar *X) {
- cerr << "Classof: " << X << "\n";
- return true;
- }*/
-};
-
-template <> inline bool isa_impl<foo,bar>(const bar &Val) {
- cerr << "Classof: " << &Val << "\n";
- return true;
-}
-
-
-bar *fub();
-void test(bar &B1, const bar *B2) {
- // test various configurations of const
- const bar &B3 = B1;
- const bar *const B4 = B2;
-
- // test isa
- if (!isa<foo>(B1)) return;
- if (!isa<foo>(B2)) return;
- if (!isa<foo>(B3)) return;
- if (!isa<foo>(B4)) return;
-
- // test cast
- foo &F1 = cast<foo>(B1);
- const foo *F3 = cast<foo>(B2);
- const foo *F4 = cast<foo>(B2);
- const foo &F8 = cast<foo>(B3);
- const foo *F9 = cast<foo>(B4);
- foo *F10 = cast<foo>(fub());
-
- // test cast_or_null
- const foo *F11 = cast_or_null<foo>(B2);
- const foo *F12 = cast_or_null<foo>(B2);
- const foo *F13 = cast_or_null<foo>(B4);
- const foo *F14 = cast_or_null<foo>(fub()); // Shouldn't print.
-
- // These lines are errors...
- //foo *F20 = cast<foo>(B2); // Yields const foo*
- //foo &F21 = cast<foo>(B3); // Yields const foo&
- //foo *F22 = cast<foo>(B4); // Yields const foo*
- //foo &F23 = cast_or_null<foo>(B1);
- //const foo &F24 = cast_or_null<foo>(B3);
-}
-
-bar *fub() { return 0; }
-void main() {
- bar B;
- test(B, &B);
-}
-
-#endif
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/Support/CommandLine.h b/release_23/include/llvm/Support/CommandLine.h
deleted file mode 100644
index f4db8c4bf8fe..000000000000
--- a/release_23/include/llvm/Support/CommandLine.h
+++ /dev/null
@@ -1,1336 +0,0 @@
-//===- llvm/Support/CommandLine.h - Command line handler --------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This class implements a command line argument processor that is useful when
-// creating a tool. It provides a simple, minimalistic interface that is easily
-// extensible and supports nonlocal (library) command line options.
-//
-// Note that rather than trying to figure out what this code does, you should
-// read the library documentation located in docs/CommandLine.html or looks at
-// the many example usages in tools/*/*.cpp
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_SUPPORT_COMMANDLINE_H
-#define LLVM_SUPPORT_COMMANDLINE_H
-
-#include "llvm/Support/type_traits.h"
-#include "llvm/Support/DataTypes.h"
-#include "llvm/Support/Compiler.h"
-#include "llvm/ADT/SmallVector.h"
-#include <string>
-#include <vector>
-#include <utility>
-#include <cstdarg>
-#include <cassert>
-
-namespace llvm {
-
-/// cl Namespace - This namespace contains all of the command line option
-/// processing machinery. It is intentionally a short name to make qualified
-/// usage concise.
-namespace cl {
-
-//===----------------------------------------------------------------------===//
-// ParseCommandLineOptions - Command line option processing entry point.
-//
-void ParseCommandLineOptions(int argc, char **argv,
- const char *Overview = 0,
- bool ReadResponseFiles = false);
-
-//===----------------------------------------------------------------------===//
-// ParseEnvironmentOptions - Environment variable option processing alternate
-// entry point.
-//
-void ParseEnvironmentOptions(const char *progName, const char *envvar,
- const char *Overview = 0,
- bool ReadResponseFiles = false);
-
-///===---------------------------------------------------------------------===//
-/// SetVersionPrinter - Override the default (LLVM specific) version printer
-/// used to print out the version when --version is given
-/// on the command line. This allows other systems using the
-/// CommandLine utilities to print their own version string.
-void SetVersionPrinter(void (*func)());
-
-
-// MarkOptionsChanged - Internal helper function.
-void MarkOptionsChanged();
-
-//===----------------------------------------------------------------------===//
-// Flags permitted to be passed to command line arguments
-//
-
-enum NumOccurrences { // Flags for the number of occurrences allowed
- Optional = 0x01, // Zero or One occurrence
- ZeroOrMore = 0x02, // Zero or more occurrences allowed
- Required = 0x03, // One occurrence required
- OneOrMore = 0x04, // One or more occurrences required
-
- // ConsumeAfter - Indicates that this option is fed anything that follows the
- // last positional argument required by the application (it is an error if
- // there are zero positional arguments, and a ConsumeAfter option is used).
- // Thus, for example, all arguments to LLI are processed until a filename is
- // found. Once a filename is found, all of the succeeding arguments are
- // passed, unprocessed, to the ConsumeAfter option.
- //
- ConsumeAfter = 0x05,
-
- OccurrencesMask = 0x07
-};
-
-enum ValueExpected { // Is a value required for the option?
- ValueOptional = 0x08, // The value can appear... or not
- ValueRequired = 0x10, // The value is required to appear!
- ValueDisallowed = 0x18, // A value may not be specified (for flags)
- ValueMask = 0x18
-};
-
-enum OptionHidden { // Control whether -help shows this option
- NotHidden = 0x20, // Option included in --help & --help-hidden
- Hidden = 0x40, // -help doesn't, but --help-hidden does
- ReallyHidden = 0x60, // Neither --help nor --help-hidden show this arg
- HiddenMask = 0x60
-};
-
-// Formatting flags - This controls special features that the option might have
-// that cause it to be parsed differently...
-//
-// Prefix - This option allows arguments that are otherwise unrecognized to be
-// matched by options that are a prefix of the actual value. This is useful for
-// cases like a linker, where options are typically of the form '-lfoo' or
-// '-L../../include' where -l or -L are the actual flags. When prefix is
-// enabled, and used, the value for the flag comes from the suffix of the
-// argument.
-//
-// Grouping - With this option enabled, multiple letter options are allowed to
-// bunch together with only a single hyphen for the whole group. This allows
-// emulation of the behavior that ls uses for example: ls -la === ls -l -a
-//
-
-enum FormattingFlags {
- NormalFormatting = 0x000, // Nothing special
- Positional = 0x080, // Is a positional argument, no '-' required
- Prefix = 0x100, // Can this option directly prefix its value?
- Grouping = 0x180, // Can this option group with other options?
- FormattingMask = 0x180 // Union of the above flags.
-};
-
-enum MiscFlags { // Miscellaneous flags to adjust argument
- CommaSeparated = 0x200, // Should this cl::list split between commas?
- PositionalEatsArgs = 0x400, // Should this positional cl::list eat -args?
- Sink = 0x800, // Should this cl::list eat all unknown options?
- MiscMask = 0xE00 // Union of the above flags.
-};
-
-
-
-//===----------------------------------------------------------------------===//
-// Option Base class
-//
-class alias;
-class Option {
- friend class alias;
-
- // handleOccurrences - Overriden by subclasses to handle the value passed into
- // an argument. Should return true if there was an error processing the
- // argument and the program should exit.
- //
- virtual bool handleOccurrence(unsigned pos, const char *ArgName,
- const std::string &Arg) = 0;
-
- virtual enum ValueExpected getValueExpectedFlagDefault() const {
- return ValueOptional;
- }
-
- // Out of line virtual function to provide home for the class.
- virtual void anchor();
-
- int NumOccurrences; // The number of times specified
- int Flags; // Flags for the argument
- unsigned Position; // Position of last occurrence of the option
- Option *NextRegistered; // Singly linked list of registered options.
-public:
- const char *ArgStr; // The argument string itself (ex: "help", "o")
- const char *HelpStr; // The descriptive text message for --help
- const char *ValueStr; // String describing what the value of this option is
-
- inline enum NumOccurrences getNumOccurrencesFlag() const {
- return static_cast<enum NumOccurrences>(Flags & OccurrencesMask);
- }
- inline enum ValueExpected getValueExpectedFlag() const {
- int VE = Flags & ValueMask;
- return VE ? static_cast<enum ValueExpected>(VE)
- : getValueExpectedFlagDefault();
- }
- inline enum OptionHidden getOptionHiddenFlag() const {
- return static_cast<enum OptionHidden>(Flags & HiddenMask);
- }
- inline enum FormattingFlags getFormattingFlag() const {
- return static_cast<enum FormattingFlags>(Flags & FormattingMask);
- }
- inline unsigned getMiscFlags() const {
- return Flags & MiscMask;
- }
- inline unsigned getPosition() const { return Position; }
-
- // hasArgStr - Return true if the argstr != ""
- bool hasArgStr() const { return ArgStr[0] != 0; }
-
- //-------------------------------------------------------------------------===
- // Accessor functions set by OptionModifiers
- //
- void setArgStr(const char *S) { ArgStr = S; }
- void setDescription(const char *S) { HelpStr = S; }
- void setValueStr(const char *S) { ValueStr = S; }
-
- void setFlag(unsigned Flag, unsigned FlagMask) {
- Flags &= ~FlagMask;
- Flags |= Flag;
- }
-
- void setNumOccurrencesFlag(enum NumOccurrences Val) {
- setFlag(Val, OccurrencesMask);
- }
- void setValueExpectedFlag(enum ValueExpected Val) { setFlag(Val, ValueMask); }
- void setHiddenFlag(enum OptionHidden Val) { setFlag(Val, HiddenMask); }
- void setFormattingFlag(enum FormattingFlags V) { setFlag(V, FormattingMask); }
- void setMiscFlag(enum MiscFlags M) { setFlag(M, M); }
- void setPosition(unsigned pos) { Position = pos; }
-protected:
- explicit Option(unsigned DefaultFlags)
- : NumOccurrences(0), Flags(DefaultFlags | NormalFormatting), Position(0),
- NextRegistered(0), ArgStr(""), HelpStr(""), ValueStr("") {
- assert(getNumOccurrencesFlag() != 0 &&
- getOptionHiddenFlag() != 0 && "Not all default flags specified!");
- }
-
-public:
- // addArgument - Register this argument with the commandline system.
- //
- void addArgument();
-
- Option *getNextRegisteredOption() const { return NextRegistered; }
-
- // Return the width of the option tag for printing...
- virtual size_t getOptionWidth() const = 0;
-
- // printOptionInfo - Print out information about this option. The
- // to-be-maintained width is specified.
- //
- virtual void printOptionInfo(size_t GlobalWidth) const = 0;
-
- virtual void getExtraOptionNames(std::vector<const char*> &OptionNames) {}
-
- // addOccurrence - Wrapper around handleOccurrence that enforces Flags
- //
- bool addOccurrence(unsigned pos, const char *ArgName,
- const std::string &Value);
-
- // Prints option name followed by message. Always returns true.
- bool error(std::string Message, const char *ArgName = 0);
-
-public:
- inline int getNumOccurrences() const { return NumOccurrences; }
- virtual ~Option() {}
-};
-
-
-//===----------------------------------------------------------------------===//
-// Command line option modifiers that can be used to modify the behavior of
-// command line option parsers...
-//
-
-// desc - Modifier to set the description shown in the --help output...
-struct desc {
- const char *Desc;
- desc(const char *Str) : Desc(Str) {}
- void apply(Option &O) const { O.setDescription(Desc); }
-};
-
-// value_desc - Modifier to set the value description shown in the --help
-// output...
-struct value_desc {
- const char *Desc;
- value_desc(const char *Str) : Desc(Str) {}
- void apply(Option &O) const { O.setValueStr(Desc); }
-};
-
-// init - Specify a default (initial) value for the command line argument, if
-// the default constructor for the argument type does not give you what you
-// want. This is only valid on "opt" arguments, not on "list" arguments.
-//
-template<class Ty>
-struct initializer {
- const Ty &Init;
- initializer(const Ty &Val) : Init(Val) {}
-
- template<class Opt>
- void apply(Opt &O) const { O.setInitialValue(Init); }
-};
-
-template<class Ty>
-initializer<Ty> init(const Ty &Val) {
- return initializer<Ty>(Val);
-}
-
-
-// location - Allow the user to specify which external variable they want to
-// store the results of the command line argument processing into, if they don't
-// want to store it in the option itself.
-//
-template<class Ty>
-struct LocationClass {
- Ty &Loc;
- LocationClass(Ty &L) : Loc(L) {}
-
- template<class Opt>
- void apply(Opt &O) const { O.setLocation(O, Loc); }
-};
-
-template<class Ty>
-LocationClass<Ty> location(Ty &L) { return LocationClass<Ty>(L); }
-
-
-//===----------------------------------------------------------------------===//
-// Enum valued command line option
-//
-#define clEnumVal(ENUMVAL, DESC) #ENUMVAL, int(ENUMVAL), DESC
-#define clEnumValN(ENUMVAL, FLAGNAME, DESC) FLAGNAME, int(ENUMVAL), DESC
-#define clEnumValEnd (reinterpret_cast<void*>(0))
-
-// values - For custom data types, allow specifying a group of values together
-// as the values that go into the mapping that the option handler uses. Note
-// that the values list must always have a 0 at the end of the list to indicate
-// that the list has ended.
-//
-template<class DataType>
-class ValuesClass {
- // Use a vector instead of a map, because the lists should be short,
- // the overhead is less, and most importantly, it keeps them in the order
- // inserted so we can print our option out nicely.
- SmallVector<std::pair<const char *, std::pair<int, const char *> >,4> Values;
- void processValues(va_list Vals);
-public:
- ValuesClass(const char *EnumName, DataType Val, const char *Desc,
- va_list ValueArgs) {
- // Insert the first value, which is required.
- Values.push_back(std::make_pair(EnumName, std::make_pair(Val, Desc)));
-
- // Process the varargs portion of the values...
- while (const char *EnumName = va_arg(ValueArgs, const char *)) {
- DataType EnumVal = static_cast<DataType>(va_arg(ValueArgs, int));
- const char *EnumDesc = va_arg(ValueArgs, const char *);
- Values.push_back(std::make_pair(EnumName, // Add value to value map
- std::make_pair(EnumVal, EnumDesc)));
- }
- }
-
- template<class Opt>
- void apply(Opt &O) const {
- for (unsigned i = 0, e = static_cast<unsigned>(Values.size());
- i != e; ++i)
- O.getParser().addLiteralOption(Values[i].first, Values[i].second.first,
- Values[i].second.second);
- }
-};
-
-template<class DataType>
-ValuesClass<DataType> END_WITH_NULL values(const char *Arg, DataType Val,
- const char *Desc, ...) {
- va_list ValueArgs;
- va_start(ValueArgs, Desc);
- ValuesClass<DataType> Vals(Arg, Val, Desc, ValueArgs);
- va_end(ValueArgs);
- return Vals;
-}
-
-
-//===----------------------------------------------------------------------===//
-// parser class - Parameterizable parser for different data types. By default,
-// known data types (string, int, bool) have specialized parsers, that do what
-// you would expect. The default parser, used for data types that are not
-// built-in, uses a mapping table to map specific options to values, which is
-// used, among other things, to handle enum types.
-
-//--------------------------------------------------
-// generic_parser_base - This class holds all the non-generic code that we do
-// not need replicated for every instance of the generic parser. This also
-// allows us to put stuff into CommandLine.cpp
-//
-struct generic_parser_base {
- virtual ~generic_parser_base() {} // Base class should have virtual-dtor
-
- // getNumOptions - Virtual function implemented by generic subclass to
- // indicate how many entries are in Values.
- //
- virtual unsigned getNumOptions() const = 0;
-
- // getOption - Return option name N.
- virtual const char *getOption(unsigned N) const = 0;
-
- // getDescription - Return description N
- virtual const char *getDescription(unsigned N) const = 0;
-
- // Return the width of the option tag for printing...
- virtual size_t getOptionWidth(const Option &O) const;
-
- // printOptionInfo - Print out information about this option. The
- // to-be-maintained width is specified.
- //
- virtual void printOptionInfo(const Option &O, size_t GlobalWidth) const;
-
- void initialize(Option &O) {
- // All of the modifiers for the option have been processed by now, so the
- // argstr field should be stable, copy it down now.
- //
- hasArgStr = O.hasArgStr();
- }
-
- void getExtraOptionNames(std::vector<const char*> &OptionNames) {
- // If there has been no argstr specified, that means that we need to add an
- // argument for every possible option. This ensures that our options are
- // vectored to us.
- if (!hasArgStr)
- for (unsigned i = 0, e = getNumOptions(); i != e; ++i)
- OptionNames.push_back(getOption(i));
- }
-
-
- enum ValueExpected getValueExpectedFlagDefault() const {
- // If there is an ArgStr specified, then we are of the form:
- //
- // -opt=O2 or -opt O2 or -optO2
- //
- // In which case, the value is required. Otherwise if an arg str has not
- // been specified, we are of the form:
- //
- // -O2 or O2 or -la (where -l and -a are separate options)
- //
- // If this is the case, we cannot allow a value.
- //
- if (hasArgStr)
- return ValueRequired;
- else
- return ValueDisallowed;
- }
-
- // findOption - Return the option number corresponding to the specified
- // argument string. If the option is not found, getNumOptions() is returned.
- //
- unsigned findOption(const char *Name);
-
-protected:
- bool hasArgStr;
-};
-
-// Default parser implementation - This implementation depends on having a
-// mapping of recognized options to values of some sort. In addition to this,
-// each entry in the mapping also tracks a help message that is printed with the
-// command line option for --help. Because this is a simple mapping parser, the
-// data type can be any unsupported type.
-//
-template <class DataType>
-class parser : public generic_parser_base {
-protected:
- SmallVector<std::pair<const char *,
- std::pair<DataType, const char *> >, 8> Values;
-public:
- typedef DataType parser_data_type;
-
- // Implement virtual functions needed by generic_parser_base
- unsigned getNumOptions() const { return unsigned(Values.size()); }
- const char *getOption(unsigned N) const { return Values[N].first; }
- const char *getDescription(unsigned N) const {
- return Values[N].second.second;
- }
-
- // parse - Return true on error.
- bool parse(Option &O, const char *ArgName, const std::string &Arg,
- DataType &V) {
- std::string ArgVal;
- if (hasArgStr)
- ArgVal = Arg;
- else
- ArgVal = ArgName;
-
- for (unsigned i = 0, e = static_cast<unsigned>(Values.size());
- i != e; ++i)
- if (ArgVal == Values[i].first) {
- V = Values[i].second.first;
- return false;
- }
-
- return O.error(": Cannot find option named '" + ArgVal + "'!");
- }
-
- /// addLiteralOption - Add an entry to the mapping table.
- ///
- template <class DT>
- void addLiteralOption(const char *Name, const DT &V, const char *HelpStr) {
- assert(findOption(Name) == Values.size() && "Option already exists!");
- Values.push_back(std::make_pair(Name,
- std::make_pair(static_cast<DataType>(V),HelpStr)));
- MarkOptionsChanged();
- }
-
- /// removeLiteralOption - Remove the specified option.
- ///
- void removeLiteralOption(const char *Name) {
- unsigned N = findOption(Name);
- assert(N != Values.size() && "Option not found!");
- Values.erase(Values.begin()+N);
- }
-};
-
-//--------------------------------------------------
-// basic_parser - Super class of parsers to provide boilerplate code
-//
-struct basic_parser_impl { // non-template implementation of basic_parser<t>
- virtual ~basic_parser_impl() {}
-
- enum ValueExpected getValueExpectedFlagDefault() const {
- return ValueRequired;
- }
-
- void getExtraOptionNames(std::vector<const char*> &OptionNames) {}
-
- void initialize(Option &O) {}
-
- // Return the width of the option tag for printing...
- size_t getOptionWidth(const Option &O) const;
-
- // printOptionInfo - Print out information about this option. The
- // to-be-maintained width is specified.
- //
- void printOptionInfo(const Option &O, size_t GlobalWidth) const;
-
- // getValueName - Overload in subclass to provide a better default value.
- virtual const char *getValueName() const { return "value"; }
-
- // An out-of-line virtual method to provide a 'home' for this class.
- virtual void anchor();
-};
-
-// basic_parser - The real basic parser is just a template wrapper that provides
-// a typedef for the provided data type.
-//
-template<class DataType>
-struct basic_parser : public basic_parser_impl {
- typedef DataType parser_data_type;
-};
-
-//--------------------------------------------------
-// parser<bool>
-//
-template<>
-class parser<bool> : public basic_parser<bool> {
-public:
- // parse - Return true on error.
- bool parse(Option &O, const char *ArgName, const std::string &Arg, bool &Val);
-
- enum ValueExpected getValueExpectedFlagDefault() const {
- return ValueOptional;
- }
-
- // getValueName - Do not print =<value> at all.
- virtual const char *getValueName() const { return 0; }
-
- // An out-of-line virtual method to provide a 'home' for this class.
- virtual void anchor();
-};
-
-EXTERN_TEMPLATE_INSTANTIATION(class basic_parser<bool>);
-
-//--------------------------------------------------
-// parser<boolOrDefault>
-enum boolOrDefault { BOU_UNSET, BOU_TRUE, BOU_FALSE };
-template<>
-class parser<boolOrDefault> : public basic_parser<boolOrDefault> {
-public:
- // parse - Return true on error.
- bool parse(Option &O, const char *ArgName, const std::string &Arg,
- boolOrDefault &Val);
-
- enum ValueExpected getValueExpectedFlagDefault() const {
- return ValueOptional;
- }
-
- // getValueName - Do not print =<value> at all.
- virtual const char *getValueName() const { return 0; }
-
- // An out-of-line virtual method to provide a 'home' for this class.
- virtual void anchor();
-};
-
-EXTERN_TEMPLATE_INSTANTIATION(class basic_parser<boolOrDefault>);
-
-//--------------------------------------------------
-// parser<int>
-//
-template<>
-class parser<int> : public basic_parser<int> {
-public:
- // parse - Return true on error.
- bool parse(Option &O, const char *ArgName, const std::string &Arg, int &Val);
-
- // getValueName - Overload in subclass to provide a better default value.
- virtual const char *getValueName() const { return "int"; }
-
- // An out-of-line virtual method to provide a 'home' for this class.
- virtual void anchor();
-};
-
-EXTERN_TEMPLATE_INSTANTIATION(class basic_parser<int>);
-
-
-//--------------------------------------------------
-// parser<unsigned>
-//
-template<>
-class parser<unsigned> : public basic_parser<unsigned> {
-public:
- // parse - Return true on error.
- bool parse(Option &O, const char *AN, const std::string &Arg, unsigned &Val);
-
- // getValueName - Overload in subclass to provide a better default value.
- virtual const char *getValueName() const { return "uint"; }
-
- // An out-of-line virtual method to provide a 'home' for this class.
- virtual void anchor();
-};
-
-EXTERN_TEMPLATE_INSTANTIATION(class basic_parser<unsigned>);
-
-//--------------------------------------------------
-// parser<double>
-//
-template<>
-class parser<double> : public basic_parser<double> {
-public:
- // parse - Return true on error.
- bool parse(Option &O, const char *AN, const std::string &Arg, double &Val);
-
- // getValueName - Overload in subclass to provide a better default value.
- virtual const char *getValueName() const { return "number"; }
-
- // An out-of-line virtual method to provide a 'home' for this class.
- virtual void anchor();
-};
-
-EXTERN_TEMPLATE_INSTANTIATION(class basic_parser<double>);
-
-//--------------------------------------------------
-// parser<float>
-//
-template<>
-class parser<float> : public basic_parser<float> {
-public:
- // parse - Return true on error.
- bool parse(Option &O, const char *AN, const std::string &Arg, float &Val);
-
- // getValueName - Overload in subclass to provide a better default value.
- virtual const char *getValueName() const { return "number"; }
-
- // An out-of-line virtual method to provide a 'home' for this class.
- virtual void anchor();
-};
-
-EXTERN_TEMPLATE_INSTANTIATION(class basic_parser<float>);
-
-//--------------------------------------------------
-// parser<std::string>
-//
-template<>
-class parser<std::string> : public basic_parser<std::string> {
-public:
- // parse - Return true on error.
- bool parse(Option &O, const char *AN, const std::string &Arg,
- std::string &Value) {
- Value = Arg;
- return false;
- }
-
- // getValueName - Overload in subclass to provide a better default value.
- virtual const char *getValueName() const { return "string"; }
-
- // An out-of-line virtual method to provide a 'home' for this class.
- virtual void anchor();
-};
-
-EXTERN_TEMPLATE_INSTANTIATION(class basic_parser<std::string>);
-
-//===----------------------------------------------------------------------===//
-// applicator class - This class is used because we must use partial
-// specialization to handle literal string arguments specially (const char* does
-// not correctly respond to the apply method). Because the syntax to use this
-// is a pain, we have the 'apply' method below to handle the nastiness...
-//
-template<class Mod> struct applicator {
- template<class Opt>
- static void opt(const Mod &M, Opt &O) { M.apply(O); }
-};
-
-// Handle const char* as a special case...
-template<unsigned n> struct applicator<char[n]> {
- template<class Opt>
- static void opt(const char *Str, Opt &O) { O.setArgStr(Str); }
-};
-template<unsigned n> struct applicator<const char[n]> {
- template<class Opt>
- static void opt(const char *Str, Opt &O) { O.setArgStr(Str); }
-};
-template<> struct applicator<const char*> {
- template<class Opt>
- static void opt(const char *Str, Opt &O) { O.setArgStr(Str); }
-};
-
-template<> struct applicator<NumOccurrences> {
- static void opt(NumOccurrences NO, Option &O) { O.setNumOccurrencesFlag(NO); }
-};
-template<> struct applicator<ValueExpected> {
- static void opt(ValueExpected VE, Option &O) { O.setValueExpectedFlag(VE); }
-};
-template<> struct applicator<OptionHidden> {
- static void opt(OptionHidden OH, Option &O) { O.setHiddenFlag(OH); }
-};
-template<> struct applicator<FormattingFlags> {
- static void opt(FormattingFlags FF, Option &O) { O.setFormattingFlag(FF); }
-};
-template<> struct applicator<MiscFlags> {
- static void opt(MiscFlags MF, Option &O) { O.setMiscFlag(MF); }
-};
-
-// apply method - Apply a modifier to an option in a type safe way.
-template<class Mod, class Opt>
-void apply(const Mod &M, Opt *O) {
- applicator<Mod>::opt(M, *O);
-}
-
-
-//===----------------------------------------------------------------------===//
-// opt_storage class
-
-// Default storage class definition: external storage. This implementation
-// assumes the user will specify a variable to store the data into with the
-// cl::location(x) modifier.
-//
-template<class DataType, bool ExternalStorage, bool isClass>
-class opt_storage {
- DataType *Location; // Where to store the object...
-
- void check() {
- assert(Location != 0 && "cl::location(...) not specified for a command "
- "line option with external storage, "
- "or cl::init specified before cl::location()!!");
- }
-public:
- opt_storage() : Location(0) {}
-
- bool setLocation(Option &O, DataType &L) {
- if (Location)
- return O.error(": cl::location(x) specified more than once!");
- Location = &L;
- return false;
- }
-
- template<class T>
- void setValue(const T &V) {
- check();
- *Location = V;
- }
-
- DataType &getValue() { check(); return *Location; }
- const DataType &getValue() const { check(); return *Location; }
-};
-
-
-// Define how to hold a class type object, such as a string. Since we can
-// inherit from a class, we do so. This makes us exactly compatible with the
-// object in all cases that it is used.
-//
-template<class DataType>
-class opt_storage<DataType,false,true> : public DataType {
-public:
- template<class T>
- void setValue(const T &V) { DataType::operator=(V); }
-
- DataType &getValue() { return *this; }
- const DataType &getValue() const { return *this; }
-};
-
-// Define a partial specialization to handle things we cannot inherit from. In
-// this case, we store an instance through containment, and overload operators
-// to get at the value.
-//
-template<class DataType>
-class opt_storage<DataType, false, false> {
-public:
- DataType Value;
-
- // Make sure we initialize the value with the default constructor for the
- // type.
- opt_storage() : Value(DataType()) {}
-
- template<class T>
- void setValue(const T &V) { Value = V; }
- DataType &getValue() { return Value; }
- DataType getValue() const { return Value; }
-
- // If the datatype is a pointer, support -> on it.
- DataType operator->() const { return Value; }
-};
-
-
-//===----------------------------------------------------------------------===//
-// opt - A scalar command line option.
-//
-template <class DataType, bool ExternalStorage = false,
- class ParserClass = parser<DataType> >
-class opt : public Option,
- public opt_storage<DataType, ExternalStorage,
- is_class<DataType>::value> {
- ParserClass Parser;
-
- virtual bool handleOccurrence(unsigned pos, const char *ArgName,
- const std::string &Arg) {
- typename ParserClass::parser_data_type Val =
- typename ParserClass::parser_data_type();
- if (Parser.parse(*this, ArgName, Arg, Val))
- return true; // Parse error!
- setValue(Val);
- setPosition(pos);
- return false;
- }
-
- virtual enum ValueExpected getValueExpectedFlagDefault() const {
- return Parser.getValueExpectedFlagDefault();
- }
- virtual void getExtraOptionNames(std::vector<const char*> &OptionNames) {
- return Parser.getExtraOptionNames(OptionNames);
- }
-
- // Forward printing stuff to the parser...
- virtual size_t getOptionWidth() const {return Parser.getOptionWidth(*this);}
- virtual void printOptionInfo(size_t GlobalWidth) const {
- Parser.printOptionInfo(*this, GlobalWidth);
- }
-
- void done() {
- addArgument();
- Parser.initialize(*this);
- }
-public:
- // setInitialValue - Used by the cl::init modifier...
- void setInitialValue(const DataType &V) { this->setValue(V); }
-
- ParserClass &getParser() { return Parser; }
-
- operator DataType() const { return this->getValue(); }
-
- template<class T>
- DataType &operator=(const T &Val) {
- this->setValue(Val);
- return this->getValue();
- }
-
- // One option...
- template<class M0t>
- explicit opt(const M0t &M0) : Option(Optional | NotHidden) {
- apply(M0, this);
- done();
- }
-
- // Two options...
- template<class M0t, class M1t>
- opt(const M0t &M0, const M1t &M1) : Option(Optional | NotHidden) {
- apply(M0, this); apply(M1, this);
- done();
- }
-
- // Three options...
- template<class M0t, class M1t, class M2t>
- opt(const M0t &M0, const M1t &M1,
- const M2t &M2) : Option(Optional | NotHidden) {
- apply(M0, this); apply(M1, this); apply(M2, this);
- done();
- }
- // Four options...
- template<class M0t, class M1t, class M2t, class M3t>
- opt(const M0t &M0, const M1t &M1, const M2t &M2,
- const M3t &M3) : Option(Optional | NotHidden) {
- apply(M0, this); apply(M1, this); apply(M2, this); apply(M3, this);
- done();
- }
- // Five options...
- template<class M0t, class M1t, class M2t, class M3t, class M4t>
- opt(const M0t &M0, const M1t &M1, const M2t &M2, const M3t &M3,
- const M4t &M4) : Option(Optional | NotHidden) {
- apply(M0, this); apply(M1, this); apply(M2, this); apply(M3, this);
- apply(M4, this);
- done();
- }
- // Six options...
- template<class M0t, class M1t, class M2t, class M3t,
- class M4t, class M5t>
- opt(const M0t &M0, const M1t &M1, const M2t &M2, const M3t &M3,
- const M4t &M4, const M5t &M5) : Option(Optional | NotHidden) {
- apply(M0, this); apply(M1, this); apply(M2, this); apply(M3, this);
- apply(M4, this); apply(M5, this);
- done();
- }
- // Seven options...
- template<class M0t, class M1t, class M2t, class M3t,
- class M4t, class M5t, class M6t>
- opt(const M0t &M0, const M1t &M1, const M2t &M2, const M3t &M3,
- const M4t &M4, const M5t &M5,
- const M6t &M6) : Option(Optional | NotHidden) {
- apply(M0, this); apply(M1, this); apply(M2, this); apply(M3, this);
- apply(M4, this); apply(M5, this); apply(M6, this);
- done();
- }
- // Eight options...
- template<class M0t, class M1t, class M2t, class M3t,
- class M4t, class M5t, class M6t, class M7t>
- opt(const M0t &M0, const M1t &M1, const M2t &M2, const M3t &M3,
- const M4t &M4, const M5t &M5, const M6t &M6,
- const M7t &M7) : Option(Optional | NotHidden) {
- apply(M0, this); apply(M1, this); apply(M2, this); apply(M3, this);
- apply(M4, this); apply(M5, this); apply(M6, this); apply(M7, this);
- done();
- }
-};
-
-EXTERN_TEMPLATE_INSTANTIATION(class opt<unsigned>);
-EXTERN_TEMPLATE_INSTANTIATION(class opt<int>);
-EXTERN_TEMPLATE_INSTANTIATION(class opt<std::string>);
-EXTERN_TEMPLATE_INSTANTIATION(class opt<bool>);
-
-//===----------------------------------------------------------------------===//
-// list_storage class
-
-// Default storage class definition: external storage. This implementation
-// assumes the user will specify a variable to store the data into with the
-// cl::location(x) modifier.
-//
-template<class DataType, class StorageClass>
-class list_storage {
- StorageClass *Location; // Where to store the object...
-
-public:
- list_storage() : Location(0) {}
-
- bool setLocation(Option &O, StorageClass &L) {
- if (Location)
- return O.error(": cl::location(x) specified more than once!");
- Location = &L;
- return false;
- }
-
- template<class T>
- void addValue(const T &V) {
- assert(Location != 0 && "cl::location(...) not specified for a command "
- "line option with external storage!");
- Location->push_back(V);
- }
-};
-
-
-// Define how to hold a class type object, such as a string. Since we can
-// inherit from a class, we do so. This makes us exactly compatible with the
-// object in all cases that it is used.
-//
-template<class DataType>
-class list_storage<DataType, bool> : public std::vector<DataType> {
-public:
- template<class T>
- void addValue(const T &V) { push_back(V); }
-};
-
-
-//===----------------------------------------------------------------------===//
-// list - A list of command line options.
-//
-template <class DataType, class Storage = bool,
- class ParserClass = parser<DataType> >
-class list : public Option, public list_storage<DataType, Storage> {
- std::vector<unsigned> Positions;
- ParserClass Parser;
-
- virtual enum ValueExpected getValueExpectedFlagDefault() const {
- return Parser.getValueExpectedFlagDefault();
- }
- virtual void getExtraOptionNames(std::vector<const char*> &OptionNames) {
- return Parser.getExtraOptionNames(OptionNames);
- }
-
- virtual bool handleOccurrence(unsigned pos, const char *ArgName,
- const std::string &Arg) {
- typename ParserClass::parser_data_type Val =
- typename ParserClass::parser_data_type();
- if (Parser.parse(*this, ArgName, Arg, Val))
- return true; // Parse Error!
- addValue(Val);
- setPosition(pos);
- Positions.push_back(pos);
- return false;
- }
-
- // Forward printing stuff to the parser...
- virtual size_t getOptionWidth() const {return Parser.getOptionWidth(*this);}
- virtual void printOptionInfo(size_t GlobalWidth) const {
- Parser.printOptionInfo(*this, GlobalWidth);
- }
-
- void done() {
- addArgument();
- Parser.initialize(*this);
- }
-public:
- ParserClass &getParser() { return Parser; }
-
- unsigned getPosition(unsigned optnum) const {
- assert(optnum < this->size() && "Invalid option index");
- return Positions[optnum];
- }
-
- // One option...
- template<class M0t>
- explicit list(const M0t &M0) : Option(ZeroOrMore | NotHidden) {
- apply(M0, this);
- done();
- }
- // Two options...
- template<class M0t, class M1t>
- list(const M0t &M0, const M1t &M1) : Option(ZeroOrMore | NotHidden) {
- apply(M0, this); apply(M1, this);
- done();
- }
- // Three options...
- template<class M0t, class M1t, class M2t>
- list(const M0t &M0, const M1t &M1, const M2t &M2)
- : Option(ZeroOrMore | NotHidden) {
- apply(M0, this); apply(M1, this); apply(M2, this);
- done();
- }
- // Four options...
- template<class M0t, class M1t, class M2t, class M3t>
- list(const M0t &M0, const M1t &M1, const M2t &M2, const M3t &M3)
- : Option(ZeroOrMore | NotHidden) {
- apply(M0, this); apply(M1, this); apply(M2, this); apply(M3, this);
- done();
- }
- // Five options...
- template<class M0t, class M1t, class M2t, class M3t, class M4t>
- list(const M0t &M0, const M1t &M1, const M2t &M2, const M3t &M3,
- const M4t &M4) : Option(ZeroOrMore | NotHidden) {
- apply(M0, this); apply(M1, this); apply(M2, this); apply(M3, this);
- apply(M4, this);
- done();
- }
- // Six options...
- template<class M0t, class M1t, class M2t, class M3t,
- class M4t, class M5t>
- list(const M0t &M0, const M1t &M1, const M2t &M2, const M3t &M3,
- const M4t &M4, const M5t &M5) : Option(ZeroOrMore | NotHidden) {
- apply(M0, this); apply(M1, this); apply(M2, this); apply(M3, this);
- apply(M4, this); apply(M5, this);
- done();
- }
- // Seven options...
- template<class M0t, class M1t, class M2t, class M3t,
- class M4t, class M5t, class M6t>
- list(const M0t &M0, const M1t &M1, const M2t &M2, const M3t &M3,
- const M4t &M4, const M5t &M5, const M6t &M6)
- : Option(ZeroOrMore | NotHidden) {
- apply(M0, this); apply(M1, this); apply(M2, this); apply(M3, this);
- apply(M4, this); apply(M5, this); apply(M6, this);
- done();
- }
- // Eight options...
- template<class M0t, class M1t, class M2t, class M3t,
- class M4t, class M5t, class M6t, class M7t>
- list(const M0t &M0, const M1t &M1, const M2t &M2, const M3t &M3,
- const M4t &M4, const M5t &M5, const M6t &M6,
- const M7t &M7) : Option(ZeroOrMore | NotHidden) {
- apply(M0, this); apply(M1, this); apply(M2, this); apply(M3, this);
- apply(M4, this); apply(M5, this); apply(M6, this); apply(M7, this);
- done();
- }
-};
-
-//===----------------------------------------------------------------------===//
-// bits_storage class
-
-// Default storage class definition: external storage. This implementation
-// assumes the user will specify a variable to store the data into with the
-// cl::location(x) modifier.
-//
-template<class DataType, class StorageClass>
-class bits_storage {
- unsigned *Location; // Where to store the bits...
-
- template<class T>
- static unsigned Bit(const T &V) {
- unsigned BitPos = reinterpret_cast<unsigned>(V);
- assert(BitPos < sizeof(unsigned) * 8 &&
- "enum exceeds width of bit vector!");
- return 1 << BitPos;
- }
-
-public:
- bits_storage() : Location(0) {}
-
- bool setLocation(Option &O, unsigned &L) {
- if (Location)
- return O.error(": cl::location(x) specified more than once!");
- Location = &L;
- return false;
- }
-
- template<class T>
- void addValue(const T &V) {
- assert(Location != 0 && "cl::location(...) not specified for a command "
- "line option with external storage!");
- *Location |= Bit(V);
- }
-
- unsigned getBits() { return *Location; }
-
- template<class T>
- bool isSet(const T &V) {
- return (*Location & Bit(V)) != 0;
- }
-};
-
-
-// Define how to hold bits. Since we can inherit from a class, we do so.
-// This makes us exactly compatible with the bits in all cases that it is used.
-//
-template<class DataType>
-class bits_storage<DataType, bool> {
- unsigned Bits; // Where to store the bits...
-
- template<class T>
- static unsigned Bit(const T &V) {
- unsigned BitPos = reinterpret_cast<unsigned>(V);
- assert(BitPos < sizeof(unsigned) * 8 &&
- "enum exceeds width of bit vector!");
- return 1 << BitPos;
- }
-
-public:
- template<class T>
- void addValue(const T &V) {
- Bits |= Bit(V);
- }
-
- unsigned getBits() { return Bits; }
-
- template<class T>
- bool isSet(const T &V) {
- return (Bits & Bit(V)) != 0;
- }
-};
-
-
-//===----------------------------------------------------------------------===//
-// bits - A bit vector of command options.
-//
-template <class DataType, class Storage = bool,
- class ParserClass = parser<DataType> >
-class bits : public Option, public bits_storage<DataType, Storage> {
- std::vector<unsigned> Positions;
- ParserClass Parser;
-
- virtual enum ValueExpected getValueExpectedFlagDefault() const {
- return Parser.getValueExpectedFlagDefault();
- }
- virtual void getExtraOptionNames(std::vector<const char*> &OptionNames) {
- return Parser.getExtraOptionNames(OptionNames);
- }
-
- virtual bool handleOccurrence(unsigned pos, const char *ArgName,
- const std::string &Arg) {
- typename ParserClass::parser_data_type Val =
- typename ParserClass::parser_data_type();
- if (Parser.parse(*this, ArgName, Arg, Val))
- return true; // Parse Error!
- addValue(Val);
- setPosition(pos);
- Positions.push_back(pos);
- return false;
- }
-
- // Forward printing stuff to the parser...
- virtual size_t getOptionWidth() const {return Parser.getOptionWidth(*this);}
- virtual void printOptionInfo(size_t GlobalWidth) const {
- Parser.printOptionInfo(*this, GlobalWidth);
- }
-
- void done() {
- addArgument();
- Parser.initialize(*this);
- }
-public:
- ParserClass &getParser() { return Parser; }
-
- unsigned getPosition(unsigned optnum) const {
- assert(optnum < this->size() && "Invalid option index");
- return Positions[optnum];
- }
-
- // One option...
- template<class M0t>
- explicit bits(const M0t &M0) : Option(ZeroOrMore | NotHidden) {
- apply(M0, this);
- done();
- }
- // Two options...
- template<class M0t, class M1t>
- bits(const M0t &M0, const M1t &M1) : Option(ZeroOrMore | NotHidden) {
- apply(M0, this); apply(M1, this);
- done();
- }
- // Three options...
- template<class M0t, class M1t, class M2t>
- bits(const M0t &M0, const M1t &M1, const M2t &M2)
- : Option(ZeroOrMore | NotHidden) {
- apply(M0, this); apply(M1, this); apply(M2, this);
- done();
- }
- // Four options...
- template<class M0t, class M1t, class M2t, class M3t>
- bits(const M0t &M0, const M1t &M1, const M2t &M2, const M3t &M3)
- : Option(ZeroOrMore | NotHidden) {
- apply(M0, this); apply(M1, this); apply(M2, this); apply(M3, this);
- done();
- }
- // Five options...
- template<class M0t, class M1t, class M2t, class M3t, class M4t>
- bits(const M0t &M0, const M1t &M1, const M2t &M2, const M3t &M3,
- const M4t &M4) : Option(ZeroOrMore | NotHidden) {
- apply(M0, this); apply(M1, this); apply(M2, this); apply(M3, this);
- apply(M4, this);
- done();
- }
- // Six options...
- template<class M0t, class M1t, class M2t, class M3t,
- class M4t, class M5t>
- bits(const M0t &M0, const M1t &M1, const M2t &M2, const M3t &M3,
- const M4t &M4, const M5t &M5) : Option(ZeroOrMore | NotHidden) {
- apply(M0, this); apply(M1, this); apply(M2, this); apply(M3, this);
- apply(M4, this); apply(M5, this);
- done();
- }
- // Seven options...
- template<class M0t, class M1t, class M2t, class M3t,
- class M4t, class M5t, class M6t>
- bits(const M0t &M0, const M1t &M1, const M2t &M2, const M3t &M3,
- const M4t &M4, const M5t &M5, const M6t &M6)
- : Option(ZeroOrMore | NotHidden) {
- apply(M0, this); apply(M1, this); apply(M2, this); apply(M3, this);
- apply(M4, this); apply(M5, this); apply(M6, this);
- done();
- }
- // Eight options...
- template<class M0t, class M1t, class M2t, class M3t,
- class M4t, class M5t, class M6t, class M7t>
- bits(const M0t &M0, const M1t &M1, const M2t &M2, const M3t &M3,
- const M4t &M4, const M5t &M5, const M6t &M6,
- const M7t &M7) : Option(ZeroOrMore | NotHidden) {
- apply(M0, this); apply(M1, this); apply(M2, this); apply(M3, this);
- apply(M4, this); apply(M5, this); apply(M6, this); apply(M7, this);
- done();
- }
-};
-
-//===----------------------------------------------------------------------===//
-// Aliased command line option (alias this name to a preexisting name)
-//
-
-class alias : public Option {
- Option *AliasFor;
- virtual bool handleOccurrence(unsigned pos, const char *ArgName,
- const std::string &Arg) {
- return AliasFor->handleOccurrence(pos, AliasFor->ArgStr, Arg);
- }
- // Handle printing stuff...
- virtual size_t getOptionWidth() const;
- virtual void printOptionInfo(size_t GlobalWidth) const;
-
- void done() {
- if (!hasArgStr())
- error(": cl::alias must have argument name specified!");
- if (AliasFor == 0)
- error(": cl::alias must have an cl::aliasopt(option) specified!");
- addArgument();
- }
-public:
- void setAliasFor(Option &O) {
- if (AliasFor)
- error(": cl::alias must only have one cl::aliasopt(...) specified!");
- AliasFor = &O;
- }
-
- // One option...
- template<class M0t>
- explicit alias(const M0t &M0) : Option(Optional | Hidden), AliasFor(0) {
- apply(M0, this);
- done();
- }
- // Two options...
- template<class M0t, class M1t>
- alias(const M0t &M0, const M1t &M1) : Option(Optional | Hidden), AliasFor(0) {
- apply(M0, this); apply(M1, this);
- done();
- }
- // Three options...
- template<class M0t, class M1t, class M2t>
- alias(const M0t &M0, const M1t &M1, const M2t &M2)
- : Option(Optional | Hidden), AliasFor(0) {
- apply(M0, this); apply(M1, this); apply(M2, this);
- done();
- }
- // Four options...
- template<class M0t, class M1t, class M2t, class M3t>
- alias(const M0t &M0, const M1t &M1, const M2t &M2, const M3t &M3)
- : Option(Optional | Hidden), AliasFor(0) {
- apply(M0, this); apply(M1, this); apply(M2, this); apply(M3, this);
- done();
- }
-};
-
-// aliasfor - Modifier to set the option an alias aliases.
-struct aliasopt {
- Option &Opt;
- explicit aliasopt(Option &O) : Opt(O) {}
- void apply(alias &A) const { A.setAliasFor(Opt); }
-};
-
-// extrahelp - provide additional help at the end of the normal help
-// output. All occurrences of cl::extrahelp will be accumulated and
-// printed to std::cerr at the end of the regular help, just before
-// exit is called.
-struct extrahelp {
- const char * morehelp;
- explicit extrahelp(const char* help);
-};
-
-void PrintVersionMessage();
-// This function just prints the help message, exactly the same way as if the
-// --help option had been given on the command line.
-// NOTE: THIS FUNCTION TERMINATES THE PROGRAM!
-void PrintHelpMessage();
-
-} // End namespace cl
-
-} // End namespace llvm
-
-#endif
diff --git a/release_23/include/llvm/Support/Compiler.h b/release_23/include/llvm/Support/Compiler.h
deleted file mode 100644
index 1497dd61edee..000000000000
--- a/release_23/include/llvm/Support/Compiler.h
+++ /dev/null
@@ -1,48 +0,0 @@
-//===-- llvm/Support/Compiler.h - Compiler abstraction support --*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines several macros, based on the current compiler. This allows
-// use of compiler-specific features in a way that remains portable.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_SUPPORT_COMPILER_H
-#define LLVM_SUPPORT_COMPILER_H
-
-// The VISIBILITY_HIDDEN macro, used for marking classes with the GCC-specific
-// visibility("hidden") attribute.
-#if (__GNUC__ >= 4) && !defined(__MINGW32__)
-#define VISIBILITY_HIDDEN __attribute__ ((visibility("hidden")))
-#else
-#define VISIBILITY_HIDDEN
-#endif
-
-
-// C++ doesn't support 'extern template' of template specializations. GCC does,
-// but requires __extension__ before it. In the header, use this:
-// EXTERN_TEMPLATE_INSTANTIATION(class foo<bar>);
-// in the .cpp file, use this:
-// TEMPLATE_INSTANTIATION(class foo<bar>);
-#ifdef __GNUC__
-#define EXTERN_TEMPLATE_INSTANTIATION(X) __extension__ extern template X
-#define TEMPLATE_INSTANTIATION(X) template X
-#else
-#define EXTERN_TEMPLATE_INSTANTIATION(X)
-#define TEMPLATE_INSTANTIATION(X)
-#endif
-
-// DISABLE_INLINE - On compilers where we have a directive to do so, mark a
-// method "not for inlining".
-#if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
-#define DISABLE_INLINE __attribute__((noinline))
-#else
-#define DISABLE_INLINE
-#endif
-
-#endif
diff --git a/release_23/include/llvm/Support/ConstantRange.h b/release_23/include/llvm/Support/ConstantRange.h
deleted file mode 100644
index 2e477cf89984..000000000000
--- a/release_23/include/llvm/Support/ConstantRange.h
+++ /dev/null
@@ -1,198 +0,0 @@
-//===-- llvm/Support/ConstantRange.h - Represent a range --------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// Represent a range of possible values that may occur when the program is run
-// for an integral value. This keeps track of a lower and upper bound for the
-// constant, which MAY wrap around the end of the numeric range. To do this, it
-// keeps track of a [lower, upper) bound, which specifies an interval just like
-// STL iterators. When used with boolean values, the following are important
-// ranges: :
-//
-// [F, F) = {} = Empty set
-// [T, F) = {T}
-// [F, T) = {F}
-// [T, T) = {F, T} = Full set
-//
-// The other integral ranges use min/max values for special range values. For
-// example, for 8-bit types, it uses:
-// [0, 0) = {} = Empty set
-// [255, 255) = {0..255} = Full Set
-//
-// Note that ConstantRange always keeps unsigned values.
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_SUPPORT_CONSTANT_RANGE_H
-#define LLVM_SUPPORT_CONSTANT_RANGE_H
-
-#include "llvm/ADT/APInt.h"
-#include "llvm/Support/DataTypes.h"
-#include "llvm/Support/Streams.h"
-#include <iosfwd>
-
-namespace llvm {
-
-class ConstantRange {
- APInt Lower, Upper;
- static ConstantRange intersect1Wrapped(const ConstantRange &LHS,
- const ConstantRange &RHS);
- public:
- /// Initialize a full (the default) or empty set for the specified bit width.
- ///
- explicit ConstantRange(uint32_t BitWidth, bool isFullSet = true);
-
- /// Initialize a range to hold the single specified value.
- ///
- ConstantRange(const APInt &Value);
-
- /// @brief Initialize a range of values explicitly. This will assert out if
- /// Lower==Upper and Lower != Min or Max value for its type. It will also
- /// assert out if the two APInt's are not the same bit width.
- ConstantRange(const APInt& Lower, const APInt& Upper);
-
- /// getLower - Return the lower value for this range...
- ///
- const APInt &getLower() const { return Lower; }
-
- /// getUpper - Return the upper value for this range...
- ///
- const APInt &getUpper() const { return Upper; }
-
- /// getBitWidth - get the bit width of this ConstantRange
- ///
- uint32_t getBitWidth() const { return Lower.getBitWidth(); }
-
- /// isFullSet - Return true if this set contains all of the elements possible
- /// for this data-type
- ///
- bool isFullSet() const;
-
- /// isEmptySet - Return true if this set contains no members.
- ///
- bool isEmptySet() const;
-
- /// isWrappedSet - Return true if this set wraps around the top of the range,
- /// for example: [100, 8)
- ///
- bool isWrappedSet() const;
-
- /// contains - Return true if the specified value is in the set.
- ///
- bool contains(const APInt &Val) const;
-
- /// getSingleElement - If this set contains a single element, return it,
- /// otherwise return null.
- ///
- const APInt *getSingleElement() const {
- if (Upper == Lower + 1)
- return &Lower;
- return 0;
- }
-
- /// isSingleElement - Return true if this set contains exactly one member.
- ///
- bool isSingleElement() const { return getSingleElement() != 0; }
-
- /// getSetSize - Return the number of elements in this set.
- ///
- APInt getSetSize() const;
-
- /// getUnsignedMax - Return the largest unsigned value contained in the
- /// ConstantRange.
- ///
- APInt getUnsignedMax() const;
-
- /// getUnsignedMin - Return the smallest unsigned value contained in the
- /// ConstantRange.
- ///
- APInt getUnsignedMin() const;
-
- /// getSignedMax - Return the largest signed value contained in the
- /// ConstantRange.
- ///
- APInt getSignedMax() const;
-
- /// getSignedMin - Return the smallest signed value contained in the
- /// ConstantRange.
- ///
- APInt getSignedMin() const;
-
- /// operator== - Return true if this range is equal to another range.
- ///
- bool operator==(const ConstantRange &CR) const {
- return Lower == CR.Lower && Upper == CR.Upper;
- }
- bool operator!=(const ConstantRange &CR) const {
- return !operator==(CR);
- }
-
- /// subtract - Subtract the specified constant from the endpoints of this
- /// constant range.
- ConstantRange subtract(const APInt &CI) const;
-
- /// intersectWith - Return the range that results from the intersection of
- /// this range with another range. The resultant range is pruned as much as
- /// possible, but there may be cases where elements are included that are in
- /// one of the sets but not the other. For example: [100, 8) intersect [3,
- /// 120) yields [3, 120)
- ///
- ConstantRange intersectWith(const ConstantRange &CR) const;
-
- /// maximalIntersectWith - Return the range that results from the intersection
- /// of this range with another range. The resultant range is guaranteed to
- /// include all elements contained in both input ranges, and to have the
- /// smallest possible set size that does so. Because there may be two
- /// intersections with the same set size, A.maximalIntersectWith(B) might not
- /// be equal to B.maximalIntersectWith(A).
- ///
- ConstantRange maximalIntersectWith(const ConstantRange &CR) const;
-
- /// unionWith - Return the range that results from the union of this range
- /// with another range. The resultant range is guaranteed to include the
- /// elements of both sets, but may contain more. For example, [3, 9) union
- /// [12,15) is [3, 15), which includes 9, 10, and 11, which were not included
- /// in either set before.
- ///
- ConstantRange unionWith(const ConstantRange &CR) const;
-
- /// zeroExtend - Return a new range in the specified integer type, which must
- /// be strictly larger than the current type. The returned range will
- /// correspond to the possible range of values if the source range had been
- /// zero extended to BitWidth.
- ConstantRange zeroExtend(uint32_t BitWidth) const;
-
- /// signExtend - Return a new range in the specified integer type, which must
- /// be strictly larger than the current type. The returned range will
- /// correspond to the possible range of values if the source range had been
- /// sign extended to BitWidth.
- ConstantRange signExtend(uint32_t BitWidth) const;
-
- /// truncate - Return a new range in the specified integer type, which must be
- /// strictly smaller than the current type. The returned range will
- /// correspond to the possible range of values if the source range had been
- /// truncated to the specified type.
- ConstantRange truncate(uint32_t BitWidth) const;
-
- /// print - Print out the bounds to a stream...
- ///
- void print(std::ostream &OS) const;
- void print(std::ostream *OS) const { if (OS) print(*OS); }
-
- /// dump - Allow printing from a debugger easily...
- ///
- void dump() const;
-};
-
-inline std::ostream &operator<<(std::ostream &OS, const ConstantRange &CR) {
- CR.print(OS);
- return OS;
-}
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/Support/DOTGraphTraits.h b/release_23/include/llvm/Support/DOTGraphTraits.h
deleted file mode 100644
index 080c09b5f48e..000000000000
--- a/release_23/include/llvm/Support/DOTGraphTraits.h
+++ /dev/null
@@ -1,123 +0,0 @@
-//===-- llvm/Support/DotGraphTraits.h - Customize .dot output ---*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines a template class that can be used to customize dot output
-// graphs generated by the GraphWriter.h file. The default implementation of
-// this file will produce a simple, but not very polished graph. By
-// specializing this template, lots of customization opportunities are possible.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_SUPPORT_DOTGRAPHTRAITS_H
-#define LLVM_SUPPORT_DOTGRAPHTRAITS_H
-
-#include <string>
-
-namespace llvm {
-
-/// DefaultDOTGraphTraits - This class provides the default implementations of
-/// all of the DOTGraphTraits methods. If a specialization does not need to
-/// override all methods here it should inherit so that it can get the default
-/// implementations.
-///
-struct DefaultDOTGraphTraits {
- /// getGraphName - Return the label for the graph as a whole. Printed at the
- /// top of the graph.
- ///
- template<typename GraphType>
- static std::string getGraphName(const GraphType& Graph) { return ""; }
-
- /// getGraphProperties - Return any custom properties that should be included
- /// in the top level graph structure for dot.
- ///
- template<typename GraphType>
- static std::string getGraphProperties(const GraphType& Graph) {
- return "";
- }
-
- /// renderGraphFromBottomUp - If this function returns true, the graph is
- /// emitted bottom-up instead of top-down. This requires graphviz 2.0 to work
- /// though.
- static bool renderGraphFromBottomUp() {
- return false;
- }
-
- /// getNodeLabel - Given a node and a pointer to the top level graph, return
- /// the label to print in the node.
- template<typename GraphType>
- static std::string getNodeLabel(const void *Node, const GraphType& Graph) {
- return "";
- }
-
- /// hasNodeAddressLabel - If this method returns true, the address of the node
- /// is added to the label of the node.
- template<typename GraphType>
- static bool hasNodeAddressLabel(const void *Node, const GraphType& Graph) {
- return false;
- }
-
- /// If you want to specify custom node attributes, this is the place to do so
- ///
- template<typename GraphType>
- static std::string getNodeAttributes(const void *Node,
- const GraphType& Graph) {
- return "";
- }
-
- /// If you want to override the dot attributes printed for a particular edge,
- /// override this method.
- template<typename EdgeIter>
- static std::string getEdgeAttributes(const void *Node, EdgeIter EI) {
- return "";
- }
-
- /// getEdgeSourceLabel - If you want to label the edge source itself,
- /// implement this method.
- template<typename EdgeIter>
- static std::string getEdgeSourceLabel(const void *Node, EdgeIter I) {
- return "";
- }
-
- /// edgeTargetsEdgeSource - This method returns true if this outgoing edge
- /// should actually target another edge source, not a node. If this method is
- /// implemented, getEdgeTarget should be implemented.
- template<typename EdgeIter>
- static bool edgeTargetsEdgeSource(const void *Node, EdgeIter I) {
- return false;
- }
-
- /// getEdgeTarget - If edgeTargetsEdgeSource returns true, this method is
- /// called to determine which outgoing edge of Node is the target of this
- /// edge.
- template<typename EdgeIter>
- static EdgeIter getEdgeTarget(const void *Node, EdgeIter I) {
- return I;
- }
-
- /// addCustomGraphFeatures - If a graph is made up of more than just
- /// straight-forward nodes and edges, this is the place to put all of the
- /// custom stuff necessary. The GraphWriter object, instantiated with your
- /// GraphType is passed in as an argument. You may call arbitrary methods on
- /// it to add things to the output graph.
- ///
- template<typename GraphType, typename GraphWriter>
- static void addCustomGraphFeatures(const GraphType& Graph, GraphWriter &GW) {}
-};
-
-
-/// DOTGraphTraits - Template class that can be specialized to customize how
-/// graphs are converted to 'dot' graphs. When specializing, you may inherit
-/// from DefaultDOTGraphTraits if you don't need to override everything.
-///
-template <typename Ty>
-struct DOTGraphTraits : public DefaultDOTGraphTraits {};
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/Support/DataFlow.h b/release_23/include/llvm/Support/DataFlow.h
deleted file mode 100644
index 8d0ae0c70c58..000000000000
--- a/release_23/include/llvm/Support/DataFlow.h
+++ /dev/null
@@ -1,104 +0,0 @@
-//===-- llvm/Support/DataFlow.h - dataflow as graphs ------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines specializations of GraphTraits that allows Use-Def and
-// Def-Use relations to be treated as proper graphs for generic algorithms.
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_SUPPORT_DATAFLOW_H
-#define LLVM_SUPPORT_DATAFLOW_H
-
-#include "llvm/User.h"
-#include "llvm/Value.h"
-#include "llvm/ADT/GraphTraits.h"
-
-namespace llvm {
-
-//===----------------------------------------------------------------------===//
-// Provide specializations of GraphTraits to be able to treat def-use/use-def
-// chains as graphs
-
-template <> struct GraphTraits<const User*> {
- typedef const Value NodeType;
- typedef Value::use_const_iterator ChildIteratorType;
-
- static NodeType *getEntryNode(const User *G) {
- return G;
- }
-
- static inline ChildIteratorType child_begin(NodeType *N) {
- return N->use_begin();
- }
-
- static inline ChildIteratorType child_end(NodeType *N) {
- return N->use_end();
- }
-};
-
-template <> struct GraphTraits<User*> {
- typedef Value NodeType;
- typedef Value::use_iterator ChildIteratorType;
-
- static NodeType *getEntryNode(User *G) {
- return G;
- }
-
- static inline ChildIteratorType child_begin(NodeType *N) {
- return N->use_begin();
- }
-
- static inline ChildIteratorType child_end(NodeType *N) {
- return N->use_end();
- }
-};
-
-template <> struct GraphTraits<Inverse<const User*> > {
- typedef const Value NodeType;
- typedef User::const_op_iterator ChildIteratorType;
-
- static NodeType *getEntryNode(Inverse<const User*> G) {
- return G.Graph;
- }
-
- static inline ChildIteratorType child_begin(NodeType *N) {
- if (const User *U = dyn_cast<User>(N))
- return U->op_begin();
- return NULL;
- }
-
- static inline ChildIteratorType child_end(NodeType *N) {
- if(const User *U = dyn_cast<User>(N))
- return U->op_end();
- return NULL;
- }
-};
-
-template <> struct GraphTraits<Inverse<User*> > {
- typedef Value NodeType;
- typedef User::op_iterator ChildIteratorType;
-
- static NodeType *getEntryNode(Inverse<User*> G) {
- return G.Graph;
- }
-
- static inline ChildIteratorType child_begin(NodeType *N) {
- if (User *U = dyn_cast<User>(N))
- return U->op_begin();
- return NULL;
- }
-
- static inline ChildIteratorType child_end(NodeType *N) {
- if (User *U = dyn_cast<User>(N))
- return U->op_end();
- return NULL;
- }
-};
-
-}
-#endif
diff --git a/release_23/include/llvm/Support/DataTypes.h.in b/release_23/include/llvm/Support/DataTypes.h.in
deleted file mode 100644
index 512b349e73e8..000000000000
--- a/release_23/include/llvm/Support/DataTypes.h.in
+++ /dev/null
@@ -1,131 +0,0 @@
-//===-- include/Support/DataTypes.h - Define fixed size types ---*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains definitions to figure out the size of _HOST_ data types.
-// This file is important because different host OS's define different macros,
-// which makes portability tough. This file exports the following definitions:
-//
-// [u]int(32|64)_t : typedefs for signed and unsigned 32/64 bit system types
-// [U]INT(8|16|32|64)_(MIN|MAX) : Constants for the min and max values.
-//
-// No library is required when using these functinons.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef SUPPORT_DATATYPES_H
-#define SUPPORT_DATATYPES_H
-
-#undef HAVE_SYS_TYPES_H
-#undef HAVE_INTTYPES_H
-#undef HAVE_STDINT_H
-#undef HAVE_UINT64_T
-#undef HAVE_U_INT64_T
-
-#ifndef _MSC_VER
-
-// Note that this header's correct operation depends on __STDC_LIMIT_MACROS
-// being defined. We would define it here, but in order to prevent Bad Things
-// happening when system headers or C++ STL headers include stdint.h before
-// we define it here, we define it on the g++ command line (in Makefile.rules).
-#if !defined(__STDC_LIMIT_MACROS)
-# error "Must #define __STDC_LIMIT_MACROS before #including Support/DataTypes.h"
-#endif
-
-// Note that <inttypes.h> includes <stdint.h>, if this is a C99 system.
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-
-#ifdef HAVE_INTTYPES_H
-#include <inttypes.h>
-#endif
-
-#ifdef HAVE_STDINT_H
-#include <stdint.h>
-#endif
-
-#ifdef __cplusplus
-#include <cmath>
-#else
-#include <math.h>
-#endif
-
-#ifdef _AIX
-#include "llvm/Support/AIXDataTypesFix.h"
-#endif
-
-// Handle incorrect definition of uint64_t as u_int64_t
-#ifndef HAVE_UINT64_T
-#ifdef HAVE_U_INT64_T
-typedef u_int64_t uint64_t;
-#else
-# error "Don't have a definition for uint64_t on this platform"
-#endif
-#endif
-
-#ifdef _OpenBSD_
-#define INT8_MAX 127
-#define INT8_MIN -128
-#define UINT8_MAX 255
-#define INT16_MAX 32767
-#define INT16_MIN -32768
-#define UINT16_MAX 65535
-#define INT32_MAX 2147483647
-#define INT32_MIN -2147483648
-#define UINT32_MAX 4294967295U
-#endif
-
-#else /* _MSC_VER */
-// Visual C++ doesn't provide standard integer headers, but it does provide
-// built-in data types.
-#include <stdlib.h>
-#include <stddef.h>
-#include <sys/types.h>
-typedef __int64 int64_t;
-typedef unsigned __int64 uint64_t;
-typedef signed int int32_t;
-typedef unsigned int uint32_t;
-typedef short int16_t;
-typedef unsigned short uint16_t;
-typedef signed char int8_t;
-typedef unsigned char uint8_t;
-typedef signed int ssize_t;
-#define INT8_MAX 127
-#define INT8_MIN -128
-#define UINT8_MAX 255
-#define INT16_MAX 32767
-#define INT16_MIN -32768
-#define UINT16_MAX 65535
-#define INT32_MAX 2147483647
-#define INT32_MIN -2147483648
-#define UINT32_MAX 4294967295U
-#endif /* _MSC_VER */
-
-/* Set defaults for constants which we cannot find. */
-#if !defined(INT64_MAX)
-# define INT64_MAX 9223372036854775807LL
-#endif
-#if !defined(INT64_MIN)
-# define INT64_MIN ((-INT64_MAX)-1)
-#endif
-#if !defined(UINT64_MAX)
-# define UINT64_MAX 0xffffffffffffffffULL
-#endif
-
-#if __GNUC__ > 3
-#define END_WITH_NULL __attribute__((sentinel))
-#else
-#define END_WITH_NULL
-#endif
-
-#ifndef HUGE_VALF
-#define HUGE_VALF (float)HUGE_VAL
-#endif
-
-#endif /* SUPPORT_DATATYPES_H */
diff --git a/release_23/include/llvm/Support/Debug.h b/release_23/include/llvm/Support/Debug.h
deleted file mode 100644
index 8315ce26a5d8..000000000000
--- a/release_23/include/llvm/Support/Debug.h
+++ /dev/null
@@ -1,78 +0,0 @@
-//===- llvm/Support/Debug.h - Easy way to add debug output ------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements a handy way of adding debugging information to your
-// code, without it being enabled all of the time, and without having to add
-// command line options to enable it.
-//
-// In particular, just wrap your code with the DEBUG() macro, and it will be
-// enabled automatically if you specify '-debug' on the command-line.
-// Alternatively, you can also use the SET_DEBUG_TYPE("foo") macro to specify
-// that your debug code belongs to class "foo". Then, on the command line, you
-// can specify '-debug-only=foo' to enable JUST the debug information for the
-// foo class.
-//
-// When compiling in release mode, the -debug-* options and all code in DEBUG()
-// statements disappears, so it does not effect the runtime of the code.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_SUPPORT_DEBUG_H
-#define LLVM_SUPPORT_DEBUG_H
-
-#include "llvm/Support/Streams.h"
-
-namespace llvm {
-
-// DebugFlag - This boolean is set to true if the '-debug' command line option
-// is specified. This should probably not be referenced directly, instead, use
-// the DEBUG macro below.
-//
-extern bool DebugFlag;
-
-// isCurrentDebugType - Return true if the specified string is the debug type
-// specified on the command line, or if none was specified on the command line
-// with the -debug-only=X option.
-//
-bool isCurrentDebugType(const char *Type);
-
-// DEBUG macro - This macro should be used by passes to emit debug information.
-// In the '-debug' option is specified on the commandline, and if this is a
-// debug build, then the code specified as the option to the macro will be
-// executed. Otherwise it will not be. Example:
-//
-// DEBUG(cerr << "Bitset contains: " << Bitset << "\n");
-//
-
-#ifndef DEBUG_TYPE
-#define DEBUG_TYPE ""
-#endif
-
-#ifdef NDEBUG
-#define DEBUG(X)
-#else
-#define DEBUG(X) \
- do { if (DebugFlag && isCurrentDebugType(DEBUG_TYPE)) { X; } } while (0)
-#endif
-
-/// getErrorOutputStream - Returns the error output stream (std::cerr). This
-/// places the std::c* I/O streams into one .cpp file and relieves the whole
-/// program from having to have hundreds of static c'tor/d'tors for them.
-///
-OStream &getErrorOutputStream(const char *DebugType);
-
-#ifdef NDEBUG
-#define DOUT llvm::OStream(0)
-#else
-#define DOUT llvm::getErrorOutputStream(DEBUG_TYPE)
-#endif
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/Support/Dwarf.h b/release_23/include/llvm/Support/Dwarf.h
deleted file mode 100644
index 01bfc3f35371..000000000000
--- a/release_23/include/llvm/Support/Dwarf.h
+++ /dev/null
@@ -1,568 +0,0 @@
-//===-- llvm/Support/Dwarf.h ---Dwarf Constants------------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains constants used for implementing Dwarf debug support. For
-// Details on the Dwarf 3 specfication see DWARF Debugging Information Format
-// V.3 reference manual http://dwarf.freestandards.org ,
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_SUPPORT_DWARF_H
-#define LLVM_SUPPORT_DWARF_H
-
-namespace llvm {
-
-namespace dwarf {
-
-//===----------------------------------------------------------------------===//
-// Dwarf constants as gleaned from the DWARF Debugging Information Format V.3
-// reference manual http://dwarf.freestandards.org .
-//
-
-// Do not mix the following two enumerations sets. DW_TAG_invalid changes the
-// enumeration base type.
-
-enum llvm_dwarf_constants {
- // llvm mock tags
- DW_TAG_invalid = ~0U, // Tag for invalid results.
-
- DW_TAG_anchor = 0, // Tag for descriptor anchors.
- DW_TAG_auto_variable = 0x100, // Tag for local (auto) variables.
- DW_TAG_arg_variable = 0x101, // Tag for argument variables.
- DW_TAG_return_variable = 0x102, // Tag for return variables.
-
- DW_TAG_vector_type = 0x103, // Tag for vector types.
-
- DW_TAG_user_base = 0x1000, // Recommended base for user tags.
-
- DW_CIE_VERSION = 1, // Common frame information version.
- DW_CIE_ID = 0xffffffff // Common frame information mark.
-};
-
-enum dwarf_constants {
- DWARF_VERSION = 2,
-
- // Tags
- DW_TAG_array_type = 0x01,
- DW_TAG_class_type = 0x02,
- DW_TAG_entry_point = 0x03,
- DW_TAG_enumeration_type = 0x04,
- DW_TAG_formal_parameter = 0x05,
- DW_TAG_imported_declaration = 0x08,
- DW_TAG_label = 0x0a,
- DW_TAG_lexical_block = 0x0b,
- DW_TAG_member = 0x0d,
- DW_TAG_pointer_type = 0x0f,
- DW_TAG_reference_type = 0x10,
- DW_TAG_compile_unit = 0x11,
- DW_TAG_string_type = 0x12,
- DW_TAG_structure_type = 0x13,
- DW_TAG_subroutine_type = 0x15,
- DW_TAG_typedef = 0x16,
- DW_TAG_union_type = 0x17,
- DW_TAG_unspecified_parameters = 0x18,
- DW_TAG_variant = 0x19,
- DW_TAG_common_block = 0x1a,
- DW_TAG_common_inclusion = 0x1b,
- DW_TAG_inheritance = 0x1c,
- DW_TAG_inlined_subroutine = 0x1d,
- DW_TAG_module = 0x1e,
- DW_TAG_ptr_to_member_type = 0x1f,
- DW_TAG_set_type = 0x20,
- DW_TAG_subrange_type = 0x21,
- DW_TAG_with_stmt = 0x22,
- DW_TAG_access_declaration = 0x23,
- DW_TAG_base_type = 0x24,
- DW_TAG_catch_block = 0x25,
- DW_TAG_const_type = 0x26,
- DW_TAG_constant = 0x27,
- DW_TAG_enumerator = 0x28,
- DW_TAG_file_type = 0x29,
- DW_TAG_friend = 0x2a,
- DW_TAG_namelist = 0x2b,
- DW_TAG_namelist_item = 0x2c,
- DW_TAG_packed_type = 0x2d,
- DW_TAG_subprogram = 0x2e,
- DW_TAG_template_type_parameter = 0x2f,
- DW_TAG_template_value_parameter = 0x30,
- DW_TAG_thrown_type = 0x31,
- DW_TAG_try_block = 0x32,
- DW_TAG_variant_part = 0x33,
- DW_TAG_variable = 0x34,
- DW_TAG_volatile_type = 0x35,
- DW_TAG_dwarf_procedure = 0x36,
- DW_TAG_restrict_type = 0x37,
- DW_TAG_interface_type = 0x38,
- DW_TAG_namespace = 0x39,
- DW_TAG_imported_module = 0x3a,
- DW_TAG_unspecified_type = 0x3b,
- DW_TAG_partial_unit = 0x3c,
- DW_TAG_imported_unit = 0x3d,
- DW_TAG_condition = 0x3f,
- DW_TAG_shared_type = 0x40,
- DW_TAG_lo_user = 0x4080,
- DW_TAG_hi_user = 0xffff,
-
- // Children flag
- DW_CHILDREN_no = 0x00,
- DW_CHILDREN_yes = 0x01,
-
- // Attributes
- DW_AT_sibling = 0x01,
- DW_AT_location = 0x02,
- DW_AT_name = 0x03,
- DW_AT_ordering = 0x09,
- DW_AT_byte_size = 0x0b,
- DW_AT_bit_offset = 0x0c,
- DW_AT_bit_size = 0x0d,
- DW_AT_stmt_list = 0x10,
- DW_AT_low_pc = 0x11,
- DW_AT_high_pc = 0x12,
- DW_AT_language = 0x13,
- DW_AT_discr = 0x15,
- DW_AT_discr_value = 0x16,
- DW_AT_visibility = 0x17,
- DW_AT_import = 0x18,
- DW_AT_string_length = 0x19,
- DW_AT_common_reference = 0x1a,
- DW_AT_comp_dir = 0x1b,
- DW_AT_const_value = 0x1c,
- DW_AT_containing_type = 0x1d,
- DW_AT_default_value = 0x1e,
- DW_AT_inline = 0x20,
- DW_AT_is_optional = 0x21,
- DW_AT_lower_bound = 0x22,
- DW_AT_producer = 0x25,
- DW_AT_prototyped = 0x27,
- DW_AT_return_addr = 0x2a,
- DW_AT_start_scope = 0x2c,
- DW_AT_bit_stride = 0x2e,
- DW_AT_upper_bound = 0x2f,
- DW_AT_abstract_origin = 0x31,
- DW_AT_accessibility = 0x32,
- DW_AT_address_class = 0x33,
- DW_AT_artificial = 0x34,
- DW_AT_base_types = 0x35,
- DW_AT_calling_convention = 0x36,
- DW_AT_count = 0x37,
- DW_AT_data_member_location = 0x38,
- DW_AT_decl_column = 0x39,
- DW_AT_decl_file = 0x3a,
- DW_AT_decl_line = 0x3b,
- DW_AT_declaration = 0x3c,
- DW_AT_discr_list = 0x3d,
- DW_AT_encoding = 0x3e,
- DW_AT_external = 0x3f,
- DW_AT_frame_base = 0x40,
- DW_AT_friend = 0x41,
- DW_AT_identifier_case = 0x42,
- DW_AT_macro_info = 0x43,
- DW_AT_namelist_item = 0x44,
- DW_AT_priority = 0x45,
- DW_AT_segment = 0x46,
- DW_AT_specification = 0x47,
- DW_AT_static_link = 0x48,
- DW_AT_type = 0x49,
- DW_AT_use_location = 0x4a,
- DW_AT_variable_parameter = 0x4b,
- DW_AT_virtuality = 0x4c,
- DW_AT_vtable_elem_location = 0x4d,
- DW_AT_allocated = 0x4e,
- DW_AT_associated = 0x4f,
- DW_AT_data_location = 0x50,
- DW_AT_byte_stride = 0x51,
- DW_AT_entry_pc = 0x52,
- DW_AT_use_UTF8 = 0x53,
- DW_AT_extension = 0x54,
- DW_AT_ranges = 0x55,
- DW_AT_trampoline = 0x56,
- DW_AT_call_column = 0x57,
- DW_AT_call_file = 0x58,
- DW_AT_call_line = 0x59,
- DW_AT_description = 0x5a,
- DW_AT_binary_scale = 0x5b,
- DW_AT_decimal_scale = 0x5c,
- DW_AT_small = 0x5d,
- DW_AT_decimal_sign = 0x5e,
- DW_AT_digit_count = 0x5f,
- DW_AT_picture_string = 0x60,
- DW_AT_mutable = 0x61,
- DW_AT_threads_scaled = 0x62,
- DW_AT_explicit = 0x63,
- DW_AT_object_pointer = 0x64,
- DW_AT_endianity = 0x65,
- DW_AT_elemental = 0x66,
- DW_AT_pure = 0x67,
- DW_AT_recursive = 0x68,
- DW_AT_MIPS_linkage_name = 0x2007,
- DW_AT_sf_names = 0x2101,
- DW_AT_src_info = 0x2102,
- DW_AT_mac_info = 0x2103,
- DW_AT_src_coords = 0x2104,
- DW_AT_body_begin = 0x2105,
- DW_AT_body_end = 0x2106,
- DW_AT_GNU_vector = 0x2107,
- DW_AT_lo_user = 0x2000,
- DW_AT_hi_user = 0x3fff,
-
- // Attribute form encodings
- DW_FORM_addr = 0x01,
- DW_FORM_block2 = 0x03,
- DW_FORM_block4 = 0x04,
- DW_FORM_data2 = 0x05,
- DW_FORM_data4 = 0x06,
- DW_FORM_data8 = 0x07,
- DW_FORM_string = 0x08,
- DW_FORM_block = 0x09,
- DW_FORM_block1 = 0x0a,
- DW_FORM_data1 = 0x0b,
- DW_FORM_flag = 0x0c,
- DW_FORM_sdata = 0x0d,
- DW_FORM_strp = 0x0e,
- DW_FORM_udata = 0x0f,
- DW_FORM_ref_addr = 0x10,
- DW_FORM_ref1 = 0x11,
- DW_FORM_ref2 = 0x12,
- DW_FORM_ref4 = 0x13,
- DW_FORM_ref8 = 0x14,
- DW_FORM_ref_udata = 0x15,
- DW_FORM_indirect = 0x16,
-
- // Operation encodings
- DW_OP_addr = 0x03,
- DW_OP_deref = 0x06,
- DW_OP_const1u = 0x08,
- DW_OP_const1s = 0x09,
- DW_OP_const2u = 0x0a,
- DW_OP_const2s = 0x0b,
- DW_OP_const4u = 0x0c,
- DW_OP_const4s = 0x0d,
- DW_OP_const8u = 0x0e,
- DW_OP_const8s = 0x0f,
- DW_OP_constu = 0x10,
- DW_OP_consts = 0x11,
- DW_OP_dup = 0x12,
- DW_OP_drop = 0x13,
- DW_OP_over = 0x14,
- DW_OP_pick = 0x15,
- DW_OP_swap = 0x16,
- DW_OP_rot = 0x17,
- DW_OP_xderef = 0x18,
- DW_OP_abs = 0x19,
- DW_OP_and = 0x1a,
- DW_OP_div = 0x1b,
- DW_OP_minus = 0x1c,
- DW_OP_mod = 0x1d,
- DW_OP_mul = 0x1e,
- DW_OP_neg = 0x1f,
- DW_OP_not = 0x20,
- DW_OP_or = 0x21,
- DW_OP_plus = 0x22,
- DW_OP_plus_uconst = 0x23,
- DW_OP_shl = 0x24,
- DW_OP_shr = 0x25,
- DW_OP_shra = 0x26,
- DW_OP_xor = 0x27,
- DW_OP_skip = 0x2f,
- DW_OP_bra = 0x28,
- DW_OP_eq = 0x29,
- DW_OP_ge = 0x2a,
- DW_OP_gt = 0x2b,
- DW_OP_le = 0x2c,
- DW_OP_lt = 0x2d,
- DW_OP_ne = 0x2e,
- DW_OP_lit0 = 0x30,
- DW_OP_lit1 = 0x31,
- DW_OP_lit31 = 0x4f,
- DW_OP_reg0 = 0x50,
- DW_OP_reg1 = 0x51,
- DW_OP_reg31 = 0x6f,
- DW_OP_breg0 = 0x70,
- DW_OP_breg1 = 0x71,
- DW_OP_breg31 = 0x8f,
- DW_OP_regx = 0x90,
- DW_OP_fbreg = 0x91,
- DW_OP_bregx = 0x92,
- DW_OP_piece = 0x93,
- DW_OP_deref_size = 0x94,
- DW_OP_xderef_size = 0x95,
- DW_OP_nop = 0x96,
- DW_OP_push_object_address = 0x97,
- DW_OP_call2 = 0x98,
- DW_OP_call4 = 0x99,
- DW_OP_call_ref = 0x9a,
- DW_OP_form_tls_address = 0x9b,
- DW_OP_call_frame_cfa = 0x9c,
- DW_OP_lo_user = 0xe0,
- DW_OP_hi_user = 0xff,
-
- // Encoding attribute values
- DW_ATE_address = 0x01,
- DW_ATE_boolean = 0x02,
- DW_ATE_complex_float = 0x03,
- DW_ATE_float = 0x04,
- DW_ATE_signed = 0x05,
- DW_ATE_signed_char = 0x06,
- DW_ATE_unsigned = 0x07,
- DW_ATE_unsigned_char = 0x08,
- DW_ATE_imaginary_float = 0x09,
- DW_ATE_packed_decimal = 0x0a,
- DW_ATE_numeric_string = 0x0b,
- DW_ATE_edited = 0x0c,
- DW_ATE_signed_fixed = 0x0d,
- DW_ATE_unsigned_fixed = 0x0e,
- DW_ATE_decimal_float = 0x0f,
- DW_ATE_lo_user = 0x80,
- DW_ATE_hi_user = 0xff,
-
- // Decimal sign attribute values
- DW_DS_unsigned = 0x01,
- DW_DS_leading_overpunch = 0x02,
- DW_DS_trailing_overpunch = 0x03,
- DW_DS_leading_separate = 0x04,
- DW_DS_trailing_separate = 0x05,
-
- // Endianity attribute values
- DW_END_default = 0x00,
- DW_END_big = 0x01,
- DW_END_little = 0x02,
- DW_END_lo_user = 0x40,
- DW_END_hi_user = 0xff,
-
- // Accessibility codes
- DW_ACCESS_public = 0x01,
- DW_ACCESS_protected = 0x02,
- DW_ACCESS_private = 0x03,
-
- // Visibility codes
- DW_VIS_local = 0x01,
- DW_VIS_exported = 0x02,
- DW_VIS_qualified = 0x03,
-
- // Virtuality codes
- DW_VIRTUALITY_none = 0x00,
- DW_VIRTUALITY_virtual = 0x01,
- DW_VIRTUALITY_pure_virtual = 0x02,
-
- // Language names
- DW_LANG_C89 = 0x0001,
- DW_LANG_C = 0x0002,
- DW_LANG_Ada83 = 0x0003,
- DW_LANG_C_plus_plus = 0x0004,
- DW_LANG_Cobol74 = 0x0005,
- DW_LANG_Cobol85 = 0x0006,
- DW_LANG_Fortran77 = 0x0007,
- DW_LANG_Fortran90 = 0x0008,
- DW_LANG_Pascal83 = 0x0009,
- DW_LANG_Modula2 = 0x000a,
- DW_LANG_Java = 0x000b,
- DW_LANG_C99 = 0x000c,
- DW_LANG_Ada95 = 0x000d,
- DW_LANG_Fortran95 = 0x000e,
- DW_LANG_PLI = 0x000f,
- DW_LANG_ObjC = 0x0010,
- DW_LANG_ObjC_plus_plus = 0x0011,
- DW_LANG_UPC = 0x0012,
- DW_LANG_D = 0x0013,
- DW_LANG_lo_user = 0x8000,
- DW_LANG_hi_user = 0xffff,
-
- // Identifier case codes
- DW_ID_case_sensitive = 0x00,
- DW_ID_up_case = 0x01,
- DW_ID_down_case = 0x02,
- DW_ID_case_insensitive = 0x03,
-
- // Calling convention codes
- DW_CC_normal = 0x01,
- DW_CC_program = 0x02,
- DW_CC_nocall = 0x03,
- DW_CC_lo_user = 0x40,
- DW_CC_hi_user = 0xff,
-
- // Inline codes
- DW_INL_not_inlined = 0x00,
- DW_INL_inlined = 0x01,
- DW_INL_declared_not_inlined = 0x02,
- DW_INL_declared_inlined = 0x03,
-
- // Array ordering
- DW_ORD_row_major = 0x00,
- DW_ORD_col_major = 0x01,
-
- // Discriminant descriptor values
- DW_DSC_label = 0x00,
- DW_DSC_range = 0x01,
-
- // Line Number Standard Opcode Encodings
- DW_LNS_copy = 0x01,
- DW_LNS_advance_pc = 0x02,
- DW_LNS_advance_line = 0x03,
- DW_LNS_set_file = 0x04,
- DW_LNS_set_column = 0x05,
- DW_LNS_negate_stmt = 0x06,
- DW_LNS_set_basic_block = 0x07,
- DW_LNS_const_add_pc = 0x08,
- DW_LNS_fixed_advance_pc = 0x09,
- DW_LNS_set_prologue_end = 0x0a,
- DW_LNS_set_epilogue_begin = 0x0b,
- DW_LNS_set_isa = 0x0c,
-
- // Line Number Extended Opcode Encodings
- DW_LNE_end_sequence = 0x01,
- DW_LNE_set_address = 0x02,
- DW_LNE_define_file = 0x03,
- DW_LNE_lo_user = 0x80,
- DW_LNE_hi_user = 0xff,
-
- // Macinfo Type Encodings
- DW_MACINFO_define = 0x01,
- DW_MACINFO_undef = 0x02,
- DW_MACINFO_start_file = 0x03,
- DW_MACINFO_end_file = 0x04,
- DW_MACINFO_vendor_ext = 0xff,
-
- // Call frame instruction encodings
- DW_CFA_extended = 0x00,
- DW_CFA_advance_loc = 0x40,
- DW_CFA_offset = 0x80,
- DW_CFA_restore = 0xc0,
- DW_CFA_set_loc = 0x01,
- DW_CFA_advance_loc1 = 0x02,
- DW_CFA_advance_loc2 = 0x03,
- DW_CFA_advance_loc4 = 0x04,
- DW_CFA_offset_extended = 0x05,
- DW_CFA_restore_extended = 0x06,
- DW_CFA_undefined = 0x07,
- DW_CFA_same_value = 0x08,
- DW_CFA_register = 0x09,
- DW_CFA_remember_state = 0x0a,
- DW_CFA_restore_state = 0x0b,
- DW_CFA_def_cfa = 0x0c,
- DW_CFA_def_cfa_register = 0x0d,
- DW_CFA_def_cfa_offset = 0x0e,
- DW_CFA_def_cfa_expression = 0x0f,
- DW_CFA_expression = 0x10,
- DW_CFA_offset_extended_sf = 0x11,
- DW_CFA_def_cfa_sf = 0x12,
- DW_CFA_def_cfa_offset_sf = 0x13,
- DW_CFA_val_offset = 0x14,
- DW_CFA_val_offset_sf = 0x15,
- DW_CFA_val_expression = 0x16,
- DW_CFA_lo_user = 0x1c,
- DW_CFA_hi_user = 0x3f,
-
- DW_EH_PE_absptr = 0x00,
- DW_EH_PE_omit = 0xff,
- DW_EH_PE_uleb128 = 0x01,
- DW_EH_PE_udata2 = 0x02,
- DW_EH_PE_udata4 = 0x03,
- DW_EH_PE_udata8 = 0x04,
- DW_EH_PE_sleb128 = 0x09,
- DW_EH_PE_sdata2 = 0x0A,
- DW_EH_PE_sdata4 = 0x0B,
- DW_EH_PE_sdata8 = 0x0C,
- DW_EH_PE_signed = 0x08,
- DW_EH_PE_pcrel = 0x10,
- DW_EH_PE_textrel = 0x20,
- DW_EH_PE_datarel = 0x30,
- DW_EH_PE_funcrel = 0x40,
- DW_EH_PE_aligned = 0x50,
- DW_EH_PE_indirect = 0x80
-};
-
-/// TagString - Return the string for the specified tag.
-///
-const char *TagString(unsigned Tag);
-
-/// ChildrenString - Return the string for the specified children flag.
-///
-const char *ChildrenString(unsigned Children);
-
-/// AttributeString - Return the string for the specified attribute.
-///
-const char *AttributeString(unsigned Attribute);
-
-/// FormEncodingString - Return the string for the specified form encoding.
-///
-const char *FormEncodingString(unsigned Encoding);
-
-/// OperationEncodingString - Return the string for the specified operation
-/// encoding.
-const char *OperationEncodingString(unsigned Encoding);
-
-/// AttributeEncodingString - Return the string for the specified attribute
-/// encoding.
-const char *AttributeEncodingString(unsigned Encoding);
-
-/// DecimalSignString - Return the string for the specified decimal sign
-/// attribute.
-const char *DecimalSignString(unsigned Sign);
-
-/// EndianityString - Return the string for the specified endianity.
-///
-const char *EndianityString(unsigned Endian);
-
-/// AccessibilityString - Return the string for the specified accessibility.
-///
-const char *AccessibilityString(unsigned Access);
-
-/// VisibilityString - Return the string for the specified visibility.
-///
-const char *VisibilityString(unsigned Visibility);
-
-/// VirtualityString - Return the string for the specified virtuality.
-///
-const char *VirtualityString(unsigned Virtuality);
-
-/// LanguageString - Return the string for the specified language.
-///
-const char *LanguageString(unsigned Language);
-
-/// CaseString - Return the string for the specified identifier case.
-///
-const char *CaseString(unsigned Case);
-
-/// ConventionString - Return the string for the specified calling convention.
-///
-const char *ConventionString(unsigned Convention);
-
-/// InlineCodeString - Return the string for the specified inline code.
-///
-const char *InlineCodeString(unsigned Code);
-
-/// ArrayOrderString - Return the string for the specified array order.
-///
-const char *ArrayOrderString(unsigned Order);
-
-/// DiscriminantString - Return the string for the specified discriminant
-/// descriptor.
-const char *DiscriminantString(unsigned Discriminant);
-
-/// LNStandardString - Return the string for the specified line number standard.
-///
-const char *LNStandardString(unsigned Standard);
-
-/// LNExtendedString - Return the string for the specified line number extended
-/// opcode encodings.
-const char *LNExtendedString(unsigned Encoding);
-
-/// MacinfoString - Return the string for the specified macinfo type encodings.
-///
-const char *MacinfoString(unsigned Encoding);
-
-/// CallFrameString - Return the string for the specified call frame instruction
-/// encodings.
-const char *CallFrameString(unsigned Encoding);
-
-} // End of namespace dwarf
-
-} // End of namespace llvm
-
-#endif
diff --git a/release_23/include/llvm/Support/DynamicLinker.h b/release_23/include/llvm/Support/DynamicLinker.h
deleted file mode 100644
index b60ffa875c63..000000000000
--- a/release_23/include/llvm/Support/DynamicLinker.h
+++ /dev/null
@@ -1,40 +0,0 @@
-//===-- llvm/Support/DynamicLinker.h - Portable Dynamic Linker --*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// Lightweight interface to dynamic library linking and loading, and dynamic
-// symbol lookup functionality, in whatever form the operating system
-// provides it.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_SUPPORT_DYNAMICLINKER_H
-#define LLVM_SUPPORT_DYNAMICLINKER_H
-
-#include <string>
-
-namespace llvm {
-
-/// LinkDynamicObject - Load the named file as a dynamic library
-/// and link it with the currently running process. Returns false
-/// on success, true if there is an error (and sets ErrorMessage
-/// if it is not NULL). Analogous to dlopen().
-///
-bool LinkDynamicObject (const char *filename, std::string *ErrorMessage);
-
-/// GetAddressOfSymbol - Returns the address of the named symbol in
-/// the currently running process, as reported by the dynamic linker,
-/// or NULL if the symbol does not exist or some other error has
-/// occurred.
-///
-void *GetAddressOfSymbol (const char *symbolName);
-void *GetAddressOfSymbol (const std::string &symbolName);
-
-} // End llvm namespace
-
-#endif // SUPPORT_DYNAMICLINKER_H
diff --git a/release_23/include/llvm/Support/ELF.h b/release_23/include/llvm/Support/ELF.h
deleted file mode 100644
index 3a9c9703215f..000000000000
--- a/release_23/include/llvm/Support/ELF.h
+++ /dev/null
@@ -1,300 +0,0 @@
-//===-- llvm/Support/ELF.h - ELF constants and data structures --*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This header contains common, non-processor-specific data structures and
-// constants for the ELF file format.
-//
-// The details of the ELF32 bits in this file are largely based on
-// the Tool Interface Standard (TIS) Executable and Linking Format
-// (ELF) Specification Version 1.2, May 1995. The ELF64 stuff is not
-// standardized, as far as I can tell. It was largely based on information
-// I found in OpenBSD header files.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_SUPPORT_ELF_H
-#define LLVM_SUPPORT_ELF_H
-
-#include "llvm/Support/DataTypes.h"
-#include <cstring>
-#include <cstdlib>
-
-namespace llvm {
-
-namespace ELF {
-
-typedef uint32_t Elf32_Addr; // Program address
-typedef uint16_t Elf32_Half;
-typedef uint32_t Elf32_Off; // File offset
-typedef int32_t Elf32_Sword;
-typedef uint32_t Elf32_Word;
-
-typedef uint64_t Elf64_Addr;
-typedef uint64_t Elf64_Off;
-typedef int32_t Elf64_Shalf;
-typedef int32_t Elf64_Sword;
-typedef uint32_t Elf64_Word;
-typedef int64_t Elf64_Sxword;
-typedef uint64_t Elf64_Xword;
-typedef uint32_t Elf64_Half;
-typedef uint16_t Elf64_Quarter;
-
-// Object file magic string.
-static const char ElfMagic[] = { 0x7f, 'E', 'L', 'F', '\0' };
-
-struct Elf32_Ehdr {
- unsigned char e_ident[16]; // ELF Identification bytes
- Elf32_Half e_type; // Type of file (see ET_* below)
- Elf32_Half e_machine; // Required architecture for this file (see EM_*)
- Elf32_Word e_version; // Must be equal to 1
- Elf32_Addr e_entry; // Address to jump to in order to start program
- Elf32_Off e_phoff; // Program header table's file offset, in bytes
- Elf32_Off e_shoff; // Section header table's file offset, in bytes
- Elf32_Word e_flags; // Processor-specific flags
- Elf32_Half e_ehsize; // Size of ELF header, in bytes
- Elf32_Half e_phentsize; // Size of an entry in the program header table
- Elf32_Half e_phnum; // Number of entries in the program header table
- Elf32_Half e_shentsize; // Size of an entry in the section header table
- Elf32_Half e_shnum; // Number of entries in the section header table
- Elf32_Half e_shstrndx; // Sect hdr table index of sect name string table
- bool checkMagic () const {
- return (memcmp (e_ident, ElfMagic, strlen (ElfMagic))) == 0;
- }
- unsigned char getFileClass () const { return e_ident[4]; }
- unsigned char getDataEncoding () { return e_ident[5]; }
-};
-
-// 64-bit ELF header. Fields are the same as for ELF32, but with different
-// types (see above).
-struct Elf64_Ehdr {
- unsigned char e_ident[16];
- Elf64_Quarter e_type;
- Elf64_Quarter e_machine;
- Elf64_Half e_version;
- Elf64_Addr e_entry;
- Elf64_Off e_phoff;
- Elf64_Off e_shoff;
- Elf64_Half e_flags;
- Elf64_Quarter e_ehsize;
- Elf64_Quarter e_phentsize;
- Elf64_Quarter e_phnum;
- Elf64_Quarter e_shentsize;
- Elf64_Quarter e_shnum;
- Elf64_Quarter e_shstrndx;
-};
-
-// File types
-enum {
- ET_NONE = 0, // No file type
- ET_REL = 1, // Relocatable file
- ET_EXEC = 2, // Executable file
- ET_DYN = 3, // Shared object file
- ET_CORE = 4, // Core file
- ET_LOPROC = 0xff00, // Beginning of processor-specific codes
- ET_HIPROC = 0xffff // Processor-specific
-};
-
-// Machine architectures
-enum {
- EM_NONE = 0, // No machine
- EM_M32 = 1, // AT&T WE 32100
- EM_SPARC = 2, // SPARC
- EM_386 = 3, // Intel 386
- EM_68K = 4, // Motorola 68000
- EM_88K = 5, // Motorola 88000
- EM_486 = 6, // Intel 486 (deprecated)
- EM_860 = 7, // Intel 80860
- EM_MIPS = 8, // MIPS R3000
- EM_PPC = 20, // PowerPC
- EM_ARM = 40, // ARM
- EM_ALPHA = 41, // DEC Alpha
- EM_SPARCV9 = 43 // SPARC V9
-};
-
-// Object file classes.
-enum {
- ELFCLASS32 = 1, // 32-bit object file
- ELFCLASS64 = 2 // 64-bit object file
-};
-
-// Object file byte orderings.
-enum {
- ELFDATA2LSB = 1, // Little-endian object file
- ELFDATA2MSB = 2 // Big-endian object file
-};
-
-// Section header.
-struct Elf32_Shdr {
- Elf32_Word sh_name; // Section name (index into string table)
- Elf32_Word sh_type; // Section type (SHT_*)
- Elf32_Word sh_flags; // Section flags (SHF_*)
- Elf32_Addr sh_addr; // Address where section is to be loaded
- Elf32_Off sh_offset; // File offset of section data, in bytes
- Elf32_Word sh_size; // Size of section, in bytes
- Elf32_Word sh_link; // Section type-specific header table index link
- Elf32_Word sh_info; // Section type-specific extra information
- Elf32_Word sh_addralign; // Section address alignment
- Elf32_Word sh_entsize; // Size of records contained within the section
-};
-
-// Section header for ELF64 - same fields as ELF32, different types.
-struct Elf64_Shdr {
- Elf64_Half sh_name;
- Elf64_Half sh_type;
- Elf64_Xword sh_flags;
- Elf64_Addr sh_addr;
- Elf64_Off sh_offset;
- Elf64_Xword sh_size;
- Elf64_Half sh_link;
- Elf64_Half sh_info;
- Elf64_Xword sh_addralign;
- Elf64_Xword sh_entsize;
-};
-
-// Special section indices.
-enum {
- SHN_UNDEF = 0, // Undefined, missing, irrelevant, or meaningless
- SHN_LORESERVE = 0xff00, // Lowest reserved index
- SHN_LOPROC = 0xff00, // Lowest processor-specific index
- SHN_HIPROC = 0xff1f, // Highest processor-specific index
- SHN_ABS = 0xfff1, // Symbol has absolute value; does not need relocation
- SHN_COMMON = 0xfff2, // FORTRAN COMMON or C external global variables
- SHN_HIRESERVE = 0xffff // Highest reserved index
-};
-
-// Section types.
-enum {
- SHT_NULL = 0, // No associated section (inactive entry).
- SHT_PROGBITS = 1, // Program-defined contents.
- SHT_SYMTAB = 2, // Symbol table.
- SHT_STRTAB = 3, // String table.
- SHT_RELA = 4, // Relocation entries; explicit addends.
- SHT_HASH = 5, // Symbol hash table.
- SHT_DYNAMIC = 6, // Information for dynamic linking.
- SHT_NOTE = 7, // Information about the file.
- SHT_NOBITS = 8, // Data occupies no space in the file.
- SHT_REL = 9, // Relocation entries; no explicit addends.
- SHT_SHLIB = 10, // Reserved.
- SHT_DYNSYM = 11, // Symbol table.
- SHT_LOPROC = 0x70000000, // Lowest processor architecture-specific type.
- SHT_HIPROC = 0x7fffffff, // Highest processor architecture-specific type.
- SHT_LOUSER = 0x80000000, // Lowest type reserved for applications.
- SHT_HIUSER = 0xffffffff // Highest type reserved for applications.
-};
-
-// Section flags.
-enum {
- SHF_WRITE = 0x1, // Section data should be writable during execution.
- SHF_ALLOC = 0x2, // Section occupies memory during program execution.
- SHF_EXECINSTR = 0x4, // Section contains executable machine instructions.
- SHF_MASKPROC = 0xf0000000 // Bits indicating processor-specific flags.
-};
-
-// Symbol table entries.
-struct Elf32_Sym {
- Elf32_Word st_name; // Symbol name (index into string table)
- Elf32_Addr st_value; // Value or address associated with the symbol
- Elf32_Word st_size; // Size of the symbol
- unsigned char st_info; // Symbol's type and binding attributes
- unsigned char st_other; // Must be zero; reserved
- Elf32_Half st_shndx; // Which section (header table index) it's defined in
-
- // These accessors and mutators correspond to the ELF32_ST_BIND,
- // ELF32_ST_TYPE, and ELF32_ST_INFO macros defined in the ELF specification:
- unsigned char getBinding () const { return st_info >> 4; }
- unsigned char getType () const { return st_info & 0x0f; }
- void setBinding (unsigned char b) { setBindingAndType (b, getType ()); }
- void setType (unsigned char t) { setBindingAndType (getBinding (), t); }
- void setBindingAndType (unsigned char b, unsigned char t) {
- st_info = (b << 4) + (t & 0x0f);
- }
-};
-
-// Symbol bindings.
-enum {
- STB_LOCAL = 0, // Local symbol, not visible outside obj file containing def
- STB_GLOBAL = 1, // Global symbol, visible to all object files being combined
- STB_WEAK = 2, // Weak symbol, like global but lower-precedence
- STB_LOPROC = 13, // Lowest processor-specific binding type
- STB_HIPROC = 15 // Highest processor-specific binding type
-};
-
-// Symbol types.
-enum {
- STT_NOTYPE = 0, // Symbol's type is not specified
- STT_OBJECT = 1, // Symbol is a data object (variable, array, etc.)
- STT_FUNC = 2, // Symbol is executable code (function, etc.)
- STT_SECTION = 3, // Symbol refers to a section
- STT_FILE = 4, // Local, absolute symbol that refers to a file
- STT_LOPROC = 13, // Lowest processor-specific symbol type
- STT_HIPROC = 15 // Highest processor-specific symbol type
-};
-
-// Relocation entry, without explicit addend.
-struct Elf32_Rel {
- Elf32_Addr r_offset; // Location (file byte offset, or program virtual addr)
- Elf32_Word r_info; // Symbol table index and type of relocation to apply
-
- // These accessors and mutators correspond to the ELF32_R_SYM, ELF32_R_TYPE,
- // and ELF32_R_INFO macros defined in the ELF specification:
- Elf32_Word getSymbol () const { return (r_info >> 8); }
- unsigned char getType () const { return (unsigned char) (r_info & 0x0ff); }
- void setSymbol (Elf32_Word s) { setSymbolAndType (s, getType ()); }
- void setType (unsigned char t) { setSymbolAndType (getSymbol(), t); }
- void setSymbolAndType (Elf32_Word s, unsigned char t) {
- r_info = (s << 8) + t;
- };
-};
-
-// Relocation entry with explicit addend.
-struct Elf32_Rela {
- Elf32_Addr r_offset; // Location (file byte offset, or program virtual addr)
- Elf32_Word r_info; // Symbol table index and type of relocation to apply
- Elf32_Sword r_addend; // Compute value for relocatable field by adding this
-
- // These accessors and mutators correspond to the ELF32_R_SYM, ELF32_R_TYPE,
- // and ELF32_R_INFO macros defined in the ELF specification:
- Elf32_Word getSymbol () const { return (r_info >> 8); }
- unsigned char getType () const { return (unsigned char) (r_info & 0x0ff); }
- void setSymbol (Elf32_Word s) { setSymbolAndType (s, getType ()); }
- void setType (unsigned char t) { setSymbolAndType (getSymbol(), t); }
- void setSymbolAndType (Elf32_Word s, unsigned char t) {
- r_info = (s << 8) + t;
- };
-};
-
-// Program header.
-struct Elf32_Phdr {
- Elf32_Word p_type; // Type of segment
- Elf32_Off p_offset; // File offset where segment is located, in bytes
- Elf32_Addr p_vaddr; // Virtual address of beginning of segment
- Elf32_Addr p_paddr; // Physical address of beginning of segment (OS-specific)
- Elf32_Word p_filesz; // Num. of bytes in file image of segment (may be zero)
- Elf32_Word p_memsz; // Num. of bytes in mem image of segment (may be zero)
- Elf32_Word p_flags; // Segment flags
- Elf32_Word p_align; // Segment alignment constraint
-};
-
-enum {
- PT_NULL = 0, // Unused segment.
- PT_LOAD = 1, // Loadable segment.
- PT_DYNAMIC = 2, // Dynamic linking information.
- PT_INTERP = 3, // Interpreter pathname.
- PT_NOTE = 4, // Auxiliary information.
- PT_SHLIB = 5, // Reserved.
- PT_PHDR = 6, // The program header table itself.
- PT_LOPROC = 0x70000000, // Lowest processor-specific program hdr entry type.
- PT_HIPROC = 0x7fffffff // Highest processor-specific program hdr entry type.
-};
-
-} // end namespace ELF
-
-} // end namespace llvm
-
-#endif
diff --git a/release_23/include/llvm/Support/FileUtilities.h b/release_23/include/llvm/Support/FileUtilities.h
deleted file mode 100644
index 44c699faa56b..000000000000
--- a/release_23/include/llvm/Support/FileUtilities.h
+++ /dev/null
@@ -1,59 +0,0 @@
-//===- llvm/Support/FileUtilities.h - File System Utilities -----*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines a family of utility functions which are useful for doing
-// various things with files.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_SUPPORT_FILEUTILITIES_H
-#define LLVM_SUPPORT_FILEUTILITIES_H
-
-#include "llvm/System/Path.h"
-
-namespace llvm {
-
- /// DiffFilesWithTolerance - Compare the two files specified, returning 0 if
- /// the files match, 1 if they are different, and 2 if there is a file error.
- /// This function allows you to specify an absolete and relative FP error that
- /// is allowed to exist. If you specify a string to fill in for the error
- /// option, it will set the string to an error message if an error occurs, or
- /// if the files are different.
- ///
- int DiffFilesWithTolerance(const sys::PathWithStatus &FileA,
- const sys::PathWithStatus &FileB,
- double AbsTol, double RelTol,
- std::string *Error = 0);
-
-
- /// FileRemover - This class is a simple object meant to be stack allocated.
- /// If an exception is thrown from a region, the object removes the filename
- /// specified (if deleteIt is true).
- ///
- class FileRemover {
- sys::Path Filename;
- bool DeleteIt;
- public:
- explicit FileRemover(const sys::Path &filename, bool deleteIt = true)
- : Filename(filename), DeleteIt(deleteIt) {}
-
- ~FileRemover() {
- if (DeleteIt) {
- // Ignore problems deleting the file.
- Filename.eraseFromDisk();
- }
- }
-
- /// releaseFile - Take ownership of the file away from the FileRemover so it
- /// will not be removed when the object is destroyed.
- void releaseFile() { DeleteIt = false; }
- };
-} // End llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/Support/GetElementPtrTypeIterator.h b/release_23/include/llvm/Support/GetElementPtrTypeIterator.h
deleted file mode 100644
index e1cda75c5f6a..000000000000
--- a/release_23/include/llvm/Support/GetElementPtrTypeIterator.h
+++ /dev/null
@@ -1,112 +0,0 @@
-//===- llvm/Support/GetElementPtrTypeIterator.h -----------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements an iterator for walking through the types indexed by
-// getelementptr instructions.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_SUPPORT_GETELEMENTPTRTYPE_H
-#define LLVM_SUPPORT_GETELEMENTPTRTYPE_H
-
-#include "llvm/User.h"
-#include "llvm/DerivedTypes.h"
-
-namespace llvm {
- template<typename ItTy = User::const_op_iterator>
- class generic_gep_type_iterator
- : public forward_iterator<const Type *, ptrdiff_t> {
- typedef forward_iterator<const Type*, ptrdiff_t> super;
-
- ItTy OpIt;
- const Type *CurTy;
- generic_gep_type_iterator() {}
- public:
-
- static generic_gep_type_iterator begin(const Type *Ty, ItTy It) {
- generic_gep_type_iterator I;
- I.CurTy = Ty;
- I.OpIt = It;
- return I;
- }
- static generic_gep_type_iterator end(ItTy It) {
- generic_gep_type_iterator I;
- I.CurTy = 0;
- I.OpIt = It;
- return I;
- }
-
- bool operator==(const generic_gep_type_iterator& x) const {
- return OpIt == x.OpIt;
- }
- bool operator!=(const generic_gep_type_iterator& x) const {
- return !operator==(x);
- }
-
- const Type *operator*() const {
- return CurTy;
- }
-
- const Type *getIndexedType() const {
- const CompositeType *CT = cast<CompositeType>(CurTy);
- return CT->getTypeAtIndex(getOperand());
- }
-
- // This is a non-standard operator->. It allows you to call methods on the
- // current type directly.
- const Type *operator->() const { return operator*(); }
-
- Value *getOperand() const { return *OpIt; }
-
- generic_gep_type_iterator& operator++() { // Preincrement
- if (const CompositeType *CT = dyn_cast<CompositeType>(CurTy)) {
- CurTy = CT->getTypeAtIndex(getOperand());
- } else {
- CurTy = 0;
- }
- ++OpIt;
- return *this;
- }
-
- generic_gep_type_iterator operator++(int) { // Postincrement
- generic_gep_type_iterator tmp = *this; ++*this; return tmp;
- }
- };
-
- typedef generic_gep_type_iterator<> gep_type_iterator;
-
- inline gep_type_iterator gep_type_begin(const User *GEP) {
- return gep_type_iterator::begin(GEP->getOperand(0)->getType(),
- GEP->op_begin()+1);
- }
- inline gep_type_iterator gep_type_end(const User *GEP) {
- return gep_type_iterator::end(GEP->op_end());
- }
- inline gep_type_iterator gep_type_begin(const User &GEP) {
- return gep_type_iterator::begin(GEP.getOperand(0)->getType(),
- GEP.op_begin()+1);
- }
- inline gep_type_iterator gep_type_end(const User &GEP) {
- return gep_type_iterator::end(GEP.op_end());
- }
-
- template<typename ItTy>
- inline generic_gep_type_iterator<ItTy>
- gep_type_begin(const Type *Op0, ItTy I, ItTy E) {
- return generic_gep_type_iterator<ItTy>::begin(Op0, I);
- }
-
- template<typename ItTy>
- inline generic_gep_type_iterator<ItTy>
- gep_type_end(const Type *Op0, ItTy I, ItTy E) {
- return generic_gep_type_iterator<ItTy>::end(E);
- }
-} // end namespace llvm
-
-#endif
diff --git a/release_23/include/llvm/Support/GraphWriter.h b/release_23/include/llvm/Support/GraphWriter.h
deleted file mode 100644
index cb9199162ed3..000000000000
--- a/release_23/include/llvm/Support/GraphWriter.h
+++ /dev/null
@@ -1,317 +0,0 @@
-//===-- llvm/Support/GraphWriter.h - Write graph to a .dot file -*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines a simple interface that can be used to print out generic
-// LLVM graphs to ".dot" files. "dot" is a tool that is part of the AT&T
-// graphviz package (http://www.research.att.com/sw/tools/graphviz/) which can
-// be used to turn the files output by this interface into a variety of
-// different graphics formats.
-//
-// Graphs do not need to implement any interface past what is already required
-// by the GraphTraits template, but they can choose to implement specializations
-// of the DOTGraphTraits template if they want to customize the graphs output in
-// any way.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_SUPPORT_GRAPHWRITER_H
-#define LLVM_SUPPORT_GRAPHWRITER_H
-
-#include "llvm/Support/Debug.h"
-#include "llvm/Support/DOTGraphTraits.h"
-#include "llvm/ADT/GraphTraits.h"
-#include "llvm/System/Path.h"
-#include <fstream>
-#include <vector>
-
-namespace llvm {
-
-namespace DOT { // Private functions...
- inline std::string EscapeString(const std::string &Label) {
- std::string Str(Label);
- for (unsigned i = 0; i != Str.length(); ++i)
- switch (Str[i]) {
- case '\n':
- Str.insert(Str.begin()+i, '\\'); // Escape character...
- ++i;
- Str[i] = 'n';
- break;
- case '\t':
- Str.insert(Str.begin()+i, ' '); // Convert to two spaces
- ++i;
- Str[i] = ' ';
- break;
- case '\\':
- if (i+1 != Str.length())
- switch (Str[i+1]) {
- case 'l': continue; // don't disturb \l
- case '|': case '{': case '}':
- Str.erase(Str.begin()+i); continue;
- default: break;
- }
- case '{': case '}':
- case '<': case '>':
- case '|': case '"':
- Str.insert(Str.begin()+i, '\\'); // Escape character...
- ++i; // don't infinite loop
- break;
- }
- return Str;
- }
-}
-
-void DisplayGraph(const sys::Path& Filename);
-
-template<typename GraphType>
-class GraphWriter {
- std::ostream &O;
- const GraphType &G;
-
- typedef DOTGraphTraits<GraphType> DOTTraits;
- typedef GraphTraits<GraphType> GTraits;
- typedef typename GTraits::NodeType NodeType;
- typedef typename GTraits::nodes_iterator node_iterator;
- typedef typename GTraits::ChildIteratorType child_iterator;
-public:
- GraphWriter(std::ostream &o, const GraphType &g) : O(o), G(g) {}
-
- void writeHeader(const std::string &Name) {
- if (Name.empty())
- O << "digraph foo {\n"; // Graph name doesn't matter
- else
- O << "digraph " << Name << " {\n";
-
- if (DOTTraits::renderGraphFromBottomUp())
- O << "\trankdir=\"BT\";\n";
-
- std::string GraphName = DOTTraits::getGraphName(G);
- if (!GraphName.empty())
- O << "\tlabel=\"" << DOT::EscapeString(GraphName) << "\";\n";
- O << DOTTraits::getGraphProperties(G);
- O << "\n";
- }
-
- void writeFooter() {
- // Finish off the graph
- O << "}\n";
- }
-
- void writeNodes() {
- // Loop over the graph, printing it out...
- for (node_iterator I = GTraits::nodes_begin(G), E = GTraits::nodes_end(G);
- I != E; ++I)
- writeNode(*I);
- }
-
- void writeNode(NodeType& Node) {
- writeNode(&Node);
- }
-
- void writeNode(NodeType *const *Node) {
- writeNode(*Node);
- }
-
- void writeNode(NodeType *Node) {
- std::string NodeAttributes = DOTTraits::getNodeAttributes(Node, G);
-
- O << "\tNode" << reinterpret_cast<const void*>(Node) << " [shape=record,";
- if (!NodeAttributes.empty()) O << NodeAttributes << ",";
- O << "label=\"{";
-
- if (!DOTTraits::renderGraphFromBottomUp()) {
- O << DOT::EscapeString(DOTTraits::getNodeLabel(Node, G));
-
- // If we should include the address of the node in the label, do so now.
- if (DOTTraits::hasNodeAddressLabel(Node, G))
- O << "|" << (void*)Node;
- }
-
- // Print out the fields of the current node...
- child_iterator EI = GTraits::child_begin(Node);
- child_iterator EE = GTraits::child_end(Node);
- if (EI != EE) {
- if (!DOTTraits::renderGraphFromBottomUp()) O << "|";
- O << "{";
-
- for (unsigned i = 0; EI != EE && i != 64; ++EI, ++i) {
- if (i) O << "|";
- O << "<g" << i << ">" << DOTTraits::getEdgeSourceLabel(Node, EI);
- }
-
- if (EI != EE)
- O << "|<g64>truncated...";
- O << "}";
- if (DOTTraits::renderGraphFromBottomUp()) O << "|";
- }
-
- if (DOTTraits::renderGraphFromBottomUp()) {
- O << DOT::EscapeString(DOTTraits::getNodeLabel(Node, G));
-
- // If we should include the address of the node in the label, do so now.
- if (DOTTraits::hasNodeAddressLabel(Node, G))
- O << "|" << (void*)Node;
- }
-
- O << "}\"];\n"; // Finish printing the "node" line
-
- // Output all of the edges now
- EI = GTraits::child_begin(Node);
- for (unsigned i = 0; EI != EE && i != 64; ++EI, ++i)
- writeEdge(Node, i, EI);
- for (; EI != EE; ++EI)
- writeEdge(Node, 64, EI);
- }
-
- void writeEdge(NodeType *Node, unsigned edgeidx, child_iterator EI) {
- if (NodeType *TargetNode = *EI) {
- int DestPort = -1;
- if (DOTTraits::edgeTargetsEdgeSource(Node, EI)) {
- child_iterator TargetIt = DOTTraits::getEdgeTarget(Node, EI);
-
- // Figure out which edge this targets...
- unsigned Offset =
- (unsigned)std::distance(GTraits::child_begin(TargetNode), TargetIt);
- DestPort = static_cast<int>(Offset);
- }
-
- emitEdge(reinterpret_cast<const void*>(Node), edgeidx,
- reinterpret_cast<const void*>(TargetNode), DestPort,
- DOTTraits::getEdgeAttributes(Node, EI));
- }
- }
-
- /// emitSimpleNode - Outputs a simple (non-record) node
- void emitSimpleNode(const void *ID, const std::string &Attr,
- const std::string &Label, unsigned NumEdgeSources = 0,
- const std::vector<std::string> *EdgeSourceLabels = 0) {
- O << "\tNode" << ID << "[ ";
- if (!Attr.empty())
- O << Attr << ",";
- O << " label =\"";
- if (NumEdgeSources) O << "{";
- O << DOT::EscapeString(Label);
- if (NumEdgeSources) {
- O << "|{";
-
- for (unsigned i = 0; i != NumEdgeSources; ++i) {
- if (i) O << "|";
- O << "<g" << i << ">";
- if (EdgeSourceLabels) O << (*EdgeSourceLabels)[i];
- }
- O << "}}";
- }
- O << "\"];\n";
- }
-
- /// emitEdge - Output an edge from a simple node into the graph...
- void emitEdge(const void *SrcNodeID, int SrcNodePort,
- const void *DestNodeID, int DestNodePort,
- const std::string &Attrs) {
- if (SrcNodePort > 64) return; // Eminating from truncated part?
- if (DestNodePort > 64) DestNodePort = 64; // Targetting the truncated part?
-
- O << "\tNode" << SrcNodeID;
- if (SrcNodePort >= 0)
- O << ":g" << SrcNodePort;
- O << " -> Node" << reinterpret_cast<const void*>(DestNodeID);
- if (DestNodePort >= 0)
- O << ":g" << DestNodePort;
-
- if (!Attrs.empty())
- O << "[" << Attrs << "]";
- O << ";\n";
- }
-};
-
-template<typename GraphType>
-std::ostream &WriteGraph(std::ostream &O, const GraphType &G,
- const std::string &Name = "") {
- // Start the graph emission process...
- GraphWriter<GraphType> W(O, G);
-
- // Output the header for the graph...
- W.writeHeader(Name);
-
- // Emit all of the nodes in the graph...
- W.writeNodes();
-
- // Output any customizations on the graph
- DOTGraphTraits<GraphType>::addCustomGraphFeatures(G, W);
-
- // Output the end of the graph
- W.writeFooter();
- return O;
-}
-
-template<typename GraphType>
-sys::Path WriteGraph(const GraphType &G,
- const std::string& Name,
- const std::string& Title = "") {
- std::string ErrMsg;
- sys::Path Filename = sys::Path::GetTemporaryDirectory(&ErrMsg);
- if (Filename.isEmpty()) {
- cerr << "Error: " << ErrMsg << "\n";
- return Filename;
- }
- Filename.appendComponent(Name + ".dot");
- if (Filename.makeUnique(true,&ErrMsg)) {
- cerr << "Error: " << ErrMsg << "\n";
- return sys::Path();
- }
-
- cerr << "Writing '" << Filename << "'... ";
-
- std::ofstream O(Filename.c_str());
-
- if (O.good()) {
- // Start the graph emission process...
- GraphWriter<GraphType> W(O, G);
-
- // Output the header for the graph...
- W.writeHeader(Title);
-
- // Emit all of the nodes in the graph...
- W.writeNodes();
-
- // Output any customizations on the graph
- DOTGraphTraits<GraphType>::addCustomGraphFeatures(G, W);
-
- // Output the end of the graph
- W.writeFooter();
- cerr << " done. \n";
-
- O.close();
-
- } else {
- cerr << "error opening file for writing!\n";
- Filename.clear();
- }
-
- return Filename;
-}
-
-/// ViewGraph - Emit a dot graph, run 'dot', run gv on the postscript file,
-/// then cleanup. For use from the debugger.
-///
-template<typename GraphType>
-void ViewGraph(const GraphType& G,
- const std::string& Name,
- const std::string& Title = "") {
- sys::Path Filename = WriteGraph(G, Name, Title);
-
- if (Filename.isEmpty()) {
- return;
- }
-
- DisplayGraph(Filename);
-}
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/Support/IRBuilder.h b/release_23/include/llvm/Support/IRBuilder.h
deleted file mode 100644
index c965cd3e13b4..000000000000
--- a/release_23/include/llvm/Support/IRBuilder.h
+++ /dev/null
@@ -1,542 +0,0 @@
-//===---- llvm/Support/IRBuilder.h - Builder for LLVM Instrs ----*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines the IRBuilder class, which is used as a convenient way
-// to create LLVM instructions with a consistent and simplified interface.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_SUPPORT_IRBUILDER_H
-#define LLVM_SUPPORT_IRBUILDER_H
-
-#include "llvm/BasicBlock.h"
-#include "llvm/Instructions.h"
-#include "llvm/Constants.h"
-
-namespace llvm {
-
-/// IRBuilder - This provides a uniform API for creating instructions and
-/// inserting them into a basic block: either at the end of a BasicBlock, or
-/// at a specific iterator location in a block.
-///
-/// Note that the builder does not expose the full generality of LLVM
-/// instructions. For example, it cannot be used to create instructions with
-/// arbitrary names (specifically, names with nul characters in them) - It only
-/// supports nul-terminated C strings. For fully generic names, use
-/// I->setName(). For access to extra instruction properties, use the mutators
-/// (e.g. setVolatile) on the instructions after they have been created.
-class IRBuilder {
- BasicBlock *BB;
- BasicBlock::iterator InsertPt;
-public:
- IRBuilder() { ClearInsertionPoint(); }
- explicit IRBuilder(BasicBlock *TheBB) { SetInsertPoint(TheBB); }
- IRBuilder(BasicBlock *TheBB, BasicBlock::iterator IP) {
- SetInsertPoint(TheBB, IP);
- }
-
- //===--------------------------------------------------------------------===//
- // Builder configuration methods
- //===--------------------------------------------------------------------===//
-
- /// ClearInsertionPoint - Clear the insertion point: created instructions will
- /// not be inserted into a block.
- void ClearInsertionPoint() {
- BB = 0;
- }
-
- BasicBlock *GetInsertBlock() const { return BB; }
-
- /// SetInsertPoint - This specifies that created instructions should be
- /// appended to the end of the specified block.
- void SetInsertPoint(BasicBlock *TheBB) {
- BB = TheBB;
- InsertPt = BB->end();
- }
-
- /// SetInsertPoint - This specifies that created instructions should be
- /// inserted at the specified point.
- void SetInsertPoint(BasicBlock *TheBB, BasicBlock::iterator IP) {
- BB = TheBB;
- InsertPt = IP;
- }
-
- /// Insert - Insert and return the specified instruction.
- template<typename InstTy>
- InstTy *Insert(InstTy *I) const {
- InsertHelper(I);
- return I;
- }
-
- /// InsertHelper - Insert the specified instruction at the specified insertion
- /// point. This is split out of Insert so that it isn't duplicated for every
- /// template instantiation.
- void InsertHelper(Instruction *I) const {
- if (BB) BB->getInstList().insert(InsertPt, I);
- }
-
- //===--------------------------------------------------------------------===//
- // Instruction creation methods: Terminators
- //===--------------------------------------------------------------------===//
-
- /// CreateRetVoid - Create a 'ret void' instruction.
- ReturnInst *CreateRetVoid() {
- return Insert(ReturnInst::Create());
- }
-
- /// @verbatim
- /// CreateRet - Create a 'ret <val>' instruction.
- /// @endverbatim
- ReturnInst *CreateRet(Value *V) {
- return Insert(ReturnInst::Create(V));
- }
-
- ReturnInst *CreateRet(Value * const* retVals, unsigned N) {
- return Insert(ReturnInst::Create(retVals, N));
- }
-
- GetResultInst *CreateGetResult(Value *V, unsigned Index,
- const char *Name = "") {
- return Insert(new GetResultInst(V, Index, Name));
- }
-
- /// CreateBr - Create an unconditional 'br label X' instruction.
- BranchInst *CreateBr(BasicBlock *Dest) {
- return Insert(BranchInst::Create(Dest));
- }
-
- /// CreateCondBr - Create a conditional 'br Cond, TrueDest, FalseDest'
- /// instruction.
- BranchInst *CreateCondBr(Value *Cond, BasicBlock *True, BasicBlock *False) {
- return Insert(BranchInst::Create(True, False, Cond));
- }
-
- /// CreateSwitch - Create a switch instruction with the specified value,
- /// default dest, and with a hint for the number of cases that will be added
- /// (for efficient allocation).
- SwitchInst *CreateSwitch(Value *V, BasicBlock *Dest, unsigned NumCases = 10) {
- return Insert(SwitchInst::Create(V, Dest, NumCases));
- }
-
- /// CreateInvoke - Create an invoke instruction.
- template<typename InputIterator>
- InvokeInst *CreateInvoke(Value *Callee, BasicBlock *NormalDest,
- BasicBlock *UnwindDest, InputIterator ArgBegin,
- InputIterator ArgEnd, const char *Name = "") {
- return Insert(InvokeInst::Create(Callee, NormalDest, UnwindDest,
- ArgBegin, ArgEnd, Name));
- }
-
- UnwindInst *CreateUnwind() {
- return Insert(new UnwindInst());
- }
-
- UnreachableInst *CreateUnreachable() {
- return Insert(new UnreachableInst());
- }
-
- //===--------------------------------------------------------------------===//
- // Instruction creation methods: Binary Operators
- //===--------------------------------------------------------------------===//
-
- Value *CreateAdd(Value *LHS, Value *RHS, const char *Name = "") {
- if (Constant *LC = dyn_cast<Constant>(LHS))
- if (Constant *RC = dyn_cast<Constant>(RHS))
- return ConstantExpr::getAdd(LC, RC);
- return Insert(BinaryOperator::createAdd(LHS, RHS, Name));
- }
- Value *CreateSub(Value *LHS, Value *RHS, const char *Name = "") {
- if (Constant *LC = dyn_cast<Constant>(LHS))
- if (Constant *RC = dyn_cast<Constant>(RHS))
- return ConstantExpr::getSub(LC, RC);
- return Insert(BinaryOperator::createSub(LHS, RHS, Name));
- }
- Value *CreateMul(Value *LHS, Value *RHS, const char *Name = "") {
- if (Constant *LC = dyn_cast<Constant>(LHS))
- if (Constant *RC = dyn_cast<Constant>(RHS))
- return ConstantExpr::getMul(LC, RC);
- return Insert(BinaryOperator::createMul(LHS, RHS, Name));
- }
- Value *CreateUDiv(Value *LHS, Value *RHS, const char *Name = "") {
- if (Constant *LC = dyn_cast<Constant>(LHS))
- if (Constant *RC = dyn_cast<Constant>(RHS))
- return ConstantExpr::getUDiv(LC, RC);
- return Insert(BinaryOperator::createUDiv(LHS, RHS, Name));
- }
- Value *CreateSDiv(Value *LHS, Value *RHS, const char *Name = "") {
- if (Constant *LC = dyn_cast<Constant>(LHS))
- if (Constant *RC = dyn_cast<Constant>(RHS))
- return ConstantExpr::getSDiv(LC, RC);
- return Insert(BinaryOperator::createSDiv(LHS, RHS, Name));
- }
- Value *CreateFDiv(Value *LHS, Value *RHS, const char *Name = "") {
- if (Constant *LC = dyn_cast<Constant>(LHS))
- if (Constant *RC = dyn_cast<Constant>(RHS))
- return ConstantExpr::getFDiv(LC, RC);
- return Insert(BinaryOperator::createFDiv(LHS, RHS, Name));
- }
- Value *CreateURem(Value *LHS, Value *RHS, const char *Name = "") {
- if (Constant *LC = dyn_cast<Constant>(LHS))
- if (Constant *RC = dyn_cast<Constant>(RHS))
- return ConstantExpr::getURem(LC, RC);
- return Insert(BinaryOperator::createURem(LHS, RHS, Name));
- }
- Value *CreateSRem(Value *LHS, Value *RHS, const char *Name = "") {
- if (Constant *LC = dyn_cast<Constant>(LHS))
- if (Constant *RC = dyn_cast<Constant>(RHS))
- return ConstantExpr::getSRem(LC, RC);
- return Insert(BinaryOperator::createSRem(LHS, RHS, Name));
- }
- Value *CreateFRem(Value *LHS, Value *RHS, const char *Name = "") {
- if (Constant *LC = dyn_cast<Constant>(LHS))
- if (Constant *RC = dyn_cast<Constant>(RHS))
- return ConstantExpr::getFRem(LC, RC);
- return Insert(BinaryOperator::createFRem(LHS, RHS, Name));
- }
- Value *CreateShl(Value *LHS, Value *RHS, const char *Name = "") {
- if (Constant *LC = dyn_cast<Constant>(LHS))
- if (Constant *RC = dyn_cast<Constant>(RHS))
- return ConstantExpr::getShl(LC, RC);
- return Insert(BinaryOperator::createShl(LHS, RHS, Name));
- }
- Value *CreateLShr(Value *LHS, Value *RHS, const char *Name = "") {
- if (Constant *LC = dyn_cast<Constant>(LHS))
- if (Constant *RC = dyn_cast<Constant>(RHS))
- return ConstantExpr::getLShr(LC, RC);
- return Insert(BinaryOperator::createLShr(LHS, RHS, Name));
- }
- Value *CreateAShr(Value *LHS, Value *RHS, const char *Name = "") {
- if (Constant *LC = dyn_cast<Constant>(LHS))
- if (Constant *RC = dyn_cast<Constant>(RHS))
- return ConstantExpr::getAShr(LC, RC);
- return Insert(BinaryOperator::createAShr(LHS, RHS, Name));
- }
- Value *CreateAnd(Value *LHS, Value *RHS, const char *Name = "") {
- if (Constant *LC = dyn_cast<Constant>(LHS))
- if (Constant *RC = dyn_cast<Constant>(RHS))
- return ConstantExpr::getAnd(LC, RC);
- return Insert(BinaryOperator::createAnd(LHS, RHS, Name));
- }
- Value *CreateOr(Value *LHS, Value *RHS, const char *Name = "") {
- if (Constant *LC = dyn_cast<Constant>(LHS))
- if (Constant *RC = dyn_cast<Constant>(RHS))
- return ConstantExpr::getOr(LC, RC);
- return Insert(BinaryOperator::createOr(LHS, RHS, Name));
- }
- Value *CreateXor(Value *LHS, Value *RHS, const char *Name = "") {
- if (Constant *LC = dyn_cast<Constant>(LHS))
- if (Constant *RC = dyn_cast<Constant>(RHS))
- return ConstantExpr::getXor(LC, RC);
- return Insert(BinaryOperator::createXor(LHS, RHS, Name));
- }
-
- BinaryOperator *CreateBinOp(Instruction::BinaryOps Opc,
- Value *LHS, Value *RHS, const char *Name = "") {
- return Insert(BinaryOperator::create(Opc, LHS, RHS, Name));
- }
-
- BinaryOperator *CreateNeg(Value *V, const char *Name = "") {
- return Insert(BinaryOperator::createNeg(V, Name));
- }
- BinaryOperator *CreateNot(Value *V, const char *Name = "") {
- return Insert(BinaryOperator::createNot(V, Name));
- }
-
- //===--------------------------------------------------------------------===//
- // Instruction creation methods: Memory Instructions
- //===--------------------------------------------------------------------===//
-
- MallocInst *CreateMalloc(const Type *Ty, Value *ArraySize = 0,
- const char *Name = "") {
- return Insert(new MallocInst(Ty, ArraySize, Name));
- }
- AllocaInst *CreateAlloca(const Type *Ty, Value *ArraySize = 0,
- const char *Name = "") {
- return Insert(new AllocaInst(Ty, ArraySize, Name));
- }
- FreeInst *CreateFree(Value *Ptr) {
- return Insert(new FreeInst(Ptr));
- }
- LoadInst *CreateLoad(Value *Ptr, const char *Name = 0) {
- return Insert(new LoadInst(Ptr, Name));
- }
- LoadInst *CreateLoad(Value *Ptr, bool isVolatile, const char *Name = 0) {
- return Insert(new LoadInst(Ptr, Name, isVolatile));
- }
- StoreInst *CreateStore(Value *Val, Value *Ptr, bool isVolatile = false) {
- return Insert(new StoreInst(Val, Ptr, isVolatile));
- }
- template<typename InputIterator>
- Value *CreateGEP(Value *Ptr, InputIterator IdxBegin,
- InputIterator IdxEnd, const char *Name = "") {
-
- if (Constant *PC = dyn_cast<Constant>(Ptr)) {
- // Every index must be constant.
- InputIterator i;
- for (i = IdxBegin; i < IdxEnd; ++i) {
- if (!dyn_cast<Constant>(*i))
- break;
- }
- if (i == IdxEnd)
- return ConstantExpr::getGetElementPtr(PC, &IdxBegin[0], IdxEnd - IdxBegin);
- }
- return(Insert(GetElementPtrInst::Create(Ptr, IdxBegin, IdxEnd, Name)));
- }
- Value *CreateGEP(Value *Ptr, Value *Idx, const char *Name = "") {
- if (Constant *PC = dyn_cast<Constant>(Ptr))
- if (Constant *IC = dyn_cast<Constant>(Idx))
- return ConstantExpr::getGetElementPtr(PC, &IC, 1);
- return Insert(GetElementPtrInst::Create(Ptr, Idx, Name));
- }
- Value *CreateStructGEP(Value *Ptr, unsigned Idx, const char *Name = "") {
- llvm::Value *Idxs[] = {
- ConstantInt::get(llvm::Type::Int32Ty, 0),
- ConstantInt::get(llvm::Type::Int32Ty, Idx)
- };
-
- if (Constant *PC = dyn_cast<Constant>(Ptr))
- return ConstantExpr::getGetElementPtr(PC, Idxs, 2);
-
- return Insert(GetElementPtrInst::Create(Ptr, Idxs, Idxs+2, Name));
- }
-
- //===--------------------------------------------------------------------===//
- // Instruction creation methods: Cast/Conversion Operators
- //===--------------------------------------------------------------------===//
-
- Value *CreateTrunc(Value *V, const Type *DestTy, const char *Name = "") {
- return CreateCast(Instruction::Trunc, V, DestTy, Name);
- }
- Value *CreateZExt(Value *V, const Type *DestTy, const char *Name = "") {
- return CreateCast(Instruction::ZExt, V, DestTy, Name);
- }
- Value *CreateSExt(Value *V, const Type *DestTy, const char *Name = "") {
- return CreateCast(Instruction::SExt, V, DestTy, Name);
- }
- Value *CreateFPToUI(Value *V, const Type *DestTy, const char *Name = ""){
- return CreateCast(Instruction::FPToUI, V, DestTy, Name);
- }
- Value *CreateFPToSI(Value *V, const Type *DestTy, const char *Name = ""){
- return CreateCast(Instruction::FPToSI, V, DestTy, Name);
- }
- Value *CreateUIToFP(Value *V, const Type *DestTy, const char *Name = ""){
- return CreateCast(Instruction::UIToFP, V, DestTy, Name);
- }
- Value *CreateSIToFP(Value *V, const Type *DestTy, const char *Name = ""){
- return CreateCast(Instruction::SIToFP, V, DestTy, Name);
- }
- Value *CreateFPTrunc(Value *V, const Type *DestTy,
- const char *Name = "") {
- return CreateCast(Instruction::FPTrunc, V, DestTy, Name);
- }
- Value *CreateFPExt(Value *V, const Type *DestTy, const char *Name = "") {
- return CreateCast(Instruction::FPExt, V, DestTy, Name);
- }
- Value *CreatePtrToInt(Value *V, const Type *DestTy,
- const char *Name = "") {
- return CreateCast(Instruction::PtrToInt, V, DestTy, Name);
- }
- Value *CreateIntToPtr(Value *V, const Type *DestTy,
- const char *Name = "") {
- return CreateCast(Instruction::IntToPtr, V, DestTy, Name);
- }
- Value *CreateBitCast(Value *V, const Type *DestTy,
- const char *Name = "") {
- return CreateCast(Instruction::BitCast, V, DestTy, Name);
- }
-
- Value *CreateCast(Instruction::CastOps Op, Value *V, const Type *DestTy,
- const char *Name = "") {
- if (V->getType() == DestTy)
- return V;
- if (Constant *VC = dyn_cast<Constant>(V))
- return ConstantExpr::getCast(Op, VC, DestTy);
- return Insert(CastInst::create(Op, V, DestTy, Name));
- }
- Value *CreateIntCast(Value *V, const Type *DestTy, bool isSigned,
- const char *Name = "") {
- if (V->getType() == DestTy)
- return V;
- if (Constant *VC = dyn_cast<Constant>(V))
- return ConstantExpr::getIntegerCast(VC, DestTy, isSigned);
- return Insert(CastInst::createIntegerCast(V, DestTy, isSigned, Name));
- }
-
- //===--------------------------------------------------------------------===//
- // Instruction creation methods: Compare Instructions
- //===--------------------------------------------------------------------===//
-
- Value *CreateICmpEQ(Value *LHS, Value *RHS, const char *Name = "") {
- return CreateICmp(ICmpInst::ICMP_EQ, LHS, RHS, Name);
- }
- Value *CreateICmpNE(Value *LHS, Value *RHS, const char *Name = "") {
- return CreateICmp(ICmpInst::ICMP_NE, LHS, RHS, Name);
- }
- Value *CreateICmpUGT(Value *LHS, Value *RHS, const char *Name = "") {
- return CreateICmp(ICmpInst::ICMP_UGT, LHS, RHS, Name);
- }
- Value *CreateICmpUGE(Value *LHS, Value *RHS, const char *Name = "") {
- return CreateICmp(ICmpInst::ICMP_UGE, LHS, RHS, Name);
- }
- Value *CreateICmpULT(Value *LHS, Value *RHS, const char *Name = "") {
- return CreateICmp(ICmpInst::ICMP_ULT, LHS, RHS, Name);
- }
- Value *CreateICmpULE(Value *LHS, Value *RHS, const char *Name = "") {
- return CreateICmp(ICmpInst::ICMP_ULE, LHS, RHS, Name);
- }
- Value *CreateICmpSGT(Value *LHS, Value *RHS, const char *Name = "") {
- return CreateICmp(ICmpInst::ICMP_SGT, LHS, RHS, Name);
- }
- Value *CreateICmpSGE(Value *LHS, Value *RHS, const char *Name = "") {
- return CreateICmp(ICmpInst::ICMP_SGE, LHS, RHS, Name);
- }
- Value *CreateICmpSLT(Value *LHS, Value *RHS, const char *Name = "") {
- return CreateICmp(ICmpInst::ICMP_SLT, LHS, RHS, Name);
- }
- Value *CreateICmpSLE(Value *LHS, Value *RHS, const char *Name = "") {
- return CreateICmp(ICmpInst::ICMP_SLE, LHS, RHS, Name);
- }
-
- Value *CreateFCmpOEQ(Value *LHS, Value *RHS, const char *Name = "") {
- return CreateFCmp(FCmpInst::FCMP_OEQ, LHS, RHS, Name);
- }
- Value *CreateFCmpOGT(Value *LHS, Value *RHS, const char *Name = "") {
- return CreateFCmp(FCmpInst::FCMP_OGT, LHS, RHS, Name);
- }
- Value *CreateFCmpOGE(Value *LHS, Value *RHS, const char *Name = "") {
- return CreateFCmp(FCmpInst::FCMP_OGE, LHS, RHS, Name);
- }
- Value *CreateFCmpOLT(Value *LHS, Value *RHS, const char *Name = "") {
- return CreateFCmp(FCmpInst::FCMP_OLT, LHS, RHS, Name);
- }
- Value *CreateFCmpOLE(Value *LHS, Value *RHS, const char *Name = "") {
- return CreateFCmp(FCmpInst::FCMP_OLE, LHS, RHS, Name);
- }
- Value *CreateFCmpONE(Value *LHS, Value *RHS, const char *Name = "") {
- return CreateFCmp(FCmpInst::FCMP_ONE, LHS, RHS, Name);
- }
- Value *CreateFCmpORD(Value *LHS, Value *RHS, const char *Name = "") {
- return CreateFCmp(FCmpInst::FCMP_ORD, LHS, RHS, Name);
- }
- Value *CreateFCmpUNO(Value *LHS, Value *RHS, const char *Name = "") {
- return CreateFCmp(FCmpInst::FCMP_UNO, LHS, RHS, Name);
- }
- Value *CreateFCmpUEQ(Value *LHS, Value *RHS, const char *Name = "") {
- return CreateFCmp(FCmpInst::FCMP_UEQ, LHS, RHS, Name);
- }
- Value *CreateFCmpUGT(Value *LHS, Value *RHS, const char *Name = "") {
- return CreateFCmp(FCmpInst::FCMP_UGT, LHS, RHS, Name);
- }
- Value *CreateFCmpUGE(Value *LHS, Value *RHS, const char *Name = "") {
- return CreateFCmp(FCmpInst::FCMP_UGE, LHS, RHS, Name);
- }
- Value *CreateFCmpULT(Value *LHS, Value *RHS, const char *Name = "") {
- return CreateFCmp(FCmpInst::FCMP_ULT, LHS, RHS, Name);
- }
- Value *CreateFCmpULE(Value *LHS, Value *RHS, const char *Name = "") {
- return CreateFCmp(FCmpInst::FCMP_ULE, LHS, RHS, Name);
- }
- Value *CreateFCmpUNE(Value *LHS, Value *RHS, const char *Name = "") {
- return CreateFCmp(FCmpInst::FCMP_UNE, LHS, RHS, Name);
- }
-
- Value *CreateICmp(ICmpInst::Predicate P, Value *LHS, Value *RHS,
- const char *Name = "") {
- if (Constant *LC = dyn_cast<Constant>(LHS))
- if (Constant *RC = dyn_cast<Constant>(RHS))
- return ConstantExpr::getCompare(P, LC, RC);
- return Insert(new ICmpInst(P, LHS, RHS, Name));
- }
- Value *CreateFCmp(FCmpInst::Predicate P, Value *LHS, Value *RHS,
- const char *Name = "") {
- if (Constant *LC = dyn_cast<Constant>(LHS))
- if (Constant *RC = dyn_cast<Constant>(RHS))
- return ConstantExpr::getCompare(P, LC, RC);
- return Insert(new FCmpInst(P, LHS, RHS, Name));
- }
-
- //===--------------------------------------------------------------------===//
- // Instruction creation methods: Other Instructions
- //===--------------------------------------------------------------------===//
-
- PHINode *CreatePHI(const Type *Ty, const char *Name = "") {
- return Insert(PHINode::Create(Ty, Name));
- }
-
- CallInst *CreateCall(Value *Callee, const char *Name = "") {
- return Insert(CallInst::Create(Callee, Name));
- }
- CallInst *CreateCall(Value *Callee, Value *Arg, const char *Name = "") {
- return Insert(CallInst::Create(Callee, Arg, Name));
- }
- CallInst *CreateCall2(Value *Callee, Value *Arg1, Value *Arg2,
- const char *Name = "") {
- Value *Args[] = { Arg1, Arg2 };
- return Insert(CallInst::Create(Callee, Args, Args+2, Name));
- }
- CallInst *CreateCall3(Value *Callee, Value *Arg1, Value *Arg2, Value *Arg3,
- const char *Name = "") {
- Value *Args[] = { Arg1, Arg2, Arg3 };
- return Insert(CallInst::Create(Callee, Args, Args+3, Name));
- }
- CallInst *CreateCall4(Value *Callee, Value *Arg1, Value *Arg2, Value *Arg3,
- Value *Arg4, const char *Name = "") {
- Value *Args[] = { Arg1, Arg2, Arg3, Arg4 };
- return Insert(CallInst::Create(Callee, Args, Args+4, Name));
- }
-
- template<typename InputIterator>
- CallInst *CreateCall(Value *Callee, InputIterator ArgBegin,
- InputIterator ArgEnd, const char *Name = "") {
- return Insert(CallInst::Create(Callee, ArgBegin, ArgEnd, Name));
- }
-
- Value *CreateSelect(Value *C, Value *True, Value *False,
- const char *Name = "") {
- if (Constant *CC = dyn_cast<Constant>(C))
- if (Constant *TC = dyn_cast<Constant>(True))
- if (Constant *FC = dyn_cast<Constant>(False))
- return ConstantExpr::getSelect(CC, TC, FC);
- return Insert(SelectInst::Create(C, True, False, Name));
- }
-
- VAArgInst *CreateVAArg(Value *List, const Type *Ty, const char *Name = "") {
- return Insert(new VAArgInst(List, Ty, Name));
- }
-
- Value *CreateExtractElement(Value *Vec, Value *Idx,
- const char *Name = "") {
- if (Constant *VC = dyn_cast<Constant>(Vec))
- if (Constant *IC = dyn_cast<Constant>(Idx))
- return ConstantExpr::getExtractElement(VC, IC);
- return Insert(new ExtractElementInst(Vec, Idx, Name));
- }
-
- Value *CreateInsertElement(Value *Vec, Value *NewElt, Value *Idx,
- const char *Name = "") {
- if (Constant *VC = dyn_cast<Constant>(Vec))
- if (Constant *NC = dyn_cast<Constant>(NewElt))
- if (Constant *IC = dyn_cast<Constant>(Idx))
- return ConstantExpr::getInsertElement(VC, NC, IC);
- return Insert(InsertElementInst::Create(Vec, NewElt, Idx, Name));
- }
-
- Value *CreateShuffleVector(Value *V1, Value *V2, Value *Mask,
- const char *Name = "") {
- if (Constant *V1C = dyn_cast<Constant>(V1))
- if (Constant *V2C = dyn_cast<Constant>(V2))
- if (Constant *MC = dyn_cast<Constant>(Mask))
- return ConstantExpr::getShuffleVector(V1C, V2C, MC);
- return Insert(new ShuffleVectorInst(V1, V2, Mask, Name));
- }
-};
-
-}
-
-#endif
diff --git a/release_23/include/llvm/Support/InstIterator.h b/release_23/include/llvm/Support/InstIterator.h
deleted file mode 100644
index 7d3f8835098e..000000000000
--- a/release_23/include/llvm/Support/InstIterator.h
+++ /dev/null
@@ -1,147 +0,0 @@
-//===- llvm/Support/InstIterator.h - Classes for inst iteration -*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains definitions of two iterators for iterating over the
-// instructions in a function. This is effectively a wrapper around a two level
-// iterator that can probably be genericized later.
-//
-// Note that this iterator gets invalidated any time that basic blocks or
-// instructions are moved around.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_SUPPORT_INSTITERATOR_H
-#define LLVM_SUPPORT_INSTITERATOR_H
-
-#include "llvm/BasicBlock.h"
-#include "llvm/Function.h"
-
-namespace llvm {
-
-// This class implements inst_begin() & inst_end() for
-// inst_iterator and const_inst_iterator's.
-//
-template <class _BB_t, class _BB_i_t, class _BI_t, class _II_t>
-class InstIterator {
- typedef _BB_t BBty;
- typedef _BB_i_t BBIty;
- typedef _BI_t BIty;
- typedef _II_t IIty;
- _BB_t *BBs; // BasicBlocksType
- _BB_i_t BB; // BasicBlocksType::iterator
- _BI_t BI; // BasicBlock::iterator
-public:
- typedef std::bidirectional_iterator_tag iterator_category;
- typedef IIty value_type;
- typedef signed difference_type;
- typedef IIty* pointer;
- typedef IIty& reference;
-
- // Default constructor
- InstIterator() {}
-
- // Copy constructor...
- template<typename A, typename B, typename C, typename D>
- InstIterator(const InstIterator<A,B,C,D> &II)
- : BBs(II.BBs), BB(II.BB), BI(II.BI) {}
-
- template<typename A, typename B, typename C, typename D>
- InstIterator(InstIterator<A,B,C,D> &II)
- : BBs(II.BBs), BB(II.BB), BI(II.BI) {}
-
- template<class M> InstIterator(M &m)
- : BBs(&m.getBasicBlockList()), BB(BBs->begin()) { // begin ctor
- if (BB != BBs->end()) {
- BI = BB->begin();
- advanceToNextBB();
- }
- }
-
- template<class M> InstIterator(M &m, bool)
- : BBs(&m.getBasicBlockList()), BB(BBs->end()) { // end ctor
- }
-
- // Accessors to get at the underlying iterators...
- inline BBIty &getBasicBlockIterator() { return BB; }
- inline BIty &getInstructionIterator() { return BI; }
-
- inline reference operator*() const { return *BI; }
- inline pointer operator->() const { return &operator*(); }
-
- inline bool operator==(const InstIterator &y) const {
- return BB == y.BB && (BB == BBs->end() || BI == y.BI);
- }
- inline bool operator!=(const InstIterator& y) const {
- return !operator==(y);
- }
-
- InstIterator& operator++() {
- ++BI;
- advanceToNextBB();
- return *this;
- }
- inline InstIterator operator++(int) {
- InstIterator tmp = *this; ++*this; return tmp;
- }
-
- InstIterator& operator--() {
- while (BB == BBs->end() || BI == BB->begin()) {
- --BB;
- BI = BB->end();
- }
- --BI;
- return *this;
- }
- inline InstIterator operator--(int) {
- InstIterator tmp = *this; --*this; return tmp;
- }
-
- inline bool atEnd() const { return BB == BBs->end(); }
-
-private:
- inline void advanceToNextBB() {
- // The only way that the II could be broken is if it is now pointing to
- // the end() of the current BasicBlock and there are successor BBs.
- while (BI == BB->end()) {
- ++BB;
- if (BB == BBs->end()) break;
- BI = BB->begin();
- }
- }
-};
-
-
-typedef InstIterator<iplist<BasicBlock>,
- Function::iterator, BasicBlock::iterator,
- Instruction> inst_iterator;
-typedef InstIterator<const iplist<BasicBlock>,
- Function::const_iterator,
- BasicBlock::const_iterator,
- const Instruction> const_inst_iterator;
-
-inline inst_iterator inst_begin(Function *F) { return inst_iterator(*F); }
-inline inst_iterator inst_end(Function *F) { return inst_iterator(*F, true); }
-inline const_inst_iterator inst_begin(const Function *F) {
- return const_inst_iterator(*F);
-}
-inline const_inst_iterator inst_end(const Function *F) {
- return const_inst_iterator(*F, true);
-}
-inline inst_iterator inst_begin(Function &F) { return inst_iterator(F); }
-inline inst_iterator inst_end(Function &F) { return inst_iterator(F, true); }
-inline const_inst_iterator inst_begin(const Function &F) {
- return const_inst_iterator(F);
-}
-inline const_inst_iterator inst_end(const Function &F) {
- return const_inst_iterator(F, true);
-}
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/Support/InstVisitor.h b/release_23/include/llvm/Support/InstVisitor.h
deleted file mode 100644
index 720b32d2bfca..000000000000
--- a/release_23/include/llvm/Support/InstVisitor.h
+++ /dev/null
@@ -1,222 +0,0 @@
-//===- llvm/Support/InstVisitor.h - Define instruction visitors -*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-
-#ifndef LLVM_SUPPORT_INSTVISITOR_H
-#define LLVM_SUPPORT_INSTVISITOR_H
-
-#include "llvm/Function.h"
-#include "llvm/Instructions.h"
-#include "llvm/Module.h"
-
-namespace llvm {
-
-// We operate on opaque instruction classes, so forward declare all instruction
-// types now...
-//
-#define HANDLE_INST(NUM, OPCODE, CLASS) class CLASS;
-#include "llvm/Instruction.def"
-
-// Forward declare the intermediate types...
-class TerminatorInst; class BinaryOperator;
-class AllocationInst;
-
-#define DELEGATE(CLASS_TO_VISIT) \
- return static_cast<SubClass*>(this)-> \
- visit##CLASS_TO_VISIT(static_cast<CLASS_TO_VISIT&>(I))
-
-
-/// @brief Base class for instruction visitors
-///
-/// Instruction visitors are used when you want to perform different action for
-/// different kinds of instruction without without having to use lots of casts
-/// and a big switch statement (in your code that is).
-///
-/// To define your own visitor, inherit from this class, specifying your
-/// new type for the 'SubClass' template parameter, and "override" visitXXX
-/// functions in your class. I say "overriding" because this class is defined
-/// in terms of statically resolved overloading, not virtual functions.
-///
-/// For example, here is a visitor that counts the number of malloc
-/// instructions processed:
-///
-/// /// Declare the class. Note that we derive from InstVisitor instantiated
-/// /// with _our new subclasses_ type.
-/// ///
-/// struct CountMallocVisitor : public InstVisitor<CountMallocVisitor> {
-/// unsigned Count;
-/// CountMallocVisitor() : Count(0) {}
-///
-/// void visitMallocInst(MallocInst &MI) { ++Count; }
-/// };
-///
-/// And this class would be used like this:
-/// CountMallocVistor CMV;
-/// CMV.visit(function);
-/// NumMallocs = CMV.Count;
-///
-/// The defined has 'visit' methods for Instruction, and also for BasicBlock,
-/// Function, and Module, which recursively process all conained instructions.
-///
-/// Note that if you don't implement visitXXX for some instruction type,
-/// the visitXXX method for instruction superclass will be invoked. So
-/// if instructions are added in the future, they will be automatically
-/// supported, if you handle on of their superclasses.
-///
-/// The optional second template argument specifies the type that instruction
-/// visitation functions should return. If you specify this, you *MUST* provide
-/// an implementation of visitInstruction though!.
-///
-/// Note that this class is specifically designed as a template to avoid
-/// virtual function call overhead. Defining and using an InstVisitor is just
-/// as efficient as having your own switch statement over the instruction
-/// opcode.
-template<typename SubClass, typename RetTy=void>
-class InstVisitor {
- //===--------------------------------------------------------------------===//
- // Interface code - This is the public interface of the InstVisitor that you
- // use to visit instructions...
- //
-
-public:
- // Generic visit method - Allow visitation to all instructions in a range
- template<class Iterator>
- void visit(Iterator Start, Iterator End) {
- while (Start != End)
- static_cast<SubClass*>(this)->visit(*Start++);
- }
-
- // Define visitors for functions and basic blocks...
- //
- void visit(Module &M) {
- static_cast<SubClass*>(this)->visitModule(M);
- visit(M.begin(), M.end());
- }
- void visit(Function &F) {
- static_cast<SubClass*>(this)->visitFunction(F);
- visit(F.begin(), F.end());
- }
- void visit(BasicBlock &BB) {
- static_cast<SubClass*>(this)->visitBasicBlock(BB);
- visit(BB.begin(), BB.end());
- }
-
- // Forwarding functions so that the user can visit with pointers AND refs.
- void visit(Module *M) { visit(*M); }
- void visit(Function *F) { visit(*F); }
- void visit(BasicBlock *BB) { visit(*BB); }
- RetTy visit(Instruction *I) { return visit(*I); }
-
- // visit - Finally, code to visit an instruction...
- //
- RetTy visit(Instruction &I) {
- switch (I.getOpcode()) {
- default: assert(0 && "Unknown instruction type encountered!");
- abort();
- // Build the switch statement using the Instruction.def file...
-#define HANDLE_INST(NUM, OPCODE, CLASS) \
- case Instruction::OPCODE: return \
- static_cast<SubClass*>(this)-> \
- visit##OPCODE(static_cast<CLASS&>(I));
-#include "llvm/Instruction.def"
- }
- }
-
- //===--------------------------------------------------------------------===//
- // Visitation functions... these functions provide default fallbacks in case
- // the user does not specify what to do for a particular instruction type.
- // The default behavior is to generalize the instruction type to its subtype
- // and try visiting the subtype. All of this should be inlined perfectly,
- // because there are no virtual functions to get in the way.
- //
-
- // When visiting a module, function or basic block directly, these methods get
- // called to indicate when transitioning into a new unit.
- //
- void visitModule (Module &M) {}
- void visitFunction (Function &F) {}
- void visitBasicBlock(BasicBlock &BB) {}
-
- // Define instruction specific visitor functions that can be overridden to
- // handle SPECIFIC instructions. These functions automatically define
- // visitMul to proxy to visitBinaryOperator for instance in case the user does
- // not need this generality.
- //
- // The one problem case we have to handle here though is that the PHINode
- // class and opcode name are the exact same. Because of this, we cannot
- // define visitPHINode (the inst version) to forward to visitPHINode (the
- // generic version) without multiply defined symbols and recursion. To handle
- // this, we do not autoexpand "Other" instructions, we do it manually.
- //
-#define HANDLE_INST(NUM, OPCODE, CLASS) \
- RetTy visit##OPCODE(CLASS &I) { DELEGATE(CLASS); }
-#include "llvm/Instruction.def"
-
- // Specific Instruction type classes... note that all of the casts are
- // necessary because we use the instruction classes as opaque types...
- //
- RetTy visitReturnInst(ReturnInst &I) { DELEGATE(TerminatorInst);}
- RetTy visitBranchInst(BranchInst &I) { DELEGATE(TerminatorInst);}
- RetTy visitSwitchInst(SwitchInst &I) { DELEGATE(TerminatorInst);}
- RetTy visitInvokeInst(InvokeInst &I) { DELEGATE(TerminatorInst);}
- RetTy visitUnwindInst(UnwindInst &I) { DELEGATE(TerminatorInst);}
- RetTy visitUnreachableInst(UnreachableInst &I) { DELEGATE(TerminatorInst);}
- RetTy visitICmpInst(ICmpInst &I) { DELEGATE(CmpInst);}
- RetTy visitFCmpInst(FCmpInst &I) { DELEGATE(CmpInst);}
- RetTy visitMallocInst(MallocInst &I) { DELEGATE(AllocationInst);}
- RetTy visitAllocaInst(AllocaInst &I) { DELEGATE(AllocationInst);}
- RetTy visitFreeInst(FreeInst &I) { DELEGATE(Instruction); }
- RetTy visitLoadInst(LoadInst &I) { DELEGATE(Instruction); }
- RetTy visitStoreInst(StoreInst &I) { DELEGATE(Instruction); }
- RetTy visitGetElementPtrInst(GetElementPtrInst &I){ DELEGATE(Instruction); }
- RetTy visitPHINode(PHINode &I) { DELEGATE(Instruction); }
- RetTy visitTruncInst(TruncInst &I) { DELEGATE(CastInst); }
- RetTy visitZExtInst(ZExtInst &I) { DELEGATE(CastInst); }
- RetTy visitSExtInst(SExtInst &I) { DELEGATE(CastInst); }
- RetTy visitFPTruncInst(FPTruncInst &I) { DELEGATE(CastInst); }
- RetTy visitFPExtInst(FPExtInst &I) { DELEGATE(CastInst); }
- RetTy visitFPToUIInst(FPToUIInst &I) { DELEGATE(CastInst); }
- RetTy visitFPToSIInst(FPToSIInst &I) { DELEGATE(CastInst); }
- RetTy visitUIToFPInst(UIToFPInst &I) { DELEGATE(CastInst); }
- RetTy visitSIToFPInst(SIToFPInst &I) { DELEGATE(CastInst); }
- RetTy visitPtrToIntInst(PtrToIntInst &I) { DELEGATE(CastInst); }
- RetTy visitIntToPtrInst(IntToPtrInst &I) { DELEGATE(CastInst); }
- RetTy visitBitCastInst(BitCastInst &I) { DELEGATE(CastInst); }
- RetTy visitSelectInst(SelectInst &I) { DELEGATE(Instruction); }
- RetTy visitCallInst(CallInst &I) { DELEGATE(Instruction); }
- RetTy visitVAArgInst(VAArgInst &I) { DELEGATE(Instruction); }
- RetTy visitExtractElementInst(ExtractElementInst &I) { DELEGATE(Instruction);}
- RetTy visitInsertElementInst(InsertElementInst &I) { DELEGATE(Instruction); }
- RetTy visitShuffleVectorInst(ShuffleVectorInst &I) { DELEGATE(Instruction); }
- RetTy visitGetResultInst(GetResultInst &I) { DELEGATE(Instruction); }
-
- // Next level propagators... if the user does not overload a specific
- // instruction type, they can overload one of these to get the whole class
- // of instructions...
- //
- RetTy visitTerminatorInst(TerminatorInst &I) { DELEGATE(Instruction); }
- RetTy visitBinaryOperator(BinaryOperator &I) { DELEGATE(Instruction); }
- RetTy visitAllocationInst(AllocationInst &I) { DELEGATE(Instruction); }
- RetTy visitCmpInst(CmpInst &I) { DELEGATE(Instruction); }
- RetTy visitCastInst(CastInst &I) { DELEGATE(Instruction); }
-
- // If the user wants a 'default' case, they can choose to override this
- // function. If this function is not overloaded in the users subclass, then
- // this instruction just gets ignored.
- //
- // Note that you MUST override this function if your return type is not void.
- //
- void visitInstruction(Instruction &I) {} // Ignore unhandled instructions
-};
-
-#undef DELEGATE
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/Support/LeakDetector.h b/release_23/include/llvm/Support/LeakDetector.h
deleted file mode 100644
index 8d74ac663b11..000000000000
--- a/release_23/include/llvm/Support/LeakDetector.h
+++ /dev/null
@@ -1,91 +0,0 @@
-//===-- llvm/Support/LeakDetector.h - Provide leak detection ----*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines a class that can be used to provide very simple memory leak
-// checks for an API. Basically LLVM uses this to make sure that Instructions,
-// for example, are deleted when they are supposed to be, and not leaked away.
-//
-// When compiling with NDEBUG (Release build), this class does nothing, thus
-// adding no checking overhead to release builds. Note that this class is
-// implemented in a very simple way, requiring completely manual manipulation
-// and checking for garbage, but this is intentional: users should not be using
-// this API, only other APIs should.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_SUPPORT_LEAKDETECTOR_H
-#define LLVM_SUPPORT_LEAKDETECTOR_H
-
-#include <string>
-
-namespace llvm {
-
-class Value;
-
-struct LeakDetector {
- /// addGarbageObject - Add a pointer to the internal set of "garbage" object
- /// pointers. This should be called when objects are created, or if they are
- /// taken out of an owning collection.
- ///
- static void addGarbageObject(void *Object) {
-#ifndef NDEBUG
- addGarbageObjectImpl(Object);
-#endif
- }
-
- /// removeGarbageObject - Remove a pointer from our internal representation of
- /// our "garbage" objects. This should be called when an object is added to
- /// an "owning" collection.
- ///
- static void removeGarbageObject(void *Object) {
-#ifndef NDEBUG
- removeGarbageObjectImpl(Object);
-#endif
- }
-
- /// checkForGarbage - Traverse the internal representation of garbage
- /// pointers. If there are any pointers that have been add'ed, but not
- /// remove'd, big obnoxious warnings about memory leaks are issued.
- ///
- /// The specified message will be printed indicating when the check was
- /// performed.
- ///
- static void checkForGarbage(const std::string &Message) {
-#ifndef NDEBUG
- checkForGarbageImpl(Message);
-#endif
- }
-
- /// Overload the normal methods to work better with Value*'s because they are
- /// by far the most common in LLVM. This does not affect the actual
- /// functioning of this class, it just makes the warning messages nicer.
- ///
- static void addGarbageObject(const Value *Object) {
-#ifndef NDEBUG
- addGarbageObjectImpl(Object);
-#endif
- }
- static void removeGarbageObject(const Value *Object) {
-#ifndef NDEBUG
- removeGarbageObjectImpl(Object);
-#endif
- }
-
-private:
- // If we are debugging, the actual implementations will be called...
- static void addGarbageObjectImpl(const Value *Object);
- static void removeGarbageObjectImpl(const Value *Object);
- static void addGarbageObjectImpl(void *Object);
- static void removeGarbageObjectImpl(void *Object);
- static void checkForGarbageImpl(const std::string &Message);
-};
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/Support/ManagedStatic.h b/release_23/include/llvm/Support/ManagedStatic.h
deleted file mode 100644
index 28b25dbb623b..000000000000
--- a/release_23/include/llvm/Support/ManagedStatic.h
+++ /dev/null
@@ -1,96 +0,0 @@
-//===-- llvm/Support/ManagedStatic.h - Static Global wrapper ----*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines the ManagedStatic class and the llvm_shutdown() function.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_SUPPORT_MANAGED_STATIC_H
-#define LLVM_SUPPORT_MANAGED_STATIC_H
-
-namespace llvm {
-
-/// object_deleter - Helper method for ManagedStatic.
-///
-template<class C>
-void object_deleter(void *Ptr) {
- delete (C*)Ptr;
-}
-
-/// ManagedStaticBase - Common base class for ManagedStatic instances.
-class ManagedStaticBase {
-protected:
- // This should only be used as a static variable, which guarantees that this
- // will be zero initialized.
- mutable void *Ptr;
- mutable void (*DeleterFn)(void*);
- mutable const ManagedStaticBase *Next;
-
- void RegisterManagedStatic(void *ObjPtr, void (*deleter)(void*)) const;
-public:
- /// isConstructed - Return true if this object has not been created yet.
- bool isConstructed() const { return Ptr != 0; }
-
- void destroy() const;
-};
-
-/// ManagedStatic - This transparently changes the behavior of global statics to
-/// be lazily constructed on demand (good for reducing startup times of dynamic
-/// libraries that link in LLVM components) and for making destruction be
-/// explicit through the llvm_shutdown() function call.
-///
-template<class C>
-class ManagedStatic : public ManagedStaticBase {
-public:
-
- // Accessors.
- C &operator*() {
- if (!Ptr) LazyInit();
- return *static_cast<C*>(Ptr);
- }
- C *operator->() {
- if (!Ptr) LazyInit();
- return static_cast<C*>(Ptr);
- }
- const C &operator*() const {
- if (!Ptr) LazyInit();
- return *static_cast<C*>(Ptr);
- }
- const C *operator->() const {
- if (!Ptr) LazyInit();
- return static_cast<C*>(Ptr);
- }
-
-public:
- void LazyInit() const {
- RegisterManagedStatic(new C(), object_deleter<C>);
- }
-};
-
-template<void (*CleanupFn)(void*)>
-class ManagedCleanup : public ManagedStaticBase {
-public:
- void Register() { RegisterManagedStatic(0, CleanupFn); }
-};
-
-
-/// llvm_shutdown - Deallocate and destroy all ManagedStatic variables.
-void llvm_shutdown();
-
-
-/// llvm_shutdown_obj - This is a simple helper class that calls
-/// llvm_shutdown() when it is destroyed.
-struct llvm_shutdown_obj {
- llvm_shutdown_obj() {}
- ~llvm_shutdown_obj() { llvm_shutdown(); }
-};
-
-}
-
-#endif
diff --git a/release_23/include/llvm/Support/Mangler.h b/release_23/include/llvm/Support/Mangler.h
deleted file mode 100644
index 39ac26dd1bf2..000000000000
--- a/release_23/include/llvm/Support/Mangler.h
+++ /dev/null
@@ -1,114 +0,0 @@
-//===-- llvm/Support/Mangler.h - Self-contained name mangler ----*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// Unified name mangler for various backends.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_SUPPORT_MANGLER_H
-#define LLVM_SUPPORT_MANGLER_H
-
-#include <map>
-#include <set>
-#include <string>
-
-namespace llvm {
-class Type;
-class Module;
-class Value;
-class GlobalValue;
-
-class Mangler {
- /// Prefix - This string is added to each symbol that is emitted, unless the
- /// symbol is marked as not needing this prefix.
- const char *Prefix;
-
- /// UseQuotes - If this is set, the target accepts global names in quotes,
- /// e.g. "foo bar" is a legal name. This syntax is used instead of escaping
- /// the space character. By default, this is false.
- bool UseQuotes;
-
- /// PreserveAsmNames - If this is set, the asm escape character is not removed
- /// from names with 'asm' specifiers.
- bool PreserveAsmNames;
-
- /// Memo - This is used to remember the name that we assign a value.
- ///
- std::map<const Value*, std::string> Memo;
-
- /// Count - This simple counter is used to unique value names.
- ///
- unsigned Count;
-
- /// TypeMap - If the client wants us to unique types, this keeps track of the
- /// current assignments and TypeCounter keeps track of the next id to assign.
- std::map<const Type*, unsigned> TypeMap;
- unsigned TypeCounter;
-
- /// This keeps track of which global values have had their names
- /// mangled in the current module.
- ///
- std::set<const GlobalValue*> MangledGlobals;
-
- /// AcceptableChars - This bitfield contains a one for each character that is
- /// allowed to be part of an unmangled name.
- unsigned AcceptableChars[256/32];
-public:
-
- // Mangler ctor - if a prefix is specified, it will be prepended onto all
- // symbols.
- Mangler(Module &M, const char *Prefix = "");
-
- /// setUseQuotes - If UseQuotes is set to true, this target accepts quoted
- /// strings for assembler labels.
- void setUseQuotes(bool Val) { UseQuotes = Val; }
-
- /// setPreserveAsmNames - If the mangler should not strip off the asm name
- /// @verbatim identifier (\001), this should be set. @endverbatim
- void setPreserveAsmNames(bool Val) { PreserveAsmNames = Val; }
-
- /// Acceptable Characters - This allows the target to specify which characters
- /// are acceptable to the assembler without being mangled. By default we
- /// allow letters, numbers, '_', '$', and '.', which is what GAS accepts.
- void markCharAcceptable(unsigned char X) {
- AcceptableChars[X/32] |= 1 << (X&31);
- }
- void markCharUnacceptable(unsigned char X) {
- AcceptableChars[X/32] &= ~(1 << (X&31));
- }
- bool isCharAcceptable(unsigned char X) const {
- return (AcceptableChars[X/32] & (1 << (X&31))) != 0;
- }
-
- /// getTypeID - Return a unique ID for the specified LLVM type.
- ///
- unsigned getTypeID(const Type *Ty);
-
- /// getValueName - Returns the mangled name of V, an LLVM Value,
- /// in the current module.
- ///
- std::string getValueName(const GlobalValue *V, const char *Suffix = "");
- std::string getValueName(const Value *V);
-
- /// makeNameProper - We don't want identifier names with ., space, or
- /// - in them, so we mangle these characters into the strings "d_",
- /// "s_", and "D_", respectively. This is a very simple mangling that
- /// doesn't guarantee unique names for values. getValueName already
- /// does this for you, so there's no point calling it on the result
- /// from getValueName.
- ///
- std::string makeNameProper(const std::string &x, const char *Prefix = "");
-
-private:
- void InsertName(GlobalValue *GV, std::map<std::string, GlobalValue*> &Names);
-};
-
-} // End llvm namespace
-
-#endif // LLVM_SUPPORT_MANGLER_H
diff --git a/release_23/include/llvm/Support/MathExtras.h b/release_23/include/llvm/Support/MathExtras.h
deleted file mode 100644
index f57beed09391..000000000000
--- a/release_23/include/llvm/Support/MathExtras.h
+++ /dev/null
@@ -1,402 +0,0 @@
-//===-- llvm/Support/MathExtras.h - Useful math functions -------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains some functions that are useful for math stuff.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_SUPPORT_MATHEXTRAS_H
-#define LLVM_SUPPORT_MATHEXTRAS_H
-
-#include "llvm/Support/DataTypes.h"
-
-namespace llvm {
-
-// NOTE: The following support functions use the _32/_64 extensions instead of
-// type overloading so that signed and unsigned integers can be used without
-// ambiguity.
-
-/// Hi_32 - This function returns the high 32 bits of a 64 bit value.
-inline uint32_t Hi_32(uint64_t Value) {
- return static_cast<uint32_t>(Value >> 32);
-}
-
-/// Lo_32 - This function returns the low 32 bits of a 64 bit value.
-inline uint32_t Lo_32(uint64_t Value) {
- return static_cast<uint32_t>(Value);
-}
-
-/// is?Type - these functions produce optimal testing for integer data types.
-inline bool isInt8 (int64_t Value) {
- return static_cast<int8_t>(Value) == Value;
-}
-inline bool isUInt8 (int64_t Value) {
- return static_cast<uint8_t>(Value) == Value;
-}
-inline bool isInt16 (int64_t Value) {
- return static_cast<int16_t>(Value) == Value;
-}
-inline bool isUInt16(int64_t Value) {
- return static_cast<uint16_t>(Value) == Value;
-}
-inline bool isInt32 (int64_t Value) {
- return static_cast<int32_t>(Value) == Value;
-}
-inline bool isUInt32(int64_t Value) {
- return static_cast<uint32_t>(Value) == Value;
-}
-
-/// isMask_32 - This function returns true if the argument is a sequence of ones
-/// starting at the least significant bit with the remainder zero (32 bit
-/// version). Ex. isMask_32(0x0000FFFFU) == true.
-inline bool isMask_32(uint32_t Value) {
- return Value && ((Value + 1) & Value) == 0;
-}
-
-/// isMask_64 - This function returns true if the argument is a sequence of ones
-/// starting at the least significant bit with the remainder zero (64 bit
-/// version).
-inline bool isMask_64(uint64_t Value) {
- return Value && ((Value + 1) & Value) == 0;
-}
-
-/// isShiftedMask_32 - This function returns true if the argument contains a
-/// sequence of ones with the remainder zero (32 bit version.)
-/// Ex. isShiftedMask_32(0x0000FF00U) == true.
-inline bool isShiftedMask_32(uint32_t Value) {
- return isMask_32((Value - 1) | Value);
-}
-
-/// isShiftedMask_64 - This function returns true if the argument contains a
-/// sequence of ones with the remainder zero (64 bit version.)
-inline bool isShiftedMask_64(uint64_t Value) {
- return isMask_64((Value - 1) | Value);
-}
-
-/// isPowerOf2_32 - This function returns true if the argument is a power of
-/// two > 0. Ex. isPowerOf2_32(0x00100000U) == true (32 bit edition.)
-inline bool isPowerOf2_32(uint32_t Value) {
- return Value && !(Value & (Value - 1));
-}
-
-/// isPowerOf2_64 - This function returns true if the argument is a power of two
-/// > 0 (64 bit edition.)
-inline bool isPowerOf2_64(uint64_t Value) {
- return Value && !(Value & (Value - int64_t(1L)));
-}
-
-/// ByteSwap_16 - This function returns a byte-swapped representation of the
-/// 16-bit argument, Value.
-inline uint16_t ByteSwap_16(uint16_t Value) {
-#if defined(_MSC_VER) && !defined(_DEBUG)
- // The DLL version of the runtime lacks these functions (bug!?), but in a
- // release build they're replaced with BSWAP instructions anyway.
- return _byteswap_ushort(Value);
-#else
- uint16_t Hi = Value << 8;
- uint16_t Lo = Value >> 8;
- return Hi | Lo;
-#endif
-}
-
-/// ByteSwap_32 - This function returns a byte-swapped representation of the
-/// 32-bit argument, Value.
-inline uint32_t ByteSwap_32(uint32_t Value) {
-#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
- return __builtin_bswap32(Value);
-#elif defined(_MSC_VER) && !defined(_DEBUG)
- return _byteswap_ulong(Value);
-#else
- uint32_t Byte0 = Value & 0x000000FF;
- uint32_t Byte1 = Value & 0x0000FF00;
- uint32_t Byte2 = Value & 0x00FF0000;
- uint32_t Byte3 = Value & 0xFF000000;
- return (Byte0 << 24) | (Byte1 << 8) | (Byte2 >> 8) | (Byte3 >> 24);
-#endif
-}
-
-/// ByteSwap_64 - This function returns a byte-swapped representation of the
-/// 64-bit argument, Value.
-inline uint64_t ByteSwap_64(uint64_t Value) {
-#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
- return __builtin_bswap64(Value);
-#elif defined(_MSC_VER) && !defined(_DEBUG)
- return _byteswap_uint64(Value);
-#else
- uint64_t Hi = ByteSwap_32(uint32_t(Value));
- uint32_t Lo = ByteSwap_32(uint32_t(Value >> 32));
- return (Hi << 32) | Lo;
-#endif
-}
-
-/// CountLeadingZeros_32 - this function performs the platform optimal form of
-/// counting the number of zeros from the most significant bit to the first one
-/// bit. Ex. CountLeadingZeros_32(0x00F000FF) == 8.
-/// Returns 32 if the word is zero.
-inline unsigned CountLeadingZeros_32(uint32_t Value) {
- unsigned Count; // result
-#if __GNUC__ >= 4
- // PowerPC is defined for __builtin_clz(0)
-#if !defined(__ppc__) && !defined(__ppc64__)
- if (!Value) return 32;
-#endif
- Count = __builtin_clz(Value);
-#else
- if (!Value) return 32;
- Count = 0;
- // bisecton method for count leading zeros
- for (unsigned Shift = 32 >> 1; Shift; Shift >>= 1) {
- uint32_t Tmp = Value >> Shift;
- if (Tmp) {
- Value = Tmp;
- } else {
- Count |= Shift;
- }
- }
-#endif
- return Count;
-}
-
-/// CountLeadingOnes_32 - this function performs the operation of
-/// counting the number of ones from the most significant bit to the first zero
-/// bit. Ex. CountLeadingOnes_32(0xFF0FFF00) == 8.
-/// Returns 32 if the word is all ones.
-inline unsigned CountLeadingOnes_32(uint32_t Value) {
- return CountLeadingZeros_32(~Value);
-}
-
-/// CountLeadingZeros_64 - This function performs the platform optimal form
-/// of counting the number of zeros from the most significant bit to the first
-/// one bit (64 bit edition.)
-/// Returns 64 if the word is zero.
-inline unsigned CountLeadingZeros_64(uint64_t Value) {
- unsigned Count; // result
-#if __GNUC__ >= 4
- // PowerPC is defined for __builtin_clzll(0)
-#if !defined(__ppc__) && !defined(__ppc64__)
- if (!Value) return 64;
-#endif
- Count = __builtin_clzll(Value);
-#else
- if (sizeof(long) == sizeof(int64_t)) {
- if (!Value) return 64;
- Count = 0;
- // bisecton method for count leading zeros
- for (unsigned Shift = 64 >> 1; Shift; Shift >>= 1) {
- uint64_t Tmp = Value >> Shift;
- if (Tmp) {
- Value = Tmp;
- } else {
- Count |= Shift;
- }
- }
- } else {
- // get hi portion
- uint32_t Hi = Hi_32(Value);
-
- // if some bits in hi portion
- if (Hi) {
- // leading zeros in hi portion plus all bits in lo portion
- Count = CountLeadingZeros_32(Hi);
- } else {
- // get lo portion
- uint32_t Lo = Lo_32(Value);
- // same as 32 bit value
- Count = CountLeadingZeros_32(Lo)+32;
- }
- }
-#endif
- return Count;
-}
-
-/// CountLeadingOnes_64 - This function performs the operation
-/// of counting the number of ones from the most significant bit to the first
-/// zero bit (64 bit edition.)
-/// Returns 64 if the word is all ones.
-inline unsigned CountLeadingOnes_64(uint64_t Value) {
- return CountLeadingZeros_64(~Value);
-}
-
-/// CountTrailingZeros_32 - this function performs the platform optimal form of
-/// counting the number of zeros from the least significant bit to the first one
-/// bit. Ex. CountTrailingZeros_32(0xFF00FF00) == 8.
-/// Returns 32 if the word is zero.
-inline unsigned CountTrailingZeros_32(uint32_t Value) {
-#if __GNUC__ >= 4
- return Value ? __builtin_ctz(Value) : 32;
-#else
- static const unsigned Mod37BitPosition[] = {
- 32, 0, 1, 26, 2, 23, 27, 0, 3, 16, 24, 30, 28, 11, 0, 13,
- 4, 7, 17, 0, 25, 22, 31, 15, 29, 10, 12, 6, 0, 21, 14, 9,
- 5, 20, 8, 19, 18
- };
- return Mod37BitPosition[(-Value & Value) % 37];
-#endif
-}
-
-/// CountTrailingOnes_32 - this function performs the operation of
-/// counting the number of ones from the least significant bit to the first zero
-/// bit. Ex. CountTrailingOnes_32(0x00FF00FF) == 8.
-/// Returns 32 if the word is all ones.
-inline unsigned CountTrailingOnes_32(uint32_t Value) {
- return CountTrailingZeros_32(~Value);
-}
-
-/// CountTrailingZeros_64 - This function performs the platform optimal form
-/// of counting the number of zeros from the least significant bit to the first
-/// one bit (64 bit edition.)
-/// Returns 64 if the word is zero.
-inline unsigned CountTrailingZeros_64(uint64_t Value) {
-#if __GNUC__ >= 4
- return Value ? __builtin_ctzll(Value) : 64;
-#else
- static const unsigned Mod67Position[] = {
- 64, 0, 1, 39, 2, 15, 40, 23, 3, 12, 16, 59, 41, 19, 24, 54,
- 4, 64, 13, 10, 17, 62, 60, 28, 42, 30, 20, 51, 25, 44, 55,
- 47, 5, 32, 65, 38, 14, 22, 11, 58, 18, 53, 63, 9, 61, 27,
- 29, 50, 43, 46, 31, 37, 21, 57, 52, 8, 26, 49, 45, 36, 56,
- 7, 48, 35, 6, 34, 33, 0
- };
- return Mod67Position[(-Value & Value) % 67];
-#endif
-}
-
-/// CountTrailingOnes_64 - This function performs the operation
-/// of counting the number of ones from the least significant bit to the first
-/// zero bit (64 bit edition.)
-/// Returns 64 if the word is all ones.
-inline unsigned CountTrailingOnes_64(uint64_t Value) {
- return CountTrailingZeros_64(~Value);
-}
-
-/// CountPopulation_32 - this function counts the number of set bits in a value.
-/// Ex. CountPopulation(0xF000F000) = 8
-/// Returns 0 if the word is zero.
-inline unsigned CountPopulation_32(uint32_t Value) {
-#if __GNUC__ >= 4
- return __builtin_popcount(Value);
-#else
- uint32_t v = Value - ((Value >> 1) & 0x55555555);
- v = (v & 0x33333333) + ((v >> 2) & 0x33333333);
- return ((v + (v >> 4) & 0xF0F0F0F) * 0x1010101) >> 24;
-#endif
-}
-
-/// CountPopulation_64 - this function counts the number of set bits in a value,
-/// (64 bit edition.)
-inline unsigned CountPopulation_64(uint64_t Value) {
-#if __GNUC__ >= 4
- return __builtin_popcountll(Value);
-#else
- uint64_t v = Value - ((Value >> 1) & 0x5555555555555555ULL);
- v = (v & 0x3333333333333333ULL) + ((v >> 2) & 0x3333333333333333ULL);
- v = (v + (v >> 4)) & 0x0F0F0F0F0F0F0F0FULL;
- return unsigned((uint64_t)(v * 0x0101010101010101ULL) >> 56);
-#endif
-}
-
-/// Log2_32 - This function returns the floor log base 2 of the specified value,
-/// -1 if the value is zero. (32 bit edition.)
-/// Ex. Log2_32(32) == 5, Log2_32(1) == 0, Log2_32(0) == -1, Log2_32(6) == 2
-inline unsigned Log2_32(uint32_t Value) {
- return 31 - CountLeadingZeros_32(Value);
-}
-
-/// Log2_64 - This function returns the floor log base 2 of the specified value,
-/// -1 if the value is zero. (64 bit edition.)
-inline unsigned Log2_64(uint64_t Value) {
- return 63 - CountLeadingZeros_64(Value);
-}
-
-/// Log2_32_Ceil - This function returns the ceil log base 2 of the specified
-/// value, 32 if the value is zero. (32 bit edition).
-/// Ex. Log2_32_Ceil(32) == 5, Log2_32_Ceil(1) == 0, Log2_32_Ceil(6) == 3
-inline unsigned Log2_32_Ceil(uint32_t Value) {
- return 32-CountLeadingZeros_32(Value-1);
-}
-
-/// Log2_64 - This function returns the ceil log base 2 of the specified value,
-/// 64 if the value is zero. (64 bit edition.)
-inline unsigned Log2_64_Ceil(uint64_t Value) {
- return 64-CountLeadingZeros_64(Value-1);
-}
-
-/// GreatestCommonDivisor64 - Return the greatest common divisor of the two
-/// values using Euclid's algorithm.
-inline uint64_t GreatestCommonDivisor64(uint64_t A, uint64_t B) {
- while (B) {
- uint64_t T = B;
- B = A % B;
- A = T;
- }
- return A;
-}
-
-/// BitsToDouble - This function takes a 64-bit integer and returns the bit
-/// equivalent double.
-inline double BitsToDouble(uint64_t Bits) {
- union {
- uint64_t L;
- double D;
- } T;
- T.L = Bits;
- return T.D;
-}
-
-/// BitsToFloat - This function takes a 32-bit integer and returns the bit
-/// equivalent float.
-inline float BitsToFloat(uint32_t Bits) {
- union {
- uint32_t I;
- float F;
- } T;
- T.I = Bits;
- return T.F;
-}
-
-/// DoubleToBits - This function takes a double and returns the bit
-/// equivalent 64-bit integer.
-inline uint64_t DoubleToBits(double Double) {
- union {
- uint64_t L;
- double D;
- } T;
- T.D = Double;
- return T.L;
-}
-
-/// FloatToBits - This function takes a float and returns the bit
-/// equivalent 32-bit integer.
-inline uint32_t FloatToBits(float Float) {
- union {
- uint32_t I;
- float F;
- } T;
- T.F = Float;
- return T.I;
-}
-
-/// Platform-independent wrappers for the C99 isnan() function.
-int IsNAN(float f);
-int IsNAN(double d);
-
-/// Platform-independent wrappers for the C99 isinf() function.
-int IsInf(float f);
-int IsInf(double d);
-
-/// MinAlign - A and B are either alignments or offsets. Return the minimum
-/// alignment that may be assumed after adding the two together.
-static inline uint64_t MinAlign(uint64_t A, uint64_t B) {
- // The largest power of 2 that divides both A and B.
- return (A | B) & -(A | B);
-}
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/Support/MemoryBuffer.h b/release_23/include/llvm/Support/MemoryBuffer.h
deleted file mode 100644
index ac77f6c9a181..000000000000
--- a/release_23/include/llvm/Support/MemoryBuffer.h
+++ /dev/null
@@ -1,109 +0,0 @@
-//===--- MemoryBuffer.h - Memory Buffer Interface ---------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines the MemoryBuffer interface.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_SUPPORT_MEMORYBUFFER_H
-#define LLVM_SUPPORT_MEMORYBUFFER_H
-
-#include "llvm/Support/DataTypes.h"
-#include <string>
-
-namespace llvm {
-
-/// MemoryBuffer - This interface provides simple read-only access to a block
-/// of memory, and provides simple methods for reading files and standard input
-/// into a memory buffer. In addition to basic access to the characters in the
-/// file, this interface guarantees you can read one character past the end of
-/// @verbatim the file, and that this character will read as '\0'. @endverbatim
-class MemoryBuffer {
- const char *BufferStart; // Start of the buffer.
- const char *BufferEnd; // End of the buffer.
-
- /// MustDeleteBuffer - True if we allocated this buffer. If so, the
- /// destructor must know the delete[] it.
- bool MustDeleteBuffer;
-protected:
- MemoryBuffer() : MustDeleteBuffer(false) {}
- void init(const char *BufStart, const char *BufEnd);
- void initCopyOf(const char *BufStart, const char *BufEnd);
-public:
- virtual ~MemoryBuffer();
-
- const char *getBufferStart() const { return BufferStart; }
- const char *getBufferEnd() const { return BufferEnd; }
- size_t getBufferSize() const { return BufferEnd-BufferStart; }
-
- /// getBufferIdentifier - Return an identifier for this buffer, typically the
- /// filename it was read from.
- virtual const char *getBufferIdentifier() const {
- return "Unknown buffer";
- }
-
- /// getFile - Open the specified file as a MemoryBuffer, returning a new
- /// MemoryBuffer if successful, otherwise returning null. If FileSize is
- /// specified, this means that the client knows that the file exists and that
- /// it has the specified size.
- static MemoryBuffer *getFile(const char *Filename,
- std::string *ErrStr = 0,
- int64_t FileSize = -1);
-
- /// getMemBuffer - Open the specified memory range as a MemoryBuffer. Note
- /// that EndPtr[0] must be a null byte and be accessible!
- static MemoryBuffer *getMemBuffer(const char *StartPtr, const char *EndPtr,
- const char *BufferName = "");
-
- /// getMemBufferCopy - Open the specified memory range as a MemoryBuffer,
- /// copying the contents and taking ownership of it. This has no requirements
- /// on EndPtr[0].
- static MemoryBuffer *getMemBufferCopy(const char *StartPtr,const char *EndPtr,
- const char *BufferName = "");
-
- /// getNewMemBuffer - Allocate a new MemoryBuffer of the specified size that
- /// is completely initialized to zeros. Note that the caller should
- /// initialize the memory allocated by this method. The memory is owned by
- /// the MemoryBuffer object.
- static MemoryBuffer *getNewMemBuffer(size_t Size,
- const char *BufferName = "");
-
- /// getNewUninitMemBuffer - Allocate a new MemoryBuffer of the specified size
- /// that is not initialized. Note that the caller should initialize the
- /// memory allocated by this method. The memory is owned by the MemoryBuffer
- /// object.
- static MemoryBuffer *getNewUninitMemBuffer(size_t Size,
- const char *BufferName = "");
-
- /// getSTDIN - Read all of stdin into a file buffer, and return it. This
- /// returns null if stdin is empty.
- static MemoryBuffer *getSTDIN();
-
-
- /// getFileOrSTDIN - Open the specified file as a MemoryBuffer, or open stdin
- /// if the Filename is "-". If an error occurs, this returns null and fills
- /// in *ErrStr with a reason. If stdin is empty, this API (unlike getSTDIN)
- /// returns an empty buffer.
- static MemoryBuffer *getFileOrSTDIN(const char *Filename,
- std::string *ErrStr = 0,
- int64_t FileSize = -1);
-
- /// getFileOrSTDIN - Open the specified file as a MemoryBuffer, or open stdin
- /// if the Filename is "-". If an error occurs, this returns null and fills
- /// in *ErrStr with a reason.
- static MemoryBuffer *getFileOrSTDIN(const std::string &FN,
- std::string *ErrStr = 0,
- int64_t FileSize = -1) {
- return getFileOrSTDIN(FN.c_str(), ErrStr, FileSize);
- }
-};
-
-} // end namespace llvm
-
-#endif
diff --git a/release_23/include/llvm/Support/MutexGuard.h b/release_23/include/llvm/Support/MutexGuard.h
deleted file mode 100644
index 723794177c30..000000000000
--- a/release_23/include/llvm/Support/MutexGuard.h
+++ /dev/null
@@ -1,41 +0,0 @@
-//===-- Support/MutexGuard.h - Acquire/Release Mutex In Scope ---*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines a guard for a block of code that ensures a Mutex is locked
-// upon construction and released upon destruction.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_SUPPORT_MUTEXGUARD_H
-#define LLVM_SUPPORT_MUTEXGUARD_H
-
-#include <llvm/System/Mutex.h>
-
-namespace llvm {
- /// Instances of this class acquire a given Mutex Lock when constructed and
- /// hold that lock until destruction. The intention is to instantiate one of
- /// these on the stack at the top of some scope to be assured that C++
- /// destruction of the object will always release the Mutex and thus avoid
- /// a host of nasty multi-threading problems in the face of exceptions, etc.
- /// @brief Guard a section of code with a Mutex.
- class MutexGuard {
- sys::Mutex &M;
- MutexGuard(const MutexGuard &); // DO NOT IMPLEMENT
- void operator=(const MutexGuard &); // DO NOT IMPLEMENT
- public:
- MutexGuard(sys::Mutex &m) : M(m) { M.acquire(); }
- ~MutexGuard() { M.release(); }
- /// holds - Returns true if this locker instance holds the specified lock.
- /// This is mostly used in assertions to validate that the correct mutex
- /// is held.
- bool holds(const sys::Mutex& lock) const { return &M == &lock; }
- };
-}
-
-#endif // LLVM_SUPPORT_MUTEXGUARD_H
diff --git a/release_23/include/llvm/Support/OutputBuffer.h b/release_23/include/llvm/Support/OutputBuffer.h
deleted file mode 100644
index 0fedb15e4050..000000000000
--- a/release_23/include/llvm/Support/OutputBuffer.h
+++ /dev/null
@@ -1,154 +0,0 @@
-//=== OutputBuffer.h - Output Buffer ----------------------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// Methods to output values to a data buffer.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_SUPPORT_OUTPUTBUFFER_H
-#define LLVM_SUPPORT_OUTPUTBUFFER_H
-
-#include <string>
-#include <vector>
-
-namespace llvm {
-
- class OutputBuffer {
- /// Output buffer.
- std::vector<unsigned char> &Output;
-
- /// is64Bit/isLittleEndian - This information is inferred from the target
- /// machine directly, indicating what header values and flags to set.
- bool is64Bit, isLittleEndian;
- public:
- OutputBuffer(std::vector<unsigned char> &Out,
- bool is64bit, bool le)
- : Output(Out), is64Bit(is64bit), isLittleEndian(le) {}
-
- // align - Emit padding into the file until the current output position is
- // aligned to the specified power of two boundary.
- void align(unsigned Boundary) {
- assert(Boundary && (Boundary & (Boundary - 1)) == 0 &&
- "Must align to 2^k boundary");
- size_t Size = Output.size();
-
- if (Size & (Boundary - 1)) {
- // Add padding to get alignment to the correct place.
- size_t Pad = Boundary - (Size & (Boundary - 1));
- Output.resize(Size + Pad);
- }
- }
-
- //===------------------------------------------------------------------===//
- // Out Functions - Output the specified value to the data buffer.
-
- void outbyte(unsigned char X) {
- Output.push_back(X);
- }
- void outhalf(unsigned short X) {
- if (isLittleEndian) {
- Output.push_back(X & 255);
- Output.push_back(X >> 8);
- } else {
- Output.push_back(X >> 8);
- Output.push_back(X & 255);
- }
- }
- void outword(unsigned X) {
- if (isLittleEndian) {
- Output.push_back((X >> 0) & 255);
- Output.push_back((X >> 8) & 255);
- Output.push_back((X >> 16) & 255);
- Output.push_back((X >> 24) & 255);
- } else {
- Output.push_back((X >> 24) & 255);
- Output.push_back((X >> 16) & 255);
- Output.push_back((X >> 8) & 255);
- Output.push_back((X >> 0) & 255);
- }
- }
- void outxword(uint64_t X) {
- if (isLittleEndian) {
- Output.push_back(unsigned(X >> 0) & 255);
- Output.push_back(unsigned(X >> 8) & 255);
- Output.push_back(unsigned(X >> 16) & 255);
- Output.push_back(unsigned(X >> 24) & 255);
- Output.push_back(unsigned(X >> 32) & 255);
- Output.push_back(unsigned(X >> 40) & 255);
- Output.push_back(unsigned(X >> 48) & 255);
- Output.push_back(unsigned(X >> 56) & 255);
- } else {
- Output.push_back(unsigned(X >> 56) & 255);
- Output.push_back(unsigned(X >> 48) & 255);
- Output.push_back(unsigned(X >> 40) & 255);
- Output.push_back(unsigned(X >> 32) & 255);
- Output.push_back(unsigned(X >> 24) & 255);
- Output.push_back(unsigned(X >> 16) & 255);
- Output.push_back(unsigned(X >> 8) & 255);
- Output.push_back(unsigned(X >> 0) & 255);
- }
- }
- void outaddr32(unsigned X) {
- outword(X);
- }
- void outaddr64(uint64_t X) {
- outxword(X);
- }
- void outaddr(uint64_t X) {
- if (!is64Bit)
- outword((unsigned)X);
- else
- outxword(X);
- }
- void outstring(const std::string &S, unsigned Length) {
- unsigned len_to_copy = static_cast<unsigned>(S.length()) < Length
- ? static_cast<unsigned>(S.length()) : Length;
- unsigned len_to_fill = static_cast<unsigned>(S.length()) < Length
- ? Length - static_cast<unsigned>(S.length()) : 0;
-
- for (unsigned i = 0; i < len_to_copy; ++i)
- outbyte(S[i]);
-
- for (unsigned i = 0; i < len_to_fill; ++i)
- outbyte(0);
- }
-
- //===------------------------------------------------------------------===//
- // Fix Functions - Replace an existing entry at an offset.
-
- void fixhalf(unsigned short X, unsigned Offset) {
- unsigned char *P = &Output[Offset];
- P[0] = (X >> (isLittleEndian ? 0 : 8)) & 255;
- P[1] = (X >> (isLittleEndian ? 8 : 0)) & 255;
- }
- void fixword(unsigned X, unsigned Offset) {
- unsigned char *P = &Output[Offset];
- P[0] = (X >> (isLittleEndian ? 0 : 24)) & 255;
- P[1] = (X >> (isLittleEndian ? 8 : 16)) & 255;
- P[2] = (X >> (isLittleEndian ? 16 : 8)) & 255;
- P[3] = (X >> (isLittleEndian ? 24 : 0)) & 255;
- }
- void fixaddr(uint64_t X, unsigned Offset) {
- if (!is64Bit)
- fixword((unsigned)X, Offset);
- else
- assert(0 && "Emission of 64-bit data not implemented yet!");
- }
-
- unsigned char &operator[](unsigned Index) {
- return Output[Index];
- }
- const unsigned char &operator[](unsigned Index) const {
- return Output[Index];
- }
- };
-
-} // end llvm namespace
-
-#endif // LLVM_SUPPORT_OUTPUTBUFFER_H
diff --git a/release_23/include/llvm/Support/PassNameParser.h b/release_23/include/llvm/Support/PassNameParser.h
deleted file mode 100644
index 961638c43f49..000000000000
--- a/release_23/include/llvm/Support/PassNameParser.h
+++ /dev/null
@@ -1,132 +0,0 @@
-//===- llvm/Support/PassNameParser.h ----------------------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file the PassNameParser and FilteredPassNameParser<> classes, which are
-// used to add command line arguments to a utility for all of the passes that
-// have been registered into the system.
-//
-// The PassNameParser class adds ALL passes linked into the system (that are
-// creatable) as command line arguments to the tool (when instantiated with the
-// appropriate command line option template). The FilteredPassNameParser<>
-// template is used for the same purposes as PassNameParser, except that it only
-// includes passes that have a PassType that are compatible with the filter
-// (which is the template argument).
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_SUPPORT_PASS_NAME_PARSER_H
-#define LLVM_SUPPORT_PASS_NAME_PARSER_H
-
-#include "llvm/Support/CommandLine.h"
-#include "llvm/Pass.h"
-#include <algorithm>
-#include <cstring>
-
-namespace llvm {
-
-//===----------------------------------------------------------------------===//
-// PassNameParser class - Make use of the pass registration mechanism to
-// automatically add a command line argument to opt for each pass.
-//
-class PassNameParser : public PassRegistrationListener,
- public cl::parser<const PassInfo*> {
- cl::Option *Opt;
-public:
- PassNameParser() : Opt(0) {}
-
- void initialize(cl::Option &O) {
- Opt = &O;
- cl::parser<const PassInfo*>::initialize(O);
-
- // Add all of the passes to the map that got initialized before 'this' did.
- enumeratePasses();
- }
-
- // ignorablePassImpl - Can be overriden in subclasses to refine the list of
- // which passes we want to include.
- //
- virtual bool ignorablePassImpl(const PassInfo *P) const { return false; }
-
- inline bool ignorablePass(const PassInfo *P) const {
- // Ignore non-selectable and non-constructible passes! Ignore
- // non-optimizations.
- return P->getPassArgument() == 0 || *P->getPassArgument() == 0 ||
- P->getNormalCtor() == 0 || ignorablePassImpl(P);
- }
-
- // Implement the PassRegistrationListener callbacks used to populate our map
- //
- virtual void passRegistered(const PassInfo *P) {
- if (ignorablePass(P) || !Opt) return;
- if (findOption(P->getPassArgument()) != getNumOptions()) {
- cerr << "Two passes with the same argument (-"
- << P->getPassArgument() << ") attempted to be registered!\n";
- abort();
- }
- addLiteralOption(P->getPassArgument(), P, P->getPassName());
- }
- virtual void passEnumerate(const PassInfo *P) { passRegistered(P); }
-
- // ValLessThan - Provide a sorting comparator for Values elements...
- typedef std::pair<const char*,
- std::pair<const PassInfo*, const char*> > ValType;
- static bool ValLessThan(const ValType &VT1, const ValType &VT2) {
- return std::string(VT1.first) < std::string(VT2.first);
- }
-
- // printOptionInfo - Print out information about this option. Override the
- // default implementation to sort the table before we print...
- virtual void printOptionInfo(const cl::Option &O, size_t GlobalWidth) const {
- PassNameParser *PNP = const_cast<PassNameParser*>(this);
- std::sort(PNP->Values.begin(), PNP->Values.end(), ValLessThan);
- cl::parser<const PassInfo*>::printOptionInfo(O, GlobalWidth);
- }
-};
-
-///===----------------------------------------------------------------------===//
-/// FilteredPassNameParser class - Make use of the pass registration
-/// mechanism to automatically add a command line argument to opt for
-/// each pass that satisfies a filter criteria. Filter should return
-/// true for passes to be registered as command-line options.
-///
-template<typename Filter>
-class FilteredPassNameParser : public PassNameParser {
-private:
- Filter filter;
-
-public:
- bool ignorablePassImpl(const PassInfo *P) const { return !filter(*P); }
-};
-
-///===----------------------------------------------------------------------===//
-/// PassArgFilter - A filter for use with PassNameFilterParser that only
-/// accepts a Pass whose Arg matches certain strings.
-///
-/// Use like this:
-///
-/// extern const char AllowedPassArgs[] = "-anders_aa -dse";
-///
-/// static cl::list<
-/// const PassInfo*,
-/// bool,
-/// FilteredPassNameParser<PassArgFilter<AllowedPassArgs> > >
-/// PassList(cl::desc("Passes available:"));
-///
-/// Only the -anders_aa and -dse options will be available to the user.
-///
-template<const char *Args>
-class PassArgFilter {
-public:
- bool operator()(const PassInfo &P) const {
- return(std::strstr(Args, P.getPassArgument()));
- }
-};
-
-} // End llvm namespace
-#endif
diff --git a/release_23/include/llvm/Support/PatternMatch.h b/release_23/include/llvm/Support/PatternMatch.h
deleted file mode 100644
index a3951e2dd39d..000000000000
--- a/release_23/include/llvm/Support/PatternMatch.h
+++ /dev/null
@@ -1,453 +0,0 @@
-//===-- llvm/Support/PatternMatch.h - Match on the LLVM IR ------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file provides a simple and efficient mechanism for performing general
-// tree-based pattern matches on the LLVM IR. The power of these routines is
-// that it allows you to write concise patterns that are expressive and easy to
-// understand. The other major advantage of this is that it allows you to
-// trivially capture/bind elements in the pattern to variables. For example,
-// you can do something like this:
-//
-// Value *Exp = ...
-// Value *X, *Y; ConstantInt *C1, *C2; // (X & C1) | (Y & C2)
-// if (match(Exp, m_Or(m_And(m_Value(X), m_ConstantInt(C1)),
-// m_And(m_Value(Y), m_ConstantInt(C2))))) {
-// ... Pattern is matched and variables are bound ...
-// }
-//
-// This is primarily useful to things like the instruction combiner, but can
-// also be useful for static analysis tools or code generators.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_SUPPORT_PATTERNMATCH_H
-#define LLVM_SUPPORT_PATTERNMATCH_H
-
-#include "llvm/Constants.h"
-#include "llvm/Instructions.h"
-
-namespace llvm {
-namespace PatternMatch {
-
-template<typename Val, typename Pattern>
-bool match(Val *V, const Pattern &P) {
- return const_cast<Pattern&>(P).match(V);
-}
-
-template<typename Class>
-struct leaf_ty {
- template<typename ITy>
- bool match(ITy *V) { return isa<Class>(V); }
-};
-
-/// m_Value() - Match an arbitrary value and ignore it.
-inline leaf_ty<Value> m_Value() { return leaf_ty<Value>(); }
-/// m_ConstantInt() - Match an arbitrary ConstantInt and ignore it.
-inline leaf_ty<ConstantInt> m_ConstantInt() { return leaf_ty<ConstantInt>(); }
-
-struct zero_ty {
- template<typename ITy>
- bool match(ITy *V) {
- if (const Constant *C = dyn_cast<Constant>(V))
- return C->isNullValue();
- return false;
- }
-};
-
-/// m_Zero() - Match an arbitrary zero/null constant.
-inline zero_ty m_Zero() { return zero_ty(); }
-
-
-template<typename Class>
-struct bind_ty {
- Class *&VR;
- bind_ty(Class *&V) : VR(V) {}
-
- template<typename ITy>
- bool match(ITy *V) {
- if (Class *CV = dyn_cast<Class>(V)) {
- VR = CV;
- return true;
- }
- return false;
- }
-};
-
-/// m_Value - Match a value, capturing it if we match.
-inline bind_ty<Value> m_Value(Value *&V) { return V; }
-
-/// m_ConstantInt - Match a ConstantInt, capturing the value if we match.
-inline bind_ty<ConstantInt> m_ConstantInt(ConstantInt *&CI) { return CI; }
-
-//===----------------------------------------------------------------------===//
-// Matchers for specific binary operators.
-//
-
-template<typename LHS_t, typename RHS_t,
- unsigned Opcode, typename ConcreteTy = BinaryOperator>
-struct BinaryOp_match {
- LHS_t L;
- RHS_t R;
-
- BinaryOp_match(const LHS_t &LHS, const RHS_t &RHS) : L(LHS), R(RHS) {}
-
- template<typename OpTy>
- bool match(OpTy *V) {
- if (V->getValueID() == Value::InstructionVal + Opcode) {
- ConcreteTy *I = cast<ConcreteTy>(V);
- return I->getOpcode() == Opcode && L.match(I->getOperand(0)) &&
- R.match(I->getOperand(1));
- }
- if (ConstantExpr *CE = dyn_cast<ConstantExpr>(V))
- return CE->getOpcode() == Opcode && L.match(CE->getOperand(0)) &&
- R.match(CE->getOperand(1));
- return false;
- }
-};
-
-template<typename LHS, typename RHS>
-inline BinaryOp_match<LHS, RHS, Instruction::Add> m_Add(const LHS &L,
- const RHS &R) {
- return BinaryOp_match<LHS, RHS, Instruction::Add>(L, R);
-}
-
-template<typename LHS, typename RHS>
-inline BinaryOp_match<LHS, RHS, Instruction::Sub> m_Sub(const LHS &L,
- const RHS &R) {
- return BinaryOp_match<LHS, RHS, Instruction::Sub>(L, R);
-}
-
-template<typename LHS, typename RHS>
-inline BinaryOp_match<LHS, RHS, Instruction::Mul> m_Mul(const LHS &L,
- const RHS &R) {
- return BinaryOp_match<LHS, RHS, Instruction::Mul>(L, R);
-}
-
-template<typename LHS, typename RHS>
-inline BinaryOp_match<LHS, RHS, Instruction::UDiv> m_UDiv(const LHS &L,
- const RHS &R) {
- return BinaryOp_match<LHS, RHS, Instruction::UDiv>(L, R);
-}
-
-template<typename LHS, typename RHS>
-inline BinaryOp_match<LHS, RHS, Instruction::SDiv> m_SDiv(const LHS &L,
- const RHS &R) {
- return BinaryOp_match<LHS, RHS, Instruction::SDiv>(L, R);
-}
-
-template<typename LHS, typename RHS>
-inline BinaryOp_match<LHS, RHS, Instruction::FDiv> m_FDiv(const LHS &L,
- const RHS &R) {
- return BinaryOp_match<LHS, RHS, Instruction::FDiv>(L, R);
-}
-
-template<typename LHS, typename RHS>
-inline BinaryOp_match<LHS, RHS, Instruction::URem> m_URem(const LHS &L,
- const RHS &R) {
- return BinaryOp_match<LHS, RHS, Instruction::URem>(L, R);
-}
-
-template<typename LHS, typename RHS>
-inline BinaryOp_match<LHS, RHS, Instruction::SRem> m_SRem(const LHS &L,
- const RHS &R) {
- return BinaryOp_match<LHS, RHS, Instruction::SRem>(L, R);
-}
-
-template<typename LHS, typename RHS>
-inline BinaryOp_match<LHS, RHS, Instruction::FRem> m_FRem(const LHS &L,
- const RHS &R) {
- return BinaryOp_match<LHS, RHS, Instruction::FRem>(L, R);
-}
-
-template<typename LHS, typename RHS>
-inline BinaryOp_match<LHS, RHS, Instruction::And> m_And(const LHS &L,
- const RHS &R) {
- return BinaryOp_match<LHS, RHS, Instruction::And>(L, R);
-}
-
-template<typename LHS, typename RHS>
-inline BinaryOp_match<LHS, RHS, Instruction::Or> m_Or(const LHS &L,
- const RHS &R) {
- return BinaryOp_match<LHS, RHS, Instruction::Or>(L, R);
-}
-
-template<typename LHS, typename RHS>
-inline BinaryOp_match<LHS, RHS, Instruction::Xor> m_Xor(const LHS &L,
- const RHS &R) {
- return BinaryOp_match<LHS, RHS, Instruction::Xor>(L, R);
-}
-
-template<typename LHS, typename RHS>
-inline BinaryOp_match<LHS, RHS, Instruction::Shl> m_Shl(const LHS &L,
- const RHS &R) {
- return BinaryOp_match<LHS, RHS, Instruction::Shl>(L, R);
-}
-
-template<typename LHS, typename RHS>
-inline BinaryOp_match<LHS, RHS, Instruction::LShr> m_LShr(const LHS &L,
- const RHS &R) {
- return BinaryOp_match<LHS, RHS, Instruction::LShr>(L, R);
-}
-
-template<typename LHS, typename RHS>
-inline BinaryOp_match<LHS, RHS, Instruction::AShr> m_AShr(const LHS &L,
- const RHS &R) {
- return BinaryOp_match<LHS, RHS, Instruction::AShr>(L, R);
-}
-
-//===----------------------------------------------------------------------===//
-// Matchers for either AShr or LShr .. for convenience
-//
-template<typename LHS_t, typename RHS_t, typename ConcreteTy = BinaryOperator>
-struct Shr_match {
- LHS_t L;
- RHS_t R;
-
- Shr_match(const LHS_t &LHS, const RHS_t &RHS) : L(LHS), R(RHS) {}
-
- template<typename OpTy>
- bool match(OpTy *V) {
- if (V->getValueID() == Value::InstructionVal + Instruction::LShr ||
- V->getValueID() == Value::InstructionVal + Instruction::AShr) {
- ConcreteTy *I = cast<ConcreteTy>(V);
- return (I->getOpcode() == Instruction::AShr ||
- I->getOpcode() == Instruction::LShr) &&
- L.match(I->getOperand(0)) &&
- R.match(I->getOperand(1));
- }
- if (ConstantExpr *CE = dyn_cast<ConstantExpr>(V))
- return (CE->getOpcode() == Instruction::LShr ||
- CE->getOpcode() == Instruction::AShr) &&
- L.match(CE->getOperand(0)) &&
- R.match(CE->getOperand(1));
- return false;
- }
-};
-
-template<typename LHS, typename RHS>
-inline Shr_match<LHS, RHS> m_Shr(const LHS &L, const RHS &R) {
- return Shr_match<LHS, RHS>(L, R);
-}
-
-//===----------------------------------------------------------------------===//
-// Matchers for binary classes
-//
-
-template<typename LHS_t, typename RHS_t, typename Class, typename OpcType>
-struct BinaryOpClass_match {
- OpcType *Opcode;
- LHS_t L;
- RHS_t R;
-
- BinaryOpClass_match(OpcType &Op, const LHS_t &LHS,
- const RHS_t &RHS)
- : Opcode(&Op), L(LHS), R(RHS) {}
- BinaryOpClass_match(const LHS_t &LHS, const RHS_t &RHS)
- : Opcode(0), L(LHS), R(RHS) {}
-
- template<typename OpTy>
- bool match(OpTy *V) {
- if (Class *I = dyn_cast<Class>(V))
- if (L.match(I->getOperand(0)) && R.match(I->getOperand(1))) {
- if (Opcode)
- *Opcode = I->getOpcode();
- return true;
- }
-#if 0 // Doesn't handle constantexprs yet!
- if (ConstantExpr *CE = dyn_cast<ConstantExpr>(V))
- return CE->getOpcode() == Opcode && L.match(CE->getOperand(0)) &&
- R.match(CE->getOperand(1));
-#endif
- return false;
- }
-};
-
-template<typename LHS, typename RHS>
-inline BinaryOpClass_match<LHS, RHS, BinaryOperator, Instruction::BinaryOps>
-m_Shift(Instruction::BinaryOps &Op, const LHS &L, const RHS &R) {
- return BinaryOpClass_match<LHS, RHS,
- BinaryOperator, Instruction::BinaryOps>(Op, L, R);
-}
-
-template<typename LHS, typename RHS>
-inline BinaryOpClass_match<LHS, RHS, BinaryOperator, Instruction::BinaryOps>
-m_Shift(const LHS &L, const RHS &R) {
- return BinaryOpClass_match<LHS, RHS,
- BinaryOperator, Instruction::BinaryOps>(L, R);
-}
-
-//===----------------------------------------------------------------------===//
-// Matchers for CmpInst classes
-//
-
-template<typename LHS_t, typename RHS_t, typename Class, typename PredicateTy>
-struct CmpClass_match {
- PredicateTy &Predicate;
- LHS_t L;
- RHS_t R;
-
- CmpClass_match(PredicateTy &Pred, const LHS_t &LHS,
- const RHS_t &RHS)
- : Predicate(Pred), L(LHS), R(RHS) {}
-
- template<typename OpTy>
- bool match(OpTy *V) {
- if (Class *I = dyn_cast<Class>(V))
- if (L.match(I->getOperand(0)) && R.match(I->getOperand(1))) {
- Predicate = I->getPredicate();
- return true;
- }
- return false;
- }
-};
-
-template<typename LHS, typename RHS>
-inline CmpClass_match<LHS, RHS, ICmpInst, ICmpInst::Predicate>
-m_ICmp(ICmpInst::Predicate &Pred, const LHS &L, const RHS &R) {
- return CmpClass_match<LHS, RHS,
- ICmpInst, ICmpInst::Predicate>(Pred, L, R);
-}
-
-template<typename LHS, typename RHS>
-inline CmpClass_match<LHS, RHS, FCmpInst, FCmpInst::Predicate>
-m_FCmp(FCmpInst::Predicate &Pred, const LHS &L, const RHS &R) {
- return CmpClass_match<LHS, RHS,
- FCmpInst, FCmpInst::Predicate>(Pred, L, R);
-}
-
-//===----------------------------------------------------------------------===//
-// Matchers for CastInst classes
-//
-
-template<typename Op_t, typename Class>
-struct CastClass_match {
- Op_t Op;
-
- CastClass_match(const Op_t &OpMatch) : Op(OpMatch) {}
-
- template<typename OpTy>
- bool match(OpTy *V) {
- if (Class *I = dyn_cast<Class>(V))
- return Op.match(I->getOperand(0));
- return false;
- }
-};
-
-template<typename Class, typename OpTy>
-inline CastClass_match<OpTy, Class> m_Cast(const OpTy &Op) {
- return CastClass_match<OpTy, Class>(Op);
-}
-
-
-//===----------------------------------------------------------------------===//
-// Matchers for unary operators
-//
-
-template<typename LHS_t>
-struct not_match {
- LHS_t L;
-
- not_match(const LHS_t &LHS) : L(LHS) {}
-
- template<typename OpTy>
- bool match(OpTy *V) {
- if (Instruction *I = dyn_cast<Instruction>(V))
- if (I->getOpcode() == Instruction::Xor)
- return matchIfNot(I->getOperand(0), I->getOperand(1));
- if (ConstantExpr *CE = dyn_cast<ConstantExpr>(V))
- if (CE->getOpcode() == Instruction::Xor)
- return matchIfNot(CE->getOperand(0), CE->getOperand(1));
- if (ConstantInt *CI = dyn_cast<ConstantInt>(V))
- return L.match(ConstantExpr::getNot(CI));
- return false;
- }
-private:
- bool matchIfNot(Value *LHS, Value *RHS) {
- if (ConstantInt *CI = dyn_cast<ConstantInt>(RHS))
- return CI->isAllOnesValue() && L.match(LHS);
- if (ConstantInt *CI = dyn_cast<ConstantInt>(LHS))
- return CI->isAllOnesValue() && L.match(RHS);
- if (ConstantVector *CV = dyn_cast<ConstantVector>(RHS))
- return CV->isAllOnesValue() && L.match(LHS);
- if (ConstantVector *CV = dyn_cast<ConstantVector>(LHS))
- return CV->isAllOnesValue() && L.match(RHS);
- return false;
- }
-};
-
-template<typename LHS>
-inline not_match<LHS> m_Not(const LHS &L) { return L; }
-
-
-template<typename LHS_t>
-struct neg_match {
- LHS_t L;
-
- neg_match(const LHS_t &LHS) : L(LHS) {}
-
- template<typename OpTy>
- bool match(OpTy *V) {
- if (Instruction *I = dyn_cast<Instruction>(V))
- if (I->getOpcode() == Instruction::Sub)
- return matchIfNeg(I->getOperand(0), I->getOperand(1));
- if (ConstantExpr *CE = dyn_cast<ConstantExpr>(V))
- if (CE->getOpcode() == Instruction::Sub)
- return matchIfNeg(CE->getOperand(0), CE->getOperand(1));
- if (ConstantInt *CI = dyn_cast<ConstantInt>(V))
- return L.match(ConstantExpr::getNeg(CI));
- return false;
- }
-private:
- bool matchIfNeg(Value *LHS, Value *RHS) {
- return LHS == ConstantExpr::getZeroValueForNegationExpr(LHS->getType()) &&
- L.match(RHS);
- }
-};
-
-template<typename LHS>
-inline neg_match<LHS> m_Neg(const LHS &L) { return L; }
-
-
-//===----------------------------------------------------------------------===//
-// Matchers for control flow
-//
-
-template<typename Cond_t>
-struct brc_match {
- Cond_t Cond;
- BasicBlock *&T, *&F;
- brc_match(const Cond_t &C, BasicBlock *&t, BasicBlock *&f)
- : Cond(C), T(t), F(f) {
- }
-
- template<typename OpTy>
- bool match(OpTy *V) {
- if (BranchInst *BI = dyn_cast<BranchInst>(V))
- if (BI->isConditional()) {
- if (Cond.match(BI->getCondition())) {
- T = BI->getSuccessor(0);
- F = BI->getSuccessor(1);
- return true;
- }
- }
- return false;
- }
-};
-
-template<typename Cond_t>
-inline brc_match<Cond_t> m_Br(const Cond_t &C, BasicBlock *&T, BasicBlock *&F){
- return brc_match<Cond_t>(C, T, F);
-}
-
-
-}} // end llvm::match
-
-
-#endif
-
diff --git a/release_23/include/llvm/Support/PluginLoader.h b/release_23/include/llvm/Support/PluginLoader.h
deleted file mode 100644
index bdbb134b28eb..000000000000
--- a/release_23/include/llvm/Support/PluginLoader.h
+++ /dev/null
@@ -1,37 +0,0 @@
-//===-- llvm/Support/PluginLoader.h - Plugin Loader for Tools ---*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// A tool can #include this file to get a -load option that allows the user to
-// load arbitrary shared objects into the tool's address space. Note that this
-// header can only be included by a program ONCE, so it should never to used by
-// library authors.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_SUPPORT_PLUGINLOADER_H
-#define LLVM_SUPPORT_PLUGINLOADER_H
-
-#include "llvm/Support/CommandLine.h"
-
-namespace llvm {
- struct PluginLoader {
- void operator=(const std::string &Filename);
- static unsigned getNumPlugins();
- static std::string& getPlugin(unsigned num);
- };
-
-#ifndef DONT_GET_PLUGIN_LOADER_OPTION
- // This causes operator= above to be invoked for every -load option.
- static cl::opt<PluginLoader, false, cl::parser<std::string> >
- LoadOpt("load", cl::ZeroOrMore, cl::value_desc("pluginfilename"),
- cl::desc("Load the specified plugin"));
-#endif
-}
-
-#endif
diff --git a/release_23/include/llvm/Support/Registry.h b/release_23/include/llvm/Support/Registry.h
deleted file mode 100644
index d89425664ab9..000000000000
--- a/release_23/include/llvm/Support/Registry.h
+++ /dev/null
@@ -1,239 +0,0 @@
-//=== Registry.h - Linker-supported plugin registries -----------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// Defines a registry template for discovering pluggable modules.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_SUPPORT_REGISTRY_H
-#define LLVM_SUPPORT_REGISTRY_H
-
-#include "llvm/Support/CommandLine.h"
-
-namespace llvm {
- /// A simple registry entry which provides only a name, description, and
- /// no-argument constructor.
- template <typename T>
- class SimpleRegistryEntry {
- const char *Name, *Desc;
- T *(*Ctor)();
-
- public:
- SimpleRegistryEntry(const char *N, const char *D, T *(*C)())
- : Name(N), Desc(D), Ctor(C)
- {}
-
- const char *getName() const { return Name; }
- const char *getDesc() const { return Desc; }
- T *instantiate() const { return Ctor(); }
- };
-
-
- /// Traits for registry entries. If using other than SimpleRegistryEntry, it
- /// is necessary to define an alternate traits class.
- template <typename T>
- class RegistryTraits {
- RegistryTraits(); // Do not implement.
-
- public:
- typedef SimpleRegistryEntry<T> entry;
-
- /// Accessors for .
- ///
- static const char *nameof(const entry &Entry) { return Entry.getName(); }
- static const char *descof(const entry &Entry) { return Entry.getDesc(); }
- };
-
-
- /// A global registry used in conjunction with static constructors to make
- /// pluggable components (like targets or garbage collectors) "just work" when
- /// linked with an executable.
- template <typename T, typename U = RegistryTraits<T> >
- class Registry {
- public:
- typedef U traits;
- typedef typename U::entry entry;
-
- class node;
- class listener;
- class iterator;
-
- private:
- Registry(); // Do not implement.
-
- static void Announce(const entry &E) {
- for (listener *Cur = ListenerHead; Cur; Cur = Cur->Next)
- Cur->registered(E);
- }
-
- friend class node;
- static node *Head, *Tail;
-
- friend class listener;
- static listener *ListenerHead, *ListenerTail;
-
- public:
- class iterator;
-
-
- /// Node in linked list of entries.
- ///
- class node {
- friend class iterator;
-
- node *Next;
- const entry& Val;
-
- public:
- node(const entry& V) : Next(0), Val(V) {
- if (Tail)
- Tail->Next = this;
- else
- Head = this;
- Tail = this;
-
- Announce(V);
- }
- };
-
-
- /// Iterators for registry entries.
- ///
- class iterator {
- const node *Cur;
-
- public:
- explicit iterator(const node *N) : Cur(N) {}
-
- bool operator==(const iterator &That) const { return Cur == That.Cur; }
- bool operator!=(const iterator &That) const { return Cur != That.Cur; }
- iterator &operator++() { Cur = Cur->Next; return *this; }
- const entry &operator*() const { return Cur->Val; }
- const entry *operator->() const { return &Cur->Val; }
- };
-
- static iterator begin() { return iterator(Head); }
- static iterator end() { return iterator(0); }
-
-
- /// Abstract base class for registry listeners, which are informed when new
- /// entries are added to the registry. Simply subclass and instantiate:
- ///
- /// class CollectorPrinter : public Registry<Collector>::listener {
- /// protected:
- /// void registered(const Registry<Collector>::entry &e) {
- /// cerr << "collector now available: " << e->getName() << "\n";
- /// }
- ///
- /// public:
- /// CollectorPrinter() { init(); } // Print those already registered.
- /// };
- ///
- /// CollectorPrinter Printer;
- ///
- class listener {
- listener *Prev, *Next;
-
- friend void Registry::Announce(const entry &E);
-
- protected:
- /// Called when an entry is added to the registry.
- ///
- virtual void registered(const entry &) = 0;
-
- /// Calls 'registered' for each pre-existing entry.
- ///
- void init() {
- for (iterator I = begin(), E = end(); I != E; ++I)
- registered(*I);
- }
-
- public:
- listener() : Prev(ListenerTail), Next(0) {
- if (Prev)
- Prev->Next = this;
- else
- ListenerHead = this;
- ListenerTail = this;
- }
-
- virtual ~listener() {
- if (Next)
- Next->Prev = Prev;
- else
- ListenerTail = Prev;
- if (Prev)
- Prev->Next = Next;
- else
- ListenerHead = Next;
- }
- };
-
-
- /// A static registration template. Use like such:
- ///
- /// Registry<Collector>::Add<FancyGC>
- /// X("fancy-gc", "Newfangled garbage collector.");
- ///
- /// Use of this template requires that:
- ///
- /// 1. The registered subclass has a default constructor.
- //
- /// 2. The registry entry type has a constructor compatible with this
- /// signature:
- ///
- /// entry(const char *Name, const char *ShortDesc, T *(*Ctor)());
- ///
- /// If you have more elaborate requirements, then copy and modify.
- ///
- template <typename V>
- class Add {
- entry Entry;
- node Node;
-
- static T *CtorFn() { return new V(); }
-
- public:
- Add(const char *Name, const char *Desc)
- : Entry(Name, Desc, CtorFn), Node(Entry) {}
- };
-
-
- /// A command-line parser for a registry. Use like such:
- ///
- /// static cl::opt<Registry<Collector>::entry, false,
- /// Registry<Collector>::Parser>
- /// GCOpt("gc", cl::desc("Garbage collector to use."),
- /// cl::value_desc());
- ///
- /// To make use of the value:
- ///
- /// Collector *TheCollector = GCOpt->instantiate();
- ///
- class Parser : public cl::parser<const typename U::entry*>, public listener{
- typedef U traits;
- typedef typename U::entry entry;
-
- protected:
- void registered(const entry &E) {
- addLiteralOption(traits::nameof(E), &E, traits::descof(E));
- }
-
- public:
- void initialize(cl::Option &O) {
- listener::init();
- cl::parser<const typename U::entry*>::initialize(O);
- }
- };
-
- };
-
-}
-
-#endif
diff --git a/release_23/include/llvm/Support/SlowOperationInformer.h b/release_23/include/llvm/Support/SlowOperationInformer.h
deleted file mode 100644
index b30aa987523c..000000000000
--- a/release_23/include/llvm/Support/SlowOperationInformer.h
+++ /dev/null
@@ -1,65 +0,0 @@
-//===- llvm/Support/SlowOperationInformer.h - Keep user informed *- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines a simple object which can be used to let the user know what
-// is going on when a slow operation is happening, and gives them the ability to
-// cancel it. Potentially slow operations can stack allocate one of these
-// objects, and periodically call the "progress" method to update the progress
-// bar. If the operation takes more than 1 second to complete, the progress bar
-// is automatically shown and updated. As such, the slow operation should not
-// print stuff to the screen, and should not be confused if an extra line
-// appears on the screen (ie, the cursor should be at the start of the line).
-//
-// If the user presses CTRL-C during the operation, the next invocation of the
-// progress method return true indicating that the operation was cancelled.
-//
-// Because SlowOperationInformers fiddle around with signals, they cannot be
-// nested, and interact poorly with threads. The SIGALRM handler is set back to
-// SIGDFL, but the SIGINT signal handler is restored when the
-// SlowOperationInformer is destroyed.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_SUPPORT_SLOW_OPERATION_INFORMER_H
-#define LLVM_SUPPORT_SLOW_OPERATION_INFORMER_H
-
-#include <string>
-#include <cassert>
-#include "llvm/Support/DataTypes.h"
-
-namespace llvm {
- class SlowOperationInformer {
- std::string OperationName;
- unsigned LastPrintAmount;
-
- SlowOperationInformer(const SlowOperationInformer&); // DO NOT IMPLEMENT
- void operator=(const SlowOperationInformer&); // DO NOT IMPLEMENT
- public:
- SlowOperationInformer(const std::string &Name);
- ~SlowOperationInformer();
-
- /// progress - Clients should periodically call this method when they can
- /// handle cancellation. The Amount variable should indicate how far
- /// along the operation is, given in 1/10ths of a percent (in other words,
- /// Amount should range from 0 to 1000). If the user cancels the operation,
- /// this returns true, false otherwise.
- bool progress(unsigned Amount);
-
- /// progress - Same as the method above, but this performs the division for
- /// you, and helps you avoid overflow if you are dealing with largish
- /// numbers.
- bool progress(unsigned Current, unsigned Maximum) {
- assert(Maximum != 0 &&
- "Shouldn't be doing work if there is nothing to do!");
- return progress(Current*uint64_t(1000UL)/Maximum);
- }
- };
-} // end namespace llvm
-
-#endif /* SLOW_OPERATION_INFORMER_H */
diff --git a/release_23/include/llvm/Support/StableBasicBlockNumbering.h b/release_23/include/llvm/Support/StableBasicBlockNumbering.h
deleted file mode 100644
index 5e0f87e48950..000000000000
--- a/release_23/include/llvm/Support/StableBasicBlockNumbering.h
+++ /dev/null
@@ -1,59 +0,0 @@
-//===- StableBasicBlockNumbering.h - Provide BB identifiers -----*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This class provides a *stable* numbering of basic blocks that does not depend
-// on their address in memory (which is nondeterministic). When requested, this
-// class simply provides a unique ID for each basic block in the function
-// specified and the inverse mapping.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_SUPPORT_STABLEBASICBLOCKNUMBERING_H
-#define LLVM_SUPPORT_STABLEBASICBLOCKNUMBERING_H
-
-#include "llvm/Function.h"
-#include "llvm/ADT/UniqueVector.h"
-
-namespace llvm {
- class StableBasicBlockNumbering {
- // BBNumbering - Holds the numbering.
- UniqueVector<BasicBlock*> BBNumbering;
- public:
- StableBasicBlockNumbering(Function *F = 0) {
- if (F) compute(*F);
- }
-
- /// compute - If we have not computed a numbering for the function yet, do
- /// so.
- void compute(Function &F) {
- if (BBNumbering.empty()) {
- for (Function::iterator I = F.begin(), E = F.end(); I != E; ++I)
- BBNumbering.insert(I);
- }
- }
-
- /// getNumber - Return the ID number for the specified BasicBlock.
- ///
- unsigned getNumber(BasicBlock *BB) const {
- unsigned Idx = BBNumbering.idFor(BB);
- assert(Idx && "Invalid basic block or numbering not computed!");
- return Idx-1;
- }
-
- /// getBlock - Return the BasicBlock corresponding to a particular ID.
- ///
- BasicBlock *getBlock(unsigned N) const {
- assert(N < BBNumbering.size() &&
- "Block ID out of range or numbering not computed!");
- return BBNumbering[N+1];
- }
- };
-}
-
-#endif
diff --git a/release_23/include/llvm/Support/Streams.h b/release_23/include/llvm/Support/Streams.h
deleted file mode 100644
index 46bac8baaf6b..000000000000
--- a/release_23/include/llvm/Support/Streams.h
+++ /dev/null
@@ -1,72 +0,0 @@
-//===- llvm/Support/Streams.h - Wrappers for iostreams ----------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements a wrapper for the STL I/O streams. It prevents the need
-// to include <iostream> in a file just to get I/O.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_SUPPORT_STREAMS_H
-#define LLVM_SUPPORT_STREAMS_H
-
-#include <iosfwd>
-
-namespace llvm {
-
- /// BaseStream - Acts like the STL streams. It's a wrapper for the std::cerr,
- /// std::cout, std::cin, etc. streams. However, it doesn't require #including
- /// @verbatim <iostream> @endverbatm in every file (doing so increases static
- /// c'tors & d'tors in the object code).
- ///
- template <typename StreamTy>
- class BaseStream {
- StreamTy *Stream;
- public:
- BaseStream() : Stream(0) {}
- BaseStream(StreamTy &S) : Stream(&S) {}
- BaseStream(StreamTy *S) : Stream(S) {}
-
- StreamTy *stream() const { return Stream; }
-
- inline BaseStream &operator << (StreamTy &(*Func)(StreamTy&)) {
- if (Stream) *Stream << Func;
- return *this;
- }
-
- template <typename Ty>
- BaseStream &operator << (const Ty &Thing) {
- if (Stream) *Stream << Thing;
- return *this;
- }
-
- template <typename Ty>
- BaseStream &operator >> (Ty &Thing) {
- if (Stream) *Stream >> Thing;
- return *this;
- }
-
- operator StreamTy* () { return Stream; }
-
- bool operator == (const StreamTy &S) { return &S == Stream; }
- bool operator != (const StreamTy &S) { return !(*this == S); }
- bool operator == (const BaseStream &S) { return S.Stream == Stream; }
- bool operator != (const BaseStream &S) { return !(*this == S); }
- };
-
- typedef BaseStream<std::ostream> OStream;
- typedef BaseStream<std::istream> IStream;
- typedef BaseStream<std::stringstream> StringStream;
-
- extern OStream cout;
- extern OStream cerr;
- extern IStream cin;
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/Support/StringPool.h b/release_23/include/llvm/Support/StringPool.h
deleted file mode 100644
index 8661f60e2ef9..000000000000
--- a/release_23/include/llvm/Support/StringPool.h
+++ /dev/null
@@ -1,148 +0,0 @@
-//===-- StringPool.h - Interned string pool -------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file declares an interned string pool, which helps reduce the cost of
-// strings by using the same storage for identical strings.
-//
-// To intern a string:
-//
-// StringPool Pool;
-// PooledStringPtr Str = Pool.intern("wakka wakka");
-//
-// To use the value of an interned string, use operator bool and operator*:
-//
-// if (Str)
-// cerr << "the string is" << *Str << "\n";
-//
-// Pooled strings are immutable, but you can change a PooledStringPtr to point
-// to another instance. So that interned strings can eventually be freed,
-// strings in the string pool are reference-counted (automatically).
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_SUPPORT_STRINGPOOL_H
-#define LLVM_SUPPORT_STRINGPOOL_H
-
-#include "llvm/ADT/StringMap.h"
-#include <new>
-#include <cassert>
-
-namespace llvm {
-
- class PooledStringPtr;
-
- /// StringPool - An interned string pool. Use the intern method to add a
- /// string. Strings are removed automatically as PooledStringPtrs are
- /// destroyed.
- class StringPool {
- /// PooledString - This is the value of an entry in the pool's interning
- /// table.
- struct PooledString {
- StringPool *Pool; ///< So the string can remove itself.
- unsigned Refcount; ///< Number of referencing PooledStringPtrs.
-
- public:
- PooledString() : Pool(0), Refcount(0) { }
- };
-
- friend class PooledStringPtr;
-
- typedef StringMap<PooledString> table_t;
- typedef StringMapEntry<PooledString> entry_t;
- table_t InternTable;
-
- public:
- StringPool();
- ~StringPool();
-
- /// intern - Adds a string to the pool and returns a reference-counted
- /// pointer to it. No additional memory is allocated if the string already
- /// exists in the pool.
- PooledStringPtr intern(const char *Begin, const char *End);
-
- /// intern - Adds a null-terminated string to the pool and returns a
- /// reference-counted pointer to it. No additional memory is allocated if
- /// the string already exists in the pool.
- inline PooledStringPtr intern(const char *Str);
-
- /// empty - Checks whether the pool is empty. Returns true if so.
- ///
- inline bool empty() const { return InternTable.empty(); }
- };
-
- /// PooledStringPtr - A pointer to an interned string. Use operator bool to
- /// test whether the pointer is valid, and operator * to get the string if so.
- /// This is a lightweight value class with storage requirements equivalent to
- /// a single pointer, but it does have reference-counting overhead when
- /// copied.
- class PooledStringPtr {
- typedef StringPool::entry_t entry_t;
- entry_t *S;
-
- public:
- PooledStringPtr() : S(0) {}
-
- explicit PooledStringPtr(entry_t *E) : S(E) {
- if (S) ++S->getValue().Refcount;
- }
-
- PooledStringPtr(const PooledStringPtr &That) : S(That.S) {
- if (S) ++S->getValue().Refcount;
- }
-
- PooledStringPtr &operator=(const PooledStringPtr &That) {
- if (S != That.S) {
- clear();
- S = That.S;
- if (S) ++S->getValue().Refcount;
- }
- return *this;
- }
-
- void clear() {
- if (!S)
- return;
- if (--S->getValue().Refcount == 0) {
- S->getValue().Pool->InternTable.remove(S);
- S->Destroy();
- }
- S = 0;
- }
-
- ~PooledStringPtr() { clear(); }
-
- inline const char *begin() const {
- assert(*this && "Attempt to dereference empty PooledStringPtr!");
- return S->getKeyData();
- }
-
- inline const char *end() const {
- assert(*this && "Attempt to dereference empty PooledStringPtr!");
- return S->getKeyData() + S->getKeyLength();
- }
-
- inline unsigned size() const {
- assert(*this && "Attempt to dereference empty PooledStringPtr!");
- return S->getKeyLength();
- }
-
- inline const char *operator*() const { return begin(); }
- inline operator bool() const { return S != 0; }
-
- inline bool operator==(const PooledStringPtr &That) { return S == That.S; }
- inline bool operator!=(const PooledStringPtr &That) { return S != That.S; }
- };
-
- PooledStringPtr StringPool::intern(const char *Str) {
- return intern(Str, Str + strlen(Str));
- }
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/Support/SystemUtils.h b/release_23/include/llvm/Support/SystemUtils.h
deleted file mode 100644
index 9a33fa31f226..000000000000
--- a/release_23/include/llvm/Support/SystemUtils.h
+++ /dev/null
@@ -1,42 +0,0 @@
-//===- SystemUtils.h - Utilities to do low-level system stuff ---*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains functions used to do a variety of low-level, often
-// system-specific, tasks.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_SUPPORT_SYSTEMUTILS_H
-#define LLVM_SUPPORT_SYSTEMUTILS_H
-
-#include "llvm/System/Program.h"
-
-namespace llvm {
-
-/// Determine if the ostream provided is connected to the std::cout and
-/// displayed or not (to a console window). If so, generate a warning message
-/// advising against display of bitcode and return true. Otherwise just return
-/// false
-/// @brief Check for output written to a console
-bool CheckBitcodeOutputToConsole(
- std::ostream* stream_to_check, ///< The stream to be checked
- bool print_warning = true ///< Control whether warnings are printed
-);
-
-/// FindExecutable - Find a named executable, giving the argv[0] of program
-/// being executed. This allows us to find another LLVM tool if it is built into
-/// the same directory, but that directory is neither the current directory, nor
-/// in the PATH. If the executable cannot be found, return an empty string.
-/// @brief Find a named executable.
-sys::Path FindExecutable(const std::string &ExeName,
- const std::string &ProgramPath);
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/Support/Timer.h b/release_23/include/llvm/Support/Timer.h
deleted file mode 100644
index 569f86314fd8..000000000000
--- a/release_23/include/llvm/Support/Timer.h
+++ /dev/null
@@ -1,165 +0,0 @@
-//===-- llvm/Support/Timer.h - Interval Timing Support ----------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines three classes: Timer, TimeRegion, and TimerGroup,
-// documented below.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_SUPPORT_TIMER_H
-#define LLVM_SUPPORT_TIMER_H
-
-#include "llvm/Support/DataTypes.h"
-#include <string>
-#include <vector>
-#include <iosfwd>
-#include <cassert>
-
-namespace llvm {
-
-class TimerGroup;
-
-/// Timer - This class is used to track the amount of time spent between
-/// invocations of it's startTimer()/stopTimer() methods. Given appropriate OS
-/// support it can also keep track of the RSS of the program at various points.
-/// By default, the Timer will print the amount of time it has captured to
-/// standard error when the laster timer is destroyed, otherwise it is printed
-/// when it's TimerGroup is destroyed. Timer's do not print their information
-/// if they are never started.
-///
-class Timer {
- double Elapsed; // Wall clock time elapsed in seconds
- double UserTime; // User time elapsed
- double SystemTime; // System time elapsed
- ssize_t MemUsed; // Memory allocated (in bytes)
- size_t PeakMem; // Peak memory used
- size_t PeakMemBase; // Temporary for peak calculation...
- std::string Name; // The name of this time variable
- bool Started; // Has this time variable ever been started?
- TimerGroup *TG; // The TimerGroup this Timer is in.
-public:
- Timer(const std::string &N);
- Timer(const std::string &N, TimerGroup &tg);
- Timer(const Timer &T);
- ~Timer();
-
- double getProcessTime() const { return UserTime+SystemTime; }
- double getWallTime() const { return Elapsed; }
- ssize_t getMemUsed() const { return MemUsed; }
- size_t getPeakMem() const { return PeakMem; }
- std::string getName() const { return Name; }
-
- const Timer &operator=(const Timer &T) {
- Elapsed = T.Elapsed;
- UserTime = T.UserTime;
- SystemTime = T.SystemTime;
- MemUsed = T.MemUsed;
- PeakMem = T.PeakMem;
- PeakMemBase = T.PeakMemBase;
- Name = T.Name;
- Started = T.Started;
- assert(TG == T.TG && "Can only assign timers in the same TimerGroup!");
- return *this;
- }
-
- // operator< - Allow sorting...
- bool operator<(const Timer &T) const {
- // Sort by Wall Time elapsed, as it is the only thing really accurate
- return Elapsed < T.Elapsed;
- }
- bool operator>(const Timer &T) const { return T.operator<(*this); }
-
- /// startTimer - Start the timer running. Time between calls to
- /// startTimer/stopTimer is counted by the Timer class. Note that these calls
- /// must be correctly paired.
- ///
- void startTimer();
-
- /// stopTimer - Stop the timer.
- ///
- void stopTimer();
-
- /// addPeakMemoryMeasurement - This method should be called whenever memory
- /// usage needs to be checked. It adds a peak memory measurement to the
- /// currently active timers, which will be printed when the timer group prints
- ///
- static void addPeakMemoryMeasurement();
-
- /// print - Print the current timer to standard error, and reset the "Started"
- /// flag.
- void print(const Timer &Total, std::ostream &OS);
-
-private:
- friend class TimerGroup;
-
- // Copy ctor, initialize with no TG member.
- Timer(bool, const Timer &T);
-
- /// sum - Add the time accumulated in the specified timer into this timer.
- ///
- void sum(const Timer &T);
-};
-
-
-/// The TimeRegion class is used as a helper class to call the startTimer() and
-/// stopTimer() methods of the Timer class. When the object is constructed, it
-/// starts the timer specified as it's argument. When it is destroyed, it stops
-/// the relevant timer. This makes it easy to time a region of code.
-///
-class TimeRegion {
- Timer &T;
- TimeRegion(const TimeRegion &); // DO NOT IMPLEMENT
-public:
- TimeRegion(Timer &t) : T(t) {
- T.startTimer();
- }
- ~TimeRegion() {
- T.stopTimer();
- }
-};
-
-
-/// NamedRegionTimer - This class is basically a combination of TimeRegion and
-/// Timer. It allows you to declare a new timer, AND specify the region to
-/// time, all in one statement. All timers with the same name are merged. This
-/// is primarily used for debugging and for hunting performance problems.
-///
-struct NamedRegionTimer : public TimeRegion {
- NamedRegionTimer(const std::string &Name);
-};
-
-
-/// The TimerGroup class is used to group together related timers into a single
-/// report that is printed when the TimerGroup is destroyed. It is illegal to
-/// destroy a TimerGroup object before all of the Timers in it are gone. A
-/// TimerGroup can be specified for a newly created timer in its constructor.
-///
-class TimerGroup {
- std::string Name;
- unsigned NumTimers;
- std::vector<Timer> TimersToPrint;
-public:
- TimerGroup(const std::string &name) : Name(name), NumTimers(0) {}
- ~TimerGroup() {
- assert(NumTimers == 0 &&
- "TimerGroup destroyed before all contained timers!");
- }
-
-private:
- friend class Timer;
- void addTimer() { ++NumTimers; }
- void removeTimer();
- void addTimerToPrint(const Timer &T) {
- TimersToPrint.push_back(Timer(true, T));
- }
-};
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/Support/type_traits.h b/release_23/include/llvm/Support/type_traits.h
deleted file mode 100644
index 5000a8b859b8..000000000000
--- a/release_23/include/llvm/Support/type_traits.h
+++ /dev/null
@@ -1,54 +0,0 @@
-//===- llvm/Support/type_traits.h - Simplfied type traits -------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file provides a template class that determines if a type is a class or
-// not. The basic mechanism, based on using the pointer to member function of
-// a zero argument to a function was "boosted" from the boost type_traits
-// library. See http://www.boost.org/ for all the gory details.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_SUPPORT_TYPE_TRAITS_H
-#define LLVM_SUPPORT_TYPE_TRAITS_H
-
-// This is actually the conforming implementation which works with abstract
-// classes. However, enough compilers have trouble with it that most will use
-// the one in boost/type_traits/object_traits.hpp. This implementation actually
-// works with VC7.0, but other interactions seem to fail when we use it.
-
-namespace llvm {
-
-namespace dont_use
-{
- // These two functions should never be used. They are helpers to
- // the is_class template below. They cannot be located inside
- // is_class because doing so causes at least GCC to think that
- // the value of the "value" enumerator is not constant. Placing
- // them out here (for some strange reason) allows the sizeof
- // operator against them to magically be constant. This is
- // important to make the is_class<T>::value idiom zero cost. it
- // evaluates to a constant 1 or 0 depending on whether the
- // parameter T is a class or not (respectively).
- template<typename T> char is_class_helper(void(T::*)(void));
- template<typename T> double is_class_helper(...);
-}
-
-template <typename T>
-struct is_class
-{
- // is_class<> metafunction due to Paul Mensonides (leavings@attbi.com). For
- // more details:
- // http://groups.google.com/groups?hl=en&selm=000001c1cc83%24e154d5e0%247772e50c%40c161550a&rnum=1
- public:
- enum { value = sizeof(char) == sizeof(dont_use::is_class_helper<T>(0)) };
-};
-
-}
-
-#endif
diff --git a/release_23/include/llvm/SymbolTableListTraits.h b/release_23/include/llvm/SymbolTableListTraits.h
deleted file mode 100644
index 8166a4eee241..000000000000
--- a/release_23/include/llvm/SymbolTableListTraits.h
+++ /dev/null
@@ -1,76 +0,0 @@
-//===-- llvm/SymbolTableListTraits.h - Traits for iplist --------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines a generic class that is used to implement the automatic
-// symbol table manipulation that occurs when you put (for example) a named
-// instruction into a basic block.
-//
-// The way that this is implemented is by using a special traits class with the
-// intrusive list that makes up the list of instructions in a basic block. When
-// a new element is added to the list of instructions, the traits class is
-// notified, allowing the symbol table to be updated.
-//
-// This generic class implements the traits class. It must be generic so that
-// it can work for all uses it, which include lists of instructions, basic
-// blocks, arguments, functions, global variables, etc...
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_SYMBOLTABLELISTTRAITS_H
-#define LLVM_SYMBOLTABLELISTTRAITS_H
-
-namespace llvm {
-
-template<typename NodeTy> class ilist_iterator;
-template<typename NodeTy, typename Traits> class iplist;
-template<typename Ty> struct ilist_traits;
-
-// ValueSubClass - The type of objects that I hold, e.g. Instruction.
-// ItemParentType - The type of object that owns the list, e.g. BasicBlock.
-// TraitBaseClass - The class this trait should inherit from, it should
-// inherit from ilist_traits<ValueSubClass>
-//
-template<typename ValueSubClass, typename ItemParentClass>
-class SymbolTableListTraits {
- typedef ilist_traits<ValueSubClass> TraitsClass;
-public:
- SymbolTableListTraits() {}
-
- /// getListOwner - Return the object that owns this list. If this is a list
- /// of instructions, it returns the BasicBlock that owns them.
- ItemParentClass *getListOwner() {
- return reinterpret_cast<ItemParentClass*>(reinterpret_cast<char*>(this)-
- TraitsClass::getListOffset());
- }
- static ValueSubClass *getPrev(ValueSubClass *V) { return V->getPrev(); }
- static ValueSubClass *getNext(ValueSubClass *V) { return V->getNext(); }
- static const ValueSubClass *getPrev(const ValueSubClass *V) {
- return V->getPrev();
- }
- static const ValueSubClass *getNext(const ValueSubClass *V) {
- return V->getNext();
- }
-
- static void setPrev(ValueSubClass *V, ValueSubClass *P) { V->setPrev(P); }
- static void setNext(ValueSubClass *V, ValueSubClass *N) { V->setNext(N); }
-
- void addNodeToList(ValueSubClass *V);
- void removeNodeFromList(ValueSubClass *V);
- void transferNodesFromList(iplist<ValueSubClass,
- ilist_traits<ValueSubClass> > &L2,
- ilist_iterator<ValueSubClass> first,
- ilist_iterator<ValueSubClass> last);
-//private:
- template<typename TPtr>
- void setSymTabObject(TPtr *, TPtr);
-};
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/System/Alarm.h b/release_23/include/llvm/System/Alarm.h
deleted file mode 100644
index 718ab8f3bb1a..000000000000
--- a/release_23/include/llvm/System/Alarm.h
+++ /dev/null
@@ -1,45 +0,0 @@
-//===- llvm/System/Alarm.h - Alarm Generation support ----------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file provides an operating system independent interface to alarm(2)
-// type functionality. The Alarm class allows a one-shot alarm to be set up
-// at some number of seconds in the future. When the alarm triggers, a method
-// is called to process the event
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_SYSTEM_ALARM_H
-#define LLVM_SYSTEM_ALARM_H
-
-namespace llvm {
-namespace sys {
-
- /// This function registers an alarm to trigger some number of \p seconds in
- /// the future. When that time arrives, the AlarmStatus function will begin
- /// to return 1 instead of 0. The user must poll the status of the alarm by
- /// making occasional calls to AlarmStatus. If the user sends an interrupt
- /// signal, AlarmStatus will begin returning -1, even if the alarm event
- /// occurred.
- /// @returns nothing
- void SetupAlarm(
- unsigned seconds ///< Number of seconds in future when alarm arrives
- );
-
- /// This function terminates the alarm previously set up
- /// @returns nothing
- void TerminateAlarm();
-
- /// This function acquires the status of the alarm.
- /// @returns -1=cancelled, 0=untriggered, 1=triggered
- int AlarmStatus();
-
-} // End sys namespace
-} // End llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/System/Disassembler.h b/release_23/include/llvm/System/Disassembler.h
deleted file mode 100644
index d1d8a81007e3..000000000000
--- a/release_23/include/llvm/System/Disassembler.h
+++ /dev/null
@@ -1,35 +0,0 @@
-//===- llvm/Support/Disassembler.h ------------------------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the necessary glue to call external disassembler
-// libraries.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_SYSTEM_DISASSEMBLER_H
-#define LLVM_SYSTEM_DISASSEMBLER_H
-
-#include "llvm/Support/DataTypes.h"
-#include <string>
-
-namespace llvm {
-namespace sys {
-
-/// This function returns true, if there is possible to use some external
-/// disassembler library. False otherwise.
-bool hasDisassembler(void);
-
-/// This function provides some "glue" code to call external disassembler
-/// libraries.
-std::string disassembleBuffer(uint8_t* start, size_t length, uint64_t pc = 0);
-
-}
-}
-
-#endif // LLVM_SYSTEM_DISASSEMBLER_H
diff --git a/release_23/include/llvm/System/DynamicLibrary.h b/release_23/include/llvm/System/DynamicLibrary.h
deleted file mode 100644
index 409a9d279c2d..000000000000
--- a/release_23/include/llvm/System/DynamicLibrary.h
+++ /dev/null
@@ -1,98 +0,0 @@
-//===-- llvm/System/DynamicLibrary.h - Portable Dynamic Library -*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file declares the sys::DynamicLibrary class.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_SYSTEM_DYNAMIC_LIBRARY_H
-#define LLVM_SYSTEM_DYNAMIC_LIBRARY_H
-
-#include "llvm/System/Path.h"
-#include <string>
-
-namespace llvm {
-namespace sys {
-
- /// This class provides a portable interface to dynamic libraries which also
- /// might be known as shared libraries, shared objects, dynamic shared
- /// objects, or dynamic link libraries. Regardless of the terminology or the
- /// operating system interface, this class provides a portable interface that
- /// allows dynamic libraries to be loaded and and searched for externally
- /// defined symbols. This is typically used to provide "plug-in" support.
- /// It also allows for symbols to be defined which don't live in any library,
- /// but rather the main program itself, useful on Windows where the main
- /// executable cannot be searched.
- class DynamicLibrary {
- /// @name Constructors
- /// @{
- public:
- /// Construct a DynamicLibrary that represents the currently executing
- /// program. The program must have been linked with -export-dynamic or
- /// -dlopen self for this to work.
- /// @throws std::string indicating why the program couldn't be opened.
- /// @brief Open program as dynamic library.
- DynamicLibrary();
-
- /// After destruction, the symbols of the library will no longer be
- /// available to the program.
- /// @brief Closes the DynamicLibrary
- ~DynamicLibrary();
-
- /// @}
- /// @name Functions
- /// @{
- public:
- /// This function allows a library to be loaded without instantiating a
- /// DynamicLibrary object. Consequently, it is marked as being permanent
- /// and will only be unloaded when the program terminates. This returns
- /// false on success or returns true and fills in *ErrMsg on failure.
- /// @brief Open a dynamic library permanently.
- static bool LoadLibraryPermanently(const char* filename,
- std::string *ErrMsg = 0);
-
- /// This function will search through all previously loaded dynamic
- /// libraries for the symbol \p symbolName. If it is found, the addressof
- /// that symbol is returned. If not, null is returned. Note that this will
- /// search permanently loaded libraries (LoadLibraryPermanently) as well
- /// as ephemerally loaded libraries (constructors).
- /// @throws std::string on error.
- /// @brief Search through libraries for address of a symbol
- static void* SearchForAddressOfSymbol(const char* symbolName);
-
- /// @brief Convenience function for C++ophiles.
- static void* SearchForAddressOfSymbol(const std::string& symbolName) {
- return SearchForAddressOfSymbol(symbolName.c_str());
- }
-
- /// This functions permanently adds the symbol \p symbolName with the
- /// value \p symbolValue. These symbols are searched before any
- /// libraries.
- /// @brief Add searchable symbol/value pair.
- static void AddSymbol(const char* symbolName, void *symbolValue);
-
- /// @brief Convenience function for C++ophiles.
- static void AddSymbol(const std::string& symbolName, void *symbolValue) {
- AddSymbol(symbolName.c_str(), symbolValue);
- }
-
- /// @}
- /// @name Implementation
- /// @{
- protected:
- void* handle; // Opaque handle for information about the library
- DynamicLibrary(const DynamicLibrary&); ///< Do not implement
- DynamicLibrary& operator=(const DynamicLibrary&); ///< Do not implement
- /// @}
- };
-
-} // End sys namespace
-} // End llvm namespace
-
-#endif // LLVM_SYSTEM_DYNAMIC_LIBRARY_H
diff --git a/release_23/include/llvm/System/Host.h b/release_23/include/llvm/System/Host.h
deleted file mode 100644
index 5e4cc1b62bf1..000000000000
--- a/release_23/include/llvm/System/Host.h
+++ /dev/null
@@ -1,36 +0,0 @@
-//===- llvm/System/Host.h - Host machine characteristics --------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// Methods for querying the nature of the host machine.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_SYSTEM_HOST_H
-#define LLVM_SYSTEM_HOST_H
-
-namespace llvm {
-namespace sys {
-
- inline bool littleEndianHost() {
- union {
- int i;
- char c;
- };
- i = 1;
- return c;
- }
-
- inline bool bigEndianHost() {
- return !littleEndianHost();
- }
-
-}
-}
-
-#endif
diff --git a/release_23/include/llvm/System/IncludeFile.h b/release_23/include/llvm/System/IncludeFile.h
deleted file mode 100644
index 6103e44e4cfc..000000000000
--- a/release_23/include/llvm/System/IncludeFile.h
+++ /dev/null
@@ -1,78 +0,0 @@
-//===- llvm/System/IncludeFile.h - Ensure Linking Of Library ---*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines the FORCE_DEFINING_FILE_TO_BE_LINKED and DEFINE_FILE_FOR
-// macros.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_SYSTEM_INCLUDEFILE_H
-#define LLVM_SYSTEM_INCLUDEFILE_H
-
-/// This macro is the public interface that IncludeFile.h exports. This gives
-/// us the option to implement the "link the definition" capability in any
-/// manner that we choose. All header files that depend on a specific .cpp
-/// file being linked at run time should use this macro instead of the
-/// IncludeFile class directly.
-///
-/// For example, foo.h would use:<br/>
-/// <tt>FORCE_DEFINING_FILE_TO_BE_LINKED(foo)</tt><br/>
-///
-/// And, foo.cp would use:<br/>
-/// <tt>DEFINING_FILE_FOR(foo)</tt><br/>
-#ifdef __GNUC__
-// If the `used' attribute is available, use it to create a variable
-// with an initializer that will force the linking of the defining file.
-#define FORCE_DEFINING_FILE_TO_BE_LINKED(name) \
- namespace llvm { \
- extern const char name ## LinkVar; \
- __attribute__((used)) static const char *const name ## LinkObj = \
- &name ## LinkVar; \
- }
-#else
-// Otherwise use a constructor call.
-#define FORCE_DEFINING_FILE_TO_BE_LINKED(name) \
- namespace llvm { \
- extern const char name ## LinkVar; \
- static const IncludeFile name ## LinkObj ( &name ## LinkVar ); \
- }
-#endif
-
-/// This macro is the counterpart to FORCE_DEFINING_FILE_TO_BE_LINKED. It should
-/// be used in a .cpp file to define the name referenced in a header file that
-/// will cause linkage of the .cpp file. It should only be used at extern level.
-#define DEFINING_FILE_FOR(name) \
- namespace llvm { const char name ## LinkVar = 0; }
-
-namespace llvm {
-
-/// This class is used in the implementation of FORCE_DEFINING_FILE_TO_BE_LINKED
-/// macro to make sure that the implementation of a header file is included
-/// into a tool that uses the header. This is solely
-/// to overcome problems linking .a files and not getting the implementation
-/// of compilation units we need. This is commonly an issue with the various
-/// Passes but also occurs elsewhere in LLVM. We like to use .a files because
-/// they link faster and provide the smallest executables. However, sometimes
-/// those executables are too small, if the program doesn't reference something
-/// that might be needed, especially by a loaded share object. This little class
-/// helps to resolve that problem. The basic strategy is to use this class in
-/// a header file and pass the address of a variable to the constructor. If the
-/// variable is defined in the header file's corresponding .cpp file then all
-/// tools/libraries that #include the header file will require the .cpp as well.
-/// For example:<br/>
-/// <tt>extern int LinkMyCodeStub;</tt><br/>
-/// <tt>static IncludeFile LinkMyModule(&LinkMyCodeStub);</tt><br/>
-/// @brief Class to ensure linking of corresponding object file.
-struct IncludeFile {
- explicit IncludeFile(const void *);
-};
-
-}
-
-#endif
diff --git a/release_23/include/llvm/System/LICENSE.TXT b/release_23/include/llvm/System/LICENSE.TXT
deleted file mode 100644
index f569da205289..000000000000
--- a/release_23/include/llvm/System/LICENSE.TXT
+++ /dev/null
@@ -1,6 +0,0 @@
-LLVM System Interface Library
--------------------------------------------------------------------------------
-The LLVM System Interface Library is licensed under the Illinois Open Source
-License and has the following additional copyright:
-
-Copyright (C) 2004 eXtensible Systems, Inc.
diff --git a/release_23/include/llvm/System/Memory.h b/release_23/include/llvm/System/Memory.h
deleted file mode 100644
index 52e1f3f14b7e..000000000000
--- a/release_23/include/llvm/System/Memory.h
+++ /dev/null
@@ -1,73 +0,0 @@
-//===- llvm/System/Memory.h - Memory Support --------------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file declares the llvm::sys::Memory class.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_SYSTEM_MEMORY_H
-#define LLVM_SYSTEM_MEMORY_H
-
-#include <string>
-
-namespace llvm {
-namespace sys {
-
- /// This class encapsulates the notion of a memory block which has an address
- /// and a size. It is used by the Memory class (a friend) as the result of
- /// various memory allocation operations.
- /// @see Memory
- /// @brief Memory block abstraction.
- class MemoryBlock {
- public:
- void *base() const { return Address; }
- unsigned size() const { return Size; }
- private:
- void *Address; ///< Address of first byte of memory area
- unsigned Size; ///< Size, in bytes of the memory area
- friend class Memory;
- };
-
- /// This class provides various memory handling functions that manipulate
- /// MemoryBlock instances.
- /// @since 1.4
- /// @brief An abstraction for memory operations.
- class Memory {
- /// @name Functions
- /// @{
- public:
- /// This method allocates a block of Read/Write/Execute memory that is
- /// suitable for executing dynamically generated code (e.g. JIT). An
- /// attempt to allocate \p NumBytes bytes of virtual memory is made.
- /// \p NearBlock may point to an existing allocation in which case
- /// an attempt is made to allocate more memory near the existing block.
- ///
- /// On success, this returns a non-null memory block, otherwise it returns
- /// a null memory block and fills in *ErrMsg.
- ///
- /// @brief Allocate Read/Write/Execute memory.
- static MemoryBlock AllocateRWX(unsigned NumBytes,
- const MemoryBlock *NearBlock,
- std::string *ErrMsg = 0);
-
- /// This method releases a block of Read/Write/Execute memory that was
- /// allocated with the AllocateRWX method. It should not be used to
- /// release any memory block allocated any other way.
- ///
- /// On success, this returns false, otherwise it returns true and fills
- /// in *ErrMsg.
- /// @throws std::string if an error occurred.
- /// @brief Release Read/Write/Execute memory.
- static bool ReleaseRWX(MemoryBlock &block, std::string *ErrMsg = 0);
- /// @}
- };
-}
-}
-
-#endif
diff --git a/release_23/include/llvm/System/Mutex.h b/release_23/include/llvm/System/Mutex.h
deleted file mode 100644
index e6d98cb271a2..000000000000
--- a/release_23/include/llvm/System/Mutex.h
+++ /dev/null
@@ -1,84 +0,0 @@
-//===- llvm/System/Mutex.h - Mutex Operating System Concept -----*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file declares the llvm::sys::Mutex class.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_SYSTEM_MUTEX_H
-#define LLVM_SYSTEM_MUTEX_H
-
-namespace llvm
-{
- namespace sys
- {
- /// @brief Platform agnostic Mutex class.
- class Mutex
- {
- /// @name Constructors
- /// @{
- public:
-
- /// Initializes the lock but doesn't acquire it. if \p recursive is set
- /// to false, the lock will not be recursive which makes it cheaper but
- /// also more likely to deadlock (same thread can't acquire more than
- /// once).
- /// @brief Default Constructor.
- Mutex ( bool recursive = true );
-
- /// Releases and removes the lock
- /// @brief Destructor
- ~Mutex ( void );
-
- /// @}
- /// @name Methods
- /// @{
- public:
-
- /// Attempts to unconditionally acquire the lock. If the lock is held by
- /// another thread, this method will wait until it can acquire the lock.
- /// @returns false if any kind of error occurs, true otherwise.
- /// @brief Unconditionally acquire the lock.
- bool acquire();
-
- /// Attempts to release the lock. If the lock is held by the current
- /// thread, the lock is released allowing other threads to acquire the
- /// lock.
- /// @returns false if any kind of error occurs, true otherwise.
- /// @brief Unconditionally release the lock.
- bool release(void);
-
- /// Attempts to acquire the lock without blocking. If the lock is not
- /// available, this function returns false quickly (without blocking). If
- /// the lock is available, it is acquired.
- /// @returns false if any kind of error occurs or the lock is not
- /// available, true otherwise.
- /// @brief Try to acquire the lock.
- bool tryacquire();
-
- //@}
- /// @name Platform Dependent Data
- /// @{
- private:
-#ifdef ENABLE_THREADS
- void* data_; ///< We don't know what the data will be
-#endif
-
- /// @}
- /// @name Do Not Implement
- /// @{
- private:
- Mutex(const Mutex & original);
- void operator=(const Mutex &);
- /// @}
- };
- }
-}
-
-#endif
diff --git a/release_23/include/llvm/System/Path.h b/release_23/include/llvm/System/Path.h
deleted file mode 100644
index 37c42aa366c8..000000000000
--- a/release_23/include/llvm/System/Path.h
+++ /dev/null
@@ -1,718 +0,0 @@
-//===- llvm/System/Path.h - Path Operating System Concept -------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file declares the llvm::sys::Path class.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_SYSTEM_PATH_H
-#define LLVM_SYSTEM_PATH_H
-
-#include "llvm/System/TimeValue.h"
-#include <set>
-#include <string>
-#include <vector>
-#include <iosfwd>
-
-namespace llvm {
-namespace sys {
-
- /// This structure provides basic file system information about a file. It
- /// is patterned after the stat(2) Unix operating system call but made
- /// platform independent and eliminates many of the unix-specific fields.
- /// However, to support llvm-ar, the mode, user, and group fields are
- /// retained. These pertain to unix security and may not have a meaningful
- /// value on non-Unix platforms. However, the other fields fields should
- /// always be applicable on all platforms. The structure is filled in by
- /// the PathWithStatus class.
- /// @brief File status structure
- class FileStatus {
- public:
- uint64_t fileSize; ///< Size of the file in bytes
- TimeValue modTime; ///< Time of file's modification
- uint32_t mode; ///< Mode of the file, if applicable
- uint32_t user; ///< User ID of owner, if applicable
- uint32_t group; ///< Group ID of owner, if applicable
- uint64_t uniqueID; ///< A number to uniquely ID this file
- bool isDir : 1; ///< True if this is a directory.
- bool isFile : 1; ///< True if this is a file.
-
- FileStatus() : fileSize(0), modTime(0,0), mode(0777), user(999),
- group(999), uniqueID(0), isDir(false), isFile(false) { }
-
- TimeValue getTimestamp() const { return modTime; }
- uint64_t getSize() const { return fileSize; }
- uint32_t getMode() const { return mode; }
- uint32_t getUser() const { return user; }
- uint32_t getGroup() const { return group; }
- uint64_t getUniqueID() const { return uniqueID; }
- };
-
- /// This class provides an abstraction for the path to a file or directory
- /// in the operating system's filesystem and provides various basic operations
- /// on it. Note that this class only represents the name of a path to a file
- /// or directory which may or may not be valid for a given machine's file
- /// system. The class is patterned after the java.io.File class with various
- /// extensions and several omissions (not relevant to LLVM). A Path object
- /// ensures that the path it encapsulates is syntactically valid for the
- /// operating system it is running on but does not ensure correctness for
- /// any particular file system. That is, a syntactically valid path might
- /// specify path components that do not exist in the file system and using
- /// such a Path to act on the file system could produce errors. There is one
- /// invalid Path value which is permitted: the empty path. The class should
- /// never allow a syntactically invalid non-empty path name to be assigned.
- /// Empty paths are required in order to indicate an error result in some
- /// situations. If the path is empty, the isValid operation will return
- /// false. All operations will fail if isValid is false. Operations that
- /// change the path will either return false if it would cause a syntactically
- /// invalid path name (in which case the Path object is left unchanged) or
- /// throw an std::string exception indicating the error. The methods are
- /// grouped into four basic categories: Path Accessors (provide information
- /// about the path without accessing disk), Disk Accessors (provide
- /// information about the underlying file or directory), Path Mutators
- /// (change the path information, not the disk), and Disk Mutators (change
- /// the disk file/directory referenced by the path). The Disk Mutator methods
- /// all have the word "disk" embedded in their method name to reinforce the
- /// notion that the operation modifies the file system.
- /// @since 1.4
- /// @brief An abstraction for operating system paths.
- class Path {
- /// @name Constructors
- /// @{
- public:
- /// Construct a path to the root directory of the file system. The root
- /// directory is a top level directory above which there are no more
- /// directories. For example, on UNIX, the root directory is /. On Windows
- /// it is C:\. Other operating systems may have different notions of
- /// what the root directory is or none at all. In that case, a consistent
- /// default root directory will be used.
- static Path GetRootDirectory();
-
- /// Construct a path to a unique temporary directory that is created in
- /// a "standard" place for the operating system. The directory is
- /// guaranteed to be created on exit from this function. If the directory
- /// cannot be created, the function will throw an exception.
- /// @returns an invalid path (empty) on error
- /// @param ErrMsg Optional place for an error message if an error occurs
- /// @brief Constrct a path to an new, unique, existing temporary
- /// directory.
- static Path GetTemporaryDirectory(std::string* ErrMsg = 0);
-
- /// Construct a vector of sys::Path that contains the "standard" system
- /// library paths suitable for linking into programs. This function *must*
- /// return the value of LLVM_LIB_SEARCH_PATH as the first item in \p Paths
- /// if that environment variable is set and it references a directory.
- /// @brief Construct a path to the system library directory
- static void GetSystemLibraryPaths(std::vector<sys::Path>& Paths);
-
- /// Construct a vector of sys::Path that contains the "standard" bitcode
- /// library paths suitable for linking into an llvm program. This function
- /// *must* return the value of LLVM_LIB_SEARCH_PATH as well as the value
- /// of LLVM_LIBDIR. It also must provide the System library paths as
- /// returned by GetSystemLibraryPaths.
- /// @see GetSystemLibraryPaths
- /// @brief Construct a list of directories in which bitcode could be
- /// found.
- static void GetBitcodeLibraryPaths(std::vector<sys::Path>& Paths);
-
- /// Find the path to a library using its short name. Use the system
- /// dependent library paths to locate the library.
- /// @brief Find a library.
- static Path FindLibrary(std::string& short_name);
-
- /// Construct a path to the default LLVM configuration directory. The
- /// implementation must ensure that this is a well-known (same on many
- /// systems) directory in which llvm configuration files exist. For
- /// example, on Unix, the /etc/llvm directory has been selected.
- /// @brief Construct a path to the default LLVM configuration directory
- static Path GetLLVMDefaultConfigDir();
-
- /// Construct a path to the LLVM installed configuration directory. The
- /// implementation must ensure that this refers to the "etc" directory of
- /// the LLVM installation. This is the location where configuration files
- /// will be located for a particular installation of LLVM on a machine.
- /// @brief Construct a path to the LLVM installed configuration directory
- static Path GetLLVMConfigDir();
-
- /// Construct a path to the current user's home directory. The
- /// implementation must use an operating system specific mechanism for
- /// determining the user's home directory. For example, the environment
- /// variable "HOME" could be used on Unix. If a given operating system
- /// does not have the concept of a user's home directory, this static
- /// constructor must provide the same result as GetRootDirectory.
- /// @brief Construct a path to the current user's "home" directory
- static Path GetUserHomeDirectory();
-
- /// Construct a path to the current directory for the current process.
- /// @returns The current working directory.
- /// @brief Returns the current working directory.
- static Path GetCurrentDirectory();
-
- /// Return the suffix commonly used on file names that contain a shared
- /// object, shared archive, or dynamic link library. Such files are
- /// linked at runtime into a process and their code images are shared
- /// between processes.
- /// @returns The dynamic link library suffix for the current platform.
- /// @brief Return the dynamic link library suffix.
- static std::string GetDLLSuffix();
-
- /// GetMainExecutable - Return the path to the main executable, given the
- /// value of argv[0] from program startup and the address of main itself.
- static Path GetMainExecutable(const char *argv0, void *MainAddr);
-
- /// This is one of the very few ways in which a path can be constructed
- /// with a syntactically invalid name. The only *legal* invalid name is an
- /// empty one. Other invalid names are not permitted. Empty paths are
- /// provided so that they can be used to indicate null or error results in
- /// other lib/System functionality.
- /// @brief Construct an empty (and invalid) path.
- Path() : path() {}
- Path(const Path &that) : path(that.path) {}
-
- /// This constructor will accept a std::string as a path. No checking is
- /// done on this path to determine if it is valid. To determine validity
- /// of the path, use the isValid method.
- /// @param p The path to assign.
- /// @brief Construct a Path from a string.
- explicit Path(const std::string& p) : path(p) {}
-
- /// This constructor will accept a character range as a path. No checking
- /// is done on this path to determine if it is valid. To determine
- /// validity of the path, use the isValid method.
- /// @param StrStart A pointer to the first character of the path name
- /// @param StrLen The length of the path name at StrStart
- /// @brief Construct a Path from a string.
- explicit Path(const char *StrStart, unsigned StrLen)
- : path(StrStart, StrStart+StrLen) {}
-
- /// @}
- /// @name Operators
- /// @{
- public:
- /// Makes a copy of \p that to \p this.
- /// @returns \p this
- /// @brief Assignment Operator
- Path &operator=(const Path &that) {
- path = that.path;
- return *this;
- }
-
- /// Compares \p this Path with \p that Path for equality.
- /// @returns true if \p this and \p that refer to the same thing.
- /// @brief Equality Operator
- bool operator==(const Path &that) const {
- return path == that.path;
- }
-
- /// Compares \p this Path with \p that Path for inequality.
- /// @returns true if \p this and \p that refer to different things.
- /// @brief Inequality Operator
- bool operator!=(const Path &that) const {
- return path != that.path;
- }
-
- /// Determines if \p this Path is less than \p that Path. This is required
- /// so that Path objects can be placed into ordered collections (e.g.
- /// std::map). The comparison is done lexicographically as defined by
- /// the std::string::compare method.
- /// @returns true if \p this path is lexicographically less than \p that.
- /// @brief Less Than Operator
- bool operator<(const Path& that) const {
- return path < that.path;
- }
-
- /// @}
- /// @name Path Accessors
- /// @{
- public:
- /// This function will use an operating system specific algorithm to
- /// determine if the current value of \p this is a syntactically valid
- /// path name for the operating system. The path name does not need to
- /// exist, validity is simply syntactical. Empty paths are always invalid.
- /// @returns true iff the path name is syntactically legal for the
- /// host operating system.
- /// @brief Determine if a path is syntactically valid or not.
- bool isValid() const;
-
- /// This function determines if the contents of the path name are empty.
- /// That is, the path name has a zero length. This does NOT determine if
- /// if the file is empty. To get the length of the file itself, Use the
- /// PathWithStatus::getFileStatus() method and then the getSize() method
- /// on the returned FileStatus object.
- /// @returns true iff the path is empty.
- /// @brief Determines if the path name is empty (invalid).
- bool isEmpty() const { return path.empty(); }
-
- /// This function returns the current contents of the path as a
- /// std::string. This allows the underlying path string to be manipulated.
- /// @returns std::string containing the path name.
- /// @brief Returns the path as a std::string.
- const std::string &toString() const { return path; }
-
- /// This function returns the last component of the path name. The last
- /// component is the file or directory name occuring after the last
- /// directory separator. If no directory separator is present, the entire
- /// path name is returned (i.e. same as toString).
- /// @returns std::string containing the last component of the path name.
- /// @brief Returns the last component of the path name.
- std::string getLast() const;
-
- /// This function strips off the path and suffix of the file or directory
- /// name and returns just the basename. For example /a/foo.bar would cause
- /// this function to return "foo".
- /// @returns std::string containing the basename of the path
- /// @brief Get the base name of the path
- std::string getBasename() const;
-
- /// This function strips off the suffix of the path beginning with the
- /// path separator ('/' on Unix, '\' on Windows) and returns the result.
- std::string getDirname() const;
-
- /// This function strips off the path and basename(up to and
- /// including the last dot) of the file or directory name and
- /// returns just the suffix. For example /a/foo.bar would cause
- /// this function to return "bar".
- /// @returns std::string containing the suffix of the path
- /// @brief Get the suffix of the path
- std::string getSuffix() const;
-
- /// Obtain a 'C' string for the path name.
- /// @returns a 'C' string containing the path name.
- /// @brief Returns the path as a C string.
- const char *c_str() const { return path.c_str(); }
-
- /// size - Return the length in bytes of this path name.
- size_t size() const { return path.size(); }
-
- /// empty - Returns true if the path is empty.
- unsigned empty() const { return path.empty(); }
-
- /// @}
- /// @name Disk Accessors
- /// @{
- public:
- /// This function determines if the path name in this object references
- /// the root (top level directory) of the file system. The details of what
- /// is considered the "root" may vary from system to system so this method
- /// will do the necessary checking.
- /// @returns true iff the path name references the root directory.
- /// @brief Determines if the path references the root directory.
- bool isRootDirectory() const;
-
- /// This function determines if the path name is absolute, as opposed to
- /// relative.
- /// @brief Determine if the path is absolute.
- bool isAbsolute() const;
-
- /// This function opens the file associated with the path name provided by
- /// the Path object and reads its magic number. If the magic number at the
- /// start of the file matches \p magic, true is returned. In all other
- /// cases (file not found, file not accessible, etc.) it returns false.
- /// @returns true if the magic number of the file matches \p magic.
- /// @brief Determine if file has a specific magic number
- bool hasMagicNumber(const std::string& magic) const;
-
- /// This function retrieves the first \p len bytes of the file associated
- /// with \p this. These bytes are returned as the "magic number" in the
- /// \p Magic parameter.
- /// @returns true if the Path is a file and the magic number is retrieved,
- /// false otherwise.
- /// @brief Get the file's magic number.
- bool getMagicNumber(std::string& Magic, unsigned len) const;
-
- /// This function determines if the path name in the object references an
- /// archive file by looking at its magic number.
- /// @returns true if the file starts with the magic number for an archive
- /// file.
- /// @brief Determine if the path references an archive file.
- bool isArchive() const;
-
- /// This function determines if the path name in the object references an
- /// LLVM Bitcode file by looking at its magic number.
- /// @returns true if the file starts with the magic number for LLVM
- /// bitcode files.
- /// @brief Determine if the path references a bitcode file.
- bool isBitcodeFile() const;
-
- /// This function determines if the path name in the object references a
- /// native Dynamic Library (shared library, shared object) by looking at
- /// the file's magic number. The Path object must reference a file, not a
- /// directory.
- /// @return strue if the file starts with the magid number for a native
- /// shared library.
- /// @brief Determine if the path reference a dynamic library.
- bool isDynamicLibrary() const;
-
- /// This function determines if the path name references an existing file
- /// or directory in the file system.
- /// @returns true if the pathname references an existing file or
- /// directory.
- /// @brief Determines if the path is a file or directory in
- /// the file system.
- bool exists() const;
-
- /// This function determines if the path name refences an
- /// existing directory.
- /// @returns true if the pathname references an existing directory.
- /// @brief Determins if the path is a directory in the file system.
- bool isDirectory() const;
-
- /// This function determines if the path name references a readable file
- /// or directory in the file system. This function checks for
- /// the existence and readability (by the current program) of the file
- /// or directory.
- /// @returns true if the pathname references a readable file.
- /// @brief Determines if the path is a readable file or directory
- /// in the file system.
- bool canRead() const;
-
- /// This function determines if the path name references a writable file
- /// or directory in the file system. This function checks for the
- /// existence and writability (by the current program) of the file or
- /// directory.
- /// @returns true if the pathname references a writable file.
- /// @brief Determines if the path is a writable file or directory
- /// in the file system.
- bool canWrite() const;
-
- /// This function determines if the path name references an executable
- /// file in the file system. This function checks for the existence and
- /// executability (by the current program) of the file.
- /// @returns true if the pathname references an executable file.
- /// @brief Determines if the path is an executable file in the file
- /// system.
- bool canExecute() const;
-
- /// This function builds a list of paths that are the names of the
- /// files and directories in a directory.
- /// @returns true if an error occurs, true otherwise
- /// @brief Build a list of directory's contents.
- bool getDirectoryContents(
- std::set<Path> &paths, ///< The resulting list of file & directory names
- std::string* ErrMsg ///< Optional place to return an error message.
- ) const;
-
- /// @}
- /// @name Path Mutators
- /// @{
- public:
- /// The path name is cleared and becomes empty. This is an invalid
- /// path name but is the *only* invalid path name. This is provided
- /// so that path objects can be used to indicate the lack of a
- /// valid path being found.
- /// @brief Make the path empty.
- void clear() { path.clear(); }
-
- /// This method sets the Path object to \p unverified_path. This can fail
- /// if the \p unverified_path does not pass the syntactic checks of the
- /// isValid() method. If verification fails, the Path object remains
- /// unchanged and false is returned. Otherwise true is returned and the
- /// Path object takes on the path value of \p unverified_path
- /// @returns true if the path was set, false otherwise.
- /// @param unverified_path The path to be set in Path object.
- /// @brief Set a full path from a std::string
- bool set(const std::string& unverified_path);
-
- /// One path component is removed from the Path. If only one component is
- /// present in the path, the Path object becomes empty. If the Path object
- /// is empty, no change is made.
- /// @returns false if the path component could not be removed.
- /// @brief Removes the last directory component of the Path.
- bool eraseComponent();
-
- /// The \p component is added to the end of the Path if it is a legal
- /// name for the operating system. A directory separator will be added if
- /// needed.
- /// @returns false if the path component could not be added.
- /// @brief Appends one path component to the Path.
- bool appendComponent( const std::string& component );
-
- /// A period and the \p suffix are appended to the end of the pathname.
- /// The precondition for this function is that the Path reference a file
- /// name (i.e. isFile() returns true). If the Path is not a file, no
- /// action is taken and the function returns false. If the path would
- /// become invalid for the host operating system, false is returned.
- /// @returns false if the suffix could not be added, true if it was.
- /// @brief Adds a period and the \p suffix to the end of the pathname.
- bool appendSuffix(const std::string& suffix);
-
- /// The suffix of the filename is erased. The suffix begins with and
- /// includes the last . character in the filename after the last directory
- /// separator and extends until the end of the name. If no . character is
- /// after the last directory separator, then the file name is left
- /// unchanged (i.e. it was already without a suffix) but the function
- /// returns false.
- /// @returns false if there was no suffix to remove, true otherwise.
- /// @brief Remove the suffix from a path name.
- bool eraseSuffix();
-
- /// The current Path name is made unique in the file system. Upon return,
- /// the Path will have been changed to make a unique file in the file
- /// system or it will not have been changed if the current path name is
- /// already unique.
- /// @throws std::string if an unrecoverable error occurs.
- /// @brief Make the current path name unique in the file system.
- bool makeUnique( bool reuse_current /*= true*/, std::string* ErrMsg );
-
- /// @}
- /// @name Disk Mutators
- /// @{
- public:
- /// This method attempts to make the file referenced by the Path object
- /// available for reading so that the canRead() method will return true.
- /// @brief Make the file readable;
- bool makeReadableOnDisk(std::string* ErrMsg = 0);
-
- /// This method attempts to make the file referenced by the Path object
- /// available for writing so that the canWrite() method will return true.
- /// @brief Make the file writable;
- bool makeWriteableOnDisk(std::string* ErrMsg = 0);
-
- /// This method attempts to make the file referenced by the Path object
- /// available for execution so that the canExecute() method will return
- /// true.
- /// @brief Make the file readable;
- bool makeExecutableOnDisk(std::string* ErrMsg = 0);
-
- /// This method allows the last modified time stamp and permission bits
- /// to be set on the disk object referenced by the Path.
- /// @throws std::string if an error occurs.
- /// @returns true on error.
- /// @brief Set the status information.
- bool setStatusInfoOnDisk(const FileStatus &SI,
- std::string *ErrStr = 0) const;
-
- /// This method attempts to create a directory in the file system with the
- /// same name as the Path object. The \p create_parents parameter controls
- /// whether intermediate directories are created or not. if \p
- /// create_parents is true, then an attempt will be made to create all
- /// intermediate directories, as needed. If \p create_parents is false,
- /// then only the final directory component of the Path name will be
- /// created. The created directory will have no entries.
- /// @returns true if the directory could not be created, false otherwise
- /// @brief Create the directory this Path refers to.
- bool createDirectoryOnDisk(
- bool create_parents = false, ///< Determines whether non-existent
- ///< directory components other than the last one (the "parents")
- ///< are created or not.
- std::string* ErrMsg = 0 ///< Optional place to put error messages.
- );
-
- /// This method attempts to create a file in the file system with the same
- /// name as the Path object. The intermediate directories must all exist
- /// at the time this method is called. Use createDirectoriesOnDisk to
- /// accomplish that. The created file will be empty upon return from this
- /// function.
- /// @returns true if the file could not be created, false otherwise.
- /// @brief Create the file this Path refers to.
- bool createFileOnDisk(
- std::string* ErrMsg = 0 ///< Optional place to put error messages.
- );
-
- /// This is like createFile except that it creates a temporary file. A
- /// unique temporary file name is generated based on the contents of
- /// \p this before the call. The new name is assigned to \p this and the
- /// file is created. Note that this will both change the Path object
- /// *and* create the corresponding file. This function will ensure that
- /// the newly generated temporary file name is unique in the file system.
- /// @returns true if the file couldn't be created, false otherwise.
- /// @brief Create a unique temporary file
- bool createTemporaryFileOnDisk(
- bool reuse_current = false, ///< When set to true, this parameter
- ///< indicates that if the current file name does not exist then
- ///< it will be used without modification.
- std::string* ErrMsg = 0 ///< Optional place to put error messages
- );
-
- /// This method renames the file referenced by \p this as \p newName. The
- /// file referenced by \p this must exist. The file referenced by
- /// \p newName does not need to exist.
- /// @returns true on error, false otherwise
- /// @brief Rename one file as another.
- bool renamePathOnDisk(const Path& newName, std::string* ErrMsg);
-
- /// This method attempts to destroy the file or directory named by the
- /// last component of the Path. If the Path refers to a directory and the
- /// \p destroy_contents is false, an attempt will be made to remove just
- /// the directory (the final Path component). If \p destroy_contents is
- /// true, an attempt will be made to remove the entire contents of the
- /// directory, recursively. If the Path refers to a file, the
- /// \p destroy_contents parameter is ignored.
- /// @param destroy_contents Indicates whether the contents of a destroyed
- /// @param Err An optional string to receive an error message.
- /// directory should also be destroyed (recursively).
- /// @returns false if the file/directory was destroyed, true on error.
- /// @brief Removes the file or directory from the filesystem.
- bool eraseFromDisk(bool destroy_contents = false,
- std::string *Err = 0) const;
-
-
- /// MapInFilePages - This is a low level system API to map in the file
- /// that is currently opened as FD into the current processes' address
- /// space for read only access. This function may return null on failure
- /// or if the system cannot provide the following constraints:
- /// 1) The pages must be valid after the FD is closed, until
- /// UnMapFilePages is called.
- /// 2) Any padding after the end of the file must be zero filled, if
- /// present.
- /// 3) The pages must be contiguous.
- ///
- /// This API is not intended for general use, clients should use
- /// MemoryBuffer::getFile instead.
- static const char *MapInFilePages(int FD, uint64_t FileSize);
-
- /// UnMapFilePages - Free pages mapped into the current process by
- /// MapInFilePages.
- ///
- /// This API is not intended for general use, clients should use
- /// MemoryBuffer::getFile instead.
- static void UnMapFilePages(const char *Base, uint64_t FileSize);
-
- /// @}
- /// @name Data
- /// @{
- protected:
- mutable std::string path; ///< Storage for the path name.
-
-
- /// @}
- };
-
- /// This class is identical to Path class except it allows you to obtain the
- /// file status of the Path as well. The reason for the distinction is one of
- /// efficiency. First, the file status requires additional space and the space
- /// is incorporated directly into PathWithStatus without an additional malloc.
- /// Second, obtaining status information is an expensive operation on most
- /// operating systems so we want to be careful and explicity about where we
- /// allow this operation in LLVM.
- /// @brief Path with file status class.
- class PathWithStatus : public Path {
- /// @name Constructors
- /// @{
- public:
- /// @brief Default constructor
- PathWithStatus() : Path(), status(), fsIsValid(false) {}
-
- /// @brief Copy constructor
- PathWithStatus(const PathWithStatus &that)
- : Path(static_cast<const Path&>(that)), status(that.status),
- fsIsValid(that.fsIsValid) {}
-
- /// This constructor allows construction from a Path object
- /// @brief Path constructor
- PathWithStatus(const Path &other)
- : Path(other), status(), fsIsValid(false) {}
-
- /// This constructor will accept a std::string as a path. No checking is
- /// done on this path to determine if it is valid. To determine validity
- /// of the path, use the isValid method.
- /// @brief Construct a Path from a string.
- explicit PathWithStatus(
- const std::string& p ///< The path to assign.
- ) : Path(p), status(), fsIsValid(false) {}
-
- /// This constructor will accept a character range as a path. No checking
- /// is done on this path to determine if it is valid. To determine
- /// validity of the path, use the isValid method.
- /// @brief Construct a Path from a string.
- explicit PathWithStatus(
- const char *StrStart, ///< Pointer to the first character of the path
- unsigned StrLen ///< Length of the path.
- ) : Path(StrStart, StrLen), status(), fsIsValid(false) {}
-
- /// Makes a copy of \p that to \p this.
- /// @returns \p this
- /// @brief Assignment Operator
- PathWithStatus &operator=(const PathWithStatus &that) {
- static_cast<Path&>(*this) = static_cast<const Path&>(that);
- status = that.status;
- fsIsValid = that.fsIsValid;
- return *this;
- }
-
- /// Makes a copy of \p that to \p this.
- /// @returns \p this
- /// @brief Assignment Operator
- PathWithStatus &operator=(const Path &that) {
- static_cast<Path&>(*this) = static_cast<const Path&>(that);
- fsIsValid = false;
- return *this;
- }
-
- /// @}
- /// @name Methods
- /// @{
- public:
- /// This function returns status information about the file. The type of
- /// path (file or directory) is updated to reflect the actual contents
- /// of the file system.
- /// @returns 0 on failure, with Error explaining why (if non-zero)
- /// @returns a pointer to a FileStatus structure on success.
- /// @brief Get file status.
- const FileStatus *getFileStatus(
- bool forceUpdate = false, ///< Force an update from the file system
- std::string *Error = 0 ///< Optional place to return an error msg.
- ) const;
-
- /// @}
- /// @name Data
- /// @{
- private:
- mutable FileStatus status; ///< Status information.
- mutable bool fsIsValid; ///< Whether we've obtained it or not
-
- /// @}
- };
-
- /// This enumeration delineates the kinds of files that LLVM knows about.
- enum LLVMFileType {
- Unknown_FileType = 0, ///< Unrecognized file
- Bitcode_FileType, ///< Bitcode file
- Archive_FileType, ///< ar style archive file
- ELF_Relocatable_FileType, ///< ELF Relocatable object file
- ELF_Executable_FileType, ///< ELF Executable image
- ELF_SharedObject_FileType, ///< ELF dynamically linked shared lib
- ELF_Core_FileType, ///< ELF core image
- Mach_O_Object_FileType, ///< Mach-O Object file
- Mach_O_Executable_FileType, ///< Mach-O Executable
- Mach_O_FixedVirtualMemorySharedLib_FileType, ///< Mach-O Shared Lib, FVM
- Mach_O_Core_FileType, ///< Mach-O Core File
- Mach_O_PreloadExectuable_FileType, ///< Mach-O Preloaded Executable
- Mach_O_DynamicallyLinkedSharedLib_FileType, ///< Mach-O dynlinked shared lib
- Mach_O_DynamicLinker_FileType, ///< The Mach-O dynamic linker
- Mach_O_Bundle_FileType, ///< Mach-O Bundle file
- Mach_O_DynamicallyLinkedSharedLibStub_FileType, ///< Mach-O Shared lib stub
- COFF_FileType ///< COFF object file or lib
- };
-
- /// This utility function allows any memory block to be examined in order
- /// to determine its file type.
- LLVMFileType IdentifyFileType(const char*magic, unsigned length);
-
- /// This function can be used to copy the file specified by Src to the
- /// file specified by Dest. If an error occurs, Dest is removed.
- /// @returns true if an error occurs, false otherwise
- /// @brief Copy one file to another.
- bool CopyFile(const Path& Dest, const Path& Src, std::string* ErrMsg);
-
- /// This is the OS-specific path separator: a colon on Unix or a semicolon
- /// on Windows.
- extern const char PathSeparator;
-}
-
-std::ostream& operator<<(std::ostream& strm, const sys::Path& aPath);
-inline std::ostream& operator<<(std::ostream& strm,
- const sys::PathWithStatus& aPath) {
- strm << static_cast<const sys::Path&>(aPath);
- return strm;
-}
-
-}
-
-#endif
diff --git a/release_23/include/llvm/System/Process.h b/release_23/include/llvm/System/Process.h
deleted file mode 100644
index f98a3612c6c7..000000000000
--- a/release_23/include/llvm/System/Process.h
+++ /dev/null
@@ -1,102 +0,0 @@
-//===- llvm/System/Process.h ------------------------------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file declares the llvm::sys::Process class.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_SYSTEM_PROCESS_H
-#define LLVM_SYSTEM_PROCESS_H
-
-#include "llvm/System/TimeValue.h"
-
-namespace llvm {
-namespace sys {
-
- /// This class provides an abstraction for getting information about the
- /// currently executing process.
- /// @since 1.4
- /// @brief An abstraction for operating system processes.
- class Process {
- /// @name Accessors
- /// @{
- public:
- /// This static function will return the operating system's virtual memory
- /// page size.
- /// @returns The number of bytes in a virtual memory page.
- /// @throws nothing
- /// @brief Get the virtual memory page size
- static unsigned GetPageSize();
-
- /// This static function will return the total amount of memory allocated
- /// by the process. This only counts the memory allocated via the malloc,
- /// calloc and realloc functions and includes any "free" holes in the
- /// allocated space.
- /// @throws nothing
- /// @brief Return process memory usage.
- static size_t GetMallocUsage();
-
- /// This static function will return the total memory usage of the
- /// process. This includes code, data, stack and mapped pages usage. Notei
- /// that the value returned here is not necessarily the Running Set Size,
- /// it is the total virtual memory usage, regardless of mapped state of
- /// that memory.
- static size_t GetTotalMemoryUsage();
-
- /// This static function will set \p user_time to the amount of CPU time
- /// spent in user (non-kernel) mode and \p sys_time to the amount of CPU
- /// time spent in system (kernel) mode. If the operating system does not
- /// support collection of these metrics, a zero TimeValue will be for both
- /// values.
- static void GetTimeUsage(
- TimeValue& elapsed,
- ///< Returns the TimeValue::now() giving current time
- TimeValue& user_time,
- ///< Returns the current amount of user time for the process
- TimeValue& sys_time
- ///< Returns the current amount of system time for the process
- );
-
- /// This static function will return the process' current user id number.
- /// Not all operating systems support this feature. Where it is not
- /// supported, the function should return 65536 as the value.
- static int GetCurrentUserId();
-
- /// This static function will return the process' current group id number.
- /// Not all operating systems support this feature. Where it is not
- /// supported, the function should return 65536 as the value.
- static int GetCurrentGroupId();
-
- /// This function makes the necessary calls to the operating system to
- /// prevent core files or any other kind of large memory dumps that can
- /// occur when a program fails.
- /// @brief Prevent core file generation.
- static void PreventCoreFiles();
-
- /// This function determines if the standard input is connected directly
- /// to a user's input (keyboard probably), rather than coming from a file
- /// or pipe.
- static bool StandardInIsUserInput();
-
- /// This function determines if the standard output is connected to a
- /// "tty" or "console" window. That is, the output would be displayed to
- /// the user rather than being put on a pipe or stored in a file.
- static bool StandardOutIsDisplayed();
-
- /// This function determines if the standard error is connected to a
- /// "tty" or "console" window. That is, the output would be displayed to
- /// the user rather than being put on a pipe or stored in a file.
- static bool StandardErrIsDisplayed();
-
- /// @}
- };
-}
-}
-
-#endif
diff --git a/release_23/include/llvm/System/Program.h b/release_23/include/llvm/System/Program.h
deleted file mode 100644
index 3e9a1f2835ef..000000000000
--- a/release_23/include/llvm/System/Program.h
+++ /dev/null
@@ -1,92 +0,0 @@
-//===- llvm/System/Program.h ------------------------------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file declares the llvm::sys::Program class.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_SYSTEM_PROGRAM_H
-#define LLVM_SYSTEM_PROGRAM_H
-
-#include "llvm/System/Path.h"
-#include <vector>
-
-namespace llvm {
-namespace sys {
-
- /// This class provides an abstraction for programs that are executable by the
- /// operating system. It provides a platform generic way to find executable
- /// programs from the path and to execute them in various ways. The sys::Path
- /// class is used to specify the location of the Program.
- /// @since 1.4
- /// @brief An abstraction for finding and executing programs.
- class Program {
- /// @name Methods
- /// @{
- public:
- /// This static constructor (factory) will attempt to locate a program in
- /// the operating system's file system using some pre-determined set of
- /// locations to search (e.g. the PATH on Unix).
- /// @returns A Path object initialized to the path of the program or a
- /// Path object that is empty (invalid) if the program could not be found.
- /// @throws nothing
- /// @brief Construct a Program by finding it by name.
- static Path FindProgramByName(const std::string& name);
-
- /// This function executes the program using the \p arguments provided and
- /// waits for the program to exit. This function will block the current
- /// program until the invoked program exits. The invoked program will
- /// inherit the stdin, stdout, and stderr file descriptors, the
- /// environment and other configuration settings of the invoking program.
- /// If Path::executable() does not return true when this function is
- /// called then a std::string is thrown.
- /// @returns an integer result code indicating the status of the program.
- /// A zero or positive value indicates the result code of the program. A
- /// negative value is the signal number on which it terminated.
- /// @see FindProgrambyName
- /// @brief Executes the program with the given set of \p args.
- static int ExecuteAndWait(
- const Path& path, ///< sys::Path object providing the path of the
- ///< program to be executed. It is presumed this is the result of
- ///< the FindProgramByName method.
- const char** args, ///< A vector of strings that are passed to the
- ///< program. The first element should be the name of the program.
- ///< The list *must* be terminated by a null char* entry.
- const char ** env = 0, ///< An optional vector of strings to use for
- ///< the program's environment. If not provided, the current program's
- ///< environment will be used.
- const sys::Path** redirects = 0, ///< An optional array of pointers to
- ///< Paths. If the array is null, no redirection is done. The array
- ///< should have a size of at least three. If the pointer in the array
- ///< are not null, then the inferior process's stdin(0), stdout(1),
- ///< and stderr(2) will be redirected to the corresponding Paths.
- unsigned secondsToWait = 0, ///< If non-zero, this specifies the amount
- ///< of time to wait for the child process to exit. If the time
- ///< expires, the child is killed and this call returns. If zero,
- ///< this function will wait until the child finishes or forever if
- ///< it doesn't.
- unsigned memoryLimit = 0, ///< If non-zero, this specifies max. amount
- ///< of memory can be allocated by process. If memory usage will be
- ///< higher limit, the child is killed and this call returns. If zero -
- ///< no memory limit.
- std::string* ErrMsg = 0 ///< If non-zero, provides a pointer to a string
- ///< instance in which error messages will be returned. If the string
- ///< is non-empty upon return an error occurred while invoking the
- ///< program.
- );
- // These methods change the specified standard stream (stdin or stdout) to
- // binary mode. They return true if an error occurred
- static bool ChangeStdinToBinary();
- static bool ChangeStdoutToBinary();
- /// @}
- };
-}
-}
-
-#endif
diff --git a/release_23/include/llvm/System/Signals.h b/release_23/include/llvm/System/Signals.h
deleted file mode 100644
index 197e4e1d2d61..000000000000
--- a/release_23/include/llvm/System/Signals.h
+++ /dev/null
@@ -1,52 +0,0 @@
-//===- llvm/System/Signals.h - Signal Handling support ----------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines some helpful functions for dealing with the possibility of
-// unix signals occuring while your program is running.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_SYSTEM_SIGNALS_H
-#define LLVM_SYSTEM_SIGNALS_H
-
-#include "llvm/System/Path.h"
-
-namespace llvm {
-namespace sys {
-
- /// This function registers signal handlers to ensure that if a signal gets
- /// delivered that the named file is removed.
- /// @brief Remove a file if a fatal signal occurs.
- bool RemoveFileOnSignal(const Path &Filename, std::string* ErrMsg = 0);
-
- /// This function registers a signal handler to ensure that if a fatal signal
- /// gets delivered to the process that the named directory and all its
- /// contents are removed.
- /// @brief Remove a directory if a fatal signal occurs.
- bool RemoveDirectoryOnSignal(const Path& path, std::string* ErrMsg = 0);
-
- /// When an error signal (such as SIBABRT or SIGSEGV) is delivered to the
- /// process, print a stack trace and then exit.
- /// @brief Print a stack trace if a fatal signal occurs.
- void PrintStackTraceOnErrorSignal();
-
- /// This function registers a function to be called when the user "interrupts"
- /// the program (typically by pressing ctrl-c). When the user interrupts the
- /// program, the specified interrupt function is called instead of the program
- /// being killed, and the interrupt function automatically disabled. Note
- /// that interrupt functions are not allowed to call any non-reentrant
- /// functions. An null interrupt function pointer disables the current
- /// installed function. Note also that the handler may be executed on a
- /// different thread on some platforms.
- /// @brief Register a function to be called when ctrl-c is pressed.
- void SetInterruptFunction(void (*IF)());
-} // End sys namespace
-} // End llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/System/TimeValue.h b/release_23/include/llvm/System/TimeValue.h
deleted file mode 100644
index b9ada0071232..000000000000
--- a/release_23/include/llvm/System/TimeValue.h
+++ /dev/null
@@ -1,382 +0,0 @@
-//===-- TimeValue.h - Declare OS TimeValue Concept --------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This header file declares the operating system TimeValue concept.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Support/DataTypes.h"
-#include <string>
-
-#ifndef LLVM_SYSTEM_TIMEVALUE_H
-#define LLVM_SYSTEM_TIMEVALUE_H
-
-namespace llvm {
-namespace sys {
- /// This class is used where a precise fixed point in time is required. The
- /// range of TimeValue spans many hundreds of billions of years both past and
- /// present. The precision of TimeValue is to the nanosecond. However, the
- /// actual precision of its values will be determined by the resolution of
- /// the system clock. The TimeValue class is used in conjunction with several
- /// other lib/System interfaces to specify the time at which a call should
- /// timeout, etc.
- /// @since 1.4
- /// @brief Provides an abstraction for a fixed point in time.
- class TimeValue {
-
- /// @name Constants
- /// @{
- public:
-
- /// A constant TimeValue representing the smallest time
- /// value permissable by the class. MinTime is some point
- /// in the distant past, about 300 billion years BCE.
- /// @brief The smallest possible time value.
- static const TimeValue MinTime;
-
- /// A constant TimeValue representing the largest time
- /// value permissable by the class. MaxTime is some point
- /// in the distant future, about 300 billion years AD.
- /// @brief The largest possible time value.
- static const TimeValue MaxTime;
-
- /// A constant TimeValue representing the base time,
- /// or zero time of 00:00:00 (midnight) January 1st, 2000.
- /// @brief 00:00:00 Jan 1, 2000 UTC.
- static const TimeValue ZeroTime;
-
- /// A constant TimeValue for the Posix base time which is
- /// 00:00:00 (midnight) January 1st, 1970.
- /// @brief 00:00:00 Jan 1, 1970 UTC.
- static const TimeValue PosixZeroTime;
-
- /// A constant TimeValue for the Win32 base time which is
- /// 00:00:00 (midnight) January 1st, 1601.
- /// @brief 00:00:00 Jan 1, 1601 UTC.
- static const TimeValue Win32ZeroTime;
-
- /// @}
- /// @name Types
- /// @{
- public:
- typedef int64_t SecondsType; ///< Type used for representing seconds.
- typedef int32_t NanoSecondsType; ///< Type used for representing nanoseconds.
-
- enum TimeConversions {
- NANOSECONDS_PER_SECOND = 1000000000, ///< One Billion
- MICROSECONDS_PER_SECOND = 1000000, ///< One Million
- MILLISECONDS_PER_SECOND = 1000, ///< One Thousand
- NANOSECONDS_PER_MICROSECOND = 1000, ///< One Thousand
- NANOSECONDS_PER_MILLISECOND = 1000000,///< One Million
- NANOSECONDS_PER_POSIX_TICK = 100, ///< Posix tick is 100 Hz (10ms)
- NANOSECONDS_PER_WIN32_TICK = 100 ///< Win32 tick is 100 Hz (10ms)
- };
-
- /// @}
- /// @name Constructors
- /// @{
- public:
- /// Caller provides the exact value in seconds and nanoseconds. The
- /// \p nanos argument defaults to zero for convenience.
- /// @brief Explicit constructor
- explicit TimeValue (SecondsType seconds, NanoSecondsType nanos = 0)
- : seconds_( seconds ), nanos_( nanos ) { this->normalize(); }
-
- /// Caller provides the exact value as a double in seconds with the
- /// fractional part representing nanoseconds.
- /// @brief Double Constructor.
- explicit TimeValue( double new_time )
- : seconds_( 0 ) , nanos_ ( 0 ) {
- SecondsType integer_part = static_cast<SecondsType>( new_time );
- seconds_ = integer_part;
- nanos_ = static_cast<NanoSecondsType>( (new_time -
- static_cast<double>(integer_part)) * NANOSECONDS_PER_SECOND );
- this->normalize();
- }
-
- /// This is a static constructor that returns a TimeValue that represents
- /// the current time.
- /// @brief Creates a TimeValue with the current time (UTC).
- static TimeValue now();
-
- /// @}
- /// @name Operators
- /// @{
- public:
- /// Add \p that to \p this.
- /// @returns this
- /// @brief Incrementing assignment operator.
- TimeValue& operator += (const TimeValue& that ) {
- this->seconds_ += that.seconds_ ;
- this->nanos_ += that.nanos_ ;
- this->normalize();
- return *this;
- }
-
- /// Subtract \p that from \p this.
- /// @returns this
- /// @brief Decrementing assignment operator.
- TimeValue& operator -= (const TimeValue &that ) {
- this->seconds_ -= that.seconds_ ;
- this->nanos_ -= that.nanos_ ;
- this->normalize();
- return *this;
- }
-
- /// Determine if \p this is less than \p that.
- /// @returns True iff *this < that.
- /// @brief True if this < that.
- int operator < (const TimeValue &that) const { return that > *this; }
-
- /// Determine if \p this is greather than \p that.
- /// @returns True iff *this > that.
- /// @brief True if this > that.
- int operator > (const TimeValue &that) const {
- if ( this->seconds_ > that.seconds_ ) {
- return 1;
- } else if ( this->seconds_ == that.seconds_ ) {
- if ( this->nanos_ > that.nanos_ ) return 1;
- }
- return 0;
- }
-
- /// Determine if \p this is less than or equal to \p that.
- /// @returns True iff *this <= that.
- /// @brief True if this <= that.
- int operator <= (const TimeValue &that) const { return that >= *this; }
-
- /// Determine if \p this is greater than or equal to \p that.
- /// @returns True iff *this >= that.
- /// @brief True if this >= that.
- int operator >= (const TimeValue &that) const {
- if ( this->seconds_ > that.seconds_ ) {
- return 1;
- } else if ( this->seconds_ == that.seconds_ ) {
- if ( this->nanos_ >= that.nanos_ ) return 1;
- }
- return 0;
- }
-
- /// Determines if two TimeValue objects represent the same moment in time.
- /// @brief True iff *this == that.
- /// @brief True if this == that.
- int operator == (const TimeValue &that) const {
- return (this->seconds_ == that.seconds_) &&
- (this->nanos_ == that.nanos_);
- }
-
- /// Determines if two TimeValue objects represent times that are not the
- /// same.
- /// @return True iff *this != that.
- /// @brief True if this != that.
- int operator != (const TimeValue &that) const { return !(*this == that); }
-
- /// Adds two TimeValue objects together.
- /// @returns The sum of the two operands as a new TimeValue
- /// @brief Addition operator.
- friend TimeValue operator + (const TimeValue &tv1, const TimeValue &tv2);
-
- /// Subtracts two TimeValue objects.
- /// @returns The difference of the two operands as a new TimeValue
- /// @brief Subtraction operator.
- friend TimeValue operator - (const TimeValue &tv1, const TimeValue &tv2);
-
- /// @}
- /// @name Accessors
- /// @{
- public:
-
- /// Returns only the seconds component of the TimeValue. The nanoseconds
- /// portion is ignored. No rounding is performed.
- /// @brief Retrieve the seconds component
- SecondsType seconds() const { return seconds_; }
-
- /// Returns only the nanoseconds component of the TimeValue. The seconds
- /// portion is ignored.
- /// @brief Retrieve the nanoseconds component.
- NanoSecondsType nanoseconds() const { return nanos_; }
-
- /// Returns only the fractional portion of the TimeValue rounded down to the
- /// nearest microsecond (divide by one thousand).
- /// @brief Retrieve the fractional part as microseconds;
- uint32_t microseconds() const {
- return nanos_ / NANOSECONDS_PER_MICROSECOND;
- }
-
- /// Returns only the fractional portion of the TimeValue rounded down to the
- /// nearest millisecond (divide by one million).
- /// @brief Retrieve the fractional part as milliseconds;
- uint32_t milliseconds() const {
- return nanos_ / NANOSECONDS_PER_MILLISECOND;
- }
-
- /// Returns the TimeValue as a number of microseconds. Note that the value
- /// returned can overflow because the range of a uint64_t is smaller than
- /// the range of a TimeValue. Nevertheless, this is useful on some operating
- /// systems and is therefore provided.
- /// @brief Convert to a number of microseconds (can overflow)
- uint64_t usec() const {
- return seconds_ * MICROSECONDS_PER_SECOND +
- ( nanos_ / NANOSECONDS_PER_MICROSECOND );
- }
-
- /// Returns the TimeValue as a number of milliseconds. Note that the value
- /// returned can overflow because the range of a uint64_t is smaller than
- /// the range of a TimeValue. Nevertheless, this is useful on some operating
- /// systems and is therefore provided.
- /// @brief Convert to a number of milliseconds (can overflow)
- uint64_t msec() const {
- return seconds_ * MILLISECONDS_PER_SECOND +
- ( nanos_ / NANOSECONDS_PER_MILLISECOND );
- }
-
- /// Converts the TimeValue into the corresponding number of "ticks" for
- /// Posix, correcting for the difference in Posix zero time.
- /// @brief Convert to unix time (100 nanoseconds since 12:00:00a Jan 1,1970)
- uint64_t toPosixTime() const {
- uint64_t result = seconds_ - PosixZeroTime.seconds_;
- result += nanos_ / NANOSECONDS_PER_POSIX_TICK;
- return result;
- }
-
- /// Converts the TimeValue into the corresponding number of seconds
- /// since the epoch (00:00:00 Jan 1,1970).
- uint64_t toEpochTime() const {
- return seconds_ - PosixZeroTime.seconds_;
- }
-
- /// Converts the TiemValue into the correspodning number of "ticks" for
- /// Win32 platforms, correcting for the difference in Win32 zero time.
- /// @brief Convert to windows time (seconds since 12:00:00a Jan 1, 1601)
- uint64_t toWin32Time() const {
- uint64_t result = seconds_ - Win32ZeroTime.seconds_;
- result += nanos_ / NANOSECONDS_PER_WIN32_TICK;
- return result;
- }
-
- /// Provides the seconds and nanoseconds as results in its arguments after
- /// correction for the Posix zero time.
- /// @brief Convert to timespec time (ala POSIX.1b)
- void getTimespecTime( uint64_t& seconds, uint32_t& nanos ) const {
- seconds = seconds_ - PosixZeroTime.seconds_;
- nanos = nanos_;
- }
-
- /// Provides conversion of the TimeValue into a readable time & date.
- /// @returns std::string containing the readable time value
- /// @brief Convert time to a string.
- std::string toString() const;
-
- /// @}
- /// @name Mutators
- /// @{
- public:
- /// The seconds component of the TimeValue is set to \p sec without
- /// modifying the nanoseconds part. This is useful for whole second
- /// arithmetic.
- /// @brief Set the seconds component.
- void seconds (SecondsType sec ) {
- this->seconds_ = sec;
- this->normalize();
- }
-
- /// The nanoseconds component of the TimeValue is set to \p nanos without
- /// modifying the seconds part. This is useful for basic computations
- /// involving just the nanoseconds portion. Note that the TimeValue will be
- /// normalized after this call so that the fractional (nanoseconds) portion
- /// will have the smallest equivalent value.
- /// @brief Set the nanoseconds component using a number of nanoseconds.
- void nanoseconds ( NanoSecondsType nanos ) {
- this->nanos_ = nanos;
- this->normalize();
- }
-
- /// The seconds component remains unchanged.
- /// @brief Set the nanoseconds component using a number of microseconds.
- void microseconds ( int32_t micros ) {
- this->nanos_ = micros * NANOSECONDS_PER_MICROSECOND;
- this->normalize();
- }
-
- /// The seconds component remains unchanged.
- /// @brief Set the nanoseconds component using a number of milliseconds.
- void milliseconds ( int32_t millis ) {
- this->nanos_ = millis * NANOSECONDS_PER_MILLISECOND;
- this->normalize();
- }
-
- /// @brief Converts from microsecond format to TimeValue format
- void usec( int64_t microseconds ) {
- this->seconds_ = microseconds / MICROSECONDS_PER_SECOND;
- this->nanos_ = NanoSecondsType(microseconds % MICROSECONDS_PER_SECOND) *
- NANOSECONDS_PER_MICROSECOND;
- this->normalize();
- }
-
- /// @brief Converts from millisecond format to TimeValue format
- void msec( int64_t milliseconds ) {
- this->seconds_ = milliseconds / MILLISECONDS_PER_SECOND;
- this->nanos_ = NanoSecondsType(milliseconds % MILLISECONDS_PER_SECOND) *
- NANOSECONDS_PER_MILLISECOND;
- this->normalize();
- }
-
- /// Converts the \p seconds argument from PosixTime to the corresponding
- /// TimeValue and assigns that value to \p this.
- /// @brief Convert seconds form PosixTime to TimeValue
- void fromEpochTime( SecondsType seconds ) {
- seconds_ = seconds + PosixZeroTime.seconds_;
- nanos_ = 0;
- this->normalize();
- }
-
- /// Converts the \p win32Time argument from Windows FILETIME to the
- /// corresponding TimeValue and assigns that value to \p this.
- /// @brief Convert seconds form Windows FILETIME to TimeValue
- void fromWin32Time( uint64_t win32Time ) {
- this->seconds_ = win32Time / 10000000 + Win32ZeroTime.seconds_;
- this->nanos_ = NanoSecondsType(win32Time % 10000000) * 100;
- }
-
- /// @}
- /// @name Implementation
- /// @{
- private:
- /// This causes the values to be represented so that the fractional
- /// part is minimized, possibly incrementing the seconds part.
- /// @brief Normalize to canonical form.
- void normalize();
-
- /// @}
- /// @name Data
- /// @{
- private:
- /// Store the values as a <timeval>.
- SecondsType seconds_;///< Stores the seconds part of the TimeVal
- NanoSecondsType nanos_; ///< Stores the nanoseconds part of the TimeVal
- /// @}
-
- };
-
-inline TimeValue operator + (const TimeValue &tv1, const TimeValue &tv2) {
- TimeValue sum (tv1.seconds_ + tv2.seconds_, tv1.nanos_ + tv2.nanos_);
- sum.normalize ();
- return sum;
-}
-
-inline TimeValue operator - (const TimeValue &tv1, const TimeValue &tv2) {
- TimeValue difference (tv1.seconds_ - tv2.seconds_, tv1.nanos_ - tv2.nanos_ );
- difference.normalize ();
- return difference;
-}
-
-}
-}
-
-#endif
diff --git a/release_23/include/llvm/Target/SubtargetFeature.h b/release_23/include/llvm/Target/SubtargetFeature.h
deleted file mode 100644
index d187daac0c89..000000000000
--- a/release_23/include/llvm/Target/SubtargetFeature.h
+++ /dev/null
@@ -1,111 +0,0 @@
-//===-- llvm/Target/SubtargetFeature.h - CPU characteristics ----*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines and manages user or tool specified CPU characteristics.
-// The intent is to be able to package specific features that should or should
-// not be used on a specific target processor. A tool, such as llc, could, as
-// as example, gather chip info from the command line, a long with features
-// that should be used on that chip.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_TARGET_SUBTARGETFEATURE_H
-#define LLVM_TARGET_SUBTARGETFEATURE_H
-
-#include <string>
-#include <vector>
-#include <iosfwd>
-#include <cstring>
-#include "llvm/Support/DataTypes.h"
-
-namespace llvm {
-
-//===----------------------------------------------------------------------===//
-///
-/// SubtargetFeatureKV - Used to provide key value pairs for feature and
-/// CPU bit flags.
-//
-struct SubtargetFeatureKV {
- const char *Key; // K-V key string
- const char *Desc; // Help descriptor
- uint32_t Value; // K-V integer value
- uint32_t Implies; // K-V bit mask
-
- // Compare routine for std binary search
- bool operator<(const SubtargetFeatureKV &S) const {
- return strcmp(Key, S.Key) < 0;
- }
-};
-
-//===----------------------------------------------------------------------===//
-///
-/// SubtargetInfoKV - Used to provide key value pairs for CPU and arbitrary
-/// pointers.
-//
-struct SubtargetInfoKV {
- const char *Key; // K-V key string
- void *Value; // K-V pointer value
-
- // Compare routine for std binary search
- bool operator<(const SubtargetInfoKV &S) const {
- return strcmp(Key, S.Key) < 0;
- }
-};
-
-//===----------------------------------------------------------------------===//
-///
-/// SubtargetFeatures - Manages the enabling and disabling of subtarget
-/// specific features. Features are encoded as a string of the form
-/// "cpu,+attr1,+attr2,-attr3,...,+attrN"
-/// A comma separates each feature from the next (all lowercase.)
-/// The first feature is always the CPU subtype (eg. pentiumm). If the CPU
-/// value is "generic" then the CPU subtype should be generic for the target.
-/// Each of the remaining features is prefixed with + or - indicating whether
-/// that feature should be enabled or disabled contrary to the cpu
-/// specification.
-///
-
-class SubtargetFeatures {
- std::vector<std::string> Features; // Subtarget features as a vector
-public:
- explicit SubtargetFeatures(const std::string &Initial = std::string());
-
- /// Features string accessors.
- std::string getString() const;
- void setString(const std::string &Initial);
-
- /// Set the CPU string. Replaces previous setting. Setting to "" clears CPU.
- void setCPU(const std::string &String);
-
- /// Setting CPU string only if no string is set.
- void setCPUIfNone(const std::string &String);
-
- /// Adding Features.
- void AddFeature(const std::string &String, bool IsEnabled = true);
-
- /// Get feature bits.
- uint32_t getBits(const SubtargetFeatureKV *CPUTable,
- size_t CPUTableSize,
- const SubtargetFeatureKV *FeatureTable,
- size_t FeatureTableSize);
-
- /// Get info pointer
- void *getInfo(const SubtargetInfoKV *Table, size_t TableSize);
-
- /// Print feature string.
- void print(std::ostream &OS) const;
- void print(std::ostream *OS) const { if (OS) print(*OS); }
-
- // Dump feature info.
- void dump() const;
-};
-
-} // End namespace llvm
-
-#endif
diff --git a/release_23/include/llvm/Target/TargetAsmInfo.h b/release_23/include/llvm/Target/TargetAsmInfo.h
deleted file mode 100644
index 7deac403b50b..000000000000
--- a/release_23/include/llvm/Target/TargetAsmInfo.h
+++ /dev/null
@@ -1,683 +0,0 @@
-//===-- llvm/Target/TargetAsmInfo.h - Asm info ------------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains a class to be used as the basis for target specific
-// asm writers. This class primarily takes care of global printing constants,
-// which are used in very similar ways across all targets.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_TARGET_ASM_INFO_H
-#define LLVM_TARGET_ASM_INFO_H
-
-#include "llvm/CodeGen/MachineFunctionPass.h"
-#include "llvm/Support/DataTypes.h"
-
-namespace llvm {
- // DWARF encoding query type
- namespace DwarfEncoding {
- enum Target {
- Data = 0,
- CodeLabels = 1,
- Functions = 2
- };
- }
-
- class TargetMachine;
- class CallInst;
-
- /// TargetAsmInfo - This class is intended to be used as a base class for asm
- /// properties and features specific to the target.
- class TargetAsmInfo {
- protected:
- //===------------------------------------------------------------------===//
- // Properties to be set by the target writer, used to configure asm printer.
- //
-
- /// TextSection - Section directive for standard text.
- ///
- const char *TextSection; // Defaults to ".text".
-
- /// DataSection - Section directive for standard data.
- ///
- const char *DataSection; // Defaults to ".data".
-
- /// BSSSection - Section directive for uninitialized data. Null if this
- /// target doesn't support a BSS section.
- ///
- const char *BSSSection; // Default to ".bss".
-
- /// TLSDataSection - Section directive for Thread Local data.
- ///
- const char *TLSDataSection;// Defaults to ".section .tdata,"awT",@progbits".
-
- /// TLSBSSSection - Section directive for Thread Local uninitialized data.
- /// Null if this target doesn't support a BSS section.
- ///
- const char *TLSBSSSection;// Default to ".section .tbss,"awT",@nobits".
-
- /// ZeroFillDirective - Directive for emitting a global to the ZeroFill
- /// section on this target. Null if this target doesn't support zerofill.
- const char *ZeroFillDirective; // Default is null.
-
- /// NonexecutableStackDirective - Directive for declaring to the
- /// linker and beyond that the emitted code does not require stack
- /// memory to be executable.
- const char *NonexecutableStackDirective; // Default is null.
-
- /// NeedsSet - True if target asm treats expressions in data directives
- /// as linktime-relocatable. For assembly-time computation, we need to
- /// use a .set. Thus:
- /// .set w, x-y
- /// .long w
- /// is computed at assembly time, while
- /// .long x-y
- /// is relocated if the relative locations of x and y change at linktime.
- /// We want both these things in different places.
- bool NeedsSet; // Defaults to false.
-
- /// MaxInstLength - This is the maximum possible length of an instruction,
- /// which is needed to compute the size of an inline asm.
- unsigned MaxInstLength; // Defaults to 4.
-
- /// PCSymbol - The symbol used to represent the current PC. Used in PC
- /// relative expressions.
- const char *PCSymbol; // Defaults to "$".
-
- /// SeparatorChar - This character, if specified, is used to separate
- /// instructions from each other when on the same line. This is used to
- /// measure inline asm instructions.
- char SeparatorChar; // Defaults to ';'
-
- /// CommentString - This indicates the comment character used by the
- /// assembler.
- const char *CommentString; // Defaults to "#"
-
- /// GlobalPrefix - If this is set to a non-empty string, it is prepended
- /// onto all global symbols. This is often used for "_" or ".".
- const char *GlobalPrefix; // Defaults to ""
-
- /// PrivateGlobalPrefix - This prefix is used for globals like constant
- /// pool entries that are completely private to the .o file and should not
- /// have names in the .o file. This is often "." or "L".
- const char *PrivateGlobalPrefix; // Defaults to "."
-
- /// JumpTableSpecialLabelPrefix - If not null, a extra (dead) label is
- /// emitted before jump tables with the specified prefix.
- const char *JumpTableSpecialLabelPrefix; // Default to null.
-
- /// GlobalVarAddrPrefix/Suffix - If these are nonempty, these strings
- /// will enclose any GlobalVariable (that isn't a function)
- ///
- const char *GlobalVarAddrPrefix; // Defaults to ""
- const char *GlobalVarAddrSuffix; // Defaults to ""
-
- /// FunctionAddrPrefix/Suffix - If these are nonempty, these strings
- /// will enclose any GlobalVariable that points to a function.
- /// For example, this is used by the IA64 backend to materialize
- /// function descriptors, by decorating the ".data8" object with the
- /// @verbatim @fptr( ) @endverbatim
- /// link-relocation operator.
- ///
- const char *FunctionAddrPrefix; // Defaults to ""
- const char *FunctionAddrSuffix; // Defaults to ""
-
- /// PersonalityPrefix/Suffix - If these are nonempty, these strings will
- /// enclose any personality function in the common frame section.
- ///
- const char *PersonalityPrefix; // Defaults to ""
- const char *PersonalitySuffix; // Defaults to ""
-
- /// NeedsIndirectEncoding - If set, we need to set the indirect encoding bit
- /// for EH in Dwarf.
- ///
- bool NeedsIndirectEncoding; // Defaults to false
-
- /// InlineAsmStart/End - If these are nonempty, they contain a directive to
- /// emit before and after an inline assembly statement.
- const char *InlineAsmStart; // Defaults to "#APP\n"
- const char *InlineAsmEnd; // Defaults to "#NO_APP\n"
-
- /// AssemblerDialect - Which dialect of an assembler variant to use.
- unsigned AssemblerDialect; // Defaults to 0
-
- //===--- Data Emission Directives -------------------------------------===//
-
- /// ZeroDirective - this should be set to the directive used to get some
- /// number of zero bytes emitted to the current section. Common cases are
- /// "\t.zero\t" and "\t.space\t". If this is set to null, the
- /// Data*bitsDirective's will be used to emit zero bytes.
- const char *ZeroDirective; // Defaults to "\t.zero\t"
- const char *ZeroDirectiveSuffix; // Defaults to ""
-
- /// AsciiDirective - This directive allows emission of an ascii string with
- /// the standard C escape characters embedded into it.
- const char *AsciiDirective; // Defaults to "\t.ascii\t"
-
- /// AscizDirective - If not null, this allows for special handling of
- /// zero terminated strings on this target. This is commonly supported as
- /// ".asciz". If a target doesn't support this, it can be set to null.
- const char *AscizDirective; // Defaults to "\t.asciz\t"
-
- /// DataDirectives - These directives are used to output some unit of
- /// integer data to the current section. If a data directive is set to
- /// null, smaller data directives will be used to emit the large sizes.
- const char *Data8bitsDirective; // Defaults to "\t.byte\t"
- const char *Data16bitsDirective; // Defaults to "\t.short\t"
- const char *Data32bitsDirective; // Defaults to "\t.long\t"
- const char *Data64bitsDirective; // Defaults to "\t.quad\t"
-
- //===--- Alignment Information ----------------------------------------===//
-
- /// AlignDirective - The directive used to emit round up to an alignment
- /// boundary.
- ///
- const char *AlignDirective; // Defaults to "\t.align\t"
-
- /// AlignmentIsInBytes - If this is true (the default) then the asmprinter
- /// emits ".align N" directives, where N is the number of bytes to align to.
- /// Otherwise, it emits ".align log2(N)", e.g. 3 to align to an 8 byte
- /// boundary.
- bool AlignmentIsInBytes; // Defaults to true
-
- /// TextAlignFillValue - If non-zero, this is used to fill the executable
- /// space created as the result of a alignment directive.
- unsigned TextAlignFillValue;
-
- //===--- Section Switching Directives ---------------------------------===//
-
- /// SwitchToSectionDirective - This is the directive used when we want to
- /// emit a global to an arbitrary section. The section name is emited after
- /// this.
- const char *SwitchToSectionDirective; // Defaults to "\t.section\t"
-
- /// TextSectionStartSuffix - This is printed after each start of section
- /// directive for text sections.
- const char *TextSectionStartSuffix; // Defaults to "".
-
- /// DataSectionStartSuffix - This is printed after each start of section
- /// directive for data sections.
- const char *DataSectionStartSuffix; // Defaults to "".
-
- /// SectionEndDirectiveSuffix - If non-null, the asm printer will close each
- /// section with the section name and this suffix printed.
- const char *SectionEndDirectiveSuffix;// Defaults to null.
-
- /// ConstantPoolSection - This is the section that we SwitchToSection right
- /// before emitting the constant pool for a function.
- const char *ConstantPoolSection; // Defaults to "\t.section .rodata"
-
- /// JumpTableDataSection - This is the section that we SwitchToSection right
- /// before emitting the jump tables for a function when the relocation model
- /// is not PIC.
- const char *JumpTableDataSection; // Defaults to "\t.section .rodata"
-
- /// JumpTableDirective - if non-null, the directive to emit before a jump
- /// table.
- const char *JumpTableDirective;
-
- /// CStringSection - If not null, this allows for special handling of
- /// cstring constants (null terminated string that does not contain any
- /// other null bytes) on this target. This is commonly supported as
- /// ".cstring".
- const char *CStringSection; // Defaults to NULL
-
- /// StaticCtorsSection - This is the directive that is emitted to switch to
- /// a section to emit the static constructor list.
- /// Defaults to "\t.section .ctors,\"aw\",@progbits".
- const char *StaticCtorsSection;
-
- /// StaticDtorsSection - This is the directive that is emitted to switch to
- /// a section to emit the static destructor list.
- /// Defaults to "\t.section .dtors,\"aw\",@progbits".
- const char *StaticDtorsSection;
-
- /// FourByteConstantSection, EightByteConstantSection,
- /// SixteenByteConstantSection - These are special sections where we place
- /// 4-, 8-, and 16- byte constant literals.
- const char *FourByteConstantSection;
- const char *EightByteConstantSection;
- const char *SixteenByteConstantSection;
-
- /// ReadOnlySection - This is the directive that is emitted to switch to a
- /// read-only section for constant data (e.g. data declared const,
- /// jump tables).
- const char *ReadOnlySection; // Defaults to NULL
-
- //===--- Global Variable Emission Directives --------------------------===//
-
- /// GlobalDirective - This is the directive used to declare a global entity.
- ///
- const char *GlobalDirective; // Defaults to NULL.
-
- /// SetDirective - This is the name of a directive that can be used to tell
- /// the assembler to set the value of a variable to some expression.
- const char *SetDirective; // Defaults to null.
-
- /// LCOMMDirective - This is the name of a directive (if supported) that can
- /// be used to efficiently declare a local (internal) block of zero
- /// initialized data in the .bss/.data section. The syntax expected is:
- /// @verbatim <LCOMMDirective> SYMBOLNAME LENGTHINBYTES, ALIGNMENT
- /// @endverbatim
- const char *LCOMMDirective; // Defaults to null.
-
- const char *COMMDirective; // Defaults to "\t.comm\t".
-
- /// COMMDirectiveTakesAlignment - True if COMMDirective take a third
- /// argument that specifies the alignment of the declaration.
- bool COMMDirectiveTakesAlignment; // Defaults to true.
-
- /// HasDotTypeDotSizeDirective - True if the target has .type and .size
- /// directives, this is true for most ELF targets.
- bool HasDotTypeDotSizeDirective; // Defaults to true.
-
- /// UsedDirective - This directive, if non-null, is used to declare a global
- /// as being used somehow that the assembler can't see. This prevents dead
- /// code elimination on some targets.
- const char *UsedDirective; // Defaults to null.
-
- /// WeakRefDirective - This directive, if non-null, is used to declare a
- /// global as being a weak undefined symbol.
- const char *WeakRefDirective; // Defaults to null.
-
- /// WeakDefDirective - This directive, if non-null, is used to declare a
- /// global as being a weak defined symbol.
- const char *WeakDefDirective; // Defaults to null.
-
- /// HiddenDirective - This directive, if non-null, is used to declare a
- /// global or function as having hidden visibility.
- const char *HiddenDirective; // Defaults to "\t.hidden\t".
-
- /// ProtectedDirective - This directive, if non-null, is used to declare a
- /// global or function as having protected visibility.
- const char *ProtectedDirective; // Defaults to "\t.protected\t".
-
- //===--- Dwarf Emission Directives -----------------------------------===//
-
- /// AbsoluteDebugSectionOffsets - True if we should emit abolute section
- /// offsets for debug information. Defaults to false.
- bool AbsoluteDebugSectionOffsets;
-
- /// AbsoluteEHSectionOffsets - True if we should emit abolute section
- /// offsets for EH information. Defaults to false.
- bool AbsoluteEHSectionOffsets;
-
- /// HasLEB128 - True if target asm supports leb128 directives.
- ///
- bool HasLEB128; // Defaults to false.
-
- /// hasDotLocAndDotFile - True if target asm supports .loc and .file
- /// directives for emitting debugging information.
- ///
- bool HasDotLocAndDotFile; // Defaults to false.
-
- /// SupportsDebugInformation - True if target supports emission of debugging
- /// information.
- bool SupportsDebugInformation;
-
- /// SupportsExceptionHandling - True if target supports
- /// exception handling.
- ///
- bool SupportsExceptionHandling; // Defaults to false.
-
- /// RequiresFrameSection - true if the Dwarf2 output needs a frame section
- ///
- bool DwarfRequiresFrameSection; // Defaults to true.
-
- /// GlobalEHDirective - This is the directive used to make exception frame
- /// tables globally visible.
- ///
- const char *GlobalEHDirective; // Defaults to NULL.
-
- /// SupportsWeakEmptyEHFrame - True if target assembler and linker will
- /// handle a weak_definition of constant 0 for an omitted EH frame.
- bool SupportsWeakOmittedEHFrame; // Defaults to true.
-
- /// DwarfSectionOffsetDirective - Special section offset directive.
- const char* DwarfSectionOffsetDirective; // Defaults to NULL
-
- /// DwarfAbbrevSection - Section directive for Dwarf abbrev.
- ///
- const char *DwarfAbbrevSection; // Defaults to ".debug_abbrev".
-
- /// DwarfInfoSection - Section directive for Dwarf info.
- ///
- const char *DwarfInfoSection; // Defaults to ".debug_info".
-
- /// DwarfLineSection - Section directive for Dwarf info.
- ///
- const char *DwarfLineSection; // Defaults to ".debug_line".
-
- /// DwarfFrameSection - Section directive for Dwarf info.
- ///
- const char *DwarfFrameSection; // Defaults to ".debug_frame".
-
- /// DwarfPubNamesSection - Section directive for Dwarf info.
- ///
- const char *DwarfPubNamesSection; // Defaults to ".debug_pubnames".
-
- /// DwarfPubTypesSection - Section directive for Dwarf info.
- ///
- const char *DwarfPubTypesSection; // Defaults to ".debug_pubtypes".
-
- /// DwarfStrSection - Section directive for Dwarf info.
- ///
- const char *DwarfStrSection; // Defaults to ".debug_str".
-
- /// DwarfLocSection - Section directive for Dwarf info.
- ///
- const char *DwarfLocSection; // Defaults to ".debug_loc".
-
- /// DwarfARangesSection - Section directive for Dwarf info.
- ///
- const char *DwarfARangesSection; // Defaults to ".debug_aranges".
-
- /// DwarfRangesSection - Section directive for Dwarf info.
- ///
- const char *DwarfRangesSection; // Defaults to ".debug_ranges".
-
- /// DwarfMacInfoSection - Section directive for Dwarf info.
- ///
- const char *DwarfMacInfoSection; // Defaults to ".debug_macinfo".
-
- /// DwarfEHFrameSection - Section directive for Exception frames.
- ///
- const char *DwarfEHFrameSection; // Defaults to ".eh_frame".
-
- /// DwarfExceptionSection - Section directive for Exception table.
- ///
- const char *DwarfExceptionSection; // Defaults to ".gcc_except_table".
-
-
- //===--- CBE Asm Translation Table -----------------------------------===//
-
- const char *const *AsmTransCBE; // Defaults to empty
-
- public:
- TargetAsmInfo();
- virtual ~TargetAsmInfo();
-
- /// Measure the specified inline asm to determine an approximation of its
- /// length.
- virtual unsigned getInlineAsmLength(const char *Str) const;
-
- /// ExpandInlineAsm - This hook allows the target to expand an inline asm
- /// call to be explicit llvm code if it wants to. This is useful for
- /// turning simple inline asms into LLVM intrinsics, which gives the
- /// compiler more information about the behavior of the code.
- virtual bool ExpandInlineAsm(CallInst *CI) const {
- return false;
- }
-
- /// PreferredEHDataFormat - This hook allows the target to select data
- /// format used for encoding pointers in exception handling data. Reason is
- /// 0 for data, 1 for code labels, 2 for function pointers. Global is true
- /// if the symbol can be relocated.
- virtual unsigned PreferredEHDataFormat(DwarfEncoding::Target Reason,
- bool Global) const;
-
- // Accessors.
- //
- const char *getTextSection() const {
- return TextSection;
- }
- const char *getDataSection() const {
- return DataSection;
- }
- const char *getBSSSection() const {
- return BSSSection;
- }
- const char *getTLSDataSection() const {
- return TLSDataSection;
- }
- const char *getTLSBSSSection() const {
- return TLSBSSSection;
- }
- const char *getZeroFillDirective() const {
- return ZeroFillDirective;
- }
- const char *getNonexecutableStackDirective() const {
- return NonexecutableStackDirective;
- }
- bool needsSet() const {
- return NeedsSet;
- }
- const char *getPCSymbol() const {
- return PCSymbol;
- }
- char getSeparatorChar() const {
- return SeparatorChar;
- }
- const char *getCommentString() const {
- return CommentString;
- }
- const char *getGlobalPrefix() const {
- return GlobalPrefix;
- }
- const char *getPrivateGlobalPrefix() const {
- return PrivateGlobalPrefix;
- }
- const char *getJumpTableSpecialLabelPrefix() const {
- return JumpTableSpecialLabelPrefix;
- }
- const char *getGlobalVarAddrPrefix() const {
- return GlobalVarAddrPrefix;
- }
- const char *getGlobalVarAddrSuffix() const {
- return GlobalVarAddrSuffix;
- }
- const char *getFunctionAddrPrefix() const {
- return FunctionAddrPrefix;
- }
- const char *getFunctionAddrSuffix() const {
- return FunctionAddrSuffix;
- }
- const char *getPersonalityPrefix() const {
- return PersonalityPrefix;
- }
- const char *getPersonalitySuffix() const {
- return PersonalitySuffix;
- }
- bool getNeedsIndirectEncoding() const {
- return NeedsIndirectEncoding;
- }
- const char *getInlineAsmStart() const {
- return InlineAsmStart;
- }
- const char *getInlineAsmEnd() const {
- return InlineAsmEnd;
- }
- unsigned getAssemblerDialect() const {
- return AssemblerDialect;
- }
- const char *getZeroDirective() const {
- return ZeroDirective;
- }
- const char *getZeroDirectiveSuffix() const {
- return ZeroDirectiveSuffix;
- }
- const char *getAsciiDirective() const {
- return AsciiDirective;
- }
- const char *getAscizDirective() const {
- return AscizDirective;
- }
- const char *getData8bitsDirective() const {
- return Data8bitsDirective;
- }
- const char *getData16bitsDirective() const {
- return Data16bitsDirective;
- }
- const char *getData32bitsDirective() const {
- return Data32bitsDirective;
- }
- const char *getData64bitsDirective() const {
- return Data64bitsDirective;
- }
- const char *getJumpTableDirective() const {
- return JumpTableDirective;
- }
- const char *getAlignDirective() const {
- return AlignDirective;
- }
- bool getAlignmentIsInBytes() const {
- return AlignmentIsInBytes;
- }
- unsigned getTextAlignFillValue() const {
- return TextAlignFillValue;
- }
- const char *getSwitchToSectionDirective() const {
- return SwitchToSectionDirective;
- }
- const char *getTextSectionStartSuffix() const {
- return TextSectionStartSuffix;
- }
- const char *getDataSectionStartSuffix() const {
- return DataSectionStartSuffix;
- }
- const char *getSectionEndDirectiveSuffix() const {
- return SectionEndDirectiveSuffix;
- }
- const char *getConstantPoolSection() const {
- return ConstantPoolSection;
- }
- const char *getJumpTableDataSection() const {
- return JumpTableDataSection;
- }
- const char *getCStringSection() const {
- return CStringSection;
- }
- const char *getStaticCtorsSection() const {
- return StaticCtorsSection;
- }
- const char *getStaticDtorsSection() const {
- return StaticDtorsSection;
- }
- const char *getFourByteConstantSection() const {
- return FourByteConstantSection;
- }
- const char *getEightByteConstantSection() const {
- return EightByteConstantSection;
- }
- const char *getSixteenByteConstantSection() const {
- return SixteenByteConstantSection;
- }
- const char *getReadOnlySection() const {
- return ReadOnlySection;
- }
- const char *getGlobalDirective() const {
- return GlobalDirective;
- }
- const char *getSetDirective() const {
- return SetDirective;
- }
- const char *getLCOMMDirective() const {
- return LCOMMDirective;
- }
- const char *getCOMMDirective() const {
- return COMMDirective;
- }
- bool getCOMMDirectiveTakesAlignment() const {
- return COMMDirectiveTakesAlignment;
- }
- bool hasDotTypeDotSizeDirective() const {
- return HasDotTypeDotSizeDirective;
- }
- const char *getUsedDirective() const {
- return UsedDirective;
- }
- const char *getWeakRefDirective() const {
- return WeakRefDirective;
- }
- const char *getWeakDefDirective() const {
- return WeakDefDirective;
- }
- const char *getHiddenDirective() const {
- return HiddenDirective;
- }
- const char *getProtectedDirective() const {
- return ProtectedDirective;
- }
- bool isAbsoluteDebugSectionOffsets() const {
- return AbsoluteDebugSectionOffsets;
- }
- bool isAbsoluteEHSectionOffsets() const {
- return AbsoluteEHSectionOffsets;
- }
- bool hasLEB128() const {
- return HasLEB128;
- }
- bool hasDotLocAndDotFile() const {
- return HasDotLocAndDotFile;
- }
- bool doesSupportDebugInformation() const {
- return SupportsDebugInformation;
- }
- bool doesSupportExceptionHandling() const {
- return SupportsExceptionHandling;
- }
- bool doesDwarfRequireFrameSection() const {
- return DwarfRequiresFrameSection;
- }
- const char *getGlobalEHDirective() const {
- return GlobalEHDirective;
- }
- bool getSupportsWeakOmittedEHFrame() const {
- return SupportsWeakOmittedEHFrame;
- }
- const char *getDwarfSectionOffsetDirective() const {
- return DwarfSectionOffsetDirective;
- }
- const char *getDwarfAbbrevSection() const {
- return DwarfAbbrevSection;
- }
- const char *getDwarfInfoSection() const {
- return DwarfInfoSection;
- }
- const char *getDwarfLineSection() const {
- return DwarfLineSection;
- }
- const char *getDwarfFrameSection() const {
- return DwarfFrameSection;
- }
- const char *getDwarfPubNamesSection() const {
- return DwarfPubNamesSection;
- }
- const char *getDwarfPubTypesSection() const {
- return DwarfPubTypesSection;
- }
- const char *getDwarfStrSection() const {
- return DwarfStrSection;
- }
- const char *getDwarfLocSection() const {
- return DwarfLocSection;
- }
- const char *getDwarfARangesSection() const {
- return DwarfARangesSection;
- }
- const char *getDwarfRangesSection() const {
- return DwarfRangesSection;
- }
- const char *getDwarfMacInfoSection() const {
- return DwarfMacInfoSection;
- }
- const char *getDwarfEHFrameSection() const {
- return DwarfEHFrameSection;
- }
- const char *getDwarfExceptionSection() const {
- return DwarfExceptionSection;
- }
- const char *const *getAsmCBE() const {
- return AsmTransCBE;
- }
- };
-}
-
-#endif
-
diff --git a/release_23/include/llvm/Target/TargetData.h b/release_23/include/llvm/Target/TargetData.h
deleted file mode 100644
index 2d9dc076e2ff..000000000000
--- a/release_23/include/llvm/Target/TargetData.h
+++ /dev/null
@@ -1,289 +0,0 @@
-//===-- llvm/Target/TargetData.h - Data size & alignment info ---*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines target properties related to datatype size/offset/alignment
-// information. It uses lazy annotations to cache information about how
-// structure types are laid out and used.
-//
-// This structure should be created once, filled in if the defaults are not
-// correct and then passed around by const&. None of the members functions
-// require modification to the object.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_TARGET_TARGETDATA_H
-#define LLVM_TARGET_TARGETDATA_H
-
-#include "llvm/Pass.h"
-#include "llvm/Support/DataTypes.h"
-#include "llvm/ADT/SmallVector.h"
-#include <string>
-
-namespace llvm {
-
-class Value;
-class Type;
-class StructType;
-class StructLayout;
-class GlobalVariable;
-
-/// Enum used to categorize the alignment types stored by TargetAlignElem
-enum AlignTypeEnum {
- INTEGER_ALIGN = 'i', ///< Integer type alignment
- VECTOR_ALIGN = 'v', ///< Vector type alignment
- FLOAT_ALIGN = 'f', ///< Floating point type alignment
- AGGREGATE_ALIGN = 'a', ///< Aggregate alignment
- STACK_ALIGN = 's' ///< Stack objects alignment
-};
-/// Target alignment element.
-///
-/// Stores the alignment data associated with a given alignment type (pointer,
-/// integer, vector, float) and type bit width.
-///
-/// @note The unusual order of elements in the structure attempts to reduce
-/// padding and make the structure slightly more cache friendly.
-struct TargetAlignElem {
- AlignTypeEnum AlignType : 8; //< Alignment type (AlignTypeEnum)
- unsigned char ABIAlign; //< ABI alignment for this type/bitw
- unsigned char PrefAlign; //< Pref. alignment for this type/bitw
- uint32_t TypeBitWidth; //< Type bit width
-
- /// Initializer
- static TargetAlignElem get(AlignTypeEnum align_type, unsigned char abi_align,
- unsigned char pref_align, uint32_t bit_width);
- /// Equality predicate
- bool operator==(const TargetAlignElem &rhs) const;
- /// output stream operator
- std::ostream &dump(std::ostream &os) const;
-};
-
-class TargetData : public ImmutablePass {
-private:
- bool LittleEndian; ///< Defaults to false
- unsigned char PointerMemSize; ///< Pointer size in bytes
- unsigned char PointerABIAlign; ///< Pointer ABI alignment
- unsigned char PointerPrefAlign; ///< Pointer preferred alignment
-
- //! Where the primitive type alignment data is stored.
- /*!
- @sa init().
- @note Could support multiple size pointer alignments, e.g., 32-bit pointers
- vs. 64-bit pointers by extending TargetAlignment, but for now, we don't.
- */
- SmallVector<TargetAlignElem, 16> Alignments;
- //! Alignment iterator shorthand
- typedef SmallVector<TargetAlignElem, 16>::iterator align_iterator;
- //! Constant alignment iterator shorthand
- typedef SmallVector<TargetAlignElem, 16>::const_iterator align_const_iterator;
- //! Invalid alignment.
- /*!
- This member is a signal that a requested alignment type and bit width were
- not found in the SmallVector.
- */
- static const TargetAlignElem InvalidAlignmentElem;
-
- //! Set/initialize target alignments
- void setAlignment(AlignTypeEnum align_type, unsigned char abi_align,
- unsigned char pref_align, uint32_t bit_width);
- unsigned getAlignmentInfo(AlignTypeEnum align_type, uint32_t bit_width,
- bool ABIAlign, const Type *Ty) const;
- //! Internal helper method that returns requested alignment for type.
- unsigned char getAlignment(const Type *Ty, bool abi_or_pref) const;
-
- /// Valid alignment predicate.
- ///
- /// Predicate that tests a TargetAlignElem reference returned by get() against
- /// InvalidAlignmentElem.
- inline bool validAlignment(const TargetAlignElem &align) const {
- return (&align != &InvalidAlignmentElem);
- }
-
-public:
- /// Default ctor.
- ///
- /// @note This has to exist, because this is a pass, but it should never be
- /// used.
- TargetData() : ImmutablePass(intptr_t(&ID)) {
- assert(0 && "ERROR: Bad TargetData ctor used. "
- "Tool did not specify a TargetData to use?");
- abort();
- }
-
- /// Constructs a TargetData from a specification string. See init().
- explicit TargetData(const std::string &TargetDescription)
- : ImmutablePass(intptr_t(&ID)) {
- init(TargetDescription);
- }
-
- /// Initialize target data from properties stored in the module.
- explicit TargetData(const Module *M);
-
- TargetData(const TargetData &TD) :
- ImmutablePass(intptr_t(&ID)),
- LittleEndian(TD.isLittleEndian()),
- PointerMemSize(TD.PointerMemSize),
- PointerABIAlign(TD.PointerABIAlign),
- PointerPrefAlign(TD.PointerPrefAlign),
- Alignments(TD.Alignments)
- { }
-
- ~TargetData(); // Not virtual, do not subclass this class
-
- //! Parse a target data layout string and initialize TargetData alignments.
- void init(const std::string &TargetDescription);
-
- /// Target endianness...
- bool isLittleEndian() const { return LittleEndian; }
- bool isBigEndian() const { return !LittleEndian; }
-
- /// getStringRepresentation - Return the string representation of the
- /// TargetData. This representation is in the same format accepted by the
- /// string constructor above.
- std::string getStringRepresentation() const;
- /// Target pointer alignment
- unsigned char getPointerABIAlignment() const { return PointerABIAlign; }
- /// Return target's alignment for stack-based pointers
- unsigned char getPointerPrefAlignment() const { return PointerPrefAlign; }
- /// Target pointer size
- unsigned char getPointerSize() const { return PointerMemSize; }
- /// Target pointer size, in bits
- unsigned char getPointerSizeInBits() const { return 8*PointerMemSize; }
-
- /// getTypeSizeInBits - Return the number of bits necessary to hold the
- /// specified type. For example, returns 36 for i36 and 80 for x86_fp80.
- uint64_t getTypeSizeInBits(const Type* Ty) const;
-
- /// getTypeStoreSize - Return the maximum number of bytes that may be
- /// overwritten by storing the specified type. For example, returns 5
- /// for i36 and 10 for x86_fp80.
- uint64_t getTypeStoreSize(const Type *Ty) const {
- return (getTypeSizeInBits(Ty)+7)/8;
- }
-
- /// getTypeStoreSizeInBits - Return the maximum number of bits that may be
- /// overwritten by storing the specified type; always a multiple of 8. For
- /// example, returns 40 for i36 and 80 for x86_fp80.
- uint64_t getTypeStoreSizeInBits(const Type *Ty) const {
- return 8*getTypeStoreSize(Ty);
- }
-
- /// getABITypeSize - Return the offset in bytes between successive objects
- /// of the specified type, including alignment padding. This is the amount
- /// that alloca reserves for this type. For example, returns 12 or 16 for
- /// x86_fp80, depending on alignment.
- uint64_t getABITypeSize(const Type* Ty) const {
- unsigned char Align = getABITypeAlignment(Ty);
- return (getTypeStoreSize(Ty) + Align - 1)/Align*Align;
- }
-
- /// getABITypeSizeInBits - Return the offset in bits between successive
- /// objects of the specified type, including alignment padding; always a
- /// multiple of 8. This is the amount that alloca reserves for this type.
- /// For example, returns 96 or 128 for x86_fp80, depending on alignment.
- uint64_t getABITypeSizeInBits(const Type* Ty) const {
- return 8*getABITypeSize(Ty);
- }
-
- /// getABITypeAlignment - Return the minimum ABI-required alignment for the
- /// specified type.
- unsigned char getABITypeAlignment(const Type *Ty) const;
-
- /// getCallFrameTypeAlignment - Return the minimum ABI-required alignment
- /// for the specified type when it is part of a call frame.
- unsigned char getCallFrameTypeAlignment(const Type *Ty) const;
-
-
- /// getPrefTypeAlignment - Return the preferred stack/global alignment for
- /// the specified type. This is always at least as good as the ABI alignment.
- unsigned char getPrefTypeAlignment(const Type *Ty) const;
-
- /// getPreferredTypeAlignmentShift - Return the preferred alignment for the
- /// specified type, returned as log2 of the value (a shift amount).
- ///
- unsigned char getPreferredTypeAlignmentShift(const Type *Ty) const;
-
- /// getIntPtrType - Return an unsigned integer type that is the same size or
- /// greater to the host pointer size.
- ///
- const Type *getIntPtrType() const;
-
- /// getIndexedOffset - return the offset from the beginning of the type for the
- /// specified indices. This is used to implement getelementptr.
- ///
- uint64_t getIndexedOffset(const Type *Ty,
- Value* const* Indices, unsigned NumIndices) const;
-
- /// getStructLayout - Return a StructLayout object, indicating the alignment
- /// of the struct, its size, and the offsets of its fields. Note that this
- /// information is lazily cached.
- const StructLayout *getStructLayout(const StructType *Ty) const;
-
- /// InvalidateStructLayoutInfo - TargetData speculatively caches StructLayout
- /// objects. If a TargetData object is alive when types are being refined and
- /// removed, this method must be called whenever a StructType is removed to
- /// avoid a dangling pointer in this cache.
- void InvalidateStructLayoutInfo(const StructType *Ty) const;
-
- /// getPreferredAlignment - Return the preferred alignment of the specified
- /// global. This includes an explicitly requested alignment (if the global
- /// has one).
- unsigned getPreferredAlignment(const GlobalVariable *GV) const;
-
- /// getPreferredAlignmentLog - Return the preferred alignment of the
- /// specified global, returned in log form. This includes an explicitly
- /// requested alignment (if the global has one).
- unsigned getPreferredAlignmentLog(const GlobalVariable *GV) const;
-
- static char ID; // Pass identification, replacement for typeid
-};
-
-/// StructLayout - used to lazily calculate structure layout information for a
-/// target machine, based on the TargetData structure.
-///
-class StructLayout {
- uint64_t StructSize;
- unsigned StructAlignment;
- unsigned NumElements;
- uint64_t MemberOffsets[1]; // variable sized array!
-public:
-
- uint64_t getSizeInBytes() const {
- return StructSize;
- }
-
- uint64_t getSizeInBits() const {
- return 8*StructSize;
- }
-
- unsigned getAlignment() const {
- return StructAlignment;
- }
-
- /// getElementContainingOffset - Given a valid offset into the structure,
- /// return the structure index that contains it.
- ///
- unsigned getElementContainingOffset(uint64_t Offset) const;
-
- uint64_t getElementOffset(unsigned Idx) const {
- assert(Idx < NumElements && "Invalid element idx!");
- return MemberOffsets[Idx];
- }
-
- uint64_t getElementOffsetInBits(unsigned Idx) const {
- return getElementOffset(Idx)*8;
- }
-
-private:
- friend class TargetData; // Only TargetData can create this class
- StructLayout(const StructType *ST, const TargetData &TD);
-};
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/Target/TargetELFWriterInfo.h b/release_23/include/llvm/Target/TargetELFWriterInfo.h
deleted file mode 100644
index f08e2e957c9d..000000000000
--- a/release_23/include/llvm/Target/TargetELFWriterInfo.h
+++ /dev/null
@@ -1,43 +0,0 @@
-//===-- llvm/Target/TargetELFWriterInfo.h - ELF Writer Info -----*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines the TargetELFWriterInfo class.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_TARGET_TARGETELFWRITERINFO_H
-#define LLVM_TARGET_TARGETELFWRITERINFO_H
-
-namespace llvm {
-
- class MachineBasicBlock;
-
- //===--------------------------------------------------------------------===//
- // TargetELFWriterInfo
- //===--------------------------------------------------------------------===//
-
- class TargetELFWriterInfo {
- // EMachine - This field is the target specific value to emit as the
- // e_machine member of the ELF header.
- unsigned short EMachine;
- public:
- enum MachineType {
- NoMachine,
- EM_386 = 3
- };
-
- explicit TargetELFWriterInfo(MachineType machine) : EMachine(machine) {}
- virtual ~TargetELFWriterInfo() {}
-
- unsigned short getEMachine() const { return EMachine; }
- };
-
-} // end llvm namespace
-
-#endif // LLVM_TARGET_TARGETELFWRITERINFO_H
diff --git a/release_23/include/llvm/Target/TargetFrameInfo.h b/release_23/include/llvm/Target/TargetFrameInfo.h
deleted file mode 100644
index 836d8721d601..000000000000
--- a/release_23/include/llvm/Target/TargetFrameInfo.h
+++ /dev/null
@@ -1,82 +0,0 @@
-//===-- llvm/Target/TargetFrameInfo.h ---------------------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// Interface to describe the layout of a stack frame on the target machine.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_TARGET_TARGETFRAMEINFO_H
-#define LLVM_TARGET_TARGETFRAMEINFO_H
-
-#include <utility>
-
-namespace llvm {
-
-class MachineFunction;
-
-/// Information about stack frame layout on the target. It holds the direction
-/// of stack growth, the known stack alignment on entry to each function, and
-/// the offset to the locals area.
-///
-/// The offset to the local area is the offset from the stack pointer on
-/// function entry to the first location where function data (local variables,
-/// spill locations) can be stored.
-class TargetFrameInfo {
-public:
- enum StackDirection {
- StackGrowsUp, // Adding to the stack increases the stack address
- StackGrowsDown // Adding to the stack decreases the stack address
- };
-private:
- StackDirection StackDir;
- unsigned StackAlignment;
- int LocalAreaOffset;
-public:
- TargetFrameInfo(StackDirection D, unsigned StackAl, int LAO)
- : StackDir(D), StackAlignment(StackAl), LocalAreaOffset(LAO) {}
-
- virtual ~TargetFrameInfo();
-
- // These methods return information that describes the abstract stack layout
- // of the target machine.
-
- /// getStackGrowthDirection - Return the direction the stack grows
- ///
- StackDirection getStackGrowthDirection() const { return StackDir; }
-
- /// getStackAlignment - This method returns the number of bytes that the stack
- /// pointer must be aligned to. Typically, this is the largest alignment for
- /// any data object in the target.
- ///
- unsigned getStackAlignment() const { return StackAlignment; }
-
- /// getOffsetOfLocalArea - This method returns the offset of the local area
- /// from the stack pointer on entrance to a function.
- ///
- int getOffsetOfLocalArea() const { return LocalAreaOffset; }
-
- /// getCalleeSavedSpillSlots - This method returns a pointer to an array of
- /// pairs, that contains an entry for each callee saved register that must be
- /// spilled to a particular stack location if it is spilled.
- ///
- /// Each entry in this array contains a <register,offset> pair, indicating the
- /// fixed offset from the incoming stack pointer that each register should be
- /// spilled at. If a register is not listed here, the code generator is
- /// allowed to spill it anywhere it chooses.
- ///
- virtual const std::pair<unsigned, int> *
- getCalleeSavedSpillSlots(unsigned &NumEntries) const {
- NumEntries = 0;
- return 0;
- }
-};
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/Target/TargetInstrDesc.h b/release_23/include/llvm/Target/TargetInstrDesc.h
deleted file mode 100644
index dbfd55a7fb85..000000000000
--- a/release_23/include/llvm/Target/TargetInstrDesc.h
+++ /dev/null
@@ -1,394 +0,0 @@
-//===-- llvm/Target/TargetInstrDesc.h - Instruction Descriptors -*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines the TargetOperandInfo and TargetInstrDesc classes, which
-// are used to describe target instructions and their operands.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_TARGET_TARGETINSTRDESC_H
-#define LLVM_TARGET_TARGETINSTRDESC_H
-
-#include <cassert>
-
-namespace llvm {
-
-//===----------------------------------------------------------------------===//
-// Machine Operand Flags and Description
-//===----------------------------------------------------------------------===//
-
-namespace TOI {
- // Operand constraints: only "tied_to" for now.
- enum OperandConstraint {
- TIED_TO = 0 // Must be allocated the same register as.
- };
-
- /// OperandFlags - These are flags set on operands, but should be considered
- /// private, all access should go through the TargetOperandInfo accessors.
- /// See the accessors for a description of what these are.
- enum OperandFlags {
- LookupPtrRegClass = 0,
- Predicate,
- OptionalDef
- };
-}
-
-/// TargetOperandInfo - This holds information about one operand of a machine
-/// instruction, indicating the register class for register operands, etc.
-///
-class TargetOperandInfo {
-public:
- /// RegClass - This specifies the register class enumeration of the operand
- /// if the operand is a register. If not, this contains 0.
- unsigned short RegClass;
- unsigned short Flags;
- /// Lower 16 bits are used to specify which constraints are set. The higher 16
- /// bits are used to specify the value of constraints (4 bits each).
- unsigned int Constraints;
- /// Currently no other information.
-
- /// isLookupPtrRegClass - Set if this operand is a pointer value and it
- /// requires a callback to look up its register class.
- bool isLookupPtrRegClass() const { return Flags&(1 <<TOI::LookupPtrRegClass);}
-
- /// isPredicate - Set if this is one of the operands that made up of
- /// the predicate operand that controls an isPredicable() instruction.
- bool isPredicate() const { return Flags & (1 << TOI::Predicate); }
-
- /// isOptionalDef - Set if this operand is a optional def.
- ///
- bool isOptionalDef() const { return Flags & (1 << TOI::OptionalDef); }
-};
-
-
-//===----------------------------------------------------------------------===//
-// Machine Instruction Flags and Description
-//===----------------------------------------------------------------------===//
-
-/// TargetInstrDesc flags - These should be considered private to the
-/// implementation of the TargetInstrDesc class. Clients should use the
-/// predicate methods on TargetInstrDesc, not use these directly. These
-/// all correspond to bitfields in the TargetInstrDesc::Flags field.
-namespace TID {
- enum {
- Variadic = 0,
- HasOptionalDef,
- Return,
- Call,
- Barrier,
- Terminator,
- Branch,
- IndirectBranch,
- Predicable,
- NotDuplicable,
- DelaySlot,
- SimpleLoad,
- MayLoad,
- MayStore,
- UnmodeledSideEffects,
- Commutable,
- ConvertibleTo3Addr,
- UsesCustomDAGSchedInserter,
- Rematerializable
- };
-}
-
-/// TargetInstrDesc - Describe properties that are true of each
-/// instruction in the target description file. This captures information about
-/// side effects, register use and many other things. There is one instance of
-/// this struct for each target instruction class, and the MachineInstr class
-/// points to this struct directly to describe itself.
-class TargetInstrDesc {
-public:
- unsigned short Opcode; // The opcode number.
- unsigned short NumOperands; // Num of args (may be more if variable_ops)
- unsigned short NumDefs; // Num of args that are definitions.
- unsigned short SchedClass; // enum identifying instr sched class
- const char * Name; // Name of the instruction record in td file.
- unsigned Flags; // flags identifying machine instr class
- unsigned TSFlags; // Target Specific Flag values
- const unsigned *ImplicitUses; // Registers implicitly read by this instr
- const unsigned *ImplicitDefs; // Registers implicitly defined by this instr
- const TargetOperandInfo *OpInfo; // 'NumOperands' entries about operands.
-
- /// getOperandConstraint - Returns the value of the specific constraint if
- /// it is set. Returns -1 if it is not set.
- int getOperandConstraint(unsigned OpNum,
- TOI::OperandConstraint Constraint) const {
- if (OpNum < NumOperands &&
- (OpInfo[OpNum].Constraints & (1 << Constraint))) {
- unsigned Pos = 16 + Constraint * 4;
- return (int)(OpInfo[OpNum].Constraints >> Pos) & 0xf;
- }
- return -1;
- }
-
- /// findTiedToSrcOperand - Returns the operand that is tied to the specified
- /// dest operand. Returns -1 if there isn't one.
- int findTiedToSrcOperand(unsigned OpNum) const;
-
- /// getOpcode - Return the opcode number for this descriptor.
- unsigned getOpcode() const {
- return Opcode;
- }
-
- /// getName - Return the name of the record in the .td file for this
- /// instruction, for example "ADD8ri".
- const char *getName() const {
- return Name;
- }
-
- /// getNumOperands - Return the number of declared MachineOperands for this
- /// MachineInstruction. Note that variadic (isVariadic() returns true)
- /// instructions may have additional operands at the end of the list, and note
- /// that the machine instruction may include implicit register def/uses as
- /// well.
- unsigned getNumOperands() const {
- return NumOperands;
- }
-
- /// getNumDefs - Return the number of MachineOperands that are register
- /// definitions. Register definitions always occur at the start of the
- /// machine operand list. This is the number of "outs" in the .td file.
- unsigned getNumDefs() const {
- return NumDefs;
- }
-
- /// isVariadic - Return true if this instruction can have a variable number of
- /// operands. In this case, the variable operands will be after the normal
- /// operands but before the implicit definitions and uses (if any are
- /// present).
- bool isVariadic() const {
- return Flags & (1 << TID::Variadic);
- }
-
- /// hasOptionalDef - Set if this instruction has an optional definition, e.g.
- /// ARM instructions which can set condition code if 's' bit is set.
- bool hasOptionalDef() const {
- return Flags & (1 << TID::HasOptionalDef);
- }
-
- /// getImplicitUses - Return a list of registers that are potentially
- /// read by any instance of this machine instruction. For example, on X86,
- /// the "adc" instruction adds two register operands and adds the carry bit in
- /// from the flags register. In this case, the instruction is marked as
- /// implicitly reading the flags. Likewise, the variable shift instruction on
- /// X86 is marked as implicitly reading the 'CL' register, which it always
- /// does.
- ///
- /// This method returns null if the instruction has no implicit uses.
- const unsigned *getImplicitUses() const {
- return ImplicitUses;
- }
-
- /// getImplicitDefs - Return a list of registers that are potentially
- /// written by any instance of this machine instruction. For example, on X86,
- /// many instructions implicitly set the flags register. In this case, they
- /// are marked as setting the FLAGS. Likewise, many instructions always
- /// deposit their result in a physical register. For example, the X86 divide
- /// instruction always deposits the quotient and remainder in the EAX/EDX
- /// registers. For that instruction, this will return a list containing the
- /// EAX/EDX/EFLAGS registers.
- ///
- /// This method returns null if the instruction has no implicit defs.
- const unsigned *getImplicitDefs() const {
- return ImplicitDefs;
- }
-
- /// getSchedClass - Return the scheduling class for this instruction. The
- /// scheduling class is an index into the InstrItineraryData table. This
- /// returns zero if there is no known scheduling information for the
- /// instruction.
- ///
- unsigned getSchedClass() const {
- return SchedClass;
- }
-
- bool isReturn() const {
- return Flags & (1 << TID::Return);
- }
-
- bool isCall() const {
- return Flags & (1 << TID::Call);
- }
-
- /// isBarrier - Returns true if the specified instruction stops control flow
- /// from executing the instruction immediately following it. Examples include
- /// unconditional branches and return instructions.
- bool isBarrier() const {
- return Flags & (1 << TID::Barrier);
- }
-
- /// isTerminator - Returns true if this instruction part of the terminator for
- /// a basic block. Typically this is things like return and branch
- /// instructions.
- ///
- /// Various passes use this to insert code into the bottom of a basic block,
- /// but before control flow occurs.
- bool isTerminator() const {
- return Flags & (1 << TID::Terminator);
- }
-
- /// isBranch - Returns true if this is a conditional, unconditional, or
- /// indirect branch. Predicates below can be used to discriminate between
- /// these cases, and the TargetInstrInfo::AnalyzeBranch method can be used to
- /// get more information.
- bool isBranch() const {
- return Flags & (1 << TID::Branch);
- }
-
- /// isIndirectBranch - Return true if this is an indirect branch, such as a
- /// branch through a register.
- bool isIndirectBranch() const {
- return Flags & (1 << TID::IndirectBranch);
- }
-
- /// isConditionalBranch - Return true if this is a branch which may fall
- /// through to the next instruction or may transfer control flow to some other
- /// block. The TargetInstrInfo::AnalyzeBranch method can be used to get more
- /// information about this branch.
- bool isConditionalBranch() const {
- return isBranch() & !isBarrier() & !isIndirectBranch();
- }
-
- /// isUnconditionalBranch - Return true if this is a branch which always
- /// transfers control flow to some other block. The
- /// TargetInstrInfo::AnalyzeBranch method can be used to get more information
- /// about this branch.
- bool isUnconditionalBranch() const {
- return isBranch() & isBarrier() & !isIndirectBranch();
- }
-
- // isPredicable - Return true if this instruction has a predicate operand that
- // controls execution. It may be set to 'always', or may be set to other
- /// values. There are various methods in TargetInstrInfo that can be used to
- /// control and modify the predicate in this instruction.
- bool isPredicable() const {
- return Flags & (1 << TID::Predicable);
- }
-
- /// isNotDuplicable - Return true if this instruction cannot be safely
- /// duplicated. For example, if the instruction has a unique labels attached
- /// to it, duplicating it would cause multiple definition errors.
- bool isNotDuplicable() const {
- return Flags & (1 << TID::NotDuplicable);
- }
-
- /// hasDelaySlot - Returns true if the specified instruction has a delay slot
- /// which must be filled by the code generator.
- bool hasDelaySlot() const {
- return Flags & (1 << TID::DelaySlot);
- }
-
- /// isSimpleLoad - Return true for instructions that are simple loads from
- /// memory. This should only be set on instructions that load a value from
- /// memory and return it in their only virtual register definition.
- /// Instructions that return a value loaded from memory and then modified in
- /// some way should not return true for this.
- bool isSimpleLoad() const {
- return Flags & (1 << TID::SimpleLoad);
- }
-
- //===--------------------------------------------------------------------===//
- // Side Effect Analysis
- //===--------------------------------------------------------------------===//
-
- /// mayLoad - Return true if this instruction could possibly read memory.
- /// Instructions with this flag set are not necessarily simple load
- /// instructions, they may load a value and modify it, for example.
- bool mayLoad() const {
- return Flags & (1 << TID::MayLoad);
- }
-
-
- /// mayStore - Return true if this instruction could possibly modify memory.
- /// Instructions with this flag set are not necessarily simple store
- /// instructions, they may store a modified value based on their operands, or
- /// may not actually modify anything, for example.
- bool mayStore() const {
- return Flags & (1 << TID::MayStore);
- }
-
- /// hasUnmodeledSideEffects - Return true if this instruction has side
- /// effects that are not modeled by other flags. This does not return true
- /// for instructions whose effects are captured by:
- ///
- /// 1. Their operand list and implicit definition/use list. Register use/def
- /// info is explicit for instructions.
- /// 2. Memory accesses. Use mayLoad/mayStore.
- /// 3. Calling, branching, returning: use isCall/isReturn/isBranch.
- ///
- /// Examples of side effects would be modifying 'invisible' machine state like
- /// a control register, flushing a cache, modifying a register invisible to
- /// LLVM, etc.
- ///
- bool hasUnmodeledSideEffects() const {
- return Flags & (1 << TID::UnmodeledSideEffects);
- }
-
- //===--------------------------------------------------------------------===//
- // Flags that indicate whether an instruction can be modified by a method.
- //===--------------------------------------------------------------------===//
-
- /// isCommutable - Return true if this may be a 2- or 3-address
- /// instruction (of the form "X = op Y, Z, ..."), which produces the same
- /// result if Y and Z are exchanged. If this flag is set, then the
- /// TargetInstrInfo::commuteInstruction method may be used to hack on the
- /// instruction.
- ///
- /// Note that this flag may be set on instructions that are only commutable
- /// sometimes. In these cases, the call to commuteInstruction will fail.
- /// Also note that some instructions require non-trivial modification to
- /// commute them.
- bool isCommutable() const {
- return Flags & (1 << TID::Commutable);
- }
-
- /// isConvertibleTo3Addr - Return true if this is a 2-address instruction
- /// which can be changed into a 3-address instruction if needed. Doing this
- /// transformation can be profitable in the register allocator, because it
- /// means that the instruction can use a 2-address form if possible, but
- /// degrade into a less efficient form if the source and dest register cannot
- /// be assigned to the same register. For example, this allows the x86
- /// backend to turn a "shl reg, 3" instruction into an LEA instruction, which
- /// is the same speed as the shift but has bigger code size.
- ///
- /// If this returns true, then the target must implement the
- /// TargetInstrInfo::convertToThreeAddress method for this instruction, which
- /// is allowed to fail if the transformation isn't valid for this specific
- /// instruction (e.g. shl reg, 4 on x86).
- ///
- bool isConvertibleTo3Addr() const {
- return Flags & (1 << TID::ConvertibleTo3Addr);
- }
-
- /// usesCustomDAGSchedInsertionHook - Return true if this instruction requires
- /// custom insertion support when the DAG scheduler is inserting it into a
- /// machine basic block. If this is true for the instruction, it basically
- /// means that it is a pseudo instruction used at SelectionDAG time that is
- /// expanded out into magic code by the target when MachineInstrs are formed.
- ///
- /// If this is true, the TargetLoweringInfo::InsertAtEndOfBasicBlock method
- /// is used to insert this into the MachineBasicBlock.
- bool usesCustomDAGSchedInsertionHook() const {
- return Flags & (1 << TID::UsesCustomDAGSchedInserter);
- }
-
- /// isRematerializable - Returns true if this instruction is a candidate for
- /// remat. This flag is deprecated, please don't use it anymore. If this
- /// flag is set, the isReallyTriviallyReMaterializable() method is called to
- /// verify the instruction is really rematable.
- bool isRematerializable() const {
- return Flags & (1 << TID::Rematerializable);
- }
-};
-
-} // end namespace llvm
-
-#endif
diff --git a/release_23/include/llvm/Target/TargetInstrInfo.h b/release_23/include/llvm/Target/TargetInstrInfo.h
deleted file mode 100644
index ca35fa7850c7..000000000000
--- a/release_23/include/llvm/Target/TargetInstrInfo.h
+++ /dev/null
@@ -1,428 +0,0 @@
-//===-- llvm/Target/TargetInstrInfo.h - Instruction Info --------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file describes the target machine instructions to the code generator.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_TARGET_TARGETINSTRINFO_H
-#define LLVM_TARGET_TARGETINSTRINFO_H
-
-#include "llvm/Target/TargetInstrDesc.h"
-#include "llvm/CodeGen/MachineFunction.h"
-
-namespace llvm {
-
-class TargetRegisterClass;
-class LiveVariables;
-class CalleeSavedInfo;
-class SDNode;
-class SelectionDAG;
-
-template<class T> class SmallVectorImpl;
-
-
-//---------------------------------------------------------------------------
-///
-/// TargetInstrInfo - Interface to description of machine instructions
-///
-class TargetInstrInfo {
- const TargetInstrDesc *Descriptors; // Raw array to allow static init'n
- unsigned NumOpcodes; // Number of entries in the desc array
-
- TargetInstrInfo(const TargetInstrInfo &); // DO NOT IMPLEMENT
- void operator=(const TargetInstrInfo &); // DO NOT IMPLEMENT
-public:
- TargetInstrInfo(const TargetInstrDesc *desc, unsigned NumOpcodes);
- virtual ~TargetInstrInfo();
-
- // Invariant opcodes: All instruction sets have these as their low opcodes.
- enum {
- PHI = 0,
- INLINEASM = 1,
- LABEL = 2,
- DECLARE = 3,
- EXTRACT_SUBREG = 4,
- INSERT_SUBREG = 5,
- IMPLICIT_DEF = 6,
- SUBREG_TO_REG = 7
- };
-
- unsigned getNumOpcodes() const { return NumOpcodes; }
-
- /// get - Return the machine instruction descriptor that corresponds to the
- /// specified instruction opcode.
- ///
- const TargetInstrDesc &get(unsigned Opcode) const {
- assert(Opcode < NumOpcodes && "Invalid opcode!");
- return Descriptors[Opcode];
- }
-
- /// isTriviallyReMaterializable - Return true if the instruction is trivially
- /// rematerializable, meaning it has no side effects and requires no operands
- /// that aren't always available.
- bool isTriviallyReMaterializable(MachineInstr *MI) const {
- return MI->getDesc().isRematerializable() &&
- isReallyTriviallyReMaterializable(MI);
- }
-
-protected:
- /// isReallyTriviallyReMaterializable - For instructions with opcodes for
- /// which the M_REMATERIALIZABLE flag is set, this function tests whether the
- /// instruction itself is actually trivially rematerializable, considering
- /// its operands. This is used for targets that have instructions that are
- /// only trivially rematerializable for specific uses. This predicate must
- /// return false if the instruction has any side effects other than
- /// producing a value, or if it requres any address registers that are not
- /// always available.
- virtual bool isReallyTriviallyReMaterializable(MachineInstr *MI) const {
- return true;
- }
-
-public:
- /// Return true if the instruction is a register to register move
- /// and leave the source and dest operands in the passed parameters.
- virtual bool isMoveInstr(const MachineInstr& MI,
- unsigned& sourceReg,
- unsigned& destReg) const {
- return false;
- }
-
- /// isLoadFromStackSlot - If the specified machine instruction is a direct
- /// load from a stack slot, return the virtual or physical register number of
- /// the destination along with the FrameIndex of the loaded stack slot. If
- /// not, return 0. This predicate must return 0 if the instruction has
- /// any side effects other than loading from the stack slot.
- virtual unsigned isLoadFromStackSlot(MachineInstr *MI, int &FrameIndex) const{
- return 0;
- }
-
- /// isStoreToStackSlot - If the specified machine instruction is a direct
- /// store to a stack slot, return the virtual or physical register number of
- /// the source reg along with the FrameIndex of the loaded stack slot. If
- /// not, return 0. This predicate must return 0 if the instruction has
- /// any side effects other than storing to the stack slot.
- virtual unsigned isStoreToStackSlot(MachineInstr *MI, int &FrameIndex) const {
- return 0;
- }
-
- /// reMaterialize - Re-issue the specified 'original' instruction at the
- /// specific location targeting a new destination register.
- virtual void reMaterialize(MachineBasicBlock &MBB,
- MachineBasicBlock::iterator MI,
- unsigned DestReg,
- const MachineInstr *Orig) const = 0;
-
- /// isInvariantLoad - Return true if the specified instruction (which is
- /// marked mayLoad) is loading from a location whose value is invariant across
- /// the function. For example, loading a value from the constant pool or from
- /// from the argument area of a function if it does not change. This should
- /// only return true of *all* loads the instruction does are invariant (if it
- /// does multiple loads).
- virtual bool isInvariantLoad(MachineInstr *MI) const {
- return false;
- }
-
- /// convertToThreeAddress - This method must be implemented by targets that
- /// set the M_CONVERTIBLE_TO_3_ADDR flag. When this flag is set, the target
- /// may be able to convert a two-address instruction into one or more true
- /// three-address instructions on demand. This allows the X86 target (for
- /// example) to convert ADD and SHL instructions into LEA instructions if they
- /// would require register copies due to two-addressness.
- ///
- /// This method returns a null pointer if the transformation cannot be
- /// performed, otherwise it returns the last new instruction.
- ///
- virtual MachineInstr *
- convertToThreeAddress(MachineFunction::iterator &MFI,
- MachineBasicBlock::iterator &MBBI, LiveVariables &LV) const {
- return 0;
- }
-
- /// commuteInstruction - If a target has any instructions that are commutable,
- /// but require converting to a different instruction or making non-trivial
- /// changes to commute them, this method can overloaded to do this. The
- /// default implementation of this method simply swaps the first two operands
- /// of MI and returns it.
- ///
- /// If a target wants to make more aggressive changes, they can construct and
- /// return a new machine instruction. If an instruction cannot commute, it
- /// can also return null.
- ///
- virtual MachineInstr *commuteInstruction(MachineInstr *MI) const = 0;
-
- /// CommuteChangesDestination - Return true if commuting the specified
- /// instruction will also changes the destination operand. Also return the
- /// current operand index of the would be new destination register by
- /// reference. This can happen when the commutable instruction is also a
- /// two-address instruction.
- virtual bool CommuteChangesDestination(MachineInstr *MI,
- unsigned &OpIdx) const = 0;
-
- /// AnalyzeBranch - Analyze the branching code at the end of MBB, returning
- /// true if it cannot be understood (e.g. it's a switch dispatch or isn't
- /// implemented for a target). Upon success, this returns false and returns
- /// with the following information in various cases:
- ///
- /// 1. If this block ends with no branches (it just falls through to its succ)
- /// just return false, leaving TBB/FBB null.
- /// 2. If this block ends with only an unconditional branch, it sets TBB to be
- /// the destination block.
- /// 3. If this block ends with an conditional branch and it falls through to
- /// an successor block, it sets TBB to be the branch destination block and a
- /// list of operands that evaluate the condition. These
- /// operands can be passed to other TargetInstrInfo methods to create new
- /// branches.
- /// 4. If this block ends with an conditional branch and an unconditional
- /// block, it returns the 'true' destination in TBB, the 'false' destination
- /// in FBB, and a list of operands that evaluate the condition. These
- /// operands can be passed to other TargetInstrInfo methods to create new
- /// branches.
- ///
- /// Note that RemoveBranch and InsertBranch must be implemented to support
- /// cases where this method returns success.
- ///
- virtual bool AnalyzeBranch(MachineBasicBlock &MBB, MachineBasicBlock *&TBB,
- MachineBasicBlock *&FBB,
- std::vector<MachineOperand> &Cond) const {
- return true;
- }
-
- /// RemoveBranch - Remove the branching code at the end of the specific MBB.
- /// this is only invoked in cases where AnalyzeBranch returns success. It
- /// returns the number of instructions that were removed.
- virtual unsigned RemoveBranch(MachineBasicBlock &MBB) const {
- assert(0 && "Target didn't implement TargetInstrInfo::RemoveBranch!");
- return 0;
- }
-
- /// InsertBranch - Insert a branch into the end of the specified
- /// MachineBasicBlock. This operands to this method are the same as those
- /// returned by AnalyzeBranch. This is invoked in cases where AnalyzeBranch
- /// returns success and when an unconditional branch (TBB is non-null, FBB is
- /// null, Cond is empty) needs to be inserted. It returns the number of
- /// instructions inserted.
- virtual unsigned InsertBranch(MachineBasicBlock &MBB, MachineBasicBlock *TBB,
- MachineBasicBlock *FBB,
- const std::vector<MachineOperand> &Cond) const {
- assert(0 && "Target didn't implement TargetInstrInfo::InsertBranch!");
- return 0;
- }
-
- /// copyRegToReg - Add a copy between a pair of registers
- virtual void copyRegToReg(MachineBasicBlock &MBB,
- MachineBasicBlock::iterator MI,
- unsigned DestReg, unsigned SrcReg,
- const TargetRegisterClass *DestRC,
- const TargetRegisterClass *SrcRC) const {
- assert(0 && "Target didn't implement TargetInstrInfo::copyRegToReg!");
- }
-
- virtual void storeRegToStackSlot(MachineBasicBlock &MBB,
- MachineBasicBlock::iterator MI,
- unsigned SrcReg, bool isKill, int FrameIndex,
- const TargetRegisterClass *RC) const {
- assert(0 && "Target didn't implement TargetInstrInfo::storeRegToStackSlot!");
- }
-
- virtual void storeRegToAddr(MachineFunction &MF, unsigned SrcReg, bool isKill,
- SmallVectorImpl<MachineOperand> &Addr,
- const TargetRegisterClass *RC,
- SmallVectorImpl<MachineInstr*> &NewMIs) const {
- assert(0 && "Target didn't implement TargetInstrInfo::storeRegToAddr!");
- }
-
- virtual void loadRegFromStackSlot(MachineBasicBlock &MBB,
- MachineBasicBlock::iterator MI,
- unsigned DestReg, int FrameIndex,
- const TargetRegisterClass *RC) const {
- assert(0 && "Target didn't implement TargetInstrInfo::loadRegFromStackSlot!");
- }
-
- virtual void loadRegFromAddr(MachineFunction &MF, unsigned DestReg,
- SmallVectorImpl<MachineOperand> &Addr,
- const TargetRegisterClass *RC,
- SmallVectorImpl<MachineInstr*> &NewMIs) const {
- assert(0 && "Target didn't implement TargetInstrInfo::loadRegFromAddr!");
- }
-
- /// spillCalleeSavedRegisters - Issues instruction(s) to spill all callee
- /// saved registers and returns true if it isn't possible / profitable to do
- /// so by issuing a series of store instructions via
- /// storeRegToStackSlot(). Returns false otherwise.
- virtual bool spillCalleeSavedRegisters(MachineBasicBlock &MBB,
- MachineBasicBlock::iterator MI,
- const std::vector<CalleeSavedInfo> &CSI) const {
- return false;
- }
-
- /// restoreCalleeSavedRegisters - Issues instruction(s) to restore all callee
- /// saved registers and returns true if it isn't possible / profitable to do
- /// so by issuing a series of load instructions via loadRegToStackSlot().
- /// Returns false otherwise.
- virtual bool restoreCalleeSavedRegisters(MachineBasicBlock &MBB,
- MachineBasicBlock::iterator MI,
- const std::vector<CalleeSavedInfo> &CSI) const {
- return false;
- }
-
- /// foldMemoryOperand - Attempt to fold a load or store of the specified stack
- /// slot into the specified machine instruction for the specified operand(s).
- /// If this is possible, a new instruction is returned with the specified
- /// operand folded, otherwise NULL is returned. The client is responsible for
- /// removing the old instruction and adding the new one in the instruction
- /// stream.
- virtual MachineInstr* foldMemoryOperand(MachineFunction &MF,
- MachineInstr* MI,
- SmallVectorImpl<unsigned> &Ops,
- int FrameIndex) const {
- return 0;
- }
-
- /// foldMemoryOperand - Same as the previous version except it allows folding
- /// of any load and store from / to any address, not just from a specific
- /// stack slot.
- virtual MachineInstr* foldMemoryOperand(MachineFunction &MF,
- MachineInstr* MI,
- SmallVectorImpl<unsigned> &Ops,
- MachineInstr* LoadMI) const {
- return 0;
- }
-
- /// canFoldMemoryOperand - Returns true if the specified load / store is
- /// folding is possible.
- virtual
- bool canFoldMemoryOperand(MachineInstr *MI,
- SmallVectorImpl<unsigned> &Ops) const{
- return false;
- }
-
- /// unfoldMemoryOperand - Separate a single instruction which folded a load or
- /// a store or a load and a store into two or more instruction. If this is
- /// possible, returns true as well as the new instructions by reference.
- virtual bool unfoldMemoryOperand(MachineFunction &MF, MachineInstr *MI,
- unsigned Reg, bool UnfoldLoad, bool UnfoldStore,
- SmallVectorImpl<MachineInstr*> &NewMIs) const{
- return false;
- }
-
- virtual bool unfoldMemoryOperand(SelectionDAG &DAG, SDNode *N,
- SmallVectorImpl<SDNode*> &NewNodes) const {
- return false;
- }
-
- /// getOpcodeAfterMemoryUnfold - Returns the opcode of the would be new
- /// instruction after load / store are unfolded from an instruction of the
- /// specified opcode. It returns zero if the specified unfolding is not
- /// possible.
- virtual unsigned getOpcodeAfterMemoryUnfold(unsigned Opc,
- bool UnfoldLoad, bool UnfoldStore) const {
- return 0;
- }
-
- /// BlockHasNoFallThrough - Return true if the specified block does not
- /// fall-through into its successor block. This is primarily used when a
- /// branch is unanalyzable. It is useful for things like unconditional
- /// indirect branches (jump tables).
- virtual bool BlockHasNoFallThrough(MachineBasicBlock &MBB) const {
- return false;
- }
-
- /// ReverseBranchCondition - Reverses the branch condition of the specified
- /// condition list, returning false on success and true if it cannot be
- /// reversed.
- virtual bool ReverseBranchCondition(std::vector<MachineOperand> &Cond) const {
- return true;
- }
-
- /// insertNoop - Insert a noop into the instruction stream at the specified
- /// point.
- virtual void insertNoop(MachineBasicBlock &MBB,
- MachineBasicBlock::iterator MI) const {
- assert(0 && "Target didn't implement insertNoop!");
- abort();
- }
-
- /// isPredicated - Returns true if the instruction is already predicated.
- ///
- virtual bool isPredicated(const MachineInstr *MI) const {
- return false;
- }
-
- /// isUnpredicatedTerminator - Returns true if the instruction is a
- /// terminator instruction that has not been predicated.
- virtual bool isUnpredicatedTerminator(const MachineInstr *MI) const;
-
- /// PredicateInstruction - Convert the instruction into a predicated
- /// instruction. It returns true if the operation was successful.
- virtual
- bool PredicateInstruction(MachineInstr *MI,
- const std::vector<MachineOperand> &Pred) const = 0;
-
- /// SubsumesPredicate - Returns true if the first specified predicate
- /// subsumes the second, e.g. GE subsumes GT.
- virtual
- bool SubsumesPredicate(const std::vector<MachineOperand> &Pred1,
- const std::vector<MachineOperand> &Pred2) const {
- return false;
- }
-
- /// DefinesPredicate - If the specified instruction defines any predicate
- /// or condition code register(s) used for predication, returns true as well
- /// as the definition predicate(s) by reference.
- virtual bool DefinesPredicate(MachineInstr *MI,
- std::vector<MachineOperand> &Pred) const {
- return false;
- }
-
- /// getPointerRegClass - Returns a TargetRegisterClass used for pointer
- /// values.
- virtual const TargetRegisterClass *getPointerRegClass() const {
- assert(0 && "Target didn't implement getPointerRegClass!");
- abort();
- return 0; // Must return a value in order to compile with VS 2005
- }
-
- /// GetInstSize - Returns the size of the specified Instruction.
- ///
- virtual unsigned GetInstSizeInBytes(const MachineInstr *MI) const {
- assert(0 && "Target didn't implement TargetInstrInfo::GetInstSize!");
- return 0;
- }
-
- /// GetFunctionSizeInBytes - Returns the size of the specified MachineFunction.
- ///
- virtual unsigned GetFunctionSizeInBytes(const MachineFunction &MF) const = 0;
-
-};
-
-/// TargetInstrInfoImpl - This is the default implementation of
-/// TargetInstrInfo, which just provides a couple of default implementations
-/// for various methods. This separated out because it is implemented in
-/// libcodegen, not in libtarget.
-class TargetInstrInfoImpl : public TargetInstrInfo {
-protected:
- TargetInstrInfoImpl(const TargetInstrDesc *desc, unsigned NumOpcodes)
- : TargetInstrInfo(desc, NumOpcodes) {}
-public:
- virtual MachineInstr *commuteInstruction(MachineInstr *MI) const;
- virtual bool CommuteChangesDestination(MachineInstr *MI,
- unsigned &OpIdx) const;
- virtual bool PredicateInstruction(MachineInstr *MI,
- const std::vector<MachineOperand> &Pred) const;
- virtual void reMaterialize(MachineBasicBlock &MBB,
- MachineBasicBlock::iterator MI,
- unsigned DestReg,
- const MachineInstr *Orig) const;
- virtual unsigned GetFunctionSizeInBytes(const MachineFunction &MF) const;
-};
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/Target/TargetInstrItineraries.h b/release_23/include/llvm/Target/TargetInstrItineraries.h
deleted file mode 100644
index dbf2b65b9a9f..000000000000
--- a/release_23/include/llvm/Target/TargetInstrItineraries.h
+++ /dev/null
@@ -1,85 +0,0 @@
-//===-- llvm/Target/TargetInstrItineraries.h - Scheduling -------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file describes the structures used for instruction itineraries and
-// states. This is used by schedulers to determine instruction states and
-// latencies.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_TARGET_TARGETINSTRITINERARIES_H
-#define LLVM_TARGET_TARGETINSTRITINERARIES_H
-
-namespace llvm {
-
-//===----------------------------------------------------------------------===//
-// Instruction stage - These values represent a step in the execution of an
-// instruction. The latency represents the number of discrete time slots used
-// need to complete the stage. Units represent the choice of functional units
-// that can be used to complete the stage. Eg. IntUnit1, IntUnit2.
-//
-struct InstrStage {
- unsigned Cycles; // Length of stage in machine cycles
- unsigned Units; // Choice of functional units
-};
-
-
-//===----------------------------------------------------------------------===//
-// Instruction itinerary - An itinerary represents a sequential series of steps
-// required to complete an instruction. Itineraries are represented as
-// sequences of instruction stages.
-//
-struct InstrItinerary {
- unsigned First; // Index of first stage in itinerary
- unsigned Last; // Index of last + 1 stage in itinerary
-};
-
-
-
-//===----------------------------------------------------------------------===//
-// Instruction itinerary Data - Itinerary data supplied by a subtarget to be
-// used by a target.
-//
-struct InstrItineraryData {
- const InstrStage *Stages; // Array of stages selected
- const InstrItinerary *Itineratries; // Array of itineraries selected
-
-//
-// Ctors.
-//
- InstrItineraryData() : Stages(0), Itineratries(0) {}
- InstrItineraryData(const InstrStage *S, const InstrItinerary *I)
- : Stages(S), Itineratries(I) {}
-
- //
- // isEmpty - Returns true if there are no itineraries.
- //
- inline bool isEmpty() const { return Itineratries == 0; }
-
- //
- // begin - Return the first stage of the itinerary.
- //
- inline const InstrStage *begin(unsigned ItinClassIndx) const {
- unsigned StageIdx = Itineratries[ItinClassIndx].First;
- return Stages + StageIdx;
- }
-
- //
- // end - Return the last+1 stage of the itinerary.
- //
- inline const InstrStage *end(unsigned ItinClassIndx) const {
- unsigned StageIdx = Itineratries[ItinClassIndx].Last;
- return Stages + StageIdx;
- }
-};
-
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/Target/TargetJITInfo.h b/release_23/include/llvm/Target/TargetJITInfo.h
deleted file mode 100644
index 918319f11cc6..000000000000
--- a/release_23/include/llvm/Target/TargetJITInfo.h
+++ /dev/null
@@ -1,107 +0,0 @@
-//===- Target/TargetJITInfo.h - Target Information for JIT ------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file exposes an abstract interface used by the Just-In-Time code
-// generator to perform target-specific activities, such as emitting stubs. If
-// a TargetMachine supports JIT code generation, it should provide one of these
-// objects through the getJITInfo() method.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_TARGET_TARGETJITINFO_H
-#define LLVM_TARGET_TARGETJITINFO_H
-
-#include <vector>
-#include <cassert>
-#include "llvm/Support/DataTypes.h"
-
-namespace llvm {
- class Function;
- class GlobalValue;
- class MachineBasicBlock;
- class MachineCodeEmitter;
- class MachineRelocation;
-
- /// TargetJITInfo - Target specific information required by the Just-In-Time
- /// code generator.
- class TargetJITInfo {
- public:
- virtual ~TargetJITInfo() {}
-
- /// replaceMachineCodeForFunction - Make it so that calling the function
- /// whose machine code is at OLD turns into a call to NEW, perhaps by
- /// overwriting OLD with a branch to NEW. This is used for self-modifying
- /// code.
- ///
- virtual void replaceMachineCodeForFunction(void *Old, void *New) = 0;
-
- /// emitGlobalValueLazyPtr - Use the specified MachineCodeEmitter object to
- /// emit a lazy pointer which contains the address of the specified ptr.
- virtual void *emitGlobalValueLazyPtr(const GlobalValue* GV, void *ptr,
- MachineCodeEmitter &MCE) {
- assert(0 && "This target doesn't implement emitGlobalValueLazyPtr!");
- return 0;
- }
-
- /// emitFunctionStub - Use the specified MachineCodeEmitter object to emit a
- /// small native function that simply calls the function at the specified
- /// address. Return the address of the resultant function.
- virtual void *emitFunctionStub(const Function* F, void *Fn,
- MachineCodeEmitter &MCE) {
- assert(0 && "This target doesn't implement emitFunctionStub!");
- return 0;
- }
-
- /// getPICJumpTableEntry - Returns the value of the jumptable entry for the
- /// specific basic block.
- virtual intptr_t getPICJumpTableEntry(intptr_t BB, intptr_t JTBase) {
- assert(0 && "This target doesn't implement getPICJumpTableEntry!");
- return 0;
- }
-
- /// LazyResolverFn - This typedef is used to represent the function that
- /// unresolved call points should invoke. This is a target specific
- /// function that knows how to walk the stack and find out which stub the
- /// call is coming from.
- typedef void (*LazyResolverFn)();
-
- /// JITCompilerFn - This typedef is used to represent the JIT function that
- /// lazily compiles the function corresponding to a stub. The JIT keeps
- /// track of the mapping between stubs and LLVM Functions, the target
- /// provides the ability to figure out the address of a stub that is called
- /// by the LazyResolverFn.
- typedef void* (*JITCompilerFn)(void *);
-
- /// getLazyResolverFunction - This method is used to initialize the JIT,
- /// giving the target the function that should be used to compile a
- /// function, and giving the JIT the target function used to do the lazy
- /// resolving.
- virtual LazyResolverFn getLazyResolverFunction(JITCompilerFn) {
- assert(0 && "Not implemented for this target!");
- return 0;
- }
-
- /// relocate - Before the JIT can run a block of code that has been emitted,
- /// it must rewrite the code to contain the actual addresses of any
- /// referenced global symbols.
- virtual void relocate(void *Function, MachineRelocation *MR,
- unsigned NumRelocs, unsigned char* GOTBase) {
- assert(NumRelocs == 0 && "This target does not have relocations!");
- }
-
- /// needsGOT - Allows a target to specify that it would like the
- // JIT to manage a GOT for it.
- bool needsGOT() const { return useGOT; }
-
- protected:
- bool useGOT;
- };
-} // End llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/Target/TargetLowering.h b/release_23/include/llvm/Target/TargetLowering.h
deleted file mode 100644
index b6f10bb6944d..000000000000
--- a/release_23/include/llvm/Target/TargetLowering.h
+++ /dev/null
@@ -1,1446 +0,0 @@
-//===-- llvm/Target/TargetLowering.h - Target Lowering Info -----*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file describes how to lower LLVM code to machine code. This has two
-// main components:
-//
-// 1. Which ValueTypes are natively supported by the target.
-// 2. Which operations are supported for supported ValueTypes.
-// 3. Cost thresholds for alternative implementations of certain operations.
-//
-// In addition it has a few other components, like information about FP
-// immediates.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_TARGET_TARGETLOWERING_H
-#define LLVM_TARGET_TARGETLOWERING_H
-
-#include "llvm/Constants.h"
-#include "llvm/InlineAsm.h"
-#include "llvm/CodeGen/SelectionDAGNodes.h"
-#include "llvm/CodeGen/RuntimeLibcalls.h"
-#include "llvm/ADT/APFloat.h"
-#include "llvm/ADT/STLExtras.h"
-#include <map>
-#include <vector>
-
-namespace llvm {
- class Value;
- class Function;
- class TargetMachine;
- class TargetData;
- class TargetRegisterClass;
- class SDNode;
- class SDOperand;
- class SelectionDAG;
- class MachineBasicBlock;
- class MachineInstr;
- class VectorType;
- class TargetSubtarget;
-
-//===----------------------------------------------------------------------===//
-/// TargetLowering - This class defines information used to lower LLVM code to
-/// legal SelectionDAG operators that the target instruction selector can accept
-/// natively.
-///
-/// This class also defines callbacks that targets must implement to lower
-/// target-specific constructs to SelectionDAG operators.
-///
-class TargetLowering {
-public:
- /// LegalizeAction - This enum indicates whether operations are valid for a
- /// target, and if not, what action should be used to make them valid.
- enum LegalizeAction {
- Legal, // The target natively supports this operation.
- Promote, // This operation should be executed in a larger type.
- Expand, // Try to expand this to other ops, otherwise use a libcall.
- Custom // Use the LowerOperation hook to implement custom lowering.
- };
-
- enum OutOfRangeShiftAmount {
- Undefined, // Oversized shift amounts are undefined (default).
- Mask, // Shift amounts are auto masked (anded) to value size.
- Extend // Oversized shift pulls in zeros or sign bits.
- };
-
- enum SetCCResultValue {
- UndefinedSetCCResult, // SetCC returns a garbage/unknown extend.
- ZeroOrOneSetCCResult, // SetCC returns a zero extended result.
- ZeroOrNegativeOneSetCCResult // SetCC returns a sign extended result.
- };
-
- enum SchedPreference {
- SchedulingForLatency, // Scheduling for shortest total latency.
- SchedulingForRegPressure // Scheduling for lowest register pressure.
- };
-
- explicit TargetLowering(TargetMachine &TM);
- virtual ~TargetLowering();
-
- TargetMachine &getTargetMachine() const { return TM; }
- const TargetData *getTargetData() const { return TD; }
-
- bool isBigEndian() const { return !IsLittleEndian; }
- bool isLittleEndian() const { return IsLittleEndian; }
- MVT::ValueType getPointerTy() const { return PointerTy; }
- MVT::ValueType getShiftAmountTy() const { return ShiftAmountTy; }
- OutOfRangeShiftAmount getShiftAmountFlavor() const {return ShiftAmtHandling; }
-
- /// usesGlobalOffsetTable - Return true if this target uses a GOT for PIC
- /// codegen.
- bool usesGlobalOffsetTable() const { return UsesGlobalOffsetTable; }
-
- /// isSelectExpensive - Return true if the select operation is expensive for
- /// this target.
- bool isSelectExpensive() const { return SelectIsExpensive; }
-
- /// isIntDivCheap() - Return true if integer divide is usually cheaper than
- /// a sequence of several shifts, adds, and multiplies for this target.
- bool isIntDivCheap() const { return IntDivIsCheap; }
-
- /// isPow2DivCheap() - Return true if pow2 div is cheaper than a chain of
- /// srl/add/sra.
- bool isPow2DivCheap() const { return Pow2DivIsCheap; }
-
- /// getSetCCResultType - Return the ValueType of the result of setcc
- /// operations.
- virtual MVT::ValueType getSetCCResultType(const SDOperand &) const;
-
- /// getSetCCResultContents - For targets without boolean registers, this flag
- /// returns information about the contents of the high-bits in the setcc
- /// result register.
- SetCCResultValue getSetCCResultContents() const { return SetCCResultContents;}
-
- /// getSchedulingPreference - Return target scheduling preference.
- SchedPreference getSchedulingPreference() const {
- return SchedPreferenceInfo;
- }
-
- /// getRegClassFor - Return the register class that should be used for the
- /// specified value type. This may only be called on legal types.
- TargetRegisterClass *getRegClassFor(MVT::ValueType VT) const {
- assert(VT < array_lengthof(RegClassForVT));
- TargetRegisterClass *RC = RegClassForVT[VT];
- assert(RC && "This value type is not natively supported!");
- return RC;
- }
-
- /// isTypeLegal - Return true if the target has native support for the
- /// specified value type. This means that it has a register that directly
- /// holds it without promotions or expansions.
- bool isTypeLegal(MVT::ValueType VT) const {
- assert(MVT::isExtendedVT(VT) || VT < array_lengthof(RegClassForVT));
- return !MVT::isExtendedVT(VT) && RegClassForVT[VT] != 0;
- }
-
- class ValueTypeActionImpl {
- /// ValueTypeActions - This is a bitvector that contains two bits for each
- /// value type, where the two bits correspond to the LegalizeAction enum.
- /// This can be queried with "getTypeAction(VT)".
- uint32_t ValueTypeActions[2];
- public:
- ValueTypeActionImpl() {
- ValueTypeActions[0] = ValueTypeActions[1] = 0;
- }
- ValueTypeActionImpl(const ValueTypeActionImpl &RHS) {
- ValueTypeActions[0] = RHS.ValueTypeActions[0];
- ValueTypeActions[1] = RHS.ValueTypeActions[1];
- }
-
- LegalizeAction getTypeAction(MVT::ValueType VT) const {
- if (MVT::isExtendedVT(VT)) {
- if (MVT::isVector(VT)) return Expand;
- if (MVT::isInteger(VT))
- // First promote to a power-of-two size, then expand if necessary.
- return VT == MVT::RoundIntegerType(VT) ? Expand : Promote;
- assert(0 && "Unsupported extended type!");
- }
- assert(VT<4*array_lengthof(ValueTypeActions)*sizeof(ValueTypeActions[0]));
- return (LegalizeAction)((ValueTypeActions[VT>>4] >> ((2*VT) & 31)) & 3);
- }
- void setTypeAction(MVT::ValueType VT, LegalizeAction Action) {
- assert(VT<4*array_lengthof(ValueTypeActions)*sizeof(ValueTypeActions[0]));
- ValueTypeActions[VT>>4] |= Action << ((VT*2) & 31);
- }
- };
-
- const ValueTypeActionImpl &getValueTypeActions() const {
- return ValueTypeActions;
- }
-
- /// getTypeAction - Return how we should legalize values of this type, either
- /// it is already legal (return 'Legal') or we need to promote it to a larger
- /// type (return 'Promote'), or we need to expand it into multiple registers
- /// of smaller integer type (return 'Expand'). 'Custom' is not an option.
- LegalizeAction getTypeAction(MVT::ValueType VT) const {
- return ValueTypeActions.getTypeAction(VT);
- }
-
- /// getTypeToTransformTo - For types supported by the target, this is an
- /// identity function. For types that must be promoted to larger types, this
- /// returns the larger type to promote to. For integer types that are larger
- /// than the largest integer register, this contains one step in the expansion
- /// to get to the smaller register. For illegal floating point types, this
- /// returns the integer type to transform to.
- MVT::ValueType getTypeToTransformTo(MVT::ValueType VT) const {
- if (!MVT::isExtendedVT(VT)) {
- assert(VT < array_lengthof(TransformToType));
- MVT::ValueType NVT = TransformToType[VT];
- assert(getTypeAction(NVT) != Promote &&
- "Promote may not follow Expand or Promote");
- return NVT;
- }
-
- if (MVT::isVector(VT))
- return MVT::getVectorType(MVT::getVectorElementType(VT),
- MVT::getVectorNumElements(VT) / 2);
- if (MVT::isInteger(VT)) {
- MVT::ValueType NVT = MVT::RoundIntegerType(VT);
- if (NVT == VT)
- // Size is a power of two - expand to half the size.
- return MVT::getIntegerType(MVT::getSizeInBits(VT) / 2);
- else
- // Promote to a power of two size, avoiding multi-step promotion.
- return getTypeAction(NVT) == Promote ? getTypeToTransformTo(NVT) : NVT;
- }
- assert(0 && "Unsupported extended type!");
- return MVT::ValueType(); // Not reached
- }
-
- /// getTypeToExpandTo - For types supported by the target, this is an
- /// identity function. For types that must be expanded (i.e. integer types
- /// that are larger than the largest integer register or illegal floating
- /// point types), this returns the largest legal type it will be expanded to.
- MVT::ValueType getTypeToExpandTo(MVT::ValueType VT) const {
- assert(!MVT::isVector(VT));
- while (true) {
- switch (getTypeAction(VT)) {
- case Legal:
- return VT;
- case Expand:
- VT = getTypeToTransformTo(VT);
- break;
- default:
- assert(false && "Type is not legal nor is it to be expanded!");
- return VT;
- }
- }
- return VT;
- }
-
- /// getVectorTypeBreakdown - Vector types are broken down into some number of
- /// legal first class types. For example, MVT::v8f32 maps to 2 MVT::v4f32
- /// with Altivec or SSE1, or 8 promoted MVT::f64 values with the X86 FP stack.
- /// Similarly, MVT::v2i64 turns into 4 MVT::i32 values with both PPC and X86.
- ///
- /// This method returns the number of registers needed, and the VT for each
- /// register. It also returns the VT and quantity of the intermediate values
- /// before they are promoted/expanded.
- ///
- unsigned getVectorTypeBreakdown(MVT::ValueType VT,
- MVT::ValueType &IntermediateVT,
- unsigned &NumIntermediates,
- MVT::ValueType &RegisterVT) const;
-
- typedef std::vector<APFloat>::const_iterator legal_fpimm_iterator;
- legal_fpimm_iterator legal_fpimm_begin() const {
- return LegalFPImmediates.begin();
- }
- legal_fpimm_iterator legal_fpimm_end() const {
- return LegalFPImmediates.end();
- }
-
- /// isShuffleMaskLegal - Targets can use this to indicate that they only
- /// support *some* VECTOR_SHUFFLE operations, those with specific masks.
- /// By default, if a target supports the VECTOR_SHUFFLE node, all mask values
- /// are assumed to be legal.
- virtual bool isShuffleMaskLegal(SDOperand Mask, MVT::ValueType VT) const {
- return true;
- }
-
- /// isVectorClearMaskLegal - Similar to isShuffleMaskLegal. This is
- /// used by Targets can use this to indicate if there is a suitable
- /// VECTOR_SHUFFLE that can be used to replace a VAND with a constant
- /// pool entry.
- virtual bool isVectorClearMaskLegal(const std::vector<SDOperand> &BVOps,
- MVT::ValueType EVT,
- SelectionDAG &DAG) const {
- return false;
- }
-
- /// getOperationAction - Return how this operation should be treated: either
- /// it is legal, needs to be promoted to a larger size, needs to be
- /// expanded to some other code sequence, or the target has a custom expander
- /// for it.
- LegalizeAction getOperationAction(unsigned Op, MVT::ValueType VT) const {
- if (MVT::isExtendedVT(VT)) return Expand;
- assert(Op < array_lengthof(OpActions) &&
- VT < sizeof(OpActions[0])*4 && "Table isn't big enough!");
- return (LegalizeAction)((OpActions[Op] >> (2*VT)) & 3);
- }
-
- /// isOperationLegal - Return true if the specified operation is legal on this
- /// target.
- bool isOperationLegal(unsigned Op, MVT::ValueType VT) const {
- return getOperationAction(Op, VT) == Legal ||
- getOperationAction(Op, VT) == Custom;
- }
-
- /// getLoadXAction - Return how this load with extension should be treated:
- /// either it is legal, needs to be promoted to a larger size, needs to be
- /// expanded to some other code sequence, or the target has a custom expander
- /// for it.
- LegalizeAction getLoadXAction(unsigned LType, MVT::ValueType VT) const {
- assert(LType < array_lengthof(LoadXActions) &&
- VT < sizeof(LoadXActions[0])*4 && "Table isn't big enough!");
- return (LegalizeAction)((LoadXActions[LType] >> (2*VT)) & 3);
- }
-
- /// isLoadXLegal - Return true if the specified load with extension is legal
- /// on this target.
- bool isLoadXLegal(unsigned LType, MVT::ValueType VT) const {
- return !MVT::isExtendedVT(VT) &&
- (getLoadXAction(LType, VT) == Legal ||
- getLoadXAction(LType, VT) == Custom);
- }
-
- /// getTruncStoreAction - Return how this store with truncation should be
- /// treated: either it is legal, needs to be promoted to a larger size, needs
- /// to be expanded to some other code sequence, or the target has a custom
- /// expander for it.
- LegalizeAction getTruncStoreAction(MVT::ValueType ValVT,
- MVT::ValueType MemVT) const {
- assert(ValVT < array_lengthof(TruncStoreActions) &&
- MemVT < sizeof(TruncStoreActions[0])*4 && "Table isn't big enough!");
- return (LegalizeAction)((TruncStoreActions[ValVT] >> (2*MemVT)) & 3);
- }
-
- /// isTruncStoreLegal - Return true if the specified store with truncation is
- /// legal on this target.
- bool isTruncStoreLegal(MVT::ValueType ValVT, MVT::ValueType MemVT) const {
- return !MVT::isExtendedVT(MemVT) &&
- (getTruncStoreAction(ValVT, MemVT) == Legal ||
- getTruncStoreAction(ValVT, MemVT) == Custom);
- }
-
- /// getIndexedLoadAction - Return how the indexed load should be treated:
- /// either it is legal, needs to be promoted to a larger size, needs to be
- /// expanded to some other code sequence, or the target has a custom expander
- /// for it.
- LegalizeAction
- getIndexedLoadAction(unsigned IdxMode, MVT::ValueType VT) const {
- assert(IdxMode < array_lengthof(IndexedModeActions[0]) &&
- VT < sizeof(IndexedModeActions[0][0])*4 &&
- "Table isn't big enough!");
- return (LegalizeAction)((IndexedModeActions[0][IdxMode] >> (2*VT)) & 3);
- }
-
- /// isIndexedLoadLegal - Return true if the specified indexed load is legal
- /// on this target.
- bool isIndexedLoadLegal(unsigned IdxMode, MVT::ValueType VT) const {
- return getIndexedLoadAction(IdxMode, VT) == Legal ||
- getIndexedLoadAction(IdxMode, VT) == Custom;
- }
-
- /// getIndexedStoreAction - Return how the indexed store should be treated:
- /// either it is legal, needs to be promoted to a larger size, needs to be
- /// expanded to some other code sequence, or the target has a custom expander
- /// for it.
- LegalizeAction
- getIndexedStoreAction(unsigned IdxMode, MVT::ValueType VT) const {
- assert(IdxMode < array_lengthof(IndexedModeActions[1]) &&
- VT < sizeof(IndexedModeActions[1][0])*4 &&
- "Table isn't big enough!");
- return (LegalizeAction)((IndexedModeActions[1][IdxMode] >> (2*VT)) & 3);
- }
-
- /// isIndexedStoreLegal - Return true if the specified indexed load is legal
- /// on this target.
- bool isIndexedStoreLegal(unsigned IdxMode, MVT::ValueType VT) const {
- return getIndexedStoreAction(IdxMode, VT) == Legal ||
- getIndexedStoreAction(IdxMode, VT) == Custom;
- }
-
- /// getConvertAction - Return how the conversion should be treated:
- /// either it is legal, needs to be promoted to a larger size, needs to be
- /// expanded to some other code sequence, or the target has a custom expander
- /// for it.
- LegalizeAction
- getConvertAction(MVT::ValueType FromVT, MVT::ValueType ToVT) const {
- assert(FromVT < array_lengthof(ConvertActions) &&
- ToVT < sizeof(ConvertActions[0])*4 && "Table isn't big enough!");
- return (LegalizeAction)((ConvertActions[FromVT] >> (2*ToVT)) & 3);
- }
-
- /// isConvertLegal - Return true if the specified conversion is legal
- /// on this target.
- bool isConvertLegal(MVT::ValueType FromVT, MVT::ValueType ToVT) const {
- return getConvertAction(FromVT, ToVT) == Legal ||
- getConvertAction(FromVT, ToVT) == Custom;
- }
-
- /// getTypeToPromoteTo - If the action for this operation is to promote, this
- /// method returns the ValueType to promote to.
- MVT::ValueType getTypeToPromoteTo(unsigned Op, MVT::ValueType VT) const {
- assert(getOperationAction(Op, VT) == Promote &&
- "This operation isn't promoted!");
-
- // See if this has an explicit type specified.
- std::map<std::pair<unsigned, MVT::ValueType>,
- MVT::ValueType>::const_iterator PTTI =
- PromoteToType.find(std::make_pair(Op, VT));
- if (PTTI != PromoteToType.end()) return PTTI->second;
-
- assert((MVT::isInteger(VT) || MVT::isFloatingPoint(VT)) &&
- "Cannot autopromote this type, add it with AddPromotedToType.");
-
- MVT::ValueType NVT = VT;
- do {
- NVT = (MVT::ValueType)(NVT+1);
- assert(MVT::isInteger(NVT) == MVT::isInteger(VT) && NVT != MVT::isVoid &&
- "Didn't find type to promote to!");
- } while (!isTypeLegal(NVT) ||
- getOperationAction(Op, NVT) == Promote);
- return NVT;
- }
-
- /// getValueType - Return the MVT::ValueType corresponding to this LLVM type.
- /// This is fixed by the LLVM operations except for the pointer size. If
- /// AllowUnknown is true, this will return MVT::Other for types with no MVT
- /// counterpart (e.g. structs), otherwise it will assert.
- MVT::ValueType getValueType(const Type *Ty, bool AllowUnknown = false) const {
- MVT::ValueType VT = MVT::getValueType(Ty, AllowUnknown);
- return VT == MVT::iPTR ? PointerTy : VT;
- }
-
- /// getByValTypeAlignment - Return the desired alignment for ByVal aggregate
- /// function arguments in the caller parameter area. This is the actual
- /// alignment, not its logarithm.
- virtual unsigned getByValTypeAlignment(const Type *Ty) const;
-
- /// getRegisterType - Return the type of registers that this ValueType will
- /// eventually require.
- MVT::ValueType getRegisterType(MVT::ValueType VT) const {
- if (!MVT::isExtendedVT(VT)) {
- assert(VT < array_lengthof(RegisterTypeForVT));
- return RegisterTypeForVT[VT];
- }
- if (MVT::isVector(VT)) {
- MVT::ValueType VT1, RegisterVT;
- unsigned NumIntermediates;
- (void)getVectorTypeBreakdown(VT, VT1, NumIntermediates, RegisterVT);
- return RegisterVT;
- }
- if (MVT::isInteger(VT)) {
- return getRegisterType(getTypeToTransformTo(VT));
- }
- assert(0 && "Unsupported extended type!");
- return MVT::ValueType(); // Not reached
- }
-
- /// getNumRegisters - Return the number of registers that this ValueType will
- /// eventually require. This is one for any types promoted to live in larger
- /// registers, but may be more than one for types (like i64) that are split
- /// into pieces. For types like i140, which are first promoted then expanded,
- /// it is the number of registers needed to hold all the bits of the original
- /// type. For an i140 on a 32 bit machine this means 5 registers.
- unsigned getNumRegisters(MVT::ValueType VT) const {
- if (!MVT::isExtendedVT(VT)) {
- assert(VT < array_lengthof(NumRegistersForVT));
- return NumRegistersForVT[VT];
- }
- if (MVT::isVector(VT)) {
- MVT::ValueType VT1, VT2;
- unsigned NumIntermediates;
- return getVectorTypeBreakdown(VT, VT1, NumIntermediates, VT2);
- }
- if (MVT::isInteger(VT)) {
- unsigned BitWidth = MVT::getSizeInBits(VT);
- unsigned RegWidth = MVT::getSizeInBits(getRegisterType(VT));
- return (BitWidth + RegWidth - 1) / RegWidth;
- }
- assert(0 && "Unsupported extended type!");
- return 0; // Not reached
- }
-
- /// ShouldShrinkFPConstant - If true, then instruction selection should
- /// seek to shrink the FP constant of the specified type to a smaller type
- /// in order to save space and / or reduce runtime.
- virtual bool ShouldShrinkFPConstant(MVT::ValueType VT) const { return true; }
-
- /// hasTargetDAGCombine - If true, the target has custom DAG combine
- /// transformations that it can perform for the specified node.
- bool hasTargetDAGCombine(ISD::NodeType NT) const {
- assert(unsigned(NT >> 3) < array_lengthof(TargetDAGCombineArray));
- return TargetDAGCombineArray[NT >> 3] & (1 << (NT&7));
- }
-
- /// This function returns the maximum number of store operations permitted
- /// to replace a call to llvm.memset. The value is set by the target at the
- /// performance threshold for such a replacement.
- /// @brief Get maximum # of store operations permitted for llvm.memset
- unsigned getMaxStoresPerMemset() const { return maxStoresPerMemset; }
-
- /// This function returns the maximum number of store operations permitted
- /// to replace a call to llvm.memcpy. The value is set by the target at the
- /// performance threshold for such a replacement.
- /// @brief Get maximum # of store operations permitted for llvm.memcpy
- unsigned getMaxStoresPerMemcpy() const { return maxStoresPerMemcpy; }
-
- /// This function returns the maximum number of store operations permitted
- /// to replace a call to llvm.memmove. The value is set by the target at the
- /// performance threshold for such a replacement.
- /// @brief Get maximum # of store operations permitted for llvm.memmove
- unsigned getMaxStoresPerMemmove() const { return maxStoresPerMemmove; }
-
- /// This function returns true if the target allows unaligned memory accesses.
- /// This is used, for example, in situations where an array copy/move/set is
- /// converted to a sequence of store operations. It's use helps to ensure that
- /// such replacements don't generate code that causes an alignment error
- /// (trap) on the target machine.
- /// @brief Determine if the target supports unaligned memory accesses.
- bool allowsUnalignedMemoryAccesses() const {
- return allowUnalignedMemoryAccesses;
- }
-
- /// usesUnderscoreSetJmp - Determine if we should use _setjmp or setjmp
- /// to implement llvm.setjmp.
- bool usesUnderscoreSetJmp() const {
- return UseUnderscoreSetJmp;
- }
-
- /// usesUnderscoreLongJmp - Determine if we should use _longjmp or longjmp
- /// to implement llvm.longjmp.
- bool usesUnderscoreLongJmp() const {
- return UseUnderscoreLongJmp;
- }
-
- /// getStackPointerRegisterToSaveRestore - If a physical register, this
- /// specifies the register that llvm.savestack/llvm.restorestack should save
- /// and restore.
- unsigned getStackPointerRegisterToSaveRestore() const {
- return StackPointerRegisterToSaveRestore;
- }
-
- /// getExceptionAddressRegister - If a physical register, this returns
- /// the register that receives the exception address on entry to a landing
- /// pad.
- unsigned getExceptionAddressRegister() const {
- return ExceptionPointerRegister;
- }
-
- /// getExceptionSelectorRegister - If a physical register, this returns
- /// the register that receives the exception typeid on entry to a landing
- /// pad.
- unsigned getExceptionSelectorRegister() const {
- return ExceptionSelectorRegister;
- }
-
- /// getJumpBufSize - returns the target's jmp_buf size in bytes (if never
- /// set, the default is 200)
- unsigned getJumpBufSize() const {
- return JumpBufSize;
- }
-
- /// getJumpBufAlignment - returns the target's jmp_buf alignment in bytes
- /// (if never set, the default is 0)
- unsigned getJumpBufAlignment() const {
- return JumpBufAlignment;
- }
-
- /// getIfCvtBlockLimit - returns the target specific if-conversion block size
- /// limit. Any block whose size is greater should not be predicated.
- unsigned getIfCvtBlockSizeLimit() const {
- return IfCvtBlockSizeLimit;
- }
-
- /// getIfCvtDupBlockLimit - returns the target specific size limit for a
- /// block to be considered for duplication. Any block whose size is greater
- /// should not be duplicated to facilitate its predication.
- unsigned getIfCvtDupBlockSizeLimit() const {
- return IfCvtDupBlockSizeLimit;
- }
-
- /// getPrefLoopAlignment - return the preferred loop alignment.
- ///
- unsigned getPrefLoopAlignment() const {
- return PrefLoopAlignment;
- }
-
- /// getPreIndexedAddressParts - returns true by value, base pointer and
- /// offset pointer and addressing mode by reference if the node's address
- /// can be legally represented as pre-indexed load / store address.
- virtual bool getPreIndexedAddressParts(SDNode *N, SDOperand &Base,
- SDOperand &Offset,
- ISD::MemIndexedMode &AM,
- SelectionDAG &DAG) {
- return false;
- }
-
- /// getPostIndexedAddressParts - returns true by value, base pointer and
- /// offset pointer and addressing mode by reference if this node can be
- /// combined with a load / store to form a post-indexed load / store.
- virtual bool getPostIndexedAddressParts(SDNode *N, SDNode *Op,
- SDOperand &Base, SDOperand &Offset,
- ISD::MemIndexedMode &AM,
- SelectionDAG &DAG) {
- return false;
- }
-
- /// getPICJumpTableRelocaBase - Returns relocation base for the given PIC
- /// jumptable.
- virtual SDOperand getPICJumpTableRelocBase(SDOperand Table,
- SelectionDAG &DAG) const;
-
- //===--------------------------------------------------------------------===//
- // TargetLowering Optimization Methods
- //
-
- /// TargetLoweringOpt - A convenience struct that encapsulates a DAG, and two
- /// SDOperands for returning information from TargetLowering to its clients
- /// that want to combine
- struct TargetLoweringOpt {
- SelectionDAG &DAG;
- bool AfterLegalize;
- SDOperand Old;
- SDOperand New;
-
- explicit TargetLoweringOpt(SelectionDAG &InDAG, bool afterLegalize)
- : DAG(InDAG), AfterLegalize(afterLegalize) {}
-
- bool CombineTo(SDOperand O, SDOperand N) {
- Old = O;
- New = N;
- return true;
- }
-
- /// ShrinkDemandedConstant - Check to see if the specified operand of the
- /// specified instruction is a constant integer. If so, check to see if
- /// there are any bits set in the constant that are not demanded. If so,
- /// shrink the constant and return true.
- bool ShrinkDemandedConstant(SDOperand Op, const APInt &Demanded);
- };
-
- /// SimplifyDemandedBits - Look at Op. At this point, we know that only the
- /// DemandedMask bits of the result of Op are ever used downstream. If we can
- /// use this information to simplify Op, create a new simplified DAG node and
- /// return true, returning the original and new nodes in Old and New.
- /// Otherwise, analyze the expression and return a mask of KnownOne and
- /// KnownZero bits for the expression (used to simplify the caller).
- /// The KnownZero/One bits may only be accurate for those bits in the
- /// DemandedMask.
- bool SimplifyDemandedBits(SDOperand Op, const APInt &DemandedMask,
- APInt &KnownZero, APInt &KnownOne,
- TargetLoweringOpt &TLO, unsigned Depth = 0) const;
-
- /// computeMaskedBitsForTargetNode - Determine which of the bits specified in
- /// Mask are known to be either zero or one and return them in the
- /// KnownZero/KnownOne bitsets.
- virtual void computeMaskedBitsForTargetNode(const SDOperand Op,
- const APInt &Mask,
- APInt &KnownZero,
- APInt &KnownOne,
- const SelectionDAG &DAG,
- unsigned Depth = 0) const;
-
- /// ComputeNumSignBitsForTargetNode - This method can be implemented by
- /// targets that want to expose additional information about sign bits to the
- /// DAG Combiner.
- virtual unsigned ComputeNumSignBitsForTargetNode(SDOperand Op,
- unsigned Depth = 0) const;
-
- struct DAGCombinerInfo {
- void *DC; // The DAG Combiner object.
- bool BeforeLegalize;
- bool CalledByLegalizer;
- public:
- SelectionDAG &DAG;
-
- DAGCombinerInfo(SelectionDAG &dag, bool bl, bool cl, void *dc)
- : DC(dc), BeforeLegalize(bl), CalledByLegalizer(cl), DAG(dag) {}
-
- bool isBeforeLegalize() const { return BeforeLegalize; }
- bool isCalledByLegalizer() const { return CalledByLegalizer; }
-
- void AddToWorklist(SDNode *N);
- SDOperand CombineTo(SDNode *N, const std::vector<SDOperand> &To);
- SDOperand CombineTo(SDNode *N, SDOperand Res);
- SDOperand CombineTo(SDNode *N, SDOperand Res0, SDOperand Res1);
- };
-
- /// SimplifySetCC - Try to simplify a setcc built with the specified operands
- /// and cc. If it is unable to simplify it, return a null SDOperand.
- SDOperand SimplifySetCC(MVT::ValueType VT, SDOperand N0, SDOperand N1,
- ISD::CondCode Cond, bool foldBooleans,
- DAGCombinerInfo &DCI) const;
-
- /// PerformDAGCombine - This method will be invoked for all target nodes and
- /// for any target-independent nodes that the target has registered with
- /// invoke it for.
- ///
- /// The semantics are as follows:
- /// Return Value:
- /// SDOperand.Val == 0 - No change was made
- /// SDOperand.Val == N - N was replaced, is dead, and is already handled.
- /// otherwise - N should be replaced by the returned Operand.
- ///
- /// In addition, methods provided by DAGCombinerInfo may be used to perform
- /// more complex transformations.
- ///
- virtual SDOperand PerformDAGCombine(SDNode *N, DAGCombinerInfo &DCI) const;
-
- //===--------------------------------------------------------------------===//
- // TargetLowering Configuration Methods - These methods should be invoked by
- // the derived class constructor to configure this object for the target.
- //
-
-protected:
- /// setUsesGlobalOffsetTable - Specify that this target does or doesn't use a
- /// GOT for PC-relative code.
- void setUsesGlobalOffsetTable(bool V) { UsesGlobalOffsetTable = V; }
-
- /// setShiftAmountType - Describe the type that should be used for shift
- /// amounts. This type defaults to the pointer type.
- void setShiftAmountType(MVT::ValueType VT) { ShiftAmountTy = VT; }
-
- /// setSetCCResultContents - Specify how the target extends the result of a
- /// setcc operation in a register.
- void setSetCCResultContents(SetCCResultValue Ty) { SetCCResultContents = Ty; }
-
- /// setSchedulingPreference - Specify the target scheduling preference.
- void setSchedulingPreference(SchedPreference Pref) {
- SchedPreferenceInfo = Pref;
- }
-
- /// setShiftAmountFlavor - Describe how the target handles out of range shift
- /// amounts.
- void setShiftAmountFlavor(OutOfRangeShiftAmount OORSA) {
- ShiftAmtHandling = OORSA;
- }
-
- /// setUseUnderscoreSetJmp - Indicate whether this target prefers to
- /// use _setjmp to implement llvm.setjmp or the non _ version.
- /// Defaults to false.
- void setUseUnderscoreSetJmp(bool Val) {
- UseUnderscoreSetJmp = Val;
- }
-
- /// setUseUnderscoreLongJmp - Indicate whether this target prefers to
- /// use _longjmp to implement llvm.longjmp or the non _ version.
- /// Defaults to false.
- void setUseUnderscoreLongJmp(bool Val) {
- UseUnderscoreLongJmp = Val;
- }
-
- /// setStackPointerRegisterToSaveRestore - If set to a physical register, this
- /// specifies the register that llvm.savestack/llvm.restorestack should save
- /// and restore.
- void setStackPointerRegisterToSaveRestore(unsigned R) {
- StackPointerRegisterToSaveRestore = R;
- }
-
- /// setExceptionPointerRegister - If set to a physical register, this sets
- /// the register that receives the exception address on entry to a landing
- /// pad.
- void setExceptionPointerRegister(unsigned R) {
- ExceptionPointerRegister = R;
- }
-
- /// setExceptionSelectorRegister - If set to a physical register, this sets
- /// the register that receives the exception typeid on entry to a landing
- /// pad.
- void setExceptionSelectorRegister(unsigned R) {
- ExceptionSelectorRegister = R;
- }
-
- /// SelectIsExpensive - Tells the code generator not to expand operations
- /// into sequences that use the select operations if possible.
- void setSelectIsExpensive() { SelectIsExpensive = true; }
-
- /// setIntDivIsCheap - Tells the code generator that integer divide is
- /// expensive, and if possible, should be replaced by an alternate sequence
- /// of instructions not containing an integer divide.
- void setIntDivIsCheap(bool isCheap = true) { IntDivIsCheap = isCheap; }
-
- /// setPow2DivIsCheap - Tells the code generator that it shouldn't generate
- /// srl/add/sra for a signed divide by power of two, and let the target handle
- /// it.
- void setPow2DivIsCheap(bool isCheap = true) { Pow2DivIsCheap = isCheap; }
-
- /// addRegisterClass - Add the specified register class as an available
- /// regclass for the specified value type. This indicates the selector can
- /// handle values of that class natively.
- void addRegisterClass(MVT::ValueType VT, TargetRegisterClass *RC) {
- assert(VT < array_lengthof(RegClassForVT));
- AvailableRegClasses.push_back(std::make_pair(VT, RC));
- RegClassForVT[VT] = RC;
- }
-
- /// computeRegisterProperties - Once all of the register classes are added,
- /// this allows us to compute derived properties we expose.
- void computeRegisterProperties();
-
- /// setOperationAction - Indicate that the specified operation does not work
- /// with the specified type and indicate what to do about it.
- void setOperationAction(unsigned Op, MVT::ValueType VT,
- LegalizeAction Action) {
- assert(VT < sizeof(OpActions[0])*4 && Op < array_lengthof(OpActions) &&
- "Table isn't big enough!");
- OpActions[Op] &= ~(uint64_t(3UL) << VT*2);
- OpActions[Op] |= (uint64_t)Action << VT*2;
- }
-
- /// setLoadXAction - Indicate that the specified load with extension does not
- /// work with the with specified type and indicate what to do about it.
- void setLoadXAction(unsigned ExtType, MVT::ValueType VT,
- LegalizeAction Action) {
- assert(VT < sizeof(LoadXActions[0])*4 &&
- ExtType < array_lengthof(LoadXActions) &&
- "Table isn't big enough!");
- LoadXActions[ExtType] &= ~(uint64_t(3UL) << VT*2);
- LoadXActions[ExtType] |= (uint64_t)Action << VT*2;
- }
-
- /// setTruncStoreAction - Indicate that the specified truncating store does
- /// not work with the with specified type and indicate what to do about it.
- void setTruncStoreAction(MVT::ValueType ValVT, MVT::ValueType MemVT,
- LegalizeAction Action) {
- assert(ValVT < array_lengthof(TruncStoreActions) &&
- MemVT < sizeof(TruncStoreActions[0])*4 && "Table isn't big enough!");
- TruncStoreActions[ValVT] &= ~(uint64_t(3UL) << MemVT*2);
- TruncStoreActions[ValVT] |= (uint64_t)Action << MemVT*2;
- }
-
- /// setIndexedLoadAction - Indicate that the specified indexed load does or
- /// does not work with the with specified type and indicate what to do abort
- /// it. NOTE: All indexed mode loads are initialized to Expand in
- /// TargetLowering.cpp
- void setIndexedLoadAction(unsigned IdxMode, MVT::ValueType VT,
- LegalizeAction Action) {
- assert(VT < sizeof(IndexedModeActions[0])*4 && IdxMode <
- array_lengthof(IndexedModeActions[0]) &&
- "Table isn't big enough!");
- IndexedModeActions[0][IdxMode] &= ~(uint64_t(3UL) << VT*2);
- IndexedModeActions[0][IdxMode] |= (uint64_t)Action << VT*2;
- }
-
- /// setIndexedStoreAction - Indicate that the specified indexed store does or
- /// does not work with the with specified type and indicate what to do about
- /// it. NOTE: All indexed mode stores are initialized to Expand in
- /// TargetLowering.cpp
- void setIndexedStoreAction(unsigned IdxMode, MVT::ValueType VT,
- LegalizeAction Action) {
- assert(VT < sizeof(IndexedModeActions[1][0])*4 &&
- IdxMode < array_lengthof(IndexedModeActions[1]) &&
- "Table isn't big enough!");
- IndexedModeActions[1][IdxMode] &= ~(uint64_t(3UL) << VT*2);
- IndexedModeActions[1][IdxMode] |= (uint64_t)Action << VT*2;
- }
-
- /// setConvertAction - Indicate that the specified conversion does or does
- /// not work with the with specified type and indicate what to do about it.
- void setConvertAction(MVT::ValueType FromVT, MVT::ValueType ToVT,
- LegalizeAction Action) {
- assert(FromVT < array_lengthof(ConvertActions) &&
- ToVT < sizeof(ConvertActions[0])*4 && "Table isn't big enough!");
- ConvertActions[FromVT] &= ~(uint64_t(3UL) << ToVT*2);
- ConvertActions[FromVT] |= (uint64_t)Action << ToVT*2;
- }
-
- /// AddPromotedToType - If Opc/OrigVT is specified as being promoted, the
- /// promotion code defaults to trying a larger integer/fp until it can find
- /// one that works. If that default is insufficient, this method can be used
- /// by the target to override the default.
- void AddPromotedToType(unsigned Opc, MVT::ValueType OrigVT,
- MVT::ValueType DestVT) {
- PromoteToType[std::make_pair(Opc, OrigVT)] = DestVT;
- }
-
- /// addLegalFPImmediate - Indicate that this target can instruction select
- /// the specified FP immediate natively.
- void addLegalFPImmediate(const APFloat& Imm) {
- LegalFPImmediates.push_back(Imm);
- }
-
- /// setTargetDAGCombine - Targets should invoke this method for each target
- /// independent node that they want to provide a custom DAG combiner for by
- /// implementing the PerformDAGCombine virtual method.
- void setTargetDAGCombine(ISD::NodeType NT) {
- assert(unsigned(NT >> 3) < array_lengthof(TargetDAGCombineArray));
- TargetDAGCombineArray[NT >> 3] |= 1 << (NT&7);
- }
-
- /// setJumpBufSize - Set the target's required jmp_buf buffer size (in
- /// bytes); default is 200
- void setJumpBufSize(unsigned Size) {
- JumpBufSize = Size;
- }
-
- /// setJumpBufAlignment - Set the target's required jmp_buf buffer
- /// alignment (in bytes); default is 0
- void setJumpBufAlignment(unsigned Align) {
- JumpBufAlignment = Align;
- }
-
- /// setIfCvtBlockSizeLimit - Set the target's if-conversion block size
- /// limit (in number of instructions); default is 2.
- void setIfCvtBlockSizeLimit(unsigned Limit) {
- IfCvtBlockSizeLimit = Limit;
- }
-
- /// setIfCvtDupBlockSizeLimit - Set the target's block size limit (in number
- /// of instructions) to be considered for code duplication during
- /// if-conversion; default is 2.
- void setIfCvtDupBlockSizeLimit(unsigned Limit) {
- IfCvtDupBlockSizeLimit = Limit;
- }
-
- /// setPrefLoopAlignment - Set the target's preferred loop alignment. Default
- /// alignment is zero, it means the target does not care about loop alignment.
- void setPrefLoopAlignment(unsigned Align) {
- PrefLoopAlignment = Align;
- }
-
-public:
-
- virtual const TargetSubtarget *getSubtarget() {
- assert(0 && "Not Implemented");
- return NULL; // this is here to silence compiler errors
- }
- //===--------------------------------------------------------------------===//
- // Lowering methods - These methods must be implemented by targets so that
- // the SelectionDAGLowering code knows how to lower these.
- //
-
- /// LowerArguments - This hook must be implemented to indicate how we should
- /// lower the arguments for the specified function, into the specified DAG.
- virtual std::vector<SDOperand>
- LowerArguments(Function &F, SelectionDAG &DAG);
-
- /// LowerCallTo - This hook lowers an abstract call to a function into an
- /// actual call. This returns a pair of operands. The first element is the
- /// return value for the function (if RetTy is not VoidTy). The second
- /// element is the outgoing token chain.
- struct ArgListEntry {
- SDOperand Node;
- const Type* Ty;
- bool isSExt;
- bool isZExt;
- bool isInReg;
- bool isSRet;
- bool isNest;
- bool isByVal;
- uint16_t Alignment;
-
- ArgListEntry() : isSExt(false), isZExt(false), isInReg(false),
- isSRet(false), isNest(false), isByVal(false), Alignment(0) { }
- };
- typedef std::vector<ArgListEntry> ArgListTy;
- virtual std::pair<SDOperand, SDOperand>
- LowerCallTo(SDOperand Chain, const Type *RetTy, bool RetSExt, bool RetZExt,
- bool isVarArg, unsigned CallingConv, bool isTailCall,
- SDOperand Callee, ArgListTy &Args, SelectionDAG &DAG);
-
-
- /// EmitTargetCodeForMemcpy - Emit target-specific code that performs a
- /// memcpy. This can be used by targets to provide code sequences for cases
- /// that don't fit the target's parameters for simple loads/stores and can be
- /// more efficient than using a library call. This function can return a null
- /// SDOperand if the target declines to use custom code and a different
- /// lowering strategy should be used.
- ///
- /// If AlwaysInline is true, the size is constant and the target should not
- /// emit any calls and is strongly encouraged to attempt to emit inline code
- /// even if it is beyond the usual threshold because this intrinsic is being
- /// expanded in a place where calls are not feasible (e.g. within the prologue
- /// for another call). If the target chooses to decline an AlwaysInline
- /// request here, legalize will resort to using simple loads and stores.
- virtual SDOperand
- EmitTargetCodeForMemcpy(SelectionDAG &DAG,
- SDOperand Chain,
- SDOperand Op1, SDOperand Op2,
- SDOperand Op3, unsigned Align,
- bool AlwaysInline,
- const Value *DstSV, uint64_t DstOff,
- const Value *SrcSV, uint64_t SrcOff) {
- return SDOperand();
- }
-
- /// EmitTargetCodeForMemmove - Emit target-specific code that performs a
- /// memmove. This can be used by targets to provide code sequences for cases
- /// that don't fit the target's parameters for simple loads/stores and can be
- /// more efficient than using a library call. This function can return a null
- /// SDOperand if the target declines to use custom code and a different
- /// lowering strategy should be used.
- virtual SDOperand
- EmitTargetCodeForMemmove(SelectionDAG &DAG,
- SDOperand Chain,
- SDOperand Op1, SDOperand Op2,
- SDOperand Op3, unsigned Align,
- const Value *DstSV, uint64_t DstOff,
- const Value *SrcSV, uint64_t SrcOff) {
- return SDOperand();
- }
-
- /// EmitTargetCodeForMemset - Emit target-specific code that performs a
- /// memset. This can be used by targets to provide code sequences for cases
- /// that don't fit the target's parameters for simple stores and can be more
- /// efficient than using a library call. This function can return a null
- /// SDOperand if the target declines to use custom code and a different
- /// lowering strategy should be used.
- virtual SDOperand
- EmitTargetCodeForMemset(SelectionDAG &DAG,
- SDOperand Chain,
- SDOperand Op1, SDOperand Op2,
- SDOperand Op3, unsigned Align,
- const Value *DstSV, uint64_t DstOff) {
- return SDOperand();
- }
-
- /// LowerOperation - This callback is invoked for operations that are
- /// unsupported by the target, which are registered to use 'custom' lowering,
- /// and whose defined values are all legal.
- /// If the target has no operations that require custom lowering, it need not
- /// implement this. The default implementation of this aborts.
- virtual SDOperand LowerOperation(SDOperand Op, SelectionDAG &DAG);
-
- /// ExpandOperationResult - This callback is invoked for operations that are
- /// unsupported by the target, which are registered to use 'custom' lowering,
- /// and whose result type needs to be expanded. This must return a node whose
- /// results precisely match the results of the input node. This typically
- /// involves a MERGE_VALUES node and/or BUILD_PAIR.
- ///
- /// If the target has no operations that require custom lowering, it need not
- /// implement this. The default implementation of this aborts.
- virtual SDNode *ExpandOperationResult(SDNode *N, SelectionDAG &DAG) {
- assert(0 && "ExpandOperationResult not implemented for this target!");
- return 0;
- }
-
- /// IsEligibleForTailCallOptimization - Check whether the call is eligible for
- /// tail call optimization. Targets which want to do tail call optimization
- /// should override this function.
- virtual bool IsEligibleForTailCallOptimization(SDOperand Call,
- SDOperand Ret,
- SelectionDAG &DAG) const {
- return false;
- }
-
- /// CheckTailCallReturnConstraints - Check whether CALL node immediatly
- /// preceeds the RET node and whether the return uses the result of the node
- /// or is a void return. This function can be used by the target to determine
- /// eligiblity of tail call optimization.
- static bool CheckTailCallReturnConstraints(SDOperand Call, SDOperand Ret) {
- unsigned NumOps = Ret.getNumOperands();
- if ((NumOps == 1 &&
- (Ret.getOperand(0) == SDOperand(Call.Val,1) ||
- Ret.getOperand(0) == SDOperand(Call.Val,0))) ||
- (NumOps > 1 &&
- Ret.getOperand(0) == SDOperand(Call.Val,Call.Val->getNumValues()-1) &&
- Ret.getOperand(1) == SDOperand(Call.Val,0)))
- return true;
- return false;
- }
-
- /// GetPossiblePreceedingTailCall - Get preceeding TailCallNodeOpCode node if
- /// it exists skip possible ISD:TokenFactor.
- static SDOperand GetPossiblePreceedingTailCall(SDOperand Chain,
- unsigned TailCallNodeOpCode) {
- if (Chain.getOpcode() == TailCallNodeOpCode) {
- return Chain;
- } else if (Chain.getOpcode() == ISD::TokenFactor) {
- if (Chain.getNumOperands() &&
- Chain.getOperand(0).getOpcode() == TailCallNodeOpCode)
- return Chain.getOperand(0);
- }
- return Chain;
- }
-
- /// CustomPromoteOperation - This callback is invoked for operations that are
- /// unsupported by the target, are registered to use 'custom' lowering, and
- /// whose type needs to be promoted.
- virtual SDOperand CustomPromoteOperation(SDOperand Op, SelectionDAG &DAG);
-
- /// getTargetNodeName() - This method returns the name of a target specific
- /// DAG node.
- virtual const char *getTargetNodeName(unsigned Opcode) const;
-
- //===--------------------------------------------------------------------===//
- // Inline Asm Support hooks
- //
-
- enum ConstraintType {
- C_Register, // Constraint represents a single register.
- C_RegisterClass, // Constraint represents one or more registers.
- C_Memory, // Memory constraint.
- C_Other, // Something else.
- C_Unknown // Unsupported constraint.
- };
-
- /// AsmOperandInfo - This contains information for each constraint that we are
- /// lowering.
- struct AsmOperandInfo : public InlineAsm::ConstraintInfo {
- /// ConstraintCode - This contains the actual string for the code, like "m".
- std::string ConstraintCode;
-
- /// ConstraintType - Information about the constraint code, e.g. Register,
- /// RegisterClass, Memory, Other, Unknown.
- TargetLowering::ConstraintType ConstraintType;
-
- /// CallOperandval - If this is the result output operand or a
- /// clobber, this is null, otherwise it is the incoming operand to the
- /// CallInst. This gets modified as the asm is processed.
- Value *CallOperandVal;
-
- /// ConstraintVT - The ValueType for the operand value.
- MVT::ValueType ConstraintVT;
-
- AsmOperandInfo(const InlineAsm::ConstraintInfo &info)
- : InlineAsm::ConstraintInfo(info),
- ConstraintType(TargetLowering::C_Unknown),
- CallOperandVal(0), ConstraintVT(MVT::Other) {
- }
- };
-
- /// ComputeConstraintToUse - Determines the constraint code and constraint
- /// type to use for the specific AsmOperandInfo, setting
- /// OpInfo.ConstraintCode and OpInfo.ConstraintType. If the actual operand
- /// being passed in is available, it can be passed in as Op, otherwise an
- /// empty SDOperand can be passed.
- virtual void ComputeConstraintToUse(AsmOperandInfo &OpInfo,
- SDOperand Op,
- SelectionDAG *DAG = 0) const;
-
- /// getConstraintType - Given a constraint, return the type of constraint it
- /// is for this target.
- virtual ConstraintType getConstraintType(const std::string &Constraint) const;
-
- /// getRegClassForInlineAsmConstraint - Given a constraint letter (e.g. "r"),
- /// return a list of registers that can be used to satisfy the constraint.
- /// This should only be used for C_RegisterClass constraints.
- virtual std::vector<unsigned>
- getRegClassForInlineAsmConstraint(const std::string &Constraint,
- MVT::ValueType VT) const;
-
- /// getRegForInlineAsmConstraint - Given a physical register constraint (e.g.
- /// {edx}), return the register number and the register class for the
- /// register.
- ///
- /// Given a register class constraint, like 'r', if this corresponds directly
- /// to an LLVM register class, return a register of 0 and the register class
- /// pointer.
- ///
- /// This should only be used for C_Register constraints. On error,
- /// this returns a register number of 0 and a null register class pointer..
- virtual std::pair<unsigned, const TargetRegisterClass*>
- getRegForInlineAsmConstraint(const std::string &Constraint,
- MVT::ValueType VT) const;
-
- /// LowerXConstraint - try to replace an X constraint, which matches anything,
- /// with another that has more specific requirements based on the type of the
- /// corresponding operand. This returns null if there is no replacement to
- /// make.
- virtual const char *LowerXConstraint(MVT::ValueType ConstraintVT) const;
-
- /// LowerAsmOperandForConstraint - Lower the specified operand into the Ops
- /// vector. If it is invalid, don't add anything to Ops.
- virtual void LowerAsmOperandForConstraint(SDOperand Op, char ConstraintLetter,
- std::vector<SDOperand> &Ops,
- SelectionDAG &DAG) const;
-
- //===--------------------------------------------------------------------===//
- // Scheduler hooks
- //
-
- // EmitInstrWithCustomInserter - This method should be implemented by targets
- // that mark instructions with the 'usesCustomDAGSchedInserter' flag. These
- // instructions are special in various ways, which require special support to
- // insert. The specified MachineInstr is created but not inserted into any
- // basic blocks, and the scheduler passes ownership of it to this method.
- virtual MachineBasicBlock *EmitInstrWithCustomInserter(MachineInstr *MI,
- MachineBasicBlock *MBB);
-
- //===--------------------------------------------------------------------===//
- // Addressing mode description hooks (used by LSR etc).
- //
-
- /// AddrMode - This represents an addressing mode of:
- /// BaseGV + BaseOffs + BaseReg + Scale*ScaleReg
- /// If BaseGV is null, there is no BaseGV.
- /// If BaseOffs is zero, there is no base offset.
- /// If HasBaseReg is false, there is no base register.
- /// If Scale is zero, there is no ScaleReg. Scale of 1 indicates a reg with
- /// no scale.
- ///
- struct AddrMode {
- GlobalValue *BaseGV;
- int64_t BaseOffs;
- bool HasBaseReg;
- int64_t Scale;
- AddrMode() : BaseGV(0), BaseOffs(0), HasBaseReg(false), Scale(0) {}
- };
-
- /// isLegalAddressingMode - Return true if the addressing mode represented by
- /// AM is legal for this target, for a load/store of the specified type.
- /// TODO: Handle pre/postinc as well.
- virtual bool isLegalAddressingMode(const AddrMode &AM, const Type *Ty) const;
-
- /// isTruncateFree - Return true if it's free to truncate a value of
- /// type Ty1 to type Ty2. e.g. On x86 it's free to truncate a i32 value in
- /// register EAX to i16 by referencing its sub-register AX.
- virtual bool isTruncateFree(const Type *Ty1, const Type *Ty2) const {
- return false;
- }
-
- virtual bool isTruncateFree(MVT::ValueType VT1, MVT::ValueType VT2) const {
- return false;
- }
-
- //===--------------------------------------------------------------------===//
- // Div utility functions
- //
- SDOperand BuildSDIV(SDNode *N, SelectionDAG &DAG,
- std::vector<SDNode*>* Created) const;
- SDOperand BuildUDIV(SDNode *N, SelectionDAG &DAG,
- std::vector<SDNode*>* Created) const;
-
-
- //===--------------------------------------------------------------------===//
- // Runtime Library hooks
- //
-
- /// setLibcallName - Rename the default libcall routine name for the specified
- /// libcall.
- void setLibcallName(RTLIB::Libcall Call, const char *Name) {
- LibcallRoutineNames[Call] = Name;
- }
-
- /// getLibcallName - Get the libcall routine name for the specified libcall.
- ///
- const char *getLibcallName(RTLIB::Libcall Call) const {
- return LibcallRoutineNames[Call];
- }
-
- /// setCmpLibcallCC - Override the default CondCode to be used to test the
- /// result of the comparison libcall against zero.
- void setCmpLibcallCC(RTLIB::Libcall Call, ISD::CondCode CC) {
- CmpLibcallCCs[Call] = CC;
- }
-
- /// getCmpLibcallCC - Get the CondCode that's to be used to test the result of
- /// the comparison libcall against zero.
- ISD::CondCode getCmpLibcallCC(RTLIB::Libcall Call) const {
- return CmpLibcallCCs[Call];
- }
-
-private:
- TargetMachine &TM;
- const TargetData *TD;
-
- /// IsLittleEndian - True if this is a little endian target.
- ///
- bool IsLittleEndian;
-
- /// PointerTy - The type to use for pointers, usually i32 or i64.
- ///
- MVT::ValueType PointerTy;
-
- /// UsesGlobalOffsetTable - True if this target uses a GOT for PIC codegen.
- ///
- bool UsesGlobalOffsetTable;
-
- /// ShiftAmountTy - The type to use for shift amounts, usually i8 or whatever
- /// PointerTy is.
- MVT::ValueType ShiftAmountTy;
-
- OutOfRangeShiftAmount ShiftAmtHandling;
-
- /// SelectIsExpensive - Tells the code generator not to expand operations
- /// into sequences that use the select operations if possible.
- bool SelectIsExpensive;
-
- /// IntDivIsCheap - Tells the code generator not to expand integer divides by
- /// constants into a sequence of muls, adds, and shifts. This is a hack until
- /// a real cost model is in place. If we ever optimize for size, this will be
- /// set to true unconditionally.
- bool IntDivIsCheap;
-
- /// Pow2DivIsCheap - Tells the code generator that it shouldn't generate
- /// srl/add/sra for a signed divide by power of two, and let the target handle
- /// it.
- bool Pow2DivIsCheap;
-
- /// SetCCResultContents - Information about the contents of the high-bits in
- /// the result of a setcc comparison operation.
- SetCCResultValue SetCCResultContents;
-
- /// SchedPreferenceInfo - The target scheduling preference: shortest possible
- /// total cycles or lowest register usage.
- SchedPreference SchedPreferenceInfo;
-
- /// UseUnderscoreSetJmp - This target prefers to use _setjmp to implement
- /// llvm.setjmp. Defaults to false.
- bool UseUnderscoreSetJmp;
-
- /// UseUnderscoreLongJmp - This target prefers to use _longjmp to implement
- /// llvm.longjmp. Defaults to false.
- bool UseUnderscoreLongJmp;
-
- /// JumpBufSize - The size, in bytes, of the target's jmp_buf buffers
- unsigned JumpBufSize;
-
- /// JumpBufAlignment - The alignment, in bytes, of the target's jmp_buf
- /// buffers
- unsigned JumpBufAlignment;
-
- /// IfCvtBlockSizeLimit - The maximum allowed size for a block to be
- /// if-converted.
- unsigned IfCvtBlockSizeLimit;
-
- /// IfCvtDupBlockSizeLimit - The maximum allowed size for a block to be
- /// duplicated during if-conversion.
- unsigned IfCvtDupBlockSizeLimit;
-
- /// PrefLoopAlignment - The perferred loop alignment.
- ///
- unsigned PrefLoopAlignment;
-
- /// StackPointerRegisterToSaveRestore - If set to a physical register, this
- /// specifies the register that llvm.savestack/llvm.restorestack should save
- /// and restore.
- unsigned StackPointerRegisterToSaveRestore;
-
- /// ExceptionPointerRegister - If set to a physical register, this specifies
- /// the register that receives the exception address on entry to a landing
- /// pad.
- unsigned ExceptionPointerRegister;
-
- /// ExceptionSelectorRegister - If set to a physical register, this specifies
- /// the register that receives the exception typeid on entry to a landing
- /// pad.
- unsigned ExceptionSelectorRegister;
-
- /// RegClassForVT - This indicates the default register class to use for
- /// each ValueType the target supports natively.
- TargetRegisterClass *RegClassForVT[MVT::LAST_VALUETYPE];
- unsigned char NumRegistersForVT[MVT::LAST_VALUETYPE];
- MVT::ValueType RegisterTypeForVT[MVT::LAST_VALUETYPE];
-
- /// TransformToType - For any value types we are promoting or expanding, this
- /// contains the value type that we are changing to. For Expanded types, this
- /// contains one step of the expand (e.g. i64 -> i32), even if there are
- /// multiple steps required (e.g. i64 -> i16). For types natively supported
- /// by the system, this holds the same type (e.g. i32 -> i32).
- MVT::ValueType TransformToType[MVT::LAST_VALUETYPE];
-
- // Defines the capacity of the TargetLowering::OpActions table
- static const int OpActionsCapacity = 176;
-
- /// OpActions - For each operation and each value type, keep a LegalizeAction
- /// that indicates how instruction selection should deal with the operation.
- /// Most operations are Legal (aka, supported natively by the target), but
- /// operations that are not should be described. Note that operations on
- /// non-legal value types are not described here.
- uint64_t OpActions[OpActionsCapacity];
-
- /// LoadXActions - For each load of load extension type and each value type,
- /// keep a LegalizeAction that indicates how instruction selection should deal
- /// with the load.
- uint64_t LoadXActions[ISD::LAST_LOADX_TYPE];
-
- /// TruncStoreActions - For each truncating store, keep a LegalizeAction that
- /// indicates how instruction selection should deal with the store.
- uint64_t TruncStoreActions[MVT::LAST_VALUETYPE];
-
- /// IndexedModeActions - For each indexed mode and each value type, keep a
- /// pair of LegalizeAction that indicates how instruction selection should
- /// deal with the load / store.
- uint64_t IndexedModeActions[2][ISD::LAST_INDEXED_MODE];
-
- /// ConvertActions - For each conversion from source type to destination type,
- /// keep a LegalizeAction that indicates how instruction selection should
- /// deal with the conversion.
- /// Currently, this is used only for floating->floating conversions
- /// (FP_EXTEND and FP_ROUND).
- uint64_t ConvertActions[MVT::LAST_VALUETYPE];
-
- ValueTypeActionImpl ValueTypeActions;
-
- std::vector<APFloat> LegalFPImmediates;
-
- std::vector<std::pair<MVT::ValueType,
- TargetRegisterClass*> > AvailableRegClasses;
-
- /// TargetDAGCombineArray - Targets can specify ISD nodes that they would
- /// like PerformDAGCombine callbacks for by calling setTargetDAGCombine(),
- /// which sets a bit in this array.
- unsigned char
- TargetDAGCombineArray[OpActionsCapacity/(sizeof(unsigned char)*8)];
-
- /// PromoteToType - For operations that must be promoted to a specific type,
- /// this holds the destination type. This map should be sparse, so don't hold
- /// it as an array.
- ///
- /// Targets add entries to this map with AddPromotedToType(..), clients access
- /// this with getTypeToPromoteTo(..).
- std::map<std::pair<unsigned, MVT::ValueType>, MVT::ValueType> PromoteToType;
-
- /// LibcallRoutineNames - Stores the name each libcall.
- ///
- const char *LibcallRoutineNames[RTLIB::UNKNOWN_LIBCALL];
-
- /// CmpLibcallCCs - The ISD::CondCode that should be used to test the result
- /// of each of the comparison libcall against zero.
- ISD::CondCode CmpLibcallCCs[RTLIB::UNKNOWN_LIBCALL];
-
-protected:
- /// When lowering %llvm.memset this field specifies the maximum number of
- /// store operations that may be substituted for the call to memset. Targets
- /// must set this value based on the cost threshold for that target. Targets
- /// should assume that the memset will be done using as many of the largest
- /// store operations first, followed by smaller ones, if necessary, per
- /// alignment restrictions. For example, storing 9 bytes on a 32-bit machine
- /// with 16-bit alignment would result in four 2-byte stores and one 1-byte
- /// store. This only applies to setting a constant array of a constant size.
- /// @brief Specify maximum number of store instructions per memset call.
- unsigned maxStoresPerMemset;
-
- /// When lowering %llvm.memcpy this field specifies the maximum number of
- /// store operations that may be substituted for a call to memcpy. Targets
- /// must set this value based on the cost threshold for that target. Targets
- /// should assume that the memcpy will be done using as many of the largest
- /// store operations first, followed by smaller ones, if necessary, per
- /// alignment restrictions. For example, storing 7 bytes on a 32-bit machine
- /// with 32-bit alignment would result in one 4-byte store, a one 2-byte store
- /// and one 1-byte store. This only applies to copying a constant array of
- /// constant size.
- /// @brief Specify maximum bytes of store instructions per memcpy call.
- unsigned maxStoresPerMemcpy;
-
- /// When lowering %llvm.memmove this field specifies the maximum number of
- /// store instructions that may be substituted for a call to memmove. Targets
- /// must set this value based on the cost threshold for that target. Targets
- /// should assume that the memmove will be done using as many of the largest
- /// store operations first, followed by smaller ones, if necessary, per
- /// alignment restrictions. For example, moving 9 bytes on a 32-bit machine
- /// with 8-bit alignment would result in nine 1-byte stores. This only
- /// applies to copying a constant array of constant size.
- /// @brief Specify maximum bytes of store instructions per memmove call.
- unsigned maxStoresPerMemmove;
-
- /// This field specifies whether the target machine permits unaligned memory
- /// accesses. This is used, for example, to determine the size of store
- /// operations when copying small arrays and other similar tasks.
- /// @brief Indicate whether the target permits unaligned memory accesses.
- bool allowUnalignedMemoryAccesses;
-};
-} // end llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/Target/TargetMachOWriterInfo.h b/release_23/include/llvm/Target/TargetMachOWriterInfo.h
deleted file mode 100644
index f723bb5bee6a..000000000000
--- a/release_23/include/llvm/Target/TargetMachOWriterInfo.h
+++ /dev/null
@@ -1,112 +0,0 @@
-//===-- llvm/Target/TargetMachOWriterInfo.h - MachO Writer Info--*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines the TargetMachOWriterInfo class.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_TARGET_TARGETMACHOWRITERINFO_H
-#define LLVM_TARGET_TARGETMACHOWRITERINFO_H
-
-#include "llvm/CodeGen/MachineRelocation.h"
-
-namespace llvm {
-
- class MachineBasicBlock;
- class OutputBuffer;
-
- //===--------------------------------------------------------------------===//
- // TargetMachOWriterInfo
- //===--------------------------------------------------------------------===//
-
- class TargetMachOWriterInfo {
- uint32_t CPUType; // CPU specifier
- uint32_t CPUSubType; // Machine specifier
- public:
- // The various CPU_TYPE_* constants are already defined by at least one
- // system header file and create compilation errors if not respected.
-#if !defined(CPU_TYPE_I386)
-#define CPU_TYPE_I386 7
-#endif
-#if !defined(CPU_TYPE_X86_64)
-#define CPU_TYPE_X86_64 (CPU_TYPE_I386 | 0x1000000)
-#endif
-#if !defined(CPU_TYPE_ARM)
-#define CPU_TYPE_ARM 12
-#endif
-#if !defined(CPU_TYPE_SPARC)
-#define CPU_TYPE_SPARC 14
-#endif
-#if !defined(CPU_TYPE_POWERPC)
-#define CPU_TYPE_POWERPC 18
-#endif
-#if !defined(CPU_TYPE_POWERPC64)
-#define CPU_TYPE_POWERPC64 (CPU_TYPE_POWERPC | 0x1000000)
-#endif
-
- // Constants for the cputype field
- // see <mach/machine.h>
- enum {
- HDR_CPU_TYPE_I386 = CPU_TYPE_I386,
- HDR_CPU_TYPE_X86_64 = CPU_TYPE_X86_64,
- HDR_CPU_TYPE_ARM = CPU_TYPE_ARM,
- HDR_CPU_TYPE_SPARC = CPU_TYPE_SPARC,
- HDR_CPU_TYPE_POWERPC = CPU_TYPE_POWERPC,
- HDR_CPU_TYPE_POWERPC64 = CPU_TYPE_POWERPC64
- };
-
-#if !defined(CPU_SUBTYPE_I386_ALL)
-#define CPU_SUBTYPE_I386_ALL 3
-#endif
-#if !defined(CPU_SUBTYPE_X86_64_ALL)
-#define CPU_SUBTYPE_X86_64_ALL 3
-#endif
-#if !defined(CPU_SUBTYPE_ARM_ALL)
-#define CPU_SUBTYPE_ARM_ALL 0
-#endif
-#if !defined(CPU_SUBTYPE_SPARC_ALL)
-#define CPU_SUBTYPE_SPARC_ALL 0
-#endif
-#if !defined(CPU_SUBTYPE_POWERPC_ALL)
-#define CPU_SUBTYPE_POWERPC_ALL 0
-#endif
-
- // Constants for the cpusubtype field
- // see <mach/machine.h>
- enum {
- HDR_CPU_SUBTYPE_I386_ALL = CPU_SUBTYPE_I386_ALL,
- HDR_CPU_SUBTYPE_X86_64_ALL = CPU_SUBTYPE_X86_64_ALL,
- HDR_CPU_SUBTYPE_ARM_ALL = CPU_SUBTYPE_ARM_ALL,
- HDR_CPU_SUBTYPE_SPARC_ALL = CPU_SUBTYPE_SPARC_ALL,
- HDR_CPU_SUBTYPE_POWERPC_ALL = CPU_SUBTYPE_POWERPC_ALL
- };
-
- TargetMachOWriterInfo(uint32_t cputype, uint32_t cpusubtype)
- : CPUType(cputype), CPUSubType(cpusubtype) {}
- virtual ~TargetMachOWriterInfo();
-
- virtual MachineRelocation GetJTRelocation(unsigned Offset,
- MachineBasicBlock *MBB) const;
-
- virtual unsigned GetTargetRelocation(MachineRelocation &MR,
- unsigned FromIdx,
- unsigned ToAddr,
- unsigned ToIdx,
- OutputBuffer &RelocOut,
- OutputBuffer &SecOut,
- bool Scattered,
- bool Extern) const { return 0; }
-
- uint32_t getCPUType() const { return CPUType; }
- uint32_t getCPUSubType() const { return CPUSubType; }
- };
-
-} // end llvm namespace
-
-#endif // LLVM_TARGET_TARGETMACHOWRITERINFO_H
diff --git a/release_23/include/llvm/Target/TargetMachine.h b/release_23/include/llvm/Target/TargetMachine.h
deleted file mode 100644
index 7c86a8d7dbe4..000000000000
--- a/release_23/include/llvm/Target/TargetMachine.h
+++ /dev/null
@@ -1,339 +0,0 @@
-//===-- llvm/Target/TargetMachine.h - Target Information --------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines the TargetMachine and LLVMTargetMachine classes.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_TARGET_TARGETMACHINE_H
-#define LLVM_TARGET_TARGETMACHINE_H
-
-#include "llvm/Target/TargetInstrItineraries.h"
-#include <cassert>
-#include <string>
-
-namespace llvm {
-
-class TargetAsmInfo;
-class TargetData;
-class TargetSubtarget;
-class TargetInstrInfo;
-class TargetJITInfo;
-class TargetLowering;
-class TargetFrameInfo;
-class MachineCodeEmitter;
-class TargetRegisterInfo;
-class Module;
-class PassManagerBase;
-class PassManager;
-class Pass;
-class TargetMachOWriterInfo;
-class TargetELFWriterInfo;
-
-// Relocation model types.
-namespace Reloc {
- enum Model {
- Default,
- Static,
- PIC_, // Cannot be named PIC due to collision with -DPIC
- DynamicNoPIC
- };
-}
-
-// Code model types.
-namespace CodeModel {
- enum Model {
- Default,
- Small,
- Kernel,
- Medium,
- Large
- };
-}
-
-namespace FileModel {
- enum Model {
- Error,
- None,
- AsmFile,
- MachOFile,
- ElfFile
- };
-}
-
-//===----------------------------------------------------------------------===//
-///
-/// TargetMachine - Primary interface to the complete machine description for
-/// the target machine. All target-specific information should be accessible
-/// through this interface.
-///
-class TargetMachine {
- TargetMachine(const TargetMachine &); // DO NOT IMPLEMENT
- void operator=(const TargetMachine &); // DO NOT IMPLEMENT
-protected: // Can only create subclasses.
- TargetMachine() : AsmInfo(NULL) { }
-
- /// getSubtargetImpl - virtual method implemented by subclasses that returns
- /// a reference to that target's TargetSubtarget-derived member variable.
- virtual const TargetSubtarget *getSubtargetImpl() const { return 0; }
-
- /// AsmInfo - Contains target specific asm information.
- ///
- mutable const TargetAsmInfo *AsmInfo;
-
- /// createTargetAsmInfo - Create a new instance of target specific asm
- /// information.
- virtual const TargetAsmInfo *createTargetAsmInfo() const { return NULL; }
-
-public:
- virtual ~TargetMachine();
-
- /// getModuleMatchQuality - This static method should be implemented by
- /// targets to indicate how closely they match the specified module. This is
- /// used by the LLC tool to determine which target to use when an explicit
- /// -march option is not specified. If a target returns zero, it will never
- /// be chosen without an explicit -march option.
- static unsigned getModuleMatchQuality(const Module &M) { return 0; }
-
- /// getJITMatchQuality - This static method should be implemented by targets
- /// that provide JIT capabilities to indicate how suitable they are for
- /// execution on the current host. If a value of 0 is returned, the target
- /// will not be used unless an explicit -march option is used.
- static unsigned getJITMatchQuality() { return 0; }
-
- // Interfaces to the major aspects of target machine information:
- // -- Instruction opcode and operand information
- // -- Pipelines and scheduling information
- // -- Stack frame information
- // -- Selection DAG lowering information
- //
- virtual const TargetInstrInfo *getInstrInfo() const { return 0; }
- virtual const TargetFrameInfo *getFrameInfo() const { return 0; }
- virtual TargetLowering *getTargetLowering() const { return 0; }
- virtual const TargetData *getTargetData() const { return 0; }
-
-
- /// getTargetAsmInfo - Return target specific asm information.
- ///
- const TargetAsmInfo *getTargetAsmInfo() const {
- if (!AsmInfo) AsmInfo = createTargetAsmInfo();
- return AsmInfo;
- }
-
- /// getSubtarget - This method returns a pointer to the specified type of
- /// TargetSubtarget. In debug builds, it verifies that the object being
- /// returned is of the correct type.
- template<typename STC> const STC &getSubtarget() const {
- const TargetSubtarget *TST = getSubtargetImpl();
- assert(TST && dynamic_cast<const STC*>(TST) &&
- "Not the right kind of subtarget!");
- return *static_cast<const STC*>(TST);
- }
-
- /// getRegisterInfo - If register information is available, return it. If
- /// not, return null. This is kept separate from RegInfo until RegInfo has
- /// details of graph coloring register allocation removed from it.
- ///
- virtual const TargetRegisterInfo *getRegisterInfo() const { return 0; }
-
- /// getJITInfo - If this target supports a JIT, return information for it,
- /// otherwise return null.
- ///
- virtual TargetJITInfo *getJITInfo() { return 0; }
-
- /// getInstrItineraryData - Returns instruction itinerary data for the target
- /// or specific subtarget.
- ///
- virtual const InstrItineraryData getInstrItineraryData() const {
- return InstrItineraryData();
- }
-
- /// getMachOWriterInfo - If this target supports a Mach-O writer, return
- /// information for it, otherwise return null.
- ///
- virtual const TargetMachOWriterInfo *getMachOWriterInfo() const { return 0; }
-
- /// getELFWriterInfo - If this target supports an ELF writer, return
- /// information for it, otherwise return null.
- ///
- virtual const TargetELFWriterInfo *getELFWriterInfo() const { return 0; }
-
- /// getRelocationModel - Returns the code generation relocation model. The
- /// choices are static, PIC, and dynamic-no-pic, and target default.
- static Reloc::Model getRelocationModel();
-
- /// setRelocationModel - Sets the code generation relocation model.
- static void setRelocationModel(Reloc::Model Model);
-
- /// getCodeModel - Returns the code model. The choices are small, kernel,
- /// medium, large, and target default.
- static CodeModel::Model getCodeModel();
-
- /// setCodeModel - Sets the code model.
- static void setCodeModel(CodeModel::Model Model);
-
- /// CodeGenFileType - These enums are meant to be passed into
- /// addPassesToEmitFile to indicate what type of file to emit.
- enum CodeGenFileType {
- AssemblyFile, ObjectFile, DynamicLibrary
- };
-
- /// getEnableTailMergeDefault - the default setting for -enable-tail-merge
- /// on this target. User flag overrides.
- virtual bool getEnableTailMergeDefault() const { return true; }
-
- /// addPassesToEmitFile - Add passes to the specified pass manager to get the
- /// specified file emitted. Typically this will involve several steps of code
- /// generation. If Fast is set to true, the code generator should emit code
- /// as fast as possible, though the generated code may be less efficient.
- /// This method should return FileModel::Error if emission of this file type
- /// is not supported.
- ///
- virtual FileModel::Model addPassesToEmitFile(PassManagerBase &PM,
- std::ostream &Out,
- CodeGenFileType FileType,
- bool Fast) {
- return FileModel::None;
- }
-
- /// addPassesToEmitFileFinish - If the passes to emit the specified file had
- /// to be split up (e.g., to add an object writer pass), this method can be
- /// used to finish up adding passes to emit the file, if necessary.
- ///
- virtual bool addPassesToEmitFileFinish(PassManagerBase &PM,
- MachineCodeEmitter *MCE, bool Fast) {
- return true;
- }
-
- /// addPassesToEmitMachineCode - Add passes to the specified pass manager to
- /// get machine code emitted. This uses a MachineCodeEmitter object to handle
- /// actually outputting the machine code and resolving things like the address
- /// of functions. This method returns true if machine code emission is
- /// not supported.
- ///
- virtual bool addPassesToEmitMachineCode(PassManagerBase &PM,
- MachineCodeEmitter &MCE, bool Fast) {
- return true;
- }
-
- /// addPassesToEmitWholeFile - This method can be implemented by targets that
- /// require having the entire module at once. This is not recommended, do not
- /// use this.
- virtual bool WantsWholeFile() const { return false; }
- virtual bool addPassesToEmitWholeFile(PassManager &PM, std::ostream &Out,
- CodeGenFileType FileType, bool Fast) {
- return true;
- }
-};
-
-/// LLVMTargetMachine - This class describes a target machine that is
-/// implemented with the LLVM target-independent code generator.
-///
-class LLVMTargetMachine : public TargetMachine {
-protected: // Can only create subclasses.
- LLVMTargetMachine() { }
-public:
-
- /// addPassesToEmitFile - Add passes to the specified pass manager to get the
- /// specified file emitted. Typically this will involve several steps of code
- /// generation. If Fast is set to true, the code generator should emit code
- /// as fast as possible, though the generated code may be less efficient.
- /// This method should return FileModel::Error if emission of this file type
- /// is not supported.
- ///
- /// The default implementation of this method adds components from the
- /// LLVM retargetable code generator, invoking the methods below to get
- /// target-specific passes in standard locations.
- ///
- virtual FileModel::Model addPassesToEmitFile(PassManagerBase &PM,
- std::ostream &Out,
- CodeGenFileType FileType,
- bool Fast);
-
- /// addPassesToEmitFileFinish - If the passes to emit the specified file had
- /// to be split up (e.g., to add an object writer pass), this method can be
- /// used to finish up adding passes to emit the file, if necessary.
- ///
- virtual bool addPassesToEmitFileFinish(PassManagerBase &PM,
- MachineCodeEmitter *MCE, bool Fast);
-
- /// addPassesToEmitMachineCode - Add passes to the specified pass manager to
- /// get machine code emitted. This uses a MachineCodeEmitter object to handle
- /// actually outputting the machine code and resolving things like the address
- /// of functions. This method returns true if machine code emission is
- /// not supported.
- ///
- virtual bool addPassesToEmitMachineCode(PassManagerBase &PM,
- MachineCodeEmitter &MCE, bool Fast);
-
- /// Target-Independent Code Generator Pass Configuration Options.
-
- /// addInstSelector - This method should add any "last minute" LLVM->LLVM
- /// passes, then install an instruction selector pass, which converts from
- /// LLVM code to machine instructions.
- virtual bool addInstSelector(PassManagerBase &PM, bool Fast) {
- return true;
- }
-
- /// addPreRegAllocPasses - This method may be implemented by targets that want
- /// to run passes immediately before register allocation. This should return
- /// true if -print-machineinstrs should print after these passes.
- virtual bool addPreRegAlloc(PassManagerBase &PM, bool Fast) {
- return false;
- }
-
- /// addPostRegAllocPasses - This method may be implemented by targets that
- /// want to run passes after register allocation but before prolog-epilog
- /// insertion. This should return true if -print-machineinstrs should print
- /// after these passes.
- virtual bool addPostRegAlloc(PassManagerBase &PM, bool Fast) {
- return false;
- }
-
- /// addPreEmitPass - This pass may be implemented by targets that want to run
- /// passes immediately before machine code is emitted. This should return
- /// true if -print-machineinstrs should print out the code after the passes.
- virtual bool addPreEmitPass(PassManagerBase &PM, bool Fast) {
- return false;
- }
-
-
- /// addAssemblyEmitter - This pass should be overridden by the target to add
- /// the asmprinter, if asm emission is supported. If this is not supported,
- /// 'true' should be returned.
- virtual bool addAssemblyEmitter(PassManagerBase &PM, bool Fast,
- std::ostream &Out) {
- return true;
- }
-
- /// addCodeEmitter - This pass should be overridden by the target to add a
- /// code emitter, if supported. If this is not supported, 'true' should be
- /// returned. If DumpAsm is true, the generated assembly is printed to cerr.
- virtual bool addCodeEmitter(PassManagerBase &PM, bool Fast, bool DumpAsm,
- MachineCodeEmitter &MCE) {
- return true;
- }
-
- /// addSimpleCodeEmitter - This pass should be overridden by the target to add
- /// a code emitter (without setting flags), if supported. If this is not
- /// supported, 'true' should be returned. If DumpAsm is true, the generated
- /// assembly is printed to cerr.
- virtual bool addSimpleCodeEmitter(PassManagerBase &PM, bool Fast,
- bool DumpAsm, MachineCodeEmitter &MCE) {
- return true;
- }
-
- /// getEnableTailMergeDefault - the default setting for -enable-tail-merge
- /// on this target. User flag overrides.
- virtual bool getEnableTailMergeDefault() const { return true; }
-};
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/Target/TargetMachineRegistry.h b/release_23/include/llvm/Target/TargetMachineRegistry.h
deleted file mode 100644
index 2607ad5e6391..000000000000
--- a/release_23/include/llvm/Target/TargetMachineRegistry.h
+++ /dev/null
@@ -1,96 +0,0 @@
-//===-- Target/TargetMachineRegistry.h - Target Registration ----*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file exposes two classes: the TargetMachineRegistry class, which allows
-// tools to inspect all of registered targets, and the RegisterTarget class,
-// which TargetMachine implementations should use to register themselves with
-// the system.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_TARGET_TARGETMACHINEREGISTRY_H
-#define LLVM_TARGET_TARGETMACHINEREGISTRY_H
-
-#include "llvm/Support/Registry.h"
-
-namespace llvm {
- class Module;
- class TargetMachine;
-
- struct TargetMachineRegistryEntry {
- const char *Name;
- const char *ShortDesc;
- TargetMachine *(*CtorFn)(const Module &, const std::string &);
- unsigned (*ModuleMatchQualityFn)(const Module &M);
- unsigned (*JITMatchQualityFn)();
-
- public:
- TargetMachineRegistryEntry(const char *N, const char *SD,
- TargetMachine *(*CF)(const Module &, const std::string &),
- unsigned (*MMF)(const Module &M),
- unsigned (*JMF)())
- : Name(N), ShortDesc(SD), CtorFn(CF), ModuleMatchQualityFn(MMF),
- JITMatchQualityFn(JMF) {}
- };
-
- template<>
- class RegistryTraits<TargetMachine> {
- public:
- typedef TargetMachineRegistryEntry entry;
-
- static const char *nameof(const entry &Entry) { return Entry.Name; }
- static const char *descof(const entry &Entry) { return Entry.ShortDesc; }
- };
-
- struct TargetMachineRegistry : public Registry<TargetMachine> {
- /// getClosestStaticTargetForModule - Given an LLVM module, pick the best
- /// target that is compatible with the module. If no close target can be
- /// found, this returns null and sets the Error string to a reason.
- static const entry *getClosestStaticTargetForModule(const Module &M,
- std::string &Error);
-
- /// getClosestTargetForJIT - Pick the best target that is compatible with
- /// the current host. If no close target can be found, this returns null
- /// and sets the Error string to a reason.
- static const entry *getClosestTargetForJIT(std::string &Error);
-
- };
-
- //===--------------------------------------------------------------------===//
- /// RegisterTarget - This class is used to make targets automatically register
- /// themselves with the tool they are linked. Targets should define an
- /// instance of this and implement the static methods described in the
- /// TargetMachine comments.
- /// The type 'TargetMachineImpl' should provide a constructor with two
- /// parameters:
- /// - const Module& M: the module that is being compiled:
- /// - const std::string& FS: target-specific string describing target
- /// flavour.
-
- template<class TargetMachineImpl>
- struct RegisterTarget {
- RegisterTarget(const char *Name, const char *ShortDesc)
- : Entry(Name, ShortDesc, &Allocator,
- &TargetMachineImpl::getModuleMatchQuality,
- &TargetMachineImpl::getJITMatchQuality),
- Node(Entry)
- {}
-
- private:
- TargetMachineRegistry::entry Entry;
- TargetMachineRegistry::node Node;
-
- static TargetMachine *Allocator(const Module &M, const std::string &FS) {
- return new TargetMachineImpl(M, FS);
- }
- };
-
-}
-
-#endif
diff --git a/release_23/include/llvm/Target/TargetOptions.h b/release_23/include/llvm/Target/TargetOptions.h
deleted file mode 100644
index ac3a6081edc3..000000000000
--- a/release_23/include/llvm/Target/TargetOptions.h
+++ /dev/null
@@ -1,98 +0,0 @@
-//===-- llvm/Target/TargetOptions.h - Target Options ------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines command line option flags that are shared across various
-// targets.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_TARGET_TARGETOPTIONS_H
-#define LLVM_TARGET_TARGETOPTIONS_H
-
-namespace llvm {
- /// PrintMachineCode - This flag is enabled when the -print-machineinstrs
- /// option is specified on the command line, and should enable debugging
- /// output from the code generator.
- extern bool PrintMachineCode;
-
- /// NoFramePointerElim - This flag is enabled when the -disable-fp-elim is
- /// specified on the command line. If the target supports the frame pointer
- /// elimination optimization, this option should disable it.
- extern bool NoFramePointerElim;
-
- /// NoExcessFPPrecision - This flag is enabled when the
- /// -disable-excess-fp-precision flag is specified on the command line. When
- /// this flag is off (the default), the code generator is allowed to produce
- /// results that are "more precise" than IEEE allows. This includes use of
- /// FMA-like operations and use of the X86 FP registers without rounding all
- /// over the place.
- extern bool NoExcessFPPrecision;
-
- /// UnsafeFPMath - This flag is enabled when the
- /// -enable-unsafe-fp-math flag is specified on the command line. When
- /// this flag is off (the default), the code generator is not allowed to
- /// produce results that are "less precise" than IEEE allows. This includes
- /// use of X86 instructions like FSIN and FCOS instead of libcalls.
- /// UnsafeFPMath implies FiniteOnlyFPMath.
- extern bool UnsafeFPMath;
-
- /// FiniteOnlyFPMath - This returns true when the -enable-finite-only-fp-math
- /// option is specified on the command line. If this returns false (default),
- /// the code generator is not allowed to assume that FP arithmetic arguments
- /// and results are never NaNs or +-Infs.
- extern bool FiniteOnlyFPMathOption;
- extern bool FiniteOnlyFPMath();
-
- /// HonorSignDependentRoundingFPMath - This returns true when the
- /// -enable-sign-dependent-rounding-fp-math is specified. If this returns
- /// false (the default), the code generator is allowed to assume that the
- /// rounding behavior is the default (round-to-zero for all floating point to
- /// integer conversions, and round-to-nearest for all other arithmetic
- /// truncations). If this is enabled (set to true), the code generator must
- /// assume that the rounding mode may dynamically change.
- extern bool HonorSignDependentRoundingFPMathOption;
- extern bool HonorSignDependentRoundingFPMath();
-
- /// UseSoftFloat - This flag is enabled when the -soft-float flag is specified
- /// on the command line. When this flag is on, the code generator will
- /// generate libcalls to the software floating point library instead of
- /// target FP instructions.
- extern bool UseSoftFloat;
-
- /// NoZerosInBSS - By default some codegens place zero-initialized data to
- /// .bss section. This flag disables such behaviour (necessary, e.g. for
- /// crt*.o compiling).
- extern bool NoZerosInBSS;
-
- /// ExceptionHandling - This flag indicates that exception information should
- /// be emitted.
- extern bool ExceptionHandling;
-
- /// UnwindTablesMandatory - This flag indicates that unwind tables should
- /// be emitted for all functions.
- extern bool UnwindTablesMandatory;
-
- /// PerformTailCallOpt - This flag is enabled when -tailcallopt is specified
- /// on the commandline. When the flag is on, the target will perform tail call
- /// optimization (pop the caller's stack) providing it supports it.
- extern bool PerformTailCallOpt;
-
- /// OptimizeForSize - When this flag is set, the code generator avoids
- /// optimizations that increase size.
- extern bool OptimizeForSize;
-
- /// StackAlignment - Override default stack alignment for target.
- extern unsigned StackAlignment;
-
- /// RealignStack - This flag indicates, whether stack should be automatically
- /// realigned, if needed.
- extern bool RealignStack;
-} // End llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/Target/TargetRegisterInfo.h b/release_23/include/llvm/Target/TargetRegisterInfo.h
deleted file mode 100644
index f606c8814f93..000000000000
--- a/release_23/include/llvm/Target/TargetRegisterInfo.h
+++ /dev/null
@@ -1,618 +0,0 @@
-//=== Target/TargetRegisterInfo.h - Target Register Information -*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file describes an abstract interface used to get information about a
-// target machines register file. This information is used for a variety of
-// purposed, especially register allocation.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_TARGET_TARGETREGISTERINFO_H
-#define LLVM_TARGET_TARGETREGISTERINFO_H
-
-#include "llvm/ADT/SmallVector.h"
-#include "llvm/CodeGen/MachineBasicBlock.h"
-#include "llvm/CodeGen/ValueTypes.h"
-#include <cassert>
-#include <functional>
-
-namespace llvm {
-
-class BitVector;
-class MachineFunction;
-class MachineInstr;
-class MachineMove;
-class RegScavenger;
-class SDNode;
-class SelectionDAG;
-class TargetRegisterClass;
-class Type;
-
-/// TargetRegisterDesc - This record contains all of the information known about
-/// a particular register. The AliasSet field (if not null) contains a pointer
-/// to a Zero terminated array of registers that this register aliases. This is
-/// needed for architectures like X86 which have AL alias AX alias EAX.
-/// Registers that this does not apply to simply should set this to null.
-/// The SubRegs field is a zero terminated array of registers that are
-/// sub-registers of the specific register, e.g. AL, AH are sub-registers of AX.
-/// The ImmsubRegs field is a subset of SubRegs. It includes only the immediate
-/// sub-registers. e.g. EAX has only one immediate sub-register of AX, not AH,
-/// AL which are immediate sub-registers of AX. The SuperRegs field is a zero
-/// terminated array of registers that are super-registers of the specific
-/// register, e.g. RAX, EAX, are super-registers of AX.
-///
-struct TargetRegisterDesc {
- const char *AsmName; // Assembly language name for the register
- const char *Name; // Printable name for the reg (for debugging)
- const unsigned *AliasSet; // Register Alias Set, described above
- const unsigned *SubRegs; // Sub-register set, described above
- const unsigned *ImmSubRegs; // Immediate sub-register set, described above
- const unsigned *SuperRegs; // Super-register set, described above
-};
-
-class TargetRegisterClass {
-public:
- typedef const unsigned* iterator;
- typedef const unsigned* const_iterator;
-
- typedef const MVT::ValueType* vt_iterator;
- typedef const TargetRegisterClass* const * sc_iterator;
-private:
- unsigned ID;
- bool isSubClass;
- const vt_iterator VTs;
- const sc_iterator SubClasses;
- const sc_iterator SuperClasses;
- const sc_iterator SubRegClasses;
- const sc_iterator SuperRegClasses;
- const unsigned RegSize, Alignment; // Size & Alignment of register in bytes
- const int CopyCost;
- const iterator RegsBegin, RegsEnd;
-public:
- TargetRegisterClass(unsigned id,
- const MVT::ValueType *vts,
- const TargetRegisterClass * const *subcs,
- const TargetRegisterClass * const *supcs,
- const TargetRegisterClass * const *subregcs,
- const TargetRegisterClass * const *superregcs,
- unsigned RS, unsigned Al, int CC,
- iterator RB, iterator RE)
- : ID(id), VTs(vts), SubClasses(subcs), SuperClasses(supcs),
- SubRegClasses(subregcs), SuperRegClasses(superregcs),
- RegSize(RS), Alignment(Al), CopyCost(CC), RegsBegin(RB), RegsEnd(RE) {}
- virtual ~TargetRegisterClass() {} // Allow subclasses
-
- /// getID() - Return the register class ID number.
- ///
- unsigned getID() const { return ID; }
-
- /// begin/end - Return all of the registers in this class.
- ///
- iterator begin() const { return RegsBegin; }
- iterator end() const { return RegsEnd; }
-
- /// getNumRegs - Return the number of registers in this class.
- ///
- unsigned getNumRegs() const { return (unsigned)(RegsEnd-RegsBegin); }
-
- /// getRegister - Return the specified register in the class.
- ///
- unsigned getRegister(unsigned i) const {
- assert(i < getNumRegs() && "Register number out of range!");
- return RegsBegin[i];
- }
-
- /// contains - Return true if the specified register is included in this
- /// register class.
- bool contains(unsigned Reg) const {
- for (iterator I = begin(), E = end(); I != E; ++I)
- if (*I == Reg) return true;
- return false;
- }
-
- /// hasType - return true if this TargetRegisterClass has the ValueType vt.
- ///
- bool hasType(MVT::ValueType vt) const {
- for(int i = 0; VTs[i] != MVT::Other; ++i)
- if (VTs[i] == vt)
- return true;
- return false;
- }
-
- /// vt_begin / vt_end - Loop over all of the value types that can be
- /// represented by values in this register class.
- vt_iterator vt_begin() const {
- return VTs;
- }
-
- vt_iterator vt_end() const {
- vt_iterator I = VTs;
- while (*I != MVT::Other) ++I;
- return I;
- }
-
- /// hasSubClass - return true if the specified TargetRegisterClass is a
- /// sub-register class of this TargetRegisterClass.
- bool hasSubClass(const TargetRegisterClass *cs) const {
- for (int i = 0; SubClasses[i] != NULL; ++i)
- if (SubClasses[i] == cs)
- return true;
- return false;
- }
-
- /// subclasses_begin / subclasses_end - Loop over all of the sub-classes of
- /// this register class.
- sc_iterator subclasses_begin() const {
- return SubClasses;
- }
-
- sc_iterator subclasses_end() const {
- sc_iterator I = SubClasses;
- while (*I != NULL) ++I;
- return I;
- }
-
- /// hasSuperClass - return true if the specified TargetRegisterClass is a
- /// super-register class of this TargetRegisterClass.
- bool hasSuperClass(const TargetRegisterClass *cs) const {
- for (int i = 0; SuperClasses[i] != NULL; ++i)
- if (SuperClasses[i] == cs)
- return true;
- return false;
- }
-
- /// superclasses_begin / superclasses_end - Loop over all of the super-classes
- /// of this register class.
- sc_iterator superclasses_begin() const {
- return SuperClasses;
- }
-
- sc_iterator superclasses_end() const {
- sc_iterator I = SuperClasses;
- while (*I != NULL) ++I;
- return I;
- }
-
- /// hasSubRegClass - return true if the specified TargetRegisterClass is a
- /// class of a sub-register class for this TargetRegisterClass.
- bool hasSubRegClass(const TargetRegisterClass *cs) const {
- for (int i = 0; SubRegClasses[i] != NULL; ++i)
- if (SubRegClasses[i] == cs)
- return true;
- return false;
- }
-
- /// hasClassForSubReg - return true if the specified TargetRegisterClass is a
- /// class of a sub-register class for this TargetRegisterClass.
- bool hasClassForSubReg(unsigned SubReg) const {
- --SubReg;
- for (unsigned i = 0; SubRegClasses[i] != NULL; ++i)
- if (i == SubReg)
- return true;
- return false;
- }
-
- /// getClassForSubReg - return theTargetRegisterClass for the sub-register
- /// at idx for this TargetRegisterClass.
- sc_iterator getClassForSubReg(unsigned SubReg) const {
- --SubReg;
- for (unsigned i = 0; SubRegClasses[i] != NULL; ++i)
- if (i == SubReg)
- return &SubRegClasses[i];
- assert(0 && "Invalid subregister index for register class");
- return NULL;
- }
-
- /// subregclasses_begin / subregclasses_end - Loop over all of
- /// the subregister classes of this register class.
- sc_iterator subregclasses_begin() const {
- return SubRegClasses;
- }
-
- sc_iterator subregclasses_end() const {
- sc_iterator I = SubRegClasses;
- while (*I != NULL) ++I;
- return I;
- }
-
- /// superregclasses_begin / superregclasses_end - Loop over all of
- /// the superregister classes of this register class.
- sc_iterator superregclasses_begin() const {
- return SuperRegClasses;
- }
-
- sc_iterator superregclasses_end() const {
- sc_iterator I = SuperRegClasses;
- while (*I != NULL) ++I;
- return I;
- }
-
- /// allocation_order_begin/end - These methods define a range of registers
- /// which specify the registers in this class that are valid to register
- /// allocate, and the preferred order to allocate them in. For example,
- /// callee saved registers should be at the end of the list, because it is
- /// cheaper to allocate caller saved registers.
- ///
- /// These methods take a MachineFunction argument, which can be used to tune
- /// the allocatable registers based on the characteristics of the function.
- /// One simple example is that the frame pointer register can be used if
- /// frame-pointer-elimination is performed.
- ///
- /// By default, these methods return all registers in the class.
- ///
- virtual iterator allocation_order_begin(const MachineFunction &MF) const {
- return begin();
- }
- virtual iterator allocation_order_end(const MachineFunction &MF) const {
- return end();
- }
-
-
-
- /// getSize - Return the size of the register in bytes, which is also the size
- /// of a stack slot allocated to hold a spilled copy of this register.
- unsigned getSize() const { return RegSize; }
-
- /// getAlignment - Return the minimum required alignment for a register of
- /// this class.
- unsigned getAlignment() const { return Alignment; }
-
- /// getCopyCost - Return the cost of copying a value between two registers in
- /// this class.
- int getCopyCost() const { return CopyCost; }
-};
-
-
-/// TargetRegisterInfo base class - We assume that the target defines a static
-/// array of TargetRegisterDesc objects that represent all of the machine
-/// registers that the target has. As such, we simply have to track a pointer
-/// to this array so that we can turn register number into a register
-/// descriptor.
-///
-class TargetRegisterInfo {
-public:
- typedef const TargetRegisterClass * const * regclass_iterator;
-private:
- const TargetRegisterDesc *Desc; // Pointer to the descriptor array
- unsigned NumRegs; // Number of entries in the array
-
- regclass_iterator RegClassBegin, RegClassEnd; // List of regclasses
-
- int CallFrameSetupOpcode, CallFrameDestroyOpcode;
-protected:
- TargetRegisterInfo(const TargetRegisterDesc *D, unsigned NR,
- regclass_iterator RegClassBegin,
- regclass_iterator RegClassEnd,
- int CallFrameSetupOpcode = -1,
- int CallFrameDestroyOpcode = -1);
- virtual ~TargetRegisterInfo();
-public:
-
- enum { // Define some target independent constants
- /// NoRegister - This physical register is not a real target register. It
- /// is useful as a sentinal.
- NoRegister = 0,
-
- /// FirstVirtualRegister - This is the first register number that is
- /// considered to be a 'virtual' register, which is part of the SSA
- /// namespace. This must be the same for all targets, which means that each
- /// target is limited to 1024 registers.
- FirstVirtualRegister = 1024
- };
-
- /// isPhysicalRegister - Return true if the specified register number is in
- /// the physical register namespace.
- static bool isPhysicalRegister(unsigned Reg) {
- assert(Reg && "this is not a register!");
- return Reg < FirstVirtualRegister;
- }
-
- /// isVirtualRegister - Return true if the specified register number is in
- /// the virtual register namespace.
- static bool isVirtualRegister(unsigned Reg) {
- assert(Reg && "this is not a register!");
- return Reg >= FirstVirtualRegister;
- }
-
- /// getPhysicalRegisterRegClass - Returns the Register Class of a physical
- /// register of the given type. If type is MVT::Other, then just return any
- /// register class the register belongs to.
- const TargetRegisterClass *getPhysicalRegisterRegClass(unsigned Reg,
- MVT::ValueType VT = MVT::Other) const;
-
- /// getAllocatableSet - Returns a bitset indexed by register number
- /// indicating if a register is allocatable or not. If a register class is
- /// specified, returns the subset for the class.
- BitVector getAllocatableSet(MachineFunction &MF,
- const TargetRegisterClass *RC = NULL) const;
-
- const TargetRegisterDesc &operator[](unsigned RegNo) const {
- assert(RegNo < NumRegs &&
- "Attempting to access record for invalid register number!");
- return Desc[RegNo];
- }
-
- /// Provide a get method, equivalent to [], but more useful if we have a
- /// pointer to this object.
- ///
- const TargetRegisterDesc &get(unsigned RegNo) const {
- return operator[](RegNo);
- }
-
- /// getAliasSet - Return the set of registers aliased by the specified
- /// register, or a null list of there are none. The list returned is zero
- /// terminated.
- ///
- const unsigned *getAliasSet(unsigned RegNo) const {
- return get(RegNo).AliasSet;
- }
-
- /// getSubRegisters - Return the list of registers that are sub-registers of
- /// the specified register, or a null list of there are none. The list
- /// returned is zero terminated and sorted according to super-sub register
- /// relations. e.g. X86::RAX's sub-register list is EAX, AX, AL, AH.
- ///
- const unsigned *getSubRegisters(unsigned RegNo) const {
- return get(RegNo).SubRegs;
- }
-
- /// getImmediateSubRegisters - Return the set of registers that are immediate
- /// sub-registers of the specified register, or a null list of there are none.
- /// The list returned is zero terminated.
- ///
- const unsigned *getImmediateSubRegisters(unsigned RegNo) const {
- return get(RegNo).ImmSubRegs;
- }
-
- /// getSuperRegisters - Return the list of registers that are super-registers
- /// of the specified register, or a null list of there are none. The list
- /// returned is zero terminated and sorted according to super-sub register
- /// relations. e.g. X86::AL's super-register list is RAX, EAX, AX.
- ///
- const unsigned *getSuperRegisters(unsigned RegNo) const {
- return get(RegNo).SuperRegs;
- }
-
- /// getAsmName - Return the symbolic target-specific name for the
- /// specified physical register.
- const char *getAsmName(unsigned RegNo) const {
- return get(RegNo).AsmName;
- }
-
- /// getName - Return the human-readable symbolic target-specific name for the
- /// specified physical register.
- const char *getName(unsigned RegNo) const {
- return get(RegNo).Name;
- }
-
- /// getNumRegs - Return the number of registers this target has (useful for
- /// sizing arrays holding per register information)
- unsigned getNumRegs() const {
- return NumRegs;
- }
-
- /// areAliases - Returns true if the two registers alias each other, false
- /// otherwise
- bool areAliases(unsigned regA, unsigned regB) const {
- for (const unsigned *Alias = getAliasSet(regA); *Alias; ++Alias)
- if (*Alias == regB) return true;
- return false;
- }
-
- /// regsOverlap - Returns true if the two registers are equal or alias each
- /// other. The registers may be virtual register.
- bool regsOverlap(unsigned regA, unsigned regB) const {
- if (regA == regB)
- return true;
-
- if (isVirtualRegister(regA) || isVirtualRegister(regB))
- return false;
- return areAliases(regA, regB);
- }
-
- /// isSubRegister - Returns true if regB is a sub-register of regA.
- ///
- bool isSubRegister(unsigned regA, unsigned regB) const {
- for (const unsigned *SR = getSubRegisters(regA); *SR; ++SR)
- if (*SR == regB) return true;
- return false;
- }
-
- /// isSuperRegister - Returns true if regB is a super-register of regA.
- ///
- bool isSuperRegister(unsigned regA, unsigned regB) const {
- for (const unsigned *SR = getSuperRegisters(regA); *SR; ++SR)
- if (*SR == regB) return true;
- return false;
- }
-
- /// getCalleeSavedRegs - Return a null-terminated list of all of the
- /// callee saved registers on this target. The register should be in the
- /// order of desired callee-save stack frame offset. The first register is
- /// closed to the incoming stack pointer if stack grows down, and vice versa.
- virtual const unsigned* getCalleeSavedRegs(const MachineFunction *MF = 0)
- const = 0;
-
- /// getCalleeSavedRegClasses - Return a null-terminated list of the preferred
- /// register classes to spill each callee saved register with. The order and
- /// length of this list match the getCalleeSaveRegs() list.
- virtual const TargetRegisterClass* const *getCalleeSavedRegClasses(
- const MachineFunction *MF) const =0;
-
- /// getReservedRegs - Returns a bitset indexed by physical register number
- /// indicating if a register is a special register that has particular uses
- /// and should be considered unavailable at all times, e.g. SP, RA. This is
- /// used by register scavenger to determine what registers are free.
- virtual BitVector getReservedRegs(const MachineFunction &MF) const = 0;
-
- /// getSubReg - Returns the physical register number of sub-register "Index"
- /// for physical register RegNo.
- virtual unsigned getSubReg(unsigned RegNo, unsigned Index) const = 0;
-
- //===--------------------------------------------------------------------===//
- // Register Class Information
- //
-
- /// Register class iterators
- ///
- regclass_iterator regclass_begin() const { return RegClassBegin; }
- regclass_iterator regclass_end() const { return RegClassEnd; }
-
- unsigned getNumRegClasses() const {
- return (unsigned)(regclass_end()-regclass_begin());
- }
-
- /// getRegClass - Returns the register class associated with the enumeration
- /// value. See class TargetOperandInfo.
- const TargetRegisterClass *getRegClass(unsigned i) const {
- assert(i <= getNumRegClasses() && "Register Class ID out of range");
- return i ? RegClassBegin[i - 1] : NULL;
- }
-
- //===--------------------------------------------------------------------===//
- // Interfaces used by the register allocator and stack frame
- // manipulation passes to move data around between registers,
- // immediates and memory. FIXME: Move these to TargetInstrInfo.h.
- //
-
- /// getCrossCopyRegClass - Returns a legal register class to copy a register
- /// in the specified class to or from. Returns NULL if it is possible to copy
- /// between a two registers of the specified class.
- virtual const TargetRegisterClass *
- getCrossCopyRegClass(const TargetRegisterClass *RC) const {
- return NULL;
- }
-
- /// targetHandlesStackFrameRounding - Returns true if the target is
- /// responsible for rounding up the stack frame (probably at emitPrologue
- /// time).
- virtual bool targetHandlesStackFrameRounding() const {
- return false;
- }
-
- /// requiresRegisterScavenging - returns true if the target requires (and can
- /// make use of) the register scavenger.
- virtual bool requiresRegisterScavenging(const MachineFunction &MF) const {
- return false;
- }
-
- /// hasFP - Return true if the specified function should have a dedicated
- /// frame pointer register. For most targets this is true only if the function
- /// has variable sized allocas or if frame pointer elimination is disabled.
- virtual bool hasFP(const MachineFunction &MF) const = 0;
-
- // hasReservedCallFrame - Under normal circumstances, when a frame pointer is
- // not required, we reserve argument space for call sites in the function
- // immediately on entry to the current function. This eliminates the need for
- // add/sub sp brackets around call sites. Returns true if the call frame is
- // included as part of the stack frame.
- virtual bool hasReservedCallFrame(MachineFunction &MF) const {
- return !hasFP(MF);
- }
-
- /// getCallFrameSetup/DestroyOpcode - These methods return the opcode of the
- /// frame setup/destroy instructions if they exist (-1 otherwise). Some
- /// targets use pseudo instructions in order to abstract away the difference
- /// between operating with a frame pointer and operating without, through the
- /// use of these two instructions.
- ///
- int getCallFrameSetupOpcode() const { return CallFrameSetupOpcode; }
- int getCallFrameDestroyOpcode() const { return CallFrameDestroyOpcode; }
-
-
- /// eliminateCallFramePseudoInstr - This method is called during prolog/epilog
- /// code insertion to eliminate call frame setup and destroy pseudo
- /// instructions (but only if the Target is using them). It is responsible
- /// for eliminating these instructions, replacing them with concrete
- /// instructions. This method need only be implemented if using call frame
- /// setup/destroy pseudo instructions.
- ///
- virtual void
- eliminateCallFramePseudoInstr(MachineFunction &MF,
- MachineBasicBlock &MBB,
- MachineBasicBlock::iterator MI) const {
- assert(getCallFrameSetupOpcode()== -1 && getCallFrameDestroyOpcode()== -1 &&
- "eliminateCallFramePseudoInstr must be implemented if using"
- " call frame setup/destroy pseudo instructions!");
- assert(0 && "Call Frame Pseudo Instructions do not exist on this target!");
- }
-
- /// processFunctionBeforeCalleeSavedScan - This method is called immediately
- /// before PrologEpilogInserter scans the physical registers used to determine
- /// what callee saved registers should be spilled. This method is optional.
- virtual void processFunctionBeforeCalleeSavedScan(MachineFunction &MF,
- RegScavenger *RS = NULL) const {
-
- }
-
- /// processFunctionBeforeFrameFinalized - This method is called immediately
- /// before the specified functions frame layout (MF.getFrameInfo()) is
- /// finalized. Once the frame is finalized, MO_FrameIndex operands are
- /// replaced with direct constants. This method is optional.
- ///
- virtual void processFunctionBeforeFrameFinalized(MachineFunction &MF) const {
- }
-
- /// eliminateFrameIndex - This method must be overriden to eliminate abstract
- /// frame indices from instructions which may use them. The instruction
- /// referenced by the iterator contains an MO_FrameIndex operand which must be
- /// eliminated by this method. This method may modify or replace the
- /// specified instruction, as long as it keeps the iterator pointing the the
- /// finished product. SPAdj is the SP adjustment due to call frame setup
- /// instruction. The return value is the number of instructions added to
- /// (negative if removed from) the basic block.
- ///
- virtual void eliminateFrameIndex(MachineBasicBlock::iterator MI,
- int SPAdj, RegScavenger *RS=NULL) const = 0;
-
- /// emitProlog/emitEpilog - These methods insert prolog and epilog code into
- /// the function. The return value is the number of instructions
- /// added to (negative if removed from) the basic block (entry for prologue).
- ///
- virtual void emitPrologue(MachineFunction &MF) const = 0;
- virtual void emitEpilogue(MachineFunction &MF,
- MachineBasicBlock &MBB) const = 0;
-
- //===--------------------------------------------------------------------===//
- /// Debug information queries.
-
- /// getDwarfRegNum - Map a target register to an equivalent dwarf register
- /// number. Returns -1 if there is no equivalent value. The second
- /// parameter allows targets to use different numberings for EH info and
- /// deubgging info.
- virtual int getDwarfRegNum(unsigned RegNum, bool isEH) const = 0;
-
- /// getFrameRegister - This method should return the register used as a base
- /// for values allocated in the current stack frame.
- virtual unsigned getFrameRegister(MachineFunction &MF) const = 0;
-
- /// getFrameIndexOffset - Returns the displacement from the frame register to
- /// the stack frame of the specified index.
- virtual int getFrameIndexOffset(MachineFunction &MF, int FI) const;
-
- /// getRARegister - This method should return the register where the return
- /// address can be found.
- virtual unsigned getRARegister() const = 0;
-
- /// getInitialFrameState - Returns a list of machine moves that are assumed
- /// on entry to all functions. Note that LabelID is ignored (assumed to be
- /// the beginning of the function.)
- virtual void getInitialFrameState(std::vector<MachineMove> &Moves) const;
-};
-
-// This is useful when building IndexedMaps keyed on virtual registers
-struct VirtReg2IndexFunctor : std::unary_function<unsigned, unsigned> {
- unsigned operator()(unsigned Reg) const {
- return Reg - TargetRegisterInfo::FirstVirtualRegister;
- }
-};
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/Target/TargetSubtarget.h b/release_23/include/llvm/Target/TargetSubtarget.h
deleted file mode 100644
index fde8f44669ad..000000000000
--- a/release_23/include/llvm/Target/TargetSubtarget.h
+++ /dev/null
@@ -1,36 +0,0 @@
-//==-- llvm/Target/TargetSubtarget.h - Target Information --------*- C++ -*-==//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file describes the subtarget options of a Target machine.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_TARGET_TARGETSUBTARGET_H
-#define LLVM_TARGET_TARGETSUBTARGET_H
-
-namespace llvm {
-
-//===----------------------------------------------------------------------===//
-///
-/// TargetSubtarget - Generic base class for all target subtargets. All
-/// Target-specific options that control code generation and printing should
-/// be exposed through a TargetSubtarget-derived class.
-///
-class TargetSubtarget {
- TargetSubtarget(const TargetSubtarget&); // DO NOT IMPLEMENT
- void operator=(const TargetSubtarget&); // DO NOT IMPLEMENT
-protected: // Can only create subclasses...
- TargetSubtarget();
-public:
- virtual ~TargetSubtarget();
-};
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/Transforms/IPO.h b/release_23/include/llvm/Transforms/IPO.h
deleted file mode 100644
index 7d98dfe60452..000000000000
--- a/release_23/include/llvm/Transforms/IPO.h
+++ /dev/null
@@ -1,172 +0,0 @@
-//===- llvm/Transforms/IPO.h - Interprocedural Transformations --*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This header file defines prototypes for accessor functions that expose passes
-// in the IPO transformations library.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_TRANSFORMS_IPO_H
-#define LLVM_TRANSFORMS_IPO_H
-
-#include <vector>
-
-namespace llvm {
-
-class FunctionPass;
-class ModulePass;
-class Pass;
-class Function;
-class BasicBlock;
-class GlobalValue;
-
-//===----------------------------------------------------------------------===//
-//
-// These functions removes symbols from functions and modules. If OnlyDebugInfo
-// is true, only debugging information is removed from the module.
-//
-ModulePass *createStripSymbolsPass(bool OnlyDebugInfo = false);
-
-//===----------------------------------------------------------------------===//
-/// createLowerSetJmpPass - This function lowers the setjmp/longjmp intrinsics
-/// to invoke/unwind instructions. This should really be part of the C/C++
-/// front-end, but it's so much easier to write transformations in LLVM proper.
-///
-ModulePass* createLowerSetJmpPass();
-
-//===----------------------------------------------------------------------===//
-/// createConstantMergePass - This function returns a new pass that merges
-/// duplicate global constants together into a single constant that is shared.
-/// This is useful because some passes (ie TraceValues) insert a lot of string
-/// constants into the program, regardless of whether or not they duplicate an
-/// existing string.
-///
-ModulePass *createConstantMergePass();
-
-
-//===----------------------------------------------------------------------===//
-/// createGlobalOptimizerPass - This function returns a new pass that optimizes
-/// non-address taken internal globals.
-///
-ModulePass *createGlobalOptimizerPass();
-
-
-//===----------------------------------------------------------------------===//
-/// createRaiseAllocationsPass - Return a new pass that transforms malloc and
-/// free function calls into malloc and free instructions.
-///
-ModulePass *createRaiseAllocationsPass();
-
-
-//===----------------------------------------------------------------------===//
-/// createDeadTypeEliminationPass - Return a new pass that eliminates symbol
-/// table entries for types that are never used.
-///
-ModulePass *createDeadTypeEliminationPass();
-
-
-//===----------------------------------------------------------------------===//
-/// createGlobalDCEPass - This transform is designed to eliminate unreachable
-/// internal globals (functions or global variables)
-///
-ModulePass *createGlobalDCEPass();
-
-
-//===----------------------------------------------------------------------===//
-/// createGVExtractionPass - If deleteFn is true, this pass deletes as
-/// the specified global values. Otherwise, it deletes as much of the module as
-/// possible, except for the global values specified.
-///
-ModulePass *createGVExtractionPass(std::vector<GlobalValue*>& GVs, bool
- deleteFn = false,
- bool relinkCallees = false);
-
-//===----------------------------------------------------------------------===//
-/// createFunctionInliningPass - Return a new pass object that uses a heuristic
-/// to inline direct function calls to small functions.
-///
-Pass *createFunctionInliningPass();
-Pass *createFunctionInliningPass(int Threshold);
-
-//===----------------------------------------------------------------------===//
-/// createPruneEHPass - Return a new pass object which transforms invoke
-/// instructions into calls, if the callee can _not_ unwind the stack.
-///
-Pass *createPruneEHPass();
-
-//===----------------------------------------------------------------------===//
-/// createInternalizePass - This pass loops over all of the functions in the
-/// input module, looking for a main function. If a list of symbols is
-/// specified with the -internalize-public-api-* command line options, those
-/// symbols are internalized. Otherwise if InternalizeEverything is set and
-/// the main function is found, all other globals are marked as internal.
-///
-ModulePass *createInternalizePass(bool InternalizeEverything);
-ModulePass *createInternalizePass(const std::vector<const char *> &exportList);
-
-//===----------------------------------------------------------------------===//
-/// createDeadArgEliminationPass - This pass removes arguments from functions
-/// which are not used by the body of the function.
-///
-ModulePass *createDeadArgEliminationPass();
-
-/// DeadArgHacking pass - Same as DAE, but delete arguments of external
-/// functions as well. This is definitely not safe, and should only be used by
-/// bugpoint.
-ModulePass *createDeadArgHackingPass();
-
-//===----------------------------------------------------------------------===//
-/// createArgumentPromotionPass - This pass promotes "by reference" arguments to
-/// be passed by value if the number of elements passed is smaller or
-/// equal to maxElements (maxElements == 0 means always promote).
-///
-Pass *createArgumentPromotionPass(unsigned maxElements = 3);
-Pass *createStructRetPromotionPass();
-
-//===----------------------------------------------------------------------===//
-/// createIPConstantPropagationPass - This pass propagates constants from call
-/// sites into the bodies of functions.
-///
-ModulePass *createIPConstantPropagationPass();
-
-//===----------------------------------------------------------------------===//
-/// createIPSCCPPass - This pass propagates constants from call sites into the
-/// bodies of functions, and keeps track of whether basic blocks are executable
-/// in the process.
-///
-ModulePass *createIPSCCPPass();
-
-//===----------------------------------------------------------------------===//
-//
-/// createLoopExtractorPass - This pass extracts all natural loops from the
-/// program into a function if it can.
-///
-FunctionPass *createLoopExtractorPass();
-
-/// createSingleLoopExtractorPass - This pass extracts one natural loop from the
-/// program into a function if it can. This is used by bugpoint.
-///
-FunctionPass *createSingleLoopExtractorPass();
-
-/// createBlockExtractorPass - This pass extracts all blocks (except those
-/// specified in the argument list) from the functions in the module.
-///
-ModulePass *createBlockExtractorPass(const std::vector<BasicBlock*> &BTNE);
-
-/// createIndMemRemPass - This pass removes potential indirect calls of
-/// malloc and free
-ModulePass *createIndMemRemPass();
-
-/// createStripDeadPrototypesPass - This pass removes any function declarations
-/// (prototypes) that are not used.
-ModulePass *createStripDeadPrototypesPass();
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/Transforms/IPO/InlinerPass.h b/release_23/include/llvm/Transforms/IPO/InlinerPass.h
deleted file mode 100644
index d34641def09b..000000000000
--- a/release_23/include/llvm/Transforms/IPO/InlinerPass.h
+++ /dev/null
@@ -1,70 +0,0 @@
-//===- InlinerPass.h - Code common to all inliners --------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines a simple policy-based bottom-up inliner. This file
-// implements all of the boring mechanics of the bottom-up inlining, while the
-// subclass determines WHAT to inline, which is the much more interesting
-// component.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef INLINER_H
-#define INLINER_H
-
-#include "llvm/CallGraphSCCPass.h"
-
-namespace llvm {
- class CallSite;
-
-/// Inliner - This class contains all of the helper code which is used to
-/// perform the inlining operations that does not depend on the policy.
-///
-struct Inliner : public CallGraphSCCPass {
- explicit Inliner(const void *ID);
- explicit Inliner(const void *ID, int Threshold);
-
- /// getAnalysisUsage - For this class, we declare that we require and preserve
- /// the call graph. If the derived class implements this method, it should
- /// always explicitly call the implementation here.
- virtual void getAnalysisUsage(AnalysisUsage &Info) const;
-
- // Main run interface method, this implements the interface required by the
- // Pass class.
- virtual bool runOnSCC(const std::vector<CallGraphNode *> &SCC);
-
- // doFinalization - Remove now-dead linkonce functions at the end of
- // processing to avoid breaking the SCC traversal.
- virtual bool doFinalization(CallGraph &CG);
-
-
- /// This method returns the value specified by the -inline-threshold value,
- /// specified on the command line. This is typically not directly needed.
- ///
- unsigned getInlineThreshold() const { return InlineThreshold; }
-
- /// getInlineCost - This method must be implemented by the subclass to
- /// determine the cost of inlining the specified call site. If the cost
- /// returned is greater than the current inline threshold, the call site is
- /// not inlined.
- ///
- virtual int getInlineCost(CallSite CS) = 0;
-
- // getInlineFudgeFactor - Return a > 1.0 factor if the inliner should use a
- // higher threshold to determine if the function call should be inlined.
- ///
- virtual float getInlineFudgeFactor(CallSite CS) = 0;
-
-private:
- // InlineThreshold - Cache the value here for easy access.
- unsigned InlineThreshold;
-};
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/Transforms/Instrumentation.h b/release_23/include/llvm/Transforms/Instrumentation.h
deleted file mode 100644
index 698e248e7e64..000000000000
--- a/release_23/include/llvm/Transforms/Instrumentation.h
+++ /dev/null
@@ -1,37 +0,0 @@
-//===- Transforms/Instrumentation.h - Instrumentation passes ----*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines constructor functions for instrumentation passes.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_TRANSFORMS_INSTRUMENTATION_H
-#define LLVM_TRANSFORMS_INSTRUMENTATION_H
-
-namespace llvm {
-
-class ModulePass;
-class FunctionPass;
-
-// Insert function profiling instrumentation
-ModulePass *createFunctionProfilerPass();
-
-// Insert block profiling instrumentation
-ModulePass *createBlockProfilerPass();
-
-// Insert edge profiling instrumentation
-ModulePass *createEdgeProfilerPass();
-
-// Random Sampling Profiling Framework
-ModulePass* createNullProfilerRSPass();
-FunctionPass* createRSProfilingPass();
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/Transforms/RSProfiling.h b/release_23/include/llvm/Transforms/RSProfiling.h
deleted file mode 100644
index b44a992bd3dc..000000000000
--- a/release_23/include/llvm/Transforms/RSProfiling.h
+++ /dev/null
@@ -1,38 +0,0 @@
-//===- RSProfiling.cpp - Various profiling using random sampling ----------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines the abstract interface that a profiler must implement to
-// support the random profiling transform.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_TRANSFORMS_RSPROFILING_H
-#define LLVM_TRANSFORMS_RSPROFILING_H
-
-namespace llvm {
- //===--------------------------------------------------------------------===//
- /// RSProfilers - The basic Random Sampling Profiler Interface Any profiler
- /// that implements this interface can be transformed by the random sampling
- /// pass to be sample based rather than always on.
- ///
- /// The only exposed function can be queried to find out if an instruction
- /// was original or if it was inserted by the profiler. Implementations of
- /// this interface are expected to chain to other implementations, such that
- /// multiple profilers can be support simultaniously.
- struct RSProfilers : public ModulePass {
- static char ID; // Pass identification, replacement for typeinfo
- RSProfilers() : ModulePass((intptr_t)&ID) {}
-
- /// isProfiling - This method returns true if the value passed it was
- /// inserted by the profiler.
- virtual bool isProfiling(Value* v) = 0;
- };
-}
-
-#endif
diff --git a/release_23/include/llvm/Transforms/Scalar.h b/release_23/include/llvm/Transforms/Scalar.h
deleted file mode 100644
index f350a513e58c..000000000000
--- a/release_23/include/llvm/Transforms/Scalar.h
+++ /dev/null
@@ -1,341 +0,0 @@
-//===-- Scalar.h - Scalar Transformations -----------------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This header file defines prototypes for accessor functions that expose passes
-// in the Scalar transformations library.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_TRANSFORMS_SCALAR_H
-#define LLVM_TRANSFORMS_SCALAR_H
-
-#include <cstdlib>
-
-namespace llvm {
-
-class FunctionPass;
-class LoopPass;
-class Pass;
-class GetElementPtrInst;
-class PassInfo;
-class TerminatorInst;
-class TargetLowering;
-
-//===----------------------------------------------------------------------===//
-//
-// ConstantPropagation - A worklist driven constant propagation pass
-//
-FunctionPass *createConstantPropagationPass();
-
-//===----------------------------------------------------------------------===//
-//
-// SCCP - Sparse conditional constant propagation.
-//
-FunctionPass *createSCCPPass();
-
-//===----------------------------------------------------------------------===//
-//
-// DeadInstElimination - This pass quickly removes trivially dead instructions
-// without modifying the CFG of the function. It is a BasicBlockPass, so it
-// runs efficiently when queued next to other BasicBlockPass's.
-//
-Pass *createDeadInstEliminationPass();
-
-//===----------------------------------------------------------------------===//
-//
-// DeadCodeElimination - This pass is more powerful than DeadInstElimination,
-// because it is worklist driven that can potentially revisit instructions when
-// their other instructions become dead, to eliminate chains of dead
-// computations.
-//
-FunctionPass *createDeadCodeEliminationPass();
-
-//===----------------------------------------------------------------------===//
-//
-// DeadStoreElimination - This pass deletes stores that are post-dominated by
-// must-aliased stores and are not loaded used between the stores.
-//
-FunctionPass *createDeadStoreEliminationPass();
-
-//===----------------------------------------------------------------------===//
-//
-// AggressiveDCE - This pass uses the SSA based Aggressive DCE algorithm. This
-// algorithm assumes instructions are dead until proven otherwise, which makes
-// it more successful are removing non-obviously dead instructions.
-//
-FunctionPass *createAggressiveDCEPass();
-
-//===----------------------------------------------------------------------===//
-//
-// ScalarReplAggregates - Break up alloca's of aggregates into multiple allocas
-// if possible.
-//
-FunctionPass *createScalarReplAggregatesPass(signed Threshold = -1);
-
-//===----------------------------------------------------------------------===//
-//
-// GCSE - This pass is designed to be a very quick global transformation that
-// eliminates global common subexpressions from a function. It does this by
-// examining the SSA value graph of the function, instead of doing slow
-// bit-vector computations.
-//
-FunctionPass *createGCSEPass();
-
-//===----------------------------------------------------------------------===//
-//
-// InductionVariableSimplify - Transform induction variables in a program to all
-// use a single canonical induction variable per loop.
-//
-LoopPass *createIndVarSimplifyPass();
-
-//===----------------------------------------------------------------------===//
-//
-// InstructionCombining - Combine instructions to form fewer, simple
-// instructions. This pass does not modify the CFG, and has a tendency to make
-// instructions dead, so a subsequent DCE pass is useful.
-//
-// This pass combines things like:
-// %Y = add int 1, %X
-// %Z = add int 1, %Y
-// into:
-// %Z = add int 2, %X
-//
-FunctionPass *createInstructionCombiningPass();
-
-//===----------------------------------------------------------------------===//
-//
-// LICM - This pass is a loop invariant code motion and memory promotion pass.
-//
-LoopPass *createLICMPass();
-
-//===----------------------------------------------------------------------===//
-//
-// LoopStrengthReduce - This pass is strength reduces GEP instructions that use
-// a loop's canonical induction variable as one of their indices. It takes an
-// optional parameter used to consult the target machine whether certain
-// transformations are profitable.
-//
-LoopPass *createLoopStrengthReducePass(const TargetLowering *TLI = 0);
-
-//===----------------------------------------------------------------------===//
-//
-// LoopUnswitch - This pass is a simple loop unswitching pass.
-//
-LoopPass *createLoopUnswitchPass(bool OptimizeForSize = false);
-
-//===----------------------------------------------------------------------===//
-//
-// LoopUnroll - This pass is a simple loop unrolling pass.
-//
-LoopPass *createLoopUnrollPass();
-
-//===----------------------------------------------------------------------===//
-//
-// LoopRotate - This pass is a simple loop rotating pass.
-//
-LoopPass *createLoopRotatePass();
-
-//===----------------------------------------------------------------------===//
-//
-// LoopIndexSplit - This pass divides loop's iteration range by spliting loop
-// such that each individual loop is executed efficiently.
-//
-LoopPass *createLoopIndexSplitPass();
-
-
-//===----------------------------------------------------------------------===//
-//
-// PromoteMemoryToRegister - This pass is used to promote memory references to
-// be register references. A simple example of the transformation performed by
-// this pass is:
-//
-// FROM CODE TO CODE
-// %X = alloca int, uint 1 ret int 42
-// store int 42, int *%X
-// %Y = load int* %X
-// ret int %Y
-//
-FunctionPass *createPromoteMemoryToRegisterPass();
-extern const PassInfo *PromoteMemoryToRegisterID;
-
-//===----------------------------------------------------------------------===//
-//
-// DemoteRegisterToMemoryPass - This pass is used to demote registers to memory
-// references. In basically undoes the PromoteMemoryToRegister pass to make cfg
-// hacking easier.
-//
-FunctionPass *createDemoteRegisterToMemoryPass();
-extern const PassInfo *DemoteRegisterToMemoryID;
-
-//===----------------------------------------------------------------------===//
-//
-// Reassociate - This pass reassociates commutative expressions in an order that
-// is designed to promote better constant propagation, GCSE, LICM, PRE...
-//
-// For example: 4 + (x + 5) -> x + (4 + 5)
-//
-FunctionPass *createReassociatePass();
-
-//===----------------------------------------------------------------------===//
-//
-// CondPropagationPass - This pass propagates information about conditional
-// expressions through the program, allowing it to eliminate conditional
-// branches in some cases.
-//
-FunctionPass *createCondPropagationPass();
-
-//===----------------------------------------------------------------------===//
-//
-// TailDuplication - Eliminate unconditional branches through controlled code
-// duplication, creating simpler CFG structures.
-//
-FunctionPass *createTailDuplicationPass();
-
-//===----------------------------------------------------------------------===//
-//
-// JumpThreading - Thread control through mult-pred/multi-succ blocks where some
-// preds always go to some succ.
-//
-FunctionPass *createJumpThreadingPass();
-
- //===----------------------------------------------------------------------===//
-//
-// CFGSimplification - Merge basic blocks, eliminate unreachable blocks,
-// simplify terminator instructions, etc...
-//
-FunctionPass *createCFGSimplificationPass();
-
-//===----------------------------------------------------------------------===//
-//
-// BreakCriticalEdges - Break all of the critical edges in the CFG by inserting
-// a dummy basic block. This pass may be "required" by passes that cannot deal
-// with critical edges. For this usage, a pass must call:
-//
-// AU.addRequiredID(BreakCriticalEdgesID);
-//
-// This pass obviously invalidates the CFG, but can update forward dominator
-// (set, immediate dominators, tree, and frontier) information.
-//
-FunctionPass *createBreakCriticalEdgesPass();
-extern const PassInfo *BreakCriticalEdgesID;
-
-//===----------------------------------------------------------------------===//
-//
-// LoopSimplify - Insert Pre-header blocks into the CFG for every function in
-// the module. This pass updates dominator information, loop information, and
-// does not add critical edges to the CFG.
-//
-// AU.addRequiredID(LoopSimplifyID);
-//
-FunctionPass *createLoopSimplifyPass();
-extern const PassInfo *LoopSimplifyID;
-
-//===----------------------------------------------------------------------===//
-//
-// LowerAllocations - Turn malloc and free instructions into %malloc and %free
-// calls.
-//
-// AU.addRequiredID(LowerAllocationsID);
-//
-Pass *createLowerAllocationsPass(bool LowerMallocArgToInteger = false);
-extern const PassInfo *LowerAllocationsID;
-
-//===----------------------------------------------------------------------===//
-//
-// TailCallElimination - This pass eliminates call instructions to the current
-// function which occur immediately before return instructions.
-//
-FunctionPass *createTailCallEliminationPass();
-
-//===----------------------------------------------------------------------===//
-//
-// LowerSwitch - This pass converts SwitchInst instructions into a sequence of
-// chained binary branch instructions.
-//
-FunctionPass *createLowerSwitchPass();
-extern const PassInfo *LowerSwitchID;
-
-//===----------------------------------------------------------------------===//
-//
-// LowerInvoke - This pass converts invoke and unwind instructions to use sjlj
-// exception handling mechanisms. Note that after this pass runs the CFG is not
-// entirely accurate (exceptional control flow edges are not correct anymore) so
-// only very simple things should be done after the lowerinvoke pass has run
-// (like generation of native code). This should *NOT* be used as a general
-// purpose "my LLVM-to-LLVM pass doesn't support the invoke instruction yet"
-// lowering pass.
-//
-FunctionPass *createLowerInvokePass(const TargetLowering *TLI = NULL);
-extern const PassInfo *LowerInvokePassID;
-
-//===----------------------------------------------------------------------===//
-//
-// BlockPlacement - This pass reorders basic blocks in order to increase the
-// number of fall-through conditional branches.
-//
-FunctionPass *createBlockPlacementPass();
-
-//===----------------------------------------------------------------------===//
-//
-// LCSSA - This pass inserts phi nodes at loop boundaries to simplify other loop
-// optimizations.
-//
-LoopPass *createLCSSAPass();
-extern const PassInfo *LCSSAID;
-
-//===----------------------------------------------------------------------===//
-//
-// PredicateSimplifier - This pass collapses duplicate variables into one
-// canonical form, and tries to simplify expressions along the way.
-//
-FunctionPass *createPredicateSimplifierPass();
-
-//===----------------------------------------------------------------------===//
-//
-// GVN-PRE - This pass performs global value numbering and partial redundancy
-// elimination.
-//
-FunctionPass *createGVNPREPass();
-
-//===----------------------------------------------------------------------===//
-//
-// GVN - This pass performs global value numbering and redundant load
-// elimination cotemporaneously.
-//
-FunctionPass *createGVNPass();
-
-//===----------------------------------------------------------------------===//
-//
-// MemCpyOpt - This pass performs optimizations related to eliminating memcpy
-// calls and/or combining multiple stores into memset's.
-//
-FunctionPass *createMemCpyOptPass();
-
-//===----------------------------------------------------------------------===//
-//
-// LoopDeletion - This pass performs DCE of non-infinite loops that it
-// can prove are dead.
-//
-LoopPass *createLoopDeletionPass();
-
-//===----------------------------------------------------------------------===//
-//
-/// createSimplifyLibCallsPass - This pass optimizes specific calls to
-/// specific well-known (library) functions.
-FunctionPass *createSimplifyLibCallsPass();
-
-//===----------------------------------------------------------------------===//
-//
-// CodeGenPrepare - This pass prepares a function for instruction selection.
-//
-FunctionPass *createCodeGenPreparePass(const TargetLowering *TLI = 0);
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/Transforms/Utils/BasicBlockUtils.h b/release_23/include/llvm/Transforms/Utils/BasicBlockUtils.h
deleted file mode 100644
index a44095f27d19..000000000000
--- a/release_23/include/llvm/Transforms/Utils/BasicBlockUtils.h
+++ /dev/null
@@ -1,138 +0,0 @@
-//===-- Transform/Utils/BasicBlockUtils.h - BasicBlock Utils ----*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This family of functions perform manipulations on basic blocks, and
-// instructions contained within basic blocks.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_TRANSFORMS_UTILS_BASICBLOCK_H
-#define LLVM_TRANSFORMS_UTILS_BASICBLOCK_H
-
-// FIXME: Move to this file: BasicBlock::removePredecessor, BB::splitBasicBlock
-
-#include "llvm/BasicBlock.h"
-#include "llvm/Support/CFG.h"
-
-namespace llvm {
-
-class Instruction;
-class Pass;
-
-// ReplaceInstWithValue - Replace all uses of an instruction (specified by BI)
-// with a value, then remove and delete the original instruction.
-//
-void ReplaceInstWithValue(BasicBlock::InstListType &BIL,
- BasicBlock::iterator &BI, Value *V);
-
-// ReplaceInstWithInst - Replace the instruction specified by BI with the
-// instruction specified by I. The original instruction is deleted and BI is
-// updated to point to the new instruction.
-//
-void ReplaceInstWithInst(BasicBlock::InstListType &BIL,
- BasicBlock::iterator &BI, Instruction *I);
-
-// ReplaceInstWithInst - Replace the instruction specified by From with the
-// instruction specified by To.
-//
-void ReplaceInstWithInst(Instruction *From, Instruction *To);
-
-
-// RemoveSuccessor - Change the specified terminator instruction such that its
-// successor #SuccNum no longer exists. Because this reduces the outgoing
-// degree of the current basic block, the actual terminator instruction itself
-// may have to be changed. In the case where the last successor of the block is
-// deleted, a return instruction is inserted in its place which can cause a
-// suprising change in program behavior if it is not expected.
-//
-void RemoveSuccessor(TerminatorInst *TI, unsigned SuccNum);
-
-/// isCriticalEdge - Return true if the specified edge is a critical edge.
-/// Critical edges are edges from a block with multiple successors to a block
-/// with multiple predecessors.
-///
-bool isCriticalEdge(const TerminatorInst *TI, unsigned SuccNum,
- bool AllowIdenticalEdges = false);
-
-/// SplitCriticalEdge - If this edge is a critical edge, insert a new node to
-/// split the critical edge. This will update DominatorTree and
-/// DominatorFrontier information if it is available, thus calling this pass
-/// will not invalidate either of them. This returns true if the edge was split,
-/// false otherwise.
-///
-/// If MergeIdenticalEdges is true (the default), *all* edges from TI to the
-/// specified successor will be merged into the same critical edge block.
-/// This is most commonly interesting with switch instructions, which may
-/// have many edges to any one destination. This ensures that all edges to that
-/// dest go to one block instead of each going to a different block, but isn't
-/// the standard definition of a "critical edge".
-///
-bool SplitCriticalEdge(TerminatorInst *TI, unsigned SuccNum, Pass *P = 0,
- bool MergeIdenticalEdges = false);
-
-inline bool SplitCriticalEdge(BasicBlock *BB, succ_iterator SI, Pass *P = 0) {
- return SplitCriticalEdge(BB->getTerminator(), SI.getSuccessorIndex(), P);
-}
-
-/// SplitCriticalEdge - If the edge from *PI to BB is not critical, return
-/// false. Otherwise, split all edges between the two blocks and return true.
-/// This updates all of the same analyses as the other SplitCriticalEdge
-/// function. If P is specified, it updates the analyses
-/// described above.
-inline bool SplitCriticalEdge(BasicBlock *Succ, pred_iterator PI, Pass *P = 0) {
- bool MadeChange = false;
- TerminatorInst *TI = (*PI)->getTerminator();
- for (unsigned i = 0, e = TI->getNumSuccessors(); i != e; ++i)
- if (TI->getSuccessor(i) == Succ)
- MadeChange |= SplitCriticalEdge(TI, i, P);
- return MadeChange;
-}
-
-/// SplitCriticalEdge - If an edge from Src to Dst is critical, split the edge
-/// and return true, otherwise return false. This method requires that there be
-/// an edge between the two blocks. If P is specified, it updates the analyses
-/// described above.
-inline bool SplitCriticalEdge(BasicBlock *Src, BasicBlock *Dst, Pass *P = 0,
- bool MergeIdenticalEdges = false) {
- TerminatorInst *TI = Src->getTerminator();
- unsigned i = 0;
- while (1) {
- assert(i != TI->getNumSuccessors() && "Edge doesn't exist!");
- if (TI->getSuccessor(i) == Dst)
- return SplitCriticalEdge(TI, i, P, MergeIdenticalEdges);
- ++i;
- }
-}
-
-/// SplitEdge - Split the edge connecting specified block. Pass P must
-/// not be NULL.
-BasicBlock *SplitEdge(BasicBlock *From, BasicBlock *To, Pass *P);
-
-/// SplitBlock - Split the specified block at the specified instruction - every
-/// thing before SplitPt stays in Old and everything starting with SplitPt moves
-/// to a new block. The two blocks are joined by an unconditional branch and
-/// the loop info is updated.
-///
-BasicBlock *SplitBlock(BasicBlock *Old, Instruction *SplitPt, Pass *P);
-
-/// SplitBlockPredecessors - This method transforms BB by introducing a new
-/// basic block into the function, and moving some of the predecessors of BB to
-/// be predecessors of the new block. The new predecessors are indicated by the
-/// Preds array, which has NumPreds elements in it. The new block is given a
-/// suffix of 'Suffix'. This function returns the new block.
-///
-/// This currently updates the LLVM IR, AliasAnalysis, DominatorTree and
-/// DominanceFrontier, but no other analyses.
-BasicBlock *SplitBlockPredecessors(BasicBlock *BB, BasicBlock *const *Preds,
- unsigned NumPreds, const char *Suffix,
- Pass *P = 0);
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/Transforms/Utils/BasicInliner.h b/release_23/include/llvm/Transforms/Utils/BasicInliner.h
deleted file mode 100644
index e2070f93faff..000000000000
--- a/release_23/include/llvm/Transforms/Utils/BasicInliner.h
+++ /dev/null
@@ -1,55 +0,0 @@
-//===- BasicInliner.h - Basic function level inliner ------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines a simple function based inliner that does not use
-// call graph information.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef BASICINLINER_H
-#define BASICINLINER_H
-
-#include "llvm/Transforms/Utils/InlineCost.h"
-
-namespace llvm {
-
- class Function;
- class TargetData;
- struct BasicInlinerImpl;
-
- /// BasicInliner - BasicInliner provides function level inlining interface.
- /// Clients provide list of functions which are inline without using
- /// module level call graph information. Note that the BasicInliner is
- /// free to delete a function if it is inlined into all call sites.
- class BasicInliner {
- public:
-
- BasicInliner(TargetData *T = NULL);
- ~BasicInliner();
-
- /// addFunction - Add function into the list of functions to process.
- /// All functions must be inserted using this interface before invoking
- /// inlineFunctions().
- void addFunction(Function *F);
-
- /// neverInlineFunction - Sometimes a function is never to be inlined
- /// because of one or other reason.
- void neverInlineFunction(Function *F);
-
- /// inlineFuctions - Walk all call sites in all functions supplied by
- /// client. Inline as many call sites as possible. Delete completely
- /// inlined functions.
- void inlineFunctions();
-
- private:
- BasicInlinerImpl *Impl;
- };
-}
-
-#endif
diff --git a/release_23/include/llvm/Transforms/Utils/Cloning.h b/release_23/include/llvm/Transforms/Utils/Cloning.h
deleted file mode 100644
index 1e2bbaa295b3..000000000000
--- a/release_23/include/llvm/Transforms/Utils/Cloning.h
+++ /dev/null
@@ -1,191 +0,0 @@
-//===- Cloning.h - Clone various parts of LLVM programs ---------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines various functions that are used to clone chunks of LLVM
-// code for various purposes. This varies from copying whole modules into new
-// modules, to cloning functions with different arguments, to inlining
-// functions, to copying basic blocks to support loop unrolling or superblock
-// formation, etc.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_TRANSFORMS_UTILS_CLONING_H
-#define LLVM_TRANSFORMS_UTILS_CLONING_H
-
-#include <vector>
-#include "llvm/ADT/DenseMap.h"
-
-namespace llvm {
-
-class Module;
-class Function;
-class Pass;
-class LPPassManager;
-class BasicBlock;
-class Value;
-class CallInst;
-class InvokeInst;
-class ReturnInst;
-class CallSite;
-class Trace;
-class CallGraph;
-class TargetData;
-class LoopInfo;
-template<class N> class LoopBase;
-typedef LoopBase<BasicBlock> Loop;
-
-/// CloneModule - Return an exact copy of the specified module
-///
-Module *CloneModule(const Module *M);
-Module *CloneModule(const Module *M, DenseMap<const Value*, Value*> &ValueMap);
-
-/// ClonedCodeInfo - This struct can be used to capture information about code
-/// being cloned, while it is being cloned.
-struct ClonedCodeInfo {
- /// ContainsCalls - This is set to true if the cloned code contains a normal
- /// call instruction.
- bool ContainsCalls;
-
- /// ContainsUnwinds - This is set to true if the cloned code contains an
- /// unwind instruction.
- bool ContainsUnwinds;
-
- /// ContainsDynamicAllocas - This is set to true if the cloned code contains
- /// a 'dynamic' alloca. Dynamic allocas are allocas that are either not in
- /// the entry block or they are in the entry block but are not a constant
- /// size.
- bool ContainsDynamicAllocas;
-
- ClonedCodeInfo() {
- ContainsCalls = false;
- ContainsUnwinds = false;
- ContainsDynamicAllocas = false;
- }
-};
-
-
-/// CloneBasicBlock - Return a copy of the specified basic block, but without
-/// embedding the block into a particular function. The block returned is an
-/// exact copy of the specified basic block, without any remapping having been
-/// performed. Because of this, this is only suitable for applications where
-/// the basic block will be inserted into the same function that it was cloned
-/// from (loop unrolling would use this, for example).
-///
-/// Also, note that this function makes a direct copy of the basic block, and
-/// can thus produce illegal LLVM code. In particular, it will copy any PHI
-/// nodes from the original block, even though there are no predecessors for the
-/// newly cloned block (thus, phi nodes will have to be updated). Also, this
-/// block will branch to the old successors of the original block: these
-/// successors will have to have any PHI nodes updated to account for the new
-/// incoming edges.
-///
-/// The correlation between instructions in the source and result basic blocks
-/// is recorded in the ValueMap map.
-///
-/// If you have a particular suffix you'd like to use to add to any cloned
-/// names, specify it as the optional third parameter.
-///
-/// If you would like the basic block to be auto-inserted into the end of a
-/// function, you can specify it as the optional fourth parameter.
-///
-/// If you would like to collect additional information about the cloned
-/// function, you can specify a ClonedCodeInfo object with the optional fifth
-/// parameter.
-///
-BasicBlock *CloneBasicBlock(const BasicBlock *BB,
- DenseMap<const Value*, Value*> &ValueMap,
- const char *NameSuffix = "", Function *F = 0,
- ClonedCodeInfo *CodeInfo = 0);
-
-
-/// CloneLoop - Clone Loop. Clone dominator info for loop insiders. Populate ValueMap
-/// using old blocks to new blocks mapping.
-Loop *CloneLoop(Loop *L, LPPassManager *LPM, LoopInfo *LI,
- DenseMap<const Value *, Value *> &ValueMap, Pass *P);
-
-/// CloneFunction - Return a copy of the specified function, but without
-/// embedding the function into another module. Also, any references specified
-/// in the ValueMap are changed to refer to their mapped value instead of the
-/// original one. If any of the arguments to the function are in the ValueMap,
-/// the arguments are deleted from the resultant function. The ValueMap is
-/// updated to include mappings from all of the instructions and basicblocks in
-/// the function from their old to new values. The final argument captures
-/// information about the cloned code if non-null.
-///
-Function *CloneFunction(const Function *F,
- DenseMap<const Value*, Value*> &ValueMap,
- ClonedCodeInfo *CodeInfo = 0);
-
-/// CloneFunction - Version of the function that doesn't need the ValueMap.
-///
-inline Function *CloneFunction(const Function *F, ClonedCodeInfo *CodeInfo = 0){
- DenseMap<const Value*, Value*> ValueMap;
- return CloneFunction(F, ValueMap, CodeInfo);
-}
-
-/// Clone OldFunc into NewFunc, transforming the old arguments into references
-/// to ArgMap values. Note that if NewFunc already has basic blocks, the ones
-/// cloned into it will be added to the end of the function. This function
-/// fills in a list of return instructions, and can optionally append the
-/// specified suffix to all values cloned.
-///
-void CloneFunctionInto(Function *NewFunc, const Function *OldFunc,
- DenseMap<const Value*, Value*> &ValueMap,
- std::vector<ReturnInst*> &Returns,
- const char *NameSuffix = "",
- ClonedCodeInfo *CodeInfo = 0);
-
-/// CloneAndPruneFunctionInto - This works exactly like CloneFunctionInto,
-/// except that it does some simple constant prop and DCE on the fly. The
-/// effect of this is to copy significantly less code in cases where (for
-/// example) a function call with constant arguments is inlined, and those
-/// constant arguments cause a significant amount of code in the callee to be
-/// dead. Since this doesn't produce an exactly copy of the input, it can't be
-/// used for things like CloneFunction or CloneModule.
-void CloneAndPruneFunctionInto(Function *NewFunc, const Function *OldFunc,
- DenseMap<const Value*, Value*> &ValueMap,
- std::vector<ReturnInst*> &Returns,
- const char *NameSuffix = "",
- ClonedCodeInfo *CodeInfo = 0,
- const TargetData *TD = 0);
-
-
-/// CloneTraceInto - Clone T into NewFunc. Original<->clone mapping is
-/// saved in ValueMap.
-///
-void CloneTraceInto(Function *NewFunc, Trace &T,
- DenseMap<const Value*, Value*> &ValueMap,
- const char *NameSuffix);
-
-/// CloneTrace - Returns a copy of the specified trace.
-/// It takes a vector of basic blocks clones the basic blocks, removes internal
-/// phi nodes, adds it to the same function as the original (although there is
-/// no jump to it) and returns the new vector of basic blocks.
-std::vector<BasicBlock *> CloneTrace(const std::vector<BasicBlock*> &origTrace);
-
-/// InlineFunction - This function inlines the called function into the basic
-/// block of the caller. This returns false if it is not possible to inline
-/// this call. The program is still in a well defined state if this occurs
-/// though.
-///
-/// Note that this only does one level of inlining. For example, if the
-/// instruction 'call B' is inlined, and 'B' calls 'C', then the call to 'C' now
-/// exists in the instruction stream. Similiarly this will inline a recursive
-/// function by one level.
-///
-/// If a non-null callgraph pointer is provided, these functions update the
-/// CallGraph to represent the program after inlining.
-///
-bool InlineFunction(CallInst *C, CallGraph *CG = 0, const TargetData *TD = 0);
-bool InlineFunction(InvokeInst *II, CallGraph *CG = 0, const TargetData *TD =0);
-bool InlineFunction(CallSite CS, CallGraph *CG = 0, const TargetData *TD = 0);
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/Transforms/Utils/FunctionUtils.h b/release_23/include/llvm/Transforms/Utils/FunctionUtils.h
deleted file mode 100644
index 09afebeab790..000000000000
--- a/release_23/include/llvm/Transforms/Utils/FunctionUtils.h
+++ /dev/null
@@ -1,41 +0,0 @@
-//===-- Transform/Utils/FunctionUtils.h - Function Utils --------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This family of transformations manipulate LLVM functions.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_TRANSFORMS_UTILS_FUNCTION_H
-#define LLVM_TRANSFORMS_UTILS_FUNCTION_H
-
-#include "llvm/Analysis/Dominators.h"
-#include "llvm/Analysis/LoopInfo.h"
-#include <vector>
-
-namespace llvm {
- class BasicBlock;
- class Function;
-
- /// ExtractCodeRegion - rip out a sequence of basic blocks into a new function
- ///
- Function* ExtractCodeRegion(DominatorTree& DT,
- const std::vector<BasicBlock*> &code,
- bool AggregateArgs = false);
-
- /// ExtractLoop - rip out a natural loop into a new function
- ///
- Function* ExtractLoop(DominatorTree& DT, Loop *L,
- bool AggregateArgs = false);
-
- /// ExtractBasicBlock - rip out a basic block into a new function
- ///
- Function* ExtractBasicBlock(BasicBlock *BB, bool AggregateArgs = false);
-}
-
-#endif
diff --git a/release_23/include/llvm/Transforms/Utils/InlineCost.h b/release_23/include/llvm/Transforms/Utils/InlineCost.h
deleted file mode 100644
index 6018a803c6f9..000000000000
--- a/release_23/include/llvm/Transforms/Utils/InlineCost.h
+++ /dev/null
@@ -1,89 +0,0 @@
-//===- InlineCost.cpp - Cost analysis for inliner ---------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements bottom-up inlining of functions into callees.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef INLINECOST_H
-#define INLINECOST_H
-
-#include "llvm/ADT/SmallPtrSet.h"
-#include <map>
-#include <vector>
-
-namespace llvm {
-
- class Value;
- class Function;
- class CallSite;
-
- /// InlineCostAnalyzer - Cost analyzer used by inliner.
- class InlineCostAnalyzer {
- struct ArgInfo {
- public:
- unsigned ConstantWeight;
- unsigned AllocaWeight;
-
- ArgInfo(unsigned CWeight, unsigned AWeight)
- : ConstantWeight(CWeight), AllocaWeight(AWeight) {}
- };
-
- // FunctionInfo - For each function, calculate the size of it in blocks and
- // instructions.
- struct FunctionInfo {
- // NumInsts, NumBlocks - Keep track of how large each function is, which is
- // used to estimate the code size cost of inlining it.
- unsigned NumInsts, NumBlocks;
-
- // NumVectorInsts - Keep track how many instrctions produce vector values.
- // The inliner is being more aggressive with inlining vector kernels.
- unsigned NumVectorInsts;
-
- // ArgumentWeights - Each formal argument of the function is inspected to
- // see if it is used in any contexts where making it a constant or alloca
- // would reduce the code size. If so, we add some value to the argument
- // entry here.
- std::vector<ArgInfo> ArgumentWeights;
-
- FunctionInfo() : NumInsts(0), NumBlocks(0), NumVectorInsts(0) {}
-
- /// analyzeFunction - Fill in the current structure with information gleaned
- /// from the specified function.
- void analyzeFunction(Function *F);
-
- // CountCodeReductionForConstant - Figure out an approximation for how many
- // instructions will be constant folded if the specified value is constant.
- //
- unsigned CountCodeReductionForConstant(Value *V);
-
- // CountCodeReductionForAlloca - Figure out an approximation of how much smaller
- // the function will be if it is inlined into a context where an argument
- // becomes an alloca.
- //
- unsigned CountCodeReductionForAlloca(Value *V);
- };
-
- std::map<const Function *, FunctionInfo>CachedFunctionInfo;
-
- public:
-
- // getInlineCost - The heuristic used to determine if we should inline the
- // function call or not.
- //
- int getInlineCost(CallSite CS,
- SmallPtrSet<const Function *, 16> &NeverInline);
-
- // getInlineFudgeFactor - Return a > 1.0 factor if the inliner should use a
- // higher threshold to determine if the function call should be inlined.
- float getInlineFudgeFactor(CallSite CS);
- };
-}
-
-#endif
diff --git a/release_23/include/llvm/Transforms/Utils/Local.h b/release_23/include/llvm/Transforms/Utils/Local.h
deleted file mode 100644
index e65638d94a02..000000000000
--- a/release_23/include/llvm/Transforms/Utils/Local.h
+++ /dev/null
@@ -1,91 +0,0 @@
-//===-- Local.h - Functions to perform local transformations ----*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This family of functions perform various local transformations to the
-// program.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_TRANSFORMS_UTILS_LOCAL_H
-#define LLVM_TRANSFORMS_UTILS_LOCAL_H
-
-#include "llvm/Function.h"
-
-namespace llvm {
-
-class Pass;
-class PHINode;
-class AllocaInst;
-class ConstantExpr;
-class TargetData;
-
-//===----------------------------------------------------------------------===//
-// Local constant propagation...
-//
-
-/// doConstantPropagation - Constant prop a specific instruction. Returns true
-/// and potentially moves the iterator if constant propagation was performed.
-///
-bool doConstantPropagation(BasicBlock::iterator &I, const TargetData *TD = 0);
-
-/// ConstantFoldTerminator - If a terminator instruction is predicated on a
-/// constant value, convert it into an unconditional branch to the constant
-/// destination. This is a nontrivial operation because the successors of this
-/// basic block must have their PHI nodes updated.
-///
-bool ConstantFoldTerminator(BasicBlock *BB);
-
-//===----------------------------------------------------------------------===//
-// Local dead code elimination...
-//
-
-/// isInstructionTriviallyDead - Return true if the result produced by the
-/// instruction is not used, and the instruction has no side effects.
-///
-bool isInstructionTriviallyDead(Instruction *I);
-
-
-/// dceInstruction - Inspect the instruction at *BBI and figure out if it
-/// isTriviallyDead. If so, remove the instruction and update the iterator to
-/// point to the instruction that immediately succeeded the original
-/// instruction.
-///
-bool dceInstruction(BasicBlock::iterator &BBI);
-
-//===----------------------------------------------------------------------===//
-// Control Flow Graph Restructuring...
-//
-
-/// SimplifyCFG - This function is used to do simplification of a CFG. For
-/// example, it adjusts branches to branches to eliminate the extra hop, it
-/// eliminates unreachable basic blocks, and does other "peephole" optimization
-/// of the CFG. It returns true if a modification was made, possibly deleting
-/// the basic block that was pointed to.
-///
-/// WARNING: The entry node of a method may not be simplified.
-///
-bool SimplifyCFG(BasicBlock *BB);
-
-/// DemoteRegToStack - This function takes a virtual register computed by an
-/// Instruction and replaces it with a slot in the stack frame, allocated via
-/// alloca. This allows the CFG to be changed around without fear of
-/// invalidating the SSA information for the value. It returns the pointer to
-/// the alloca inserted to create a stack slot for X.
-///
-AllocaInst *DemoteRegToStack(Instruction &X, bool VolatileLoads = false,
- Instruction *AllocaPoint = NULL);
-
-/// DemotePHIToStack - This function takes a virtual register computed by a phi
-/// node and replaces it with a slot in the stack frame, allocated via alloca.
-/// The phi node is deleted and it returns the pointer to the alloca inserted.
-AllocaInst *DemotePHIToStack(PHINode *P, Instruction *AllocaPoint = NULL);
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/Transforms/Utils/PromoteMemToReg.h b/release_23/include/llvm/Transforms/Utils/PromoteMemToReg.h
deleted file mode 100644
index 35cfaddb7379..000000000000
--- a/release_23/include/llvm/Transforms/Utils/PromoteMemToReg.h
+++ /dev/null
@@ -1,46 +0,0 @@
-//===- PromoteMemToReg.h - Promote Allocas to Scalars -----------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file exposes an interface to promote alloca instructions to SSA
-// registers, by using the SSA construction algorithm.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef TRANSFORMS_UTILS_PROMOTEMEMTOREG_H
-#define TRANSFORMS_UTILS_PROMOTEMEMTOREG_H
-
-#include <vector>
-
-namespace llvm {
-
-class AllocaInst;
-class DominatorTree;
-class DominanceFrontier;
-class AliasSetTracker;
-
-/// isAllocaPromotable - Return true if this alloca is legal for promotion.
-/// This is true if there are only loads and stores to the alloca...
-///
-bool isAllocaPromotable(const AllocaInst *AI);
-
-/// PromoteMemToReg - Promote the specified list of alloca instructions into
-/// scalar registers, inserting PHI nodes as appropriate. This function makes
-/// use of DominanceFrontier information. This function does not modify the CFG
-/// of the function at all. All allocas must be from the same function.
-///
-/// If AST is specified, the specified tracker is updated to reflect changes
-/// made to the IR.
-///
-void PromoteMemToReg(const std::vector<AllocaInst*> &Allocas,
- DominatorTree &DT, DominanceFrontier &DF,
- AliasSetTracker *AST = 0);
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/Transforms/Utils/UnifyFunctionExitNodes.h b/release_23/include/llvm/Transforms/Utils/UnifyFunctionExitNodes.h
deleted file mode 100644
index 598adfc0bce0..000000000000
--- a/release_23/include/llvm/Transforms/Utils/UnifyFunctionExitNodes.h
+++ /dev/null
@@ -1,49 +0,0 @@
-//===-- UnifyFunctionExitNodes.h - Ensure fn's have one return --*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This pass is used to ensure that functions have at most one return and one
-// unwind instruction in them. Additionally, it keeps track of which node is
-// the new exit node of the CFG. If there are no return or unwind instructions
-// in the function, the getReturnBlock/getUnwindBlock methods will return a null
-// pointer.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_TRANSFORMS_UNIFYFUNCTIONEXITNODES_H
-#define LLVM_TRANSFORMS_UNIFYFUNCTIONEXITNODES_H
-
-#include "llvm/Pass.h"
-
-namespace llvm {
-
-struct UnifyFunctionExitNodes : public FunctionPass {
- BasicBlock *ReturnBlock, *UnwindBlock, *UnreachableBlock;
-public:
- static char ID; // Pass identification, replacement for typeid
- UnifyFunctionExitNodes() : FunctionPass((intptr_t)&ID),
- ReturnBlock(0), UnwindBlock(0) {}
-
- // We can preserve non-critical-edgeness when we unify function exit nodes
- virtual void getAnalysisUsage(AnalysisUsage &AU) const;
-
- // getReturn|Unwind|UnreachableBlock - Return the new single (or nonexistant)
- // return, unwind, or unreachable basic blocks in the CFG.
- //
- BasicBlock *getReturnBlock() const { return ReturnBlock; }
- BasicBlock *getUnwindBlock() const { return UnwindBlock; }
- BasicBlock *getUnreachableBlock() const { return UnreachableBlock; }
-
- virtual bool runOnFunction(Function &F);
-};
-
-Pass *createUnifyFunctionExitNodesPass();
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/Transforms/Utils/ValueMapper.h b/release_23/include/llvm/Transforms/Utils/ValueMapper.h
deleted file mode 100644
index ed3341364181..000000000000
--- a/release_23/include/llvm/Transforms/Utils/ValueMapper.h
+++ /dev/null
@@ -1,29 +0,0 @@
-//===- ValueMapper.h - Interface shared by lib/Transforms/Utils -*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines the MapValue interface which is used by various parts of
-// the Transforms/Utils library to implement cloning and linking facilities.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef VALUEMAPPER_H
-#define VALUEMAPPER_H
-
-#include "llvm/ADT/DenseMap.h"
-
-namespace llvm {
- class Value;
- class Instruction;
- typedef DenseMap<const Value *, Value *> ValueMapTy;
-
- Value *MapValue(const Value *V, ValueMapTy &VM);
- void RemapInstruction(Instruction *I, ValueMapTy &VM);
-} // End llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/Type.h b/release_23/include/llvm/Type.h
deleted file mode 100644
index 1ee84e2cabe2..000000000000
--- a/release_23/include/llvm/Type.h
+++ /dev/null
@@ -1,412 +0,0 @@
-//===-- llvm/Type.h - Classes for handling data types -----------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-
-#ifndef LLVM_TYPE_H
-#define LLVM_TYPE_H
-
-#include "llvm/AbstractTypeUser.h"
-#include "llvm/Support/Casting.h"
-#include "llvm/Support/DataTypes.h"
-#include "llvm/Support/Streams.h"
-#include "llvm/ADT/GraphTraits.h"
-#include "llvm/ADT/iterator"
-#include <string>
-#include <vector>
-
-namespace llvm {
-
-class DerivedType;
-class PointerType;
-class IntegerType;
-class TypeMapBase;
-
-/// This file contains the declaration of the Type class. For more "Type" type
-/// stuff, look in DerivedTypes.h.
-///
-/// The instances of the Type class are immutable: once they are created,
-/// they are never changed. Also note that only one instance of a particular
-/// type is ever created. Thus seeing if two types are equal is a matter of
-/// doing a trivial pointer comparison. To enforce that no two equal instances
-/// are created, Type instances can only be created via static factory methods
-/// in class Type and in derived classes.
-///
-/// Once allocated, Types are never free'd, unless they are an abstract type
-/// that is resolved to a more concrete type.
-///
-/// Types themself don't have a name, and can be named either by:
-/// - using SymbolTable instance, typically from some Module,
-/// - using convenience methods in the Module class (which uses module's
-/// SymbolTable too).
-///
-/// Opaque types are simple derived types with no state. There may be many
-/// different Opaque type objects floating around, but two are only considered
-/// identical if they are pointer equals of each other. This allows us to have
-/// two opaque types that end up resolving to different concrete types later.
-///
-/// Opaque types are also kinda weird and scary and different because they have
-/// to keep a list of uses of the type. When, through linking, parsing, or
-/// bitcode reading, they become resolved, they need to find and update all
-/// users of the unknown type, causing them to reference a new, more concrete
-/// type. Opaque types are deleted when their use list dwindles to zero users.
-///
-/// @brief Root of type hierarchy
-class Type : public AbstractTypeUser {
-public:
- //===-------------------------------------------------------------------===//
- /// Definitions of all of the base types for the Type system. Based on this
- /// value, you can cast to a "DerivedType" subclass (see DerivedTypes.h)
- /// Note: If you add an element to this, you need to add an element to the
- /// Type::getPrimitiveType function, or else things will break!
- ///
- enum TypeID {
- // PrimitiveTypes .. make sure LastPrimitiveTyID stays up to date
- VoidTyID = 0, ///< 0: type with no size
- FloatTyID, ///< 1: 32 bit floating point type
- DoubleTyID, ///< 2: 64 bit floating point type
- X86_FP80TyID, ///< 3: 80 bit floating point type (X87)
- FP128TyID, ///< 4: 128 bit floating point type (112-bit mantissa)
- PPC_FP128TyID, ///< 5: 128 bit floating point type (two 64-bits)
- LabelTyID, ///< 6: Labels
-
- // Derived types... see DerivedTypes.h file...
- // Make sure FirstDerivedTyID stays up to date!!!
- IntegerTyID, ///< 7: Arbitrary bit width integers
- FunctionTyID, ///< 8: Functions
- StructTyID, ///< 9: Structures
- ArrayTyID, ///< 10: Arrays
- PointerTyID, ///< 11: Pointers
- OpaqueTyID, ///< 12: Opaque: type with unknown structure
- VectorTyID, ///< 13: SIMD 'packed' format, or other vector type
-
- NumTypeIDs, // Must remain as last defined ID
- LastPrimitiveTyID = LabelTyID,
- FirstDerivedTyID = IntegerTyID
- };
-
-private:
- TypeID ID : 8; // The current base type of this type.
- bool Abstract : 1; // True if type contains an OpaqueType
- unsigned SubclassData : 23; //Space for subclasses to store data
-
- /// RefCount - This counts the number of PATypeHolders that are pointing to
- /// this type. When this number falls to zero, if the type is abstract and
- /// has no AbstractTypeUsers, the type is deleted. This is only sensical for
- /// derived types.
- ///
- mutable unsigned RefCount;
-
- const Type *getForwardedTypeInternal() const;
-
- // Some Type instances are allocated as arrays, some aren't. So we provide
- // this method to get the right kind of destruction for the type of Type.
- void destroy() const; // const is a lie, this does "delete this"!
-
-protected:
- explicit Type(TypeID id) : ID(id), Abstract(false), SubclassData(0),
- RefCount(0), ForwardType(0), NumContainedTys(0),
- ContainedTys(0) {}
- virtual ~Type() {
- assert(AbstractTypeUsers.empty() && "Abstract types remain");
- }
-
- /// Types can become nonabstract later, if they are refined.
- ///
- inline void setAbstract(bool Val) { Abstract = Val; }
-
- unsigned getRefCount() const { return RefCount; }
-
- unsigned getSubclassData() const { return SubclassData; }
- void setSubclassData(unsigned val) { SubclassData = val; }
-
- /// ForwardType - This field is used to implement the union find scheme for
- /// abstract types. When types are refined to other types, this field is set
- /// to the more refined type. Only abstract types can be forwarded.
- mutable const Type *ForwardType;
-
-
- /// AbstractTypeUsers - Implement a list of the users that need to be notified
- /// if I am a type, and I get resolved into a more concrete type.
- ///
- mutable std::vector<AbstractTypeUser *> AbstractTypeUsers;
-
- /// NumContainedTys - Keeps track of how many PATypeHandle instances there
- /// are at the end of this type instance for the list of contained types. It
- /// is the subclasses responsibility to set this up. Set to 0 if there are no
- /// contained types in this type.
- unsigned NumContainedTys;
-
- /// ContainedTys - A pointer to the array of Types (PATypeHandle) contained
- /// by this Type. For example, this includes the arguments of a function
- /// type, the elements of a structure, the pointee of a pointer, the element
- /// type of an array, etc. This pointer may be 0 for types that don't
- /// contain other types (Integer, Double, Float). In general, the subclass
- /// should arrange for space for the PATypeHandles to be included in the
- /// allocation of the type object and set this pointer to the address of the
- /// first element. This allows the Type class to manipulate the ContainedTys
- /// without understanding the subclass's placement for this array. keeping
- /// it here also allows the subtype_* members to be implemented MUCH more
- /// efficiently, and dynamically very few types do not contain any elements.
- PATypeHandle *ContainedTys;
-
-public:
- void print(std::ostream &O) const;
- void print(std::ostream *O) const { if (O) print(*O); }
-
- /// @brief Debugging support: print to stderr
- void dump() const;
-
- //===--------------------------------------------------------------------===//
- // Property accessors for dealing with types... Some of these virtual methods
- // are defined in private classes defined in Type.cpp for primitive types.
- //
-
- /// getTypeID - Return the type id for the type. This will return one
- /// of the TypeID enum elements defined above.
- ///
- inline TypeID getTypeID() const { return ID; }
-
- /// getDescription - Return the string representation of the type...
- const std::string &getDescription() const;
-
- /// isInteger - True if this is an instance of IntegerType.
- ///
- bool isInteger() const { return ID == IntegerTyID; }
-
- /// isIntOrIntVector - Return true if this is an integer type or a vector of
- /// integer types.
- ///
- bool isIntOrIntVector() const;
-
- /// isFloatingPoint - Return true if this is one of the two floating point
- /// types
- bool isFloatingPoint() const { return ID == FloatTyID || ID == DoubleTyID ||
- ID == X86_FP80TyID || ID == FP128TyID || ID == PPC_FP128TyID; }
-
- /// isFPOrFPVector - Return true if this is a FP type or a vector of FP types.
- ///
- bool isFPOrFPVector() const;
-
- /// isAbstract - True if the type is either an Opaque type, or is a derived
- /// type that includes an opaque type somewhere in it.
- ///
- inline bool isAbstract() const { return Abstract; }
-
- /// canLosslesslyBitCastTo - Return true if this type could be converted
- /// with a lossless BitCast to type 'Ty'. For example, uint to int. BitCasts
- /// are valid for types of the same size only where no re-interpretation of
- /// the bits is done.
- /// @brief Determine if this type could be losslessly bitcast to Ty
- bool canLosslesslyBitCastTo(const Type *Ty) const;
-
-
- /// Here are some useful little methods to query what type derived types are
- /// Note that all other types can just compare to see if this == Type::xxxTy;
- ///
- inline bool isPrimitiveType() const { return ID <= LastPrimitiveTyID; }
- inline bool isDerivedType() const { return ID >= FirstDerivedTyID; }
-
- /// isFirstClassType - Return true if the value is holdable in a register.
- ///
- inline bool isFirstClassType() const {
- return (ID != VoidTyID && ID <= LastPrimitiveTyID) ||
- ID == IntegerTyID || ID == PointerTyID || ID == VectorTyID;
- }
-
- /// isSized - Return true if it makes sense to take the size of this type. To
- /// get the actual size for a particular target, it is reasonable to use the
- /// TargetData subsystem to do this.
- ///
- bool isSized() const {
- // If it's a primitive, it is always sized.
- if (ID == IntegerTyID || isFloatingPoint() || ID == PointerTyID)
- return true;
- // If it is not something that can have a size (e.g. a function or label),
- // it doesn't have a size.
- if (ID != StructTyID && ID != ArrayTyID && ID != VectorTyID)
- return false;
- // If it is something that can have a size and it's concrete, it definitely
- // has a size, otherwise we have to try harder to decide.
- return !isAbstract() || isSizedDerivedType();
- }
-
- /// getPrimitiveSizeInBits - Return the basic size of this type if it is a
- /// primitive type. These are fixed by LLVM and are not target dependent.
- /// This will return zero if the type does not have a size or is not a
- /// primitive type.
- ///
- unsigned getPrimitiveSizeInBits() const;
-
- /// getForwardedType - Return the type that this type has been resolved to if
- /// it has been resolved to anything. This is used to implement the
- /// union-find algorithm for type resolution, and shouldn't be used by general
- /// purpose clients.
- const Type *getForwardedType() const {
- if (!ForwardType) return 0;
- return getForwardedTypeInternal();
- }
-
- /// getVAArgsPromotedType - Return the type an argument of this type
- /// will be promoted to if passed through a variable argument
- /// function.
- const Type *getVAArgsPromotedType() const;
-
- //===--------------------------------------------------------------------===//
- // Type Iteration support
- //
- typedef PATypeHandle *subtype_iterator;
- subtype_iterator subtype_begin() const { return ContainedTys; }
- subtype_iterator subtype_end() const { return &ContainedTys[NumContainedTys];}
-
- /// getContainedType - This method is used to implement the type iterator
- /// (defined a the end of the file). For derived types, this returns the
- /// types 'contained' in the derived type.
- ///
- const Type *getContainedType(unsigned i) const {
- assert(i < NumContainedTys && "Index out of range!");
- return ContainedTys[i].get();
- }
-
- /// getNumContainedTypes - Return the number of types in the derived type.
- ///
- unsigned getNumContainedTypes() const { return NumContainedTys; }
-
- //===--------------------------------------------------------------------===//
- // Static members exported by the Type class itself. Useful for getting
- // instances of Type.
- //
-
- /// getPrimitiveType - Return a type based on an identifier.
- static const Type *getPrimitiveType(TypeID IDNumber);
-
- //===--------------------------------------------------------------------===//
- // These are the builtin types that are always available...
- //
- static const Type *VoidTy, *LabelTy, *FloatTy, *DoubleTy;
- static const Type *X86_FP80Ty, *FP128Ty, *PPC_FP128Ty;
- static const IntegerType *Int1Ty, *Int8Ty, *Int16Ty, *Int32Ty, *Int64Ty;
-
- /// Methods for support type inquiry through isa, cast, and dyn_cast:
- static inline bool classof(const Type *T) { return true; }
-
- void addRef() const {
- assert(isAbstract() && "Cannot add a reference to a non-abstract type!");
- ++RefCount;
- }
-
- void dropRef() const {
- assert(isAbstract() && "Cannot drop a reference to a non-abstract type!");
- assert(RefCount && "No objects are currently referencing this object!");
-
- // If this is the last PATypeHolder using this object, and there are no
- // PATypeHandles using it, the type is dead, delete it now.
- if (--RefCount == 0 && AbstractTypeUsers.empty())
- this->destroy();
- }
-
- /// addAbstractTypeUser - Notify an abstract type that there is a new user of
- /// it. This function is called primarily by the PATypeHandle class.
- ///
- void addAbstractTypeUser(AbstractTypeUser *U) const {
- assert(isAbstract() && "addAbstractTypeUser: Current type not abstract!");
- AbstractTypeUsers.push_back(U);
- }
-
- /// removeAbstractTypeUser - Notify an abstract type that a user of the class
- /// no longer has a handle to the type. This function is called primarily by
- /// the PATypeHandle class. When there are no users of the abstract type, it
- /// is annihilated, because there is no way to get a reference to it ever
- /// again.
- ///
- void removeAbstractTypeUser(AbstractTypeUser *U) const;
-
-private:
- /// isSizedDerivedType - Derived types like structures and arrays are sized
- /// iff all of the members of the type are sized as well. Since asking for
- /// their size is relatively uncommon, move this operation out of line.
- bool isSizedDerivedType() const;
-
- virtual void refineAbstractType(const DerivedType *OldTy, const Type *NewTy);
- virtual void typeBecameConcrete(const DerivedType *AbsTy);
-
-protected:
- // PromoteAbstractToConcrete - This is an internal method used to calculate
- // change "Abstract" from true to false when types are refined.
- void PromoteAbstractToConcrete();
- friend class TypeMapBase;
-};
-
-//===----------------------------------------------------------------------===//
-// Define some inline methods for the AbstractTypeUser.h:PATypeHandle class.
-// These are defined here because they MUST be inlined, yet are dependent on
-// the definition of the Type class.
-//
-inline void PATypeHandle::addUser() {
- assert(Ty && "Type Handle has a null type!");
- if (Ty->isAbstract())
- Ty->addAbstractTypeUser(User);
-}
-inline void PATypeHandle::removeUser() {
- if (Ty->isAbstract())
- Ty->removeAbstractTypeUser(User);
-}
-
-// Define inline methods for PATypeHolder.
-
-inline void PATypeHolder::addRef() {
- assert(Ty && "Type Holder has a null type!");
- if (Ty->isAbstract())
- Ty->addRef();
-}
-
-inline void PATypeHolder::dropRef() {
- if (Ty->isAbstract())
- Ty->dropRef();
-}
-
-
-//===----------------------------------------------------------------------===//
-// Provide specializations of GraphTraits to be able to treat a type as a
-// graph of sub types...
-
-template <> struct GraphTraits<Type*> {
- typedef Type NodeType;
- typedef Type::subtype_iterator ChildIteratorType;
-
- static inline NodeType *getEntryNode(Type *T) { return T; }
- static inline ChildIteratorType child_begin(NodeType *N) {
- return N->subtype_begin();
- }
- static inline ChildIteratorType child_end(NodeType *N) {
- return N->subtype_end();
- }
-};
-
-template <> struct GraphTraits<const Type*> {
- typedef const Type NodeType;
- typedef Type::subtype_iterator ChildIteratorType;
-
- static inline NodeType *getEntryNode(const Type *T) { return T; }
- static inline ChildIteratorType child_begin(NodeType *N) {
- return N->subtype_begin();
- }
- static inline ChildIteratorType child_end(NodeType *N) {
- return N->subtype_end();
- }
-};
-
-template <> inline bool isa_impl<PointerType, Type>(const Type &Ty) {
- return Ty.getTypeID() == Type::PointerTyID;
-}
-
-std::ostream &operator<<(std::ostream &OS, const Type &T);
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/TypeSymbolTable.h b/release_23/include/llvm/TypeSymbolTable.h
deleted file mode 100644
index f4e641002825..000000000000
--- a/release_23/include/llvm/TypeSymbolTable.h
+++ /dev/null
@@ -1,137 +0,0 @@
-//===-- llvm/TypeSymbolTable.h - Implement a Type Symtab --------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the name/type symbol table for LLVM.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_TYPE_SYMBOL_TABLE_H
-#define LLVM_TYPE_SYMBOL_TABLE_H
-
-#include "llvm/Type.h"
-#include <map>
-
-namespace llvm {
-
-/// This class provides a symbol table of name/type pairs with operations to
-/// support constructing, searching and iterating over the symbol table. The
-/// class derives from AbstractTypeUser so that the contents of the symbol
-/// table can be updated when abstract types become concrete.
-class TypeSymbolTable : public AbstractTypeUser {
-
-/// @name Types
-/// @{
-public:
-
- /// @brief A mapping of names to types.
- typedef std::map<const std::string, const Type*> TypeMap;
-
- /// @brief An iterator over the TypeMap.
- typedef TypeMap::iterator iterator;
-
- /// @brief A const_iterator over the TypeMap.
- typedef TypeMap::const_iterator const_iterator;
-
-/// @}
-/// @name Constructors
-/// @{
-public:
-
- TypeSymbolTable():LastUnique(0) {}
- ~TypeSymbolTable();
-
-/// @}
-/// @name Accessors
-/// @{
-public:
-
- /// Generates a unique name for a type based on the \p BaseName by
- /// incrementing an integer and appending it to the name, if necessary
- /// @returns the unique name
- /// @brief Get a unique name for a type
- std::string getUniqueName(const std::string &BaseName) const;
-
- /// This method finds the type with the given \p name in the type map
- /// and returns it.
- /// @returns null if the name is not found, otherwise the Type
- /// associated with the \p name.
- /// @brief Lookup a type by name.
- Type* lookup(const std::string& name) const;
-
- /// @returns true iff the symbol table is empty.
- /// @brief Determine if the symbol table is empty
- inline bool empty() const { return tmap.empty(); }
-
- /// @returns the size of the symbol table
- /// @brief The number of name/type pairs is returned.
- inline unsigned size() const { return unsigned(tmap.size()); }
-
- /// This function can be used from the debugger to display the
- /// content of the symbol table while debugging.
- /// @brief Print out symbol table on stderr
- void dump() const;
-
-/// @}
-/// @name Iteration
-/// @{
-public:
- /// Get an iterator to the start of the symbol table
- inline iterator begin() { return tmap.begin(); }
-
- /// @brief Get a const_iterator to the start of the symbol table
- inline const_iterator begin() const { return tmap.begin(); }
-
- /// Get an iterator to the end of the symbol talbe.
- inline iterator end() { return tmap.end(); }
-
- /// Get a const_iterator to the end of the symbol table.
- inline const_iterator end() const { return tmap.end(); }
-
-/// @}
-/// @name Mutators
-/// @{
-public:
-
- /// Inserts a type into the symbol table with the specified name. There can be
- /// a many-to-one mapping between names and types. This method allows a type
- /// with an existing entry in the symbol table to get a new name.
- /// @brief Insert a type under a new name.
- void insert(const std::string &Name, const Type *Typ);
-
- /// Remove a type at the specified position in the symbol table.
- /// @returns the removed Type.
- /// @returns the Type that was erased from the symbol table.
- Type* remove(iterator TI);
-
-/// @}
-/// @name AbstractTypeUser Methods
-/// @{
-private:
- /// This function is called when one of the types in the type plane
- /// is refined.
- virtual void refineAbstractType(const DerivedType *OldTy, const Type *NewTy);
-
- /// This function markes a type as being concrete (defined).
- virtual void typeBecameConcrete(const DerivedType *AbsTy);
-
-/// @}
-/// @name Internal Data
-/// @{
-private:
- TypeMap tmap; ///< This is the mapping of names to types.
- mutable uint32_t LastUnique; ///< Counter for tracking unique names
-
-/// @}
-
-};
-
-} // End llvm namespace
-
-#endif
-
diff --git a/release_23/include/llvm/Use.h b/release_23/include/llvm/Use.h
deleted file mode 100644
index e050743ffdb0..000000000000
--- a/release_23/include/llvm/Use.h
+++ /dev/null
@@ -1,181 +0,0 @@
-//===-- llvm/Use.h - Definition of the Use class ----------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This defines the Use class. The Use class represents the operand of an
-// instruction or some other User instance which refers to a Value. The Use
-// class keeps the "use list" of the referenced value up to date.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_USE_H
-#define LLVM_USE_H
-
-#include "llvm/Support/Casting.h"
-#include "llvm/ADT/iterator"
-
-namespace llvm {
-
-class Value;
-class User;
-
-
-//===----------------------------------------------------------------------===//
-// Use Class
-//===----------------------------------------------------------------------===//
-
-// Use is here to make keeping the "use" list of a Value up-to-date really easy.
-//
-class Use {
-public:
- inline void init(Value *V, User *U);
-
- Use(Value *V, User *U) { init(V, U); }
- Use(const Use &U) { init(U.Val, U.U); }
- inline ~Use() {
- if (Val) removeFromList();
- }
-
- /// Default ctor - This leaves the Use completely unitialized. The only thing
- /// that is valid to do with this use is to call the "init" method.
- inline Use() : Val(0) {}
-
-
- operator Value*() const { return Val; }
- Value *get() const { return Val; }
- User *getUser() const { return U; }
-
- inline void set(Value *Val);
-
- Value *operator=(Value *RHS) {
- set(RHS);
- return RHS;
- }
- const Use &operator=(const Use &RHS) {
- set(RHS.Val);
- return *this;
- }
-
- Value *operator->() { return Val; }
- const Value *operator->() const { return Val; }
-
- Use *getNext() const { return Next; }
-private:
- Use *Next, **Prev;
- Value *Val;
- User *U;
-
- void addToList(Use **List) {
- Next = *List;
- if (Next) Next->Prev = &Next;
- Prev = List;
- *List = this;
- }
- void removeFromList() {
- *Prev = Next;
- if (Next) Next->Prev = Prev;
- }
-
- friend class Value;
-};
-
-// simplify_type - Allow clients to treat uses just like values when using
-// casting operators.
-template<> struct simplify_type<Use> {
- typedef Value* SimpleType;
- static SimpleType getSimplifiedValue(const Use &Val) {
- return static_cast<SimpleType>(Val.get());
- }
-};
-template<> struct simplify_type<const Use> {
- typedef Value* SimpleType;
- static SimpleType getSimplifiedValue(const Use &Val) {
- return static_cast<SimpleType>(Val.get());
- }
-};
-
-
-
-template<typename UserTy> // UserTy == 'User' or 'const User'
-class value_use_iterator : public forward_iterator<UserTy*, ptrdiff_t> {
- typedef forward_iterator<UserTy*, ptrdiff_t> super;
- typedef value_use_iterator<UserTy> _Self;
-
- Use *U;
- explicit value_use_iterator(Use *u) : U(u) {}
- friend class Value;
-public:
- typedef typename super::reference reference;
- typedef typename super::pointer pointer;
-
- value_use_iterator(const _Self &I) : U(I.U) {}
- value_use_iterator() {}
-
- bool operator==(const _Self &x) const {
- return U == x.U;
- }
- bool operator!=(const _Self &x) const {
- return !operator==(x);
- }
-
- /// atEnd - return true if this iterator is equal to use_end() on the value.
- bool atEnd() const { return U == 0; }
-
- // Iterator traversal: forward iteration only
- _Self &operator++() { // Preincrement
- assert(U && "Cannot increment end iterator!");
- U = U->getNext();
- return *this;
- }
- _Self operator++(int) { // Postincrement
- _Self tmp = *this; ++*this; return tmp;
- }
-
- // Retrieve a reference to the current User
- UserTy *operator*() const {
- assert(U && "Cannot increment end iterator!");
- return U->getUser();
- }
-
- UserTy *operator->() const { return operator*(); }
-
- Use &getUse() const { return *U; }
-
- /// getOperandNo - Return the operand # of this use in its User. Defined in
- /// User.h
- ///
- unsigned getOperandNo() const;
-};
-
-
-template<> struct simplify_type<value_use_iterator<User> > {
- typedef User* SimpleType;
-
- static SimpleType getSimplifiedValue(const value_use_iterator<User> &Val) {
- return *Val;
- }
-};
-
-template<> struct simplify_type<const value_use_iterator<User> >
- : public simplify_type<value_use_iterator<User> > {};
-
-template<> struct simplify_type<value_use_iterator<const User> > {
- typedef const User* SimpleType;
-
- static SimpleType getSimplifiedValue(const
- value_use_iterator<const User> &Val) {
- return *Val;
- }
-};
-
-template<> struct simplify_type<const value_use_iterator<const User> >
- : public simplify_type<value_use_iterator<const User> > {};
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/User.h b/release_23/include/llvm/User.h
deleted file mode 100644
index d3e4f1ede2a9..000000000000
--- a/release_23/include/llvm/User.h
+++ /dev/null
@@ -1,127 +0,0 @@
-//===-- llvm/User.h - User class definition ---------------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This class defines the interface that one who 'use's a Value must implement.
-// Each instance of the Value class keeps track of what User's have handles
-// to it.
-//
-// * Instructions are the largest class of User's.
-// * Constants may be users of other constants (think arrays and stuff)
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_USER_H
-#define LLVM_USER_H
-
-#include "llvm/Value.h"
-
-namespace llvm {
-
-class User : public Value {
- User(const User &); // Do not implement
- void *operator new(size_t); // Do not implement
-protected:
- /// OperandList - This is a pointer to the array of Users for this operand.
- /// For nodes of fixed arity (e.g. a binary operator) this array will live
- /// embedded into the derived class. For nodes of variable arity
- /// (e.g. ConstantArrays, CallInst, PHINodes, ReturnInst etc), this memory
- /// will be dynamically allocated and should be destroyed by the classes
- /// virtual dtor.
- Use *OperandList;
-
- /// NumOperands - The number of values used by this User.
- ///
- unsigned NumOperands;
-
- void *operator new(size_t s, size_t) {
- return ::operator new(s);
- }
- User(const Type *Ty, unsigned vty, Use *OpList, unsigned NumOps)
- : Value(Ty, vty), OperandList(OpList), NumOperands(NumOps) {}
-
-public:
- Value *getOperand(unsigned i) const {
- assert(i < NumOperands && "getOperand() out of range!");
- return OperandList[i];
- }
- void setOperand(unsigned i, Value *Val) {
- assert(i < NumOperands && "setOperand() out of range!");
- OperandList[i] = Val;
- }
- unsigned getNumOperands() const { return NumOperands; }
-
- // ---------------------------------------------------------------------------
- // Operand Iterator interface...
- //
- typedef Use* op_iterator;
- typedef const Use* const_op_iterator;
-
- inline op_iterator op_begin() { return OperandList; }
- inline const_op_iterator op_begin() const { return OperandList; }
- inline op_iterator op_end() { return OperandList+NumOperands; }
- inline const_op_iterator op_end() const { return OperandList+NumOperands; }
-
- // dropAllReferences() - This function is in charge of "letting go" of all
- // objects that this User refers to. This allows one to
- // 'delete' a whole class at a time, even though there may be circular
- // references... first all references are dropped, and all use counts go to
- // zero. Then everything is delete'd for real. Note that no operations are
- // valid on an object that has "dropped all references", except operator
- // delete.
- //
- void dropAllReferences() {
- Use *OL = OperandList;
- for (unsigned i = 0, e = NumOperands; i != e; ++i)
- OL[i].set(0);
- }
-
- /// replaceUsesOfWith - Replaces all references to the "From" definition with
- /// references to the "To" definition.
- ///
- void replaceUsesOfWith(Value *From, Value *To);
-
- // Methods for support type inquiry through isa, cast, and dyn_cast:
- static inline bool classof(const User *) { return true; }
- static inline bool classof(const Value *V) {
- return isa<Instruction>(V) || isa<Constant>(V);
- }
-};
-
-template<> struct simplify_type<User::op_iterator> {
- typedef Value* SimpleType;
-
- static SimpleType getSimplifiedValue(const User::op_iterator &Val) {
- return static_cast<SimpleType>(Val->get());
- }
-};
-
-template<> struct simplify_type<const User::op_iterator>
- : public simplify_type<User::op_iterator> {};
-
-template<> struct simplify_type<User::const_op_iterator> {
- typedef Value* SimpleType;
-
- static SimpleType getSimplifiedValue(const User::const_op_iterator &Val) {
- return static_cast<SimpleType>(Val->get());
- }
-};
-
-template<> struct simplify_type<const User::const_op_iterator>
- : public simplify_type<User::const_op_iterator> {};
-
-
-// value_use_iterator::getOperandNo - Requires the definition of the User class.
-template<typename UserTy>
-unsigned value_use_iterator<UserTy>::getOperandNo() const {
- return U - U->getUser()->op_begin();
-}
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/Value.h b/release_23/include/llvm/Value.h
deleted file mode 100644
index 2bcac08a952e..000000000000
--- a/release_23/include/llvm/Value.h
+++ /dev/null
@@ -1,282 +0,0 @@
-//===-- llvm/Value.h - Definition of the Value class ------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file declares the Value class.
-// This file also defines the Use<> template for users of value.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_VALUE_H
-#define LLVM_VALUE_H
-
-#include "llvm/AbstractTypeUser.h"
-#include "llvm/Use.h"
-#include "llvm/Support/Casting.h"
-#include "llvm/Support/Streams.h"
-#include <string>
-
-namespace llvm {
-
-class Constant;
-class Argument;
-class Instruction;
-class BasicBlock;
-class GlobalValue;
-class Function;
-class GlobalVariable;
-class GlobalAlias;
-class InlineAsm;
-class ValueSymbolTable;
-class TypeSymbolTable;
-template<typename ValueTy> class StringMapEntry;
-typedef StringMapEntry<Value*> ValueName;
-
-//===----------------------------------------------------------------------===//
-// Value Class
-//===----------------------------------------------------------------------===//
-
-/// This is a very important LLVM class. It is the base class of all values
-/// computed by a program that may be used as operands to other values. Value is
-/// the super class of other important classes such as Instruction and Function.
-/// All Values have a Type. Type is not a subclass of Value. All types can have
-/// a name and they should belong to some Module. Setting the name on the Value
-/// automatically updates the module's symbol table.
-///
-/// Every value has a "use list" that keeps track of which other Values are
-/// using this Value.
-/// @brief LLVM Value Representation
-class Value {
- const unsigned short SubclassID; // Subclass identifier (for isa/dyn_cast)
-protected:
- /// SubclassData - This member is defined by this class, but is not used for
- /// anything. Subclasses can use it to hold whatever state they find useful.
- /// This field is initialized to zero by the ctor.
- unsigned short SubclassData;
-private:
- PATypeHolder Ty;
- Use *UseList;
-
- friend class ValueSymbolTable; // Allow ValueSymbolTable to directly mod Name.
- friend class SymbolTable; // Allow SymbolTable to directly poke Name.
- ValueName *Name;
-
- void operator=(const Value &); // Do not implement
- Value(const Value &); // Do not implement
-
-public:
- Value(const Type *Ty, unsigned scid);
- virtual ~Value();
-
- /// dump - Support for debugging, callable in GDB: V->dump()
- //
- virtual void dump() const;
-
- /// print - Implement operator<< on Value...
- ///
- virtual void print(std::ostream &O) const = 0;
- void print(std::ostream *O) const { if (O) print(*O); }
-
- /// All values are typed, get the type of this value.
- ///
- inline const Type *getType() const { return Ty; }
-
- // All values can potentially be named...
- inline bool hasName() const { return Name != 0; }
- ValueName *getValueName() const { return Name; }
-
- /// getNameStart - Return a pointer to a null terminated string for this name.
- /// Note that names can have null characters within the string as well as at
- /// their end. This always returns a non-null pointer.
- const char *getNameStart() const;
-
- /// isName - Return true if this value has the name specified by the provided
- /// nul terminated string.
- bool isName(const char *N) const;
-
- /// getNameLen - Return the length of the string, correctly handling nul
- /// characters embedded into them.
- unsigned getNameLen() const;
-
- /// getName()/getNameStr() - Return the name of the specified value,
- /// *constructing a string* to hold it. Because these are guaranteed to
- /// construct a string, they are very expensive and should be avoided.
- std::string getName() const { return getNameStr(); }
- std::string getNameStr() const;
-
-
- void setName(const std::string &name);
- void setName(const char *Name, unsigned NameLen);
- void setName(const char *Name); // Takes a null-terminated string.
-
-
- /// takeName - transfer the name from V to this value, setting V's name to
- /// empty. It is an error to call V->takeName(V).
- void takeName(Value *V);
-
- /// replaceAllUsesWith - Go through the uses list for this definition and make
- /// each use point to "V" instead of "this". After this completes, 'this's
- /// use list is guaranteed to be empty.
- ///
- void replaceAllUsesWith(Value *V);
-
- // uncheckedReplaceAllUsesWith - Just like replaceAllUsesWith but dangerous.
- // Only use when in type resolution situations!
- void uncheckedReplaceAllUsesWith(Value *V);
-
- //----------------------------------------------------------------------
- // Methods for handling the vector of uses of this Value.
- //
- typedef value_use_iterator<User> use_iterator;
- typedef value_use_iterator<const User> use_const_iterator;
-
- bool use_empty() const { return UseList == 0; }
- use_iterator use_begin() { return use_iterator(UseList); }
- use_const_iterator use_begin() const { return use_const_iterator(UseList); }
- use_iterator use_end() { return use_iterator(0); }
- use_const_iterator use_end() const { return use_const_iterator(0); }
- User *use_back() { return *use_begin(); }
- const User *use_back() const { return *use_begin(); }
-
- /// hasOneUse - Return true if there is exactly one user of this value. This
- /// is specialized because it is a common request and does not require
- /// traversing the whole use list.
- ///
- bool hasOneUse() const {
- use_const_iterator I = use_begin(), E = use_end();
- if (I == E) return false;
- return ++I == E;
- }
-
- /// hasNUses - Return true if this Value has exactly N users.
- ///
- bool hasNUses(unsigned N) const;
-
- /// hasNUsesOrMore - Return true if this value has N users or more. This is
- /// logically equivalent to getNumUses() >= N.
- ///
- bool hasNUsesOrMore(unsigned N) const;
-
- /// getNumUses - This method computes the number of uses of this Value. This
- /// is a linear time operation. Use hasOneUse, hasNUses, or hasMoreThanNUses
- /// to check for specific values.
- unsigned getNumUses() const;
-
- /// addUse - This method should only be used by the Use class.
- ///
- void addUse(Use &U) { U.addToList(&UseList); }
-
- /// An enumeration for keeping track of the concrete subclass of Value that
- /// is actually instantiated. Values of this enumeration are kept in the
- /// Value classes SubclassID field. They are used for concrete type
- /// identification.
- enum ValueTy {
- ArgumentVal, // This is an instance of Argument
- BasicBlockVal, // This is an instance of BasicBlock
- FunctionVal, // This is an instance of Function
- GlobalAliasVal, // This is an instance of GlobalAlias
- GlobalVariableVal, // This is an instance of GlobalVariable
- UndefValueVal, // This is an instance of UndefValue
- ConstantExprVal, // This is an instance of ConstantExpr
- ConstantAggregateZeroVal, // This is an instance of ConstantAggregateNull
- ConstantIntVal, // This is an instance of ConstantInt
- ConstantFPVal, // This is an instance of ConstantFP
- ConstantArrayVal, // This is an instance of ConstantArray
- ConstantStructVal, // This is an instance of ConstantStruct
- ConstantVectorVal, // This is an instance of ConstantVector
- ConstantPointerNullVal, // This is an instance of ConstantPointerNull
- InlineAsmVal, // This is an instance of InlineAsm
- PseudoSourceValueVal, // This is an instance of PseudoSourceValue
- InstructionVal, // This is an instance of Instruction
-
- // Markers:
- ConstantFirstVal = FunctionVal,
- ConstantLastVal = ConstantPointerNullVal
- };
-
- /// getValueID - Return an ID for the concrete type of this object. This is
- /// used to implement the classof checks. This should not be used for any
- /// other purpose, as the values may change as LLVM evolves. Also, note that
- /// for instructions, the Instruction's opcode is added to InstructionVal. So
- /// this means three things:
- /// # there is no value with code InstructionVal (no opcode==0).
- /// # there are more possible values for the value type than in ValueTy enum.
- /// # the InstructionVal enumerator must be the highest valued enumerator in
- /// the ValueTy enum.
- unsigned getValueID() const {
- return SubclassID;
- }
-
- // Methods for support type inquiry through isa, cast, and dyn_cast:
- static inline bool classof(const Value *) {
- return true; // Values are always values.
- }
-
- /// getRawType - This should only be used to implement the vmcore library.
- ///
- const Type *getRawType() const { return Ty.getRawType(); }
-
- /// stripPointerCasts - This method strips off any unneeded pointer
- /// casts from the specified value, returning the original uncasted value.
- /// Note that the returned value is guaranteed to have pointer type.
- Value *stripPointerCasts();
-};
-
-inline std::ostream &operator<<(std::ostream &OS, const Value &V) {
- V.print(OS);
- return OS;
-}
-
-void Use::init(Value *v, User *user) {
- Val = v;
- U = user;
- if (Val) Val->addUse(*this);
-}
-
-void Use::set(Value *V) {
- if (Val) removeFromList();
- Val = V;
- if (V) V->addUse(*this);
-}
-
-
-// isa - Provide some specializations of isa so that we don't have to include
-// the subtype header files to test to see if the value is a subclass...
-//
-template <> inline bool isa_impl<Constant, Value>(const Value &Val) {
- return Val.getValueID() >= Value::ConstantFirstVal &&
- Val.getValueID() <= Value::ConstantLastVal;
-}
-template <> inline bool isa_impl<Argument, Value>(const Value &Val) {
- return Val.getValueID() == Value::ArgumentVal;
-}
-template <> inline bool isa_impl<InlineAsm, Value>(const Value &Val) {
- return Val.getValueID() == Value::InlineAsmVal;
-}
-template <> inline bool isa_impl<Instruction, Value>(const Value &Val) {
- return Val.getValueID() >= Value::InstructionVal;
-}
-template <> inline bool isa_impl<BasicBlock, Value>(const Value &Val) {
- return Val.getValueID() == Value::BasicBlockVal;
-}
-template <> inline bool isa_impl<Function, Value>(const Value &Val) {
- return Val.getValueID() == Value::FunctionVal;
-}
-template <> inline bool isa_impl<GlobalVariable, Value>(const Value &Val) {
- return Val.getValueID() == Value::GlobalVariableVal;
-}
-template <> inline bool isa_impl<GlobalAlias, Value>(const Value &Val) {
- return Val.getValueID() == Value::GlobalAliasVal;
-}
-template <> inline bool isa_impl<GlobalValue, Value>(const Value &Val) {
- return isa<GlobalVariable>(Val) || isa<Function>(Val) || isa<GlobalAlias>(Val);
-}
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/include/llvm/ValueSymbolTable.h b/release_23/include/llvm/ValueSymbolTable.h
deleted file mode 100644
index 54522df6a15b..000000000000
--- a/release_23/include/llvm/ValueSymbolTable.h
+++ /dev/null
@@ -1,137 +0,0 @@
-//===-- llvm/ValueSymbolTable.h - Implement a Value Symtab ------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the name/Value symbol table for LLVM.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_VALUE_SYMBOL_TABLE_H
-#define LLVM_VALUE_SYMBOL_TABLE_H
-
-#include "llvm/Value.h"
-#include "llvm/ADT/StringMap.h"
-#include "llvm/Support/DataTypes.h"
-
-namespace llvm {
- template<typename ValueSubClass, typename ItemParentClass>
- class SymbolTableListTraits;
- class BasicBlock;
- class Function;
- class Module;
-
-/// This class provides a symbol table of name/value pairs. It is essentially
-/// a std::map<std::string,Value*> but has a controlled interface provided by
-/// LLVM as well as ensuring uniqueness of names.
-///
-class ValueSymbolTable {
- friend class Value;
- friend class SymbolTableListTraits<Argument, Function>;
- friend class SymbolTableListTraits<BasicBlock, Function>;
- friend class SymbolTableListTraits<Instruction, BasicBlock>;
- friend class SymbolTableListTraits<Function, Module>;
- friend class SymbolTableListTraits<GlobalVariable, Module>;
- friend class SymbolTableListTraits<GlobalAlias, Module>;
-/// @name Types
-/// @{
-public:
- /// @brief A mapping of names to values.
- typedef StringMap<Value*> ValueMap;
-
- /// @brief An iterator over a ValueMap.
- typedef ValueMap::iterator iterator;
-
- /// @brief A const_iterator over a ValueMap.
- typedef ValueMap::const_iterator const_iterator;
-
-/// @}
-/// @name Constructors
-/// @{
-public:
-
- ValueSymbolTable() : vmap(0), LastUnique(0) {}
- ~ValueSymbolTable();
-
-/// @}
-/// @name Accessors
-/// @{
-public:
-
- /// This method finds the value with the given \p name in the
- /// the symbol table.
- /// @returns the value associated with the \p name
- /// @brief Lookup a named Value.
- Value *lookup(const std::string &name) const;
-
- /// @returns true iff the symbol table is empty
- /// @brief Determine if the symbol table is empty
- inline bool empty() const { return vmap.empty(); }
-
- /// @brief The number of name/type pairs is returned.
- inline unsigned size() const { return unsigned(vmap.size()); }
-
- /// Given a base name, return a string that is either equal to it or
- /// derived from it that does not already occur in the symbol table
- /// for the specified type.
- /// @brief Get a name unique to this symbol table
- std::string getUniqueName(const std::string &BaseName) const;
-
- /// This function can be used from the debugger to display the
- /// content of the symbol table while debugging.
- /// @brief Print out symbol table on stderr
- void dump() const;
-
-/// @}
-/// @name Iteration
-/// @{
-public:
- /// @brief Get an iterator that from the beginning of the symbol table.
- inline iterator begin() { return vmap.begin(); }
-
- /// @brief Get a const_iterator that from the beginning of the symbol table.
- inline const_iterator begin() const { return vmap.begin(); }
-
- /// @brief Get an iterator to the end of the symbol table.
- inline iterator end() { return vmap.end(); }
-
- /// @brief Get a const_iterator to the end of the symbol table.
- inline const_iterator end() const { return vmap.end(); }
-
-/// @}
-/// @name Mutators
-/// @{
-private:
- /// This method adds the provided value \p N to the symbol table. The Value
- /// must have a name which is used to place the value in the symbol table.
- /// If the inserted name conflicts, this renames the value.
- /// @brief Add a named value to the symbol table
- void reinsertValue(Value *V);
-
- /// createValueName - This method attempts to create a value name and insert
- /// it into the symbol table with the specified name. If it conflicts, it
- /// auto-renames the name and returns that instead.
- ValueName *createValueName(const char *NameStart, unsigned NameLen, Value *V);
-
- /// This method removes a value from the symbol table. It leaves the
- /// ValueName attached to the value, but it is no longer inserted in the
- /// symtab.
- void removeValueName(ValueName *V);
-
-/// @}
-/// @name Internal Data
-/// @{
-private:
- ValueMap vmap; ///< The map that holds the symbol table.
- mutable uint32_t LastUnique; ///< Counter for tracking unique names
-
-/// @}
-};
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/lib/Analysis/AliasAnalysis.cpp b/release_23/lib/Analysis/AliasAnalysis.cpp
deleted file mode 100644
index 04ad7de7bd3b..000000000000
--- a/release_23/lib/Analysis/AliasAnalysis.cpp
+++ /dev/null
@@ -1,216 +0,0 @@
-//===- AliasAnalysis.cpp - Generic Alias Analysis Interface Implementation -==//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the generic AliasAnalysis interface which is used as the
-// common interface used by all clients and implementations of alias analysis.
-//
-// This file also implements the default version of the AliasAnalysis interface
-// that is to be used when no other implementation is specified. This does some
-// simple tests that detect obvious cases: two different global pointers cannot
-// alias, a global cannot alias a malloc, two different mallocs cannot alias,
-// etc.
-//
-// This alias analysis implementation really isn't very good for anything, but
-// it is very fast, and makes a nice clean default implementation. Because it
-// handles lots of little corner cases, other, more complex, alias analysis
-// implementations may choose to rely on this pass to resolve these simple and
-// easy cases.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Analysis/AliasAnalysis.h"
-#include "llvm/Pass.h"
-#include "llvm/BasicBlock.h"
-#include "llvm/Function.h"
-#include "llvm/Instructions.h"
-#include "llvm/Type.h"
-#include "llvm/Target/TargetData.h"
-using namespace llvm;
-
-// Register the AliasAnalysis interface, providing a nice name to refer to.
-namespace {
- RegisterAnalysisGroup<AliasAnalysis> Z("Alias Analysis");
-}
-char AliasAnalysis::ID = 0;
-
-//===----------------------------------------------------------------------===//
-// Default chaining methods
-//===----------------------------------------------------------------------===//
-
-AliasAnalysis::AliasResult
-AliasAnalysis::alias(const Value *V1, unsigned V1Size,
- const Value *V2, unsigned V2Size) {
- assert(AA && "AA didn't call InitializeAliasAnalysis in its run method!");
- return AA->alias(V1, V1Size, V2, V2Size);
-}
-
-void AliasAnalysis::getMustAliases(Value *P, std::vector<Value*> &RetVals) {
- assert(AA && "AA didn't call InitializeAliasAnalysis in its run method!");
- return AA->getMustAliases(P, RetVals);
-}
-
-bool AliasAnalysis::pointsToConstantMemory(const Value *P) {
- assert(AA && "AA didn't call InitializeAliasAnalysis in its run method!");
- return AA->pointsToConstantMemory(P);
-}
-
-AliasAnalysis::ModRefBehavior
-AliasAnalysis::getModRefBehavior(Function *F, CallSite CS,
- std::vector<PointerAccessInfo> *Info) {
- assert(AA && "AA didn't call InitializeAliasAnalysis in its run method!");
- return AA->getModRefBehavior(F, CS, Info);
-}
-
-bool AliasAnalysis::hasNoModRefInfoForCalls() const {
- assert(AA && "AA didn't call InitializeAliasAnalysis in its run method!");
- return AA->hasNoModRefInfoForCalls();
-}
-
-void AliasAnalysis::deleteValue(Value *V) {
- assert(AA && "AA didn't call InitializeAliasAnalysis in its run method!");
- AA->deleteValue(V);
-}
-
-void AliasAnalysis::copyValue(Value *From, Value *To) {
- assert(AA && "AA didn't call InitializeAliasAnalysis in its run method!");
- AA->copyValue(From, To);
-}
-
-AliasAnalysis::ModRefResult
-AliasAnalysis::getModRefInfo(CallSite CS1, CallSite CS2) {
- // FIXME: we can do better.
- assert(AA && "AA didn't call InitializeAliasAnalysis in its run method!");
- return AA->getModRefInfo(CS1, CS2);
-}
-
-
-//===----------------------------------------------------------------------===//
-// AliasAnalysis non-virtual helper method implementation
-//===----------------------------------------------------------------------===//
-
-AliasAnalysis::ModRefResult
-AliasAnalysis::getModRefInfo(LoadInst *L, Value *P, unsigned Size) {
- return alias(L->getOperand(0), TD->getTypeStoreSize(L->getType()),
- P, Size) ? Ref : NoModRef;
-}
-
-AliasAnalysis::ModRefResult
-AliasAnalysis::getModRefInfo(StoreInst *S, Value *P, unsigned Size) {
- // If the stored address cannot alias the pointer in question, then the
- // pointer cannot be modified by the store.
- if (!alias(S->getOperand(1),
- TD->getTypeStoreSize(S->getOperand(0)->getType()), P, Size))
- return NoModRef;
-
- // If the pointer is a pointer to constant memory, then it could not have been
- // modified by this store.
- return pointsToConstantMemory(P) ? NoModRef : Mod;
-}
-
-AliasAnalysis::ModRefBehavior
-AliasAnalysis::getModRefBehavior(CallSite CS,
- std::vector<PointerAccessInfo> *Info) {
- if (CS.doesNotAccessMemory())
- // Can't do better than this.
- return DoesNotAccessMemory;
- ModRefBehavior MRB = UnknownModRefBehavior;
- if (Function *F = CS.getCalledFunction())
- MRB = getModRefBehavior(F, CS, Info);
- if (MRB != DoesNotAccessMemory && CS.onlyReadsMemory())
- return OnlyReadsMemory;
- return MRB;
-}
-
-AliasAnalysis::ModRefBehavior
-AliasAnalysis::getModRefBehavior(Function *F,
- std::vector<PointerAccessInfo> *Info) {
- if (F->doesNotAccessMemory())
- // Can't do better than this.
- return DoesNotAccessMemory;
- ModRefBehavior MRB = getModRefBehavior(F, CallSite(), Info);
- if (MRB != DoesNotAccessMemory && F->onlyReadsMemory())
- return OnlyReadsMemory;
- return MRB;
-}
-
-AliasAnalysis::ModRefResult
-AliasAnalysis::getModRefInfo(CallSite CS, Value *P, unsigned Size) {
- ModRefResult Mask = ModRef;
- ModRefBehavior MRB = getModRefBehavior(CS);
- if (MRB == OnlyReadsMemory)
- Mask = Ref;
- else if (MRB == DoesNotAccessMemory)
- return NoModRef;
-
- if (!AA) return Mask;
-
- // If P points to a constant memory location, the call definitely could not
- // modify the memory location.
- if ((Mask & Mod) && AA->pointsToConstantMemory(P))
- Mask = ModRefResult(Mask & ~Mod);
-
- return ModRefResult(Mask & AA->getModRefInfo(CS, P, Size));
-}
-
-// AliasAnalysis destructor: DO NOT move this to the header file for
-// AliasAnalysis or else clients of the AliasAnalysis class may not depend on
-// the AliasAnalysis.o file in the current .a file, causing alias analysis
-// support to not be included in the tool correctly!
-//
-AliasAnalysis::~AliasAnalysis() {}
-
-/// setTargetData - Subclasses must call this method to initialize the
-/// AliasAnalysis interface before any other methods are called.
-///
-void AliasAnalysis::InitializeAliasAnalysis(Pass *P) {
- TD = &P->getAnalysis<TargetData>();
- AA = &P->getAnalysis<AliasAnalysis>();
-}
-
-// getAnalysisUsage - All alias analysis implementations should invoke this
-// directly (using AliasAnalysis::getAnalysisUsage(AU)) to make sure that
-// TargetData is required by the pass.
-void AliasAnalysis::getAnalysisUsage(AnalysisUsage &AU) const {
- AU.addRequired<TargetData>(); // All AA's need TargetData.
- AU.addRequired<AliasAnalysis>(); // All AA's chain
-}
-
-/// canBasicBlockModify - Return true if it is possible for execution of the
-/// specified basic block to modify the value pointed to by Ptr.
-///
-bool AliasAnalysis::canBasicBlockModify(const BasicBlock &BB,
- const Value *Ptr, unsigned Size) {
- return canInstructionRangeModify(BB.front(), BB.back(), Ptr, Size);
-}
-
-/// canInstructionRangeModify - Return true if it is possible for the execution
-/// of the specified instructions to modify the value pointed to by Ptr. The
-/// instructions to consider are all of the instructions in the range of [I1,I2]
-/// INCLUSIVE. I1 and I2 must be in the same basic block.
-///
-bool AliasAnalysis::canInstructionRangeModify(const Instruction &I1,
- const Instruction &I2,
- const Value *Ptr, unsigned Size) {
- assert(I1.getParent() == I2.getParent() &&
- "Instructions not in same basic block!");
- BasicBlock::iterator I = const_cast<Instruction*>(&I1);
- BasicBlock::iterator E = const_cast<Instruction*>(&I2);
- ++E; // Convert from inclusive to exclusive range.
-
- for (; I != E; ++I) // Check every instruction in range
- if (getModRefInfo(I, const_cast<Value*>(Ptr), Size) & Mod)
- return true;
- return false;
-}
-
-// Because of the way .a files work, we must force the BasicAA implementation to
-// be pulled in if the AliasAnalysis classes are pulled in. Otherwise we run
-// the risk of AliasAnalysis being used, but the default implementation not
-// being linked into the tool that uses it.
-DEFINING_FILE_FOR(AliasAnalysis)
diff --git a/release_23/lib/Analysis/AliasAnalysisCounter.cpp b/release_23/lib/Analysis/AliasAnalysisCounter.cpp
deleted file mode 100644
index 9c42902a04c7..000000000000
--- a/release_23/lib/Analysis/AliasAnalysisCounter.cpp
+++ /dev/null
@@ -1,171 +0,0 @@
-//===- AliasAnalysisCounter.cpp - Alias Analysis Query Counter ------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements a pass which can be used to count how many alias queries
-// are being made and how the alias analysis implementation being used responds.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Analysis/Passes.h"
-#include "llvm/Pass.h"
-#include "llvm/Analysis/AliasAnalysis.h"
-#include "llvm/Assembly/Writer.h"
-#include "llvm/Support/CommandLine.h"
-#include "llvm/Support/Compiler.h"
-#include "llvm/Support/Streams.h"
-using namespace llvm;
-
-namespace {
- static cl::opt<bool>
- PrintAll("count-aa-print-all-queries", cl::ReallyHidden);
- static cl::opt<bool>
- PrintAllFailures("count-aa-print-all-failed-queries", cl::ReallyHidden);
-
- class VISIBILITY_HIDDEN AliasAnalysisCounter
- : public ModulePass, public AliasAnalysis {
- unsigned No, May, Must;
- unsigned NoMR, JustRef, JustMod, MR;
- const char *Name;
- Module *M;
- public:
- static char ID; // Class identification, replacement for typeinfo
- AliasAnalysisCounter() : ModulePass((intptr_t) &ID) {
- No = May = Must = 0;
- NoMR = JustRef = JustMod = MR = 0;
- }
-
- void printLine(const char *Desc, unsigned Val, unsigned Sum) {
- cerr << " " << Val << " " << Desc << " responses ("
- << Val*100/Sum << "%)\n";
- }
- ~AliasAnalysisCounter() {
- unsigned AASum = No+May+Must;
- unsigned MRSum = NoMR+JustRef+JustMod+MR;
- if (AASum + MRSum) { // Print a report if any counted queries occurred...
- cerr << "\n===== Alias Analysis Counter Report =====\n"
- << " Analysis counted: " << Name << "\n"
- << " " << AASum << " Total Alias Queries Performed\n";
- if (AASum) {
- printLine("no alias", No, AASum);
- printLine("may alias", May, AASum);
- printLine("must alias", Must, AASum);
- cerr << " Alias Analysis Counter Summary: " << No*100/AASum << "%/"
- << May*100/AASum << "%/" << Must*100/AASum<<"%\n\n";
- }
-
- cerr << " " << MRSum << " Total Mod/Ref Queries Performed\n";
- if (MRSum) {
- printLine("no mod/ref", NoMR, MRSum);
- printLine("ref", JustRef, MRSum);
- printLine("mod", JustMod, MRSum);
- printLine("mod/ref", MR, MRSum);
- cerr << " Mod/Ref Analysis Counter Summary: " <<NoMR*100/MRSum<< "%/"
- << JustRef*100/MRSum << "%/" << JustMod*100/MRSum << "%/"
- << MR*100/MRSum <<"%\n\n";
- }
- }
- }
-
- bool runOnModule(Module &M) {
- this->M = &M;
- InitializeAliasAnalysis(this);
- Name = dynamic_cast<Pass*>(&getAnalysis<AliasAnalysis>())->getPassName();
- return false;
- }
-
- virtual void getAnalysisUsage(AnalysisUsage &AU) const {
- AliasAnalysis::getAnalysisUsage(AU);
- AU.addRequired<AliasAnalysis>();
- AU.setPreservesAll();
- }
-
- // FIXME: We could count these too...
- bool pointsToConstantMemory(const Value *P) {
- return getAnalysis<AliasAnalysis>().pointsToConstantMemory(P);
- }
- bool doesNotAccessMemory(CallSite CS) {
- return getAnalysis<AliasAnalysis>().doesNotAccessMemory(CS);
- }
- bool doesNotAccessMemory(Function *F) {
- return getAnalysis<AliasAnalysis>().doesNotAccessMemory(F);
- }
- bool onlyReadsMemory(CallSite CS) {
- return getAnalysis<AliasAnalysis>().onlyReadsMemory(CS);
- }
- bool onlyReadsMemory(Function *F) {
- return getAnalysis<AliasAnalysis>().onlyReadsMemory(F);
- }
-
-
- // Forwarding functions: just delegate to a real AA implementation, counting
- // the number of responses...
- AliasResult alias(const Value *V1, unsigned V1Size,
- const Value *V2, unsigned V2Size);
-
- ModRefResult getModRefInfo(CallSite CS, Value *P, unsigned Size);
- ModRefResult getModRefInfo(CallSite CS1, CallSite CS2) {
- return AliasAnalysis::getModRefInfo(CS1,CS2);
- }
- };
-
- char AliasAnalysisCounter::ID = 0;
- RegisterPass<AliasAnalysisCounter>
- X("count-aa", "Count Alias Analysis Query Responses", false, true);
- RegisterAnalysisGroup<AliasAnalysis> Y(X);
-}
-
-ModulePass *llvm::createAliasAnalysisCounterPass() {
- return new AliasAnalysisCounter();
-}
-
-AliasAnalysis::AliasResult
-AliasAnalysisCounter::alias(const Value *V1, unsigned V1Size,
- const Value *V2, unsigned V2Size) {
- AliasResult R = getAnalysis<AliasAnalysis>().alias(V1, V1Size, V2, V2Size);
-
- const char *AliasString;
- switch (R) {
- default: assert(0 && "Unknown alias type!");
- case NoAlias: No++; AliasString = "No alias"; break;
- case MayAlias: May++; AliasString = "May alias"; break;
- case MustAlias: Must++; AliasString = "Must alias"; break;
- }
-
- if (PrintAll || (PrintAllFailures && R == MayAlias)) {
- cerr << AliasString << ":\t";
- cerr << "[" << V1Size << "B] ";
- WriteAsOperand(*cerr.stream(), V1, true, M) << ", ";
- cerr << "[" << V2Size << "B] ";
- WriteAsOperand(*cerr.stream(), V2, true, M) << "\n";
- }
-
- return R;
-}
-
-AliasAnalysis::ModRefResult
-AliasAnalysisCounter::getModRefInfo(CallSite CS, Value *P, unsigned Size) {
- ModRefResult R = getAnalysis<AliasAnalysis>().getModRefInfo(CS, P, Size);
-
- const char *MRString;
- switch (R) {
- default: assert(0 && "Unknown mod/ref type!");
- case NoModRef: NoMR++; MRString = "NoModRef"; break;
- case Ref: JustRef++; MRString = "JustRef"; break;
- case Mod: JustMod++; MRString = "JustMod"; break;
- case ModRef: MR++; MRString = "ModRef"; break;
- }
-
- if (PrintAll || (PrintAllFailures && R == ModRef)) {
- cerr << MRString << ": Ptr: ";
- cerr << "[" << Size << "B] ";
- WriteAsOperand(*cerr.stream(), P, true, M);
- cerr << "\t<->" << *CS.getInstruction();
- }
- return R;
-}
diff --git a/release_23/lib/Analysis/AliasAnalysisEvaluator.cpp b/release_23/lib/Analysis/AliasAnalysisEvaluator.cpp
deleted file mode 100644
index 704ab8273cc7..000000000000
--- a/release_23/lib/Analysis/AliasAnalysisEvaluator.cpp
+++ /dev/null
@@ -1,247 +0,0 @@
-//===- AliasAnalysisEvaluator.cpp - Alias Analysis Accuracy Evaluator -----===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements a simple N^2 alias analysis accuracy evaluator.
-// Basically, for each function in the program, it simply queries to see how the
-// alias analysis implementation answers alias queries between each pair of
-// pointers in the function.
-//
-// This is inspired and adapted from code by: Naveen Neelakantam, Francesco
-// Spadini, and Wojciech Stryjewski.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Constants.h"
-#include "llvm/DerivedTypes.h"
-#include "llvm/Function.h"
-#include "llvm/Instructions.h"
-#include "llvm/Pass.h"
-#include "llvm/Analysis/Passes.h"
-#include "llvm/Analysis/AliasAnalysis.h"
-#include "llvm/Assembly/Writer.h"
-#include "llvm/Target/TargetData.h"
-#include "llvm/Support/InstIterator.h"
-#include "llvm/Support/CommandLine.h"
-#include "llvm/Support/Compiler.h"
-#include "llvm/Support/Streams.h"
-#include <set>
-#include <sstream>
-using namespace llvm;
-
-namespace {
- static cl::opt<bool>
- PrintAll("print-all-alias-modref-info", cl::ReallyHidden);
-
- static cl::opt<bool> PrintNoAlias("print-no-aliases", cl::ReallyHidden);
- static cl::opt<bool> PrintMayAlias("print-may-aliases", cl::ReallyHidden);
- static cl::opt<bool> PrintMustAlias("print-must-aliases", cl::ReallyHidden);
-
- static cl::opt<bool> PrintNoModRef("print-no-modref", cl::ReallyHidden);
- static cl::opt<bool> PrintMod("print-mod", cl::ReallyHidden);
- static cl::opt<bool> PrintRef("print-ref", cl::ReallyHidden);
- static cl::opt<bool> PrintModRef("print-modref", cl::ReallyHidden);
-
- class VISIBILITY_HIDDEN AAEval : public FunctionPass {
- unsigned NoAlias, MayAlias, MustAlias;
- unsigned NoModRef, Mod, Ref, ModRef;
-
- public:
- static char ID; // Pass identification, replacement for typeid
- AAEval() : FunctionPass((intptr_t)&ID) {}
-
- virtual void getAnalysisUsage(AnalysisUsage &AU) const {
- AU.addRequired<AliasAnalysis>();
- AU.setPreservesAll();
- }
-
- bool doInitialization(Module &M) {
- NoAlias = MayAlias = MustAlias = 0;
- NoModRef = Mod = Ref = ModRef = 0;
-
- if (PrintAll) {
- PrintNoAlias = PrintMayAlias = PrintMustAlias = true;
- PrintNoModRef = PrintMod = PrintRef = PrintModRef = true;
- }
- return false;
- }
-
- bool runOnFunction(Function &F);
- bool doFinalization(Module &M);
- };
-
- char AAEval::ID = 0;
- static RegisterPass<AAEval>
- X("aa-eval", "Exhaustive Alias Analysis Precision Evaluator", false, true);
-}
-
-FunctionPass *llvm::createAAEvalPass() { return new AAEval(); }
-
-static void PrintResults(const char *Msg, bool P, const Value *V1, const Value *V2,
- const Module *M) {
- if (P) {
- std::stringstream s1, s2;
- WriteAsOperand(s1, V1, true, M);
- WriteAsOperand(s2, V2, true, M);
- std::string o1(s1.str()), o2(s2.str());
- if (o2 < o1)
- std::swap(o1, o2);
- cerr << " " << Msg << ":\t"
- << o1 << ", "
- << o2 << "\n";
- }
-}
-
-static inline void
-PrintModRefResults(const char *Msg, bool P, Instruction *I, Value *Ptr,
- Module *M) {
- if (P) {
- cerr << " " << Msg << ": Ptr: ";
- WriteAsOperand(*cerr.stream(), Ptr, true, M);
- cerr << "\t<->" << *I;
- }
-}
-
-bool AAEval::runOnFunction(Function &F) {
- AliasAnalysis &AA = getAnalysis<AliasAnalysis>();
-
- const TargetData &TD = AA.getTargetData();
-
- std::set<Value *> Pointers;
- std::set<CallSite> CallSites;
-
- for (Function::arg_iterator I = F.arg_begin(), E = F.arg_end(); I != E; ++I)
- if (isa<PointerType>(I->getType())) // Add all pointer arguments
- Pointers.insert(I);
-
- for (inst_iterator I = inst_begin(F), E = inst_end(F); I != E; ++I) {
- if (isa<PointerType>(I->getType())) // Add all pointer instructions
- Pointers.insert(&*I);
- Instruction &Inst = *I;
- User::op_iterator OI = Inst.op_begin();
- if ((isa<InvokeInst>(Inst) || isa<CallInst>(Inst)) &&
- isa<Function>(Inst.getOperand(0)))
- ++OI; // Skip actual functions for direct function calls.
- for (; OI != Inst.op_end(); ++OI)
- if (isa<PointerType>((*OI)->getType()) && !isa<ConstantPointerNull>(*OI))
- Pointers.insert(*OI);
-
- CallSite CS = CallSite::get(&*I);
- if (CS.getInstruction()) CallSites.insert(CS);
- }
-
- if (PrintNoAlias || PrintMayAlias || PrintMustAlias ||
- PrintNoModRef || PrintMod || PrintRef || PrintModRef)
- cerr << "Function: " << F.getName() << ": " << Pointers.size()
- << " pointers, " << CallSites.size() << " call sites\n";
-
- // iterate over the worklist, and run the full (n^2)/2 disambiguations
- for (std::set<Value *>::iterator I1 = Pointers.begin(), E = Pointers.end();
- I1 != E; ++I1) {
- unsigned I1Size = 0;
- const Type *I1ElTy = cast<PointerType>((*I1)->getType())->getElementType();
- if (I1ElTy->isSized()) I1Size = TD.getTypeStoreSize(I1ElTy);
-
- for (std::set<Value *>::iterator I2 = Pointers.begin(); I2 != I1; ++I2) {
- unsigned I2Size = 0;
- const Type *I2ElTy =cast<PointerType>((*I2)->getType())->getElementType();
- if (I2ElTy->isSized()) I2Size = TD.getTypeStoreSize(I2ElTy);
-
- switch (AA.alias(*I1, I1Size, *I2, I2Size)) {
- case AliasAnalysis::NoAlias:
- PrintResults("NoAlias", PrintNoAlias, *I1, *I2, F.getParent());
- ++NoAlias; break;
- case AliasAnalysis::MayAlias:
- PrintResults("MayAlias", PrintMayAlias, *I1, *I2, F.getParent());
- ++MayAlias; break;
- case AliasAnalysis::MustAlias:
- PrintResults("MustAlias", PrintMustAlias, *I1, *I2, F.getParent());
- ++MustAlias; break;
- default:
- cerr << "Unknown alias query result!\n";
- }
- }
- }
-
- // Mod/ref alias analysis: compare all pairs of calls and values
- for (std::set<CallSite>::iterator C = CallSites.begin(),
- Ce = CallSites.end(); C != Ce; ++C) {
- Instruction *I = C->getInstruction();
-
- for (std::set<Value *>::iterator V = Pointers.begin(), Ve = Pointers.end();
- V != Ve; ++V) {
- unsigned Size = 0;
- const Type *ElTy = cast<PointerType>((*V)->getType())->getElementType();
- if (ElTy->isSized()) Size = TD.getTypeStoreSize(ElTy);
-
- switch (AA.getModRefInfo(*C, *V, Size)) {
- case AliasAnalysis::NoModRef:
- PrintModRefResults("NoModRef", PrintNoModRef, I, *V, F.getParent());
- ++NoModRef; break;
- case AliasAnalysis::Mod:
- PrintModRefResults(" Mod", PrintMod, I, *V, F.getParent());
- ++Mod; break;
- case AliasAnalysis::Ref:
- PrintModRefResults(" Ref", PrintRef, I, *V, F.getParent());
- ++Ref; break;
- case AliasAnalysis::ModRef:
- PrintModRefResults(" ModRef", PrintModRef, I, *V, F.getParent());
- ++ModRef; break;
- default:
- cerr << "Unknown alias query result!\n";
- }
- }
- }
-
- return false;
-}
-
-static void PrintPercent(unsigned Num, unsigned Sum) {
- cerr << "(" << Num*100ULL/Sum << "."
- << ((Num*1000ULL/Sum) % 10) << "%)\n";
-}
-
-bool AAEval::doFinalization(Module &M) {
- unsigned AliasSum = NoAlias + MayAlias + MustAlias;
- cerr << "===== Alias Analysis Evaluator Report =====\n";
- if (AliasSum == 0) {
- cerr << " Alias Analysis Evaluator Summary: No pointers!\n";
- } else {
- cerr << " " << AliasSum << " Total Alias Queries Performed\n";
- cerr << " " << NoAlias << " no alias responses ";
- PrintPercent(NoAlias, AliasSum);
- cerr << " " << MayAlias << " may alias responses ";
- PrintPercent(MayAlias, AliasSum);
- cerr << " " << MustAlias << " must alias responses ";
- PrintPercent(MustAlias, AliasSum);
- cerr << " Alias Analysis Evaluator Pointer Alias Summary: "
- << NoAlias*100/AliasSum << "%/" << MayAlias*100/AliasSum << "%/"
- << MustAlias*100/AliasSum << "%\n";
- }
-
- // Display the summary for mod/ref analysis
- unsigned ModRefSum = NoModRef + Mod + Ref + ModRef;
- if (ModRefSum == 0) {
- cerr << " Alias Analysis Mod/Ref Evaluator Summary: no mod/ref!\n";
- } else {
- cerr << " " << ModRefSum << " Total ModRef Queries Performed\n";
- cerr << " " << NoModRef << " no mod/ref responses ";
- PrintPercent(NoModRef, ModRefSum);
- cerr << " " << Mod << " mod responses ";
- PrintPercent(Mod, ModRefSum);
- cerr << " " << Ref << " ref responses ";
- PrintPercent(Ref, ModRefSum);
- cerr << " " << ModRef << " mod & ref responses ";
- PrintPercent(ModRef, ModRefSum);
- cerr << " Alias Analysis Evaluator Mod/Ref Summary: "
- << NoModRef*100/ModRefSum << "%/" << Mod*100/ModRefSum << "%/"
- << Ref*100/ModRefSum << "%/" << ModRef*100/ModRefSum << "%\n";
- }
-
- return false;
-}
diff --git a/release_23/lib/Analysis/AliasDebugger.cpp b/release_23/lib/Analysis/AliasDebugger.cpp
deleted file mode 100644
index 491c4b091ea6..000000000000
--- a/release_23/lib/Analysis/AliasDebugger.cpp
+++ /dev/null
@@ -1,131 +0,0 @@
-//===- AliasDebugger.cpp - Simple Alias Analysis Use Checker --------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This simple pass checks alias analysis users to ensure that if they
-// create a new value, they do not query AA without informing it of the value.
-// It acts as a shim over any other AA pass you want.
-//
-// Yes keeping track of every value in the program is expensive, but this is
-// a debugging pass.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Analysis/Passes.h"
-#include "llvm/Module.h"
-#include "llvm/Pass.h"
-#include "llvm/Instructions.h"
-#include "llvm/Constants.h"
-#include "llvm/DerivedTypes.h"
-#include "llvm/Analysis/AliasAnalysis.h"
-#include "llvm/Support/Compiler.h"
-#include <set>
-using namespace llvm;
-
-namespace {
-
- class VISIBILITY_HIDDEN AliasDebugger
- : public ModulePass, public AliasAnalysis {
-
- //What we do is simple. Keep track of every value the AA could
- //know about, and verify that queries are one of those.
- //A query to a value that didn't exist when the AA was created
- //means someone forgot to update the AA when creating new values
-
- std::set<const Value*> Vals;
-
- public:
- static char ID; // Class identification, replacement for typeinfo
- AliasDebugger() : ModulePass((intptr_t)&ID) {}
-
- bool runOnModule(Module &M) {
- InitializeAliasAnalysis(this); // set up super class
-
- for(Module::global_iterator I = M.global_begin(),
- E = M.global_end(); I != E; ++I)
- Vals.insert(&*I);
-
- for(Module::iterator I = M.begin(),
- E = M.end(); I != E; ++I){
- Vals.insert(&*I);
- if(!I->isDeclaration()) {
- for (Function::arg_iterator AI = I->arg_begin(), AE = I->arg_end();
- AI != AE; ++AI)
- Vals.insert(&*AI);
- for (Function::const_iterator FI = I->begin(), FE = I->end();
- FI != FE; ++FI)
- for (BasicBlock::const_iterator BI = FI->begin(), BE = FI->end();
- BI != BE; ++BI)
- Vals.insert(&*BI);
- }
-
- }
- return false;
- }
-
- virtual void getAnalysisUsage(AnalysisUsage &AU) const {
- AliasAnalysis::getAnalysisUsage(AU);
- AU.setPreservesAll(); // Does not transform code
- }
-
- //------------------------------------------------
- // Implement the AliasAnalysis API
- //
- AliasResult alias(const Value *V1, unsigned V1Size,
- const Value *V2, unsigned V2Size) {
- assert(Vals.find(V1) != Vals.end() && "Never seen value in AA before");
- assert(Vals.find(V2) != Vals.end() && "Never seen value in AA before");
- return AliasAnalysis::alias(V1, V1Size, V2, V2Size);
- }
-
- ModRefResult getModRefInfo(CallSite CS, Value *P, unsigned Size) {
- assert(Vals.find(P) != Vals.end() && "Never seen value in AA before");
- return AliasAnalysis::getModRefInfo(CS, P, Size);
- }
-
- ModRefResult getModRefInfo(CallSite CS1, CallSite CS2) {
- return AliasAnalysis::getModRefInfo(CS1,CS2);
- }
-
- void getMustAliases(Value *P, std::vector<Value*> &RetVals) {
- assert(Vals.find(P) != Vals.end() && "Never seen value in AA before");
- return AliasAnalysis::getMustAliases(P, RetVals);
- }
-
- bool pointsToConstantMemory(const Value *P) {
- assert(Vals.find(P) != Vals.end() && "Never seen value in AA before");
- return AliasAnalysis::pointsToConstantMemory(P);
- }
-
- /// getModRefBehavior - Return the behavior of the specified function if
- /// called from the specified call site. The call site may be null in which
- /// case the most generic behavior of this function should be returned.
- virtual ModRefBehavior getModRefBehavior(Function *F, CallSite CS,
- std::vector<PointerAccessInfo> *Info) {
- assert(Vals.find(F) != Vals.end() && "Never seen value in AA before");
- return AliasAnalysis::getModRefBehavior(F, CS, Info);
- }
-
- virtual void deleteValue(Value *V) {
- assert(Vals.find(V) != Vals.end() && "Never seen value in AA before");
- AliasAnalysis::deleteValue(V);
- }
- virtual void copyValue(Value *From, Value *To) {
- Vals.insert(To);
- AliasAnalysis::copyValue(From, To);
- }
-
- };
-
- char AliasDebugger::ID = 0;
- RegisterPass<AliasDebugger> X("debug-aa", "AA use debugger", false, true);
- RegisterAnalysisGroup<AliasAnalysis> Y(X);
-}
-
-Pass *llvm::createAliasDebugger() { return new AliasDebugger(); }
-
diff --git a/release_23/lib/Analysis/AliasSetTracker.cpp b/release_23/lib/Analysis/AliasSetTracker.cpp
deleted file mode 100644
index 01e700b76812..000000000000
--- a/release_23/lib/Analysis/AliasSetTracker.cpp
+++ /dev/null
@@ -1,590 +0,0 @@
-//===- AliasSetTracker.cpp - Alias Sets Tracker implementation-------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the AliasSetTracker and AliasSet classes.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Analysis/AliasSetTracker.h"
-#include "llvm/Analysis/AliasAnalysis.h"
-#include "llvm/Instructions.h"
-#include "llvm/Pass.h"
-#include "llvm/Type.h"
-#include "llvm/Target/TargetData.h"
-#include "llvm/Assembly/Writer.h"
-#include "llvm/Support/Compiler.h"
-#include "llvm/Support/InstIterator.h"
-#include "llvm/Support/Streams.h"
-using namespace llvm;
-
-/// mergeSetIn - Merge the specified alias set into this alias set.
-///
-void AliasSet::mergeSetIn(AliasSet &AS, AliasSetTracker &AST) {
- assert(!AS.Forward && "Alias set is already forwarding!");
- assert(!Forward && "This set is a forwarding set!!");
-
- // Update the alias and access types of this set...
- AccessTy |= AS.AccessTy;
- AliasTy |= AS.AliasTy;
-
- if (AliasTy == MustAlias) {
- // Check that these two merged sets really are must aliases. Since both
- // used to be must-alias sets, we can just check any pointer from each set
- // for aliasing.
- AliasAnalysis &AA = AST.getAliasAnalysis();
- HashNodePair *L = getSomePointer();
- HashNodePair *R = AS.getSomePointer();
-
- // If the pointers are not a must-alias pair, this set becomes a may alias.
- if (AA.alias(L->first, L->second.getSize(), R->first, R->second.getSize())
- != AliasAnalysis::MustAlias)
- AliasTy = MayAlias;
- }
-
- if (CallSites.empty()) { // Merge call sites...
- if (!AS.CallSites.empty())
- std::swap(CallSites, AS.CallSites);
- } else if (!AS.CallSites.empty()) {
- CallSites.insert(CallSites.end(), AS.CallSites.begin(), AS.CallSites.end());
- AS.CallSites.clear();
- }
-
- AS.Forward = this; // Forward across AS now...
- addRef(); // AS is now pointing to us...
-
- // Merge the list of constituent pointers...
- if (AS.PtrList) {
- *PtrListEnd = AS.PtrList;
- AS.PtrList->second.setPrevInList(PtrListEnd);
- PtrListEnd = AS.PtrListEnd;
-
- AS.PtrList = 0;
- AS.PtrListEnd = &AS.PtrList;
- assert(*AS.PtrListEnd == 0 && "End of list is not null?");
- }
-}
-
-void AliasSetTracker::removeAliasSet(AliasSet *AS) {
- if (AliasSet *Fwd = AS->Forward) {
- Fwd->dropRef(*this);
- AS->Forward = 0;
- }
- AliasSets.erase(AS);
-}
-
-void AliasSet::removeFromTracker(AliasSetTracker &AST) {
- assert(RefCount == 0 && "Cannot remove non-dead alias set from tracker!");
- AST.removeAliasSet(this);
-}
-
-void AliasSet::addPointer(AliasSetTracker &AST, HashNodePair &Entry,
- unsigned Size, bool KnownMustAlias) {
- assert(!Entry.second.hasAliasSet() && "Entry already in set!");
-
- // Check to see if we have to downgrade to _may_ alias.
- if (isMustAlias() && !KnownMustAlias)
- if (HashNodePair *P = getSomePointer()) {
- AliasAnalysis &AA = AST.getAliasAnalysis();
- AliasAnalysis::AliasResult Result =
- AA.alias(P->first, P->second.getSize(), Entry.first, Size);
- if (Result == AliasAnalysis::MayAlias)
- AliasTy = MayAlias;
- else // First entry of must alias must have maximum size!
- P->second.updateSize(Size);
- assert(Result != AliasAnalysis::NoAlias && "Cannot be part of must set!");
- }
-
- Entry.second.setAliasSet(this);
- Entry.second.updateSize(Size);
-
- // Add it to the end of the list...
- assert(*PtrListEnd == 0 && "End of list is not null?");
- *PtrListEnd = &Entry;
- PtrListEnd = Entry.second.setPrevInList(PtrListEnd);
- assert(*PtrListEnd == 0 && "End of list is not null?");
- addRef(); // Entry points to alias set...
-}
-
-void AliasSet::addCallSite(CallSite CS, AliasAnalysis &AA) {
- CallSites.push_back(CS);
-
- AliasAnalysis::ModRefBehavior Behavior = AA.getModRefBehavior(CS);
- if (Behavior == AliasAnalysis::DoesNotAccessMemory)
- return;
- else if (Behavior == AliasAnalysis::OnlyReadsMemory) {
- AliasTy = MayAlias;
- AccessTy |= Refs;
- return;
- }
-
- // FIXME: This should use mod/ref information to make this not suck so bad
- AliasTy = MayAlias;
- AccessTy = ModRef;
-}
-
-/// aliasesPointer - Return true if the specified pointer "may" (or must)
-/// alias one of the members in the set.
-///
-bool AliasSet::aliasesPointer(const Value *Ptr, unsigned Size,
- AliasAnalysis &AA) const {
- if (AliasTy == MustAlias) {
- assert(CallSites.empty() && "Illegal must alias set!");
-
- // If this is a set of MustAliases, only check to see if the pointer aliases
- // SOME value in the set...
- HashNodePair *SomePtr = getSomePointer();
- assert(SomePtr && "Empty must-alias set??");
- return AA.alias(SomePtr->first, SomePtr->second.getSize(), Ptr, Size);
- }
-
- // If this is a may-alias set, we have to check all of the pointers in the set
- // to be sure it doesn't alias the set...
- for (iterator I = begin(), E = end(); I != E; ++I)
- if (AA.alias(Ptr, Size, I.getPointer(), I.getSize()))
- return true;
-
- // Check the call sites list and invoke list...
- if (!CallSites.empty()) {
- if (AA.hasNoModRefInfoForCalls())
- return true;
-
- for (unsigned i = 0, e = CallSites.size(); i != e; ++i)
- if (AA.getModRefInfo(CallSites[i], const_cast<Value*>(Ptr), Size)
- != AliasAnalysis::NoModRef)
- return true;
- }
-
- return false;
-}
-
-bool AliasSet::aliasesCallSite(CallSite CS, AliasAnalysis &AA) const {
- if (AA.doesNotAccessMemory(CS))
- return false;
-
- if (AA.hasNoModRefInfoForCalls())
- return true;
-
- for (unsigned i = 0, e = CallSites.size(); i != e; ++i)
- if (AA.getModRefInfo(CallSites[i], CS) != AliasAnalysis::NoModRef ||
- AA.getModRefInfo(CS, CallSites[i]) != AliasAnalysis::NoModRef)
- return true;
-
- for (iterator I = begin(), E = end(); I != E; ++I)
- if (AA.getModRefInfo(CS, I.getPointer(), I.getSize()) !=
- AliasAnalysis::NoModRef)
- return true;
-
- return false;
-}
-
-
-/// findAliasSetForPointer - Given a pointer, find the one alias set to put the
-/// instruction referring to the pointer into. If there are multiple alias sets
-/// that may alias the pointer, merge them together and return the unified set.
-///
-AliasSet *AliasSetTracker::findAliasSetForPointer(const Value *Ptr,
- unsigned Size) {
- AliasSet *FoundSet = 0;
- for (iterator I = begin(), E = end(); I != E; ++I)
- if (!I->Forward && I->aliasesPointer(Ptr, Size, AA)) {
- if (FoundSet == 0) { // If this is the first alias set ptr can go into.
- FoundSet = I; // Remember it.
- } else { // Otherwise, we must merge the sets.
- FoundSet->mergeSetIn(*I, *this); // Merge in contents.
- }
- }
-
- return FoundSet;
-}
-
-/// containsPointer - Return true if the specified location is represented by
-/// this alias set, false otherwise. This does not modify the AST object or
-/// alias sets.
-bool AliasSetTracker::containsPointer(Value *Ptr, unsigned Size) const {
- for (const_iterator I = begin(), E = end(); I != E; ++I)
- if (!I->Forward && I->aliasesPointer(Ptr, Size, AA))
- return true;
- return false;
-}
-
-
-
-AliasSet *AliasSetTracker::findAliasSetForCallSite(CallSite CS) {
- AliasSet *FoundSet = 0;
- for (iterator I = begin(), E = end(); I != E; ++I)
- if (!I->Forward && I->aliasesCallSite(CS, AA)) {
- if (FoundSet == 0) { // If this is the first alias set ptr can go into.
- FoundSet = I; // Remember it.
- } else if (!I->Forward) { // Otherwise, we must merge the sets.
- FoundSet->mergeSetIn(*I, *this); // Merge in contents.
- }
- }
-
- return FoundSet;
-}
-
-
-
-
-/// getAliasSetForPointer - Return the alias set that the specified pointer
-/// lives in...
-AliasSet &AliasSetTracker::getAliasSetForPointer(Value *Pointer, unsigned Size,
- bool *New) {
- AliasSet::HashNodePair &Entry = getEntryFor(Pointer);
-
- // Check to see if the pointer is already known...
- if (Entry.second.hasAliasSet()) {
- Entry.second.updateSize(Size);
- // Return the set!
- return *Entry.second.getAliasSet(*this)->getForwardedTarget(*this);
- } else if (AliasSet *AS = findAliasSetForPointer(Pointer, Size)) {
- // Add it to the alias set it aliases...
- AS->addPointer(*this, Entry, Size);
- return *AS;
- } else {
- if (New) *New = true;
- // Otherwise create a new alias set to hold the loaded pointer...
- AliasSets.push_back(new AliasSet());
- AliasSets.back().addPointer(*this, Entry, Size);
- return AliasSets.back();
- }
-}
-
-bool AliasSetTracker::add(Value *Ptr, unsigned Size) {
- bool NewPtr;
- addPointer(Ptr, Size, AliasSet::NoModRef, NewPtr);
- return NewPtr;
-}
-
-
-bool AliasSetTracker::add(LoadInst *LI) {
- bool NewPtr;
- AliasSet &AS = addPointer(LI->getOperand(0),
- AA.getTargetData().getTypeStoreSize(LI->getType()),
- AliasSet::Refs, NewPtr);
- if (LI->isVolatile()) AS.setVolatile();
- return NewPtr;
-}
-
-bool AliasSetTracker::add(StoreInst *SI) {
- bool NewPtr;
- Value *Val = SI->getOperand(0);
- AliasSet &AS = addPointer(SI->getOperand(1),
- AA.getTargetData().getTypeStoreSize(Val->getType()),
- AliasSet::Mods, NewPtr);
- if (SI->isVolatile()) AS.setVolatile();
- return NewPtr;
-}
-
-bool AliasSetTracker::add(FreeInst *FI) {
- bool NewPtr;
- AliasSet &AS = addPointer(FI->getOperand(0), ~0,
- AliasSet::Mods, NewPtr);
-
- // Free operations are volatile ops (cannot be moved).
- AS.setVolatile();
- return NewPtr;
-}
-
-bool AliasSetTracker::add(VAArgInst *VAAI) {
- bool NewPtr;
- addPointer(VAAI->getOperand(0), ~0, AliasSet::ModRef, NewPtr);
- return NewPtr;
-}
-
-
-bool AliasSetTracker::add(CallSite CS) {
- if (AA.doesNotAccessMemory(CS))
- return true; // doesn't alias anything
-
- AliasSet *AS = findAliasSetForCallSite(CS);
- if (!AS) {
- AliasSets.push_back(new AliasSet());
- AS = &AliasSets.back();
- AS->addCallSite(CS, AA);
- return true;
- } else {
- AS->addCallSite(CS, AA);
- return false;
- }
-}
-
-bool AliasSetTracker::add(Instruction *I) {
- // Dispatch to one of the other add methods...
- if (LoadInst *LI = dyn_cast<LoadInst>(I))
- return add(LI);
- else if (StoreInst *SI = dyn_cast<StoreInst>(I))
- return add(SI);
- else if (CallInst *CI = dyn_cast<CallInst>(I))
- return add(CI);
- else if (InvokeInst *II = dyn_cast<InvokeInst>(I))
- return add(II);
- else if (FreeInst *FI = dyn_cast<FreeInst>(I))
- return add(FI);
- else if (VAArgInst *VAAI = dyn_cast<VAArgInst>(I))
- return add(VAAI);
- return true;
-}
-
-void AliasSetTracker::add(BasicBlock &BB) {
- for (BasicBlock::iterator I = BB.begin(), E = BB.end(); I != E; ++I)
- add(I);
-}
-
-void AliasSetTracker::add(const AliasSetTracker &AST) {
- assert(&AA == &AST.AA &&
- "Merging AliasSetTracker objects with different Alias Analyses!");
-
- // Loop over all of the alias sets in AST, adding the pointers contained
- // therein into the current alias sets. This can cause alias sets to be
- // merged together in the current AST.
- for (const_iterator I = AST.begin(), E = AST.end(); I != E; ++I)
- if (!I->Forward) { // Ignore forwarding alias sets
- AliasSet &AS = const_cast<AliasSet&>(*I);
-
- // If there are any call sites in the alias set, add them to this AST.
- for (unsigned i = 0, e = AS.CallSites.size(); i != e; ++i)
- add(AS.CallSites[i]);
-
- // Loop over all of the pointers in this alias set...
- AliasSet::iterator I = AS.begin(), E = AS.end();
- bool X;
- for (; I != E; ++I) {
- AliasSet &NewAS = addPointer(I.getPointer(), I.getSize(),
- (AliasSet::AccessType)AS.AccessTy, X);
- if (AS.isVolatile()) NewAS.setVolatile();
- }
- }
-}
-
-/// remove - Remove the specified (potentially non-empty) alias set from the
-/// tracker.
-void AliasSetTracker::remove(AliasSet &AS) {
- // Drop all call sites.
- AS.CallSites.clear();
-
- // Clear the alias set.
- unsigned NumRefs = 0;
- while (!AS.empty()) {
- AliasSet::HashNodePair *P = AS.PtrList;
-
- // Unlink from the list of values.
- P->second.removeFromList();
-
- // Remember how many references need to be dropped.
- ++NumRefs;
-
- // Finally, remove the entry.
- Value *Remove = P->first; // Take a copy because it is invalid to pass
- PointerMap.erase(Remove); // a reference to the data being erased.
- }
-
- // Stop using the alias set, removing it.
- AS.RefCount -= NumRefs;
- if (AS.RefCount == 0)
- AS.removeFromTracker(*this);
-}
-
-bool AliasSetTracker::remove(Value *Ptr, unsigned Size) {
- AliasSet *AS = findAliasSetForPointer(Ptr, Size);
- if (!AS) return false;
- remove(*AS);
- return true;
-}
-
-bool AliasSetTracker::remove(LoadInst *LI) {
- unsigned Size = AA.getTargetData().getTypeStoreSize(LI->getType());
- AliasSet *AS = findAliasSetForPointer(LI->getOperand(0), Size);
- if (!AS) return false;
- remove(*AS);
- return true;
-}
-
-bool AliasSetTracker::remove(StoreInst *SI) {
- unsigned Size =
- AA.getTargetData().getTypeStoreSize(SI->getOperand(0)->getType());
- AliasSet *AS = findAliasSetForPointer(SI->getOperand(1), Size);
- if (!AS) return false;
- remove(*AS);
- return true;
-}
-
-bool AliasSetTracker::remove(FreeInst *FI) {
- AliasSet *AS = findAliasSetForPointer(FI->getOperand(0), ~0);
- if (!AS) return false;
- remove(*AS);
- return true;
-}
-
-bool AliasSetTracker::remove(VAArgInst *VAAI) {
- AliasSet *AS = findAliasSetForPointer(VAAI->getOperand(0), ~0);
- if (!AS) return false;
- remove(*AS);
- return true;
-}
-
-bool AliasSetTracker::remove(CallSite CS) {
- if (AA.doesNotAccessMemory(CS))
- return false; // doesn't alias anything
-
- AliasSet *AS = findAliasSetForCallSite(CS);
- if (!AS) return false;
- remove(*AS);
- return true;
-}
-
-bool AliasSetTracker::remove(Instruction *I) {
- // Dispatch to one of the other remove methods...
- if (LoadInst *LI = dyn_cast<LoadInst>(I))
- return remove(LI);
- else if (StoreInst *SI = dyn_cast<StoreInst>(I))
- return remove(SI);
- else if (CallInst *CI = dyn_cast<CallInst>(I))
- return remove(CI);
- else if (FreeInst *FI = dyn_cast<FreeInst>(I))
- return remove(FI);
- else if (VAArgInst *VAAI = dyn_cast<VAArgInst>(I))
- return remove(VAAI);
- return true;
-}
-
-
-// deleteValue method - This method is used to remove a pointer value from the
-// AliasSetTracker entirely. It should be used when an instruction is deleted
-// from the program to update the AST. If you don't use this, you would have
-// dangling pointers to deleted instructions.
-//
-void AliasSetTracker::deleteValue(Value *PtrVal) {
- // Notify the alias analysis implementation that this value is gone.
- AA.deleteValue(PtrVal);
-
- // If this is a call instruction, remove the callsite from the appropriate
- // AliasSet.
- CallSite CS = CallSite::get(PtrVal);
- if (CS.getInstruction())
- if (!AA.doesNotAccessMemory(CS))
- if (AliasSet *AS = findAliasSetForCallSite(CS))
- AS->removeCallSite(CS);
-
- // First, look up the PointerRec for this pointer.
- hash_map<Value*, AliasSet::PointerRec>::iterator I = PointerMap.find(PtrVal);
- if (I == PointerMap.end()) return; // Noop
-
- // If we found one, remove the pointer from the alias set it is in.
- AliasSet::HashNodePair &PtrValEnt = *I;
- AliasSet *AS = PtrValEnt.second.getAliasSet(*this);
-
- // Unlink from the list of values...
- PtrValEnt.second.removeFromList();
- // Stop using the alias set
- AS->dropRef(*this);
- PointerMap.erase(I);
-}
-
-// copyValue - This method should be used whenever a preexisting value in the
-// program is copied or cloned, introducing a new value. Note that it is ok for
-// clients that use this method to introduce the same value multiple times: if
-// the tracker already knows about a value, it will ignore the request.
-//
-void AliasSetTracker::copyValue(Value *From, Value *To) {
- // Notify the alias analysis implementation that this value is copied.
- AA.copyValue(From, To);
-
- // First, look up the PointerRec for this pointer.
- hash_map<Value*, AliasSet::PointerRec>::iterator I = PointerMap.find(From);
- if (I == PointerMap.end() || !I->second.hasAliasSet())
- return; // Noop
-
- AliasSet::HashNodePair &Entry = getEntryFor(To);
- if (Entry.second.hasAliasSet()) return; // Already in the tracker!
-
- // Add it to the alias set it aliases...
- AliasSet *AS = I->second.getAliasSet(*this);
- AS->addPointer(*this, Entry, I->second.getSize(), true);
-}
-
-
-
-//===----------------------------------------------------------------------===//
-// AliasSet/AliasSetTracker Printing Support
-//===----------------------------------------------------------------------===//
-
-void AliasSet::print(std::ostream &OS) const {
- OS << " AliasSet[" << (void*)this << "," << RefCount << "] ";
- OS << (AliasTy == MustAlias ? "must" : "may") << " alias, ";
- switch (AccessTy) {
- case NoModRef: OS << "No access "; break;
- case Refs : OS << "Ref "; break;
- case Mods : OS << "Mod "; break;
- case ModRef : OS << "Mod/Ref "; break;
- default: assert(0 && "Bad value for AccessTy!");
- }
- if (isVolatile()) OS << "[volatile] ";
- if (Forward)
- OS << " forwarding to " << (void*)Forward;
-
-
- if (!empty()) {
- OS << "Pointers: ";
- for (iterator I = begin(), E = end(); I != E; ++I) {
- if (I != begin()) OS << ", ";
- WriteAsOperand(OS << "(", I.getPointer());
- OS << ", " << I.getSize() << ")";
- }
- }
- if (!CallSites.empty()) {
- OS << "\n " << CallSites.size() << " Call Sites: ";
- for (unsigned i = 0, e = CallSites.size(); i != e; ++i) {
- if (i) OS << ", ";
- WriteAsOperand(OS, CallSites[i].getCalledValue());
- }
- }
- OS << "\n";
-}
-
-void AliasSetTracker::print(std::ostream &OS) const {
- OS << "Alias Set Tracker: " << AliasSets.size() << " alias sets for "
- << PointerMap.size() << " pointer values.\n";
- for (const_iterator I = begin(), E = end(); I != E; ++I)
- I->print(OS);
- OS << "\n";
-}
-
-void AliasSet::dump() const { print (cerr); }
-void AliasSetTracker::dump() const { print(cerr); }
-
-//===----------------------------------------------------------------------===//
-// AliasSetPrinter Pass
-//===----------------------------------------------------------------------===//
-
-namespace {
- class VISIBILITY_HIDDEN AliasSetPrinter : public FunctionPass {
- AliasSetTracker *Tracker;
- public:
- static char ID; // Pass identification, replacement for typeid
- AliasSetPrinter() : FunctionPass((intptr_t)&ID) {}
-
- virtual void getAnalysisUsage(AnalysisUsage &AU) const {
- AU.setPreservesAll();
- AU.addRequired<AliasAnalysis>();
- }
-
- virtual bool runOnFunction(Function &F) {
- Tracker = new AliasSetTracker(getAnalysis<AliasAnalysis>());
-
- for (inst_iterator I = inst_begin(F), E = inst_end(F); I != E; ++I)
- Tracker->add(&*I);
- Tracker->print(cerr);
- delete Tracker;
- return false;
- }
- };
- char AliasSetPrinter::ID = 0;
- RegisterPass<AliasSetPrinter> X("print-alias-sets", "Alias Set Printer", false, true);
-}
diff --git a/release_23/lib/Analysis/Analysis.cpp b/release_23/lib/Analysis/Analysis.cpp
deleted file mode 100644
index 493c6e88b3f8..000000000000
--- a/release_23/lib/Analysis/Analysis.cpp
+++ /dev/null
@@ -1,44 +0,0 @@
-//===-- Analysis.cpp ------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm-c/Analysis.h"
-#include "llvm/Analysis/Verifier.h"
-#include <fstream>
-#include <cstring>
-
-using namespace llvm;
-
-int LLVMVerifyModule(LLVMModuleRef M, LLVMVerifierFailureAction Action,
- char **OutMessages) {
- std::string Messages;
-
- int Result = verifyModule(*unwrap(M),
- static_cast<VerifierFailureAction>(Action),
- OutMessages? &Messages : 0);
-
- if (OutMessages)
- *OutMessages = strdup(Messages.c_str());
-
- return Result;
-}
-
-int LLVMVerifyFunction(LLVMValueRef Fn, LLVMVerifierFailureAction Action) {
- return verifyFunction(*unwrap<Function>(Fn),
- static_cast<VerifierFailureAction>(Action));
-}
-
-void LLVMViewFunctionCFG(LLVMValueRef Fn) {
- Function *F = unwrap<Function>(Fn);
- F->viewCFG();
-}
-
-void LLVMViewFunctionCFGOnly(LLVMValueRef Fn) {
- Function *F = unwrap<Function>(Fn);
- F->viewCFGOnly();
-}
diff --git a/release_23/lib/Analysis/BasicAliasAnalysis.cpp b/release_23/lib/Analysis/BasicAliasAnalysis.cpp
deleted file mode 100644
index 97dd56aa0319..000000000000
--- a/release_23/lib/Analysis/BasicAliasAnalysis.cpp
+++ /dev/null
@@ -1,833 +0,0 @@
-//===- BasicAliasAnalysis.cpp - Local Alias Analysis Impl -----------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines the default implementation of the Alias Analysis interface
-// that simply implements a few identities (two different globals cannot alias,
-// etc), but otherwise does no analysis.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Analysis/AliasAnalysis.h"
-#include "llvm/Analysis/Passes.h"
-#include "llvm/Constants.h"
-#include "llvm/DerivedTypes.h"
-#include "llvm/Function.h"
-#include "llvm/ParameterAttributes.h"
-#include "llvm/GlobalVariable.h"
-#include "llvm/Instructions.h"
-#include "llvm/IntrinsicInst.h"
-#include "llvm/Pass.h"
-#include "llvm/Target/TargetData.h"
-#include "llvm/ADT/SmallVector.h"
-#include "llvm/ADT/STLExtras.h"
-#include "llvm/Support/Compiler.h"
-#include "llvm/Support/GetElementPtrTypeIterator.h"
-#include "llvm/Support/ManagedStatic.h"
-#include <algorithm>
-using namespace llvm;
-
-namespace {
- /// NoAA - This class implements the -no-aa pass, which always returns "I
- /// don't know" for alias queries. NoAA is unlike other alias analysis
- /// implementations, in that it does not chain to a previous analysis. As
- /// such it doesn't follow many of the rules that other alias analyses must.
- ///
- struct VISIBILITY_HIDDEN NoAA : public ImmutablePass, public AliasAnalysis {
- static char ID; // Class identification, replacement for typeinfo
- NoAA() : ImmutablePass((intptr_t)&ID) {}
- explicit NoAA(intptr_t PID) : ImmutablePass(PID) { }
-
- virtual void getAnalysisUsage(AnalysisUsage &AU) const {
- AU.addRequired<TargetData>();
- }
-
- virtual void initializePass() {
- TD = &getAnalysis<TargetData>();
- }
-
- virtual AliasResult alias(const Value *V1, unsigned V1Size,
- const Value *V2, unsigned V2Size) {
- return MayAlias;
- }
-
- virtual ModRefBehavior getModRefBehavior(Function *F, CallSite CS,
- std::vector<PointerAccessInfo> *Info) {
- return UnknownModRefBehavior;
- }
-
- virtual void getArgumentAccesses(Function *F, CallSite CS,
- std::vector<PointerAccessInfo> &Info) {
- assert(0 && "This method may not be called on this function!");
- }
-
- virtual void getMustAliases(Value *P, std::vector<Value*> &RetVals) { }
- virtual bool pointsToConstantMemory(const Value *P) { return false; }
- virtual ModRefResult getModRefInfo(CallSite CS, Value *P, unsigned Size) {
- return ModRef;
- }
- virtual ModRefResult getModRefInfo(CallSite CS1, CallSite CS2) {
- return ModRef;
- }
- virtual bool hasNoModRefInfoForCalls() const { return true; }
-
- virtual void deleteValue(Value *V) {}
- virtual void copyValue(Value *From, Value *To) {}
- };
-
- // Register this pass...
- char NoAA::ID = 0;
- RegisterPass<NoAA>
- U("no-aa", "No Alias Analysis (always returns 'may' alias)", true, true);
-
- // Declare that we implement the AliasAnalysis interface
- RegisterAnalysisGroup<AliasAnalysis> V(U);
-} // End of anonymous namespace
-
-ImmutablePass *llvm::createNoAAPass() { return new NoAA(); }
-
-namespace {
- /// BasicAliasAnalysis - This is the default alias analysis implementation.
- /// Because it doesn't chain to a previous alias analysis (like -no-aa), it
- /// derives from the NoAA class.
- struct VISIBILITY_HIDDEN BasicAliasAnalysis : public NoAA {
- static char ID; // Class identification, replacement for typeinfo
- BasicAliasAnalysis() : NoAA((intptr_t)&ID) { }
- AliasResult alias(const Value *V1, unsigned V1Size,
- const Value *V2, unsigned V2Size);
-
- ModRefResult getModRefInfo(CallSite CS, Value *P, unsigned Size);
- ModRefResult getModRefInfo(CallSite CS1, CallSite CS2) {
- return NoAA::getModRefInfo(CS1,CS2);
- }
-
- /// hasNoModRefInfoForCalls - We can provide mod/ref information against
- /// non-escaping allocations.
- virtual bool hasNoModRefInfoForCalls() const { return false; }
-
- /// pointsToConstantMemory - Chase pointers until we find a (constant
- /// global) or not.
- bool pointsToConstantMemory(const Value *P);
-
- private:
- // CheckGEPInstructions - Check two GEP instructions with known
- // must-aliasing base pointers. This checks to see if the index expressions
- // preclude the pointers from aliasing...
- AliasResult
- CheckGEPInstructions(const Type* BasePtr1Ty,
- Value **GEP1Ops, unsigned NumGEP1Ops, unsigned G1Size,
- const Type *BasePtr2Ty,
- Value **GEP2Ops, unsigned NumGEP2Ops, unsigned G2Size);
- };
-
- // Register this pass...
- char BasicAliasAnalysis::ID = 0;
- RegisterPass<BasicAliasAnalysis>
- X("basicaa", "Basic Alias Analysis (default AA impl)", false, true);
-
- // Declare that we implement the AliasAnalysis interface
- RegisterAnalysisGroup<AliasAnalysis, true> Y(X);
-} // End of anonymous namespace
-
-ImmutablePass *llvm::createBasicAliasAnalysisPass() {
- return new BasicAliasAnalysis();
-}
-
-/// getUnderlyingObject - This traverses the use chain to figure out what object
-/// the specified value points to. If the value points to, or is derived from,
-/// a unique object or an argument, return it. This returns:
-/// Arguments, GlobalVariables, Functions, Allocas, Mallocs.
-static const Value *getUnderlyingObject(const Value *V) {
- if (!isa<PointerType>(V->getType())) return 0;
-
- // If we are at some type of object, return it. GlobalValues and Allocations
- // have unique addresses.
- if (isa<GlobalValue>(V) || isa<AllocationInst>(V) || isa<Argument>(V))
- return V;
-
- // Traverse through different addressing mechanisms...
- if (const Instruction *I = dyn_cast<Instruction>(V)) {
- if (isa<BitCastInst>(I) || isa<GetElementPtrInst>(I))
- return getUnderlyingObject(I->getOperand(0));
- } else if (const ConstantExpr *CE = dyn_cast<ConstantExpr>(V)) {
- if (CE->getOpcode() == Instruction::BitCast ||
- CE->getOpcode() == Instruction::GetElementPtr)
- return getUnderlyingObject(CE->getOperand(0));
- }
- return 0;
-}
-
-static const User *isGEP(const Value *V) {
- if (isa<GetElementPtrInst>(V) ||
- (isa<ConstantExpr>(V) &&
- cast<ConstantExpr>(V)->getOpcode() == Instruction::GetElementPtr))
- return cast<User>(V);
- return 0;
-}
-
-static const Value *GetGEPOperands(const Value *V,
- SmallVector<Value*, 16> &GEPOps){
- assert(GEPOps.empty() && "Expect empty list to populate!");
- GEPOps.insert(GEPOps.end(), cast<User>(V)->op_begin()+1,
- cast<User>(V)->op_end());
-
- // Accumulate all of the chained indexes into the operand array
- V = cast<User>(V)->getOperand(0);
-
- while (const User *G = isGEP(V)) {
- if (!isa<Constant>(GEPOps[0]) || isa<GlobalValue>(GEPOps[0]) ||
- !cast<Constant>(GEPOps[0])->isNullValue())
- break; // Don't handle folding arbitrary pointer offsets yet...
- GEPOps.erase(GEPOps.begin()); // Drop the zero index
- GEPOps.insert(GEPOps.begin(), G->op_begin()+1, G->op_end());
- V = G->getOperand(0);
- }
- return V;
-}
-
-/// pointsToConstantMemory - Chase pointers until we find a (constant
-/// global) or not.
-bool BasicAliasAnalysis::pointsToConstantMemory(const Value *P) {
- if (const Value *V = getUnderlyingObject(P))
- if (const GlobalVariable *GV = dyn_cast<GlobalVariable>(V))
- return GV->isConstant();
- return false;
-}
-
-// Determine if an AllocationInst instruction escapes from the function it is
-// contained in. If it does not escape, there is no way for another function to
-// mod/ref it. We do this by looking at its uses and determining if the uses
-// can escape (recursively).
-static bool AddressMightEscape(const Value *V) {
- for (Value::use_const_iterator UI = V->use_begin(), E = V->use_end();
- UI != E; ++UI) {
- const Instruction *I = cast<Instruction>(*UI);
- switch (I->getOpcode()) {
- case Instruction::Load:
- break; //next use.
- case Instruction::Store:
- if (I->getOperand(0) == V)
- return true; // Escapes if the pointer is stored.
- break; // next use.
- case Instruction::GetElementPtr:
- if (AddressMightEscape(I))
- return true;
- break; // next use.
- case Instruction::BitCast:
- if (AddressMightEscape(I))
- return true;
- break; // next use
- case Instruction::Ret:
- // If returned, the address will escape to calling functions, but no
- // callees could modify it.
- break; // next use
- case Instruction::Call:
- // If the call is to a few known safe intrinsics, we know that it does
- // not escape
- if (!isa<MemIntrinsic>(I))
- return true;
- break; // next use
- default:
- return true;
- }
- }
- return false;
-}
-
-// getModRefInfo - Check to see if the specified callsite can clobber the
-// specified memory object. Since we only look at local properties of this
-// function, we really can't say much about this query. We do, however, use
-// simple "address taken" analysis on local objects.
-//
-AliasAnalysis::ModRefResult
-BasicAliasAnalysis::getModRefInfo(CallSite CS, Value *P, unsigned Size) {
- if (!isa<Constant>(P)) {
- const Value *Object = getUnderlyingObject(P);
- // Allocations and byval arguments are "new" objects.
- if (Object &&
- (isa<AllocationInst>(Object) || isa<Argument>(Object))) {
- // Okay, the pointer is to a stack allocated (or effectively so, for
- // for noalias parameters) object. If the address of this object doesn't
- // escape from this function body to a callee, then we know that no
- // callees can mod/ref it unless they are actually passed it.
- if (isa<AllocationInst>(Object) ||
- cast<Argument>(Object)->hasByValAttr() ||
- cast<Argument>(Object)->hasNoAliasAttr())
- if (!AddressMightEscape(Object)) {
- bool passedAsArg = false;
- for (CallSite::arg_iterator CI = CS.arg_begin(), CE = CS.arg_end();
- CI != CE; ++CI)
- if (isa<PointerType>((*CI)->getType()) &&
- ( getUnderlyingObject(*CI) == P ||
- alias(cast<Value>(CI), ~0U, P, ~0U) != NoAlias) )
- passedAsArg = true;
-
- if (!passedAsArg)
- return NoModRef;
- }
-
- // If this is a tail call and P points to a stack location, we know that
- // the tail call cannot access or modify the local stack.
- // We cannot exclude byval arguments here; these belong to the caller of
- // the current function not to the current function, and a tail callee
- // may reference them.
- if (isa<AllocaInst>(Object))
- if (CallInst *CI = dyn_cast<CallInst>(CS.getInstruction()))
- if (CI->isTailCall())
- return NoModRef;
- }
- }
-
- // The AliasAnalysis base class has some smarts, lets use them.
- return AliasAnalysis::getModRefInfo(CS, P, Size);
-}
-
-// alias - Provide a bunch of ad-hoc rules to disambiguate in common cases, such
-// as array references. Note that this function is heavily tail recursive.
-// Hopefully we have a smart C++ compiler. :)
-//
-AliasAnalysis::AliasResult
-BasicAliasAnalysis::alias(const Value *V1, unsigned V1Size,
- const Value *V2, unsigned V2Size) {
- // Strip off any constant expression casts if they exist
- if (const ConstantExpr *CE = dyn_cast<ConstantExpr>(V1))
- if (CE->isCast() && isa<PointerType>(CE->getOperand(0)->getType()))
- V1 = CE->getOperand(0);
- if (const ConstantExpr *CE = dyn_cast<ConstantExpr>(V2))
- if (CE->isCast() && isa<PointerType>(CE->getOperand(0)->getType()))
- V2 = CE->getOperand(0);
-
- // Are we checking for alias of the same value?
- if (V1 == V2) return MustAlias;
-
- if ((!isa<PointerType>(V1->getType()) || !isa<PointerType>(V2->getType())) &&
- V1->getType() != Type::Int64Ty && V2->getType() != Type::Int64Ty)
- return NoAlias; // Scalars cannot alias each other
-
- // Strip off cast instructions...
- if (const BitCastInst *I = dyn_cast<BitCastInst>(V1))
- return alias(I->getOperand(0), V1Size, V2, V2Size);
- if (const BitCastInst *I = dyn_cast<BitCastInst>(V2))
- return alias(V1, V1Size, I->getOperand(0), V2Size);
-
- // Figure out what objects these things are pointing to if we can...
- const Value *O1 = getUnderlyingObject(V1);
- const Value *O2 = getUnderlyingObject(V2);
-
- // Pointing at a discernible object?
- if (O1) {
- if (O2) {
- if (const Argument *O1Arg = dyn_cast<Argument>(O1)) {
- // Incoming argument cannot alias locally allocated object!
- if (isa<AllocationInst>(O2)) return NoAlias;
-
- // If they are two different objects, and one is a noalias argument
- // then they do not alias.
- if (O1 != O2 && O1Arg->hasNoAliasAttr())
- return NoAlias;
-
- // Byval arguments can't alias globals or other arguments.
- if (O1 != O2 && O1Arg->hasByValAttr()) return NoAlias;
-
- // Otherwise, nothing is known...
- }
-
- if (const Argument *O2Arg = dyn_cast<Argument>(O2)) {
- // Incoming argument cannot alias locally allocated object!
- if (isa<AllocationInst>(O1)) return NoAlias;
-
- // If they are two different objects, and one is a noalias argument
- // then they do not alias.
- if (O1 != O2 && O2Arg->hasNoAliasAttr())
- return NoAlias;
-
- // Byval arguments can't alias globals or other arguments.
- if (O1 != O2 && O2Arg->hasByValAttr()) return NoAlias;
-
- // Otherwise, nothing is known...
-
- } else if (O1 != O2 && !isa<Argument>(O1)) {
- // If they are two different objects, and neither is an argument,
- // we know that we have no alias.
- return NoAlias;
- }
-
- // If they are the same object, they we can look at the indexes. If they
- // index off of the object is the same for both pointers, they must alias.
- // If they are provably different, they must not alias. Otherwise, we
- // can't tell anything.
- }
-
- // Unique values don't alias null, except non-byval arguments.
- if (isa<ConstantPointerNull>(V2)) {
- if (const Argument *O1Arg = dyn_cast<Argument>(O1)) {
- if (O1Arg->hasByValAttr())
- return NoAlias;
- } else {
- return NoAlias;
- }
- }
-
- if (isa<GlobalVariable>(O1) ||
- (isa<AllocationInst>(O1) &&
- !cast<AllocationInst>(O1)->isArrayAllocation()))
- if (cast<PointerType>(O1->getType())->getElementType()->isSized()) {
- // If the size of the other access is larger than the total size of the
- // global/alloca/malloc, it cannot be accessing the global (it's
- // undefined to load or store bytes before or after an object).
- const Type *ElTy = cast<PointerType>(O1->getType())->getElementType();
- unsigned GlobalSize = getTargetData().getABITypeSize(ElTy);
- if (GlobalSize < V2Size && V2Size != ~0U)
- return NoAlias;
- }
- }
-
- if (O2) {
- if (!isa<Argument>(O2) && isa<ConstantPointerNull>(V1))
- return NoAlias; // Unique values don't alias null
-
- if (isa<GlobalVariable>(O2) ||
- (isa<AllocationInst>(O2) &&
- !cast<AllocationInst>(O2)->isArrayAllocation()))
- if (cast<PointerType>(O2->getType())->getElementType()->isSized()) {
- // If the size of the other access is larger than the total size of the
- // global/alloca/malloc, it cannot be accessing the object (it's
- // undefined to load or store bytes before or after an object).
- const Type *ElTy = cast<PointerType>(O2->getType())->getElementType();
- unsigned GlobalSize = getTargetData().getABITypeSize(ElTy);
- if (GlobalSize < V1Size && V1Size != ~0U)
- return NoAlias;
- }
- }
-
- // If we have two gep instructions with must-alias'ing base pointers, figure
- // out if the indexes to the GEP tell us anything about the derived pointer.
- // Note that we also handle chains of getelementptr instructions as well as
- // constant expression getelementptrs here.
- //
- if (isGEP(V1) && isGEP(V2)) {
- // Drill down into the first non-gep value, to test for must-aliasing of
- // the base pointers.
- const User *G = cast<User>(V1);
- while (isGEP(G->getOperand(0)) &&
- G->getOperand(1) ==
- Constant::getNullValue(G->getOperand(1)->getType()))
- G = cast<User>(G->getOperand(0));
- const Value *BasePtr1 = G->getOperand(0);
-
- G = cast<User>(V2);
- while (isGEP(G->getOperand(0)) &&
- G->getOperand(1) ==
- Constant::getNullValue(G->getOperand(1)->getType()))
- G = cast<User>(G->getOperand(0));
- const Value *BasePtr2 = G->getOperand(0);
-
- // Do the base pointers alias?
- AliasResult BaseAlias = alias(BasePtr1, ~0U, BasePtr2, ~0U);
- if (BaseAlias == NoAlias) return NoAlias;
- if (BaseAlias == MustAlias) {
- // If the base pointers alias each other exactly, check to see if we can
- // figure out anything about the resultant pointers, to try to prove
- // non-aliasing.
-
- // Collect all of the chained GEP operands together into one simple place
- SmallVector<Value*, 16> GEP1Ops, GEP2Ops;
- BasePtr1 = GetGEPOperands(V1, GEP1Ops);
- BasePtr2 = GetGEPOperands(V2, GEP2Ops);
-
- // If GetGEPOperands were able to fold to the same must-aliased pointer,
- // do the comparison.
- if (BasePtr1 == BasePtr2) {
- AliasResult GAlias =
- CheckGEPInstructions(BasePtr1->getType(),
- &GEP1Ops[0], GEP1Ops.size(), V1Size,
- BasePtr2->getType(),
- &GEP2Ops[0], GEP2Ops.size(), V2Size);
- if (GAlias != MayAlias)
- return GAlias;
- }
- }
- }
-
- // Check to see if these two pointers are related by a getelementptr
- // instruction. If one pointer is a GEP with a non-zero index of the other
- // pointer, we know they cannot alias.
- //
- if (isGEP(V2)) {
- std::swap(V1, V2);
- std::swap(V1Size, V2Size);
- }
-
- if (V1Size != ~0U && V2Size != ~0U)
- if (isGEP(V1)) {
- SmallVector<Value*, 16> GEPOperands;
- const Value *BasePtr = GetGEPOperands(V1, GEPOperands);
-
- AliasResult R = alias(BasePtr, V1Size, V2, V2Size);
- if (R == MustAlias) {
- // If there is at least one non-zero constant index, we know they cannot
- // alias.
- bool ConstantFound = false;
- bool AllZerosFound = true;
- for (unsigned i = 0, e = GEPOperands.size(); i != e; ++i)
- if (const Constant *C = dyn_cast<Constant>(GEPOperands[i])) {
- if (!C->isNullValue()) {
- ConstantFound = true;
- AllZerosFound = false;
- break;
- }
- } else {
- AllZerosFound = false;
- }
-
- // If we have getelementptr <ptr>, 0, 0, 0, 0, ... and V2 must aliases
- // the ptr, the end result is a must alias also.
- if (AllZerosFound)
- return MustAlias;
-
- if (ConstantFound) {
- if (V2Size <= 1 && V1Size <= 1) // Just pointer check?
- return NoAlias;
-
- // Otherwise we have to check to see that the distance is more than
- // the size of the argument... build an index vector that is equal to
- // the arguments provided, except substitute 0's for any variable
- // indexes we find...
- if (cast<PointerType>(
- BasePtr->getType())->getElementType()->isSized()) {
- for (unsigned i = 0; i != GEPOperands.size(); ++i)
- if (!isa<ConstantInt>(GEPOperands[i]))
- GEPOperands[i] =
- Constant::getNullValue(GEPOperands[i]->getType());
- int64_t Offset =
- getTargetData().getIndexedOffset(BasePtr->getType(),
- &GEPOperands[0],
- GEPOperands.size());
-
- if (Offset >= (int64_t)V2Size || Offset <= -(int64_t)V1Size)
- return NoAlias;
- }
- }
- }
- }
-
- return MayAlias;
-}
-
-// This function is used to determin if the indices of two GEP instructions are
-// equal. V1 and V2 are the indices.
-static bool IndexOperandsEqual(Value *V1, Value *V2) {
- if (V1->getType() == V2->getType())
- return V1 == V2;
- if (Constant *C1 = dyn_cast<Constant>(V1))
- if (Constant *C2 = dyn_cast<Constant>(V2)) {
- // Sign extend the constants to long types, if necessary
- if (C1->getType() != Type::Int64Ty)
- C1 = ConstantExpr::getSExt(C1, Type::Int64Ty);
- if (C2->getType() != Type::Int64Ty)
- C2 = ConstantExpr::getSExt(C2, Type::Int64Ty);
- return C1 == C2;
- }
- return false;
-}
-
-/// CheckGEPInstructions - Check two GEP instructions with known must-aliasing
-/// base pointers. This checks to see if the index expressions preclude the
-/// pointers from aliasing...
-AliasAnalysis::AliasResult
-BasicAliasAnalysis::CheckGEPInstructions(
- const Type* BasePtr1Ty, Value **GEP1Ops, unsigned NumGEP1Ops, unsigned G1S,
- const Type *BasePtr2Ty, Value **GEP2Ops, unsigned NumGEP2Ops, unsigned G2S) {
- // We currently can't handle the case when the base pointers have different
- // primitive types. Since this is uncommon anyway, we are happy being
- // extremely conservative.
- if (BasePtr1Ty != BasePtr2Ty)
- return MayAlias;
-
- const PointerType *GEPPointerTy = cast<PointerType>(BasePtr1Ty);
-
- // Find the (possibly empty) initial sequence of equal values... which are not
- // necessarily constants.
- unsigned NumGEP1Operands = NumGEP1Ops, NumGEP2Operands = NumGEP2Ops;
- unsigned MinOperands = std::min(NumGEP1Operands, NumGEP2Operands);
- unsigned MaxOperands = std::max(NumGEP1Operands, NumGEP2Operands);
- unsigned UnequalOper = 0;
- while (UnequalOper != MinOperands &&
- IndexOperandsEqual(GEP1Ops[UnequalOper], GEP2Ops[UnequalOper])) {
- // Advance through the type as we go...
- ++UnequalOper;
- if (const CompositeType *CT = dyn_cast<CompositeType>(BasePtr1Ty))
- BasePtr1Ty = CT->getTypeAtIndex(GEP1Ops[UnequalOper-1]);
- else {
- // If all operands equal each other, then the derived pointers must
- // alias each other...
- BasePtr1Ty = 0;
- assert(UnequalOper == NumGEP1Operands && UnequalOper == NumGEP2Operands &&
- "Ran out of type nesting, but not out of operands?");
- return MustAlias;
- }
- }
-
- // If we have seen all constant operands, and run out of indexes on one of the
- // getelementptrs, check to see if the tail of the leftover one is all zeros.
- // If so, return mustalias.
- if (UnequalOper == MinOperands) {
- if (NumGEP1Ops < NumGEP2Ops) {
- std::swap(GEP1Ops, GEP2Ops);
- std::swap(NumGEP1Ops, NumGEP2Ops);
- }
-
- bool AllAreZeros = true;
- for (unsigned i = UnequalOper; i != MaxOperands; ++i)
- if (!isa<Constant>(GEP1Ops[i]) ||
- !cast<Constant>(GEP1Ops[i])->isNullValue()) {
- AllAreZeros = false;
- break;
- }
- if (AllAreZeros) return MustAlias;
- }
-
-
- // So now we know that the indexes derived from the base pointers,
- // which are known to alias, are different. We can still determine a
- // no-alias result if there are differing constant pairs in the index
- // chain. For example:
- // A[i][0] != A[j][1] iff (&A[0][1]-&A[0][0] >= std::max(G1S, G2S))
- //
- // We have to be careful here about array accesses. In particular, consider:
- // A[1][0] vs A[0][i]
- // In this case, we don't *know* that the array will be accessed in bounds:
- // the index could even be negative. Because of this, we have to
- // conservatively *give up* and return may alias. We disregard differing
- // array subscripts that are followed by a variable index without going
- // through a struct.
- //
- unsigned SizeMax = std::max(G1S, G2S);
- if (SizeMax == ~0U) return MayAlias; // Avoid frivolous work.
-
- // Scan for the first operand that is constant and unequal in the
- // two getelementptrs...
- unsigned FirstConstantOper = UnequalOper;
- for (; FirstConstantOper != MinOperands; ++FirstConstantOper) {
- const Value *G1Oper = GEP1Ops[FirstConstantOper];
- const Value *G2Oper = GEP2Ops[FirstConstantOper];
-
- if (G1Oper != G2Oper) // Found non-equal constant indexes...
- if (Constant *G1OC = dyn_cast<ConstantInt>(const_cast<Value*>(G1Oper)))
- if (Constant *G2OC = dyn_cast<ConstantInt>(const_cast<Value*>(G2Oper))){
- if (G1OC->getType() != G2OC->getType()) {
- // Sign extend both operands to long.
- if (G1OC->getType() != Type::Int64Ty)
- G1OC = ConstantExpr::getSExt(G1OC, Type::Int64Ty);
- if (G2OC->getType() != Type::Int64Ty)
- G2OC = ConstantExpr::getSExt(G2OC, Type::Int64Ty);
- GEP1Ops[FirstConstantOper] = G1OC;
- GEP2Ops[FirstConstantOper] = G2OC;
- }
-
- if (G1OC != G2OC) {
- // Handle the "be careful" case above: if this is an array/vector
- // subscript, scan for a subsequent variable array index.
- if (isa<SequentialType>(BasePtr1Ty)) {
- const Type *NextTy =
- cast<SequentialType>(BasePtr1Ty)->getElementType();
- bool isBadCase = false;
-
- for (unsigned Idx = FirstConstantOper+1;
- Idx != MinOperands && isa<SequentialType>(NextTy); ++Idx) {
- const Value *V1 = GEP1Ops[Idx], *V2 = GEP2Ops[Idx];
- if (!isa<Constant>(V1) || !isa<Constant>(V2)) {
- isBadCase = true;
- break;
- }
- NextTy = cast<SequentialType>(NextTy)->getElementType();
- }
-
- if (isBadCase) G1OC = 0;
- }
-
- // Make sure they are comparable (ie, not constant expressions), and
- // make sure the GEP with the smaller leading constant is GEP1.
- if (G1OC) {
- Constant *Compare = ConstantExpr::getICmp(ICmpInst::ICMP_SGT,
- G1OC, G2OC);
- if (ConstantInt *CV = dyn_cast<ConstantInt>(Compare)) {
- if (CV->getZExtValue()) { // If they are comparable and G2 > G1
- std::swap(GEP1Ops, GEP2Ops); // Make GEP1 < GEP2
- std::swap(NumGEP1Ops, NumGEP2Ops);
- }
- break;
- }
- }
- }
- }
- BasePtr1Ty = cast<CompositeType>(BasePtr1Ty)->getTypeAtIndex(G1Oper);
- }
-
- // No shared constant operands, and we ran out of common operands. At this
- // point, the GEP instructions have run through all of their operands, and we
- // haven't found evidence that there are any deltas between the GEP's.
- // However, one GEP may have more operands than the other. If this is the
- // case, there may still be hope. Check this now.
- if (FirstConstantOper == MinOperands) {
- // Make GEP1Ops be the longer one if there is a longer one.
- if (NumGEP1Ops < NumGEP2Ops) {
- std::swap(GEP1Ops, GEP2Ops);
- std::swap(NumGEP1Ops, NumGEP2Ops);
- }
-
- // Is there anything to check?
- if (NumGEP1Ops > MinOperands) {
- for (unsigned i = FirstConstantOper; i != MaxOperands; ++i)
- if (isa<ConstantInt>(GEP1Ops[i]) &&
- !cast<ConstantInt>(GEP1Ops[i])->isZero()) {
- // Yup, there's a constant in the tail. Set all variables to
- // constants in the GEP instruction to make it suiteable for
- // TargetData::getIndexedOffset.
- for (i = 0; i != MaxOperands; ++i)
- if (!isa<ConstantInt>(GEP1Ops[i]))
- GEP1Ops[i] = Constant::getNullValue(GEP1Ops[i]->getType());
- // Okay, now get the offset. This is the relative offset for the full
- // instruction.
- const TargetData &TD = getTargetData();
- int64_t Offset1 = TD.getIndexedOffset(GEPPointerTy, GEP1Ops,
- NumGEP1Ops);
-
- // Now check without any constants at the end.
- int64_t Offset2 = TD.getIndexedOffset(GEPPointerTy, GEP1Ops,
- MinOperands);
-
- // If the tail provided a bit enough offset, return noalias!
- if ((uint64_t)(Offset2-Offset1) >= SizeMax)
- return NoAlias;
- }
- }
-
- // Couldn't find anything useful.
- return MayAlias;
- }
-
- // If there are non-equal constants arguments, then we can figure
- // out a minimum known delta between the two index expressions... at
- // this point we know that the first constant index of GEP1 is less
- // than the first constant index of GEP2.
-
- // Advance BasePtr[12]Ty over this first differing constant operand.
- BasePtr2Ty = cast<CompositeType>(BasePtr1Ty)->
- getTypeAtIndex(GEP2Ops[FirstConstantOper]);
- BasePtr1Ty = cast<CompositeType>(BasePtr1Ty)->
- getTypeAtIndex(GEP1Ops[FirstConstantOper]);
-
- // We are going to be using TargetData::getIndexedOffset to determine the
- // offset that each of the GEP's is reaching. To do this, we have to convert
- // all variable references to constant references. To do this, we convert the
- // initial sequence of array subscripts into constant zeros to start with.
- const Type *ZeroIdxTy = GEPPointerTy;
- for (unsigned i = 0; i != FirstConstantOper; ++i) {
- if (!isa<StructType>(ZeroIdxTy))
- GEP1Ops[i] = GEP2Ops[i] = Constant::getNullValue(Type::Int32Ty);
-
- if (const CompositeType *CT = dyn_cast<CompositeType>(ZeroIdxTy))
- ZeroIdxTy = CT->getTypeAtIndex(GEP1Ops[i]);
- }
-
- // We know that GEP1Ops[FirstConstantOper] & GEP2Ops[FirstConstantOper] are ok
-
- // Loop over the rest of the operands...
- for (unsigned i = FirstConstantOper+1; i != MaxOperands; ++i) {
- const Value *Op1 = i < NumGEP1Ops ? GEP1Ops[i] : 0;
- const Value *Op2 = i < NumGEP2Ops ? GEP2Ops[i] : 0;
- // If they are equal, use a zero index...
- if (Op1 == Op2 && BasePtr1Ty == BasePtr2Ty) {
- if (!isa<ConstantInt>(Op1))
- GEP1Ops[i] = GEP2Ops[i] = Constant::getNullValue(Op1->getType());
- // Otherwise, just keep the constants we have.
- } else {
- if (Op1) {
- if (const ConstantInt *Op1C = dyn_cast<ConstantInt>(Op1)) {
- // If this is an array index, make sure the array element is in range.
- if (const ArrayType *AT = dyn_cast<ArrayType>(BasePtr1Ty)) {
- if (Op1C->getZExtValue() >= AT->getNumElements())
- return MayAlias; // Be conservative with out-of-range accesses
- } else if (const VectorType *VT = dyn_cast<VectorType>(BasePtr1Ty)) {
- if (Op1C->getZExtValue() >= VT->getNumElements())
- return MayAlias; // Be conservative with out-of-range accesses
- }
-
- } else {
- // GEP1 is known to produce a value less than GEP2. To be
- // conservatively correct, we must assume the largest possible
- // constant is used in this position. This cannot be the initial
- // index to the GEP instructions (because we know we have at least one
- // element before this one with the different constant arguments), so
- // we know that the current index must be into either a struct or
- // array. Because we know it's not constant, this cannot be a
- // structure index. Because of this, we can calculate the maximum
- // value possible.
- //
- if (const ArrayType *AT = dyn_cast<ArrayType>(BasePtr1Ty))
- GEP1Ops[i] = ConstantInt::get(Type::Int64Ty,AT->getNumElements()-1);
- else if (const VectorType *VT = dyn_cast<VectorType>(BasePtr1Ty))
- GEP1Ops[i] = ConstantInt::get(Type::Int64Ty,VT->getNumElements()-1);
- }
- }
-
- if (Op2) {
- if (const ConstantInt *Op2C = dyn_cast<ConstantInt>(Op2)) {
- // If this is an array index, make sure the array element is in range.
- if (const ArrayType *AT = dyn_cast<ArrayType>(BasePtr2Ty)) {
- if (Op2C->getZExtValue() >= AT->getNumElements())
- return MayAlias; // Be conservative with out-of-range accesses
- } else if (const VectorType *VT = dyn_cast<VectorType>(BasePtr2Ty)) {
- if (Op2C->getZExtValue() >= VT->getNumElements())
- return MayAlias; // Be conservative with out-of-range accesses
- }
- } else { // Conservatively assume the minimum value for this index
- GEP2Ops[i] = Constant::getNullValue(Op2->getType());
- }
- }
- }
-
- if (BasePtr1Ty && Op1) {
- if (const CompositeType *CT = dyn_cast<CompositeType>(BasePtr1Ty))
- BasePtr1Ty = CT->getTypeAtIndex(GEP1Ops[i]);
- else
- BasePtr1Ty = 0;
- }
-
- if (BasePtr2Ty && Op2) {
- if (const CompositeType *CT = dyn_cast<CompositeType>(BasePtr2Ty))
- BasePtr2Ty = CT->getTypeAtIndex(GEP2Ops[i]);
- else
- BasePtr2Ty = 0;
- }
- }
-
- if (GEPPointerTy->getElementType()->isSized()) {
- int64_t Offset1 =
- getTargetData().getIndexedOffset(GEPPointerTy, GEP1Ops, NumGEP1Ops);
- int64_t Offset2 =
- getTargetData().getIndexedOffset(GEPPointerTy, GEP2Ops, NumGEP2Ops);
- assert(Offset1 != Offset2 &&
- "There is at least one different constant here!");
-
- // Make sure we compare the absolute difference.
- if (Offset1 > Offset2)
- std::swap(Offset1, Offset2);
-
- if ((uint64_t)(Offset2-Offset1) >= SizeMax) {
- //cerr << "Determined that these two GEP's don't alias ["
- // << SizeMax << " bytes]: \n" << *GEP1 << *GEP2;
- return NoAlias;
- }
- }
- return MayAlias;
-}
-
-// Make sure that anything that uses AliasAnalysis pulls in this file...
-DEFINING_FILE_FOR(BasicAliasAnalysis)
diff --git a/release_23/lib/Analysis/CFGPrinter.cpp b/release_23/lib/Analysis/CFGPrinter.cpp
deleted file mode 100644
index f293555a6935..000000000000
--- a/release_23/lib/Analysis/CFGPrinter.cpp
+++ /dev/null
@@ -1,214 +0,0 @@
-//===- CFGPrinter.cpp - DOT printer for the control flow graph ------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines a '-print-cfg' analysis pass, which emits the
-// cfg.<fnname>.dot file for each function in the program, with a graph of the
-// CFG for that function.
-//
-// The other main feature of this file is that it implements the
-// Function::viewCFG method, which is useful for debugging passes which operate
-// on the CFG.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Function.h"
-#include "llvm/Instructions.h"
-#include "llvm/Pass.h"
-#include "llvm/Analysis/CFGPrinter.h"
-#include "llvm/Assembly/Writer.h"
-#include "llvm/Support/CFG.h"
-#include "llvm/Support/Compiler.h"
-#include "llvm/Support/GraphWriter.h"
-#include "llvm/Config/config.h"
-#include <iosfwd>
-#include <sstream>
-#include <fstream>
-using namespace llvm;
-
-/// CFGOnly flag - This is used to control whether or not the CFG graph printer
-/// prints out the contents of basic blocks or not. This is acceptable because
-/// this code is only really used for debugging purposes.
-///
-static bool CFGOnly = false;
-
-namespace llvm {
-template<>
-struct DOTGraphTraits<const Function*> : public DefaultDOTGraphTraits {
- static std::string getGraphName(const Function *F) {
- return "CFG for '" + F->getName() + "' function";
- }
-
- static std::string getNodeLabel(const BasicBlock *Node,
- const Function *Graph) {
- if (CFGOnly && !Node->getName().empty())
- return Node->getName() + ":";
-
- std::ostringstream Out;
- if (CFGOnly) {
- WriteAsOperand(Out, Node, false);
- return Out.str();
- }
-
- if (Node->getName().empty()) {
- WriteAsOperand(Out, Node, false);
- Out << ":";
- }
-
- Out << *Node;
- std::string OutStr = Out.str();
- if (OutStr[0] == '\n') OutStr.erase(OutStr.begin());
-
- // Process string output to make it nicer...
- for (unsigned i = 0; i != OutStr.length(); ++i)
- if (OutStr[i] == '\n') { // Left justify
- OutStr[i] = '\\';
- OutStr.insert(OutStr.begin()+i+1, 'l');
- } else if (OutStr[i] == ';') { // Delete comments!
- unsigned Idx = OutStr.find('\n', i+1); // Find end of line
- OutStr.erase(OutStr.begin()+i, OutStr.begin()+Idx);
- --i;
- }
-
- return OutStr;
- }
-
- static std::string getEdgeSourceLabel(const BasicBlock *Node,
- succ_const_iterator I) {
- // Label source of conditional branches with "T" or "F"
- if (const BranchInst *BI = dyn_cast<BranchInst>(Node->getTerminator()))
- if (BI->isConditional())
- return (I == succ_begin(Node)) ? "T" : "F";
- return "";
- }
-};
-}
-
-namespace {
- struct VISIBILITY_HIDDEN CFGViewer : public FunctionPass {
- static char ID; // Pass identifcation, replacement for typeid
- CFGViewer() : FunctionPass((intptr_t)&ID) {}
-
- virtual bool runOnFunction(Function &F) {
- F.viewCFG();
- return false;
- }
-
- void print(std::ostream &OS, const Module* = 0) const {}
-
- virtual void getAnalysisUsage(AnalysisUsage &AU) const {
- AU.setPreservesAll();
- }
- };
-
- char CFGViewer::ID = 0;
- RegisterPass<CFGViewer> V0("view-cfg",
- "View CFG of function", false, true);
-
- struct VISIBILITY_HIDDEN CFGOnlyViewer : public FunctionPass {
- static char ID; // Pass identifcation, replacement for typeid
- CFGOnlyViewer() : FunctionPass((intptr_t)&ID) {}
-
- virtual bool runOnFunction(Function &F) {
- CFGOnly = true;
- F.viewCFG();
- CFGOnly = false;
- return false;
- }
-
- void print(std::ostream &OS, const Module* = 0) const {}
-
- virtual void getAnalysisUsage(AnalysisUsage &AU) const {
- AU.setPreservesAll();
- }
- };
-
- char CFGOnlyViewer::ID = 0;
- RegisterPass<CFGOnlyViewer> V1("view-cfg-only",
- "View CFG of function (with no function bodies)", false, true);
-
- struct VISIBILITY_HIDDEN CFGPrinter : public FunctionPass {
- static char ID; // Pass identification, replacement for typeid
- CFGPrinter() : FunctionPass((intptr_t)&ID) {}
- explicit CFGPrinter(intptr_t pid) : FunctionPass(pid) {}
-
- virtual bool runOnFunction(Function &F) {
- std::string Filename = "cfg." + F.getName() + ".dot";
- cerr << "Writing '" << Filename << "'...";
- std::ofstream File(Filename.c_str());
-
- if (File.good())
- WriteGraph(File, (const Function*)&F);
- else
- cerr << " error opening file for writing!";
- cerr << "\n";
- return false;
- }
-
- void print(std::ostream &OS, const Module* = 0) const {}
-
- virtual void getAnalysisUsage(AnalysisUsage &AU) const {
- AU.setPreservesAll();
- }
- };
-
- char CFGPrinter::ID = 0;
- RegisterPass<CFGPrinter> P1("print-cfg",
- "Print CFG of function to 'dot' file", false, true);
-
- struct VISIBILITY_HIDDEN CFGOnlyPrinter : public CFGPrinter {
- static char ID; // Pass identification, replacement for typeid
- CFGOnlyPrinter() : CFGPrinter((intptr_t)&ID) {}
- virtual bool runOnFunction(Function &F) {
- bool OldCFGOnly = CFGOnly;
- CFGOnly = true;
- CFGPrinter::runOnFunction(F);
- CFGOnly = OldCFGOnly;
- return false;
- }
- void print(std::ostream &OS, const Module* = 0) const {}
-
- virtual void getAnalysisUsage(AnalysisUsage &AU) const {
- AU.setPreservesAll();
- }
- };
-
- char CFGOnlyPrinter::ID = 0;
- RegisterPass<CFGOnlyPrinter>
- P2("print-cfg-only",
- "Print CFG of function to 'dot' file (with no function bodies)", false, true);
-}
-
-/// viewCFG - This function is meant for use from the debugger. You can just
-/// say 'call F->viewCFG()' and a ghostview window should pop up from the
-/// program, displaying the CFG of the current function. This depends on there
-/// being a 'dot' and 'gv' program in your path.
-///
-void Function::viewCFG() const {
- ViewGraph(this, "cfg" + getName());
-}
-
-/// viewCFGOnly - This function is meant for use from the debugger. It works
-/// just like viewCFG, but it does not include the contents of basic blocks
-/// into the nodes, just the label. If you are only interested in the CFG t
-/// his can make the graph smaller.
-///
-void Function::viewCFGOnly() const {
- CFGOnly = true;
- viewCFG();
- CFGOnly = false;
-}
-
-FunctionPass *llvm::createCFGPrinterPass () {
- return new CFGPrinter();
-}
-
-FunctionPass *llvm::createCFGOnlyPrinterPass () {
- return new CFGOnlyPrinter();
-}
-
diff --git a/release_23/lib/Analysis/ConstantFolding.cpp b/release_23/lib/Analysis/ConstantFolding.cpp
deleted file mode 100644
index 7601aeb2f4f7..000000000000
--- a/release_23/lib/Analysis/ConstantFolding.cpp
+++ /dev/null
@@ -1,753 +0,0 @@
-//===-- ConstantFolding.cpp - Analyze constant folding possibilities ------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This family of functions determines the possibility of performing constant
-// folding.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Analysis/ConstantFolding.h"
-#include "llvm/Constants.h"
-#include "llvm/DerivedTypes.h"
-#include "llvm/Function.h"
-#include "llvm/Instructions.h"
-#include "llvm/Intrinsics.h"
-#include "llvm/ADT/SmallVector.h"
-#include "llvm/ADT/StringMap.h"
-#include "llvm/Target/TargetData.h"
-#include "llvm/Support/GetElementPtrTypeIterator.h"
-#include "llvm/Support/MathExtras.h"
-#include <cerrno>
-#include <cmath>
-using namespace llvm;
-
-//===----------------------------------------------------------------------===//
-// Constant Folding internal helper functions
-//===----------------------------------------------------------------------===//
-
-/// IsConstantOffsetFromGlobal - If this constant is actually a constant offset
-/// from a global, return the global and the constant. Because of
-/// constantexprs, this function is recursive.
-static bool IsConstantOffsetFromGlobal(Constant *C, GlobalValue *&GV,
- int64_t &Offset, const TargetData &TD) {
- // Trivial case, constant is the global.
- if ((GV = dyn_cast<GlobalValue>(C))) {
- Offset = 0;
- return true;
- }
-
- // Otherwise, if this isn't a constant expr, bail out.
- ConstantExpr *CE = dyn_cast<ConstantExpr>(C);
- if (!CE) return false;
-
- // Look through ptr->int and ptr->ptr casts.
- if (CE->getOpcode() == Instruction::PtrToInt ||
- CE->getOpcode() == Instruction::BitCast)
- return IsConstantOffsetFromGlobal(CE->getOperand(0), GV, Offset, TD);
-
- // i32* getelementptr ([5 x i32]* @a, i32 0, i32 5)
- if (CE->getOpcode() == Instruction::GetElementPtr) {
- // Cannot compute this if the element type of the pointer is missing size
- // info.
- if (!cast<PointerType>(CE->getOperand(0)->getType())
- ->getElementType()->isSized())
- return false;
-
- // If the base isn't a global+constant, we aren't either.
- if (!IsConstantOffsetFromGlobal(CE->getOperand(0), GV, Offset, TD))
- return false;
-
- // Otherwise, add any offset that our operands provide.
- gep_type_iterator GTI = gep_type_begin(CE);
- for (unsigned i = 1, e = CE->getNumOperands(); i != e; ++i, ++GTI) {
- ConstantInt *CI = dyn_cast<ConstantInt>(CE->getOperand(i));
- if (!CI) return false; // Index isn't a simple constant?
- if (CI->getZExtValue() == 0) continue; // Not adding anything.
-
- if (const StructType *ST = dyn_cast<StructType>(*GTI)) {
- // N = N + Offset
- Offset += TD.getStructLayout(ST)->getElementOffset(CI->getZExtValue());
- } else {
- const SequentialType *SQT = cast<SequentialType>(*GTI);
- Offset += TD.getABITypeSize(SQT->getElementType())*CI->getSExtValue();
- }
- }
- return true;
- }
-
- return false;
-}
-
-
-/// SymbolicallyEvaluateBinop - One of Op0/Op1 is a constant expression.
-/// Attempt to symbolically evaluate the result of a binary operator merging
-/// these together. If target data info is available, it is provided as TD,
-/// otherwise TD is null.
-static Constant *SymbolicallyEvaluateBinop(unsigned Opc, Constant *Op0,
- Constant *Op1, const TargetData *TD){
- // SROA
-
- // Fold (and 0xffffffff00000000, (shl x, 32)) -> shl.
- // Fold (lshr (or X, Y), 32) -> (lshr [X/Y], 32) if one doesn't contribute
- // bits.
-
-
- // If the constant expr is something like &A[123] - &A[4].f, fold this into a
- // constant. This happens frequently when iterating over a global array.
- if (Opc == Instruction::Sub && TD) {
- GlobalValue *GV1, *GV2;
- int64_t Offs1, Offs2;
-
- if (IsConstantOffsetFromGlobal(Op0, GV1, Offs1, *TD))
- if (IsConstantOffsetFromGlobal(Op1, GV2, Offs2, *TD) &&
- GV1 == GV2) {
- // (&GV+C1) - (&GV+C2) -> C1-C2, pointer arithmetic cannot overflow.
- return ConstantInt::get(Op0->getType(), Offs1-Offs2);
- }
- }
-
- // TODO: Fold icmp setne/seteq as well.
- return 0;
-}
-
-/// SymbolicallyEvaluateGEP - If we can symbolically evaluate the specified GEP
-/// constant expression, do so.
-static Constant *SymbolicallyEvaluateGEP(Constant* const* Ops, unsigned NumOps,
- const Type *ResultTy,
- const TargetData *TD) {
- Constant *Ptr = Ops[0];
- if (!TD || !cast<PointerType>(Ptr->getType())->getElementType()->isSized())
- return 0;
-
- uint64_t BasePtr = 0;
- if (!Ptr->isNullValue()) {
- // If this is a inttoptr from a constant int, we can fold this as the base,
- // otherwise we can't.
- if (ConstantExpr *CE = dyn_cast<ConstantExpr>(Ptr))
- if (CE->getOpcode() == Instruction::IntToPtr)
- if (ConstantInt *Base = dyn_cast<ConstantInt>(CE->getOperand(0)))
- BasePtr = Base->getZExtValue();
-
- if (BasePtr == 0)
- return 0;
- }
-
- // If this is a constant expr gep that is effectively computing an
- // "offsetof", fold it into 'cast int Size to T*' instead of 'gep 0, 0, 12'
- for (unsigned i = 1; i != NumOps; ++i)
- if (!isa<ConstantInt>(Ops[i]))
- return false;
-
- uint64_t Offset = TD->getIndexedOffset(Ptr->getType(),
- (Value**)Ops+1, NumOps-1);
- Constant *C = ConstantInt::get(TD->getIntPtrType(), Offset+BasePtr);
- return ConstantExpr::getIntToPtr(C, ResultTy);
-}
-
-/// FoldBitCast - Constant fold bitcast, symbolically evaluating it with
-/// targetdata. Return 0 if unfoldable.
-static Constant *FoldBitCast(Constant *C, const Type *DestTy,
- const TargetData &TD) {
- // If this is a bitcast from constant vector -> vector, fold it.
- if (ConstantVector *CV = dyn_cast<ConstantVector>(C)) {
- if (const VectorType *DestVTy = dyn_cast<VectorType>(DestTy)) {
- // If the element types match, VMCore can fold it.
- unsigned NumDstElt = DestVTy->getNumElements();
- unsigned NumSrcElt = CV->getNumOperands();
- if (NumDstElt == NumSrcElt)
- return 0;
-
- const Type *SrcEltTy = CV->getType()->getElementType();
- const Type *DstEltTy = DestVTy->getElementType();
-
- // Otherwise, we're changing the number of elements in a vector, which
- // requires endianness information to do the right thing. For example,
- // bitcast (<2 x i64> <i64 0, i64 1> to <4 x i32>)
- // folds to (little endian):
- // <4 x i32> <i32 0, i32 0, i32 1, i32 0>
- // and to (big endian):
- // <4 x i32> <i32 0, i32 0, i32 0, i32 1>
-
- // First thing is first. We only want to think about integer here, so if
- // we have something in FP form, recast it as integer.
- if (DstEltTy->isFloatingPoint()) {
- // Fold to an vector of integers with same size as our FP type.
- unsigned FPWidth = DstEltTy->getPrimitiveSizeInBits();
- const Type *DestIVTy = VectorType::get(IntegerType::get(FPWidth),
- NumDstElt);
- // Recursively handle this integer conversion, if possible.
- C = FoldBitCast(C, DestIVTy, TD);
- if (!C) return 0;
-
- // Finally, VMCore can handle this now that #elts line up.
- return ConstantExpr::getBitCast(C, DestTy);
- }
-
- // Okay, we know the destination is integer, if the input is FP, convert
- // it to integer first.
- if (SrcEltTy->isFloatingPoint()) {
- unsigned FPWidth = SrcEltTy->getPrimitiveSizeInBits();
- const Type *SrcIVTy = VectorType::get(IntegerType::get(FPWidth),
- NumSrcElt);
- // Ask VMCore to do the conversion now that #elts line up.
- C = ConstantExpr::getBitCast(C, SrcIVTy);
- CV = dyn_cast<ConstantVector>(C);
- if (!CV) return 0; // If VMCore wasn't able to fold it, bail out.
- }
-
- // Now we know that the input and output vectors are both integer vectors
- // of the same size, and that their #elements is not the same. Do the
- // conversion here, which depends on whether the input or output has
- // more elements.
- bool isLittleEndian = TD.isLittleEndian();
-
- SmallVector<Constant*, 32> Result;
- if (NumDstElt < NumSrcElt) {
- // Handle: bitcast (<4 x i32> <i32 0, i32 1, i32 2, i32 3> to <2 x i64>)
- Constant *Zero = Constant::getNullValue(DstEltTy);
- unsigned Ratio = NumSrcElt/NumDstElt;
- unsigned SrcBitSize = SrcEltTy->getPrimitiveSizeInBits();
- unsigned SrcElt = 0;
- for (unsigned i = 0; i != NumDstElt; ++i) {
- // Build each element of the result.
- Constant *Elt = Zero;
- unsigned ShiftAmt = isLittleEndian ? 0 : SrcBitSize*(Ratio-1);
- for (unsigned j = 0; j != Ratio; ++j) {
- Constant *Src = dyn_cast<ConstantInt>(CV->getOperand(SrcElt++));
- if (!Src) return 0; // Reject constantexpr elements.
-
- // Zero extend the element to the right size.
- Src = ConstantExpr::getZExt(Src, Elt->getType());
-
- // Shift it to the right place, depending on endianness.
- Src = ConstantExpr::getShl(Src,
- ConstantInt::get(Src->getType(), ShiftAmt));
- ShiftAmt += isLittleEndian ? SrcBitSize : -SrcBitSize;
-
- // Mix it in.
- Elt = ConstantExpr::getOr(Elt, Src);
- }
- Result.push_back(Elt);
- }
- } else {
- // Handle: bitcast (<2 x i64> <i64 0, i64 1> to <4 x i32>)
- unsigned Ratio = NumDstElt/NumSrcElt;
- unsigned DstBitSize = DstEltTy->getPrimitiveSizeInBits();
-
- // Loop over each source value, expanding into multiple results.
- for (unsigned i = 0; i != NumSrcElt; ++i) {
- Constant *Src = dyn_cast<ConstantInt>(CV->getOperand(i));
- if (!Src) return 0; // Reject constantexpr elements.
-
- unsigned ShiftAmt = isLittleEndian ? 0 : DstBitSize*(Ratio-1);
- for (unsigned j = 0; j != Ratio; ++j) {
- // Shift the piece of the value into the right place, depending on
- // endianness.
- Constant *Elt = ConstantExpr::getLShr(Src,
- ConstantInt::get(Src->getType(), ShiftAmt));
- ShiftAmt += isLittleEndian ? DstBitSize : -DstBitSize;
-
- // Truncate and remember this piece.
- Result.push_back(ConstantExpr::getTrunc(Elt, DstEltTy));
- }
- }
- }
-
- return ConstantVector::get(&Result[0], Result.size());
- }
- }
-
- return 0;
-}
-
-
-//===----------------------------------------------------------------------===//
-// Constant Folding public APIs
-//===----------------------------------------------------------------------===//
-
-
-/// ConstantFoldInstruction - Attempt to constant fold the specified
-/// instruction. If successful, the constant result is returned, if not, null
-/// is returned. Note that this function can only fail when attempting to fold
-/// instructions like loads and stores, which have no constant expression form.
-///
-Constant *llvm::ConstantFoldInstruction(Instruction *I, const TargetData *TD) {
- if (PHINode *PN = dyn_cast<PHINode>(I)) {
- if (PN->getNumIncomingValues() == 0)
- return Constant::getNullValue(PN->getType());
-
- Constant *Result = dyn_cast<Constant>(PN->getIncomingValue(0));
- if (Result == 0) return 0;
-
- // Handle PHI nodes specially here...
- for (unsigned i = 1, e = PN->getNumIncomingValues(); i != e; ++i)
- if (PN->getIncomingValue(i) != Result && PN->getIncomingValue(i) != PN)
- return 0; // Not all the same incoming constants...
-
- // If we reach here, all incoming values are the same constant.
- return Result;
- }
-
- // Scan the operand list, checking to see if they are all constants, if so,
- // hand off to ConstantFoldInstOperands.
- SmallVector<Constant*, 8> Ops;
- for (unsigned i = 0, e = I->getNumOperands(); i != e; ++i)
- if (Constant *Op = dyn_cast<Constant>(I->getOperand(i)))
- Ops.push_back(Op);
- else
- return 0; // All operands not constant!
-
- if (const CmpInst *CI = dyn_cast<CmpInst>(I))
- return ConstantFoldCompareInstOperands(CI->getPredicate(),
- &Ops[0], Ops.size(), TD);
- else
- return ConstantFoldInstOperands(I->getOpcode(), I->getType(),
- &Ops[0], Ops.size(), TD);
-}
-
-/// ConstantFoldInstOperands - Attempt to constant fold an instruction with the
-/// specified opcode and operands. If successful, the constant result is
-/// returned, if not, null is returned. Note that this function can fail when
-/// attempting to fold instructions like loads and stores, which have no
-/// constant expression form.
-///
-Constant *llvm::ConstantFoldInstOperands(unsigned Opcode, const Type *DestTy,
- Constant* const* Ops, unsigned NumOps,
- const TargetData *TD) {
- // Handle easy binops first.
- if (Instruction::isBinaryOp(Opcode)) {
- if (isa<ConstantExpr>(Ops[0]) || isa<ConstantExpr>(Ops[1]))
- if (Constant *C = SymbolicallyEvaluateBinop(Opcode, Ops[0], Ops[1], TD))
- return C;
-
- return ConstantExpr::get(Opcode, Ops[0], Ops[1]);
- }
-
- switch (Opcode) {
- default: return 0;
- case Instruction::Call:
- if (Function *F = dyn_cast<Function>(Ops[0]))
- if (canConstantFoldCallTo(F))
- return ConstantFoldCall(F, Ops+1, NumOps-1);
- return 0;
- case Instruction::ICmp:
- case Instruction::FCmp:
- assert(0 &&"This function is invalid for compares: no predicate specified");
- case Instruction::PtrToInt:
- // If the input is a inttoptr, eliminate the pair. This requires knowing
- // the width of a pointer, so it can't be done in ConstantExpr::getCast.
- if (ConstantExpr *CE = dyn_cast<ConstantExpr>(Ops[0])) {
- if (TD && CE->getOpcode() == Instruction::IntToPtr) {
- Constant *Input = CE->getOperand(0);
- unsigned InWidth = Input->getType()->getPrimitiveSizeInBits();
- Constant *Mask =
- ConstantInt::get(APInt::getLowBitsSet(InWidth,
- TD->getPointerSizeInBits()));
- Input = ConstantExpr::getAnd(Input, Mask);
- // Do a zext or trunc to get to the dest size.
- return ConstantExpr::getIntegerCast(Input, DestTy, false);
- }
- }
- return ConstantExpr::getCast(Opcode, Ops[0], DestTy);
- case Instruction::IntToPtr:
- case Instruction::Trunc:
- case Instruction::ZExt:
- case Instruction::SExt:
- case Instruction::FPTrunc:
- case Instruction::FPExt:
- case Instruction::UIToFP:
- case Instruction::SIToFP:
- case Instruction::FPToUI:
- case Instruction::FPToSI:
- return ConstantExpr::getCast(Opcode, Ops[0], DestTy);
- case Instruction::BitCast:
- if (TD)
- if (Constant *C = FoldBitCast(Ops[0], DestTy, *TD))
- return C;
- return ConstantExpr::getBitCast(Ops[0], DestTy);
- case Instruction::Select:
- return ConstantExpr::getSelect(Ops[0], Ops[1], Ops[2]);
- case Instruction::ExtractElement:
- return ConstantExpr::getExtractElement(Ops[0], Ops[1]);
- case Instruction::InsertElement:
- return ConstantExpr::getInsertElement(Ops[0], Ops[1], Ops[2]);
- case Instruction::ShuffleVector:
- return ConstantExpr::getShuffleVector(Ops[0], Ops[1], Ops[2]);
- case Instruction::GetElementPtr:
- if (Constant *C = SymbolicallyEvaluateGEP(Ops, NumOps, DestTy, TD))
- return C;
-
- return ConstantExpr::getGetElementPtr(Ops[0], Ops+1, NumOps-1);
- }
-}
-
-/// ConstantFoldCompareInstOperands - Attempt to constant fold a compare
-/// instruction (icmp/fcmp) with the specified operands. If it fails, it
-/// returns a constant expression of the specified operands.
-///
-Constant *llvm::ConstantFoldCompareInstOperands(unsigned Predicate,
- Constant*const * Ops,
- unsigned NumOps,
- const TargetData *TD) {
- // fold: icmp (inttoptr x), null -> icmp x, 0
- // fold: icmp (ptrtoint x), 0 -> icmp x, null
- // fold: icmp (inttoptr x), (inttoptr y) -> icmp x, y
- // fold: icmp (ptrtoint x), (ptrtoint y) -> icmp x, y
- //
- // ConstantExpr::getCompare cannot do this, because it doesn't have TD
- // around to know if bit truncation is happening.
- if (ConstantExpr *CE0 = dyn_cast<ConstantExpr>(Ops[0])) {
- if (TD && Ops[1]->isNullValue()) {
- const Type *IntPtrTy = TD->getIntPtrType();
- if (CE0->getOpcode() == Instruction::IntToPtr) {
- // Convert the integer value to the right size to ensure we get the
- // proper extension or truncation.
- Constant *C = ConstantExpr::getIntegerCast(CE0->getOperand(0),
- IntPtrTy, false);
- Constant *NewOps[] = { C, Constant::getNullValue(C->getType()) };
- return ConstantFoldCompareInstOperands(Predicate, NewOps, 2, TD);
- }
-
- // Only do this transformation if the int is intptrty in size, otherwise
- // there is a truncation or extension that we aren't modeling.
- if (CE0->getOpcode() == Instruction::PtrToInt &&
- CE0->getType() == IntPtrTy) {
- Constant *C = CE0->getOperand(0);
- Constant *NewOps[] = { C, Constant::getNullValue(C->getType()) };
- // FIXME!
- return ConstantFoldCompareInstOperands(Predicate, NewOps, 2, TD);
- }
- }
-
- if (TD && isa<ConstantExpr>(Ops[1]) &&
- cast<ConstantExpr>(Ops[1])->getOpcode() == CE0->getOpcode()) {
- const Type *IntPtrTy = TD->getIntPtrType();
- // Only do this transformation if the int is intptrty in size, otherwise
- // there is a truncation or extension that we aren't modeling.
- if ((CE0->getOpcode() == Instruction::IntToPtr &&
- CE0->getOperand(0)->getType() == IntPtrTy &&
- Ops[1]->getOperand(0)->getType() == IntPtrTy) ||
- (CE0->getOpcode() == Instruction::PtrToInt &&
- CE0->getType() == IntPtrTy &&
- CE0->getOperand(0)->getType() == Ops[1]->getOperand(0)->getType())) {
- Constant *NewOps[] = {
- CE0->getOperand(0), cast<ConstantExpr>(Ops[1])->getOperand(0)
- };
- return ConstantFoldCompareInstOperands(Predicate, NewOps, 2, TD);
- }
- }
- }
- return ConstantExpr::getCompare(Predicate, Ops[0], Ops[1]);
-}
-
-
-/// ConstantFoldLoadThroughGEPConstantExpr - Given a constant and a
-/// getelementptr constantexpr, return the constant value being addressed by the
-/// constant expression, or null if something is funny and we can't decide.
-Constant *llvm::ConstantFoldLoadThroughGEPConstantExpr(Constant *C,
- ConstantExpr *CE) {
- if (CE->getOperand(1) != Constant::getNullValue(CE->getOperand(1)->getType()))
- return 0; // Do not allow stepping over the value!
-
- // Loop over all of the operands, tracking down which value we are
- // addressing...
- gep_type_iterator I = gep_type_begin(CE), E = gep_type_end(CE);
- for (++I; I != E; ++I)
- if (const StructType *STy = dyn_cast<StructType>(*I)) {
- ConstantInt *CU = cast<ConstantInt>(I.getOperand());
- assert(CU->getZExtValue() < STy->getNumElements() &&
- "Struct index out of range!");
- unsigned El = (unsigned)CU->getZExtValue();
- if (ConstantStruct *CS = dyn_cast<ConstantStruct>(C)) {
- C = CS->getOperand(El);
- } else if (isa<ConstantAggregateZero>(C)) {
- C = Constant::getNullValue(STy->getElementType(El));
- } else if (isa<UndefValue>(C)) {
- C = UndefValue::get(STy->getElementType(El));
- } else {
- return 0;
- }
- } else if (ConstantInt *CI = dyn_cast<ConstantInt>(I.getOperand())) {
- if (const ArrayType *ATy = dyn_cast<ArrayType>(*I)) {
- if (CI->getZExtValue() >= ATy->getNumElements())
- return 0;
- if (ConstantArray *CA = dyn_cast<ConstantArray>(C))
- C = CA->getOperand(CI->getZExtValue());
- else if (isa<ConstantAggregateZero>(C))
- C = Constant::getNullValue(ATy->getElementType());
- else if (isa<UndefValue>(C))
- C = UndefValue::get(ATy->getElementType());
- else
- return 0;
- } else if (const VectorType *PTy = dyn_cast<VectorType>(*I)) {
- if (CI->getZExtValue() >= PTy->getNumElements())
- return 0;
- if (ConstantVector *CP = dyn_cast<ConstantVector>(C))
- C = CP->getOperand(CI->getZExtValue());
- else if (isa<ConstantAggregateZero>(C))
- C = Constant::getNullValue(PTy->getElementType());
- else if (isa<UndefValue>(C))
- C = UndefValue::get(PTy->getElementType());
- else
- return 0;
- } else {
- return 0;
- }
- } else {
- return 0;
- }
- return C;
-}
-
-
-//===----------------------------------------------------------------------===//
-// Constant Folding for Calls
-//
-
-/// canConstantFoldCallTo - Return true if its even possible to fold a call to
-/// the specified function.
-bool
-llvm::canConstantFoldCallTo(const Function *F) {
- switch (F->getIntrinsicID()) {
- case Intrinsic::sqrt:
- case Intrinsic::powi:
- case Intrinsic::bswap:
- case Intrinsic::ctpop:
- case Intrinsic::ctlz:
- case Intrinsic::cttz:
- return true;
- default: break;
- }
-
- const ValueName *NameVal = F->getValueName();
- if (NameVal == 0) return false;
- const char *Str = NameVal->getKeyData();
- unsigned Len = NameVal->getKeyLength();
-
- // In these cases, the check of the length is required. We don't want to
- // return true for a name like "cos\0blah" which strcmp would return equal to
- // "cos", but has length 8.
- switch (Str[0]) {
- default: return false;
- case 'a':
- if (Len == 4)
- return !strcmp(Str, "acos") || !strcmp(Str, "asin") ||
- !strcmp(Str, "atan");
- else if (Len == 5)
- return !strcmp(Str, "atan2");
- return false;
- case 'c':
- if (Len == 3)
- return !strcmp(Str, "cos");
- else if (Len == 4)
- return !strcmp(Str, "ceil") || !strcmp(Str, "cosf") ||
- !strcmp(Str, "cosh");
- return false;
- case 'e':
- if (Len == 3)
- return !strcmp(Str, "exp");
- return false;
- case 'f':
- if (Len == 4)
- return !strcmp(Str, "fabs") || !strcmp(Str, "fmod");
- else if (Len == 5)
- return !strcmp(Str, "floor");
- return false;
- break;
- case 'l':
- if (Len == 3 && !strcmp(Str, "log"))
- return true;
- if (Len == 5 && !strcmp(Str, "log10"))
- return true;
- return false;
- case 'p':
- if (Len == 3 && !strcmp(Str, "pow"))
- return true;
- return false;
- case 's':
- if (Len == 3)
- return !strcmp(Str, "sin");
- if (Len == 4)
- return !strcmp(Str, "sinh") || !strcmp(Str, "sqrt") ||
- !strcmp(Str, "sinf");
- if (Len == 5)
- return !strcmp(Str, "sqrtf");
- return false;
- case 't':
- if (Len == 3 && !strcmp(Str, "tan"))
- return true;
- else if (Len == 4 && !strcmp(Str, "tanh"))
- return true;
- return false;
- }
-}
-
-static Constant *ConstantFoldFP(double (*NativeFP)(double), double V,
- const Type *Ty) {
- errno = 0;
- V = NativeFP(V);
- if (errno != 0) {
- errno = 0;
- return 0;
- }
-
- if (Ty == Type::FloatTy)
- return ConstantFP::get(APFloat((float)V));
- if (Ty == Type::DoubleTy)
- return ConstantFP::get(APFloat(V));
- assert(0 && "Can only constant fold float/double");
- return 0; // dummy return to suppress warning
-}
-
-static Constant *ConstantFoldBinaryFP(double (*NativeFP)(double, double),
- double V, double W,
- const Type *Ty) {
- errno = 0;
- V = NativeFP(V, W);
- if (errno != 0) {
- errno = 0;
- return 0;
- }
-
- if (Ty == Type::FloatTy)
- return ConstantFP::get(APFloat((float)V));
- if (Ty == Type::DoubleTy)
- return ConstantFP::get(APFloat(V));
- assert(0 && "Can only constant fold float/double");
- return 0; // dummy return to suppress warning
-}
-
-/// ConstantFoldCall - Attempt to constant fold a call to the specified function
-/// with the specified arguments, returning null if unsuccessful.
-
-Constant *
-llvm::ConstantFoldCall(Function *F,
- Constant* const* Operands, unsigned NumOperands) {
- const ValueName *NameVal = F->getValueName();
- if (NameVal == 0) return 0;
- const char *Str = NameVal->getKeyData();
- unsigned Len = NameVal->getKeyLength();
-
- const Type *Ty = F->getReturnType();
- if (NumOperands == 1) {
- if (ConstantFP *Op = dyn_cast<ConstantFP>(Operands[0])) {
- if (Ty!=Type::FloatTy && Ty!=Type::DoubleTy)
- return 0;
- /// Currently APFloat versions of these functions do not exist, so we use
- /// the host native double versions. Float versions are not called
- /// directly but for all these it is true (float)(f((double)arg)) ==
- /// f(arg). Long double not supported yet.
- double V = Ty==Type::FloatTy ? (double)Op->getValueAPF().convertToFloat():
- Op->getValueAPF().convertToDouble();
- switch (Str[0]) {
- case 'a':
- if (Len == 4 && !strcmp(Str, "acos"))
- return ConstantFoldFP(acos, V, Ty);
- else if (Len == 4 && !strcmp(Str, "asin"))
- return ConstantFoldFP(asin, V, Ty);
- else if (Len == 4 && !strcmp(Str, "atan"))
- return ConstantFoldFP(atan, V, Ty);
- break;
- case 'c':
- if (Len == 4 && !strcmp(Str, "ceil"))
- return ConstantFoldFP(ceil, V, Ty);
- else if (Len == 3 && !strcmp(Str, "cos"))
- return ConstantFoldFP(cos, V, Ty);
- else if (Len == 4 && !strcmp(Str, "cosh"))
- return ConstantFoldFP(cosh, V, Ty);
- else if (Len == 4 && !strcmp(Str, "cosf"))
- return ConstantFoldFP(cos, V, Ty);
- break;
- case 'e':
- if (Len == 3 && !strcmp(Str, "exp"))
- return ConstantFoldFP(exp, V, Ty);
- break;
- case 'f':
- if (Len == 4 && !strcmp(Str, "fabs"))
- return ConstantFoldFP(fabs, V, Ty);
- else if (Len == 5 && !strcmp(Str, "floor"))
- return ConstantFoldFP(floor, V, Ty);
- break;
- case 'l':
- if (Len == 3 && !strcmp(Str, "log") && V > 0)
- return ConstantFoldFP(log, V, Ty);
- else if (Len == 5 && !strcmp(Str, "log10") && V > 0)
- return ConstantFoldFP(log10, V, Ty);
- else if (!strcmp(Str, "llvm.sqrt.f32") ||
- !strcmp(Str, "llvm.sqrt.f64")) {
- if (V >= -0.0)
- return ConstantFoldFP(sqrt, V, Ty);
- else // Undefined
- return Constant::getNullValue(Ty);
- }
- break;
- case 's':
- if (Len == 3 && !strcmp(Str, "sin"))
- return ConstantFoldFP(sin, V, Ty);
- else if (Len == 4 && !strcmp(Str, "sinh"))
- return ConstantFoldFP(sinh, V, Ty);
- else if (Len == 4 && !strcmp(Str, "sqrt") && V >= 0)
- return ConstantFoldFP(sqrt, V, Ty);
- else if (Len == 5 && !strcmp(Str, "sqrtf") && V >= 0)
- return ConstantFoldFP(sqrt, V, Ty);
- else if (Len == 4 && !strcmp(Str, "sinf"))
- return ConstantFoldFP(sin, V, Ty);
- break;
- case 't':
- if (Len == 3 && !strcmp(Str, "tan"))
- return ConstantFoldFP(tan, V, Ty);
- else if (Len == 4 && !strcmp(Str, "tanh"))
- return ConstantFoldFP(tanh, V, Ty);
- break;
- default:
- break;
- }
- } else if (ConstantInt *Op = dyn_cast<ConstantInt>(Operands[0])) {
- if (Len > 11 && !memcmp(Str, "llvm.bswap", 10))
- return ConstantInt::get(Op->getValue().byteSwap());
- else if (Len > 11 && !memcmp(Str, "llvm.ctpop", 10))
- return ConstantInt::get(Ty, Op->getValue().countPopulation());
- else if (Len > 10 && !memcmp(Str, "llvm.cttz", 9))
- return ConstantInt::get(Ty, Op->getValue().countTrailingZeros());
- else if (Len > 10 && !memcmp(Str, "llvm.ctlz", 9))
- return ConstantInt::get(Ty, Op->getValue().countLeadingZeros());
- }
- } else if (NumOperands == 2) {
- if (ConstantFP *Op1 = dyn_cast<ConstantFP>(Operands[0])) {
- if (Ty!=Type::FloatTy && Ty!=Type::DoubleTy)
- return 0;
- double Op1V = Ty==Type::FloatTy ?
- (double)Op1->getValueAPF().convertToFloat():
- Op1->getValueAPF().convertToDouble();
- if (ConstantFP *Op2 = dyn_cast<ConstantFP>(Operands[1])) {
- double Op2V = Ty==Type::FloatTy ?
- (double)Op2->getValueAPF().convertToFloat():
- Op2->getValueAPF().convertToDouble();
-
- if (Len == 3 && !strcmp(Str, "pow")) {
- return ConstantFoldBinaryFP(pow, Op1V, Op2V, Ty);
- } else if (Len == 4 && !strcmp(Str, "fmod")) {
- return ConstantFoldBinaryFP(fmod, Op1V, Op2V, Ty);
- } else if (Len == 5 && !strcmp(Str, "atan2")) {
- return ConstantFoldBinaryFP(atan2, Op1V, Op2V, Ty);
- }
- } else if (ConstantInt *Op2C = dyn_cast<ConstantInt>(Operands[1])) {
- if (!strcmp(Str, "llvm.powi.f32")) {
- return ConstantFP::get(APFloat((float)std::pow((float)Op1V,
- (int)Op2C->getZExtValue())));
- } else if (!strcmp(Str, "llvm.powi.f64")) {
- return ConstantFP::get(APFloat((double)std::pow((double)Op1V,
- (int)Op2C->getZExtValue())));
- }
- }
- }
- }
- return 0;
-}
-
diff --git a/release_23/lib/Analysis/IPA/Andersens.cpp b/release_23/lib/Analysis/IPA/Andersens.cpp
deleted file mode 100644
index ab80bab95c70..000000000000
--- a/release_23/lib/Analysis/IPA/Andersens.cpp
+++ /dev/null
@@ -1,2869 +0,0 @@
-//===- Andersens.cpp - Andersen's Interprocedural Alias Analysis ----------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines an implementation of Andersen's interprocedural alias
-// analysis
-//
-// In pointer analysis terms, this is a subset-based, flow-insensitive,
-// field-sensitive, and context-insensitive algorithm pointer algorithm.
-//
-// This algorithm is implemented as three stages:
-// 1. Object identification.
-// 2. Inclusion constraint identification.
-// 3. Offline constraint graph optimization
-// 4. Inclusion constraint solving.
-//
-// The object identification stage identifies all of the memory objects in the
-// program, which includes globals, heap allocated objects, and stack allocated
-// objects.
-//
-// The inclusion constraint identification stage finds all inclusion constraints
-// in the program by scanning the program, looking for pointer assignments and
-// other statements that effect the points-to graph. For a statement like "A =
-// B", this statement is processed to indicate that A can point to anything that
-// B can point to. Constraints can handle copies, loads, and stores, and
-// address taking.
-//
-// The offline constraint graph optimization portion includes offline variable
-// substitution algorithms intended to compute pointer and location
-// equivalences. Pointer equivalences are those pointers that will have the
-// same points-to sets, and location equivalences are those variables that
-// always appear together in points-to sets. It also includes an offline
-// cycle detection algorithm that allows cycles to be collapsed sooner
-// during solving.
-//
-// The inclusion constraint solving phase iteratively propagates the inclusion
-// constraints until a fixed point is reached. This is an O(N^3) algorithm.
-//
-// Function constraints are handled as if they were structs with X fields.
-// Thus, an access to argument X of function Y is an access to node index
-// getNode(Y) + X. This representation allows handling of indirect calls
-// without any issues. To wit, an indirect call Y(a,b) is equivalent to
-// *(Y + 1) = a, *(Y + 2) = b.
-// The return node for a function is always located at getNode(F) +
-// CallReturnPos. The arguments start at getNode(F) + CallArgPos.
-//
-// Future Improvements:
-// Use of BDD's.
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "anders-aa"
-#include "llvm/Constants.h"
-#include "llvm/DerivedTypes.h"
-#include "llvm/Instructions.h"
-#include "llvm/Module.h"
-#include "llvm/Pass.h"
-#include "llvm/Support/Compiler.h"
-#include "llvm/Support/InstIterator.h"
-#include "llvm/Support/InstVisitor.h"
-#include "llvm/Analysis/AliasAnalysis.h"
-#include "llvm/Analysis/Passes.h"
-#include "llvm/Support/Debug.h"
-#include "llvm/ADT/Statistic.h"
-#include "llvm/ADT/SparseBitVector.h"
-#include "llvm/ADT/DenseSet.h"
-#include <algorithm>
-#include <set>
-#include <list>
-#include <map>
-#include <stack>
-#include <vector>
-#include <queue>
-
-// Determining the actual set of nodes the universal set can consist of is very
-// expensive because it means propagating around very large sets. We rely on
-// other analysis being able to determine which nodes can never be pointed to in
-// order to disambiguate further than "points-to anything".
-#define FULL_UNIVERSAL 0
-
-using namespace llvm;
-STATISTIC(NumIters , "Number of iterations to reach convergence");
-STATISTIC(NumConstraints, "Number of constraints");
-STATISTIC(NumNodes , "Number of nodes");
-STATISTIC(NumUnified , "Number of variables unified");
-STATISTIC(NumErased , "Number of redundant constraints erased");
-
-namespace {
- const unsigned SelfRep = (unsigned)-1;
- const unsigned Unvisited = (unsigned)-1;
- // Position of the function return node relative to the function node.
- const unsigned CallReturnPos = 1;
- // Position of the function call node relative to the function node.
- const unsigned CallFirstArgPos = 2;
-
- struct BitmapKeyInfo {
- static inline SparseBitVector<> *getEmptyKey() {
- return reinterpret_cast<SparseBitVector<> *>(-1);
- }
- static inline SparseBitVector<> *getTombstoneKey() {
- return reinterpret_cast<SparseBitVector<> *>(-2);
- }
- static unsigned getHashValue(const SparseBitVector<> *bitmap) {
- return bitmap->getHashValue();
- }
- static bool isEqual(const SparseBitVector<> *LHS,
- const SparseBitVector<> *RHS) {
- if (LHS == RHS)
- return true;
- else if (LHS == getEmptyKey() || RHS == getEmptyKey()
- || LHS == getTombstoneKey() || RHS == getTombstoneKey())
- return false;
-
- return *LHS == *RHS;
- }
-
- static bool isPod() { return true; }
- };
-
- class VISIBILITY_HIDDEN Andersens : public ModulePass, public AliasAnalysis,
- private InstVisitor<Andersens> {
- struct Node;
-
- /// Constraint - Objects of this structure are used to represent the various
- /// constraints identified by the algorithm. The constraints are 'copy',
- /// for statements like "A = B", 'load' for statements like "A = *B",
- /// 'store' for statements like "*A = B", and AddressOf for statements like
- /// A = alloca; The Offset is applied as *(A + K) = B for stores,
- /// A = *(B + K) for loads, and A = B + K for copies. It is
- /// illegal on addressof constraints (because it is statically
- /// resolvable to A = &C where C = B + K)
-
- struct Constraint {
- enum ConstraintType { Copy, Load, Store, AddressOf } Type;
- unsigned Dest;
- unsigned Src;
- unsigned Offset;
-
- Constraint(ConstraintType Ty, unsigned D, unsigned S, unsigned O = 0)
- : Type(Ty), Dest(D), Src(S), Offset(O) {
- assert((Offset == 0 || Ty != AddressOf) &&
- "Offset is illegal on addressof constraints");
- }
-
- bool operator==(const Constraint &RHS) const {
- return RHS.Type == Type
- && RHS.Dest == Dest
- && RHS.Src == Src
- && RHS.Offset == Offset;
- }
-
- bool operator!=(const Constraint &RHS) const {
- return !(*this == RHS);
- }
-
- bool operator<(const Constraint &RHS) const {
- if (RHS.Type != Type)
- return RHS.Type < Type;
- else if (RHS.Dest != Dest)
- return RHS.Dest < Dest;
- else if (RHS.Src != Src)
- return RHS.Src < Src;
- return RHS.Offset < Offset;
- }
- };
-
- // Information DenseSet requires implemented in order to be able to do
- // it's thing
- struct PairKeyInfo {
- static inline std::pair<unsigned, unsigned> getEmptyKey() {
- return std::make_pair(~0U, ~0U);
- }
- static inline std::pair<unsigned, unsigned> getTombstoneKey() {
- return std::make_pair(~0U - 1, ~0U - 1);
- }
- static unsigned getHashValue(const std::pair<unsigned, unsigned> &P) {
- return P.first ^ P.second;
- }
- static unsigned isEqual(const std::pair<unsigned, unsigned> &LHS,
- const std::pair<unsigned, unsigned> &RHS) {
- return LHS == RHS;
- }
- };
-
- struct ConstraintKeyInfo {
- static inline Constraint getEmptyKey() {
- return Constraint(Constraint::Copy, ~0U, ~0U, ~0U);
- }
- static inline Constraint getTombstoneKey() {
- return Constraint(Constraint::Copy, ~0U - 1, ~0U - 1, ~0U - 1);
- }
- static unsigned getHashValue(const Constraint &C) {
- return C.Src ^ C.Dest ^ C.Type ^ C.Offset;
- }
- static bool isEqual(const Constraint &LHS,
- const Constraint &RHS) {
- return LHS.Type == RHS.Type && LHS.Dest == RHS.Dest
- && LHS.Src == RHS.Src && LHS.Offset == RHS.Offset;
- }
- };
-
- // Node class - This class is used to represent a node in the constraint
- // graph. Due to various optimizations, it is not always the case that
- // there is a mapping from a Node to a Value. In particular, we add
- // artificial Node's that represent the set of pointed-to variables shared
- // for each location equivalent Node.
- struct Node {
- private:
- static unsigned Counter;
-
- public:
- Value *Val;
- SparseBitVector<> *Edges;
- SparseBitVector<> *PointsTo;
- SparseBitVector<> *OldPointsTo;
- std::list<Constraint> Constraints;
-
- // Pointer and location equivalence labels
- unsigned PointerEquivLabel;
- unsigned LocationEquivLabel;
- // Predecessor edges, both real and implicit
- SparseBitVector<> *PredEdges;
- SparseBitVector<> *ImplicitPredEdges;
- // Set of nodes that point to us, only use for location equivalence.
- SparseBitVector<> *PointedToBy;
- // Number of incoming edges, used during variable substitution to early
- // free the points-to sets
- unsigned NumInEdges;
- // True if our points-to set is in the Set2PEClass map
- bool StoredInHash;
- // True if our node has no indirect constraints (complex or otherwise)
- bool Direct;
- // True if the node is address taken, *or* it is part of a group of nodes
- // that must be kept together. This is set to true for functions and
- // their arg nodes, which must be kept at the same position relative to
- // their base function node.
- bool AddressTaken;
-
- // Nodes in cycles (or in equivalence classes) are united together using a
- // standard union-find representation with path compression. NodeRep
- // gives the index into GraphNodes for the representative Node.
- unsigned NodeRep;
-
- // Modification timestamp. Assigned from Counter.
- // Used for work list prioritization.
- unsigned Timestamp;
-
- explicit Node(bool direct = true) :
- Val(0), Edges(0), PointsTo(0), OldPointsTo(0),
- PointerEquivLabel(0), LocationEquivLabel(0), PredEdges(0),
- ImplicitPredEdges(0), PointedToBy(0), NumInEdges(0),
- StoredInHash(false), Direct(direct), AddressTaken(false),
- NodeRep(SelfRep), Timestamp(0) { }
-
- Node *setValue(Value *V) {
- assert(Val == 0 && "Value already set for this node!");
- Val = V;
- return this;
- }
-
- /// getValue - Return the LLVM value corresponding to this node.
- ///
- Value *getValue() const { return Val; }
-
- /// addPointerTo - Add a pointer to the list of pointees of this node,
- /// returning true if this caused a new pointer to be added, or false if
- /// we already knew about the points-to relation.
- bool addPointerTo(unsigned Node) {
- return PointsTo->test_and_set(Node);
- }
-
- /// intersects - Return true if the points-to set of this node intersects
- /// with the points-to set of the specified node.
- bool intersects(Node *N) const;
-
- /// intersectsIgnoring - Return true if the points-to set of this node
- /// intersects with the points-to set of the specified node on any nodes
- /// except for the specified node to ignore.
- bool intersectsIgnoring(Node *N, unsigned) const;
-
- // Timestamp a node (used for work list prioritization)
- void Stamp() {
- Timestamp = Counter++;
- }
-
- bool isRep() const {
- return( (int) NodeRep < 0 );
- }
- };
-
- struct WorkListElement {
- Node* node;
- unsigned Timestamp;
- WorkListElement(Node* n, unsigned t) : node(n), Timestamp(t) {}
-
- // Note that we reverse the sense of the comparison because we
- // actually want to give low timestamps the priority over high,
- // whereas priority is typically interpreted as a greater value is
- // given high priority.
- bool operator<(const WorkListElement& that) const {
- return( this->Timestamp > that.Timestamp );
- }
- };
-
- // Priority-queue based work list specialized for Nodes.
- class WorkList {
- std::priority_queue<WorkListElement> Q;
-
- public:
- void insert(Node* n) {
- Q.push( WorkListElement(n, n->Timestamp) );
- }
-
- // We automatically discard non-representative nodes and nodes
- // that were in the work list twice (we keep a copy of the
- // timestamp in the work list so we can detect this situation by
- // comparing against the node's current timestamp).
- Node* pop() {
- while( !Q.empty() ) {
- WorkListElement x = Q.top(); Q.pop();
- Node* INode = x.node;
-
- if( INode->isRep() &&
- INode->Timestamp == x.Timestamp ) {
- return(x.node);
- }
- }
- return(0);
- }
-
- bool empty() {
- return Q.empty();
- }
- };
-
- /// GraphNodes - This vector is populated as part of the object
- /// identification stage of the analysis, which populates this vector with a
- /// node for each memory object and fills in the ValueNodes map.
- std::vector<Node> GraphNodes;
-
- /// ValueNodes - This map indicates the Node that a particular Value* is
- /// represented by. This contains entries for all pointers.
- DenseMap<Value*, unsigned> ValueNodes;
-
- /// ObjectNodes - This map contains entries for each memory object in the
- /// program: globals, alloca's and mallocs.
- DenseMap<Value*, unsigned> ObjectNodes;
-
- /// ReturnNodes - This map contains an entry for each function in the
- /// program that returns a value.
- DenseMap<Function*, unsigned> ReturnNodes;
-
- /// VarargNodes - This map contains the entry used to represent all pointers
- /// passed through the varargs portion of a function call for a particular
- /// function. An entry is not present in this map for functions that do not
- /// take variable arguments.
- DenseMap<Function*, unsigned> VarargNodes;
-
-
- /// Constraints - This vector contains a list of all of the constraints
- /// identified by the program.
- std::vector<Constraint> Constraints;
-
- // Map from graph node to maximum K value that is allowed (for functions,
- // this is equivalent to the number of arguments + CallFirstArgPos)
- std::map<unsigned, unsigned> MaxK;
-
- /// This enum defines the GraphNodes indices that correspond to important
- /// fixed sets.
- enum {
- UniversalSet = 0,
- NullPtr = 1,
- NullObject = 2,
- NumberSpecialNodes
- };
- // Stack for Tarjan's
- std::stack<unsigned> SCCStack;
- // Map from Graph Node to DFS number
- std::vector<unsigned> Node2DFS;
- // Map from Graph Node to Deleted from graph.
- std::vector<bool> Node2Deleted;
- // Same as Node Maps, but implemented as std::map because it is faster to
- // clear
- std::map<unsigned, unsigned> Tarjan2DFS;
- std::map<unsigned, bool> Tarjan2Deleted;
- // Current DFS number
- unsigned DFSNumber;
-
- // Work lists.
- WorkList w1, w2;
- WorkList *CurrWL, *NextWL; // "current" and "next" work lists
-
- // Offline variable substitution related things
-
- // Temporary rep storage, used because we can't collapse SCC's in the
- // predecessor graph by uniting the variables permanently, we can only do so
- // for the successor graph.
- std::vector<unsigned> VSSCCRep;
- // Mapping from node to whether we have visited it during SCC finding yet.
- std::vector<bool> Node2Visited;
- // During variable substitution, we create unknowns to represent the unknown
- // value that is a dereference of a variable. These nodes are known as
- // "ref" nodes (since they represent the value of dereferences).
- unsigned FirstRefNode;
- // During HVN, we create represent address taken nodes as if they were
- // unknown (since HVN, unlike HU, does not evaluate unions).
- unsigned FirstAdrNode;
- // Current pointer equivalence class number
- unsigned PEClass;
- // Mapping from points-to sets to equivalence classes
- typedef DenseMap<SparseBitVector<> *, unsigned, BitmapKeyInfo> BitVectorMap;
- BitVectorMap Set2PEClass;
- // Mapping from pointer equivalences to the representative node. -1 if we
- // have no representative node for this pointer equivalence class yet.
- std::vector<int> PEClass2Node;
- // Mapping from pointer equivalences to representative node. This includes
- // pointer equivalent but not location equivalent variables. -1 if we have
- // no representative node for this pointer equivalence class yet.
- std::vector<int> PENLEClass2Node;
- // Union/Find for HCD
- std::vector<unsigned> HCDSCCRep;
- // HCD's offline-detected cycles; "Statically DeTected"
- // -1 if not part of such a cycle, otherwise a representative node.
- std::vector<int> SDT;
- // Whether to use SDT (UniteNodes can use it during solving, but not before)
- bool SDTActive;
-
- public:
- static char ID;
- Andersens() : ModulePass((intptr_t)&ID) {}
-
- bool runOnModule(Module &M) {
- InitializeAliasAnalysis(this);
- IdentifyObjects(M);
- CollectConstraints(M);
-#undef DEBUG_TYPE
-#define DEBUG_TYPE "anders-aa-constraints"
- DEBUG(PrintConstraints());
-#undef DEBUG_TYPE
-#define DEBUG_TYPE "anders-aa"
- SolveConstraints();
- DEBUG(PrintPointsToGraph());
-
- // Free the constraints list, as we don't need it to respond to alias
- // requests.
- std::vector<Constraint>().swap(Constraints);
- //These are needed for Print() (-analyze in opt)
- //ObjectNodes.clear();
- //ReturnNodes.clear();
- //VarargNodes.clear();
- return false;
- }
-
- void releaseMemory() {
- // FIXME: Until we have transitively required passes working correctly,
- // this cannot be enabled! Otherwise, using -count-aa with the pass
- // causes memory to be freed too early. :(
-#if 0
- // The memory objects and ValueNodes data structures at the only ones that
- // are still live after construction.
- std::vector<Node>().swap(GraphNodes);
- ValueNodes.clear();
-#endif
- }
-
- virtual void getAnalysisUsage(AnalysisUsage &AU) const {
- AliasAnalysis::getAnalysisUsage(AU);
- AU.setPreservesAll(); // Does not transform code
- }
-
- //------------------------------------------------
- // Implement the AliasAnalysis API
- //
- AliasResult alias(const Value *V1, unsigned V1Size,
- const Value *V2, unsigned V2Size);
- virtual ModRefResult getModRefInfo(CallSite CS, Value *P, unsigned Size);
- virtual ModRefResult getModRefInfo(CallSite CS1, CallSite CS2);
- void getMustAliases(Value *P, std::vector<Value*> &RetVals);
- bool pointsToConstantMemory(const Value *P);
-
- virtual void deleteValue(Value *V) {
- ValueNodes.erase(V);
- getAnalysis<AliasAnalysis>().deleteValue(V);
- }
-
- virtual void copyValue(Value *From, Value *To) {
- ValueNodes[To] = ValueNodes[From];
- getAnalysis<AliasAnalysis>().copyValue(From, To);
- }
-
- private:
- /// getNode - Return the node corresponding to the specified pointer scalar.
- ///
- unsigned getNode(Value *V) {
- if (Constant *C = dyn_cast<Constant>(V))
- if (!isa<GlobalValue>(C))
- return getNodeForConstantPointer(C);
-
- DenseMap<Value*, unsigned>::iterator I = ValueNodes.find(V);
- if (I == ValueNodes.end()) {
-#ifndef NDEBUG
- V->dump();
-#endif
- assert(0 && "Value does not have a node in the points-to graph!");
- }
- return I->second;
- }
-
- /// getObject - Return the node corresponding to the memory object for the
- /// specified global or allocation instruction.
- unsigned getObject(Value *V) const {
- DenseMap<Value*, unsigned>::iterator I = ObjectNodes.find(V);
- assert(I != ObjectNodes.end() &&
- "Value does not have an object in the points-to graph!");
- return I->second;
- }
-
- /// getReturnNode - Return the node representing the return value for the
- /// specified function.
- unsigned getReturnNode(Function *F) const {
- DenseMap<Function*, unsigned>::iterator I = ReturnNodes.find(F);
- assert(I != ReturnNodes.end() && "Function does not return a value!");
- return I->second;
- }
-
- /// getVarargNode - Return the node representing the variable arguments
- /// formal for the specified function.
- unsigned getVarargNode(Function *F) const {
- DenseMap<Function*, unsigned>::iterator I = VarargNodes.find(F);
- assert(I != VarargNodes.end() && "Function does not take var args!");
- return I->second;
- }
-
- /// getNodeValue - Get the node for the specified LLVM value and set the
- /// value for it to be the specified value.
- unsigned getNodeValue(Value &V) {
- unsigned Index = getNode(&V);
- GraphNodes[Index].setValue(&V);
- return Index;
- }
-
- unsigned UniteNodes(unsigned First, unsigned Second,
- bool UnionByRank = true);
- unsigned FindNode(unsigned Node);
- unsigned FindNode(unsigned Node) const;
-
- void IdentifyObjects(Module &M);
- void CollectConstraints(Module &M);
- bool AnalyzeUsesOfFunction(Value *);
- void CreateConstraintGraph();
- void OptimizeConstraints();
- unsigned FindEquivalentNode(unsigned, unsigned);
- void ClumpAddressTaken();
- void RewriteConstraints();
- void HU();
- void HVN();
- void HCD();
- void Search(unsigned Node);
- void UnitePointerEquivalences();
- void SolveConstraints();
- bool QueryNode(unsigned Node);
- void Condense(unsigned Node);
- void HUValNum(unsigned Node);
- void HVNValNum(unsigned Node);
- unsigned getNodeForConstantPointer(Constant *C);
- unsigned getNodeForConstantPointerTarget(Constant *C);
- void AddGlobalInitializerConstraints(unsigned, Constant *C);
-
- void AddConstraintsForNonInternalLinkage(Function *F);
- void AddConstraintsForCall(CallSite CS, Function *F);
- bool AddConstraintsForExternalCall(CallSite CS, Function *F);
-
-
- void PrintNode(const Node *N) const;
- void PrintConstraints() const ;
- void PrintConstraint(const Constraint &) const;
- void PrintLabels() const;
- void PrintPointsToGraph() const;
-
- //===------------------------------------------------------------------===//
- // Instruction visitation methods for adding constraints
- //
- friend class InstVisitor<Andersens>;
- void visitReturnInst(ReturnInst &RI);
- void visitInvokeInst(InvokeInst &II) { visitCallSite(CallSite(&II)); }
- void visitCallInst(CallInst &CI) { visitCallSite(CallSite(&CI)); }
- void visitCallSite(CallSite CS);
- void visitAllocationInst(AllocationInst &AI);
- void visitLoadInst(LoadInst &LI);
- void visitStoreInst(StoreInst &SI);
- void visitGetElementPtrInst(GetElementPtrInst &GEP);
- void visitPHINode(PHINode &PN);
- void visitCastInst(CastInst &CI);
- void visitICmpInst(ICmpInst &ICI) {} // NOOP!
- void visitFCmpInst(FCmpInst &ICI) {} // NOOP!
- void visitSelectInst(SelectInst &SI);
- void visitVAArg(VAArgInst &I);
- void visitInstruction(Instruction &I);
-
- //===------------------------------------------------------------------===//
- // Implement Analyize interface
- //
- void print(std::ostream &O, const Module* M) const {
- PrintPointsToGraph();
- }
- };
-
- char Andersens::ID = 0;
- RegisterPass<Andersens> X("anders-aa",
- "Andersen's Interprocedural Alias Analysis", false,
- true);
- RegisterAnalysisGroup<AliasAnalysis> Y(X);
-
- // Initialize Timestamp Counter (static).
- unsigned Andersens::Node::Counter = 0;
-}
-
-ModulePass *llvm::createAndersensPass() { return new Andersens(); }
-
-//===----------------------------------------------------------------------===//
-// AliasAnalysis Interface Implementation
-//===----------------------------------------------------------------------===//
-
-AliasAnalysis::AliasResult Andersens::alias(const Value *V1, unsigned V1Size,
- const Value *V2, unsigned V2Size) {
- Node *N1 = &GraphNodes[FindNode(getNode(const_cast<Value*>(V1)))];
- Node *N2 = &GraphNodes[FindNode(getNode(const_cast<Value*>(V2)))];
-
- // Check to see if the two pointers are known to not alias. They don't alias
- // if their points-to sets do not intersect.
- if (!N1->intersectsIgnoring(N2, NullObject))
- return NoAlias;
-
- return AliasAnalysis::alias(V1, V1Size, V2, V2Size);
-}
-
-AliasAnalysis::ModRefResult
-Andersens::getModRefInfo(CallSite CS, Value *P, unsigned Size) {
- // The only thing useful that we can contribute for mod/ref information is
- // when calling external function calls: if we know that memory never escapes
- // from the program, it cannot be modified by an external call.
- //
- // NOTE: This is not really safe, at least not when the entire program is not
- // available. The deal is that the external function could call back into the
- // program and modify stuff. We ignore this technical niggle for now. This
- // is, after all, a "research quality" implementation of Andersen's analysis.
- if (Function *F = CS.getCalledFunction())
- if (F->isDeclaration()) {
- Node *N1 = &GraphNodes[FindNode(getNode(P))];
-
- if (N1->PointsTo->empty())
- return NoModRef;
-#if FULL_UNIVERSAL
- if (!UniversalSet->PointsTo->test(FindNode(getNode(P))))
- return NoModRef; // Universal set does not contain P
-#else
- if (!N1->PointsTo->test(UniversalSet))
- return NoModRef; // P doesn't point to the universal set.
-#endif
- }
-
- return AliasAnalysis::getModRefInfo(CS, P, Size);
-}
-
-AliasAnalysis::ModRefResult
-Andersens::getModRefInfo(CallSite CS1, CallSite CS2) {
- return AliasAnalysis::getModRefInfo(CS1,CS2);
-}
-
-/// getMustAlias - We can provide must alias information if we know that a
-/// pointer can only point to a specific function or the null pointer.
-/// Unfortunately we cannot determine must-alias information for global
-/// variables or any other memory memory objects because we do not track whether
-/// a pointer points to the beginning of an object or a field of it.
-void Andersens::getMustAliases(Value *P, std::vector<Value*> &RetVals) {
- Node *N = &GraphNodes[FindNode(getNode(P))];
- if (N->PointsTo->count() == 1) {
- Node *Pointee = &GraphNodes[N->PointsTo->find_first()];
- // If a function is the only object in the points-to set, then it must be
- // the destination. Note that we can't handle global variables here,
- // because we don't know if the pointer is actually pointing to a field of
- // the global or to the beginning of it.
- if (Value *V = Pointee->getValue()) {
- if (Function *F = dyn_cast<Function>(V))
- RetVals.push_back(F);
- } else {
- // If the object in the points-to set is the null object, then the null
- // pointer is a must alias.
- if (Pointee == &GraphNodes[NullObject])
- RetVals.push_back(Constant::getNullValue(P->getType()));
- }
- }
- AliasAnalysis::getMustAliases(P, RetVals);
-}
-
-/// pointsToConstantMemory - If we can determine that this pointer only points
-/// to constant memory, return true. In practice, this means that if the
-/// pointer can only point to constant globals, functions, or the null pointer,
-/// return true.
-///
-bool Andersens::pointsToConstantMemory(const Value *P) {
- Node *N = &GraphNodes[FindNode(getNode(const_cast<Value*>(P)))];
- unsigned i;
-
- for (SparseBitVector<>::iterator bi = N->PointsTo->begin();
- bi != N->PointsTo->end();
- ++bi) {
- i = *bi;
- Node *Pointee = &GraphNodes[i];
- if (Value *V = Pointee->getValue()) {
- if (!isa<GlobalValue>(V) || (isa<GlobalVariable>(V) &&
- !cast<GlobalVariable>(V)->isConstant()))
- return AliasAnalysis::pointsToConstantMemory(P);
- } else {
- if (i != NullObject)
- return AliasAnalysis::pointsToConstantMemory(P);
- }
- }
-
- return true;
-}
-
-//===----------------------------------------------------------------------===//
-// Object Identification Phase
-//===----------------------------------------------------------------------===//
-
-/// IdentifyObjects - This stage scans the program, adding an entry to the
-/// GraphNodes list for each memory object in the program (global stack or
-/// heap), and populates the ValueNodes and ObjectNodes maps for these objects.
-///
-void Andersens::IdentifyObjects(Module &M) {
- unsigned NumObjects = 0;
-
- // Object #0 is always the universal set: the object that we don't know
- // anything about.
- assert(NumObjects == UniversalSet && "Something changed!");
- ++NumObjects;
-
- // Object #1 always represents the null pointer.
- assert(NumObjects == NullPtr && "Something changed!");
- ++NumObjects;
-
- // Object #2 always represents the null object (the object pointed to by null)
- assert(NumObjects == NullObject && "Something changed!");
- ++NumObjects;
-
- // Add all the globals first.
- for (Module::global_iterator I = M.global_begin(), E = M.global_end();
- I != E; ++I) {
- ObjectNodes[I] = NumObjects++;
- ValueNodes[I] = NumObjects++;
- }
-
- // Add nodes for all of the functions and the instructions inside of them.
- for (Module::iterator F = M.begin(), E = M.end(); F != E; ++F) {
- // The function itself is a memory object.
- unsigned First = NumObjects;
- ValueNodes[F] = NumObjects++;
- if (isa<PointerType>(F->getFunctionType()->getReturnType()))
- ReturnNodes[F] = NumObjects++;
- if (F->getFunctionType()->isVarArg())
- VarargNodes[F] = NumObjects++;
-
-
- // Add nodes for all of the incoming pointer arguments.
- for (Function::arg_iterator I = F->arg_begin(), E = F->arg_end();
- I != E; ++I)
- {
- if (isa<PointerType>(I->getType()))
- ValueNodes[I] = NumObjects++;
- }
- MaxK[First] = NumObjects - First;
-
- // Scan the function body, creating a memory object for each heap/stack
- // allocation in the body of the function and a node to represent all
- // pointer values defined by instructions and used as operands.
- for (inst_iterator II = inst_begin(F), E = inst_end(F); II != E; ++II) {
- // If this is an heap or stack allocation, create a node for the memory
- // object.
- if (isa<PointerType>(II->getType())) {
- ValueNodes[&*II] = NumObjects++;
- if (AllocationInst *AI = dyn_cast<AllocationInst>(&*II))
- ObjectNodes[AI] = NumObjects++;
- }
-
- // Calls to inline asm need to be added as well because the callee isn't
- // referenced anywhere else.
- if (CallInst *CI = dyn_cast<CallInst>(&*II)) {
- Value *Callee = CI->getCalledValue();
- if (isa<InlineAsm>(Callee))
- ValueNodes[Callee] = NumObjects++;
- }
- }
- }
-
- // Now that we know how many objects to create, make them all now!
- GraphNodes.resize(NumObjects);
- NumNodes += NumObjects;
-}
-
-//===----------------------------------------------------------------------===//
-// Constraint Identification Phase
-//===----------------------------------------------------------------------===//
-
-/// getNodeForConstantPointer - Return the node corresponding to the constant
-/// pointer itself.
-unsigned Andersens::getNodeForConstantPointer(Constant *C) {
- assert(isa<PointerType>(C->getType()) && "Not a constant pointer!");
-
- if (isa<ConstantPointerNull>(C) || isa<UndefValue>(C))
- return NullPtr;
- else if (GlobalValue *GV = dyn_cast<GlobalValue>(C))
- return getNode(GV);
- else if (ConstantExpr *CE = dyn_cast<ConstantExpr>(C)) {
- switch (CE->getOpcode()) {
- case Instruction::GetElementPtr:
- return getNodeForConstantPointer(CE->getOperand(0));
- case Instruction::IntToPtr:
- return UniversalSet;
- case Instruction::BitCast:
- return getNodeForConstantPointer(CE->getOperand(0));
- default:
- cerr << "Constant Expr not yet handled: " << *CE << "\n";
- assert(0);
- }
- } else {
- assert(0 && "Unknown constant pointer!");
- }
- return 0;
-}
-
-/// getNodeForConstantPointerTarget - Return the node POINTED TO by the
-/// specified constant pointer.
-unsigned Andersens::getNodeForConstantPointerTarget(Constant *C) {
- assert(isa<PointerType>(C->getType()) && "Not a constant pointer!");
-
- if (isa<ConstantPointerNull>(C))
- return NullObject;
- else if (GlobalValue *GV = dyn_cast<GlobalValue>(C))
- return getObject(GV);
- else if (ConstantExpr *CE = dyn_cast<ConstantExpr>(C)) {
- switch (CE->getOpcode()) {
- case Instruction::GetElementPtr:
- return getNodeForConstantPointerTarget(CE->getOperand(0));
- case Instruction::IntToPtr:
- return UniversalSet;
- case Instruction::BitCast:
- return getNodeForConstantPointerTarget(CE->getOperand(0));
- default:
- cerr << "Constant Expr not yet handled: " << *CE << "\n";
- assert(0);
- }
- } else {
- assert(0 && "Unknown constant pointer!");
- }
- return 0;
-}
-
-/// AddGlobalInitializerConstraints - Add inclusion constraints for the memory
-/// object N, which contains values indicated by C.
-void Andersens::AddGlobalInitializerConstraints(unsigned NodeIndex,
- Constant *C) {
- if (C->getType()->isFirstClassType()) {
- if (isa<PointerType>(C->getType()))
- Constraints.push_back(Constraint(Constraint::Copy, NodeIndex,
- getNodeForConstantPointer(C)));
- } else if (C->isNullValue()) {
- Constraints.push_back(Constraint(Constraint::Copy, NodeIndex,
- NullObject));
- return;
- } else if (!isa<UndefValue>(C)) {
- // If this is an array or struct, include constraints for each element.
- assert(isa<ConstantArray>(C) || isa<ConstantStruct>(C));
- for (unsigned i = 0, e = C->getNumOperands(); i != e; ++i)
- AddGlobalInitializerConstraints(NodeIndex,
- cast<Constant>(C->getOperand(i)));
- }
-}
-
-/// AddConstraintsForNonInternalLinkage - If this function does not have
-/// internal linkage, realize that we can't trust anything passed into or
-/// returned by this function.
-void Andersens::AddConstraintsForNonInternalLinkage(Function *F) {
- for (Function::arg_iterator I = F->arg_begin(), E = F->arg_end(); I != E; ++I)
- if (isa<PointerType>(I->getType()))
- // If this is an argument of an externally accessible function, the
- // incoming pointer might point to anything.
- Constraints.push_back(Constraint(Constraint::Copy, getNode(I),
- UniversalSet));
-}
-
-/// AddConstraintsForCall - If this is a call to a "known" function, add the
-/// constraints and return true. If this is a call to an unknown function,
-/// return false.
-bool Andersens::AddConstraintsForExternalCall(CallSite CS, Function *F) {
- assert(F->isDeclaration() && "Not an external function!");
-
- // These functions don't induce any points-to constraints.
- if (F->getName() == "atoi" || F->getName() == "atof" ||
- F->getName() == "atol" || F->getName() == "atoll" ||
- F->getName() == "remove" || F->getName() == "unlink" ||
- F->getName() == "rename" || F->getName() == "memcmp" ||
- F->getName() == "llvm.memset.i32" ||
- F->getName() == "llvm.memset.i64" ||
- F->getName() == "strcmp" || F->getName() == "strncmp" ||
- F->getName() == "execl" || F->getName() == "execlp" ||
- F->getName() == "execle" || F->getName() == "execv" ||
- F->getName() == "execvp" || F->getName() == "chmod" ||
- F->getName() == "puts" || F->getName() == "write" ||
- F->getName() == "open" || F->getName() == "create" ||
- F->getName() == "truncate" || F->getName() == "chdir" ||
- F->getName() == "mkdir" || F->getName() == "rmdir" ||
- F->getName() == "read" || F->getName() == "pipe" ||
- F->getName() == "wait" || F->getName() == "time" ||
- F->getName() == "stat" || F->getName() == "fstat" ||
- F->getName() == "lstat" || F->getName() == "strtod" ||
- F->getName() == "strtof" || F->getName() == "strtold" ||
- F->getName() == "fopen" || F->getName() == "fdopen" ||
- F->getName() == "freopen" ||
- F->getName() == "fflush" || F->getName() == "feof" ||
- F->getName() == "fileno" || F->getName() == "clearerr" ||
- F->getName() == "rewind" || F->getName() == "ftell" ||
- F->getName() == "ferror" || F->getName() == "fgetc" ||
- F->getName() == "fgetc" || F->getName() == "_IO_getc" ||
- F->getName() == "fwrite" || F->getName() == "fread" ||
- F->getName() == "fgets" || F->getName() == "ungetc" ||
- F->getName() == "fputc" ||
- F->getName() == "fputs" || F->getName() == "putc" ||
- F->getName() == "ftell" || F->getName() == "rewind" ||
- F->getName() == "_IO_putc" || F->getName() == "fseek" ||
- F->getName() == "fgetpos" || F->getName() == "fsetpos" ||
- F->getName() == "printf" || F->getName() == "fprintf" ||
- F->getName() == "sprintf" || F->getName() == "vprintf" ||
- F->getName() == "vfprintf" || F->getName() == "vsprintf" ||
- F->getName() == "scanf" || F->getName() == "fscanf" ||
- F->getName() == "sscanf" || F->getName() == "__assert_fail" ||
- F->getName() == "modf")
- return true;
-
-
- // These functions do induce points-to edges.
- if (F->getName() == "llvm.memcpy.i32" || F->getName() == "llvm.memcpy.i64" ||
- F->getName() == "llvm.memmove.i32" ||F->getName() == "llvm.memmove.i64" ||
- F->getName() == "memmove") {
-
- // *Dest = *Src, which requires an artificial graph node to represent the
- // constraint. It is broken up into *Dest = temp, temp = *Src
- unsigned FirstArg = getNode(CS.getArgument(0));
- unsigned SecondArg = getNode(CS.getArgument(1));
- unsigned TempArg = GraphNodes.size();
- GraphNodes.push_back(Node());
- Constraints.push_back(Constraint(Constraint::Store,
- FirstArg, TempArg));
- Constraints.push_back(Constraint(Constraint::Load,
- TempArg, SecondArg));
- // In addition, Dest = Src
- Constraints.push_back(Constraint(Constraint::Copy,
- FirstArg, SecondArg));
- return true;
- }
-
- // Result = Arg0
- if (F->getName() == "realloc" || F->getName() == "strchr" ||
- F->getName() == "strrchr" || F->getName() == "strstr" ||
- F->getName() == "strtok") {
- Constraints.push_back(Constraint(Constraint::Copy,
- getNode(CS.getInstruction()),
- getNode(CS.getArgument(0))));
- return true;
- }
-
- return false;
-}
-
-
-
-/// AnalyzeUsesOfFunction - Look at all of the users of the specified function.
-/// If this is used by anything complex (i.e., the address escapes), return
-/// true.
-bool Andersens::AnalyzeUsesOfFunction(Value *V) {
-
- if (!isa<PointerType>(V->getType())) return true;
-
- for (Value::use_iterator UI = V->use_begin(), E = V->use_end(); UI != E; ++UI)
- if (dyn_cast<LoadInst>(*UI)) {
- return false;
- } else if (StoreInst *SI = dyn_cast<StoreInst>(*UI)) {
- if (V == SI->getOperand(1)) {
- return false;
- } else if (SI->getOperand(1)) {
- return true; // Storing the pointer
- }
- } else if (GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(*UI)) {
- if (AnalyzeUsesOfFunction(GEP)) return true;
- } else if (CallInst *CI = dyn_cast<CallInst>(*UI)) {
- // Make sure that this is just the function being called, not that it is
- // passing into the function.
- for (unsigned i = 1, e = CI->getNumOperands(); i != e; ++i)
- if (CI->getOperand(i) == V) return true;
- } else if (InvokeInst *II = dyn_cast<InvokeInst>(*UI)) {
- // Make sure that this is just the function being called, not that it is
- // passing into the function.
- for (unsigned i = 3, e = II->getNumOperands(); i != e; ++i)
- if (II->getOperand(i) == V) return true;
- } else if (ConstantExpr *CE = dyn_cast<ConstantExpr>(*UI)) {
- if (CE->getOpcode() == Instruction::GetElementPtr ||
- CE->getOpcode() == Instruction::BitCast) {
- if (AnalyzeUsesOfFunction(CE))
- return true;
- } else {
- return true;
- }
- } else if (ICmpInst *ICI = dyn_cast<ICmpInst>(*UI)) {
- if (!isa<ConstantPointerNull>(ICI->getOperand(1)))
- return true; // Allow comparison against null.
- } else if (dyn_cast<FreeInst>(*UI)) {
- return false;
- } else {
- return true;
- }
- return false;
-}
-
-/// CollectConstraints - This stage scans the program, adding a constraint to
-/// the Constraints list for each instruction in the program that induces a
-/// constraint, and setting up the initial points-to graph.
-///
-void Andersens::CollectConstraints(Module &M) {
- // First, the universal set points to itself.
- Constraints.push_back(Constraint(Constraint::AddressOf, UniversalSet,
- UniversalSet));
- Constraints.push_back(Constraint(Constraint::Store, UniversalSet,
- UniversalSet));
-
- // Next, the null pointer points to the null object.
- Constraints.push_back(Constraint(Constraint::AddressOf, NullPtr, NullObject));
-
- // Next, add any constraints on global variables and their initializers.
- for (Module::global_iterator I = M.global_begin(), E = M.global_end();
- I != E; ++I) {
- // Associate the address of the global object as pointing to the memory for
- // the global: &G = <G memory>
- unsigned ObjectIndex = getObject(I);
- Node *Object = &GraphNodes[ObjectIndex];
- Object->setValue(I);
- Constraints.push_back(Constraint(Constraint::AddressOf, getNodeValue(*I),
- ObjectIndex));
-
- if (I->hasInitializer()) {
- AddGlobalInitializerConstraints(ObjectIndex, I->getInitializer());
- } else {
- // If it doesn't have an initializer (i.e. it's defined in another
- // translation unit), it points to the universal set.
- Constraints.push_back(Constraint(Constraint::Copy, ObjectIndex,
- UniversalSet));
- }
- }
-
- for (Module::iterator F = M.begin(), E = M.end(); F != E; ++F) {
- // Set up the return value node.
- if (isa<PointerType>(F->getFunctionType()->getReturnType()))
- GraphNodes[getReturnNode(F)].setValue(F);
- if (F->getFunctionType()->isVarArg())
- GraphNodes[getVarargNode(F)].setValue(F);
-
- // Set up incoming argument nodes.
- for (Function::arg_iterator I = F->arg_begin(), E = F->arg_end();
- I != E; ++I)
- if (isa<PointerType>(I->getType()))
- getNodeValue(*I);
-
- // At some point we should just add constraints for the escaping functions
- // at solve time, but this slows down solving. For now, we simply mark
- // address taken functions as escaping and treat them as external.
- if (!F->hasInternalLinkage() || AnalyzeUsesOfFunction(F))
- AddConstraintsForNonInternalLinkage(F);
-
- if (!F->isDeclaration()) {
- // Scan the function body, creating a memory object for each heap/stack
- // allocation in the body of the function and a node to represent all
- // pointer values defined by instructions and used as operands.
- visit(F);
- } else {
- // External functions that return pointers return the universal set.
- if (isa<PointerType>(F->getFunctionType()->getReturnType()))
- Constraints.push_back(Constraint(Constraint::Copy,
- getReturnNode(F),
- UniversalSet));
-
- // Any pointers that are passed into the function have the universal set
- // stored into them.
- for (Function::arg_iterator I = F->arg_begin(), E = F->arg_end();
- I != E; ++I)
- if (isa<PointerType>(I->getType())) {
- // Pointers passed into external functions could have anything stored
- // through them.
- Constraints.push_back(Constraint(Constraint::Store, getNode(I),
- UniversalSet));
- // Memory objects passed into external function calls can have the
- // universal set point to them.
-#if FULL_UNIVERSAL
- Constraints.push_back(Constraint(Constraint::Copy,
- UniversalSet,
- getNode(I)));
-#else
- Constraints.push_back(Constraint(Constraint::Copy,
- getNode(I),
- UniversalSet));
-#endif
- }
-
- // If this is an external varargs function, it can also store pointers
- // into any pointers passed through the varargs section.
- if (F->getFunctionType()->isVarArg())
- Constraints.push_back(Constraint(Constraint::Store, getVarargNode(F),
- UniversalSet));
- }
- }
- NumConstraints += Constraints.size();
-}
-
-
-void Andersens::visitInstruction(Instruction &I) {
-#ifdef NDEBUG
- return; // This function is just a big assert.
-#endif
- if (isa<BinaryOperator>(I))
- return;
- // Most instructions don't have any effect on pointer values.
- switch (I.getOpcode()) {
- case Instruction::Br:
- case Instruction::Switch:
- case Instruction::Unwind:
- case Instruction::Unreachable:
- case Instruction::Free:
- case Instruction::ICmp:
- case Instruction::FCmp:
- return;
- default:
- // Is this something we aren't handling yet?
- cerr << "Unknown instruction: " << I;
- abort();
- }
-}
-
-void Andersens::visitAllocationInst(AllocationInst &AI) {
- unsigned ObjectIndex = getObject(&AI);
- GraphNodes[ObjectIndex].setValue(&AI);
- Constraints.push_back(Constraint(Constraint::AddressOf, getNodeValue(AI),
- ObjectIndex));
-}
-
-void Andersens::visitReturnInst(ReturnInst &RI) {
- if (RI.getNumOperands() && isa<PointerType>(RI.getOperand(0)->getType()))
- // return V --> <Copy/retval{F}/v>
- Constraints.push_back(Constraint(Constraint::Copy,
- getReturnNode(RI.getParent()->getParent()),
- getNode(RI.getOperand(0))));
-}
-
-void Andersens::visitLoadInst(LoadInst &LI) {
- if (isa<PointerType>(LI.getType()))
- // P1 = load P2 --> <Load/P1/P2>
- Constraints.push_back(Constraint(Constraint::Load, getNodeValue(LI),
- getNode(LI.getOperand(0))));
-}
-
-void Andersens::visitStoreInst(StoreInst &SI) {
- if (isa<PointerType>(SI.getOperand(0)->getType()))
- // store P1, P2 --> <Store/P2/P1>
- Constraints.push_back(Constraint(Constraint::Store,
- getNode(SI.getOperand(1)),
- getNode(SI.getOperand(0))));
-}
-
-void Andersens::visitGetElementPtrInst(GetElementPtrInst &GEP) {
- // P1 = getelementptr P2, ... --> <Copy/P1/P2>
- Constraints.push_back(Constraint(Constraint::Copy, getNodeValue(GEP),
- getNode(GEP.getOperand(0))));
-}
-
-void Andersens::visitPHINode(PHINode &PN) {
- if (isa<PointerType>(PN.getType())) {
- unsigned PNN = getNodeValue(PN);
- for (unsigned i = 0, e = PN.getNumIncomingValues(); i != e; ++i)
- // P1 = phi P2, P3 --> <Copy/P1/P2>, <Copy/P1/P3>, ...
- Constraints.push_back(Constraint(Constraint::Copy, PNN,
- getNode(PN.getIncomingValue(i))));
- }
-}
-
-void Andersens::visitCastInst(CastInst &CI) {
- Value *Op = CI.getOperand(0);
- if (isa<PointerType>(CI.getType())) {
- if (isa<PointerType>(Op->getType())) {
- // P1 = cast P2 --> <Copy/P1/P2>
- Constraints.push_back(Constraint(Constraint::Copy, getNodeValue(CI),
- getNode(CI.getOperand(0))));
- } else {
- // P1 = cast int --> <Copy/P1/Univ>
-#if 0
- Constraints.push_back(Constraint(Constraint::Copy, getNodeValue(CI),
- UniversalSet));
-#else
- getNodeValue(CI);
-#endif
- }
- } else if (isa<PointerType>(Op->getType())) {
- // int = cast P1 --> <Copy/Univ/P1>
-#if 0
- Constraints.push_back(Constraint(Constraint::Copy,
- UniversalSet,
- getNode(CI.getOperand(0))));
-#else
- getNode(CI.getOperand(0));
-#endif
- }
-}
-
-void Andersens::visitSelectInst(SelectInst &SI) {
- if (isa<PointerType>(SI.getType())) {
- unsigned SIN = getNodeValue(SI);
- // P1 = select C, P2, P3 ---> <Copy/P1/P2>, <Copy/P1/P3>
- Constraints.push_back(Constraint(Constraint::Copy, SIN,
- getNode(SI.getOperand(1))));
- Constraints.push_back(Constraint(Constraint::Copy, SIN,
- getNode(SI.getOperand(2))));
- }
-}
-
-void Andersens::visitVAArg(VAArgInst &I) {
- assert(0 && "vaarg not handled yet!");
-}
-
-/// AddConstraintsForCall - Add constraints for a call with actual arguments
-/// specified by CS to the function specified by F. Note that the types of
-/// arguments might not match up in the case where this is an indirect call and
-/// the function pointer has been casted. If this is the case, do something
-/// reasonable.
-void Andersens::AddConstraintsForCall(CallSite CS, Function *F) {
- Value *CallValue = CS.getCalledValue();
- bool IsDeref = F == NULL;
-
- // If this is a call to an external function, try to handle it directly to get
- // some taste of context sensitivity.
- if (F && F->isDeclaration() && AddConstraintsForExternalCall(CS, F))
- return;
-
- if (isa<PointerType>(CS.getType())) {
- unsigned CSN = getNode(CS.getInstruction());
- if (!F || isa<PointerType>(F->getFunctionType()->getReturnType())) {
- if (IsDeref)
- Constraints.push_back(Constraint(Constraint::Load, CSN,
- getNode(CallValue), CallReturnPos));
- else
- Constraints.push_back(Constraint(Constraint::Copy, CSN,
- getNode(CallValue) + CallReturnPos));
- } else {
- // If the function returns a non-pointer value, handle this just like we
- // treat a nonpointer cast to pointer.
- Constraints.push_back(Constraint(Constraint::Copy, CSN,
- UniversalSet));
- }
- } else if (F && isa<PointerType>(F->getFunctionType()->getReturnType())) {
-#if FULL_UNIVERSAL
- Constraints.push_back(Constraint(Constraint::Copy,
- UniversalSet,
- getNode(CallValue) + CallReturnPos));
-#else
- Constraints.push_back(Constraint(Constraint::Copy,
- getNode(CallValue) + CallReturnPos,
- UniversalSet));
-#endif
-
-
- }
-
- CallSite::arg_iterator ArgI = CS.arg_begin(), ArgE = CS.arg_end();
- bool external = !F || F->isDeclaration();
- if (F) {
- // Direct Call
- Function::arg_iterator AI = F->arg_begin(), AE = F->arg_end();
- for (; AI != AE && ArgI != ArgE; ++AI, ++ArgI)
- {
-#if !FULL_UNIVERSAL
- if (external && isa<PointerType>((*ArgI)->getType()))
- {
- // Add constraint that ArgI can now point to anything due to
- // escaping, as can everything it points to. The second portion of
- // this should be taken care of by universal = *universal
- Constraints.push_back(Constraint(Constraint::Copy,
- getNode(*ArgI),
- UniversalSet));
- }
-#endif
- if (isa<PointerType>(AI->getType())) {
- if (isa<PointerType>((*ArgI)->getType())) {
- // Copy the actual argument into the formal argument.
- Constraints.push_back(Constraint(Constraint::Copy, getNode(AI),
- getNode(*ArgI)));
- } else {
- Constraints.push_back(Constraint(Constraint::Copy, getNode(AI),
- UniversalSet));
- }
- } else if (isa<PointerType>((*ArgI)->getType())) {
-#if FULL_UNIVERSAL
- Constraints.push_back(Constraint(Constraint::Copy,
- UniversalSet,
- getNode(*ArgI)));
-#else
- Constraints.push_back(Constraint(Constraint::Copy,
- getNode(*ArgI),
- UniversalSet));
-#endif
- }
- }
- } else {
- //Indirect Call
- unsigned ArgPos = CallFirstArgPos;
- for (; ArgI != ArgE; ++ArgI) {
- if (isa<PointerType>((*ArgI)->getType())) {
- // Copy the actual argument into the formal argument.
- Constraints.push_back(Constraint(Constraint::Store,
- getNode(CallValue),
- getNode(*ArgI), ArgPos++));
- } else {
- Constraints.push_back(Constraint(Constraint::Store,
- getNode (CallValue),
- UniversalSet, ArgPos++));
- }
- }
- }
- // Copy all pointers passed through the varargs section to the varargs node.
- if (F && F->getFunctionType()->isVarArg())
- for (; ArgI != ArgE; ++ArgI)
- if (isa<PointerType>((*ArgI)->getType()))
- Constraints.push_back(Constraint(Constraint::Copy, getVarargNode(F),
- getNode(*ArgI)));
- // If more arguments are passed in than we track, just drop them on the floor.
-}
-
-void Andersens::visitCallSite(CallSite CS) {
- if (isa<PointerType>(CS.getType()))
- getNodeValue(*CS.getInstruction());
-
- if (Function *F = CS.getCalledFunction()) {
- AddConstraintsForCall(CS, F);
- } else {
- AddConstraintsForCall(CS, NULL);
- }
-}
-
-//===----------------------------------------------------------------------===//
-// Constraint Solving Phase
-//===----------------------------------------------------------------------===//
-
-/// intersects - Return true if the points-to set of this node intersects
-/// with the points-to set of the specified node.
-bool Andersens::Node::intersects(Node *N) const {
- return PointsTo->intersects(N->PointsTo);
-}
-
-/// intersectsIgnoring - Return true if the points-to set of this node
-/// intersects with the points-to set of the specified node on any nodes
-/// except for the specified node to ignore.
-bool Andersens::Node::intersectsIgnoring(Node *N, unsigned Ignoring) const {
- // TODO: If we are only going to call this with the same value for Ignoring,
- // we should move the special values out of the points-to bitmap.
- bool WeHadIt = PointsTo->test(Ignoring);
- bool NHadIt = N->PointsTo->test(Ignoring);
- bool Result = false;
- if (WeHadIt)
- PointsTo->reset(Ignoring);
- if (NHadIt)
- N->PointsTo->reset(Ignoring);
- Result = PointsTo->intersects(N->PointsTo);
- if (WeHadIt)
- PointsTo->set(Ignoring);
- if (NHadIt)
- N->PointsTo->set(Ignoring);
- return Result;
-}
-
-void dumpToDOUT(SparseBitVector<> *bitmap) {
-#ifndef NDEBUG
- dump(*bitmap, DOUT);
-#endif
-}
-
-
-/// Clump together address taken variables so that the points-to sets use up
-/// less space and can be operated on faster.
-
-void Andersens::ClumpAddressTaken() {
-#undef DEBUG_TYPE
-#define DEBUG_TYPE "anders-aa-renumber"
- std::vector<unsigned> Translate;
- std::vector<Node> NewGraphNodes;
-
- Translate.resize(GraphNodes.size());
- unsigned NewPos = 0;
-
- for (unsigned i = 0; i < Constraints.size(); ++i) {
- Constraint &C = Constraints[i];
- if (C.Type == Constraint::AddressOf) {
- GraphNodes[C.Src].AddressTaken = true;
- }
- }
- for (unsigned i = 0; i < NumberSpecialNodes; ++i) {
- unsigned Pos = NewPos++;
- Translate[i] = Pos;
- NewGraphNodes.push_back(GraphNodes[i]);
- DOUT << "Renumbering node " << i << " to node " << Pos << "\n";
- }
-
- // I believe this ends up being faster than making two vectors and splicing
- // them.
- for (unsigned i = NumberSpecialNodes; i < GraphNodes.size(); ++i) {
- if (GraphNodes[i].AddressTaken) {
- unsigned Pos = NewPos++;
- Translate[i] = Pos;
- NewGraphNodes.push_back(GraphNodes[i]);
- DOUT << "Renumbering node " << i << " to node " << Pos << "\n";
- }
- }
-
- for (unsigned i = NumberSpecialNodes; i < GraphNodes.size(); ++i) {
- if (!GraphNodes[i].AddressTaken) {
- unsigned Pos = NewPos++;
- Translate[i] = Pos;
- NewGraphNodes.push_back(GraphNodes[i]);
- DOUT << "Renumbering node " << i << " to node " << Pos << "\n";
- }
- }
-
- for (DenseMap<Value*, unsigned>::iterator Iter = ValueNodes.begin();
- Iter != ValueNodes.end();
- ++Iter)
- Iter->second = Translate[Iter->second];
-
- for (DenseMap<Value*, unsigned>::iterator Iter = ObjectNodes.begin();
- Iter != ObjectNodes.end();
- ++Iter)
- Iter->second = Translate[Iter->second];
-
- for (DenseMap<Function*, unsigned>::iterator Iter = ReturnNodes.begin();
- Iter != ReturnNodes.end();
- ++Iter)
- Iter->second = Translate[Iter->second];
-
- for (DenseMap<Function*, unsigned>::iterator Iter = VarargNodes.begin();
- Iter != VarargNodes.end();
- ++Iter)
- Iter->second = Translate[Iter->second];
-
- for (unsigned i = 0; i < Constraints.size(); ++i) {
- Constraint &C = Constraints[i];
- C.Src = Translate[C.Src];
- C.Dest = Translate[C.Dest];
- }
-
- GraphNodes.swap(NewGraphNodes);
-#undef DEBUG_TYPE
-#define DEBUG_TYPE "anders-aa"
-}
-
-/// The technique used here is described in "Exploiting Pointer and Location
-/// Equivalence to Optimize Pointer Analysis. In the 14th International Static
-/// Analysis Symposium (SAS), August 2007." It is known as the "HVN" algorithm,
-/// and is equivalent to value numbering the collapsed constraint graph without
-/// evaluating unions. This is used as a pre-pass to HU in order to resolve
-/// first order pointer dereferences and speed up/reduce memory usage of HU.
-/// Running both is equivalent to HRU without the iteration
-/// HVN in more detail:
-/// Imagine the set of constraints was simply straight line code with no loops
-/// (we eliminate cycles, so there are no loops), such as:
-/// E = &D
-/// E = &C
-/// E = F
-/// F = G
-/// G = F
-/// Applying value numbering to this code tells us:
-/// G == F == E
-///
-/// For HVN, this is as far as it goes. We assign new value numbers to every
-/// "address node", and every "reference node".
-/// To get the optimal result for this, we use a DFS + SCC (since all nodes in a
-/// cycle must have the same value number since the = operation is really
-/// inclusion, not overwrite), and value number nodes we receive points-to sets
-/// before we value our own node.
-/// The advantage of HU over HVN is that HU considers the inclusion property, so
-/// that if you have
-/// E = &D
-/// E = &C
-/// E = F
-/// F = G
-/// F = &D
-/// G = F
-/// HU will determine that G == F == E. HVN will not, because it cannot prove
-/// that the points to information ends up being the same because they all
-/// receive &D from E anyway.
-
-void Andersens::HVN() {
- DOUT << "Beginning HVN\n";
- // Build a predecessor graph. This is like our constraint graph with the
- // edges going in the opposite direction, and there are edges for all the
- // constraints, instead of just copy constraints. We also build implicit
- // edges for constraints are implied but not explicit. I.E for the constraint
- // a = &b, we add implicit edges *a = b. This helps us capture more cycles
- for (unsigned i = 0, e = Constraints.size(); i != e; ++i) {
- Constraint &C = Constraints[i];
- if (C.Type == Constraint::AddressOf) {
- GraphNodes[C.Src].AddressTaken = true;
- GraphNodes[C.Src].Direct = false;
-
- // Dest = &src edge
- unsigned AdrNode = C.Src + FirstAdrNode;
- if (!GraphNodes[C.Dest].PredEdges)
- GraphNodes[C.Dest].PredEdges = new SparseBitVector<>;
- GraphNodes[C.Dest].PredEdges->set(AdrNode);
-
- // *Dest = src edge
- unsigned RefNode = C.Dest + FirstRefNode;
- if (!GraphNodes[RefNode].ImplicitPredEdges)
- GraphNodes[RefNode].ImplicitPredEdges = new SparseBitVector<>;
- GraphNodes[RefNode].ImplicitPredEdges->set(C.Src);
- } else if (C.Type == Constraint::Load) {
- if (C.Offset == 0) {
- // dest = *src edge
- if (!GraphNodes[C.Dest].PredEdges)
- GraphNodes[C.Dest].PredEdges = new SparseBitVector<>;
- GraphNodes[C.Dest].PredEdges->set(C.Src + FirstRefNode);
- } else {
- GraphNodes[C.Dest].Direct = false;
- }
- } else if (C.Type == Constraint::Store) {
- if (C.Offset == 0) {
- // *dest = src edge
- unsigned RefNode = C.Dest + FirstRefNode;
- if (!GraphNodes[RefNode].PredEdges)
- GraphNodes[RefNode].PredEdges = new SparseBitVector<>;
- GraphNodes[RefNode].PredEdges->set(C.Src);
- }
- } else {
- // Dest = Src edge and *Dest = *Src edge
- if (!GraphNodes[C.Dest].PredEdges)
- GraphNodes[C.Dest].PredEdges = new SparseBitVector<>;
- GraphNodes[C.Dest].PredEdges->set(C.Src);
- unsigned RefNode = C.Dest + FirstRefNode;
- if (!GraphNodes[RefNode].ImplicitPredEdges)
- GraphNodes[RefNode].ImplicitPredEdges = new SparseBitVector<>;
- GraphNodes[RefNode].ImplicitPredEdges->set(C.Src + FirstRefNode);
- }
- }
- PEClass = 1;
- // Do SCC finding first to condense our predecessor graph
- DFSNumber = 0;
- Node2DFS.insert(Node2DFS.begin(), GraphNodes.size(), 0);
- Node2Deleted.insert(Node2Deleted.begin(), GraphNodes.size(), false);
- Node2Visited.insert(Node2Visited.begin(), GraphNodes.size(), false);
-
- for (unsigned i = 0; i < FirstRefNode; ++i) {
- unsigned Node = VSSCCRep[i];
- if (!Node2Visited[Node])
- HVNValNum(Node);
- }
- for (BitVectorMap::iterator Iter = Set2PEClass.begin();
- Iter != Set2PEClass.end();
- ++Iter)
- delete Iter->first;
- Set2PEClass.clear();
- Node2DFS.clear();
- Node2Deleted.clear();
- Node2Visited.clear();
- DOUT << "Finished HVN\n";
-
-}
-
-/// This is the workhorse of HVN value numbering. We combine SCC finding at the
-/// same time because it's easy.
-void Andersens::HVNValNum(unsigned NodeIndex) {
- unsigned MyDFS = DFSNumber++;
- Node *N = &GraphNodes[NodeIndex];
- Node2Visited[NodeIndex] = true;
- Node2DFS[NodeIndex] = MyDFS;
-
- // First process all our explicit edges
- if (N->PredEdges)
- for (SparseBitVector<>::iterator Iter = N->PredEdges->begin();
- Iter != N->PredEdges->end();
- ++Iter) {
- unsigned j = VSSCCRep[*Iter];
- if (!Node2Deleted[j]) {
- if (!Node2Visited[j])
- HVNValNum(j);
- if (Node2DFS[NodeIndex] > Node2DFS[j])
- Node2DFS[NodeIndex] = Node2DFS[j];
- }
- }
-
- // Now process all the implicit edges
- if (N->ImplicitPredEdges)
- for (SparseBitVector<>::iterator Iter = N->ImplicitPredEdges->begin();
- Iter != N->ImplicitPredEdges->end();
- ++Iter) {
- unsigned j = VSSCCRep[*Iter];
- if (!Node2Deleted[j]) {
- if (!Node2Visited[j])
- HVNValNum(j);
- if (Node2DFS[NodeIndex] > Node2DFS[j])
- Node2DFS[NodeIndex] = Node2DFS[j];
- }
- }
-
- // See if we found any cycles
- if (MyDFS == Node2DFS[NodeIndex]) {
- while (!SCCStack.empty() && Node2DFS[SCCStack.top()] >= MyDFS) {
- unsigned CycleNodeIndex = SCCStack.top();
- Node *CycleNode = &GraphNodes[CycleNodeIndex];
- VSSCCRep[CycleNodeIndex] = NodeIndex;
- // Unify the nodes
- N->Direct &= CycleNode->Direct;
-
- if (CycleNode->PredEdges) {
- if (!N->PredEdges)
- N->PredEdges = new SparseBitVector<>;
- *(N->PredEdges) |= CycleNode->PredEdges;
- delete CycleNode->PredEdges;
- CycleNode->PredEdges = NULL;
- }
- if (CycleNode->ImplicitPredEdges) {
- if (!N->ImplicitPredEdges)
- N->ImplicitPredEdges = new SparseBitVector<>;
- *(N->ImplicitPredEdges) |= CycleNode->ImplicitPredEdges;
- delete CycleNode->ImplicitPredEdges;
- CycleNode->ImplicitPredEdges = NULL;
- }
-
- SCCStack.pop();
- }
-
- Node2Deleted[NodeIndex] = true;
-
- if (!N->Direct) {
- GraphNodes[NodeIndex].PointerEquivLabel = PEClass++;
- return;
- }
-
- // Collect labels of successor nodes
- bool AllSame = true;
- unsigned First = ~0;
- SparseBitVector<> *Labels = new SparseBitVector<>;
- bool Used = false;
-
- if (N->PredEdges)
- for (SparseBitVector<>::iterator Iter = N->PredEdges->begin();
- Iter != N->PredEdges->end();
- ++Iter) {
- unsigned j = VSSCCRep[*Iter];
- unsigned Label = GraphNodes[j].PointerEquivLabel;
- // Ignore labels that are equal to us or non-pointers
- if (j == NodeIndex || Label == 0)
- continue;
- if (First == (unsigned)~0)
- First = Label;
- else if (First != Label)
- AllSame = false;
- Labels->set(Label);
- }
-
- // We either have a non-pointer, a copy of an existing node, or a new node.
- // Assign the appropriate pointer equivalence label.
- if (Labels->empty()) {
- GraphNodes[NodeIndex].PointerEquivLabel = 0;
- } else if (AllSame) {
- GraphNodes[NodeIndex].PointerEquivLabel = First;
- } else {
- GraphNodes[NodeIndex].PointerEquivLabel = Set2PEClass[Labels];
- if (GraphNodes[NodeIndex].PointerEquivLabel == 0) {
- unsigned EquivClass = PEClass++;
- Set2PEClass[Labels] = EquivClass;
- GraphNodes[NodeIndex].PointerEquivLabel = EquivClass;
- Used = true;
- }
- }
- if (!Used)
- delete Labels;
- } else {
- SCCStack.push(NodeIndex);
- }
-}
-
-/// The technique used here is described in "Exploiting Pointer and Location
-/// Equivalence to Optimize Pointer Analysis. In the 14th International Static
-/// Analysis Symposium (SAS), August 2007." It is known as the "HU" algorithm,
-/// and is equivalent to value numbering the collapsed constraint graph
-/// including evaluating unions.
-void Andersens::HU() {
- DOUT << "Beginning HU\n";
- // Build a predecessor graph. This is like our constraint graph with the
- // edges going in the opposite direction, and there are edges for all the
- // constraints, instead of just copy constraints. We also build implicit
- // edges for constraints are implied but not explicit. I.E for the constraint
- // a = &b, we add implicit edges *a = b. This helps us capture more cycles
- for (unsigned i = 0, e = Constraints.size(); i != e; ++i) {
- Constraint &C = Constraints[i];
- if (C.Type == Constraint::AddressOf) {
- GraphNodes[C.Src].AddressTaken = true;
- GraphNodes[C.Src].Direct = false;
-
- GraphNodes[C.Dest].PointsTo->set(C.Src);
- // *Dest = src edge
- unsigned RefNode = C.Dest + FirstRefNode;
- if (!GraphNodes[RefNode].ImplicitPredEdges)
- GraphNodes[RefNode].ImplicitPredEdges = new SparseBitVector<>;
- GraphNodes[RefNode].ImplicitPredEdges->set(C.Src);
- GraphNodes[C.Src].PointedToBy->set(C.Dest);
- } else if (C.Type == Constraint::Load) {
- if (C.Offset == 0) {
- // dest = *src edge
- if (!GraphNodes[C.Dest].PredEdges)
- GraphNodes[C.Dest].PredEdges = new SparseBitVector<>;
- GraphNodes[C.Dest].PredEdges->set(C.Src + FirstRefNode);
- } else {
- GraphNodes[C.Dest].Direct = false;
- }
- } else if (C.Type == Constraint::Store) {
- if (C.Offset == 0) {
- // *dest = src edge
- unsigned RefNode = C.Dest + FirstRefNode;
- if (!GraphNodes[RefNode].PredEdges)
- GraphNodes[RefNode].PredEdges = new SparseBitVector<>;
- GraphNodes[RefNode].PredEdges->set(C.Src);
- }
- } else {
- // Dest = Src edge and *Dest = *Src edg
- if (!GraphNodes[C.Dest].PredEdges)
- GraphNodes[C.Dest].PredEdges = new SparseBitVector<>;
- GraphNodes[C.Dest].PredEdges->set(C.Src);
- unsigned RefNode = C.Dest + FirstRefNode;
- if (!GraphNodes[RefNode].ImplicitPredEdges)
- GraphNodes[RefNode].ImplicitPredEdges = new SparseBitVector<>;
- GraphNodes[RefNode].ImplicitPredEdges->set(C.Src + FirstRefNode);
- }
- }
- PEClass = 1;
- // Do SCC finding first to condense our predecessor graph
- DFSNumber = 0;
- Node2DFS.insert(Node2DFS.begin(), GraphNodes.size(), 0);
- Node2Deleted.insert(Node2Deleted.begin(), GraphNodes.size(), false);
- Node2Visited.insert(Node2Visited.begin(), GraphNodes.size(), false);
-
- for (unsigned i = 0; i < FirstRefNode; ++i) {
- if (FindNode(i) == i) {
- unsigned Node = VSSCCRep[i];
- if (!Node2Visited[Node])
- Condense(Node);
- }
- }
-
- // Reset tables for actual labeling
- Node2DFS.clear();
- Node2Visited.clear();
- Node2Deleted.clear();
- // Pre-grow our densemap so that we don't get really bad behavior
- Set2PEClass.resize(GraphNodes.size());
-
- // Visit the condensed graph and generate pointer equivalence labels.
- Node2Visited.insert(Node2Visited.begin(), GraphNodes.size(), false);
- for (unsigned i = 0; i < FirstRefNode; ++i) {
- if (FindNode(i) == i) {
- unsigned Node = VSSCCRep[i];
- if (!Node2Visited[Node])
- HUValNum(Node);
- }
- }
- // PEClass nodes will be deleted by the deleting of N->PointsTo in our caller.
- Set2PEClass.clear();
- DOUT << "Finished HU\n";
-}
-
-
-/// Implementation of standard Tarjan SCC algorithm as modified by Nuutilla.
-void Andersens::Condense(unsigned NodeIndex) {
- unsigned MyDFS = DFSNumber++;
- Node *N = &GraphNodes[NodeIndex];
- Node2Visited[NodeIndex] = true;
- Node2DFS[NodeIndex] = MyDFS;
-
- // First process all our explicit edges
- if (N->PredEdges)
- for (SparseBitVector<>::iterator Iter = N->PredEdges->begin();
- Iter != N->PredEdges->end();
- ++Iter) {
- unsigned j = VSSCCRep[*Iter];
- if (!Node2Deleted[j]) {
- if (!Node2Visited[j])
- Condense(j);
- if (Node2DFS[NodeIndex] > Node2DFS[j])
- Node2DFS[NodeIndex] = Node2DFS[j];
- }
- }
-
- // Now process all the implicit edges
- if (N->ImplicitPredEdges)
- for (SparseBitVector<>::iterator Iter = N->ImplicitPredEdges->begin();
- Iter != N->ImplicitPredEdges->end();
- ++Iter) {
- unsigned j = VSSCCRep[*Iter];
- if (!Node2Deleted[j]) {
- if (!Node2Visited[j])
- Condense(j);
- if (Node2DFS[NodeIndex] > Node2DFS[j])
- Node2DFS[NodeIndex] = Node2DFS[j];
- }
- }
-
- // See if we found any cycles
- if (MyDFS == Node2DFS[NodeIndex]) {
- while (!SCCStack.empty() && Node2DFS[SCCStack.top()] >= MyDFS) {
- unsigned CycleNodeIndex = SCCStack.top();
- Node *CycleNode = &GraphNodes[CycleNodeIndex];
- VSSCCRep[CycleNodeIndex] = NodeIndex;
- // Unify the nodes
- N->Direct &= CycleNode->Direct;
-
- *(N->PointsTo) |= CycleNode->PointsTo;
- delete CycleNode->PointsTo;
- CycleNode->PointsTo = NULL;
- if (CycleNode->PredEdges) {
- if (!N->PredEdges)
- N->PredEdges = new SparseBitVector<>;
- *(N->PredEdges) |= CycleNode->PredEdges;
- delete CycleNode->PredEdges;
- CycleNode->PredEdges = NULL;
- }
- if (CycleNode->ImplicitPredEdges) {
- if (!N->ImplicitPredEdges)
- N->ImplicitPredEdges = new SparseBitVector<>;
- *(N->ImplicitPredEdges) |= CycleNode->ImplicitPredEdges;
- delete CycleNode->ImplicitPredEdges;
- CycleNode->ImplicitPredEdges = NULL;
- }
- SCCStack.pop();
- }
-
- Node2Deleted[NodeIndex] = true;
-
- // Set up number of incoming edges for other nodes
- if (N->PredEdges)
- for (SparseBitVector<>::iterator Iter = N->PredEdges->begin();
- Iter != N->PredEdges->end();
- ++Iter)
- ++GraphNodes[VSSCCRep[*Iter]].NumInEdges;
- } else {
- SCCStack.push(NodeIndex);
- }
-}
-
-void Andersens::HUValNum(unsigned NodeIndex) {
- Node *N = &GraphNodes[NodeIndex];
- Node2Visited[NodeIndex] = true;
-
- // Eliminate dereferences of non-pointers for those non-pointers we have
- // already identified. These are ref nodes whose non-ref node:
- // 1. Has already been visited determined to point to nothing (and thus, a
- // dereference of it must point to nothing)
- // 2. Any direct node with no predecessor edges in our graph and with no
- // points-to set (since it can't point to anything either, being that it
- // receives no points-to sets and has none).
- if (NodeIndex >= FirstRefNode) {
- unsigned j = VSSCCRep[FindNode(NodeIndex - FirstRefNode)];
- if ((Node2Visited[j] && !GraphNodes[j].PointerEquivLabel)
- || (GraphNodes[j].Direct && !GraphNodes[j].PredEdges
- && GraphNodes[j].PointsTo->empty())){
- return;
- }
- }
- // Process all our explicit edges
- if (N->PredEdges)
- for (SparseBitVector<>::iterator Iter = N->PredEdges->begin();
- Iter != N->PredEdges->end();
- ++Iter) {
- unsigned j = VSSCCRep[*Iter];
- if (!Node2Visited[j])
- HUValNum(j);
-
- // If this edge turned out to be the same as us, or got no pointer
- // equivalence label (and thus points to nothing) , just decrement our
- // incoming edges and continue.
- if (j == NodeIndex || GraphNodes[j].PointerEquivLabel == 0) {
- --GraphNodes[j].NumInEdges;
- continue;
- }
-
- *(N->PointsTo) |= GraphNodes[j].PointsTo;
-
- // If we didn't end up storing this in the hash, and we're done with all
- // the edges, we don't need the points-to set anymore.
- --GraphNodes[j].NumInEdges;
- if (!GraphNodes[j].NumInEdges && !GraphNodes[j].StoredInHash) {
- delete GraphNodes[j].PointsTo;
- GraphNodes[j].PointsTo = NULL;
- }
- }
- // If this isn't a direct node, generate a fresh variable.
- if (!N->Direct) {
- N->PointsTo->set(FirstRefNode + NodeIndex);
- }
-
- // See If we have something equivalent to us, if not, generate a new
- // equivalence class.
- if (N->PointsTo->empty()) {
- delete N->PointsTo;
- N->PointsTo = NULL;
- } else {
- if (N->Direct) {
- N->PointerEquivLabel = Set2PEClass[N->PointsTo];
- if (N->PointerEquivLabel == 0) {
- unsigned EquivClass = PEClass++;
- N->StoredInHash = true;
- Set2PEClass[N->PointsTo] = EquivClass;
- N->PointerEquivLabel = EquivClass;
- }
- } else {
- N->PointerEquivLabel = PEClass++;
- }
- }
-}
-
-/// Rewrite our list of constraints so that pointer equivalent nodes are
-/// replaced by their the pointer equivalence class representative.
-void Andersens::RewriteConstraints() {
- std::vector<Constraint> NewConstraints;
- DenseSet<Constraint, ConstraintKeyInfo> Seen;
-
- PEClass2Node.clear();
- PENLEClass2Node.clear();
-
- // We may have from 1 to Graphnodes + 1 equivalence classes.
- PEClass2Node.insert(PEClass2Node.begin(), GraphNodes.size() + 1, -1);
- PENLEClass2Node.insert(PENLEClass2Node.begin(), GraphNodes.size() + 1, -1);
-
- // Rewrite constraints, ignoring non-pointer constraints, uniting equivalent
- // nodes, and rewriting constraints to use the representative nodes.
- for (unsigned i = 0, e = Constraints.size(); i != e; ++i) {
- Constraint &C = Constraints[i];
- unsigned RHSNode = FindNode(C.Src);
- unsigned LHSNode = FindNode(C.Dest);
- unsigned RHSLabel = GraphNodes[VSSCCRep[RHSNode]].PointerEquivLabel;
- unsigned LHSLabel = GraphNodes[VSSCCRep[LHSNode]].PointerEquivLabel;
-
- // First we try to eliminate constraints for things we can prove don't point
- // to anything.
- if (LHSLabel == 0) {
- DEBUG(PrintNode(&GraphNodes[LHSNode]));
- DOUT << " is a non-pointer, ignoring constraint.\n";
- continue;
- }
- if (RHSLabel == 0) {
- DEBUG(PrintNode(&GraphNodes[RHSNode]));
- DOUT << " is a non-pointer, ignoring constraint.\n";
- continue;
- }
- // This constraint may be useless, and it may become useless as we translate
- // it.
- if (C.Src == C.Dest && C.Type == Constraint::Copy)
- continue;
-
- C.Src = FindEquivalentNode(RHSNode, RHSLabel);
- C.Dest = FindEquivalentNode(FindNode(LHSNode), LHSLabel);
- if ((C.Src == C.Dest && C.Type == Constraint::Copy)
- || Seen.count(C))
- continue;
-
- Seen.insert(C);
- NewConstraints.push_back(C);
- }
- Constraints.swap(NewConstraints);
- PEClass2Node.clear();
-}
-
-/// See if we have a node that is pointer equivalent to the one being asked
-/// about, and if so, unite them and return the equivalent node. Otherwise,
-/// return the original node.
-unsigned Andersens::FindEquivalentNode(unsigned NodeIndex,
- unsigned NodeLabel) {
- if (!GraphNodes[NodeIndex].AddressTaken) {
- if (PEClass2Node[NodeLabel] != -1) {
- // We found an existing node with the same pointer label, so unify them.
- // We specifically request that Union-By-Rank not be used so that
- // PEClass2Node[NodeLabel] U= NodeIndex and not the other way around.
- return UniteNodes(PEClass2Node[NodeLabel], NodeIndex, false);
- } else {
- PEClass2Node[NodeLabel] = NodeIndex;
- PENLEClass2Node[NodeLabel] = NodeIndex;
- }
- } else if (PENLEClass2Node[NodeLabel] == -1) {
- PENLEClass2Node[NodeLabel] = NodeIndex;
- }
-
- return NodeIndex;
-}
-
-void Andersens::PrintLabels() const {
- for (unsigned i = 0; i < GraphNodes.size(); ++i) {
- if (i < FirstRefNode) {
- PrintNode(&GraphNodes[i]);
- } else if (i < FirstAdrNode) {
- DOUT << "REF(";
- PrintNode(&GraphNodes[i-FirstRefNode]);
- DOUT <<")";
- } else {
- DOUT << "ADR(";
- PrintNode(&GraphNodes[i-FirstAdrNode]);
- DOUT <<")";
- }
-
- DOUT << " has pointer label " << GraphNodes[i].PointerEquivLabel
- << " and SCC rep " << VSSCCRep[i]
- << " and is " << (GraphNodes[i].Direct ? "Direct" : "Not direct")
- << "\n";
- }
-}
-
-/// The technique used here is described in "The Ant and the
-/// Grasshopper: Fast and Accurate Pointer Analysis for Millions of
-/// Lines of Code. In Programming Language Design and Implementation
-/// (PLDI), June 2007." It is known as the "HCD" (Hybrid Cycle
-/// Detection) algorithm. It is called a hybrid because it performs an
-/// offline analysis and uses its results during the solving (online)
-/// phase. This is just the offline portion; the results of this
-/// operation are stored in SDT and are later used in SolveContraints()
-/// and UniteNodes().
-void Andersens::HCD() {
- DOUT << "Starting HCD.\n";
- HCDSCCRep.resize(GraphNodes.size());
-
- for (unsigned i = 0; i < GraphNodes.size(); ++i) {
- GraphNodes[i].Edges = new SparseBitVector<>;
- HCDSCCRep[i] = i;
- }
-
- for (unsigned i = 0, e = Constraints.size(); i != e; ++i) {
- Constraint &C = Constraints[i];
- assert (C.Src < GraphNodes.size() && C.Dest < GraphNodes.size());
- if (C.Type == Constraint::AddressOf) {
- continue;
- } else if (C.Type == Constraint::Load) {
- if( C.Offset == 0 )
- GraphNodes[C.Dest].Edges->set(C.Src + FirstRefNode);
- } else if (C.Type == Constraint::Store) {
- if( C.Offset == 0 )
- GraphNodes[C.Dest + FirstRefNode].Edges->set(C.Src);
- } else {
- GraphNodes[C.Dest].Edges->set(C.Src);
- }
- }
-
- Node2DFS.insert(Node2DFS.begin(), GraphNodes.size(), 0);
- Node2Deleted.insert(Node2Deleted.begin(), GraphNodes.size(), false);
- Node2Visited.insert(Node2Visited.begin(), GraphNodes.size(), false);
- SDT.insert(SDT.begin(), GraphNodes.size() / 2, -1);
-
- DFSNumber = 0;
- for (unsigned i = 0; i < GraphNodes.size(); ++i) {
- unsigned Node = HCDSCCRep[i];
- if (!Node2Deleted[Node])
- Search(Node);
- }
-
- for (unsigned i = 0; i < GraphNodes.size(); ++i)
- if (GraphNodes[i].Edges != NULL) {
- delete GraphNodes[i].Edges;
- GraphNodes[i].Edges = NULL;
- }
-
- while( !SCCStack.empty() )
- SCCStack.pop();
-
- Node2DFS.clear();
- Node2Visited.clear();
- Node2Deleted.clear();
- HCDSCCRep.clear();
- DOUT << "HCD complete.\n";
-}
-
-// Component of HCD:
-// Use Nuutila's variant of Tarjan's algorithm to detect
-// Strongly-Connected Components (SCCs). For non-trivial SCCs
-// containing ref nodes, insert the appropriate information in SDT.
-void Andersens::Search(unsigned Node) {
- unsigned MyDFS = DFSNumber++;
-
- Node2Visited[Node] = true;
- Node2DFS[Node] = MyDFS;
-
- for (SparseBitVector<>::iterator Iter = GraphNodes[Node].Edges->begin(),
- End = GraphNodes[Node].Edges->end();
- Iter != End;
- ++Iter) {
- unsigned J = HCDSCCRep[*Iter];
- assert(GraphNodes[J].isRep() && "Debug check; must be representative");
- if (!Node2Deleted[J]) {
- if (!Node2Visited[J])
- Search(J);
- if (Node2DFS[Node] > Node2DFS[J])
- Node2DFS[Node] = Node2DFS[J];
- }
- }
-
- if( MyDFS != Node2DFS[Node] ) {
- SCCStack.push(Node);
- return;
- }
-
- // This node is the root of a SCC, so process it.
- //
- // If the SCC is "non-trivial" (not a singleton) and contains a reference
- // node, we place this SCC into SDT. We unite the nodes in any case.
- if (!SCCStack.empty() && Node2DFS[SCCStack.top()] >= MyDFS) {
- SparseBitVector<> SCC;
-
- SCC.set(Node);
-
- bool Ref = (Node >= FirstRefNode);
-
- Node2Deleted[Node] = true;
-
- do {
- unsigned P = SCCStack.top(); SCCStack.pop();
- Ref |= (P >= FirstRefNode);
- SCC.set(P);
- HCDSCCRep[P] = Node;
- } while (!SCCStack.empty() && Node2DFS[SCCStack.top()] >= MyDFS);
-
- if (Ref) {
- unsigned Rep = SCC.find_first();
- assert(Rep < FirstRefNode && "The SCC didn't have a non-Ref node!");
-
- SparseBitVector<>::iterator i = SCC.begin();
-
- // Skip over the non-ref nodes
- while( *i < FirstRefNode )
- ++i;
-
- while( i != SCC.end() )
- SDT[ (*i++) - FirstRefNode ] = Rep;
- }
- }
-}
-
-
-/// Optimize the constraints by performing offline variable substitution and
-/// other optimizations.
-void Andersens::OptimizeConstraints() {
- DOUT << "Beginning constraint optimization\n";
-
- SDTActive = false;
-
- // Function related nodes need to stay in the same relative position and can't
- // be location equivalent.
- for (std::map<unsigned, unsigned>::iterator Iter = MaxK.begin();
- Iter != MaxK.end();
- ++Iter) {
- for (unsigned i = Iter->first;
- i != Iter->first + Iter->second;
- ++i) {
- GraphNodes[i].AddressTaken = true;
- GraphNodes[i].Direct = false;
- }
- }
-
- ClumpAddressTaken();
- FirstRefNode = GraphNodes.size();
- FirstAdrNode = FirstRefNode + GraphNodes.size();
- GraphNodes.insert(GraphNodes.end(), 2 * GraphNodes.size(),
- Node(false));
- VSSCCRep.resize(GraphNodes.size());
- for (unsigned i = 0; i < GraphNodes.size(); ++i) {
- VSSCCRep[i] = i;
- }
- HVN();
- for (unsigned i = 0; i < GraphNodes.size(); ++i) {
- Node *N = &GraphNodes[i];
- delete N->PredEdges;
- N->PredEdges = NULL;
- delete N->ImplicitPredEdges;
- N->ImplicitPredEdges = NULL;
- }
-#undef DEBUG_TYPE
-#define DEBUG_TYPE "anders-aa-labels"
- DEBUG(PrintLabels());
-#undef DEBUG_TYPE
-#define DEBUG_TYPE "anders-aa"
- RewriteConstraints();
- // Delete the adr nodes.
- GraphNodes.resize(FirstRefNode * 2);
-
- // Now perform HU
- for (unsigned i = 0; i < GraphNodes.size(); ++i) {
- Node *N = &GraphNodes[i];
- if (FindNode(i) == i) {
- N->PointsTo = new SparseBitVector<>;
- N->PointedToBy = new SparseBitVector<>;
- // Reset our labels
- }
- VSSCCRep[i] = i;
- N->PointerEquivLabel = 0;
- }
- HU();
-#undef DEBUG_TYPE
-#define DEBUG_TYPE "anders-aa-labels"
- DEBUG(PrintLabels());
-#undef DEBUG_TYPE
-#define DEBUG_TYPE "anders-aa"
- RewriteConstraints();
- for (unsigned i = 0; i < GraphNodes.size(); ++i) {
- if (FindNode(i) == i) {
- Node *N = &GraphNodes[i];
- delete N->PointsTo;
- N->PointsTo = NULL;
- delete N->PredEdges;
- N->PredEdges = NULL;
- delete N->ImplicitPredEdges;
- N->ImplicitPredEdges = NULL;
- delete N->PointedToBy;
- N->PointedToBy = NULL;
- }
- }
-
- // perform Hybrid Cycle Detection (HCD)
- HCD();
- SDTActive = true;
-
- // No longer any need for the upper half of GraphNodes (for ref nodes).
- GraphNodes.erase(GraphNodes.begin() + FirstRefNode, GraphNodes.end());
-
- // HCD complete.
-
- DOUT << "Finished constraint optimization\n";
- FirstRefNode = 0;
- FirstAdrNode = 0;
-}
-
-/// Unite pointer but not location equivalent variables, now that the constraint
-/// graph is built.
-void Andersens::UnitePointerEquivalences() {
- DOUT << "Uniting remaining pointer equivalences\n";
- for (unsigned i = 0; i < GraphNodes.size(); ++i) {
- if (GraphNodes[i].AddressTaken && GraphNodes[i].isRep()) {
- unsigned Label = GraphNodes[i].PointerEquivLabel;
-
- if (Label && PENLEClass2Node[Label] != -1)
- UniteNodes(i, PENLEClass2Node[Label]);
- }
- }
- DOUT << "Finished remaining pointer equivalences\n";
- PENLEClass2Node.clear();
-}
-
-/// Create the constraint graph used for solving points-to analysis.
-///
-void Andersens::CreateConstraintGraph() {
- for (unsigned i = 0, e = Constraints.size(); i != e; ++i) {
- Constraint &C = Constraints[i];
- assert (C.Src < GraphNodes.size() && C.Dest < GraphNodes.size());
- if (C.Type == Constraint::AddressOf)
- GraphNodes[C.Dest].PointsTo->set(C.Src);
- else if (C.Type == Constraint::Load)
- GraphNodes[C.Src].Constraints.push_back(C);
- else if (C.Type == Constraint::Store)
- GraphNodes[C.Dest].Constraints.push_back(C);
- else if (C.Offset != 0)
- GraphNodes[C.Src].Constraints.push_back(C);
- else
- GraphNodes[C.Src].Edges->set(C.Dest);
- }
-}
-
-// Perform DFS and cycle detection.
-bool Andersens::QueryNode(unsigned Node) {
- assert(GraphNodes[Node].isRep() && "Querying a non-rep node");
- unsigned OurDFS = ++DFSNumber;
- SparseBitVector<> ToErase;
- SparseBitVector<> NewEdges;
- Tarjan2DFS[Node] = OurDFS;
-
- // Changed denotes a change from a recursive call that we will bubble up.
- // Merged is set if we actually merge a node ourselves.
- bool Changed = false, Merged = false;
-
- for (SparseBitVector<>::iterator bi = GraphNodes[Node].Edges->begin();
- bi != GraphNodes[Node].Edges->end();
- ++bi) {
- unsigned RepNode = FindNode(*bi);
- // If this edge points to a non-representative node but we are
- // already planning to add an edge to its representative, we have no
- // need for this edge anymore.
- if (RepNode != *bi && NewEdges.test(RepNode)){
- ToErase.set(*bi);
- continue;
- }
-
- // Continue about our DFS.
- if (!Tarjan2Deleted[RepNode]){
- if (Tarjan2DFS[RepNode] == 0) {
- Changed |= QueryNode(RepNode);
- // May have been changed by QueryNode
- RepNode = FindNode(RepNode);
- }
- if (Tarjan2DFS[RepNode] < Tarjan2DFS[Node])
- Tarjan2DFS[Node] = Tarjan2DFS[RepNode];
- }
-
- // We may have just discovered that this node is part of a cycle, in
- // which case we can also erase it.
- if (RepNode != *bi) {
- ToErase.set(*bi);
- NewEdges.set(RepNode);
- }
- }
-
- GraphNodes[Node].Edges->intersectWithComplement(ToErase);
- GraphNodes[Node].Edges |= NewEdges;
-
- // If this node is a root of a non-trivial SCC, place it on our
- // worklist to be processed.
- if (OurDFS == Tarjan2DFS[Node]) {
- while (!SCCStack.empty() && Tarjan2DFS[SCCStack.top()] >= OurDFS) {
- Node = UniteNodes(Node, SCCStack.top());
-
- SCCStack.pop();
- Merged = true;
- }
- Tarjan2Deleted[Node] = true;
-
- if (Merged)
- NextWL->insert(&GraphNodes[Node]);
- } else {
- SCCStack.push(Node);
- }
-
- return(Changed | Merged);
-}
-
-/// SolveConstraints - This stage iteratively processes the constraints list
-/// propagating constraints (adding edges to the Nodes in the points-to graph)
-/// until a fixed point is reached.
-///
-/// We use a variant of the technique called "Lazy Cycle Detection", which is
-/// described in "The Ant and the Grasshopper: Fast and Accurate Pointer
-/// Analysis for Millions of Lines of Code. In Programming Language Design and
-/// Implementation (PLDI), June 2007."
-/// The paper describes performing cycle detection one node at a time, which can
-/// be expensive if there are no cycles, but there are long chains of nodes that
-/// it heuristically believes are cycles (because it will DFS from each node
-/// without state from previous nodes).
-/// Instead, we use the heuristic to build a worklist of nodes to check, then
-/// cycle detect them all at the same time to do this more cheaply. This
-/// catches cycles slightly later than the original technique did, but does it
-/// make significantly cheaper.
-
-void Andersens::SolveConstraints() {
- CurrWL = &w1;
- NextWL = &w2;
-
- OptimizeConstraints();
-#undef DEBUG_TYPE
-#define DEBUG_TYPE "anders-aa-constraints"
- DEBUG(PrintConstraints());
-#undef DEBUG_TYPE
-#define DEBUG_TYPE "anders-aa"
-
- for (unsigned i = 0; i < GraphNodes.size(); ++i) {
- Node *N = &GraphNodes[i];
- N->PointsTo = new SparseBitVector<>;
- N->OldPointsTo = new SparseBitVector<>;
- N->Edges = new SparseBitVector<>;
- }
- CreateConstraintGraph();
- UnitePointerEquivalences();
- assert(SCCStack.empty() && "SCC Stack should be empty by now!");
- Node2DFS.clear();
- Node2Deleted.clear();
- Node2DFS.insert(Node2DFS.begin(), GraphNodes.size(), 0);
- Node2Deleted.insert(Node2Deleted.begin(), GraphNodes.size(), false);
- DFSNumber = 0;
- DenseSet<Constraint, ConstraintKeyInfo> Seen;
- DenseSet<std::pair<unsigned,unsigned>, PairKeyInfo> EdgesChecked;
-
- // Order graph and add initial nodes to work list.
- for (unsigned i = 0; i < GraphNodes.size(); ++i) {
- Node *INode = &GraphNodes[i];
-
- // Add to work list if it's a representative and can contribute to the
- // calculation right now.
- if (INode->isRep() && !INode->PointsTo->empty()
- && (!INode->Edges->empty() || !INode->Constraints.empty())) {
- INode->Stamp();
- CurrWL->insert(INode);
- }
- }
- std::queue<unsigned int> TarjanWL;
-#if !FULL_UNIVERSAL
- // "Rep and special variables" - in order for HCD to maintain conservative
- // results when !FULL_UNIVERSAL, we need to treat the special variables in
- // the same way that the !FULL_UNIVERSAL tweak does throughout the rest of
- // the analysis - it's ok to add edges from the special nodes, but never
- // *to* the special nodes.
- std::vector<unsigned int> RSV;
-#endif
- while( !CurrWL->empty() ) {
- DOUT << "Starting iteration #" << ++NumIters << "\n";
-
- Node* CurrNode;
- unsigned CurrNodeIndex;
-
- // Actual cycle checking code. We cycle check all of the lazy cycle
- // candidates from the last iteration in one go.
- if (!TarjanWL.empty()) {
- DFSNumber = 0;
-
- Tarjan2DFS.clear();
- Tarjan2Deleted.clear();
- while (!TarjanWL.empty()) {
- unsigned int ToTarjan = TarjanWL.front();
- TarjanWL.pop();
- if (!Tarjan2Deleted[ToTarjan]
- && GraphNodes[ToTarjan].isRep()
- && Tarjan2DFS[ToTarjan] == 0)
- QueryNode(ToTarjan);
- }
- }
-
- // Add to work list if it's a representative and can contribute to the
- // calculation right now.
- while( (CurrNode = CurrWL->pop()) != NULL ) {
- CurrNodeIndex = CurrNode - &GraphNodes[0];
- CurrNode->Stamp();
-
-
- // Figure out the changed points to bits
- SparseBitVector<> CurrPointsTo;
- CurrPointsTo.intersectWithComplement(CurrNode->PointsTo,
- CurrNode->OldPointsTo);
- if (CurrPointsTo.empty())
- continue;
-
- *(CurrNode->OldPointsTo) |= CurrPointsTo;
-
- // Check the offline-computed equivalencies from HCD.
- bool SCC = false;
- unsigned Rep;
-
- if (SDT[CurrNodeIndex] >= 0) {
- SCC = true;
- Rep = FindNode(SDT[CurrNodeIndex]);
-
-#if !FULL_UNIVERSAL
- RSV.clear();
-#endif
- for (SparseBitVector<>::iterator bi = CurrPointsTo.begin();
- bi != CurrPointsTo.end(); ++bi) {
- unsigned Node = FindNode(*bi);
-#if !FULL_UNIVERSAL
- if (Node < NumberSpecialNodes) {
- RSV.push_back(Node);
- continue;
- }
-#endif
- Rep = UniteNodes(Rep,Node);
- }
-#if !FULL_UNIVERSAL
- RSV.push_back(Rep);
-#endif
-
- NextWL->insert(&GraphNodes[Rep]);
-
- if ( ! CurrNode->isRep() )
- continue;
- }
-
- Seen.clear();
-
- /* Now process the constraints for this node. */
- for (std::list<Constraint>::iterator li = CurrNode->Constraints.begin();
- li != CurrNode->Constraints.end(); ) {
- li->Src = FindNode(li->Src);
- li->Dest = FindNode(li->Dest);
-
- // Delete redundant constraints
- if( Seen.count(*li) ) {
- std::list<Constraint>::iterator lk = li; li++;
-
- CurrNode->Constraints.erase(lk);
- ++NumErased;
- continue;
- }
- Seen.insert(*li);
-
- // Src and Dest will be the vars we are going to process.
- // This may look a bit ugly, but what it does is allow us to process
- // both store and load constraints with the same code.
- // Load constraints say that every member of our RHS solution has K
- // added to it, and that variable gets an edge to LHS. We also union
- // RHS+K's solution into the LHS solution.
- // Store constraints say that every member of our LHS solution has K
- // added to it, and that variable gets an edge from RHS. We also union
- // RHS's solution into the LHS+K solution.
- unsigned *Src;
- unsigned *Dest;
- unsigned K = li->Offset;
- unsigned CurrMember;
- if (li->Type == Constraint::Load) {
- Src = &CurrMember;
- Dest = &li->Dest;
- } else if (li->Type == Constraint::Store) {
- Src = &li->Src;
- Dest = &CurrMember;
- } else {
- // TODO Handle offseted copy constraint
- li++;
- continue;
- }
-
- // See if we can use Hybrid Cycle Detection (that is, check
- // if it was a statically detected offline equivalence that
- // involves pointers; if so, remove the redundant constraints).
- if( SCC && K == 0 ) {
-#if FULL_UNIVERSAL
- CurrMember = Rep;
-
- if (GraphNodes[*Src].Edges->test_and_set(*Dest))
- if (GraphNodes[*Dest].PointsTo |= *(GraphNodes[*Src].PointsTo))
- NextWL->insert(&GraphNodes[*Dest]);
-#else
- for (unsigned i=0; i < RSV.size(); ++i) {
- CurrMember = RSV[i];
-
- if (*Dest < NumberSpecialNodes)
- continue;
- if (GraphNodes[*Src].Edges->test_and_set(*Dest))
- if (GraphNodes[*Dest].PointsTo |= *(GraphNodes[*Src].PointsTo))
- NextWL->insert(&GraphNodes[*Dest]);
- }
-#endif
- // since all future elements of the points-to set will be
- // equivalent to the current ones, the complex constraints
- // become redundant.
- //
- std::list<Constraint>::iterator lk = li; li++;
-#if !FULL_UNIVERSAL
- // In this case, we can still erase the constraints when the
- // elements of the points-to sets are referenced by *Dest,
- // but not when they are referenced by *Src (i.e. for a Load
- // constraint). This is because if another special variable is
- // put into the points-to set later, we still need to add the
- // new edge from that special variable.
- if( lk->Type != Constraint::Load)
-#endif
- GraphNodes[CurrNodeIndex].Constraints.erase(lk);
- } else {
- const SparseBitVector<> &Solution = CurrPointsTo;
-
- for (SparseBitVector<>::iterator bi = Solution.begin();
- bi != Solution.end();
- ++bi) {
- CurrMember = *bi;
-
- // Need to increment the member by K since that is where we are
- // supposed to copy to/from. Note that in positive weight cycles,
- // which occur in address taking of fields, K can go past
- // MaxK[CurrMember] elements, even though that is all it could point
- // to.
- if (K > 0 && K > MaxK[CurrMember])
- continue;
- else
- CurrMember = FindNode(CurrMember + K);
-
- // Add an edge to the graph, so we can just do regular
- // bitmap ior next time. It may also let us notice a cycle.
-#if !FULL_UNIVERSAL
- if (*Dest < NumberSpecialNodes)
- continue;
-#endif
- if (GraphNodes[*Src].Edges->test_and_set(*Dest))
- if (GraphNodes[*Dest].PointsTo |= *(GraphNodes[*Src].PointsTo))
- NextWL->insert(&GraphNodes[*Dest]);
-
- }
- li++;
- }
- }
- SparseBitVector<> NewEdges;
- SparseBitVector<> ToErase;
-
- // Now all we have left to do is propagate points-to info along the
- // edges, erasing the redundant edges.
- for (SparseBitVector<>::iterator bi = CurrNode->Edges->begin();
- bi != CurrNode->Edges->end();
- ++bi) {
-
- unsigned DestVar = *bi;
- unsigned Rep = FindNode(DestVar);
-
- // If we ended up with this node as our destination, or we've already
- // got an edge for the representative, delete the current edge.
- if (Rep == CurrNodeIndex ||
- (Rep != DestVar && NewEdges.test(Rep))) {
- ToErase.set(DestVar);
- continue;
- }
-
- std::pair<unsigned,unsigned> edge(CurrNodeIndex,Rep);
-
- // This is where we do lazy cycle detection.
- // If this is a cycle candidate (equal points-to sets and this
- // particular edge has not been cycle-checked previously), add to the
- // list to check for cycles on the next iteration.
- if (!EdgesChecked.count(edge) &&
- *(GraphNodes[Rep].PointsTo) == *(CurrNode->PointsTo)) {
- EdgesChecked.insert(edge);
- TarjanWL.push(Rep);
- }
- // Union the points-to sets into the dest
-#if !FULL_UNIVERSAL
- if (Rep >= NumberSpecialNodes)
-#endif
- if (GraphNodes[Rep].PointsTo |= CurrPointsTo) {
- NextWL->insert(&GraphNodes[Rep]);
- }
- // If this edge's destination was collapsed, rewrite the edge.
- if (Rep != DestVar) {
- ToErase.set(DestVar);
- NewEdges.set(Rep);
- }
- }
- CurrNode->Edges->intersectWithComplement(ToErase);
- CurrNode->Edges |= NewEdges;
- }
-
- // Switch to other work list.
- WorkList* t = CurrWL; CurrWL = NextWL; NextWL = t;
- }
-
-
- Node2DFS.clear();
- Node2Deleted.clear();
- for (unsigned i = 0; i < GraphNodes.size(); ++i) {
- Node *N = &GraphNodes[i];
- delete N->OldPointsTo;
- delete N->Edges;
- }
- SDTActive = false;
- SDT.clear();
-}
-
-//===----------------------------------------------------------------------===//
-// Union-Find
-//===----------------------------------------------------------------------===//
-
-// Unite nodes First and Second, returning the one which is now the
-// representative node. First and Second are indexes into GraphNodes
-unsigned Andersens::UniteNodes(unsigned First, unsigned Second,
- bool UnionByRank) {
- assert (First < GraphNodes.size() && Second < GraphNodes.size() &&
- "Attempting to merge nodes that don't exist");
-
- Node *FirstNode = &GraphNodes[First];
- Node *SecondNode = &GraphNodes[Second];
-
- assert (SecondNode->isRep() && FirstNode->isRep() &&
- "Trying to unite two non-representative nodes!");
- if (First == Second)
- return First;
-
- if (UnionByRank) {
- int RankFirst = (int) FirstNode ->NodeRep;
- int RankSecond = (int) SecondNode->NodeRep;
-
- // Rank starts at -1 and gets decremented as it increases.
- // Translation: higher rank, lower NodeRep value, which is always negative.
- if (RankFirst > RankSecond) {
- unsigned t = First; First = Second; Second = t;
- Node* tp = FirstNode; FirstNode = SecondNode; SecondNode = tp;
- } else if (RankFirst == RankSecond) {
- FirstNode->NodeRep = (unsigned) (RankFirst - 1);
- }
- }
-
- SecondNode->NodeRep = First;
-#if !FULL_UNIVERSAL
- if (First >= NumberSpecialNodes)
-#endif
- if (FirstNode->PointsTo && SecondNode->PointsTo)
- FirstNode->PointsTo |= *(SecondNode->PointsTo);
- if (FirstNode->Edges && SecondNode->Edges)
- FirstNode->Edges |= *(SecondNode->Edges);
- if (!SecondNode->Constraints.empty())
- FirstNode->Constraints.splice(FirstNode->Constraints.begin(),
- SecondNode->Constraints);
- if (FirstNode->OldPointsTo) {
- delete FirstNode->OldPointsTo;
- FirstNode->OldPointsTo = new SparseBitVector<>;
- }
-
- // Destroy interesting parts of the merged-from node.
- delete SecondNode->OldPointsTo;
- delete SecondNode->Edges;
- delete SecondNode->PointsTo;
- SecondNode->Edges = NULL;
- SecondNode->PointsTo = NULL;
- SecondNode->OldPointsTo = NULL;
-
- NumUnified++;
- DOUT << "Unified Node ";
- DEBUG(PrintNode(FirstNode));
- DOUT << " and Node ";
- DEBUG(PrintNode(SecondNode));
- DOUT << "\n";
-
- if (SDTActive)
- if (SDT[Second] >= 0)
- if (SDT[First] < 0)
- SDT[First] = SDT[Second];
- else {
- UniteNodes( FindNode(SDT[First]), FindNode(SDT[Second]) );
- First = FindNode(First);
- }
-
- return First;
-}
-
-// Find the index into GraphNodes of the node representing Node, performing
-// path compression along the way
-unsigned Andersens::FindNode(unsigned NodeIndex) {
- assert (NodeIndex < GraphNodes.size()
- && "Attempting to find a node that can't exist");
- Node *N = &GraphNodes[NodeIndex];
- if (N->isRep())
- return NodeIndex;
- else
- return (N->NodeRep = FindNode(N->NodeRep));
-}
-
-// Find the index into GraphNodes of the node representing Node,
-// don't perform path compression along the way (for Print)
-unsigned Andersens::FindNode(unsigned NodeIndex) const {
- assert (NodeIndex < GraphNodes.size()
- && "Attempting to find a node that can't exist");
- const Node *N = &GraphNodes[NodeIndex];
- if (N->isRep())
- return NodeIndex;
- else
- return FindNode(N->NodeRep);
-}
-
-//===----------------------------------------------------------------------===//
-// Debugging Output
-//===----------------------------------------------------------------------===//
-
-void Andersens::PrintNode(const Node *N) const {
- if (N == &GraphNodes[UniversalSet]) {
- cerr << "<universal>";
- return;
- } else if (N == &GraphNodes[NullPtr]) {
- cerr << "<nullptr>";
- return;
- } else if (N == &GraphNodes[NullObject]) {
- cerr << "<null>";
- return;
- }
- if (!N->getValue()) {
- cerr << "artificial" << (intptr_t) N;
- return;
- }
-
- assert(N->getValue() != 0 && "Never set node label!");
- Value *V = N->getValue();
- if (Function *F = dyn_cast<Function>(V)) {
- if (isa<PointerType>(F->getFunctionType()->getReturnType()) &&
- N == &GraphNodes[getReturnNode(F)]) {
- cerr << F->getName() << ":retval";
- return;
- } else if (F->getFunctionType()->isVarArg() &&
- N == &GraphNodes[getVarargNode(F)]) {
- cerr << F->getName() << ":vararg";
- return;
- }
- }
-
- if (Instruction *I = dyn_cast<Instruction>(V))
- cerr << I->getParent()->getParent()->getName() << ":";
- else if (Argument *Arg = dyn_cast<Argument>(V))
- cerr << Arg->getParent()->getName() << ":";
-
- if (V->hasName())
- cerr << V->getName();
- else
- cerr << "(unnamed)";
-
- if (isa<GlobalValue>(V) || isa<AllocationInst>(V))
- if (N == &GraphNodes[getObject(V)])
- cerr << "<mem>";
-}
-void Andersens::PrintConstraint(const Constraint &C) const {
- if (C.Type == Constraint::Store) {
- cerr << "*";
- if (C.Offset != 0)
- cerr << "(";
- }
- PrintNode(&GraphNodes[C.Dest]);
- if (C.Type == Constraint::Store && C.Offset != 0)
- cerr << " + " << C.Offset << ")";
- cerr << " = ";
- if (C.Type == Constraint::Load) {
- cerr << "*";
- if (C.Offset != 0)
- cerr << "(";
- }
- else if (C.Type == Constraint::AddressOf)
- cerr << "&";
- PrintNode(&GraphNodes[C.Src]);
- if (C.Offset != 0 && C.Type != Constraint::Store)
- cerr << " + " << C.Offset;
- if (C.Type == Constraint::Load && C.Offset != 0)
- cerr << ")";
- cerr << "\n";
-}
-
-void Andersens::PrintConstraints() const {
- cerr << "Constraints:\n";
-
- for (unsigned i = 0, e = Constraints.size(); i != e; ++i)
- PrintConstraint(Constraints[i]);
-}
-
-void Andersens::PrintPointsToGraph() const {
- cerr << "Points-to graph:\n";
- for (unsigned i = 0, e = GraphNodes.size(); i != e; ++i) {
- const Node *N = &GraphNodes[i];
- if (FindNode(i) != i) {
- PrintNode(N);
- cerr << "\t--> same as ";
- PrintNode(&GraphNodes[FindNode(i)]);
- cerr << "\n";
- } else {
- cerr << "[" << (N->PointsTo->count()) << "] ";
- PrintNode(N);
- cerr << "\t--> ";
-
- bool first = true;
- for (SparseBitVector<>::iterator bi = N->PointsTo->begin();
- bi != N->PointsTo->end();
- ++bi) {
- if (!first)
- cerr << ", ";
- PrintNode(&GraphNodes[*bi]);
- first = false;
- }
- cerr << "\n";
- }
- }
-}
diff --git a/release_23/lib/Analysis/IPA/CallGraph.cpp b/release_23/lib/Analysis/IPA/CallGraph.cpp
deleted file mode 100644
index f0dd1880ff4e..000000000000
--- a/release_23/lib/Analysis/IPA/CallGraph.cpp
+++ /dev/null
@@ -1,323 +0,0 @@
-//===- CallGraph.cpp - Build a Module's call graph ------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the CallGraph class and provides the BasicCallGraph
-// default implementation.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Analysis/CallGraph.h"
-#include "llvm/Module.h"
-#include "llvm/Instructions.h"
-#include "llvm/Support/CallSite.h"
-#include "llvm/Support/Compiler.h"
-#include "llvm/Support/Streams.h"
-#include <ostream>
-using namespace llvm;
-
-/// isOnlyADirectCall - Return true if this callsite is *just* a direct call to
-/// the specified function. Specifically return false if the callsite also
-/// takes the address of the function.
-static bool isOnlyADirectCall(Function *F, CallSite CS) {
- if (!CS.getInstruction()) return false;
- for (CallSite::arg_iterator I = CS.arg_begin(), E = CS.arg_end(); I != E; ++I)
- if (*I == F) return false;
- return true;
-}
-
-namespace {
-
-//===----------------------------------------------------------------------===//
-// BasicCallGraph class definition
-//
-class VISIBILITY_HIDDEN BasicCallGraph : public CallGraph, public ModulePass {
- // Root is root of the call graph, or the external node if a 'main' function
- // couldn't be found.
- //
- CallGraphNode *Root;
-
- // ExternalCallingNode - This node has edges to all external functions and
- // those internal functions that have their address taken.
- CallGraphNode *ExternalCallingNode;
-
- // CallsExternalNode - This node has edges to it from all functions making
- // indirect calls or calling an external function.
- CallGraphNode *CallsExternalNode;
-
-public:
- static char ID; // Class identification, replacement for typeinfo
- BasicCallGraph() : ModulePass((intptr_t)&ID), Root(0),
- ExternalCallingNode(0), CallsExternalNode(0) {}
-
- // runOnModule - Compute the call graph for the specified module.
- virtual bool runOnModule(Module &M) {
- CallGraph::initialize(M);
-
- ExternalCallingNode = getOrInsertFunction(0);
- CallsExternalNode = new CallGraphNode(0);
- Root = 0;
-
- // Add every function to the call graph...
- for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I)
- addToCallGraph(I);
-
- // If we didn't find a main function, use the external call graph node
- if (Root == 0) Root = ExternalCallingNode;
-
- return false;
- }
-
- virtual void getAnalysisUsage(AnalysisUsage &AU) const {
- AU.setPreservesAll();
- }
-
- void print(std::ostream *o, const Module *M) const {
- if (o) print(*o, M);
- }
-
- virtual void print(std::ostream &o, const Module *M) const {
- o << "CallGraph Root is: ";
- if (Function *F = getRoot()->getFunction())
- o << F->getName() << "\n";
- else
- o << "<<null function: 0x" << getRoot() << ">>\n";
-
- CallGraph::print(o, M);
- }
-
- virtual void releaseMemory() {
- destroy();
- }
-
- /// dump - Print out this call graph.
- ///
- inline void dump() const {
- print(cerr, Mod);
- }
-
- CallGraphNode* getExternalCallingNode() const { return ExternalCallingNode; }
- CallGraphNode* getCallsExternalNode() const { return CallsExternalNode; }
-
- // getRoot - Return the root of the call graph, which is either main, or if
- // main cannot be found, the external node.
- //
- CallGraphNode *getRoot() { return Root; }
- const CallGraphNode *getRoot() const { return Root; }
-
-private:
- //===---------------------------------------------------------------------
- // Implementation of CallGraph construction
- //
-
- // addToCallGraph - Add a function to the call graph, and link the node to all
- // of the functions that it calls.
- //
- void addToCallGraph(Function *F) {
- CallGraphNode *Node = getOrInsertFunction(F);
-
- // If this function has external linkage, anything could call it.
- if (!F->hasInternalLinkage()) {
- ExternalCallingNode->addCalledFunction(CallSite(), Node);
-
- // Found the entry point?
- if (F->getName() == "main") {
- if (Root) // Found multiple external mains? Don't pick one.
- Root = ExternalCallingNode;
- else
- Root = Node; // Found a main, keep track of it!
- }
- }
-
- // If this function is not defined in this translation unit, it could call
- // anything.
- if (F->isDeclaration() && !F->isIntrinsic())
- Node->addCalledFunction(CallSite(), CallsExternalNode);
-
- // Loop over all of the users of the function... looking for callers...
- //
- bool isUsedExternally = false;
- for (Value::use_iterator I = F->use_begin(), E = F->use_end(); I != E; ++I){
- if (Instruction *Inst = dyn_cast<Instruction>(*I)) {
- CallSite CS = CallSite::get(Inst);
- if (isOnlyADirectCall(F, CS))
- getOrInsertFunction(Inst->getParent()->getParent())
- ->addCalledFunction(CS, Node);
- else
- isUsedExternally = true;
- } else if (GlobalValue *GV = dyn_cast<GlobalValue>(*I)) {
- for (Value::use_iterator I = GV->use_begin(), E = GV->use_end();
- I != E; ++I)
- if (Instruction *Inst = dyn_cast<Instruction>(*I)) {
- CallSite CS = CallSite::get(Inst);
- if (isOnlyADirectCall(F, CS))
- getOrInsertFunction(Inst->getParent()->getParent())
- ->addCalledFunction(CS, Node);
- else
- isUsedExternally = true;
- } else {
- isUsedExternally = true;
- }
- } else { // Can't classify the user!
- isUsedExternally = true;
- }
- }
- if (isUsedExternally)
- ExternalCallingNode->addCalledFunction(CallSite(), Node);
-
- // Look for an indirect function call.
- for (Function::iterator BB = F->begin(), BBE = F->end(); BB != BBE; ++BB)
- for (BasicBlock::iterator II = BB->begin(), IE = BB->end();
- II != IE; ++II) {
- CallSite CS = CallSite::get(II);
- if (CS.getInstruction() && !CS.getCalledFunction())
- Node->addCalledFunction(CS, CallsExternalNode);
- }
- }
-
- //
- // destroy - Release memory for the call graph
- virtual void destroy() {
- /// CallsExternalNode is not in the function map, delete it explicitly.
- delete CallsExternalNode;
- CallsExternalNode = 0;
- CallGraph::destroy();
- }
-};
-
-RegisterAnalysisGroup<CallGraph> X("Call Graph");
-RegisterPass<BasicCallGraph> Y("basiccg", "Basic CallGraph Construction", false, true);
-RegisterAnalysisGroup<CallGraph, true> Z(Y);
-
-} //End anonymous namespace
-
-char CallGraph::ID = 0;
-char BasicCallGraph::ID = 0;
-
-void CallGraph::initialize(Module &M) {
- Mod = &M;
-}
-
-void CallGraph::destroy() {
- if (!FunctionMap.empty()) {
- for (FunctionMapTy::iterator I = FunctionMap.begin(), E = FunctionMap.end();
- I != E; ++I)
- delete I->second;
- FunctionMap.clear();
- }
-}
-
-void CallGraph::print(std::ostream &OS, const Module *M) const {
- for (CallGraph::const_iterator I = begin(), E = end(); I != E; ++I)
- I->second->print(OS);
-}
-
-void CallGraph::dump() const {
- print(cerr, 0);
-}
-
-//===----------------------------------------------------------------------===//
-// Implementations of public modification methods
-//
-
-// removeFunctionFromModule - Unlink the function from this module, returning
-// it. Because this removes the function from the module, the call graph node
-// is destroyed. This is only valid if the function does not call any other
-// functions (ie, there are no edges in it's CGN). The easiest way to do this
-// is to dropAllReferences before calling this.
-//
-Function *CallGraph::removeFunctionFromModule(CallGraphNode *CGN) {
- assert(CGN->CalledFunctions.empty() && "Cannot remove function from call "
- "graph if it references other functions!");
- Function *F = CGN->getFunction(); // Get the function for the call graph node
- delete CGN; // Delete the call graph node for this func
- FunctionMap.erase(F); // Remove the call graph node from the map
-
- Mod->getFunctionList().remove(F);
- return F;
-}
-
-// changeFunction - This method changes the function associated with this
-// CallGraphNode, for use by transformations that need to change the prototype
-// of a Function (thus they must create a new Function and move the old code
-// over).
-void CallGraph::changeFunction(Function *OldF, Function *NewF) {
- iterator I = FunctionMap.find(OldF);
- CallGraphNode *&New = FunctionMap[NewF];
- assert(I != FunctionMap.end() && I->second && !New &&
- "OldF didn't exist in CG or NewF already does!");
- New = I->second;
- New->F = NewF;
- FunctionMap.erase(I);
-}
-
-// getOrInsertFunction - This method is identical to calling operator[], but
-// it will insert a new CallGraphNode for the specified function if one does
-// not already exist.
-CallGraphNode *CallGraph::getOrInsertFunction(const Function *F) {
- CallGraphNode *&CGN = FunctionMap[F];
- if (CGN) return CGN;
-
- assert((!F || F->getParent() == Mod) && "Function not in current module!");
- return CGN = new CallGraphNode(const_cast<Function*>(F));
-}
-
-void CallGraphNode::print(std::ostream &OS) const {
- if (Function *F = getFunction())
- OS << "Call graph node for function: '" << F->getName() <<"'\n";
- else
- OS << "Call graph node <<null function: 0x" << this << ">>:\n";
-
- for (const_iterator I = begin(), E = end(); I != E; ++I)
- if (I->second->getFunction())
- OS << " Calls function '" << I->second->getFunction()->getName() <<"'\n";
- else
- OS << " Calls external node\n";
- OS << "\n";
-}
-
-void CallGraphNode::dump() const { print(cerr); }
-
-void CallGraphNode::removeCallEdgeTo(CallGraphNode *Callee) {
- for (unsigned i = CalledFunctions.size(); ; --i) {
- assert(i && "Cannot find callee to remove!");
- if (CalledFunctions[i-1].second == Callee) {
- CalledFunctions.erase(CalledFunctions.begin()+i-1);
- return;
- }
- }
-}
-
-/// removeCallEdgeFor - This method removes the edge in the node for the
-/// specified call site. Note that this method takes linear time, so it
-/// should be used sparingly.
-void CallGraphNode::removeCallEdgeFor(CallSite CS) {
- for (unsigned i = CalledFunctions.size(); ; --i) {
- assert(i && "Cannot find callee to remove!");
- if (CalledFunctions[i-1].first == CS) {
- CalledFunctions.erase(CalledFunctions.begin()+i-1);
- return;
- }
- }
-}
-
-
-// removeAnyCallEdgeTo - This method removes any call edges from this node to
-// the specified callee function. This takes more time to execute than
-// removeCallEdgeTo, so it should not be used unless necessary.
-void CallGraphNode::removeAnyCallEdgeTo(CallGraphNode *Callee) {
- for (unsigned i = 0, e = CalledFunctions.size(); i != e; ++i)
- if (CalledFunctions[i].second == Callee) {
- CalledFunctions[i] = CalledFunctions.back();
- CalledFunctions.pop_back();
- --i; --e;
- }
-}
-
-// Enuse that users of CallGraph.h also link with this file
-DEFINING_FILE_FOR(CallGraph)
diff --git a/release_23/lib/Analysis/IPA/CallGraphSCCPass.cpp b/release_23/lib/Analysis/IPA/CallGraphSCCPass.cpp
deleted file mode 100644
index 99954d632d4d..000000000000
--- a/release_23/lib/Analysis/IPA/CallGraphSCCPass.cpp
+++ /dev/null
@@ -1,195 +0,0 @@
-//===- CallGraphSCCPass.cpp - Pass that operates BU on call graph ---------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the CallGraphSCCPass class, which is used for passes
-// which are implemented as bottom-up traversals on the call graph. Because
-// there may be cycles in the call graph, passes of this type operate on the
-// call-graph in SCC order: that is, they process function bottom-up, except for
-// recursive functions, which they process all at once.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/CallGraphSCCPass.h"
-#include "llvm/Analysis/CallGraph.h"
-#include "llvm/ADT/SCCIterator.h"
-#include "llvm/PassManagers.h"
-#include "llvm/Function.h"
-using namespace llvm;
-
-//===----------------------------------------------------------------------===//
-// CGPassManager
-//
-/// CGPassManager manages FPPassManagers and CalLGraphSCCPasses.
-
-class CGPassManager : public ModulePass, public PMDataManager {
-
-public:
- static char ID;
- explicit CGPassManager(int Depth)
- : ModulePass((intptr_t)&ID), PMDataManager(Depth) { }
-
- /// run - Execute all of the passes scheduled for execution. Keep track of
- /// whether any of the passes modifies the module, and if so, return true.
- bool runOnModule(Module &M);
-
- bool doInitialization(CallGraph &CG);
- bool doFinalization(CallGraph &CG);
-
- /// Pass Manager itself does not invalidate any analysis info.
- void getAnalysisUsage(AnalysisUsage &Info) const {
- // CGPassManager walks SCC and it needs CallGraph.
- Info.addRequired<CallGraph>();
- Info.setPreservesAll();
- }
-
- virtual const char *getPassName() const {
- return "CallGraph Pass Manager";
- }
-
- // Print passes managed by this manager
- void dumpPassStructure(unsigned Offset) {
- llvm::cerr << std::string(Offset*2, ' ') << "Call Graph SCC Pass Manager\n";
- for (unsigned Index = 0; Index < getNumContainedPasses(); ++Index) {
- Pass *P = getContainedPass(Index);
- P->dumpPassStructure(Offset + 1);
- dumpLastUses(P, Offset+1);
- }
- }
-
- Pass *getContainedPass(unsigned N) {
- assert ( N < PassVector.size() && "Pass number out of range!");
- Pass *FP = static_cast<Pass *>(PassVector[N]);
- return FP;
- }
-
- virtual PassManagerType getPassManagerType() const {
- return PMT_CallGraphPassManager;
- }
-};
-
-char CGPassManager::ID = 0;
-/// run - Execute all of the passes scheduled for execution. Keep track of
-/// whether any of the passes modifies the module, and if so, return true.
-bool CGPassManager::runOnModule(Module &M) {
- CallGraph &CG = getAnalysis<CallGraph>();
- bool Changed = doInitialization(CG);
-
- // Walk SCC
- for (scc_iterator<CallGraph*> I = scc_begin(&CG), E = scc_end(&CG);
- I != E; ++I) {
-
- // Run all passes on current SCC
- for (unsigned Index = 0; Index < getNumContainedPasses(); ++Index) {
- Pass *P = getContainedPass(Index);
- AnalysisUsage AnUsage;
- P->getAnalysisUsage(AnUsage);
-
- dumpPassInfo(P, EXECUTION_MSG, ON_CG_MSG, "");
- dumpAnalysisSetInfo("Required", P, AnUsage.getRequiredSet());
-
- initializeAnalysisImpl(P);
-
- StartPassTimer(P);
- if (CallGraphSCCPass *CGSP = dynamic_cast<CallGraphSCCPass *>(P))
- Changed |= CGSP->runOnSCC(*I); // TODO : What if CG is changed ?
- else {
- FPPassManager *FPP = dynamic_cast<FPPassManager *>(P);
- assert (FPP && "Invalid CGPassManager member");
-
- // Run pass P on all functions current SCC
- std::vector<CallGraphNode*> &SCC = *I;
- for (unsigned i = 0, e = SCC.size(); i != e; ++i) {
- Function *F = SCC[i]->getFunction();
- if (F) {
- dumpPassInfo(P, EXECUTION_MSG, ON_FUNCTION_MSG, F->getNameStart());
- Changed |= FPP->runOnFunction(*F);
- }
- }
- }
- StopPassTimer(P);
-
- if (Changed)
- dumpPassInfo(P, MODIFICATION_MSG, ON_CG_MSG, "");
- dumpAnalysisSetInfo("Preserved", P, AnUsage.getPreservedSet());
-
- verifyPreservedAnalysis(P);
- removeNotPreservedAnalysis(P);
- recordAvailableAnalysis(P);
- removeDeadPasses(P, "", ON_CG_MSG);
- }
- }
- Changed |= doFinalization(CG);
- return Changed;
-}
-
-/// Initialize CG
-bool CGPassManager::doInitialization(CallGraph &CG) {
- bool Changed = false;
- for (unsigned Index = 0; Index < getNumContainedPasses(); ++Index) {
- Pass *P = getContainedPass(Index);
- if (CallGraphSCCPass *CGSP = dynamic_cast<CallGraphSCCPass *>(P))
- Changed |= CGSP->doInitialization(CG);
- }
- return Changed;
-}
-
-/// Finalize CG
-bool CGPassManager::doFinalization(CallGraph &CG) {
- bool Changed = false;
- for (unsigned Index = 0; Index < getNumContainedPasses(); ++Index) {
- Pass *P = getContainedPass(Index);
- if (CallGraphSCCPass *CGSP = dynamic_cast<CallGraphSCCPass *>(P))
- Changed |= CGSP->doFinalization(CG);
- }
- return Changed;
-}
-
-/// Assign pass manager to manage this pass.
-void CallGraphSCCPass::assignPassManager(PMStack &PMS,
- PassManagerType PreferredType) {
- // Find CGPassManager
- while (!PMS.empty() &&
- PMS.top()->getPassManagerType() > PMT_CallGraphPassManager)
- PMS.pop();
-
- assert (!PMS.empty() && "Unable to handle Call Graph Pass");
- CGPassManager *CGP = dynamic_cast<CGPassManager *>(PMS.top());
-
- // Create new Call Graph SCC Pass Manager if it does not exist.
- if (!CGP) {
-
- assert (!PMS.empty() && "Unable to create Call Graph Pass Manager");
- PMDataManager *PMD = PMS.top();
-
- // [1] Create new Call Graph Pass Manager
- CGP = new CGPassManager(PMD->getDepth() + 1);
-
- // [2] Set up new manager's top level manager
- PMTopLevelManager *TPM = PMD->getTopLevelManager();
- TPM->addIndirectPassManager(CGP);
-
- // [3] Assign manager to manage this new manager. This may create
- // and push new managers into PMS
- Pass *P = dynamic_cast<Pass *>(CGP);
- TPM->schedulePass(P);
-
- // [4] Push new manager into PMS
- PMS.push(CGP);
- }
-
- CGP->add(this);
-}
-
-/// getAnalysisUsage - For this class, we declare that we require and preserve
-/// the call graph. If the derived class implements this method, it should
-/// always explicitly call the implementation here.
-void CallGraphSCCPass::getAnalysisUsage(AnalysisUsage &AU) const {
- AU.addRequired<CallGraph>();
- AU.addPreserved<CallGraph>();
-}
diff --git a/release_23/lib/Analysis/IPA/FindUsedTypes.cpp b/release_23/lib/Analysis/IPA/FindUsedTypes.cpp
deleted file mode 100644
index 0a28cd5153c8..000000000000
--- a/release_23/lib/Analysis/IPA/FindUsedTypes.cpp
+++ /dev/null
@@ -1,98 +0,0 @@
-//===- FindUsedTypes.cpp - Find all Types used by a module ----------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This pass is used to seek out all of the types in use by the program. Note
-// that this analysis explicitly does not include types only used by the symbol
-// table.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Analysis/FindUsedTypes.h"
-#include "llvm/Constants.h"
-#include "llvm/DerivedTypes.h"
-#include "llvm/Module.h"
-#include "llvm/Assembly/Writer.h"
-#include "llvm/Support/InstIterator.h"
-using namespace llvm;
-
-char FindUsedTypes::ID = 0;
-static RegisterPass<FindUsedTypes>
-X("printusedtypes", "Find Used Types", false, true);
-
-// IncorporateType - Incorporate one type and all of its subtypes into the
-// collection of used types.
-//
-void FindUsedTypes::IncorporateType(const Type *Ty) {
- // If ty doesn't already exist in the used types map, add it now, otherwise
- // return.
- if (!UsedTypes.insert(Ty).second) return; // Already contain Ty.
-
- // Make sure to add any types this type references now.
- //
- for (Type::subtype_iterator I = Ty->subtype_begin(), E = Ty->subtype_end();
- I != E; ++I)
- IncorporateType(*I);
-}
-
-void FindUsedTypes::IncorporateValue(const Value *V) {
- IncorporateType(V->getType());
-
- // If this is a constant, it could be using other types...
- if (const Constant *C = dyn_cast<Constant>(V)) {
- if (!isa<GlobalValue>(C))
- for (User::const_op_iterator OI = C->op_begin(), OE = C->op_end();
- OI != OE; ++OI)
- IncorporateValue(*OI);
- }
-}
-
-
-// run - This incorporates all types used by the specified module
-//
-bool FindUsedTypes::runOnModule(Module &m) {
- UsedTypes.clear(); // reset if run multiple times...
-
- // Loop over global variables, incorporating their types
- for (Module::const_global_iterator I = m.global_begin(), E = m.global_end(); I != E; ++I) {
- IncorporateType(I->getType());
- if (I->hasInitializer())
- IncorporateValue(I->getInitializer());
- }
-
- for (Module::iterator MI = m.begin(), ME = m.end(); MI != ME; ++MI) {
- IncorporateType(MI->getType());
- const Function &F = *MI;
-
- // Loop over all of the instructions in the function, adding their return
- // type as well as the types of their operands.
- //
- for (const_inst_iterator II = inst_begin(F), IE = inst_end(F);
- II != IE; ++II) {
- const Instruction &I = *II;
-
- IncorporateType(I.getType()); // Incorporate the type of the instruction
- for (User::const_op_iterator OI = I.op_begin(), OE = I.op_end();
- OI != OE; ++OI)
- IncorporateValue(*OI); // Insert inst operand types as well
- }
- }
-
- return false;
-}
-
-// Print the types found in the module. If the optional Module parameter is
-// passed in, then the types are printed symbolically if possible, using the
-// symbol table from the module.
-//
-void FindUsedTypes::print(std::ostream &o, const Module *M) const {
- o << "Types in use by this module:\n";
- for (std::set<const Type *>::const_iterator I = UsedTypes.begin(),
- E = UsedTypes.end(); I != E; ++I)
- WriteTypeSymbolic(o << " ", *I, M) << "\n";
-}
diff --git a/release_23/lib/Analysis/IPA/GlobalsModRef.cpp b/release_23/lib/Analysis/IPA/GlobalsModRef.cpp
deleted file mode 100644
index 6ce320964e9d..000000000000
--- a/release_23/lib/Analysis/IPA/GlobalsModRef.cpp
+++ /dev/null
@@ -1,559 +0,0 @@
-//===- GlobalsModRef.cpp - Simple Mod/Ref Analysis for Globals ------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This simple pass provides alias and mod/ref information for global values
-// that do not have their address taken, and keeps track of whether functions
-// read or write memory (are "pure"). For this simple (but very common) case,
-// we can provide pretty accurate and useful information.
-//
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "globalsmodref-aa"
-#include "llvm/Analysis/Passes.h"
-#include "llvm/Module.h"
-#include "llvm/Pass.h"
-#include "llvm/Instructions.h"
-#include "llvm/Constants.h"
-#include "llvm/DerivedTypes.h"
-#include "llvm/Analysis/AliasAnalysis.h"
-#include "llvm/Analysis/CallGraph.h"
-#include "llvm/Support/Compiler.h"
-#include "llvm/Support/CommandLine.h"
-#include "llvm/Support/InstIterator.h"
-#include "llvm/ADT/Statistic.h"
-#include "llvm/ADT/SCCIterator.h"
-#include <set>
-using namespace llvm;
-
-STATISTIC(NumNonAddrTakenGlobalVars,
- "Number of global vars without address taken");
-STATISTIC(NumNonAddrTakenFunctions,"Number of functions without address taken");
-STATISTIC(NumNoMemFunctions, "Number of functions that do not access memory");
-STATISTIC(NumReadMemFunctions, "Number of functions that only read memory");
-STATISTIC(NumIndirectGlobalVars, "Number of indirect global objects");
-
-namespace {
- /// FunctionRecord - One instance of this structure is stored for every
- /// function in the program. Later, the entries for these functions are
- /// removed if the function is found to call an external function (in which
- /// case we know nothing about it.
- struct VISIBILITY_HIDDEN FunctionRecord {
- /// GlobalInfo - Maintain mod/ref info for all of the globals without
- /// addresses taken that are read or written (transitively) by this
- /// function.
- std::map<GlobalValue*, unsigned> GlobalInfo;
-
- unsigned getInfoForGlobal(GlobalValue *GV) const {
- std::map<GlobalValue*, unsigned>::const_iterator I = GlobalInfo.find(GV);
- if (I != GlobalInfo.end())
- return I->second;
- return 0;
- }
-
- /// FunctionEffect - Capture whether or not this function reads or writes to
- /// ANY memory. If not, we can do a lot of aggressive analysis on it.
- unsigned FunctionEffect;
-
- FunctionRecord() : FunctionEffect(0) {}
- };
-
- /// GlobalsModRef - The actual analysis pass.
- class VISIBILITY_HIDDEN GlobalsModRef
- : public ModulePass, public AliasAnalysis {
- /// NonAddressTakenGlobals - The globals that do not have their addresses
- /// taken.
- std::set<GlobalValue*> NonAddressTakenGlobals;
-
- /// IndirectGlobals - The memory pointed to by this global is known to be
- /// 'owned' by the global.
- std::set<GlobalValue*> IndirectGlobals;
-
- /// AllocsForIndirectGlobals - If an instruction allocates memory for an
- /// indirect global, this map indicates which one.
- std::map<Value*, GlobalValue*> AllocsForIndirectGlobals;
-
- /// FunctionInfo - For each function, keep track of what globals are
- /// modified or read.
- std::map<Function*, FunctionRecord> FunctionInfo;
-
- public:
- static char ID;
- GlobalsModRef() : ModulePass((intptr_t)&ID) {}
-
- bool runOnModule(Module &M) {
- InitializeAliasAnalysis(this); // set up super class
- AnalyzeGlobals(M); // find non-addr taken globals
- AnalyzeCallGraph(getAnalysis<CallGraph>(), M); // Propagate on CG
- return false;
- }
-
- virtual void getAnalysisUsage(AnalysisUsage &AU) const {
- AliasAnalysis::getAnalysisUsage(AU);
- AU.addRequired<CallGraph>();
- AU.setPreservesAll(); // Does not transform code
- }
-
- //------------------------------------------------
- // Implement the AliasAnalysis API
- //
- AliasResult alias(const Value *V1, unsigned V1Size,
- const Value *V2, unsigned V2Size);
- ModRefResult getModRefInfo(CallSite CS, Value *P, unsigned Size);
- ModRefResult getModRefInfo(CallSite CS1, CallSite CS2) {
- return AliasAnalysis::getModRefInfo(CS1,CS2);
- }
- bool hasNoModRefInfoForCalls() const { return false; }
-
- /// getModRefBehavior - Return the behavior of the specified function if
- /// called from the specified call site. The call site may be null in which
- /// case the most generic behavior of this function should be returned.
- virtual ModRefBehavior getModRefBehavior(Function *F, CallSite CS,
- std::vector<PointerAccessInfo> *Info) {
- if (FunctionRecord *FR = getFunctionInfo(F)) {
- if (FR->FunctionEffect == 0)
- return DoesNotAccessMemory;
- else if ((FR->FunctionEffect & Mod) == 0)
- return OnlyReadsMemory;
- }
- return AliasAnalysis::getModRefBehavior(F, CS, Info);
- }
-
- virtual void deleteValue(Value *V);
- virtual void copyValue(Value *From, Value *To);
-
- private:
- /// getFunctionInfo - Return the function info for the function, or null if
- /// the function calls an external function (in which case we don't have
- /// anything useful to say about it).
- FunctionRecord *getFunctionInfo(Function *F) {
- std::map<Function*, FunctionRecord>::iterator I = FunctionInfo.find(F);
- if (I != FunctionInfo.end())
- return &I->second;
- return 0;
- }
-
- void AnalyzeGlobals(Module &M);
- void AnalyzeCallGraph(CallGraph &CG, Module &M);
- void AnalyzeSCC(std::vector<CallGraphNode *> &SCC);
- bool AnalyzeUsesOfPointer(Value *V, std::vector<Function*> &Readers,
- std::vector<Function*> &Writers,
- GlobalValue *OkayStoreDest = 0);
- bool AnalyzeIndirectGlobalMemory(GlobalValue *GV);
- };
-
- char GlobalsModRef::ID = 0;
- RegisterPass<GlobalsModRef> X("globalsmodref-aa",
- "Simple mod/ref analysis for globals", false,
- true);
- RegisterAnalysisGroup<AliasAnalysis> Y(X);
-}
-
-Pass *llvm::createGlobalsModRefPass() { return new GlobalsModRef(); }
-
-/// getUnderlyingObject - This traverses the use chain to figure out what object
-/// the specified value points to. If the value points to, or is derived from,
-/// a global object, return it.
-static Value *getUnderlyingObject(Value *V) {
- if (!isa<PointerType>(V->getType())) return V;
-
- // If we are at some type of object... return it.
- if (GlobalValue *GV = dyn_cast<GlobalValue>(V)) return GV;
-
- // Traverse through different addressing mechanisms.
- if (Instruction *I = dyn_cast<Instruction>(V)) {
- if (isa<BitCastInst>(I) || isa<GetElementPtrInst>(I))
- return getUnderlyingObject(I->getOperand(0));
- } else if (ConstantExpr *CE = dyn_cast<ConstantExpr>(V)) {
- if (CE->getOpcode() == Instruction::BitCast ||
- CE->getOpcode() == Instruction::GetElementPtr)
- return getUnderlyingObject(CE->getOperand(0));
- }
-
- // Othewise, we don't know what this is, return it as the base pointer.
- return V;
-}
-
-/// AnalyzeGlobals - Scan through the users of all of the internal
-/// GlobalValue's in the program. If none of them have their "Address taken"
-/// (really, their address passed to something nontrivial), record this fact,
-/// and record the functions that they are used directly in.
-void GlobalsModRef::AnalyzeGlobals(Module &M) {
- std::vector<Function*> Readers, Writers;
- for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I)
- if (I->hasInternalLinkage()) {
- if (!AnalyzeUsesOfPointer(I, Readers, Writers)) {
- // Remember that we are tracking this global.
- NonAddressTakenGlobals.insert(I);
- ++NumNonAddrTakenFunctions;
- }
- Readers.clear(); Writers.clear();
- }
-
- for (Module::global_iterator I = M.global_begin(), E = M.global_end();
- I != E; ++I)
- if (I->hasInternalLinkage()) {
- if (!AnalyzeUsesOfPointer(I, Readers, Writers)) {
- // Remember that we are tracking this global, and the mod/ref fns
- NonAddressTakenGlobals.insert(I);
- for (unsigned i = 0, e = Readers.size(); i != e; ++i)
- FunctionInfo[Readers[i]].GlobalInfo[I] |= Ref;
-
- if (!I->isConstant()) // No need to keep track of writers to constants
- for (unsigned i = 0, e = Writers.size(); i != e; ++i)
- FunctionInfo[Writers[i]].GlobalInfo[I] |= Mod;
- ++NumNonAddrTakenGlobalVars;
-
- // If this global holds a pointer type, see if it is an indirect global.
- if (isa<PointerType>(I->getType()->getElementType()) &&
- AnalyzeIndirectGlobalMemory(I))
- ++NumIndirectGlobalVars;
- }
- Readers.clear(); Writers.clear();
- }
-}
-
-/// AnalyzeUsesOfPointer - Look at all of the users of the specified pointer.
-/// If this is used by anything complex (i.e., the address escapes), return
-/// true. Also, while we are at it, keep track of those functions that read and
-/// write to the value.
-///
-/// If OkayStoreDest is non-null, stores into this global are allowed.
-bool GlobalsModRef::AnalyzeUsesOfPointer(Value *V,
- std::vector<Function*> &Readers,
- std::vector<Function*> &Writers,
- GlobalValue *OkayStoreDest) {
- if (!isa<PointerType>(V->getType())) return true;
-
- for (Value::use_iterator UI = V->use_begin(), E = V->use_end(); UI != E; ++UI)
- if (LoadInst *LI = dyn_cast<LoadInst>(*UI)) {
- Readers.push_back(LI->getParent()->getParent());
- } else if (StoreInst *SI = dyn_cast<StoreInst>(*UI)) {
- if (V == SI->getOperand(1)) {
- Writers.push_back(SI->getParent()->getParent());
- } else if (SI->getOperand(1) != OkayStoreDest) {
- return true; // Storing the pointer
- }
- } else if (GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(*UI)) {
- if (AnalyzeUsesOfPointer(GEP, Readers, Writers)) return true;
- } else if (CallInst *CI = dyn_cast<CallInst>(*UI)) {
- // Make sure that this is just the function being called, not that it is
- // passing into the function.
- for (unsigned i = 1, e = CI->getNumOperands(); i != e; ++i)
- if (CI->getOperand(i) == V) return true;
- } else if (InvokeInst *II = dyn_cast<InvokeInst>(*UI)) {
- // Make sure that this is just the function being called, not that it is
- // passing into the function.
- for (unsigned i = 3, e = II->getNumOperands(); i != e; ++i)
- if (II->getOperand(i) == V) return true;
- } else if (ConstantExpr *CE = dyn_cast<ConstantExpr>(*UI)) {
- if (CE->getOpcode() == Instruction::GetElementPtr ||
- CE->getOpcode() == Instruction::BitCast) {
- if (AnalyzeUsesOfPointer(CE, Readers, Writers))
- return true;
- } else {
- return true;
- }
- } else if (ICmpInst *ICI = dyn_cast<ICmpInst>(*UI)) {
- if (!isa<ConstantPointerNull>(ICI->getOperand(1)))
- return true; // Allow comparison against null.
- } else if (FreeInst *F = dyn_cast<FreeInst>(*UI)) {
- Writers.push_back(F->getParent()->getParent());
- } else {
- return true;
- }
- return false;
-}
-
-/// AnalyzeIndirectGlobalMemory - We found an non-address-taken global variable
-/// which holds a pointer type. See if the global always points to non-aliased
-/// heap memory: that is, all initializers of the globals are allocations, and
-/// those allocations have no use other than initialization of the global.
-/// Further, all loads out of GV must directly use the memory, not store the
-/// pointer somewhere. If this is true, we consider the memory pointed to by
-/// GV to be owned by GV and can disambiguate other pointers from it.
-bool GlobalsModRef::AnalyzeIndirectGlobalMemory(GlobalValue *GV) {
- // Keep track of values related to the allocation of the memory, f.e. the
- // value produced by the malloc call and any casts.
- std::vector<Value*> AllocRelatedValues;
-
- // Walk the user list of the global. If we find anything other than a direct
- // load or store, bail out.
- for (Value::use_iterator I = GV->use_begin(), E = GV->use_end(); I != E; ++I){
- if (LoadInst *LI = dyn_cast<LoadInst>(*I)) {
- // The pointer loaded from the global can only be used in simple ways:
- // we allow addressing of it and loading storing to it. We do *not* allow
- // storing the loaded pointer somewhere else or passing to a function.
- std::vector<Function*> ReadersWriters;
- if (AnalyzeUsesOfPointer(LI, ReadersWriters, ReadersWriters))
- return false; // Loaded pointer escapes.
- // TODO: Could try some IP mod/ref of the loaded pointer.
- } else if (StoreInst *SI = dyn_cast<StoreInst>(*I)) {
- // Storing the global itself.
- if (SI->getOperand(0) == GV) return false;
-
- // If storing the null pointer, ignore it.
- if (isa<ConstantPointerNull>(SI->getOperand(0)))
- continue;
-
- // Check the value being stored.
- Value *Ptr = getUnderlyingObject(SI->getOperand(0));
-
- if (isa<MallocInst>(Ptr)) {
- // Okay, easy case.
- } else if (CallInst *CI = dyn_cast<CallInst>(Ptr)) {
- Function *F = CI->getCalledFunction();
- if (!F || !F->isDeclaration()) return false; // Too hard to analyze.
- if (F->getName() != "calloc") return false; // Not calloc.
- } else {
- return false; // Too hard to analyze.
- }
-
- // Analyze all uses of the allocation. If any of them are used in a
- // non-simple way (e.g. stored to another global) bail out.
- std::vector<Function*> ReadersWriters;
- if (AnalyzeUsesOfPointer(Ptr, ReadersWriters, ReadersWriters, GV))
- return false; // Loaded pointer escapes.
-
- // Remember that this allocation is related to the indirect global.
- AllocRelatedValues.push_back(Ptr);
- } else {
- // Something complex, bail out.
- return false;
- }
- }
-
- // Okay, this is an indirect global. Remember all of the allocations for
- // this global in AllocsForIndirectGlobals.
- while (!AllocRelatedValues.empty()) {
- AllocsForIndirectGlobals[AllocRelatedValues.back()] = GV;
- AllocRelatedValues.pop_back();
- }
- IndirectGlobals.insert(GV);
- return true;
-}
-
-/// AnalyzeCallGraph - At this point, we know the functions where globals are
-/// immediately stored to and read from. Propagate this information up the call
-/// graph to all callers and compute the mod/ref info for all memory for each
-/// function.
-void GlobalsModRef::AnalyzeCallGraph(CallGraph &CG, Module &M) {
- // We do a bottom-up SCC traversal of the call graph. In other words, we
- // visit all callees before callers (leaf-first).
- for (scc_iterator<CallGraph*> I = scc_begin(&CG), E = scc_end(&CG); I!=E; ++I)
- if ((*I).size() != 1) {
- AnalyzeSCC(*I);
- } else if (Function *F = (*I)[0]->getFunction()) {
- if (!F->isDeclaration()) {
- // Nonexternal function.
- AnalyzeSCC(*I);
- } else {
- // Otherwise external function. Handle intrinsics and other special
- // cases here.
- if (getAnalysis<AliasAnalysis>().doesNotAccessMemory(F))
- // If it does not access memory, process the function, causing us to
- // realize it doesn't do anything (the body is empty).
- AnalyzeSCC(*I);
- else {
- // Otherwise, don't process it. This will cause us to conservatively
- // assume the worst.
- }
- }
- } else {
- // Do not process the external node, assume the worst.
- }
-}
-
-void GlobalsModRef::AnalyzeSCC(std::vector<CallGraphNode *> &SCC) {
- assert(!SCC.empty() && "SCC with no functions?");
- FunctionRecord &FR = FunctionInfo[SCC[0]->getFunction()];
-
- bool CallsExternal = false;
- unsigned FunctionEffect = 0;
-
- // Collect the mod/ref properties due to called functions. We only compute
- // one mod-ref set
- for (unsigned i = 0, e = SCC.size(); i != e && !CallsExternal; ++i)
- for (CallGraphNode::iterator CI = SCC[i]->begin(), E = SCC[i]->end();
- CI != E; ++CI)
- if (Function *Callee = CI->second->getFunction()) {
- if (FunctionRecord *CalleeFR = getFunctionInfo(Callee)) {
- // Propagate function effect up.
- FunctionEffect |= CalleeFR->FunctionEffect;
-
- // Incorporate callee's effects on globals into our info.
- for (std::map<GlobalValue*, unsigned>::iterator GI =
- CalleeFR->GlobalInfo.begin(), E = CalleeFR->GlobalInfo.end();
- GI != E; ++GI)
- FR.GlobalInfo[GI->first] |= GI->second;
-
- } else {
- // Okay, if we can't say anything about it, maybe some other alias
- // analysis can.
- ModRefBehavior MRB =
- AliasAnalysis::getModRefBehavior(Callee);
- if (MRB != DoesNotAccessMemory) {
- // FIXME: could make this more aggressive for functions that just
- // read memory. We should just say they read all globals.
- CallsExternal = true;
- break;
- }
- }
- } else {
- CallsExternal = true;
- break;
- }
-
- // If this SCC calls an external function, we can't say anything about it, so
- // remove all SCC functions from the FunctionInfo map.
- if (CallsExternal) {
- for (unsigned i = 0, e = SCC.size(); i != e; ++i)
- FunctionInfo.erase(SCC[i]->getFunction());
- return;
- }
-
- // Otherwise, unless we already know that this function mod/refs memory, scan
- // the function bodies to see if there are any explicit loads or stores.
- if (FunctionEffect != ModRef) {
- for (unsigned i = 0, e = SCC.size(); i != e && FunctionEffect != ModRef;++i)
- for (inst_iterator II = inst_begin(SCC[i]->getFunction()),
- E = inst_end(SCC[i]->getFunction());
- II != E && FunctionEffect != ModRef; ++II)
- if (isa<LoadInst>(*II))
- FunctionEffect |= Ref;
- else if (isa<StoreInst>(*II))
- FunctionEffect |= Mod;
- else if (isa<MallocInst>(*II) || isa<FreeInst>(*II))
- FunctionEffect |= ModRef;
- }
-
- if ((FunctionEffect & Mod) == 0)
- ++NumReadMemFunctions;
- if (FunctionEffect == 0)
- ++NumNoMemFunctions;
- FR.FunctionEffect = FunctionEffect;
-
- // Finally, now that we know the full effect on this SCC, clone the
- // information to each function in the SCC.
- for (unsigned i = 1, e = SCC.size(); i != e; ++i)
- FunctionInfo[SCC[i]->getFunction()] = FR;
-}
-
-
-
-/// alias - If one of the pointers is to a global that we are tracking, and the
-/// other is some random pointer, we know there cannot be an alias, because the
-/// address of the global isn't taken.
-AliasAnalysis::AliasResult
-GlobalsModRef::alias(const Value *V1, unsigned V1Size,
- const Value *V2, unsigned V2Size) {
- // Get the base object these pointers point to.
- Value *UV1 = getUnderlyingObject(const_cast<Value*>(V1));
- Value *UV2 = getUnderlyingObject(const_cast<Value*>(V2));
-
- // If either of the underlying values is a global, they may be non-addr-taken
- // globals, which we can answer queries about.
- GlobalValue *GV1 = dyn_cast<GlobalValue>(UV1);
- GlobalValue *GV2 = dyn_cast<GlobalValue>(UV2);
- if (GV1 || GV2) {
- // If the global's address is taken, pretend we don't know it's a pointer to
- // the global.
- if (GV1 && !NonAddressTakenGlobals.count(GV1)) GV1 = 0;
- if (GV2 && !NonAddressTakenGlobals.count(GV2)) GV2 = 0;
-
- // If the the two pointers are derived from two different non-addr-taken
- // globals, or if one is and the other isn't, we know these can't alias.
- if ((GV1 || GV2) && GV1 != GV2)
- return NoAlias;
-
- // Otherwise if they are both derived from the same addr-taken global, we
- // can't know the two accesses don't overlap.
- }
-
- // These pointers may be based on the memory owned by an indirect global. If
- // so, we may be able to handle this. First check to see if the base pointer
- // is a direct load from an indirect global.
- GV1 = GV2 = 0;
- if (LoadInst *LI = dyn_cast<LoadInst>(UV1))
- if (GlobalVariable *GV = dyn_cast<GlobalVariable>(LI->getOperand(0)))
- if (IndirectGlobals.count(GV))
- GV1 = GV;
- if (LoadInst *LI = dyn_cast<LoadInst>(UV2))
- if (GlobalVariable *GV = dyn_cast<GlobalVariable>(LI->getOperand(0)))
- if (IndirectGlobals.count(GV))
- GV2 = GV;
-
- // These pointers may also be from an allocation for the indirect global. If
- // so, also handle them.
- if (AllocsForIndirectGlobals.count(UV1))
- GV1 = AllocsForIndirectGlobals[UV1];
- if (AllocsForIndirectGlobals.count(UV2))
- GV2 = AllocsForIndirectGlobals[UV2];
-
- // Now that we know whether the two pointers are related to indirect globals,
- // use this to disambiguate the pointers. If either pointer is based on an
- // indirect global and if they are not both based on the same indirect global,
- // they cannot alias.
- if ((GV1 || GV2) && GV1 != GV2)
- return NoAlias;
-
- return AliasAnalysis::alias(V1, V1Size, V2, V2Size);
-}
-
-AliasAnalysis::ModRefResult
-GlobalsModRef::getModRefInfo(CallSite CS, Value *P, unsigned Size) {
- unsigned Known = ModRef;
-
- // If we are asking for mod/ref info of a direct call with a pointer to a
- // global we are tracking, return information if we have it.
- if (GlobalValue *GV = dyn_cast<GlobalValue>(getUnderlyingObject(P)))
- if (GV->hasInternalLinkage())
- if (Function *F = CS.getCalledFunction())
- if (NonAddressTakenGlobals.count(GV))
- if (FunctionRecord *FR = getFunctionInfo(F))
- Known = FR->getInfoForGlobal(GV);
-
- if (Known == NoModRef)
- return NoModRef; // No need to query other mod/ref analyses
- return ModRefResult(Known & AliasAnalysis::getModRefInfo(CS, P, Size));
-}
-
-
-//===----------------------------------------------------------------------===//
-// Methods to update the analysis as a result of the client transformation.
-//
-void GlobalsModRef::deleteValue(Value *V) {
- if (GlobalValue *GV = dyn_cast<GlobalValue>(V)) {
- if (NonAddressTakenGlobals.erase(GV)) {
- // This global might be an indirect global. If so, remove it and remove
- // any AllocRelatedValues for it.
- if (IndirectGlobals.erase(GV)) {
- // Remove any entries in AllocsForIndirectGlobals for this global.
- for (std::map<Value*, GlobalValue*>::iterator
- I = AllocsForIndirectGlobals.begin(),
- E = AllocsForIndirectGlobals.end(); I != E; ) {
- if (I->second == GV) {
- AllocsForIndirectGlobals.erase(I++);
- } else {
- ++I;
- }
- }
- }
- }
- }
-
- // Otherwise, if this is an allocation related to an indirect global, remove
- // it.
- AllocsForIndirectGlobals.erase(V);
-
- AliasAnalysis::deleteValue(V);
-}
-
-void GlobalsModRef::copyValue(Value *From, Value *To) {
- AliasAnalysis::copyValue(From, To);
-}
diff --git a/release_23/lib/Analysis/IPA/Makefile b/release_23/lib/Analysis/IPA/Makefile
deleted file mode 100644
index e1619e8a34e1..000000000000
--- a/release_23/lib/Analysis/IPA/Makefile
+++ /dev/null
@@ -1,14 +0,0 @@
-##===- lib/Analysis/IPA/Makefile ---------------------------*- Makefile -*-===##
-#
-# The LLVM Compiler Infrastructure
-#
-# This file is distributed under the University of Illinois Open Source
-# License. See LICENSE.TXT for details.
-#
-##===----------------------------------------------------------------------===##
-
-LEVEL = ../../..
-LIBRARYNAME = LLVMipa
-BUILD_ARCHIVE = 1
-include $(LEVEL)/Makefile.common
-
diff --git a/release_23/lib/Analysis/InstCount.cpp b/release_23/lib/Analysis/InstCount.cpp
deleted file mode 100644
index c4f36d3874cd..000000000000
--- a/release_23/lib/Analysis/InstCount.cpp
+++ /dev/null
@@ -1,86 +0,0 @@
-//===-- InstCount.cpp - Collects the count of all instructions ------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This pass collects the count of all instructions and reports them
-//
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "instcount"
-#include "llvm/Analysis/Passes.h"
-#include "llvm/Pass.h"
-#include "llvm/Function.h"
-#include "llvm/Support/Compiler.h"
-#include "llvm/Support/InstVisitor.h"
-#include "llvm/Support/Streams.h"
-#include "llvm/ADT/Statistic.h"
-#include <ostream>
-using namespace llvm;
-
-STATISTIC(TotalInsts , "Number of instructions (of all types)");
-STATISTIC(TotalBlocks, "Number of basic blocks");
-STATISTIC(TotalFuncs , "Number of non-external functions");
-STATISTIC(TotalMemInst, "Number of memory instructions");
-
-#define HANDLE_INST(N, OPCODE, CLASS) \
- STATISTIC(Num ## OPCODE ## Inst, "Number of " #OPCODE " insts");
-
-#include "llvm/Instruction.def"
-
-
-namespace {
- class VISIBILITY_HIDDEN InstCount
- : public FunctionPass, public InstVisitor<InstCount> {
- friend class InstVisitor<InstCount>;
-
- void visitFunction (Function &F) { ++TotalFuncs; }
- void visitBasicBlock(BasicBlock &BB) { ++TotalBlocks; }
-
-#define HANDLE_INST(N, OPCODE, CLASS) \
- void visit##OPCODE(CLASS &) { ++Num##OPCODE##Inst; ++TotalInsts; }
-
-#include "llvm/Instruction.def"
-
- void visitInstruction(Instruction &I) {
- cerr << "Instruction Count does not know about " << I;
- abort();
- }
- public:
- static char ID; // Pass identification, replacement for typeid
- InstCount() : FunctionPass((intptr_t)&ID) {}
-
- virtual bool runOnFunction(Function &F);
-
- virtual void getAnalysisUsage(AnalysisUsage &AU) const {
- AU.setPreservesAll();
- }
- virtual void print(std::ostream &O, const Module *M) const {}
-
- };
-
- char InstCount::ID = 0;
- RegisterPass<InstCount> X("instcount",
- "Counts the various types of Instructions", false, true);
-}
-
-FunctionPass *llvm::createInstCountPass() { return new InstCount(); }
-
-// InstCount::run - This is the main Analysis entry point for a
-// function.
-//
-bool InstCount::runOnFunction(Function &F) {
- unsigned StartMemInsts =
- NumGetElementPtrInst + NumLoadInst + NumStoreInst + NumCallInst +
- NumInvokeInst + NumAllocaInst + NumMallocInst + NumFreeInst;
- visit(F);
- unsigned EndMemInsts =
- NumGetElementPtrInst + NumLoadInst + NumStoreInst + NumCallInst +
- NumInvokeInst + NumAllocaInst + NumMallocInst + NumFreeInst;
- TotalMemInst += EndMemInsts-StartMemInsts;
- return false;
-}
diff --git a/release_23/lib/Analysis/Interval.cpp b/release_23/lib/Analysis/Interval.cpp
deleted file mode 100644
index 16b194723071..000000000000
--- a/release_23/lib/Analysis/Interval.cpp
+++ /dev/null
@@ -1,57 +0,0 @@
-//===- Interval.cpp - Interval class code ---------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains the definition of the Interval class, which represents a
-// partition of a control flow graph of some kind.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Analysis/Interval.h"
-#include "llvm/BasicBlock.h"
-#include "llvm/Support/CFG.h"
-#include <algorithm>
-
-using namespace llvm;
-
-//===----------------------------------------------------------------------===//
-// Interval Implementation
-//===----------------------------------------------------------------------===//
-
-// isLoop - Find out if there is a back edge in this interval...
-//
-bool Interval::isLoop() const {
- // There is a loop in this interval iff one of the predecessors of the header
- // node lives in the interval.
- for (::pred_iterator I = ::pred_begin(HeaderNode), E = ::pred_end(HeaderNode);
- I != E; ++I) {
- if (contains(*I)) return true;
- }
- return false;
-}
-
-
-void Interval::print(std::ostream &o) const {
- o << "-------------------------------------------------------------\n"
- << "Interval Contents:\n";
-
- // Print out all of the basic blocks in the interval...
- for (std::vector<BasicBlock*>::const_iterator I = Nodes.begin(),
- E = Nodes.end(); I != E; ++I)
- o << **I << "\n";
-
- o << "Interval Predecessors:\n";
- for (std::vector<BasicBlock*>::const_iterator I = Predecessors.begin(),
- E = Predecessors.end(); I != E; ++I)
- o << **I << "\n";
-
- o << "Interval Successors:\n";
- for (std::vector<BasicBlock*>::const_iterator I = Successors.begin(),
- E = Successors.end(); I != E; ++I)
- o << **I << "\n";
-}
diff --git a/release_23/lib/Analysis/IntervalPartition.cpp b/release_23/lib/Analysis/IntervalPartition.cpp
deleted file mode 100644
index a430cffc3580..000000000000
--- a/release_23/lib/Analysis/IntervalPartition.cpp
+++ /dev/null
@@ -1,114 +0,0 @@
-//===- IntervalPartition.cpp - Interval Partition module code -------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains the definition of the IntervalPartition class, which
-// calculates and represent the interval partition of a function.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Analysis/IntervalIterator.h"
-using namespace llvm;
-
-char IntervalPartition::ID = 0;
-static RegisterPass<IntervalPartition>
-X("intervals", "Interval Partition Construction", true, true);
-
-//===----------------------------------------------------------------------===//
-// IntervalPartition Implementation
-//===----------------------------------------------------------------------===//
-
-// destroy - Reset state back to before function was analyzed
-void IntervalPartition::destroy() {
- for (unsigned i = 0, e = Intervals.size(); i != e; ++i)
- delete Intervals[i];
- IntervalMap.clear();
- RootInterval = 0;
-}
-
-void IntervalPartition::print(std::ostream &O, const Module*) const {
- for(unsigned i = 0, e = Intervals.size(); i != e; ++i)
- Intervals[i]->print(O);
-}
-
-// addIntervalToPartition - Add an interval to the internal list of intervals,
-// and then add mappings from all of the basic blocks in the interval to the
-// interval itself (in the IntervalMap).
-//
-void IntervalPartition::addIntervalToPartition(Interval *I) {
- Intervals.push_back(I);
-
- // Add mappings for all of the basic blocks in I to the IntervalPartition
- for (Interval::node_iterator It = I->Nodes.begin(), End = I->Nodes.end();
- It != End; ++It)
- IntervalMap.insert(std::make_pair(*It, I));
-}
-
-// updatePredecessors - Interval generation only sets the successor fields of
-// the interval data structures. After interval generation is complete,
-// run through all of the intervals and propagate successor info as
-// predecessor info.
-//
-void IntervalPartition::updatePredecessors(Interval *Int) {
- BasicBlock *Header = Int->getHeaderNode();
- for (Interval::succ_iterator I = Int->Successors.begin(),
- E = Int->Successors.end(); I != E; ++I)
- getBlockInterval(*I)->Predecessors.push_back(Header);
-}
-
-// IntervalPartition ctor - Build the first level interval partition for the
-// specified function...
-//
-bool IntervalPartition::runOnFunction(Function &F) {
- // Pass false to intervals_begin because we take ownership of it's memory
- function_interval_iterator I = intervals_begin(&F, false);
- assert(I != intervals_end(&F) && "No intervals in function!?!?!");
-
- addIntervalToPartition(RootInterval = *I);
-
- ++I; // After the first one...
-
- // Add the rest of the intervals to the partition.
- for (function_interval_iterator E = intervals_end(&F); I != E; ++I)
- addIntervalToPartition(*I);
-
- // Now that we know all of the successor information, propagate this to the
- // predecessors for each block.
- for (unsigned i = 0, e = Intervals.size(); i != e; ++i)
- updatePredecessors(Intervals[i]);
- return false;
-}
-
-
-// IntervalPartition ctor - Build a reduced interval partition from an
-// existing interval graph. This takes an additional boolean parameter to
-// distinguish it from a copy constructor. Always pass in false for now.
-//
-IntervalPartition::IntervalPartition(IntervalPartition &IP, bool)
- : FunctionPass((intptr_t) &ID) {
- Interval *FunctionStart = IP.getRootInterval();
- assert(FunctionStart && "Cannot operate on empty IntervalPartitions!");
-
- // Pass false to intervals_begin because we take ownership of it's memory
- interval_part_interval_iterator I = intervals_begin(IP, false);
- assert(I != intervals_end(IP) && "No intervals in interval partition!?!?!");
-
- addIntervalToPartition(RootInterval = *I);
-
- ++I; // After the first one...
-
- // Add the rest of the intervals to the partition.
- for (interval_part_interval_iterator E = intervals_end(IP); I != E; ++I)
- addIntervalToPartition(*I);
-
- // Now that we know all of the successor information, propagate this to the
- // predecessors for each block.
- for (unsigned i = 0, e = Intervals.size(); i != e; ++i)
- updatePredecessors(Intervals[i]);
-}
-
diff --git a/release_23/lib/Analysis/LibCallAliasAnalysis.cpp b/release_23/lib/Analysis/LibCallAliasAnalysis.cpp
deleted file mode 100644
index 2fd17cfacc57..000000000000
--- a/release_23/lib/Analysis/LibCallAliasAnalysis.cpp
+++ /dev/null
@@ -1,169 +0,0 @@
-//===- LibCallAliasAnalysis.cpp - Implement AliasAnalysis for libcalls ----===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the LibCallAliasAnalysis class.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Analysis/Passes.h"
-#include "llvm/Analysis/LibCallSemantics.h"
-#include "llvm/Function.h"
-#include "llvm/Pass.h"
-#include "llvm/Target/TargetData.h"
-using namespace llvm;
-
-namespace {
- /// LibCallAliasAnalysis - Alias analysis driven from LibCallInfo.
- struct LibCallAliasAnalysis : public FunctionPass, AliasAnalysis {
- static char ID; // Class identification
-
- LibCallInfo *LCI;
-
- LibCallAliasAnalysis(LibCallInfo *LC = 0)
- : FunctionPass((intptr_t)&ID), LCI(LC) {
- }
- ~LibCallAliasAnalysis() {
- delete LCI;
- }
-
- ModRefResult getModRefInfo(CallSite CS, Value *P, unsigned Size);
- ModRefResult getModRefInfo(CallSite CS1, CallSite CS2) {
- // TODO: Could compare two direct calls against each other if we cared to.
- return AliasAnalysis::getModRefInfo(CS1,CS2);
- }
-
- virtual void getAnalysisUsage(AnalysisUsage &AU) const {
- AliasAnalysis::getAnalysisUsage(AU);
- AU.addRequired<TargetData>();
- AU.setPreservesAll(); // Does not transform code
- }
-
- virtual bool runOnFunction(Function &F) {
- InitializeAliasAnalysis(this); // set up super class
- return false;
- }
-
- /// hasNoModRefInfoForCalls - We can provide mod/ref information against
- /// non-escaping allocations.
- virtual bool hasNoModRefInfoForCalls() const { return false; }
- private:
- ModRefResult AnalyzeLibCallDetails(const LibCallFunctionInfo *FI,
- CallSite CS, Value *P, unsigned Size);
- };
-
- // Register this pass...
- char LibCallAliasAnalysis::ID = 0;
- RegisterPass<LibCallAliasAnalysis>
- X("libcall-aa", "LibCall Alias Analysis", false, true);
-
- // Declare that we implement the AliasAnalysis interface
- RegisterAnalysisGroup<AliasAnalysis> Y(X);
-} // End of llvm namespace
-
-FunctionPass *llvm::createLibCallAliasAnalysisPass(LibCallInfo *LCI) {
- return new LibCallAliasAnalysis(LCI);
-}
-
-
-/// AnalyzeLibCallDetails - Given a call to a function with the specified
-/// LibCallFunctionInfo, see if we can improve the mod/ref footprint of the call
-/// vs the specified pointer/size.
-AliasAnalysis::ModRefResult
-LibCallAliasAnalysis::AnalyzeLibCallDetails(const LibCallFunctionInfo *FI,
- CallSite CS, Value *P,
- unsigned Size) {
- // If we have a function, check to see what kind of mod/ref effects it
- // has. Start by including any info globally known about the function.
- AliasAnalysis::ModRefResult MRInfo = FI->UniversalBehavior;
- if (MRInfo == NoModRef) return MRInfo;
-
- // If that didn't tell us that the function is 'readnone', check to see
- // if we have detailed info and if 'P' is any of the locations we know
- // about.
- const LibCallFunctionInfo::LocationMRInfo *Details = FI->LocationDetails;
- if (Details == 0)
- return MRInfo;
-
- // If the details array is of the 'DoesNot' kind, we only know something if
- // the pointer is a match for one of the locations in 'Details'. If we find a
- // match, we can prove some interactions cannot happen.
- //
- if (FI->DetailsType == LibCallFunctionInfo::DoesNot) {
- // Find out if the pointer refers to a known location.
- for (unsigned i = 0; Details[i].LocationID != ~0U; ++i) {
- const LibCallLocationInfo &Loc =
- LCI->getLocationInfo(Details[i].LocationID);
- LibCallLocationInfo::LocResult Res = Loc.isLocation(CS, P, Size);
- if (Res != LibCallLocationInfo::Yes) continue;
-
- // If we find a match against a location that we 'do not' interact with,
- // learn this info into MRInfo.
- return ModRefResult(MRInfo & ~Details[i].MRInfo);
- }
- return MRInfo;
- }
-
- // If the details are of the 'DoesOnly' sort, we know something if the pointer
- // is a match for one of the locations in 'Details'. Also, if we can prove
- // that the pointers is *not* one of the locations in 'Details', we know that
- // the call is NoModRef.
- assert(FI->DetailsType == LibCallFunctionInfo::DoesOnly);
-
- // Find out if the pointer refers to a known location.
- bool NoneMatch = true;
- for (unsigned i = 0; Details[i].LocationID != ~0U; ++i) {
- const LibCallLocationInfo &Loc =
- LCI->getLocationInfo(Details[i].LocationID);
- LibCallLocationInfo::LocResult Res = Loc.isLocation(CS, P, Size);
- if (Res == LibCallLocationInfo::No) continue;
-
- // If we don't know if this pointer points to the location, then we have to
- // assume it might alias in some case.
- if (Res == LibCallLocationInfo::Unknown) {
- NoneMatch = false;
- continue;
- }
-
- // If we know that this pointer definitely is pointing into the location,
- // merge in this information.
- return ModRefResult(MRInfo & Details[i].MRInfo);
- }
-
- // If we found that the pointer is guaranteed to not match any of the
- // locations in our 'DoesOnly' rule, then we know that the pointer must point
- // to some other location. Since the libcall doesn't mod/ref any other
- // locations, return NoModRef.
- if (NoneMatch)
- return NoModRef;
-
- // Otherwise, return any other info gained so far.
- return MRInfo;
-}
-
-// getModRefInfo - Check to see if the specified callsite can clobber the
-// specified memory object.
-//
-AliasAnalysis::ModRefResult
-LibCallAliasAnalysis::getModRefInfo(CallSite CS, Value *P, unsigned Size) {
- ModRefResult MRInfo = ModRef;
-
- // If this is a direct call to a function that LCI knows about, get the
- // information about the runtime function.
- if (Function *F = CS.getCalledFunction()) {
- if (LCI && F->isDeclaration()) {
- if (const LibCallFunctionInfo *FI = LCI->getFunctionInfo(F)) {
- MRInfo = ModRefResult(MRInfo & AnalyzeLibCallDetails(FI, CS, P, Size));
- if (MRInfo == NoModRef) return NoModRef;
- }
- }
- }
-
- // The AliasAnalysis base class has some smarts, lets use them.
- return (ModRefResult)(MRInfo | AliasAnalysis::getModRefInfo(CS, P, Size));
-}
diff --git a/release_23/lib/Analysis/LibCallSemantics.cpp b/release_23/lib/Analysis/LibCallSemantics.cpp
deleted file mode 100644
index 29850471f7dc..000000000000
--- a/release_23/lib/Analysis/LibCallSemantics.cpp
+++ /dev/null
@@ -1,65 +0,0 @@
-//===- LibCallSemantics.cpp - Describe library semantics ------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements interfaces that can be used to describe language
-// specific runtime library interfaces (e.g. libc, libm, etc) to LLVM
-// optimizers.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Analysis/LibCallSemantics.h"
-#include "llvm/ADT/StringMap.h"
-#include "llvm/Function.h"
-using namespace llvm;
-
-/// getMap - This impl pointer in ~LibCallInfo is actually a StringMap. This
-/// helper does the cast.
-static StringMap<const LibCallFunctionInfo*> *getMap(void *Ptr) {
- return static_cast<StringMap<const LibCallFunctionInfo*> *>(Ptr);
-}
-
-LibCallInfo::~LibCallInfo() {
- delete getMap(Impl);
-}
-
-const LibCallLocationInfo &LibCallInfo::getLocationInfo(unsigned LocID) const {
- // Get location info on the first call.
- if (NumLocations == 0)
- NumLocations = getLocationInfo(Locations);
-
- assert(LocID < NumLocations && "Invalid location ID!");
- return Locations[LocID];
-}
-
-
-/// getFunctionInfo - Return the LibCallFunctionInfo object corresponding to
-/// the specified function if we have it. If not, return null.
-const LibCallFunctionInfo *LibCallInfo::getFunctionInfo(Function *F) const {
- StringMap<const LibCallFunctionInfo*> *Map = getMap(Impl);
-
- /// If this is the first time we are querying for this info, lazily construct
- /// the StringMap to index it.
- if (Map == 0) {
- Impl = Map = new StringMap<const LibCallFunctionInfo*>();
-
- const LibCallFunctionInfo *Array = getFunctionInfoArray();
- if (Array == 0) return 0;
-
- // We now have the array of entries. Populate the StringMap.
- for (unsigned i = 0; Array[i].Name; ++i)
- (*Map)[Array[i].Name] = Array+i;
- }
-
- // Look up this function in the string map.
- const char *ValueName = F->getNameStart();
- StringMap<const LibCallFunctionInfo*>::iterator I =
- Map->find(ValueName, ValueName+F->getNameLen());
- return I != Map->end() ? I->second : 0;
-}
-
diff --git a/release_23/lib/Analysis/LoadValueNumbering.cpp b/release_23/lib/Analysis/LoadValueNumbering.cpp
deleted file mode 100644
index bbb1e1e1b0db..000000000000
--- a/release_23/lib/Analysis/LoadValueNumbering.cpp
+++ /dev/null
@@ -1,528 +0,0 @@
-//===- LoadValueNumbering.cpp - Load Value #'ing Implementation -*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements a value numbering pass that value numbers load and call
-// instructions. To do this, it finds lexically identical load instructions,
-// and uses alias analysis to determine which loads are guaranteed to produce
-// the same value. To value number call instructions, it looks for calls to
-// functions that do not write to memory which do not have intervening
-// instructions that clobber the memory that is read from.
-//
-// This pass builds off of another value numbering pass to implement value
-// numbering for non-load and non-call instructions. It uses Alias Analysis so
-// that it can disambiguate the load instructions. The more powerful these base
-// analyses are, the more powerful the resultant value numbering will be.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Analysis/LoadValueNumbering.h"
-#include "llvm/Constants.h"
-#include "llvm/Function.h"
-#include "llvm/Instructions.h"
-#include "llvm/Pass.h"
-#include "llvm/Type.h"
-#include "llvm/Analysis/ValueNumbering.h"
-#include "llvm/Analysis/AliasAnalysis.h"
-#include "llvm/Analysis/Dominators.h"
-#include "llvm/Support/CFG.h"
-#include "llvm/Support/Compiler.h"
-#include "llvm/Target/TargetData.h"
-#include <set>
-#include <algorithm>
-using namespace llvm;
-
-namespace {
- // FIXME: This should not be a FunctionPass.
- struct VISIBILITY_HIDDEN LoadVN : public FunctionPass, public ValueNumbering {
- static char ID; // Class identification, replacement for typeinfo
- LoadVN() : FunctionPass((intptr_t)&ID) {}
-
- /// Pass Implementation stuff. This doesn't do any analysis.
- ///
- bool runOnFunction(Function &) { return false; }
-
- /// getAnalysisUsage - Does not modify anything. It uses Value Numbering
- /// and Alias Analysis.
- ///
- virtual void getAnalysisUsage(AnalysisUsage &AU) const;
-
- /// getEqualNumberNodes - Return nodes with the same value number as the
- /// specified Value. This fills in the argument vector with any equal
- /// values.
- ///
- virtual void getEqualNumberNodes(Value *V1,
- std::vector<Value*> &RetVals) const;
-
- /// deleteValue - This method should be called whenever an LLVM Value is
- /// deleted from the program, for example when an instruction is found to be
- /// redundant and is eliminated.
- ///
- virtual void deleteValue(Value *V) {
- getAnalysis<AliasAnalysis>().deleteValue(V);
- }
-
- /// copyValue - This method should be used whenever a preexisting value in
- /// the program is copied or cloned, introducing a new value. Note that
- /// analysis implementations should tolerate clients that use this method to
- /// introduce the same value multiple times: if the analysis already knows
- /// about a value, it should ignore the request.
- ///
- virtual void copyValue(Value *From, Value *To) {
- getAnalysis<AliasAnalysis>().copyValue(From, To);
- }
-
- /// getCallEqualNumberNodes - Given a call instruction, find other calls
- /// that have the same value number.
- void getCallEqualNumberNodes(CallInst *CI,
- std::vector<Value*> &RetVals) const;
- };
-
- char LoadVN::ID = 0;
- // Register this pass...
- RegisterPass<LoadVN> X("load-vn", "Load Value Numbering", false, true);
-
- // Declare that we implement the ValueNumbering interface
- RegisterAnalysisGroup<ValueNumbering> Y(X);
-}
-
-FunctionPass *llvm::createLoadValueNumberingPass() { return new LoadVN(); }
-
-
-/// getAnalysisUsage - Does not modify anything. It uses Value Numbering and
-/// Alias Analysis.
-///
-void LoadVN::getAnalysisUsage(AnalysisUsage &AU) const {
- AU.setPreservesAll();
- AU.addRequiredTransitive<AliasAnalysis>();
- AU.addRequired<ValueNumbering>();
- AU.addRequiredTransitive<DominatorTree>();
- AU.addRequiredTransitive<TargetData>();
-}
-
-static bool isPathTransparentTo(BasicBlock *CurBlock, BasicBlock *Dom,
- Value *Ptr, unsigned Size, AliasAnalysis &AA,
- std::set<BasicBlock*> &Visited,
- std::map<BasicBlock*, bool> &TransparentBlocks){
- // If we have already checked out this path, or if we reached our destination,
- // stop searching, returning success.
- if (CurBlock == Dom || !Visited.insert(CurBlock).second)
- return true;
-
- // Check whether this block is known transparent or not.
- std::map<BasicBlock*, bool>::iterator TBI =
- TransparentBlocks.lower_bound(CurBlock);
-
- if (TBI == TransparentBlocks.end() || TBI->first != CurBlock) {
- // If this basic block can modify the memory location, then the path is not
- // transparent!
- if (AA.canBasicBlockModify(*CurBlock, Ptr, Size)) {
- TransparentBlocks.insert(TBI, std::make_pair(CurBlock, false));
- return false;
- }
- TransparentBlocks.insert(TBI, std::make_pair(CurBlock, true));
- } else if (!TBI->second)
- // This block is known non-transparent, so that path can't be either.
- return false;
-
- // The current block is known to be transparent. The entire path is
- // transparent if all of the predecessors paths to the parent is also
- // transparent to the memory location.
- for (pred_iterator PI = pred_begin(CurBlock), E = pred_end(CurBlock);
- PI != E; ++PI)
- if (!isPathTransparentTo(*PI, Dom, Ptr, Size, AA, Visited,
- TransparentBlocks))
- return false;
- return true;
-}
-
-/// getCallEqualNumberNodes - Given a call instruction, find other calls that
-/// have the same value number.
-void LoadVN::getCallEqualNumberNodes(CallInst *CI,
- std::vector<Value*> &RetVals) const {
- Function *CF = CI->getCalledFunction();
- if (CF == 0) return; // Indirect call.
- AliasAnalysis &AA = getAnalysis<AliasAnalysis>();
- AliasAnalysis::ModRefBehavior MRB = AA.getModRefBehavior(CI);
- if (MRB != AliasAnalysis::DoesNotAccessMemory &&
- MRB != AliasAnalysis::OnlyReadsMemory)
- return; // Nothing we can do for now.
-
- // Scan all of the arguments of the function, looking for one that is not
- // global. In particular, we would prefer to have an argument or instruction
- // operand to chase the def-use chains of.
- Value *Op = CF;
- for (unsigned i = 1, e = CI->getNumOperands(); i != e; ++i)
- if (isa<Argument>(CI->getOperand(i)) ||
- isa<Instruction>(CI->getOperand(i))) {
- Op = CI->getOperand(i);
- break;
- }
-
- // Identify all lexically identical calls in this function.
- std::vector<CallInst*> IdenticalCalls;
-
- Function *CIFunc = CI->getParent()->getParent();
- for (Value::use_iterator UI = Op->use_begin(), E = Op->use_end(); UI != E;
- ++UI)
- if (CallInst *C = dyn_cast<CallInst>(*UI))
- if (C->getNumOperands() == CI->getNumOperands() &&
- C->getOperand(0) == CI->getOperand(0) &&
- C->getParent()->getParent() == CIFunc && C != CI) {
- bool AllOperandsEqual = true;
- for (unsigned i = 1, e = CI->getNumOperands(); i != e; ++i)
- if (C->getOperand(i) != CI->getOperand(i)) {
- AllOperandsEqual = false;
- break;
- }
-
- if (AllOperandsEqual)
- IdenticalCalls.push_back(C);
- }
-
- if (IdenticalCalls.empty()) return;
-
- // Eliminate duplicates, which could occur if we chose a value that is passed
- // into a call site multiple times.
- std::sort(IdenticalCalls.begin(), IdenticalCalls.end());
- IdenticalCalls.erase(std::unique(IdenticalCalls.begin(),IdenticalCalls.end()),
- IdenticalCalls.end());
-
- // If the call reads memory, we must make sure that there are no stores
- // between the calls in question.
- //
- // FIXME: This should use mod/ref information. What we really care about it
- // whether an intervening instruction could modify memory that is read, not
- // ANY memory.
- //
- if (MRB == AliasAnalysis::OnlyReadsMemory) {
- DominatorTree &DT = getAnalysis<DominatorTree>();
- BasicBlock *CIBB = CI->getParent();
- for (unsigned i = 0; i != IdenticalCalls.size(); ++i) {
- CallInst *C = IdenticalCalls[i];
- bool CantEqual = false;
-
- if (DT.dominates(CIBB, C->getParent())) {
- // FIXME: we currently only handle the case where both calls are in the
- // same basic block.
- if (CIBB != C->getParent()) {
- CantEqual = true;
- } else {
- Instruction *First = CI, *Second = C;
- if (!DT.dominates(CI, C))
- std::swap(First, Second);
-
- // Scan the instructions between the calls, checking for stores or
- // calls to dangerous functions.
- BasicBlock::iterator I = First;
- for (++First; I != BasicBlock::iterator(Second); ++I) {
- if (isa<StoreInst>(I)) {
- // FIXME: We could use mod/ref information to make this much
- // better!
- CantEqual = true;
- break;
- } else if (CallInst *CI = dyn_cast<CallInst>(I)) {
- if (!AA.onlyReadsMemory(CI)) {
- CantEqual = true;
- break;
- }
- } else if (I->mayWriteToMemory()) {
- CantEqual = true;
- break;
- }
- }
- }
-
- } else if (DT.dominates(C->getParent(), CIBB)) {
- // FIXME: We could implement this, but we don't for now.
- CantEqual = true;
- } else {
- // FIXME: if one doesn't dominate the other, we can't tell yet.
- CantEqual = true;
- }
-
-
- if (CantEqual) {
- // This call does not produce the same value as the one in the query.
- std::swap(IdenticalCalls[i--], IdenticalCalls.back());
- IdenticalCalls.pop_back();
- }
- }
- }
-
- // Any calls that are identical and not destroyed will produce equal values!
- for (unsigned i = 0, e = IdenticalCalls.size(); i != e; ++i)
- RetVals.push_back(IdenticalCalls[i]);
-}
-
-// getEqualNumberNodes - Return nodes with the same value number as the
-// specified Value. This fills in the argument vector with any equal values.
-//
-void LoadVN::getEqualNumberNodes(Value *V,
- std::vector<Value*> &RetVals) const {
- // If the alias analysis has any must alias information to share with us, we
- // can definitely use it.
- if (isa<PointerType>(V->getType()))
- getAnalysis<AliasAnalysis>().getMustAliases(V, RetVals);
-
- if (!isa<LoadInst>(V)) {
- if (CallInst *CI = dyn_cast<CallInst>(V))
- getCallEqualNumberNodes(CI, RetVals);
-
- // Not a load instruction? Just chain to the base value numbering
- // implementation to satisfy the request...
- assert(&getAnalysis<ValueNumbering>() != (ValueNumbering*)this &&
- "getAnalysis() returned this!");
-
- return getAnalysis<ValueNumbering>().getEqualNumberNodes(V, RetVals);
- }
-
- // Volatile loads cannot be replaced with the value of other loads.
- LoadInst *LI = cast<LoadInst>(V);
- if (LI->isVolatile())
- return getAnalysis<ValueNumbering>().getEqualNumberNodes(V, RetVals);
-
- Value *LoadPtr = LI->getOperand(0);
- BasicBlock *LoadBB = LI->getParent();
- Function *F = LoadBB->getParent();
-
- // Find out how many bytes of memory are loaded by the load instruction...
- unsigned LoadSize = getAnalysis<TargetData>().getTypeStoreSize(LI->getType());
- AliasAnalysis &AA = getAnalysis<AliasAnalysis>();
-
- // Figure out if the load is invalidated from the entry of the block it is in
- // until the actual instruction. This scans the block backwards from LI. If
- // we see any candidate load or store instructions, then we know that the
- // candidates have the same value # as LI.
- bool LoadInvalidatedInBBBefore = false;
- for (BasicBlock::iterator I = LI; I != LoadBB->begin(); ) {
- --I;
- if (I == LoadPtr) {
- // If we run into an allocation of the value being loaded, then the
- // contents are not initialized.
- if (isa<AllocationInst>(I))
- RetVals.push_back(UndefValue::get(LI->getType()));
-
- // Otherwise, since this is the definition of what we are loading, this
- // loaded value cannot occur before this block.
- LoadInvalidatedInBBBefore = true;
- break;
- } else if (LoadInst *LI = dyn_cast<LoadInst>(I)) {
- // If this instruction is a candidate load before LI, we know there are no
- // invalidating instructions between it and LI, so they have the same
- // value number.
- if (LI->getOperand(0) == LoadPtr && !LI->isVolatile())
- RetVals.push_back(I);
- }
-
- if (AA.getModRefInfo(I, LoadPtr, LoadSize) & AliasAnalysis::Mod) {
- // If the invalidating instruction is a store, and its in our candidate
- // set, then we can do store-load forwarding: the load has the same value
- // # as the stored value.
- if (StoreInst *SI = dyn_cast<StoreInst>(I))
- if (SI->getOperand(1) == LoadPtr)
- RetVals.push_back(I->getOperand(0));
-
- LoadInvalidatedInBBBefore = true;
- break;
- }
- }
-
- // Figure out if the load is invalidated between the load and the exit of the
- // block it is defined in. While we are scanning the current basic block, if
- // we see any candidate loads, then we know they have the same value # as LI.
- //
- bool LoadInvalidatedInBBAfter = false;
- {
- BasicBlock::iterator I = LI;
- for (++I; I != LoadBB->end(); ++I) {
- // If this instruction is a load, then this instruction returns the same
- // value as LI.
- if (isa<LoadInst>(I) && cast<LoadInst>(I)->getOperand(0) == LoadPtr)
- RetVals.push_back(I);
-
- if (AA.getModRefInfo(I, LoadPtr, LoadSize) & AliasAnalysis::Mod) {
- LoadInvalidatedInBBAfter = true;
- break;
- }
- }
- }
-
- // If the pointer is clobbered on entry and on exit to the function, there is
- // no need to do any global analysis at all.
- if (LoadInvalidatedInBBBefore && LoadInvalidatedInBBAfter)
- return;
-
- // Now that we know the value is not neccesarily killed on entry or exit to
- // the BB, find out how many load and store instructions (to this location)
- // live in each BB in the function.
- //
- std::map<BasicBlock*, unsigned> CandidateLoads;
- std::set<BasicBlock*> CandidateStores;
-
- for (Value::use_iterator UI = LoadPtr->use_begin(), UE = LoadPtr->use_end();
- UI != UE; ++UI)
- if (LoadInst *Cand = dyn_cast<LoadInst>(*UI)) {// Is a load of source?
- if (Cand->getParent()->getParent() == F && // In the same function?
- // Not in LI's block?
- Cand->getParent() != LoadBB && !Cand->isVolatile())
- ++CandidateLoads[Cand->getParent()]; // Got one.
- } else if (StoreInst *Cand = dyn_cast<StoreInst>(*UI)) {
- if (Cand->getParent()->getParent() == F && !Cand->isVolatile() &&
- Cand->getOperand(1) == LoadPtr) // It's a store THROUGH the ptr.
- CandidateStores.insert(Cand->getParent());
- }
-
- // Get dominators.
- DominatorTree &DT = getAnalysis<DominatorTree>();
-
- // TransparentBlocks - For each basic block the load/store is alive across,
- // figure out if the pointer is invalidated or not. If it is invalidated, the
- // boolean is set to false, if it's not it is set to true. If we don't know
- // yet, the entry is not in the map.
- std::map<BasicBlock*, bool> TransparentBlocks;
-
- // Loop over all of the basic blocks that also load the value. If the value
- // is live across the CFG from the source to destination blocks, and if the
- // value is not invalidated in either the source or destination blocks, add it
- // to the equivalence sets.
- for (std::map<BasicBlock*, unsigned>::iterator
- I = CandidateLoads.begin(), E = CandidateLoads.end(); I != E; ++I) {
- bool CantEqual = false;
-
- // Right now we only can handle cases where one load dominates the other.
- // FIXME: generalize this!
- BasicBlock *BB1 = I->first, *BB2 = LoadBB;
- if (DT.dominates(BB1, BB2)) {
- // The other load dominates LI. If the loaded value is killed entering
- // the LoadBB block, we know the load is not live.
- if (LoadInvalidatedInBBBefore)
- CantEqual = true;
- } else if (DT.dominates(BB2, BB1)) {
- std::swap(BB1, BB2); // Canonicalize
- // LI dominates the other load. If the loaded value is killed exiting
- // the LoadBB block, we know the load is not live.
- if (LoadInvalidatedInBBAfter)
- CantEqual = true;
- } else {
- // None of these loads can VN the same.
- CantEqual = true;
- }
-
- if (!CantEqual) {
- // Ok, at this point, we know that BB1 dominates BB2, and that there is
- // nothing in the LI block that kills the loaded value. Check to see if
- // the value is live across the CFG.
- std::set<BasicBlock*> Visited;
- for (pred_iterator PI = pred_begin(BB2), E = pred_end(BB2); PI!=E; ++PI)
- if (!isPathTransparentTo(*PI, BB1, LoadPtr, LoadSize, AA,
- Visited, TransparentBlocks)) {
- // None of these loads can VN the same.
- CantEqual = true;
- break;
- }
- }
-
- // If the loads can equal so far, scan the basic block that contains the
- // loads under consideration to see if they are invalidated in the block.
- // For any loads that are not invalidated, add them to the equivalence
- // set!
- if (!CantEqual) {
- unsigned NumLoads = I->second;
- if (BB1 == LoadBB) {
- // If LI dominates the block in question, check to see if any of the
- // loads in this block are invalidated before they are reached.
- for (BasicBlock::iterator BBI = I->first->begin(); ; ++BBI) {
- if (LoadInst *LI = dyn_cast<LoadInst>(BBI)) {
- if (LI->getOperand(0) == LoadPtr && !LI->isVolatile()) {
- // The load is in the set!
- RetVals.push_back(BBI);
- if (--NumLoads == 0) break; // Found last load to check.
- }
- } else if (AA.getModRefInfo(BBI, LoadPtr, LoadSize)
- & AliasAnalysis::Mod) {
- // If there is a modifying instruction, nothing below it will value
- // # the same.
- break;
- }
- }
- } else {
- // If the block dominates LI, make sure that the loads in the block are
- // not invalidated before the block ends.
- BasicBlock::iterator BBI = I->first->end();
- while (1) {
- --BBI;
- if (LoadInst *LI = dyn_cast<LoadInst>(BBI)) {
- if (LI->getOperand(0) == LoadPtr && !LI->isVolatile()) {
- // The load is the same as this load!
- RetVals.push_back(BBI);
- if (--NumLoads == 0) break; // Found all of the laods.
- }
- } else if (AA.getModRefInfo(BBI, LoadPtr, LoadSize)
- & AliasAnalysis::Mod) {
- // If there is a modifying instruction, nothing above it will value
- // # the same.
- break;
- }
- }
- }
- }
- }
-
- // Handle candidate stores. If the loaded location is clobbered on entrance
- // to the LoadBB, no store outside of the LoadBB can value number equal, so
- // quick exit.
- if (LoadInvalidatedInBBBefore)
- return;
-
- // Stores in the load-bb are handled above.
- CandidateStores.erase(LoadBB);
-
- for (std::set<BasicBlock*>::iterator I = CandidateStores.begin(),
- E = CandidateStores.end(); I != E; ++I)
- if (DT.dominates(*I, LoadBB)) {
- BasicBlock *StoreBB = *I;
-
- // Check to see if the path from the store to the load is transparent
- // w.r.t. the memory location.
- bool CantEqual = false;
- std::set<BasicBlock*> Visited;
- for (pred_iterator PI = pred_begin(LoadBB), E = pred_end(LoadBB);
- PI != E; ++PI)
- if (!isPathTransparentTo(*PI, StoreBB, LoadPtr, LoadSize, AA,
- Visited, TransparentBlocks)) {
- // None of these stores can VN the same.
- CantEqual = true;
- break;
- }
- Visited.clear();
- if (!CantEqual) {
- // Okay, the path from the store block to the load block is clear, and
- // we know that there are no invalidating instructions from the start
- // of the load block to the load itself. Now we just scan the store
- // block.
-
- BasicBlock::iterator BBI = StoreBB->end();
- while (1) {
- assert(BBI != StoreBB->begin() &&
- "There is a store in this block of the pointer, but the store"
- " doesn't mod the address being stored to?? Must be a bug in"
- " the alias analysis implementation!");
- --BBI;
- if (AA.getModRefInfo(BBI, LoadPtr, LoadSize) & AliasAnalysis::Mod) {
- // If the invalidating instruction is one of the candidates,
- // then it provides the value the load loads.
- if (StoreInst *SI = dyn_cast<StoreInst>(BBI))
- if (SI->getOperand(1) == LoadPtr)
- RetVals.push_back(SI->getOperand(0));
- break;
- }
- }
- }
- }
-}
diff --git a/release_23/lib/Analysis/LoopInfo.cpp b/release_23/lib/Analysis/LoopInfo.cpp
deleted file mode 100644
index b6c6c5ffc0b8..000000000000
--- a/release_23/lib/Analysis/LoopInfo.cpp
+++ /dev/null
@@ -1,53 +0,0 @@
-//===- LoopInfo.cpp - Natural Loop Calculator -----------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines the LoopInfo class that is used to identify natural loops
-// and determine the loop depth of various nodes of the CFG. Note that the
-// loops identified may actually be several natural loops that share the same
-// header node... not just a single natural loop.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Analysis/LoopInfo.h"
-#include "llvm/Constants.h"
-#include "llvm/Instructions.h"
-#include "llvm/Analysis/Dominators.h"
-#include "llvm/Assembly/Writer.h"
-#include "llvm/Support/CFG.h"
-#include "llvm/Support/Streams.h"
-#include "llvm/ADT/DepthFirstIterator.h"
-#include "llvm/ADT/SmallPtrSet.h"
-#include <algorithm>
-#include <ostream>
-using namespace llvm;
-
-char LoopInfo::ID = 0;
-static RegisterPass<LoopInfo>
-X("loops", "Natural Loop Construction", true, true);
-
-//===----------------------------------------------------------------------===//
-// Loop implementation
-//
-
-/// getNumBackEdges - Calculate the number of back edges to the loop header.
-///
-
-//===----------------------------------------------------------------------===//
-// LoopInfo implementation
-//
-bool LoopInfo::runOnFunction(Function &) {
- releaseMemory();
- LI->Calculate(getAnalysis<DominatorTree>().getBase()); // Update
- return false;
-}
-
-void LoopInfo::getAnalysisUsage(AnalysisUsage &AU) const {
- AU.setPreservesAll();
- AU.addRequired<DominatorTree>();
-}
diff --git a/release_23/lib/Analysis/LoopPass.cpp b/release_23/lib/Analysis/LoopPass.cpp
deleted file mode 100644
index b4534cd511f3..000000000000
--- a/release_23/lib/Analysis/LoopPass.cpp
+++ /dev/null
@@ -1,320 +0,0 @@
-//===- LoopPass.cpp - Loop Pass and Loop Pass Manager ---------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements LoopPass and LPPassManager. All loop optimization
-// and transformation passes are derived from LoopPass. LPPassManager is
-// responsible for managing LoopPasses.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Analysis/LoopPass.h"
-#include "llvm/Analysis/ScalarEvolution.h"
-using namespace llvm;
-
-//===----------------------------------------------------------------------===//
-// LPPassManager
-//
-
-char LPPassManager::ID = 0;
-/// LPPassManager manages FPPassManagers and CalLGraphSCCPasses.
-
-LPPassManager::LPPassManager(int Depth)
- : FunctionPass((intptr_t)&ID), PMDataManager(Depth) {
- skipThisLoop = false;
- redoThisLoop = false;
- LI = NULL;
- CurrentLoop = NULL;
-}
-
-/// Delete loop from the loop queue and loop hierarcy (LoopInfo).
-void LPPassManager::deleteLoopFromQueue(Loop *L) {
-
- if (Loop *ParentLoop = L->getParentLoop()) { // Not a top-level loop.
- // Reparent all of the blocks in this loop. Since BBLoop had a parent,
- // they are now all in it.
- for (Loop::block_iterator I = L->block_begin(), E = L->block_end();
- I != E; ++I)
- if (LI->getLoopFor(*I) == L) // Don't change blocks in subloops.
- LI->changeLoopFor(*I, ParentLoop);
-
- // Remove the loop from its parent loop.
- for (Loop::iterator I = ParentLoop->begin(), E = ParentLoop->end();;
- ++I) {
- assert(I != E && "Couldn't find loop");
- if (*I == L) {
- ParentLoop->removeChildLoop(I);
- break;
- }
- }
-
- // Move all subloops into the parent loop.
- while (!L->empty())
- ParentLoop->addChildLoop(L->removeChildLoop(L->end()-1));
- } else {
- // Reparent all of the blocks in this loop. Since BBLoop had no parent,
- // they no longer in a loop at all.
-
- for (unsigned i = 0; i != L->getBlocks().size(); ++i) {
- // Don't change blocks in subloops.
- if (LI->getLoopFor(L->getBlocks()[i]) == L) {
- LI->removeBlock(L->getBlocks()[i]);
- --i;
- }
- }
-
- // Remove the loop from the top-level LoopInfo object.
- for (LoopInfo::iterator I = LI->begin(), E = LI->end();; ++I) {
- assert(I != E && "Couldn't find loop");
- if (*I == L) {
- LI->removeLoop(I);
- break;
- }
- }
-
- // Move all of the subloops to the top-level.
- while (!L->empty())
- LI->addTopLevelLoop(L->removeChildLoop(L->end()-1));
- }
-
- delete L;
-
- // If L is current loop then skip rest of the passes and let
- // runOnFunction remove L from LQ. Otherwise, remove L from LQ now
- // and continue applying other passes on CurrentLoop.
- if (CurrentLoop == L) {
- skipThisLoop = true;
- return;
- }
-
- for (std::deque<Loop *>::iterator I = LQ.begin(),
- E = LQ.end(); I != E; ++I) {
- if (*I == L) {
- LQ.erase(I);
- break;
- }
- }
-}
-
-// Inset loop into loop nest (LoopInfo) and loop queue (LQ).
-void LPPassManager::insertLoop(Loop *L, Loop *ParentLoop) {
-
- assert (CurrentLoop != L && "Cannot insert CurrentLoop");
-
- // Insert into loop nest
- if (ParentLoop)
- ParentLoop->addChildLoop(L);
- else
- LI->addTopLevelLoop(L);
-
- // Insert L into loop queue
- if (L == CurrentLoop)
- redoLoop(L);
- else if (!ParentLoop)
- // This is top level loop.
- LQ.push_front(L);
- else {
- // Insert L after ParentLoop
- for (std::deque<Loop *>::iterator I = LQ.begin(),
- E = LQ.end(); I != E; ++I) {
- if (*I == ParentLoop) {
- // deque does not support insert after.
- ++I;
- LQ.insert(I, 1, L);
- break;
- }
- }
- }
-}
-
-// Reoptimize this loop. LPPassManager will re-insert this loop into the
-// queue. This allows LoopPass to change loop nest for the loop. This
-// utility may send LPPassManager into infinite loops so use caution.
-void LPPassManager::redoLoop(Loop *L) {
- assert (CurrentLoop == L && "Can redo only CurrentLoop");
- redoThisLoop = true;
-}
-
-/// cloneBasicBlockSimpleAnalysis - Invoke cloneBasicBlockAnalysis hook for
-/// all loop passes.
-void LPPassManager::cloneBasicBlockSimpleAnalysis(BasicBlock *From,
- BasicBlock *To, Loop *L) {
- for (unsigned Index = 0; Index < getNumContainedPasses(); ++Index) {
- Pass *P = getContainedPass(Index);
- LoopPass *LP = dynamic_cast<LoopPass *>(P);
- LP->cloneBasicBlockAnalysis(From, To, L);
- }
-}
-
-/// deleteSimpleAnalysisValue - Invoke deleteAnalysisValue hook for all passes.
-void LPPassManager::deleteSimpleAnalysisValue(Value *V, Loop *L) {
- for (unsigned Index = 0; Index < getNumContainedPasses(); ++Index) {
- Pass *P = getContainedPass(Index);
- LoopPass *LP = dynamic_cast<LoopPass *>(P);
- LP->deleteAnalysisValue(V, L);
- }
-}
-
-
-// Recurse through all subloops and all loops into LQ.
-static void addLoopIntoQueue(Loop *L, std::deque<Loop *> &LQ) {
- LQ.push_back(L);
- for (Loop::iterator I = L->begin(), E = L->end(); I != E; ++I)
- addLoopIntoQueue(*I, LQ);
-}
-
-/// Pass Manager itself does not invalidate any analysis info.
-void LPPassManager::getAnalysisUsage(AnalysisUsage &Info) const {
- // LPPassManager needs LoopInfo. In the long term LoopInfo class will
- // become part of LPPassManager.
- Info.addRequired<LoopInfo>();
- // Used by IndVar doInitialization.
- Info.addRequired<ScalarEvolution>();
- Info.setPreservesAll();
-}
-
-/// run - Execute all of the passes scheduled for execution. Keep track of
-/// whether any of the passes modifies the function, and if so, return true.
-bool LPPassManager::runOnFunction(Function &F) {
- LI = &getAnalysis<LoopInfo>();
- bool Changed = false;
-
- // Populate Loop Queue
- for (LoopInfo::iterator I = LI->begin(), E = LI->end(); I != E; ++I)
- addLoopIntoQueue(*I, LQ);
-
- // Initialization
- for (std::deque<Loop *>::const_iterator I = LQ.begin(), E = LQ.end();
- I != E; ++I) {
- Loop *L = *I;
- for (unsigned Index = 0; Index < getNumContainedPasses(); ++Index) {
- Pass *P = getContainedPass(Index);
- LoopPass *LP = dynamic_cast<LoopPass *>(P);
- if (LP)
- Changed |= LP->doInitialization(L, *this);
- }
- }
-
- // Walk Loops
- while (!LQ.empty()) {
-
- CurrentLoop = LQ.back();
- skipThisLoop = false;
- redoThisLoop = false;
-
- // Run all passes on current SCC
- for (unsigned Index = 0; Index < getNumContainedPasses(); ++Index) {
-
- Pass *P = getContainedPass(Index);
- AnalysisUsage AnUsage;
- P->getAnalysisUsage(AnUsage);
-
- dumpPassInfo(P, EXECUTION_MSG, ON_LOOP_MSG, "");
- dumpAnalysisSetInfo("Required", P, AnUsage.getRequiredSet());
-
- initializeAnalysisImpl(P);
-
- StartPassTimer(P);
- LoopPass *LP = dynamic_cast<LoopPass *>(P);
- assert (LP && "Invalid LPPassManager member");
- Changed |= LP->runOnLoop(CurrentLoop, *this);
- StopPassTimer(P);
-
- if (Changed)
- dumpPassInfo(P, MODIFICATION_MSG, ON_LOOP_MSG, "");
- dumpAnalysisSetInfo("Preserved", P, AnUsage.getPreservedSet());
-
- verifyPreservedAnalysis(LP);
- removeNotPreservedAnalysis(P);
- recordAvailableAnalysis(P);
- removeDeadPasses(P, "", ON_LOOP_MSG);
-
- if (skipThisLoop)
- // Do not run other passes on this loop.
- break;
- }
-
- // Pop the loop from queue after running all passes.
- LQ.pop_back();
-
- if (redoThisLoop)
- LQ.push_back(CurrentLoop);
- }
-
- // Finalization
- for (unsigned Index = 0; Index < getNumContainedPasses(); ++Index) {
- Pass *P = getContainedPass(Index);
- LoopPass *LP = dynamic_cast <LoopPass *>(P);
- if (LP)
- Changed |= LP->doFinalization();
- }
-
- return Changed;
-}
-
-
-//===----------------------------------------------------------------------===//
-// LoopPass
-
-// Check if this pass is suitable for the current LPPassManager, if
-// available. This pass P is not suitable for a LPPassManager if P
-// is not preserving higher level analysis info used by other
-// LPPassManager passes. In such case, pop LPPassManager from the
-// stack. This will force assignPassManager() to create new
-// LPPassManger as expected.
-void LoopPass::preparePassManager(PMStack &PMS) {
-
- // Find LPPassManager
- while (!PMS.empty() &&
- PMS.top()->getPassManagerType() > PMT_LoopPassManager)
- PMS.pop();
-
- LPPassManager *LPPM = dynamic_cast<LPPassManager *>(PMS.top());
-
- // If this pass is destroying high level information that is used
- // by other passes that are managed by LPM then do not insert
- // this pass in current LPM. Use new LPPassManager.
- if (LPPM && !LPPM->preserveHigherLevelAnalysis(this))
- PMS.pop();
-}
-
-/// Assign pass manager to manage this pass.
-void LoopPass::assignPassManager(PMStack &PMS,
- PassManagerType PreferredType) {
- // Find LPPassManager
- while (!PMS.empty() &&
- PMS.top()->getPassManagerType() > PMT_LoopPassManager)
- PMS.pop();
-
- LPPassManager *LPPM = dynamic_cast<LPPassManager *>(PMS.top());
-
- // Create new Loop Pass Manager if it does not exist.
- if (!LPPM) {
-
- assert (!PMS.empty() && "Unable to create Loop Pass Manager");
- PMDataManager *PMD = PMS.top();
-
- // [1] Create new Call Graph Pass Manager
- LPPM = new LPPassManager(PMD->getDepth() + 1);
- LPPM->populateInheritedAnalysis(PMS);
-
- // [2] Set up new manager's top level manager
- PMTopLevelManager *TPM = PMD->getTopLevelManager();
- TPM->addIndirectPassManager(LPPM);
-
- // [3] Assign manager to manage this new manager. This may create
- // and push new managers into PMS
- Pass *P = dynamic_cast<Pass *>(LPPM);
- TPM->schedulePass(P);
-
- // [4] Push new manager into PMS
- PMS.push(LPPM);
- }
-
- LPPM->add(this);
-}
diff --git a/release_23/lib/Analysis/Makefile b/release_23/lib/Analysis/Makefile
deleted file mode 100644
index 31ce23591d04..000000000000
--- a/release_23/lib/Analysis/Makefile
+++ /dev/null
@@ -1,16 +0,0 @@
-##===- lib/Analysis/Makefile -------------------------------*- Makefile -*-===##
-#
-# The LLVM Compiler Infrastructure
-#
-# This file is distributed under the University of Illinois Open Source
-# License. See LICENSE.TXT for details.
-#
-##===----------------------------------------------------------------------===##
-
-LEVEL = ../..
-LIBRARYNAME = LLVMAnalysis
-DIRS = IPA
-BUILD_ARCHIVE = 1
-
-include $(LEVEL)/Makefile.common
-
diff --git a/release_23/lib/Analysis/MemoryDependenceAnalysis.cpp b/release_23/lib/Analysis/MemoryDependenceAnalysis.cpp
deleted file mode 100644
index 8a59c3a74316..000000000000
--- a/release_23/lib/Analysis/MemoryDependenceAnalysis.cpp
+++ /dev/null
@@ -1,578 +0,0 @@
-//===- MemoryDependenceAnalysis.cpp - Mem Deps Implementation --*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements an analysis that determines, for a given memory
-// operation, what preceding memory operations it depends on. It builds on
-// alias analysis information, and tries to provide a lazy, caching interface to
-// a common kind of alias information query.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Analysis/MemoryDependenceAnalysis.h"
-#include "llvm/Constants.h"
-#include "llvm/Instructions.h"
-#include "llvm/Function.h"
-#include "llvm/Analysis/AliasAnalysis.h"
-#include "llvm/Support/CFG.h"
-#include "llvm/Support/CommandLine.h"
-#include "llvm/Target/TargetData.h"
-#include "llvm/ADT/Statistic.h"
-
-#define DEBUG_TYPE "memdep"
-
-using namespace llvm;
-
-namespace {
- // Control the calculation of non-local dependencies by only examining the
- // predecessors if the basic block has less than X amount (50 by default).
- static cl::opt<int>
- PredLimit("nonlocaldep-threshold", cl::Hidden, cl::init(50),
- cl::desc("Control the calculation of non-local"
- "dependencies (default = 50)"));
-}
-
-STATISTIC(NumCacheNonlocal, "Number of cached non-local responses");
-STATISTIC(NumUncacheNonlocal, "Number of uncached non-local responses");
-
-char MemoryDependenceAnalysis::ID = 0;
-
-Instruction* const MemoryDependenceAnalysis::NonLocal = (Instruction*)-3;
-Instruction* const MemoryDependenceAnalysis::None = (Instruction*)-4;
-Instruction* const MemoryDependenceAnalysis::Dirty = (Instruction*)-5;
-
-// Register this pass...
-static RegisterPass<MemoryDependenceAnalysis> X("memdep",
- "Memory Dependence Analysis", false, true);
-
-void MemoryDependenceAnalysis::ping(Instruction *D) {
- for (depMapType::iterator I = depGraphLocal.begin(), E = depGraphLocal.end();
- I != E; ++I) {
- assert(I->first != D);
- assert(I->second.first != D);
- }
-
- for (nonLocalDepMapType::iterator I = depGraphNonLocal.begin(), E = depGraphNonLocal.end();
- I != E; ++I) {
- assert(I->first != D);
- }
-
- for (reverseDepMapType::iterator I = reverseDep.begin(), E = reverseDep.end();
- I != E; ++I)
- for (SmallPtrSet<Instruction*, 4>::iterator II = I->second.begin(), EE = I->second.end();
- II != EE; ++II)
- assert(*II != D);
-
- for (reverseDepMapType::iterator I = reverseDepNonLocal.begin(), E = reverseDepNonLocal.end();
- I != E; ++I)
- for (SmallPtrSet<Instruction*, 4>::iterator II = I->second.begin(), EE = I->second.end();
- II != EE; ++II)
- assert(*II != D);
-}
-
-/// getAnalysisUsage - Does not modify anything. It uses Alias Analysis.
-///
-void MemoryDependenceAnalysis::getAnalysisUsage(AnalysisUsage &AU) const {
- AU.setPreservesAll();
- AU.addRequiredTransitive<AliasAnalysis>();
- AU.addRequiredTransitive<TargetData>();
-}
-
-/// getCallSiteDependency - Private helper for finding the local dependencies
-/// of a call site.
-Instruction* MemoryDependenceAnalysis::getCallSiteDependency(CallSite C,
- Instruction* start,
- BasicBlock* block) {
-
- std::pair<Instruction*, bool>& cachedResult =
- depGraphLocal[C.getInstruction()];
- AliasAnalysis& AA = getAnalysis<AliasAnalysis>();
- TargetData& TD = getAnalysis<TargetData>();
- BasicBlock::iterator blockBegin = C.getInstruction()->getParent()->begin();
- BasicBlock::iterator QI = C.getInstruction();
-
- // If the starting point was specifiy, use it
- if (start) {
- QI = start;
- blockBegin = start->getParent()->begin();
- // If the starting point wasn't specified, but the block was, use it
- } else if (!start && block) {
- QI = block->end();
- blockBegin = block->begin();
- }
-
- // Walk backwards through the block, looking for dependencies
- while (QI != blockBegin) {
- --QI;
-
- // If this inst is a memory op, get the pointer it accessed
- Value* pointer = 0;
- uint64_t pointerSize = 0;
- if (StoreInst* S = dyn_cast<StoreInst>(QI)) {
- pointer = S->getPointerOperand();
- pointerSize = TD.getTypeStoreSize(S->getOperand(0)->getType());
- } else if (AllocationInst* AI = dyn_cast<AllocationInst>(QI)) {
- pointer = AI;
- if (ConstantInt* C = dyn_cast<ConstantInt>(AI->getArraySize()))
- pointerSize = C->getZExtValue() * \
- TD.getABITypeSize(AI->getAllocatedType());
- else
- pointerSize = ~0UL;
- } else if (VAArgInst* V = dyn_cast<VAArgInst>(QI)) {
- pointer = V->getOperand(0);
- pointerSize = TD.getTypeStoreSize(V->getType());
- } else if (FreeInst* F = dyn_cast<FreeInst>(QI)) {
- pointer = F->getPointerOperand();
-
- // FreeInsts erase the entire structure
- pointerSize = ~0UL;
- } else if (isa<CallInst>(QI)) {
- AliasAnalysis::ModRefBehavior result =
- AA.getModRefBehavior(CallSite::get(QI));
- if (result != AliasAnalysis::DoesNotAccessMemory) {
- if (!start && !block) {
- cachedResult.first = QI;
- cachedResult.second = true;
- reverseDep[QI].insert(C.getInstruction());
- }
- return QI;
- } else {
- continue;
- }
- } else
- continue;
-
- if (AA.getModRefInfo(C, pointer, pointerSize) != AliasAnalysis::NoModRef) {
- if (!start && !block) {
- cachedResult.first = QI;
- cachedResult.second = true;
- reverseDep[QI].insert(C.getInstruction());
- }
- return QI;
- }
- }
-
- // No dependence found
- cachedResult.first = NonLocal;
- cachedResult.second = true;
- reverseDep[NonLocal].insert(C.getInstruction());
- return NonLocal;
-}
-
-/// nonLocalHelper - Private helper used to calculate non-local dependencies
-/// by doing DFS on the predecessors of a block to find its dependencies
-void MemoryDependenceAnalysis::nonLocalHelper(Instruction* query,
- BasicBlock* block,
- DenseMap<BasicBlock*, Value*>& resp) {
- // Set of blocks that we've already visited in our DFS
- SmallPtrSet<BasicBlock*, 4> visited;
- // If we're updating a dirtied cache entry, we don't need to reprocess
- // already computed entries.
- for (DenseMap<BasicBlock*, Value*>::iterator I = resp.begin(),
- E = resp.end(); I != E; ++I)
- if (I->second != Dirty)
- visited.insert(I->first);
-
- // Current stack of the DFS
- SmallVector<BasicBlock*, 4> stack;
- for (pred_iterator PI = pred_begin(block), PE = pred_end(block);
- PI != PE; ++PI)
- stack.push_back(*PI);
-
- // Do a basic DFS
- while (!stack.empty()) {
- BasicBlock* BB = stack.back();
-
- // If we've already visited this block, no need to revist
- if (visited.count(BB)) {
- stack.pop_back();
- continue;
- }
-
- // If we find a new block with a local dependency for query,
- // then we insert the new dependency and backtrack.
- if (BB != block) {
- visited.insert(BB);
-
- Instruction* localDep = getDependency(query, 0, BB);
- if (localDep != NonLocal) {
- resp.insert(std::make_pair(BB, localDep));
- stack.pop_back();
-
- continue;
- }
- // If we re-encounter the starting block, we still need to search it
- // because there might be a dependency in the starting block AFTER
- // the position of the query. This is necessary to get loops right.
- } else if (BB == block) {
- visited.insert(BB);
-
- Instruction* localDep = getDependency(query, 0, BB);
- if (localDep != query)
- resp.insert(std::make_pair(BB, localDep));
-
- stack.pop_back();
-
- continue;
- }
-
- // If we didn't find anything, recurse on the precessors of this block
- // Only do this for blocks with a small number of predecessors.
- bool predOnStack = false;
- bool inserted = false;
- if (std::distance(pred_begin(BB), pred_end(BB)) <= PredLimit) {
- for (pred_iterator PI = pred_begin(BB), PE = pred_end(BB);
- PI != PE; ++PI)
- if (!visited.count(*PI)) {
- stack.push_back(*PI);
- inserted = true;
- } else
- predOnStack = true;
- }
-
- // If we inserted a new predecessor, then we'll come back to this block
- if (inserted)
- continue;
- // If we didn't insert because we have no predecessors, then this
- // query has no dependency at all.
- else if (!inserted && !predOnStack) {
- resp.insert(std::make_pair(BB, None));
- // If we didn't insert because our predecessors are already on the stack,
- // then we might still have a dependency, but it will be discovered during
- // backtracking.
- } else if (!inserted && predOnStack){
- resp.insert(std::make_pair(BB, NonLocal));
- }
-
- stack.pop_back();
- }
-}
-
-/// getNonLocalDependency - Fills the passed-in map with the non-local
-/// dependencies of the queries. The map will contain NonLocal for
-/// blocks between the query and its dependencies.
-void MemoryDependenceAnalysis::getNonLocalDependency(Instruction* query,
- DenseMap<BasicBlock*, Value*>& resp) {
- if (depGraphNonLocal.count(query)) {
- DenseMap<BasicBlock*, Value*>& cached = depGraphNonLocal[query];
- NumCacheNonlocal++;
-
- SmallVector<BasicBlock*, 4> dirtied;
- for (DenseMap<BasicBlock*, Value*>::iterator I = cached.begin(),
- E = cached.end(); I != E; ++I)
- if (I->second == Dirty)
- dirtied.push_back(I->first);
-
- for (SmallVector<BasicBlock*, 4>::iterator I = dirtied.begin(),
- E = dirtied.end(); I != E; ++I) {
- Instruction* localDep = getDependency(query, 0, *I);
- if (localDep != NonLocal)
- cached[*I] = localDep;
- else {
- cached.erase(*I);
- nonLocalHelper(query, *I, cached);
- }
- }
-
- resp = cached;
-
- return;
- } else
- NumUncacheNonlocal++;
-
- // If not, go ahead and search for non-local deps.
- nonLocalHelper(query, query->getParent(), resp);
-
- // Update the non-local dependency cache
- for (DenseMap<BasicBlock*, Value*>::iterator I = resp.begin(), E = resp.end();
- I != E; ++I) {
- depGraphNonLocal[query].insert(*I);
- reverseDepNonLocal[I->second].insert(query);
- }
-}
-
-/// getDependency - Return the instruction on which a memory operation
-/// depends. The local parameter indicates if the query should only
-/// evaluate dependencies within the same basic block.
-Instruction* MemoryDependenceAnalysis::getDependency(Instruction* query,
- Instruction* start,
- BasicBlock* block) {
- // Start looking for dependencies with the queried inst
- BasicBlock::iterator QI = query;
-
- // Check for a cached result
- std::pair<Instruction*, bool>& cachedResult = depGraphLocal[query];
- // If we have a _confirmed_ cached entry, return it
- if (!block && !start) {
- if (cachedResult.second)
- return cachedResult.first;
- else if (cachedResult.first && cachedResult.first != NonLocal)
- // If we have an unconfirmed cached entry, we can start our search from there
- QI = cachedResult.first;
- }
-
- if (start)
- QI = start;
- else if (!start && block)
- QI = block->end();
-
- AliasAnalysis& AA = getAnalysis<AliasAnalysis>();
- TargetData& TD = getAnalysis<TargetData>();
-
- // Get the pointer value for which dependence will be determined
- Value* dependee = 0;
- uint64_t dependeeSize = 0;
- bool queryIsVolatile = false;
- if (StoreInst* S = dyn_cast<StoreInst>(query)) {
- dependee = S->getPointerOperand();
- dependeeSize = TD.getTypeStoreSize(S->getOperand(0)->getType());
- queryIsVolatile = S->isVolatile();
- } else if (LoadInst* L = dyn_cast<LoadInst>(query)) {
- dependee = L->getPointerOperand();
- dependeeSize = TD.getTypeStoreSize(L->getType());
- queryIsVolatile = L->isVolatile();
- } else if (VAArgInst* V = dyn_cast<VAArgInst>(query)) {
- dependee = V->getOperand(0);
- dependeeSize = TD.getTypeStoreSize(V->getType());
- } else if (FreeInst* F = dyn_cast<FreeInst>(query)) {
- dependee = F->getPointerOperand();
-
- // FreeInsts erase the entire structure, not just a field
- dependeeSize = ~0UL;
- } else if (CallSite::get(query).getInstruction() != 0)
- return getCallSiteDependency(CallSite::get(query), start, block);
- else if (isa<AllocationInst>(query))
- return None;
- else
- return None;
-
- BasicBlock::iterator blockBegin = block ? block->begin()
- : query->getParent()->begin();
-
- // Walk backwards through the basic block, looking for dependencies
- while (QI != blockBegin) {
- --QI;
-
- // If this inst is a memory op, get the pointer it accessed
- Value* pointer = 0;
- uint64_t pointerSize = 0;
- if (StoreInst* S = dyn_cast<StoreInst>(QI)) {
- // All volatile loads/stores depend on each other
- if (queryIsVolatile && S->isVolatile()) {
- if (!start && !block) {
- cachedResult.first = S;
- cachedResult.second = true;
- reverseDep[S].insert(query);
- }
-
- return S;
- }
-
- pointer = S->getPointerOperand();
- pointerSize = TD.getTypeStoreSize(S->getOperand(0)->getType());
- } else if (LoadInst* L = dyn_cast<LoadInst>(QI)) {
- // All volatile loads/stores depend on each other
- if (queryIsVolatile && L->isVolatile()) {
- if (!start && !block) {
- cachedResult.first = L;
- cachedResult.second = true;
- reverseDep[L].insert(query);
- }
-
- return L;
- }
-
- pointer = L->getPointerOperand();
- pointerSize = TD.getTypeStoreSize(L->getType());
- } else if (AllocationInst* AI = dyn_cast<AllocationInst>(QI)) {
- pointer = AI;
- if (ConstantInt* C = dyn_cast<ConstantInt>(AI->getArraySize()))
- pointerSize = C->getZExtValue() * \
- TD.getABITypeSize(AI->getAllocatedType());
- else
- pointerSize = ~0UL;
- } else if (VAArgInst* V = dyn_cast<VAArgInst>(QI)) {
- pointer = V->getOperand(0);
- pointerSize = TD.getTypeStoreSize(V->getType());
- } else if (FreeInst* F = dyn_cast<FreeInst>(QI)) {
- pointer = F->getPointerOperand();
-
- // FreeInsts erase the entire structure
- pointerSize = ~0UL;
- } else if (CallSite::get(QI).getInstruction() != 0) {
- // Call insts need special handling. Check if they can modify our pointer
- AliasAnalysis::ModRefResult MR = AA.getModRefInfo(CallSite::get(QI),
- dependee, dependeeSize);
-
- if (MR != AliasAnalysis::NoModRef) {
- // Loads don't depend on read-only calls
- if (isa<LoadInst>(query) && MR == AliasAnalysis::Ref)
- continue;
-
- if (!start && !block) {
- cachedResult.first = QI;
- cachedResult.second = true;
- reverseDep[QI].insert(query);
- }
-
- return QI;
- } else {
- continue;
- }
- }
-
- // If we found a pointer, check if it could be the same as our pointer
- if (pointer) {
- AliasAnalysis::AliasResult R = AA.alias(pointer, pointerSize,
- dependee, dependeeSize);
-
- if (R != AliasAnalysis::NoAlias) {
- // May-alias loads don't depend on each other
- if (isa<LoadInst>(query) && isa<LoadInst>(QI) &&
- R == AliasAnalysis::MayAlias)
- continue;
-
- if (!start && !block) {
- cachedResult.first = QI;
- cachedResult.second = true;
- reverseDep[QI].insert(query);
- }
-
- return QI;
- }
- }
- }
-
- // If we found nothing, return the non-local flag
- if (!start && !block) {
- cachedResult.first = NonLocal;
- cachedResult.second = true;
- reverseDep[NonLocal].insert(query);
- }
-
- return NonLocal;
-}
-
-/// dropInstruction - Remove an instruction from the analysis, making
-/// absolutely conservative assumptions when updating the cache. This is
-/// useful, for example when an instruction is changed rather than removed.
-void MemoryDependenceAnalysis::dropInstruction(Instruction* drop) {
- depMapType::iterator depGraphEntry = depGraphLocal.find(drop);
- if (depGraphEntry != depGraphLocal.end())
- reverseDep[depGraphEntry->second.first].erase(drop);
-
- // Drop dependency information for things that depended on this instr
- SmallPtrSet<Instruction*, 4>& set = reverseDep[drop];
- for (SmallPtrSet<Instruction*, 4>::iterator I = set.begin(), E = set.end();
- I != E; ++I)
- depGraphLocal.erase(*I);
-
- depGraphLocal.erase(drop);
- reverseDep.erase(drop);
-
- for (DenseMap<BasicBlock*, Value*>::iterator DI =
- depGraphNonLocal[drop].begin(), DE = depGraphNonLocal[drop].end();
- DI != DE; ++DI)
- if (DI->second != None)
- reverseDepNonLocal[DI->second].erase(drop);
-
- if (reverseDepNonLocal.count(drop)) {
- SmallPtrSet<Instruction*, 4>& set = reverseDepNonLocal[drop];
- for (SmallPtrSet<Instruction*, 4>::iterator I = set.begin(), E = set.end();
- I != E; ++I)
- for (DenseMap<BasicBlock*, Value*>::iterator DI =
- depGraphNonLocal[*I].begin(), DE = depGraphNonLocal[*I].end();
- DI != DE; ++DI)
- if (DI->second == drop)
- DI->second = Dirty;
- }
-
- reverseDepNonLocal.erase(drop);
- nonLocalDepMapType::iterator I = depGraphNonLocal.find(drop);
- if (I != depGraphNonLocal.end())
- depGraphNonLocal.erase(I);
-}
-
-/// removeInstruction - Remove an instruction from the dependence analysis,
-/// updating the dependence of instructions that previously depended on it.
-/// This method attempts to keep the cache coherent using the reverse map.
-void MemoryDependenceAnalysis::removeInstruction(Instruction* rem) {
- // Figure out the new dep for things that currently depend on rem
- Instruction* newDep = NonLocal;
-
- for (DenseMap<BasicBlock*, Value*>::iterator DI =
- depGraphNonLocal[rem].begin(), DE = depGraphNonLocal[rem].end();
- DI != DE; ++DI)
- if (DI->second != None)
- reverseDepNonLocal[DI->second].erase(rem);
-
- depMapType::iterator depGraphEntry = depGraphLocal.find(rem);
-
- if (depGraphEntry != depGraphLocal.end()) {
- reverseDep[depGraphEntry->second.first].erase(rem);
-
- if (depGraphEntry->second.first != NonLocal &&
- depGraphEntry->second.first != None &&
- depGraphEntry->second.second) {
- // If we have dep info for rem, set them to it
- BasicBlock::iterator RI = depGraphEntry->second.first;
- RI++;
- newDep = RI;
- } else if ( (depGraphEntry->second.first == NonLocal ||
- depGraphEntry->second.first == None ) &&
- depGraphEntry->second.second ) {
- // If we have a confirmed non-local flag, use it
- newDep = depGraphEntry->second.first;
- } else {
- // Otherwise, use the immediate successor of rem
- // NOTE: This is because, when getDependence is called, it will first
- // check the immediate predecessor of what is in the cache.
- BasicBlock::iterator RI = rem;
- RI++;
- newDep = RI;
- }
- } else {
- // Otherwise, use the immediate successor of rem
- // NOTE: This is because, when getDependence is called, it will first
- // check the immediate predecessor of what is in the cache.
- BasicBlock::iterator RI = rem;
- RI++;
- newDep = RI;
- }
-
- SmallPtrSet<Instruction*, 4>& set = reverseDep[rem];
- for (SmallPtrSet<Instruction*, 4>::iterator I = set.begin(), E = set.end();
- I != E; ++I) {
- // Insert the new dependencies
- // Mark it as unconfirmed as long as it is not the non-local flag
- depGraphLocal[*I] = std::make_pair(newDep, (newDep == NonLocal ||
- newDep == None));
- }
-
- depGraphLocal.erase(rem);
- reverseDep.erase(rem);
-
- if (reverseDepNonLocal.count(rem)) {
- SmallPtrSet<Instruction*, 4>& set = reverseDepNonLocal[rem];
- for (SmallPtrSet<Instruction*, 4>::iterator I = set.begin(), E = set.end();
- I != E; ++I)
- for (DenseMap<BasicBlock*, Value*>::iterator DI =
- depGraphNonLocal[*I].begin(), DE = depGraphNonLocal[*I].end();
- DI != DE; ++DI)
- if (DI->second == rem)
- DI->second = Dirty;
-
- }
-
- reverseDepNonLocal.erase(rem);
- nonLocalDepMapType::iterator I = depGraphNonLocal.find(rem);
- if (I != depGraphNonLocal.end())
- depGraphNonLocal.erase(I);
-
- getAnalysis<AliasAnalysis>().deleteValue(rem);
-}
diff --git a/release_23/lib/Analysis/PostDominators.cpp b/release_23/lib/Analysis/PostDominators.cpp
deleted file mode 100644
index cfa1b463295e..000000000000
--- a/release_23/lib/Analysis/PostDominators.cpp
+++ /dev/null
@@ -1,86 +0,0 @@
-//===- PostDominators.cpp - Post-Dominator Calculation --------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the post-dominator construction algorithms.
-//
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "postdomtree"
-
-#include "llvm/Analysis/PostDominators.h"
-#include "llvm/Instructions.h"
-#include "llvm/Support/CFG.h"
-#include "llvm/Support/Debug.h"
-#include "llvm/ADT/DepthFirstIterator.h"
-#include "llvm/ADT/SetOperations.h"
-#include "llvm/Analysis/DominatorInternals.h"
-using namespace llvm;
-
-//===----------------------------------------------------------------------===//
-// PostDominatorTree Implementation
-//===----------------------------------------------------------------------===//
-
-char PostDominatorTree::ID = 0;
-char PostDominanceFrontier::ID = 0;
-static RegisterPass<PostDominatorTree>
-F("postdomtree", "Post-Dominator Tree Construction", true, true);
-
-bool PostDominatorTree::runOnFunction(Function &F) {
- DT->recalculate(F);
- DEBUG(DT->dump());
- return false;
-}
-
-PostDominatorTree::~PostDominatorTree()
-{
- delete DT;
-}
-
-//===----------------------------------------------------------------------===//
-// PostDominanceFrontier Implementation
-//===----------------------------------------------------------------------===//
-
-static RegisterPass<PostDominanceFrontier>
-H("postdomfrontier", "Post-Dominance Frontier Construction", true, true);
-
-const DominanceFrontier::DomSetType &
-PostDominanceFrontier::calculate(const PostDominatorTree &DT,
- const DomTreeNode *Node) {
- // Loop over CFG successors to calculate DFlocal[Node]
- BasicBlock *BB = Node->getBlock();
- DomSetType &S = Frontiers[BB]; // The new set to fill in...
- if (getRoots().empty()) return S;
-
- if (BB)
- for (pred_iterator SI = pred_begin(BB), SE = pred_end(BB);
- SI != SE; ++SI) {
- // Does Node immediately dominate this predecessor?
- DomTreeNode *SINode = DT[*SI];
- if (SINode && SINode->getIDom() != Node)
- S.insert(*SI);
- }
-
- // At this point, S is DFlocal. Now we union in DFup's of our children...
- // Loop through and visit the nodes that Node immediately dominates (Node's
- // children in the IDomTree)
- //
- for (DomTreeNode::const_iterator
- NI = Node->begin(), NE = Node->end(); NI != NE; ++NI) {
- DomTreeNode *IDominee = *NI;
- const DomSetType &ChildDF = calculate(DT, IDominee);
-
- DomSetType::const_iterator CDFI = ChildDF.begin(), CDFE = ChildDF.end();
- for (; CDFI != CDFE; ++CDFI) {
- if (!DT.properlyDominates(Node, DT[*CDFI]))
- S.insert(*CDFI);
- }
- }
-
- return S;
-}
diff --git a/release_23/lib/Analysis/ProfileInfo.cpp b/release_23/lib/Analysis/ProfileInfo.cpp
deleted file mode 100644
index 2ee398d1aa41..000000000000
--- a/release_23/lib/Analysis/ProfileInfo.cpp
+++ /dev/null
@@ -1,102 +0,0 @@
-//===- ProfileInfo.cpp - Profile Info Interface ---------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the abstract ProfileInfo interface, and the default
-// "no profile" implementation.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Analysis/Passes.h"
-#include "llvm/Analysis/ProfileInfo.h"
-#include "llvm/Pass.h"
-#include "llvm/Support/CFG.h"
-#include "llvm/Support/Compiler.h"
-#include <set>
-using namespace llvm;
-
-// Register the ProfileInfo interface, providing a nice name to refer to.
-namespace {
- RegisterAnalysisGroup<ProfileInfo> Z("Profile Information");
-}
-char ProfileInfo::ID = 0;
-
-ProfileInfo::~ProfileInfo() {}
-
-unsigned ProfileInfo::getExecutionCount(BasicBlock *BB) const {
- pred_iterator PI = pred_begin(BB), PE = pred_end(BB);
-
- // Are there zero predecessors of this block?
- if (PI == PE) {
- // If this is the entry block, look for the Null -> Entry edge.
- if (BB == &BB->getParent()->getEntryBlock())
- return getEdgeWeight(0, BB);
- else
- return 0; // Otherwise, this is a dead block.
- }
-
- // Otherwise, if there are predecessors, the execution count of this block is
- // the sum of the edge frequencies from the incoming edges. Note that if
- // there are multiple edges from a predecessor to this block that we don't
- // want to count its weight multiple times. For this reason, we keep track of
- // the predecessors we've seen and only count them if we haven't run into them
- // yet.
- //
- // We don't want to create an std::set unless we are dealing with a block that
- // has a LARGE number of in-edges. Handle the common case of having only a
- // few in-edges with special code.
- //
- BasicBlock *FirstPred = *PI;
- unsigned Count = getEdgeWeight(FirstPred, BB);
- ++PI;
- if (PI == PE) return Count; // Quick exit for single predecessor blocks
-
- BasicBlock *SecondPred = *PI;
- if (SecondPred != FirstPred) Count += getEdgeWeight(SecondPred, BB);
- ++PI;
- if (PI == PE) return Count; // Quick exit for two predecessor blocks
-
- BasicBlock *ThirdPred = *PI;
- if (ThirdPred != FirstPred && ThirdPred != SecondPred)
- Count += getEdgeWeight(ThirdPred, BB);
- ++PI;
- if (PI == PE) return Count; // Quick exit for three predecessor blocks
-
- std::set<BasicBlock*> ProcessedPreds;
- ProcessedPreds.insert(FirstPred);
- ProcessedPreds.insert(SecondPred);
- ProcessedPreds.insert(ThirdPred);
- for (; PI != PE; ++PI)
- if (ProcessedPreds.insert(*PI).second)
- Count += getEdgeWeight(*PI, BB);
- return Count;
-}
-
-
-
-//===----------------------------------------------------------------------===//
-// NoProfile ProfileInfo implementation
-//
-
-namespace {
- struct VISIBILITY_HIDDEN NoProfileInfo
- : public ImmutablePass, public ProfileInfo {
- static char ID; // Class identification, replacement for typeinfo
- NoProfileInfo() : ImmutablePass((intptr_t)&ID) {}
- };
-
- char NoProfileInfo::ID = 0;
- // Register this pass...
- RegisterPass<NoProfileInfo>
- X("no-profile", "No Profile Information", false, true);
-
- // Declare that we implement the ProfileInfo interface
- RegisterAnalysisGroup<ProfileInfo, true> Y(X);
-} // End of anonymous namespace
-
-ImmutablePass *llvm::createNoProfileInfoPass() { return new NoProfileInfo(); }
diff --git a/release_23/lib/Analysis/ProfileInfoLoader.cpp b/release_23/lib/Analysis/ProfileInfoLoader.cpp
deleted file mode 100644
index 732829887e91..000000000000
--- a/release_23/lib/Analysis/ProfileInfoLoader.cpp
+++ /dev/null
@@ -1,276 +0,0 @@
-//===- ProfileInfoLoad.cpp - Load profile information from disk -----------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// The ProfileInfoLoader class is used to load and represent profiling
-// information read in from the dump file.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Analysis/ProfileInfoLoader.h"
-#include "llvm/Analysis/ProfileInfoTypes.h"
-#include "llvm/Module.h"
-#include "llvm/InstrTypes.h"
-#include "llvm/Support/Streams.h"
-#include <cstdio>
-#include <map>
-using namespace llvm;
-
-// ByteSwap - Byteswap 'Var' if 'Really' is true.
-//
-static inline unsigned ByteSwap(unsigned Var, bool Really) {
- if (!Really) return Var;
- return ((Var & (255<< 0)) << 24) |
- ((Var & (255<< 8)) << 8) |
- ((Var & (255<<16)) >> 8) |
- ((Var & (255<<24)) >> 24);
-}
-
-static void ReadProfilingBlock(const char *ToolName, FILE *F,
- bool ShouldByteSwap,
- std::vector<unsigned> &Data) {
- // Read the number of entries...
- unsigned NumEntries;
- if (fread(&NumEntries, sizeof(unsigned), 1, F) != 1) {
- cerr << ToolName << ": data packet truncated!\n";
- perror(0);
- exit(1);
- }
- NumEntries = ByteSwap(NumEntries, ShouldByteSwap);
-
- // Read the counts...
- std::vector<unsigned> TempSpace(NumEntries);
-
- // Read in the block of data...
- if (fread(&TempSpace[0], sizeof(unsigned)*NumEntries, 1, F) != 1) {
- cerr << ToolName << ": data packet truncated!\n";
- perror(0);
- exit(1);
- }
-
- // Make sure we have enough space...
- if (Data.size() < NumEntries)
- Data.resize(NumEntries);
-
- // Accumulate the data we just read into the data.
- if (!ShouldByteSwap) {
- for (unsigned i = 0; i != NumEntries; ++i)
- Data[i] += TempSpace[i];
- } else {
- for (unsigned i = 0; i != NumEntries; ++i)
- Data[i] += ByteSwap(TempSpace[i], true);
- }
-}
-
-// ProfileInfoLoader ctor - Read the specified profiling data file, exiting the
-// program if the file is invalid or broken.
-//
-ProfileInfoLoader::ProfileInfoLoader(const char *ToolName,
- const std::string &Filename,
- Module &TheModule) : M(TheModule) {
- FILE *F = fopen(Filename.c_str(), "r");
- if (F == 0) {
- cerr << ToolName << ": Error opening '" << Filename << "': ";
- perror(0);
- exit(1);
- }
-
- // Keep reading packets until we run out of them.
- unsigned PacketType;
- while (fread(&PacketType, sizeof(unsigned), 1, F) == 1) {
- // If the low eight bits of the packet are zero, we must be dealing with an
- // endianness mismatch. Byteswap all words read from the profiling
- // information.
- bool ShouldByteSwap = (char)PacketType == 0;
- PacketType = ByteSwap(PacketType, ShouldByteSwap);
-
- switch (PacketType) {
- case ArgumentInfo: {
- unsigned ArgLength;
- if (fread(&ArgLength, sizeof(unsigned), 1, F) != 1) {
- cerr << ToolName << ": arguments packet truncated!\n";
- perror(0);
- exit(1);
- }
- ArgLength = ByteSwap(ArgLength, ShouldByteSwap);
-
- // Read in the arguments...
- std::vector<char> Chars(ArgLength+4);
-
- if (ArgLength)
- if (fread(&Chars[0], (ArgLength+3) & ~3, 1, F) != 1) {
- cerr << ToolName << ": arguments packet truncated!\n";
- perror(0);
- exit(1);
- }
- CommandLines.push_back(std::string(&Chars[0], &Chars[ArgLength]));
- break;
- }
-
- case FunctionInfo:
- ReadProfilingBlock(ToolName, F, ShouldByteSwap, FunctionCounts);
- break;
-
- case BlockInfo:
- ReadProfilingBlock(ToolName, F, ShouldByteSwap, BlockCounts);
- break;
-
- case EdgeInfo:
- ReadProfilingBlock(ToolName, F, ShouldByteSwap, EdgeCounts);
- break;
-
- case BBTraceInfo:
- ReadProfilingBlock(ToolName, F, ShouldByteSwap, BBTrace);
- break;
-
- default:
- cerr << ToolName << ": Unknown packet type #" << PacketType << "!\n";
- exit(1);
- }
- }
-
- fclose(F);
-}
-
-
-// getFunctionCounts - This method is used by consumers of function counting
-// information. If we do not directly have function count information, we
-// compute it from other, more refined, types of profile information.
-//
-void ProfileInfoLoader::getFunctionCounts(std::vector<std::pair<Function*,
- unsigned> > &Counts) {
- if (FunctionCounts.empty()) {
- if (hasAccurateBlockCounts()) {
- // Synthesize function frequency information from the number of times
- // their entry blocks were executed.
- std::vector<std::pair<BasicBlock*, unsigned> > BlockCounts;
- getBlockCounts(BlockCounts);
-
- for (unsigned i = 0, e = BlockCounts.size(); i != e; ++i)
- if (&BlockCounts[i].first->getParent()->getEntryBlock() ==
- BlockCounts[i].first)
- Counts.push_back(std::make_pair(BlockCounts[i].first->getParent(),
- BlockCounts[i].second));
- } else {
- cerr << "Function counts are not available!\n";
- }
- return;
- }
-
- unsigned Counter = 0;
- for (Module::iterator I = M.begin(), E = M.end();
- I != E && Counter != FunctionCounts.size(); ++I)
- if (!I->isDeclaration())
- Counts.push_back(std::make_pair(I, FunctionCounts[Counter++]));
-}
-
-// getBlockCounts - This method is used by consumers of block counting
-// information. If we do not directly have block count information, we
-// compute it from other, more refined, types of profile information.
-//
-void ProfileInfoLoader::getBlockCounts(std::vector<std::pair<BasicBlock*,
- unsigned> > &Counts) {
- if (BlockCounts.empty()) {
- if (hasAccurateEdgeCounts()) {
- // Synthesize block count information from edge frequency information.
- // The block execution frequency is equal to the sum of the execution
- // frequency of all outgoing edges from a block.
- //
- // If a block has no successors, this will not be correct, so we have to
- // special case it. :(
- std::vector<std::pair<Edge, unsigned> > EdgeCounts;
- getEdgeCounts(EdgeCounts);
-
- std::map<BasicBlock*, unsigned> InEdgeFreqs;
-
- BasicBlock *LastBlock = 0;
- TerminatorInst *TI = 0;
- for (unsigned i = 0, e = EdgeCounts.size(); i != e; ++i) {
- if (EdgeCounts[i].first.first != LastBlock) {
- LastBlock = EdgeCounts[i].first.first;
- TI = LastBlock->getTerminator();
- Counts.push_back(std::make_pair(LastBlock, 0));
- }
- Counts.back().second += EdgeCounts[i].second;
- unsigned SuccNum = EdgeCounts[i].first.second;
- if (SuccNum >= TI->getNumSuccessors()) {
- static bool Warned = false;
- if (!Warned) {
- cerr << "WARNING: profile info doesn't seem to match"
- << " the program!\n";
- Warned = true;
- }
- } else {
- // If this successor has no successors of its own, we will never
- // compute an execution count for that block. Remember the incoming
- // edge frequencies to add later.
- BasicBlock *Succ = TI->getSuccessor(SuccNum);
- if (Succ->getTerminator()->getNumSuccessors() == 0)
- InEdgeFreqs[Succ] += EdgeCounts[i].second;
- }
- }
-
- // Now we have to accumulate information for those blocks without
- // successors into our table.
- for (std::map<BasicBlock*, unsigned>::iterator I = InEdgeFreqs.begin(),
- E = InEdgeFreqs.end(); I != E; ++I) {
- unsigned i = 0;
- for (; i != Counts.size() && Counts[i].first != I->first; ++i)
- /*empty*/;
- if (i == Counts.size()) Counts.push_back(std::make_pair(I->first, 0));
- Counts[i].second += I->second;
- }
-
- } else {
- cerr << "Block counts are not available!\n";
- }
- return;
- }
-
- unsigned Counter = 0;
- for (Module::iterator F = M.begin(), E = M.end(); F != E; ++F)
- for (Function::iterator BB = F->begin(), E = F->end(); BB != E; ++BB) {
- Counts.push_back(std::make_pair(BB, BlockCounts[Counter++]));
- if (Counter == BlockCounts.size())
- return;
- }
-}
-
-// getEdgeCounts - This method is used by consumers of edge counting
-// information. If we do not directly have edge count information, we compute
-// it from other, more refined, types of profile information.
-//
-void ProfileInfoLoader::getEdgeCounts(std::vector<std::pair<Edge,
- unsigned> > &Counts) {
- if (EdgeCounts.empty()) {
- cerr << "Edge counts not available, and no synthesis "
- << "is implemented yet!\n";
- return;
- }
-
- unsigned Counter = 0;
- for (Module::iterator F = M.begin(), E = M.end(); F != E; ++F)
- for (Function::iterator BB = F->begin(), E = F->end(); BB != E; ++BB)
- for (unsigned i = 0, e = BB->getTerminator()->getNumSuccessors();
- i != e; ++i) {
- Counts.push_back(std::make_pair(Edge(BB, i), EdgeCounts[Counter++]));
- if (Counter == EdgeCounts.size())
- return;
- }
-}
-
-// getBBTrace - This method is used by consumers of basic-block trace
-// information.
-//
-void ProfileInfoLoader::getBBTrace(std::vector<BasicBlock *> &Trace) {
- if (BBTrace.empty ()) {
- cerr << "Basic block trace is not available!\n";
- return;
- }
- cerr << "Basic block trace loading is not implemented yet!\n";
-}
diff --git a/release_23/lib/Analysis/ProfileInfoLoaderPass.cpp b/release_23/lib/Analysis/ProfileInfoLoaderPass.cpp
deleted file mode 100644
index e7612e1d821c..000000000000
--- a/release_23/lib/Analysis/ProfileInfoLoaderPass.cpp
+++ /dev/null
@@ -1,92 +0,0 @@
-//===- ProfileInfoLoaderPass.cpp - LLVM Pass to load profile info ---------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements a concrete implementation of profiling information that
-// loads the information from a profile dump file.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/BasicBlock.h"
-#include "llvm/InstrTypes.h"
-#include "llvm/Pass.h"
-#include "llvm/Analysis/Passes.h"
-#include "llvm/Analysis/ProfileInfo.h"
-#include "llvm/Analysis/ProfileInfoLoader.h"
-#include "llvm/Support/CommandLine.h"
-#include "llvm/Support/Compiler.h"
-#include "llvm/Support/Streams.h"
-using namespace llvm;
-
-namespace {
- static cl::opt<std::string>
- ProfileInfoFilename("profile-info-file", cl::init("llvmprof.out"),
- cl::value_desc("filename"),
- cl::desc("Profile file loaded by -profile-loader"));
-
- class VISIBILITY_HIDDEN LoaderPass : public ModulePass, public ProfileInfo {
- std::string Filename;
- public:
- static char ID; // Class identification, replacement for typeinfo
- explicit LoaderPass(const std::string &filename = "")
- : ModulePass((intptr_t)&ID), Filename(filename) {
- if (filename.empty()) Filename = ProfileInfoFilename;
- }
-
- virtual void getAnalysisUsage(AnalysisUsage &AU) const {
- AU.setPreservesAll();
- }
-
- virtual const char *getPassName() const {
- return "Profiling information loader";
- }
-
- /// run - Load the profile information from the specified file.
- virtual bool runOnModule(Module &M);
- };
-
- char LoaderPass::ID = 0;
- RegisterPass<LoaderPass>
- X("profile-loader", "Load profile information from llvmprof.out", false, true);
-
- RegisterAnalysisGroup<ProfileInfo> Y(X);
-} // End of anonymous namespace
-
-ModulePass *llvm::createProfileLoaderPass() { return new LoaderPass(); }
-
-/// createProfileLoaderPass - This function returns a Pass that loads the
-/// profiling information for the module from the specified filename, making it
-/// available to the optimizers.
-Pass *llvm::createProfileLoaderPass(const std::string &Filename) {
- return new LoaderPass(Filename);
-}
-
-bool LoaderPass::runOnModule(Module &M) {
- ProfileInfoLoader PIL("profile-loader", Filename, M);
- EdgeCounts.clear();
- bool PrintedWarning = false;
-
- std::vector<std::pair<ProfileInfoLoader::Edge, unsigned> > ECs;
- PIL.getEdgeCounts(ECs);
- for (unsigned i = 0, e = ECs.size(); i != e; ++i) {
- BasicBlock *BB = ECs[i].first.first;
- unsigned SuccNum = ECs[i].first.second;
- TerminatorInst *TI = BB->getTerminator();
- if (SuccNum >= TI->getNumSuccessors()) {
- if (!PrintedWarning) {
- cerr << "WARNING: profile information is inconsistent with "
- << "the current program!\n";
- PrintedWarning = true;
- }
- } else {
- EdgeCounts[std::make_pair(BB, TI->getSuccessor(SuccNum))]+= ECs[i].second;
- }
- }
-
- return false;
-}
diff --git a/release_23/lib/Analysis/ScalarEvolution.cpp b/release_23/lib/Analysis/ScalarEvolution.cpp
deleted file mode 100644
index b757531bc112..000000000000
--- a/release_23/lib/Analysis/ScalarEvolution.cpp
+++ /dev/null
@@ -1,2905 +0,0 @@
-//===- ScalarEvolution.cpp - Scalar Evolution Analysis ----------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains the implementation of the scalar evolution analysis
-// engine, which is used primarily to analyze expressions involving induction
-// variables in loops.
-//
-// There are several aspects to this library. First is the representation of
-// scalar expressions, which are represented as subclasses of the SCEV class.
-// These classes are used to represent certain types of subexpressions that we
-// can handle. These classes are reference counted, managed by the SCEVHandle
-// class. We only create one SCEV of a particular shape, so pointer-comparisons
-// for equality are legal.
-//
-// One important aspect of the SCEV objects is that they are never cyclic, even
-// if there is a cycle in the dataflow for an expression (ie, a PHI node). If
-// the PHI node is one of the idioms that we can represent (e.g., a polynomial
-// recurrence) then we represent it directly as a recurrence node, otherwise we
-// represent it as a SCEVUnknown node.
-//
-// In addition to being able to represent expressions of various types, we also
-// have folders that are used to build the *canonical* representation for a
-// particular expression. These folders are capable of using a variety of
-// rewrite rules to simplify the expressions.
-//
-// Once the folders are defined, we can implement the more interesting
-// higher-level code, such as the code that recognizes PHI nodes of various
-// types, computes the execution count of a loop, etc.
-//
-// TODO: We should use these routines and value representations to implement
-// dependence analysis!
-//
-//===----------------------------------------------------------------------===//
-//
-// There are several good references for the techniques used in this analysis.
-//
-// Chains of recurrences -- a method to expedite the evaluation
-// of closed-form functions
-// Olaf Bachmann, Paul S. Wang, Eugene V. Zima
-//
-// On computational properties of chains of recurrences
-// Eugene V. Zima
-//
-// Symbolic Evaluation of Chains of Recurrences for Loop Optimization
-// Robert A. van Engelen
-//
-// Efficient Symbolic Analysis for Optimizing Compilers
-// Robert A. van Engelen
-//
-// Using the chains of recurrences algebra for data dependence testing and
-// induction variable substitution
-// MS Thesis, Johnie Birch
-//
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "scalar-evolution"
-#include "llvm/Analysis/ScalarEvolutionExpressions.h"
-#include "llvm/Constants.h"
-#include "llvm/DerivedTypes.h"
-#include "llvm/GlobalVariable.h"
-#include "llvm/Instructions.h"
-#include "llvm/Analysis/ConstantFolding.h"
-#include "llvm/Analysis/LoopInfo.h"
-#include "llvm/Assembly/Writer.h"
-#include "llvm/Transforms/Scalar.h"
-#include "llvm/Support/CFG.h"
-#include "llvm/Support/CommandLine.h"
-#include "llvm/Support/Compiler.h"
-#include "llvm/Support/ConstantRange.h"
-#include "llvm/Support/InstIterator.h"
-#include "llvm/Support/ManagedStatic.h"
-#include "llvm/Support/MathExtras.h"
-#include "llvm/Support/Streams.h"
-#include "llvm/ADT/Statistic.h"
-#include <ostream>
-#include <algorithm>
-#include <cmath>
-using namespace llvm;
-
-STATISTIC(NumBruteForceEvaluations,
- "Number of brute force evaluations needed to "
- "calculate high-order polynomial exit values");
-STATISTIC(NumArrayLenItCounts,
- "Number of trip counts computed with array length");
-STATISTIC(NumTripCountsComputed,
- "Number of loops with predictable loop counts");
-STATISTIC(NumTripCountsNotComputed,
- "Number of loops without predictable loop counts");
-STATISTIC(NumBruteForceTripCountsComputed,
- "Number of loops with trip counts computed by force");
-
-cl::opt<unsigned>
-MaxBruteForceIterations("scalar-evolution-max-iterations", cl::ReallyHidden,
- cl::desc("Maximum number of iterations SCEV will "
- "symbolically execute a constant derived loop"),
- cl::init(100));
-
-namespace {
- RegisterPass<ScalarEvolution>
- R("scalar-evolution", "Scalar Evolution Analysis", false, true);
-}
-char ScalarEvolution::ID = 0;
-
-//===----------------------------------------------------------------------===//
-// SCEV class definitions
-//===----------------------------------------------------------------------===//
-
-//===----------------------------------------------------------------------===//
-// Implementation of the SCEV class.
-//
-SCEV::~SCEV() {}
-void SCEV::dump() const {
- print(cerr);
-}
-
-/// getValueRange - Return the tightest constant bounds that this value is
-/// known to have. This method is only valid on integer SCEV objects.
-ConstantRange SCEV::getValueRange() const {
- const Type *Ty = getType();
- assert(Ty->isInteger() && "Can't get range for a non-integer SCEV!");
- // Default to a full range if no better information is available.
- return ConstantRange(getBitWidth());
-}
-
-uint32_t SCEV::getBitWidth() const {
- if (const IntegerType* ITy = dyn_cast<IntegerType>(getType()))
- return ITy->getBitWidth();
- return 0;
-}
-
-
-SCEVCouldNotCompute::SCEVCouldNotCompute() : SCEV(scCouldNotCompute) {}
-
-bool SCEVCouldNotCompute::isLoopInvariant(const Loop *L) const {
- assert(0 && "Attempt to use a SCEVCouldNotCompute object!");
- return false;
-}
-
-const Type *SCEVCouldNotCompute::getType() const {
- assert(0 && "Attempt to use a SCEVCouldNotCompute object!");
- return 0;
-}
-
-bool SCEVCouldNotCompute::hasComputableLoopEvolution(const Loop *L) const {
- assert(0 && "Attempt to use a SCEVCouldNotCompute object!");
- return false;
-}
-
-SCEVHandle SCEVCouldNotCompute::
-replaceSymbolicValuesWithConcrete(const SCEVHandle &Sym,
- const SCEVHandle &Conc,
- ScalarEvolution &SE) const {
- return this;
-}
-
-void SCEVCouldNotCompute::print(std::ostream &OS) const {
- OS << "***COULDNOTCOMPUTE***";
-}
-
-bool SCEVCouldNotCompute::classof(const SCEV *S) {
- return S->getSCEVType() == scCouldNotCompute;
-}
-
-
-// SCEVConstants - Only allow the creation of one SCEVConstant for any
-// particular value. Don't use a SCEVHandle here, or else the object will
-// never be deleted!
-static ManagedStatic<std::map<ConstantInt*, SCEVConstant*> > SCEVConstants;
-
-
-SCEVConstant::~SCEVConstant() {
- SCEVConstants->erase(V);
-}
-
-SCEVHandle ScalarEvolution::getConstant(ConstantInt *V) {
- SCEVConstant *&R = (*SCEVConstants)[V];
- if (R == 0) R = new SCEVConstant(V);
- return R;
-}
-
-SCEVHandle ScalarEvolution::getConstant(const APInt& Val) {
- return getConstant(ConstantInt::get(Val));
-}
-
-ConstantRange SCEVConstant::getValueRange() const {
- return ConstantRange(V->getValue());
-}
-
-const Type *SCEVConstant::getType() const { return V->getType(); }
-
-void SCEVConstant::print(std::ostream &OS) const {
- WriteAsOperand(OS, V, false);
-}
-
-// SCEVTruncates - Only allow the creation of one SCEVTruncateExpr for any
-// particular input. Don't use a SCEVHandle here, or else the object will
-// never be deleted!
-static ManagedStatic<std::map<std::pair<SCEV*, const Type*>,
- SCEVTruncateExpr*> > SCEVTruncates;
-
-SCEVTruncateExpr::SCEVTruncateExpr(const SCEVHandle &op, const Type *ty)
- : SCEV(scTruncate), Op(op), Ty(ty) {
- assert(Op->getType()->isInteger() && Ty->isInteger() &&
- "Cannot truncate non-integer value!");
- assert(Op->getType()->getPrimitiveSizeInBits() > Ty->getPrimitiveSizeInBits()
- && "This is not a truncating conversion!");
-}
-
-SCEVTruncateExpr::~SCEVTruncateExpr() {
- SCEVTruncates->erase(std::make_pair(Op, Ty));
-}
-
-ConstantRange SCEVTruncateExpr::getValueRange() const {
- return getOperand()->getValueRange().truncate(getBitWidth());
-}
-
-void SCEVTruncateExpr::print(std::ostream &OS) const {
- OS << "(truncate " << *Op << " to " << *Ty << ")";
-}
-
-// SCEVZeroExtends - Only allow the creation of one SCEVZeroExtendExpr for any
-// particular input. Don't use a SCEVHandle here, or else the object will never
-// be deleted!
-static ManagedStatic<std::map<std::pair<SCEV*, const Type*>,
- SCEVZeroExtendExpr*> > SCEVZeroExtends;
-
-SCEVZeroExtendExpr::SCEVZeroExtendExpr(const SCEVHandle &op, const Type *ty)
- : SCEV(scZeroExtend), Op(op), Ty(ty) {
- assert(Op->getType()->isInteger() && Ty->isInteger() &&
- "Cannot zero extend non-integer value!");
- assert(Op->getType()->getPrimitiveSizeInBits() < Ty->getPrimitiveSizeInBits()
- && "This is not an extending conversion!");
-}
-
-SCEVZeroExtendExpr::~SCEVZeroExtendExpr() {
- SCEVZeroExtends->erase(std::make_pair(Op, Ty));
-}
-
-ConstantRange SCEVZeroExtendExpr::getValueRange() const {
- return getOperand()->getValueRange().zeroExtend(getBitWidth());
-}
-
-void SCEVZeroExtendExpr::print(std::ostream &OS) const {
- OS << "(zeroextend " << *Op << " to " << *Ty << ")";
-}
-
-// SCEVSignExtends - Only allow the creation of one SCEVSignExtendExpr for any
-// particular input. Don't use a SCEVHandle here, or else the object will never
-// be deleted!
-static ManagedStatic<std::map<std::pair<SCEV*, const Type*>,
- SCEVSignExtendExpr*> > SCEVSignExtends;
-
-SCEVSignExtendExpr::SCEVSignExtendExpr(const SCEVHandle &op, const Type *ty)
- : SCEV(scSignExtend), Op(op), Ty(ty) {
- assert(Op->getType()->isInteger() && Ty->isInteger() &&
- "Cannot sign extend non-integer value!");
- assert(Op->getType()->getPrimitiveSizeInBits() < Ty->getPrimitiveSizeInBits()
- && "This is not an extending conversion!");
-}
-
-SCEVSignExtendExpr::~SCEVSignExtendExpr() {
- SCEVSignExtends->erase(std::make_pair(Op, Ty));
-}
-
-ConstantRange SCEVSignExtendExpr::getValueRange() const {
- return getOperand()->getValueRange().signExtend(getBitWidth());
-}
-
-void SCEVSignExtendExpr::print(std::ostream &OS) const {
- OS << "(signextend " << *Op << " to " << *Ty << ")";
-}
-
-// SCEVCommExprs - Only allow the creation of one SCEVCommutativeExpr for any
-// particular input. Don't use a SCEVHandle here, or else the object will never
-// be deleted!
-static ManagedStatic<std::map<std::pair<unsigned, std::vector<SCEV*> >,
- SCEVCommutativeExpr*> > SCEVCommExprs;
-
-SCEVCommutativeExpr::~SCEVCommutativeExpr() {
- SCEVCommExprs->erase(std::make_pair(getSCEVType(),
- std::vector<SCEV*>(Operands.begin(),
- Operands.end())));
-}
-
-void SCEVCommutativeExpr::print(std::ostream &OS) const {
- assert(Operands.size() > 1 && "This plus expr shouldn't exist!");
- const char *OpStr = getOperationStr();
- OS << "(" << *Operands[0];
- for (unsigned i = 1, e = Operands.size(); i != e; ++i)
- OS << OpStr << *Operands[i];
- OS << ")";
-}
-
-SCEVHandle SCEVCommutativeExpr::
-replaceSymbolicValuesWithConcrete(const SCEVHandle &Sym,
- const SCEVHandle &Conc,
- ScalarEvolution &SE) const {
- for (unsigned i = 0, e = getNumOperands(); i != e; ++i) {
- SCEVHandle H =
- getOperand(i)->replaceSymbolicValuesWithConcrete(Sym, Conc, SE);
- if (H != getOperand(i)) {
- std::vector<SCEVHandle> NewOps;
- NewOps.reserve(getNumOperands());
- for (unsigned j = 0; j != i; ++j)
- NewOps.push_back(getOperand(j));
- NewOps.push_back(H);
- for (++i; i != e; ++i)
- NewOps.push_back(getOperand(i)->
- replaceSymbolicValuesWithConcrete(Sym, Conc, SE));
-
- if (isa<SCEVAddExpr>(this))
- return SE.getAddExpr(NewOps);
- else if (isa<SCEVMulExpr>(this))
- return SE.getMulExpr(NewOps);
- else if (isa<SCEVSMaxExpr>(this))
- return SE.getSMaxExpr(NewOps);
- else if (isa<SCEVUMaxExpr>(this))
- return SE.getUMaxExpr(NewOps);
- else
- assert(0 && "Unknown commutative expr!");
- }
- }
- return this;
-}
-
-
-// SCEVUDivs - Only allow the creation of one SCEVUDivExpr for any particular
-// input. Don't use a SCEVHandle here, or else the object will never be
-// deleted!
-static ManagedStatic<std::map<std::pair<SCEV*, SCEV*>,
- SCEVUDivExpr*> > SCEVUDivs;
-
-SCEVUDivExpr::~SCEVUDivExpr() {
- SCEVUDivs->erase(std::make_pair(LHS, RHS));
-}
-
-void SCEVUDivExpr::print(std::ostream &OS) const {
- OS << "(" << *LHS << " /u " << *RHS << ")";
-}
-
-const Type *SCEVUDivExpr::getType() const {
- return LHS->getType();
-}
-
-// SCEVAddRecExprs - Only allow the creation of one SCEVAddRecExpr for any
-// particular input. Don't use a SCEVHandle here, or else the object will never
-// be deleted!
-static ManagedStatic<std::map<std::pair<const Loop *, std::vector<SCEV*> >,
- SCEVAddRecExpr*> > SCEVAddRecExprs;
-
-SCEVAddRecExpr::~SCEVAddRecExpr() {
- SCEVAddRecExprs->erase(std::make_pair(L,
- std::vector<SCEV*>(Operands.begin(),
- Operands.end())));
-}
-
-SCEVHandle SCEVAddRecExpr::
-replaceSymbolicValuesWithConcrete(const SCEVHandle &Sym,
- const SCEVHandle &Conc,
- ScalarEvolution &SE) const {
- for (unsigned i = 0, e = getNumOperands(); i != e; ++i) {
- SCEVHandle H =
- getOperand(i)->replaceSymbolicValuesWithConcrete(Sym, Conc, SE);
- if (H != getOperand(i)) {
- std::vector<SCEVHandle> NewOps;
- NewOps.reserve(getNumOperands());
- for (unsigned j = 0; j != i; ++j)
- NewOps.push_back(getOperand(j));
- NewOps.push_back(H);
- for (++i; i != e; ++i)
- NewOps.push_back(getOperand(i)->
- replaceSymbolicValuesWithConcrete(Sym, Conc, SE));
-
- return SE.getAddRecExpr(NewOps, L);
- }
- }
- return this;
-}
-
-
-bool SCEVAddRecExpr::isLoopInvariant(const Loop *QueryLoop) const {
- // This recurrence is invariant w.r.t to QueryLoop iff QueryLoop doesn't
- // contain L and if the start is invariant.
- return !QueryLoop->contains(L->getHeader()) &&
- getOperand(0)->isLoopInvariant(QueryLoop);
-}
-
-
-void SCEVAddRecExpr::print(std::ostream &OS) const {
- OS << "{" << *Operands[0];
- for (unsigned i = 1, e = Operands.size(); i != e; ++i)
- OS << ",+," << *Operands[i];
- OS << "}<" << L->getHeader()->getName() + ">";
-}
-
-// SCEVUnknowns - Only allow the creation of one SCEVUnknown for any particular
-// value. Don't use a SCEVHandle here, or else the object will never be
-// deleted!
-static ManagedStatic<std::map<Value*, SCEVUnknown*> > SCEVUnknowns;
-
-SCEVUnknown::~SCEVUnknown() { SCEVUnknowns->erase(V); }
-
-bool SCEVUnknown::isLoopInvariant(const Loop *L) const {
- // All non-instruction values are loop invariant. All instructions are loop
- // invariant if they are not contained in the specified loop.
- if (Instruction *I = dyn_cast<Instruction>(V))
- return !L->contains(I->getParent());
- return true;
-}
-
-const Type *SCEVUnknown::getType() const {
- return V->getType();
-}
-
-void SCEVUnknown::print(std::ostream &OS) const {
- WriteAsOperand(OS, V, false);
-}
-
-//===----------------------------------------------------------------------===//
-// SCEV Utilities
-//===----------------------------------------------------------------------===//
-
-namespace {
- /// SCEVComplexityCompare - Return true if the complexity of the LHS is less
- /// than the complexity of the RHS. This comparator is used to canonicalize
- /// expressions.
- struct VISIBILITY_HIDDEN SCEVComplexityCompare {
- bool operator()(const SCEV *LHS, const SCEV *RHS) const {
- return LHS->getSCEVType() < RHS->getSCEVType();
- }
- };
-}
-
-/// GroupByComplexity - Given a list of SCEV objects, order them by their
-/// complexity, and group objects of the same complexity together by value.
-/// When this routine is finished, we know that any duplicates in the vector are
-/// consecutive and that complexity is monotonically increasing.
-///
-/// Note that we go take special precautions to ensure that we get determinstic
-/// results from this routine. In other words, we don't want the results of
-/// this to depend on where the addresses of various SCEV objects happened to
-/// land in memory.
-///
-static void GroupByComplexity(std::vector<SCEVHandle> &Ops) {
- if (Ops.size() < 2) return; // Noop
- if (Ops.size() == 2) {
- // This is the common case, which also happens to be trivially simple.
- // Special case it.
- if (SCEVComplexityCompare()(Ops[1], Ops[0]))
- std::swap(Ops[0], Ops[1]);
- return;
- }
-
- // Do the rough sort by complexity.
- std::sort(Ops.begin(), Ops.end(), SCEVComplexityCompare());
-
- // Now that we are sorted by complexity, group elements of the same
- // complexity. Note that this is, at worst, N^2, but the vector is likely to
- // be extremely short in practice. Note that we take this approach because we
- // do not want to depend on the addresses of the objects we are grouping.
- for (unsigned i = 0, e = Ops.size(); i != e-2; ++i) {
- SCEV *S = Ops[i];
- unsigned Complexity = S->getSCEVType();
-
- // If there are any objects of the same complexity and same value as this
- // one, group them.
- for (unsigned j = i+1; j != e && Ops[j]->getSCEVType() == Complexity; ++j) {
- if (Ops[j] == S) { // Found a duplicate.
- // Move it to immediately after i'th element.
- std::swap(Ops[i+1], Ops[j]);
- ++i; // no need to rescan it.
- if (i == e-2) return; // Done!
- }
- }
- }
-}
-
-
-
-//===----------------------------------------------------------------------===//
-// Simple SCEV method implementations
-//===----------------------------------------------------------------------===//
-
-/// getIntegerSCEV - Given an integer or FP type, create a constant for the
-/// specified signed integer value and return a SCEV for the constant.
-SCEVHandle ScalarEvolution::getIntegerSCEV(int Val, const Type *Ty) {
- Constant *C;
- if (Val == 0)
- C = Constant::getNullValue(Ty);
- else if (Ty->isFloatingPoint())
- C = ConstantFP::get(APFloat(Ty==Type::FloatTy ? APFloat::IEEEsingle :
- APFloat::IEEEdouble, Val));
- else
- C = ConstantInt::get(Ty, Val);
- return getUnknown(C);
-}
-
-/// getTruncateOrZeroExtend - Return a SCEV corresponding to a conversion of the
-/// input value to the specified type. If the type must be extended, it is zero
-/// extended.
-static SCEVHandle getTruncateOrZeroExtend(const SCEVHandle &V, const Type *Ty,
- ScalarEvolution &SE) {
- const Type *SrcTy = V->getType();
- assert(SrcTy->isInteger() && Ty->isInteger() &&
- "Cannot truncate or zero extend with non-integer arguments!");
- if (SrcTy->getPrimitiveSizeInBits() == Ty->getPrimitiveSizeInBits())
- return V; // No conversion
- if (SrcTy->getPrimitiveSizeInBits() > Ty->getPrimitiveSizeInBits())
- return SE.getTruncateExpr(V, Ty);
- return SE.getZeroExtendExpr(V, Ty);
-}
-
-/// getNegativeSCEV - Return a SCEV corresponding to -V = -1*V
-///
-SCEVHandle ScalarEvolution::getNegativeSCEV(const SCEVHandle &V) {
- if (SCEVConstant *VC = dyn_cast<SCEVConstant>(V))
- return getUnknown(ConstantExpr::getNeg(VC->getValue()));
-
- return getMulExpr(V, getConstant(ConstantInt::getAllOnesValue(V->getType())));
-}
-
-/// getNotSCEV - Return a SCEV corresponding to ~V = -1-V
-SCEVHandle ScalarEvolution::getNotSCEV(const SCEVHandle &V) {
- if (SCEVConstant *VC = dyn_cast<SCEVConstant>(V))
- return getUnknown(ConstantExpr::getNot(VC->getValue()));
-
- SCEVHandle AllOnes = getConstant(ConstantInt::getAllOnesValue(V->getType()));
- return getMinusSCEV(AllOnes, V);
-}
-
-/// getMinusSCEV - Return a SCEV corresponding to LHS - RHS.
-///
-SCEVHandle ScalarEvolution::getMinusSCEV(const SCEVHandle &LHS,
- const SCEVHandle &RHS) {
- // X - Y --> X + -Y
- return getAddExpr(LHS, getNegativeSCEV(RHS));
-}
-
-
-/// BinomialCoefficient - Compute BC(It, K). The result is of the same type as
-/// It. Assume, K > 0.
-static SCEVHandle BinomialCoefficient(SCEVHandle It, unsigned K,
- ScalarEvolution &SE) {
- // We are using the following formula for BC(It, K):
- //
- // BC(It, K) = (It * (It - 1) * ... * (It - K + 1)) / K!
- //
- // Suppose, W is the bitwidth of It (and of the return value as well). We
- // must be prepared for overflow. Hence, we must assure that the result of
- // our computation is equal to the accurate one modulo 2^W. Unfortunately,
- // division isn't safe in modular arithmetic. This means we must perform the
- // whole computation accurately and then truncate the result to W bits.
- //
- // The dividend of the formula is a multiplication of K integers of bitwidth
- // W. K*W bits suffice to compute it accurately.
- //
- // FIXME: We assume the divisor can be accurately computed using 16-bit
- // unsigned integer type. It is true up to K = 8 (AddRecs of length 9). In
- // future we may use APInt to use the minimum number of bits necessary to
- // compute it accurately.
- //
- // It is safe to use unsigned division here: the dividend is nonnegative and
- // the divisor is positive.
-
- // Handle the simplest case efficiently.
- if (K == 1)
- return It;
-
- assert(K < 9 && "We cannot handle such long AddRecs yet.");
-
- // FIXME: A temporary hack to remove in future. Arbitrary precision integers
- // aren't supported by the code generator yet. For the dividend, the bitwidth
- // we use is the smallest power of 2 greater or equal to K*W and less or equal
- // to 64. Note that setting the upper bound for bitwidth may still lead to
- // miscompilation in some cases.
- unsigned DividendBits = 1U << Log2_32_Ceil(K * It->getBitWidth());
- if (DividendBits > 64)
- DividendBits = 64;
-#if 0 // Waiting for the APInt support in the code generator...
- unsigned DividendBits = K * It->getBitWidth();
-#endif
-
- const IntegerType *DividendTy = IntegerType::get(DividendBits);
- const SCEVHandle ExIt = SE.getZeroExtendExpr(It, DividendTy);
-
- // The final number of bits we need to perform the division is the maximum of
- // dividend and divisor bitwidths.
- const IntegerType *DivisionTy =
- IntegerType::get(std::max(DividendBits, 16U));
-
- // Compute K! We know K >= 2 here.
- unsigned F = 2;
- for (unsigned i = 3; i <= K; ++i)
- F *= i;
- APInt Divisor(DivisionTy->getBitWidth(), F);
-
- // Handle this case efficiently, it is common to have constant iteration
- // counts while computing loop exit values.
- if (SCEVConstant *SC = dyn_cast<SCEVConstant>(ExIt)) {
- const APInt& N = SC->getValue()->getValue();
- APInt Dividend(N.getBitWidth(), 1);
- for (; K; --K)
- Dividend *= N-(K-1);
- if (DividendTy != DivisionTy)
- Dividend = Dividend.zext(DivisionTy->getBitWidth());
- return SE.getConstant(Dividend.udiv(Divisor).trunc(It->getBitWidth()));
- }
-
- SCEVHandle Dividend = ExIt;
- for (unsigned i = 1; i != K; ++i)
- Dividend =
- SE.getMulExpr(Dividend,
- SE.getMinusSCEV(ExIt, SE.getIntegerSCEV(i, DividendTy)));
- if (DividendTy != DivisionTy)
- Dividend = SE.getZeroExtendExpr(Dividend, DivisionTy);
- return
- SE.getTruncateExpr(SE.getUDivExpr(Dividend, SE.getConstant(Divisor)),
- It->getType());
-}
-
-/// evaluateAtIteration - Return the value of this chain of recurrences at
-/// the specified iteration number. We can evaluate this recurrence by
-/// multiplying each element in the chain by the binomial coefficient
-/// corresponding to it. In other words, we can evaluate {A,+,B,+,C,+,D} as:
-///
-/// A*BC(It, 0) + B*BC(It, 1) + C*BC(It, 2) + D*BC(It, 3)
-///
-/// where BC(It, k) stands for binomial coefficient.
-///
-SCEVHandle SCEVAddRecExpr::evaluateAtIteration(SCEVHandle It,
- ScalarEvolution &SE) const {
- SCEVHandle Result = getStart();
- for (unsigned i = 1, e = getNumOperands(); i != e; ++i) {
- // The computation is correct in the face of overflow provided that the
- // multiplication is performed _after_ the evaluation of the binomial
- // coefficient.
- SCEVHandle Val = SE.getMulExpr(getOperand(i),
- BinomialCoefficient(It, i, SE));
- Result = SE.getAddExpr(Result, Val);
- }
- return Result;
-}
-
-//===----------------------------------------------------------------------===//
-// SCEV Expression folder implementations
-//===----------------------------------------------------------------------===//
-
-SCEVHandle ScalarEvolution::getTruncateExpr(const SCEVHandle &Op, const Type *Ty) {
- if (SCEVConstant *SC = dyn_cast<SCEVConstant>(Op))
- return getUnknown(
- ConstantExpr::getTrunc(SC->getValue(), Ty));
-
- // If the input value is a chrec scev made out of constants, truncate
- // all of the constants.
- if (SCEVAddRecExpr *AddRec = dyn_cast<SCEVAddRecExpr>(Op)) {
- std::vector<SCEVHandle> Operands;
- for (unsigned i = 0, e = AddRec->getNumOperands(); i != e; ++i)
- // FIXME: This should allow truncation of other expression types!
- if (isa<SCEVConstant>(AddRec->getOperand(i)))
- Operands.push_back(getTruncateExpr(AddRec->getOperand(i), Ty));
- else
- break;
- if (Operands.size() == AddRec->getNumOperands())
- return getAddRecExpr(Operands, AddRec->getLoop());
- }
-
- SCEVTruncateExpr *&Result = (*SCEVTruncates)[std::make_pair(Op, Ty)];
- if (Result == 0) Result = new SCEVTruncateExpr(Op, Ty);
- return Result;
-}
-
-SCEVHandle ScalarEvolution::getZeroExtendExpr(const SCEVHandle &Op, const Type *Ty) {
- if (SCEVConstant *SC = dyn_cast<SCEVConstant>(Op))
- return getUnknown(
- ConstantExpr::getZExt(SC->getValue(), Ty));
-
- // FIXME: If the input value is a chrec scev, and we can prove that the value
- // did not overflow the old, smaller, value, we can zero extend all of the
- // operands (often constants). This would allow analysis of something like
- // this: for (unsigned char X = 0; X < 100; ++X) { int Y = X; }
-
- SCEVZeroExtendExpr *&Result = (*SCEVZeroExtends)[std::make_pair(Op, Ty)];
- if (Result == 0) Result = new SCEVZeroExtendExpr(Op, Ty);
- return Result;
-}
-
-SCEVHandle ScalarEvolution::getSignExtendExpr(const SCEVHandle &Op, const Type *Ty) {
- if (SCEVConstant *SC = dyn_cast<SCEVConstant>(Op))
- return getUnknown(
- ConstantExpr::getSExt(SC->getValue(), Ty));
-
- // FIXME: If the input value is a chrec scev, and we can prove that the value
- // did not overflow the old, smaller, value, we can sign extend all of the
- // operands (often constants). This would allow analysis of something like
- // this: for (signed char X = 0; X < 100; ++X) { int Y = X; }
-
- SCEVSignExtendExpr *&Result = (*SCEVSignExtends)[std::make_pair(Op, Ty)];
- if (Result == 0) Result = new SCEVSignExtendExpr(Op, Ty);
- return Result;
-}
-
-// get - Get a canonical add expression, or something simpler if possible.
-SCEVHandle ScalarEvolution::getAddExpr(std::vector<SCEVHandle> &Ops) {
- assert(!Ops.empty() && "Cannot get empty add!");
- if (Ops.size() == 1) return Ops[0];
-
- // Sort by complexity, this groups all similar expression types together.
- GroupByComplexity(Ops);
-
- // If there are any constants, fold them together.
- unsigned Idx = 0;
- if (SCEVConstant *LHSC = dyn_cast<SCEVConstant>(Ops[0])) {
- ++Idx;
- assert(Idx < Ops.size());
- while (SCEVConstant *RHSC = dyn_cast<SCEVConstant>(Ops[Idx])) {
- // We found two constants, fold them together!
- ConstantInt *Fold = ConstantInt::get(LHSC->getValue()->getValue() +
- RHSC->getValue()->getValue());
- Ops[0] = getConstant(Fold);
- Ops.erase(Ops.begin()+1); // Erase the folded element
- if (Ops.size() == 1) return Ops[0];
- LHSC = cast<SCEVConstant>(Ops[0]);
- }
-
- // If we are left with a constant zero being added, strip it off.
- if (cast<SCEVConstant>(Ops[0])->getValue()->isZero()) {
- Ops.erase(Ops.begin());
- --Idx;
- }
- }
-
- if (Ops.size() == 1) return Ops[0];
-
- // Okay, check to see if the same value occurs in the operand list twice. If
- // so, merge them together into an multiply expression. Since we sorted the
- // list, these values are required to be adjacent.
- const Type *Ty = Ops[0]->getType();
- for (unsigned i = 0, e = Ops.size()-1; i != e; ++i)
- if (Ops[i] == Ops[i+1]) { // X + Y + Y --> X + Y*2
- // Found a match, merge the two values into a multiply, and add any
- // remaining values to the result.
- SCEVHandle Two = getIntegerSCEV(2, Ty);
- SCEVHandle Mul = getMulExpr(Ops[i], Two);
- if (Ops.size() == 2)
- return Mul;
- Ops.erase(Ops.begin()+i, Ops.begin()+i+2);
- Ops.push_back(Mul);
- return getAddExpr(Ops);
- }
-
- // Now we know the first non-constant operand. Skip past any cast SCEVs.
- while (Idx < Ops.size() && Ops[Idx]->getSCEVType() < scAddExpr)
- ++Idx;
-
- // If there are add operands they would be next.
- if (Idx < Ops.size()) {
- bool DeletedAdd = false;
- while (SCEVAddExpr *Add = dyn_cast<SCEVAddExpr>(Ops[Idx])) {
- // If we have an add, expand the add operands onto the end of the operands
- // list.
- Ops.insert(Ops.end(), Add->op_begin(), Add->op_end());
- Ops.erase(Ops.begin()+Idx);
- DeletedAdd = true;
- }
-
- // If we deleted at least one add, we added operands to the end of the list,
- // and they are not necessarily sorted. Recurse to resort and resimplify
- // any operands we just aquired.
- if (DeletedAdd)
- return getAddExpr(Ops);
- }
-
- // Skip over the add expression until we get to a multiply.
- while (Idx < Ops.size() && Ops[Idx]->getSCEVType() < scMulExpr)
- ++Idx;
-
- // If we are adding something to a multiply expression, make sure the
- // something is not already an operand of the multiply. If so, merge it into
- // the multiply.
- for (; Idx < Ops.size() && isa<SCEVMulExpr>(Ops[Idx]); ++Idx) {
- SCEVMulExpr *Mul = cast<SCEVMulExpr>(Ops[Idx]);
- for (unsigned MulOp = 0, e = Mul->getNumOperands(); MulOp != e; ++MulOp) {
- SCEV *MulOpSCEV = Mul->getOperand(MulOp);
- for (unsigned AddOp = 0, e = Ops.size(); AddOp != e; ++AddOp)
- if (MulOpSCEV == Ops[AddOp] && !isa<SCEVConstant>(MulOpSCEV)) {
- // Fold W + X + (X * Y * Z) --> W + (X * ((Y*Z)+1))
- SCEVHandle InnerMul = Mul->getOperand(MulOp == 0);
- if (Mul->getNumOperands() != 2) {
- // If the multiply has more than two operands, we must get the
- // Y*Z term.
- std::vector<SCEVHandle> MulOps(Mul->op_begin(), Mul->op_end());
- MulOps.erase(MulOps.begin()+MulOp);
- InnerMul = getMulExpr(MulOps);
- }
- SCEVHandle One = getIntegerSCEV(1, Ty);
- SCEVHandle AddOne = getAddExpr(InnerMul, One);
- SCEVHandle OuterMul = getMulExpr(AddOne, Ops[AddOp]);
- if (Ops.size() == 2) return OuterMul;
- if (AddOp < Idx) {
- Ops.erase(Ops.begin()+AddOp);
- Ops.erase(Ops.begin()+Idx-1);
- } else {
- Ops.erase(Ops.begin()+Idx);
- Ops.erase(Ops.begin()+AddOp-1);
- }
- Ops.push_back(OuterMul);
- return getAddExpr(Ops);
- }
-
- // Check this multiply against other multiplies being added together.
- for (unsigned OtherMulIdx = Idx+1;
- OtherMulIdx < Ops.size() && isa<SCEVMulExpr>(Ops[OtherMulIdx]);
- ++OtherMulIdx) {
- SCEVMulExpr *OtherMul = cast<SCEVMulExpr>(Ops[OtherMulIdx]);
- // If MulOp occurs in OtherMul, we can fold the two multiplies
- // together.
- for (unsigned OMulOp = 0, e = OtherMul->getNumOperands();
- OMulOp != e; ++OMulOp)
- if (OtherMul->getOperand(OMulOp) == MulOpSCEV) {
- // Fold X + (A*B*C) + (A*D*E) --> X + (A*(B*C+D*E))
- SCEVHandle InnerMul1 = Mul->getOperand(MulOp == 0);
- if (Mul->getNumOperands() != 2) {
- std::vector<SCEVHandle> MulOps(Mul->op_begin(), Mul->op_end());
- MulOps.erase(MulOps.begin()+MulOp);
- InnerMul1 = getMulExpr(MulOps);
- }
- SCEVHandle InnerMul2 = OtherMul->getOperand(OMulOp == 0);
- if (OtherMul->getNumOperands() != 2) {
- std::vector<SCEVHandle> MulOps(OtherMul->op_begin(),
- OtherMul->op_end());
- MulOps.erase(MulOps.begin()+OMulOp);
- InnerMul2 = getMulExpr(MulOps);
- }
- SCEVHandle InnerMulSum = getAddExpr(InnerMul1,InnerMul2);
- SCEVHandle OuterMul = getMulExpr(MulOpSCEV, InnerMulSum);
- if (Ops.size() == 2) return OuterMul;
- Ops.erase(Ops.begin()+Idx);
- Ops.erase(Ops.begin()+OtherMulIdx-1);
- Ops.push_back(OuterMul);
- return getAddExpr(Ops);
- }
- }
- }
- }
-
- // If there are any add recurrences in the operands list, see if any other
- // added values are loop invariant. If so, we can fold them into the
- // recurrence.
- while (Idx < Ops.size() && Ops[Idx]->getSCEVType() < scAddRecExpr)
- ++Idx;
-
- // Scan over all recurrences, trying to fold loop invariants into them.
- for (; Idx < Ops.size() && isa<SCEVAddRecExpr>(Ops[Idx]); ++Idx) {
- // Scan all of the other operands to this add and add them to the vector if
- // they are loop invariant w.r.t. the recurrence.
- std::vector<SCEVHandle> LIOps;
- SCEVAddRecExpr *AddRec = cast<SCEVAddRecExpr>(Ops[Idx]);
- for (unsigned i = 0, e = Ops.size(); i != e; ++i)
- if (Ops[i]->isLoopInvariant(AddRec->getLoop())) {
- LIOps.push_back(Ops[i]);
- Ops.erase(Ops.begin()+i);
- --i; --e;
- }
-
- // If we found some loop invariants, fold them into the recurrence.
- if (!LIOps.empty()) {
- // NLI + LI + { Start,+,Step} --> NLI + { LI+Start,+,Step }
- LIOps.push_back(AddRec->getStart());
-
- std::vector<SCEVHandle> AddRecOps(AddRec->op_begin(), AddRec->op_end());
- AddRecOps[0] = getAddExpr(LIOps);
-
- SCEVHandle NewRec = getAddRecExpr(AddRecOps, AddRec->getLoop());
- // If all of the other operands were loop invariant, we are done.
- if (Ops.size() == 1) return NewRec;
-
- // Otherwise, add the folded AddRec by the non-liv parts.
- for (unsigned i = 0;; ++i)
- if (Ops[i] == AddRec) {
- Ops[i] = NewRec;
- break;
- }
- return getAddExpr(Ops);
- }
-
- // Okay, if there weren't any loop invariants to be folded, check to see if
- // there are multiple AddRec's with the same loop induction variable being
- // added together. If so, we can fold them.
- for (unsigned OtherIdx = Idx+1;
- OtherIdx < Ops.size() && isa<SCEVAddRecExpr>(Ops[OtherIdx]);++OtherIdx)
- if (OtherIdx != Idx) {
- SCEVAddRecExpr *OtherAddRec = cast<SCEVAddRecExpr>(Ops[OtherIdx]);
- if (AddRec->getLoop() == OtherAddRec->getLoop()) {
- // Other + {A,+,B} + {C,+,D} --> Other + {A+C,+,B+D}
- std::vector<SCEVHandle> NewOps(AddRec->op_begin(), AddRec->op_end());
- for (unsigned i = 0, e = OtherAddRec->getNumOperands(); i != e; ++i) {
- if (i >= NewOps.size()) {
- NewOps.insert(NewOps.end(), OtherAddRec->op_begin()+i,
- OtherAddRec->op_end());
- break;
- }
- NewOps[i] = getAddExpr(NewOps[i], OtherAddRec->getOperand(i));
- }
- SCEVHandle NewAddRec = getAddRecExpr(NewOps, AddRec->getLoop());
-
- if (Ops.size() == 2) return NewAddRec;
-
- Ops.erase(Ops.begin()+Idx);
- Ops.erase(Ops.begin()+OtherIdx-1);
- Ops.push_back(NewAddRec);
- return getAddExpr(Ops);
- }
- }
-
- // Otherwise couldn't fold anything into this recurrence. Move onto the
- // next one.
- }
-
- // Okay, it looks like we really DO need an add expr. Check to see if we
- // already have one, otherwise create a new one.
- std::vector<SCEV*> SCEVOps(Ops.begin(), Ops.end());
- SCEVCommutativeExpr *&Result = (*SCEVCommExprs)[std::make_pair(scAddExpr,
- SCEVOps)];
- if (Result == 0) Result = new SCEVAddExpr(Ops);
- return Result;
-}
-
-
-SCEVHandle ScalarEvolution::getMulExpr(std::vector<SCEVHandle> &Ops) {
- assert(!Ops.empty() && "Cannot get empty mul!");
-
- // Sort by complexity, this groups all similar expression types together.
- GroupByComplexity(Ops);
-
- // If there are any constants, fold them together.
- unsigned Idx = 0;
- if (SCEVConstant *LHSC = dyn_cast<SCEVConstant>(Ops[0])) {
-
- // C1*(C2+V) -> C1*C2 + C1*V
- if (Ops.size() == 2)
- if (SCEVAddExpr *Add = dyn_cast<SCEVAddExpr>(Ops[1]))
- if (Add->getNumOperands() == 2 &&
- isa<SCEVConstant>(Add->getOperand(0)))
- return getAddExpr(getMulExpr(LHSC, Add->getOperand(0)),
- getMulExpr(LHSC, Add->getOperand(1)));
-
-
- ++Idx;
- while (SCEVConstant *RHSC = dyn_cast<SCEVConstant>(Ops[Idx])) {
- // We found two constants, fold them together!
- ConstantInt *Fold = ConstantInt::get(LHSC->getValue()->getValue() *
- RHSC->getValue()->getValue());
- Ops[0] = getConstant(Fold);
- Ops.erase(Ops.begin()+1); // Erase the folded element
- if (Ops.size() == 1) return Ops[0];
- LHSC = cast<SCEVConstant>(Ops[0]);
- }
-
- // If we are left with a constant one being multiplied, strip it off.
- if (cast<SCEVConstant>(Ops[0])->getValue()->equalsInt(1)) {
- Ops.erase(Ops.begin());
- --Idx;
- } else if (cast<SCEVConstant>(Ops[0])->getValue()->isZero()) {
- // If we have a multiply of zero, it will always be zero.
- return Ops[0];
- }
- }
-
- // Skip over the add expression until we get to a multiply.
- while (Idx < Ops.size() && Ops[Idx]->getSCEVType() < scMulExpr)
- ++Idx;
-
- if (Ops.size() == 1)
- return Ops[0];
-
- // If there are mul operands inline them all into this expression.
- if (Idx < Ops.size()) {
- bool DeletedMul = false;
- while (SCEVMulExpr *Mul = dyn_cast<SCEVMulExpr>(Ops[Idx])) {
- // If we have an mul, expand the mul operands onto the end of the operands
- // list.
- Ops.insert(Ops.end(), Mul->op_begin(), Mul->op_end());
- Ops.erase(Ops.begin()+Idx);
- DeletedMul = true;
- }
-
- // If we deleted at least one mul, we added operands to the end of the list,
- // and they are not necessarily sorted. Recurse to resort and resimplify
- // any operands we just aquired.
- if (DeletedMul)
- return getMulExpr(Ops);
- }
-
- // If there are any add recurrences in the operands list, see if any other
- // added values are loop invariant. If so, we can fold them into the
- // recurrence.
- while (Idx < Ops.size() && Ops[Idx]->getSCEVType() < scAddRecExpr)
- ++Idx;
-
- // Scan over all recurrences, trying to fold loop invariants into them.
- for (; Idx < Ops.size() && isa<SCEVAddRecExpr>(Ops[Idx]); ++Idx) {
- // Scan all of the other operands to this mul and add them to the vector if
- // they are loop invariant w.r.t. the recurrence.
- std::vector<SCEVHandle> LIOps;
- SCEVAddRecExpr *AddRec = cast<SCEVAddRecExpr>(Ops[Idx]);
- for (unsigned i = 0, e = Ops.size(); i != e; ++i)
- if (Ops[i]->isLoopInvariant(AddRec->getLoop())) {
- LIOps.push_back(Ops[i]);
- Ops.erase(Ops.begin()+i);
- --i; --e;
- }
-
- // If we found some loop invariants, fold them into the recurrence.
- if (!LIOps.empty()) {
- // NLI * LI * { Start,+,Step} --> NLI * { LI*Start,+,LI*Step }
- std::vector<SCEVHandle> NewOps;
- NewOps.reserve(AddRec->getNumOperands());
- if (LIOps.size() == 1) {
- SCEV *Scale = LIOps[0];
- for (unsigned i = 0, e = AddRec->getNumOperands(); i != e; ++i)
- NewOps.push_back(getMulExpr(Scale, AddRec->getOperand(i)));
- } else {
- for (unsigned i = 0, e = AddRec->getNumOperands(); i != e; ++i) {
- std::vector<SCEVHandle> MulOps(LIOps);
- MulOps.push_back(AddRec->getOperand(i));
- NewOps.push_back(getMulExpr(MulOps));
- }
- }
-
- SCEVHandle NewRec = getAddRecExpr(NewOps, AddRec->getLoop());
-
- // If all of the other operands were loop invariant, we are done.
- if (Ops.size() == 1) return NewRec;
-
- // Otherwise, multiply the folded AddRec by the non-liv parts.
- for (unsigned i = 0;; ++i)
- if (Ops[i] == AddRec) {
- Ops[i] = NewRec;
- break;
- }
- return getMulExpr(Ops);
- }
-
- // Okay, if there weren't any loop invariants to be folded, check to see if
- // there are multiple AddRec's with the same loop induction variable being
- // multiplied together. If so, we can fold them.
- for (unsigned OtherIdx = Idx+1;
- OtherIdx < Ops.size() && isa<SCEVAddRecExpr>(Ops[OtherIdx]);++OtherIdx)
- if (OtherIdx != Idx) {
- SCEVAddRecExpr *OtherAddRec = cast<SCEVAddRecExpr>(Ops[OtherIdx]);
- if (AddRec->getLoop() == OtherAddRec->getLoop()) {
- // F * G --> {A,+,B} * {C,+,D} --> {A*C,+,F*D + G*B + B*D}
- SCEVAddRecExpr *F = AddRec, *G = OtherAddRec;
- SCEVHandle NewStart = getMulExpr(F->getStart(),
- G->getStart());
- SCEVHandle B = F->getStepRecurrence(*this);
- SCEVHandle D = G->getStepRecurrence(*this);
- SCEVHandle NewStep = getAddExpr(getMulExpr(F, D),
- getMulExpr(G, B),
- getMulExpr(B, D));
- SCEVHandle NewAddRec = getAddRecExpr(NewStart, NewStep,
- F->getLoop());
- if (Ops.size() == 2) return NewAddRec;
-
- Ops.erase(Ops.begin()+Idx);
- Ops.erase(Ops.begin()+OtherIdx-1);
- Ops.push_back(NewAddRec);
- return getMulExpr(Ops);
- }
- }
-
- // Otherwise couldn't fold anything into this recurrence. Move onto the
- // next one.
- }
-
- // Okay, it looks like we really DO need an mul expr. Check to see if we
- // already have one, otherwise create a new one.
- std::vector<SCEV*> SCEVOps(Ops.begin(), Ops.end());
- SCEVCommutativeExpr *&Result = (*SCEVCommExprs)[std::make_pair(scMulExpr,
- SCEVOps)];
- if (Result == 0)
- Result = new SCEVMulExpr(Ops);
- return Result;
-}
-
-SCEVHandle ScalarEvolution::getUDivExpr(const SCEVHandle &LHS, const SCEVHandle &RHS) {
- if (SCEVConstant *RHSC = dyn_cast<SCEVConstant>(RHS)) {
- if (RHSC->getValue()->equalsInt(1))
- return LHS; // X udiv 1 --> x
-
- if (SCEVConstant *LHSC = dyn_cast<SCEVConstant>(LHS)) {
- Constant *LHSCV = LHSC->getValue();
- Constant *RHSCV = RHSC->getValue();
- return getUnknown(ConstantExpr::getUDiv(LHSCV, RHSCV));
- }
- }
-
- // FIXME: implement folding of (X*4)/4 when we know X*4 doesn't overflow.
-
- SCEVUDivExpr *&Result = (*SCEVUDivs)[std::make_pair(LHS, RHS)];
- if (Result == 0) Result = new SCEVUDivExpr(LHS, RHS);
- return Result;
-}
-
-
-/// SCEVAddRecExpr::get - Get a add recurrence expression for the
-/// specified loop. Simplify the expression as much as possible.
-SCEVHandle ScalarEvolution::getAddRecExpr(const SCEVHandle &Start,
- const SCEVHandle &Step, const Loop *L) {
- std::vector<SCEVHandle> Operands;
- Operands.push_back(Start);
- if (SCEVAddRecExpr *StepChrec = dyn_cast<SCEVAddRecExpr>(Step))
- if (StepChrec->getLoop() == L) {
- Operands.insert(Operands.end(), StepChrec->op_begin(),
- StepChrec->op_end());
- return getAddRecExpr(Operands, L);
- }
-
- Operands.push_back(Step);
- return getAddRecExpr(Operands, L);
-}
-
-/// SCEVAddRecExpr::get - Get a add recurrence expression for the
-/// specified loop. Simplify the expression as much as possible.
-SCEVHandle ScalarEvolution::getAddRecExpr(std::vector<SCEVHandle> &Operands,
- const Loop *L) {
- if (Operands.size() == 1) return Operands[0];
-
- if (SCEVConstant *StepC = dyn_cast<SCEVConstant>(Operands.back()))
- if (StepC->getValue()->isZero()) {
- Operands.pop_back();
- return getAddRecExpr(Operands, L); // { X,+,0 } --> X
- }
-
- SCEVAddRecExpr *&Result =
- (*SCEVAddRecExprs)[std::make_pair(L, std::vector<SCEV*>(Operands.begin(),
- Operands.end()))];
- if (Result == 0) Result = new SCEVAddRecExpr(Operands, L);
- return Result;
-}
-
-SCEVHandle ScalarEvolution::getSMaxExpr(const SCEVHandle &LHS,
- const SCEVHandle &RHS) {
- std::vector<SCEVHandle> Ops;
- Ops.push_back(LHS);
- Ops.push_back(RHS);
- return getSMaxExpr(Ops);
-}
-
-SCEVHandle ScalarEvolution::getSMaxExpr(std::vector<SCEVHandle> Ops) {
- assert(!Ops.empty() && "Cannot get empty smax!");
- if (Ops.size() == 1) return Ops[0];
-
- // Sort by complexity, this groups all similar expression types together.
- GroupByComplexity(Ops);
-
- // If there are any constants, fold them together.
- unsigned Idx = 0;
- if (SCEVConstant *LHSC = dyn_cast<SCEVConstant>(Ops[0])) {
- ++Idx;
- assert(Idx < Ops.size());
- while (SCEVConstant *RHSC = dyn_cast<SCEVConstant>(Ops[Idx])) {
- // We found two constants, fold them together!
- ConstantInt *Fold = ConstantInt::get(
- APIntOps::smax(LHSC->getValue()->getValue(),
- RHSC->getValue()->getValue()));
- Ops[0] = getConstant(Fold);
- Ops.erase(Ops.begin()+1); // Erase the folded element
- if (Ops.size() == 1) return Ops[0];
- LHSC = cast<SCEVConstant>(Ops[0]);
- }
-
- // If we are left with a constant -inf, strip it off.
- if (cast<SCEVConstant>(Ops[0])->getValue()->isMinValue(true)) {
- Ops.erase(Ops.begin());
- --Idx;
- }
- }
-
- if (Ops.size() == 1) return Ops[0];
-
- // Find the first SMax
- while (Idx < Ops.size() && Ops[Idx]->getSCEVType() < scSMaxExpr)
- ++Idx;
-
- // Check to see if one of the operands is an SMax. If so, expand its operands
- // onto our operand list, and recurse to simplify.
- if (Idx < Ops.size()) {
- bool DeletedSMax = false;
- while (SCEVSMaxExpr *SMax = dyn_cast<SCEVSMaxExpr>(Ops[Idx])) {
- Ops.insert(Ops.end(), SMax->op_begin(), SMax->op_end());
- Ops.erase(Ops.begin()+Idx);
- DeletedSMax = true;
- }
-
- if (DeletedSMax)
- return getSMaxExpr(Ops);
- }
-
- // Okay, check to see if the same value occurs in the operand list twice. If
- // so, delete one. Since we sorted the list, these values are required to
- // be adjacent.
- for (unsigned i = 0, e = Ops.size()-1; i != e; ++i)
- if (Ops[i] == Ops[i+1]) { // X smax Y smax Y --> X smax Y
- Ops.erase(Ops.begin()+i, Ops.begin()+i+1);
- --i; --e;
- }
-
- if (Ops.size() == 1) return Ops[0];
-
- assert(!Ops.empty() && "Reduced smax down to nothing!");
-
- // Okay, it looks like we really DO need an smax expr. Check to see if we
- // already have one, otherwise create a new one.
- std::vector<SCEV*> SCEVOps(Ops.begin(), Ops.end());
- SCEVCommutativeExpr *&Result = (*SCEVCommExprs)[std::make_pair(scSMaxExpr,
- SCEVOps)];
- if (Result == 0) Result = new SCEVSMaxExpr(Ops);
- return Result;
-}
-
-SCEVHandle ScalarEvolution::getUMaxExpr(const SCEVHandle &LHS,
- const SCEVHandle &RHS) {
- std::vector<SCEVHandle> Ops;
- Ops.push_back(LHS);
- Ops.push_back(RHS);
- return getUMaxExpr(Ops);
-}
-
-SCEVHandle ScalarEvolution::getUMaxExpr(std::vector<SCEVHandle> Ops) {
- assert(!Ops.empty() && "Cannot get empty umax!");
- if (Ops.size() == 1) return Ops[0];
-
- // Sort by complexity, this groups all similar expression types together.
- GroupByComplexity(Ops);
-
- // If there are any constants, fold them together.
- unsigned Idx = 0;
- if (SCEVConstant *LHSC = dyn_cast<SCEVConstant>(Ops[0])) {
- ++Idx;
- assert(Idx < Ops.size());
- while (SCEVConstant *RHSC = dyn_cast<SCEVConstant>(Ops[Idx])) {
- // We found two constants, fold them together!
- ConstantInt *Fold = ConstantInt::get(
- APIntOps::umax(LHSC->getValue()->getValue(),
- RHSC->getValue()->getValue()));
- Ops[0] = getConstant(Fold);
- Ops.erase(Ops.begin()+1); // Erase the folded element
- if (Ops.size() == 1) return Ops[0];
- LHSC = cast<SCEVConstant>(Ops[0]);
- }
-
- // If we are left with a constant zero, strip it off.
- if (cast<SCEVConstant>(Ops[0])->getValue()->isMinValue(false)) {
- Ops.erase(Ops.begin());
- --Idx;
- }
- }
-
- if (Ops.size() == 1) return Ops[0];
-
- // Find the first UMax
- while (Idx < Ops.size() && Ops[Idx]->getSCEVType() < scUMaxExpr)
- ++Idx;
-
- // Check to see if one of the operands is a UMax. If so, expand its operands
- // onto our operand list, and recurse to simplify.
- if (Idx < Ops.size()) {
- bool DeletedUMax = false;
- while (SCEVUMaxExpr *UMax = dyn_cast<SCEVUMaxExpr>(Ops[Idx])) {
- Ops.insert(Ops.end(), UMax->op_begin(), UMax->op_end());
- Ops.erase(Ops.begin()+Idx);
- DeletedUMax = true;
- }
-
- if (DeletedUMax)
- return getUMaxExpr(Ops);
- }
-
- // Okay, check to see if the same value occurs in the operand list twice. If
- // so, delete one. Since we sorted the list, these values are required to
- // be adjacent.
- for (unsigned i = 0, e = Ops.size()-1; i != e; ++i)
- if (Ops[i] == Ops[i+1]) { // X umax Y umax Y --> X umax Y
- Ops.erase(Ops.begin()+i, Ops.begin()+i+1);
- --i; --e;
- }
-
- if (Ops.size() == 1) return Ops[0];
-
- assert(!Ops.empty() && "Reduced umax down to nothing!");
-
- // Okay, it looks like we really DO need a umax expr. Check to see if we
- // already have one, otherwise create a new one.
- std::vector<SCEV*> SCEVOps(Ops.begin(), Ops.end());
- SCEVCommutativeExpr *&Result = (*SCEVCommExprs)[std::make_pair(scUMaxExpr,
- SCEVOps)];
- if (Result == 0) Result = new SCEVUMaxExpr(Ops);
- return Result;
-}
-
-SCEVHandle ScalarEvolution::getUnknown(Value *V) {
- if (ConstantInt *CI = dyn_cast<ConstantInt>(V))
- return getConstant(CI);
- SCEVUnknown *&Result = (*SCEVUnknowns)[V];
- if (Result == 0) Result = new SCEVUnknown(V);
- return Result;
-}
-
-
-//===----------------------------------------------------------------------===//
-// ScalarEvolutionsImpl Definition and Implementation
-//===----------------------------------------------------------------------===//
-//
-/// ScalarEvolutionsImpl - This class implements the main driver for the scalar
-/// evolution code.
-///
-namespace {
- struct VISIBILITY_HIDDEN ScalarEvolutionsImpl {
- /// SE - A reference to the public ScalarEvolution object.
- ScalarEvolution &SE;
-
- /// F - The function we are analyzing.
- ///
- Function &F;
-
- /// LI - The loop information for the function we are currently analyzing.
- ///
- LoopInfo &LI;
-
- /// UnknownValue - This SCEV is used to represent unknown trip counts and
- /// things.
- SCEVHandle UnknownValue;
-
- /// Scalars - This is a cache of the scalars we have analyzed so far.
- ///
- std::map<Value*, SCEVHandle> Scalars;
-
- /// IterationCounts - Cache the iteration count of the loops for this
- /// function as they are computed.
- std::map<const Loop*, SCEVHandle> IterationCounts;
-
- /// ConstantEvolutionLoopExitValue - This map contains entries for all of
- /// the PHI instructions that we attempt to compute constant evolutions for.
- /// This allows us to avoid potentially expensive recomputation of these
- /// properties. An instruction maps to null if we are unable to compute its
- /// exit value.
- std::map<PHINode*, Constant*> ConstantEvolutionLoopExitValue;
-
- public:
- ScalarEvolutionsImpl(ScalarEvolution &se, Function &f, LoopInfo &li)
- : SE(se), F(f), LI(li), UnknownValue(new SCEVCouldNotCompute()) {}
-
- /// getSCEV - Return an existing SCEV if it exists, otherwise analyze the
- /// expression and create a new one.
- SCEVHandle getSCEV(Value *V);
-
- /// hasSCEV - Return true if the SCEV for this value has already been
- /// computed.
- bool hasSCEV(Value *V) const {
- return Scalars.count(V);
- }
-
- /// setSCEV - Insert the specified SCEV into the map of current SCEVs for
- /// the specified value.
- void setSCEV(Value *V, const SCEVHandle &H) {
- bool isNew = Scalars.insert(std::make_pair(V, H)).second;
- assert(isNew && "This entry already existed!");
- }
-
-
- /// getSCEVAtScope - Compute the value of the specified expression within
- /// the indicated loop (which may be null to indicate in no loop). If the
- /// expression cannot be evaluated, return UnknownValue itself.
- SCEVHandle getSCEVAtScope(SCEV *V, const Loop *L);
-
-
- /// hasLoopInvariantIterationCount - Return true if the specified loop has
- /// an analyzable loop-invariant iteration count.
- bool hasLoopInvariantIterationCount(const Loop *L);
-
- /// getIterationCount - If the specified loop has a predictable iteration
- /// count, return it. Note that it is not valid to call this method on a
- /// loop without a loop-invariant iteration count.
- SCEVHandle getIterationCount(const Loop *L);
-
- /// deleteValueFromRecords - This method should be called by the
- /// client before it removes a value from the program, to make sure
- /// that no dangling references are left around.
- void deleteValueFromRecords(Value *V);
-
- private:
- /// createSCEV - We know that there is no SCEV for the specified value.
- /// Analyze the expression.
- SCEVHandle createSCEV(Value *V);
-
- /// createNodeForPHI - Provide the special handling we need to analyze PHI
- /// SCEVs.
- SCEVHandle createNodeForPHI(PHINode *PN);
-
- /// ReplaceSymbolicValueWithConcrete - This looks up the computed SCEV value
- /// for the specified instruction and replaces any references to the
- /// symbolic value SymName with the specified value. This is used during
- /// PHI resolution.
- void ReplaceSymbolicValueWithConcrete(Instruction *I,
- const SCEVHandle &SymName,
- const SCEVHandle &NewVal);
-
- /// ComputeIterationCount - Compute the number of times the specified loop
- /// will iterate.
- SCEVHandle ComputeIterationCount(const Loop *L);
-
- /// ComputeLoadConstantCompareIterationCount - Given an exit condition of
- /// 'icmp op load X, cst', try to see if we can compute the trip count.
- SCEVHandle ComputeLoadConstantCompareIterationCount(LoadInst *LI,
- Constant *RHS,
- const Loop *L,
- ICmpInst::Predicate p);
-
- /// ComputeIterationCountExhaustively - If the trip is known to execute a
- /// constant number of times (the condition evolves only from constants),
- /// try to evaluate a few iterations of the loop until we get the exit
- /// condition gets a value of ExitWhen (true or false). If we cannot
- /// evaluate the trip count of the loop, return UnknownValue.
- SCEVHandle ComputeIterationCountExhaustively(const Loop *L, Value *Cond,
- bool ExitWhen);
-
- /// HowFarToZero - Return the number of times a backedge comparing the
- /// specified value to zero will execute. If not computable, return
- /// UnknownValue.
- SCEVHandle HowFarToZero(SCEV *V, const Loop *L);
-
- /// HowFarToNonZero - Return the number of times a backedge checking the
- /// specified value for nonzero will execute. If not computable, return
- /// UnknownValue.
- SCEVHandle HowFarToNonZero(SCEV *V, const Loop *L);
-
- /// HowManyLessThans - Return the number of times a backedge containing the
- /// specified less-than comparison will execute. If not computable, return
- /// UnknownValue. isSigned specifies whether the less-than is signed.
- SCEVHandle HowManyLessThans(SCEV *LHS, SCEV *RHS, const Loop *L,
- bool isSigned);
-
- /// getConstantEvolutionLoopExitValue - If we know that the specified Phi is
- /// in the header of its containing loop, we know the loop executes a
- /// constant number of times, and the PHI node is just a recurrence
- /// involving constants, fold it.
- Constant *getConstantEvolutionLoopExitValue(PHINode *PN, const APInt& Its,
- const Loop *L);
- };
-}
-
-//===----------------------------------------------------------------------===//
-// Basic SCEV Analysis and PHI Idiom Recognition Code
-//
-
-/// deleteValueFromRecords - This method should be called by the
-/// client before it removes an instruction from the program, to make sure
-/// that no dangling references are left around.
-void ScalarEvolutionsImpl::deleteValueFromRecords(Value *V) {
- SmallVector<Value *, 16> Worklist;
-
- if (Scalars.erase(V)) {
- if (PHINode *PN = dyn_cast<PHINode>(V))
- ConstantEvolutionLoopExitValue.erase(PN);
- Worklist.push_back(V);
- }
-
- while (!Worklist.empty()) {
- Value *VV = Worklist.back();
- Worklist.pop_back();
-
- for (Instruction::use_iterator UI = VV->use_begin(), UE = VV->use_end();
- UI != UE; ++UI) {
- Instruction *Inst = cast<Instruction>(*UI);
- if (Scalars.erase(Inst)) {
- if (PHINode *PN = dyn_cast<PHINode>(VV))
- ConstantEvolutionLoopExitValue.erase(PN);
- Worklist.push_back(Inst);
- }
- }
- }
-}
-
-
-/// getSCEV - Return an existing SCEV if it exists, otherwise analyze the
-/// expression and create a new one.
-SCEVHandle ScalarEvolutionsImpl::getSCEV(Value *V) {
- assert(V->getType() != Type::VoidTy && "Can't analyze void expressions!");
-
- std::map<Value*, SCEVHandle>::iterator I = Scalars.find(V);
- if (I != Scalars.end()) return I->second;
- SCEVHandle S = createSCEV(V);
- Scalars.insert(std::make_pair(V, S));
- return S;
-}
-
-/// ReplaceSymbolicValueWithConcrete - This looks up the computed SCEV value for
-/// the specified instruction and replaces any references to the symbolic value
-/// SymName with the specified value. This is used during PHI resolution.
-void ScalarEvolutionsImpl::
-ReplaceSymbolicValueWithConcrete(Instruction *I, const SCEVHandle &SymName,
- const SCEVHandle &NewVal) {
- std::map<Value*, SCEVHandle>::iterator SI = Scalars.find(I);
- if (SI == Scalars.end()) return;
-
- SCEVHandle NV =
- SI->second->replaceSymbolicValuesWithConcrete(SymName, NewVal, SE);
- if (NV == SI->second) return; // No change.
-
- SI->second = NV; // Update the scalars map!
-
- // Any instruction values that use this instruction might also need to be
- // updated!
- for (Value::use_iterator UI = I->use_begin(), E = I->use_end();
- UI != E; ++UI)
- ReplaceSymbolicValueWithConcrete(cast<Instruction>(*UI), SymName, NewVal);
-}
-
-/// createNodeForPHI - PHI nodes have two cases. Either the PHI node exists in
-/// a loop header, making it a potential recurrence, or it doesn't.
-///
-SCEVHandle ScalarEvolutionsImpl::createNodeForPHI(PHINode *PN) {
- if (PN->getNumIncomingValues() == 2) // The loops have been canonicalized.
- if (const Loop *L = LI.getLoopFor(PN->getParent()))
- if (L->getHeader() == PN->getParent()) {
- // If it lives in the loop header, it has two incoming values, one
- // from outside the loop, and one from inside.
- unsigned IncomingEdge = L->contains(PN->getIncomingBlock(0));
- unsigned BackEdge = IncomingEdge^1;
-
- // While we are analyzing this PHI node, handle its value symbolically.
- SCEVHandle SymbolicName = SE.getUnknown(PN);
- assert(Scalars.find(PN) == Scalars.end() &&
- "PHI node already processed?");
- Scalars.insert(std::make_pair(PN, SymbolicName));
-
- // Using this symbolic name for the PHI, analyze the value coming around
- // the back-edge.
- SCEVHandle BEValue = getSCEV(PN->getIncomingValue(BackEdge));
-
- // NOTE: If BEValue is loop invariant, we know that the PHI node just
- // has a special value for the first iteration of the loop.
-
- // If the value coming around the backedge is an add with the symbolic
- // value we just inserted, then we found a simple induction variable!
- if (SCEVAddExpr *Add = dyn_cast<SCEVAddExpr>(BEValue)) {
- // If there is a single occurrence of the symbolic value, replace it
- // with a recurrence.
- unsigned FoundIndex = Add->getNumOperands();
- for (unsigned i = 0, e = Add->getNumOperands(); i != e; ++i)
- if (Add->getOperand(i) == SymbolicName)
- if (FoundIndex == e) {
- FoundIndex = i;
- break;
- }
-
- if (FoundIndex != Add->getNumOperands()) {
- // Create an add with everything but the specified operand.
- std::vector<SCEVHandle> Ops;
- for (unsigned i = 0, e = Add->getNumOperands(); i != e; ++i)
- if (i != FoundIndex)
- Ops.push_back(Add->getOperand(i));
- SCEVHandle Accum = SE.getAddExpr(Ops);
-
- // This is not a valid addrec if the step amount is varying each
- // loop iteration, but is not itself an addrec in this loop.
- if (Accum->isLoopInvariant(L) ||
- (isa<SCEVAddRecExpr>(Accum) &&
- cast<SCEVAddRecExpr>(Accum)->getLoop() == L)) {
- SCEVHandle StartVal = getSCEV(PN->getIncomingValue(IncomingEdge));
- SCEVHandle PHISCEV = SE.getAddRecExpr(StartVal, Accum, L);
-
- // Okay, for the entire analysis of this edge we assumed the PHI
- // to be symbolic. We now need to go back and update all of the
- // entries for the scalars that use the PHI (except for the PHI
- // itself) to use the new analyzed value instead of the "symbolic"
- // value.
- ReplaceSymbolicValueWithConcrete(PN, SymbolicName, PHISCEV);
- return PHISCEV;
- }
- }
- } else if (SCEVAddRecExpr *AddRec = dyn_cast<SCEVAddRecExpr>(BEValue)) {
- // Otherwise, this could be a loop like this:
- // i = 0; for (j = 1; ..; ++j) { .... i = j; }
- // In this case, j = {1,+,1} and BEValue is j.
- // Because the other in-value of i (0) fits the evolution of BEValue
- // i really is an addrec evolution.
- if (AddRec->getLoop() == L && AddRec->isAffine()) {
- SCEVHandle StartVal = getSCEV(PN->getIncomingValue(IncomingEdge));
-
- // If StartVal = j.start - j.stride, we can use StartVal as the
- // initial step of the addrec evolution.
- if (StartVal == SE.getMinusSCEV(AddRec->getOperand(0),
- AddRec->getOperand(1))) {
- SCEVHandle PHISCEV =
- SE.getAddRecExpr(StartVal, AddRec->getOperand(1), L);
-
- // Okay, for the entire analysis of this edge we assumed the PHI
- // to be symbolic. We now need to go back and update all of the
- // entries for the scalars that use the PHI (except for the PHI
- // itself) to use the new analyzed value instead of the "symbolic"
- // value.
- ReplaceSymbolicValueWithConcrete(PN, SymbolicName, PHISCEV);
- return PHISCEV;
- }
- }
- }
-
- return SymbolicName;
- }
-
- // If it's not a loop phi, we can't handle it yet.
- return SE.getUnknown(PN);
-}
-
-/// GetMinTrailingZeros - Determine the minimum number of zero bits that S is
-/// guaranteed to end in (at every loop iteration). It is, at the same time,
-/// the minimum number of times S is divisible by 2. For example, given {4,+,8}
-/// it returns 2. If S is guaranteed to be 0, it returns the bitwidth of S.
-static uint32_t GetMinTrailingZeros(SCEVHandle S) {
- if (SCEVConstant *C = dyn_cast<SCEVConstant>(S))
- return C->getValue()->getValue().countTrailingZeros();
-
- if (SCEVTruncateExpr *T = dyn_cast<SCEVTruncateExpr>(S))
- return std::min(GetMinTrailingZeros(T->getOperand()), T->getBitWidth());
-
- if (SCEVZeroExtendExpr *E = dyn_cast<SCEVZeroExtendExpr>(S)) {
- uint32_t OpRes = GetMinTrailingZeros(E->getOperand());
- return OpRes == E->getOperand()->getBitWidth() ? E->getBitWidth() : OpRes;
- }
-
- if (SCEVSignExtendExpr *E = dyn_cast<SCEVSignExtendExpr>(S)) {
- uint32_t OpRes = GetMinTrailingZeros(E->getOperand());
- return OpRes == E->getOperand()->getBitWidth() ? E->getBitWidth() : OpRes;
- }
-
- if (SCEVAddExpr *A = dyn_cast<SCEVAddExpr>(S)) {
- // The result is the min of all operands results.
- uint32_t MinOpRes = GetMinTrailingZeros(A->getOperand(0));
- for (unsigned i = 1, e = A->getNumOperands(); MinOpRes && i != e; ++i)
- MinOpRes = std::min(MinOpRes, GetMinTrailingZeros(A->getOperand(i)));
- return MinOpRes;
- }
-
- if (SCEVMulExpr *M = dyn_cast<SCEVMulExpr>(S)) {
- // The result is the sum of all operands results.
- uint32_t SumOpRes = GetMinTrailingZeros(M->getOperand(0));
- uint32_t BitWidth = M->getBitWidth();
- for (unsigned i = 1, e = M->getNumOperands();
- SumOpRes != BitWidth && i != e; ++i)
- SumOpRes = std::min(SumOpRes + GetMinTrailingZeros(M->getOperand(i)),
- BitWidth);
- return SumOpRes;
- }
-
- if (SCEVAddRecExpr *A = dyn_cast<SCEVAddRecExpr>(S)) {
- // The result is the min of all operands results.
- uint32_t MinOpRes = GetMinTrailingZeros(A->getOperand(0));
- for (unsigned i = 1, e = A->getNumOperands(); MinOpRes && i != e; ++i)
- MinOpRes = std::min(MinOpRes, GetMinTrailingZeros(A->getOperand(i)));
- return MinOpRes;
- }
-
- if (SCEVSMaxExpr *M = dyn_cast<SCEVSMaxExpr>(S)) {
- // The result is the min of all operands results.
- uint32_t MinOpRes = GetMinTrailingZeros(M->getOperand(0));
- for (unsigned i = 1, e = M->getNumOperands(); MinOpRes && i != e; ++i)
- MinOpRes = std::min(MinOpRes, GetMinTrailingZeros(M->getOperand(i)));
- return MinOpRes;
- }
-
- if (SCEVUMaxExpr *M = dyn_cast<SCEVUMaxExpr>(S)) {
- // The result is the min of all operands results.
- uint32_t MinOpRes = GetMinTrailingZeros(M->getOperand(0));
- for (unsigned i = 1, e = M->getNumOperands(); MinOpRes && i != e; ++i)
- MinOpRes = std::min(MinOpRes, GetMinTrailingZeros(M->getOperand(i)));
- return MinOpRes;
- }
-
- // SCEVUDivExpr, SCEVUnknown
- return 0;
-}
-
-/// createSCEV - We know that there is no SCEV for the specified value.
-/// Analyze the expression.
-///
-SCEVHandle ScalarEvolutionsImpl::createSCEV(Value *V) {
- if (!isa<IntegerType>(V->getType()))
- return SE.getUnknown(V);
-
- if (Instruction *I = dyn_cast<Instruction>(V)) {
- switch (I->getOpcode()) {
- case Instruction::Add:
- return SE.getAddExpr(getSCEV(I->getOperand(0)),
- getSCEV(I->getOperand(1)));
- case Instruction::Mul:
- return SE.getMulExpr(getSCEV(I->getOperand(0)),
- getSCEV(I->getOperand(1)));
- case Instruction::UDiv:
- return SE.getUDivExpr(getSCEV(I->getOperand(0)),
- getSCEV(I->getOperand(1)));
- case Instruction::Sub:
- return SE.getMinusSCEV(getSCEV(I->getOperand(0)),
- getSCEV(I->getOperand(1)));
- case Instruction::Or:
- // If the RHS of the Or is a constant, we may have something like:
- // X*4+1 which got turned into X*4|1. Handle this as an Add so loop
- // optimizations will transparently handle this case.
- //
- // In order for this transformation to be safe, the LHS must be of the
- // form X*(2^n) and the Or constant must be less than 2^n.
- if (ConstantInt *CI = dyn_cast<ConstantInt>(I->getOperand(1))) {
- SCEVHandle LHS = getSCEV(I->getOperand(0));
- const APInt &CIVal = CI->getValue();
- if (GetMinTrailingZeros(LHS) >=
- (CIVal.getBitWidth() - CIVal.countLeadingZeros()))
- return SE.getAddExpr(LHS, getSCEV(I->getOperand(1)));
- }
- break;
- case Instruction::Xor:
- // If the RHS of the xor is a signbit, then this is just an add.
- // Instcombine turns add of signbit into xor as a strength reduction step.
- if (ConstantInt *CI = dyn_cast<ConstantInt>(I->getOperand(1))) {
- if (CI->getValue().isSignBit())
- return SE.getAddExpr(getSCEV(I->getOperand(0)),
- getSCEV(I->getOperand(1)));
- else if (CI->isAllOnesValue())
- return SE.getNotSCEV(getSCEV(I->getOperand(0)));
- }
- break;
-
- case Instruction::Shl:
- // Turn shift left of a constant amount into a multiply.
- if (ConstantInt *SA = dyn_cast<ConstantInt>(I->getOperand(1))) {
- uint32_t BitWidth = cast<IntegerType>(V->getType())->getBitWidth();
- Constant *X = ConstantInt::get(
- APInt(BitWidth, 1).shl(SA->getLimitedValue(BitWidth)));
- return SE.getMulExpr(getSCEV(I->getOperand(0)), getSCEV(X));
- }
- break;
-
- case Instruction::Trunc:
- return SE.getTruncateExpr(getSCEV(I->getOperand(0)), I->getType());
-
- case Instruction::ZExt:
- return SE.getZeroExtendExpr(getSCEV(I->getOperand(0)), I->getType());
-
- case Instruction::SExt:
- return SE.getSignExtendExpr(getSCEV(I->getOperand(0)), I->getType());
-
- case Instruction::BitCast:
- // BitCasts are no-op casts so we just eliminate the cast.
- if (I->getType()->isInteger() &&
- I->getOperand(0)->getType()->isInteger())
- return getSCEV(I->getOperand(0));
- break;
-
- case Instruction::PHI:
- return createNodeForPHI(cast<PHINode>(I));
-
- case Instruction::Select:
- // This could be a smax or umax that was lowered earlier.
- // Try to recover it.
- if (ICmpInst *ICI = dyn_cast<ICmpInst>(I->getOperand(0))) {
- Value *LHS = ICI->getOperand(0);
- Value *RHS = ICI->getOperand(1);
- switch (ICI->getPredicate()) {
- case ICmpInst::ICMP_SLT:
- case ICmpInst::ICMP_SLE:
- std::swap(LHS, RHS);
- // fall through
- case ICmpInst::ICMP_SGT:
- case ICmpInst::ICMP_SGE:
- if (LHS == I->getOperand(1) && RHS == I->getOperand(2))
- return SE.getSMaxExpr(getSCEV(LHS), getSCEV(RHS));
- else if (LHS == I->getOperand(2) && RHS == I->getOperand(1))
- // -smax(-x, -y) == smin(x, y).
- return SE.getNegativeSCEV(SE.getSMaxExpr(
- SE.getNegativeSCEV(getSCEV(LHS)),
- SE.getNegativeSCEV(getSCEV(RHS))));
- break;
- case ICmpInst::ICMP_ULT:
- case ICmpInst::ICMP_ULE:
- std::swap(LHS, RHS);
- // fall through
- case ICmpInst::ICMP_UGT:
- case ICmpInst::ICMP_UGE:
- if (LHS == I->getOperand(1) && RHS == I->getOperand(2))
- return SE.getUMaxExpr(getSCEV(LHS), getSCEV(RHS));
- else if (LHS == I->getOperand(2) && RHS == I->getOperand(1))
- // ~umax(~x, ~y) == umin(x, y)
- return SE.getNotSCEV(SE.getUMaxExpr(SE.getNotSCEV(getSCEV(LHS)),
- SE.getNotSCEV(getSCEV(RHS))));
- break;
- default:
- break;
- }
- }
-
- default: // We cannot analyze this expression.
- break;
- }
- }
-
- return SE.getUnknown(V);
-}
-
-
-
-//===----------------------------------------------------------------------===//
-// Iteration Count Computation Code
-//
-
-/// getIterationCount - If the specified loop has a predictable iteration
-/// count, return it. Note that it is not valid to call this method on a
-/// loop without a loop-invariant iteration count.
-SCEVHandle ScalarEvolutionsImpl::getIterationCount(const Loop *L) {
- std::map<const Loop*, SCEVHandle>::iterator I = IterationCounts.find(L);
- if (I == IterationCounts.end()) {
- SCEVHandle ItCount = ComputeIterationCount(L);
- I = IterationCounts.insert(std::make_pair(L, ItCount)).first;
- if (ItCount != UnknownValue) {
- assert(ItCount->isLoopInvariant(L) &&
- "Computed trip count isn't loop invariant for loop!");
- ++NumTripCountsComputed;
- } else if (isa<PHINode>(L->getHeader()->begin())) {
- // Only count loops that have phi nodes as not being computable.
- ++NumTripCountsNotComputed;
- }
- }
- return I->second;
-}
-
-/// ComputeIterationCount - Compute the number of times the specified loop
-/// will iterate.
-SCEVHandle ScalarEvolutionsImpl::ComputeIterationCount(const Loop *L) {
- // If the loop has a non-one exit block count, we can't analyze it.
- SmallVector<BasicBlock*, 8> ExitBlocks;
- L->getExitBlocks(ExitBlocks);
- if (ExitBlocks.size() != 1) return UnknownValue;
-
- // Okay, there is one exit block. Try to find the condition that causes the
- // loop to be exited.
- BasicBlock *ExitBlock = ExitBlocks[0];
-
- BasicBlock *ExitingBlock = 0;
- for (pred_iterator PI = pred_begin(ExitBlock), E = pred_end(ExitBlock);
- PI != E; ++PI)
- if (L->contains(*PI)) {
- if (ExitingBlock == 0)
- ExitingBlock = *PI;
- else
- return UnknownValue; // More than one block exiting!
- }
- assert(ExitingBlock && "No exits from loop, something is broken!");
-
- // Okay, we've computed the exiting block. See what condition causes us to
- // exit.
- //
- // FIXME: we should be able to handle switch instructions (with a single exit)
- BranchInst *ExitBr = dyn_cast<BranchInst>(ExitingBlock->getTerminator());
- if (ExitBr == 0) return UnknownValue;
- assert(ExitBr->isConditional() && "If unconditional, it can't be in loop!");
-
- // At this point, we know we have a conditional branch that determines whether
- // the loop is exited. However, we don't know if the branch is executed each
- // time through the loop. If not, then the execution count of the branch will
- // not be equal to the trip count of the loop.
- //
- // Currently we check for this by checking to see if the Exit branch goes to
- // the loop header. If so, we know it will always execute the same number of
- // times as the loop. We also handle the case where the exit block *is* the
- // loop header. This is common for un-rotated loops. More extensive analysis
- // could be done to handle more cases here.
- if (ExitBr->getSuccessor(0) != L->getHeader() &&
- ExitBr->getSuccessor(1) != L->getHeader() &&
- ExitBr->getParent() != L->getHeader())
- return UnknownValue;
-
- ICmpInst *ExitCond = dyn_cast<ICmpInst>(ExitBr->getCondition());
-
- // If it's not an integer comparison then compute it the hard way.
- // Note that ICmpInst deals with pointer comparisons too so we must check
- // the type of the operand.
- if (ExitCond == 0 || isa<PointerType>(ExitCond->getOperand(0)->getType()))
- return ComputeIterationCountExhaustively(L, ExitBr->getCondition(),
- ExitBr->getSuccessor(0) == ExitBlock);
-
- // If the condition was exit on true, convert the condition to exit on false
- ICmpInst::Predicate Cond;
- if (ExitBr->getSuccessor(1) == ExitBlock)
- Cond = ExitCond->getPredicate();
- else
- Cond = ExitCond->getInversePredicate();
-
- // Handle common loops like: for (X = "string"; *X; ++X)
- if (LoadInst *LI = dyn_cast<LoadInst>(ExitCond->getOperand(0)))
- if (Constant *RHS = dyn_cast<Constant>(ExitCond->getOperand(1))) {
- SCEVHandle ItCnt =
- ComputeLoadConstantCompareIterationCount(LI, RHS, L, Cond);
- if (!isa<SCEVCouldNotCompute>(ItCnt)) return ItCnt;
- }
-
- SCEVHandle LHS = getSCEV(ExitCond->getOperand(0));
- SCEVHandle RHS = getSCEV(ExitCond->getOperand(1));
-
- // Try to evaluate any dependencies out of the loop.
- SCEVHandle Tmp = getSCEVAtScope(LHS, L);
- if (!isa<SCEVCouldNotCompute>(Tmp)) LHS = Tmp;
- Tmp = getSCEVAtScope(RHS, L);
- if (!isa<SCEVCouldNotCompute>(Tmp)) RHS = Tmp;
-
- // At this point, we would like to compute how many iterations of the
- // loop the predicate will return true for these inputs.
- if (isa<SCEVConstant>(LHS) && !isa<SCEVConstant>(RHS)) {
- // If there is a constant, force it into the RHS.
- std::swap(LHS, RHS);
- Cond = ICmpInst::getSwappedPredicate(Cond);
- }
-
- // FIXME: think about handling pointer comparisons! i.e.:
- // while (P != P+100) ++P;
-
- // If we have a comparison of a chrec against a constant, try to use value
- // ranges to answer this query.
- if (SCEVConstant *RHSC = dyn_cast<SCEVConstant>(RHS))
- if (SCEVAddRecExpr *AddRec = dyn_cast<SCEVAddRecExpr>(LHS))
- if (AddRec->getLoop() == L) {
- // Form the comparison range using the constant of the correct type so
- // that the ConstantRange class knows to do a signed or unsigned
- // comparison.
- ConstantInt *CompVal = RHSC->getValue();
- const Type *RealTy = ExitCond->getOperand(0)->getType();
- CompVal = dyn_cast<ConstantInt>(
- ConstantExpr::getBitCast(CompVal, RealTy));
- if (CompVal) {
- // Form the constant range.
- ConstantRange CompRange(
- ICmpInst::makeConstantRange(Cond, CompVal->getValue()));
-
- SCEVHandle Ret = AddRec->getNumIterationsInRange(CompRange, SE);
- if (!isa<SCEVCouldNotCompute>(Ret)) return Ret;
- }
- }
-
- switch (Cond) {
- case ICmpInst::ICMP_NE: { // while (X != Y)
- // Convert to: while (X-Y != 0)
- SCEVHandle TC = HowFarToZero(SE.getMinusSCEV(LHS, RHS), L);
- if (!isa<SCEVCouldNotCompute>(TC)) return TC;
- break;
- }
- case ICmpInst::ICMP_EQ: {
- // Convert to: while (X-Y == 0) // while (X == Y)
- SCEVHandle TC = HowFarToNonZero(SE.getMinusSCEV(LHS, RHS), L);
- if (!isa<SCEVCouldNotCompute>(TC)) return TC;
- break;
- }
- case ICmpInst::ICMP_SLT: {
- SCEVHandle TC = HowManyLessThans(LHS, RHS, L, true);
- if (!isa<SCEVCouldNotCompute>(TC)) return TC;
- break;
- }
- case ICmpInst::ICMP_SGT: {
- SCEVHandle TC = HowManyLessThans(SE.getNegativeSCEV(LHS),
- SE.getNegativeSCEV(RHS), L, true);
- if (!isa<SCEVCouldNotCompute>(TC)) return TC;
- break;
- }
- case ICmpInst::ICMP_ULT: {
- SCEVHandle TC = HowManyLessThans(LHS, RHS, L, false);
- if (!isa<SCEVCouldNotCompute>(TC)) return TC;
- break;
- }
- case ICmpInst::ICMP_UGT: {
- SCEVHandle TC = HowManyLessThans(SE.getNotSCEV(LHS),
- SE.getNotSCEV(RHS), L, false);
- if (!isa<SCEVCouldNotCompute>(TC)) return TC;
- break;
- }
- default:
-#if 0
- cerr << "ComputeIterationCount ";
- if (ExitCond->getOperand(0)->getType()->isUnsigned())
- cerr << "[unsigned] ";
- cerr << *LHS << " "
- << Instruction::getOpcodeName(Instruction::ICmp)
- << " " << *RHS << "\n";
-#endif
- break;
- }
- return ComputeIterationCountExhaustively(L, ExitCond,
- ExitBr->getSuccessor(0) == ExitBlock);
-}
-
-static ConstantInt *
-EvaluateConstantChrecAtConstant(const SCEVAddRecExpr *AddRec, ConstantInt *C,
- ScalarEvolution &SE) {
- SCEVHandle InVal = SE.getConstant(C);
- SCEVHandle Val = AddRec->evaluateAtIteration(InVal, SE);
- assert(isa<SCEVConstant>(Val) &&
- "Evaluation of SCEV at constant didn't fold correctly?");
- return cast<SCEVConstant>(Val)->getValue();
-}
-
-/// GetAddressedElementFromGlobal - Given a global variable with an initializer
-/// and a GEP expression (missing the pointer index) indexing into it, return
-/// the addressed element of the initializer or null if the index expression is
-/// invalid.
-static Constant *
-GetAddressedElementFromGlobal(GlobalVariable *GV,
- const std::vector<ConstantInt*> &Indices) {
- Constant *Init = GV->getInitializer();
- for (unsigned i = 0, e = Indices.size(); i != e; ++i) {
- uint64_t Idx = Indices[i]->getZExtValue();
- if (ConstantStruct *CS = dyn_cast<ConstantStruct>(Init)) {
- assert(Idx < CS->getNumOperands() && "Bad struct index!");
- Init = cast<Constant>(CS->getOperand(Idx));
- } else if (ConstantArray *CA = dyn_cast<ConstantArray>(Init)) {
- if (Idx >= CA->getNumOperands()) return 0; // Bogus program
- Init = cast<Constant>(CA->getOperand(Idx));
- } else if (isa<ConstantAggregateZero>(Init)) {
- if (const StructType *STy = dyn_cast<StructType>(Init->getType())) {
- assert(Idx < STy->getNumElements() && "Bad struct index!");
- Init = Constant::getNullValue(STy->getElementType(Idx));
- } else if (const ArrayType *ATy = dyn_cast<ArrayType>(Init->getType())) {
- if (Idx >= ATy->getNumElements()) return 0; // Bogus program
- Init = Constant::getNullValue(ATy->getElementType());
- } else {
- assert(0 && "Unknown constant aggregate type!");
- }
- return 0;
- } else {
- return 0; // Unknown initializer type
- }
- }
- return Init;
-}
-
-/// ComputeLoadConstantCompareIterationCount - Given an exit condition of
-/// 'icmp op load X, cst', try to see if we can compute the trip count.
-SCEVHandle ScalarEvolutionsImpl::
-ComputeLoadConstantCompareIterationCount(LoadInst *LI, Constant *RHS,
- const Loop *L,
- ICmpInst::Predicate predicate) {
- if (LI->isVolatile()) return UnknownValue;
-
- // Check to see if the loaded pointer is a getelementptr of a global.
- GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(LI->getOperand(0));
- if (!GEP) return UnknownValue;
-
- // Make sure that it is really a constant global we are gepping, with an
- // initializer, and make sure the first IDX is really 0.
- GlobalVariable *GV = dyn_cast<GlobalVariable>(GEP->getOperand(0));
- if (!GV || !GV->isConstant() || !GV->hasInitializer() ||
- GEP->getNumOperands() < 3 || !isa<Constant>(GEP->getOperand(1)) ||
- !cast<Constant>(GEP->getOperand(1))->isNullValue())
- return UnknownValue;
-
- // Okay, we allow one non-constant index into the GEP instruction.
- Value *VarIdx = 0;
- std::vector<ConstantInt*> Indexes;
- unsigned VarIdxNum = 0;
- for (unsigned i = 2, e = GEP->getNumOperands(); i != e; ++i)
- if (ConstantInt *CI = dyn_cast<ConstantInt>(GEP->getOperand(i))) {
- Indexes.push_back(CI);
- } else if (!isa<ConstantInt>(GEP->getOperand(i))) {
- if (VarIdx) return UnknownValue; // Multiple non-constant idx's.
- VarIdx = GEP->getOperand(i);
- VarIdxNum = i-2;
- Indexes.push_back(0);
- }
-
- // Okay, we know we have a (load (gep GV, 0, X)) comparison with a constant.
- // Check to see if X is a loop variant variable value now.
- SCEVHandle Idx = getSCEV(VarIdx);
- SCEVHandle Tmp = getSCEVAtScope(Idx, L);
- if (!isa<SCEVCouldNotCompute>(Tmp)) Idx = Tmp;
-
- // We can only recognize very limited forms of loop index expressions, in
- // particular, only affine AddRec's like {C1,+,C2}.
- SCEVAddRecExpr *IdxExpr = dyn_cast<SCEVAddRecExpr>(Idx);
- if (!IdxExpr || !IdxExpr->isAffine() || IdxExpr->isLoopInvariant(L) ||
- !isa<SCEVConstant>(IdxExpr->getOperand(0)) ||
- !isa<SCEVConstant>(IdxExpr->getOperand(1)))
- return UnknownValue;
-
- unsigned MaxSteps = MaxBruteForceIterations;
- for (unsigned IterationNum = 0; IterationNum != MaxSteps; ++IterationNum) {
- ConstantInt *ItCst =
- ConstantInt::get(IdxExpr->getType(), IterationNum);
- ConstantInt *Val = EvaluateConstantChrecAtConstant(IdxExpr, ItCst, SE);
-
- // Form the GEP offset.
- Indexes[VarIdxNum] = Val;
-
- Constant *Result = GetAddressedElementFromGlobal(GV, Indexes);
- if (Result == 0) break; // Cannot compute!
-
- // Evaluate the condition for this iteration.
- Result = ConstantExpr::getICmp(predicate, Result, RHS);
- if (!isa<ConstantInt>(Result)) break; // Couldn't decide for sure
- if (cast<ConstantInt>(Result)->getValue().isMinValue()) {
-#if 0
- cerr << "\n***\n*** Computed loop count " << *ItCst
- << "\n*** From global " << *GV << "*** BB: " << *L->getHeader()
- << "***\n";
-#endif
- ++NumArrayLenItCounts;
- return SE.getConstant(ItCst); // Found terminating iteration!
- }
- }
- return UnknownValue;
-}
-
-
-/// CanConstantFold - Return true if we can constant fold an instruction of the
-/// specified type, assuming that all operands were constants.
-static bool CanConstantFold(const Instruction *I) {
- if (isa<BinaryOperator>(I) || isa<CmpInst>(I) ||
- isa<SelectInst>(I) || isa<CastInst>(I) || isa<GetElementPtrInst>(I))
- return true;
-
- if (const CallInst *CI = dyn_cast<CallInst>(I))
- if (const Function *F = CI->getCalledFunction())
- return canConstantFoldCallTo(F);
- return false;
-}
-
-/// getConstantEvolvingPHI - Given an LLVM value and a loop, return a PHI node
-/// in the loop that V is derived from. We allow arbitrary operations along the
-/// way, but the operands of an operation must either be constants or a value
-/// derived from a constant PHI. If this expression does not fit with these
-/// constraints, return null.
-static PHINode *getConstantEvolvingPHI(Value *V, const Loop *L) {
- // If this is not an instruction, or if this is an instruction outside of the
- // loop, it can't be derived from a loop PHI.
- Instruction *I = dyn_cast<Instruction>(V);
- if (I == 0 || !L->contains(I->getParent())) return 0;
-
- if (PHINode *PN = dyn_cast<PHINode>(I)) {
- if (L->getHeader() == I->getParent())
- return PN;
- else
- // We don't currently keep track of the control flow needed to evaluate
- // PHIs, so we cannot handle PHIs inside of loops.
- return 0;
- }
-
- // If we won't be able to constant fold this expression even if the operands
- // are constants, return early.
- if (!CanConstantFold(I)) return 0;
-
- // Otherwise, we can evaluate this instruction if all of its operands are
- // constant or derived from a PHI node themselves.
- PHINode *PHI = 0;
- for (unsigned Op = 0, e = I->getNumOperands(); Op != e; ++Op)
- if (!(isa<Constant>(I->getOperand(Op)) ||
- isa<GlobalValue>(I->getOperand(Op)))) {
- PHINode *P = getConstantEvolvingPHI(I->getOperand(Op), L);
- if (P == 0) return 0; // Not evolving from PHI
- if (PHI == 0)
- PHI = P;
- else if (PHI != P)
- return 0; // Evolving from multiple different PHIs.
- }
-
- // This is a expression evolving from a constant PHI!
- return PHI;
-}
-
-/// EvaluateExpression - Given an expression that passes the
-/// getConstantEvolvingPHI predicate, evaluate its value assuming the PHI node
-/// in the loop has the value PHIVal. If we can't fold this expression for some
-/// reason, return null.
-static Constant *EvaluateExpression(Value *V, Constant *PHIVal) {
- if (isa<PHINode>(V)) return PHIVal;
- if (Constant *C = dyn_cast<Constant>(V)) return C;
- Instruction *I = cast<Instruction>(V);
-
- std::vector<Constant*> Operands;
- Operands.resize(I->getNumOperands());
-
- for (unsigned i = 0, e = I->getNumOperands(); i != e; ++i) {
- Operands[i] = EvaluateExpression(I->getOperand(i), PHIVal);
- if (Operands[i] == 0) return 0;
- }
-
- if (const CmpInst *CI = dyn_cast<CmpInst>(I))
- return ConstantFoldCompareInstOperands(CI->getPredicate(),
- &Operands[0], Operands.size());
- else
- return ConstantFoldInstOperands(I->getOpcode(), I->getType(),
- &Operands[0], Operands.size());
-}
-
-/// getConstantEvolutionLoopExitValue - If we know that the specified Phi is
-/// in the header of its containing loop, we know the loop executes a
-/// constant number of times, and the PHI node is just a recurrence
-/// involving constants, fold it.
-Constant *ScalarEvolutionsImpl::
-getConstantEvolutionLoopExitValue(PHINode *PN, const APInt& Its, const Loop *L){
- std::map<PHINode*, Constant*>::iterator I =
- ConstantEvolutionLoopExitValue.find(PN);
- if (I != ConstantEvolutionLoopExitValue.end())
- return I->second;
-
- if (Its.ugt(APInt(Its.getBitWidth(),MaxBruteForceIterations)))
- return ConstantEvolutionLoopExitValue[PN] = 0; // Not going to evaluate it.
-
- Constant *&RetVal = ConstantEvolutionLoopExitValue[PN];
-
- // Since the loop is canonicalized, the PHI node must have two entries. One
- // entry must be a constant (coming in from outside of the loop), and the
- // second must be derived from the same PHI.
- bool SecondIsBackedge = L->contains(PN->getIncomingBlock(1));
- Constant *StartCST =
- dyn_cast<Constant>(PN->getIncomingValue(!SecondIsBackedge));
- if (StartCST == 0)
- return RetVal = 0; // Must be a constant.
-
- Value *BEValue = PN->getIncomingValue(SecondIsBackedge);
- PHINode *PN2 = getConstantEvolvingPHI(BEValue, L);
- if (PN2 != PN)
- return RetVal = 0; // Not derived from same PHI.
-
- // Execute the loop symbolically to determine the exit value.
- if (Its.getActiveBits() >= 32)
- return RetVal = 0; // More than 2^32-1 iterations?? Not doing it!
-
- unsigned NumIterations = Its.getZExtValue(); // must be in range
- unsigned IterationNum = 0;
- for (Constant *PHIVal = StartCST; ; ++IterationNum) {
- if (IterationNum == NumIterations)
- return RetVal = PHIVal; // Got exit value!
-
- // Compute the value of the PHI node for the next iteration.
- Constant *NextPHI = EvaluateExpression(BEValue, PHIVal);
- if (NextPHI == PHIVal)
- return RetVal = NextPHI; // Stopped evolving!
- if (NextPHI == 0)
- return 0; // Couldn't evaluate!
- PHIVal = NextPHI;
- }
-}
-
-/// ComputeIterationCountExhaustively - If the trip is known to execute a
-/// constant number of times (the condition evolves only from constants),
-/// try to evaluate a few iterations of the loop until we get the exit
-/// condition gets a value of ExitWhen (true or false). If we cannot
-/// evaluate the trip count of the loop, return UnknownValue.
-SCEVHandle ScalarEvolutionsImpl::
-ComputeIterationCountExhaustively(const Loop *L, Value *Cond, bool ExitWhen) {
- PHINode *PN = getConstantEvolvingPHI(Cond, L);
- if (PN == 0) return UnknownValue;
-
- // Since the loop is canonicalized, the PHI node must have two entries. One
- // entry must be a constant (coming in from outside of the loop), and the
- // second must be derived from the same PHI.
- bool SecondIsBackedge = L->contains(PN->getIncomingBlock(1));
- Constant *StartCST =
- dyn_cast<Constant>(PN->getIncomingValue(!SecondIsBackedge));
- if (StartCST == 0) return UnknownValue; // Must be a constant.
-
- Value *BEValue = PN->getIncomingValue(SecondIsBackedge);
- PHINode *PN2 = getConstantEvolvingPHI(BEValue, L);
- if (PN2 != PN) return UnknownValue; // Not derived from same PHI.
-
- // Okay, we find a PHI node that defines the trip count of this loop. Execute
- // the loop symbolically to determine when the condition gets a value of
- // "ExitWhen".
- unsigned IterationNum = 0;
- unsigned MaxIterations = MaxBruteForceIterations; // Limit analysis.
- for (Constant *PHIVal = StartCST;
- IterationNum != MaxIterations; ++IterationNum) {
- ConstantInt *CondVal =
- dyn_cast_or_null<ConstantInt>(EvaluateExpression(Cond, PHIVal));
-
- // Couldn't symbolically evaluate.
- if (!CondVal) return UnknownValue;
-
- if (CondVal->getValue() == uint64_t(ExitWhen)) {
- ConstantEvolutionLoopExitValue[PN] = PHIVal;
- ++NumBruteForceTripCountsComputed;
- return SE.getConstant(ConstantInt::get(Type::Int32Ty, IterationNum));
- }
-
- // Compute the value of the PHI node for the next iteration.
- Constant *NextPHI = EvaluateExpression(BEValue, PHIVal);
- if (NextPHI == 0 || NextPHI == PHIVal)
- return UnknownValue; // Couldn't evaluate or not making progress...
- PHIVal = NextPHI;
- }
-
- // Too many iterations were needed to evaluate.
- return UnknownValue;
-}
-
-/// getSCEVAtScope - Compute the value of the specified expression within the
-/// indicated loop (which may be null to indicate in no loop). If the
-/// expression cannot be evaluated, return UnknownValue.
-SCEVHandle ScalarEvolutionsImpl::getSCEVAtScope(SCEV *V, const Loop *L) {
- // FIXME: this should be turned into a virtual method on SCEV!
-
- if (isa<SCEVConstant>(V)) return V;
-
- // If this instruction is evolved from a constant-evolving PHI, compute the
- // exit value from the loop without using SCEVs.
- if (SCEVUnknown *SU = dyn_cast<SCEVUnknown>(V)) {
- if (Instruction *I = dyn_cast<Instruction>(SU->getValue())) {
- const Loop *LI = this->LI[I->getParent()];
- if (LI && LI->getParentLoop() == L) // Looking for loop exit value.
- if (PHINode *PN = dyn_cast<PHINode>(I))
- if (PN->getParent() == LI->getHeader()) {
- // Okay, there is no closed form solution for the PHI node. Check
- // to see if the loop that contains it has a known iteration count.
- // If so, we may be able to force computation of the exit value.
- SCEVHandle IterationCount = getIterationCount(LI);
- if (SCEVConstant *ICC = dyn_cast<SCEVConstant>(IterationCount)) {
- // Okay, we know how many times the containing loop executes. If
- // this is a constant evolving PHI node, get the final value at
- // the specified iteration number.
- Constant *RV = getConstantEvolutionLoopExitValue(PN,
- ICC->getValue()->getValue(),
- LI);
- if (RV) return SE.getUnknown(RV);
- }
- }
-
- // Okay, this is an expression that we cannot symbolically evaluate
- // into a SCEV. Check to see if it's possible to symbolically evaluate
- // the arguments into constants, and if so, try to constant propagate the
- // result. This is particularly useful for computing loop exit values.
- if (CanConstantFold(I)) {
- std::vector<Constant*> Operands;
- Operands.reserve(I->getNumOperands());
- for (unsigned i = 0, e = I->getNumOperands(); i != e; ++i) {
- Value *Op = I->getOperand(i);
- if (Constant *C = dyn_cast<Constant>(Op)) {
- Operands.push_back(C);
- } else {
- // If any of the operands is non-constant and if they are
- // non-integer, don't even try to analyze them with scev techniques.
- if (!isa<IntegerType>(Op->getType()))
- return V;
-
- SCEVHandle OpV = getSCEVAtScope(getSCEV(Op), L);
- if (SCEVConstant *SC = dyn_cast<SCEVConstant>(OpV))
- Operands.push_back(ConstantExpr::getIntegerCast(SC->getValue(),
- Op->getType(),
- false));
- else if (SCEVUnknown *SU = dyn_cast<SCEVUnknown>(OpV)) {
- if (Constant *C = dyn_cast<Constant>(SU->getValue()))
- Operands.push_back(ConstantExpr::getIntegerCast(C,
- Op->getType(),
- false));
- else
- return V;
- } else {
- return V;
- }
- }
- }
-
- Constant *C;
- if (const CmpInst *CI = dyn_cast<CmpInst>(I))
- C = ConstantFoldCompareInstOperands(CI->getPredicate(),
- &Operands[0], Operands.size());
- else
- C = ConstantFoldInstOperands(I->getOpcode(), I->getType(),
- &Operands[0], Operands.size());
- return SE.getUnknown(C);
- }
- }
-
- // This is some other type of SCEVUnknown, just return it.
- return V;
- }
-
- if (SCEVCommutativeExpr *Comm = dyn_cast<SCEVCommutativeExpr>(V)) {
- // Avoid performing the look-up in the common case where the specified
- // expression has no loop-variant portions.
- for (unsigned i = 0, e = Comm->getNumOperands(); i != e; ++i) {
- SCEVHandle OpAtScope = getSCEVAtScope(Comm->getOperand(i), L);
- if (OpAtScope != Comm->getOperand(i)) {
- if (OpAtScope == UnknownValue) return UnknownValue;
- // Okay, at least one of these operands is loop variant but might be
- // foldable. Build a new instance of the folded commutative expression.
- std::vector<SCEVHandle> NewOps(Comm->op_begin(), Comm->op_begin()+i);
- NewOps.push_back(OpAtScope);
-
- for (++i; i != e; ++i) {
- OpAtScope = getSCEVAtScope(Comm->getOperand(i), L);
- if (OpAtScope == UnknownValue) return UnknownValue;
- NewOps.push_back(OpAtScope);
- }
- if (isa<SCEVAddExpr>(Comm))
- return SE.getAddExpr(NewOps);
- if (isa<SCEVMulExpr>(Comm))
- return SE.getMulExpr(NewOps);
- if (isa<SCEVSMaxExpr>(Comm))
- return SE.getSMaxExpr(NewOps);
- if (isa<SCEVUMaxExpr>(Comm))
- return SE.getUMaxExpr(NewOps);
- assert(0 && "Unknown commutative SCEV type!");
- }
- }
- // If we got here, all operands are loop invariant.
- return Comm;
- }
-
- if (SCEVUDivExpr *Div = dyn_cast<SCEVUDivExpr>(V)) {
- SCEVHandle LHS = getSCEVAtScope(Div->getLHS(), L);
- if (LHS == UnknownValue) return LHS;
- SCEVHandle RHS = getSCEVAtScope(Div->getRHS(), L);
- if (RHS == UnknownValue) return RHS;
- if (LHS == Div->getLHS() && RHS == Div->getRHS())
- return Div; // must be loop invariant
- return SE.getUDivExpr(LHS, RHS);
- }
-
- // If this is a loop recurrence for a loop that does not contain L, then we
- // are dealing with the final value computed by the loop.
- if (SCEVAddRecExpr *AddRec = dyn_cast<SCEVAddRecExpr>(V)) {
- if (!L || !AddRec->getLoop()->contains(L->getHeader())) {
- // To evaluate this recurrence, we need to know how many times the AddRec
- // loop iterates. Compute this now.
- SCEVHandle IterationCount = getIterationCount(AddRec->getLoop());
- if (IterationCount == UnknownValue) return UnknownValue;
- IterationCount = getTruncateOrZeroExtend(IterationCount,
- AddRec->getType(), SE);
-
- // If the value is affine, simplify the expression evaluation to just
- // Start + Step*IterationCount.
- if (AddRec->isAffine())
- return SE.getAddExpr(AddRec->getStart(),
- SE.getMulExpr(IterationCount,
- AddRec->getOperand(1)));
-
- // Otherwise, evaluate it the hard way.
- return AddRec->evaluateAtIteration(IterationCount, SE);
- }
- return UnknownValue;
- }
-
- //assert(0 && "Unknown SCEV type!");
- return UnknownValue;
-}
-
-
-/// SolveQuadraticEquation - Find the roots of the quadratic equation for the
-/// given quadratic chrec {L,+,M,+,N}. This returns either the two roots (which
-/// might be the same) or two SCEVCouldNotCompute objects.
-///
-static std::pair<SCEVHandle,SCEVHandle>
-SolveQuadraticEquation(const SCEVAddRecExpr *AddRec, ScalarEvolution &SE) {
- assert(AddRec->getNumOperands() == 3 && "This is not a quadratic chrec!");
- SCEVConstant *LC = dyn_cast<SCEVConstant>(AddRec->getOperand(0));
- SCEVConstant *MC = dyn_cast<SCEVConstant>(AddRec->getOperand(1));
- SCEVConstant *NC = dyn_cast<SCEVConstant>(AddRec->getOperand(2));
-
- // We currently can only solve this if the coefficients are constants.
- if (!LC || !MC || !NC) {
- SCEV *CNC = new SCEVCouldNotCompute();
- return std::make_pair(CNC, CNC);
- }
-
- uint32_t BitWidth = LC->getValue()->getValue().getBitWidth();
- const APInt &L = LC->getValue()->getValue();
- const APInt &M = MC->getValue()->getValue();
- const APInt &N = NC->getValue()->getValue();
- APInt Two(BitWidth, 2);
- APInt Four(BitWidth, 4);
-
- {
- using namespace APIntOps;
- const APInt& C = L;
- // Convert from chrec coefficients to polynomial coefficients AX^2+BX+C
- // The B coefficient is M-N/2
- APInt B(M);
- B -= sdiv(N,Two);
-
- // The A coefficient is N/2
- APInt A(N.sdiv(Two));
-
- // Compute the B^2-4ac term.
- APInt SqrtTerm(B);
- SqrtTerm *= B;
- SqrtTerm -= Four * (A * C);
-
- // Compute sqrt(B^2-4ac). This is guaranteed to be the nearest
- // integer value or else APInt::sqrt() will assert.
- APInt SqrtVal(SqrtTerm.sqrt());
-
- // Compute the two solutions for the quadratic formula.
- // The divisions must be performed as signed divisions.
- APInt NegB(-B);
- APInt TwoA( A << 1 );
- ConstantInt *Solution1 = ConstantInt::get((NegB + SqrtVal).sdiv(TwoA));
- ConstantInt *Solution2 = ConstantInt::get((NegB - SqrtVal).sdiv(TwoA));
-
- return std::make_pair(SE.getConstant(Solution1),
- SE.getConstant(Solution2));
- } // end APIntOps namespace
-}
-
-/// HowFarToZero - Return the number of times a backedge comparing the specified
-/// value to zero will execute. If not computable, return UnknownValue
-SCEVHandle ScalarEvolutionsImpl::HowFarToZero(SCEV *V, const Loop *L) {
- // If the value is a constant
- if (SCEVConstant *C = dyn_cast<SCEVConstant>(V)) {
- // If the value is already zero, the branch will execute zero times.
- if (C->getValue()->isZero()) return C;
- return UnknownValue; // Otherwise it will loop infinitely.
- }
-
- SCEVAddRecExpr *AddRec = dyn_cast<SCEVAddRecExpr>(V);
- if (!AddRec || AddRec->getLoop() != L)
- return UnknownValue;
-
- if (AddRec->isAffine()) {
- // If this is an affine expression the execution count of this branch is
- // equal to:
- //
- // (0 - Start/Step) iff Start % Step == 0
- //
- // Get the initial value for the loop.
- SCEVHandle Start = getSCEVAtScope(AddRec->getStart(), L->getParentLoop());
- if (isa<SCEVCouldNotCompute>(Start)) return UnknownValue;
- SCEVHandle Step = AddRec->getOperand(1);
-
- Step = getSCEVAtScope(Step, L->getParentLoop());
-
- // Figure out if Start % Step == 0.
- // FIXME: We should add DivExpr and RemExpr operations to our AST.
- if (SCEVConstant *StepC = dyn_cast<SCEVConstant>(Step)) {
- if (StepC->getValue()->equalsInt(1)) // N % 1 == 0
- return SE.getNegativeSCEV(Start); // 0 - Start/1 == -Start
- if (StepC->getValue()->isAllOnesValue()) // N % -1 == 0
- return Start; // 0 - Start/-1 == Start
-
- // Check to see if Start is divisible by SC with no remainder.
- if (SCEVConstant *StartC = dyn_cast<SCEVConstant>(Start)) {
- ConstantInt *StartCC = StartC->getValue();
- Constant *StartNegC = ConstantExpr::getNeg(StartCC);
- Constant *Rem = ConstantExpr::getSRem(StartNegC, StepC->getValue());
- if (Rem->isNullValue()) {
- Constant *Result =ConstantExpr::getSDiv(StartNegC,StepC->getValue());
- return SE.getUnknown(Result);
- }
- }
- }
- } else if (AddRec->isQuadratic() && AddRec->getType()->isInteger()) {
- // If this is a quadratic (3-term) AddRec {L,+,M,+,N}, find the roots of
- // the quadratic equation to solve it.
- std::pair<SCEVHandle,SCEVHandle> Roots = SolveQuadraticEquation(AddRec, SE);
- SCEVConstant *R1 = dyn_cast<SCEVConstant>(Roots.first);
- SCEVConstant *R2 = dyn_cast<SCEVConstant>(Roots.second);
- if (R1) {
-#if 0
- cerr << "HFTZ: " << *V << " - sol#1: " << *R1
- << " sol#2: " << *R2 << "\n";
-#endif
- // Pick the smallest positive root value.
- if (ConstantInt *CB =
- dyn_cast<ConstantInt>(ConstantExpr::getICmp(ICmpInst::ICMP_ULT,
- R1->getValue(), R2->getValue()))) {
- if (CB->getZExtValue() == false)
- std::swap(R1, R2); // R1 is the minimum root now.
-
- // We can only use this value if the chrec ends up with an exact zero
- // value at this index. When solving for "X*X != 5", for example, we
- // should not accept a root of 2.
- SCEVHandle Val = AddRec->evaluateAtIteration(R1, SE);
- if (SCEVConstant *EvalVal = dyn_cast<SCEVConstant>(Val))
- if (EvalVal->getValue()->isZero())
- return R1; // We found a quadratic root!
- }
- }
- }
-
- return UnknownValue;
-}
-
-/// HowFarToNonZero - Return the number of times a backedge checking the
-/// specified value for nonzero will execute. If not computable, return
-/// UnknownValue
-SCEVHandle ScalarEvolutionsImpl::HowFarToNonZero(SCEV *V, const Loop *L) {
- // Loops that look like: while (X == 0) are very strange indeed. We don't
- // handle them yet except for the trivial case. This could be expanded in the
- // future as needed.
-
- // If the value is a constant, check to see if it is known to be non-zero
- // already. If so, the backedge will execute zero times.
- if (SCEVConstant *C = dyn_cast<SCEVConstant>(V)) {
- if (!C->getValue()->isNullValue())
- return SE.getIntegerSCEV(0, C->getType());
- return UnknownValue; // Otherwise it will loop infinitely.
- }
-
- // We could implement others, but I really doubt anyone writes loops like
- // this, and if they did, they would already be constant folded.
- return UnknownValue;
-}
-
-/// HowManyLessThans - Return the number of times a backedge containing the
-/// specified less-than comparison will execute. If not computable, return
-/// UnknownValue.
-SCEVHandle ScalarEvolutionsImpl::
-HowManyLessThans(SCEV *LHS, SCEV *RHS, const Loop *L, bool isSigned) {
- // Only handle: "ADDREC < LoopInvariant".
- if (!RHS->isLoopInvariant(L)) return UnknownValue;
-
- SCEVAddRecExpr *AddRec = dyn_cast<SCEVAddRecExpr>(LHS);
- if (!AddRec || AddRec->getLoop() != L)
- return UnknownValue;
-
- if (AddRec->isAffine()) {
- // FORNOW: We only support unit strides.
- SCEVHandle One = SE.getIntegerSCEV(1, RHS->getType());
- if (AddRec->getOperand(1) != One)
- return UnknownValue;
-
- // We know the LHS is of the form {n,+,1} and the RHS is some loop-invariant
- // m. So, we count the number of iterations in which {n,+,1} < m is true.
- // Note that we cannot simply return max(m-n,0) because it's not safe to
- // treat m-n as signed nor unsigned due to overflow possibility.
-
- // First, we get the value of the LHS in the first iteration: n
- SCEVHandle Start = AddRec->getOperand(0);
-
- // Then, we get the value of the LHS in the first iteration in which the
- // above condition doesn't hold. This equals to max(m,n).
- SCEVHandle End = isSigned ? SE.getSMaxExpr(RHS, Start)
- : SE.getUMaxExpr(RHS, Start);
-
- // Finally, we subtract these two values to get the number of times the
- // backedge is executed: max(m,n)-n.
- return SE.getMinusSCEV(End, Start);
- }
-
- return UnknownValue;
-}
-
-/// getNumIterationsInRange - Return the number of iterations of this loop that
-/// produce values in the specified constant range. Another way of looking at
-/// this is that it returns the first iteration number where the value is not in
-/// the condition, thus computing the exit count. If the iteration count can't
-/// be computed, an instance of SCEVCouldNotCompute is returned.
-SCEVHandle SCEVAddRecExpr::getNumIterationsInRange(ConstantRange Range,
- ScalarEvolution &SE) const {
- if (Range.isFullSet()) // Infinite loop.
- return new SCEVCouldNotCompute();
-
- // If the start is a non-zero constant, shift the range to simplify things.
- if (SCEVConstant *SC = dyn_cast<SCEVConstant>(getStart()))
- if (!SC->getValue()->isZero()) {
- std::vector<SCEVHandle> Operands(op_begin(), op_end());
- Operands[0] = SE.getIntegerSCEV(0, SC->getType());
- SCEVHandle Shifted = SE.getAddRecExpr(Operands, getLoop());
- if (SCEVAddRecExpr *ShiftedAddRec = dyn_cast<SCEVAddRecExpr>(Shifted))
- return ShiftedAddRec->getNumIterationsInRange(
- Range.subtract(SC->getValue()->getValue()), SE);
- // This is strange and shouldn't happen.
- return new SCEVCouldNotCompute();
- }
-
- // The only time we can solve this is when we have all constant indices.
- // Otherwise, we cannot determine the overflow conditions.
- for (unsigned i = 0, e = getNumOperands(); i != e; ++i)
- if (!isa<SCEVConstant>(getOperand(i)))
- return new SCEVCouldNotCompute();
-
-
- // Okay at this point we know that all elements of the chrec are constants and
- // that the start element is zero.
-
- // First check to see if the range contains zero. If not, the first
- // iteration exits.
- if (!Range.contains(APInt(getBitWidth(),0)))
- return SE.getConstant(ConstantInt::get(getType(),0));
-
- if (isAffine()) {
- // If this is an affine expression then we have this situation:
- // Solve {0,+,A} in Range === Ax in Range
-
- // We know that zero is in the range. If A is positive then we know that
- // the upper value of the range must be the first possible exit value.
- // If A is negative then the lower of the range is the last possible loop
- // value. Also note that we already checked for a full range.
- APInt One(getBitWidth(),1);
- APInt A = cast<SCEVConstant>(getOperand(1))->getValue()->getValue();
- APInt End = A.sge(One) ? (Range.getUpper() - One) : Range.getLower();
-
- // The exit value should be (End+A)/A.
- APInt ExitVal = (End + A).udiv(A);
- ConstantInt *ExitValue = ConstantInt::get(ExitVal);
-
- // Evaluate at the exit value. If we really did fall out of the valid
- // range, then we computed our trip count, otherwise wrap around or other
- // things must have happened.
- ConstantInt *Val = EvaluateConstantChrecAtConstant(this, ExitValue, SE);
- if (Range.contains(Val->getValue()))
- return new SCEVCouldNotCompute(); // Something strange happened
-
- // Ensure that the previous value is in the range. This is a sanity check.
- assert(Range.contains(
- EvaluateConstantChrecAtConstant(this,
- ConstantInt::get(ExitVal - One), SE)->getValue()) &&
- "Linear scev computation is off in a bad way!");
- return SE.getConstant(ExitValue);
- } else if (isQuadratic()) {
- // If this is a quadratic (3-term) AddRec {L,+,M,+,N}, find the roots of the
- // quadratic equation to solve it. To do this, we must frame our problem in
- // terms of figuring out when zero is crossed, instead of when
- // Range.getUpper() is crossed.
- std::vector<SCEVHandle> NewOps(op_begin(), op_end());
- NewOps[0] = SE.getNegativeSCEV(SE.getConstant(Range.getUpper()));
- SCEVHandle NewAddRec = SE.getAddRecExpr(NewOps, getLoop());
-
- // Next, solve the constructed addrec
- std::pair<SCEVHandle,SCEVHandle> Roots =
- SolveQuadraticEquation(cast<SCEVAddRecExpr>(NewAddRec), SE);
- SCEVConstant *R1 = dyn_cast<SCEVConstant>(Roots.first);
- SCEVConstant *R2 = dyn_cast<SCEVConstant>(Roots.second);
- if (R1) {
- // Pick the smallest positive root value.
- if (ConstantInt *CB =
- dyn_cast<ConstantInt>(ConstantExpr::getICmp(ICmpInst::ICMP_ULT,
- R1->getValue(), R2->getValue()))) {
- if (CB->getZExtValue() == false)
- std::swap(R1, R2); // R1 is the minimum root now.
-
- // Make sure the root is not off by one. The returned iteration should
- // not be in the range, but the previous one should be. When solving
- // for "X*X < 5", for example, we should not return a root of 2.
- ConstantInt *R1Val = EvaluateConstantChrecAtConstant(this,
- R1->getValue(),
- SE);
- if (Range.contains(R1Val->getValue())) {
- // The next iteration must be out of the range...
- ConstantInt *NextVal = ConstantInt::get(R1->getValue()->getValue()+1);
-
- R1Val = EvaluateConstantChrecAtConstant(this, NextVal, SE);
- if (!Range.contains(R1Val->getValue()))
- return SE.getConstant(NextVal);
- return new SCEVCouldNotCompute(); // Something strange happened
- }
-
- // If R1 was not in the range, then it is a good return value. Make
- // sure that R1-1 WAS in the range though, just in case.
- ConstantInt *NextVal = ConstantInt::get(R1->getValue()->getValue()-1);
- R1Val = EvaluateConstantChrecAtConstant(this, NextVal, SE);
- if (Range.contains(R1Val->getValue()))
- return R1;
- return new SCEVCouldNotCompute(); // Something strange happened
- }
- }
- }
-
- // Fallback, if this is a general polynomial, figure out the progression
- // through brute force: evaluate until we find an iteration that fails the
- // test. This is likely to be slow, but getting an accurate trip count is
- // incredibly important, we will be able to simplify the exit test a lot, and
- // we are almost guaranteed to get a trip count in this case.
- ConstantInt *TestVal = ConstantInt::get(getType(), 0);
- ConstantInt *EndVal = TestVal; // Stop when we wrap around.
- do {
- ++NumBruteForceEvaluations;
- SCEVHandle Val = evaluateAtIteration(SE.getConstant(TestVal), SE);
- if (!isa<SCEVConstant>(Val)) // This shouldn't happen.
- return new SCEVCouldNotCompute();
-
- // Check to see if we found the value!
- if (!Range.contains(cast<SCEVConstant>(Val)->getValue()->getValue()))
- return SE.getConstant(TestVal);
-
- // Increment to test the next index.
- TestVal = ConstantInt::get(TestVal->getValue()+1);
- } while (TestVal != EndVal);
-
- return new SCEVCouldNotCompute();
-}
-
-
-
-//===----------------------------------------------------------------------===//
-// ScalarEvolution Class Implementation
-//===----------------------------------------------------------------------===//
-
-bool ScalarEvolution::runOnFunction(Function &F) {
- Impl = new ScalarEvolutionsImpl(*this, F, getAnalysis<LoopInfo>());
- return false;
-}
-
-void ScalarEvolution::releaseMemory() {
- delete (ScalarEvolutionsImpl*)Impl;
- Impl = 0;
-}
-
-void ScalarEvolution::getAnalysisUsage(AnalysisUsage &AU) const {
- AU.setPreservesAll();
- AU.addRequiredTransitive<LoopInfo>();
-}
-
-SCEVHandle ScalarEvolution::getSCEV(Value *V) const {
- return ((ScalarEvolutionsImpl*)Impl)->getSCEV(V);
-}
-
-/// hasSCEV - Return true if the SCEV for this value has already been
-/// computed.
-bool ScalarEvolution::hasSCEV(Value *V) const {
- return ((ScalarEvolutionsImpl*)Impl)->hasSCEV(V);
-}
-
-
-/// setSCEV - Insert the specified SCEV into the map of current SCEVs for
-/// the specified value.
-void ScalarEvolution::setSCEV(Value *V, const SCEVHandle &H) {
- ((ScalarEvolutionsImpl*)Impl)->setSCEV(V, H);
-}
-
-
-SCEVHandle ScalarEvolution::getIterationCount(const Loop *L) const {
- return ((ScalarEvolutionsImpl*)Impl)->getIterationCount(L);
-}
-
-bool ScalarEvolution::hasLoopInvariantIterationCount(const Loop *L) const {
- return !isa<SCEVCouldNotCompute>(getIterationCount(L));
-}
-
-SCEVHandle ScalarEvolution::getSCEVAtScope(Value *V, const Loop *L) const {
- return ((ScalarEvolutionsImpl*)Impl)->getSCEVAtScope(getSCEV(V), L);
-}
-
-void ScalarEvolution::deleteValueFromRecords(Value *V) const {
- return ((ScalarEvolutionsImpl*)Impl)->deleteValueFromRecords(V);
-}
-
-static void PrintLoopInfo(std::ostream &OS, const ScalarEvolution *SE,
- const Loop *L) {
- // Print all inner loops first
- for (Loop::iterator I = L->begin(), E = L->end(); I != E; ++I)
- PrintLoopInfo(OS, SE, *I);
-
- OS << "Loop " << L->getHeader()->getName() << ": ";
-
- SmallVector<BasicBlock*, 8> ExitBlocks;
- L->getExitBlocks(ExitBlocks);
- if (ExitBlocks.size() != 1)
- OS << "<multiple exits> ";
-
- if (SE->hasLoopInvariantIterationCount(L)) {
- OS << *SE->getIterationCount(L) << " iterations! ";
- } else {
- OS << "Unpredictable iteration count. ";
- }
-
- OS << "\n";
-}
-
-void ScalarEvolution::print(std::ostream &OS, const Module* ) const {
- Function &F = ((ScalarEvolutionsImpl*)Impl)->F;
- LoopInfo &LI = ((ScalarEvolutionsImpl*)Impl)->LI;
-
- OS << "Classifying expressions for: " << F.getName() << "\n";
- for (inst_iterator I = inst_begin(F), E = inst_end(F); I != E; ++I)
- if (I->getType()->isInteger()) {
- OS << *I;
- OS << " --> ";
- SCEVHandle SV = getSCEV(&*I);
- SV->print(OS);
- OS << "\t\t";
-
- if ((*I).getType()->isInteger()) {
- ConstantRange Bounds = SV->getValueRange();
- if (!Bounds.isFullSet())
- OS << "Bounds: " << Bounds << " ";
- }
-
- if (const Loop *L = LI.getLoopFor((*I).getParent())) {
- OS << "Exits: ";
- SCEVHandle ExitValue = getSCEVAtScope(&*I, L->getParentLoop());
- if (isa<SCEVCouldNotCompute>(ExitValue)) {
- OS << "<<Unknown>>";
- } else {
- OS << *ExitValue;
- }
- }
-
-
- OS << "\n";
- }
-
- OS << "Determining loop execution counts for: " << F.getName() << "\n";
- for (LoopInfo::iterator I = LI.begin(), E = LI.end(); I != E; ++I)
- PrintLoopInfo(OS, this, *I);
-}
diff --git a/release_23/lib/Analysis/ScalarEvolutionExpander.cpp b/release_23/lib/Analysis/ScalarEvolutionExpander.cpp
deleted file mode 100644
index 7ef1948b6a68..000000000000
--- a/release_23/lib/Analysis/ScalarEvolutionExpander.cpp
+++ /dev/null
@@ -1,242 +0,0 @@
-//===- ScalarEvolutionExpander.cpp - Scalar Evolution Analysis --*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains the implementation of the scalar evolution expander,
-// which is used to generate the code corresponding to a given scalar evolution
-// expression.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Analysis/ScalarEvolutionExpander.h"
-#include "llvm/Analysis/LoopInfo.h"
-using namespace llvm;
-
-/// InsertCastOfTo - Insert a cast of V to the specified type, doing what
-/// we can to share the casts.
-Value *SCEVExpander::InsertCastOfTo(Instruction::CastOps opcode, Value *V,
- const Type *Ty) {
- // FIXME: keep track of the cast instruction.
- if (Constant *C = dyn_cast<Constant>(V))
- return ConstantExpr::getCast(opcode, C, Ty);
-
- if (Argument *A = dyn_cast<Argument>(V)) {
- // Check to see if there is already a cast!
- for (Value::use_iterator UI = A->use_begin(), E = A->use_end();
- UI != E; ++UI) {
- if ((*UI)->getType() == Ty)
- if (CastInst *CI = dyn_cast<CastInst>(cast<Instruction>(*UI)))
- if (CI->getOpcode() == opcode) {
- // If the cast isn't the first instruction of the function, move it.
- if (BasicBlock::iterator(CI) !=
- A->getParent()->getEntryBlock().begin()) {
- CI->moveBefore(A->getParent()->getEntryBlock().begin());
- }
- return CI;
- }
- }
- return CastInst::create(opcode, V, Ty, V->getName(),
- A->getParent()->getEntryBlock().begin());
- }
-
- Instruction *I = cast<Instruction>(V);
-
- // Check to see if there is already a cast. If there is, use it.
- for (Value::use_iterator UI = I->use_begin(), E = I->use_end();
- UI != E; ++UI) {
- if ((*UI)->getType() == Ty)
- if (CastInst *CI = dyn_cast<CastInst>(cast<Instruction>(*UI)))
- if (CI->getOpcode() == opcode) {
- BasicBlock::iterator It = I; ++It;
- if (isa<InvokeInst>(I))
- It = cast<InvokeInst>(I)->getNormalDest()->begin();
- while (isa<PHINode>(It)) ++It;
- if (It != BasicBlock::iterator(CI)) {
- // Splice the cast immediately after the operand in question.
- CI->moveBefore(It);
- }
- return CI;
- }
- }
- BasicBlock::iterator IP = I; ++IP;
- if (InvokeInst *II = dyn_cast<InvokeInst>(I))
- IP = II->getNormalDest()->begin();
- while (isa<PHINode>(IP)) ++IP;
- return CastInst::create(opcode, V, Ty, V->getName(), IP);
-}
-
-/// InsertBinop - Insert the specified binary operator, doing a small amount
-/// of work to avoid inserting an obviously redundant operation.
-Value *SCEVExpander::InsertBinop(Instruction::BinaryOps Opcode, Value *LHS,
- Value *RHS, Instruction *&InsertPt) {
- // Fold a binop with constant operands.
- if (Constant *CLHS = dyn_cast<Constant>(LHS))
- if (Constant *CRHS = dyn_cast<Constant>(RHS))
- return ConstantExpr::get(Opcode, CLHS, CRHS);
-
- // Do a quick scan to see if we have this binop nearby. If so, reuse it.
- unsigned ScanLimit = 6;
- for (BasicBlock::iterator IP = InsertPt, E = InsertPt->getParent()->begin();
- ScanLimit; --IP, --ScanLimit) {
- if (BinaryOperator *BinOp = dyn_cast<BinaryOperator>(IP))
- if (BinOp->getOpcode() == Opcode && BinOp->getOperand(0) == LHS &&
- BinOp->getOperand(1) == RHS) {
- // If we found the instruction *at* the insert point, insert later
- // instructions after it.
- if (BinOp == InsertPt)
- InsertPt = ++IP;
- return BinOp;
- }
- if (IP == E) break;
- }
-
- // If we don't have
- return BinaryOperator::create(Opcode, LHS, RHS, "tmp", InsertPt);
-}
-
-Value *SCEVExpander::visitMulExpr(SCEVMulExpr *S) {
- int FirstOp = 0; // Set if we should emit a subtract.
- if (SCEVConstant *SC = dyn_cast<SCEVConstant>(S->getOperand(0)))
- if (SC->getValue()->isAllOnesValue())
- FirstOp = 1;
-
- int i = S->getNumOperands()-2;
- Value *V = expand(S->getOperand(i+1));
-
- // Emit a bunch of multiply instructions
- for (; i >= FirstOp; --i)
- V = InsertBinop(Instruction::Mul, V, expand(S->getOperand(i)),
- InsertPt);
- // -1 * ... ---> 0 - ...
- if (FirstOp == 1)
- V = InsertBinop(Instruction::Sub, Constant::getNullValue(V->getType()), V,
- InsertPt);
- return V;
-}
-
-Value *SCEVExpander::visitAddRecExpr(SCEVAddRecExpr *S) {
- const Type *Ty = S->getType();
- const Loop *L = S->getLoop();
- // We cannot yet do fp recurrences, e.g. the xform of {X,+,F} --> X+{0,+,F}
- assert(Ty->isInteger() && "Cannot expand fp recurrences yet!");
-
- // {X,+,F} --> X + {0,+,F}
- if (!isa<SCEVConstant>(S->getStart()) ||
- !cast<SCEVConstant>(S->getStart())->getValue()->isZero()) {
- Value *Start = expand(S->getStart());
- std::vector<SCEVHandle> NewOps(S->op_begin(), S->op_end());
- NewOps[0] = SE.getIntegerSCEV(0, Ty);
- Value *Rest = expand(SE.getAddRecExpr(NewOps, L));
-
- // FIXME: look for an existing add to use.
- return InsertBinop(Instruction::Add, Rest, Start, InsertPt);
- }
-
- // {0,+,1} --> Insert a canonical induction variable into the loop!
- if (S->getNumOperands() == 2 &&
- S->getOperand(1) == SE.getIntegerSCEV(1, Ty)) {
- // Create and insert the PHI node for the induction variable in the
- // specified loop.
- BasicBlock *Header = L->getHeader();
- PHINode *PN = PHINode::Create(Ty, "indvar", Header->begin());
- PN->addIncoming(Constant::getNullValue(Ty), L->getLoopPreheader());
-
- pred_iterator HPI = pred_begin(Header);
- assert(HPI != pred_end(Header) && "Loop with zero preds???");
- if (!L->contains(*HPI)) ++HPI;
- assert(HPI != pred_end(Header) && L->contains(*HPI) &&
- "No backedge in loop?");
-
- // Insert a unit add instruction right before the terminator corresponding
- // to the back-edge.
- Constant *One = ConstantInt::get(Ty, 1);
- Instruction *Add = BinaryOperator::createAdd(PN, One, "indvar.next",
- (*HPI)->getTerminator());
-
- pred_iterator PI = pred_begin(Header);
- if (*PI == L->getLoopPreheader())
- ++PI;
- PN->addIncoming(Add, *PI);
- return PN;
- }
-
- // Get the canonical induction variable I for this loop.
- Value *I = getOrInsertCanonicalInductionVariable(L, Ty);
-
- // If this is a simple linear addrec, emit it now as a special case.
- if (S->getNumOperands() == 2) { // {0,+,F} --> i*F
- Value *F = expand(S->getOperand(1));
-
- // IF the step is by one, just return the inserted IV.
- if (ConstantInt *CI = dyn_cast<ConstantInt>(F))
- if (CI->getValue() == 1)
- return I;
-
- // If the insert point is directly inside of the loop, emit the multiply at
- // the insert point. Otherwise, L is a loop that is a parent of the insert
- // point loop. If we can, move the multiply to the outer most loop that it
- // is safe to be in.
- Instruction *MulInsertPt = InsertPt;
- Loop *InsertPtLoop = LI.getLoopFor(MulInsertPt->getParent());
- if (InsertPtLoop != L && InsertPtLoop &&
- L->contains(InsertPtLoop->getHeader())) {
- while (InsertPtLoop != L) {
- // If we cannot hoist the multiply out of this loop, don't.
- if (!InsertPtLoop->isLoopInvariant(F)) break;
-
- // Otherwise, move the insert point to the preheader of the loop.
- MulInsertPt = InsertPtLoop->getLoopPreheader()->getTerminator();
- InsertPtLoop = InsertPtLoop->getParentLoop();
- }
- }
-
- return InsertBinop(Instruction::Mul, I, F, MulInsertPt);
- }
-
- // If this is a chain of recurrences, turn it into a closed form, using the
- // folders, then expandCodeFor the closed form. This allows the folders to
- // simplify the expression without having to build a bunch of special code
- // into this folder.
- SCEVHandle IH = SE.getUnknown(I); // Get I as a "symbolic" SCEV.
-
- SCEVHandle V = S->evaluateAtIteration(IH, SE);
- //cerr << "Evaluated: " << *this << "\n to: " << *V << "\n";
-
- return expand(V);
-}
-
-Value *SCEVExpander::visitSMaxExpr(SCEVSMaxExpr *S) {
- Value *LHS = expand(S->getOperand(0));
- for (unsigned i = 1; i < S->getNumOperands(); ++i) {
- Value *RHS = expand(S->getOperand(i));
- Value *ICmp = new ICmpInst(ICmpInst::ICMP_SGT, LHS, RHS, "tmp", InsertPt);
- LHS = SelectInst::Create(ICmp, LHS, RHS, "smax", InsertPt);
- }
- return LHS;
-}
-
-Value *SCEVExpander::visitUMaxExpr(SCEVUMaxExpr *S) {
- Value *LHS = expand(S->getOperand(0));
- for (unsigned i = 1; i < S->getNumOperands(); ++i) {
- Value *RHS = expand(S->getOperand(i));
- Value *ICmp = new ICmpInst(ICmpInst::ICMP_UGT, LHS, RHS, "tmp", InsertPt);
- LHS = SelectInst::Create(ICmp, LHS, RHS, "umax", InsertPt);
- }
- return LHS;
-}
-
-Value *SCEVExpander::expand(SCEV *S) {
- // Check to see if we already expanded this.
- std::map<SCEVHandle, Value*>::iterator I = InsertedExpressions.find(S);
- if (I != InsertedExpressions.end())
- return I->second;
-
- Value *V = visit(S);
- InsertedExpressions[S] = V;
- return V;
-}
diff --git a/release_23/lib/Analysis/Trace.cpp b/release_23/lib/Analysis/Trace.cpp
deleted file mode 100644
index 8f19fda953dd..000000000000
--- a/release_23/lib/Analysis/Trace.cpp
+++ /dev/null
@@ -1,50 +0,0 @@
-//===- Trace.cpp - Implementation of Trace class --------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This class represents a single trace of LLVM basic blocks. A trace is a
-// single entry, multiple exit, region of code that is often hot. Trace-based
-// optimizations treat traces almost like they are a large, strange, basic
-// block: because the trace path is assumed to be hot, optimizations for the
-// fall-through path are made at the expense of the non-fall-through paths.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Analysis/Trace.h"
-#include "llvm/Function.h"
-#include "llvm/Assembly/Writer.h"
-#include "llvm/Support/Streams.h"
-using namespace llvm;
-
-Function *Trace::getFunction() const {
- return getEntryBasicBlock()->getParent();
-}
-
-Module *Trace::getModule() const {
- return getFunction()->getParent();
-}
-
-/// print - Write trace to output stream.
-///
-void Trace::print(std::ostream &O) const {
- Function *F = getFunction ();
- O << "; Trace from function " << F->getName() << ", blocks:\n";
- for (const_iterator i = begin(), e = end(); i != e; ++i) {
- O << "; ";
- WriteAsOperand(O, *i, true, getModule());
- O << "\n";
- }
- O << "; Trace parent function: \n" << *F;
-}
-
-/// dump - Debugger convenience method; writes trace to standard error
-/// output stream.
-///
-void Trace::dump() const {
- print(cerr);
-}
diff --git a/release_23/lib/Analysis/ValueNumbering.cpp b/release_23/lib/Analysis/ValueNumbering.cpp
deleted file mode 100644
index 6c3ffdf224c5..000000000000
--- a/release_23/lib/Analysis/ValueNumbering.cpp
+++ /dev/null
@@ -1,280 +0,0 @@
-//===- ValueNumbering.cpp - Value #'ing Implementation ----------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the non-abstract Value Numbering methods as well as a
-// default implementation for the analysis group.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Analysis/Passes.h"
-#include "llvm/Analysis/ValueNumbering.h"
-#include "llvm/Support/InstVisitor.h"
-#include "llvm/BasicBlock.h"
-#include "llvm/Instructions.h"
-#include "llvm/Pass.h"
-#include "llvm/Type.h"
-#include "llvm/Support/Compiler.h"
-using namespace llvm;
-
-char ValueNumbering::ID = 0;
-// Register the ValueNumbering interface, providing a nice name to refer to.
-static RegisterAnalysisGroup<ValueNumbering> X("Value Numbering");
-
-/// ValueNumbering destructor: DO NOT move this to the header file for
-/// ValueNumbering or else clients of the ValueNumbering class may not depend on
-/// the ValueNumbering.o file in the current .a file, causing alias analysis
-/// support to not be included in the tool correctly!
-///
-ValueNumbering::~ValueNumbering() {}
-
-//===----------------------------------------------------------------------===//
-// Basic ValueNumbering Pass Implementation
-//===----------------------------------------------------------------------===//
-//
-// Because of the way .a files work, the implementation of the BasicVN class
-// MUST be in the ValueNumbering file itself, or else we run the risk of
-// ValueNumbering being used, but the default implementation not being linked
-// into the tool that uses it. As such, we register and implement the class
-// here.
-//
-
-namespace {
- /// BasicVN - This class is the default implementation of the ValueNumbering
- /// interface. It walks the SSA def-use chains to trivially identify
- /// lexically identical expressions. This does not require any ahead of time
- /// analysis, so it is a very fast default implementation.
- ///
- struct VISIBILITY_HIDDEN BasicVN
- : public ImmutablePass, public ValueNumbering {
- static char ID; // Class identification, replacement for typeinfo
- BasicVN() : ImmutablePass((intptr_t)&ID) {}
-
- /// getEqualNumberNodes - Return nodes with the same value number as the
- /// specified Value. This fills in the argument vector with any equal
- /// values.
- ///
- /// This is where our implementation is.
- ///
- virtual void getEqualNumberNodes(Value *V1,
- std::vector<Value*> &RetVals) const;
- };
-
- char BasicVN::ID = 0;
- // Register this pass...
- RegisterPass<BasicVN>
- X("basicvn", "Basic Value Numbering (default GVN impl)", false, true);
-
- // Declare that we implement the ValueNumbering interface
- RegisterAnalysisGroup<ValueNumbering, true> Y(X);
-
- /// BVNImpl - Implement BasicVN in terms of a visitor class that
- /// handles the different types of instructions as appropriate.
- ///
- struct VISIBILITY_HIDDEN BVNImpl : public InstVisitor<BVNImpl> {
- std::vector<Value*> &RetVals;
- explicit BVNImpl(std::vector<Value*> &RV) : RetVals(RV) {}
-
- void visitCastInst(CastInst &I);
- void visitGetElementPtrInst(GetElementPtrInst &I);
- void visitCmpInst(CmpInst &I);
-
- void handleBinaryInst(Instruction &I);
- void visitBinaryOperator(Instruction &I) { handleBinaryInst(I); }
- void visitShiftInst(Instruction &I) { handleBinaryInst(I); }
- void visitExtractElementInst(Instruction &I) { handleBinaryInst(I); }
-
- void handleTernaryInst(Instruction &I);
- void visitSelectInst(Instruction &I) { handleTernaryInst(I); }
- void visitInsertElementInst(Instruction &I) { handleTernaryInst(I); }
- void visitShuffleVectorInst(Instruction &I) { handleTernaryInst(I); }
- void visitInstruction(Instruction &) {
- // Cannot value number calls or terminator instructions.
- }
- };
-}
-
-ImmutablePass *llvm::createBasicVNPass() { return new BasicVN(); }
-
-// getEqualNumberNodes - Return nodes with the same value number as the
-// specified Value. This fills in the argument vector with any equal values.
-//
-void BasicVN::getEqualNumberNodes(Value *V, std::vector<Value*> &RetVals) const{
- assert(V->getType() != Type::VoidTy &&
- "Can only value number non-void values!");
- // We can only handle the case where I is an instruction!
- if (Instruction *I = dyn_cast<Instruction>(V))
- BVNImpl(RetVals).visit(I);
-}
-
-void BVNImpl::visitCastInst(CastInst &CI) {
- Instruction &I = (Instruction&)CI;
- Value *Op = I.getOperand(0);
- Function *F = I.getParent()->getParent();
-
- for (Value::use_iterator UI = Op->use_begin(), UE = Op->use_end();
- UI != UE; ++UI)
- if (CastInst *Other = dyn_cast<CastInst>(*UI))
- // Check that the opcode is the same
- if (Other->getOpcode() == Instruction::CastOps(I.getOpcode()) &&
- // Check that the destination types are the same
- Other->getType() == I.getType() &&
- // Is it embedded in the same function? (This could be false if LHS
- // is a constant or global!)
- Other->getParent()->getParent() == F &&
- // Check to see if this new cast is not I.
- Other != &I) {
- // These instructions are identical. Add to list...
- RetVals.push_back(Other);
- }
-}
-
-void BVNImpl::visitCmpInst(CmpInst &CI1) {
- Value *LHS = CI1.getOperand(0);
- for (Value::use_iterator UI = LHS->use_begin(), UE = LHS->use_end();
- UI != UE; ++UI)
- if (CmpInst *CI2 = dyn_cast<CmpInst>(*UI))
- // Check to see if this compare instruction is not CI, but same opcode,
- // same predicate, and in the same function.
- if (CI2 != &CI1 && CI2->getOpcode() == CI1.getOpcode() &&
- CI2->getPredicate() == CI1.getPredicate() &&
- CI2->getParent()->getParent() == CI1.getParent()->getParent())
- // If the operands are the same
- if ((CI2->getOperand(0) == CI1.getOperand(0) &&
- CI2->getOperand(1) == CI1.getOperand(1)) ||
- // Or the compare is commutative and the operands are reversed
- (CI1.isCommutative() &&
- CI2->getOperand(0) == CI1.getOperand(1) &&
- CI2->getOperand(1) == CI1.getOperand(0)))
- // Then the instructiosn are identical, add to list.
- RetVals.push_back(CI2);
-}
-
-
-
-// isIdenticalBinaryInst - Return true if the two binary instructions are
-// identical.
-//
-static inline bool isIdenticalBinaryInst(const Instruction &I1,
- const Instruction *I2) {
- // Is it embedded in the same function? (This could be false if LHS
- // is a constant or global!)
- if (I1.getOpcode() != I2->getOpcode() ||
- I1.getParent()->getParent() != I2->getParent()->getParent())
- return false;
-
- // If they are CmpInst instructions, check their predicates
- if (CmpInst *CI1 = dyn_cast<CmpInst>(&const_cast<Instruction&>(I1)))
- if (CI1->getPredicate() != cast<CmpInst>(I2)->getPredicate())
- return false;
-
- // They are identical if both operands are the same!
- if (I1.getOperand(0) == I2->getOperand(0) &&
- I1.getOperand(1) == I2->getOperand(1))
- return true;
-
- // If the instruction is commutative, the instruction can match if the
- // operands are swapped!
- //
- if ((I1.getOperand(0) == I2->getOperand(1) &&
- I1.getOperand(1) == I2->getOperand(0)) &&
- I1.isCommutative())
- return true;
-
- return false;
-}
-
-// isIdenticalTernaryInst - Return true if the two ternary instructions are
-// identical.
-//
-static inline bool isIdenticalTernaryInst(const Instruction &I1,
- const Instruction *I2) {
- // Is it embedded in the same function? (This could be false if LHS
- // is a constant or global!)
- if (I1.getParent()->getParent() != I2->getParent()->getParent())
- return false;
-
- // They are identical if all operands are the same!
- return I1.getOperand(0) == I2->getOperand(0) &&
- I1.getOperand(1) == I2->getOperand(1) &&
- I1.getOperand(2) == I2->getOperand(2);
-}
-
-
-
-void BVNImpl::handleBinaryInst(Instruction &I) {
- Value *LHS = I.getOperand(0);
-
- for (Value::use_iterator UI = LHS->use_begin(), UE = LHS->use_end();
- UI != UE; ++UI)
- if (Instruction *Other = dyn_cast<Instruction>(*UI))
- // Check to see if this new binary operator is not I, but same operand...
- if (Other != &I && isIdenticalBinaryInst(I, Other)) {
- // These instructions are identical. Handle the situation.
- RetVals.push_back(Other);
- }
-}
-
-// IdenticalComplexInst - Return true if the two instructions are the same, by
-// using a brute force comparison. This is useful for instructions with an
-// arbitrary number of arguments.
-//
-static inline bool IdenticalComplexInst(const Instruction *I1,
- const Instruction *I2) {
- assert(I1->getOpcode() == I2->getOpcode());
- // Equal if they are in the same function...
- return I1->getParent()->getParent() == I2->getParent()->getParent() &&
- // And return the same type...
- I1->getType() == I2->getType() &&
- // And have the same number of operands...
- I1->getNumOperands() == I2->getNumOperands() &&
- // And all of the operands are equal.
- std::equal(I1->op_begin(), I1->op_end(), I2->op_begin());
-}
-
-void BVNImpl::visitGetElementPtrInst(GetElementPtrInst &I) {
- Value *Op = I.getOperand(0);
-
- // Try to pick a local operand if possible instead of a constant or a global
- // that might have a lot of uses.
- for (unsigned i = 1, e = I.getNumOperands(); i != e; ++i)
- if (isa<Instruction>(I.getOperand(i)) || isa<Argument>(I.getOperand(i))) {
- Op = I.getOperand(i);
- break;
- }
-
- for (Value::use_iterator UI = Op->use_begin(), UE = Op->use_end();
- UI != UE; ++UI)
- if (GetElementPtrInst *Other = dyn_cast<GetElementPtrInst>(*UI))
- // Check to see if this new getelementptr is not I, but same operand...
- if (Other != &I && IdenticalComplexInst(&I, Other)) {
- // These instructions are identical. Handle the situation.
- RetVals.push_back(Other);
- }
-}
-
-void BVNImpl::handleTernaryInst(Instruction &I) {
- Value *Op0 = I.getOperand(0);
- Instruction *OtherInst;
-
- for (Value::use_iterator UI = Op0->use_begin(), UE = Op0->use_end();
- UI != UE; ++UI)
- if ((OtherInst = dyn_cast<Instruction>(*UI)) &&
- OtherInst->getOpcode() == I.getOpcode()) {
- // Check to see if this new select is not I, but has the same operands.
- if (OtherInst != &I && isIdenticalTernaryInst(I, OtherInst)) {
- // These instructions are identical. Handle the situation.
- RetVals.push_back(OtherInst);
- }
-
- }
-}
-
-
-// Ensure that users of ValueNumbering.h will link with this file
-DEFINING_FILE_FOR(BasicValueNumbering)
diff --git a/release_23/lib/Archive/Archive.cpp b/release_23/lib/Archive/Archive.cpp
deleted file mode 100644
index a0e5eedc9c94..000000000000
--- a/release_23/lib/Archive/Archive.cpp
+++ /dev/null
@@ -1,266 +0,0 @@
-//===-- Archive.cpp - Generic LLVM archive functions ------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains the implementation of the Archive and ArchiveMember
-// classes that is common to both reading and writing archives..
-//
-//===----------------------------------------------------------------------===//
-
-#include "ArchiveInternals.h"
-#include "llvm/Bitcode/ReaderWriter.h"
-#include "llvm/ModuleProvider.h"
-#include "llvm/Module.h"
-#include "llvm/Support/MemoryBuffer.h"
-#include "llvm/System/Process.h"
-#include <memory>
-#include <cstring>
-using namespace llvm;
-
-// getMemberSize - compute the actual physical size of the file member as seen
-// on disk. This isn't the size of member's payload. Use getSize() for that.
-unsigned
-ArchiveMember::getMemberSize() const {
- // Basically its the file size plus the header size
- unsigned result = info.fileSize + sizeof(ArchiveMemberHeader);
-
- // If it has a long filename, include the name length
- if (hasLongFilename())
- result += path.toString().length() + 1;
-
- // If its now odd lengthed, include the padding byte
- if (result % 2 != 0 )
- result++;
-
- return result;
-}
-
-// This default constructor is only use by the ilist when it creates its
-// sentry node. We give it specific static values to make it stand out a bit.
-ArchiveMember::ArchiveMember()
- : next(0), prev(0), parent(0), path("--invalid--"), flags(0), data(0)
-{
- info.user = sys::Process::GetCurrentUserId();
- info.group = sys::Process::GetCurrentGroupId();
- info.mode = 0777;
- info.fileSize = 0;
- info.modTime = sys::TimeValue::now();
-}
-
-// This is the constructor that the Archive class uses when it is building or
-// reading an archive. It just defaults a few things and ensures the parent is
-// set for the iplist. The Archive class fills in the ArchiveMember's data.
-// This is required because correctly setting the data may depend on other
-// things in the Archive.
-ArchiveMember::ArchiveMember(Archive* PAR)
- : next(0), prev(0), parent(PAR), path(), flags(0), data(0)
-{
-}
-
-// This method allows an ArchiveMember to be replaced with the data for a
-// different file, presumably as an update to the member. It also makes sure
-// the flags are reset correctly.
-bool ArchiveMember::replaceWith(const sys::Path& newFile, std::string* ErrMsg) {
- if (!newFile.exists()) {
- if (ErrMsg)
- *ErrMsg = "Can not replace an archive member with a non-existent file";
- return true;
- }
-
- data = 0;
- path = newFile;
-
- // SVR4 symbol tables have an empty name
- if (path.toString() == ARFILE_SVR4_SYMTAB_NAME)
- flags |= SVR4SymbolTableFlag;
- else
- flags &= ~SVR4SymbolTableFlag;
-
- // BSD4.4 symbol tables have a special name
- if (path.toString() == ARFILE_BSD4_SYMTAB_NAME)
- flags |= BSD4SymbolTableFlag;
- else
- flags &= ~BSD4SymbolTableFlag;
-
- // LLVM symbol tables have a very specific name
- if (path.toString() == ARFILE_LLVM_SYMTAB_NAME)
- flags |= LLVMSymbolTableFlag;
- else
- flags &= ~LLVMSymbolTableFlag;
-
- // String table name
- if (path.toString() == ARFILE_STRTAB_NAME)
- flags |= StringTableFlag;
- else
- flags &= ~StringTableFlag;
-
- // If it has a slash then it has a path
- bool hasSlash = path.toString().find('/') != std::string::npos;
- if (hasSlash)
- flags |= HasPathFlag;
- else
- flags &= ~HasPathFlag;
-
- // If it has a slash or its over 15 chars then its a long filename format
- if (hasSlash || path.toString().length() > 15)
- flags |= HasLongFilenameFlag;
- else
- flags &= ~HasLongFilenameFlag;
-
- // Get the signature and status info
- const char* signature = (const char*) data;
- std::string magic;
- if (!signature) {
- path.getMagicNumber(magic,4);
- signature = magic.c_str();
- std::string err;
- const sys::FileStatus *FSinfo = path.getFileStatus(false, ErrMsg);
- if (FSinfo)
- info = *FSinfo;
- else
- return true;
- }
-
- // Determine what kind of file it is
- switch (sys::IdentifyFileType(signature,4)) {
- default:
- flags &= ~BitcodeFlag;
- break;
- }
- return false;
-}
-
-// Archive constructor - this is the only constructor that gets used for the
-// Archive class. Everything else (default,copy) is deprecated. This just
-// initializes and maps the file into memory, if requested.
-Archive::Archive(const sys::Path& filename)
- : archPath(filename), members(), mapfile(0), base(0), symTab(), strtab(),
- symTabSize(0), firstFileOffset(0), modules(), foreignST(0) {
-}
-
-bool
-Archive::mapToMemory(std::string* ErrMsg) {
- mapfile = MemoryBuffer::getFile(archPath.c_str(), ErrMsg);
- if (mapfile == 0)
- return true;
- base = mapfile->getBufferStart();
- return false;
-}
-
-void Archive::cleanUpMemory() {
- // Shutdown the file mapping
- delete mapfile;
- mapfile = 0;
- base = 0;
-
- // Forget the entire symbol table
- symTab.clear();
- symTabSize = 0;
-
- firstFileOffset = 0;
-
- // Free the foreign symbol table member
- if (foreignST) {
- delete foreignST;
- foreignST = 0;
- }
-
- // Delete any ModuleProviders and ArchiveMember's we've allocated as a result
- // of symbol table searches.
- for (ModuleMap::iterator I=modules.begin(), E=modules.end(); I != E; ++I ) {
- delete I->second.first;
- delete I->second.second;
- }
-}
-
-// Archive destructor - just clean up memory
-Archive::~Archive() {
- cleanUpMemory();
-}
-
-
-
-static void getSymbols(Module*M, std::vector<std::string>& symbols) {
- // Loop over global variables
- for (Module::global_iterator GI = M->global_begin(), GE=M->global_end(); GI != GE; ++GI)
- if (!GI->isDeclaration() && !GI->hasInternalLinkage())
- if (!GI->getName().empty())
- symbols.push_back(GI->getName());
-
- // Loop over functions
- for (Module::iterator FI = M->begin(), FE = M->end(); FI != FE; ++FI)
- if (!FI->isDeclaration() && !FI->hasInternalLinkage())
- if (!FI->getName().empty())
- symbols.push_back(FI->getName());
-
- // Loop over aliases
- for (Module::alias_iterator AI = M->alias_begin(), AE = M->alias_end();
- AI != AE; ++AI) {
- if (AI->hasName())
- symbols.push_back(AI->getName());
- }
-}
-
-// Get just the externally visible defined symbols from the bitcode
-bool llvm::GetBitcodeSymbols(const sys::Path& fName,
- std::vector<std::string>& symbols,
- std::string* ErrMsg) {
- std::auto_ptr<MemoryBuffer> Buffer(
- MemoryBuffer::getFileOrSTDIN(fName.c_str()));
- if (!Buffer.get()) {
- if (ErrMsg) *ErrMsg = "Could not open file '" + fName.toString() + "'";
- return true;
- }
-
- ModuleProvider *MP = getBitcodeModuleProvider(Buffer.get(), ErrMsg);
- if (!MP)
- return true;
-
- // Get the module from the provider
- Module* M = MP->materializeModule();
- if (M == 0) {
- delete MP;
- return true;
- }
-
- // Get the symbols
- getSymbols(M, symbols);
-
- // Done with the module.
- delete MP;
- return true;
-}
-
-ModuleProvider*
-llvm::GetBitcodeSymbols(const unsigned char *BufPtr, unsigned Length,
- const std::string& ModuleID,
- std::vector<std::string>& symbols,
- std::string* ErrMsg) {
- // Get the module provider
- MemoryBuffer *Buffer =MemoryBuffer::getNewMemBuffer(Length, ModuleID.c_str());
- memcpy((char*)Buffer->getBufferStart(), BufPtr, Length);
-
- ModuleProvider *MP = getBitcodeModuleProvider(Buffer, ErrMsg);
- if (!MP)
- return 0;
-
- // Get the module from the provider
- Module* M = MP->materializeModule();
- if (M == 0) {
- delete MP;
- return 0;
- }
-
- // Get the symbols
- getSymbols(M, symbols);
-
- // Done with the module. Note that ModuleProvider will delete the
- // Module when it is deleted. Also note that its the caller's responsibility
- // to delete the ModuleProvider.
- return MP;
-}
diff --git a/release_23/lib/Archive/ArchiveInternals.h b/release_23/lib/Archive/ArchiveInternals.h
deleted file mode 100644
index 7ba30244a213..000000000000
--- a/release_23/lib/Archive/ArchiveInternals.h
+++ /dev/null
@@ -1,85 +0,0 @@
-//===-- lib/Archive/ArchiveInternals.h -------------------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// Internal implementation header for LLVM Archive files.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LIB_ARCHIVE_ARCHIVEINTERNALS_H
-#define LIB_ARCHIVE_ARCHIVEINTERNALS_H
-
-#include "llvm/Bitcode/Archive.h"
-#include "llvm/System/TimeValue.h"
-#include "llvm/ADT/StringExtras.h"
-
-#include <cstring>
-
-#define ARFILE_MAGIC "!<arch>\n" ///< magic string
-#define ARFILE_MAGIC_LEN (sizeof(ARFILE_MAGIC)-1) ///< length of magic string
-#define ARFILE_SVR4_SYMTAB_NAME "/ " ///< SVR4 symtab entry name
-#define ARFILE_LLVM_SYMTAB_NAME "#_LLVM_SYM_TAB_#" ///< LLVM symtab entry name
-#define ARFILE_BSD4_SYMTAB_NAME "__.SYMDEF SORTED" ///< BSD4 symtab entry name
-#define ARFILE_STRTAB_NAME "// " ///< Name of string table
-#define ARFILE_PAD "\n" ///< inter-file align padding
-#define ARFILE_MEMBER_MAGIC "`\n" ///< fmag field magic #
-
-namespace llvm {
-
- /// The ArchiveMemberHeader structure is used internally for bitcode
- /// archives.
- /// The header precedes each file member in the archive. This structure is
- /// defined using character arrays for direct and correct interpretation
- /// regardless of the endianess of the machine that produced it.
- /// @brief Archive File Member Header
- class ArchiveMemberHeader {
- /// @name Data
- /// @{
- public:
- char name[16]; ///< Name of the file member.
- char date[12]; ///< File date, decimal seconds since Epoch
- char uid[6]; ///< user id in ASCII decimal
- char gid[6]; ///< group id in ASCII decimal
- char mode[8]; ///< file mode in ASCII octal
- char size[10]; ///< file size in ASCII decimal
- char fmag[2]; ///< Always contains ARFILE_MAGIC_TERMINATOR
-
- /// @}
- /// @name Methods
- /// @{
- public:
- void init() {
- memset(name,' ',16);
- memset(date,' ',12);
- memset(uid,' ',6);
- memset(gid,' ',6);
- memset(mode,' ',8);
- memset(size,' ',10);
- fmag[0] = '`';
- fmag[1] = '\n';
- }
-
- bool checkSignature() {
- return 0 == memcmp(fmag, ARFILE_MEMBER_MAGIC,2);
- }
- };
-
- // Get just the externally visible defined symbols from the bitcode
- bool GetBitcodeSymbols(const sys::Path& fName,
- std::vector<std::string>& symbols,
- std::string* ErrMsg);
-
- ModuleProvider* GetBitcodeSymbols(const unsigned char*Buffer,unsigned Length,
- const std::string& ModuleID,
- std::vector<std::string>& symbols,
- std::string* ErrMsg);
-}
-
-#endif
-
-// vim: sw=2 ai
diff --git a/release_23/lib/Archive/ArchiveReader.cpp b/release_23/lib/Archive/ArchiveReader.cpp
deleted file mode 100644
index fd0e30a71bfb..000000000000
--- a/release_23/lib/Archive/ArchiveReader.cpp
+++ /dev/null
@@ -1,628 +0,0 @@
-//===-- ArchiveReader.cpp - Read LLVM archive files -------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// Builds up standard unix archive files (.a) containing LLVM bitcode.
-//
-//===----------------------------------------------------------------------===//
-
-#include "ArchiveInternals.h"
-#include "llvm/Bitcode/ReaderWriter.h"
-#include "llvm/Support/MemoryBuffer.h"
-#include "llvm/Module.h"
-#include <memory>
-using namespace llvm;
-
-/// Read a variable-bit-rate encoded unsigned integer
-inline unsigned readInteger(const char*&At, const char*End){
- unsigned Shift = 0;
- unsigned Result = 0;
-
- do {
- if (At == End)
- return Result;
- Result |= (unsigned)((*At++) & 0x7F) << Shift;
- Shift += 7;
- } while (At[-1] & 0x80);
- return Result;
-}
-
-// Completely parse the Archive's symbol table and populate symTab member var.
-bool
-Archive::parseSymbolTable(const void* data, unsigned size, std::string* error) {
- const char* At = (const char*) data;
- const char* End = At + size;
- while (At < End) {
- unsigned offset = readInteger(At, End);
- if (At == End) {
- if (error)
- *error = "Ran out of data reading vbr_uint for symtab offset!";
- return false;
- }
- unsigned length = readInteger(At, End);
- if (At == End) {
- if (error)
- *error = "Ran out of data reading vbr_uint for symtab length!";
- return false;
- }
- if (At + length > End) {
- if (error)
- *error = "Malformed symbol table: length not consistent with size";
- return false;
- }
- // we don't care if it can't be inserted (duplicate entry)
- symTab.insert(std::make_pair(std::string(At, length), offset));
- At += length;
- }
- symTabSize = size;
- return true;
-}
-
-// This member parses an ArchiveMemberHeader that is presumed to be pointed to
-// by At. The At pointer is updated to the byte just after the header, which
-// can be variable in size.
-ArchiveMember*
-Archive::parseMemberHeader(const char*& At, const char* End, std::string* error)
-{
- if (At + sizeof(ArchiveMemberHeader) >= End) {
- if (error)
- *error = "Unexpected end of file";
- return 0;
- }
-
- // Cast archive member header
- ArchiveMemberHeader* Hdr = (ArchiveMemberHeader*)At;
- At += sizeof(ArchiveMemberHeader);
-
- // Extract the size and determine if the file is
- // compressed or not (negative length).
- int flags = 0;
- int MemberSize = atoi(Hdr->size);
- if (MemberSize < 0) {
- flags |= ArchiveMember::CompressedFlag;
- MemberSize = -MemberSize;
- }
-
- // Check the size of the member for sanity
- if (At + MemberSize > End) {
- if (error)
- *error = "invalid member length in archive file";
- return 0;
- }
-
- // Check the member signature
- if (!Hdr->checkSignature()) {
- if (error)
- *error = "invalid file member signature";
- return 0;
- }
-
- // Convert and check the member name
- // The empty name ( '/' and 15 blanks) is for a foreign (non-LLVM) symbol
- // table. The special name "//" and 14 blanks is for a string table, used
- // for long file names. This library doesn't generate either of those but
- // it will accept them. If the name starts with #1/ and the remainder is
- // digits, then those digits specify the length of the name that is
- // stored immediately following the header. The special name
- // __LLVM_SYM_TAB__ identifies the symbol table for LLVM bitcode.
- // Anything else is a regular, short filename that is terminated with
- // a '/' and blanks.
-
- std::string pathname;
- switch (Hdr->name[0]) {
- case '#':
- if (Hdr->name[1] == '1' && Hdr->name[2] == '/') {
- if (isdigit(Hdr->name[3])) {
- unsigned len = atoi(&Hdr->name[3]);
- pathname.assign(At, len);
- At += len;
- MemberSize -= len;
- flags |= ArchiveMember::HasLongFilenameFlag;
- } else {
- if (error)
- *error = "invalid long filename";
- return 0;
- }
- } else if (Hdr->name[1] == '_' &&
- (0 == memcmp(Hdr->name, ARFILE_LLVM_SYMTAB_NAME, 16))) {
- // The member is using a long file name (>15 chars) format.
- // This format is standard for 4.4BSD and Mac OSX operating
- // systems. LLVM uses it similarly. In this format, the
- // remainder of the name field (after #1/) specifies the
- // length of the file name which occupy the first bytes of
- // the member's data. The pathname already has the #1/ stripped.
- pathname.assign(ARFILE_LLVM_SYMTAB_NAME);
- flags |= ArchiveMember::LLVMSymbolTableFlag;
- }
- break;
- case '/':
- if (Hdr->name[1]== '/') {
- if (0 == memcmp(Hdr->name, ARFILE_STRTAB_NAME, 16)) {
- pathname.assign(ARFILE_STRTAB_NAME);
- flags |= ArchiveMember::StringTableFlag;
- } else {
- if (error)
- *error = "invalid string table name";
- return 0;
- }
- } else if (Hdr->name[1] == ' ') {
- if (0 == memcmp(Hdr->name, ARFILE_SVR4_SYMTAB_NAME, 16)) {
- pathname.assign(ARFILE_SVR4_SYMTAB_NAME);
- flags |= ArchiveMember::SVR4SymbolTableFlag;
- } else {
- if (error)
- *error = "invalid SVR4 symbol table name";
- return 0;
- }
- } else if (isdigit(Hdr->name[1])) {
- unsigned index = atoi(&Hdr->name[1]);
- if (index < strtab.length()) {
- const char* namep = strtab.c_str() + index;
- const char* endp = strtab.c_str() + strtab.length();
- const char* p = namep;
- const char* last_p = p;
- while (p < endp) {
- if (*p == '\n' && *last_p == '/') {
- pathname.assign(namep, last_p - namep);
- flags |= ArchiveMember::HasLongFilenameFlag;
- break;
- }
- last_p = p;
- p++;
- }
- if (p >= endp) {
- if (error)
- *error = "missing name termiantor in string table";
- return 0;
- }
- } else {
- if (error)
- *error = "name index beyond string table";
- return 0;
- }
- }
- break;
- case '_':
- if (Hdr->name[1] == '_' &&
- (0 == memcmp(Hdr->name, ARFILE_BSD4_SYMTAB_NAME, 16))) {
- pathname.assign(ARFILE_BSD4_SYMTAB_NAME);
- flags |= ArchiveMember::BSD4SymbolTableFlag;
- break;
- }
- /* FALL THROUGH */
-
- default:
- char* slash = (char*) memchr(Hdr->name, '/', 16);
- if (slash == 0)
- slash = Hdr->name + 16;
- pathname.assign(Hdr->name, slash - Hdr->name);
- break;
- }
-
- // Determine if this is a bitcode file
- switch (sys::IdentifyFileType(At, 4)) {
- case sys::Bitcode_FileType:
- flags |= ArchiveMember::BitcodeFlag;
- break;
- default:
- flags &= ~ArchiveMember::BitcodeFlag;
- break;
- }
-
- // Instantiate the ArchiveMember to be filled
- ArchiveMember* member = new ArchiveMember(this);
-
- // Fill in fields of the ArchiveMember
- member->next = 0;
- member->prev = 0;
- member->parent = this;
- member->path.set(pathname);
- member->info.fileSize = MemberSize;
- member->info.modTime.fromEpochTime(atoi(Hdr->date));
- unsigned int mode;
- sscanf(Hdr->mode, "%o", &mode);
- member->info.mode = mode;
- member->info.user = atoi(Hdr->uid);
- member->info.group = atoi(Hdr->gid);
- member->flags = flags;
- member->data = At;
-
- return member;
-}
-
-bool
-Archive::checkSignature(std::string* error) {
- // Check the magic string at file's header
- if (mapfile->getBufferSize() < 8 || memcmp(base, ARFILE_MAGIC, 8)) {
- if (error)
- *error = "invalid signature for an archive file";
- return false;
- }
- return true;
-}
-
-// This function loads the entire archive and fully populates its ilist with
-// the members of the archive file. This is typically used in preparation for
-// editing the contents of the archive.
-bool
-Archive::loadArchive(std::string* error) {
-
- // Set up parsing
- members.clear();
- symTab.clear();
- const char *At = base;
- const char *End = mapfile->getBufferEnd();
-
- if (!checkSignature(error))
- return false;
-
- At += 8; // Skip the magic string.
-
- bool seenSymbolTable = false;
- bool foundFirstFile = false;
- while (At < End) {
- // parse the member header
- const char* Save = At;
- ArchiveMember* mbr = parseMemberHeader(At, End, error);
- if (!mbr)
- return false;
-
- // check if this is the foreign symbol table
- if (mbr->isSVR4SymbolTable() || mbr->isBSD4SymbolTable()) {
- // We just save this but don't do anything special
- // with it. It doesn't count as the "first file".
- if (foreignST) {
- // What? Multiple foreign symbol tables? Just chuck it
- // and retain the last one found.
- delete foreignST;
- }
- foreignST = mbr;
- At += mbr->getSize();
- if ((intptr_t(At) & 1) == 1)
- At++;
- } else if (mbr->isStringTable()) {
- // Simply suck the entire string table into a string
- // variable. This will be used to get the names of the
- // members that use the "/ddd" format for their names
- // (SVR4 style long names).
- strtab.assign(At, mbr->getSize());
- At += mbr->getSize();
- if ((intptr_t(At) & 1) == 1)
- At++;
- delete mbr;
- } else if (mbr->isLLVMSymbolTable()) {
- // This is the LLVM symbol table for the archive. If we've seen it
- // already, its an error. Otherwise, parse the symbol table and move on.
- if (seenSymbolTable) {
- if (error)
- *error = "invalid archive: multiple symbol tables";
- return false;
- }
- if (!parseSymbolTable(mbr->getData(), mbr->getSize(), error))
- return false;
- seenSymbolTable = true;
- At += mbr->getSize();
- if ((intptr_t(At) & 1) == 1)
- At++;
- delete mbr; // We don't need this member in the list of members.
- } else {
- // This is just a regular file. If its the first one, save its offset.
- // Otherwise just push it on the list and move on to the next file.
- if (!foundFirstFile) {
- firstFileOffset = Save - base;
- foundFirstFile = true;
- }
- members.push_back(mbr);
- At += mbr->getSize();
- if ((intptr_t(At) & 1) == 1)
- At++;
- }
- }
- return true;
-}
-
-// Open and completely load the archive file.
-Archive*
-Archive::OpenAndLoad(const sys::Path& file, std::string* ErrorMessage)
-{
- std::auto_ptr<Archive> result ( new Archive(file));
- if (result->mapToMemory(ErrorMessage))
- return 0;
- if (!result->loadArchive(ErrorMessage))
- return 0;
- return result.release();
-}
-
-// Get all the bitcode modules from the archive
-bool
-Archive::getAllModules(std::vector<Module*>& Modules, std::string* ErrMessage) {
-
- for (iterator I=begin(), E=end(); I != E; ++I) {
- if (I->isBitcode()) {
- std::string FullMemberName = archPath.toString() +
- "(" + I->getPath().toString() + ")";
- MemoryBuffer *Buffer =
- MemoryBuffer::getNewMemBuffer(I->getSize(), FullMemberName.c_str());
- memcpy((char*)Buffer->getBufferStart(), I->getData(), I->getSize());
-
- Module *M = ParseBitcodeFile(Buffer, ErrMessage);
- delete Buffer;
- if (!M)
- return true;
-
- Modules.push_back(M);
- }
- }
- return false;
-}
-
-// Load just the symbol table from the archive file
-bool
-Archive::loadSymbolTable(std::string* ErrorMsg) {
-
- // Set up parsing
- members.clear();
- symTab.clear();
- const char *At = base;
- const char *End = mapfile->getBufferEnd();
-
- // Make sure we're dealing with an archive
- if (!checkSignature(ErrorMsg))
- return false;
-
- At += 8; // Skip signature
-
- // Parse the first file member header
- const char* FirstFile = At;
- ArchiveMember* mbr = parseMemberHeader(At, End, ErrorMsg);
- if (!mbr)
- return false;
-
- if (mbr->isSVR4SymbolTable() || mbr->isBSD4SymbolTable()) {
- // Skip the foreign symbol table, we don't do anything with it
- At += mbr->getSize();
- if ((intptr_t(At) & 1) == 1)
- At++;
- delete mbr;
-
- // Read the next one
- FirstFile = At;
- mbr = parseMemberHeader(At, End, ErrorMsg);
- if (!mbr) {
- delete mbr;
- return false;
- }
- }
-
- if (mbr->isStringTable()) {
- // Process the string table entry
- strtab.assign((const char*)mbr->getData(), mbr->getSize());
- At += mbr->getSize();
- if ((intptr_t(At) & 1) == 1)
- At++;
- delete mbr;
- // Get the next one
- FirstFile = At;
- mbr = parseMemberHeader(At, End, ErrorMsg);
- if (!mbr) {
- delete mbr;
- return false;
- }
- }
-
- // See if its the symbol table
- if (mbr->isLLVMSymbolTable()) {
- if (!parseSymbolTable(mbr->getData(), mbr->getSize(), ErrorMsg)) {
- delete mbr;
- return false;
- }
-
- At += mbr->getSize();
- if ((intptr_t(At) & 1) == 1)
- At++;
- delete mbr;
- // Can't be any more symtab headers so just advance
- FirstFile = At;
- } else {
- // There's no symbol table in the file. We have to rebuild it from scratch
- // because the intent of this method is to get the symbol table loaded so
- // it can be searched efficiently.
- // Add the member to the members list
- members.push_back(mbr);
- }
-
- firstFileOffset = FirstFile - base;
- return true;
-}
-
-// Open the archive and load just the symbol tables
-Archive*
-Archive::OpenAndLoadSymbols(const sys::Path& file, std::string* ErrorMessage) {
- std::auto_ptr<Archive> result ( new Archive(file) );
- if (result->mapToMemory(ErrorMessage))
- return 0;
- if (!result->loadSymbolTable(ErrorMessage))
- return 0;
- return result.release();
-}
-
-// Look up one symbol in the symbol table and return a ModuleProvider for the
-// module that defines that symbol.
-ModuleProvider*
-Archive::findModuleDefiningSymbol(const std::string& symbol,
- std::string* ErrMsg) {
- SymTabType::iterator SI = symTab.find(symbol);
- if (SI == symTab.end())
- return 0;
-
- // The symbol table was previously constructed assuming that the members were
- // written without the symbol table header. Because VBR encoding is used, the
- // values could not be adjusted to account for the offset of the symbol table
- // because that could affect the size of the symbol table due to VBR encoding.
- // We now have to account for this by adjusting the offset by the size of the
- // symbol table and its header.
- unsigned fileOffset =
- SI->second + // offset in symbol-table-less file
- firstFileOffset; // add offset to first "real" file in archive
-
- // See if the module is already loaded
- ModuleMap::iterator MI = modules.find(fileOffset);
- if (MI != modules.end())
- return MI->second.first;
-
- // Module hasn't been loaded yet, we need to load it
- const char* modptr = base + fileOffset;
- ArchiveMember* mbr = parseMemberHeader(modptr, mapfile->getBufferEnd(),
- ErrMsg);
- if (!mbr)
- return 0;
-
- // Now, load the bitcode module to get the ModuleProvider
- std::string FullMemberName = archPath.toString() + "(" +
- mbr->getPath().toString() + ")";
- MemoryBuffer *Buffer =MemoryBuffer::getNewMemBuffer(mbr->getSize(),
- FullMemberName.c_str());
- memcpy((char*)Buffer->getBufferStart(), mbr->getData(), mbr->getSize());
-
- ModuleProvider *mp = getBitcodeModuleProvider(Buffer, ErrMsg);
- if (!mp)
- return 0;
-
- modules.insert(std::make_pair(fileOffset, std::make_pair(mp, mbr)));
-
- return mp;
-}
-
-// Look up multiple symbols in the symbol table and return a set of
-// ModuleProviders that define those symbols.
-bool
-Archive::findModulesDefiningSymbols(std::set<std::string>& symbols,
- std::set<ModuleProvider*>& result,
- std::string* error) {
- if (!mapfile || !base) {
- if (error)
- *error = "Empty archive invalid for finding modules defining symbols";
- return false;
- }
-
- if (symTab.empty()) {
- // We don't have a symbol table, so we must build it now but lets also
- // make sure that we populate the modules table as we do this to ensure
- // that we don't load them twice when findModuleDefiningSymbol is called
- // below.
-
- // Get a pointer to the first file
- const char* At = base + firstFileOffset;
- const char* End = mapfile->getBufferEnd();
-
- while ( At < End) {
- // Compute the offset to be put in the symbol table
- unsigned offset = At - base - firstFileOffset;
-
- // Parse the file's header
- ArchiveMember* mbr = parseMemberHeader(At, End, error);
- if (!mbr)
- return false;
-
- // If it contains symbols
- if (mbr->isBitcode()) {
- // Get the symbols
- std::vector<std::string> symbols;
- std::string FullMemberName = archPath.toString() + "(" +
- mbr->getPath().toString() + ")";
- ModuleProvider* MP =
- GetBitcodeSymbols((const unsigned char*)At, mbr->getSize(),
- FullMemberName, symbols, error);
-
- if (MP) {
- // Insert the module's symbols into the symbol table
- for (std::vector<std::string>::iterator I = symbols.begin(),
- E=symbols.end(); I != E; ++I ) {
- symTab.insert(std::make_pair(*I, offset));
- }
- // Insert the ModuleProvider and the ArchiveMember into the table of
- // modules.
- modules.insert(std::make_pair(offset, std::make_pair(MP, mbr)));
- } else {
- if (error)
- *error = "Can't parse bitcode member: " +
- mbr->getPath().toString() + ": " + *error;
- delete mbr;
- return false;
- }
- }
-
- // Go to the next file location
- At += mbr->getSize();
- if ((intptr_t(At) & 1) == 1)
- At++;
- }
- }
-
- // At this point we have a valid symbol table (one way or another) so we
- // just use it to quickly find the symbols requested.
-
- for (std::set<std::string>::iterator I=symbols.begin(),
- E=symbols.end(); I != E;) {
- // See if this symbol exists
- ModuleProvider* mp = findModuleDefiningSymbol(*I,error);
- if (mp) {
- // The symbol exists, insert the ModuleProvider into our result,
- // duplicates wil be ignored
- result.insert(mp);
-
- // Remove the symbol now that its been resolved, being careful to
- // post-increment the iterator.
- symbols.erase(I++);
- } else {
- ++I;
- }
- }
- return true;
-}
-
-bool Archive::isBitcodeArchive() {
- // Make sure the symTab has been loaded. In most cases this should have been
- // done when the archive was constructed, but still, this is just in case.
- if (symTab.empty())
- if (!loadSymbolTable(0))
- return false;
-
- // Now that we know it's been loaded, return true
- // if it has a size
- if (symTab.size()) return true;
-
- // We still can't be sure it isn't a bitcode archive
- if (!loadArchive(0))
- return false;
-
- std::vector<Module *> Modules;
- std::string ErrorMessage;
-
- // Scan the archive, trying to load a bitcode member. We only load one to
- // see if this works.
- for (iterator I = begin(), E = end(); I != E; ++I) {
- if (!I->isBitcode())
- continue;
-
- std::string FullMemberName =
- archPath.toString() + "(" + I->getPath().toString() + ")";
-
- MemoryBuffer *Buffer =
- MemoryBuffer::getNewMemBuffer(I->getSize(), FullMemberName.c_str());
- memcpy((char*)Buffer->getBufferStart(), I->getData(), I->getSize());
- Module *M = ParseBitcodeFile(Buffer);
- delete Buffer;
- if (!M)
- return false; // Couldn't parse bitcode, not a bitcode archive.
- delete M;
- return true;
- }
-
- return false;
-}
diff --git a/release_23/lib/Archive/ArchiveWriter.cpp b/release_23/lib/Archive/ArchiveWriter.cpp
deleted file mode 100644
index d3861f32cbe4..000000000000
--- a/release_23/lib/Archive/ArchiveWriter.cpp
+++ /dev/null
@@ -1,471 +0,0 @@
-//===-- ArchiveWriter.cpp - Write LLVM archive files ----------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// Builds up an LLVM archive file (.a) containing LLVM bitcode.
-//
-//===----------------------------------------------------------------------===//
-
-#include "ArchiveInternals.h"
-#include "llvm/Bitcode/ReaderWriter.h"
-#include "llvm/ADT/OwningPtr.h"
-#include "llvm/Support/MemoryBuffer.h"
-#include "llvm/System/Signals.h"
-#include "llvm/System/Process.h"
-#include "llvm/ModuleProvider.h"
-#include <fstream>
-#include <ostream>
-#include <iomanip>
-using namespace llvm;
-
-// Write an integer using variable bit rate encoding. This saves a few bytes
-// per entry in the symbol table.
-inline void writeInteger(unsigned num, std::ofstream& ARFile) {
- while (1) {
- if (num < 0x80) { // done?
- ARFile << (unsigned char)num;
- return;
- }
-
- // Nope, we are bigger than a character, output the next 7 bits and set the
- // high bit to say that there is more coming...
- ARFile << (unsigned char)(0x80 | ((unsigned char)num & 0x7F));
- num >>= 7; // Shift out 7 bits now...
- }
-}
-
-// Compute how many bytes are taken by a given VBR encoded value. This is needed
-// to pre-compute the size of the symbol table.
-inline unsigned numVbrBytes(unsigned num) {
-
- // Note that the following nested ifs are somewhat equivalent to a binary
- // search. We split it in half by comparing against 2^14 first. This allows
- // most reasonable values to be done in 2 comparisons instead of 1 for
- // small ones and four for large ones. We expect this to access file offsets
- // in the 2^10 to 2^24 range and symbol lengths in the 2^0 to 2^8 range,
- // so this approach is reasonable.
- if (num < 1<<14) {
- if (num < 1<<7)
- return 1;
- else
- return 2;
- }
- if (num < 1<<21)
- return 3;
-
- if (num < 1<<28)
- return 4;
- return 5; // anything >= 2^28 takes 5 bytes
-}
-
-// Create an empty archive.
-Archive*
-Archive::CreateEmpty(const sys::Path& FilePath ) {
- Archive* result = new Archive(FilePath);
- return result;
-}
-
-// Fill the ArchiveMemberHeader with the information from a member. If
-// TruncateNames is true, names are flattened to 15 chars or less. The sz field
-// is provided here instead of coming from the mbr because the member might be
-// stored compressed and the compressed size is not the ArchiveMember's size.
-// Furthermore compressed files have negative size fields to identify them as
-// compressed.
-bool
-Archive::fillHeader(const ArchiveMember &mbr, ArchiveMemberHeader& hdr,
- int sz, bool TruncateNames) const {
-
- // Set the permissions mode, uid and gid
- hdr.init();
- char buffer[32];
- sprintf(buffer, "%-8o", mbr.getMode());
- memcpy(hdr.mode,buffer,8);
- sprintf(buffer, "%-6u", mbr.getUser());
- memcpy(hdr.uid,buffer,6);
- sprintf(buffer, "%-6u", mbr.getGroup());
- memcpy(hdr.gid,buffer,6);
-
- // Set the last modification date
- uint64_t secondsSinceEpoch = mbr.getModTime().toEpochTime();
- sprintf(buffer,"%-12u", unsigned(secondsSinceEpoch));
- memcpy(hdr.date,buffer,12);
-
- // Get rid of trailing blanks in the name
- std::string mbrPath = mbr.getPath().toString();
- size_t mbrLen = mbrPath.length();
- while (mbrLen > 0 && mbrPath[mbrLen-1] == ' ') {
- mbrPath.erase(mbrLen-1,1);
- mbrLen--;
- }
-
- // Set the name field in one of its various flavors.
- bool writeLongName = false;
- if (mbr.isStringTable()) {
- memcpy(hdr.name,ARFILE_STRTAB_NAME,16);
- } else if (mbr.isSVR4SymbolTable()) {
- memcpy(hdr.name,ARFILE_SVR4_SYMTAB_NAME,16);
- } else if (mbr.isBSD4SymbolTable()) {
- memcpy(hdr.name,ARFILE_BSD4_SYMTAB_NAME,16);
- } else if (mbr.isLLVMSymbolTable()) {
- memcpy(hdr.name,ARFILE_LLVM_SYMTAB_NAME,16);
- } else if (TruncateNames) {
- const char* nm = mbrPath.c_str();
- unsigned len = mbrPath.length();
- size_t slashpos = mbrPath.rfind('/');
- if (slashpos != std::string::npos) {
- nm += slashpos + 1;
- len -= slashpos +1;
- }
- if (len > 15)
- len = 15;
- memcpy(hdr.name,nm,len);
- hdr.name[len] = '/';
- } else if (mbrPath.length() < 16 && mbrPath.find('/') == std::string::npos) {
- memcpy(hdr.name,mbrPath.c_str(),mbrPath.length());
- hdr.name[mbrPath.length()] = '/';
- } else {
- std::string nm = "#1/";
- nm += utostr(mbrPath.length());
- memcpy(hdr.name,nm.data(),nm.length());
- if (sz < 0)
- sz -= mbrPath.length();
- else
- sz += mbrPath.length();
- writeLongName = true;
- }
-
- // Set the size field
- if (sz < 0) {
- buffer[0] = '-';
- sprintf(&buffer[1],"%-9u",(unsigned)-sz);
- } else {
- sprintf(buffer, "%-10u", (unsigned)sz);
- }
- memcpy(hdr.size,buffer,10);
-
- return writeLongName;
-}
-
-// Insert a file into the archive before some other member. This also takes care
-// of extracting the necessary flags and information from the file.
-bool
-Archive::addFileBefore(const sys::Path& filePath, iterator where,
- std::string* ErrMsg) {
- if (!filePath.exists()) {
- if (ErrMsg)
- *ErrMsg = "Can not add a non-existent file to archive";
- return true;
- }
-
- ArchiveMember* mbr = new ArchiveMember(this);
-
- mbr->data = 0;
- mbr->path = filePath;
- const sys::FileStatus *FSInfo = mbr->path.getFileStatus(false, ErrMsg);
- if (FSInfo)
- mbr->info = *FSInfo;
- else
- return true;
-
- unsigned flags = 0;
- bool hasSlash = filePath.toString().find('/') != std::string::npos;
- if (hasSlash)
- flags |= ArchiveMember::HasPathFlag;
- if (hasSlash || filePath.toString().length() > 15)
- flags |= ArchiveMember::HasLongFilenameFlag;
- std::string magic;
- mbr->path.getMagicNumber(magic,4);
- switch (sys::IdentifyFileType(magic.c_str(),4)) {
- case sys::Bitcode_FileType:
- flags |= ArchiveMember::BitcodeFlag;
- break;
- default:
- break;
- }
- mbr->flags = flags;
- members.insert(where,mbr);
- return false;
-}
-
-// Write one member out to the file.
-bool
-Archive::writeMember(
- const ArchiveMember& member,
- std::ofstream& ARFile,
- bool CreateSymbolTable,
- bool TruncateNames,
- bool ShouldCompress,
- std::string* ErrMsg
-) {
-
- unsigned filepos = ARFile.tellp();
- filepos -= 8;
-
- // Get the data and its size either from the
- // member's in-memory data or directly from the file.
- size_t fSize = member.getSize();
- const char *data = (const char*)member.getData();
- MemoryBuffer *mFile = 0;
- if (!data) {
- mFile = MemoryBuffer::getFile(member.getPath().c_str(), ErrMsg);
- if (mFile == 0)
- return true;
- data = mFile->getBufferStart();
- fSize = mFile->getBufferSize();
- }
-
- // Now that we have the data in memory, update the
- // symbol table if its a bitcode file.
- if (CreateSymbolTable && member.isBitcode()) {
- std::vector<std::string> symbols;
- std::string FullMemberName = archPath.toString() + "(" +
- member.getPath().toString()
- + ")";
- ModuleProvider* MP =
- GetBitcodeSymbols((const unsigned char*)data,fSize,
- FullMemberName, symbols, ErrMsg);
-
- // If the bitcode parsed successfully
- if ( MP ) {
- for (std::vector<std::string>::iterator SI = symbols.begin(),
- SE = symbols.end(); SI != SE; ++SI) {
-
- std::pair<SymTabType::iterator,bool> Res =
- symTab.insert(std::make_pair(*SI,filepos));
-
- if (Res.second) {
- symTabSize += SI->length() +
- numVbrBytes(SI->length()) +
- numVbrBytes(filepos);
- }
- }
- // We don't need this module any more.
- delete MP;
- } else {
- delete mFile;
- if (ErrMsg)
- *ErrMsg = "Can't parse bitcode member: " + member.getPath().toString()
- + ": " + *ErrMsg;
- return true;
- }
- }
-
- int hdrSize = fSize;
-
- // Compute the fields of the header
- ArchiveMemberHeader Hdr;
- bool writeLongName = fillHeader(member,Hdr,hdrSize,TruncateNames);
-
- // Write header to archive file
- ARFile.write((char*)&Hdr, sizeof(Hdr));
-
- // Write the long filename if its long
- if (writeLongName) {
- ARFile.write(member.getPath().toString().data(),
- member.getPath().toString().length());
- }
-
- // Write the (possibly compressed) member's content to the file.
- ARFile.write(data,fSize);
-
- // Make sure the member is an even length
- if ((ARFile.tellp() & 1) == 1)
- ARFile << ARFILE_PAD;
-
- // Close the mapped file if it was opened
- delete mFile;
- return false;
-}
-
-// Write out the LLVM symbol table as an archive member to the file.
-void
-Archive::writeSymbolTable(std::ofstream& ARFile) {
-
- // Construct the symbol table's header
- ArchiveMemberHeader Hdr;
- Hdr.init();
- memcpy(Hdr.name,ARFILE_LLVM_SYMTAB_NAME,16);
- uint64_t secondsSinceEpoch = sys::TimeValue::now().toEpochTime();
- char buffer[32];
- sprintf(buffer, "%-8o", 0644);
- memcpy(Hdr.mode,buffer,8);
- sprintf(buffer, "%-6u", sys::Process::GetCurrentUserId());
- memcpy(Hdr.uid,buffer,6);
- sprintf(buffer, "%-6u", sys::Process::GetCurrentGroupId());
- memcpy(Hdr.gid,buffer,6);
- sprintf(buffer,"%-12u", unsigned(secondsSinceEpoch));
- memcpy(Hdr.date,buffer,12);
- sprintf(buffer,"%-10u",symTabSize);
- memcpy(Hdr.size,buffer,10);
-
- // Write the header
- ARFile.write((char*)&Hdr, sizeof(Hdr));
-
- // Save the starting position of the symbol tables data content.
- unsigned startpos = ARFile.tellp();
-
- // Write out the symbols sequentially
- for ( Archive::SymTabType::iterator I = symTab.begin(), E = symTab.end();
- I != E; ++I)
- {
- // Write out the file index
- writeInteger(I->second, ARFile);
- // Write out the length of the symbol
- writeInteger(I->first.length(), ARFile);
- // Write out the symbol
- ARFile.write(I->first.data(), I->first.length());
- }
-
- // Now that we're done with the symbol table, get the ending file position
- unsigned endpos = ARFile.tellp();
-
- // Make sure that the amount we wrote is what we pre-computed. This is
- // critical for file integrity purposes.
- assert(endpos - startpos == symTabSize && "Invalid symTabSize computation");
-
- // Make sure the symbol table is even sized
- if (symTabSize % 2 != 0 )
- ARFile << ARFILE_PAD;
-}
-
-// Write the entire archive to the file specified when the archive was created.
-// This writes to a temporary file first. Options are for creating a symbol
-// table, flattening the file names (no directories, 15 chars max) and
-// compressing each archive member.
-bool
-Archive::writeToDisk(bool CreateSymbolTable, bool TruncateNames, bool Compress,
- std::string* ErrMsg)
-{
- // Make sure they haven't opened up the file, not loaded it,
- // but are now trying to write it which would wipe out the file.
- if (members.empty() && mapfile && mapfile->getBufferSize() > 8) {
- if (ErrMsg)
- *ErrMsg = "Can't write an archive not opened for writing";
- return true;
- }
-
- // Create a temporary file to store the archive in
- sys::Path TmpArchive = archPath;
- if (TmpArchive.createTemporaryFileOnDisk(ErrMsg))
- return true;
-
- // Make sure the temporary gets removed if we crash
- sys::RemoveFileOnSignal(TmpArchive);
-
- // Create archive file for output.
- std::ios::openmode io_mode = std::ios::out | std::ios::trunc |
- std::ios::binary;
- std::ofstream ArchiveFile(TmpArchive.c_str(), io_mode);
-
- // Check for errors opening or creating archive file.
- if (!ArchiveFile.is_open() || ArchiveFile.bad()) {
- if (TmpArchive.exists())
- TmpArchive.eraseFromDisk();
- if (ErrMsg)
- *ErrMsg = "Error opening archive file: " + archPath.toString();
- return true;
- }
-
- // If we're creating a symbol table, reset it now
- if (CreateSymbolTable) {
- symTabSize = 0;
- symTab.clear();
- }
-
- // Write magic string to archive.
- ArchiveFile << ARFILE_MAGIC;
-
- // Loop over all member files, and write them out. Note that this also
- // builds the symbol table, symTab.
- for (MembersList::iterator I = begin(), E = end(); I != E; ++I) {
- if (writeMember(*I, ArchiveFile, CreateSymbolTable,
- TruncateNames, Compress, ErrMsg)) {
- if (TmpArchive.exists())
- TmpArchive.eraseFromDisk();
- ArchiveFile.close();
- return true;
- }
- }
-
- // Close archive file.
- ArchiveFile.close();
-
- // Write the symbol table
- if (CreateSymbolTable) {
- // At this point we have written a file that is a legal archive but it
- // doesn't have a symbol table in it. To aid in faster reading and to
- // ensure compatibility with other archivers we need to put the symbol
- // table first in the file. Unfortunately, this means mapping the file
- // we just wrote back in and copying it to the destination file.
- sys::Path FinalFilePath = archPath;
-
- // Map in the archive we just wrote.
- {
- OwningPtr<MemoryBuffer> arch(MemoryBuffer::getFile(TmpArchive.c_str()));
- if (arch == 0) return true;
- const char* base = arch->getBufferStart();
-
- // Open another temporary file in order to avoid invalidating the
- // mmapped data
- if (FinalFilePath.createTemporaryFileOnDisk(ErrMsg))
- return true;
- sys::RemoveFileOnSignal(FinalFilePath);
-
- std::ofstream FinalFile(FinalFilePath.c_str(), io_mode);
- if (!FinalFile.is_open() || FinalFile.bad()) {
- if (TmpArchive.exists())
- TmpArchive.eraseFromDisk();
- if (ErrMsg)
- *ErrMsg = "Error opening archive file: " + FinalFilePath.toString();
- return true;
- }
-
- // Write the file magic number
- FinalFile << ARFILE_MAGIC;
-
- // If there is a foreign symbol table, put it into the file now. Most
- // ar(1) implementations require the symbol table to be first but llvm-ar
- // can deal with it being after a foreign symbol table. This ensures
- // compatibility with other ar(1) implementations as well as allowing the
- // archive to store both native .o and LLVM .bc files, both indexed.
- if (foreignST) {
- if (writeMember(*foreignST, FinalFile, false, false, false, ErrMsg)) {
- FinalFile.close();
- if (TmpArchive.exists())
- TmpArchive.eraseFromDisk();
- return true;
- }
- }
-
- // Put out the LLVM symbol table now.
- writeSymbolTable(FinalFile);
-
- // Copy the temporary file contents being sure to skip the file's magic
- // number.
- FinalFile.write(base + sizeof(ARFILE_MAGIC)-1,
- arch->getBufferSize()-sizeof(ARFILE_MAGIC)+1);
-
- // Close up shop
- FinalFile.close();
- } // free arch.
-
- // Move the final file over top of TmpArchive
- if (FinalFilePath.renamePathOnDisk(TmpArchive, ErrMsg))
- return true;
- }
-
- // Before we replace the actual archive, we need to forget all the
- // members, since they point to data in that old archive. We need to do
- // this because we cannot replace an open file on Windows.
- cleanUpMemory();
-
- if (TmpArchive.renamePathOnDisk(archPath, ErrMsg))
- return true;
-
- return false;
-}
diff --git a/release_23/lib/Archive/Makefile b/release_23/lib/Archive/Makefile
deleted file mode 100644
index e951aa3e0b16..000000000000
--- a/release_23/lib/Archive/Makefile
+++ /dev/null
@@ -1,17 +0,0 @@
-##===- lib/Archive/Makefile --------------------------------*- Makefile -*-===##
-#
-# The LLVM Compiler Infrastructure
-#
-# This file is distributed under the University of Illinois Open Source
-# License. See LICENSE.TXT for details.
-#
-##===----------------------------------------------------------------------===##
-
-LEVEL = ../..
-LIBRARYNAME = LLVMArchive
-
-# We only want an archive so only those modules actually used by a tool are
-# included.
-BUILD_ARCHIVE := 1
-
-include $(LEVEL)/Makefile.common
diff --git a/release_23/lib/AsmParser/LLLexer.cpp b/release_23/lib/AsmParser/LLLexer.cpp
deleted file mode 100644
index f78079b60626..000000000000
--- a/release_23/lib/AsmParser/LLLexer.cpp
+++ /dev/null
@@ -1,844 +0,0 @@
-//===- LLLexer.cpp - Lexer for .ll Files ----------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// Implement the Lexer for .ll files.
-//
-//===----------------------------------------------------------------------===//
-
-#include "LLLexer.h"
-#include "ParserInternals.h"
-#include "llvm/Support/MemoryBuffer.h"
-#include "llvm/Support/MathExtras.h"
-
-#include <list>
-#include "llvmAsmParser.h"
-
-#include <cstring>
-using namespace llvm;
-
-//===----------------------------------------------------------------------===//
-// Helper functions.
-//===----------------------------------------------------------------------===//
-
-// atoull - Convert an ascii string of decimal digits into the unsigned long
-// long representation... this does not have to do input error checking,
-// because we know that the input will be matched by a suitable regex...
-//
-static uint64_t atoull(const char *Buffer, const char *End) {
- uint64_t Result = 0;
- for (; Buffer != End; Buffer++) {
- uint64_t OldRes = Result;
- Result *= 10;
- Result += *Buffer-'0';
- if (Result < OldRes) { // Uh, oh, overflow detected!!!
- GenerateError("constant bigger than 64 bits detected!");
- return 0;
- }
- }
- return Result;
-}
-
-static uint64_t HexIntToVal(const char *Buffer, const char *End) {
- uint64_t Result = 0;
- for (; Buffer != End; ++Buffer) {
- uint64_t OldRes = Result;
- Result *= 16;
- char C = *Buffer;
- if (C >= '0' && C <= '9')
- Result += C-'0';
- else if (C >= 'A' && C <= 'F')
- Result += C-'A'+10;
- else if (C >= 'a' && C <= 'f')
- Result += C-'a'+10;
-
- if (Result < OldRes) { // Uh, oh, overflow detected!!!
- GenerateError("constant bigger than 64 bits detected!");
- return 0;
- }
- }
- return Result;
-}
-
-// HexToFP - Convert the ascii string in hexadecimal format to the floating
-// point representation of it.
-//
-static double HexToFP(const char *Buffer, const char *End) {
- return BitsToDouble(HexIntToVal(Buffer, End)); // Cast Hex constant to double
-}
-
-static void HexToIntPair(const char *Buffer, const char *End, uint64_t Pair[2]){
- Pair[0] = 0;
- for (int i=0; i<16; i++, Buffer++) {
- assert(Buffer != End);
- Pair[0] *= 16;
- char C = *Buffer;
- if (C >= '0' && C <= '9')
- Pair[0] += C-'0';
- else if (C >= 'A' && C <= 'F')
- Pair[0] += C-'A'+10;
- else if (C >= 'a' && C <= 'f')
- Pair[0] += C-'a'+10;
- }
- Pair[1] = 0;
- for (int i=0; i<16 && Buffer != End; i++, Buffer++) {
- Pair[1] *= 16;
- char C = *Buffer;
- if (C >= '0' && C <= '9')
- Pair[1] += C-'0';
- else if (C >= 'A' && C <= 'F')
- Pair[1] += C-'A'+10;
- else if (C >= 'a' && C <= 'f')
- Pair[1] += C-'a'+10;
- }
- if (Buffer != End)
- GenerateError("constant bigger than 128 bits detected!");
-}
-
-// UnEscapeLexed - Run through the specified buffer and change \xx codes to the
-// appropriate character.
-static void UnEscapeLexed(std::string &Str) {
- if (Str.empty()) return;
-
- char *Buffer = &Str[0], *EndBuffer = Buffer+Str.size();
- char *BOut = Buffer;
- for (char *BIn = Buffer; BIn != EndBuffer; ) {
- if (BIn[0] == '\\') {
- if (BIn < EndBuffer-1 && BIn[1] == '\\') {
- *BOut++ = '\\'; // Two \ becomes one
- BIn += 2;
- } else if (BIn < EndBuffer-2 && isxdigit(BIn[1]) && isxdigit(BIn[2])) {
- char Tmp = BIn[3]; BIn[3] = 0; // Terminate string
- *BOut = (char)strtol(BIn+1, 0, 16); // Convert to number
- BIn[3] = Tmp; // Restore character
- BIn += 3; // Skip over handled chars
- ++BOut;
- } else {
- *BOut++ = *BIn++;
- }
- } else {
- *BOut++ = *BIn++;
- }
- }
- Str.resize(BOut-Buffer);
-}
-
-/// isLabelChar - Return true for [-a-zA-Z$._0-9].
-static bool isLabelChar(char C) {
- return isalnum(C) || C == '-' || C == '$' || C == '.' || C == '_';
-}
-
-
-/// isLabelTail - Return true if this pointer points to a valid end of a label.
-static const char *isLabelTail(const char *CurPtr) {
- while (1) {
- if (CurPtr[0] == ':') return CurPtr+1;
- if (!isLabelChar(CurPtr[0])) return 0;
- ++CurPtr;
- }
-}
-
-
-
-//===----------------------------------------------------------------------===//
-// Lexer definition.
-//===----------------------------------------------------------------------===//
-
-// FIXME: REMOVE THIS.
-#define YYEOF 0
-#define YYERROR -2
-
-LLLexer::LLLexer(MemoryBuffer *StartBuf) : CurLineNo(1), CurBuf(StartBuf) {
- CurPtr = CurBuf->getBufferStart();
-}
-
-std::string LLLexer::getFilename() const {
- return CurBuf->getBufferIdentifier();
-}
-
-int LLLexer::getNextChar() {
- char CurChar = *CurPtr++;
- switch (CurChar) {
- default: return (unsigned char)CurChar;
- case 0:
- // A nul character in the stream is either the end of the current buffer or
- // a random nul in the file. Disambiguate that here.
- if (CurPtr-1 != CurBuf->getBufferEnd())
- return 0; // Just whitespace.
-
- // Otherwise, return end of file.
- --CurPtr; // Another call to lex will return EOF again.
- return EOF;
- case '\n':
- case '\r':
- // Handle the newline character by ignoring it and incrementing the line
- // count. However, be careful about 'dos style' files with \n\r in them.
- // Only treat a \n\r or \r\n as a single line.
- if ((*CurPtr == '\n' || (*CurPtr == '\r')) &&
- *CurPtr != CurChar)
- ++CurPtr; // Eat the two char newline sequence.
-
- ++CurLineNo;
- return '\n';
- }
-}
-
-
-int LLLexer::LexToken() {
- TokStart = CurPtr;
-
- int CurChar = getNextChar();
-
- switch (CurChar) {
- default:
- // Handle letters: [a-zA-Z_]
- if (isalpha(CurChar) || CurChar == '_')
- return LexIdentifier();
-
- return CurChar;
- case EOF: return YYEOF;
- case 0:
- case ' ':
- case '\t':
- case '\n':
- case '\r':
- // Ignore whitespace.
- return LexToken();
- case '+': return LexPositive();
- case '@': return LexAt();
- case '%': return LexPercent();
- case '"': return LexQuote();
- case '.':
- if (const char *Ptr = isLabelTail(CurPtr)) {
- CurPtr = Ptr;
- llvmAsmlval.StrVal = new std::string(TokStart, CurPtr-1);
- return LABELSTR;
- }
- if (CurPtr[0] == '.' && CurPtr[1] == '.') {
- CurPtr += 2;
- return DOTDOTDOT;
- }
- return '.';
- case '$':
- if (const char *Ptr = isLabelTail(CurPtr)) {
- CurPtr = Ptr;
- llvmAsmlval.StrVal = new std::string(TokStart, CurPtr-1);
- return LABELSTR;
- }
- return '$';
- case ';':
- SkipLineComment();
- return LexToken();
- case '0': case '1': case '2': case '3': case '4':
- case '5': case '6': case '7': case '8': case '9':
- case '-':
- return LexDigitOrNegative();
- }
-}
-
-void LLLexer::SkipLineComment() {
- while (1) {
- if (CurPtr[0] == '\n' || CurPtr[0] == '\r' || getNextChar() == EOF)
- return;
- }
-}
-
-/// LexAt - Lex all tokens that start with an @ character:
-/// AtStringConstant @\"[^\"]*\"
-/// GlobalVarName @[-a-zA-Z$._][-a-zA-Z$._0-9]*
-/// GlobalVarID @[0-9]+
-int LLLexer::LexAt() {
- // Handle AtStringConstant: @\"[^\"]*\"
- if (CurPtr[0] == '"') {
- ++CurPtr;
-
- while (1) {
- int CurChar = getNextChar();
-
- if (CurChar == EOF) {
- GenerateError("End of file in global variable name");
- return YYERROR;
- }
- if (CurChar == '"') {
- llvmAsmlval.StrVal = new std::string(TokStart+2, CurPtr-1);
- UnEscapeLexed(*llvmAsmlval.StrVal);
- return ATSTRINGCONSTANT;
- }
- }
- }
-
- // Handle GlobalVarName: @[-a-zA-Z$._][-a-zA-Z$._0-9]*
- if (isalpha(CurPtr[0]) || CurPtr[0] == '-' || CurPtr[0] == '$' ||
- CurPtr[0] == '.' || CurPtr[0] == '_') {
- ++CurPtr;
- while (isalnum(CurPtr[0]) || CurPtr[0] == '-' || CurPtr[0] == '$' ||
- CurPtr[0] == '.' || CurPtr[0] == '_')
- ++CurPtr;
-
- llvmAsmlval.StrVal = new std::string(TokStart+1, CurPtr); // Skip @
- return GLOBALVAR;
- }
-
- // Handle GlobalVarID: @[0-9]+
- if (isdigit(CurPtr[0])) {
- for (++CurPtr; isdigit(CurPtr[0]); ++CurPtr)
- /*empty*/;
-
- uint64_t Val = atoull(TokStart+1, CurPtr);
- if ((unsigned)Val != Val)
- GenerateError("Invalid value number (too large)!");
- llvmAsmlval.UIntVal = unsigned(Val);
- return GLOBALVAL_ID;
- }
-
- return '@';
-}
-
-
-/// LexPercent - Lex all tokens that start with a % character:
-/// PctStringConstant %\"[^\"]*\"
-/// LocalVarName %[-a-zA-Z$._][-a-zA-Z$._0-9]*
-/// LocalVarID %[0-9]+
-int LLLexer::LexPercent() {
- // Handle PctStringConstant: %\"[^\"]*\"
- if (CurPtr[0] == '"') {
- ++CurPtr;
-
- while (1) {
- int CurChar = getNextChar();
-
- if (CurChar == EOF) {
- GenerateError("End of file in local variable name");
- return YYERROR;
- }
- if (CurChar == '"') {
- llvmAsmlval.StrVal = new std::string(TokStart+2, CurPtr-1);
- UnEscapeLexed(*llvmAsmlval.StrVal);
- return PCTSTRINGCONSTANT;
- }
- }
- }
-
- // Handle LocalVarName: %[-a-zA-Z$._][-a-zA-Z$._0-9]*
- if (isalpha(CurPtr[0]) || CurPtr[0] == '-' || CurPtr[0] == '$' ||
- CurPtr[0] == '.' || CurPtr[0] == '_') {
- ++CurPtr;
- while (isalnum(CurPtr[0]) || CurPtr[0] == '-' || CurPtr[0] == '$' ||
- CurPtr[0] == '.' || CurPtr[0] == '_')
- ++CurPtr;
-
- llvmAsmlval.StrVal = new std::string(TokStart+1, CurPtr); // Skip %
- return LOCALVAR;
- }
-
- // Handle LocalVarID: %[0-9]+
- if (isdigit(CurPtr[0])) {
- for (++CurPtr; isdigit(CurPtr[0]); ++CurPtr)
- /*empty*/;
-
- uint64_t Val = atoull(TokStart+1, CurPtr);
- if ((unsigned)Val != Val)
- GenerateError("Invalid value number (too large)!");
- llvmAsmlval.UIntVal = unsigned(Val);
- return LOCALVAL_ID;
- }
-
- return '%';
-}
-
-/// LexQuote - Lex all tokens that start with a " character:
-/// QuoteLabel "[^"]+":
-/// StringConstant "[^"]*"
-int LLLexer::LexQuote() {
- while (1) {
- int CurChar = getNextChar();
-
- if (CurChar == EOF) {
- GenerateError("End of file in quoted string");
- return YYERROR;
- }
-
- if (CurChar != '"') continue;
-
- if (CurPtr[0] != ':') {
- llvmAsmlval.StrVal = new std::string(TokStart+1, CurPtr-1);
- UnEscapeLexed(*llvmAsmlval.StrVal);
- return STRINGCONSTANT;
- }
-
- ++CurPtr;
- llvmAsmlval.StrVal = new std::string(TokStart+1, CurPtr-2);
- UnEscapeLexed(*llvmAsmlval.StrVal);
- return LABELSTR;
- }
-}
-
-static bool JustWhitespaceNewLine(const char *&Ptr) {
- const char *ThisPtr = Ptr;
- while (*ThisPtr == ' ' || *ThisPtr == '\t')
- ++ThisPtr;
- if (*ThisPtr == '\n' || *ThisPtr == '\r') {
- Ptr = ThisPtr;
- return true;
- }
- return false;
-}
-
-
-/// LexIdentifier: Handle several related productions:
-/// Label [-a-zA-Z$._0-9]+:
-/// IntegerType i[0-9]+
-/// Keyword sdiv, float, ...
-/// HexIntConstant [us]0x[0-9A-Fa-f]+
-int LLLexer::LexIdentifier() {
- const char *StartChar = CurPtr;
- const char *IntEnd = CurPtr[-1] == 'i' ? 0 : StartChar;
- const char *KeywordEnd = 0;
-
- for (; isLabelChar(*CurPtr); ++CurPtr) {
- // If we decide this is an integer, remember the end of the sequence.
- if (!IntEnd && !isdigit(*CurPtr)) IntEnd = CurPtr;
- if (!KeywordEnd && !isalnum(*CurPtr) && *CurPtr != '_') KeywordEnd = CurPtr;
- }
-
- // If we stopped due to a colon, this really is a label.
- if (*CurPtr == ':') {
- llvmAsmlval.StrVal = new std::string(StartChar-1, CurPtr++);
- return LABELSTR;
- }
-
- // Otherwise, this wasn't a label. If this was valid as an integer type,
- // return it.
- if (IntEnd == 0) IntEnd = CurPtr;
- if (IntEnd != StartChar) {
- CurPtr = IntEnd;
- uint64_t NumBits = atoull(StartChar, CurPtr);
- if (NumBits < IntegerType::MIN_INT_BITS ||
- NumBits > IntegerType::MAX_INT_BITS) {
- GenerateError("Bitwidth for integer type out of range!");
- return YYERROR;
- }
- const Type* Ty = IntegerType::get(NumBits);
- llvmAsmlval.PrimType = Ty;
- return INTTYPE;
- }
-
- // Otherwise, this was a letter sequence. See which keyword this is.
- if (KeywordEnd == 0) KeywordEnd = CurPtr;
- CurPtr = KeywordEnd;
- --StartChar;
- unsigned Len = CurPtr-StartChar;
-#define KEYWORD(STR, TOK) \
- if (Len == strlen(STR) && !memcmp(StartChar, STR, strlen(STR))) return TOK;
-
- KEYWORD("begin", BEGINTOK);
- KEYWORD("end", ENDTOK);
- KEYWORD("true", TRUETOK);
- KEYWORD("false", FALSETOK);
- KEYWORD("declare", DECLARE);
- KEYWORD("define", DEFINE);
- KEYWORD("global", GLOBAL);
- KEYWORD("constant", CONSTANT);
-
- KEYWORD("internal", INTERNAL);
- KEYWORD("linkonce", LINKONCE);
- KEYWORD("weak", WEAK);
- KEYWORD("appending", APPENDING);
- KEYWORD("dllimport", DLLIMPORT);
- KEYWORD("dllexport", DLLEXPORT);
- KEYWORD("hidden", HIDDEN);
- KEYWORD("protected", PROTECTED);
- KEYWORD("extern_weak", EXTERN_WEAK);
- KEYWORD("external", EXTERNAL);
- KEYWORD("thread_local", THREAD_LOCAL);
- KEYWORD("zeroinitializer", ZEROINITIALIZER);
- KEYWORD("undef", UNDEF);
- KEYWORD("null", NULL_TOK);
- KEYWORD("to", TO);
- KEYWORD("tail", TAIL);
- KEYWORD("target", TARGET);
- KEYWORD("triple", TRIPLE);
- KEYWORD("deplibs", DEPLIBS);
- KEYWORD("datalayout", DATALAYOUT);
- KEYWORD("volatile", VOLATILE);
- KEYWORD("align", ALIGN);
- KEYWORD("addrspace", ADDRSPACE);
- KEYWORD("section", SECTION);
- KEYWORD("alias", ALIAS);
- KEYWORD("module", MODULE);
- KEYWORD("asm", ASM_TOK);
- KEYWORD("sideeffect", SIDEEFFECT);
- KEYWORD("gc", GC);
-
- KEYWORD("cc", CC_TOK);
- KEYWORD("ccc", CCC_TOK);
- KEYWORD("fastcc", FASTCC_TOK);
- KEYWORD("coldcc", COLDCC_TOK);
- KEYWORD("x86_stdcallcc", X86_STDCALLCC_TOK);
- KEYWORD("x86_fastcallcc", X86_FASTCALLCC_TOK);
-
- KEYWORD("signext", SIGNEXT);
- KEYWORD("zeroext", ZEROEXT);
- KEYWORD("inreg", INREG);
- KEYWORD("sret", SRET);
- KEYWORD("nounwind", NOUNWIND);
- KEYWORD("noreturn", NORETURN);
- KEYWORD("noalias", NOALIAS);
- KEYWORD("byval", BYVAL);
- KEYWORD("nest", NEST);
- KEYWORD("readnone", READNONE);
- KEYWORD("readonly", READONLY);
-
- KEYWORD("type", TYPE);
- KEYWORD("opaque", OPAQUE);
-
- KEYWORD("eq" , EQ);
- KEYWORD("ne" , NE);
- KEYWORD("slt", SLT);
- KEYWORD("sgt", SGT);
- KEYWORD("sle", SLE);
- KEYWORD("sge", SGE);
- KEYWORD("ult", ULT);
- KEYWORD("ugt", UGT);
- KEYWORD("ule", ULE);
- KEYWORD("uge", UGE);
- KEYWORD("oeq", OEQ);
- KEYWORD("one", ONE);
- KEYWORD("olt", OLT);
- KEYWORD("ogt", OGT);
- KEYWORD("ole", OLE);
- KEYWORD("oge", OGE);
- KEYWORD("ord", ORD);
- KEYWORD("uno", UNO);
- KEYWORD("ueq", UEQ);
- KEYWORD("une", UNE);
-#undef KEYWORD
-
- // Keywords for types.
-#define TYPEKEYWORD(STR, LLVMTY, TOK) \
- if (Len == strlen(STR) && !memcmp(StartChar, STR, strlen(STR))) { \
- llvmAsmlval.PrimType = LLVMTY; return TOK; }
- TYPEKEYWORD("void", Type::VoidTy, VOID);
- TYPEKEYWORD("float", Type::FloatTy, FLOAT);
- TYPEKEYWORD("double", Type::DoubleTy, DOUBLE);
- TYPEKEYWORD("x86_fp80", Type::X86_FP80Ty, X86_FP80);
- TYPEKEYWORD("fp128", Type::FP128Ty, FP128);
- TYPEKEYWORD("ppc_fp128", Type::PPC_FP128Ty, PPC_FP128);
- TYPEKEYWORD("label", Type::LabelTy, LABEL);
-#undef TYPEKEYWORD
-
- // Handle special forms for autoupgrading. Drop these in LLVM 3.0. This is
- // to avoid conflicting with the sext/zext instructions, below.
- if (Len == 4 && !memcmp(StartChar, "sext", 4)) {
- // Scan CurPtr ahead, seeing if there is just whitespace before the newline.
- if (JustWhitespaceNewLine(CurPtr))
- return SIGNEXT;
- } else if (Len == 4 && !memcmp(StartChar, "zext", 4)) {
- // Scan CurPtr ahead, seeing if there is just whitespace before the newline.
- if (JustWhitespaceNewLine(CurPtr))
- return ZEROEXT;
- }
-
- // Keywords for instructions.
-#define INSTKEYWORD(STR, type, Enum, TOK) \
- if (Len == strlen(STR) && !memcmp(StartChar, STR, strlen(STR))) { \
- llvmAsmlval.type = Instruction::Enum; return TOK; }
-
- INSTKEYWORD("add", BinaryOpVal, Add, ADD);
- INSTKEYWORD("sub", BinaryOpVal, Sub, SUB);
- INSTKEYWORD("mul", BinaryOpVal, Mul, MUL);
- INSTKEYWORD("udiv", BinaryOpVal, UDiv, UDIV);
- INSTKEYWORD("sdiv", BinaryOpVal, SDiv, SDIV);
- INSTKEYWORD("fdiv", BinaryOpVal, FDiv, FDIV);
- INSTKEYWORD("urem", BinaryOpVal, URem, UREM);
- INSTKEYWORD("srem", BinaryOpVal, SRem, SREM);
- INSTKEYWORD("frem", BinaryOpVal, FRem, FREM);
- INSTKEYWORD("shl", BinaryOpVal, Shl, SHL);
- INSTKEYWORD("lshr", BinaryOpVal, LShr, LSHR);
- INSTKEYWORD("ashr", BinaryOpVal, AShr, ASHR);
- INSTKEYWORD("and", BinaryOpVal, And, AND);
- INSTKEYWORD("or", BinaryOpVal, Or , OR );
- INSTKEYWORD("xor", BinaryOpVal, Xor, XOR);
- INSTKEYWORD("icmp", OtherOpVal, ICmp, ICMP);
- INSTKEYWORD("fcmp", OtherOpVal, FCmp, FCMP);
-
- INSTKEYWORD("phi", OtherOpVal, PHI, PHI_TOK);
- INSTKEYWORD("call", OtherOpVal, Call, CALL);
- INSTKEYWORD("trunc", CastOpVal, Trunc, TRUNC);
- INSTKEYWORD("zext", CastOpVal, ZExt, ZEXT);
- INSTKEYWORD("sext", CastOpVal, SExt, SEXT);
- INSTKEYWORD("fptrunc", CastOpVal, FPTrunc, FPTRUNC);
- INSTKEYWORD("fpext", CastOpVal, FPExt, FPEXT);
- INSTKEYWORD("uitofp", CastOpVal, UIToFP, UITOFP);
- INSTKEYWORD("sitofp", CastOpVal, SIToFP, SITOFP);
- INSTKEYWORD("fptoui", CastOpVal, FPToUI, FPTOUI);
- INSTKEYWORD("fptosi", CastOpVal, FPToSI, FPTOSI);
- INSTKEYWORD("inttoptr", CastOpVal, IntToPtr, INTTOPTR);
- INSTKEYWORD("ptrtoint", CastOpVal, PtrToInt, PTRTOINT);
- INSTKEYWORD("bitcast", CastOpVal, BitCast, BITCAST);
- INSTKEYWORD("select", OtherOpVal, Select, SELECT);
- INSTKEYWORD("va_arg", OtherOpVal, VAArg , VAARG);
- INSTKEYWORD("ret", TermOpVal, Ret, RET);
- INSTKEYWORD("br", TermOpVal, Br, BR);
- INSTKEYWORD("switch", TermOpVal, Switch, SWITCH);
- INSTKEYWORD("invoke", TermOpVal, Invoke, INVOKE);
- INSTKEYWORD("unwind", TermOpVal, Unwind, UNWIND);
- INSTKEYWORD("unreachable", TermOpVal, Unreachable, UNREACHABLE);
-
- INSTKEYWORD("malloc", MemOpVal, Malloc, MALLOC);
- INSTKEYWORD("alloca", MemOpVal, Alloca, ALLOCA);
- INSTKEYWORD("free", MemOpVal, Free, FREE);
- INSTKEYWORD("load", MemOpVal, Load, LOAD);
- INSTKEYWORD("store", MemOpVal, Store, STORE);
- INSTKEYWORD("getelementptr", MemOpVal, GetElementPtr, GETELEMENTPTR);
-
- INSTKEYWORD("extractelement", OtherOpVal, ExtractElement, EXTRACTELEMENT);
- INSTKEYWORD("insertelement", OtherOpVal, InsertElement, INSERTELEMENT);
- INSTKEYWORD("shufflevector", OtherOpVal, ShuffleVector, SHUFFLEVECTOR);
- INSTKEYWORD("getresult", OtherOpVal, GetResult, GETRESULT);
-#undef INSTKEYWORD
-
- // Check for [us]0x[0-9A-Fa-f]+ which are Hexadecimal constant generated by
- // the CFE to avoid forcing it to deal with 64-bit numbers.
- if ((TokStart[0] == 'u' || TokStart[0] == 's') &&
- TokStart[1] == '0' && TokStart[2] == 'x' && isxdigit(TokStart[3])) {
- int len = CurPtr-TokStart-3;
- uint32_t bits = len * 4;
- APInt Tmp(bits, TokStart+3, len, 16);
- uint32_t activeBits = Tmp.getActiveBits();
- if (activeBits > 0 && activeBits < bits)
- Tmp.trunc(activeBits);
- if (Tmp.getBitWidth() > 64) {
- llvmAsmlval.APIntVal = new APInt(Tmp);
- return TokStart[0] == 's' ? ESAPINTVAL : EUAPINTVAL;
- } else if (TokStart[0] == 's') {
- llvmAsmlval.SInt64Val = Tmp.getSExtValue();
- return ESINT64VAL;
- } else {
- llvmAsmlval.UInt64Val = Tmp.getZExtValue();
- return EUINT64VAL;
- }
- }
-
- // If this is "cc1234", return this as just "cc".
- if (TokStart[0] == 'c' && TokStart[1] == 'c') {
- CurPtr = TokStart+2;
- return CC_TOK;
- }
-
- // If this starts with "call", return it as CALL. This is to support old
- // broken .ll files. FIXME: remove this with LLVM 3.0.
- if (CurPtr-TokStart > 4 && !memcmp(TokStart, "call", 4)) {
- CurPtr = TokStart+4;
- llvmAsmlval.OtherOpVal = Instruction::Call;
- return CALL;
- }
-
- // Finally, if this isn't known, return just a single character.
- CurPtr = TokStart+1;
- return TokStart[0];
-}
-
-
-/// Lex0x: Handle productions that start with 0x, knowing that it matches and
-/// that this is not a label:
-/// HexFPConstant 0x[0-9A-Fa-f]+
-/// HexFP80Constant 0xK[0-9A-Fa-f]+
-/// HexFP128Constant 0xL[0-9A-Fa-f]+
-/// HexPPC128Constant 0xM[0-9A-Fa-f]+
-int LLLexer::Lex0x() {
- CurPtr = TokStart + 2;
-
- char Kind;
- if (CurPtr[0] >= 'K' && CurPtr[0] <= 'M') {
- Kind = *CurPtr++;
- } else {
- Kind = 'J';
- }
-
- if (!isxdigit(CurPtr[0])) {
- // Bad token, return it as just zero.
- CurPtr = TokStart+1;
- return '0';
- }
-
- while (isxdigit(CurPtr[0]))
- ++CurPtr;
-
- if (Kind == 'J') {
- // HexFPConstant - Floating point constant represented in IEEE format as a
- // hexadecimal number for when exponential notation is not precise enough.
- // Float and double only.
- llvmAsmlval.FPVal = new APFloat(HexToFP(TokStart+2, CurPtr));
- return FPVAL;
- }
-
- uint64_t Pair[2];
- HexToIntPair(TokStart+3, CurPtr, Pair);
- switch (Kind) {
- default: assert(0 && "Unknown kind!");
- case 'K':
- // F80HexFPConstant - x87 long double in hexadecimal format (10 bytes)
- llvmAsmlval.FPVal = new APFloat(APInt(80, 2, Pair));
- return FPVAL;
- case 'L':
- // F128HexFPConstant - IEEE 128-bit in hexadecimal format (16 bytes)
- llvmAsmlval.FPVal = new APFloat(APInt(128, 2, Pair), true);
- return FPVAL;
- case 'M':
- // PPC128HexFPConstant - PowerPC 128-bit in hexadecimal format (16 bytes)
- llvmAsmlval.FPVal = new APFloat(APInt(128, 2, Pair));
- return FPVAL;
- }
-}
-
-/// LexIdentifier: Handle several related productions:
-/// Label [-a-zA-Z$._0-9]+:
-/// NInteger -[0-9]+
-/// FPConstant [-+]?[0-9]+[.][0-9]*([eE][-+]?[0-9]+)?
-/// PInteger [0-9]+
-/// HexFPConstant 0x[0-9A-Fa-f]+
-/// HexFP80Constant 0xK[0-9A-Fa-f]+
-/// HexFP128Constant 0xL[0-9A-Fa-f]+
-/// HexPPC128Constant 0xM[0-9A-Fa-f]+
-int LLLexer::LexDigitOrNegative() {
- // If the letter after the negative is a number, this is probably a label.
- if (!isdigit(TokStart[0]) && !isdigit(CurPtr[0])) {
- // Okay, this is not a number after the -, it's probably a label.
- if (const char *End = isLabelTail(CurPtr)) {
- llvmAsmlval.StrVal = new std::string(TokStart, End-1);
- CurPtr = End;
- return LABELSTR;
- }
-
- return CurPtr[-1];
- }
-
- // At this point, it is either a label, int or fp constant.
-
- // Skip digits, we have at least one.
- for (; isdigit(CurPtr[0]); ++CurPtr)
- /*empty*/;
-
- // Check to see if this really is a label afterall, e.g. "-1:".
- if (isLabelChar(CurPtr[0]) || CurPtr[0] == ':') {
- if (const char *End = isLabelTail(CurPtr)) {
- llvmAsmlval.StrVal = new std::string(TokStart, End-1);
- CurPtr = End;
- return LABELSTR;
- }
- }
-
- // If the next character is a '.', then it is a fp value, otherwise its
- // integer.
- if (CurPtr[0] != '.') {
- if (TokStart[0] == '0' && TokStart[1] == 'x')
- return Lex0x();
- unsigned Len = CurPtr-TokStart;
- uint32_t numBits = ((Len * 64) / 19) + 2;
- APInt Tmp(numBits, TokStart, Len, 10);
- if (TokStart[0] == '-') {
- uint32_t minBits = Tmp.getMinSignedBits();
- if (minBits > 0 && minBits < numBits)
- Tmp.trunc(minBits);
- if (Tmp.getBitWidth() > 64) {
- llvmAsmlval.APIntVal = new APInt(Tmp);
- return ESAPINTVAL;
- } else {
- llvmAsmlval.SInt64Val = Tmp.getSExtValue();
- return ESINT64VAL;
- }
- } else {
- uint32_t activeBits = Tmp.getActiveBits();
- if (activeBits > 0 && activeBits < numBits)
- Tmp.trunc(activeBits);
- if (Tmp.getBitWidth() > 64) {
- llvmAsmlval.APIntVal = new APInt(Tmp);
- return EUAPINTVAL;
- } else {
- llvmAsmlval.UInt64Val = Tmp.getZExtValue();
- return EUINT64VAL;
- }
- }
- }
-
- ++CurPtr;
-
- // Skip over [0-9]*([eE][-+]?[0-9]+)?
- while (isdigit(CurPtr[0])) ++CurPtr;
-
- if (CurPtr[0] == 'e' || CurPtr[0] == 'E') {
- if (isdigit(CurPtr[1]) ||
- ((CurPtr[1] == '-' || CurPtr[1] == '+') && isdigit(CurPtr[2]))) {
- CurPtr += 2;
- while (isdigit(CurPtr[0])) ++CurPtr;
- }
- }
-
- llvmAsmlval.FPVal = new APFloat(atof(TokStart));
- return FPVAL;
-}
-
-/// FPConstant [-+]?[0-9]+[.][0-9]*([eE][-+]?[0-9]+)?
-int LLLexer::LexPositive() {
- // If the letter after the negative is a number, this is probably not a
- // label.
- if (!isdigit(CurPtr[0]))
- return CurPtr[-1];
-
- // Skip digits.
- for (++CurPtr; isdigit(CurPtr[0]); ++CurPtr)
- /*empty*/;
-
- // At this point, we need a '.'.
- if (CurPtr[0] != '.') {
- CurPtr = TokStart+1;
- return TokStart[0];
- }
-
- ++CurPtr;
-
- // Skip over [0-9]*([eE][-+]?[0-9]+)?
- while (isdigit(CurPtr[0])) ++CurPtr;
-
- if (CurPtr[0] == 'e' || CurPtr[0] == 'E') {
- if (isdigit(CurPtr[1]) ||
- ((CurPtr[1] == '-' || CurPtr[1] == '+') && isdigit(CurPtr[2]))) {
- CurPtr += 2;
- while (isdigit(CurPtr[0])) ++CurPtr;
- }
- }
-
- llvmAsmlval.FPVal = new APFloat(atof(TokStart));
- return FPVAL;
-}
-
-
-//===----------------------------------------------------------------------===//
-// Define the interface to this file.
-//===----------------------------------------------------------------------===//
-
-static LLLexer *TheLexer;
-
-void InitLLLexer(llvm::MemoryBuffer *MB) {
- assert(TheLexer == 0 && "LL Lexer isn't reentrant yet");
- TheLexer = new LLLexer(MB);
-}
-
-int llvmAsmlex() {
- return TheLexer->LexToken();
-}
-const char *LLLgetTokenStart() { return TheLexer->getTokStart(); }
-unsigned LLLgetTokenLength() { return TheLexer->getTokLength(); }
-std::string LLLgetFilename() { return TheLexer->getFilename(); }
-unsigned LLLgetLineNo() { return TheLexer->getLineNo(); }
-
-void FreeLexer() {
- delete TheLexer;
- TheLexer = 0;
-}
diff --git a/release_23/lib/AsmParser/LLLexer.h b/release_23/lib/AsmParser/LLLexer.h
deleted file mode 100644
index 8b44b14cb741..000000000000
--- a/release_23/lib/AsmParser/LLLexer.h
+++ /dev/null
@@ -1,57 +0,0 @@
-//===- LLLexer.h - Lexer for LLVM Assembly Files ----------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This class represents the Lexer for .ll files.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LIB_ASMPARSER_LLLEXER_H
-#define LIB_ASMPARSER_LLLEXER_H
-
-#include <vector>
-#include <string>
-#include <iosfwd>
-
-namespace llvm {
- class MemoryBuffer;
-
- class LLLexer {
- const char *CurPtr;
- unsigned CurLineNo;
- MemoryBuffer *CurBuf;
-
- const char *TokStart;
-
- std::string TheError;
- public:
- explicit LLLexer(MemoryBuffer *StartBuf);
- ~LLLexer() {}
-
- const char *getTokStart() const { return TokStart; }
- unsigned getTokLength() const { return CurPtr-TokStart; }
- unsigned getLineNo() const { return CurLineNo; }
- std::string getFilename() const;
- int LexToken();
-
- const std::string getError() const { return TheError; }
-
- private:
- int getNextChar();
- void SkipLineComment();
- int LexIdentifier();
- int LexDigitOrNegative();
- int LexPositive();
- int LexAt();
- int LexPercent();
- int LexQuote();
- int Lex0x();
- };
-} // end namespace llvm
-
-#endif
diff --git a/release_23/lib/AsmParser/Makefile b/release_23/lib/AsmParser/Makefile
deleted file mode 100644
index 62e9c8707634..000000000000
--- a/release_23/lib/AsmParser/Makefile
+++ /dev/null
@@ -1,26 +0,0 @@
-##===- lib/AsmParser/Makefile ------------------------------*- Makefile -*-===##
-#
-# The LLVM Compiler Infrastructure
-#
-# This file is distributed under the University of Illinois Open Source
-# License. See LICENSE.TXT for details.
-#
-##===----------------------------------------------------------------------===##
-
-LEVEL = ../..
-LIBRARYNAME := LLVMAsmParser
-BUILD_ARCHIVE = 1
-EXTRA_DIST := llvmAsmParser.cpp.cvs llvmAsmParser.h.cvs llvmAsmParser.y.cvs
-
-include $(LEVEL)/Makefile.common
-
-# Disable -pedantic for this library, as bison output isn't necessarily
-# -pedantic clean.
-CompileCommonOpts := $(filter-out -pedantic,$(CompileCommonOpts))
-CompileCommonOpts := $(filter-out -Wno-long-long,$(CompileCommonOpts))
-
-#
-# Make the object code file for the lexer depend upon the header file generated
-# by the Bison parser. This prevents the Lexer from being compiled before the
-# header file it needs is built.
-$(ObjDir)/LLLexer.o: $(PROJ_SRC_DIR)/llvmAsmParser.h
diff --git a/release_23/lib/AsmParser/Parser.cpp b/release_23/lib/AsmParser/Parser.cpp
deleted file mode 100644
index 0005e11737b8..000000000000
--- a/release_23/lib/AsmParser/Parser.cpp
+++ /dev/null
@@ -1,90 +0,0 @@
-//===- Parser.cpp - Main dispatch module for the Parser library -------------===
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This library implements the functionality defined in llvm/assembly/parser.h
-//
-//===------------------------------------------------------------------------===
-
-#include "ParserInternals.h"
-#include "llvm/Module.h"
-#include "llvm/Support/MemoryBuffer.h"
-#include <cstring>
-using namespace llvm;
-
-
-ParseError* TheParseError = 0; /// FIXME: Not threading friendly
-
-Module *llvm::ParseAssemblyFile(const std::string &Filename, ParseError* Err) {
- std::string ErrorStr;
- MemoryBuffer *F = MemoryBuffer::getFileOrSTDIN(Filename.c_str(), &ErrorStr);
- if (F == 0) {
- if (Err)
- Err->setError(Filename, "Could not open input file '" + Filename + "'");
- return 0;
- }
-
- TheParseError = Err;
- Module *Result = RunVMAsmParser(F);
- delete F;
- return Result;
-}
-
-Module *llvm::ParseAssemblyString(const char *AsmString, Module *M,
- ParseError *Err) {
- TheParseError = Err;
- MemoryBuffer *F = MemoryBuffer::getMemBuffer(AsmString,
- AsmString+strlen(AsmString),
- "<string>");
- Module *Result = RunVMAsmParser(F);
- delete F;
- return Result;
-}
-
-
-//===------------------------------------------------------------------------===
-// ParseError Class
-//===------------------------------------------------------------------------===
-
-
-void ParseError::setError(const std::string &filename,
- const std::string &message,
- int lineNo, int colNo) {
- Filename = filename;
- Message = message;
- LineNo = lineNo;
- colNo = colNo;
-}
-
-ParseError::ParseError(const ParseError &E)
- : Filename(E.Filename), Message(E.Message) {
- LineNo = E.LineNo;
- ColumnNo = E.ColumnNo;
-}
-
-// Includes info from options
-const std::string ParseError::getMessage() const {
- std::string Result;
- char Buffer[10];
-
- if (Filename == "-")
- Result += "<stdin>";
- else
- Result += Filename;
-
- if (LineNo != -1) {
- sprintf(Buffer, "%d", LineNo);
- Result += std::string(":") + Buffer;
- if (ColumnNo != -1) {
- sprintf(Buffer, "%d", ColumnNo);
- Result += std::string(",") + Buffer;
- }
- }
-
- return Result + ": " + Message;
-}
diff --git a/release_23/lib/AsmParser/ParserInternals.h b/release_23/lib/AsmParser/ParserInternals.h
deleted file mode 100644
index 298dd8c19023..000000000000
--- a/release_23/lib/AsmParser/ParserInternals.h
+++ /dev/null
@@ -1,242 +0,0 @@
-//===-- ParserInternals.h - Definitions internal to the parser --*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This header file defines the various variables that are shared among the
-// different components of the parser...
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef PARSER_INTERNALS_H
-#define PARSER_INTERNALS_H
-
-#include "llvm/Constants.h"
-#include "llvm/DerivedTypes.h"
-#include "llvm/ParameterAttributes.h"
-#include "llvm/Function.h"
-#include "llvm/Instructions.h"
-#include "llvm/Assembly/Parser.h"
-#include "llvm/ADT/StringExtras.h"
-#include "llvm/ADT/APFloat.h"
-namespace llvm { class MemoryBuffer; }
-
-// Global variables exported from the lexer...
-
-extern llvm::ParseError* TheParseError; /// FIXME: Not threading friendly
-
-// functions exported from the lexer
-void InitLLLexer(llvm::MemoryBuffer *MB);
-const char *LLLgetTokenStart();
-unsigned LLLgetTokenLength();
-std::string LLLgetFilename();
-unsigned LLLgetLineNo();
-void FreeLexer();
-
-namespace llvm {
-class Module;
-
-// RunVMAsmParser - Parse a buffer and return Module
-Module *RunVMAsmParser(llvm::MemoryBuffer *MB);
-
-// GenerateError - Wrapper around the ParseException class that automatically
-// fills in file line number and column number and options info.
-//
-// This also helps me because I keep typing 'throw new ParseException' instead
-// of just 'throw ParseException'... sigh...
-//
-extern void GenerateError(const std::string &message, int LineNo = -1);
-
-/// InlineAsmDescriptor - This is a simple class that holds info about inline
-/// asm blocks, for use by ValID.
-struct InlineAsmDescriptor {
- std::string AsmString, Constraints;
- bool HasSideEffects;
-
- InlineAsmDescriptor(const std::string &as, const std::string &c, bool HSE)
- : AsmString(as), Constraints(c), HasSideEffects(HSE) {}
-};
-
-
-// ValID - Represents a reference of a definition of some sort. This may either
-// be a numeric reference or a symbolic (%var) reference. This is just a
-// discriminated union.
-//
-// Note that I can't implement this class in a straight forward manner with
-// constructors and stuff because it goes in a union.
-//
-struct ValID {
- enum {
- LocalID, GlobalID, LocalName, GlobalName,
- ConstSIntVal, ConstUIntVal, ConstFPVal, ConstNullVal,
- ConstUndefVal, ConstZeroVal, ConstantVal, InlineAsmVal
- } Type;
-
- union {
- unsigned Num; // If it's a numeric reference like %1234
- std::string *Name; // If it's a named reference. Memory must be deleted.
- int64_t ConstPool64; // Constant pool reference. This is the value
- uint64_t UConstPool64;// Unsigned constant pool reference.
- APFloat *ConstPoolFP; // Floating point constant pool reference
- Constant *ConstantValue; // Fully resolved constant for ConstantVal case.
- InlineAsmDescriptor *IAD;
- };
-
- static ValID createLocalID(unsigned Num) {
- ValID D; D.Type = LocalID; D.Num = Num; return D;
- }
- static ValID createGlobalID(unsigned Num) {
- ValID D; D.Type = GlobalID; D.Num = Num; return D;
- }
- static ValID createLocalName(const std::string &Name) {
- ValID D; D.Type = LocalName; D.Name = new std::string(Name); return D;
- }
- static ValID createGlobalName(const std::string &Name) {
- ValID D; D.Type = GlobalName; D.Name = new std::string(Name); return D;
- }
-
- static ValID create(int64_t Val) {
- ValID D; D.Type = ConstSIntVal; D.ConstPool64 = Val; return D;
- }
-
- static ValID create(uint64_t Val) {
- ValID D; D.Type = ConstUIntVal; D.UConstPool64 = Val; return D;
- }
-
- static ValID create(APFloat *Val) {
- ValID D; D.Type = ConstFPVal; D.ConstPoolFP = Val; return D;
- }
-
- static ValID createNull() {
- ValID D; D.Type = ConstNullVal; return D;
- }
-
- static ValID createUndef() {
- ValID D; D.Type = ConstUndefVal; return D;
- }
-
- static ValID createZeroInit() {
- ValID D; D.Type = ConstZeroVal; return D;
- }
-
- static ValID create(Constant *Val) {
- ValID D; D.Type = ConstantVal; D.ConstantValue = Val; return D;
- }
-
- static ValID createInlineAsm(const std::string &AsmString,
- const std::string &Constraints,
- bool HasSideEffects) {
- ValID D;
- D.Type = InlineAsmVal;
- D.IAD = new InlineAsmDescriptor(AsmString, Constraints, HasSideEffects);
- return D;
- }
-
- inline void destroy() const {
- if (Type == LocalName || Type == GlobalName)
- delete Name; // Free this strdup'd memory.
- else if (Type == InlineAsmVal)
- delete IAD;
- }
-
- inline ValID copy() const {
- if (Type != LocalName && Type != GlobalName) return *this;
- ValID Result = *this;
- Result.Name = new std::string(*Name);
- return Result;
- }
-
- inline std::string getName() const {
- switch (Type) {
- case LocalID : return '%' + utostr(Num);
- case GlobalID : return '@' + utostr(Num);
- case LocalName : return *Name;
- case GlobalName : return *Name;
- case ConstFPVal : return ftostr(*ConstPoolFP);
- case ConstNullVal : return "null";
- case ConstUndefVal : return "undef";
- case ConstZeroVal : return "zeroinitializer";
- case ConstUIntVal :
- case ConstSIntVal : return std::string("%") + itostr(ConstPool64);
- case ConstantVal:
- if (ConstantValue == ConstantInt::getTrue()) return "true";
- if (ConstantValue == ConstantInt::getFalse()) return "false";
- return "<constant expression>";
- default:
- assert(0 && "Unknown value!");
- abort();
- return "";
- }
- }
-
- bool operator<(const ValID &V) const {
- if (Type != V.Type) return Type < V.Type;
- switch (Type) {
- case LocalID:
- case GlobalID: return Num < V.Num;
- case LocalName:
- case GlobalName: return *Name < *V.Name;
- case ConstSIntVal: return ConstPool64 < V.ConstPool64;
- case ConstUIntVal: return UConstPool64 < V.UConstPool64;
- case ConstFPVal: return ConstPoolFP->compare(*V.ConstPoolFP) ==
- APFloat::cmpLessThan;
- case ConstNullVal: return false;
- case ConstUndefVal: return false;
- case ConstZeroVal: return false;
- case ConstantVal: return ConstantValue < V.ConstantValue;
- default: assert(0 && "Unknown value type!"); return false;
- }
- }
-
- bool operator==(const ValID &V) const {
- if (Type == V.Type) {
- switch (Type) {
- case LocalID:
- case GlobalID: return Num == V.Num;
- case LocalName:
- case GlobalName: return *Name == *(V.Name);
- case ConstSIntVal: return ConstPool64 == V.ConstPool64;
- case ConstUIntVal: return UConstPool64 == V.UConstPool64;
- case ConstFPVal: return ConstPoolFP->compare(*V.ConstPoolFP) ==
- APFloat::cmpEqual;
- case ConstantVal: return ConstantValue == V.ConstantValue;
- case ConstNullVal: return true;
- case ConstUndefVal: return true;
- case ConstZeroVal: return true;
- default: assert(0 && "Unknown value type!"); return false;
- }
- }
- return false;
- }
-};
-
-struct TypeWithAttrs {
- llvm::PATypeHolder *Ty;
- ParameterAttributes Attrs;
-};
-
-typedef std::vector<TypeWithAttrs> TypeWithAttrsList;
-
-struct ArgListEntry {
- ParameterAttributes Attrs;
- llvm::PATypeHolder *Ty;
- std::string *Name;
-};
-
-typedef std::vector<struct ArgListEntry> ArgListType;
-
-struct ParamListEntry {
- Value *Val;
- ParameterAttributes Attrs;
-};
-
-typedef std::vector<ParamListEntry> ParamList;
-
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/lib/AsmParser/llvmAsmParser.cpp.cvs b/release_23/lib/AsmParser/llvmAsmParser.cpp.cvs
deleted file mode 100644
index 6d924c4a7e82..000000000000
--- a/release_23/lib/AsmParser/llvmAsmParser.cpp.cvs
+++ /dev/null
@@ -1,6675 +0,0 @@
-/* A Bison parser, made by GNU Bison 2.3. */
-
-/* Skeleton implementation for Bison's Yacc-like parsers in C
-
- Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
- Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA. */
-
-/* As a special exception, you may create a larger work that contains
- part or all of the Bison parser skeleton and distribute that work
- under terms of your choice, so long as that work isn't itself a
- parser generator using the skeleton or a modified version thereof
- as a parser skeleton. Alternatively, if you modify or redistribute
- the parser skeleton itself, you may (at your option) remove this
- special exception, which will cause the skeleton and the resulting
- Bison output files to be licensed under the GNU General Public
- License without this special exception.
-
- This special exception was added by the Free Software Foundation in
- version 2.2 of Bison. */
-
-/* C LALR(1) parser skeleton written by Richard Stallman, by
- simplifying the original so-called "semantic" parser. */
-
-/* All symbols defined below should begin with yy or YY, to avoid
- infringing on user name space. This should be done even for local
- variables, as they might otherwise be expanded by user macros.
- There are some unavoidable exceptions within include files to
- define necessary library symbols; they are noted "INFRINGES ON
- USER NAME SPACE" below. */
-
-/* Identify Bison output. */
-#define YYBISON 1
-
-/* Bison version. */
-#define YYBISON_VERSION "2.3"
-
-/* Skeleton name. */
-#define YYSKELETON_NAME "yacc.c"
-
-/* Pure parsers. */
-#define YYPURE 0
-
-/* Using locations. */
-#define YYLSP_NEEDED 0
-
-/* Substitute the variable and function names. */
-#define yyparse llvmAsmparse
-#define yylex llvmAsmlex
-#define yyerror llvmAsmerror
-#define yylval llvmAsmlval
-#define yychar llvmAsmchar
-#define yydebug llvmAsmdebug
-#define yynerrs llvmAsmnerrs
-
-
-/* Tokens. */
-#ifndef YYTOKENTYPE
-# define YYTOKENTYPE
- /* Put the tokens into the symbol table, so that GDB and other debuggers
- know about them. */
- enum yytokentype {
- ESINT64VAL = 258,
- EUINT64VAL = 259,
- ESAPINTVAL = 260,
- EUAPINTVAL = 261,
- LOCALVAL_ID = 262,
- GLOBALVAL_ID = 263,
- FPVAL = 264,
- VOID = 265,
- INTTYPE = 266,
- FLOAT = 267,
- DOUBLE = 268,
- X86_FP80 = 269,
- FP128 = 270,
- PPC_FP128 = 271,
- LABEL = 272,
- TYPE = 273,
- LOCALVAR = 274,
- GLOBALVAR = 275,
- LABELSTR = 276,
- STRINGCONSTANT = 277,
- ATSTRINGCONSTANT = 278,
- PCTSTRINGCONSTANT = 279,
- ZEROINITIALIZER = 280,
- TRUETOK = 281,
- FALSETOK = 282,
- BEGINTOK = 283,
- ENDTOK = 284,
- DECLARE = 285,
- DEFINE = 286,
- GLOBAL = 287,
- CONSTANT = 288,
- SECTION = 289,
- ALIAS = 290,
- VOLATILE = 291,
- THREAD_LOCAL = 292,
- TO = 293,
- DOTDOTDOT = 294,
- NULL_TOK = 295,
- UNDEF = 296,
- INTERNAL = 297,
- LINKONCE = 298,
- WEAK = 299,
- APPENDING = 300,
- DLLIMPORT = 301,
- DLLEXPORT = 302,
- EXTERN_WEAK = 303,
- OPAQUE = 304,
- EXTERNAL = 305,
- TARGET = 306,
- TRIPLE = 307,
- ALIGN = 308,
- ADDRSPACE = 309,
- DEPLIBS = 310,
- CALL = 311,
- TAIL = 312,
- ASM_TOK = 313,
- MODULE = 314,
- SIDEEFFECT = 315,
- CC_TOK = 316,
- CCC_TOK = 317,
- FASTCC_TOK = 318,
- COLDCC_TOK = 319,
- X86_STDCALLCC_TOK = 320,
- X86_FASTCALLCC_TOK = 321,
- DATALAYOUT = 322,
- RET = 323,
- BR = 324,
- SWITCH = 325,
- INVOKE = 326,
- UNWIND = 327,
- UNREACHABLE = 328,
- ADD = 329,
- SUB = 330,
- MUL = 331,
- UDIV = 332,
- SDIV = 333,
- FDIV = 334,
- UREM = 335,
- SREM = 336,
- FREM = 337,
- AND = 338,
- OR = 339,
- XOR = 340,
- SHL = 341,
- LSHR = 342,
- ASHR = 343,
- ICMP = 344,
- FCMP = 345,
- EQ = 346,
- NE = 347,
- SLT = 348,
- SGT = 349,
- SLE = 350,
- SGE = 351,
- ULT = 352,
- UGT = 353,
- ULE = 354,
- UGE = 355,
- OEQ = 356,
- ONE = 357,
- OLT = 358,
- OGT = 359,
- OLE = 360,
- OGE = 361,
- ORD = 362,
- UNO = 363,
- UEQ = 364,
- UNE = 365,
- MALLOC = 366,
- ALLOCA = 367,
- FREE = 368,
- LOAD = 369,
- STORE = 370,
- GETELEMENTPTR = 371,
- TRUNC = 372,
- ZEXT = 373,
- SEXT = 374,
- FPTRUNC = 375,
- FPEXT = 376,
- BITCAST = 377,
- UITOFP = 378,
- SITOFP = 379,
- FPTOUI = 380,
- FPTOSI = 381,
- INTTOPTR = 382,
- PTRTOINT = 383,
- PHI_TOK = 384,
- SELECT = 385,
- VAARG = 386,
- EXTRACTELEMENT = 387,
- INSERTELEMENT = 388,
- SHUFFLEVECTOR = 389,
- GETRESULT = 390,
- SIGNEXT = 391,
- ZEROEXT = 392,
- NORETURN = 393,
- INREG = 394,
- SRET = 395,
- NOUNWIND = 396,
- NOALIAS = 397,
- BYVAL = 398,
- NEST = 399,
- READNONE = 400,
- READONLY = 401,
- GC = 402,
- DEFAULT = 403,
- HIDDEN = 404,
- PROTECTED = 405
- };
-#endif
-/* Tokens. */
-#define ESINT64VAL 258
-#define EUINT64VAL 259
-#define ESAPINTVAL 260
-#define EUAPINTVAL 261
-#define LOCALVAL_ID 262
-#define GLOBALVAL_ID 263
-#define FPVAL 264
-#define VOID 265
-#define INTTYPE 266
-#define FLOAT 267
-#define DOUBLE 268
-#define X86_FP80 269
-#define FP128 270
-#define PPC_FP128 271
-#define LABEL 272
-#define TYPE 273
-#define LOCALVAR 274
-#define GLOBALVAR 275
-#define LABELSTR 276
-#define STRINGCONSTANT 277
-#define ATSTRINGCONSTANT 278
-#define PCTSTRINGCONSTANT 279
-#define ZEROINITIALIZER 280
-#define TRUETOK 281
-#define FALSETOK 282
-#define BEGINTOK 283
-#define ENDTOK 284
-#define DECLARE 285
-#define DEFINE 286
-#define GLOBAL 287
-#define CONSTANT 288
-#define SECTION 289
-#define ALIAS 290
-#define VOLATILE 291
-#define THREAD_LOCAL 292
-#define TO 293
-#define DOTDOTDOT 294
-#define NULL_TOK 295
-#define UNDEF 296
-#define INTERNAL 297
-#define LINKONCE 298
-#define WEAK 299
-#define APPENDING 300
-#define DLLIMPORT 301
-#define DLLEXPORT 302
-#define EXTERN_WEAK 303
-#define OPAQUE 304
-#define EXTERNAL 305
-#define TARGET 306
-#define TRIPLE 307
-#define ALIGN 308
-#define ADDRSPACE 309
-#define DEPLIBS 310
-#define CALL 311
-#define TAIL 312
-#define ASM_TOK 313
-#define MODULE 314
-#define SIDEEFFECT 315
-#define CC_TOK 316
-#define CCC_TOK 317
-#define FASTCC_TOK 318
-#define COLDCC_TOK 319
-#define X86_STDCALLCC_TOK 320
-#define X86_FASTCALLCC_TOK 321
-#define DATALAYOUT 322
-#define RET 323
-#define BR 324
-#define SWITCH 325
-#define INVOKE 326
-#define UNWIND 327
-#define UNREACHABLE 328
-#define ADD 329
-#define SUB 330
-#define MUL 331
-#define UDIV 332
-#define SDIV 333
-#define FDIV 334
-#define UREM 335
-#define SREM 336
-#define FREM 337
-#define AND 338
-#define OR 339
-#define XOR 340
-#define SHL 341
-#define LSHR 342
-#define ASHR 343
-#define ICMP 344
-#define FCMP 345
-#define EQ 346
-#define NE 347
-#define SLT 348
-#define SGT 349
-#define SLE 350
-#define SGE 351
-#define ULT 352
-#define UGT 353
-#define ULE 354
-#define UGE 355
-#define OEQ 356
-#define ONE 357
-#define OLT 358
-#define OGT 359
-#define OLE 360
-#define OGE 361
-#define ORD 362
-#define UNO 363
-#define UEQ 364
-#define UNE 365
-#define MALLOC 366
-#define ALLOCA 367
-#define FREE 368
-#define LOAD 369
-#define STORE 370
-#define GETELEMENTPTR 371
-#define TRUNC 372
-#define ZEXT 373
-#define SEXT 374
-#define FPTRUNC 375
-#define FPEXT 376
-#define BITCAST 377
-#define UITOFP 378
-#define SITOFP 379
-#define FPTOUI 380
-#define FPTOSI 381
-#define INTTOPTR 382
-#define PTRTOINT 383
-#define PHI_TOK 384
-#define SELECT 385
-#define VAARG 386
-#define EXTRACTELEMENT 387
-#define INSERTELEMENT 388
-#define SHUFFLEVECTOR 389
-#define GETRESULT 390
-#define SIGNEXT 391
-#define ZEROEXT 392
-#define NORETURN 393
-#define INREG 394
-#define SRET 395
-#define NOUNWIND 396
-#define NOALIAS 397
-#define BYVAL 398
-#define NEST 399
-#define READNONE 400
-#define READONLY 401
-#define GC 402
-#define DEFAULT 403
-#define HIDDEN 404
-#define PROTECTED 405
-
-
-
-
-/* Copy the first part of user declarations. */
-#line 14 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
-
-#include "ParserInternals.h"
-#include "llvm/CallingConv.h"
-#include "llvm/InlineAsm.h"
-#include "llvm/Instructions.h"
-#include "llvm/Module.h"
-#include "llvm/ValueSymbolTable.h"
-#include "llvm/AutoUpgrade.h"
-#include "llvm/Support/GetElementPtrTypeIterator.h"
-#include "llvm/Support/CommandLine.h"
-#include "llvm/ADT/SmallVector.h"
-#include "llvm/ADT/STLExtras.h"
-#include "llvm/Support/MathExtras.h"
-#include "llvm/Support/Streams.h"
-#include <algorithm>
-#include <list>
-#include <map>
-#include <utility>
-
-// The following is a gross hack. In order to rid the libAsmParser library of
-// exceptions, we have to have a way of getting the yyparse function to go into
-// an error situation. So, whenever we want an error to occur, the GenerateError
-// function (see bottom of file) sets TriggerError. Then, at the end of each
-// production in the grammer we use CHECK_FOR_ERROR which will invoke YYERROR
-// (a goto) to put YACC in error state. Furthermore, several calls to
-// GenerateError are made from inside productions and they must simulate the
-// previous exception behavior by exiting the production immediately. We have
-// replaced these with the GEN_ERROR macro which calls GeneratError and then
-// immediately invokes YYERROR. This would be so much cleaner if it was a
-// recursive descent parser.
-static bool TriggerError = false;
-#define CHECK_FOR_ERROR { if (TriggerError) { TriggerError = false; YYABORT; } }
-#define GEN_ERROR(msg) { GenerateError(msg); YYERROR; }
-
-int yyerror(const char *ErrorMsg); // Forward declarations to prevent "implicit
-int yylex(); // declaration" of xxx warnings.
-int yyparse();
-using namespace llvm;
-
-static Module *ParserResult;
-
-// DEBUG_UPREFS - Define this symbol if you want to enable debugging output
-// relating to upreferences in the input stream.
-//
-//#define DEBUG_UPREFS 1
-#ifdef DEBUG_UPREFS
-#define UR_OUT(X) cerr << X
-#else
-#define UR_OUT(X)
-#endif
-
-#define YYERROR_VERBOSE 1
-
-static GlobalVariable *CurGV;
-
-
-// This contains info used when building the body of a function. It is
-// destroyed when the function is completed.
-//
-typedef std::vector<Value *> ValueList; // Numbered defs
-
-static void
-ResolveDefinitions(ValueList &LateResolvers, ValueList *FutureLateResolvers=0);
-
-static struct PerModuleInfo {
- Module *CurrentModule;
- ValueList Values; // Module level numbered definitions
- ValueList LateResolveValues;
- std::vector<PATypeHolder> Types;
- std::map<ValID, PATypeHolder> LateResolveTypes;
-
- /// PlaceHolderInfo - When temporary placeholder objects are created, remember
- /// how they were referenced and on which line of the input they came from so
- /// that we can resolve them later and print error messages as appropriate.
- std::map<Value*, std::pair<ValID, int> > PlaceHolderInfo;
-
- // GlobalRefs - This maintains a mapping between <Type, ValID>'s and forward
- // references to global values. Global values may be referenced before they
- // are defined, and if so, the temporary object that they represent is held
- // here. This is used for forward references of GlobalValues.
- //
- typedef std::map<std::pair<const PointerType *,
- ValID>, GlobalValue*> GlobalRefsType;
- GlobalRefsType GlobalRefs;
-
- void ModuleDone() {
- // If we could not resolve some functions at function compilation time
- // (calls to functions before they are defined), resolve them now... Types
- // are resolved when the constant pool has been completely parsed.
- //
- ResolveDefinitions(LateResolveValues);
- if (TriggerError)
- return;
-
- // Check to make sure that all global value forward references have been
- // resolved!
- //
- if (!GlobalRefs.empty()) {
- std::string UndefinedReferences = "Unresolved global references exist:\n";
-
- for (GlobalRefsType::iterator I = GlobalRefs.begin(), E =GlobalRefs.end();
- I != E; ++I) {
- UndefinedReferences += " " + I->first.first->getDescription() + " " +
- I->first.second.getName() + "\n";
- }
- GenerateError(UndefinedReferences);
- return;
- }
-
- // Look for intrinsic functions and CallInst that need to be upgraded
- for (Module::iterator FI = CurrentModule->begin(),
- FE = CurrentModule->end(); FI != FE; )
- UpgradeCallsToIntrinsic(FI++); // must be post-increment, as we remove
-
- Values.clear(); // Clear out function local definitions
- Types.clear();
- CurrentModule = 0;
- }
-
- // GetForwardRefForGlobal - Check to see if there is a forward reference
- // for this global. If so, remove it from the GlobalRefs map and return it.
- // If not, just return null.
- GlobalValue *GetForwardRefForGlobal(const PointerType *PTy, ValID ID) {
- // Check to see if there is a forward reference to this global variable...
- // if there is, eliminate it and patch the reference to use the new def'n.
- GlobalRefsType::iterator I = GlobalRefs.find(std::make_pair(PTy, ID));
- GlobalValue *Ret = 0;
- if (I != GlobalRefs.end()) {
- Ret = I->second;
- GlobalRefs.erase(I);
- }
- return Ret;
- }
-
- bool TypeIsUnresolved(PATypeHolder* PATy) {
- // If it isn't abstract, its resolved
- const Type* Ty = PATy->get();
- if (!Ty->isAbstract())
- return false;
- // Traverse the type looking for abstract types. If it isn't abstract then
- // we don't need to traverse that leg of the type.
- std::vector<const Type*> WorkList, SeenList;
- WorkList.push_back(Ty);
- while (!WorkList.empty()) {
- const Type* Ty = WorkList.back();
- SeenList.push_back(Ty);
- WorkList.pop_back();
- if (const OpaqueType* OpTy = dyn_cast<OpaqueType>(Ty)) {
- // Check to see if this is an unresolved type
- std::map<ValID, PATypeHolder>::iterator I = LateResolveTypes.begin();
- std::map<ValID, PATypeHolder>::iterator E = LateResolveTypes.end();
- for ( ; I != E; ++I) {
- if (I->second.get() == OpTy)
- return true;
- }
- } else if (const SequentialType* SeqTy = dyn_cast<SequentialType>(Ty)) {
- const Type* TheTy = SeqTy->getElementType();
- if (TheTy->isAbstract() && TheTy != Ty) {
- std::vector<const Type*>::iterator I = SeenList.begin(),
- E = SeenList.end();
- for ( ; I != E; ++I)
- if (*I == TheTy)
- break;
- if (I == E)
- WorkList.push_back(TheTy);
- }
- } else if (const StructType* StrTy = dyn_cast<StructType>(Ty)) {
- for (unsigned i = 0; i < StrTy->getNumElements(); ++i) {
- const Type* TheTy = StrTy->getElementType(i);
- if (TheTy->isAbstract() && TheTy != Ty) {
- std::vector<const Type*>::iterator I = SeenList.begin(),
- E = SeenList.end();
- for ( ; I != E; ++I)
- if (*I == TheTy)
- break;
- if (I == E)
- WorkList.push_back(TheTy);
- }
- }
- }
- }
- return false;
- }
-} CurModule;
-
-static struct PerFunctionInfo {
- Function *CurrentFunction; // Pointer to current function being created
-
- ValueList Values; // Keep track of #'d definitions
- unsigned NextValNum;
- ValueList LateResolveValues;
- bool isDeclare; // Is this function a forward declararation?
- GlobalValue::LinkageTypes Linkage; // Linkage for forward declaration.
- GlobalValue::VisibilityTypes Visibility;
-
- /// BBForwardRefs - When we see forward references to basic blocks, keep
- /// track of them here.
- std::map<ValID, BasicBlock*> BBForwardRefs;
-
- inline PerFunctionInfo() {
- CurrentFunction = 0;
- isDeclare = false;
- Linkage = GlobalValue::ExternalLinkage;
- Visibility = GlobalValue::DefaultVisibility;
- }
-
- inline void FunctionStart(Function *M) {
- CurrentFunction = M;
- NextValNum = 0;
- }
-
- void FunctionDone() {
- // Any forward referenced blocks left?
- if (!BBForwardRefs.empty()) {
- GenerateError("Undefined reference to label " +
- BBForwardRefs.begin()->second->getName());
- return;
- }
-
- // Resolve all forward references now.
- ResolveDefinitions(LateResolveValues, &CurModule.LateResolveValues);
-
- Values.clear(); // Clear out function local definitions
- BBForwardRefs.clear();
- CurrentFunction = 0;
- isDeclare = false;
- Linkage = GlobalValue::ExternalLinkage;
- Visibility = GlobalValue::DefaultVisibility;
- }
-} CurFun; // Info for the current function...
-
-static bool inFunctionScope() { return CurFun.CurrentFunction != 0; }
-
-
-//===----------------------------------------------------------------------===//
-// Code to handle definitions of all the types
-//===----------------------------------------------------------------------===//
-
-static void InsertValue(Value *V, ValueList &ValueTab = CurFun.Values) {
- // Things that have names or are void typed don't get slot numbers
- if (V->hasName() || (V->getType() == Type::VoidTy))
- return;
-
- // In the case of function values, we have to allow for the forward reference
- // of basic blocks, which are included in the numbering. Consequently, we keep
- // track of the next insertion location with NextValNum. When a BB gets
- // inserted, it could change the size of the CurFun.Values vector.
- if (&ValueTab == &CurFun.Values) {
- if (ValueTab.size() <= CurFun.NextValNum)
- ValueTab.resize(CurFun.NextValNum+1);
- ValueTab[CurFun.NextValNum++] = V;
- return;
- }
- // For all other lists, its okay to just tack it on the back of the vector.
- ValueTab.push_back(V);
-}
-
-static const Type *getTypeVal(const ValID &D, bool DoNotImprovise = false) {
- switch (D.Type) {
- case ValID::LocalID: // Is it a numbered definition?
- // Module constants occupy the lowest numbered slots...
- if (D.Num < CurModule.Types.size())
- return CurModule.Types[D.Num];
- break;
- case ValID::LocalName: // Is it a named definition?
- if (const Type *N = CurModule.CurrentModule->getTypeByName(D.getName())) {
- D.destroy(); // Free old strdup'd memory...
- return N;
- }
- break;
- default:
- GenerateError("Internal parser error: Invalid symbol type reference");
- return 0;
- }
-
- // If we reached here, we referenced either a symbol that we don't know about
- // or an id number that hasn't been read yet. We may be referencing something
- // forward, so just create an entry to be resolved later and get to it...
- //
- if (DoNotImprovise) return 0; // Do we just want a null to be returned?
-
-
- if (inFunctionScope()) {
- if (D.Type == ValID::LocalName) {
- GenerateError("Reference to an undefined type: '" + D.getName() + "'");
- return 0;
- } else {
- GenerateError("Reference to an undefined type: #" + utostr(D.Num));
- return 0;
- }
- }
-
- std::map<ValID, PATypeHolder>::iterator I =CurModule.LateResolveTypes.find(D);
- if (I != CurModule.LateResolveTypes.end())
- return I->second;
-
- Type *Typ = OpaqueType::get();
- CurModule.LateResolveTypes.insert(std::make_pair(D, Typ));
- return Typ;
- }
-
-// getExistingVal - Look up the value specified by the provided type and
-// the provided ValID. If the value exists and has already been defined, return
-// it. Otherwise return null.
-//
-static Value *getExistingVal(const Type *Ty, const ValID &D) {
- if (isa<FunctionType>(Ty)) {
- GenerateError("Functions are not values and "
- "must be referenced as pointers");
- return 0;
- }
-
- switch (D.Type) {
- case ValID::LocalID: { // Is it a numbered definition?
- // Check that the number is within bounds.
- if (D.Num >= CurFun.Values.size())
- return 0;
- Value *Result = CurFun.Values[D.Num];
- if (Ty != Result->getType()) {
- GenerateError("Numbered value (%" + utostr(D.Num) + ") of type '" +
- Result->getType()->getDescription() + "' does not match "
- "expected type, '" + Ty->getDescription() + "'");
- return 0;
- }
- return Result;
- }
- case ValID::GlobalID: { // Is it a numbered definition?
- if (D.Num >= CurModule.Values.size())
- return 0;
- Value *Result = CurModule.Values[D.Num];
- if (Ty != Result->getType()) {
- GenerateError("Numbered value (@" + utostr(D.Num) + ") of type '" +
- Result->getType()->getDescription() + "' does not match "
- "expected type, '" + Ty->getDescription() + "'");
- return 0;
- }
- return Result;
- }
-
- case ValID::LocalName: { // Is it a named definition?
- if (!inFunctionScope())
- return 0;
- ValueSymbolTable &SymTab = CurFun.CurrentFunction->getValueSymbolTable();
- Value *N = SymTab.lookup(D.getName());
- if (N == 0)
- return 0;
- if (N->getType() != Ty)
- return 0;
-
- D.destroy(); // Free old strdup'd memory...
- return N;
- }
- case ValID::GlobalName: { // Is it a named definition?
- ValueSymbolTable &SymTab = CurModule.CurrentModule->getValueSymbolTable();
- Value *N = SymTab.lookup(D.getName());
- if (N == 0)
- return 0;
- if (N->getType() != Ty)
- return 0;
-
- D.destroy(); // Free old strdup'd memory...
- return N;
- }
-
- // Check to make sure that "Ty" is an integral type, and that our
- // value will fit into the specified type...
- case ValID::ConstSIntVal: // Is it a constant pool reference??
- if (!isa<IntegerType>(Ty) ||
- !ConstantInt::isValueValidForType(Ty, D.ConstPool64)) {
- GenerateError("Signed integral constant '" +
- itostr(D.ConstPool64) + "' is invalid for type '" +
- Ty->getDescription() + "'");
- return 0;
- }
- return ConstantInt::get(Ty, D.ConstPool64, true);
-
- case ValID::ConstUIntVal: // Is it an unsigned const pool reference?
- if (isa<IntegerType>(Ty) &&
- ConstantInt::isValueValidForType(Ty, D.UConstPool64))
- return ConstantInt::get(Ty, D.UConstPool64);
-
- if (!isa<IntegerType>(Ty) ||
- !ConstantInt::isValueValidForType(Ty, D.ConstPool64)) {
- GenerateError("Integral constant '" + utostr(D.UConstPool64) +
- "' is invalid or out of range for type '" +
- Ty->getDescription() + "'");
- return 0;
- }
- // This is really a signed reference. Transmogrify.
- return ConstantInt::get(Ty, D.ConstPool64, true);
-
- case ValID::ConstFPVal: // Is it a floating point const pool reference?
- if (!Ty->isFloatingPoint() ||
- !ConstantFP::isValueValidForType(Ty, *D.ConstPoolFP)) {
- GenerateError("FP constant invalid for type");
- return 0;
- }
- // Lexer has no type info, so builds all float and double FP constants
- // as double. Fix this here. Long double does not need this.
- if (&D.ConstPoolFP->getSemantics() == &APFloat::IEEEdouble &&
- Ty==Type::FloatTy)
- D.ConstPoolFP->convert(APFloat::IEEEsingle, APFloat::rmNearestTiesToEven);
- return ConstantFP::get(*D.ConstPoolFP);
-
- case ValID::ConstNullVal: // Is it a null value?
- if (!isa<PointerType>(Ty)) {
- GenerateError("Cannot create a a non pointer null");
- return 0;
- }
- return ConstantPointerNull::get(cast<PointerType>(Ty));
-
- case ValID::ConstUndefVal: // Is it an undef value?
- return UndefValue::get(Ty);
-
- case ValID::ConstZeroVal: // Is it a zero value?
- return Constant::getNullValue(Ty);
-
- case ValID::ConstantVal: // Fully resolved constant?
- if (D.ConstantValue->getType() != Ty) {
- GenerateError("Constant expression type different from required type");
- return 0;
- }
- return D.ConstantValue;
-
- case ValID::InlineAsmVal: { // Inline asm expression
- const PointerType *PTy = dyn_cast<PointerType>(Ty);
- const FunctionType *FTy =
- PTy ? dyn_cast<FunctionType>(PTy->getElementType()) : 0;
- if (!FTy || !InlineAsm::Verify(FTy, D.IAD->Constraints)) {
- GenerateError("Invalid type for asm constraint string");
- return 0;
- }
- InlineAsm *IA = InlineAsm::get(FTy, D.IAD->AsmString, D.IAD->Constraints,
- D.IAD->HasSideEffects);
- D.destroy(); // Free InlineAsmDescriptor.
- return IA;
- }
- default:
- assert(0 && "Unhandled case!");
- return 0;
- } // End of switch
-
- assert(0 && "Unhandled case!");
- return 0;
-}
-
-// getVal - This function is identical to getExistingVal, except that if a
-// value is not already defined, it "improvises" by creating a placeholder var
-// that looks and acts just like the requested variable. When the value is
-// defined later, all uses of the placeholder variable are replaced with the
-// real thing.
-//
-static Value *getVal(const Type *Ty, const ValID &ID) {
- if (Ty == Type::LabelTy) {
- GenerateError("Cannot use a basic block here");
- return 0;
- }
-
- // See if the value has already been defined.
- Value *V = getExistingVal(Ty, ID);
- if (V) return V;
- if (TriggerError) return 0;
-
- if (!Ty->isFirstClassType() && !isa<OpaqueType>(Ty)) {
- GenerateError("Invalid use of a composite type");
- return 0;
- }
-
- // If we reached here, we referenced either a symbol that we don't know about
- // or an id number that hasn't been read yet. We may be referencing something
- // forward, so just create an entry to be resolved later and get to it...
- //
- switch (ID.Type) {
- case ValID::GlobalName:
- case ValID::GlobalID: {
- const PointerType *PTy = dyn_cast<PointerType>(Ty);
- if (!PTy) {
- GenerateError("Invalid type for reference to global" );
- return 0;
- }
- const Type* ElTy = PTy->getElementType();
- if (const FunctionType *FTy = dyn_cast<FunctionType>(ElTy))
- V = Function::Create(FTy, GlobalValue::ExternalLinkage);
- else
- V = new GlobalVariable(ElTy, false, GlobalValue::ExternalLinkage, 0, "",
- (Module*)0, false, PTy->getAddressSpace());
- break;
- }
- default:
- V = new Argument(Ty);
- }
-
- // Remember where this forward reference came from. FIXME, shouldn't we try
- // to recycle these things??
- CurModule.PlaceHolderInfo.insert(std::make_pair(V, std::make_pair(ID,
- LLLgetLineNo())));
-
- if (inFunctionScope())
- InsertValue(V, CurFun.LateResolveValues);
- else
- InsertValue(V, CurModule.LateResolveValues);
- return V;
-}
-
-/// defineBBVal - This is a definition of a new basic block with the specified
-/// identifier which must be the same as CurFun.NextValNum, if its numeric.
-static BasicBlock *defineBBVal(const ValID &ID) {
- assert(inFunctionScope() && "Can't get basic block at global scope!");
-
- BasicBlock *BB = 0;
-
- // First, see if this was forward referenced
-
- std::map<ValID, BasicBlock*>::iterator BBI = CurFun.BBForwardRefs.find(ID);
- if (BBI != CurFun.BBForwardRefs.end()) {
- BB = BBI->second;
- // The forward declaration could have been inserted anywhere in the
- // function: insert it into the correct place now.
- CurFun.CurrentFunction->getBasicBlockList().remove(BB);
- CurFun.CurrentFunction->getBasicBlockList().push_back(BB);
-
- // We're about to erase the entry, save the key so we can clean it up.
- ValID Tmp = BBI->first;
-
- // Erase the forward ref from the map as its no longer "forward"
- CurFun.BBForwardRefs.erase(ID);
-
- // The key has been removed from the map but so we don't want to leave
- // strdup'd memory around so destroy it too.
- Tmp.destroy();
-
- // If its a numbered definition, bump the number and set the BB value.
- if (ID.Type == ValID::LocalID) {
- assert(ID.Num == CurFun.NextValNum && "Invalid new block number");
- InsertValue(BB);
- }
- } else {
- // We haven't seen this BB before and its first mention is a definition.
- // Just create it and return it.
- std::string Name (ID.Type == ValID::LocalName ? ID.getName() : "");
- BB = BasicBlock::Create(Name, CurFun.CurrentFunction);
- if (ID.Type == ValID::LocalID) {
- assert(ID.Num == CurFun.NextValNum && "Invalid new block number");
- InsertValue(BB);
- }
- }
-
- ID.destroy();
- return BB;
-}
-
-/// getBBVal - get an existing BB value or create a forward reference for it.
-///
-static BasicBlock *getBBVal(const ValID &ID) {
- assert(inFunctionScope() && "Can't get basic block at global scope!");
-
- BasicBlock *BB = 0;
-
- std::map<ValID, BasicBlock*>::iterator BBI = CurFun.BBForwardRefs.find(ID);
- if (BBI != CurFun.BBForwardRefs.end()) {
- BB = BBI->second;
- } if (ID.Type == ValID::LocalName) {
- std::string Name = ID.getName();
- Value *N = CurFun.CurrentFunction->getValueSymbolTable().lookup(Name);
- if (N) {
- if (N->getType()->getTypeID() == Type::LabelTyID)
- BB = cast<BasicBlock>(N);
- else
- GenerateError("Reference to label '" + Name + "' is actually of type '"+
- N->getType()->getDescription() + "'");
- }
- } else if (ID.Type == ValID::LocalID) {
- if (ID.Num < CurFun.NextValNum && ID.Num < CurFun.Values.size()) {
- if (CurFun.Values[ID.Num]->getType()->getTypeID() == Type::LabelTyID)
- BB = cast<BasicBlock>(CurFun.Values[ID.Num]);
- else
- GenerateError("Reference to label '%" + utostr(ID.Num) +
- "' is actually of type '"+
- CurFun.Values[ID.Num]->getType()->getDescription() + "'");
- }
- } else {
- GenerateError("Illegal label reference " + ID.getName());
- return 0;
- }
-
- // If its already been defined, return it now.
- if (BB) {
- ID.destroy(); // Free strdup'd memory.
- return BB;
- }
-
- // Otherwise, this block has not been seen before, create it.
- std::string Name;
- if (ID.Type == ValID::LocalName)
- Name = ID.getName();
- BB = BasicBlock::Create(Name, CurFun.CurrentFunction);
-
- // Insert it in the forward refs map.
- CurFun.BBForwardRefs[ID] = BB;
-
- return BB;
-}
-
-
-//===----------------------------------------------------------------------===//
-// Code to handle forward references in instructions
-//===----------------------------------------------------------------------===//
-//
-// This code handles the late binding needed with statements that reference
-// values not defined yet... for example, a forward branch, or the PHI node for
-// a loop body.
-//
-// This keeps a table (CurFun.LateResolveValues) of all such forward references
-// and back patchs after we are done.
-//
-
-// ResolveDefinitions - If we could not resolve some defs at parsing
-// time (forward branches, phi functions for loops, etc...) resolve the
-// defs now...
-//
-static void
-ResolveDefinitions(ValueList &LateResolvers, ValueList *FutureLateResolvers) {
- // Loop over LateResolveDefs fixing up stuff that couldn't be resolved
- while (!LateResolvers.empty()) {
- Value *V = LateResolvers.back();
- LateResolvers.pop_back();
-
- std::map<Value*, std::pair<ValID, int> >::iterator PHI =
- CurModule.PlaceHolderInfo.find(V);
- assert(PHI != CurModule.PlaceHolderInfo.end() && "Placeholder error!");
-
- ValID &DID = PHI->second.first;
-
- Value *TheRealValue = getExistingVal(V->getType(), DID);
- if (TriggerError)
- return;
- if (TheRealValue) {
- V->replaceAllUsesWith(TheRealValue);
- delete V;
- CurModule.PlaceHolderInfo.erase(PHI);
- } else if (FutureLateResolvers) {
- // Functions have their unresolved items forwarded to the module late
- // resolver table
- InsertValue(V, *FutureLateResolvers);
- } else {
- if (DID.Type == ValID::LocalName || DID.Type == ValID::GlobalName) {
- GenerateError("Reference to an invalid definition: '" +DID.getName()+
- "' of type '" + V->getType()->getDescription() + "'",
- PHI->second.second);
- return;
- } else {
- GenerateError("Reference to an invalid definition: #" +
- itostr(DID.Num) + " of type '" +
- V->getType()->getDescription() + "'",
- PHI->second.second);
- return;
- }
- }
- }
- LateResolvers.clear();
-}
-
-// ResolveTypeTo - A brand new type was just declared. This means that (if
-// name is not null) things referencing Name can be resolved. Otherwise, things
-// refering to the number can be resolved. Do this now.
-//
-static void ResolveTypeTo(std::string *Name, const Type *ToTy) {
- ValID D;
- if (Name)
- D = ValID::createLocalName(*Name);
- else
- D = ValID::createLocalID(CurModule.Types.size());
-
- std::map<ValID, PATypeHolder>::iterator I =
- CurModule.LateResolveTypes.find(D);
- if (I != CurModule.LateResolveTypes.end()) {
- ((DerivedType*)I->second.get())->refineAbstractTypeTo(ToTy);
- CurModule.LateResolveTypes.erase(I);
- }
-}
-
-// setValueName - Set the specified value to the name given. The name may be
-// null potentially, in which case this is a noop. The string passed in is
-// assumed to be a malloc'd string buffer, and is free'd by this function.
-//
-static void setValueName(Value *V, std::string *NameStr) {
- if (!NameStr) return;
- std::string Name(*NameStr); // Copy string
- delete NameStr; // Free old string
-
- if (V->getType() == Type::VoidTy) {
- GenerateError("Can't assign name '" + Name+"' to value with void type");
- return;
- }
-
- assert(inFunctionScope() && "Must be in function scope!");
- ValueSymbolTable &ST = CurFun.CurrentFunction->getValueSymbolTable();
- if (ST.lookup(Name)) {
- GenerateError("Redefinition of value '" + Name + "' of type '" +
- V->getType()->getDescription() + "'");
- return;
- }
-
- // Set the name.
- V->setName(Name);
-}
-
-/// ParseGlobalVariable - Handle parsing of a global. If Initializer is null,
-/// this is a declaration, otherwise it is a definition.
-static GlobalVariable *
-ParseGlobalVariable(std::string *NameStr,
- GlobalValue::LinkageTypes Linkage,
- GlobalValue::VisibilityTypes Visibility,
- bool isConstantGlobal, const Type *Ty,
- Constant *Initializer, bool IsThreadLocal,
- unsigned AddressSpace = 0) {
- if (isa<FunctionType>(Ty)) {
- GenerateError("Cannot declare global vars of function type");
- return 0;
- }
-
- const PointerType *PTy = PointerType::get(Ty, AddressSpace);
-
- std::string Name;
- if (NameStr) {
- Name = *NameStr; // Copy string
- delete NameStr; // Free old string
- }
-
- // See if this global value was forward referenced. If so, recycle the
- // object.
- ValID ID;
- if (!Name.empty()) {
- ID = ValID::createGlobalName(Name);
- } else {
- ID = ValID::createGlobalID(CurModule.Values.size());
- }
-
- if (GlobalValue *FWGV = CurModule.GetForwardRefForGlobal(PTy, ID)) {
- // Move the global to the end of the list, from whereever it was
- // previously inserted.
- GlobalVariable *GV = cast<GlobalVariable>(FWGV);
- CurModule.CurrentModule->getGlobalList().remove(GV);
- CurModule.CurrentModule->getGlobalList().push_back(GV);
- GV->setInitializer(Initializer);
- GV->setLinkage(Linkage);
- GV->setVisibility(Visibility);
- GV->setConstant(isConstantGlobal);
- GV->setThreadLocal(IsThreadLocal);
- InsertValue(GV, CurModule.Values);
- return GV;
- }
-
- // If this global has a name
- if (!Name.empty()) {
- // if the global we're parsing has an initializer (is a definition) and
- // has external linkage.
- if (Initializer && Linkage != GlobalValue::InternalLinkage)
- // If there is already a global with external linkage with this name
- if (CurModule.CurrentModule->getGlobalVariable(Name, false)) {
- // If we allow this GVar to get created, it will be renamed in the
- // symbol table because it conflicts with an existing GVar. We can't
- // allow redefinition of GVars whose linking indicates that their name
- // must stay the same. Issue the error.
- GenerateError("Redefinition of global variable named '" + Name +
- "' of type '" + Ty->getDescription() + "'");
- return 0;
- }
- }
-
- // Otherwise there is no existing GV to use, create one now.
- GlobalVariable *GV =
- new GlobalVariable(Ty, isConstantGlobal, Linkage, Initializer, Name,
- CurModule.CurrentModule, IsThreadLocal, AddressSpace);
- GV->setVisibility(Visibility);
- InsertValue(GV, CurModule.Values);
- return GV;
-}
-
-// setTypeName - Set the specified type to the name given. The name may be
-// null potentially, in which case this is a noop. The string passed in is
-// assumed to be a malloc'd string buffer, and is freed by this function.
-//
-// This function returns true if the type has already been defined, but is
-// allowed to be redefined in the specified context. If the name is a new name
-// for the type plane, it is inserted and false is returned.
-static bool setTypeName(const Type *T, std::string *NameStr) {
- assert(!inFunctionScope() && "Can't give types function-local names!");
- if (NameStr == 0) return false;
-
- std::string Name(*NameStr); // Copy string
- delete NameStr; // Free old string
-
- // We don't allow assigning names to void type
- if (T == Type::VoidTy) {
- GenerateError("Can't assign name '" + Name + "' to the void type");
- return false;
- }
-
- // Set the type name, checking for conflicts as we do so.
- bool AlreadyExists = CurModule.CurrentModule->addTypeName(Name, T);
-
- if (AlreadyExists) { // Inserting a name that is already defined???
- const Type *Existing = CurModule.CurrentModule->getTypeByName(Name);
- assert(Existing && "Conflict but no matching type?!");
-
- // There is only one case where this is allowed: when we are refining an
- // opaque type. In this case, Existing will be an opaque type.
- if (const OpaqueType *OpTy = dyn_cast<OpaqueType>(Existing)) {
- // We ARE replacing an opaque type!
- const_cast<OpaqueType*>(OpTy)->refineAbstractTypeTo(T);
- return true;
- }
-
- // Otherwise, this is an attempt to redefine a type. That's okay if
- // the redefinition is identical to the original. This will be so if
- // Existing and T point to the same Type object. In this one case we
- // allow the equivalent redefinition.
- if (Existing == T) return true; // Yes, it's equal.
-
- // Any other kind of (non-equivalent) redefinition is an error.
- GenerateError("Redefinition of type named '" + Name + "' of type '" +
- T->getDescription() + "'");
- }
-
- return false;
-}
-
-//===----------------------------------------------------------------------===//
-// Code for handling upreferences in type names...
-//
-
-// TypeContains - Returns true if Ty directly contains E in it.
-//
-static bool TypeContains(const Type *Ty, const Type *E) {
- return std::find(Ty->subtype_begin(), Ty->subtype_end(),
- E) != Ty->subtype_end();
-}
-
-namespace {
- struct UpRefRecord {
- // NestingLevel - The number of nesting levels that need to be popped before
- // this type is resolved.
- unsigned NestingLevel;
-
- // LastContainedTy - This is the type at the current binding level for the
- // type. Every time we reduce the nesting level, this gets updated.
- const Type *LastContainedTy;
-
- // UpRefTy - This is the actual opaque type that the upreference is
- // represented with.
- OpaqueType *UpRefTy;
-
- UpRefRecord(unsigned NL, OpaqueType *URTy)
- : NestingLevel(NL), LastContainedTy(URTy), UpRefTy(URTy) {}
- };
-}
-
-// UpRefs - A list of the outstanding upreferences that need to be resolved.
-static std::vector<UpRefRecord> UpRefs;
-
-/// HandleUpRefs - Every time we finish a new layer of types, this function is
-/// called. It loops through the UpRefs vector, which is a list of the
-/// currently active types. For each type, if the up reference is contained in
-/// the newly completed type, we decrement the level count. When the level
-/// count reaches zero, the upreferenced type is the type that is passed in:
-/// thus we can complete the cycle.
-///
-static PATypeHolder HandleUpRefs(const Type *ty) {
- // If Ty isn't abstract, or if there are no up-references in it, then there is
- // nothing to resolve here.
- if (!ty->isAbstract() || UpRefs.empty()) return ty;
-
- PATypeHolder Ty(ty);
- UR_OUT("Type '" << Ty->getDescription() <<
- "' newly formed. Resolving upreferences.\n" <<
- UpRefs.size() << " upreferences active!\n");
-
- // If we find any resolvable upreferences (i.e., those whose NestingLevel goes
- // to zero), we resolve them all together before we resolve them to Ty. At
- // the end of the loop, if there is anything to resolve to Ty, it will be in
- // this variable.
- OpaqueType *TypeToResolve = 0;
-
- for (unsigned i = 0; i != UpRefs.size(); ++i) {
- UR_OUT(" UR#" << i << " - TypeContains(" << Ty->getDescription() << ", "
- << UpRefs[i].second->getDescription() << ") = "
- << (TypeContains(Ty, UpRefs[i].second) ? "true" : "false") << "\n");
- if (TypeContains(Ty, UpRefs[i].LastContainedTy)) {
- // Decrement level of upreference
- unsigned Level = --UpRefs[i].NestingLevel;
- UpRefs[i].LastContainedTy = Ty;
- UR_OUT(" Uplevel Ref Level = " << Level << "\n");
- if (Level == 0) { // Upreference should be resolved!
- if (!TypeToResolve) {
- TypeToResolve = UpRefs[i].UpRefTy;
- } else {
- UR_OUT(" * Resolving upreference for "
- << UpRefs[i].second->getDescription() << "\n";
- std::string OldName = UpRefs[i].UpRefTy->getDescription());
- UpRefs[i].UpRefTy->refineAbstractTypeTo(TypeToResolve);
- UR_OUT(" * Type '" << OldName << "' refined upreference to: "
- << (const void*)Ty << ", " << Ty->getDescription() << "\n");
- }
- UpRefs.erase(UpRefs.begin()+i); // Remove from upreference list...
- --i; // Do not skip the next element...
- }
- }
- }
-
- if (TypeToResolve) {
- UR_OUT(" * Resolving upreference for "
- << UpRefs[i].second->getDescription() << "\n";
- std::string OldName = TypeToResolve->getDescription());
- TypeToResolve->refineAbstractTypeTo(Ty);
- }
-
- return Ty;
-}
-
-//===----------------------------------------------------------------------===//
-// RunVMAsmParser - Define an interface to this parser
-//===----------------------------------------------------------------------===//
-//
-static Module* RunParser(Module * M);
-
-Module *llvm::RunVMAsmParser(llvm::MemoryBuffer *MB) {
- InitLLLexer(MB);
- Module *M = RunParser(new Module(LLLgetFilename()));
- FreeLexer();
- return M;
-}
-
-
-
-/* Enabling traces. */
-#ifndef YYDEBUG
-# define YYDEBUG 0
-#endif
-
-/* Enabling verbose error messages. */
-#ifdef YYERROR_VERBOSE
-# undef YYERROR_VERBOSE
-# define YYERROR_VERBOSE 1
-#else
-# define YYERROR_VERBOSE 0
-#endif
-
-/* Enabling the token table. */
-#ifndef YYTOKEN_TABLE
-# define YYTOKEN_TABLE 0
-#endif
-
-#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
-typedef union YYSTYPE
-#line 949 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
-{
- llvm::Module *ModuleVal;
- llvm::Function *FunctionVal;
- llvm::BasicBlock *BasicBlockVal;
- llvm::TerminatorInst *TermInstVal;
- llvm::Instruction *InstVal;
- llvm::Constant *ConstVal;
-
- const llvm::Type *PrimType;
- std::list<llvm::PATypeHolder> *TypeList;
- llvm::PATypeHolder *TypeVal;
- llvm::Value *ValueVal;
- std::vector<llvm::Value*> *ValueList;
- llvm::ArgListType *ArgList;
- llvm::TypeWithAttrs TypeWithAttrs;
- llvm::TypeWithAttrsList *TypeWithAttrsList;
- llvm::ParamList *ParamList;
-
- // Represent the RHS of PHI node
- std::list<std::pair<llvm::Value*,
- llvm::BasicBlock*> > *PHIList;
- std::vector<std::pair<llvm::Constant*, llvm::BasicBlock*> > *JumpTable;
- std::vector<llvm::Constant*> *ConstVector;
-
- llvm::GlobalValue::LinkageTypes Linkage;
- llvm::GlobalValue::VisibilityTypes Visibility;
- llvm::ParameterAttributes ParamAttrs;
- llvm::APInt *APIntVal;
- int64_t SInt64Val;
- uint64_t UInt64Val;
- int SIntVal;
- unsigned UIntVal;
- llvm::APFloat *FPVal;
- bool BoolVal;
-
- std::string *StrVal; // This memory must be deleted
- llvm::ValID ValIDVal;
-
- llvm::Instruction::BinaryOps BinaryOpVal;
- llvm::Instruction::TermOps TermOpVal;
- llvm::Instruction::MemoryOps MemOpVal;
- llvm::Instruction::CastOps CastOpVal;
- llvm::Instruction::OtherOps OtherOpVal;
- llvm::ICmpInst::Predicate IPredicate;
- llvm::FCmpInst::Predicate FPredicate;
-}
-/* Line 193 of yacc.c. */
-#line 1386 "llvmAsmParser.tab.c"
- YYSTYPE;
-# define yystype YYSTYPE /* obsolescent; will be withdrawn */
-# define YYSTYPE_IS_DECLARED 1
-# define YYSTYPE_IS_TRIVIAL 1
-#endif
-
-
-
-/* Copy the second part of user declarations. */
-
-
-/* Line 216 of yacc.c. */
-#line 1399 "llvmAsmParser.tab.c"
-
-#ifdef short
-# undef short
-#endif
-
-#ifdef YYTYPE_UINT8
-typedef YYTYPE_UINT8 yytype_uint8;
-#else
-typedef unsigned char yytype_uint8;
-#endif
-
-#ifdef YYTYPE_INT8
-typedef YYTYPE_INT8 yytype_int8;
-#elif (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
-typedef signed char yytype_int8;
-#else
-typedef short int yytype_int8;
-#endif
-
-#ifdef YYTYPE_UINT16
-typedef YYTYPE_UINT16 yytype_uint16;
-#else
-typedef unsigned short int yytype_uint16;
-#endif
-
-#ifdef YYTYPE_INT16
-typedef YYTYPE_INT16 yytype_int16;
-#else
-typedef short int yytype_int16;
-#endif
-
-#ifndef YYSIZE_T
-# ifdef __SIZE_TYPE__
-# define YYSIZE_T __SIZE_TYPE__
-# elif defined size_t
-# define YYSIZE_T size_t
-# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
-# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
-# define YYSIZE_T size_t
-# else
-# define YYSIZE_T unsigned int
-# endif
-#endif
-
-#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
-
-#ifndef YY_
-# if defined YYENABLE_NLS && YYENABLE_NLS
-# if ENABLE_NLS
-# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
-# define YY_(msgid) dgettext ("bison-runtime", msgid)
-# endif
-# endif
-# ifndef YY_
-# define YY_(msgid) msgid
-# endif
-#endif
-
-/* Suppress unused-variable warnings by "using" E. */
-#if ! defined lint || defined __GNUC__
-# define YYUSE(e) ((void) (e))
-#else
-# define YYUSE(e) /* empty */
-#endif
-
-/* Identity function, used to suppress warnings about constant conditions. */
-#ifndef lint
-# define YYID(n) (n)
-#else
-#if (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
-static int
-YYID (int i)
-#else
-static int
-YYID (i)
- int i;
-#endif
-{
- return i;
-}
-#endif
-
-#if ! defined yyoverflow || YYERROR_VERBOSE
-
-/* The parser invokes alloca or malloc; define the necessary symbols. */
-
-# ifdef YYSTACK_USE_ALLOCA
-# if YYSTACK_USE_ALLOCA
-# ifdef __GNUC__
-# define YYSTACK_ALLOC __builtin_alloca
-# elif defined __BUILTIN_VA_ARG_INCR
-# include <alloca.h> /* INFRINGES ON USER NAME SPACE */
-# elif defined _AIX
-# define YYSTACK_ALLOC __alloca
-# elif defined _MSC_VER
-# include <malloc.h> /* INFRINGES ON USER NAME SPACE */
-# define alloca _alloca
-# else
-# define YYSTACK_ALLOC alloca
-# if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
-# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
-# ifndef _STDLIB_H
-# define _STDLIB_H 1
-# endif
-# endif
-# endif
-# endif
-# endif
-
-# ifdef YYSTACK_ALLOC
- /* Pacify GCC's `empty if-body' warning. */
-# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
-# ifndef YYSTACK_ALLOC_MAXIMUM
- /* The OS might guarantee only one guard page at the bottom of the stack,
- and a page size can be as small as 4096 bytes. So we cannot safely
- invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
- to allow for a few compiler-allocated temporary stack slots. */
-# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
-# endif
-# else
-# define YYSTACK_ALLOC YYMALLOC
-# define YYSTACK_FREE YYFREE
-# ifndef YYSTACK_ALLOC_MAXIMUM
-# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
-# endif
-# if (defined __cplusplus && ! defined _STDLIB_H \
- && ! ((defined YYMALLOC || defined malloc) \
- && (defined YYFREE || defined free)))
-# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
-# ifndef _STDLIB_H
-# define _STDLIB_H 1
-# endif
-# endif
-# ifndef YYMALLOC
-# define YYMALLOC malloc
-# if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
-void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
-# endif
-# endif
-# ifndef YYFREE
-# define YYFREE free
-# if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
-void free (void *); /* INFRINGES ON USER NAME SPACE */
-# endif
-# endif
-# endif
-#endif /* ! defined yyoverflow || YYERROR_VERBOSE */
-
-
-#if (! defined yyoverflow \
- && (! defined __cplusplus \
- || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
-
-/* A type that is properly aligned for any stack member. */
-union yyalloc
-{
- yytype_int16 yyss;
- YYSTYPE yyvs;
- };
-
-/* The size of the maximum gap between one aligned stack and the next. */
-# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
-
-/* The size of an array large to enough to hold all stacks, each with
- N elements. */
-# define YYSTACK_BYTES(N) \
- ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
- + YYSTACK_GAP_MAXIMUM)
-
-/* Copy COUNT objects from FROM to TO. The source and destination do
- not overlap. */
-# ifndef YYCOPY
-# if defined __GNUC__ && 1 < __GNUC__
-# define YYCOPY(To, From, Count) \
- __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
-# else
-# define YYCOPY(To, From, Count) \
- do \
- { \
- YYSIZE_T yyi; \
- for (yyi = 0; yyi < (Count); yyi++) \
- (To)[yyi] = (From)[yyi]; \
- } \
- while (YYID (0))
-# endif
-# endif
-
-/* Relocate STACK from its old location to the new one. The
- local variables YYSIZE and YYSTACKSIZE give the old and new number of
- elements in the stack, and YYPTR gives the new location of the
- stack. Advance YYPTR to a properly aligned location for the next
- stack. */
-# define YYSTACK_RELOCATE(Stack) \
- do \
- { \
- YYSIZE_T yynewbytes; \
- YYCOPY (&yyptr->Stack, Stack, yysize); \
- Stack = &yyptr->Stack; \
- yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
- yyptr += yynewbytes / sizeof (*yyptr); \
- } \
- while (YYID (0))
-
-#endif
-
-/* YYFINAL -- State number of the termination state. */
-#define YYFINAL 43
-/* YYLAST -- Last index in YYTABLE. */
-#define YYLAST 1978
-
-/* YYNTOKENS -- Number of terminals. */
-#define YYNTOKENS 165
-/* YYNNTS -- Number of nonterminals. */
-#define YYNNTS 85
-/* YYNRULES -- Number of rules. */
-#define YYNRULES 322
-/* YYNRULES -- Number of states. */
-#define YYNSTATES 629
-
-/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
-#define YYUNDEFTOK 2
-#define YYMAXUTOK 405
-
-#define YYTRANSLATE(YYX) \
- ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
-
-/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
-static const yytype_uint8 yytranslate[] =
-{
- 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 151, 152, 155, 2, 154, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 160, 153, 161, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 157, 156, 159, 2, 2, 2, 2, 2, 164,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 158, 2, 2, 162, 2, 163, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
- 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
- 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
- 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
- 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
- 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
- 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
- 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
- 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
- 85, 86, 87, 88, 89, 90, 91, 92, 93, 94,
- 95, 96, 97, 98, 99, 100, 101, 102, 103, 104,
- 105, 106, 107, 108, 109, 110, 111, 112, 113, 114,
- 115, 116, 117, 118, 119, 120, 121, 122, 123, 124,
- 125, 126, 127, 128, 129, 130, 131, 132, 133, 134,
- 135, 136, 137, 138, 139, 140, 141, 142, 143, 144,
- 145, 146, 147, 148, 149, 150
-};
-
-#if YYDEBUG
-/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
- YYRHS. */
-static const yytype_uint16 yyprhs[] =
-{
- 0, 0, 3, 5, 7, 9, 11, 13, 15, 17,
- 19, 21, 23, 25, 27, 29, 31, 33, 35, 37,
- 39, 41, 43, 45, 47, 49, 51, 53, 55, 57,
- 59, 61, 63, 65, 67, 69, 71, 73, 75, 77,
- 79, 81, 83, 85, 87, 89, 91, 93, 95, 97,
- 99, 101, 103, 105, 107, 109, 111, 113, 115, 117,
- 119, 121, 123, 125, 127, 129, 130, 135, 136, 139,
- 140, 142, 144, 146, 147, 150, 152, 154, 156, 158,
- 160, 162, 164, 166, 167, 169, 171, 173, 174, 176,
- 178, 179, 181, 183, 185, 187, 188, 190, 192, 193,
- 195, 197, 199, 201, 203, 206, 208, 210, 212, 214,
- 216, 218, 220, 222, 224, 227, 228, 231, 233, 235,
- 237, 239, 241, 243, 244, 247, 248, 251, 252, 255,
- 256, 260, 263, 264, 266, 267, 271, 273, 276, 278,
- 280, 282, 284, 286, 288, 290, 292, 294, 298, 300,
- 303, 309, 315, 321, 327, 331, 334, 340, 345, 348,
- 350, 352, 354, 358, 360, 364, 366, 367, 369, 373,
- 378, 382, 386, 391, 396, 400, 407, 413, 416, 419,
- 422, 425, 428, 431, 434, 437, 440, 443, 446, 449,
- 456, 462, 471, 478, 485, 493, 501, 508, 517, 526,
- 530, 532, 534, 536, 538, 539, 542, 549, 551, 552,
- 554, 557, 558, 562, 563, 567, 571, 575, 579, 580,
- 589, 590, 600, 601, 611, 617, 620, 624, 626, 630,
- 634, 638, 642, 644, 645, 651, 655, 657, 661, 663,
- 664, 675, 677, 679, 684, 686, 688, 691, 695, 696,
- 698, 700, 702, 704, 706, 708, 710, 712, 714, 718,
- 720, 726, 728, 730, 732, 734, 736, 738, 741, 743,
- 747, 750, 753, 757, 760, 761, 763, 766, 769, 773,
- 783, 793, 802, 817, 819, 821, 828, 834, 837, 844,
- 852, 857, 862, 869, 876, 877, 878, 882, 885, 887,
- 893, 899, 906, 913, 918, 925, 930, 935, 942, 949,
- 952, 961, 963, 965, 966, 970, 977, 981, 988, 991,
- 997, 1005, 1011
-};
-
-/* YYRHS -- A `-1'-separated list of the rules' RHS. */
-static const yytype_int16 yyrhs[] =
-{
- 211, 0, -1, 74, -1, 75, -1, 76, -1, 77,
- -1, 78, -1, 79, -1, 80, -1, 81, -1, 82,
- -1, 86, -1, 87, -1, 88, -1, 83, -1, 84,
- -1, 85, -1, 117, -1, 118, -1, 119, -1, 120,
- -1, 121, -1, 122, -1, 123, -1, 124, -1, 125,
- -1, 126, -1, 127, -1, 128, -1, 91, -1, 92,
- -1, 93, -1, 94, -1, 95, -1, 96, -1, 97,
- -1, 98, -1, 99, -1, 100, -1, 101, -1, 102,
- -1, 103, -1, 104, -1, 105, -1, 106, -1, 107,
- -1, 108, -1, 109, -1, 110, -1, 97, -1, 98,
- -1, 99, -1, 100, -1, 26, -1, 27, -1, 11,
- -1, 12, -1, 13, -1, 16, -1, 15, -1, 14,
- -1, 19, -1, 22, -1, 24, -1, 173, -1, -1,
- 54, 151, 4, 152, -1, -1, 173, 153, -1, -1,
- 20, -1, 23, -1, 179, -1, -1, 177, 153, -1,
- 42, -1, 44, -1, 43, -1, 45, -1, 47, -1,
- 46, -1, 48, -1, 50, -1, -1, 148, -1, 149,
- -1, 150, -1, -1, 46, -1, 48, -1, -1, 42,
- -1, 43, -1, 44, -1, 47, -1, -1, 44, -1,
- 42, -1, -1, 62, -1, 63, -1, 64, -1, 65,
- -1, 66, -1, 61, 4, -1, 137, -1, 118, -1,
- 136, -1, 119, -1, 139, -1, 140, -1, 142, -1,
- 143, -1, 144, -1, 53, 4, -1, -1, 188, 187,
- -1, 138, -1, 141, -1, 137, -1, 136, -1, 145,
- -1, 146, -1, -1, 190, 189, -1, -1, 147, 22,
- -1, -1, 53, 4, -1, -1, 154, 53, 4, -1,
- 34, 22, -1, -1, 194, -1, -1, 154, 197, 196,
- -1, 194, -1, 53, 4, -1, 11, -1, 12, -1,
- 13, -1, 16, -1, 15, -1, 14, -1, 17, -1,
- 49, -1, 198, -1, 199, 175, 155, -1, 233, -1,
- 156, 4, -1, 199, 151, 203, 152, 190, -1, 10,
- 151, 203, 152, 190, -1, 157, 4, 158, 199, 159,
- -1, 160, 4, 158, 199, 161, -1, 162, 204, 163,
- -1, 162, 163, -1, 160, 162, 204, 163, 161, -1,
- 160, 162, 163, 161, -1, 199, 188, -1, 199, -1,
- 10, -1, 200, -1, 202, 154, 200, -1, 202, -1,
- 202, 154, 39, -1, 39, -1, -1, 199, -1, 204,
- 154, 199, -1, 199, 157, 207, 159, -1, 199, 157,
- 159, -1, 199, 164, 22, -1, 199, 160, 207, 161,
- -1, 199, 162, 207, 163, -1, 199, 162, 163, -1,
- 199, 160, 162, 207, 163, 161, -1, 199, 160, 162,
- 163, 161, -1, 199, 40, -1, 199, 41, -1, 199,
- 233, -1, 199, 206, -1, 199, 25, -1, 171, 3,
- -1, 171, 5, -1, 171, 4, -1, 171, 6, -1,
- 11, 26, -1, 11, 27, -1, 172, 9, -1, 168,
- 151, 205, 38, 199, 152, -1, 116, 151, 205, 245,
- 152, -1, 130, 151, 205, 154, 205, 154, 205, 152,
- -1, 166, 151, 205, 154, 205, 152, -1, 167, 151,
- 205, 154, 205, 152, -1, 89, 169, 151, 205, 154,
- 205, 152, -1, 90, 170, 151, 205, 154, 205, 152,
- -1, 132, 151, 205, 154, 205, 152, -1, 133, 151,
- 205, 154, 205, 154, 205, 152, -1, 134, 151, 205,
- 154, 205, 154, 205, 152, -1, 207, 154, 205, -1,
- 205, -1, 32, -1, 33, -1, 37, -1, -1, 201,
- 233, -1, 122, 151, 210, 38, 199, 152, -1, 212,
- -1, -1, 213, -1, 212, 213, -1, -1, 31, 214,
- 229, -1, -1, 30, 215, 230, -1, 59, 58, 219,
- -1, 176, 18, 199, -1, 176, 18, 10, -1, -1,
- 178, 182, 209, 208, 205, 175, 216, 196, -1, -1,
- 178, 180, 182, 209, 208, 205, 175, 217, 196, -1,
- -1, 178, 181, 182, 209, 208, 199, 175, 218, 196,
- -1, 178, 182, 35, 185, 210, -1, 51, 220, -1,
- 55, 153, 221, -1, 22, -1, 52, 153, 22, -1,
- 67, 153, 22, -1, 157, 222, 159, -1, 222, 154,
- 22, -1, 22, -1, -1, 223, 154, 199, 188, 174,
- -1, 199, 188, 174, -1, 223, -1, 223, 154, 39,
- -1, 39, -1, -1, 186, 201, 177, 151, 224, 152,
- 190, 195, 192, 191, -1, 28, -1, 162, -1, 184,
- 182, 225, 226, -1, 29, -1, 163, -1, 237, 228,
- -1, 183, 182, 225, -1, -1, 60, -1, 3, -1,
- 4, -1, 9, -1, 26, -1, 27, -1, 40, -1,
- 41, -1, 25, -1, 160, 207, 161, -1, 206, -1,
- 58, 231, 22, 154, 22, -1, 7, -1, 8, -1,
- 173, -1, 177, -1, 233, -1, 232, -1, 199, 234,
- -1, 235, -1, 236, 154, 235, -1, 237, 238, -1,
- 227, 238, -1, 239, 176, 240, -1, 239, 242, -1,
- -1, 21, -1, 68, 236, -1, 68, 10, -1, 69,
- 17, 234, -1, 69, 11, 234, 154, 17, 234, 154,
- 17, 234, -1, 70, 171, 234, 154, 17, 234, 157,
- 241, 159, -1, 70, 171, 234, 154, 17, 234, 157,
- 159, -1, 71, 186, 201, 234, 151, 244, 152, 190,
- 38, 17, 234, 72, 17, 234, -1, 72, -1, 73,
- -1, 241, 171, 232, 154, 17, 234, -1, 171, 232,
- 154, 17, 234, -1, 176, 247, -1, 199, 157, 234,
- 154, 234, 159, -1, 243, 154, 157, 234, 154, 234,
- 159, -1, 199, 188, 234, 188, -1, 17, 188, 234,
- 188, -1, 244, 154, 199, 188, 234, 188, -1, 244,
- 154, 17, 188, 234, 188, -1, -1, -1, 245, 154,
- 235, -1, 57, 56, -1, 56, -1, 166, 199, 234,
- 154, 234, -1, 167, 199, 234, 154, 234, -1, 89,
- 169, 199, 234, 154, 234, -1, 90, 170, 199, 234,
- 154, 234, -1, 168, 235, 38, 199, -1, 130, 235,
- 154, 235, 154, 235, -1, 131, 235, 154, 199, -1,
- 132, 235, 154, 235, -1, 133, 235, 154, 235, 154,
- 235, -1, 134, 235, 154, 235, 154, 235, -1, 129,
- 243, -1, 246, 186, 201, 234, 151, 244, 152, 190,
- -1, 249, -1, 36, -1, -1, 111, 199, 193, -1,
- 111, 199, 154, 11, 234, 193, -1, 112, 199, 193,
- -1, 112, 199, 154, 11, 234, 193, -1, 113, 235,
- -1, 248, 114, 199, 234, 193, -1, 248, 115, 235,
- 154, 199, 234, 193, -1, 135, 199, 234, 154, 4,
- -1, 116, 199, 234, 245, -1
-};
-
-/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
-static const yytype_uint16 yyrline[] =
-{
- 0, 1111, 1111, 1111, 1111, 1111, 1111, 1111, 1111, 1111,
- 1111, 1112, 1112, 1112, 1112, 1112, 1112, 1113, 1113, 1113,
- 1113, 1113, 1113, 1114, 1114, 1114, 1114, 1114, 1114, 1117,
- 1117, 1118, 1118, 1119, 1119, 1120, 1120, 1121, 1121, 1125,
- 1125, 1126, 1126, 1127, 1127, 1128, 1128, 1129, 1129, 1130,
- 1130, 1131, 1131, 1132, 1133, 1138, 1139, 1139, 1139, 1139,
- 1139, 1141, 1141, 1141, 1142, 1142, 1144, 1145, 1149, 1153,
- 1158, 1158, 1160, 1161, 1166, 1172, 1173, 1174, 1175, 1176,
- 1180, 1181, 1182, 1186, 1187, 1188, 1189, 1193, 1194, 1195,
- 1199, 1200, 1201, 1202, 1203, 1207, 1208, 1209, 1212, 1213,
- 1214, 1215, 1216, 1217, 1218, 1225, 1226, 1227, 1228, 1229,
- 1230, 1231, 1232, 1233, 1234, 1238, 1239, 1244, 1245, 1246,
- 1247, 1248, 1249, 1252, 1253, 1258, 1259, 1266, 1267, 1273,
- 1274, 1283, 1291, 1292, 1297, 1298, 1299, 1304, 1317, 1317,
- 1317, 1317, 1317, 1317, 1317, 1320, 1324, 1328, 1335, 1340,
- 1348, 1377, 1402, 1407, 1417, 1427, 1431, 1441, 1448, 1457,
- 1464, 1469, 1474, 1481, 1482, 1489, 1496, 1504, 1510, 1522,
- 1550, 1566, 1593, 1621, 1647, 1667, 1693, 1713, 1725, 1732,
- 1798, 1808, 1818, 1824, 1834, 1840, 1850, 1855, 1860, 1873,
- 1885, 1907, 1915, 1921, 1932, 1937, 1942, 1948, 1954, 1963,
- 1967, 1975, 1975, 1978, 1978, 1981, 1993, 2014, 2019, 2027,
- 2028, 2032, 2032, 2036, 2036, 2039, 2042, 2066, 2078, 2077,
- 2089, 2088, 2098, 2097, 2108, 2148, 2151, 2157, 2167, 2171,
- 2176, 2178, 2183, 2188, 2197, 2207, 2218, 2222, 2231, 2240,
- 2245, 2374, 2374, 2376, 2385, 2385, 2387, 2392, 2404, 2408,
- 2413, 2417, 2421, 2425, 2429, 2433, 2437, 2441, 2445, 2470,
- 2474, 2484, 2488, 2492, 2497, 2504, 2504, 2510, 2519, 2524,
- 2529, 2533, 2542, 2551, 2560, 2564, 2572, 2579, 2583, 2588,
- 2598, 2617, 2626, 2711, 2715, 2722, 2733, 2746, 2756, 2767,
- 2777, 2788, 2796, 2806, 2813, 2816, 2817, 2824, 2828, 2833,
- 2849, 2866, 2880, 2894, 2906, 2914, 2921, 2927, 2933, 2939,
- 2954, 3044, 3049, 3053, 3060, 3067, 3075, 3082, 3090, 3098,
- 3112, 3129, 3137
-};
-#endif
-
-#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
-/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
- First, the terminals, then, starting at YYNTOKENS, nonterminals. */
-static const char *const yytname[] =
-{
- "$end", "error", "$undefined", "ESINT64VAL", "EUINT64VAL", "ESAPINTVAL",
- "EUAPINTVAL", "LOCALVAL_ID", "GLOBALVAL_ID", "FPVAL", "VOID", "INTTYPE",
- "FLOAT", "DOUBLE", "X86_FP80", "FP128", "PPC_FP128", "LABEL", "TYPE",
- "LOCALVAR", "GLOBALVAR", "LABELSTR", "STRINGCONSTANT",
- "ATSTRINGCONSTANT", "PCTSTRINGCONSTANT", "ZEROINITIALIZER", "TRUETOK",
- "FALSETOK", "BEGINTOK", "ENDTOK", "DECLARE", "DEFINE", "GLOBAL",
- "CONSTANT", "SECTION", "ALIAS", "VOLATILE", "THREAD_LOCAL", "TO",
- "DOTDOTDOT", "NULL_TOK", "UNDEF", "INTERNAL", "LINKONCE", "WEAK",
- "APPENDING", "DLLIMPORT", "DLLEXPORT", "EXTERN_WEAK", "OPAQUE",
- "EXTERNAL", "TARGET", "TRIPLE", "ALIGN", "ADDRSPACE", "DEPLIBS", "CALL",
- "TAIL", "ASM_TOK", "MODULE", "SIDEEFFECT", "CC_TOK", "CCC_TOK",
- "FASTCC_TOK", "COLDCC_TOK", "X86_STDCALLCC_TOK", "X86_FASTCALLCC_TOK",
- "DATALAYOUT", "RET", "BR", "SWITCH", "INVOKE", "UNWIND", "UNREACHABLE",
- "ADD", "SUB", "MUL", "UDIV", "SDIV", "FDIV", "UREM", "SREM", "FREM",
- "AND", "OR", "XOR", "SHL", "LSHR", "ASHR", "ICMP", "FCMP", "EQ", "NE",
- "SLT", "SGT", "SLE", "SGE", "ULT", "UGT", "ULE", "UGE", "OEQ", "ONE",
- "OLT", "OGT", "OLE", "OGE", "ORD", "UNO", "UEQ", "UNE", "MALLOC",
- "ALLOCA", "FREE", "LOAD", "STORE", "GETELEMENTPTR", "TRUNC", "ZEXT",
- "SEXT", "FPTRUNC", "FPEXT", "BITCAST", "UITOFP", "SITOFP", "FPTOUI",
- "FPTOSI", "INTTOPTR", "PTRTOINT", "PHI_TOK", "SELECT", "VAARG",
- "EXTRACTELEMENT", "INSERTELEMENT", "SHUFFLEVECTOR", "GETRESULT",
- "SIGNEXT", "ZEROEXT", "NORETURN", "INREG", "SRET", "NOUNWIND", "NOALIAS",
- "BYVAL", "NEST", "READNONE", "READONLY", "GC", "DEFAULT", "HIDDEN",
- "PROTECTED", "'('", "')'", "'='", "','", "'*'", "'\\\\'", "'['", "'x'",
- "']'", "'<'", "'>'", "'{'", "'}'", "'c'", "$accept", "ArithmeticOps",
- "LogicalOps", "CastOps", "IPredicates", "FPredicates", "IntType",
- "FPType", "LocalName", "OptLocalName", "OptAddrSpace", "OptLocalAssign",
- "GlobalName", "OptGlobalAssign", "GlobalAssign", "GVInternalLinkage",
- "GVExternalLinkage", "GVVisibilityStyle", "FunctionDeclareLinkage",
- "FunctionDefineLinkage", "AliasLinkage", "OptCallingConv", "ParamAttr",
- "OptParamAttrs", "FuncAttr", "OptFuncAttrs", "OptGC", "OptAlign",
- "OptCAlign", "SectionString", "OptSection", "GlobalVarAttributes",
- "GlobalVarAttribute", "PrimType", "Types", "ArgType", "ResultTypes",
- "ArgTypeList", "ArgTypeListI", "TypeListI", "ConstVal", "ConstExpr",
- "ConstVector", "GlobalType", "ThreadLocal", "AliaseeRef", "Module",
- "DefinitionList", "Definition", "@1", "@2", "@3", "@4", "@5", "AsmBlock",
- "TargetDefinition", "LibrariesDefinition", "LibList", "ArgListH",
- "ArgList", "FunctionHeaderH", "BEGIN", "FunctionHeader", "END",
- "Function", "FunctionProto", "OptSideEffect", "ConstValueRef",
- "SymbolicValueRef", "ValueRef", "ResolvedVal", "ReturnedVal",
- "BasicBlockList", "BasicBlock", "InstructionList", "BBTerminatorInst",
- "JumpTable", "Inst", "PHIList", "ParamList", "IndexList", "OptTailCall",
- "InstVal", "OptVolatile", "MemoryInst", 0
-};
-#endif
-
-# ifdef YYPRINT
-/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
- token YYLEX-NUM. */
-static const yytype_uint16 yytoknum[] =
-{
- 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
- 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
- 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
- 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
- 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
- 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
- 315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
- 325, 326, 327, 328, 329, 330, 331, 332, 333, 334,
- 335, 336, 337, 338, 339, 340, 341, 342, 343, 344,
- 345, 346, 347, 348, 349, 350, 351, 352, 353, 354,
- 355, 356, 357, 358, 359, 360, 361, 362, 363, 364,
- 365, 366, 367, 368, 369, 370, 371, 372, 373, 374,
- 375, 376, 377, 378, 379, 380, 381, 382, 383, 384,
- 385, 386, 387, 388, 389, 390, 391, 392, 393, 394,
- 395, 396, 397, 398, 399, 400, 401, 402, 403, 404,
- 405, 40, 41, 61, 44, 42, 92, 91, 120, 93,
- 60, 62, 123, 125, 99
-};
-# endif
-
-/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
-static const yytype_uint8 yyr1[] =
-{
- 0, 165, 166, 166, 166, 166, 166, 166, 166, 166,
- 166, 167, 167, 167, 167, 167, 167, 168, 168, 168,
- 168, 168, 168, 168, 168, 168, 168, 168, 168, 169,
- 169, 169, 169, 169, 169, 169, 169, 169, 169, 170,
- 170, 170, 170, 170, 170, 170, 170, 170, 170, 170,
- 170, 170, 170, 170, 170, 171, 172, 172, 172, 172,
- 172, 173, 173, 173, 174, 174, 175, 175, 176, 176,
- 177, 177, 178, 178, 179, 180, 180, 180, 180, 180,
- 181, 181, 181, 182, 182, 182, 182, 183, 183, 183,
- 184, 184, 184, 184, 184, 185, 185, 185, 186, 186,
- 186, 186, 186, 186, 186, 187, 187, 187, 187, 187,
- 187, 187, 187, 187, 187, 188, 188, 189, 189, 189,
- 189, 189, 189, 190, 190, 191, 191, 192, 192, 193,
- 193, 194, 195, 195, 196, 196, 197, 197, 198, 198,
- 198, 198, 198, 198, 198, 199, 199, 199, 199, 199,
- 199, 199, 199, 199, 199, 199, 199, 199, 200, 201,
- 201, 202, 202, 203, 203, 203, 203, 204, 204, 205,
- 205, 205, 205, 205, 205, 205, 205, 205, 205, 205,
- 205, 205, 205, 205, 205, 205, 205, 205, 205, 206,
- 206, 206, 206, 206, 206, 206, 206, 206, 206, 207,
- 207, 208, 208, 209, 209, 210, 210, 211, 211, 212,
- 212, 214, 213, 215, 213, 213, 213, 213, 216, 213,
- 217, 213, 218, 213, 213, 213, 213, 219, 220, 220,
- 221, 222, 222, 222, 223, 223, 224, 224, 224, 224,
- 225, 226, 226, 227, 228, 228, 229, 230, 231, 231,
- 232, 232, 232, 232, 232, 232, 232, 232, 232, 232,
- 232, 233, 233, 233, 233, 234, 234, 235, 236, 236,
- 237, 237, 238, 239, 239, 239, 240, 240, 240, 240,
- 240, 240, 240, 240, 240, 241, 241, 242, 243, 243,
- 244, 244, 244, 244, 244, 245, 245, 246, 246, 247,
- 247, 247, 247, 247, 247, 247, 247, 247, 247, 247,
- 247, 247, 248, 248, 249, 249, 249, 249, 249, 249,
- 249, 249, 249
-};
-
-/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
-static const yytype_uint8 yyr2[] =
-{
- 0, 2, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 0, 4, 0, 2, 0,
- 1, 1, 1, 0, 2, 1, 1, 1, 1, 1,
- 1, 1, 1, 0, 1, 1, 1, 0, 1, 1,
- 0, 1, 1, 1, 1, 0, 1, 1, 0, 1,
- 1, 1, 1, 1, 2, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 2, 0, 2, 1, 1, 1,
- 1, 1, 1, 0, 2, 0, 2, 0, 2, 0,
- 3, 2, 0, 1, 0, 3, 1, 2, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 3, 1, 2,
- 5, 5, 5, 5, 3, 2, 5, 4, 2, 1,
- 1, 1, 3, 1, 3, 1, 0, 1, 3, 4,
- 3, 3, 4, 4, 3, 6, 5, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 6,
- 5, 8, 6, 6, 7, 7, 6, 8, 8, 3,
- 1, 1, 1, 1, 0, 2, 6, 1, 0, 1,
- 2, 0, 3, 0, 3, 3, 3, 3, 0, 8,
- 0, 9, 0, 9, 5, 2, 3, 1, 3, 3,
- 3, 3, 1, 0, 5, 3, 1, 3, 1, 0,
- 10, 1, 1, 4, 1, 1, 2, 3, 0, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 3, 1,
- 5, 1, 1, 1, 1, 1, 1, 2, 1, 3,
- 2, 2, 3, 2, 0, 1, 2, 2, 3, 9,
- 9, 8, 14, 1, 1, 6, 5, 2, 6, 7,
- 4, 4, 6, 6, 0, 0, 3, 2, 1, 5,
- 5, 6, 6, 4, 6, 4, 4, 6, 6, 2,
- 8, 1, 1, 0, 3, 6, 3, 6, 2, 5,
- 7, 5, 4
-};
-
-/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
- STATE-NUM when YYTABLE doesn't specify something else to do. Zero
- means the default is an error. */
-static const yytype_uint16 yydefact[] =
-{
- 73, 61, 70, 62, 71, 63, 213, 211, 0, 0,
- 0, 0, 0, 0, 83, 72, 0, 73, 209, 87,
- 90, 0, 0, 225, 0, 0, 68, 0, 74, 75,
- 77, 76, 78, 80, 79, 81, 82, 84, 85, 86,
- 83, 83, 204, 1, 210, 88, 89, 83, 214, 91,
- 92, 93, 94, 83, 274, 212, 274, 0, 0, 233,
- 226, 227, 215, 261, 262, 217, 138, 139, 140, 143,
- 142, 141, 144, 145, 0, 0, 0, 0, 263, 264,
- 146, 216, 148, 204, 204, 95, 203, 0, 98, 98,
- 275, 271, 69, 244, 245, 246, 270, 228, 229, 232,
- 0, 166, 149, 0, 0, 0, 0, 155, 167, 0,
- 0, 166, 0, 0, 0, 97, 96, 0, 201, 202,
- 0, 0, 99, 100, 101, 102, 103, 0, 247, 0,
- 313, 273, 0, 230, 165, 115, 161, 163, 0, 0,
- 0, 0, 0, 0, 154, 0, 0, 147, 0, 0,
- 160, 0, 159, 0, 224, 138, 139, 140, 143, 142,
- 141, 0, 0, 67, 67, 104, 0, 241, 242, 243,
- 312, 298, 0, 0, 0, 0, 98, 283, 284, 2,
- 3, 4, 5, 6, 7, 8, 9, 10, 14, 15,
- 16, 11, 12, 13, 0, 0, 0, 0, 0, 0,
- 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
- 27, 28, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 272, 98, 287, 0, 311, 231, 158, 0,
- 123, 67, 67, 157, 0, 168, 0, 123, 67, 67,
- 0, 205, 186, 187, 182, 184, 183, 185, 188, 181,
- 177, 178, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 180, 179, 218, 0,
- 297, 277, 67, 268, 276, 0, 0, 55, 0, 0,
- 29, 30, 31, 32, 33, 34, 35, 36, 37, 38,
- 0, 53, 54, 49, 50, 51, 52, 39, 40, 41,
- 42, 43, 44, 45, 46, 47, 48, 0, 129, 129,
- 318, 67, 67, 309, 0, 0, 0, 0, 0, 67,
- 67, 67, 0, 0, 0, 0, 0, 106, 108, 107,
- 105, 109, 110, 111, 112, 113, 116, 164, 162, 151,
- 152, 153, 156, 66, 150, 220, 222, 0, 0, 0,
- 0, 0, 0, 0, 0, 170, 200, 0, 0, 0,
- 174, 0, 171, 0, 0, 0, 134, 239, 250, 251,
- 252, 257, 253, 254, 255, 256, 248, 0, 259, 266,
- 265, 267, 0, 0, 278, 0, 0, 67, 67, 0,
- 314, 0, 316, 295, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 67, 0, 114, 120,
- 119, 117, 118, 121, 122, 124, 134, 134, 0, 0,
- 0, 295, 0, 0, 0, 0, 0, 169, 155, 167,
- 0, 172, 173, 0, 0, 0, 0, 219, 238, 115,
- 236, 0, 249, 0, 0, 269, 0, 0, 0, 0,
- 0, 0, 0, 0, 322, 0, 0, 0, 305, 306,
- 0, 0, 0, 0, 0, 303, 0, 129, 0, 221,
- 223, 67, 0, 0, 0, 0, 0, 0, 0, 199,
- 176, 0, 0, 0, 0, 0, 0, 136, 134, 65,
- 0, 123, 0, 258, 0, 0, 294, 0, 0, 129,
- 130, 129, 0, 0, 0, 0, 0, 0, 321, 299,
- 300, 294, 0, 319, 67, 206, 0, 0, 190, 0,
- 0, 0, 0, 175, 0, 0, 67, 131, 137, 135,
- 64, 235, 237, 115, 132, 0, 0, 0, 115, 115,
- 0, 301, 302, 315, 317, 296, 0, 0, 304, 307,
- 308, 0, 129, 0, 0, 0, 196, 0, 0, 192,
- 193, 189, 65, 133, 127, 260, 0, 0, 0, 0,
- 123, 0, 288, 0, 123, 320, 194, 195, 0, 0,
- 0, 234, 0, 125, 0, 281, 0, 0, 106, 108,
- 115, 115, 0, 115, 115, 289, 310, 191, 197, 198,
- 128, 0, 240, 279, 0, 280, 0, 291, 290, 0,
- 0, 0, 126, 0, 0, 0, 115, 115, 0, 0,
- 0, 293, 292, 286, 0, 0, 285, 0, 282
-};
-
-/* YYDEFGOTO[NTERM-NUM]. */
-static const yytype_int16 yydefgoto[] =
-{
- -1, 263, 264, 265, 290, 307, 161, 162, 78, 531,
- 112, 12, 79, 14, 15, 40, 41, 42, 47, 53,
- 117, 127, 336, 228, 415, 339, 602, 583, 390, 487,
- 564, 437, 488, 80, 163, 136, 153, 137, 138, 109,
- 356, 378, 357, 120, 87, 154, 16, 17, 18, 20,
- 19, 366, 416, 417, 62, 23, 60, 100, 440, 441,
- 128, 169, 54, 95, 55, 48, 443, 379, 82, 381,
- 273, 274, 56, 91, 92, 222, 587, 131, 313, 540,
- 454, 223, 224, 225, 226
-};
-
-/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
- STATE-NUM. */
-#define YYPACT_NINF -561
-static const yytype_int16 yypact[] =
-{
- 284, -561, -561, -561, -561, -561, -561, -561, -34, -121,
- 14, -63, 101, -22, 17, -561, 127, 883, -561, 22,
- 162, 10, 23, -561, 12, 158, -561, 1464, -561, -561,
- -561, -561, -561, -561, -561, -561, -561, -561, -561, -561,
- -46, -46, 176, -561, -561, -561, -561, -46, -561, -561,
- -561, -561, -561, -46, 200, -561, -10, 209, 219, 234,
- -561, -561, -561, -561, -561, 124, -561, -561, -561, -561,
- -561, -561, -561, -561, 272, 275, 2, 126, -561, -561,
- -561, 28, -561, 243, 243, 196, -561, 165, 33, 33,
- -561, -561, 215, -561, -561, -561, -561, -561, -561, -561,
- -73, 1059, -561, 129, 132, 506, 124, -561, 28, -111,
- 134, 1059, 137, 165, 165, -561, -561, 1014, -561, -561,
- 1504, 292, -561, -561, -561, -561, -561, 1562, -561, -6,
- 1843, -561, 278, -561, -561, 28, -561, 147, 153, 1620,
- 1620, 148, -110, 1620, -561, 309, 164, -561, 1504, 1620,
- 124, 166, 28, 388, -561, 342, 310, 311, 314, 316,
- 317, 156, 322, 1115, 279, -561, 16, -561, -561, -561,
- -561, -561, 281, 1660, 20, 327, 33, -561, -561, -561,
- -561, -561, -561, -561, -561, -561, -561, -561, -561, -561,
- -561, -561, -561, -561, 511, 787, 1620, 1620, 1620, 1620,
- -561, -561, -561, -561, -561, -561, -561, -561, -561, -561,
- -561, -561, 1620, 1620, 1620, 1620, 1620, 1620, 1620, 1620,
- 1620, 1620, -561, 33, -561, -60, -561, -561, 434, 1345,
- -561, -7, -33, -561, 181, 28, 192, -561, 279, -16,
- 1014, -561, -561, -561, -561, -561, -561, -561, -561, -561,
- -561, -561, 511, 787, 198, 199, 201, 203, 204, 1385,
- 1678, 609, 329, 207, 208, 210, -561, -561, -561, 211,
- -561, 124, 702, -561, 206, 841, 841, -561, 841, 1562,
- -561, -561, -561, -561, -561, -561, -561, -561, -561, -561,
- 1620, -561, -561, -561, -561, -561, -561, -561, -561, -561,
- -561, -561, -561, -561, -561, -561, -561, 1620, 100, 114,
- -561, 702, -31, 222, 225, 227, 228, 235, 239, 702,
- 702, 702, 325, 1562, 1620, 1620, 360, -561, -561, -561,
- -561, -561, -561, -561, -561, -561, -561, -561, -561, -96,
- -561, -561, -561, -561, -96, -561, 137, 361, 247, 252,
- 1504, 1504, 1504, 1504, 1504, -561, -561, -54, 788, -88,
- -561, -85, -561, 1504, 1504, 1504, 250, 1406, -561, -561,
- -561, -561, -561, -561, -561, -561, 345, 1504, -561, -561,
- -561, -561, 1620, 255, -561, 259, 841, 702, 702, 4,
- -561, 5, -561, -561, 841, 249, 1620, 1620, 1620, 1620,
- 1620, 261, 262, 263, 1620, 841, 702, 266, -561, -561,
- -561, -561, -561, -561, -561, -561, 250, 250, 1620, 1504,
- 1504, -561, 269, 274, 276, 277, 1504, -561, 265, 969,
- -83, -561, -561, 282, 283, 391, -5, -561, -561, 28,
- 285, 289, -561, 413, -78, -561, 426, 427, 294, 293,
- 295, 841, 442, 841, 296, 299, 841, 300, 28, -561,
- 301, 302, 444, 841, 841, 28, 306, 305, 1620, -561,
- -561, -45, 307, 308, 94, 1504, 1504, 1504, 1504, -561,
- -561, 312, 1504, 1504, 1620, 438, 463, -561, 250, 1746,
- 1446, -561, 315, -561, 841, 841, 1718, 841, 841, 305,
- -561, 305, 1620, 841, 318, 1620, 1620, 1620, -561, -561,
- -561, 1718, 415, -561, 702, -561, 1504, 1504, -561, 320,
- 323, 324, 328, -561, 331, 332, -30, -561, -561, -561,
- -561, -561, -561, 28, 81, 455, 334, 333, 123, 28,
- 95, -561, -561, -561, -561, -561, 335, 841, -561, -561,
- -561, 98, 305, 339, 343, 1504, -561, 1504, 1504, -561,
- -561, -561, 1746, -561, 433, -561, 479, -4, 560, 560,
- -561, 1736, -561, 341, -561, -561, -561, -561, 346, 349,
- 351, -561, 500, 358, 841, -561, 1255, -1, 355, 356,
- -561, -561, 87, 123, 28, -561, -96, -561, -561, -561,
- -561, 489, -561, -561, 370, -561, 1255, 434, 434, 495,
- 560, 560, -561, 498, 373, 841, -561, -561, 841, 514,
- 460, 434, 434, -561, 841, 516, -561, 841, -561
-};
-
-/* YYPGOTO[NTERM-NUM]. */
-static const yytype_int16 yypgoto[] =
-{
- -561, 406, 407, 408, 298, 303, -173, -561, 0, -15,
- -150, 454, 8, -561, -561, -561, -561, 189, -561, -561,
- -561, -149, -561, -409, -561, -234, -561, -561, -289, 24,
- -561, -404, -561, -561, -26, 330, -122, -561, 443, 452,
- -92, -159, -226, 102, 183, 321, -561, -561, 548, -561,
- -561, -561, -561, -561, -561, -561, -561, -561, -561, -561,
- 477, -561, -561, -561, -561, -561, -561, -560, -76, 46,
- -105, -561, -561, 519, -561, -561, -561, -561, -561, 61,
- 160, -561, -561, -561, -561
-};
-
-/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
- positive, shift that token. If negative, reduce the rule which
- number is the opposite. If zero, do what YYDEFACT says.
- If YYTABLE_NINF, syntax error. */
-#define YYTABLE_NINF -209
-static const yytype_int16 yytable[] =
-{
- 11, 81, 278, 344, 266, 166, 104, 277, 13, 110,
- 277, 90, 469, 470, 268, 451, 453, 11, 21, 93,
- 392, 110, 167, 110, 110, 13, 604, 279, 164, 485,
- 489, 275, 24, 22, 359, 361, 2, 276, 110, 4,
- 409, 410, 411, 143, 143, 412, 614, 110, 486, 413,
- 414, 108, 144, 234, 324, 325, 238, 452, 452, 29,
- 30, 31, 32, 33, 34, 35, 426, 36, 45, 426,
- 46, 426, 25, 431, 323, 135, 426, 241, 432, 108,
- 481, 132, 110, 493, 529, 135, 133, 267, 345, 346,
- 26, 152, 11, 310, 121, 122, 123, 124, 125, 126,
- 426, 152, 37, 38, 39, 427, 111, 515, 314, 315,
- 316, 317, 318, 231, 232, 485, 322, 235, 111, 27,
- 111, 111, 561, 239, 562, 609, 394, 43, 341, 568,
- 569, 28, 430, 63, 64, 111, 106, 66, 67, 68,
- 69, 70, 71, 72, 111, 1, 2, 272, 3, 4,
- 5, 444, 340, 94, 110, 585, 168, 386, 605, 244,
- 245, 246, 247, 57, 105, 37, 38, 39, 110, 59,
- 308, 309, 272, 311, 269, 73, 58, -144, 513, 111,
- 61, 607, 608, -67, 610, 611, 312, 272, 272, 272,
- 272, 272, 319, 320, 321, 272, 380, 118, 119, 380,
- 380, 405, 380, 135, 49, 50, 51, 621, 622, 52,
- 543, 85, 544, 86, 152, 148, 149, 409, 410, 411,
- 407, 90, 412, 409, 410, 411, 413, 414, 412, 83,
- 84, 97, 413, 414, 1, 380, 88, 3, 115, 5,
- 116, 98, 89, 380, 380, 380, 518, 570, 502, 571,
- 574, 111, 571, 152, 389, -67, 99, 534, 421, 422,
- 423, 424, 425, 575, 387, 111, 113, 114, 391, -67,
- 266, 433, 434, 435, -144, 101, 102, 445, -144, 103,
- 86, 388, 74, 75, -208, 145, 76, 139, 77, 107,
- 140, 457, 147, 459, 460, 461, 165, 152, 406, 272,
- 227, 229, -69, 1, 2, 230, 3, 4, 5, 233,
- 380, 380, 380, 236, 6, 7, 237, 240, 380, -56,
- -57, 383, 384, -60, 385, -59, -58, 472, 473, 380,
- 380, 248, 429, 110, 479, 8, 592, 270, 277, 9,
- 596, 439, 342, 10, 343, -55, -55, -55, -55, 350,
- 351, 362, 352, 267, 353, 354, 272, 393, 363, 364,
- 382, 365, 367, 404, 408, 401, 402, 403, 242, 243,
- 272, 458, 272, 272, 272, 380, 395, 380, 465, 396,
- 380, 397, 398, 519, 520, 521, 522, 380, 380, 399,
- 524, 525, 471, 400, 586, 63, 64, 545, 419, 418,
- 548, 549, 550, 420, 436, 442, 456, 1, 2, 446,
- 3, 4, 5, 447, 606, 462, 463, 464, 380, 380,
- 468, 380, 380, 475, 553, 554, 480, 380, 476, 484,
- 477, 478, 448, 449, 450, 492, 482, 483, 380, 490,
- 455, 491, 514, 494, 495, 496, 500, 497, 508, 498,
- 502, 466, 467, 503, 505, 506, 507, 511, 526, 512,
- 527, 516, 517, 578, 533, 579, 580, 528, 452, 535,
- 539, 380, 547, 523, 555, 556, 272, 565, 557, 272,
- 272, 272, 558, 559, 560, 539, 582, 326, 566, 530,
- 567, 576, 380, 380, 572, 577, 584, 499, 597, 501,
- 595, 598, 504, 599, 600, 601, -18, -19, 380, 509,
- 510, 612, 615, 63, 64, 618, 106, 66, 67, 68,
- 69, 70, 71, 72, 613, 1, 2, 619, 3, 4,
- 5, 624, 625, 627, 380, 380, 219, 220, 221, 380,
- 536, 537, 380, 541, 542, 594, 130, 581, 380, 546,
- 348, 380, 327, 328, 146, 73, 349, 142, 563, 338,
- 552, 347, 530, 368, 369, 44, 129, 63, 64, 370,
- 329, 330, 551, 331, 332, 96, 333, 334, 335, 1,
- 2, 474, 3, 4, 5, 371, 372, 373, 0, 0,
- 0, 0, 0, 573, 0, 0, 0, 0, 0, 0,
- 374, 375, 280, 281, 282, 283, 284, 285, 286, 287,
- 288, 289, 0, 326, 590, 591, 63, 64, 376, 106,
- 155, 156, 157, 158, 159, 160, 72, 0, 1, 2,
- 603, 3, 4, 5, 179, 180, 181, 182, 183, 184,
- 185, 186, 187, 188, 189, 190, 191, 192, 193, 252,
- 253, 0, 0, 0, 0, 0, 616, 617, 73, 0,
- 0, 620, 74, 75, 623, 0, 76, 0, 77, 141,
- 626, 0, 0, 628, 0, 0, 254, 200, 588, 589,
- 203, 204, 205, 206, 207, 208, 209, 210, 211, 0,
- 255, 0, 256, 257, 258, 0, 329, 330, 0, 331,
- 332, 0, 333, 334, 335, 368, 369, 0, 0, 63,
- 64, 370, 0, 0, 0, 0, 0, 0, 0, 0,
- 377, 1, 2, 0, 3, 4, 5, 371, 372, 373,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 374, 375, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 110, 0, 0, 0,
- 376, 0, 0, 0, 0, 74, 75, 0, 0, 76,
- 0, 77, 360, 0, 0, 0, 179, 180, 181, 182,
- 183, 184, 185, 186, 187, 188, 189, 190, 191, 192,
- 193, 252, 253, 0, 0, 63, 64, 0, 106, 155,
- 156, 157, 158, 159, 160, 72, 0, 1, 2, 0,
- 3, 4, 5, 291, 292, 0, 0, 0, 254, 200,
- 201, 202, 203, 204, 205, 206, 207, 208, 209, 210,
- 211, 0, 255, 0, 256, 257, 258, 73, 0, 0,
- 0, 0, 0, 0, 368, 369, 0, 0, 63, 64,
- 370, 0, 0, 111, 0, 0, 0, 0, 0, 0,
- 1, 2, 377, 3, 4, 5, 371, 372, 373, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 374, 375, -207, 293, 294, 295, 296, 297, 298,
- 299, 300, 301, 302, 303, 304, 305, 306, 0, 376,
- 0, -69, 1, 2, 0, 3, 4, 5, 0, 0,
- 0, 0, 0, 6, 7, 179, 180, 181, 182, 183,
- 184, 185, 186, 187, 188, 189, 190, 191, 192, 193,
- 252, 253, 0, 0, 8, 0, 0, 0, 9, 0,
- 0, 0, 10, 0, 74, 75, 0, 0, 76, 0,
- 77, 428, 0, 0, 0, 0, 0, 254, 200, 201,
- 202, 203, 204, 205, 206, 207, 208, 209, 210, 211,
- 0, 255, 0, 256, 257, 258, 63, 64, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 1, 2,
- 0, 3, 4, 5, 249, 0, 0, 0, 0, 0,
- 0, 377, 0, 0, 0, 0, 0, 0, 0, 250,
- 251, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 63, 64, 110, 150, 66, 67, 68, 69, 70,
- 71, 72, 0, 1, 2, 0, 3, 4, 5, 0,
- 0, 0, 0, 179, 180, 181, 182, 183, 184, 185,
- 186, 187, 188, 189, 190, 191, 192, 193, 252, 253,
- 0, 0, 0, 73, 0, 0, 63, 64, 0, 106,
- 66, 67, 68, 69, 70, 71, 72, 0, 1, 2,
- 0, 3, 4, 5, 0, 254, 200, 201, 202, 203,
- 204, 205, 206, 207, 208, 209, 210, 211, 134, 255,
- 0, 256, 257, 258, 0, 0, 0, 0, 73, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 111, 0, 63, 64, -67, 0, 259, 0, 0, 260,
- 0, 261, 0, 262, 1, 2, 151, 3, 4, 5,
- 249, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 250, 251, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 110,
- 74, 75, 0, 0, 76, 0, 77, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 179,
- 180, 181, 182, 183, 184, 185, 186, 187, 188, 189,
- 190, 191, 192, 193, 252, 253, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 74, 75, 0, 0, 76,
- 0, 77, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 254, 200, 201, 202, 203, 204, 205, 206, 207,
- 208, 209, 210, 211, 0, 255, 0, 256, 257, 258,
- 0, 0, 0, 0, 0, 0, 0, 0, 368, 369,
- 0, 0, 0, 0, 370, 0, 111, 0, 0, 0,
- 0, 0, 259, 0, 0, 260, 0, 261, 0, 262,
- 371, 372, 373, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 374, 375, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 376, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 179,
- 180, 181, 182, 183, 184, 185, 186, 187, 188, 189,
- 190, 191, 192, 193, 252, 253, 0, 0, 0, 0,
- 0, 0, 63, 64, 0, 106, 66, 67, 68, 69,
- 70, 71, 72, 0, 1, 2, 0, 3, 4, 5,
- 0, 254, 200, 201, 202, 203, 204, 205, 206, 207,
- 208, 209, 210, 211, 337, 255, 0, 256, 257, 258,
- 0, 0, 63, 64, 73, 106, 155, 156, 157, 158,
- 159, 160, 72, 0, 1, 2, 0, 3, 4, 5,
- 0, 0, 0, 63, 64, 377, 106, 66, 67, 68,
- 69, 70, 71, 72, 0, 1, 2, 0, 3, 4,
- 5, 0, 0, 0, 73, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 438, 0, 0, 0, 0,
- 0, 0, 0, 63, 64, 73, 106, 66, 67, 68,
- 69, 70, 71, 72, 0, 1, 2, 0, 3, 4,
- 5, 63, 64, 0, 65, 66, 67, 68, 69, 70,
- 71, 72, 0, 1, 2, 532, 3, 4, 5, 0,
- 0, 0, 0, 0, 0, 73, 0, 0, 0, 0,
- 0, 74, 75, 0, 0, 76, 0, 77, 0, 0,
- 0, 63, 64, 73, 106, 155, 156, 157, 158, 159,
- 160, 72, 0, 1, 2, 0, 3, 4, 5, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 74, 75, 0, 355, 76, 0, 77, 0, 0,
- 0, 0, 0, 73, 0, 0, 0, 0, 0, 0,
- 0, 0, 74, 75, 0, 0, 76, 0, 77, 63,
- 64, 0, 150, 66, 67, 68, 69, 70, 71, 72,
- 0, 1, 2, 0, 3, 4, 5, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 74, 75, 0, 0, 76, 0, 77, 0,
- 0, 73, 0, 0, 0, 0, 0, 0, 0, 0,
- 74, 75, 0, 0, 76, 0, 77, 63, 64, 0,
- 106, 66, 67, 68, 69, 70, 71, 72, 0, 1,
- 2, 0, 3, 4, 5, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 74, 75, 0, 0, 76, 0, 77, 63, 64, 73,
- 271, 66, 67, 68, 69, 70, 71, 72, 0, 1,
- 2, 0, 3, 4, 5, 63, 64, 0, 106, 155,
- 156, 157, 158, 159, 160, 72, 0, 1, 2, 0,
- 3, 4, 5, 0, 0, 0, 0, 0, 0, 73,
- 0, 0, 0, 0, 0, 0, 0, 0, 74, 75,
- 0, 0, 76, 0, 77, 63, 64, 73, 106, 66,
- 67, 68, 69, 70, 71, 538, 0, 1, 2, 0,
- 3, 4, 5, 63, 64, 0, 106, 66, 67, 68,
- 69, 70, 71, 593, 0, 1, 2, 0, 3, 4,
- 5, 0, 0, 0, 0, 1, 0, 73, 3, 0,
- 5, 0, 0, 0, 0, 0, 74, 75, 0, 0,
- 76, 0, 77, 0, 0, 73, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 326,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 74, 75, 0, 0,
- 76, 0, 77, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 74, 75, 0, 0, 76, 0,
- 358, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 327, 328, 0, 0, 0, 0,
- 0, 0, 0, 0, 74, 75, 0, 0, 76, 170,
- 77, 0, 329, 330, 0, 331, 332, 0, 333, 334,
- 335, 0, 74, 75, 0, 0, 76, 0, 77, 171,
- 172, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 173, 174, 175, 176, 177, 178, 179, 180, 181,
- 182, 183, 184, 185, 186, 187, 188, 189, 190, 191,
- 192, 193, 194, 195, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 196, 197, 198, 0, 0, 199,
- 200, 201, 202, 203, 204, 205, 206, 207, 208, 209,
- 210, 211, 212, 213, 214, 215, 216, 217, 218
-};
-
-static const yytype_int16 yycheck[] =
-{
- 0, 27, 175, 237, 163, 127, 4, 11, 0, 54,
- 11, 21, 416, 417, 164, 11, 11, 17, 52, 29,
- 309, 54, 28, 54, 54, 17, 586, 176, 120, 34,
- 439, 11, 153, 67, 260, 261, 20, 17, 54, 23,
- 136, 137, 138, 154, 154, 141, 606, 54, 53, 145,
- 146, 77, 163, 163, 114, 115, 148, 53, 53, 42,
- 43, 44, 45, 46, 47, 48, 154, 50, 46, 154,
- 48, 154, 58, 161, 223, 101, 154, 153, 163, 105,
- 163, 154, 54, 161, 488, 111, 159, 163, 238, 239,
- 153, 117, 92, 198, 61, 62, 63, 64, 65, 66,
- 154, 127, 148, 149, 150, 159, 151, 152, 213, 214,
- 215, 216, 217, 139, 140, 34, 221, 143, 151, 18,
- 151, 151, 152, 149, 533, 38, 157, 0, 161, 538,
- 539, 153, 358, 7, 8, 151, 10, 11, 12, 13,
- 14, 15, 16, 17, 151, 19, 20, 173, 22, 23,
- 24, 377, 159, 163, 54, 159, 162, 279, 159, 3,
- 4, 5, 6, 153, 162, 148, 149, 150, 54, 157,
- 196, 197, 198, 199, 166, 49, 153, 54, 467, 151,
- 22, 590, 591, 155, 593, 594, 212, 213, 214, 215,
- 216, 217, 218, 219, 220, 221, 272, 32, 33, 275,
- 276, 323, 278, 229, 42, 43, 44, 616, 617, 47,
- 499, 35, 501, 37, 240, 113, 114, 136, 137, 138,
- 325, 21, 141, 136, 137, 138, 145, 146, 141, 40,
- 41, 22, 145, 146, 19, 311, 47, 22, 42, 24,
- 44, 22, 53, 319, 320, 321, 152, 152, 154, 154,
- 152, 151, 154, 279, 154, 155, 22, 491, 350, 351,
- 352, 353, 354, 552, 290, 151, 83, 84, 154, 155,
- 429, 363, 364, 365, 151, 151, 4, 382, 155, 4,
- 37, 307, 156, 157, 0, 151, 160, 158, 162, 163,
- 158, 396, 155, 398, 399, 400, 4, 323, 324, 325,
- 22, 154, 18, 19, 20, 152, 22, 23, 24, 161,
- 386, 387, 388, 4, 30, 31, 152, 151, 394, 9,
- 9, 275, 276, 9, 278, 9, 9, 419, 420, 405,
- 406, 9, 358, 54, 426, 51, 570, 56, 11, 55,
- 574, 367, 161, 59, 152, 3, 4, 5, 6, 151,
- 151, 22, 151, 429, 151, 151, 382, 311, 151, 151,
- 154, 151, 151, 38, 4, 319, 320, 321, 26, 27,
- 396, 397, 398, 399, 400, 451, 154, 453, 404, 154,
- 456, 154, 154, 475, 476, 477, 478, 463, 464, 154,
- 482, 483, 418, 154, 567, 7, 8, 502, 151, 38,
- 505, 506, 507, 151, 154, 60, 157, 19, 20, 154,
- 22, 23, 24, 154, 587, 154, 154, 154, 494, 495,
- 154, 497, 498, 154, 516, 517, 161, 503, 154, 38,
- 154, 154, 386, 387, 388, 22, 154, 154, 514, 154,
- 394, 152, 468, 17, 17, 151, 4, 154, 4, 154,
- 154, 405, 406, 154, 154, 154, 154, 151, 484, 154,
- 22, 154, 154, 555, 490, 557, 558, 4, 53, 154,
- 496, 547, 154, 161, 154, 152, 502, 22, 154, 505,
- 506, 507, 154, 152, 152, 511, 53, 53, 154, 489,
- 157, 152, 568, 569, 159, 152, 17, 451, 152, 453,
- 159, 152, 456, 152, 4, 147, 151, 151, 584, 463,
- 464, 22, 17, 7, 8, 17, 10, 11, 12, 13,
- 14, 15, 16, 17, 154, 19, 20, 154, 22, 23,
- 24, 17, 72, 17, 610, 611, 130, 130, 130, 615,
- 494, 495, 618, 497, 498, 571, 92, 562, 624, 503,
- 252, 627, 118, 119, 111, 49, 253, 105, 534, 229,
- 514, 240, 562, 3, 4, 17, 89, 7, 8, 9,
- 136, 137, 511, 139, 140, 56, 142, 143, 144, 19,
- 20, 421, 22, 23, 24, 25, 26, 27, -1, -1,
- -1, -1, -1, 547, -1, -1, -1, -1, -1, -1,
- 40, 41, 91, 92, 93, 94, 95, 96, 97, 98,
- 99, 100, -1, 53, 568, 569, 7, 8, 58, 10,
- 11, 12, 13, 14, 15, 16, 17, -1, 19, 20,
- 584, 22, 23, 24, 74, 75, 76, 77, 78, 79,
- 80, 81, 82, 83, 84, 85, 86, 87, 88, 89,
- 90, -1, -1, -1, -1, -1, 610, 611, 49, -1,
- -1, 615, 156, 157, 618, -1, 160, -1, 162, 163,
- 624, -1, -1, 627, -1, -1, 116, 117, 118, 119,
- 120, 121, 122, 123, 124, 125, 126, 127, 128, -1,
- 130, -1, 132, 133, 134, -1, 136, 137, -1, 139,
- 140, -1, 142, 143, 144, 3, 4, -1, -1, 7,
- 8, 9, -1, -1, -1, -1, -1, -1, -1, -1,
- 160, 19, 20, -1, 22, 23, 24, 25, 26, 27,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, 40, 41, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, 54, -1, -1, -1,
- 58, -1, -1, -1, -1, 156, 157, -1, -1, 160,
- -1, 162, 163, -1, -1, -1, 74, 75, 76, 77,
- 78, 79, 80, 81, 82, 83, 84, 85, 86, 87,
- 88, 89, 90, -1, -1, 7, 8, -1, 10, 11,
- 12, 13, 14, 15, 16, 17, -1, 19, 20, -1,
- 22, 23, 24, 26, 27, -1, -1, -1, 116, 117,
- 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
- 128, -1, 130, -1, 132, 133, 134, 49, -1, -1,
- -1, -1, -1, -1, 3, 4, -1, -1, 7, 8,
- 9, -1, -1, 151, -1, -1, -1, -1, -1, -1,
- 19, 20, 160, 22, 23, 24, 25, 26, 27, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, 40, 41, 0, 97, 98, 99, 100, 101, 102,
- 103, 104, 105, 106, 107, 108, 109, 110, -1, 58,
- -1, 18, 19, 20, -1, 22, 23, 24, -1, -1,
- -1, -1, -1, 30, 31, 74, 75, 76, 77, 78,
- 79, 80, 81, 82, 83, 84, 85, 86, 87, 88,
- 89, 90, -1, -1, 51, -1, -1, -1, 55, -1,
- -1, -1, 59, -1, 156, 157, -1, -1, 160, -1,
- 162, 163, -1, -1, -1, -1, -1, 116, 117, 118,
- 119, 120, 121, 122, 123, 124, 125, 126, 127, 128,
- -1, 130, -1, 132, 133, 134, 7, 8, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, 19, 20,
- -1, 22, 23, 24, 25, -1, -1, -1, -1, -1,
- -1, 160, -1, -1, -1, -1, -1, -1, -1, 40,
- 41, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, 7, 8, 54, 10, 11, 12, 13, 14, 15,
- 16, 17, -1, 19, 20, -1, 22, 23, 24, -1,
- -1, -1, -1, 74, 75, 76, 77, 78, 79, 80,
- 81, 82, 83, 84, 85, 86, 87, 88, 89, 90,
- -1, -1, -1, 49, -1, -1, 7, 8, -1, 10,
- 11, 12, 13, 14, 15, 16, 17, -1, 19, 20,
- -1, 22, 23, 24, -1, 116, 117, 118, 119, 120,
- 121, 122, 123, 124, 125, 126, 127, 128, 39, 130,
- -1, 132, 133, 134, -1, -1, -1, -1, 49, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- 151, -1, 7, 8, 155, -1, 157, -1, -1, 160,
- -1, 162, -1, 164, 19, 20, 122, 22, 23, 24,
- 25, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, 40, 41, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, 54,
- 156, 157, -1, -1, 160, -1, 162, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, 74,
- 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
- 85, 86, 87, 88, 89, 90, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, 156, 157, -1, -1, 160,
- -1, 162, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, 116, 117, 118, 119, 120, 121, 122, 123, 124,
- 125, 126, 127, 128, -1, 130, -1, 132, 133, 134,
- -1, -1, -1, -1, -1, -1, -1, -1, 3, 4,
- -1, -1, -1, -1, 9, -1, 151, -1, -1, -1,
- -1, -1, 157, -1, -1, 160, -1, 162, -1, 164,
- 25, 26, 27, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, 40, 41, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, 58, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, 74,
- 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
- 85, 86, 87, 88, 89, 90, -1, -1, -1, -1,
- -1, -1, 7, 8, -1, 10, 11, 12, 13, 14,
- 15, 16, 17, -1, 19, 20, -1, 22, 23, 24,
- -1, 116, 117, 118, 119, 120, 121, 122, 123, 124,
- 125, 126, 127, 128, 39, 130, -1, 132, 133, 134,
- -1, -1, 7, 8, 49, 10, 11, 12, 13, 14,
- 15, 16, 17, -1, 19, 20, -1, 22, 23, 24,
- -1, -1, -1, 7, 8, 160, 10, 11, 12, 13,
- 14, 15, 16, 17, -1, 19, 20, -1, 22, 23,
- 24, -1, -1, -1, 49, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, 39, -1, -1, -1, -1,
- -1, -1, -1, 7, 8, 49, 10, 11, 12, 13,
- 14, 15, 16, 17, -1, 19, 20, -1, 22, 23,
- 24, 7, 8, -1, 10, 11, 12, 13, 14, 15,
- 16, 17, -1, 19, 20, 39, 22, 23, 24, -1,
- -1, -1, -1, -1, -1, 49, -1, -1, -1, -1,
- -1, 156, 157, -1, -1, 160, -1, 162, -1, -1,
- -1, 7, 8, 49, 10, 11, 12, 13, 14, 15,
- 16, 17, -1, 19, 20, -1, 22, 23, 24, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, 156, 157, -1, 159, 160, -1, 162, -1, -1,
- -1, -1, -1, 49, -1, -1, -1, -1, -1, -1,
- -1, -1, 156, 157, -1, -1, 160, -1, 162, 7,
- 8, -1, 10, 11, 12, 13, 14, 15, 16, 17,
- -1, 19, 20, -1, 22, 23, 24, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, 156, 157, -1, -1, 160, -1, 162, -1,
- -1, 49, -1, -1, -1, -1, -1, -1, -1, -1,
- 156, 157, -1, -1, 160, -1, 162, 7, 8, -1,
- 10, 11, 12, 13, 14, 15, 16, 17, -1, 19,
- 20, -1, 22, 23, 24, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- 156, 157, -1, -1, 160, -1, 162, 7, 8, 49,
- 10, 11, 12, 13, 14, 15, 16, 17, -1, 19,
- 20, -1, 22, 23, 24, 7, 8, -1, 10, 11,
- 12, 13, 14, 15, 16, 17, -1, 19, 20, -1,
- 22, 23, 24, -1, -1, -1, -1, -1, -1, 49,
- -1, -1, -1, -1, -1, -1, -1, -1, 156, 157,
- -1, -1, 160, -1, 162, 7, 8, 49, 10, 11,
- 12, 13, 14, 15, 16, 17, -1, 19, 20, -1,
- 22, 23, 24, 7, 8, -1, 10, 11, 12, 13,
- 14, 15, 16, 17, -1, 19, 20, -1, 22, 23,
- 24, -1, -1, -1, -1, 19, -1, 49, 22, -1,
- 24, -1, -1, -1, -1, -1, 156, 157, -1, -1,
- 160, -1, 162, -1, -1, 49, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, 53,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, 156, 157, -1, -1,
- 160, -1, 162, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, 156, 157, -1, -1, 160, -1,
- 162, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, 118, 119, -1, -1, -1, -1,
- -1, -1, -1, -1, 156, 157, -1, -1, 160, 36,
- 162, -1, 136, 137, -1, 139, 140, -1, 142, 143,
- 144, -1, 156, 157, -1, -1, 160, -1, 162, 56,
- 57, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, 68, 69, 70, 71, 72, 73, 74, 75, 76,
- 77, 78, 79, 80, 81, 82, 83, 84, 85, 86,
- 87, 88, 89, 90, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, 111, 112, 113, -1, -1, 116,
- 117, 118, 119, 120, 121, 122, 123, 124, 125, 126,
- 127, 128, 129, 130, 131, 132, 133, 134, 135
-};
-
-/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
- symbol of state STATE-NUM. */
-static const yytype_uint8 yystos[] =
-{
- 0, 19, 20, 22, 23, 24, 30, 31, 51, 55,
- 59, 173, 176, 177, 178, 179, 211, 212, 213, 215,
- 214, 52, 67, 220, 153, 58, 153, 18, 153, 42,
- 43, 44, 45, 46, 47, 48, 50, 148, 149, 150,
- 180, 181, 182, 0, 213, 46, 48, 183, 230, 42,
- 43, 44, 47, 184, 227, 229, 237, 153, 153, 157,
- 221, 22, 219, 7, 8, 10, 11, 12, 13, 14,
- 15, 16, 17, 49, 156, 157, 160, 162, 173, 177,
- 198, 199, 233, 182, 182, 35, 37, 209, 182, 182,
- 21, 238, 239, 29, 163, 228, 238, 22, 22, 22,
- 222, 151, 4, 4, 4, 162, 10, 163, 199, 204,
- 54, 151, 175, 209, 209, 42, 44, 185, 32, 33,
- 208, 61, 62, 63, 64, 65, 66, 186, 225, 225,
- 176, 242, 154, 159, 39, 199, 200, 202, 203, 158,
- 158, 163, 204, 154, 163, 151, 203, 155, 208, 208,
- 10, 122, 199, 201, 210, 11, 12, 13, 14, 15,
- 16, 171, 172, 199, 205, 4, 201, 28, 162, 226,
- 36, 56, 57, 68, 69, 70, 71, 72, 73, 74,
- 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
- 85, 86, 87, 88, 89, 90, 111, 112, 113, 116,
- 117, 118, 119, 120, 121, 122, 123, 124, 125, 126,
- 127, 128, 129, 130, 131, 132, 133, 134, 135, 166,
- 167, 168, 240, 246, 247, 248, 249, 22, 188, 154,
- 152, 199, 199, 161, 163, 199, 4, 152, 205, 199,
- 151, 233, 26, 27, 3, 4, 5, 6, 9, 25,
- 40, 41, 89, 90, 116, 130, 132, 133, 134, 157,
- 160, 162, 164, 166, 167, 168, 206, 233, 175, 177,
- 56, 10, 199, 235, 236, 11, 17, 11, 171, 186,
- 91, 92, 93, 94, 95, 96, 97, 98, 99, 100,
- 169, 26, 27, 97, 98, 99, 100, 101, 102, 103,
- 104, 105, 106, 107, 108, 109, 110, 170, 199, 199,
- 235, 199, 199, 243, 235, 235, 235, 235, 235, 199,
- 199, 199, 235, 186, 114, 115, 53, 118, 119, 136,
- 137, 139, 140, 142, 143, 144, 187, 39, 200, 190,
- 159, 161, 161, 152, 190, 175, 175, 210, 169, 170,
- 151, 151, 151, 151, 151, 159, 205, 207, 162, 207,
- 163, 207, 22, 151, 151, 151, 216, 151, 3, 4,
- 9, 25, 26, 27, 40, 41, 58, 160, 206, 232,
- 233, 234, 154, 234, 234, 234, 201, 199, 199, 154,
- 193, 154, 193, 234, 157, 154, 154, 154, 154, 154,
- 154, 234, 234, 234, 38, 201, 199, 235, 4, 136,
- 137, 138, 141, 145, 146, 189, 217, 218, 38, 151,
- 151, 205, 205, 205, 205, 205, 154, 159, 163, 199,
- 207, 161, 163, 205, 205, 205, 154, 196, 39, 199,
- 223, 224, 60, 231, 207, 235, 154, 154, 234, 234,
- 234, 11, 53, 11, 245, 234, 157, 235, 199, 235,
- 235, 235, 154, 154, 154, 199, 234, 234, 154, 196,
- 196, 199, 205, 205, 245, 154, 154, 154, 154, 205,
- 161, 163, 154, 154, 38, 34, 53, 194, 197, 188,
- 154, 152, 22, 161, 17, 17, 151, 154, 154, 234,
- 4, 234, 154, 154, 234, 154, 154, 154, 4, 234,
- 234, 151, 154, 193, 199, 152, 154, 154, 152, 205,
- 205, 205, 205, 161, 205, 205, 199, 22, 4, 196,
- 173, 174, 39, 199, 190, 154, 234, 234, 17, 199,
- 244, 234, 234, 193, 193, 235, 234, 154, 235, 235,
- 235, 244, 234, 205, 205, 154, 152, 154, 154, 152,
- 152, 152, 188, 194, 195, 22, 154, 157, 188, 188,
- 152, 154, 159, 234, 152, 193, 152, 152, 205, 205,
- 205, 174, 53, 192, 17, 159, 171, 241, 118, 119,
- 234, 234, 190, 17, 199, 159, 190, 152, 152, 152,
- 4, 147, 191, 234, 232, 159, 171, 188, 188, 38,
- 188, 188, 22, 154, 232, 17, 234, 234, 17, 154,
- 234, 188, 188, 234, 17, 72, 234, 17, 234
-};
-
-#define yyerrok (yyerrstatus = 0)
-#define yyclearin (yychar = YYEMPTY)
-#define YYEMPTY (-2)
-#define YYEOF 0
-
-#define YYACCEPT goto yyacceptlab
-#define YYABORT goto yyabortlab
-#define YYERROR goto yyerrorlab
-
-
-/* Like YYERROR except do call yyerror. This remains here temporarily
- to ease the transition to the new meaning of YYERROR, for GCC.
- Once GCC version 2 has supplanted version 1, this can go. */
-
-#define YYFAIL goto yyerrlab
-
-#define YYRECOVERING() (!!yyerrstatus)
-
-#define YYBACKUP(Token, Value) \
-do \
- if (yychar == YYEMPTY && yylen == 1) \
- { \
- yychar = (Token); \
- yylval = (Value); \
- yytoken = YYTRANSLATE (yychar); \
- YYPOPSTACK (1); \
- goto yybackup; \
- } \
- else \
- { \
- yyerror (YY_("syntax error: cannot back up")); \
- YYERROR; \
- } \
-while (YYID (0))
-
-
-#define YYTERROR 1
-#define YYERRCODE 256
-
-
-/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
- If N is 0, then set CURRENT to the empty location which ends
- the previous symbol: RHS[0] (always defined). */
-
-#define YYRHSLOC(Rhs, K) ((Rhs)[K])
-#ifndef YYLLOC_DEFAULT
-# define YYLLOC_DEFAULT(Current, Rhs, N) \
- do \
- if (YYID (N)) \
- { \
- (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
- (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
- (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
- (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
- } \
- else \
- { \
- (Current).first_line = (Current).last_line = \
- YYRHSLOC (Rhs, 0).last_line; \
- (Current).first_column = (Current).last_column = \
- YYRHSLOC (Rhs, 0).last_column; \
- } \
- while (YYID (0))
-#endif
-
-
-/* YY_LOCATION_PRINT -- Print the location on the stream.
- This macro was not mandated originally: define only if we know
- we won't break user code: when these are the locations we know. */
-
-#ifndef YY_LOCATION_PRINT
-# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
-# define YY_LOCATION_PRINT(File, Loc) \
- fprintf (File, "%d.%d-%d.%d", \
- (Loc).first_line, (Loc).first_column, \
- (Loc).last_line, (Loc).last_column)
-# else
-# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
-# endif
-#endif
-
-
-/* YYLEX -- calling `yylex' with the right arguments. */
-
-#ifdef YYLEX_PARAM
-# define YYLEX yylex (YYLEX_PARAM)
-#else
-# define YYLEX yylex ()
-#endif
-
-/* Enable debugging if requested. */
-#if YYDEBUG
-
-# ifndef YYFPRINTF
-# include <stdio.h> /* INFRINGES ON USER NAME SPACE */
-# define YYFPRINTF fprintf
-# endif
-
-# define YYDPRINTF(Args) \
-do { \
- if (yydebug) \
- YYFPRINTF Args; \
-} while (YYID (0))
-
-# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
-do { \
- if (yydebug) \
- { \
- YYFPRINTF (stderr, "%s ", Title); \
- yy_symbol_print (stderr, \
- Type, Value); \
- YYFPRINTF (stderr, "\n"); \
- } \
-} while (YYID (0))
-
-
-/*--------------------------------.
-| Print this symbol on YYOUTPUT. |
-`--------------------------------*/
-
-/*ARGSUSED*/
-#if (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
-static void
-yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
-#else
-static void
-yy_symbol_value_print (yyoutput, yytype, yyvaluep)
- FILE *yyoutput;
- int yytype;
- YYSTYPE const * const yyvaluep;
-#endif
-{
- if (!yyvaluep)
- return;
-# ifdef YYPRINT
- if (yytype < YYNTOKENS)
- YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
-# else
- YYUSE (yyoutput);
-# endif
- switch (yytype)
- {
- default:
- break;
- }
-}
-
-
-/*--------------------------------.
-| Print this symbol on YYOUTPUT. |
-`--------------------------------*/
-
-#if (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
-static void
-yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
-#else
-static void
-yy_symbol_print (yyoutput, yytype, yyvaluep)
- FILE *yyoutput;
- int yytype;
- YYSTYPE const * const yyvaluep;
-#endif
-{
- if (yytype < YYNTOKENS)
- YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
- else
- YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
-
- yy_symbol_value_print (yyoutput, yytype, yyvaluep);
- YYFPRINTF (yyoutput, ")");
-}
-
-/*------------------------------------------------------------------.
-| yy_stack_print -- Print the state stack from its BOTTOM up to its |
-| TOP (included). |
-`------------------------------------------------------------------*/
-
-#if (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
-static void
-yy_stack_print (yytype_int16 *bottom, yytype_int16 *top)
-#else
-static void
-yy_stack_print (bottom, top)
- yytype_int16 *bottom;
- yytype_int16 *top;
-#endif
-{
- YYFPRINTF (stderr, "Stack now");
- for (; bottom <= top; ++bottom)
- YYFPRINTF (stderr, " %d", *bottom);
- YYFPRINTF (stderr, "\n");
-}
-
-# define YY_STACK_PRINT(Bottom, Top) \
-do { \
- if (yydebug) \
- yy_stack_print ((Bottom), (Top)); \
-} while (YYID (0))
-
-
-/*------------------------------------------------.
-| Report that the YYRULE is going to be reduced. |
-`------------------------------------------------*/
-
-#if (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
-static void
-yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
-#else
-static void
-yy_reduce_print (yyvsp, yyrule)
- YYSTYPE *yyvsp;
- int yyrule;
-#endif
-{
- int yynrhs = yyr2[yyrule];
- int yyi;
- unsigned long int yylno = yyrline[yyrule];
- YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
- yyrule - 1, yylno);
- /* The symbols being reduced. */
- for (yyi = 0; yyi < yynrhs; yyi++)
- {
- fprintf (stderr, " $%d = ", yyi + 1);
- yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
- &(yyvsp[(yyi + 1) - (yynrhs)])
- );
- fprintf (stderr, "\n");
- }
-}
-
-# define YY_REDUCE_PRINT(Rule) \
-do { \
- if (yydebug) \
- yy_reduce_print (yyvsp, Rule); \
-} while (YYID (0))
-
-/* Nonzero means print parse trace. It is left uninitialized so that
- multiple parsers can coexist. */
-int yydebug;
-#else /* !YYDEBUG */
-# define YYDPRINTF(Args)
-# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
-# define YY_STACK_PRINT(Bottom, Top)
-# define YY_REDUCE_PRINT(Rule)
-#endif /* !YYDEBUG */
-
-
-/* YYINITDEPTH -- initial size of the parser's stacks. */
-#ifndef YYINITDEPTH
-# define YYINITDEPTH 200
-#endif
-
-/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
- if the built-in stack extension method is used).
-
- Do not make this value too large; the results are undefined if
- YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
- evaluated with infinite-precision integer arithmetic. */
-
-#ifndef YYMAXDEPTH
-# define YYMAXDEPTH 10000
-#endif
-
-
-
-#if YYERROR_VERBOSE
-
-# ifndef yystrlen
-# if defined __GLIBC__ && defined _STRING_H
-# define yystrlen strlen
-# else
-/* Return the length of YYSTR. */
-#if (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
-static YYSIZE_T
-yystrlen (const char *yystr)
-#else
-static YYSIZE_T
-yystrlen (yystr)
- const char *yystr;
-#endif
-{
- YYSIZE_T yylen;
- for (yylen = 0; yystr[yylen]; yylen++)
- continue;
- return yylen;
-}
-# endif
-# endif
-
-# ifndef yystpcpy
-# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
-# define yystpcpy stpcpy
-# else
-/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
- YYDEST. */
-#if (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
-static char *
-yystpcpy (char *yydest, const char *yysrc)
-#else
-static char *
-yystpcpy (yydest, yysrc)
- char *yydest;
- const char *yysrc;
-#endif
-{
- char *yyd = yydest;
- const char *yys = yysrc;
-
- while ((*yyd++ = *yys++) != '\0')
- continue;
-
- return yyd - 1;
-}
-# endif
-# endif
-
-# ifndef yytnamerr
-/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
- quotes and backslashes, so that it's suitable for yyerror. The
- heuristic is that double-quoting is unnecessary unless the string
- contains an apostrophe, a comma, or backslash (other than
- backslash-backslash). YYSTR is taken from yytname. If YYRES is
- null, do not copy; instead, return the length of what the result
- would have been. */
-static YYSIZE_T
-yytnamerr (char *yyres, const char *yystr)
-{
- if (*yystr == '"')
- {
- YYSIZE_T yyn = 0;
- char const *yyp = yystr;
-
- for (;;)
- switch (*++yyp)
- {
- case '\'':
- case ',':
- goto do_not_strip_quotes;
-
- case '\\':
- if (*++yyp != '\\')
- goto do_not_strip_quotes;
- /* Fall through. */
- default:
- if (yyres)
- yyres[yyn] = *yyp;
- yyn++;
- break;
-
- case '"':
- if (yyres)
- yyres[yyn] = '\0';
- return yyn;
- }
- do_not_strip_quotes: ;
- }
-
- if (! yyres)
- return yystrlen (yystr);
-
- return yystpcpy (yyres, yystr) - yyres;
-}
-# endif
-
-/* Copy into YYRESULT an error message about the unexpected token
- YYCHAR while in state YYSTATE. Return the number of bytes copied,
- including the terminating null byte. If YYRESULT is null, do not
- copy anything; just return the number of bytes that would be
- copied. As a special case, return 0 if an ordinary "syntax error"
- message will do. Return YYSIZE_MAXIMUM if overflow occurs during
- size calculation. */
-static YYSIZE_T
-yysyntax_error (char *yyresult, int yystate, int yychar)
-{
- int yyn = yypact[yystate];
-
- if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
- return 0;
- else
- {
- int yytype = YYTRANSLATE (yychar);
- YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
- YYSIZE_T yysize = yysize0;
- YYSIZE_T yysize1;
- int yysize_overflow = 0;
- enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
- char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
- int yyx;
-
-# if 0
- /* This is so xgettext sees the translatable formats that are
- constructed on the fly. */
- YY_("syntax error, unexpected %s");
- YY_("syntax error, unexpected %s, expecting %s");
- YY_("syntax error, unexpected %s, expecting %s or %s");
- YY_("syntax error, unexpected %s, expecting %s or %s or %s");
- YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
-# endif
- char *yyfmt;
- char const *yyf;
- static char const yyunexpected[] = "syntax error, unexpected %s";
- static char const yyexpecting[] = ", expecting %s";
- static char const yyor[] = " or %s";
- char yyformat[sizeof yyunexpected
- + sizeof yyexpecting - 1
- + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
- * (sizeof yyor - 1))];
- char const *yyprefix = yyexpecting;
-
- /* Start YYX at -YYN if negative to avoid negative indexes in
- YYCHECK. */
- int yyxbegin = yyn < 0 ? -yyn : 0;
-
- /* Stay within bounds of both yycheck and yytname. */
- int yychecklim = YYLAST - yyn + 1;
- int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
- int yycount = 1;
-
- yyarg[0] = yytname[yytype];
- yyfmt = yystpcpy (yyformat, yyunexpected);
-
- for (yyx = yyxbegin; yyx < yyxend; ++yyx)
- if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
- {
- if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
- {
- yycount = 1;
- yysize = yysize0;
- yyformat[sizeof yyunexpected - 1] = '\0';
- break;
- }
- yyarg[yycount++] = yytname[yyx];
- yysize1 = yysize + yytnamerr (0, yytname[yyx]);
- yysize_overflow |= (yysize1 < yysize);
- yysize = yysize1;
- yyfmt = yystpcpy (yyfmt, yyprefix);
- yyprefix = yyor;
- }
-
- yyf = YY_(yyformat);
- yysize1 = yysize + yystrlen (yyf);
- yysize_overflow |= (yysize1 < yysize);
- yysize = yysize1;
-
- if (yysize_overflow)
- return YYSIZE_MAXIMUM;
-
- if (yyresult)
- {
- /* Avoid sprintf, as that infringes on the user's name space.
- Don't have undefined behavior even if the translation
- produced a string with the wrong number of "%s"s. */
- char *yyp = yyresult;
- int yyi = 0;
- while ((*yyp = *yyf) != '\0')
- {
- if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
- {
- yyp += yytnamerr (yyp, yyarg[yyi++]);
- yyf += 2;
- }
- else
- {
- yyp++;
- yyf++;
- }
- }
- }
- return yysize;
- }
-}
-#endif /* YYERROR_VERBOSE */
-
-
-/*-----------------------------------------------.
-| Release the memory associated to this symbol. |
-`-----------------------------------------------*/
-
-/*ARGSUSED*/
-#if (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
-static void
-yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
-#else
-static void
-yydestruct (yymsg, yytype, yyvaluep)
- const char *yymsg;
- int yytype;
- YYSTYPE *yyvaluep;
-#endif
-{
- YYUSE (yyvaluep);
-
- if (!yymsg)
- yymsg = "Deleting";
- YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
-
- switch (yytype)
- {
-
- default:
- break;
- }
-}
-
-
-/* Prevent warnings from -Wmissing-prototypes. */
-
-#ifdef YYPARSE_PARAM
-#if defined __STDC__ || defined __cplusplus
-int yyparse (void *YYPARSE_PARAM);
-#else
-int yyparse ();
-#endif
-#else /* ! YYPARSE_PARAM */
-#if defined __STDC__ || defined __cplusplus
-int yyparse (void);
-#else
-int yyparse ();
-#endif
-#endif /* ! YYPARSE_PARAM */
-
-
-
-/* The look-ahead symbol. */
-int yychar;
-
-/* The semantic value of the look-ahead symbol. */
-YYSTYPE yylval;
-
-/* Number of syntax errors so far. */
-int yynerrs;
-
-
-
-/*----------.
-| yyparse. |
-`----------*/
-
-#ifdef YYPARSE_PARAM
-#if (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
-int
-yyparse (void *YYPARSE_PARAM)
-#else
-int
-yyparse (YYPARSE_PARAM)
- void *YYPARSE_PARAM;
-#endif
-#else /* ! YYPARSE_PARAM */
-#if (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
-int
-yyparse (void)
-#else
-int
-yyparse ()
-
-#endif
-#endif
-{
-
- int yystate;
- int yyn;
- int yyresult;
- /* Number of tokens to shift before error messages enabled. */
- int yyerrstatus;
- /* Look-ahead token as an internal (translated) token number. */
- int yytoken = 0;
-#if YYERROR_VERBOSE
- /* Buffer for error messages, and its allocated size. */
- char yymsgbuf[128];
- char *yymsg = yymsgbuf;
- YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
-#endif
-
- /* Three stacks and their tools:
- `yyss': related to states,
- `yyvs': related to semantic values,
- `yyls': related to locations.
-
- Refer to the stacks thru separate pointers, to allow yyoverflow
- to reallocate them elsewhere. */
-
- /* The state stack. */
- yytype_int16 yyssa[YYINITDEPTH];
- yytype_int16 *yyss = yyssa;
- yytype_int16 *yyssp;
-
- /* The semantic value stack. */
- YYSTYPE yyvsa[YYINITDEPTH];
- YYSTYPE *yyvs = yyvsa;
- YYSTYPE *yyvsp;
-
-
-
-#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
-
- YYSIZE_T yystacksize = YYINITDEPTH;
-
- /* The variables used to return semantic value and location from the
- action routines. */
- YYSTYPE yyval;
-
-
- /* The number of symbols on the RHS of the reduced rule.
- Keep to zero when no symbol should be popped. */
- int yylen = 0;
-
- YYDPRINTF ((stderr, "Starting parse\n"));
-
- yystate = 0;
- yyerrstatus = 0;
- yynerrs = 0;
- yychar = YYEMPTY; /* Cause a token to be read. */
-
- /* Initialize stack pointers.
- Waste one element of value and location stack
- so that they stay on the same level as the state stack.
- The wasted elements are never initialized. */
-
- yyssp = yyss;
- yyvsp = yyvs;
-
- goto yysetstate;
-
-/*------------------------------------------------------------.
-| yynewstate -- Push a new state, which is found in yystate. |
-`------------------------------------------------------------*/
- yynewstate:
- /* In all cases, when you get here, the value and location stacks
- have just been pushed. So pushing a state here evens the stacks. */
- yyssp++;
-
- yysetstate:
- *yyssp = yystate;
-
- if (yyss + yystacksize - 1 <= yyssp)
- {
- /* Get the current used size of the three stacks, in elements. */
- YYSIZE_T yysize = yyssp - yyss + 1;
-
-#ifdef yyoverflow
- {
- /* Give user a chance to reallocate the stack. Use copies of
- these so that the &'s don't force the real ones into
- memory. */
- YYSTYPE *yyvs1 = yyvs;
- yytype_int16 *yyss1 = yyss;
-
-
- /* Each stack pointer address is followed by the size of the
- data in use in that stack, in bytes. This used to be a
- conditional around just the two extra args, but that might
- be undefined if yyoverflow is a macro. */
- yyoverflow (YY_("memory exhausted"),
- &yyss1, yysize * sizeof (*yyssp),
- &yyvs1, yysize * sizeof (*yyvsp),
-
- &yystacksize);
-
- yyss = yyss1;
- yyvs = yyvs1;
- }
-#else /* no yyoverflow */
-# ifndef YYSTACK_RELOCATE
- goto yyexhaustedlab;
-# else
- /* Extend the stack our own way. */
- if (YYMAXDEPTH <= yystacksize)
- goto yyexhaustedlab;
- yystacksize *= 2;
- if (YYMAXDEPTH < yystacksize)
- yystacksize = YYMAXDEPTH;
-
- {
- yytype_int16 *yyss1 = yyss;
- union yyalloc *yyptr =
- (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
- if (! yyptr)
- goto yyexhaustedlab;
- YYSTACK_RELOCATE (yyss);
- YYSTACK_RELOCATE (yyvs);
-
-# undef YYSTACK_RELOCATE
- if (yyss1 != yyssa)
- YYSTACK_FREE (yyss1);
- }
-# endif
-#endif /* no yyoverflow */
-
- yyssp = yyss + yysize - 1;
- yyvsp = yyvs + yysize - 1;
-
-
- YYDPRINTF ((stderr, "Stack size increased to %lu\n",
- (unsigned long int) yystacksize));
-
- if (yyss + yystacksize - 1 <= yyssp)
- YYABORT;
- }
-
- YYDPRINTF ((stderr, "Entering state %d\n", yystate));
-
- goto yybackup;
-
-/*-----------.
-| yybackup. |
-`-----------*/
-yybackup:
-
- /* Do appropriate processing given the current state. Read a
- look-ahead token if we need one and don't already have one. */
-
- /* First try to decide what to do without reference to look-ahead token. */
- yyn = yypact[yystate];
- if (yyn == YYPACT_NINF)
- goto yydefault;
-
- /* Not known => get a look-ahead token if don't already have one. */
-
- /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */
- if (yychar == YYEMPTY)
- {
- YYDPRINTF ((stderr, "Reading a token: "));
- yychar = YYLEX;
- }
-
- if (yychar <= YYEOF)
- {
- yychar = yytoken = YYEOF;
- YYDPRINTF ((stderr, "Now at end of input.\n"));
- }
- else
- {
- yytoken = YYTRANSLATE (yychar);
- YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
- }
-
- /* If the proper action on seeing token YYTOKEN is to reduce or to
- detect an error, take that action. */
- yyn += yytoken;
- if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
- goto yydefault;
- yyn = yytable[yyn];
- if (yyn <= 0)
- {
- if (yyn == 0 || yyn == YYTABLE_NINF)
- goto yyerrlab;
- yyn = -yyn;
- goto yyreduce;
- }
-
- if (yyn == YYFINAL)
- YYACCEPT;
-
- /* Count tokens shifted since error; after three, turn off error
- status. */
- if (yyerrstatus)
- yyerrstatus--;
-
- /* Shift the look-ahead token. */
- YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
-
- /* Discard the shifted token unless it is eof. */
- if (yychar != YYEOF)
- yychar = YYEMPTY;
-
- yystate = yyn;
- *++yyvsp = yylval;
-
- goto yynewstate;
-
-
-/*-----------------------------------------------------------.
-| yydefault -- do the default action for the current state. |
-`-----------------------------------------------------------*/
-yydefault:
- yyn = yydefact[yystate];
- if (yyn == 0)
- goto yyerrlab;
- goto yyreduce;
-
-
-/*-----------------------------.
-| yyreduce -- Do a reduction. |
-`-----------------------------*/
-yyreduce:
- /* yyn is the number of a rule to reduce with. */
- yylen = yyr2[yyn];
-
- /* If YYLEN is nonzero, implement the default value of the action:
- `$$ = $1'.
-
- Otherwise, the following line sets YYVAL to garbage.
- This behavior is undocumented and Bison
- users should not rely upon it. Assigning to YYVAL
- unconditionally makes the parser a bit smaller, and it avoids a
- GCC warning that YYVAL may be used uninitialized. */
- yyval = yyvsp[1-yylen];
-
-
- YY_REDUCE_PRINT (yyn);
- switch (yyn)
- {
- case 29:
-#line 1117 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- { (yyval.IPredicate) = ICmpInst::ICMP_EQ; ;}
- break;
-
- case 30:
-#line 1117 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- { (yyval.IPredicate) = ICmpInst::ICMP_NE; ;}
- break;
-
- case 31:
-#line 1118 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- { (yyval.IPredicate) = ICmpInst::ICMP_SLT; ;}
- break;
-
- case 32:
-#line 1118 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- { (yyval.IPredicate) = ICmpInst::ICMP_SGT; ;}
- break;
-
- case 33:
-#line 1119 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- { (yyval.IPredicate) = ICmpInst::ICMP_SLE; ;}
- break;
-
- case 34:
-#line 1119 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- { (yyval.IPredicate) = ICmpInst::ICMP_SGE; ;}
- break;
-
- case 35:
-#line 1120 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- { (yyval.IPredicate) = ICmpInst::ICMP_ULT; ;}
- break;
-
- case 36:
-#line 1120 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- { (yyval.IPredicate) = ICmpInst::ICMP_UGT; ;}
- break;
-
- case 37:
-#line 1121 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- { (yyval.IPredicate) = ICmpInst::ICMP_ULE; ;}
- break;
-
- case 38:
-#line 1121 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- { (yyval.IPredicate) = ICmpInst::ICMP_UGE; ;}
- break;
-
- case 39:
-#line 1125 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- { (yyval.FPredicate) = FCmpInst::FCMP_OEQ; ;}
- break;
-
- case 40:
-#line 1125 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- { (yyval.FPredicate) = FCmpInst::FCMP_ONE; ;}
- break;
-
- case 41:
-#line 1126 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- { (yyval.FPredicate) = FCmpInst::FCMP_OLT; ;}
- break;
-
- case 42:
-#line 1126 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- { (yyval.FPredicate) = FCmpInst::FCMP_OGT; ;}
- break;
-
- case 43:
-#line 1127 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- { (yyval.FPredicate) = FCmpInst::FCMP_OLE; ;}
- break;
-
- case 44:
-#line 1127 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- { (yyval.FPredicate) = FCmpInst::FCMP_OGE; ;}
- break;
-
- case 45:
-#line 1128 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- { (yyval.FPredicate) = FCmpInst::FCMP_ORD; ;}
- break;
-
- case 46:
-#line 1128 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- { (yyval.FPredicate) = FCmpInst::FCMP_UNO; ;}
- break;
-
- case 47:
-#line 1129 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- { (yyval.FPredicate) = FCmpInst::FCMP_UEQ; ;}
- break;
-
- case 48:
-#line 1129 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- { (yyval.FPredicate) = FCmpInst::FCMP_UNE; ;}
- break;
-
- case 49:
-#line 1130 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- { (yyval.FPredicate) = FCmpInst::FCMP_ULT; ;}
- break;
-
- case 50:
-#line 1130 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- { (yyval.FPredicate) = FCmpInst::FCMP_UGT; ;}
- break;
-
- case 51:
-#line 1131 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- { (yyval.FPredicate) = FCmpInst::FCMP_ULE; ;}
- break;
-
- case 52:
-#line 1131 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- { (yyval.FPredicate) = FCmpInst::FCMP_UGE; ;}
- break;
-
- case 53:
-#line 1132 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- { (yyval.FPredicate) = FCmpInst::FCMP_TRUE; ;}
- break;
-
- case 54:
-#line 1133 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- { (yyval.FPredicate) = FCmpInst::FCMP_FALSE; ;}
- break;
-
- case 65:
-#line 1142 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- { (yyval.StrVal) = 0; ;}
- break;
-
- case 66:
-#line 1144 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- { (yyval.UIntVal)=(yyvsp[(3) - (4)].UInt64Val); ;}
- break;
-
- case 67:
-#line 1145 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- { (yyval.UIntVal)=0; ;}
- break;
-
- case 68:
-#line 1149 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- (yyval.StrVal) = (yyvsp[(1) - (2)].StrVal);
- CHECK_FOR_ERROR
- ;}
- break;
-
- case 69:
-#line 1153 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- (yyval.StrVal) = 0;
- CHECK_FOR_ERROR
- ;}
- break;
-
- case 73:
-#line 1161 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- (yyval.StrVal) = 0;
- CHECK_FOR_ERROR
- ;}
- break;
-
- case 74:
-#line 1166 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- (yyval.StrVal) = (yyvsp[(1) - (2)].StrVal);
- CHECK_FOR_ERROR
- ;}
- break;
-
- case 75:
-#line 1172 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- { (yyval.Linkage) = GlobalValue::InternalLinkage; ;}
- break;
-
- case 76:
-#line 1173 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- { (yyval.Linkage) = GlobalValue::WeakLinkage; ;}
- break;
-
- case 77:
-#line 1174 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- { (yyval.Linkage) = GlobalValue::LinkOnceLinkage; ;}
- break;
-
- case 78:
-#line 1175 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- { (yyval.Linkage) = GlobalValue::AppendingLinkage; ;}
- break;
-
- case 79:
-#line 1176 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- { (yyval.Linkage) = GlobalValue::DLLExportLinkage; ;}
- break;
-
- case 80:
-#line 1180 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- { (yyval.Linkage) = GlobalValue::DLLImportLinkage; ;}
- break;
-
- case 81:
-#line 1181 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- { (yyval.Linkage) = GlobalValue::ExternalWeakLinkage; ;}
- break;
-
- case 82:
-#line 1182 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;}
- break;
-
- case 83:
-#line 1186 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- { (yyval.Visibility) = GlobalValue::DefaultVisibility; ;}
- break;
-
- case 84:
-#line 1187 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- { (yyval.Visibility) = GlobalValue::DefaultVisibility; ;}
- break;
-
- case 85:
-#line 1188 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- { (yyval.Visibility) = GlobalValue::HiddenVisibility; ;}
- break;
-
- case 86:
-#line 1189 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- { (yyval.Visibility) = GlobalValue::ProtectedVisibility; ;}
- break;
-
- case 87:
-#line 1193 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;}
- break;
-
- case 88:
-#line 1194 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- { (yyval.Linkage) = GlobalValue::DLLImportLinkage; ;}
- break;
-
- case 89:
-#line 1195 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- { (yyval.Linkage) = GlobalValue::ExternalWeakLinkage; ;}
- break;
-
- case 90:
-#line 1199 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;}
- break;
-
- case 91:
-#line 1200 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- { (yyval.Linkage) = GlobalValue::InternalLinkage; ;}
- break;
-
- case 92:
-#line 1201 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- { (yyval.Linkage) = GlobalValue::LinkOnceLinkage; ;}
- break;
-
- case 93:
-#line 1202 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- { (yyval.Linkage) = GlobalValue::WeakLinkage; ;}
- break;
-
- case 94:
-#line 1203 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- { (yyval.Linkage) = GlobalValue::DLLExportLinkage; ;}
- break;
-
- case 95:
-#line 1207 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;}
- break;
-
- case 96:
-#line 1208 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- { (yyval.Linkage) = GlobalValue::WeakLinkage; ;}
- break;
-
- case 97:
-#line 1209 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- { (yyval.Linkage) = GlobalValue::InternalLinkage; ;}
- break;
-
- case 98:
-#line 1212 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- { (yyval.UIntVal) = CallingConv::C; ;}
- break;
-
- case 99:
-#line 1213 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- { (yyval.UIntVal) = CallingConv::C; ;}
- break;
-
- case 100:
-#line 1214 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- { (yyval.UIntVal) = CallingConv::Fast; ;}
- break;
-
- case 101:
-#line 1215 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- { (yyval.UIntVal) = CallingConv::Cold; ;}
- break;
-
- case 102:
-#line 1216 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- { (yyval.UIntVal) = CallingConv::X86_StdCall; ;}
- break;
-
- case 103:
-#line 1217 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- { (yyval.UIntVal) = CallingConv::X86_FastCall; ;}
- break;
-
- case 104:
-#line 1218 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- if ((unsigned)(yyvsp[(2) - (2)].UInt64Val) != (yyvsp[(2) - (2)].UInt64Val))
- GEN_ERROR("Calling conv too large");
- (yyval.UIntVal) = (yyvsp[(2) - (2)].UInt64Val);
- CHECK_FOR_ERROR
- ;}
- break;
-
- case 105:
-#line 1225 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- { (yyval.ParamAttrs) = ParamAttr::ZExt; ;}
- break;
-
- case 106:
-#line 1226 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- { (yyval.ParamAttrs) = ParamAttr::ZExt; ;}
- break;
-
- case 107:
-#line 1227 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- { (yyval.ParamAttrs) = ParamAttr::SExt; ;}
- break;
-
- case 108:
-#line 1228 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- { (yyval.ParamAttrs) = ParamAttr::SExt; ;}
- break;
-
- case 109:
-#line 1229 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- { (yyval.ParamAttrs) = ParamAttr::InReg; ;}
- break;
-
- case 110:
-#line 1230 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- { (yyval.ParamAttrs) = ParamAttr::StructRet; ;}
- break;
-
- case 111:
-#line 1231 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- { (yyval.ParamAttrs) = ParamAttr::NoAlias; ;}
- break;
-
- case 112:
-#line 1232 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- { (yyval.ParamAttrs) = ParamAttr::ByVal; ;}
- break;
-
- case 113:
-#line 1233 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- { (yyval.ParamAttrs) = ParamAttr::Nest; ;}
- break;
-
- case 114:
-#line 1234 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- { (yyval.ParamAttrs) =
- ParamAttr::constructAlignmentFromInt((yyvsp[(2) - (2)].UInt64Val)); ;}
- break;
-
- case 115:
-#line 1238 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- { (yyval.ParamAttrs) = ParamAttr::None; ;}
- break;
-
- case 116:
-#line 1239 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- (yyval.ParamAttrs) = (yyvsp[(1) - (2)].ParamAttrs) | (yyvsp[(2) - (2)].ParamAttrs);
- ;}
- break;
-
- case 117:
-#line 1244 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- { (yyval.ParamAttrs) = ParamAttr::NoReturn; ;}
- break;
-
- case 118:
-#line 1245 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- { (yyval.ParamAttrs) = ParamAttr::NoUnwind; ;}
- break;
-
- case 119:
-#line 1246 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- { (yyval.ParamAttrs) = ParamAttr::ZExt; ;}
- break;
-
- case 120:
-#line 1247 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- { (yyval.ParamAttrs) = ParamAttr::SExt; ;}
- break;
-
- case 121:
-#line 1248 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- { (yyval.ParamAttrs) = ParamAttr::ReadNone; ;}
- break;
-
- case 122:
-#line 1249 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- { (yyval.ParamAttrs) = ParamAttr::ReadOnly; ;}
- break;
-
- case 123:
-#line 1252 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- { (yyval.ParamAttrs) = ParamAttr::None; ;}
- break;
-
- case 124:
-#line 1253 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- (yyval.ParamAttrs) = (yyvsp[(1) - (2)].ParamAttrs) | (yyvsp[(2) - (2)].ParamAttrs);
- ;}
- break;
-
- case 125:
-#line 1258 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- { (yyval.StrVal) = 0; ;}
- break;
-
- case 126:
-#line 1259 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- (yyval.StrVal) = (yyvsp[(2) - (2)].StrVal);
- ;}
- break;
-
- case 127:
-#line 1266 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- { (yyval.UIntVal) = 0; ;}
- break;
-
- case 128:
-#line 1267 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- (yyval.UIntVal) = (yyvsp[(2) - (2)].UInt64Val);
- if ((yyval.UIntVal) != 0 && !isPowerOf2_32((yyval.UIntVal)))
- GEN_ERROR("Alignment must be a power of two");
- CHECK_FOR_ERROR
-;}
- break;
-
- case 129:
-#line 1273 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- { (yyval.UIntVal) = 0; ;}
- break;
-
- case 130:
-#line 1274 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- (yyval.UIntVal) = (yyvsp[(3) - (3)].UInt64Val);
- if ((yyval.UIntVal) != 0 && !isPowerOf2_32((yyval.UIntVal)))
- GEN_ERROR("Alignment must be a power of two");
- CHECK_FOR_ERROR
-;}
- break;
-
- case 131:
-#line 1283 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- for (unsigned i = 0, e = (yyvsp[(2) - (2)].StrVal)->length(); i != e; ++i)
- if ((*(yyvsp[(2) - (2)].StrVal))[i] == '"' || (*(yyvsp[(2) - (2)].StrVal))[i] == '\\')
- GEN_ERROR("Invalid character in section name");
- (yyval.StrVal) = (yyvsp[(2) - (2)].StrVal);
- CHECK_FOR_ERROR
-;}
- break;
-
- case 132:
-#line 1291 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- { (yyval.StrVal) = 0; ;}
- break;
-
- case 133:
-#line 1292 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- { (yyval.StrVal) = (yyvsp[(1) - (1)].StrVal); ;}
- break;
-
- case 134:
-#line 1297 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {;}
- break;
-
- case 135:
-#line 1298 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {;}
- break;
-
- case 136:
-#line 1299 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- CurGV->setSection(*(yyvsp[(1) - (1)].StrVal));
- delete (yyvsp[(1) - (1)].StrVal);
- CHECK_FOR_ERROR
- ;}
- break;
-
- case 137:
-#line 1304 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- if ((yyvsp[(2) - (2)].UInt64Val) != 0 && !isPowerOf2_32((yyvsp[(2) - (2)].UInt64Val)))
- GEN_ERROR("Alignment must be a power of two");
- CurGV->setAlignment((yyvsp[(2) - (2)].UInt64Val));
- CHECK_FOR_ERROR
- ;}
- break;
-
- case 145:
-#line 1320 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- (yyval.TypeVal) = new PATypeHolder(OpaqueType::get());
- CHECK_FOR_ERROR
- ;}
- break;
-
- case 146:
-#line 1324 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- (yyval.TypeVal) = new PATypeHolder((yyvsp[(1) - (1)].PrimType));
- CHECK_FOR_ERROR
- ;}
- break;
-
- case 147:
-#line 1328 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- { // Pointer type?
- if (*(yyvsp[(1) - (3)].TypeVal) == Type::LabelTy)
- GEN_ERROR("Cannot form a pointer to a basic block");
- (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(PointerType::get(*(yyvsp[(1) - (3)].TypeVal), (yyvsp[(2) - (3)].UIntVal))));
- delete (yyvsp[(1) - (3)].TypeVal);
- CHECK_FOR_ERROR
- ;}
- break;
-
- case 148:
-#line 1335 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- { // Named types are also simple types...
- const Type* tmp = getTypeVal((yyvsp[(1) - (1)].ValIDVal));
- CHECK_FOR_ERROR
- (yyval.TypeVal) = new PATypeHolder(tmp);
- ;}
- break;
-
- case 149:
-#line 1340 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- { // Type UpReference
- if ((yyvsp[(2) - (2)].UInt64Val) > (uint64_t)~0U) GEN_ERROR("Value out of range");
- OpaqueType *OT = OpaqueType::get(); // Use temporary placeholder
- UpRefs.push_back(UpRefRecord((unsigned)(yyvsp[(2) - (2)].UInt64Val), OT)); // Add to vector...
- (yyval.TypeVal) = new PATypeHolder(OT);
- UR_OUT("New Upreference!\n");
- CHECK_FOR_ERROR
- ;}
- break;
-
- case 150:
-#line 1348 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- // Allow but ignore attributes on function types; this permits auto-upgrade.
- // FIXME: remove in LLVM 3.0.
- const Type *RetTy = *(yyvsp[(1) - (5)].TypeVal);
- if (!FunctionType::isValidReturnType(RetTy))
- GEN_ERROR("Invalid result type for LLVM function");
-
- std::vector<const Type*> Params;
- TypeWithAttrsList::iterator I = (yyvsp[(3) - (5)].TypeWithAttrsList)->begin(), E = (yyvsp[(3) - (5)].TypeWithAttrsList)->end();
- for (; I != E; ++I ) {
- const Type *Ty = I->Ty->get();
- Params.push_back(Ty);
- }
-
- bool isVarArg = Params.size() && Params.back() == Type::VoidTy;
- if (isVarArg) Params.pop_back();
-
- for (unsigned i = 0; i != Params.size(); ++i)
- if (!(Params[i]->isFirstClassType() || isa<OpaqueType>(Params[i])))
- GEN_ERROR("Function arguments must be value types!");
-
- CHECK_FOR_ERROR
-
- FunctionType *FT = FunctionType::get(RetTy, Params, isVarArg);
- delete (yyvsp[(3) - (5)].TypeWithAttrsList); // Delete the argument list
- delete (yyvsp[(1) - (5)].TypeVal); // Delete the return type handle
- (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(FT));
- CHECK_FOR_ERROR
- ;}
- break;
-
- case 151:
-#line 1377 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- // Allow but ignore attributes on function types; this permits auto-upgrade.
- // FIXME: remove in LLVM 3.0.
- std::vector<const Type*> Params;
- TypeWithAttrsList::iterator I = (yyvsp[(3) - (5)].TypeWithAttrsList)->begin(), E = (yyvsp[(3) - (5)].TypeWithAttrsList)->end();
- for ( ; I != E; ++I ) {
- const Type* Ty = I->Ty->get();
- Params.push_back(Ty);
- }
-
- bool isVarArg = Params.size() && Params.back() == Type::VoidTy;
- if (isVarArg) Params.pop_back();
-
- for (unsigned i = 0; i != Params.size(); ++i)
- if (!(Params[i]->isFirstClassType() || isa<OpaqueType>(Params[i])))
- GEN_ERROR("Function arguments must be value types!");
-
- CHECK_FOR_ERROR
-
- FunctionType *FT = FunctionType::get((yyvsp[(1) - (5)].PrimType), Params, isVarArg);
- delete (yyvsp[(3) - (5)].TypeWithAttrsList); // Delete the argument list
- (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(FT));
- CHECK_FOR_ERROR
- ;}
- break;
-
- case 152:
-#line 1402 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- { // Sized array type?
- (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(ArrayType::get(*(yyvsp[(4) - (5)].TypeVal), (unsigned)(yyvsp[(2) - (5)].UInt64Val))));
- delete (yyvsp[(4) - (5)].TypeVal);
- CHECK_FOR_ERROR
- ;}
- break;
-
- case 153:
-#line 1407 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- { // Vector type?
- const llvm::Type* ElemTy = (yyvsp[(4) - (5)].TypeVal)->get();
- if ((unsigned)(yyvsp[(2) - (5)].UInt64Val) != (yyvsp[(2) - (5)].UInt64Val))
- GEN_ERROR("Unsigned result not equal to signed result");
- if (!ElemTy->isFloatingPoint() && !ElemTy->isInteger())
- GEN_ERROR("Element type of a VectorType must be primitive");
- (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(VectorType::get(*(yyvsp[(4) - (5)].TypeVal), (unsigned)(yyvsp[(2) - (5)].UInt64Val))));
- delete (yyvsp[(4) - (5)].TypeVal);
- CHECK_FOR_ERROR
- ;}
- break;
-
- case 154:
-#line 1417 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- { // Structure type?
- std::vector<const Type*> Elements;
- for (std::list<llvm::PATypeHolder>::iterator I = (yyvsp[(2) - (3)].TypeList)->begin(),
- E = (yyvsp[(2) - (3)].TypeList)->end(); I != E; ++I)
- Elements.push_back(*I);
-
- (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(StructType::get(Elements)));
- delete (yyvsp[(2) - (3)].TypeList);
- CHECK_FOR_ERROR
- ;}
- break;
-
- case 155:
-#line 1427 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- { // Empty structure type?
- (yyval.TypeVal) = new PATypeHolder(StructType::get(std::vector<const Type*>()));
- CHECK_FOR_ERROR
- ;}
- break;
-
- case 156:
-#line 1431 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- std::vector<const Type*> Elements;
- for (std::list<llvm::PATypeHolder>::iterator I = (yyvsp[(3) - (5)].TypeList)->begin(),
- E = (yyvsp[(3) - (5)].TypeList)->end(); I != E; ++I)
- Elements.push_back(*I);
-
- (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(StructType::get(Elements, true)));
- delete (yyvsp[(3) - (5)].TypeList);
- CHECK_FOR_ERROR
- ;}
- break;
-
- case 157:
-#line 1441 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- { // Empty structure type?
- (yyval.TypeVal) = new PATypeHolder(StructType::get(std::vector<const Type*>(), true));
- CHECK_FOR_ERROR
- ;}
- break;
-
- case 158:
-#line 1448 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- // Allow but ignore attributes on function types; this permits auto-upgrade.
- // FIXME: remove in LLVM 3.0.
- (yyval.TypeWithAttrs).Ty = (yyvsp[(1) - (2)].TypeVal);
- (yyval.TypeWithAttrs).Attrs = ParamAttr::None;
- ;}
- break;
-
- case 159:
-#line 1457 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (1)].TypeVal))->getDescription());
- if (!(*(yyvsp[(1) - (1)].TypeVal))->isFirstClassType() && !isa<StructType>((yyvsp[(1) - (1)].TypeVal)->get()))
- GEN_ERROR("LLVM functions cannot return aggregate types");
- (yyval.TypeVal) = (yyvsp[(1) - (1)].TypeVal);
- ;}
- break;
-
- case 160:
-#line 1464 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- (yyval.TypeVal) = new PATypeHolder(Type::VoidTy);
- ;}
- break;
-
- case 161:
-#line 1469 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- (yyval.TypeWithAttrsList) = new TypeWithAttrsList();
- (yyval.TypeWithAttrsList)->push_back((yyvsp[(1) - (1)].TypeWithAttrs));
- CHECK_FOR_ERROR
- ;}
- break;
-
- case 162:
-#line 1474 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- ((yyval.TypeWithAttrsList)=(yyvsp[(1) - (3)].TypeWithAttrsList))->push_back((yyvsp[(3) - (3)].TypeWithAttrs));
- CHECK_FOR_ERROR
- ;}
- break;
-
- case 164:
-#line 1482 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- (yyval.TypeWithAttrsList)=(yyvsp[(1) - (3)].TypeWithAttrsList);
- TypeWithAttrs TWA; TWA.Attrs = ParamAttr::None;
- TWA.Ty = new PATypeHolder(Type::VoidTy);
- (yyval.TypeWithAttrsList)->push_back(TWA);
- CHECK_FOR_ERROR
- ;}
- break;
-
- case 165:
-#line 1489 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- (yyval.TypeWithAttrsList) = new TypeWithAttrsList;
- TypeWithAttrs TWA; TWA.Attrs = ParamAttr::None;
- TWA.Ty = new PATypeHolder(Type::VoidTy);
- (yyval.TypeWithAttrsList)->push_back(TWA);
- CHECK_FOR_ERROR
- ;}
- break;
-
- case 166:
-#line 1496 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- (yyval.TypeWithAttrsList) = new TypeWithAttrsList();
- CHECK_FOR_ERROR
- ;}
- break;
-
- case 167:
-#line 1504 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- (yyval.TypeList) = new std::list<PATypeHolder>();
- (yyval.TypeList)->push_back(*(yyvsp[(1) - (1)].TypeVal));
- delete (yyvsp[(1) - (1)].TypeVal);
- CHECK_FOR_ERROR
- ;}
- break;
-
- case 168:
-#line 1510 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- ((yyval.TypeList)=(yyvsp[(1) - (3)].TypeList))->push_back(*(yyvsp[(3) - (3)].TypeVal));
- delete (yyvsp[(3) - (3)].TypeVal);
- CHECK_FOR_ERROR
- ;}
- break;
-
- case 169:
-#line 1522 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- { // Nonempty unsized arr
- if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (4)].TypeVal))->getDescription());
- const ArrayType *ATy = dyn_cast<ArrayType>((yyvsp[(1) - (4)].TypeVal)->get());
- if (ATy == 0)
- GEN_ERROR("Cannot make array constant with type: '" +
- (*(yyvsp[(1) - (4)].TypeVal))->getDescription() + "'");
- const Type *ETy = ATy->getElementType();
- int NumElements = ATy->getNumElements();
-
- // Verify that we have the correct size...
- if (NumElements != -1 && NumElements != (int)(yyvsp[(3) - (4)].ConstVector)->size())
- GEN_ERROR("Type mismatch: constant sized array initialized with " +
- utostr((yyvsp[(3) - (4)].ConstVector)->size()) + " arguments, but has size of " +
- itostr(NumElements) + "");
-
- // Verify all elements are correct type!
- for (unsigned i = 0; i < (yyvsp[(3) - (4)].ConstVector)->size(); i++) {
- if (ETy != (*(yyvsp[(3) - (4)].ConstVector))[i]->getType())
- GEN_ERROR("Element #" + utostr(i) + " is not of type '" +
- ETy->getDescription() +"' as required!\nIt is of type '"+
- (*(yyvsp[(3) - (4)].ConstVector))[i]->getType()->getDescription() + "'.");
- }
-
- (yyval.ConstVal) = ConstantArray::get(ATy, *(yyvsp[(3) - (4)].ConstVector));
- delete (yyvsp[(1) - (4)].TypeVal); delete (yyvsp[(3) - (4)].ConstVector);
- CHECK_FOR_ERROR
- ;}
- break;
-
- case 170:
-#line 1550 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription());
- const ArrayType *ATy = dyn_cast<ArrayType>((yyvsp[(1) - (3)].TypeVal)->get());
- if (ATy == 0)
- GEN_ERROR("Cannot make array constant with type: '" +
- (*(yyvsp[(1) - (3)].TypeVal))->getDescription() + "'");
-
- int NumElements = ATy->getNumElements();
- if (NumElements != -1 && NumElements != 0)
- GEN_ERROR("Type mismatch: constant sized array initialized with 0"
- " arguments, but has size of " + itostr(NumElements) +"");
- (yyval.ConstVal) = ConstantArray::get(ATy, std::vector<Constant*>());
- delete (yyvsp[(1) - (3)].TypeVal);
- CHECK_FOR_ERROR
- ;}
- break;
-
- case 171:
-#line 1566 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription());
- const ArrayType *ATy = dyn_cast<ArrayType>((yyvsp[(1) - (3)].TypeVal)->get());
- if (ATy == 0)
- GEN_ERROR("Cannot make array constant with type: '" +
- (*(yyvsp[(1) - (3)].TypeVal))->getDescription() + "'");
-
- int NumElements = ATy->getNumElements();
- const Type *ETy = ATy->getElementType();
- if (NumElements != -1 && NumElements != int((yyvsp[(3) - (3)].StrVal)->length()))
- GEN_ERROR("Can't build string constant of size " +
- itostr((int)((yyvsp[(3) - (3)].StrVal)->length())) +
- " when array has size " + itostr(NumElements) + "");
- std::vector<Constant*> Vals;
- if (ETy == Type::Int8Ty) {
- for (unsigned i = 0; i < (yyvsp[(3) - (3)].StrVal)->length(); ++i)
- Vals.push_back(ConstantInt::get(ETy, (*(yyvsp[(3) - (3)].StrVal))[i]));
- } else {
- delete (yyvsp[(3) - (3)].StrVal);
- GEN_ERROR("Cannot build string arrays of non byte sized elements");
- }
- delete (yyvsp[(3) - (3)].StrVal);
- (yyval.ConstVal) = ConstantArray::get(ATy, Vals);
- delete (yyvsp[(1) - (3)].TypeVal);
- CHECK_FOR_ERROR
- ;}
- break;
-
- case 172:
-#line 1593 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- { // Nonempty unsized arr
- if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (4)].TypeVal))->getDescription());
- const VectorType *PTy = dyn_cast<VectorType>((yyvsp[(1) - (4)].TypeVal)->get());
- if (PTy == 0)
- GEN_ERROR("Cannot make packed constant with type: '" +
- (*(yyvsp[(1) - (4)].TypeVal))->getDescription() + "'");
- const Type *ETy = PTy->getElementType();
- int NumElements = PTy->getNumElements();
-
- // Verify that we have the correct size...
- if (NumElements != -1 && NumElements != (int)(yyvsp[(3) - (4)].ConstVector)->size())
- GEN_ERROR("Type mismatch: constant sized packed initialized with " +
- utostr((yyvsp[(3) - (4)].ConstVector)->size()) + " arguments, but has size of " +
- itostr(NumElements) + "");
-
- // Verify all elements are correct type!
- for (unsigned i = 0; i < (yyvsp[(3) - (4)].ConstVector)->size(); i++) {
- if (ETy != (*(yyvsp[(3) - (4)].ConstVector))[i]->getType())
- GEN_ERROR("Element #" + utostr(i) + " is not of type '" +
- ETy->getDescription() +"' as required!\nIt is of type '"+
- (*(yyvsp[(3) - (4)].ConstVector))[i]->getType()->getDescription() + "'.");
- }
-
- (yyval.ConstVal) = ConstantVector::get(PTy, *(yyvsp[(3) - (4)].ConstVector));
- delete (yyvsp[(1) - (4)].TypeVal); delete (yyvsp[(3) - (4)].ConstVector);
- CHECK_FOR_ERROR
- ;}
- break;
-
- case 173:
-#line 1621 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- const StructType *STy = dyn_cast<StructType>((yyvsp[(1) - (4)].TypeVal)->get());
- if (STy == 0)
- GEN_ERROR("Cannot make struct constant with type: '" +
- (*(yyvsp[(1) - (4)].TypeVal))->getDescription() + "'");
-
- if ((yyvsp[(3) - (4)].ConstVector)->size() != STy->getNumContainedTypes())
- GEN_ERROR("Illegal number of initializers for structure type");
-
- // Check to ensure that constants are compatible with the type initializer!
- for (unsigned i = 0, e = (yyvsp[(3) - (4)].ConstVector)->size(); i != e; ++i)
- if ((*(yyvsp[(3) - (4)].ConstVector))[i]->getType() != STy->getElementType(i))
- GEN_ERROR("Expected type '" +
- STy->getElementType(i)->getDescription() +
- "' for element #" + utostr(i) +
- " of structure initializer");
-
- // Check to ensure that Type is not packed
- if (STy->isPacked())
- GEN_ERROR("Unpacked Initializer to vector type '" +
- STy->getDescription() + "'");
-
- (yyval.ConstVal) = ConstantStruct::get(STy, *(yyvsp[(3) - (4)].ConstVector));
- delete (yyvsp[(1) - (4)].TypeVal); delete (yyvsp[(3) - (4)].ConstVector);
- CHECK_FOR_ERROR
- ;}
- break;
-
- case 174:
-#line 1647 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription());
- const StructType *STy = dyn_cast<StructType>((yyvsp[(1) - (3)].TypeVal)->get());
- if (STy == 0)
- GEN_ERROR("Cannot make struct constant with type: '" +
- (*(yyvsp[(1) - (3)].TypeVal))->getDescription() + "'");
-
- if (STy->getNumContainedTypes() != 0)
- GEN_ERROR("Illegal number of initializers for structure type");
-
- // Check to ensure that Type is not packed
- if (STy->isPacked())
- GEN_ERROR("Unpacked Initializer to vector type '" +
- STy->getDescription() + "'");
-
- (yyval.ConstVal) = ConstantStruct::get(STy, std::vector<Constant*>());
- delete (yyvsp[(1) - (3)].TypeVal);
- CHECK_FOR_ERROR
- ;}
- break;
-
- case 175:
-#line 1667 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- const StructType *STy = dyn_cast<StructType>((yyvsp[(1) - (6)].TypeVal)->get());
- if (STy == 0)
- GEN_ERROR("Cannot make struct constant with type: '" +
- (*(yyvsp[(1) - (6)].TypeVal))->getDescription() + "'");
-
- if ((yyvsp[(4) - (6)].ConstVector)->size() != STy->getNumContainedTypes())
- GEN_ERROR("Illegal number of initializers for structure type");
-
- // Check to ensure that constants are compatible with the type initializer!
- for (unsigned i = 0, e = (yyvsp[(4) - (6)].ConstVector)->size(); i != e; ++i)
- if ((*(yyvsp[(4) - (6)].ConstVector))[i]->getType() != STy->getElementType(i))
- GEN_ERROR("Expected type '" +
- STy->getElementType(i)->getDescription() +
- "' for element #" + utostr(i) +
- " of structure initializer");
-
- // Check to ensure that Type is packed
- if (!STy->isPacked())
- GEN_ERROR("Vector initializer to non-vector type '" +
- STy->getDescription() + "'");
-
- (yyval.ConstVal) = ConstantStruct::get(STy, *(yyvsp[(4) - (6)].ConstVector));
- delete (yyvsp[(1) - (6)].TypeVal); delete (yyvsp[(4) - (6)].ConstVector);
- CHECK_FOR_ERROR
- ;}
- break;
-
- case 176:
-#line 1693 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (5)].TypeVal))->getDescription());
- const StructType *STy = dyn_cast<StructType>((yyvsp[(1) - (5)].TypeVal)->get());
- if (STy == 0)
- GEN_ERROR("Cannot make struct constant with type: '" +
- (*(yyvsp[(1) - (5)].TypeVal))->getDescription() + "'");
-
- if (STy->getNumContainedTypes() != 0)
- GEN_ERROR("Illegal number of initializers for structure type");
-
- // Check to ensure that Type is packed
- if (!STy->isPacked())
- GEN_ERROR("Vector initializer to non-vector type '" +
- STy->getDescription() + "'");
-
- (yyval.ConstVal) = ConstantStruct::get(STy, std::vector<Constant*>());
- delete (yyvsp[(1) - (5)].TypeVal);
- CHECK_FOR_ERROR
- ;}
- break;
-
- case 177:
-#line 1713 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
- const PointerType *PTy = dyn_cast<PointerType>((yyvsp[(1) - (2)].TypeVal)->get());
- if (PTy == 0)
- GEN_ERROR("Cannot make null pointer constant with type: '" +
- (*(yyvsp[(1) - (2)].TypeVal))->getDescription() + "'");
-
- (yyval.ConstVal) = ConstantPointerNull::get(PTy);
- delete (yyvsp[(1) - (2)].TypeVal);
- CHECK_FOR_ERROR
- ;}
- break;
-
- case 178:
-#line 1725 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
- (yyval.ConstVal) = UndefValue::get((yyvsp[(1) - (2)].TypeVal)->get());
- delete (yyvsp[(1) - (2)].TypeVal);
- CHECK_FOR_ERROR
- ;}
- break;
-
- case 179:
-#line 1732 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
- const PointerType *Ty = dyn_cast<PointerType>((yyvsp[(1) - (2)].TypeVal)->get());
- if (Ty == 0)
- GEN_ERROR("Global const reference must be a pointer type " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
-
- // ConstExprs can exist in the body of a function, thus creating
- // GlobalValues whenever they refer to a variable. Because we are in
- // the context of a function, getExistingVal will search the functions
- // symbol table instead of the module symbol table for the global symbol,
- // which throws things all off. To get around this, we just tell
- // getExistingVal that we are at global scope here.
- //
- Function *SavedCurFn = CurFun.CurrentFunction;
- CurFun.CurrentFunction = 0;
-
- Value *V = getExistingVal(Ty, (yyvsp[(2) - (2)].ValIDVal));
- CHECK_FOR_ERROR
-
- CurFun.CurrentFunction = SavedCurFn;
-
- // If this is an initializer for a constant pointer, which is referencing a
- // (currently) undefined variable, create a stub now that shall be replaced
- // in the future with the right type of variable.
- //
- if (V == 0) {
- assert(isa<PointerType>(Ty) && "Globals may only be used as pointers!");
- const PointerType *PT = cast<PointerType>(Ty);
-
- // First check to see if the forward references value is already created!
- PerModuleInfo::GlobalRefsType::iterator I =
- CurModule.GlobalRefs.find(std::make_pair(PT, (yyvsp[(2) - (2)].ValIDVal)));
-
- if (I != CurModule.GlobalRefs.end()) {
- V = I->second; // Placeholder already exists, use it...
- (yyvsp[(2) - (2)].ValIDVal).destroy();
- } else {
- std::string Name;
- if ((yyvsp[(2) - (2)].ValIDVal).Type == ValID::GlobalName)
- Name = (yyvsp[(2) - (2)].ValIDVal).getName();
- else if ((yyvsp[(2) - (2)].ValIDVal).Type != ValID::GlobalID)
- GEN_ERROR("Invalid reference to global");
-
- // Create the forward referenced global.
- GlobalValue *GV;
- if (const FunctionType *FTy =
- dyn_cast<FunctionType>(PT->getElementType())) {
- GV = Function::Create(FTy, GlobalValue::ExternalWeakLinkage, Name,
- CurModule.CurrentModule);
- } else {
- GV = new GlobalVariable(PT->getElementType(), false,
- GlobalValue::ExternalWeakLinkage, 0,
- Name, CurModule.CurrentModule);
- }
-
- // Keep track of the fact that we have a forward ref to recycle it
- CurModule.GlobalRefs.insert(std::make_pair(std::make_pair(PT, (yyvsp[(2) - (2)].ValIDVal)), GV));
- V = GV;
- }
- }
-
- (yyval.ConstVal) = cast<GlobalValue>(V);
- delete (yyvsp[(1) - (2)].TypeVal); // Free the type handle
- CHECK_FOR_ERROR
- ;}
- break;
-
- case 180:
-#line 1798 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
- if ((yyvsp[(1) - (2)].TypeVal)->get() != (yyvsp[(2) - (2)].ConstVal)->getType())
- GEN_ERROR("Mismatched types for constant expression: " +
- (*(yyvsp[(1) - (2)].TypeVal))->getDescription() + " and " + (yyvsp[(2) - (2)].ConstVal)->getType()->getDescription());
- (yyval.ConstVal) = (yyvsp[(2) - (2)].ConstVal);
- delete (yyvsp[(1) - (2)].TypeVal);
- CHECK_FOR_ERROR
- ;}
- break;
-
- case 181:
-#line 1808 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
- const Type *Ty = (yyvsp[(1) - (2)].TypeVal)->get();
- if (isa<FunctionType>(Ty) || Ty == Type::LabelTy || isa<OpaqueType>(Ty))
- GEN_ERROR("Cannot create a null initialized value of this type");
- (yyval.ConstVal) = Constant::getNullValue(Ty);
- delete (yyvsp[(1) - (2)].TypeVal);
- CHECK_FOR_ERROR
- ;}
- break;
-
- case 182:
-#line 1818 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- { // integral constants
- if (!ConstantInt::isValueValidForType((yyvsp[(1) - (2)].PrimType), (yyvsp[(2) - (2)].SInt64Val)))
- GEN_ERROR("Constant value doesn't fit in type");
- (yyval.ConstVal) = ConstantInt::get((yyvsp[(1) - (2)].PrimType), (yyvsp[(2) - (2)].SInt64Val), true);
- CHECK_FOR_ERROR
- ;}
- break;
-
- case 183:
-#line 1824 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- { // arbitrary precision integer constants
- uint32_t BitWidth = cast<IntegerType>((yyvsp[(1) - (2)].PrimType))->getBitWidth();
- if ((yyvsp[(2) - (2)].APIntVal)->getBitWidth() > BitWidth) {
- GEN_ERROR("Constant value does not fit in type");
- }
- (yyvsp[(2) - (2)].APIntVal)->sextOrTrunc(BitWidth);
- (yyval.ConstVal) = ConstantInt::get(*(yyvsp[(2) - (2)].APIntVal));
- delete (yyvsp[(2) - (2)].APIntVal);
- CHECK_FOR_ERROR
- ;}
- break;
-
- case 184:
-#line 1834 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- { // integral constants
- if (!ConstantInt::isValueValidForType((yyvsp[(1) - (2)].PrimType), (yyvsp[(2) - (2)].UInt64Val)))
- GEN_ERROR("Constant value doesn't fit in type");
- (yyval.ConstVal) = ConstantInt::get((yyvsp[(1) - (2)].PrimType), (yyvsp[(2) - (2)].UInt64Val), false);
- CHECK_FOR_ERROR
- ;}
- break;
-
- case 185:
-#line 1840 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- { // arbitrary precision integer constants
- uint32_t BitWidth = cast<IntegerType>((yyvsp[(1) - (2)].PrimType))->getBitWidth();
- if ((yyvsp[(2) - (2)].APIntVal)->getBitWidth() > BitWidth) {
- GEN_ERROR("Constant value does not fit in type");
- }
- (yyvsp[(2) - (2)].APIntVal)->zextOrTrunc(BitWidth);
- (yyval.ConstVal) = ConstantInt::get(*(yyvsp[(2) - (2)].APIntVal));
- delete (yyvsp[(2) - (2)].APIntVal);
- CHECK_FOR_ERROR
- ;}
- break;
-
- case 186:
-#line 1850 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- { // Boolean constants
- assert(cast<IntegerType>((yyvsp[(1) - (2)].PrimType))->getBitWidth() == 1 && "Not Bool?");
- (yyval.ConstVal) = ConstantInt::getTrue();
- CHECK_FOR_ERROR
- ;}
- break;
-
- case 187:
-#line 1855 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- { // Boolean constants
- assert(cast<IntegerType>((yyvsp[(1) - (2)].PrimType))->getBitWidth() == 1 && "Not Bool?");
- (yyval.ConstVal) = ConstantInt::getFalse();
- CHECK_FOR_ERROR
- ;}
- break;
-
- case 188:
-#line 1860 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- { // Floating point constants
- if (!ConstantFP::isValueValidForType((yyvsp[(1) - (2)].PrimType), *(yyvsp[(2) - (2)].FPVal)))
- GEN_ERROR("Floating point constant invalid for type");
- // Lexer has no type info, so builds all float and double FP constants
- // as double. Fix this here. Long double is done right.
- if (&(yyvsp[(2) - (2)].FPVal)->getSemantics()==&APFloat::IEEEdouble && (yyvsp[(1) - (2)].PrimType)==Type::FloatTy)
- (yyvsp[(2) - (2)].FPVal)->convert(APFloat::IEEEsingle, APFloat::rmNearestTiesToEven);
- (yyval.ConstVal) = ConstantFP::get(*(yyvsp[(2) - (2)].FPVal));
- delete (yyvsp[(2) - (2)].FPVal);
- CHECK_FOR_ERROR
- ;}
- break;
-
- case 189:
-#line 1873 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(5) - (6)].TypeVal))->getDescription());
- Constant *Val = (yyvsp[(3) - (6)].ConstVal);
- const Type *DestTy = (yyvsp[(5) - (6)].TypeVal)->get();
- if (!CastInst::castIsValid((yyvsp[(1) - (6)].CastOpVal), (yyvsp[(3) - (6)].ConstVal), DestTy))
- GEN_ERROR("invalid cast opcode for cast from '" +
- Val->getType()->getDescription() + "' to '" +
- DestTy->getDescription() + "'");
- (yyval.ConstVal) = ConstantExpr::getCast((yyvsp[(1) - (6)].CastOpVal), (yyvsp[(3) - (6)].ConstVal), DestTy);
- delete (yyvsp[(5) - (6)].TypeVal);
- ;}
- break;
-
- case 190:
-#line 1885 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- if (!isa<PointerType>((yyvsp[(3) - (5)].ConstVal)->getType()))
- GEN_ERROR("GetElementPtr requires a pointer operand");
-
- const Type *IdxTy =
- GetElementPtrInst::getIndexedType((yyvsp[(3) - (5)].ConstVal)->getType(), (yyvsp[(4) - (5)].ValueList)->begin(), (yyvsp[(4) - (5)].ValueList)->end(),
- true);
- if (!IdxTy)
- GEN_ERROR("Index list invalid for constant getelementptr");
-
- SmallVector<Constant*, 8> IdxVec;
- for (unsigned i = 0, e = (yyvsp[(4) - (5)].ValueList)->size(); i != e; ++i)
- if (Constant *C = dyn_cast<Constant>((*(yyvsp[(4) - (5)].ValueList))[i]))
- IdxVec.push_back(C);
- else
- GEN_ERROR("Indices to constant getelementptr must be constants");
-
- delete (yyvsp[(4) - (5)].ValueList);
-
- (yyval.ConstVal) = ConstantExpr::getGetElementPtr((yyvsp[(3) - (5)].ConstVal), &IdxVec[0], IdxVec.size());
- CHECK_FOR_ERROR
- ;}
- break;
-
- case 191:
-#line 1907 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- if ((yyvsp[(3) - (8)].ConstVal)->getType() != Type::Int1Ty)
- GEN_ERROR("Select condition must be of boolean type");
- if ((yyvsp[(5) - (8)].ConstVal)->getType() != (yyvsp[(7) - (8)].ConstVal)->getType())
- GEN_ERROR("Select operand types must match");
- (yyval.ConstVal) = ConstantExpr::getSelect((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal));
- CHECK_FOR_ERROR
- ;}
- break;
-
- case 192:
-#line 1915 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- if ((yyvsp[(3) - (6)].ConstVal)->getType() != (yyvsp[(5) - (6)].ConstVal)->getType())
- GEN_ERROR("Binary operator types must match");
- CHECK_FOR_ERROR;
- (yyval.ConstVal) = ConstantExpr::get((yyvsp[(1) - (6)].BinaryOpVal), (yyvsp[(3) - (6)].ConstVal), (yyvsp[(5) - (6)].ConstVal));
- ;}
- break;
-
- case 193:
-#line 1921 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- if ((yyvsp[(3) - (6)].ConstVal)->getType() != (yyvsp[(5) - (6)].ConstVal)->getType())
- GEN_ERROR("Logical operator types must match");
- if (!(yyvsp[(3) - (6)].ConstVal)->getType()->isInteger()) {
- if (Instruction::isShift((yyvsp[(1) - (6)].BinaryOpVal)) || !isa<VectorType>((yyvsp[(3) - (6)].ConstVal)->getType()) ||
- !cast<VectorType>((yyvsp[(3) - (6)].ConstVal)->getType())->getElementType()->isInteger())
- GEN_ERROR("Logical operator requires integral operands");
- }
- (yyval.ConstVal) = ConstantExpr::get((yyvsp[(1) - (6)].BinaryOpVal), (yyvsp[(3) - (6)].ConstVal), (yyvsp[(5) - (6)].ConstVal));
- CHECK_FOR_ERROR
- ;}
- break;
-
- case 194:
-#line 1932 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType())
- GEN_ERROR("icmp operand types must match");
- (yyval.ConstVal) = ConstantExpr::getICmp((yyvsp[(2) - (7)].IPredicate), (yyvsp[(4) - (7)].ConstVal), (yyvsp[(6) - (7)].ConstVal));
- ;}
- break;
-
- case 195:
-#line 1937 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType())
- GEN_ERROR("fcmp operand types must match");
- (yyval.ConstVal) = ConstantExpr::getFCmp((yyvsp[(2) - (7)].FPredicate), (yyvsp[(4) - (7)].ConstVal), (yyvsp[(6) - (7)].ConstVal));
- ;}
- break;
-
- case 196:
-#line 1942 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- if (!ExtractElementInst::isValidOperands((yyvsp[(3) - (6)].ConstVal), (yyvsp[(5) - (6)].ConstVal)))
- GEN_ERROR("Invalid extractelement operands");
- (yyval.ConstVal) = ConstantExpr::getExtractElement((yyvsp[(3) - (6)].ConstVal), (yyvsp[(5) - (6)].ConstVal));
- CHECK_FOR_ERROR
- ;}
- break;
-
- case 197:
-#line 1948 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- if (!InsertElementInst::isValidOperands((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal)))
- GEN_ERROR("Invalid insertelement operands");
- (yyval.ConstVal) = ConstantExpr::getInsertElement((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal));
- CHECK_FOR_ERROR
- ;}
- break;
-
- case 198:
-#line 1954 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- if (!ShuffleVectorInst::isValidOperands((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal)))
- GEN_ERROR("Invalid shufflevector operands");
- (yyval.ConstVal) = ConstantExpr::getShuffleVector((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal));
- CHECK_FOR_ERROR
- ;}
- break;
-
- case 199:
-#line 1963 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- ((yyval.ConstVector) = (yyvsp[(1) - (3)].ConstVector))->push_back((yyvsp[(3) - (3)].ConstVal));
- CHECK_FOR_ERROR
- ;}
- break;
-
- case 200:
-#line 1967 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- (yyval.ConstVector) = new std::vector<Constant*>();
- (yyval.ConstVector)->push_back((yyvsp[(1) - (1)].ConstVal));
- CHECK_FOR_ERROR
- ;}
- break;
-
- case 201:
-#line 1975 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- { (yyval.BoolVal) = false; ;}
- break;
-
- case 202:
-#line 1975 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- { (yyval.BoolVal) = true; ;}
- break;
-
- case 203:
-#line 1978 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- { (yyval.BoolVal) = true; ;}
- break;
-
- case 204:
-#line 1978 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- { (yyval.BoolVal) = false; ;}
- break;
-
- case 205:
-#line 1981 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- const Type* VTy = (yyvsp[(1) - (2)].TypeVal)->get();
- Value *V = getVal(VTy, (yyvsp[(2) - (2)].ValIDVal));
- CHECK_FOR_ERROR
- GlobalValue* Aliasee = dyn_cast<GlobalValue>(V);
- if (!Aliasee)
- GEN_ERROR("Aliases can be created only to global values");
-
- (yyval.ConstVal) = Aliasee;
- CHECK_FOR_ERROR
- delete (yyvsp[(1) - (2)].TypeVal);
- ;}
- break;
-
- case 206:
-#line 1993 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- Constant *Val = (yyvsp[(3) - (6)].ConstVal);
- const Type *DestTy = (yyvsp[(5) - (6)].TypeVal)->get();
- if (!CastInst::castIsValid((yyvsp[(1) - (6)].CastOpVal), (yyvsp[(3) - (6)].ConstVal), DestTy))
- GEN_ERROR("invalid cast opcode for cast from '" +
- Val->getType()->getDescription() + "' to '" +
- DestTy->getDescription() + "'");
-
- (yyval.ConstVal) = ConstantExpr::getCast((yyvsp[(1) - (6)].CastOpVal), (yyvsp[(3) - (6)].ConstVal), DestTy);
- CHECK_FOR_ERROR
- delete (yyvsp[(5) - (6)].TypeVal);
- ;}
- break;
-
- case 207:
-#line 2014 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- (yyval.ModuleVal) = ParserResult = CurModule.CurrentModule;
- CurModule.ModuleDone();
- CHECK_FOR_ERROR;
- ;}
- break;
-
- case 208:
-#line 2019 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- (yyval.ModuleVal) = ParserResult = CurModule.CurrentModule;
- CurModule.ModuleDone();
- CHECK_FOR_ERROR;
- ;}
- break;
-
- case 211:
-#line 2032 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- { CurFun.isDeclare = false; ;}
- break;
-
- case 212:
-#line 2032 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- CurFun.FunctionDone();
- CHECK_FOR_ERROR
- ;}
- break;
-
- case 213:
-#line 2036 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- { CurFun.isDeclare = true; ;}
- break;
-
- case 214:
-#line 2036 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- CHECK_FOR_ERROR
- ;}
- break;
-
- case 215:
-#line 2039 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- CHECK_FOR_ERROR
- ;}
- break;
-
- case 216:
-#line 2042 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (3)].TypeVal))->getDescription());
- // Eagerly resolve types. This is not an optimization, this is a
- // requirement that is due to the fact that we could have this:
- //
- // %list = type { %list * }
- // %list = type { %list * } ; repeated type decl
- //
- // If types are not resolved eagerly, then the two types will not be
- // determined to be the same type!
- //
- ResolveTypeTo((yyvsp[(1) - (3)].StrVal), *(yyvsp[(3) - (3)].TypeVal));
-
- if (!setTypeName(*(yyvsp[(3) - (3)].TypeVal), (yyvsp[(1) - (3)].StrVal)) && !(yyvsp[(1) - (3)].StrVal)) {
- CHECK_FOR_ERROR
- // If this is a named type that is not a redefinition, add it to the slot
- // table.
- CurModule.Types.push_back(*(yyvsp[(3) - (3)].TypeVal));
- }
-
- delete (yyvsp[(3) - (3)].TypeVal);
- CHECK_FOR_ERROR
- ;}
- break;
-
- case 217:
-#line 2066 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- ResolveTypeTo((yyvsp[(1) - (3)].StrVal), (yyvsp[(3) - (3)].PrimType));
-
- if (!setTypeName((yyvsp[(3) - (3)].PrimType), (yyvsp[(1) - (3)].StrVal)) && !(yyvsp[(1) - (3)].StrVal)) {
- CHECK_FOR_ERROR
- // If this is a named type that is not a redefinition, add it to the slot
- // table.
- CurModule.Types.push_back((yyvsp[(3) - (3)].PrimType));
- }
- CHECK_FOR_ERROR
- ;}
- break;
-
- case 218:
-#line 2078 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- /* "Externally Visible" Linkage */
- if ((yyvsp[(5) - (6)].ConstVal) == 0)
- GEN_ERROR("Global value initializer is not a constant");
- CurGV = ParseGlobalVariable((yyvsp[(1) - (6)].StrVal), GlobalValue::ExternalLinkage,
- (yyvsp[(2) - (6)].Visibility), (yyvsp[(4) - (6)].BoolVal), (yyvsp[(5) - (6)].ConstVal)->getType(), (yyvsp[(5) - (6)].ConstVal), (yyvsp[(3) - (6)].BoolVal), (yyvsp[(6) - (6)].UIntVal));
- CHECK_FOR_ERROR
- ;}
- break;
-
- case 219:
-#line 2085 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- CurGV = 0;
- ;}
- break;
-
- case 220:
-#line 2089 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- if ((yyvsp[(6) - (7)].ConstVal) == 0)
- GEN_ERROR("Global value initializer is not a constant");
- CurGV = ParseGlobalVariable((yyvsp[(1) - (7)].StrVal), (yyvsp[(2) - (7)].Linkage), (yyvsp[(3) - (7)].Visibility), (yyvsp[(5) - (7)].BoolVal), (yyvsp[(6) - (7)].ConstVal)->getType(), (yyvsp[(6) - (7)].ConstVal), (yyvsp[(4) - (7)].BoolVal), (yyvsp[(7) - (7)].UIntVal));
- CHECK_FOR_ERROR
- ;}
- break;
-
- case 221:
-#line 2094 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- CurGV = 0;
- ;}
- break;
-
- case 222:
-#line 2098 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(6) - (7)].TypeVal))->getDescription());
- CurGV = ParseGlobalVariable((yyvsp[(1) - (7)].StrVal), (yyvsp[(2) - (7)].Linkage), (yyvsp[(3) - (7)].Visibility), (yyvsp[(5) - (7)].BoolVal), *(yyvsp[(6) - (7)].TypeVal), 0, (yyvsp[(4) - (7)].BoolVal), (yyvsp[(7) - (7)].UIntVal));
- CHECK_FOR_ERROR
- delete (yyvsp[(6) - (7)].TypeVal);
- ;}
- break;
-
- case 223:
-#line 2104 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- CurGV = 0;
- CHECK_FOR_ERROR
- ;}
- break;
-
- case 224:
-#line 2108 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- std::string Name;
- if ((yyvsp[(1) - (5)].StrVal)) {
- Name = *(yyvsp[(1) - (5)].StrVal);
- delete (yyvsp[(1) - (5)].StrVal);
- }
- if (Name.empty())
- GEN_ERROR("Alias name cannot be empty");
-
- Constant* Aliasee = (yyvsp[(5) - (5)].ConstVal);
- if (Aliasee == 0)
- GEN_ERROR(std::string("Invalid aliasee for alias: ") + Name);
-
- GlobalAlias* GA = new GlobalAlias(Aliasee->getType(), (yyvsp[(4) - (5)].Linkage), Name, Aliasee,
- CurModule.CurrentModule);
- GA->setVisibility((yyvsp[(2) - (5)].Visibility));
- InsertValue(GA, CurModule.Values);
-
-
- // If there was a forward reference of this alias, resolve it now.
-
- ValID ID;
- if (!Name.empty())
- ID = ValID::createGlobalName(Name);
- else
- ID = ValID::createGlobalID(CurModule.Values.size()-1);
-
- if (GlobalValue *FWGV =
- CurModule.GetForwardRefForGlobal(GA->getType(), ID)) {
- // Replace uses of the fwdref with the actual alias.
- FWGV->replaceAllUsesWith(GA);
- if (GlobalVariable *GV = dyn_cast<GlobalVariable>(FWGV))
- GV->eraseFromParent();
- else
- cast<Function>(FWGV)->eraseFromParent();
- }
- ID.destroy();
-
- CHECK_FOR_ERROR
- ;}
- break;
-
- case 225:
-#line 2148 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- CHECK_FOR_ERROR
- ;}
- break;
-
- case 226:
-#line 2151 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- CHECK_FOR_ERROR
- ;}
- break;
-
- case 227:
-#line 2157 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- const std::string &AsmSoFar = CurModule.CurrentModule->getModuleInlineAsm();
- if (AsmSoFar.empty())
- CurModule.CurrentModule->setModuleInlineAsm(*(yyvsp[(1) - (1)].StrVal));
- else
- CurModule.CurrentModule->setModuleInlineAsm(AsmSoFar+"\n"+*(yyvsp[(1) - (1)].StrVal));
- delete (yyvsp[(1) - (1)].StrVal);
- CHECK_FOR_ERROR
-;}
- break;
-
- case 228:
-#line 2167 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- CurModule.CurrentModule->setTargetTriple(*(yyvsp[(3) - (3)].StrVal));
- delete (yyvsp[(3) - (3)].StrVal);
- ;}
- break;
-
- case 229:
-#line 2171 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- CurModule.CurrentModule->setDataLayout(*(yyvsp[(3) - (3)].StrVal));
- delete (yyvsp[(3) - (3)].StrVal);
- ;}
- break;
-
- case 231:
-#line 2178 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- CurModule.CurrentModule->addLibrary(*(yyvsp[(3) - (3)].StrVal));
- delete (yyvsp[(3) - (3)].StrVal);
- CHECK_FOR_ERROR
- ;}
- break;
-
- case 232:
-#line 2183 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- CurModule.CurrentModule->addLibrary(*(yyvsp[(1) - (1)].StrVal));
- delete (yyvsp[(1) - (1)].StrVal);
- CHECK_FOR_ERROR
- ;}
- break;
-
- case 233:
-#line 2188 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- CHECK_FOR_ERROR
- ;}
- break;
-
- case 234:
-#line 2197 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (5)].TypeVal))->getDescription());
- if (*(yyvsp[(3) - (5)].TypeVal) == Type::VoidTy)
- GEN_ERROR("void typed arguments are invalid");
- ArgListEntry E; E.Attrs = (yyvsp[(4) - (5)].ParamAttrs); E.Ty = (yyvsp[(3) - (5)].TypeVal); E.Name = (yyvsp[(5) - (5)].StrVal);
- (yyval.ArgList) = (yyvsp[(1) - (5)].ArgList);
- (yyvsp[(1) - (5)].ArgList)->push_back(E);
- CHECK_FOR_ERROR
- ;}
- break;
-
- case 235:
-#line 2207 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription());
- if (*(yyvsp[(1) - (3)].TypeVal) == Type::VoidTy)
- GEN_ERROR("void typed arguments are invalid");
- ArgListEntry E; E.Attrs = (yyvsp[(2) - (3)].ParamAttrs); E.Ty = (yyvsp[(1) - (3)].TypeVal); E.Name = (yyvsp[(3) - (3)].StrVal);
- (yyval.ArgList) = new ArgListType;
- (yyval.ArgList)->push_back(E);
- CHECK_FOR_ERROR
- ;}
- break;
-
- case 236:
-#line 2218 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- (yyval.ArgList) = (yyvsp[(1) - (1)].ArgList);
- CHECK_FOR_ERROR
- ;}
- break;
-
- case 237:
-#line 2222 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- (yyval.ArgList) = (yyvsp[(1) - (3)].ArgList);
- struct ArgListEntry E;
- E.Ty = new PATypeHolder(Type::VoidTy);
- E.Name = 0;
- E.Attrs = ParamAttr::None;
- (yyval.ArgList)->push_back(E);
- CHECK_FOR_ERROR
- ;}
- break;
-
- case 238:
-#line 2231 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- (yyval.ArgList) = new ArgListType;
- struct ArgListEntry E;
- E.Ty = new PATypeHolder(Type::VoidTy);
- E.Name = 0;
- E.Attrs = ParamAttr::None;
- (yyval.ArgList)->push_back(E);
- CHECK_FOR_ERROR
- ;}
- break;
-
- case 239:
-#line 2240 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- (yyval.ArgList) = 0;
- CHECK_FOR_ERROR
- ;}
- break;
-
- case 240:
-#line 2246 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- std::string FunctionName(*(yyvsp[(3) - (10)].StrVal));
- delete (yyvsp[(3) - (10)].StrVal); // Free strdup'd memory!
-
- // Check the function result for abstractness if this is a define. We should
- // have no abstract types at this point
- if (!CurFun.isDeclare && CurModule.TypeIsUnresolved((yyvsp[(2) - (10)].TypeVal)))
- GEN_ERROR("Reference to abstract result: "+ (yyvsp[(2) - (10)].TypeVal)->get()->getDescription());
-
- if (!FunctionType::isValidReturnType(*(yyvsp[(2) - (10)].TypeVal)))
- GEN_ERROR("Invalid result type for LLVM function");
-
- std::vector<const Type*> ParamTypeList;
- SmallVector<ParamAttrsWithIndex, 8> Attrs;
- if ((yyvsp[(7) - (10)].ParamAttrs) != ParamAttr::None)
- Attrs.push_back(ParamAttrsWithIndex::get(0, (yyvsp[(7) - (10)].ParamAttrs)));
- if ((yyvsp[(5) - (10)].ArgList)) { // If there are arguments...
- unsigned index = 1;
- for (ArgListType::iterator I = (yyvsp[(5) - (10)].ArgList)->begin(); I != (yyvsp[(5) - (10)].ArgList)->end(); ++I, ++index) {
- const Type* Ty = I->Ty->get();
- if (!CurFun.isDeclare && CurModule.TypeIsUnresolved(I->Ty))
- GEN_ERROR("Reference to abstract argument: " + Ty->getDescription());
- ParamTypeList.push_back(Ty);
- if (Ty != Type::VoidTy && I->Attrs != ParamAttr::None)
- Attrs.push_back(ParamAttrsWithIndex::get(index, I->Attrs));
- }
- }
-
- bool isVarArg = ParamTypeList.size() && ParamTypeList.back() == Type::VoidTy;
- if (isVarArg) ParamTypeList.pop_back();
-
- PAListPtr PAL;
- if (!Attrs.empty())
- PAL = PAListPtr::get(Attrs.begin(), Attrs.end());
-
- FunctionType *FT = FunctionType::get(*(yyvsp[(2) - (10)].TypeVal), ParamTypeList, isVarArg);
- const PointerType *PFT = PointerType::getUnqual(FT);
- delete (yyvsp[(2) - (10)].TypeVal);
-
- ValID ID;
- if (!FunctionName.empty()) {
- ID = ValID::createGlobalName((char*)FunctionName.c_str());
- } else {
- ID = ValID::createGlobalID(CurModule.Values.size());
- }
-
- Function *Fn = 0;
- // See if this function was forward referenced. If so, recycle the object.
- if (GlobalValue *FWRef = CurModule.GetForwardRefForGlobal(PFT, ID)) {
- // Move the function to the end of the list, from whereever it was
- // previously inserted.
- Fn = cast<Function>(FWRef);
- assert(Fn->getParamAttrs().isEmpty() &&
- "Forward reference has parameter attributes!");
- CurModule.CurrentModule->getFunctionList().remove(Fn);
- CurModule.CurrentModule->getFunctionList().push_back(Fn);
- } else if (!FunctionName.empty() && // Merge with an earlier prototype?
- (Fn = CurModule.CurrentModule->getFunction(FunctionName))) {
- if (Fn->getFunctionType() != FT ) {
- // The existing function doesn't have the same type. This is an overload
- // error.
- GEN_ERROR("Overload of function '" + FunctionName + "' not permitted.");
- } else if (Fn->getParamAttrs() != PAL) {
- // The existing function doesn't have the same parameter attributes.
- // This is an overload error.
- GEN_ERROR("Overload of function '" + FunctionName + "' not permitted.");
- } else if (!CurFun.isDeclare && !Fn->isDeclaration()) {
- // Neither the existing or the current function is a declaration and they
- // have the same name and same type. Clearly this is a redefinition.
- GEN_ERROR("Redefinition of function '" + FunctionName + "'");
- } else if (Fn->isDeclaration()) {
- // Make sure to strip off any argument names so we can't get conflicts.
- for (Function::arg_iterator AI = Fn->arg_begin(), AE = Fn->arg_end();
- AI != AE; ++AI)
- AI->setName("");
- }
- } else { // Not already defined?
- Fn = Function::Create(FT, GlobalValue::ExternalWeakLinkage, FunctionName,
- CurModule.CurrentModule);
- InsertValue(Fn, CurModule.Values);
- }
-
- CurFun.FunctionStart(Fn);
-
- if (CurFun.isDeclare) {
- // If we have declaration, always overwrite linkage. This will allow us to
- // correctly handle cases, when pointer to function is passed as argument to
- // another function.
- Fn->setLinkage(CurFun.Linkage);
- Fn->setVisibility(CurFun.Visibility);
- }
- Fn->setCallingConv((yyvsp[(1) - (10)].UIntVal));
- Fn->setParamAttrs(PAL);
- Fn->setAlignment((yyvsp[(9) - (10)].UIntVal));
- if ((yyvsp[(8) - (10)].StrVal)) {
- Fn->setSection(*(yyvsp[(8) - (10)].StrVal));
- delete (yyvsp[(8) - (10)].StrVal);
- }
- if ((yyvsp[(10) - (10)].StrVal)) {
- Fn->setCollector((yyvsp[(10) - (10)].StrVal)->c_str());
- delete (yyvsp[(10) - (10)].StrVal);
- }
-
- // Add all of the arguments we parsed to the function...
- if ((yyvsp[(5) - (10)].ArgList)) { // Is null if empty...
- if (isVarArg) { // Nuke the last entry
- assert((yyvsp[(5) - (10)].ArgList)->back().Ty->get() == Type::VoidTy && (yyvsp[(5) - (10)].ArgList)->back().Name == 0 &&
- "Not a varargs marker!");
- delete (yyvsp[(5) - (10)].ArgList)->back().Ty;
- (yyvsp[(5) - (10)].ArgList)->pop_back(); // Delete the last entry
- }
- Function::arg_iterator ArgIt = Fn->arg_begin();
- Function::arg_iterator ArgEnd = Fn->arg_end();
- unsigned Idx = 1;
- for (ArgListType::iterator I = (yyvsp[(5) - (10)].ArgList)->begin();
- I != (yyvsp[(5) - (10)].ArgList)->end() && ArgIt != ArgEnd; ++I, ++ArgIt) {
- delete I->Ty; // Delete the typeholder...
- setValueName(ArgIt, I->Name); // Insert arg into symtab...
- CHECK_FOR_ERROR
- InsertValue(ArgIt);
- Idx++;
- }
-
- delete (yyvsp[(5) - (10)].ArgList); // We're now done with the argument list
- }
- CHECK_FOR_ERROR
-;}
- break;
-
- case 243:
-#line 2376 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- (yyval.FunctionVal) = CurFun.CurrentFunction;
-
- // Make sure that we keep track of the linkage type even if there was a
- // previous "declare".
- (yyval.FunctionVal)->setLinkage((yyvsp[(1) - (4)].Linkage));
- (yyval.FunctionVal)->setVisibility((yyvsp[(2) - (4)].Visibility));
-;}
- break;
-
- case 246:
-#line 2387 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal);
- CHECK_FOR_ERROR
-;}
- break;
-
- case 247:
-#line 2392 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- CurFun.CurrentFunction->setLinkage((yyvsp[(1) - (3)].Linkage));
- CurFun.CurrentFunction->setVisibility((yyvsp[(2) - (3)].Visibility));
- (yyval.FunctionVal) = CurFun.CurrentFunction;
- CurFun.FunctionDone();
- CHECK_FOR_ERROR
- ;}
- break;
-
- case 248:
-#line 2404 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- (yyval.BoolVal) = false;
- CHECK_FOR_ERROR
- ;}
- break;
-
- case 249:
-#line 2408 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- (yyval.BoolVal) = true;
- CHECK_FOR_ERROR
- ;}
- break;
-
- case 250:
-#line 2413 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- { // A reference to a direct constant
- (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].SInt64Val));
- CHECK_FOR_ERROR
- ;}
- break;
-
- case 251:
-#line 2417 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].UInt64Val));
- CHECK_FOR_ERROR
- ;}
- break;
-
- case 252:
-#line 2421 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- { // Perhaps it's an FP constant?
- (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].FPVal));
- CHECK_FOR_ERROR
- ;}
- break;
-
- case 253:
-#line 2425 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- (yyval.ValIDVal) = ValID::create(ConstantInt::getTrue());
- CHECK_FOR_ERROR
- ;}
- break;
-
- case 254:
-#line 2429 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- (yyval.ValIDVal) = ValID::create(ConstantInt::getFalse());
- CHECK_FOR_ERROR
- ;}
- break;
-
- case 255:
-#line 2433 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- (yyval.ValIDVal) = ValID::createNull();
- CHECK_FOR_ERROR
- ;}
- break;
-
- case 256:
-#line 2437 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- (yyval.ValIDVal) = ValID::createUndef();
- CHECK_FOR_ERROR
- ;}
- break;
-
- case 257:
-#line 2441 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- { // A vector zero constant.
- (yyval.ValIDVal) = ValID::createZeroInit();
- CHECK_FOR_ERROR
- ;}
- break;
-
- case 258:
-#line 2445 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- { // Nonempty unsized packed vector
- const Type *ETy = (*(yyvsp[(2) - (3)].ConstVector))[0]->getType();
- int NumElements = (yyvsp[(2) - (3)].ConstVector)->size();
-
- VectorType* pt = VectorType::get(ETy, NumElements);
- PATypeHolder* PTy = new PATypeHolder(
- HandleUpRefs(
- VectorType::get(
- ETy,
- NumElements)
- )
- );
-
- // Verify all elements are correct type!
- for (unsigned i = 0; i < (yyvsp[(2) - (3)].ConstVector)->size(); i++) {
- if (ETy != (*(yyvsp[(2) - (3)].ConstVector))[i]->getType())
- GEN_ERROR("Element #" + utostr(i) + " is not of type '" +
- ETy->getDescription() +"' as required!\nIt is of type '" +
- (*(yyvsp[(2) - (3)].ConstVector))[i]->getType()->getDescription() + "'.");
- }
-
- (yyval.ValIDVal) = ValID::create(ConstantVector::get(pt, *(yyvsp[(2) - (3)].ConstVector)));
- delete PTy; delete (yyvsp[(2) - (3)].ConstVector);
- CHECK_FOR_ERROR
- ;}
- break;
-
- case 259:
-#line 2470 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].ConstVal));
- CHECK_FOR_ERROR
- ;}
- break;
-
- case 260:
-#line 2474 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- (yyval.ValIDVal) = ValID::createInlineAsm(*(yyvsp[(3) - (5)].StrVal), *(yyvsp[(5) - (5)].StrVal), (yyvsp[(2) - (5)].BoolVal));
- delete (yyvsp[(3) - (5)].StrVal);
- delete (yyvsp[(5) - (5)].StrVal);
- CHECK_FOR_ERROR
- ;}
- break;
-
- case 261:
-#line 2484 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- { // Is it an integer reference...?
- (yyval.ValIDVal) = ValID::createLocalID((yyvsp[(1) - (1)].UIntVal));
- CHECK_FOR_ERROR
- ;}
- break;
-
- case 262:
-#line 2488 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- (yyval.ValIDVal) = ValID::createGlobalID((yyvsp[(1) - (1)].UIntVal));
- CHECK_FOR_ERROR
- ;}
- break;
-
- case 263:
-#line 2492 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- { // Is it a named reference...?
- (yyval.ValIDVal) = ValID::createLocalName(*(yyvsp[(1) - (1)].StrVal));
- delete (yyvsp[(1) - (1)].StrVal);
- CHECK_FOR_ERROR
- ;}
- break;
-
- case 264:
-#line 2497 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- { // Is it a named reference...?
- (yyval.ValIDVal) = ValID::createGlobalName(*(yyvsp[(1) - (1)].StrVal));
- delete (yyvsp[(1) - (1)].StrVal);
- CHECK_FOR_ERROR
- ;}
- break;
-
- case 267:
-#line 2510 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
- (yyval.ValueVal) = getVal(*(yyvsp[(1) - (2)].TypeVal), (yyvsp[(2) - (2)].ValIDVal));
- delete (yyvsp[(1) - (2)].TypeVal);
- CHECK_FOR_ERROR
- ;}
- break;
-
- case 268:
-#line 2519 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- (yyval.ValueList) = new std::vector<Value *>();
- (yyval.ValueList)->push_back((yyvsp[(1) - (1)].ValueVal));
- CHECK_FOR_ERROR
- ;}
- break;
-
- case 269:
-#line 2524 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- ((yyval.ValueList)=(yyvsp[(1) - (3)].ValueList))->push_back((yyvsp[(3) - (3)].ValueVal));
- CHECK_FOR_ERROR
- ;}
- break;
-
- case 270:
-#line 2529 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal);
- CHECK_FOR_ERROR
- ;}
- break;
-
- case 271:
-#line 2533 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- { // Do not allow functions with 0 basic blocks
- (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal);
- CHECK_FOR_ERROR
- ;}
- break;
-
- case 272:
-#line 2542 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- setValueName((yyvsp[(3) - (3)].TermInstVal), (yyvsp[(2) - (3)].StrVal));
- CHECK_FOR_ERROR
- InsertValue((yyvsp[(3) - (3)].TermInstVal));
- (yyvsp[(1) - (3)].BasicBlockVal)->getInstList().push_back((yyvsp[(3) - (3)].TermInstVal));
- (yyval.BasicBlockVal) = (yyvsp[(1) - (3)].BasicBlockVal);
- CHECK_FOR_ERROR
- ;}
- break;
-
- case 273:
-#line 2551 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- if (CastInst *CI1 = dyn_cast<CastInst>((yyvsp[(2) - (2)].InstVal)))
- if (CastInst *CI2 = dyn_cast<CastInst>(CI1->getOperand(0)))
- if (CI2->getParent() == 0)
- (yyvsp[(1) - (2)].BasicBlockVal)->getInstList().push_back(CI2);
- (yyvsp[(1) - (2)].BasicBlockVal)->getInstList().push_back((yyvsp[(2) - (2)].InstVal));
- (yyval.BasicBlockVal) = (yyvsp[(1) - (2)].BasicBlockVal);
- CHECK_FOR_ERROR
- ;}
- break;
-
- case 274:
-#line 2560 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- { // Empty space between instruction lists
- (yyval.BasicBlockVal) = defineBBVal(ValID::createLocalID(CurFun.NextValNum));
- CHECK_FOR_ERROR
- ;}
- break;
-
- case 275:
-#line 2564 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- { // Labelled (named) basic block
- (yyval.BasicBlockVal) = defineBBVal(ValID::createLocalName(*(yyvsp[(1) - (1)].StrVal)));
- delete (yyvsp[(1) - (1)].StrVal);
- CHECK_FOR_ERROR
-
- ;}
- break;
-
- case 276:
-#line 2572 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- { // Return with a result...
- ValueList &VL = *(yyvsp[(2) - (2)].ValueList);
- assert(!VL.empty() && "Invalid ret operands!");
- (yyval.TermInstVal) = ReturnInst::Create(&VL[0], VL.size());
- delete (yyvsp[(2) - (2)].ValueList);
- CHECK_FOR_ERROR
- ;}
- break;
-
- case 277:
-#line 2579 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- { // Return with no result...
- (yyval.TermInstVal) = ReturnInst::Create();
- CHECK_FOR_ERROR
- ;}
- break;
-
- case 278:
-#line 2583 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- { // Unconditional Branch...
- BasicBlock* tmpBB = getBBVal((yyvsp[(3) - (3)].ValIDVal));
- CHECK_FOR_ERROR
- (yyval.TermInstVal) = BranchInst::Create(tmpBB);
- ;}
- break;
-
- case 279:
-#line 2588 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- assert(cast<IntegerType>((yyvsp[(2) - (9)].PrimType))->getBitWidth() == 1 && "Not Bool?");
- BasicBlock* tmpBBA = getBBVal((yyvsp[(6) - (9)].ValIDVal));
- CHECK_FOR_ERROR
- BasicBlock* tmpBBB = getBBVal((yyvsp[(9) - (9)].ValIDVal));
- CHECK_FOR_ERROR
- Value* tmpVal = getVal(Type::Int1Ty, (yyvsp[(3) - (9)].ValIDVal));
- CHECK_FOR_ERROR
- (yyval.TermInstVal) = BranchInst::Create(tmpBBA, tmpBBB, tmpVal);
- ;}
- break;
-
- case 280:
-#line 2598 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- Value* tmpVal = getVal((yyvsp[(2) - (9)].PrimType), (yyvsp[(3) - (9)].ValIDVal));
- CHECK_FOR_ERROR
- BasicBlock* tmpBB = getBBVal((yyvsp[(6) - (9)].ValIDVal));
- CHECK_FOR_ERROR
- SwitchInst *S = SwitchInst::Create(tmpVal, tmpBB, (yyvsp[(8) - (9)].JumpTable)->size());
- (yyval.TermInstVal) = S;
-
- std::vector<std::pair<Constant*,BasicBlock*> >::iterator I = (yyvsp[(8) - (9)].JumpTable)->begin(),
- E = (yyvsp[(8) - (9)].JumpTable)->end();
- for (; I != E; ++I) {
- if (ConstantInt *CI = dyn_cast<ConstantInt>(I->first))
- S->addCase(CI, I->second);
- else
- GEN_ERROR("Switch case is constant, but not a simple integer");
- }
- delete (yyvsp[(8) - (9)].JumpTable);
- CHECK_FOR_ERROR
- ;}
- break;
-
- case 281:
-#line 2617 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- Value* tmpVal = getVal((yyvsp[(2) - (8)].PrimType), (yyvsp[(3) - (8)].ValIDVal));
- CHECK_FOR_ERROR
- BasicBlock* tmpBB = getBBVal((yyvsp[(6) - (8)].ValIDVal));
- CHECK_FOR_ERROR
- SwitchInst *S = SwitchInst::Create(tmpVal, tmpBB, 0);
- (yyval.TermInstVal) = S;
- CHECK_FOR_ERROR
- ;}
- break;
-
- case 282:
-#line 2627 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
-
- // Handle the short syntax
- const PointerType *PFTy = 0;
- const FunctionType *Ty = 0;
- if (!(PFTy = dyn_cast<PointerType>((yyvsp[(3) - (14)].TypeVal)->get())) ||
- !(Ty = dyn_cast<FunctionType>(PFTy->getElementType()))) {
- // Pull out the types of all of the arguments...
- std::vector<const Type*> ParamTypes;
- ParamList::iterator I = (yyvsp[(6) - (14)].ParamList)->begin(), E = (yyvsp[(6) - (14)].ParamList)->end();
- for (; I != E; ++I) {
- const Type *Ty = I->Val->getType();
- if (Ty == Type::VoidTy)
- GEN_ERROR("Short call syntax cannot be used with varargs");
- ParamTypes.push_back(Ty);
- }
-
- if (!FunctionType::isValidReturnType(*(yyvsp[(3) - (14)].TypeVal)))
- GEN_ERROR("Invalid result type for LLVM function");
-
- Ty = FunctionType::get((yyvsp[(3) - (14)].TypeVal)->get(), ParamTypes, false);
- PFTy = PointerType::getUnqual(Ty);
- }
-
- delete (yyvsp[(3) - (14)].TypeVal);
-
- Value *V = getVal(PFTy, (yyvsp[(4) - (14)].ValIDVal)); // Get the function we're calling...
- CHECK_FOR_ERROR
- BasicBlock *Normal = getBBVal((yyvsp[(11) - (14)].ValIDVal));
- CHECK_FOR_ERROR
- BasicBlock *Except = getBBVal((yyvsp[(14) - (14)].ValIDVal));
- CHECK_FOR_ERROR
-
- SmallVector<ParamAttrsWithIndex, 8> Attrs;
- if ((yyvsp[(8) - (14)].ParamAttrs) != ParamAttr::None)
- Attrs.push_back(ParamAttrsWithIndex::get(0, (yyvsp[(8) - (14)].ParamAttrs)));
-
- // Check the arguments
- ValueList Args;
- if ((yyvsp[(6) - (14)].ParamList)->empty()) { // Has no arguments?
- // Make sure no arguments is a good thing!
- if (Ty->getNumParams() != 0)
- GEN_ERROR("No arguments passed to a function that "
- "expects arguments");
- } else { // Has arguments?
- // Loop through FunctionType's arguments and ensure they are specified
- // correctly!
- FunctionType::param_iterator I = Ty->param_begin();
- FunctionType::param_iterator E = Ty->param_end();
- ParamList::iterator ArgI = (yyvsp[(6) - (14)].ParamList)->begin(), ArgE = (yyvsp[(6) - (14)].ParamList)->end();
- unsigned index = 1;
-
- for (; ArgI != ArgE && I != E; ++ArgI, ++I, ++index) {
- if (ArgI->Val->getType() != *I)
- GEN_ERROR("Parameter " + ArgI->Val->getName()+ " is not of type '" +
- (*I)->getDescription() + "'");
- Args.push_back(ArgI->Val);
- if (ArgI->Attrs != ParamAttr::None)
- Attrs.push_back(ParamAttrsWithIndex::get(index, ArgI->Attrs));
- }
-
- if (Ty->isVarArg()) {
- if (I == E)
- for (; ArgI != ArgE; ++ArgI, ++index) {
- Args.push_back(ArgI->Val); // push the remaining varargs
- if (ArgI->Attrs != ParamAttr::None)
- Attrs.push_back(ParamAttrsWithIndex::get(index, ArgI->Attrs));
- }
- } else if (I != E || ArgI != ArgE)
- GEN_ERROR("Invalid number of parameters detected");
- }
-
- PAListPtr PAL;
- if (!Attrs.empty())
- PAL = PAListPtr::get(Attrs.begin(), Attrs.end());
-
- // Create the InvokeInst
- InvokeInst *II = InvokeInst::Create(V, Normal, Except, Args.begin(),Args.end());
- II->setCallingConv((yyvsp[(2) - (14)].UIntVal));
- II->setParamAttrs(PAL);
- (yyval.TermInstVal) = II;
- delete (yyvsp[(6) - (14)].ParamList);
- CHECK_FOR_ERROR
- ;}
- break;
-
- case 283:
-#line 2711 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- (yyval.TermInstVal) = new UnwindInst();
- CHECK_FOR_ERROR
- ;}
- break;
-
- case 284:
-#line 2715 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- (yyval.TermInstVal) = new UnreachableInst();
- CHECK_FOR_ERROR
- ;}
- break;
-
- case 285:
-#line 2722 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- (yyval.JumpTable) = (yyvsp[(1) - (6)].JumpTable);
- Constant *V = cast<Constant>(getExistingVal((yyvsp[(2) - (6)].PrimType), (yyvsp[(3) - (6)].ValIDVal)));
- CHECK_FOR_ERROR
- if (V == 0)
- GEN_ERROR("May only switch on a constant pool value");
-
- BasicBlock* tmpBB = getBBVal((yyvsp[(6) - (6)].ValIDVal));
- CHECK_FOR_ERROR
- (yyval.JumpTable)->push_back(std::make_pair(V, tmpBB));
- ;}
- break;
-
- case 286:
-#line 2733 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- (yyval.JumpTable) = new std::vector<std::pair<Constant*, BasicBlock*> >();
- Constant *V = cast<Constant>(getExistingVal((yyvsp[(1) - (5)].PrimType), (yyvsp[(2) - (5)].ValIDVal)));
- CHECK_FOR_ERROR
-
- if (V == 0)
- GEN_ERROR("May only switch on a constant pool value");
-
- BasicBlock* tmpBB = getBBVal((yyvsp[(5) - (5)].ValIDVal));
- CHECK_FOR_ERROR
- (yyval.JumpTable)->push_back(std::make_pair(V, tmpBB));
- ;}
- break;
-
- case 287:
-#line 2746 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- // Is this definition named?? if so, assign the name...
- setValueName((yyvsp[(2) - (2)].InstVal), (yyvsp[(1) - (2)].StrVal));
- CHECK_FOR_ERROR
- InsertValue((yyvsp[(2) - (2)].InstVal));
- (yyval.InstVal) = (yyvsp[(2) - (2)].InstVal);
- CHECK_FOR_ERROR
- ;}
- break;
-
- case 288:
-#line 2756 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- { // Used for PHI nodes
- if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (6)].TypeVal))->getDescription());
- (yyval.PHIList) = new std::list<std::pair<Value*, BasicBlock*> >();
- Value* tmpVal = getVal(*(yyvsp[(1) - (6)].TypeVal), (yyvsp[(3) - (6)].ValIDVal));
- CHECK_FOR_ERROR
- BasicBlock* tmpBB = getBBVal((yyvsp[(5) - (6)].ValIDVal));
- CHECK_FOR_ERROR
- (yyval.PHIList)->push_back(std::make_pair(tmpVal, tmpBB));
- delete (yyvsp[(1) - (6)].TypeVal);
- ;}
- break;
-
- case 289:
-#line 2767 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- (yyval.PHIList) = (yyvsp[(1) - (7)].PHIList);
- Value* tmpVal = getVal((yyvsp[(1) - (7)].PHIList)->front().first->getType(), (yyvsp[(4) - (7)].ValIDVal));
- CHECK_FOR_ERROR
- BasicBlock* tmpBB = getBBVal((yyvsp[(6) - (7)].ValIDVal));
- CHECK_FOR_ERROR
- (yyvsp[(1) - (7)].PHIList)->push_back(std::make_pair(tmpVal, tmpBB));
- ;}
- break;
-
- case 290:
-#line 2777 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- // FIXME: Remove trailing OptParamAttrs in LLVM 3.0, it was a mistake in 2.0
- if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (4)].TypeVal))->getDescription());
- // Used for call and invoke instructions
- (yyval.ParamList) = new ParamList();
- ParamListEntry E; E.Attrs = (yyvsp[(2) - (4)].ParamAttrs) | (yyvsp[(4) - (4)].ParamAttrs); E.Val = getVal((yyvsp[(1) - (4)].TypeVal)->get(), (yyvsp[(3) - (4)].ValIDVal));
- (yyval.ParamList)->push_back(E);
- delete (yyvsp[(1) - (4)].TypeVal);
- CHECK_FOR_ERROR
- ;}
- break;
-
- case 291:
-#line 2788 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- // FIXME: Remove trailing OptParamAttrs in LLVM 3.0, it was a mistake in 2.0
- // Labels are only valid in ASMs
- (yyval.ParamList) = new ParamList();
- ParamListEntry E; E.Attrs = (yyvsp[(2) - (4)].ParamAttrs) | (yyvsp[(4) - (4)].ParamAttrs); E.Val = getBBVal((yyvsp[(3) - (4)].ValIDVal));
- (yyval.ParamList)->push_back(E);
- CHECK_FOR_ERROR
- ;}
- break;
-
- case 292:
-#line 2796 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- // FIXME: Remove trailing OptParamAttrs in LLVM 3.0, it was a mistake in 2.0
- if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription());
- (yyval.ParamList) = (yyvsp[(1) - (6)].ParamList);
- ParamListEntry E; E.Attrs = (yyvsp[(4) - (6)].ParamAttrs) | (yyvsp[(6) - (6)].ParamAttrs); E.Val = getVal((yyvsp[(3) - (6)].TypeVal)->get(), (yyvsp[(5) - (6)].ValIDVal));
- (yyval.ParamList)->push_back(E);
- delete (yyvsp[(3) - (6)].TypeVal);
- CHECK_FOR_ERROR
- ;}
- break;
-
- case 293:
-#line 2806 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- // FIXME: Remove trailing OptParamAttrs in LLVM 3.0, it was a mistake in 2.0
- (yyval.ParamList) = (yyvsp[(1) - (6)].ParamList);
- ParamListEntry E; E.Attrs = (yyvsp[(4) - (6)].ParamAttrs) | (yyvsp[(6) - (6)].ParamAttrs); E.Val = getBBVal((yyvsp[(5) - (6)].ValIDVal));
- (yyval.ParamList)->push_back(E);
- CHECK_FOR_ERROR
- ;}
- break;
-
- case 294:
-#line 2813 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- { (yyval.ParamList) = new ParamList(); ;}
- break;
-
- case 295:
-#line 2816 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- { (yyval.ValueList) = new std::vector<Value*>(); ;}
- break;
-
- case 296:
-#line 2817 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- (yyval.ValueList) = (yyvsp[(1) - (3)].ValueList);
- (yyval.ValueList)->push_back((yyvsp[(3) - (3)].ValueVal));
- CHECK_FOR_ERROR
- ;}
- break;
-
- case 297:
-#line 2824 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- (yyval.BoolVal) = true;
- CHECK_FOR_ERROR
- ;}
- break;
-
- case 298:
-#line 2828 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- (yyval.BoolVal) = false;
- CHECK_FOR_ERROR
- ;}
- break;
-
- case 299:
-#line 2833 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (5)].TypeVal))->getDescription());
- if (!(*(yyvsp[(2) - (5)].TypeVal))->isInteger() && !(*(yyvsp[(2) - (5)].TypeVal))->isFloatingPoint() &&
- !isa<VectorType>((*(yyvsp[(2) - (5)].TypeVal)).get()))
- GEN_ERROR(
- "Arithmetic operator requires integer, FP, or packed operands");
- Value* val1 = getVal(*(yyvsp[(2) - (5)].TypeVal), (yyvsp[(3) - (5)].ValIDVal));
- CHECK_FOR_ERROR
- Value* val2 = getVal(*(yyvsp[(2) - (5)].TypeVal), (yyvsp[(5) - (5)].ValIDVal));
- CHECK_FOR_ERROR
- (yyval.InstVal) = BinaryOperator::create((yyvsp[(1) - (5)].BinaryOpVal), val1, val2);
- if ((yyval.InstVal) == 0)
- GEN_ERROR("binary operator returned null");
- delete (yyvsp[(2) - (5)].TypeVal);
- ;}
- break;
-
- case 300:
-#line 2849 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (5)].TypeVal))->getDescription());
- if (!(*(yyvsp[(2) - (5)].TypeVal))->isInteger()) {
- if (Instruction::isShift((yyvsp[(1) - (5)].BinaryOpVal)) || !isa<VectorType>((yyvsp[(2) - (5)].TypeVal)->get()) ||
- !cast<VectorType>((yyvsp[(2) - (5)].TypeVal)->get())->getElementType()->isInteger())
- GEN_ERROR("Logical operator requires integral operands");
- }
- Value* tmpVal1 = getVal(*(yyvsp[(2) - (5)].TypeVal), (yyvsp[(3) - (5)].ValIDVal));
- CHECK_FOR_ERROR
- Value* tmpVal2 = getVal(*(yyvsp[(2) - (5)].TypeVal), (yyvsp[(5) - (5)].ValIDVal));
- CHECK_FOR_ERROR
- (yyval.InstVal) = BinaryOperator::create((yyvsp[(1) - (5)].BinaryOpVal), tmpVal1, tmpVal2);
- if ((yyval.InstVal) == 0)
- GEN_ERROR("binary operator returned null");
- delete (yyvsp[(2) - (5)].TypeVal);
- ;}
- break;
-
- case 301:
-#line 2866 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription());
- if (isa<VectorType>((*(yyvsp[(3) - (6)].TypeVal)).get()))
- GEN_ERROR("Vector types not supported by icmp instruction");
- Value* tmpVal1 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(4) - (6)].ValIDVal));
- CHECK_FOR_ERROR
- Value* tmpVal2 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(6) - (6)].ValIDVal));
- CHECK_FOR_ERROR
- (yyval.InstVal) = CmpInst::create((yyvsp[(1) - (6)].OtherOpVal), (yyvsp[(2) - (6)].IPredicate), tmpVal1, tmpVal2);
- if ((yyval.InstVal) == 0)
- GEN_ERROR("icmp operator returned null");
- delete (yyvsp[(3) - (6)].TypeVal);
- ;}
- break;
-
- case 302:
-#line 2880 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription());
- if (isa<VectorType>((*(yyvsp[(3) - (6)].TypeVal)).get()))
- GEN_ERROR("Vector types not supported by fcmp instruction");
- Value* tmpVal1 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(4) - (6)].ValIDVal));
- CHECK_FOR_ERROR
- Value* tmpVal2 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(6) - (6)].ValIDVal));
- CHECK_FOR_ERROR
- (yyval.InstVal) = CmpInst::create((yyvsp[(1) - (6)].OtherOpVal), (yyvsp[(2) - (6)].FPredicate), tmpVal1, tmpVal2);
- if ((yyval.InstVal) == 0)
- GEN_ERROR("fcmp operator returned null");
- delete (yyvsp[(3) - (6)].TypeVal);
- ;}
- break;
-
- case 303:
-#line 2894 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(4) - (4)].TypeVal))->getDescription());
- Value* Val = (yyvsp[(2) - (4)].ValueVal);
- const Type* DestTy = (yyvsp[(4) - (4)].TypeVal)->get();
- if (!CastInst::castIsValid((yyvsp[(1) - (4)].CastOpVal), Val, DestTy))
- GEN_ERROR("invalid cast opcode for cast from '" +
- Val->getType()->getDescription() + "' to '" +
- DestTy->getDescription() + "'");
- (yyval.InstVal) = CastInst::create((yyvsp[(1) - (4)].CastOpVal), Val, DestTy);
- delete (yyvsp[(4) - (4)].TypeVal);
- ;}
- break;
-
- case 304:
-#line 2906 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- if ((yyvsp[(2) - (6)].ValueVal)->getType() != Type::Int1Ty)
- GEN_ERROR("select condition must be boolean");
- if ((yyvsp[(4) - (6)].ValueVal)->getType() != (yyvsp[(6) - (6)].ValueVal)->getType())
- GEN_ERROR("select value types should match");
- (yyval.InstVal) = SelectInst::Create((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal));
- CHECK_FOR_ERROR
- ;}
- break;
-
- case 305:
-#line 2914 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(4) - (4)].TypeVal))->getDescription());
- (yyval.InstVal) = new VAArgInst((yyvsp[(2) - (4)].ValueVal), *(yyvsp[(4) - (4)].TypeVal));
- delete (yyvsp[(4) - (4)].TypeVal);
- CHECK_FOR_ERROR
- ;}
- break;
-
- case 306:
-#line 2921 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- if (!ExtractElementInst::isValidOperands((yyvsp[(2) - (4)].ValueVal), (yyvsp[(4) - (4)].ValueVal)))
- GEN_ERROR("Invalid extractelement operands");
- (yyval.InstVal) = new ExtractElementInst((yyvsp[(2) - (4)].ValueVal), (yyvsp[(4) - (4)].ValueVal));
- CHECK_FOR_ERROR
- ;}
- break;
-
- case 307:
-#line 2927 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- if (!InsertElementInst::isValidOperands((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal)))
- GEN_ERROR("Invalid insertelement operands");
- (yyval.InstVal) = InsertElementInst::Create((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal));
- CHECK_FOR_ERROR
- ;}
- break;
-
- case 308:
-#line 2933 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- if (!ShuffleVectorInst::isValidOperands((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal)))
- GEN_ERROR("Invalid shufflevector operands");
- (yyval.InstVal) = new ShuffleVectorInst((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal));
- CHECK_FOR_ERROR
- ;}
- break;
-
- case 309:
-#line 2939 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- const Type *Ty = (yyvsp[(2) - (2)].PHIList)->front().first->getType();
- if (!Ty->isFirstClassType())
- GEN_ERROR("PHI node operands must be of first class type");
- (yyval.InstVal) = PHINode::Create(Ty);
- ((PHINode*)(yyval.InstVal))->reserveOperandSpace((yyvsp[(2) - (2)].PHIList)->size());
- while ((yyvsp[(2) - (2)].PHIList)->begin() != (yyvsp[(2) - (2)].PHIList)->end()) {
- if ((yyvsp[(2) - (2)].PHIList)->front().first->getType() != Ty)
- GEN_ERROR("All elements of a PHI node must be of the same type");
- cast<PHINode>((yyval.InstVal))->addIncoming((yyvsp[(2) - (2)].PHIList)->front().first, (yyvsp[(2) - (2)].PHIList)->front().second);
- (yyvsp[(2) - (2)].PHIList)->pop_front();
- }
- delete (yyvsp[(2) - (2)].PHIList); // Free the list...
- CHECK_FOR_ERROR
- ;}
- break;
-
- case 310:
-#line 2955 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
-
- // Handle the short syntax
- const PointerType *PFTy = 0;
- const FunctionType *Ty = 0;
- if (!(PFTy = dyn_cast<PointerType>((yyvsp[(3) - (8)].TypeVal)->get())) ||
- !(Ty = dyn_cast<FunctionType>(PFTy->getElementType()))) {
- // Pull out the types of all of the arguments...
- std::vector<const Type*> ParamTypes;
- ParamList::iterator I = (yyvsp[(6) - (8)].ParamList)->begin(), E = (yyvsp[(6) - (8)].ParamList)->end();
- for (; I != E; ++I) {
- const Type *Ty = I->Val->getType();
- if (Ty == Type::VoidTy)
- GEN_ERROR("Short call syntax cannot be used with varargs");
- ParamTypes.push_back(Ty);
- }
-
- if (!FunctionType::isValidReturnType(*(yyvsp[(3) - (8)].TypeVal)))
- GEN_ERROR("Invalid result type for LLVM function");
-
- Ty = FunctionType::get((yyvsp[(3) - (8)].TypeVal)->get(), ParamTypes, false);
- PFTy = PointerType::getUnqual(Ty);
- }
-
- Value *V = getVal(PFTy, (yyvsp[(4) - (8)].ValIDVal)); // Get the function we're calling...
- CHECK_FOR_ERROR
-
- // Check for call to invalid intrinsic to avoid crashing later.
- if (Function *theF = dyn_cast<Function>(V)) {
- if (theF->hasName() && (theF->getValueName()->getKeyLength() >= 5) &&
- (0 == strncmp(theF->getValueName()->getKeyData(), "llvm.", 5)) &&
- !theF->getIntrinsicID(true))
- GEN_ERROR("Call to invalid LLVM intrinsic function '" +
- theF->getName() + "'");
- }
-
- // Set up the ParamAttrs for the function
- SmallVector<ParamAttrsWithIndex, 8> Attrs;
- if ((yyvsp[(8) - (8)].ParamAttrs) != ParamAttr::None)
- Attrs.push_back(ParamAttrsWithIndex::get(0, (yyvsp[(8) - (8)].ParamAttrs)));
- // Check the arguments
- ValueList Args;
- if ((yyvsp[(6) - (8)].ParamList)->empty()) { // Has no arguments?
- // Make sure no arguments is a good thing!
- if (Ty->getNumParams() != 0)
- GEN_ERROR("No arguments passed to a function that "
- "expects arguments");
- } else { // Has arguments?
- // Loop through FunctionType's arguments and ensure they are specified
- // correctly. Also, gather any parameter attributes.
- FunctionType::param_iterator I = Ty->param_begin();
- FunctionType::param_iterator E = Ty->param_end();
- ParamList::iterator ArgI = (yyvsp[(6) - (8)].ParamList)->begin(), ArgE = (yyvsp[(6) - (8)].ParamList)->end();
- unsigned index = 1;
-
- for (; ArgI != ArgE && I != E; ++ArgI, ++I, ++index) {
- if (ArgI->Val->getType() != *I)
- GEN_ERROR("Parameter " + ArgI->Val->getName()+ " is not of type '" +
- (*I)->getDescription() + "'");
- Args.push_back(ArgI->Val);
- if (ArgI->Attrs != ParamAttr::None)
- Attrs.push_back(ParamAttrsWithIndex::get(index, ArgI->Attrs));
- }
- if (Ty->isVarArg()) {
- if (I == E)
- for (; ArgI != ArgE; ++ArgI, ++index) {
- Args.push_back(ArgI->Val); // push the remaining varargs
- if (ArgI->Attrs != ParamAttr::None)
- Attrs.push_back(ParamAttrsWithIndex::get(index, ArgI->Attrs));
- }
- } else if (I != E || ArgI != ArgE)
- GEN_ERROR("Invalid number of parameters detected");
- }
-
- // Finish off the ParamAttrs and check them
- PAListPtr PAL;
- if (!Attrs.empty())
- PAL = PAListPtr::get(Attrs.begin(), Attrs.end());
-
- // Create the call node
- CallInst *CI = CallInst::Create(V, Args.begin(), Args.end());
- CI->setTailCall((yyvsp[(1) - (8)].BoolVal));
- CI->setCallingConv((yyvsp[(2) - (8)].UIntVal));
- CI->setParamAttrs(PAL);
- (yyval.InstVal) = CI;
- delete (yyvsp[(6) - (8)].ParamList);
- delete (yyvsp[(3) - (8)].TypeVal);
- CHECK_FOR_ERROR
- ;}
- break;
-
- case 311:
-#line 3044 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- (yyval.InstVal) = (yyvsp[(1) - (1)].InstVal);
- CHECK_FOR_ERROR
- ;}
- break;
-
- case 312:
-#line 3049 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- (yyval.BoolVal) = true;
- CHECK_FOR_ERROR
- ;}
- break;
-
- case 313:
-#line 3053 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- (yyval.BoolVal) = false;
- CHECK_FOR_ERROR
- ;}
- break;
-
- case 314:
-#line 3060 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (3)].TypeVal))->getDescription());
- (yyval.InstVal) = new MallocInst(*(yyvsp[(2) - (3)].TypeVal), 0, (yyvsp[(3) - (3)].UIntVal));
- delete (yyvsp[(2) - (3)].TypeVal);
- CHECK_FOR_ERROR
- ;}
- break;
-
- case 315:
-#line 3067 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (6)].TypeVal))->getDescription());
- Value* tmpVal = getVal((yyvsp[(4) - (6)].PrimType), (yyvsp[(5) - (6)].ValIDVal));
- CHECK_FOR_ERROR
- (yyval.InstVal) = new MallocInst(*(yyvsp[(2) - (6)].TypeVal), tmpVal, (yyvsp[(6) - (6)].UIntVal));
- delete (yyvsp[(2) - (6)].TypeVal);
- ;}
- break;
-
- case 316:
-#line 3075 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (3)].TypeVal))->getDescription());
- (yyval.InstVal) = new AllocaInst(*(yyvsp[(2) - (3)].TypeVal), 0, (yyvsp[(3) - (3)].UIntVal));
- delete (yyvsp[(2) - (3)].TypeVal);
- CHECK_FOR_ERROR
- ;}
- break;
-
- case 317:
-#line 3082 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (6)].TypeVal))->getDescription());
- Value* tmpVal = getVal((yyvsp[(4) - (6)].PrimType), (yyvsp[(5) - (6)].ValIDVal));
- CHECK_FOR_ERROR
- (yyval.InstVal) = new AllocaInst(*(yyvsp[(2) - (6)].TypeVal), tmpVal, (yyvsp[(6) - (6)].UIntVal));
- delete (yyvsp[(2) - (6)].TypeVal);
- ;}
- break;
-
- case 318:
-#line 3090 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- if (!isa<PointerType>((yyvsp[(2) - (2)].ValueVal)->getType()))
- GEN_ERROR("Trying to free nonpointer type " +
- (yyvsp[(2) - (2)].ValueVal)->getType()->getDescription() + "");
- (yyval.InstVal) = new FreeInst((yyvsp[(2) - (2)].ValueVal));
- CHECK_FOR_ERROR
- ;}
- break;
-
- case 319:
-#line 3098 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (5)].TypeVal))->getDescription());
- if (!isa<PointerType>((yyvsp[(3) - (5)].TypeVal)->get()))
- GEN_ERROR("Can't load from nonpointer type: " +
- (*(yyvsp[(3) - (5)].TypeVal))->getDescription());
- if (!cast<PointerType>((yyvsp[(3) - (5)].TypeVal)->get())->getElementType()->isFirstClassType())
- GEN_ERROR("Can't load from pointer of non-first-class type: " +
- (*(yyvsp[(3) - (5)].TypeVal))->getDescription());
- Value* tmpVal = getVal(*(yyvsp[(3) - (5)].TypeVal), (yyvsp[(4) - (5)].ValIDVal));
- CHECK_FOR_ERROR
- (yyval.InstVal) = new LoadInst(tmpVal, "", (yyvsp[(1) - (5)].BoolVal), (yyvsp[(5) - (5)].UIntVal));
- delete (yyvsp[(3) - (5)].TypeVal);
- ;}
- break;
-
- case 320:
-#line 3112 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(5) - (7)].TypeVal))->getDescription());
- const PointerType *PT = dyn_cast<PointerType>((yyvsp[(5) - (7)].TypeVal)->get());
- if (!PT)
- GEN_ERROR("Can't store to a nonpointer type: " +
- (*(yyvsp[(5) - (7)].TypeVal))->getDescription());
- const Type *ElTy = PT->getElementType();
- if (ElTy != (yyvsp[(3) - (7)].ValueVal)->getType())
- GEN_ERROR("Can't store '" + (yyvsp[(3) - (7)].ValueVal)->getType()->getDescription() +
- "' into space of type '" + ElTy->getDescription() + "'");
-
- Value* tmpVal = getVal(*(yyvsp[(5) - (7)].TypeVal), (yyvsp[(6) - (7)].ValIDVal));
- CHECK_FOR_ERROR
- (yyval.InstVal) = new StoreInst((yyvsp[(3) - (7)].ValueVal), tmpVal, (yyvsp[(1) - (7)].BoolVal), (yyvsp[(7) - (7)].UIntVal));
- delete (yyvsp[(5) - (7)].TypeVal);
- ;}
- break;
-
- case 321:
-#line 3129 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- Value *TmpVal = getVal((yyvsp[(2) - (5)].TypeVal)->get(), (yyvsp[(3) - (5)].ValIDVal));
- if (!GetResultInst::isValidOperands(TmpVal, (yyvsp[(5) - (5)].UInt64Val)))
- GEN_ERROR("Invalid getresult operands");
- (yyval.InstVal) = new GetResultInst(TmpVal, (yyvsp[(5) - (5)].UInt64Val));
- delete (yyvsp[(2) - (5)].TypeVal);
- CHECK_FOR_ERROR
- ;}
- break;
-
- case 322:
-#line 3137 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
- {
- if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (4)].TypeVal))->getDescription());
- if (!isa<PointerType>((yyvsp[(2) - (4)].TypeVal)->get()))
- GEN_ERROR("getelementptr insn requires pointer operand");
-
- if (!GetElementPtrInst::getIndexedType(*(yyvsp[(2) - (4)].TypeVal), (yyvsp[(4) - (4)].ValueList)->begin(), (yyvsp[(4) - (4)].ValueList)->end(), true))
- GEN_ERROR("Invalid getelementptr indices for type '" +
- (*(yyvsp[(2) - (4)].TypeVal))->getDescription()+ "'");
- Value* tmpVal = getVal(*(yyvsp[(2) - (4)].TypeVal), (yyvsp[(3) - (4)].ValIDVal));
- CHECK_FOR_ERROR
- (yyval.InstVal) = GetElementPtrInst::Create(tmpVal, (yyvsp[(4) - (4)].ValueList)->begin(), (yyvsp[(4) - (4)].ValueList)->end());
- delete (yyvsp[(2) - (4)].TypeVal);
- delete (yyvsp[(4) - (4)].ValueList);
- ;}
- break;
-
-
-/* Line 1267 of yacc.c. */
-#line 6387 "llvmAsmParser.tab.c"
- default: break;
- }
- YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
-
- YYPOPSTACK (yylen);
- yylen = 0;
- YY_STACK_PRINT (yyss, yyssp);
-
- *++yyvsp = yyval;
-
-
- /* Now `shift' the result of the reduction. Determine what state
- that goes to, based on the state we popped back to and the rule
- number reduced by. */
-
- yyn = yyr1[yyn];
-
- yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
- if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
- yystate = yytable[yystate];
- else
- yystate = yydefgoto[yyn - YYNTOKENS];
-
- goto yynewstate;
-
-
-/*------------------------------------.
-| yyerrlab -- here on detecting error |
-`------------------------------------*/
-yyerrlab:
- /* If not already recovering from an error, report this error. */
- if (!yyerrstatus)
- {
- ++yynerrs;
-#if ! YYERROR_VERBOSE
- yyerror (YY_("syntax error"));
-#else
- {
- YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
- if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
- {
- YYSIZE_T yyalloc = 2 * yysize;
- if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
- yyalloc = YYSTACK_ALLOC_MAXIMUM;
- if (yymsg != yymsgbuf)
- YYSTACK_FREE (yymsg);
- yymsg = (char *) YYSTACK_ALLOC (yyalloc);
- if (yymsg)
- yymsg_alloc = yyalloc;
- else
- {
- yymsg = yymsgbuf;
- yymsg_alloc = sizeof yymsgbuf;
- }
- }
-
- if (0 < yysize && yysize <= yymsg_alloc)
- {
- (void) yysyntax_error (yymsg, yystate, yychar);
- yyerror (yymsg);
- }
- else
- {
- yyerror (YY_("syntax error"));
- if (yysize != 0)
- goto yyexhaustedlab;
- }
- }
-#endif
- }
-
-
-
- if (yyerrstatus == 3)
- {
- /* If just tried and failed to reuse look-ahead token after an
- error, discard it. */
-
- if (yychar <= YYEOF)
- {
- /* Return failure if at end of input. */
- if (yychar == YYEOF)
- YYABORT;
- }
- else
- {
- yydestruct ("Error: discarding",
- yytoken, &yylval);
- yychar = YYEMPTY;
- }
- }
-
- /* Else will try to reuse look-ahead token after shifting the error
- token. */
- goto yyerrlab1;
-
-
-/*---------------------------------------------------.
-| yyerrorlab -- error raised explicitly by YYERROR. |
-`---------------------------------------------------*/
-yyerrorlab:
-
- /* Pacify compilers like GCC when the user code never invokes
- YYERROR and the label yyerrorlab therefore never appears in user
- code. */
- if (/*CONSTCOND*/ 0)
- goto yyerrorlab;
-
- /* Do not reclaim the symbols of the rule which action triggered
- this YYERROR. */
- YYPOPSTACK (yylen);
- yylen = 0;
- YY_STACK_PRINT (yyss, yyssp);
- yystate = *yyssp;
- goto yyerrlab1;
-
-
-/*-------------------------------------------------------------.
-| yyerrlab1 -- common code for both syntax error and YYERROR. |
-`-------------------------------------------------------------*/
-yyerrlab1:
- yyerrstatus = 3; /* Each real token shifted decrements this. */
-
- for (;;)
- {
- yyn = yypact[yystate];
- if (yyn != YYPACT_NINF)
- {
- yyn += YYTERROR;
- if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
- {
- yyn = yytable[yyn];
- if (0 < yyn)
- break;
- }
- }
-
- /* Pop the current state because it cannot handle the error token. */
- if (yyssp == yyss)
- YYABORT;
-
-
- yydestruct ("Error: popping",
- yystos[yystate], yyvsp);
- YYPOPSTACK (1);
- yystate = *yyssp;
- YY_STACK_PRINT (yyss, yyssp);
- }
-
- if (yyn == YYFINAL)
- YYACCEPT;
-
- *++yyvsp = yylval;
-
-
- /* Shift the error token. */
- YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
-
- yystate = yyn;
- goto yynewstate;
-
-
-/*-------------------------------------.
-| yyacceptlab -- YYACCEPT comes here. |
-`-------------------------------------*/
-yyacceptlab:
- yyresult = 0;
- goto yyreturn;
-
-/*-----------------------------------.
-| yyabortlab -- YYABORT comes here. |
-`-----------------------------------*/
-yyabortlab:
- yyresult = 1;
- goto yyreturn;
-
-#ifndef yyoverflow
-/*-------------------------------------------------.
-| yyexhaustedlab -- memory exhaustion comes here. |
-`-------------------------------------------------*/
-yyexhaustedlab:
- yyerror (YY_("memory exhausted"));
- yyresult = 2;
- /* Fall through. */
-#endif
-
-yyreturn:
- if (yychar != YYEOF && yychar != YYEMPTY)
- yydestruct ("Cleanup: discarding lookahead",
- yytoken, &yylval);
- /* Do not reclaim the symbols of the rule which action triggered
- this YYABORT or YYACCEPT. */
- YYPOPSTACK (yylen);
- YY_STACK_PRINT (yyss, yyssp);
- while (yyssp != yyss)
- {
- yydestruct ("Cleanup: popping",
- yystos[*yyssp], yyvsp);
- YYPOPSTACK (1);
- }
-#ifndef yyoverflow
- if (yyss != yyssa)
- YYSTACK_FREE (yyss);
-#endif
-#if YYERROR_VERBOSE
- if (yymsg != yymsgbuf)
- YYSTACK_FREE (yymsg);
-#endif
- /* Make sure YYID is used. */
- return YYID (yyresult);
-}
-
-
-#line 3154 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
-
-
-// common code from the two 'RunVMAsmParser' functions
-static Module* RunParser(Module * M) {
- CurModule.CurrentModule = M;
- // Check to make sure the parser succeeded
- if (yyparse()) {
- if (ParserResult)
- delete ParserResult;
- return 0;
- }
-
- // Emit an error if there are any unresolved types left.
- if (!CurModule.LateResolveTypes.empty()) {
- const ValID &DID = CurModule.LateResolveTypes.begin()->first;
- if (DID.Type == ValID::LocalName) {
- GenerateError("Undefined type remains at eof: '"+DID.getName() + "'");
- } else {
- GenerateError("Undefined type remains at eof: #" + itostr(DID.Num));
- }
- if (ParserResult)
- delete ParserResult;
- return 0;
- }
-
- // Emit an error if there are any unresolved values left.
- if (!CurModule.LateResolveValues.empty()) {
- Value *V = CurModule.LateResolveValues.back();
- std::map<Value*, std::pair<ValID, int> >::iterator I =
- CurModule.PlaceHolderInfo.find(V);
-
- if (I != CurModule.PlaceHolderInfo.end()) {
- ValID &DID = I->second.first;
- if (DID.Type == ValID::LocalName) {
- GenerateError("Undefined value remains at eof: "+DID.getName() + "'");
- } else {
- GenerateError("Undefined value remains at eof: #" + itostr(DID.Num));
- }
- if (ParserResult)
- delete ParserResult;
- return 0;
- }
- }
-
- // Check to make sure that parsing produced a result
- if (!ParserResult)
- return 0;
-
- // Reset ParserResult variable while saving its value for the result.
- Module *Result = ParserResult;
- ParserResult = 0;
-
- return Result;
-}
-
-void llvm::GenerateError(const std::string &message, int LineNo) {
- if (LineNo == -1) LineNo = LLLgetLineNo();
- // TODO: column number in exception
- if (TheParseError)
- TheParseError->setError(LLLgetFilename(), message, LineNo);
- TriggerError = 1;
-}
-
-int yyerror(const char *ErrorMsg) {
- std::string where = LLLgetFilename() + ":" + utostr(LLLgetLineNo()) + ": ";
- std::string errMsg = where + "error: " + std::string(ErrorMsg);
- if (yychar != YYEMPTY && yychar != 0) {
- errMsg += " while reading token: '";
- errMsg += std::string(LLLgetTokenStart(),
- LLLgetTokenStart()+LLLgetTokenLength()) + "'";
- }
- GenerateError(errMsg);
- return 0;
-}
-
diff --git a/release_23/lib/AsmParser/llvmAsmParser.h.cvs b/release_23/lib/AsmParser/llvmAsmParser.h.cvs
deleted file mode 100644
index e3f22fc5a3c9..000000000000
--- a/release_23/lib/AsmParser/llvmAsmParser.h.cvs
+++ /dev/null
@@ -1,403 +0,0 @@
-/* A Bison parser, made by GNU Bison 2.3. */
-
-/* Skeleton interface for Bison's Yacc-like parsers in C
-
- Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
- Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA. */
-
-/* As a special exception, you may create a larger work that contains
- part or all of the Bison parser skeleton and distribute that work
- under terms of your choice, so long as that work isn't itself a
- parser generator using the skeleton or a modified version thereof
- as a parser skeleton. Alternatively, if you modify or redistribute
- the parser skeleton itself, you may (at your option) remove this
- special exception, which will cause the skeleton and the resulting
- Bison output files to be licensed under the GNU General Public
- License without this special exception.
-
- This special exception was added by the Free Software Foundation in
- version 2.2 of Bison. */
-
-/* Tokens. */
-#ifndef YYTOKENTYPE
-# define YYTOKENTYPE
- /* Put the tokens into the symbol table, so that GDB and other debuggers
- know about them. */
- enum yytokentype {
- ESINT64VAL = 258,
- EUINT64VAL = 259,
- ESAPINTVAL = 260,
- EUAPINTVAL = 261,
- LOCALVAL_ID = 262,
- GLOBALVAL_ID = 263,
- FPVAL = 264,
- VOID = 265,
- INTTYPE = 266,
- FLOAT = 267,
- DOUBLE = 268,
- X86_FP80 = 269,
- FP128 = 270,
- PPC_FP128 = 271,
- LABEL = 272,
- TYPE = 273,
- LOCALVAR = 274,
- GLOBALVAR = 275,
- LABELSTR = 276,
- STRINGCONSTANT = 277,
- ATSTRINGCONSTANT = 278,
- PCTSTRINGCONSTANT = 279,
- ZEROINITIALIZER = 280,
- TRUETOK = 281,
- FALSETOK = 282,
- BEGINTOK = 283,
- ENDTOK = 284,
- DECLARE = 285,
- DEFINE = 286,
- GLOBAL = 287,
- CONSTANT = 288,
- SECTION = 289,
- ALIAS = 290,
- VOLATILE = 291,
- THREAD_LOCAL = 292,
- TO = 293,
- DOTDOTDOT = 294,
- NULL_TOK = 295,
- UNDEF = 296,
- INTERNAL = 297,
- LINKONCE = 298,
- WEAK = 299,
- APPENDING = 300,
- DLLIMPORT = 301,
- DLLEXPORT = 302,
- EXTERN_WEAK = 303,
- OPAQUE = 304,
- EXTERNAL = 305,
- TARGET = 306,
- TRIPLE = 307,
- ALIGN = 308,
- ADDRSPACE = 309,
- DEPLIBS = 310,
- CALL = 311,
- TAIL = 312,
- ASM_TOK = 313,
- MODULE = 314,
- SIDEEFFECT = 315,
- CC_TOK = 316,
- CCC_TOK = 317,
- FASTCC_TOK = 318,
- COLDCC_TOK = 319,
- X86_STDCALLCC_TOK = 320,
- X86_FASTCALLCC_TOK = 321,
- DATALAYOUT = 322,
- RET = 323,
- BR = 324,
- SWITCH = 325,
- INVOKE = 326,
- UNWIND = 327,
- UNREACHABLE = 328,
- ADD = 329,
- SUB = 330,
- MUL = 331,
- UDIV = 332,
- SDIV = 333,
- FDIV = 334,
- UREM = 335,
- SREM = 336,
- FREM = 337,
- AND = 338,
- OR = 339,
- XOR = 340,
- SHL = 341,
- LSHR = 342,
- ASHR = 343,
- ICMP = 344,
- FCMP = 345,
- EQ = 346,
- NE = 347,
- SLT = 348,
- SGT = 349,
- SLE = 350,
- SGE = 351,
- ULT = 352,
- UGT = 353,
- ULE = 354,
- UGE = 355,
- OEQ = 356,
- ONE = 357,
- OLT = 358,
- OGT = 359,
- OLE = 360,
- OGE = 361,
- ORD = 362,
- UNO = 363,
- UEQ = 364,
- UNE = 365,
- MALLOC = 366,
- ALLOCA = 367,
- FREE = 368,
- LOAD = 369,
- STORE = 370,
- GETELEMENTPTR = 371,
- TRUNC = 372,
- ZEXT = 373,
- SEXT = 374,
- FPTRUNC = 375,
- FPEXT = 376,
- BITCAST = 377,
- UITOFP = 378,
- SITOFP = 379,
- FPTOUI = 380,
- FPTOSI = 381,
- INTTOPTR = 382,
- PTRTOINT = 383,
- PHI_TOK = 384,
- SELECT = 385,
- VAARG = 386,
- EXTRACTELEMENT = 387,
- INSERTELEMENT = 388,
- SHUFFLEVECTOR = 389,
- GETRESULT = 390,
- SIGNEXT = 391,
- ZEROEXT = 392,
- NORETURN = 393,
- INREG = 394,
- SRET = 395,
- NOUNWIND = 396,
- NOALIAS = 397,
- BYVAL = 398,
- NEST = 399,
- READNONE = 400,
- READONLY = 401,
- GC = 402,
- DEFAULT = 403,
- HIDDEN = 404,
- PROTECTED = 405
- };
-#endif
-/* Tokens. */
-#define ESINT64VAL 258
-#define EUINT64VAL 259
-#define ESAPINTVAL 260
-#define EUAPINTVAL 261
-#define LOCALVAL_ID 262
-#define GLOBALVAL_ID 263
-#define FPVAL 264
-#define VOID 265
-#define INTTYPE 266
-#define FLOAT 267
-#define DOUBLE 268
-#define X86_FP80 269
-#define FP128 270
-#define PPC_FP128 271
-#define LABEL 272
-#define TYPE 273
-#define LOCALVAR 274
-#define GLOBALVAR 275
-#define LABELSTR 276
-#define STRINGCONSTANT 277
-#define ATSTRINGCONSTANT 278
-#define PCTSTRINGCONSTANT 279
-#define ZEROINITIALIZER 280
-#define TRUETOK 281
-#define FALSETOK 282
-#define BEGINTOK 283
-#define ENDTOK 284
-#define DECLARE 285
-#define DEFINE 286
-#define GLOBAL 287
-#define CONSTANT 288
-#define SECTION 289
-#define ALIAS 290
-#define VOLATILE 291
-#define THREAD_LOCAL 292
-#define TO 293
-#define DOTDOTDOT 294
-#define NULL_TOK 295
-#define UNDEF 296
-#define INTERNAL 297
-#define LINKONCE 298
-#define WEAK 299
-#define APPENDING 300
-#define DLLIMPORT 301
-#define DLLEXPORT 302
-#define EXTERN_WEAK 303
-#define OPAQUE 304
-#define EXTERNAL 305
-#define TARGET 306
-#define TRIPLE 307
-#define ALIGN 308
-#define ADDRSPACE 309
-#define DEPLIBS 310
-#define CALL 311
-#define TAIL 312
-#define ASM_TOK 313
-#define MODULE 314
-#define SIDEEFFECT 315
-#define CC_TOK 316
-#define CCC_TOK 317
-#define FASTCC_TOK 318
-#define COLDCC_TOK 319
-#define X86_STDCALLCC_TOK 320
-#define X86_FASTCALLCC_TOK 321
-#define DATALAYOUT 322
-#define RET 323
-#define BR 324
-#define SWITCH 325
-#define INVOKE 326
-#define UNWIND 327
-#define UNREACHABLE 328
-#define ADD 329
-#define SUB 330
-#define MUL 331
-#define UDIV 332
-#define SDIV 333
-#define FDIV 334
-#define UREM 335
-#define SREM 336
-#define FREM 337
-#define AND 338
-#define OR 339
-#define XOR 340
-#define SHL 341
-#define LSHR 342
-#define ASHR 343
-#define ICMP 344
-#define FCMP 345
-#define EQ 346
-#define NE 347
-#define SLT 348
-#define SGT 349
-#define SLE 350
-#define SGE 351
-#define ULT 352
-#define UGT 353
-#define ULE 354
-#define UGE 355
-#define OEQ 356
-#define ONE 357
-#define OLT 358
-#define OGT 359
-#define OLE 360
-#define OGE 361
-#define ORD 362
-#define UNO 363
-#define UEQ 364
-#define UNE 365
-#define MALLOC 366
-#define ALLOCA 367
-#define FREE 368
-#define LOAD 369
-#define STORE 370
-#define GETELEMENTPTR 371
-#define TRUNC 372
-#define ZEXT 373
-#define SEXT 374
-#define FPTRUNC 375
-#define FPEXT 376
-#define BITCAST 377
-#define UITOFP 378
-#define SITOFP 379
-#define FPTOUI 380
-#define FPTOSI 381
-#define INTTOPTR 382
-#define PTRTOINT 383
-#define PHI_TOK 384
-#define SELECT 385
-#define VAARG 386
-#define EXTRACTELEMENT 387
-#define INSERTELEMENT 388
-#define SHUFFLEVECTOR 389
-#define GETRESULT 390
-#define SIGNEXT 391
-#define ZEROEXT 392
-#define NORETURN 393
-#define INREG 394
-#define SRET 395
-#define NOUNWIND 396
-#define NOALIAS 397
-#define BYVAL 398
-#define NEST 399
-#define READNONE 400
-#define READONLY 401
-#define GC 402
-#define DEFAULT 403
-#define HIDDEN 404
-#define PROTECTED 405
-
-
-
-
-#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
-typedef union YYSTYPE
-#line 949 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
-{
- llvm::Module *ModuleVal;
- llvm::Function *FunctionVal;
- llvm::BasicBlock *BasicBlockVal;
- llvm::TerminatorInst *TermInstVal;
- llvm::Instruction *InstVal;
- llvm::Constant *ConstVal;
-
- const llvm::Type *PrimType;
- std::list<llvm::PATypeHolder> *TypeList;
- llvm::PATypeHolder *TypeVal;
- llvm::Value *ValueVal;
- std::vector<llvm::Value*> *ValueList;
- llvm::ArgListType *ArgList;
- llvm::TypeWithAttrs TypeWithAttrs;
- llvm::TypeWithAttrsList *TypeWithAttrsList;
- llvm::ParamList *ParamList;
-
- // Represent the RHS of PHI node
- std::list<std::pair<llvm::Value*,
- llvm::BasicBlock*> > *PHIList;
- std::vector<std::pair<llvm::Constant*, llvm::BasicBlock*> > *JumpTable;
- std::vector<llvm::Constant*> *ConstVector;
-
- llvm::GlobalValue::LinkageTypes Linkage;
- llvm::GlobalValue::VisibilityTypes Visibility;
- llvm::ParameterAttributes ParamAttrs;
- llvm::APInt *APIntVal;
- int64_t SInt64Val;
- uint64_t UInt64Val;
- int SIntVal;
- unsigned UIntVal;
- llvm::APFloat *FPVal;
- bool BoolVal;
-
- std::string *StrVal; // This memory must be deleted
- llvm::ValID ValIDVal;
-
- llvm::Instruction::BinaryOps BinaryOpVal;
- llvm::Instruction::TermOps TermOpVal;
- llvm::Instruction::MemoryOps MemOpVal;
- llvm::Instruction::CastOps CastOpVal;
- llvm::Instruction::OtherOps OtherOpVal;
- llvm::ICmpInst::Predicate IPredicate;
- llvm::FCmpInst::Predicate FPredicate;
-}
-/* Line 1529 of yacc.c. */
-#line 396 "llvmAsmParser.tab.h"
- YYSTYPE;
-# define yystype YYSTYPE /* obsolescent; will be withdrawn */
-# define YYSTYPE_IS_DECLARED 1
-# define YYSTYPE_IS_TRIVIAL 1
-#endif
-
-extern YYSTYPE llvmAsmlval;
-
diff --git a/release_23/lib/AsmParser/llvmAsmParser.y b/release_23/lib/AsmParser/llvmAsmParser.y
deleted file mode 100644
index f3a59ee0a6e8..000000000000
--- a/release_23/lib/AsmParser/llvmAsmParser.y
+++ /dev/null
@@ -1,3227 +0,0 @@
-//===-- llvmAsmParser.y - Parser for llvm assembly files --------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the bison parser for LLVM assembly languages files.
-//
-//===----------------------------------------------------------------------===//
-
-%{
-#include "ParserInternals.h"
-#include "llvm/CallingConv.h"
-#include "llvm/InlineAsm.h"
-#include "llvm/Instructions.h"
-#include "llvm/Module.h"
-#include "llvm/ValueSymbolTable.h"
-#include "llvm/AutoUpgrade.h"
-#include "llvm/Support/GetElementPtrTypeIterator.h"
-#include "llvm/Support/CommandLine.h"
-#include "llvm/ADT/SmallVector.h"
-#include "llvm/ADT/STLExtras.h"
-#include "llvm/Support/MathExtras.h"
-#include "llvm/Support/Streams.h"
-#include <algorithm>
-#include <list>
-#include <map>
-#include <utility>
-
-// The following is a gross hack. In order to rid the libAsmParser library of
-// exceptions, we have to have a way of getting the yyparse function to go into
-// an error situation. So, whenever we want an error to occur, the GenerateError
-// function (see bottom of file) sets TriggerError. Then, at the end of each
-// production in the grammer we use CHECK_FOR_ERROR which will invoke YYERROR
-// (a goto) to put YACC in error state. Furthermore, several calls to
-// GenerateError are made from inside productions and they must simulate the
-// previous exception behavior by exiting the production immediately. We have
-// replaced these with the GEN_ERROR macro which calls GeneratError and then
-// immediately invokes YYERROR. This would be so much cleaner if it was a
-// recursive descent parser.
-static bool TriggerError = false;
-#define CHECK_FOR_ERROR { if (TriggerError) { TriggerError = false; YYABORT; } }
-#define GEN_ERROR(msg) { GenerateError(msg); YYERROR; }
-
-int yyerror(const char *ErrorMsg); // Forward declarations to prevent "implicit
-int yylex(); // declaration" of xxx warnings.
-int yyparse();
-using namespace llvm;
-
-static Module *ParserResult;
-
-// DEBUG_UPREFS - Define this symbol if you want to enable debugging output
-// relating to upreferences in the input stream.
-//
-//#define DEBUG_UPREFS 1
-#ifdef DEBUG_UPREFS
-#define UR_OUT(X) cerr << X
-#else
-#define UR_OUT(X)
-#endif
-
-#define YYERROR_VERBOSE 1
-
-static GlobalVariable *CurGV;
-
-
-// This contains info used when building the body of a function. It is
-// destroyed when the function is completed.
-//
-typedef std::vector<Value *> ValueList; // Numbered defs
-
-static void
-ResolveDefinitions(ValueList &LateResolvers, ValueList *FutureLateResolvers=0);
-
-static struct PerModuleInfo {
- Module *CurrentModule;
- ValueList Values; // Module level numbered definitions
- ValueList LateResolveValues;
- std::vector<PATypeHolder> Types;
- std::map<ValID, PATypeHolder> LateResolveTypes;
-
- /// PlaceHolderInfo - When temporary placeholder objects are created, remember
- /// how they were referenced and on which line of the input they came from so
- /// that we can resolve them later and print error messages as appropriate.
- std::map<Value*, std::pair<ValID, int> > PlaceHolderInfo;
-
- // GlobalRefs - This maintains a mapping between <Type, ValID>'s and forward
- // references to global values. Global values may be referenced before they
- // are defined, and if so, the temporary object that they represent is held
- // here. This is used for forward references of GlobalValues.
- //
- typedef std::map<std::pair<const PointerType *,
- ValID>, GlobalValue*> GlobalRefsType;
- GlobalRefsType GlobalRefs;
-
- void ModuleDone() {
- // If we could not resolve some functions at function compilation time
- // (calls to functions before they are defined), resolve them now... Types
- // are resolved when the constant pool has been completely parsed.
- //
- ResolveDefinitions(LateResolveValues);
- if (TriggerError)
- return;
-
- // Check to make sure that all global value forward references have been
- // resolved!
- //
- if (!GlobalRefs.empty()) {
- std::string UndefinedReferences = "Unresolved global references exist:\n";
-
- for (GlobalRefsType::iterator I = GlobalRefs.begin(), E =GlobalRefs.end();
- I != E; ++I) {
- UndefinedReferences += " " + I->first.first->getDescription() + " " +
- I->first.second.getName() + "\n";
- }
- GenerateError(UndefinedReferences);
- return;
- }
-
- // Look for intrinsic functions and CallInst that need to be upgraded
- for (Module::iterator FI = CurrentModule->begin(),
- FE = CurrentModule->end(); FI != FE; )
- UpgradeCallsToIntrinsic(FI++); // must be post-increment, as we remove
-
- Values.clear(); // Clear out function local definitions
- Types.clear();
- CurrentModule = 0;
- }
-
- // GetForwardRefForGlobal - Check to see if there is a forward reference
- // for this global. If so, remove it from the GlobalRefs map and return it.
- // If not, just return null.
- GlobalValue *GetForwardRefForGlobal(const PointerType *PTy, ValID ID) {
- // Check to see if there is a forward reference to this global variable...
- // if there is, eliminate it and patch the reference to use the new def'n.
- GlobalRefsType::iterator I = GlobalRefs.find(std::make_pair(PTy, ID));
- GlobalValue *Ret = 0;
- if (I != GlobalRefs.end()) {
- Ret = I->second;
- GlobalRefs.erase(I);
- }
- return Ret;
- }
-
- bool TypeIsUnresolved(PATypeHolder* PATy) {
- // If it isn't abstract, its resolved
- const Type* Ty = PATy->get();
- if (!Ty->isAbstract())
- return false;
- // Traverse the type looking for abstract types. If it isn't abstract then
- // we don't need to traverse that leg of the type.
- std::vector<const Type*> WorkList, SeenList;
- WorkList.push_back(Ty);
- while (!WorkList.empty()) {
- const Type* Ty = WorkList.back();
- SeenList.push_back(Ty);
- WorkList.pop_back();
- if (const OpaqueType* OpTy = dyn_cast<OpaqueType>(Ty)) {
- // Check to see if this is an unresolved type
- std::map<ValID, PATypeHolder>::iterator I = LateResolveTypes.begin();
- std::map<ValID, PATypeHolder>::iterator E = LateResolveTypes.end();
- for ( ; I != E; ++I) {
- if (I->second.get() == OpTy)
- return true;
- }
- } else if (const SequentialType* SeqTy = dyn_cast<SequentialType>(Ty)) {
- const Type* TheTy = SeqTy->getElementType();
- if (TheTy->isAbstract() && TheTy != Ty) {
- std::vector<const Type*>::iterator I = SeenList.begin(),
- E = SeenList.end();
- for ( ; I != E; ++I)
- if (*I == TheTy)
- break;
- if (I == E)
- WorkList.push_back(TheTy);
- }
- } else if (const StructType* StrTy = dyn_cast<StructType>(Ty)) {
- for (unsigned i = 0; i < StrTy->getNumElements(); ++i) {
- const Type* TheTy = StrTy->getElementType(i);
- if (TheTy->isAbstract() && TheTy != Ty) {
- std::vector<const Type*>::iterator I = SeenList.begin(),
- E = SeenList.end();
- for ( ; I != E; ++I)
- if (*I == TheTy)
- break;
- if (I == E)
- WorkList.push_back(TheTy);
- }
- }
- }
- }
- return false;
- }
-} CurModule;
-
-static struct PerFunctionInfo {
- Function *CurrentFunction; // Pointer to current function being created
-
- ValueList Values; // Keep track of #'d definitions
- unsigned NextValNum;
- ValueList LateResolveValues;
- bool isDeclare; // Is this function a forward declararation?
- GlobalValue::LinkageTypes Linkage; // Linkage for forward declaration.
- GlobalValue::VisibilityTypes Visibility;
-
- /// BBForwardRefs - When we see forward references to basic blocks, keep
- /// track of them here.
- std::map<ValID, BasicBlock*> BBForwardRefs;
-
- inline PerFunctionInfo() {
- CurrentFunction = 0;
- isDeclare = false;
- Linkage = GlobalValue::ExternalLinkage;
- Visibility = GlobalValue::DefaultVisibility;
- }
-
- inline void FunctionStart(Function *M) {
- CurrentFunction = M;
- NextValNum = 0;
- }
-
- void FunctionDone() {
- // Any forward referenced blocks left?
- if (!BBForwardRefs.empty()) {
- GenerateError("Undefined reference to label " +
- BBForwardRefs.begin()->second->getName());
- return;
- }
-
- // Resolve all forward references now.
- ResolveDefinitions(LateResolveValues, &CurModule.LateResolveValues);
-
- Values.clear(); // Clear out function local definitions
- BBForwardRefs.clear();
- CurrentFunction = 0;
- isDeclare = false;
- Linkage = GlobalValue::ExternalLinkage;
- Visibility = GlobalValue::DefaultVisibility;
- }
-} CurFun; // Info for the current function...
-
-static bool inFunctionScope() { return CurFun.CurrentFunction != 0; }
-
-
-//===----------------------------------------------------------------------===//
-// Code to handle definitions of all the types
-//===----------------------------------------------------------------------===//
-
-static void InsertValue(Value *V, ValueList &ValueTab = CurFun.Values) {
- // Things that have names or are void typed don't get slot numbers
- if (V->hasName() || (V->getType() == Type::VoidTy))
- return;
-
- // In the case of function values, we have to allow for the forward reference
- // of basic blocks, which are included in the numbering. Consequently, we keep
- // track of the next insertion location with NextValNum. When a BB gets
- // inserted, it could change the size of the CurFun.Values vector.
- if (&ValueTab == &CurFun.Values) {
- if (ValueTab.size() <= CurFun.NextValNum)
- ValueTab.resize(CurFun.NextValNum+1);
- ValueTab[CurFun.NextValNum++] = V;
- return;
- }
- // For all other lists, its okay to just tack it on the back of the vector.
- ValueTab.push_back(V);
-}
-
-static const Type *getTypeVal(const ValID &D, bool DoNotImprovise = false) {
- switch (D.Type) {
- case ValID::LocalID: // Is it a numbered definition?
- // Module constants occupy the lowest numbered slots...
- if (D.Num < CurModule.Types.size())
- return CurModule.Types[D.Num];
- break;
- case ValID::LocalName: // Is it a named definition?
- if (const Type *N = CurModule.CurrentModule->getTypeByName(D.getName())) {
- D.destroy(); // Free old strdup'd memory...
- return N;
- }
- break;
- default:
- GenerateError("Internal parser error: Invalid symbol type reference");
- return 0;
- }
-
- // If we reached here, we referenced either a symbol that we don't know about
- // or an id number that hasn't been read yet. We may be referencing something
- // forward, so just create an entry to be resolved later and get to it...
- //
- if (DoNotImprovise) return 0; // Do we just want a null to be returned?
-
-
- if (inFunctionScope()) {
- if (D.Type == ValID::LocalName) {
- GenerateError("Reference to an undefined type: '" + D.getName() + "'");
- return 0;
- } else {
- GenerateError("Reference to an undefined type: #" + utostr(D.Num));
- return 0;
- }
- }
-
- std::map<ValID, PATypeHolder>::iterator I =CurModule.LateResolveTypes.find(D);
- if (I != CurModule.LateResolveTypes.end())
- return I->second;
-
- Type *Typ = OpaqueType::get();
- CurModule.LateResolveTypes.insert(std::make_pair(D, Typ));
- return Typ;
- }
-
-// getExistingVal - Look up the value specified by the provided type and
-// the provided ValID. If the value exists and has already been defined, return
-// it. Otherwise return null.
-//
-static Value *getExistingVal(const Type *Ty, const ValID &D) {
- if (isa<FunctionType>(Ty)) {
- GenerateError("Functions are not values and "
- "must be referenced as pointers");
- return 0;
- }
-
- switch (D.Type) {
- case ValID::LocalID: { // Is it a numbered definition?
- // Check that the number is within bounds.
- if (D.Num >= CurFun.Values.size())
- return 0;
- Value *Result = CurFun.Values[D.Num];
- if (Ty != Result->getType()) {
- GenerateError("Numbered value (%" + utostr(D.Num) + ") of type '" +
- Result->getType()->getDescription() + "' does not match "
- "expected type, '" + Ty->getDescription() + "'");
- return 0;
- }
- return Result;
- }
- case ValID::GlobalID: { // Is it a numbered definition?
- if (D.Num >= CurModule.Values.size())
- return 0;
- Value *Result = CurModule.Values[D.Num];
- if (Ty != Result->getType()) {
- GenerateError("Numbered value (@" + utostr(D.Num) + ") of type '" +
- Result->getType()->getDescription() + "' does not match "
- "expected type, '" + Ty->getDescription() + "'");
- return 0;
- }
- return Result;
- }
-
- case ValID::LocalName: { // Is it a named definition?
- if (!inFunctionScope())
- return 0;
- ValueSymbolTable &SymTab = CurFun.CurrentFunction->getValueSymbolTable();
- Value *N = SymTab.lookup(D.getName());
- if (N == 0)
- return 0;
- if (N->getType() != Ty)
- return 0;
-
- D.destroy(); // Free old strdup'd memory...
- return N;
- }
- case ValID::GlobalName: { // Is it a named definition?
- ValueSymbolTable &SymTab = CurModule.CurrentModule->getValueSymbolTable();
- Value *N = SymTab.lookup(D.getName());
- if (N == 0)
- return 0;
- if (N->getType() != Ty)
- return 0;
-
- D.destroy(); // Free old strdup'd memory...
- return N;
- }
-
- // Check to make sure that "Ty" is an integral type, and that our
- // value will fit into the specified type...
- case ValID::ConstSIntVal: // Is it a constant pool reference??
- if (!isa<IntegerType>(Ty) ||
- !ConstantInt::isValueValidForType(Ty, D.ConstPool64)) {
- GenerateError("Signed integral constant '" +
- itostr(D.ConstPool64) + "' is invalid for type '" +
- Ty->getDescription() + "'");
- return 0;
- }
- return ConstantInt::get(Ty, D.ConstPool64, true);
-
- case ValID::ConstUIntVal: // Is it an unsigned const pool reference?
- if (isa<IntegerType>(Ty) &&
- ConstantInt::isValueValidForType(Ty, D.UConstPool64))
- return ConstantInt::get(Ty, D.UConstPool64);
-
- if (!isa<IntegerType>(Ty) ||
- !ConstantInt::isValueValidForType(Ty, D.ConstPool64)) {
- GenerateError("Integral constant '" + utostr(D.UConstPool64) +
- "' is invalid or out of range for type '" +
- Ty->getDescription() + "'");
- return 0;
- }
- // This is really a signed reference. Transmogrify.
- return ConstantInt::get(Ty, D.ConstPool64, true);
-
- case ValID::ConstFPVal: // Is it a floating point const pool reference?
- if (!Ty->isFloatingPoint() ||
- !ConstantFP::isValueValidForType(Ty, *D.ConstPoolFP)) {
- GenerateError("FP constant invalid for type");
- return 0;
- }
- // Lexer has no type info, so builds all float and double FP constants
- // as double. Fix this here. Long double does not need this.
- if (&D.ConstPoolFP->getSemantics() == &APFloat::IEEEdouble &&
- Ty==Type::FloatTy)
- D.ConstPoolFP->convert(APFloat::IEEEsingle, APFloat::rmNearestTiesToEven);
- return ConstantFP::get(*D.ConstPoolFP);
-
- case ValID::ConstNullVal: // Is it a null value?
- if (!isa<PointerType>(Ty)) {
- GenerateError("Cannot create a a non pointer null");
- return 0;
- }
- return ConstantPointerNull::get(cast<PointerType>(Ty));
-
- case ValID::ConstUndefVal: // Is it an undef value?
- return UndefValue::get(Ty);
-
- case ValID::ConstZeroVal: // Is it a zero value?
- return Constant::getNullValue(Ty);
-
- case ValID::ConstantVal: // Fully resolved constant?
- if (D.ConstantValue->getType() != Ty) {
- GenerateError("Constant expression type different from required type");
- return 0;
- }
- return D.ConstantValue;
-
- case ValID::InlineAsmVal: { // Inline asm expression
- const PointerType *PTy = dyn_cast<PointerType>(Ty);
- const FunctionType *FTy =
- PTy ? dyn_cast<FunctionType>(PTy->getElementType()) : 0;
- if (!FTy || !InlineAsm::Verify(FTy, D.IAD->Constraints)) {
- GenerateError("Invalid type for asm constraint string");
- return 0;
- }
- InlineAsm *IA = InlineAsm::get(FTy, D.IAD->AsmString, D.IAD->Constraints,
- D.IAD->HasSideEffects);
- D.destroy(); // Free InlineAsmDescriptor.
- return IA;
- }
- default:
- assert(0 && "Unhandled case!");
- return 0;
- } // End of switch
-
- assert(0 && "Unhandled case!");
- return 0;
-}
-
-// getVal - This function is identical to getExistingVal, except that if a
-// value is not already defined, it "improvises" by creating a placeholder var
-// that looks and acts just like the requested variable. When the value is
-// defined later, all uses of the placeholder variable are replaced with the
-// real thing.
-//
-static Value *getVal(const Type *Ty, const ValID &ID) {
- if (Ty == Type::LabelTy) {
- GenerateError("Cannot use a basic block here");
- return 0;
- }
-
- // See if the value has already been defined.
- Value *V = getExistingVal(Ty, ID);
- if (V) return V;
- if (TriggerError) return 0;
-
- if (!Ty->isFirstClassType() && !isa<OpaqueType>(Ty)) {
- GenerateError("Invalid use of a composite type");
- return 0;
- }
-
- // If we reached here, we referenced either a symbol that we don't know about
- // or an id number that hasn't been read yet. We may be referencing something
- // forward, so just create an entry to be resolved later and get to it...
- //
- switch (ID.Type) {
- case ValID::GlobalName:
- case ValID::GlobalID: {
- const PointerType *PTy = dyn_cast<PointerType>(Ty);
- if (!PTy) {
- GenerateError("Invalid type for reference to global" );
- return 0;
- }
- const Type* ElTy = PTy->getElementType();
- if (const FunctionType *FTy = dyn_cast<FunctionType>(ElTy))
- V = Function::Create(FTy, GlobalValue::ExternalLinkage);
- else
- V = new GlobalVariable(ElTy, false, GlobalValue::ExternalLinkage, 0, "",
- (Module*)0, false, PTy->getAddressSpace());
- break;
- }
- default:
- V = new Argument(Ty);
- }
-
- // Remember where this forward reference came from. FIXME, shouldn't we try
- // to recycle these things??
- CurModule.PlaceHolderInfo.insert(std::make_pair(V, std::make_pair(ID,
- LLLgetLineNo())));
-
- if (inFunctionScope())
- InsertValue(V, CurFun.LateResolveValues);
- else
- InsertValue(V, CurModule.LateResolveValues);
- return V;
-}
-
-/// defineBBVal - This is a definition of a new basic block with the specified
-/// identifier which must be the same as CurFun.NextValNum, if its numeric.
-static BasicBlock *defineBBVal(const ValID &ID) {
- assert(inFunctionScope() && "Can't get basic block at global scope!");
-
- BasicBlock *BB = 0;
-
- // First, see if this was forward referenced
-
- std::map<ValID, BasicBlock*>::iterator BBI = CurFun.BBForwardRefs.find(ID);
- if (BBI != CurFun.BBForwardRefs.end()) {
- BB = BBI->second;
- // The forward declaration could have been inserted anywhere in the
- // function: insert it into the correct place now.
- CurFun.CurrentFunction->getBasicBlockList().remove(BB);
- CurFun.CurrentFunction->getBasicBlockList().push_back(BB);
-
- // We're about to erase the entry, save the key so we can clean it up.
- ValID Tmp = BBI->first;
-
- // Erase the forward ref from the map as its no longer "forward"
- CurFun.BBForwardRefs.erase(ID);
-
- // The key has been removed from the map but so we don't want to leave
- // strdup'd memory around so destroy it too.
- Tmp.destroy();
-
- // If its a numbered definition, bump the number and set the BB value.
- if (ID.Type == ValID::LocalID) {
- assert(ID.Num == CurFun.NextValNum && "Invalid new block number");
- InsertValue(BB);
- }
- } else {
- // We haven't seen this BB before and its first mention is a definition.
- // Just create it and return it.
- std::string Name (ID.Type == ValID::LocalName ? ID.getName() : "");
- BB = BasicBlock::Create(Name, CurFun.CurrentFunction);
- if (ID.Type == ValID::LocalID) {
- assert(ID.Num == CurFun.NextValNum && "Invalid new block number");
- InsertValue(BB);
- }
- }
-
- ID.destroy();
- return BB;
-}
-
-/// getBBVal - get an existing BB value or create a forward reference for it.
-///
-static BasicBlock *getBBVal(const ValID &ID) {
- assert(inFunctionScope() && "Can't get basic block at global scope!");
-
- BasicBlock *BB = 0;
-
- std::map<ValID, BasicBlock*>::iterator BBI = CurFun.BBForwardRefs.find(ID);
- if (BBI != CurFun.BBForwardRefs.end()) {
- BB = BBI->second;
- } if (ID.Type == ValID::LocalName) {
- std::string Name = ID.getName();
- Value *N = CurFun.CurrentFunction->getValueSymbolTable().lookup(Name);
- if (N) {
- if (N->getType()->getTypeID() == Type::LabelTyID)
- BB = cast<BasicBlock>(N);
- else
- GenerateError("Reference to label '" + Name + "' is actually of type '"+
- N->getType()->getDescription() + "'");
- }
- } else if (ID.Type == ValID::LocalID) {
- if (ID.Num < CurFun.NextValNum && ID.Num < CurFun.Values.size()) {
- if (CurFun.Values[ID.Num]->getType()->getTypeID() == Type::LabelTyID)
- BB = cast<BasicBlock>(CurFun.Values[ID.Num]);
- else
- GenerateError("Reference to label '%" + utostr(ID.Num) +
- "' is actually of type '"+
- CurFun.Values[ID.Num]->getType()->getDescription() + "'");
- }
- } else {
- GenerateError("Illegal label reference " + ID.getName());
- return 0;
- }
-
- // If its already been defined, return it now.
- if (BB) {
- ID.destroy(); // Free strdup'd memory.
- return BB;
- }
-
- // Otherwise, this block has not been seen before, create it.
- std::string Name;
- if (ID.Type == ValID::LocalName)
- Name = ID.getName();
- BB = BasicBlock::Create(Name, CurFun.CurrentFunction);
-
- // Insert it in the forward refs map.
- CurFun.BBForwardRefs[ID] = BB;
-
- return BB;
-}
-
-
-//===----------------------------------------------------------------------===//
-// Code to handle forward references in instructions
-//===----------------------------------------------------------------------===//
-//
-// This code handles the late binding needed with statements that reference
-// values not defined yet... for example, a forward branch, or the PHI node for
-// a loop body.
-//
-// This keeps a table (CurFun.LateResolveValues) of all such forward references
-// and back patchs after we are done.
-//
-
-// ResolveDefinitions - If we could not resolve some defs at parsing
-// time (forward branches, phi functions for loops, etc...) resolve the
-// defs now...
-//
-static void
-ResolveDefinitions(ValueList &LateResolvers, ValueList *FutureLateResolvers) {
- // Loop over LateResolveDefs fixing up stuff that couldn't be resolved
- while (!LateResolvers.empty()) {
- Value *V = LateResolvers.back();
- LateResolvers.pop_back();
-
- std::map<Value*, std::pair<ValID, int> >::iterator PHI =
- CurModule.PlaceHolderInfo.find(V);
- assert(PHI != CurModule.PlaceHolderInfo.end() && "Placeholder error!");
-
- ValID &DID = PHI->second.first;
-
- Value *TheRealValue = getExistingVal(V->getType(), DID);
- if (TriggerError)
- return;
- if (TheRealValue) {
- V->replaceAllUsesWith(TheRealValue);
- delete V;
- CurModule.PlaceHolderInfo.erase(PHI);
- } else if (FutureLateResolvers) {
- // Functions have their unresolved items forwarded to the module late
- // resolver table
- InsertValue(V, *FutureLateResolvers);
- } else {
- if (DID.Type == ValID::LocalName || DID.Type == ValID::GlobalName) {
- GenerateError("Reference to an invalid definition: '" +DID.getName()+
- "' of type '" + V->getType()->getDescription() + "'",
- PHI->second.second);
- return;
- } else {
- GenerateError("Reference to an invalid definition: #" +
- itostr(DID.Num) + " of type '" +
- V->getType()->getDescription() + "'",
- PHI->second.second);
- return;
- }
- }
- }
- LateResolvers.clear();
-}
-
-// ResolveTypeTo - A brand new type was just declared. This means that (if
-// name is not null) things referencing Name can be resolved. Otherwise, things
-// refering to the number can be resolved. Do this now.
-//
-static void ResolveTypeTo(std::string *Name, const Type *ToTy) {
- ValID D;
- if (Name)
- D = ValID::createLocalName(*Name);
- else
- D = ValID::createLocalID(CurModule.Types.size());
-
- std::map<ValID, PATypeHolder>::iterator I =
- CurModule.LateResolveTypes.find(D);
- if (I != CurModule.LateResolveTypes.end()) {
- ((DerivedType*)I->second.get())->refineAbstractTypeTo(ToTy);
- CurModule.LateResolveTypes.erase(I);
- }
-}
-
-// setValueName - Set the specified value to the name given. The name may be
-// null potentially, in which case this is a noop. The string passed in is
-// assumed to be a malloc'd string buffer, and is free'd by this function.
-//
-static void setValueName(Value *V, std::string *NameStr) {
- if (!NameStr) return;
- std::string Name(*NameStr); // Copy string
- delete NameStr; // Free old string
-
- if (V->getType() == Type::VoidTy) {
- GenerateError("Can't assign name '" + Name+"' to value with void type");
- return;
- }
-
- assert(inFunctionScope() && "Must be in function scope!");
- ValueSymbolTable &ST = CurFun.CurrentFunction->getValueSymbolTable();
- if (ST.lookup(Name)) {
- GenerateError("Redefinition of value '" + Name + "' of type '" +
- V->getType()->getDescription() + "'");
- return;
- }
-
- // Set the name.
- V->setName(Name);
-}
-
-/// ParseGlobalVariable - Handle parsing of a global. If Initializer is null,
-/// this is a declaration, otherwise it is a definition.
-static GlobalVariable *
-ParseGlobalVariable(std::string *NameStr,
- GlobalValue::LinkageTypes Linkage,
- GlobalValue::VisibilityTypes Visibility,
- bool isConstantGlobal, const Type *Ty,
- Constant *Initializer, bool IsThreadLocal,
- unsigned AddressSpace = 0) {
- if (isa<FunctionType>(Ty)) {
- GenerateError("Cannot declare global vars of function type");
- return 0;
- }
-
- const PointerType *PTy = PointerType::get(Ty, AddressSpace);
-
- std::string Name;
- if (NameStr) {
- Name = *NameStr; // Copy string
- delete NameStr; // Free old string
- }
-
- // See if this global value was forward referenced. If so, recycle the
- // object.
- ValID ID;
- if (!Name.empty()) {
- ID = ValID::createGlobalName(Name);
- } else {
- ID = ValID::createGlobalID(CurModule.Values.size());
- }
-
- if (GlobalValue *FWGV = CurModule.GetForwardRefForGlobal(PTy, ID)) {
- // Move the global to the end of the list, from whereever it was
- // previously inserted.
- GlobalVariable *GV = cast<GlobalVariable>(FWGV);
- CurModule.CurrentModule->getGlobalList().remove(GV);
- CurModule.CurrentModule->getGlobalList().push_back(GV);
- GV->setInitializer(Initializer);
- GV->setLinkage(Linkage);
- GV->setVisibility(Visibility);
- GV->setConstant(isConstantGlobal);
- GV->setThreadLocal(IsThreadLocal);
- InsertValue(GV, CurModule.Values);
- return GV;
- }
-
- // If this global has a name
- if (!Name.empty()) {
- // if the global we're parsing has an initializer (is a definition) and
- // has external linkage.
- if (Initializer && Linkage != GlobalValue::InternalLinkage)
- // If there is already a global with external linkage with this name
- if (CurModule.CurrentModule->getGlobalVariable(Name, false)) {
- // If we allow this GVar to get created, it will be renamed in the
- // symbol table because it conflicts with an existing GVar. We can't
- // allow redefinition of GVars whose linking indicates that their name
- // must stay the same. Issue the error.
- GenerateError("Redefinition of global variable named '" + Name +
- "' of type '" + Ty->getDescription() + "'");
- return 0;
- }
- }
-
- // Otherwise there is no existing GV to use, create one now.
- GlobalVariable *GV =
- new GlobalVariable(Ty, isConstantGlobal, Linkage, Initializer, Name,
- CurModule.CurrentModule, IsThreadLocal, AddressSpace);
- GV->setVisibility(Visibility);
- InsertValue(GV, CurModule.Values);
- return GV;
-}
-
-// setTypeName - Set the specified type to the name given. The name may be
-// null potentially, in which case this is a noop. The string passed in is
-// assumed to be a malloc'd string buffer, and is freed by this function.
-//
-// This function returns true if the type has already been defined, but is
-// allowed to be redefined in the specified context. If the name is a new name
-// for the type plane, it is inserted and false is returned.
-static bool setTypeName(const Type *T, std::string *NameStr) {
- assert(!inFunctionScope() && "Can't give types function-local names!");
- if (NameStr == 0) return false;
-
- std::string Name(*NameStr); // Copy string
- delete NameStr; // Free old string
-
- // We don't allow assigning names to void type
- if (T == Type::VoidTy) {
- GenerateError("Can't assign name '" + Name + "' to the void type");
- return false;
- }
-
- // Set the type name, checking for conflicts as we do so.
- bool AlreadyExists = CurModule.CurrentModule->addTypeName(Name, T);
-
- if (AlreadyExists) { // Inserting a name that is already defined???
- const Type *Existing = CurModule.CurrentModule->getTypeByName(Name);
- assert(Existing && "Conflict but no matching type?!");
-
- // There is only one case where this is allowed: when we are refining an
- // opaque type. In this case, Existing will be an opaque type.
- if (const OpaqueType *OpTy = dyn_cast<OpaqueType>(Existing)) {
- // We ARE replacing an opaque type!
- const_cast<OpaqueType*>(OpTy)->refineAbstractTypeTo(T);
- return true;
- }
-
- // Otherwise, this is an attempt to redefine a type. That's okay if
- // the redefinition is identical to the original. This will be so if
- // Existing and T point to the same Type object. In this one case we
- // allow the equivalent redefinition.
- if (Existing == T) return true; // Yes, it's equal.
-
- // Any other kind of (non-equivalent) redefinition is an error.
- GenerateError("Redefinition of type named '" + Name + "' of type '" +
- T->getDescription() + "'");
- }
-
- return false;
-}
-
-//===----------------------------------------------------------------------===//
-// Code for handling upreferences in type names...
-//
-
-// TypeContains - Returns true if Ty directly contains E in it.
-//
-static bool TypeContains(const Type *Ty, const Type *E) {
- return std::find(Ty->subtype_begin(), Ty->subtype_end(),
- E) != Ty->subtype_end();
-}
-
-namespace {
- struct UpRefRecord {
- // NestingLevel - The number of nesting levels that need to be popped before
- // this type is resolved.
- unsigned NestingLevel;
-
- // LastContainedTy - This is the type at the current binding level for the
- // type. Every time we reduce the nesting level, this gets updated.
- const Type *LastContainedTy;
-
- // UpRefTy - This is the actual opaque type that the upreference is
- // represented with.
- OpaqueType *UpRefTy;
-
- UpRefRecord(unsigned NL, OpaqueType *URTy)
- : NestingLevel(NL), LastContainedTy(URTy), UpRefTy(URTy) {}
- };
-}
-
-// UpRefs - A list of the outstanding upreferences that need to be resolved.
-static std::vector<UpRefRecord> UpRefs;
-
-/// HandleUpRefs - Every time we finish a new layer of types, this function is
-/// called. It loops through the UpRefs vector, which is a list of the
-/// currently active types. For each type, if the up reference is contained in
-/// the newly completed type, we decrement the level count. When the level
-/// count reaches zero, the upreferenced type is the type that is passed in:
-/// thus we can complete the cycle.
-///
-static PATypeHolder HandleUpRefs(const Type *ty) {
- // If Ty isn't abstract, or if there are no up-references in it, then there is
- // nothing to resolve here.
- if (!ty->isAbstract() || UpRefs.empty()) return ty;
-
- PATypeHolder Ty(ty);
- UR_OUT("Type '" << Ty->getDescription() <<
- "' newly formed. Resolving upreferences.\n" <<
- UpRefs.size() << " upreferences active!\n");
-
- // If we find any resolvable upreferences (i.e., those whose NestingLevel goes
- // to zero), we resolve them all together before we resolve them to Ty. At
- // the end of the loop, if there is anything to resolve to Ty, it will be in
- // this variable.
- OpaqueType *TypeToResolve = 0;
-
- for (unsigned i = 0; i != UpRefs.size(); ++i) {
- UR_OUT(" UR#" << i << " - TypeContains(" << Ty->getDescription() << ", "
- << UpRefs[i].second->getDescription() << ") = "
- << (TypeContains(Ty, UpRefs[i].second) ? "true" : "false") << "\n");
- if (TypeContains(Ty, UpRefs[i].LastContainedTy)) {
- // Decrement level of upreference
- unsigned Level = --UpRefs[i].NestingLevel;
- UpRefs[i].LastContainedTy = Ty;
- UR_OUT(" Uplevel Ref Level = " << Level << "\n");
- if (Level == 0) { // Upreference should be resolved!
- if (!TypeToResolve) {
- TypeToResolve = UpRefs[i].UpRefTy;
- } else {
- UR_OUT(" * Resolving upreference for "
- << UpRefs[i].second->getDescription() << "\n";
- std::string OldName = UpRefs[i].UpRefTy->getDescription());
- UpRefs[i].UpRefTy->refineAbstractTypeTo(TypeToResolve);
- UR_OUT(" * Type '" << OldName << "' refined upreference to: "
- << (const void*)Ty << ", " << Ty->getDescription() << "\n");
- }
- UpRefs.erase(UpRefs.begin()+i); // Remove from upreference list...
- --i; // Do not skip the next element...
- }
- }
- }
-
- if (TypeToResolve) {
- UR_OUT(" * Resolving upreference for "
- << UpRefs[i].second->getDescription() << "\n";
- std::string OldName = TypeToResolve->getDescription());
- TypeToResolve->refineAbstractTypeTo(Ty);
- }
-
- return Ty;
-}
-
-//===----------------------------------------------------------------------===//
-// RunVMAsmParser - Define an interface to this parser
-//===----------------------------------------------------------------------===//
-//
-static Module* RunParser(Module * M);
-
-Module *llvm::RunVMAsmParser(llvm::MemoryBuffer *MB) {
- InitLLLexer(MB);
- Module *M = RunParser(new Module(LLLgetFilename()));
- FreeLexer();
- return M;
-}
-
-%}
-
-%union {
- llvm::Module *ModuleVal;
- llvm::Function *FunctionVal;
- llvm::BasicBlock *BasicBlockVal;
- llvm::TerminatorInst *TermInstVal;
- llvm::Instruction *InstVal;
- llvm::Constant *ConstVal;
-
- const llvm::Type *PrimType;
- std::list<llvm::PATypeHolder> *TypeList;
- llvm::PATypeHolder *TypeVal;
- llvm::Value *ValueVal;
- std::vector<llvm::Value*> *ValueList;
- llvm::ArgListType *ArgList;
- llvm::TypeWithAttrs TypeWithAttrs;
- llvm::TypeWithAttrsList *TypeWithAttrsList;
- llvm::ParamList *ParamList;
-
- // Represent the RHS of PHI node
- std::list<std::pair<llvm::Value*,
- llvm::BasicBlock*> > *PHIList;
- std::vector<std::pair<llvm::Constant*, llvm::BasicBlock*> > *JumpTable;
- std::vector<llvm::Constant*> *ConstVector;
-
- llvm::GlobalValue::LinkageTypes Linkage;
- llvm::GlobalValue::VisibilityTypes Visibility;
- llvm::ParameterAttributes ParamAttrs;
- llvm::APInt *APIntVal;
- int64_t SInt64Val;
- uint64_t UInt64Val;
- int SIntVal;
- unsigned UIntVal;
- llvm::APFloat *FPVal;
- bool BoolVal;
-
- std::string *StrVal; // This memory must be deleted
- llvm::ValID ValIDVal;
-
- llvm::Instruction::BinaryOps BinaryOpVal;
- llvm::Instruction::TermOps TermOpVal;
- llvm::Instruction::MemoryOps MemOpVal;
- llvm::Instruction::CastOps CastOpVal;
- llvm::Instruction::OtherOps OtherOpVal;
- llvm::ICmpInst::Predicate IPredicate;
- llvm::FCmpInst::Predicate FPredicate;
-}
-
-%type <ModuleVal> Module
-%type <FunctionVal> Function FunctionProto FunctionHeader BasicBlockList
-%type <BasicBlockVal> BasicBlock InstructionList
-%type <TermInstVal> BBTerminatorInst
-%type <InstVal> Inst InstVal MemoryInst
-%type <ConstVal> ConstVal ConstExpr AliaseeRef
-%type <ConstVector> ConstVector
-%type <ArgList> ArgList ArgListH
-%type <PHIList> PHIList
-%type <ParamList> ParamList // For call param lists & GEP indices
-%type <ValueList> IndexList // For GEP indices
-%type <TypeList> TypeListI
-%type <TypeWithAttrsList> ArgTypeList ArgTypeListI
-%type <TypeWithAttrs> ArgType
-%type <JumpTable> JumpTable
-%type <BoolVal> GlobalType // GLOBAL or CONSTANT?
-%type <BoolVal> ThreadLocal // 'thread_local' or not
-%type <BoolVal> OptVolatile // 'volatile' or not
-%type <BoolVal> OptTailCall // TAIL CALL or plain CALL.
-%type <BoolVal> OptSideEffect // 'sideeffect' or not.
-%type <Linkage> GVInternalLinkage GVExternalLinkage
-%type <Linkage> FunctionDefineLinkage FunctionDeclareLinkage
-%type <Linkage> AliasLinkage
-%type <Visibility> GVVisibilityStyle
-
-// ValueRef - Unresolved reference to a definition or BB
-%type <ValIDVal> ValueRef ConstValueRef SymbolicValueRef
-%type <ValueVal> ResolvedVal // <type> <valref> pair
-%type <ValueList> ReturnedVal
-// Tokens and types for handling constant integer values
-//
-// ESINT64VAL - A negative number within long long range
-%token <SInt64Val> ESINT64VAL
-
-// EUINT64VAL - A positive number within uns. long long range
-%token <UInt64Val> EUINT64VAL
-
-// ESAPINTVAL - A negative number with arbitrary precision
-%token <APIntVal> ESAPINTVAL
-
-// EUAPINTVAL - A positive number with arbitrary precision
-%token <APIntVal> EUAPINTVAL
-
-%token <UIntVal> LOCALVAL_ID GLOBALVAL_ID // %123 @123
-%token <FPVal> FPVAL // Float or Double constant
-
-// Built in types...
-%type <TypeVal> Types ResultTypes
-%type <PrimType> IntType FPType PrimType // Classifications
-%token <PrimType> VOID INTTYPE
-%token <PrimType> FLOAT DOUBLE X86_FP80 FP128 PPC_FP128 LABEL
-%token TYPE
-
-
-%token<StrVal> LOCALVAR GLOBALVAR LABELSTR
-%token<StrVal> STRINGCONSTANT ATSTRINGCONSTANT PCTSTRINGCONSTANT
-%type <StrVal> LocalName OptLocalName OptLocalAssign
-%type <StrVal> GlobalName OptGlobalAssign GlobalAssign
-%type <StrVal> OptSection SectionString OptGC
-
-%type <UIntVal> OptAlign OptCAlign OptAddrSpace
-
-%token ZEROINITIALIZER TRUETOK FALSETOK BEGINTOK ENDTOK
-%token DECLARE DEFINE GLOBAL CONSTANT SECTION ALIAS VOLATILE THREAD_LOCAL
-%token TO DOTDOTDOT NULL_TOK UNDEF INTERNAL LINKONCE WEAK APPENDING
-%token DLLIMPORT DLLEXPORT EXTERN_WEAK
-%token OPAQUE EXTERNAL TARGET TRIPLE ALIGN ADDRSPACE
-%token DEPLIBS CALL TAIL ASM_TOK MODULE SIDEEFFECT
-%token CC_TOK CCC_TOK FASTCC_TOK COLDCC_TOK X86_STDCALLCC_TOK X86_FASTCALLCC_TOK
-%token DATALAYOUT
-%type <UIntVal> OptCallingConv
-%type <ParamAttrs> OptParamAttrs ParamAttr
-%type <ParamAttrs> OptFuncAttrs FuncAttr
-
-// Basic Block Terminating Operators
-%token <TermOpVal> RET BR SWITCH INVOKE UNWIND UNREACHABLE
-
-// Binary Operators
-%type <BinaryOpVal> ArithmeticOps LogicalOps // Binops Subcatagories
-%token <BinaryOpVal> ADD SUB MUL UDIV SDIV FDIV UREM SREM FREM AND OR XOR
-%token <BinaryOpVal> SHL LSHR ASHR
-
-%token <OtherOpVal> ICMP FCMP
-%type <IPredicate> IPredicates
-%type <FPredicate> FPredicates
-%token EQ NE SLT SGT SLE SGE ULT UGT ULE UGE
-%token OEQ ONE OLT OGT OLE OGE ORD UNO UEQ UNE
-
-// Memory Instructions
-%token <MemOpVal> MALLOC ALLOCA FREE LOAD STORE GETELEMENTPTR
-
-// Cast Operators
-%type <CastOpVal> CastOps
-%token <CastOpVal> TRUNC ZEXT SEXT FPTRUNC FPEXT BITCAST
-%token <CastOpVal> UITOFP SITOFP FPTOUI FPTOSI INTTOPTR PTRTOINT
-
-// Other Operators
-%token <OtherOpVal> PHI_TOK SELECT VAARG
-%token <OtherOpVal> EXTRACTELEMENT INSERTELEMENT SHUFFLEVECTOR
-%token <OtherOpVal> GETRESULT
-
-// Function Attributes
-%token SIGNEXT ZEROEXT NORETURN INREG SRET NOUNWIND NOALIAS BYVAL NEST
-%token READNONE READONLY GC
-
-// Visibility Styles
-%token DEFAULT HIDDEN PROTECTED
-
-%start Module
-%%
-
-
-// Operations that are notably excluded from this list include:
-// RET, BR, & SWITCH because they end basic blocks and are treated specially.
-//
-ArithmeticOps: ADD | SUB | MUL | UDIV | SDIV | FDIV | UREM | SREM | FREM;
-LogicalOps : SHL | LSHR | ASHR | AND | OR | XOR;
-CastOps : TRUNC | ZEXT | SEXT | FPTRUNC | FPEXT | BITCAST |
- UITOFP | SITOFP | FPTOUI | FPTOSI | INTTOPTR | PTRTOINT;
-
-IPredicates
- : EQ { $$ = ICmpInst::ICMP_EQ; } | NE { $$ = ICmpInst::ICMP_NE; }
- | SLT { $$ = ICmpInst::ICMP_SLT; } | SGT { $$ = ICmpInst::ICMP_SGT; }
- | SLE { $$ = ICmpInst::ICMP_SLE; } | SGE { $$ = ICmpInst::ICMP_SGE; }
- | ULT { $$ = ICmpInst::ICMP_ULT; } | UGT { $$ = ICmpInst::ICMP_UGT; }
- | ULE { $$ = ICmpInst::ICMP_ULE; } | UGE { $$ = ICmpInst::ICMP_UGE; }
- ;
-
-FPredicates
- : OEQ { $$ = FCmpInst::FCMP_OEQ; } | ONE { $$ = FCmpInst::FCMP_ONE; }
- | OLT { $$ = FCmpInst::FCMP_OLT; } | OGT { $$ = FCmpInst::FCMP_OGT; }
- | OLE { $$ = FCmpInst::FCMP_OLE; } | OGE { $$ = FCmpInst::FCMP_OGE; }
- | ORD { $$ = FCmpInst::FCMP_ORD; } | UNO { $$ = FCmpInst::FCMP_UNO; }
- | UEQ { $$ = FCmpInst::FCMP_UEQ; } | UNE { $$ = FCmpInst::FCMP_UNE; }
- | ULT { $$ = FCmpInst::FCMP_ULT; } | UGT { $$ = FCmpInst::FCMP_UGT; }
- | ULE { $$ = FCmpInst::FCMP_ULE; } | UGE { $$ = FCmpInst::FCMP_UGE; }
- | TRUETOK { $$ = FCmpInst::FCMP_TRUE; }
- | FALSETOK { $$ = FCmpInst::FCMP_FALSE; }
- ;
-
-// These are some types that allow classification if we only want a particular
-// thing... for example, only a signed, unsigned, or integral type.
-IntType : INTTYPE;
-FPType : FLOAT | DOUBLE | PPC_FP128 | FP128 | X86_FP80;
-
-LocalName : LOCALVAR | STRINGCONSTANT | PCTSTRINGCONSTANT ;
-OptLocalName : LocalName | /*empty*/ { $$ = 0; };
-
-OptAddrSpace : ADDRSPACE '(' EUINT64VAL ')' { $$=$3; }
- | /*empty*/ { $$=0; };
-
-/// OptLocalAssign - Value producing statements have an optional assignment
-/// component.
-OptLocalAssign : LocalName '=' {
- $$ = $1;
- CHECK_FOR_ERROR
- }
- | /*empty*/ {
- $$ = 0;
- CHECK_FOR_ERROR
- };
-
-GlobalName : GLOBALVAR | ATSTRINGCONSTANT ;
-
-OptGlobalAssign : GlobalAssign
- | /*empty*/ {
- $$ = 0;
- CHECK_FOR_ERROR
- };
-
-GlobalAssign : GlobalName '=' {
- $$ = $1;
- CHECK_FOR_ERROR
- };
-
-GVInternalLinkage
- : INTERNAL { $$ = GlobalValue::InternalLinkage; }
- | WEAK { $$ = GlobalValue::WeakLinkage; }
- | LINKONCE { $$ = GlobalValue::LinkOnceLinkage; }
- | APPENDING { $$ = GlobalValue::AppendingLinkage; }
- | DLLEXPORT { $$ = GlobalValue::DLLExportLinkage; }
- ;
-
-GVExternalLinkage
- : DLLIMPORT { $$ = GlobalValue::DLLImportLinkage; }
- | EXTERN_WEAK { $$ = GlobalValue::ExternalWeakLinkage; }
- | EXTERNAL { $$ = GlobalValue::ExternalLinkage; }
- ;
-
-GVVisibilityStyle
- : /*empty*/ { $$ = GlobalValue::DefaultVisibility; }
- | DEFAULT { $$ = GlobalValue::DefaultVisibility; }
- | HIDDEN { $$ = GlobalValue::HiddenVisibility; }
- | PROTECTED { $$ = GlobalValue::ProtectedVisibility; }
- ;
-
-FunctionDeclareLinkage
- : /*empty*/ { $$ = GlobalValue::ExternalLinkage; }
- | DLLIMPORT { $$ = GlobalValue::DLLImportLinkage; }
- | EXTERN_WEAK { $$ = GlobalValue::ExternalWeakLinkage; }
- ;
-
-FunctionDefineLinkage
- : /*empty*/ { $$ = GlobalValue::ExternalLinkage; }
- | INTERNAL { $$ = GlobalValue::InternalLinkage; }
- | LINKONCE { $$ = GlobalValue::LinkOnceLinkage; }
- | WEAK { $$ = GlobalValue::WeakLinkage; }
- | DLLEXPORT { $$ = GlobalValue::DLLExportLinkage; }
- ;
-
-AliasLinkage
- : /*empty*/ { $$ = GlobalValue::ExternalLinkage; }
- | WEAK { $$ = GlobalValue::WeakLinkage; }
- | INTERNAL { $$ = GlobalValue::InternalLinkage; }
- ;
-
-OptCallingConv : /*empty*/ { $$ = CallingConv::C; } |
- CCC_TOK { $$ = CallingConv::C; } |
- FASTCC_TOK { $$ = CallingConv::Fast; } |
- COLDCC_TOK { $$ = CallingConv::Cold; } |
- X86_STDCALLCC_TOK { $$ = CallingConv::X86_StdCall; } |
- X86_FASTCALLCC_TOK { $$ = CallingConv::X86_FastCall; } |
- CC_TOK EUINT64VAL {
- if ((unsigned)$2 != $2)
- GEN_ERROR("Calling conv too large");
- $$ = $2;
- CHECK_FOR_ERROR
- };
-
-ParamAttr : ZEROEXT { $$ = ParamAttr::ZExt; }
- | ZEXT { $$ = ParamAttr::ZExt; }
- | SIGNEXT { $$ = ParamAttr::SExt; }
- | SEXT { $$ = ParamAttr::SExt; }
- | INREG { $$ = ParamAttr::InReg; }
- | SRET { $$ = ParamAttr::StructRet; }
- | NOALIAS { $$ = ParamAttr::NoAlias; }
- | BYVAL { $$ = ParamAttr::ByVal; }
- | NEST { $$ = ParamAttr::Nest; }
- | ALIGN EUINT64VAL { $$ =
- ParamAttr::constructAlignmentFromInt($2); }
- ;
-
-OptParamAttrs : /* empty */ { $$ = ParamAttr::None; }
- | OptParamAttrs ParamAttr {
- $$ = $1 | $2;
- }
- ;
-
-FuncAttr : NORETURN { $$ = ParamAttr::NoReturn; }
- | NOUNWIND { $$ = ParamAttr::NoUnwind; }
- | ZEROEXT { $$ = ParamAttr::ZExt; }
- | SIGNEXT { $$ = ParamAttr::SExt; }
- | READNONE { $$ = ParamAttr::ReadNone; }
- | READONLY { $$ = ParamAttr::ReadOnly; }
- ;
-
-OptFuncAttrs : /* empty */ { $$ = ParamAttr::None; }
- | OptFuncAttrs FuncAttr {
- $$ = $1 | $2;
- }
- ;
-
-OptGC : /* empty */ { $$ = 0; }
- | GC STRINGCONSTANT {
- $$ = $2;
- }
- ;
-
-// OptAlign/OptCAlign - An optional alignment, and an optional alignment with
-// a comma before it.
-OptAlign : /*empty*/ { $$ = 0; } |
- ALIGN EUINT64VAL {
- $$ = $2;
- if ($$ != 0 && !isPowerOf2_32($$))
- GEN_ERROR("Alignment must be a power of two");
- CHECK_FOR_ERROR
-};
-OptCAlign : /*empty*/ { $$ = 0; } |
- ',' ALIGN EUINT64VAL {
- $$ = $3;
- if ($$ != 0 && !isPowerOf2_32($$))
- GEN_ERROR("Alignment must be a power of two");
- CHECK_FOR_ERROR
-};
-
-
-
-SectionString : SECTION STRINGCONSTANT {
- for (unsigned i = 0, e = $2->length(); i != e; ++i)
- if ((*$2)[i] == '"' || (*$2)[i] == '\\')
- GEN_ERROR("Invalid character in section name");
- $$ = $2;
- CHECK_FOR_ERROR
-};
-
-OptSection : /*empty*/ { $$ = 0; } |
- SectionString { $$ = $1; };
-
-// GlobalVarAttributes - Used to pass the attributes string on a global. CurGV
-// is set to be the global we are processing.
-//
-GlobalVarAttributes : /* empty */ {} |
- ',' GlobalVarAttribute GlobalVarAttributes {};
-GlobalVarAttribute : SectionString {
- CurGV->setSection(*$1);
- delete $1;
- CHECK_FOR_ERROR
- }
- | ALIGN EUINT64VAL {
- if ($2 != 0 && !isPowerOf2_32($2))
- GEN_ERROR("Alignment must be a power of two");
- CurGV->setAlignment($2);
- CHECK_FOR_ERROR
- };
-
-//===----------------------------------------------------------------------===//
-// Types includes all predefined types... except void, because it can only be
-// used in specific contexts (function returning void for example).
-
-// Derived types are added later...
-//
-PrimType : INTTYPE | FLOAT | DOUBLE | PPC_FP128 | FP128 | X86_FP80 | LABEL ;
-
-Types
- : OPAQUE {
- $$ = new PATypeHolder(OpaqueType::get());
- CHECK_FOR_ERROR
- }
- | PrimType {
- $$ = new PATypeHolder($1);
- CHECK_FOR_ERROR
- }
- | Types OptAddrSpace '*' { // Pointer type?
- if (*$1 == Type::LabelTy)
- GEN_ERROR("Cannot form a pointer to a basic block");
- $$ = new PATypeHolder(HandleUpRefs(PointerType::get(*$1, $2)));
- delete $1;
- CHECK_FOR_ERROR
- }
- | SymbolicValueRef { // Named types are also simple types...
- const Type* tmp = getTypeVal($1);
- CHECK_FOR_ERROR
- $$ = new PATypeHolder(tmp);
- }
- | '\\' EUINT64VAL { // Type UpReference
- if ($2 > (uint64_t)~0U) GEN_ERROR("Value out of range");
- OpaqueType *OT = OpaqueType::get(); // Use temporary placeholder
- UpRefs.push_back(UpRefRecord((unsigned)$2, OT)); // Add to vector...
- $$ = new PATypeHolder(OT);
- UR_OUT("New Upreference!\n");
- CHECK_FOR_ERROR
- }
- | Types '(' ArgTypeListI ')' OptFuncAttrs {
- // Allow but ignore attributes on function types; this permits auto-upgrade.
- // FIXME: remove in LLVM 3.0.
- const Type *RetTy = *$1;
- if (!FunctionType::isValidReturnType(RetTy))
- GEN_ERROR("Invalid result type for LLVM function");
-
- std::vector<const Type*> Params;
- TypeWithAttrsList::iterator I = $3->begin(), E = $3->end();
- for (; I != E; ++I ) {
- const Type *Ty = I->Ty->get();
- Params.push_back(Ty);
- }
-
- bool isVarArg = Params.size() && Params.back() == Type::VoidTy;
- if (isVarArg) Params.pop_back();
-
- for (unsigned i = 0; i != Params.size(); ++i)
- if (!(Params[i]->isFirstClassType() || isa<OpaqueType>(Params[i])))
- GEN_ERROR("Function arguments must be value types!");
-
- CHECK_FOR_ERROR
-
- FunctionType *FT = FunctionType::get(RetTy, Params, isVarArg);
- delete $3; // Delete the argument list
- delete $1; // Delete the return type handle
- $$ = new PATypeHolder(HandleUpRefs(FT));
- CHECK_FOR_ERROR
- }
- | VOID '(' ArgTypeListI ')' OptFuncAttrs {
- // Allow but ignore attributes on function types; this permits auto-upgrade.
- // FIXME: remove in LLVM 3.0.
- std::vector<const Type*> Params;
- TypeWithAttrsList::iterator I = $3->begin(), E = $3->end();
- for ( ; I != E; ++I ) {
- const Type* Ty = I->Ty->get();
- Params.push_back(Ty);
- }
-
- bool isVarArg = Params.size() && Params.back() == Type::VoidTy;
- if (isVarArg) Params.pop_back();
-
- for (unsigned i = 0; i != Params.size(); ++i)
- if (!(Params[i]->isFirstClassType() || isa<OpaqueType>(Params[i])))
- GEN_ERROR("Function arguments must be value types!");
-
- CHECK_FOR_ERROR
-
- FunctionType *FT = FunctionType::get($1, Params, isVarArg);
- delete $3; // Delete the argument list
- $$ = new PATypeHolder(HandleUpRefs(FT));
- CHECK_FOR_ERROR
- }
-
- | '[' EUINT64VAL 'x' Types ']' { // Sized array type?
- $$ = new PATypeHolder(HandleUpRefs(ArrayType::get(*$4, (unsigned)$2)));
- delete $4;
- CHECK_FOR_ERROR
- }
- | '<' EUINT64VAL 'x' Types '>' { // Vector type?
- const llvm::Type* ElemTy = $4->get();
- if ((unsigned)$2 != $2)
- GEN_ERROR("Unsigned result not equal to signed result");
- if (!ElemTy->isFloatingPoint() && !ElemTy->isInteger())
- GEN_ERROR("Element type of a VectorType must be primitive");
- $$ = new PATypeHolder(HandleUpRefs(VectorType::get(*$4, (unsigned)$2)));
- delete $4;
- CHECK_FOR_ERROR
- }
- | '{' TypeListI '}' { // Structure type?
- std::vector<const Type*> Elements;
- for (std::list<llvm::PATypeHolder>::iterator I = $2->begin(),
- E = $2->end(); I != E; ++I)
- Elements.push_back(*I);
-
- $$ = new PATypeHolder(HandleUpRefs(StructType::get(Elements)));
- delete $2;
- CHECK_FOR_ERROR
- }
- | '{' '}' { // Empty structure type?
- $$ = new PATypeHolder(StructType::get(std::vector<const Type*>()));
- CHECK_FOR_ERROR
- }
- | '<' '{' TypeListI '}' '>' {
- std::vector<const Type*> Elements;
- for (std::list<llvm::PATypeHolder>::iterator I = $3->begin(),
- E = $3->end(); I != E; ++I)
- Elements.push_back(*I);
-
- $$ = new PATypeHolder(HandleUpRefs(StructType::get(Elements, true)));
- delete $3;
- CHECK_FOR_ERROR
- }
- | '<' '{' '}' '>' { // Empty structure type?
- $$ = new PATypeHolder(StructType::get(std::vector<const Type*>(), true));
- CHECK_FOR_ERROR
- }
- ;
-
-ArgType
- : Types OptParamAttrs {
- // Allow but ignore attributes on function types; this permits auto-upgrade.
- // FIXME: remove in LLVM 3.0.
- $$.Ty = $1;
- $$.Attrs = ParamAttr::None;
- }
- ;
-
-ResultTypes
- : Types {
- if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*$1)->getDescription());
- if (!(*$1)->isFirstClassType() && !isa<StructType>($1->get()))
- GEN_ERROR("LLVM functions cannot return aggregate types");
- $$ = $1;
- }
- | VOID {
- $$ = new PATypeHolder(Type::VoidTy);
- }
- ;
-
-ArgTypeList : ArgType {
- $$ = new TypeWithAttrsList();
- $$->push_back($1);
- CHECK_FOR_ERROR
- }
- | ArgTypeList ',' ArgType {
- ($$=$1)->push_back($3);
- CHECK_FOR_ERROR
- }
- ;
-
-ArgTypeListI
- : ArgTypeList
- | ArgTypeList ',' DOTDOTDOT {
- $$=$1;
- TypeWithAttrs TWA; TWA.Attrs = ParamAttr::None;
- TWA.Ty = new PATypeHolder(Type::VoidTy);
- $$->push_back(TWA);
- CHECK_FOR_ERROR
- }
- | DOTDOTDOT {
- $$ = new TypeWithAttrsList;
- TypeWithAttrs TWA; TWA.Attrs = ParamAttr::None;
- TWA.Ty = new PATypeHolder(Type::VoidTy);
- $$->push_back(TWA);
- CHECK_FOR_ERROR
- }
- | /*empty*/ {
- $$ = new TypeWithAttrsList();
- CHECK_FOR_ERROR
- };
-
-// TypeList - Used for struct declarations and as a basis for function type
-// declaration type lists
-//
-TypeListI : Types {
- $$ = new std::list<PATypeHolder>();
- $$->push_back(*$1);
- delete $1;
- CHECK_FOR_ERROR
- }
- | TypeListI ',' Types {
- ($$=$1)->push_back(*$3);
- delete $3;
- CHECK_FOR_ERROR
- };
-
-// ConstVal - The various declarations that go into the constant pool. This
-// production is used ONLY to represent constants that show up AFTER a 'const',
-// 'constant' or 'global' token at global scope. Constants that can be inlined
-// into other expressions (such as integers and constexprs) are handled by the
-// ResolvedVal, ValueRef and ConstValueRef productions.
-//
-ConstVal: Types '[' ConstVector ']' { // Nonempty unsized arr
- if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*$1)->getDescription());
- const ArrayType *ATy = dyn_cast<ArrayType>($1->get());
- if (ATy == 0)
- GEN_ERROR("Cannot make array constant with type: '" +
- (*$1)->getDescription() + "'");
- const Type *ETy = ATy->getElementType();
- int NumElements = ATy->getNumElements();
-
- // Verify that we have the correct size...
- if (NumElements != -1 && NumElements != (int)$3->size())
- GEN_ERROR("Type mismatch: constant sized array initialized with " +
- utostr($3->size()) + " arguments, but has size of " +
- itostr(NumElements) + "");
-
- // Verify all elements are correct type!
- for (unsigned i = 0; i < $3->size(); i++) {
- if (ETy != (*$3)[i]->getType())
- GEN_ERROR("Element #" + utostr(i) + " is not of type '" +
- ETy->getDescription() +"' as required!\nIt is of type '"+
- (*$3)[i]->getType()->getDescription() + "'.");
- }
-
- $$ = ConstantArray::get(ATy, *$3);
- delete $1; delete $3;
- CHECK_FOR_ERROR
- }
- | Types '[' ']' {
- if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*$1)->getDescription());
- const ArrayType *ATy = dyn_cast<ArrayType>($1->get());
- if (ATy == 0)
- GEN_ERROR("Cannot make array constant with type: '" +
- (*$1)->getDescription() + "'");
-
- int NumElements = ATy->getNumElements();
- if (NumElements != -1 && NumElements != 0)
- GEN_ERROR("Type mismatch: constant sized array initialized with 0"
- " arguments, but has size of " + itostr(NumElements) +"");
- $$ = ConstantArray::get(ATy, std::vector<Constant*>());
- delete $1;
- CHECK_FOR_ERROR
- }
- | Types 'c' STRINGCONSTANT {
- if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*$1)->getDescription());
- const ArrayType *ATy = dyn_cast<ArrayType>($1->get());
- if (ATy == 0)
- GEN_ERROR("Cannot make array constant with type: '" +
- (*$1)->getDescription() + "'");
-
- int NumElements = ATy->getNumElements();
- const Type *ETy = ATy->getElementType();
- if (NumElements != -1 && NumElements != int($3->length()))
- GEN_ERROR("Can't build string constant of size " +
- itostr((int)($3->length())) +
- " when array has size " + itostr(NumElements) + "");
- std::vector<Constant*> Vals;
- if (ETy == Type::Int8Ty) {
- for (unsigned i = 0; i < $3->length(); ++i)
- Vals.push_back(ConstantInt::get(ETy, (*$3)[i]));
- } else {
- delete $3;
- GEN_ERROR("Cannot build string arrays of non byte sized elements");
- }
- delete $3;
- $$ = ConstantArray::get(ATy, Vals);
- delete $1;
- CHECK_FOR_ERROR
- }
- | Types '<' ConstVector '>' { // Nonempty unsized arr
- if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*$1)->getDescription());
- const VectorType *PTy = dyn_cast<VectorType>($1->get());
- if (PTy == 0)
- GEN_ERROR("Cannot make packed constant with type: '" +
- (*$1)->getDescription() + "'");
- const Type *ETy = PTy->getElementType();
- int NumElements = PTy->getNumElements();
-
- // Verify that we have the correct size...
- if (NumElements != -1 && NumElements != (int)$3->size())
- GEN_ERROR("Type mismatch: constant sized packed initialized with " +
- utostr($3->size()) + " arguments, but has size of " +
- itostr(NumElements) + "");
-
- // Verify all elements are correct type!
- for (unsigned i = 0; i < $3->size(); i++) {
- if (ETy != (*$3)[i]->getType())
- GEN_ERROR("Element #" + utostr(i) + " is not of type '" +
- ETy->getDescription() +"' as required!\nIt is of type '"+
- (*$3)[i]->getType()->getDescription() + "'.");
- }
-
- $$ = ConstantVector::get(PTy, *$3);
- delete $1; delete $3;
- CHECK_FOR_ERROR
- }
- | Types '{' ConstVector '}' {
- const StructType *STy = dyn_cast<StructType>($1->get());
- if (STy == 0)
- GEN_ERROR("Cannot make struct constant with type: '" +
- (*$1)->getDescription() + "'");
-
- if ($3->size() != STy->getNumContainedTypes())
- GEN_ERROR("Illegal number of initializers for structure type");
-
- // Check to ensure that constants are compatible with the type initializer!
- for (unsigned i = 0, e = $3->size(); i != e; ++i)
- if ((*$3)[i]->getType() != STy->getElementType(i))
- GEN_ERROR("Expected type '" +
- STy->getElementType(i)->getDescription() +
- "' for element #" + utostr(i) +
- " of structure initializer");
-
- // Check to ensure that Type is not packed
- if (STy->isPacked())
- GEN_ERROR("Unpacked Initializer to vector type '" +
- STy->getDescription() + "'");
-
- $$ = ConstantStruct::get(STy, *$3);
- delete $1; delete $3;
- CHECK_FOR_ERROR
- }
- | Types '{' '}' {
- if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*$1)->getDescription());
- const StructType *STy = dyn_cast<StructType>($1->get());
- if (STy == 0)
- GEN_ERROR("Cannot make struct constant with type: '" +
- (*$1)->getDescription() + "'");
-
- if (STy->getNumContainedTypes() != 0)
- GEN_ERROR("Illegal number of initializers for structure type");
-
- // Check to ensure that Type is not packed
- if (STy->isPacked())
- GEN_ERROR("Unpacked Initializer to vector type '" +
- STy->getDescription() + "'");
-
- $$ = ConstantStruct::get(STy, std::vector<Constant*>());
- delete $1;
- CHECK_FOR_ERROR
- }
- | Types '<' '{' ConstVector '}' '>' {
- const StructType *STy = dyn_cast<StructType>($1->get());
- if (STy == 0)
- GEN_ERROR("Cannot make struct constant with type: '" +
- (*$1)->getDescription() + "'");
-
- if ($4->size() != STy->getNumContainedTypes())
- GEN_ERROR("Illegal number of initializers for structure type");
-
- // Check to ensure that constants are compatible with the type initializer!
- for (unsigned i = 0, e = $4->size(); i != e; ++i)
- if ((*$4)[i]->getType() != STy->getElementType(i))
- GEN_ERROR("Expected type '" +
- STy->getElementType(i)->getDescription() +
- "' for element #" + utostr(i) +
- " of structure initializer");
-
- // Check to ensure that Type is packed
- if (!STy->isPacked())
- GEN_ERROR("Vector initializer to non-vector type '" +
- STy->getDescription() + "'");
-
- $$ = ConstantStruct::get(STy, *$4);
- delete $1; delete $4;
- CHECK_FOR_ERROR
- }
- | Types '<' '{' '}' '>' {
- if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*$1)->getDescription());
- const StructType *STy = dyn_cast<StructType>($1->get());
- if (STy == 0)
- GEN_ERROR("Cannot make struct constant with type: '" +
- (*$1)->getDescription() + "'");
-
- if (STy->getNumContainedTypes() != 0)
- GEN_ERROR("Illegal number of initializers for structure type");
-
- // Check to ensure that Type is packed
- if (!STy->isPacked())
- GEN_ERROR("Vector initializer to non-vector type '" +
- STy->getDescription() + "'");
-
- $$ = ConstantStruct::get(STy, std::vector<Constant*>());
- delete $1;
- CHECK_FOR_ERROR
- }
- | Types NULL_TOK {
- if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*$1)->getDescription());
- const PointerType *PTy = dyn_cast<PointerType>($1->get());
- if (PTy == 0)
- GEN_ERROR("Cannot make null pointer constant with type: '" +
- (*$1)->getDescription() + "'");
-
- $$ = ConstantPointerNull::get(PTy);
- delete $1;
- CHECK_FOR_ERROR
- }
- | Types UNDEF {
- if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*$1)->getDescription());
- $$ = UndefValue::get($1->get());
- delete $1;
- CHECK_FOR_ERROR
- }
- | Types SymbolicValueRef {
- if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*$1)->getDescription());
- const PointerType *Ty = dyn_cast<PointerType>($1->get());
- if (Ty == 0)
- GEN_ERROR("Global const reference must be a pointer type " + (*$1)->getDescription());
-
- // ConstExprs can exist in the body of a function, thus creating
- // GlobalValues whenever they refer to a variable. Because we are in
- // the context of a function, getExistingVal will search the functions
- // symbol table instead of the module symbol table for the global symbol,
- // which throws things all off. To get around this, we just tell
- // getExistingVal that we are at global scope here.
- //
- Function *SavedCurFn = CurFun.CurrentFunction;
- CurFun.CurrentFunction = 0;
-
- Value *V = getExistingVal(Ty, $2);
- CHECK_FOR_ERROR
-
- CurFun.CurrentFunction = SavedCurFn;
-
- // If this is an initializer for a constant pointer, which is referencing a
- // (currently) undefined variable, create a stub now that shall be replaced
- // in the future with the right type of variable.
- //
- if (V == 0) {
- assert(isa<PointerType>(Ty) && "Globals may only be used as pointers!");
- const PointerType *PT = cast<PointerType>(Ty);
-
- // First check to see if the forward references value is already created!
- PerModuleInfo::GlobalRefsType::iterator I =
- CurModule.GlobalRefs.find(std::make_pair(PT, $2));
-
- if (I != CurModule.GlobalRefs.end()) {
- V = I->second; // Placeholder already exists, use it...
- $2.destroy();
- } else {
- std::string Name;
- if ($2.Type == ValID::GlobalName)
- Name = $2.getName();
- else if ($2.Type != ValID::GlobalID)
- GEN_ERROR("Invalid reference to global");
-
- // Create the forward referenced global.
- GlobalValue *GV;
- if (const FunctionType *FTy =
- dyn_cast<FunctionType>(PT->getElementType())) {
- GV = Function::Create(FTy, GlobalValue::ExternalWeakLinkage, Name,
- CurModule.CurrentModule);
- } else {
- GV = new GlobalVariable(PT->getElementType(), false,
- GlobalValue::ExternalWeakLinkage, 0,
- Name, CurModule.CurrentModule);
- }
-
- // Keep track of the fact that we have a forward ref to recycle it
- CurModule.GlobalRefs.insert(std::make_pair(std::make_pair(PT, $2), GV));
- V = GV;
- }
- }
-
- $$ = cast<GlobalValue>(V);
- delete $1; // Free the type handle
- CHECK_FOR_ERROR
- }
- | Types ConstExpr {
- if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*$1)->getDescription());
- if ($1->get() != $2->getType())
- GEN_ERROR("Mismatched types for constant expression: " +
- (*$1)->getDescription() + " and " + $2->getType()->getDescription());
- $$ = $2;
- delete $1;
- CHECK_FOR_ERROR
- }
- | Types ZEROINITIALIZER {
- if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*$1)->getDescription());
- const Type *Ty = $1->get();
- if (isa<FunctionType>(Ty) || Ty == Type::LabelTy || isa<OpaqueType>(Ty))
- GEN_ERROR("Cannot create a null initialized value of this type");
- $$ = Constant::getNullValue(Ty);
- delete $1;
- CHECK_FOR_ERROR
- }
- | IntType ESINT64VAL { // integral constants
- if (!ConstantInt::isValueValidForType($1, $2))
- GEN_ERROR("Constant value doesn't fit in type");
- $$ = ConstantInt::get($1, $2, true);
- CHECK_FOR_ERROR
- }
- | IntType ESAPINTVAL { // arbitrary precision integer constants
- uint32_t BitWidth = cast<IntegerType>($1)->getBitWidth();
- if ($2->getBitWidth() > BitWidth) {
- GEN_ERROR("Constant value does not fit in type");
- }
- $2->sextOrTrunc(BitWidth);
- $$ = ConstantInt::get(*$2);
- delete $2;
- CHECK_FOR_ERROR
- }
- | IntType EUINT64VAL { // integral constants
- if (!ConstantInt::isValueValidForType($1, $2))
- GEN_ERROR("Constant value doesn't fit in type");
- $$ = ConstantInt::get($1, $2, false);
- CHECK_FOR_ERROR
- }
- | IntType EUAPINTVAL { // arbitrary precision integer constants
- uint32_t BitWidth = cast<IntegerType>($1)->getBitWidth();
- if ($2->getBitWidth() > BitWidth) {
- GEN_ERROR("Constant value does not fit in type");
- }
- $2->zextOrTrunc(BitWidth);
- $$ = ConstantInt::get(*$2);
- delete $2;
- CHECK_FOR_ERROR
- }
- | INTTYPE TRUETOK { // Boolean constants
- assert(cast<IntegerType>($1)->getBitWidth() == 1 && "Not Bool?");
- $$ = ConstantInt::getTrue();
- CHECK_FOR_ERROR
- }
- | INTTYPE FALSETOK { // Boolean constants
- assert(cast<IntegerType>($1)->getBitWidth() == 1 && "Not Bool?");
- $$ = ConstantInt::getFalse();
- CHECK_FOR_ERROR
- }
- | FPType FPVAL { // Floating point constants
- if (!ConstantFP::isValueValidForType($1, *$2))
- GEN_ERROR("Floating point constant invalid for type");
- // Lexer has no type info, so builds all float and double FP constants
- // as double. Fix this here. Long double is done right.
- if (&$2->getSemantics()==&APFloat::IEEEdouble && $1==Type::FloatTy)
- $2->convert(APFloat::IEEEsingle, APFloat::rmNearestTiesToEven);
- $$ = ConstantFP::get(*$2);
- delete $2;
- CHECK_FOR_ERROR
- };
-
-
-ConstExpr: CastOps '(' ConstVal TO Types ')' {
- if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*$5)->getDescription());
- Constant *Val = $3;
- const Type *DestTy = $5->get();
- if (!CastInst::castIsValid($1, $3, DestTy))
- GEN_ERROR("invalid cast opcode for cast from '" +
- Val->getType()->getDescription() + "' to '" +
- DestTy->getDescription() + "'");
- $$ = ConstantExpr::getCast($1, $3, DestTy);
- delete $5;
- }
- | GETELEMENTPTR '(' ConstVal IndexList ')' {
- if (!isa<PointerType>($3->getType()))
- GEN_ERROR("GetElementPtr requires a pointer operand");
-
- const Type *IdxTy =
- GetElementPtrInst::getIndexedType($3->getType(), $4->begin(), $4->end(),
- true);
- if (!IdxTy)
- GEN_ERROR("Index list invalid for constant getelementptr");
-
- SmallVector<Constant*, 8> IdxVec;
- for (unsigned i = 0, e = $4->size(); i != e; ++i)
- if (Constant *C = dyn_cast<Constant>((*$4)[i]))
- IdxVec.push_back(C);
- else
- GEN_ERROR("Indices to constant getelementptr must be constants");
-
- delete $4;
-
- $$ = ConstantExpr::getGetElementPtr($3, &IdxVec[0], IdxVec.size());
- CHECK_FOR_ERROR
- }
- | SELECT '(' ConstVal ',' ConstVal ',' ConstVal ')' {
- if ($3->getType() != Type::Int1Ty)
- GEN_ERROR("Select condition must be of boolean type");
- if ($5->getType() != $7->getType())
- GEN_ERROR("Select operand types must match");
- $$ = ConstantExpr::getSelect($3, $5, $7);
- CHECK_FOR_ERROR
- }
- | ArithmeticOps '(' ConstVal ',' ConstVal ')' {
- if ($3->getType() != $5->getType())
- GEN_ERROR("Binary operator types must match");
- CHECK_FOR_ERROR;
- $$ = ConstantExpr::get($1, $3, $5);
- }
- | LogicalOps '(' ConstVal ',' ConstVal ')' {
- if ($3->getType() != $5->getType())
- GEN_ERROR("Logical operator types must match");
- if (!$3->getType()->isInteger()) {
- if (Instruction::isShift($1) || !isa<VectorType>($3->getType()) ||
- !cast<VectorType>($3->getType())->getElementType()->isInteger())
- GEN_ERROR("Logical operator requires integral operands");
- }
- $$ = ConstantExpr::get($1, $3, $5);
- CHECK_FOR_ERROR
- }
- | ICMP IPredicates '(' ConstVal ',' ConstVal ')' {
- if ($4->getType() != $6->getType())
- GEN_ERROR("icmp operand types must match");
- $$ = ConstantExpr::getICmp($2, $4, $6);
- }
- | FCMP FPredicates '(' ConstVal ',' ConstVal ')' {
- if ($4->getType() != $6->getType())
- GEN_ERROR("fcmp operand types must match");
- $$ = ConstantExpr::getFCmp($2, $4, $6);
- }
- | EXTRACTELEMENT '(' ConstVal ',' ConstVal ')' {
- if (!ExtractElementInst::isValidOperands($3, $5))
- GEN_ERROR("Invalid extractelement operands");
- $$ = ConstantExpr::getExtractElement($3, $5);
- CHECK_FOR_ERROR
- }
- | INSERTELEMENT '(' ConstVal ',' ConstVal ',' ConstVal ')' {
- if (!InsertElementInst::isValidOperands($3, $5, $7))
- GEN_ERROR("Invalid insertelement operands");
- $$ = ConstantExpr::getInsertElement($3, $5, $7);
- CHECK_FOR_ERROR
- }
- | SHUFFLEVECTOR '(' ConstVal ',' ConstVal ',' ConstVal ')' {
- if (!ShuffleVectorInst::isValidOperands($3, $5, $7))
- GEN_ERROR("Invalid shufflevector operands");
- $$ = ConstantExpr::getShuffleVector($3, $5, $7);
- CHECK_FOR_ERROR
- };
-
-
-// ConstVector - A list of comma separated constants.
-ConstVector : ConstVector ',' ConstVal {
- ($$ = $1)->push_back($3);
- CHECK_FOR_ERROR
- }
- | ConstVal {
- $$ = new std::vector<Constant*>();
- $$->push_back($1);
- CHECK_FOR_ERROR
- };
-
-
-// GlobalType - Match either GLOBAL or CONSTANT for global declarations...
-GlobalType : GLOBAL { $$ = false; } | CONSTANT { $$ = true; };
-
-// ThreadLocal
-ThreadLocal : THREAD_LOCAL { $$ = true; } | { $$ = false; };
-
-// AliaseeRef - Match either GlobalValue or bitcast to GlobalValue.
-AliaseeRef : ResultTypes SymbolicValueRef {
- const Type* VTy = $1->get();
- Value *V = getVal(VTy, $2);
- CHECK_FOR_ERROR
- GlobalValue* Aliasee = dyn_cast<GlobalValue>(V);
- if (!Aliasee)
- GEN_ERROR("Aliases can be created only to global values");
-
- $$ = Aliasee;
- CHECK_FOR_ERROR
- delete $1;
- }
- | BITCAST '(' AliaseeRef TO Types ')' {
- Constant *Val = $3;
- const Type *DestTy = $5->get();
- if (!CastInst::castIsValid($1, $3, DestTy))
- GEN_ERROR("invalid cast opcode for cast from '" +
- Val->getType()->getDescription() + "' to '" +
- DestTy->getDescription() + "'");
-
- $$ = ConstantExpr::getCast($1, $3, DestTy);
- CHECK_FOR_ERROR
- delete $5;
- };
-
-//===----------------------------------------------------------------------===//
-// Rules to match Modules
-//===----------------------------------------------------------------------===//
-
-// Module rule: Capture the result of parsing the whole file into a result
-// variable...
-//
-Module
- : DefinitionList {
- $$ = ParserResult = CurModule.CurrentModule;
- CurModule.ModuleDone();
- CHECK_FOR_ERROR;
- }
- | /*empty*/ {
- $$ = ParserResult = CurModule.CurrentModule;
- CurModule.ModuleDone();
- CHECK_FOR_ERROR;
- }
- ;
-
-DefinitionList
- : Definition
- | DefinitionList Definition
- ;
-
-Definition
- : DEFINE { CurFun.isDeclare = false; } Function {
- CurFun.FunctionDone();
- CHECK_FOR_ERROR
- }
- | DECLARE { CurFun.isDeclare = true; } FunctionProto {
- CHECK_FOR_ERROR
- }
- | MODULE ASM_TOK AsmBlock {
- CHECK_FOR_ERROR
- }
- | OptLocalAssign TYPE Types {
- if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*$3)->getDescription());
- // Eagerly resolve types. This is not an optimization, this is a
- // requirement that is due to the fact that we could have this:
- //
- // %list = type { %list * }
- // %list = type { %list * } ; repeated type decl
- //
- // If types are not resolved eagerly, then the two types will not be
- // determined to be the same type!
- //
- ResolveTypeTo($1, *$3);
-
- if (!setTypeName(*$3, $1) && !$1) {
- CHECK_FOR_ERROR
- // If this is a named type that is not a redefinition, add it to the slot
- // table.
- CurModule.Types.push_back(*$3);
- }
-
- delete $3;
- CHECK_FOR_ERROR
- }
- | OptLocalAssign TYPE VOID {
- ResolveTypeTo($1, $3);
-
- if (!setTypeName($3, $1) && !$1) {
- CHECK_FOR_ERROR
- // If this is a named type that is not a redefinition, add it to the slot
- // table.
- CurModule.Types.push_back($3);
- }
- CHECK_FOR_ERROR
- }
- | OptGlobalAssign GVVisibilityStyle ThreadLocal GlobalType ConstVal
- OptAddrSpace {
- /* "Externally Visible" Linkage */
- if ($5 == 0)
- GEN_ERROR("Global value initializer is not a constant");
- CurGV = ParseGlobalVariable($1, GlobalValue::ExternalLinkage,
- $2, $4, $5->getType(), $5, $3, $6);
- CHECK_FOR_ERROR
- } GlobalVarAttributes {
- CurGV = 0;
- }
- | OptGlobalAssign GVInternalLinkage GVVisibilityStyle ThreadLocal GlobalType
- ConstVal OptAddrSpace {
- if ($6 == 0)
- GEN_ERROR("Global value initializer is not a constant");
- CurGV = ParseGlobalVariable($1, $2, $3, $5, $6->getType(), $6, $4, $7);
- CHECK_FOR_ERROR
- } GlobalVarAttributes {
- CurGV = 0;
- }
- | OptGlobalAssign GVExternalLinkage GVVisibilityStyle ThreadLocal GlobalType
- Types OptAddrSpace {
- if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*$6)->getDescription());
- CurGV = ParseGlobalVariable($1, $2, $3, $5, *$6, 0, $4, $7);
- CHECK_FOR_ERROR
- delete $6;
- } GlobalVarAttributes {
- CurGV = 0;
- CHECK_FOR_ERROR
- }
- | OptGlobalAssign GVVisibilityStyle ALIAS AliasLinkage AliaseeRef {
- std::string Name;
- if ($1) {
- Name = *$1;
- delete $1;
- }
- if (Name.empty())
- GEN_ERROR("Alias name cannot be empty");
-
- Constant* Aliasee = $5;
- if (Aliasee == 0)
- GEN_ERROR(std::string("Invalid aliasee for alias: ") + Name);
-
- GlobalAlias* GA = new GlobalAlias(Aliasee->getType(), $4, Name, Aliasee,
- CurModule.CurrentModule);
- GA->setVisibility($2);
- InsertValue(GA, CurModule.Values);
-
-
- // If there was a forward reference of this alias, resolve it now.
-
- ValID ID;
- if (!Name.empty())
- ID = ValID::createGlobalName(Name);
- else
- ID = ValID::createGlobalID(CurModule.Values.size()-1);
-
- if (GlobalValue *FWGV =
- CurModule.GetForwardRefForGlobal(GA->getType(), ID)) {
- // Replace uses of the fwdref with the actual alias.
- FWGV->replaceAllUsesWith(GA);
- if (GlobalVariable *GV = dyn_cast<GlobalVariable>(FWGV))
- GV->eraseFromParent();
- else
- cast<Function>(FWGV)->eraseFromParent();
- }
- ID.destroy();
-
- CHECK_FOR_ERROR
- }
- | TARGET TargetDefinition {
- CHECK_FOR_ERROR
- }
- | DEPLIBS '=' LibrariesDefinition {
- CHECK_FOR_ERROR
- }
- ;
-
-
-AsmBlock : STRINGCONSTANT {
- const std::string &AsmSoFar = CurModule.CurrentModule->getModuleInlineAsm();
- if (AsmSoFar.empty())
- CurModule.CurrentModule->setModuleInlineAsm(*$1);
- else
- CurModule.CurrentModule->setModuleInlineAsm(AsmSoFar+"\n"+*$1);
- delete $1;
- CHECK_FOR_ERROR
-};
-
-TargetDefinition : TRIPLE '=' STRINGCONSTANT {
- CurModule.CurrentModule->setTargetTriple(*$3);
- delete $3;
- }
- | DATALAYOUT '=' STRINGCONSTANT {
- CurModule.CurrentModule->setDataLayout(*$3);
- delete $3;
- };
-
-LibrariesDefinition : '[' LibList ']';
-
-LibList : LibList ',' STRINGCONSTANT {
- CurModule.CurrentModule->addLibrary(*$3);
- delete $3;
- CHECK_FOR_ERROR
- }
- | STRINGCONSTANT {
- CurModule.CurrentModule->addLibrary(*$1);
- delete $1;
- CHECK_FOR_ERROR
- }
- | /* empty: end of list */ {
- CHECK_FOR_ERROR
- }
- ;
-
-//===----------------------------------------------------------------------===//
-// Rules to match Function Headers
-//===----------------------------------------------------------------------===//
-
-ArgListH : ArgListH ',' Types OptParamAttrs OptLocalName {
- if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*$3)->getDescription());
- if (*$3 == Type::VoidTy)
- GEN_ERROR("void typed arguments are invalid");
- ArgListEntry E; E.Attrs = $4; E.Ty = $3; E.Name = $5;
- $$ = $1;
- $1->push_back(E);
- CHECK_FOR_ERROR
- }
- | Types OptParamAttrs OptLocalName {
- if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*$1)->getDescription());
- if (*$1 == Type::VoidTy)
- GEN_ERROR("void typed arguments are invalid");
- ArgListEntry E; E.Attrs = $2; E.Ty = $1; E.Name = $3;
- $$ = new ArgListType;
- $$->push_back(E);
- CHECK_FOR_ERROR
- };
-
-ArgList : ArgListH {
- $$ = $1;
- CHECK_FOR_ERROR
- }
- | ArgListH ',' DOTDOTDOT {
- $$ = $1;
- struct ArgListEntry E;
- E.Ty = new PATypeHolder(Type::VoidTy);
- E.Name = 0;
- E.Attrs = ParamAttr::None;
- $$->push_back(E);
- CHECK_FOR_ERROR
- }
- | DOTDOTDOT {
- $$ = new ArgListType;
- struct ArgListEntry E;
- E.Ty = new PATypeHolder(Type::VoidTy);
- E.Name = 0;
- E.Attrs = ParamAttr::None;
- $$->push_back(E);
- CHECK_FOR_ERROR
- }
- | /* empty */ {
- $$ = 0;
- CHECK_FOR_ERROR
- };
-
-FunctionHeaderH : OptCallingConv ResultTypes GlobalName '(' ArgList ')'
- OptFuncAttrs OptSection OptAlign OptGC {
- std::string FunctionName(*$3);
- delete $3; // Free strdup'd memory!
-
- // Check the function result for abstractness if this is a define. We should
- // have no abstract types at this point
- if (!CurFun.isDeclare && CurModule.TypeIsUnresolved($2))
- GEN_ERROR("Reference to abstract result: "+ $2->get()->getDescription());
-
- if (!FunctionType::isValidReturnType(*$2))
- GEN_ERROR("Invalid result type for LLVM function");
-
- std::vector<const Type*> ParamTypeList;
- SmallVector<ParamAttrsWithIndex, 8> Attrs;
- if ($7 != ParamAttr::None)
- Attrs.push_back(ParamAttrsWithIndex::get(0, $7));
- if ($5) { // If there are arguments...
- unsigned index = 1;
- for (ArgListType::iterator I = $5->begin(); I != $5->end(); ++I, ++index) {
- const Type* Ty = I->Ty->get();
- if (!CurFun.isDeclare && CurModule.TypeIsUnresolved(I->Ty))
- GEN_ERROR("Reference to abstract argument: " + Ty->getDescription());
- ParamTypeList.push_back(Ty);
- if (Ty != Type::VoidTy && I->Attrs != ParamAttr::None)
- Attrs.push_back(ParamAttrsWithIndex::get(index, I->Attrs));
- }
- }
-
- bool isVarArg = ParamTypeList.size() && ParamTypeList.back() == Type::VoidTy;
- if (isVarArg) ParamTypeList.pop_back();
-
- PAListPtr PAL;
- if (!Attrs.empty())
- PAL = PAListPtr::get(Attrs.begin(), Attrs.end());
-
- FunctionType *FT = FunctionType::get(*$2, ParamTypeList, isVarArg);
- const PointerType *PFT = PointerType::getUnqual(FT);
- delete $2;
-
- ValID ID;
- if (!FunctionName.empty()) {
- ID = ValID::createGlobalName((char*)FunctionName.c_str());
- } else {
- ID = ValID::createGlobalID(CurModule.Values.size());
- }
-
- Function *Fn = 0;
- // See if this function was forward referenced. If so, recycle the object.
- if (GlobalValue *FWRef = CurModule.GetForwardRefForGlobal(PFT, ID)) {
- // Move the function to the end of the list, from whereever it was
- // previously inserted.
- Fn = cast<Function>(FWRef);
- assert(Fn->getParamAttrs().isEmpty() &&
- "Forward reference has parameter attributes!");
- CurModule.CurrentModule->getFunctionList().remove(Fn);
- CurModule.CurrentModule->getFunctionList().push_back(Fn);
- } else if (!FunctionName.empty() && // Merge with an earlier prototype?
- (Fn = CurModule.CurrentModule->getFunction(FunctionName))) {
- if (Fn->getFunctionType() != FT ) {
- // The existing function doesn't have the same type. This is an overload
- // error.
- GEN_ERROR("Overload of function '" + FunctionName + "' not permitted.");
- } else if (Fn->getParamAttrs() != PAL) {
- // The existing function doesn't have the same parameter attributes.
- // This is an overload error.
- GEN_ERROR("Overload of function '" + FunctionName + "' not permitted.");
- } else if (!CurFun.isDeclare && !Fn->isDeclaration()) {
- // Neither the existing or the current function is a declaration and they
- // have the same name and same type. Clearly this is a redefinition.
- GEN_ERROR("Redefinition of function '" + FunctionName + "'");
- } else if (Fn->isDeclaration()) {
- // Make sure to strip off any argument names so we can't get conflicts.
- for (Function::arg_iterator AI = Fn->arg_begin(), AE = Fn->arg_end();
- AI != AE; ++AI)
- AI->setName("");
- }
- } else { // Not already defined?
- Fn = Function::Create(FT, GlobalValue::ExternalWeakLinkage, FunctionName,
- CurModule.CurrentModule);
- InsertValue(Fn, CurModule.Values);
- }
-
- CurFun.FunctionStart(Fn);
-
- if (CurFun.isDeclare) {
- // If we have declaration, always overwrite linkage. This will allow us to
- // correctly handle cases, when pointer to function is passed as argument to
- // another function.
- Fn->setLinkage(CurFun.Linkage);
- Fn->setVisibility(CurFun.Visibility);
- }
- Fn->setCallingConv($1);
- Fn->setParamAttrs(PAL);
- Fn->setAlignment($9);
- if ($8) {
- Fn->setSection(*$8);
- delete $8;
- }
- if ($10) {
- Fn->setCollector($10->c_str());
- delete $10;
- }
-
- // Add all of the arguments we parsed to the function...
- if ($5) { // Is null if empty...
- if (isVarArg) { // Nuke the last entry
- assert($5->back().Ty->get() == Type::VoidTy && $5->back().Name == 0 &&
- "Not a varargs marker!");
- delete $5->back().Ty;
- $5->pop_back(); // Delete the last entry
- }
- Function::arg_iterator ArgIt = Fn->arg_begin();
- Function::arg_iterator ArgEnd = Fn->arg_end();
- unsigned Idx = 1;
- for (ArgListType::iterator I = $5->begin();
- I != $5->end() && ArgIt != ArgEnd; ++I, ++ArgIt) {
- delete I->Ty; // Delete the typeholder...
- setValueName(ArgIt, I->Name); // Insert arg into symtab...
- CHECK_FOR_ERROR
- InsertValue(ArgIt);
- Idx++;
- }
-
- delete $5; // We're now done with the argument list
- }
- CHECK_FOR_ERROR
-};
-
-BEGIN : BEGINTOK | '{'; // Allow BEGIN or '{' to start a function
-
-FunctionHeader : FunctionDefineLinkage GVVisibilityStyle FunctionHeaderH BEGIN {
- $$ = CurFun.CurrentFunction;
-
- // Make sure that we keep track of the linkage type even if there was a
- // previous "declare".
- $$->setLinkage($1);
- $$->setVisibility($2);
-};
-
-END : ENDTOK | '}'; // Allow end of '}' to end a function
-
-Function : BasicBlockList END {
- $$ = $1;
- CHECK_FOR_ERROR
-};
-
-FunctionProto : FunctionDeclareLinkage GVVisibilityStyle FunctionHeaderH {
- CurFun.CurrentFunction->setLinkage($1);
- CurFun.CurrentFunction->setVisibility($2);
- $$ = CurFun.CurrentFunction;
- CurFun.FunctionDone();
- CHECK_FOR_ERROR
- };
-
-//===----------------------------------------------------------------------===//
-// Rules to match Basic Blocks
-//===----------------------------------------------------------------------===//
-
-OptSideEffect : /* empty */ {
- $$ = false;
- CHECK_FOR_ERROR
- }
- | SIDEEFFECT {
- $$ = true;
- CHECK_FOR_ERROR
- };
-
-ConstValueRef : ESINT64VAL { // A reference to a direct constant
- $$ = ValID::create($1);
- CHECK_FOR_ERROR
- }
- | EUINT64VAL {
- $$ = ValID::create($1);
- CHECK_FOR_ERROR
- }
- | FPVAL { // Perhaps it's an FP constant?
- $$ = ValID::create($1);
- CHECK_FOR_ERROR
- }
- | TRUETOK {
- $$ = ValID::create(ConstantInt::getTrue());
- CHECK_FOR_ERROR
- }
- | FALSETOK {
- $$ = ValID::create(ConstantInt::getFalse());
- CHECK_FOR_ERROR
- }
- | NULL_TOK {
- $$ = ValID::createNull();
- CHECK_FOR_ERROR
- }
- | UNDEF {
- $$ = ValID::createUndef();
- CHECK_FOR_ERROR
- }
- | ZEROINITIALIZER { // A vector zero constant.
- $$ = ValID::createZeroInit();
- CHECK_FOR_ERROR
- }
- | '<' ConstVector '>' { // Nonempty unsized packed vector
- const Type *ETy = (*$2)[0]->getType();
- int NumElements = $2->size();
-
- VectorType* pt = VectorType::get(ETy, NumElements);
- PATypeHolder* PTy = new PATypeHolder(
- HandleUpRefs(
- VectorType::get(
- ETy,
- NumElements)
- )
- );
-
- // Verify all elements are correct type!
- for (unsigned i = 0; i < $2->size(); i++) {
- if (ETy != (*$2)[i]->getType())
- GEN_ERROR("Element #" + utostr(i) + " is not of type '" +
- ETy->getDescription() +"' as required!\nIt is of type '" +
- (*$2)[i]->getType()->getDescription() + "'.");
- }
-
- $$ = ValID::create(ConstantVector::get(pt, *$2));
- delete PTy; delete $2;
- CHECK_FOR_ERROR
- }
- | ConstExpr {
- $$ = ValID::create($1);
- CHECK_FOR_ERROR
- }
- | ASM_TOK OptSideEffect STRINGCONSTANT ',' STRINGCONSTANT {
- $$ = ValID::createInlineAsm(*$3, *$5, $2);
- delete $3;
- delete $5;
- CHECK_FOR_ERROR
- };
-
-// SymbolicValueRef - Reference to one of two ways of symbolically refering to
-// another value.
-//
-SymbolicValueRef : LOCALVAL_ID { // Is it an integer reference...?
- $$ = ValID::createLocalID($1);
- CHECK_FOR_ERROR
- }
- | GLOBALVAL_ID {
- $$ = ValID::createGlobalID($1);
- CHECK_FOR_ERROR
- }
- | LocalName { // Is it a named reference...?
- $$ = ValID::createLocalName(*$1);
- delete $1;
- CHECK_FOR_ERROR
- }
- | GlobalName { // Is it a named reference...?
- $$ = ValID::createGlobalName(*$1);
- delete $1;
- CHECK_FOR_ERROR
- };
-
-// ValueRef - A reference to a definition... either constant or symbolic
-ValueRef : SymbolicValueRef | ConstValueRef;
-
-
-// ResolvedVal - a <type> <value> pair. This is used only in cases where the
-// type immediately preceeds the value reference, and allows complex constant
-// pool references (for things like: 'ret [2 x int] [ int 12, int 42]')
-ResolvedVal : Types ValueRef {
- if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*$1)->getDescription());
- $$ = getVal(*$1, $2);
- delete $1;
- CHECK_FOR_ERROR
- }
- ;
-
-ReturnedVal : ResolvedVal {
- $$ = new std::vector<Value *>();
- $$->push_back($1);
- CHECK_FOR_ERROR
- }
- | ReturnedVal ',' ResolvedVal {
- ($$=$1)->push_back($3);
- CHECK_FOR_ERROR
- };
-
-BasicBlockList : BasicBlockList BasicBlock {
- $$ = $1;
- CHECK_FOR_ERROR
- }
- | FunctionHeader BasicBlock { // Do not allow functions with 0 basic blocks
- $$ = $1;
- CHECK_FOR_ERROR
- };
-
-
-// Basic blocks are terminated by branching instructions:
-// br, br/cc, switch, ret
-//
-BasicBlock : InstructionList OptLocalAssign BBTerminatorInst {
- setValueName($3, $2);
- CHECK_FOR_ERROR
- InsertValue($3);
- $1->getInstList().push_back($3);
- $$ = $1;
- CHECK_FOR_ERROR
- };
-
-InstructionList : InstructionList Inst {
- if (CastInst *CI1 = dyn_cast<CastInst>($2))
- if (CastInst *CI2 = dyn_cast<CastInst>(CI1->getOperand(0)))
- if (CI2->getParent() == 0)
- $1->getInstList().push_back(CI2);
- $1->getInstList().push_back($2);
- $$ = $1;
- CHECK_FOR_ERROR
- }
- | /* empty */ { // Empty space between instruction lists
- $$ = defineBBVal(ValID::createLocalID(CurFun.NextValNum));
- CHECK_FOR_ERROR
- }
- | LABELSTR { // Labelled (named) basic block
- $$ = defineBBVal(ValID::createLocalName(*$1));
- delete $1;
- CHECK_FOR_ERROR
-
- };
-
-BBTerminatorInst :
- RET ReturnedVal { // Return with a result...
- ValueList &VL = *$2;
- assert(!VL.empty() && "Invalid ret operands!");
- $$ = ReturnInst::Create(&VL[0], VL.size());
- delete $2;
- CHECK_FOR_ERROR
- }
- | RET VOID { // Return with no result...
- $$ = ReturnInst::Create();
- CHECK_FOR_ERROR
- }
- | BR LABEL ValueRef { // Unconditional Branch...
- BasicBlock* tmpBB = getBBVal($3);
- CHECK_FOR_ERROR
- $$ = BranchInst::Create(tmpBB);
- } // Conditional Branch...
- | BR INTTYPE ValueRef ',' LABEL ValueRef ',' LABEL ValueRef {
- assert(cast<IntegerType>($2)->getBitWidth() == 1 && "Not Bool?");
- BasicBlock* tmpBBA = getBBVal($6);
- CHECK_FOR_ERROR
- BasicBlock* tmpBBB = getBBVal($9);
- CHECK_FOR_ERROR
- Value* tmpVal = getVal(Type::Int1Ty, $3);
- CHECK_FOR_ERROR
- $$ = BranchInst::Create(tmpBBA, tmpBBB, tmpVal);
- }
- | SWITCH IntType ValueRef ',' LABEL ValueRef '[' JumpTable ']' {
- Value* tmpVal = getVal($2, $3);
- CHECK_FOR_ERROR
- BasicBlock* tmpBB = getBBVal($6);
- CHECK_FOR_ERROR
- SwitchInst *S = SwitchInst::Create(tmpVal, tmpBB, $8->size());
- $$ = S;
-
- std::vector<std::pair<Constant*,BasicBlock*> >::iterator I = $8->begin(),
- E = $8->end();
- for (; I != E; ++I) {
- if (ConstantInt *CI = dyn_cast<ConstantInt>(I->first))
- S->addCase(CI, I->second);
- else
- GEN_ERROR("Switch case is constant, but not a simple integer");
- }
- delete $8;
- CHECK_FOR_ERROR
- }
- | SWITCH IntType ValueRef ',' LABEL ValueRef '[' ']' {
- Value* tmpVal = getVal($2, $3);
- CHECK_FOR_ERROR
- BasicBlock* tmpBB = getBBVal($6);
- CHECK_FOR_ERROR
- SwitchInst *S = SwitchInst::Create(tmpVal, tmpBB, 0);
- $$ = S;
- CHECK_FOR_ERROR
- }
- | INVOKE OptCallingConv ResultTypes ValueRef '(' ParamList ')' OptFuncAttrs
- TO LABEL ValueRef UNWIND LABEL ValueRef {
-
- // Handle the short syntax
- const PointerType *PFTy = 0;
- const FunctionType *Ty = 0;
- if (!(PFTy = dyn_cast<PointerType>($3->get())) ||
- !(Ty = dyn_cast<FunctionType>(PFTy->getElementType()))) {
- // Pull out the types of all of the arguments...
- std::vector<const Type*> ParamTypes;
- ParamList::iterator I = $6->begin(), E = $6->end();
- for (; I != E; ++I) {
- const Type *Ty = I->Val->getType();
- if (Ty == Type::VoidTy)
- GEN_ERROR("Short call syntax cannot be used with varargs");
- ParamTypes.push_back(Ty);
- }
-
- if (!FunctionType::isValidReturnType(*$3))
- GEN_ERROR("Invalid result type for LLVM function");
-
- Ty = FunctionType::get($3->get(), ParamTypes, false);
- PFTy = PointerType::getUnqual(Ty);
- }
-
- delete $3;
-
- Value *V = getVal(PFTy, $4); // Get the function we're calling...
- CHECK_FOR_ERROR
- BasicBlock *Normal = getBBVal($11);
- CHECK_FOR_ERROR
- BasicBlock *Except = getBBVal($14);
- CHECK_FOR_ERROR
-
- SmallVector<ParamAttrsWithIndex, 8> Attrs;
- if ($8 != ParamAttr::None)
- Attrs.push_back(ParamAttrsWithIndex::get(0, $8));
-
- // Check the arguments
- ValueList Args;
- if ($6->empty()) { // Has no arguments?
- // Make sure no arguments is a good thing!
- if (Ty->getNumParams() != 0)
- GEN_ERROR("No arguments passed to a function that "
- "expects arguments");
- } else { // Has arguments?
- // Loop through FunctionType's arguments and ensure they are specified
- // correctly!
- FunctionType::param_iterator I = Ty->param_begin();
- FunctionType::param_iterator E = Ty->param_end();
- ParamList::iterator ArgI = $6->begin(), ArgE = $6->end();
- unsigned index = 1;
-
- for (; ArgI != ArgE && I != E; ++ArgI, ++I, ++index) {
- if (ArgI->Val->getType() != *I)
- GEN_ERROR("Parameter " + ArgI->Val->getName()+ " is not of type '" +
- (*I)->getDescription() + "'");
- Args.push_back(ArgI->Val);
- if (ArgI->Attrs != ParamAttr::None)
- Attrs.push_back(ParamAttrsWithIndex::get(index, ArgI->Attrs));
- }
-
- if (Ty->isVarArg()) {
- if (I == E)
- for (; ArgI != ArgE; ++ArgI, ++index) {
- Args.push_back(ArgI->Val); // push the remaining varargs
- if (ArgI->Attrs != ParamAttr::None)
- Attrs.push_back(ParamAttrsWithIndex::get(index, ArgI->Attrs));
- }
- } else if (I != E || ArgI != ArgE)
- GEN_ERROR("Invalid number of parameters detected");
- }
-
- PAListPtr PAL;
- if (!Attrs.empty())
- PAL = PAListPtr::get(Attrs.begin(), Attrs.end());
-
- // Create the InvokeInst
- InvokeInst *II = InvokeInst::Create(V, Normal, Except, Args.begin(),Args.end());
- II->setCallingConv($2);
- II->setParamAttrs(PAL);
- $$ = II;
- delete $6;
- CHECK_FOR_ERROR
- }
- | UNWIND {
- $$ = new UnwindInst();
- CHECK_FOR_ERROR
- }
- | UNREACHABLE {
- $$ = new UnreachableInst();
- CHECK_FOR_ERROR
- };
-
-
-
-JumpTable : JumpTable IntType ConstValueRef ',' LABEL ValueRef {
- $$ = $1;
- Constant *V = cast<Constant>(getExistingVal($2, $3));
- CHECK_FOR_ERROR
- if (V == 0)
- GEN_ERROR("May only switch on a constant pool value");
-
- BasicBlock* tmpBB = getBBVal($6);
- CHECK_FOR_ERROR
- $$->push_back(std::make_pair(V, tmpBB));
- }
- | IntType ConstValueRef ',' LABEL ValueRef {
- $$ = new std::vector<std::pair<Constant*, BasicBlock*> >();
- Constant *V = cast<Constant>(getExistingVal($1, $2));
- CHECK_FOR_ERROR
-
- if (V == 0)
- GEN_ERROR("May only switch on a constant pool value");
-
- BasicBlock* tmpBB = getBBVal($5);
- CHECK_FOR_ERROR
- $$->push_back(std::make_pair(V, tmpBB));
- };
-
-Inst : OptLocalAssign InstVal {
- // Is this definition named?? if so, assign the name...
- setValueName($2, $1);
- CHECK_FOR_ERROR
- InsertValue($2);
- $$ = $2;
- CHECK_FOR_ERROR
- };
-
-
-PHIList : Types '[' ValueRef ',' ValueRef ']' { // Used for PHI nodes
- if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*$1)->getDescription());
- $$ = new std::list<std::pair<Value*, BasicBlock*> >();
- Value* tmpVal = getVal(*$1, $3);
- CHECK_FOR_ERROR
- BasicBlock* tmpBB = getBBVal($5);
- CHECK_FOR_ERROR
- $$->push_back(std::make_pair(tmpVal, tmpBB));
- delete $1;
- }
- | PHIList ',' '[' ValueRef ',' ValueRef ']' {
- $$ = $1;
- Value* tmpVal = getVal($1->front().first->getType(), $4);
- CHECK_FOR_ERROR
- BasicBlock* tmpBB = getBBVal($6);
- CHECK_FOR_ERROR
- $1->push_back(std::make_pair(tmpVal, tmpBB));
- };
-
-
-ParamList : Types OptParamAttrs ValueRef OptParamAttrs {
- // FIXME: Remove trailing OptParamAttrs in LLVM 3.0, it was a mistake in 2.0
- if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*$1)->getDescription());
- // Used for call and invoke instructions
- $$ = new ParamList();
- ParamListEntry E; E.Attrs = $2 | $4; E.Val = getVal($1->get(), $3);
- $$->push_back(E);
- delete $1;
- CHECK_FOR_ERROR
- }
- | LABEL OptParamAttrs ValueRef OptParamAttrs {
- // FIXME: Remove trailing OptParamAttrs in LLVM 3.0, it was a mistake in 2.0
- // Labels are only valid in ASMs
- $$ = new ParamList();
- ParamListEntry E; E.Attrs = $2 | $4; E.Val = getBBVal($3);
- $$->push_back(E);
- CHECK_FOR_ERROR
- }
- | ParamList ',' Types OptParamAttrs ValueRef OptParamAttrs {
- // FIXME: Remove trailing OptParamAttrs in LLVM 3.0, it was a mistake in 2.0
- if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*$3)->getDescription());
- $$ = $1;
- ParamListEntry E; E.Attrs = $4 | $6; E.Val = getVal($3->get(), $5);
- $$->push_back(E);
- delete $3;
- CHECK_FOR_ERROR
- }
- | ParamList ',' LABEL OptParamAttrs ValueRef OptParamAttrs {
- // FIXME: Remove trailing OptParamAttrs in LLVM 3.0, it was a mistake in 2.0
- $$ = $1;
- ParamListEntry E; E.Attrs = $4 | $6; E.Val = getBBVal($5);
- $$->push_back(E);
- CHECK_FOR_ERROR
- }
- | /*empty*/ { $$ = new ParamList(); };
-
-IndexList // Used for gep instructions and constant expressions
- : /*empty*/ { $$ = new std::vector<Value*>(); }
- | IndexList ',' ResolvedVal {
- $$ = $1;
- $$->push_back($3);
- CHECK_FOR_ERROR
- }
- ;
-
-OptTailCall : TAIL CALL {
- $$ = true;
- CHECK_FOR_ERROR
- }
- | CALL {
- $$ = false;
- CHECK_FOR_ERROR
- };
-
-InstVal : ArithmeticOps Types ValueRef ',' ValueRef {
- if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*$2)->getDescription());
- if (!(*$2)->isInteger() && !(*$2)->isFloatingPoint() &&
- !isa<VectorType>((*$2).get()))
- GEN_ERROR(
- "Arithmetic operator requires integer, FP, or packed operands");
- Value* val1 = getVal(*$2, $3);
- CHECK_FOR_ERROR
- Value* val2 = getVal(*$2, $5);
- CHECK_FOR_ERROR
- $$ = BinaryOperator::create($1, val1, val2);
- if ($$ == 0)
- GEN_ERROR("binary operator returned null");
- delete $2;
- }
- | LogicalOps Types ValueRef ',' ValueRef {
- if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*$2)->getDescription());
- if (!(*$2)->isInteger()) {
- if (Instruction::isShift($1) || !isa<VectorType>($2->get()) ||
- !cast<VectorType>($2->get())->getElementType()->isInteger())
- GEN_ERROR("Logical operator requires integral operands");
- }
- Value* tmpVal1 = getVal(*$2, $3);
- CHECK_FOR_ERROR
- Value* tmpVal2 = getVal(*$2, $5);
- CHECK_FOR_ERROR
- $$ = BinaryOperator::create($1, tmpVal1, tmpVal2);
- if ($$ == 0)
- GEN_ERROR("binary operator returned null");
- delete $2;
- }
- | ICMP IPredicates Types ValueRef ',' ValueRef {
- if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*$3)->getDescription());
- if (isa<VectorType>((*$3).get()))
- GEN_ERROR("Vector types not supported by icmp instruction");
- Value* tmpVal1 = getVal(*$3, $4);
- CHECK_FOR_ERROR
- Value* tmpVal2 = getVal(*$3, $6);
- CHECK_FOR_ERROR
- $$ = CmpInst::create($1, $2, tmpVal1, tmpVal2);
- if ($$ == 0)
- GEN_ERROR("icmp operator returned null");
- delete $3;
- }
- | FCMP FPredicates Types ValueRef ',' ValueRef {
- if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*$3)->getDescription());
- if (isa<VectorType>((*$3).get()))
- GEN_ERROR("Vector types not supported by fcmp instruction");
- Value* tmpVal1 = getVal(*$3, $4);
- CHECK_FOR_ERROR
- Value* tmpVal2 = getVal(*$3, $6);
- CHECK_FOR_ERROR
- $$ = CmpInst::create($1, $2, tmpVal1, tmpVal2);
- if ($$ == 0)
- GEN_ERROR("fcmp operator returned null");
- delete $3;
- }
- | CastOps ResolvedVal TO Types {
- if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*$4)->getDescription());
- Value* Val = $2;
- const Type* DestTy = $4->get();
- if (!CastInst::castIsValid($1, Val, DestTy))
- GEN_ERROR("invalid cast opcode for cast from '" +
- Val->getType()->getDescription() + "' to '" +
- DestTy->getDescription() + "'");
- $$ = CastInst::create($1, Val, DestTy);
- delete $4;
- }
- | SELECT ResolvedVal ',' ResolvedVal ',' ResolvedVal {
- if ($2->getType() != Type::Int1Ty)
- GEN_ERROR("select condition must be boolean");
- if ($4->getType() != $6->getType())
- GEN_ERROR("select value types should match");
- $$ = SelectInst::Create($2, $4, $6);
- CHECK_FOR_ERROR
- }
- | VAARG ResolvedVal ',' Types {
- if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*$4)->getDescription());
- $$ = new VAArgInst($2, *$4);
- delete $4;
- CHECK_FOR_ERROR
- }
- | EXTRACTELEMENT ResolvedVal ',' ResolvedVal {
- if (!ExtractElementInst::isValidOperands($2, $4))
- GEN_ERROR("Invalid extractelement operands");
- $$ = new ExtractElementInst($2, $4);
- CHECK_FOR_ERROR
- }
- | INSERTELEMENT ResolvedVal ',' ResolvedVal ',' ResolvedVal {
- if (!InsertElementInst::isValidOperands($2, $4, $6))
- GEN_ERROR("Invalid insertelement operands");
- $$ = InsertElementInst::Create($2, $4, $6);
- CHECK_FOR_ERROR
- }
- | SHUFFLEVECTOR ResolvedVal ',' ResolvedVal ',' ResolvedVal {
- if (!ShuffleVectorInst::isValidOperands($2, $4, $6))
- GEN_ERROR("Invalid shufflevector operands");
- $$ = new ShuffleVectorInst($2, $4, $6);
- CHECK_FOR_ERROR
- }
- | PHI_TOK PHIList {
- const Type *Ty = $2->front().first->getType();
- if (!Ty->isFirstClassType())
- GEN_ERROR("PHI node operands must be of first class type");
- $$ = PHINode::Create(Ty);
- ((PHINode*)$$)->reserveOperandSpace($2->size());
- while ($2->begin() != $2->end()) {
- if ($2->front().first->getType() != Ty)
- GEN_ERROR("All elements of a PHI node must be of the same type");
- cast<PHINode>($$)->addIncoming($2->front().first, $2->front().second);
- $2->pop_front();
- }
- delete $2; // Free the list...
- CHECK_FOR_ERROR
- }
- | OptTailCall OptCallingConv ResultTypes ValueRef '(' ParamList ')'
- OptFuncAttrs {
-
- // Handle the short syntax
- const PointerType *PFTy = 0;
- const FunctionType *Ty = 0;
- if (!(PFTy = dyn_cast<PointerType>($3->get())) ||
- !(Ty = dyn_cast<FunctionType>(PFTy->getElementType()))) {
- // Pull out the types of all of the arguments...
- std::vector<const Type*> ParamTypes;
- ParamList::iterator I = $6->begin(), E = $6->end();
- for (; I != E; ++I) {
- const Type *Ty = I->Val->getType();
- if (Ty == Type::VoidTy)
- GEN_ERROR("Short call syntax cannot be used with varargs");
- ParamTypes.push_back(Ty);
- }
-
- if (!FunctionType::isValidReturnType(*$3))
- GEN_ERROR("Invalid result type for LLVM function");
-
- Ty = FunctionType::get($3->get(), ParamTypes, false);
- PFTy = PointerType::getUnqual(Ty);
- }
-
- Value *V = getVal(PFTy, $4); // Get the function we're calling...
- CHECK_FOR_ERROR
-
- // Check for call to invalid intrinsic to avoid crashing later.
- if (Function *theF = dyn_cast<Function>(V)) {
- if (theF->hasName() && (theF->getValueName()->getKeyLength() >= 5) &&
- (0 == strncmp(theF->getValueName()->getKeyData(), "llvm.", 5)) &&
- !theF->getIntrinsicID(true))
- GEN_ERROR("Call to invalid LLVM intrinsic function '" +
- theF->getName() + "'");
- }
-
- // Set up the ParamAttrs for the function
- SmallVector<ParamAttrsWithIndex, 8> Attrs;
- if ($8 != ParamAttr::None)
- Attrs.push_back(ParamAttrsWithIndex::get(0, $8));
- // Check the arguments
- ValueList Args;
- if ($6->empty()) { // Has no arguments?
- // Make sure no arguments is a good thing!
- if (Ty->getNumParams() != 0)
- GEN_ERROR("No arguments passed to a function that "
- "expects arguments");
- } else { // Has arguments?
- // Loop through FunctionType's arguments and ensure they are specified
- // correctly. Also, gather any parameter attributes.
- FunctionType::param_iterator I = Ty->param_begin();
- FunctionType::param_iterator E = Ty->param_end();
- ParamList::iterator ArgI = $6->begin(), ArgE = $6->end();
- unsigned index = 1;
-
- for (; ArgI != ArgE && I != E; ++ArgI, ++I, ++index) {
- if (ArgI->Val->getType() != *I)
- GEN_ERROR("Parameter " + ArgI->Val->getName()+ " is not of type '" +
- (*I)->getDescription() + "'");
- Args.push_back(ArgI->Val);
- if (ArgI->Attrs != ParamAttr::None)
- Attrs.push_back(ParamAttrsWithIndex::get(index, ArgI->Attrs));
- }
- if (Ty->isVarArg()) {
- if (I == E)
- for (; ArgI != ArgE; ++ArgI, ++index) {
- Args.push_back(ArgI->Val); // push the remaining varargs
- if (ArgI->Attrs != ParamAttr::None)
- Attrs.push_back(ParamAttrsWithIndex::get(index, ArgI->Attrs));
- }
- } else if (I != E || ArgI != ArgE)
- GEN_ERROR("Invalid number of parameters detected");
- }
-
- // Finish off the ParamAttrs and check them
- PAListPtr PAL;
- if (!Attrs.empty())
- PAL = PAListPtr::get(Attrs.begin(), Attrs.end());
-
- // Create the call node
- CallInst *CI = CallInst::Create(V, Args.begin(), Args.end());
- CI->setTailCall($1);
- CI->setCallingConv($2);
- CI->setParamAttrs(PAL);
- $$ = CI;
- delete $6;
- delete $3;
- CHECK_FOR_ERROR
- }
- | MemoryInst {
- $$ = $1;
- CHECK_FOR_ERROR
- };
-
-OptVolatile : VOLATILE {
- $$ = true;
- CHECK_FOR_ERROR
- }
- | /* empty */ {
- $$ = false;
- CHECK_FOR_ERROR
- };
-
-
-
-MemoryInst : MALLOC Types OptCAlign {
- if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*$2)->getDescription());
- $$ = new MallocInst(*$2, 0, $3);
- delete $2;
- CHECK_FOR_ERROR
- }
- | MALLOC Types ',' INTTYPE ValueRef OptCAlign {
- if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*$2)->getDescription());
- Value* tmpVal = getVal($4, $5);
- CHECK_FOR_ERROR
- $$ = new MallocInst(*$2, tmpVal, $6);
- delete $2;
- }
- | ALLOCA Types OptCAlign {
- if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*$2)->getDescription());
- $$ = new AllocaInst(*$2, 0, $3);
- delete $2;
- CHECK_FOR_ERROR
- }
- | ALLOCA Types ',' INTTYPE ValueRef OptCAlign {
- if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*$2)->getDescription());
- Value* tmpVal = getVal($4, $5);
- CHECK_FOR_ERROR
- $$ = new AllocaInst(*$2, tmpVal, $6);
- delete $2;
- }
- | FREE ResolvedVal {
- if (!isa<PointerType>($2->getType()))
- GEN_ERROR("Trying to free nonpointer type " +
- $2->getType()->getDescription() + "");
- $$ = new FreeInst($2);
- CHECK_FOR_ERROR
- }
-
- | OptVolatile LOAD Types ValueRef OptCAlign {
- if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*$3)->getDescription());
- if (!isa<PointerType>($3->get()))
- GEN_ERROR("Can't load from nonpointer type: " +
- (*$3)->getDescription());
- if (!cast<PointerType>($3->get())->getElementType()->isFirstClassType())
- GEN_ERROR("Can't load from pointer of non-first-class type: " +
- (*$3)->getDescription());
- Value* tmpVal = getVal(*$3, $4);
- CHECK_FOR_ERROR
- $$ = new LoadInst(tmpVal, "", $1, $5);
- delete $3;
- }
- | OptVolatile STORE ResolvedVal ',' Types ValueRef OptCAlign {
- if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*$5)->getDescription());
- const PointerType *PT = dyn_cast<PointerType>($5->get());
- if (!PT)
- GEN_ERROR("Can't store to a nonpointer type: " +
- (*$5)->getDescription());
- const Type *ElTy = PT->getElementType();
- if (ElTy != $3->getType())
- GEN_ERROR("Can't store '" + $3->getType()->getDescription() +
- "' into space of type '" + ElTy->getDescription() + "'");
-
- Value* tmpVal = getVal(*$5, $6);
- CHECK_FOR_ERROR
- $$ = new StoreInst($3, tmpVal, $1, $7);
- delete $5;
- }
-| GETRESULT Types ValueRef ',' EUINT64VAL {
- Value *TmpVal = getVal($2->get(), $3);
- if (!GetResultInst::isValidOperands(TmpVal, $5))
- GEN_ERROR("Invalid getresult operands");
- $$ = new GetResultInst(TmpVal, $5);
- delete $2;
- CHECK_FOR_ERROR
- }
- | GETELEMENTPTR Types ValueRef IndexList {
- if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*$2)->getDescription());
- if (!isa<PointerType>($2->get()))
- GEN_ERROR("getelementptr insn requires pointer operand");
-
- if (!GetElementPtrInst::getIndexedType(*$2, $4->begin(), $4->end(), true))
- GEN_ERROR("Invalid getelementptr indices for type '" +
- (*$2)->getDescription()+ "'");
- Value* tmpVal = getVal(*$2, $3);
- CHECK_FOR_ERROR
- $$ = GetElementPtrInst::Create(tmpVal, $4->begin(), $4->end());
- delete $2;
- delete $4;
- };
-
-
-%%
-
-// common code from the two 'RunVMAsmParser' functions
-static Module* RunParser(Module * M) {
- CurModule.CurrentModule = M;
- // Check to make sure the parser succeeded
- if (yyparse()) {
- if (ParserResult)
- delete ParserResult;
- return 0;
- }
-
- // Emit an error if there are any unresolved types left.
- if (!CurModule.LateResolveTypes.empty()) {
- const ValID &DID = CurModule.LateResolveTypes.begin()->first;
- if (DID.Type == ValID::LocalName) {
- GenerateError("Undefined type remains at eof: '"+DID.getName() + "'");
- } else {
- GenerateError("Undefined type remains at eof: #" + itostr(DID.Num));
- }
- if (ParserResult)
- delete ParserResult;
- return 0;
- }
-
- // Emit an error if there are any unresolved values left.
- if (!CurModule.LateResolveValues.empty()) {
- Value *V = CurModule.LateResolveValues.back();
- std::map<Value*, std::pair<ValID, int> >::iterator I =
- CurModule.PlaceHolderInfo.find(V);
-
- if (I != CurModule.PlaceHolderInfo.end()) {
- ValID &DID = I->second.first;
- if (DID.Type == ValID::LocalName) {
- GenerateError("Undefined value remains at eof: "+DID.getName() + "'");
- } else {
- GenerateError("Undefined value remains at eof: #" + itostr(DID.Num));
- }
- if (ParserResult)
- delete ParserResult;
- return 0;
- }
- }
-
- // Check to make sure that parsing produced a result
- if (!ParserResult)
- return 0;
-
- // Reset ParserResult variable while saving its value for the result.
- Module *Result = ParserResult;
- ParserResult = 0;
-
- return Result;
-}
-
-void llvm::GenerateError(const std::string &message, int LineNo) {
- if (LineNo == -1) LineNo = LLLgetLineNo();
- // TODO: column number in exception
- if (TheParseError)
- TheParseError->setError(LLLgetFilename(), message, LineNo);
- TriggerError = 1;
-}
-
-int yyerror(const char *ErrorMsg) {
- std::string where = LLLgetFilename() + ":" + utostr(LLLgetLineNo()) + ": ";
- std::string errMsg = where + "error: " + std::string(ErrorMsg);
- if (yychar != YYEMPTY && yychar != 0) {
- errMsg += " while reading token: '";
- errMsg += std::string(LLLgetTokenStart(),
- LLLgetTokenStart()+LLLgetTokenLength()) + "'";
- }
- GenerateError(errMsg);
- return 0;
-}
diff --git a/release_23/lib/AsmParser/llvmAsmParser.y.cvs b/release_23/lib/AsmParser/llvmAsmParser.y.cvs
deleted file mode 100644
index f3a59ee0a6e8..000000000000
--- a/release_23/lib/AsmParser/llvmAsmParser.y.cvs
+++ /dev/null
@@ -1,3227 +0,0 @@
-//===-- llvmAsmParser.y - Parser for llvm assembly files --------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the bison parser for LLVM assembly languages files.
-//
-//===----------------------------------------------------------------------===//
-
-%{
-#include "ParserInternals.h"
-#include "llvm/CallingConv.h"
-#include "llvm/InlineAsm.h"
-#include "llvm/Instructions.h"
-#include "llvm/Module.h"
-#include "llvm/ValueSymbolTable.h"
-#include "llvm/AutoUpgrade.h"
-#include "llvm/Support/GetElementPtrTypeIterator.h"
-#include "llvm/Support/CommandLine.h"
-#include "llvm/ADT/SmallVector.h"
-#include "llvm/ADT/STLExtras.h"
-#include "llvm/Support/MathExtras.h"
-#include "llvm/Support/Streams.h"
-#include <algorithm>
-#include <list>
-#include <map>
-#include <utility>
-
-// The following is a gross hack. In order to rid the libAsmParser library of
-// exceptions, we have to have a way of getting the yyparse function to go into
-// an error situation. So, whenever we want an error to occur, the GenerateError
-// function (see bottom of file) sets TriggerError. Then, at the end of each
-// production in the grammer we use CHECK_FOR_ERROR which will invoke YYERROR
-// (a goto) to put YACC in error state. Furthermore, several calls to
-// GenerateError are made from inside productions and they must simulate the
-// previous exception behavior by exiting the production immediately. We have
-// replaced these with the GEN_ERROR macro which calls GeneratError and then
-// immediately invokes YYERROR. This would be so much cleaner if it was a
-// recursive descent parser.
-static bool TriggerError = false;
-#define CHECK_FOR_ERROR { if (TriggerError) { TriggerError = false; YYABORT; } }
-#define GEN_ERROR(msg) { GenerateError(msg); YYERROR; }
-
-int yyerror(const char *ErrorMsg); // Forward declarations to prevent "implicit
-int yylex(); // declaration" of xxx warnings.
-int yyparse();
-using namespace llvm;
-
-static Module *ParserResult;
-
-// DEBUG_UPREFS - Define this symbol if you want to enable debugging output
-// relating to upreferences in the input stream.
-//
-//#define DEBUG_UPREFS 1
-#ifdef DEBUG_UPREFS
-#define UR_OUT(X) cerr << X
-#else
-#define UR_OUT(X)
-#endif
-
-#define YYERROR_VERBOSE 1
-
-static GlobalVariable *CurGV;
-
-
-// This contains info used when building the body of a function. It is
-// destroyed when the function is completed.
-//
-typedef std::vector<Value *> ValueList; // Numbered defs
-
-static void
-ResolveDefinitions(ValueList &LateResolvers, ValueList *FutureLateResolvers=0);
-
-static struct PerModuleInfo {
- Module *CurrentModule;
- ValueList Values; // Module level numbered definitions
- ValueList LateResolveValues;
- std::vector<PATypeHolder> Types;
- std::map<ValID, PATypeHolder> LateResolveTypes;
-
- /// PlaceHolderInfo - When temporary placeholder objects are created, remember
- /// how they were referenced and on which line of the input they came from so
- /// that we can resolve them later and print error messages as appropriate.
- std::map<Value*, std::pair<ValID, int> > PlaceHolderInfo;
-
- // GlobalRefs - This maintains a mapping between <Type, ValID>'s and forward
- // references to global values. Global values may be referenced before they
- // are defined, and if so, the temporary object that they represent is held
- // here. This is used for forward references of GlobalValues.
- //
- typedef std::map<std::pair<const PointerType *,
- ValID>, GlobalValue*> GlobalRefsType;
- GlobalRefsType GlobalRefs;
-
- void ModuleDone() {
- // If we could not resolve some functions at function compilation time
- // (calls to functions before they are defined), resolve them now... Types
- // are resolved when the constant pool has been completely parsed.
- //
- ResolveDefinitions(LateResolveValues);
- if (TriggerError)
- return;
-
- // Check to make sure that all global value forward references have been
- // resolved!
- //
- if (!GlobalRefs.empty()) {
- std::string UndefinedReferences = "Unresolved global references exist:\n";
-
- for (GlobalRefsType::iterator I = GlobalRefs.begin(), E =GlobalRefs.end();
- I != E; ++I) {
- UndefinedReferences += " " + I->first.first->getDescription() + " " +
- I->first.second.getName() + "\n";
- }
- GenerateError(UndefinedReferences);
- return;
- }
-
- // Look for intrinsic functions and CallInst that need to be upgraded
- for (Module::iterator FI = CurrentModule->begin(),
- FE = CurrentModule->end(); FI != FE; )
- UpgradeCallsToIntrinsic(FI++); // must be post-increment, as we remove
-
- Values.clear(); // Clear out function local definitions
- Types.clear();
- CurrentModule = 0;
- }
-
- // GetForwardRefForGlobal - Check to see if there is a forward reference
- // for this global. If so, remove it from the GlobalRefs map and return it.
- // If not, just return null.
- GlobalValue *GetForwardRefForGlobal(const PointerType *PTy, ValID ID) {
- // Check to see if there is a forward reference to this global variable...
- // if there is, eliminate it and patch the reference to use the new def'n.
- GlobalRefsType::iterator I = GlobalRefs.find(std::make_pair(PTy, ID));
- GlobalValue *Ret = 0;
- if (I != GlobalRefs.end()) {
- Ret = I->second;
- GlobalRefs.erase(I);
- }
- return Ret;
- }
-
- bool TypeIsUnresolved(PATypeHolder* PATy) {
- // If it isn't abstract, its resolved
- const Type* Ty = PATy->get();
- if (!Ty->isAbstract())
- return false;
- // Traverse the type looking for abstract types. If it isn't abstract then
- // we don't need to traverse that leg of the type.
- std::vector<const Type*> WorkList, SeenList;
- WorkList.push_back(Ty);
- while (!WorkList.empty()) {
- const Type* Ty = WorkList.back();
- SeenList.push_back(Ty);
- WorkList.pop_back();
- if (const OpaqueType* OpTy = dyn_cast<OpaqueType>(Ty)) {
- // Check to see if this is an unresolved type
- std::map<ValID, PATypeHolder>::iterator I = LateResolveTypes.begin();
- std::map<ValID, PATypeHolder>::iterator E = LateResolveTypes.end();
- for ( ; I != E; ++I) {
- if (I->second.get() == OpTy)
- return true;
- }
- } else if (const SequentialType* SeqTy = dyn_cast<SequentialType>(Ty)) {
- const Type* TheTy = SeqTy->getElementType();
- if (TheTy->isAbstract() && TheTy != Ty) {
- std::vector<const Type*>::iterator I = SeenList.begin(),
- E = SeenList.end();
- for ( ; I != E; ++I)
- if (*I == TheTy)
- break;
- if (I == E)
- WorkList.push_back(TheTy);
- }
- } else if (const StructType* StrTy = dyn_cast<StructType>(Ty)) {
- for (unsigned i = 0; i < StrTy->getNumElements(); ++i) {
- const Type* TheTy = StrTy->getElementType(i);
- if (TheTy->isAbstract() && TheTy != Ty) {
- std::vector<const Type*>::iterator I = SeenList.begin(),
- E = SeenList.end();
- for ( ; I != E; ++I)
- if (*I == TheTy)
- break;
- if (I == E)
- WorkList.push_back(TheTy);
- }
- }
- }
- }
- return false;
- }
-} CurModule;
-
-static struct PerFunctionInfo {
- Function *CurrentFunction; // Pointer to current function being created
-
- ValueList Values; // Keep track of #'d definitions
- unsigned NextValNum;
- ValueList LateResolveValues;
- bool isDeclare; // Is this function a forward declararation?
- GlobalValue::LinkageTypes Linkage; // Linkage for forward declaration.
- GlobalValue::VisibilityTypes Visibility;
-
- /// BBForwardRefs - When we see forward references to basic blocks, keep
- /// track of them here.
- std::map<ValID, BasicBlock*> BBForwardRefs;
-
- inline PerFunctionInfo() {
- CurrentFunction = 0;
- isDeclare = false;
- Linkage = GlobalValue::ExternalLinkage;
- Visibility = GlobalValue::DefaultVisibility;
- }
-
- inline void FunctionStart(Function *M) {
- CurrentFunction = M;
- NextValNum = 0;
- }
-
- void FunctionDone() {
- // Any forward referenced blocks left?
- if (!BBForwardRefs.empty()) {
- GenerateError("Undefined reference to label " +
- BBForwardRefs.begin()->second->getName());
- return;
- }
-
- // Resolve all forward references now.
- ResolveDefinitions(LateResolveValues, &CurModule.LateResolveValues);
-
- Values.clear(); // Clear out function local definitions
- BBForwardRefs.clear();
- CurrentFunction = 0;
- isDeclare = false;
- Linkage = GlobalValue::ExternalLinkage;
- Visibility = GlobalValue::DefaultVisibility;
- }
-} CurFun; // Info for the current function...
-
-static bool inFunctionScope() { return CurFun.CurrentFunction != 0; }
-
-
-//===----------------------------------------------------------------------===//
-// Code to handle definitions of all the types
-//===----------------------------------------------------------------------===//
-
-static void InsertValue(Value *V, ValueList &ValueTab = CurFun.Values) {
- // Things that have names or are void typed don't get slot numbers
- if (V->hasName() || (V->getType() == Type::VoidTy))
- return;
-
- // In the case of function values, we have to allow for the forward reference
- // of basic blocks, which are included in the numbering. Consequently, we keep
- // track of the next insertion location with NextValNum. When a BB gets
- // inserted, it could change the size of the CurFun.Values vector.
- if (&ValueTab == &CurFun.Values) {
- if (ValueTab.size() <= CurFun.NextValNum)
- ValueTab.resize(CurFun.NextValNum+1);
- ValueTab[CurFun.NextValNum++] = V;
- return;
- }
- // For all other lists, its okay to just tack it on the back of the vector.
- ValueTab.push_back(V);
-}
-
-static const Type *getTypeVal(const ValID &D, bool DoNotImprovise = false) {
- switch (D.Type) {
- case ValID::LocalID: // Is it a numbered definition?
- // Module constants occupy the lowest numbered slots...
- if (D.Num < CurModule.Types.size())
- return CurModule.Types[D.Num];
- break;
- case ValID::LocalName: // Is it a named definition?
- if (const Type *N = CurModule.CurrentModule->getTypeByName(D.getName())) {
- D.destroy(); // Free old strdup'd memory...
- return N;
- }
- break;
- default:
- GenerateError("Internal parser error: Invalid symbol type reference");
- return 0;
- }
-
- // If we reached here, we referenced either a symbol that we don't know about
- // or an id number that hasn't been read yet. We may be referencing something
- // forward, so just create an entry to be resolved later and get to it...
- //
- if (DoNotImprovise) return 0; // Do we just want a null to be returned?
-
-
- if (inFunctionScope()) {
- if (D.Type == ValID::LocalName) {
- GenerateError("Reference to an undefined type: '" + D.getName() + "'");
- return 0;
- } else {
- GenerateError("Reference to an undefined type: #" + utostr(D.Num));
- return 0;
- }
- }
-
- std::map<ValID, PATypeHolder>::iterator I =CurModule.LateResolveTypes.find(D);
- if (I != CurModule.LateResolveTypes.end())
- return I->second;
-
- Type *Typ = OpaqueType::get();
- CurModule.LateResolveTypes.insert(std::make_pair(D, Typ));
- return Typ;
- }
-
-// getExistingVal - Look up the value specified by the provided type and
-// the provided ValID. If the value exists and has already been defined, return
-// it. Otherwise return null.
-//
-static Value *getExistingVal(const Type *Ty, const ValID &D) {
- if (isa<FunctionType>(Ty)) {
- GenerateError("Functions are not values and "
- "must be referenced as pointers");
- return 0;
- }
-
- switch (D.Type) {
- case ValID::LocalID: { // Is it a numbered definition?
- // Check that the number is within bounds.
- if (D.Num >= CurFun.Values.size())
- return 0;
- Value *Result = CurFun.Values[D.Num];
- if (Ty != Result->getType()) {
- GenerateError("Numbered value (%" + utostr(D.Num) + ") of type '" +
- Result->getType()->getDescription() + "' does not match "
- "expected type, '" + Ty->getDescription() + "'");
- return 0;
- }
- return Result;
- }
- case ValID::GlobalID: { // Is it a numbered definition?
- if (D.Num >= CurModule.Values.size())
- return 0;
- Value *Result = CurModule.Values[D.Num];
- if (Ty != Result->getType()) {
- GenerateError("Numbered value (@" + utostr(D.Num) + ") of type '" +
- Result->getType()->getDescription() + "' does not match "
- "expected type, '" + Ty->getDescription() + "'");
- return 0;
- }
- return Result;
- }
-
- case ValID::LocalName: { // Is it a named definition?
- if (!inFunctionScope())
- return 0;
- ValueSymbolTable &SymTab = CurFun.CurrentFunction->getValueSymbolTable();
- Value *N = SymTab.lookup(D.getName());
- if (N == 0)
- return 0;
- if (N->getType() != Ty)
- return 0;
-
- D.destroy(); // Free old strdup'd memory...
- return N;
- }
- case ValID::GlobalName: { // Is it a named definition?
- ValueSymbolTable &SymTab = CurModule.CurrentModule->getValueSymbolTable();
- Value *N = SymTab.lookup(D.getName());
- if (N == 0)
- return 0;
- if (N->getType() != Ty)
- return 0;
-
- D.destroy(); // Free old strdup'd memory...
- return N;
- }
-
- // Check to make sure that "Ty" is an integral type, and that our
- // value will fit into the specified type...
- case ValID::ConstSIntVal: // Is it a constant pool reference??
- if (!isa<IntegerType>(Ty) ||
- !ConstantInt::isValueValidForType(Ty, D.ConstPool64)) {
- GenerateError("Signed integral constant '" +
- itostr(D.ConstPool64) + "' is invalid for type '" +
- Ty->getDescription() + "'");
- return 0;
- }
- return ConstantInt::get(Ty, D.ConstPool64, true);
-
- case ValID::ConstUIntVal: // Is it an unsigned const pool reference?
- if (isa<IntegerType>(Ty) &&
- ConstantInt::isValueValidForType(Ty, D.UConstPool64))
- return ConstantInt::get(Ty, D.UConstPool64);
-
- if (!isa<IntegerType>(Ty) ||
- !ConstantInt::isValueValidForType(Ty, D.ConstPool64)) {
- GenerateError("Integral constant '" + utostr(D.UConstPool64) +
- "' is invalid or out of range for type '" +
- Ty->getDescription() + "'");
- return 0;
- }
- // This is really a signed reference. Transmogrify.
- return ConstantInt::get(Ty, D.ConstPool64, true);
-
- case ValID::ConstFPVal: // Is it a floating point const pool reference?
- if (!Ty->isFloatingPoint() ||
- !ConstantFP::isValueValidForType(Ty, *D.ConstPoolFP)) {
- GenerateError("FP constant invalid for type");
- return 0;
- }
- // Lexer has no type info, so builds all float and double FP constants
- // as double. Fix this here. Long double does not need this.
- if (&D.ConstPoolFP->getSemantics() == &APFloat::IEEEdouble &&
- Ty==Type::FloatTy)
- D.ConstPoolFP->convert(APFloat::IEEEsingle, APFloat::rmNearestTiesToEven);
- return ConstantFP::get(*D.ConstPoolFP);
-
- case ValID::ConstNullVal: // Is it a null value?
- if (!isa<PointerType>(Ty)) {
- GenerateError("Cannot create a a non pointer null");
- return 0;
- }
- return ConstantPointerNull::get(cast<PointerType>(Ty));
-
- case ValID::ConstUndefVal: // Is it an undef value?
- return UndefValue::get(Ty);
-
- case ValID::ConstZeroVal: // Is it a zero value?
- return Constant::getNullValue(Ty);
-
- case ValID::ConstantVal: // Fully resolved constant?
- if (D.ConstantValue->getType() != Ty) {
- GenerateError("Constant expression type different from required type");
- return 0;
- }
- return D.ConstantValue;
-
- case ValID::InlineAsmVal: { // Inline asm expression
- const PointerType *PTy = dyn_cast<PointerType>(Ty);
- const FunctionType *FTy =
- PTy ? dyn_cast<FunctionType>(PTy->getElementType()) : 0;
- if (!FTy || !InlineAsm::Verify(FTy, D.IAD->Constraints)) {
- GenerateError("Invalid type for asm constraint string");
- return 0;
- }
- InlineAsm *IA = InlineAsm::get(FTy, D.IAD->AsmString, D.IAD->Constraints,
- D.IAD->HasSideEffects);
- D.destroy(); // Free InlineAsmDescriptor.
- return IA;
- }
- default:
- assert(0 && "Unhandled case!");
- return 0;
- } // End of switch
-
- assert(0 && "Unhandled case!");
- return 0;
-}
-
-// getVal - This function is identical to getExistingVal, except that if a
-// value is not already defined, it "improvises" by creating a placeholder var
-// that looks and acts just like the requested variable. When the value is
-// defined later, all uses of the placeholder variable are replaced with the
-// real thing.
-//
-static Value *getVal(const Type *Ty, const ValID &ID) {
- if (Ty == Type::LabelTy) {
- GenerateError("Cannot use a basic block here");
- return 0;
- }
-
- // See if the value has already been defined.
- Value *V = getExistingVal(Ty, ID);
- if (V) return V;
- if (TriggerError) return 0;
-
- if (!Ty->isFirstClassType() && !isa<OpaqueType>(Ty)) {
- GenerateError("Invalid use of a composite type");
- return 0;
- }
-
- // If we reached here, we referenced either a symbol that we don't know about
- // or an id number that hasn't been read yet. We may be referencing something
- // forward, so just create an entry to be resolved later and get to it...
- //
- switch (ID.Type) {
- case ValID::GlobalName:
- case ValID::GlobalID: {
- const PointerType *PTy = dyn_cast<PointerType>(Ty);
- if (!PTy) {
- GenerateError("Invalid type for reference to global" );
- return 0;
- }
- const Type* ElTy = PTy->getElementType();
- if (const FunctionType *FTy = dyn_cast<FunctionType>(ElTy))
- V = Function::Create(FTy, GlobalValue::ExternalLinkage);
- else
- V = new GlobalVariable(ElTy, false, GlobalValue::ExternalLinkage, 0, "",
- (Module*)0, false, PTy->getAddressSpace());
- break;
- }
- default:
- V = new Argument(Ty);
- }
-
- // Remember where this forward reference came from. FIXME, shouldn't we try
- // to recycle these things??
- CurModule.PlaceHolderInfo.insert(std::make_pair(V, std::make_pair(ID,
- LLLgetLineNo())));
-
- if (inFunctionScope())
- InsertValue(V, CurFun.LateResolveValues);
- else
- InsertValue(V, CurModule.LateResolveValues);
- return V;
-}
-
-/// defineBBVal - This is a definition of a new basic block with the specified
-/// identifier which must be the same as CurFun.NextValNum, if its numeric.
-static BasicBlock *defineBBVal(const ValID &ID) {
- assert(inFunctionScope() && "Can't get basic block at global scope!");
-
- BasicBlock *BB = 0;
-
- // First, see if this was forward referenced
-
- std::map<ValID, BasicBlock*>::iterator BBI = CurFun.BBForwardRefs.find(ID);
- if (BBI != CurFun.BBForwardRefs.end()) {
- BB = BBI->second;
- // The forward declaration could have been inserted anywhere in the
- // function: insert it into the correct place now.
- CurFun.CurrentFunction->getBasicBlockList().remove(BB);
- CurFun.CurrentFunction->getBasicBlockList().push_back(BB);
-
- // We're about to erase the entry, save the key so we can clean it up.
- ValID Tmp = BBI->first;
-
- // Erase the forward ref from the map as its no longer "forward"
- CurFun.BBForwardRefs.erase(ID);
-
- // The key has been removed from the map but so we don't want to leave
- // strdup'd memory around so destroy it too.
- Tmp.destroy();
-
- // If its a numbered definition, bump the number and set the BB value.
- if (ID.Type == ValID::LocalID) {
- assert(ID.Num == CurFun.NextValNum && "Invalid new block number");
- InsertValue(BB);
- }
- } else {
- // We haven't seen this BB before and its first mention is a definition.
- // Just create it and return it.
- std::string Name (ID.Type == ValID::LocalName ? ID.getName() : "");
- BB = BasicBlock::Create(Name, CurFun.CurrentFunction);
- if (ID.Type == ValID::LocalID) {
- assert(ID.Num == CurFun.NextValNum && "Invalid new block number");
- InsertValue(BB);
- }
- }
-
- ID.destroy();
- return BB;
-}
-
-/// getBBVal - get an existing BB value or create a forward reference for it.
-///
-static BasicBlock *getBBVal(const ValID &ID) {
- assert(inFunctionScope() && "Can't get basic block at global scope!");
-
- BasicBlock *BB = 0;
-
- std::map<ValID, BasicBlock*>::iterator BBI = CurFun.BBForwardRefs.find(ID);
- if (BBI != CurFun.BBForwardRefs.end()) {
- BB = BBI->second;
- } if (ID.Type == ValID::LocalName) {
- std::string Name = ID.getName();
- Value *N = CurFun.CurrentFunction->getValueSymbolTable().lookup(Name);
- if (N) {
- if (N->getType()->getTypeID() == Type::LabelTyID)
- BB = cast<BasicBlock>(N);
- else
- GenerateError("Reference to label '" + Name + "' is actually of type '"+
- N->getType()->getDescription() + "'");
- }
- } else if (ID.Type == ValID::LocalID) {
- if (ID.Num < CurFun.NextValNum && ID.Num < CurFun.Values.size()) {
- if (CurFun.Values[ID.Num]->getType()->getTypeID() == Type::LabelTyID)
- BB = cast<BasicBlock>(CurFun.Values[ID.Num]);
- else
- GenerateError("Reference to label '%" + utostr(ID.Num) +
- "' is actually of type '"+
- CurFun.Values[ID.Num]->getType()->getDescription() + "'");
- }
- } else {
- GenerateError("Illegal label reference " + ID.getName());
- return 0;
- }
-
- // If its already been defined, return it now.
- if (BB) {
- ID.destroy(); // Free strdup'd memory.
- return BB;
- }
-
- // Otherwise, this block has not been seen before, create it.
- std::string Name;
- if (ID.Type == ValID::LocalName)
- Name = ID.getName();
- BB = BasicBlock::Create(Name, CurFun.CurrentFunction);
-
- // Insert it in the forward refs map.
- CurFun.BBForwardRefs[ID] = BB;
-
- return BB;
-}
-
-
-//===----------------------------------------------------------------------===//
-// Code to handle forward references in instructions
-//===----------------------------------------------------------------------===//
-//
-// This code handles the late binding needed with statements that reference
-// values not defined yet... for example, a forward branch, or the PHI node for
-// a loop body.
-//
-// This keeps a table (CurFun.LateResolveValues) of all such forward references
-// and back patchs after we are done.
-//
-
-// ResolveDefinitions - If we could not resolve some defs at parsing
-// time (forward branches, phi functions for loops, etc...) resolve the
-// defs now...
-//
-static void
-ResolveDefinitions(ValueList &LateResolvers, ValueList *FutureLateResolvers) {
- // Loop over LateResolveDefs fixing up stuff that couldn't be resolved
- while (!LateResolvers.empty()) {
- Value *V = LateResolvers.back();
- LateResolvers.pop_back();
-
- std::map<Value*, std::pair<ValID, int> >::iterator PHI =
- CurModule.PlaceHolderInfo.find(V);
- assert(PHI != CurModule.PlaceHolderInfo.end() && "Placeholder error!");
-
- ValID &DID = PHI->second.first;
-
- Value *TheRealValue = getExistingVal(V->getType(), DID);
- if (TriggerError)
- return;
- if (TheRealValue) {
- V->replaceAllUsesWith(TheRealValue);
- delete V;
- CurModule.PlaceHolderInfo.erase(PHI);
- } else if (FutureLateResolvers) {
- // Functions have their unresolved items forwarded to the module late
- // resolver table
- InsertValue(V, *FutureLateResolvers);
- } else {
- if (DID.Type == ValID::LocalName || DID.Type == ValID::GlobalName) {
- GenerateError("Reference to an invalid definition: '" +DID.getName()+
- "' of type '" + V->getType()->getDescription() + "'",
- PHI->second.second);
- return;
- } else {
- GenerateError("Reference to an invalid definition: #" +
- itostr(DID.Num) + " of type '" +
- V->getType()->getDescription() + "'",
- PHI->second.second);
- return;
- }
- }
- }
- LateResolvers.clear();
-}
-
-// ResolveTypeTo - A brand new type was just declared. This means that (if
-// name is not null) things referencing Name can be resolved. Otherwise, things
-// refering to the number can be resolved. Do this now.
-//
-static void ResolveTypeTo(std::string *Name, const Type *ToTy) {
- ValID D;
- if (Name)
- D = ValID::createLocalName(*Name);
- else
- D = ValID::createLocalID(CurModule.Types.size());
-
- std::map<ValID, PATypeHolder>::iterator I =
- CurModule.LateResolveTypes.find(D);
- if (I != CurModule.LateResolveTypes.end()) {
- ((DerivedType*)I->second.get())->refineAbstractTypeTo(ToTy);
- CurModule.LateResolveTypes.erase(I);
- }
-}
-
-// setValueName - Set the specified value to the name given. The name may be
-// null potentially, in which case this is a noop. The string passed in is
-// assumed to be a malloc'd string buffer, and is free'd by this function.
-//
-static void setValueName(Value *V, std::string *NameStr) {
- if (!NameStr) return;
- std::string Name(*NameStr); // Copy string
- delete NameStr; // Free old string
-
- if (V->getType() == Type::VoidTy) {
- GenerateError("Can't assign name '" + Name+"' to value with void type");
- return;
- }
-
- assert(inFunctionScope() && "Must be in function scope!");
- ValueSymbolTable &ST = CurFun.CurrentFunction->getValueSymbolTable();
- if (ST.lookup(Name)) {
- GenerateError("Redefinition of value '" + Name + "' of type '" +
- V->getType()->getDescription() + "'");
- return;
- }
-
- // Set the name.
- V->setName(Name);
-}
-
-/// ParseGlobalVariable - Handle parsing of a global. If Initializer is null,
-/// this is a declaration, otherwise it is a definition.
-static GlobalVariable *
-ParseGlobalVariable(std::string *NameStr,
- GlobalValue::LinkageTypes Linkage,
- GlobalValue::VisibilityTypes Visibility,
- bool isConstantGlobal, const Type *Ty,
- Constant *Initializer, bool IsThreadLocal,
- unsigned AddressSpace = 0) {
- if (isa<FunctionType>(Ty)) {
- GenerateError("Cannot declare global vars of function type");
- return 0;
- }
-
- const PointerType *PTy = PointerType::get(Ty, AddressSpace);
-
- std::string Name;
- if (NameStr) {
- Name = *NameStr; // Copy string
- delete NameStr; // Free old string
- }
-
- // See if this global value was forward referenced. If so, recycle the
- // object.
- ValID ID;
- if (!Name.empty()) {
- ID = ValID::createGlobalName(Name);
- } else {
- ID = ValID::createGlobalID(CurModule.Values.size());
- }
-
- if (GlobalValue *FWGV = CurModule.GetForwardRefForGlobal(PTy, ID)) {
- // Move the global to the end of the list, from whereever it was
- // previously inserted.
- GlobalVariable *GV = cast<GlobalVariable>(FWGV);
- CurModule.CurrentModule->getGlobalList().remove(GV);
- CurModule.CurrentModule->getGlobalList().push_back(GV);
- GV->setInitializer(Initializer);
- GV->setLinkage(Linkage);
- GV->setVisibility(Visibility);
- GV->setConstant(isConstantGlobal);
- GV->setThreadLocal(IsThreadLocal);
- InsertValue(GV, CurModule.Values);
- return GV;
- }
-
- // If this global has a name
- if (!Name.empty()) {
- // if the global we're parsing has an initializer (is a definition) and
- // has external linkage.
- if (Initializer && Linkage != GlobalValue::InternalLinkage)
- // If there is already a global with external linkage with this name
- if (CurModule.CurrentModule->getGlobalVariable(Name, false)) {
- // If we allow this GVar to get created, it will be renamed in the
- // symbol table because it conflicts with an existing GVar. We can't
- // allow redefinition of GVars whose linking indicates that their name
- // must stay the same. Issue the error.
- GenerateError("Redefinition of global variable named '" + Name +
- "' of type '" + Ty->getDescription() + "'");
- return 0;
- }
- }
-
- // Otherwise there is no existing GV to use, create one now.
- GlobalVariable *GV =
- new GlobalVariable(Ty, isConstantGlobal, Linkage, Initializer, Name,
- CurModule.CurrentModule, IsThreadLocal, AddressSpace);
- GV->setVisibility(Visibility);
- InsertValue(GV, CurModule.Values);
- return GV;
-}
-
-// setTypeName - Set the specified type to the name given. The name may be
-// null potentially, in which case this is a noop. The string passed in is
-// assumed to be a malloc'd string buffer, and is freed by this function.
-//
-// This function returns true if the type has already been defined, but is
-// allowed to be redefined in the specified context. If the name is a new name
-// for the type plane, it is inserted and false is returned.
-static bool setTypeName(const Type *T, std::string *NameStr) {
- assert(!inFunctionScope() && "Can't give types function-local names!");
- if (NameStr == 0) return false;
-
- std::string Name(*NameStr); // Copy string
- delete NameStr; // Free old string
-
- // We don't allow assigning names to void type
- if (T == Type::VoidTy) {
- GenerateError("Can't assign name '" + Name + "' to the void type");
- return false;
- }
-
- // Set the type name, checking for conflicts as we do so.
- bool AlreadyExists = CurModule.CurrentModule->addTypeName(Name, T);
-
- if (AlreadyExists) { // Inserting a name that is already defined???
- const Type *Existing = CurModule.CurrentModule->getTypeByName(Name);
- assert(Existing && "Conflict but no matching type?!");
-
- // There is only one case where this is allowed: when we are refining an
- // opaque type. In this case, Existing will be an opaque type.
- if (const OpaqueType *OpTy = dyn_cast<OpaqueType>(Existing)) {
- // We ARE replacing an opaque type!
- const_cast<OpaqueType*>(OpTy)->refineAbstractTypeTo(T);
- return true;
- }
-
- // Otherwise, this is an attempt to redefine a type. That's okay if
- // the redefinition is identical to the original. This will be so if
- // Existing and T point to the same Type object. In this one case we
- // allow the equivalent redefinition.
- if (Existing == T) return true; // Yes, it's equal.
-
- // Any other kind of (non-equivalent) redefinition is an error.
- GenerateError("Redefinition of type named '" + Name + "' of type '" +
- T->getDescription() + "'");
- }
-
- return false;
-}
-
-//===----------------------------------------------------------------------===//
-// Code for handling upreferences in type names...
-//
-
-// TypeContains - Returns true if Ty directly contains E in it.
-//
-static bool TypeContains(const Type *Ty, const Type *E) {
- return std::find(Ty->subtype_begin(), Ty->subtype_end(),
- E) != Ty->subtype_end();
-}
-
-namespace {
- struct UpRefRecord {
- // NestingLevel - The number of nesting levels that need to be popped before
- // this type is resolved.
- unsigned NestingLevel;
-
- // LastContainedTy - This is the type at the current binding level for the
- // type. Every time we reduce the nesting level, this gets updated.
- const Type *LastContainedTy;
-
- // UpRefTy - This is the actual opaque type that the upreference is
- // represented with.
- OpaqueType *UpRefTy;
-
- UpRefRecord(unsigned NL, OpaqueType *URTy)
- : NestingLevel(NL), LastContainedTy(URTy), UpRefTy(URTy) {}
- };
-}
-
-// UpRefs - A list of the outstanding upreferences that need to be resolved.
-static std::vector<UpRefRecord> UpRefs;
-
-/// HandleUpRefs - Every time we finish a new layer of types, this function is
-/// called. It loops through the UpRefs vector, which is a list of the
-/// currently active types. For each type, if the up reference is contained in
-/// the newly completed type, we decrement the level count. When the level
-/// count reaches zero, the upreferenced type is the type that is passed in:
-/// thus we can complete the cycle.
-///
-static PATypeHolder HandleUpRefs(const Type *ty) {
- // If Ty isn't abstract, or if there are no up-references in it, then there is
- // nothing to resolve here.
- if (!ty->isAbstract() || UpRefs.empty()) return ty;
-
- PATypeHolder Ty(ty);
- UR_OUT("Type '" << Ty->getDescription() <<
- "' newly formed. Resolving upreferences.\n" <<
- UpRefs.size() << " upreferences active!\n");
-
- // If we find any resolvable upreferences (i.e., those whose NestingLevel goes
- // to zero), we resolve them all together before we resolve them to Ty. At
- // the end of the loop, if there is anything to resolve to Ty, it will be in
- // this variable.
- OpaqueType *TypeToResolve = 0;
-
- for (unsigned i = 0; i != UpRefs.size(); ++i) {
- UR_OUT(" UR#" << i << " - TypeContains(" << Ty->getDescription() << ", "
- << UpRefs[i].second->getDescription() << ") = "
- << (TypeContains(Ty, UpRefs[i].second) ? "true" : "false") << "\n");
- if (TypeContains(Ty, UpRefs[i].LastContainedTy)) {
- // Decrement level of upreference
- unsigned Level = --UpRefs[i].NestingLevel;
- UpRefs[i].LastContainedTy = Ty;
- UR_OUT(" Uplevel Ref Level = " << Level << "\n");
- if (Level == 0) { // Upreference should be resolved!
- if (!TypeToResolve) {
- TypeToResolve = UpRefs[i].UpRefTy;
- } else {
- UR_OUT(" * Resolving upreference for "
- << UpRefs[i].second->getDescription() << "\n";
- std::string OldName = UpRefs[i].UpRefTy->getDescription());
- UpRefs[i].UpRefTy->refineAbstractTypeTo(TypeToResolve);
- UR_OUT(" * Type '" << OldName << "' refined upreference to: "
- << (const void*)Ty << ", " << Ty->getDescription() << "\n");
- }
- UpRefs.erase(UpRefs.begin()+i); // Remove from upreference list...
- --i; // Do not skip the next element...
- }
- }
- }
-
- if (TypeToResolve) {
- UR_OUT(" * Resolving upreference for "
- << UpRefs[i].second->getDescription() << "\n";
- std::string OldName = TypeToResolve->getDescription());
- TypeToResolve->refineAbstractTypeTo(Ty);
- }
-
- return Ty;
-}
-
-//===----------------------------------------------------------------------===//
-// RunVMAsmParser - Define an interface to this parser
-//===----------------------------------------------------------------------===//
-//
-static Module* RunParser(Module * M);
-
-Module *llvm::RunVMAsmParser(llvm::MemoryBuffer *MB) {
- InitLLLexer(MB);
- Module *M = RunParser(new Module(LLLgetFilename()));
- FreeLexer();
- return M;
-}
-
-%}
-
-%union {
- llvm::Module *ModuleVal;
- llvm::Function *FunctionVal;
- llvm::BasicBlock *BasicBlockVal;
- llvm::TerminatorInst *TermInstVal;
- llvm::Instruction *InstVal;
- llvm::Constant *ConstVal;
-
- const llvm::Type *PrimType;
- std::list<llvm::PATypeHolder> *TypeList;
- llvm::PATypeHolder *TypeVal;
- llvm::Value *ValueVal;
- std::vector<llvm::Value*> *ValueList;
- llvm::ArgListType *ArgList;
- llvm::TypeWithAttrs TypeWithAttrs;
- llvm::TypeWithAttrsList *TypeWithAttrsList;
- llvm::ParamList *ParamList;
-
- // Represent the RHS of PHI node
- std::list<std::pair<llvm::Value*,
- llvm::BasicBlock*> > *PHIList;
- std::vector<std::pair<llvm::Constant*, llvm::BasicBlock*> > *JumpTable;
- std::vector<llvm::Constant*> *ConstVector;
-
- llvm::GlobalValue::LinkageTypes Linkage;
- llvm::GlobalValue::VisibilityTypes Visibility;
- llvm::ParameterAttributes ParamAttrs;
- llvm::APInt *APIntVal;
- int64_t SInt64Val;
- uint64_t UInt64Val;
- int SIntVal;
- unsigned UIntVal;
- llvm::APFloat *FPVal;
- bool BoolVal;
-
- std::string *StrVal; // This memory must be deleted
- llvm::ValID ValIDVal;
-
- llvm::Instruction::BinaryOps BinaryOpVal;
- llvm::Instruction::TermOps TermOpVal;
- llvm::Instruction::MemoryOps MemOpVal;
- llvm::Instruction::CastOps CastOpVal;
- llvm::Instruction::OtherOps OtherOpVal;
- llvm::ICmpInst::Predicate IPredicate;
- llvm::FCmpInst::Predicate FPredicate;
-}
-
-%type <ModuleVal> Module
-%type <FunctionVal> Function FunctionProto FunctionHeader BasicBlockList
-%type <BasicBlockVal> BasicBlock InstructionList
-%type <TermInstVal> BBTerminatorInst
-%type <InstVal> Inst InstVal MemoryInst
-%type <ConstVal> ConstVal ConstExpr AliaseeRef
-%type <ConstVector> ConstVector
-%type <ArgList> ArgList ArgListH
-%type <PHIList> PHIList
-%type <ParamList> ParamList // For call param lists & GEP indices
-%type <ValueList> IndexList // For GEP indices
-%type <TypeList> TypeListI
-%type <TypeWithAttrsList> ArgTypeList ArgTypeListI
-%type <TypeWithAttrs> ArgType
-%type <JumpTable> JumpTable
-%type <BoolVal> GlobalType // GLOBAL or CONSTANT?
-%type <BoolVal> ThreadLocal // 'thread_local' or not
-%type <BoolVal> OptVolatile // 'volatile' or not
-%type <BoolVal> OptTailCall // TAIL CALL or plain CALL.
-%type <BoolVal> OptSideEffect // 'sideeffect' or not.
-%type <Linkage> GVInternalLinkage GVExternalLinkage
-%type <Linkage> FunctionDefineLinkage FunctionDeclareLinkage
-%type <Linkage> AliasLinkage
-%type <Visibility> GVVisibilityStyle
-
-// ValueRef - Unresolved reference to a definition or BB
-%type <ValIDVal> ValueRef ConstValueRef SymbolicValueRef
-%type <ValueVal> ResolvedVal // <type> <valref> pair
-%type <ValueList> ReturnedVal
-// Tokens and types for handling constant integer values
-//
-// ESINT64VAL - A negative number within long long range
-%token <SInt64Val> ESINT64VAL
-
-// EUINT64VAL - A positive number within uns. long long range
-%token <UInt64Val> EUINT64VAL
-
-// ESAPINTVAL - A negative number with arbitrary precision
-%token <APIntVal> ESAPINTVAL
-
-// EUAPINTVAL - A positive number with arbitrary precision
-%token <APIntVal> EUAPINTVAL
-
-%token <UIntVal> LOCALVAL_ID GLOBALVAL_ID // %123 @123
-%token <FPVal> FPVAL // Float or Double constant
-
-// Built in types...
-%type <TypeVal> Types ResultTypes
-%type <PrimType> IntType FPType PrimType // Classifications
-%token <PrimType> VOID INTTYPE
-%token <PrimType> FLOAT DOUBLE X86_FP80 FP128 PPC_FP128 LABEL
-%token TYPE
-
-
-%token<StrVal> LOCALVAR GLOBALVAR LABELSTR
-%token<StrVal> STRINGCONSTANT ATSTRINGCONSTANT PCTSTRINGCONSTANT
-%type <StrVal> LocalName OptLocalName OptLocalAssign
-%type <StrVal> GlobalName OptGlobalAssign GlobalAssign
-%type <StrVal> OptSection SectionString OptGC
-
-%type <UIntVal> OptAlign OptCAlign OptAddrSpace
-
-%token ZEROINITIALIZER TRUETOK FALSETOK BEGINTOK ENDTOK
-%token DECLARE DEFINE GLOBAL CONSTANT SECTION ALIAS VOLATILE THREAD_LOCAL
-%token TO DOTDOTDOT NULL_TOK UNDEF INTERNAL LINKONCE WEAK APPENDING
-%token DLLIMPORT DLLEXPORT EXTERN_WEAK
-%token OPAQUE EXTERNAL TARGET TRIPLE ALIGN ADDRSPACE
-%token DEPLIBS CALL TAIL ASM_TOK MODULE SIDEEFFECT
-%token CC_TOK CCC_TOK FASTCC_TOK COLDCC_TOK X86_STDCALLCC_TOK X86_FASTCALLCC_TOK
-%token DATALAYOUT
-%type <UIntVal> OptCallingConv
-%type <ParamAttrs> OptParamAttrs ParamAttr
-%type <ParamAttrs> OptFuncAttrs FuncAttr
-
-// Basic Block Terminating Operators
-%token <TermOpVal> RET BR SWITCH INVOKE UNWIND UNREACHABLE
-
-// Binary Operators
-%type <BinaryOpVal> ArithmeticOps LogicalOps // Binops Subcatagories
-%token <BinaryOpVal> ADD SUB MUL UDIV SDIV FDIV UREM SREM FREM AND OR XOR
-%token <BinaryOpVal> SHL LSHR ASHR
-
-%token <OtherOpVal> ICMP FCMP
-%type <IPredicate> IPredicates
-%type <FPredicate> FPredicates
-%token EQ NE SLT SGT SLE SGE ULT UGT ULE UGE
-%token OEQ ONE OLT OGT OLE OGE ORD UNO UEQ UNE
-
-// Memory Instructions
-%token <MemOpVal> MALLOC ALLOCA FREE LOAD STORE GETELEMENTPTR
-
-// Cast Operators
-%type <CastOpVal> CastOps
-%token <CastOpVal> TRUNC ZEXT SEXT FPTRUNC FPEXT BITCAST
-%token <CastOpVal> UITOFP SITOFP FPTOUI FPTOSI INTTOPTR PTRTOINT
-
-// Other Operators
-%token <OtherOpVal> PHI_TOK SELECT VAARG
-%token <OtherOpVal> EXTRACTELEMENT INSERTELEMENT SHUFFLEVECTOR
-%token <OtherOpVal> GETRESULT
-
-// Function Attributes
-%token SIGNEXT ZEROEXT NORETURN INREG SRET NOUNWIND NOALIAS BYVAL NEST
-%token READNONE READONLY GC
-
-// Visibility Styles
-%token DEFAULT HIDDEN PROTECTED
-
-%start Module
-%%
-
-
-// Operations that are notably excluded from this list include:
-// RET, BR, & SWITCH because they end basic blocks and are treated specially.
-//
-ArithmeticOps: ADD | SUB | MUL | UDIV | SDIV | FDIV | UREM | SREM | FREM;
-LogicalOps : SHL | LSHR | ASHR | AND | OR | XOR;
-CastOps : TRUNC | ZEXT | SEXT | FPTRUNC | FPEXT | BITCAST |
- UITOFP | SITOFP | FPTOUI | FPTOSI | INTTOPTR | PTRTOINT;
-
-IPredicates
- : EQ { $$ = ICmpInst::ICMP_EQ; } | NE { $$ = ICmpInst::ICMP_NE; }
- | SLT { $$ = ICmpInst::ICMP_SLT; } | SGT { $$ = ICmpInst::ICMP_SGT; }
- | SLE { $$ = ICmpInst::ICMP_SLE; } | SGE { $$ = ICmpInst::ICMP_SGE; }
- | ULT { $$ = ICmpInst::ICMP_ULT; } | UGT { $$ = ICmpInst::ICMP_UGT; }
- | ULE { $$ = ICmpInst::ICMP_ULE; } | UGE { $$ = ICmpInst::ICMP_UGE; }
- ;
-
-FPredicates
- : OEQ { $$ = FCmpInst::FCMP_OEQ; } | ONE { $$ = FCmpInst::FCMP_ONE; }
- | OLT { $$ = FCmpInst::FCMP_OLT; } | OGT { $$ = FCmpInst::FCMP_OGT; }
- | OLE { $$ = FCmpInst::FCMP_OLE; } | OGE { $$ = FCmpInst::FCMP_OGE; }
- | ORD { $$ = FCmpInst::FCMP_ORD; } | UNO { $$ = FCmpInst::FCMP_UNO; }
- | UEQ { $$ = FCmpInst::FCMP_UEQ; } | UNE { $$ = FCmpInst::FCMP_UNE; }
- | ULT { $$ = FCmpInst::FCMP_ULT; } | UGT { $$ = FCmpInst::FCMP_UGT; }
- | ULE { $$ = FCmpInst::FCMP_ULE; } | UGE { $$ = FCmpInst::FCMP_UGE; }
- | TRUETOK { $$ = FCmpInst::FCMP_TRUE; }
- | FALSETOK { $$ = FCmpInst::FCMP_FALSE; }
- ;
-
-// These are some types that allow classification if we only want a particular
-// thing... for example, only a signed, unsigned, or integral type.
-IntType : INTTYPE;
-FPType : FLOAT | DOUBLE | PPC_FP128 | FP128 | X86_FP80;
-
-LocalName : LOCALVAR | STRINGCONSTANT | PCTSTRINGCONSTANT ;
-OptLocalName : LocalName | /*empty*/ { $$ = 0; };
-
-OptAddrSpace : ADDRSPACE '(' EUINT64VAL ')' { $$=$3; }
- | /*empty*/ { $$=0; };
-
-/// OptLocalAssign - Value producing statements have an optional assignment
-/// component.
-OptLocalAssign : LocalName '=' {
- $$ = $1;
- CHECK_FOR_ERROR
- }
- | /*empty*/ {
- $$ = 0;
- CHECK_FOR_ERROR
- };
-
-GlobalName : GLOBALVAR | ATSTRINGCONSTANT ;
-
-OptGlobalAssign : GlobalAssign
- | /*empty*/ {
- $$ = 0;
- CHECK_FOR_ERROR
- };
-
-GlobalAssign : GlobalName '=' {
- $$ = $1;
- CHECK_FOR_ERROR
- };
-
-GVInternalLinkage
- : INTERNAL { $$ = GlobalValue::InternalLinkage; }
- | WEAK { $$ = GlobalValue::WeakLinkage; }
- | LINKONCE { $$ = GlobalValue::LinkOnceLinkage; }
- | APPENDING { $$ = GlobalValue::AppendingLinkage; }
- | DLLEXPORT { $$ = GlobalValue::DLLExportLinkage; }
- ;
-
-GVExternalLinkage
- : DLLIMPORT { $$ = GlobalValue::DLLImportLinkage; }
- | EXTERN_WEAK { $$ = GlobalValue::ExternalWeakLinkage; }
- | EXTERNAL { $$ = GlobalValue::ExternalLinkage; }
- ;
-
-GVVisibilityStyle
- : /*empty*/ { $$ = GlobalValue::DefaultVisibility; }
- | DEFAULT { $$ = GlobalValue::DefaultVisibility; }
- | HIDDEN { $$ = GlobalValue::HiddenVisibility; }
- | PROTECTED { $$ = GlobalValue::ProtectedVisibility; }
- ;
-
-FunctionDeclareLinkage
- : /*empty*/ { $$ = GlobalValue::ExternalLinkage; }
- | DLLIMPORT { $$ = GlobalValue::DLLImportLinkage; }
- | EXTERN_WEAK { $$ = GlobalValue::ExternalWeakLinkage; }
- ;
-
-FunctionDefineLinkage
- : /*empty*/ { $$ = GlobalValue::ExternalLinkage; }
- | INTERNAL { $$ = GlobalValue::InternalLinkage; }
- | LINKONCE { $$ = GlobalValue::LinkOnceLinkage; }
- | WEAK { $$ = GlobalValue::WeakLinkage; }
- | DLLEXPORT { $$ = GlobalValue::DLLExportLinkage; }
- ;
-
-AliasLinkage
- : /*empty*/ { $$ = GlobalValue::ExternalLinkage; }
- | WEAK { $$ = GlobalValue::WeakLinkage; }
- | INTERNAL { $$ = GlobalValue::InternalLinkage; }
- ;
-
-OptCallingConv : /*empty*/ { $$ = CallingConv::C; } |
- CCC_TOK { $$ = CallingConv::C; } |
- FASTCC_TOK { $$ = CallingConv::Fast; } |
- COLDCC_TOK { $$ = CallingConv::Cold; } |
- X86_STDCALLCC_TOK { $$ = CallingConv::X86_StdCall; } |
- X86_FASTCALLCC_TOK { $$ = CallingConv::X86_FastCall; } |
- CC_TOK EUINT64VAL {
- if ((unsigned)$2 != $2)
- GEN_ERROR("Calling conv too large");
- $$ = $2;
- CHECK_FOR_ERROR
- };
-
-ParamAttr : ZEROEXT { $$ = ParamAttr::ZExt; }
- | ZEXT { $$ = ParamAttr::ZExt; }
- | SIGNEXT { $$ = ParamAttr::SExt; }
- | SEXT { $$ = ParamAttr::SExt; }
- | INREG { $$ = ParamAttr::InReg; }
- | SRET { $$ = ParamAttr::StructRet; }
- | NOALIAS { $$ = ParamAttr::NoAlias; }
- | BYVAL { $$ = ParamAttr::ByVal; }
- | NEST { $$ = ParamAttr::Nest; }
- | ALIGN EUINT64VAL { $$ =
- ParamAttr::constructAlignmentFromInt($2); }
- ;
-
-OptParamAttrs : /* empty */ { $$ = ParamAttr::None; }
- | OptParamAttrs ParamAttr {
- $$ = $1 | $2;
- }
- ;
-
-FuncAttr : NORETURN { $$ = ParamAttr::NoReturn; }
- | NOUNWIND { $$ = ParamAttr::NoUnwind; }
- | ZEROEXT { $$ = ParamAttr::ZExt; }
- | SIGNEXT { $$ = ParamAttr::SExt; }
- | READNONE { $$ = ParamAttr::ReadNone; }
- | READONLY { $$ = ParamAttr::ReadOnly; }
- ;
-
-OptFuncAttrs : /* empty */ { $$ = ParamAttr::None; }
- | OptFuncAttrs FuncAttr {
- $$ = $1 | $2;
- }
- ;
-
-OptGC : /* empty */ { $$ = 0; }
- | GC STRINGCONSTANT {
- $$ = $2;
- }
- ;
-
-// OptAlign/OptCAlign - An optional alignment, and an optional alignment with
-// a comma before it.
-OptAlign : /*empty*/ { $$ = 0; } |
- ALIGN EUINT64VAL {
- $$ = $2;
- if ($$ != 0 && !isPowerOf2_32($$))
- GEN_ERROR("Alignment must be a power of two");
- CHECK_FOR_ERROR
-};
-OptCAlign : /*empty*/ { $$ = 0; } |
- ',' ALIGN EUINT64VAL {
- $$ = $3;
- if ($$ != 0 && !isPowerOf2_32($$))
- GEN_ERROR("Alignment must be a power of two");
- CHECK_FOR_ERROR
-};
-
-
-
-SectionString : SECTION STRINGCONSTANT {
- for (unsigned i = 0, e = $2->length(); i != e; ++i)
- if ((*$2)[i] == '"' || (*$2)[i] == '\\')
- GEN_ERROR("Invalid character in section name");
- $$ = $2;
- CHECK_FOR_ERROR
-};
-
-OptSection : /*empty*/ { $$ = 0; } |
- SectionString { $$ = $1; };
-
-// GlobalVarAttributes - Used to pass the attributes string on a global. CurGV
-// is set to be the global we are processing.
-//
-GlobalVarAttributes : /* empty */ {} |
- ',' GlobalVarAttribute GlobalVarAttributes {};
-GlobalVarAttribute : SectionString {
- CurGV->setSection(*$1);
- delete $1;
- CHECK_FOR_ERROR
- }
- | ALIGN EUINT64VAL {
- if ($2 != 0 && !isPowerOf2_32($2))
- GEN_ERROR("Alignment must be a power of two");
- CurGV->setAlignment($2);
- CHECK_FOR_ERROR
- };
-
-//===----------------------------------------------------------------------===//
-// Types includes all predefined types... except void, because it can only be
-// used in specific contexts (function returning void for example).
-
-// Derived types are added later...
-//
-PrimType : INTTYPE | FLOAT | DOUBLE | PPC_FP128 | FP128 | X86_FP80 | LABEL ;
-
-Types
- : OPAQUE {
- $$ = new PATypeHolder(OpaqueType::get());
- CHECK_FOR_ERROR
- }
- | PrimType {
- $$ = new PATypeHolder($1);
- CHECK_FOR_ERROR
- }
- | Types OptAddrSpace '*' { // Pointer type?
- if (*$1 == Type::LabelTy)
- GEN_ERROR("Cannot form a pointer to a basic block");
- $$ = new PATypeHolder(HandleUpRefs(PointerType::get(*$1, $2)));
- delete $1;
- CHECK_FOR_ERROR
- }
- | SymbolicValueRef { // Named types are also simple types...
- const Type* tmp = getTypeVal($1);
- CHECK_FOR_ERROR
- $$ = new PATypeHolder(tmp);
- }
- | '\\' EUINT64VAL { // Type UpReference
- if ($2 > (uint64_t)~0U) GEN_ERROR("Value out of range");
- OpaqueType *OT = OpaqueType::get(); // Use temporary placeholder
- UpRefs.push_back(UpRefRecord((unsigned)$2, OT)); // Add to vector...
- $$ = new PATypeHolder(OT);
- UR_OUT("New Upreference!\n");
- CHECK_FOR_ERROR
- }
- | Types '(' ArgTypeListI ')' OptFuncAttrs {
- // Allow but ignore attributes on function types; this permits auto-upgrade.
- // FIXME: remove in LLVM 3.0.
- const Type *RetTy = *$1;
- if (!FunctionType::isValidReturnType(RetTy))
- GEN_ERROR("Invalid result type for LLVM function");
-
- std::vector<const Type*> Params;
- TypeWithAttrsList::iterator I = $3->begin(), E = $3->end();
- for (; I != E; ++I ) {
- const Type *Ty = I->Ty->get();
- Params.push_back(Ty);
- }
-
- bool isVarArg = Params.size() && Params.back() == Type::VoidTy;
- if (isVarArg) Params.pop_back();
-
- for (unsigned i = 0; i != Params.size(); ++i)
- if (!(Params[i]->isFirstClassType() || isa<OpaqueType>(Params[i])))
- GEN_ERROR("Function arguments must be value types!");
-
- CHECK_FOR_ERROR
-
- FunctionType *FT = FunctionType::get(RetTy, Params, isVarArg);
- delete $3; // Delete the argument list
- delete $1; // Delete the return type handle
- $$ = new PATypeHolder(HandleUpRefs(FT));
- CHECK_FOR_ERROR
- }
- | VOID '(' ArgTypeListI ')' OptFuncAttrs {
- // Allow but ignore attributes on function types; this permits auto-upgrade.
- // FIXME: remove in LLVM 3.0.
- std::vector<const Type*> Params;
- TypeWithAttrsList::iterator I = $3->begin(), E = $3->end();
- for ( ; I != E; ++I ) {
- const Type* Ty = I->Ty->get();
- Params.push_back(Ty);
- }
-
- bool isVarArg = Params.size() && Params.back() == Type::VoidTy;
- if (isVarArg) Params.pop_back();
-
- for (unsigned i = 0; i != Params.size(); ++i)
- if (!(Params[i]->isFirstClassType() || isa<OpaqueType>(Params[i])))
- GEN_ERROR("Function arguments must be value types!");
-
- CHECK_FOR_ERROR
-
- FunctionType *FT = FunctionType::get($1, Params, isVarArg);
- delete $3; // Delete the argument list
- $$ = new PATypeHolder(HandleUpRefs(FT));
- CHECK_FOR_ERROR
- }
-
- | '[' EUINT64VAL 'x' Types ']' { // Sized array type?
- $$ = new PATypeHolder(HandleUpRefs(ArrayType::get(*$4, (unsigned)$2)));
- delete $4;
- CHECK_FOR_ERROR
- }
- | '<' EUINT64VAL 'x' Types '>' { // Vector type?
- const llvm::Type* ElemTy = $4->get();
- if ((unsigned)$2 != $2)
- GEN_ERROR("Unsigned result not equal to signed result");
- if (!ElemTy->isFloatingPoint() && !ElemTy->isInteger())
- GEN_ERROR("Element type of a VectorType must be primitive");
- $$ = new PATypeHolder(HandleUpRefs(VectorType::get(*$4, (unsigned)$2)));
- delete $4;
- CHECK_FOR_ERROR
- }
- | '{' TypeListI '}' { // Structure type?
- std::vector<const Type*> Elements;
- for (std::list<llvm::PATypeHolder>::iterator I = $2->begin(),
- E = $2->end(); I != E; ++I)
- Elements.push_back(*I);
-
- $$ = new PATypeHolder(HandleUpRefs(StructType::get(Elements)));
- delete $2;
- CHECK_FOR_ERROR
- }
- | '{' '}' { // Empty structure type?
- $$ = new PATypeHolder(StructType::get(std::vector<const Type*>()));
- CHECK_FOR_ERROR
- }
- | '<' '{' TypeListI '}' '>' {
- std::vector<const Type*> Elements;
- for (std::list<llvm::PATypeHolder>::iterator I = $3->begin(),
- E = $3->end(); I != E; ++I)
- Elements.push_back(*I);
-
- $$ = new PATypeHolder(HandleUpRefs(StructType::get(Elements, true)));
- delete $3;
- CHECK_FOR_ERROR
- }
- | '<' '{' '}' '>' { // Empty structure type?
- $$ = new PATypeHolder(StructType::get(std::vector<const Type*>(), true));
- CHECK_FOR_ERROR
- }
- ;
-
-ArgType
- : Types OptParamAttrs {
- // Allow but ignore attributes on function types; this permits auto-upgrade.
- // FIXME: remove in LLVM 3.0.
- $$.Ty = $1;
- $$.Attrs = ParamAttr::None;
- }
- ;
-
-ResultTypes
- : Types {
- if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*$1)->getDescription());
- if (!(*$1)->isFirstClassType() && !isa<StructType>($1->get()))
- GEN_ERROR("LLVM functions cannot return aggregate types");
- $$ = $1;
- }
- | VOID {
- $$ = new PATypeHolder(Type::VoidTy);
- }
- ;
-
-ArgTypeList : ArgType {
- $$ = new TypeWithAttrsList();
- $$->push_back($1);
- CHECK_FOR_ERROR
- }
- | ArgTypeList ',' ArgType {
- ($$=$1)->push_back($3);
- CHECK_FOR_ERROR
- }
- ;
-
-ArgTypeListI
- : ArgTypeList
- | ArgTypeList ',' DOTDOTDOT {
- $$=$1;
- TypeWithAttrs TWA; TWA.Attrs = ParamAttr::None;
- TWA.Ty = new PATypeHolder(Type::VoidTy);
- $$->push_back(TWA);
- CHECK_FOR_ERROR
- }
- | DOTDOTDOT {
- $$ = new TypeWithAttrsList;
- TypeWithAttrs TWA; TWA.Attrs = ParamAttr::None;
- TWA.Ty = new PATypeHolder(Type::VoidTy);
- $$->push_back(TWA);
- CHECK_FOR_ERROR
- }
- | /*empty*/ {
- $$ = new TypeWithAttrsList();
- CHECK_FOR_ERROR
- };
-
-// TypeList - Used for struct declarations and as a basis for function type
-// declaration type lists
-//
-TypeListI : Types {
- $$ = new std::list<PATypeHolder>();
- $$->push_back(*$1);
- delete $1;
- CHECK_FOR_ERROR
- }
- | TypeListI ',' Types {
- ($$=$1)->push_back(*$3);
- delete $3;
- CHECK_FOR_ERROR
- };
-
-// ConstVal - The various declarations that go into the constant pool. This
-// production is used ONLY to represent constants that show up AFTER a 'const',
-// 'constant' or 'global' token at global scope. Constants that can be inlined
-// into other expressions (such as integers and constexprs) are handled by the
-// ResolvedVal, ValueRef and ConstValueRef productions.
-//
-ConstVal: Types '[' ConstVector ']' { // Nonempty unsized arr
- if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*$1)->getDescription());
- const ArrayType *ATy = dyn_cast<ArrayType>($1->get());
- if (ATy == 0)
- GEN_ERROR("Cannot make array constant with type: '" +
- (*$1)->getDescription() + "'");
- const Type *ETy = ATy->getElementType();
- int NumElements = ATy->getNumElements();
-
- // Verify that we have the correct size...
- if (NumElements != -1 && NumElements != (int)$3->size())
- GEN_ERROR("Type mismatch: constant sized array initialized with " +
- utostr($3->size()) + " arguments, but has size of " +
- itostr(NumElements) + "");
-
- // Verify all elements are correct type!
- for (unsigned i = 0; i < $3->size(); i++) {
- if (ETy != (*$3)[i]->getType())
- GEN_ERROR("Element #" + utostr(i) + " is not of type '" +
- ETy->getDescription() +"' as required!\nIt is of type '"+
- (*$3)[i]->getType()->getDescription() + "'.");
- }
-
- $$ = ConstantArray::get(ATy, *$3);
- delete $1; delete $3;
- CHECK_FOR_ERROR
- }
- | Types '[' ']' {
- if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*$1)->getDescription());
- const ArrayType *ATy = dyn_cast<ArrayType>($1->get());
- if (ATy == 0)
- GEN_ERROR("Cannot make array constant with type: '" +
- (*$1)->getDescription() + "'");
-
- int NumElements = ATy->getNumElements();
- if (NumElements != -1 && NumElements != 0)
- GEN_ERROR("Type mismatch: constant sized array initialized with 0"
- " arguments, but has size of " + itostr(NumElements) +"");
- $$ = ConstantArray::get(ATy, std::vector<Constant*>());
- delete $1;
- CHECK_FOR_ERROR
- }
- | Types 'c' STRINGCONSTANT {
- if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*$1)->getDescription());
- const ArrayType *ATy = dyn_cast<ArrayType>($1->get());
- if (ATy == 0)
- GEN_ERROR("Cannot make array constant with type: '" +
- (*$1)->getDescription() + "'");
-
- int NumElements = ATy->getNumElements();
- const Type *ETy = ATy->getElementType();
- if (NumElements != -1 && NumElements != int($3->length()))
- GEN_ERROR("Can't build string constant of size " +
- itostr((int)($3->length())) +
- " when array has size " + itostr(NumElements) + "");
- std::vector<Constant*> Vals;
- if (ETy == Type::Int8Ty) {
- for (unsigned i = 0; i < $3->length(); ++i)
- Vals.push_back(ConstantInt::get(ETy, (*$3)[i]));
- } else {
- delete $3;
- GEN_ERROR("Cannot build string arrays of non byte sized elements");
- }
- delete $3;
- $$ = ConstantArray::get(ATy, Vals);
- delete $1;
- CHECK_FOR_ERROR
- }
- | Types '<' ConstVector '>' { // Nonempty unsized arr
- if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*$1)->getDescription());
- const VectorType *PTy = dyn_cast<VectorType>($1->get());
- if (PTy == 0)
- GEN_ERROR("Cannot make packed constant with type: '" +
- (*$1)->getDescription() + "'");
- const Type *ETy = PTy->getElementType();
- int NumElements = PTy->getNumElements();
-
- // Verify that we have the correct size...
- if (NumElements != -1 && NumElements != (int)$3->size())
- GEN_ERROR("Type mismatch: constant sized packed initialized with " +
- utostr($3->size()) + " arguments, but has size of " +
- itostr(NumElements) + "");
-
- // Verify all elements are correct type!
- for (unsigned i = 0; i < $3->size(); i++) {
- if (ETy != (*$3)[i]->getType())
- GEN_ERROR("Element #" + utostr(i) + " is not of type '" +
- ETy->getDescription() +"' as required!\nIt is of type '"+
- (*$3)[i]->getType()->getDescription() + "'.");
- }
-
- $$ = ConstantVector::get(PTy, *$3);
- delete $1; delete $3;
- CHECK_FOR_ERROR
- }
- | Types '{' ConstVector '}' {
- const StructType *STy = dyn_cast<StructType>($1->get());
- if (STy == 0)
- GEN_ERROR("Cannot make struct constant with type: '" +
- (*$1)->getDescription() + "'");
-
- if ($3->size() != STy->getNumContainedTypes())
- GEN_ERROR("Illegal number of initializers for structure type");
-
- // Check to ensure that constants are compatible with the type initializer!
- for (unsigned i = 0, e = $3->size(); i != e; ++i)
- if ((*$3)[i]->getType() != STy->getElementType(i))
- GEN_ERROR("Expected type '" +
- STy->getElementType(i)->getDescription() +
- "' for element #" + utostr(i) +
- " of structure initializer");
-
- // Check to ensure that Type is not packed
- if (STy->isPacked())
- GEN_ERROR("Unpacked Initializer to vector type '" +
- STy->getDescription() + "'");
-
- $$ = ConstantStruct::get(STy, *$3);
- delete $1; delete $3;
- CHECK_FOR_ERROR
- }
- | Types '{' '}' {
- if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*$1)->getDescription());
- const StructType *STy = dyn_cast<StructType>($1->get());
- if (STy == 0)
- GEN_ERROR("Cannot make struct constant with type: '" +
- (*$1)->getDescription() + "'");
-
- if (STy->getNumContainedTypes() != 0)
- GEN_ERROR("Illegal number of initializers for structure type");
-
- // Check to ensure that Type is not packed
- if (STy->isPacked())
- GEN_ERROR("Unpacked Initializer to vector type '" +
- STy->getDescription() + "'");
-
- $$ = ConstantStruct::get(STy, std::vector<Constant*>());
- delete $1;
- CHECK_FOR_ERROR
- }
- | Types '<' '{' ConstVector '}' '>' {
- const StructType *STy = dyn_cast<StructType>($1->get());
- if (STy == 0)
- GEN_ERROR("Cannot make struct constant with type: '" +
- (*$1)->getDescription() + "'");
-
- if ($4->size() != STy->getNumContainedTypes())
- GEN_ERROR("Illegal number of initializers for structure type");
-
- // Check to ensure that constants are compatible with the type initializer!
- for (unsigned i = 0, e = $4->size(); i != e; ++i)
- if ((*$4)[i]->getType() != STy->getElementType(i))
- GEN_ERROR("Expected type '" +
- STy->getElementType(i)->getDescription() +
- "' for element #" + utostr(i) +
- " of structure initializer");
-
- // Check to ensure that Type is packed
- if (!STy->isPacked())
- GEN_ERROR("Vector initializer to non-vector type '" +
- STy->getDescription() + "'");
-
- $$ = ConstantStruct::get(STy, *$4);
- delete $1; delete $4;
- CHECK_FOR_ERROR
- }
- | Types '<' '{' '}' '>' {
- if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*$1)->getDescription());
- const StructType *STy = dyn_cast<StructType>($1->get());
- if (STy == 0)
- GEN_ERROR("Cannot make struct constant with type: '" +
- (*$1)->getDescription() + "'");
-
- if (STy->getNumContainedTypes() != 0)
- GEN_ERROR("Illegal number of initializers for structure type");
-
- // Check to ensure that Type is packed
- if (!STy->isPacked())
- GEN_ERROR("Vector initializer to non-vector type '" +
- STy->getDescription() + "'");
-
- $$ = ConstantStruct::get(STy, std::vector<Constant*>());
- delete $1;
- CHECK_FOR_ERROR
- }
- | Types NULL_TOK {
- if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*$1)->getDescription());
- const PointerType *PTy = dyn_cast<PointerType>($1->get());
- if (PTy == 0)
- GEN_ERROR("Cannot make null pointer constant with type: '" +
- (*$1)->getDescription() + "'");
-
- $$ = ConstantPointerNull::get(PTy);
- delete $1;
- CHECK_FOR_ERROR
- }
- | Types UNDEF {
- if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*$1)->getDescription());
- $$ = UndefValue::get($1->get());
- delete $1;
- CHECK_FOR_ERROR
- }
- | Types SymbolicValueRef {
- if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*$1)->getDescription());
- const PointerType *Ty = dyn_cast<PointerType>($1->get());
- if (Ty == 0)
- GEN_ERROR("Global const reference must be a pointer type " + (*$1)->getDescription());
-
- // ConstExprs can exist in the body of a function, thus creating
- // GlobalValues whenever they refer to a variable. Because we are in
- // the context of a function, getExistingVal will search the functions
- // symbol table instead of the module symbol table for the global symbol,
- // which throws things all off. To get around this, we just tell
- // getExistingVal that we are at global scope here.
- //
- Function *SavedCurFn = CurFun.CurrentFunction;
- CurFun.CurrentFunction = 0;
-
- Value *V = getExistingVal(Ty, $2);
- CHECK_FOR_ERROR
-
- CurFun.CurrentFunction = SavedCurFn;
-
- // If this is an initializer for a constant pointer, which is referencing a
- // (currently) undefined variable, create a stub now that shall be replaced
- // in the future with the right type of variable.
- //
- if (V == 0) {
- assert(isa<PointerType>(Ty) && "Globals may only be used as pointers!");
- const PointerType *PT = cast<PointerType>(Ty);
-
- // First check to see if the forward references value is already created!
- PerModuleInfo::GlobalRefsType::iterator I =
- CurModule.GlobalRefs.find(std::make_pair(PT, $2));
-
- if (I != CurModule.GlobalRefs.end()) {
- V = I->second; // Placeholder already exists, use it...
- $2.destroy();
- } else {
- std::string Name;
- if ($2.Type == ValID::GlobalName)
- Name = $2.getName();
- else if ($2.Type != ValID::GlobalID)
- GEN_ERROR("Invalid reference to global");
-
- // Create the forward referenced global.
- GlobalValue *GV;
- if (const FunctionType *FTy =
- dyn_cast<FunctionType>(PT->getElementType())) {
- GV = Function::Create(FTy, GlobalValue::ExternalWeakLinkage, Name,
- CurModule.CurrentModule);
- } else {
- GV = new GlobalVariable(PT->getElementType(), false,
- GlobalValue::ExternalWeakLinkage, 0,
- Name, CurModule.CurrentModule);
- }
-
- // Keep track of the fact that we have a forward ref to recycle it
- CurModule.GlobalRefs.insert(std::make_pair(std::make_pair(PT, $2), GV));
- V = GV;
- }
- }
-
- $$ = cast<GlobalValue>(V);
- delete $1; // Free the type handle
- CHECK_FOR_ERROR
- }
- | Types ConstExpr {
- if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*$1)->getDescription());
- if ($1->get() != $2->getType())
- GEN_ERROR("Mismatched types for constant expression: " +
- (*$1)->getDescription() + " and " + $2->getType()->getDescription());
- $$ = $2;
- delete $1;
- CHECK_FOR_ERROR
- }
- | Types ZEROINITIALIZER {
- if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*$1)->getDescription());
- const Type *Ty = $1->get();
- if (isa<FunctionType>(Ty) || Ty == Type::LabelTy || isa<OpaqueType>(Ty))
- GEN_ERROR("Cannot create a null initialized value of this type");
- $$ = Constant::getNullValue(Ty);
- delete $1;
- CHECK_FOR_ERROR
- }
- | IntType ESINT64VAL { // integral constants
- if (!ConstantInt::isValueValidForType($1, $2))
- GEN_ERROR("Constant value doesn't fit in type");
- $$ = ConstantInt::get($1, $2, true);
- CHECK_FOR_ERROR
- }
- | IntType ESAPINTVAL { // arbitrary precision integer constants
- uint32_t BitWidth = cast<IntegerType>($1)->getBitWidth();
- if ($2->getBitWidth() > BitWidth) {
- GEN_ERROR("Constant value does not fit in type");
- }
- $2->sextOrTrunc(BitWidth);
- $$ = ConstantInt::get(*$2);
- delete $2;
- CHECK_FOR_ERROR
- }
- | IntType EUINT64VAL { // integral constants
- if (!ConstantInt::isValueValidForType($1, $2))
- GEN_ERROR("Constant value doesn't fit in type");
- $$ = ConstantInt::get($1, $2, false);
- CHECK_FOR_ERROR
- }
- | IntType EUAPINTVAL { // arbitrary precision integer constants
- uint32_t BitWidth = cast<IntegerType>($1)->getBitWidth();
- if ($2->getBitWidth() > BitWidth) {
- GEN_ERROR("Constant value does not fit in type");
- }
- $2->zextOrTrunc(BitWidth);
- $$ = ConstantInt::get(*$2);
- delete $2;
- CHECK_FOR_ERROR
- }
- | INTTYPE TRUETOK { // Boolean constants
- assert(cast<IntegerType>($1)->getBitWidth() == 1 && "Not Bool?");
- $$ = ConstantInt::getTrue();
- CHECK_FOR_ERROR
- }
- | INTTYPE FALSETOK { // Boolean constants
- assert(cast<IntegerType>($1)->getBitWidth() == 1 && "Not Bool?");
- $$ = ConstantInt::getFalse();
- CHECK_FOR_ERROR
- }
- | FPType FPVAL { // Floating point constants
- if (!ConstantFP::isValueValidForType($1, *$2))
- GEN_ERROR("Floating point constant invalid for type");
- // Lexer has no type info, so builds all float and double FP constants
- // as double. Fix this here. Long double is done right.
- if (&$2->getSemantics()==&APFloat::IEEEdouble && $1==Type::FloatTy)
- $2->convert(APFloat::IEEEsingle, APFloat::rmNearestTiesToEven);
- $$ = ConstantFP::get(*$2);
- delete $2;
- CHECK_FOR_ERROR
- };
-
-
-ConstExpr: CastOps '(' ConstVal TO Types ')' {
- if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*$5)->getDescription());
- Constant *Val = $3;
- const Type *DestTy = $5->get();
- if (!CastInst::castIsValid($1, $3, DestTy))
- GEN_ERROR("invalid cast opcode for cast from '" +
- Val->getType()->getDescription() + "' to '" +
- DestTy->getDescription() + "'");
- $$ = ConstantExpr::getCast($1, $3, DestTy);
- delete $5;
- }
- | GETELEMENTPTR '(' ConstVal IndexList ')' {
- if (!isa<PointerType>($3->getType()))
- GEN_ERROR("GetElementPtr requires a pointer operand");
-
- const Type *IdxTy =
- GetElementPtrInst::getIndexedType($3->getType(), $4->begin(), $4->end(),
- true);
- if (!IdxTy)
- GEN_ERROR("Index list invalid for constant getelementptr");
-
- SmallVector<Constant*, 8> IdxVec;
- for (unsigned i = 0, e = $4->size(); i != e; ++i)
- if (Constant *C = dyn_cast<Constant>((*$4)[i]))
- IdxVec.push_back(C);
- else
- GEN_ERROR("Indices to constant getelementptr must be constants");
-
- delete $4;
-
- $$ = ConstantExpr::getGetElementPtr($3, &IdxVec[0], IdxVec.size());
- CHECK_FOR_ERROR
- }
- | SELECT '(' ConstVal ',' ConstVal ',' ConstVal ')' {
- if ($3->getType() != Type::Int1Ty)
- GEN_ERROR("Select condition must be of boolean type");
- if ($5->getType() != $7->getType())
- GEN_ERROR("Select operand types must match");
- $$ = ConstantExpr::getSelect($3, $5, $7);
- CHECK_FOR_ERROR
- }
- | ArithmeticOps '(' ConstVal ',' ConstVal ')' {
- if ($3->getType() != $5->getType())
- GEN_ERROR("Binary operator types must match");
- CHECK_FOR_ERROR;
- $$ = ConstantExpr::get($1, $3, $5);
- }
- | LogicalOps '(' ConstVal ',' ConstVal ')' {
- if ($3->getType() != $5->getType())
- GEN_ERROR("Logical operator types must match");
- if (!$3->getType()->isInteger()) {
- if (Instruction::isShift($1) || !isa<VectorType>($3->getType()) ||
- !cast<VectorType>($3->getType())->getElementType()->isInteger())
- GEN_ERROR("Logical operator requires integral operands");
- }
- $$ = ConstantExpr::get($1, $3, $5);
- CHECK_FOR_ERROR
- }
- | ICMP IPredicates '(' ConstVal ',' ConstVal ')' {
- if ($4->getType() != $6->getType())
- GEN_ERROR("icmp operand types must match");
- $$ = ConstantExpr::getICmp($2, $4, $6);
- }
- | FCMP FPredicates '(' ConstVal ',' ConstVal ')' {
- if ($4->getType() != $6->getType())
- GEN_ERROR("fcmp operand types must match");
- $$ = ConstantExpr::getFCmp($2, $4, $6);
- }
- | EXTRACTELEMENT '(' ConstVal ',' ConstVal ')' {
- if (!ExtractElementInst::isValidOperands($3, $5))
- GEN_ERROR("Invalid extractelement operands");
- $$ = ConstantExpr::getExtractElement($3, $5);
- CHECK_FOR_ERROR
- }
- | INSERTELEMENT '(' ConstVal ',' ConstVal ',' ConstVal ')' {
- if (!InsertElementInst::isValidOperands($3, $5, $7))
- GEN_ERROR("Invalid insertelement operands");
- $$ = ConstantExpr::getInsertElement($3, $5, $7);
- CHECK_FOR_ERROR
- }
- | SHUFFLEVECTOR '(' ConstVal ',' ConstVal ',' ConstVal ')' {
- if (!ShuffleVectorInst::isValidOperands($3, $5, $7))
- GEN_ERROR("Invalid shufflevector operands");
- $$ = ConstantExpr::getShuffleVector($3, $5, $7);
- CHECK_FOR_ERROR
- };
-
-
-// ConstVector - A list of comma separated constants.
-ConstVector : ConstVector ',' ConstVal {
- ($$ = $1)->push_back($3);
- CHECK_FOR_ERROR
- }
- | ConstVal {
- $$ = new std::vector<Constant*>();
- $$->push_back($1);
- CHECK_FOR_ERROR
- };
-
-
-// GlobalType - Match either GLOBAL or CONSTANT for global declarations...
-GlobalType : GLOBAL { $$ = false; } | CONSTANT { $$ = true; };
-
-// ThreadLocal
-ThreadLocal : THREAD_LOCAL { $$ = true; } | { $$ = false; };
-
-// AliaseeRef - Match either GlobalValue or bitcast to GlobalValue.
-AliaseeRef : ResultTypes SymbolicValueRef {
- const Type* VTy = $1->get();
- Value *V = getVal(VTy, $2);
- CHECK_FOR_ERROR
- GlobalValue* Aliasee = dyn_cast<GlobalValue>(V);
- if (!Aliasee)
- GEN_ERROR("Aliases can be created only to global values");
-
- $$ = Aliasee;
- CHECK_FOR_ERROR
- delete $1;
- }
- | BITCAST '(' AliaseeRef TO Types ')' {
- Constant *Val = $3;
- const Type *DestTy = $5->get();
- if (!CastInst::castIsValid($1, $3, DestTy))
- GEN_ERROR("invalid cast opcode for cast from '" +
- Val->getType()->getDescription() + "' to '" +
- DestTy->getDescription() + "'");
-
- $$ = ConstantExpr::getCast($1, $3, DestTy);
- CHECK_FOR_ERROR
- delete $5;
- };
-
-//===----------------------------------------------------------------------===//
-// Rules to match Modules
-//===----------------------------------------------------------------------===//
-
-// Module rule: Capture the result of parsing the whole file into a result
-// variable...
-//
-Module
- : DefinitionList {
- $$ = ParserResult = CurModule.CurrentModule;
- CurModule.ModuleDone();
- CHECK_FOR_ERROR;
- }
- | /*empty*/ {
- $$ = ParserResult = CurModule.CurrentModule;
- CurModule.ModuleDone();
- CHECK_FOR_ERROR;
- }
- ;
-
-DefinitionList
- : Definition
- | DefinitionList Definition
- ;
-
-Definition
- : DEFINE { CurFun.isDeclare = false; } Function {
- CurFun.FunctionDone();
- CHECK_FOR_ERROR
- }
- | DECLARE { CurFun.isDeclare = true; } FunctionProto {
- CHECK_FOR_ERROR
- }
- | MODULE ASM_TOK AsmBlock {
- CHECK_FOR_ERROR
- }
- | OptLocalAssign TYPE Types {
- if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*$3)->getDescription());
- // Eagerly resolve types. This is not an optimization, this is a
- // requirement that is due to the fact that we could have this:
- //
- // %list = type { %list * }
- // %list = type { %list * } ; repeated type decl
- //
- // If types are not resolved eagerly, then the two types will not be
- // determined to be the same type!
- //
- ResolveTypeTo($1, *$3);
-
- if (!setTypeName(*$3, $1) && !$1) {
- CHECK_FOR_ERROR
- // If this is a named type that is not a redefinition, add it to the slot
- // table.
- CurModule.Types.push_back(*$3);
- }
-
- delete $3;
- CHECK_FOR_ERROR
- }
- | OptLocalAssign TYPE VOID {
- ResolveTypeTo($1, $3);
-
- if (!setTypeName($3, $1) && !$1) {
- CHECK_FOR_ERROR
- // If this is a named type that is not a redefinition, add it to the slot
- // table.
- CurModule.Types.push_back($3);
- }
- CHECK_FOR_ERROR
- }
- | OptGlobalAssign GVVisibilityStyle ThreadLocal GlobalType ConstVal
- OptAddrSpace {
- /* "Externally Visible" Linkage */
- if ($5 == 0)
- GEN_ERROR("Global value initializer is not a constant");
- CurGV = ParseGlobalVariable($1, GlobalValue::ExternalLinkage,
- $2, $4, $5->getType(), $5, $3, $6);
- CHECK_FOR_ERROR
- } GlobalVarAttributes {
- CurGV = 0;
- }
- | OptGlobalAssign GVInternalLinkage GVVisibilityStyle ThreadLocal GlobalType
- ConstVal OptAddrSpace {
- if ($6 == 0)
- GEN_ERROR("Global value initializer is not a constant");
- CurGV = ParseGlobalVariable($1, $2, $3, $5, $6->getType(), $6, $4, $7);
- CHECK_FOR_ERROR
- } GlobalVarAttributes {
- CurGV = 0;
- }
- | OptGlobalAssign GVExternalLinkage GVVisibilityStyle ThreadLocal GlobalType
- Types OptAddrSpace {
- if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*$6)->getDescription());
- CurGV = ParseGlobalVariable($1, $2, $3, $5, *$6, 0, $4, $7);
- CHECK_FOR_ERROR
- delete $6;
- } GlobalVarAttributes {
- CurGV = 0;
- CHECK_FOR_ERROR
- }
- | OptGlobalAssign GVVisibilityStyle ALIAS AliasLinkage AliaseeRef {
- std::string Name;
- if ($1) {
- Name = *$1;
- delete $1;
- }
- if (Name.empty())
- GEN_ERROR("Alias name cannot be empty");
-
- Constant* Aliasee = $5;
- if (Aliasee == 0)
- GEN_ERROR(std::string("Invalid aliasee for alias: ") + Name);
-
- GlobalAlias* GA = new GlobalAlias(Aliasee->getType(), $4, Name, Aliasee,
- CurModule.CurrentModule);
- GA->setVisibility($2);
- InsertValue(GA, CurModule.Values);
-
-
- // If there was a forward reference of this alias, resolve it now.
-
- ValID ID;
- if (!Name.empty())
- ID = ValID::createGlobalName(Name);
- else
- ID = ValID::createGlobalID(CurModule.Values.size()-1);
-
- if (GlobalValue *FWGV =
- CurModule.GetForwardRefForGlobal(GA->getType(), ID)) {
- // Replace uses of the fwdref with the actual alias.
- FWGV->replaceAllUsesWith(GA);
- if (GlobalVariable *GV = dyn_cast<GlobalVariable>(FWGV))
- GV->eraseFromParent();
- else
- cast<Function>(FWGV)->eraseFromParent();
- }
- ID.destroy();
-
- CHECK_FOR_ERROR
- }
- | TARGET TargetDefinition {
- CHECK_FOR_ERROR
- }
- | DEPLIBS '=' LibrariesDefinition {
- CHECK_FOR_ERROR
- }
- ;
-
-
-AsmBlock : STRINGCONSTANT {
- const std::string &AsmSoFar = CurModule.CurrentModule->getModuleInlineAsm();
- if (AsmSoFar.empty())
- CurModule.CurrentModule->setModuleInlineAsm(*$1);
- else
- CurModule.CurrentModule->setModuleInlineAsm(AsmSoFar+"\n"+*$1);
- delete $1;
- CHECK_FOR_ERROR
-};
-
-TargetDefinition : TRIPLE '=' STRINGCONSTANT {
- CurModule.CurrentModule->setTargetTriple(*$3);
- delete $3;
- }
- | DATALAYOUT '=' STRINGCONSTANT {
- CurModule.CurrentModule->setDataLayout(*$3);
- delete $3;
- };
-
-LibrariesDefinition : '[' LibList ']';
-
-LibList : LibList ',' STRINGCONSTANT {
- CurModule.CurrentModule->addLibrary(*$3);
- delete $3;
- CHECK_FOR_ERROR
- }
- | STRINGCONSTANT {
- CurModule.CurrentModule->addLibrary(*$1);
- delete $1;
- CHECK_FOR_ERROR
- }
- | /* empty: end of list */ {
- CHECK_FOR_ERROR
- }
- ;
-
-//===----------------------------------------------------------------------===//
-// Rules to match Function Headers
-//===----------------------------------------------------------------------===//
-
-ArgListH : ArgListH ',' Types OptParamAttrs OptLocalName {
- if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*$3)->getDescription());
- if (*$3 == Type::VoidTy)
- GEN_ERROR("void typed arguments are invalid");
- ArgListEntry E; E.Attrs = $4; E.Ty = $3; E.Name = $5;
- $$ = $1;
- $1->push_back(E);
- CHECK_FOR_ERROR
- }
- | Types OptParamAttrs OptLocalName {
- if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*$1)->getDescription());
- if (*$1 == Type::VoidTy)
- GEN_ERROR("void typed arguments are invalid");
- ArgListEntry E; E.Attrs = $2; E.Ty = $1; E.Name = $3;
- $$ = new ArgListType;
- $$->push_back(E);
- CHECK_FOR_ERROR
- };
-
-ArgList : ArgListH {
- $$ = $1;
- CHECK_FOR_ERROR
- }
- | ArgListH ',' DOTDOTDOT {
- $$ = $1;
- struct ArgListEntry E;
- E.Ty = new PATypeHolder(Type::VoidTy);
- E.Name = 0;
- E.Attrs = ParamAttr::None;
- $$->push_back(E);
- CHECK_FOR_ERROR
- }
- | DOTDOTDOT {
- $$ = new ArgListType;
- struct ArgListEntry E;
- E.Ty = new PATypeHolder(Type::VoidTy);
- E.Name = 0;
- E.Attrs = ParamAttr::None;
- $$->push_back(E);
- CHECK_FOR_ERROR
- }
- | /* empty */ {
- $$ = 0;
- CHECK_FOR_ERROR
- };
-
-FunctionHeaderH : OptCallingConv ResultTypes GlobalName '(' ArgList ')'
- OptFuncAttrs OptSection OptAlign OptGC {
- std::string FunctionName(*$3);
- delete $3; // Free strdup'd memory!
-
- // Check the function result for abstractness if this is a define. We should
- // have no abstract types at this point
- if (!CurFun.isDeclare && CurModule.TypeIsUnresolved($2))
- GEN_ERROR("Reference to abstract result: "+ $2->get()->getDescription());
-
- if (!FunctionType::isValidReturnType(*$2))
- GEN_ERROR("Invalid result type for LLVM function");
-
- std::vector<const Type*> ParamTypeList;
- SmallVector<ParamAttrsWithIndex, 8> Attrs;
- if ($7 != ParamAttr::None)
- Attrs.push_back(ParamAttrsWithIndex::get(0, $7));
- if ($5) { // If there are arguments...
- unsigned index = 1;
- for (ArgListType::iterator I = $5->begin(); I != $5->end(); ++I, ++index) {
- const Type* Ty = I->Ty->get();
- if (!CurFun.isDeclare && CurModule.TypeIsUnresolved(I->Ty))
- GEN_ERROR("Reference to abstract argument: " + Ty->getDescription());
- ParamTypeList.push_back(Ty);
- if (Ty != Type::VoidTy && I->Attrs != ParamAttr::None)
- Attrs.push_back(ParamAttrsWithIndex::get(index, I->Attrs));
- }
- }
-
- bool isVarArg = ParamTypeList.size() && ParamTypeList.back() == Type::VoidTy;
- if (isVarArg) ParamTypeList.pop_back();
-
- PAListPtr PAL;
- if (!Attrs.empty())
- PAL = PAListPtr::get(Attrs.begin(), Attrs.end());
-
- FunctionType *FT = FunctionType::get(*$2, ParamTypeList, isVarArg);
- const PointerType *PFT = PointerType::getUnqual(FT);
- delete $2;
-
- ValID ID;
- if (!FunctionName.empty()) {
- ID = ValID::createGlobalName((char*)FunctionName.c_str());
- } else {
- ID = ValID::createGlobalID(CurModule.Values.size());
- }
-
- Function *Fn = 0;
- // See if this function was forward referenced. If so, recycle the object.
- if (GlobalValue *FWRef = CurModule.GetForwardRefForGlobal(PFT, ID)) {
- // Move the function to the end of the list, from whereever it was
- // previously inserted.
- Fn = cast<Function>(FWRef);
- assert(Fn->getParamAttrs().isEmpty() &&
- "Forward reference has parameter attributes!");
- CurModule.CurrentModule->getFunctionList().remove(Fn);
- CurModule.CurrentModule->getFunctionList().push_back(Fn);
- } else if (!FunctionName.empty() && // Merge with an earlier prototype?
- (Fn = CurModule.CurrentModule->getFunction(FunctionName))) {
- if (Fn->getFunctionType() != FT ) {
- // The existing function doesn't have the same type. This is an overload
- // error.
- GEN_ERROR("Overload of function '" + FunctionName + "' not permitted.");
- } else if (Fn->getParamAttrs() != PAL) {
- // The existing function doesn't have the same parameter attributes.
- // This is an overload error.
- GEN_ERROR("Overload of function '" + FunctionName + "' not permitted.");
- } else if (!CurFun.isDeclare && !Fn->isDeclaration()) {
- // Neither the existing or the current function is a declaration and they
- // have the same name and same type. Clearly this is a redefinition.
- GEN_ERROR("Redefinition of function '" + FunctionName + "'");
- } else if (Fn->isDeclaration()) {
- // Make sure to strip off any argument names so we can't get conflicts.
- for (Function::arg_iterator AI = Fn->arg_begin(), AE = Fn->arg_end();
- AI != AE; ++AI)
- AI->setName("");
- }
- } else { // Not already defined?
- Fn = Function::Create(FT, GlobalValue::ExternalWeakLinkage, FunctionName,
- CurModule.CurrentModule);
- InsertValue(Fn, CurModule.Values);
- }
-
- CurFun.FunctionStart(Fn);
-
- if (CurFun.isDeclare) {
- // If we have declaration, always overwrite linkage. This will allow us to
- // correctly handle cases, when pointer to function is passed as argument to
- // another function.
- Fn->setLinkage(CurFun.Linkage);
- Fn->setVisibility(CurFun.Visibility);
- }
- Fn->setCallingConv($1);
- Fn->setParamAttrs(PAL);
- Fn->setAlignment($9);
- if ($8) {
- Fn->setSection(*$8);
- delete $8;
- }
- if ($10) {
- Fn->setCollector($10->c_str());
- delete $10;
- }
-
- // Add all of the arguments we parsed to the function...
- if ($5) { // Is null if empty...
- if (isVarArg) { // Nuke the last entry
- assert($5->back().Ty->get() == Type::VoidTy && $5->back().Name == 0 &&
- "Not a varargs marker!");
- delete $5->back().Ty;
- $5->pop_back(); // Delete the last entry
- }
- Function::arg_iterator ArgIt = Fn->arg_begin();
- Function::arg_iterator ArgEnd = Fn->arg_end();
- unsigned Idx = 1;
- for (ArgListType::iterator I = $5->begin();
- I != $5->end() && ArgIt != ArgEnd; ++I, ++ArgIt) {
- delete I->Ty; // Delete the typeholder...
- setValueName(ArgIt, I->Name); // Insert arg into symtab...
- CHECK_FOR_ERROR
- InsertValue(ArgIt);
- Idx++;
- }
-
- delete $5; // We're now done with the argument list
- }
- CHECK_FOR_ERROR
-};
-
-BEGIN : BEGINTOK | '{'; // Allow BEGIN or '{' to start a function
-
-FunctionHeader : FunctionDefineLinkage GVVisibilityStyle FunctionHeaderH BEGIN {
- $$ = CurFun.CurrentFunction;
-
- // Make sure that we keep track of the linkage type even if there was a
- // previous "declare".
- $$->setLinkage($1);
- $$->setVisibility($2);
-};
-
-END : ENDTOK | '}'; // Allow end of '}' to end a function
-
-Function : BasicBlockList END {
- $$ = $1;
- CHECK_FOR_ERROR
-};
-
-FunctionProto : FunctionDeclareLinkage GVVisibilityStyle FunctionHeaderH {
- CurFun.CurrentFunction->setLinkage($1);
- CurFun.CurrentFunction->setVisibility($2);
- $$ = CurFun.CurrentFunction;
- CurFun.FunctionDone();
- CHECK_FOR_ERROR
- };
-
-//===----------------------------------------------------------------------===//
-// Rules to match Basic Blocks
-//===----------------------------------------------------------------------===//
-
-OptSideEffect : /* empty */ {
- $$ = false;
- CHECK_FOR_ERROR
- }
- | SIDEEFFECT {
- $$ = true;
- CHECK_FOR_ERROR
- };
-
-ConstValueRef : ESINT64VAL { // A reference to a direct constant
- $$ = ValID::create($1);
- CHECK_FOR_ERROR
- }
- | EUINT64VAL {
- $$ = ValID::create($1);
- CHECK_FOR_ERROR
- }
- | FPVAL { // Perhaps it's an FP constant?
- $$ = ValID::create($1);
- CHECK_FOR_ERROR
- }
- | TRUETOK {
- $$ = ValID::create(ConstantInt::getTrue());
- CHECK_FOR_ERROR
- }
- | FALSETOK {
- $$ = ValID::create(ConstantInt::getFalse());
- CHECK_FOR_ERROR
- }
- | NULL_TOK {
- $$ = ValID::createNull();
- CHECK_FOR_ERROR
- }
- | UNDEF {
- $$ = ValID::createUndef();
- CHECK_FOR_ERROR
- }
- | ZEROINITIALIZER { // A vector zero constant.
- $$ = ValID::createZeroInit();
- CHECK_FOR_ERROR
- }
- | '<' ConstVector '>' { // Nonempty unsized packed vector
- const Type *ETy = (*$2)[0]->getType();
- int NumElements = $2->size();
-
- VectorType* pt = VectorType::get(ETy, NumElements);
- PATypeHolder* PTy = new PATypeHolder(
- HandleUpRefs(
- VectorType::get(
- ETy,
- NumElements)
- )
- );
-
- // Verify all elements are correct type!
- for (unsigned i = 0; i < $2->size(); i++) {
- if (ETy != (*$2)[i]->getType())
- GEN_ERROR("Element #" + utostr(i) + " is not of type '" +
- ETy->getDescription() +"' as required!\nIt is of type '" +
- (*$2)[i]->getType()->getDescription() + "'.");
- }
-
- $$ = ValID::create(ConstantVector::get(pt, *$2));
- delete PTy; delete $2;
- CHECK_FOR_ERROR
- }
- | ConstExpr {
- $$ = ValID::create($1);
- CHECK_FOR_ERROR
- }
- | ASM_TOK OptSideEffect STRINGCONSTANT ',' STRINGCONSTANT {
- $$ = ValID::createInlineAsm(*$3, *$5, $2);
- delete $3;
- delete $5;
- CHECK_FOR_ERROR
- };
-
-// SymbolicValueRef - Reference to one of two ways of symbolically refering to
-// another value.
-//
-SymbolicValueRef : LOCALVAL_ID { // Is it an integer reference...?
- $$ = ValID::createLocalID($1);
- CHECK_FOR_ERROR
- }
- | GLOBALVAL_ID {
- $$ = ValID::createGlobalID($1);
- CHECK_FOR_ERROR
- }
- | LocalName { // Is it a named reference...?
- $$ = ValID::createLocalName(*$1);
- delete $1;
- CHECK_FOR_ERROR
- }
- | GlobalName { // Is it a named reference...?
- $$ = ValID::createGlobalName(*$1);
- delete $1;
- CHECK_FOR_ERROR
- };
-
-// ValueRef - A reference to a definition... either constant or symbolic
-ValueRef : SymbolicValueRef | ConstValueRef;
-
-
-// ResolvedVal - a <type> <value> pair. This is used only in cases where the
-// type immediately preceeds the value reference, and allows complex constant
-// pool references (for things like: 'ret [2 x int] [ int 12, int 42]')
-ResolvedVal : Types ValueRef {
- if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*$1)->getDescription());
- $$ = getVal(*$1, $2);
- delete $1;
- CHECK_FOR_ERROR
- }
- ;
-
-ReturnedVal : ResolvedVal {
- $$ = new std::vector<Value *>();
- $$->push_back($1);
- CHECK_FOR_ERROR
- }
- | ReturnedVal ',' ResolvedVal {
- ($$=$1)->push_back($3);
- CHECK_FOR_ERROR
- };
-
-BasicBlockList : BasicBlockList BasicBlock {
- $$ = $1;
- CHECK_FOR_ERROR
- }
- | FunctionHeader BasicBlock { // Do not allow functions with 0 basic blocks
- $$ = $1;
- CHECK_FOR_ERROR
- };
-
-
-// Basic blocks are terminated by branching instructions:
-// br, br/cc, switch, ret
-//
-BasicBlock : InstructionList OptLocalAssign BBTerminatorInst {
- setValueName($3, $2);
- CHECK_FOR_ERROR
- InsertValue($3);
- $1->getInstList().push_back($3);
- $$ = $1;
- CHECK_FOR_ERROR
- };
-
-InstructionList : InstructionList Inst {
- if (CastInst *CI1 = dyn_cast<CastInst>($2))
- if (CastInst *CI2 = dyn_cast<CastInst>(CI1->getOperand(0)))
- if (CI2->getParent() == 0)
- $1->getInstList().push_back(CI2);
- $1->getInstList().push_back($2);
- $$ = $1;
- CHECK_FOR_ERROR
- }
- | /* empty */ { // Empty space between instruction lists
- $$ = defineBBVal(ValID::createLocalID(CurFun.NextValNum));
- CHECK_FOR_ERROR
- }
- | LABELSTR { // Labelled (named) basic block
- $$ = defineBBVal(ValID::createLocalName(*$1));
- delete $1;
- CHECK_FOR_ERROR
-
- };
-
-BBTerminatorInst :
- RET ReturnedVal { // Return with a result...
- ValueList &VL = *$2;
- assert(!VL.empty() && "Invalid ret operands!");
- $$ = ReturnInst::Create(&VL[0], VL.size());
- delete $2;
- CHECK_FOR_ERROR
- }
- | RET VOID { // Return with no result...
- $$ = ReturnInst::Create();
- CHECK_FOR_ERROR
- }
- | BR LABEL ValueRef { // Unconditional Branch...
- BasicBlock* tmpBB = getBBVal($3);
- CHECK_FOR_ERROR
- $$ = BranchInst::Create(tmpBB);
- } // Conditional Branch...
- | BR INTTYPE ValueRef ',' LABEL ValueRef ',' LABEL ValueRef {
- assert(cast<IntegerType>($2)->getBitWidth() == 1 && "Not Bool?");
- BasicBlock* tmpBBA = getBBVal($6);
- CHECK_FOR_ERROR
- BasicBlock* tmpBBB = getBBVal($9);
- CHECK_FOR_ERROR
- Value* tmpVal = getVal(Type::Int1Ty, $3);
- CHECK_FOR_ERROR
- $$ = BranchInst::Create(tmpBBA, tmpBBB, tmpVal);
- }
- | SWITCH IntType ValueRef ',' LABEL ValueRef '[' JumpTable ']' {
- Value* tmpVal = getVal($2, $3);
- CHECK_FOR_ERROR
- BasicBlock* tmpBB = getBBVal($6);
- CHECK_FOR_ERROR
- SwitchInst *S = SwitchInst::Create(tmpVal, tmpBB, $8->size());
- $$ = S;
-
- std::vector<std::pair<Constant*,BasicBlock*> >::iterator I = $8->begin(),
- E = $8->end();
- for (; I != E; ++I) {
- if (ConstantInt *CI = dyn_cast<ConstantInt>(I->first))
- S->addCase(CI, I->second);
- else
- GEN_ERROR("Switch case is constant, but not a simple integer");
- }
- delete $8;
- CHECK_FOR_ERROR
- }
- | SWITCH IntType ValueRef ',' LABEL ValueRef '[' ']' {
- Value* tmpVal = getVal($2, $3);
- CHECK_FOR_ERROR
- BasicBlock* tmpBB = getBBVal($6);
- CHECK_FOR_ERROR
- SwitchInst *S = SwitchInst::Create(tmpVal, tmpBB, 0);
- $$ = S;
- CHECK_FOR_ERROR
- }
- | INVOKE OptCallingConv ResultTypes ValueRef '(' ParamList ')' OptFuncAttrs
- TO LABEL ValueRef UNWIND LABEL ValueRef {
-
- // Handle the short syntax
- const PointerType *PFTy = 0;
- const FunctionType *Ty = 0;
- if (!(PFTy = dyn_cast<PointerType>($3->get())) ||
- !(Ty = dyn_cast<FunctionType>(PFTy->getElementType()))) {
- // Pull out the types of all of the arguments...
- std::vector<const Type*> ParamTypes;
- ParamList::iterator I = $6->begin(), E = $6->end();
- for (; I != E; ++I) {
- const Type *Ty = I->Val->getType();
- if (Ty == Type::VoidTy)
- GEN_ERROR("Short call syntax cannot be used with varargs");
- ParamTypes.push_back(Ty);
- }
-
- if (!FunctionType::isValidReturnType(*$3))
- GEN_ERROR("Invalid result type for LLVM function");
-
- Ty = FunctionType::get($3->get(), ParamTypes, false);
- PFTy = PointerType::getUnqual(Ty);
- }
-
- delete $3;
-
- Value *V = getVal(PFTy, $4); // Get the function we're calling...
- CHECK_FOR_ERROR
- BasicBlock *Normal = getBBVal($11);
- CHECK_FOR_ERROR
- BasicBlock *Except = getBBVal($14);
- CHECK_FOR_ERROR
-
- SmallVector<ParamAttrsWithIndex, 8> Attrs;
- if ($8 != ParamAttr::None)
- Attrs.push_back(ParamAttrsWithIndex::get(0, $8));
-
- // Check the arguments
- ValueList Args;
- if ($6->empty()) { // Has no arguments?
- // Make sure no arguments is a good thing!
- if (Ty->getNumParams() != 0)
- GEN_ERROR("No arguments passed to a function that "
- "expects arguments");
- } else { // Has arguments?
- // Loop through FunctionType's arguments and ensure they are specified
- // correctly!
- FunctionType::param_iterator I = Ty->param_begin();
- FunctionType::param_iterator E = Ty->param_end();
- ParamList::iterator ArgI = $6->begin(), ArgE = $6->end();
- unsigned index = 1;
-
- for (; ArgI != ArgE && I != E; ++ArgI, ++I, ++index) {
- if (ArgI->Val->getType() != *I)
- GEN_ERROR("Parameter " + ArgI->Val->getName()+ " is not of type '" +
- (*I)->getDescription() + "'");
- Args.push_back(ArgI->Val);
- if (ArgI->Attrs != ParamAttr::None)
- Attrs.push_back(ParamAttrsWithIndex::get(index, ArgI->Attrs));
- }
-
- if (Ty->isVarArg()) {
- if (I == E)
- for (; ArgI != ArgE; ++ArgI, ++index) {
- Args.push_back(ArgI->Val); // push the remaining varargs
- if (ArgI->Attrs != ParamAttr::None)
- Attrs.push_back(ParamAttrsWithIndex::get(index, ArgI->Attrs));
- }
- } else if (I != E || ArgI != ArgE)
- GEN_ERROR("Invalid number of parameters detected");
- }
-
- PAListPtr PAL;
- if (!Attrs.empty())
- PAL = PAListPtr::get(Attrs.begin(), Attrs.end());
-
- // Create the InvokeInst
- InvokeInst *II = InvokeInst::Create(V, Normal, Except, Args.begin(),Args.end());
- II->setCallingConv($2);
- II->setParamAttrs(PAL);
- $$ = II;
- delete $6;
- CHECK_FOR_ERROR
- }
- | UNWIND {
- $$ = new UnwindInst();
- CHECK_FOR_ERROR
- }
- | UNREACHABLE {
- $$ = new UnreachableInst();
- CHECK_FOR_ERROR
- };
-
-
-
-JumpTable : JumpTable IntType ConstValueRef ',' LABEL ValueRef {
- $$ = $1;
- Constant *V = cast<Constant>(getExistingVal($2, $3));
- CHECK_FOR_ERROR
- if (V == 0)
- GEN_ERROR("May only switch on a constant pool value");
-
- BasicBlock* tmpBB = getBBVal($6);
- CHECK_FOR_ERROR
- $$->push_back(std::make_pair(V, tmpBB));
- }
- | IntType ConstValueRef ',' LABEL ValueRef {
- $$ = new std::vector<std::pair<Constant*, BasicBlock*> >();
- Constant *V = cast<Constant>(getExistingVal($1, $2));
- CHECK_FOR_ERROR
-
- if (V == 0)
- GEN_ERROR("May only switch on a constant pool value");
-
- BasicBlock* tmpBB = getBBVal($5);
- CHECK_FOR_ERROR
- $$->push_back(std::make_pair(V, tmpBB));
- };
-
-Inst : OptLocalAssign InstVal {
- // Is this definition named?? if so, assign the name...
- setValueName($2, $1);
- CHECK_FOR_ERROR
- InsertValue($2);
- $$ = $2;
- CHECK_FOR_ERROR
- };
-
-
-PHIList : Types '[' ValueRef ',' ValueRef ']' { // Used for PHI nodes
- if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*$1)->getDescription());
- $$ = new std::list<std::pair<Value*, BasicBlock*> >();
- Value* tmpVal = getVal(*$1, $3);
- CHECK_FOR_ERROR
- BasicBlock* tmpBB = getBBVal($5);
- CHECK_FOR_ERROR
- $$->push_back(std::make_pair(tmpVal, tmpBB));
- delete $1;
- }
- | PHIList ',' '[' ValueRef ',' ValueRef ']' {
- $$ = $1;
- Value* tmpVal = getVal($1->front().first->getType(), $4);
- CHECK_FOR_ERROR
- BasicBlock* tmpBB = getBBVal($6);
- CHECK_FOR_ERROR
- $1->push_back(std::make_pair(tmpVal, tmpBB));
- };
-
-
-ParamList : Types OptParamAttrs ValueRef OptParamAttrs {
- // FIXME: Remove trailing OptParamAttrs in LLVM 3.0, it was a mistake in 2.0
- if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*$1)->getDescription());
- // Used for call and invoke instructions
- $$ = new ParamList();
- ParamListEntry E; E.Attrs = $2 | $4; E.Val = getVal($1->get(), $3);
- $$->push_back(E);
- delete $1;
- CHECK_FOR_ERROR
- }
- | LABEL OptParamAttrs ValueRef OptParamAttrs {
- // FIXME: Remove trailing OptParamAttrs in LLVM 3.0, it was a mistake in 2.0
- // Labels are only valid in ASMs
- $$ = new ParamList();
- ParamListEntry E; E.Attrs = $2 | $4; E.Val = getBBVal($3);
- $$->push_back(E);
- CHECK_FOR_ERROR
- }
- | ParamList ',' Types OptParamAttrs ValueRef OptParamAttrs {
- // FIXME: Remove trailing OptParamAttrs in LLVM 3.0, it was a mistake in 2.0
- if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*$3)->getDescription());
- $$ = $1;
- ParamListEntry E; E.Attrs = $4 | $6; E.Val = getVal($3->get(), $5);
- $$->push_back(E);
- delete $3;
- CHECK_FOR_ERROR
- }
- | ParamList ',' LABEL OptParamAttrs ValueRef OptParamAttrs {
- // FIXME: Remove trailing OptParamAttrs in LLVM 3.0, it was a mistake in 2.0
- $$ = $1;
- ParamListEntry E; E.Attrs = $4 | $6; E.Val = getBBVal($5);
- $$->push_back(E);
- CHECK_FOR_ERROR
- }
- | /*empty*/ { $$ = new ParamList(); };
-
-IndexList // Used for gep instructions and constant expressions
- : /*empty*/ { $$ = new std::vector<Value*>(); }
- | IndexList ',' ResolvedVal {
- $$ = $1;
- $$->push_back($3);
- CHECK_FOR_ERROR
- }
- ;
-
-OptTailCall : TAIL CALL {
- $$ = true;
- CHECK_FOR_ERROR
- }
- | CALL {
- $$ = false;
- CHECK_FOR_ERROR
- };
-
-InstVal : ArithmeticOps Types ValueRef ',' ValueRef {
- if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*$2)->getDescription());
- if (!(*$2)->isInteger() && !(*$2)->isFloatingPoint() &&
- !isa<VectorType>((*$2).get()))
- GEN_ERROR(
- "Arithmetic operator requires integer, FP, or packed operands");
- Value* val1 = getVal(*$2, $3);
- CHECK_FOR_ERROR
- Value* val2 = getVal(*$2, $5);
- CHECK_FOR_ERROR
- $$ = BinaryOperator::create($1, val1, val2);
- if ($$ == 0)
- GEN_ERROR("binary operator returned null");
- delete $2;
- }
- | LogicalOps Types ValueRef ',' ValueRef {
- if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*$2)->getDescription());
- if (!(*$2)->isInteger()) {
- if (Instruction::isShift($1) || !isa<VectorType>($2->get()) ||
- !cast<VectorType>($2->get())->getElementType()->isInteger())
- GEN_ERROR("Logical operator requires integral operands");
- }
- Value* tmpVal1 = getVal(*$2, $3);
- CHECK_FOR_ERROR
- Value* tmpVal2 = getVal(*$2, $5);
- CHECK_FOR_ERROR
- $$ = BinaryOperator::create($1, tmpVal1, tmpVal2);
- if ($$ == 0)
- GEN_ERROR("binary operator returned null");
- delete $2;
- }
- | ICMP IPredicates Types ValueRef ',' ValueRef {
- if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*$3)->getDescription());
- if (isa<VectorType>((*$3).get()))
- GEN_ERROR("Vector types not supported by icmp instruction");
- Value* tmpVal1 = getVal(*$3, $4);
- CHECK_FOR_ERROR
- Value* tmpVal2 = getVal(*$3, $6);
- CHECK_FOR_ERROR
- $$ = CmpInst::create($1, $2, tmpVal1, tmpVal2);
- if ($$ == 0)
- GEN_ERROR("icmp operator returned null");
- delete $3;
- }
- | FCMP FPredicates Types ValueRef ',' ValueRef {
- if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*$3)->getDescription());
- if (isa<VectorType>((*$3).get()))
- GEN_ERROR("Vector types not supported by fcmp instruction");
- Value* tmpVal1 = getVal(*$3, $4);
- CHECK_FOR_ERROR
- Value* tmpVal2 = getVal(*$3, $6);
- CHECK_FOR_ERROR
- $$ = CmpInst::create($1, $2, tmpVal1, tmpVal2);
- if ($$ == 0)
- GEN_ERROR("fcmp operator returned null");
- delete $3;
- }
- | CastOps ResolvedVal TO Types {
- if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*$4)->getDescription());
- Value* Val = $2;
- const Type* DestTy = $4->get();
- if (!CastInst::castIsValid($1, Val, DestTy))
- GEN_ERROR("invalid cast opcode for cast from '" +
- Val->getType()->getDescription() + "' to '" +
- DestTy->getDescription() + "'");
- $$ = CastInst::create($1, Val, DestTy);
- delete $4;
- }
- | SELECT ResolvedVal ',' ResolvedVal ',' ResolvedVal {
- if ($2->getType() != Type::Int1Ty)
- GEN_ERROR("select condition must be boolean");
- if ($4->getType() != $6->getType())
- GEN_ERROR("select value types should match");
- $$ = SelectInst::Create($2, $4, $6);
- CHECK_FOR_ERROR
- }
- | VAARG ResolvedVal ',' Types {
- if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*$4)->getDescription());
- $$ = new VAArgInst($2, *$4);
- delete $4;
- CHECK_FOR_ERROR
- }
- | EXTRACTELEMENT ResolvedVal ',' ResolvedVal {
- if (!ExtractElementInst::isValidOperands($2, $4))
- GEN_ERROR("Invalid extractelement operands");
- $$ = new ExtractElementInst($2, $4);
- CHECK_FOR_ERROR
- }
- | INSERTELEMENT ResolvedVal ',' ResolvedVal ',' ResolvedVal {
- if (!InsertElementInst::isValidOperands($2, $4, $6))
- GEN_ERROR("Invalid insertelement operands");
- $$ = InsertElementInst::Create($2, $4, $6);
- CHECK_FOR_ERROR
- }
- | SHUFFLEVECTOR ResolvedVal ',' ResolvedVal ',' ResolvedVal {
- if (!ShuffleVectorInst::isValidOperands($2, $4, $6))
- GEN_ERROR("Invalid shufflevector operands");
- $$ = new ShuffleVectorInst($2, $4, $6);
- CHECK_FOR_ERROR
- }
- | PHI_TOK PHIList {
- const Type *Ty = $2->front().first->getType();
- if (!Ty->isFirstClassType())
- GEN_ERROR("PHI node operands must be of first class type");
- $$ = PHINode::Create(Ty);
- ((PHINode*)$$)->reserveOperandSpace($2->size());
- while ($2->begin() != $2->end()) {
- if ($2->front().first->getType() != Ty)
- GEN_ERROR("All elements of a PHI node must be of the same type");
- cast<PHINode>($$)->addIncoming($2->front().first, $2->front().second);
- $2->pop_front();
- }
- delete $2; // Free the list...
- CHECK_FOR_ERROR
- }
- | OptTailCall OptCallingConv ResultTypes ValueRef '(' ParamList ')'
- OptFuncAttrs {
-
- // Handle the short syntax
- const PointerType *PFTy = 0;
- const FunctionType *Ty = 0;
- if (!(PFTy = dyn_cast<PointerType>($3->get())) ||
- !(Ty = dyn_cast<FunctionType>(PFTy->getElementType()))) {
- // Pull out the types of all of the arguments...
- std::vector<const Type*> ParamTypes;
- ParamList::iterator I = $6->begin(), E = $6->end();
- for (; I != E; ++I) {
- const Type *Ty = I->Val->getType();
- if (Ty == Type::VoidTy)
- GEN_ERROR("Short call syntax cannot be used with varargs");
- ParamTypes.push_back(Ty);
- }
-
- if (!FunctionType::isValidReturnType(*$3))
- GEN_ERROR("Invalid result type for LLVM function");
-
- Ty = FunctionType::get($3->get(), ParamTypes, false);
- PFTy = PointerType::getUnqual(Ty);
- }
-
- Value *V = getVal(PFTy, $4); // Get the function we're calling...
- CHECK_FOR_ERROR
-
- // Check for call to invalid intrinsic to avoid crashing later.
- if (Function *theF = dyn_cast<Function>(V)) {
- if (theF->hasName() && (theF->getValueName()->getKeyLength() >= 5) &&
- (0 == strncmp(theF->getValueName()->getKeyData(), "llvm.", 5)) &&
- !theF->getIntrinsicID(true))
- GEN_ERROR("Call to invalid LLVM intrinsic function '" +
- theF->getName() + "'");
- }
-
- // Set up the ParamAttrs for the function
- SmallVector<ParamAttrsWithIndex, 8> Attrs;
- if ($8 != ParamAttr::None)
- Attrs.push_back(ParamAttrsWithIndex::get(0, $8));
- // Check the arguments
- ValueList Args;
- if ($6->empty()) { // Has no arguments?
- // Make sure no arguments is a good thing!
- if (Ty->getNumParams() != 0)
- GEN_ERROR("No arguments passed to a function that "
- "expects arguments");
- } else { // Has arguments?
- // Loop through FunctionType's arguments and ensure they are specified
- // correctly. Also, gather any parameter attributes.
- FunctionType::param_iterator I = Ty->param_begin();
- FunctionType::param_iterator E = Ty->param_end();
- ParamList::iterator ArgI = $6->begin(), ArgE = $6->end();
- unsigned index = 1;
-
- for (; ArgI != ArgE && I != E; ++ArgI, ++I, ++index) {
- if (ArgI->Val->getType() != *I)
- GEN_ERROR("Parameter " + ArgI->Val->getName()+ " is not of type '" +
- (*I)->getDescription() + "'");
- Args.push_back(ArgI->Val);
- if (ArgI->Attrs != ParamAttr::None)
- Attrs.push_back(ParamAttrsWithIndex::get(index, ArgI->Attrs));
- }
- if (Ty->isVarArg()) {
- if (I == E)
- for (; ArgI != ArgE; ++ArgI, ++index) {
- Args.push_back(ArgI->Val); // push the remaining varargs
- if (ArgI->Attrs != ParamAttr::None)
- Attrs.push_back(ParamAttrsWithIndex::get(index, ArgI->Attrs));
- }
- } else if (I != E || ArgI != ArgE)
- GEN_ERROR("Invalid number of parameters detected");
- }
-
- // Finish off the ParamAttrs and check them
- PAListPtr PAL;
- if (!Attrs.empty())
- PAL = PAListPtr::get(Attrs.begin(), Attrs.end());
-
- // Create the call node
- CallInst *CI = CallInst::Create(V, Args.begin(), Args.end());
- CI->setTailCall($1);
- CI->setCallingConv($2);
- CI->setParamAttrs(PAL);
- $$ = CI;
- delete $6;
- delete $3;
- CHECK_FOR_ERROR
- }
- | MemoryInst {
- $$ = $1;
- CHECK_FOR_ERROR
- };
-
-OptVolatile : VOLATILE {
- $$ = true;
- CHECK_FOR_ERROR
- }
- | /* empty */ {
- $$ = false;
- CHECK_FOR_ERROR
- };
-
-
-
-MemoryInst : MALLOC Types OptCAlign {
- if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*$2)->getDescription());
- $$ = new MallocInst(*$2, 0, $3);
- delete $2;
- CHECK_FOR_ERROR
- }
- | MALLOC Types ',' INTTYPE ValueRef OptCAlign {
- if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*$2)->getDescription());
- Value* tmpVal = getVal($4, $5);
- CHECK_FOR_ERROR
- $$ = new MallocInst(*$2, tmpVal, $6);
- delete $2;
- }
- | ALLOCA Types OptCAlign {
- if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*$2)->getDescription());
- $$ = new AllocaInst(*$2, 0, $3);
- delete $2;
- CHECK_FOR_ERROR
- }
- | ALLOCA Types ',' INTTYPE ValueRef OptCAlign {
- if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*$2)->getDescription());
- Value* tmpVal = getVal($4, $5);
- CHECK_FOR_ERROR
- $$ = new AllocaInst(*$2, tmpVal, $6);
- delete $2;
- }
- | FREE ResolvedVal {
- if (!isa<PointerType>($2->getType()))
- GEN_ERROR("Trying to free nonpointer type " +
- $2->getType()->getDescription() + "");
- $$ = new FreeInst($2);
- CHECK_FOR_ERROR
- }
-
- | OptVolatile LOAD Types ValueRef OptCAlign {
- if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*$3)->getDescription());
- if (!isa<PointerType>($3->get()))
- GEN_ERROR("Can't load from nonpointer type: " +
- (*$3)->getDescription());
- if (!cast<PointerType>($3->get())->getElementType()->isFirstClassType())
- GEN_ERROR("Can't load from pointer of non-first-class type: " +
- (*$3)->getDescription());
- Value* tmpVal = getVal(*$3, $4);
- CHECK_FOR_ERROR
- $$ = new LoadInst(tmpVal, "", $1, $5);
- delete $3;
- }
- | OptVolatile STORE ResolvedVal ',' Types ValueRef OptCAlign {
- if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*$5)->getDescription());
- const PointerType *PT = dyn_cast<PointerType>($5->get());
- if (!PT)
- GEN_ERROR("Can't store to a nonpointer type: " +
- (*$5)->getDescription());
- const Type *ElTy = PT->getElementType();
- if (ElTy != $3->getType())
- GEN_ERROR("Can't store '" + $3->getType()->getDescription() +
- "' into space of type '" + ElTy->getDescription() + "'");
-
- Value* tmpVal = getVal(*$5, $6);
- CHECK_FOR_ERROR
- $$ = new StoreInst($3, tmpVal, $1, $7);
- delete $5;
- }
-| GETRESULT Types ValueRef ',' EUINT64VAL {
- Value *TmpVal = getVal($2->get(), $3);
- if (!GetResultInst::isValidOperands(TmpVal, $5))
- GEN_ERROR("Invalid getresult operands");
- $$ = new GetResultInst(TmpVal, $5);
- delete $2;
- CHECK_FOR_ERROR
- }
- | GETELEMENTPTR Types ValueRef IndexList {
- if (!UpRefs.empty())
- GEN_ERROR("Invalid upreference in type: " + (*$2)->getDescription());
- if (!isa<PointerType>($2->get()))
- GEN_ERROR("getelementptr insn requires pointer operand");
-
- if (!GetElementPtrInst::getIndexedType(*$2, $4->begin(), $4->end(), true))
- GEN_ERROR("Invalid getelementptr indices for type '" +
- (*$2)->getDescription()+ "'");
- Value* tmpVal = getVal(*$2, $3);
- CHECK_FOR_ERROR
- $$ = GetElementPtrInst::Create(tmpVal, $4->begin(), $4->end());
- delete $2;
- delete $4;
- };
-
-
-%%
-
-// common code from the two 'RunVMAsmParser' functions
-static Module* RunParser(Module * M) {
- CurModule.CurrentModule = M;
- // Check to make sure the parser succeeded
- if (yyparse()) {
- if (ParserResult)
- delete ParserResult;
- return 0;
- }
-
- // Emit an error if there are any unresolved types left.
- if (!CurModule.LateResolveTypes.empty()) {
- const ValID &DID = CurModule.LateResolveTypes.begin()->first;
- if (DID.Type == ValID::LocalName) {
- GenerateError("Undefined type remains at eof: '"+DID.getName() + "'");
- } else {
- GenerateError("Undefined type remains at eof: #" + itostr(DID.Num));
- }
- if (ParserResult)
- delete ParserResult;
- return 0;
- }
-
- // Emit an error if there are any unresolved values left.
- if (!CurModule.LateResolveValues.empty()) {
- Value *V = CurModule.LateResolveValues.back();
- std::map<Value*, std::pair<ValID, int> >::iterator I =
- CurModule.PlaceHolderInfo.find(V);
-
- if (I != CurModule.PlaceHolderInfo.end()) {
- ValID &DID = I->second.first;
- if (DID.Type == ValID::LocalName) {
- GenerateError("Undefined value remains at eof: "+DID.getName() + "'");
- } else {
- GenerateError("Undefined value remains at eof: #" + itostr(DID.Num));
- }
- if (ParserResult)
- delete ParserResult;
- return 0;
- }
- }
-
- // Check to make sure that parsing produced a result
- if (!ParserResult)
- return 0;
-
- // Reset ParserResult variable while saving its value for the result.
- Module *Result = ParserResult;
- ParserResult = 0;
-
- return Result;
-}
-
-void llvm::GenerateError(const std::string &message, int LineNo) {
- if (LineNo == -1) LineNo = LLLgetLineNo();
- // TODO: column number in exception
- if (TheParseError)
- TheParseError->setError(LLLgetFilename(), message, LineNo);
- TriggerError = 1;
-}
-
-int yyerror(const char *ErrorMsg) {
- std::string where = LLLgetFilename() + ":" + utostr(LLLgetLineNo()) + ": ";
- std::string errMsg = where + "error: " + std::string(ErrorMsg);
- if (yychar != YYEMPTY && yychar != 0) {
- errMsg += " while reading token: '";
- errMsg += std::string(LLLgetTokenStart(),
- LLLgetTokenStart()+LLLgetTokenLength()) + "'";
- }
- GenerateError(errMsg);
- return 0;
-}
diff --git a/release_23/lib/Bitcode/Makefile b/release_23/lib/Bitcode/Makefile
deleted file mode 100644
index 7abff6a0b73c..000000000000
--- a/release_23/lib/Bitcode/Makefile
+++ /dev/null
@@ -1,14 +0,0 @@
-##===- lib/Bitcode/Makefile --------------------------------*- Makefile -*-===##
-#
-# The LLVM Compiler Infrastructure
-#
-# This file is distributed under the University of Illinois Open Source
-# License. See LICENSE.TXT for details.
-#
-##===----------------------------------------------------------------------===##
-
-LEVEL = ../..
-PARALLEL_DIRS = Reader Writer
-
-include $(LEVEL)/Makefile.common
-
diff --git a/release_23/lib/Bitcode/Reader/BitReader.cpp b/release_23/lib/Bitcode/Reader/BitReader.cpp
deleted file mode 100644
index 52851cd142da..000000000000
--- a/release_23/lib/Bitcode/Reader/BitReader.cpp
+++ /dev/null
@@ -1,51 +0,0 @@
-//===-- BitReader.cpp -----------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm-c/BitReader.h"
-#include "llvm/Bitcode/ReaderWriter.h"
-#include "llvm/Support/MemoryBuffer.h"
-#include <string>
-#include <cstring>
-
-using namespace llvm;
-
-/* Builds a module from the bitcode in the specified memory buffer, returning a
- reference to the module via the OutModule parameter. Returns 0 on success.
- Optionally returns a human-readable error message via OutMessage. */
-int LLVMParseBitcode(LLVMMemoryBufferRef MemBuf,
- LLVMModuleRef *OutModule, char **OutMessage) {
- std::string Message;
-
- *OutModule = wrap(ParseBitcodeFile(unwrap(MemBuf), &Message));
- if (!*OutModule) {
- if (OutMessage)
- *OutMessage = strdup(Message.c_str());
- return 1;
- }
-
- return 0;
-}
-
-/* Reads a module from the specified path, returning via the OutModule parameter
- a module provider which performs lazy deserialization. Returns 0 on success.
- Optionally returns a human-readable error message via OutMessage. */
-int LLVMGetBitcodeModuleProvider(LLVMMemoryBufferRef MemBuf,
- LLVMModuleProviderRef *OutMP,
- char **OutMessage) {
- std::string Message;
-
- *OutMP = wrap(getBitcodeModuleProvider(unwrap(MemBuf), &Message));
- if (!*OutMP) {
- if (OutMessage)
- *OutMessage = strdup(Message.c_str());
- return 1;
- }
-
- return 0;
-}
diff --git a/release_23/lib/Bitcode/Reader/BitcodeReader.cpp b/release_23/lib/Bitcode/Reader/BitcodeReader.cpp
deleted file mode 100644
index ec25f52b1b04..000000000000
--- a/release_23/lib/Bitcode/Reader/BitcodeReader.cpp
+++ /dev/null
@@ -1,1785 +0,0 @@
-//===- BitcodeReader.cpp - Internal BitcodeReader implementation ----------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This header defines the BitcodeReader class.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Bitcode/ReaderWriter.h"
-#include "BitcodeReader.h"
-#include "llvm/Constants.h"
-#include "llvm/DerivedTypes.h"
-#include "llvm/InlineAsm.h"
-#include "llvm/Instructions.h"
-#include "llvm/Module.h"
-#include "llvm/AutoUpgrade.h"
-#include "llvm/ADT/SmallString.h"
-#include "llvm/ADT/SmallVector.h"
-#include "llvm/Support/MathExtras.h"
-#include "llvm/Support/MemoryBuffer.h"
-using namespace llvm;
-
-void BitcodeReader::FreeState() {
- delete Buffer;
- Buffer = 0;
- std::vector<PATypeHolder>().swap(TypeList);
- ValueList.clear();
-
- std::vector<PAListPtr>().swap(ParamAttrs);
- std::vector<BasicBlock*>().swap(FunctionBBs);
- std::vector<Function*>().swap(FunctionsWithBodies);
- DeferredFunctionInfo.clear();
-}
-
-//===----------------------------------------------------------------------===//
-// Helper functions to implement forward reference resolution, etc.
-//===----------------------------------------------------------------------===//
-
-/// ConvertToString - Convert a string from a record into an std::string, return
-/// true on failure.
-template<typename StrTy>
-static bool ConvertToString(SmallVector<uint64_t, 64> &Record, unsigned Idx,
- StrTy &Result) {
- if (Idx > Record.size())
- return true;
-
- for (unsigned i = Idx, e = Record.size(); i != e; ++i)
- Result += (char)Record[i];
- return false;
-}
-
-static GlobalValue::LinkageTypes GetDecodedLinkage(unsigned Val) {
- switch (Val) {
- default: // Map unknown/new linkages to external
- case 0: return GlobalValue::ExternalLinkage;
- case 1: return GlobalValue::WeakLinkage;
- case 2: return GlobalValue::AppendingLinkage;
- case 3: return GlobalValue::InternalLinkage;
- case 4: return GlobalValue::LinkOnceLinkage;
- case 5: return GlobalValue::DLLImportLinkage;
- case 6: return GlobalValue::DLLExportLinkage;
- case 7: return GlobalValue::ExternalWeakLinkage;
- }
-}
-
-static GlobalValue::VisibilityTypes GetDecodedVisibility(unsigned Val) {
- switch (Val) {
- default: // Map unknown visibilities to default.
- case 0: return GlobalValue::DefaultVisibility;
- case 1: return GlobalValue::HiddenVisibility;
- case 2: return GlobalValue::ProtectedVisibility;
- }
-}
-
-static int GetDecodedCastOpcode(unsigned Val) {
- switch (Val) {
- default: return -1;
- case bitc::CAST_TRUNC : return Instruction::Trunc;
- case bitc::CAST_ZEXT : return Instruction::ZExt;
- case bitc::CAST_SEXT : return Instruction::SExt;
- case bitc::CAST_FPTOUI : return Instruction::FPToUI;
- case bitc::CAST_FPTOSI : return Instruction::FPToSI;
- case bitc::CAST_UITOFP : return Instruction::UIToFP;
- case bitc::CAST_SITOFP : return Instruction::SIToFP;
- case bitc::CAST_FPTRUNC : return Instruction::FPTrunc;
- case bitc::CAST_FPEXT : return Instruction::FPExt;
- case bitc::CAST_PTRTOINT: return Instruction::PtrToInt;
- case bitc::CAST_INTTOPTR: return Instruction::IntToPtr;
- case bitc::CAST_BITCAST : return Instruction::BitCast;
- }
-}
-static int GetDecodedBinaryOpcode(unsigned Val, const Type *Ty) {
- switch (Val) {
- default: return -1;
- case bitc::BINOP_ADD: return Instruction::Add;
- case bitc::BINOP_SUB: return Instruction::Sub;
- case bitc::BINOP_MUL: return Instruction::Mul;
- case bitc::BINOP_UDIV: return Instruction::UDiv;
- case bitc::BINOP_SDIV:
- return Ty->isFPOrFPVector() ? Instruction::FDiv : Instruction::SDiv;
- case bitc::BINOP_UREM: return Instruction::URem;
- case bitc::BINOP_SREM:
- return Ty->isFPOrFPVector() ? Instruction::FRem : Instruction::SRem;
- case bitc::BINOP_SHL: return Instruction::Shl;
- case bitc::BINOP_LSHR: return Instruction::LShr;
- case bitc::BINOP_ASHR: return Instruction::AShr;
- case bitc::BINOP_AND: return Instruction::And;
- case bitc::BINOP_OR: return Instruction::Or;
- case bitc::BINOP_XOR: return Instruction::Xor;
- }
-}
-
-
-namespace {
- /// @brief A class for maintaining the slot number definition
- /// as a placeholder for the actual definition for forward constants defs.
- class ConstantPlaceHolder : public ConstantExpr {
- ConstantPlaceHolder(); // DO NOT IMPLEMENT
- void operator=(const ConstantPlaceHolder &); // DO NOT IMPLEMENT
- Use Op;
- public:
- // allocate space for exactly one operand
- void *operator new(size_t s) {
- return User::operator new(s, 1);
- }
- explicit ConstantPlaceHolder(const Type *Ty)
- : ConstantExpr(Ty, Instruction::UserOp1, &Op, 1),
- Op(UndefValue::get(Type::Int32Ty), this) {
- }
- };
-}
-
-Constant *BitcodeReaderValueList::getConstantFwdRef(unsigned Idx,
- const Type *Ty) {
- if (Idx >= size()) {
- // Insert a bunch of null values.
- Uses.resize(Idx+1);
- OperandList = &Uses[0];
- NumOperands = Idx+1;
- }
-
- if (Value *V = Uses[Idx]) {
- assert(Ty == V->getType() && "Type mismatch in constant table!");
- return cast<Constant>(V);
- }
-
- // Create and return a placeholder, which will later be RAUW'd.
- Constant *C = new ConstantPlaceHolder(Ty);
- Uses[Idx].init(C, this);
- return C;
-}
-
-Value *BitcodeReaderValueList::getValueFwdRef(unsigned Idx, const Type *Ty) {
- if (Idx >= size()) {
- // Insert a bunch of null values.
- Uses.resize(Idx+1);
- OperandList = &Uses[0];
- NumOperands = Idx+1;
- }
-
- if (Value *V = Uses[Idx]) {
- assert((Ty == 0 || Ty == V->getType()) && "Type mismatch in value table!");
- return V;
- }
-
- // No type specified, must be invalid reference.
- if (Ty == 0) return 0;
-
- // Create and return a placeholder, which will later be RAUW'd.
- Value *V = new Argument(Ty);
- Uses[Idx].init(V, this);
- return V;
-}
-
-
-const Type *BitcodeReader::getTypeByID(unsigned ID, bool isTypeTable) {
- // If the TypeID is in range, return it.
- if (ID < TypeList.size())
- return TypeList[ID].get();
- if (!isTypeTable) return 0;
-
- // The type table allows forward references. Push as many Opaque types as
- // needed to get up to ID.
- while (TypeList.size() <= ID)
- TypeList.push_back(OpaqueType::get());
- return TypeList.back().get();
-}
-
-//===----------------------------------------------------------------------===//
-// Functions for parsing blocks from the bitcode file
-//===----------------------------------------------------------------------===//
-
-bool BitcodeReader::ParseParamAttrBlock() {
- if (Stream.EnterSubBlock(bitc::PARAMATTR_BLOCK_ID))
- return Error("Malformed block record");
-
- if (!ParamAttrs.empty())
- return Error("Multiple PARAMATTR blocks found!");
-
- SmallVector<uint64_t, 64> Record;
-
- SmallVector<ParamAttrsWithIndex, 8> Attrs;
-
- // Read all the records.
- while (1) {
- unsigned Code = Stream.ReadCode();
- if (Code == bitc::END_BLOCK) {
- if (Stream.ReadBlockEnd())
- return Error("Error at end of PARAMATTR block");
- return false;
- }
-
- if (Code == bitc::ENTER_SUBBLOCK) {
- // No known subblocks, always skip them.
- Stream.ReadSubBlockID();
- if (Stream.SkipBlock())
- return Error("Malformed block record");
- continue;
- }
-
- if (Code == bitc::DEFINE_ABBREV) {
- Stream.ReadAbbrevRecord();
- continue;
- }
-
- // Read a record.
- Record.clear();
- switch (Stream.ReadRecord(Code, Record)) {
- default: // Default behavior: ignore.
- break;
- case bitc::PARAMATTR_CODE_ENTRY: { // ENTRY: [paramidx0, attr0, ...]
- if (Record.size() & 1)
- return Error("Invalid ENTRY record");
-
- for (unsigned i = 0, e = Record.size(); i != e; i += 2) {
- if (Record[i+1] != ParamAttr::None)
- Attrs.push_back(ParamAttrsWithIndex::get(Record[i], Record[i+1]));
- }
-
- ParamAttrs.push_back(PAListPtr::get(Attrs.begin(), Attrs.end()));
- Attrs.clear();
- break;
- }
- }
- }
-}
-
-
-bool BitcodeReader::ParseTypeTable() {
- if (Stream.EnterSubBlock(bitc::TYPE_BLOCK_ID))
- return Error("Malformed block record");
-
- if (!TypeList.empty())
- return Error("Multiple TYPE_BLOCKs found!");
-
- SmallVector<uint64_t, 64> Record;
- unsigned NumRecords = 0;
-
- // Read all the records for this type table.
- while (1) {
- unsigned Code = Stream.ReadCode();
- if (Code == bitc::END_BLOCK) {
- if (NumRecords != TypeList.size())
- return Error("Invalid type forward reference in TYPE_BLOCK");
- if (Stream.ReadBlockEnd())
- return Error("Error at end of type table block");
- return false;
- }
-
- if (Code == bitc::ENTER_SUBBLOCK) {
- // No known subblocks, always skip them.
- Stream.ReadSubBlockID();
- if (Stream.SkipBlock())
- return Error("Malformed block record");
- continue;
- }
-
- if (Code == bitc::DEFINE_ABBREV) {
- Stream.ReadAbbrevRecord();
- continue;
- }
-
- // Read a record.
- Record.clear();
- const Type *ResultTy = 0;
- switch (Stream.ReadRecord(Code, Record)) {
- default: // Default behavior: unknown type.
- ResultTy = 0;
- break;
- case bitc::TYPE_CODE_NUMENTRY: // TYPE_CODE_NUMENTRY: [numentries]
- // TYPE_CODE_NUMENTRY contains a count of the number of types in the
- // type list. This allows us to reserve space.
- if (Record.size() < 1)
- return Error("Invalid TYPE_CODE_NUMENTRY record");
- TypeList.reserve(Record[0]);
- continue;
- case bitc::TYPE_CODE_VOID: // VOID
- ResultTy = Type::VoidTy;
- break;
- case bitc::TYPE_CODE_FLOAT: // FLOAT
- ResultTy = Type::FloatTy;
- break;
- case bitc::TYPE_CODE_DOUBLE: // DOUBLE
- ResultTy = Type::DoubleTy;
- break;
- case bitc::TYPE_CODE_X86_FP80: // X86_FP80
- ResultTy = Type::X86_FP80Ty;
- break;
- case bitc::TYPE_CODE_FP128: // FP128
- ResultTy = Type::FP128Ty;
- break;
- case bitc::TYPE_CODE_PPC_FP128: // PPC_FP128
- ResultTy = Type::PPC_FP128Ty;
- break;
- case bitc::TYPE_CODE_LABEL: // LABEL
- ResultTy = Type::LabelTy;
- break;
- case bitc::TYPE_CODE_OPAQUE: // OPAQUE
- ResultTy = 0;
- break;
- case bitc::TYPE_CODE_INTEGER: // INTEGER: [width]
- if (Record.size() < 1)
- return Error("Invalid Integer type record");
-
- ResultTy = IntegerType::get(Record[0]);
- break;
- case bitc::TYPE_CODE_POINTER: { // POINTER: [pointee type] or
- // [pointee type, address space]
- if (Record.size() < 1)
- return Error("Invalid POINTER type record");
- unsigned AddressSpace = 0;
- if (Record.size() == 2)
- AddressSpace = Record[1];
- ResultTy = PointerType::get(getTypeByID(Record[0], true), AddressSpace);
- break;
- }
- case bitc::TYPE_CODE_FUNCTION: {
- // FIXME: attrid is dead, remove it in LLVM 3.0
- // FUNCTION: [vararg, attrid, retty, paramty x N]
- if (Record.size() < 3)
- return Error("Invalid FUNCTION type record");
- std::vector<const Type*> ArgTys;
- for (unsigned i = 3, e = Record.size(); i != e; ++i)
- ArgTys.push_back(getTypeByID(Record[i], true));
-
- ResultTy = FunctionType::get(getTypeByID(Record[2], true), ArgTys,
- Record[0]);
- break;
- }
- case bitc::TYPE_CODE_STRUCT: { // STRUCT: [ispacked, eltty x N]
- if (Record.size() < 1)
- return Error("Invalid STRUCT type record");
- std::vector<const Type*> EltTys;
- for (unsigned i = 1, e = Record.size(); i != e; ++i)
- EltTys.push_back(getTypeByID(Record[i], true));
- ResultTy = StructType::get(EltTys, Record[0]);
- break;
- }
- case bitc::TYPE_CODE_ARRAY: // ARRAY: [numelts, eltty]
- if (Record.size() < 2)
- return Error("Invalid ARRAY type record");
- ResultTy = ArrayType::get(getTypeByID(Record[1], true), Record[0]);
- break;
- case bitc::TYPE_CODE_VECTOR: // VECTOR: [numelts, eltty]
- if (Record.size() < 2)
- return Error("Invalid VECTOR type record");
- ResultTy = VectorType::get(getTypeByID(Record[1], true), Record[0]);
- break;
- }
-
- if (NumRecords == TypeList.size()) {
- // If this is a new type slot, just append it.
- TypeList.push_back(ResultTy ? ResultTy : OpaqueType::get());
- ++NumRecords;
- } else if (ResultTy == 0) {
- // Otherwise, this was forward referenced, so an opaque type was created,
- // but the result type is actually just an opaque. Leave the one we
- // created previously.
- ++NumRecords;
- } else {
- // Otherwise, this was forward referenced, so an opaque type was created.
- // Resolve the opaque type to the real type now.
- assert(NumRecords < TypeList.size() && "Typelist imbalance");
- const OpaqueType *OldTy = cast<OpaqueType>(TypeList[NumRecords++].get());
-
- // Don't directly push the new type on the Tab. Instead we want to replace
- // the opaque type we previously inserted with the new concrete value. The
- // refinement from the abstract (opaque) type to the new type causes all
- // uses of the abstract type to use the concrete type (NewTy). This will
- // also cause the opaque type to be deleted.
- const_cast<OpaqueType*>(OldTy)->refineAbstractTypeTo(ResultTy);
-
- // This should have replaced the old opaque type with the new type in the
- // value table... or with a preexisting type that was already in the
- // system. Let's just make sure it did.
- assert(TypeList[NumRecords-1].get() != OldTy &&
- "refineAbstractType didn't work!");
- }
- }
-}
-
-
-bool BitcodeReader::ParseTypeSymbolTable() {
- if (Stream.EnterSubBlock(bitc::TYPE_SYMTAB_BLOCK_ID))
- return Error("Malformed block record");
-
- SmallVector<uint64_t, 64> Record;
-
- // Read all the records for this type table.
- std::string TypeName;
- while (1) {
- unsigned Code = Stream.ReadCode();
- if (Code == bitc::END_BLOCK) {
- if (Stream.ReadBlockEnd())
- return Error("Error at end of type symbol table block");
- return false;
- }
-
- if (Code == bitc::ENTER_SUBBLOCK) {
- // No known subblocks, always skip them.
- Stream.ReadSubBlockID();
- if (Stream.SkipBlock())
- return Error("Malformed block record");
- continue;
- }
-
- if (Code == bitc::DEFINE_ABBREV) {
- Stream.ReadAbbrevRecord();
- continue;
- }
-
- // Read a record.
- Record.clear();
- switch (Stream.ReadRecord(Code, Record)) {
- default: // Default behavior: unknown type.
- break;
- case bitc::TST_CODE_ENTRY: // TST_ENTRY: [typeid, namechar x N]
- if (ConvertToString(Record, 1, TypeName))
- return Error("Invalid TST_ENTRY record");
- unsigned TypeID = Record[0];
- if (TypeID >= TypeList.size())
- return Error("Invalid Type ID in TST_ENTRY record");
-
- TheModule->addTypeName(TypeName, TypeList[TypeID].get());
- TypeName.clear();
- break;
- }
- }
-}
-
-bool BitcodeReader::ParseValueSymbolTable() {
- if (Stream.EnterSubBlock(bitc::VALUE_SYMTAB_BLOCK_ID))
- return Error("Malformed block record");
-
- SmallVector<uint64_t, 64> Record;
-
- // Read all the records for this value table.
- SmallString<128> ValueName;
- while (1) {
- unsigned Code = Stream.ReadCode();
- if (Code == bitc::END_BLOCK) {
- if (Stream.ReadBlockEnd())
- return Error("Error at end of value symbol table block");
- return false;
- }
- if (Code == bitc::ENTER_SUBBLOCK) {
- // No known subblocks, always skip them.
- Stream.ReadSubBlockID();
- if (Stream.SkipBlock())
- return Error("Malformed block record");
- continue;
- }
-
- if (Code == bitc::DEFINE_ABBREV) {
- Stream.ReadAbbrevRecord();
- continue;
- }
-
- // Read a record.
- Record.clear();
- switch (Stream.ReadRecord(Code, Record)) {
- default: // Default behavior: unknown type.
- break;
- case bitc::VST_CODE_ENTRY: { // VST_ENTRY: [valueid, namechar x N]
- if (ConvertToString(Record, 1, ValueName))
- return Error("Invalid TST_ENTRY record");
- unsigned ValueID = Record[0];
- if (ValueID >= ValueList.size())
- return Error("Invalid Value ID in VST_ENTRY record");
- Value *V = ValueList[ValueID];
-
- V->setName(&ValueName[0], ValueName.size());
- ValueName.clear();
- break;
- }
- case bitc::VST_CODE_BBENTRY: {
- if (ConvertToString(Record, 1, ValueName))
- return Error("Invalid VST_BBENTRY record");
- BasicBlock *BB = getBasicBlock(Record[0]);
- if (BB == 0)
- return Error("Invalid BB ID in VST_BBENTRY record");
-
- BB->setName(&ValueName[0], ValueName.size());
- ValueName.clear();
- break;
- }
- }
- }
-}
-
-/// DecodeSignRotatedValue - Decode a signed value stored with the sign bit in
-/// the LSB for dense VBR encoding.
-static uint64_t DecodeSignRotatedValue(uint64_t V) {
- if ((V & 1) == 0)
- return V >> 1;
- if (V != 1)
- return -(V >> 1);
- // There is no such thing as -0 with integers. "-0" really means MININT.
- return 1ULL << 63;
-}
-
-/// ResolveGlobalAndAliasInits - Resolve all of the initializers for global
-/// values and aliases that we can.
-bool BitcodeReader::ResolveGlobalAndAliasInits() {
- std::vector<std::pair<GlobalVariable*, unsigned> > GlobalInitWorklist;
- std::vector<std::pair<GlobalAlias*, unsigned> > AliasInitWorklist;
-
- GlobalInitWorklist.swap(GlobalInits);
- AliasInitWorklist.swap(AliasInits);
-
- while (!GlobalInitWorklist.empty()) {
- unsigned ValID = GlobalInitWorklist.back().second;
- if (ValID >= ValueList.size()) {
- // Not ready to resolve this yet, it requires something later in the file.
- GlobalInits.push_back(GlobalInitWorklist.back());
- } else {
- if (Constant *C = dyn_cast<Constant>(ValueList[ValID]))
- GlobalInitWorklist.back().first->setInitializer(C);
- else
- return Error("Global variable initializer is not a constant!");
- }
- GlobalInitWorklist.pop_back();
- }
-
- while (!AliasInitWorklist.empty()) {
- unsigned ValID = AliasInitWorklist.back().second;
- if (ValID >= ValueList.size()) {
- AliasInits.push_back(AliasInitWorklist.back());
- } else {
- if (Constant *C = dyn_cast<Constant>(ValueList[ValID]))
- AliasInitWorklist.back().first->setAliasee(C);
- else
- return Error("Alias initializer is not a constant!");
- }
- AliasInitWorklist.pop_back();
- }
- return false;
-}
-
-
-bool BitcodeReader::ParseConstants() {
- if (Stream.EnterSubBlock(bitc::CONSTANTS_BLOCK_ID))
- return Error("Malformed block record");
-
- SmallVector<uint64_t, 64> Record;
-
- // Read all the records for this value table.
- const Type *CurTy = Type::Int32Ty;
- unsigned NextCstNo = ValueList.size();
- while (1) {
- unsigned Code = Stream.ReadCode();
- if (Code == bitc::END_BLOCK) {
- if (NextCstNo != ValueList.size())
- return Error("Invalid constant reference!");
-
- if (Stream.ReadBlockEnd())
- return Error("Error at end of constants block");
- return false;
- }
-
- if (Code == bitc::ENTER_SUBBLOCK) {
- // No known subblocks, always skip them.
- Stream.ReadSubBlockID();
- if (Stream.SkipBlock())
- return Error("Malformed block record");
- continue;
- }
-
- if (Code == bitc::DEFINE_ABBREV) {
- Stream.ReadAbbrevRecord();
- continue;
- }
-
- // Read a record.
- Record.clear();
- Value *V = 0;
- switch (Stream.ReadRecord(Code, Record)) {
- default: // Default behavior: unknown constant
- case bitc::CST_CODE_UNDEF: // UNDEF
- V = UndefValue::get(CurTy);
- break;
- case bitc::CST_CODE_SETTYPE: // SETTYPE: [typeid]
- if (Record.empty())
- return Error("Malformed CST_SETTYPE record");
- if (Record[0] >= TypeList.size())
- return Error("Invalid Type ID in CST_SETTYPE record");
- CurTy = TypeList[Record[0]];
- continue; // Skip the ValueList manipulation.
- case bitc::CST_CODE_NULL: // NULL
- V = Constant::getNullValue(CurTy);
- break;
- case bitc::CST_CODE_INTEGER: // INTEGER: [intval]
- if (!isa<IntegerType>(CurTy) || Record.empty())
- return Error("Invalid CST_INTEGER record");
- V = ConstantInt::get(CurTy, DecodeSignRotatedValue(Record[0]));
- break;
- case bitc::CST_CODE_WIDE_INTEGER: {// WIDE_INTEGER: [n x intval]
- if (!isa<IntegerType>(CurTy) || Record.empty())
- return Error("Invalid WIDE_INTEGER record");
-
- unsigned NumWords = Record.size();
- SmallVector<uint64_t, 8> Words;
- Words.resize(NumWords);
- for (unsigned i = 0; i != NumWords; ++i)
- Words[i] = DecodeSignRotatedValue(Record[i]);
- V = ConstantInt::get(APInt(cast<IntegerType>(CurTy)->getBitWidth(),
- NumWords, &Words[0]));
- break;
- }
- case bitc::CST_CODE_FLOAT: { // FLOAT: [fpval]
- if (Record.empty())
- return Error("Invalid FLOAT record");
- if (CurTy == Type::FloatTy)
- V = ConstantFP::get(APFloat(APInt(32, (uint32_t)Record[0])));
- else if (CurTy == Type::DoubleTy)
- V = ConstantFP::get(APFloat(APInt(64, Record[0])));
- else if (CurTy == Type::X86_FP80Ty)
- V = ConstantFP::get(APFloat(APInt(80, 2, &Record[0])));
- else if (CurTy == Type::FP128Ty)
- V = ConstantFP::get(APFloat(APInt(128, 2, &Record[0]), true));
- else if (CurTy == Type::PPC_FP128Ty)
- V = ConstantFP::get(APFloat(APInt(128, 2, &Record[0])));
- else
- V = UndefValue::get(CurTy);
- break;
- }
-
- case bitc::CST_CODE_AGGREGATE: {// AGGREGATE: [n x value number]
- if (Record.empty())
- return Error("Invalid CST_AGGREGATE record");
-
- unsigned Size = Record.size();
- std::vector<Constant*> Elts;
-
- if (const StructType *STy = dyn_cast<StructType>(CurTy)) {
- for (unsigned i = 0; i != Size; ++i)
- Elts.push_back(ValueList.getConstantFwdRef(Record[i],
- STy->getElementType(i)));
- V = ConstantStruct::get(STy, Elts);
- } else if (const ArrayType *ATy = dyn_cast<ArrayType>(CurTy)) {
- const Type *EltTy = ATy->getElementType();
- for (unsigned i = 0; i != Size; ++i)
- Elts.push_back(ValueList.getConstantFwdRef(Record[i], EltTy));
- V = ConstantArray::get(ATy, Elts);
- } else if (const VectorType *VTy = dyn_cast<VectorType>(CurTy)) {
- const Type *EltTy = VTy->getElementType();
- for (unsigned i = 0; i != Size; ++i)
- Elts.push_back(ValueList.getConstantFwdRef(Record[i], EltTy));
- V = ConstantVector::get(Elts);
- } else {
- V = UndefValue::get(CurTy);
- }
- break;
- }
- case bitc::CST_CODE_STRING: { // STRING: [values]
- if (Record.empty())
- return Error("Invalid CST_AGGREGATE record");
-
- const ArrayType *ATy = cast<ArrayType>(CurTy);
- const Type *EltTy = ATy->getElementType();
-
- unsigned Size = Record.size();
- std::vector<Constant*> Elts;
- for (unsigned i = 0; i != Size; ++i)
- Elts.push_back(ConstantInt::get(EltTy, Record[i]));
- V = ConstantArray::get(ATy, Elts);
- break;
- }
- case bitc::CST_CODE_CSTRING: { // CSTRING: [values]
- if (Record.empty())
- return Error("Invalid CST_AGGREGATE record");
-
- const ArrayType *ATy = cast<ArrayType>(CurTy);
- const Type *EltTy = ATy->getElementType();
-
- unsigned Size = Record.size();
- std::vector<Constant*> Elts;
- for (unsigned i = 0; i != Size; ++i)
- Elts.push_back(ConstantInt::get(EltTy, Record[i]));
- Elts.push_back(Constant::getNullValue(EltTy));
- V = ConstantArray::get(ATy, Elts);
- break;
- }
- case bitc::CST_CODE_CE_BINOP: { // CE_BINOP: [opcode, opval, opval]
- if (Record.size() < 3) return Error("Invalid CE_BINOP record");
- int Opc = GetDecodedBinaryOpcode(Record[0], CurTy);
- if (Opc < 0) {
- V = UndefValue::get(CurTy); // Unknown binop.
- } else {
- Constant *LHS = ValueList.getConstantFwdRef(Record[1], CurTy);
- Constant *RHS = ValueList.getConstantFwdRef(Record[2], CurTy);
- V = ConstantExpr::get(Opc, LHS, RHS);
- }
- break;
- }
- case bitc::CST_CODE_CE_CAST: { // CE_CAST: [opcode, opty, opval]
- if (Record.size() < 3) return Error("Invalid CE_CAST record");
- int Opc = GetDecodedCastOpcode(Record[0]);
- if (Opc < 0) {
- V = UndefValue::get(CurTy); // Unknown cast.
- } else {
- const Type *OpTy = getTypeByID(Record[1]);
- if (!OpTy) return Error("Invalid CE_CAST record");
- Constant *Op = ValueList.getConstantFwdRef(Record[2], OpTy);
- V = ConstantExpr::getCast(Opc, Op, CurTy);
- }
- break;
- }
- case bitc::CST_CODE_CE_GEP: { // CE_GEP: [n x operands]
- if (Record.size() & 1) return Error("Invalid CE_GEP record");
- SmallVector<Constant*, 16> Elts;
- for (unsigned i = 0, e = Record.size(); i != e; i += 2) {
- const Type *ElTy = getTypeByID(Record[i]);
- if (!ElTy) return Error("Invalid CE_GEP record");
- Elts.push_back(ValueList.getConstantFwdRef(Record[i+1], ElTy));
- }
- V = ConstantExpr::getGetElementPtr(Elts[0], &Elts[1], Elts.size()-1);
- break;
- }
- case bitc::CST_CODE_CE_SELECT: // CE_SELECT: [opval#, opval#, opval#]
- if (Record.size() < 3) return Error("Invalid CE_SELECT record");
- V = ConstantExpr::getSelect(ValueList.getConstantFwdRef(Record[0],
- Type::Int1Ty),
- ValueList.getConstantFwdRef(Record[1],CurTy),
- ValueList.getConstantFwdRef(Record[2],CurTy));
- break;
- case bitc::CST_CODE_CE_EXTRACTELT: { // CE_EXTRACTELT: [opty, opval, opval]
- if (Record.size() < 3) return Error("Invalid CE_EXTRACTELT record");
- const VectorType *OpTy =
- dyn_cast_or_null<VectorType>(getTypeByID(Record[0]));
- if (OpTy == 0) return Error("Invalid CE_EXTRACTELT record");
- Constant *Op0 = ValueList.getConstantFwdRef(Record[1], OpTy);
- Constant *Op1 = ValueList.getConstantFwdRef(Record[2],
- OpTy->getElementType());
- V = ConstantExpr::getExtractElement(Op0, Op1);
- break;
- }
- case bitc::CST_CODE_CE_INSERTELT: { // CE_INSERTELT: [opval, opval, opval]
- const VectorType *OpTy = dyn_cast<VectorType>(CurTy);
- if (Record.size() < 3 || OpTy == 0)
- return Error("Invalid CE_INSERTELT record");
- Constant *Op0 = ValueList.getConstantFwdRef(Record[0], OpTy);
- Constant *Op1 = ValueList.getConstantFwdRef(Record[1],
- OpTy->getElementType());
- Constant *Op2 = ValueList.getConstantFwdRef(Record[2], Type::Int32Ty);
- V = ConstantExpr::getInsertElement(Op0, Op1, Op2);
- break;
- }
- case bitc::CST_CODE_CE_SHUFFLEVEC: { // CE_SHUFFLEVEC: [opval, opval, opval]
- const VectorType *OpTy = dyn_cast<VectorType>(CurTy);
- if (Record.size() < 3 || OpTy == 0)
- return Error("Invalid CE_INSERTELT record");
- Constant *Op0 = ValueList.getConstantFwdRef(Record[0], OpTy);
- Constant *Op1 = ValueList.getConstantFwdRef(Record[1], OpTy);
- const Type *ShufTy=VectorType::get(Type::Int32Ty, OpTy->getNumElements());
- Constant *Op2 = ValueList.getConstantFwdRef(Record[2], ShufTy);
- V = ConstantExpr::getShuffleVector(Op0, Op1, Op2);
- break;
- }
- case bitc::CST_CODE_CE_CMP: { // CE_CMP: [opty, opval, opval, pred]
- if (Record.size() < 4) return Error("Invalid CE_CMP record");
- const Type *OpTy = getTypeByID(Record[0]);
- if (OpTy == 0) return Error("Invalid CE_CMP record");
- Constant *Op0 = ValueList.getConstantFwdRef(Record[1], OpTy);
- Constant *Op1 = ValueList.getConstantFwdRef(Record[2], OpTy);
-
- if (OpTy->isFloatingPoint())
- V = ConstantExpr::getFCmp(Record[3], Op0, Op1);
- else
- V = ConstantExpr::getICmp(Record[3], Op0, Op1);
- break;
- }
- case bitc::CST_CODE_INLINEASM: {
- if (Record.size() < 2) return Error("Invalid INLINEASM record");
- std::string AsmStr, ConstrStr;
- bool HasSideEffects = Record[0];
- unsigned AsmStrSize = Record[1];
- if (2+AsmStrSize >= Record.size())
- return Error("Invalid INLINEASM record");
- unsigned ConstStrSize = Record[2+AsmStrSize];
- if (3+AsmStrSize+ConstStrSize > Record.size())
- return Error("Invalid INLINEASM record");
-
- for (unsigned i = 0; i != AsmStrSize; ++i)
- AsmStr += (char)Record[2+i];
- for (unsigned i = 0; i != ConstStrSize; ++i)
- ConstrStr += (char)Record[3+AsmStrSize+i];
- const PointerType *PTy = cast<PointerType>(CurTy);
- V = InlineAsm::get(cast<FunctionType>(PTy->getElementType()),
- AsmStr, ConstrStr, HasSideEffects);
- break;
- }
- }
-
- ValueList.AssignValue(V, NextCstNo);
- ++NextCstNo;
- }
-}
-
-/// RememberAndSkipFunctionBody - When we see the block for a function body,
-/// remember where it is and then skip it. This lets us lazily deserialize the
-/// functions.
-bool BitcodeReader::RememberAndSkipFunctionBody() {
- // Get the function we are talking about.
- if (FunctionsWithBodies.empty())
- return Error("Insufficient function protos");
-
- Function *Fn = FunctionsWithBodies.back();
- FunctionsWithBodies.pop_back();
-
- // Save the current stream state.
- uint64_t CurBit = Stream.GetCurrentBitNo();
- DeferredFunctionInfo[Fn] = std::make_pair(CurBit, Fn->getLinkage());
-
- // Set the functions linkage to GhostLinkage so we know it is lazily
- // deserialized.
- Fn->setLinkage(GlobalValue::GhostLinkage);
-
- // Skip over the function block for now.
- if (Stream.SkipBlock())
- return Error("Malformed block record");
- return false;
-}
-
-bool BitcodeReader::ParseModule(const std::string &ModuleID) {
- // Reject multiple MODULE_BLOCK's in a single bitstream.
- if (TheModule)
- return Error("Multiple MODULE_BLOCKs in same stream");
-
- if (Stream.EnterSubBlock(bitc::MODULE_BLOCK_ID))
- return Error("Malformed block record");
-
- // Otherwise, create the module.
- TheModule = new Module(ModuleID);
-
- SmallVector<uint64_t, 64> Record;
- std::vector<std::string> SectionTable;
- std::vector<std::string> CollectorTable;
-
- // Read all the records for this module.
- while (!Stream.AtEndOfStream()) {
- unsigned Code = Stream.ReadCode();
- if (Code == bitc::END_BLOCK) {
- if (Stream.ReadBlockEnd())
- return Error("Error at end of module block");
-
- // Patch the initializers for globals and aliases up.
- ResolveGlobalAndAliasInits();
- if (!GlobalInits.empty() || !AliasInits.empty())
- return Error("Malformed global initializer set");
- if (!FunctionsWithBodies.empty())
- return Error("Too few function bodies found");
-
- // Look for intrinsic functions which need to be upgraded at some point
- for (Module::iterator FI = TheModule->begin(), FE = TheModule->end();
- FI != FE; ++FI) {
- Function* NewFn;
- if (UpgradeIntrinsicFunction(FI, NewFn))
- UpgradedIntrinsics.push_back(std::make_pair(FI, NewFn));
- }
-
- // Force deallocation of memory for these vectors to favor the client that
- // want lazy deserialization.
- std::vector<std::pair<GlobalVariable*, unsigned> >().swap(GlobalInits);
- std::vector<std::pair<GlobalAlias*, unsigned> >().swap(AliasInits);
- std::vector<Function*>().swap(FunctionsWithBodies);
- return false;
- }
-
- if (Code == bitc::ENTER_SUBBLOCK) {
- switch (Stream.ReadSubBlockID()) {
- default: // Skip unknown content.
- if (Stream.SkipBlock())
- return Error("Malformed block record");
- break;
- case bitc::BLOCKINFO_BLOCK_ID:
- if (Stream.ReadBlockInfoBlock())
- return Error("Malformed BlockInfoBlock");
- break;
- case bitc::PARAMATTR_BLOCK_ID:
- if (ParseParamAttrBlock())
- return true;
- break;
- case bitc::TYPE_BLOCK_ID:
- if (ParseTypeTable())
- return true;
- break;
- case bitc::TYPE_SYMTAB_BLOCK_ID:
- if (ParseTypeSymbolTable())
- return true;
- break;
- case bitc::VALUE_SYMTAB_BLOCK_ID:
- if (ParseValueSymbolTable())
- return true;
- break;
- case bitc::CONSTANTS_BLOCK_ID:
- if (ParseConstants() || ResolveGlobalAndAliasInits())
- return true;
- break;
- case bitc::FUNCTION_BLOCK_ID:
- // If this is the first function body we've seen, reverse the
- // FunctionsWithBodies list.
- if (!HasReversedFunctionsWithBodies) {
- std::reverse(FunctionsWithBodies.begin(), FunctionsWithBodies.end());
- HasReversedFunctionsWithBodies = true;
- }
-
- if (RememberAndSkipFunctionBody())
- return true;
- break;
- }
- continue;
- }
-
- if (Code == bitc::DEFINE_ABBREV) {
- Stream.ReadAbbrevRecord();
- continue;
- }
-
- // Read a record.
- switch (Stream.ReadRecord(Code, Record)) {
- default: break; // Default behavior, ignore unknown content.
- case bitc::MODULE_CODE_VERSION: // VERSION: [version#]
- if (Record.size() < 1)
- return Error("Malformed MODULE_CODE_VERSION");
- // Only version #0 is supported so far.
- if (Record[0] != 0)
- return Error("Unknown bitstream version!");
- break;
- case bitc::MODULE_CODE_TRIPLE: { // TRIPLE: [strchr x N]
- std::string S;
- if (ConvertToString(Record, 0, S))
- return Error("Invalid MODULE_CODE_TRIPLE record");
- TheModule->setTargetTriple(S);
- break;
- }
- case bitc::MODULE_CODE_DATALAYOUT: { // DATALAYOUT: [strchr x N]
- std::string S;
- if (ConvertToString(Record, 0, S))
- return Error("Invalid MODULE_CODE_DATALAYOUT record");
- TheModule->setDataLayout(S);
- break;
- }
- case bitc::MODULE_CODE_ASM: { // ASM: [strchr x N]
- std::string S;
- if (ConvertToString(Record, 0, S))
- return Error("Invalid MODULE_CODE_ASM record");
- TheModule->setModuleInlineAsm(S);
- break;
- }
- case bitc::MODULE_CODE_DEPLIB: { // DEPLIB: [strchr x N]
- std::string S;
- if (ConvertToString(Record, 0, S))
- return Error("Invalid MODULE_CODE_DEPLIB record");
- TheModule->addLibrary(S);
- break;
- }
- case bitc::MODULE_CODE_SECTIONNAME: { // SECTIONNAME: [strchr x N]
- std::string S;
- if (ConvertToString(Record, 0, S))
- return Error("Invalid MODULE_CODE_SECTIONNAME record");
- SectionTable.push_back(S);
- break;
- }
- case bitc::MODULE_CODE_COLLECTORNAME: { // SECTIONNAME: [strchr x N]
- std::string S;
- if (ConvertToString(Record, 0, S))
- return Error("Invalid MODULE_CODE_COLLECTORNAME record");
- CollectorTable.push_back(S);
- break;
- }
- // GLOBALVAR: [pointer type, isconst, initid,
- // linkage, alignment, section, visibility, threadlocal]
- case bitc::MODULE_CODE_GLOBALVAR: {
- if (Record.size() < 6)
- return Error("Invalid MODULE_CODE_GLOBALVAR record");
- const Type *Ty = getTypeByID(Record[0]);
- if (!isa<PointerType>(Ty))
- return Error("Global not a pointer type!");
- unsigned AddressSpace = cast<PointerType>(Ty)->getAddressSpace();
- Ty = cast<PointerType>(Ty)->getElementType();
-
- bool isConstant = Record[1];
- GlobalValue::LinkageTypes Linkage = GetDecodedLinkage(Record[3]);
- unsigned Alignment = (1 << Record[4]) >> 1;
- std::string Section;
- if (Record[5]) {
- if (Record[5]-1 >= SectionTable.size())
- return Error("Invalid section ID");
- Section = SectionTable[Record[5]-1];
- }
- GlobalValue::VisibilityTypes Visibility = GlobalValue::DefaultVisibility;
- if (Record.size() > 6)
- Visibility = GetDecodedVisibility(Record[6]);
- bool isThreadLocal = false;
- if (Record.size() > 7)
- isThreadLocal = Record[7];
-
- GlobalVariable *NewGV =
- new GlobalVariable(Ty, isConstant, Linkage, 0, "", TheModule,
- isThreadLocal, AddressSpace);
- NewGV->setAlignment(Alignment);
- if (!Section.empty())
- NewGV->setSection(Section);
- NewGV->setVisibility(Visibility);
- NewGV->setThreadLocal(isThreadLocal);
-
- ValueList.push_back(NewGV);
-
- // Remember which value to use for the global initializer.
- if (unsigned InitID = Record[2])
- GlobalInits.push_back(std::make_pair(NewGV, InitID-1));
- break;
- }
- // FUNCTION: [type, callingconv, isproto, linkage, paramattr,
- // alignment, section, visibility, collector]
- case bitc::MODULE_CODE_FUNCTION: {
- if (Record.size() < 8)
- return Error("Invalid MODULE_CODE_FUNCTION record");
- const Type *Ty = getTypeByID(Record[0]);
- if (!isa<PointerType>(Ty))
- return Error("Function not a pointer type!");
- const FunctionType *FTy =
- dyn_cast<FunctionType>(cast<PointerType>(Ty)->getElementType());
- if (!FTy)
- return Error("Function not a pointer to function type!");
-
- Function *Func = Function::Create(FTy, GlobalValue::ExternalLinkage,
- "", TheModule);
-
- Func->setCallingConv(Record[1]);
- bool isProto = Record[2];
- Func->setLinkage(GetDecodedLinkage(Record[3]));
- Func->setParamAttrs(getParamAttrs(Record[4]));
-
- Func->setAlignment((1 << Record[5]) >> 1);
- if (Record[6]) {
- if (Record[6]-1 >= SectionTable.size())
- return Error("Invalid section ID");
- Func->setSection(SectionTable[Record[6]-1]);
- }
- Func->setVisibility(GetDecodedVisibility(Record[7]));
- if (Record.size() > 8 && Record[8]) {
- if (Record[8]-1 > CollectorTable.size())
- return Error("Invalid collector ID");
- Func->setCollector(CollectorTable[Record[8]-1].c_str());
- }
-
- ValueList.push_back(Func);
-
- // If this is a function with a body, remember the prototype we are
- // creating now, so that we can match up the body with them later.
- if (!isProto)
- FunctionsWithBodies.push_back(Func);
- break;
- }
- // ALIAS: [alias type, aliasee val#, linkage]
- // ALIAS: [alias type, aliasee val#, linkage, visibility]
- case bitc::MODULE_CODE_ALIAS: {
- if (Record.size() < 3)
- return Error("Invalid MODULE_ALIAS record");
- const Type *Ty = getTypeByID(Record[0]);
- if (!isa<PointerType>(Ty))
- return Error("Function not a pointer type!");
-
- GlobalAlias *NewGA = new GlobalAlias(Ty, GetDecodedLinkage(Record[2]),
- "", 0, TheModule);
- // Old bitcode files didn't have visibility field.
- if (Record.size() > 3)
- NewGA->setVisibility(GetDecodedVisibility(Record[3]));
- ValueList.push_back(NewGA);
- AliasInits.push_back(std::make_pair(NewGA, Record[1]));
- break;
- }
- /// MODULE_CODE_PURGEVALS: [numvals]
- case bitc::MODULE_CODE_PURGEVALS:
- // Trim down the value list to the specified size.
- if (Record.size() < 1 || Record[0] > ValueList.size())
- return Error("Invalid MODULE_PURGEVALS record");
- ValueList.shrinkTo(Record[0]);
- break;
- }
- Record.clear();
- }
-
- return Error("Premature end of bitstream");
-}
-
-
-bool BitcodeReader::ParseBitcode() {
- TheModule = 0;
-
- if (Buffer->getBufferSize() & 3)
- return Error("Bitcode stream should be a multiple of 4 bytes in length");
-
- unsigned char *BufPtr = (unsigned char *)Buffer->getBufferStart();
- Stream.init(BufPtr, BufPtr+Buffer->getBufferSize());
-
- // Sniff for the signature.
- if (Stream.Read(8) != 'B' ||
- Stream.Read(8) != 'C' ||
- Stream.Read(4) != 0x0 ||
- Stream.Read(4) != 0xC ||
- Stream.Read(4) != 0xE ||
- Stream.Read(4) != 0xD)
- return Error("Invalid bitcode signature");
-
- // We expect a number of well-defined blocks, though we don't necessarily
- // need to understand them all.
- while (!Stream.AtEndOfStream()) {
- unsigned Code = Stream.ReadCode();
-
- if (Code != bitc::ENTER_SUBBLOCK)
- return Error("Invalid record at top-level");
-
- unsigned BlockID = Stream.ReadSubBlockID();
-
- // We only know the MODULE subblock ID.
- switch (BlockID) {
- case bitc::BLOCKINFO_BLOCK_ID:
- if (Stream.ReadBlockInfoBlock())
- return Error("Malformed BlockInfoBlock");
- break;
- case bitc::MODULE_BLOCK_ID:
- if (ParseModule(Buffer->getBufferIdentifier()))
- return true;
- break;
- default:
- if (Stream.SkipBlock())
- return Error("Malformed block record");
- break;
- }
- }
-
- return false;
-}
-
-
-/// ParseFunctionBody - Lazily parse the specified function body block.
-bool BitcodeReader::ParseFunctionBody(Function *F) {
- if (Stream.EnterSubBlock(bitc::FUNCTION_BLOCK_ID))
- return Error("Malformed block record");
-
- unsigned ModuleValueListSize = ValueList.size();
-
- // Add all the function arguments to the value table.
- for(Function::arg_iterator I = F->arg_begin(), E = F->arg_end(); I != E; ++I)
- ValueList.push_back(I);
-
- unsigned NextValueNo = ValueList.size();
- BasicBlock *CurBB = 0;
- unsigned CurBBNo = 0;
-
- // Read all the records.
- SmallVector<uint64_t, 64> Record;
- while (1) {
- unsigned Code = Stream.ReadCode();
- if (Code == bitc::END_BLOCK) {
- if (Stream.ReadBlockEnd())
- return Error("Error at end of function block");
- break;
- }
-
- if (Code == bitc::ENTER_SUBBLOCK) {
- switch (Stream.ReadSubBlockID()) {
- default: // Skip unknown content.
- if (Stream.SkipBlock())
- return Error("Malformed block record");
- break;
- case bitc::CONSTANTS_BLOCK_ID:
- if (ParseConstants()) return true;
- NextValueNo = ValueList.size();
- break;
- case bitc::VALUE_SYMTAB_BLOCK_ID:
- if (ParseValueSymbolTable()) return true;
- break;
- }
- continue;
- }
-
- if (Code == bitc::DEFINE_ABBREV) {
- Stream.ReadAbbrevRecord();
- continue;
- }
-
- // Read a record.
- Record.clear();
- Instruction *I = 0;
- switch (Stream.ReadRecord(Code, Record)) {
- default: // Default behavior: reject
- return Error("Unknown instruction");
- case bitc::FUNC_CODE_DECLAREBLOCKS: // DECLAREBLOCKS: [nblocks]
- if (Record.size() < 1 || Record[0] == 0)
- return Error("Invalid DECLAREBLOCKS record");
- // Create all the basic blocks for the function.
- FunctionBBs.resize(Record[0]);
- for (unsigned i = 0, e = FunctionBBs.size(); i != e; ++i)
- FunctionBBs[i] = BasicBlock::Create("", F);
- CurBB = FunctionBBs[0];
- continue;
-
- case bitc::FUNC_CODE_INST_BINOP: { // BINOP: [opval, ty, opval, opcode]
- unsigned OpNum = 0;
- Value *LHS, *RHS;
- if (getValueTypePair(Record, OpNum, NextValueNo, LHS) ||
- getValue(Record, OpNum, LHS->getType(), RHS) ||
- OpNum+1 != Record.size())
- return Error("Invalid BINOP record");
-
- int Opc = GetDecodedBinaryOpcode(Record[OpNum], LHS->getType());
- if (Opc == -1) return Error("Invalid BINOP record");
- I = BinaryOperator::create((Instruction::BinaryOps)Opc, LHS, RHS);
- break;
- }
- case bitc::FUNC_CODE_INST_CAST: { // CAST: [opval, opty, destty, castopc]
- unsigned OpNum = 0;
- Value *Op;
- if (getValueTypePair(Record, OpNum, NextValueNo, Op) ||
- OpNum+2 != Record.size())
- return Error("Invalid CAST record");
-
- const Type *ResTy = getTypeByID(Record[OpNum]);
- int Opc = GetDecodedCastOpcode(Record[OpNum+1]);
- if (Opc == -1 || ResTy == 0)
- return Error("Invalid CAST record");
- I = CastInst::create((Instruction::CastOps)Opc, Op, ResTy);
- break;
- }
- case bitc::FUNC_CODE_INST_GEP: { // GEP: [n x operands]
- unsigned OpNum = 0;
- Value *BasePtr;
- if (getValueTypePair(Record, OpNum, NextValueNo, BasePtr))
- return Error("Invalid GEP record");
-
- SmallVector<Value*, 16> GEPIdx;
- while (OpNum != Record.size()) {
- Value *Op;
- if (getValueTypePair(Record, OpNum, NextValueNo, Op))
- return Error("Invalid GEP record");
- GEPIdx.push_back(Op);
- }
-
- I = GetElementPtrInst::Create(BasePtr, GEPIdx.begin(), GEPIdx.end());
- break;
- }
-
- case bitc::FUNC_CODE_INST_SELECT: { // SELECT: [opval, ty, opval, opval]
- unsigned OpNum = 0;
- Value *TrueVal, *FalseVal, *Cond;
- if (getValueTypePair(Record, OpNum, NextValueNo, TrueVal) ||
- getValue(Record, OpNum, TrueVal->getType(), FalseVal) ||
- getValue(Record, OpNum, Type::Int1Ty, Cond))
- return Error("Invalid SELECT record");
-
- I = SelectInst::Create(Cond, TrueVal, FalseVal);
- break;
- }
-
- case bitc::FUNC_CODE_INST_EXTRACTELT: { // EXTRACTELT: [opty, opval, opval]
- unsigned OpNum = 0;
- Value *Vec, *Idx;
- if (getValueTypePair(Record, OpNum, NextValueNo, Vec) ||
- getValue(Record, OpNum, Type::Int32Ty, Idx))
- return Error("Invalid EXTRACTELT record");
- I = new ExtractElementInst(Vec, Idx);
- break;
- }
-
- case bitc::FUNC_CODE_INST_INSERTELT: { // INSERTELT: [ty, opval,opval,opval]
- unsigned OpNum = 0;
- Value *Vec, *Elt, *Idx;
- if (getValueTypePair(Record, OpNum, NextValueNo, Vec) ||
- getValue(Record, OpNum,
- cast<VectorType>(Vec->getType())->getElementType(), Elt) ||
- getValue(Record, OpNum, Type::Int32Ty, Idx))
- return Error("Invalid INSERTELT record");
- I = InsertElementInst::Create(Vec, Elt, Idx);
- break;
- }
-
- case bitc::FUNC_CODE_INST_SHUFFLEVEC: {// SHUFFLEVEC: [opval,ty,opval,opval]
- unsigned OpNum = 0;
- Value *Vec1, *Vec2, *Mask;
- if (getValueTypePair(Record, OpNum, NextValueNo, Vec1) ||
- getValue(Record, OpNum, Vec1->getType(), Vec2))
- return Error("Invalid SHUFFLEVEC record");
-
- const Type *MaskTy =
- VectorType::get(Type::Int32Ty,
- cast<VectorType>(Vec1->getType())->getNumElements());
-
- if (getValue(Record, OpNum, MaskTy, Mask))
- return Error("Invalid SHUFFLEVEC record");
- I = new ShuffleVectorInst(Vec1, Vec2, Mask);
- break;
- }
-
- case bitc::FUNC_CODE_INST_CMP: { // CMP: [opty, opval, opval, pred]
- unsigned OpNum = 0;
- Value *LHS, *RHS;
- if (getValueTypePair(Record, OpNum, NextValueNo, LHS) ||
- getValue(Record, OpNum, LHS->getType(), RHS) ||
- OpNum+1 != Record.size())
- return Error("Invalid CMP record");
-
- if (LHS->getType()->isFPOrFPVector())
- I = new FCmpInst((FCmpInst::Predicate)Record[OpNum], LHS, RHS);
- else
- I = new ICmpInst((ICmpInst::Predicate)Record[OpNum], LHS, RHS);
- break;
- }
- case bitc::FUNC_CODE_INST_GETRESULT: { // GETRESULT: [ty, val, n]
- if (Record.size() != 2)
- return Error("Invalid GETRESULT record");
- unsigned OpNum = 0;
- Value *Op;
- getValueTypePair(Record, OpNum, NextValueNo, Op);
- unsigned Index = Record[1];
- I = new GetResultInst(Op, Index);
- break;
- }
-
- case bitc::FUNC_CODE_INST_RET: // RET: [opty,opval<optional>]
- {
- unsigned Size = Record.size();
- if (Size == 0) {
- I = ReturnInst::Create();
- break;
- } else {
- unsigned OpNum = 0;
- SmallVector<Value *,4> Vs;
- do {
- Value *Op = NULL;
- if (getValueTypePair(Record, OpNum, NextValueNo, Op))
- return Error("Invalid RET record");
- Vs.push_back(Op);
- } while(OpNum != Record.size());
-
- // SmallVector Vs has at least one element.
- I = ReturnInst::Create(&Vs[0], Vs.size());
- break;
- }
- }
- case bitc::FUNC_CODE_INST_BR: { // BR: [bb#, bb#, opval] or [bb#]
- if (Record.size() != 1 && Record.size() != 3)
- return Error("Invalid BR record");
- BasicBlock *TrueDest = getBasicBlock(Record[0]);
- if (TrueDest == 0)
- return Error("Invalid BR record");
-
- if (Record.size() == 1)
- I = BranchInst::Create(TrueDest);
- else {
- BasicBlock *FalseDest = getBasicBlock(Record[1]);
- Value *Cond = getFnValueByID(Record[2], Type::Int1Ty);
- if (FalseDest == 0 || Cond == 0)
- return Error("Invalid BR record");
- I = BranchInst::Create(TrueDest, FalseDest, Cond);
- }
- break;
- }
- case bitc::FUNC_CODE_INST_SWITCH: { // SWITCH: [opty, opval, n, n x ops]
- if (Record.size() < 3 || (Record.size() & 1) == 0)
- return Error("Invalid SWITCH record");
- const Type *OpTy = getTypeByID(Record[0]);
- Value *Cond = getFnValueByID(Record[1], OpTy);
- BasicBlock *Default = getBasicBlock(Record[2]);
- if (OpTy == 0 || Cond == 0 || Default == 0)
- return Error("Invalid SWITCH record");
- unsigned NumCases = (Record.size()-3)/2;
- SwitchInst *SI = SwitchInst::Create(Cond, Default, NumCases);
- for (unsigned i = 0, e = NumCases; i != e; ++i) {
- ConstantInt *CaseVal =
- dyn_cast_or_null<ConstantInt>(getFnValueByID(Record[3+i*2], OpTy));
- BasicBlock *DestBB = getBasicBlock(Record[1+3+i*2]);
- if (CaseVal == 0 || DestBB == 0) {
- delete SI;
- return Error("Invalid SWITCH record!");
- }
- SI->addCase(CaseVal, DestBB);
- }
- I = SI;
- break;
- }
-
- case bitc::FUNC_CODE_INST_INVOKE: {
- // INVOKE: [attrs, cc, normBB, unwindBB, fnty, op0,op1,op2, ...]
- if (Record.size() < 4) return Error("Invalid INVOKE record");
- PAListPtr PAL = getParamAttrs(Record[0]);
- unsigned CCInfo = Record[1];
- BasicBlock *NormalBB = getBasicBlock(Record[2]);
- BasicBlock *UnwindBB = getBasicBlock(Record[3]);
-
- unsigned OpNum = 4;
- Value *Callee;
- if (getValueTypePair(Record, OpNum, NextValueNo, Callee))
- return Error("Invalid INVOKE record");
-
- const PointerType *CalleeTy = dyn_cast<PointerType>(Callee->getType());
- const FunctionType *FTy = !CalleeTy ? 0 :
- dyn_cast<FunctionType>(CalleeTy->getElementType());
-
- // Check that the right number of fixed parameters are here.
- if (FTy == 0 || NormalBB == 0 || UnwindBB == 0 ||
- Record.size() < OpNum+FTy->getNumParams())
- return Error("Invalid INVOKE record");
-
- SmallVector<Value*, 16> Ops;
- for (unsigned i = 0, e = FTy->getNumParams(); i != e; ++i, ++OpNum) {
- Ops.push_back(getFnValueByID(Record[OpNum], FTy->getParamType(i)));
- if (Ops.back() == 0) return Error("Invalid INVOKE record");
- }
-
- if (!FTy->isVarArg()) {
- if (Record.size() != OpNum)
- return Error("Invalid INVOKE record");
- } else {
- // Read type/value pairs for varargs params.
- while (OpNum != Record.size()) {
- Value *Op;
- if (getValueTypePair(Record, OpNum, NextValueNo, Op))
- return Error("Invalid INVOKE record");
- Ops.push_back(Op);
- }
- }
-
- I = InvokeInst::Create(Callee, NormalBB, UnwindBB, Ops.begin(), Ops.end());
- cast<InvokeInst>(I)->setCallingConv(CCInfo);
- cast<InvokeInst>(I)->setParamAttrs(PAL);
- break;
- }
- case bitc::FUNC_CODE_INST_UNWIND: // UNWIND
- I = new UnwindInst();
- break;
- case bitc::FUNC_CODE_INST_UNREACHABLE: // UNREACHABLE
- I = new UnreachableInst();
- break;
- case bitc::FUNC_CODE_INST_PHI: { // PHI: [ty, val0,bb0, ...]
- if (Record.size() < 1 || ((Record.size()-1)&1))
- return Error("Invalid PHI record");
- const Type *Ty = getTypeByID(Record[0]);
- if (!Ty) return Error("Invalid PHI record");
-
- PHINode *PN = PHINode::Create(Ty);
- PN->reserveOperandSpace((Record.size()-1)/2);
-
- for (unsigned i = 0, e = Record.size()-1; i != e; i += 2) {
- Value *V = getFnValueByID(Record[1+i], Ty);
- BasicBlock *BB = getBasicBlock(Record[2+i]);
- if (!V || !BB) return Error("Invalid PHI record");
- PN->addIncoming(V, BB);
- }
- I = PN;
- break;
- }
-
- case bitc::FUNC_CODE_INST_MALLOC: { // MALLOC: [instty, op, align]
- if (Record.size() < 3)
- return Error("Invalid MALLOC record");
- const PointerType *Ty =
- dyn_cast_or_null<PointerType>(getTypeByID(Record[0]));
- Value *Size = getFnValueByID(Record[1], Type::Int32Ty);
- unsigned Align = Record[2];
- if (!Ty || !Size) return Error("Invalid MALLOC record");
- I = new MallocInst(Ty->getElementType(), Size, (1 << Align) >> 1);
- break;
- }
- case bitc::FUNC_CODE_INST_FREE: { // FREE: [op, opty]
- unsigned OpNum = 0;
- Value *Op;
- if (getValueTypePair(Record, OpNum, NextValueNo, Op) ||
- OpNum != Record.size())
- return Error("Invalid FREE record");
- I = new FreeInst(Op);
- break;
- }
- case bitc::FUNC_CODE_INST_ALLOCA: { // ALLOCA: [instty, op, align]
- if (Record.size() < 3)
- return Error("Invalid ALLOCA record");
- const PointerType *Ty =
- dyn_cast_or_null<PointerType>(getTypeByID(Record[0]));
- Value *Size = getFnValueByID(Record[1], Type::Int32Ty);
- unsigned Align = Record[2];
- if (!Ty || !Size) return Error("Invalid ALLOCA record");
- I = new AllocaInst(Ty->getElementType(), Size, (1 << Align) >> 1);
- break;
- }
- case bitc::FUNC_CODE_INST_LOAD: { // LOAD: [opty, op, align, vol]
- unsigned OpNum = 0;
- Value *Op;
- if (getValueTypePair(Record, OpNum, NextValueNo, Op) ||
- OpNum+2 != Record.size())
- return Error("Invalid LOAD record");
-
- I = new LoadInst(Op, "", Record[OpNum+1], (1 << Record[OpNum]) >> 1);
- break;
- }
- case bitc::FUNC_CODE_INST_STORE2: { // STORE2:[ptrty, ptr, val, align, vol]
- unsigned OpNum = 0;
- Value *Val, *Ptr;
- if (getValueTypePair(Record, OpNum, NextValueNo, Ptr) ||
- getValue(Record, OpNum,
- cast<PointerType>(Ptr->getType())->getElementType(), Val) ||
- OpNum+2 != Record.size())
- return Error("Invalid STORE record");
-
- I = new StoreInst(Val, Ptr, Record[OpNum+1], (1 << Record[OpNum]) >> 1);
- break;
- }
- case bitc::FUNC_CODE_INST_STORE: { // STORE:[val, valty, ptr, align, vol]
- // FIXME: Legacy form of store instruction. Should be removed in LLVM 3.0.
- unsigned OpNum = 0;
- Value *Val, *Ptr;
- if (getValueTypePair(Record, OpNum, NextValueNo, Val) ||
- getValue(Record, OpNum, PointerType::getUnqual(Val->getType()), Ptr)||
- OpNum+2 != Record.size())
- return Error("Invalid STORE record");
-
- I = new StoreInst(Val, Ptr, Record[OpNum+1], (1 << Record[OpNum]) >> 1);
- break;
- }
- case bitc::FUNC_CODE_INST_CALL: {
- // CALL: [paramattrs, cc, fnty, fnid, arg0, arg1...]
- if (Record.size() < 3)
- return Error("Invalid CALL record");
-
- PAListPtr PAL = getParamAttrs(Record[0]);
- unsigned CCInfo = Record[1];
-
- unsigned OpNum = 2;
- Value *Callee;
- if (getValueTypePair(Record, OpNum, NextValueNo, Callee))
- return Error("Invalid CALL record");
-
- const PointerType *OpTy = dyn_cast<PointerType>(Callee->getType());
- const FunctionType *FTy = 0;
- if (OpTy) FTy = dyn_cast<FunctionType>(OpTy->getElementType());
- if (!FTy || Record.size() < FTy->getNumParams()+OpNum)
- return Error("Invalid CALL record");
-
- SmallVector<Value*, 16> Args;
- // Read the fixed params.
- for (unsigned i = 0, e = FTy->getNumParams(); i != e; ++i, ++OpNum) {
- if (FTy->getParamType(i)->getTypeID()==Type::LabelTyID)
- Args.push_back(getBasicBlock(Record[OpNum]));
- else
- Args.push_back(getFnValueByID(Record[OpNum], FTy->getParamType(i)));
- if (Args.back() == 0) return Error("Invalid CALL record");
- }
-
- // Read type/value pairs for varargs params.
- if (!FTy->isVarArg()) {
- if (OpNum != Record.size())
- return Error("Invalid CALL record");
- } else {
- while (OpNum != Record.size()) {
- Value *Op;
- if (getValueTypePair(Record, OpNum, NextValueNo, Op))
- return Error("Invalid CALL record");
- Args.push_back(Op);
- }
- }
-
- I = CallInst::Create(Callee, Args.begin(), Args.end());
- cast<CallInst>(I)->setCallingConv(CCInfo>>1);
- cast<CallInst>(I)->setTailCall(CCInfo & 1);
- cast<CallInst>(I)->setParamAttrs(PAL);
- break;
- }
- case bitc::FUNC_CODE_INST_VAARG: { // VAARG: [valistty, valist, instty]
- if (Record.size() < 3)
- return Error("Invalid VAARG record");
- const Type *OpTy = getTypeByID(Record[0]);
- Value *Op = getFnValueByID(Record[1], OpTy);
- const Type *ResTy = getTypeByID(Record[2]);
- if (!OpTy || !Op || !ResTy)
- return Error("Invalid VAARG record");
- I = new VAArgInst(Op, ResTy);
- break;
- }
- }
-
- // Add instruction to end of current BB. If there is no current BB, reject
- // this file.
- if (CurBB == 0) {
- delete I;
- return Error("Invalid instruction with no BB");
- }
- CurBB->getInstList().push_back(I);
-
- // If this was a terminator instruction, move to the next block.
- if (isa<TerminatorInst>(I)) {
- ++CurBBNo;
- CurBB = CurBBNo < FunctionBBs.size() ? FunctionBBs[CurBBNo] : 0;
- }
-
- // Non-void values get registered in the value table for future use.
- if (I && I->getType() != Type::VoidTy)
- ValueList.AssignValue(I, NextValueNo++);
- }
-
- // Check the function list for unresolved values.
- if (Argument *A = dyn_cast<Argument>(ValueList.back())) {
- if (A->getParent() == 0) {
- // We found at least one unresolved value. Nuke them all to avoid leaks.
- for (unsigned i = ModuleValueListSize, e = ValueList.size(); i != e; ++i){
- if ((A = dyn_cast<Argument>(ValueList.back())) && A->getParent() == 0) {
- A->replaceAllUsesWith(UndefValue::get(A->getType()));
- delete A;
- }
- }
- return Error("Never resolved value found in function!");
- }
- }
-
- // Trim the value list down to the size it was before we parsed this function.
- ValueList.shrinkTo(ModuleValueListSize);
- std::vector<BasicBlock*>().swap(FunctionBBs);
-
- return false;
-}
-
-//===----------------------------------------------------------------------===//
-// ModuleProvider implementation
-//===----------------------------------------------------------------------===//
-
-
-bool BitcodeReader::materializeFunction(Function *F, std::string *ErrInfo) {
- // If it already is material, ignore the request.
- if (!F->hasNotBeenReadFromBitcode()) return false;
-
- DenseMap<Function*, std::pair<uint64_t, unsigned> >::iterator DFII =
- DeferredFunctionInfo.find(F);
- assert(DFII != DeferredFunctionInfo.end() && "Deferred function not found!");
-
- // Move the bit stream to the saved position of the deferred function body and
- // restore the real linkage type for the function.
- Stream.JumpToBit(DFII->second.first);
- F->setLinkage((GlobalValue::LinkageTypes)DFII->second.second);
-
- if (ParseFunctionBody(F)) {
- if (ErrInfo) *ErrInfo = ErrorString;
- return true;
- }
-
- // Upgrade any old intrinsic calls in the function.
- for (UpgradedIntrinsicMap::iterator I = UpgradedIntrinsics.begin(),
- E = UpgradedIntrinsics.end(); I != E; ++I) {
- if (I->first != I->second) {
- for (Value::use_iterator UI = I->first->use_begin(),
- UE = I->first->use_end(); UI != UE; ) {
- if (CallInst* CI = dyn_cast<CallInst>(*UI++))
- UpgradeIntrinsicCall(CI, I->second);
- }
- }
- }
-
- return false;
-}
-
-void BitcodeReader::dematerializeFunction(Function *F) {
- // If this function isn't materialized, or if it is a proto, this is a noop.
- if (F->hasNotBeenReadFromBitcode() || F->isDeclaration())
- return;
-
- assert(DeferredFunctionInfo.count(F) && "No info to read function later?");
-
- // Just forget the function body, we can remat it later.
- F->deleteBody();
- F->setLinkage(GlobalValue::GhostLinkage);
-}
-
-
-Module *BitcodeReader::materializeModule(std::string *ErrInfo) {
- for (DenseMap<Function*, std::pair<uint64_t, unsigned> >::iterator I =
- DeferredFunctionInfo.begin(), E = DeferredFunctionInfo.end(); I != E;
- ++I) {
- Function *F = I->first;
- if (F->hasNotBeenReadFromBitcode() &&
- materializeFunction(F, ErrInfo))
- return 0;
- }
-
- // Upgrade any intrinsic calls that slipped through (should not happen!) and
- // delete the old functions to clean up. We can't do this unless the entire
- // module is materialized because there could always be another function body
- // with calls to the old function.
- for (std::vector<std::pair<Function*, Function*> >::iterator I =
- UpgradedIntrinsics.begin(), E = UpgradedIntrinsics.end(); I != E; ++I) {
- if (I->first != I->second) {
- for (Value::use_iterator UI = I->first->use_begin(),
- UE = I->first->use_end(); UI != UE; ) {
- if (CallInst* CI = dyn_cast<CallInst>(*UI++))
- UpgradeIntrinsicCall(CI, I->second);
- }
- ValueList.replaceUsesOfWith(I->first, I->second);
- I->first->eraseFromParent();
- }
- }
- std::vector<std::pair<Function*, Function*> >().swap(UpgradedIntrinsics);
-
- return TheModule;
-}
-
-
-/// This method is provided by the parent ModuleProvde class and overriden
-/// here. It simply releases the module from its provided and frees up our
-/// state.
-/// @brief Release our hold on the generated module
-Module *BitcodeReader::releaseModule(std::string *ErrInfo) {
- // Since we're losing control of this Module, we must hand it back complete
- Module *M = ModuleProvider::releaseModule(ErrInfo);
- FreeState();
- return M;
-}
-
-
-//===----------------------------------------------------------------------===//
-// External interface
-//===----------------------------------------------------------------------===//
-
-/// getBitcodeModuleProvider - lazy function-at-a-time loading from a file.
-///
-ModuleProvider *llvm::getBitcodeModuleProvider(MemoryBuffer *Buffer,
- std::string *ErrMsg) {
- BitcodeReader *R = new BitcodeReader(Buffer);
- if (R->ParseBitcode()) {
- if (ErrMsg)
- *ErrMsg = R->getErrorString();
-
- // Don't let the BitcodeReader dtor delete 'Buffer'.
- R->releaseMemoryBuffer();
- delete R;
- return 0;
- }
- return R;
-}
-
-/// ParseBitcodeFile - Read the specified bitcode file, returning the module.
-/// If an error occurs, return null and fill in *ErrMsg if non-null.
-Module *llvm::ParseBitcodeFile(MemoryBuffer *Buffer, std::string *ErrMsg){
- BitcodeReader *R;
- R = static_cast<BitcodeReader*>(getBitcodeModuleProvider(Buffer, ErrMsg));
- if (!R) return 0;
-
- // Read in the entire module.
- Module *M = R->materializeModule(ErrMsg);
-
- // Don't let the BitcodeReader dtor delete 'Buffer', regardless of whether
- // there was an error.
- R->releaseMemoryBuffer();
-
- // If there was no error, tell ModuleProvider not to delete it when its dtor
- // is run.
- if (M)
- M = R->releaseModule(ErrMsg);
-
- delete R;
- return M;
-}
diff --git a/release_23/lib/Bitcode/Reader/BitcodeReader.h b/release_23/lib/Bitcode/Reader/BitcodeReader.h
deleted file mode 100644
index 86b00a5ef14c..000000000000
--- a/release_23/lib/Bitcode/Reader/BitcodeReader.h
+++ /dev/null
@@ -1,208 +0,0 @@
-//===- BitcodeReader.h - Internal BitcodeReader impl ------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This header defines the BitcodeReader class.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef BITCODE_READER_H
-#define BITCODE_READER_H
-
-#include "llvm/ModuleProvider.h"
-#include "llvm/ParameterAttributes.h"
-#include "llvm/Type.h"
-#include "llvm/User.h"
-#include "llvm/Bitcode/BitstreamReader.h"
-#include "llvm/Bitcode/LLVMBitCodes.h"
-#include "llvm/ADT/DenseMap.h"
-#include <vector>
-
-namespace llvm {
- class MemoryBuffer;
-
-class BitcodeReaderValueList : public User {
- std::vector<Use> Uses;
-public:
- BitcodeReaderValueList() : User(Type::VoidTy, Value::ArgumentVal, 0, 0) {}
-
- // vector compatibility methods
- unsigned size() const { return getNumOperands(); }
- void push_back(Value *V) {
- Uses.push_back(Use(V, this));
- OperandList = &Uses[0];
- ++NumOperands;
- }
-
- void clear() {
- std::vector<Use>().swap(Uses);
- }
-
- Value *operator[](unsigned i) const { return getOperand(i); }
-
- Value *back() const { return Uses.back(); }
- void pop_back() { Uses.pop_back(); --NumOperands; }
- bool empty() const { return NumOperands == 0; }
- void shrinkTo(unsigned N) {
- assert(N <= NumOperands && "Invalid shrinkTo request!");
- Uses.resize(N);
- NumOperands = N;
- }
- virtual void print(std::ostream&) const {}
-
- Constant *getConstantFwdRef(unsigned Idx, const Type *Ty);
- Value *getValueFwdRef(unsigned Idx, const Type *Ty);
-
- void AssignValue(Value *V, unsigned Idx) {
- if (Idx == size()) {
- push_back(V);
- } else if (Value *OldV = getOperand(Idx)) {
- // If there was a forward reference to this value, replace it.
- setOperand(Idx, V);
- OldV->replaceAllUsesWith(V);
- delete OldV;
- } else {
- initVal(Idx, V);
- }
- }
-
-private:
- void initVal(unsigned Idx, Value *V) {
- assert(Uses[Idx] == 0 && "Cannot init an already init'd Use!");
- Uses[Idx].init(V, this);
- }
-};
-
-
-class BitcodeReader : public ModuleProvider {
- MemoryBuffer *Buffer;
- BitstreamReader Stream;
-
- const char *ErrorString;
-
- std::vector<PATypeHolder> TypeList;
- BitcodeReaderValueList ValueList;
- std::vector<std::pair<GlobalVariable*, unsigned> > GlobalInits;
- std::vector<std::pair<GlobalAlias*, unsigned> > AliasInits;
-
- /// ParamAttrs - The set of parameter attributes by index. Index zero in the
- /// file is for null, and is thus not represented here. As such all indices
- /// are off by one.
- std::vector<PAListPtr> ParamAttrs;
-
- /// FunctionBBs - While parsing a function body, this is a list of the basic
- /// blocks for the function.
- std::vector<BasicBlock*> FunctionBBs;
-
- // When reading the module header, this list is populated with functions that
- // have bodies later in the file.
- std::vector<Function*> FunctionsWithBodies;
-
- // When intrinsic functions are encountered which require upgrading they are
- // stored here with their replacement function.
- typedef std::vector<std::pair<Function*, Function*> > UpgradedIntrinsicMap;
- UpgradedIntrinsicMap UpgradedIntrinsics;
-
- // After the module header has been read, the FunctionsWithBodies list is
- // reversed. This keeps track of whether we've done this yet.
- bool HasReversedFunctionsWithBodies;
-
- /// DeferredFunctionInfo - When function bodies are initially scanned, this
- /// map contains info about where to find deferred function body (in the
- /// stream) and what linkage the original function had.
- DenseMap<Function*, std::pair<uint64_t, unsigned> > DeferredFunctionInfo;
-public:
- explicit BitcodeReader(MemoryBuffer *buffer)
- : Buffer(buffer), ErrorString(0) {
- HasReversedFunctionsWithBodies = false;
- }
- ~BitcodeReader() {
- FreeState();
- }
-
- void FreeState();
-
- /// releaseMemoryBuffer - This causes the reader to completely forget about
- /// the memory buffer it contains, which prevents the buffer from being
- /// destroyed when it is deleted.
- void releaseMemoryBuffer() {
- Buffer = 0;
- }
-
- virtual bool materializeFunction(Function *F, std::string *ErrInfo = 0);
- virtual Module *materializeModule(std::string *ErrInfo = 0);
- virtual void dematerializeFunction(Function *F);
- virtual Module *releaseModule(std::string *ErrInfo = 0);
-
- bool Error(const char *Str) {
- ErrorString = Str;
- return true;
- }
- const char *getErrorString() const { return ErrorString; }
-
- /// @brief Main interface to parsing a bitcode buffer.
- /// @returns true if an error occurred.
- bool ParseBitcode();
-private:
- const Type *getTypeByID(unsigned ID, bool isTypeTable = false);
- Value *getFnValueByID(unsigned ID, const Type *Ty) {
- return ValueList.getValueFwdRef(ID, Ty);
- }
- BasicBlock *getBasicBlock(unsigned ID) const {
- if (ID >= FunctionBBs.size()) return 0; // Invalid ID
- return FunctionBBs[ID];
- }
- PAListPtr getParamAttrs(unsigned i) const {
- if (i-1 < ParamAttrs.size())
- return ParamAttrs[i-1];
- return PAListPtr();
- }
-
- /// getValueTypePair - Read a value/type pair out of the specified record from
- /// slot 'Slot'. Increment Slot past the number of slots used in the record.
- /// Return true on failure.
- bool getValueTypePair(SmallVector<uint64_t, 64> &Record, unsigned &Slot,
- unsigned InstNum, Value *&ResVal) {
- if (Slot == Record.size()) return true;
- unsigned ValNo = (unsigned)Record[Slot++];
- if (ValNo < InstNum) {
- // If this is not a forward reference, just return the value we already
- // have.
- ResVal = getFnValueByID(ValNo, 0);
- return ResVal == 0;
- } else if (Slot == Record.size()) {
- return true;
- }
-
- unsigned TypeNo = (unsigned)Record[Slot++];
- ResVal = getFnValueByID(ValNo, getTypeByID(TypeNo));
- return ResVal == 0;
- }
- bool getValue(SmallVector<uint64_t, 64> &Record, unsigned &Slot,
- const Type *Ty, Value *&ResVal) {
- if (Slot == Record.size()) return true;
- unsigned ValNo = (unsigned)Record[Slot++];
- ResVal = getFnValueByID(ValNo, Ty);
- return ResVal == 0;
- }
-
-
- bool ParseModule(const std::string &ModuleID);
- bool ParseParamAttrBlock();
- bool ParseTypeTable();
- bool ParseTypeSymbolTable();
- bool ParseValueSymbolTable();
- bool ParseConstants();
- bool RememberAndSkipFunctionBody();
- bool ParseFunctionBody(Function *F);
- bool ResolveGlobalAndAliasInits();
-};
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/lib/Bitcode/Reader/Deserialize.cpp b/release_23/lib/Bitcode/Reader/Deserialize.cpp
deleted file mode 100644
index 113321fa26f2..000000000000
--- a/release_23/lib/Bitcode/Reader/Deserialize.cpp
+++ /dev/null
@@ -1,454 +0,0 @@
-//==- Deserialize.cpp - Generic Object Serialization to Bitcode --*- C++ -*-==//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines the internal methods used for object serialization.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Bitcode/Deserialize.h"
-
-#ifdef DEBUG_BACKPATCH
-#include "llvm/Support/Streams.h"
-#endif
-
-using namespace llvm;
-
-Deserializer::Deserializer(BitstreamReader& stream)
- : Stream(stream), RecIdx(0), FreeList(NULL), AbbrevNo(0), RecordCode(0) {
-
- StreamStart = Stream.GetCurrentBitNo();
-}
-
-Deserializer::~Deserializer() {
- assert (RecIdx >= Record.size() &&
- "Still scanning bitcode record when deserialization completed.");
-
-#ifdef DEBUG_BACKPATCH
- for (MapTy::iterator I=BPatchMap.begin(), E=BPatchMap.end(); I!=E; ++I)
- assert (I->first.hasFinalPtr() &&
- "Some pointers were not backpatched.");
-#endif
-}
-
-
-bool Deserializer::inRecord() {
- if (Record.size() > 0) {
- if (RecIdx >= Record.size()) {
- RecIdx = 0;
- Record.clear();
- AbbrevNo = 0;
- return false;
- }
- else
- return true;
- }
-
- return false;
-}
-
-bool Deserializer::AdvanceStream() {
- assert (!inRecord() &&
- "Cannot advance stream. Still processing a record.");
-
- if (AbbrevNo == bitc::ENTER_SUBBLOCK ||
- AbbrevNo >= bitc::UNABBREV_RECORD)
- return true;
-
- while (!Stream.AtEndOfStream()) {
-
- uint64_t Pos = Stream.GetCurrentBitNo();
- AbbrevNo = Stream.ReadCode();
-
- switch (AbbrevNo) {
- case bitc::ENTER_SUBBLOCK: {
- unsigned id = Stream.ReadSubBlockID();
-
- // Determine the extent of the block. This is useful for jumping around
- // the stream. This is hack: we read the header of the block, save
- // the length, and then revert the bitstream to a location just before
- // the block is entered.
- uint64_t BPos = Stream.GetCurrentBitNo();
- Stream.ReadVBR(bitc::CodeLenWidth); // Skip the code size.
- Stream.SkipToWord();
- unsigned NumWords = Stream.Read(bitc::BlockSizeWidth);
- Stream.JumpToBit(BPos);
-
- BlockStack.push_back(Location(Pos,id,NumWords));
- break;
- }
-
- case bitc::END_BLOCK: {
- bool x = Stream.ReadBlockEnd();
- assert (!x && "Error at block end.");
- BlockStack.pop_back();
- continue;
- }
-
- case bitc::DEFINE_ABBREV:
- Stream.ReadAbbrevRecord();
- continue;
-
- default:
- break;
- }
-
- return true;
- }
-
- return false;
-}
-
-void Deserializer::ReadRecord() {
-
- while (AdvanceStream() && AbbrevNo == bitc::ENTER_SUBBLOCK) {
- assert (!BlockStack.empty());
- Stream.EnterSubBlock(BlockStack.back().BlockID);
- AbbrevNo = 0;
- }
-
- if (Stream.AtEndOfStream())
- return;
-
- assert (Record.empty());
- assert (AbbrevNo >= bitc::UNABBREV_RECORD);
- RecordCode = Stream.ReadRecord(AbbrevNo,Record);
- assert (Record.size() > 0);
-}
-
-void Deserializer::SkipBlock() {
- assert (!inRecord());
-
- if (AtEnd())
- return;
-
- AdvanceStream();
-
- assert (AbbrevNo == bitc::ENTER_SUBBLOCK);
- BlockStack.pop_back();
- Stream.SkipBlock();
-
- AbbrevNo = 0;
- AdvanceStream();
-}
-
-bool Deserializer::SkipToBlock(unsigned BlockID) {
- assert (!inRecord());
-
- AdvanceStream();
- assert (AbbrevNo == bitc::ENTER_SUBBLOCK);
-
- unsigned BlockLevel = BlockStack.size();
-
- while (!AtEnd() &&
- BlockLevel == BlockStack.size() &&
- getCurrentBlockID() != BlockID)
- SkipBlock();
-
- return !(AtEnd() || BlockLevel != BlockStack.size());
-}
-
-Deserializer::Location Deserializer::getCurrentBlockLocation() {
- if (!inRecord())
- AdvanceStream();
-
- return BlockStack.back();
-}
-
-bool Deserializer::JumpTo(const Location& Loc) {
-
- assert (!inRecord());
-
- AdvanceStream();
-
- assert (!BlockStack.empty() || AtEnd());
-
- uint64_t LastBPos = StreamStart;
-
- while (!BlockStack.empty()) {
-
- LastBPos = BlockStack.back().BitNo;
-
- // Determine of the current block contains the location of the block
- // we are looking for.
- if (BlockStack.back().contains(Loc)) {
- // We found the enclosing block. We must first POP it off to
- // destroy any accumulated context within the block scope. We then
- // jump to the position of the block and enter it.
- Stream.JumpToBit(LastBPos);
-
- if (BlockStack.size() == Stream.BlockScope.size())
- Stream.PopBlockScope();
-
- BlockStack.pop_back();
-
- AbbrevNo = 0;
- AdvanceStream();
- assert (AbbrevNo == bitc::ENTER_SUBBLOCK);
-
- Stream.EnterSubBlock(BlockStack.back().BlockID);
- break;
- }
-
- // This block does not contain the block we are looking for. Pop it.
- if (BlockStack.size() == Stream.BlockScope.size())
- Stream.PopBlockScope();
-
- BlockStack.pop_back();
-
- }
-
- // Check if we have popped our way to the outermost scope. If so,
- // we need to adjust our position.
- if (BlockStack.empty()) {
- assert (Stream.BlockScope.empty());
-
- Stream.JumpToBit(Loc.BitNo < LastBPos ? StreamStart : LastBPos);
- AbbrevNo = 0;
- AdvanceStream();
- }
-
- assert (AbbrevNo == bitc::ENTER_SUBBLOCK);
- assert (!BlockStack.empty());
-
- while (!AtEnd() && BlockStack.back() != Loc) {
- if (BlockStack.back().contains(Loc)) {
- Stream.EnterSubBlock(BlockStack.back().BlockID);
- AbbrevNo = 0;
- AdvanceStream();
- continue;
- }
- else
- SkipBlock();
- }
-
- if (AtEnd())
- return false;
-
- assert (BlockStack.back() == Loc);
-
- return true;
-}
-
-void Deserializer::Rewind() {
- while (!Stream.BlockScope.empty())
- Stream.PopBlockScope();
-
- while (!BlockStack.empty())
- BlockStack.pop_back();
-
- Stream.JumpToBit(StreamStart);
- AbbrevNo = 0;
-}
-
-
-unsigned Deserializer::getCurrentBlockID() {
- if (!inRecord())
- AdvanceStream();
-
- return BlockStack.back().BlockID;
-}
-
-unsigned Deserializer::getRecordCode() {
- if (!inRecord()) {
- AdvanceStream();
- assert (AbbrevNo >= bitc::UNABBREV_RECORD);
- ReadRecord();
- }
-
- return RecordCode;
-}
-
-bool Deserializer::FinishedBlock(Location BlockLoc) {
- if (!inRecord())
- AdvanceStream();
-
- for (llvm::SmallVector<Location,8>::reverse_iterator
- I=BlockStack.rbegin(), E=BlockStack.rend(); I!=E; ++I)
- if (*I == BlockLoc)
- return false;
-
- return true;
-}
-
-unsigned Deserializer::getAbbrevNo() {
- if (!inRecord())
- AdvanceStream();
-
- return AbbrevNo;
-}
-
-bool Deserializer::AtEnd() {
- if (inRecord())
- return false;
-
- if (!AdvanceStream())
- return true;
-
- return false;
-}
-
-uint64_t Deserializer::ReadInt() {
- // FIXME: Any error recovery/handling with incomplete or bad files?
- if (!inRecord())
- ReadRecord();
-
- return Record[RecIdx++];
-}
-
-int64_t Deserializer::ReadSInt() {
- uint64_t x = ReadInt();
- int64_t magnitude = x >> 1;
- return x & 0x1 ? -magnitude : magnitude;
-}
-
-char* Deserializer::ReadCStr(char* cstr, unsigned MaxLen, bool isNullTerm) {
- if (cstr == NULL)
- MaxLen = 0; // Zero this just in case someone does something funny.
-
- unsigned len = ReadInt();
-
- assert (MaxLen == 0 || (len + (isNullTerm ? 1 : 0)) <= MaxLen);
-
- if (!cstr)
- cstr = new char[len + (isNullTerm ? 1 : 0)];
-
- assert (cstr != NULL);
-
- for (unsigned i = 0; i < len; ++i)
- cstr[i] = (char) ReadInt();
-
- if (isNullTerm)
- cstr[len] = '\0';
-
- return cstr;
-}
-
-void Deserializer::ReadCStr(std::vector<char>& buff, bool isNullTerm,
- unsigned Idx) {
-
- unsigned len = ReadInt();
-
- // If Idx is beyond the current before size, reduce Idx to refer to the
- // element after the last element.
- if (Idx > buff.size())
- Idx = buff.size();
-
- buff.reserve(len+Idx);
- buff.resize(Idx);
-
- for (unsigned i = 0; i < len; ++i)
- buff.push_back((char) ReadInt());
-
- if (isNullTerm)
- buff.push_back('\0');
-}
-
-void Deserializer::RegisterPtr(const SerializedPtrID& PtrId,
- const void* Ptr) {
-
- MapTy::value_type& E = BPatchMap.FindAndConstruct(BPKey(PtrId));
-
- assert (!HasFinalPtr(E) && "Pointer already registered.");
-
-#ifdef DEBUG_BACKPATCH
- llvm::cerr << "RegisterPtr: " << PtrId << " => " << Ptr << "\n";
-#endif
-
- SetPtr(E,Ptr);
-}
-
-void Deserializer::ReadUIntPtr(uintptr_t& PtrRef,
- const SerializedPtrID& PtrId,
- bool AllowBackpatch) {
- if (PtrId == 0) {
- PtrRef = 0;
- return;
- }
-
- MapTy::value_type& E = BPatchMap.FindAndConstruct(BPKey(PtrId));
-
- if (HasFinalPtr(E)) {
- PtrRef = GetFinalPtr(E);
-
-#ifdef DEBUG_BACKPATCH
- llvm::cerr << "ReadUintPtr: " << PtrId
- << " <-- " << (void*) GetFinalPtr(E) << '\n';
-#endif
- }
- else {
- assert (AllowBackpatch &&
- "Client forbids backpatching for this pointer.");
-
-#ifdef DEBUG_BACKPATCH
- llvm::cerr << "ReadUintPtr: " << PtrId << " (NO PTR YET)\n";
-#endif
-
- // Register backpatch. Check the freelist for a BPNode.
- BPNode* N;
-
- if (FreeList) {
- N = FreeList;
- FreeList = FreeList->Next;
- }
- else // No available BPNode. Allocate one.
- N = (BPNode*) Allocator.Allocate<BPNode>();
-
- new (N) BPNode(GetBPNode(E),PtrRef);
- SetBPNode(E,N);
- }
-}
-
-uintptr_t Deserializer::ReadInternalRefPtr() {
- SerializedPtrID PtrId = ReadPtrID();
-
- assert (PtrId != 0 && "References cannot refer the NULL address.");
-
- MapTy::value_type& E = BPatchMap.FindAndConstruct(BPKey(PtrId));
-
- assert (HasFinalPtr(E) &&
- "Cannot backpatch references. Object must be already deserialized.");
-
- return GetFinalPtr(E);
-}
-
-void Deserializer::BPEntry::SetPtr(BPNode*& FreeList, void* P) {
- BPNode* Last = NULL;
-
- for (BPNode* N = Head; N != NULL; N=N->Next) {
- Last = N;
- N->PtrRef |= reinterpret_cast<uintptr_t>(P);
- }
-
- if (Last) {
- Last->Next = FreeList;
- FreeList = Head;
- }
-
- Ptr = const_cast<void*>(P);
-}
-
-
-#define INT_READ(TYPE)\
-void SerializeTrait<TYPE>::Read(Deserializer& D, TYPE& X) {\
- X = (TYPE) D.ReadInt(); }
-
-INT_READ(bool)
-INT_READ(unsigned char)
-INT_READ(unsigned short)
-INT_READ(unsigned int)
-INT_READ(unsigned long)
-
-#define SINT_READ(TYPE)\
-void SerializeTrait<TYPE>::Read(Deserializer& D, TYPE& X) {\
- X = (TYPE) D.ReadSInt(); }
-
-INT_READ(signed char)
-INT_READ(signed short)
-INT_READ(signed int)
-INT_READ(signed long)
diff --git a/release_23/lib/Bitcode/Reader/DeserializeAPFloat.cpp b/release_23/lib/Bitcode/Reader/DeserializeAPFloat.cpp
deleted file mode 100644
index ee24b681f026..000000000000
--- a/release_23/lib/Bitcode/Reader/DeserializeAPFloat.cpp
+++ /dev/null
@@ -1,24 +0,0 @@
-//===-- SerializeAPInt.cpp - Serialization for APFloat ---------*- C++ -*--===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements deserialization of APFloat.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/ADT/APFloat.h"
-#include "llvm/Bitcode/Deserialize.h"
-
-using namespace llvm;
-
-APFloat APFloat::ReadVal(Deserializer& D) {
- APInt x;
- D.Read(x);
- return APFloat(x);
-}
-
diff --git a/release_23/lib/Bitcode/Reader/DeserializeAPInt.cpp b/release_23/lib/Bitcode/Reader/DeserializeAPInt.cpp
deleted file mode 100644
index 1b5b2bf1ff14..000000000000
--- a/release_23/lib/Bitcode/Reader/DeserializeAPInt.cpp
+++ /dev/null
@@ -1,33 +0,0 @@
-//===-- DeserializeAPInt.cpp - Deserialization for APInts ------*- C++ -*--===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements deserialization of APInts.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/ADT/APInt.h"
-#include "llvm/Bitcode/Deserialize.h"
-#include <cassert>
-
-using namespace llvm;
-
-void APInt::Read(Deserializer& D) {
- BitWidth = D.ReadInt();
-
- if (isSingleWord())
- VAL = D.ReadInt();
- else {
- uint32_t NumWords = D.ReadInt();
- assert (NumWords > 1);
- pVal = new uint64_t[NumWords];
- assert (pVal && "Allocation in deserialization of APInt failed.");
- for (unsigned i = 0; i < NumWords; ++i)
- pVal[i] = D.ReadInt();
- }
-}
diff --git a/release_23/lib/Bitcode/Reader/Makefile b/release_23/lib/Bitcode/Reader/Makefile
deleted file mode 100644
index f194ec28e92d..000000000000
--- a/release_23/lib/Bitcode/Reader/Makefile
+++ /dev/null
@@ -1,15 +0,0 @@
-##===- lib/Bitcode/Reader/Makefile -------------------------*- Makefile -*-===##
-#
-# The LLVM Compiler Infrastructure
-#
-# This file is distributed under the University of Illinois Open Source
-# License. See LICENSE.TXT for details.
-#
-##===----------------------------------------------------------------------===##
-
-LEVEL = ../../..
-LIBRARYNAME = LLVMBitReader
-BUILD_ARCHIVE = 1
-
-include $(LEVEL)/Makefile.common
-
diff --git a/release_23/lib/Bitcode/Writer/BitWriter.cpp b/release_23/lib/Bitcode/Writer/BitWriter.cpp
deleted file mode 100644
index 1aac5006d8f6..000000000000
--- a/release_23/lib/Bitcode/Writer/BitWriter.cpp
+++ /dev/null
@@ -1,52 +0,0 @@
-//===-- BitWriter.cpp -----------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm-c/BitWriter.h"
-#include "llvm/Bitcode/ReaderWriter.h"
-#include <fstream>
-
-using namespace llvm;
-
-
-/*===-- Operations on modules ---------------------------------------------===*/
-
-int LLVMWriteBitcodeToFile(LLVMModuleRef M, const char *Path) {
- std::ofstream OS(Path, std::ios_base::out|std::ios::trunc|std::ios::binary);
-
- if (!OS.fail())
- WriteBitcodeToFile(unwrap(M), OS);
-
- if (OS.fail())
- return -1;
-
- return 0;
-}
-
-#ifdef __GNUC__
-#include <ext/stdio_filebuf.h>
-
-// FIXME: Control this with configure? Provide some portable abstraction in
-// libSystem? As is, the user will just get a linker error if they use this on
-// non-GCC. Some C++ stdlibs even have ofstream::ofstream(int fd).
-int LLVMWriteBitcodeToFileHandle(LLVMModuleRef M, int FileHandle) {
- __gnu_cxx::stdio_filebuf<char> Buffer(FileHandle, std::ios_base::out |
- std::ios::trunc |
- std::ios::binary);
- std::ostream OS(&Buffer);
-
- if (!OS.fail())
- WriteBitcodeToFile(unwrap(M), OS);
-
- if (OS.fail())
- return -1;
-
- return 0;
-}
-
-#endif
diff --git a/release_23/lib/Bitcode/Writer/BitcodeWriter.cpp b/release_23/lib/Bitcode/Writer/BitcodeWriter.cpp
deleted file mode 100644
index 713a82b6b2f7..000000000000
--- a/release_23/lib/Bitcode/Writer/BitcodeWriter.cpp
+++ /dev/null
@@ -1,1258 +0,0 @@
-//===--- Bitcode/Writer/BitcodeWriter.cpp - Bitcode Writer ----------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// Bitcode writer implementation.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Bitcode/ReaderWriter.h"
-#include "llvm/Bitcode/BitstreamWriter.h"
-#include "llvm/Bitcode/LLVMBitCodes.h"
-#include "ValueEnumerator.h"
-#include "llvm/Constants.h"
-#include "llvm/DerivedTypes.h"
-#include "llvm/InlineAsm.h"
-#include "llvm/Instructions.h"
-#include "llvm/Module.h"
-#include "llvm/TypeSymbolTable.h"
-#include "llvm/ValueSymbolTable.h"
-#include "llvm/Support/MathExtras.h"
-using namespace llvm;
-
-/// These are manifest constants used by the bitcode writer. They do not need to
-/// be kept in sync with the reader, but need to be consistent within this file.
-enum {
- CurVersion = 0,
-
- // VALUE_SYMTAB_BLOCK abbrev id's.
- VST_ENTRY_8_ABBREV = bitc::FIRST_APPLICATION_ABBREV,
- VST_ENTRY_7_ABBREV,
- VST_ENTRY_6_ABBREV,
- VST_BBENTRY_6_ABBREV,
-
- // CONSTANTS_BLOCK abbrev id's.
- CONSTANTS_SETTYPE_ABBREV = bitc::FIRST_APPLICATION_ABBREV,
- CONSTANTS_INTEGER_ABBREV,
- CONSTANTS_CE_CAST_Abbrev,
- CONSTANTS_NULL_Abbrev,
-
- // FUNCTION_BLOCK abbrev id's.
- FUNCTION_INST_LOAD_ABBREV = bitc::FIRST_APPLICATION_ABBREV,
- FUNCTION_INST_BINOP_ABBREV,
- FUNCTION_INST_CAST_ABBREV,
- FUNCTION_INST_RET_VOID_ABBREV,
- FUNCTION_INST_RET_VAL_ABBREV,
- FUNCTION_INST_UNREACHABLE_ABBREV
-};
-
-
-static unsigned GetEncodedCastOpcode(unsigned Opcode) {
- switch (Opcode) {
- default: assert(0 && "Unknown cast instruction!");
- case Instruction::Trunc : return bitc::CAST_TRUNC;
- case Instruction::ZExt : return bitc::CAST_ZEXT;
- case Instruction::SExt : return bitc::CAST_SEXT;
- case Instruction::FPToUI : return bitc::CAST_FPTOUI;
- case Instruction::FPToSI : return bitc::CAST_FPTOSI;
- case Instruction::UIToFP : return bitc::CAST_UITOFP;
- case Instruction::SIToFP : return bitc::CAST_SITOFP;
- case Instruction::FPTrunc : return bitc::CAST_FPTRUNC;
- case Instruction::FPExt : return bitc::CAST_FPEXT;
- case Instruction::PtrToInt: return bitc::CAST_PTRTOINT;
- case Instruction::IntToPtr: return bitc::CAST_INTTOPTR;
- case Instruction::BitCast : return bitc::CAST_BITCAST;
- }
-}
-
-static unsigned GetEncodedBinaryOpcode(unsigned Opcode) {
- switch (Opcode) {
- default: assert(0 && "Unknown binary instruction!");
- case Instruction::Add: return bitc::BINOP_ADD;
- case Instruction::Sub: return bitc::BINOP_SUB;
- case Instruction::Mul: return bitc::BINOP_MUL;
- case Instruction::UDiv: return bitc::BINOP_UDIV;
- case Instruction::FDiv:
- case Instruction::SDiv: return bitc::BINOP_SDIV;
- case Instruction::URem: return bitc::BINOP_UREM;
- case Instruction::FRem:
- case Instruction::SRem: return bitc::BINOP_SREM;
- case Instruction::Shl: return bitc::BINOP_SHL;
- case Instruction::LShr: return bitc::BINOP_LSHR;
- case Instruction::AShr: return bitc::BINOP_ASHR;
- case Instruction::And: return bitc::BINOP_AND;
- case Instruction::Or: return bitc::BINOP_OR;
- case Instruction::Xor: return bitc::BINOP_XOR;
- }
-}
-
-
-
-static void WriteStringRecord(unsigned Code, const std::string &Str,
- unsigned AbbrevToUse, BitstreamWriter &Stream) {
- SmallVector<unsigned, 64> Vals;
-
- // Code: [strchar x N]
- for (unsigned i = 0, e = Str.size(); i != e; ++i)
- Vals.push_back(Str[i]);
-
- // Emit the finished record.
- Stream.EmitRecord(Code, Vals, AbbrevToUse);
-}
-
-// Emit information about parameter attributes.
-static void WriteParamAttrTable(const ValueEnumerator &VE,
- BitstreamWriter &Stream) {
- const std::vector<PAListPtr> &Attrs = VE.getParamAttrs();
- if (Attrs.empty()) return;
-
- Stream.EnterSubblock(bitc::PARAMATTR_BLOCK_ID, 3);
-
- SmallVector<uint64_t, 64> Record;
- for (unsigned i = 0, e = Attrs.size(); i != e; ++i) {
- const PAListPtr &A = Attrs[i];
- for (unsigned i = 0, e = A.getNumSlots(); i != e; ++i) {
- const ParamAttrsWithIndex &PAWI = A.getSlot(i);
- Record.push_back(PAWI.Index);
- Record.push_back(PAWI.Attrs);
- }
-
- Stream.EmitRecord(bitc::PARAMATTR_CODE_ENTRY, Record);
- Record.clear();
- }
-
- Stream.ExitBlock();
-}
-
-/// WriteTypeTable - Write out the type table for a module.
-static void WriteTypeTable(const ValueEnumerator &VE, BitstreamWriter &Stream) {
- const ValueEnumerator::TypeList &TypeList = VE.getTypes();
-
- Stream.EnterSubblock(bitc::TYPE_BLOCK_ID, 4 /*count from # abbrevs */);
- SmallVector<uint64_t, 64> TypeVals;
-
- // Abbrev for TYPE_CODE_POINTER.
- BitCodeAbbrev *Abbv = new BitCodeAbbrev();
- Abbv->Add(BitCodeAbbrevOp(bitc::TYPE_CODE_POINTER));
- Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed,
- Log2_32_Ceil(VE.getTypes().size()+1)));
- Abbv->Add(BitCodeAbbrevOp(0)); // Addrspace = 0
- unsigned PtrAbbrev = Stream.EmitAbbrev(Abbv);
-
- // Abbrev for TYPE_CODE_FUNCTION.
- Abbv = new BitCodeAbbrev();
- Abbv->Add(BitCodeAbbrevOp(bitc::TYPE_CODE_FUNCTION));
- Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); // isvararg
- Abbv->Add(BitCodeAbbrevOp(0)); // FIXME: DEAD value, remove in LLVM 3.0
- Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array));
- Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed,
- Log2_32_Ceil(VE.getTypes().size()+1)));
- unsigned FunctionAbbrev = Stream.EmitAbbrev(Abbv);
-
- // Abbrev for TYPE_CODE_STRUCT.
- Abbv = new BitCodeAbbrev();
- Abbv->Add(BitCodeAbbrevOp(bitc::TYPE_CODE_STRUCT));
- Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); // ispacked
- Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array));
- Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed,
- Log2_32_Ceil(VE.getTypes().size()+1)));
- unsigned StructAbbrev = Stream.EmitAbbrev(Abbv);
-
- // Abbrev for TYPE_CODE_ARRAY.
- Abbv = new BitCodeAbbrev();
- Abbv->Add(BitCodeAbbrevOp(bitc::TYPE_CODE_ARRAY));
- Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 8)); // size
- Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed,
- Log2_32_Ceil(VE.getTypes().size()+1)));
- unsigned ArrayAbbrev = Stream.EmitAbbrev(Abbv);
-
- // Emit an entry count so the reader can reserve space.
- TypeVals.push_back(TypeList.size());
- Stream.EmitRecord(bitc::TYPE_CODE_NUMENTRY, TypeVals);
- TypeVals.clear();
-
- // Loop over all of the types, emitting each in turn.
- for (unsigned i = 0, e = TypeList.size(); i != e; ++i) {
- const Type *T = TypeList[i].first;
- int AbbrevToUse = 0;
- unsigned Code = 0;
-
- switch (T->getTypeID()) {
- default: assert(0 && "Unknown type!");
- case Type::VoidTyID: Code = bitc::TYPE_CODE_VOID; break;
- case Type::FloatTyID: Code = bitc::TYPE_CODE_FLOAT; break;
- case Type::DoubleTyID: Code = bitc::TYPE_CODE_DOUBLE; break;
- case Type::X86_FP80TyID: Code = bitc::TYPE_CODE_X86_FP80; break;
- case Type::FP128TyID: Code = bitc::TYPE_CODE_FP128; break;
- case Type::PPC_FP128TyID: Code = bitc::TYPE_CODE_PPC_FP128; break;
- case Type::LabelTyID: Code = bitc::TYPE_CODE_LABEL; break;
- case Type::OpaqueTyID: Code = bitc::TYPE_CODE_OPAQUE; break;
- case Type::IntegerTyID:
- // INTEGER: [width]
- Code = bitc::TYPE_CODE_INTEGER;
- TypeVals.push_back(cast<IntegerType>(T)->getBitWidth());
- break;
- case Type::PointerTyID: {
- const PointerType *PTy = cast<PointerType>(T);
- // POINTER: [pointee type, address space]
- Code = bitc::TYPE_CODE_POINTER;
- TypeVals.push_back(VE.getTypeID(PTy->getElementType()));
- unsigned AddressSpace = PTy->getAddressSpace();
- TypeVals.push_back(AddressSpace);
- if (AddressSpace == 0) AbbrevToUse = PtrAbbrev;
- break;
- }
- case Type::FunctionTyID: {
- const FunctionType *FT = cast<FunctionType>(T);
- // FUNCTION: [isvararg, attrid, retty, paramty x N]
- Code = bitc::TYPE_CODE_FUNCTION;
- TypeVals.push_back(FT->isVarArg());
- TypeVals.push_back(0); // FIXME: DEAD: remove in llvm 3.0
- TypeVals.push_back(VE.getTypeID(FT->getReturnType()));
- for (unsigned i = 0, e = FT->getNumParams(); i != e; ++i)
- TypeVals.push_back(VE.getTypeID(FT->getParamType(i)));
- AbbrevToUse = FunctionAbbrev;
- break;
- }
- case Type::StructTyID: {
- const StructType *ST = cast<StructType>(T);
- // STRUCT: [ispacked, eltty x N]
- Code = bitc::TYPE_CODE_STRUCT;
- TypeVals.push_back(ST->isPacked());
- // Output all of the element types.
- for (StructType::element_iterator I = ST->element_begin(),
- E = ST->element_end(); I != E; ++I)
- TypeVals.push_back(VE.getTypeID(*I));
- AbbrevToUse = StructAbbrev;
- break;
- }
- case Type::ArrayTyID: {
- const ArrayType *AT = cast<ArrayType>(T);
- // ARRAY: [numelts, eltty]
- Code = bitc::TYPE_CODE_ARRAY;
- TypeVals.push_back(AT->getNumElements());
- TypeVals.push_back(VE.getTypeID(AT->getElementType()));
- AbbrevToUse = ArrayAbbrev;
- break;
- }
- case Type::VectorTyID: {
- const VectorType *VT = cast<VectorType>(T);
- // VECTOR [numelts, eltty]
- Code = bitc::TYPE_CODE_VECTOR;
- TypeVals.push_back(VT->getNumElements());
- TypeVals.push_back(VE.getTypeID(VT->getElementType()));
- break;
- }
- }
-
- // Emit the finished record.
- Stream.EmitRecord(Code, TypeVals, AbbrevToUse);
- TypeVals.clear();
- }
-
- Stream.ExitBlock();
-}
-
-static unsigned getEncodedLinkage(const GlobalValue *GV) {
- switch (GV->getLinkage()) {
- default: assert(0 && "Invalid linkage!");
- case GlobalValue::GhostLinkage: // Map ghost linkage onto external.
- case GlobalValue::ExternalLinkage: return 0;
- case GlobalValue::WeakLinkage: return 1;
- case GlobalValue::AppendingLinkage: return 2;
- case GlobalValue::InternalLinkage: return 3;
- case GlobalValue::LinkOnceLinkage: return 4;
- case GlobalValue::DLLImportLinkage: return 5;
- case GlobalValue::DLLExportLinkage: return 6;
- case GlobalValue::ExternalWeakLinkage: return 7;
- }
-}
-
-static unsigned getEncodedVisibility(const GlobalValue *GV) {
- switch (GV->getVisibility()) {
- default: assert(0 && "Invalid visibility!");
- case GlobalValue::DefaultVisibility: return 0;
- case GlobalValue::HiddenVisibility: return 1;
- case GlobalValue::ProtectedVisibility: return 2;
- }
-}
-
-// Emit top-level description of module, including target triple, inline asm,
-// descriptors for global variables, and function prototype info.
-static void WriteModuleInfo(const Module *M, const ValueEnumerator &VE,
- BitstreamWriter &Stream) {
- // Emit the list of dependent libraries for the Module.
- for (Module::lib_iterator I = M->lib_begin(), E = M->lib_end(); I != E; ++I)
- WriteStringRecord(bitc::MODULE_CODE_DEPLIB, *I, 0/*TODO*/, Stream);
-
- // Emit various pieces of data attached to a module.
- if (!M->getTargetTriple().empty())
- WriteStringRecord(bitc::MODULE_CODE_TRIPLE, M->getTargetTriple(),
- 0/*TODO*/, Stream);
- if (!M->getDataLayout().empty())
- WriteStringRecord(bitc::MODULE_CODE_DATALAYOUT, M->getDataLayout(),
- 0/*TODO*/, Stream);
- if (!M->getModuleInlineAsm().empty())
- WriteStringRecord(bitc::MODULE_CODE_ASM, M->getModuleInlineAsm(),
- 0/*TODO*/, Stream);
-
- // Emit information about sections and collectors, computing how many there
- // are. Also compute the maximum alignment value.
- std::map<std::string, unsigned> SectionMap;
- std::map<std::string, unsigned> CollectorMap;
- unsigned MaxAlignment = 0;
- unsigned MaxGlobalType = 0;
- for (Module::const_global_iterator GV = M->global_begin(),E = M->global_end();
- GV != E; ++GV) {
- MaxAlignment = std::max(MaxAlignment, GV->getAlignment());
- MaxGlobalType = std::max(MaxGlobalType, VE.getTypeID(GV->getType()));
-
- if (!GV->hasSection()) continue;
- // Give section names unique ID's.
- unsigned &Entry = SectionMap[GV->getSection()];
- if (Entry != 0) continue;
- WriteStringRecord(bitc::MODULE_CODE_SECTIONNAME, GV->getSection(),
- 0/*TODO*/, Stream);
- Entry = SectionMap.size();
- }
- for (Module::const_iterator F = M->begin(), E = M->end(); F != E; ++F) {
- MaxAlignment = std::max(MaxAlignment, F->getAlignment());
- if (F->hasSection()) {
- // Give section names unique ID's.
- unsigned &Entry = SectionMap[F->getSection()];
- if (!Entry) {
- WriteStringRecord(bitc::MODULE_CODE_SECTIONNAME, F->getSection(),
- 0/*TODO*/, Stream);
- Entry = SectionMap.size();
- }
- }
- if (F->hasCollector()) {
- // Same for collector names.
- unsigned &Entry = CollectorMap[F->getCollector()];
- if (!Entry) {
- WriteStringRecord(bitc::MODULE_CODE_COLLECTORNAME, F->getCollector(),
- 0/*TODO*/, Stream);
- Entry = CollectorMap.size();
- }
- }
- }
-
- // Emit abbrev for globals, now that we know # sections and max alignment.
- unsigned SimpleGVarAbbrev = 0;
- if (!M->global_empty()) {
- // Add an abbrev for common globals with no visibility or thread localness.
- BitCodeAbbrev *Abbv = new BitCodeAbbrev();
- Abbv->Add(BitCodeAbbrevOp(bitc::MODULE_CODE_GLOBALVAR));
- Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed,
- Log2_32_Ceil(MaxGlobalType+1)));
- Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); // Constant.
- Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // Initializer.
- Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3)); // Linkage.
- if (MaxAlignment == 0) // Alignment.
- Abbv->Add(BitCodeAbbrevOp(0));
- else {
- unsigned MaxEncAlignment = Log2_32(MaxAlignment)+1;
- Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed,
- Log2_32_Ceil(MaxEncAlignment+1)));
- }
- if (SectionMap.empty()) // Section.
- Abbv->Add(BitCodeAbbrevOp(0));
- else
- Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed,
- Log2_32_Ceil(SectionMap.size()+1)));
- // Don't bother emitting vis + thread local.
- SimpleGVarAbbrev = Stream.EmitAbbrev(Abbv);
- }
-
- // Emit the global variable information.
- SmallVector<unsigned, 64> Vals;
- for (Module::const_global_iterator GV = M->global_begin(),E = M->global_end();
- GV != E; ++GV) {
- unsigned AbbrevToUse = 0;
-
- // GLOBALVAR: [type, isconst, initid,
- // linkage, alignment, section, visibility, threadlocal]
- Vals.push_back(VE.getTypeID(GV->getType()));
- Vals.push_back(GV->isConstant());
- Vals.push_back(GV->isDeclaration() ? 0 :
- (VE.getValueID(GV->getInitializer()) + 1));
- Vals.push_back(getEncodedLinkage(GV));
- Vals.push_back(Log2_32(GV->getAlignment())+1);
- Vals.push_back(GV->hasSection() ? SectionMap[GV->getSection()] : 0);
- if (GV->isThreadLocal() ||
- GV->getVisibility() != GlobalValue::DefaultVisibility) {
- Vals.push_back(getEncodedVisibility(GV));
- Vals.push_back(GV->isThreadLocal());
- } else {
- AbbrevToUse = SimpleGVarAbbrev;
- }
-
- Stream.EmitRecord(bitc::MODULE_CODE_GLOBALVAR, Vals, AbbrevToUse);
- Vals.clear();
- }
-
- // Emit the function proto information.
- for (Module::const_iterator F = M->begin(), E = M->end(); F != E; ++F) {
- // FUNCTION: [type, callingconv, isproto, paramattr,
- // linkage, alignment, section, visibility, collector]
- Vals.push_back(VE.getTypeID(F->getType()));
- Vals.push_back(F->getCallingConv());
- Vals.push_back(F->isDeclaration());
- Vals.push_back(getEncodedLinkage(F));
- Vals.push_back(VE.getParamAttrID(F->getParamAttrs()));
- Vals.push_back(Log2_32(F->getAlignment())+1);
- Vals.push_back(F->hasSection() ? SectionMap[F->getSection()] : 0);
- Vals.push_back(getEncodedVisibility(F));
- Vals.push_back(F->hasCollector() ? CollectorMap[F->getCollector()] : 0);
-
- unsigned AbbrevToUse = 0;
- Stream.EmitRecord(bitc::MODULE_CODE_FUNCTION, Vals, AbbrevToUse);
- Vals.clear();
- }
-
-
- // Emit the alias information.
- for (Module::const_alias_iterator AI = M->alias_begin(), E = M->alias_end();
- AI != E; ++AI) {
- Vals.push_back(VE.getTypeID(AI->getType()));
- Vals.push_back(VE.getValueID(AI->getAliasee()));
- Vals.push_back(getEncodedLinkage(AI));
- Vals.push_back(getEncodedVisibility(AI));
- unsigned AbbrevToUse = 0;
- Stream.EmitRecord(bitc::MODULE_CODE_ALIAS, Vals, AbbrevToUse);
- Vals.clear();
- }
-}
-
-
-static void WriteConstants(unsigned FirstVal, unsigned LastVal,
- const ValueEnumerator &VE,
- BitstreamWriter &Stream, bool isGlobal) {
- if (FirstVal == LastVal) return;
-
- Stream.EnterSubblock(bitc::CONSTANTS_BLOCK_ID, 4);
-
- unsigned AggregateAbbrev = 0;
- unsigned String8Abbrev = 0;
- unsigned CString7Abbrev = 0;
- unsigned CString6Abbrev = 0;
- // If this is a constant pool for the module, emit module-specific abbrevs.
- if (isGlobal) {
- // Abbrev for CST_CODE_AGGREGATE.
- BitCodeAbbrev *Abbv = new BitCodeAbbrev();
- Abbv->Add(BitCodeAbbrevOp(bitc::CST_CODE_AGGREGATE));
- Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array));
- Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, Log2_32_Ceil(LastVal+1)));
- AggregateAbbrev = Stream.EmitAbbrev(Abbv);
-
- // Abbrev for CST_CODE_STRING.
- Abbv = new BitCodeAbbrev();
- Abbv->Add(BitCodeAbbrevOp(bitc::CST_CODE_STRING));
- Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array));
- Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 8));
- String8Abbrev = Stream.EmitAbbrev(Abbv);
- // Abbrev for CST_CODE_CSTRING.
- Abbv = new BitCodeAbbrev();
- Abbv->Add(BitCodeAbbrevOp(bitc::CST_CODE_CSTRING));
- Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array));
- Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 7));
- CString7Abbrev = Stream.EmitAbbrev(Abbv);
- // Abbrev for CST_CODE_CSTRING.
- Abbv = new BitCodeAbbrev();
- Abbv->Add(BitCodeAbbrevOp(bitc::CST_CODE_CSTRING));
- Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array));
- Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Char6));
- CString6Abbrev = Stream.EmitAbbrev(Abbv);
- }
-
- SmallVector<uint64_t, 64> Record;
-
- const ValueEnumerator::ValueList &Vals = VE.getValues();
- const Type *LastTy = 0;
- for (unsigned i = FirstVal; i != LastVal; ++i) {
- const Value *V = Vals[i].first;
- // If we need to switch types, do so now.
- if (V->getType() != LastTy) {
- LastTy = V->getType();
- Record.push_back(VE.getTypeID(LastTy));
- Stream.EmitRecord(bitc::CST_CODE_SETTYPE, Record,
- CONSTANTS_SETTYPE_ABBREV);
- Record.clear();
- }
-
- if (const InlineAsm *IA = dyn_cast<InlineAsm>(V)) {
- Record.push_back(unsigned(IA->hasSideEffects()));
-
- // Add the asm string.
- const std::string &AsmStr = IA->getAsmString();
- Record.push_back(AsmStr.size());
- for (unsigned i = 0, e = AsmStr.size(); i != e; ++i)
- Record.push_back(AsmStr[i]);
-
- // Add the constraint string.
- const std::string &ConstraintStr = IA->getConstraintString();
- Record.push_back(ConstraintStr.size());
- for (unsigned i = 0, e = ConstraintStr.size(); i != e; ++i)
- Record.push_back(ConstraintStr[i]);
- Stream.EmitRecord(bitc::CST_CODE_INLINEASM, Record);
- Record.clear();
- continue;
- }
- const Constant *C = cast<Constant>(V);
- unsigned Code = -1U;
- unsigned AbbrevToUse = 0;
- if (C->isNullValue()) {
- Code = bitc::CST_CODE_NULL;
- } else if (isa<UndefValue>(C)) {
- Code = bitc::CST_CODE_UNDEF;
- } else if (const ConstantInt *IV = dyn_cast<ConstantInt>(C)) {
- if (IV->getBitWidth() <= 64) {
- int64_t V = IV->getSExtValue();
- if (V >= 0)
- Record.push_back(V << 1);
- else
- Record.push_back((-V << 1) | 1);
- Code = bitc::CST_CODE_INTEGER;
- AbbrevToUse = CONSTANTS_INTEGER_ABBREV;
- } else { // Wide integers, > 64 bits in size.
- // We have an arbitrary precision integer value to write whose
- // bit width is > 64. However, in canonical unsigned integer
- // format it is likely that the high bits are going to be zero.
- // So, we only write the number of active words.
- unsigned NWords = IV->getValue().getActiveWords();
- const uint64_t *RawWords = IV->getValue().getRawData();
- for (unsigned i = 0; i != NWords; ++i) {
- int64_t V = RawWords[i];
- if (V >= 0)
- Record.push_back(V << 1);
- else
- Record.push_back((-V << 1) | 1);
- }
- Code = bitc::CST_CODE_WIDE_INTEGER;
- }
- } else if (const ConstantFP *CFP = dyn_cast<ConstantFP>(C)) {
- Code = bitc::CST_CODE_FLOAT;
- const Type *Ty = CFP->getType();
- if (Ty == Type::FloatTy || Ty == Type::DoubleTy) {
- Record.push_back(CFP->getValueAPF().convertToAPInt().getZExtValue());
- } else if (Ty == Type::X86_FP80Ty) {
- // api needed to prevent premature destruction
- APInt api = CFP->getValueAPF().convertToAPInt();
- const uint64_t *p = api.getRawData();
- Record.push_back(p[0]);
- Record.push_back((uint16_t)p[1]);
- } else if (Ty == Type::FP128Ty || Ty == Type::PPC_FP128Ty) {
- APInt api = CFP->getValueAPF().convertToAPInt();
- const uint64_t *p = api.getRawData();
- Record.push_back(p[0]);
- Record.push_back(p[1]);
- } else {
- assert (0 && "Unknown FP type!");
- }
- } else if (isa<ConstantArray>(C) && cast<ConstantArray>(C)->isString()) {
- // Emit constant strings specially.
- unsigned NumOps = C->getNumOperands();
- // If this is a null-terminated string, use the denser CSTRING encoding.
- if (C->getOperand(NumOps-1)->isNullValue()) {
- Code = bitc::CST_CODE_CSTRING;
- --NumOps; // Don't encode the null, which isn't allowed by char6.
- } else {
- Code = bitc::CST_CODE_STRING;
- AbbrevToUse = String8Abbrev;
- }
- bool isCStr7 = Code == bitc::CST_CODE_CSTRING;
- bool isCStrChar6 = Code == bitc::CST_CODE_CSTRING;
- for (unsigned i = 0; i != NumOps; ++i) {
- unsigned char V = cast<ConstantInt>(C->getOperand(i))->getZExtValue();
- Record.push_back(V);
- isCStr7 &= (V & 128) == 0;
- if (isCStrChar6)
- isCStrChar6 = BitCodeAbbrevOp::isChar6(V);
- }
-
- if (isCStrChar6)
- AbbrevToUse = CString6Abbrev;
- else if (isCStr7)
- AbbrevToUse = CString7Abbrev;
- } else if (isa<ConstantArray>(C) || isa<ConstantStruct>(V) ||
- isa<ConstantVector>(V)) {
- Code = bitc::CST_CODE_AGGREGATE;
- for (unsigned i = 0, e = C->getNumOperands(); i != e; ++i)
- Record.push_back(VE.getValueID(C->getOperand(i)));
- AbbrevToUse = AggregateAbbrev;
- } else if (const ConstantExpr *CE = dyn_cast<ConstantExpr>(C)) {
- switch (CE->getOpcode()) {
- default:
- if (Instruction::isCast(CE->getOpcode())) {
- Code = bitc::CST_CODE_CE_CAST;
- Record.push_back(GetEncodedCastOpcode(CE->getOpcode()));
- Record.push_back(VE.getTypeID(C->getOperand(0)->getType()));
- Record.push_back(VE.getValueID(C->getOperand(0)));
- AbbrevToUse = CONSTANTS_CE_CAST_Abbrev;
- } else {
- assert(CE->getNumOperands() == 2 && "Unknown constant expr!");
- Code = bitc::CST_CODE_CE_BINOP;
- Record.push_back(GetEncodedBinaryOpcode(CE->getOpcode()));
- Record.push_back(VE.getValueID(C->getOperand(0)));
- Record.push_back(VE.getValueID(C->getOperand(1)));
- }
- break;
- case Instruction::GetElementPtr:
- Code = bitc::CST_CODE_CE_GEP;
- for (unsigned i = 0, e = CE->getNumOperands(); i != e; ++i) {
- Record.push_back(VE.getTypeID(C->getOperand(i)->getType()));
- Record.push_back(VE.getValueID(C->getOperand(i)));
- }
- break;
- case Instruction::Select:
- Code = bitc::CST_CODE_CE_SELECT;
- Record.push_back(VE.getValueID(C->getOperand(0)));
- Record.push_back(VE.getValueID(C->getOperand(1)));
- Record.push_back(VE.getValueID(C->getOperand(2)));
- break;
- case Instruction::ExtractElement:
- Code = bitc::CST_CODE_CE_EXTRACTELT;
- Record.push_back(VE.getTypeID(C->getOperand(0)->getType()));
- Record.push_back(VE.getValueID(C->getOperand(0)));
- Record.push_back(VE.getValueID(C->getOperand(1)));
- break;
- case Instruction::InsertElement:
- Code = bitc::CST_CODE_CE_INSERTELT;
- Record.push_back(VE.getValueID(C->getOperand(0)));
- Record.push_back(VE.getValueID(C->getOperand(1)));
- Record.push_back(VE.getValueID(C->getOperand(2)));
- break;
- case Instruction::ShuffleVector:
- Code = bitc::CST_CODE_CE_SHUFFLEVEC;
- Record.push_back(VE.getValueID(C->getOperand(0)));
- Record.push_back(VE.getValueID(C->getOperand(1)));
- Record.push_back(VE.getValueID(C->getOperand(2)));
- break;
- case Instruction::ICmp:
- case Instruction::FCmp:
- Code = bitc::CST_CODE_CE_CMP;
- Record.push_back(VE.getTypeID(C->getOperand(0)->getType()));
- Record.push_back(VE.getValueID(C->getOperand(0)));
- Record.push_back(VE.getValueID(C->getOperand(1)));
- Record.push_back(CE->getPredicate());
- break;
- }
- } else {
- assert(0 && "Unknown constant!");
- }
- Stream.EmitRecord(Code, Record, AbbrevToUse);
- Record.clear();
- }
-
- Stream.ExitBlock();
-}
-
-static void WriteModuleConstants(const ValueEnumerator &VE,
- BitstreamWriter &Stream) {
- const ValueEnumerator::ValueList &Vals = VE.getValues();
-
- // Find the first constant to emit, which is the first non-globalvalue value.
- // We know globalvalues have been emitted by WriteModuleInfo.
- for (unsigned i = 0, e = Vals.size(); i != e; ++i) {
- if (!isa<GlobalValue>(Vals[i].first)) {
- WriteConstants(i, Vals.size(), VE, Stream, true);
- return;
- }
- }
-}
-
-/// PushValueAndType - The file has to encode both the value and type id for
-/// many values, because we need to know what type to create for forward
-/// references. However, most operands are not forward references, so this type
-/// field is not needed.
-///
-/// This function adds V's value ID to Vals. If the value ID is higher than the
-/// instruction ID, then it is a forward reference, and it also includes the
-/// type ID.
-static bool PushValueAndType(Value *V, unsigned InstID,
- SmallVector<unsigned, 64> &Vals,
- ValueEnumerator &VE) {
- unsigned ValID = VE.getValueID(V);
- Vals.push_back(ValID);
- if (ValID >= InstID) {
- Vals.push_back(VE.getTypeID(V->getType()));
- return true;
- }
- return false;
-}
-
-/// WriteInstruction - Emit an instruction to the specified stream.
-static void WriteInstruction(const Instruction &I, unsigned InstID,
- ValueEnumerator &VE, BitstreamWriter &Stream,
- SmallVector<unsigned, 64> &Vals) {
- unsigned Code = 0;
- unsigned AbbrevToUse = 0;
- switch (I.getOpcode()) {
- default:
- if (Instruction::isCast(I.getOpcode())) {
- Code = bitc::FUNC_CODE_INST_CAST;
- if (!PushValueAndType(I.getOperand(0), InstID, Vals, VE))
- AbbrevToUse = FUNCTION_INST_CAST_ABBREV;
- Vals.push_back(VE.getTypeID(I.getType()));
- Vals.push_back(GetEncodedCastOpcode(I.getOpcode()));
- } else {
- assert(isa<BinaryOperator>(I) && "Unknown instruction!");
- Code = bitc::FUNC_CODE_INST_BINOP;
- if (!PushValueAndType(I.getOperand(0), InstID, Vals, VE))
- AbbrevToUse = FUNCTION_INST_BINOP_ABBREV;
- Vals.push_back(VE.getValueID(I.getOperand(1)));
- Vals.push_back(GetEncodedBinaryOpcode(I.getOpcode()));
- }
- break;
-
- case Instruction::GetElementPtr:
- Code = bitc::FUNC_CODE_INST_GEP;
- for (unsigned i = 0, e = I.getNumOperands(); i != e; ++i)
- PushValueAndType(I.getOperand(i), InstID, Vals, VE);
- break;
- case Instruction::Select:
- Code = bitc::FUNC_CODE_INST_SELECT;
- PushValueAndType(I.getOperand(1), InstID, Vals, VE);
- Vals.push_back(VE.getValueID(I.getOperand(2)));
- Vals.push_back(VE.getValueID(I.getOperand(0)));
- break;
- case Instruction::ExtractElement:
- Code = bitc::FUNC_CODE_INST_EXTRACTELT;
- PushValueAndType(I.getOperand(0), InstID, Vals, VE);
- Vals.push_back(VE.getValueID(I.getOperand(1)));
- break;
- case Instruction::InsertElement:
- Code = bitc::FUNC_CODE_INST_INSERTELT;
- PushValueAndType(I.getOperand(0), InstID, Vals, VE);
- Vals.push_back(VE.getValueID(I.getOperand(1)));
- Vals.push_back(VE.getValueID(I.getOperand(2)));
- break;
- case Instruction::ShuffleVector:
- Code = bitc::FUNC_CODE_INST_SHUFFLEVEC;
- PushValueAndType(I.getOperand(0), InstID, Vals, VE);
- Vals.push_back(VE.getValueID(I.getOperand(1)));
- Vals.push_back(VE.getValueID(I.getOperand(2)));
- break;
- case Instruction::ICmp:
- case Instruction::FCmp:
- Code = bitc::FUNC_CODE_INST_CMP;
- PushValueAndType(I.getOperand(0), InstID, Vals, VE);
- Vals.push_back(VE.getValueID(I.getOperand(1)));
- Vals.push_back(cast<CmpInst>(I).getPredicate());
- break;
- case Instruction::GetResult:
- Code = bitc::FUNC_CODE_INST_GETRESULT;
- PushValueAndType(I.getOperand(0), InstID, Vals, VE);
- Vals.push_back(cast<GetResultInst>(I).getIndex());
- break;
-
- case Instruction::Ret:
- {
- Code = bitc::FUNC_CODE_INST_RET;
- unsigned NumOperands = I.getNumOperands();
- if (NumOperands == 0)
- AbbrevToUse = FUNCTION_INST_RET_VOID_ABBREV;
- else if (NumOperands == 1) {
- if (!PushValueAndType(I.getOperand(0), InstID, Vals, VE))
- AbbrevToUse = FUNCTION_INST_RET_VAL_ABBREV;
- } else {
- for (unsigned i = 0, e = NumOperands; i != e; ++i)
- PushValueAndType(I.getOperand(i), InstID, Vals, VE);
- }
- }
- break;
- case Instruction::Br:
- Code = bitc::FUNC_CODE_INST_BR;
- Vals.push_back(VE.getValueID(I.getOperand(0)));
- if (cast<BranchInst>(I).isConditional()) {
- Vals.push_back(VE.getValueID(I.getOperand(1)));
- Vals.push_back(VE.getValueID(I.getOperand(2)));
- }
- break;
- case Instruction::Switch:
- Code = bitc::FUNC_CODE_INST_SWITCH;
- Vals.push_back(VE.getTypeID(I.getOperand(0)->getType()));
- for (unsigned i = 0, e = I.getNumOperands(); i != e; ++i)
- Vals.push_back(VE.getValueID(I.getOperand(i)));
- break;
- case Instruction::Invoke: {
- const PointerType *PTy = cast<PointerType>(I.getOperand(0)->getType());
- const FunctionType *FTy = cast<FunctionType>(PTy->getElementType());
- Code = bitc::FUNC_CODE_INST_INVOKE;
-
- const InvokeInst *II = cast<InvokeInst>(&I);
- Vals.push_back(VE.getParamAttrID(II->getParamAttrs()));
- Vals.push_back(II->getCallingConv());
- Vals.push_back(VE.getValueID(I.getOperand(1))); // normal dest
- Vals.push_back(VE.getValueID(I.getOperand(2))); // unwind dest
- PushValueAndType(I.getOperand(0), InstID, Vals, VE); // callee
-
- // Emit value #'s for the fixed parameters.
- for (unsigned i = 0, e = FTy->getNumParams(); i != e; ++i)
- Vals.push_back(VE.getValueID(I.getOperand(i+3))); // fixed param.
-
- // Emit type/value pairs for varargs params.
- if (FTy->isVarArg()) {
- for (unsigned i = 3+FTy->getNumParams(), e = I.getNumOperands();
- i != e; ++i)
- PushValueAndType(I.getOperand(i), InstID, Vals, VE); // vararg
- }
- break;
- }
- case Instruction::Unwind:
- Code = bitc::FUNC_CODE_INST_UNWIND;
- break;
- case Instruction::Unreachable:
- Code = bitc::FUNC_CODE_INST_UNREACHABLE;
- AbbrevToUse = FUNCTION_INST_UNREACHABLE_ABBREV;
- break;
-
- case Instruction::PHI:
- Code = bitc::FUNC_CODE_INST_PHI;
- Vals.push_back(VE.getTypeID(I.getType()));
- for (unsigned i = 0, e = I.getNumOperands(); i != e; ++i)
- Vals.push_back(VE.getValueID(I.getOperand(i)));
- break;
-
- case Instruction::Malloc:
- Code = bitc::FUNC_CODE_INST_MALLOC;
- Vals.push_back(VE.getTypeID(I.getType()));
- Vals.push_back(VE.getValueID(I.getOperand(0))); // size.
- Vals.push_back(Log2_32(cast<MallocInst>(I).getAlignment())+1);
- break;
-
- case Instruction::Free:
- Code = bitc::FUNC_CODE_INST_FREE;
- PushValueAndType(I.getOperand(0), InstID, Vals, VE);
- break;
-
- case Instruction::Alloca:
- Code = bitc::FUNC_CODE_INST_ALLOCA;
- Vals.push_back(VE.getTypeID(I.getType()));
- Vals.push_back(VE.getValueID(I.getOperand(0))); // size.
- Vals.push_back(Log2_32(cast<AllocaInst>(I).getAlignment())+1);
- break;
-
- case Instruction::Load:
- Code = bitc::FUNC_CODE_INST_LOAD;
- if (!PushValueAndType(I.getOperand(0), InstID, Vals, VE)) // ptr
- AbbrevToUse = FUNCTION_INST_LOAD_ABBREV;
-
- Vals.push_back(Log2_32(cast<LoadInst>(I).getAlignment())+1);
- Vals.push_back(cast<LoadInst>(I).isVolatile());
- break;
- case Instruction::Store:
- Code = bitc::FUNC_CODE_INST_STORE2;
- PushValueAndType(I.getOperand(1), InstID, Vals, VE); // ptrty + ptr
- Vals.push_back(VE.getValueID(I.getOperand(0))); // val.
- Vals.push_back(Log2_32(cast<StoreInst>(I).getAlignment())+1);
- Vals.push_back(cast<StoreInst>(I).isVolatile());
- break;
- case Instruction::Call: {
- const PointerType *PTy = cast<PointerType>(I.getOperand(0)->getType());
- const FunctionType *FTy = cast<FunctionType>(PTy->getElementType());
-
- Code = bitc::FUNC_CODE_INST_CALL;
-
- const CallInst *CI = cast<CallInst>(&I);
- Vals.push_back(VE.getParamAttrID(CI->getParamAttrs()));
- Vals.push_back((CI->getCallingConv() << 1) | unsigned(CI->isTailCall()));
- PushValueAndType(CI->getOperand(0), InstID, Vals, VE); // Callee
-
- // Emit value #'s for the fixed parameters.
- for (unsigned i = 0, e = FTy->getNumParams(); i != e; ++i)
- Vals.push_back(VE.getValueID(I.getOperand(i+1))); // fixed param.
-
- // Emit type/value pairs for varargs params.
- if (FTy->isVarArg()) {
- unsigned NumVarargs = I.getNumOperands()-1-FTy->getNumParams();
- for (unsigned i = I.getNumOperands()-NumVarargs, e = I.getNumOperands();
- i != e; ++i)
- PushValueAndType(I.getOperand(i), InstID, Vals, VE); // varargs
- }
- break;
- }
- case Instruction::VAArg:
- Code = bitc::FUNC_CODE_INST_VAARG;
- Vals.push_back(VE.getTypeID(I.getOperand(0)->getType())); // valistty
- Vals.push_back(VE.getValueID(I.getOperand(0))); // valist.
- Vals.push_back(VE.getTypeID(I.getType())); // restype.
- break;
- }
-
- Stream.EmitRecord(Code, Vals, AbbrevToUse);
- Vals.clear();
-}
-
-// Emit names for globals/functions etc.
-static void WriteValueSymbolTable(const ValueSymbolTable &VST,
- const ValueEnumerator &VE,
- BitstreamWriter &Stream) {
- if (VST.empty()) return;
- Stream.EnterSubblock(bitc::VALUE_SYMTAB_BLOCK_ID, 4);
-
- // FIXME: Set up the abbrev, we know how many values there are!
- // FIXME: We know if the type names can use 7-bit ascii.
- SmallVector<unsigned, 64> NameVals;
-
- for (ValueSymbolTable::const_iterator SI = VST.begin(), SE = VST.end();
- SI != SE; ++SI) {
-
- const ValueName &Name = *SI;
-
- // Figure out the encoding to use for the name.
- bool is7Bit = true;
- bool isChar6 = true;
- for (const char *C = Name.getKeyData(), *E = C+Name.getKeyLength();
- C != E; ++C) {
- if (isChar6)
- isChar6 = BitCodeAbbrevOp::isChar6(*C);
- if ((unsigned char)*C & 128) {
- is7Bit = false;
- break; // don't bother scanning the rest.
- }
- }
-
- unsigned AbbrevToUse = VST_ENTRY_8_ABBREV;
-
- // VST_ENTRY: [valueid, namechar x N]
- // VST_BBENTRY: [bbid, namechar x N]
- unsigned Code;
- if (isa<BasicBlock>(SI->getValue())) {
- Code = bitc::VST_CODE_BBENTRY;
- if (isChar6)
- AbbrevToUse = VST_BBENTRY_6_ABBREV;
- } else {
- Code = bitc::VST_CODE_ENTRY;
- if (isChar6)
- AbbrevToUse = VST_ENTRY_6_ABBREV;
- else if (is7Bit)
- AbbrevToUse = VST_ENTRY_7_ABBREV;
- }
-
- NameVals.push_back(VE.getValueID(SI->getValue()));
- for (const char *P = Name.getKeyData(),
- *E = Name.getKeyData()+Name.getKeyLength(); P != E; ++P)
- NameVals.push_back((unsigned char)*P);
-
- // Emit the finished record.
- Stream.EmitRecord(Code, NameVals, AbbrevToUse);
- NameVals.clear();
- }
- Stream.ExitBlock();
-}
-
-/// WriteFunction - Emit a function body to the module stream.
-static void WriteFunction(const Function &F, ValueEnumerator &VE,
- BitstreamWriter &Stream) {
- Stream.EnterSubblock(bitc::FUNCTION_BLOCK_ID, 4);
- VE.incorporateFunction(F);
-
- SmallVector<unsigned, 64> Vals;
-
- // Emit the number of basic blocks, so the reader can create them ahead of
- // time.
- Vals.push_back(VE.getBasicBlocks().size());
- Stream.EmitRecord(bitc::FUNC_CODE_DECLAREBLOCKS, Vals);
- Vals.clear();
-
- // If there are function-local constants, emit them now.
- unsigned CstStart, CstEnd;
- VE.getFunctionConstantRange(CstStart, CstEnd);
- WriteConstants(CstStart, CstEnd, VE, Stream, false);
-
- // Keep a running idea of what the instruction ID is.
- unsigned InstID = CstEnd;
-
- // Finally, emit all the instructions, in order.
- for (Function::const_iterator BB = F.begin(), E = F.end(); BB != E; ++BB)
- for (BasicBlock::const_iterator I = BB->begin(), E = BB->end();
- I != E; ++I) {
- WriteInstruction(*I, InstID, VE, Stream, Vals);
- if (I->getType() != Type::VoidTy)
- ++InstID;
- }
-
- // Emit names for all the instructions etc.
- WriteValueSymbolTable(F.getValueSymbolTable(), VE, Stream);
-
- VE.purgeFunction();
- Stream.ExitBlock();
-}
-
-/// WriteTypeSymbolTable - Emit a block for the specified type symtab.
-static void WriteTypeSymbolTable(const TypeSymbolTable &TST,
- const ValueEnumerator &VE,
- BitstreamWriter &Stream) {
- if (TST.empty()) return;
-
- Stream.EnterSubblock(bitc::TYPE_SYMTAB_BLOCK_ID, 3);
-
- // 7-bit fixed width VST_CODE_ENTRY strings.
- BitCodeAbbrev *Abbv = new BitCodeAbbrev();
- Abbv->Add(BitCodeAbbrevOp(bitc::VST_CODE_ENTRY));
- Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed,
- Log2_32_Ceil(VE.getTypes().size()+1)));
- Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array));
- Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 7));
- unsigned V7Abbrev = Stream.EmitAbbrev(Abbv);
-
- SmallVector<unsigned, 64> NameVals;
-
- for (TypeSymbolTable::const_iterator TI = TST.begin(), TE = TST.end();
- TI != TE; ++TI) {
- // TST_ENTRY: [typeid, namechar x N]
- NameVals.push_back(VE.getTypeID(TI->second));
-
- const std::string &Str = TI->first;
- bool is7Bit = true;
- for (unsigned i = 0, e = Str.size(); i != e; ++i) {
- NameVals.push_back((unsigned char)Str[i]);
- if (Str[i] & 128)
- is7Bit = false;
- }
-
- // Emit the finished record.
- Stream.EmitRecord(bitc::VST_CODE_ENTRY, NameVals, is7Bit ? V7Abbrev : 0);
- NameVals.clear();
- }
-
- Stream.ExitBlock();
-}
-
-// Emit blockinfo, which defines the standard abbreviations etc.
-static void WriteBlockInfo(const ValueEnumerator &VE, BitstreamWriter &Stream) {
- // We only want to emit block info records for blocks that have multiple
- // instances: CONSTANTS_BLOCK, FUNCTION_BLOCK and VALUE_SYMTAB_BLOCK. Other
- // blocks can defined their abbrevs inline.
- Stream.EnterBlockInfoBlock(2);
-
- { // 8-bit fixed-width VST_ENTRY/VST_BBENTRY strings.
- BitCodeAbbrev *Abbv = new BitCodeAbbrev();
- Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3));
- Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 8));
- Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array));
- Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 8));
- if (Stream.EmitBlockInfoAbbrev(bitc::VALUE_SYMTAB_BLOCK_ID,
- Abbv) != VST_ENTRY_8_ABBREV)
- assert(0 && "Unexpected abbrev ordering!");
- }
-
- { // 7-bit fixed width VST_ENTRY strings.
- BitCodeAbbrev *Abbv = new BitCodeAbbrev();
- Abbv->Add(BitCodeAbbrevOp(bitc::VST_CODE_ENTRY));
- Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 8));
- Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array));
- Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 7));
- if (Stream.EmitBlockInfoAbbrev(bitc::VALUE_SYMTAB_BLOCK_ID,
- Abbv) != VST_ENTRY_7_ABBREV)
- assert(0 && "Unexpected abbrev ordering!");
- }
- { // 6-bit char6 VST_ENTRY strings.
- BitCodeAbbrev *Abbv = new BitCodeAbbrev();
- Abbv->Add(BitCodeAbbrevOp(bitc::VST_CODE_ENTRY));
- Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 8));
- Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array));
- Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Char6));
- if (Stream.EmitBlockInfoAbbrev(bitc::VALUE_SYMTAB_BLOCK_ID,
- Abbv) != VST_ENTRY_6_ABBREV)
- assert(0 && "Unexpected abbrev ordering!");
- }
- { // 6-bit char6 VST_BBENTRY strings.
- BitCodeAbbrev *Abbv = new BitCodeAbbrev();
- Abbv->Add(BitCodeAbbrevOp(bitc::VST_CODE_BBENTRY));
- Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 8));
- Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array));
- Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Char6));
- if (Stream.EmitBlockInfoAbbrev(bitc::VALUE_SYMTAB_BLOCK_ID,
- Abbv) != VST_BBENTRY_6_ABBREV)
- assert(0 && "Unexpected abbrev ordering!");
- }
-
-
-
- { // SETTYPE abbrev for CONSTANTS_BLOCK.
- BitCodeAbbrev *Abbv = new BitCodeAbbrev();
- Abbv->Add(BitCodeAbbrevOp(bitc::CST_CODE_SETTYPE));
- Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed,
- Log2_32_Ceil(VE.getTypes().size()+1)));
- if (Stream.EmitBlockInfoAbbrev(bitc::CONSTANTS_BLOCK_ID,
- Abbv) != CONSTANTS_SETTYPE_ABBREV)
- assert(0 && "Unexpected abbrev ordering!");
- }
-
- { // INTEGER abbrev for CONSTANTS_BLOCK.
- BitCodeAbbrev *Abbv = new BitCodeAbbrev();
- Abbv->Add(BitCodeAbbrevOp(bitc::CST_CODE_INTEGER));
- Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 8));
- if (Stream.EmitBlockInfoAbbrev(bitc::CONSTANTS_BLOCK_ID,
- Abbv) != CONSTANTS_INTEGER_ABBREV)
- assert(0 && "Unexpected abbrev ordering!");
- }
-
- { // CE_CAST abbrev for CONSTANTS_BLOCK.
- BitCodeAbbrev *Abbv = new BitCodeAbbrev();
- Abbv->Add(BitCodeAbbrevOp(bitc::CST_CODE_CE_CAST));
- Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 4)); // cast opc
- Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, // typeid
- Log2_32_Ceil(VE.getTypes().size()+1)));
- Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 8)); // value id
-
- if (Stream.EmitBlockInfoAbbrev(bitc::CONSTANTS_BLOCK_ID,
- Abbv) != CONSTANTS_CE_CAST_Abbrev)
- assert(0 && "Unexpected abbrev ordering!");
- }
- { // NULL abbrev for CONSTANTS_BLOCK.
- BitCodeAbbrev *Abbv = new BitCodeAbbrev();
- Abbv->Add(BitCodeAbbrevOp(bitc::CST_CODE_NULL));
- if (Stream.EmitBlockInfoAbbrev(bitc::CONSTANTS_BLOCK_ID,
- Abbv) != CONSTANTS_NULL_Abbrev)
- assert(0 && "Unexpected abbrev ordering!");
- }
-
- // FIXME: This should only use space for first class types!
-
- { // INST_LOAD abbrev for FUNCTION_BLOCK.
- BitCodeAbbrev *Abbv = new BitCodeAbbrev();
- Abbv->Add(BitCodeAbbrevOp(bitc::FUNC_CODE_INST_LOAD));
- Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // Ptr
- Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 4)); // Align
- Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); // volatile
- if (Stream.EmitBlockInfoAbbrev(bitc::FUNCTION_BLOCK_ID,
- Abbv) != FUNCTION_INST_LOAD_ABBREV)
- assert(0 && "Unexpected abbrev ordering!");
- }
- { // INST_BINOP abbrev for FUNCTION_BLOCK.
- BitCodeAbbrev *Abbv = new BitCodeAbbrev();
- Abbv->Add(BitCodeAbbrevOp(bitc::FUNC_CODE_INST_BINOP));
- Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // LHS
- Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // RHS
- Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 4)); // opc
- if (Stream.EmitBlockInfoAbbrev(bitc::FUNCTION_BLOCK_ID,
- Abbv) != FUNCTION_INST_BINOP_ABBREV)
- assert(0 && "Unexpected abbrev ordering!");
- }
- { // INST_CAST abbrev for FUNCTION_BLOCK.
- BitCodeAbbrev *Abbv = new BitCodeAbbrev();
- Abbv->Add(BitCodeAbbrevOp(bitc::FUNC_CODE_INST_CAST));
- Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // OpVal
- Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, // dest ty
- Log2_32_Ceil(VE.getTypes().size()+1)));
- Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 4)); // opc
- if (Stream.EmitBlockInfoAbbrev(bitc::FUNCTION_BLOCK_ID,
- Abbv) != FUNCTION_INST_CAST_ABBREV)
- assert(0 && "Unexpected abbrev ordering!");
- }
-
- { // INST_RET abbrev for FUNCTION_BLOCK.
- BitCodeAbbrev *Abbv = new BitCodeAbbrev();
- Abbv->Add(BitCodeAbbrevOp(bitc::FUNC_CODE_INST_RET));
- if (Stream.EmitBlockInfoAbbrev(bitc::FUNCTION_BLOCK_ID,
- Abbv) != FUNCTION_INST_RET_VOID_ABBREV)
- assert(0 && "Unexpected abbrev ordering!");
- }
- { // INST_RET abbrev for FUNCTION_BLOCK.
- BitCodeAbbrev *Abbv = new BitCodeAbbrev();
- Abbv->Add(BitCodeAbbrevOp(bitc::FUNC_CODE_INST_RET));
- Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // ValID
- if (Stream.EmitBlockInfoAbbrev(bitc::FUNCTION_BLOCK_ID,
- Abbv) != FUNCTION_INST_RET_VAL_ABBREV)
- assert(0 && "Unexpected abbrev ordering!");
- }
- { // INST_UNREACHABLE abbrev for FUNCTION_BLOCK.
- BitCodeAbbrev *Abbv = new BitCodeAbbrev();
- Abbv->Add(BitCodeAbbrevOp(bitc::FUNC_CODE_INST_UNREACHABLE));
- if (Stream.EmitBlockInfoAbbrev(bitc::FUNCTION_BLOCK_ID,
- Abbv) != FUNCTION_INST_UNREACHABLE_ABBREV)
- assert(0 && "Unexpected abbrev ordering!");
- }
-
- Stream.ExitBlock();
-}
-
-
-/// WriteModule - Emit the specified module to the bitstream.
-static void WriteModule(const Module *M, BitstreamWriter &Stream) {
- Stream.EnterSubblock(bitc::MODULE_BLOCK_ID, 3);
-
- // Emit the version number if it is non-zero.
- if (CurVersion) {
- SmallVector<unsigned, 1> Vals;
- Vals.push_back(CurVersion);
- Stream.EmitRecord(bitc::MODULE_CODE_VERSION, Vals);
- }
-
- // Analyze the module, enumerating globals, functions, etc.
- ValueEnumerator VE(M);
-
- // Emit blockinfo, which defines the standard abbreviations etc.
- WriteBlockInfo(VE, Stream);
-
- // Emit information about parameter attributes.
- WriteParamAttrTable(VE, Stream);
-
- // Emit information describing all of the types in the module.
- WriteTypeTable(VE, Stream);
-
- // Emit top-level description of module, including target triple, inline asm,
- // descriptors for global variables, and function prototype info.
- WriteModuleInfo(M, VE, Stream);
-
- // Emit constants.
- WriteModuleConstants(VE, Stream);
-
- // If we have any aggregate values in the value table, purge them - these can
- // only be used to initialize global variables. Doing so makes the value
- // namespace smaller for code in functions.
- int NumNonAggregates = VE.PurgeAggregateValues();
- if (NumNonAggregates != -1) {
- SmallVector<unsigned, 1> Vals;
- Vals.push_back(NumNonAggregates);
- Stream.EmitRecord(bitc::MODULE_CODE_PURGEVALS, Vals);
- }
-
- // Emit function bodies.
- for (Module::const_iterator I = M->begin(), E = M->end(); I != E; ++I)
- if (!I->isDeclaration())
- WriteFunction(*I, VE, Stream);
-
- // Emit the type symbol table information.
- WriteTypeSymbolTable(M->getTypeSymbolTable(), VE, Stream);
-
- // Emit names for globals/functions etc.
- WriteValueSymbolTable(M->getValueSymbolTable(), VE, Stream);
-
- Stream.ExitBlock();
-}
-
-
-/// WriteBitcodeToFile - Write the specified module to the specified output
-/// stream.
-void llvm::WriteBitcodeToFile(const Module *M, std::ostream &Out) {
- std::vector<unsigned char> Buffer;
- BitstreamWriter Stream(Buffer);
-
- Buffer.reserve(256*1024);
-
- // Emit the file header.
- Stream.Emit((unsigned)'B', 8);
- Stream.Emit((unsigned)'C', 8);
- Stream.Emit(0x0, 4);
- Stream.Emit(0xC, 4);
- Stream.Emit(0xE, 4);
- Stream.Emit(0xD, 4);
-
- // Emit the module.
- WriteModule(M, Stream);
-
- // Write the generated bitstream to "Out".
- Out.write((char*)&Buffer.front(), Buffer.size());
-
- // Make sure it hits disk now.
- Out.flush();
-}
diff --git a/release_23/lib/Bitcode/Writer/BitcodeWriterPass.cpp b/release_23/lib/Bitcode/Writer/BitcodeWriterPass.cpp
deleted file mode 100644
index 522060e78e71..000000000000
--- a/release_23/lib/Bitcode/Writer/BitcodeWriterPass.cpp
+++ /dev/null
@@ -1,43 +0,0 @@
-//===--- Bitcode/Writer/BitcodeWriterPass.cpp - Bitcode Writer ------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// BitcodeWriterPass implementation.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Bitcode/ReaderWriter.h"
-#include "llvm/Pass.h"
-using namespace llvm;
-
-namespace {
- class WriteBitcodePass : public ModulePass {
- std::ostream &Out; // ostream to print on
- public:
- static char ID; // Pass identifcation, replacement for typeid
- explicit WriteBitcodePass(std::ostream &o)
- : ModulePass((intptr_t) &ID), Out(o) {}
-
- const char *getPassName() const { return "Bitcode Writer"; }
-
- bool runOnModule(Module &M) {
- WriteBitcodeToFile(&M, Out);
- return false;
- }
- };
-}
-
-char WriteBitcodePass::ID = 0;
-
-/// CreateBitcodeWriterPass - Create and return a pass that writes the module
-/// to the specified ostream.
-ModulePass *llvm::CreateBitcodeWriterPass(std::ostream &Str) {
- return new WriteBitcodePass(Str);
-}
-
-
diff --git a/release_23/lib/Bitcode/Writer/Makefile b/release_23/lib/Bitcode/Writer/Makefile
deleted file mode 100644
index 7abc1d3d8f0d..000000000000
--- a/release_23/lib/Bitcode/Writer/Makefile
+++ /dev/null
@@ -1,15 +0,0 @@
-##===- lib/Bitcode/Reader/Makefile -------------------------*- Makefile -*-===##
-#
-# The LLVM Compiler Infrastructure
-#
-# This file is distributed under the University of Illinois Open Source
-# License. See LICENSE.TXT for details.
-#
-##===----------------------------------------------------------------------===##
-
-LEVEL = ../../..
-LIBRARYNAME = LLVMBitWriter
-BUILD_ARCHIVE = 1
-
-include $(LEVEL)/Makefile.common
-
diff --git a/release_23/lib/Bitcode/Writer/Serialize.cpp b/release_23/lib/Bitcode/Writer/Serialize.cpp
deleted file mode 100644
index 79464a61be46..000000000000
--- a/release_23/lib/Bitcode/Writer/Serialize.cpp
+++ /dev/null
@@ -1,118 +0,0 @@
-//==- Serialize.cpp - Generic Object Serialization to Bitcode ----*- C++ -*-==//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines the internal methods used for object serialization.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Bitcode/Serialize.h"
-#include "string.h"
-
-#ifdef DEBUG_BACKPATCH
-#include "llvm/Support/Streams.h"
-#endif
-
-using namespace llvm;
-
-Serializer::Serializer(BitstreamWriter& stream)
- : Stream(stream), BlockLevel(0) {}
-
-Serializer::~Serializer() {
- if (inRecord())
- EmitRecord();
-
- while (BlockLevel > 0)
- Stream.ExitBlock();
-
- Stream.FlushToWord();
-}
-
-void Serializer::EmitRecord() {
- assert(Record.size() > 0 && "Cannot emit empty record.");
- Stream.EmitRecord(8,Record);
- Record.clear();
-}
-
-void Serializer::EnterBlock(unsigned BlockID,unsigned CodeLen) {
- FlushRecord();
- Stream.EnterSubblock(BlockID,CodeLen);
- ++BlockLevel;
-}
-
-void Serializer::ExitBlock() {
- assert (BlockLevel > 0);
- --BlockLevel;
- FlushRecord();
- Stream.ExitBlock();
-}
-
-void Serializer::EmitInt(uint64_t X) {
- assert (BlockLevel > 0);
- Record.push_back(X);
-}
-
-void Serializer::EmitSInt(int64_t X) {
- if (X >= 0)
- EmitInt(X << 1);
- else
- EmitInt((-X << 1) | 1);
-}
-
-void Serializer::EmitCStr(const char* s, const char* end) {
- Record.push_back(end - s);
-
- while(s != end) {
- Record.push_back(*s);
- ++s;
- }
-}
-
-void Serializer::EmitCStr(const char* s) {
- EmitCStr(s,s+strlen(s));
-}
-
-SerializedPtrID Serializer::getPtrId(const void* ptr) {
- if (!ptr)
- return 0;
-
- MapTy::iterator I = PtrMap.find(ptr);
-
- if (I == PtrMap.end()) {
- unsigned id = PtrMap.size()+1;
-#ifdef DEBUG_BACKPATCH
- llvm::cerr << "Registered PTR: " << ptr << " => " << id << "\n";
-#endif
- PtrMap[ptr] = id;
- return id;
- }
- else return I->second;
-}
-
-bool Serializer::isRegistered(const void* ptr) const {
- MapTy::const_iterator I = PtrMap.find(ptr);
- return I != PtrMap.end();
-}
-
-
-#define INT_EMIT(TYPE)\
-void SerializeTrait<TYPE>::Emit(Serializer&S, TYPE X) { S.EmitInt(X); }
-
-INT_EMIT(bool)
-INT_EMIT(unsigned char)
-INT_EMIT(unsigned short)
-INT_EMIT(unsigned int)
-INT_EMIT(unsigned long)
-
-#define SINT_EMIT(TYPE)\
-void SerializeTrait<TYPE>::Emit(Serializer&S, TYPE X) { S.EmitSInt(X); }
-
-SINT_EMIT(signed char)
-SINT_EMIT(signed short)
-SINT_EMIT(signed int)
-SINT_EMIT(signed long)
diff --git a/release_23/lib/Bitcode/Writer/SerializeAPFloat.cpp b/release_23/lib/Bitcode/Writer/SerializeAPFloat.cpp
deleted file mode 100644
index 0e644522b10e..000000000000
--- a/release_23/lib/Bitcode/Writer/SerializeAPFloat.cpp
+++ /dev/null
@@ -1,21 +0,0 @@
-//===-- SerializeAPInt.cpp - Serialization for APFloat ---------*- C++ -*--===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements serialization of APFloat.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/ADT/APFloat.h"
-#include "llvm/Bitcode/Serialize.h"
-
-using namespace llvm;
-
-void APFloat::Emit(Serializer& S) const {
- S.Emit(convertToAPInt());
-}
diff --git a/release_23/lib/Bitcode/Writer/SerializeAPInt.cpp b/release_23/lib/Bitcode/Writer/SerializeAPInt.cpp
deleted file mode 100644
index 47792c7d0894..000000000000
--- a/release_23/lib/Bitcode/Writer/SerializeAPInt.cpp
+++ /dev/null
@@ -1,31 +0,0 @@
-//===-- SerializeAPInt.cpp - Serialization for APInts ----------*- C++ -*--===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements serialization of APInts.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/ADT/APInt.h"
-#include "llvm/Bitcode/Serialize.h"
-#include <cassert>
-
-using namespace llvm;
-
-void APInt::Emit(Serializer& S) const {
- S.EmitInt(BitWidth);
-
- if (isSingleWord())
- S.EmitInt(VAL);
- else {
- uint32_t NumWords = getNumWords();
- S.EmitInt(NumWords);
- for (unsigned i = 0; i < NumWords; ++i)
- S.EmitInt(pVal[i]);
- }
-}
diff --git a/release_23/lib/Bitcode/Writer/ValueEnumerator.cpp b/release_23/lib/Bitcode/Writer/ValueEnumerator.cpp
deleted file mode 100644
index 09a1db3d6288..000000000000
--- a/release_23/lib/Bitcode/Writer/ValueEnumerator.cpp
+++ /dev/null
@@ -1,327 +0,0 @@
-//===-- ValueEnumerator.cpp - Number values and types for bitcode writer --===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the ValueEnumerator class.
-//
-//===----------------------------------------------------------------------===//
-
-#include "ValueEnumerator.h"
-#include "llvm/Constants.h"
-#include "llvm/DerivedTypes.h"
-#include "llvm/Module.h"
-#include "llvm/TypeSymbolTable.h"
-#include "llvm/ValueSymbolTable.h"
-#include "llvm/Instructions.h"
-#include <algorithm>
-using namespace llvm;
-
-static bool isFirstClassType(const std::pair<const llvm::Type*,
- unsigned int> &P) {
- return P.first->isFirstClassType();
-}
-
-static bool isIntegerValue(const std::pair<const Value*, unsigned> &V) {
- return isa<IntegerType>(V.first->getType());
-}
-
-static bool CompareByFrequency(const std::pair<const llvm::Type*,
- unsigned int> &P1,
- const std::pair<const llvm::Type*,
- unsigned int> &P2) {
- return P1.second > P2.second;
-}
-
-/// ValueEnumerator - Enumerate module-level information.
-ValueEnumerator::ValueEnumerator(const Module *M) {
- // Enumerate the global variables.
- for (Module::const_global_iterator I = M->global_begin(),
- E = M->global_end(); I != E; ++I)
- EnumerateValue(I);
-
- // Enumerate the functions.
- for (Module::const_iterator I = M->begin(), E = M->end(); I != E; ++I) {
- EnumerateValue(I);
- EnumerateParamAttrs(cast<Function>(I)->getParamAttrs());
- }
-
- // Enumerate the aliases.
- for (Module::const_alias_iterator I = M->alias_begin(), E = M->alias_end();
- I != E; ++I)
- EnumerateValue(I);
-
- // Remember what is the cutoff between globalvalue's and other constants.
- unsigned FirstConstant = Values.size();
-
- // Enumerate the global variable initializers.
- for (Module::const_global_iterator I = M->global_begin(),
- E = M->global_end(); I != E; ++I)
- if (I->hasInitializer())
- EnumerateValue(I->getInitializer());
-
- // Enumerate the aliasees.
- for (Module::const_alias_iterator I = M->alias_begin(), E = M->alias_end();
- I != E; ++I)
- EnumerateValue(I->getAliasee());
-
- // Enumerate types used by the type symbol table.
- EnumerateTypeSymbolTable(M->getTypeSymbolTable());
-
- // Insert constants that are named at module level into the slot pool so that
- // the module symbol table can refer to them...
- EnumerateValueSymbolTable(M->getValueSymbolTable());
-
- // Enumerate types used by function bodies and argument lists.
- for (Module::const_iterator F = M->begin(), E = M->end(); F != E; ++F) {
-
- for (Function::const_arg_iterator I = F->arg_begin(), E = F->arg_end();
- I != E; ++I)
- EnumerateType(I->getType());
-
- for (Function::const_iterator BB = F->begin(), E = F->end(); BB != E; ++BB)
- for (BasicBlock::const_iterator I = BB->begin(), E = BB->end(); I!=E;++I){
- for (User::const_op_iterator OI = I->op_begin(), E = I->op_end();
- OI != E; ++OI)
- EnumerateOperandType(*OI);
- EnumerateType(I->getType());
- if (const CallInst *CI = dyn_cast<CallInst>(I))
- EnumerateParamAttrs(CI->getParamAttrs());
- else if (const InvokeInst *II = dyn_cast<InvokeInst>(I))
- EnumerateParamAttrs(II->getParamAttrs());
- }
- }
-
- // Optimize constant ordering.
- OptimizeConstants(FirstConstant, Values.size());
-
- // Sort the type table by frequency so that most commonly used types are early
- // in the table (have low bit-width).
- std::stable_sort(Types.begin(), Types.end(), CompareByFrequency);
-
- // Partition the Type ID's so that the first-class types occur before the
- // aggregate types. This allows the aggregate types to be dropped from the
- // type table after parsing the global variable initializers.
- std::partition(Types.begin(), Types.end(), isFirstClassType);
-
- // Now that we rearranged the type table, rebuild TypeMap.
- for (unsigned i = 0, e = Types.size(); i != e; ++i)
- TypeMap[Types[i].first] = i+1;
-}
-
-// Optimize constant ordering.
-struct CstSortPredicate {
- ValueEnumerator &VE;
- CstSortPredicate(ValueEnumerator &ve) : VE(ve) {}
- bool operator()(const std::pair<const Value*, unsigned> &LHS,
- const std::pair<const Value*, unsigned> &RHS) {
- // Sort by plane.
- if (LHS.first->getType() != RHS.first->getType())
- return VE.getTypeID(LHS.first->getType()) <
- VE.getTypeID(RHS.first->getType());
- // Then by frequency.
- return LHS.second > RHS.second;
- }
-};
-
-/// OptimizeConstants - Reorder constant pool for denser encoding.
-void ValueEnumerator::OptimizeConstants(unsigned CstStart, unsigned CstEnd) {
- if (CstStart == CstEnd || CstStart+1 == CstEnd) return;
-
- CstSortPredicate P(*this);
- std::stable_sort(Values.begin()+CstStart, Values.begin()+CstEnd, P);
-
- // Ensure that integer constants are at the start of the constant pool. This
- // is important so that GEP structure indices come before gep constant exprs.
- std::partition(Values.begin()+CstStart, Values.begin()+CstEnd,
- isIntegerValue);
-
- // Rebuild the modified portion of ValueMap.
- for (; CstStart != CstEnd; ++CstStart)
- ValueMap[Values[CstStart].first] = CstStart+1;
-}
-
-
-/// EnumerateTypeSymbolTable - Insert all of the types in the specified symbol
-/// table.
-void ValueEnumerator::EnumerateTypeSymbolTable(const TypeSymbolTable &TST) {
- for (TypeSymbolTable::const_iterator TI = TST.begin(), TE = TST.end();
- TI != TE; ++TI)
- EnumerateType(TI->second);
-}
-
-/// EnumerateValueSymbolTable - Insert all of the values in the specified symbol
-/// table into the values table.
-void ValueEnumerator::EnumerateValueSymbolTable(const ValueSymbolTable &VST) {
- for (ValueSymbolTable::const_iterator VI = VST.begin(), VE = VST.end();
- VI != VE; ++VI)
- EnumerateValue(VI->getValue());
-}
-
-void ValueEnumerator::EnumerateValue(const Value *V) {
- assert(V->getType() != Type::VoidTy && "Can't insert void values!");
-
- // Check to see if it's already in!
- unsigned &ValueID = ValueMap[V];
- if (ValueID) {
- // Increment use count.
- Values[ValueID-1].second++;
- return;
- }
-
- // Enumerate the type of this value.
- EnumerateType(V->getType());
-
- if (const Constant *C = dyn_cast<Constant>(V)) {
- if (isa<GlobalValue>(C)) {
- // Initializers for globals are handled explicitly elsewhere.
- } else if (isa<ConstantArray>(C) && cast<ConstantArray>(C)->isString()) {
- // Do not enumerate the initializers for an array of simple characters.
- // The initializers just polute the value table, and we emit the strings
- // specially.
- } else if (C->getNumOperands()) {
- // If a constant has operands, enumerate them. This makes sure that if a
- // constant has uses (for example an array of const ints), that they are
- // inserted also.
-
- // We prefer to enumerate them with values before we enumerate the user
- // itself. This makes it more likely that we can avoid forward references
- // in the reader. We know that there can be no cycles in the constants
- // graph that don't go through a global variable.
- for (User::const_op_iterator I = C->op_begin(), E = C->op_end();
- I != E; ++I)
- EnumerateValue(*I);
-
- // Finally, add the value. Doing this could make the ValueID reference be
- // dangling, don't reuse it.
- Values.push_back(std::make_pair(V, 1U));
- ValueMap[V] = Values.size();
- return;
- }
- }
-
- // Add the value.
- Values.push_back(std::make_pair(V, 1U));
- ValueID = Values.size();
-}
-
-
-void ValueEnumerator::EnumerateType(const Type *Ty) {
- unsigned &TypeID = TypeMap[Ty];
-
- if (TypeID) {
- // If we've already seen this type, just increase its occurrence count.
- Types[TypeID-1].second++;
- return;
- }
-
- // First time we saw this type, add it.
- Types.push_back(std::make_pair(Ty, 1U));
- TypeID = Types.size();
-
- // Enumerate subtypes.
- for (Type::subtype_iterator I = Ty->subtype_begin(), E = Ty->subtype_end();
- I != E; ++I)
- EnumerateType(*I);
-}
-
-// Enumerate the types for the specified value. If the value is a constant,
-// walk through it, enumerating the types of the constant.
-void ValueEnumerator::EnumerateOperandType(const Value *V) {
- EnumerateType(V->getType());
- if (const Constant *C = dyn_cast<Constant>(V)) {
- // If this constant is already enumerated, ignore it, we know its type must
- // be enumerated.
- if (ValueMap.count(V)) return;
-
- // This constant may have operands, make sure to enumerate the types in
- // them.
- for (unsigned i = 0, e = C->getNumOperands(); i != e; ++i)
- EnumerateOperandType(C->getOperand(i));
- }
-}
-
-void ValueEnumerator::EnumerateParamAttrs(const PAListPtr &PAL) {
- if (PAL.isEmpty()) return; // null is always 0.
- // Do a lookup.
- unsigned &Entry = ParamAttrMap[PAL.getRawPointer()];
- if (Entry == 0) {
- // Never saw this before, add it.
- ParamAttrs.push_back(PAL);
- Entry = ParamAttrs.size();
- }
-}
-
-
-/// PurgeAggregateValues - If there are any aggregate values at the end of the
-/// value list, remove them and return the count of the remaining values. If
-/// there are none, return -1.
-int ValueEnumerator::PurgeAggregateValues() {
- // If there are no aggregate values at the end of the list, return -1.
- if (Values.empty() || Values.back().first->getType()->isFirstClassType())
- return -1;
-
- // Otherwise, remove aggregate values...
- while (!Values.empty() && !Values.back().first->getType()->isFirstClassType())
- Values.pop_back();
-
- // ... and return the new size.
- return Values.size();
-}
-
-void ValueEnumerator::incorporateFunction(const Function &F) {
- NumModuleValues = Values.size();
-
- // Adding function arguments to the value table.
- for(Function::const_arg_iterator I = F.arg_begin(), E = F.arg_end();
- I != E; ++I)
- EnumerateValue(I);
-
- FirstFuncConstantID = Values.size();
-
- // Add all function-level constants to the value table.
- for (Function::const_iterator BB = F.begin(), E = F.end(); BB != E; ++BB) {
- for (BasicBlock::const_iterator I = BB->begin(), E = BB->end(); I!=E; ++I)
- for (User::const_op_iterator OI = I->op_begin(), E = I->op_end();
- OI != E; ++OI) {
- if ((isa<Constant>(*OI) && !isa<GlobalValue>(*OI)) ||
- isa<InlineAsm>(*OI))
- EnumerateValue(*OI);
- }
- BasicBlocks.push_back(BB);
- ValueMap[BB] = BasicBlocks.size();
- }
-
- // Optimize the constant layout.
- OptimizeConstants(FirstFuncConstantID, Values.size());
-
- // Add the function's parameter attributes so they are available for use in
- // the function's instruction.
- EnumerateParamAttrs(F.getParamAttrs());
-
- FirstInstID = Values.size();
-
- // Add all of the instructions.
- for (Function::const_iterator BB = F.begin(), E = F.end(); BB != E; ++BB) {
- for (BasicBlock::const_iterator I = BB->begin(), E = BB->end(); I!=E; ++I) {
- if (I->getType() != Type::VoidTy)
- EnumerateValue(I);
- }
- }
-}
-
-void ValueEnumerator::purgeFunction() {
- /// Remove purged values from the ValueMap.
- for (unsigned i = NumModuleValues, e = Values.size(); i != e; ++i)
- ValueMap.erase(Values[i].first);
- for (unsigned i = 0, e = BasicBlocks.size(); i != e; ++i)
- ValueMap.erase(BasicBlocks[i]);
-
- Values.resize(NumModuleValues);
- BasicBlocks.clear();
-}
-
diff --git a/release_23/lib/Bitcode/Writer/ValueEnumerator.h b/release_23/lib/Bitcode/Writer/ValueEnumerator.h
deleted file mode 100644
index dc40d016dcaa..000000000000
--- a/release_23/lib/Bitcode/Writer/ValueEnumerator.h
+++ /dev/null
@@ -1,127 +0,0 @@
-//===-- Bitcode/Writer/ValueEnumerator.h - Number values --------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This class gives values and types Unique ID's.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef VALUE_ENUMERATOR_H
-#define VALUE_ENUMERATOR_H
-
-#include "llvm/ADT/DenseMap.h"
-#include "llvm/ParameterAttributes.h"
-#include <vector>
-
-namespace llvm {
-
-class Type;
-class Value;
-class BasicBlock;
-class Function;
-class Module;
-class PAListPtr;
-class TypeSymbolTable;
-class ValueSymbolTable;
-
-class ValueEnumerator {
-public:
- // For each type, we remember its Type* and occurrence frequency.
- typedef std::vector<std::pair<const Type*, unsigned> > TypeList;
-
- // For each value, we remember its Value* and occurrence frequency.
- typedef std::vector<std::pair<const Value*, unsigned> > ValueList;
-private:
- typedef DenseMap<const Type*, unsigned> TypeMapType;
- TypeMapType TypeMap;
- TypeList Types;
-
- typedef DenseMap<const Value*, unsigned> ValueMapType;
- ValueMapType ValueMap;
- ValueList Values;
-
- typedef DenseMap<void*, unsigned> ParamAttrMapType;
- ParamAttrMapType ParamAttrMap;
- std::vector<PAListPtr> ParamAttrs;
-
- /// BasicBlocks - This contains all the basic blocks for the currently
- /// incorporated function. Their reverse mapping is stored in ValueMap.
- std::vector<const BasicBlock*> BasicBlocks;
-
- /// When a function is incorporated, this is the size of the Values list
- /// before incorporation.
- unsigned NumModuleValues;
- unsigned FirstFuncConstantID;
- unsigned FirstInstID;
-
- ValueEnumerator(const ValueEnumerator &); // DO NOT IMPLEMENT
- void operator=(const ValueEnumerator &); // DO NOT IMPLEMENT
-public:
- ValueEnumerator(const Module *M);
-
- unsigned getValueID(const Value *V) const {
- ValueMapType::const_iterator I = ValueMap.find(V);
- assert(I != ValueMap.end() && "Value not in slotcalculator!");
- return I->second-1;
- }
-
- unsigned getTypeID(const Type *T) const {
- TypeMapType::const_iterator I = TypeMap.find(T);
- assert(I != TypeMap.end() && "Type not in ValueEnumerator!");
- return I->second-1;
- }
-
- unsigned getParamAttrID(const PAListPtr &PAL) const {
- if (PAL.isEmpty()) return 0; // Null maps to zero.
- ParamAttrMapType::const_iterator I = ParamAttrMap.find(PAL.getRawPointer());
- assert(I != ParamAttrMap.end() && "ParamAttr not in ValueEnumerator!");
- return I->second;
- }
-
- /// getFunctionConstantRange - Return the range of values that corresponds to
- /// function-local constants.
- void getFunctionConstantRange(unsigned &Start, unsigned &End) const {
- Start = FirstFuncConstantID;
- End = FirstInstID;
- }
-
- const ValueList &getValues() const { return Values; }
- const TypeList &getTypes() const { return Types; }
- const std::vector<const BasicBlock*> &getBasicBlocks() const {
- return BasicBlocks;
- }
- const std::vector<PAListPtr> &getParamAttrs() const {
- return ParamAttrs;
- }
-
- /// PurgeAggregateValues - If there are any aggregate values at the end of the
- /// value list, remove them and return the count of the remaining values. If
- /// there are none, return -1.
- int PurgeAggregateValues();
-
- /// incorporateFunction/purgeFunction - If you'd like to deal with a function,
- /// use these two methods to get its data into the ValueEnumerator!
- ///
- void incorporateFunction(const Function &F);
- void purgeFunction();
-
-private:
- void OptimizeConstants(unsigned CstStart, unsigned CstEnd);
-
- void EnumerateValue(const Value *V);
- void EnumerateType(const Type *T);
- void EnumerateOperandType(const Value *V);
- void EnumerateParamAttrs(const PAListPtr &PAL);
-
- void EnumerateTypeSymbolTable(const TypeSymbolTable &ST);
- void EnumerateValueSymbolTable(const ValueSymbolTable &ST);
-};
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/lib/CodeGen/AsmPrinter.cpp b/release_23/lib/CodeGen/AsmPrinter.cpp
deleted file mode 100644
index 9c4e789251a6..000000000000
--- a/release_23/lib/CodeGen/AsmPrinter.cpp
+++ /dev/null
@@ -1,1437 +0,0 @@
-//===-- AsmPrinter.cpp - Common AsmPrinter code ---------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the AsmPrinter class.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/CodeGen/AsmPrinter.h"
-#include "llvm/Assembly/Writer.h"
-#include "llvm/DerivedTypes.h"
-#include "llvm/Constants.h"
-#include "llvm/Module.h"
-#include "llvm/CodeGen/Collector.h"
-#include "llvm/CodeGen/CollectorMetadata.h"
-#include "llvm/CodeGen/MachineConstantPool.h"
-#include "llvm/CodeGen/MachineJumpTableInfo.h"
-#include "llvm/CodeGen/MachineModuleInfo.h"
-#include "llvm/Support/CommandLine.h"
-#include "llvm/Support/Mangler.h"
-#include "llvm/Support/MathExtras.h"
-#include "llvm/Support/Streams.h"
-#include "llvm/Target/TargetAsmInfo.h"
-#include "llvm/Target/TargetData.h"
-#include "llvm/Target/TargetLowering.h"
-#include "llvm/Target/TargetMachine.h"
-#include "llvm/Target/TargetRegisterInfo.h"
-#include "llvm/ADT/SmallPtrSet.h"
-#include <cerrno>
-using namespace llvm;
-
-static cl::opt<bool>
-AsmVerbose("asm-verbose", cl::Hidden, cl::desc("Add comments to directives."));
-
-char AsmPrinter::ID = 0;
-AsmPrinter::AsmPrinter(std::ostream &o, TargetMachine &tm,
- const TargetAsmInfo *T)
- : MachineFunctionPass((intptr_t)&ID), FunctionNumber(0), O(o),
- TM(tm), TAI(T), TRI(tm.getRegisterInfo()),
- IsInTextSection(false)
-{}
-
-std::string AsmPrinter::getSectionForFunction(const Function &F) const {
- return TAI->getTextSection();
-}
-
-
-/// SwitchToTextSection - Switch to the specified text section of the executable
-/// if we are not already in it!
-///
-void AsmPrinter::SwitchToTextSection(const char *NewSection,
- const GlobalValue *GV) {
- std::string NS;
- if (GV && GV->hasSection())
- NS = TAI->getSwitchToSectionDirective() + GV->getSection();
- else
- NS = NewSection;
-
- // If we're already in this section, we're done.
- if (CurrentSection == NS) return;
-
- // Close the current section, if applicable.
- if (TAI->getSectionEndDirectiveSuffix() && !CurrentSection.empty())
- O << CurrentSection << TAI->getSectionEndDirectiveSuffix() << "\n";
-
- CurrentSection = NS;
-
- if (!CurrentSection.empty())
- O << CurrentSection << TAI->getTextSectionStartSuffix() << '\n';
-
- IsInTextSection = true;
-}
-
-/// SwitchToDataSection - Switch to the specified data section of the executable
-/// if we are not already in it!
-///
-void AsmPrinter::SwitchToDataSection(const char *NewSection,
- const GlobalValue *GV) {
- std::string NS;
- if (GV && GV->hasSection())
- NS = TAI->getSwitchToSectionDirective() + GV->getSection();
- else
- NS = NewSection;
-
- // If we're already in this section, we're done.
- if (CurrentSection == NS) return;
-
- // Close the current section, if applicable.
- if (TAI->getSectionEndDirectiveSuffix() && !CurrentSection.empty())
- O << CurrentSection << TAI->getSectionEndDirectiveSuffix() << "\n";
-
- CurrentSection = NS;
-
- if (!CurrentSection.empty())
- O << CurrentSection << TAI->getDataSectionStartSuffix() << '\n';
-
- IsInTextSection = false;
-}
-
-
-void AsmPrinter::getAnalysisUsage(AnalysisUsage &AU) const {
- MachineFunctionPass::getAnalysisUsage(AU);
- AU.addRequired<CollectorModuleMetadata>();
-}
-
-bool AsmPrinter::doInitialization(Module &M) {
- Mang = new Mangler(M, TAI->getGlobalPrefix());
-
- CollectorModuleMetadata *CMM = getAnalysisToUpdate<CollectorModuleMetadata>();
- assert(CMM && "AsmPrinter didn't require CollectorModuleMetadata?");
- for (CollectorModuleMetadata::iterator I = CMM->begin(),
- E = CMM->end(); I != E; ++I)
- (*I)->beginAssembly(O, *this, *TAI);
-
- if (!M.getModuleInlineAsm().empty())
- O << TAI->getCommentString() << " Start of file scope inline assembly\n"
- << M.getModuleInlineAsm()
- << "\n" << TAI->getCommentString()
- << " End of file scope inline assembly\n";
-
- SwitchToDataSection(""); // Reset back to no section.
-
- MMI = getAnalysisToUpdate<MachineModuleInfo>();
- if (MMI) MMI->AnalyzeModule(M);
-
- return false;
-}
-
-bool AsmPrinter::doFinalization(Module &M) {
- if (TAI->getWeakRefDirective()) {
- if (!ExtWeakSymbols.empty())
- SwitchToDataSection("");
-
- for (std::set<const GlobalValue*>::iterator i = ExtWeakSymbols.begin(),
- e = ExtWeakSymbols.end(); i != e; ++i) {
- const GlobalValue *GV = *i;
- std::string Name = Mang->getValueName(GV);
- O << TAI->getWeakRefDirective() << Name << "\n";
- }
- }
-
- if (TAI->getSetDirective()) {
- if (!M.alias_empty())
- SwitchToTextSection(TAI->getTextSection());
-
- O << "\n";
- for (Module::const_alias_iterator I = M.alias_begin(), E = M.alias_end();
- I!=E; ++I) {
- std::string Name = Mang->getValueName(I);
- std::string Target;
-
- const GlobalValue *GV = cast<GlobalValue>(I->getAliasedGlobal());
- Target = Mang->getValueName(GV);
-
- if (I->hasExternalLinkage() || !TAI->getWeakRefDirective())
- O << "\t.globl\t" << Name << "\n";
- else if (I->hasWeakLinkage())
- O << TAI->getWeakRefDirective() << Name << "\n";
- else if (!I->hasInternalLinkage())
- assert(0 && "Invalid alias linkage");
-
- if (I->hasHiddenVisibility()) {
- if (const char *Directive = TAI->getHiddenDirective())
- O << Directive << Name << "\n";
- } else if (I->hasProtectedVisibility()) {
- if (const char *Directive = TAI->getProtectedDirective())
- O << Directive << Name << "\n";
- }
-
- O << TAI->getSetDirective() << ' ' << Name << ", " << Target << "\n";
-
- // If the aliasee has external weak linkage it can be referenced only by
- // alias itself. In this case it can be not in ExtWeakSymbols list. Emit
- // weak reference in such case.
- if (GV->hasExternalWeakLinkage()) {
- if (TAI->getWeakRefDirective())
- O << TAI->getWeakRefDirective() << Target << "\n";
- else
- O << "\t.globl\t" << Target << "\n";
- }
- }
- }
-
- CollectorModuleMetadata *CMM = getAnalysisToUpdate<CollectorModuleMetadata>();
- assert(CMM && "AsmPrinter didn't require CollectorModuleMetadata?");
- for (CollectorModuleMetadata::iterator I = CMM->end(),
- E = CMM->begin(); I != E; )
- (*--I)->finishAssembly(O, *this, *TAI);
-
- // If we don't have any trampolines, then we don't require stack memory
- // to be executable. Some targets have a directive to declare this.
- Function* InitTrampolineIntrinsic = M.getFunction("llvm.init.trampoline");
- if (!InitTrampolineIntrinsic || InitTrampolineIntrinsic->use_empty())
- if (TAI->getNonexecutableStackDirective())
- O << TAI->getNonexecutableStackDirective() << "\n";
-
- delete Mang; Mang = 0;
- return false;
-}
-
-std::string AsmPrinter::getCurrentFunctionEHName(const MachineFunction *MF) {
- assert(MF && "No machine function?");
- std::string Name = MF->getFunction()->getName();
- if (Name.empty())
- Name = Mang->getValueName(MF->getFunction());
- return Mang->makeNameProper(Name + ".eh", TAI->getGlobalPrefix());
-}
-
-void AsmPrinter::SetupMachineFunction(MachineFunction &MF) {
- // What's my mangled name?
- CurrentFnName = Mang->getValueName(MF.getFunction());
- IncrementFunctionNumber();
-}
-
-/// EmitConstantPool - Print to the current output stream assembly
-/// representations of the constants in the constant pool MCP. This is
-/// used to print out constants which have been "spilled to memory" by
-/// the code generator.
-///
-void AsmPrinter::EmitConstantPool(MachineConstantPool *MCP) {
- const std::vector<MachineConstantPoolEntry> &CP = MCP->getConstants();
- if (CP.empty()) return;
-
- // Some targets require 4-, 8-, and 16- byte constant literals to be placed
- // in special sections.
- std::vector<std::pair<MachineConstantPoolEntry,unsigned> > FourByteCPs;
- std::vector<std::pair<MachineConstantPoolEntry,unsigned> > EightByteCPs;
- std::vector<std::pair<MachineConstantPoolEntry,unsigned> > SixteenByteCPs;
- std::vector<std::pair<MachineConstantPoolEntry,unsigned> > OtherCPs;
- std::vector<std::pair<MachineConstantPoolEntry,unsigned> > TargetCPs;
- for (unsigned i = 0, e = CP.size(); i != e; ++i) {
- MachineConstantPoolEntry CPE = CP[i];
- const Type *Ty = CPE.getType();
- if (TAI->getFourByteConstantSection() &&
- TM.getTargetData()->getABITypeSize(Ty) == 4)
- FourByteCPs.push_back(std::make_pair(CPE, i));
- else if (TAI->getEightByteConstantSection() &&
- TM.getTargetData()->getABITypeSize(Ty) == 8)
- EightByteCPs.push_back(std::make_pair(CPE, i));
- else if (TAI->getSixteenByteConstantSection() &&
- TM.getTargetData()->getABITypeSize(Ty) == 16)
- SixteenByteCPs.push_back(std::make_pair(CPE, i));
- else
- OtherCPs.push_back(std::make_pair(CPE, i));
- }
-
- unsigned Alignment = MCP->getConstantPoolAlignment();
- EmitConstantPool(Alignment, TAI->getFourByteConstantSection(), FourByteCPs);
- EmitConstantPool(Alignment, TAI->getEightByteConstantSection(), EightByteCPs);
- EmitConstantPool(Alignment, TAI->getSixteenByteConstantSection(),
- SixteenByteCPs);
- EmitConstantPool(Alignment, TAI->getConstantPoolSection(), OtherCPs);
-}
-
-void AsmPrinter::EmitConstantPool(unsigned Alignment, const char *Section,
- std::vector<std::pair<MachineConstantPoolEntry,unsigned> > &CP) {
- if (CP.empty()) return;
-
- SwitchToDataSection(Section);
- EmitAlignment(Alignment);
- for (unsigned i = 0, e = CP.size(); i != e; ++i) {
- O << TAI->getPrivateGlobalPrefix() << "CPI" << getFunctionNumber() << '_'
- << CP[i].second << ":\t\t\t\t\t" << TAI->getCommentString() << " ";
- WriteTypeSymbolic(O, CP[i].first.getType(), 0) << '\n';
- if (CP[i].first.isMachineConstantPoolEntry())
- EmitMachineConstantPoolValue(CP[i].first.Val.MachineCPVal);
- else
- EmitGlobalConstant(CP[i].first.Val.ConstVal);
- if (i != e-1) {
- const Type *Ty = CP[i].first.getType();
- unsigned EntSize =
- TM.getTargetData()->getABITypeSize(Ty);
- unsigned ValEnd = CP[i].first.getOffset() + EntSize;
- // Emit inter-object padding for alignment.
- EmitZeros(CP[i+1].first.getOffset()-ValEnd);
- }
- }
-}
-
-/// EmitJumpTableInfo - Print assembly representations of the jump tables used
-/// by the current function to the current output stream.
-///
-void AsmPrinter::EmitJumpTableInfo(MachineJumpTableInfo *MJTI,
- MachineFunction &MF) {
- const std::vector<MachineJumpTableEntry> &JT = MJTI->getJumpTables();
- if (JT.empty()) return;
-
- bool IsPic = TM.getRelocationModel() == Reloc::PIC_;
-
- // Pick the directive to use to print the jump table entries, and switch to
- // the appropriate section.
- TargetLowering *LoweringInfo = TM.getTargetLowering();
-
- const char* JumpTableDataSection = TAI->getJumpTableDataSection();
- if ((IsPic && !(LoweringInfo && LoweringInfo->usesGlobalOffsetTable())) ||
- !JumpTableDataSection) {
- // In PIC mode, we need to emit the jump table to the same section as the
- // function body itself, otherwise the label differences won't make sense.
- // We should also do if the section name is NULL.
- const Function *F = MF.getFunction();
- SwitchToTextSection(getSectionForFunction(*F).c_str(), F);
- } else {
- SwitchToDataSection(JumpTableDataSection);
- }
-
- EmitAlignment(Log2_32(MJTI->getAlignment()));
-
- for (unsigned i = 0, e = JT.size(); i != e; ++i) {
- const std::vector<MachineBasicBlock*> &JTBBs = JT[i].MBBs;
-
- // If this jump table was deleted, ignore it.
- if (JTBBs.empty()) continue;
-
- // For PIC codegen, if possible we want to use the SetDirective to reduce
- // the number of relocations the assembler will generate for the jump table.
- // Set directives are all printed before the jump table itself.
- SmallPtrSet<MachineBasicBlock*, 16> EmittedSets;
- if (TAI->getSetDirective() && IsPic)
- for (unsigned ii = 0, ee = JTBBs.size(); ii != ee; ++ii)
- if (EmittedSets.insert(JTBBs[ii]))
- printPICJumpTableSetLabel(i, JTBBs[ii]);
-
- // On some targets (e.g. darwin) we want to emit two consequtive labels
- // before each jump table. The first label is never referenced, but tells
- // the assembler and linker the extents of the jump table object. The
- // second label is actually referenced by the code.
- if (const char *JTLabelPrefix = TAI->getJumpTableSpecialLabelPrefix())
- O << JTLabelPrefix << "JTI" << getFunctionNumber() << '_' << i << ":\n";
-
- O << TAI->getPrivateGlobalPrefix() << "JTI" << getFunctionNumber()
- << '_' << i << ":\n";
-
- for (unsigned ii = 0, ee = JTBBs.size(); ii != ee; ++ii) {
- printPICJumpTableEntry(MJTI, JTBBs[ii], i);
- O << '\n';
- }
- }
-}
-
-void AsmPrinter::printPICJumpTableEntry(const MachineJumpTableInfo *MJTI,
- const MachineBasicBlock *MBB,
- unsigned uid) const {
- bool IsPic = TM.getRelocationModel() == Reloc::PIC_;
-
- // Use JumpTableDirective otherwise honor the entry size from the jump table
- // info.
- const char *JTEntryDirective = TAI->getJumpTableDirective();
- bool HadJTEntryDirective = JTEntryDirective != NULL;
- if (!HadJTEntryDirective) {
- JTEntryDirective = MJTI->getEntrySize() == 4 ?
- TAI->getData32bitsDirective() : TAI->getData64bitsDirective();
- }
-
- O << JTEntryDirective << ' ';
-
- // If we have emitted set directives for the jump table entries, print
- // them rather than the entries themselves. If we're emitting PIC, then
- // emit the table entries as differences between two text section labels.
- // If we're emitting non-PIC code, then emit the entries as direct
- // references to the target basic blocks.
- if (IsPic) {
- if (TAI->getSetDirective()) {
- O << TAI->getPrivateGlobalPrefix() << getFunctionNumber()
- << '_' << uid << "_set_" << MBB->getNumber();
- } else {
- printBasicBlockLabel(MBB, false, false, false);
- // If the arch uses custom Jump Table directives, don't calc relative to
- // JT
- if (!HadJTEntryDirective)
- O << '-' << TAI->getPrivateGlobalPrefix() << "JTI"
- << getFunctionNumber() << '_' << uid;
- }
- } else {
- printBasicBlockLabel(MBB, false, false, false);
- }
-}
-
-
-/// EmitSpecialLLVMGlobal - Check to see if the specified global is a
-/// special global used by LLVM. If so, emit it and return true, otherwise
-/// do nothing and return false.
-bool AsmPrinter::EmitSpecialLLVMGlobal(const GlobalVariable *GV) {
- if (GV->getName() == "llvm.used") {
- if (TAI->getUsedDirective() != 0) // No need to emit this at all.
- EmitLLVMUsedList(GV->getInitializer());
- return true;
- }
-
- // Ignore debug and non-emitted data.
- if (GV->getSection() == "llvm.metadata") return true;
-
- if (!GV->hasAppendingLinkage()) return false;
-
- assert(GV->hasInitializer() && "Not a special LLVM global!");
-
- const TargetData *TD = TM.getTargetData();
- unsigned Align = Log2_32(TD->getPointerPrefAlignment());
- if (GV->getName() == "llvm.global_ctors" && GV->use_empty()) {
- SwitchToDataSection(TAI->getStaticCtorsSection());
- EmitAlignment(Align, 0);
- EmitXXStructorList(GV->getInitializer());
- return true;
- }
-
- if (GV->getName() == "llvm.global_dtors" && GV->use_empty()) {
- SwitchToDataSection(TAI->getStaticDtorsSection());
- EmitAlignment(Align, 0);
- EmitXXStructorList(GV->getInitializer());
- return true;
- }
-
- return false;
-}
-
-/// EmitLLVMUsedList - For targets that define a TAI::UsedDirective, mark each
-/// global in the specified llvm.used list as being used with this directive.
-void AsmPrinter::EmitLLVMUsedList(Constant *List) {
- const char *Directive = TAI->getUsedDirective();
-
- // Should be an array of 'sbyte*'.
- ConstantArray *InitList = dyn_cast<ConstantArray>(List);
- if (InitList == 0) return;
-
- for (unsigned i = 0, e = InitList->getNumOperands(); i != e; ++i) {
- O << Directive;
- EmitConstantValueOnly(InitList->getOperand(i));
- O << "\n";
- }
-}
-
-/// EmitXXStructorList - Emit the ctor or dtor list. This just prints out the
-/// function pointers, ignoring the init priority.
-void AsmPrinter::EmitXXStructorList(Constant *List) {
- // Should be an array of '{ int, void ()* }' structs. The first value is the
- // init priority, which we ignore.
- if (!isa<ConstantArray>(List)) return;
- ConstantArray *InitList = cast<ConstantArray>(List);
- for (unsigned i = 0, e = InitList->getNumOperands(); i != e; ++i)
- if (ConstantStruct *CS = dyn_cast<ConstantStruct>(InitList->getOperand(i))){
- if (CS->getNumOperands() != 2) return; // Not array of 2-element structs.
-
- if (CS->getOperand(1)->isNullValue())
- return; // Found a null terminator, exit printing.
- // Emit the function pointer.
- EmitGlobalConstant(CS->getOperand(1));
- }
-}
-
-/// getGlobalLinkName - Returns the asm/link name of of the specified
-/// global variable. Should be overridden by each target asm printer to
-/// generate the appropriate value.
-const std::string AsmPrinter::getGlobalLinkName(const GlobalVariable *GV) const{
- std::string LinkName;
-
- if (isa<Function>(GV)) {
- LinkName += TAI->getFunctionAddrPrefix();
- LinkName += Mang->getValueName(GV);
- LinkName += TAI->getFunctionAddrSuffix();
- } else {
- LinkName += TAI->getGlobalVarAddrPrefix();
- LinkName += Mang->getValueName(GV);
- LinkName += TAI->getGlobalVarAddrSuffix();
- }
-
- return LinkName;
-}
-
-/// EmitExternalGlobal - Emit the external reference to a global variable.
-/// Should be overridden if an indirect reference should be used.
-void AsmPrinter::EmitExternalGlobal(const GlobalVariable *GV) {
- O << getGlobalLinkName(GV);
-}
-
-
-
-//===----------------------------------------------------------------------===//
-/// LEB 128 number encoding.
-
-/// PrintULEB128 - Print a series of hexidecimal values (separated by commas)
-/// representing an unsigned leb128 value.
-void AsmPrinter::PrintULEB128(unsigned Value) const {
- do {
- unsigned Byte = Value & 0x7f;
- Value >>= 7;
- if (Value) Byte |= 0x80;
- O << "0x" << std::hex << Byte << std::dec;
- if (Value) O << ", ";
- } while (Value);
-}
-
-/// SizeULEB128 - Compute the number of bytes required for an unsigned leb128
-/// value.
-unsigned AsmPrinter::SizeULEB128(unsigned Value) {
- unsigned Size = 0;
- do {
- Value >>= 7;
- Size += sizeof(int8_t);
- } while (Value);
- return Size;
-}
-
-/// PrintSLEB128 - Print a series of hexidecimal values (separated by commas)
-/// representing a signed leb128 value.
-void AsmPrinter::PrintSLEB128(int Value) const {
- int Sign = Value >> (8 * sizeof(Value) - 1);
- bool IsMore;
-
- do {
- unsigned Byte = Value & 0x7f;
- Value >>= 7;
- IsMore = Value != Sign || ((Byte ^ Sign) & 0x40) != 0;
- if (IsMore) Byte |= 0x80;
- O << "0x" << std::hex << Byte << std::dec;
- if (IsMore) O << ", ";
- } while (IsMore);
-}
-
-/// SizeSLEB128 - Compute the number of bytes required for a signed leb128
-/// value.
-unsigned AsmPrinter::SizeSLEB128(int Value) {
- unsigned Size = 0;
- int Sign = Value >> (8 * sizeof(Value) - 1);
- bool IsMore;
-
- do {
- unsigned Byte = Value & 0x7f;
- Value >>= 7;
- IsMore = Value != Sign || ((Byte ^ Sign) & 0x40) != 0;
- Size += sizeof(int8_t);
- } while (IsMore);
- return Size;
-}
-
-//===--------------------------------------------------------------------===//
-// Emission and print routines
-//
-
-/// PrintHex - Print a value as a hexidecimal value.
-///
-void AsmPrinter::PrintHex(int Value) const {
- O << "0x" << std::hex << Value << std::dec;
-}
-
-/// EOL - Print a newline character to asm stream. If a comment is present
-/// then it will be printed first. Comments should not contain '\n'.
-void AsmPrinter::EOL() const {
- O << "\n";
-}
-void AsmPrinter::EOL(const std::string &Comment) const {
- if (AsmVerbose && !Comment.empty()) {
- O << "\t"
- << TAI->getCommentString()
- << " "
- << Comment;
- }
- O << "\n";
-}
-
-/// EmitULEB128Bytes - Emit an assembler byte data directive to compose an
-/// unsigned leb128 value.
-void AsmPrinter::EmitULEB128Bytes(unsigned Value) const {
- if (TAI->hasLEB128()) {
- O << "\t.uleb128\t"
- << Value;
- } else {
- O << TAI->getData8bitsDirective();
- PrintULEB128(Value);
- }
-}
-
-/// EmitSLEB128Bytes - print an assembler byte data directive to compose a
-/// signed leb128 value.
-void AsmPrinter::EmitSLEB128Bytes(int Value) const {
- if (TAI->hasLEB128()) {
- O << "\t.sleb128\t"
- << Value;
- } else {
- O << TAI->getData8bitsDirective();
- PrintSLEB128(Value);
- }
-}
-
-/// EmitInt8 - Emit a byte directive and value.
-///
-void AsmPrinter::EmitInt8(int Value) const {
- O << TAI->getData8bitsDirective();
- PrintHex(Value & 0xFF);
-}
-
-/// EmitInt16 - Emit a short directive and value.
-///
-void AsmPrinter::EmitInt16(int Value) const {
- O << TAI->getData16bitsDirective();
- PrintHex(Value & 0xFFFF);
-}
-
-/// EmitInt32 - Emit a long directive and value.
-///
-void AsmPrinter::EmitInt32(int Value) const {
- O << TAI->getData32bitsDirective();
- PrintHex(Value);
-}
-
-/// EmitInt64 - Emit a long long directive and value.
-///
-void AsmPrinter::EmitInt64(uint64_t Value) const {
- if (TAI->getData64bitsDirective()) {
- O << TAI->getData64bitsDirective();
- PrintHex(Value);
- } else {
- if (TM.getTargetData()->isBigEndian()) {
- EmitInt32(unsigned(Value >> 32)); O << "\n";
- EmitInt32(unsigned(Value));
- } else {
- EmitInt32(unsigned(Value)); O << "\n";
- EmitInt32(unsigned(Value >> 32));
- }
- }
-}
-
-/// toOctal - Convert the low order bits of X into an octal digit.
-///
-static inline char toOctal(int X) {
- return (X&7)+'0';
-}
-
-/// printStringChar - Print a char, escaped if necessary.
-///
-static void printStringChar(std::ostream &O, unsigned char C) {
- if (C == '"') {
- O << "\\\"";
- } else if (C == '\\') {
- O << "\\\\";
- } else if (isprint(C)) {
- O << C;
- } else {
- switch(C) {
- case '\b': O << "\\b"; break;
- case '\f': O << "\\f"; break;
- case '\n': O << "\\n"; break;
- case '\r': O << "\\r"; break;
- case '\t': O << "\\t"; break;
- default:
- O << '\\';
- O << toOctal(C >> 6);
- O << toOctal(C >> 3);
- O << toOctal(C >> 0);
- break;
- }
- }
-}
-
-/// EmitString - Emit a string with quotes and a null terminator.
-/// Special characters are emitted properly.
-/// \literal (Eg. '\t') \endliteral
-void AsmPrinter::EmitString(const std::string &String) const {
- const char* AscizDirective = TAI->getAscizDirective();
- if (AscizDirective)
- O << AscizDirective;
- else
- O << TAI->getAsciiDirective();
- O << "\"";
- for (unsigned i = 0, N = String.size(); i < N; ++i) {
- unsigned char C = String[i];
- printStringChar(O, C);
- }
- if (AscizDirective)
- O << "\"";
- else
- O << "\\0\"";
-}
-
-
-/// EmitFile - Emit a .file directive.
-void AsmPrinter::EmitFile(unsigned Number, const std::string &Name) const {
- O << "\t.file\t" << Number << " \"";
- for (unsigned i = 0, N = Name.size(); i < N; ++i) {
- unsigned char C = Name[i];
- printStringChar(O, C);
- }
- O << "\"";
-}
-
-
-//===----------------------------------------------------------------------===//
-
-// EmitAlignment - Emit an alignment directive to the specified power of
-// two boundary. For example, if you pass in 3 here, you will get an 8
-// byte alignment. If a global value is specified, and if that global has
-// an explicit alignment requested, it will unconditionally override the
-// alignment request. However, if ForcedAlignBits is specified, this value
-// has final say: the ultimate alignment will be the max of ForcedAlignBits
-// and the alignment computed with NumBits and the global.
-//
-// The algorithm is:
-// Align = NumBits;
-// if (GV && GV->hasalignment) Align = GV->getalignment();
-// Align = std::max(Align, ForcedAlignBits);
-//
-void AsmPrinter::EmitAlignment(unsigned NumBits, const GlobalValue *GV,
- unsigned ForcedAlignBits,
- bool UseFillExpr) const {
- if (GV && GV->getAlignment())
- NumBits = Log2_32(GV->getAlignment());
- NumBits = std::max(NumBits, ForcedAlignBits);
-
- if (NumBits == 0) return; // No need to emit alignment.
- if (TAI->getAlignmentIsInBytes()) NumBits = 1 << NumBits;
- O << TAI->getAlignDirective() << NumBits;
-
- unsigned FillValue = TAI->getTextAlignFillValue();
- UseFillExpr &= IsInTextSection && FillValue;
- if (UseFillExpr) O << ",0x" << std::hex << FillValue << std::dec;
- O << "\n";
-}
-
-
-/// EmitZeros - Emit a block of zeros.
-///
-void AsmPrinter::EmitZeros(uint64_t NumZeros) const {
- if (NumZeros) {
- if (TAI->getZeroDirective()) {
- O << TAI->getZeroDirective() << NumZeros;
- if (TAI->getZeroDirectiveSuffix())
- O << TAI->getZeroDirectiveSuffix();
- O << "\n";
- } else {
- for (; NumZeros; --NumZeros)
- O << TAI->getData8bitsDirective() << "0\n";
- }
- }
-}
-
-// Print out the specified constant, without a storage class. Only the
-// constants valid in constant expressions can occur here.
-void AsmPrinter::EmitConstantValueOnly(const Constant *CV) {
- if (CV->isNullValue() || isa<UndefValue>(CV))
- O << "0";
- else if (const ConstantInt *CI = dyn_cast<ConstantInt>(CV)) {
- O << CI->getZExtValue();
- } else if (const GlobalValue *GV = dyn_cast<GlobalValue>(CV)) {
- // This is a constant address for a global variable or function. Use the
- // name of the variable or function as the address value, possibly
- // decorating it with GlobalVarAddrPrefix/Suffix or
- // FunctionAddrPrefix/Suffix (these all default to "" )
- if (isa<Function>(GV)) {
- O << TAI->getFunctionAddrPrefix()
- << Mang->getValueName(GV)
- << TAI->getFunctionAddrSuffix();
- } else {
- O << TAI->getGlobalVarAddrPrefix()
- << Mang->getValueName(GV)
- << TAI->getGlobalVarAddrSuffix();
- }
- } else if (const ConstantExpr *CE = dyn_cast<ConstantExpr>(CV)) {
- const TargetData *TD = TM.getTargetData();
- unsigned Opcode = CE->getOpcode();
- switch (Opcode) {
- case Instruction::GetElementPtr: {
- // generate a symbolic expression for the byte address
- const Constant *ptrVal = CE->getOperand(0);
- SmallVector<Value*, 8> idxVec(CE->op_begin()+1, CE->op_end());
- if (int64_t Offset = TD->getIndexedOffset(ptrVal->getType(), &idxVec[0],
- idxVec.size())) {
- if (Offset)
- O << "(";
- EmitConstantValueOnly(ptrVal);
- if (Offset > 0)
- O << ") + " << Offset;
- else if (Offset < 0)
- O << ") - " << -Offset;
- } else {
- EmitConstantValueOnly(ptrVal);
- }
- break;
- }
- case Instruction::Trunc:
- case Instruction::ZExt:
- case Instruction::SExt:
- case Instruction::FPTrunc:
- case Instruction::FPExt:
- case Instruction::UIToFP:
- case Instruction::SIToFP:
- case Instruction::FPToUI:
- case Instruction::FPToSI:
- assert(0 && "FIXME: Don't yet support this kind of constant cast expr");
- break;
- case Instruction::BitCast:
- return EmitConstantValueOnly(CE->getOperand(0));
-
- case Instruction::IntToPtr: {
- // Handle casts to pointers by changing them into casts to the appropriate
- // integer type. This promotes constant folding and simplifies this code.
- Constant *Op = CE->getOperand(0);
- Op = ConstantExpr::getIntegerCast(Op, TD->getIntPtrType(), false/*ZExt*/);
- return EmitConstantValueOnly(Op);
- }
-
-
- case Instruction::PtrToInt: {
- // Support only foldable casts to/from pointers that can be eliminated by
- // changing the pointer to the appropriately sized integer type.
- Constant *Op = CE->getOperand(0);
- const Type *Ty = CE->getType();
-
- // We can emit the pointer value into this slot if the slot is an
- // integer slot greater or equal to the size of the pointer.
- if (Ty->isInteger() &&
- TD->getABITypeSize(Ty) >= TD->getABITypeSize(Op->getType()))
- return EmitConstantValueOnly(Op);
-
- assert(0 && "FIXME: Don't yet support this kind of constant cast expr");
- EmitConstantValueOnly(Op);
- break;
- }
- case Instruction::Add:
- case Instruction::Sub:
- case Instruction::And:
- case Instruction::Or:
- case Instruction::Xor:
- O << "(";
- EmitConstantValueOnly(CE->getOperand(0));
- O << ")";
- switch (Opcode) {
- case Instruction::Add:
- O << " + ";
- break;
- case Instruction::Sub:
- O << " - ";
- break;
- case Instruction::And:
- O << " & ";
- break;
- case Instruction::Or:
- O << " | ";
- break;
- case Instruction::Xor:
- O << " ^ ";
- break;
- default:
- break;
- }
- O << "(";
- EmitConstantValueOnly(CE->getOperand(1));
- O << ")";
- break;
- default:
- assert(0 && "Unsupported operator!");
- }
- } else {
- assert(0 && "Unknown constant value!");
- }
-}
-
-/// printAsCString - Print the specified array as a C compatible string, only if
-/// the predicate isString is true.
-///
-static void printAsCString(std::ostream &O, const ConstantArray *CVA,
- unsigned LastElt) {
- assert(CVA->isString() && "Array is not string compatible!");
-
- O << "\"";
- for (unsigned i = 0; i != LastElt; ++i) {
- unsigned char C =
- (unsigned char)cast<ConstantInt>(CVA->getOperand(i))->getZExtValue();
- printStringChar(O, C);
- }
- O << "\"";
-}
-
-/// EmitString - Emit a zero-byte-terminated string constant.
-///
-void AsmPrinter::EmitString(const ConstantArray *CVA) const {
- unsigned NumElts = CVA->getNumOperands();
- if (TAI->getAscizDirective() && NumElts &&
- cast<ConstantInt>(CVA->getOperand(NumElts-1))->getZExtValue() == 0) {
- O << TAI->getAscizDirective();
- printAsCString(O, CVA, NumElts-1);
- } else {
- O << TAI->getAsciiDirective();
- printAsCString(O, CVA, NumElts);
- }
- O << "\n";
-}
-
-/// EmitGlobalConstant - Print a general LLVM constant to the .s file.
-/// If Packed is false, pad to the ABI size.
-void AsmPrinter::EmitGlobalConstant(const Constant *CV, bool Packed) {
- const TargetData *TD = TM.getTargetData();
- unsigned Size = Packed ?
- TD->getTypeStoreSize(CV->getType()) : TD->getABITypeSize(CV->getType());
-
- if (CV->isNullValue() || isa<UndefValue>(CV)) {
- EmitZeros(Size);
- return;
- } else if (const ConstantArray *CVA = dyn_cast<ConstantArray>(CV)) {
- if (CVA->isString()) {
- EmitString(CVA);
- } else { // Not a string. Print the values in successive locations
- for (unsigned i = 0, e = CVA->getNumOperands(); i != e; ++i)
- EmitGlobalConstant(CVA->getOperand(i), false);
- }
- return;
- } else if (const ConstantStruct *CVS = dyn_cast<ConstantStruct>(CV)) {
- // Print the fields in successive locations. Pad to align if needed!
- const StructLayout *cvsLayout = TD->getStructLayout(CVS->getType());
- uint64_t sizeSoFar = 0;
- for (unsigned i = 0, e = CVS->getNumOperands(); i != e; ++i) {
- const Constant* field = CVS->getOperand(i);
-
- // Check if padding is needed and insert one or more 0s.
- uint64_t fieldSize = TD->getTypeStoreSize(field->getType());
- uint64_t padSize = ((i == e-1 ? Size : cvsLayout->getElementOffset(i+1))
- - cvsLayout->getElementOffset(i)) - fieldSize;
- sizeSoFar += fieldSize + padSize;
-
- // Now print the actual field value without ABI size padding.
- EmitGlobalConstant(field, true);
-
- // Insert padding - this may include padding to increase the size of the
- // current field up to the ABI size (if the struct is not packed) as well
- // as padding to ensure that the next field starts at the right offset.
- EmitZeros(padSize);
- }
- assert(sizeSoFar == cvsLayout->getSizeInBytes() &&
- "Layout of constant struct may be incorrect!");
- return;
- } else if (const ConstantFP *CFP = dyn_cast<ConstantFP>(CV)) {
- // FP Constants are printed as integer constants to avoid losing
- // precision...
- if (CFP->getType() == Type::DoubleTy) {
- double Val = CFP->getValueAPF().convertToDouble(); // for comment only
- uint64_t i = CFP->getValueAPF().convertToAPInt().getZExtValue();
- if (TAI->getData64bitsDirective())
- O << TAI->getData64bitsDirective() << i << "\t"
- << TAI->getCommentString() << " double value: " << Val << "\n";
- else if (TD->isBigEndian()) {
- O << TAI->getData32bitsDirective() << unsigned(i >> 32)
- << "\t" << TAI->getCommentString()
- << " double most significant word " << Val << "\n";
- O << TAI->getData32bitsDirective() << unsigned(i)
- << "\t" << TAI->getCommentString()
- << " double least significant word " << Val << "\n";
- } else {
- O << TAI->getData32bitsDirective() << unsigned(i)
- << "\t" << TAI->getCommentString()
- << " double least significant word " << Val << "\n";
- O << TAI->getData32bitsDirective() << unsigned(i >> 32)
- << "\t" << TAI->getCommentString()
- << " double most significant word " << Val << "\n";
- }
- return;
- } else if (CFP->getType() == Type::FloatTy) {
- float Val = CFP->getValueAPF().convertToFloat(); // for comment only
- O << TAI->getData32bitsDirective()
- << CFP->getValueAPF().convertToAPInt().getZExtValue()
- << "\t" << TAI->getCommentString() << " float " << Val << "\n";
- return;
- } else if (CFP->getType() == Type::X86_FP80Ty) {
- // all long double variants are printed as hex
- // api needed to prevent premature destruction
- APInt api = CFP->getValueAPF().convertToAPInt();
- const uint64_t *p = api.getRawData();
- APFloat DoubleVal = CFP->getValueAPF();
- DoubleVal.convert(APFloat::IEEEdouble, APFloat::rmNearestTiesToEven);
- if (TD->isBigEndian()) {
- O << TAI->getData16bitsDirective() << uint16_t(p[0] >> 48)
- << "\t" << TAI->getCommentString()
- << " long double most significant halfword of ~"
- << DoubleVal.convertToDouble() << "\n";
- O << TAI->getData16bitsDirective() << uint16_t(p[0] >> 32)
- << "\t" << TAI->getCommentString()
- << " long double next halfword\n";
- O << TAI->getData16bitsDirective() << uint16_t(p[0] >> 16)
- << "\t" << TAI->getCommentString()
- << " long double next halfword\n";
- O << TAI->getData16bitsDirective() << uint16_t(p[0])
- << "\t" << TAI->getCommentString()
- << " long double next halfword\n";
- O << TAI->getData16bitsDirective() << uint16_t(p[1])
- << "\t" << TAI->getCommentString()
- << " long double least significant halfword\n";
- } else {
- O << TAI->getData16bitsDirective() << uint16_t(p[1])
- << "\t" << TAI->getCommentString()
- << " long double least significant halfword of ~"
- << DoubleVal.convertToDouble() << "\n";
- O << TAI->getData16bitsDirective() << uint16_t(p[0])
- << "\t" << TAI->getCommentString()
- << " long double next halfword\n";
- O << TAI->getData16bitsDirective() << uint16_t(p[0] >> 16)
- << "\t" << TAI->getCommentString()
- << " long double next halfword\n";
- O << TAI->getData16bitsDirective() << uint16_t(p[0] >> 32)
- << "\t" << TAI->getCommentString()
- << " long double next halfword\n";
- O << TAI->getData16bitsDirective() << uint16_t(p[0] >> 48)
- << "\t" << TAI->getCommentString()
- << " long double most significant halfword\n";
- }
- EmitZeros(Size - TD->getTypeStoreSize(Type::X86_FP80Ty));
- return;
- } else if (CFP->getType() == Type::PPC_FP128Ty) {
- // all long double variants are printed as hex
- // api needed to prevent premature destruction
- APInt api = CFP->getValueAPF().convertToAPInt();
- const uint64_t *p = api.getRawData();
- if (TD->isBigEndian()) {
- O << TAI->getData32bitsDirective() << uint32_t(p[0] >> 32)
- << "\t" << TAI->getCommentString()
- << " long double most significant word\n";
- O << TAI->getData32bitsDirective() << uint32_t(p[0])
- << "\t" << TAI->getCommentString()
- << " long double next word\n";
- O << TAI->getData32bitsDirective() << uint32_t(p[1] >> 32)
- << "\t" << TAI->getCommentString()
- << " long double next word\n";
- O << TAI->getData32bitsDirective() << uint32_t(p[1])
- << "\t" << TAI->getCommentString()
- << " long double least significant word\n";
- } else {
- O << TAI->getData32bitsDirective() << uint32_t(p[1])
- << "\t" << TAI->getCommentString()
- << " long double least significant word\n";
- O << TAI->getData32bitsDirective() << uint32_t(p[1] >> 32)
- << "\t" << TAI->getCommentString()
- << " long double next word\n";
- O << TAI->getData32bitsDirective() << uint32_t(p[0])
- << "\t" << TAI->getCommentString()
- << " long double next word\n";
- O << TAI->getData32bitsDirective() << uint32_t(p[0] >> 32)
- << "\t" << TAI->getCommentString()
- << " long double most significant word\n";
- }
- return;
- } else assert(0 && "Floating point constant type not handled");
- } else if (CV->getType() == Type::Int64Ty) {
- if (const ConstantInt *CI = dyn_cast<ConstantInt>(CV)) {
- uint64_t Val = CI->getZExtValue();
-
- if (TAI->getData64bitsDirective())
- O << TAI->getData64bitsDirective() << Val << "\n";
- else if (TD->isBigEndian()) {
- O << TAI->getData32bitsDirective() << unsigned(Val >> 32)
- << "\t" << TAI->getCommentString()
- << " Double-word most significant word " << Val << "\n";
- O << TAI->getData32bitsDirective() << unsigned(Val)
- << "\t" << TAI->getCommentString()
- << " Double-word least significant word " << Val << "\n";
- } else {
- O << TAI->getData32bitsDirective() << unsigned(Val)
- << "\t" << TAI->getCommentString()
- << " Double-word least significant word " << Val << "\n";
- O << TAI->getData32bitsDirective() << unsigned(Val >> 32)
- << "\t" << TAI->getCommentString()
- << " Double-word most significant word " << Val << "\n";
- }
- return;
- }
- } else if (const ConstantVector *CP = dyn_cast<ConstantVector>(CV)) {
- const VectorType *PTy = CP->getType();
-
- for (unsigned I = 0, E = PTy->getNumElements(); I < E; ++I)
- EmitGlobalConstant(CP->getOperand(I), false);
-
- return;
- }
-
- const Type *type = CV->getType();
- printDataDirective(type);
- EmitConstantValueOnly(CV);
- O << "\n";
-}
-
-void
-AsmPrinter::EmitMachineConstantPoolValue(MachineConstantPoolValue *MCPV) {
- // Target doesn't support this yet!
- abort();
-}
-
-/// PrintSpecial - Print information related to the specified machine instr
-/// that is independent of the operand, and may be independent of the instr
-/// itself. This can be useful for portably encoding the comment character
-/// or other bits of target-specific knowledge into the asmstrings. The
-/// syntax used is ${:comment}. Targets can override this to add support
-/// for their own strange codes.
-void AsmPrinter::PrintSpecial(const MachineInstr *MI, const char *Code) {
- if (!strcmp(Code, "private")) {
- O << TAI->getPrivateGlobalPrefix();
- } else if (!strcmp(Code, "comment")) {
- O << TAI->getCommentString();
- } else if (!strcmp(Code, "uid")) {
- // Assign a unique ID to this machine instruction.
- static const MachineInstr *LastMI = 0;
- static const Function *F = 0;
- static unsigned Counter = 0U-1;
-
- // Comparing the address of MI isn't sufficient, because machineinstrs may
- // be allocated to the same address across functions.
- const Function *ThisF = MI->getParent()->getParent()->getFunction();
-
- // If this is a new machine instruction, bump the counter.
- if (LastMI != MI || F != ThisF) {
- ++Counter;
- LastMI = MI;
- F = ThisF;
- }
- O << Counter;
- } else {
- cerr << "Unknown special formatter '" << Code
- << "' for machine instr: " << *MI;
- exit(1);
- }
-}
-
-
-/// printInlineAsm - This method formats and prints the specified machine
-/// instruction that is an inline asm.
-void AsmPrinter::printInlineAsm(const MachineInstr *MI) const {
- unsigned NumOperands = MI->getNumOperands();
-
- // Count the number of register definitions.
- unsigned NumDefs = 0;
- for (; MI->getOperand(NumDefs).isRegister() && MI->getOperand(NumDefs).isDef();
- ++NumDefs)
- assert(NumDefs != NumOperands-1 && "No asm string?");
-
- assert(MI->getOperand(NumDefs).isExternalSymbol() && "No asm string?");
-
- // Disassemble the AsmStr, printing out the literal pieces, the operands, etc.
- const char *AsmStr = MI->getOperand(NumDefs).getSymbolName();
-
- // If this asmstr is empty, just print the #APP/#NOAPP markers.
- // These are useful to see where empty asm's wound up.
- if (AsmStr[0] == 0) {
- O << TAI->getInlineAsmStart() << "\n\t" << TAI->getInlineAsmEnd() << "\n";
- return;
- }
-
- O << TAI->getInlineAsmStart() << "\n\t";
-
- // The variant of the current asmprinter.
- int AsmPrinterVariant = TAI->getAssemblerDialect();
-
- int CurVariant = -1; // The number of the {.|.|.} region we are in.
- const char *LastEmitted = AsmStr; // One past the last character emitted.
-
- while (*LastEmitted) {
- switch (*LastEmitted) {
- default: {
- // Not a special case, emit the string section literally.
- const char *LiteralEnd = LastEmitted+1;
- while (*LiteralEnd && *LiteralEnd != '{' && *LiteralEnd != '|' &&
- *LiteralEnd != '}' && *LiteralEnd != '$' && *LiteralEnd != '\n')
- ++LiteralEnd;
- if (CurVariant == -1 || CurVariant == AsmPrinterVariant)
- O.write(LastEmitted, LiteralEnd-LastEmitted);
- LastEmitted = LiteralEnd;
- break;
- }
- case '\n':
- ++LastEmitted; // Consume newline character.
- O << "\n"; // Indent code with newline.
- break;
- case '$': {
- ++LastEmitted; // Consume '$' character.
- bool Done = true;
-
- // Handle escapes.
- switch (*LastEmitted) {
- default: Done = false; break;
- case '$': // $$ -> $
- if (CurVariant == -1 || CurVariant == AsmPrinterVariant)
- O << '$';
- ++LastEmitted; // Consume second '$' character.
- break;
- case '(': // $( -> same as GCC's { character.
- ++LastEmitted; // Consume '(' character.
- if (CurVariant != -1) {
- cerr << "Nested variants found in inline asm string: '"
- << AsmStr << "'\n";
- exit(1);
- }
- CurVariant = 0; // We're in the first variant now.
- break;
- case '|':
- ++LastEmitted; // consume '|' character.
- if (CurVariant == -1) {
- cerr << "Found '|' character outside of variant in inline asm "
- << "string: '" << AsmStr << "'\n";
- exit(1);
- }
- ++CurVariant; // We're in the next variant.
- break;
- case ')': // $) -> same as GCC's } char.
- ++LastEmitted; // consume ')' character.
- if (CurVariant == -1) {
- cerr << "Found '}' character outside of variant in inline asm "
- << "string: '" << AsmStr << "'\n";
- exit(1);
- }
- CurVariant = -1;
- break;
- }
- if (Done) break;
-
- bool HasCurlyBraces = false;
- if (*LastEmitted == '{') { // ${variable}
- ++LastEmitted; // Consume '{' character.
- HasCurlyBraces = true;
- }
-
- const char *IDStart = LastEmitted;
- char *IDEnd;
- errno = 0;
- long Val = strtol(IDStart, &IDEnd, 10); // We only accept numbers for IDs.
- if (!isdigit(*IDStart) || (Val == 0 && errno == EINVAL)) {
- cerr << "Bad $ operand number in inline asm string: '"
- << AsmStr << "'\n";
- exit(1);
- }
- LastEmitted = IDEnd;
-
- char Modifier[2] = { 0, 0 };
-
- if (HasCurlyBraces) {
- // If we have curly braces, check for a modifier character. This
- // supports syntax like ${0:u}, which correspond to "%u0" in GCC asm.
- if (*LastEmitted == ':') {
- ++LastEmitted; // Consume ':' character.
- if (*LastEmitted == 0) {
- cerr << "Bad ${:} expression in inline asm string: '"
- << AsmStr << "'\n";
- exit(1);
- }
-
- Modifier[0] = *LastEmitted;
- ++LastEmitted; // Consume modifier character.
- }
-
- if (*LastEmitted != '}') {
- cerr << "Bad ${} expression in inline asm string: '"
- << AsmStr << "'\n";
- exit(1);
- }
- ++LastEmitted; // Consume '}' character.
- }
-
- if ((unsigned)Val >= NumOperands-1) {
- cerr << "Invalid $ operand number in inline asm string: '"
- << AsmStr << "'\n";
- exit(1);
- }
-
- // Okay, we finally have a value number. Ask the target to print this
- // operand!
- if (CurVariant == -1 || CurVariant == AsmPrinterVariant) {
- unsigned OpNo = 1;
-
- bool Error = false;
-
- // Scan to find the machine operand number for the operand.
- for (; Val; --Val) {
- if (OpNo >= MI->getNumOperands()) break;
- unsigned OpFlags = MI->getOperand(OpNo).getImm();
- OpNo += (OpFlags >> 3) + 1;
- }
-
- if (OpNo >= MI->getNumOperands()) {
- Error = true;
- } else {
- unsigned OpFlags = MI->getOperand(OpNo).getImm();
- ++OpNo; // Skip over the ID number.
-
- if (Modifier[0]=='l') // labels are target independent
- printBasicBlockLabel(MI->getOperand(OpNo).getMBB(),
- false, false, false);
- else {
- AsmPrinter *AP = const_cast<AsmPrinter*>(this);
- if ((OpFlags & 7) == 4 /*ADDR MODE*/) {
- Error = AP->PrintAsmMemoryOperand(MI, OpNo, AsmPrinterVariant,
- Modifier[0] ? Modifier : 0);
- } else {
- Error = AP->PrintAsmOperand(MI, OpNo, AsmPrinterVariant,
- Modifier[0] ? Modifier : 0);
- }
- }
- }
- if (Error) {
- cerr << "Invalid operand found in inline asm: '"
- << AsmStr << "'\n";
- MI->dump();
- exit(1);
- }
- }
- break;
- }
- }
- }
- O << "\n\t" << TAI->getInlineAsmEnd() << "\n";
-}
-
-/// printImplicitDef - This method prints the specified machine instruction
-/// that is an implicit def.
-void AsmPrinter::printImplicitDef(const MachineInstr *MI) const {
- O << "\t" << TAI->getCommentString() << " implicit-def: "
- << TRI->getAsmName(MI->getOperand(0).getReg()) << "\n";
-}
-
-/// printLabel - This method prints a local label used by debug and
-/// exception handling tables.
-void AsmPrinter::printLabel(const MachineInstr *MI) const {
- O << TAI->getPrivateGlobalPrefix()
- << "label" << MI->getOperand(0).getImm() << ":\n";
-}
-
-void AsmPrinter::printLabel(unsigned Id) const {
- O << TAI->getPrivateGlobalPrefix() << "label" << Id << ":\n";
-}
-
-/// printDeclare - This method prints a local variable declaration used by
-/// debug tables.
-/// FIXME: It doesn't really print anything rather it inserts a DebugVariable
-/// entry into dwarf table.
-void AsmPrinter::printDeclare(const MachineInstr *MI) const {
- int FI = MI->getOperand(0).getIndex();
- GlobalValue *GV = MI->getOperand(1).getGlobal();
- MMI->RecordVariable(GV, FI);
-}
-
-/// PrintAsmOperand - Print the specified operand of MI, an INLINEASM
-/// instruction, using the specified assembler variant. Targets should
-/// overried this to format as appropriate.
-bool AsmPrinter::PrintAsmOperand(const MachineInstr *MI, unsigned OpNo,
- unsigned AsmVariant, const char *ExtraCode) {
- // Target doesn't support this yet!
- return true;
-}
-
-bool AsmPrinter::PrintAsmMemoryOperand(const MachineInstr *MI, unsigned OpNo,
- unsigned AsmVariant,
- const char *ExtraCode) {
- // Target doesn't support this yet!
- return true;
-}
-
-/// printBasicBlockLabel - This method prints the label for the specified
-/// MachineBasicBlock
-void AsmPrinter::printBasicBlockLabel(const MachineBasicBlock *MBB,
- bool printAlign,
- bool printColon,
- bool printComment) const {
- if (printAlign) {
- unsigned Align = MBB->getAlignment();
- if (Align)
- EmitAlignment(Log2_32(Align));
- }
-
- O << TAI->getPrivateGlobalPrefix() << "BB" << getFunctionNumber() << "_"
- << MBB->getNumber();
- if (printColon)
- O << ':';
- if (printComment && MBB->getBasicBlock())
- O << '\t' << TAI->getCommentString() << ' '
- << MBB->getBasicBlock()->getName();
-}
-
-/// printPICJumpTableSetLabel - This method prints a set label for the
-/// specified MachineBasicBlock for a jumptable entry.
-void AsmPrinter::printPICJumpTableSetLabel(unsigned uid,
- const MachineBasicBlock *MBB) const {
- if (!TAI->getSetDirective())
- return;
-
- O << TAI->getSetDirective() << ' ' << TAI->getPrivateGlobalPrefix()
- << getFunctionNumber() << '_' << uid << "_set_" << MBB->getNumber() << ',';
- printBasicBlockLabel(MBB, false, false, false);
- O << '-' << TAI->getPrivateGlobalPrefix() << "JTI" << getFunctionNumber()
- << '_' << uid << '\n';
-}
-
-void AsmPrinter::printPICJumpTableSetLabel(unsigned uid, unsigned uid2,
- const MachineBasicBlock *MBB) const {
- if (!TAI->getSetDirective())
- return;
-
- O << TAI->getSetDirective() << ' ' << TAI->getPrivateGlobalPrefix()
- << getFunctionNumber() << '_' << uid << '_' << uid2
- << "_set_" << MBB->getNumber() << ',';
- printBasicBlockLabel(MBB, false, false, false);
- O << '-' << TAI->getPrivateGlobalPrefix() << "JTI" << getFunctionNumber()
- << '_' << uid << '_' << uid2 << '\n';
-}
-
-/// printDataDirective - This method prints the asm directive for the
-/// specified type.
-void AsmPrinter::printDataDirective(const Type *type) {
- const TargetData *TD = TM.getTargetData();
- switch (type->getTypeID()) {
- case Type::IntegerTyID: {
- unsigned BitWidth = cast<IntegerType>(type)->getBitWidth();
- if (BitWidth <= 8)
- O << TAI->getData8bitsDirective();
- else if (BitWidth <= 16)
- O << TAI->getData16bitsDirective();
- else if (BitWidth <= 32)
- O << TAI->getData32bitsDirective();
- else if (BitWidth <= 64) {
- assert(TAI->getData64bitsDirective() &&
- "Target cannot handle 64-bit constant exprs!");
- O << TAI->getData64bitsDirective();
- }
- break;
- }
- case Type::PointerTyID:
- if (TD->getPointerSize() == 8) {
- assert(TAI->getData64bitsDirective() &&
- "Target cannot handle 64-bit pointer exprs!");
- O << TAI->getData64bitsDirective();
- } else {
- O << TAI->getData32bitsDirective();
- }
- break;
- case Type::FloatTyID: case Type::DoubleTyID:
- case Type::X86_FP80TyID: case Type::FP128TyID: case Type::PPC_FP128TyID:
- assert (0 && "Should have already output floating point constant.");
- default:
- assert (0 && "Can't handle printing this type of thing");
- break;
- }
-}
-
diff --git a/release_23/lib/CodeGen/BranchFolding.cpp b/release_23/lib/CodeGen/BranchFolding.cpp
deleted file mode 100644
index 9895ab7a0348..000000000000
--- a/release_23/lib/CodeGen/BranchFolding.cpp
+++ /dev/null
@@ -1,1214 +0,0 @@
-//===-- BranchFolding.cpp - Fold machine code branch instructions ---------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This pass forwards branches to unconditional branches to make them branch
-// directly to the target block. This pass often results in dead MBB's, which
-// it then removes.
-//
-// Note that this pass must be run after register allocation, it cannot handle
-// SSA form.
-//
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "branchfolding"
-#include "llvm/CodeGen/Passes.h"
-#include "llvm/CodeGen/MachineModuleInfo.h"
-#include "llvm/CodeGen/MachineFunctionPass.h"
-#include "llvm/CodeGen/MachineJumpTableInfo.h"
-#include "llvm/CodeGen/RegisterScavenging.h"
-#include "llvm/Target/TargetInstrInfo.h"
-#include "llvm/Target/TargetMachine.h"
-#include "llvm/Target/TargetRegisterInfo.h"
-#include "llvm/Support/CommandLine.h"
-#include "llvm/Support/Debug.h"
-#include "llvm/ADT/SmallSet.h"
-#include "llvm/ADT/Statistic.h"
-#include "llvm/ADT/STLExtras.h"
-#include <algorithm>
-using namespace llvm;
-
-STATISTIC(NumDeadBlocks, "Number of dead blocks removed");
-STATISTIC(NumBranchOpts, "Number of branches optimized");
-STATISTIC(NumTailMerge , "Number of block tails merged");
-static cl::opt<cl::boolOrDefault> FlagEnableTailMerge("enable-tail-merge",
- cl::init(cl::BOU_UNSET), cl::Hidden);
-namespace {
- // Throttle for huge numbers of predecessors (compile speed problems)
- static cl::opt<unsigned>
- TailMergeThreshold("tail-merge-threshold",
- cl::desc("Max number of predecessors to consider tail merging"),
- cl::init(100), cl::Hidden);
-
- struct VISIBILITY_HIDDEN BranchFolder : public MachineFunctionPass {
- static char ID;
- explicit BranchFolder(bool defaultEnableTailMerge) :
- MachineFunctionPass((intptr_t)&ID) {
- switch (FlagEnableTailMerge) {
- case cl::BOU_UNSET: EnableTailMerge = defaultEnableTailMerge; break;
- case cl::BOU_TRUE: EnableTailMerge = true; break;
- case cl::BOU_FALSE: EnableTailMerge = false; break;
- }
- }
-
- virtual bool runOnMachineFunction(MachineFunction &MF);
- virtual const char *getPassName() const { return "Control Flow Optimizer"; }
- const TargetInstrInfo *TII;
- MachineModuleInfo *MMI;
- bool MadeChange;
- private:
- // Tail Merging.
- bool EnableTailMerge;
- bool TailMergeBlocks(MachineFunction &MF);
- bool TryMergeBlocks(MachineBasicBlock* SuccBB,
- MachineBasicBlock* PredBB);
- void ReplaceTailWithBranchTo(MachineBasicBlock::iterator OldInst,
- MachineBasicBlock *NewDest);
- MachineBasicBlock *SplitMBBAt(MachineBasicBlock &CurMBB,
- MachineBasicBlock::iterator BBI1);
- unsigned ComputeSameTails(unsigned CurHash, unsigned minCommonTailLength);
- void RemoveBlocksWithHash(unsigned CurHash, MachineBasicBlock* SuccBB,
- MachineBasicBlock* PredBB);
-
- typedef std::pair<unsigned,MachineBasicBlock*> MergePotentialsElt;
- typedef std::vector<MergePotentialsElt>::iterator MPIterator;
- std::vector<MergePotentialsElt> MergePotentials;
- typedef std::pair<MPIterator, MachineBasicBlock::iterator> SameTailElt;
- std::vector<SameTailElt> SameTails;
-
- const TargetRegisterInfo *RegInfo;
- RegScavenger *RS;
- // Branch optzn.
- bool OptimizeBranches(MachineFunction &MF);
- void OptimizeBlock(MachineBasicBlock *MBB);
- void RemoveDeadBlock(MachineBasicBlock *MBB);
- bool OptimizeImpDefsBlock(MachineBasicBlock *MBB);
-
- bool CanFallThrough(MachineBasicBlock *CurBB);
- bool CanFallThrough(MachineBasicBlock *CurBB, bool BranchUnAnalyzable,
- MachineBasicBlock *TBB, MachineBasicBlock *FBB,
- const std::vector<MachineOperand> &Cond);
- };
- char BranchFolder::ID = 0;
-}
-
-FunctionPass *llvm::createBranchFoldingPass(bool DefaultEnableTailMerge) {
- return new BranchFolder(DefaultEnableTailMerge); }
-
-/// RemoveDeadBlock - Remove the specified dead machine basic block from the
-/// function, updating the CFG.
-void BranchFolder::RemoveDeadBlock(MachineBasicBlock *MBB) {
- assert(MBB->pred_empty() && "MBB must be dead!");
- DOUT << "\nRemoving MBB: " << *MBB;
-
- MachineFunction *MF = MBB->getParent();
- // drop all successors.
- while (!MBB->succ_empty())
- MBB->removeSuccessor(MBB->succ_end()-1);
-
- // If there is DWARF info to active, check to see if there are any LABEL
- // records in the basic block. If so, unregister them from MachineModuleInfo.
- if (MMI && !MBB->empty()) {
- for (MachineBasicBlock::iterator I = MBB->begin(), E = MBB->end();
- I != E; ++I) {
- if ((unsigned)I->getOpcode() == TargetInstrInfo::LABEL) {
- // The label ID # is always operand #0, an immediate.
- MMI->InvalidateLabel(I->getOperand(0).getImm());
- }
- }
- }
-
- // Remove the block.
- MF->getBasicBlockList().erase(MBB);
-}
-
-/// OptimizeImpDefsBlock - If a basic block is just a bunch of implicit_def
-/// followed by terminators, and if the implicitly defined registers are not
-/// used by the terminators, remove those implicit_def's. e.g.
-/// BB1:
-/// r0 = implicit_def
-/// r1 = implicit_def
-/// br
-/// This block can be optimized away later if the implicit instructions are
-/// removed.
-bool BranchFolder::OptimizeImpDefsBlock(MachineBasicBlock *MBB) {
- SmallSet<unsigned, 4> ImpDefRegs;
- MachineBasicBlock::iterator I = MBB->begin();
- while (I != MBB->end()) {
- if (I->getOpcode() != TargetInstrInfo::IMPLICIT_DEF)
- break;
- unsigned Reg = I->getOperand(0).getReg();
- ImpDefRegs.insert(Reg);
- for (const unsigned *SubRegs = RegInfo->getSubRegisters(Reg);
- unsigned SubReg = *SubRegs; ++SubRegs)
- ImpDefRegs.insert(SubReg);
- ++I;
- }
- if (ImpDefRegs.empty())
- return false;
-
- MachineBasicBlock::iterator FirstTerm = I;
- while (I != MBB->end()) {
- if (!TII->isUnpredicatedTerminator(I))
- return false;
- // See if it uses any of the implicitly defined registers.
- for (unsigned i = 0, e = I->getNumOperands(); i != e; ++i) {
- MachineOperand &MO = I->getOperand(i);
- if (!MO.isReg() || !MO.isUse())
- continue;
- unsigned Reg = MO.getReg();
- if (ImpDefRegs.count(Reg))
- return false;
- }
- ++I;
- }
-
- I = MBB->begin();
- while (I != FirstTerm) {
- MachineInstr *ImpDefMI = &*I;
- ++I;
- MBB->erase(ImpDefMI);
- }
-
- return true;
-}
-
-bool BranchFolder::runOnMachineFunction(MachineFunction &MF) {
- TII = MF.getTarget().getInstrInfo();
- if (!TII) return false;
-
- RegInfo = MF.getTarget().getRegisterInfo();
-
- // Fix CFG. The later algorithms expect it to be right.
- bool EverMadeChange = false;
- for (MachineFunction::iterator I = MF.begin(), E = MF.end(); I != E; I++) {
- MachineBasicBlock *MBB = I, *TBB = 0, *FBB = 0;
- std::vector<MachineOperand> Cond;
- if (!TII->AnalyzeBranch(*MBB, TBB, FBB, Cond))
- EverMadeChange |= MBB->CorrectExtraCFGEdges(TBB, FBB, !Cond.empty());
- EverMadeChange |= OptimizeImpDefsBlock(MBB);
- }
-
- RS = RegInfo->requiresRegisterScavenging(MF) ? new RegScavenger() : NULL;
-
- MMI = getAnalysisToUpdate<MachineModuleInfo>();
-
- bool MadeChangeThisIteration = true;
- while (MadeChangeThisIteration) {
- MadeChangeThisIteration = false;
- MadeChangeThisIteration |= TailMergeBlocks(MF);
- MadeChangeThisIteration |= OptimizeBranches(MF);
- EverMadeChange |= MadeChangeThisIteration;
- }
-
- // See if any jump tables have become mergable or dead as the code generator
- // did its thing.
- MachineJumpTableInfo *JTI = MF.getJumpTableInfo();
- const std::vector<MachineJumpTableEntry> &JTs = JTI->getJumpTables();
- if (!JTs.empty()) {
- // Figure out how these jump tables should be merged.
- std::vector<unsigned> JTMapping;
- JTMapping.reserve(JTs.size());
-
- // We always keep the 0th jump table.
- JTMapping.push_back(0);
-
- // Scan the jump tables, seeing if there are any duplicates. Note that this
- // is N^2, which should be fixed someday.
- for (unsigned i = 1, e = JTs.size(); i != e; ++i)
- JTMapping.push_back(JTI->getJumpTableIndex(JTs[i].MBBs));
-
- // If a jump table was merge with another one, walk the function rewriting
- // references to jump tables to reference the new JT ID's. Keep track of
- // whether we see a jump table idx, if not, we can delete the JT.
- BitVector JTIsLive(JTs.size());
- for (MachineFunction::iterator BB = MF.begin(), E = MF.end();
- BB != E; ++BB) {
- for (MachineBasicBlock::iterator I = BB->begin(), E = BB->end();
- I != E; ++I)
- for (unsigned op = 0, e = I->getNumOperands(); op != e; ++op) {
- MachineOperand &Op = I->getOperand(op);
- if (!Op.isJumpTableIndex()) continue;
- unsigned NewIdx = JTMapping[Op.getIndex()];
- Op.setIndex(NewIdx);
-
- // Remember that this JT is live.
- JTIsLive.set(NewIdx);
- }
- }
-
- // Finally, remove dead jump tables. This happens either because the
- // indirect jump was unreachable (and thus deleted) or because the jump
- // table was merged with some other one.
- for (unsigned i = 0, e = JTIsLive.size(); i != e; ++i)
- if (!JTIsLive.test(i)) {
- JTI->RemoveJumpTable(i);
- EverMadeChange = true;
- }
- }
-
- delete RS;
- return EverMadeChange;
-}
-
-//===----------------------------------------------------------------------===//
-// Tail Merging of Blocks
-//===----------------------------------------------------------------------===//
-
-/// HashMachineInstr - Compute a hash value for MI and its operands.
-static unsigned HashMachineInstr(const MachineInstr *MI) {
- unsigned Hash = MI->getOpcode();
- for (unsigned i = 0, e = MI->getNumOperands(); i != e; ++i) {
- const MachineOperand &Op = MI->getOperand(i);
-
- // Merge in bits from the operand if easy.
- unsigned OperandHash = 0;
- switch (Op.getType()) {
- case MachineOperand::MO_Register: OperandHash = Op.getReg(); break;
- case MachineOperand::MO_Immediate: OperandHash = Op.getImm(); break;
- case MachineOperand::MO_MachineBasicBlock:
- OperandHash = Op.getMBB()->getNumber();
- break;
- case MachineOperand::MO_FrameIndex:
- case MachineOperand::MO_ConstantPoolIndex:
- case MachineOperand::MO_JumpTableIndex:
- OperandHash = Op.getIndex();
- break;
- case MachineOperand::MO_GlobalAddress:
- case MachineOperand::MO_ExternalSymbol:
- // Global address / external symbol are too hard, don't bother, but do
- // pull in the offset.
- OperandHash = Op.getOffset();
- break;
- default: break;
- }
-
- Hash += ((OperandHash << 3) | Op.getType()) << (i&31);
- }
- return Hash;
-}
-
-/// HashEndOfMBB - Hash the last few instructions in the MBB. For blocks
-/// with no successors, we hash two instructions, because cross-jumping
-/// only saves code when at least two instructions are removed (since a
-/// branch must be inserted). For blocks with a successor, one of the
-/// two blocks to be tail-merged will end with a branch already, so
-/// it gains to cross-jump even for one instruction.
-
-static unsigned HashEndOfMBB(const MachineBasicBlock *MBB,
- unsigned minCommonTailLength) {
- MachineBasicBlock::const_iterator I = MBB->end();
- if (I == MBB->begin())
- return 0; // Empty MBB.
-
- --I;
- unsigned Hash = HashMachineInstr(I);
-
- if (I == MBB->begin() || minCommonTailLength == 1)
- return Hash; // Single instr MBB.
-
- --I;
- // Hash in the second-to-last instruction.
- Hash ^= HashMachineInstr(I) << 2;
- return Hash;
-}
-
-/// ComputeCommonTailLength - Given two machine basic blocks, compute the number
-/// of instructions they actually have in common together at their end. Return
-/// iterators for the first shared instruction in each block.
-static unsigned ComputeCommonTailLength(MachineBasicBlock *MBB1,
- MachineBasicBlock *MBB2,
- MachineBasicBlock::iterator &I1,
- MachineBasicBlock::iterator &I2) {
- I1 = MBB1->end();
- I2 = MBB2->end();
-
- unsigned TailLen = 0;
- while (I1 != MBB1->begin() && I2 != MBB2->begin()) {
- --I1; --I2;
- if (!I1->isIdenticalTo(I2) ||
- // FIXME: This check is dubious. It's used to get around a problem where
- // people incorrectly expect inline asm directives to remain in the same
- // relative order. This is untenable because normal compiler
- // optimizations (like this one) may reorder and/or merge these
- // directives.
- I1->getOpcode() == TargetInstrInfo::INLINEASM) {
- ++I1; ++I2;
- break;
- }
- ++TailLen;
- }
- return TailLen;
-}
-
-/// ReplaceTailWithBranchTo - Delete the instruction OldInst and everything
-/// after it, replacing it with an unconditional branch to NewDest. This
-/// returns true if OldInst's block is modified, false if NewDest is modified.
-void BranchFolder::ReplaceTailWithBranchTo(MachineBasicBlock::iterator OldInst,
- MachineBasicBlock *NewDest) {
- MachineBasicBlock *OldBB = OldInst->getParent();
-
- // Remove all the old successors of OldBB from the CFG.
- while (!OldBB->succ_empty())
- OldBB->removeSuccessor(OldBB->succ_begin());
-
- // Remove all the dead instructions from the end of OldBB.
- OldBB->erase(OldInst, OldBB->end());
-
- // If OldBB isn't immediately before OldBB, insert a branch to it.
- if (++MachineFunction::iterator(OldBB) != MachineFunction::iterator(NewDest))
- TII->InsertBranch(*OldBB, NewDest, 0, std::vector<MachineOperand>());
- OldBB->addSuccessor(NewDest);
- ++NumTailMerge;
-}
-
-/// SplitMBBAt - Given a machine basic block and an iterator into it, split the
-/// MBB so that the part before the iterator falls into the part starting at the
-/// iterator. This returns the new MBB.
-MachineBasicBlock *BranchFolder::SplitMBBAt(MachineBasicBlock &CurMBB,
- MachineBasicBlock::iterator BBI1) {
- // Create the fall-through block.
- MachineFunction::iterator MBBI = &CurMBB;
- MachineBasicBlock *NewMBB = new MachineBasicBlock(CurMBB.getBasicBlock());
- CurMBB.getParent()->getBasicBlockList().insert(++MBBI, NewMBB);
-
- // Move all the successors of this block to the specified block.
- while (!CurMBB.succ_empty()) {
- MachineBasicBlock *S = *(CurMBB.succ_end()-1);
- NewMBB->addSuccessor(S);
- CurMBB.removeSuccessor(S);
- }
-
- // Add an edge from CurMBB to NewMBB for the fall-through.
- CurMBB.addSuccessor(NewMBB);
-
- // Splice the code over.
- NewMBB->splice(NewMBB->end(), &CurMBB, BBI1, CurMBB.end());
-
- // For targets that use the register scavenger, we must maintain LiveIns.
- if (RS) {
- RS->enterBasicBlock(&CurMBB);
- if (!CurMBB.empty())
- RS->forward(prior(CurMBB.end()));
- BitVector RegsLiveAtExit(RegInfo->getNumRegs());
- RS->getRegsUsed(RegsLiveAtExit, false);
- for (unsigned int i=0, e=RegInfo->getNumRegs(); i!=e; i++)
- if (RegsLiveAtExit[i])
- NewMBB->addLiveIn(i);
- }
-
- return NewMBB;
-}
-
-/// EstimateRuntime - Make a rough estimate for how long it will take to run
-/// the specified code.
-static unsigned EstimateRuntime(MachineBasicBlock::iterator I,
- MachineBasicBlock::iterator E) {
- unsigned Time = 0;
- for (; I != E; ++I) {
- const TargetInstrDesc &TID = I->getDesc();
- if (TID.isCall())
- Time += 10;
- else if (TID.isSimpleLoad() || TID.mayStore())
- Time += 2;
- else
- ++Time;
- }
- return Time;
-}
-
-/// ShouldSplitFirstBlock - We need to either split MBB1 at MBB1I or MBB2 at
-/// MBB2I and then insert an unconditional branch in the other block. Determine
-/// which is the best to split
-static bool ShouldSplitFirstBlock(MachineBasicBlock *MBB1,
- MachineBasicBlock::iterator MBB1I,
- MachineBasicBlock *MBB2,
- MachineBasicBlock::iterator MBB2I,
- MachineBasicBlock *PredBB) {
- // If one block is the entry block, split the other one; we can't generate
- // a branch to the entry block, as its label is not emitted.
- MachineBasicBlock *Entry = MBB1->getParent()->begin();
- if (MBB1 == Entry)
- return false;
- if (MBB2 == Entry)
- return true;
-
- // If one block falls through into the common successor, choose that
- // one to split; it is one instruction less to do that.
- if (PredBB) {
- if (MBB1 == PredBB)
- return true;
- else if (MBB2 == PredBB)
- return false;
- }
- // TODO: if we had some notion of which block was hotter, we could split
- // the hot block, so it is the fall-through. Since we don't have profile info
- // make a decision based on which will hurt most to split.
- unsigned MBB1Time = EstimateRuntime(MBB1->begin(), MBB1I);
- unsigned MBB2Time = EstimateRuntime(MBB2->begin(), MBB2I);
-
- // If the MBB1 prefix takes "less time" to run than the MBB2 prefix, split the
- // MBB1 block so it falls through. This will penalize the MBB2 path, but will
- // have a lower overall impact on the program execution.
- return MBB1Time < MBB2Time;
-}
-
-// CurMBB needs to add an unconditional branch to SuccMBB (we removed these
-// branches temporarily for tail merging). In the case where CurMBB ends
-// with a conditional branch to the next block, optimize by reversing the
-// test and conditionally branching to SuccMBB instead.
-
-static void FixTail(MachineBasicBlock* CurMBB, MachineBasicBlock *SuccBB,
- const TargetInstrInfo *TII) {
- MachineFunction *MF = CurMBB->getParent();
- MachineFunction::iterator I = next(MachineFunction::iterator(CurMBB));
- MachineBasicBlock *TBB = 0, *FBB = 0;
- std::vector<MachineOperand> Cond;
- if (I != MF->end() &&
- !TII->AnalyzeBranch(*CurMBB, TBB, FBB, Cond)) {
- MachineBasicBlock *NextBB = I;
- if (TBB == NextBB && !Cond.empty() && !FBB) {
- if (!TII->ReverseBranchCondition(Cond)) {
- TII->RemoveBranch(*CurMBB);
- TII->InsertBranch(*CurMBB, SuccBB, NULL, Cond);
- return;
- }
- }
- }
- TII->InsertBranch(*CurMBB, SuccBB, NULL, std::vector<MachineOperand>());
-}
-
-static bool MergeCompare(const std::pair<unsigned,MachineBasicBlock*> &p,
- const std::pair<unsigned,MachineBasicBlock*> &q) {
- if (p.first < q.first)
- return true;
- else if (p.first > q.first)
- return false;
- else if (p.second->getNumber() < q.second->getNumber())
- return true;
- else if (p.second->getNumber() > q.second->getNumber())
- return false;
- else {
- // _GLIBCXX_DEBUG checks strict weak ordering, which involves comparing
- // an object with itself.
-#ifndef _GLIBCXX_DEBUG
- assert(0 && "Predecessor appears twice");
-#endif
- return(false);
- }
-}
-
-/// ComputeSameTails - Look through all the blocks in MergePotentials that have
-/// hash CurHash (guaranteed to match the last element). Build the vector
-/// SameTails of all those that have the (same) largest number of instructions
-/// in common of any pair of these blocks. SameTails entries contain an
-/// iterator into MergePotentials (from which the MachineBasicBlock can be
-/// found) and a MachineBasicBlock::iterator into that MBB indicating the
-/// instruction where the matching code sequence begins.
-/// Order of elements in SameTails is the reverse of the order in which
-/// those blocks appear in MergePotentials (where they are not necessarily
-/// consecutive).
-unsigned BranchFolder::ComputeSameTails(unsigned CurHash,
- unsigned minCommonTailLength) {
- unsigned maxCommonTailLength = 0U;
- SameTails.clear();
- MachineBasicBlock::iterator TrialBBI1, TrialBBI2;
- MPIterator HighestMPIter = prior(MergePotentials.end());
- for (MPIterator CurMPIter = prior(MergePotentials.end()),
- B = MergePotentials.begin();
- CurMPIter!=B && CurMPIter->first==CurHash;
- --CurMPIter) {
- for (MPIterator I = prior(CurMPIter); I->first==CurHash ; --I) {
- unsigned CommonTailLen = ComputeCommonTailLength(
- CurMPIter->second,
- I->second,
- TrialBBI1, TrialBBI2);
- if (CommonTailLen >= minCommonTailLength) {
- if (CommonTailLen > maxCommonTailLength) {
- SameTails.clear();
- maxCommonTailLength = CommonTailLen;
- HighestMPIter = CurMPIter;
- SameTails.push_back(std::make_pair(CurMPIter, TrialBBI1));
- }
- if (HighestMPIter == CurMPIter &&
- CommonTailLen == maxCommonTailLength)
- SameTails.push_back(std::make_pair(I, TrialBBI2));
- }
- if (I==B)
- break;
- }
- }
- return maxCommonTailLength;
-}
-
-/// RemoveBlocksWithHash - Remove all blocks with hash CurHash from
-/// MergePotentials, restoring branches at ends of blocks as appropriate.
-void BranchFolder::RemoveBlocksWithHash(unsigned CurHash,
- MachineBasicBlock* SuccBB,
- MachineBasicBlock* PredBB) {
- for (MPIterator CurMPIter = prior(MergePotentials.end()),
- B = MergePotentials.begin();
- CurMPIter->first==CurHash;
- --CurMPIter) {
- // Put the unconditional branch back, if we need one.
- MachineBasicBlock *CurMBB = CurMPIter->second;
- if (SuccBB && CurMBB != PredBB)
- FixTail(CurMBB, SuccBB, TII);
- MergePotentials.erase(CurMPIter);
- if (CurMPIter==B)
- break;
- }
-}
-
-// See if any of the blocks in MergePotentials (which all have a common single
-// successor, or all have no successor) can be tail-merged. If there is a
-// successor, any blocks in MergePotentials that are not tail-merged and
-// are not immediately before Succ must have an unconditional branch to
-// Succ added (but the predecessor/successor lists need no adjustment).
-// The lone predecessor of Succ that falls through into Succ,
-// if any, is given in PredBB.
-
-bool BranchFolder::TryMergeBlocks(MachineBasicBlock *SuccBB,
- MachineBasicBlock* PredBB) {
- // We cannot jump to the entry block, which affects various choices below.
- MachineBasicBlock *Entry = MergePotentials.begin()->second->
- getParent()->begin();
-
- // It doesn't make sense to save a single instruction since tail merging
- // will add a jump.
- // FIXME: Ask the target to provide the threshold?
- unsigned minCommonTailLength = (SuccBB ? 1 : 2) + 1;
- MadeChange = false;
-
- DOUT << "\nTryMergeBlocks " << MergePotentials.size();
-
- // Sort by hash value so that blocks with identical end sequences sort
- // together.
- std::stable_sort(MergePotentials.begin(), MergePotentials.end(),MergeCompare);
-
- // Walk through equivalence sets looking for actual exact matches.
- while (MergePotentials.size() > 1) {
- unsigned CurHash = prior(MergePotentials.end())->first;
-
- // Build SameTails, identifying the set of blocks with this hash code
- // and with the maximum number of instructions in common.
- unsigned maxCommonTailLength = ComputeSameTails(CurHash,
- minCommonTailLength);
-
- // If we didn't find any pair that has at least minCommonTailLength
- // instructions in common, remove all blocks with this hash code and retry.
- if (SameTails.empty()) {
- RemoveBlocksWithHash(CurHash, SuccBB, PredBB);
- continue;
- }
-
- // If one of the blocks is the entire common tail (and not the entry
- // block, which we can't jump to), treat all blocks with this same
- // tail at once.
- unsigned int i;
- for (i=0; i<SameTails.size(); i++) {
- MachineBasicBlock *MBB = SameTails[i].first->second;
- if (MBB->begin() == SameTails[i].second && MBB != Entry)
- break;
- }
- if (i!=SameTails.size()) {
- MachineBasicBlock *MBB = SameTails[i].first->second;
- // MBB is common tail. Adjust all other BB's to jump to this one.
- // Traversal must be forwards so erases work.
- DOUT << "\nUsing common tail " << MBB->getNumber() << " for ";
- for (unsigned int j=0; j<SameTails.size(); ++j) {
- if (i==j)
- continue;
- DOUT << SameTails[j].first->second->getNumber() << ",";
- // Hack the end off BB j, making it jump to BB i instead.
- ReplaceTailWithBranchTo(SameTails[j].second, MBB);
- // This modifies BB j, so remove it from the worklist.
- MergePotentials.erase(SameTails[j].first);
- }
- DOUT << "\n";
- // We leave i in the worklist in case there are other blocks that
- // match it with a smaller number of instructions.
- MadeChange = true;
- continue;
- }
-
- // Otherwise, merge the 2 blocks in SameTails that are latest in
- // MergePotentials; these are at indices 0 and 1 in SameTails.
- MachineBasicBlock::iterator BBI1 = (SameTails[0]).second;
- MachineBasicBlock::iterator BBI2 = (SameTails[1]).second;
- MachineBasicBlock *MBB1 = (SameTails[0]).first->second;
- MachineBasicBlock *MBB2 = (SameTails[1]).first->second;
-
- DOUT << "\nMerging " << MBB1->getNumber() << "," <<
- MBB2->getNumber() << ", size " << maxCommonTailLength;
-
- // Neither block is the entire common tail; split the tail of one block
- // to make it redundant with the other tail. We cannot jump to the
- // entry block, so if one block is the entry block, split the other one.
-
- // The second half of the split block will remain in SameTails, and will
- // consist entirely of common code. Thus in the case where there are
- // multiple blocks that would all need to be split, the next iteration of
- // the outer loop will handle all the rest of them.
-
- // Decide whether we want to split MBB1 or MBB2.
- if (ShouldSplitFirstBlock(MBB1, BBI1, MBB2, BBI2, PredBB)) {
- MBB1 = SplitMBBAt(*MBB1, BBI1);
- BBI1 = MBB1->begin();
- SameTails[0].first->second = MBB1;
- } else {
- MBB2 = SplitMBBAt(*MBB2, BBI2);
- BBI2 = MBB2->begin();
- SameTails[1].first->second = MBB2;
- }
-
- if (MBB2->begin() == BBI2 && MBB2 != Entry) {
- // Hack the end off MBB1, making it jump to MBB2 instead.
- ReplaceTailWithBranchTo(BBI1, MBB2);
- // This modifies MBB1, so remove it from the worklist.
- MergePotentials.erase(SameTails[0].first);
- } else {
- assert(MBB1->begin() == BBI1 && MBB1 != Entry &&
- "Didn't split block correctly?");
- // Hack the end off MBB2, making it jump to MBB1 instead.
- ReplaceTailWithBranchTo(BBI2, MBB1);
- // This modifies MBB2, so remove it from the worklist.
- MergePotentials.erase(SameTails[1].first);
- }
- MadeChange = true;
- }
- return MadeChange;
-}
-
-bool BranchFolder::TailMergeBlocks(MachineFunction &MF) {
-
- if (!EnableTailMerge) return false;
-
- MadeChange = false;
-
- // First find blocks with no successors.
- MergePotentials.clear();
- for (MachineFunction::iterator I = MF.begin(), E = MF.end(); I != E; ++I) {
- if (I->succ_empty())
- MergePotentials.push_back(std::make_pair(HashEndOfMBB(I, 2U), I));
- }
- // See if we can do any tail merging on those.
- if (MergePotentials.size() < TailMergeThreshold &&
- MergePotentials.size() >= 2)
- MadeChange |= TryMergeBlocks(NULL, NULL);
-
- // Look at blocks (IBB) with multiple predecessors (PBB).
- // We change each predecessor to a canonical form, by
- // (1) temporarily removing any unconditional branch from the predecessor
- // to IBB, and
- // (2) alter conditional branches so they branch to the other block
- // not IBB; this may require adding back an unconditional branch to IBB
- // later, where there wasn't one coming in. E.g.
- // Bcc IBB
- // fallthrough to QBB
- // here becomes
- // Bncc QBB
- // with a conceptual B to IBB after that, which never actually exists.
- // With those changes, we see whether the predecessors' tails match,
- // and merge them if so. We change things out of canonical form and
- // back to the way they were later in the process. (OptimizeBranches
- // would undo some of this, but we can't use it, because we'd get into
- // a compile-time infinite loop repeatedly doing and undoing the same
- // transformations.)
-
- for (MachineFunction::iterator I = MF.begin(), E = MF.end(); I != E; ++I) {
- if (!I->succ_empty() && I->pred_size() >= 2 &&
- I->pred_size() < TailMergeThreshold) {
- MachineBasicBlock *IBB = I;
- MachineBasicBlock *PredBB = prior(I);
- MergePotentials.clear();
- for (MachineBasicBlock::pred_iterator P = I->pred_begin(),
- E2 = I->pred_end();
- P != E2; ++P) {
- MachineBasicBlock* PBB = *P;
- // Skip blocks that loop to themselves, can't tail merge these.
- if (PBB==IBB)
- continue;
- MachineBasicBlock *TBB = 0, *FBB = 0;
- std::vector<MachineOperand> Cond;
- if (!TII->AnalyzeBranch(*PBB, TBB, FBB, Cond)) {
- // Failing case: IBB is the target of a cbr, and
- // we cannot reverse the branch.
- std::vector<MachineOperand> NewCond(Cond);
- if (!Cond.empty() && TBB==IBB) {
- if (TII->ReverseBranchCondition(NewCond))
- continue;
- // This is the QBB case described above
- if (!FBB)
- FBB = next(MachineFunction::iterator(PBB));
- }
- // Failing case: the only way IBB can be reached from PBB is via
- // exception handling. Happens for landing pads. Would be nice
- // to have a bit in the edge so we didn't have to do all this.
- if (IBB->isLandingPad()) {
- MachineFunction::iterator IP = PBB; IP++;
- MachineBasicBlock* PredNextBB = NULL;
- if (IP!=MF.end())
- PredNextBB = IP;
- if (TBB==NULL) {
- if (IBB!=PredNextBB) // fallthrough
- continue;
- } else if (FBB) {
- if (TBB!=IBB && FBB!=IBB) // cbr then ubr
- continue;
- } else if (Cond.empty()) {
- if (TBB!=IBB) // ubr
- continue;
- } else {
- if (TBB!=IBB && IBB!=PredNextBB) // cbr
- continue;
- }
- }
- // Remove the unconditional branch at the end, if any.
- if (TBB && (Cond.empty() || FBB)) {
- TII->RemoveBranch(*PBB);
- if (!Cond.empty())
- // reinsert conditional branch only, for now
- TII->InsertBranch(*PBB, (TBB==IBB) ? FBB : TBB, 0, NewCond);
- }
- MergePotentials.push_back(std::make_pair(HashEndOfMBB(PBB, 1U), *P));
- }
- }
- if (MergePotentials.size() >= 2)
- MadeChange |= TryMergeBlocks(I, PredBB);
- // Reinsert an unconditional branch if needed.
- // The 1 below can be either an original single predecessor, or a result
- // of removing blocks in TryMergeBlocks.
- PredBB = prior(I); // this may have been changed in TryMergeBlocks
- if (MergePotentials.size()==1 &&
- (MergePotentials.begin())->second != PredBB)
- FixTail((MergePotentials.begin())->second, I, TII);
- }
- }
- return MadeChange;
-}
-
-//===----------------------------------------------------------------------===//
-// Branch Optimization
-//===----------------------------------------------------------------------===//
-
-bool BranchFolder::OptimizeBranches(MachineFunction &MF) {
- MadeChange = false;
-
- // Make sure blocks are numbered in order
- MF.RenumberBlocks();
-
- for (MachineFunction::iterator I = ++MF.begin(), E = MF.end(); I != E; ) {
- MachineBasicBlock *MBB = I++;
- OptimizeBlock(MBB);
-
- // If it is dead, remove it.
- if (MBB->pred_empty()) {
- RemoveDeadBlock(MBB);
- MadeChange = true;
- ++NumDeadBlocks;
- }
- }
- return MadeChange;
-}
-
-
-/// CanFallThrough - Return true if the specified block (with the specified
-/// branch condition) can implicitly transfer control to the block after it by
-/// falling off the end of it. This should return false if it can reach the
-/// block after it, but it uses an explicit branch to do so (e.g. a table jump).
-///
-/// True is a conservative answer.
-///
-bool BranchFolder::CanFallThrough(MachineBasicBlock *CurBB,
- bool BranchUnAnalyzable,
- MachineBasicBlock *TBB, MachineBasicBlock *FBB,
- const std::vector<MachineOperand> &Cond) {
- MachineFunction::iterator Fallthrough = CurBB;
- ++Fallthrough;
- // If FallthroughBlock is off the end of the function, it can't fall through.
- if (Fallthrough == CurBB->getParent()->end())
- return false;
-
- // If FallthroughBlock isn't a successor of CurBB, no fallthrough is possible.
- if (!CurBB->isSuccessor(Fallthrough))
- return false;
-
- // If we couldn't analyze the branch, assume it could fall through.
- if (BranchUnAnalyzable) return true;
-
- // If there is no branch, control always falls through.
- if (TBB == 0) return true;
-
- // If there is some explicit branch to the fallthrough block, it can obviously
- // reach, even though the branch should get folded to fall through implicitly.
- if (MachineFunction::iterator(TBB) == Fallthrough ||
- MachineFunction::iterator(FBB) == Fallthrough)
- return true;
-
- // If it's an unconditional branch to some block not the fall through, it
- // doesn't fall through.
- if (Cond.empty()) return false;
-
- // Otherwise, if it is conditional and has no explicit false block, it falls
- // through.
- return FBB == 0;
-}
-
-/// CanFallThrough - Return true if the specified can implicitly transfer
-/// control to the block after it by falling off the end of it. This should
-/// return false if it can reach the block after it, but it uses an explicit
-/// branch to do so (e.g. a table jump).
-///
-/// True is a conservative answer.
-///
-bool BranchFolder::CanFallThrough(MachineBasicBlock *CurBB) {
- MachineBasicBlock *TBB = 0, *FBB = 0;
- std::vector<MachineOperand> Cond;
- bool CurUnAnalyzable = TII->AnalyzeBranch(*CurBB, TBB, FBB, Cond);
- return CanFallThrough(CurBB, CurUnAnalyzable, TBB, FBB, Cond);
-}
-
-/// IsBetterFallthrough - Return true if it would be clearly better to
-/// fall-through to MBB1 than to fall through into MBB2. This has to return
-/// a strict ordering, returning true for both (MBB1,MBB2) and (MBB2,MBB1) will
-/// result in infinite loops.
-static bool IsBetterFallthrough(MachineBasicBlock *MBB1,
- MachineBasicBlock *MBB2) {
- // Right now, we use a simple heuristic. If MBB2 ends with a call, and
- // MBB1 doesn't, we prefer to fall through into MBB1. This allows us to
- // optimize branches that branch to either a return block or an assert block
- // into a fallthrough to the return.
- if (MBB1->empty() || MBB2->empty()) return false;
-
- // If there is a clear successor ordering we make sure that one block
- // will fall through to the next
- if (MBB1->isSuccessor(MBB2)) return true;
- if (MBB2->isSuccessor(MBB1)) return false;
-
- MachineInstr *MBB1I = --MBB1->end();
- MachineInstr *MBB2I = --MBB2->end();
- return MBB2I->getDesc().isCall() && !MBB1I->getDesc().isCall();
-}
-
-/// OptimizeBlock - Analyze and optimize control flow related to the specified
-/// block. This is never called on the entry block.
-void BranchFolder::OptimizeBlock(MachineBasicBlock *MBB) {
- MachineFunction::iterator FallThrough = MBB;
- ++FallThrough;
-
- // If this block is empty, make everyone use its fall-through, not the block
- // explicitly. Landing pads should not do this since the landing-pad table
- // points to this block.
- if (MBB->empty() && !MBB->isLandingPad()) {
- // Dead block? Leave for cleanup later.
- if (MBB->pred_empty()) return;
-
- if (FallThrough == MBB->getParent()->end()) {
- // TODO: Simplify preds to not branch here if possible!
- } else {
- // Rewrite all predecessors of the old block to go to the fallthrough
- // instead.
- while (!MBB->pred_empty()) {
- MachineBasicBlock *Pred = *(MBB->pred_end()-1);
- Pred->ReplaceUsesOfBlockWith(MBB, FallThrough);
- }
-
- // If MBB was the target of a jump table, update jump tables to go to the
- // fallthrough instead.
- MBB->getParent()->getJumpTableInfo()->
- ReplaceMBBInJumpTables(MBB, FallThrough);
- MadeChange = true;
- }
- return;
- }
-
- // Check to see if we can simplify the terminator of the block before this
- // one.
- MachineBasicBlock &PrevBB = *prior(MachineFunction::iterator(MBB));
-
- MachineBasicBlock *PriorTBB = 0, *PriorFBB = 0;
- std::vector<MachineOperand> PriorCond;
- bool PriorUnAnalyzable =
- TII->AnalyzeBranch(PrevBB, PriorTBB, PriorFBB, PriorCond);
- if (!PriorUnAnalyzable) {
- // If the CFG for the prior block has extra edges, remove them.
- MadeChange |= PrevBB.CorrectExtraCFGEdges(PriorTBB, PriorFBB,
- !PriorCond.empty());
-
- // If the previous branch is conditional and both conditions go to the same
- // destination, remove the branch, replacing it with an unconditional one or
- // a fall-through.
- if (PriorTBB && PriorTBB == PriorFBB) {
- TII->RemoveBranch(PrevBB);
- PriorCond.clear();
- if (PriorTBB != MBB)
- TII->InsertBranch(PrevBB, PriorTBB, 0, PriorCond);
- MadeChange = true;
- ++NumBranchOpts;
- return OptimizeBlock(MBB);
- }
-
- // If the previous branch *only* branches to *this* block (conditional or
- // not) remove the branch.
- if (PriorTBB == MBB && PriorFBB == 0) {
- TII->RemoveBranch(PrevBB);
- MadeChange = true;
- ++NumBranchOpts;
- return OptimizeBlock(MBB);
- }
-
- // If the prior block branches somewhere else on the condition and here if
- // the condition is false, remove the uncond second branch.
- if (PriorFBB == MBB) {
- TII->RemoveBranch(PrevBB);
- TII->InsertBranch(PrevBB, PriorTBB, 0, PriorCond);
- MadeChange = true;
- ++NumBranchOpts;
- return OptimizeBlock(MBB);
- }
-
- // If the prior block branches here on true and somewhere else on false, and
- // if the branch condition is reversible, reverse the branch to create a
- // fall-through.
- if (PriorTBB == MBB) {
- std::vector<MachineOperand> NewPriorCond(PriorCond);
- if (!TII->ReverseBranchCondition(NewPriorCond)) {
- TII->RemoveBranch(PrevBB);
- TII->InsertBranch(PrevBB, PriorFBB, 0, NewPriorCond);
- MadeChange = true;
- ++NumBranchOpts;
- return OptimizeBlock(MBB);
- }
- }
-
- // If this block doesn't fall through (e.g. it ends with an uncond branch or
- // has no successors) and if the pred falls through into this block, and if
- // it would otherwise fall through into the block after this, move this
- // block to the end of the function.
- //
- // We consider it more likely that execution will stay in the function (e.g.
- // due to loops) than it is to exit it. This asserts in loops etc, moving
- // the assert condition out of the loop body.
- if (!PriorCond.empty() && PriorFBB == 0 &&
- MachineFunction::iterator(PriorTBB) == FallThrough &&
- !CanFallThrough(MBB)) {
- bool DoTransform = true;
-
- // We have to be careful that the succs of PredBB aren't both no-successor
- // blocks. If neither have successors and if PredBB is the second from
- // last block in the function, we'd just keep swapping the two blocks for
- // last. Only do the swap if one is clearly better to fall through than
- // the other.
- if (FallThrough == --MBB->getParent()->end() &&
- !IsBetterFallthrough(PriorTBB, MBB))
- DoTransform = false;
-
- // We don't want to do this transformation if we have control flow like:
- // br cond BB2
- // BB1:
- // ..
- // jmp BBX
- // BB2:
- // ..
- // ret
- //
- // In this case, we could actually be moving the return block *into* a
- // loop!
- if (DoTransform && !MBB->succ_empty() &&
- (!CanFallThrough(PriorTBB) || PriorTBB->empty()))
- DoTransform = false;
-
-
- if (DoTransform) {
- // Reverse the branch so we will fall through on the previous true cond.
- std::vector<MachineOperand> NewPriorCond(PriorCond);
- if (!TII->ReverseBranchCondition(NewPriorCond)) {
- DOUT << "\nMoving MBB: " << *MBB;
- DOUT << "To make fallthrough to: " << *PriorTBB << "\n";
-
- TII->RemoveBranch(PrevBB);
- TII->InsertBranch(PrevBB, MBB, 0, NewPriorCond);
-
- // Move this block to the end of the function.
- MBB->moveAfter(--MBB->getParent()->end());
- MadeChange = true;
- ++NumBranchOpts;
- return;
- }
- }
- }
- }
-
- // Analyze the branch in the current block.
- MachineBasicBlock *CurTBB = 0, *CurFBB = 0;
- std::vector<MachineOperand> CurCond;
- bool CurUnAnalyzable = TII->AnalyzeBranch(*MBB, CurTBB, CurFBB, CurCond);
- if (!CurUnAnalyzable) {
- // If the CFG for the prior block has extra edges, remove them.
- MadeChange |= MBB->CorrectExtraCFGEdges(CurTBB, CurFBB, !CurCond.empty());
-
- // If this is a two-way branch, and the FBB branches to this block, reverse
- // the condition so the single-basic-block loop is faster. Instead of:
- // Loop: xxx; jcc Out; jmp Loop
- // we want:
- // Loop: xxx; jncc Loop; jmp Out
- if (CurTBB && CurFBB && CurFBB == MBB && CurTBB != MBB) {
- std::vector<MachineOperand> NewCond(CurCond);
- if (!TII->ReverseBranchCondition(NewCond)) {
- TII->RemoveBranch(*MBB);
- TII->InsertBranch(*MBB, CurFBB, CurTBB, NewCond);
- MadeChange = true;
- ++NumBranchOpts;
- return OptimizeBlock(MBB);
- }
- }
-
-
- // If this branch is the only thing in its block, see if we can forward
- // other blocks across it.
- if (CurTBB && CurCond.empty() && CurFBB == 0 &&
- MBB->begin()->getDesc().isBranch() && CurTBB != MBB) {
- // This block may contain just an unconditional branch. Because there can
- // be 'non-branch terminators' in the block, try removing the branch and
- // then seeing if the block is empty.
- TII->RemoveBranch(*MBB);
-
- // If this block is just an unconditional branch to CurTBB, we can
- // usually completely eliminate the block. The only case we cannot
- // completely eliminate the block is when the block before this one
- // falls through into MBB and we can't understand the prior block's branch
- // condition.
- if (MBB->empty()) {
- bool PredHasNoFallThrough = TII->BlockHasNoFallThrough(PrevBB);
- if (PredHasNoFallThrough || !PriorUnAnalyzable ||
- !PrevBB.isSuccessor(MBB)) {
- // If the prior block falls through into us, turn it into an
- // explicit branch to us to make updates simpler.
- if (!PredHasNoFallThrough && PrevBB.isSuccessor(MBB) &&
- PriorTBB != MBB && PriorFBB != MBB) {
- if (PriorTBB == 0) {
- assert(PriorCond.empty() && PriorFBB == 0 &&
- "Bad branch analysis");
- PriorTBB = MBB;
- } else {
- assert(PriorFBB == 0 && "Machine CFG out of date!");
- PriorFBB = MBB;
- }
- TII->RemoveBranch(PrevBB);
- TII->InsertBranch(PrevBB, PriorTBB, PriorFBB, PriorCond);
- }
-
- // Iterate through all the predecessors, revectoring each in-turn.
- size_t PI = 0;
- bool DidChange = false;
- bool HasBranchToSelf = false;
- while(PI != MBB->pred_size()) {
- MachineBasicBlock *PMBB = *(MBB->pred_begin() + PI);
- if (PMBB == MBB) {
- // If this block has an uncond branch to itself, leave it.
- ++PI;
- HasBranchToSelf = true;
- } else {
- DidChange = true;
- PMBB->ReplaceUsesOfBlockWith(MBB, CurTBB);
- }
- }
-
- // Change any jumptables to go to the new MBB.
- MBB->getParent()->getJumpTableInfo()->
- ReplaceMBBInJumpTables(MBB, CurTBB);
- if (DidChange) {
- ++NumBranchOpts;
- MadeChange = true;
- if (!HasBranchToSelf) return;
- }
- }
- }
-
- // Add the branch back if the block is more than just an uncond branch.
- TII->InsertBranch(*MBB, CurTBB, 0, CurCond);
- }
- }
-
- // If the prior block doesn't fall through into this block, and if this
- // block doesn't fall through into some other block, see if we can find a
- // place to move this block where a fall-through will happen.
- if (!CanFallThrough(&PrevBB, PriorUnAnalyzable,
- PriorTBB, PriorFBB, PriorCond)) {
- // Now we know that there was no fall-through into this block, check to
- // see if it has a fall-through into its successor.
- bool CurFallsThru = CanFallThrough(MBB, CurUnAnalyzable, CurTBB, CurFBB,
- CurCond);
-
- if (!MBB->isLandingPad()) {
- // Check all the predecessors of this block. If one of them has no fall
- // throughs, move this block right after it.
- for (MachineBasicBlock::pred_iterator PI = MBB->pred_begin(),
- E = MBB->pred_end(); PI != E; ++PI) {
- // Analyze the branch at the end of the pred.
- MachineBasicBlock *PredBB = *PI;
- MachineFunction::iterator PredFallthrough = PredBB; ++PredFallthrough;
- if (PredBB != MBB && !CanFallThrough(PredBB)
- && (!CurFallsThru || !CurTBB || !CurFBB)
- && (!CurFallsThru || MBB->getNumber() >= PredBB->getNumber())) {
- // If the current block doesn't fall through, just move it.
- // If the current block can fall through and does not end with a
- // conditional branch, we need to append an unconditional jump to
- // the (current) next block. To avoid a possible compile-time
- // infinite loop, move blocks only backward in this case.
- // Also, if there are already 2 branches here, we cannot add a third;
- // this means we have the case
- // Bcc next
- // B elsewhere
- // next:
- if (CurFallsThru) {
- MachineBasicBlock *NextBB = next(MachineFunction::iterator(MBB));
- CurCond.clear();
- TII->InsertBranch(*MBB, NextBB, 0, CurCond);
- }
- MBB->moveAfter(PredBB);
- MadeChange = true;
- return OptimizeBlock(MBB);
- }
- }
- }
-
- if (!CurFallsThru) {
- // Check all successors to see if we can move this block before it.
- for (MachineBasicBlock::succ_iterator SI = MBB->succ_begin(),
- E = MBB->succ_end(); SI != E; ++SI) {
- // Analyze the branch at the end of the block before the succ.
- MachineBasicBlock *SuccBB = *SI;
- MachineFunction::iterator SuccPrev = SuccBB; --SuccPrev;
- std::vector<MachineOperand> SuccPrevCond;
-
- // If this block doesn't already fall-through to that successor, and if
- // the succ doesn't already have a block that can fall through into it,
- // and if the successor isn't an EH destination, we can arrange for the
- // fallthrough to happen.
- if (SuccBB != MBB && !CanFallThrough(SuccPrev) &&
- !SuccBB->isLandingPad()) {
- MBB->moveBefore(SuccBB);
- MadeChange = true;
- return OptimizeBlock(MBB);
- }
- }
-
- // Okay, there is no really great place to put this block. If, however,
- // the block before this one would be a fall-through if this block were
- // removed, move this block to the end of the function.
- if (FallThrough != MBB->getParent()->end() &&
- PrevBB.isSuccessor(FallThrough)) {
- MBB->moveAfter(--MBB->getParent()->end());
- MadeChange = true;
- return;
- }
- }
- }
-}
diff --git a/release_23/lib/CodeGen/Collector.cpp b/release_23/lib/CodeGen/Collector.cpp
deleted file mode 100644
index 6c5263d73e3b..000000000000
--- a/release_23/lib/CodeGen/Collector.cpp
+++ /dev/null
@@ -1,400 +0,0 @@
-//===-- Collector.cpp - Garbage collection infrastructure -----------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements target- and collector-independent garbage collection
-// infrastructure.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/CodeGen/Collector.h"
-#include "llvm/CodeGen/Passes.h"
-#include "llvm/IntrinsicInst.h"
-#include "llvm/Module.h"
-#include "llvm/PassManager.h"
-#include "llvm/ADT/SmallPtrSet.h"
-#include "llvm/CodeGen/MachineFrameInfo.h"
-#include "llvm/CodeGen/MachineFunctionPass.h"
-#include "llvm/CodeGen/MachineInstrBuilder.h"
-#include "llvm/CodeGen/MachineModuleInfo.h"
-#include "llvm/Target/TargetFrameInfo.h"
-#include "llvm/Target/TargetInstrInfo.h"
-#include "llvm/Target/TargetMachine.h"
-#include "llvm/Support/Compiler.h"
-
-using namespace llvm;
-
-namespace {
-
- /// LowerIntrinsics - This pass rewrites calls to the llvm.gcread or
- /// llvm.gcwrite intrinsics, replacing them with simple loads and stores as
- /// directed by the Collector. It also performs automatic root initialization
- /// and custom intrinsic lowering.
- class VISIBILITY_HIDDEN LowerIntrinsics : public FunctionPass {
- static bool NeedsDefaultLoweringPass(const Collector &C);
- static bool NeedsCustomLoweringPass(const Collector &C);
- static bool CouldBecomeSafePoint(Instruction *I);
- bool PerformDefaultLowering(Function &F, Collector &Coll);
- static bool InsertRootInitializers(Function &F,
- AllocaInst **Roots, unsigned Count);
-
- public:
- static char ID;
-
- LowerIntrinsics();
- const char *getPassName() const;
- void getAnalysisUsage(AnalysisUsage &AU) const;
-
- bool doInitialization(Module &M);
- bool runOnFunction(Function &F);
- };
-
-
- /// MachineCodeAnalysis - This is a target-independent pass over the machine
- /// function representation to identify safe points for the garbage collector
- /// in the machine code. It inserts labels at safe points and populates a
- /// CollectorMetadata record for each function.
- class VISIBILITY_HIDDEN MachineCodeAnalysis : public MachineFunctionPass {
- const TargetMachine *TM;
- CollectorMetadata *MD;
- MachineModuleInfo *MMI;
- const TargetInstrInfo *TII;
- MachineFrameInfo *MFI;
-
- void FindSafePoints(MachineFunction &MF);
- void VisitCallPoint(MachineBasicBlock::iterator MI);
- unsigned InsertLabel(MachineBasicBlock &MBB,
- MachineBasicBlock::iterator MI) const;
-
- void FindStackOffsets(MachineFunction &MF);
-
- public:
- static char ID;
-
- MachineCodeAnalysis();
- const char *getPassName() const;
- void getAnalysisUsage(AnalysisUsage &AU) const;
-
- bool runOnMachineFunction(MachineFunction &MF);
- };
-
-}
-
-// -----------------------------------------------------------------------------
-
-Collector::Collector() :
- NeededSafePoints(0),
- CustomReadBarriers(false),
- CustomWriteBarriers(false),
- CustomRoots(false),
- InitRoots(true)
-{}
-
-Collector::~Collector() {
- for (iterator I = begin(), E = end(); I != E; ++I)
- delete *I;
-
- Functions.clear();
-}
-
-bool Collector::initializeCustomLowering(Module &M) { return false; }
-
-bool Collector::performCustomLowering(Function &F) {
- cerr << "gc " << getName() << " must override performCustomLowering.\n";
- abort();
- return 0;
-}
-
-void Collector::beginAssembly(std::ostream &OS, AsmPrinter &AP,
- const TargetAsmInfo &TAI) {
- // Default is no action.
-}
-
-void Collector::finishAssembly(std::ostream &OS, AsmPrinter &AP,
- const TargetAsmInfo &TAI) {
- // Default is no action.
-}
-
-CollectorMetadata *Collector::insertFunctionMetadata(const Function &F) {
- CollectorMetadata *CM = new CollectorMetadata(F, *this);
- Functions.push_back(CM);
- return CM;
-}
-
-// -----------------------------------------------------------------------------
-
-FunctionPass *llvm::createGCLoweringPass() {
- return new LowerIntrinsics();
-}
-
-char LowerIntrinsics::ID = 0;
-
-LowerIntrinsics::LowerIntrinsics()
- : FunctionPass((intptr_t)&ID) {}
-
-const char *LowerIntrinsics::getPassName() const {
- return "Lower Garbage Collection Instructions";
-}
-
-void LowerIntrinsics::getAnalysisUsage(AnalysisUsage &AU) const {
- FunctionPass::getAnalysisUsage(AU);
- AU.addRequired<CollectorModuleMetadata>();
-}
-
-/// doInitialization - If this module uses the GC intrinsics, find them now.
-bool LowerIntrinsics::doInitialization(Module &M) {
- // FIXME: This is rather antisocial in the context of a JIT since it performs
- // work against the entire module. But this cannot be done at
- // runFunction time (initializeCustomLowering likely needs to change
- // the module).
- CollectorModuleMetadata *CMM = getAnalysisToUpdate<CollectorModuleMetadata>();
- assert(CMM && "LowerIntrinsics didn't require CollectorModuleMetadata!?");
- for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I)
- if (I->hasCollector())
- CMM->get(*I); // Instantiate the Collector.
-
- bool MadeChange = false;
- for (CollectorModuleMetadata::iterator I = CMM->begin(),
- E = CMM->end(); I != E; ++I)
- if (NeedsCustomLoweringPass(**I))
- if ((*I)->initializeCustomLowering(M))
- MadeChange = true;
-
- return MadeChange;
-}
-
-bool LowerIntrinsics::InsertRootInitializers(Function &F, AllocaInst **Roots,
- unsigned Count) {
- // Scroll past alloca instructions.
- BasicBlock::iterator IP = F.getEntryBlock().begin();
- while (isa<AllocaInst>(IP)) ++IP;
-
- // Search for initializers in the initial BB.
- SmallPtrSet<AllocaInst*,16> InitedRoots;
- for (; !CouldBecomeSafePoint(IP); ++IP)
- if (StoreInst *SI = dyn_cast<StoreInst>(IP))
- if (AllocaInst *AI =
- dyn_cast<AllocaInst>(SI->getOperand(1)->stripPointerCasts()))
- InitedRoots.insert(AI);
-
- // Add root initializers.
- bool MadeChange = false;
-
- for (AllocaInst **I = Roots, **E = Roots + Count; I != E; ++I)
- if (!InitedRoots.count(*I)) {
- new StoreInst(ConstantPointerNull::get(cast<PointerType>(
- cast<PointerType>((*I)->getType())->getElementType())),
- *I, IP);
- MadeChange = true;
- }
-
- return MadeChange;
-}
-
-bool LowerIntrinsics::NeedsDefaultLoweringPass(const Collector &C) {
- // Default lowering is necessary only if read or write barriers have a default
- // action. The default for roots is no action.
- return !C.customWriteBarrier()
- || !C.customReadBarrier()
- || C.initializeRoots();
-}
-
-bool LowerIntrinsics::NeedsCustomLoweringPass(const Collector &C) {
- // Custom lowering is only necessary if enabled for some action.
- return C.customWriteBarrier()
- || C.customReadBarrier()
- || C.customRoots();
-}
-
-/// CouldBecomeSafePoint - Predicate to conservatively determine whether the
-/// instruction could introduce a safe point.
-bool LowerIntrinsics::CouldBecomeSafePoint(Instruction *I) {
- // The natural definition of instructions which could introduce safe points
- // are:
- //
- // - call, invoke (AfterCall, BeforeCall)
- // - phis (Loops)
- // - invoke, ret, unwind (Exit)
- //
- // However, instructions as seemingly inoccuous as arithmetic can become
- // libcalls upon lowering (e.g., div i64 on a 32-bit platform), so instead
- // it is necessary to take a conservative approach.
-
- if (isa<AllocaInst>(I) || isa<GetElementPtrInst>(I) ||
- isa<StoreInst>(I) || isa<LoadInst>(I))
- return false;
-
- // llvm.gcroot is safe because it doesn't do anything at runtime.
- if (CallInst *CI = dyn_cast<CallInst>(I))
- if (Function *F = CI->getCalledFunction())
- if (unsigned IID = F->getIntrinsicID())
- if (IID == Intrinsic::gcroot)
- return false;
-
- return true;
-}
-
-/// runOnFunction - Replace gcread/gcwrite intrinsics with loads and stores.
-/// Leave gcroot intrinsics; the code generator needs to see those.
-bool LowerIntrinsics::runOnFunction(Function &F) {
- // Quick exit for functions that do not use GC.
- if (!F.hasCollector()) return false;
-
- CollectorMetadata &MD = getAnalysis<CollectorModuleMetadata>().get(F);
- Collector &Coll = MD.getCollector();
-
- bool MadeChange = false;
-
- if (NeedsDefaultLoweringPass(Coll))
- MadeChange |= PerformDefaultLowering(F, Coll);
-
- if (NeedsCustomLoweringPass(Coll))
- MadeChange |= Coll.performCustomLowering(F);
-
- return MadeChange;
-}
-
-bool LowerIntrinsics::PerformDefaultLowering(Function &F, Collector &Coll) {
- bool LowerWr = !Coll.customWriteBarrier();
- bool LowerRd = !Coll.customReadBarrier();
- bool InitRoots = Coll.initializeRoots();
-
- SmallVector<AllocaInst*,32> Roots;
-
- bool MadeChange = false;
- for (Function::iterator BB = F.begin(), E = F.end(); BB != E; ++BB) {
- for (BasicBlock::iterator II = BB->begin(), E = BB->end(); II != E;) {
- if (IntrinsicInst *CI = dyn_cast<IntrinsicInst>(II++)) {
- Function *F = CI->getCalledFunction();
- switch (F->getIntrinsicID()) {
- case Intrinsic::gcwrite:
- if (LowerWr) {
- // Replace a write barrier with a simple store.
- Value *St = new StoreInst(CI->getOperand(1), CI->getOperand(3), CI);
- CI->replaceAllUsesWith(St);
- CI->eraseFromParent();
- }
- break;
- case Intrinsic::gcread:
- if (LowerRd) {
- // Replace a read barrier with a simple load.
- Value *Ld = new LoadInst(CI->getOperand(2), "", CI);
- Ld->takeName(CI);
- CI->replaceAllUsesWith(Ld);
- CI->eraseFromParent();
- }
- break;
- case Intrinsic::gcroot:
- if (InitRoots) {
- // Initialize the GC root, but do not delete the intrinsic. The
- // backend needs the intrinsic to flag the stack slot.
- Roots.push_back(cast<AllocaInst>(
- CI->getOperand(1)->stripPointerCasts()));
- }
- break;
- default:
- continue;
- }
-
- MadeChange = true;
- }
- }
- }
-
- if (Roots.size())
- MadeChange |= InsertRootInitializers(F, Roots.begin(), Roots.size());
-
- return MadeChange;
-}
-
-// -----------------------------------------------------------------------------
-
-FunctionPass *llvm::createGCMachineCodeAnalysisPass() {
- return new MachineCodeAnalysis();
-}
-
-char MachineCodeAnalysis::ID = 0;
-
-MachineCodeAnalysis::MachineCodeAnalysis()
- : MachineFunctionPass(intptr_t(&ID)) {}
-
-const char *MachineCodeAnalysis::getPassName() const {
- return "Analyze Machine Code For Garbage Collection";
-}
-
-void MachineCodeAnalysis::getAnalysisUsage(AnalysisUsage &AU) const {
- MachineFunctionPass::getAnalysisUsage(AU);
- AU.setPreservesAll();
- AU.addRequired<MachineModuleInfo>();
- AU.addRequired<CollectorModuleMetadata>();
-}
-
-unsigned MachineCodeAnalysis::InsertLabel(MachineBasicBlock &MBB,
- MachineBasicBlock::iterator MI) const {
- unsigned Label = MMI->NextLabelID();
- BuildMI(MBB, MI, TII->get(TargetInstrInfo::LABEL)).addImm(Label).addImm(2);
- return Label;
-}
-
-void MachineCodeAnalysis::VisitCallPoint(MachineBasicBlock::iterator CI) {
- // Find the return address (next instruction), too, so as to bracket the call
- // instruction.
- MachineBasicBlock::iterator RAI = CI;
- ++RAI;
-
- if (MD->getCollector().needsSafePoint(GC::PreCall))
- MD->addSafePoint(GC::PreCall, InsertLabel(*CI->getParent(), CI));
-
- if (MD->getCollector().needsSafePoint(GC::PostCall))
- MD->addSafePoint(GC::PostCall, InsertLabel(*CI->getParent(), RAI));
-}
-
-void MachineCodeAnalysis::FindSafePoints(MachineFunction &MF) {
- for (MachineFunction::iterator BBI = MF.begin(),
- BBE = MF.end(); BBI != BBE; ++BBI)
- for (MachineBasicBlock::iterator MI = BBI->begin(),
- ME = BBI->end(); MI != ME; ++MI)
- if (MI->getDesc().isCall())
- VisitCallPoint(*MI);
-}
-
-void MachineCodeAnalysis::FindStackOffsets(MachineFunction &MF) {
- uint64_t StackSize = MFI->getStackSize();
- uint64_t OffsetAdjustment = MFI->getOffsetAdjustment();
- uint64_t OffsetOfLocalArea = TM->getFrameInfo()->getOffsetOfLocalArea();
-
- for (CollectorMetadata::roots_iterator RI = MD->roots_begin(),
- RE = MD->roots_end(); RI != RE; ++RI)
- RI->StackOffset = MFI->getObjectOffset(RI->Num) + StackSize
- - OffsetOfLocalArea + OffsetAdjustment;
-}
-
-bool MachineCodeAnalysis::runOnMachineFunction(MachineFunction &MF) {
- // Quick exit for functions that do not use GC.
- if (!MF.getFunction()->hasCollector()) return false;
-
- MD = &getAnalysis<CollectorModuleMetadata>().get(*MF.getFunction());
- if (!MD->getCollector().needsSafePoints())
- return false;
-
- TM = &MF.getTarget();
- MMI = &getAnalysis<MachineModuleInfo>();
- TII = TM->getInstrInfo();
- MFI = MF.getFrameInfo();
-
- // Find the size of the stack frame.
- MD->setFrameSize(MFI->getStackSize());
-
- // Find all safe points.
- FindSafePoints(MF);
-
- // Find the stack offsets for all roots.
- FindStackOffsets(MF);
-
- return false;
-}
diff --git a/release_23/lib/CodeGen/CollectorMetadata.cpp b/release_23/lib/CodeGen/CollectorMetadata.cpp
deleted file mode 100644
index 80085cd29de1..000000000000
--- a/release_23/lib/CodeGen/CollectorMetadata.cpp
+++ /dev/null
@@ -1,215 +0,0 @@
-//===-- CollectorMetadata.cpp - Garbage collector metadata ----------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the CollectorMetadata and CollectorModuleMetadata
-// classes.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/CodeGen/CollectorMetadata.h"
-#include "llvm/CodeGen/Collector.h"
-#include "llvm/CodeGen/Collectors.h"
-#include "llvm/CodeGen/MachineFrameInfo.h"
-#include "llvm/Pass.h"
-#include "llvm/CodeGen/Passes.h"
-#include "llvm/Function.h"
-#include "llvm/Support/Compiler.h"
-
-using namespace llvm;
-
-namespace {
-
- class VISIBILITY_HIDDEN Printer : public FunctionPass {
- static char ID;
- std::ostream &OS;
-
- public:
- explicit Printer(std::ostream &OS = *cerr);
-
- const char *getPassName() const;
- void getAnalysisUsage(AnalysisUsage &AU) const;
-
- bool runOnFunction(Function &F);
- };
-
- class VISIBILITY_HIDDEN Deleter : public FunctionPass {
- static char ID;
-
- public:
- Deleter();
-
- const char *getPassName() const;
- void getAnalysisUsage(AnalysisUsage &AU) const;
-
- bool runOnFunction(Function &F);
- bool doFinalization(Module &M);
- };
-
- RegisterPass<CollectorModuleMetadata>
- X("collector-metadata", "Create Garbage Collector Module Metadata");
-
-}
-
-// -----------------------------------------------------------------------------
-
-CollectorMetadata::CollectorMetadata(const Function &F, Collector &C)
- : F(F), C(C), FrameSize(~0LL) {}
-
-CollectorMetadata::~CollectorMetadata() {}
-
-// -----------------------------------------------------------------------------
-
-char CollectorModuleMetadata::ID = 0;
-
-CollectorModuleMetadata::CollectorModuleMetadata()
- : ImmutablePass((intptr_t)&ID) {}
-
-CollectorModuleMetadata::~CollectorModuleMetadata() {
- clear();
-}
-
-Collector *CollectorModuleMetadata::
-getOrCreateCollector(const Module *M, const std::string &Name) {
- const char *Start = Name.c_str();
-
- collector_map_type::iterator NMI = NameMap.find(Start, Start + Name.size());
- if (NMI != NameMap.end())
- return NMI->getValue();
-
- for (CollectorRegistry::iterator I = CollectorRegistry::begin(),
- E = CollectorRegistry::end(); I != E; ++I) {
- if (strcmp(Start, I->getName()) == 0) {
- Collector *C = I->instantiate();
- C->M = M;
- C->Name = Name;
- NameMap.GetOrCreateValue(Start, Start + Name.size()).setValue(C);
- Collectors.push_back(C);
- return C;
- }
- }
-
- cerr << "unsupported collector: " << Name << "\n";
- abort();
-}
-
-CollectorMetadata &CollectorModuleMetadata::get(const Function &F) {
- assert(F.hasCollector());
- function_map_type::iterator I = Map.find(&F);
- if (I != Map.end())
- return *I->second;
-
- Collector *C = getOrCreateCollector(F.getParent(), F.getCollector());
- CollectorMetadata *MD = C->insertFunctionMetadata(F);
- Map[&F] = MD;
- return *MD;
-}
-
-void CollectorModuleMetadata::clear() {
- Map.clear();
-
- // TODO: StringMap should provide a clear method.
- while (!NameMap.empty())
- NameMap.erase(NameMap.begin());
-
- for (iterator I = begin(), E = end(); I != E; ++I)
- delete *I;
- Collectors.clear();
-}
-
-// -----------------------------------------------------------------------------
-
-char Printer::ID = 0;
-
-FunctionPass *llvm::createCollectorMetadataPrinter(std::ostream &OS) {
- return new Printer(OS);
-}
-
-Printer::Printer(std::ostream &OS)
- : FunctionPass(intptr_t(&ID)), OS(OS) {}
-
-const char *Printer::getPassName() const {
- return "Print Garbage Collector Information";
-}
-
-void Printer::getAnalysisUsage(AnalysisUsage &AU) const {
- FunctionPass::getAnalysisUsage(AU);
- AU.setPreservesAll();
- AU.addRequired<CollectorModuleMetadata>();
-}
-
-static const char *DescKind(GC::PointKind Kind) {
- switch (Kind) {
- default: assert(0 && "Unknown GC point kind");
- case GC::Loop: return "loop";
- case GC::Return: return "return";
- case GC::PreCall: return "pre-call";
- case GC::PostCall: return "post-call";
- }
-}
-
-bool Printer::runOnFunction(Function &F) {
- if (F.hasCollector()) {
- CollectorMetadata *FD = &getAnalysis<CollectorModuleMetadata>().get(F);
-
- OS << "GC roots for " << FD->getFunction().getNameStart() << ":\n";
- for (CollectorMetadata::roots_iterator RI = FD->roots_begin(),
- RE = FD->roots_end();
- RI != RE; ++RI)
- OS << "\t" << RI->Num << "\t" << RI->StackOffset << "[sp]\n";
-
- OS << "GC safe points for " << FD->getFunction().getNameStart() << ":\n";
- for (CollectorMetadata::iterator PI = FD->begin(),
- PE = FD->end(); PI != PE; ++PI) {
-
- OS << "\tlabel " << PI->Num << ": " << DescKind(PI->Kind) << ", live = {";
-
- for (CollectorMetadata::live_iterator RI = FD->live_begin(PI),
- RE = FD->live_end(PI);;) {
- OS << " " << RI->Num;
- if (++RI == RE)
- break;
- OS << ",";
- }
-
- OS << " }\n";
- }
- }
-
- return false;
-}
-
-// -----------------------------------------------------------------------------
-
-char Deleter::ID = 0;
-
-FunctionPass *llvm::createCollectorMetadataDeleter() {
- return new Deleter();
-}
-
-Deleter::Deleter() : FunctionPass(intptr_t(&ID)) {}
-
-const char *Deleter::getPassName() const {
- return "Delete Garbage Collector Information";
-}
-
-void Deleter::getAnalysisUsage(AnalysisUsage &AU) const {
- AU.setPreservesAll();
- AU.addRequired<CollectorModuleMetadata>();
-}
-
-bool Deleter::runOnFunction(Function &MF) {
- return false;
-}
-
-bool Deleter::doFinalization(Module &M) {
- CollectorModuleMetadata *CMM = getAnalysisToUpdate<CollectorModuleMetadata>();
- assert(CMM && "Deleter didn't require CollectorModuleMetadata?!");
- CMM->clear();
- return false;
-}
diff --git a/release_23/lib/CodeGen/Collectors.cpp b/release_23/lib/CodeGen/Collectors.cpp
deleted file mode 100644
index e063d47a9923..000000000000
--- a/release_23/lib/CodeGen/Collectors.cpp
+++ /dev/null
@@ -1,21 +0,0 @@
-//===-- Collectors.cpp - Garbage collector registry -----------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines the static data members of the CollectorRegistry class.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/CodeGen/Collectors.h"
-
-using namespace llvm;
-
-template<> CollectorRegistry::node *CollectorRegistry::Head = 0;
-template<> CollectorRegistry::node *CollectorRegistry::Tail = 0;
-template<> CollectorRegistry::listener *CollectorRegistry::ListenerHead = 0;
-template<> CollectorRegistry::listener *CollectorRegistry::ListenerTail = 0;
diff --git a/release_23/lib/CodeGen/DwarfWriter.cpp b/release_23/lib/CodeGen/DwarfWriter.cpp
deleted file mode 100644
index fc7ba6db0464..000000000000
--- a/release_23/lib/CodeGen/DwarfWriter.cpp
+++ /dev/null
@@ -1,3823 +0,0 @@
-//===-- llvm/CodeGen/DwarfWriter.cpp - Dwarf Framework ----------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains support for writing dwarf info into asm files.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/CodeGen/DwarfWriter.h"
-
-#include "llvm/ADT/DenseMap.h"
-#include "llvm/ADT/FoldingSet.h"
-#include "llvm/ADT/StringExtras.h"
-#include "llvm/ADT/UniqueVector.h"
-#include "llvm/Module.h"
-#include "llvm/Type.h"
-#include "llvm/CodeGen/AsmPrinter.h"
-#include "llvm/CodeGen/MachineModuleInfo.h"
-#include "llvm/CodeGen/MachineFrameInfo.h"
-#include "llvm/CodeGen/MachineLocation.h"
-#include "llvm/Support/Debug.h"
-#include "llvm/Support/Dwarf.h"
-#include "llvm/Support/CommandLine.h"
-#include "llvm/Support/DataTypes.h"
-#include "llvm/Support/Mangler.h"
-#include "llvm/System/Path.h"
-#include "llvm/Target/TargetAsmInfo.h"
-#include "llvm/Target/TargetRegisterInfo.h"
-#include "llvm/Target/TargetData.h"
-#include "llvm/Target/TargetFrameInfo.h"
-#include "llvm/Target/TargetInstrInfo.h"
-#include "llvm/Target/TargetMachine.h"
-#include "llvm/Target/TargetOptions.h"
-#include <ostream>
-#include <string>
-using namespace llvm;
-using namespace llvm::dwarf;
-
-namespace llvm {
-
-//===----------------------------------------------------------------------===//
-
-/// Configuration values for initial hash set sizes (log2).
-///
-static const unsigned InitDiesSetSize = 9; // 512
-static const unsigned InitAbbreviationsSetSize = 9; // 512
-static const unsigned InitValuesSetSize = 9; // 512
-
-//===----------------------------------------------------------------------===//
-/// Forward declarations.
-///
-class DIE;
-class DIEValue;
-
-//===----------------------------------------------------------------------===//
-/// DWLabel - Labels are used to track locations in the assembler file.
-/// Labels appear in the form @verbatim <prefix><Tag><Number> @endverbatim,
-/// where the tag is a category of label (Ex. location) and number is a value
-/// unique in that category.
-class DWLabel {
-public:
- /// Tag - Label category tag. Should always be a staticly declared C string.
- ///
- const char *Tag;
-
- /// Number - Value to make label unique.
- ///
- unsigned Number;
-
- DWLabel(const char *T, unsigned N) : Tag(T), Number(N) {}
-
- void Profile(FoldingSetNodeID &ID) const {
- ID.AddString(std::string(Tag));
- ID.AddInteger(Number);
- }
-
-#ifndef NDEBUG
- void print(std::ostream *O) const {
- if (O) print(*O);
- }
- void print(std::ostream &O) const {
- O << "." << Tag;
- if (Number) O << Number;
- }
-#endif
-};
-
-//===----------------------------------------------------------------------===//
-/// DIEAbbrevData - Dwarf abbreviation data, describes the one attribute of a
-/// Dwarf abbreviation.
-class DIEAbbrevData {
-private:
- /// Attribute - Dwarf attribute code.
- ///
- unsigned Attribute;
-
- /// Form - Dwarf form code.
- ///
- unsigned Form;
-
-public:
- DIEAbbrevData(unsigned A, unsigned F)
- : Attribute(A)
- , Form(F)
- {}
-
- // Accessors.
- unsigned getAttribute() const { return Attribute; }
- unsigned getForm() const { return Form; }
-
- /// Profile - Used to gather unique data for the abbreviation folding set.
- ///
- void Profile(FoldingSetNodeID &ID)const {
- ID.AddInteger(Attribute);
- ID.AddInteger(Form);
- }
-};
-
-//===----------------------------------------------------------------------===//
-/// DIEAbbrev - Dwarf abbreviation, describes the organization of a debug
-/// information object.
-class DIEAbbrev : public FoldingSetNode {
-private:
- /// Tag - Dwarf tag code.
- ///
- unsigned Tag;
-
- /// Unique number for node.
- ///
- unsigned Number;
-
- /// ChildrenFlag - Dwarf children flag.
- ///
- unsigned ChildrenFlag;
-
- /// Data - Raw data bytes for abbreviation.
- ///
- std::vector<DIEAbbrevData> Data;
-
-public:
-
- DIEAbbrev(unsigned T, unsigned C)
- : Tag(T)
- , ChildrenFlag(C)
- , Data()
- {}
- ~DIEAbbrev() {}
-
- // Accessors.
- unsigned getTag() const { return Tag; }
- unsigned getNumber() const { return Number; }
- unsigned getChildrenFlag() const { return ChildrenFlag; }
- const std::vector<DIEAbbrevData> &getData() const { return Data; }
- void setTag(unsigned T) { Tag = T; }
- void setChildrenFlag(unsigned CF) { ChildrenFlag = CF; }
- void setNumber(unsigned N) { Number = N; }
-
- /// AddAttribute - Adds another set of attribute information to the
- /// abbreviation.
- void AddAttribute(unsigned Attribute, unsigned Form) {
- Data.push_back(DIEAbbrevData(Attribute, Form));
- }
-
- /// AddFirstAttribute - Adds a set of attribute information to the front
- /// of the abbreviation.
- void AddFirstAttribute(unsigned Attribute, unsigned Form) {
- Data.insert(Data.begin(), DIEAbbrevData(Attribute, Form));
- }
-
- /// Profile - Used to gather unique data for the abbreviation folding set.
- ///
- void Profile(FoldingSetNodeID &ID) {
- ID.AddInteger(Tag);
- ID.AddInteger(ChildrenFlag);
-
- // For each attribute description.
- for (unsigned i = 0, N = Data.size(); i < N; ++i)
- Data[i].Profile(ID);
- }
-
- /// Emit - Print the abbreviation using the specified Dwarf writer.
- ///
- void Emit(const DwarfDebug &DD) const;
-
-#ifndef NDEBUG
- void print(std::ostream *O) {
- if (O) print(*O);
- }
- void print(std::ostream &O);
- void dump();
-#endif
-};
-
-//===----------------------------------------------------------------------===//
-/// DIE - A structured debug information entry. Has an abbreviation which
-/// describes it's organization.
-class DIE : public FoldingSetNode {
-protected:
- /// Abbrev - Buffer for constructing abbreviation.
- ///
- DIEAbbrev Abbrev;
-
- /// Offset - Offset in debug info section.
- ///
- unsigned Offset;
-
- /// Size - Size of instance + children.
- ///
- unsigned Size;
-
- /// Children DIEs.
- ///
- std::vector<DIE *> Children;
-
- /// Attributes values.
- ///
- std::vector<DIEValue *> Values;
-
-public:
- explicit DIE(unsigned Tag)
- : Abbrev(Tag, DW_CHILDREN_no)
- , Offset(0)
- , Size(0)
- , Children()
- , Values()
- {}
- virtual ~DIE();
-
- // Accessors.
- DIEAbbrev &getAbbrev() { return Abbrev; }
- unsigned getAbbrevNumber() const {
- return Abbrev.getNumber();
- }
- unsigned getTag() const { return Abbrev.getTag(); }
- unsigned getOffset() const { return Offset; }
- unsigned getSize() const { return Size; }
- const std::vector<DIE *> &getChildren() const { return Children; }
- std::vector<DIEValue *> &getValues() { return Values; }
- void setTag(unsigned Tag) { Abbrev.setTag(Tag); }
- void setOffset(unsigned O) { Offset = O; }
- void setSize(unsigned S) { Size = S; }
-
- /// AddValue - Add a value and attributes to a DIE.
- ///
- void AddValue(unsigned Attribute, unsigned Form, DIEValue *Value) {
- Abbrev.AddAttribute(Attribute, Form);
- Values.push_back(Value);
- }
-
- /// SiblingOffset - Return the offset of the debug information entry's
- /// sibling.
- unsigned SiblingOffset() const { return Offset + Size; }
-
- /// AddSiblingOffset - Add a sibling offset field to the front of the DIE.
- ///
- void AddSiblingOffset();
-
- /// AddChild - Add a child to the DIE.
- ///
- void AddChild(DIE *Child) {
- Abbrev.setChildrenFlag(DW_CHILDREN_yes);
- Children.push_back(Child);
- }
-
- /// Detach - Detaches objects connected to it after copying.
- ///
- void Detach() {
- Children.clear();
- }
-
- /// Profile - Used to gather unique data for the value folding set.
- ///
- void Profile(FoldingSetNodeID &ID) ;
-
-#ifndef NDEBUG
- void print(std::ostream *O, unsigned IncIndent = 0) {
- if (O) print(*O, IncIndent);
- }
- void print(std::ostream &O, unsigned IncIndent = 0);
- void dump();
-#endif
-};
-
-//===----------------------------------------------------------------------===//
-/// DIEValue - A debug information entry value.
-///
-class DIEValue : public FoldingSetNode {
-public:
- enum {
- isInteger,
- isString,
- isLabel,
- isAsIsLabel,
- isDelta,
- isEntry,
- isBlock
- };
-
- /// Type - Type of data stored in the value.
- ///
- unsigned Type;
-
- explicit DIEValue(unsigned T)
- : Type(T)
- {}
- virtual ~DIEValue() {}
-
- // Accessors
- unsigned getType() const { return Type; }
-
- // Implement isa/cast/dyncast.
- static bool classof(const DIEValue *) { return true; }
-
- /// EmitValue - Emit value via the Dwarf writer.
- ///
- virtual void EmitValue(DwarfDebug &DD, unsigned Form) = 0;
-
- /// SizeOf - Return the size of a value in bytes.
- ///
- virtual unsigned SizeOf(const DwarfDebug &DD, unsigned Form) const = 0;
-
- /// Profile - Used to gather unique data for the value folding set.
- ///
- virtual void Profile(FoldingSetNodeID &ID) = 0;
-
-#ifndef NDEBUG
- void print(std::ostream *O) {
- if (O) print(*O);
- }
- virtual void print(std::ostream &O) = 0;
- void dump();
-#endif
-};
-
-//===----------------------------------------------------------------------===//
-/// DWInteger - An integer value DIE.
-///
-class DIEInteger : public DIEValue {
-private:
- uint64_t Integer;
-
-public:
- explicit DIEInteger(uint64_t I) : DIEValue(isInteger), Integer(I) {}
-
- // Implement isa/cast/dyncast.
- static bool classof(const DIEInteger *) { return true; }
- static bool classof(const DIEValue *I) { return I->Type == isInteger; }
-
- /// BestForm - Choose the best form for integer.
- ///
- static unsigned BestForm(bool IsSigned, uint64_t Integer) {
- if (IsSigned) {
- if ((char)Integer == (signed)Integer) return DW_FORM_data1;
- if ((short)Integer == (signed)Integer) return DW_FORM_data2;
- if ((int)Integer == (signed)Integer) return DW_FORM_data4;
- } else {
- if ((unsigned char)Integer == Integer) return DW_FORM_data1;
- if ((unsigned short)Integer == Integer) return DW_FORM_data2;
- if ((unsigned int)Integer == Integer) return DW_FORM_data4;
- }
- return DW_FORM_data8;
- }
-
- /// EmitValue - Emit integer of appropriate size.
- ///
- virtual void EmitValue(DwarfDebug &DD, unsigned Form);
-
- /// SizeOf - Determine size of integer value in bytes.
- ///
- virtual unsigned SizeOf(const DwarfDebug &DD, unsigned Form) const;
-
- /// Profile - Used to gather unique data for the value folding set.
- ///
- static void Profile(FoldingSetNodeID &ID, unsigned Integer) {
- ID.AddInteger(isInteger);
- ID.AddInteger(Integer);
- }
- virtual void Profile(FoldingSetNodeID &ID) { Profile(ID, Integer); }
-
-#ifndef NDEBUG
- virtual void print(std::ostream &O) {
- O << "Int: " << (int64_t)Integer
- << " 0x" << std::hex << Integer << std::dec;
- }
-#endif
-};
-
-//===----------------------------------------------------------------------===//
-/// DIEString - A string value DIE.
-///
-class DIEString : public DIEValue {
-public:
- const std::string String;
-
- explicit DIEString(const std::string &S) : DIEValue(isString), String(S) {}
-
- // Implement isa/cast/dyncast.
- static bool classof(const DIEString *) { return true; }
- static bool classof(const DIEValue *S) { return S->Type == isString; }
-
- /// EmitValue - Emit string value.
- ///
- virtual void EmitValue(DwarfDebug &DD, unsigned Form);
-
- /// SizeOf - Determine size of string value in bytes.
- ///
- virtual unsigned SizeOf(const DwarfDebug &DD, unsigned Form) const {
- return String.size() + sizeof(char); // sizeof('\0');
- }
-
- /// Profile - Used to gather unique data for the value folding set.
- ///
- static void Profile(FoldingSetNodeID &ID, const std::string &String) {
- ID.AddInteger(isString);
- ID.AddString(String);
- }
- virtual void Profile(FoldingSetNodeID &ID) { Profile(ID, String); }
-
-#ifndef NDEBUG
- virtual void print(std::ostream &O) {
- O << "Str: \"" << String << "\"";
- }
-#endif
-};
-
-//===----------------------------------------------------------------------===//
-/// DIEDwarfLabel - A Dwarf internal label expression DIE.
-//
-class DIEDwarfLabel : public DIEValue {
-public:
-
- const DWLabel Label;
-
- explicit DIEDwarfLabel(const DWLabel &L) : DIEValue(isLabel), Label(L) {}
-
- // Implement isa/cast/dyncast.
- static bool classof(const DIEDwarfLabel *) { return true; }
- static bool classof(const DIEValue *L) { return L->Type == isLabel; }
-
- /// EmitValue - Emit label value.
- ///
- virtual void EmitValue(DwarfDebug &DD, unsigned Form);
-
- /// SizeOf - Determine size of label value in bytes.
- ///
- virtual unsigned SizeOf(const DwarfDebug &DD, unsigned Form) const;
-
- /// Profile - Used to gather unique data for the value folding set.
- ///
- static void Profile(FoldingSetNodeID &ID, const DWLabel &Label) {
- ID.AddInteger(isLabel);
- Label.Profile(ID);
- }
- virtual void Profile(FoldingSetNodeID &ID) { Profile(ID, Label); }
-
-#ifndef NDEBUG
- virtual void print(std::ostream &O) {
- O << "Lbl: ";
- Label.print(O);
- }
-#endif
-};
-
-
-//===----------------------------------------------------------------------===//
-/// DIEObjectLabel - A label to an object in code or data.
-//
-class DIEObjectLabel : public DIEValue {
-public:
- const std::string Label;
-
- explicit DIEObjectLabel(const std::string &L)
- : DIEValue(isAsIsLabel), Label(L) {}
-
- // Implement isa/cast/dyncast.
- static bool classof(const DIEObjectLabel *) { return true; }
- static bool classof(const DIEValue *L) { return L->Type == isAsIsLabel; }
-
- /// EmitValue - Emit label value.
- ///
- virtual void EmitValue(DwarfDebug &DD, unsigned Form);
-
- /// SizeOf - Determine size of label value in bytes.
- ///
- virtual unsigned SizeOf(const DwarfDebug &DD, unsigned Form) const;
-
- /// Profile - Used to gather unique data for the value folding set.
- ///
- static void Profile(FoldingSetNodeID &ID, const std::string &Label) {
- ID.AddInteger(isAsIsLabel);
- ID.AddString(Label);
- }
- virtual void Profile(FoldingSetNodeID &ID) { Profile(ID, Label); }
-
-#ifndef NDEBUG
- virtual void print(std::ostream &O) {
- O << "Obj: " << Label;
- }
-#endif
-};
-
-//===----------------------------------------------------------------------===//
-/// DIEDelta - A simple label difference DIE.
-///
-class DIEDelta : public DIEValue {
-public:
- const DWLabel LabelHi;
- const DWLabel LabelLo;
-
- DIEDelta(const DWLabel &Hi, const DWLabel &Lo)
- : DIEValue(isDelta), LabelHi(Hi), LabelLo(Lo) {}
-
- // Implement isa/cast/dyncast.
- static bool classof(const DIEDelta *) { return true; }
- static bool classof(const DIEValue *D) { return D->Type == isDelta; }
-
- /// EmitValue - Emit delta value.
- ///
- virtual void EmitValue(DwarfDebug &DD, unsigned Form);
-
- /// SizeOf - Determine size of delta value in bytes.
- ///
- virtual unsigned SizeOf(const DwarfDebug &DD, unsigned Form) const;
-
- /// Profile - Used to gather unique data for the value folding set.
- ///
- static void Profile(FoldingSetNodeID &ID, const DWLabel &LabelHi,
- const DWLabel &LabelLo) {
- ID.AddInteger(isDelta);
- LabelHi.Profile(ID);
- LabelLo.Profile(ID);
- }
- virtual void Profile(FoldingSetNodeID &ID) { Profile(ID, LabelHi, LabelLo); }
-
-#ifndef NDEBUG
- virtual void print(std::ostream &O) {
- O << "Del: ";
- LabelHi.print(O);
- O << "-";
- LabelLo.print(O);
- }
-#endif
-};
-
-//===----------------------------------------------------------------------===//
-/// DIEntry - A pointer to another debug information entry. An instance of this
-/// class can also be used as a proxy for a debug information entry not yet
-/// defined (ie. types.)
-class DIEntry : public DIEValue {
-public:
- DIE *Entry;
-
- explicit DIEntry(DIE *E) : DIEValue(isEntry), Entry(E) {}
-
- // Implement isa/cast/dyncast.
- static bool classof(const DIEntry *) { return true; }
- static bool classof(const DIEValue *E) { return E->Type == isEntry; }
-
- /// EmitValue - Emit debug information entry offset.
- ///
- virtual void EmitValue(DwarfDebug &DD, unsigned Form);
-
- /// SizeOf - Determine size of debug information entry in bytes.
- ///
- virtual unsigned SizeOf(const DwarfDebug &DD, unsigned Form) const {
- return sizeof(int32_t);
- }
-
- /// Profile - Used to gather unique data for the value folding set.
- ///
- static void Profile(FoldingSetNodeID &ID, DIE *Entry) {
- ID.AddInteger(isEntry);
- ID.AddPointer(Entry);
- }
- virtual void Profile(FoldingSetNodeID &ID) {
- ID.AddInteger(isEntry);
-
- if (Entry) {
- ID.AddPointer(Entry);
- } else {
- ID.AddPointer(this);
- }
- }
-
-#ifndef NDEBUG
- virtual void print(std::ostream &O) {
- O << "Die: 0x" << std::hex << (intptr_t)Entry << std::dec;
- }
-#endif
-};
-
-//===----------------------------------------------------------------------===//
-/// DIEBlock - A block of values. Primarily used for location expressions.
-//
-class DIEBlock : public DIEValue, public DIE {
-public:
- unsigned Size; // Size in bytes excluding size header.
-
- DIEBlock()
- : DIEValue(isBlock)
- , DIE(0)
- , Size(0)
- {}
- ~DIEBlock() {
- }
-
- // Implement isa/cast/dyncast.
- static bool classof(const DIEBlock *) { return true; }
- static bool classof(const DIEValue *E) { return E->Type == isBlock; }
-
- /// ComputeSize - calculate the size of the block.
- ///
- unsigned ComputeSize(DwarfDebug &DD);
-
- /// BestForm - Choose the best form for data.
- ///
- unsigned BestForm() const {
- if ((unsigned char)Size == Size) return DW_FORM_block1;
- if ((unsigned short)Size == Size) return DW_FORM_block2;
- if ((unsigned int)Size == Size) return DW_FORM_block4;
- return DW_FORM_block;
- }
-
- /// EmitValue - Emit block data.
- ///
- virtual void EmitValue(DwarfDebug &DD, unsigned Form);
-
- /// SizeOf - Determine size of block data in bytes.
- ///
- virtual unsigned SizeOf(const DwarfDebug &DD, unsigned Form) const;
-
-
- /// Profile - Used to gather unique data for the value folding set.
- ///
- virtual void Profile(FoldingSetNodeID &ID) {
- ID.AddInteger(isBlock);
- DIE::Profile(ID);
- }
-
-#ifndef NDEBUG
- virtual void print(std::ostream &O) {
- O << "Blk: ";
- DIE::print(O, 5);
- }
-#endif
-};
-
-//===----------------------------------------------------------------------===//
-/// CompileUnit - This dwarf writer support class manages information associate
-/// with a source file.
-class CompileUnit {
-private:
- /// Desc - Compile unit debug descriptor.
- ///
- CompileUnitDesc *Desc;
-
- /// ID - File identifier for source.
- ///
- unsigned ID;
-
- /// Die - Compile unit debug information entry.
- ///
- DIE *Die;
-
- /// DescToDieMap - Tracks the mapping of unit level debug informaton
- /// descriptors to debug information entries.
- std::map<DebugInfoDesc *, DIE *> DescToDieMap;
-
- /// DescToDIEntryMap - Tracks the mapping of unit level debug informaton
- /// descriptors to debug information entries using a DIEntry proxy.
- std::map<DebugInfoDesc *, DIEntry *> DescToDIEntryMap;
-
- /// Globals - A map of globally visible named entities for this unit.
- ///
- std::map<std::string, DIE *> Globals;
-
- /// DiesSet - Used to uniquely define dies within the compile unit.
- ///
- FoldingSet<DIE> DiesSet;
-
- /// Dies - List of all dies in the compile unit.
- ///
- std::vector<DIE *> Dies;
-
-public:
- CompileUnit(CompileUnitDesc *CUD, unsigned I, DIE *D)
- : Desc(CUD)
- , ID(I)
- , Die(D)
- , DescToDieMap()
- , DescToDIEntryMap()
- , Globals()
- , DiesSet(InitDiesSetSize)
- , Dies()
- {}
-
- ~CompileUnit() {
- delete Die;
-
- for (unsigned i = 0, N = Dies.size(); i < N; ++i)
- delete Dies[i];
- }
-
- // Accessors.
- CompileUnitDesc *getDesc() const { return Desc; }
- unsigned getID() const { return ID; }
- DIE* getDie() const { return Die; }
- std::map<std::string, DIE *> &getGlobals() { return Globals; }
-
- /// hasContent - Return true if this compile unit has something to write out.
- ///
- bool hasContent() const {
- return !Die->getChildren().empty();
- }
-
- /// AddGlobal - Add a new global entity to the compile unit.
- ///
- void AddGlobal(const std::string &Name, DIE *Die) {
- Globals[Name] = Die;
- }
-
- /// getDieMapSlotFor - Returns the debug information entry map slot for the
- /// specified debug descriptor.
- DIE *&getDieMapSlotFor(DebugInfoDesc *DID) {
- return DescToDieMap[DID];
- }
-
- /// getDIEntrySlotFor - Returns the debug information entry proxy slot for the
- /// specified debug descriptor.
- DIEntry *&getDIEntrySlotFor(DebugInfoDesc *DID) {
- return DescToDIEntryMap[DID];
- }
-
- /// AddDie - Adds or interns the DIE to the compile unit.
- ///
- DIE *AddDie(DIE &Buffer) {
- FoldingSetNodeID ID;
- Buffer.Profile(ID);
- void *Where;
- DIE *Die = DiesSet.FindNodeOrInsertPos(ID, Where);
-
- if (!Die) {
- Die = new DIE(Buffer);
- DiesSet.InsertNode(Die, Where);
- this->Die->AddChild(Die);
- Buffer.Detach();
- }
-
- return Die;
- }
-};
-
-//===----------------------------------------------------------------------===//
-/// Dwarf - Emits general Dwarf directives.
-///
-class Dwarf {
-
-protected:
-
- //===--------------------------------------------------------------------===//
- // Core attributes used by the Dwarf writer.
- //
-
- //
- /// O - Stream to .s file.
- ///
- std::ostream &O;
-
- /// Asm - Target of Dwarf emission.
- ///
- AsmPrinter *Asm;
-
- /// TAI - Target Asm Printer.
- const TargetAsmInfo *TAI;
-
- /// TD - Target data.
- const TargetData *TD;
-
- /// RI - Register Information.
- const TargetRegisterInfo *RI;
-
- /// M - Current module.
- ///
- Module *M;
-
- /// MF - Current machine function.
- ///
- MachineFunction *MF;
-
- /// MMI - Collected machine module information.
- ///
- MachineModuleInfo *MMI;
-
- /// SubprogramCount - The running count of functions being compiled.
- ///
- unsigned SubprogramCount;
-
- /// Flavor - A unique string indicating what dwarf producer this is, used to
- /// unique labels.
- const char * const Flavor;
-
- unsigned SetCounter;
- Dwarf(std::ostream &OS, AsmPrinter *A, const TargetAsmInfo *T,
- const char *flavor)
- : O(OS)
- , Asm(A)
- , TAI(T)
- , TD(Asm->TM.getTargetData())
- , RI(Asm->TM.getRegisterInfo())
- , M(NULL)
- , MF(NULL)
- , MMI(NULL)
- , SubprogramCount(0)
- , Flavor(flavor)
- , SetCounter(1)
- {
- }
-
-public:
-
- //===--------------------------------------------------------------------===//
- // Accessors.
- //
- AsmPrinter *getAsm() const { return Asm; }
- MachineModuleInfo *getMMI() const { return MMI; }
- const TargetAsmInfo *getTargetAsmInfo() const { return TAI; }
- const TargetData *getTargetData() const { return TD; }
-
- void PrintRelDirective(bool Force32Bit = false, bool isInSection = false)
- const {
- if (isInSection && TAI->getDwarfSectionOffsetDirective())
- O << TAI->getDwarfSectionOffsetDirective();
- else if (Force32Bit || TD->getPointerSize() == sizeof(int32_t))
- O << TAI->getData32bitsDirective();
- else
- O << TAI->getData64bitsDirective();
- }
-
- /// PrintLabelName - Print label name in form used by Dwarf writer.
- ///
- void PrintLabelName(DWLabel Label) const {
- PrintLabelName(Label.Tag, Label.Number);
- }
- void PrintLabelName(const char *Tag, unsigned Number) const {
- O << TAI->getPrivateGlobalPrefix() << Tag;
- if (Number) O << Number;
- }
-
- void PrintLabelName(const char *Tag, unsigned Number,
- const char *Suffix) const {
- O << TAI->getPrivateGlobalPrefix() << Tag;
- if (Number) O << Number;
- O << Suffix;
- }
-
- /// EmitLabel - Emit location label for internal use by Dwarf.
- ///
- void EmitLabel(DWLabel Label) const {
- EmitLabel(Label.Tag, Label.Number);
- }
- void EmitLabel(const char *Tag, unsigned Number) const {
- PrintLabelName(Tag, Number);
- O << ":\n";
- }
-
- /// EmitReference - Emit a reference to a label.
- ///
- void EmitReference(DWLabel Label, bool IsPCRelative = false,
- bool Force32Bit = false) const {
- EmitReference(Label.Tag, Label.Number, IsPCRelative, Force32Bit);
- }
- void EmitReference(const char *Tag, unsigned Number,
- bool IsPCRelative = false, bool Force32Bit = false) const {
- PrintRelDirective(Force32Bit);
- PrintLabelName(Tag, Number);
-
- if (IsPCRelative) O << "-" << TAI->getPCSymbol();
- }
- void EmitReference(const std::string &Name, bool IsPCRelative = false,
- bool Force32Bit = false) const {
- PrintRelDirective(Force32Bit);
-
- O << Name;
-
- if (IsPCRelative) O << "-" << TAI->getPCSymbol();
- }
-
- /// EmitDifference - Emit the difference between two labels. Some
- /// assemblers do not behave with absolute expressions with data directives,
- /// so there is an option (needsSet) to use an intermediary set expression.
- void EmitDifference(DWLabel LabelHi, DWLabel LabelLo,
- bool IsSmall = false) {
- EmitDifference(LabelHi.Tag, LabelHi.Number,
- LabelLo.Tag, LabelLo.Number,
- IsSmall);
- }
- void EmitDifference(const char *TagHi, unsigned NumberHi,
- const char *TagLo, unsigned NumberLo,
- bool IsSmall = false) {
- if (TAI->needsSet()) {
- O << "\t.set\t";
- PrintLabelName("set", SetCounter, Flavor);
- O << ",";
- PrintLabelName(TagHi, NumberHi);
- O << "-";
- PrintLabelName(TagLo, NumberLo);
- O << "\n";
-
- PrintRelDirective(IsSmall);
- PrintLabelName("set", SetCounter, Flavor);
- ++SetCounter;
- } else {
- PrintRelDirective(IsSmall);
-
- PrintLabelName(TagHi, NumberHi);
- O << "-";
- PrintLabelName(TagLo, NumberLo);
- }
- }
-
- void EmitSectionOffset(const char* Label, const char* Section,
- unsigned LabelNumber, unsigned SectionNumber,
- bool IsSmall = false, bool isEH = false,
- bool useSet = true) {
- bool printAbsolute = false;
- if (isEH)
- printAbsolute = TAI->isAbsoluteEHSectionOffsets();
- else
- printAbsolute = TAI->isAbsoluteDebugSectionOffsets();
-
- if (TAI->needsSet() && useSet) {
- O << "\t.set\t";
- PrintLabelName("set", SetCounter, Flavor);
- O << ",";
- PrintLabelName(Label, LabelNumber);
-
- if (!printAbsolute) {
- O << "-";
- PrintLabelName(Section, SectionNumber);
- }
- O << "\n";
-
- PrintRelDirective(IsSmall);
-
- PrintLabelName("set", SetCounter, Flavor);
- ++SetCounter;
- } else {
- PrintRelDirective(IsSmall, true);
-
- PrintLabelName(Label, LabelNumber);
-
- if (!printAbsolute) {
- O << "-";
- PrintLabelName(Section, SectionNumber);
- }
- }
- }
-
- /// EmitFrameMoves - Emit frame instructions to describe the layout of the
- /// frame.
- void EmitFrameMoves(const char *BaseLabel, unsigned BaseLabelID,
- const std::vector<MachineMove> &Moves, bool isEH) {
- int stackGrowth =
- Asm->TM.getFrameInfo()->getStackGrowthDirection() ==
- TargetFrameInfo::StackGrowsUp ?
- TD->getPointerSize() : -TD->getPointerSize();
- bool IsLocal = BaseLabel && strcmp(BaseLabel, "label") == 0;
-
- for (unsigned i = 0, N = Moves.size(); i < N; ++i) {
- const MachineMove &Move = Moves[i];
- unsigned LabelID = Move.getLabelID();
-
- if (LabelID) {
- LabelID = MMI->MappedLabel(LabelID);
-
- // Throw out move if the label is invalid.
- if (!LabelID) continue;
- }
-
- const MachineLocation &Dst = Move.getDestination();
- const MachineLocation &Src = Move.getSource();
-
- // Advance row if new location.
- if (BaseLabel && LabelID && (BaseLabelID != LabelID || !IsLocal)) {
- Asm->EmitInt8(DW_CFA_advance_loc4);
- Asm->EOL("DW_CFA_advance_loc4");
- EmitDifference("label", LabelID, BaseLabel, BaseLabelID, true);
- Asm->EOL();
-
- BaseLabelID = LabelID;
- BaseLabel = "label";
- IsLocal = true;
- }
-
- // If advancing cfa.
- if (Dst.isRegister() && Dst.getRegister() == MachineLocation::VirtualFP) {
- if (!Src.isRegister()) {
- if (Src.getRegister() == MachineLocation::VirtualFP) {
- Asm->EmitInt8(DW_CFA_def_cfa_offset);
- Asm->EOL("DW_CFA_def_cfa_offset");
- } else {
- Asm->EmitInt8(DW_CFA_def_cfa);
- Asm->EOL("DW_CFA_def_cfa");
- Asm->EmitULEB128Bytes(RI->getDwarfRegNum(Src.getRegister(), isEH));
- Asm->EOL("Register");
- }
-
- int Offset = -Src.getOffset();
-
- Asm->EmitULEB128Bytes(Offset);
- Asm->EOL("Offset");
- } else {
- assert(0 && "Machine move no supported yet.");
- }
- } else if (Src.isRegister() &&
- Src.getRegister() == MachineLocation::VirtualFP) {
- if (Dst.isRegister()) {
- Asm->EmitInt8(DW_CFA_def_cfa_register);
- Asm->EOL("DW_CFA_def_cfa_register");
- Asm->EmitULEB128Bytes(RI->getDwarfRegNum(Dst.getRegister(), isEH));
- Asm->EOL("Register");
- } else {
- assert(0 && "Machine move no supported yet.");
- }
- } else {
- unsigned Reg = RI->getDwarfRegNum(Src.getRegister(), isEH);
- int Offset = Dst.getOffset() / stackGrowth;
-
- if (Offset < 0) {
- Asm->EmitInt8(DW_CFA_offset_extended_sf);
- Asm->EOL("DW_CFA_offset_extended_sf");
- Asm->EmitULEB128Bytes(Reg);
- Asm->EOL("Reg");
- Asm->EmitSLEB128Bytes(Offset);
- Asm->EOL("Offset");
- } else if (Reg < 64) {
- Asm->EmitInt8(DW_CFA_offset + Reg);
- Asm->EOL("DW_CFA_offset + Reg (" + utostr(Reg) + ")");
- Asm->EmitULEB128Bytes(Offset);
- Asm->EOL("Offset");
- } else {
- Asm->EmitInt8(DW_CFA_offset_extended);
- Asm->EOL("DW_CFA_offset_extended");
- Asm->EmitULEB128Bytes(Reg);
- Asm->EOL("Reg");
- Asm->EmitULEB128Bytes(Offset);
- Asm->EOL("Offset");
- }
- }
- }
- }
-
-};
-
-//===----------------------------------------------------------------------===//
-/// DwarfDebug - Emits Dwarf debug directives.
-///
-class DwarfDebug : public Dwarf {
-
-private:
- //===--------------------------------------------------------------------===//
- // Attributes used to construct specific Dwarf sections.
- //
-
- /// CompileUnits - All the compile units involved in this build. The index
- /// of each entry in this vector corresponds to the sources in MMI.
- std::vector<CompileUnit *> CompileUnits;
-
- /// AbbreviationsSet - Used to uniquely define abbreviations.
- ///
- FoldingSet<DIEAbbrev> AbbreviationsSet;
-
- /// Abbreviations - A list of all the unique abbreviations in use.
- ///
- std::vector<DIEAbbrev *> Abbreviations;
-
- /// ValuesSet - Used to uniquely define values.
- ///
- FoldingSet<DIEValue> ValuesSet;
-
- /// Values - A list of all the unique values in use.
- ///
- std::vector<DIEValue *> Values;
-
- /// StringPool - A UniqueVector of strings used by indirect references.
- ///
- UniqueVector<std::string> StringPool;
-
- /// UnitMap - Map debug information descriptor to compile unit.
- ///
- std::map<DebugInfoDesc *, CompileUnit *> DescToUnitMap;
-
- /// SectionMap - Provides a unique id per text section.
- ///
- UniqueVector<std::string> SectionMap;
-
- /// SectionSourceLines - Tracks line numbers per text section.
- ///
- std::vector<std::vector<SourceLineInfo> > SectionSourceLines;
-
- /// didInitial - Flag to indicate if initial emission has been done.
- ///
- bool didInitial;
-
- /// shouldEmit - Flag to indicate if debug information should be emitted.
- ///
- bool shouldEmit;
-
- struct FunctionDebugFrameInfo {
- unsigned Number;
- std::vector<MachineMove> Moves;
-
- FunctionDebugFrameInfo(unsigned Num, const std::vector<MachineMove> &M):
- Number(Num), Moves(M) { }
- };
-
- std::vector<FunctionDebugFrameInfo> DebugFrames;
-
-public:
-
- /// ShouldEmitDwarf - Returns true if Dwarf declarations should be made.
- ///
- bool ShouldEmitDwarf() const { return shouldEmit; }
-
- /// AssignAbbrevNumber - Define a unique number for the abbreviation.
- ///
- void AssignAbbrevNumber(DIEAbbrev &Abbrev) {
- // Profile the node so that we can make it unique.
- FoldingSetNodeID ID;
- Abbrev.Profile(ID);
-
- // Check the set for priors.
- DIEAbbrev *InSet = AbbreviationsSet.GetOrInsertNode(&Abbrev);
-
- // If it's newly added.
- if (InSet == &Abbrev) {
- // Add to abbreviation list.
- Abbreviations.push_back(&Abbrev);
- // Assign the vector position + 1 as its number.
- Abbrev.setNumber(Abbreviations.size());
- } else {
- // Assign existing abbreviation number.
- Abbrev.setNumber(InSet->getNumber());
- }
- }
-
- /// NewString - Add a string to the constant pool and returns a label.
- ///
- DWLabel NewString(const std::string &String) {
- unsigned StringID = StringPool.insert(String);
- return DWLabel("string", StringID);
- }
-
- /// NewDIEntry - Creates a new DIEntry to be a proxy for a debug information
- /// entry.
- DIEntry *NewDIEntry(DIE *Entry = NULL) {
- DIEntry *Value;
-
- if (Entry) {
- FoldingSetNodeID ID;
- DIEntry::Profile(ID, Entry);
- void *Where;
- Value = static_cast<DIEntry *>(ValuesSet.FindNodeOrInsertPos(ID, Where));
-
- if (Value) return Value;
-
- Value = new DIEntry(Entry);
- ValuesSet.InsertNode(Value, Where);
- } else {
- Value = new DIEntry(Entry);
- }
-
- Values.push_back(Value);
- return Value;
- }
-
- /// SetDIEntry - Set a DIEntry once the debug information entry is defined.
- ///
- void SetDIEntry(DIEntry *Value, DIE *Entry) {
- Value->Entry = Entry;
- // Add to values set if not already there. If it is, we merely have a
- // duplicate in the values list (no harm.)
- ValuesSet.GetOrInsertNode(Value);
- }
-
- /// AddUInt - Add an unsigned integer attribute data and value.
- ///
- void AddUInt(DIE *Die, unsigned Attribute, unsigned Form, uint64_t Integer) {
- if (!Form) Form = DIEInteger::BestForm(false, Integer);
-
- FoldingSetNodeID ID;
- DIEInteger::Profile(ID, Integer);
- void *Where;
- DIEValue *Value = ValuesSet.FindNodeOrInsertPos(ID, Where);
- if (!Value) {
- Value = new DIEInteger(Integer);
- ValuesSet.InsertNode(Value, Where);
- Values.push_back(Value);
- }
-
- Die->AddValue(Attribute, Form, Value);
- }
-
- /// AddSInt - Add an signed integer attribute data and value.
- ///
- void AddSInt(DIE *Die, unsigned Attribute, unsigned Form, int64_t Integer) {
- if (!Form) Form = DIEInteger::BestForm(true, Integer);
-
- FoldingSetNodeID ID;
- DIEInteger::Profile(ID, (uint64_t)Integer);
- void *Where;
- DIEValue *Value = ValuesSet.FindNodeOrInsertPos(ID, Where);
- if (!Value) {
- Value = new DIEInteger(Integer);
- ValuesSet.InsertNode(Value, Where);
- Values.push_back(Value);
- }
-
- Die->AddValue(Attribute, Form, Value);
- }
-
- /// AddString - Add a std::string attribute data and value.
- ///
- void AddString(DIE *Die, unsigned Attribute, unsigned Form,
- const std::string &String) {
- FoldingSetNodeID ID;
- DIEString::Profile(ID, String);
- void *Where;
- DIEValue *Value = ValuesSet.FindNodeOrInsertPos(ID, Where);
- if (!Value) {
- Value = new DIEString(String);
- ValuesSet.InsertNode(Value, Where);
- Values.push_back(Value);
- }
-
- Die->AddValue(Attribute, Form, Value);
- }
-
- /// AddLabel - Add a Dwarf label attribute data and value.
- ///
- void AddLabel(DIE *Die, unsigned Attribute, unsigned Form,
- const DWLabel &Label) {
- FoldingSetNodeID ID;
- DIEDwarfLabel::Profile(ID, Label);
- void *Where;
- DIEValue *Value = ValuesSet.FindNodeOrInsertPos(ID, Where);
- if (!Value) {
- Value = new DIEDwarfLabel(Label);
- ValuesSet.InsertNode(Value, Where);
- Values.push_back(Value);
- }
-
- Die->AddValue(Attribute, Form, Value);
- }
-
- /// AddObjectLabel - Add an non-Dwarf label attribute data and value.
- ///
- void AddObjectLabel(DIE *Die, unsigned Attribute, unsigned Form,
- const std::string &Label) {
- FoldingSetNodeID ID;
- DIEObjectLabel::Profile(ID, Label);
- void *Where;
- DIEValue *Value = ValuesSet.FindNodeOrInsertPos(ID, Where);
- if (!Value) {
- Value = new DIEObjectLabel(Label);
- ValuesSet.InsertNode(Value, Where);
- Values.push_back(Value);
- }
-
- Die->AddValue(Attribute, Form, Value);
- }
-
- /// AddDelta - Add a label delta attribute data and value.
- ///
- void AddDelta(DIE *Die, unsigned Attribute, unsigned Form,
- const DWLabel &Hi, const DWLabel &Lo) {
- FoldingSetNodeID ID;
- DIEDelta::Profile(ID, Hi, Lo);
- void *Where;
- DIEValue *Value = ValuesSet.FindNodeOrInsertPos(ID, Where);
- if (!Value) {
- Value = new DIEDelta(Hi, Lo);
- ValuesSet.InsertNode(Value, Where);
- Values.push_back(Value);
- }
-
- Die->AddValue(Attribute, Form, Value);
- }
-
- /// AddDIEntry - Add a DIE attribute data and value.
- ///
- void AddDIEntry(DIE *Die, unsigned Attribute, unsigned Form, DIE *Entry) {
- Die->AddValue(Attribute, Form, NewDIEntry(Entry));
- }
-
- /// AddBlock - Add block data.
- ///
- void AddBlock(DIE *Die, unsigned Attribute, unsigned Form, DIEBlock *Block) {
- Block->ComputeSize(*this);
- FoldingSetNodeID ID;
- Block->Profile(ID);
- void *Where;
- DIEValue *Value = ValuesSet.FindNodeOrInsertPos(ID, Where);
- if (!Value) {
- Value = Block;
- ValuesSet.InsertNode(Value, Where);
- Values.push_back(Value);
- } else {
- // Already exists, reuse the previous one.
- delete Block;
- Block = cast<DIEBlock>(Value);
- }
-
- Die->AddValue(Attribute, Block->BestForm(), Value);
- }
-
-private:
-
- /// AddSourceLine - Add location information to specified debug information
- /// entry.
- void AddSourceLine(DIE *Die, CompileUnitDesc *File, unsigned Line) {
- if (File && Line) {
- CompileUnit *FileUnit = FindCompileUnit(File);
- unsigned FileID = FileUnit->getID();
- AddUInt(Die, DW_AT_decl_file, 0, FileID);
- AddUInt(Die, DW_AT_decl_line, 0, Line);
- }
- }
-
- /// AddAddress - Add an address attribute to a die based on the location
- /// provided.
- void AddAddress(DIE *Die, unsigned Attribute,
- const MachineLocation &Location) {
- unsigned Reg = RI->getDwarfRegNum(Location.getRegister(), false);
- DIEBlock *Block = new DIEBlock();
-
- if (Location.isRegister()) {
- if (Reg < 32) {
- AddUInt(Block, 0, DW_FORM_data1, DW_OP_reg0 + Reg);
- } else {
- AddUInt(Block, 0, DW_FORM_data1, DW_OP_regx);
- AddUInt(Block, 0, DW_FORM_udata, Reg);
- }
- } else {
- if (Reg < 32) {
- AddUInt(Block, 0, DW_FORM_data1, DW_OP_breg0 + Reg);
- } else {
- AddUInt(Block, 0, DW_FORM_data1, DW_OP_bregx);
- AddUInt(Block, 0, DW_FORM_udata, Reg);
- }
- AddUInt(Block, 0, DW_FORM_sdata, Location.getOffset());
- }
-
- AddBlock(Die, Attribute, 0, Block);
- }
-
- /// AddBasicType - Add a new basic type attribute to the specified entity.
- ///
- void AddBasicType(DIE *Entity, CompileUnit *Unit,
- const std::string &Name,
- unsigned Encoding, unsigned Size) {
- DIE *Die = ConstructBasicType(Unit, Name, Encoding, Size);
- AddDIEntry(Entity, DW_AT_type, DW_FORM_ref4, Die);
- }
-
- /// ConstructBasicType - Construct a new basic type.
- ///
- DIE *ConstructBasicType(CompileUnit *Unit,
- const std::string &Name,
- unsigned Encoding, unsigned Size) {
- DIE Buffer(DW_TAG_base_type);
- AddUInt(&Buffer, DW_AT_byte_size, 0, Size);
- AddUInt(&Buffer, DW_AT_encoding, DW_FORM_data1, Encoding);
- if (!Name.empty()) AddString(&Buffer, DW_AT_name, DW_FORM_string, Name);
- return Unit->AddDie(Buffer);
- }
-
- /// AddPointerType - Add a new pointer type attribute to the specified entity.
- ///
- void AddPointerType(DIE *Entity, CompileUnit *Unit, const std::string &Name) {
- DIE *Die = ConstructPointerType(Unit, Name);
- AddDIEntry(Entity, DW_AT_type, DW_FORM_ref4, Die);
- }
-
- /// ConstructPointerType - Construct a new pointer type.
- ///
- DIE *ConstructPointerType(CompileUnit *Unit, const std::string &Name) {
- DIE Buffer(DW_TAG_pointer_type);
- AddUInt(&Buffer, DW_AT_byte_size, 0, TD->getPointerSize());
- if (!Name.empty()) AddString(&Buffer, DW_AT_name, DW_FORM_string, Name);
- return Unit->AddDie(Buffer);
- }
-
- /// AddType - Add a new type attribute to the specified entity.
- ///
- void AddType(DIE *Entity, TypeDesc *TyDesc, CompileUnit *Unit) {
- if (!TyDesc) {
- AddBasicType(Entity, Unit, "", DW_ATE_signed, sizeof(int32_t));
- } else {
- // Check for pre-existence.
- DIEntry *&Slot = Unit->getDIEntrySlotFor(TyDesc);
-
- // If it exists then use the existing value.
- if (Slot) {
- Entity->AddValue(DW_AT_type, DW_FORM_ref4, Slot);
- return;
- }
-
- if (SubprogramDesc *SubprogramTy = dyn_cast<SubprogramDesc>(TyDesc)) {
- // FIXME - Not sure why programs and variables are coming through here.
- // Short cut for handling subprogram types (not really a TyDesc.)
- AddPointerType(Entity, Unit, SubprogramTy->getName());
- } else if (GlobalVariableDesc *GlobalTy =
- dyn_cast<GlobalVariableDesc>(TyDesc)) {
- // FIXME - Not sure why programs and variables are coming through here.
- // Short cut for handling global variable types (not really a TyDesc.)
- AddPointerType(Entity, Unit, GlobalTy->getName());
- } else {
- // Set up proxy.
- Slot = NewDIEntry();
-
- // Construct type.
- DIE Buffer(DW_TAG_base_type);
- ConstructType(Buffer, TyDesc, Unit);
-
- // Add debug information entry to entity and unit.
- DIE *Die = Unit->AddDie(Buffer);
- SetDIEntry(Slot, Die);
- Entity->AddValue(DW_AT_type, DW_FORM_ref4, Slot);
- }
- }
- }
-
- /// ConstructType - Adds all the required attributes to the type.
- ///
- void ConstructType(DIE &Buffer, TypeDesc *TyDesc, CompileUnit *Unit) {
- // Get core information.
- const std::string &Name = TyDesc->getName();
- uint64_t Size = TyDesc->getSize() >> 3;
-
- if (BasicTypeDesc *BasicTy = dyn_cast<BasicTypeDesc>(TyDesc)) {
- // Fundamental types like int, float, bool
- Buffer.setTag(DW_TAG_base_type);
- AddUInt(&Buffer, DW_AT_encoding, DW_FORM_data1, BasicTy->getEncoding());
- } else if (DerivedTypeDesc *DerivedTy = dyn_cast<DerivedTypeDesc>(TyDesc)) {
- // Fetch tag.
- unsigned Tag = DerivedTy->getTag();
- // FIXME - Workaround for templates.
- if (Tag == DW_TAG_inheritance) Tag = DW_TAG_reference_type;
- // Pointers, typedefs et al.
- Buffer.setTag(Tag);
- // Map to main type, void will not have a type.
- if (TypeDesc *FromTy = DerivedTy->getFromType())
- AddType(&Buffer, FromTy, Unit);
- } else if (CompositeTypeDesc *CompTy = dyn_cast<CompositeTypeDesc>(TyDesc)){
- // Fetch tag.
- unsigned Tag = CompTy->getTag();
-
- // Set tag accordingly.
- if (Tag == DW_TAG_vector_type)
- Buffer.setTag(DW_TAG_array_type);
- else
- Buffer.setTag(Tag);
-
- std::vector<DebugInfoDesc *> &Elements = CompTy->getElements();
-
- switch (Tag) {
- case DW_TAG_vector_type:
- AddUInt(&Buffer, DW_AT_GNU_vector, DW_FORM_flag, 1);
- // Fall thru
- case DW_TAG_array_type: {
- // Add element type.
- if (TypeDesc *FromTy = CompTy->getFromType())
- AddType(&Buffer, FromTy, Unit);
-
- // Don't emit size attribute.
- Size = 0;
-
- // Construct an anonymous type for index type.
- DIE *IndexTy = ConstructBasicType(Unit, "", DW_ATE_signed,
- sizeof(int32_t));
-
- // Add subranges to array type.
- for(unsigned i = 0, N = Elements.size(); i < N; ++i) {
- SubrangeDesc *SRD = cast<SubrangeDesc>(Elements[i]);
- int64_t Lo = SRD->getLo();
- int64_t Hi = SRD->getHi();
- DIE *Subrange = new DIE(DW_TAG_subrange_type);
-
- // If a range is available.
- if (Lo != Hi) {
- AddDIEntry(Subrange, DW_AT_type, DW_FORM_ref4, IndexTy);
- // Only add low if non-zero.
- if (Lo) AddSInt(Subrange, DW_AT_lower_bound, 0, Lo);
- AddSInt(Subrange, DW_AT_upper_bound, 0, Hi);
- }
-
- Buffer.AddChild(Subrange);
- }
- break;
- }
- case DW_TAG_structure_type:
- case DW_TAG_union_type: {
- // Add elements to structure type.
- for(unsigned i = 0, N = Elements.size(); i < N; ++i) {
- DebugInfoDesc *Element = Elements[i];
-
- if (DerivedTypeDesc *MemberDesc = dyn_cast<DerivedTypeDesc>(Element)){
- // Add field or base class.
-
- unsigned Tag = MemberDesc->getTag();
-
- // Extract the basic information.
- const std::string &Name = MemberDesc->getName();
- uint64_t Size = MemberDesc->getSize();
- uint64_t Align = MemberDesc->getAlign();
- uint64_t Offset = MemberDesc->getOffset();
-
- // Construct member debug information entry.
- DIE *Member = new DIE(Tag);
-
- // Add name if not "".
- if (!Name.empty())
- AddString(Member, DW_AT_name, DW_FORM_string, Name);
- // Add location if available.
- AddSourceLine(Member, MemberDesc->getFile(), MemberDesc->getLine());
-
- // Most of the time the field info is the same as the members.
- uint64_t FieldSize = Size;
- uint64_t FieldAlign = Align;
- uint64_t FieldOffset = Offset;
-
- // Set the member type.
- TypeDesc *FromTy = MemberDesc->getFromType();
- AddType(Member, FromTy, Unit);
-
- // Walk up typedefs until a real size is found.
- while (FromTy) {
- if (FromTy->getTag() != DW_TAG_typedef) {
- FieldSize = FromTy->getSize();
- FieldAlign = FromTy->getSize();
- break;
- }
-
- FromTy = cast<DerivedTypeDesc>(FromTy)->getFromType();
- }
-
- // Unless we have a bit field.
- if (Tag == DW_TAG_member && FieldSize != Size) {
- // Construct the alignment mask.
- uint64_t AlignMask = ~(FieldAlign - 1);
- // Determine the high bit + 1 of the declared size.
- uint64_t HiMark = (Offset + FieldSize) & AlignMask;
- // Work backwards to determine the base offset of the field.
- FieldOffset = HiMark - FieldSize;
- // Now normalize offset to the field.
- Offset -= FieldOffset;
-
- // Maybe we need to work from the other end.
- if (TD->isLittleEndian()) Offset = FieldSize - (Offset + Size);
-
- // Add size and offset.
- AddUInt(Member, DW_AT_byte_size, 0, FieldSize >> 3);
- AddUInt(Member, DW_AT_bit_size, 0, Size);
- AddUInt(Member, DW_AT_bit_offset, 0, Offset);
- }
-
- // Add computation for offset.
- DIEBlock *Block = new DIEBlock();
- AddUInt(Block, 0, DW_FORM_data1, DW_OP_plus_uconst);
- AddUInt(Block, 0, DW_FORM_udata, FieldOffset >> 3);
- AddBlock(Member, DW_AT_data_member_location, 0, Block);
-
- // Add accessibility (public default unless is base class.
- if (MemberDesc->isProtected()) {
- AddUInt(Member, DW_AT_accessibility, 0, DW_ACCESS_protected);
- } else if (MemberDesc->isPrivate()) {
- AddUInt(Member, DW_AT_accessibility, 0, DW_ACCESS_private);
- } else if (Tag == DW_TAG_inheritance) {
- AddUInt(Member, DW_AT_accessibility, 0, DW_ACCESS_public);
- }
-
- Buffer.AddChild(Member);
- } else if (GlobalVariableDesc *StaticDesc =
- dyn_cast<GlobalVariableDesc>(Element)) {
- // Add static member.
-
- // Construct member debug information entry.
- DIE *Static = new DIE(DW_TAG_variable);
-
- // Add name and mangled name.
- const std::string &Name = StaticDesc->getName();
- const std::string &LinkageName = StaticDesc->getLinkageName();
- AddString(Static, DW_AT_name, DW_FORM_string, Name);
- if (!LinkageName.empty()) {
- AddString(Static, DW_AT_MIPS_linkage_name, DW_FORM_string,
- LinkageName);
- }
-
- // Add location.
- AddSourceLine(Static, StaticDesc->getFile(), StaticDesc->getLine());
-
- // Add type.
- if (TypeDesc *StaticTy = StaticDesc->getType())
- AddType(Static, StaticTy, Unit);
-
- // Add flags.
- if (!StaticDesc->isStatic())
- AddUInt(Static, DW_AT_external, DW_FORM_flag, 1);
- AddUInt(Static, DW_AT_declaration, DW_FORM_flag, 1);
-
- Buffer.AddChild(Static);
- } else if (SubprogramDesc *MethodDesc =
- dyn_cast<SubprogramDesc>(Element)) {
- // Add member function.
-
- // Construct member debug information entry.
- DIE *Method = new DIE(DW_TAG_subprogram);
-
- // Add name and mangled name.
- const std::string &Name = MethodDesc->getName();
- const std::string &LinkageName = MethodDesc->getLinkageName();
-
- AddString(Method, DW_AT_name, DW_FORM_string, Name);
- bool IsCTor = TyDesc->getName() == Name;
-
- if (!LinkageName.empty()) {
- AddString(Method, DW_AT_MIPS_linkage_name, DW_FORM_string,
- LinkageName);
- }
-
- // Add location.
- AddSourceLine(Method, MethodDesc->getFile(), MethodDesc->getLine());
-
- // Add type.
- if (CompositeTypeDesc *MethodTy =
- dyn_cast_or_null<CompositeTypeDesc>(MethodDesc->getType())) {
- // Get argument information.
- std::vector<DebugInfoDesc *> &Args = MethodTy->getElements();
-
- // If not a ctor.
- if (!IsCTor) {
- // Add return type.
- AddType(Method, dyn_cast<TypeDesc>(Args[0]), Unit);
- }
-
- // Add arguments.
- for(unsigned i = 1, N = Args.size(); i < N; ++i) {
- DIE *Arg = new DIE(DW_TAG_formal_parameter);
- AddType(Arg, cast<TypeDesc>(Args[i]), Unit);
- AddUInt(Arg, DW_AT_artificial, DW_FORM_flag, 1);
- Method->AddChild(Arg);
- }
- }
-
- // Add flags.
- if (!MethodDesc->isStatic())
- AddUInt(Method, DW_AT_external, DW_FORM_flag, 1);
- AddUInt(Method, DW_AT_declaration, DW_FORM_flag, 1);
-
- Buffer.AddChild(Method);
- }
- }
- break;
- }
- case DW_TAG_enumeration_type: {
- // Add enumerators to enumeration type.
- for(unsigned i = 0, N = Elements.size(); i < N; ++i) {
- EnumeratorDesc *ED = cast<EnumeratorDesc>(Elements[i]);
- const std::string &Name = ED->getName();
- int64_t Value = ED->getValue();
- DIE *Enumerator = new DIE(DW_TAG_enumerator);
- AddString(Enumerator, DW_AT_name, DW_FORM_string, Name);
- AddSInt(Enumerator, DW_AT_const_value, DW_FORM_sdata, Value);
- Buffer.AddChild(Enumerator);
- }
-
- break;
- }
- case DW_TAG_subroutine_type: {
- // Add prototype flag.
- AddUInt(&Buffer, DW_AT_prototyped, DW_FORM_flag, 1);
- // Add return type.
- AddType(&Buffer, dyn_cast<TypeDesc>(Elements[0]), Unit);
-
- // Add arguments.
- for(unsigned i = 1, N = Elements.size(); i < N; ++i) {
- DIE *Arg = new DIE(DW_TAG_formal_parameter);
- AddType(Arg, cast<TypeDesc>(Elements[i]), Unit);
- Buffer.AddChild(Arg);
- }
-
- break;
- }
- default: break;
- }
- }
-
- // Add size if non-zero (derived types don't have a size.)
- if (Size) AddUInt(&Buffer, DW_AT_byte_size, 0, Size);
- // Add name if not anonymous or intermediate type.
- if (!Name.empty()) AddString(&Buffer, DW_AT_name, DW_FORM_string, Name);
- // Add source line info if available.
- AddSourceLine(&Buffer, TyDesc->getFile(), TyDesc->getLine());
- }
-
- /// NewCompileUnit - Create new compile unit and it's debug information entry.
- ///
- CompileUnit *NewCompileUnit(CompileUnitDesc *UnitDesc, unsigned ID) {
- // Construct debug information entry.
- DIE *Die = new DIE(DW_TAG_compile_unit);
- if (TAI->isAbsoluteDebugSectionOffsets())
- AddLabel(Die, DW_AT_stmt_list, DW_FORM_data4, DWLabel("section_line", 0));
- else
- AddDelta(Die, DW_AT_stmt_list, DW_FORM_data4, DWLabel("section_line", 0),
- DWLabel("section_line", 0));
- AddString(Die, DW_AT_producer, DW_FORM_string, UnitDesc->getProducer());
- AddUInt (Die, DW_AT_language, DW_FORM_data1, UnitDesc->getLanguage());
- AddString(Die, DW_AT_name, DW_FORM_string, UnitDesc->getFileName());
- AddString(Die, DW_AT_comp_dir, DW_FORM_string, UnitDesc->getDirectory());
-
- // Construct compile unit.
- CompileUnit *Unit = new CompileUnit(UnitDesc, ID, Die);
-
- // Add Unit to compile unit map.
- DescToUnitMap[UnitDesc] = Unit;
-
- return Unit;
- }
-
- /// GetBaseCompileUnit - Get the main compile unit.
- ///
- CompileUnit *GetBaseCompileUnit() const {
- CompileUnit *Unit = CompileUnits[0];
- assert(Unit && "Missing compile unit.");
- return Unit;
- }
-
- /// FindCompileUnit - Get the compile unit for the given descriptor.
- ///
- CompileUnit *FindCompileUnit(CompileUnitDesc *UnitDesc) {
- CompileUnit *Unit = DescToUnitMap[UnitDesc];
- assert(Unit && "Missing compile unit.");
- return Unit;
- }
-
- /// NewGlobalVariable - Add a new global variable DIE.
- ///
- DIE *NewGlobalVariable(GlobalVariableDesc *GVD) {
- // Get the compile unit context.
- CompileUnitDesc *UnitDesc =
- static_cast<CompileUnitDesc *>(GVD->getContext());
- CompileUnit *Unit = GetBaseCompileUnit();
-
- // Check for pre-existence.
- DIE *&Slot = Unit->getDieMapSlotFor(GVD);
- if (Slot) return Slot;
-
- // Get the global variable itself.
- GlobalVariable *GV = GVD->getGlobalVariable();
-
- const std::string &Name = GVD->getName();
- const std::string &FullName = GVD->getFullName();
- const std::string &LinkageName = GVD->getLinkageName();
- // Create the global's variable DIE.
- DIE *VariableDie = new DIE(DW_TAG_variable);
- AddString(VariableDie, DW_AT_name, DW_FORM_string, Name);
- if (!LinkageName.empty()) {
- AddString(VariableDie, DW_AT_MIPS_linkage_name, DW_FORM_string,
- LinkageName);
- }
- AddType(VariableDie, GVD->getType(), Unit);
- if (!GVD->isStatic())
- AddUInt(VariableDie, DW_AT_external, DW_FORM_flag, 1);
-
- // Add source line info if available.
- AddSourceLine(VariableDie, UnitDesc, GVD->getLine());
-
- // Add address.
- DIEBlock *Block = new DIEBlock();
- AddUInt(Block, 0, DW_FORM_data1, DW_OP_addr);
- AddObjectLabel(Block, 0, DW_FORM_udata, Asm->getGlobalLinkName(GV));
- AddBlock(VariableDie, DW_AT_location, 0, Block);
-
- // Add to map.
- Slot = VariableDie;
-
- // Add to context owner.
- Unit->getDie()->AddChild(VariableDie);
-
- // Expose as global.
- // FIXME - need to check external flag.
- Unit->AddGlobal(FullName, VariableDie);
-
- return VariableDie;
- }
-
- /// NewSubprogram - Add a new subprogram DIE.
- ///
- DIE *NewSubprogram(SubprogramDesc *SPD) {
- // Get the compile unit context.
- CompileUnitDesc *UnitDesc =
- static_cast<CompileUnitDesc *>(SPD->getContext());
- CompileUnit *Unit = GetBaseCompileUnit();
-
- // Check for pre-existence.
- DIE *&Slot = Unit->getDieMapSlotFor(SPD);
- if (Slot) return Slot;
-
- // Gather the details (simplify add attribute code.)
- const std::string &Name = SPD->getName();
- const std::string &FullName = SPD->getFullName();
- const std::string &LinkageName = SPD->getLinkageName();
-
- DIE *SubprogramDie = new DIE(DW_TAG_subprogram);
- AddString(SubprogramDie, DW_AT_name, DW_FORM_string, Name);
- if (!LinkageName.empty()) {
- AddString(SubprogramDie, DW_AT_MIPS_linkage_name, DW_FORM_string,
- LinkageName);
- }
- if (SPD->getType()) AddType(SubprogramDie, SPD->getType(), Unit);
- if (!SPD->isStatic())
- AddUInt(SubprogramDie, DW_AT_external, DW_FORM_flag, 1);
- AddUInt(SubprogramDie, DW_AT_prototyped, DW_FORM_flag, 1);
-
- // Add source line info if available.
- AddSourceLine(SubprogramDie, UnitDesc, SPD->getLine());
-
- // Add to map.
- Slot = SubprogramDie;
-
- // Add to context owner.
- Unit->getDie()->AddChild(SubprogramDie);
-
- // Expose as global.
- Unit->AddGlobal(FullName, SubprogramDie);
-
- return SubprogramDie;
- }
-
- /// NewScopeVariable - Create a new scope variable.
- ///
- DIE *NewScopeVariable(DebugVariable *DV, CompileUnit *Unit) {
- // Get the descriptor.
- VariableDesc *VD = DV->getDesc();
-
- // Translate tag to proper Dwarf tag. The result variable is dropped for
- // now.
- unsigned Tag;
- switch (VD->getTag()) {
- case DW_TAG_return_variable: return NULL;
- case DW_TAG_arg_variable: Tag = DW_TAG_formal_parameter; break;
- case DW_TAG_auto_variable: // fall thru
- default: Tag = DW_TAG_variable; break;
- }
-
- // Define variable debug information entry.
- DIE *VariableDie = new DIE(Tag);
- AddString(VariableDie, DW_AT_name, DW_FORM_string, VD->getName());
-
- // Add source line info if available.
- AddSourceLine(VariableDie, VD->getFile(), VD->getLine());
-
- // Add variable type.
- AddType(VariableDie, VD->getType(), Unit);
-
- // Add variable address.
- MachineLocation Location;
- Location.set(RI->getFrameRegister(*MF),
- RI->getFrameIndexOffset(*MF, DV->getFrameIndex()));
- AddAddress(VariableDie, DW_AT_location, Location);
-
- return VariableDie;
- }
-
- /// ConstructScope - Construct the components of a scope.
- ///
- void ConstructScope(DebugScope *ParentScope,
- unsigned ParentStartID, unsigned ParentEndID,
- DIE *ParentDie, CompileUnit *Unit) {
- // Add variables to scope.
- std::vector<DebugVariable *> &Variables = ParentScope->getVariables();
- for (unsigned i = 0, N = Variables.size(); i < N; ++i) {
- DIE *VariableDie = NewScopeVariable(Variables[i], Unit);
- if (VariableDie) ParentDie->AddChild(VariableDie);
- }
-
- // Add nested scopes.
- std::vector<DebugScope *> &Scopes = ParentScope->getScopes();
- for (unsigned j = 0, M = Scopes.size(); j < M; ++j) {
- // Define the Scope debug information entry.
- DebugScope *Scope = Scopes[j];
- // FIXME - Ignore inlined functions for the time being.
- if (!Scope->getParent()) continue;
-
- unsigned StartID = MMI->MappedLabel(Scope->getStartLabelID());
- unsigned EndID = MMI->MappedLabel(Scope->getEndLabelID());
-
- // Ignore empty scopes.
- if (StartID == EndID && StartID != 0) continue;
- if (Scope->getScopes().empty() && Scope->getVariables().empty()) continue;
-
- if (StartID == ParentStartID && EndID == ParentEndID) {
- // Just add stuff to the parent scope.
- ConstructScope(Scope, ParentStartID, ParentEndID, ParentDie, Unit);
- } else {
- DIE *ScopeDie = new DIE(DW_TAG_lexical_block);
-
- // Add the scope bounds.
- if (StartID) {
- AddLabel(ScopeDie, DW_AT_low_pc, DW_FORM_addr,
- DWLabel("label", StartID));
- } else {
- AddLabel(ScopeDie, DW_AT_low_pc, DW_FORM_addr,
- DWLabel("func_begin", SubprogramCount));
- }
- if (EndID) {
- AddLabel(ScopeDie, DW_AT_high_pc, DW_FORM_addr,
- DWLabel("label", EndID));
- } else {
- AddLabel(ScopeDie, DW_AT_high_pc, DW_FORM_addr,
- DWLabel("func_end", SubprogramCount));
- }
-
- // Add the scope contents.
- ConstructScope(Scope, StartID, EndID, ScopeDie, Unit);
- ParentDie->AddChild(ScopeDie);
- }
- }
- }
-
- /// ConstructRootScope - Construct the scope for the subprogram.
- ///
- void ConstructRootScope(DebugScope *RootScope) {
- // Exit if there is no root scope.
- if (!RootScope) return;
-
- // Get the subprogram debug information entry.
- SubprogramDesc *SPD = cast<SubprogramDesc>(RootScope->getDesc());
-
- // Get the compile unit context.
- CompileUnit *Unit = GetBaseCompileUnit();
-
- // Get the subprogram die.
- DIE *SPDie = Unit->getDieMapSlotFor(SPD);
- assert(SPDie && "Missing subprogram descriptor");
-
- // Add the function bounds.
- AddLabel(SPDie, DW_AT_low_pc, DW_FORM_addr,
- DWLabel("func_begin", SubprogramCount));
- AddLabel(SPDie, DW_AT_high_pc, DW_FORM_addr,
- DWLabel("func_end", SubprogramCount));
- MachineLocation Location(RI->getFrameRegister(*MF));
- AddAddress(SPDie, DW_AT_frame_base, Location);
-
- ConstructScope(RootScope, 0, 0, SPDie, Unit);
- }
-
- /// EmitInitial - Emit initial Dwarf declarations. This is necessary for cc
- /// tools to recognize the object file contains Dwarf information.
- void EmitInitial() {
- // Check to see if we already emitted intial headers.
- if (didInitial) return;
- didInitial = true;
-
- // Dwarf sections base addresses.
- if (TAI->doesDwarfRequireFrameSection()) {
- Asm->SwitchToDataSection(TAI->getDwarfFrameSection());
- EmitLabel("section_debug_frame", 0);
- }
- Asm->SwitchToDataSection(TAI->getDwarfInfoSection());
- EmitLabel("section_info", 0);
- Asm->SwitchToDataSection(TAI->getDwarfAbbrevSection());
- EmitLabel("section_abbrev", 0);
- Asm->SwitchToDataSection(TAI->getDwarfARangesSection());
- EmitLabel("section_aranges", 0);
- Asm->SwitchToDataSection(TAI->getDwarfMacInfoSection());
- EmitLabel("section_macinfo", 0);
- Asm->SwitchToDataSection(TAI->getDwarfLineSection());
- EmitLabel("section_line", 0);
- Asm->SwitchToDataSection(TAI->getDwarfLocSection());
- EmitLabel("section_loc", 0);
- Asm->SwitchToDataSection(TAI->getDwarfPubNamesSection());
- EmitLabel("section_pubnames", 0);
- Asm->SwitchToDataSection(TAI->getDwarfStrSection());
- EmitLabel("section_str", 0);
- Asm->SwitchToDataSection(TAI->getDwarfRangesSection());
- EmitLabel("section_ranges", 0);
-
- Asm->SwitchToTextSection(TAI->getTextSection());
- EmitLabel("text_begin", 0);
- Asm->SwitchToDataSection(TAI->getDataSection());
- EmitLabel("data_begin", 0);
- }
-
- /// EmitDIE - Recusively Emits a debug information entry.
- ///
- void EmitDIE(DIE *Die) {
- // Get the abbreviation for this DIE.
- unsigned AbbrevNumber = Die->getAbbrevNumber();
- const DIEAbbrev *Abbrev = Abbreviations[AbbrevNumber - 1];
-
- Asm->EOL();
-
- // Emit the code (index) for the abbreviation.
- Asm->EmitULEB128Bytes(AbbrevNumber);
- Asm->EOL(std::string("Abbrev [" +
- utostr(AbbrevNumber) +
- "] 0x" + utohexstr(Die->getOffset()) +
- ":0x" + utohexstr(Die->getSize()) + " " +
- TagString(Abbrev->getTag())));
-
- std::vector<DIEValue *> &Values = Die->getValues();
- const std::vector<DIEAbbrevData> &AbbrevData = Abbrev->getData();
-
- // Emit the DIE attribute values.
- for (unsigned i = 0, N = Values.size(); i < N; ++i) {
- unsigned Attr = AbbrevData[i].getAttribute();
- unsigned Form = AbbrevData[i].getForm();
- assert(Form && "Too many attributes for DIE (check abbreviation)");
-
- switch (Attr) {
- case DW_AT_sibling: {
- Asm->EmitInt32(Die->SiblingOffset());
- break;
- }
- default: {
- // Emit an attribute using the defined form.
- Values[i]->EmitValue(*this, Form);
- break;
- }
- }
-
- Asm->EOL(AttributeString(Attr));
- }
-
- // Emit the DIE children if any.
- if (Abbrev->getChildrenFlag() == DW_CHILDREN_yes) {
- const std::vector<DIE *> &Children = Die->getChildren();
-
- for (unsigned j = 0, M = Children.size(); j < M; ++j) {
- EmitDIE(Children[j]);
- }
-
- Asm->EmitInt8(0); Asm->EOL("End Of Children Mark");
- }
- }
-
- /// SizeAndOffsetDie - Compute the size and offset of a DIE.
- ///
- unsigned SizeAndOffsetDie(DIE *Die, unsigned Offset, bool Last) {
- // Get the children.
- const std::vector<DIE *> &Children = Die->getChildren();
-
- // If not last sibling and has children then add sibling offset attribute.
- if (!Last && !Children.empty()) Die->AddSiblingOffset();
-
- // Record the abbreviation.
- AssignAbbrevNumber(Die->getAbbrev());
-
- // Get the abbreviation for this DIE.
- unsigned AbbrevNumber = Die->getAbbrevNumber();
- const DIEAbbrev *Abbrev = Abbreviations[AbbrevNumber - 1];
-
- // Set DIE offset
- Die->setOffset(Offset);
-
- // Start the size with the size of abbreviation code.
- Offset += Asm->SizeULEB128(AbbrevNumber);
-
- const std::vector<DIEValue *> &Values = Die->getValues();
- const std::vector<DIEAbbrevData> &AbbrevData = Abbrev->getData();
-
- // Size the DIE attribute values.
- for (unsigned i = 0, N = Values.size(); i < N; ++i) {
- // Size attribute value.
- Offset += Values[i]->SizeOf(*this, AbbrevData[i].getForm());
- }
-
- // Size the DIE children if any.
- if (!Children.empty()) {
- assert(Abbrev->getChildrenFlag() == DW_CHILDREN_yes &&
- "Children flag not set");
-
- for (unsigned j = 0, M = Children.size(); j < M; ++j) {
- Offset = SizeAndOffsetDie(Children[j], Offset, (j + 1) == M);
- }
-
- // End of children marker.
- Offset += sizeof(int8_t);
- }
-
- Die->setSize(Offset - Die->getOffset());
- return Offset;
- }
-
- /// SizeAndOffsets - Compute the size and offset of all the DIEs.
- ///
- void SizeAndOffsets() {
- // Process base compile unit.
- CompileUnit *Unit = GetBaseCompileUnit();
- // Compute size of compile unit header
- unsigned Offset = sizeof(int32_t) + // Length of Compilation Unit Info
- sizeof(int16_t) + // DWARF version number
- sizeof(int32_t) + // Offset Into Abbrev. Section
- sizeof(int8_t); // Pointer Size (in bytes)
- SizeAndOffsetDie(Unit->getDie(), Offset, true);
- }
-
- /// EmitDebugInfo - Emit the debug info section.
- ///
- void EmitDebugInfo() {
- // Start debug info section.
- Asm->SwitchToDataSection(TAI->getDwarfInfoSection());
-
- CompileUnit *Unit = GetBaseCompileUnit();
- DIE *Die = Unit->getDie();
- // Emit the compile units header.
- EmitLabel("info_begin", Unit->getID());
- // Emit size of content not including length itself
- unsigned ContentSize = Die->getSize() +
- sizeof(int16_t) + // DWARF version number
- sizeof(int32_t) + // Offset Into Abbrev. Section
- sizeof(int8_t) + // Pointer Size (in bytes)
- sizeof(int32_t); // FIXME - extra pad for gdb bug.
-
- Asm->EmitInt32(ContentSize); Asm->EOL("Length of Compilation Unit Info");
- Asm->EmitInt16(DWARF_VERSION); Asm->EOL("DWARF version number");
- EmitSectionOffset("abbrev_begin", "section_abbrev", 0, 0, true, false);
- Asm->EOL("Offset Into Abbrev. Section");
- Asm->EmitInt8(TD->getPointerSize()); Asm->EOL("Address Size (in bytes)");
-
- EmitDIE(Die);
- // FIXME - extra padding for gdb bug.
- Asm->EmitInt8(0); Asm->EOL("Extra Pad For GDB");
- Asm->EmitInt8(0); Asm->EOL("Extra Pad For GDB");
- Asm->EmitInt8(0); Asm->EOL("Extra Pad For GDB");
- Asm->EmitInt8(0); Asm->EOL("Extra Pad For GDB");
- EmitLabel("info_end", Unit->getID());
-
- Asm->EOL();
- }
-
- /// EmitAbbreviations - Emit the abbreviation section.
- ///
- void EmitAbbreviations() const {
- // Check to see if it is worth the effort.
- if (!Abbreviations.empty()) {
- // Start the debug abbrev section.
- Asm->SwitchToDataSection(TAI->getDwarfAbbrevSection());
-
- EmitLabel("abbrev_begin", 0);
-
- // For each abbrevation.
- for (unsigned i = 0, N = Abbreviations.size(); i < N; ++i) {
- // Get abbreviation data
- const DIEAbbrev *Abbrev = Abbreviations[i];
-
- // Emit the abbrevations code (base 1 index.)
- Asm->EmitULEB128Bytes(Abbrev->getNumber());
- Asm->EOL("Abbreviation Code");
-
- // Emit the abbreviations data.
- Abbrev->Emit(*this);
-
- Asm->EOL();
- }
-
- // Mark end of abbreviations.
- Asm->EmitULEB128Bytes(0); Asm->EOL("EOM(3)");
-
- EmitLabel("abbrev_end", 0);
-
- Asm->EOL();
- }
- }
-
- /// EmitDebugLines - Emit source line information.
- ///
- void EmitDebugLines() {
- // If there are no lines to emit (such as when we're using .loc directives
- // to emit .debug_line information) don't emit a .debug_line header.
- if (SectionSourceLines.empty())
- return;
-
- // Minimum line delta, thus ranging from -10..(255-10).
- const int MinLineDelta = -(DW_LNS_fixed_advance_pc + 1);
- // Maximum line delta, thus ranging from -10..(255-10).
- const int MaxLineDelta = 255 + MinLineDelta;
-
- // Start the dwarf line section.
- Asm->SwitchToDataSection(TAI->getDwarfLineSection());
-
- // Construct the section header.
-
- EmitDifference("line_end", 0, "line_begin", 0, true);
- Asm->EOL("Length of Source Line Info");
- EmitLabel("line_begin", 0);
-
- Asm->EmitInt16(DWARF_VERSION); Asm->EOL("DWARF version number");
-
- EmitDifference("line_prolog_end", 0, "line_prolog_begin", 0, true);
- Asm->EOL("Prolog Length");
- EmitLabel("line_prolog_begin", 0);
-
- Asm->EmitInt8(1); Asm->EOL("Minimum Instruction Length");
-
- Asm->EmitInt8(1); Asm->EOL("Default is_stmt_start flag");
-
- Asm->EmitInt8(MinLineDelta); Asm->EOL("Line Base Value (Special Opcodes)");
-
- Asm->EmitInt8(MaxLineDelta); Asm->EOL("Line Range Value (Special Opcodes)");
-
- Asm->EmitInt8(-MinLineDelta); Asm->EOL("Special Opcode Base");
-
- // Line number standard opcode encodings argument count
- Asm->EmitInt8(0); Asm->EOL("DW_LNS_copy arg count");
- Asm->EmitInt8(1); Asm->EOL("DW_LNS_advance_pc arg count");
- Asm->EmitInt8(1); Asm->EOL("DW_LNS_advance_line arg count");
- Asm->EmitInt8(1); Asm->EOL("DW_LNS_set_file arg count");
- Asm->EmitInt8(1); Asm->EOL("DW_LNS_set_column arg count");
- Asm->EmitInt8(0); Asm->EOL("DW_LNS_negate_stmt arg count");
- Asm->EmitInt8(0); Asm->EOL("DW_LNS_set_basic_block arg count");
- Asm->EmitInt8(0); Asm->EOL("DW_LNS_const_add_pc arg count");
- Asm->EmitInt8(1); Asm->EOL("DW_LNS_fixed_advance_pc arg count");
-
- const UniqueVector<std::string> &Directories = MMI->getDirectories();
- const UniqueVector<SourceFileInfo>
- &SourceFiles = MMI->getSourceFiles();
-
- // Emit directories.
- for (unsigned DirectoryID = 1, NDID = Directories.size();
- DirectoryID <= NDID; ++DirectoryID) {
- Asm->EmitString(Directories[DirectoryID]); Asm->EOL("Directory");
- }
- Asm->EmitInt8(0); Asm->EOL("End of directories");
-
- // Emit files.
- for (unsigned SourceID = 1, NSID = SourceFiles.size();
- SourceID <= NSID; ++SourceID) {
- const SourceFileInfo &SourceFile = SourceFiles[SourceID];
- Asm->EmitString(SourceFile.getName());
- Asm->EOL("Source");
- Asm->EmitULEB128Bytes(SourceFile.getDirectoryID());
- Asm->EOL("Directory #");
- Asm->EmitULEB128Bytes(0);
- Asm->EOL("Mod date");
- Asm->EmitULEB128Bytes(0);
- Asm->EOL("File size");
- }
- Asm->EmitInt8(0); Asm->EOL("End of files");
-
- EmitLabel("line_prolog_end", 0);
-
- // A sequence for each text section.
- for (unsigned j = 0, M = SectionSourceLines.size(); j < M; ++j) {
- // Isolate current sections line info.
- const std::vector<SourceLineInfo> &LineInfos = SectionSourceLines[j];
-
- Asm->EOL(std::string("Section ") + SectionMap[j + 1]);
-
- // Dwarf assumes we start with first line of first source file.
- unsigned Source = 1;
- unsigned Line = 1;
-
- // Construct rows of the address, source, line, column matrix.
- for (unsigned i = 0, N = LineInfos.size(); i < N; ++i) {
- const SourceLineInfo &LineInfo = LineInfos[i];
- unsigned LabelID = MMI->MappedLabel(LineInfo.getLabelID());
- if (!LabelID) continue;
-
- unsigned SourceID = LineInfo.getSourceID();
- const SourceFileInfo &SourceFile = SourceFiles[SourceID];
- unsigned DirectoryID = SourceFile.getDirectoryID();
- Asm->EOL(Directories[DirectoryID]
- + SourceFile.getName()
- + ":"
- + utostr_32(LineInfo.getLine()));
-
- // Define the line address.
- Asm->EmitInt8(0); Asm->EOL("Extended Op");
- Asm->EmitInt8(TD->getPointerSize() + 1); Asm->EOL("Op size");
- Asm->EmitInt8(DW_LNE_set_address); Asm->EOL("DW_LNE_set_address");
- EmitReference("label", LabelID); Asm->EOL("Location label");
-
- // If change of source, then switch to the new source.
- if (Source != LineInfo.getSourceID()) {
- Source = LineInfo.getSourceID();
- Asm->EmitInt8(DW_LNS_set_file); Asm->EOL("DW_LNS_set_file");
- Asm->EmitULEB128Bytes(Source); Asm->EOL("New Source");
- }
-
- // If change of line.
- if (Line != LineInfo.getLine()) {
- // Determine offset.
- int Offset = LineInfo.getLine() - Line;
- int Delta = Offset - MinLineDelta;
-
- // Update line.
- Line = LineInfo.getLine();
-
- // If delta is small enough and in range...
- if (Delta >= 0 && Delta < (MaxLineDelta - 1)) {
- // ... then use fast opcode.
- Asm->EmitInt8(Delta - MinLineDelta); Asm->EOL("Line Delta");
- } else {
- // ... otherwise use long hand.
- Asm->EmitInt8(DW_LNS_advance_line); Asm->EOL("DW_LNS_advance_line");
- Asm->EmitSLEB128Bytes(Offset); Asm->EOL("Line Offset");
- Asm->EmitInt8(DW_LNS_copy); Asm->EOL("DW_LNS_copy");
- }
- } else {
- // Copy the previous row (different address or source)
- Asm->EmitInt8(DW_LNS_copy); Asm->EOL("DW_LNS_copy");
- }
- }
-
- // Define last address of section.
- Asm->EmitInt8(0); Asm->EOL("Extended Op");
- Asm->EmitInt8(TD->getPointerSize() + 1); Asm->EOL("Op size");
- Asm->EmitInt8(DW_LNE_set_address); Asm->EOL("DW_LNE_set_address");
- EmitReference("section_end", j + 1); Asm->EOL("Section end label");
-
- // Mark end of matrix.
- Asm->EmitInt8(0); Asm->EOL("DW_LNE_end_sequence");
- Asm->EmitULEB128Bytes(1); Asm->EOL();
- Asm->EmitInt8(1); Asm->EOL();
- }
-
- EmitLabel("line_end", 0);
-
- Asm->EOL();
- }
-
- /// EmitCommonDebugFrame - Emit common frame info into a debug frame section.
- ///
- void EmitCommonDebugFrame() {
- if (!TAI->doesDwarfRequireFrameSection())
- return;
-
- int stackGrowth =
- Asm->TM.getFrameInfo()->getStackGrowthDirection() ==
- TargetFrameInfo::StackGrowsUp ?
- TD->getPointerSize() : -TD->getPointerSize();
-
- // Start the dwarf frame section.
- Asm->SwitchToDataSection(TAI->getDwarfFrameSection());
-
- EmitLabel("debug_frame_common", 0);
- EmitDifference("debug_frame_common_end", 0,
- "debug_frame_common_begin", 0, true);
- Asm->EOL("Length of Common Information Entry");
-
- EmitLabel("debug_frame_common_begin", 0);
- Asm->EmitInt32((int)DW_CIE_ID);
- Asm->EOL("CIE Identifier Tag");
- Asm->EmitInt8(DW_CIE_VERSION);
- Asm->EOL("CIE Version");
- Asm->EmitString("");
- Asm->EOL("CIE Augmentation");
- Asm->EmitULEB128Bytes(1);
- Asm->EOL("CIE Code Alignment Factor");
- Asm->EmitSLEB128Bytes(stackGrowth);
- Asm->EOL("CIE Data Alignment Factor");
- Asm->EmitInt8(RI->getDwarfRegNum(RI->getRARegister(), false));
- Asm->EOL("CIE RA Column");
-
- std::vector<MachineMove> Moves;
- RI->getInitialFrameState(Moves);
-
- EmitFrameMoves(NULL, 0, Moves, false);
-
- Asm->EmitAlignment(2, 0, 0, false);
- EmitLabel("debug_frame_common_end", 0);
-
- Asm->EOL();
- }
-
- /// EmitFunctionDebugFrame - Emit per function frame info into a debug frame
- /// section.
- void EmitFunctionDebugFrame(const FunctionDebugFrameInfo &DebugFrameInfo) {
- if (!TAI->doesDwarfRequireFrameSection())
- return;
-
- // Start the dwarf frame section.
- Asm->SwitchToDataSection(TAI->getDwarfFrameSection());
-
- EmitDifference("debug_frame_end", DebugFrameInfo.Number,
- "debug_frame_begin", DebugFrameInfo.Number, true);
- Asm->EOL("Length of Frame Information Entry");
-
- EmitLabel("debug_frame_begin", DebugFrameInfo.Number);
-
- EmitSectionOffset("debug_frame_common", "section_debug_frame",
- 0, 0, true, false);
- Asm->EOL("FDE CIE offset");
-
- EmitReference("func_begin", DebugFrameInfo.Number);
- Asm->EOL("FDE initial location");
- EmitDifference("func_end", DebugFrameInfo.Number,
- "func_begin", DebugFrameInfo.Number);
- Asm->EOL("FDE address range");
-
- EmitFrameMoves("func_begin", DebugFrameInfo.Number, DebugFrameInfo.Moves, false);
-
- Asm->EmitAlignment(2, 0, 0, false);
- EmitLabel("debug_frame_end", DebugFrameInfo.Number);
-
- Asm->EOL();
- }
-
- /// EmitDebugPubNames - Emit visible names into a debug pubnames section.
- ///
- void EmitDebugPubNames() {
- // Start the dwarf pubnames section.
- Asm->SwitchToDataSection(TAI->getDwarfPubNamesSection());
-
- CompileUnit *Unit = GetBaseCompileUnit();
-
- EmitDifference("pubnames_end", Unit->getID(),
- "pubnames_begin", Unit->getID(), true);
- Asm->EOL("Length of Public Names Info");
-
- EmitLabel("pubnames_begin", Unit->getID());
-
- Asm->EmitInt16(DWARF_VERSION); Asm->EOL("DWARF Version");
-
- EmitSectionOffset("info_begin", "section_info",
- Unit->getID(), 0, true, false);
- Asm->EOL("Offset of Compilation Unit Info");
-
- EmitDifference("info_end", Unit->getID(), "info_begin", Unit->getID(),true);
- Asm->EOL("Compilation Unit Length");
-
- std::map<std::string, DIE *> &Globals = Unit->getGlobals();
-
- for (std::map<std::string, DIE *>::iterator GI = Globals.begin(),
- GE = Globals.end();
- GI != GE; ++GI) {
- const std::string &Name = GI->first;
- DIE * Entity = GI->second;
-
- Asm->EmitInt32(Entity->getOffset()); Asm->EOL("DIE offset");
- Asm->EmitString(Name); Asm->EOL("External Name");
- }
-
- Asm->EmitInt32(0); Asm->EOL("End Mark");
- EmitLabel("pubnames_end", Unit->getID());
-
- Asm->EOL();
- }
-
- /// EmitDebugStr - Emit visible names into a debug str section.
- ///
- void EmitDebugStr() {
- // Check to see if it is worth the effort.
- if (!StringPool.empty()) {
- // Start the dwarf str section.
- Asm->SwitchToDataSection(TAI->getDwarfStrSection());
-
- // For each of strings in the string pool.
- for (unsigned StringID = 1, N = StringPool.size();
- StringID <= N; ++StringID) {
- // Emit a label for reference from debug information entries.
- EmitLabel("string", StringID);
- // Emit the string itself.
- const std::string &String = StringPool[StringID];
- Asm->EmitString(String); Asm->EOL();
- }
-
- Asm->EOL();
- }
- }
-
- /// EmitDebugLoc - Emit visible names into a debug loc section.
- ///
- void EmitDebugLoc() {
- // Start the dwarf loc section.
- Asm->SwitchToDataSection(TAI->getDwarfLocSection());
-
- Asm->EOL();
- }
-
- /// EmitDebugARanges - Emit visible names into a debug aranges section.
- ///
- void EmitDebugARanges() {
- // Start the dwarf aranges section.
- Asm->SwitchToDataSection(TAI->getDwarfARangesSection());
-
- // FIXME - Mock up
- #if 0
- CompileUnit *Unit = GetBaseCompileUnit();
-
- // Don't include size of length
- Asm->EmitInt32(0x1c); Asm->EOL("Length of Address Ranges Info");
-
- Asm->EmitInt16(DWARF_VERSION); Asm->EOL("Dwarf Version");
-
- EmitReference("info_begin", Unit->getID());
- Asm->EOL("Offset of Compilation Unit Info");
-
- Asm->EmitInt8(TD->getPointerSize()); Asm->EOL("Size of Address");
-
- Asm->EmitInt8(0); Asm->EOL("Size of Segment Descriptor");
-
- Asm->EmitInt16(0); Asm->EOL("Pad (1)");
- Asm->EmitInt16(0); Asm->EOL("Pad (2)");
-
- // Range 1
- EmitReference("text_begin", 0); Asm->EOL("Address");
- EmitDifference("text_end", 0, "text_begin", 0, true); Asm->EOL("Length");
-
- Asm->EmitInt32(0); Asm->EOL("EOM (1)");
- Asm->EmitInt32(0); Asm->EOL("EOM (2)");
- #endif
-
- Asm->EOL();
- }
-
- /// EmitDebugRanges - Emit visible names into a debug ranges section.
- ///
- void EmitDebugRanges() {
- // Start the dwarf ranges section.
- Asm->SwitchToDataSection(TAI->getDwarfRangesSection());
-
- Asm->EOL();
- }
-
- /// EmitDebugMacInfo - Emit visible names into a debug macinfo section.
- ///
- void EmitDebugMacInfo() {
- // Start the dwarf macinfo section.
- Asm->SwitchToDataSection(TAI->getDwarfMacInfoSection());
-
- Asm->EOL();
- }
-
- /// ConstructCompileUnitDIEs - Create a compile unit DIE for each source and
- /// header file.
- void ConstructCompileUnitDIEs() {
- const UniqueVector<CompileUnitDesc *> CUW = MMI->getCompileUnits();
-
- for (unsigned i = 1, N = CUW.size(); i <= N; ++i) {
- unsigned ID = MMI->RecordSource(CUW[i]);
- CompileUnit *Unit = NewCompileUnit(CUW[i], ID);
- CompileUnits.push_back(Unit);
- }
- }
-
- /// ConstructGlobalDIEs - Create DIEs for each of the externally visible
- /// global variables.
- void ConstructGlobalDIEs() {
- std::vector<GlobalVariableDesc *> GlobalVariables =
- MMI->getAnchoredDescriptors<GlobalVariableDesc>(*M);
-
- for (unsigned i = 0, N = GlobalVariables.size(); i < N; ++i) {
- GlobalVariableDesc *GVD = GlobalVariables[i];
- NewGlobalVariable(GVD);
- }
- }
-
- /// ConstructSubprogramDIEs - Create DIEs for each of the externally visible
- /// subprograms.
- void ConstructSubprogramDIEs() {
- std::vector<SubprogramDesc *> Subprograms =
- MMI->getAnchoredDescriptors<SubprogramDesc>(*M);
-
- for (unsigned i = 0, N = Subprograms.size(); i < N; ++i) {
- SubprogramDesc *SPD = Subprograms[i];
- NewSubprogram(SPD);
- }
- }
-
-public:
- //===--------------------------------------------------------------------===//
- // Main entry points.
- //
- DwarfDebug(std::ostream &OS, AsmPrinter *A, const TargetAsmInfo *T)
- : Dwarf(OS, A, T, "dbg")
- , CompileUnits()
- , AbbreviationsSet(InitAbbreviationsSetSize)
- , Abbreviations()
- , ValuesSet(InitValuesSetSize)
- , Values()
- , StringPool()
- , DescToUnitMap()
- , SectionMap()
- , SectionSourceLines()
- , didInitial(false)
- , shouldEmit(false)
- {
- }
- virtual ~DwarfDebug() {
- for (unsigned i = 0, N = CompileUnits.size(); i < N; ++i)
- delete CompileUnits[i];
- for (unsigned j = 0, M = Values.size(); j < M; ++j)
- delete Values[j];
- }
-
- /// SetModuleInfo - Set machine module information when it's known that pass
- /// manager has created it. Set by the target AsmPrinter.
- void SetModuleInfo(MachineModuleInfo *mmi) {
- // Make sure initial declarations are made.
- if (!MMI && mmi->hasDebugInfo()) {
- MMI = mmi;
- shouldEmit = true;
-
- // Create all the compile unit DIEs.
- ConstructCompileUnitDIEs();
-
- // Create DIEs for each of the externally visible global variables.
- ConstructGlobalDIEs();
-
- // Create DIEs for each of the externally visible subprograms.
- ConstructSubprogramDIEs();
-
- // Prime section data.
- SectionMap.insert(TAI->getTextSection());
-
- // Print out .file directives to specify files for .loc directives. These
- // are printed out early so that they precede any .loc directives.
- if (TAI->hasDotLocAndDotFile()) {
- const UniqueVector<SourceFileInfo> &SourceFiles = MMI->getSourceFiles();
- const UniqueVector<std::string> &Directories = MMI->getDirectories();
- for (unsigned i = 1, e = SourceFiles.size(); i <= e; ++i) {
- sys::Path FullPath(Directories[SourceFiles[i].getDirectoryID()]);
- bool AppendOk = FullPath.appendComponent(SourceFiles[i].getName());
- assert(AppendOk && "Could not append filename to directory!");
- Asm->EmitFile(i, FullPath.toString());
- Asm->EOL();
- }
- }
-
- // Emit initial sections
- EmitInitial();
- }
- }
-
- /// BeginModule - Emit all Dwarf sections that should come prior to the
- /// content.
- void BeginModule(Module *M) {
- this->M = M;
-
- if (!ShouldEmitDwarf()) return;
- }
-
- /// EndModule - Emit all Dwarf sections that should come after the content.
- ///
- void EndModule() {
- if (!ShouldEmitDwarf()) return;
-
- // Standard sections final addresses.
- Asm->SwitchToTextSection(TAI->getTextSection());
- EmitLabel("text_end", 0);
- Asm->SwitchToDataSection(TAI->getDataSection());
- EmitLabel("data_end", 0);
-
- // End text sections.
- for (unsigned i = 1, N = SectionMap.size(); i <= N; ++i) {
- Asm->SwitchToTextSection(SectionMap[i].c_str());
- EmitLabel("section_end", i);
- }
-
- // Emit common frame information.
- EmitCommonDebugFrame();
-
- // Emit function debug frame information
- for (std::vector<FunctionDebugFrameInfo>::iterator I = DebugFrames.begin(),
- E = DebugFrames.end(); I != E; ++I)
- EmitFunctionDebugFrame(*I);
-
- // Compute DIE offsets and sizes.
- SizeAndOffsets();
-
- // Emit all the DIEs into a debug info section
- EmitDebugInfo();
-
- // Corresponding abbreviations into a abbrev section.
- EmitAbbreviations();
-
- // Emit source line correspondence into a debug line section.
- EmitDebugLines();
-
- // Emit info into a debug pubnames section.
- EmitDebugPubNames();
-
- // Emit info into a debug str section.
- EmitDebugStr();
-
- // Emit info into a debug loc section.
- EmitDebugLoc();
-
- // Emit info into a debug aranges section.
- EmitDebugARanges();
-
- // Emit info into a debug ranges section.
- EmitDebugRanges();
-
- // Emit info into a debug macinfo section.
- EmitDebugMacInfo();
- }
-
- /// BeginFunction - Gather pre-function debug information. Assumes being
- /// emitted immediately after the function entry point.
- void BeginFunction(MachineFunction *MF) {
- this->MF = MF;
-
- if (!ShouldEmitDwarf()) return;
-
- // Begin accumulating function debug information.
- MMI->BeginFunction(MF);
-
- // Assumes in correct section after the entry point.
- EmitLabel("func_begin", ++SubprogramCount);
-
- // Emit label for the implicitly defined dbg.stoppoint at the start of
- // the function.
- const std::vector<SourceLineInfo> &LineInfos = MMI->getSourceLines();
- if (!LineInfos.empty()) {
- const SourceLineInfo &LineInfo = LineInfos[0];
- Asm->printLabel(LineInfo.getLabelID());
- }
- }
-
- /// EndFunction - Gather and emit post-function debug information.
- ///
- void EndFunction() {
- if (!ShouldEmitDwarf()) return;
-
- // Define end label for subprogram.
- EmitLabel("func_end", SubprogramCount);
-
- // Get function line info.
- const std::vector<SourceLineInfo> &LineInfos = MMI->getSourceLines();
-
- if (!LineInfos.empty()) {
- // Get section line info.
- unsigned ID = SectionMap.insert(Asm->CurrentSection);
- if (SectionSourceLines.size() < ID) SectionSourceLines.resize(ID);
- std::vector<SourceLineInfo> &SectionLineInfos = SectionSourceLines[ID-1];
- // Append the function info to section info.
- SectionLineInfos.insert(SectionLineInfos.end(),
- LineInfos.begin(), LineInfos.end());
- }
-
- // Construct scopes for subprogram.
- ConstructRootScope(MMI->getRootScope());
-
- DebugFrames.push_back(FunctionDebugFrameInfo(SubprogramCount,
- MMI->getFrameMoves()));
- }
-};
-
-//===----------------------------------------------------------------------===//
-/// DwarfException - Emits Dwarf exception handling directives.
-///
-class DwarfException : public Dwarf {
-
-private:
- struct FunctionEHFrameInfo {
- std::string FnName;
- unsigned Number;
- unsigned PersonalityIndex;
- bool hasCalls;
- bool hasLandingPads;
- std::vector<MachineMove> Moves;
- const Function * function;
-
- FunctionEHFrameInfo(const std::string &FN, unsigned Num, unsigned P,
- bool hC, bool hL,
- const std::vector<MachineMove> &M,
- const Function *f):
- FnName(FN), Number(Num), PersonalityIndex(P),
- hasCalls(hC), hasLandingPads(hL), Moves(M), function (f) { }
- };
-
- std::vector<FunctionEHFrameInfo> EHFrames;
-
- /// shouldEmitTable - Per-function flag to indicate if EH tables should
- /// be emitted.
- bool shouldEmitTable;
-
- /// shouldEmitMoves - Per-function flag to indicate if frame moves info
- /// should be emitted.
- bool shouldEmitMoves;
-
- /// shouldEmitTableModule - Per-module flag to indicate if EH tables
- /// should be emitted.
- bool shouldEmitTableModule;
-
- /// shouldEmitFrameModule - Per-module flag to indicate if frame moves
- /// should be emitted.
- bool shouldEmitMovesModule;
-
- /// EmitCommonEHFrame - Emit the common eh unwind frame.
- ///
- void EmitCommonEHFrame(const Function *Personality, unsigned Index) {
- // Size and sign of stack growth.
- int stackGrowth =
- Asm->TM.getFrameInfo()->getStackGrowthDirection() ==
- TargetFrameInfo::StackGrowsUp ?
- TD->getPointerSize() : -TD->getPointerSize();
-
- // Begin eh frame section.
- Asm->SwitchToTextSection(TAI->getDwarfEHFrameSection());
- O << "EH_frame" << Index << ":\n";
- EmitLabel("section_eh_frame", Index);
-
- // Define base labels.
- EmitLabel("eh_frame_common", Index);
-
- // Define the eh frame length.
- EmitDifference("eh_frame_common_end", Index,
- "eh_frame_common_begin", Index, true);
- Asm->EOL("Length of Common Information Entry");
-
- // EH frame header.
- EmitLabel("eh_frame_common_begin", Index);
- Asm->EmitInt32((int)0);
- Asm->EOL("CIE Identifier Tag");
- Asm->EmitInt8(DW_CIE_VERSION);
- Asm->EOL("CIE Version");
-
- // The personality presence indicates that language specific information
- // will show up in the eh frame.
- Asm->EmitString(Personality ? "zPLR" : "zR");
- Asm->EOL("CIE Augmentation");
-
- // Round out reader.
- Asm->EmitULEB128Bytes(1);
- Asm->EOL("CIE Code Alignment Factor");
- Asm->EmitSLEB128Bytes(stackGrowth);
- Asm->EOL("CIE Data Alignment Factor");
- Asm->EmitInt8(RI->getDwarfRegNum(RI->getRARegister(), true));
- Asm->EOL("CIE Return Address Column");
-
- // If there is a personality, we need to indicate the functions location.
- if (Personality) {
- Asm->EmitULEB128Bytes(7);
- Asm->EOL("Augmentation Size");
-
- if (TAI->getNeedsIndirectEncoding()) {
- Asm->EmitInt8(DW_EH_PE_pcrel | DW_EH_PE_sdata4 | DW_EH_PE_indirect);
- Asm->EOL("Personality (pcrel sdata4 indirect)");
- } else {
- Asm->EmitInt8(DW_EH_PE_pcrel | DW_EH_PE_sdata4);
- Asm->EOL("Personality (pcrel sdata4)");
- }
-
- PrintRelDirective(true);
- O << TAI->getPersonalityPrefix();
- Asm->EmitExternalGlobal((const GlobalVariable *)(Personality));
- O << TAI->getPersonalitySuffix();
- if (strcmp(TAI->getPersonalitySuffix(), "+4@GOTPCREL"))
- O << "-" << TAI->getPCSymbol();
- Asm->EOL("Personality");
-
- Asm->EmitInt8(DW_EH_PE_pcrel | DW_EH_PE_sdata4);
- Asm->EOL("LSDA Encoding (pcrel sdata4)");
- Asm->EmitInt8(DW_EH_PE_pcrel | DW_EH_PE_sdata4);
- Asm->EOL("FDE Encoding (pcrel sdata4)");
- } else {
- Asm->EmitULEB128Bytes(1);
- Asm->EOL("Augmentation Size");
- Asm->EmitInt8(DW_EH_PE_pcrel | DW_EH_PE_sdata4);
- Asm->EOL("FDE Encoding (pcrel sdata4)");
- }
-
- // Indicate locations of general callee saved registers in frame.
- std::vector<MachineMove> Moves;
- RI->getInitialFrameState(Moves);
- EmitFrameMoves(NULL, 0, Moves, true);
-
- // On Darwin the linker honors the alignment of eh_frame, which means it
- // must be 8-byte on 64-bit targets to match what gcc does. Otherwise
- // you get holes which confuse readers of eh_frame.
- Asm->EmitAlignment(TD->getPointerSize() == sizeof(int32_t) ? 2 : 3,
- 0, 0, false);
- EmitLabel("eh_frame_common_end", Index);
-
- Asm->EOL();
- }
-
- /// EmitEHFrame - Emit function exception frame information.
- ///
- void EmitEHFrame(const FunctionEHFrameInfo &EHFrameInfo) {
- Function::LinkageTypes linkage = EHFrameInfo.function->getLinkage();
-
- Asm->SwitchToTextSection(TAI->getDwarfEHFrameSection());
-
- // Externally visible entry into the functions eh frame info.
- // If the corresponding function is static, this should not be
- // externally visible.
- if (linkage != Function::InternalLinkage) {
- if (const char *GlobalEHDirective = TAI->getGlobalEHDirective())
- O << GlobalEHDirective << EHFrameInfo.FnName << "\n";
- }
-
- // If corresponding function is weak definition, this should be too.
- if ((linkage == Function::WeakLinkage ||
- linkage == Function::LinkOnceLinkage) &&
- TAI->getWeakDefDirective())
- O << TAI->getWeakDefDirective() << EHFrameInfo.FnName << "\n";
-
- // If there are no calls then you can't unwind. This may mean we can
- // omit the EH Frame, but some environments do not handle weak absolute
- // symbols.
- // If UnwindTablesMandatory is set we cannot do this optimization; the
- // unwind info is to be available for non-EH uses.
- if (!EHFrameInfo.hasCalls &&
- !UnwindTablesMandatory &&
- ((linkage != Function::WeakLinkage &&
- linkage != Function::LinkOnceLinkage) ||
- !TAI->getWeakDefDirective() ||
- TAI->getSupportsWeakOmittedEHFrame()))
- {
- O << EHFrameInfo.FnName << " = 0\n";
- // This name has no connection to the function, so it might get
- // dead-stripped when the function is not, erroneously. Prohibit
- // dead-stripping unconditionally.
- if (const char *UsedDirective = TAI->getUsedDirective())
- O << UsedDirective << EHFrameInfo.FnName << "\n\n";
- } else {
- O << EHFrameInfo.FnName << ":\n";
-
- // EH frame header.
- EmitDifference("eh_frame_end", EHFrameInfo.Number,
- "eh_frame_begin", EHFrameInfo.Number, true);
- Asm->EOL("Length of Frame Information Entry");
-
- EmitLabel("eh_frame_begin", EHFrameInfo.Number);
-
- EmitSectionOffset("eh_frame_begin", "eh_frame_common",
- EHFrameInfo.Number, EHFrameInfo.PersonalityIndex,
- true, true, false);
- Asm->EOL("FDE CIE offset");
-
- EmitReference("eh_func_begin", EHFrameInfo.Number, true, true);
- Asm->EOL("FDE initial location");
- EmitDifference("eh_func_end", EHFrameInfo.Number,
- "eh_func_begin", EHFrameInfo.Number, true);
- Asm->EOL("FDE address range");
-
- // If there is a personality and landing pads then point to the language
- // specific data area in the exception table.
- if (EHFrameInfo.PersonalityIndex) {
- Asm->EmitULEB128Bytes(4);
- Asm->EOL("Augmentation size");
-
- if (EHFrameInfo.hasLandingPads)
- EmitReference("exception", EHFrameInfo.Number, true, true);
- else
- Asm->EmitInt32((int)0);
- Asm->EOL("Language Specific Data Area");
- } else {
- Asm->EmitULEB128Bytes(0);
- Asm->EOL("Augmentation size");
- }
-
- // Indicate locations of function specific callee saved registers in
- // frame.
- EmitFrameMoves("eh_func_begin", EHFrameInfo.Number, EHFrameInfo.Moves, true);
-
- // On Darwin the linker honors the alignment of eh_frame, which means it
- // must be 8-byte on 64-bit targets to match what gcc does. Otherwise
- // you get holes which confuse readers of eh_frame.
- Asm->EmitAlignment(TD->getPointerSize() == sizeof(int32_t) ? 2 : 3,
- 0, 0, false);
- EmitLabel("eh_frame_end", EHFrameInfo.Number);
-
- // If the function is marked used, this table should be also. We cannot
- // make the mark unconditional in this case, since retaining the table
- // also retains the function in this case, and there is code around
- // that depends on unused functions (calling undefined externals) being
- // dead-stripped to link correctly. Yes, there really is.
- if (MMI->getUsedFunctions().count(EHFrameInfo.function))
- if (const char *UsedDirective = TAI->getUsedDirective())
- O << UsedDirective << EHFrameInfo.FnName << "\n\n";
- }
- }
-
- /// EmitExceptionTable - Emit landing pads and actions.
- ///
- /// The general organization of the table is complex, but the basic concepts
- /// are easy. First there is a header which describes the location and
- /// organization of the three components that follow.
- /// 1. The landing pad site information describes the range of code covered
- /// by the try. In our case it's an accumulation of the ranges covered
- /// by the invokes in the try. There is also a reference to the landing
- /// pad that handles the exception once processed. Finally an index into
- /// the actions table.
- /// 2. The action table, in our case, is composed of pairs of type ids
- /// and next action offset. Starting with the action index from the
- /// landing pad site, each type Id is checked for a match to the current
- /// exception. If it matches then the exception and type id are passed
- /// on to the landing pad. Otherwise the next action is looked up. This
- /// chain is terminated with a next action of zero. If no type id is
- /// found the the frame is unwound and handling continues.
- /// 3. Type id table contains references to all the C++ typeinfo for all
- /// catches in the function. This tables is reversed indexed base 1.
-
- /// SharedTypeIds - How many leading type ids two landing pads have in common.
- static unsigned SharedTypeIds(const LandingPadInfo *L,
- const LandingPadInfo *R) {
- const std::vector<int> &LIds = L->TypeIds, &RIds = R->TypeIds;
- unsigned LSize = LIds.size(), RSize = RIds.size();
- unsigned MinSize = LSize < RSize ? LSize : RSize;
- unsigned Count = 0;
-
- for (; Count != MinSize; ++Count)
- if (LIds[Count] != RIds[Count])
- return Count;
-
- return Count;
- }
-
- /// PadLT - Order landing pads lexicographically by type id.
- static bool PadLT(const LandingPadInfo *L, const LandingPadInfo *R) {
- const std::vector<int> &LIds = L->TypeIds, &RIds = R->TypeIds;
- unsigned LSize = LIds.size(), RSize = RIds.size();
- unsigned MinSize = LSize < RSize ? LSize : RSize;
-
- for (unsigned i = 0; i != MinSize; ++i)
- if (LIds[i] != RIds[i])
- return LIds[i] < RIds[i];
-
- return LSize < RSize;
- }
-
- struct KeyInfo {
- static inline unsigned getEmptyKey() { return -1U; }
- static inline unsigned getTombstoneKey() { return -2U; }
- static unsigned getHashValue(const unsigned &Key) { return Key; }
- static bool isEqual(unsigned LHS, unsigned RHS) { return LHS == RHS; }
- static bool isPod() { return true; }
- };
-
- /// ActionEntry - Structure describing an entry in the actions table.
- struct ActionEntry {
- int ValueForTypeID; // The value to write - may not be equal to the type id.
- int NextAction;
- struct ActionEntry *Previous;
- };
-
- /// PadRange - Structure holding a try-range and the associated landing pad.
- struct PadRange {
- // The index of the landing pad.
- unsigned PadIndex;
- // The index of the begin and end labels in the landing pad's label lists.
- unsigned RangeIndex;
- };
-
- typedef DenseMap<unsigned, PadRange, KeyInfo> RangeMapType;
-
- /// CallSiteEntry - Structure describing an entry in the call-site table.
- struct CallSiteEntry {
- // The 'try-range' is BeginLabel .. EndLabel.
- unsigned BeginLabel; // zero indicates the start of the function.
- unsigned EndLabel; // zero indicates the end of the function.
- // The landing pad starts at PadLabel.
- unsigned PadLabel; // zero indicates that there is no landing pad.
- unsigned Action;
- };
-
- void EmitExceptionTable() {
- const std::vector<GlobalVariable *> &TypeInfos = MMI->getTypeInfos();
- const std::vector<unsigned> &FilterIds = MMI->getFilterIds();
- const std::vector<LandingPadInfo> &PadInfos = MMI->getLandingPads();
- if (PadInfos.empty()) return;
-
- // Sort the landing pads in order of their type ids. This is used to fold
- // duplicate actions.
- SmallVector<const LandingPadInfo *, 64> LandingPads;
- LandingPads.reserve(PadInfos.size());
- for (unsigned i = 0, N = PadInfos.size(); i != N; ++i)
- LandingPads.push_back(&PadInfos[i]);
- std::sort(LandingPads.begin(), LandingPads.end(), PadLT);
-
- // Negative type ids index into FilterIds, positive type ids index into
- // TypeInfos. The value written for a positive type id is just the type
- // id itself. For a negative type id, however, the value written is the
- // (negative) byte offset of the corresponding FilterIds entry. The byte
- // offset is usually equal to the type id, because the FilterIds entries
- // are written using a variable width encoding which outputs one byte per
- // entry as long as the value written is not too large, but can differ.
- // This kind of complication does not occur for positive type ids because
- // type infos are output using a fixed width encoding.
- // FilterOffsets[i] holds the byte offset corresponding to FilterIds[i].
- SmallVector<int, 16> FilterOffsets;
- FilterOffsets.reserve(FilterIds.size());
- int Offset = -1;
- for(std::vector<unsigned>::const_iterator I = FilterIds.begin(),
- E = FilterIds.end(); I != E; ++I) {
- FilterOffsets.push_back(Offset);
- Offset -= Asm->SizeULEB128(*I);
- }
-
- // Compute the actions table and gather the first action index for each
- // landing pad site.
- SmallVector<ActionEntry, 32> Actions;
- SmallVector<unsigned, 64> FirstActions;
- FirstActions.reserve(LandingPads.size());
-
- int FirstAction = 0;
- unsigned SizeActions = 0;
- for (unsigned i = 0, N = LandingPads.size(); i != N; ++i) {
- const LandingPadInfo *LP = LandingPads[i];
- const std::vector<int> &TypeIds = LP->TypeIds;
- const unsigned NumShared = i ? SharedTypeIds(LP, LandingPads[i-1]) : 0;
- unsigned SizeSiteActions = 0;
-
- if (NumShared < TypeIds.size()) {
- unsigned SizeAction = 0;
- ActionEntry *PrevAction = 0;
-
- if (NumShared) {
- const unsigned SizePrevIds = LandingPads[i-1]->TypeIds.size();
- assert(Actions.size());
- PrevAction = &Actions.back();
- SizeAction = Asm->SizeSLEB128(PrevAction->NextAction) +
- Asm->SizeSLEB128(PrevAction->ValueForTypeID);
- for (unsigned j = NumShared; j != SizePrevIds; ++j) {
- SizeAction -= Asm->SizeSLEB128(PrevAction->ValueForTypeID);
- SizeAction += -PrevAction->NextAction;
- PrevAction = PrevAction->Previous;
- }
- }
-
- // Compute the actions.
- for (unsigned I = NumShared, M = TypeIds.size(); I != M; ++I) {
- int TypeID = TypeIds[I];
- assert(-1-TypeID < (int)FilterOffsets.size() && "Unknown filter id!");
- int ValueForTypeID = TypeID < 0 ? FilterOffsets[-1 - TypeID] : TypeID;
- unsigned SizeTypeID = Asm->SizeSLEB128(ValueForTypeID);
-
- int NextAction = SizeAction ? -(SizeAction + SizeTypeID) : 0;
- SizeAction = SizeTypeID + Asm->SizeSLEB128(NextAction);
- SizeSiteActions += SizeAction;
-
- ActionEntry Action = {ValueForTypeID, NextAction, PrevAction};
- Actions.push_back(Action);
-
- PrevAction = &Actions.back();
- }
-
- // Record the first action of the landing pad site.
- FirstAction = SizeActions + SizeSiteActions - SizeAction + 1;
- } // else identical - re-use previous FirstAction
-
- FirstActions.push_back(FirstAction);
-
- // Compute this sites contribution to size.
- SizeActions += SizeSiteActions;
- }
-
- // Compute the call-site table. The entry for an invoke has a try-range
- // containing the call, a non-zero landing pad and an appropriate action.
- // The entry for an ordinary call has a try-range containing the call and
- // zero for the landing pad and the action. Calls marked 'nounwind' have
- // no entry and must not be contained in the try-range of any entry - they
- // form gaps in the table. Entries must be ordered by try-range address.
- SmallVector<CallSiteEntry, 64> CallSites;
-
- RangeMapType PadMap;
- // Invokes and nounwind calls have entries in PadMap (due to being bracketed
- // by try-range labels when lowered). Ordinary calls do not, so appropriate
- // try-ranges for them need be deduced.
- for (unsigned i = 0, N = LandingPads.size(); i != N; ++i) {
- const LandingPadInfo *LandingPad = LandingPads[i];
- for (unsigned j = 0, E = LandingPad->BeginLabels.size(); j != E; ++j) {
- unsigned BeginLabel = LandingPad->BeginLabels[j];
- assert(!PadMap.count(BeginLabel) && "Duplicate landing pad labels!");
- PadRange P = { i, j };
- PadMap[BeginLabel] = P;
- }
- }
-
- // The end label of the previous invoke or nounwind try-range.
- unsigned LastLabel = 0;
-
- // Whether there is a potentially throwing instruction (currently this means
- // an ordinary call) between the end of the previous try-range and now.
- bool SawPotentiallyThrowing = false;
-
- // Whether the last callsite entry was for an invoke.
- bool PreviousIsInvoke = false;
-
- // Visit all instructions in order of address.
- for (MachineFunction::const_iterator I = MF->begin(), E = MF->end();
- I != E; ++I) {
- for (MachineBasicBlock::const_iterator MI = I->begin(), E = I->end();
- MI != E; ++MI) {
- if (MI->getOpcode() != TargetInstrInfo::LABEL) {
- SawPotentiallyThrowing |= MI->getDesc().isCall();
- continue;
- }
-
- unsigned BeginLabel = MI->getOperand(0).getImm();
- assert(BeginLabel && "Invalid label!");
-
- // End of the previous try-range?
- if (BeginLabel == LastLabel)
- SawPotentiallyThrowing = false;
-
- // Beginning of a new try-range?
- RangeMapType::iterator L = PadMap.find(BeginLabel);
- if (L == PadMap.end())
- // Nope, it was just some random label.
- continue;
-
- PadRange P = L->second;
- const LandingPadInfo *LandingPad = LandingPads[P.PadIndex];
-
- assert(BeginLabel == LandingPad->BeginLabels[P.RangeIndex] &&
- "Inconsistent landing pad map!");
-
- // If some instruction between the previous try-range and this one may
- // throw, create a call-site entry with no landing pad for the region
- // between the try-ranges.
- if (SawPotentiallyThrowing) {
- CallSiteEntry Site = {LastLabel, BeginLabel, 0, 0};
- CallSites.push_back(Site);
- PreviousIsInvoke = false;
- }
-
- LastLabel = LandingPad->EndLabels[P.RangeIndex];
- assert(BeginLabel && LastLabel && "Invalid landing pad!");
-
- if (LandingPad->LandingPadLabel) {
- // This try-range is for an invoke.
- CallSiteEntry Site = {BeginLabel, LastLabel,
- LandingPad->LandingPadLabel, FirstActions[P.PadIndex]};
-
- // Try to merge with the previous call-site.
- if (PreviousIsInvoke) {
- CallSiteEntry &Prev = CallSites[CallSites.size()-1];
- if (Site.PadLabel == Prev.PadLabel && Site.Action == Prev.Action) {
- // Extend the range of the previous entry.
- Prev.EndLabel = Site.EndLabel;
- continue;
- }
- }
-
- // Otherwise, create a new call-site.
- CallSites.push_back(Site);
- PreviousIsInvoke = true;
- } else {
- // Create a gap.
- PreviousIsInvoke = false;
- }
- }
- }
- // If some instruction between the previous try-range and the end of the
- // function may throw, create a call-site entry with no landing pad for the
- // region following the try-range.
- if (SawPotentiallyThrowing) {
- CallSiteEntry Site = {LastLabel, 0, 0, 0};
- CallSites.push_back(Site);
- }
-
- // Final tallies.
-
- // Call sites.
- const unsigned SiteStartSize = sizeof(int32_t); // DW_EH_PE_udata4
- const unsigned SiteLengthSize = sizeof(int32_t); // DW_EH_PE_udata4
- const unsigned LandingPadSize = sizeof(int32_t); // DW_EH_PE_udata4
- unsigned SizeSites = CallSites.size() * (SiteStartSize +
- SiteLengthSize +
- LandingPadSize);
- for (unsigned i = 0, e = CallSites.size(); i < e; ++i)
- SizeSites += Asm->SizeULEB128(CallSites[i].Action);
-
- // Type infos.
- const unsigned TypeInfoSize = TD->getPointerSize(); // DW_EH_PE_absptr
- unsigned SizeTypes = TypeInfos.size() * TypeInfoSize;
-
- unsigned TypeOffset = sizeof(int8_t) + // Call site format
- Asm->SizeULEB128(SizeSites) + // Call-site table length
- SizeSites + SizeActions + SizeTypes;
-
- unsigned TotalSize = sizeof(int8_t) + // LPStart format
- sizeof(int8_t) + // TType format
- Asm->SizeULEB128(TypeOffset) + // TType base offset
- TypeOffset;
-
- unsigned SizeAlign = (4 - TotalSize) & 3;
-
- // Begin the exception table.
- Asm->SwitchToDataSection(TAI->getDwarfExceptionSection());
- O << "GCC_except_table" << SubprogramCount << ":\n";
- Asm->EmitAlignment(2, 0, 0, false);
- for (unsigned i = 0; i != SizeAlign; ++i) {
- Asm->EmitInt8(0);
- Asm->EOL("Padding");
- }
- EmitLabel("exception", SubprogramCount);
-
- // Emit the header.
- Asm->EmitInt8(DW_EH_PE_omit);
- Asm->EOL("LPStart format (DW_EH_PE_omit)");
- Asm->EmitInt8(DW_EH_PE_absptr);
- Asm->EOL("TType format (DW_EH_PE_absptr)");
- Asm->EmitULEB128Bytes(TypeOffset);
- Asm->EOL("TType base offset");
- Asm->EmitInt8(DW_EH_PE_udata4);
- Asm->EOL("Call site format (DW_EH_PE_udata4)");
- Asm->EmitULEB128Bytes(SizeSites);
- Asm->EOL("Call-site table length");
-
- // Emit the landing pad site information.
- for (unsigned i = 0; i < CallSites.size(); ++i) {
- CallSiteEntry &S = CallSites[i];
- const char *BeginTag;
- unsigned BeginNumber;
-
- if (!S.BeginLabel) {
- BeginTag = "eh_func_begin";
- BeginNumber = SubprogramCount;
- } else {
- BeginTag = "label";
- BeginNumber = S.BeginLabel;
- }
-
- EmitSectionOffset(BeginTag, "eh_func_begin", BeginNumber, SubprogramCount,
- true, true);
- Asm->EOL("Region start");
-
- if (!S.EndLabel) {
- EmitDifference("eh_func_end", SubprogramCount, BeginTag, BeginNumber,
- true);
- } else {
- EmitDifference("label", S.EndLabel, BeginTag, BeginNumber, true);
- }
- Asm->EOL("Region length");
-
- if (!S.PadLabel)
- Asm->EmitInt32(0);
- else
- EmitSectionOffset("label", "eh_func_begin", S.PadLabel, SubprogramCount,
- true, true);
- Asm->EOL("Landing pad");
-
- Asm->EmitULEB128Bytes(S.Action);
- Asm->EOL("Action");
- }
-
- // Emit the actions.
- for (unsigned I = 0, N = Actions.size(); I != N; ++I) {
- ActionEntry &Action = Actions[I];
-
- Asm->EmitSLEB128Bytes(Action.ValueForTypeID);
- Asm->EOL("TypeInfo index");
- Asm->EmitSLEB128Bytes(Action.NextAction);
- Asm->EOL("Next action");
- }
-
- // Emit the type ids.
- for (unsigned M = TypeInfos.size(); M; --M) {
- GlobalVariable *GV = TypeInfos[M - 1];
-
- PrintRelDirective();
-
- if (GV)
- O << Asm->getGlobalLinkName(GV);
- else
- O << "0";
-
- Asm->EOL("TypeInfo");
- }
-
- // Emit the filter typeids.
- for (unsigned j = 0, M = FilterIds.size(); j < M; ++j) {
- unsigned TypeID = FilterIds[j];
- Asm->EmitULEB128Bytes(TypeID);
- Asm->EOL("Filter TypeInfo index");
- }
-
- Asm->EmitAlignment(2, 0, 0, false);
- }
-
-public:
- //===--------------------------------------------------------------------===//
- // Main entry points.
- //
- DwarfException(std::ostream &OS, AsmPrinter *A, const TargetAsmInfo *T)
- : Dwarf(OS, A, T, "eh")
- , shouldEmitTable(false)
- , shouldEmitMoves(false)
- , shouldEmitTableModule(false)
- , shouldEmitMovesModule(false)
- {}
-
- virtual ~DwarfException() {}
-
- /// SetModuleInfo - Set machine module information when it's known that pass
- /// manager has created it. Set by the target AsmPrinter.
- void SetModuleInfo(MachineModuleInfo *mmi) {
- MMI = mmi;
- }
-
- /// BeginModule - Emit all exception information that should come prior to the
- /// content.
- void BeginModule(Module *M) {
- this->M = M;
- }
-
- /// EndModule - Emit all exception information that should come after the
- /// content.
- void EndModule() {
- if (shouldEmitMovesModule || shouldEmitTableModule) {
- const std::vector<Function *> Personalities = MMI->getPersonalities();
- for (unsigned i =0; i < Personalities.size(); ++i)
- EmitCommonEHFrame(Personalities[i], i);
-
- for (std::vector<FunctionEHFrameInfo>::iterator I = EHFrames.begin(),
- E = EHFrames.end(); I != E; ++I)
- EmitEHFrame(*I);
- }
- }
-
- /// BeginFunction - Gather pre-function exception information. Assumes being
- /// emitted immediately after the function entry point.
- void BeginFunction(MachineFunction *MF) {
- this->MF = MF;
- shouldEmitTable = shouldEmitMoves = false;
- if (MMI && TAI->doesSupportExceptionHandling()) {
-
- // Map all labels and get rid of any dead landing pads.
- MMI->TidyLandingPads();
- // If any landing pads survive, we need an EH table.
- if (MMI->getLandingPads().size())
- shouldEmitTable = true;
-
- // See if we need frame move info.
- if (MMI->hasDebugInfo() ||
- !MF->getFunction()->doesNotThrow() ||
- UnwindTablesMandatory)
- shouldEmitMoves = true;
-
- if (shouldEmitMoves || shouldEmitTable)
- // Assumes in correct section after the entry point.
- EmitLabel("eh_func_begin", ++SubprogramCount);
- }
- shouldEmitTableModule |= shouldEmitTable;
- shouldEmitMovesModule |= shouldEmitMoves;
- }
-
- /// EndFunction - Gather and emit post-function exception information.
- ///
- void EndFunction() {
- if (shouldEmitMoves || shouldEmitTable) {
- EmitLabel("eh_func_end", SubprogramCount);
- EmitExceptionTable();
-
- // Save EH frame information
- EHFrames.
- push_back(FunctionEHFrameInfo(getAsm()->getCurrentFunctionEHName(MF),
- SubprogramCount,
- MMI->getPersonalityIndex(),
- MF->getFrameInfo()->hasCalls(),
- !MMI->getLandingPads().empty(),
- MMI->getFrameMoves(),
- MF->getFunction()));
- }
- }
-};
-
-} // End of namespace llvm
-
-//===----------------------------------------------------------------------===//
-
-/// Emit - Print the abbreviation using the specified Dwarf writer.
-///
-void DIEAbbrev::Emit(const DwarfDebug &DD) const {
- // Emit its Dwarf tag type.
- DD.getAsm()->EmitULEB128Bytes(Tag);
- DD.getAsm()->EOL(TagString(Tag));
-
- // Emit whether it has children DIEs.
- DD.getAsm()->EmitULEB128Bytes(ChildrenFlag);
- DD.getAsm()->EOL(ChildrenString(ChildrenFlag));
-
- // For each attribute description.
- for (unsigned i = 0, N = Data.size(); i < N; ++i) {
- const DIEAbbrevData &AttrData = Data[i];
-
- // Emit attribute type.
- DD.getAsm()->EmitULEB128Bytes(AttrData.getAttribute());
- DD.getAsm()->EOL(AttributeString(AttrData.getAttribute()));
-
- // Emit form type.
- DD.getAsm()->EmitULEB128Bytes(AttrData.getForm());
- DD.getAsm()->EOL(FormEncodingString(AttrData.getForm()));
- }
-
- // Mark end of abbreviation.
- DD.getAsm()->EmitULEB128Bytes(0); DD.getAsm()->EOL("EOM(1)");
- DD.getAsm()->EmitULEB128Bytes(0); DD.getAsm()->EOL("EOM(2)");
-}
-
-#ifndef NDEBUG
-void DIEAbbrev::print(std::ostream &O) {
- O << "Abbreviation @"
- << std::hex << (intptr_t)this << std::dec
- << " "
- << TagString(Tag)
- << " "
- << ChildrenString(ChildrenFlag)
- << "\n";
-
- for (unsigned i = 0, N = Data.size(); i < N; ++i) {
- O << " "
- << AttributeString(Data[i].getAttribute())
- << " "
- << FormEncodingString(Data[i].getForm())
- << "\n";
- }
-}
-void DIEAbbrev::dump() { print(cerr); }
-#endif
-
-//===----------------------------------------------------------------------===//
-
-#ifndef NDEBUG
-void DIEValue::dump() {
- print(cerr);
-}
-#endif
-
-//===----------------------------------------------------------------------===//
-
-/// EmitValue - Emit integer of appropriate size.
-///
-void DIEInteger::EmitValue(DwarfDebug &DD, unsigned Form) {
- switch (Form) {
- case DW_FORM_flag: // Fall thru
- case DW_FORM_ref1: // Fall thru
- case DW_FORM_data1: DD.getAsm()->EmitInt8(Integer); break;
- case DW_FORM_ref2: // Fall thru
- case DW_FORM_data2: DD.getAsm()->EmitInt16(Integer); break;
- case DW_FORM_ref4: // Fall thru
- case DW_FORM_data4: DD.getAsm()->EmitInt32(Integer); break;
- case DW_FORM_ref8: // Fall thru
- case DW_FORM_data8: DD.getAsm()->EmitInt64(Integer); break;
- case DW_FORM_udata: DD.getAsm()->EmitULEB128Bytes(Integer); break;
- case DW_FORM_sdata: DD.getAsm()->EmitSLEB128Bytes(Integer); break;
- default: assert(0 && "DIE Value form not supported yet"); break;
- }
-}
-
-/// SizeOf - Determine size of integer value in bytes.
-///
-unsigned DIEInteger::SizeOf(const DwarfDebug &DD, unsigned Form) const {
- switch (Form) {
- case DW_FORM_flag: // Fall thru
- case DW_FORM_ref1: // Fall thru
- case DW_FORM_data1: return sizeof(int8_t);
- case DW_FORM_ref2: // Fall thru
- case DW_FORM_data2: return sizeof(int16_t);
- case DW_FORM_ref4: // Fall thru
- case DW_FORM_data4: return sizeof(int32_t);
- case DW_FORM_ref8: // Fall thru
- case DW_FORM_data8: return sizeof(int64_t);
- case DW_FORM_udata: return DD.getAsm()->SizeULEB128(Integer);
- case DW_FORM_sdata: return DD.getAsm()->SizeSLEB128(Integer);
- default: assert(0 && "DIE Value form not supported yet"); break;
- }
- return 0;
-}
-
-//===----------------------------------------------------------------------===//
-
-/// EmitValue - Emit string value.
-///
-void DIEString::EmitValue(DwarfDebug &DD, unsigned Form) {
- DD.getAsm()->EmitString(String);
-}
-
-//===----------------------------------------------------------------------===//
-
-/// EmitValue - Emit label value.
-///
-void DIEDwarfLabel::EmitValue(DwarfDebug &DD, unsigned Form) {
- bool IsSmall = Form == DW_FORM_data4;
- DD.EmitReference(Label, false, IsSmall);
-}
-
-/// SizeOf - Determine size of label value in bytes.
-///
-unsigned DIEDwarfLabel::SizeOf(const DwarfDebug &DD, unsigned Form) const {
- if (Form == DW_FORM_data4) return 4;
- return DD.getTargetData()->getPointerSize();
-}
-
-//===----------------------------------------------------------------------===//
-
-/// EmitValue - Emit label value.
-///
-void DIEObjectLabel::EmitValue(DwarfDebug &DD, unsigned Form) {
- bool IsSmall = Form == DW_FORM_data4;
- DD.EmitReference(Label, false, IsSmall);
-}
-
-/// SizeOf - Determine size of label value in bytes.
-///
-unsigned DIEObjectLabel::SizeOf(const DwarfDebug &DD, unsigned Form) const {
- if (Form == DW_FORM_data4) return 4;
- return DD.getTargetData()->getPointerSize();
-}
-
-//===----------------------------------------------------------------------===//
-
-/// EmitValue - Emit delta value.
-///
-void DIEDelta::EmitValue(DwarfDebug &DD, unsigned Form) {
- bool IsSmall = Form == DW_FORM_data4;
- DD.EmitDifference(LabelHi, LabelLo, IsSmall);
-}
-
-/// SizeOf - Determine size of delta value in bytes.
-///
-unsigned DIEDelta::SizeOf(const DwarfDebug &DD, unsigned Form) const {
- if (Form == DW_FORM_data4) return 4;
- return DD.getTargetData()->getPointerSize();
-}
-
-//===----------------------------------------------------------------------===//
-
-/// EmitValue - Emit debug information entry offset.
-///
-void DIEntry::EmitValue(DwarfDebug &DD, unsigned Form) {
- DD.getAsm()->EmitInt32(Entry->getOffset());
-}
-
-//===----------------------------------------------------------------------===//
-
-/// ComputeSize - calculate the size of the block.
-///
-unsigned DIEBlock::ComputeSize(DwarfDebug &DD) {
- if (!Size) {
- const std::vector<DIEAbbrevData> &AbbrevData = Abbrev.getData();
-
- for (unsigned i = 0, N = Values.size(); i < N; ++i) {
- Size += Values[i]->SizeOf(DD, AbbrevData[i].getForm());
- }
- }
- return Size;
-}
-
-/// EmitValue - Emit block data.
-///
-void DIEBlock::EmitValue(DwarfDebug &DD, unsigned Form) {
- switch (Form) {
- case DW_FORM_block1: DD.getAsm()->EmitInt8(Size); break;
- case DW_FORM_block2: DD.getAsm()->EmitInt16(Size); break;
- case DW_FORM_block4: DD.getAsm()->EmitInt32(Size); break;
- case DW_FORM_block: DD.getAsm()->EmitULEB128Bytes(Size); break;
- default: assert(0 && "Improper form for block"); break;
- }
-
- const std::vector<DIEAbbrevData> &AbbrevData = Abbrev.getData();
-
- for (unsigned i = 0, N = Values.size(); i < N; ++i) {
- DD.getAsm()->EOL();
- Values[i]->EmitValue(DD, AbbrevData[i].getForm());
- }
-}
-
-/// SizeOf - Determine size of block data in bytes.
-///
-unsigned DIEBlock::SizeOf(const DwarfDebug &DD, unsigned Form) const {
- switch (Form) {
- case DW_FORM_block1: return Size + sizeof(int8_t);
- case DW_FORM_block2: return Size + sizeof(int16_t);
- case DW_FORM_block4: return Size + sizeof(int32_t);
- case DW_FORM_block: return Size + DD.getAsm()->SizeULEB128(Size);
- default: assert(0 && "Improper form for block"); break;
- }
- return 0;
-}
-
-//===----------------------------------------------------------------------===//
-/// DIE Implementation
-
-DIE::~DIE() {
- for (unsigned i = 0, N = Children.size(); i < N; ++i)
- delete Children[i];
-}
-
-/// AddSiblingOffset - Add a sibling offset field to the front of the DIE.
-///
-void DIE::AddSiblingOffset() {
- DIEInteger *DI = new DIEInteger(0);
- Values.insert(Values.begin(), DI);
- Abbrev.AddFirstAttribute(DW_AT_sibling, DW_FORM_ref4);
-}
-
-/// Profile - Used to gather unique data for the value folding set.
-///
-void DIE::Profile(FoldingSetNodeID &ID) {
- Abbrev.Profile(ID);
-
- for (unsigned i = 0, N = Children.size(); i < N; ++i)
- ID.AddPointer(Children[i]);
-
- for (unsigned j = 0, M = Values.size(); j < M; ++j)
- ID.AddPointer(Values[j]);
-}
-
-#ifndef NDEBUG
-void DIE::print(std::ostream &O, unsigned IncIndent) {
- static unsigned IndentCount = 0;
- IndentCount += IncIndent;
- const std::string Indent(IndentCount, ' ');
- bool isBlock = Abbrev.getTag() == 0;
-
- if (!isBlock) {
- O << Indent
- << "Die: "
- << "0x" << std::hex << (intptr_t)this << std::dec
- << ", Offset: " << Offset
- << ", Size: " << Size
- << "\n";
-
- O << Indent
- << TagString(Abbrev.getTag())
- << " "
- << ChildrenString(Abbrev.getChildrenFlag());
- } else {
- O << "Size: " << Size;
- }
- O << "\n";
-
- const std::vector<DIEAbbrevData> &Data = Abbrev.getData();
-
- IndentCount += 2;
- for (unsigned i = 0, N = Data.size(); i < N; ++i) {
- O << Indent;
- if (!isBlock) {
- O << AttributeString(Data[i].getAttribute());
- } else {
- O << "Blk[" << i << "]";
- }
- O << " "
- << FormEncodingString(Data[i].getForm())
- << " ";
- Values[i]->print(O);
- O << "\n";
- }
- IndentCount -= 2;
-
- for (unsigned j = 0, M = Children.size(); j < M; ++j) {
- Children[j]->print(O, 4);
- }
-
- if (!isBlock) O << "\n";
- IndentCount -= IncIndent;
-}
-
-void DIE::dump() {
- print(cerr);
-}
-#endif
-
-//===----------------------------------------------------------------------===//
-/// DwarfWriter Implementation
-///
-
-DwarfWriter::DwarfWriter(std::ostream &OS, AsmPrinter *A,
- const TargetAsmInfo *T) {
- DE = new DwarfException(OS, A, T);
- DD = new DwarfDebug(OS, A, T);
-}
-
-DwarfWriter::~DwarfWriter() {
- delete DE;
- delete DD;
-}
-
-/// SetModuleInfo - Set machine module info when it's known that pass manager
-/// has created it. Set by the target AsmPrinter.
-void DwarfWriter::SetModuleInfo(MachineModuleInfo *MMI) {
- DD->SetModuleInfo(MMI);
- DE->SetModuleInfo(MMI);
-}
-
-/// BeginModule - Emit all Dwarf sections that should come prior to the
-/// content.
-void DwarfWriter::BeginModule(Module *M) {
- DE->BeginModule(M);
- DD->BeginModule(M);
-}
-
-/// EndModule - Emit all Dwarf sections that should come after the content.
-///
-void DwarfWriter::EndModule() {
- DE->EndModule();
- DD->EndModule();
-}
-
-/// BeginFunction - Gather pre-function debug information. Assumes being
-/// emitted immediately after the function entry point.
-void DwarfWriter::BeginFunction(MachineFunction *MF) {
- DE->BeginFunction(MF);
- DD->BeginFunction(MF);
-}
-
-/// EndFunction - Gather and emit post-function debug information.
-///
-void DwarfWriter::EndFunction() {
- DD->EndFunction();
- DE->EndFunction();
-
- if (MachineModuleInfo *MMI = DD->getMMI() ? DD->getMMI() : DE->getMMI()) {
- // Clear function debug information.
- MMI->EndFunction();
- }
-}
diff --git a/release_23/lib/CodeGen/ELFWriter.cpp b/release_23/lib/CodeGen/ELFWriter.cpp
deleted file mode 100644
index 63fee3a8d74d..000000000000
--- a/release_23/lib/CodeGen/ELFWriter.cpp
+++ /dev/null
@@ -1,563 +0,0 @@
-//===-- ELFWriter.cpp - Target-independent ELF Writer code ----------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the target-independent ELF writer. This file writes out
-// the ELF file in the following order:
-//
-// #1. ELF Header
-// #2. '.text' section
-// #3. '.data' section
-// #4. '.bss' section (conceptual position in file)
-// ...
-// #X. '.shstrtab' section
-// #Y. Section Table
-//
-// The entries in the section table are laid out as:
-// #0. Null entry [required]
-// #1. ".text" entry - the program code
-// #2. ".data" entry - global variables with initializers. [ if needed ]
-// #3. ".bss" entry - global variables without initializers. [ if needed ]
-// ...
-// #N. ".shstrtab" entry - String table for the section names.
-//
-// NOTE: This code should eventually be extended to support 64-bit ELF (this
-// won't be hard), but we haven't done so yet!
-//
-//===----------------------------------------------------------------------===//
-
-#include "ELFWriter.h"
-#include "llvm/Module.h"
-#include "llvm/PassManager.h"
-#include "llvm/CodeGen/FileWriters.h"
-#include "llvm/CodeGen/MachineCodeEmitter.h"
-#include "llvm/CodeGen/MachineConstantPool.h"
-#include "llvm/CodeGen/MachineFunctionPass.h"
-#include "llvm/Target/TargetData.h"
-#include "llvm/Target/TargetELFWriterInfo.h"
-#include "llvm/Target/TargetMachine.h"
-#include "llvm/Support/Mangler.h"
-#include "llvm/Support/OutputBuffer.h"
-#include "llvm/Support/Streams.h"
-#include <list>
-using namespace llvm;
-
-char ELFWriter::ID = 0;
-/// AddELFWriter - Concrete function to add the ELF writer to the function pass
-/// manager.
-MachineCodeEmitter *llvm::AddELFWriter(PassManagerBase &PM,
- std::ostream &O,
- TargetMachine &TM) {
- ELFWriter *EW = new ELFWriter(O, TM);
- PM.add(EW);
- return &EW->getMachineCodeEmitter();
-}
-
-//===----------------------------------------------------------------------===//
-// ELFCodeEmitter Implementation
-//===----------------------------------------------------------------------===//
-
-namespace llvm {
- /// ELFCodeEmitter - This class is used by the ELFWriter to emit the code for
- /// functions to the ELF file.
- class ELFCodeEmitter : public MachineCodeEmitter {
- ELFWriter &EW;
- TargetMachine &TM;
- ELFWriter::ELFSection *ES; // Section to write to.
- std::vector<unsigned char> *OutBuffer;
- size_t FnStart;
- public:
- explicit ELFCodeEmitter(ELFWriter &ew) : EW(ew), TM(EW.TM), OutBuffer(0) {}
-
- void startFunction(MachineFunction &F);
- bool finishFunction(MachineFunction &F);
-
- void addRelocation(const MachineRelocation &MR) {
- assert(0 && "relo not handled yet!");
- }
-
- virtual void StartMachineBasicBlock(MachineBasicBlock *MBB) {
- }
-
- virtual intptr_t getConstantPoolEntryAddress(unsigned Index) const {
- assert(0 && "CP not implementated yet!");
- return 0;
- }
- virtual intptr_t getJumpTableEntryAddress(unsigned Index) const {
- assert(0 && "JT not implementated yet!");
- return 0;
- }
-
- virtual intptr_t getMachineBasicBlockAddress(MachineBasicBlock *MBB) const {
- assert(0 && "JT not implementated yet!");
- return 0;
- }
-
- virtual intptr_t getLabelAddress(uint64_t Label) const {
- assert(0 && "Label address not implementated yet!");
- abort();
- return 0;
- }
-
- virtual void emitLabel(uint64_t LabelID) {
- assert(0 && "emit Label not implementated yet!");
- abort();
- }
-
-
- virtual void setModuleInfo(llvm::MachineModuleInfo* MMI) { }
-
-
- /// JIT SPECIFIC FUNCTIONS - DO NOT IMPLEMENT THESE HERE!
- void startFunctionStub(const GlobalValue* F, unsigned StubSize,
- unsigned Alignment = 1) {
- assert(0 && "JIT specific function called!");
- abort();
- }
- void *finishFunctionStub(const GlobalValue *F) {
- assert(0 && "JIT specific function called!");
- abort();
- return 0;
- }
- };
-}
-
-/// startFunction - This callback is invoked when a new machine function is
-/// about to be emitted.
-void ELFCodeEmitter::startFunction(MachineFunction &F) {
- // Align the output buffer to the appropriate alignment.
- unsigned Align = 16; // FIXME: GENERICIZE!!
- // Get the ELF Section that this function belongs in.
- ES = &EW.getSection(".text", ELFWriter::ELFSection::SHT_PROGBITS,
- ELFWriter::ELFSection::SHF_EXECINSTR |
- ELFWriter::ELFSection::SHF_ALLOC);
- OutBuffer = &ES->SectionData;
- cerr << "FIXME: This code needs to be updated for changes in the "
- << "CodeEmitter interfaces. In particular, this should set "
- << "BufferBegin/BufferEnd/CurBufferPtr, not deal with OutBuffer!";
- abort();
-
- // Upgrade the section alignment if required.
- if (ES->Align < Align) ES->Align = Align;
-
- // Add padding zeros to the end of the buffer to make sure that the
- // function will start on the correct byte alignment within the section.
- OutputBuffer OB(*OutBuffer,
- TM.getTargetData()->getPointerSizeInBits() == 64,
- TM.getTargetData()->isLittleEndian());
- OB.align(Align);
- FnStart = OutBuffer->size();
-}
-
-/// finishFunction - This callback is invoked after the function is completely
-/// finished.
-bool ELFCodeEmitter::finishFunction(MachineFunction &F) {
- // We now know the size of the function, add a symbol to represent it.
- ELFWriter::ELFSym FnSym(F.getFunction());
-
- // Figure out the binding (linkage) of the symbol.
- switch (F.getFunction()->getLinkage()) {
- default:
- // appending linkage is illegal for functions.
- assert(0 && "Unknown linkage type!");
- case GlobalValue::ExternalLinkage:
- FnSym.SetBind(ELFWriter::ELFSym::STB_GLOBAL);
- break;
- case GlobalValue::LinkOnceLinkage:
- case GlobalValue::WeakLinkage:
- FnSym.SetBind(ELFWriter::ELFSym::STB_WEAK);
- break;
- case GlobalValue::InternalLinkage:
- FnSym.SetBind(ELFWriter::ELFSym::STB_LOCAL);
- break;
- }
-
- ES->Size = OutBuffer->size();
-
- FnSym.SetType(ELFWriter::ELFSym::STT_FUNC);
- FnSym.SectionIdx = ES->SectionIdx;
- FnSym.Value = FnStart; // Value = Offset from start of Section.
- FnSym.Size = OutBuffer->size()-FnStart;
-
- // Finally, add it to the symtab.
- EW.SymbolTable.push_back(FnSym);
- return false;
-}
-
-//===----------------------------------------------------------------------===//
-// ELFWriter Implementation
-//===----------------------------------------------------------------------===//
-
-ELFWriter::ELFWriter(std::ostream &o, TargetMachine &tm)
- : MachineFunctionPass((intptr_t)&ID), O(o), TM(tm) {
- e_flags = 0; // e_flags defaults to 0, no flags.
-
- is64Bit = TM.getTargetData()->getPointerSizeInBits() == 64;
- isLittleEndian = TM.getTargetData()->isLittleEndian();
-
- // Create the machine code emitter object for this target.
- MCE = new ELFCodeEmitter(*this);
- NumSections = 0;
-}
-
-ELFWriter::~ELFWriter() {
- delete MCE;
-}
-
-// doInitialization - Emit the file header and all of the global variables for
-// the module to the ELF file.
-bool ELFWriter::doInitialization(Module &M) {
- Mang = new Mangler(M);
-
- // Local alias to shortenify coming code.
- std::vector<unsigned char> &FH = FileHeader;
- OutputBuffer FHOut(FH, is64Bit, isLittleEndian);
-
- FHOut.outbyte(0x7F); // EI_MAG0
- FHOut.outbyte('E'); // EI_MAG1
- FHOut.outbyte('L'); // EI_MAG2
- FHOut.outbyte('F'); // EI_MAG3
- FHOut.outbyte(is64Bit ? 2 : 1); // EI_CLASS
- FHOut.outbyte(isLittleEndian ? 1 : 2); // EI_DATA
- FHOut.outbyte(1); // EI_VERSION
- FH.resize(16); // EI_PAD up to 16 bytes.
-
- // This should change for shared objects.
- FHOut.outhalf(1); // e_type = ET_REL
- FHOut.outhalf(TM.getELFWriterInfo()->getEMachine()); // target-defined
- FHOut.outword(1); // e_version = 1
- FHOut.outaddr(0); // e_entry = 0 -> no entry point in .o file
- FHOut.outaddr(0); // e_phoff = 0 -> no program header for .o
-
- ELFHeader_e_shoff_Offset = FH.size();
- FHOut.outaddr(0); // e_shoff
- FHOut.outword(e_flags); // e_flags = whatever the target wants
-
- FHOut.outhalf(is64Bit ? 64 : 52); // e_ehsize = ELF header size
- FHOut.outhalf(0); // e_phentsize = prog header entry size
- FHOut.outhalf(0); // e_phnum = # prog header entries = 0
- FHOut.outhalf(is64Bit ? 64 : 40); // e_shentsize = sect hdr entry size
-
-
- ELFHeader_e_shnum_Offset = FH.size();
- FHOut.outhalf(0); // e_shnum = # of section header ents
- ELFHeader_e_shstrndx_Offset = FH.size();
- FHOut.outhalf(0); // e_shstrndx = Section # of '.shstrtab'
-
- // Add the null section, which is required to be first in the file.
- getSection("", 0, 0);
-
- // Start up the symbol table. The first entry in the symtab is the null
- // entry.
- SymbolTable.push_back(ELFSym(0));
-
- return false;
-}
-
-void ELFWriter::EmitGlobal(GlobalVariable *GV) {
- // If this is an external global, emit it now. TODO: Note that it would be
- // better to ignore the symbol here and only add it to the symbol table if
- // referenced.
- if (!GV->hasInitializer()) {
- ELFSym ExternalSym(GV);
- ExternalSym.SetBind(ELFSym::STB_GLOBAL);
- ExternalSym.SetType(ELFSym::STT_NOTYPE);
- ExternalSym.SectionIdx = ELFSection::SHN_UNDEF;
- SymbolTable.push_back(ExternalSym);
- return;
- }
-
- const Type *GVType = (const Type*)GV->getType();
- unsigned Align = TM.getTargetData()->getPreferredAlignment(GV);
- unsigned Size = TM.getTargetData()->getABITypeSize(GVType);
-
- // If this global has a zero initializer, it is part of the .bss or common
- // section.
- if (GV->getInitializer()->isNullValue()) {
- // If this global is part of the common block, add it now. Variables are
- // part of the common block if they are zero initialized and allowed to be
- // merged with other symbols.
- if (GV->hasLinkOnceLinkage() || GV->hasWeakLinkage()) {
- ELFSym CommonSym(GV);
- // Value for common symbols is the alignment required.
- CommonSym.Value = Align;
- CommonSym.Size = Size;
- CommonSym.SetBind(ELFSym::STB_GLOBAL);
- CommonSym.SetType(ELFSym::STT_OBJECT);
- // TODO SOMEDAY: add ELF visibility.
- CommonSym.SectionIdx = ELFSection::SHN_COMMON;
- SymbolTable.push_back(CommonSym);
- return;
- }
-
- // Otherwise, this symbol is part of the .bss section. Emit it now.
-
- // Handle alignment. Ensure section is aligned at least as much as required
- // by this symbol.
- ELFSection &BSSSection = getBSSSection();
- BSSSection.Align = std::max(BSSSection.Align, Align);
-
- // Within the section, emit enough virtual padding to get us to an alignment
- // boundary.
- if (Align)
- BSSSection.Size = (BSSSection.Size + Align - 1) & ~(Align-1);
-
- ELFSym BSSSym(GV);
- BSSSym.Value = BSSSection.Size;
- BSSSym.Size = Size;
- BSSSym.SetType(ELFSym::STT_OBJECT);
-
- switch (GV->getLinkage()) {
- default: // weak/linkonce handled above
- assert(0 && "Unexpected linkage type!");
- case GlobalValue::AppendingLinkage: // FIXME: This should be improved!
- case GlobalValue::ExternalLinkage:
- BSSSym.SetBind(ELFSym::STB_GLOBAL);
- break;
- case GlobalValue::InternalLinkage:
- BSSSym.SetBind(ELFSym::STB_LOCAL);
- break;
- }
-
- // Set the idx of the .bss section
- BSSSym.SectionIdx = BSSSection.SectionIdx;
- SymbolTable.push_back(BSSSym);
-
- // Reserve space in the .bss section for this symbol.
- BSSSection.Size += Size;
- return;
- }
-
- // FIXME: handle .rodata
- //assert(!GV->isConstant() && "unimp");
-
- // FIXME: handle .data
- //assert(0 && "unimp");
-}
-
-
-bool ELFWriter::runOnMachineFunction(MachineFunction &MF) {
- // Nothing to do here, this is all done through the MCE object above.
- return false;
-}
-
-/// doFinalization - Now that the module has been completely processed, emit
-/// the ELF file to 'O'.
-bool ELFWriter::doFinalization(Module &M) {
- // Okay, the ELF header and .text sections have been completed, build the
- // .data, .bss, and "common" sections next.
- for (Module::global_iterator I = M.global_begin(), E = M.global_end();
- I != E; ++I)
- EmitGlobal(I);
-
- // Emit the symbol table now, if non-empty.
- EmitSymbolTable();
-
- // FIXME: Emit the relocations now.
-
- // Emit the string table for the sections in the ELF file we have.
- EmitSectionTableStringTable();
-
- // Emit the sections to the .o file, and emit the section table for the file.
- OutputSectionsAndSectionTable();
-
- // We are done with the abstract symbols.
- SectionList.clear();
- NumSections = 0;
-
- // Release the name mangler object.
- delete Mang; Mang = 0;
- return false;
-}
-
-/// EmitSymbolTable - If the current symbol table is non-empty, emit the string
-/// table for it and then the symbol table itself.
-void ELFWriter::EmitSymbolTable() {
- if (SymbolTable.size() == 1) return; // Only the null entry.
-
- // FIXME: compact all local symbols to the start of the symtab.
- unsigned FirstNonLocalSymbol = 1;
-
- ELFSection &StrTab = getSection(".strtab", ELFSection::SHT_STRTAB, 0);
- StrTab.Align = 1;
-
- DataBuffer &StrTabBuf = StrTab.SectionData;
- OutputBuffer StrTabOut(StrTabBuf, is64Bit, isLittleEndian);
-
- // Set the zero'th symbol to a null byte, as required.
- StrTabOut.outbyte(0);
- SymbolTable[0].NameIdx = 0;
- unsigned Index = 1;
- for (unsigned i = 1, e = SymbolTable.size(); i != e; ++i) {
- // Use the name mangler to uniquify the LLVM symbol.
- std::string Name = Mang->getValueName(SymbolTable[i].GV);
-
- if (Name.empty()) {
- SymbolTable[i].NameIdx = 0;
- } else {
- SymbolTable[i].NameIdx = Index;
-
- // Add the name to the output buffer, including the null terminator.
- StrTabBuf.insert(StrTabBuf.end(), Name.begin(), Name.end());
-
- // Add a null terminator.
- StrTabBuf.push_back(0);
-
- // Keep track of the number of bytes emitted to this section.
- Index += Name.size()+1;
- }
- }
- assert(Index == StrTabBuf.size());
- StrTab.Size = Index;
-
- // Now that we have emitted the string table and know the offset into the
- // string table of each symbol, emit the symbol table itself.
- ELFSection &SymTab = getSection(".symtab", ELFSection::SHT_SYMTAB, 0);
- SymTab.Align = is64Bit ? 8 : 4;
- SymTab.Link = SymTab.SectionIdx; // Section Index of .strtab.
- SymTab.Info = FirstNonLocalSymbol; // First non-STB_LOCAL symbol.
- SymTab.EntSize = 16; // Size of each symtab entry. FIXME: wrong for ELF64
- DataBuffer &SymTabBuf = SymTab.SectionData;
- OutputBuffer SymTabOut(SymTabBuf, is64Bit, isLittleEndian);
-
- if (!is64Bit) { // 32-bit and 64-bit formats are shuffled a bit.
- for (unsigned i = 0, e = SymbolTable.size(); i != e; ++i) {
- ELFSym &Sym = SymbolTable[i];
- SymTabOut.outword(Sym.NameIdx);
- SymTabOut.outaddr32(Sym.Value);
- SymTabOut.outword(Sym.Size);
- SymTabOut.outbyte(Sym.Info);
- SymTabOut.outbyte(Sym.Other);
- SymTabOut.outhalf(Sym.SectionIdx);
- }
- } else {
- for (unsigned i = 0, e = SymbolTable.size(); i != e; ++i) {
- ELFSym &Sym = SymbolTable[i];
- SymTabOut.outword(Sym.NameIdx);
- SymTabOut.outbyte(Sym.Info);
- SymTabOut.outbyte(Sym.Other);
- SymTabOut.outhalf(Sym.SectionIdx);
- SymTabOut.outaddr64(Sym.Value);
- SymTabOut.outxword(Sym.Size);
- }
- }
-
- SymTab.Size = SymTabBuf.size();
-}
-
-/// EmitSectionTableStringTable - This method adds and emits a section for the
-/// ELF Section Table string table: the string table that holds all of the
-/// section names.
-void ELFWriter::EmitSectionTableStringTable() {
- // First step: add the section for the string table to the list of sections:
- ELFSection &SHStrTab = getSection(".shstrtab", ELFSection::SHT_STRTAB, 0);
-
- // Now that we know which section number is the .shstrtab section, update the
- // e_shstrndx entry in the ELF header.
- OutputBuffer FHOut(FileHeader, is64Bit, isLittleEndian);
- FHOut.fixhalf(SHStrTab.SectionIdx, ELFHeader_e_shstrndx_Offset);
-
- // Set the NameIdx of each section in the string table and emit the bytes for
- // the string table.
- unsigned Index = 0;
- DataBuffer &Buf = SHStrTab.SectionData;
-
- for (std::list<ELFSection>::iterator I = SectionList.begin(),
- E = SectionList.end(); I != E; ++I) {
- // Set the index into the table. Note if we have lots of entries with
- // common suffixes, we could memoize them here if we cared.
- I->NameIdx = Index;
-
- // Add the name to the output buffer, including the null terminator.
- Buf.insert(Buf.end(), I->Name.begin(), I->Name.end());
-
- // Add a null terminator.
- Buf.push_back(0);
-
- // Keep track of the number of bytes emitted to this section.
- Index += I->Name.size()+1;
- }
-
- // Set the size of .shstrtab now that we know what it is.
- assert(Index == Buf.size());
- SHStrTab.Size = Index;
-}
-
-/// OutputSectionsAndSectionTable - Now that we have constructed the file header
-/// and all of the sections, emit these to the ostream destination and emit the
-/// SectionTable.
-void ELFWriter::OutputSectionsAndSectionTable() {
- // Pass #1: Compute the file offset for each section.
- size_t FileOff = FileHeader.size(); // File header first.
-
- // Emit all of the section data in order.
- for (std::list<ELFSection>::iterator I = SectionList.begin(),
- E = SectionList.end(); I != E; ++I) {
- // Align FileOff to whatever the alignment restrictions of the section are.
- if (I->Align)
- FileOff = (FileOff+I->Align-1) & ~(I->Align-1);
- I->Offset = FileOff;
- FileOff += I->SectionData.size();
- }
-
- // Align Section Header.
- unsigned TableAlign = is64Bit ? 8 : 4;
- FileOff = (FileOff+TableAlign-1) & ~(TableAlign-1);
-
- // Now that we know where all of the sections will be emitted, set the e_shnum
- // entry in the ELF header.
- OutputBuffer FHOut(FileHeader, is64Bit, isLittleEndian);
- FHOut.fixhalf(NumSections, ELFHeader_e_shnum_Offset);
-
- // Now that we know the offset in the file of the section table, update the
- // e_shoff address in the ELF header.
- FHOut.fixaddr(FileOff, ELFHeader_e_shoff_Offset);
-
- // Now that we know all of the data in the file header, emit it and all of the
- // sections!
- O.write((char*)&FileHeader[0], FileHeader.size());
- FileOff = FileHeader.size();
- DataBuffer().swap(FileHeader);
-
- DataBuffer Table;
- OutputBuffer TableOut(Table, is64Bit, isLittleEndian);
-
- // Emit all of the section data and build the section table itself.
- while (!SectionList.empty()) {
- const ELFSection &S = *SectionList.begin();
-
- // Align FileOff to whatever the alignment restrictions of the section are.
- if (S.Align)
- for (size_t NewFileOff = (FileOff+S.Align-1) & ~(S.Align-1);
- FileOff != NewFileOff; ++FileOff)
- O.put((char)0xAB);
- O.write((char*)&S.SectionData[0], S.SectionData.size());
- FileOff += S.SectionData.size();
-
- TableOut.outword(S.NameIdx); // sh_name - Symbol table name idx
- TableOut.outword(S.Type); // sh_type - Section contents & semantics
- TableOut.outword(S.Flags); // sh_flags - Section flags.
- TableOut.outaddr(S.Addr); // sh_addr - The mem addr this section is in.
- TableOut.outaddr(S.Offset); // sh_offset - Offset from the file start.
- TableOut.outword(S.Size); // sh_size - The section size.
- TableOut.outword(S.Link); // sh_link - Section header table index link.
- TableOut.outword(S.Info); // sh_info - Auxillary information.
- TableOut.outword(S.Align); // sh_addralign - Alignment of section.
- TableOut.outword(S.EntSize); // sh_entsize - Size of entries in the section
-
- SectionList.pop_front();
- }
-
- // Align output for the section table.
- for (size_t NewFileOff = (FileOff+TableAlign-1) & ~(TableAlign-1);
- FileOff != NewFileOff; ++FileOff)
- O.put((char)0xAB);
-
- // Emit the section table itself.
- O.write((char*)&Table[0], Table.size());
-}
diff --git a/release_23/lib/CodeGen/ELFWriter.h b/release_23/lib/CodeGen/ELFWriter.h
deleted file mode 100644
index be3b39b476c5..000000000000
--- a/release_23/lib/CodeGen/ELFWriter.h
+++ /dev/null
@@ -1,229 +0,0 @@
-//===-- ELFWriter.h - Target-independent ELF writer support -----*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines the ELFWriter class.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef ELFWRITER_H
-#define ELFWRITER_H
-
-#include "llvm/CodeGen/MachineFunctionPass.h"
-#include <list>
-#include <map>
-
-namespace llvm {
- class GlobalVariable;
- class Mangler;
- class MachineCodeEmitter;
- class ELFCodeEmitter;
-
- /// ELFWriter - This class implements the common target-independent code for
- /// writing ELF files. Targets should derive a class from this to
- /// parameterize the output format.
- ///
- class ELFWriter : public MachineFunctionPass {
- friend class ELFCodeEmitter;
- public:
- static char ID;
-
- MachineCodeEmitter &getMachineCodeEmitter() const {
- return *(MachineCodeEmitter*)MCE;
- }
-
- ELFWriter(std::ostream &O, TargetMachine &TM);
- ~ELFWriter();
-
- typedef std::vector<unsigned char> DataBuffer;
-
- protected:
- /// Output stream to send the resultant object file to.
- ///
- std::ostream &O;
-
- /// Target machine description.
- ///
- TargetMachine &TM;
-
- /// Mang - The object used to perform name mangling for this module.
- ///
- Mangler *Mang;
-
- /// MCE - The MachineCodeEmitter object that we are exposing to emit machine
- /// code for functions to the .o file.
- ELFCodeEmitter *MCE;
-
- //===------------------------------------------------------------------===//
- // Properties to be set by the derived class ctor, used to configure the
- // ELFWriter.
-
- // e_machine - This field is the target specific value to emit as the
- // e_machine member of the ELF header.
- unsigned short e_machine;
-
- // e_flags - The machine flags for the target. This defaults to zero.
- unsigned e_flags;
-
- //===------------------------------------------------------------------===//
- // Properties inferred automatically from the target machine.
- //
-
- /// is64Bit/isLittleEndian - This information is inferred from the target
- /// machine directly, indicating whether to emit a 32- or 64-bit ELF file.
- bool is64Bit, isLittleEndian;
-
- /// doInitialization - Emit the file header and all of the global variables
- /// for the module to the ELF file.
- bool doInitialization(Module &M);
-
- bool runOnMachineFunction(MachineFunction &MF);
-
-
- /// doFinalization - Now that the module has been completely processed, emit
- /// the ELF file to 'O'.
- bool doFinalization(Module &M);
-
- private:
- // The buffer we accumulate the file header into. Note that this should be
- // changed into something much more efficient later (and the bitcode writer
- // as well!).
- DataBuffer FileHeader;
-
- /// ELFSection - This struct contains information about each section that is
- /// emitted to the file. This is eventually turned into the section header
- /// table at the end of the file.
- struct ELFSection {
- std::string Name; // Name of the section.
- unsigned NameIdx; // Index in .shstrtab of name, once emitted.
- unsigned Type;
- unsigned Flags;
- uint64_t Addr;
- unsigned Offset;
- unsigned Size;
- unsigned Link;
- unsigned Info;
- unsigned Align;
- unsigned EntSize;
-
- /// SectionIdx - The number of the section in the Section Table.
- ///
- unsigned short SectionIdx;
-
- /// SectionData - The actual data for this section which we are building
- /// up for emission to the file.
- DataBuffer SectionData;
-
- enum { SHT_NULL = 0, SHT_PROGBITS = 1, SHT_SYMTAB = 2, SHT_STRTAB = 3,
- SHT_RELA = 4, SHT_HASH = 5, SHT_DYNAMIC = 6, SHT_NOTE = 7,
- SHT_NOBITS = 8, SHT_REL = 9, SHT_SHLIB = 10, SHT_DYNSYM = 11 };
- enum { SHN_UNDEF = 0, SHN_ABS = 0xFFF1, SHN_COMMON = 0xFFF2 };
- enum { // SHF - ELF Section Header Flags
- SHF_WRITE = 1 << 0, // Writable
- SHF_ALLOC = 1 << 1, // Mapped into the process addr space
- SHF_EXECINSTR = 1 << 2, // Executable
- SHF_MERGE = 1 << 4, // Might be merged if equal
- SHF_STRINGS = 1 << 5, // Contains null-terminated strings
- SHF_INFO_LINK = 1 << 6, // 'sh_info' contains SHT index
- SHF_LINK_ORDER = 1 << 7, // Preserve order after combining
- SHF_OS_NONCONFORMING = 1 << 8, // nonstandard OS support required
- SHF_GROUP = 1 << 9, // Section is a member of a group
- SHF_TLS = 1 << 10 // Section holds thread-local data
- };
-
- ELFSection(const std::string &name)
- : Name(name), Type(0), Flags(0), Addr(0), Offset(0), Size(0),
- Link(0), Info(0), Align(0), EntSize(0) {
- }
- };
-
- /// SectionList - This is the list of sections that we have emitted to the
- /// file. Once the file has been completely built, the section header table
- /// is constructed from this info.
- std::list<ELFSection> SectionList;
- unsigned NumSections; // Always = SectionList.size()
-
- /// SectionLookup - This is a mapping from section name to section number in
- /// the SectionList.
- std::map<std::string, ELFSection*> SectionLookup;
-
- /// getSection - Return the section with the specified name, creating a new
- /// section if one does not already exist.
- ELFSection &getSection(const std::string &Name,
- unsigned Type, unsigned Flags = 0) {
- ELFSection *&SN = SectionLookup[Name];
- if (SN) return *SN;
-
- SectionList.push_back(Name);
- SN = &SectionList.back();
- SN->SectionIdx = NumSections++;
- SN->Type = Type;
- SN->Flags = Flags;
- return *SN;
- }
-
- ELFSection &getDataSection() {
- return getSection(".data", ELFSection::SHT_PROGBITS,
- ELFSection::SHF_WRITE | ELFSection::SHF_ALLOC);
- }
- ELFSection &getBSSSection() {
- return getSection(".bss", ELFSection::SHT_NOBITS,
- ELFSection::SHF_WRITE | ELFSection::SHF_ALLOC);
- }
-
- /// ELFSym - This struct contains information about each symbol that is
- /// added to logical symbol table for the module. This is eventually
- /// turned into a real symbol table in the file.
- struct ELFSym {
- const GlobalValue *GV; // The global value this corresponds to.
- unsigned NameIdx; // Index in .strtab of name, once emitted.
- uint64_t Value;
- unsigned Size;
- unsigned char Info;
- unsigned char Other;
- unsigned short SectionIdx;
-
- enum { STB_LOCAL = 0, STB_GLOBAL = 1, STB_WEAK = 2 };
- enum { STT_NOTYPE = 0, STT_OBJECT = 1, STT_FUNC = 2, STT_SECTION = 3,
- STT_FILE = 4 };
- ELFSym(const GlobalValue *gv) : GV(gv), Value(0), Size(0), Info(0),
- Other(0), SectionIdx(0) {}
-
- void SetBind(unsigned X) {
- assert(X == (X & 0xF) && "Bind value out of range!");
- Info = (Info & 0x0F) | (X << 4);
- }
- void SetType(unsigned X) {
- assert(X == (X & 0xF) && "Type value out of range!");
- Info = (Info & 0xF0) | X;
- }
- };
-
- /// SymbolTable - This is the list of symbols we have emitted to the file.
- /// This actually gets rearranged before emission to the file (to put the
- /// local symbols first in the list).
- std::vector<ELFSym> SymbolTable;
-
- // As we complete the ELF file, we need to update fields in the ELF header
- // (e.g. the location of the section table). These members keep track of
- // the offset in ELFHeader of these various pieces to update and other
- // locations in the file.
- unsigned ELFHeader_e_shoff_Offset; // e_shoff in ELF header.
- unsigned ELFHeader_e_shstrndx_Offset; // e_shstrndx in ELF header.
- unsigned ELFHeader_e_shnum_Offset; // e_shnum in ELF header.
- private:
- void EmitGlobal(GlobalVariable *GV);
-
- void EmitSymbolTable();
-
- void EmitSectionTableStringTable();
- void OutputSectionsAndSectionTable();
- };
-}
-
-#endif
diff --git a/release_23/lib/CodeGen/IfConversion.cpp b/release_23/lib/CodeGen/IfConversion.cpp
deleted file mode 100644
index a77ccb766ff6..000000000000
--- a/release_23/lib/CodeGen/IfConversion.cpp
+++ /dev/null
@@ -1,1223 +0,0 @@
-//===-- IfConversion.cpp - Machine code if conversion pass. ---------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the machine instruction level if-conversion pass.
-//
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "ifcvt"
-#include "llvm/Function.h"
-#include "llvm/CodeGen/Passes.h"
-#include "llvm/CodeGen/MachineModuleInfo.h"
-#include "llvm/CodeGen/MachineFunctionPass.h"
-#include "llvm/Target/TargetInstrInfo.h"
-#include "llvm/Target/TargetLowering.h"
-#include "llvm/Target/TargetMachine.h"
-#include "llvm/Support/CommandLine.h"
-#include "llvm/Support/Debug.h"
-#include "llvm/ADT/DepthFirstIterator.h"
-#include "llvm/ADT/Statistic.h"
-#include "llvm/ADT/STLExtras.h"
-using namespace llvm;
-
-// Hidden options for help debugging.
-static cl::opt<int> IfCvtFnStart("ifcvt-fn-start", cl::init(-1), cl::Hidden);
-static cl::opt<int> IfCvtFnStop("ifcvt-fn-stop", cl::init(-1), cl::Hidden);
-static cl::opt<int> IfCvtLimit("ifcvt-limit", cl::init(-1), cl::Hidden);
-static cl::opt<bool> DisableSimple("disable-ifcvt-simple",
- cl::init(false), cl::Hidden);
-static cl::opt<bool> DisableSimpleF("disable-ifcvt-simple-false",
- cl::init(false), cl::Hidden);
-static cl::opt<bool> DisableTriangle("disable-ifcvt-triangle",
- cl::init(false), cl::Hidden);
-static cl::opt<bool> DisableTriangleR("disable-ifcvt-triangle-rev",
- cl::init(false), cl::Hidden);
-static cl::opt<bool> DisableTriangleF("disable-ifcvt-triangle-false",
- cl::init(false), cl::Hidden);
-static cl::opt<bool> DisableTriangleFR("disable-ifcvt-triangle-false-rev",
- cl::init(false), cl::Hidden);
-static cl::opt<bool> DisableDiamond("disable-ifcvt-diamond",
- cl::init(false), cl::Hidden);
-
-STATISTIC(NumSimple, "Number of simple if-conversions performed");
-STATISTIC(NumSimpleFalse, "Number of simple (F) if-conversions performed");
-STATISTIC(NumTriangle, "Number of triangle if-conversions performed");
-STATISTIC(NumTriangleRev, "Number of triangle (R) if-conversions performed");
-STATISTIC(NumTriangleFalse,"Number of triangle (F) if-conversions performed");
-STATISTIC(NumTriangleFRev, "Number of triangle (F/R) if-conversions performed");
-STATISTIC(NumDiamonds, "Number of diamond if-conversions performed");
-STATISTIC(NumIfConvBBs, "Number of if-converted blocks");
-STATISTIC(NumDupBBs, "Number of duplicated blocks");
-
-namespace {
- class VISIBILITY_HIDDEN IfConverter : public MachineFunctionPass {
- enum IfcvtKind {
- ICNotClassfied, // BB data valid, but not classified.
- ICSimpleFalse, // Same as ICSimple, but on the false path.
- ICSimple, // BB is entry of an one split, no rejoin sub-CFG.
- ICTriangleFRev, // Same as ICTriangleFalse, but false path rev condition.
- ICTriangleRev, // Same as ICTriangle, but true path rev condition.
- ICTriangleFalse, // Same as ICTriangle, but on the false path.
- ICTriangle, // BB is entry of a triangle sub-CFG.
- ICDiamond // BB is entry of a diamond sub-CFG.
- };
-
- /// BBInfo - One per MachineBasicBlock, this is used to cache the result
- /// if-conversion feasibility analysis. This includes results from
- /// TargetInstrInfo::AnalyzeBranch() (i.e. TBB, FBB, and Cond), and its
- /// classification, and common tail block of its successors (if it's a
- /// diamond shape), its size, whether it's predicable, and whether any
- /// instruction can clobber the 'would-be' predicate.
- ///
- /// IsDone - True if BB is not to be considered for ifcvt.
- /// IsBeingAnalyzed - True if BB is currently being analyzed.
- /// IsAnalyzed - True if BB has been analyzed (info is still valid).
- /// IsEnqueued - True if BB has been enqueued to be ifcvt'ed.
- /// IsBrAnalyzable - True if AnalyzeBranch() returns false.
- /// HasFallThrough - True if BB may fallthrough to the following BB.
- /// IsUnpredicable - True if BB is known to be unpredicable.
- /// ClobbersPred - True if BB could modify predicates (e.g. has
- /// cmp, call, etc.)
- /// NonPredSize - Number of non-predicated instructions.
- /// BB - Corresponding MachineBasicBlock.
- /// TrueBB / FalseBB- See AnalyzeBranch().
- /// BrCond - Conditions for end of block conditional branches.
- /// Predicate - Predicate used in the BB.
- struct BBInfo {
- bool IsDone : 1;
- bool IsBeingAnalyzed : 1;
- bool IsAnalyzed : 1;
- bool IsEnqueued : 1;
- bool IsBrAnalyzable : 1;
- bool HasFallThrough : 1;
- bool IsUnpredicable : 1;
- bool CannotBeCopied : 1;
- bool ClobbersPred : 1;
- unsigned NonPredSize;
- MachineBasicBlock *BB;
- MachineBasicBlock *TrueBB;
- MachineBasicBlock *FalseBB;
- std::vector<MachineOperand> BrCond;
- std::vector<MachineOperand> Predicate;
- BBInfo() : IsDone(false), IsBeingAnalyzed(false),
- IsAnalyzed(false), IsEnqueued(false), IsBrAnalyzable(false),
- HasFallThrough(false), IsUnpredicable(false),
- CannotBeCopied(false), ClobbersPred(false), NonPredSize(0),
- BB(0), TrueBB(0), FalseBB(0) {}
- };
-
- /// IfcvtToken - Record information about pending if-conversions to attemp:
- /// BBI - Corresponding BBInfo.
- /// Kind - Type of block. See IfcvtKind.
- /// NeedSubsumsion - True if the to be predicated BB has already been
- /// predicated.
- /// NumDups - Number of instructions that would be duplicated due
- /// to this if-conversion. (For diamonds, the number of
- /// identical instructions at the beginnings of both
- /// paths).
- /// NumDups2 - For diamonds, the number of identical instructions
- /// at the ends of both paths.
- struct IfcvtToken {
- BBInfo &BBI;
- IfcvtKind Kind;
- bool NeedSubsumsion;
- unsigned NumDups;
- unsigned NumDups2;
- IfcvtToken(BBInfo &b, IfcvtKind k, bool s, unsigned d, unsigned d2 = 0)
- : BBI(b), Kind(k), NeedSubsumsion(s), NumDups(d), NumDups2(d2) {}
- };
-
- /// Roots - Basic blocks that do not have successors. These are the starting
- /// points of Graph traversal.
- std::vector<MachineBasicBlock*> Roots;
-
- /// BBAnalysis - Results of if-conversion feasibility analysis indexed by
- /// basic block number.
- std::vector<BBInfo> BBAnalysis;
-
- const TargetLowering *TLI;
- const TargetInstrInfo *TII;
- bool MadeChange;
- public:
- static char ID;
- IfConverter() : MachineFunctionPass((intptr_t)&ID) {}
-
- virtual bool runOnMachineFunction(MachineFunction &MF);
- virtual const char *getPassName() const { return "If converter"; }
-
- private:
- bool ReverseBranchCondition(BBInfo &BBI);
- bool ValidSimple(BBInfo &TrueBBI, unsigned &Dups) const;
- bool ValidTriangle(BBInfo &TrueBBI, BBInfo &FalseBBI,
- bool FalseBranch, unsigned &Dups) const;
- bool ValidDiamond(BBInfo &TrueBBI, BBInfo &FalseBBI,
- unsigned &Dups1, unsigned &Dups2) const;
- void ScanInstructions(BBInfo &BBI);
- BBInfo &AnalyzeBlock(MachineBasicBlock *BB,
- std::vector<IfcvtToken*> &Tokens);
- bool FeasibilityAnalysis(BBInfo &BBI, std::vector<MachineOperand> &Cond,
- bool isTriangle = false, bool RevBranch = false);
- bool AnalyzeBlocks(MachineFunction &MF,
- std::vector<IfcvtToken*> &Tokens);
- void InvalidatePreds(MachineBasicBlock *BB);
- void RemoveExtraEdges(BBInfo &BBI);
- bool IfConvertSimple(BBInfo &BBI, IfcvtKind Kind);
- bool IfConvertTriangle(BBInfo &BBI, IfcvtKind Kind);
- bool IfConvertDiamond(BBInfo &BBI, IfcvtKind Kind,
- unsigned NumDups1, unsigned NumDups2);
- void PredicateBlock(BBInfo &BBI,
- MachineBasicBlock::iterator E,
- std::vector<MachineOperand> &Cond);
- void CopyAndPredicateBlock(BBInfo &ToBBI, BBInfo &FromBBI,
- std::vector<MachineOperand> &Cond,
- bool IgnoreBr = false);
- void MergeBlocks(BBInfo &ToBBI, BBInfo &FromBBI);
-
- bool MeetIfcvtSizeLimit(unsigned Size) const {
- return Size > 0 && Size <= TLI->getIfCvtBlockSizeLimit();
- }
-
- // blockAlwaysFallThrough - Block ends without a terminator.
- bool blockAlwaysFallThrough(BBInfo &BBI) const {
- return BBI.IsBrAnalyzable && BBI.TrueBB == NULL;
- }
-
- // IfcvtTokenCmp - Used to sort if-conversion candidates.
- static bool IfcvtTokenCmp(IfcvtToken *C1, IfcvtToken *C2) {
- int Incr1 = (C1->Kind == ICDiamond)
- ? -(int)(C1->NumDups + C1->NumDups2) : (int)C1->NumDups;
- int Incr2 = (C2->Kind == ICDiamond)
- ? -(int)(C2->NumDups + C2->NumDups2) : (int)C2->NumDups;
- if (Incr1 > Incr2)
- return true;
- else if (Incr1 == Incr2) {
- // Favors subsumsion.
- if (C1->NeedSubsumsion == false && C2->NeedSubsumsion == true)
- return true;
- else if (C1->NeedSubsumsion == C2->NeedSubsumsion) {
- // Favors diamond over triangle, etc.
- if ((unsigned)C1->Kind < (unsigned)C2->Kind)
- return true;
- else if (C1->Kind == C2->Kind)
- return C1->BBI.BB->getNumber() < C2->BBI.BB->getNumber();
- }
- }
- return false;
- }
- };
-
- char IfConverter::ID = 0;
-}
-
-FunctionPass *llvm::createIfConverterPass() { return new IfConverter(); }
-
-bool IfConverter::runOnMachineFunction(MachineFunction &MF) {
- TLI = MF.getTarget().getTargetLowering();
- TII = MF.getTarget().getInstrInfo();
- if (!TII) return false;
-
- static int FnNum = -1;
- DOUT << "\nIfcvt: function (" << ++FnNum << ") \'"
- << MF.getFunction()->getName() << "\'";
-
- if (FnNum < IfCvtFnStart || (IfCvtFnStop != -1 && FnNum > IfCvtFnStop)) {
- DOUT << " skipped\n";
- return false;
- }
- DOUT << "\n";
-
- MF.RenumberBlocks();
- BBAnalysis.resize(MF.getNumBlockIDs());
-
- // Look for root nodes, i.e. blocks without successors.
- for (MachineFunction::iterator I = MF.begin(), E = MF.end(); I != E; ++I)
- if (I->succ_empty())
- Roots.push_back(I);
-
- std::vector<IfcvtToken*> Tokens;
- MadeChange = false;
- unsigned NumIfCvts = NumSimple + NumSimpleFalse + NumTriangle +
- NumTriangleRev + NumTriangleFalse + NumTriangleFRev + NumDiamonds;
- while (IfCvtLimit == -1 || (int)NumIfCvts < IfCvtLimit) {
- // Do an intial analysis for each basic block and finding all the potential
- // candidates to perform if-convesion.
- bool Change = AnalyzeBlocks(MF, Tokens);
- while (!Tokens.empty()) {
- IfcvtToken *Token = Tokens.back();
- Tokens.pop_back();
- BBInfo &BBI = Token->BBI;
- IfcvtKind Kind = Token->Kind;
-
- // If the block has been evicted out of the queue or it has already been
- // marked dead (due to it being predicated), then skip it.
- if (BBI.IsDone)
- BBI.IsEnqueued = false;
- if (!BBI.IsEnqueued)
- continue;
-
- BBI.IsEnqueued = false;
-
- bool RetVal = false;
- switch (Kind) {
- default: assert(false && "Unexpected!");
- break;
- case ICSimple:
- case ICSimpleFalse: {
- bool isFalse = Kind == ICSimpleFalse;
- if ((isFalse && DisableSimpleF) || (!isFalse && DisableSimple)) break;
- DOUT << "Ifcvt (Simple" << (Kind == ICSimpleFalse ? " false" :"")
- << "): BB#" << BBI.BB->getNumber() << " ("
- << ((Kind == ICSimpleFalse)
- ? BBI.FalseBB->getNumber()
- : BBI.TrueBB->getNumber()) << ") ";
- RetVal = IfConvertSimple(BBI, Kind);
- DOUT << (RetVal ? "succeeded!" : "failed!") << "\n";
- if (RetVal) {
- if (isFalse) NumSimpleFalse++;
- else NumSimple++;
- }
- break;
- }
- case ICTriangle:
- case ICTriangleRev:
- case ICTriangleFalse:
- case ICTriangleFRev: {
- bool isFalse = Kind == ICTriangleFalse;
- bool isRev = (Kind == ICTriangleRev || Kind == ICTriangleFRev);
- if (DisableTriangle && !isFalse && !isRev) break;
- if (DisableTriangleR && !isFalse && isRev) break;
- if (DisableTriangleF && isFalse && !isRev) break;
- if (DisableTriangleFR && isFalse && isRev) break;
- DOUT << "Ifcvt (Triangle";
- if (isFalse)
- DOUT << " false";
- if (isRev)
- DOUT << " rev";
- DOUT << "): BB#" << BBI.BB->getNumber() << " (T:"
- << BBI.TrueBB->getNumber() << ",F:"
- << BBI.FalseBB->getNumber() << ") ";
- RetVal = IfConvertTriangle(BBI, Kind);
- DOUT << (RetVal ? "succeeded!" : "failed!") << "\n";
- if (RetVal) {
- if (isFalse) {
- if (isRev) NumTriangleFRev++;
- else NumTriangleFalse++;
- } else {
- if (isRev) NumTriangleRev++;
- else NumTriangle++;
- }
- }
- break;
- }
- case ICDiamond: {
- if (DisableDiamond) break;
- DOUT << "Ifcvt (Diamond): BB#" << BBI.BB->getNumber() << " (T:"
- << BBI.TrueBB->getNumber() << ",F:"
- << BBI.FalseBB->getNumber() << ") ";
- RetVal = IfConvertDiamond(BBI, Kind, Token->NumDups, Token->NumDups2);
- DOUT << (RetVal ? "succeeded!" : "failed!") << "\n";
- if (RetVal) NumDiamonds++;
- break;
- }
- }
-
- Change |= RetVal;
-
- NumIfCvts = NumSimple + NumSimpleFalse + NumTriangle + NumTriangleRev +
- NumTriangleFalse + NumTriangleFRev + NumDiamonds;
- if (IfCvtLimit != -1 && (int)NumIfCvts >= IfCvtLimit)
- break;
- }
-
- if (!Change)
- break;
- MadeChange |= Change;
- }
-
- // Delete tokens in case of early exit.
- while (!Tokens.empty()) {
- IfcvtToken *Token = Tokens.back();
- Tokens.pop_back();
- delete Token;
- }
-
- Tokens.clear();
- Roots.clear();
- BBAnalysis.clear();
-
- return MadeChange;
-}
-
-/// findFalseBlock - BB has a fallthrough. Find its 'false' successor given
-/// its 'true' successor.
-static MachineBasicBlock *findFalseBlock(MachineBasicBlock *BB,
- MachineBasicBlock *TrueBB) {
- for (MachineBasicBlock::succ_iterator SI = BB->succ_begin(),
- E = BB->succ_end(); SI != E; ++SI) {
- MachineBasicBlock *SuccBB = *SI;
- if (SuccBB != TrueBB)
- return SuccBB;
- }
- return NULL;
-}
-
-/// ReverseBranchCondition - Reverse the condition of the end of the block
-/// branchs. Swap block's 'true' and 'false' successors.
-bool IfConverter::ReverseBranchCondition(BBInfo &BBI) {
- if (!TII->ReverseBranchCondition(BBI.BrCond)) {
- TII->RemoveBranch(*BBI.BB);
- TII->InsertBranch(*BBI.BB, BBI.FalseBB, BBI.TrueBB, BBI.BrCond);
- std::swap(BBI.TrueBB, BBI.FalseBB);
- return true;
- }
- return false;
-}
-
-/// getNextBlock - Returns the next block in the function blocks ordering. If
-/// it is the end, returns NULL.
-static inline MachineBasicBlock *getNextBlock(MachineBasicBlock *BB) {
- MachineFunction::iterator I = BB;
- MachineFunction::iterator E = BB->getParent()->end();
- if (++I == E)
- return NULL;
- return I;
-}
-
-/// ValidSimple - Returns true if the 'true' block (along with its
-/// predecessor) forms a valid simple shape for ifcvt. It also returns the
-/// number of instructions that the ifcvt would need to duplicate if performed
-/// in Dups.
-bool IfConverter::ValidSimple(BBInfo &TrueBBI, unsigned &Dups) const {
- Dups = 0;
- if (TrueBBI.IsBeingAnalyzed || TrueBBI.IsDone)
- return false;
-
- if (TrueBBI.IsBrAnalyzable)
- return false;
-
- if (TrueBBI.BB->pred_size() > 1) {
- if (TrueBBI.CannotBeCopied ||
- TrueBBI.NonPredSize > TLI->getIfCvtDupBlockSizeLimit())
- return false;
- Dups = TrueBBI.NonPredSize;
- }
-
- return true;
-}
-
-/// ValidTriangle - Returns true if the 'true' and 'false' blocks (along
-/// with their common predecessor) forms a valid triangle shape for ifcvt.
-/// If 'FalseBranch' is true, it checks if 'true' block's false branch
-/// branches to the false branch rather than the other way around. It also
-/// returns the number of instructions that the ifcvt would need to duplicate
-/// if performed in 'Dups'.
-bool IfConverter::ValidTriangle(BBInfo &TrueBBI, BBInfo &FalseBBI,
- bool FalseBranch, unsigned &Dups) const {
- Dups = 0;
- if (TrueBBI.IsBeingAnalyzed || TrueBBI.IsDone)
- return false;
-
- if (TrueBBI.BB->pred_size() > 1) {
- if (TrueBBI.CannotBeCopied)
- return false;
-
- unsigned Size = TrueBBI.NonPredSize;
- if (TrueBBI.IsBrAnalyzable) {
- if (TrueBBI.TrueBB && TrueBBI.BrCond.empty())
- // End with an unconditional branch. It will be removed.
- --Size;
- else {
- MachineBasicBlock *FExit = FalseBranch
- ? TrueBBI.TrueBB : TrueBBI.FalseBB;
- if (FExit)
- // Require a conditional branch
- ++Size;
- }
- }
- if (Size > TLI->getIfCvtDupBlockSizeLimit())
- return false;
- Dups = Size;
- }
-
- MachineBasicBlock *TExit = FalseBranch ? TrueBBI.FalseBB : TrueBBI.TrueBB;
- if (!TExit && blockAlwaysFallThrough(TrueBBI)) {
- MachineFunction::iterator I = TrueBBI.BB;
- if (++I == TrueBBI.BB->getParent()->end())
- return false;
- TExit = I;
- }
- return TExit && TExit == FalseBBI.BB;
-}
-
-static
-MachineBasicBlock::iterator firstNonBranchInst(MachineBasicBlock *BB,
- const TargetInstrInfo *TII) {
- MachineBasicBlock::iterator I = BB->end();
- while (I != BB->begin()) {
- --I;
- if (!I->getDesc().isBranch())
- break;
- }
- return I;
-}
-
-/// ValidDiamond - Returns true if the 'true' and 'false' blocks (along
-/// with their common predecessor) forms a valid diamond shape for ifcvt.
-bool IfConverter::ValidDiamond(BBInfo &TrueBBI, BBInfo &FalseBBI,
- unsigned &Dups1, unsigned &Dups2) const {
- Dups1 = Dups2 = 0;
- if (TrueBBI.IsBeingAnalyzed || TrueBBI.IsDone ||
- FalseBBI.IsBeingAnalyzed || FalseBBI.IsDone)
- return false;
-
- MachineBasicBlock *TT = TrueBBI.TrueBB;
- MachineBasicBlock *FT = FalseBBI.TrueBB;
-
- if (!TT && blockAlwaysFallThrough(TrueBBI))
- TT = getNextBlock(TrueBBI.BB);
- if (!FT && blockAlwaysFallThrough(FalseBBI))
- FT = getNextBlock(FalseBBI.BB);
- if (TT != FT)
- return false;
- if (TT == NULL && (TrueBBI.IsBrAnalyzable || FalseBBI.IsBrAnalyzable))
- return false;
- if (TrueBBI.BB->pred_size() > 1 || FalseBBI.BB->pred_size() > 1)
- return false;
-
- // FIXME: Allow true block to have an early exit?
- if (TrueBBI.FalseBB || FalseBBI.FalseBB ||
- (TrueBBI.ClobbersPred && FalseBBI.ClobbersPred))
- return false;
-
- MachineBasicBlock::iterator TI = TrueBBI.BB->begin();
- MachineBasicBlock::iterator FI = FalseBBI.BB->begin();
- while (TI != TrueBBI.BB->end() && FI != FalseBBI.BB->end()) {
- if (!TI->isIdenticalTo(FI))
- break;
- ++Dups1;
- ++TI;
- ++FI;
- }
-
- TI = firstNonBranchInst(TrueBBI.BB, TII);
- FI = firstNonBranchInst(FalseBBI.BB, TII);
- while (TI != TrueBBI.BB->begin() && FI != FalseBBI.BB->begin()) {
- if (!TI->isIdenticalTo(FI))
- break;
- ++Dups2;
- --TI;
- --FI;
- }
-
- return true;
-}
-
-/// ScanInstructions - Scan all the instructions in the block to determine if
-/// the block is predicable. In most cases, that means all the instructions
-/// in the block are isPredicable(). Also checks if the block contains any
-/// instruction which can clobber a predicate (e.g. condition code register).
-/// If so, the block is not predicable unless it's the last instruction.
-void IfConverter::ScanInstructions(BBInfo &BBI) {
- if (BBI.IsDone)
- return;
-
- bool AlreadyPredicated = BBI.Predicate.size() > 0;
- // First analyze the end of BB branches.
- BBI.TrueBB = BBI.FalseBB = NULL;
- BBI.BrCond.clear();
- BBI.IsBrAnalyzable =
- !TII->AnalyzeBranch(*BBI.BB, BBI.TrueBB, BBI.FalseBB, BBI.BrCond);
- BBI.HasFallThrough = BBI.IsBrAnalyzable && BBI.FalseBB == NULL;
-
- if (BBI.BrCond.size()) {
- // No false branch. This BB must end with a conditional branch and a
- // fallthrough.
- if (!BBI.FalseBB)
- BBI.FalseBB = findFalseBlock(BBI.BB, BBI.TrueBB);
- assert(BBI.FalseBB && "Expected to find the fallthrough block!");
- }
-
- // Then scan all the instructions.
- BBI.NonPredSize = 0;
- BBI.ClobbersPred = false;
- bool SeenCondBr = false;
- for (MachineBasicBlock::iterator I = BBI.BB->begin(), E = BBI.BB->end();
- I != E; ++I) {
- const TargetInstrDesc &TID = I->getDesc();
- if (TID.isNotDuplicable())
- BBI.CannotBeCopied = true;
-
- bool isPredicated = TII->isPredicated(I);
- bool isCondBr = BBI.IsBrAnalyzable && TID.isConditionalBranch();
-
- if (!isCondBr) {
- if (!isPredicated)
- BBI.NonPredSize++;
- else if (!AlreadyPredicated) {
- // FIXME: This instruction is already predicated before the
- // if-conversion pass. It's probably something like a conditional move.
- // Mark this block unpredicable for now.
- BBI.IsUnpredicable = true;
- return;
- }
-
- }
-
- if (BBI.ClobbersPred && !isPredicated) {
- // Predicate modification instruction should end the block (except for
- // already predicated instructions and end of block branches).
- if (isCondBr) {
- SeenCondBr = true;
-
- // Conditional branches is not predicable. But it may be eliminated.
- continue;
- }
-
- // Predicate may have been modified, the subsequent (currently)
- // unpredicated instructions cannot be correctly predicated.
- BBI.IsUnpredicable = true;
- return;
- }
-
- // FIXME: Make use of PredDefs? e.g. ADDC, SUBC sets predicates but are
- // still potentially predicable.
- std::vector<MachineOperand> PredDefs;
- if (TII->DefinesPredicate(I, PredDefs))
- BBI.ClobbersPred = true;
-
- if (!TID.isPredicable()) {
- BBI.IsUnpredicable = true;
- return;
- }
- }
-}
-
-/// FeasibilityAnalysis - Determine if the block is a suitable candidate to be
-/// predicated by the specified predicate.
-bool IfConverter::FeasibilityAnalysis(BBInfo &BBI,
- std::vector<MachineOperand> &Pred,
- bool isTriangle, bool RevBranch) {
- // If the block is dead or unpredicable, then it cannot be predicated.
- if (BBI.IsDone || BBI.IsUnpredicable)
- return false;
-
- // If it is already predicated, check if its predicate subsumes the new
- // predicate.
- if (BBI.Predicate.size() && !TII->SubsumesPredicate(BBI.Predicate, Pred))
- return false;
-
- if (BBI.BrCond.size()) {
- if (!isTriangle)
- return false;
-
- // Test predicate subsumsion.
- std::vector<MachineOperand> RevPred(Pred);
- std::vector<MachineOperand> Cond(BBI.BrCond);
- if (RevBranch) {
- if (TII->ReverseBranchCondition(Cond))
- return false;
- }
- if (TII->ReverseBranchCondition(RevPred) ||
- !TII->SubsumesPredicate(Cond, RevPred))
- return false;
- }
-
- return true;
-}
-
-/// AnalyzeBlock - Analyze the structure of the sub-CFG starting from
-/// the specified block. Record its successors and whether it looks like an
-/// if-conversion candidate.
-IfConverter::BBInfo &IfConverter::AnalyzeBlock(MachineBasicBlock *BB,
- std::vector<IfcvtToken*> &Tokens) {
- BBInfo &BBI = BBAnalysis[BB->getNumber()];
-
- if (BBI.IsAnalyzed || BBI.IsBeingAnalyzed)
- return BBI;
-
- BBI.BB = BB;
- BBI.IsBeingAnalyzed = true;
-
- ScanInstructions(BBI);
-
- // Unanalyable or ends with fallthrough or unconditional branch.
- if (!BBI.IsBrAnalyzable || BBI.BrCond.empty()) {
- BBI.IsBeingAnalyzed = false;
- BBI.IsAnalyzed = true;
- return BBI;
- }
-
- // Do not ifcvt if either path is a back edge to the entry block.
- if (BBI.TrueBB == BB || BBI.FalseBB == BB) {
- BBI.IsBeingAnalyzed = false;
- BBI.IsAnalyzed = true;
- return BBI;
- }
-
- BBInfo &TrueBBI = AnalyzeBlock(BBI.TrueBB, Tokens);
- BBInfo &FalseBBI = AnalyzeBlock(BBI.FalseBB, Tokens);
-
- if (TrueBBI.IsDone && FalseBBI.IsDone) {
- BBI.IsBeingAnalyzed = false;
- BBI.IsAnalyzed = true;
- return BBI;
- }
-
- std::vector<MachineOperand> RevCond(BBI.BrCond);
- bool CanRevCond = !TII->ReverseBranchCondition(RevCond);
-
- unsigned Dups = 0;
- unsigned Dups2 = 0;
- bool TNeedSub = TrueBBI.Predicate.size() > 0;
- bool FNeedSub = FalseBBI.Predicate.size() > 0;
- bool Enqueued = false;
- if (CanRevCond && ValidDiamond(TrueBBI, FalseBBI, Dups, Dups2) &&
- MeetIfcvtSizeLimit(TrueBBI.NonPredSize - (Dups + Dups2)) &&
- MeetIfcvtSizeLimit(FalseBBI.NonPredSize - (Dups + Dups2)) &&
- FeasibilityAnalysis(TrueBBI, BBI.BrCond) &&
- FeasibilityAnalysis(FalseBBI, RevCond)) {
- // Diamond:
- // EBB
- // / \_
- // | |
- // TBB FBB
- // \ /
- // TailBB
- // Note TailBB can be empty.
- Tokens.push_back(new IfcvtToken(BBI, ICDiamond, TNeedSub|FNeedSub, Dups,
- Dups2));
- Enqueued = true;
- }
-
- if (ValidTriangle(TrueBBI, FalseBBI, false, Dups) &&
- MeetIfcvtSizeLimit(TrueBBI.NonPredSize) &&
- FeasibilityAnalysis(TrueBBI, BBI.BrCond, true)) {
- // Triangle:
- // EBB
- // | \_
- // | |
- // | TBB
- // | /
- // FBB
- Tokens.push_back(new IfcvtToken(BBI, ICTriangle, TNeedSub, Dups));
- Enqueued = true;
- }
-
- if (ValidTriangle(TrueBBI, FalseBBI, true, Dups) &&
- MeetIfcvtSizeLimit(TrueBBI.NonPredSize) &&
- FeasibilityAnalysis(TrueBBI, BBI.BrCond, true, true)) {
- Tokens.push_back(new IfcvtToken(BBI, ICTriangleRev, TNeedSub, Dups));
- Enqueued = true;
- }
-
- if (ValidSimple(TrueBBI, Dups) &&
- MeetIfcvtSizeLimit(TrueBBI.NonPredSize) &&
- FeasibilityAnalysis(TrueBBI, BBI.BrCond)) {
- // Simple (split, no rejoin):
- // EBB
- // | \_
- // | |
- // | TBB---> exit
- // |
- // FBB
- Tokens.push_back(new IfcvtToken(BBI, ICSimple, TNeedSub, Dups));
- Enqueued = true;
- }
-
- if (CanRevCond) {
- // Try the other path...
- if (ValidTriangle(FalseBBI, TrueBBI, false, Dups) &&
- MeetIfcvtSizeLimit(FalseBBI.NonPredSize) &&
- FeasibilityAnalysis(FalseBBI, RevCond, true)) {
- Tokens.push_back(new IfcvtToken(BBI, ICTriangleFalse, FNeedSub, Dups));
- Enqueued = true;
- }
-
- if (ValidTriangle(FalseBBI, TrueBBI, true, Dups) &&
- MeetIfcvtSizeLimit(FalseBBI.NonPredSize) &&
- FeasibilityAnalysis(FalseBBI, RevCond, true, true)) {
- Tokens.push_back(new IfcvtToken(BBI, ICTriangleFRev, FNeedSub, Dups));
- Enqueued = true;
- }
-
- if (ValidSimple(FalseBBI, Dups) &&
- MeetIfcvtSizeLimit(FalseBBI.NonPredSize) &&
- FeasibilityAnalysis(FalseBBI, RevCond)) {
- Tokens.push_back(new IfcvtToken(BBI, ICSimpleFalse, FNeedSub, Dups));
- Enqueued = true;
- }
- }
-
- BBI.IsEnqueued = Enqueued;
- BBI.IsBeingAnalyzed = false;
- BBI.IsAnalyzed = true;
- return BBI;
-}
-
-/// AnalyzeBlocks - Analyze all blocks and find entries for all if-conversion
-/// candidates. It returns true if any CFG restructuring is done to expose more
-/// if-conversion opportunities.
-bool IfConverter::AnalyzeBlocks(MachineFunction &MF,
- std::vector<IfcvtToken*> &Tokens) {
- bool Change = false;
- std::set<MachineBasicBlock*> Visited;
- for (unsigned i = 0, e = Roots.size(); i != e; ++i) {
- for (idf_ext_iterator<MachineBasicBlock*> I=idf_ext_begin(Roots[i],Visited),
- E = idf_ext_end(Roots[i], Visited); I != E; ++I) {
- MachineBasicBlock *BB = *I;
- AnalyzeBlock(BB, Tokens);
- }
- }
-
- // Sort to favor more complex ifcvt scheme.
- std::stable_sort(Tokens.begin(), Tokens.end(), IfcvtTokenCmp);
-
- return Change;
-}
-
-/// canFallThroughTo - Returns true either if ToBB is the next block after BB or
-/// that all the intervening blocks are empty (given BB can fall through to its
-/// next block).
-static bool canFallThroughTo(MachineBasicBlock *BB, MachineBasicBlock *ToBB) {
- MachineFunction::iterator I = BB;
- MachineFunction::iterator TI = ToBB;
- MachineFunction::iterator E = BB->getParent()->end();
- while (++I != TI)
- if (I == E || !I->empty())
- return false;
- return true;
-}
-
-/// InvalidatePreds - Invalidate predecessor BB info so it would be re-analyzed
-/// to determine if it can be if-converted. If predecessor is already enqueued,
-/// dequeue it!
-void IfConverter::InvalidatePreds(MachineBasicBlock *BB) {
- for (MachineBasicBlock::pred_iterator PI = BB->pred_begin(),
- E = BB->pred_end(); PI != E; ++PI) {
- BBInfo &PBBI = BBAnalysis[(*PI)->getNumber()];
- if (PBBI.IsDone || PBBI.BB == BB)
- continue;
- PBBI.IsAnalyzed = false;
- PBBI.IsEnqueued = false;
- }
-}
-
-/// InsertUncondBranch - Inserts an unconditional branch from BB to ToBB.
-///
-static void InsertUncondBranch(MachineBasicBlock *BB, MachineBasicBlock *ToBB,
- const TargetInstrInfo *TII) {
- std::vector<MachineOperand> NoCond;
- TII->InsertBranch(*BB, ToBB, NULL, NoCond);
-}
-
-/// RemoveExtraEdges - Remove true / false edges if either / both are no longer
-/// successors.
-void IfConverter::RemoveExtraEdges(BBInfo &BBI) {
- MachineBasicBlock *TBB = NULL, *FBB = NULL;
- std::vector<MachineOperand> Cond;
- if (!TII->AnalyzeBranch(*BBI.BB, TBB, FBB, Cond))
- BBI.BB->CorrectExtraCFGEdges(TBB, FBB, !Cond.empty());
-}
-
-/// IfConvertSimple - If convert a simple (split, no rejoin) sub-CFG.
-///
-bool IfConverter::IfConvertSimple(BBInfo &BBI, IfcvtKind Kind) {
- BBInfo &TrueBBI = BBAnalysis[BBI.TrueBB->getNumber()];
- BBInfo &FalseBBI = BBAnalysis[BBI.FalseBB->getNumber()];
- BBInfo *CvtBBI = &TrueBBI;
- BBInfo *NextBBI = &FalseBBI;
-
- std::vector<MachineOperand> Cond(BBI.BrCond);
- if (Kind == ICSimpleFalse)
- std::swap(CvtBBI, NextBBI);
-
- if (CvtBBI->IsDone ||
- (CvtBBI->CannotBeCopied && CvtBBI->BB->pred_size() > 1)) {
- // Something has changed. It's no longer safe to predicate this block.
- BBI.IsAnalyzed = false;
- CvtBBI->IsAnalyzed = false;
- return false;
- }
-
- if (Kind == ICSimpleFalse)
- TII->ReverseBranchCondition(Cond);
-
- if (CvtBBI->BB->pred_size() > 1) {
- BBI.NonPredSize -= TII->RemoveBranch(*BBI.BB);
- // Copy instructions in the true block, predicate them add them to
- // the entry block.
- CopyAndPredicateBlock(BBI, *CvtBBI, Cond);
- } else {
- PredicateBlock(*CvtBBI, CvtBBI->BB->end(), Cond);
-
- // Merge converted block into entry block.
- BBI.NonPredSize -= TII->RemoveBranch(*BBI.BB);
- MergeBlocks(BBI, *CvtBBI);
- }
-
- bool IterIfcvt = true;
- if (!canFallThroughTo(BBI.BB, NextBBI->BB)) {
- InsertUncondBranch(BBI.BB, NextBBI->BB, TII);
- BBI.HasFallThrough = false;
- // Now ifcvt'd block will look like this:
- // BB:
- // ...
- // t, f = cmp
- // if t op
- // b BBf
- //
- // We cannot further ifcvt this block because the unconditional branch
- // will have to be predicated on the new condition, that will not be
- // available if cmp executes.
- IterIfcvt = false;
- }
-
- RemoveExtraEdges(BBI);
-
- // Update block info. BB can be iteratively if-converted.
- if (!IterIfcvt)
- BBI.IsDone = true;
- InvalidatePreds(BBI.BB);
- CvtBBI->IsDone = true;
-
- // FIXME: Must maintain LiveIns.
- return true;
-}
-
-/// IfConvertTriangle - If convert a triangle sub-CFG.
-///
-bool IfConverter::IfConvertTriangle(BBInfo &BBI, IfcvtKind Kind) {
- BBInfo &TrueBBI = BBAnalysis[BBI.TrueBB->getNumber()];
- BBInfo &FalseBBI = BBAnalysis[BBI.FalseBB->getNumber()];
- BBInfo *CvtBBI = &TrueBBI;
- BBInfo *NextBBI = &FalseBBI;
-
- std::vector<MachineOperand> Cond(BBI.BrCond);
- if (Kind == ICTriangleFalse || Kind == ICTriangleFRev)
- std::swap(CvtBBI, NextBBI);
-
- if (CvtBBI->IsDone ||
- (CvtBBI->CannotBeCopied && CvtBBI->BB->pred_size() > 1)) {
- // Something has changed. It's no longer safe to predicate this block.
- BBI.IsAnalyzed = false;
- CvtBBI->IsAnalyzed = false;
- return false;
- }
-
- if (Kind == ICTriangleFalse || Kind == ICTriangleFRev)
- TII->ReverseBranchCondition(Cond);
-
- if (Kind == ICTriangleRev || Kind == ICTriangleFRev) {
- ReverseBranchCondition(*CvtBBI);
- // BB has been changed, modify its predecessors (except for this
- // one) so they don't get ifcvt'ed based on bad intel.
- for (MachineBasicBlock::pred_iterator PI = CvtBBI->BB->pred_begin(),
- E = CvtBBI->BB->pred_end(); PI != E; ++PI) {
- MachineBasicBlock *PBB = *PI;
- if (PBB == BBI.BB)
- continue;
- BBInfo &PBBI = BBAnalysis[PBB->getNumber()];
- if (PBBI.IsEnqueued) {
- PBBI.IsAnalyzed = false;
- PBBI.IsEnqueued = false;
- }
- }
- }
-
- bool HasEarlyExit = CvtBBI->FalseBB != NULL;
- bool DupBB = CvtBBI->BB->pred_size() > 1;
- if (DupBB) {
- BBI.NonPredSize -= TII->RemoveBranch(*BBI.BB);
- // Copy instructions in the true block, predicate them add them to
- // the entry block.
- CopyAndPredicateBlock(BBI, *CvtBBI, Cond, true);
- } else {
- // Predicate the 'true' block after removing its branch.
- CvtBBI->NonPredSize -= TII->RemoveBranch(*CvtBBI->BB);
- PredicateBlock(*CvtBBI, CvtBBI->BB->end(), Cond);
- }
-
- if (!DupBB) {
- // Now merge the entry of the triangle with the true block.
- BBI.NonPredSize -= TII->RemoveBranch(*BBI.BB);
- MergeBlocks(BBI, *CvtBBI);
- }
-
- // If 'true' block has a 'false' successor, add an exit branch to it.
- if (HasEarlyExit) {
- std::vector<MachineOperand> RevCond(CvtBBI->BrCond);
- if (TII->ReverseBranchCondition(RevCond))
- assert(false && "Unable to reverse branch condition!");
- TII->InsertBranch(*BBI.BB, CvtBBI->FalseBB, NULL, RevCond);
- BBI.BB->addSuccessor(CvtBBI->FalseBB);
- }
-
- // Merge in the 'false' block if the 'false' block has no other
- // predecessors. Otherwise, add a unconditional branch from to 'false'.
- bool FalseBBDead = false;
- bool IterIfcvt = true;
- bool isFallThrough = canFallThroughTo(BBI.BB, NextBBI->BB);
- if (!isFallThrough) {
- // Only merge them if the true block does not fallthrough to the false
- // block. By not merging them, we make it possible to iteratively
- // ifcvt the blocks.
- if (!HasEarlyExit &&
- NextBBI->BB->pred_size() == 1 && !NextBBI->HasFallThrough) {
- MergeBlocks(BBI, *NextBBI);
- FalseBBDead = true;
- } else {
- InsertUncondBranch(BBI.BB, NextBBI->BB, TII);
- BBI.HasFallThrough = false;
- }
- // Mixed predicated and unpredicated code. This cannot be iteratively
- // predicated.
- IterIfcvt = false;
- }
-
- RemoveExtraEdges(BBI);
-
- // Update block info. BB can be iteratively if-converted.
- if (!IterIfcvt)
- BBI.IsDone = true;
- InvalidatePreds(BBI.BB);
- CvtBBI->IsDone = true;
- if (FalseBBDead)
- NextBBI->IsDone = true;
-
- // FIXME: Must maintain LiveIns.
- return true;
-}
-
-/// IfConvertDiamond - If convert a diamond sub-CFG.
-///
-bool IfConverter::IfConvertDiamond(BBInfo &BBI, IfcvtKind Kind,
- unsigned NumDups1, unsigned NumDups2) {
- BBInfo &TrueBBI = BBAnalysis[BBI.TrueBB->getNumber()];
- BBInfo &FalseBBI = BBAnalysis[BBI.FalseBB->getNumber()];
- MachineBasicBlock *TailBB = TrueBBI.TrueBB;
- // True block must fall through or ended with unanalyzable terminator.
- if (!TailBB) {
- if (blockAlwaysFallThrough(TrueBBI))
- TailBB = FalseBBI.TrueBB;
- assert((TailBB || !TrueBBI.IsBrAnalyzable) && "Unexpected!");
- }
-
- if (TrueBBI.IsDone || FalseBBI.IsDone ||
- TrueBBI.BB->pred_size() > 1 ||
- FalseBBI.BB->pred_size() > 1) {
- // Something has changed. It's no longer safe to predicate these blocks.
- BBI.IsAnalyzed = false;
- TrueBBI.IsAnalyzed = false;
- FalseBBI.IsAnalyzed = false;
- return false;
- }
-
- // Merge the 'true' and 'false' blocks by copying the instructions
- // from the 'false' block to the 'true' block. That is, unless the true
- // block would clobber the predicate, in that case, do the opposite.
- BBInfo *BBI1 = &TrueBBI;
- BBInfo *BBI2 = &FalseBBI;
- std::vector<MachineOperand> RevCond(BBI.BrCond);
- TII->ReverseBranchCondition(RevCond);
- std::vector<MachineOperand> *Cond1 = &BBI.BrCond;
- std::vector<MachineOperand> *Cond2 = &RevCond;
-
- // Figure out the more profitable ordering.
- bool DoSwap = false;
- if (TrueBBI.ClobbersPred && !FalseBBI.ClobbersPred)
- DoSwap = true;
- else if (TrueBBI.ClobbersPred == FalseBBI.ClobbersPred) {
- if (TrueBBI.NonPredSize > FalseBBI.NonPredSize)
- DoSwap = true;
- }
- if (DoSwap) {
- std::swap(BBI1, BBI2);
- std::swap(Cond1, Cond2);
- }
-
- // Remove the conditional branch from entry to the blocks.
- BBI.NonPredSize -= TII->RemoveBranch(*BBI.BB);
-
- // Remove the duplicated instructions at the beginnings of both paths.
- MachineBasicBlock::iterator DI1 = BBI1->BB->begin();
- MachineBasicBlock::iterator DI2 = BBI2->BB->begin();
- BBI1->NonPredSize -= NumDups1;
- BBI2->NonPredSize -= NumDups1;
- while (NumDups1 != 0) {
- ++DI1;
- ++DI2;
- --NumDups1;
- }
- BBI.BB->splice(BBI.BB->end(), BBI1->BB, BBI1->BB->begin(), DI1);
- BBI2->BB->erase(BBI2->BB->begin(), DI2);
-
- // Predicate the 'true' block after removing its branch.
- BBI1->NonPredSize -= TII->RemoveBranch(*BBI1->BB);
- DI1 = BBI1->BB->end();
- for (unsigned i = 0; i != NumDups2; ++i)
- --DI1;
- BBI1->BB->erase(DI1, BBI1->BB->end());
- PredicateBlock(*BBI1, BBI1->BB->end(), *Cond1);
-
- // Predicate the 'false' block.
- BBI2->NonPredSize -= TII->RemoveBranch(*BBI2->BB);
- DI2 = BBI2->BB->end();
- while (NumDups2 != 0) {
- --DI2;
- --NumDups2;
- }
- PredicateBlock(*BBI2, DI2, *Cond2);
-
- // Merge the true block into the entry of the diamond.
- MergeBlocks(BBI, *BBI1);
- MergeBlocks(BBI, *BBI2);
-
- // If the if-converted block fallthrough or unconditionally branch into the
- // tail block, and the tail block does not have other predecessors, then
- // fold the tail block in as well. Otherwise, unless it falls through to the
- // tail, add a unconditional branch to it.
- if (TailBB) {
- BBInfo TailBBI = BBAnalysis[TailBB->getNumber()];
- if (TailBB->pred_size() == 1 && !TailBBI.HasFallThrough) {
- BBI.NonPredSize -= TII->RemoveBranch(*BBI.BB);
- MergeBlocks(BBI, TailBBI);
- TailBBI.IsDone = true;
- } else {
- InsertUncondBranch(BBI.BB, TailBB, TII);
- BBI.HasFallThrough = false;
- }
- }
-
- RemoveExtraEdges(BBI);
-
- // Update block info.
- BBI.IsDone = TrueBBI.IsDone = FalseBBI.IsDone = true;
- InvalidatePreds(BBI.BB);
-
- // FIXME: Must maintain LiveIns.
- return true;
-}
-
-/// PredicateBlock - Predicate instructions from the start of the block to the
-/// specified end with the specified condition.
-void IfConverter::PredicateBlock(BBInfo &BBI,
- MachineBasicBlock::iterator E,
- std::vector<MachineOperand> &Cond) {
- for (MachineBasicBlock::iterator I = BBI.BB->begin(); I != E; ++I) {
- if (TII->isPredicated(I))
- continue;
- if (!TII->PredicateInstruction(I, Cond)) {
- cerr << "Unable to predicate " << *I << "!\n";
- abort();
- }
- }
-
- std::copy(Cond.begin(), Cond.end(), std::back_inserter(BBI.Predicate));
-
- BBI.IsAnalyzed = false;
- BBI.NonPredSize = 0;
-
- NumIfConvBBs++;
-}
-
-/// CopyAndPredicateBlock - Copy and predicate instructions from source BB to
-/// the destination block. Skip end of block branches if IgnoreBr is true.
-void IfConverter::CopyAndPredicateBlock(BBInfo &ToBBI, BBInfo &FromBBI,
- std::vector<MachineOperand> &Cond,
- bool IgnoreBr) {
- for (MachineBasicBlock::iterator I = FromBBI.BB->begin(),
- E = FromBBI.BB->end(); I != E; ++I) {
- const TargetInstrDesc &TID = I->getDesc();
- bool isPredicated = TII->isPredicated(I);
- // Do not copy the end of the block branches.
- if (IgnoreBr && !isPredicated && TID.isBranch())
- break;
-
- MachineInstr *MI = I->clone();
- ToBBI.BB->insert(ToBBI.BB->end(), MI);
- ToBBI.NonPredSize++;
-
- if (!isPredicated)
- if (!TII->PredicateInstruction(MI, Cond)) {
- cerr << "Unable to predicate " << *MI << "!\n";
- abort();
- }
- }
-
- std::vector<MachineBasicBlock *> Succs(FromBBI.BB->succ_begin(),
- FromBBI.BB->succ_end());
- MachineBasicBlock *NBB = getNextBlock(FromBBI.BB);
- MachineBasicBlock *FallThrough = FromBBI.HasFallThrough ? NBB : NULL;
-
- for (unsigned i = 0, e = Succs.size(); i != e; ++i) {
- MachineBasicBlock *Succ = Succs[i];
- // Fallthrough edge can't be transferred.
- if (Succ == FallThrough)
- continue;
- if (!ToBBI.BB->isSuccessor(Succ))
- ToBBI.BB->addSuccessor(Succ);
- }
-
- std::copy(FromBBI.Predicate.begin(), FromBBI.Predicate.end(),
- std::back_inserter(ToBBI.Predicate));
- std::copy(Cond.begin(), Cond.end(), std::back_inserter(ToBBI.Predicate));
-
- ToBBI.ClobbersPred |= FromBBI.ClobbersPred;
- ToBBI.IsAnalyzed = false;
-
- NumDupBBs++;
-}
-
-/// MergeBlocks - Move all instructions from FromBB to the end of ToBB.
-///
-void IfConverter::MergeBlocks(BBInfo &ToBBI, BBInfo &FromBBI) {
- ToBBI.BB->splice(ToBBI.BB->end(),
- FromBBI.BB, FromBBI.BB->begin(), FromBBI.BB->end());
-
- // Redirect all branches to FromBB to ToBB.
- std::vector<MachineBasicBlock *> Preds(FromBBI.BB->pred_begin(),
- FromBBI.BB->pred_end());
- for (unsigned i = 0, e = Preds.size(); i != e; ++i) {
- MachineBasicBlock *Pred = Preds[i];
- if (Pred == ToBBI.BB)
- continue;
- Pred->ReplaceUsesOfBlockWith(FromBBI.BB, ToBBI.BB);
- }
-
- std::vector<MachineBasicBlock *> Succs(FromBBI.BB->succ_begin(),
- FromBBI.BB->succ_end());
- MachineBasicBlock *NBB = getNextBlock(FromBBI.BB);
- MachineBasicBlock *FallThrough = FromBBI.HasFallThrough ? NBB : NULL;
-
- for (unsigned i = 0, e = Succs.size(); i != e; ++i) {
- MachineBasicBlock *Succ = Succs[i];
- // Fallthrough edge can't be transferred.
- if (Succ == FallThrough)
- continue;
- FromBBI.BB->removeSuccessor(Succ);
- if (!ToBBI.BB->isSuccessor(Succ))
- ToBBI.BB->addSuccessor(Succ);
- }
-
- // Now FromBBI always fall through to the next block!
- if (NBB && !FromBBI.BB->isSuccessor(NBB))
- FromBBI.BB->addSuccessor(NBB);
-
- std::copy(FromBBI.Predicate.begin(), FromBBI.Predicate.end(),
- std::back_inserter(ToBBI.Predicate));
- FromBBI.Predicate.clear();
-
- ToBBI.NonPredSize += FromBBI.NonPredSize;
- FromBBI.NonPredSize = 0;
-
- ToBBI.ClobbersPred |= FromBBI.ClobbersPred;
- ToBBI.HasFallThrough = FromBBI.HasFallThrough;
- ToBBI.IsAnalyzed = false;
- FromBBI.IsAnalyzed = false;
-}
diff --git a/release_23/lib/CodeGen/IntrinsicLowering.cpp b/release_23/lib/CodeGen/IntrinsicLowering.cpp
deleted file mode 100644
index 0500bfb496e1..000000000000
--- a/release_23/lib/CodeGen/IntrinsicLowering.cpp
+++ /dev/null
@@ -1,870 +0,0 @@
-//===-- IntrinsicLowering.cpp - Intrinsic Lowering default implementation -===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the IntrinsicLowering class.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Constants.h"
-#include "llvm/DerivedTypes.h"
-#include "llvm/Module.h"
-#include "llvm/Instructions.h"
-#include "llvm/Type.h"
-#include "llvm/CodeGen/IntrinsicLowering.h"
-#include "llvm/Support/Streams.h"
-#include "llvm/Target/TargetData.h"
-#include "llvm/ADT/SmallVector.h"
-#include "llvm/ADT/STLExtras.h"
-using namespace llvm;
-
-template <class ArgIt>
-static void EnsureFunctionExists(Module &M, const char *Name,
- ArgIt ArgBegin, ArgIt ArgEnd,
- const Type *RetTy) {
- // Insert a correctly-typed definition now.
- std::vector<const Type *> ParamTys;
- for (ArgIt I = ArgBegin; I != ArgEnd; ++I)
- ParamTys.push_back(I->getType());
- M.getOrInsertFunction(Name, FunctionType::get(RetTy, ParamTys, false));
-}
-
-/// ReplaceCallWith - This function is used when we want to lower an intrinsic
-/// call to a call of an external function. This handles hard cases such as
-/// when there was already a prototype for the external function, and if that
-/// prototype doesn't match the arguments we expect to pass in.
-template <class ArgIt>
-static CallInst *ReplaceCallWith(const char *NewFn, CallInst *CI,
- ArgIt ArgBegin, ArgIt ArgEnd,
- const Type *RetTy, Constant *&FCache) {
- if (!FCache) {
- // If we haven't already looked up this function, check to see if the
- // program already contains a function with this name.
- Module *M = CI->getParent()->getParent()->getParent();
- // Get or insert the definition now.
- std::vector<const Type *> ParamTys;
- for (ArgIt I = ArgBegin; I != ArgEnd; ++I)
- ParamTys.push_back((*I)->getType());
- FCache = M->getOrInsertFunction(NewFn,
- FunctionType::get(RetTy, ParamTys, false));
- }
-
- SmallVector<Value *, 8> Args(ArgBegin, ArgEnd);
- CallInst *NewCI = CallInst::Create(FCache, Args.begin(), Args.end(),
- CI->getName(), CI);
- if (!CI->use_empty())
- CI->replaceAllUsesWith(NewCI);
- return NewCI;
-}
-
-void IntrinsicLowering::AddPrototypes(Module &M) {
- for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I)
- if (I->isDeclaration() && !I->use_empty())
- switch (I->getIntrinsicID()) {
- default: break;
- case Intrinsic::setjmp:
- EnsureFunctionExists(M, "setjmp", I->arg_begin(), I->arg_end(),
- Type::Int32Ty);
- break;
- case Intrinsic::longjmp:
- EnsureFunctionExists(M, "longjmp", I->arg_begin(), I->arg_end(),
- Type::VoidTy);
- break;
- case Intrinsic::siglongjmp:
- EnsureFunctionExists(M, "abort", I->arg_end(), I->arg_end(),
- Type::VoidTy);
- break;
- case Intrinsic::memcpy_i32:
- case Intrinsic::memcpy_i64:
- M.getOrInsertFunction("memcpy", PointerType::getUnqual(Type::Int8Ty),
- PointerType::getUnqual(Type::Int8Ty),
- PointerType::getUnqual(Type::Int8Ty),
- TD.getIntPtrType(), (Type *)0);
- break;
- case Intrinsic::memmove_i32:
- case Intrinsic::memmove_i64:
- M.getOrInsertFunction("memmove", PointerType::getUnqual(Type::Int8Ty),
- PointerType::getUnqual(Type::Int8Ty),
- PointerType::getUnqual(Type::Int8Ty),
- TD.getIntPtrType(), (Type *)0);
- break;
- case Intrinsic::memset_i32:
- case Intrinsic::memset_i64:
- M.getOrInsertFunction("memset", PointerType::getUnqual(Type::Int8Ty),
- PointerType::getUnqual(Type::Int8Ty),
- Type::Int32Ty,
- TD.getIntPtrType(), (Type *)0);
- break;
- case Intrinsic::sqrt:
- switch((int)I->arg_begin()->getType()->getTypeID()) {
- case Type::FloatTyID:
- EnsureFunctionExists(M, "sqrtf", I->arg_begin(), I->arg_end(),
- Type::FloatTy);
- case Type::DoubleTyID:
- EnsureFunctionExists(M, "sqrt", I->arg_begin(), I->arg_end(),
- Type::DoubleTy);
- case Type::X86_FP80TyID:
- case Type::FP128TyID:
- case Type::PPC_FP128TyID:
- EnsureFunctionExists(M, "sqrtl", I->arg_begin(), I->arg_end(),
- I->arg_begin()->getType());
- }
- break;
- case Intrinsic::sin:
- switch((int)I->arg_begin()->getType()->getTypeID()) {
- case Type::FloatTyID:
- EnsureFunctionExists(M, "sinf", I->arg_begin(), I->arg_end(),
- Type::FloatTy);
- case Type::DoubleTyID:
- EnsureFunctionExists(M, "sin", I->arg_begin(), I->arg_end(),
- Type::DoubleTy);
- case Type::X86_FP80TyID:
- case Type::FP128TyID:
- case Type::PPC_FP128TyID:
- EnsureFunctionExists(M, "sinl", I->arg_begin(), I->arg_end(),
- I->arg_begin()->getType());
- }
- break;
- case Intrinsic::cos:
- switch((int)I->arg_begin()->getType()->getTypeID()) {
- case Type::FloatTyID:
- EnsureFunctionExists(M, "cosf", I->arg_begin(), I->arg_end(),
- Type::FloatTy);
- case Type::DoubleTyID:
- EnsureFunctionExists(M, "cos", I->arg_begin(), I->arg_end(),
- Type::DoubleTy);
- case Type::X86_FP80TyID:
- case Type::FP128TyID:
- case Type::PPC_FP128TyID:
- EnsureFunctionExists(M, "cosl", I->arg_begin(), I->arg_end(),
- I->arg_begin()->getType());
- }
- break;
- case Intrinsic::pow:
- switch((int)I->arg_begin()->getType()->getTypeID()) {
- case Type::FloatTyID:
- EnsureFunctionExists(M, "powf", I->arg_begin(), I->arg_end(),
- Type::FloatTy);
- case Type::DoubleTyID:
- EnsureFunctionExists(M, "pow", I->arg_begin(), I->arg_end(),
- Type::DoubleTy);
- case Type::X86_FP80TyID:
- case Type::FP128TyID:
- case Type::PPC_FP128TyID:
- EnsureFunctionExists(M, "powl", I->arg_begin(), I->arg_end(),
- I->arg_begin()->getType());
- }
- break;
- }
-}
-
-/// LowerBSWAP - Emit the code to lower bswap of V before the specified
-/// instruction IP.
-static Value *LowerBSWAP(Value *V, Instruction *IP) {
- assert(V->getType()->isInteger() && "Can't bswap a non-integer type!");
-
- unsigned BitSize = V->getType()->getPrimitiveSizeInBits();
-
- switch(BitSize) {
- default: assert(0 && "Unhandled type size of value to byteswap!");
- case 16: {
- Value *Tmp1 = BinaryOperator::createShl(V,
- ConstantInt::get(V->getType(),8),"bswap.2",IP);
- Value *Tmp2 = BinaryOperator::createLShr(V,
- ConstantInt::get(V->getType(),8),"bswap.1",IP);
- V = BinaryOperator::createOr(Tmp1, Tmp2, "bswap.i16", IP);
- break;
- }
- case 32: {
- Value *Tmp4 = BinaryOperator::createShl(V,
- ConstantInt::get(V->getType(),24),"bswap.4", IP);
- Value *Tmp3 = BinaryOperator::createShl(V,
- ConstantInt::get(V->getType(),8),"bswap.3",IP);
- Value *Tmp2 = BinaryOperator::createLShr(V,
- ConstantInt::get(V->getType(),8),"bswap.2",IP);
- Value *Tmp1 = BinaryOperator::createLShr(V,
- ConstantInt::get(V->getType(),24),"bswap.1", IP);
- Tmp3 = BinaryOperator::createAnd(Tmp3,
- ConstantInt::get(Type::Int32Ty, 0xFF0000),
- "bswap.and3", IP);
- Tmp2 = BinaryOperator::createAnd(Tmp2,
- ConstantInt::get(Type::Int32Ty, 0xFF00),
- "bswap.and2", IP);
- Tmp4 = BinaryOperator::createOr(Tmp4, Tmp3, "bswap.or1", IP);
- Tmp2 = BinaryOperator::createOr(Tmp2, Tmp1, "bswap.or2", IP);
- V = BinaryOperator::createOr(Tmp4, Tmp2, "bswap.i32", IP);
- break;
- }
- case 64: {
- Value *Tmp8 = BinaryOperator::createShl(V,
- ConstantInt::get(V->getType(),56),"bswap.8", IP);
- Value *Tmp7 = BinaryOperator::createShl(V,
- ConstantInt::get(V->getType(),40),"bswap.7", IP);
- Value *Tmp6 = BinaryOperator::createShl(V,
- ConstantInt::get(V->getType(),24),"bswap.6", IP);
- Value *Tmp5 = BinaryOperator::createShl(V,
- ConstantInt::get(V->getType(),8),"bswap.5", IP);
- Value* Tmp4 = BinaryOperator::createLShr(V,
- ConstantInt::get(V->getType(),8),"bswap.4", IP);
- Value* Tmp3 = BinaryOperator::createLShr(V,
- ConstantInt::get(V->getType(),24),"bswap.3", IP);
- Value* Tmp2 = BinaryOperator::createLShr(V,
- ConstantInt::get(V->getType(),40),"bswap.2", IP);
- Value* Tmp1 = BinaryOperator::createLShr(V,
- ConstantInt::get(V->getType(),56),"bswap.1", IP);
- Tmp7 = BinaryOperator::createAnd(Tmp7,
- ConstantInt::get(Type::Int64Ty,
- 0xFF000000000000ULL),
- "bswap.and7", IP);
- Tmp6 = BinaryOperator::createAnd(Tmp6,
- ConstantInt::get(Type::Int64Ty, 0xFF0000000000ULL),
- "bswap.and6", IP);
- Tmp5 = BinaryOperator::createAnd(Tmp5,
- ConstantInt::get(Type::Int64Ty, 0xFF00000000ULL),
- "bswap.and5", IP);
- Tmp4 = BinaryOperator::createAnd(Tmp4,
- ConstantInt::get(Type::Int64Ty, 0xFF000000ULL),
- "bswap.and4", IP);
- Tmp3 = BinaryOperator::createAnd(Tmp3,
- ConstantInt::get(Type::Int64Ty, 0xFF0000ULL),
- "bswap.and3", IP);
- Tmp2 = BinaryOperator::createAnd(Tmp2,
- ConstantInt::get(Type::Int64Ty, 0xFF00ULL),
- "bswap.and2", IP);
- Tmp8 = BinaryOperator::createOr(Tmp8, Tmp7, "bswap.or1", IP);
- Tmp6 = BinaryOperator::createOr(Tmp6, Tmp5, "bswap.or2", IP);
- Tmp4 = BinaryOperator::createOr(Tmp4, Tmp3, "bswap.or3", IP);
- Tmp2 = BinaryOperator::createOr(Tmp2, Tmp1, "bswap.or4", IP);
- Tmp8 = BinaryOperator::createOr(Tmp8, Tmp6, "bswap.or5", IP);
- Tmp4 = BinaryOperator::createOr(Tmp4, Tmp2, "bswap.or6", IP);
- V = BinaryOperator::createOr(Tmp8, Tmp4, "bswap.i64", IP);
- break;
- }
- }
- return V;
-}
-
-/// LowerCTPOP - Emit the code to lower ctpop of V before the specified
-/// instruction IP.
-static Value *LowerCTPOP(Value *V, Instruction *IP) {
- assert(V->getType()->isInteger() && "Can't ctpop a non-integer type!");
-
- static const uint64_t MaskValues[6] = {
- 0x5555555555555555ULL, 0x3333333333333333ULL,
- 0x0F0F0F0F0F0F0F0FULL, 0x00FF00FF00FF00FFULL,
- 0x0000FFFF0000FFFFULL, 0x00000000FFFFFFFFULL
- };
-
- unsigned BitSize = V->getType()->getPrimitiveSizeInBits();
- unsigned WordSize = (BitSize + 63) / 64;
- Value *Count = ConstantInt::get(V->getType(), 0);
-
- for (unsigned n = 0; n < WordSize; ++n) {
- Value *PartValue = V;
- for (unsigned i = 1, ct = 0; i < (BitSize>64 ? 64 : BitSize);
- i <<= 1, ++ct) {
- Value *MaskCst = ConstantInt::get(V->getType(), MaskValues[ct]);
- Value *LHS = BinaryOperator::createAnd(
- PartValue, MaskCst, "cppop.and1", IP);
- Value *VShift = BinaryOperator::createLShr(PartValue,
- ConstantInt::get(V->getType(), i), "ctpop.sh", IP);
- Value *RHS = BinaryOperator::createAnd(VShift, MaskCst, "cppop.and2", IP);
- PartValue = BinaryOperator::createAdd(LHS, RHS, "ctpop.step", IP);
- }
- Count = BinaryOperator::createAdd(PartValue, Count, "ctpop.part", IP);
- if (BitSize > 64) {
- V = BinaryOperator::createLShr(V, ConstantInt::get(V->getType(), 64),
- "ctpop.part.sh", IP);
- BitSize -= 64;
- }
- }
-
- return Count;
-}
-
-/// LowerCTLZ - Emit the code to lower ctlz of V before the specified
-/// instruction IP.
-static Value *LowerCTLZ(Value *V, Instruction *IP) {
-
- unsigned BitSize = V->getType()->getPrimitiveSizeInBits();
- for (unsigned i = 1; i < BitSize; i <<= 1) {
- Value *ShVal = ConstantInt::get(V->getType(), i);
- ShVal = BinaryOperator::createLShr(V, ShVal, "ctlz.sh", IP);
- V = BinaryOperator::createOr(V, ShVal, "ctlz.step", IP);
- }
-
- V = BinaryOperator::createNot(V, "", IP);
- return LowerCTPOP(V, IP);
-}
-
-/// Convert the llvm.part.select.iX.iY intrinsic. This intrinsic takes
-/// three integer arguments. The first argument is the Value from which the
-/// bits will be selected. It may be of any bit width. The second and third
-/// arguments specify a range of bits to select with the second argument
-/// specifying the low bit and the third argument specifying the high bit. Both
-/// must be type i32. The result is the corresponding selected bits from the
-/// Value in the same width as the Value (first argument). If the low bit index
-/// is higher than the high bit index then the inverse selection is done and
-/// the bits are returned in inverse order.
-/// @brief Lowering of llvm.part.select intrinsic.
-static Instruction *LowerPartSelect(CallInst *CI) {
- // Make sure we're dealing with a part select intrinsic here
- Function *F = CI->getCalledFunction();
- const FunctionType *FT = F->getFunctionType();
- if (!F->isDeclaration() || !FT->getReturnType()->isInteger() ||
- FT->getNumParams() != 3 || !FT->getParamType(0)->isInteger() ||
- !FT->getParamType(1)->isInteger() || !FT->getParamType(2)->isInteger())
- return CI;
-
- // Get the intrinsic implementation function by converting all the . to _
- // in the intrinsic's function name and then reconstructing the function
- // declaration.
- std::string Name(F->getName());
- for (unsigned i = 4; i < Name.length(); ++i)
- if (Name[i] == '.')
- Name[i] = '_';
- Module* M = F->getParent();
- F = cast<Function>(M->getOrInsertFunction(Name, FT));
- F->setLinkage(GlobalValue::WeakLinkage);
-
- // If we haven't defined the impl function yet, do so now
- if (F->isDeclaration()) {
-
- // Get the arguments to the function
- Function::arg_iterator args = F->arg_begin();
- Value* Val = args++; Val->setName("Val");
- Value* Lo = args++; Lo->setName("Lo");
- Value* Hi = args++; Hi->setName("High");
-
- // We want to select a range of bits here such that [Hi, Lo] is shifted
- // down to the low bits. However, it is quite possible that Hi is smaller
- // than Lo in which case the bits have to be reversed.
-
- // Create the blocks we will need for the two cases (forward, reverse)
- BasicBlock* CurBB = BasicBlock::Create("entry", F);
- BasicBlock *RevSize = BasicBlock::Create("revsize", CurBB->getParent());
- BasicBlock *FwdSize = BasicBlock::Create("fwdsize", CurBB->getParent());
- BasicBlock *Compute = BasicBlock::Create("compute", CurBB->getParent());
- BasicBlock *Reverse = BasicBlock::Create("reverse", CurBB->getParent());
- BasicBlock *RsltBlk = BasicBlock::Create("result", CurBB->getParent());
-
- // Cast Hi and Lo to the size of Val so the widths are all the same
- if (Hi->getType() != Val->getType())
- Hi = CastInst::createIntegerCast(Hi, Val->getType(), false,
- "tmp", CurBB);
- if (Lo->getType() != Val->getType())
- Lo = CastInst::createIntegerCast(Lo, Val->getType(), false,
- "tmp", CurBB);
-
- // Compute a few things that both cases will need, up front.
- Constant* Zero = ConstantInt::get(Val->getType(), 0);
- Constant* One = ConstantInt::get(Val->getType(), 1);
- Constant* AllOnes = ConstantInt::getAllOnesValue(Val->getType());
-
- // Compare the Hi and Lo bit positions. This is used to determine
- // which case we have (forward or reverse)
- ICmpInst *Cmp = new ICmpInst(ICmpInst::ICMP_ULT, Hi, Lo, "less",CurBB);
- BranchInst::Create(RevSize, FwdSize, Cmp, CurBB);
-
- // First, copmute the number of bits in the forward case.
- Instruction* FBitSize =
- BinaryOperator::createSub(Hi, Lo,"fbits", FwdSize);
- BranchInst::Create(Compute, FwdSize);
-
- // Second, compute the number of bits in the reverse case.
- Instruction* RBitSize =
- BinaryOperator::createSub(Lo, Hi, "rbits", RevSize);
- BranchInst::Create(Compute, RevSize);
-
- // Now, compute the bit range. Start by getting the bitsize and the shift
- // amount (either Hi or Lo) from PHI nodes. Then we compute a mask for
- // the number of bits we want in the range. We shift the bits down to the
- // least significant bits, apply the mask to zero out unwanted high bits,
- // and we have computed the "forward" result. It may still need to be
- // reversed.
-
- // Get the BitSize from one of the two subtractions
- PHINode *BitSize = PHINode::Create(Val->getType(), "bits", Compute);
- BitSize->reserveOperandSpace(2);
- BitSize->addIncoming(FBitSize, FwdSize);
- BitSize->addIncoming(RBitSize, RevSize);
-
- // Get the ShiftAmount as the smaller of Hi/Lo
- PHINode *ShiftAmt = PHINode::Create(Val->getType(), "shiftamt", Compute);
- ShiftAmt->reserveOperandSpace(2);
- ShiftAmt->addIncoming(Lo, FwdSize);
- ShiftAmt->addIncoming(Hi, RevSize);
-
- // Increment the bit size
- Instruction *BitSizePlusOne =
- BinaryOperator::createAdd(BitSize, One, "bits", Compute);
-
- // Create a Mask to zero out the high order bits.
- Instruction* Mask =
- BinaryOperator::createShl(AllOnes, BitSizePlusOne, "mask", Compute);
- Mask = BinaryOperator::createNot(Mask, "mask", Compute);
-
- // Shift the bits down and apply the mask
- Instruction* FRes =
- BinaryOperator::createLShr(Val, ShiftAmt, "fres", Compute);
- FRes = BinaryOperator::createAnd(FRes, Mask, "fres", Compute);
- BranchInst::Create(Reverse, RsltBlk, Cmp, Compute);
-
- // In the Reverse block we have the mask already in FRes but we must reverse
- // it by shifting FRes bits right and putting them in RRes by shifting them
- // in from left.
-
- // First set up our loop counters
- PHINode *Count = PHINode::Create(Val->getType(), "count", Reverse);
- Count->reserveOperandSpace(2);
- Count->addIncoming(BitSizePlusOne, Compute);
-
- // Next, get the value that we are shifting.
- PHINode *BitsToShift = PHINode::Create(Val->getType(), "val", Reverse);
- BitsToShift->reserveOperandSpace(2);
- BitsToShift->addIncoming(FRes, Compute);
-
- // Finally, get the result of the last computation
- PHINode *RRes = PHINode::Create(Val->getType(), "rres", Reverse);
- RRes->reserveOperandSpace(2);
- RRes->addIncoming(Zero, Compute);
-
- // Decrement the counter
- Instruction *Decr = BinaryOperator::createSub(Count, One, "decr", Reverse);
- Count->addIncoming(Decr, Reverse);
-
- // Compute the Bit that we want to move
- Instruction *Bit =
- BinaryOperator::createAnd(BitsToShift, One, "bit", Reverse);
-
- // Compute the new value for next iteration.
- Instruction *NewVal =
- BinaryOperator::createLShr(BitsToShift, One, "rshift", Reverse);
- BitsToShift->addIncoming(NewVal, Reverse);
-
- // Shift the bit into the low bits of the result.
- Instruction *NewRes =
- BinaryOperator::createShl(RRes, One, "lshift", Reverse);
- NewRes = BinaryOperator::createOr(NewRes, Bit, "addbit", Reverse);
- RRes->addIncoming(NewRes, Reverse);
-
- // Terminate loop if we've moved all the bits.
- ICmpInst *Cond =
- new ICmpInst(ICmpInst::ICMP_EQ, Decr, Zero, "cond", Reverse);
- BranchInst::Create(RsltBlk, Reverse, Cond, Reverse);
-
- // Finally, in the result block, select one of the two results with a PHI
- // node and return the result;
- CurBB = RsltBlk;
- PHINode *BitSelect = PHINode::Create(Val->getType(), "part_select", CurBB);
- BitSelect->reserveOperandSpace(2);
- BitSelect->addIncoming(FRes, Compute);
- BitSelect->addIncoming(NewRes, Reverse);
- ReturnInst::Create(BitSelect, CurBB);
- }
-
- // Return a call to the implementation function
- Value *Args[] = {
- CI->getOperand(1),
- CI->getOperand(2),
- CI->getOperand(3)
- };
- return CallInst::Create(F, Args, array_endof(Args), CI->getName(), CI);
-}
-
-/// Convert the llvm.part.set.iX.iY.iZ intrinsic. This intrinsic takes
-/// four integer arguments (iAny %Value, iAny %Replacement, i32 %Low, i32 %High)
-/// The first two arguments can be any bit width. The result is the same width
-/// as %Value. The operation replaces bits between %Low and %High with the value
-/// in %Replacement. If %Replacement is not the same width, it is truncated or
-/// zero extended as appropriate to fit the bits being replaced. If %Low is
-/// greater than %High then the inverse set of bits are replaced.
-/// @brief Lowering of llvm.bit.part.set intrinsic.
-static Instruction *LowerPartSet(CallInst *CI) {
- // Make sure we're dealing with a part select intrinsic here
- Function *F = CI->getCalledFunction();
- const FunctionType *FT = F->getFunctionType();
- if (!F->isDeclaration() || !FT->getReturnType()->isInteger() ||
- FT->getNumParams() != 4 || !FT->getParamType(0)->isInteger() ||
- !FT->getParamType(1)->isInteger() || !FT->getParamType(2)->isInteger() ||
- !FT->getParamType(3)->isInteger())
- return CI;
-
- // Get the intrinsic implementation function by converting all the . to _
- // in the intrinsic's function name and then reconstructing the function
- // declaration.
- std::string Name(F->getName());
- for (unsigned i = 4; i < Name.length(); ++i)
- if (Name[i] == '.')
- Name[i] = '_';
- Module* M = F->getParent();
- F = cast<Function>(M->getOrInsertFunction(Name, FT));
- F->setLinkage(GlobalValue::WeakLinkage);
-
- // If we haven't defined the impl function yet, do so now
- if (F->isDeclaration()) {
- // Get the arguments for the function.
- Function::arg_iterator args = F->arg_begin();
- Value* Val = args++; Val->setName("Val");
- Value* Rep = args++; Rep->setName("Rep");
- Value* Lo = args++; Lo->setName("Lo");
- Value* Hi = args++; Hi->setName("Hi");
-
- // Get some types we need
- const IntegerType* ValTy = cast<IntegerType>(Val->getType());
- const IntegerType* RepTy = cast<IntegerType>(Rep->getType());
- uint32_t ValBits = ValTy->getBitWidth();
- uint32_t RepBits = RepTy->getBitWidth();
-
- // Constant Definitions
- ConstantInt* RepBitWidth = ConstantInt::get(Type::Int32Ty, RepBits);
- ConstantInt* RepMask = ConstantInt::getAllOnesValue(RepTy);
- ConstantInt* ValMask = ConstantInt::getAllOnesValue(ValTy);
- ConstantInt* One = ConstantInt::get(Type::Int32Ty, 1);
- ConstantInt* ValOne = ConstantInt::get(ValTy, 1);
- ConstantInt* Zero = ConstantInt::get(Type::Int32Ty, 0);
- ConstantInt* ValZero = ConstantInt::get(ValTy, 0);
-
- // Basic blocks we fill in below.
- BasicBlock* entry = BasicBlock::Create("entry", F, 0);
- BasicBlock* large = BasicBlock::Create("large", F, 0);
- BasicBlock* small = BasicBlock::Create("small", F, 0);
- BasicBlock* reverse = BasicBlock::Create("reverse", F, 0);
- BasicBlock* result = BasicBlock::Create("result", F, 0);
-
- // BASIC BLOCK: entry
- // First, get the number of bits that we're placing as an i32
- ICmpInst* is_forward =
- new ICmpInst(ICmpInst::ICMP_ULT, Lo, Hi, "", entry);
- SelectInst* Hi_pn = SelectInst::Create(is_forward, Hi, Lo, "", entry);
- SelectInst* Lo_pn = SelectInst::Create(is_forward, Lo, Hi, "", entry);
- BinaryOperator* NumBits = BinaryOperator::createSub(Hi_pn, Lo_pn, "",entry);
- NumBits = BinaryOperator::createAdd(NumBits, One, "", entry);
- // Now, convert Lo and Hi to ValTy bit width
- if (ValBits > 32) {
- Lo = new ZExtInst(Lo_pn, ValTy, "", entry);
- } else if (ValBits < 32) {
- Lo = new TruncInst(Lo_pn, ValTy, "", entry);
- }
- // Determine if the replacement bits are larger than the number of bits we
- // are replacing and deal with it.
- ICmpInst* is_large =
- new ICmpInst(ICmpInst::ICMP_ULT, NumBits, RepBitWidth, "", entry);
- BranchInst::Create(large, small, is_large, entry);
-
- // BASIC BLOCK: large
- Instruction* MaskBits =
- BinaryOperator::createSub(RepBitWidth, NumBits, "", large);
- MaskBits = CastInst::createIntegerCast(MaskBits, RepMask->getType(),
- false, "", large);
- BinaryOperator* Mask1 =
- BinaryOperator::createLShr(RepMask, MaskBits, "", large);
- BinaryOperator* Rep2 = BinaryOperator::createAnd(Mask1, Rep, "", large);
- BranchInst::Create(small, large);
-
- // BASIC BLOCK: small
- PHINode* Rep3 = PHINode::Create(RepTy, "", small);
- Rep3->reserveOperandSpace(2);
- Rep3->addIncoming(Rep2, large);
- Rep3->addIncoming(Rep, entry);
- Value* Rep4 = Rep3;
- if (ValBits > RepBits)
- Rep4 = new ZExtInst(Rep3, ValTy, "", small);
- else if (ValBits < RepBits)
- Rep4 = new TruncInst(Rep3, ValTy, "", small);
- BranchInst::Create(result, reverse, is_forward, small);
-
- // BASIC BLOCK: reverse (reverses the bits of the replacement)
- // Set up our loop counter as a PHI so we can decrement on each iteration.
- // We will loop for the number of bits in the replacement value.
- PHINode *Count = PHINode::Create(Type::Int32Ty, "count", reverse);
- Count->reserveOperandSpace(2);
- Count->addIncoming(NumBits, small);
-
- // Get the value that we are shifting bits out of as a PHI because
- // we'll change this with each iteration.
- PHINode *BitsToShift = PHINode::Create(Val->getType(), "val", reverse);
- BitsToShift->reserveOperandSpace(2);
- BitsToShift->addIncoming(Rep4, small);
-
- // Get the result of the last computation or zero on first iteration
- PHINode *RRes = PHINode::Create(Val->getType(), "rres", reverse);
- RRes->reserveOperandSpace(2);
- RRes->addIncoming(ValZero, small);
-
- // Decrement the loop counter by one
- Instruction *Decr = BinaryOperator::createSub(Count, One, "", reverse);
- Count->addIncoming(Decr, reverse);
-
- // Get the bit that we want to move into the result
- Value *Bit = BinaryOperator::createAnd(BitsToShift, ValOne, "", reverse);
-
- // Compute the new value of the bits to shift for the next iteration.
- Value *NewVal = BinaryOperator::createLShr(BitsToShift, ValOne,"", reverse);
- BitsToShift->addIncoming(NewVal, reverse);
-
- // Shift the bit we extracted into the low bit of the result.
- Instruction *NewRes = BinaryOperator::createShl(RRes, ValOne, "", reverse);
- NewRes = BinaryOperator::createOr(NewRes, Bit, "", reverse);
- RRes->addIncoming(NewRes, reverse);
-
- // Terminate loop if we've moved all the bits.
- ICmpInst *Cond = new ICmpInst(ICmpInst::ICMP_EQ, Decr, Zero, "", reverse);
- BranchInst::Create(result, reverse, Cond, reverse);
-
- // BASIC BLOCK: result
- PHINode *Rplcmnt = PHINode::Create(Val->getType(), "", result);
- Rplcmnt->reserveOperandSpace(2);
- Rplcmnt->addIncoming(NewRes, reverse);
- Rplcmnt->addIncoming(Rep4, small);
- Value* t0 = CastInst::createIntegerCast(NumBits,ValTy,false,"",result);
- Value* t1 = BinaryOperator::createShl(ValMask, Lo, "", result);
- Value* t2 = BinaryOperator::createNot(t1, "", result);
- Value* t3 = BinaryOperator::createShl(t1, t0, "", result);
- Value* t4 = BinaryOperator::createOr(t2, t3, "", result);
- Value* t5 = BinaryOperator::createAnd(t4, Val, "", result);
- Value* t6 = BinaryOperator::createShl(Rplcmnt, Lo, "", result);
- Value* Rslt = BinaryOperator::createOr(t5, t6, "part_set", result);
- ReturnInst::Create(Rslt, result);
- }
-
- // Return a call to the implementation function
- Value *Args[] = {
- CI->getOperand(1),
- CI->getOperand(2),
- CI->getOperand(3),
- CI->getOperand(4)
- };
- return CallInst::Create(F, Args, array_endof(Args), CI->getName(), CI);
-}
-
-
-void IntrinsicLowering::LowerIntrinsicCall(CallInst *CI) {
- Function *Callee = CI->getCalledFunction();
- assert(Callee && "Cannot lower an indirect call!");
-
- switch (Callee->getIntrinsicID()) {
- case Intrinsic::not_intrinsic:
- cerr << "Cannot lower a call to a non-intrinsic function '"
- << Callee->getName() << "'!\n";
- abort();
- default:
- cerr << "Error: Code generator does not support intrinsic function '"
- << Callee->getName() << "'!\n";
- abort();
-
- // The setjmp/longjmp intrinsics should only exist in the code if it was
- // never optimized (ie, right out of the CFE), or if it has been hacked on
- // by the lowerinvoke pass. In both cases, the right thing to do is to
- // convert the call to an explicit setjmp or longjmp call.
- case Intrinsic::setjmp: {
- static Constant *SetjmpFCache = 0;
- Value *V = ReplaceCallWith("setjmp", CI, CI->op_begin()+1, CI->op_end(),
- Type::Int32Ty, SetjmpFCache);
- if (CI->getType() != Type::VoidTy)
- CI->replaceAllUsesWith(V);
- break;
- }
- case Intrinsic::sigsetjmp:
- if (CI->getType() != Type::VoidTy)
- CI->replaceAllUsesWith(Constant::getNullValue(CI->getType()));
- break;
-
- case Intrinsic::longjmp: {
- static Constant *LongjmpFCache = 0;
- ReplaceCallWith("longjmp", CI, CI->op_begin()+1, CI->op_end(),
- Type::VoidTy, LongjmpFCache);
- break;
- }
-
- case Intrinsic::siglongjmp: {
- // Insert the call to abort
- static Constant *AbortFCache = 0;
- ReplaceCallWith("abort", CI, CI->op_end(), CI->op_end(),
- Type::VoidTy, AbortFCache);
- break;
- }
- case Intrinsic::ctpop:
- CI->replaceAllUsesWith(LowerCTPOP(CI->getOperand(1), CI));
- break;
-
- case Intrinsic::bswap:
- CI->replaceAllUsesWith(LowerBSWAP(CI->getOperand(1), CI));
- break;
-
- case Intrinsic::ctlz:
- CI->replaceAllUsesWith(LowerCTLZ(CI->getOperand(1), CI));
- break;
-
- case Intrinsic::cttz: {
- // cttz(x) -> ctpop(~X & (X-1))
- Value *Src = CI->getOperand(1);
- Value *NotSrc = BinaryOperator::createNot(Src, Src->getName()+".not", CI);
- Value *SrcM1 = ConstantInt::get(Src->getType(), 1);
- SrcM1 = BinaryOperator::createSub(Src, SrcM1, "", CI);
- Src = LowerCTPOP(BinaryOperator::createAnd(NotSrc, SrcM1, "", CI), CI);
- CI->replaceAllUsesWith(Src);
- break;
- }
-
- case Intrinsic::part_select:
- CI->replaceAllUsesWith(LowerPartSelect(CI));
- break;
-
- case Intrinsic::part_set:
- CI->replaceAllUsesWith(LowerPartSet(CI));
- break;
-
- case Intrinsic::stacksave:
- case Intrinsic::stackrestore: {
- static bool Warned = false;
- if (!Warned)
- cerr << "WARNING: this target does not support the llvm.stack"
- << (Callee->getIntrinsicID() == Intrinsic::stacksave ?
- "save" : "restore") << " intrinsic.\n";
- Warned = true;
- if (Callee->getIntrinsicID() == Intrinsic::stacksave)
- CI->replaceAllUsesWith(Constant::getNullValue(CI->getType()));
- break;
- }
-
- case Intrinsic::returnaddress:
- case Intrinsic::frameaddress:
- cerr << "WARNING: this target does not support the llvm."
- << (Callee->getIntrinsicID() == Intrinsic::returnaddress ?
- "return" : "frame") << "address intrinsic.\n";
- CI->replaceAllUsesWith(ConstantPointerNull::get(
- cast<PointerType>(CI->getType())));
- break;
-
- case Intrinsic::prefetch:
- break; // Simply strip out prefetches on unsupported architectures
-
- case Intrinsic::pcmarker:
- break; // Simply strip out pcmarker on unsupported architectures
- case Intrinsic::readcyclecounter: {
- cerr << "WARNING: this target does not support the llvm.readcyclecoun"
- << "ter intrinsic. It is being lowered to a constant 0\n";
- CI->replaceAllUsesWith(ConstantInt::get(Type::Int64Ty, 0));
- break;
- }
-
- case Intrinsic::dbg_stoppoint:
- case Intrinsic::dbg_region_start:
- case Intrinsic::dbg_region_end:
- case Intrinsic::dbg_func_start:
- case Intrinsic::dbg_declare:
- break; // Simply strip out debugging intrinsics
-
- case Intrinsic::eh_exception:
- case Intrinsic::eh_selector_i32:
- case Intrinsic::eh_selector_i64:
- CI->replaceAllUsesWith(Constant::getNullValue(CI->getType()));
- break;
-
- case Intrinsic::eh_typeid_for_i32:
- case Intrinsic::eh_typeid_for_i64:
- // Return something different to eh_selector.
- CI->replaceAllUsesWith(ConstantInt::get(CI->getType(), 1));
- break;
-
- case Intrinsic::var_annotation:
- break; // Strip out annotate intrinsic
-
- case Intrinsic::memcpy_i32:
- case Intrinsic::memcpy_i64: {
- static Constant *MemcpyFCache = 0;
- Value *Size = CI->getOperand(3);
- const Type *IntPtr = TD.getIntPtrType();
- if (Size->getType()->getPrimitiveSizeInBits() <
- IntPtr->getPrimitiveSizeInBits())
- Size = new ZExtInst(Size, IntPtr, "", CI);
- else if (Size->getType()->getPrimitiveSizeInBits() >
- IntPtr->getPrimitiveSizeInBits())
- Size = new TruncInst(Size, IntPtr, "", CI);
- Value *Ops[3];
- Ops[0] = CI->getOperand(1);
- Ops[1] = CI->getOperand(2);
- Ops[2] = Size;
- ReplaceCallWith("memcpy", CI, Ops, Ops+3, CI->getOperand(1)->getType(),
- MemcpyFCache);
- break;
- }
- case Intrinsic::memmove_i32:
- case Intrinsic::memmove_i64: {
- static Constant *MemmoveFCache = 0;
- Value *Size = CI->getOperand(3);
- const Type *IntPtr = TD.getIntPtrType();
- if (Size->getType()->getPrimitiveSizeInBits() <
- IntPtr->getPrimitiveSizeInBits())
- Size = new ZExtInst(Size, IntPtr, "", CI);
- else if (Size->getType()->getPrimitiveSizeInBits() >
- IntPtr->getPrimitiveSizeInBits())
- Size = new TruncInst(Size, IntPtr, "", CI);
- Value *Ops[3];
- Ops[0] = CI->getOperand(1);
- Ops[1] = CI->getOperand(2);
- Ops[2] = Size;
- ReplaceCallWith("memmove", CI, Ops, Ops+3, CI->getOperand(1)->getType(),
- MemmoveFCache);
- break;
- }
- case Intrinsic::memset_i32:
- case Intrinsic::memset_i64: {
- static Constant *MemsetFCache = 0;
- Value *Size = CI->getOperand(3);
- const Type *IntPtr = TD.getIntPtrType();
- if (Size->getType()->getPrimitiveSizeInBits() <
- IntPtr->getPrimitiveSizeInBits())
- Size = new ZExtInst(Size, IntPtr, "", CI);
- else if (Size->getType()->getPrimitiveSizeInBits() >
- IntPtr->getPrimitiveSizeInBits())
- Size = new TruncInst(Size, IntPtr, "", CI);
- Value *Ops[3];
- Ops[0] = CI->getOperand(1);
- // Extend the amount to i32.
- Ops[1] = new ZExtInst(CI->getOperand(2), Type::Int32Ty, "", CI);
- Ops[2] = Size;
- ReplaceCallWith("memset", CI, Ops, Ops+3, CI->getOperand(1)->getType(),
- MemsetFCache);
- break;
- }
- case Intrinsic::sqrt: {
- static Constant *sqrtfFCache = 0;
- static Constant *sqrtFCache = 0;
- static Constant *sqrtLDCache = 0;
- switch (CI->getOperand(1)->getType()->getTypeID()) {
- default: assert(0 && "Invalid type in sqrt"); abort();
- case Type::FloatTyID:
- ReplaceCallWith("sqrtf", CI, CI->op_begin()+1, CI->op_end(),
- Type::FloatTy, sqrtfFCache);
- break;
- case Type::DoubleTyID:
- ReplaceCallWith("sqrt", CI, CI->op_begin()+1, CI->op_end(),
- Type::DoubleTy, sqrtFCache);
- break;
- case Type::X86_FP80TyID:
- case Type::FP128TyID:
- case Type::PPC_FP128TyID:
- ReplaceCallWith("sqrtl", CI, CI->op_begin()+1, CI->op_end(),
- CI->getOperand(1)->getType(), sqrtLDCache);
- break;
- }
- break;
- }
- case Intrinsic::flt_rounds:
- // Lower to "round to the nearest"
- if (CI->getType() != Type::VoidTy)
- CI->replaceAllUsesWith(ConstantInt::get(CI->getType(), 1));
- break;
- }
-
- assert(CI->use_empty() &&
- "Lowering should have eliminated any uses of the intrinsic call!");
- CI->eraseFromParent();
-}
diff --git a/release_23/lib/CodeGen/LLVMTargetMachine.cpp b/release_23/lib/CodeGen/LLVMTargetMachine.cpp
deleted file mode 100644
index 4004cf1e1800..000000000000
--- a/release_23/lib/CodeGen/LLVMTargetMachine.cpp
+++ /dev/null
@@ -1,278 +0,0 @@
-//===-- LLVMTargetMachine.cpp - Implement the LLVMTargetMachine class -----===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the LLVMTargetMachine class.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Target/TargetMachine.h"
-#include "llvm/PassManager.h"
-#include "llvm/Pass.h"
-#include "llvm/Assembly/PrintModulePass.h"
-#include "llvm/Analysis/LoopPass.h"
-#include "llvm/CodeGen/Passes.h"
-#include "llvm/CodeGen/Collector.h"
-#include "llvm/Target/TargetOptions.h"
-#include "llvm/Target/TargetAsmInfo.h"
-#include "llvm/Transforms/Scalar.h"
-#include "llvm/Support/CommandLine.h"
-using namespace llvm;
-
-static cl::opt<bool> PrintLSR("print-lsr-output", cl::Hidden,
- cl::desc("Print LLVM IR produced by the loop-reduce pass"));
-static cl::opt<bool> PrintISelInput("print-isel-input", cl::Hidden,
- cl::desc("Print LLVM IR input to isel pass"));
-static cl::opt<bool> PrintEmittedAsm("print-emitted-asm", cl::Hidden,
- cl::desc("Dump emitter generated instructions as assembly"));
-static cl::opt<bool> PrintGCInfo("print-gc", cl::Hidden,
- cl::desc("Dump garbage collector data"));
-
-// Hidden options to help debugging
-static cl::opt<bool>
-EnableSinking("enable-sinking", cl::init(false), cl::Hidden,
- cl::desc("Perform sinking on machine code"));
-static cl::opt<bool>
-AlignLoops("align-loops", cl::init(true), cl::Hidden,
- cl::desc("Align loop headers"));
-static cl::opt<bool>
-PerformLICM("machine-licm",
- cl::init(false), cl::Hidden,
- cl::desc("Perform loop-invariant code motion on machine code"));
-
-// When this works it will be on by default.
-static cl::opt<bool>
-DisablePostRAScheduler("disable-post-RA-scheduler",
- cl::desc("Disable scheduling after register allocation"),
- cl::init(true));
-
-FileModel::Model
-LLVMTargetMachine::addPassesToEmitFile(PassManagerBase &PM,
- std::ostream &Out,
- CodeGenFileType FileType,
- bool Fast) {
- // Standard LLVM-Level Passes.
-
- // Run loop strength reduction before anything else.
- if (!Fast) {
- PM.add(createLoopStrengthReducePass(getTargetLowering()));
- if (PrintLSR)
- PM.add(new PrintFunctionPass("\n\n*** Code after LSR ***\n", &cerr));
- }
-
- PM.add(createGCLoweringPass());
-
- if (!getTargetAsmInfo()->doesSupportExceptionHandling())
- PM.add(createLowerInvokePass(getTargetLowering()));
-
- // Make sure that no unreachable blocks are instruction selected.
- PM.add(createUnreachableBlockEliminationPass());
-
- if (!Fast)
- PM.add(createCodeGenPreparePass(getTargetLowering()));
-
- if (PrintISelInput)
- PM.add(new PrintFunctionPass("\n\n*** Final LLVM Code input to ISel ***\n",
- &cerr));
-
- // Ask the target for an isel.
- if (addInstSelector(PM, Fast))
- return FileModel::Error;
-
- // Print the instruction selected machine code...
- if (PrintMachineCode)
- PM.add(createMachineFunctionPrinterPass(cerr));
-
- if (PerformLICM)
- PM.add(createMachineLICMPass());
-
- if (EnableSinking)
- PM.add(createMachineSinkingPass());
-
- // Run pre-ra passes.
- if (addPreRegAlloc(PM, Fast) && PrintMachineCode)
- PM.add(createMachineFunctionPrinterPass(cerr));
-
- // Perform register allocation to convert to a concrete x86 representation
- PM.add(createRegisterAllocator());
-
- if (PrintMachineCode)
- PM.add(createMachineFunctionPrinterPass(cerr));
-
- PM.add(createLowerSubregsPass());
-
- if (PrintMachineCode) // Print the subreg lowered code
- PM.add(createMachineFunctionPrinterPass(cerr));
-
- // Run post-ra passes.
- if (addPostRegAlloc(PM, Fast) && PrintMachineCode)
- PM.add(createMachineFunctionPrinterPass(cerr));
-
- // Insert prolog/epilog code. Eliminate abstract frame index references...
- PM.add(createPrologEpilogCodeInserter());
-
- // Second pass scheduler.
- if (!Fast && !DisablePostRAScheduler)
- PM.add(createPostRAScheduler());
-
- // Branch folding must be run after regalloc and prolog/epilog insertion.
- if (!Fast)
- PM.add(createBranchFoldingPass(getEnableTailMergeDefault()));
-
- PM.add(createGCMachineCodeAnalysisPass());
- if (PrintMachineCode)
- PM.add(createMachineFunctionPrinterPass(cerr));
-
- if (PrintGCInfo)
- PM.add(createCollectorMetadataPrinter(*cerr));
-
- // Fold redundant debug labels.
- PM.add(createDebugLabelFoldingPass());
-
- if (PrintMachineCode) // Print the register-allocated code
- PM.add(createMachineFunctionPrinterPass(cerr));
-
- if (addPreEmitPass(PM, Fast) && PrintMachineCode)
- PM.add(createMachineFunctionPrinterPass(cerr));
-
- if (AlignLoops && !OptimizeForSize)
- PM.add(createLoopAlignerPass());
-
- switch (FileType) {
- default:
- break;
- case TargetMachine::AssemblyFile:
- if (addAssemblyEmitter(PM, Fast, Out))
- return FileModel::Error;
- return FileModel::AsmFile;
- case TargetMachine::ObjectFile:
- if (getMachOWriterInfo())
- return FileModel::MachOFile;
- else if (getELFWriterInfo())
- return FileModel::ElfFile;
- }
-
- return FileModel::Error;
-}
-
-/// addPassesToEmitFileFinish - If the passes to emit the specified file had to
-/// be split up (e.g., to add an object writer pass), this method can be used to
-/// finish up adding passes to emit the file, if necessary.
-bool LLVMTargetMachine::addPassesToEmitFileFinish(PassManagerBase &PM,
- MachineCodeEmitter *MCE,
- bool Fast) {
- if (MCE)
- addSimpleCodeEmitter(PM, Fast, PrintEmittedAsm, *MCE);
-
- PM.add(createCollectorMetadataDeleter());
-
- // Delete machine code for this function
- PM.add(createMachineCodeDeleter());
-
- return false; // success!
-}
-
-/// addPassesToEmitMachineCode - Add passes to the specified pass manager to
-/// get machine code emitted. This uses a MachineCodeEmitter object to handle
-/// actually outputting the machine code and resolving things like the address
-/// of functions. This method should returns true if machine code emission is
-/// not supported.
-///
-bool LLVMTargetMachine::addPassesToEmitMachineCode(PassManagerBase &PM,
- MachineCodeEmitter &MCE,
- bool Fast) {
- // Standard LLVM-Level Passes.
-
- // Run loop strength reduction before anything else.
- if (!Fast) {
- PM.add(createLoopStrengthReducePass(getTargetLowering()));
- if (PrintLSR)
- PM.add(new PrintFunctionPass("\n\n*** Code after LSR ***\n", &cerr));
- }
-
- PM.add(createGCLoweringPass());
-
- if (!getTargetAsmInfo()->doesSupportExceptionHandling())
- PM.add(createLowerInvokePass(getTargetLowering()));
-
- // Make sure that no unreachable blocks are instruction selected.
- PM.add(createUnreachableBlockEliminationPass());
-
- if (!Fast)
- PM.add(createCodeGenPreparePass(getTargetLowering()));
-
- if (PrintISelInput)
- PM.add(new PrintFunctionPass("\n\n*** Final LLVM Code input to ISel ***\n",
- &cerr));
-
- // Ask the target for an isel.
- if (addInstSelector(PM, Fast))
- return true;
-
- // Print the instruction selected machine code...
- if (PrintMachineCode)
- PM.add(createMachineFunctionPrinterPass(cerr));
-
- if (PerformLICM)
- PM.add(createMachineLICMPass());
-
- if (EnableSinking)
- PM.add(createMachineSinkingPass());
-
- // Run pre-ra passes.
- if (addPreRegAlloc(PM, Fast) && PrintMachineCode)
- PM.add(createMachineFunctionPrinterPass(cerr));
-
- // Perform register allocation to convert to a concrete x86 representation
- PM.add(createRegisterAllocator());
-
- if (PrintMachineCode)
- PM.add(createMachineFunctionPrinterPass(cerr));
-
- PM.add(createLowerSubregsPass());
-
- if (PrintMachineCode) // Print the subreg lowered code
- PM.add(createMachineFunctionPrinterPass(cerr));
-
- // Run post-ra passes.
- if (addPostRegAlloc(PM, Fast) && PrintMachineCode)
- PM.add(createMachineFunctionPrinterPass(cerr));
-
- // Insert prolog/epilog code. Eliminate abstract frame index references...
- PM.add(createPrologEpilogCodeInserter());
-
- if (PrintMachineCode) // Print the register-allocated code
- PM.add(createMachineFunctionPrinterPass(cerr));
-
- // Second pass scheduler.
- if (!Fast)
- PM.add(createPostRAScheduler());
-
- // Branch folding must be run after regalloc and prolog/epilog insertion.
- if (!Fast)
- PM.add(createBranchFoldingPass(getEnableTailMergeDefault()));
-
- PM.add(createGCMachineCodeAnalysisPass());
- if (PrintMachineCode)
- PM.add(createMachineFunctionPrinterPass(cerr));
-
- if (PrintGCInfo)
- PM.add(createCollectorMetadataPrinter(*cerr));
-
- if (addPreEmitPass(PM, Fast) && PrintMachineCode)
- PM.add(createMachineFunctionPrinterPass(cerr));
-
- addCodeEmitter(PM, Fast, PrintEmittedAsm, MCE);
-
- PM.add(createCollectorMetadataDeleter());
-
- // Delete machine code for this function
- PM.add(createMachineCodeDeleter());
-
- return false; // success!
-}
diff --git a/release_23/lib/CodeGen/LiveInterval.cpp b/release_23/lib/CodeGen/LiveInterval.cpp
deleted file mode 100644
index 48c25a14a350..000000000000
--- a/release_23/lib/CodeGen/LiveInterval.cpp
+++ /dev/null
@@ -1,726 +0,0 @@
-//===-- LiveInterval.cpp - Live Interval Representation -------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the LiveRange and LiveInterval classes. Given some
-// numbering of each the machine instructions an interval [i, j) is said to be a
-// live interval for register v if there is no instruction with number j' > j
-// such that v is live at j' abd there is no instruction with number i' < i such
-// that v is live at i'. In this implementation intervals can have holes,
-// i.e. an interval might look like [1,20), [50,65), [1000,1001). Each
-// individual range is represented as an instance of LiveRange, and the whole
-// interval is represented as an instance of LiveInterval.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/CodeGen/LiveInterval.h"
-#include "llvm/ADT/SmallSet.h"
-#include "llvm/ADT/STLExtras.h"
-#include "llvm/Support/Streams.h"
-#include "llvm/Target/TargetRegisterInfo.h"
-#include <algorithm>
-#include <ostream>
-using namespace llvm;
-
-// An example for liveAt():
-//
-// this = [1,4), liveAt(0) will return false. The instruction defining this
-// spans slots [0,3]. The interval belongs to an spilled definition of the
-// variable it represents. This is because slot 1 is used (def slot) and spans
-// up to slot 3 (store slot).
-//
-bool LiveInterval::liveAt(unsigned I) const {
- Ranges::const_iterator r = std::upper_bound(ranges.begin(), ranges.end(), I);
-
- if (r == ranges.begin())
- return false;
-
- --r;
- return r->contains(I);
-}
-
-// liveBeforeAndAt - Check if the interval is live at the index and the index
-// just before it. If index is liveAt, check if it starts a new live range.
-// If it does, then check if the previous live range ends at index-1.
-bool LiveInterval::liveBeforeAndAt(unsigned I) const {
- Ranges::const_iterator r = std::upper_bound(ranges.begin(), ranges.end(), I);
-
- if (r == ranges.begin())
- return false;
-
- --r;
- if (!r->contains(I))
- return false;
- if (I != r->start)
- return true;
- // I is the start of a live range. Check if the previous live range ends
- // at I-1.
- if (r == ranges.begin())
- return false;
- return r->end == I;
-}
-
-// overlaps - Return true if the intersection of the two live intervals is
-// not empty.
-//
-// An example for overlaps():
-//
-// 0: A = ...
-// 4: B = ...
-// 8: C = A + B ;; last use of A
-//
-// The live intervals should look like:
-//
-// A = [3, 11)
-// B = [7, x)
-// C = [11, y)
-//
-// A->overlaps(C) should return false since we want to be able to join
-// A and C.
-//
-bool LiveInterval::overlapsFrom(const LiveInterval& other,
- const_iterator StartPos) const {
- const_iterator i = begin();
- const_iterator ie = end();
- const_iterator j = StartPos;
- const_iterator je = other.end();
-
- assert((StartPos->start <= i->start || StartPos == other.begin()) &&
- StartPos != other.end() && "Bogus start position hint!");
-
- if (i->start < j->start) {
- i = std::upper_bound(i, ie, j->start);
- if (i != ranges.begin()) --i;
- } else if (j->start < i->start) {
- ++StartPos;
- if (StartPos != other.end() && StartPos->start <= i->start) {
- assert(StartPos < other.end() && i < end());
- j = std::upper_bound(j, je, i->start);
- if (j != other.ranges.begin()) --j;
- }
- } else {
- return true;
- }
-
- if (j == je) return false;
-
- while (i != ie) {
- if (i->start > j->start) {
- std::swap(i, j);
- std::swap(ie, je);
- }
-
- if (i->end > j->start)
- return true;
- ++i;
- }
-
- return false;
-}
-
-/// extendIntervalEndTo - This method is used when we want to extend the range
-/// specified by I to end at the specified endpoint. To do this, we should
-/// merge and eliminate all ranges that this will overlap with. The iterator is
-/// not invalidated.
-void LiveInterval::extendIntervalEndTo(Ranges::iterator I, unsigned NewEnd) {
- assert(I != ranges.end() && "Not a valid interval!");
- VNInfo *ValNo = I->valno;
- unsigned OldEnd = I->end;
-
- // Search for the first interval that we can't merge with.
- Ranges::iterator MergeTo = next(I);
- for (; MergeTo != ranges.end() && NewEnd >= MergeTo->end; ++MergeTo) {
- assert(MergeTo->valno == ValNo && "Cannot merge with differing values!");
- }
-
- // If NewEnd was in the middle of an interval, make sure to get its endpoint.
- I->end = std::max(NewEnd, prior(MergeTo)->end);
-
- // Erase any dead ranges.
- ranges.erase(next(I), MergeTo);
-
- // Update kill info.
- removeKills(ValNo, OldEnd, I->end-1);
-
- // If the newly formed range now touches the range after it and if they have
- // the same value number, merge the two ranges into one range.
- Ranges::iterator Next = next(I);
- if (Next != ranges.end() && Next->start <= I->end && Next->valno == ValNo) {
- I->end = Next->end;
- ranges.erase(Next);
- }
-}
-
-
-/// extendIntervalStartTo - This method is used when we want to extend the range
-/// specified by I to start at the specified endpoint. To do this, we should
-/// merge and eliminate all ranges that this will overlap with.
-LiveInterval::Ranges::iterator
-LiveInterval::extendIntervalStartTo(Ranges::iterator I, unsigned NewStart) {
- assert(I != ranges.end() && "Not a valid interval!");
- VNInfo *ValNo = I->valno;
-
- // Search for the first interval that we can't merge with.
- Ranges::iterator MergeTo = I;
- do {
- if (MergeTo == ranges.begin()) {
- I->start = NewStart;
- ranges.erase(MergeTo, I);
- return I;
- }
- assert(MergeTo->valno == ValNo && "Cannot merge with differing values!");
- --MergeTo;
- } while (NewStart <= MergeTo->start);
-
- // If we start in the middle of another interval, just delete a range and
- // extend that interval.
- if (MergeTo->end >= NewStart && MergeTo->valno == ValNo) {
- MergeTo->end = I->end;
- } else {
- // Otherwise, extend the interval right after.
- ++MergeTo;
- MergeTo->start = NewStart;
- MergeTo->end = I->end;
- }
-
- ranges.erase(next(MergeTo), next(I));
- return MergeTo;
-}
-
-LiveInterval::iterator
-LiveInterval::addRangeFrom(LiveRange LR, iterator From) {
- unsigned Start = LR.start, End = LR.end;
- iterator it = std::upper_bound(From, ranges.end(), Start);
-
- // If the inserted interval starts in the middle or right at the end of
- // another interval, just extend that interval to contain the range of LR.
- if (it != ranges.begin()) {
- iterator B = prior(it);
- if (LR.valno == B->valno) {
- if (B->start <= Start && B->end >= Start) {
- extendIntervalEndTo(B, End);
- return B;
- }
- } else {
- // Check to make sure that we are not overlapping two live ranges with
- // different valno's.
- assert(B->end <= Start &&
- "Cannot overlap two LiveRanges with differing ValID's"
- " (did you def the same reg twice in a MachineInstr?)");
- }
- }
-
- // Otherwise, if this range ends in the middle of, or right next to, another
- // interval, merge it into that interval.
- if (it != ranges.end()) {
- if (LR.valno == it->valno) {
- if (it->start <= End) {
- it = extendIntervalStartTo(it, Start);
-
- // If LR is a complete superset of an interval, we may need to grow its
- // endpoint as well.
- if (End > it->end)
- extendIntervalEndTo(it, End);
- else if (End < it->end)
- // Overlapping intervals, there might have been a kill here.
- removeKill(it->valno, End);
- return it;
- }
- } else {
- // Check to make sure that we are not overlapping two live ranges with
- // different valno's.
- assert(it->start >= End &&
- "Cannot overlap two LiveRanges with differing ValID's");
- }
- }
-
- // Otherwise, this is just a new range that doesn't interact with anything.
- // Insert it.
- return ranges.insert(it, LR);
-}
-
-
-/// removeRange - Remove the specified range from this interval. Note that
-/// the range must already be in this interval in its entirety.
-void LiveInterval::removeRange(unsigned Start, unsigned End,
- bool RemoveDeadValNo) {
- // Find the LiveRange containing this span.
- Ranges::iterator I = std::upper_bound(ranges.begin(), ranges.end(), Start);
- assert(I != ranges.begin() && "Range is not in interval!");
- --I;
- assert(I->contains(Start) && I->contains(End-1) &&
- "Range is not entirely in interval!");
-
- // If the span we are removing is at the start of the LiveRange, adjust it.
- VNInfo *ValNo = I->valno;
- if (I->start == Start) {
- if (I->end == End) {
- removeKills(I->valno, Start, End);
- if (RemoveDeadValNo) {
- // Check if val# is dead.
- bool isDead = true;
- for (const_iterator II = begin(), EE = end(); II != EE; ++II)
- if (II != I && II->valno == ValNo) {
- isDead = false;
- break;
- }
- if (isDead) {
- // Now that ValNo is dead, remove it. If it is the largest value
- // number, just nuke it (and any other deleted values neighboring it),
- // otherwise mark it as ~1U so it can be nuked later.
- if (ValNo->id == getNumValNums()-1) {
- do {
- VNInfo *VNI = valnos.back();
- valnos.pop_back();
- VNI->~VNInfo();
- } while (!valnos.empty() && valnos.back()->def == ~1U);
- } else {
- ValNo->def = ~1U;
- }
- }
- }
-
- ranges.erase(I); // Removed the whole LiveRange.
- } else
- I->start = End;
- return;
- }
-
- // Otherwise if the span we are removing is at the end of the LiveRange,
- // adjust the other way.
- if (I->end == End) {
- removeKills(ValNo, Start, End);
- I->end = Start;
- return;
- }
-
- // Otherwise, we are splitting the LiveRange into two pieces.
- unsigned OldEnd = I->end;
- I->end = Start; // Trim the old interval.
-
- // Insert the new one.
- ranges.insert(next(I), LiveRange(End, OldEnd, ValNo));
-}
-
-/// removeValNo - Remove all the ranges defined by the specified value#.
-/// Also remove the value# from value# list.
-void LiveInterval::removeValNo(VNInfo *ValNo) {
- if (empty()) return;
- Ranges::iterator I = ranges.end();
- Ranges::iterator E = ranges.begin();
- do {
- --I;
- if (I->valno == ValNo)
- ranges.erase(I);
- } while (I != E);
- // Now that ValNo is dead, remove it. If it is the largest value
- // number, just nuke it (and any other deleted values neighboring it),
- // otherwise mark it as ~1U so it can be nuked later.
- if (ValNo->id == getNumValNums()-1) {
- do {
- VNInfo *VNI = valnos.back();
- valnos.pop_back();
- VNI->~VNInfo();
- } while (!valnos.empty() && valnos.back()->def == ~1U);
- } else {
- ValNo->def = ~1U;
- }
-}
-
-/// getLiveRangeContaining - Return the live range that contains the
-/// specified index, or null if there is none.
-LiveInterval::const_iterator
-LiveInterval::FindLiveRangeContaining(unsigned Idx) const {
- const_iterator It = std::upper_bound(begin(), end(), Idx);
- if (It != ranges.begin()) {
- --It;
- if (It->contains(Idx))
- return It;
- }
-
- return end();
-}
-
-LiveInterval::iterator
-LiveInterval::FindLiveRangeContaining(unsigned Idx) {
- iterator It = std::upper_bound(begin(), end(), Idx);
- if (It != begin()) {
- --It;
- if (It->contains(Idx))
- return It;
- }
-
- return end();
-}
-
-/// join - Join two live intervals (this, and other) together. This applies
-/// mappings to the value numbers in the LHS/RHS intervals as specified. If
-/// the intervals are not joinable, this aborts.
-void LiveInterval::join(LiveInterval &Other, const int *LHSValNoAssignments,
- const int *RHSValNoAssignments,
- SmallVector<VNInfo*, 16> &NewVNInfo) {
- // Determine if any of our live range values are mapped. This is uncommon, so
- // we want to avoid the interval scan if not.
- bool MustMapCurValNos = false;
- unsigned NumVals = getNumValNums();
- unsigned NumNewVals = NewVNInfo.size();
- for (unsigned i = 0; i != NumVals; ++i) {
- unsigned LHSValID = LHSValNoAssignments[i];
- if (i != LHSValID ||
- (NewVNInfo[LHSValID] && NewVNInfo[LHSValID] != getValNumInfo(i)))
- MustMapCurValNos = true;
- }
-
- // If we have to apply a mapping to our base interval assignment, rewrite it
- // now.
- if (MustMapCurValNos) {
- // Map the first live range.
- iterator OutIt = begin();
- OutIt->valno = NewVNInfo[LHSValNoAssignments[OutIt->valno->id]];
- ++OutIt;
- for (iterator I = OutIt, E = end(); I != E; ++I) {
- OutIt->valno = NewVNInfo[LHSValNoAssignments[I->valno->id]];
-
- // If this live range has the same value # as its immediate predecessor,
- // and if they are neighbors, remove one LiveRange. This happens when we
- // have [0,3:0)[4,7:1) and map 0/1 onto the same value #.
- if (OutIt->valno == (OutIt-1)->valno && (OutIt-1)->end == OutIt->start) {
- (OutIt-1)->end = OutIt->end;
- } else {
- if (I != OutIt) {
- OutIt->start = I->start;
- OutIt->end = I->end;
- }
-
- // Didn't merge, on to the next one.
- ++OutIt;
- }
- }
-
- // If we merge some live ranges, chop off the end.
- ranges.erase(OutIt, end());
- }
-
- // Remember assignements because val# ids are changing.
- SmallVector<unsigned, 16> OtherAssignments;
- for (iterator I = Other.begin(), E = Other.end(); I != E; ++I)
- OtherAssignments.push_back(RHSValNoAssignments[I->valno->id]);
-
- // Update val# info. Renumber them and make sure they all belong to this
- // LiveInterval now. Also remove dead val#'s.
- unsigned NumValNos = 0;
- for (unsigned i = 0; i < NumNewVals; ++i) {
- VNInfo *VNI = NewVNInfo[i];
- if (VNI) {
- if (i >= NumVals)
- valnos.push_back(VNI);
- else
- valnos[NumValNos] = VNI;
- VNI->id = NumValNos++; // Renumber val#.
- }
- }
- if (NumNewVals < NumVals)
- valnos.resize(NumNewVals); // shrinkify
-
- // Okay, now insert the RHS live ranges into the LHS.
- iterator InsertPos = begin();
- unsigned RangeNo = 0;
- for (iterator I = Other.begin(), E = Other.end(); I != E; ++I, ++RangeNo) {
- // Map the valno in the other live range to the current live range.
- I->valno = NewVNInfo[OtherAssignments[RangeNo]];
- assert(I->valno && "Adding a dead range?");
- InsertPos = addRangeFrom(*I, InsertPos);
- }
-
- weight += Other.weight;
- if (Other.preference && !preference)
- preference = Other.preference;
-}
-
-/// MergeRangesInAsValue - Merge all of the intervals in RHS into this live
-/// interval as the specified value number. The LiveRanges in RHS are
-/// allowed to overlap with LiveRanges in the current interval, but only if
-/// the overlapping LiveRanges have the specified value number.
-void LiveInterval::MergeRangesInAsValue(const LiveInterval &RHS,
- VNInfo *LHSValNo) {
- // TODO: Make this more efficient.
- iterator InsertPos = begin();
- for (const_iterator I = RHS.begin(), E = RHS.end(); I != E; ++I) {
- // Map the valno in the other live range to the current live range.
- LiveRange Tmp = *I;
- Tmp.valno = LHSValNo;
- InsertPos = addRangeFrom(Tmp, InsertPos);
- }
-}
-
-
-/// MergeValueInAsValue - Merge all of the live ranges of a specific val#
-/// in RHS into this live interval as the specified value number.
-/// The LiveRanges in RHS are allowed to overlap with LiveRanges in the
-/// current interval, it will replace the value numbers of the overlaped
-/// live ranges with the specified value number.
-void LiveInterval::MergeValueInAsValue(const LiveInterval &RHS,
- const VNInfo *RHSValNo, VNInfo *LHSValNo) {
- SmallVector<VNInfo*, 4> ReplacedValNos;
- iterator IP = begin();
- for (const_iterator I = RHS.begin(), E = RHS.end(); I != E; ++I) {
- if (I->valno != RHSValNo)
- continue;
- unsigned Start = I->start, End = I->end;
- IP = std::upper_bound(IP, end(), Start);
- // If the start of this range overlaps with an existing liverange, trim it.
- if (IP != begin() && IP[-1].end > Start) {
- if (IP[-1].valno != LHSValNo) {
- ReplacedValNos.push_back(IP[-1].valno);
- IP[-1].valno = LHSValNo; // Update val#.
- }
- Start = IP[-1].end;
- // Trimmed away the whole range?
- if (Start >= End) continue;
- }
- // If the end of this range overlaps with an existing liverange, trim it.
- if (IP != end() && End > IP->start) {
- if (IP->valno != LHSValNo) {
- ReplacedValNos.push_back(IP->valno);
- IP->valno = LHSValNo; // Update val#.
- }
- End = IP->start;
- // If this trimmed away the whole range, ignore it.
- if (Start == End) continue;
- }
-
- // Map the valno in the other live range to the current live range.
- IP = addRangeFrom(LiveRange(Start, End, LHSValNo), IP);
- }
-
-
- SmallSet<VNInfo*, 4> Seen;
- for (unsigned i = 0, e = ReplacedValNos.size(); i != e; ++i) {
- VNInfo *V1 = ReplacedValNos[i];
- if (Seen.insert(V1)) {
- bool isDead = true;
- for (const_iterator I = begin(), E = end(); I != E; ++I)
- if (I->valno == V1) {
- isDead = false;
- break;
- }
- if (isDead) {
- // Now that V1 is dead, remove it. If it is the largest value number,
- // just nuke it (and any other deleted values neighboring it), otherwise
- // mark it as ~1U so it can be nuked later.
- if (V1->id == getNumValNums()-1) {
- do {
- VNInfo *VNI = valnos.back();
- valnos.pop_back();
- VNI->~VNInfo();
- } while (!valnos.empty() && valnos.back()->def == ~1U);
- } else {
- V1->def = ~1U;
- }
- }
- }
- }
-}
-
-
-/// MergeInClobberRanges - For any live ranges that are not defined in the
-/// current interval, but are defined in the Clobbers interval, mark them
-/// used with an unknown definition value.
-void LiveInterval::MergeInClobberRanges(const LiveInterval &Clobbers,
- BumpPtrAllocator &VNInfoAllocator) {
- if (Clobbers.begin() == Clobbers.end()) return;
-
- // Find a value # to use for the clobber ranges. If there is already a value#
- // for unknown values, use it.
- // FIXME: Use a single sentinal number for these!
- VNInfo *ClobberValNo = getNextValue(~0U, 0, VNInfoAllocator);
-
- iterator IP = begin();
- for (const_iterator I = Clobbers.begin(), E = Clobbers.end(); I != E; ++I) {
- unsigned Start = I->start, End = I->end;
- IP = std::upper_bound(IP, end(), Start);
-
- // If the start of this range overlaps with an existing liverange, trim it.
- if (IP != begin() && IP[-1].end > Start) {
- Start = IP[-1].end;
- // Trimmed away the whole range?
- if (Start >= End) continue;
- }
- // If the end of this range overlaps with an existing liverange, trim it.
- if (IP != end() && End > IP->start) {
- End = IP->start;
- // If this trimmed away the whole range, ignore it.
- if (Start == End) continue;
- }
-
- // Insert the clobber interval.
- IP = addRangeFrom(LiveRange(Start, End, ClobberValNo), IP);
- }
-}
-
-/// MergeValueNumberInto - This method is called when two value nubmers
-/// are found to be equivalent. This eliminates V1, replacing all
-/// LiveRanges with the V1 value number with the V2 value number. This can
-/// cause merging of V1/V2 values numbers and compaction of the value space.
-void LiveInterval::MergeValueNumberInto(VNInfo *V1, VNInfo *V2) {
- assert(V1 != V2 && "Identical value#'s are always equivalent!");
-
- // This code actually merges the (numerically) larger value number into the
- // smaller value number, which is likely to allow us to compactify the value
- // space. The only thing we have to be careful of is to preserve the
- // instruction that defines the result value.
-
- // Make sure V2 is smaller than V1.
- if (V1->id < V2->id) {
- copyValNumInfo(V1, V2);
- std::swap(V1, V2);
- }
-
- // Merge V1 live ranges into V2.
- for (iterator I = begin(); I != end(); ) {
- iterator LR = I++;
- if (LR->valno != V1) continue; // Not a V1 LiveRange.
-
- // Okay, we found a V1 live range. If it had a previous, touching, V2 live
- // range, extend it.
- if (LR != begin()) {
- iterator Prev = LR-1;
- if (Prev->valno == V2 && Prev->end == LR->start) {
- Prev->end = LR->end;
-
- // Erase this live-range.
- ranges.erase(LR);
- I = Prev+1;
- LR = Prev;
- }
- }
-
- // Okay, now we have a V1 or V2 live range that is maximally merged forward.
- // Ensure that it is a V2 live-range.
- LR->valno = V2;
-
- // If we can merge it into later V2 live ranges, do so now. We ignore any
- // following V1 live ranges, as they will be merged in subsequent iterations
- // of the loop.
- if (I != end()) {
- if (I->start == LR->end && I->valno == V2) {
- LR->end = I->end;
- ranges.erase(I);
- I = LR+1;
- }
- }
- }
-
- // Now that V1 is dead, remove it. If it is the largest value number, just
- // nuke it (and any other deleted values neighboring it), otherwise mark it as
- // ~1U so it can be nuked later.
- if (V1->id == getNumValNums()-1) {
- do {
- VNInfo *VNI = valnos.back();
- valnos.pop_back();
- VNI->~VNInfo();
- } while (valnos.back()->def == ~1U);
- } else {
- V1->def = ~1U;
- }
-}
-
-void LiveInterval::Copy(const LiveInterval &RHS,
- BumpPtrAllocator &VNInfoAllocator) {
- ranges.clear();
- valnos.clear();
- preference = RHS.preference;
- weight = RHS.weight;
- for (unsigned i = 0, e = RHS.getNumValNums(); i != e; ++i) {
- const VNInfo *VNI = RHS.getValNumInfo(i);
- VNInfo *NewVNI = getNextValue(~0U, 0, VNInfoAllocator);
- copyValNumInfo(NewVNI, VNI);
- }
- for (unsigned i = 0, e = RHS.ranges.size(); i != e; ++i) {
- const LiveRange &LR = RHS.ranges[i];
- addRange(LiveRange(LR.start, LR.end, getValNumInfo(LR.valno->id)));
- }
-}
-
-unsigned LiveInterval::getSize() const {
- unsigned Sum = 0;
- for (const_iterator I = begin(), E = end(); I != E; ++I)
- Sum += I->end - I->start;
- return Sum;
-}
-
-std::ostream& llvm::operator<<(std::ostream& os, const LiveRange &LR) {
- return os << '[' << LR.start << ',' << LR.end << ':' << LR.valno->id << ")";
-}
-
-void LiveRange::dump() const {
- cerr << *this << "\n";
-}
-
-void LiveInterval::print(std::ostream &OS,
- const TargetRegisterInfo *TRI) const {
- if (TRI && TargetRegisterInfo::isPhysicalRegister(reg))
- OS << TRI->getName(reg);
- else
- OS << "%reg" << reg;
-
- OS << ',' << weight;
-
- if (empty())
- OS << "EMPTY";
- else {
- OS << " = ";
- for (LiveInterval::Ranges::const_iterator I = ranges.begin(),
- E = ranges.end(); I != E; ++I)
- OS << *I;
- }
-
- // Print value number info.
- if (getNumValNums()) {
- OS << " ";
- unsigned vnum = 0;
- for (const_vni_iterator i = vni_begin(), e = vni_end(); i != e;
- ++i, ++vnum) {
- const VNInfo *vni = *i;
- if (vnum) OS << " ";
- OS << vnum << "@";
- if (vni->def == ~1U) {
- OS << "x";
- } else {
- if (vni->def == ~0U)
- OS << "?";
- else
- OS << vni->def;
- unsigned ee = vni->kills.size();
- if (ee || vni->hasPHIKill) {
- OS << "-(";
- for (unsigned j = 0; j != ee; ++j) {
- OS << vni->kills[j];
- if (j != ee-1)
- OS << " ";
- }
- if (vni->hasPHIKill) {
- if (ee)
- OS << " ";
- OS << "phi";
- }
- OS << ")";
- }
- }
- }
- }
-}
-
-void LiveInterval::dump() const {
- cerr << *this << "\n";
-}
-
-
-void LiveRange::print(std::ostream &os) const {
- os << *this;
-}
diff --git a/release_23/lib/CodeGen/LiveIntervalAnalysis.cpp b/release_23/lib/CodeGen/LiveIntervalAnalysis.cpp
deleted file mode 100644
index 87c854bd0271..000000000000
--- a/release_23/lib/CodeGen/LiveIntervalAnalysis.cpp
+++ /dev/null
@@ -1,1743 +0,0 @@
-//===-- LiveIntervalAnalysis.cpp - Live Interval Analysis -----------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the LiveInterval analysis pass which is used
-// by the Linear Scan Register allocator. This pass linearizes the
-// basic blocks of the function in DFS order and uses the
-// LiveVariables pass to conservatively compute live intervals for
-// each virtual and physical register.
-//
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "liveintervals"
-#include "llvm/CodeGen/LiveIntervalAnalysis.h"
-#include "VirtRegMap.h"
-#include "llvm/Value.h"
-#include "llvm/CodeGen/LiveVariables.h"
-#include "llvm/CodeGen/MachineFrameInfo.h"
-#include "llvm/CodeGen/MachineInstr.h"
-#include "llvm/CodeGen/MachineLoopInfo.h"
-#include "llvm/CodeGen/MachineRegisterInfo.h"
-#include "llvm/CodeGen/Passes.h"
-#include "llvm/Target/TargetRegisterInfo.h"
-#include "llvm/Target/TargetInstrInfo.h"
-#include "llvm/Target/TargetMachine.h"
-#include "llvm/Support/CommandLine.h"
-#include "llvm/Support/Debug.h"
-#include "llvm/ADT/Statistic.h"
-#include "llvm/ADT/STLExtras.h"
-#include <algorithm>
-#include <cmath>
-using namespace llvm;
-
-namespace {
- // Hidden options for help debugging.
- static cl::opt<bool> DisableReMat("disable-rematerialization",
- cl::init(false), cl::Hidden);
-
- static cl::opt<bool> SplitAtBB("split-intervals-at-bb",
- cl::init(true), cl::Hidden);
- static cl::opt<int> SplitLimit("split-limit",
- cl::init(-1), cl::Hidden);
-}
-
-STATISTIC(numIntervals, "Number of original intervals");
-STATISTIC(numIntervalsAfter, "Number of intervals after coalescing");
-STATISTIC(numFolds , "Number of loads/stores folded into instructions");
-STATISTIC(numSplits , "Number of intervals split");
-
-char LiveIntervals::ID = 0;
-namespace {
- RegisterPass<LiveIntervals> X("liveintervals", "Live Interval Analysis");
-}
-
-void LiveIntervals::getAnalysisUsage(AnalysisUsage &AU) const {
- AU.addPreserved<LiveVariables>();
- AU.addRequired<LiveVariables>();
- AU.addPreservedID(MachineLoopInfoID);
- AU.addPreservedID(MachineDominatorsID);
- AU.addPreservedID(PHIEliminationID);
- AU.addRequiredID(PHIEliminationID);
- AU.addRequiredID(TwoAddressInstructionPassID);
- MachineFunctionPass::getAnalysisUsage(AU);
-}
-
-void LiveIntervals::releaseMemory() {
- Idx2MBBMap.clear();
- mi2iMap_.clear();
- i2miMap_.clear();
- r2iMap_.clear();
- // Release VNInfo memroy regions after all VNInfo objects are dtor'd.
- VNInfoAllocator.Reset();
- for (unsigned i = 0, e = ClonedMIs.size(); i != e; ++i)
- delete ClonedMIs[i];
-}
-
-/// runOnMachineFunction - Register allocate the whole function
-///
-bool LiveIntervals::runOnMachineFunction(MachineFunction &fn) {
- mf_ = &fn;
- mri_ = &mf_->getRegInfo();
- tm_ = &fn.getTarget();
- tri_ = tm_->getRegisterInfo();
- tii_ = tm_->getInstrInfo();
- lv_ = &getAnalysis<LiveVariables>();
- allocatableRegs_ = tri_->getAllocatableSet(fn);
-
- // Number MachineInstrs and MachineBasicBlocks.
- // Initialize MBB indexes to a sentinal.
- MBB2IdxMap.resize(mf_->getNumBlockIDs(), std::make_pair(~0U,~0U));
-
- unsigned MIIndex = 0;
- for (MachineFunction::iterator MBB = mf_->begin(), E = mf_->end();
- MBB != E; ++MBB) {
- unsigned StartIdx = MIIndex;
-
- for (MachineBasicBlock::iterator I = MBB->begin(), E = MBB->end();
- I != E; ++I) {
- bool inserted = mi2iMap_.insert(std::make_pair(I, MIIndex)).second;
- assert(inserted && "multiple MachineInstr -> index mappings");
- i2miMap_.push_back(I);
- MIIndex += InstrSlots::NUM;
- }
-
- // Set the MBB2IdxMap entry for this MBB.
- MBB2IdxMap[MBB->getNumber()] = (StartIdx == MIIndex)
- ? std::make_pair(StartIdx, StartIdx) // Empty MBB
- : std::make_pair(StartIdx, MIIndex - 1);
- Idx2MBBMap.push_back(std::make_pair(StartIdx, MBB));
- }
- std::sort(Idx2MBBMap.begin(), Idx2MBBMap.end(), Idx2MBBCompare());
-
- computeIntervals();
-
- numIntervals += getNumIntervals();
-
- DOUT << "********** INTERVALS **********\n";
- for (iterator I = begin(), E = end(); I != E; ++I) {
- I->second.print(DOUT, tri_);
- DOUT << "\n";
- }
-
- numIntervalsAfter += getNumIntervals();
- DEBUG(dump());
- return true;
-}
-
-/// print - Implement the dump method.
-void LiveIntervals::print(std::ostream &O, const Module* ) const {
- O << "********** INTERVALS **********\n";
- for (const_iterator I = begin(), E = end(); I != E; ++I) {
- I->second.print(DOUT, tri_);
- DOUT << "\n";
- }
-
- O << "********** MACHINEINSTRS **********\n";
- for (MachineFunction::iterator mbbi = mf_->begin(), mbbe = mf_->end();
- mbbi != mbbe; ++mbbi) {
- O << ((Value*)mbbi->getBasicBlock())->getName() << ":\n";
- for (MachineBasicBlock::iterator mii = mbbi->begin(),
- mie = mbbi->end(); mii != mie; ++mii) {
- O << getInstructionIndex(mii) << '\t' << *mii;
- }
- }
-}
-
-/// conflictsWithPhysRegDef - Returns true if the specified register
-/// is defined during the duration of the specified interval.
-bool LiveIntervals::conflictsWithPhysRegDef(const LiveInterval &li,
- VirtRegMap &vrm, unsigned reg) {
- for (LiveInterval::Ranges::const_iterator
- I = li.ranges.begin(), E = li.ranges.end(); I != E; ++I) {
- for (unsigned index = getBaseIndex(I->start),
- end = getBaseIndex(I->end-1) + InstrSlots::NUM; index != end;
- index += InstrSlots::NUM) {
- // skip deleted instructions
- while (index != end && !getInstructionFromIndex(index))
- index += InstrSlots::NUM;
- if (index == end) break;
-
- MachineInstr *MI = getInstructionFromIndex(index);
- unsigned SrcReg, DstReg;
- if (tii_->isMoveInstr(*MI, SrcReg, DstReg))
- if (SrcReg == li.reg || DstReg == li.reg)
- continue;
- for (unsigned i = 0; i != MI->getNumOperands(); ++i) {
- MachineOperand& mop = MI->getOperand(i);
- if (!mop.isRegister())
- continue;
- unsigned PhysReg = mop.getReg();
- if (PhysReg == 0 || PhysReg == li.reg)
- continue;
- if (TargetRegisterInfo::isVirtualRegister(PhysReg)) {
- if (!vrm.hasPhys(PhysReg))
- continue;
- PhysReg = vrm.getPhys(PhysReg);
- }
- if (PhysReg && tri_->regsOverlap(PhysReg, reg))
- return true;
- }
- }
- }
-
- return false;
-}
-
-void LiveIntervals::printRegName(unsigned reg) const {
- if (TargetRegisterInfo::isPhysicalRegister(reg))
- cerr << tri_->getName(reg);
- else
- cerr << "%reg" << reg;
-}
-
-void LiveIntervals::handleVirtualRegisterDef(MachineBasicBlock *mbb,
- MachineBasicBlock::iterator mi,
- unsigned MIIdx,
- LiveInterval &interval) {
- DOUT << "\t\tregister: "; DEBUG(printRegName(interval.reg));
- LiveVariables::VarInfo& vi = lv_->getVarInfo(interval.reg);
-
- if (mi->getOpcode() == TargetInstrInfo::IMPLICIT_DEF) {
- DOUT << "is a implicit_def\n";
- return;
- }
-
- // Virtual registers may be defined multiple times (due to phi
- // elimination and 2-addr elimination). Much of what we do only has to be
- // done once for the vreg. We use an empty interval to detect the first
- // time we see a vreg.
- if (interval.empty()) {
- // Get the Idx of the defining instructions.
- unsigned defIndex = getDefIndex(MIIdx);
- VNInfo *ValNo;
- MachineInstr *CopyMI = NULL;
- unsigned SrcReg, DstReg;
- if (mi->getOpcode() == TargetInstrInfo::EXTRACT_SUBREG ||
- mi->getOpcode() == TargetInstrInfo::INSERT_SUBREG ||
- tii_->isMoveInstr(*mi, SrcReg, DstReg))
- CopyMI = mi;
- ValNo = interval.getNextValue(defIndex, CopyMI, VNInfoAllocator);
-
- assert(ValNo->id == 0 && "First value in interval is not 0?");
-
- // Loop over all of the blocks that the vreg is defined in. There are
- // two cases we have to handle here. The most common case is a vreg
- // whose lifetime is contained within a basic block. In this case there
- // will be a single kill, in MBB, which comes after the definition.
- if (vi.Kills.size() == 1 && vi.Kills[0]->getParent() == mbb) {
- // FIXME: what about dead vars?
- unsigned killIdx;
- if (vi.Kills[0] != mi)
- killIdx = getUseIndex(getInstructionIndex(vi.Kills[0]))+1;
- else
- killIdx = defIndex+1;
-
- // If the kill happens after the definition, we have an intra-block
- // live range.
- if (killIdx > defIndex) {
- assert(vi.AliveBlocks.none() &&
- "Shouldn't be alive across any blocks!");
- LiveRange LR(defIndex, killIdx, ValNo);
- interval.addRange(LR);
- DOUT << " +" << LR << "\n";
- interval.addKill(ValNo, killIdx);
- return;
- }
- }
-
- // The other case we handle is when a virtual register lives to the end
- // of the defining block, potentially live across some blocks, then is
- // live into some number of blocks, but gets killed. Start by adding a
- // range that goes from this definition to the end of the defining block.
- LiveRange NewLR(defIndex,
- getInstructionIndex(&mbb->back()) + InstrSlots::NUM,
- ValNo);
- DOUT << " +" << NewLR;
- interval.addRange(NewLR);
-
- // Iterate over all of the blocks that the variable is completely
- // live in, adding [insrtIndex(begin), instrIndex(end)+4) to the
- // live interval.
- for (unsigned i = 0, e = vi.AliveBlocks.size(); i != e; ++i) {
- if (vi.AliveBlocks[i]) {
- MachineBasicBlock *MBB = mf_->getBlockNumbered(i);
- if (!MBB->empty()) {
- LiveRange LR(getMBBStartIdx(i),
- getInstructionIndex(&MBB->back()) + InstrSlots::NUM,
- ValNo);
- interval.addRange(LR);
- DOUT << " +" << LR;
- }
- }
- }
-
- // Finally, this virtual register is live from the start of any killing
- // block to the 'use' slot of the killing instruction.
- for (unsigned i = 0, e = vi.Kills.size(); i != e; ++i) {
- MachineInstr *Kill = vi.Kills[i];
- unsigned killIdx = getUseIndex(getInstructionIndex(Kill))+1;
- LiveRange LR(getMBBStartIdx(Kill->getParent()),
- killIdx, ValNo);
- interval.addRange(LR);
- interval.addKill(ValNo, killIdx);
- DOUT << " +" << LR;
- }
-
- } else {
- // If this is the second time we see a virtual register definition, it
- // must be due to phi elimination or two addr elimination. If this is
- // the result of two address elimination, then the vreg is one of the
- // def-and-use register operand.
- if (mi->isRegReDefinedByTwoAddr(interval.reg)) {
- // If this is a two-address definition, then we have already processed
- // the live range. The only problem is that we didn't realize there
- // are actually two values in the live interval. Because of this we
- // need to take the LiveRegion that defines this register and split it
- // into two values.
- assert(interval.containsOneValue());
- unsigned DefIndex = getDefIndex(interval.getValNumInfo(0)->def);
- unsigned RedefIndex = getDefIndex(MIIdx);
-
- const LiveRange *OldLR = interval.getLiveRangeContaining(RedefIndex-1);
- VNInfo *OldValNo = OldLR->valno;
-
- // Delete the initial value, which should be short and continuous,
- // because the 2-addr copy must be in the same MBB as the redef.
- interval.removeRange(DefIndex, RedefIndex);
-
- // Two-address vregs should always only be redefined once. This means
- // that at this point, there should be exactly one value number in it.
- assert(interval.containsOneValue() && "Unexpected 2-addr liveint!");
-
- // The new value number (#1) is defined by the instruction we claimed
- // defined value #0.
- VNInfo *ValNo = interval.getNextValue(OldValNo->def, OldValNo->copy,
- VNInfoAllocator);
-
- // Value#0 is now defined by the 2-addr instruction.
- OldValNo->def = RedefIndex;
- OldValNo->copy = 0;
-
- // Add the new live interval which replaces the range for the input copy.
- LiveRange LR(DefIndex, RedefIndex, ValNo);
- DOUT << " replace range with " << LR;
- interval.addRange(LR);
- interval.addKill(ValNo, RedefIndex);
-
- // If this redefinition is dead, we need to add a dummy unit live
- // range covering the def slot.
- if (mi->registerDefIsDead(interval.reg, tri_))
- interval.addRange(LiveRange(RedefIndex, RedefIndex+1, OldValNo));
-
- DOUT << " RESULT: ";
- interval.print(DOUT, tri_);
-
- } else {
- // Otherwise, this must be because of phi elimination. If this is the
- // first redefinition of the vreg that we have seen, go back and change
- // the live range in the PHI block to be a different value number.
- if (interval.containsOneValue()) {
- assert(vi.Kills.size() == 1 &&
- "PHI elimination vreg should have one kill, the PHI itself!");
-
- // Remove the old range that we now know has an incorrect number.
- VNInfo *VNI = interval.getValNumInfo(0);
- MachineInstr *Killer = vi.Kills[0];
- unsigned Start = getMBBStartIdx(Killer->getParent());
- unsigned End = getUseIndex(getInstructionIndex(Killer))+1;
- DOUT << " Removing [" << Start << "," << End << "] from: ";
- interval.print(DOUT, tri_); DOUT << "\n";
- interval.removeRange(Start, End);
- VNI->hasPHIKill = true;
- DOUT << " RESULT: "; interval.print(DOUT, tri_);
-
- // Replace the interval with one of a NEW value number. Note that this
- // value number isn't actually defined by an instruction, weird huh? :)
- LiveRange LR(Start, End, interval.getNextValue(~0, 0, VNInfoAllocator));
- DOUT << " replace range with " << LR;
- interval.addRange(LR);
- interval.addKill(LR.valno, End);
- DOUT << " RESULT: "; interval.print(DOUT, tri_);
- }
-
- // In the case of PHI elimination, each variable definition is only
- // live until the end of the block. We've already taken care of the
- // rest of the live range.
- unsigned defIndex = getDefIndex(MIIdx);
-
- VNInfo *ValNo;
- MachineInstr *CopyMI = NULL;
- unsigned SrcReg, DstReg;
- if (mi->getOpcode() == TargetInstrInfo::EXTRACT_SUBREG ||
- mi->getOpcode() == TargetInstrInfo::INSERT_SUBREG ||
- tii_->isMoveInstr(*mi, SrcReg, DstReg))
- CopyMI = mi;
- ValNo = interval.getNextValue(defIndex, CopyMI, VNInfoAllocator);
-
- unsigned killIndex = getInstructionIndex(&mbb->back()) + InstrSlots::NUM;
- LiveRange LR(defIndex, killIndex, ValNo);
- interval.addRange(LR);
- interval.addKill(ValNo, killIndex);
- ValNo->hasPHIKill = true;
- DOUT << " +" << LR;
- }
- }
-
- DOUT << '\n';
-}
-
-void LiveIntervals::handlePhysicalRegisterDef(MachineBasicBlock *MBB,
- MachineBasicBlock::iterator mi,
- unsigned MIIdx,
- LiveInterval &interval,
- MachineInstr *CopyMI) {
- // A physical register cannot be live across basic block, so its
- // lifetime must end somewhere in its defining basic block.
- DOUT << "\t\tregister: "; DEBUG(printRegName(interval.reg));
-
- unsigned baseIndex = MIIdx;
- unsigned start = getDefIndex(baseIndex);
- unsigned end = start;
-
- // If it is not used after definition, it is considered dead at
- // the instruction defining it. Hence its interval is:
- // [defSlot(def), defSlot(def)+1)
- if (mi->registerDefIsDead(interval.reg, tri_)) {
- DOUT << " dead";
- end = getDefIndex(start) + 1;
- goto exit;
- }
-
- // If it is not dead on definition, it must be killed by a
- // subsequent instruction. Hence its interval is:
- // [defSlot(def), useSlot(kill)+1)
- while (++mi != MBB->end()) {
- baseIndex += InstrSlots::NUM;
- if (mi->killsRegister(interval.reg, tri_)) {
- DOUT << " killed";
- end = getUseIndex(baseIndex) + 1;
- goto exit;
- } else if (mi->modifiesRegister(interval.reg, tri_)) {
- // Another instruction redefines the register before it is ever read.
- // Then the register is essentially dead at the instruction that defines
- // it. Hence its interval is:
- // [defSlot(def), defSlot(def)+1)
- DOUT << " dead";
- end = getDefIndex(start) + 1;
- goto exit;
- }
- }
-
- // The only case we should have a dead physreg here without a killing or
- // instruction where we know it's dead is if it is live-in to the function
- // and never used.
- assert(!CopyMI && "physreg was not killed in defining block!");
- end = getDefIndex(start) + 1; // It's dead.
-
-exit:
- assert(start < end && "did not find end of interval?");
-
- // Already exists? Extend old live interval.
- LiveInterval::iterator OldLR = interval.FindLiveRangeContaining(start);
- VNInfo *ValNo = (OldLR != interval.end())
- ? OldLR->valno : interval.getNextValue(start, CopyMI, VNInfoAllocator);
- LiveRange LR(start, end, ValNo);
- interval.addRange(LR);
- interval.addKill(LR.valno, end);
- DOUT << " +" << LR << '\n';
-}
-
-void LiveIntervals::handleRegisterDef(MachineBasicBlock *MBB,
- MachineBasicBlock::iterator MI,
- unsigned MIIdx,
- unsigned reg) {
- if (TargetRegisterInfo::isVirtualRegister(reg))
- handleVirtualRegisterDef(MBB, MI, MIIdx, getOrCreateInterval(reg));
- else if (allocatableRegs_[reg]) {
- MachineInstr *CopyMI = NULL;
- unsigned SrcReg, DstReg;
- if (MI->getOpcode() == TargetInstrInfo::EXTRACT_SUBREG ||
- MI->getOpcode() == TargetInstrInfo::INSERT_SUBREG ||
- tii_->isMoveInstr(*MI, SrcReg, DstReg))
- CopyMI = MI;
- handlePhysicalRegisterDef(MBB, MI, MIIdx, getOrCreateInterval(reg), CopyMI);
- // Def of a register also defines its sub-registers.
- for (const unsigned* AS = tri_->getSubRegisters(reg); *AS; ++AS)
- // If MI also modifies the sub-register explicitly, avoid processing it
- // more than once. Do not pass in TRI here so it checks for exact match.
- if (!MI->modifiesRegister(*AS))
- handlePhysicalRegisterDef(MBB, MI, MIIdx, getOrCreateInterval(*AS), 0);
- }
-}
-
-void LiveIntervals::handleLiveInRegister(MachineBasicBlock *MBB,
- unsigned MIIdx,
- LiveInterval &interval, bool isAlias) {
- DOUT << "\t\tlivein register: "; DEBUG(printRegName(interval.reg));
-
- // Look for kills, if it reaches a def before it's killed, then it shouldn't
- // be considered a livein.
- MachineBasicBlock::iterator mi = MBB->begin();
- unsigned baseIndex = MIIdx;
- unsigned start = baseIndex;
- unsigned end = start;
- while (mi != MBB->end()) {
- if (mi->killsRegister(interval.reg, tri_)) {
- DOUT << " killed";
- end = getUseIndex(baseIndex) + 1;
- goto exit;
- } else if (mi->modifiesRegister(interval.reg, tri_)) {
- // Another instruction redefines the register before it is ever read.
- // Then the register is essentially dead at the instruction that defines
- // it. Hence its interval is:
- // [defSlot(def), defSlot(def)+1)
- DOUT << " dead";
- end = getDefIndex(start) + 1;
- goto exit;
- }
-
- baseIndex += InstrSlots::NUM;
- ++mi;
- }
-
-exit:
- // Live-in register might not be used at all.
- if (end == MIIdx) {
- if (isAlias) {
- DOUT << " dead";
- end = getDefIndex(MIIdx) + 1;
- } else {
- DOUT << " live through";
- end = baseIndex;
- }
- }
-
- LiveRange LR(start, end, interval.getNextValue(start, 0, VNInfoAllocator));
- interval.addRange(LR);
- interval.addKill(LR.valno, end);
- DOUT << " +" << LR << '\n';
-}
-
-/// computeIntervals - computes the live intervals for virtual
-/// registers. for some ordering of the machine instructions [1,N] a
-/// live interval is an interval [i, j) where 1 <= i <= j < N for
-/// which a variable is live
-void LiveIntervals::computeIntervals() {
- DOUT << "********** COMPUTING LIVE INTERVALS **********\n"
- << "********** Function: "
- << ((Value*)mf_->getFunction())->getName() << '\n';
- // Track the index of the current machine instr.
- unsigned MIIndex = 0;
- for (MachineFunction::iterator MBBI = mf_->begin(), E = mf_->end();
- MBBI != E; ++MBBI) {
- MachineBasicBlock *MBB = MBBI;
- DOUT << ((Value*)MBB->getBasicBlock())->getName() << ":\n";
-
- MachineBasicBlock::iterator MI = MBB->begin(), miEnd = MBB->end();
-
- // Create intervals for live-ins to this BB first.
- for (MachineBasicBlock::const_livein_iterator LI = MBB->livein_begin(),
- LE = MBB->livein_end(); LI != LE; ++LI) {
- handleLiveInRegister(MBB, MIIndex, getOrCreateInterval(*LI));
- // Multiple live-ins can alias the same register.
- for (const unsigned* AS = tri_->getSubRegisters(*LI); *AS; ++AS)
- if (!hasInterval(*AS))
- handleLiveInRegister(MBB, MIIndex, getOrCreateInterval(*AS),
- true);
- }
-
- for (; MI != miEnd; ++MI) {
- DOUT << MIIndex << "\t" << *MI;
-
- // Handle defs.
- for (int i = MI->getNumOperands() - 1; i >= 0; --i) {
- MachineOperand &MO = MI->getOperand(i);
- // handle register defs - build intervals
- if (MO.isRegister() && MO.getReg() && MO.isDef())
- handleRegisterDef(MBB, MI, MIIndex, MO.getReg());
- }
-
- MIIndex += InstrSlots::NUM;
- }
- }
-}
-
-bool LiveIntervals::findLiveInMBBs(const LiveRange &LR,
- SmallVectorImpl<MachineBasicBlock*> &MBBs) const {
- std::vector<IdxMBBPair>::const_iterator I =
- std::lower_bound(Idx2MBBMap.begin(), Idx2MBBMap.end(), LR.start);
-
- bool ResVal = false;
- while (I != Idx2MBBMap.end()) {
- if (LR.end <= I->first)
- break;
- MBBs.push_back(I->second);
- ResVal = true;
- ++I;
- }
- return ResVal;
-}
-
-
-LiveInterval LiveIntervals::createInterval(unsigned reg) {
- float Weight = TargetRegisterInfo::isPhysicalRegister(reg) ?
- HUGE_VALF : 0.0F;
- return LiveInterval(reg, Weight);
-}
-
-/// getVNInfoSourceReg - Helper function that parses the specified VNInfo
-/// copy field and returns the source register that defines it.
-unsigned LiveIntervals::getVNInfoSourceReg(const VNInfo *VNI) const {
- if (!VNI->copy)
- return 0;
-
- if (VNI->copy->getOpcode() == TargetInstrInfo::EXTRACT_SUBREG)
- return VNI->copy->getOperand(1).getReg();
- if (VNI->copy->getOpcode() == TargetInstrInfo::INSERT_SUBREG)
- return VNI->copy->getOperand(2).getReg();
- unsigned SrcReg, DstReg;
- if (tii_->isMoveInstr(*VNI->copy, SrcReg, DstReg))
- return SrcReg;
- assert(0 && "Unrecognized copy instruction!");
- return 0;
-}
-
-//===----------------------------------------------------------------------===//
-// Register allocator hooks.
-//
-
-/// getReMatImplicitUse - If the remat definition MI has one (for now, we only
-/// allow one) virtual register operand, then its uses are implicitly using
-/// the register. Returns the virtual register.
-unsigned LiveIntervals::getReMatImplicitUse(const LiveInterval &li,
- MachineInstr *MI) const {
- unsigned RegOp = 0;
- for (unsigned i = 0, e = MI->getNumOperands(); i != e; ++i) {
- MachineOperand &MO = MI->getOperand(i);
- if (!MO.isRegister() || !MO.isUse())
- continue;
- unsigned Reg = MO.getReg();
- if (Reg == 0 || Reg == li.reg)
- continue;
- // FIXME: For now, only remat MI with at most one register operand.
- assert(!RegOp &&
- "Can't rematerialize instruction with multiple register operand!");
- RegOp = MO.getReg();
- break;
- }
- return RegOp;
-}
-
-/// isValNoAvailableAt - Return true if the val# of the specified interval
-/// which reaches the given instruction also reaches the specified use index.
-bool LiveIntervals::isValNoAvailableAt(const LiveInterval &li, MachineInstr *MI,
- unsigned UseIdx) const {
- unsigned Index = getInstructionIndex(MI);
- VNInfo *ValNo = li.FindLiveRangeContaining(Index)->valno;
- LiveInterval::const_iterator UI = li.FindLiveRangeContaining(UseIdx);
- return UI != li.end() && UI->valno == ValNo;
-}
-
-/// isReMaterializable - Returns true if the definition MI of the specified
-/// val# of the specified interval is re-materializable.
-bool LiveIntervals::isReMaterializable(const LiveInterval &li,
- const VNInfo *ValNo, MachineInstr *MI,
- bool &isLoad) {
- if (DisableReMat)
- return false;
-
- isLoad = false;
- if (MI->getOpcode() == TargetInstrInfo::IMPLICIT_DEF)
- return true;
-
- int FrameIdx = 0;
- if (tii_->isLoadFromStackSlot(MI, FrameIdx) &&
- mf_->getFrameInfo()->isImmutableObjectIndex(FrameIdx))
- // FIXME: Let target specific isReallyTriviallyReMaterializable determines
- // this but remember this is not safe to fold into a two-address
- // instruction.
- // This is a load from fixed stack slot. It can be rematerialized.
- return true;
-
- if (tii_->isTriviallyReMaterializable(MI)) {
- const TargetInstrDesc &TID = MI->getDesc();
- isLoad = TID.isSimpleLoad();
-
- unsigned ImpUse = getReMatImplicitUse(li, MI);
- if (ImpUse) {
- const LiveInterval &ImpLi = getInterval(ImpUse);
- for (MachineRegisterInfo::use_iterator ri = mri_->use_begin(li.reg),
- re = mri_->use_end(); ri != re; ++ri) {
- MachineInstr *UseMI = &*ri;
- unsigned UseIdx = getInstructionIndex(UseMI);
- if (li.FindLiveRangeContaining(UseIdx)->valno != ValNo)
- continue;
- if (!isValNoAvailableAt(ImpLi, MI, UseIdx))
- return false;
- }
- }
- return true;
- }
-
- return false;
-}
-
-/// isReMaterializable - Returns true if every definition of MI of every
-/// val# of the specified interval is re-materializable.
-bool LiveIntervals::isReMaterializable(const LiveInterval &li, bool &isLoad) {
- isLoad = false;
- for (LiveInterval::const_vni_iterator i = li.vni_begin(), e = li.vni_end();
- i != e; ++i) {
- const VNInfo *VNI = *i;
- unsigned DefIdx = VNI->def;
- if (DefIdx == ~1U)
- continue; // Dead val#.
- // Is the def for the val# rematerializable?
- if (DefIdx == ~0u)
- return false;
- MachineInstr *ReMatDefMI = getInstructionFromIndex(DefIdx);
- bool DefIsLoad = false;
- if (!ReMatDefMI ||
- !isReMaterializable(li, VNI, ReMatDefMI, DefIsLoad))
- return false;
- isLoad |= DefIsLoad;
- }
- return true;
-}
-
-/// FilterFoldedOps - Filter out two-address use operands. Return
-/// true if it finds any issue with the operands that ought to prevent
-/// folding.
-static bool FilterFoldedOps(MachineInstr *MI,
- SmallVector<unsigned, 2> &Ops,
- unsigned &MRInfo,
- SmallVector<unsigned, 2> &FoldOps) {
- const TargetInstrDesc &TID = MI->getDesc();
-
- MRInfo = 0;
- for (unsigned i = 0, e = Ops.size(); i != e; ++i) {
- unsigned OpIdx = Ops[i];
- MachineOperand &MO = MI->getOperand(OpIdx);
- // FIXME: fold subreg use.
- if (MO.getSubReg())
- return true;
- if (MO.isDef())
- MRInfo |= (unsigned)VirtRegMap::isMod;
- else {
- // Filter out two-address use operand(s).
- if (!MO.isImplicit() &&
- TID.getOperandConstraint(OpIdx, TOI::TIED_TO) != -1) {
- MRInfo = VirtRegMap::isModRef;
- continue;
- }
- MRInfo |= (unsigned)VirtRegMap::isRef;
- }
- FoldOps.push_back(OpIdx);
- }
- return false;
-}
-
-
-/// tryFoldMemoryOperand - Attempts to fold either a spill / restore from
-/// slot / to reg or any rematerialized load into ith operand of specified
-/// MI. If it is successul, MI is updated with the newly created MI and
-/// returns true.
-bool LiveIntervals::tryFoldMemoryOperand(MachineInstr* &MI,
- VirtRegMap &vrm, MachineInstr *DefMI,
- unsigned InstrIdx,
- SmallVector<unsigned, 2> &Ops,
- bool isSS, int Slot, unsigned Reg) {
- // If it is an implicit def instruction, just delete it.
- if (MI->getOpcode() == TargetInstrInfo::IMPLICIT_DEF) {
- RemoveMachineInstrFromMaps(MI);
- vrm.RemoveMachineInstrFromMaps(MI);
- MI->eraseFromParent();
- ++numFolds;
- return true;
- }
-
- // Filter the list of operand indexes that are to be folded. Abort if
- // any operand will prevent folding.
- unsigned MRInfo = 0;
- SmallVector<unsigned, 2> FoldOps;
- if (FilterFoldedOps(MI, Ops, MRInfo, FoldOps))
- return false;
-
- // The only time it's safe to fold into a two address instruction is when
- // it's folding reload and spill from / into a spill stack slot.
- if (DefMI && (MRInfo & VirtRegMap::isMod))
- return false;
-
- MachineInstr *fmi = isSS ? tii_->foldMemoryOperand(*mf_, MI, FoldOps, Slot)
- : tii_->foldMemoryOperand(*mf_, MI, FoldOps, DefMI);
- if (fmi) {
- // Remember this instruction uses the spill slot.
- if (isSS) vrm.addSpillSlotUse(Slot, fmi);
-
- // Attempt to fold the memory reference into the instruction. If
- // we can do this, we don't need to insert spill code.
- if (lv_)
- lv_->instructionChanged(MI, fmi);
- else
- fmi->copyKillDeadInfo(MI, tri_);
- MachineBasicBlock &MBB = *MI->getParent();
- if (isSS && !mf_->getFrameInfo()->isImmutableObjectIndex(Slot))
- vrm.virtFolded(Reg, MI, fmi, (VirtRegMap::ModRef)MRInfo);
- vrm.transferSpillPts(MI, fmi);
- vrm.transferRestorePts(MI, fmi);
- vrm.transferEmergencySpills(MI, fmi);
- mi2iMap_.erase(MI);
- i2miMap_[InstrIdx /InstrSlots::NUM] = fmi;
- mi2iMap_[fmi] = InstrIdx;
- MI = MBB.insert(MBB.erase(MI), fmi);
- ++numFolds;
- return true;
- }
- return false;
-}
-
-/// canFoldMemoryOperand - Returns true if the specified load / store
-/// folding is possible.
-bool LiveIntervals::canFoldMemoryOperand(MachineInstr *MI,
- SmallVector<unsigned, 2> &Ops,
- bool ReMat) const {
- // Filter the list of operand indexes that are to be folded. Abort if
- // any operand will prevent folding.
- unsigned MRInfo = 0;
- SmallVector<unsigned, 2> FoldOps;
- if (FilterFoldedOps(MI, Ops, MRInfo, FoldOps))
- return false;
-
- // It's only legal to remat for a use, not a def.
- if (ReMat && (MRInfo & VirtRegMap::isMod))
- return false;
-
- return tii_->canFoldMemoryOperand(MI, FoldOps);
-}
-
-bool LiveIntervals::intervalIsInOneMBB(const LiveInterval &li) const {
- SmallPtrSet<MachineBasicBlock*, 4> MBBs;
- for (LiveInterval::Ranges::const_iterator
- I = li.ranges.begin(), E = li.ranges.end(); I != E; ++I) {
- std::vector<IdxMBBPair>::const_iterator II =
- std::lower_bound(Idx2MBBMap.begin(), Idx2MBBMap.end(), I->start);
- if (II == Idx2MBBMap.end())
- continue;
- if (I->end > II->first) // crossing a MBB.
- return false;
- MBBs.insert(II->second);
- if (MBBs.size() > 1)
- return false;
- }
- return true;
-}
-
-/// rewriteImplicitOps - Rewrite implicit use operands of MI (i.e. uses of
-/// interval on to-be re-materialized operands of MI) with new register.
-void LiveIntervals::rewriteImplicitOps(const LiveInterval &li,
- MachineInstr *MI, unsigned NewVReg,
- VirtRegMap &vrm) {
- // There is an implicit use. That means one of the other operand is
- // being remat'ed and the remat'ed instruction has li.reg as an
- // use operand. Make sure we rewrite that as well.
- for (unsigned i = 0, e = MI->getNumOperands(); i != e; ++i) {
- MachineOperand &MO = MI->getOperand(i);
- if (!MO.isRegister())
- continue;
- unsigned Reg = MO.getReg();
- if (Reg == 0 || TargetRegisterInfo::isPhysicalRegister(Reg))
- continue;
- if (!vrm.isReMaterialized(Reg))
- continue;
- MachineInstr *ReMatMI = vrm.getReMaterializedMI(Reg);
- MachineOperand *UseMO = ReMatMI->findRegisterUseOperand(li.reg);
- if (UseMO)
- UseMO->setReg(NewVReg);
- }
-}
-
-/// rewriteInstructionForSpills, rewriteInstructionsForSpills - Helper functions
-/// for addIntervalsForSpills to rewrite uses / defs for the given live range.
-bool LiveIntervals::
-rewriteInstructionForSpills(const LiveInterval &li, const VNInfo *VNI,
- bool TrySplit, unsigned index, unsigned end, MachineInstr *MI,
- MachineInstr *ReMatOrigDefMI, MachineInstr *ReMatDefMI,
- unsigned Slot, int LdSlot,
- bool isLoad, bool isLoadSS, bool DefIsReMat, bool CanDelete,
- VirtRegMap &vrm,
- const TargetRegisterClass* rc,
- SmallVector<int, 4> &ReMatIds,
- const MachineLoopInfo *loopInfo,
- unsigned &NewVReg, unsigned ImpUse, bool &HasDef, bool &HasUse,
- std::map<unsigned,unsigned> &MBBVRegsMap,
- std::vector<LiveInterval*> &NewLIs) {
- bool CanFold = false;
- RestartInstruction:
- for (unsigned i = 0; i != MI->getNumOperands(); ++i) {
- MachineOperand& mop = MI->getOperand(i);
- if (!mop.isRegister())
- continue;
- unsigned Reg = mop.getReg();
- unsigned RegI = Reg;
- if (Reg == 0 || TargetRegisterInfo::isPhysicalRegister(Reg))
- continue;
- if (Reg != li.reg)
- continue;
-
- bool TryFold = !DefIsReMat;
- bool FoldSS = true; // Default behavior unless it's a remat.
- int FoldSlot = Slot;
- if (DefIsReMat) {
- // If this is the rematerializable definition MI itself and
- // all of its uses are rematerialized, simply delete it.
- if (MI == ReMatOrigDefMI && CanDelete) {
- DOUT << "\t\t\t\tErasing re-materlizable def: ";
- DOUT << MI << '\n';
- RemoveMachineInstrFromMaps(MI);
- vrm.RemoveMachineInstrFromMaps(MI);
- MI->eraseFromParent();
- break;
- }
-
- // If def for this use can't be rematerialized, then try folding.
- // If def is rematerializable and it's a load, also try folding.
- TryFold = !ReMatDefMI || (ReMatDefMI && (MI == ReMatOrigDefMI || isLoad));
- if (isLoad) {
- // Try fold loads (from stack slot, constant pool, etc.) into uses.
- FoldSS = isLoadSS;
- FoldSlot = LdSlot;
- }
- }
-
- // Scan all of the operands of this instruction rewriting operands
- // to use NewVReg instead of li.reg as appropriate. We do this for
- // two reasons:
- //
- // 1. If the instr reads the same spilled vreg multiple times, we
- // want to reuse the NewVReg.
- // 2. If the instr is a two-addr instruction, we are required to
- // keep the src/dst regs pinned.
- //
- // Keep track of whether we replace a use and/or def so that we can
- // create the spill interval with the appropriate range.
-
- HasUse = mop.isUse();
- HasDef = mop.isDef();
- SmallVector<unsigned, 2> Ops;
- Ops.push_back(i);
- for (unsigned j = i+1, e = MI->getNumOperands(); j != e; ++j) {
- const MachineOperand &MOj = MI->getOperand(j);
- if (!MOj.isRegister())
- continue;
- unsigned RegJ = MOj.getReg();
- if (RegJ == 0 || TargetRegisterInfo::isPhysicalRegister(RegJ))
- continue;
- if (RegJ == RegI) {
- Ops.push_back(j);
- HasUse |= MOj.isUse();
- HasDef |= MOj.isDef();
- }
- }
-
- if (TryFold) {
- // Do not fold load / store here if we are splitting. We'll find an
- // optimal point to insert a load / store later.
- if (!TrySplit) {
- if (tryFoldMemoryOperand(MI, vrm, ReMatDefMI, index,
- Ops, FoldSS, FoldSlot, Reg)) {
- // Folding the load/store can completely change the instruction in
- // unpredictable ways, rescan it from the beginning.
- HasUse = false;
- HasDef = false;
- CanFold = false;
- if (isRemoved(MI))
- break;
- goto RestartInstruction;
- }
- } else {
- CanFold = canFoldMemoryOperand(MI, Ops, DefIsReMat);
- }
- } else
- CanFold = false;
-
- // Create a new virtual register for the spill interval.
- bool CreatedNewVReg = false;
- if (NewVReg == 0) {
- NewVReg = mri_->createVirtualRegister(rc);
- vrm.grow();
- CreatedNewVReg = true;
- }
- mop.setReg(NewVReg);
- if (mop.isImplicit())
- rewriteImplicitOps(li, MI, NewVReg, vrm);
-
- // Reuse NewVReg for other reads.
- for (unsigned j = 0, e = Ops.size(); j != e; ++j) {
- MachineOperand &mopj = MI->getOperand(Ops[j]);
- mopj.setReg(NewVReg);
- if (mopj.isImplicit())
- rewriteImplicitOps(li, MI, NewVReg, vrm);
- }
-
- if (CreatedNewVReg) {
- if (DefIsReMat) {
- vrm.setVirtIsReMaterialized(NewVReg, ReMatDefMI/*, CanDelete*/);
- if (ReMatIds[VNI->id] == VirtRegMap::MAX_STACK_SLOT) {
- // Each valnum may have its own remat id.
- ReMatIds[VNI->id] = vrm.assignVirtReMatId(NewVReg);
- } else {
- vrm.assignVirtReMatId(NewVReg, ReMatIds[VNI->id]);
- }
- if (!CanDelete || (HasUse && HasDef)) {
- // If this is a two-addr instruction then its use operands are
- // rematerializable but its def is not. It should be assigned a
- // stack slot.
- vrm.assignVirt2StackSlot(NewVReg, Slot);
- }
- } else {
- vrm.assignVirt2StackSlot(NewVReg, Slot);
- }
- } else if (HasUse && HasDef &&
- vrm.getStackSlot(NewVReg) == VirtRegMap::NO_STACK_SLOT) {
- // If this interval hasn't been assigned a stack slot (because earlier
- // def is a deleted remat def), do it now.
- assert(Slot != VirtRegMap::NO_STACK_SLOT);
- vrm.assignVirt2StackSlot(NewVReg, Slot);
- }
-
- // Re-matting an instruction with virtual register use. Add the
- // register as an implicit use on the use MI.
- if (DefIsReMat && ImpUse)
- MI->addOperand(MachineOperand::CreateReg(ImpUse, false, true));
-
- // create a new register interval for this spill / remat.
- LiveInterval &nI = getOrCreateInterval(NewVReg);
- if (CreatedNewVReg) {
- NewLIs.push_back(&nI);
- MBBVRegsMap.insert(std::make_pair(MI->getParent()->getNumber(), NewVReg));
- if (TrySplit)
- vrm.setIsSplitFromReg(NewVReg, li.reg);
- }
-
- if (HasUse) {
- if (CreatedNewVReg) {
- LiveRange LR(getLoadIndex(index), getUseIndex(index)+1,
- nI.getNextValue(~0U, 0, VNInfoAllocator));
- DOUT << " +" << LR;
- nI.addRange(LR);
- } else {
- // Extend the split live interval to this def / use.
- unsigned End = getUseIndex(index)+1;
- LiveRange LR(nI.ranges[nI.ranges.size()-1].end, End,
- nI.getValNumInfo(nI.getNumValNums()-1));
- DOUT << " +" << LR;
- nI.addRange(LR);
- }
- }
- if (HasDef) {
- LiveRange LR(getDefIndex(index), getStoreIndex(index),
- nI.getNextValue(~0U, 0, VNInfoAllocator));
- DOUT << " +" << LR;
- nI.addRange(LR);
- }
-
- DOUT << "\t\t\t\tAdded new interval: ";
- nI.print(DOUT, tri_);
- DOUT << '\n';
- }
- return CanFold;
-}
-bool LiveIntervals::anyKillInMBBAfterIdx(const LiveInterval &li,
- const VNInfo *VNI,
- MachineBasicBlock *MBB, unsigned Idx) const {
- unsigned End = getMBBEndIdx(MBB);
- for (unsigned j = 0, ee = VNI->kills.size(); j != ee; ++j) {
- unsigned KillIdx = VNI->kills[j];
- if (KillIdx > Idx && KillIdx < End)
- return true;
- }
- return false;
-}
-
-static const VNInfo *findDefinedVNInfo(const LiveInterval &li, unsigned DefIdx) {
- const VNInfo *VNI = NULL;
- for (LiveInterval::const_vni_iterator i = li.vni_begin(),
- e = li.vni_end(); i != e; ++i)
- if ((*i)->def == DefIdx) {
- VNI = *i;
- break;
- }
- return VNI;
-}
-
-/// RewriteInfo - Keep track of machine instrs that will be rewritten
-/// during spilling.
-struct RewriteInfo {
- unsigned Index;
- MachineInstr *MI;
- bool HasUse;
- bool HasDef;
- RewriteInfo(unsigned i, MachineInstr *mi, bool u, bool d)
- : Index(i), MI(mi), HasUse(u), HasDef(d) {}
-};
-
-struct RewriteInfoCompare {
- bool operator()(const RewriteInfo &LHS, const RewriteInfo &RHS) const {
- return LHS.Index < RHS.Index;
- }
-};
-
-void LiveIntervals::
-rewriteInstructionsForSpills(const LiveInterval &li, bool TrySplit,
- LiveInterval::Ranges::const_iterator &I,
- MachineInstr *ReMatOrigDefMI, MachineInstr *ReMatDefMI,
- unsigned Slot, int LdSlot,
- bool isLoad, bool isLoadSS, bool DefIsReMat, bool CanDelete,
- VirtRegMap &vrm,
- const TargetRegisterClass* rc,
- SmallVector<int, 4> &ReMatIds,
- const MachineLoopInfo *loopInfo,
- BitVector &SpillMBBs,
- std::map<unsigned, std::vector<SRInfo> > &SpillIdxes,
- BitVector &RestoreMBBs,
- std::map<unsigned, std::vector<SRInfo> > &RestoreIdxes,
- std::map<unsigned,unsigned> &MBBVRegsMap,
- std::vector<LiveInterval*> &NewLIs) {
- bool AllCanFold = true;
- unsigned NewVReg = 0;
- unsigned start = getBaseIndex(I->start);
- unsigned end = getBaseIndex(I->end-1) + InstrSlots::NUM;
-
- // First collect all the def / use in this live range that will be rewritten.
- // Make sure they are sorted according to instruction index.
- std::vector<RewriteInfo> RewriteMIs;
- for (MachineRegisterInfo::reg_iterator ri = mri_->reg_begin(li.reg),
- re = mri_->reg_end(); ri != re; ) {
- MachineInstr *MI = &*ri;
- MachineOperand &O = ri.getOperand();
- ++ri;
- assert(!O.isImplicit() && "Spilling register that's used as implicit use?");
- unsigned index = getInstructionIndex(MI);
- if (index < start || index >= end)
- continue;
- RewriteMIs.push_back(RewriteInfo(index, MI, O.isUse(), O.isDef()));
- }
- std::sort(RewriteMIs.begin(), RewriteMIs.end(), RewriteInfoCompare());
-
- unsigned ImpUse = DefIsReMat ? getReMatImplicitUse(li, ReMatDefMI) : 0;
- // Now rewrite the defs and uses.
- for (unsigned i = 0, e = RewriteMIs.size(); i != e; ) {
- RewriteInfo &rwi = RewriteMIs[i];
- ++i;
- unsigned index = rwi.Index;
- bool MIHasUse = rwi.HasUse;
- bool MIHasDef = rwi.HasDef;
- MachineInstr *MI = rwi.MI;
- // If MI def and/or use the same register multiple times, then there
- // are multiple entries.
- unsigned NumUses = MIHasUse;
- while (i != e && RewriteMIs[i].MI == MI) {
- assert(RewriteMIs[i].Index == index);
- bool isUse = RewriteMIs[i].HasUse;
- if (isUse) ++NumUses;
- MIHasUse |= isUse;
- MIHasDef |= RewriteMIs[i].HasDef;
- ++i;
- }
- MachineBasicBlock *MBB = MI->getParent();
-
- if (ImpUse && MI != ReMatDefMI) {
- // Re-matting an instruction with virtual register use. Update the
- // register interval's spill weight to HUGE_VALF to prevent it from
- // being spilled.
- LiveInterval &ImpLi = getInterval(ImpUse);
- ImpLi.weight = HUGE_VALF;
- }
-
- unsigned MBBId = MBB->getNumber();
- unsigned ThisVReg = 0;
- if (TrySplit) {
- std::map<unsigned,unsigned>::const_iterator NVI = MBBVRegsMap.find(MBBId);
- if (NVI != MBBVRegsMap.end()) {
- ThisVReg = NVI->second;
- // One common case:
- // x = use
- // ...
- // ...
- // def = ...
- // = use
- // It's better to start a new interval to avoid artifically
- // extend the new interval.
- if (MIHasDef && !MIHasUse) {
- MBBVRegsMap.erase(MBB->getNumber());
- ThisVReg = 0;
- }
- }
- }
-
- bool IsNew = ThisVReg == 0;
- if (IsNew) {
- // This ends the previous live interval. If all of its def / use
- // can be folded, give it a low spill weight.
- if (NewVReg && TrySplit && AllCanFold) {
- LiveInterval &nI = getOrCreateInterval(NewVReg);
- nI.weight /= 10.0F;
- }
- AllCanFold = true;
- }
- NewVReg = ThisVReg;
-
- bool HasDef = false;
- bool HasUse = false;
- bool CanFold = rewriteInstructionForSpills(li, I->valno, TrySplit,
- index, end, MI, ReMatOrigDefMI, ReMatDefMI,
- Slot, LdSlot, isLoad, isLoadSS, DefIsReMat,
- CanDelete, vrm, rc, ReMatIds, loopInfo, NewVReg,
- ImpUse, HasDef, HasUse, MBBVRegsMap, NewLIs);
- if (!HasDef && !HasUse)
- continue;
-
- AllCanFold &= CanFold;
-
- // Update weight of spill interval.
- LiveInterval &nI = getOrCreateInterval(NewVReg);
- if (!TrySplit) {
- // The spill weight is now infinity as it cannot be spilled again.
- nI.weight = HUGE_VALF;
- continue;
- }
-
- // Keep track of the last def and first use in each MBB.
- if (HasDef) {
- if (MI != ReMatOrigDefMI || !CanDelete) {
- bool HasKill = false;
- if (!HasUse)
- HasKill = anyKillInMBBAfterIdx(li, I->valno, MBB, getDefIndex(index));
- else {
- // If this is a two-address code, then this index starts a new VNInfo.
- const VNInfo *VNI = findDefinedVNInfo(li, getDefIndex(index));
- if (VNI)
- HasKill = anyKillInMBBAfterIdx(li, VNI, MBB, getDefIndex(index));
- }
- std::map<unsigned, std::vector<SRInfo> >::iterator SII =
- SpillIdxes.find(MBBId);
- if (!HasKill) {
- if (SII == SpillIdxes.end()) {
- std::vector<SRInfo> S;
- S.push_back(SRInfo(index, NewVReg, true));
- SpillIdxes.insert(std::make_pair(MBBId, S));
- } else if (SII->second.back().vreg != NewVReg) {
- SII->second.push_back(SRInfo(index, NewVReg, true));
- } else if ((int)index > SII->second.back().index) {
- // If there is an earlier def and this is a two-address
- // instruction, then it's not possible to fold the store (which
- // would also fold the load).
- SRInfo &Info = SII->second.back();
- Info.index = index;
- Info.canFold = !HasUse;
- }
- SpillMBBs.set(MBBId);
- } else if (SII != SpillIdxes.end() &&
- SII->second.back().vreg == NewVReg &&
- (int)index > SII->second.back().index) {
- // There is an earlier def that's not killed (must be two-address).
- // The spill is no longer needed.
- SII->second.pop_back();
- if (SII->second.empty()) {
- SpillIdxes.erase(MBBId);
- SpillMBBs.reset(MBBId);
- }
- }
- }
- }
-
- if (HasUse) {
- std::map<unsigned, std::vector<SRInfo> >::iterator SII =
- SpillIdxes.find(MBBId);
- if (SII != SpillIdxes.end() &&
- SII->second.back().vreg == NewVReg &&
- (int)index > SII->second.back().index)
- // Use(s) following the last def, it's not safe to fold the spill.
- SII->second.back().canFold = false;
- std::map<unsigned, std::vector<SRInfo> >::iterator RII =
- RestoreIdxes.find(MBBId);
- if (RII != RestoreIdxes.end() && RII->second.back().vreg == NewVReg)
- // If we are splitting live intervals, only fold if it's the first
- // use and there isn't another use later in the MBB.
- RII->second.back().canFold = false;
- else if (IsNew) {
- // Only need a reload if there isn't an earlier def / use.
- if (RII == RestoreIdxes.end()) {
- std::vector<SRInfo> Infos;
- Infos.push_back(SRInfo(index, NewVReg, true));
- RestoreIdxes.insert(std::make_pair(MBBId, Infos));
- } else {
- RII->second.push_back(SRInfo(index, NewVReg, true));
- }
- RestoreMBBs.set(MBBId);
- }
- }
-
- // Update spill weight.
- unsigned loopDepth = loopInfo->getLoopDepth(MBB);
- nI.weight += getSpillWeight(HasDef, HasUse, loopDepth);
- }
-
- if (NewVReg && TrySplit && AllCanFold) {
- // If all of its def / use can be folded, give it a low spill weight.
- LiveInterval &nI = getOrCreateInterval(NewVReg);
- nI.weight /= 10.0F;
- }
-}
-
-bool LiveIntervals::alsoFoldARestore(int Id, int index, unsigned vr,
- BitVector &RestoreMBBs,
- std::map<unsigned,std::vector<SRInfo> > &RestoreIdxes) {
- if (!RestoreMBBs[Id])
- return false;
- std::vector<SRInfo> &Restores = RestoreIdxes[Id];
- for (unsigned i = 0, e = Restores.size(); i != e; ++i)
- if (Restores[i].index == index &&
- Restores[i].vreg == vr &&
- Restores[i].canFold)
- return true;
- return false;
-}
-
-void LiveIntervals::eraseRestoreInfo(int Id, int index, unsigned vr,
- BitVector &RestoreMBBs,
- std::map<unsigned,std::vector<SRInfo> > &RestoreIdxes) {
- if (!RestoreMBBs[Id])
- return;
- std::vector<SRInfo> &Restores = RestoreIdxes[Id];
- for (unsigned i = 0, e = Restores.size(); i != e; ++i)
- if (Restores[i].index == index && Restores[i].vreg)
- Restores[i].index = -1;
-}
-
-/// handleSpilledImpDefs - Remove IMPLICIT_DEF instructions which are being
-/// spilled and create empty intervals for their uses.
-void
-LiveIntervals::handleSpilledImpDefs(const LiveInterval &li, VirtRegMap &vrm,
- const TargetRegisterClass* rc,
- std::vector<LiveInterval*> &NewLIs) {
- for (MachineRegisterInfo::reg_iterator ri = mri_->reg_begin(li.reg),
- re = mri_->reg_end(); ri != re; ) {
- MachineOperand &O = ri.getOperand();
- MachineInstr *MI = &*ri;
- ++ri;
- if (O.isDef()) {
- assert(MI->getOpcode() == TargetInstrInfo::IMPLICIT_DEF &&
- "Register def was not rewritten?");
- RemoveMachineInstrFromMaps(MI);
- vrm.RemoveMachineInstrFromMaps(MI);
- MI->eraseFromParent();
- } else {
- // This must be an use of an implicit_def so it's not part of the live
- // interval. Create a new empty live interval for it.
- // FIXME: Can we simply erase some of the instructions? e.g. Stores?
- unsigned NewVReg = mri_->createVirtualRegister(rc);
- vrm.grow();
- vrm.setIsImplicitlyDefined(NewVReg);
- NewLIs.push_back(&getOrCreateInterval(NewVReg));
- for (unsigned i = 0, e = MI->getNumOperands(); i != e; ++i) {
- MachineOperand &MO = MI->getOperand(i);
- if (MO.isReg() && MO.getReg() == li.reg)
- MO.setReg(NewVReg);
- }
- }
- }
-}
-
-
-std::vector<LiveInterval*> LiveIntervals::
-addIntervalsForSpills(const LiveInterval &li,
- const MachineLoopInfo *loopInfo, VirtRegMap &vrm) {
- // Since this is called after the analysis is done we don't know if
- // LiveVariables is available
- lv_ = getAnalysisToUpdate<LiveVariables>();
-
- assert(li.weight != HUGE_VALF &&
- "attempt to spill already spilled interval!");
-
- DOUT << "\t\t\t\tadding intervals for spills for interval: ";
- li.print(DOUT, tri_);
- DOUT << '\n';
-
- // Each bit specify whether it a spill is required in the MBB.
- BitVector SpillMBBs(mf_->getNumBlockIDs());
- std::map<unsigned, std::vector<SRInfo> > SpillIdxes;
- BitVector RestoreMBBs(mf_->getNumBlockIDs());
- std::map<unsigned, std::vector<SRInfo> > RestoreIdxes;
- std::map<unsigned,unsigned> MBBVRegsMap;
- std::vector<LiveInterval*> NewLIs;
- const TargetRegisterClass* rc = mri_->getRegClass(li.reg);
-
- unsigned NumValNums = li.getNumValNums();
- SmallVector<MachineInstr*, 4> ReMatDefs;
- ReMatDefs.resize(NumValNums, NULL);
- SmallVector<MachineInstr*, 4> ReMatOrigDefs;
- ReMatOrigDefs.resize(NumValNums, NULL);
- SmallVector<int, 4> ReMatIds;
- ReMatIds.resize(NumValNums, VirtRegMap::MAX_STACK_SLOT);
- BitVector ReMatDelete(NumValNums);
- unsigned Slot = VirtRegMap::MAX_STACK_SLOT;
-
- // Spilling a split live interval. It cannot be split any further. Also,
- // it's also guaranteed to be a single val# / range interval.
- if (vrm.getPreSplitReg(li.reg)) {
- vrm.setIsSplitFromReg(li.reg, 0);
- // Unset the split kill marker on the last use.
- unsigned KillIdx = vrm.getKillPoint(li.reg);
- if (KillIdx) {
- MachineInstr *KillMI = getInstructionFromIndex(KillIdx);
- assert(KillMI && "Last use disappeared?");
- int KillOp = KillMI->findRegisterUseOperandIdx(li.reg, true);
- assert(KillOp != -1 && "Last use disappeared?");
- KillMI->getOperand(KillOp).setIsKill(false);
- }
- vrm.removeKillPoint(li.reg);
- bool DefIsReMat = vrm.isReMaterialized(li.reg);
- Slot = vrm.getStackSlot(li.reg);
- assert(Slot != VirtRegMap::MAX_STACK_SLOT);
- MachineInstr *ReMatDefMI = DefIsReMat ?
- vrm.getReMaterializedMI(li.reg) : NULL;
- int LdSlot = 0;
- bool isLoadSS = DefIsReMat && tii_->isLoadFromStackSlot(ReMatDefMI, LdSlot);
- bool isLoad = isLoadSS ||
- (DefIsReMat && (ReMatDefMI->getDesc().isSimpleLoad()));
- bool IsFirstRange = true;
- for (LiveInterval::Ranges::const_iterator
- I = li.ranges.begin(), E = li.ranges.end(); I != E; ++I) {
- // If this is a split live interval with multiple ranges, it means there
- // are two-address instructions that re-defined the value. Only the
- // first def can be rematerialized!
- if (IsFirstRange) {
- // Note ReMatOrigDefMI has already been deleted.
- rewriteInstructionsForSpills(li, false, I, NULL, ReMatDefMI,
- Slot, LdSlot, isLoad, isLoadSS, DefIsReMat,
- false, vrm, rc, ReMatIds, loopInfo,
- SpillMBBs, SpillIdxes, RestoreMBBs, RestoreIdxes,
- MBBVRegsMap, NewLIs);
- } else {
- rewriteInstructionsForSpills(li, false, I, NULL, 0,
- Slot, 0, false, false, false,
- false, vrm, rc, ReMatIds, loopInfo,
- SpillMBBs, SpillIdxes, RestoreMBBs, RestoreIdxes,
- MBBVRegsMap, NewLIs);
- }
- IsFirstRange = false;
- }
-
- handleSpilledImpDefs(li, vrm, rc, NewLIs);
- return NewLIs;
- }
-
- bool TrySplit = SplitAtBB && !intervalIsInOneMBB(li);
- if (SplitLimit != -1 && (int)numSplits >= SplitLimit)
- TrySplit = false;
- if (TrySplit)
- ++numSplits;
- bool NeedStackSlot = false;
- for (LiveInterval::const_vni_iterator i = li.vni_begin(), e = li.vni_end();
- i != e; ++i) {
- const VNInfo *VNI = *i;
- unsigned VN = VNI->id;
- unsigned DefIdx = VNI->def;
- if (DefIdx == ~1U)
- continue; // Dead val#.
- // Is the def for the val# rematerializable?
- MachineInstr *ReMatDefMI = (DefIdx == ~0u)
- ? 0 : getInstructionFromIndex(DefIdx);
- bool dummy;
- if (ReMatDefMI && isReMaterializable(li, VNI, ReMatDefMI, dummy)) {
- // Remember how to remat the def of this val#.
- ReMatOrigDefs[VN] = ReMatDefMI;
- // Original def may be modified so we have to make a copy here. vrm must
- // delete these!
- ReMatDefs[VN] = ReMatDefMI = ReMatDefMI->clone();
-
- bool CanDelete = true;
- if (VNI->hasPHIKill) {
- // A kill is a phi node, not all of its uses can be rematerialized.
- // It must not be deleted.
- CanDelete = false;
- // Need a stack slot if there is any live range where uses cannot be
- // rematerialized.
- NeedStackSlot = true;
- }
- if (CanDelete)
- ReMatDelete.set(VN);
- } else {
- // Need a stack slot if there is any live range where uses cannot be
- // rematerialized.
- NeedStackSlot = true;
- }
- }
-
- // One stack slot per live interval.
- if (NeedStackSlot && vrm.getPreSplitReg(li.reg) == 0)
- Slot = vrm.assignVirt2StackSlot(li.reg);
-
- // Create new intervals and rewrite defs and uses.
- for (LiveInterval::Ranges::const_iterator
- I = li.ranges.begin(), E = li.ranges.end(); I != E; ++I) {
- MachineInstr *ReMatDefMI = ReMatDefs[I->valno->id];
- MachineInstr *ReMatOrigDefMI = ReMatOrigDefs[I->valno->id];
- bool DefIsReMat = ReMatDefMI != NULL;
- bool CanDelete = ReMatDelete[I->valno->id];
- int LdSlot = 0;
- bool isLoadSS = DefIsReMat && tii_->isLoadFromStackSlot(ReMatDefMI, LdSlot);
- bool isLoad = isLoadSS ||
- (DefIsReMat && ReMatDefMI->getDesc().isSimpleLoad());
- rewriteInstructionsForSpills(li, TrySplit, I, ReMatOrigDefMI, ReMatDefMI,
- Slot, LdSlot, isLoad, isLoadSS, DefIsReMat,
- CanDelete, vrm, rc, ReMatIds, loopInfo,
- SpillMBBs, SpillIdxes, RestoreMBBs, RestoreIdxes,
- MBBVRegsMap, NewLIs);
- }
-
- // Insert spills / restores if we are splitting.
- if (!TrySplit) {
- handleSpilledImpDefs(li, vrm, rc, NewLIs);
- return NewLIs;
- }
-
- SmallPtrSet<LiveInterval*, 4> AddedKill;
- SmallVector<unsigned, 2> Ops;
- if (NeedStackSlot) {
- int Id = SpillMBBs.find_first();
- while (Id != -1) {
- std::vector<SRInfo> &spills = SpillIdxes[Id];
- for (unsigned i = 0, e = spills.size(); i != e; ++i) {
- int index = spills[i].index;
- unsigned VReg = spills[i].vreg;
- LiveInterval &nI = getOrCreateInterval(VReg);
- bool isReMat = vrm.isReMaterialized(VReg);
- MachineInstr *MI = getInstructionFromIndex(index);
- bool CanFold = false;
- bool FoundUse = false;
- Ops.clear();
- if (spills[i].canFold) {
- CanFold = true;
- for (unsigned j = 0, ee = MI->getNumOperands(); j != ee; ++j) {
- MachineOperand &MO = MI->getOperand(j);
- if (!MO.isRegister() || MO.getReg() != VReg)
- continue;
-
- Ops.push_back(j);
- if (MO.isDef())
- continue;
- if (isReMat ||
- (!FoundUse && !alsoFoldARestore(Id, index, VReg,
- RestoreMBBs, RestoreIdxes))) {
- // MI has two-address uses of the same register. If the use
- // isn't the first and only use in the BB, then we can't fold
- // it. FIXME: Move this to rewriteInstructionsForSpills.
- CanFold = false;
- break;
- }
- FoundUse = true;
- }
- }
- // Fold the store into the def if possible.
- bool Folded = false;
- if (CanFold && !Ops.empty()) {
- if (tryFoldMemoryOperand(MI, vrm, NULL, index, Ops, true, Slot,VReg)){
- Folded = true;
- if (FoundUse > 0) {
- // Also folded uses, do not issue a load.
- eraseRestoreInfo(Id, index, VReg, RestoreMBBs, RestoreIdxes);
- nI.removeRange(getLoadIndex(index), getUseIndex(index)+1);
- }
- nI.removeRange(getDefIndex(index), getStoreIndex(index));
- }
- }
-
- // Otherwise tell the spiller to issue a spill.
- if (!Folded) {
- LiveRange *LR = &nI.ranges[nI.ranges.size()-1];
- bool isKill = LR->end == getStoreIndex(index);
- vrm.addSpillPoint(VReg, isKill, MI);
- if (isKill)
- AddedKill.insert(&nI);
- }
- }
- Id = SpillMBBs.find_next(Id);
- }
- }
-
- int Id = RestoreMBBs.find_first();
- while (Id != -1) {
- std::vector<SRInfo> &restores = RestoreIdxes[Id];
- for (unsigned i = 0, e = restores.size(); i != e; ++i) {
- int index = restores[i].index;
- if (index == -1)
- continue;
- unsigned VReg = restores[i].vreg;
- LiveInterval &nI = getOrCreateInterval(VReg);
- MachineInstr *MI = getInstructionFromIndex(index);
- bool CanFold = false;
- Ops.clear();
- if (restores[i].canFold) {
- CanFold = true;
- for (unsigned j = 0, ee = MI->getNumOperands(); j != ee; ++j) {
- MachineOperand &MO = MI->getOperand(j);
- if (!MO.isRegister() || MO.getReg() != VReg)
- continue;
-
- if (MO.isDef()) {
- // If this restore were to be folded, it would have been folded
- // already.
- CanFold = false;
- break;
- }
- Ops.push_back(j);
- }
- }
-
- // Fold the load into the use if possible.
- bool Folded = false;
- if (CanFold && !Ops.empty()) {
- if (!vrm.isReMaterialized(VReg))
- Folded = tryFoldMemoryOperand(MI, vrm, NULL,index,Ops,true,Slot,VReg);
- else {
- MachineInstr *ReMatDefMI = vrm.getReMaterializedMI(VReg);
- int LdSlot = 0;
- bool isLoadSS = tii_->isLoadFromStackSlot(ReMatDefMI, LdSlot);
- // If the rematerializable def is a load, also try to fold it.
- if (isLoadSS || ReMatDefMI->getDesc().isSimpleLoad())
- Folded = tryFoldMemoryOperand(MI, vrm, ReMatDefMI, index,
- Ops, isLoadSS, LdSlot, VReg);
- unsigned ImpUse = getReMatImplicitUse(li, ReMatDefMI);
- if (ImpUse) {
- // Re-matting an instruction with virtual register use. Add the
- // register as an implicit use on the use MI and update the register
- // interval's spill weight to HUGE_VALF to prevent it from being
- // spilled.
- LiveInterval &ImpLi = getInterval(ImpUse);
- ImpLi.weight = HUGE_VALF;
- MI->addOperand(MachineOperand::CreateReg(ImpUse, false, true));
- }
- }
- }
- // If folding is not possible / failed, then tell the spiller to issue a
- // load / rematerialization for us.
- if (Folded)
- nI.removeRange(getLoadIndex(index), getUseIndex(index)+1);
- else
- vrm.addRestorePoint(VReg, MI);
- }
- Id = RestoreMBBs.find_next(Id);
- }
-
- // Finalize intervals: add kills, finalize spill weights, and filter out
- // dead intervals.
- std::vector<LiveInterval*> RetNewLIs;
- for (unsigned i = 0, e = NewLIs.size(); i != e; ++i) {
- LiveInterval *LI = NewLIs[i];
- if (!LI->empty()) {
- LI->weight /= LI->getSize();
- if (!AddedKill.count(LI)) {
- LiveRange *LR = &LI->ranges[LI->ranges.size()-1];
- unsigned LastUseIdx = getBaseIndex(LR->end);
- MachineInstr *LastUse = getInstructionFromIndex(LastUseIdx);
- int UseIdx = LastUse->findRegisterUseOperandIdx(LI->reg, false);
- assert(UseIdx != -1);
- if (LastUse->getOperand(UseIdx).isImplicit() ||
- LastUse->getDesc().getOperandConstraint(UseIdx,TOI::TIED_TO) == -1){
- LastUse->getOperand(UseIdx).setIsKill();
- vrm.addKillPoint(LI->reg, LastUseIdx);
- }
- }
- RetNewLIs.push_back(LI);
- }
- }
-
- handleSpilledImpDefs(li, vrm, rc, RetNewLIs);
- return RetNewLIs;
-}
-
-/// hasAllocatableSuperReg - Return true if the specified physical register has
-/// any super register that's allocatable.
-bool LiveIntervals::hasAllocatableSuperReg(unsigned Reg) const {
- for (const unsigned* AS = tri_->getSuperRegisters(Reg); *AS; ++AS)
- if (allocatableRegs_[*AS] && hasInterval(*AS))
- return true;
- return false;
-}
-
-/// getRepresentativeReg - Find the largest super register of the specified
-/// physical register.
-unsigned LiveIntervals::getRepresentativeReg(unsigned Reg) const {
- // Find the largest super-register that is allocatable.
- unsigned BestReg = Reg;
- for (const unsigned* AS = tri_->getSuperRegisters(Reg); *AS; ++AS) {
- unsigned SuperReg = *AS;
- if (!hasAllocatableSuperReg(SuperReg) && hasInterval(SuperReg)) {
- BestReg = SuperReg;
- break;
- }
- }
- return BestReg;
-}
-
-/// getNumConflictsWithPhysReg - Return the number of uses and defs of the
-/// specified interval that conflicts with the specified physical register.
-unsigned LiveIntervals::getNumConflictsWithPhysReg(const LiveInterval &li,
- unsigned PhysReg) const {
- unsigned NumConflicts = 0;
- const LiveInterval &pli = getInterval(getRepresentativeReg(PhysReg));
- for (MachineRegisterInfo::reg_iterator I = mri_->reg_begin(li.reg),
- E = mri_->reg_end(); I != E; ++I) {
- MachineOperand &O = I.getOperand();
- MachineInstr *MI = O.getParent();
- unsigned Index = getInstructionIndex(MI);
- if (pli.liveAt(Index))
- ++NumConflicts;
- }
- return NumConflicts;
-}
-
-/// spillPhysRegAroundRegDefsUses - Spill the specified physical register
-/// around all defs and uses of the specified interval.
-void LiveIntervals::spillPhysRegAroundRegDefsUses(const LiveInterval &li,
- unsigned PhysReg, VirtRegMap &vrm) {
- unsigned SpillReg = getRepresentativeReg(PhysReg);
-
- for (const unsigned *AS = tri_->getAliasSet(PhysReg); *AS; ++AS)
- // If there are registers which alias PhysReg, but which are not a
- // sub-register of the chosen representative super register. Assert
- // since we can't handle it yet.
- assert(*AS == SpillReg || !allocatableRegs_[*AS] ||
- tri_->isSuperRegister(*AS, SpillReg));
-
- LiveInterval &pli = getInterval(SpillReg);
- SmallPtrSet<MachineInstr*, 8> SeenMIs;
- for (MachineRegisterInfo::reg_iterator I = mri_->reg_begin(li.reg),
- E = mri_->reg_end(); I != E; ++I) {
- MachineOperand &O = I.getOperand();
- MachineInstr *MI = O.getParent();
- if (SeenMIs.count(MI))
- continue;
- SeenMIs.insert(MI);
- unsigned Index = getInstructionIndex(MI);
- if (pli.liveAt(Index)) {
- vrm.addEmergencySpill(SpillReg, MI);
- pli.removeRange(getLoadIndex(Index), getStoreIndex(Index)+1);
- for (const unsigned* AS = tri_->getSubRegisters(SpillReg); *AS; ++AS) {
- if (!hasInterval(*AS))
- continue;
- LiveInterval &spli = getInterval(*AS);
- if (spli.liveAt(Index))
- spli.removeRange(getLoadIndex(Index), getStoreIndex(Index)+1);
- }
- }
- }
-}
diff --git a/release_23/lib/CodeGen/LiveVariables.cpp b/release_23/lib/CodeGen/LiveVariables.cpp
deleted file mode 100644
index 4a4ef37b004e..000000000000
--- a/release_23/lib/CodeGen/LiveVariables.cpp
+++ /dev/null
@@ -1,715 +0,0 @@
-//===-- LiveVariables.cpp - Live Variable Analysis for Machine Code -------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the LiveVariable analysis pass. For each machine
-// instruction in the function, this pass calculates the set of registers that
-// are immediately dead after the instruction (i.e., the instruction calculates
-// the value, but it is never used) and the set of registers that are used by
-// the instruction, but are never used after the instruction (i.e., they are
-// killed).
-//
-// This class computes live variables using are sparse implementation based on
-// the machine code SSA form. This class computes live variable information for
-// each virtual and _register allocatable_ physical register in a function. It
-// uses the dominance properties of SSA form to efficiently compute live
-// variables for virtual registers, and assumes that physical registers are only
-// live within a single basic block (allowing it to do a single local analysis
-// to resolve physical register lifetimes in each basic block). If a physical
-// register is not register allocatable, it is not tracked. This is useful for
-// things like the stack pointer and condition codes.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/CodeGen/LiveVariables.h"
-#include "llvm/CodeGen/MachineInstr.h"
-#include "llvm/CodeGen/MachineRegisterInfo.h"
-#include "llvm/Target/TargetRegisterInfo.h"
-#include "llvm/Target/TargetInstrInfo.h"
-#include "llvm/Target/TargetMachine.h"
-#include "llvm/ADT/DepthFirstIterator.h"
-#include "llvm/ADT/SmallPtrSet.h"
-#include "llvm/ADT/STLExtras.h"
-#include "llvm/Config/alloca.h"
-#include <algorithm>
-using namespace llvm;
-
-char LiveVariables::ID = 0;
-static RegisterPass<LiveVariables> X("livevars", "Live Variable Analysis");
-
-void LiveVariables::VarInfo::dump() const {
- cerr << " Alive in blocks: ";
- for (unsigned i = 0, e = AliveBlocks.size(); i != e; ++i)
- if (AliveBlocks[i]) cerr << i << ", ";
- cerr << " Used in blocks: ";
- for (unsigned i = 0, e = UsedBlocks.size(); i != e; ++i)
- if (UsedBlocks[i]) cerr << i << ", ";
- cerr << "\n Killed by:";
- if (Kills.empty())
- cerr << " No instructions.\n";
- else {
- for (unsigned i = 0, e = Kills.size(); i != e; ++i)
- cerr << "\n #" << i << ": " << *Kills[i];
- cerr << "\n";
- }
-}
-
-/// getVarInfo - Get (possibly creating) a VarInfo object for the given vreg.
-LiveVariables::VarInfo &LiveVariables::getVarInfo(unsigned RegIdx) {
- assert(TargetRegisterInfo::isVirtualRegister(RegIdx) &&
- "getVarInfo: not a virtual register!");
- RegIdx -= TargetRegisterInfo::FirstVirtualRegister;
- if (RegIdx >= VirtRegInfo.size()) {
- if (RegIdx >= 2*VirtRegInfo.size())
- VirtRegInfo.resize(RegIdx*2);
- else
- VirtRegInfo.resize(2*VirtRegInfo.size());
- }
- VarInfo &VI = VirtRegInfo[RegIdx];
- VI.AliveBlocks.resize(MF->getNumBlockIDs());
- VI.UsedBlocks.resize(MF->getNumBlockIDs());
- return VI;
-}
-
-void LiveVariables::MarkVirtRegAliveInBlock(VarInfo& VRInfo,
- MachineBasicBlock *DefBlock,
- MachineBasicBlock *MBB,
- std::vector<MachineBasicBlock*> &WorkList) {
- unsigned BBNum = MBB->getNumber();
-
- // Check to see if this basic block is one of the killing blocks. If so,
- // remove it.
- for (unsigned i = 0, e = VRInfo.Kills.size(); i != e; ++i)
- if (VRInfo.Kills[i]->getParent() == MBB) {
- VRInfo.Kills.erase(VRInfo.Kills.begin()+i); // Erase entry
- break;
- }
-
- if (MBB == DefBlock) return; // Terminate recursion
-
- if (VRInfo.AliveBlocks[BBNum])
- return; // We already know the block is live
-
- // Mark the variable known alive in this bb
- VRInfo.AliveBlocks[BBNum] = true;
-
- for (MachineBasicBlock::const_pred_reverse_iterator PI = MBB->pred_rbegin(),
- E = MBB->pred_rend(); PI != E; ++PI)
- WorkList.push_back(*PI);
-}
-
-void LiveVariables::MarkVirtRegAliveInBlock(VarInfo &VRInfo,
- MachineBasicBlock *DefBlock,
- MachineBasicBlock *MBB) {
- std::vector<MachineBasicBlock*> WorkList;
- MarkVirtRegAliveInBlock(VRInfo, DefBlock, MBB, WorkList);
-
- while (!WorkList.empty()) {
- MachineBasicBlock *Pred = WorkList.back();
- WorkList.pop_back();
- MarkVirtRegAliveInBlock(VRInfo, DefBlock, Pred, WorkList);
- }
-}
-
-void LiveVariables::HandleVirtRegUse(unsigned reg, MachineBasicBlock *MBB,
- MachineInstr *MI) {
- assert(MRI->getVRegDef(reg) && "Register use before def!");
-
- unsigned BBNum = MBB->getNumber();
-
- VarInfo& VRInfo = getVarInfo(reg);
- VRInfo.UsedBlocks[BBNum] = true;
- VRInfo.NumUses++;
-
- // Check to see if this basic block is already a kill block.
- if (!VRInfo.Kills.empty() && VRInfo.Kills.back()->getParent() == MBB) {
- // Yes, this register is killed in this basic block already. Increase the
- // live range by updating the kill instruction.
- VRInfo.Kills.back() = MI;
- return;
- }
-
-#ifndef NDEBUG
- for (unsigned i = 0, e = VRInfo.Kills.size(); i != e; ++i)
- assert(VRInfo.Kills[i]->getParent() != MBB && "entry should be at end!");
-#endif
-
- assert(MBB != MRI->getVRegDef(reg)->getParent() &&
- "Should have kill for defblock!");
-
- // Add a new kill entry for this basic block. If this virtual register is
- // already marked as alive in this basic block, that means it is alive in at
- // least one of the successor blocks, it's not a kill.
- if (!VRInfo.AliveBlocks[BBNum])
- VRInfo.Kills.push_back(MI);
-
- // Update all dominating blocks to mark them as "known live".
- for (MachineBasicBlock::const_pred_iterator PI = MBB->pred_begin(),
- E = MBB->pred_end(); PI != E; ++PI)
- MarkVirtRegAliveInBlock(VRInfo, MRI->getVRegDef(reg)->getParent(), *PI);
-}
-
-/// FindLastPartialDef - Return the last partial def of the specified register.
-/// Also returns the sub-register that's defined.
-MachineInstr *LiveVariables::FindLastPartialDef(unsigned Reg,
- unsigned &PartDefReg) {
- unsigned LastDefReg = 0;
- unsigned LastDefDist = 0;
- MachineInstr *LastDef = NULL;
- for (const unsigned *SubRegs = TRI->getSubRegisters(Reg);
- unsigned SubReg = *SubRegs; ++SubRegs) {
- MachineInstr *Def = PhysRegDef[SubReg];
- if (!Def)
- continue;
- unsigned Dist = DistanceMap[Def];
- if (Dist > LastDefDist) {
- LastDefReg = SubReg;
- LastDef = Def;
- LastDefDist = Dist;
- }
- }
- PartDefReg = LastDefReg;
- return LastDef;
-}
-
-/// HandlePhysRegUse - Turn previous partial def's into read/mod/writes. Add
-/// implicit defs to a machine instruction if there was an earlier def of its
-/// super-register.
-void LiveVariables::HandlePhysRegUse(unsigned Reg, MachineInstr *MI) {
- // If there was a previous use or a "full" def all is well.
- if (!PhysRegDef[Reg] && !PhysRegUse[Reg]) {
- // Otherwise, the last sub-register def implicitly defines this register.
- // e.g.
- // AH =
- // AL = ... <imp-def EAX>, <imp-kill AH>
- // = AH
- // ...
- // = EAX
- // All of the sub-registers must have been defined before the use of Reg!
- unsigned PartDefReg = 0;
- MachineInstr *LastPartialDef = FindLastPartialDef(Reg, PartDefReg);
- // If LastPartialDef is NULL, it must be using a livein register.
- if (LastPartialDef) {
- LastPartialDef->addOperand(MachineOperand::CreateReg(Reg, true/*IsDef*/,
- true/*IsImp*/));
- PhysRegDef[Reg] = LastPartialDef;
- std::set<unsigned> Processed;
- for (const unsigned *SubRegs = TRI->getSubRegisters(Reg);
- unsigned SubReg = *SubRegs; ++SubRegs) {
- if (Processed.count(SubReg))
- continue;
- if (SubReg == PartDefReg || TRI->isSubRegister(PartDefReg, SubReg))
- continue;
- // This part of Reg was defined before the last partial def. It's killed
- // here.
- LastPartialDef->addOperand(MachineOperand::CreateReg(SubReg,
- false/*IsDef*/,
- true/*IsImp*/));
- PhysRegDef[SubReg] = LastPartialDef;
- for (const unsigned *SS = TRI->getSubRegisters(SubReg); *SS; ++SS)
- Processed.insert(*SS);
- }
- }
- }
-
- // There was an earlier def of a super-register. Add implicit def to that MI.
- //
- // A: EAX = ...
- // B: ... = AX
- //
- // Add implicit def to A if there isn't a use of AX (or EAX) before B.
- if (!PhysRegUse[Reg]) {
- MachineInstr *Def = PhysRegDef[Reg];
- if (Def && !Def->modifiesRegister(Reg))
- Def->addOperand(MachineOperand::CreateReg(Reg,
- true /*IsDef*/,
- true /*IsImp*/));
- }
-
- // Remember this use.
- PhysRegUse[Reg] = MI;
- for (const unsigned *SubRegs = TRI->getSubRegisters(Reg);
- unsigned SubReg = *SubRegs; ++SubRegs)
- PhysRegUse[SubReg] = MI;
-}
-
-/// hasRegisterUseBelow - Return true if the specified register is used after
-/// the current instruction and before it's next definition.
-bool LiveVariables::hasRegisterUseBelow(unsigned Reg,
- MachineBasicBlock::iterator I,
- MachineBasicBlock *MBB) {
- if (I == MBB->end())
- return false;
-
- // First find out if there are any uses / defs below.
- bool hasDistInfo = true;
- unsigned CurDist = DistanceMap[I];
- SmallVector<MachineInstr*, 4> Uses;
- SmallVector<MachineInstr*, 4> Defs;
- for (MachineRegisterInfo::reg_iterator RI = MRI->reg_begin(Reg),
- RE = MRI->reg_end(); RI != RE; ++RI) {
- MachineOperand &UDO = RI.getOperand();
- MachineInstr *UDMI = &*RI;
- if (UDMI->getParent() != MBB)
- continue;
- DenseMap<MachineInstr*, unsigned>::iterator DI = DistanceMap.find(UDMI);
- bool isBelow = false;
- if (DI == DistanceMap.end()) {
- // Must be below if it hasn't been assigned a distance yet.
- isBelow = true;
- hasDistInfo = false;
- } else if (DI->second > CurDist)
- isBelow = true;
- if (isBelow) {
- if (UDO.isUse())
- Uses.push_back(UDMI);
- if (UDO.isDef())
- Defs.push_back(UDMI);
- }
- }
-
- if (Uses.empty())
- // No uses below.
- return false;
- else if (!Uses.empty() && Defs.empty())
- // There are uses below but no defs below.
- return true;
- // There are both uses and defs below. We need to know which comes first.
- if (!hasDistInfo) {
- // Complete DistanceMap for this MBB. This information is computed only
- // once per MBB.
- ++I;
- ++CurDist;
- for (MachineBasicBlock::iterator E = MBB->end(); I != E; ++I, ++CurDist)
- DistanceMap.insert(std::make_pair(I, CurDist));
- }
-
- unsigned EarliestUse = DistanceMap[Uses[0]];
- for (unsigned i = 1, e = Uses.size(); i != e; ++i) {
- unsigned Dist = DistanceMap[Uses[i]];
- if (Dist < EarliestUse)
- EarliestUse = Dist;
- }
- for (unsigned i = 0, e = Defs.size(); i != e; ++i) {
- unsigned Dist = DistanceMap[Defs[i]];
- if (Dist < EarliestUse)
- // The register is defined before its first use below.
- return false;
- }
- return true;
-}
-
-bool LiveVariables::HandlePhysRegKill(unsigned Reg) {
- if (!PhysRegUse[Reg] && !PhysRegDef[Reg])
- return false;
-
- MachineInstr *LastRefOrPartRef = PhysRegUse[Reg]
- ? PhysRegUse[Reg] : PhysRegDef[Reg];
- unsigned LastRefOrPartRefDist = DistanceMap[LastRefOrPartRef];
- // The whole register is used.
- // AL =
- // AH =
- //
- // = AX
- // = AL, AX<imp-use, kill>
- // AX =
- //
- // Or whole register is defined, but not used at all.
- // AX<dead> =
- // ...
- // AX =
- //
- // Or whole register is defined, but only partly used.
- // AX<dead> = AL<imp-def>
- // = AL<kill>
- // AX =
- std::set<unsigned> PartUses;
- for (const unsigned *SubRegs = TRI->getSubRegisters(Reg);
- unsigned SubReg = *SubRegs; ++SubRegs) {
- if (MachineInstr *Use = PhysRegUse[SubReg]) {
- PartUses.insert(SubReg);
- for (const unsigned *SS = TRI->getSubRegisters(SubReg); *SS; ++SS)
- PartUses.insert(*SS);
- unsigned Dist = DistanceMap[Use];
- if (Dist > LastRefOrPartRefDist) {
- LastRefOrPartRefDist = Dist;
- LastRefOrPartRef = Use;
- }
- }
- }
- if (LastRefOrPartRef == PhysRegDef[Reg])
- // Not used at all.
- LastRefOrPartRef->addRegisterDead(Reg, TRI, true);
-
- /* Partial uses. Mark register def dead and add implicit def of
- sub-registers which are used.
- FIXME: LiveIntervalAnalysis can't handle this yet!
- EAX<dead> = op AL<imp-def>
- That is, EAX def is dead but AL def extends pass it.
- Enable this after live interval analysis is fixed to improve codegen!
- else if (!PhysRegUse[Reg]) {
- PhysRegDef[Reg]->addRegisterDead(Reg, TRI, true);
- for (const unsigned *SubRegs = TRI->getSubRegisters(Reg);
- unsigned SubReg = *SubRegs; ++SubRegs) {
- if (PartUses.count(SubReg)) {
- PhysRegDef[Reg]->addOperand(MachineOperand::CreateReg(SubReg,
- true, true));
- LastRefOrPartRef->addRegisterKilled(SubReg, TRI, true);
- for (const unsigned *SS = TRI->getSubRegisters(SubReg); *SS; ++SS)
- PartUses.erase(*SS);
- }
- }
- } */
- else
- LastRefOrPartRef->addRegisterKilled(Reg, TRI, true);
- return true;
-}
-
-void LiveVariables::HandlePhysRegDef(unsigned Reg, MachineInstr *MI) {
- // What parts of the register are previously defined?
- std::set<unsigned> Live;
- if (PhysRegDef[Reg] || PhysRegUse[Reg]) {
- Live.insert(Reg);
- for (const unsigned *SS = TRI->getSubRegisters(Reg); *SS; ++SS)
- Live.insert(*SS);
- } else {
- for (const unsigned *SubRegs = TRI->getSubRegisters(Reg);
- unsigned SubReg = *SubRegs; ++SubRegs) {
- // If a register isn't itself defined, but all parts that make up of it
- // are defined, then consider it also defined.
- // e.g.
- // AL =
- // AH =
- // = AX
- if (PhysRegDef[SubReg] || PhysRegUse[SubReg]) {
- Live.insert(SubReg);
- for (const unsigned *SS = TRI->getSubRegisters(SubReg); *SS; ++SS)
- Live.insert(*SS);
- }
- }
- }
-
- // Start from the largest piece, find the last time any part of the register
- // is referenced.
- if (!HandlePhysRegKill(Reg)) {
- // Only some of the sub-registers are used.
- for (const unsigned *SubRegs = TRI->getSubRegisters(Reg);
- unsigned SubReg = *SubRegs; ++SubRegs) {
- if (!Live.count(SubReg))
- // Skip if this sub-register isn't defined.
- continue;
- if (HandlePhysRegKill(SubReg)) {
- Live.erase(SubReg);
- for (const unsigned *SS = TRI->getSubRegisters(SubReg); *SS; ++SS)
- Live.erase(*SS);
- }
- }
- assert(Live.empty() && "Not all defined registers are killed / dead?");
- }
-
- if (MI) {
- // Does this extend the live range of a super-register?
- std::set<unsigned> Processed;
- for (const unsigned *SuperRegs = TRI->getSuperRegisters(Reg);
- unsigned SuperReg = *SuperRegs; ++SuperRegs) {
- if (Processed.count(SuperReg))
- continue;
- MachineInstr *LastRef = PhysRegUse[SuperReg]
- ? PhysRegUse[SuperReg] : PhysRegDef[SuperReg];
- if (LastRef && LastRef != MI) {
- // The larger register is previously defined. Now a smaller part is
- // being re-defined. Treat it as read/mod/write if there are uses
- // below.
- // EAX =
- // AX = EAX<imp-use,kill>, EAX<imp-def>
- // ...
- /// = EAX
- if (hasRegisterUseBelow(SuperReg, MI, MI->getParent())) {
- MI->addOperand(MachineOperand::CreateReg(SuperReg, false/*IsDef*/,
- true/*IsImp*/,true/*IsKill*/));
- MI->addOperand(MachineOperand::CreateReg(SuperReg, true/*IsDef*/,
- true/*IsImp*/));
- PhysRegDef[SuperReg] = MI;
- PhysRegUse[SuperReg] = NULL;
- Processed.insert(SuperReg);
- for (const unsigned *SS = TRI->getSubRegisters(SuperReg); *SS; ++SS) {
- PhysRegDef[*SS] = MI;
- PhysRegUse[*SS] = NULL;
- Processed.insert(*SS);
- }
- } else {
- // Otherwise, the super register is killed.
- if (HandlePhysRegKill(SuperReg)) {
- PhysRegDef[SuperReg] = NULL;
- PhysRegUse[SuperReg] = NULL;
- for (const unsigned *SS = TRI->getSubRegisters(SuperReg); *SS; ++SS) {
- PhysRegDef[*SS] = NULL;
- PhysRegUse[*SS] = NULL;
- Processed.insert(*SS);
- }
- }
- }
- }
- }
-
- // Remember this def.
- PhysRegDef[Reg] = MI;
- PhysRegUse[Reg] = NULL;
- for (const unsigned *SubRegs = TRI->getSubRegisters(Reg);
- unsigned SubReg = *SubRegs; ++SubRegs) {
- PhysRegDef[SubReg] = MI;
- PhysRegUse[SubReg] = NULL;
- }
- }
-}
-
-bool LiveVariables::runOnMachineFunction(MachineFunction &mf) {
- MF = &mf;
- MRI = &mf.getRegInfo();
- TRI = MF->getTarget().getRegisterInfo();
-
- ReservedRegisters = TRI->getReservedRegs(mf);
-
- unsigned NumRegs = TRI->getNumRegs();
- PhysRegDef = new MachineInstr*[NumRegs];
- PhysRegUse = new MachineInstr*[NumRegs];
- PHIVarInfo = new SmallVector<unsigned, 4>[MF->getNumBlockIDs()];
- std::fill(PhysRegDef, PhysRegDef + NumRegs, (MachineInstr*)0);
- std::fill(PhysRegUse, PhysRegUse + NumRegs, (MachineInstr*)0);
-
- /// Get some space for a respectable number of registers.
- VirtRegInfo.resize(64);
-
- analyzePHINodes(mf);
-
- // Calculate live variable information in depth first order on the CFG of the
- // function. This guarantees that we will see the definition of a virtual
- // register before its uses due to dominance properties of SSA (except for PHI
- // nodes, which are treated as a special case).
- MachineBasicBlock *Entry = MF->begin();
- SmallPtrSet<MachineBasicBlock*,16> Visited;
-
- for (df_ext_iterator<MachineBasicBlock*, SmallPtrSet<MachineBasicBlock*,16> >
- DFI = df_ext_begin(Entry, Visited), E = df_ext_end(Entry, Visited);
- DFI != E; ++DFI) {
- MachineBasicBlock *MBB = *DFI;
-
- // Mark live-in registers as live-in.
- for (MachineBasicBlock::const_livein_iterator II = MBB->livein_begin(),
- EE = MBB->livein_end(); II != EE; ++II) {
- assert(TargetRegisterInfo::isPhysicalRegister(*II) &&
- "Cannot have a live-in virtual register!");
- HandlePhysRegDef(*II, 0);
- }
-
- // Loop over all of the instructions, processing them.
- DistanceMap.clear();
- unsigned Dist = 0;
- for (MachineBasicBlock::iterator I = MBB->begin(), E = MBB->end();
- I != E; ++I) {
- MachineInstr *MI = I;
- DistanceMap.insert(std::make_pair(MI, Dist++));
-
- // Process all of the operands of the instruction...
- unsigned NumOperandsToProcess = MI->getNumOperands();
-
- // Unless it is a PHI node. In this case, ONLY process the DEF, not any
- // of the uses. They will be handled in other basic blocks.
- if (MI->getOpcode() == TargetInstrInfo::PHI)
- NumOperandsToProcess = 1;
-
- SmallVector<unsigned, 4> UseRegs;
- SmallVector<unsigned, 4> DefRegs;
- for (unsigned i = 0; i != NumOperandsToProcess; ++i) {
- const MachineOperand &MO = MI->getOperand(i);
- if (MO.isRegister() && MO.getReg()) {
- unsigned MOReg = MO.getReg();
- if (!MOReg)
- continue;
- if (MO.isUse())
- UseRegs.push_back(MOReg);
- if (MO.isDef())
- DefRegs.push_back(MOReg);
- }
- }
-
- // Process all uses.
- for (unsigned i = 0, e = UseRegs.size(); i != e; ++i) {
- unsigned MOReg = UseRegs[i];
- if (TargetRegisterInfo::isVirtualRegister(MOReg))
- HandleVirtRegUse(MOReg, MBB, MI);
- else if (TargetRegisterInfo::isPhysicalRegister(MOReg) &&
- !ReservedRegisters[MOReg])
- HandlePhysRegUse(MOReg, MI);
- }
-
- // Process all defs.
- for (unsigned i = 0, e = DefRegs.size(); i != e; ++i) {
- unsigned MOReg = DefRegs[i];
- if (TargetRegisterInfo::isVirtualRegister(MOReg)) {
- VarInfo &VRInfo = getVarInfo(MOReg);
-
- if (VRInfo.AliveBlocks.none())
- // If vr is not alive in any block, then defaults to dead.
- VRInfo.Kills.push_back(MI);
- } else if (TargetRegisterInfo::isPhysicalRegister(MOReg) &&
- !ReservedRegisters[MOReg]) {
- HandlePhysRegDef(MOReg, MI);
- }
- }
- }
-
- // Handle any virtual assignments from PHI nodes which might be at the
- // bottom of this basic block. We check all of our successor blocks to see
- // if they have PHI nodes, and if so, we simulate an assignment at the end
- // of the current block.
- if (!PHIVarInfo[MBB->getNumber()].empty()) {
- SmallVector<unsigned, 4>& VarInfoVec = PHIVarInfo[MBB->getNumber()];
-
- for (SmallVector<unsigned, 4>::iterator I = VarInfoVec.begin(),
- E = VarInfoVec.end(); I != E; ++I)
- // Mark it alive only in the block we are representing.
- MarkVirtRegAliveInBlock(getVarInfo(*I),MRI->getVRegDef(*I)->getParent(),
- MBB);
- }
-
- // Finally, if the last instruction in the block is a return, make sure to
- // mark it as using all of the live-out values in the function.
- if (!MBB->empty() && MBB->back().getDesc().isReturn()) {
- MachineInstr *Ret = &MBB->back();
-
- for (MachineRegisterInfo::liveout_iterator
- I = MF->getRegInfo().liveout_begin(),
- E = MF->getRegInfo().liveout_end(); I != E; ++I) {
- assert(TargetRegisterInfo::isPhysicalRegister(*I) &&
- "Cannot have a live-in virtual register!");
- HandlePhysRegUse(*I, Ret);
-
- // Add live-out registers as implicit uses.
- if (!Ret->readsRegister(*I))
- Ret->addOperand(MachineOperand::CreateReg(*I, false, true));
- }
- }
-
- // Loop over PhysRegDef / PhysRegUse, killing any registers that are
- // available at the end of the basic block.
- for (unsigned i = 0; i != NumRegs; ++i)
- if (PhysRegDef[i] || PhysRegUse[i])
- HandlePhysRegDef(i, 0);
-
- std::fill(PhysRegDef, PhysRegDef + NumRegs, (MachineInstr*)0);
- std::fill(PhysRegUse, PhysRegUse + NumRegs, (MachineInstr*)0);
- }
-
- // Convert and transfer the dead / killed information we have gathered into
- // VirtRegInfo onto MI's.
- for (unsigned i = 0, e1 = VirtRegInfo.size(); i != e1; ++i)
- for (unsigned j = 0, e2 = VirtRegInfo[i].Kills.size(); j != e2; ++j)
- if (VirtRegInfo[i].Kills[j] ==
- MRI->getVRegDef(i + TargetRegisterInfo::FirstVirtualRegister))
- VirtRegInfo[i]
- .Kills[j]->addRegisterDead(i +
- TargetRegisterInfo::FirstVirtualRegister,
- TRI);
- else
- VirtRegInfo[i]
- .Kills[j]->addRegisterKilled(i +
- TargetRegisterInfo::FirstVirtualRegister,
- TRI);
-
- // Check to make sure there are no unreachable blocks in the MC CFG for the
- // function. If so, it is due to a bug in the instruction selector or some
- // other part of the code generator if this happens.
-#ifndef NDEBUG
- for(MachineFunction::iterator i = MF->begin(), e = MF->end(); i != e; ++i)
- assert(Visited.count(&*i) != 0 && "unreachable basic block found");
-#endif
-
- delete[] PhysRegDef;
- delete[] PhysRegUse;
- delete[] PHIVarInfo;
-
- return false;
-}
-
-/// instructionChanged - When the address of an instruction changes, this method
-/// should be called so that live variables can update its internal data
-/// structures. This removes the records for OldMI, transfering them to the
-/// records for NewMI.
-void LiveVariables::instructionChanged(MachineInstr *OldMI,
- MachineInstr *NewMI) {
- // If the instruction defines any virtual registers, update the VarInfo,
- // kill and dead information for the instruction.
- for (unsigned i = 0, e = OldMI->getNumOperands(); i != e; ++i) {
- MachineOperand &MO = OldMI->getOperand(i);
- if (MO.isRegister() && MO.getReg() &&
- TargetRegisterInfo::isVirtualRegister(MO.getReg())) {
- unsigned Reg = MO.getReg();
- VarInfo &VI = getVarInfo(Reg);
- if (MO.isDef()) {
- if (MO.isDead()) {
- MO.setIsDead(false);
- addVirtualRegisterDead(Reg, NewMI);
- }
- }
- if (MO.isKill()) {
- MO.setIsKill(false);
- addVirtualRegisterKilled(Reg, NewMI);
- }
- // If this is a kill of the value, update the VI kills list.
- if (VI.removeKill(OldMI))
- VI.Kills.push_back(NewMI); // Yes, there was a kill of it
- }
- }
-}
-
-/// removeVirtualRegistersKilled - Remove all killed info for the specified
-/// instruction.
-void LiveVariables::removeVirtualRegistersKilled(MachineInstr *MI) {
- for (unsigned i = 0, e = MI->getNumOperands(); i != e; ++i) {
- MachineOperand &MO = MI->getOperand(i);
- if (MO.isRegister() && MO.isKill()) {
- MO.setIsKill(false);
- unsigned Reg = MO.getReg();
- if (TargetRegisterInfo::isVirtualRegister(Reg)) {
- bool removed = getVarInfo(Reg).removeKill(MI);
- assert(removed && "kill not in register's VarInfo?");
- }
- }
- }
-}
-
-/// removeVirtualRegistersDead - Remove all of the dead registers for the
-/// specified instruction from the live variable information.
-void LiveVariables::removeVirtualRegistersDead(MachineInstr *MI) {
- for (unsigned i = 0, e = MI->getNumOperands(); i != e; ++i) {
- MachineOperand &MO = MI->getOperand(i);
- if (MO.isRegister() && MO.isDead()) {
- MO.setIsDead(false);
- unsigned Reg = MO.getReg();
- if (TargetRegisterInfo::isVirtualRegister(Reg)) {
- bool removed = getVarInfo(Reg).removeKill(MI);
- assert(removed && "kill not in register's VarInfo?");
- }
- }
- }
-}
-
-/// analyzePHINodes - Gather information about the PHI nodes in here. In
-/// particular, we want to map the variable information of a virtual register
-/// which is used in a PHI node. We map that to the BB the vreg is coming from.
-///
-void LiveVariables::analyzePHINodes(const MachineFunction& Fn) {
- for (MachineFunction::const_iterator I = Fn.begin(), E = Fn.end();
- I != E; ++I)
- for (MachineBasicBlock::const_iterator BBI = I->begin(), BBE = I->end();
- BBI != BBE && BBI->getOpcode() == TargetInstrInfo::PHI; ++BBI)
- for (unsigned i = 1, e = BBI->getNumOperands(); i != e; i += 2)
- PHIVarInfo[BBI->getOperand(i + 1).getMBB()->getNumber()]
- .push_back(BBI->getOperand(i).getReg());
-}
diff --git a/release_23/lib/CodeGen/LoopAligner.cpp b/release_23/lib/CodeGen/LoopAligner.cpp
deleted file mode 100644
index 1888391d5e71..000000000000
--- a/release_23/lib/CodeGen/LoopAligner.cpp
+++ /dev/null
@@ -1,67 +0,0 @@
-//===-- LoopAligner.cpp - Loop aligner pass. ------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the pass that align loop headers to target specific
-// alignment boundary.
-//
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "loopalign"
-#include "llvm/CodeGen/MachineLoopInfo.h"
-#include "llvm/CodeGen/MachineFunctionPass.h"
-#include "llvm/CodeGen/Passes.h"
-#include "llvm/Target/TargetLowering.h"
-#include "llvm/Target/TargetMachine.h"
-#include "llvm/Support/Compiler.h"
-#include "llvm/Support/Debug.h"
-using namespace llvm;
-
-namespace {
- class LoopAligner : public MachineFunctionPass {
- public:
- static char ID;
- LoopAligner() : MachineFunctionPass((intptr_t)&ID) {}
-
- virtual bool runOnMachineFunction(MachineFunction &MF);
- virtual const char *getPassName() const { return "Loop aligner"; }
-
- virtual void getAnalysisUsage(AnalysisUsage &AU) const {
- AU.addRequired<MachineLoopInfo>();
- AU.addPreserved<MachineLoopInfo>();
- MachineFunctionPass::getAnalysisUsage(AU);
- }
- };
-
- char LoopAligner::ID = 0;
-} // end anonymous namespace
-
-FunctionPass *llvm::createLoopAlignerPass() { return new LoopAligner(); }
-
-bool LoopAligner::runOnMachineFunction(MachineFunction &MF) {
- const MachineLoopInfo *MLI = &getAnalysis<MachineLoopInfo>();
-
- if (MLI->begin() == MLI->end())
- return false; // No loops.
-
- const TargetLowering *TLI = MF.getTarget().getTargetLowering();
- if (!TLI)
- return false;
-
- unsigned Align = TLI->getPrefLoopAlignment();
- if (!Align)
- return false; // Don't care about loop alignment.
-
- for (MachineFunction::iterator I = MF.begin(), E = MF.end(); I != E; ++I) {
- MachineBasicBlock *MBB = I;
- if (MLI->isLoopHeader(MBB))
- MBB->setAlignment(Align);
- }
-
- return true;
-}
diff --git a/release_23/lib/CodeGen/LowerSubregs.cpp b/release_23/lib/CodeGen/LowerSubregs.cpp
deleted file mode 100644
index 0710a3530068..000000000000
--- a/release_23/lib/CodeGen/LowerSubregs.cpp
+++ /dev/null
@@ -1,195 +0,0 @@
-//===-- LowerSubregs.cpp - Subregister Lowering instruction pass ----------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "lowersubregs"
-#include "llvm/CodeGen/Passes.h"
-#include "llvm/Function.h"
-#include "llvm/CodeGen/MachineFunctionPass.h"
-#include "llvm/CodeGen/MachineInstr.h"
-#include "llvm/CodeGen/MachineRegisterInfo.h"
-#include "llvm/Target/TargetRegisterInfo.h"
-#include "llvm/Target/TargetInstrInfo.h"
-#include "llvm/Target/TargetMachine.h"
-#include "llvm/Support/Debug.h"
-#include "llvm/Support/Compiler.h"
-using namespace llvm;
-
-namespace {
- struct VISIBILITY_HIDDEN LowerSubregsInstructionPass
- : public MachineFunctionPass {
- static char ID; // Pass identification, replacement for typeid
- LowerSubregsInstructionPass() : MachineFunctionPass((intptr_t)&ID) {}
-
- const char *getPassName() const {
- return "Subregister lowering instruction pass";
- }
-
- /// runOnMachineFunction - pass entry point
- bool runOnMachineFunction(MachineFunction&);
-
- bool LowerExtract(MachineInstr *MI);
- bool LowerInsert(MachineInstr *MI);
- bool LowerSubregToReg(MachineInstr *MI);
- };
-
- char LowerSubregsInstructionPass::ID = 0;
-}
-
-FunctionPass *llvm::createLowerSubregsPass() {
- return new LowerSubregsInstructionPass();
-}
-
-bool LowerSubregsInstructionPass::LowerExtract(MachineInstr *MI) {
- MachineBasicBlock *MBB = MI->getParent();
- MachineFunction &MF = *MBB->getParent();
- const TargetRegisterInfo &TRI = *MF.getTarget().getRegisterInfo();
- const TargetInstrInfo &TII = *MF.getTarget().getInstrInfo();
-
- assert(MI->getOperand(0).isRegister() && MI->getOperand(0).isDef() &&
- MI->getOperand(1).isRegister() && MI->getOperand(1).isUse() &&
- MI->getOperand(2).isImmediate() && "Malformed extract_subreg");
-
- unsigned DstReg = MI->getOperand(0).getReg();
- unsigned SuperReg = MI->getOperand(1).getReg();
- unsigned SubIdx = MI->getOperand(2).getImm();
- unsigned SrcReg = TRI.getSubReg(SuperReg, SubIdx);
-
- assert(TargetRegisterInfo::isPhysicalRegister(SuperReg) &&
- "Extract supperg source must be a physical register");
- assert(TargetRegisterInfo::isPhysicalRegister(DstReg) &&
- "Insert destination must be in a physical register");
-
- DOUT << "subreg: CONVERTING: " << *MI;
-
- if (SrcReg != DstReg) {
- const TargetRegisterClass *TRC = TRI.getPhysicalRegisterRegClass(DstReg);
- assert(TRC == TRI.getPhysicalRegisterRegClass(SrcReg) &&
- "Extract subreg and Dst must be of same register class");
- TII.copyRegToReg(*MBB, MI, DstReg, SrcReg, TRC, TRC);
-
-#ifndef NDEBUG
- MachineBasicBlock::iterator dMI = MI;
- DOUT << "subreg: " << *(--dMI);
-#endif
- }
-
- DOUT << "\n";
- MBB->remove(MI);
- return true;
-}
-
-bool LowerSubregsInstructionPass::LowerSubregToReg(MachineInstr *MI) {
- MachineBasicBlock *MBB = MI->getParent();
- MachineFunction &MF = *MBB->getParent();
- const TargetRegisterInfo &TRI = *MF.getTarget().getRegisterInfo();
- const TargetInstrInfo &TII = *MF.getTarget().getInstrInfo();
- assert((MI->getOperand(0).isRegister() && MI->getOperand(0).isDef()) &&
- MI->getOperand(1).isImmediate() &&
- (MI->getOperand(2).isRegister() && MI->getOperand(2).isUse()) &&
- MI->getOperand(3).isImmediate() && "Invalid subreg_to_reg");
-
- unsigned DstReg = MI->getOperand(0).getReg();
- unsigned InsReg = MI->getOperand(2).getReg();
- unsigned SubIdx = MI->getOperand(3).getImm();
-
- assert(SubIdx != 0 && "Invalid index for insert_subreg");
- unsigned DstSubReg = TRI.getSubReg(DstReg, SubIdx);
-
- assert(TargetRegisterInfo::isPhysicalRegister(DstReg) &&
- "Insert destination must be in a physical register");
- assert(TargetRegisterInfo::isPhysicalRegister(InsReg) &&
- "Inserted value must be in a physical register");
-
- DOUT << "subreg: CONVERTING: " << *MI;
-
- // Insert sub-register copy
- const TargetRegisterClass *TRC0 = TRI.getPhysicalRegisterRegClass(DstSubReg);
- const TargetRegisterClass *TRC1 = TRI.getPhysicalRegisterRegClass(InsReg);
- TII.copyRegToReg(*MBB, MI, DstSubReg, InsReg, TRC0, TRC1);
-
-#ifndef NDEBUG
- MachineBasicBlock::iterator dMI = MI;
- DOUT << "subreg: " << *(--dMI);
-#endif
-
- DOUT << "\n";
- MBB->remove(MI);
- return true;
-}
-
-bool LowerSubregsInstructionPass::LowerInsert(MachineInstr *MI) {
- MachineBasicBlock *MBB = MI->getParent();
- MachineFunction &MF = *MBB->getParent();
- const TargetRegisterInfo &TRI = *MF.getTarget().getRegisterInfo();
- const TargetInstrInfo &TII = *MF.getTarget().getInstrInfo();
- assert((MI->getOperand(0).isRegister() && MI->getOperand(0).isDef()) &&
- (MI->getOperand(1).isRegister() && MI->getOperand(1).isUse()) &&
- (MI->getOperand(2).isRegister() && MI->getOperand(2).isUse()) &&
- MI->getOperand(3).isImmediate() && "Invalid insert_subreg");
-
- unsigned DstReg = MI->getOperand(0).getReg();
- unsigned SrcReg = MI->getOperand(1).getReg();
- unsigned InsReg = MI->getOperand(2).getReg();
- unsigned SubIdx = MI->getOperand(3).getImm();
-
- assert(DstReg == SrcReg && "insert_subreg not a two-address instruction?");
- assert(SubIdx != 0 && "Invalid index for insert_subreg");
- unsigned DstSubReg = TRI.getSubReg(DstReg, SubIdx);
-
- assert(TargetRegisterInfo::isPhysicalRegister(SrcReg) &&
- "Insert superreg source must be in a physical register");
- assert(TargetRegisterInfo::isPhysicalRegister(InsReg) &&
- "Inserted value must be in a physical register");
-
- DOUT << "subreg: CONVERTING: " << *MI;
-
- // Insert sub-register copy
- const TargetRegisterClass *TRC0 = TRI.getPhysicalRegisterRegClass(DstSubReg);
- const TargetRegisterClass *TRC1 = TRI.getPhysicalRegisterRegClass(InsReg);
- TII.copyRegToReg(*MBB, MI, DstSubReg, InsReg, TRC0, TRC1);
-
-#ifndef NDEBUG
- MachineBasicBlock::iterator dMI = MI;
- DOUT << "subreg: " << *(--dMI);
-#endif
-
- DOUT << "\n";
- MBB->remove(MI);
- return true;
-}
-
-/// runOnMachineFunction - Reduce subregister inserts and extracts to register
-/// copies.
-///
-bool LowerSubregsInstructionPass::runOnMachineFunction(MachineFunction &MF) {
- DOUT << "Machine Function\n";
-
- bool MadeChange = false;
-
- DOUT << "********** LOWERING SUBREG INSTRS **********\n";
- DOUT << "********** Function: " << MF.getFunction()->getName() << '\n';
-
- for (MachineFunction::iterator mbbi = MF.begin(), mbbe = MF.end();
- mbbi != mbbe; ++mbbi) {
- for (MachineBasicBlock::iterator mi = mbbi->begin(), me = mbbi->end();
- mi != me;) {
- MachineInstr *MI = mi++;
-
- if (MI->getOpcode() == TargetInstrInfo::EXTRACT_SUBREG) {
- MadeChange |= LowerExtract(MI);
- } else if (MI->getOpcode() == TargetInstrInfo::INSERT_SUBREG) {
- MadeChange |= LowerInsert(MI);
- } else if (MI->getOpcode() == TargetInstrInfo::SUBREG_TO_REG) {
- MadeChange |= LowerSubregToReg(MI);
- }
- }
- }
-
- return MadeChange;
-}
diff --git a/release_23/lib/CodeGen/MachOWriter.cpp b/release_23/lib/CodeGen/MachOWriter.cpp
deleted file mode 100644
index 2726f706d7f0..000000000000
--- a/release_23/lib/CodeGen/MachOWriter.cpp
+++ /dev/null
@@ -1,963 +0,0 @@
-//===-- MachOWriter.cpp - Target-independent Mach-O Writer code -----------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the target-independent Mach-O writer. This file writes
-// out the Mach-O file in the following order:
-//
-// #1 FatHeader (universal-only)
-// #2 FatArch (universal-only, 1 per universal arch)
-// Per arch:
-// #3 Header
-// #4 Load Commands
-// #5 Sections
-// #6 Relocations
-// #7 Symbols
-// #8 Strings
-//
-//===----------------------------------------------------------------------===//
-
-#include "MachOWriter.h"
-#include "llvm/Constants.h"
-#include "llvm/DerivedTypes.h"
-#include "llvm/Module.h"
-#include "llvm/PassManager.h"
-#include "llvm/CodeGen/FileWriters.h"
-#include "llvm/CodeGen/MachineCodeEmitter.h"
-#include "llvm/CodeGen/MachineConstantPool.h"
-#include "llvm/CodeGen/MachineJumpTableInfo.h"
-#include "llvm/Target/TargetAsmInfo.h"
-#include "llvm/Target/TargetJITInfo.h"
-#include "llvm/Support/Mangler.h"
-#include "llvm/Support/MathExtras.h"
-#include "llvm/Support/OutputBuffer.h"
-#include "llvm/Support/Streams.h"
-#include <algorithm>
-#include <cstring>
-using namespace llvm;
-
-/// AddMachOWriter - Concrete function to add the Mach-O writer to the function
-/// pass manager.
-MachineCodeEmitter *llvm::AddMachOWriter(PassManagerBase &PM,
- std::ostream &O,
- TargetMachine &TM) {
- MachOWriter *MOW = new MachOWriter(O, TM);
- PM.add(MOW);
- return &MOW->getMachineCodeEmitter();
-}
-
-//===----------------------------------------------------------------------===//
-// MachOCodeEmitter Implementation
-//===----------------------------------------------------------------------===//
-
-namespace llvm {
- /// MachOCodeEmitter - This class is used by the MachOWriter to emit the code
- /// for functions to the Mach-O file.
- class MachOCodeEmitter : public MachineCodeEmitter {
- MachOWriter &MOW;
-
- /// Target machine description.
- TargetMachine &TM;
-
- /// is64Bit/isLittleEndian - This information is inferred from the target
- /// machine directly, indicating what header values and flags to set.
- bool is64Bit, isLittleEndian;
-
- /// Relocations - These are the relocations that the function needs, as
- /// emitted.
- std::vector<MachineRelocation> Relocations;
-
- /// CPLocations - This is a map of constant pool indices to offsets from the
- /// start of the section for that constant pool index.
- std::vector<intptr_t> CPLocations;
-
- /// CPSections - This is a map of constant pool indices to the MachOSection
- /// containing the constant pool entry for that index.
- std::vector<unsigned> CPSections;
-
- /// JTLocations - This is a map of jump table indices to offsets from the
- /// start of the section for that jump table index.
- std::vector<intptr_t> JTLocations;
-
- /// MBBLocations - This vector is a mapping from MBB ID's to their address.
- /// It is filled in by the StartMachineBasicBlock callback and queried by
- /// the getMachineBasicBlockAddress callback.
- std::vector<intptr_t> MBBLocations;
-
- public:
- MachOCodeEmitter(MachOWriter &mow) : MOW(mow), TM(MOW.TM) {
- is64Bit = TM.getTargetData()->getPointerSizeInBits() == 64;
- isLittleEndian = TM.getTargetData()->isLittleEndian();
- }
-
- virtual void startFunction(MachineFunction &MF);
- virtual bool finishFunction(MachineFunction &MF);
-
- virtual void addRelocation(const MachineRelocation &MR) {
- Relocations.push_back(MR);
- }
-
- void emitConstantPool(MachineConstantPool *MCP);
- void emitJumpTables(MachineJumpTableInfo *MJTI);
-
- virtual intptr_t getConstantPoolEntryAddress(unsigned Index) const {
- assert(CPLocations.size() > Index && "CP not emitted!");
- return CPLocations[Index];
- }
- virtual intptr_t getJumpTableEntryAddress(unsigned Index) const {
- assert(JTLocations.size() > Index && "JT not emitted!");
- return JTLocations[Index];
- }
-
- virtual void StartMachineBasicBlock(MachineBasicBlock *MBB) {
- if (MBBLocations.size() <= (unsigned)MBB->getNumber())
- MBBLocations.resize((MBB->getNumber()+1)*2);
- MBBLocations[MBB->getNumber()] = getCurrentPCOffset();
- }
-
- virtual intptr_t getMachineBasicBlockAddress(MachineBasicBlock *MBB) const {
- assert(MBBLocations.size() > (unsigned)MBB->getNumber() &&
- MBBLocations[MBB->getNumber()] && "MBB not emitted!");
- return MBBLocations[MBB->getNumber()];
- }
-
- virtual intptr_t getLabelAddress(uint64_t Label) const {
- assert(0 && "get Label not implemented");
- abort();
- return 0;
- }
-
- virtual void emitLabel(uint64_t LabelID) {
- assert(0 && "emit Label not implemented");
- abort();
- }
-
-
- virtual void setModuleInfo(llvm::MachineModuleInfo* MMI) { }
-
- /// JIT SPECIFIC FUNCTIONS - DO NOT IMPLEMENT THESE HERE!
- virtual void startFunctionStub(const GlobalValue* F, unsigned StubSize,
- unsigned Alignment = 1) {
- assert(0 && "JIT specific function called!");
- abort();
- }
- virtual void *finishFunctionStub(const GlobalValue* F) {
- assert(0 && "JIT specific function called!");
- abort();
- return 0;
- }
- };
-}
-
-/// startFunction - This callback is invoked when a new machine function is
-/// about to be emitted.
-void MachOCodeEmitter::startFunction(MachineFunction &MF) {
- const TargetData *TD = TM.getTargetData();
- const Function *F = MF.getFunction();
-
- // Align the output buffer to the appropriate alignment, power of 2.
- unsigned FnAlign = F->getAlignment();
- unsigned TDAlign = TD->getPrefTypeAlignment(F->getType());
- unsigned Align = Log2_32(std::max(FnAlign, TDAlign));
- assert(!(Align & (Align-1)) && "Alignment is not a power of two!");
-
- // Get the Mach-O Section that this function belongs in.
- MachOWriter::MachOSection *MOS = MOW.getTextSection();
-
- // FIXME: better memory management
- MOS->SectionData.reserve(4096);
- BufferBegin = &MOS->SectionData[0];
- BufferEnd = BufferBegin + MOS->SectionData.capacity();
-
- // Upgrade the section alignment if required.
- if (MOS->align < Align) MOS->align = Align;
-
- // Round the size up to the correct alignment for starting the new function.
- if ((MOS->size & ((1 << Align) - 1)) != 0) {
- MOS->size += (1 << Align);
- MOS->size &= ~((1 << Align) - 1);
- }
-
- // FIXME: Using MOS->size directly here instead of calculating it from the
- // output buffer size (impossible because the code emitter deals only in raw
- // bytes) forces us to manually synchronize size and write padding zero bytes
- // to the output buffer for all non-text sections. For text sections, we do
- // not synchonize the output buffer, and we just blow up if anyone tries to
- // write non-code to it. An assert should probably be added to
- // AddSymbolToSection to prevent calling it on the text section.
- CurBufferPtr = BufferBegin + MOS->size;
-
- // Clear per-function data structures.
- CPLocations.clear();
- CPSections.clear();
- JTLocations.clear();
- MBBLocations.clear();
-}
-
-/// finishFunction - This callback is invoked after the function is completely
-/// finished.
-bool MachOCodeEmitter::finishFunction(MachineFunction &MF) {
- // Get the Mach-O Section that this function belongs in.
- MachOWriter::MachOSection *MOS = MOW.getTextSection();
-
- // Get a symbol for the function to add to the symbol table
- // FIXME: it seems like we should call something like AddSymbolToSection
- // in startFunction rather than changing the section size and symbol n_value
- // here.
- const GlobalValue *FuncV = MF.getFunction();
- MachOSym FnSym(FuncV, MOW.Mang->getValueName(FuncV), MOS->Index, TM);
- FnSym.n_value = MOS->size;
- MOS->size = CurBufferPtr - BufferBegin;
-
- // Emit constant pool to appropriate section(s)
- emitConstantPool(MF.getConstantPool());
-
- // Emit jump tables to appropriate section
- emitJumpTables(MF.getJumpTableInfo());
-
- // If we have emitted any relocations to function-specific objects such as
- // basic blocks, constant pools entries, or jump tables, record their
- // addresses now so that we can rewrite them with the correct addresses
- // later.
- for (unsigned i = 0, e = Relocations.size(); i != e; ++i) {
- MachineRelocation &MR = Relocations[i];
- intptr_t Addr;
-
- if (MR.isBasicBlock()) {
- Addr = getMachineBasicBlockAddress(MR.getBasicBlock());
- MR.setConstantVal(MOS->Index);
- MR.setResultPointer((void*)Addr);
- } else if (MR.isJumpTableIndex()) {
- Addr = getJumpTableEntryAddress(MR.getJumpTableIndex());
- MR.setConstantVal(MOW.getJumpTableSection()->Index);
- MR.setResultPointer((void*)Addr);
- } else if (MR.isConstantPoolIndex()) {
- Addr = getConstantPoolEntryAddress(MR.getConstantPoolIndex());
- MR.setConstantVal(CPSections[MR.getConstantPoolIndex()]);
- MR.setResultPointer((void*)Addr);
- } else if (MR.isGlobalValue()) {
- // FIXME: This should be a set or something that uniques
- MOW.PendingGlobals.push_back(MR.getGlobalValue());
- } else {
- assert(0 && "Unhandled relocation type");
- }
- MOS->Relocations.push_back(MR);
- }
- Relocations.clear();
-
- // Finally, add it to the symtab.
- MOW.SymbolTable.push_back(FnSym);
- return false;
-}
-
-/// emitConstantPool - For each constant pool entry, figure out which section
-/// the constant should live in, allocate space for it, and emit it to the
-/// Section data buffer.
-void MachOCodeEmitter::emitConstantPool(MachineConstantPool *MCP) {
- const std::vector<MachineConstantPoolEntry> &CP = MCP->getConstants();
- if (CP.empty()) return;
-
- // FIXME: handle PIC codegen
- bool isPIC = TM.getRelocationModel() == Reloc::PIC_;
- assert(!isPIC && "PIC codegen not yet handled for mach-o jump tables!");
-
- // Although there is no strict necessity that I am aware of, we will do what
- // gcc for OS X does and put each constant pool entry in a section of constant
- // objects of a certain size. That means that float constants go in the
- // literal4 section, and double objects go in literal8, etc.
- //
- // FIXME: revisit this decision if we ever do the "stick everything into one
- // "giant object for PIC" optimization.
- for (unsigned i = 0, e = CP.size(); i != e; ++i) {
- const Type *Ty = CP[i].getType();
- unsigned Size = TM.getTargetData()->getABITypeSize(Ty);
-
- MachOWriter::MachOSection *Sec = MOW.getConstSection(CP[i].Val.ConstVal);
- OutputBuffer SecDataOut(Sec->SectionData, is64Bit, isLittleEndian);
-
- CPLocations.push_back(Sec->SectionData.size());
- CPSections.push_back(Sec->Index);
-
- // FIXME: remove when we have unified size + output buffer
- Sec->size += Size;
-
- // Allocate space in the section for the global.
- // FIXME: need alignment?
- // FIXME: share between here and AddSymbolToSection?
- for (unsigned j = 0; j < Size; ++j)
- SecDataOut.outbyte(0);
-
- MOW.InitMem(CP[i].Val.ConstVal, &Sec->SectionData[0], CPLocations[i],
- TM.getTargetData(), Sec->Relocations);
- }
-}
-
-/// emitJumpTables - Emit all the jump tables for a given jump table info
-/// record to the appropriate section.
-void MachOCodeEmitter::emitJumpTables(MachineJumpTableInfo *MJTI) {
- const std::vector<MachineJumpTableEntry> &JT = MJTI->getJumpTables();
- if (JT.empty()) return;
-
- // FIXME: handle PIC codegen
- bool isPIC = TM.getRelocationModel() == Reloc::PIC_;
- assert(!isPIC && "PIC codegen not yet handled for mach-o jump tables!");
-
- MachOWriter::MachOSection *Sec = MOW.getJumpTableSection();
- unsigned TextSecIndex = MOW.getTextSection()->Index;
- OutputBuffer SecDataOut(Sec->SectionData, is64Bit, isLittleEndian);
-
- for (unsigned i = 0, e = JT.size(); i != e; ++i) {
- // For each jump table, record its offset from the start of the section,
- // reserve space for the relocations to the MBBs, and add the relocations.
- const std::vector<MachineBasicBlock*> &MBBs = JT[i].MBBs;
- JTLocations.push_back(Sec->SectionData.size());
- for (unsigned mi = 0, me = MBBs.size(); mi != me; ++mi) {
- MachineRelocation MR(MOW.GetJTRelocation(Sec->SectionData.size(),
- MBBs[mi]));
- MR.setResultPointer((void *)JTLocations[i]);
- MR.setConstantVal(TextSecIndex);
- Sec->Relocations.push_back(MR);
- SecDataOut.outaddr(0);
- }
- }
- // FIXME: remove when we have unified size + output buffer
- Sec->size = Sec->SectionData.size();
-}
-
-//===----------------------------------------------------------------------===//
-// MachOWriter Implementation
-//===----------------------------------------------------------------------===//
-
-char MachOWriter::ID = 0;
-MachOWriter::MachOWriter(std::ostream &o, TargetMachine &tm)
- : MachineFunctionPass((intptr_t)&ID), O(o), TM(tm) {
- is64Bit = TM.getTargetData()->getPointerSizeInBits() == 64;
- isLittleEndian = TM.getTargetData()->isLittleEndian();
-
- // Create the machine code emitter object for this target.
- MCE = new MachOCodeEmitter(*this);
-}
-
-MachOWriter::~MachOWriter() {
- delete MCE;
-}
-
-void MachOWriter::AddSymbolToSection(MachOSection *Sec, GlobalVariable *GV) {
- const Type *Ty = GV->getType()->getElementType();
- unsigned Size = TM.getTargetData()->getABITypeSize(Ty);
- unsigned Align = TM.getTargetData()->getPreferredAlignment(GV);
-
- // Reserve space in the .bss section for this symbol while maintaining the
- // desired section alignment, which must be at least as much as required by
- // this symbol.
- OutputBuffer SecDataOut(Sec->SectionData, is64Bit, isLittleEndian);
-
- if (Align) {
- uint64_t OrigSize = Sec->size;
- Align = Log2_32(Align);
- Sec->align = std::max(unsigned(Sec->align), Align);
- Sec->size = (Sec->size + Align - 1) & ~(Align-1);
-
- // Add alignment padding to buffer as well.
- // FIXME: remove when we have unified size + output buffer
- unsigned AlignedSize = Sec->size - OrigSize;
- for (unsigned i = 0; i < AlignedSize; ++i)
- SecDataOut.outbyte(0);
- }
- // Globals without external linkage apparently do not go in the symbol table.
- if (GV->getLinkage() != GlobalValue::InternalLinkage) {
- MachOSym Sym(GV, Mang->getValueName(GV), Sec->Index, TM);
- Sym.n_value = Sec->size;
- SymbolTable.push_back(Sym);
- }
-
- // Record the offset of the symbol, and then allocate space for it.
- // FIXME: remove when we have unified size + output buffer
- Sec->size += Size;
-
- // Now that we know what section the GlovalVariable is going to be emitted
- // into, update our mappings.
- // FIXME: We may also need to update this when outputting non-GlobalVariable
- // GlobalValues such as functions.
- GVSection[GV] = Sec;
- GVOffset[GV] = Sec->SectionData.size();
-
- // Allocate space in the section for the global.
- for (unsigned i = 0; i < Size; ++i)
- SecDataOut.outbyte(0);
-}
-
-void MachOWriter::EmitGlobal(GlobalVariable *GV) {
- const Type *Ty = GV->getType()->getElementType();
- unsigned Size = TM.getTargetData()->getABITypeSize(Ty);
- bool NoInit = !GV->hasInitializer();
-
- // If this global has a zero initializer, it is part of the .bss or common
- // section.
- if (NoInit || GV->getInitializer()->isNullValue()) {
- // If this global is part of the common block, add it now. Variables are
- // part of the common block if they are zero initialized and allowed to be
- // merged with other symbols.
- if (NoInit || GV->hasLinkOnceLinkage() || GV->hasWeakLinkage()) {
- MachOSym ExtOrCommonSym(GV, Mang->getValueName(GV), MachOSym::NO_SECT,TM);
- // For undefined (N_UNDF) external (N_EXT) types, n_value is the size in
- // bytes of the symbol.
- ExtOrCommonSym.n_value = Size;
- SymbolTable.push_back(ExtOrCommonSym);
- // Remember that we've seen this symbol
- GVOffset[GV] = Size;
- return;
- }
- // Otherwise, this symbol is part of the .bss section.
- MachOSection *BSS = getBSSSection();
- AddSymbolToSection(BSS, GV);
- return;
- }
-
- // Scalar read-only data goes in a literal section if the scalar is 4, 8, or
- // 16 bytes, or a cstring. Other read only data goes into a regular const
- // section. Read-write data goes in the data section.
- MachOSection *Sec = GV->isConstant() ? getConstSection(GV->getInitializer()) :
- getDataSection();
- AddSymbolToSection(Sec, GV);
- InitMem(GV->getInitializer(), &Sec->SectionData[0], GVOffset[GV],
- TM.getTargetData(), Sec->Relocations);
-}
-
-
-bool MachOWriter::runOnMachineFunction(MachineFunction &MF) {
- // Nothing to do here, this is all done through the MCE object.
- return false;
-}
-
-bool MachOWriter::doInitialization(Module &M) {
- // Set the magic value, now that we know the pointer size and endianness
- Header.setMagic(isLittleEndian, is64Bit);
-
- // Set the file type
- // FIXME: this only works for object files, we do not support the creation
- // of dynamic libraries or executables at this time.
- Header.filetype = MachOHeader::MH_OBJECT;
-
- Mang = new Mangler(M);
- return false;
-}
-
-/// doFinalization - Now that the module has been completely processed, emit
-/// the Mach-O file to 'O'.
-bool MachOWriter::doFinalization(Module &M) {
- // FIXME: we don't handle debug info yet, we should probably do that.
-
- // Okay, the.text section has been completed, build the .data, .bss, and
- // "common" sections next.
- for (Module::global_iterator I = M.global_begin(), E = M.global_end();
- I != E; ++I)
- EmitGlobal(I);
-
- // Emit the header and load commands.
- EmitHeaderAndLoadCommands();
-
- // Emit the various sections and their relocation info.
- EmitSections();
-
- // Write the symbol table and the string table to the end of the file.
- O.write((char*)&SymT[0], SymT.size());
- O.write((char*)&StrT[0], StrT.size());
-
- // We are done with the abstract symbols.
- SectionList.clear();
- SymbolTable.clear();
- DynamicSymbolTable.clear();
-
- // Release the name mangler object.
- delete Mang; Mang = 0;
- return false;
-}
-
-void MachOWriter::EmitHeaderAndLoadCommands() {
- // Step #0: Fill in the segment load command size, since we need it to figure
- // out the rest of the header fields
- MachOSegment SEG("", is64Bit);
- SEG.nsects = SectionList.size();
- SEG.cmdsize = SEG.cmdSize(is64Bit) +
- SEG.nsects * SectionList[0]->cmdSize(is64Bit);
-
- // Step #1: calculate the number of load commands. We always have at least
- // one, for the LC_SEGMENT load command, plus two for the normal
- // and dynamic symbol tables, if there are any symbols.
- Header.ncmds = SymbolTable.empty() ? 1 : 3;
-
- // Step #2: calculate the size of the load commands
- Header.sizeofcmds = SEG.cmdsize;
- if (!SymbolTable.empty())
- Header.sizeofcmds += SymTab.cmdsize + DySymTab.cmdsize;
-
- // Step #3: write the header to the file
- // Local alias to shortenify coming code.
- DataBuffer &FH = Header.HeaderData;
- OutputBuffer FHOut(FH, is64Bit, isLittleEndian);
-
- FHOut.outword(Header.magic);
- FHOut.outword(TM.getMachOWriterInfo()->getCPUType());
- FHOut.outword(TM.getMachOWriterInfo()->getCPUSubType());
- FHOut.outword(Header.filetype);
- FHOut.outword(Header.ncmds);
- FHOut.outword(Header.sizeofcmds);
- FHOut.outword(Header.flags);
- if (is64Bit)
- FHOut.outword(Header.reserved);
-
- // Step #4: Finish filling in the segment load command and write it out
- for (std::vector<MachOSection*>::iterator I = SectionList.begin(),
- E = SectionList.end(); I != E; ++I)
- SEG.filesize += (*I)->size;
-
- SEG.vmsize = SEG.filesize;
- SEG.fileoff = Header.cmdSize(is64Bit) + Header.sizeofcmds;
-
- FHOut.outword(SEG.cmd);
- FHOut.outword(SEG.cmdsize);
- FHOut.outstring(SEG.segname, 16);
- FHOut.outaddr(SEG.vmaddr);
- FHOut.outaddr(SEG.vmsize);
- FHOut.outaddr(SEG.fileoff);
- FHOut.outaddr(SEG.filesize);
- FHOut.outword(SEG.maxprot);
- FHOut.outword(SEG.initprot);
- FHOut.outword(SEG.nsects);
- FHOut.outword(SEG.flags);
-
- // Step #5: Finish filling in the fields of the MachOSections
- uint64_t currentAddr = 0;
- for (std::vector<MachOSection*>::iterator I = SectionList.begin(),
- E = SectionList.end(); I != E; ++I) {
- MachOSection *MOS = *I;
- MOS->addr = currentAddr;
- MOS->offset = currentAddr + SEG.fileoff;
-
- // FIXME: do we need to do something with alignment here?
- currentAddr += MOS->size;
- }
-
- // Step #6: Emit the symbol table to temporary buffers, so that we know the
- // size of the string table when we write the next load command. This also
- // sorts and assigns indices to each of the symbols, which is necessary for
- // emitting relocations to externally-defined objects.
- BufferSymbolAndStringTable();
-
- // Step #7: Calculate the number of relocations for each section and write out
- // the section commands for each section
- currentAddr += SEG.fileoff;
- for (std::vector<MachOSection*>::iterator I = SectionList.begin(),
- E = SectionList.end(); I != E; ++I) {
- MachOSection *MOS = *I;
- // Convert the relocations to target-specific relocations, and fill in the
- // relocation offset for this section.
- CalculateRelocations(*MOS);
- MOS->reloff = MOS->nreloc ? currentAddr : 0;
- currentAddr += MOS->nreloc * 8;
-
- // write the finalized section command to the output buffer
- FHOut.outstring(MOS->sectname, 16);
- FHOut.outstring(MOS->segname, 16);
- FHOut.outaddr(MOS->addr);
- FHOut.outaddr(MOS->size);
- FHOut.outword(MOS->offset);
- FHOut.outword(MOS->align);
- FHOut.outword(MOS->reloff);
- FHOut.outword(MOS->nreloc);
- FHOut.outword(MOS->flags);
- FHOut.outword(MOS->reserved1);
- FHOut.outword(MOS->reserved2);
- if (is64Bit)
- FHOut.outword(MOS->reserved3);
- }
-
- // Step #8: Emit LC_SYMTAB/LC_DYSYMTAB load commands
- SymTab.symoff = currentAddr;
- SymTab.nsyms = SymbolTable.size();
- SymTab.stroff = SymTab.symoff + SymT.size();
- SymTab.strsize = StrT.size();
- FHOut.outword(SymTab.cmd);
- FHOut.outword(SymTab.cmdsize);
- FHOut.outword(SymTab.symoff);
- FHOut.outword(SymTab.nsyms);
- FHOut.outword(SymTab.stroff);
- FHOut.outword(SymTab.strsize);
-
- // FIXME: set DySymTab fields appropriately
- // We should probably just update these in BufferSymbolAndStringTable since
- // thats where we're partitioning up the different kinds of symbols.
- FHOut.outword(DySymTab.cmd);
- FHOut.outword(DySymTab.cmdsize);
- FHOut.outword(DySymTab.ilocalsym);
- FHOut.outword(DySymTab.nlocalsym);
- FHOut.outword(DySymTab.iextdefsym);
- FHOut.outword(DySymTab.nextdefsym);
- FHOut.outword(DySymTab.iundefsym);
- FHOut.outword(DySymTab.nundefsym);
- FHOut.outword(DySymTab.tocoff);
- FHOut.outword(DySymTab.ntoc);
- FHOut.outword(DySymTab.modtaboff);
- FHOut.outword(DySymTab.nmodtab);
- FHOut.outword(DySymTab.extrefsymoff);
- FHOut.outword(DySymTab.nextrefsyms);
- FHOut.outword(DySymTab.indirectsymoff);
- FHOut.outword(DySymTab.nindirectsyms);
- FHOut.outword(DySymTab.extreloff);
- FHOut.outword(DySymTab.nextrel);
- FHOut.outword(DySymTab.locreloff);
- FHOut.outword(DySymTab.nlocrel);
-
- O.write((char*)&FH[0], FH.size());
-}
-
-/// EmitSections - Now that we have constructed the file header and load
-/// commands, emit the data for each section to the file.
-void MachOWriter::EmitSections() {
- for (std::vector<MachOSection*>::iterator I = SectionList.begin(),
- E = SectionList.end(); I != E; ++I)
- // Emit the contents of each section
- O.write((char*)&(*I)->SectionData[0], (*I)->size);
- for (std::vector<MachOSection*>::iterator I = SectionList.begin(),
- E = SectionList.end(); I != E; ++I)
- // Emit the relocation entry data for each section.
- O.write((char*)&(*I)->RelocBuffer[0], (*I)->RelocBuffer.size());
-}
-
-/// PartitionByLocal - Simple boolean predicate that returns true if Sym is
-/// a local symbol rather than an external symbol.
-bool MachOWriter::PartitionByLocal(const MachOSym &Sym) {
- return (Sym.n_type & (MachOSym::N_EXT | MachOSym::N_PEXT)) == 0;
-}
-
-/// PartitionByDefined - Simple boolean predicate that returns true if Sym is
-/// defined in this module.
-bool MachOWriter::PartitionByDefined(const MachOSym &Sym) {
- // FIXME: Do N_ABS or N_INDR count as defined?
- return (Sym.n_type & MachOSym::N_SECT) == MachOSym::N_SECT;
-}
-
-/// BufferSymbolAndStringTable - Sort the symbols we encountered and assign them
-/// each a string table index so that they appear in the correct order in the
-/// output file.
-void MachOWriter::BufferSymbolAndStringTable() {
- // The order of the symbol table is:
- // 1. local symbols
- // 2. defined external symbols (sorted by name)
- // 3. undefined external symbols (sorted by name)
-
- // Before sorting the symbols, check the PendingGlobals for any undefined
- // globals that need to be put in the symbol table.
- for (std::vector<GlobalValue*>::iterator I = PendingGlobals.begin(),
- E = PendingGlobals.end(); I != E; ++I) {
- if (GVOffset[*I] == 0 && GVSection[*I] == 0) {
- MachOSym UndfSym(*I, Mang->getValueName(*I), MachOSym::NO_SECT, TM);
- SymbolTable.push_back(UndfSym);
- GVOffset[*I] = -1;
- }
- }
-
- // Sort the symbols by name, so that when we partition the symbols by scope
- // of definition, we won't have to sort by name within each partition.
- std::sort(SymbolTable.begin(), SymbolTable.end(), MachOSymCmp());
-
- // Parition the symbol table entries so that all local symbols come before
- // all symbols with external linkage. { 1 | 2 3 }
- std::partition(SymbolTable.begin(), SymbolTable.end(), PartitionByLocal);
-
- // Advance iterator to beginning of external symbols and partition so that
- // all external symbols defined in this module come before all external
- // symbols defined elsewhere. { 1 | 2 | 3 }
- for (std::vector<MachOSym>::iterator I = SymbolTable.begin(),
- E = SymbolTable.end(); I != E; ++I) {
- if (!PartitionByLocal(*I)) {
- std::partition(I, E, PartitionByDefined);
- break;
- }
- }
-
- // Calculate the starting index for each of the local, extern defined, and
- // undefined symbols, as well as the number of each to put in the LC_DYSYMTAB
- // load command.
- for (std::vector<MachOSym>::iterator I = SymbolTable.begin(),
- E = SymbolTable.end(); I != E; ++I) {
- if (PartitionByLocal(*I)) {
- ++DySymTab.nlocalsym;
- ++DySymTab.iextdefsym;
- ++DySymTab.iundefsym;
- } else if (PartitionByDefined(*I)) {
- ++DySymTab.nextdefsym;
- ++DySymTab.iundefsym;
- } else {
- ++DySymTab.nundefsym;
- }
- }
-
- // Write out a leading zero byte when emitting string table, for n_strx == 0
- // which means an empty string.
- OutputBuffer StrTOut(StrT, is64Bit, isLittleEndian);
- StrTOut.outbyte(0);
-
- // The order of the string table is:
- // 1. strings for external symbols
- // 2. strings for local symbols
- // Since this is the opposite order from the symbol table, which we have just
- // sorted, we can walk the symbol table backwards to output the string table.
- for (std::vector<MachOSym>::reverse_iterator I = SymbolTable.rbegin(),
- E = SymbolTable.rend(); I != E; ++I) {
- if (I->GVName == "") {
- I->n_strx = 0;
- } else {
- I->n_strx = StrT.size();
- StrTOut.outstring(I->GVName, I->GVName.length()+1);
- }
- }
-
- OutputBuffer SymTOut(SymT, is64Bit, isLittleEndian);
-
- unsigned index = 0;
- for (std::vector<MachOSym>::iterator I = SymbolTable.begin(),
- E = SymbolTable.end(); I != E; ++I, ++index) {
- // Add the section base address to the section offset in the n_value field
- // to calculate the full address.
- // FIXME: handle symbols where the n_value field is not the address
- GlobalValue *GV = const_cast<GlobalValue*>(I->GV);
- if (GV && GVSection[GV])
- I->n_value += GVSection[GV]->addr;
- if (GV && (GVOffset[GV] == -1))
- GVOffset[GV] = index;
-
- // Emit nlist to buffer
- SymTOut.outword(I->n_strx);
- SymTOut.outbyte(I->n_type);
- SymTOut.outbyte(I->n_sect);
- SymTOut.outhalf(I->n_desc);
- SymTOut.outaddr(I->n_value);
- }
-}
-
-/// CalculateRelocations - For each MachineRelocation in the current section,
-/// calculate the index of the section containing the object to be relocated,
-/// and the offset into that section. From this information, create the
-/// appropriate target-specific MachORelocation type and add buffer it to be
-/// written out after we are finished writing out sections.
-void MachOWriter::CalculateRelocations(MachOSection &MOS) {
- for (unsigned i = 0, e = MOS.Relocations.size(); i != e; ++i) {
- MachineRelocation &MR = MOS.Relocations[i];
- unsigned TargetSection = MR.getConstantVal();
- unsigned TargetAddr = 0;
- unsigned TargetIndex = 0;
-
- // This is a scattered relocation entry if it points to a global value with
- // a non-zero offset.
- bool Scattered = false;
- bool Extern = false;
-
- // Since we may not have seen the GlobalValue we were interested in yet at
- // the time we emitted the relocation for it, fix it up now so that it
- // points to the offset into the correct section.
- if (MR.isGlobalValue()) {
- GlobalValue *GV = MR.getGlobalValue();
- MachOSection *MOSPtr = GVSection[GV];
- intptr_t Offset = GVOffset[GV];
-
- // If we have never seen the global before, it must be to a symbol
- // defined in another module (N_UNDF).
- if (!MOSPtr) {
- // FIXME: need to append stub suffix
- Extern = true;
- TargetAddr = 0;
- TargetIndex = GVOffset[GV];
- } else {
- Scattered = TargetSection != 0;
- TargetSection = MOSPtr->Index;
- }
- MR.setResultPointer((void*)Offset);
- }
-
- // If the symbol is locally defined, pass in the address of the section and
- // the section index to the code which will generate the target relocation.
- if (!Extern) {
- MachOSection &To = *SectionList[TargetSection - 1];
- TargetAddr = To.addr;
- TargetIndex = To.Index;
- }
-
- OutputBuffer RelocOut(MOS.RelocBuffer, is64Bit, isLittleEndian);
- OutputBuffer SecOut(MOS.SectionData, is64Bit, isLittleEndian);
-
- MOS.nreloc += GetTargetRelocation(MR, MOS.Index, TargetAddr, TargetIndex,
- RelocOut, SecOut, Scattered, Extern);
- }
-}
-
-// InitMem - Write the value of a Constant to the specified memory location,
-// converting it into bytes and relocations.
-void MachOWriter::InitMem(const Constant *C, void *Addr, intptr_t Offset,
- const TargetData *TD,
- std::vector<MachineRelocation> &MRs) {
- typedef std::pair<const Constant*, intptr_t> CPair;
- std::vector<CPair> WorkList;
-
- WorkList.push_back(CPair(C,(intptr_t)Addr + Offset));
-
- intptr_t ScatteredOffset = 0;
-
- while (!WorkList.empty()) {
- const Constant *PC = WorkList.back().first;
- intptr_t PA = WorkList.back().second;
- WorkList.pop_back();
-
- if (isa<UndefValue>(PC)) {
- continue;
- } else if (const ConstantVector *CP = dyn_cast<ConstantVector>(PC)) {
- unsigned ElementSize =
- TD->getABITypeSize(CP->getType()->getElementType());
- for (unsigned i = 0, e = CP->getNumOperands(); i != e; ++i)
- WorkList.push_back(CPair(CP->getOperand(i), PA+i*ElementSize));
- } else if (const ConstantExpr *CE = dyn_cast<ConstantExpr>(PC)) {
- //
- // FIXME: Handle ConstantExpression. See EE::getConstantValue()
- //
- switch (CE->getOpcode()) {
- case Instruction::GetElementPtr: {
- SmallVector<Value*, 8> Indices(CE->op_begin()+1, CE->op_end());
- ScatteredOffset = TD->getIndexedOffset(CE->getOperand(0)->getType(),
- &Indices[0], Indices.size());
- WorkList.push_back(CPair(CE->getOperand(0), PA));
- break;
- }
- case Instruction::Add:
- default:
- cerr << "ConstantExpr not handled as global var init: " << *CE << "\n";
- abort();
- break;
- }
- } else if (PC->getType()->isFirstClassType()) {
- unsigned char *ptr = (unsigned char *)PA;
- switch (PC->getType()->getTypeID()) {
- case Type::IntegerTyID: {
- unsigned NumBits = cast<IntegerType>(PC->getType())->getBitWidth();
- uint64_t val = cast<ConstantInt>(PC)->getZExtValue();
- if (NumBits <= 8)
- ptr[0] = val;
- else if (NumBits <= 16) {
- if (TD->isBigEndian())
- val = ByteSwap_16(val);
- ptr[0] = val;
- ptr[1] = val >> 8;
- } else if (NumBits <= 32) {
- if (TD->isBigEndian())
- val = ByteSwap_32(val);
- ptr[0] = val;
- ptr[1] = val >> 8;
- ptr[2] = val >> 16;
- ptr[3] = val >> 24;
- } else if (NumBits <= 64) {
- if (TD->isBigEndian())
- val = ByteSwap_64(val);
- ptr[0] = val;
- ptr[1] = val >> 8;
- ptr[2] = val >> 16;
- ptr[3] = val >> 24;
- ptr[4] = val >> 32;
- ptr[5] = val >> 40;
- ptr[6] = val >> 48;
- ptr[7] = val >> 56;
- } else {
- assert(0 && "Not implemented: bit widths > 64");
- }
- break;
- }
- case Type::FloatTyID: {
- uint32_t val = cast<ConstantFP>(PC)->getValueAPF().convertToAPInt().
- getZExtValue();
- if (TD->isBigEndian())
- val = ByteSwap_32(val);
- ptr[0] = val;
- ptr[1] = val >> 8;
- ptr[2] = val >> 16;
- ptr[3] = val >> 24;
- break;
- }
- case Type::DoubleTyID: {
- uint64_t val = cast<ConstantFP>(PC)->getValueAPF().convertToAPInt().
- getZExtValue();
- if (TD->isBigEndian())
- val = ByteSwap_64(val);
- ptr[0] = val;
- ptr[1] = val >> 8;
- ptr[2] = val >> 16;
- ptr[3] = val >> 24;
- ptr[4] = val >> 32;
- ptr[5] = val >> 40;
- ptr[6] = val >> 48;
- ptr[7] = val >> 56;
- break;
- }
- case Type::PointerTyID:
- if (isa<ConstantPointerNull>(PC))
- memset(ptr, 0, TD->getPointerSize());
- else if (const GlobalValue* GV = dyn_cast<GlobalValue>(PC)) {
- // FIXME: what about function stubs?
- MRs.push_back(MachineRelocation::getGV(PA-(intptr_t)Addr,
- MachineRelocation::VANILLA,
- const_cast<GlobalValue*>(GV),
- ScatteredOffset));
- ScatteredOffset = 0;
- } else
- assert(0 && "Unknown constant pointer type!");
- break;
- default:
- cerr << "ERROR: Constant unimp for type: " << *PC->getType() << "\n";
- abort();
- }
- } else if (isa<ConstantAggregateZero>(PC)) {
- memset((void*)PA, 0, (size_t)TD->getABITypeSize(PC->getType()));
- } else if (const ConstantArray *CPA = dyn_cast<ConstantArray>(PC)) {
- unsigned ElementSize =
- TD->getABITypeSize(CPA->getType()->getElementType());
- for (unsigned i = 0, e = CPA->getNumOperands(); i != e; ++i)
- WorkList.push_back(CPair(CPA->getOperand(i), PA+i*ElementSize));
- } else if (const ConstantStruct *CPS = dyn_cast<ConstantStruct>(PC)) {
- const StructLayout *SL =
- TD->getStructLayout(cast<StructType>(CPS->getType()));
- for (unsigned i = 0, e = CPS->getNumOperands(); i != e; ++i)
- WorkList.push_back(CPair(CPS->getOperand(i),
- PA+SL->getElementOffset(i)));
- } else {
- cerr << "Bad Type: " << *PC->getType() << "\n";
- assert(0 && "Unknown constant type to initialize memory with!");
- }
- }
-}
-
-MachOSym::MachOSym(const GlobalValue *gv, std::string name, uint8_t sect,
- TargetMachine &TM) :
- GV(gv), n_strx(0), n_type(sect == NO_SECT ? N_UNDF : N_SECT), n_sect(sect),
- n_desc(0), n_value(0) {
-
- const TargetAsmInfo *TAI = TM.getTargetAsmInfo();
-
- switch (GV->getLinkage()) {
- default:
- assert(0 && "Unexpected linkage type!");
- break;
- case GlobalValue::WeakLinkage:
- case GlobalValue::LinkOnceLinkage:
- assert(!isa<Function>(gv) && "Unexpected linkage type for Function!");
- case GlobalValue::ExternalLinkage:
- GVName = TAI->getGlobalPrefix() + name;
- n_type |= GV->hasHiddenVisibility() ? N_PEXT : N_EXT;
- break;
- case GlobalValue::InternalLinkage:
- GVName = TAI->getGlobalPrefix() + name;
- break;
- }
-}
diff --git a/release_23/lib/CodeGen/MachOWriter.h b/release_23/lib/CodeGen/MachOWriter.h
deleted file mode 100644
index 44fa7d4d4492..000000000000
--- a/release_23/lib/CodeGen/MachOWriter.h
+++ /dev/null
@@ -1,628 +0,0 @@
-//=== MachOWriter.h - Target-independent Mach-O writer support --*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines the MachOWriter class.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef MACHOWRITER_H
-#define MACHOWRITER_H
-
-#include "llvm/Constants.h"
-#include "llvm/DerivedTypes.h"
-#include "llvm/CodeGen/MachineFunctionPass.h"
-#include "llvm/CodeGen/MachineRelocation.h"
-#include "llvm/Target/TargetData.h"
-#include "llvm/Target/TargetMachine.h"
-#include "llvm/Target/TargetMachOWriterInfo.h"
-#include <map>
-
-namespace llvm {
- class GlobalVariable;
- class Mangler;
- class MachineCodeEmitter;
- class MachOCodeEmitter;
- class OutputBuffer;
-
- /// MachOSym - This struct contains information about each symbol that is
- /// added to logical symbol table for the module. This is eventually
- /// turned into a real symbol table in the file.
- struct MachOSym {
- const GlobalValue *GV; // The global value this corresponds to.
- std::string GVName; // The mangled name of the global value.
- uint32_t n_strx; // index into the string table
- uint8_t n_type; // type flag
- uint8_t n_sect; // section number or NO_SECT
- int16_t n_desc; // see <mach-o/stab.h>
- uint64_t n_value; // value for this symbol (or stab offset)
-
- // Constants for the n_sect field
- // see <mach-o/nlist.h>
- enum { NO_SECT = 0 }; // symbol is not in any section
-
- // Constants for the n_type field
- // see <mach-o/nlist.h>
- enum { N_UNDF = 0x0, // undefined, n_sect == NO_SECT
- N_ABS = 0x2, // absolute, n_sect == NO_SECT
- N_SECT = 0xe, // defined in section number n_sect
- N_PBUD = 0xc, // prebound undefined (defined in a dylib)
- N_INDR = 0xa // indirect
- };
- // The following bits are OR'd into the types above. For example, a type
- // of 0x0f would be an external N_SECT symbol (0x0e | 0x01).
- enum { N_EXT = 0x01, // external symbol bit
- N_PEXT = 0x10 // private external symbol bit
- };
-
- // Constants for the n_desc field
- // see <mach-o/loader.h>
- enum { REFERENCE_FLAG_UNDEFINED_NON_LAZY = 0,
- REFERENCE_FLAG_UNDEFINED_LAZY = 1,
- REFERENCE_FLAG_DEFINED = 2,
- REFERENCE_FLAG_PRIVATE_DEFINED = 3,
- REFERENCE_FLAG_PRIVATE_UNDEFINED_NON_LAZY = 4,
- REFERENCE_FLAG_PRIVATE_UNDEFINED_LAZY = 5
- };
- enum { N_NO_DEAD_STRIP = 0x0020, // symbol is not to be dead stripped
- N_WEAK_REF = 0x0040, // symbol is weak referenced
- N_WEAK_DEF = 0x0080 // coalesced symbol is a weak definition
- };
-
- MachOSym(const GlobalValue *gv, std::string name, uint8_t sect,
- TargetMachine &TM);
- };
-
- /// MachOWriter - This class implements the common target-independent code for
- /// writing Mach-O files. Targets should derive a class from this to
- /// parameterize the output format.
- ///
- class MachOWriter : public MachineFunctionPass {
- friend class MachOCodeEmitter;
- public:
- static char ID;
- MachineCodeEmitter &getMachineCodeEmitter() const {
- return *(MachineCodeEmitter*)MCE;
- }
-
- MachOWriter(std::ostream &O, TargetMachine &TM);
- virtual ~MachOWriter();
-
- virtual const char *getPassName() const {
- return "Mach-O Writer";
- }
-
- typedef std::vector<unsigned char> DataBuffer;
- protected:
- /// Output stream to send the resultant object file to.
- ///
- std::ostream &O;
-
- /// Target machine description.
- ///
- TargetMachine &TM;
-
- /// Mang - The object used to perform name mangling for this module.
- ///
- Mangler *Mang;
-
- /// MCE - The MachineCodeEmitter object that we are exposing to emit machine
- /// code for functions to the .o file.
- MachOCodeEmitter *MCE;
-
- /// is64Bit/isLittleEndian - This information is inferred from the target
- /// machine directly, indicating what header values and flags to set.
- bool is64Bit, isLittleEndian;
-
- /// doInitialization - Emit the file header and all of the global variables
- /// for the module to the Mach-O file.
- bool doInitialization(Module &M);
-
- bool runOnMachineFunction(MachineFunction &MF);
-
- /// doFinalization - Now that the module has been completely processed, emit
- /// the Mach-O file to 'O'.
- bool doFinalization(Module &M);
-
- /// MachOHeader - This struct contains the header information about a
- /// specific architecture type/subtype pair that is emitted to the file.
- struct MachOHeader {
- uint32_t magic; // mach magic number identifier
- uint32_t filetype; // type of file
- uint32_t ncmds; // number of load commands
- uint32_t sizeofcmds; // the size of all the load commands
- uint32_t flags; // flags
- uint32_t reserved; // 64-bit only
-
- /// HeaderData - The actual data for the header which we are building
- /// up for emission to the file.
- DataBuffer HeaderData;
-
- // Constants for the filetype field
- // see <mach-o/loader.h> for additional info on the various types
- enum { MH_OBJECT = 1, // relocatable object file
- MH_EXECUTE = 2, // demand paged executable file
- MH_FVMLIB = 3, // fixed VM shared library file
- MH_CORE = 4, // core file
- MH_PRELOAD = 5, // preloaded executable file
- MH_DYLIB = 6, // dynamically bound shared library
- MH_DYLINKER = 7, // dynamic link editor
- MH_BUNDLE = 8, // dynamically bound bundle file
- MH_DYLIB_STUB = 9, // shared library stub for static linking only
- MH_DSYM = 10 // companion file wiht only debug sections
- };
-
- // Constants for the flags field
- enum { MH_NOUNDEFS = 1 << 0,
- // the object file has no undefined references
- MH_INCRLINK = 1 << 1,
- // the object file is the output of an incremental link against
- // a base file and cannot be link edited again
- MH_DYLDLINK = 1 << 2,
- // the object file is input for the dynamic linker and cannot be
- // statically link edited again.
- MH_BINDATLOAD = 1 << 3,
- // the object file's undefined references are bound by the
- // dynamic linker when loaded.
- MH_PREBOUND = 1 << 4,
- // the file has its dynamic undefined references prebound
- MH_SPLIT_SEGS = 1 << 5,
- // the file has its read-only and read-write segments split
- // see <mach/shared_memory_server.h>
- MH_LAZY_INIT = 1 << 6,
- // the shared library init routine is to be run lazily via
- // catching memory faults to its writable segments (obsolete)
- MH_TWOLEVEL = 1 << 7,
- // the image is using two-level namespace bindings
- MH_FORCE_FLAT = 1 << 8,
- // the executable is forcing all images to use flat namespace
- // bindings.
- MH_NOMULTIDEFS = 1 << 8,
- // this umbrella guarantees no multiple definitions of symbols
- // in its sub-images so the two-level namespace hints can
- // always be used.
- MH_NOFIXPREBINDING = 1 << 10,
- // do not have dyld notify the prebidning agent about this
- // executable.
- MH_PREBINDABLE = 1 << 11,
- // the binary is not prebound but can have its prebinding
- // redone. only used when MH_PREBOUND is not set.
- MH_ALLMODSBOUND = 1 << 12,
- // indicates that this binary binds to all two-level namespace
- // modules of its dependent libraries. Only used when
- // MH_PREBINDABLE and MH_TWOLEVEL are both set.
- MH_SUBSECTIONS_VIA_SYMBOLS = 1 << 13,
- // safe to divide up the sections into sub-sections via symbols
- // for dead code stripping.
- MH_CANONICAL = 1 << 14,
- // the binary has been canonicalized via the unprebind operation
- MH_WEAK_DEFINES = 1 << 15,
- // the final linked image contains external weak symbols
- MH_BINDS_TO_WEAK = 1 << 16,
- // the final linked image uses weak symbols
- MH_ALLOW_STACK_EXECUTION = 1 << 17
- // When this bit is set, all stacks in the task will be given
- // stack execution privilege. Only used in MH_EXECUTE filetype
- };
-
- MachOHeader() : magic(0), filetype(0), ncmds(0), sizeofcmds(0), flags(0),
- reserved(0) { }
-
- /// cmdSize - This routine returns the size of the MachOSection as written
- /// to disk, depending on whether the destination is a 64 bit Mach-O file.
- unsigned cmdSize(bool is64Bit) const {
- if (is64Bit)
- return 8 * sizeof(uint32_t);
- else
- return 7 * sizeof(uint32_t);
- }
-
- /// setMagic - This routine sets the appropriate value for the 'magic'
- /// field based on pointer size and endianness.
- void setMagic(bool isLittleEndian, bool is64Bit) {
- if (isLittleEndian)
- if (is64Bit) magic = 0xcffaedfe;
- else magic = 0xcefaedfe;
- else
- if (is64Bit) magic = 0xfeedfacf;
- else magic = 0xfeedface;
- }
- };
-
- /// Header - An instance of MachOHeader that we will update while we build
- /// the file, and then emit during finalization.
- MachOHeader Header;
-
- /// MachOSegment - This struct contains the necessary information to
- /// emit the load commands for each section in the file.
- struct MachOSegment {
- uint32_t cmd; // LC_SEGMENT or LC_SEGMENT_64
- uint32_t cmdsize; // Total size of this struct and section commands
- std::string segname; // segment name
- uint64_t vmaddr; // address of this segment
- uint64_t vmsize; // size of this segment, may be larger than filesize
- uint64_t fileoff; // offset in file
- uint64_t filesize; // amount to read from file
- uint32_t maxprot; // maximum VM protection
- uint32_t initprot; // initial VM protection
- uint32_t nsects; // number of sections in this segment
- uint32_t flags; // flags
-
- // The following constants are getting pulled in by one of the
- // system headers, which creates a neat clash with the enum.
-#if !defined(VM_PROT_NONE)
-#define VM_PROT_NONE 0x00
-#endif
-#if !defined(VM_PROT_READ)
-#define VM_PROT_READ 0x01
-#endif
-#if !defined(VM_PROT_WRITE)
-#define VM_PROT_WRITE 0x02
-#endif
-#if !defined(VM_PROT_EXECUTE)
-#define VM_PROT_EXECUTE 0x04
-#endif
-#if !defined(VM_PROT_ALL)
-#define VM_PROT_ALL 0x07
-#endif
-
- // Constants for the vm protection fields
- // see <mach-o/vm_prot.h>
- enum { SEG_VM_PROT_NONE = VM_PROT_NONE,
- SEG_VM_PROT_READ = VM_PROT_READ, // read permission
- SEG_VM_PROT_WRITE = VM_PROT_WRITE, // write permission
- SEG_VM_PROT_EXECUTE = VM_PROT_EXECUTE,
- SEG_VM_PROT_ALL = VM_PROT_ALL
- };
-
- // Constants for the cmd field
- // see <mach-o/loader.h>
- enum { LC_SEGMENT = 0x01, // segment of this file to be mapped
- LC_SEGMENT_64 = 0x19 // 64-bit segment of this file to be mapped
- };
-
- /// cmdSize - This routine returns the size of the MachOSection as written
- /// to disk, depending on whether the destination is a 64 bit Mach-O file.
- unsigned cmdSize(bool is64Bit) const {
- if (is64Bit)
- return 6 * sizeof(uint32_t) + 4 * sizeof(uint64_t) + 16;
- else
- return 10 * sizeof(uint32_t) + 16; // addresses only 32 bits
- }
-
- MachOSegment(const std::string &seg, bool is64Bit)
- : cmd(is64Bit ? LC_SEGMENT_64 : LC_SEGMENT), cmdsize(0), segname(seg),
- vmaddr(0), vmsize(0), fileoff(0), filesize(0), maxprot(VM_PROT_ALL),
- initprot(VM_PROT_ALL), nsects(0), flags(0) { }
- };
-
- /// MachOSection - This struct contains information about each section in a
- /// particular segment that is emitted to the file. This is eventually
- /// turned into the SectionCommand in the load command for a particlar
- /// segment.
- struct MachOSection {
- std::string sectname; // name of this section,
- std::string segname; // segment this section goes in
- uint64_t addr; // memory address of this section
- uint64_t size; // size in bytes of this section
- uint32_t offset; // file offset of this section
- uint32_t align; // section alignment (power of 2)
- uint32_t reloff; // file offset of relocation entries
- uint32_t nreloc; // number of relocation entries
- uint32_t flags; // flags (section type and attributes)
- uint32_t reserved1; // reserved (for offset or index)
- uint32_t reserved2; // reserved (for count or sizeof)
- uint32_t reserved3; // reserved (64 bit only)
-
- /// A unique number for this section, which will be used to match symbols
- /// to the correct section.
- uint32_t Index;
-
- /// SectionData - The actual data for this section which we are building
- /// up for emission to the file.
- DataBuffer SectionData;
-
- /// RelocBuffer - A buffer to hold the mach-o relocations before we write
- /// them out at the appropriate location in the file.
- DataBuffer RelocBuffer;
-
- /// Relocations - The relocations that we have encountered so far in this
- /// section that we will need to convert to MachORelocation entries when
- /// the file is written.
- std::vector<MachineRelocation> Relocations;
-
- // Constants for the section types (low 8 bits of flags field)
- // see <mach-o/loader.h>
- enum { S_REGULAR = 0,
- // regular section
- S_ZEROFILL = 1,
- // zero fill on demand section
- S_CSTRING_LITERALS = 2,
- // section with only literal C strings
- S_4BYTE_LITERALS = 3,
- // section with only 4 byte literals
- S_8BYTE_LITERALS = 4,
- // section with only 8 byte literals
- S_LITERAL_POINTERS = 5,
- // section with only pointers to literals
- S_NON_LAZY_SYMBOL_POINTERS = 6,
- // section with only non-lazy symbol pointers
- S_LAZY_SYMBOL_POINTERS = 7,
- // section with only lazy symbol pointers
- S_SYMBOL_STUBS = 8,
- // section with only symbol stubs
- // byte size of stub in the reserved2 field
- S_MOD_INIT_FUNC_POINTERS = 9,
- // section with only function pointers for initialization
- S_MOD_TERM_FUNC_POINTERS = 10,
- // section with only function pointers for termination
- S_COALESCED = 11,
- // section contains symbols that are coalesced
- S_GB_ZEROFILL = 12,
- // zero fill on demand section (that can be larger than 4GB)
- S_INTERPOSING = 13,
- // section with only pairs of function pointers for interposing
- S_16BYTE_LITERALS = 14
- // section with only 16 byte literals
- };
-
- // Constants for the section flags (high 24 bits of flags field)
- // see <mach-o/loader.h>
- enum { S_ATTR_PURE_INSTRUCTIONS = 1 << 31,
- // section contains only true machine instructions
- S_ATTR_NO_TOC = 1 << 30,
- // section contains coalesced symbols that are not to be in a
- // ranlib table of contents
- S_ATTR_STRIP_STATIC_SYMS = 1 << 29,
- // ok to strip static symbols in this section in files with the
- // MY_DYLDLINK flag
- S_ATTR_NO_DEAD_STRIP = 1 << 28,
- // no dead stripping
- S_ATTR_LIVE_SUPPORT = 1 << 27,
- // blocks are live if they reference live blocks
- S_ATTR_SELF_MODIFYING_CODE = 1 << 26,
- // used with i386 code stubs written on by dyld
- S_ATTR_DEBUG = 1 << 25,
- // a debug section
- S_ATTR_SOME_INSTRUCTIONS = 1 << 10,
- // section contains some machine instructions
- S_ATTR_EXT_RELOC = 1 << 9,
- // section has external relocation entries
- S_ATTR_LOC_RELOC = 1 << 8
- // section has local relocation entries
- };
-
- /// cmdSize - This routine returns the size of the MachOSection as written
- /// to disk, depending on whether the destination is a 64 bit Mach-O file.
- unsigned cmdSize(bool is64Bit) const {
- if (is64Bit)
- return 7 * sizeof(uint32_t) + 2 * sizeof(uint64_t) + 32;
- else
- return 9 * sizeof(uint32_t) + 32; // addresses only 32 bits
- }
-
- MachOSection(const std::string &seg, const std::string &sect)
- : sectname(sect), segname(seg), addr(0), size(0), offset(0), align(2),
- reloff(0), nreloc(0), flags(0), reserved1(0), reserved2(0),
- reserved3(0) { }
- };
-
- private:
-
- /// SectionList - This is the list of sections that we have emitted to the
- /// file. Once the file has been completely built, the segment load command
- /// SectionCommands are constructed from this info.
- std::vector<MachOSection*> SectionList;
-
- /// SectionLookup - This is a mapping from section name to SectionList entry
- std::map<std::string, MachOSection*> SectionLookup;
-
- /// GVSection - This is a mapping from a GlobalValue to a MachOSection,
- /// to aid in emitting relocations.
- std::map<GlobalValue*, MachOSection*> GVSection;
-
- /// GVOffset - This is a mapping from a GlobalValue to an offset from the
- /// start of the section in which the GV resides, to aid in emitting
- /// relocations.
- std::map<GlobalValue*, intptr_t> GVOffset;
-
- /// getSection - Return the section with the specified name, creating a new
- /// section if one does not already exist.
- MachOSection *getSection(const std::string &seg, const std::string &sect,
- unsigned Flags = 0) {
- MachOSection *MOS = SectionLookup[seg+sect];
- if (MOS) return MOS;
-
- MOS = new MachOSection(seg, sect);
- SectionList.push_back(MOS);
- MOS->Index = SectionList.size();
- MOS->flags = MachOSection::S_REGULAR | Flags;
- SectionLookup[seg+sect] = MOS;
- return MOS;
- }
- MachOSection *getTextSection(bool isCode = true) {
- if (isCode)
- return getSection("__TEXT", "__text",
- MachOSection::S_ATTR_PURE_INSTRUCTIONS |
- MachOSection::S_ATTR_SOME_INSTRUCTIONS);
- else
- return getSection("__TEXT", "__text");
- }
- MachOSection *getBSSSection() {
- return getSection("__DATA", "__bss", MachOSection::S_ZEROFILL);
- }
- MachOSection *getDataSection() {
- return getSection("__DATA", "__data");
- }
- MachOSection *getConstSection(Constant *C) {
- const ConstantArray *CVA = dyn_cast<ConstantArray>(C);
- if (CVA && CVA->isCString())
- return getSection("__TEXT", "__cstring",
- MachOSection::S_CSTRING_LITERALS);
-
- const Type *Ty = C->getType();
- if (Ty->isPrimitiveType() || Ty->isInteger()) {
- unsigned Size = TM.getTargetData()->getABITypeSize(Ty);
- switch(Size) {
- default: break; // Fall through to __TEXT,__const
- case 4:
- return getSection("__TEXT", "__literal4",
- MachOSection::S_4BYTE_LITERALS);
- case 8:
- return getSection("__TEXT", "__literal8",
- MachOSection::S_8BYTE_LITERALS);
- case 16:
- return getSection("__TEXT", "__literal16",
- MachOSection::S_16BYTE_LITERALS);
- }
- }
- return getSection("__TEXT", "__const");
- }
- MachOSection *getJumpTableSection() {
- if (TM.getRelocationModel() == Reloc::PIC_)
- return getTextSection(false);
- else
- return getSection("__TEXT", "__const");
- }
-
- /// MachOSymTab - This struct contains information about the offsets and
- /// size of symbol table information.
- /// segment.
- struct MachOSymTab {
- uint32_t cmd; // LC_SYMTAB
- uint32_t cmdsize; // sizeof( MachOSymTab )
- uint32_t symoff; // symbol table offset
- uint32_t nsyms; // number of symbol table entries
- uint32_t stroff; // string table offset
- uint32_t strsize; // string table size in bytes
-
- // Constants for the cmd field
- // see <mach-o/loader.h>
- enum { LC_SYMTAB = 0x02 // link-edit stab symbol table info
- };
-
- MachOSymTab() : cmd(LC_SYMTAB), cmdsize(6 * sizeof(uint32_t)), symoff(0),
- nsyms(0), stroff(0), strsize(0) { }
- };
-
- /// MachOSymTab - This struct contains information about the offsets and
- /// size of symbol table information.
- /// segment.
- struct MachODySymTab {
- uint32_t cmd; // LC_DYSYMTAB
- uint32_t cmdsize; // sizeof( MachODySymTab )
- uint32_t ilocalsym; // index to local symbols
- uint32_t nlocalsym; // number of local symbols
- uint32_t iextdefsym; // index to externally defined symbols
- uint32_t nextdefsym; // number of externally defined symbols
- uint32_t iundefsym; // index to undefined symbols
- uint32_t nundefsym; // number of undefined symbols
- uint32_t tocoff; // file offset to table of contents
- uint32_t ntoc; // number of entries in table of contents
- uint32_t modtaboff; // file offset to module table
- uint32_t nmodtab; // number of module table entries
- uint32_t extrefsymoff; // offset to referenced symbol table
- uint32_t nextrefsyms; // number of referenced symbol table entries
- uint32_t indirectsymoff; // file offset to the indirect symbol table
- uint32_t nindirectsyms; // number of indirect symbol table entries
- uint32_t extreloff; // offset to external relocation entries
- uint32_t nextrel; // number of external relocation entries
- uint32_t locreloff; // offset to local relocation entries
- uint32_t nlocrel; // number of local relocation entries
-
- // Constants for the cmd field
- // see <mach-o/loader.h>
- enum { LC_DYSYMTAB = 0x0B // dynamic link-edit symbol table info
- };
-
- MachODySymTab() : cmd(LC_DYSYMTAB), cmdsize(20 * sizeof(uint32_t)),
- ilocalsym(0), nlocalsym(0), iextdefsym(0), nextdefsym(0),
- iundefsym(0), nundefsym(0), tocoff(0), ntoc(0), modtaboff(0),
- nmodtab(0), extrefsymoff(0), nextrefsyms(0), indirectsymoff(0),
- nindirectsyms(0), extreloff(0), nextrel(0), locreloff(0), nlocrel(0) { }
- };
-
- /// SymTab - The "stab" style symbol table information
- MachOSymTab SymTab;
- /// DySymTab - symbol table info for the dynamic link editor
- MachODySymTab DySymTab;
-
- struct MachOSymCmp {
- // FIXME: this does not appear to be sorting 'f' after 'F'
- bool operator()(const MachOSym &LHS, const MachOSym &RHS) {
- return LHS.GVName < RHS.GVName;
- }
- };
-
- /// PartitionByLocal - Simple boolean predicate that returns true if Sym is
- /// a local symbol rather than an external symbol.
- static bool PartitionByLocal(const MachOSym &Sym);
-
- /// PartitionByDefined - Simple boolean predicate that returns true if Sym
- /// is defined in this module.
- static bool PartitionByDefined(const MachOSym &Sym);
-
- protected:
-
- /// SymbolTable - This is the list of symbols we have emitted to the file.
- /// This actually gets rearranged before emission to the file (to put the
- /// local symbols first in the list).
- std::vector<MachOSym> SymbolTable;
-
- /// SymT - A buffer to hold the symbol table before we write it out at the
- /// appropriate location in the file.
- DataBuffer SymT;
-
- /// StrT - A buffer to hold the string table before we write it out at the
- /// appropriate location in the file.
- DataBuffer StrT;
-
- /// PendingSyms - This is a list of externally defined symbols that we have
- /// been asked to emit, but have not seen a reference to. When a reference
- /// is seen, the symbol will move from this list to the SymbolTable.
- std::vector<GlobalValue*> PendingGlobals;
-
- /// DynamicSymbolTable - This is just a vector of indices into
- /// SymbolTable to aid in emitting the DYSYMTAB load command.
- std::vector<unsigned> DynamicSymbolTable;
-
- static void InitMem(const Constant *C, void *Addr, intptr_t Offset,
- const TargetData *TD,
- std::vector<MachineRelocation> &MRs);
-
- private:
- void AddSymbolToSection(MachOSection *MOS, GlobalVariable *GV);
- void EmitGlobal(GlobalVariable *GV);
- void EmitHeaderAndLoadCommands();
- void EmitSections();
- void BufferSymbolAndStringTable();
- void CalculateRelocations(MachOSection &MOS);
-
- MachineRelocation GetJTRelocation(unsigned Offset,
- MachineBasicBlock *MBB) const {
- return TM.getMachOWriterInfo()->GetJTRelocation(Offset, MBB);
- }
-
- /// GetTargetRelocation - Returns the number of relocations.
- unsigned GetTargetRelocation(MachineRelocation &MR,
- unsigned FromIdx,
- unsigned ToAddr,
- unsigned ToIndex,
- OutputBuffer &RelocOut,
- OutputBuffer &SecOut,
- bool Scattered,
- bool Extern) {
- return TM.getMachOWriterInfo()->GetTargetRelocation(MR, FromIdx, ToAddr,
- ToIndex, RelocOut,
- SecOut, Scattered,
- Extern);
- }
- };
-}
-
-#endif
diff --git a/release_23/lib/CodeGen/MachineBasicBlock.cpp b/release_23/lib/CodeGen/MachineBasicBlock.cpp
deleted file mode 100644
index 01aaba5282b1..000000000000
--- a/release_23/lib/CodeGen/MachineBasicBlock.cpp
+++ /dev/null
@@ -1,358 +0,0 @@
-//===-- llvm/CodeGen/MachineBasicBlock.cpp ----------------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// Collect the sequence of machine instructions for a basic block.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/CodeGen/MachineBasicBlock.h"
-#include "llvm/BasicBlock.h"
-#include "llvm/CodeGen/MachineFunction.h"
-#include "llvm/Target/TargetRegisterInfo.h"
-#include "llvm/Target/TargetData.h"
-#include "llvm/Target/TargetInstrDesc.h"
-#include "llvm/Target/TargetMachine.h"
-#include "llvm/Support/LeakDetector.h"
-#include <algorithm>
-using namespace llvm;
-
-MachineBasicBlock::~MachineBasicBlock() {
- LeakDetector::removeGarbageObject(this);
-}
-
-std::ostream& llvm::operator<<(std::ostream &OS, const MachineBasicBlock &MBB) {
- MBB.print(OS);
- return OS;
-}
-
-/// addNodeToList (MBB) - When an MBB is added to an MF, we need to update the
-/// parent pointer of the MBB, the MBB numbering, and any instructions in the
-/// MBB to be on the right operand list for registers.
-///
-/// MBBs start out as #-1. When a MBB is added to a MachineFunction, it
-/// gets the next available unique MBB number. If it is removed from a
-/// MachineFunction, it goes back to being #-1.
-void ilist_traits<MachineBasicBlock>::addNodeToList(MachineBasicBlock* N) {
- assert(N->getParent() == 0 && "machine instruction already in a basic block");
- N->setParent(Parent);
- N->Number = Parent->addToMBBNumbering(N);
-
- // Make sure the instructions have their operands in the reginfo lists.
- MachineRegisterInfo &RegInfo = Parent->getRegInfo();
- for (MachineBasicBlock::iterator I = N->begin(), E = N->end(); I != E; ++I)
- I->AddRegOperandsToUseLists(RegInfo);
-
- LeakDetector::removeGarbageObject(N);
-}
-
-void ilist_traits<MachineBasicBlock>::removeNodeFromList(MachineBasicBlock* N) {
- assert(N->getParent() != 0 && "machine instruction not in a basic block");
- N->getParent()->removeFromMBBNumbering(N->Number);
- N->Number = -1;
- N->setParent(0);
-
- // Make sure the instructions have their operands removed from the reginfo
- // lists.
- for (MachineBasicBlock::iterator I = N->begin(), E = N->end(); I != E; ++I)
- I->RemoveRegOperandsFromUseLists();
-
- LeakDetector::addGarbageObject(N);
-}
-
-
-MachineInstr* ilist_traits<MachineInstr>::createSentinel() {
- MachineInstr* dummy = new MachineInstr();
- LeakDetector::removeGarbageObject(dummy);
- return dummy;
-}
-
-/// addNodeToList (MI) - When we add an instruction to a basic block
-/// list, we update its parent pointer and add its operands from reg use/def
-/// lists if appropriate.
-void ilist_traits<MachineInstr>::addNodeToList(MachineInstr* N) {
- assert(N->getParent() == 0 && "machine instruction already in a basic block");
- N->setParent(parent);
- LeakDetector::removeGarbageObject(N);
-
- // If the block is in a function, add the instruction's register operands to
- // their corresponding use/def lists.
- if (MachineFunction *MF = parent->getParent())
- N->AddRegOperandsToUseLists(MF->getRegInfo());
-}
-
-/// removeNodeFromList (MI) - When we remove an instruction from a basic block
-/// list, we update its parent pointer and remove its operands from reg use/def
-/// lists if appropriate.
-void ilist_traits<MachineInstr>::removeNodeFromList(MachineInstr* N) {
- assert(N->getParent() != 0 && "machine instruction not in a basic block");
- // If this block is in a function, remove from the use/def lists.
- if (parent->getParent() != 0)
- N->RemoveRegOperandsFromUseLists();
-
- N->setParent(0);
- LeakDetector::addGarbageObject(N);
-}
-
-/// transferNodesFromList (MI) - When moving a range of instructions from one
-/// MBB list to another, we need to update the parent pointers and the use/def
-/// lists.
-void ilist_traits<MachineInstr>::transferNodesFromList(
- iplist<MachineInstr, ilist_traits<MachineInstr> >& fromList,
- ilist_iterator<MachineInstr> first,
- ilist_iterator<MachineInstr> last) {
- // Splice within the same MBB -> no change.
- if (parent == fromList.parent) return;
-
- // If splicing between two blocks within the same function, just update the
- // parent pointers.
- if (parent->getParent() == fromList.parent->getParent()) {
- for (; first != last; ++first)
- first->setParent(parent);
- return;
- }
-
- // Otherwise, we have to update the parent and the use/def lists. The common
- // case when this occurs is if we're splicing from a block in a MF to a block
- // that is not in an MF.
- bool HasOldMF = fromList.parent->getParent() != 0;
- MachineFunction *NewMF = parent->getParent();
-
- for (; first != last; ++first) {
- if (HasOldMF) first->RemoveRegOperandsFromUseLists();
- first->setParent(parent);
- if (NewMF) first->AddRegOperandsToUseLists(NewMF->getRegInfo());
- }
-}
-
-MachineBasicBlock::iterator MachineBasicBlock::getFirstTerminator() {
- iterator I = end();
- while (I != begin() && (--I)->getDesc().isTerminator())
- ; /*noop */
- if (I != end() && !I->getDesc().isTerminator()) ++I;
- return I;
-}
-
-void MachineBasicBlock::dump() const {
- print(*cerr.stream());
-}
-
-static inline void OutputReg(std::ostream &os, unsigned RegNo,
- const TargetRegisterInfo *TRI = 0) {
- if (!RegNo || TargetRegisterInfo::isPhysicalRegister(RegNo)) {
- if (TRI)
- os << " %" << TRI->get(RegNo).Name;
- else
- os << " %mreg(" << RegNo << ")";
- } else
- os << " %reg" << RegNo;
-}
-
-void MachineBasicBlock::print(std::ostream &OS) const {
- const MachineFunction *MF = getParent();
- if(!MF) {
- OS << "Can't print out MachineBasicBlock because parent MachineFunction"
- << " is null\n";
- return;
- }
-
- const BasicBlock *LBB = getBasicBlock();
- OS << "\n";
- if (LBB) OS << LBB->getName() << ": ";
- OS << (const void*)this
- << ", LLVM BB @" << (const void*) LBB << ", ID#" << getNumber();
- if (Alignment) OS << ", Alignment " << Alignment;
- if (isLandingPad()) OS << ", EH LANDING PAD";
- OS << ":\n";
-
- const TargetRegisterInfo *TRI = MF->getTarget().getRegisterInfo();
- if (!livein_empty()) {
- OS << "Live Ins:";
- for (const_livein_iterator I = livein_begin(),E = livein_end(); I != E; ++I)
- OutputReg(OS, *I, TRI);
- OS << "\n";
- }
- // Print the preds of this block according to the CFG.
- if (!pred_empty()) {
- OS << " Predecessors according to CFG:";
- for (const_pred_iterator PI = pred_begin(), E = pred_end(); PI != E; ++PI)
- OS << " " << *PI << " (#" << (*PI)->getNumber() << ")";
- OS << "\n";
- }
-
- for (const_iterator I = begin(); I != end(); ++I) {
- OS << "\t";
- I->print(OS, &getParent()->getTarget());
- }
-
- // Print the successors of this block according to the CFG.
- if (!succ_empty()) {
- OS << " Successors according to CFG:";
- for (const_succ_iterator SI = succ_begin(), E = succ_end(); SI != E; ++SI)
- OS << " " << *SI << " (#" << (*SI)->getNumber() << ")";
- OS << "\n";
- }
-}
-
-void MachineBasicBlock::removeLiveIn(unsigned Reg) {
- livein_iterator I = std::find(livein_begin(), livein_end(), Reg);
- assert(I != livein_end() && "Not a live in!");
- LiveIns.erase(I);
-}
-
-bool MachineBasicBlock::isLiveIn(unsigned Reg) const {
- const_livein_iterator I = std::find(livein_begin(), livein_end(), Reg);
- return I != livein_end();
-}
-
-void MachineBasicBlock::moveBefore(MachineBasicBlock *NewAfter) {
- MachineFunction::BasicBlockListType &BBList =getParent()->getBasicBlockList();
- getParent()->getBasicBlockList().splice(NewAfter, BBList, this);
-}
-
-void MachineBasicBlock::moveAfter(MachineBasicBlock *NewBefore) {
- MachineFunction::BasicBlockListType &BBList =getParent()->getBasicBlockList();
- MachineFunction::iterator BBI = NewBefore;
- getParent()->getBasicBlockList().splice(++BBI, BBList, this);
-}
-
-
-void MachineBasicBlock::addSuccessor(MachineBasicBlock *succ) {
- Successors.push_back(succ);
- succ->addPredecessor(this);
-}
-
-void MachineBasicBlock::removeSuccessor(MachineBasicBlock *succ) {
- succ->removePredecessor(this);
- succ_iterator I = std::find(Successors.begin(), Successors.end(), succ);
- assert(I != Successors.end() && "Not a current successor!");
- Successors.erase(I);
-}
-
-MachineBasicBlock::succ_iterator
-MachineBasicBlock::removeSuccessor(succ_iterator I) {
- assert(I != Successors.end() && "Not a current successor!");
- (*I)->removePredecessor(this);
- return(Successors.erase(I));
-}
-
-void MachineBasicBlock::addPredecessor(MachineBasicBlock *pred) {
- Predecessors.push_back(pred);
-}
-
-void MachineBasicBlock::removePredecessor(MachineBasicBlock *pred) {
- std::vector<MachineBasicBlock *>::iterator I =
- std::find(Predecessors.begin(), Predecessors.end(), pred);
- assert(I != Predecessors.end() && "Pred is not a predecessor of this block!");
- Predecessors.erase(I);
-}
-
-void MachineBasicBlock::transferSuccessors(MachineBasicBlock *fromMBB)
-{
- if (this == fromMBB)
- return;
-
- for(MachineBasicBlock::succ_iterator iter = fromMBB->succ_begin(),
- end = fromMBB->succ_end(); iter != end; ++iter) {
- addSuccessor(*iter);
- }
- while(!fromMBB->succ_empty())
- fromMBB->removeSuccessor(fromMBB->succ_begin());
-}
-
-bool MachineBasicBlock::isSuccessor(MachineBasicBlock *MBB) const {
- std::vector<MachineBasicBlock *>::const_iterator I =
- std::find(Successors.begin(), Successors.end(), MBB);
- return I != Successors.end();
-}
-
-/// ReplaceUsesOfBlockWith - Given a machine basic block that branched to
-/// 'Old', change the code and CFG so that it branches to 'New' instead.
-void MachineBasicBlock::ReplaceUsesOfBlockWith(MachineBasicBlock *Old,
- MachineBasicBlock *New) {
- assert(Old != New && "Cannot replace self with self!");
-
- MachineBasicBlock::iterator I = end();
- while (I != begin()) {
- --I;
- if (!I->getDesc().isTerminator()) break;
-
- // Scan the operands of this machine instruction, replacing any uses of Old
- // with New.
- for (unsigned i = 0, e = I->getNumOperands(); i != e; ++i)
- if (I->getOperand(i).isMBB() && I->getOperand(i).getMBB() == Old)
- I->getOperand(i).setMBB(New);
- }
-
- // Update the successor information. If New was already a successor, just
- // remove the link to Old instead of creating another one. PR 1444.
- removeSuccessor(Old);
- if (!isSuccessor(New))
- addSuccessor(New);
-}
-
-/// CorrectExtraCFGEdges - Various pieces of code can cause excess edges in the
-/// CFG to be inserted. If we have proven that MBB can only branch to DestA and
-/// DestB, remove any other MBB successors from the CFG. DestA and DestB can
-/// be null.
-/// Besides DestA and DestB, retain other edges leading to LandingPads
-/// (currently there can be only one; we don't check or require that here).
-/// Note it is possible that DestA and/or DestB are LandingPads.
-bool MachineBasicBlock::CorrectExtraCFGEdges(MachineBasicBlock *DestA,
- MachineBasicBlock *DestB,
- bool isCond) {
- bool MadeChange = false;
- bool AddedFallThrough = false;
-
- MachineBasicBlock *FallThru = getNext();
-
- // If this block ends with a conditional branch that falls through to its
- // successor, set DestB as the successor.
- if (isCond) {
- if (DestB == 0 && FallThru != getParent()->end()) {
- DestB = FallThru;
- AddedFallThrough = true;
- }
- } else {
- // If this is an unconditional branch with no explicit dest, it must just be
- // a fallthrough into DestB.
- if (DestA == 0 && FallThru != getParent()->end()) {
- DestA = FallThru;
- AddedFallThrough = true;
- }
- }
-
- MachineBasicBlock::succ_iterator SI = succ_begin();
- MachineBasicBlock *OrigDestA = DestA, *OrigDestB = DestB;
- while (SI != succ_end()) {
- if (*SI == DestA && DestA == DestB) {
- DestA = DestB = 0;
- ++SI;
- } else if (*SI == DestA) {
- DestA = 0;
- ++SI;
- } else if (*SI == DestB) {
- DestB = 0;
- ++SI;
- } else if ((*SI)->isLandingPad() &&
- *SI!=OrigDestA && *SI!=OrigDestB) {
- ++SI;
- } else {
- // Otherwise, this is a superfluous edge, remove it.
- SI = removeSuccessor(SI);
- MadeChange = true;
- }
- }
- if (!AddedFallThrough) {
- assert(DestA == 0 && DestB == 0 &&
- "MachineCFG is missing edges!");
- } else if (isCond) {
- assert(DestA == 0 && "MachineCFG is missing edges!");
- }
- return MadeChange;
-}
diff --git a/release_23/lib/CodeGen/MachineDominators.cpp b/release_23/lib/CodeGen/MachineDominators.cpp
deleted file mode 100644
index 9b53bdb8b3f3..000000000000
--- a/release_23/lib/CodeGen/MachineDominators.cpp
+++ /dev/null
@@ -1,30 +0,0 @@
-//===- MachineDominators.cpp - Machine Dominator Calculation --------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements simple dominator construction algorithms for finding
-// forward dominators on machine functions.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/CodeGen/MachineDominators.h"
-#include "llvm/CodeGen/Passes.h"
-
-using namespace llvm;
-
-TEMPLATE_INSTANTIATION(class DomTreeNodeBase<MachineBasicBlock>);
-TEMPLATE_INSTANTIATION(class DominatorTreeBase<MachineBasicBlock>);
-
-char MachineDominatorTree::ID = 0;
-
-namespace {
- RegisterPass<MachineDominatorTree>
- E("machinedomtree", "MachineDominator Tree Construction", true);
-}
-
-const PassInfo *llvm::MachineDominatorsID = E.getPassInfo();
diff --git a/release_23/lib/CodeGen/MachineFunction.cpp b/release_23/lib/CodeGen/MachineFunction.cpp
deleted file mode 100644
index a9501259d24b..000000000000
--- a/release_23/lib/CodeGen/MachineFunction.cpp
+++ /dev/null
@@ -1,499 +0,0 @@
-//===-- MachineFunction.cpp -----------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// Collect native machine code information for a function. This allows
-// target-specific information about the generated code to be stored with each
-// function.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/DerivedTypes.h"
-#include "llvm/CodeGen/MachineConstantPool.h"
-#include "llvm/CodeGen/MachineFunctionPass.h"
-#include "llvm/CodeGen/MachineFrameInfo.h"
-#include "llvm/CodeGen/MachineInstr.h"
-#include "llvm/CodeGen/MachineJumpTableInfo.h"
-#include "llvm/CodeGen/MachineRegisterInfo.h"
-#include "llvm/CodeGen/Passes.h"
-#include "llvm/Target/TargetData.h"
-#include "llvm/Target/TargetLowering.h"
-#include "llvm/Target/TargetMachine.h"
-#include "llvm/Target/TargetFrameInfo.h"
-#include "llvm/Function.h"
-#include "llvm/Instructions.h"
-#include "llvm/Support/Compiler.h"
-#include "llvm/Support/GraphWriter.h"
-#include "llvm/Support/LeakDetector.h"
-#include "llvm/ADT/STLExtras.h"
-#include "llvm/Config/config.h"
-#include <fstream>
-#include <sstream>
-using namespace llvm;
-
-static AnnotationID MF_AID(
- AnnotationManager::getID("CodeGen::MachineCodeForFunction"));
-
-// Out of line virtual function to home classes.
-void MachineFunctionPass::virtfn() {}
-
-namespace {
- struct VISIBILITY_HIDDEN Printer : public MachineFunctionPass {
- static char ID;
-
- std::ostream *OS;
- const std::string Banner;
-
- Printer (std::ostream *_OS, const std::string &_Banner)
- : MachineFunctionPass((intptr_t)&ID), OS (_OS), Banner (_Banner) { }
-
- const char *getPassName() const { return "MachineFunction Printer"; }
-
- virtual void getAnalysisUsage(AnalysisUsage &AU) const {
- AU.setPreservesAll();
- }
-
- bool runOnMachineFunction(MachineFunction &MF) {
- (*OS) << Banner;
- MF.print (*OS);
- return false;
- }
- };
- char Printer::ID = 0;
-}
-
-/// Returns a newly-created MachineFunction Printer pass. The default output
-/// stream is std::cerr; the default banner is empty.
-///
-FunctionPass *llvm::createMachineFunctionPrinterPass(std::ostream *OS,
- const std::string &Banner){
- return new Printer(OS, Banner);
-}
-
-namespace {
- struct VISIBILITY_HIDDEN Deleter : public MachineFunctionPass {
- static char ID;
- Deleter() : MachineFunctionPass((intptr_t)&ID) {}
-
- const char *getPassName() const { return "Machine Code Deleter"; }
-
- bool runOnMachineFunction(MachineFunction &MF) {
- // Delete the annotation from the function now.
- MachineFunction::destruct(MF.getFunction());
- return true;
- }
- };
- char Deleter::ID = 0;
-}
-
-/// MachineCodeDeletion Pass - This pass deletes all of the machine code for
-/// the current function, which should happen after the function has been
-/// emitted to a .s file or to memory.
-FunctionPass *llvm::createMachineCodeDeleter() {
- return new Deleter();
-}
-
-
-
-//===---------------------------------------------------------------------===//
-// MachineFunction implementation
-//===---------------------------------------------------------------------===//
-
-MachineBasicBlock* ilist_traits<MachineBasicBlock>::createSentinel() {
- MachineBasicBlock* dummy = new MachineBasicBlock();
- LeakDetector::removeGarbageObject(dummy);
- return dummy;
-}
-
-void ilist_traits<MachineBasicBlock>::transferNodesFromList(
- iplist<MachineBasicBlock, ilist_traits<MachineBasicBlock> >& toList,
- ilist_iterator<MachineBasicBlock> first,
- ilist_iterator<MachineBasicBlock> last) {
- // If splicing withing the same function, no change.
- if (Parent == toList.Parent) return;
-
- for (; first != last; ++first)
- first->setParent(toList.Parent);
-}
-
-MachineFunction::MachineFunction(const Function *F,
- const TargetMachine &TM)
- : Annotation(MF_AID), Fn(F), Target(TM) {
- RegInfo = new MachineRegisterInfo(*TM.getRegisterInfo());
- MFInfo = 0;
- FrameInfo = new MachineFrameInfo(*TM.getFrameInfo());
- ConstantPool = new MachineConstantPool(TM.getTargetData());
-
- // Set up jump table.
- const TargetData &TD = *TM.getTargetData();
- bool IsPic = TM.getRelocationModel() == Reloc::PIC_;
- unsigned EntrySize = IsPic ? 4 : TD.getPointerSize();
- unsigned Alignment = IsPic ? TD.getABITypeAlignment(Type::Int32Ty)
- : TD.getPointerABIAlignment();
- JumpTableInfo = new MachineJumpTableInfo(EntrySize, Alignment);
-
- BasicBlocks.Parent = this;
-}
-
-MachineFunction::~MachineFunction() {
- BasicBlocks.clear();
- delete RegInfo;
- delete MFInfo;
- delete FrameInfo;
- delete ConstantPool;
- delete JumpTableInfo;
-}
-
-
-/// RenumberBlocks - This discards all of the MachineBasicBlock numbers and
-/// recomputes them. This guarantees that the MBB numbers are sequential,
-/// dense, and match the ordering of the blocks within the function. If a
-/// specific MachineBasicBlock is specified, only that block and those after
-/// it are renumbered.
-void MachineFunction::RenumberBlocks(MachineBasicBlock *MBB) {
- if (empty()) { MBBNumbering.clear(); return; }
- MachineFunction::iterator MBBI, E = end();
- if (MBB == 0)
- MBBI = begin();
- else
- MBBI = MBB;
-
- // Figure out the block number this should have.
- unsigned BlockNo = 0;
- if (MBBI != begin())
- BlockNo = prior(MBBI)->getNumber()+1;
-
- for (; MBBI != E; ++MBBI, ++BlockNo) {
- if (MBBI->getNumber() != (int)BlockNo) {
- // Remove use of the old number.
- if (MBBI->getNumber() != -1) {
- assert(MBBNumbering[MBBI->getNumber()] == &*MBBI &&
- "MBB number mismatch!");
- MBBNumbering[MBBI->getNumber()] = 0;
- }
-
- // If BlockNo is already taken, set that block's number to -1.
- if (MBBNumbering[BlockNo])
- MBBNumbering[BlockNo]->setNumber(-1);
-
- MBBNumbering[BlockNo] = MBBI;
- MBBI->setNumber(BlockNo);
- }
- }
-
- // Okay, all the blocks are renumbered. If we have compactified the block
- // numbering, shrink MBBNumbering now.
- assert(BlockNo <= MBBNumbering.size() && "Mismatch!");
- MBBNumbering.resize(BlockNo);
-}
-
-
-void MachineFunction::dump() const { print(*cerr.stream()); }
-
-void MachineFunction::print(std::ostream &OS) const {
- OS << "# Machine code for " << Fn->getName () << "():\n";
-
- // Print Frame Information
- getFrameInfo()->print(*this, OS);
-
- // Print JumpTable Information
- getJumpTableInfo()->print(OS);
-
- // Print Constant Pool
- getConstantPool()->print(OS);
-
- const TargetRegisterInfo *TRI = getTarget().getRegisterInfo();
-
- if (!RegInfo->livein_empty()) {
- OS << "Live Ins:";
- for (MachineRegisterInfo::livein_iterator
- I = RegInfo->livein_begin(), E = RegInfo->livein_end(); I != E; ++I) {
- if (TRI)
- OS << " " << TRI->getName(I->first);
- else
- OS << " Reg #" << I->first;
-
- if (I->second)
- OS << " in VR#" << I->second << " ";
- }
- OS << "\n";
- }
- if (!RegInfo->liveout_empty()) {
- OS << "Live Outs:";
- for (MachineRegisterInfo::liveout_iterator
- I = RegInfo->liveout_begin(), E = RegInfo->liveout_end(); I != E; ++I)
- if (TRI)
- OS << " " << TRI->getName(*I);
- else
- OS << " Reg #" << *I;
- OS << "\n";
- }
-
- for (const_iterator BB = begin(); BB != end(); ++BB)
- BB->print(OS);
-
- OS << "\n# End machine code for " << Fn->getName () << "().\n\n";
-}
-
-/// CFGOnly flag - This is used to control whether or not the CFG graph printer
-/// prints out the contents of basic blocks or not. This is acceptable because
-/// this code is only really used for debugging purposes.
-///
-static bool CFGOnly = false;
-
-namespace llvm {
- template<>
- struct DOTGraphTraits<const MachineFunction*> : public DefaultDOTGraphTraits {
- static std::string getGraphName(const MachineFunction *F) {
- return "CFG for '" + F->getFunction()->getName() + "' function";
- }
-
- static std::string getNodeLabel(const MachineBasicBlock *Node,
- const MachineFunction *Graph) {
- if (CFGOnly && Node->getBasicBlock() &&
- !Node->getBasicBlock()->getName().empty())
- return Node->getBasicBlock()->getName() + ":";
-
- std::ostringstream Out;
- if (CFGOnly) {
- Out << Node->getNumber() << ':';
- return Out.str();
- }
-
- Node->print(Out);
-
- std::string OutStr = Out.str();
- if (OutStr[0] == '\n') OutStr.erase(OutStr.begin());
-
- // Process string output to make it nicer...
- for (unsigned i = 0; i != OutStr.length(); ++i)
- if (OutStr[i] == '\n') { // Left justify
- OutStr[i] = '\\';
- OutStr.insert(OutStr.begin()+i+1, 'l');
- }
- return OutStr;
- }
- };
-}
-
-void MachineFunction::viewCFG() const
-{
-#ifndef NDEBUG
- ViewGraph(this, "mf" + getFunction()->getName());
-#else
- cerr << "SelectionDAG::viewGraph is only available in debug builds on "
- << "systems with Graphviz or gv!\n";
-#endif // NDEBUG
-}
-
-void MachineFunction::viewCFGOnly() const
-{
- CFGOnly = true;
- viewCFG();
- CFGOnly = false;
-}
-
-// The next two methods are used to construct and to retrieve
-// the MachineCodeForFunction object for the given function.
-// construct() -- Allocates and initializes for a given function and target
-// get() -- Returns a handle to the object.
-// This should not be called before "construct()"
-// for a given Function.
-//
-MachineFunction&
-MachineFunction::construct(const Function *Fn, const TargetMachine &Tar)
-{
- assert(Fn->getAnnotation(MF_AID) == 0 &&
- "Object already exists for this function!");
- MachineFunction* mcInfo = new MachineFunction(Fn, Tar);
- Fn->addAnnotation(mcInfo);
- return *mcInfo;
-}
-
-void MachineFunction::destruct(const Function *Fn) {
- bool Deleted = Fn->deleteAnnotation(MF_AID);
- assert(Deleted && "Machine code did not exist for function!");
- Deleted = Deleted; // silence warning when no assertions.
-}
-
-MachineFunction& MachineFunction::get(const Function *F)
-{
- MachineFunction *mc = (MachineFunction*)F->getAnnotation(MF_AID);
- assert(mc && "Call construct() method first to allocate the object");
- return *mc;
-}
-
-//===----------------------------------------------------------------------===//
-// MachineFrameInfo implementation
-//===----------------------------------------------------------------------===//
-
-/// CreateFixedObject - Create a new object at a fixed location on the stack.
-/// All fixed objects should be created before other objects are created for
-/// efficiency. By default, fixed objects are immutable. This returns an
-/// index with a negative value.
-///
-int MachineFrameInfo::CreateFixedObject(uint64_t Size, int64_t SPOffset,
- bool Immutable) {
- assert(Size != 0 && "Cannot allocate zero size fixed stack objects!");
- Objects.insert(Objects.begin(), StackObject(Size, 1, SPOffset, Immutable));
- return -++NumFixedObjects;
-}
-
-
-void MachineFrameInfo::print(const MachineFunction &MF, std::ostream &OS) const{
- int ValOffset = MF.getTarget().getFrameInfo()->getOffsetOfLocalArea();
-
- for (unsigned i = 0, e = Objects.size(); i != e; ++i) {
- const StackObject &SO = Objects[i];
- OS << " <fi #" << (int)(i-NumFixedObjects) << ">: ";
- if (SO.Size == ~0ULL) {
- OS << "dead\n";
- continue;
- }
- if (SO.Size == 0)
- OS << "variable sized";
- else
- OS << "size is " << SO.Size << " byte" << (SO.Size != 1 ? "s," : ",");
- OS << " alignment is " << SO.Alignment << " byte"
- << (SO.Alignment != 1 ? "s," : ",");
-
- if (i < NumFixedObjects)
- OS << " fixed";
- if (i < NumFixedObjects || SO.SPOffset != -1) {
- int64_t Off = SO.SPOffset - ValOffset;
- OS << " at location [SP";
- if (Off > 0)
- OS << "+" << Off;
- else if (Off < 0)
- OS << Off;
- OS << "]";
- }
- OS << "\n";
- }
-
- if (HasVarSizedObjects)
- OS << " Stack frame contains variable sized objects\n";
-}
-
-void MachineFrameInfo::dump(const MachineFunction &MF) const {
- print(MF, *cerr.stream());
-}
-
-
-//===----------------------------------------------------------------------===//
-// MachineJumpTableInfo implementation
-//===----------------------------------------------------------------------===//
-
-/// getJumpTableIndex - Create a new jump table entry in the jump table info
-/// or return an existing one.
-///
-unsigned MachineJumpTableInfo::getJumpTableIndex(
- const std::vector<MachineBasicBlock*> &DestBBs) {
- assert(!DestBBs.empty() && "Cannot create an empty jump table!");
- for (unsigned i = 0, e = JumpTables.size(); i != e; ++i)
- if (JumpTables[i].MBBs == DestBBs)
- return i;
-
- JumpTables.push_back(MachineJumpTableEntry(DestBBs));
- return JumpTables.size()-1;
-}
-
-
-void MachineJumpTableInfo::print(std::ostream &OS) const {
- // FIXME: this is lame, maybe we could print out the MBB numbers or something
- // like {1, 2, 4, 5, 3, 0}
- for (unsigned i = 0, e = JumpTables.size(); i != e; ++i) {
- OS << " <jt #" << i << "> has " << JumpTables[i].MBBs.size()
- << " entries\n";
- }
-}
-
-void MachineJumpTableInfo::dump() const { print(*cerr.stream()); }
-
-
-//===----------------------------------------------------------------------===//
-// MachineConstantPool implementation
-//===----------------------------------------------------------------------===//
-
-const Type *MachineConstantPoolEntry::getType() const {
- if (isMachineConstantPoolEntry())
- return Val.MachineCPVal->getType();
- return Val.ConstVal->getType();
-}
-
-MachineConstantPool::~MachineConstantPool() {
- for (unsigned i = 0, e = Constants.size(); i != e; ++i)
- if (Constants[i].isMachineConstantPoolEntry())
- delete Constants[i].Val.MachineCPVal;
-}
-
-/// getConstantPoolIndex - Create a new entry in the constant pool or return
-/// an existing one. User must specify an alignment in bytes for the object.
-///
-unsigned MachineConstantPool::getConstantPoolIndex(Constant *C,
- unsigned Alignment) {
- assert(Alignment && "Alignment must be specified!");
- if (Alignment > PoolAlignment) PoolAlignment = Alignment;
-
- // Check to see if we already have this constant.
- //
- // FIXME, this could be made much more efficient for large constant pools.
- unsigned AlignMask = (1 << Alignment)-1;
- for (unsigned i = 0, e = Constants.size(); i != e; ++i)
- if (Constants[i].Val.ConstVal == C && (Constants[i].Offset & AlignMask)== 0)
- return i;
-
- unsigned Offset = 0;
- if (!Constants.empty()) {
- Offset = Constants.back().getOffset();
- Offset += TD->getABITypeSize(Constants.back().getType());
- Offset = (Offset+AlignMask)&~AlignMask;
- }
-
- Constants.push_back(MachineConstantPoolEntry(C, Offset));
- return Constants.size()-1;
-}
-
-unsigned MachineConstantPool::getConstantPoolIndex(MachineConstantPoolValue *V,
- unsigned Alignment) {
- assert(Alignment && "Alignment must be specified!");
- if (Alignment > PoolAlignment) PoolAlignment = Alignment;
-
- // Check to see if we already have this constant.
- //
- // FIXME, this could be made much more efficient for large constant pools.
- unsigned AlignMask = (1 << Alignment)-1;
- int Idx = V->getExistingMachineCPValue(this, Alignment);
- if (Idx != -1)
- return (unsigned)Idx;
-
- unsigned Offset = 0;
- if (!Constants.empty()) {
- Offset = Constants.back().getOffset();
- Offset += TD->getABITypeSize(Constants.back().getType());
- Offset = (Offset+AlignMask)&~AlignMask;
- }
-
- Constants.push_back(MachineConstantPoolEntry(V, Offset));
- return Constants.size()-1;
-}
-
-
-void MachineConstantPool::print(std::ostream &OS) const {
- for (unsigned i = 0, e = Constants.size(); i != e; ++i) {
- OS << " <cp #" << i << "> is";
- if (Constants[i].isMachineConstantPoolEntry())
- Constants[i].Val.MachineCPVal->print(OS);
- else
- OS << *(Value*)Constants[i].Val.ConstVal;
- OS << " , offset=" << Constants[i].getOffset();
- OS << "\n";
- }
-}
-
-void MachineConstantPool::dump() const { print(*cerr.stream()); }
diff --git a/release_23/lib/CodeGen/MachineInstr.cpp b/release_23/lib/CodeGen/MachineInstr.cpp
deleted file mode 100644
index 135718acc703..000000000000
--- a/release_23/lib/CodeGen/MachineInstr.cpp
+++ /dev/null
@@ -1,846 +0,0 @@
-//===-- lib/CodeGen/MachineInstr.cpp --------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// Methods common to all machine instructions.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Constants.h"
-#include "llvm/CodeGen/MachineInstr.h"
-#include "llvm/Value.h"
-#include "llvm/CodeGen/MachineFunction.h"
-#include "llvm/CodeGen/MachineRegisterInfo.h"
-#include "llvm/CodeGen/PseudoSourceValue.h"
-#include "llvm/CodeGen/SelectionDAGNodes.h"
-#include "llvm/Target/TargetMachine.h"
-#include "llvm/Target/TargetInstrInfo.h"
-#include "llvm/Target/TargetInstrDesc.h"
-#include "llvm/Target/TargetRegisterInfo.h"
-#include "llvm/Support/LeakDetector.h"
-#include "llvm/Support/Streams.h"
-#include <ostream>
-using namespace llvm;
-
-//===----------------------------------------------------------------------===//
-// MachineOperand Implementation
-//===----------------------------------------------------------------------===//
-
-/// AddRegOperandToRegInfo - Add this register operand to the specified
-/// MachineRegisterInfo. If it is null, then the next/prev fields should be
-/// explicitly nulled out.
-void MachineOperand::AddRegOperandToRegInfo(MachineRegisterInfo *RegInfo) {
- assert(isReg() && "Can only add reg operand to use lists");
-
- // If the reginfo pointer is null, just explicitly null out or next/prev
- // pointers, to ensure they are not garbage.
- if (RegInfo == 0) {
- Contents.Reg.Prev = 0;
- Contents.Reg.Next = 0;
- return;
- }
-
- // Otherwise, add this operand to the head of the registers use/def list.
- MachineOperand **Head = &RegInfo->getRegUseDefListHead(getReg());
-
- // For SSA values, we prefer to keep the definition at the start of the list.
- // we do this by skipping over the definition if it is at the head of the
- // list.
- if (*Head && (*Head)->isDef())
- Head = &(*Head)->Contents.Reg.Next;
-
- Contents.Reg.Next = *Head;
- if (Contents.Reg.Next) {
- assert(getReg() == Contents.Reg.Next->getReg() &&
- "Different regs on the same list!");
- Contents.Reg.Next->Contents.Reg.Prev = &Contents.Reg.Next;
- }
-
- Contents.Reg.Prev = Head;
- *Head = this;
-}
-
-void MachineOperand::setReg(unsigned Reg) {
- if (getReg() == Reg) return; // No change.
-
- // Otherwise, we have to change the register. If this operand is embedded
- // into a machine function, we need to update the old and new register's
- // use/def lists.
- if (MachineInstr *MI = getParent())
- if (MachineBasicBlock *MBB = MI->getParent())
- if (MachineFunction *MF = MBB->getParent()) {
- RemoveRegOperandFromRegInfo();
- Contents.Reg.RegNo = Reg;
- AddRegOperandToRegInfo(&MF->getRegInfo());
- return;
- }
-
- // Otherwise, just change the register, no problem. :)
- Contents.Reg.RegNo = Reg;
-}
-
-/// ChangeToImmediate - Replace this operand with a new immediate operand of
-/// the specified value. If an operand is known to be an immediate already,
-/// the setImm method should be used.
-void MachineOperand::ChangeToImmediate(int64_t ImmVal) {
- // If this operand is currently a register operand, and if this is in a
- // function, deregister the operand from the register's use/def list.
- if (isReg() && getParent() && getParent()->getParent() &&
- getParent()->getParent()->getParent())
- RemoveRegOperandFromRegInfo();
-
- OpKind = MO_Immediate;
- Contents.ImmVal = ImmVal;
-}
-
-/// ChangeToRegister - Replace this operand with a new register operand of
-/// the specified value. If an operand is known to be an register already,
-/// the setReg method should be used.
-void MachineOperand::ChangeToRegister(unsigned Reg, bool isDef, bool isImp,
- bool isKill, bool isDead) {
- // If this operand is already a register operand, use setReg to update the
- // register's use/def lists.
- if (isReg()) {
- setReg(Reg);
- } else {
- // Otherwise, change this to a register and set the reg#.
- OpKind = MO_Register;
- Contents.Reg.RegNo = Reg;
-
- // If this operand is embedded in a function, add the operand to the
- // register's use/def list.
- if (MachineInstr *MI = getParent())
- if (MachineBasicBlock *MBB = MI->getParent())
- if (MachineFunction *MF = MBB->getParent())
- AddRegOperandToRegInfo(&MF->getRegInfo());
- }
-
- IsDef = isDef;
- IsImp = isImp;
- IsKill = isKill;
- IsDead = isDead;
- SubReg = 0;
-}
-
-/// isIdenticalTo - Return true if this operand is identical to the specified
-/// operand.
-bool MachineOperand::isIdenticalTo(const MachineOperand &Other) const {
- if (getType() != Other.getType()) return false;
-
- switch (getType()) {
- default: assert(0 && "Unrecognized operand type");
- case MachineOperand::MO_Register:
- return getReg() == Other.getReg() && isDef() == Other.isDef() &&
- getSubReg() == Other.getSubReg();
- case MachineOperand::MO_Immediate:
- return getImm() == Other.getImm();
- case MachineOperand::MO_FPImmediate:
- return getFPImm() == Other.getFPImm();
- case MachineOperand::MO_MachineBasicBlock:
- return getMBB() == Other.getMBB();
- case MachineOperand::MO_FrameIndex:
- return getIndex() == Other.getIndex();
- case MachineOperand::MO_ConstantPoolIndex:
- return getIndex() == Other.getIndex() && getOffset() == Other.getOffset();
- case MachineOperand::MO_JumpTableIndex:
- return getIndex() == Other.getIndex();
- case MachineOperand::MO_GlobalAddress:
- return getGlobal() == Other.getGlobal() && getOffset() == Other.getOffset();
- case MachineOperand::MO_ExternalSymbol:
- return !strcmp(getSymbolName(), Other.getSymbolName()) &&
- getOffset() == Other.getOffset();
- }
-}
-
-/// print - Print the specified machine operand.
-///
-void MachineOperand::print(std::ostream &OS, const TargetMachine *TM) const {
- switch (getType()) {
- case MachineOperand::MO_Register:
- if (getReg() == 0 || TargetRegisterInfo::isVirtualRegister(getReg())) {
- OS << "%reg" << getReg();
- } else {
- // If the instruction is embedded into a basic block, we can find the
- // target info for the instruction.
- if (TM == 0)
- if (const MachineInstr *MI = getParent())
- if (const MachineBasicBlock *MBB = MI->getParent())
- if (const MachineFunction *MF = MBB->getParent())
- TM = &MF->getTarget();
-
- if (TM)
- OS << "%" << TM->getRegisterInfo()->get(getReg()).Name;
- else
- OS << "%mreg" << getReg();
- }
-
- if (isDef() || isKill() || isDead() || isImplicit()) {
- OS << "<";
- bool NeedComma = false;
- if (isImplicit()) {
- OS << (isDef() ? "imp-def" : "imp-use");
- NeedComma = true;
- } else if (isDef()) {
- OS << "def";
- NeedComma = true;
- }
- if (isKill() || isDead()) {
- if (NeedComma) OS << ",";
- if (isKill()) OS << "kill";
- if (isDead()) OS << "dead";
- }
- OS << ">";
- }
- break;
- case MachineOperand::MO_Immediate:
- OS << getImm();
- break;
- case MachineOperand::MO_FPImmediate:
- if (getFPImm()->getType() == Type::FloatTy) {
- OS << getFPImm()->getValueAPF().convertToFloat();
- } else {
- OS << getFPImm()->getValueAPF().convertToDouble();
- }
- break;
- case MachineOperand::MO_MachineBasicBlock:
- OS << "mbb<"
- << ((Value*)getMBB()->getBasicBlock())->getName()
- << "," << (void*)getMBB() << ">";
- break;
- case MachineOperand::MO_FrameIndex:
- OS << "<fi#" << getIndex() << ">";
- break;
- case MachineOperand::MO_ConstantPoolIndex:
- OS << "<cp#" << getIndex();
- if (getOffset()) OS << "+" << getOffset();
- OS << ">";
- break;
- case MachineOperand::MO_JumpTableIndex:
- OS << "<jt#" << getIndex() << ">";
- break;
- case MachineOperand::MO_GlobalAddress:
- OS << "<ga:" << ((Value*)getGlobal())->getName();
- if (getOffset()) OS << "+" << getOffset();
- OS << ">";
- break;
- case MachineOperand::MO_ExternalSymbol:
- OS << "<es:" << getSymbolName();
- if (getOffset()) OS << "+" << getOffset();
- OS << ">";
- break;
- default:
- assert(0 && "Unrecognized operand type");
- }
-}
-
-//===----------------------------------------------------------------------===//
-// MachineInstr Implementation
-//===----------------------------------------------------------------------===//
-
-/// MachineInstr ctor - This constructor creates a dummy MachineInstr with
-/// TID NULL and no operands.
-MachineInstr::MachineInstr()
- : TID(0), NumImplicitOps(0), Parent(0) {
- // Make sure that we get added to a machine basicblock
- LeakDetector::addGarbageObject(this);
-}
-
-void MachineInstr::addImplicitDefUseOperands() {
- if (TID->ImplicitDefs)
- for (const unsigned *ImpDefs = TID->ImplicitDefs; *ImpDefs; ++ImpDefs)
- addOperand(MachineOperand::CreateReg(*ImpDefs, true, true));
- if (TID->ImplicitUses)
- for (const unsigned *ImpUses = TID->ImplicitUses; *ImpUses; ++ImpUses)
- addOperand(MachineOperand::CreateReg(*ImpUses, false, true));
-}
-
-/// MachineInstr ctor - This constructor create a MachineInstr and add the
-/// implicit operands. It reserves space for number of operands specified by
-/// TargetInstrDesc or the numOperands if it is not zero. (for
-/// instructions with variable number of operands).
-MachineInstr::MachineInstr(const TargetInstrDesc &tid, bool NoImp)
- : TID(&tid), NumImplicitOps(0), Parent(0) {
- if (!NoImp && TID->getImplicitDefs())
- for (const unsigned *ImpDefs = TID->getImplicitDefs(); *ImpDefs; ++ImpDefs)
- NumImplicitOps++;
- if (!NoImp && TID->getImplicitUses())
- for (const unsigned *ImpUses = TID->getImplicitUses(); *ImpUses; ++ImpUses)
- NumImplicitOps++;
- Operands.reserve(NumImplicitOps + TID->getNumOperands());
- if (!NoImp)
- addImplicitDefUseOperands();
- // Make sure that we get added to a machine basicblock
- LeakDetector::addGarbageObject(this);
-}
-
-/// MachineInstr ctor - Work exactly the same as the ctor above, except that the
-/// MachineInstr is created and added to the end of the specified basic block.
-///
-MachineInstr::MachineInstr(MachineBasicBlock *MBB,
- const TargetInstrDesc &tid)
- : TID(&tid), NumImplicitOps(0), Parent(0) {
- assert(MBB && "Cannot use inserting ctor with null basic block!");
- if (TID->ImplicitDefs)
- for (const unsigned *ImpDefs = TID->getImplicitDefs(); *ImpDefs; ++ImpDefs)
- NumImplicitOps++;
- if (TID->ImplicitUses)
- for (const unsigned *ImpUses = TID->getImplicitUses(); *ImpUses; ++ImpUses)
- NumImplicitOps++;
- Operands.reserve(NumImplicitOps + TID->getNumOperands());
- addImplicitDefUseOperands();
- // Make sure that we get added to a machine basicblock
- LeakDetector::addGarbageObject(this);
- MBB->push_back(this); // Add instruction to end of basic block!
-}
-
-/// MachineInstr ctor - Copies MachineInstr arg exactly
-///
-MachineInstr::MachineInstr(const MachineInstr &MI) {
- TID = &MI.getDesc();
- NumImplicitOps = MI.NumImplicitOps;
- Operands.reserve(MI.getNumOperands());
- MemOperands = MI.MemOperands;
-
- // Add operands
- for (unsigned i = 0; i != MI.getNumOperands(); ++i) {
- Operands.push_back(MI.getOperand(i));
- Operands.back().ParentMI = this;
- }
-
- // Set parent, next, and prev to null
- Parent = 0;
- Prev = 0;
- Next = 0;
-}
-
-
-MachineInstr::~MachineInstr() {
- LeakDetector::removeGarbageObject(this);
-#ifndef NDEBUG
- for (unsigned i = 0, e = Operands.size(); i != e; ++i) {
- assert(Operands[i].ParentMI == this && "ParentMI mismatch!");
- assert((!Operands[i].isReg() || !Operands[i].isOnRegUseList()) &&
- "Reg operand def/use list corrupted");
- }
-#endif
-}
-
-/// getOpcode - Returns the opcode of this MachineInstr.
-///
-int MachineInstr::getOpcode() const {
- return TID->Opcode;
-}
-
-/// getRegInfo - If this instruction is embedded into a MachineFunction,
-/// return the MachineRegisterInfo object for the current function, otherwise
-/// return null.
-MachineRegisterInfo *MachineInstr::getRegInfo() {
- if (MachineBasicBlock *MBB = getParent())
- if (MachineFunction *MF = MBB->getParent())
- return &MF->getRegInfo();
- return 0;
-}
-
-/// RemoveRegOperandsFromUseLists - Unlink all of the register operands in
-/// this instruction from their respective use lists. This requires that the
-/// operands already be on their use lists.
-void MachineInstr::RemoveRegOperandsFromUseLists() {
- for (unsigned i = 0, e = Operands.size(); i != e; ++i) {
- if (Operands[i].isReg())
- Operands[i].RemoveRegOperandFromRegInfo();
- }
-}
-
-/// AddRegOperandsToUseLists - Add all of the register operands in
-/// this instruction from their respective use lists. This requires that the
-/// operands not be on their use lists yet.
-void MachineInstr::AddRegOperandsToUseLists(MachineRegisterInfo &RegInfo) {
- for (unsigned i = 0, e = Operands.size(); i != e; ++i) {
- if (Operands[i].isReg())
- Operands[i].AddRegOperandToRegInfo(&RegInfo);
- }
-}
-
-
-/// addOperand - Add the specified operand to the instruction. If it is an
-/// implicit operand, it is added to the end of the operand list. If it is
-/// an explicit operand it is added at the end of the explicit operand list
-/// (before the first implicit operand).
-void MachineInstr::addOperand(const MachineOperand &Op) {
- bool isImpReg = Op.isReg() && Op.isImplicit();
- assert((isImpReg || !OperandsComplete()) &&
- "Trying to add an operand to a machine instr that is already done!");
-
- // If we are adding the operand to the end of the list, our job is simpler.
- // This is true most of the time, so this is a reasonable optimization.
- if (isImpReg || NumImplicitOps == 0) {
- // We can only do this optimization if we know that the operand list won't
- // reallocate.
- if (Operands.empty() || Operands.size()+1 <= Operands.capacity()) {
- Operands.push_back(Op);
-
- // Set the parent of the operand.
- Operands.back().ParentMI = this;
-
- // If the operand is a register, update the operand's use list.
- if (Op.isReg())
- Operands.back().AddRegOperandToRegInfo(getRegInfo());
- return;
- }
- }
-
- // Otherwise, we have to insert a real operand before any implicit ones.
- unsigned OpNo = Operands.size()-NumImplicitOps;
-
- MachineRegisterInfo *RegInfo = getRegInfo();
-
- // If this instruction isn't embedded into a function, then we don't need to
- // update any operand lists.
- if (RegInfo == 0) {
- // Simple insertion, no reginfo update needed for other register operands.
- Operands.insert(Operands.begin()+OpNo, Op);
- Operands[OpNo].ParentMI = this;
-
- // Do explicitly set the reginfo for this operand though, to ensure the
- // next/prev fields are properly nulled out.
- if (Operands[OpNo].isReg())
- Operands[OpNo].AddRegOperandToRegInfo(0);
-
- } else if (Operands.size()+1 <= Operands.capacity()) {
- // Otherwise, we have to remove register operands from their register use
- // list, add the operand, then add the register operands back to their use
- // list. This also must handle the case when the operand list reallocates
- // to somewhere else.
-
- // If insertion of this operand won't cause reallocation of the operand
- // list, just remove the implicit operands, add the operand, then re-add all
- // the rest of the operands.
- for (unsigned i = OpNo, e = Operands.size(); i != e; ++i) {
- assert(Operands[i].isReg() && "Should only be an implicit reg!");
- Operands[i].RemoveRegOperandFromRegInfo();
- }
-
- // Add the operand. If it is a register, add it to the reg list.
- Operands.insert(Operands.begin()+OpNo, Op);
- Operands[OpNo].ParentMI = this;
-
- if (Operands[OpNo].isReg())
- Operands[OpNo].AddRegOperandToRegInfo(RegInfo);
-
- // Re-add all the implicit ops.
- for (unsigned i = OpNo+1, e = Operands.size(); i != e; ++i) {
- assert(Operands[i].isReg() && "Should only be an implicit reg!");
- Operands[i].AddRegOperandToRegInfo(RegInfo);
- }
- } else {
- // Otherwise, we will be reallocating the operand list. Remove all reg
- // operands from their list, then readd them after the operand list is
- // reallocated.
- RemoveRegOperandsFromUseLists();
-
- Operands.insert(Operands.begin()+OpNo, Op);
- Operands[OpNo].ParentMI = this;
-
- // Re-add all the operands.
- AddRegOperandsToUseLists(*RegInfo);
- }
-}
-
-/// RemoveOperand - Erase an operand from an instruction, leaving it with one
-/// fewer operand than it started with.
-///
-void MachineInstr::RemoveOperand(unsigned OpNo) {
- assert(OpNo < Operands.size() && "Invalid operand number");
-
- // Special case removing the last one.
- if (OpNo == Operands.size()-1) {
- // If needed, remove from the reg def/use list.
- if (Operands.back().isReg() && Operands.back().isOnRegUseList())
- Operands.back().RemoveRegOperandFromRegInfo();
-
- Operands.pop_back();
- return;
- }
-
- // Otherwise, we are removing an interior operand. If we have reginfo to
- // update, remove all operands that will be shifted down from their reg lists,
- // move everything down, then re-add them.
- MachineRegisterInfo *RegInfo = getRegInfo();
- if (RegInfo) {
- for (unsigned i = OpNo, e = Operands.size(); i != e; ++i) {
- if (Operands[i].isReg())
- Operands[i].RemoveRegOperandFromRegInfo();
- }
- }
-
- Operands.erase(Operands.begin()+OpNo);
-
- if (RegInfo) {
- for (unsigned i = OpNo, e = Operands.size(); i != e; ++i) {
- if (Operands[i].isReg())
- Operands[i].AddRegOperandToRegInfo(RegInfo);
- }
- }
-}
-
-
-/// removeFromParent - This method unlinks 'this' from the containing basic
-/// block, and returns it, but does not delete it.
-MachineInstr *MachineInstr::removeFromParent() {
- assert(getParent() && "Not embedded in a basic block!");
- getParent()->remove(this);
- return this;
-}
-
-
-/// OperandComplete - Return true if it's illegal to add a new operand
-///
-bool MachineInstr::OperandsComplete() const {
- unsigned short NumOperands = TID->getNumOperands();
- if (!TID->isVariadic() && getNumOperands()-NumImplicitOps >= NumOperands)
- return true; // Broken: we have all the operands of this instruction!
- return false;
-}
-
-/// getNumExplicitOperands - Returns the number of non-implicit operands.
-///
-unsigned MachineInstr::getNumExplicitOperands() const {
- unsigned NumOperands = TID->getNumOperands();
- if (!TID->isVariadic())
- return NumOperands;
-
- for (unsigned e = getNumOperands(); NumOperands != e; ++NumOperands) {
- const MachineOperand &MO = getOperand(NumOperands);
- if (!MO.isRegister() || !MO.isImplicit())
- NumOperands++;
- }
- return NumOperands;
-}
-
-
-/// isDebugLabel - Returns true if the MachineInstr represents a debug label.
-///
-bool MachineInstr::isDebugLabel() const {
- return getOpcode() == TargetInstrInfo::LABEL && getOperand(1).getImm() == 0;
-}
-
-/// findRegisterUseOperandIdx() - Returns the MachineOperand that is a use of
-/// the specific register or -1 if it is not found. It further tightening
-/// the search criteria to a use that kills the register if isKill is true.
-int MachineInstr::findRegisterUseOperandIdx(unsigned Reg, bool isKill,
- const TargetRegisterInfo *TRI) const {
- for (unsigned i = 0, e = getNumOperands(); i != e; ++i) {
- const MachineOperand &MO = getOperand(i);
- if (!MO.isRegister() || !MO.isUse())
- continue;
- unsigned MOReg = MO.getReg();
- if (!MOReg)
- continue;
- if (MOReg == Reg ||
- (TRI &&
- TargetRegisterInfo::isPhysicalRegister(MOReg) &&
- TargetRegisterInfo::isPhysicalRegister(Reg) &&
- TRI->isSubRegister(MOReg, Reg)))
- if (!isKill || MO.isKill())
- return i;
- }
- return -1;
-}
-
-/// findRegisterDefOperandIdx() - Returns the operand index that is a def of
-/// the specified register or -1 if it is not found. If isDead is true, defs
-/// that are not dead are skipped. If TargetRegisterInfo is non-null, then it
-/// also checks if there is a def of a super-register.
-int MachineInstr::findRegisterDefOperandIdx(unsigned Reg, bool isDead,
- const TargetRegisterInfo *TRI) const {
- for (unsigned i = 0, e = getNumOperands(); i != e; ++i) {
- const MachineOperand &MO = getOperand(i);
- if (!MO.isRegister() || !MO.isDef())
- continue;
- unsigned MOReg = MO.getReg();
- if (MOReg == Reg ||
- (TRI &&
- TargetRegisterInfo::isPhysicalRegister(MOReg) &&
- TargetRegisterInfo::isPhysicalRegister(Reg) &&
- TRI->isSubRegister(MOReg, Reg)))
- if (!isDead || MO.isDead())
- return i;
- }
- return -1;
-}
-
-/// findFirstPredOperandIdx() - Find the index of the first operand in the
-/// operand list that is used to represent the predicate. It returns -1 if
-/// none is found.
-int MachineInstr::findFirstPredOperandIdx() const {
- const TargetInstrDesc &TID = getDesc();
- if (TID.isPredicable()) {
- for (unsigned i = 0, e = getNumOperands(); i != e; ++i)
- if (TID.OpInfo[i].isPredicate())
- return i;
- }
-
- return -1;
-}
-
-/// isRegReDefinedByTwoAddr - Returns true if the Reg re-definition is due
-/// to two addr elimination.
-bool MachineInstr::isRegReDefinedByTwoAddr(unsigned Reg) const {
- const TargetInstrDesc &TID = getDesc();
- for (unsigned i = 0, e = getNumOperands(); i != e; ++i) {
- const MachineOperand &MO1 = getOperand(i);
- if (MO1.isRegister() && MO1.isDef() && MO1.getReg() == Reg) {
- for (unsigned j = i+1; j < e; ++j) {
- const MachineOperand &MO2 = getOperand(j);
- if (MO2.isRegister() && MO2.isUse() && MO2.getReg() == Reg &&
- TID.getOperandConstraint(j, TOI::TIED_TO) == (int)i)
- return true;
- }
- }
- }
- return false;
-}
-
-/// copyKillDeadInfo - Copies kill / dead operand properties from MI.
-///
-void MachineInstr::copyKillDeadInfo(const MachineInstr *MI) {
- for (unsigned i = 0, e = MI->getNumOperands(); i != e; ++i) {
- const MachineOperand &MO = MI->getOperand(i);
- if (!MO.isRegister() || (!MO.isKill() && !MO.isDead()))
- continue;
- for (unsigned j = 0, ee = getNumOperands(); j != ee; ++j) {
- MachineOperand &MOp = getOperand(j);
- if (!MOp.isIdenticalTo(MO))
- continue;
- if (MO.isKill())
- MOp.setIsKill();
- else
- MOp.setIsDead();
- break;
- }
- }
-}
-
-/// copyPredicates - Copies predicate operand(s) from MI.
-void MachineInstr::copyPredicates(const MachineInstr *MI) {
- const TargetInstrDesc &TID = MI->getDesc();
- if (!TID.isPredicable())
- return;
- for (unsigned i = 0, e = MI->getNumOperands(); i != e; ++i) {
- if (TID.OpInfo[i].isPredicate()) {
- // Predicated operands must be last operands.
- addOperand(MI->getOperand(i));
- }
- }
-}
-
-/// isSafeToMove - Return true if it is safe to this instruction. If SawStore
-/// true, it means there is a store (or call) between the instruction the
-/// localtion and its intended destination.
-bool MachineInstr::isSafeToMove(const TargetInstrInfo *TII, bool &SawStore) {
- // Ignore stuff that we obviously can't move.
- if (TID->mayStore() || TID->isCall()) {
- SawStore = true;
- return false;
- }
- if (TID->isReturn() || TID->isBranch() || TID->hasUnmodeledSideEffects())
- return false;
-
- // See if this instruction does a load. If so, we have to guarantee that the
- // loaded value doesn't change between the load and the its intended
- // destination. The check for isInvariantLoad gives the targe the chance to
- // classify the load as always returning a constant, e.g. a constant pool
- // load.
- if (TID->mayLoad() && !TII->isInvariantLoad(this)) {
- // Otherwise, this is a real load. If there is a store between the load and
- // end of block, we can't sink the load.
- //
- // FIXME: we can't do this transformation until we know that the load is
- // not volatile, and machineinstrs don't keep this info. :(
- //
- //if (SawStore)
- return false;
- }
- return true;
-}
-
-void MachineInstr::dump() const {
- cerr << " " << *this;
-}
-
-void MachineInstr::print(std::ostream &OS, const TargetMachine *TM) const {
- // Specialize printing if op#0 is definition
- unsigned StartOp = 0;
- if (getNumOperands() && getOperand(0).isRegister() && getOperand(0).isDef()) {
- getOperand(0).print(OS, TM);
- OS << " = ";
- ++StartOp; // Don't print this operand again!
- }
-
- OS << getDesc().getName();
-
- for (unsigned i = StartOp, e = getNumOperands(); i != e; ++i) {
- if (i != StartOp)
- OS << ",";
- OS << " ";
- getOperand(i).print(OS, TM);
- }
-
- if (getNumMemOperands() > 0) {
- OS << ", Mem:";
- for (unsigned i = 0; i < getNumMemOperands(); i++) {
- const MachineMemOperand &MRO = getMemOperand(i);
- const Value *V = MRO.getValue();
-
- assert((MRO.isLoad() || MRO.isStore()) &&
- "SV has to be a load, store or both.");
-
- if (MRO.isVolatile())
- OS << "Volatile ";
-
- if (MRO.isLoad())
- OS << "LD";
- if (MRO.isStore())
- OS << "ST";
-
- OS << "(" << MRO.getSize() << "," << MRO.getAlignment() << ") [";
-
- if (!V)
- OS << "<unknown>";
- else if (!V->getName().empty())
- OS << V->getName();
- else if (isa<PseudoSourceValue>(V))
- OS << *V;
- else
- OS << V;
-
- OS << " + " << MRO.getOffset() << "]";
- }
- }
-
- OS << "\n";
-}
-
-bool MachineInstr::addRegisterKilled(unsigned IncomingReg,
- const TargetRegisterInfo *RegInfo,
- bool AddIfNotFound) {
- bool isPhysReg = TargetRegisterInfo::isPhysicalRegister(IncomingReg);
- bool Found = false;
- SmallVector<unsigned,4> DeadOps;
- for (unsigned i = 0, e = getNumOperands(); i != e; ++i) {
- MachineOperand &MO = getOperand(i);
- if (!MO.isRegister() || !MO.isUse())
- continue;
- unsigned Reg = MO.getReg();
- if (!Reg)
- continue;
-
- if (Reg == IncomingReg) {
- if (!Found) // One kill of reg per instruction.
- MO.setIsKill();
- Found = true;
- } else if (isPhysReg && MO.isKill() &&
- TargetRegisterInfo::isPhysicalRegister(Reg)) {
- // A super-register kill already exists.
- if (RegInfo->isSuperRegister(IncomingReg, Reg))
- Found = true;
- else if (RegInfo->isSubRegister(IncomingReg, Reg))
- DeadOps.push_back(i);
- }
- }
-
- // Trim unneeded kill operands.
- while (!DeadOps.empty()) {
- unsigned OpIdx = DeadOps.back();
- if (getOperand(OpIdx).isImplicit())
- RemoveOperand(OpIdx);
- else
- getOperand(OpIdx).setIsKill(false);
- DeadOps.pop_back();
- }
-
- // If not found, this means an alias of one of the operands is killed. Add a
- // new implicit operand if required.
- if (!Found && AddIfNotFound) {
- addOperand(MachineOperand::CreateReg(IncomingReg,
- false /*IsDef*/,
- true /*IsImp*/,
- true /*IsKill*/));
- return true;
- }
- return Found;
-}
-
-bool MachineInstr::addRegisterDead(unsigned IncomingReg,
- const TargetRegisterInfo *RegInfo,
- bool AddIfNotFound) {
- bool isPhysReg = TargetRegisterInfo::isPhysicalRegister(IncomingReg);
- bool Found = false;
- SmallVector<unsigned,4> DeadOps;
- for (unsigned i = 0, e = getNumOperands(); i != e; ++i) {
- MachineOperand &MO = getOperand(i);
- if (!MO.isRegister() || !MO.isDef())
- continue;
- unsigned Reg = MO.getReg();
- if (Reg == IncomingReg) {
- MO.setIsDead();
- Found = true;
- } else if (isPhysReg && MO.isDead() &&
- TargetRegisterInfo::isPhysicalRegister(Reg)) {
- // There exists a super-register that's marked dead.
- if (RegInfo->isSuperRegister(IncomingReg, Reg))
- Found = true;
- else if (RegInfo->isSubRegister(IncomingReg, Reg))
- DeadOps.push_back(i);
- }
- }
-
- // Trim unneeded dead operands.
- while (!DeadOps.empty()) {
- unsigned OpIdx = DeadOps.back();
- if (getOperand(OpIdx).isImplicit())
- RemoveOperand(OpIdx);
- else
- getOperand(OpIdx).setIsDead(false);
- DeadOps.pop_back();
- }
-
- // If not found, this means an alias of one of the operand is dead. Add a
- // new implicit operand.
- if (!Found && AddIfNotFound) {
- addOperand(MachineOperand::CreateReg(IncomingReg, true/*IsDef*/,
- true/*IsImp*/,false/*IsKill*/,
- true/*IsDead*/));
- return true;
- }
- return Found;
-}
-
-/// copyKillDeadInfo - copies killed/dead information from one instr to another
-void MachineInstr::copyKillDeadInfo(MachineInstr *OldMI,
- const TargetRegisterInfo *RegInfo) {
- // If the instruction defines any virtual registers, update the VarInfo,
- // kill and dead information for the instruction.
- for (unsigned i = 0, e = OldMI->getNumOperands(); i != e; ++i) {
- MachineOperand &MO = OldMI->getOperand(i);
- if (MO.isRegister() && MO.getReg() &&
- TargetRegisterInfo::isVirtualRegister(MO.getReg())) {
- unsigned Reg = MO.getReg();
- if (MO.isDef()) {
- if (MO.isDead()) {
- MO.setIsDead(false);
- addRegisterDead(Reg, RegInfo);
- }
- }
- if (MO.isKill()) {
- MO.setIsKill(false);
- addRegisterKilled(Reg, RegInfo);
- }
- }
- }
-}
diff --git a/release_23/lib/CodeGen/MachineLICM.cpp b/release_23/lib/CodeGen/MachineLICM.cpp
deleted file mode 100644
index ffcc02e3b832..000000000000
--- a/release_23/lib/CodeGen/MachineLICM.cpp
+++ /dev/null
@@ -1,327 +0,0 @@
-//===-- MachineLICM.cpp - Machine Loop Invariant Code Motion Pass ---------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This pass performs loop invariant code motion on machine instructions. We
-// attempt to remove as much code from the body of a loop as possible.
-//
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "machine-licm"
-#include "llvm/CodeGen/Passes.h"
-#include "llvm/CodeGen/MachineDominators.h"
-#include "llvm/CodeGen/MachineLoopInfo.h"
-#include "llvm/CodeGen/MachineRegisterInfo.h"
-#include "llvm/Target/TargetRegisterInfo.h"
-#include "llvm/Target/TargetInstrInfo.h"
-#include "llvm/Target/TargetMachine.h"
-#include "llvm/ADT/SmallVector.h"
-#include "llvm/ADT/Statistic.h"
-#include "llvm/Support/CommandLine.h"
-#include "llvm/Support/Compiler.h"
-#include "llvm/Support/Debug.h"
-
-using namespace llvm;
-
-STATISTIC(NumHoisted, "Number of machine instructions hoisted out of loops");
-
-namespace {
- class VISIBILITY_HIDDEN MachineLICM : public MachineFunctionPass {
- const TargetMachine *TM;
- const TargetInstrInfo *TII;
- MachineFunction *CurMF; // Current MachineFunction
-
- // Various analyses that we use...
- MachineLoopInfo *LI; // Current MachineLoopInfo
- MachineDominatorTree *DT; // Machine dominator tree for the current Loop
- MachineRegisterInfo *RegInfo; // Machine register information
-
- // State that is updated as we process loops
- bool Changed; // True if a loop is changed.
- MachineLoop *CurLoop; // The current loop we are working on.
- public:
- static char ID; // Pass identification, replacement for typeid
- MachineLICM() : MachineFunctionPass((intptr_t)&ID) {}
-
- virtual bool runOnMachineFunction(MachineFunction &MF);
-
- // FIXME: Loop preheaders?
- virtual void getAnalysisUsage(AnalysisUsage &AU) const {
- AU.setPreservesCFG();
- AU.addRequired<MachineLoopInfo>();
- AU.addRequired<MachineDominatorTree>();
- AU.addPreserved<MachineLoopInfo>();
- AU.addPreserved<MachineDominatorTree>();
- MachineFunctionPass::getAnalysisUsage(AU);
- }
- private:
- /// VisitAllLoops - Visit all of the loops in depth first order and try to
- /// hoist invariant instructions from them.
- ///
- void VisitAllLoops(MachineLoop *L) {
- const std::vector<MachineLoop*> &SubLoops = L->getSubLoops();
-
- for (MachineLoop::iterator
- I = SubLoops.begin(), E = SubLoops.end(); I != E; ++I) {
- MachineLoop *ML = *I;
-
- // Traverse the body of the loop in depth first order on the dominator
- // tree so that we are guaranteed to see definitions before we see uses.
- VisitAllLoops(ML);
- HoistRegion(DT->getNode(ML->getHeader()));
- }
-
- HoistRegion(DT->getNode(L->getHeader()));
- }
-
- /// IsInSubLoop - A little predicate that returns true if the specified
- /// basic block is in a subloop of the current one, not the current one
- /// itself.
- ///
- bool IsInSubLoop(MachineBasicBlock *BB) {
- assert(CurLoop->contains(BB) && "Only valid if BB is IN the loop");
- return LI->getLoopFor(BB) != CurLoop;
- }
-
- /// IsLoopInvariantInst - Returns true if the instruction is loop
- /// invariant. I.e., all virtual register operands are defined outside of
- /// the loop, physical registers aren't accessed (explicitly or implicitly),
- /// and the instruction is hoistable.
- ///
- bool IsLoopInvariantInst(MachineInstr &I);
-
- /// FindPredecessors - Get all of the predecessors of the loop that are not
- /// back-edges.
- ///
- void FindPredecessors(std::vector<MachineBasicBlock*> &Preds) {
- const MachineBasicBlock *Header = CurLoop->getHeader();
-
- for (MachineBasicBlock::const_pred_iterator
- I = Header->pred_begin(), E = Header->pred_end(); I != E; ++I)
- if (!CurLoop->contains(*I))
- Preds.push_back(*I);
- }
-
- /// MoveInstToEndOfBlock - Moves the machine instruction to the bottom of
- /// the predecessor basic block (but before the terminator instructions).
- ///
- void MoveInstToEndOfBlock(MachineBasicBlock *ToMBB,
- MachineBasicBlock *FromMBB,
- MachineInstr *MI) {
- DEBUG({
- DOUT << "Hoisting " << *MI;
- if (ToMBB->getBasicBlock())
- DOUT << " to MachineBasicBlock "
- << ToMBB->getBasicBlock()->getName();
- if (FromMBB->getBasicBlock())
- DOUT << " from MachineBasicBlock "
- << FromMBB->getBasicBlock()->getName();
- DOUT << "\n";
- });
-
- MachineBasicBlock::iterator WhereIter = ToMBB->getFirstTerminator();
- MachineBasicBlock::iterator To, From = FromMBB->begin();
-
- while (&*From != MI)
- ++From;
-
- assert(From != FromMBB->end() && "Didn't find instr in BB!");
-
- To = From;
- ToMBB->splice(WhereIter, FromMBB, From, ++To);
- ++NumHoisted;
- }
-
- /// HoistRegion - Walk the specified region of the CFG (defined by all
- /// blocks dominated by the specified block, and that are in the current
- /// loop) in depth first order w.r.t the DominatorTree. This allows us to
- /// visit definitions before uses, allowing us to hoist a loop body in one
- /// pass without iteration.
- ///
- void HoistRegion(MachineDomTreeNode *N);
-
- /// Hoist - When an instruction is found to only use loop invariant operands
- /// that is safe to hoist, this instruction is called to do the dirty work.
- ///
- void Hoist(MachineInstr &MI);
- };
-
- char MachineLICM::ID = 0;
- RegisterPass<MachineLICM> X("machine-licm",
- "Machine Loop Invariant Code Motion");
-} // end anonymous namespace
-
-FunctionPass *llvm::createMachineLICMPass() { return new MachineLICM(); }
-
-/// Hoist expressions out of the specified loop. Note, alias info for inner loop
-/// is not preserved so it is not a good idea to run LICM multiple times on one
-/// loop.
-///
-bool MachineLICM::runOnMachineFunction(MachineFunction &MF) {
- DOUT << "******** Machine LICM ********\n";
-
- Changed = false;
- CurMF = &MF;
- TM = &CurMF->getTarget();
- TII = TM->getInstrInfo();
- RegInfo = &CurMF->getRegInfo();
-
- // Get our Loop information...
- LI = &getAnalysis<MachineLoopInfo>();
- DT = &getAnalysis<MachineDominatorTree>();
-
- for (MachineLoopInfo::iterator
- I = LI->begin(), E = LI->end(); I != E; ++I) {
- CurLoop = *I;
-
- // Visit all of the instructions of the loop. We want to visit the subloops
- // first, though, so that we can hoist their invariants first into their
- // containing loop before we process that loop.
- VisitAllLoops(CurLoop);
- }
-
- return Changed;
-}
-
-/// HoistRegion - Walk the specified region of the CFG (defined by all blocks
-/// dominated by the specified block, and that are in the current loop) in depth
-/// first order w.r.t the DominatorTree. This allows us to visit definitions
-/// before uses, allowing us to hoist a loop body in one pass without iteration.
-///
-void MachineLICM::HoistRegion(MachineDomTreeNode *N) {
- assert(N != 0 && "Null dominator tree node?");
- MachineBasicBlock *BB = N->getBlock();
-
- // If this subregion is not in the top level loop at all, exit.
- if (!CurLoop->contains(BB)) return;
-
- // Only need to process the contents of this block if it is not part of a
- // subloop (which would already have been processed).
- if (!IsInSubLoop(BB))
- for (MachineBasicBlock::iterator
- I = BB->begin(), E = BB->end(); I != E; ) {
- MachineInstr &MI = *I++;
-
- // Try hoisting the instruction out of the loop. We can only do this if
- // all of the operands of the instruction are loop invariant and if it is
- // safe to hoist the instruction.
- Hoist(MI);
- }
-
- const std::vector<MachineDomTreeNode*> &Children = N->getChildren();
-
- for (unsigned I = 0, E = Children.size(); I != E; ++I)
- HoistRegion(Children[I]);
-}
-
-/// IsLoopInvariantInst - Returns true if the instruction is loop
-/// invariant. I.e., all virtual register operands are defined outside of the
-/// loop, physical registers aren't accessed explicitly, and there are no side
-/// effects that aren't captured by the operands or other flags.
-///
-bool MachineLICM::IsLoopInvariantInst(MachineInstr &I) {
- const TargetInstrDesc &TID = I.getDesc();
-
- // Ignore stuff that we obviously can't hoist.
- if (TID.mayStore() || TID.isCall() || TID.isReturn() || TID.isBranch() ||
- TID.hasUnmodeledSideEffects())
- return false;
-
- if (TID.mayLoad()) {
- // Okay, this instruction does a load. As a refinement, allow the target
- // to decide whether the loaded value is actually a constant. If so, we
- // can actually use it as a load.
- if (!TII->isInvariantLoad(&I)) {
- // FIXME: we should be able to sink loads with no other side effects if
- // there is nothing that can change memory from here until the end of
- // block. This is a trivial form of alias analysis.
- return false;
- }
- }
-
- DEBUG({
- DOUT << "--- Checking if we can hoist " << I;
- if (I.getDesc().getImplicitUses()) {
- DOUT << " * Instruction has implicit uses:\n";
-
- const TargetRegisterInfo *TRI = TM->getRegisterInfo();
- for (const unsigned *ImpUses = I.getDesc().getImplicitUses();
- *ImpUses; ++ImpUses)
- DOUT << " -> " << TRI->getName(*ImpUses) << "\n";
- }
-
- if (I.getDesc().getImplicitDefs()) {
- DOUT << " * Instruction has implicit defines:\n";
-
- const TargetRegisterInfo *TRI = TM->getRegisterInfo();
- for (const unsigned *ImpDefs = I.getDesc().getImplicitDefs();
- *ImpDefs; ++ImpDefs)
- DOUT << " -> " << TRI->getName(*ImpDefs) << "\n";
- }
-
- //if (TII->hasUnmodelledSideEffects(&I))
- //DOUT << " * Instruction has side effects.\n";
- });
-
- // The instruction is loop invariant if all of its operands are loop-invariant
- for (unsigned i = 0, e = I.getNumOperands(); i != e; ++i) {
- const MachineOperand &MO = I.getOperand(i);
-
- if (!MO.isRegister() || !MO.isUse())
- continue;
-
- unsigned Reg = MO.getReg();
- if (Reg == 0) continue;
-
- // Don't hoist instructions that access physical registers.
- if (TargetRegisterInfo::isPhysicalRegister(Reg))
- return false;
-
- assert(RegInfo->getVRegDef(Reg)&&"Machine instr not mapped for this vreg?");
-
- // If the loop contains the definition of an operand, then the instruction
- // isn't loop invariant.
- if (CurLoop->contains(RegInfo->getVRegDef(Reg)->getParent()))
- return false;
- }
-
- // If we got this far, the instruction is loop invariant!
- return true;
-}
-
-/// Hoist - When an instruction is found to only use loop invariant operands
-/// that is safe to hoist, this instruction is called to do the dirty work.
-///
-void MachineLICM::Hoist(MachineInstr &MI) {
- if (!IsLoopInvariantInst(MI)) return;
-
- std::vector<MachineBasicBlock*> Preds;
-
- // Non-back-edge predecessors.
- FindPredecessors(Preds);
-
- // Either we don't have any predecessors(?!) or we have more than one, which
- // is forbidden.
- if (Preds.empty() || Preds.size() != 1) return;
-
- // Check that the predecessor is qualified to take the hoisted
- // instruction. I.e., there is only one edge from the predecessor, and it's to
- // the loop header.
- MachineBasicBlock *MBB = Preds.front();
-
- // FIXME: We are assuming at first that the basic block coming into this loop
- // has only one successor. This isn't the case in general because we haven't
- // broken critical edges or added preheaders.
- if (MBB->succ_size() != 1) return;
- assert(*MBB->succ_begin() == CurLoop->getHeader() &&
- "The predecessor doesn't feed directly into the loop header!");
-
- // Now move the instructions to the predecessor.
- MoveInstToEndOfBlock(MBB, MI.getParent(), &MI);
- Changed = true;
-}
diff --git a/release_23/lib/CodeGen/MachineLoopInfo.cpp b/release_23/lib/CodeGen/MachineLoopInfo.cpp
deleted file mode 100644
index 007317ccb599..000000000000
--- a/release_23/lib/CodeGen/MachineLoopInfo.cpp
+++ /dev/null
@@ -1,42 +0,0 @@
-//===- MachineLoopInfo.cpp - Natural Loop Calculator ----------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines the MachineLoopInfo class that is used to identify natural
-// loops and determine the loop depth of various nodes of the CFG. Note that
-// the loops identified may actually be several natural loops that share the
-// same header node... not just a single natural loop.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/CodeGen/MachineLoopInfo.h"
-#include "llvm/CodeGen/MachineDominators.h"
-#include "llvm/CodeGen/Passes.h"
-using namespace llvm;
-
-TEMPLATE_INSTANTIATION(class LoopBase<MachineBasicBlock>);
-TEMPLATE_INSTANTIATION(class LoopInfoBase<MachineBasicBlock>);
-
-char MachineLoopInfo::ID = 0;
-namespace {
- RegisterPass<MachineLoopInfo>
- X("machine-loops", "Machine Natural Loop Construction", true);
-}
-
-const PassInfo *llvm::MachineLoopInfoID = X.getPassInfo();
-
-bool MachineLoopInfo::runOnMachineFunction(MachineFunction &) {
- releaseMemory();
- LI->Calculate(getAnalysis<MachineDominatorTree>().getBase()); // Update
- return false;
-}
-
-void MachineLoopInfo::getAnalysisUsage(AnalysisUsage &AU) const {
- AU.setPreservesAll();
- AU.addRequired<MachineDominatorTree>();
-}
diff --git a/release_23/lib/CodeGen/MachineModuleInfo.cpp b/release_23/lib/CodeGen/MachineModuleInfo.cpp
deleted file mode 100644
index 0cfcc61b7805..000000000000
--- a/release_23/lib/CodeGen/MachineModuleInfo.cpp
+++ /dev/null
@@ -1,1945 +0,0 @@
-//===-- llvm/CodeGen/MachineModuleInfo.cpp ----------------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/CodeGen/MachineModuleInfo.h"
-
-#include "llvm/Constants.h"
-#include "llvm/CodeGen/MachineFunctionPass.h"
-#include "llvm/CodeGen/MachineFunction.h"
-#include "llvm/CodeGen/MachineLocation.h"
-#include "llvm/Target/TargetInstrInfo.h"
-#include "llvm/Target/TargetMachine.h"
-#include "llvm/Target/TargetOptions.h"
-#include "llvm/DerivedTypes.h"
-#include "llvm/GlobalVariable.h"
-#include "llvm/Intrinsics.h"
-#include "llvm/Instructions.h"
-#include "llvm/Module.h"
-#include "llvm/Support/Dwarf.h"
-#include "llvm/Support/Streams.h"
-using namespace llvm;
-using namespace llvm::dwarf;
-
-// Handle the Pass registration stuff necessary to use TargetData's.
-namespace {
- RegisterPass<MachineModuleInfo> X("machinemoduleinfo", "Module Information");
-}
-char MachineModuleInfo::ID = 0;
-
-//===----------------------------------------------------------------------===//
-
-/// getGlobalVariablesUsing - Return all of the GlobalVariables which have the
-/// specified value in their initializer somewhere.
-static void
-getGlobalVariablesUsing(Value *V, std::vector<GlobalVariable*> &Result) {
- // Scan though value users.
- for (Value::use_iterator I = V->use_begin(), E = V->use_end(); I != E; ++I) {
- if (GlobalVariable *GV = dyn_cast<GlobalVariable>(*I)) {
- // If the user is a GlobalVariable then add to result.
- Result.push_back(GV);
- } else if (Constant *C = dyn_cast<Constant>(*I)) {
- // If the user is a constant variable then scan its users
- getGlobalVariablesUsing(C, Result);
- }
- }
-}
-
-/// getGlobalVariablesUsing - Return all of the GlobalVariables that use the
-/// named GlobalVariable.
-static std::vector<GlobalVariable*>
-getGlobalVariablesUsing(Module &M, const std::string &RootName) {
- std::vector<GlobalVariable*> Result; // GlobalVariables matching criteria.
-
- std::vector<const Type*> FieldTypes;
- FieldTypes.push_back(Type::Int32Ty);
- FieldTypes.push_back(Type::Int32Ty);
-
- // Get the GlobalVariable root.
- GlobalVariable *UseRoot = M.getGlobalVariable(RootName,
- StructType::get(FieldTypes));
-
- // If present and linkonce then scan for users.
- if (UseRoot && UseRoot->hasLinkOnceLinkage()) {
- getGlobalVariablesUsing(UseRoot, Result);
- }
-
- return Result;
-}
-
-/// isStringValue - Return true if the given value can be coerced to a string.
-///
-static bool isStringValue(Value *V) {
- if (GlobalVariable *GV = dyn_cast<GlobalVariable>(V)) {
- if (GV->hasInitializer() && isa<ConstantArray>(GV->getInitializer())) {
- ConstantArray *Init = cast<ConstantArray>(GV->getInitializer());
- return Init->isString();
- }
- } else if (Constant *C = dyn_cast<Constant>(V)) {
- if (GlobalValue *GV = dyn_cast<GlobalValue>(C))
- return isStringValue(GV);
- else if (ConstantExpr *CE = dyn_cast<ConstantExpr>(C)) {
- if (CE->getOpcode() == Instruction::GetElementPtr) {
- if (CE->getNumOperands() == 3 &&
- cast<Constant>(CE->getOperand(1))->isNullValue() &&
- isa<ConstantInt>(CE->getOperand(2))) {
- return isStringValue(CE->getOperand(0));
- }
- }
- }
- }
- return false;
-}
-
-/// getGlobalVariable - Return either a direct or cast Global value.
-///
-static GlobalVariable *getGlobalVariable(Value *V) {
- if (GlobalVariable *GV = dyn_cast<GlobalVariable>(V)) {
- return GV;
- } else if (ConstantExpr *CE = dyn_cast<ConstantExpr>(V)) {
- if (CE->getOpcode() == Instruction::BitCast) {
- return dyn_cast<GlobalVariable>(CE->getOperand(0));
- } else if (CE->getOpcode() == Instruction::GetElementPtr) {
- for (unsigned int i=1; i<CE->getNumOperands(); i++) {
- if (!CE->getOperand(i)->isNullValue())
- return NULL;
- }
- return dyn_cast<GlobalVariable>(CE->getOperand(0));
- }
- }
- return NULL;
-}
-
-/// isGlobalVariable - Return true if the given value can be coerced to a
-/// GlobalVariable.
-static bool isGlobalVariable(Value *V) {
- if (isa<GlobalVariable>(V) || isa<ConstantPointerNull>(V)) {
- return true;
- } else if (ConstantExpr *CE = dyn_cast<ConstantExpr>(V)) {
- if (CE->getOpcode() == Instruction::BitCast) {
- return isa<GlobalVariable>(CE->getOperand(0));
- } else if (CE->getOpcode() == Instruction::GetElementPtr) {
- for (unsigned int i=1; i<CE->getNumOperands(); i++) {
- if (!CE->getOperand(i)->isNullValue())
- return false;
- }
- return isa<GlobalVariable>(CE->getOperand(0));
- }
- }
- return false;
-}
-
-/// getUIntOperand - Return ith operand if it is an unsigned integer.
-///
-static ConstantInt *getUIntOperand(GlobalVariable *GV, unsigned i) {
- // Make sure the GlobalVariable has an initializer.
- if (!GV->hasInitializer()) return NULL;
-
- // Get the initializer constant.
- ConstantStruct *CI = dyn_cast<ConstantStruct>(GV->getInitializer());
- if (!CI) return NULL;
-
- // Check if there is at least i + 1 operands.
- unsigned N = CI->getNumOperands();
- if (i >= N) return NULL;
-
- // Check constant.
- return dyn_cast<ConstantInt>(CI->getOperand(i));
-}
-
-//===----------------------------------------------------------------------===//
-
-/// ApplyToFields - Target the visitor to each field of the debug information
-/// descriptor.
-void DIVisitor::ApplyToFields(DebugInfoDesc *DD) {
- DD->ApplyToFields(this);
-}
-
-//===----------------------------------------------------------------------===//
-/// DICountVisitor - This DIVisitor counts all the fields in the supplied debug
-/// the supplied DebugInfoDesc.
-class DICountVisitor : public DIVisitor {
-private:
- unsigned Count; // Running count of fields.
-
-public:
- DICountVisitor() : DIVisitor(), Count(0) {}
-
- // Accessors.
- unsigned getCount() const { return Count; }
-
- /// Apply - Count each of the fields.
- ///
- virtual void Apply(int &Field) { ++Count; }
- virtual void Apply(unsigned &Field) { ++Count; }
- virtual void Apply(int64_t &Field) { ++Count; }
- virtual void Apply(uint64_t &Field) { ++Count; }
- virtual void Apply(bool &Field) { ++Count; }
- virtual void Apply(std::string &Field) { ++Count; }
- virtual void Apply(DebugInfoDesc *&Field) { ++Count; }
- virtual void Apply(GlobalVariable *&Field) { ++Count; }
- virtual void Apply(std::vector<DebugInfoDesc *> &Field) {
- ++Count;
- }
-};
-
-//===----------------------------------------------------------------------===//
-/// DIDeserializeVisitor - This DIVisitor deserializes all the fields in the
-/// supplied DebugInfoDesc.
-class DIDeserializeVisitor : public DIVisitor {
-private:
- DIDeserializer &DR; // Active deserializer.
- unsigned I; // Current operand index.
- ConstantStruct *CI; // GlobalVariable constant initializer.
-
-public:
- DIDeserializeVisitor(DIDeserializer &D, GlobalVariable *GV)
- : DIVisitor()
- , DR(D)
- , I(0)
- , CI(cast<ConstantStruct>(GV->getInitializer()))
- {}
-
- /// Apply - Set the value of each of the fields.
- ///
- virtual void Apply(int &Field) {
- Constant *C = CI->getOperand(I++);
- Field = cast<ConstantInt>(C)->getSExtValue();
- }
- virtual void Apply(unsigned &Field) {
- Constant *C = CI->getOperand(I++);
- Field = cast<ConstantInt>(C)->getZExtValue();
- }
- virtual void Apply(int64_t &Field) {
- Constant *C = CI->getOperand(I++);
- Field = cast<ConstantInt>(C)->getSExtValue();
- }
- virtual void Apply(uint64_t &Field) {
- Constant *C = CI->getOperand(I++);
- Field = cast<ConstantInt>(C)->getZExtValue();
- }
- virtual void Apply(bool &Field) {
- Constant *C = CI->getOperand(I++);
- Field = cast<ConstantInt>(C)->getZExtValue();
- }
- virtual void Apply(std::string &Field) {
- Constant *C = CI->getOperand(I++);
- Field = C->getStringValue();
- }
- virtual void Apply(DebugInfoDesc *&Field) {
- Constant *C = CI->getOperand(I++);
- Field = DR.Deserialize(C);
- }
- virtual void Apply(GlobalVariable *&Field) {
- Constant *C = CI->getOperand(I++);
- Field = getGlobalVariable(C);
- }
- virtual void Apply(std::vector<DebugInfoDesc *> &Field) {
- Field.resize(0);
- Constant *C = CI->getOperand(I++);
- GlobalVariable *GV = getGlobalVariable(C);
- if (GV->hasInitializer()) {
- if (ConstantArray *CA = dyn_cast<ConstantArray>(GV->getInitializer())) {
- for (unsigned i = 0, N = CA->getNumOperands(); i < N; ++i) {
- GlobalVariable *GVE = getGlobalVariable(CA->getOperand(i));
- DebugInfoDesc *DE = DR.Deserialize(GVE);
- Field.push_back(DE);
- }
- } else if (GV->getInitializer()->isNullValue()) {
- if (const ArrayType *T =
- dyn_cast<ArrayType>(GV->getType()->getElementType())) {
- Field.resize(T->getNumElements());
- }
- }
- }
- }
-};
-
-//===----------------------------------------------------------------------===//
-/// DISerializeVisitor - This DIVisitor serializes all the fields in
-/// the supplied DebugInfoDesc.
-class DISerializeVisitor : public DIVisitor {
-private:
- DISerializer &SR; // Active serializer.
- std::vector<Constant*> &Elements; // Element accumulator.
-
-public:
- DISerializeVisitor(DISerializer &S, std::vector<Constant*> &E)
- : DIVisitor()
- , SR(S)
- , Elements(E)
- {}
-
- /// Apply - Set the value of each of the fields.
- ///
- virtual void Apply(int &Field) {
- Elements.push_back(ConstantInt::get(Type::Int32Ty, int32_t(Field)));
- }
- virtual void Apply(unsigned &Field) {
- Elements.push_back(ConstantInt::get(Type::Int32Ty, uint32_t(Field)));
- }
- virtual void Apply(int64_t &Field) {
- Elements.push_back(ConstantInt::get(Type::Int64Ty, int64_t(Field)));
- }
- virtual void Apply(uint64_t &Field) {
- Elements.push_back(ConstantInt::get(Type::Int64Ty, uint64_t(Field)));
- }
- virtual void Apply(bool &Field) {
- Elements.push_back(ConstantInt::get(Type::Int1Ty, Field));
- }
- virtual void Apply(std::string &Field) {
- Elements.push_back(SR.getString(Field));
- }
- virtual void Apply(DebugInfoDesc *&Field) {
- GlobalVariable *GV = NULL;
-
- // If non-NULL then convert to global.
- if (Field) GV = SR.Serialize(Field);
-
- // FIXME - At some point should use specific type.
- const PointerType *EmptyTy = SR.getEmptyStructPtrType();
-
- if (GV) {
- // Set to pointer to global.
- Elements.push_back(ConstantExpr::getBitCast(GV, EmptyTy));
- } else {
- // Use NULL.
- Elements.push_back(ConstantPointerNull::get(EmptyTy));
- }
- }
- virtual void Apply(GlobalVariable *&Field) {
- const PointerType *EmptyTy = SR.getEmptyStructPtrType();
- if (Field) {
- Elements.push_back(ConstantExpr::getBitCast(Field, EmptyTy));
- } else {
- Elements.push_back(ConstantPointerNull::get(EmptyTy));
- }
- }
- virtual void Apply(std::vector<DebugInfoDesc *> &Field) {
- const PointerType *EmptyTy = SR.getEmptyStructPtrType();
- unsigned N = Field.size();
- ArrayType *AT = ArrayType::get(EmptyTy, N);
- std::vector<Constant *> ArrayElements;
-
- for (unsigned i = 0, N = Field.size(); i < N; ++i) {
- if (DebugInfoDesc *Element = Field[i]) {
- GlobalVariable *GVE = SR.Serialize(Element);
- Constant *CE = ConstantExpr::getBitCast(GVE, EmptyTy);
- ArrayElements.push_back(cast<Constant>(CE));
- } else {
- ArrayElements.push_back(ConstantPointerNull::get(EmptyTy));
- }
- }
-
- Constant *CA = ConstantArray::get(AT, ArrayElements);
- GlobalVariable *CAGV = new GlobalVariable(AT, true,
- GlobalValue::InternalLinkage,
- CA, "llvm.dbg.array",
- SR.getModule());
- CAGV->setSection("llvm.metadata");
- Constant *CAE = ConstantExpr::getBitCast(CAGV, EmptyTy);
- Elements.push_back(CAE);
- }
-};
-
-//===----------------------------------------------------------------------===//
-/// DIGetTypesVisitor - This DIVisitor gathers all the field types in
-/// the supplied DebugInfoDesc.
-class DIGetTypesVisitor : public DIVisitor {
-private:
- DISerializer &SR; // Active serializer.
- std::vector<const Type*> &Fields; // Type accumulator.
-
-public:
- DIGetTypesVisitor(DISerializer &S, std::vector<const Type*> &F)
- : DIVisitor()
- , SR(S)
- , Fields(F)
- {}
-
- /// Apply - Set the value of each of the fields.
- ///
- virtual void Apply(int &Field) {
- Fields.push_back(Type::Int32Ty);
- }
- virtual void Apply(unsigned &Field) {
- Fields.push_back(Type::Int32Ty);
- }
- virtual void Apply(int64_t &Field) {
- Fields.push_back(Type::Int64Ty);
- }
- virtual void Apply(uint64_t &Field) {
- Fields.push_back(Type::Int64Ty);
- }
- virtual void Apply(bool &Field) {
- Fields.push_back(Type::Int1Ty);
- }
- virtual void Apply(std::string &Field) {
- Fields.push_back(SR.getStrPtrType());
- }
- virtual void Apply(DebugInfoDesc *&Field) {
- // FIXME - At some point should use specific type.
- const PointerType *EmptyTy = SR.getEmptyStructPtrType();
- Fields.push_back(EmptyTy);
- }
- virtual void Apply(GlobalVariable *&Field) {
- const PointerType *EmptyTy = SR.getEmptyStructPtrType();
- Fields.push_back(EmptyTy);
- }
- virtual void Apply(std::vector<DebugInfoDesc *> &Field) {
- const PointerType *EmptyTy = SR.getEmptyStructPtrType();
- Fields.push_back(EmptyTy);
- }
-};
-
-//===----------------------------------------------------------------------===//
-/// DIVerifyVisitor - This DIVisitor verifies all the field types against
-/// a constant initializer.
-class DIVerifyVisitor : public DIVisitor {
-private:
- DIVerifier &VR; // Active verifier.
- bool IsValid; // Validity status.
- unsigned I; // Current operand index.
- ConstantStruct *CI; // GlobalVariable constant initializer.
-
-public:
- DIVerifyVisitor(DIVerifier &V, GlobalVariable *GV)
- : DIVisitor()
- , VR(V)
- , IsValid(true)
- , I(0)
- , CI(cast<ConstantStruct>(GV->getInitializer()))
- {
- }
-
- // Accessors.
- bool isValid() const { return IsValid; }
-
- /// Apply - Set the value of each of the fields.
- ///
- virtual void Apply(int &Field) {
- Constant *C = CI->getOperand(I++);
- IsValid = IsValid && isa<ConstantInt>(C);
- }
- virtual void Apply(unsigned &Field) {
- Constant *C = CI->getOperand(I++);
- IsValid = IsValid && isa<ConstantInt>(C);
- }
- virtual void Apply(int64_t &Field) {
- Constant *C = CI->getOperand(I++);
- IsValid = IsValid && isa<ConstantInt>(C);
- }
- virtual void Apply(uint64_t &Field) {
- Constant *C = CI->getOperand(I++);
- IsValid = IsValid && isa<ConstantInt>(C);
- }
- virtual void Apply(bool &Field) {
- Constant *C = CI->getOperand(I++);
- IsValid = IsValid && isa<ConstantInt>(C) && C->getType() == Type::Int1Ty;
- }
- virtual void Apply(std::string &Field) {
- Constant *C = CI->getOperand(I++);
- IsValid = IsValid &&
- (!C || isStringValue(C) || C->isNullValue());
- }
- virtual void Apply(DebugInfoDesc *&Field) {
- // FIXME - Prepare the correct descriptor.
- Constant *C = CI->getOperand(I++);
- IsValid = IsValid && isGlobalVariable(C);
- }
- virtual void Apply(GlobalVariable *&Field) {
- Constant *C = CI->getOperand(I++);
- IsValid = IsValid && isGlobalVariable(C);
- }
- virtual void Apply(std::vector<DebugInfoDesc *> &Field) {
- Constant *C = CI->getOperand(I++);
- IsValid = IsValid && isGlobalVariable(C);
- if (!IsValid) return;
-
- GlobalVariable *GV = getGlobalVariable(C);
- IsValid = IsValid && GV && GV->hasInitializer();
- if (!IsValid) return;
-
- ConstantArray *CA = dyn_cast<ConstantArray>(GV->getInitializer());
- IsValid = IsValid && CA;
- if (!IsValid) return;
-
- for (unsigned i = 0, N = CA->getNumOperands(); IsValid && i < N; ++i) {
- IsValid = IsValid && isGlobalVariable(CA->getOperand(i));
- if (!IsValid) return;
-
- GlobalVariable *GVE = getGlobalVariable(CA->getOperand(i));
- VR.Verify(GVE);
- }
- }
-};
-
-
-//===----------------------------------------------------------------------===//
-
-/// TagFromGlobal - Returns the tag number from a debug info descriptor
-/// GlobalVariable. Return DIIValid if operand is not an unsigned int.
-unsigned DebugInfoDesc::TagFromGlobal(GlobalVariable *GV) {
- ConstantInt *C = getUIntOperand(GV, 0);
- return C ? ((unsigned)C->getZExtValue() & ~LLVMDebugVersionMask) :
- (unsigned)DW_TAG_invalid;
-}
-
-/// VersionFromGlobal - Returns the version number from a debug info
-/// descriptor GlobalVariable. Return DIIValid if operand is not an unsigned
-/// int.
-unsigned DebugInfoDesc::VersionFromGlobal(GlobalVariable *GV) {
- ConstantInt *C = getUIntOperand(GV, 0);
- return C ? ((unsigned)C->getZExtValue() & LLVMDebugVersionMask) :
- (unsigned)DW_TAG_invalid;
-}
-
-/// DescFactory - Create an instance of debug info descriptor based on Tag.
-/// Return NULL if not a recognized Tag.
-DebugInfoDesc *DebugInfoDesc::DescFactory(unsigned Tag) {
- switch (Tag) {
- case DW_TAG_anchor: return new AnchorDesc();
- case DW_TAG_compile_unit: return new CompileUnitDesc();
- case DW_TAG_variable: return new GlobalVariableDesc();
- case DW_TAG_subprogram: return new SubprogramDesc();
- case DW_TAG_lexical_block: return new BlockDesc();
- case DW_TAG_base_type: return new BasicTypeDesc();
- case DW_TAG_typedef:
- case DW_TAG_pointer_type:
- case DW_TAG_reference_type:
- case DW_TAG_const_type:
- case DW_TAG_volatile_type:
- case DW_TAG_restrict_type:
- case DW_TAG_member:
- case DW_TAG_inheritance: return new DerivedTypeDesc(Tag);
- case DW_TAG_array_type:
- case DW_TAG_structure_type:
- case DW_TAG_union_type:
- case DW_TAG_enumeration_type:
- case DW_TAG_vector_type:
- case DW_TAG_subroutine_type: return new CompositeTypeDesc(Tag);
- case DW_TAG_subrange_type: return new SubrangeDesc();
- case DW_TAG_enumerator: return new EnumeratorDesc();
- case DW_TAG_return_variable:
- case DW_TAG_arg_variable:
- case DW_TAG_auto_variable: return new VariableDesc(Tag);
- default: break;
- }
- return NULL;
-}
-
-/// getLinkage - get linkage appropriate for this type of descriptor.
-///
-GlobalValue::LinkageTypes DebugInfoDesc::getLinkage() const {
- return GlobalValue::InternalLinkage;
-}
-
-/// ApplyToFields - Target the vistor to the fields of the descriptor.
-///
-void DebugInfoDesc::ApplyToFields(DIVisitor *Visitor) {
- Visitor->Apply(Tag);
-}
-
-//===----------------------------------------------------------------------===//
-
-AnchorDesc::AnchorDesc()
-: DebugInfoDesc(DW_TAG_anchor)
-, AnchorTag(0)
-{}
-AnchorDesc::AnchorDesc(AnchoredDesc *D)
-: DebugInfoDesc(DW_TAG_anchor)
-, AnchorTag(D->getTag())
-{}
-
-// Implement isa/cast/dyncast.
-bool AnchorDesc::classof(const DebugInfoDesc *D) {
- return D->getTag() == DW_TAG_anchor;
-}
-
-/// getLinkage - get linkage appropriate for this type of descriptor.
-///
-GlobalValue::LinkageTypes AnchorDesc::getLinkage() const {
- return GlobalValue::LinkOnceLinkage;
-}
-
-/// ApplyToFields - Target the visitor to the fields of the TransUnitDesc.
-///
-void AnchorDesc::ApplyToFields(DIVisitor *Visitor) {
- DebugInfoDesc::ApplyToFields(Visitor);
-
- Visitor->Apply(AnchorTag);
-}
-
-/// getDescString - Return a string used to compose global names and labels. A
-/// A global variable name needs to be defined for each debug descriptor that is
-/// anchored. NOTE: that each global variable named here also needs to be added
-/// to the list of names left external in the internalizer.
-/// ExternalNames.insert("llvm.dbg.compile_units");
-/// ExternalNames.insert("llvm.dbg.global_variables");
-/// ExternalNames.insert("llvm.dbg.subprograms");
-const char *AnchorDesc::getDescString() const {
- switch (AnchorTag) {
- case DW_TAG_compile_unit: return CompileUnitDesc::AnchorString;
- case DW_TAG_variable: return GlobalVariableDesc::AnchorString;
- case DW_TAG_subprogram: return SubprogramDesc::AnchorString;
- default: break;
- }
-
- assert(0 && "Tag does not have a case for anchor string");
- return "";
-}
-
-/// getTypeString - Return a string used to label this descriptors type.
-///
-const char *AnchorDesc::getTypeString() const {
- return "llvm.dbg.anchor.type";
-}
-
-#ifndef NDEBUG
-void AnchorDesc::dump() {
- cerr << getDescString() << " "
- << "Version(" << getVersion() << "), "
- << "Tag(" << getTag() << "), "
- << "AnchorTag(" << AnchorTag << ")\n";
-}
-#endif
-
-//===----------------------------------------------------------------------===//
-
-AnchoredDesc::AnchoredDesc(unsigned T)
-: DebugInfoDesc(T)
-, Anchor(NULL)
-{}
-
-/// ApplyToFields - Target the visitor to the fields of the AnchoredDesc.
-///
-void AnchoredDesc::ApplyToFields(DIVisitor *Visitor) {
- DebugInfoDesc::ApplyToFields(Visitor);
-
- Visitor->Apply(Anchor);
-}
-
-//===----------------------------------------------------------------------===//
-
-CompileUnitDesc::CompileUnitDesc()
-: AnchoredDesc(DW_TAG_compile_unit)
-, Language(0)
-, FileName("")
-, Directory("")
-, Producer("")
-{}
-
-// Implement isa/cast/dyncast.
-bool CompileUnitDesc::classof(const DebugInfoDesc *D) {
- return D->getTag() == DW_TAG_compile_unit;
-}
-
-/// ApplyToFields - Target the visitor to the fields of the CompileUnitDesc.
-///
-void CompileUnitDesc::ApplyToFields(DIVisitor *Visitor) {
- AnchoredDesc::ApplyToFields(Visitor);
-
- // Handle cases out of sync with compiler.
- if (getVersion() == 0) {
- unsigned DebugVersion;
- Visitor->Apply(DebugVersion);
- }
-
- Visitor->Apply(Language);
- Visitor->Apply(FileName);
- Visitor->Apply(Directory);
- Visitor->Apply(Producer);
-}
-
-/// getDescString - Return a string used to compose global names and labels.
-///
-const char *CompileUnitDesc::getDescString() const {
- return "llvm.dbg.compile_unit";
-}
-
-/// getTypeString - Return a string used to label this descriptors type.
-///
-const char *CompileUnitDesc::getTypeString() const {
- return "llvm.dbg.compile_unit.type";
-}
-
-/// getAnchorString - Return a string used to label this descriptor's anchor.
-///
-const char *const CompileUnitDesc::AnchorString = "llvm.dbg.compile_units";
-const char *CompileUnitDesc::getAnchorString() const {
- return AnchorString;
-}
-
-#ifndef NDEBUG
-void CompileUnitDesc::dump() {
- cerr << getDescString() << " "
- << "Version(" << getVersion() << "), "
- << "Tag(" << getTag() << "), "
- << "Anchor(" << getAnchor() << "), "
- << "Language(" << Language << "), "
- << "FileName(\"" << FileName << "\"), "
- << "Directory(\"" << Directory << "\"), "
- << "Producer(\"" << Producer << "\")\n";
-}
-#endif
-
-//===----------------------------------------------------------------------===//
-
-TypeDesc::TypeDesc(unsigned T)
-: DebugInfoDesc(T)
-, Context(NULL)
-, Name("")
-, File(NULL)
-, Line(0)
-, Size(0)
-, Align(0)
-, Offset(0)
-, Flags(0)
-{}
-
-/// ApplyToFields - Target the visitor to the fields of the TypeDesc.
-///
-void TypeDesc::ApplyToFields(DIVisitor *Visitor) {
- DebugInfoDesc::ApplyToFields(Visitor);
-
- Visitor->Apply(Context);
- Visitor->Apply(Name);
- Visitor->Apply(File);
- Visitor->Apply(Line);
- Visitor->Apply(Size);
- Visitor->Apply(Align);
- Visitor->Apply(Offset);
- if (getVersion() > LLVMDebugVersion4) Visitor->Apply(Flags);
-}
-
-/// getDescString - Return a string used to compose global names and labels.
-///
-const char *TypeDesc::getDescString() const {
- return "llvm.dbg.type";
-}
-
-/// getTypeString - Return a string used to label this descriptor's type.
-///
-const char *TypeDesc::getTypeString() const {
- return "llvm.dbg.type.type";
-}
-
-#ifndef NDEBUG
-void TypeDesc::dump() {
- cerr << getDescString() << " "
- << "Version(" << getVersion() << "), "
- << "Tag(" << getTag() << "), "
- << "Context(" << Context << "), "
- << "Name(\"" << Name << "\"), "
- << "File(" << File << "), "
- << "Line(" << Line << "), "
- << "Size(" << Size << "), "
- << "Align(" << Align << "), "
- << "Offset(" << Offset << "), "
- << "Flags(" << Flags << ")\n";
-}
-#endif
-
-//===----------------------------------------------------------------------===//
-
-BasicTypeDesc::BasicTypeDesc()
-: TypeDesc(DW_TAG_base_type)
-, Encoding(0)
-{}
-
-// Implement isa/cast/dyncast.
-bool BasicTypeDesc::classof(const DebugInfoDesc *D) {
- return D->getTag() == DW_TAG_base_type;
-}
-
-/// ApplyToFields - Target the visitor to the fields of the BasicTypeDesc.
-///
-void BasicTypeDesc::ApplyToFields(DIVisitor *Visitor) {
- TypeDesc::ApplyToFields(Visitor);
-
- Visitor->Apply(Encoding);
-}
-
-/// getDescString - Return a string used to compose global names and labels.
-///
-const char *BasicTypeDesc::getDescString() const {
- return "llvm.dbg.basictype";
-}
-
-/// getTypeString - Return a string used to label this descriptor's type.
-///
-const char *BasicTypeDesc::getTypeString() const {
- return "llvm.dbg.basictype.type";
-}
-
-#ifndef NDEBUG
-void BasicTypeDesc::dump() {
- cerr << getDescString() << " "
- << "Version(" << getVersion() << "), "
- << "Tag(" << getTag() << "), "
- << "Context(" << getContext() << "), "
- << "Name(\"" << getName() << "\"), "
- << "Size(" << getSize() << "), "
- << "Encoding(" << Encoding << ")\n";
-}
-#endif
-
-//===----------------------------------------------------------------------===//
-
-DerivedTypeDesc::DerivedTypeDesc(unsigned T)
-: TypeDesc(T)
-, FromType(NULL)
-{}
-
-// Implement isa/cast/dyncast.
-bool DerivedTypeDesc::classof(const DebugInfoDesc *D) {
- unsigned T = D->getTag();
- switch (T) {
- case DW_TAG_typedef:
- case DW_TAG_pointer_type:
- case DW_TAG_reference_type:
- case DW_TAG_const_type:
- case DW_TAG_volatile_type:
- case DW_TAG_restrict_type:
- case DW_TAG_member:
- case DW_TAG_inheritance:
- return true;
- default: break;
- }
- return false;
-}
-
-/// ApplyToFields - Target the visitor to the fields of the DerivedTypeDesc.
-///
-void DerivedTypeDesc::ApplyToFields(DIVisitor *Visitor) {
- TypeDesc::ApplyToFields(Visitor);
-
- Visitor->Apply(FromType);
-}
-
-/// getDescString - Return a string used to compose global names and labels.
-///
-const char *DerivedTypeDesc::getDescString() const {
- return "llvm.dbg.derivedtype";
-}
-
-/// getTypeString - Return a string used to label this descriptor's type.
-///
-const char *DerivedTypeDesc::getTypeString() const {
- return "llvm.dbg.derivedtype.type";
-}
-
-#ifndef NDEBUG
-void DerivedTypeDesc::dump() {
- cerr << getDescString() << " "
- << "Version(" << getVersion() << "), "
- << "Tag(" << getTag() << "), "
- << "Context(" << getContext() << "), "
- << "Name(\"" << getName() << "\"), "
- << "Size(" << getSize() << "), "
- << "File(" << getFile() << "), "
- << "Line(" << getLine() << "), "
- << "FromType(" << FromType << ")\n";
-}
-#endif
-
-//===----------------------------------------------------------------------===//
-
-CompositeTypeDesc::CompositeTypeDesc(unsigned T)
-: DerivedTypeDesc(T)
-, Elements()
-{}
-
-// Implement isa/cast/dyncast.
-bool CompositeTypeDesc::classof(const DebugInfoDesc *D) {
- unsigned T = D->getTag();
- switch (T) {
- case DW_TAG_array_type:
- case DW_TAG_structure_type:
- case DW_TAG_union_type:
- case DW_TAG_enumeration_type:
- case DW_TAG_vector_type:
- case DW_TAG_subroutine_type:
- return true;
- default: break;
- }
- return false;
-}
-
-/// ApplyToFields - Target the visitor to the fields of the CompositeTypeDesc.
-///
-void CompositeTypeDesc::ApplyToFields(DIVisitor *Visitor) {
- DerivedTypeDesc::ApplyToFields(Visitor);
-
- Visitor->Apply(Elements);
-}
-
-/// getDescString - Return a string used to compose global names and labels.
-///
-const char *CompositeTypeDesc::getDescString() const {
- return "llvm.dbg.compositetype";
-}
-
-/// getTypeString - Return a string used to label this descriptor's type.
-///
-const char *CompositeTypeDesc::getTypeString() const {
- return "llvm.dbg.compositetype.type";
-}
-
-#ifndef NDEBUG
-void CompositeTypeDesc::dump() {
- cerr << getDescString() << " "
- << "Version(" << getVersion() << "), "
- << "Tag(" << getTag() << "), "
- << "Context(" << getContext() << "), "
- << "Name(\"" << getName() << "\"), "
- << "Size(" << getSize() << "), "
- << "File(" << getFile() << "), "
- << "Line(" << getLine() << "), "
- << "FromType(" << getFromType() << "), "
- << "Elements.size(" << Elements.size() << ")\n";
-}
-#endif
-
-//===----------------------------------------------------------------------===//
-
-SubrangeDesc::SubrangeDesc()
-: DebugInfoDesc(DW_TAG_subrange_type)
-, Lo(0)
-, Hi(0)
-{}
-
-// Implement isa/cast/dyncast.
-bool SubrangeDesc::classof(const DebugInfoDesc *D) {
- return D->getTag() == DW_TAG_subrange_type;
-}
-
-/// ApplyToFields - Target the visitor to the fields of the SubrangeDesc.
-///
-void SubrangeDesc::ApplyToFields(DIVisitor *Visitor) {
- DebugInfoDesc::ApplyToFields(Visitor);
-
- Visitor->Apply(Lo);
- Visitor->Apply(Hi);
-}
-
-/// getDescString - Return a string used to compose global names and labels.
-///
-const char *SubrangeDesc::getDescString() const {
- return "llvm.dbg.subrange";
-}
-
-/// getTypeString - Return a string used to label this descriptor's type.
-///
-const char *SubrangeDesc::getTypeString() const {
- return "llvm.dbg.subrange.type";
-}
-
-#ifndef NDEBUG
-void SubrangeDesc::dump() {
- cerr << getDescString() << " "
- << "Version(" << getVersion() << "), "
- << "Tag(" << getTag() << "), "
- << "Lo(" << Lo << "), "
- << "Hi(" << Hi << ")\n";
-}
-#endif
-
-//===----------------------------------------------------------------------===//
-
-EnumeratorDesc::EnumeratorDesc()
-: DebugInfoDesc(DW_TAG_enumerator)
-, Name("")
-, Value(0)
-{}
-
-// Implement isa/cast/dyncast.
-bool EnumeratorDesc::classof(const DebugInfoDesc *D) {
- return D->getTag() == DW_TAG_enumerator;
-}
-
-/// ApplyToFields - Target the visitor to the fields of the EnumeratorDesc.
-///
-void EnumeratorDesc::ApplyToFields(DIVisitor *Visitor) {
- DebugInfoDesc::ApplyToFields(Visitor);
-
- Visitor->Apply(Name);
- Visitor->Apply(Value);
-}
-
-/// getDescString - Return a string used to compose global names and labels.
-///
-const char *EnumeratorDesc::getDescString() const {
- return "llvm.dbg.enumerator";
-}
-
-/// getTypeString - Return a string used to label this descriptor's type.
-///
-const char *EnumeratorDesc::getTypeString() const {
- return "llvm.dbg.enumerator.type";
-}
-
-#ifndef NDEBUG
-void EnumeratorDesc::dump() {
- cerr << getDescString() << " "
- << "Version(" << getVersion() << "), "
- << "Tag(" << getTag() << "), "
- << "Name(" << Name << "), "
- << "Value(" << Value << ")\n";
-}
-#endif
-
-//===----------------------------------------------------------------------===//
-
-VariableDesc::VariableDesc(unsigned T)
-: DebugInfoDesc(T)
-, Context(NULL)
-, Name("")
-, File(NULL)
-, Line(0)
-, TyDesc(0)
-{}
-
-// Implement isa/cast/dyncast.
-bool VariableDesc::classof(const DebugInfoDesc *D) {
- unsigned T = D->getTag();
- switch (T) {
- case DW_TAG_auto_variable:
- case DW_TAG_arg_variable:
- case DW_TAG_return_variable:
- return true;
- default: break;
- }
- return false;
-}
-
-/// ApplyToFields - Target the visitor to the fields of the VariableDesc.
-///
-void VariableDesc::ApplyToFields(DIVisitor *Visitor) {
- DebugInfoDesc::ApplyToFields(Visitor);
-
- Visitor->Apply(Context);
- Visitor->Apply(Name);
- Visitor->Apply(File);
- Visitor->Apply(Line);
- Visitor->Apply(TyDesc);
-}
-
-/// getDescString - Return a string used to compose global names and labels.
-///
-const char *VariableDesc::getDescString() const {
- return "llvm.dbg.variable";
-}
-
-/// getTypeString - Return a string used to label this descriptor's type.
-///
-const char *VariableDesc::getTypeString() const {
- return "llvm.dbg.variable.type";
-}
-
-#ifndef NDEBUG
-void VariableDesc::dump() {
- cerr << getDescString() << " "
- << "Version(" << getVersion() << "), "
- << "Tag(" << getTag() << "), "
- << "Context(" << Context << "), "
- << "Name(\"" << Name << "\"), "
- << "File(" << File << "), "
- << "Line(" << Line << "), "
- << "TyDesc(" << TyDesc << ")\n";
-}
-#endif
-
-//===----------------------------------------------------------------------===//
-
-GlobalDesc::GlobalDesc(unsigned T)
-: AnchoredDesc(T)
-, Context(0)
-, Name("")
-, FullName("")
-, LinkageName("")
-, File(NULL)
-, Line(0)
-, TyDesc(NULL)
-, IsStatic(false)
-, IsDefinition(false)
-{}
-
-/// ApplyToFields - Target the visitor to the fields of the global.
-///
-void GlobalDesc::ApplyToFields(DIVisitor *Visitor) {
- AnchoredDesc::ApplyToFields(Visitor);
-
- Visitor->Apply(Context);
- Visitor->Apply(Name);
- Visitor->Apply(FullName);
- Visitor->Apply(LinkageName);
- Visitor->Apply(File);
- Visitor->Apply(Line);
- Visitor->Apply(TyDesc);
- Visitor->Apply(IsStatic);
- Visitor->Apply(IsDefinition);
-}
-
-//===----------------------------------------------------------------------===//
-
-GlobalVariableDesc::GlobalVariableDesc()
-: GlobalDesc(DW_TAG_variable)
-, Global(NULL)
-{}
-
-// Implement isa/cast/dyncast.
-bool GlobalVariableDesc::classof(const DebugInfoDesc *D) {
- return D->getTag() == DW_TAG_variable;
-}
-
-/// ApplyToFields - Target the visitor to the fields of the GlobalVariableDesc.
-///
-void GlobalVariableDesc::ApplyToFields(DIVisitor *Visitor) {
- GlobalDesc::ApplyToFields(Visitor);
-
- Visitor->Apply(Global);
-}
-
-/// getDescString - Return a string used to compose global names and labels.
-///
-const char *GlobalVariableDesc::getDescString() const {
- return "llvm.dbg.global_variable";
-}
-
-/// getTypeString - Return a string used to label this descriptors type.
-///
-const char *GlobalVariableDesc::getTypeString() const {
- return "llvm.dbg.global_variable.type";
-}
-
-/// getAnchorString - Return a string used to label this descriptor's anchor.
-///
-const char *const GlobalVariableDesc::AnchorString = "llvm.dbg.global_variables";
-const char *GlobalVariableDesc::getAnchorString() const {
- return AnchorString;
-}
-
-#ifndef NDEBUG
-void GlobalVariableDesc::dump() {
- cerr << getDescString() << " "
- << "Version(" << getVersion() << "), "
- << "Tag(" << getTag() << "), "
- << "Anchor(" << getAnchor() << "), "
- << "Name(\"" << getName() << "\"), "
- << "FullName(\"" << getFullName() << "\"), "
- << "LinkageName(\"" << getLinkageName() << "\"), "
- << "File(" << getFile() << "),"
- << "Line(" << getLine() << "),"
- << "Type(" << getType() << "), "
- << "IsStatic(" << (isStatic() ? "true" : "false") << "), "
- << "IsDefinition(" << (isDefinition() ? "true" : "false") << "), "
- << "Global(" << Global << ")\n";
-}
-#endif
-
-//===----------------------------------------------------------------------===//
-
-SubprogramDesc::SubprogramDesc()
-: GlobalDesc(DW_TAG_subprogram)
-{}
-
-// Implement isa/cast/dyncast.
-bool SubprogramDesc::classof(const DebugInfoDesc *D) {
- return D->getTag() == DW_TAG_subprogram;
-}
-
-/// ApplyToFields - Target the visitor to the fields of the
-/// SubprogramDesc.
-void SubprogramDesc::ApplyToFields(DIVisitor *Visitor) {
- GlobalDesc::ApplyToFields(Visitor);
-}
-
-/// getDescString - Return a string used to compose global names and labels.
-///
-const char *SubprogramDesc::getDescString() const {
- return "llvm.dbg.subprogram";
-}
-
-/// getTypeString - Return a string used to label this descriptors type.
-///
-const char *SubprogramDesc::getTypeString() const {
- return "llvm.dbg.subprogram.type";
-}
-
-/// getAnchorString - Return a string used to label this descriptor's anchor.
-///
-const char *const SubprogramDesc::AnchorString = "llvm.dbg.subprograms";
-const char *SubprogramDesc::getAnchorString() const {
- return AnchorString;
-}
-
-#ifndef NDEBUG
-void SubprogramDesc::dump() {
- cerr << getDescString() << " "
- << "Version(" << getVersion() << "), "
- << "Tag(" << getTag() << "), "
- << "Anchor(" << getAnchor() << "), "
- << "Name(\"" << getName() << "\"), "
- << "FullName(\"" << getFullName() << "\"), "
- << "LinkageName(\"" << getLinkageName() << "\"), "
- << "File(" << getFile() << "),"
- << "Line(" << getLine() << "),"
- << "Type(" << getType() << "), "
- << "IsStatic(" << (isStatic() ? "true" : "false") << "), "
- << "IsDefinition(" << (isDefinition() ? "true" : "false") << ")\n";
-}
-#endif
-
-//===----------------------------------------------------------------------===//
-
-BlockDesc::BlockDesc()
-: DebugInfoDesc(DW_TAG_lexical_block)
-, Context(NULL)
-{}
-
-// Implement isa/cast/dyncast.
-bool BlockDesc::classof(const DebugInfoDesc *D) {
- return D->getTag() == DW_TAG_lexical_block;
-}
-
-/// ApplyToFields - Target the visitor to the fields of the BlockDesc.
-///
-void BlockDesc::ApplyToFields(DIVisitor *Visitor) {
- DebugInfoDesc::ApplyToFields(Visitor);
-
- Visitor->Apply(Context);
-}
-
-/// getDescString - Return a string used to compose global names and labels.
-///
-const char *BlockDesc::getDescString() const {
- return "llvm.dbg.block";
-}
-
-/// getTypeString - Return a string used to label this descriptors type.
-///
-const char *BlockDesc::getTypeString() const {
- return "llvm.dbg.block.type";
-}
-
-#ifndef NDEBUG
-void BlockDesc::dump() {
- cerr << getDescString() << " "
- << "Version(" << getVersion() << "), "
- << "Tag(" << getTag() << "),"
- << "Context(" << Context << ")\n";
-}
-#endif
-
-//===----------------------------------------------------------------------===//
-
-DebugInfoDesc *DIDeserializer::Deserialize(Value *V) {
- return Deserialize(getGlobalVariable(V));
-}
-DebugInfoDesc *DIDeserializer::Deserialize(GlobalVariable *GV) {
- // Handle NULL.
- if (!GV) return NULL;
-
- // Check to see if it has been already deserialized.
- DebugInfoDesc *&Slot = GlobalDescs[GV];
- if (Slot) return Slot;
-
- // Get the Tag from the global.
- unsigned Tag = DebugInfoDesc::TagFromGlobal(GV);
-
- // Create an empty instance of the correct sort.
- Slot = DebugInfoDesc::DescFactory(Tag);
-
- // If not a user defined descriptor.
- if (Slot) {
- // Deserialize the fields.
- DIDeserializeVisitor DRAM(*this, GV);
- DRAM.ApplyToFields(Slot);
- }
-
- return Slot;
-}
-
-//===----------------------------------------------------------------------===//
-
-/// getStrPtrType - Return a "sbyte *" type.
-///
-const PointerType *DISerializer::getStrPtrType() {
- // If not already defined.
- if (!StrPtrTy) {
- // Construct the pointer to signed bytes.
- StrPtrTy = PointerType::getUnqual(Type::Int8Ty);
- }
-
- return StrPtrTy;
-}
-
-/// getEmptyStructPtrType - Return a "{ }*" type.
-///
-const PointerType *DISerializer::getEmptyStructPtrType() {
- // If not already defined.
- if (!EmptyStructPtrTy) {
- // Construct the empty structure type.
- const StructType *EmptyStructTy =
- StructType::get(std::vector<const Type*>());
- // Construct the pointer to empty structure type.
- EmptyStructPtrTy = PointerType::getUnqual(EmptyStructTy);
- }
-
- return EmptyStructPtrTy;
-}
-
-/// getTagType - Return the type describing the specified descriptor (via tag.)
-///
-const StructType *DISerializer::getTagType(DebugInfoDesc *DD) {
- // Attempt to get the previously defined type.
- StructType *&Ty = TagTypes[DD->getTag()];
-
- // If not already defined.
- if (!Ty) {
- // Set up fields vector.
- std::vector<const Type*> Fields;
- // Get types of fields.
- DIGetTypesVisitor GTAM(*this, Fields);
- GTAM.ApplyToFields(DD);
-
- // Construct structured type.
- Ty = StructType::get(Fields);
-
- // Register type name with module.
- M->addTypeName(DD->getTypeString(), Ty);
- }
-
- return Ty;
-}
-
-/// getString - Construct the string as constant string global.
-///
-Constant *DISerializer::getString(const std::string &String) {
- // Check string cache for previous edition.
- Constant *&Slot = StringCache[String];
- // Return Constant if previously defined.
- if (Slot) return Slot;
- // If empty string then use a sbyte* null instead.
- if (String.empty()) {
- Slot = ConstantPointerNull::get(getStrPtrType());
- } else {
- // Construct string as an llvm constant.
- Constant *ConstStr = ConstantArray::get(String);
- // Otherwise create and return a new string global.
- GlobalVariable *StrGV = new GlobalVariable(ConstStr->getType(), true,
- GlobalVariable::InternalLinkage,
- ConstStr, ".str", M);
- StrGV->setSection("llvm.metadata");
- // Convert to generic string pointer.
- Slot = ConstantExpr::getBitCast(StrGV, getStrPtrType());
- }
- return Slot;
-
-}
-
-/// Serialize - Recursively cast the specified descriptor into a GlobalVariable
-/// so that it can be serialized to a .bc or .ll file.
-GlobalVariable *DISerializer::Serialize(DebugInfoDesc *DD) {
- // Check if the DebugInfoDesc is already in the map.
- GlobalVariable *&Slot = DescGlobals[DD];
-
- // See if DebugInfoDesc exists, if so return prior GlobalVariable.
- if (Slot) return Slot;
-
- // Get the type associated with the Tag.
- const StructType *Ty = getTagType(DD);
-
- // Create the GlobalVariable early to prevent infinite recursion.
- GlobalVariable *GV = new GlobalVariable(Ty, true, DD->getLinkage(),
- NULL, DD->getDescString(), M);
- GV->setSection("llvm.metadata");
-
- // Insert new GlobalVariable in DescGlobals map.
- Slot = GV;
-
- // Set up elements vector
- std::vector<Constant*> Elements;
- // Add fields.
- DISerializeVisitor SRAM(*this, Elements);
- SRAM.ApplyToFields(DD);
-
- // Set the globals initializer.
- GV->setInitializer(ConstantStruct::get(Ty, Elements));
-
- return GV;
-}
-
-/// addDescriptor - Directly connect DD with existing GV.
-void DISerializer::addDescriptor(DebugInfoDesc *DD,
- GlobalVariable *GV) {
- DescGlobals[DD] = GV;
-}
-
-//===----------------------------------------------------------------------===//
-
-/// Verify - Return true if the GlobalVariable appears to be a valid
-/// serialization of a DebugInfoDesc.
-bool DIVerifier::Verify(Value *V) {
- return !V || Verify(getGlobalVariable(V));
-}
-bool DIVerifier::Verify(GlobalVariable *GV) {
- // NULLs are valid.
- if (!GV) return true;
-
- // Check prior validity.
- unsigned &ValiditySlot = Validity[GV];
-
- // If visited before then use old state.
- if (ValiditySlot) return ValiditySlot == Valid;
-
- // Assume validity for the time being (recursion.)
- ValiditySlot = Valid;
-
- // Make sure the global is internal or link once (anchor.)
- if (GV->getLinkage() != GlobalValue::InternalLinkage &&
- GV->getLinkage() != GlobalValue::LinkOnceLinkage) {
- ValiditySlot = Invalid;
- return false;
- }
-
- // Get the Tag.
- unsigned Tag = DebugInfoDesc::TagFromGlobal(GV);
-
- // Check for user defined descriptors.
- if (Tag == DW_TAG_invalid) {
- ValiditySlot = Valid;
- return true;
- }
-
- // Get the Version.
- unsigned Version = DebugInfoDesc::VersionFromGlobal(GV);
-
- // Check for version mismatch.
- if (Version != LLVMDebugVersion) {
- ValiditySlot = Invalid;
- return false;
- }
-
- // Construct an empty DebugInfoDesc.
- DebugInfoDesc *DD = DebugInfoDesc::DescFactory(Tag);
-
- // Allow for user defined descriptors.
- if (!DD) return true;
-
- // Get the initializer constant.
- ConstantStruct *CI = cast<ConstantStruct>(GV->getInitializer());
-
- // Get the operand count.
- unsigned N = CI->getNumOperands();
-
- // Get the field count.
- unsigned &CountSlot = Counts[Tag];
- if (!CountSlot) {
- // Check the operand count to the field count
- DICountVisitor CTAM;
- CTAM.ApplyToFields(DD);
- CountSlot = CTAM.getCount();
- }
-
- // Field count must be at most equal operand count.
- if (CountSlot > N) {
- delete DD;
- ValiditySlot = Invalid;
- return false;
- }
-
- // Check each field for valid type.
- DIVerifyVisitor VRAM(*this, GV);
- VRAM.ApplyToFields(DD);
-
- // Release empty DebugInfoDesc.
- delete DD;
-
- // If fields are not valid.
- if (!VRAM.isValid()) {
- ValiditySlot = Invalid;
- return false;
- }
-
- return true;
-}
-
-/// isVerified - Return true if the specified GV has already been
-/// verified as a debug information descriptor.
-bool DIVerifier::isVerified(GlobalVariable *GV) {
- unsigned &ValiditySlot = Validity[GV];
- if (ValiditySlot) return ValiditySlot == Valid;
- return false;
-}
-
-//===----------------------------------------------------------------------===//
-
-DebugScope::~DebugScope() {
- for (unsigned i = 0, N = Scopes.size(); i < N; ++i) delete Scopes[i];
- for (unsigned j = 0, M = Variables.size(); j < M; ++j) delete Variables[j];
-}
-
-//===----------------------------------------------------------------------===//
-
-MachineModuleInfo::MachineModuleInfo()
-: ImmutablePass((intptr_t)&ID)
-, DR()
-, VR()
-, CompileUnits()
-, Directories()
-, SourceFiles()
-, Lines()
-, LabelIDList()
-, ScopeMap()
-, RootScope(NULL)
-, FrameMoves()
-, LandingPads()
-, Personalities()
-, CallsEHReturn(0)
-, CallsUnwindInit(0)
-{
- // Always emit "no personality" info
- Personalities.push_back(NULL);
-}
-MachineModuleInfo::~MachineModuleInfo() {
-
-}
-
-/// doInitialization - Initialize the state for a new module.
-///
-bool MachineModuleInfo::doInitialization() {
- return false;
-}
-
-/// doFinalization - Tear down the state after completion of a module.
-///
-bool MachineModuleInfo::doFinalization() {
- return false;
-}
-
-/// BeginFunction - Begin gathering function meta information.
-///
-void MachineModuleInfo::BeginFunction(MachineFunction *MF) {
- // Coming soon.
-}
-
-/// EndFunction - Discard function meta information.
-///
-void MachineModuleInfo::EndFunction() {
- // Clean up scope information.
- if (RootScope) {
- delete RootScope;
- ScopeMap.clear();
- RootScope = NULL;
- }
-
- // Clean up line info.
- Lines.clear();
-
- // Clean up frame info.
- FrameMoves.clear();
-
- // Clean up exception info.
- LandingPads.clear();
- TypeInfos.clear();
- FilterIds.clear();
- FilterEnds.clear();
- CallsEHReturn = 0;
- CallsUnwindInit = 0;
-}
-
-/// getDescFor - Convert a Value to a debug information descriptor.
-///
-// FIXME - use new Value type when available.
-DebugInfoDesc *MachineModuleInfo::getDescFor(Value *V) {
- return DR.Deserialize(V);
-}
-
-/// AnalyzeModule - Scan the module for global debug information.
-///
-void MachineModuleInfo::AnalyzeModule(Module &M) {
- SetupCompileUnits(M);
-
- // Insert functions in the llvm.used array into UsedFunctions.
- GlobalVariable *GV = M.getGlobalVariable("llvm.used");
- if (!GV || !GV->hasInitializer()) return;
-
- // Should be an array of 'i8*'.
- ConstantArray *InitList = dyn_cast<ConstantArray>(GV->getInitializer());
- if (InitList == 0) return;
-
- for (unsigned i = 0, e = InitList->getNumOperands(); i != e; ++i) {
- if (ConstantExpr *CE = dyn_cast<ConstantExpr>(InitList->getOperand(i)))
- if (CE->getOpcode() == Instruction::BitCast)
- if (Function *F = dyn_cast<Function>(CE->getOperand(0)))
- UsedFunctions.insert(F);
- }
-}
-
-/// SetupCompileUnits - Set up the unique vector of compile units.
-///
-void MachineModuleInfo::SetupCompileUnits(Module &M) {
- std::vector<CompileUnitDesc *>CU = getAnchoredDescriptors<CompileUnitDesc>(M);
-
- for (unsigned i = 0, N = CU.size(); i < N; i++) {
- CompileUnits.insert(CU[i]);
- }
-}
-
-/// getCompileUnits - Return a vector of debug compile units.
-///
-const UniqueVector<CompileUnitDesc *> MachineModuleInfo::getCompileUnits()const{
- return CompileUnits;
-}
-
-/// getGlobalVariablesUsing - Return all of the GlobalVariables that use the
-/// named GlobalVariable.
-std::vector<GlobalVariable*>
-MachineModuleInfo::getGlobalVariablesUsing(Module &M,
- const std::string &RootName) {
- return ::getGlobalVariablesUsing(M, RootName);
-}
-
-/// RecordSourceLine - Records location information and associates it with a
-/// debug label. Returns a unique label ID used to generate a label and
-/// provide correspondence to the source line list.
-unsigned MachineModuleInfo::RecordSourceLine(unsigned Line, unsigned Column,
- unsigned Source) {
- unsigned ID = NextLabelID();
- Lines.push_back(SourceLineInfo(Line, Column, Source, ID));
- return ID;
-}
-
-/// RecordSource - Register a source file with debug info. Returns an source
-/// ID.
-unsigned MachineModuleInfo::RecordSource(const std::string &Directory,
- const std::string &Source) {
- unsigned DirectoryID = Directories.insert(Directory);
- return SourceFiles.insert(SourceFileInfo(DirectoryID, Source));
-}
-unsigned MachineModuleInfo::RecordSource(const CompileUnitDesc *CompileUnit) {
- return RecordSource(CompileUnit->getDirectory(),
- CompileUnit->getFileName());
-}
-
-/// RecordRegionStart - Indicate the start of a region.
-///
-unsigned MachineModuleInfo::RecordRegionStart(Value *V) {
- // FIXME - need to be able to handle split scopes because of bb cloning.
- DebugInfoDesc *ScopeDesc = DR.Deserialize(V);
- DebugScope *Scope = getOrCreateScope(ScopeDesc);
- unsigned ID = NextLabelID();
- if (!Scope->getStartLabelID()) Scope->setStartLabelID(ID);
- return ID;
-}
-
-/// RecordRegionEnd - Indicate the end of a region.
-///
-unsigned MachineModuleInfo::RecordRegionEnd(Value *V) {
- // FIXME - need to be able to handle split scopes because of bb cloning.
- DebugInfoDesc *ScopeDesc = DR.Deserialize(V);
- DebugScope *Scope = getOrCreateScope(ScopeDesc);
- unsigned ID = NextLabelID();
- Scope->setEndLabelID(ID);
- return ID;
-}
-
-/// RecordVariable - Indicate the declaration of a local variable.
-///
-void MachineModuleInfo::RecordVariable(GlobalValue *GV, unsigned FrameIndex) {
- VariableDesc *VD = cast<VariableDesc>(DR.Deserialize(GV));
- DebugScope *Scope = getOrCreateScope(VD->getContext());
- DebugVariable *DV = new DebugVariable(VD, FrameIndex);
- Scope->AddVariable(DV);
-}
-
-/// getOrCreateScope - Returns the scope associated with the given descriptor.
-///
-DebugScope *MachineModuleInfo::getOrCreateScope(DebugInfoDesc *ScopeDesc) {
- DebugScope *&Slot = ScopeMap[ScopeDesc];
- if (!Slot) {
- // FIXME - breaks down when the context is an inlined function.
- DebugInfoDesc *ParentDesc = NULL;
- if (BlockDesc *Block = dyn_cast<BlockDesc>(ScopeDesc)) {
- ParentDesc = Block->getContext();
- }
- DebugScope *Parent = ParentDesc ? getOrCreateScope(ParentDesc) : NULL;
- Slot = new DebugScope(Parent, ScopeDesc);
- if (Parent) {
- Parent->AddScope(Slot);
- } else if (RootScope) {
- // FIXME - Add inlined function scopes to the root so we can delete
- // them later. Long term, handle inlined functions properly.
- RootScope->AddScope(Slot);
- } else {
- // First function is top level function.
- RootScope = Slot;
- }
- }
- return Slot;
-}
-
-//===-EH-------------------------------------------------------------------===//
-
-/// getOrCreateLandingPadInfo - Find or create an LandingPadInfo for the
-/// specified MachineBasicBlock.
-LandingPadInfo &MachineModuleInfo::getOrCreateLandingPadInfo
- (MachineBasicBlock *LandingPad) {
- unsigned N = LandingPads.size();
- for (unsigned i = 0; i < N; ++i) {
- LandingPadInfo &LP = LandingPads[i];
- if (LP.LandingPadBlock == LandingPad)
- return LP;
- }
-
- LandingPads.push_back(LandingPadInfo(LandingPad));
- return LandingPads[N];
-}
-
-/// addInvoke - Provide the begin and end labels of an invoke style call and
-/// associate it with a try landing pad block.
-void MachineModuleInfo::addInvoke(MachineBasicBlock *LandingPad,
- unsigned BeginLabel, unsigned EndLabel) {
- LandingPadInfo &LP = getOrCreateLandingPadInfo(LandingPad);
- LP.BeginLabels.push_back(BeginLabel);
- LP.EndLabels.push_back(EndLabel);
-}
-
-/// addLandingPad - Provide the label of a try LandingPad block.
-///
-unsigned MachineModuleInfo::addLandingPad(MachineBasicBlock *LandingPad) {
- unsigned LandingPadLabel = NextLabelID();
- LandingPadInfo &LP = getOrCreateLandingPadInfo(LandingPad);
- LP.LandingPadLabel = LandingPadLabel;
- return LandingPadLabel;
-}
-
-/// addPersonality - Provide the personality function for the exception
-/// information.
-void MachineModuleInfo::addPersonality(MachineBasicBlock *LandingPad,
- Function *Personality) {
- LandingPadInfo &LP = getOrCreateLandingPadInfo(LandingPad);
- LP.Personality = Personality;
-
- for (unsigned i = 0; i < Personalities.size(); ++i)
- if (Personalities[i] == Personality)
- return;
-
- Personalities.push_back(Personality);
-}
-
-/// addCatchTypeInfo - Provide the catch typeinfo for a landing pad.
-///
-void MachineModuleInfo::addCatchTypeInfo(MachineBasicBlock *LandingPad,
- std::vector<GlobalVariable *> &TyInfo) {
- LandingPadInfo &LP = getOrCreateLandingPadInfo(LandingPad);
- for (unsigned N = TyInfo.size(); N; --N)
- LP.TypeIds.push_back(getTypeIDFor(TyInfo[N - 1]));
-}
-
-/// addFilterTypeInfo - Provide the filter typeinfo for a landing pad.
-///
-void MachineModuleInfo::addFilterTypeInfo(MachineBasicBlock *LandingPad,
- std::vector<GlobalVariable *> &TyInfo) {
- LandingPadInfo &LP = getOrCreateLandingPadInfo(LandingPad);
- std::vector<unsigned> IdsInFilter (TyInfo.size());
- for (unsigned I = 0, E = TyInfo.size(); I != E; ++I)
- IdsInFilter[I] = getTypeIDFor(TyInfo[I]);
- LP.TypeIds.push_back(getFilterIDFor(IdsInFilter));
-}
-
-/// addCleanup - Add a cleanup action for a landing pad.
-///
-void MachineModuleInfo::addCleanup(MachineBasicBlock *LandingPad) {
- LandingPadInfo &LP = getOrCreateLandingPadInfo(LandingPad);
- LP.TypeIds.push_back(0);
-}
-
-/// TidyLandingPads - Remap landing pad labels and remove any deleted landing
-/// pads.
-void MachineModuleInfo::TidyLandingPads() {
- for (unsigned i = 0; i != LandingPads.size(); ) {
- LandingPadInfo &LandingPad = LandingPads[i];
- LandingPad.LandingPadLabel = MappedLabel(LandingPad.LandingPadLabel);
-
- // Special case: we *should* emit LPs with null LP MBB. This indicates
- // "nounwind" case.
- if (!LandingPad.LandingPadLabel && LandingPad.LandingPadBlock) {
- LandingPads.erase(LandingPads.begin() + i);
- continue;
- }
-
- for (unsigned j=0; j != LandingPads[i].BeginLabels.size(); ) {
- unsigned BeginLabel = MappedLabel(LandingPad.BeginLabels[j]);
- unsigned EndLabel = MappedLabel(LandingPad.EndLabels[j]);
-
- if (!BeginLabel || !EndLabel) {
- LandingPad.BeginLabels.erase(LandingPad.BeginLabels.begin() + j);
- LandingPad.EndLabels.erase(LandingPad.EndLabels.begin() + j);
- continue;
- }
-
- LandingPad.BeginLabels[j] = BeginLabel;
- LandingPad.EndLabels[j] = EndLabel;
- ++j;
- }
-
- // Remove landing pads with no try-ranges.
- if (LandingPads[i].BeginLabels.empty()) {
- LandingPads.erase(LandingPads.begin() + i);
- continue;
- }
-
- // If there is no landing pad, ensure that the list of typeids is empty.
- // If the only typeid is a cleanup, this is the same as having no typeids.
- if (!LandingPad.LandingPadBlock ||
- (LandingPad.TypeIds.size() == 1 && !LandingPad.TypeIds[0]))
- LandingPad.TypeIds.clear();
-
- ++i;
- }
-}
-
-/// getTypeIDFor - Return the type id for the specified typeinfo. This is
-/// function wide.
-unsigned MachineModuleInfo::getTypeIDFor(GlobalVariable *TI) {
- for (unsigned i = 0, N = TypeInfos.size(); i != N; ++i)
- if (TypeInfos[i] == TI) return i + 1;
-
- TypeInfos.push_back(TI);
- return TypeInfos.size();
-}
-
-/// getFilterIDFor - Return the filter id for the specified typeinfos. This is
-/// function wide.
-int MachineModuleInfo::getFilterIDFor(std::vector<unsigned> &TyIds) {
- // If the new filter coincides with the tail of an existing filter, then
- // re-use the existing filter. Folding filters more than this requires
- // re-ordering filters and/or their elements - probably not worth it.
- for (std::vector<unsigned>::iterator I = FilterEnds.begin(),
- E = FilterEnds.end(); I != E; ++I) {
- unsigned i = *I, j = TyIds.size();
-
- while (i && j)
- if (FilterIds[--i] != TyIds[--j])
- goto try_next;
-
- if (!j)
- // The new filter coincides with range [i, end) of the existing filter.
- return -(1 + i);
-
-try_next:;
- }
-
- // Add the new filter.
- int FilterID = -(1 + FilterIds.size());
- FilterIds.reserve(FilterIds.size() + TyIds.size() + 1);
- for (unsigned I = 0, N = TyIds.size(); I != N; ++I)
- FilterIds.push_back(TyIds[I]);
- FilterEnds.push_back(FilterIds.size());
- FilterIds.push_back(0); // terminator
- return FilterID;
-}
-
-/// getPersonality - Return the personality function for the current function.
-Function *MachineModuleInfo::getPersonality() const {
- // FIXME: Until PR1414 will be fixed, we're using 1 personality function per
- // function
- return !LandingPads.empty() ? LandingPads[0].Personality : NULL;
-}
-
-/// getPersonalityIndex - Return unique index for current personality
-/// function. NULL personality function should always get zero index.
-unsigned MachineModuleInfo::getPersonalityIndex() const {
- const Function* Personality = NULL;
-
- // Scan landing pads. If there is at least one non-NULL personality - use it.
- for (unsigned i = 0; i != LandingPads.size(); ++i)
- if (LandingPads[i].Personality) {
- Personality = LandingPads[i].Personality;
- break;
- }
-
- for (unsigned i = 0; i < Personalities.size(); ++i) {
- if (Personalities[i] == Personality)
- return i;
- }
-
- // This should never happen
- assert(0 && "Personality function should be set!");
- return 0;
-}
-
-//===----------------------------------------------------------------------===//
-/// DebugLabelFolding pass - This pass prunes out redundant labels. This allows
-/// a info consumer to determine if the range of two labels is empty, by seeing
-/// if the labels map to the same reduced label.
-
-namespace llvm {
-
-struct DebugLabelFolder : public MachineFunctionPass {
- static char ID;
- DebugLabelFolder() : MachineFunctionPass((intptr_t)&ID) {}
-
- virtual bool runOnMachineFunction(MachineFunction &MF);
- virtual const char *getPassName() const { return "Label Folder"; }
-};
-
-char DebugLabelFolder::ID = 0;
-
-bool DebugLabelFolder::runOnMachineFunction(MachineFunction &MF) {
- // Get machine module info.
- MachineModuleInfo *MMI = getAnalysisToUpdate<MachineModuleInfo>();
- if (!MMI) return false;
-
- // Track if change is made.
- bool MadeChange = false;
- // No prior label to begin.
- unsigned PriorLabel = 0;
-
- // Iterate through basic blocks.
- for (MachineFunction::iterator BB = MF.begin(), E = MF.end();
- BB != E; ++BB) {
- // Iterate through instructions.
- for (MachineBasicBlock::iterator I = BB->begin(), E = BB->end(); I != E; ) {
- // Is it a label.
- if (I->isDebugLabel()) {
- // The label ID # is always operand #0, an immediate.
- unsigned NextLabel = I->getOperand(0).getImm();
-
- // If there was an immediate prior label.
- if (PriorLabel) {
- // Remap the current label to prior label.
- MMI->RemapLabel(NextLabel, PriorLabel);
- // Delete the current label.
- I = BB->erase(I);
- // Indicate a change has been made.
- MadeChange = true;
- continue;
- } else {
- // Start a new round.
- PriorLabel = NextLabel;
- }
- } else {
- // No consecutive labels.
- PriorLabel = 0;
- }
-
- ++I;
- }
- }
-
- return MadeChange;
-}
-
-FunctionPass *createDebugLabelFoldingPass() { return new DebugLabelFolder(); }
-
-}
-
diff --git a/release_23/lib/CodeGen/MachinePassRegistry.cpp b/release_23/lib/CodeGen/MachinePassRegistry.cpp
deleted file mode 100644
index 9f4ef1287803..000000000000
--- a/release_23/lib/CodeGen/MachinePassRegistry.cpp
+++ /dev/null
@@ -1,41 +0,0 @@
-//===-- CodeGen/MachineInstr.cpp ------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains the machine function pass registry for register allocators
-// and instruction schedulers.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/CodeGen/MachinePassRegistry.h"
-
-using namespace llvm;
-
-
-/// Add - Adds a function pass to the registration list.
-///
-void MachinePassRegistry::Add(MachinePassRegistryNode *Node) {
- Node->setNext(List);
- List = Node;
- if (Listener) Listener->NotifyAdd(Node->getName(),
- Node->getCtor(),
- Node->getDescription());
-}
-
-
-/// Remove - Removes a function pass from the registration list.
-///
-void MachinePassRegistry::Remove(MachinePassRegistryNode *Node) {
- for (MachinePassRegistryNode **I = &List; *I; I = (*I)->getNextAddress()) {
- if (*I == Node) {
- if (Listener) Listener->NotifyRemove(Node->getName());
- *I = (*I)->getNext();
- break;
- }
- }
-}
diff --git a/release_23/lib/CodeGen/MachineRegisterInfo.cpp b/release_23/lib/CodeGen/MachineRegisterInfo.cpp
deleted file mode 100644
index b3ee0358bb16..000000000000
--- a/release_23/lib/CodeGen/MachineRegisterInfo.cpp
+++ /dev/null
@@ -1,83 +0,0 @@
-//===-- lib/Codegen/MachineRegisterInfo.cpp -------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// Implementation of the MachineRegisterInfo class.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/CodeGen/MachineRegisterInfo.h"
-using namespace llvm;
-
-MachineRegisterInfo::MachineRegisterInfo(const TargetRegisterInfo &TRI) {
- VRegInfo.reserve(256);
- UsedPhysRegs.resize(TRI.getNumRegs());
-
- // Create the physreg use/def lists.
- PhysRegUseDefLists = new MachineOperand*[TRI.getNumRegs()];
- memset(PhysRegUseDefLists, 0, sizeof(MachineOperand*)*TRI.getNumRegs());
-}
-
-MachineRegisterInfo::~MachineRegisterInfo() {
-#ifndef NDEBUG
- for (unsigned i = 0, e = VRegInfo.size(); i != e; ++i)
- assert(VRegInfo[i].second == 0 && "Vreg use list non-empty still?");
-#endif
- delete [] PhysRegUseDefLists;
-}
-
-/// HandleVRegListReallocation - We just added a virtual register to the
-/// VRegInfo info list and it reallocated. Update the use/def lists info
-/// pointers.
-void MachineRegisterInfo::HandleVRegListReallocation() {
- // The back pointers for the vreg lists point into the previous vector.
- // Update them to point to their correct slots.
- for (unsigned i = 0, e = VRegInfo.size(); i != e; ++i) {
- MachineOperand *List = VRegInfo[i].second;
- if (!List) continue;
- // Update the back-pointer to be accurate once more.
- List->Contents.Reg.Prev = &VRegInfo[i].second;
- }
-}
-
-/// replaceRegWith - Replace all instances of FromReg with ToReg in the
-/// machine function. This is like llvm-level X->replaceAllUsesWith(Y),
-/// except that it also changes any definitions of the register as well.
-void MachineRegisterInfo::replaceRegWith(unsigned FromReg, unsigned ToReg) {
- assert(FromReg != ToReg && "Cannot replace a reg with itself");
-
- // TODO: This could be more efficient by bulk changing the operands.
- for (reg_iterator I = reg_begin(FromReg), E = reg_end(); I != E; ) {
- MachineOperand &O = I.getOperand();
- ++I;
- O.setReg(ToReg);
- }
-}
-
-
-/// getVRegDef - Return the machine instr that defines the specified virtual
-/// register or null if none is found. This assumes that the code is in SSA
-/// form, so there should only be one definition.
-MachineInstr *MachineRegisterInfo::getVRegDef(unsigned Reg) const {
- assert(Reg-TargetRegisterInfo::FirstVirtualRegister < VRegInfo.size() &&
- "Invalid vreg!");
- for (reg_iterator I = reg_begin(Reg), E = reg_end(); I != E; ++I) {
- // Since we are in SSA form, we can stop at the first definition.
- if (I.getOperand().isDef())
- return &*I;
- }
- return 0;
-}
-
-
-#ifndef NDEBUG
-void MachineRegisterInfo::dumpUses(unsigned Reg) const {
- for (use_iterator I = use_begin(Reg), E = use_end(); I != E; ++I)
- I.getOperand().getParent()->dump();
-}
-#endif
diff --git a/release_23/lib/CodeGen/MachineSink.cpp b/release_23/lib/CodeGen/MachineSink.cpp
deleted file mode 100644
index 97a4df5497fe..000000000000
--- a/release_23/lib/CodeGen/MachineSink.cpp
+++ /dev/null
@@ -1,234 +0,0 @@
-//===-- MachineSink.cpp - Sinking for machine instructions ----------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This pass
-//
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "machine-sink"
-#include "llvm/CodeGen/Passes.h"
-#include "llvm/CodeGen/MachineRegisterInfo.h"
-#include "llvm/CodeGen/MachineDominators.h"
-#include "llvm/Target/TargetRegisterInfo.h"
-#include "llvm/Target/TargetInstrInfo.h"
-#include "llvm/Target/TargetMachine.h"
-#include "llvm/ADT/SmallVector.h"
-#include "llvm/ADT/Statistic.h"
-#include "llvm/Support/Compiler.h"
-#include "llvm/Support/Debug.h"
-using namespace llvm;
-
-STATISTIC(NumSunk, "Number of machine instructions sunk");
-
-namespace {
- class VISIBILITY_HIDDEN MachineSinking : public MachineFunctionPass {
- const TargetMachine *TM;
- const TargetInstrInfo *TII;
- MachineFunction *CurMF; // Current MachineFunction
- MachineRegisterInfo *RegInfo; // Machine register information
- MachineDominatorTree *DT; // Machine dominator tree for the current Loop
-
- public:
- static char ID; // Pass identification
- MachineSinking() : MachineFunctionPass((intptr_t)&ID) {}
-
- virtual bool runOnMachineFunction(MachineFunction &MF);
-
- virtual void getAnalysisUsage(AnalysisUsage &AU) const {
- MachineFunctionPass::getAnalysisUsage(AU);
- AU.addRequired<MachineDominatorTree>();
- AU.addPreserved<MachineDominatorTree>();
- }
- private:
- bool ProcessBlock(MachineBasicBlock &MBB);
- bool SinkInstruction(MachineInstr *MI, bool &SawStore);
- bool AllUsesDominatedByBlock(unsigned Reg, MachineBasicBlock *MBB) const;
- };
-
- char MachineSinking::ID = 0;
- RegisterPass<MachineSinking> X("machine-sink", "Machine code sinking");
-} // end anonymous namespace
-
-FunctionPass *llvm::createMachineSinkingPass() { return new MachineSinking(); }
-
-/// AllUsesDominatedByBlock - Return true if all uses of the specified register
-/// occur in blocks dominated by the specified block.
-bool MachineSinking::AllUsesDominatedByBlock(unsigned Reg,
- MachineBasicBlock *MBB) const {
- assert(TargetRegisterInfo::isVirtualRegister(Reg) &&
- "Only makes sense for vregs");
- for (MachineRegisterInfo::reg_iterator I = RegInfo->reg_begin(Reg),
- E = RegInfo->reg_end(); I != E; ++I) {
- if (I.getOperand().isDef()) continue; // ignore def.
-
- // Determine the block of the use.
- MachineInstr *UseInst = &*I;
- MachineBasicBlock *UseBlock = UseInst->getParent();
- if (UseInst->getOpcode() == TargetInstrInfo::PHI) {
- // PHI nodes use the operand in the predecessor block, not the block with
- // the PHI.
- UseBlock = UseInst->getOperand(I.getOperandNo()+1).getMBB();
- }
- // Check that it dominates.
- if (!DT->dominates(MBB, UseBlock))
- return false;
- }
- return true;
-}
-
-
-
-bool MachineSinking::runOnMachineFunction(MachineFunction &MF) {
- DOUT << "******** Machine Sinking ********\n";
-
- CurMF = &MF;
- TM = &CurMF->getTarget();
- TII = TM->getInstrInfo();
- RegInfo = &CurMF->getRegInfo();
- DT = &getAnalysis<MachineDominatorTree>();
-
- bool EverMadeChange = false;
-
- while (1) {
- bool MadeChange = false;
-
- // Process all basic blocks.
- for (MachineFunction::iterator I = CurMF->begin(), E = CurMF->end();
- I != E; ++I)
- MadeChange |= ProcessBlock(*I);
-
- // If this iteration over the code changed anything, keep iterating.
- if (!MadeChange) break;
- EverMadeChange = true;
- }
- return EverMadeChange;
-}
-
-bool MachineSinking::ProcessBlock(MachineBasicBlock &MBB) {
- bool MadeChange = false;
-
- // Can't sink anything out of a block that has less than two successors.
- if (MBB.succ_size() <= 1) return false;
-
- // Walk the basic block bottom-up. Remember if we saw a store.
- bool SawStore = false;
- for (MachineBasicBlock::iterator I = MBB.end(); I != MBB.begin(); ){
- MachineBasicBlock::iterator LastIt = I;
- if (SinkInstruction(--I, SawStore)) {
- I = LastIt;
- ++NumSunk;
- }
- }
-
- return MadeChange;
-}
-
-/// SinkInstruction - Determine whether it is safe to sink the specified machine
-/// instruction out of its current block into a successor.
-bool MachineSinking::SinkInstruction(MachineInstr *MI, bool &SawStore) {
- // Check if it's safe to move the instruction.
- if (!MI->isSafeToMove(TII, SawStore))
- return false;
-
- // FIXME: This should include support for sinking instructions within the
- // block they are currently in to shorten the live ranges. We often get
- // instructions sunk into the top of a large block, but it would be better to
- // also sink them down before their first use in the block. This xform has to
- // be careful not to *increase* register pressure though, e.g. sinking
- // "x = y + z" down if it kills y and z would increase the live ranges of y
- // and z only the shrink the live range of x.
-
- // Loop over all the operands of the specified instruction. If there is
- // anything we can't handle, bail out.
- MachineBasicBlock *ParentBlock = MI->getParent();
-
- // SuccToSinkTo - This is the successor to sink this instruction to, once we
- // decide.
- MachineBasicBlock *SuccToSinkTo = 0;
-
- for (unsigned i = 0, e = MI->getNumOperands(); i != e; ++i) {
- const MachineOperand &MO = MI->getOperand(i);
- if (!MO.isReg()) continue; // Ignore non-register operands.
-
- unsigned Reg = MO.getReg();
- if (Reg == 0) continue;
-
- if (TargetRegisterInfo::isPhysicalRegister(Reg)) {
- // If this is a physical register use, we can't move it. If it is a def,
- // we can move it, but only if the def is dead.
- if (MO.isUse() || !MO.isDead())
- return false;
- } else {
- // Virtual register uses are always safe to sink.
- if (MO.isUse()) continue;
-
- // FIXME: This picks a successor to sink into based on having one
- // successor that dominates all the uses. However, there are cases where
- // sinking can happen but where the sink point isn't a successor. For
- // example:
- // x = computation
- // if () {} else {}
- // use x
- // the instruction could be sunk over the whole diamond for the
- // if/then/else (or loop, etc), allowing it to be sunk into other blocks
- // after that.
-
- // Virtual register defs can only be sunk if all their uses are in blocks
- // dominated by one of the successors.
- if (SuccToSinkTo) {
- // If a previous operand picked a block to sink to, then this operand
- // must be sinkable to the same block.
- if (!AllUsesDominatedByBlock(Reg, SuccToSinkTo))
- return false;
- continue;
- }
-
- // Otherwise, we should look at all the successors and decide which one
- // we should sink to.
- for (MachineBasicBlock::succ_iterator SI = ParentBlock->succ_begin(),
- E = ParentBlock->succ_end(); SI != E; ++SI) {
- if (AllUsesDominatedByBlock(Reg, *SI)) {
- SuccToSinkTo = *SI;
- break;
- }
- }
-
- // If we couldn't find a block to sink to, ignore this instruction.
- if (SuccToSinkTo == 0)
- return false;
- }
- }
-
- // If there are no outputs, it must have side-effects.
- if (SuccToSinkTo == 0)
- return false;
-
- DEBUG(cerr << "Sink instr " << *MI);
- DEBUG(cerr << "to block " << *SuccToSinkTo);
-
- // If the block has multiple predecessors, this would introduce computation on
- // a path that it doesn't already exist. We could split the critical edge,
- // but for now we just punt.
- // FIXME: Split critical edges if not backedges.
- if (SuccToSinkTo->pred_size() > 1) {
- DEBUG(cerr << " *** PUNTING: Critical edge found\n");
- return false;
- }
-
- // Determine where to insert into. Skip phi nodes.
- MachineBasicBlock::iterator InsertPos = SuccToSinkTo->begin();
- while (InsertPos != SuccToSinkTo->end() &&
- InsertPos->getOpcode() == TargetInstrInfo::PHI)
- ++InsertPos;
-
- // Move the instruction.
- SuccToSinkTo->splice(InsertPos, ParentBlock, MI,
- ++MachineBasicBlock::iterator(MI));
- return true;
-}
diff --git a/release_23/lib/CodeGen/Makefile b/release_23/lib/CodeGen/Makefile
deleted file mode 100644
index e2f569bbb23c..000000000000
--- a/release_23/lib/CodeGen/Makefile
+++ /dev/null
@@ -1,22 +0,0 @@
-##===- lib/CodeGen/Makefile --------------------------------*- Makefile -*-===##
-#
-# The LLVM Compiler Infrastructure
-#
-# This file is distributed under the University of Illinois Open Source
-# License. See LICENSE.TXT for details.
-#
-##===----------------------------------------------------------------------===##
-
-LEVEL = ../..
-LIBRARYNAME = LLVMCodeGen
-PARALLEL_DIRS = SelectionDAG
-BUILD_ARCHIVE = 1
-
-include $(LEVEL)/Makefile.common
-
-# Xcode prior to 2.4 generates an error in -pedantic mode with use of HUGE_VAL
-# in this directory. Disable -pedantic for this broken compiler.
-ifneq ($(HUGE_VAL_SANITY),yes)
-CompileCommonOpts := $(filter-out -pedantic, $(CompileCommonOpts))
-endif
-
diff --git a/release_23/lib/CodeGen/OcamlCollector.cpp b/release_23/lib/CodeGen/OcamlCollector.cpp
deleted file mode 100644
index 95022a9ed4dc..000000000000
--- a/release_23/lib/CodeGen/OcamlCollector.cpp
+++ /dev/null
@@ -1,171 +0,0 @@
-//===-- OcamlCollector.cpp - Ocaml frametable emitter ---------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements lowering for the llvm.gc* intrinsics compatible with
-// Objective Caml 3.10.0, which uses a liveness-accurate static stack map.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/CodeGen/Collectors.h"
-#include "llvm/CodeGen/AsmPrinter.h"
-#include "llvm/CodeGen/Collector.h"
-#include "llvm/Module.h"
-#include "llvm/Target/TargetAsmInfo.h"
-#include "llvm/Target/TargetData.h"
-#include "llvm/Target/TargetMachine.h"
-
-using namespace llvm;
-
-namespace {
-
- class VISIBILITY_HIDDEN OcamlCollector : public Collector {
- public:
- OcamlCollector();
-
- void beginAssembly(std::ostream &OS, AsmPrinter &AP,
- const TargetAsmInfo &TAI);
-
- void finishAssembly(std::ostream &OS, AsmPrinter &AP,
- const TargetAsmInfo &TAI);
- };
-
- CollectorRegistry::Add<OcamlCollector>
- X("ocaml", "ocaml 3.10-compatible collector");
-
-}
-
-// -----------------------------------------------------------------------------
-
-static void EmitCamlGlobal(const Module &M, std::ostream &OS, AsmPrinter &AP,
- const TargetAsmInfo &TAI, const char *Id) {
- const std::string &MId = M.getModuleIdentifier();
-
- std::string Mangled;
- Mangled += TAI.getGlobalPrefix();
- Mangled += "caml";
- size_t Letter = Mangled.size();
- Mangled.append(MId.begin(), std::find(MId.begin(), MId.end(), '.'));
- Mangled += "__";
- Mangled += Id;
-
- // Capitalize the first letter of the module name.
- Mangled[Letter] = toupper(Mangled[Letter]);
-
- if (const char *GlobalDirective = TAI.getGlobalDirective())
- OS << GlobalDirective << Mangled << "\n";
- OS << Mangled << ":\n";
-}
-
-Collector *llvm::createOcamlCollector() {
- return new OcamlCollector();
-}
-
-OcamlCollector::OcamlCollector() {
- NeededSafePoints = 1 << GC::PostCall;
-}
-
-void OcamlCollector::beginAssembly(std::ostream &OS, AsmPrinter &AP,
- const TargetAsmInfo &TAI) {
- AP.SwitchToTextSection(TAI.getTextSection());
- EmitCamlGlobal(getModule(), OS, AP, TAI, "code_begin");
-
- AP.SwitchToDataSection(TAI.getDataSection());
- EmitCamlGlobal(getModule(), OS, AP, TAI, "data_begin");
-}
-
-/// emitAssembly - Print the frametable. The ocaml frametable format is thus:
-///
-/// extern "C" struct align(sizeof(intptr_t)) {
-/// uint16_t NumDescriptors;
-/// struct align(sizeof(intptr_t)) {
-/// void *ReturnAddress;
-/// uint16_t FrameSize;
-/// uint16_t NumLiveOffsets;
-/// uint16_t LiveOffsets[NumLiveOffsets];
-/// } Descriptors[NumDescriptors];
-/// } caml${module}__frametable;
-///
-/// Note that this precludes programs from stack frames larger than 64K
-/// (FrameSize and LiveOffsets would overflow). FrameTablePrinter will abort if
-/// either condition is detected in a function which uses the collector.
-///
-void OcamlCollector::finishAssembly(std::ostream &OS, AsmPrinter &AP,
- const TargetAsmInfo &TAI) {
- const char *AddressDirective;
- int AddressAlignLog;
- if (AP.TM.getTargetData()->getPointerSize() == sizeof(int32_t)) {
- AddressDirective = TAI.getData32bitsDirective();
- AddressAlignLog = 2;
- } else {
- AddressDirective = TAI.getData64bitsDirective();
- AddressAlignLog = 3;
- }
-
- AP.SwitchToTextSection(TAI.getTextSection());
- EmitCamlGlobal(getModule(), OS, AP, TAI, "code_end");
-
- AP.SwitchToDataSection(TAI.getDataSection());
- EmitCamlGlobal(getModule(), OS, AP, TAI, "data_end");
-
- OS << AddressDirective << 0; // FIXME: Why does ocaml emit this??
- AP.EOL();
-
- AP.SwitchToDataSection(TAI.getDataSection());
- EmitCamlGlobal(getModule(), OS, AP, TAI, "frametable");
-
- for (iterator FI = begin(), FE = end(); FI != FE; ++FI) {
- CollectorMetadata &MD = **FI;
-
- OS << "\t" << TAI.getCommentString() << " live roots for "
- << MD.getFunction().getNameStart() << "\n";
-
- for (CollectorMetadata::iterator PI = MD.begin(),
- PE = MD.end(); PI != PE; ++PI) {
-
- uint64_t FrameSize = MD.getFrameSize();
- if (FrameSize >= 2<<16) {
- cerr << "Function '" << MD.getFunction().getNameStart()
- << "' is too large for the ocaml collector! "
- << "Frame size " << FrameSize << " >= 65536.\n";
- abort(); // Very rude!
- }
-
- size_t LiveCount = MD.live_size(PI);
- if (LiveCount >= 2<<16) {
- cerr << "Function '" << MD.getFunction().getNameStart()
- << "' is too large for the ocaml collector! "
- << "Live root count " << LiveCount << " >= 65536.\n";
- abort(); // Very rude!
- }
-
- OS << AddressDirective
- << TAI.getPrivateGlobalPrefix() << "label" << PI->Num;
- AP.EOL("call return address");
-
- AP.EmitInt16(FrameSize);
- AP.EOL("stack frame size");
-
- AP.EmitInt16(LiveCount);
- AP.EOL("live root count");
-
- for (CollectorMetadata::live_iterator LI = MD.live_begin(PI),
- LE = MD.live_end(PI);
- LI != LE; ++LI) {
- assert(LI->StackOffset < 2<<16 &&
- "GC root stack offset is outside of fixed stack frame and out "
- "of range for Ocaml collector!");
-
- OS << "\t.word\t" << LI->StackOffset;
- AP.EOL("stack offset");
- }
-
- AP.EmitAlignment(AddressAlignLog);
- }
- }
-}
diff --git a/release_23/lib/CodeGen/PHIElimination.cpp b/release_23/lib/CodeGen/PHIElimination.cpp
deleted file mode 100644
index 8b1f3078709a..000000000000
--- a/release_23/lib/CodeGen/PHIElimination.cpp
+++ /dev/null
@@ -1,373 +0,0 @@
-//===-- PhiElimination.cpp - Eliminate PHI nodes by inserting copies ------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This pass eliminates machine instruction PHI nodes by inserting copy
-// instructions. This destroys SSA information, but is the desired input for
-// some register allocators.
-//
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "phielim"
-#include "llvm/CodeGen/LiveVariables.h"
-#include "llvm/CodeGen/Passes.h"
-#include "llvm/CodeGen/MachineFunctionPass.h"
-#include "llvm/CodeGen/MachineInstr.h"
-#include "llvm/CodeGen/MachineInstrBuilder.h"
-#include "llvm/CodeGen/MachineRegisterInfo.h"
-#include "llvm/Target/TargetInstrInfo.h"
-#include "llvm/Target/TargetMachine.h"
-#include "llvm/ADT/SmallPtrSet.h"
-#include "llvm/ADT/STLExtras.h"
-#include "llvm/ADT/Statistic.h"
-#include "llvm/Support/Compiler.h"
-#include <algorithm>
-#include <map>
-using namespace llvm;
-
-STATISTIC(NumAtomic, "Number of atomic phis lowered");
-
-namespace {
- class VISIBILITY_HIDDEN PNE : public MachineFunctionPass {
- MachineRegisterInfo *MRI; // Machine register information
-
- public:
- static char ID; // Pass identification, replacement for typeid
- PNE() : MachineFunctionPass((intptr_t)&ID) {}
-
- virtual bool runOnMachineFunction(MachineFunction &Fn);
-
- virtual void getAnalysisUsage(AnalysisUsage &AU) const {
- AU.addPreserved<LiveVariables>();
- AU.addPreservedID(MachineLoopInfoID);
- AU.addPreservedID(MachineDominatorsID);
- MachineFunctionPass::getAnalysisUsage(AU);
- }
-
- private:
- /// EliminatePHINodes - Eliminate phi nodes by inserting copy instructions
- /// in predecessor basic blocks.
- ///
- bool EliminatePHINodes(MachineFunction &MF, MachineBasicBlock &MBB);
- void LowerAtomicPHINode(MachineBasicBlock &MBB,
- MachineBasicBlock::iterator AfterPHIsIt);
-
- /// analyzePHINodes - Gather information about the PHI nodes in
- /// here. In particular, we want to map the number of uses of a virtual
- /// register which is used in a PHI node. We map that to the BB the
- /// vreg is coming from. This is used later to determine when the vreg
- /// is killed in the BB.
- ///
- void analyzePHINodes(const MachineFunction& Fn);
-
- typedef std::pair<const MachineBasicBlock*, unsigned> BBVRegPair;
- typedef std::map<BBVRegPair, unsigned> VRegPHIUse;
-
- VRegPHIUse VRegPHIUseCount;
-
- // Defs of PHI sources which are implicit_def.
- SmallPtrSet<MachineInstr*, 4> ImpDefs;
- };
-
- char PNE::ID = 0;
- RegisterPass<PNE> X("phi-node-elimination",
- "Eliminate PHI nodes for register allocation");
-}
-
-const PassInfo *llvm::PHIEliminationID = X.getPassInfo();
-
-bool PNE::runOnMachineFunction(MachineFunction &Fn) {
- MRI = &Fn.getRegInfo();
-
- analyzePHINodes(Fn);
-
- bool Changed = false;
-
- // Eliminate PHI instructions by inserting copies into predecessor blocks.
- for (MachineFunction::iterator I = Fn.begin(), E = Fn.end(); I != E; ++I)
- Changed |= EliminatePHINodes(Fn, *I);
-
- // Remove dead IMPLICIT_DEF instructions.
- for (SmallPtrSet<MachineInstr*,4>::iterator I = ImpDefs.begin(),
- E = ImpDefs.end(); I != E; ++I) {
- MachineInstr *DefMI = *I;
- unsigned DefReg = DefMI->getOperand(0).getReg();
- if (MRI->use_begin(DefReg) == MRI->use_end())
- DefMI->eraseFromParent();
- }
-
- ImpDefs.clear();
- VRegPHIUseCount.clear();
- return Changed;
-}
-
-
-/// EliminatePHINodes - Eliminate phi nodes by inserting copy instructions in
-/// predecessor basic blocks.
-///
-bool PNE::EliminatePHINodes(MachineFunction &MF, MachineBasicBlock &MBB) {
- if (MBB.empty() || MBB.front().getOpcode() != TargetInstrInfo::PHI)
- return false; // Quick exit for basic blocks without PHIs.
-
- // Get an iterator to the first instruction after the last PHI node (this may
- // also be the end of the basic block).
- MachineBasicBlock::iterator AfterPHIsIt = MBB.begin();
- while (AfterPHIsIt != MBB.end() &&
- AfterPHIsIt->getOpcode() == TargetInstrInfo::PHI)
- ++AfterPHIsIt; // Skip over all of the PHI nodes...
-
- while (MBB.front().getOpcode() == TargetInstrInfo::PHI)
- LowerAtomicPHINode(MBB, AfterPHIsIt);
-
- return true;
-}
-
-static bool isSourceDefinedByImplicitDef(MachineInstr *MPhi,
- MachineRegisterInfo *MRI) {
- for (unsigned i = 1; i != MPhi->getNumOperands(); i += 2) {
- unsigned SrcReg = MPhi->getOperand(i).getReg();
- MachineInstr *DefMI = MRI->getVRegDef(SrcReg);
- if (!DefMI || DefMI->getOpcode() != TargetInstrInfo::IMPLICIT_DEF)
- return false;
- }
- return true;
-}
-
-/// LowerAtomicPHINode - Lower the PHI node at the top of the specified block,
-/// under the assuption that it needs to be lowered in a way that supports
-/// atomic execution of PHIs. This lowering method is always correct all of the
-/// time.
-void PNE::LowerAtomicPHINode(MachineBasicBlock &MBB,
- MachineBasicBlock::iterator AfterPHIsIt) {
- // Unlink the PHI node from the basic block, but don't delete the PHI yet.
- MachineInstr *MPhi = MBB.remove(MBB.begin());
-
- unsigned NumSrcs = (MPhi->getNumOperands() - 1) / 2;
- unsigned DestReg = MPhi->getOperand(0).getReg();
-
- // Create a new register for the incoming PHI arguments.
- MachineFunction &MF = *MBB.getParent();
- const TargetRegisterClass *RC = MF.getRegInfo().getRegClass(DestReg);
- unsigned IncomingReg = MF.getRegInfo().createVirtualRegister(RC);
-
- // Insert a register to register copy in the top of the current block (but
- // after any remaining phi nodes) which copies the new incoming register
- // into the phi node destination.
- //
- const TargetInstrInfo *TII = MF.getTarget().getInstrInfo();
- if (isSourceDefinedByImplicitDef(MPhi, MRI))
- // If all sources of a PHI node are implicit_def, just emit an implicit_def
- // instead of a copy.
- BuildMI(MBB, AfterPHIsIt, TII->get(TargetInstrInfo::IMPLICIT_DEF), DestReg);
- else
- TII->copyRegToReg(MBB, AfterPHIsIt, DestReg, IncomingReg, RC, RC);
-
- // Update live variable information if there is any...
- LiveVariables *LV = getAnalysisToUpdate<LiveVariables>();
- if (LV) {
- MachineInstr *PHICopy = prior(AfterPHIsIt);
-
- // Increment use count of the newly created virtual register.
- LV->getVarInfo(IncomingReg).NumUses++;
-
- // Add information to LiveVariables to know that the incoming value is
- // killed. Note that because the value is defined in several places (once
- // each for each incoming block), the "def" block and instruction fields
- // for the VarInfo is not filled in.
- //
- LV->addVirtualRegisterKilled(IncomingReg, PHICopy);
-
- // Since we are going to be deleting the PHI node, if it is the last use
- // of any registers, or if the value itself is dead, we need to move this
- // information over to the new copy we just inserted.
- //
- LV->removeVirtualRegistersKilled(MPhi);
-
- // If the result is dead, update LV.
- if (MPhi->registerDefIsDead(DestReg)) {
- LV->addVirtualRegisterDead(DestReg, PHICopy);
- LV->removeVirtualRegistersDead(MPhi);
- }
-
- LV->getVarInfo(IncomingReg).UsedBlocks[MBB.getNumber()] = true;
- }
-
- // Adjust the VRegPHIUseCount map to account for the removal of this PHI
- // node.
- for (unsigned i = 1; i != MPhi->getNumOperands(); i += 2)
- --VRegPHIUseCount[BBVRegPair(MPhi->getOperand(i + 1).getMBB(),
- MPhi->getOperand(i).getReg())];
-
- // Now loop over all of the incoming arguments, changing them to copy into
- // the IncomingReg register in the corresponding predecessor basic block.
- //
- SmallPtrSet<MachineBasicBlock*, 8> MBBsInsertedInto;
- for (int i = NumSrcs - 1; i >= 0; --i) {
- unsigned SrcReg = MPhi->getOperand(i*2+1).getReg();
- assert(TargetRegisterInfo::isVirtualRegister(SrcReg) &&
- "Machine PHI Operands must all be virtual registers!");
-
- // If source is defined by an implicit def, there is no need to insert
- // a copy unless it's the only source.
- MachineInstr *DefMI = MRI->getVRegDef(SrcReg);
- if (DefMI->getOpcode() == TargetInstrInfo::IMPLICIT_DEF) {
- ImpDefs.insert(DefMI);
- continue;
- }
-
- // Get the MachineBasicBlock equivalent of the BasicBlock that is the
- // source path the PHI.
- MachineBasicBlock &opBlock = *MPhi->getOperand(i*2+2).getMBB();
-
- // Check to make sure we haven't already emitted the copy for this block.
- // This can happen because PHI nodes may have multiple entries for the
- // same basic block.
- if (!MBBsInsertedInto.insert(&opBlock))
- continue; // If the copy has already been emitted, we're done.
-
- // Find a safe location to insert the copy, this may be the first
- // terminator in the block (or end()).
- MachineBasicBlock::iterator InsertPos = opBlock.getFirstTerminator();
-
- // Insert the copy.
- TII->copyRegToReg(opBlock, InsertPos, IncomingReg, SrcReg, RC, RC);
-
- // Now update live variable information if we have it. Otherwise we're done
- if (!LV) continue;
-
- // We want to be able to insert a kill of the register if this PHI
- // (aka, the copy we just inserted) is the last use of the source
- // value. Live variable analysis conservatively handles this by
- // saying that the value is live until the end of the block the PHI
- // entry lives in. If the value really is dead at the PHI copy, there
- // will be no successor blocks which have the value live-in.
- //
- // Check to see if the copy is the last use, and if so, update the
- // live variables information so that it knows the copy source
- // instruction kills the incoming value.
- //
- LiveVariables::VarInfo &InRegVI = LV->getVarInfo(SrcReg);
- InRegVI.UsedBlocks[opBlock.getNumber()] = true;
-
- // Loop over all of the successors of the basic block, checking to see
- // if the value is either live in the block, or if it is killed in the
- // block. Also check to see if this register is in use by another PHI
- // node which has not yet been eliminated. If so, it will be killed
- // at an appropriate point later.
- //
-
- // Is it used by any PHI instructions in this block?
- bool ValueIsLive = VRegPHIUseCount[BBVRegPair(&opBlock, SrcReg)] != 0;
-
- std::vector<MachineBasicBlock*> OpSuccBlocks;
-
- // Otherwise, scan successors, including the BB the PHI node lives in.
- for (MachineBasicBlock::succ_iterator SI = opBlock.succ_begin(),
- E = opBlock.succ_end(); SI != E && !ValueIsLive; ++SI) {
- MachineBasicBlock *SuccMBB = *SI;
-
- // Is it alive in this successor?
- unsigned SuccIdx = SuccMBB->getNumber();
- if (SuccIdx < InRegVI.AliveBlocks.size() &&
- InRegVI.AliveBlocks[SuccIdx]) {
- ValueIsLive = true;
- break;
- }
-
- OpSuccBlocks.push_back(SuccMBB);
- }
-
- // Check to see if this value is live because there is a use in a successor
- // that kills it.
- if (!ValueIsLive) {
- switch (OpSuccBlocks.size()) {
- case 1: {
- MachineBasicBlock *MBB = OpSuccBlocks[0];
- for (unsigned i = 0, e = InRegVI.Kills.size(); i != e; ++i)
- if (InRegVI.Kills[i]->getParent() == MBB) {
- ValueIsLive = true;
- break;
- }
- break;
- }
- case 2: {
- MachineBasicBlock *MBB1 = OpSuccBlocks[0], *MBB2 = OpSuccBlocks[1];
- for (unsigned i = 0, e = InRegVI.Kills.size(); i != e; ++i)
- if (InRegVI.Kills[i]->getParent() == MBB1 ||
- InRegVI.Kills[i]->getParent() == MBB2) {
- ValueIsLive = true;
- break;
- }
- break;
- }
- default:
- std::sort(OpSuccBlocks.begin(), OpSuccBlocks.end());
- for (unsigned i = 0, e = InRegVI.Kills.size(); i != e; ++i)
- if (std::binary_search(OpSuccBlocks.begin(), OpSuccBlocks.end(),
- InRegVI.Kills[i]->getParent())) {
- ValueIsLive = true;
- break;
- }
- }
- }
-
- // Okay, if we now know that the value is not live out of the block,
- // we can add a kill marker in this block saying that it kills the incoming
- // value!
- if (!ValueIsLive) {
- // In our final twist, we have to decide which instruction kills the
- // register. In most cases this is the copy, however, the first
- // terminator instruction at the end of the block may also use the value.
- // In this case, we should mark *it* as being the killing block, not the
- // copy.
- MachineBasicBlock::iterator KillInst = prior(InsertPos);
- MachineBasicBlock::iterator Term = opBlock.getFirstTerminator();
- if (Term != opBlock.end()) {
- if (Term->readsRegister(SrcReg))
- KillInst = Term;
-
- // Check that no other terminators use values.
-#ifndef NDEBUG
- for (MachineBasicBlock::iterator TI = next(Term); TI != opBlock.end();
- ++TI) {
- assert(!TI->readsRegister(SrcReg) &&
- "Terminator instructions cannot use virtual registers unless"
- "they are the first terminator in a block!");
- }
-#endif
- }
-
- // Finally, mark it killed.
- LV->addVirtualRegisterKilled(SrcReg, KillInst);
-
- // This vreg no longer lives all of the way through opBlock.
- unsigned opBlockNum = opBlock.getNumber();
- if (opBlockNum < InRegVI.AliveBlocks.size())
- InRegVI.AliveBlocks[opBlockNum] = false;
- }
- }
-
- // Really delete the PHI instruction now!
- delete MPhi;
- ++NumAtomic;
-}
-
-/// analyzePHINodes - Gather information about the PHI nodes in here. In
-/// particular, we want to map the number of uses of a virtual register which is
-/// used in a PHI node. We map that to the BB the vreg is coming from. This is
-/// used later to determine when the vreg is killed in the BB.
-///
-void PNE::analyzePHINodes(const MachineFunction& Fn) {
- for (MachineFunction::const_iterator I = Fn.begin(), E = Fn.end();
- I != E; ++I)
- for (MachineBasicBlock::const_iterator BBI = I->begin(), BBE = I->end();
- BBI != BBE && BBI->getOpcode() == TargetInstrInfo::PHI; ++BBI)
- for (unsigned i = 1, e = BBI->getNumOperands(); i != e; i += 2)
- ++VRegPHIUseCount[BBVRegPair(BBI->getOperand(i + 1).getMBB(),
- BBI->getOperand(i).getReg())];
-}
diff --git a/release_23/lib/CodeGen/Passes.cpp b/release_23/lib/CodeGen/Passes.cpp
deleted file mode 100644
index bcd67c5037f5..000000000000
--- a/release_23/lib/CodeGen/Passes.cpp
+++ /dev/null
@@ -1,57 +0,0 @@
-//===-- Passes.cpp - Target independent code generation passes ------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines interfaces to access the target independent code
-// generation passes provided by the LLVM backend.
-//
-//===---------------------------------------------------------------------===//
-
-#include "llvm/CodeGen/RegAllocRegistry.h"
-#include "llvm/CodeGen/Passes.h"
-
-using namespace llvm;
-
-//===---------------------------------------------------------------------===//
-///
-/// RegisterRegAlloc class - Track the registration of register allocators.
-///
-//===---------------------------------------------------------------------===//
-MachinePassRegistry RegisterRegAlloc::Registry;
-
-
-//===---------------------------------------------------------------------===//
-///
-/// RegAlloc command line options.
-///
-//===---------------------------------------------------------------------===//
-namespace {
- static
- cl::opt<RegisterRegAlloc::FunctionPassCtor, false,
- RegisterPassParser<RegisterRegAlloc> >
- RegAlloc("regalloc",
- cl::init(&createLinearScanRegisterAllocator),
- cl::desc("Register allocator to use: (default = linearscan)"));
-}
-
-
-//===---------------------------------------------------------------------===//
-///
-/// createRegisterAllocator - choose the appropriate register allocator.
-///
-//===---------------------------------------------------------------------===//
-FunctionPass *llvm::createRegisterAllocator() {
- RegisterRegAlloc::FunctionPassCtor Ctor = RegisterRegAlloc::getDefault();
-
- if (!Ctor) {
- Ctor = RegAlloc;
- RegisterRegAlloc::setDefault(RegAlloc);
- }
-
- return Ctor();
-}
diff --git a/release_23/lib/CodeGen/PhysRegTracker.h b/release_23/lib/CodeGen/PhysRegTracker.h
deleted file mode 100644
index 1f10c4bdaf9c..000000000000
--- a/release_23/lib/CodeGen/PhysRegTracker.h
+++ /dev/null
@@ -1,73 +0,0 @@
-//===-- llvm/CodeGen/PhysRegTracker.h - Physical Register Tracker -*- C++ -*-=//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements a physical register tracker. The tracker
-// tracks physical register usage through addRegUse and
-// delRegUse. isRegAvail checks if a physical register is available or
-// not taking into consideration register aliases.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_CODEGEN_PHYSREGTRACKER_H
-#define LLVM_CODEGEN_PHYSREGTRACKER_H
-
-#include "llvm/Target/TargetRegisterInfo.h"
-
-namespace llvm {
-
- class PhysRegTracker {
- const TargetRegisterInfo* tri_;
- std::vector<unsigned> regUse_;
-
- public:
- explicit PhysRegTracker(const TargetRegisterInfo& tri)
- : tri_(&tri),
- regUse_(tri_->getNumRegs(), 0) {
- }
-
- PhysRegTracker(const PhysRegTracker& rhs)
- : tri_(rhs.tri_),
- regUse_(rhs.regUse_) {
- }
-
- const PhysRegTracker& operator=(const PhysRegTracker& rhs) {
- tri_ = rhs.tri_;
- regUse_ = rhs.regUse_;
- return *this;
- }
-
- void addRegUse(unsigned physReg) {
- assert(TargetRegisterInfo::isPhysicalRegister(physReg) &&
- "should be physical register!");
- ++regUse_[physReg];
- for (const unsigned* as = tri_->getAliasSet(physReg); *as; ++as)
- ++regUse_[*as];
- }
-
- void delRegUse(unsigned physReg) {
- assert(TargetRegisterInfo::isPhysicalRegister(physReg) &&
- "should be physical register!");
- assert(regUse_[physReg] != 0);
- --regUse_[physReg];
- for (const unsigned* as = tri_->getAliasSet(physReg); *as; ++as) {
- assert(regUse_[*as] != 0);
- --regUse_[*as];
- }
- }
-
- bool isRegAvail(unsigned physReg) const {
- assert(TargetRegisterInfo::isPhysicalRegister(physReg) &&
- "should be physical register!");
- return regUse_[physReg] == 0;
- }
- };
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/lib/CodeGen/PostRASchedulerList.cpp b/release_23/lib/CodeGen/PostRASchedulerList.cpp
deleted file mode 100644
index 8c9776e07a94..000000000000
--- a/release_23/lib/CodeGen/PostRASchedulerList.cpp
+++ /dev/null
@@ -1,66 +0,0 @@
-//===----- SchedulePostRAList.cpp - list scheduler ------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This implements a top-down list scheduler, using standard algorithms.
-// The basic approach uses a priority queue of available nodes to schedule.
-// One at a time, nodes are taken from the priority queue (thus in priority
-// order), checked for legality to schedule, and emitted if legal.
-//
-// Nodes may not be legal to schedule either due to structural hazards (e.g.
-// pipeline or resource constraints) or because an input to the instruction has
-// not completed execution.
-//
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "post-RA-sched"
-#include "llvm/CodeGen/Passes.h"
-#include "llvm/CodeGen/MachineFunctionPass.h"
-#include "llvm/Support/Compiler.h"
-#include "llvm/Support/Debug.h"
-using namespace llvm;
-
-namespace {
- class VISIBILITY_HIDDEN SchedulePostRATDList : public MachineFunctionPass {
- public:
- static char ID;
- SchedulePostRATDList() : MachineFunctionPass((intptr_t)&ID) {}
- private:
- MachineFunction *MF;
- const TargetMachine *TM;
- public:
- const char *getPassName() const {
- return "Post RA top-down list latency scheduler (STUB)";
- }
-
- bool runOnMachineFunction(MachineFunction &Fn);
- };
- char SchedulePostRATDList::ID = 0;
-}
-
-bool SchedulePostRATDList::runOnMachineFunction(MachineFunction &Fn) {
- DOUT << "SchedulePostRATDList\n";
- MF = &Fn;
- TM = &MF->getTarget();
-
- // Loop over all of the basic blocks
- for (MachineFunction::iterator MBB = Fn.begin(), MBBe = Fn.end();
- MBB != MBBe; ++MBB)
- ;
-
- return true;
-}
-
-
-//===----------------------------------------------------------------------===//
-// Public Constructor Functions
-//===----------------------------------------------------------------------===//
-
-FunctionPass *llvm::createPostRAScheduler() {
- return new SchedulePostRATDList();
-}
diff --git a/release_23/lib/CodeGen/PrologEpilogInserter.cpp b/release_23/lib/CodeGen/PrologEpilogInserter.cpp
deleted file mode 100644
index fda08bc29f63..000000000000
--- a/release_23/lib/CodeGen/PrologEpilogInserter.cpp
+++ /dev/null
@@ -1,585 +0,0 @@
-//===-- PrologEpilogInserter.cpp - Insert Prolog/Epilog code in function --===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This pass is responsible for finalizing the functions frame layout, saving
-// callee saved registers, and for emitting prolog & epilog code for the
-// function.
-//
-// This pass must be run after register allocation. After this pass is
-// executed, it is illegal to construct MO_FrameIndex operands.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/CodeGen/Passes.h"
-#include "llvm/CodeGen/MachineFunctionPass.h"
-#include "llvm/CodeGen/MachineInstr.h"
-#include "llvm/CodeGen/MachineFrameInfo.h"
-#include "llvm/CodeGen/MachineModuleInfo.h"
-#include "llvm/CodeGen/MachineRegisterInfo.h"
-#include "llvm/CodeGen/RegisterScavenging.h"
-#include "llvm/Target/TargetMachine.h"
-#include "llvm/Target/TargetRegisterInfo.h"
-#include "llvm/Target/TargetFrameInfo.h"
-#include "llvm/Target/TargetInstrInfo.h"
-#include "llvm/Support/Compiler.h"
-#include "llvm/ADT/STLExtras.h"
-#include <climits>
-using namespace llvm;
-
-namespace {
- struct VISIBILITY_HIDDEN PEI : public MachineFunctionPass {
- static char ID;
- PEI() : MachineFunctionPass((intptr_t)&ID) {}
-
- const char *getPassName() const {
- return "Prolog/Epilog Insertion & Frame Finalization";
- }
-
- /// runOnMachineFunction - Insert prolog/epilog code and replace abstract
- /// frame indexes with appropriate references.
- ///
- bool runOnMachineFunction(MachineFunction &Fn) {
- const TargetRegisterInfo *TRI = Fn.getTarget().getRegisterInfo();
- RS = TRI->requiresRegisterScavenging(Fn) ? new RegScavenger() : NULL;
-
- // Get MachineModuleInfo so that we can track the construction of the
- // frame.
- if (MachineModuleInfo *MMI = getAnalysisToUpdate<MachineModuleInfo>())
- Fn.getFrameInfo()->setMachineModuleInfo(MMI);
-
- // Allow the target machine to make some adjustments to the function
- // e.g. UsedPhysRegs before calculateCalleeSavedRegisters.
- TRI->processFunctionBeforeCalleeSavedScan(Fn, RS);
-
- // Scan the function for modified callee saved registers and insert spill
- // code for any callee saved registers that are modified. Also calculate
- // the MaxCallFrameSize and HasCalls variables for the function's frame
- // information and eliminates call frame pseudo instructions.
- calculateCalleeSavedRegisters(Fn);
-
- // Add the code to save and restore the callee saved registers
- saveCalleeSavedRegisters(Fn);
-
- // Allow the target machine to make final modifications to the function
- // before the frame layout is finalized.
- TRI->processFunctionBeforeFrameFinalized(Fn);
-
- // Calculate actual frame offsets for all of the abstract stack objects...
- calculateFrameObjectOffsets(Fn);
-
- // Add prolog and epilog code to the function. This function is required
- // to align the stack frame as necessary for any stack variables or
- // called functions. Because of this, calculateCalleeSavedRegisters
- // must be called before this function in order to set the HasCalls
- // and MaxCallFrameSize variables.
- insertPrologEpilogCode(Fn);
-
- // Replace all MO_FrameIndex operands with physical register references
- // and actual offsets.
- //
- replaceFrameIndices(Fn);
-
- delete RS;
- return true;
- }
-
- private:
- RegScavenger *RS;
-
- // MinCSFrameIndex, MaxCSFrameIndex - Keeps the range of callee saved
- // stack frame indexes.
- unsigned MinCSFrameIndex, MaxCSFrameIndex;
-
- void calculateCalleeSavedRegisters(MachineFunction &Fn);
- void saveCalleeSavedRegisters(MachineFunction &Fn);
- void calculateFrameObjectOffsets(MachineFunction &Fn);
- void replaceFrameIndices(MachineFunction &Fn);
- void insertPrologEpilogCode(MachineFunction &Fn);
- };
- char PEI::ID = 0;
-}
-
-
-/// createPrologEpilogCodeInserter - This function returns a pass that inserts
-/// prolog and epilog code, and eliminates abstract frame references.
-///
-FunctionPass *llvm::createPrologEpilogCodeInserter() { return new PEI(); }
-
-
-/// calculateCalleeSavedRegisters - Scan the function for modified callee saved
-/// registers. Also calculate the MaxCallFrameSize and HasCalls variables for
-/// the function's frame information and eliminates call frame pseudo
-/// instructions.
-///
-void PEI::calculateCalleeSavedRegisters(MachineFunction &Fn) {
- const TargetRegisterInfo *RegInfo = Fn.getTarget().getRegisterInfo();
- const TargetFrameInfo *TFI = Fn.getTarget().getFrameInfo();
-
- // Get the callee saved register list...
- const unsigned *CSRegs = RegInfo->getCalleeSavedRegs(&Fn);
-
- // Get the function call frame set-up and tear-down instruction opcode
- int FrameSetupOpcode = RegInfo->getCallFrameSetupOpcode();
- int FrameDestroyOpcode = RegInfo->getCallFrameDestroyOpcode();
-
- // These are used to keep track the callee-save area. Initialize them.
- MinCSFrameIndex = INT_MAX;
- MaxCSFrameIndex = 0;
-
- // Early exit for targets which have no callee saved registers and no call
- // frame setup/destroy pseudo instructions.
- if ((CSRegs == 0 || CSRegs[0] == 0) &&
- FrameSetupOpcode == -1 && FrameDestroyOpcode == -1)
- return;
-
- unsigned MaxCallFrameSize = 0;
- bool HasCalls = false;
-
- std::vector<MachineBasicBlock::iterator> FrameSDOps;
- for (MachineFunction::iterator BB = Fn.begin(), E = Fn.end(); BB != E; ++BB)
- for (MachineBasicBlock::iterator I = BB->begin(); I != BB->end(); ++I)
- if (I->getOpcode() == FrameSetupOpcode ||
- I->getOpcode() == FrameDestroyOpcode) {
- assert(I->getNumOperands() >= 1 && "Call Frame Setup/Destroy Pseudo"
- " instructions should have a single immediate argument!");
- unsigned Size = I->getOperand(0).getImm();
- if (Size > MaxCallFrameSize) MaxCallFrameSize = Size;
- HasCalls = true;
- FrameSDOps.push_back(I);
- }
-
- MachineFrameInfo *FFI = Fn.getFrameInfo();
- FFI->setHasCalls(HasCalls);
- FFI->setMaxCallFrameSize(MaxCallFrameSize);
-
- for (unsigned i = 0, e = FrameSDOps.size(); i != e; ++i) {
- MachineBasicBlock::iterator I = FrameSDOps[i];
- // If call frames are not being included as part of the stack frame,
- // and there is no dynamic allocation (therefore referencing frame slots
- // off sp), leave the pseudo ops alone. We'll eliminate them later.
- if (RegInfo->hasReservedCallFrame(Fn) || RegInfo->hasFP(Fn))
- RegInfo->eliminateCallFramePseudoInstr(Fn, *I->getParent(), I);
- }
-
- // Now figure out which *callee saved* registers are modified by the current
- // function, thus needing to be saved and restored in the prolog/epilog.
- //
- const TargetRegisterClass* const *CSRegClasses =
- RegInfo->getCalleeSavedRegClasses(&Fn);
- std::vector<CalleeSavedInfo> CSI;
- for (unsigned i = 0; CSRegs[i]; ++i) {
- unsigned Reg = CSRegs[i];
- if (Fn.getRegInfo().isPhysRegUsed(Reg)) {
- // If the reg is modified, save it!
- CSI.push_back(CalleeSavedInfo(Reg, CSRegClasses[i]));
- } else {
- for (const unsigned *AliasSet = RegInfo->getAliasSet(Reg);
- *AliasSet; ++AliasSet) { // Check alias registers too.
- if (Fn.getRegInfo().isPhysRegUsed(*AliasSet)) {
- CSI.push_back(CalleeSavedInfo(Reg, CSRegClasses[i]));
- break;
- }
- }
- }
- }
-
- if (CSI.empty())
- return; // Early exit if no callee saved registers are modified!
-
- unsigned NumFixedSpillSlots;
- const std::pair<unsigned,int> *FixedSpillSlots =
- TFI->getCalleeSavedSpillSlots(NumFixedSpillSlots);
-
- // Now that we know which registers need to be saved and restored, allocate
- // stack slots for them.
- for (unsigned i = 0, e = CSI.size(); i != e; ++i) {
- unsigned Reg = CSI[i].getReg();
- const TargetRegisterClass *RC = CSI[i].getRegClass();
-
- // Check to see if this physreg must be spilled to a particular stack slot
- // on this target.
- const std::pair<unsigned,int> *FixedSlot = FixedSpillSlots;
- while (FixedSlot != FixedSpillSlots+NumFixedSpillSlots &&
- FixedSlot->first != Reg)
- ++FixedSlot;
-
- int FrameIdx;
- if (FixedSlot == FixedSpillSlots+NumFixedSpillSlots) {
- // Nope, just spill it anywhere convenient.
- unsigned Align = RC->getAlignment();
- unsigned StackAlign = TFI->getStackAlignment();
- // We may not be able to sastify the desired alignment specification of
- // the TargetRegisterClass if the stack alignment is smaller. Use the min.
- Align = std::min(Align, StackAlign);
- FrameIdx = FFI->CreateStackObject(RC->getSize(), Align);
- if ((unsigned)FrameIdx < MinCSFrameIndex) MinCSFrameIndex = FrameIdx;
- if ((unsigned)FrameIdx > MaxCSFrameIndex) MaxCSFrameIndex = FrameIdx;
- } else {
- // Spill it to the stack where we must.
- FrameIdx = FFI->CreateFixedObject(RC->getSize(), FixedSlot->second);
- }
- CSI[i].setFrameIdx(FrameIdx);
- }
-
- FFI->setCalleeSavedInfo(CSI);
-}
-
-/// saveCalleeSavedRegisters - Insert spill code for any callee saved registers
-/// that are modified in the function.
-///
-void PEI::saveCalleeSavedRegisters(MachineFunction &Fn) {
- // Get callee saved register information.
- MachineFrameInfo *FFI = Fn.getFrameInfo();
- const std::vector<CalleeSavedInfo> &CSI = FFI->getCalleeSavedInfo();
-
- // Early exit if no callee saved registers are modified!
- if (CSI.empty())
- return;
-
- const TargetInstrInfo &TII = *Fn.getTarget().getInstrInfo();
-
- // Now that we have a stack slot for each register to be saved, insert spill
- // code into the entry block.
- MachineBasicBlock *MBB = Fn.begin();
- MachineBasicBlock::iterator I = MBB->begin();
-
- if (!TII.spillCalleeSavedRegisters(*MBB, I, CSI)) {
- for (unsigned i = 0, e = CSI.size(); i != e; ++i) {
- // Add the callee-saved register as live-in. It's killed at the spill.
- MBB->addLiveIn(CSI[i].getReg());
-
- // Insert the spill to the stack frame.
- TII.storeRegToStackSlot(*MBB, I, CSI[i].getReg(), true,
- CSI[i].getFrameIdx(), CSI[i].getRegClass());
- }
- }
-
- // Add code to restore the callee-save registers in each exiting block.
- for (MachineFunction::iterator FI = Fn.begin(), E = Fn.end(); FI != E; ++FI)
- // If last instruction is a return instruction, add an epilogue.
- if (!FI->empty() && FI->back().getDesc().isReturn()) {
- MBB = FI;
- I = MBB->end(); --I;
-
- // Skip over all terminator instructions, which are part of the return
- // sequence.
- MachineBasicBlock::iterator I2 = I;
- while (I2 != MBB->begin() && (--I2)->getDesc().isTerminator())
- I = I2;
-
- bool AtStart = I == MBB->begin();
- MachineBasicBlock::iterator BeforeI = I;
- if (!AtStart)
- --BeforeI;
-
- // Restore all registers immediately before the return and any terminators
- // that preceed it.
- if (!TII.restoreCalleeSavedRegisters(*MBB, I, CSI)) {
- for (unsigned i = 0, e = CSI.size(); i != e; ++i) {
- TII.loadRegFromStackSlot(*MBB, I, CSI[i].getReg(),
- CSI[i].getFrameIdx(),
- CSI[i].getRegClass());
- assert(I != MBB->begin() &&
- "loadRegFromStackSlot didn't insert any code!");
- // Insert in reverse order. loadRegFromStackSlot can insert multiple
- // instructions.
- if (AtStart)
- I = MBB->begin();
- else {
- I = BeforeI;
- ++I;
- }
- }
- }
- }
-}
-
-
-/// calculateFrameObjectOffsets - Calculate actual frame offsets for all of the
-/// abstract stack objects.
-///
-void PEI::calculateFrameObjectOffsets(MachineFunction &Fn) {
- const TargetFrameInfo &TFI = *Fn.getTarget().getFrameInfo();
-
- bool StackGrowsDown =
- TFI.getStackGrowthDirection() == TargetFrameInfo::StackGrowsDown;
-
- // Loop over all of the stack objects, assigning sequential addresses...
- MachineFrameInfo *FFI = Fn.getFrameInfo();
-
- unsigned MaxAlign = FFI->getMaxAlignment();
-
- // Start at the beginning of the local area.
- // The Offset is the distance from the stack top in the direction
- // of stack growth -- so it's always positive.
- int64_t Offset = TFI.getOffsetOfLocalArea();
- if (StackGrowsDown)
- Offset = -Offset;
- assert(Offset >= 0
- && "Local area offset should be in direction of stack growth");
-
- // If there are fixed sized objects that are preallocated in the local area,
- // non-fixed objects can't be allocated right at the start of local area.
- // We currently don't support filling in holes in between fixed sized objects,
- // so we adjust 'Offset' to point to the end of last fixed sized
- // preallocated object.
- for (int i = FFI->getObjectIndexBegin(); i != 0; ++i) {
- int64_t FixedOff;
- if (StackGrowsDown) {
- // The maximum distance from the stack pointer is at lower address of
- // the object -- which is given by offset. For down growing stack
- // the offset is negative, so we negate the offset to get the distance.
- FixedOff = -FFI->getObjectOffset(i);
- } else {
- // The maximum distance from the start pointer is at the upper
- // address of the object.
- FixedOff = FFI->getObjectOffset(i) + FFI->getObjectSize(i);
- }
- if (FixedOff > Offset) Offset = FixedOff;
- }
-
- // First assign frame offsets to stack objects that are used to spill
- // callee saved registers.
- if (StackGrowsDown) {
- for (unsigned i = MinCSFrameIndex; i <= MaxCSFrameIndex; ++i) {
- // If stack grows down, we need to add size of find the lowest
- // address of the object.
- Offset += FFI->getObjectSize(i);
-
- unsigned Align = FFI->getObjectAlignment(i);
- // If the alignment of this object is greater than that of the stack, then
- // increase the stack alignment to match.
- MaxAlign = std::max(MaxAlign, Align);
- // Adjust to alignment boundary
- Offset = (Offset+Align-1)/Align*Align;
-
- FFI->setObjectOffset(i, -Offset); // Set the computed offset
- }
- } else {
- for (unsigned i = MaxCSFrameIndex; i >= MinCSFrameIndex; --i) {
- unsigned Align = FFI->getObjectAlignment(i);
- // If the alignment of this object is greater than that of the stack, then
- // increase the stack alignment to match.
- MaxAlign = std::max(MaxAlign, Align);
- // Adjust to alignment boundary
- Offset = (Offset+Align-1)/Align*Align;
-
- FFI->setObjectOffset(i, Offset);
- Offset += FFI->getObjectSize(i);
- }
- }
-
- // Make sure the special register scavenging spill slot is closest to the
- // frame pointer if a frame pointer is required.
- const TargetRegisterInfo *RegInfo = Fn.getTarget().getRegisterInfo();
- if (RS && RegInfo->hasFP(Fn)) {
- int SFI = RS->getScavengingFrameIndex();
- if (SFI >= 0) {
- // If stack grows down, we need to add size of the lowest
- // address of the object.
- if (StackGrowsDown)
- Offset += FFI->getObjectSize(SFI);
-
- unsigned Align = FFI->getObjectAlignment(SFI);
- // Adjust to alignment boundary
- Offset = (Offset+Align-1)/Align*Align;
-
- if (StackGrowsDown) {
- FFI->setObjectOffset(SFI, -Offset); // Set the computed offset
- } else {
- FFI->setObjectOffset(SFI, Offset);
- Offset += FFI->getObjectSize(SFI);
- }
- }
- }
-
- // Then assign frame offsets to stack objects that are not used to spill
- // callee saved registers.
- for (unsigned i = 0, e = FFI->getObjectIndexEnd(); i != e; ++i) {
- if (i >= MinCSFrameIndex && i <= MaxCSFrameIndex)
- continue;
- if (RS && (int)i == RS->getScavengingFrameIndex())
- continue;
- if (FFI->isDeadObjectIndex(i))
- continue;
-
- // If stack grows down, we need to add size of find the lowest
- // address of the object.
- if (StackGrowsDown)
- Offset += FFI->getObjectSize(i);
-
- unsigned Align = FFI->getObjectAlignment(i);
- // If the alignment of this object is greater than that of the stack, then
- // increase the stack alignment to match.
- MaxAlign = std::max(MaxAlign, Align);
- // Adjust to alignment boundary
- Offset = (Offset+Align-1)/Align*Align;
-
- if (StackGrowsDown) {
- FFI->setObjectOffset(i, -Offset); // Set the computed offset
- } else {
- FFI->setObjectOffset(i, Offset);
- Offset += FFI->getObjectSize(i);
- }
- }
-
- // Make sure the special register scavenging spill slot is closest to the
- // stack pointer.
- if (RS && !RegInfo->hasFP(Fn)) {
- int SFI = RS->getScavengingFrameIndex();
- if (SFI >= 0) {
- // If stack grows down, we need to add size of find the lowest
- // address of the object.
- if (StackGrowsDown)
- Offset += FFI->getObjectSize(SFI);
-
- unsigned Align = FFI->getObjectAlignment(SFI);
- // If the alignment of this object is greater than that of the
- // stack, then increase the stack alignment to match.
- MaxAlign = std::max(MaxAlign, Align);
- // Adjust to alignment boundary
- Offset = (Offset+Align-1)/Align*Align;
-
- if (StackGrowsDown) {
- FFI->setObjectOffset(SFI, -Offset); // Set the computed offset
- } else {
- FFI->setObjectOffset(SFI, Offset);
- Offset += FFI->getObjectSize(SFI);
- }
- }
- }
-
- // Round up the size to a multiple of the alignment, but only if there are
- // calls or alloca's in the function. This ensures that any calls to
- // subroutines have their stack frames suitable aligned.
- if (!RegInfo->targetHandlesStackFrameRounding() &&
- (FFI->hasCalls() || FFI->hasVarSizedObjects())) {
- // If we have reserved argument space for call sites in the function
- // immediately on entry to the current function, count it as part of the
- // overall stack size.
- if (RegInfo->hasReservedCallFrame(Fn))
- Offset += FFI->getMaxCallFrameSize();
-
- unsigned AlignMask = TFI.getStackAlignment() - 1;
- Offset = (Offset + AlignMask) & ~uint64_t(AlignMask);
- }
-
- // Update frame info to pretend that this is part of the stack...
- FFI->setStackSize(Offset+TFI.getOffsetOfLocalArea());
-
- // Remember the required stack alignment in case targets need it to perform
- // dynamic stack alignment.
- FFI->setMaxAlignment(MaxAlign);
-}
-
-
-/// insertPrologEpilogCode - Scan the function for modified callee saved
-/// registers, insert spill code for these callee saved registers, then add
-/// prolog and epilog code to the function.
-///
-void PEI::insertPrologEpilogCode(MachineFunction &Fn) {
- const TargetRegisterInfo *TRI = Fn.getTarget().getRegisterInfo();
-
- // Add prologue to the function...
- TRI->emitPrologue(Fn);
-
- // Add epilogue to restore the callee-save registers in each exiting block
- for (MachineFunction::iterator I = Fn.begin(), E = Fn.end(); I != E; ++I) {
- // If last instruction is a return instruction, add an epilogue
- if (!I->empty() && I->back().getDesc().isReturn())
- TRI->emitEpilogue(Fn, *I);
- }
-}
-
-
-/// replaceFrameIndices - Replace all MO_FrameIndex operands with physical
-/// register references and actual offsets.
-///
-void PEI::replaceFrameIndices(MachineFunction &Fn) {
- if (!Fn.getFrameInfo()->hasStackObjects()) return; // Nothing to do?
-
- const TargetMachine &TM = Fn.getTarget();
- assert(TM.getRegisterInfo() && "TM::getRegisterInfo() must be implemented!");
- const TargetRegisterInfo &TRI = *TM.getRegisterInfo();
- const TargetFrameInfo *TFI = TM.getFrameInfo();
- bool StackGrowsDown =
- TFI->getStackGrowthDirection() == TargetFrameInfo::StackGrowsDown;
- int FrameSetupOpcode = TRI.getCallFrameSetupOpcode();
- int FrameDestroyOpcode = TRI.getCallFrameDestroyOpcode();
-
- for (MachineFunction::iterator BB = Fn.begin(), E = Fn.end(); BB != E; ++BB) {
- int SPAdj = 0; // SP offset due to call frame setup / destroy.
- if (RS) RS->enterBasicBlock(BB);
- for (MachineBasicBlock::iterator I = BB->begin(); I != BB->end(); ) {
- MachineInstr *MI = I;
-
- if (I->getOpcode() == TargetInstrInfo::DECLARE) {
- // Ignore it.
- ++I;
- continue;
- }
-
- if (I->getOpcode() == FrameSetupOpcode ||
- I->getOpcode() == FrameDestroyOpcode) {
- // Remember how much SP has been adjusted to create the call
- // frame.
- int Size = I->getOperand(0).getImm();
-
- if ((!StackGrowsDown && I->getOpcode() == FrameSetupOpcode) ||
- (StackGrowsDown && I->getOpcode() == FrameDestroyOpcode))
- Size = -Size;
-
- SPAdj += Size;
-
- MachineBasicBlock::iterator PrevI = prior(I);
- TRI.eliminateCallFramePseudoInstr(Fn, *BB, I);
-
- // Visit the instructions created by eliminateCallFramePseudoInstr().
- I = next(PrevI);
- continue;
- }
-
- bool DoIncr = true;
-
- for (unsigned i = 0, e = MI->getNumOperands(); i != e; ++i)
- if (MI->getOperand(i).isFrameIndex()) {
- // Some instructions (e.g. inline asm instructions) can have
- // multiple frame indices and/or cause eliminateFrameIndex
- // to insert more than one instruction. We need the register
- // scavenger to go through all of these instructions so that
- // it can update its register information. We keep the
- // iterator at the point before insertion so that we can
- // revisit them in full.
- bool AtBeginning = (I == BB->begin());
- if (!AtBeginning) --I;
-
- // If this instruction has a FrameIndex operand, we need to
- // use that target machine register info object to eliminate
- // it.
- TRI.eliminateFrameIndex(MI, SPAdj, RS);
-
- // Reset the iterator if we were at the beginning of the BB.
- if (AtBeginning) {
- I = BB->begin();
- DoIncr = false;
- }
-
- MI = 0;
- break;
- }
-
- if (DoIncr) ++I;
-
- // Update register states.
- if (RS && MI) RS->forward(MI);
- }
-
- assert(SPAdj == 0 && "Unbalanced call frame setup / destroy pairs?");
- }
-}
diff --git a/release_23/lib/CodeGen/PseudoSourceValue.cpp b/release_23/lib/CodeGen/PseudoSourceValue.cpp
deleted file mode 100644
index c62e49a4b082..000000000000
--- a/release_23/lib/CodeGen/PseudoSourceValue.cpp
+++ /dev/null
@@ -1,46 +0,0 @@
-//===-- llvm/CodeGen/PseudoSourceValue.cpp ----------------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the PseudoSourceValue class.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/CodeGen/PseudoSourceValue.h"
-#include "llvm/DerivedTypes.h"
-#include "llvm/Support/ManagedStatic.h"
-
-namespace llvm {
- static ManagedStatic<PseudoSourceValue[5]> PSVs;
-
- const PseudoSourceValue *PseudoSourceValue::getFixedStack()
- { return &(*PSVs)[0]; }
- const PseudoSourceValue *PseudoSourceValue::getStack()
- { return &(*PSVs)[1]; }
- const PseudoSourceValue *PseudoSourceValue::getGOT()
- { return &(*PSVs)[2]; }
- const PseudoSourceValue *PseudoSourceValue::getConstantPool()
- { return &(*PSVs)[3]; }
- const PseudoSourceValue *PseudoSourceValue::getJumpTable()
- { return &(*PSVs)[4]; }
-
- static const char *const PSVNames[] = {
- "FixedStack",
- "Stack",
- "GOT",
- "ConstantPool",
- "JumpTable"
- };
-
- PseudoSourceValue::PseudoSourceValue() :
- Value(PointerType::getUnqual(Type::Int8Ty), PseudoSourceValueVal) {}
-
- void PseudoSourceValue::print(std::ostream &OS) const {
- OS << PSVNames[this - *PSVs];
- }
-}
diff --git a/release_23/lib/CodeGen/README.txt b/release_23/lib/CodeGen/README.txt
deleted file mode 100644
index a66fc9dcdccd..000000000000
--- a/release_23/lib/CodeGen/README.txt
+++ /dev/null
@@ -1,199 +0,0 @@
-//===---------------------------------------------------------------------===//
-
-Common register allocation / spilling problem:
-
- mul lr, r4, lr
- str lr, [sp, #+52]
- ldr lr, [r1, #+32]
- sxth r3, r3
- ldr r4, [sp, #+52]
- mla r4, r3, lr, r4
-
-can be:
-
- mul lr, r4, lr
- mov r4, lr
- str lr, [sp, #+52]
- ldr lr, [r1, #+32]
- sxth r3, r3
- mla r4, r3, lr, r4
-
-and then "merge" mul and mov:
-
- mul r4, r4, lr
- str lr, [sp, #+52]
- ldr lr, [r1, #+32]
- sxth r3, r3
- mla r4, r3, lr, r4
-
-It also increase the likelyhood the store may become dead.
-
-//===---------------------------------------------------------------------===//
-
-I think we should have a "hasSideEffects" flag (which is automatically set for
-stuff that "isLoad" "isCall" etc), and the remat pass should eventually be able
-to remat any instruction that has no side effects, if it can handle it and if
-profitable.
-
-For now, I'd suggest having the remat stuff work like this:
-
-1. I need to spill/reload this thing.
-2. Check to see if it has side effects.
-3. Check to see if it is simple enough: e.g. it only has one register
-destination and no register input.
-4. If so, clone the instruction, do the xform, etc.
-
-Advantages of this are:
-
-1. the .td file describes the behavior of the instructions, not the way the
- algorithm should work.
-2. as remat gets smarter in the future, we shouldn't have to be changing the .td
- files.
-3. it is easier to explain what the flag means in the .td file, because you
- don't have to pull in the explanation of how the current remat algo works.
-
-Some potential added complexities:
-
-1. Some instructions have to be glued to it's predecessor or successor. All of
- the PC relative instructions and condition code setting instruction. We could
- mark them as hasSideEffects, but that's not quite right. PC relative loads
- from constantpools can be remat'ed, for example. But it requires more than
- just cloning the instruction. Some instructions can be remat'ed but it
- expands to more than one instruction. But allocator will have to make a
- decision.
-
-4. As stated in 3, not as simple as cloning in some cases. The target will have
- to decide how to remat it. For example, an ARM 2-piece constant generation
- instruction is remat'ed as a load from constantpool.
-
-//===---------------------------------------------------------------------===//
-
-bb27 ...
- ...
- %reg1037 = ADDri %reg1039, 1
- %reg1038 = ADDrs %reg1032, %reg1039, %NOREG, 10
- Successors according to CFG: 0x8b03bf0 (#5)
-
-bb76 (0x8b03bf0, LLVM BB @0x8b032d0, ID#5):
- Predecessors according to CFG: 0x8b0c5f0 (#3) 0x8b0a7c0 (#4)
- %reg1039 = PHI %reg1070, mbb<bb76.outer,0x8b0c5f0>, %reg1037, mbb<bb27,0x8b0a7c0>
-
-Note ADDri is not a two-address instruction. However, its result %reg1037 is an
-operand of the PHI node in bb76 and its operand %reg1039 is the result of the
-PHI node. We should treat it as a two-address code and make sure the ADDri is
-scheduled after any node that reads %reg1039.
-
-//===---------------------------------------------------------------------===//
-
-Use local info (i.e. register scavenger) to assign it a free register to allow
-reuse:
- ldr r3, [sp, #+4]
- add r3, r3, #3
- ldr r2, [sp, #+8]
- add r2, r2, #2
- ldr r1, [sp, #+4] <==
- add r1, r1, #1
- ldr r0, [sp, #+4]
- add r0, r0, #2
-
-//===---------------------------------------------------------------------===//
-
-LLVM aggressively lift CSE out of loop. Sometimes this can be negative side-
-effects:
-
-R1 = X + 4
-R2 = X + 7
-R3 = X + 15
-
-loop:
-load [i + R1]
-...
-load [i + R2]
-...
-load [i + R3]
-
-Suppose there is high register pressure, R1, R2, R3, can be spilled. We need
-to implement proper re-materialization to handle this:
-
-R1 = X + 4
-R2 = X + 7
-R3 = X + 15
-
-loop:
-R1 = X + 4 @ re-materialized
-load [i + R1]
-...
-R2 = X + 7 @ re-materialized
-load [i + R2]
-...
-R3 = X + 15 @ re-materialized
-load [i + R3]
-
-Furthermore, with re-association, we can enable sharing:
-
-R1 = X + 4
-R2 = X + 7
-R3 = X + 15
-
-loop:
-T = i + X
-load [T + 4]
-...
-load [T + 7]
-...
-load [T + 15]
-//===---------------------------------------------------------------------===//
-
-It's not always a good idea to choose rematerialization over spilling. If all
-the load / store instructions would be folded then spilling is cheaper because
-it won't require new live intervals / registers. See 2003-05-31-LongShifts for
-an example.
-
-//===---------------------------------------------------------------------===//
-
-With a copying garbage collector, derived pointers must not be retained across
-collector safe points; the collector could move the objects and invalidate the
-derived pointer. This is bad enough in the first place, but safe points can
-crop up unpredictably. Consider:
-
- %array = load { i32, [0 x %obj] }** %array_addr
- %nth_el = getelementptr { i32, [0 x %obj] }* %array, i32 0, i32 %n
- %old = load %obj** %nth_el
- %z = div i64 %x, %y
- store %obj* %new, %obj** %nth_el
-
-If the i64 division is lowered to a libcall, then a safe point will (must)
-appear for the call site. If a collection occurs, %array and %nth_el no longer
-point into the correct object.
-
-The fix for this is to copy address calculations so that dependent pointers
-are never live across safe point boundaries. But the loads cannot be copied
-like this if there was an intervening store, so may be hard to get right.
-
-Only a concurrent mutator can trigger a collection at the libcall safe point.
-So single-threaded programs do not have this requirement, even with a copying
-collector. Still, LLVM optimizations would probably undo a front-end's careful
-work.
-
-//===---------------------------------------------------------------------===//
-
-The ocaml frametable structure supports liveness information. It would be good
-to support it.
-
-//===---------------------------------------------------------------------===//
-
-The FIXME in ComputeCommonTailLength in BranchFolding.cpp needs to be
-revisited. The check is there to work around a misuse of directives in inline
-assembly.
-
-//===---------------------------------------------------------------------===//
-
-It would be good to detect collector/target compatibility instead of silently
-doing the wrong thing.
-
-//===---------------------------------------------------------------------===//
-
-It would be really nice to be able to write patterns in .td files for copies,
-which would eliminate a bunch of explicit predicates on them (e.g. no side
-effects). Once this is in place, it would be even better to have tblgen
-synthesize the various copy insertion/inspection methods in TargetInstrInfo.
diff --git a/release_23/lib/CodeGen/RegAllocBigBlock.cpp b/release_23/lib/CodeGen/RegAllocBigBlock.cpp
deleted file mode 100644
index 0c6c25439a77..000000000000
--- a/release_23/lib/CodeGen/RegAllocBigBlock.cpp
+++ /dev/null
@@ -1,891 +0,0 @@
-//===- RegAllocBigBlock.cpp - A register allocator for large basic blocks -===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the RABigBlock class
-//
-//===----------------------------------------------------------------------===//
-
-// This register allocator is derived from RegAllocLocal.cpp. Like it, this
-// allocator works on one basic block at a time, oblivious to others.
-// However, the algorithm used here is suited for long blocks of
-// instructions - registers are spilled by greedily choosing those holding
-// values that will not be needed for the longest amount of time. This works
-// particularly well for blocks with 10 or more times as many instructions
-// as machine registers, but can be used for general code.
-//
-//===----------------------------------------------------------------------===//
-//
-// TODO: - automagically invoke linearscan for (groups of) small BBs?
-// - break ties when picking regs? (probably not worth it in a
-// JIT context)
-//
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "regalloc"
-#include "llvm/BasicBlock.h"
-#include "llvm/CodeGen/Passes.h"
-#include "llvm/CodeGen/MachineFunctionPass.h"
-#include "llvm/CodeGen/MachineInstr.h"
-#include "llvm/CodeGen/MachineFrameInfo.h"
-#include "llvm/CodeGen/MachineRegisterInfo.h"
-#include "llvm/CodeGen/LiveVariables.h"
-#include "llvm/CodeGen/RegAllocRegistry.h"
-#include "llvm/Target/TargetInstrInfo.h"
-#include "llvm/Target/TargetMachine.h"
-#include "llvm/Support/CommandLine.h"
-#include "llvm/Support/Debug.h"
-#include "llvm/Support/Compiler.h"
-#include "llvm/ADT/IndexedMap.h"
-#include "llvm/ADT/DenseMap.h"
-#include "llvm/ADT/SmallVector.h"
-#include "llvm/ADT/Statistic.h"
-#include <algorithm>
-using namespace llvm;
-
-STATISTIC(NumStores, "Number of stores added");
-STATISTIC(NumLoads , "Number of loads added");
-STATISTIC(NumFolded, "Number of loads/stores folded into instructions");
-
-namespace {
- static RegisterRegAlloc
- bigBlockRegAlloc("bigblock", " Big-block register allocator",
- createBigBlockRegisterAllocator);
-
-/// VRegKeyInfo - Defines magic values required to use VirtRegs as DenseMap
-/// keys.
- struct VRegKeyInfo {
- static inline unsigned getEmptyKey() { return -1U; }
- static inline unsigned getTombstoneKey() { return -2U; }
- static bool isEqual(unsigned LHS, unsigned RHS) { return LHS == RHS; }
- static unsigned getHashValue(const unsigned &Key) { return Key; }
- };
-
-
-/// This register allocator is derived from RegAllocLocal.cpp. Like it, this
-/// allocator works on one basic block at a time, oblivious to others.
-/// However, the algorithm used here is suited for long blocks of
-/// instructions - registers are spilled by greedily choosing those holding
-/// values that will not be needed for the longest amount of time. This works
-/// particularly well for blocks with 10 or more times as many instructions
-/// as machine registers, but can be used for general code.
-///
-/// TODO: - automagically invoke linearscan for (groups of) small BBs?
-/// - break ties when picking regs? (probably not worth it in a
-/// JIT context)
-///
- class VISIBILITY_HIDDEN RABigBlock : public MachineFunctionPass {
- public:
- static char ID;
- RABigBlock() : MachineFunctionPass((intptr_t)&ID) {}
- private:
- /// TM - For getting at TargetMachine info
- ///
- const TargetMachine *TM;
-
- /// MF - Our generic MachineFunction pointer
- ///
- MachineFunction *MF;
-
- /// RegInfo - For dealing with machine register info (aliases, folds
- /// etc)
- const TargetRegisterInfo *RegInfo;
-
- typedef SmallVector<unsigned, 2> VRegTimes;
-
- /// VRegReadTable - maps VRegs in a BB to the set of times they are read
- ///
- DenseMap<unsigned, VRegTimes*, VRegKeyInfo> VRegReadTable;
-
- /// VRegReadIdx - keeps track of the "current time" in terms of
- /// positions in VRegReadTable
- DenseMap<unsigned, unsigned , VRegKeyInfo> VRegReadIdx;
-
- /// StackSlotForVirtReg - Maps virtual regs to the frame index where these
- /// values are spilled.
- IndexedMap<unsigned, VirtReg2IndexFunctor> StackSlotForVirtReg;
-
- /// Virt2PhysRegMap - This map contains entries for each virtual register
- /// that is currently available in a physical register.
- IndexedMap<unsigned, VirtReg2IndexFunctor> Virt2PhysRegMap;
-
- /// PhysRegsUsed - This array is effectively a map, containing entries for
- /// each physical register that currently has a value (ie, it is in
- /// Virt2PhysRegMap). The value mapped to is the virtual register
- /// corresponding to the physical register (the inverse of the
- /// Virt2PhysRegMap), or 0. The value is set to 0 if this register is pinned
- /// because it is used by a future instruction, and to -2 if it is not
- /// allocatable. If the entry for a physical register is -1, then the
- /// physical register is "not in the map".
- ///
- std::vector<int> PhysRegsUsed;
-
- /// VirtRegModified - This bitset contains information about which virtual
- /// registers need to be spilled back to memory when their registers are
- /// scavenged. If a virtual register has simply been rematerialized, there
- /// is no reason to spill it to memory when we need the register back.
- ///
- std::vector<int> VirtRegModified;
-
- /// MBBLastInsnTime - the number of the the last instruction in MBB
- ///
- int MBBLastInsnTime;
-
- /// MBBCurTime - the number of the the instruction being currently processed
- ///
- int MBBCurTime;
-
- unsigned &getVirt2PhysRegMapSlot(unsigned VirtReg) {
- return Virt2PhysRegMap[VirtReg];
- }
-
- unsigned &getVirt2StackSlot(unsigned VirtReg) {
- return StackSlotForVirtReg[VirtReg];
- }
-
- /// markVirtRegModified - Lets us flip bits in the VirtRegModified bitset
- ///
- void markVirtRegModified(unsigned Reg, bool Val = true) {
- assert(TargetRegisterInfo::isVirtualRegister(Reg) && "Illegal VirtReg!");
- Reg -= TargetRegisterInfo::FirstVirtualRegister;
- if (VirtRegModified.size() <= Reg)
- VirtRegModified.resize(Reg+1);
- VirtRegModified[Reg] = Val;
- }
-
- /// isVirtRegModified - Lets us query the VirtRegModified bitset
- ///
- bool isVirtRegModified(unsigned Reg) const {
- assert(TargetRegisterInfo::isVirtualRegister(Reg) && "Illegal VirtReg!");
- assert(Reg - TargetRegisterInfo::FirstVirtualRegister < VirtRegModified.size()
- && "Illegal virtual register!");
- return VirtRegModified[Reg - TargetRegisterInfo::FirstVirtualRegister];
- }
-
- public:
- /// getPassName - returns the BigBlock allocator's name
- ///
- virtual const char *getPassName() const {
- return "BigBlock Register Allocator";
- }
-
- /// getAnalaysisUsage - declares the required analyses
- ///
- virtual void getAnalysisUsage(AnalysisUsage &AU) const {
- AU.addRequiredID(PHIEliminationID);
- AU.addRequiredID(TwoAddressInstructionPassID);
- MachineFunctionPass::getAnalysisUsage(AU);
- }
-
- private:
- /// runOnMachineFunction - Register allocate the whole function
- ///
- bool runOnMachineFunction(MachineFunction &Fn);
-
- /// AllocateBasicBlock - Register allocate the specified basic block.
- ///
- void AllocateBasicBlock(MachineBasicBlock &MBB);
-
- /// FillVRegReadTable - Fill out the table of vreg read times given a BB
- ///
- void FillVRegReadTable(MachineBasicBlock &MBB);
-
- /// areRegsEqual - This method returns true if the specified registers are
- /// related to each other. To do this, it checks to see if they are equal
- /// or if the first register is in the alias set of the second register.
- ///
- bool areRegsEqual(unsigned R1, unsigned R2) const {
- if (R1 == R2) return true;
- for (const unsigned *AliasSet = RegInfo->getAliasSet(R2);
- *AliasSet; ++AliasSet) {
- if (*AliasSet == R1) return true;
- }
- return false;
- }
-
- /// getStackSpaceFor - This returns the frame index of the specified virtual
- /// register on the stack, allocating space if necessary.
- int getStackSpaceFor(unsigned VirtReg, const TargetRegisterClass *RC);
-
- /// removePhysReg - This method marks the specified physical register as no
- /// longer being in use.
- ///
- void removePhysReg(unsigned PhysReg);
-
- /// spillVirtReg - This method spills the value specified by PhysReg into
- /// the virtual register slot specified by VirtReg. It then updates the RA
- /// data structures to indicate the fact that PhysReg is now available.
- ///
- void spillVirtReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI,
- unsigned VirtReg, unsigned PhysReg);
-
- /// spillPhysReg - This method spills the specified physical register into
- /// the virtual register slot associated with it. If OnlyVirtRegs is set to
- /// true, then the request is ignored if the physical register does not
- /// contain a virtual register.
- ///
- void spillPhysReg(MachineBasicBlock &MBB, MachineInstr *I,
- unsigned PhysReg, bool OnlyVirtRegs = false);
-
- /// assignVirtToPhysReg - This method updates local state so that we know
- /// that PhysReg is the proper container for VirtReg now. The physical
- /// register must not be used for anything else when this is called.
- ///
- void assignVirtToPhysReg(unsigned VirtReg, unsigned PhysReg);
-
- /// isPhysRegAvailable - Return true if the specified physical register is
- /// free and available for use. This also includes checking to see if
- /// aliased registers are all free...
- ///
- bool isPhysRegAvailable(unsigned PhysReg) const;
-
- /// getFreeReg - Look to see if there is a free register available in the
- /// specified register class. If not, return 0.
- ///
- unsigned getFreeReg(const TargetRegisterClass *RC);
-
- /// chooseReg - Pick a physical register to hold the specified
- /// virtual register by choosing the one which will be read furthest
- /// in the future.
- ///
- unsigned chooseReg(MachineBasicBlock &MBB, MachineInstr *MI,
- unsigned VirtReg);
-
- /// reloadVirtReg - This method transforms the specified specified virtual
- /// register use to refer to a physical register. This method may do this
- /// in one of several ways: if the register is available in a physical
- /// register already, it uses that physical register. If the value is not
- /// in a physical register, and if there are physical registers available,
- /// it loads it into a register. If register pressure is high, and it is
- /// possible, it tries to fold the load of the virtual register into the
- /// instruction itself. It avoids doing this if register pressure is low to
- /// improve the chance that subsequent instructions can use the reloaded
- /// value. This method returns the modified instruction.
- ///
- MachineInstr *reloadVirtReg(MachineBasicBlock &MBB, MachineInstr *MI,
- unsigned OpNum);
-
- };
- char RABigBlock::ID = 0;
-}
-
-/// getStackSpaceFor - This allocates space for the specified virtual register
-/// to be held on the stack.
-int RABigBlock::getStackSpaceFor(unsigned VirtReg, const TargetRegisterClass *RC) {
- // Find the location Reg would belong...
- int FrameIdx = getVirt2StackSlot(VirtReg);
-
- if (FrameIdx)
- return FrameIdx - 1; // Already has space allocated?
-
- // Allocate a new stack object for this spill location...
- FrameIdx = MF->getFrameInfo()->CreateStackObject(RC->getSize(),
- RC->getAlignment());
-
- // Assign the slot...
- getVirt2StackSlot(VirtReg) = FrameIdx + 1;
- return FrameIdx;
-}
-
-
-/// removePhysReg - This method marks the specified physical register as no
-/// longer being in use.
-///
-void RABigBlock::removePhysReg(unsigned PhysReg) {
- PhysRegsUsed[PhysReg] = -1; // PhyReg no longer used
-}
-
-
-/// spillVirtReg - This method spills the value specified by PhysReg into the
-/// virtual register slot specified by VirtReg. It then updates the RA data
-/// structures to indicate the fact that PhysReg is now available.
-///
-void RABigBlock::spillVirtReg(MachineBasicBlock &MBB,
- MachineBasicBlock::iterator I,
- unsigned VirtReg, unsigned PhysReg) {
- assert(VirtReg && "Spilling a physical register is illegal!"
- " Must not have appropriate kill for the register or use exists beyond"
- " the intended one.");
- DOUT << " Spilling register " << RegInfo->getName(PhysReg)
- << " containing %reg" << VirtReg;
-
- const TargetInstrInfo* TII = MBB.getParent()->getTarget().getInstrInfo();
-
- if (!isVirtRegModified(VirtReg))
- DOUT << " which has not been modified, so no store necessary!";
-
- // Otherwise, there is a virtual register corresponding to this physical
- // register. We only need to spill it into its stack slot if it has been
- // modified.
- if (isVirtRegModified(VirtReg)) {
- const TargetRegisterClass *RC = MF->getRegInfo().getRegClass(VirtReg);
- int FrameIndex = getStackSpaceFor(VirtReg, RC);
- DOUT << " to stack slot #" << FrameIndex;
- TII->storeRegToStackSlot(MBB, I, PhysReg, true, FrameIndex, RC);
- ++NumStores; // Update statistics
- }
-
- getVirt2PhysRegMapSlot(VirtReg) = 0; // VirtReg no longer available
-
- DOUT << "\n";
- removePhysReg(PhysReg);
-}
-
-
-/// spillPhysReg - This method spills the specified physical register into the
-/// virtual register slot associated with it. If OnlyVirtRegs is set to true,
-/// then the request is ignored if the physical register does not contain a
-/// virtual register.
-///
-void RABigBlock::spillPhysReg(MachineBasicBlock &MBB, MachineInstr *I,
- unsigned PhysReg, bool OnlyVirtRegs) {
- if (PhysRegsUsed[PhysReg] != -1) { // Only spill it if it's used!
- assert(PhysRegsUsed[PhysReg] != -2 && "Non allocable reg used!");
- if (PhysRegsUsed[PhysReg] || !OnlyVirtRegs)
- spillVirtReg(MBB, I, PhysRegsUsed[PhysReg], PhysReg);
- } else {
- // If the selected register aliases any other registers, we must make
- // sure that one of the aliases isn't alive.
- for (const unsigned *AliasSet = RegInfo->getAliasSet(PhysReg);
- *AliasSet; ++AliasSet)
- if (PhysRegsUsed[*AliasSet] != -1 && // Spill aliased register.
- PhysRegsUsed[*AliasSet] != -2) // If allocatable.
- if (PhysRegsUsed[*AliasSet])
- spillVirtReg(MBB, I, PhysRegsUsed[*AliasSet], *AliasSet);
- }
-}
-
-
-/// assignVirtToPhysReg - This method updates local state so that we know
-/// that PhysReg is the proper container for VirtReg now. The physical
-/// register must not be used for anything else when this is called.
-///
-void RABigBlock::assignVirtToPhysReg(unsigned VirtReg, unsigned PhysReg) {
- assert(PhysRegsUsed[PhysReg] == -1 && "Phys reg already assigned!");
- // Update information to note the fact that this register was just used, and
- // it holds VirtReg.
- PhysRegsUsed[PhysReg] = VirtReg;
- getVirt2PhysRegMapSlot(VirtReg) = PhysReg;
-}
-
-
-/// isPhysRegAvailable - Return true if the specified physical register is free
-/// and available for use. This also includes checking to see if aliased
-/// registers are all free...
-///
-bool RABigBlock::isPhysRegAvailable(unsigned PhysReg) const {
- if (PhysRegsUsed[PhysReg] != -1) return false;
-
- // If the selected register aliases any other allocated registers, it is
- // not free!
- for (const unsigned *AliasSet = RegInfo->getAliasSet(PhysReg);
- *AliasSet; ++AliasSet)
- if (PhysRegsUsed[*AliasSet] >= 0) // Aliased register in use?
- return false; // Can't use this reg then.
- return true;
-}
-
-
-/// getFreeReg - Look to see if there is a free register available in the
-/// specified register class. If not, return 0.
-///
-unsigned RABigBlock::getFreeReg(const TargetRegisterClass *RC) {
- // Get iterators defining the range of registers that are valid to allocate in
- // this class, which also specifies the preferred allocation order.
- TargetRegisterClass::iterator RI = RC->allocation_order_begin(*MF);
- TargetRegisterClass::iterator RE = RC->allocation_order_end(*MF);
-
- for (; RI != RE; ++RI)
- if (isPhysRegAvailable(*RI)) { // Is reg unused?
- assert(*RI != 0 && "Cannot use register!");
- return *RI; // Found an unused register!
- }
- return 0;
-}
-
-
-/// chooseReg - Pick a physical register to hold the specified
-/// virtual register by choosing the one whose value will be read
-/// furthest in the future.
-///
-unsigned RABigBlock::chooseReg(MachineBasicBlock &MBB, MachineInstr *I,
- unsigned VirtReg) {
- const TargetRegisterClass *RC = MF->getRegInfo().getRegClass(VirtReg);
- // First check to see if we have a free register of the requested type...
- unsigned PhysReg = getFreeReg(RC);
-
- // If we didn't find an unused register, find the one which will be
- // read at the most distant point in time.
- if (PhysReg == 0) {
- unsigned delay=0, longest_delay=0;
- VRegTimes* ReadTimes;
-
- unsigned curTime = MBBCurTime;
-
- // for all physical regs in the RC,
- for(TargetRegisterClass::iterator pReg = RC->begin();
- pReg != RC->end(); ++pReg) {
- // how long until they're read?
- if(PhysRegsUsed[*pReg]>0) { // ignore non-allocatable regs
- ReadTimes = VRegReadTable[PhysRegsUsed[*pReg]];
- if(ReadTimes && !ReadTimes->empty()) {
- unsigned& pt = VRegReadIdx[PhysRegsUsed[*pReg]];
- while(pt < ReadTimes->size() && (*ReadTimes)[pt] < curTime) {
- ++pt;
- }
-
- if(pt < ReadTimes->size())
- delay = (*ReadTimes)[pt] - curTime;
- else
- delay = MBBLastInsnTime + 1 - curTime;
- } else {
- // This register is only defined, but never
- // read in this MBB. Therefore the next read
- // happens after the end of this MBB
- delay = MBBLastInsnTime + 1 - curTime;
- }
-
-
- if(delay > longest_delay) {
- longest_delay = delay;
- PhysReg = *pReg;
- }
- }
- }
-
- if(PhysReg == 0) { // ok, now we're desperate. We couldn't choose
- // a register to spill by looking through the
- // read timetable, so now we just spill the
- // first allocatable register we find.
-
- // for all physical regs in the RC,
- for(TargetRegisterClass::iterator pReg = RC->begin();
- pReg != RC->end(); ++pReg) {
- // if we find a register we can spill
- if(PhysRegsUsed[*pReg]>=-1)
- PhysReg = *pReg; // choose it to be spilled
- }
- }
-
- assert(PhysReg && "couldn't choose a register to spill :( ");
- // TODO: assert that RC->contains(PhysReg) / handle aliased registers?
-
- // since we needed to look in the table we need to spill this register.
- spillPhysReg(MBB, I, PhysReg);
- }
-
- // assign the vreg to our chosen physical register
- assignVirtToPhysReg(VirtReg, PhysReg);
- return PhysReg; // and return it
-}
-
-
-/// reloadVirtReg - This method transforms an instruction with a virtual
-/// register use to one that references a physical register. It does this as
-/// follows:
-///
-/// 1) If the register is already in a physical register, it uses it.
-/// 2) Otherwise, if there is a free physical register, it uses that.
-/// 3) Otherwise, it calls chooseReg() to get the physical register
-/// holding the most distantly needed value, generating a spill in
-/// the process.
-///
-/// This method returns the modified instruction.
-MachineInstr *RABigBlock::reloadVirtReg(MachineBasicBlock &MBB, MachineInstr *MI,
- unsigned OpNum) {
- unsigned VirtReg = MI->getOperand(OpNum).getReg();
- const TargetInstrInfo* TII = MBB.getParent()->getTarget().getInstrInfo();
-
- // If the virtual register is already available in a physical register,
- // just update the instruction and return.
- if (unsigned PR = getVirt2PhysRegMapSlot(VirtReg)) {
- MI->getOperand(OpNum).setReg(PR);
- return MI;
- }
-
- // Otherwise, if we have free physical registers available to hold the
- // value, use them.
- const TargetRegisterClass *RC = MF->getRegInfo().getRegClass(VirtReg);
- unsigned PhysReg = getFreeReg(RC);
- int FrameIndex = getStackSpaceFor(VirtReg, RC);
-
- if (PhysReg) { // we have a free register, so use it.
- assignVirtToPhysReg(VirtReg, PhysReg);
- } else { // no free registers available.
- // try to fold the spill into the instruction
- SmallVector<unsigned, 2> Ops;
- Ops.push_back(OpNum);
- if(MachineInstr* FMI = TII->foldMemoryOperand(*MF, MI, Ops, FrameIndex)) {
- ++NumFolded;
- FMI->copyKillDeadInfo(MI);
- return MBB.insert(MBB.erase(MI), FMI);
- }
-
- // determine which of the physical registers we'll kill off, since we
- // couldn't fold.
- PhysReg = chooseReg(MBB, MI, VirtReg);
- }
-
- // this virtual register is now unmodified (since we just reloaded it)
- markVirtRegModified(VirtReg, false);
-
- DOUT << " Reloading %reg" << VirtReg << " into "
- << RegInfo->getName(PhysReg) << "\n";
-
- // Add move instruction(s)
- TII->loadRegFromStackSlot(MBB, MI, PhysReg, FrameIndex, RC);
- ++NumLoads; // Update statistics
-
- MF->getRegInfo().setPhysRegUsed(PhysReg);
- MI->getOperand(OpNum).setReg(PhysReg); // Assign the input register
- return MI;
-}
-
-/// Fill out the vreg read timetable. Since ReadTime increases
-/// monotonically, the individual readtime sets will be sorted
-/// in ascending order.
-void RABigBlock::FillVRegReadTable(MachineBasicBlock &MBB) {
- // loop over each instruction
- MachineBasicBlock::iterator MII;
- unsigned ReadTime;
-
- for(ReadTime=0, MII = MBB.begin(); MII != MBB.end(); ++ReadTime, ++MII) {
- MachineInstr *MI = MII;
-
- for (unsigned i = 0; i != MI->getNumOperands(); ++i) {
- MachineOperand& MO = MI->getOperand(i);
- // look for vreg reads..
- if (MO.isRegister() && !MO.isDef() && MO.getReg() &&
- TargetRegisterInfo::isVirtualRegister(MO.getReg())) {
- // ..and add them to the read table.
- VRegTimes* &Times = VRegReadTable[MO.getReg()];
- if(!VRegReadTable[MO.getReg()]) {
- Times = new VRegTimes;
- VRegReadIdx[MO.getReg()] = 0;
- }
- Times->push_back(ReadTime);
- }
- }
-
- }
-
- MBBLastInsnTime = ReadTime;
-
- for(DenseMap<unsigned, VRegTimes*, VRegKeyInfo>::iterator Reads = VRegReadTable.begin();
- Reads != VRegReadTable.end(); ++Reads) {
- if(Reads->second) {
- DOUT << "Reads[" << Reads->first << "]=" << Reads->second->size() << "\n";
- }
- }
-}
-
-/// isReadModWriteImplicitKill - True if this is an implicit kill for a
-/// read/mod/write register, i.e. update partial register.
-static bool isReadModWriteImplicitKill(MachineInstr *MI, unsigned Reg) {
- for (unsigned i = 0, e = MI->getNumOperands(); i != e; ++i) {
- MachineOperand& MO = MI->getOperand(i);
- if (MO.isRegister() && MO.getReg() == Reg && MO.isImplicit() &&
- MO.isDef() && !MO.isDead())
- return true;
- }
- return false;
-}
-
-/// isReadModWriteImplicitDef - True if this is an implicit def for a
-/// read/mod/write register, i.e. update partial register.
-static bool isReadModWriteImplicitDef(MachineInstr *MI, unsigned Reg) {
- for (unsigned i = 0, e = MI->getNumOperands(); i != e; ++i) {
- MachineOperand& MO = MI->getOperand(i);
- if (MO.isRegister() && MO.getReg() == Reg && MO.isImplicit() &&
- !MO.isDef() && MO.isKill())
- return true;
- }
- return false;
-}
-
-
-void RABigBlock::AllocateBasicBlock(MachineBasicBlock &MBB) {
- // loop over each instruction
- MachineBasicBlock::iterator MII = MBB.begin();
- const TargetInstrInfo &TII = *TM->getInstrInfo();
-
- DEBUG(const BasicBlock *LBB = MBB.getBasicBlock();
- if (LBB) DOUT << "\nStarting RegAlloc of BB: " << LBB->getName());
-
- // If this is the first basic block in the machine function, add live-in
- // registers as active.
- if (&MBB == &*MF->begin()) {
- for (MachineRegisterInfo::livein_iterator
- I = MF->getRegInfo().livein_begin(),
- E = MF->getRegInfo().livein_end(); I != E; ++I) {
- unsigned Reg = I->first;
- MF->getRegInfo().setPhysRegUsed(Reg);
- PhysRegsUsed[Reg] = 0; // It is free and reserved now
- for (const unsigned *AliasSet = RegInfo->getSubRegisters(Reg);
- *AliasSet; ++AliasSet) {
- if (PhysRegsUsed[*AliasSet] != -2) {
- PhysRegsUsed[*AliasSet] = 0; // It is free and reserved now
- MF->getRegInfo().setPhysRegUsed(*AliasSet);
- }
- }
- }
- }
-
- // Otherwise, sequentially allocate each instruction in the MBB.
- MBBCurTime = -1;
- while (MII != MBB.end()) {
- MachineInstr *MI = MII++;
- MBBCurTime++;
- const TargetInstrDesc &TID = MI->getDesc();
- DEBUG(DOUT << "\nTime=" << MBBCurTime << " Starting RegAlloc of: " << *MI;
- DOUT << " Regs have values: ";
- for (unsigned i = 0; i != RegInfo->getNumRegs(); ++i)
- if (PhysRegsUsed[i] != -1 && PhysRegsUsed[i] != -2)
- DOUT << "[" << RegInfo->getName(i)
- << ",%reg" << PhysRegsUsed[i] << "] ";
- DOUT << "\n");
-
- SmallVector<unsigned, 8> Kills;
- for (unsigned i = 0, e = MI->getNumOperands(); i != e; ++i) {
- MachineOperand& MO = MI->getOperand(i);
- if (MO.isRegister() && MO.isKill()) {
- if (!MO.isImplicit())
- Kills.push_back(MO.getReg());
- else if (!isReadModWriteImplicitKill(MI, MO.getReg()))
- // These are extra physical register kills when a sub-register
- // is defined (def of a sub-register is a read/mod/write of the
- // larger registers). Ignore.
- Kills.push_back(MO.getReg());
- }
- }
-
- // Get the used operands into registers. This has the potential to spill
- // incoming values if we are out of registers. Note that we completely
- // ignore physical register uses here. We assume that if an explicit
- // physical register is referenced by the instruction, that it is guaranteed
- // to be live-in, or the input is badly hosed.
- //
- for (unsigned i = 0; i != MI->getNumOperands(); ++i) {
- MachineOperand& MO = MI->getOperand(i);
- // here we are looking for only used operands (never def&use)
- if (MO.isRegister() && !MO.isDef() && MO.getReg() && !MO.isImplicit() &&
- TargetRegisterInfo::isVirtualRegister(MO.getReg()))
- MI = reloadVirtReg(MBB, MI, i);
- }
-
- // If this instruction is the last user of this register, kill the
- // value, freeing the register being used, so it doesn't need to be
- // spilled to memory.
- //
- for (unsigned i = 0, e = Kills.size(); i != e; ++i) {
- unsigned VirtReg = Kills[i];
- unsigned PhysReg = VirtReg;
- if (TargetRegisterInfo::isVirtualRegister(VirtReg)) {
- // If the virtual register was never materialized into a register, it
- // might not be in the map, but it won't hurt to zero it out anyway.
- unsigned &PhysRegSlot = getVirt2PhysRegMapSlot(VirtReg);
- PhysReg = PhysRegSlot;
- PhysRegSlot = 0;
- } else if (PhysRegsUsed[PhysReg] == -2) {
- // Unallocatable register dead, ignore.
- continue;
- } else {
- assert((!PhysRegsUsed[PhysReg] || PhysRegsUsed[PhysReg] == -1) &&
- "Silently clearing a virtual register?");
- }
-
- if (PhysReg) {
- DOUT << " Last use of " << RegInfo->getName(PhysReg)
- << "[%reg" << VirtReg <<"], removing it from live set\n";
- removePhysReg(PhysReg);
- for (const unsigned *AliasSet = RegInfo->getSubRegisters(PhysReg);
- *AliasSet; ++AliasSet) {
- if (PhysRegsUsed[*AliasSet] != -2) {
- DOUT << " Last use of "
- << RegInfo->getName(*AliasSet)
- << "[%reg" << VirtReg <<"], removing it from live set\n";
- removePhysReg(*AliasSet);
- }
- }
- }
- }
-
- // Loop over all of the operands of the instruction, spilling registers that
- // are defined, and marking explicit destinations in the PhysRegsUsed map.
- for (unsigned i = 0, e = MI->getNumOperands(); i != e; ++i) {
- MachineOperand& MO = MI->getOperand(i);
- if (MO.isRegister() && MO.isDef() && !MO.isImplicit() && MO.getReg() &&
- TargetRegisterInfo::isPhysicalRegister(MO.getReg())) {
- unsigned Reg = MO.getReg();
- if (PhysRegsUsed[Reg] == -2) continue; // Something like ESP.
- // These are extra physical register defs when a sub-register
- // is defined (def of a sub-register is a read/mod/write of the
- // larger registers). Ignore.
- if (isReadModWriteImplicitDef(MI, MO.getReg())) continue;
-
- MF->getRegInfo().setPhysRegUsed(Reg);
- spillPhysReg(MBB, MI, Reg, true); // Spill any existing value in reg
- PhysRegsUsed[Reg] = 0; // It is free and reserved now
- for (const unsigned *AliasSet = RegInfo->getSubRegisters(Reg);
- *AliasSet; ++AliasSet) {
- if (PhysRegsUsed[*AliasSet] != -2) {
- PhysRegsUsed[*AliasSet] = 0; // It is free and reserved now
- MF->getRegInfo().setPhysRegUsed(*AliasSet);
- }
- }
- }
- }
-
- // Loop over the implicit defs, spilling them as well.
- if (TID.getImplicitDefs()) {
- for (const unsigned *ImplicitDefs = TID.getImplicitDefs();
- *ImplicitDefs; ++ImplicitDefs) {
- unsigned Reg = *ImplicitDefs;
- if (PhysRegsUsed[Reg] != -2) {
- spillPhysReg(MBB, MI, Reg, true);
- PhysRegsUsed[Reg] = 0; // It is free and reserved now
- }
- MF->getRegInfo().setPhysRegUsed(Reg);
- for (const unsigned *AliasSet = RegInfo->getSubRegisters(Reg);
- *AliasSet; ++AliasSet) {
- if (PhysRegsUsed[*AliasSet] != -2) {
- PhysRegsUsed[*AliasSet] = 0; // It is free and reserved now
- MF->getRegInfo().setPhysRegUsed(*AliasSet);
- }
- }
- }
- }
-
- SmallVector<unsigned, 8> DeadDefs;
- for (unsigned i = 0, e = MI->getNumOperands(); i != e; ++i) {
- MachineOperand& MO = MI->getOperand(i);
- if (MO.isRegister() && MO.isDead())
- DeadDefs.push_back(MO.getReg());
- }
-
- // Okay, we have allocated all of the source operands and spilled any values
- // that would be destroyed by defs of this instruction. Loop over the
- // explicit defs and assign them to a register, spilling incoming values if
- // we need to scavenge a register.
- //
- for (unsigned i = 0, e = MI->getNumOperands(); i != e; ++i) {
- MachineOperand& MO = MI->getOperand(i);
- if (MO.isRegister() && MO.isDef() && MO.getReg() &&
- TargetRegisterInfo::isVirtualRegister(MO.getReg())) {
- unsigned DestVirtReg = MO.getReg();
- unsigned DestPhysReg;
-
- // If DestVirtReg already has a value, use it.
- if (!(DestPhysReg = getVirt2PhysRegMapSlot(DestVirtReg)))
- DestPhysReg = chooseReg(MBB, MI, DestVirtReg);
- MF->getRegInfo().setPhysRegUsed(DestPhysReg);
- markVirtRegModified(DestVirtReg);
- MI->getOperand(i).setReg(DestPhysReg); // Assign the output register
- }
- }
-
- // If this instruction defines any registers that are immediately dead,
- // kill them now.
- //
- for (unsigned i = 0, e = DeadDefs.size(); i != e; ++i) {
- unsigned VirtReg = DeadDefs[i];
- unsigned PhysReg = VirtReg;
- if (TargetRegisterInfo::isVirtualRegister(VirtReg)) {
- unsigned &PhysRegSlot = getVirt2PhysRegMapSlot(VirtReg);
- PhysReg = PhysRegSlot;
- assert(PhysReg != 0);
- PhysRegSlot = 0;
- } else if (PhysRegsUsed[PhysReg] == -2) {
- // Unallocatable register dead, ignore.
- continue;
- }
-
- if (PhysReg) {
- DOUT << " Register " << RegInfo->getName(PhysReg)
- << " [%reg" << VirtReg
- << "] is never used, removing it frame live list\n";
- removePhysReg(PhysReg);
- for (const unsigned *AliasSet = RegInfo->getAliasSet(PhysReg);
- *AliasSet; ++AliasSet) {
- if (PhysRegsUsed[*AliasSet] != -2) {
- DOUT << " Register " << RegInfo->getName(*AliasSet)
- << " [%reg" << *AliasSet
- << "] is never used, removing it frame live list\n";
- removePhysReg(*AliasSet);
- }
- }
- }
- }
-
- // Finally, if this is a noop copy instruction, zap it.
- unsigned SrcReg, DstReg;
- if (TII.isMoveInstr(*MI, SrcReg, DstReg) && SrcReg == DstReg)
- MBB.erase(MI);
- }
-
- MachineBasicBlock::iterator MI = MBB.getFirstTerminator();
-
- // Spill all physical registers holding virtual registers now.
- for (unsigned i = 0, e = RegInfo->getNumRegs(); i != e; ++i)
- if (PhysRegsUsed[i] != -1 && PhysRegsUsed[i] != -2) {
- if (unsigned VirtReg = PhysRegsUsed[i])
- spillVirtReg(MBB, MI, VirtReg, i);
- else
- removePhysReg(i);
- }
-}
-
-/// runOnMachineFunction - Register allocate the whole function
-///
-bool RABigBlock::runOnMachineFunction(MachineFunction &Fn) {
- DOUT << "Machine Function " << "\n";
- MF = &Fn;
- TM = &Fn.getTarget();
- RegInfo = TM->getRegisterInfo();
-
- PhysRegsUsed.assign(RegInfo->getNumRegs(), -1);
-
- // At various places we want to efficiently check to see whether a register
- // is allocatable. To handle this, we mark all unallocatable registers as
- // being pinned down, permanently.
- {
- BitVector Allocable = RegInfo->getAllocatableSet(Fn);
- for (unsigned i = 0, e = Allocable.size(); i != e; ++i)
- if (!Allocable[i])
- PhysRegsUsed[i] = -2; // Mark the reg unallocable.
- }
-
- // initialize the virtual->physical register map to have a 'null'
- // mapping for all virtual registers
- Virt2PhysRegMap.grow(MF->getRegInfo().getLastVirtReg());
- StackSlotForVirtReg.grow(MF->getRegInfo().getLastVirtReg());
- VirtRegModified.resize(MF->getRegInfo().getLastVirtReg() -
- TargetRegisterInfo::FirstVirtualRegister + 1, 0);
-
- // Loop over all of the basic blocks, eliminating virtual register references
- for (MachineFunction::iterator MBB = Fn.begin(), MBBe = Fn.end();
- MBB != MBBe; ++MBB) {
- // fill out the read timetable
- FillVRegReadTable(*MBB);
- // use it to allocate the BB
- AllocateBasicBlock(*MBB);
- // clear it
- VRegReadTable.clear();
- }
-
- StackSlotForVirtReg.clear();
- PhysRegsUsed.clear();
- VirtRegModified.clear();
- Virt2PhysRegMap.clear();
- return true;
-}
-
-FunctionPass *llvm::createBigBlockRegisterAllocator() {
- return new RABigBlock();
-}
-
diff --git a/release_23/lib/CodeGen/RegAllocLinearScan.cpp b/release_23/lib/CodeGen/RegAllocLinearScan.cpp
deleted file mode 100644
index 456ee6319c14..000000000000
--- a/release_23/lib/CodeGen/RegAllocLinearScan.cpp
+++ /dev/null
@@ -1,937 +0,0 @@
-//===-- RegAllocLinearScan.cpp - Linear Scan register allocator -----------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements a linear scan register allocator.
-//
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "regalloc"
-#include "llvm/CodeGen/LiveIntervalAnalysis.h"
-#include "PhysRegTracker.h"
-#include "VirtRegMap.h"
-#include "llvm/Function.h"
-#include "llvm/CodeGen/MachineFunctionPass.h"
-#include "llvm/CodeGen/MachineInstr.h"
-#include "llvm/CodeGen/MachineLoopInfo.h"
-#include "llvm/CodeGen/MachineRegisterInfo.h"
-#include "llvm/CodeGen/Passes.h"
-#include "llvm/CodeGen/RegAllocRegistry.h"
-#include "llvm/CodeGen/RegisterCoalescer.h"
-#include "llvm/Target/TargetRegisterInfo.h"
-#include "llvm/Target/TargetMachine.h"
-#include "llvm/Target/TargetInstrInfo.h"
-#include "llvm/ADT/EquivalenceClasses.h"
-#include "llvm/ADT/Statistic.h"
-#include "llvm/ADT/STLExtras.h"
-#include "llvm/Support/Debug.h"
-#include "llvm/Support/Compiler.h"
-#include <algorithm>
-#include <set>
-#include <queue>
-#include <memory>
-#include <cmath>
-using namespace llvm;
-
-STATISTIC(NumIters , "Number of iterations performed");
-STATISTIC(NumBacktracks, "Number of times we had to backtrack");
-STATISTIC(NumCoalesce, "Number of copies coalesced");
-
-static RegisterRegAlloc
-linearscanRegAlloc("linearscan", " linear scan register allocator",
- createLinearScanRegisterAllocator);
-
-namespace {
- struct VISIBILITY_HIDDEN RALinScan : public MachineFunctionPass {
- static char ID;
- RALinScan() : MachineFunctionPass((intptr_t)&ID) {}
-
- typedef std::pair<LiveInterval*, LiveInterval::iterator> IntervalPtr;
- typedef std::vector<IntervalPtr> IntervalPtrs;
- private:
- /// RelatedRegClasses - This structure is built the first time a function is
- /// compiled, and keeps track of which register classes have registers that
- /// belong to multiple classes or have aliases that are in other classes.
- EquivalenceClasses<const TargetRegisterClass*> RelatedRegClasses;
- std::map<unsigned, const TargetRegisterClass*> OneClassForEachPhysReg;
-
- MachineFunction* mf_;
- const TargetMachine* tm_;
- const TargetRegisterInfo* tri_;
- const TargetInstrInfo* tii_;
- MachineRegisterInfo *reginfo_;
- BitVector allocatableRegs_;
- LiveIntervals* li_;
- const MachineLoopInfo *loopInfo;
-
- /// handled_ - Intervals are added to the handled_ set in the order of their
- /// start value. This is uses for backtracking.
- std::vector<LiveInterval*> handled_;
-
- /// fixed_ - Intervals that correspond to machine registers.
- ///
- IntervalPtrs fixed_;
-
- /// active_ - Intervals that are currently being processed, and which have a
- /// live range active for the current point.
- IntervalPtrs active_;
-
- /// inactive_ - Intervals that are currently being processed, but which have
- /// a hold at the current point.
- IntervalPtrs inactive_;
-
- typedef std::priority_queue<LiveInterval*,
- std::vector<LiveInterval*>,
- greater_ptr<LiveInterval> > IntervalHeap;
- IntervalHeap unhandled_;
- std::auto_ptr<PhysRegTracker> prt_;
- std::auto_ptr<VirtRegMap> vrm_;
- std::auto_ptr<Spiller> spiller_;
-
- public:
- virtual const char* getPassName() const {
- return "Linear Scan Register Allocator";
- }
-
- virtual void getAnalysisUsage(AnalysisUsage &AU) const {
- AU.addRequired<LiveIntervals>();
- // Make sure PassManager knows which analyses to make available
- // to coalescing and which analyses coalescing invalidates.
- AU.addRequiredTransitive<RegisterCoalescer>();
- AU.addRequired<MachineLoopInfo>();
- AU.addPreserved<MachineLoopInfo>();
- AU.addPreservedID(MachineDominatorsID);
- MachineFunctionPass::getAnalysisUsage(AU);
- }
-
- /// runOnMachineFunction - register allocate the whole function
- bool runOnMachineFunction(MachineFunction&);
-
- private:
- /// linearScan - the linear scan algorithm
- void linearScan();
-
- /// initIntervalSets - initialize the interval sets.
- ///
- void initIntervalSets();
-
- /// processActiveIntervals - expire old intervals and move non-overlapping
- /// ones to the inactive list.
- void processActiveIntervals(unsigned CurPoint);
-
- /// processInactiveIntervals - expire old intervals and move overlapping
- /// ones to the active list.
- void processInactiveIntervals(unsigned CurPoint);
-
- /// assignRegOrStackSlotAtInterval - assign a register if one
- /// is available, or spill.
- void assignRegOrStackSlotAtInterval(LiveInterval* cur);
-
- /// attemptTrivialCoalescing - If a simple interval is defined by a copy,
- /// try allocate the definition the same register as the source register
- /// if the register is not defined during live time of the interval. This
- /// eliminate a copy. This is used to coalesce copies which were not
- /// coalesced away before allocation either due to dest and src being in
- /// different register classes or because the coalescer was overly
- /// conservative.
- unsigned attemptTrivialCoalescing(LiveInterval &cur, unsigned Reg);
-
- ///
- /// register handling helpers
- ///
-
- /// getFreePhysReg - return a free physical register for this virtual
- /// register interval if we have one, otherwise return 0.
- unsigned getFreePhysReg(LiveInterval* cur);
-
- /// assignVirt2StackSlot - assigns this virtual register to a
- /// stack slot. returns the stack slot
- int assignVirt2StackSlot(unsigned virtReg);
-
- void ComputeRelatedRegClasses();
-
- template <typename ItTy>
- void printIntervals(const char* const str, ItTy i, ItTy e) const {
- if (str) DOUT << str << " intervals:\n";
- for (; i != e; ++i) {
- DOUT << "\t" << *i->first << " -> ";
- unsigned reg = i->first->reg;
- if (TargetRegisterInfo::isVirtualRegister(reg)) {
- reg = vrm_->getPhys(reg);
- }
- DOUT << tri_->getName(reg) << '\n';
- }
- }
- };
- char RALinScan::ID = 0;
-}
-
-void RALinScan::ComputeRelatedRegClasses() {
- const TargetRegisterInfo &TRI = *tri_;
-
- // First pass, add all reg classes to the union, and determine at least one
- // reg class that each register is in.
- bool HasAliases = false;
- for (TargetRegisterInfo::regclass_iterator RCI = TRI.regclass_begin(),
- E = TRI.regclass_end(); RCI != E; ++RCI) {
- RelatedRegClasses.insert(*RCI);
- for (TargetRegisterClass::iterator I = (*RCI)->begin(), E = (*RCI)->end();
- I != E; ++I) {
- HasAliases = HasAliases || *TRI.getAliasSet(*I) != 0;
-
- const TargetRegisterClass *&PRC = OneClassForEachPhysReg[*I];
- if (PRC) {
- // Already processed this register. Just make sure we know that
- // multiple register classes share a register.
- RelatedRegClasses.unionSets(PRC, *RCI);
- } else {
- PRC = *RCI;
- }
- }
- }
-
- // Second pass, now that we know conservatively what register classes each reg
- // belongs to, add info about aliases. We don't need to do this for targets
- // without register aliases.
- if (HasAliases)
- for (std::map<unsigned, const TargetRegisterClass*>::iterator
- I = OneClassForEachPhysReg.begin(), E = OneClassForEachPhysReg.end();
- I != E; ++I)
- for (const unsigned *AS = TRI.getAliasSet(I->first); *AS; ++AS)
- RelatedRegClasses.unionSets(I->second, OneClassForEachPhysReg[*AS]);
-}
-
-/// attemptTrivialCoalescing - If a simple interval is defined by a copy,
-/// try allocate the definition the same register as the source register
-/// if the register is not defined during live time of the interval. This
-/// eliminate a copy. This is used to coalesce copies which were not
-/// coalesced away before allocation either due to dest and src being in
-/// different register classes or because the coalescer was overly
-/// conservative.
-unsigned RALinScan::attemptTrivialCoalescing(LiveInterval &cur, unsigned Reg) {
- if ((cur.preference && cur.preference == Reg) || !cur.containsOneValue())
- return Reg;
-
- VNInfo *vni = cur.getValNumInfo(0);
- if (!vni->def || vni->def == ~1U || vni->def == ~0U)
- return Reg;
- MachineInstr *CopyMI = li_->getInstructionFromIndex(vni->def);
- unsigned SrcReg, DstReg;
- if (!CopyMI || !tii_->isMoveInstr(*CopyMI, SrcReg, DstReg))
- return Reg;
- if (TargetRegisterInfo::isVirtualRegister(SrcReg)) {
- if (!vrm_->isAssignedReg(SrcReg))
- return Reg;
- else
- SrcReg = vrm_->getPhys(SrcReg);
- }
- if (Reg == SrcReg)
- return Reg;
-
- const TargetRegisterClass *RC = reginfo_->getRegClass(cur.reg);
- if (!RC->contains(SrcReg))
- return Reg;
-
- // Try to coalesce.
- if (!li_->conflictsWithPhysRegDef(cur, *vrm_, SrcReg)) {
- DOUT << "Coalescing: " << cur << " -> " << tri_->getName(SrcReg)
- << '\n';
- vrm_->clearVirt(cur.reg);
- vrm_->assignVirt2Phys(cur.reg, SrcReg);
- ++NumCoalesce;
- return SrcReg;
- }
-
- return Reg;
-}
-
-bool RALinScan::runOnMachineFunction(MachineFunction &fn) {
- mf_ = &fn;
- tm_ = &fn.getTarget();
- tri_ = tm_->getRegisterInfo();
- tii_ = tm_->getInstrInfo();
- reginfo_ = &mf_->getRegInfo();
- allocatableRegs_ = tri_->getAllocatableSet(fn);
- li_ = &getAnalysis<LiveIntervals>();
- loopInfo = &getAnalysis<MachineLoopInfo>();
-
- // We don't run the coalescer here because we have no reason to
- // interact with it. If the coalescer requires interaction, it
- // won't do anything. If it doesn't require interaction, we assume
- // it was run as a separate pass.
-
- // If this is the first function compiled, compute the related reg classes.
- if (RelatedRegClasses.empty())
- ComputeRelatedRegClasses();
-
- if (!prt_.get()) prt_.reset(new PhysRegTracker(*tri_));
- vrm_.reset(new VirtRegMap(*mf_));
- if (!spiller_.get()) spiller_.reset(createSpiller());
-
- initIntervalSets();
-
- linearScan();
-
- // Rewrite spill code and update the PhysRegsUsed set.
- spiller_->runOnMachineFunction(*mf_, *vrm_);
- vrm_.reset(); // Free the VirtRegMap
-
- while (!unhandled_.empty()) unhandled_.pop();
- fixed_.clear();
- active_.clear();
- inactive_.clear();
- handled_.clear();
-
- return true;
-}
-
-/// initIntervalSets - initialize the interval sets.
-///
-void RALinScan::initIntervalSets()
-{
- assert(unhandled_.empty() && fixed_.empty() &&
- active_.empty() && inactive_.empty() &&
- "interval sets should be empty on initialization");
-
- for (LiveIntervals::iterator i = li_->begin(), e = li_->end(); i != e; ++i) {
- if (TargetRegisterInfo::isPhysicalRegister(i->second.reg)) {
- reginfo_->setPhysRegUsed(i->second.reg);
- fixed_.push_back(std::make_pair(&i->second, i->second.begin()));
- } else
- unhandled_.push(&i->second);
- }
-}
-
-void RALinScan::linearScan()
-{
- // linear scan algorithm
- DOUT << "********** LINEAR SCAN **********\n";
- DOUT << "********** Function: " << mf_->getFunction()->getName() << '\n';
-
- DEBUG(printIntervals("fixed", fixed_.begin(), fixed_.end()));
-
- while (!unhandled_.empty()) {
- // pick the interval with the earliest start point
- LiveInterval* cur = unhandled_.top();
- unhandled_.pop();
- ++NumIters;
- DOUT << "\n*** CURRENT ***: " << *cur << '\n';
-
- if (!cur->empty()) {
- processActiveIntervals(cur->beginNumber());
- processInactiveIntervals(cur->beginNumber());
-
- assert(TargetRegisterInfo::isVirtualRegister(cur->reg) &&
- "Can only allocate virtual registers!");
- }
-
- // Allocating a virtual register. try to find a free
- // physical register or spill an interval (possibly this one) in order to
- // assign it one.
- assignRegOrStackSlotAtInterval(cur);
-
- DEBUG(printIntervals("active", active_.begin(), active_.end()));
- DEBUG(printIntervals("inactive", inactive_.begin(), inactive_.end()));
- }
-
- // expire any remaining active intervals
- while (!active_.empty()) {
- IntervalPtr &IP = active_.back();
- unsigned reg = IP.first->reg;
- DOUT << "\tinterval " << *IP.first << " expired\n";
- assert(TargetRegisterInfo::isVirtualRegister(reg) &&
- "Can only allocate virtual registers!");
- reg = vrm_->getPhys(reg);
- prt_->delRegUse(reg);
- active_.pop_back();
- }
-
- // expire any remaining inactive intervals
- DEBUG(for (IntervalPtrs::reverse_iterator
- i = inactive_.rbegin(); i != inactive_.rend(); ++i)
- DOUT << "\tinterval " << *i->first << " expired\n");
- inactive_.clear();
-
- // Add live-ins to every BB except for entry. Also perform trivial coalescing.
- MachineFunction::iterator EntryMBB = mf_->begin();
- SmallVector<MachineBasicBlock*, 8> LiveInMBBs;
- for (LiveIntervals::iterator i = li_->begin(), e = li_->end(); i != e; ++i) {
- LiveInterval &cur = i->second;
- unsigned Reg = 0;
- bool isPhys = TargetRegisterInfo::isPhysicalRegister(cur.reg);
- if (isPhys)
- Reg = i->second.reg;
- else if (vrm_->isAssignedReg(cur.reg))
- Reg = attemptTrivialCoalescing(cur, vrm_->getPhys(cur.reg));
- if (!Reg)
- continue;
- // Ignore splited live intervals.
- if (!isPhys && vrm_->getPreSplitReg(cur.reg))
- continue;
- for (LiveInterval::Ranges::const_iterator I = cur.begin(), E = cur.end();
- I != E; ++I) {
- const LiveRange &LR = *I;
- if (li_->findLiveInMBBs(LR, LiveInMBBs)) {
- for (unsigned i = 0, e = LiveInMBBs.size(); i != e; ++i)
- if (LiveInMBBs[i] != EntryMBB)
- LiveInMBBs[i]->addLiveIn(Reg);
- LiveInMBBs.clear();
- }
- }
- }
-
- DOUT << *vrm_;
-}
-
-/// processActiveIntervals - expire old intervals and move non-overlapping ones
-/// to the inactive list.
-void RALinScan::processActiveIntervals(unsigned CurPoint)
-{
- DOUT << "\tprocessing active intervals:\n";
-
- for (unsigned i = 0, e = active_.size(); i != e; ++i) {
- LiveInterval *Interval = active_[i].first;
- LiveInterval::iterator IntervalPos = active_[i].second;
- unsigned reg = Interval->reg;
-
- IntervalPos = Interval->advanceTo(IntervalPos, CurPoint);
-
- if (IntervalPos == Interval->end()) { // Remove expired intervals.
- DOUT << "\t\tinterval " << *Interval << " expired\n";
- assert(TargetRegisterInfo::isVirtualRegister(reg) &&
- "Can only allocate virtual registers!");
- reg = vrm_->getPhys(reg);
- prt_->delRegUse(reg);
-
- // Pop off the end of the list.
- active_[i] = active_.back();
- active_.pop_back();
- --i; --e;
-
- } else if (IntervalPos->start > CurPoint) {
- // Move inactive intervals to inactive list.
- DOUT << "\t\tinterval " << *Interval << " inactive\n";
- assert(TargetRegisterInfo::isVirtualRegister(reg) &&
- "Can only allocate virtual registers!");
- reg = vrm_->getPhys(reg);
- prt_->delRegUse(reg);
- // add to inactive.
- inactive_.push_back(std::make_pair(Interval, IntervalPos));
-
- // Pop off the end of the list.
- active_[i] = active_.back();
- active_.pop_back();
- --i; --e;
- } else {
- // Otherwise, just update the iterator position.
- active_[i].second = IntervalPos;
- }
- }
-}
-
-/// processInactiveIntervals - expire old intervals and move overlapping
-/// ones to the active list.
-void RALinScan::processInactiveIntervals(unsigned CurPoint)
-{
- DOUT << "\tprocessing inactive intervals:\n";
-
- for (unsigned i = 0, e = inactive_.size(); i != e; ++i) {
- LiveInterval *Interval = inactive_[i].first;
- LiveInterval::iterator IntervalPos = inactive_[i].second;
- unsigned reg = Interval->reg;
-
- IntervalPos = Interval->advanceTo(IntervalPos, CurPoint);
-
- if (IntervalPos == Interval->end()) { // remove expired intervals.
- DOUT << "\t\tinterval " << *Interval << " expired\n";
-
- // Pop off the end of the list.
- inactive_[i] = inactive_.back();
- inactive_.pop_back();
- --i; --e;
- } else if (IntervalPos->start <= CurPoint) {
- // move re-activated intervals in active list
- DOUT << "\t\tinterval " << *Interval << " active\n";
- assert(TargetRegisterInfo::isVirtualRegister(reg) &&
- "Can only allocate virtual registers!");
- reg = vrm_->getPhys(reg);
- prt_->addRegUse(reg);
- // add to active
- active_.push_back(std::make_pair(Interval, IntervalPos));
-
- // Pop off the end of the list.
- inactive_[i] = inactive_.back();
- inactive_.pop_back();
- --i; --e;
- } else {
- // Otherwise, just update the iterator position.
- inactive_[i].second = IntervalPos;
- }
- }
-}
-
-/// updateSpillWeights - updates the spill weights of the specifed physical
-/// register and its weight.
-static void updateSpillWeights(std::vector<float> &Weights,
- unsigned reg, float weight,
- const TargetRegisterInfo *TRI) {
- Weights[reg] += weight;
- for (const unsigned* as = TRI->getAliasSet(reg); *as; ++as)
- Weights[*as] += weight;
-}
-
-static
-RALinScan::IntervalPtrs::iterator
-FindIntervalInVector(RALinScan::IntervalPtrs &IP, LiveInterval *LI) {
- for (RALinScan::IntervalPtrs::iterator I = IP.begin(), E = IP.end();
- I != E; ++I)
- if (I->first == LI) return I;
- return IP.end();
-}
-
-static void RevertVectorIteratorsTo(RALinScan::IntervalPtrs &V, unsigned Point){
- for (unsigned i = 0, e = V.size(); i != e; ++i) {
- RALinScan::IntervalPtr &IP = V[i];
- LiveInterval::iterator I = std::upper_bound(IP.first->begin(),
- IP.second, Point);
- if (I != IP.first->begin()) --I;
- IP.second = I;
- }
-}
-
-/// assignRegOrStackSlotAtInterval - assign a register if one is available, or
-/// spill.
-void RALinScan::assignRegOrStackSlotAtInterval(LiveInterval* cur)
-{
- DOUT << "\tallocating current interval: ";
-
- // This is an implicitly defined live interval, just assign any register.
- const TargetRegisterClass *RC = reginfo_->getRegClass(cur->reg);
- if (cur->empty()) {
- unsigned physReg = cur->preference;
- if (!physReg)
- physReg = *RC->allocation_order_begin(*mf_);
- DOUT << tri_->getName(physReg) << '\n';
- // Note the register is not really in use.
- vrm_->assignVirt2Phys(cur->reg, physReg);
- return;
- }
-
- PhysRegTracker backupPrt = *prt_;
-
- std::vector<std::pair<unsigned, float> > SpillWeightsToAdd;
- unsigned StartPosition = cur->beginNumber();
- const TargetRegisterClass *RCLeader = RelatedRegClasses.getLeaderValue(RC);
-
- // If this live interval is defined by a move instruction and its source is
- // assigned a physical register that is compatible with the target register
- // class, then we should try to assign it the same register.
- // This can happen when the move is from a larger register class to a smaller
- // one, e.g. X86::mov32to32_. These move instructions are not coalescable.
- if (!cur->preference && cur->containsOneValue()) {
- VNInfo *vni = cur->getValNumInfo(0);
- if (vni->def && vni->def != ~1U && vni->def != ~0U) {
- MachineInstr *CopyMI = li_->getInstructionFromIndex(vni->def);
- unsigned SrcReg, DstReg;
- if (CopyMI && tii_->isMoveInstr(*CopyMI, SrcReg, DstReg)) {
- unsigned Reg = 0;
- if (TargetRegisterInfo::isPhysicalRegister(SrcReg))
- Reg = SrcReg;
- else if (vrm_->isAssignedReg(SrcReg))
- Reg = vrm_->getPhys(SrcReg);
- if (Reg && allocatableRegs_[Reg] && RC->contains(Reg))
- cur->preference = Reg;
- }
- }
- }
-
- // for every interval in inactive we overlap with, mark the
- // register as not free and update spill weights.
- for (IntervalPtrs::const_iterator i = inactive_.begin(),
- e = inactive_.end(); i != e; ++i) {
- unsigned Reg = i->first->reg;
- assert(TargetRegisterInfo::isVirtualRegister(Reg) &&
- "Can only allocate virtual registers!");
- const TargetRegisterClass *RegRC = reginfo_->getRegClass(Reg);
- // If this is not in a related reg class to the register we're allocating,
- // don't check it.
- if (RelatedRegClasses.getLeaderValue(RegRC) == RCLeader &&
- cur->overlapsFrom(*i->first, i->second-1)) {
- Reg = vrm_->getPhys(Reg);
- prt_->addRegUse(Reg);
- SpillWeightsToAdd.push_back(std::make_pair(Reg, i->first->weight));
- }
- }
-
- // Speculatively check to see if we can get a register right now. If not,
- // we know we won't be able to by adding more constraints. If so, we can
- // check to see if it is valid. Doing an exhaustive search of the fixed_ list
- // is very bad (it contains all callee clobbered registers for any functions
- // with a call), so we want to avoid doing that if possible.
- unsigned physReg = getFreePhysReg(cur);
- unsigned BestPhysReg = physReg;
- if (physReg) {
- // We got a register. However, if it's in the fixed_ list, we might
- // conflict with it. Check to see if we conflict with it or any of its
- // aliases.
- SmallSet<unsigned, 8> RegAliases;
- for (const unsigned *AS = tri_->getAliasSet(physReg); *AS; ++AS)
- RegAliases.insert(*AS);
-
- bool ConflictsWithFixed = false;
- for (unsigned i = 0, e = fixed_.size(); i != e; ++i) {
- IntervalPtr &IP = fixed_[i];
- if (physReg == IP.first->reg || RegAliases.count(IP.first->reg)) {
- // Okay, this reg is on the fixed list. Check to see if we actually
- // conflict.
- LiveInterval *I = IP.first;
- if (I->endNumber() > StartPosition) {
- LiveInterval::iterator II = I->advanceTo(IP.second, StartPosition);
- IP.second = II;
- if (II != I->begin() && II->start > StartPosition)
- --II;
- if (cur->overlapsFrom(*I, II)) {
- ConflictsWithFixed = true;
- break;
- }
- }
- }
- }
-
- // Okay, the register picked by our speculative getFreePhysReg call turned
- // out to be in use. Actually add all of the conflicting fixed registers to
- // prt so we can do an accurate query.
- if (ConflictsWithFixed) {
- // For every interval in fixed we overlap with, mark the register as not
- // free and update spill weights.
- for (unsigned i = 0, e = fixed_.size(); i != e; ++i) {
- IntervalPtr &IP = fixed_[i];
- LiveInterval *I = IP.first;
-
- const TargetRegisterClass *RegRC = OneClassForEachPhysReg[I->reg];
- if (RelatedRegClasses.getLeaderValue(RegRC) == RCLeader &&
- I->endNumber() > StartPosition) {
- LiveInterval::iterator II = I->advanceTo(IP.second, StartPosition);
- IP.second = II;
- if (II != I->begin() && II->start > StartPosition)
- --II;
- if (cur->overlapsFrom(*I, II)) {
- unsigned reg = I->reg;
- prt_->addRegUse(reg);
- SpillWeightsToAdd.push_back(std::make_pair(reg, I->weight));
- }
- }
- }
-
- // Using the newly updated prt_ object, which includes conflicts in the
- // future, see if there are any registers available.
- physReg = getFreePhysReg(cur);
- }
- }
-
- // Restore the physical register tracker, removing information about the
- // future.
- *prt_ = backupPrt;
-
- // if we find a free register, we are done: assign this virtual to
- // the free physical register and add this interval to the active
- // list.
- if (physReg) {
- DOUT << tri_->getName(physReg) << '\n';
- vrm_->assignVirt2Phys(cur->reg, physReg);
- prt_->addRegUse(physReg);
- active_.push_back(std::make_pair(cur, cur->begin()));
- handled_.push_back(cur);
- return;
- }
- DOUT << "no free registers\n";
-
- // Compile the spill weights into an array that is better for scanning.
- std::vector<float> SpillWeights(tri_->getNumRegs(), 0.0);
- for (std::vector<std::pair<unsigned, float> >::iterator
- I = SpillWeightsToAdd.begin(), E = SpillWeightsToAdd.end(); I != E; ++I)
- updateSpillWeights(SpillWeights, I->first, I->second, tri_);
-
- // for each interval in active, update spill weights.
- for (IntervalPtrs::const_iterator i = active_.begin(), e = active_.end();
- i != e; ++i) {
- unsigned reg = i->first->reg;
- assert(TargetRegisterInfo::isVirtualRegister(reg) &&
- "Can only allocate virtual registers!");
- reg = vrm_->getPhys(reg);
- updateSpillWeights(SpillWeights, reg, i->first->weight, tri_);
- }
-
- DOUT << "\tassigning stack slot at interval "<< *cur << ":\n";
-
- // Find a register to spill.
- float minWeight = HUGE_VALF;
- unsigned minReg = cur->preference; // Try the preferred register first.
-
- if (!minReg || SpillWeights[minReg] == HUGE_VALF)
- for (TargetRegisterClass::iterator i = RC->allocation_order_begin(*mf_),
- e = RC->allocation_order_end(*mf_); i != e; ++i) {
- unsigned reg = *i;
- if (minWeight > SpillWeights[reg]) {
- minWeight = SpillWeights[reg];
- minReg = reg;
- }
- }
-
- // If we didn't find a register that is spillable, try aliases?
- if (!minReg) {
- for (TargetRegisterClass::iterator i = RC->allocation_order_begin(*mf_),
- e = RC->allocation_order_end(*mf_); i != e; ++i) {
- unsigned reg = *i;
- // No need to worry about if the alias register size < regsize of RC.
- // We are going to spill all registers that alias it anyway.
- for (const unsigned* as = tri_->getAliasSet(reg); *as; ++as) {
- if (minWeight > SpillWeights[*as]) {
- minWeight = SpillWeights[*as];
- minReg = *as;
- }
- }
- }
-
- // All registers must have inf weight. Just grab one!
- if (!minReg) {
- minReg = BestPhysReg ? BestPhysReg : *RC->allocation_order_begin(*mf_);
- if (cur->weight == HUGE_VALF || cur->getSize() == 1)
- // Spill a physical register around defs and uses.
- li_->spillPhysRegAroundRegDefsUses(*cur, minReg, *vrm_);
- }
- }
-
- DOUT << "\t\tregister with min weight: "
- << tri_->getName(minReg) << " (" << minWeight << ")\n";
-
- // if the current has the minimum weight, we need to spill it and
- // add any added intervals back to unhandled, and restart
- // linearscan.
- if (cur->weight != HUGE_VALF && cur->weight <= minWeight) {
- DOUT << "\t\t\tspilling(c): " << *cur << '\n';
- std::vector<LiveInterval*> added =
- li_->addIntervalsForSpills(*cur, loopInfo, *vrm_);
- if (added.empty())
- return; // Early exit if all spills were folded.
-
- // Merge added with unhandled. Note that we know that
- // addIntervalsForSpills returns intervals sorted by their starting
- // point.
- for (unsigned i = 0, e = added.size(); i != e; ++i)
- unhandled_.push(added[i]);
- return;
- }
-
- ++NumBacktracks;
-
- // push the current interval back to unhandled since we are going
- // to re-run at least this iteration. Since we didn't modify it it
- // should go back right in the front of the list
- unhandled_.push(cur);
-
- // otherwise we spill all intervals aliasing the register with
- // minimum weight, rollback to the interval with the earliest
- // start point and let the linear scan algorithm run again
- std::vector<LiveInterval*> added;
- assert(TargetRegisterInfo::isPhysicalRegister(minReg) &&
- "did not choose a register to spill?");
- BitVector toSpill(tri_->getNumRegs());
-
- // We are going to spill minReg and all its aliases.
- toSpill[minReg] = true;
- for (const unsigned* as = tri_->getAliasSet(minReg); *as; ++as)
- toSpill[*as] = true;
-
- // the earliest start of a spilled interval indicates up to where
- // in handled we need to roll back
- unsigned earliestStart = cur->beginNumber();
-
- // set of spilled vregs (used later to rollback properly)
- SmallSet<unsigned, 32> spilled;
-
- // spill live intervals of virtual regs mapped to the physical register we
- // want to clear (and its aliases). We only spill those that overlap with the
- // current interval as the rest do not affect its allocation. we also keep
- // track of the earliest start of all spilled live intervals since this will
- // mark our rollback point.
- for (IntervalPtrs::iterator i = active_.begin(); i != active_.end(); ++i) {
- unsigned reg = i->first->reg;
- if (//TargetRegisterInfo::isVirtualRegister(reg) &&
- toSpill[vrm_->getPhys(reg)] &&
- cur->overlapsFrom(*i->first, i->second)) {
- DOUT << "\t\t\tspilling(a): " << *i->first << '\n';
- earliestStart = std::min(earliestStart, i->first->beginNumber());
- std::vector<LiveInterval*> newIs =
- li_->addIntervalsForSpills(*i->first, loopInfo, *vrm_);
- std::copy(newIs.begin(), newIs.end(), std::back_inserter(added));
- spilled.insert(reg);
- }
- }
- for (IntervalPtrs::iterator i = inactive_.begin(); i != inactive_.end(); ++i){
- unsigned reg = i->first->reg;
- if (//TargetRegisterInfo::isVirtualRegister(reg) &&
- toSpill[vrm_->getPhys(reg)] &&
- cur->overlapsFrom(*i->first, i->second-1)) {
- DOUT << "\t\t\tspilling(i): " << *i->first << '\n';
- earliestStart = std::min(earliestStart, i->first->beginNumber());
- std::vector<LiveInterval*> newIs =
- li_->addIntervalsForSpills(*i->first, loopInfo, *vrm_);
- std::copy(newIs.begin(), newIs.end(), std::back_inserter(added));
- spilled.insert(reg);
- }
- }
-
- DOUT << "\t\trolling back to: " << earliestStart << '\n';
-
- // Scan handled in reverse order up to the earliest start of a
- // spilled live interval and undo each one, restoring the state of
- // unhandled.
- while (!handled_.empty()) {
- LiveInterval* i = handled_.back();
- // If this interval starts before t we are done.
- if (i->beginNumber() < earliestStart)
- break;
- DOUT << "\t\t\tundo changes for: " << *i << '\n';
- handled_.pop_back();
-
- // When undoing a live interval allocation we must know if it is active or
- // inactive to properly update the PhysRegTracker and the VirtRegMap.
- IntervalPtrs::iterator it;
- if ((it = FindIntervalInVector(active_, i)) != active_.end()) {
- active_.erase(it);
- assert(!TargetRegisterInfo::isPhysicalRegister(i->reg));
- if (!spilled.count(i->reg))
- unhandled_.push(i);
- prt_->delRegUse(vrm_->getPhys(i->reg));
- vrm_->clearVirt(i->reg);
- } else if ((it = FindIntervalInVector(inactive_, i)) != inactive_.end()) {
- inactive_.erase(it);
- assert(!TargetRegisterInfo::isPhysicalRegister(i->reg));
- if (!spilled.count(i->reg))
- unhandled_.push(i);
- vrm_->clearVirt(i->reg);
- } else {
- assert(TargetRegisterInfo::isVirtualRegister(i->reg) &&
- "Can only allocate virtual registers!");
- vrm_->clearVirt(i->reg);
- unhandled_.push(i);
- }
-
- // It interval has a preference, it must be defined by a copy. Clear the
- // preference now since the source interval allocation may have been undone
- // as well.
- i->preference = 0;
- }
-
- // Rewind the iterators in the active, inactive, and fixed lists back to the
- // point we reverted to.
- RevertVectorIteratorsTo(active_, earliestStart);
- RevertVectorIteratorsTo(inactive_, earliestStart);
- RevertVectorIteratorsTo(fixed_, earliestStart);
-
- // scan the rest and undo each interval that expired after t and
- // insert it in active (the next iteration of the algorithm will
- // put it in inactive if required)
- for (unsigned i = 0, e = handled_.size(); i != e; ++i) {
- LiveInterval *HI = handled_[i];
- if (!HI->expiredAt(earliestStart) &&
- HI->expiredAt(cur->beginNumber())) {
- DOUT << "\t\t\tundo changes for: " << *HI << '\n';
- active_.push_back(std::make_pair(HI, HI->begin()));
- assert(!TargetRegisterInfo::isPhysicalRegister(HI->reg));
- prt_->addRegUse(vrm_->getPhys(HI->reg));
- }
- }
-
- // merge added with unhandled
- for (unsigned i = 0, e = added.size(); i != e; ++i)
- unhandled_.push(added[i]);
-}
-
-/// getFreePhysReg - return a free physical register for this virtual register
-/// interval if we have one, otherwise return 0.
-unsigned RALinScan::getFreePhysReg(LiveInterval *cur) {
- SmallVector<unsigned, 256> inactiveCounts;
- unsigned MaxInactiveCount = 0;
-
- const TargetRegisterClass *RC = reginfo_->getRegClass(cur->reg);
- const TargetRegisterClass *RCLeader = RelatedRegClasses.getLeaderValue(RC);
-
- for (IntervalPtrs::iterator i = inactive_.begin(), e = inactive_.end();
- i != e; ++i) {
- unsigned reg = i->first->reg;
- assert(TargetRegisterInfo::isVirtualRegister(reg) &&
- "Can only allocate virtual registers!");
-
- // If this is not in a related reg class to the register we're allocating,
- // don't check it.
- const TargetRegisterClass *RegRC = reginfo_->getRegClass(reg);
- if (RelatedRegClasses.getLeaderValue(RegRC) == RCLeader) {
- reg = vrm_->getPhys(reg);
- if (inactiveCounts.size() <= reg)
- inactiveCounts.resize(reg+1);
- ++inactiveCounts[reg];
- MaxInactiveCount = std::max(MaxInactiveCount, inactiveCounts[reg]);
- }
- }
-
- unsigned FreeReg = 0;
- unsigned FreeRegInactiveCount = 0;
-
- // If copy coalescer has assigned a "preferred" register, check if it's
- // available first.
- if (cur->preference) {
- if (prt_->isRegAvail(cur->preference)) {
- DOUT << "\t\tassigned the preferred register: "
- << tri_->getName(cur->preference) << "\n";
- return cur->preference;
- } else
- DOUT << "\t\tunable to assign the preferred register: "
- << tri_->getName(cur->preference) << "\n";
- }
-
- // Scan for the first available register.
- TargetRegisterClass::iterator I = RC->allocation_order_begin(*mf_);
- TargetRegisterClass::iterator E = RC->allocation_order_end(*mf_);
- assert(I != E && "No allocatable register in this register class!");
- for (; I != E; ++I)
- if (prt_->isRegAvail(*I)) {
- FreeReg = *I;
- if (FreeReg < inactiveCounts.size())
- FreeRegInactiveCount = inactiveCounts[FreeReg];
- else
- FreeRegInactiveCount = 0;
- break;
- }
-
- // If there are no free regs, or if this reg has the max inactive count,
- // return this register.
- if (FreeReg == 0 || FreeRegInactiveCount == MaxInactiveCount) return FreeReg;
-
- // Continue scanning the registers, looking for the one with the highest
- // inactive count. Alkis found that this reduced register pressure very
- // slightly on X86 (in rev 1.94 of this file), though this should probably be
- // reevaluated now.
- for (; I != E; ++I) {
- unsigned Reg = *I;
- if (prt_->isRegAvail(Reg) && Reg < inactiveCounts.size() &&
- FreeRegInactiveCount < inactiveCounts[Reg]) {
- FreeReg = Reg;
- FreeRegInactiveCount = inactiveCounts[Reg];
- if (FreeRegInactiveCount == MaxInactiveCount)
- break; // We found the one with the max inactive count.
- }
- }
-
- return FreeReg;
-}
-
-FunctionPass* llvm::createLinearScanRegisterAllocator() {
- return new RALinScan();
-}
diff --git a/release_23/lib/CodeGen/RegAllocLocal.cpp b/release_23/lib/CodeGen/RegAllocLocal.cpp
deleted file mode 100644
index 3281a2c3daf7..000000000000
--- a/release_23/lib/CodeGen/RegAllocLocal.cpp
+++ /dev/null
@@ -1,850 +0,0 @@
-//===-- RegAllocLocal.cpp - A BasicBlock generic register allocator -------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This register allocator allocates registers to a basic block at a time,
-// attempting to keep values in registers and reusing registers as appropriate.
-//
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "regalloc"
-#include "llvm/BasicBlock.h"
-#include "llvm/CodeGen/LiveVariables.h"
-#include "llvm/CodeGen/MachineFunctionPass.h"
-#include "llvm/CodeGen/MachineInstr.h"
-#include "llvm/CodeGen/MachineFrameInfo.h"
-#include "llvm/CodeGen/MachineRegisterInfo.h"
-#include "llvm/CodeGen/Passes.h"
-#include "llvm/CodeGen/RegAllocRegistry.h"
-#include "llvm/Target/TargetInstrInfo.h"
-#include "llvm/Target/TargetMachine.h"
-#include "llvm/Support/CommandLine.h"
-#include "llvm/Support/Debug.h"
-#include "llvm/Support/Compiler.h"
-#include "llvm/ADT/IndexedMap.h"
-#include "llvm/ADT/SmallVector.h"
-#include "llvm/ADT/Statistic.h"
-#include "llvm/ADT/STLExtras.h"
-#include <algorithm>
-#include <map>
-using namespace llvm;
-
-STATISTIC(NumStores, "Number of stores added");
-STATISTIC(NumLoads , "Number of loads added");
-
-namespace {
- static RegisterRegAlloc
- localRegAlloc("local", " local register allocator",
- createLocalRegisterAllocator);
-
-
- class VISIBILITY_HIDDEN RALocal : public MachineFunctionPass {
- public:
- static char ID;
- RALocal() : MachineFunctionPass((intptr_t)&ID) {}
- private:
- const TargetMachine *TM;
- MachineFunction *MF;
- const TargetRegisterInfo *TRI;
- const TargetInstrInfo *TII;
-
- // StackSlotForVirtReg - Maps virtual regs to the frame index where these
- // values are spilled.
- std::map<unsigned, int> StackSlotForVirtReg;
-
- // Virt2PhysRegMap - This map contains entries for each virtual register
- // that is currently available in a physical register.
- IndexedMap<unsigned, VirtReg2IndexFunctor> Virt2PhysRegMap;
-
- unsigned &getVirt2PhysRegMapSlot(unsigned VirtReg) {
- return Virt2PhysRegMap[VirtReg];
- }
-
- // PhysRegsUsed - This array is effectively a map, containing entries for
- // each physical register that currently has a value (ie, it is in
- // Virt2PhysRegMap). The value mapped to is the virtual register
- // corresponding to the physical register (the inverse of the
- // Virt2PhysRegMap), or 0. The value is set to 0 if this register is pinned
- // because it is used by a future instruction, and to -2 if it is not
- // allocatable. If the entry for a physical register is -1, then the
- // physical register is "not in the map".
- //
- std::vector<int> PhysRegsUsed;
-
- // PhysRegsUseOrder - This contains a list of the physical registers that
- // currently have a virtual register value in them. This list provides an
- // ordering of registers, imposing a reallocation order. This list is only
- // used if all registers are allocated and we have to spill one, in which
- // case we spill the least recently used register. Entries at the front of
- // the list are the least recently used registers, entries at the back are
- // the most recently used.
- //
- std::vector<unsigned> PhysRegsUseOrder;
-
- // Virt2LastUseMap - This maps each virtual register to its last use
- // (MachineInstr*, operand index pair).
- IndexedMap<std::pair<MachineInstr*, unsigned>, VirtReg2IndexFunctor>
- Virt2LastUseMap;
-
- std::pair<MachineInstr*,unsigned>& getVirtRegLastUse(unsigned Reg) {
- assert(TargetRegisterInfo::isVirtualRegister(Reg) && "Illegal VirtReg!");
- return Virt2LastUseMap[Reg];
- }
-
- // VirtRegModified - This bitset contains information about which virtual
- // registers need to be spilled back to memory when their registers are
- // scavenged. If a virtual register has simply been rematerialized, there
- // is no reason to spill it to memory when we need the register back.
- //
- BitVector VirtRegModified;
-
- void markVirtRegModified(unsigned Reg, bool Val = true) {
- assert(TargetRegisterInfo::isVirtualRegister(Reg) && "Illegal VirtReg!");
- Reg -= TargetRegisterInfo::FirstVirtualRegister;
- if (Val)
- VirtRegModified.set(Reg);
- else
- VirtRegModified.reset(Reg);
- }
-
- bool isVirtRegModified(unsigned Reg) const {
- assert(TargetRegisterInfo::isVirtualRegister(Reg) && "Illegal VirtReg!");
- assert(Reg - TargetRegisterInfo::FirstVirtualRegister < VirtRegModified.size()
- && "Illegal virtual register!");
- return VirtRegModified[Reg - TargetRegisterInfo::FirstVirtualRegister];
- }
-
- void AddToPhysRegsUseOrder(unsigned Reg) {
- std::vector<unsigned>::iterator It =
- std::find(PhysRegsUseOrder.begin(), PhysRegsUseOrder.end(), Reg);
- if (It != PhysRegsUseOrder.end())
- PhysRegsUseOrder.erase(It);
- PhysRegsUseOrder.push_back(Reg);
- }
-
- void MarkPhysRegRecentlyUsed(unsigned Reg) {
- if (PhysRegsUseOrder.empty() ||
- PhysRegsUseOrder.back() == Reg) return; // Already most recently used
-
- for (unsigned i = PhysRegsUseOrder.size(); i != 0; --i)
- if (areRegsEqual(Reg, PhysRegsUseOrder[i-1])) {
- unsigned RegMatch = PhysRegsUseOrder[i-1]; // remove from middle
- PhysRegsUseOrder.erase(PhysRegsUseOrder.begin()+i-1);
- // Add it to the end of the list
- PhysRegsUseOrder.push_back(RegMatch);
- if (RegMatch == Reg)
- return; // Found an exact match, exit early
- }
- }
-
- public:
- virtual const char *getPassName() const {
- return "Local Register Allocator";
- }
-
- virtual void getAnalysisUsage(AnalysisUsage &AU) const {
- AU.addRequired<LiveVariables>();
- AU.addRequiredID(PHIEliminationID);
- AU.addRequiredID(TwoAddressInstructionPassID);
- MachineFunctionPass::getAnalysisUsage(AU);
- }
-
- private:
- /// runOnMachineFunction - Register allocate the whole function
- bool runOnMachineFunction(MachineFunction &Fn);
-
- /// AllocateBasicBlock - Register allocate the specified basic block.
- void AllocateBasicBlock(MachineBasicBlock &MBB);
-
-
- /// areRegsEqual - This method returns true if the specified registers are
- /// related to each other. To do this, it checks to see if they are equal
- /// or if the first register is in the alias set of the second register.
- ///
- bool areRegsEqual(unsigned R1, unsigned R2) const {
- if (R1 == R2) return true;
- for (const unsigned *AliasSet = TRI->getAliasSet(R2);
- *AliasSet; ++AliasSet) {
- if (*AliasSet == R1) return true;
- }
- return false;
- }
-
- /// getStackSpaceFor - This returns the frame index of the specified virtual
- /// register on the stack, allocating space if necessary.
- int getStackSpaceFor(unsigned VirtReg, const TargetRegisterClass *RC);
-
- /// removePhysReg - This method marks the specified physical register as no
- /// longer being in use.
- ///
- void removePhysReg(unsigned PhysReg);
-
- /// spillVirtReg - This method spills the value specified by PhysReg into
- /// the virtual register slot specified by VirtReg. It then updates the RA
- /// data structures to indicate the fact that PhysReg is now available.
- ///
- void spillVirtReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI,
- unsigned VirtReg, unsigned PhysReg);
-
- /// spillPhysReg - This method spills the specified physical register into
- /// the virtual register slot associated with it. If OnlyVirtRegs is set to
- /// true, then the request is ignored if the physical register does not
- /// contain a virtual register.
- ///
- void spillPhysReg(MachineBasicBlock &MBB, MachineInstr *I,
- unsigned PhysReg, bool OnlyVirtRegs = false);
-
- /// assignVirtToPhysReg - This method updates local state so that we know
- /// that PhysReg is the proper container for VirtReg now. The physical
- /// register must not be used for anything else when this is called.
- ///
- void assignVirtToPhysReg(unsigned VirtReg, unsigned PhysReg);
-
- /// isPhysRegAvailable - Return true if the specified physical register is
- /// free and available for use. This also includes checking to see if
- /// aliased registers are all free...
- ///
- bool isPhysRegAvailable(unsigned PhysReg) const;
-
- /// getFreeReg - Look to see if there is a free register available in the
- /// specified register class. If not, return 0.
- ///
- unsigned getFreeReg(const TargetRegisterClass *RC);
-
- /// getReg - Find a physical register to hold the specified virtual
- /// register. If all compatible physical registers are used, this method
- /// spills the last used virtual register to the stack, and uses that
- /// register.
- ///
- unsigned getReg(MachineBasicBlock &MBB, MachineInstr *MI,
- unsigned VirtReg);
-
- /// reloadVirtReg - This method transforms the specified specified virtual
- /// register use to refer to a physical register. This method may do this
- /// in one of several ways: if the register is available in a physical
- /// register already, it uses that physical register. If the value is not
- /// in a physical register, and if there are physical registers available,
- /// it loads it into a register. If register pressure is high, and it is
- /// possible, it tries to fold the load of the virtual register into the
- /// instruction itself. It avoids doing this if register pressure is low to
- /// improve the chance that subsequent instructions can use the reloaded
- /// value. This method returns the modified instruction.
- ///
- MachineInstr *reloadVirtReg(MachineBasicBlock &MBB, MachineInstr *MI,
- unsigned OpNum);
-
-
- void reloadPhysReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator &I,
- unsigned PhysReg);
- };
- char RALocal::ID = 0;
-}
-
-/// getStackSpaceFor - This allocates space for the specified virtual register
-/// to be held on the stack.
-int RALocal::getStackSpaceFor(unsigned VirtReg, const TargetRegisterClass *RC) {
- // Find the location Reg would belong...
- std::map<unsigned, int>::iterator I =StackSlotForVirtReg.lower_bound(VirtReg);
-
- if (I != StackSlotForVirtReg.end() && I->first == VirtReg)
- return I->second; // Already has space allocated?
-
- // Allocate a new stack object for this spill location...
- int FrameIdx = MF->getFrameInfo()->CreateStackObject(RC->getSize(),
- RC->getAlignment());
-
- // Assign the slot...
- StackSlotForVirtReg.insert(I, std::make_pair(VirtReg, FrameIdx));
- return FrameIdx;
-}
-
-
-/// removePhysReg - This method marks the specified physical register as no
-/// longer being in use.
-///
-void RALocal::removePhysReg(unsigned PhysReg) {
- PhysRegsUsed[PhysReg] = -1; // PhyReg no longer used
-
- std::vector<unsigned>::iterator It =
- std::find(PhysRegsUseOrder.begin(), PhysRegsUseOrder.end(), PhysReg);
- if (It != PhysRegsUseOrder.end())
- PhysRegsUseOrder.erase(It);
-}
-
-
-/// spillVirtReg - This method spills the value specified by PhysReg into the
-/// virtual register slot specified by VirtReg. It then updates the RA data
-/// structures to indicate the fact that PhysReg is now available.
-///
-void RALocal::spillVirtReg(MachineBasicBlock &MBB,
- MachineBasicBlock::iterator I,
- unsigned VirtReg, unsigned PhysReg) {
- assert(VirtReg && "Spilling a physical register is illegal!"
- " Must not have appropriate kill for the register or use exists beyond"
- " the intended one.");
- DOUT << " Spilling register " << TRI->getName(PhysReg)
- << " containing %reg" << VirtReg;
-
- const TargetInstrInfo* TII = MBB.getParent()->getTarget().getInstrInfo();
-
- if (!isVirtRegModified(VirtReg)) {
- DOUT << " which has not been modified, so no store necessary!";
- std::pair<MachineInstr*, unsigned> &LastUse = getVirtRegLastUse(VirtReg);
- if (LastUse.first)
- LastUse.first->getOperand(LastUse.second).setIsKill();
- } else {
- // Otherwise, there is a virtual register corresponding to this physical
- // register. We only need to spill it into its stack slot if it has been
- // modified.
- const TargetRegisterClass *RC = MF->getRegInfo().getRegClass(VirtReg);
- int FrameIndex = getStackSpaceFor(VirtReg, RC);
- DOUT << " to stack slot #" << FrameIndex;
- // If the instruction reads the register that's spilled, (e.g. this can
- // happen if it is a move to a physical register), then the spill
- // instruction is not a kill.
- bool isKill = !(I != MBB.end() && I->readsRegister(PhysReg));
- TII->storeRegToStackSlot(MBB, I, PhysReg, isKill, FrameIndex, RC);
- ++NumStores; // Update statistics
- }
-
- getVirt2PhysRegMapSlot(VirtReg) = 0; // VirtReg no longer available
-
- DOUT << "\n";
- removePhysReg(PhysReg);
-}
-
-
-/// spillPhysReg - This method spills the specified physical register into the
-/// virtual register slot associated with it. If OnlyVirtRegs is set to true,
-/// then the request is ignored if the physical register does not contain a
-/// virtual register.
-///
-void RALocal::spillPhysReg(MachineBasicBlock &MBB, MachineInstr *I,
- unsigned PhysReg, bool OnlyVirtRegs) {
- if (PhysRegsUsed[PhysReg] != -1) { // Only spill it if it's used!
- assert(PhysRegsUsed[PhysReg] != -2 && "Non allocable reg used!");
- if (PhysRegsUsed[PhysReg] || !OnlyVirtRegs)
- spillVirtReg(MBB, I, PhysRegsUsed[PhysReg], PhysReg);
- } else {
- // If the selected register aliases any other registers, we must make
- // sure that one of the aliases isn't alive.
- for (const unsigned *AliasSet = TRI->getAliasSet(PhysReg);
- *AliasSet; ++AliasSet)
- if (PhysRegsUsed[*AliasSet] != -1 && // Spill aliased register.
- PhysRegsUsed[*AliasSet] != -2) // If allocatable.
- if (PhysRegsUsed[*AliasSet])
- spillVirtReg(MBB, I, PhysRegsUsed[*AliasSet], *AliasSet);
- }
-}
-
-
-/// assignVirtToPhysReg - This method updates local state so that we know
-/// that PhysReg is the proper container for VirtReg now. The physical
-/// register must not be used for anything else when this is called.
-///
-void RALocal::assignVirtToPhysReg(unsigned VirtReg, unsigned PhysReg) {
- assert(PhysRegsUsed[PhysReg] == -1 && "Phys reg already assigned!");
- // Update information to note the fact that this register was just used, and
- // it holds VirtReg.
- PhysRegsUsed[PhysReg] = VirtReg;
- getVirt2PhysRegMapSlot(VirtReg) = PhysReg;
- AddToPhysRegsUseOrder(PhysReg); // New use of PhysReg
-}
-
-
-/// isPhysRegAvailable - Return true if the specified physical register is free
-/// and available for use. This also includes checking to see if aliased
-/// registers are all free...
-///
-bool RALocal::isPhysRegAvailable(unsigned PhysReg) const {
- if (PhysRegsUsed[PhysReg] != -1) return false;
-
- // If the selected register aliases any other allocated registers, it is
- // not free!
- for (const unsigned *AliasSet = TRI->getAliasSet(PhysReg);
- *AliasSet; ++AliasSet)
- if (PhysRegsUsed[*AliasSet] >= 0) // Aliased register in use?
- return false; // Can't use this reg then.
- return true;
-}
-
-
-/// getFreeReg - Look to see if there is a free register available in the
-/// specified register class. If not, return 0.
-///
-unsigned RALocal::getFreeReg(const TargetRegisterClass *RC) {
- // Get iterators defining the range of registers that are valid to allocate in
- // this class, which also specifies the preferred allocation order.
- TargetRegisterClass::iterator RI = RC->allocation_order_begin(*MF);
- TargetRegisterClass::iterator RE = RC->allocation_order_end(*MF);
-
- for (; RI != RE; ++RI)
- if (isPhysRegAvailable(*RI)) { // Is reg unused?
- assert(*RI != 0 && "Cannot use register!");
- return *RI; // Found an unused register!
- }
- return 0;
-}
-
-
-/// getReg - Find a physical register to hold the specified virtual
-/// register. If all compatible physical registers are used, this method spills
-/// the last used virtual register to the stack, and uses that register.
-///
-unsigned RALocal::getReg(MachineBasicBlock &MBB, MachineInstr *I,
- unsigned VirtReg) {
- const TargetRegisterClass *RC = MF->getRegInfo().getRegClass(VirtReg);
-
- // First check to see if we have a free register of the requested type...
- unsigned PhysReg = getFreeReg(RC);
-
- // If we didn't find an unused register, scavenge one now!
- if (PhysReg == 0) {
- assert(!PhysRegsUseOrder.empty() && "No allocated registers??");
-
- // Loop over all of the preallocated registers from the least recently used
- // to the most recently used. When we find one that is capable of holding
- // our register, use it.
- for (unsigned i = 0; PhysReg == 0; ++i) {
- assert(i != PhysRegsUseOrder.size() &&
- "Couldn't find a register of the appropriate class!");
-
- unsigned R = PhysRegsUseOrder[i];
-
- // We can only use this register if it holds a virtual register (ie, it
- // can be spilled). Do not use it if it is an explicitly allocated
- // physical register!
- assert(PhysRegsUsed[R] != -1 &&
- "PhysReg in PhysRegsUseOrder, but is not allocated?");
- if (PhysRegsUsed[R] && PhysRegsUsed[R] != -2) {
- // If the current register is compatible, use it.
- if (RC->contains(R)) {
- PhysReg = R;
- break;
- } else {
- // If one of the registers aliased to the current register is
- // compatible, use it.
- for (const unsigned *AliasIt = TRI->getAliasSet(R);
- *AliasIt; ++AliasIt) {
- if (RC->contains(*AliasIt) &&
- // If this is pinned down for some reason, don't use it. For
- // example, if CL is pinned, and we run across CH, don't use
- // CH as justification for using scavenging ECX (which will
- // fail).
- PhysRegsUsed[*AliasIt] != 0 &&
-
- // Make sure the register is allocatable. Don't allocate SIL on
- // x86-32.
- PhysRegsUsed[*AliasIt] != -2) {
- PhysReg = *AliasIt; // Take an aliased register
- break;
- }
- }
- }
- }
- }
-
- assert(PhysReg && "Physical register not assigned!?!?");
-
- // At this point PhysRegsUseOrder[i] is the least recently used register of
- // compatible register class. Spill it to memory and reap its remains.
- spillPhysReg(MBB, I, PhysReg);
- }
-
- // Now that we know which register we need to assign this to, do it now!
- assignVirtToPhysReg(VirtReg, PhysReg);
- return PhysReg;
-}
-
-
-/// reloadVirtReg - This method transforms the specified specified virtual
-/// register use to refer to a physical register. This method may do this in
-/// one of several ways: if the register is available in a physical register
-/// already, it uses that physical register. If the value is not in a physical
-/// register, and if there are physical registers available, it loads it into a
-/// register. If register pressure is high, and it is possible, it tries to
-/// fold the load of the virtual register into the instruction itself. It
-/// avoids doing this if register pressure is low to improve the chance that
-/// subsequent instructions can use the reloaded value. This method returns the
-/// modified instruction.
-///
-MachineInstr *RALocal::reloadVirtReg(MachineBasicBlock &MBB, MachineInstr *MI,
- unsigned OpNum) {
- unsigned VirtReg = MI->getOperand(OpNum).getReg();
-
- // If the virtual register is already available, just update the instruction
- // and return.
- if (unsigned PR = getVirt2PhysRegMapSlot(VirtReg)) {
- MarkPhysRegRecentlyUsed(PR); // Already have this value available!
- MI->getOperand(OpNum).setReg(PR); // Assign the input register
- getVirtRegLastUse(VirtReg) = std::make_pair(MI, OpNum);
- return MI;
- }
-
- // Otherwise, we need to fold it into the current instruction, or reload it.
- // If we have registers available to hold the value, use them.
- const TargetRegisterClass *RC = MF->getRegInfo().getRegClass(VirtReg);
- unsigned PhysReg = getFreeReg(RC);
- int FrameIndex = getStackSpaceFor(VirtReg, RC);
-
- if (PhysReg) { // Register is available, allocate it!
- assignVirtToPhysReg(VirtReg, PhysReg);
- } else { // No registers available.
- // Force some poor hapless value out of the register file to
- // make room for the new register, and reload it.
- PhysReg = getReg(MBB, MI, VirtReg);
- }
-
- markVirtRegModified(VirtReg, false); // Note that this reg was just reloaded
-
- DOUT << " Reloading %reg" << VirtReg << " into "
- << TRI->getName(PhysReg) << "\n";
-
- // Add move instruction(s)
- const TargetInstrInfo* TII = MBB.getParent()->getTarget().getInstrInfo();
- TII->loadRegFromStackSlot(MBB, MI, PhysReg, FrameIndex, RC);
- ++NumLoads; // Update statistics
-
- MF->getRegInfo().setPhysRegUsed(PhysReg);
- MI->getOperand(OpNum).setReg(PhysReg); // Assign the input register
- getVirtRegLastUse(VirtReg) = std::make_pair(MI, OpNum);
- return MI;
-}
-
-/// isReadModWriteImplicitKill - True if this is an implicit kill for a
-/// read/mod/write register, i.e. update partial register.
-static bool isReadModWriteImplicitKill(MachineInstr *MI, unsigned Reg) {
- for (unsigned i = 0, e = MI->getNumOperands(); i != e; ++i) {
- MachineOperand& MO = MI->getOperand(i);
- if (MO.isRegister() && MO.getReg() == Reg && MO.isImplicit() &&
- MO.isDef() && !MO.isDead())
- return true;
- }
- return false;
-}
-
-/// isReadModWriteImplicitDef - True if this is an implicit def for a
-/// read/mod/write register, i.e. update partial register.
-static bool isReadModWriteImplicitDef(MachineInstr *MI, unsigned Reg) {
- for (unsigned i = 0, e = MI->getNumOperands(); i != e; ++i) {
- MachineOperand& MO = MI->getOperand(i);
- if (MO.isRegister() && MO.getReg() == Reg && MO.isImplicit() &&
- !MO.isDef() && MO.isKill())
- return true;
- }
- return false;
-}
-
-void RALocal::AllocateBasicBlock(MachineBasicBlock &MBB) {
- // loop over each instruction
- MachineBasicBlock::iterator MII = MBB.begin();
- const TargetInstrInfo &TII = *TM->getInstrInfo();
-
- DEBUG(const BasicBlock *LBB = MBB.getBasicBlock();
- if (LBB) DOUT << "\nStarting RegAlloc of BB: " << LBB->getName());
-
- // If this is the first basic block in the machine function, add live-in
- // registers as active.
- if (&MBB == &*MF->begin()) {
- for (MachineRegisterInfo::livein_iterator I=MF->getRegInfo().livein_begin(),
- E = MF->getRegInfo().livein_end(); I != E; ++I) {
- unsigned Reg = I->first;
- MF->getRegInfo().setPhysRegUsed(Reg);
- PhysRegsUsed[Reg] = 0; // It is free and reserved now
- AddToPhysRegsUseOrder(Reg);
- for (const unsigned *AliasSet = TRI->getSubRegisters(Reg);
- *AliasSet; ++AliasSet) {
- if (PhysRegsUsed[*AliasSet] != -2) {
- AddToPhysRegsUseOrder(*AliasSet);
- PhysRegsUsed[*AliasSet] = 0; // It is free and reserved now
- MF->getRegInfo().setPhysRegUsed(*AliasSet);
- }
- }
- }
- }
-
- // Otherwise, sequentially allocate each instruction in the MBB.
- while (MII != MBB.end()) {
- MachineInstr *MI = MII++;
- const TargetInstrDesc &TID = MI->getDesc();
- DEBUG(DOUT << "\nStarting RegAlloc of: " << *MI;
- DOUT << " Regs have values: ";
- for (unsigned i = 0; i != TRI->getNumRegs(); ++i)
- if (PhysRegsUsed[i] != -1 && PhysRegsUsed[i] != -2)
- DOUT << "[" << TRI->getName(i)
- << ",%reg" << PhysRegsUsed[i] << "] ";
- DOUT << "\n");
-
- // Loop over the implicit uses, making sure that they are at the head of the
- // use order list, so they don't get reallocated.
- if (TID.ImplicitUses) {
- for (const unsigned *ImplicitUses = TID.ImplicitUses;
- *ImplicitUses; ++ImplicitUses)
- MarkPhysRegRecentlyUsed(*ImplicitUses);
- }
-
- SmallVector<unsigned, 8> Kills;
- for (unsigned i = 0, e = MI->getNumOperands(); i != e; ++i) {
- MachineOperand& MO = MI->getOperand(i);
- if (MO.isRegister() && MO.isKill()) {
- if (!MO.isImplicit())
- Kills.push_back(MO.getReg());
- else if (!isReadModWriteImplicitKill(MI, MO.getReg()))
- // These are extra physical register kills when a sub-register
- // is defined (def of a sub-register is a read/mod/write of the
- // larger registers). Ignore.
- Kills.push_back(MO.getReg());
- }
- }
-
- // Get the used operands into registers. This has the potential to spill
- // incoming values if we are out of registers. Note that we completely
- // ignore physical register uses here. We assume that if an explicit
- // physical register is referenced by the instruction, that it is guaranteed
- // to be live-in, or the input is badly hosed.
- //
- for (unsigned i = 0; i != MI->getNumOperands(); ++i) {
- MachineOperand& MO = MI->getOperand(i);
- // here we are looking for only used operands (never def&use)
- if (MO.isRegister() && !MO.isDef() && MO.getReg() && !MO.isImplicit() &&
- TargetRegisterInfo::isVirtualRegister(MO.getReg()))
- MI = reloadVirtReg(MBB, MI, i);
- }
-
- // If this instruction is the last user of this register, kill the
- // value, freeing the register being used, so it doesn't need to be
- // spilled to memory.
- //
- for (unsigned i = 0, e = Kills.size(); i != e; ++i) {
- unsigned VirtReg = Kills[i];
- unsigned PhysReg = VirtReg;
- if (TargetRegisterInfo::isVirtualRegister(VirtReg)) {
- // If the virtual register was never materialized into a register, it
- // might not be in the map, but it won't hurt to zero it out anyway.
- unsigned &PhysRegSlot = getVirt2PhysRegMapSlot(VirtReg);
- PhysReg = PhysRegSlot;
- PhysRegSlot = 0;
- } else if (PhysRegsUsed[PhysReg] == -2) {
- // Unallocatable register dead, ignore.
- continue;
- } else {
- assert((!PhysRegsUsed[PhysReg] || PhysRegsUsed[PhysReg] == -1) &&
- "Silently clearing a virtual register?");
- }
-
- if (PhysReg) {
- DOUT << " Last use of " << TRI->getName(PhysReg)
- << "[%reg" << VirtReg <<"], removing it from live set\n";
- removePhysReg(PhysReg);
- for (const unsigned *AliasSet = TRI->getSubRegisters(PhysReg);
- *AliasSet; ++AliasSet) {
- if (PhysRegsUsed[*AliasSet] != -2) {
- DOUT << " Last use of "
- << TRI->getName(*AliasSet)
- << "[%reg" << VirtReg <<"], removing it from live set\n";
- removePhysReg(*AliasSet);
- }
- }
- }
- }
-
- // Loop over all of the operands of the instruction, spilling registers that
- // are defined, and marking explicit destinations in the PhysRegsUsed map.
- for (unsigned i = 0, e = MI->getNumOperands(); i != e; ++i) {
- MachineOperand& MO = MI->getOperand(i);
- if (MO.isRegister() && MO.isDef() && !MO.isImplicit() && MO.getReg() &&
- TargetRegisterInfo::isPhysicalRegister(MO.getReg())) {
- unsigned Reg = MO.getReg();
- if (PhysRegsUsed[Reg] == -2) continue; // Something like ESP.
- // These are extra physical register defs when a sub-register
- // is defined (def of a sub-register is a read/mod/write of the
- // larger registers). Ignore.
- if (isReadModWriteImplicitDef(MI, MO.getReg())) continue;
-
- MF->getRegInfo().setPhysRegUsed(Reg);
- spillPhysReg(MBB, MI, Reg, true); // Spill any existing value in reg
- PhysRegsUsed[Reg] = 0; // It is free and reserved now
- AddToPhysRegsUseOrder(Reg);
-
- for (const unsigned *AliasSet = TRI->getSubRegisters(Reg);
- *AliasSet; ++AliasSet) {
- if (PhysRegsUsed[*AliasSet] != -2) {
- MF->getRegInfo().setPhysRegUsed(*AliasSet);
- PhysRegsUsed[*AliasSet] = 0; // It is free and reserved now
- AddToPhysRegsUseOrder(*AliasSet);
- }
- }
- }
- }
-
- // Loop over the implicit defs, spilling them as well.
- if (TID.ImplicitDefs) {
- for (const unsigned *ImplicitDefs = TID.ImplicitDefs;
- *ImplicitDefs; ++ImplicitDefs) {
- unsigned Reg = *ImplicitDefs;
- if (PhysRegsUsed[Reg] != -2) {
- spillPhysReg(MBB, MI, Reg, true);
- AddToPhysRegsUseOrder(Reg);
- PhysRegsUsed[Reg] = 0; // It is free and reserved now
- }
- MF->getRegInfo().setPhysRegUsed(Reg);
- for (const unsigned *AliasSet = TRI->getSubRegisters(Reg);
- *AliasSet; ++AliasSet) {
- if (PhysRegsUsed[*AliasSet] != -2) {
- AddToPhysRegsUseOrder(*AliasSet);
- PhysRegsUsed[*AliasSet] = 0; // It is free and reserved now
- MF->getRegInfo().setPhysRegUsed(*AliasSet);
- }
- }
- }
- }
-
- SmallVector<unsigned, 8> DeadDefs;
- for (unsigned i = 0, e = MI->getNumOperands(); i != e; ++i) {
- MachineOperand& MO = MI->getOperand(i);
- if (MO.isRegister() && MO.isDead())
- DeadDefs.push_back(MO.getReg());
- }
-
- // Okay, we have allocated all of the source operands and spilled any values
- // that would be destroyed by defs of this instruction. Loop over the
- // explicit defs and assign them to a register, spilling incoming values if
- // we need to scavenge a register.
- //
- for (unsigned i = 0, e = MI->getNumOperands(); i != e; ++i) {
- MachineOperand& MO = MI->getOperand(i);
- if (MO.isRegister() && MO.isDef() && MO.getReg() &&
- TargetRegisterInfo::isVirtualRegister(MO.getReg())) {
- unsigned DestVirtReg = MO.getReg();
- unsigned DestPhysReg;
-
- // If DestVirtReg already has a value, use it.
- if (!(DestPhysReg = getVirt2PhysRegMapSlot(DestVirtReg)))
- DestPhysReg = getReg(MBB, MI, DestVirtReg);
- MF->getRegInfo().setPhysRegUsed(DestPhysReg);
- markVirtRegModified(DestVirtReg);
- getVirtRegLastUse(DestVirtReg) = std::make_pair((MachineInstr*)0, 0);
- DOUT << " Assigning " << TRI->getName(DestPhysReg)
- << " to %reg" << DestVirtReg << "\n";
- MI->getOperand(i).setReg(DestPhysReg); // Assign the output register
- }
- }
-
- // If this instruction defines any registers that are immediately dead,
- // kill them now.
- //
- for (unsigned i = 0, e = DeadDefs.size(); i != e; ++i) {
- unsigned VirtReg = DeadDefs[i];
- unsigned PhysReg = VirtReg;
- if (TargetRegisterInfo::isVirtualRegister(VirtReg)) {
- unsigned &PhysRegSlot = getVirt2PhysRegMapSlot(VirtReg);
- PhysReg = PhysRegSlot;
- assert(PhysReg != 0);
- PhysRegSlot = 0;
- } else if (PhysRegsUsed[PhysReg] == -2) {
- // Unallocatable register dead, ignore.
- continue;
- }
-
- if (PhysReg) {
- DOUT << " Register " << TRI->getName(PhysReg)
- << " [%reg" << VirtReg
- << "] is never used, removing it frame live list\n";
- removePhysReg(PhysReg);
- for (const unsigned *AliasSet = TRI->getAliasSet(PhysReg);
- *AliasSet; ++AliasSet) {
- if (PhysRegsUsed[*AliasSet] != -2) {
- DOUT << " Register " << TRI->getName(*AliasSet)
- << " [%reg" << *AliasSet
- << "] is never used, removing it frame live list\n";
- removePhysReg(*AliasSet);
- }
- }
- }
- }
-
- // Finally, if this is a noop copy instruction, zap it.
- unsigned SrcReg, DstReg;
- if (TII.isMoveInstr(*MI, SrcReg, DstReg) && SrcReg == DstReg)
- MBB.erase(MI);
- }
-
- MachineBasicBlock::iterator MI = MBB.getFirstTerminator();
-
- // Spill all physical registers holding virtual registers now.
- for (unsigned i = 0, e = TRI->getNumRegs(); i != e; ++i)
- if (PhysRegsUsed[i] != -1 && PhysRegsUsed[i] != -2) {
- if (unsigned VirtReg = PhysRegsUsed[i])
- spillVirtReg(MBB, MI, VirtReg, i);
- else
- removePhysReg(i);
- }
-
-#if 0
- // This checking code is very expensive.
- bool AllOk = true;
- for (unsigned i = TargetRegisterInfo::FirstVirtualRegister,
- e = MF->getRegInfo().getLastVirtReg(); i <= e; ++i)
- if (unsigned PR = Virt2PhysRegMap[i]) {
- cerr << "Register still mapped: " << i << " -> " << PR << "\n";
- AllOk = false;
- }
- assert(AllOk && "Virtual registers still in phys regs?");
-#endif
-
- // Clear any physical register which appear live at the end of the basic
- // block, but which do not hold any virtual registers. e.g., the stack
- // pointer.
- PhysRegsUseOrder.clear();
-}
-
-
-/// runOnMachineFunction - Register allocate the whole function
-///
-bool RALocal::runOnMachineFunction(MachineFunction &Fn) {
- DOUT << "Machine Function " << "\n";
- MF = &Fn;
- TM = &Fn.getTarget();
- TRI = TM->getRegisterInfo();
- TII = TM->getInstrInfo();
-
- PhysRegsUsed.assign(TRI->getNumRegs(), -1);
-
- // At various places we want to efficiently check to see whether a register
- // is allocatable. To handle this, we mark all unallocatable registers as
- // being pinned down, permanently.
- {
- BitVector Allocable = TRI->getAllocatableSet(Fn);
- for (unsigned i = 0, e = Allocable.size(); i != e; ++i)
- if (!Allocable[i])
- PhysRegsUsed[i] = -2; // Mark the reg unallocable.
- }
-
- // initialize the virtual->physical register map to have a 'null'
- // mapping for all virtual registers
- unsigned LastVirtReg = MF->getRegInfo().getLastVirtReg();
- Virt2PhysRegMap.grow(LastVirtReg);
- Virt2LastUseMap.grow(LastVirtReg);
- VirtRegModified.resize(LastVirtReg+1-TargetRegisterInfo::FirstVirtualRegister);
-
- // Loop over all of the basic blocks, eliminating virtual register references
- for (MachineFunction::iterator MBB = Fn.begin(), MBBe = Fn.end();
- MBB != MBBe; ++MBB)
- AllocateBasicBlock(*MBB);
-
- StackSlotForVirtReg.clear();
- PhysRegsUsed.clear();
- VirtRegModified.clear();
- Virt2PhysRegMap.clear();
- Virt2LastUseMap.clear();
- return true;
-}
-
-FunctionPass *llvm::createLocalRegisterAllocator() {
- return new RALocal();
-}
diff --git a/release_23/lib/CodeGen/RegAllocSimple.cpp b/release_23/lib/CodeGen/RegAllocSimple.cpp
deleted file mode 100644
index 081edd8d5eb8..000000000000
--- a/release_23/lib/CodeGen/RegAllocSimple.cpp
+++ /dev/null
@@ -1,256 +0,0 @@
-//===-- RegAllocSimple.cpp - A simple generic register allocator ----------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements a simple register allocator. *Very* simple: It immediate
-// spills every value right after it is computed, and it reloads all used
-// operands from the spill area to temporary registers before each instruction.
-// It does not keep values in registers across instructions.
-//
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "regalloc"
-#include "llvm/CodeGen/Passes.h"
-#include "llvm/CodeGen/MachineFunctionPass.h"
-#include "llvm/CodeGen/MachineInstr.h"
-#include "llvm/CodeGen/MachineFrameInfo.h"
-#include "llvm/CodeGen/MachineRegisterInfo.h"
-#include "llvm/CodeGen/RegAllocRegistry.h"
-#include "llvm/Target/TargetInstrInfo.h"
-#include "llvm/Target/TargetMachine.h"
-#include "llvm/Support/Debug.h"
-#include "llvm/Support/Compiler.h"
-#include "llvm/ADT/Statistic.h"
-#include "llvm/ADT/STLExtras.h"
-#include <map>
-using namespace llvm;
-
-STATISTIC(NumStores, "Number of stores added");
-STATISTIC(NumLoads , "Number of loads added");
-
-namespace {
- static RegisterRegAlloc
- simpleRegAlloc("simple", " simple register allocator",
- createSimpleRegisterAllocator);
-
- class VISIBILITY_HIDDEN RegAllocSimple : public MachineFunctionPass {
- public:
- static char ID;
- RegAllocSimple() : MachineFunctionPass((intptr_t)&ID) {}
- private:
- MachineFunction *MF;
- const TargetMachine *TM;
- const TargetRegisterInfo *TRI;
-
- // StackSlotForVirtReg - Maps SSA Regs => frame index on the stack where
- // these values are spilled
- std::map<unsigned, int> StackSlotForVirtReg;
-
- // RegsUsed - Keep track of what registers are currently in use. This is a
- // bitset.
- std::vector<bool> RegsUsed;
-
- // RegClassIdx - Maps RegClass => which index we can take a register
- // from. Since this is a simple register allocator, when we need a register
- // of a certain class, we just take the next available one.
- std::map<const TargetRegisterClass*, unsigned> RegClassIdx;
-
- public:
- virtual const char *getPassName() const {
- return "Simple Register Allocator";
- }
-
- /// runOnMachineFunction - Register allocate the whole function
- bool runOnMachineFunction(MachineFunction &Fn);
-
- virtual void getAnalysisUsage(AnalysisUsage &AU) const {
- AU.addRequiredID(PHIEliminationID); // Eliminate PHI nodes
- MachineFunctionPass::getAnalysisUsage(AU);
- }
- private:
- /// AllocateBasicBlock - Register allocate the specified basic block.
- void AllocateBasicBlock(MachineBasicBlock &MBB);
-
- /// getStackSpaceFor - This returns the offset of the specified virtual
- /// register on the stack, allocating space if necessary.
- int getStackSpaceFor(unsigned VirtReg, const TargetRegisterClass *RC);
-
- /// Given a virtual register, return a compatible physical register that is
- /// currently unused.
- ///
- /// Side effect: marks that register as being used until manually cleared
- ///
- unsigned getFreeReg(unsigned virtualReg);
-
- /// Moves value from memory into that register
- unsigned reloadVirtReg(MachineBasicBlock &MBB,
- MachineBasicBlock::iterator I, unsigned VirtReg);
-
- /// Saves reg value on the stack (maps virtual register to stack value)
- void spillVirtReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator I,
- unsigned VirtReg, unsigned PhysReg);
- };
- char RegAllocSimple::ID = 0;
-}
-
-/// getStackSpaceFor - This allocates space for the specified virtual
-/// register to be held on the stack.
-int RegAllocSimple::getStackSpaceFor(unsigned VirtReg,
- const TargetRegisterClass *RC) {
- // Find the location VirtReg would belong...
- std::map<unsigned, int>::iterator I =
- StackSlotForVirtReg.lower_bound(VirtReg);
-
- if (I != StackSlotForVirtReg.end() && I->first == VirtReg)
- return I->second; // Already has space allocated?
-
- // Allocate a new stack object for this spill location...
- int FrameIdx = MF->getFrameInfo()->CreateStackObject(RC->getSize(),
- RC->getAlignment());
-
- // Assign the slot...
- StackSlotForVirtReg.insert(I, std::make_pair(VirtReg, FrameIdx));
-
- return FrameIdx;
-}
-
-unsigned RegAllocSimple::getFreeReg(unsigned virtualReg) {
- const TargetRegisterClass* RC = MF->getRegInfo().getRegClass(virtualReg);
- TargetRegisterClass::iterator RI = RC->allocation_order_begin(*MF);
- TargetRegisterClass::iterator RE = RC->allocation_order_end(*MF);
-
- while (1) {
- unsigned regIdx = RegClassIdx[RC]++;
- assert(RI+regIdx != RE && "Not enough registers!");
- unsigned PhysReg = *(RI+regIdx);
-
- if (!RegsUsed[PhysReg]) {
- MF->getRegInfo().setPhysRegUsed(PhysReg);
- return PhysReg;
- }
- }
-}
-
-unsigned RegAllocSimple::reloadVirtReg(MachineBasicBlock &MBB,
- MachineBasicBlock::iterator I,
- unsigned VirtReg) {
- const TargetRegisterClass* RC = MF->getRegInfo().getRegClass(VirtReg);
- int FrameIdx = getStackSpaceFor(VirtReg, RC);
- unsigned PhysReg = getFreeReg(VirtReg);
-
- // Add move instruction(s)
- ++NumLoads;
- const TargetInstrInfo* TII = MBB.getParent()->getTarget().getInstrInfo();
- TII->loadRegFromStackSlot(MBB, I, PhysReg, FrameIdx, RC);
- return PhysReg;
-}
-
-void RegAllocSimple::spillVirtReg(MachineBasicBlock &MBB,
- MachineBasicBlock::iterator I,
- unsigned VirtReg, unsigned PhysReg) {
- const TargetRegisterClass* RC = MF->getRegInfo().getRegClass(VirtReg);
- const TargetInstrInfo* TII = MBB.getParent()->getTarget().getInstrInfo();
-
- int FrameIdx = getStackSpaceFor(VirtReg, RC);
-
- // Add move instruction(s)
- ++NumStores;
- TII->storeRegToStackSlot(MBB, I, PhysReg, true, FrameIdx, RC);
-}
-
-
-void RegAllocSimple::AllocateBasicBlock(MachineBasicBlock &MBB) {
- // loop over each instruction
- for (MachineBasicBlock::iterator MI = MBB.begin(); MI != MBB.end(); ++MI) {
- // Made to combat the incorrect allocation of r2 = add r1, r1
- std::map<unsigned, unsigned> Virt2PhysRegMap;
-
- RegsUsed.resize(TRI->getNumRegs());
-
- // This is a preliminary pass that will invalidate any registers that are
- // used by the instruction (including implicit uses).
- const TargetInstrDesc &Desc = MI->getDesc();
- const unsigned *Regs;
- if (Desc.ImplicitUses) {
- for (Regs = Desc.ImplicitUses; *Regs; ++Regs)
- RegsUsed[*Regs] = true;
- }
-
- if (Desc.ImplicitDefs) {
- for (Regs = Desc.ImplicitDefs; *Regs; ++Regs) {
- RegsUsed[*Regs] = true;
- MF->getRegInfo().setPhysRegUsed(*Regs);
- }
- }
-
- // Loop over uses, move from memory into registers.
- for (int i = MI->getNumOperands() - 1; i >= 0; --i) {
- MachineOperand &op = MI->getOperand(i);
-
- if (op.isRegister() && op.getReg() &&
- TargetRegisterInfo::isVirtualRegister(op.getReg())) {
- unsigned virtualReg = (unsigned) op.getReg();
- DOUT << "op: " << op << "\n";
- DOUT << "\t inst[" << i << "]: ";
- DEBUG(MI->print(*cerr.stream(), TM));
-
- // make sure the same virtual register maps to the same physical
- // register in any given instruction
- unsigned physReg = Virt2PhysRegMap[virtualReg];
- if (physReg == 0) {
- if (op.isDef()) {
- int TiedOp = Desc.findTiedToSrcOperand(i);
- if (TiedOp == -1) {
- physReg = getFreeReg(virtualReg);
- } else {
- // must be same register number as the source operand that is
- // tied to. This maps a = b + c into b = b + c, and saves b into
- // a's spot.
- assert(MI->getOperand(TiedOp).isRegister() &&
- MI->getOperand(TiedOp).getReg() &&
- MI->getOperand(TiedOp).isUse() &&
- "Two address instruction invalid!");
-
- physReg = MI->getOperand(TiedOp).getReg();
- }
- spillVirtReg(MBB, next(MI), virtualReg, physReg);
- } else {
- physReg = reloadVirtReg(MBB, MI, virtualReg);
- Virt2PhysRegMap[virtualReg] = physReg;
- }
- }
- MI->getOperand(i).setReg(physReg);
- DOUT << "virt: " << virtualReg << ", phys: " << op.getReg() << "\n";
- }
- }
- RegClassIdx.clear();
- RegsUsed.clear();
- }
-}
-
-
-/// runOnMachineFunction - Register allocate the whole function
-///
-bool RegAllocSimple::runOnMachineFunction(MachineFunction &Fn) {
- DOUT << "Machine Function\n";
- MF = &Fn;
- TM = &MF->getTarget();
- TRI = TM->getRegisterInfo();
-
- // Loop over all of the basic blocks, eliminating virtual register references
- for (MachineFunction::iterator MBB = Fn.begin(), MBBe = Fn.end();
- MBB != MBBe; ++MBB)
- AllocateBasicBlock(*MBB);
-
- StackSlotForVirtReg.clear();
- return true;
-}
-
-FunctionPass *llvm::createSimpleRegisterAllocator() {
- return new RegAllocSimple();
-}
diff --git a/release_23/lib/CodeGen/RegisterCoalescer.cpp b/release_23/lib/CodeGen/RegisterCoalescer.cpp
deleted file mode 100644
index 9d25d2af890b..000000000000
--- a/release_23/lib/CodeGen/RegisterCoalescer.cpp
+++ /dev/null
@@ -1,43 +0,0 @@
-//===- RegisterCoalescer.cpp - Generic Register Coalescing Interface -------==//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the generic RegisterCoalescer interface which
-// is used as the common interface used by all clients and
-// implementations of register coalescing.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/CodeGen/RegisterCoalescer.h"
-#include "llvm/CodeGen/LiveIntervalAnalysis.h"
-#include "llvm/CodeGen/MachineInstr.h"
-#include "llvm/Target/TargetRegisterInfo.h"
-#include "llvm/Pass.h"
-
-using namespace llvm;
-
-// Register the RegisterCoalescer interface, providing a nice name to refer to.
-namespace {
- RegisterAnalysisGroup<RegisterCoalescer> Z("Register Coalescer");
-}
-char RegisterCoalescer::ID = 0;
-
-// RegisterCoalescer destructor: DO NOT move this to the header file
-// for RegisterCoalescer or else clients of the RegisterCoalescer
-// class may not depend on the RegisterCoalescer.o file in the current
-// .a file, causing alias analysis support to not be included in the
-// tool correctly!
-//
-RegisterCoalescer::~RegisterCoalescer() {}
-
-// Because of the way .a files work, we must force the SimpleRC
-// implementation to be pulled in if the RegisterCoalescer classes are
-// pulled in. Otherwise we run the risk of RegisterCoalescer being
-// used, but the default implementation not being linked into the tool
-// that uses it.
-DEFINING_FILE_FOR(RegisterCoalescer)
diff --git a/release_23/lib/CodeGen/RegisterScavenging.cpp b/release_23/lib/CodeGen/RegisterScavenging.cpp
deleted file mode 100644
index 1d9effb11085..000000000000
--- a/release_23/lib/CodeGen/RegisterScavenging.cpp
+++ /dev/null
@@ -1,412 +0,0 @@
-//===-- RegisterScavenging.cpp - Machine register scavenging --------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the machine register scavenger. It can provide
-// information, such as unused registers, at any point in a machine basic block.
-// It also provides a mechanism to make registers available by evicting them to
-// spill slots.
-//
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "reg-scavenging"
-#include "llvm/CodeGen/RegisterScavenging.h"
-#include "llvm/CodeGen/MachineFunction.h"
-#include "llvm/CodeGen/MachineBasicBlock.h"
-#include "llvm/CodeGen/MachineInstr.h"
-#include "llvm/CodeGen/MachineRegisterInfo.h"
-#include "llvm/Target/TargetRegisterInfo.h"
-#include "llvm/Target/TargetInstrInfo.h"
-#include "llvm/Target/TargetMachine.h"
-#include "llvm/ADT/SmallPtrSet.h"
-#include "llvm/ADT/STLExtras.h"
-using namespace llvm;
-
-/// RedefinesSuperRegPart - Return true if the specified register is redefining
-/// part of a super-register.
-static bool RedefinesSuperRegPart(const MachineInstr *MI, unsigned SubReg,
- const TargetRegisterInfo *TRI) {
- bool SeenSuperUse = false;
- bool SeenSuperDef = false;
- for (unsigned i = 0, e = MI->getNumOperands(); i != e; ++i) {
- const MachineOperand &MO = MI->getOperand(i);
- if (!MO.isRegister())
- continue;
- if (TRI->isSuperRegister(SubReg, MO.getReg()))
- if (MO.isUse())
- SeenSuperUse = true;
- else if (MO.isImplicit())
- SeenSuperDef = true;
- }
-
- return SeenSuperDef && SeenSuperUse;
-}
-
-static bool RedefinesSuperRegPart(const MachineInstr *MI,
- const MachineOperand &MO,
- const TargetRegisterInfo *TRI) {
- assert(MO.isRegister() && MO.isDef() && "Not a register def!");
- return RedefinesSuperRegPart(MI, MO.getReg(), TRI);
-}
-
-/// setUsed - Set the register and its sub-registers as being used.
-void RegScavenger::setUsed(unsigned Reg, bool ImpDef) {
- RegsAvailable.reset(Reg);
- ImplicitDefed[Reg] = ImpDef;
-
- for (const unsigned *SubRegs = TRI->getSubRegisters(Reg);
- unsigned SubReg = *SubRegs; ++SubRegs) {
- RegsAvailable.reset(SubReg);
- ImplicitDefed[SubReg] = ImpDef;
- }
-}
-
-/// setUnused - Set the register and its sub-registers as being unused.
-void RegScavenger::setUnused(unsigned Reg, const MachineInstr *MI) {
- RegsAvailable.set(Reg);
- ImplicitDefed.reset(Reg);
-
- for (const unsigned *SubRegs = TRI->getSubRegisters(Reg);
- unsigned SubReg = *SubRegs; ++SubRegs)
- if (!RedefinesSuperRegPart(MI, Reg, TRI)) {
- RegsAvailable.set(SubReg);
- ImplicitDefed.reset(SubReg);
- }
-}
-
-void RegScavenger::enterBasicBlock(MachineBasicBlock *mbb) {
- const MachineFunction &MF = *mbb->getParent();
- const TargetMachine &TM = MF.getTarget();
- TII = TM.getInstrInfo();
- TRI = TM.getRegisterInfo();
- MRI = &MF.getRegInfo();
-
- assert((NumPhysRegs == 0 || NumPhysRegs == TRI->getNumRegs()) &&
- "Target changed?");
-
- if (!MBB) {
- NumPhysRegs = TRI->getNumRegs();
- RegsAvailable.resize(NumPhysRegs);
- ImplicitDefed.resize(NumPhysRegs);
-
- // Create reserved registers bitvector.
- ReservedRegs = TRI->getReservedRegs(MF);
-
- // Create callee-saved registers bitvector.
- CalleeSavedRegs.resize(NumPhysRegs);
- const unsigned *CSRegs = TRI->getCalleeSavedRegs();
- if (CSRegs != NULL)
- for (unsigned i = 0; CSRegs[i]; ++i)
- CalleeSavedRegs.set(CSRegs[i]);
- }
-
- MBB = mbb;
- ScavengedReg = 0;
- ScavengedRC = NULL;
-
- // All registers started out unused.
- RegsAvailable.set();
-
- // Reserved registers are always used.
- RegsAvailable ^= ReservedRegs;
-
- // Live-in registers are in use.
- if (!MBB->livein_empty())
- for (MachineBasicBlock::const_livein_iterator I = MBB->livein_begin(),
- E = MBB->livein_end(); I != E; ++I)
- setUsed(*I);
-
- Tracking = false;
-}
-
-void RegScavenger::restoreScavengedReg() {
- if (!ScavengedReg)
- return;
-
- TII->loadRegFromStackSlot(*MBB, MBBI, ScavengedReg,
- ScavengingFrameIndex, ScavengedRC);
- MachineBasicBlock::iterator II = prior(MBBI);
- TRI->eliminateFrameIndex(II, 0, this);
- setUsed(ScavengedReg);
- ScavengedReg = 0;
- ScavengedRC = NULL;
-}
-
-/// isLiveInButUnusedBefore - Return true if register is livein the MBB not
-/// not used before it reaches the MI that defines register.
-static bool isLiveInButUnusedBefore(unsigned Reg, MachineInstr *MI,
- MachineBasicBlock *MBB,
- const TargetRegisterInfo *TRI,
- MachineRegisterInfo* MRI) {
- // First check if register is livein.
- bool isLiveIn = false;
- for (MachineBasicBlock::const_livein_iterator I = MBB->livein_begin(),
- E = MBB->livein_end(); I != E; ++I)
- if (Reg == *I || TRI->isSuperRegister(Reg, *I)) {
- isLiveIn = true;
- break;
- }
- if (!isLiveIn)
- return false;
-
- // Is there any use of it before the specified MI?
- SmallPtrSet<MachineInstr*, 4> UsesInMBB;
- for (MachineRegisterInfo::use_iterator UI = MRI->use_begin(Reg),
- UE = MRI->use_end(); UI != UE; ++UI) {
- MachineInstr *UseMI = &*UI;
- if (UseMI->getParent() == MBB)
- UsesInMBB.insert(UseMI);
- }
- if (UsesInMBB.empty())
- return true;
-
- for (MachineBasicBlock::iterator I = MBB->begin(), E = MI; I != E; ++I)
- if (UsesInMBB.count(&*I))
- return false;
- return true;
-}
-
-void RegScavenger::forward() {
- // Move ptr forward.
- if (!Tracking) {
- MBBI = MBB->begin();
- Tracking = true;
- } else {
- assert(MBBI != MBB->end() && "Already at the end of the basic block!");
- MBBI = next(MBBI);
- }
-
- MachineInstr *MI = MBBI;
- const TargetInstrDesc &TID = MI->getDesc();
-
- // Reaching a terminator instruction. Restore a scavenged register (which
- // must be life out.
- if (TID.isTerminator())
- restoreScavengedReg();
-
- // Process uses first.
- BitVector ChangedRegs(NumPhysRegs);
- for (unsigned i = 0, e = MI->getNumOperands(); i != e; ++i) {
- const MachineOperand &MO = MI->getOperand(i);
- if (!MO.isRegister() || !MO.isUse())
- continue;
-
- unsigned Reg = MO.getReg();
- if (Reg == 0) continue;
-
- if (!isUsed(Reg)) {
- // Register has been scavenged. Restore it!
- if (Reg != ScavengedReg)
- assert(false && "Using an undefined register!");
- else
- restoreScavengedReg();
- }
-
- if (MO.isKill() && !isReserved(Reg)) {
- ChangedRegs.set(Reg);
-
- // Mark sub-registers as changed if they aren't defined in the same
- // instruction.
- for (const unsigned *SubRegs = TRI->getSubRegisters(Reg);
- unsigned SubReg = *SubRegs; ++SubRegs)
- ChangedRegs.set(SubReg);
- }
- }
-
- // Change states of all registers after all the uses are processed to guard
- // against multiple uses.
- setUnused(ChangedRegs);
-
- // Process defs.
- bool IsImpDef = MI->getOpcode() == TargetInstrInfo::IMPLICIT_DEF;
- for (unsigned i = 0, e = MI->getNumOperands(); i != e; ++i) {
- const MachineOperand &MO = MI->getOperand(i);
-
- if (!MO.isRegister() || !MO.isDef())
- continue;
-
- unsigned Reg = MO.getReg();
-
- // If it's dead upon def, then it is now free.
- if (MO.isDead()) {
- setUnused(Reg, MI);
- continue;
- }
-
- // Skip two-address destination operand.
- if (TID.findTiedToSrcOperand(i) != -1) {
- assert(isUsed(Reg) && "Using an undefined register!");
- continue;
- }
-
- // Skip is this is merely redefining part of a super-register.
- if (RedefinesSuperRegPart(MI, MO, TRI))
- continue;
-
- // Implicit def is allowed to "re-define" any register. Similarly,
- // implicitly defined registers can be clobbered.
- assert((isReserved(Reg) || isUnused(Reg) ||
- IsImpDef || isImplicitlyDefined(Reg) ||
- isLiveInButUnusedBefore(Reg, MI, MBB, TRI, MRI)) &&
- "Re-defining a live register!");
- setUsed(Reg, IsImpDef);
- }
-}
-
-void RegScavenger::backward() {
- assert(Tracking && "Not tracking states!");
- assert(MBBI != MBB->begin() && "Already at start of basic block!");
- // Move ptr backward.
- MBBI = prior(MBBI);
-
- MachineInstr *MI = MBBI;
- // Process defs first.
- const TargetInstrDesc &TID = MI->getDesc();
- for (unsigned i = 0, e = MI->getNumOperands(); i != e; ++i) {
- const MachineOperand &MO = MI->getOperand(i);
- if (!MO.isRegister() || !MO.isDef())
- continue;
- // Skip two-address destination operand.
- if (TID.findTiedToSrcOperand(i) != -1)
- continue;
- unsigned Reg = MO.getReg();
- assert(isUsed(Reg));
- if (!isReserved(Reg))
- setUnused(Reg, MI);
- }
-
- // Process uses.
- BitVector ChangedRegs(NumPhysRegs);
- for (unsigned i = 0, e = MI->getNumOperands(); i != e; ++i) {
- const MachineOperand &MO = MI->getOperand(i);
- if (!MO.isRegister() || !MO.isUse())
- continue;
- unsigned Reg = MO.getReg();
- if (Reg == 0)
- continue;
- assert(isUnused(Reg) || isReserved(Reg));
- ChangedRegs.set(Reg);
-
- // Set the sub-registers as "used".
- for (const unsigned *SubRegs = TRI->getSubRegisters(Reg);
- unsigned SubReg = *SubRegs; ++SubRegs)
- ChangedRegs.set(SubReg);
- }
- setUsed(ChangedRegs);
-}
-
-void RegScavenger::getRegsUsed(BitVector &used, bool includeReserved) {
- if (includeReserved)
- used = ~RegsAvailable;
- else
- used = ~RegsAvailable & ~ReservedRegs;
-}
-
-/// CreateRegClassMask - Set the bits that represent the registers in the
-/// TargetRegisterClass.
-static void CreateRegClassMask(const TargetRegisterClass *RC, BitVector &Mask) {
- for (TargetRegisterClass::iterator I = RC->begin(), E = RC->end(); I != E;
- ++I)
- Mask.set(*I);
-}
-
-unsigned RegScavenger::FindUnusedReg(const TargetRegisterClass *RegClass,
- const BitVector &Candidates) const {
- // Mask off the registers which are not in the TargetRegisterClass.
- BitVector RegsAvailableCopy(NumPhysRegs, false);
- CreateRegClassMask(RegClass, RegsAvailableCopy);
- RegsAvailableCopy &= RegsAvailable;
-
- // Restrict the search to candidates.
- RegsAvailableCopy &= Candidates;
-
- // Returns the first unused (bit is set) register, or 0 is none is found.
- int Reg = RegsAvailableCopy.find_first();
- return (Reg == -1) ? 0 : Reg;
-}
-
-unsigned RegScavenger::FindUnusedReg(const TargetRegisterClass *RegClass,
- bool ExCalleeSaved) const {
- // Mask off the registers which are not in the TargetRegisterClass.
- BitVector RegsAvailableCopy(NumPhysRegs, false);
- CreateRegClassMask(RegClass, RegsAvailableCopy);
- RegsAvailableCopy &= RegsAvailable;
-
- // If looking for a non-callee-saved register, mask off all the callee-saved
- // registers.
- if (ExCalleeSaved)
- RegsAvailableCopy &= ~CalleeSavedRegs;
-
- // Returns the first unused (bit is set) register, or 0 is none is found.
- int Reg = RegsAvailableCopy.find_first();
- return (Reg == -1) ? 0 : Reg;
-}
-
-/// calcDistanceToUse - Calculate the distance to the first use of the
-/// specified register.
-static unsigned calcDistanceToUse(MachineBasicBlock *MBB,
- MachineBasicBlock::iterator I, unsigned Reg,
- const TargetRegisterInfo *TRI) {
- unsigned Dist = 0;
- I = next(I);
- while (I != MBB->end()) {
- Dist++;
- if (I->readsRegister(Reg, TRI))
- return Dist;
- I = next(I);
- }
- return Dist + 1;
-}
-
-unsigned RegScavenger::scavengeRegister(const TargetRegisterClass *RC,
- MachineBasicBlock::iterator I,
- int SPAdj) {
- assert(ScavengingFrameIndex >= 0 &&
- "Cannot scavenge a register without an emergency spill slot!");
-
- // Mask off the registers which are not in the TargetRegisterClass.
- BitVector Candidates(NumPhysRegs, false);
- CreateRegClassMask(RC, Candidates);
- Candidates ^= ReservedRegs; // Do not include reserved registers.
-
- // Exclude all the registers being used by the instruction.
- for (unsigned i = 0, e = I->getNumOperands(); i != e; ++i) {
- MachineOperand &MO = I->getOperand(i);
- if (MO.isRegister())
- Candidates.reset(MO.getReg());
- }
-
- // Find the register whose use is furthest away.
- unsigned SReg = 0;
- unsigned MaxDist = 0;
- int Reg = Candidates.find_first();
- while (Reg != -1) {
- unsigned Dist = calcDistanceToUse(MBB, I, Reg, TRI);
- if (Dist >= MaxDist) {
- MaxDist = Dist;
- SReg = Reg;
- }
- Reg = Candidates.find_next(Reg);
- }
-
- if (ScavengedReg != 0) {
- // First restore previously scavenged register.
- TII->loadRegFromStackSlot(*MBB, I, ScavengedReg,
- ScavengingFrameIndex, ScavengedRC);
- MachineBasicBlock::iterator II = prior(I);
- TRI->eliminateFrameIndex(II, SPAdj, this);
- }
-
- TII->storeRegToStackSlot(*MBB, I, SReg, true, ScavengingFrameIndex, RC);
- MachineBasicBlock::iterator II = prior(I);
- TRI->eliminateFrameIndex(II, SPAdj, this);
- ScavengedReg = SReg;
- ScavengedRC = RC;
-
- return SReg;
-}
diff --git a/release_23/lib/CodeGen/SelectionDAG/CallingConvLower.cpp b/release_23/lib/CodeGen/SelectionDAG/CallingConvLower.cpp
deleted file mode 100644
index 667870d4521b..000000000000
--- a/release_23/lib/CodeGen/SelectionDAG/CallingConvLower.cpp
+++ /dev/null
@@ -1,120 +0,0 @@
-//===-- llvm/CallingConvLower.cpp - Calling Conventions -------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the CCState class, used for lowering and implementing
-// calling conventions.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/CodeGen/CallingConvLower.h"
-#include "llvm/CodeGen/SelectionDAGNodes.h"
-#include "llvm/Target/TargetRegisterInfo.h"
-#include "llvm/Target/TargetData.h"
-#include "llvm/Target/TargetMachine.h"
-using namespace llvm;
-
-CCState::CCState(unsigned CC, bool isVarArg, const TargetMachine &tm,
- SmallVector<CCValAssign, 16> &locs)
- : CallingConv(CC), IsVarArg(isVarArg), TM(tm),
- TRI(*TM.getRegisterInfo()), Locs(locs) {
- // No stack is used.
- StackOffset = 0;
-
- UsedRegs.resize(TRI.getNumRegs());
-}
-
-// HandleByVal - Allocate a stack slot large enough to pass an argument by
-// value. The size and alignment information of the argument is encoded in its
-// parameter attribute.
-void CCState::HandleByVal(unsigned ValNo, MVT::ValueType ValVT,
- MVT::ValueType LocVT, CCValAssign::LocInfo LocInfo,
- int MinSize, int MinAlign,
- ISD::ArgFlagsTy ArgFlags) {
- unsigned Align = ArgFlags.getByValAlign();
- unsigned Size = ArgFlags.getByValSize();
- if (MinSize > (int)Size)
- Size = MinSize;
- if (MinAlign > (int)Align)
- Align = MinAlign;
- unsigned Offset = AllocateStack(Size, Align);
-
- addLoc(CCValAssign::getMem(ValNo, ValVT, Offset, LocVT, LocInfo));
-}
-
-/// MarkAllocated - Mark a register and all of its aliases as allocated.
-void CCState::MarkAllocated(unsigned Reg) {
- UsedRegs[Reg/32] |= 1 << (Reg&31);
-
- if (const unsigned *RegAliases = TRI.getAliasSet(Reg))
- for (; (Reg = *RegAliases); ++RegAliases)
- UsedRegs[Reg/32] |= 1 << (Reg&31);
-}
-
-/// AnalyzeFormalArguments - Analyze an ISD::FORMAL_ARGUMENTS node,
-/// incorporating info about the formals into this state.
-void CCState::AnalyzeFormalArguments(SDNode *TheArgs, CCAssignFn Fn) {
- unsigned NumArgs = TheArgs->getNumValues()-1;
-
- for (unsigned i = 0; i != NumArgs; ++i) {
- MVT::ValueType ArgVT = TheArgs->getValueType(i);
- ISD::ArgFlagsTy ArgFlags =
- cast<ARG_FLAGSSDNode>(TheArgs->getOperand(3+i))->getArgFlags();
- if (Fn(i, ArgVT, ArgVT, CCValAssign::Full, ArgFlags, *this)) {
- cerr << "Formal argument #" << i << " has unhandled type "
- << MVT::getValueTypeString(ArgVT) << "\n";
- abort();
- }
- }
-}
-
-/// AnalyzeReturn - Analyze the returned values of an ISD::RET node,
-/// incorporating info about the result values into this state.
-void CCState::AnalyzeReturn(SDNode *TheRet, CCAssignFn Fn) {
- // Determine which register each value should be copied into.
- for (unsigned i = 0, e = TheRet->getNumOperands() / 2; i != e; ++i) {
- MVT::ValueType VT = TheRet->getOperand(i*2+1).getValueType();
- ISD::ArgFlagsTy ArgFlags =
- cast<ARG_FLAGSSDNode>(TheRet->getOperand(i*2+2))->getArgFlags();
- if (Fn(i, VT, VT, CCValAssign::Full, ArgFlags, *this)){
- cerr << "Return operand #" << i << " has unhandled type "
- << MVT::getValueTypeString(VT) << "\n";
- abort();
- }
- }
-}
-
-
-/// AnalyzeCallOperands - Analyze an ISD::CALL node, incorporating info
-/// about the passed values into this state.
-void CCState::AnalyzeCallOperands(SDNode *TheCall, CCAssignFn Fn) {
- unsigned NumOps = (TheCall->getNumOperands() - 5) / 2;
- for (unsigned i = 0; i != NumOps; ++i) {
- MVT::ValueType ArgVT = TheCall->getOperand(5+2*i).getValueType();
- ISD::ArgFlagsTy ArgFlags =
- cast<ARG_FLAGSSDNode>(TheCall->getOperand(5+2*i+1))->getArgFlags();
- if (Fn(i, ArgVT, ArgVT, CCValAssign::Full, ArgFlags, *this)) {
- cerr << "Call operand #" << i << " has unhandled type "
- << MVT::getValueTypeString(ArgVT) << "\n";
- abort();
- }
- }
-}
-
-/// AnalyzeCallResult - Analyze the return values of an ISD::CALL node,
-/// incorporating info about the passed values into this state.
-void CCState::AnalyzeCallResult(SDNode *TheCall, CCAssignFn Fn) {
- for (unsigned i = 0, e = TheCall->getNumValues() - 1; i != e; ++i) {
- MVT::ValueType VT = TheCall->getValueType(i);
- if (Fn(i, VT, VT, CCValAssign::Full, ISD::ArgFlagsTy(), *this)) {
- cerr << "Call result #" << i << " has unhandled type "
- << MVT::getValueTypeString(VT) << "\n";
- abort();
- }
- }
-}
diff --git a/release_23/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/release_23/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
deleted file mode 100644
index 28f32d3d3b96..000000000000
--- a/release_23/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ /dev/null
@@ -1,5552 +0,0 @@
-//===-- DAGCombiner.cpp - Implement a DAG node combiner -------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This pass combines dag nodes to form fewer, simpler DAG nodes. It can be run
-// both before and after the DAG is legalized.
-//
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "dagcombine"
-#include "llvm/CodeGen/SelectionDAG.h"
-#include "llvm/CodeGen/MachineFunction.h"
-#include "llvm/CodeGen/MachineFrameInfo.h"
-#include "llvm/Analysis/AliasAnalysis.h"
-#include "llvm/Target/TargetData.h"
-#include "llvm/Target/TargetFrameInfo.h"
-#include "llvm/Target/TargetLowering.h"
-#include "llvm/Target/TargetMachine.h"
-#include "llvm/Target/TargetOptions.h"
-#include "llvm/ADT/SmallPtrSet.h"
-#include "llvm/ADT/Statistic.h"
-#include "llvm/Support/Compiler.h"
-#include "llvm/Support/CommandLine.h"
-#include "llvm/Support/Debug.h"
-#include "llvm/Support/MathExtras.h"
-#include <algorithm>
-using namespace llvm;
-
-STATISTIC(NodesCombined , "Number of dag nodes combined");
-STATISTIC(PreIndexedNodes , "Number of pre-indexed nodes created");
-STATISTIC(PostIndexedNodes, "Number of post-indexed nodes created");
-
-namespace {
-#ifndef NDEBUG
- static cl::opt<bool>
- ViewDAGCombine1("view-dag-combine1-dags", cl::Hidden,
- cl::desc("Pop up a window to show dags before the first "
- "dag combine pass"));
- static cl::opt<bool>
- ViewDAGCombine2("view-dag-combine2-dags", cl::Hidden,
- cl::desc("Pop up a window to show dags before the second "
- "dag combine pass"));
-#else
- static const bool ViewDAGCombine1 = false;
- static const bool ViewDAGCombine2 = false;
-#endif
-
- static cl::opt<bool>
- CombinerAA("combiner-alias-analysis", cl::Hidden,
- cl::desc("Turn on alias analysis during testing"));
-
- static cl::opt<bool>
- CombinerGlobalAA("combiner-global-alias-analysis", cl::Hidden,
- cl::desc("Include global information in alias analysis"));
-
-//------------------------------ DAGCombiner ---------------------------------//
-
- class VISIBILITY_HIDDEN DAGCombiner {
- SelectionDAG &DAG;
- TargetLowering &TLI;
- bool AfterLegalize;
-
- // Worklist of all of the nodes that need to be simplified.
- std::vector<SDNode*> WorkList;
-
- // AA - Used for DAG load/store alias analysis.
- AliasAnalysis &AA;
-
- /// AddUsersToWorkList - When an instruction is simplified, add all users of
- /// the instruction to the work lists because they might get more simplified
- /// now.
- ///
- void AddUsersToWorkList(SDNode *N) {
- for (SDNode::use_iterator UI = N->use_begin(), UE = N->use_end();
- UI != UE; ++UI)
- AddToWorkList(UI->getUser());
- }
-
- /// visit - call the node-specific routine that knows how to fold each
- /// particular type of node.
- SDOperand visit(SDNode *N);
-
- public:
- /// AddToWorkList - Add to the work list making sure it's instance is at the
- /// the back (next to be processed.)
- void AddToWorkList(SDNode *N) {
- removeFromWorkList(N);
- WorkList.push_back(N);
- }
-
- /// removeFromWorkList - remove all instances of N from the worklist.
- ///
- void removeFromWorkList(SDNode *N) {
- WorkList.erase(std::remove(WorkList.begin(), WorkList.end(), N),
- WorkList.end());
- }
-
- SDOperand CombineTo(SDNode *N, const SDOperand *To, unsigned NumTo,
- bool AddTo = true);
-
- SDOperand CombineTo(SDNode *N, SDOperand Res, bool AddTo = true) {
- return CombineTo(N, &Res, 1, AddTo);
- }
-
- SDOperand CombineTo(SDNode *N, SDOperand Res0, SDOperand Res1,
- bool AddTo = true) {
- SDOperand To[] = { Res0, Res1 };
- return CombineTo(N, To, 2, AddTo);
- }
-
- private:
-
- /// SimplifyDemandedBits - Check the specified integer node value to see if
- /// it can be simplified or if things it uses can be simplified by bit
- /// propagation. If so, return true.
- bool SimplifyDemandedBits(SDOperand Op) {
- APInt Demanded = APInt::getAllOnesValue(Op.getValueSizeInBits());
- return SimplifyDemandedBits(Op, Demanded);
- }
-
- bool SimplifyDemandedBits(SDOperand Op, const APInt &Demanded);
-
- bool CombineToPreIndexedLoadStore(SDNode *N);
- bool CombineToPostIndexedLoadStore(SDNode *N);
-
-
- /// combine - call the node-specific routine that knows how to fold each
- /// particular type of node. If that doesn't do anything, try the
- /// target-specific DAG combines.
- SDOperand combine(SDNode *N);
-
- // Visitation implementation - Implement dag node combining for different
- // node types. The semantics are as follows:
- // Return Value:
- // SDOperand.Val == 0 - No change was made
- // SDOperand.Val == N - N was replaced, is dead, and is already handled.
- // otherwise - N should be replaced by the returned Operand.
- //
- SDOperand visitTokenFactor(SDNode *N);
- SDOperand visitMERGE_VALUES(SDNode *N);
- SDOperand visitADD(SDNode *N);
- SDOperand visitSUB(SDNode *N);
- SDOperand visitADDC(SDNode *N);
- SDOperand visitADDE(SDNode *N);
- SDOperand visitMUL(SDNode *N);
- SDOperand visitSDIV(SDNode *N);
- SDOperand visitUDIV(SDNode *N);
- SDOperand visitSREM(SDNode *N);
- SDOperand visitUREM(SDNode *N);
- SDOperand visitMULHU(SDNode *N);
- SDOperand visitMULHS(SDNode *N);
- SDOperand visitSMUL_LOHI(SDNode *N);
- SDOperand visitUMUL_LOHI(SDNode *N);
- SDOperand visitSDIVREM(SDNode *N);
- SDOperand visitUDIVREM(SDNode *N);
- SDOperand visitAND(SDNode *N);
- SDOperand visitOR(SDNode *N);
- SDOperand visitXOR(SDNode *N);
- SDOperand SimplifyVBinOp(SDNode *N);
- SDOperand visitSHL(SDNode *N);
- SDOperand visitSRA(SDNode *N);
- SDOperand visitSRL(SDNode *N);
- SDOperand visitCTLZ(SDNode *N);
- SDOperand visitCTTZ(SDNode *N);
- SDOperand visitCTPOP(SDNode *N);
- SDOperand visitSELECT(SDNode *N);
- SDOperand visitSELECT_CC(SDNode *N);
- SDOperand visitSETCC(SDNode *N);
- SDOperand visitSIGN_EXTEND(SDNode *N);
- SDOperand visitZERO_EXTEND(SDNode *N);
- SDOperand visitANY_EXTEND(SDNode *N);
- SDOperand visitSIGN_EXTEND_INREG(SDNode *N);
- SDOperand visitTRUNCATE(SDNode *N);
- SDOperand visitBIT_CONVERT(SDNode *N);
- SDOperand visitFADD(SDNode *N);
- SDOperand visitFSUB(SDNode *N);
- SDOperand visitFMUL(SDNode *N);
- SDOperand visitFDIV(SDNode *N);
- SDOperand visitFREM(SDNode *N);
- SDOperand visitFCOPYSIGN(SDNode *N);
- SDOperand visitSINT_TO_FP(SDNode *N);
- SDOperand visitUINT_TO_FP(SDNode *N);
- SDOperand visitFP_TO_SINT(SDNode *N);
- SDOperand visitFP_TO_UINT(SDNode *N);
- SDOperand visitFP_ROUND(SDNode *N);
- SDOperand visitFP_ROUND_INREG(SDNode *N);
- SDOperand visitFP_EXTEND(SDNode *N);
- SDOperand visitFNEG(SDNode *N);
- SDOperand visitFABS(SDNode *N);
- SDOperand visitBRCOND(SDNode *N);
- SDOperand visitBR_CC(SDNode *N);
- SDOperand visitLOAD(SDNode *N);
- SDOperand visitSTORE(SDNode *N);
- SDOperand visitINSERT_VECTOR_ELT(SDNode *N);
- SDOperand visitEXTRACT_VECTOR_ELT(SDNode *N);
- SDOperand visitBUILD_VECTOR(SDNode *N);
- SDOperand visitCONCAT_VECTORS(SDNode *N);
- SDOperand visitVECTOR_SHUFFLE(SDNode *N);
-
- SDOperand XformToShuffleWithZero(SDNode *N);
- SDOperand ReassociateOps(unsigned Opc, SDOperand LHS, SDOperand RHS);
-
- SDOperand visitShiftByConstant(SDNode *N, unsigned Amt);
-
- bool SimplifySelectOps(SDNode *SELECT, SDOperand LHS, SDOperand RHS);
- SDOperand SimplifyBinOpWithSameOpcodeHands(SDNode *N);
- SDOperand SimplifySelect(SDOperand N0, SDOperand N1, SDOperand N2);
- SDOperand SimplifySelectCC(SDOperand N0, SDOperand N1, SDOperand N2,
- SDOperand N3, ISD::CondCode CC,
- bool NotExtCompare = false);
- SDOperand SimplifySetCC(MVT::ValueType VT, SDOperand N0, SDOperand N1,
- ISD::CondCode Cond, bool foldBooleans = true);
- SDOperand SimplifyNodeWithTwoResults(SDNode *N, unsigned LoOp,
- unsigned HiOp);
- SDOperand ConstantFoldBIT_CONVERTofBUILD_VECTOR(SDNode *, MVT::ValueType);
- SDOperand BuildSDIV(SDNode *N);
- SDOperand BuildUDIV(SDNode *N);
- SDNode *MatchRotate(SDOperand LHS, SDOperand RHS);
- SDOperand ReduceLoadWidth(SDNode *N);
-
- SDOperand GetDemandedBits(SDOperand V, const APInt &Mask);
-
- /// GatherAllAliases - Walk up chain skipping non-aliasing memory nodes,
- /// looking for aliasing nodes and adding them to the Aliases vector.
- void GatherAllAliases(SDNode *N, SDOperand OriginalChain,
- SmallVector<SDOperand, 8> &Aliases);
-
- /// isAlias - Return true if there is any possibility that the two addresses
- /// overlap.
- bool isAlias(SDOperand Ptr1, int64_t Size1,
- const Value *SrcValue1, int SrcValueOffset1,
- SDOperand Ptr2, int64_t Size2,
- const Value *SrcValue2, int SrcValueOffset2);
-
- /// FindAliasInfo - Extracts the relevant alias information from the memory
- /// node. Returns true if the operand was a load.
- bool FindAliasInfo(SDNode *N,
- SDOperand &Ptr, int64_t &Size,
- const Value *&SrcValue, int &SrcValueOffset);
-
- /// FindBetterChain - Walk up chain skipping non-aliasing memory nodes,
- /// looking for a better chain (aliasing node.)
- SDOperand FindBetterChain(SDNode *N, SDOperand Chain);
-
-public:
- DAGCombiner(SelectionDAG &D, AliasAnalysis &A)
- : DAG(D),
- TLI(D.getTargetLoweringInfo()),
- AfterLegalize(false),
- AA(A) {}
-
- /// Run - runs the dag combiner on all nodes in the work list
- void Run(bool RunningAfterLegalize);
- };
-}
-
-
-namespace {
-/// WorkListRemover - This class is a DAGUpdateListener that removes any deleted
-/// nodes from the worklist.
-class VISIBILITY_HIDDEN WorkListRemover :
- public SelectionDAG::DAGUpdateListener {
- DAGCombiner &DC;
-public:
- explicit WorkListRemover(DAGCombiner &dc) : DC(dc) {}
-
- virtual void NodeDeleted(SDNode *N) {
- DC.removeFromWorkList(N);
- }
-
- virtual void NodeUpdated(SDNode *N) {
- // Ignore updates.
- }
-};
-}
-
-//===----------------------------------------------------------------------===//
-// TargetLowering::DAGCombinerInfo implementation
-//===----------------------------------------------------------------------===//
-
-void TargetLowering::DAGCombinerInfo::AddToWorklist(SDNode *N) {
- ((DAGCombiner*)DC)->AddToWorkList(N);
-}
-
-SDOperand TargetLowering::DAGCombinerInfo::
-CombineTo(SDNode *N, const std::vector<SDOperand> &To) {
- return ((DAGCombiner*)DC)->CombineTo(N, &To[0], To.size());
-}
-
-SDOperand TargetLowering::DAGCombinerInfo::
-CombineTo(SDNode *N, SDOperand Res) {
- return ((DAGCombiner*)DC)->CombineTo(N, Res);
-}
-
-
-SDOperand TargetLowering::DAGCombinerInfo::
-CombineTo(SDNode *N, SDOperand Res0, SDOperand Res1) {
- return ((DAGCombiner*)DC)->CombineTo(N, Res0, Res1);
-}
-
-
-//===----------------------------------------------------------------------===//
-// Helper Functions
-//===----------------------------------------------------------------------===//
-
-/// isNegatibleForFree - Return 1 if we can compute the negated form of the
-/// specified expression for the same cost as the expression itself, or 2 if we
-/// can compute the negated form more cheaply than the expression itself.
-static char isNegatibleForFree(SDOperand Op, bool AfterLegalize,
- unsigned Depth = 0) {
- // No compile time optimizations on this type.
- if (Op.getValueType() == MVT::ppcf128)
- return 0;
-
- // fneg is removable even if it has multiple uses.
- if (Op.getOpcode() == ISD::FNEG) return 2;
-
- // Don't allow anything with multiple uses.
- if (!Op.hasOneUse()) return 0;
-
- // Don't recurse exponentially.
- if (Depth > 6) return 0;
-
- switch (Op.getOpcode()) {
- default: return false;
- case ISD::ConstantFP:
- // Don't invert constant FP values after legalize. The negated constant
- // isn't necessarily legal.
- return AfterLegalize ? 0 : 1;
- case ISD::FADD:
- // FIXME: determine better conditions for this xform.
- if (!UnsafeFPMath) return 0;
-
- // -(A+B) -> -A - B
- if (char V = isNegatibleForFree(Op.getOperand(0), AfterLegalize, Depth+1))
- return V;
- // -(A+B) -> -B - A
- return isNegatibleForFree(Op.getOperand(1), AfterLegalize, Depth+1);
- case ISD::FSUB:
- // We can't turn -(A-B) into B-A when we honor signed zeros.
- if (!UnsafeFPMath) return 0;
-
- // -(A-B) -> B-A
- return 1;
-
- case ISD::FMUL:
- case ISD::FDIV:
- if (HonorSignDependentRoundingFPMath()) return 0;
-
- // -(X*Y) -> (-X * Y) or (X*-Y)
- if (char V = isNegatibleForFree(Op.getOperand(0), AfterLegalize, Depth+1))
- return V;
-
- return isNegatibleForFree(Op.getOperand(1), AfterLegalize, Depth+1);
-
- case ISD::FP_EXTEND:
- case ISD::FP_ROUND:
- case ISD::FSIN:
- return isNegatibleForFree(Op.getOperand(0), AfterLegalize, Depth+1);
- }
-}
-
-/// GetNegatedExpression - If isNegatibleForFree returns true, this function
-/// returns the newly negated expression.
-static SDOperand GetNegatedExpression(SDOperand Op, SelectionDAG &DAG,
- bool AfterLegalize, unsigned Depth = 0) {
- // fneg is removable even if it has multiple uses.
- if (Op.getOpcode() == ISD::FNEG) return Op.getOperand(0);
-
- // Don't allow anything with multiple uses.
- assert(Op.hasOneUse() && "Unknown reuse!");
-
- assert(Depth <= 6 && "GetNegatedExpression doesn't match isNegatibleForFree");
- switch (Op.getOpcode()) {
- default: assert(0 && "Unknown code");
- case ISD::ConstantFP: {
- APFloat V = cast<ConstantFPSDNode>(Op)->getValueAPF();
- V.changeSign();
- return DAG.getConstantFP(V, Op.getValueType());
- }
- case ISD::FADD:
- // FIXME: determine better conditions for this xform.
- assert(UnsafeFPMath);
-
- // -(A+B) -> -A - B
- if (isNegatibleForFree(Op.getOperand(0), AfterLegalize, Depth+1))
- return DAG.getNode(ISD::FSUB, Op.getValueType(),
- GetNegatedExpression(Op.getOperand(0), DAG,
- AfterLegalize, Depth+1),
- Op.getOperand(1));
- // -(A+B) -> -B - A
- return DAG.getNode(ISD::FSUB, Op.getValueType(),
- GetNegatedExpression(Op.getOperand(1), DAG,
- AfterLegalize, Depth+1),
- Op.getOperand(0));
- case ISD::FSUB:
- // We can't turn -(A-B) into B-A when we honor signed zeros.
- assert(UnsafeFPMath);
-
- // -(0-B) -> B
- if (ConstantFPSDNode *N0CFP = dyn_cast<ConstantFPSDNode>(Op.getOperand(0)))
- if (N0CFP->getValueAPF().isZero())
- return Op.getOperand(1);
-
- // -(A-B) -> B-A
- return DAG.getNode(ISD::FSUB, Op.getValueType(), Op.getOperand(1),
- Op.getOperand(0));
-
- case ISD::FMUL:
- case ISD::FDIV:
- assert(!HonorSignDependentRoundingFPMath());
-
- // -(X*Y) -> -X * Y
- if (isNegatibleForFree(Op.getOperand(0), AfterLegalize, Depth+1))
- return DAG.getNode(Op.getOpcode(), Op.getValueType(),
- GetNegatedExpression(Op.getOperand(0), DAG,
- AfterLegalize, Depth+1),
- Op.getOperand(1));
-
- // -(X*Y) -> X * -Y
- return DAG.getNode(Op.getOpcode(), Op.getValueType(),
- Op.getOperand(0),
- GetNegatedExpression(Op.getOperand(1), DAG,
- AfterLegalize, Depth+1));
-
- case ISD::FP_EXTEND:
- case ISD::FSIN:
- return DAG.getNode(Op.getOpcode(), Op.getValueType(),
- GetNegatedExpression(Op.getOperand(0), DAG,
- AfterLegalize, Depth+1));
- case ISD::FP_ROUND:
- return DAG.getNode(ISD::FP_ROUND, Op.getValueType(),
- GetNegatedExpression(Op.getOperand(0), DAG,
- AfterLegalize, Depth+1),
- Op.getOperand(1));
- }
-}
-
-
-// isSetCCEquivalent - Return true if this node is a setcc, or is a select_cc
-// that selects between the values 1 and 0, making it equivalent to a setcc.
-// Also, set the incoming LHS, RHS, and CC references to the appropriate
-// nodes based on the type of node we are checking. This simplifies life a
-// bit for the callers.
-static bool isSetCCEquivalent(SDOperand N, SDOperand &LHS, SDOperand &RHS,
- SDOperand &CC) {
- if (N.getOpcode() == ISD::SETCC) {
- LHS = N.getOperand(0);
- RHS = N.getOperand(1);
- CC = N.getOperand(2);
- return true;
- }
- if (N.getOpcode() == ISD::SELECT_CC &&
- N.getOperand(2).getOpcode() == ISD::Constant &&
- N.getOperand(3).getOpcode() == ISD::Constant &&
- cast<ConstantSDNode>(N.getOperand(2))->getAPIntValue() == 1 &&
- cast<ConstantSDNode>(N.getOperand(3))->isNullValue()) {
- LHS = N.getOperand(0);
- RHS = N.getOperand(1);
- CC = N.getOperand(4);
- return true;
- }
- return false;
-}
-
-// isOneUseSetCC - Return true if this is a SetCC-equivalent operation with only
-// one use. If this is true, it allows the users to invert the operation for
-// free when it is profitable to do so.
-static bool isOneUseSetCC(SDOperand N) {
- SDOperand N0, N1, N2;
- if (isSetCCEquivalent(N, N0, N1, N2) && N.Val->hasOneUse())
- return true;
- return false;
-}
-
-SDOperand DAGCombiner::ReassociateOps(unsigned Opc, SDOperand N0, SDOperand N1){
- MVT::ValueType VT = N0.getValueType();
- // reassoc. (op (op x, c1), y) -> (op (op x, y), c1) iff x+c1 has one use
- // reassoc. (op (op x, c1), c2) -> (op x, (op c1, c2))
- if (N0.getOpcode() == Opc && isa<ConstantSDNode>(N0.getOperand(1))) {
- if (isa<ConstantSDNode>(N1)) {
- SDOperand OpNode = DAG.getNode(Opc, VT, N0.getOperand(1), N1);
- AddToWorkList(OpNode.Val);
- return DAG.getNode(Opc, VT, OpNode, N0.getOperand(0));
- } else if (N0.hasOneUse()) {
- SDOperand OpNode = DAG.getNode(Opc, VT, N0.getOperand(0), N1);
- AddToWorkList(OpNode.Val);
- return DAG.getNode(Opc, VT, OpNode, N0.getOperand(1));
- }
- }
- // reassoc. (op y, (op x, c1)) -> (op (op x, y), c1) iff x+c1 has one use
- // reassoc. (op c2, (op x, c1)) -> (op x, (op c1, c2))
- if (N1.getOpcode() == Opc && isa<ConstantSDNode>(N1.getOperand(1))) {
- if (isa<ConstantSDNode>(N0)) {
- SDOperand OpNode = DAG.getNode(Opc, VT, N1.getOperand(1), N0);
- AddToWorkList(OpNode.Val);
- return DAG.getNode(Opc, VT, OpNode, N1.getOperand(0));
- } else if (N1.hasOneUse()) {
- SDOperand OpNode = DAG.getNode(Opc, VT, N1.getOperand(0), N0);
- AddToWorkList(OpNode.Val);
- return DAG.getNode(Opc, VT, OpNode, N1.getOperand(1));
- }
- }
- return SDOperand();
-}
-
-SDOperand DAGCombiner::CombineTo(SDNode *N, const SDOperand *To, unsigned NumTo,
- bool AddTo) {
- assert(N->getNumValues() == NumTo && "Broken CombineTo call!");
- ++NodesCombined;
- DOUT << "\nReplacing.1 "; DEBUG(N->dump(&DAG));
- DOUT << "\nWith: "; DEBUG(To[0].Val->dump(&DAG));
- DOUT << " and " << NumTo-1 << " other values\n";
- WorkListRemover DeadNodes(*this);
- DAG.ReplaceAllUsesWith(N, To, &DeadNodes);
-
- if (AddTo) {
- // Push the new nodes and any users onto the worklist
- for (unsigned i = 0, e = NumTo; i != e; ++i) {
- AddToWorkList(To[i].Val);
- AddUsersToWorkList(To[i].Val);
- }
- }
-
- // Nodes can be reintroduced into the worklist. Make sure we do not
- // process a node that has been replaced.
- removeFromWorkList(N);
-
- // Finally, since the node is now dead, remove it from the graph.
- DAG.DeleteNode(N);
- return SDOperand(N, 0);
-}
-
-/// SimplifyDemandedBits - Check the specified integer node value to see if
-/// it can be simplified or if things it uses can be simplified by bit
-/// propagation. If so, return true.
-bool DAGCombiner::SimplifyDemandedBits(SDOperand Op, const APInt &Demanded) {
- TargetLowering::TargetLoweringOpt TLO(DAG, AfterLegalize);
- APInt KnownZero, KnownOne;
- if (!TLI.SimplifyDemandedBits(Op, Demanded, KnownZero, KnownOne, TLO))
- return false;
-
- // Revisit the node.
- AddToWorkList(Op.Val);
-
- // Replace the old value with the new one.
- ++NodesCombined;
- DOUT << "\nReplacing.2 "; DEBUG(TLO.Old.Val->dump(&DAG));
- DOUT << "\nWith: "; DEBUG(TLO.New.Val->dump(&DAG));
- DOUT << '\n';
-
- // Replace all uses. If any nodes become isomorphic to other nodes and
- // are deleted, make sure to remove them from our worklist.
- WorkListRemover DeadNodes(*this);
- DAG.ReplaceAllUsesOfValueWith(TLO.Old, TLO.New, &DeadNodes);
-
- // Push the new node and any (possibly new) users onto the worklist.
- AddToWorkList(TLO.New.Val);
- AddUsersToWorkList(TLO.New.Val);
-
- // Finally, if the node is now dead, remove it from the graph. The node
- // may not be dead if the replacement process recursively simplified to
- // something else needing this node.
- if (TLO.Old.Val->use_empty()) {
- removeFromWorkList(TLO.Old.Val);
-
- // If the operands of this node are only used by the node, they will now
- // be dead. Make sure to visit them first to delete dead nodes early.
- for (unsigned i = 0, e = TLO.Old.Val->getNumOperands(); i != e; ++i)
- if (TLO.Old.Val->getOperand(i).Val->hasOneUse())
- AddToWorkList(TLO.Old.Val->getOperand(i).Val);
-
- DAG.DeleteNode(TLO.Old.Val);
- }
- return true;
-}
-
-//===----------------------------------------------------------------------===//
-// Main DAG Combiner implementation
-//===----------------------------------------------------------------------===//
-
-void DAGCombiner::Run(bool RunningAfterLegalize) {
- // set the instance variable, so that the various visit routines may use it.
- AfterLegalize = RunningAfterLegalize;
-
- // Add all the dag nodes to the worklist.
- for (SelectionDAG::allnodes_iterator I = DAG.allnodes_begin(),
- E = DAG.allnodes_end(); I != E; ++I)
- WorkList.push_back(I);
-
- // Create a dummy node (which is not added to allnodes), that adds a reference
- // to the root node, preventing it from being deleted, and tracking any
- // changes of the root.
- HandleSDNode Dummy(DAG.getRoot());
-
- // The root of the dag may dangle to deleted nodes until the dag combiner is
- // done. Set it to null to avoid confusion.
- DAG.setRoot(SDOperand());
-
- // while the worklist isn't empty, inspect the node on the end of it and
- // try and combine it.
- while (!WorkList.empty()) {
- SDNode *N = WorkList.back();
- WorkList.pop_back();
-
- // If N has no uses, it is dead. Make sure to revisit all N's operands once
- // N is deleted from the DAG, since they too may now be dead or may have a
- // reduced number of uses, allowing other xforms.
- if (N->use_empty() && N != &Dummy) {
- for (unsigned i = 0, e = N->getNumOperands(); i != e; ++i)
- AddToWorkList(N->getOperand(i).Val);
-
- DAG.DeleteNode(N);
- continue;
- }
-
- SDOperand RV = combine(N);
-
- if (RV.Val == 0)
- continue;
-
- ++NodesCombined;
-
- // If we get back the same node we passed in, rather than a new node or
- // zero, we know that the node must have defined multiple values and
- // CombineTo was used. Since CombineTo takes care of the worklist
- // mechanics for us, we have no work to do in this case.
- if (RV.Val == N)
- continue;
-
- assert(N->getOpcode() != ISD::DELETED_NODE &&
- RV.Val->getOpcode() != ISD::DELETED_NODE &&
- "Node was deleted but visit returned new node!");
-
- DOUT << "\nReplacing.3 "; DEBUG(N->dump(&DAG));
- DOUT << "\nWith: "; DEBUG(RV.Val->dump(&DAG));
- DOUT << '\n';
- WorkListRemover DeadNodes(*this);
- if (N->getNumValues() == RV.Val->getNumValues())
- DAG.ReplaceAllUsesWith(N, RV.Val, &DeadNodes);
- else {
- assert(N->getValueType(0) == RV.getValueType() &&
- N->getNumValues() == 1 && "Type mismatch");
- SDOperand OpV = RV;
- DAG.ReplaceAllUsesWith(N, &OpV, &DeadNodes);
- }
-
- // Push the new node and any users onto the worklist
- AddToWorkList(RV.Val);
- AddUsersToWorkList(RV.Val);
-
- // Add any uses of the old node to the worklist in case this node is the
- // last one that uses them. They may become dead after this node is
- // deleted.
- for (unsigned i = 0, e = N->getNumOperands(); i != e; ++i)
- AddToWorkList(N->getOperand(i).Val);
-
- // Nodes can be reintroduced into the worklist. Make sure we do not
- // process a node that has been replaced.
- removeFromWorkList(N);
-
- // Finally, since the node is now dead, remove it from the graph.
- DAG.DeleteNode(N);
- }
-
- // If the root changed (e.g. it was a dead load, update the root).
- DAG.setRoot(Dummy.getValue());
-}
-
-SDOperand DAGCombiner::visit(SDNode *N) {
- switch(N->getOpcode()) {
- default: break;
- case ISD::TokenFactor: return visitTokenFactor(N);
- case ISD::MERGE_VALUES: return visitMERGE_VALUES(N);
- case ISD::ADD: return visitADD(N);
- case ISD::SUB: return visitSUB(N);
- case ISD::ADDC: return visitADDC(N);
- case ISD::ADDE: return visitADDE(N);
- case ISD::MUL: return visitMUL(N);
- case ISD::SDIV: return visitSDIV(N);
- case ISD::UDIV: return visitUDIV(N);
- case ISD::SREM: return visitSREM(N);
- case ISD::UREM: return visitUREM(N);
- case ISD::MULHU: return visitMULHU(N);
- case ISD::MULHS: return visitMULHS(N);
- case ISD::SMUL_LOHI: return visitSMUL_LOHI(N);
- case ISD::UMUL_LOHI: return visitUMUL_LOHI(N);
- case ISD::SDIVREM: return visitSDIVREM(N);
- case ISD::UDIVREM: return visitUDIVREM(N);
- case ISD::AND: return visitAND(N);
- case ISD::OR: return visitOR(N);
- case ISD::XOR: return visitXOR(N);
- case ISD::SHL: return visitSHL(N);
- case ISD::SRA: return visitSRA(N);
- case ISD::SRL: return visitSRL(N);
- case ISD::CTLZ: return visitCTLZ(N);
- case ISD::CTTZ: return visitCTTZ(N);
- case ISD::CTPOP: return visitCTPOP(N);
- case ISD::SELECT: return visitSELECT(N);
- case ISD::SELECT_CC: return visitSELECT_CC(N);
- case ISD::SETCC: return visitSETCC(N);
- case ISD::SIGN_EXTEND: return visitSIGN_EXTEND(N);
- case ISD::ZERO_EXTEND: return visitZERO_EXTEND(N);
- case ISD::ANY_EXTEND: return visitANY_EXTEND(N);
- case ISD::SIGN_EXTEND_INREG: return visitSIGN_EXTEND_INREG(N);
- case ISD::TRUNCATE: return visitTRUNCATE(N);
- case ISD::BIT_CONVERT: return visitBIT_CONVERT(N);
- case ISD::FADD: return visitFADD(N);
- case ISD::FSUB: return visitFSUB(N);
- case ISD::FMUL: return visitFMUL(N);
- case ISD::FDIV: return visitFDIV(N);
- case ISD::FREM: return visitFREM(N);
- case ISD::FCOPYSIGN: return visitFCOPYSIGN(N);
- case ISD::SINT_TO_FP: return visitSINT_TO_FP(N);
- case ISD::UINT_TO_FP: return visitUINT_TO_FP(N);
- case ISD::FP_TO_SINT: return visitFP_TO_SINT(N);
- case ISD::FP_TO_UINT: return visitFP_TO_UINT(N);
- case ISD::FP_ROUND: return visitFP_ROUND(N);
- case ISD::FP_ROUND_INREG: return visitFP_ROUND_INREG(N);
- case ISD::FP_EXTEND: return visitFP_EXTEND(N);
- case ISD::FNEG: return visitFNEG(N);
- case ISD::FABS: return visitFABS(N);
- case ISD::BRCOND: return visitBRCOND(N);
- case ISD::BR_CC: return visitBR_CC(N);
- case ISD::LOAD: return visitLOAD(N);
- case ISD::STORE: return visitSTORE(N);
- case ISD::INSERT_VECTOR_ELT: return visitINSERT_VECTOR_ELT(N);
- case ISD::EXTRACT_VECTOR_ELT: return visitEXTRACT_VECTOR_ELT(N);
- case ISD::BUILD_VECTOR: return visitBUILD_VECTOR(N);
- case ISD::CONCAT_VECTORS: return visitCONCAT_VECTORS(N);
- case ISD::VECTOR_SHUFFLE: return visitVECTOR_SHUFFLE(N);
- }
- return SDOperand();
-}
-
-SDOperand DAGCombiner::combine(SDNode *N) {
-
- SDOperand RV = visit(N);
-
- // If nothing happened, try a target-specific DAG combine.
- if (RV.Val == 0) {
- assert(N->getOpcode() != ISD::DELETED_NODE &&
- "Node was deleted but visit returned NULL!");
-
- if (N->getOpcode() >= ISD::BUILTIN_OP_END ||
- TLI.hasTargetDAGCombine((ISD::NodeType)N->getOpcode())) {
-
- // Expose the DAG combiner to the target combiner impls.
- TargetLowering::DAGCombinerInfo
- DagCombineInfo(DAG, !AfterLegalize, false, this);
-
- RV = TLI.PerformDAGCombine(N, DagCombineInfo);
- }
- }
-
- // If N is a commutative binary node, try commuting it to enable more
- // sdisel CSE.
- if (RV.Val == 0 &&
- SelectionDAG::isCommutativeBinOp(N->getOpcode()) &&
- N->getNumValues() == 1) {
- SDOperand N0 = N->getOperand(0);
- SDOperand N1 = N->getOperand(1);
- // Constant operands are canonicalized to RHS.
- if (isa<ConstantSDNode>(N0) || !isa<ConstantSDNode>(N1)) {
- SDOperand Ops[] = { N1, N0 };
- SDNode *CSENode = DAG.getNodeIfExists(N->getOpcode(), N->getVTList(),
- Ops, 2);
- if (CSENode)
- return SDOperand(CSENode, 0);
- }
- }
-
- return RV;
-}
-
-/// getInputChainForNode - Given a node, return its input chain if it has one,
-/// otherwise return a null sd operand.
-static SDOperand getInputChainForNode(SDNode *N) {
- if (unsigned NumOps = N->getNumOperands()) {
- if (N->getOperand(0).getValueType() == MVT::Other)
- return N->getOperand(0);
- else if (N->getOperand(NumOps-1).getValueType() == MVT::Other)
- return N->getOperand(NumOps-1);
- for (unsigned i = 1; i < NumOps-1; ++i)
- if (N->getOperand(i).getValueType() == MVT::Other)
- return N->getOperand(i);
- }
- return SDOperand(0, 0);
-}
-
-SDOperand DAGCombiner::visitTokenFactor(SDNode *N) {
- // If N has two operands, where one has an input chain equal to the other,
- // the 'other' chain is redundant.
- if (N->getNumOperands() == 2) {
- if (getInputChainForNode(N->getOperand(0).Val) == N->getOperand(1))
- return N->getOperand(0);
- if (getInputChainForNode(N->getOperand(1).Val) == N->getOperand(0))
- return N->getOperand(1);
- }
-
- SmallVector<SDNode *, 8> TFs; // List of token factors to visit.
- SmallVector<SDOperand, 8> Ops; // Ops for replacing token factor.
- SmallPtrSet<SDNode*, 16> SeenOps;
- bool Changed = false; // If we should replace this token factor.
-
- // Start out with this token factor.
- TFs.push_back(N);
-
- // Iterate through token factors. The TFs grows when new token factors are
- // encountered.
- for (unsigned i = 0; i < TFs.size(); ++i) {
- SDNode *TF = TFs[i];
-
- // Check each of the operands.
- for (unsigned i = 0, ie = TF->getNumOperands(); i != ie; ++i) {
- SDOperand Op = TF->getOperand(i);
-
- switch (Op.getOpcode()) {
- case ISD::EntryToken:
- // Entry tokens don't need to be added to the list. They are
- // rededundant.
- Changed = true;
- break;
-
- case ISD::TokenFactor:
- if ((CombinerAA || Op.hasOneUse()) &&
- std::find(TFs.begin(), TFs.end(), Op.Val) == TFs.end()) {
- // Queue up for processing.
- TFs.push_back(Op.Val);
- // Clean up in case the token factor is removed.
- AddToWorkList(Op.Val);
- Changed = true;
- break;
- }
- // Fall thru
-
- default:
- // Only add if it isn't already in the list.
- if (SeenOps.insert(Op.Val))
- Ops.push_back(Op);
- else
- Changed = true;
- break;
- }
- }
- }
-
- SDOperand Result;
-
- // If we've change things around then replace token factor.
- if (Changed) {
- if (Ops.empty()) {
- // The entry token is the only possible outcome.
- Result = DAG.getEntryNode();
- } else {
- // New and improved token factor.
- Result = DAG.getNode(ISD::TokenFactor, MVT::Other, &Ops[0], Ops.size());
- }
-
- // Don't add users to work list.
- return CombineTo(N, Result, false);
- }
-
- return Result;
-}
-
-/// MERGE_VALUES can always be eliminated.
-SDOperand DAGCombiner::visitMERGE_VALUES(SDNode *N) {
- WorkListRemover DeadNodes(*this);
- for (unsigned i = 0, e = N->getNumOperands(); i != e; ++i)
- DAG.ReplaceAllUsesOfValueWith(SDOperand(N, i), N->getOperand(i),
- &DeadNodes);
- removeFromWorkList(N);
- DAG.DeleteNode(N);
- return SDOperand(N, 0); // Return N so it doesn't get rechecked!
-}
-
-
-static
-SDOperand combineShlAddConstant(SDOperand N0, SDOperand N1, SelectionDAG &DAG) {
- MVT::ValueType VT = N0.getValueType();
- SDOperand N00 = N0.getOperand(0);
- SDOperand N01 = N0.getOperand(1);
- ConstantSDNode *N01C = dyn_cast<ConstantSDNode>(N01);
- if (N01C && N00.getOpcode() == ISD::ADD && N00.Val->hasOneUse() &&
- isa<ConstantSDNode>(N00.getOperand(1))) {
- N0 = DAG.getNode(ISD::ADD, VT,
- DAG.getNode(ISD::SHL, VT, N00.getOperand(0), N01),
- DAG.getNode(ISD::SHL, VT, N00.getOperand(1), N01));
- return DAG.getNode(ISD::ADD, VT, N0, N1);
- }
- return SDOperand();
-}
-
-static
-SDOperand combineSelectAndUse(SDNode *N, SDOperand Slct, SDOperand OtherOp,
- SelectionDAG &DAG) {
- MVT::ValueType VT = N->getValueType(0);
- unsigned Opc = N->getOpcode();
- bool isSlctCC = Slct.getOpcode() == ISD::SELECT_CC;
- SDOperand LHS = isSlctCC ? Slct.getOperand(2) : Slct.getOperand(1);
- SDOperand RHS = isSlctCC ? Slct.getOperand(3) : Slct.getOperand(2);
- ISD::CondCode CC = ISD::SETCC_INVALID;
- if (isSlctCC)
- CC = cast<CondCodeSDNode>(Slct.getOperand(4))->get();
- else {
- SDOperand CCOp = Slct.getOperand(0);
- if (CCOp.getOpcode() == ISD::SETCC)
- CC = cast<CondCodeSDNode>(CCOp.getOperand(2))->get();
- }
-
- bool DoXform = false;
- bool InvCC = false;
- assert ((Opc == ISD::ADD || (Opc == ISD::SUB && Slct == N->getOperand(1))) &&
- "Bad input!");
- if (LHS.getOpcode() == ISD::Constant &&
- cast<ConstantSDNode>(LHS)->isNullValue())
- DoXform = true;
- else if (CC != ISD::SETCC_INVALID &&
- RHS.getOpcode() == ISD::Constant &&
- cast<ConstantSDNode>(RHS)->isNullValue()) {
- std::swap(LHS, RHS);
- SDOperand Op0 = Slct.getOperand(0);
- bool isInt = MVT::isInteger(isSlctCC ? Op0.getValueType()
- : Op0.getOperand(0).getValueType());
- CC = ISD::getSetCCInverse(CC, isInt);
- DoXform = true;
- InvCC = true;
- }
-
- if (DoXform) {
- SDOperand Result = DAG.getNode(Opc, VT, OtherOp, RHS);
- if (isSlctCC)
- return DAG.getSelectCC(OtherOp, Result,
- Slct.getOperand(0), Slct.getOperand(1), CC);
- SDOperand CCOp = Slct.getOperand(0);
- if (InvCC)
- CCOp = DAG.getSetCC(CCOp.getValueType(), CCOp.getOperand(0),
- CCOp.getOperand(1), CC);
- return DAG.getNode(ISD::SELECT, VT, CCOp, OtherOp, Result);
- }
- return SDOperand();
-}
-
-SDOperand DAGCombiner::visitADD(SDNode *N) {
- SDOperand N0 = N->getOperand(0);
- SDOperand N1 = N->getOperand(1);
- ConstantSDNode *N0C = dyn_cast<ConstantSDNode>(N0);
- ConstantSDNode *N1C = dyn_cast<ConstantSDNode>(N1);
- MVT::ValueType VT = N0.getValueType();
-
- // fold vector ops
- if (MVT::isVector(VT)) {
- SDOperand FoldedVOp = SimplifyVBinOp(N);
- if (FoldedVOp.Val) return FoldedVOp;
- }
-
- // fold (add x, undef) -> undef
- if (N0.getOpcode() == ISD::UNDEF)
- return N0;
- if (N1.getOpcode() == ISD::UNDEF)
- return N1;
- // fold (add c1, c2) -> c1+c2
- if (N0C && N1C)
- return DAG.getConstant(N0C->getAPIntValue() + N1C->getAPIntValue(), VT);
- // canonicalize constant to RHS
- if (N0C && !N1C)
- return DAG.getNode(ISD::ADD, VT, N1, N0);
- // fold (add x, 0) -> x
- if (N1C && N1C->isNullValue())
- return N0;
- // fold ((c1-A)+c2) -> (c1+c2)-A
- if (N1C && N0.getOpcode() == ISD::SUB)
- if (ConstantSDNode *N0C = dyn_cast<ConstantSDNode>(N0.getOperand(0)))
- return DAG.getNode(ISD::SUB, VT,
- DAG.getConstant(N1C->getAPIntValue()+
- N0C->getAPIntValue(), VT),
- N0.getOperand(1));
- // reassociate add
- SDOperand RADD = ReassociateOps(ISD::ADD, N0, N1);
- if (RADD.Val != 0)
- return RADD;
- // fold ((0-A) + B) -> B-A
- if (N0.getOpcode() == ISD::SUB && isa<ConstantSDNode>(N0.getOperand(0)) &&
- cast<ConstantSDNode>(N0.getOperand(0))->isNullValue())
- return DAG.getNode(ISD::SUB, VT, N1, N0.getOperand(1));
- // fold (A + (0-B)) -> A-B
- if (N1.getOpcode() == ISD::SUB && isa<ConstantSDNode>(N1.getOperand(0)) &&
- cast<ConstantSDNode>(N1.getOperand(0))->isNullValue())
- return DAG.getNode(ISD::SUB, VT, N0, N1.getOperand(1));
- // fold (A+(B-A)) -> B
- if (N1.getOpcode() == ISD::SUB && N0 == N1.getOperand(1))
- return N1.getOperand(0);
-
- if (!MVT::isVector(VT) && SimplifyDemandedBits(SDOperand(N, 0)))
- return SDOperand(N, 0);
-
- // fold (a+b) -> (a|b) iff a and b share no bits.
- if (MVT::isInteger(VT) && !MVT::isVector(VT)) {
- APInt LHSZero, LHSOne;
- APInt RHSZero, RHSOne;
- APInt Mask = APInt::getAllOnesValue(MVT::getSizeInBits(VT));
- DAG.ComputeMaskedBits(N0, Mask, LHSZero, LHSOne);
- if (LHSZero.getBoolValue()) {
- DAG.ComputeMaskedBits(N1, Mask, RHSZero, RHSOne);
-
- // If all possibly-set bits on the LHS are clear on the RHS, return an OR.
- // If all possibly-set bits on the RHS are clear on the LHS, return an OR.
- if ((RHSZero & (~LHSZero & Mask)) == (~LHSZero & Mask) ||
- (LHSZero & (~RHSZero & Mask)) == (~RHSZero & Mask))
- return DAG.getNode(ISD::OR, VT, N0, N1);
- }
- }
-
- // fold (add (shl (add x, c1), c2), ) -> (add (add (shl x, c2), c1<<c2), )
- if (N0.getOpcode() == ISD::SHL && N0.Val->hasOneUse()) {
- SDOperand Result = combineShlAddConstant(N0, N1, DAG);
- if (Result.Val) return Result;
- }
- if (N1.getOpcode() == ISD::SHL && N1.Val->hasOneUse()) {
- SDOperand Result = combineShlAddConstant(N1, N0, DAG);
- if (Result.Val) return Result;
- }
-
- // fold (add (select cc, 0, c), x) -> (select cc, x, (add, x, c))
- if (N0.getOpcode() == ISD::SELECT && N0.Val->hasOneUse()) {
- SDOperand Result = combineSelectAndUse(N, N0, N1, DAG);
- if (Result.Val) return Result;
- }
- if (N1.getOpcode() == ISD::SELECT && N1.Val->hasOneUse()) {
- SDOperand Result = combineSelectAndUse(N, N1, N0, DAG);
- if (Result.Val) return Result;
- }
-
- return SDOperand();
-}
-
-SDOperand DAGCombiner::visitADDC(SDNode *N) {
- SDOperand N0 = N->getOperand(0);
- SDOperand N1 = N->getOperand(1);
- ConstantSDNode *N0C = dyn_cast<ConstantSDNode>(N0);
- ConstantSDNode *N1C = dyn_cast<ConstantSDNode>(N1);
- MVT::ValueType VT = N0.getValueType();
-
- // If the flag result is dead, turn this into an ADD.
- if (N->hasNUsesOfValue(0, 1))
- return CombineTo(N, DAG.getNode(ISD::ADD, VT, N1, N0),
- DAG.getNode(ISD::CARRY_FALSE, MVT::Flag));
-
- // canonicalize constant to RHS.
- if (N0C && !N1C) {
- SDOperand Ops[] = { N1, N0 };
- return DAG.getNode(ISD::ADDC, N->getVTList(), Ops, 2);
- }
-
- // fold (addc x, 0) -> x + no carry out
- if (N1C && N1C->isNullValue())
- return CombineTo(N, N0, DAG.getNode(ISD::CARRY_FALSE, MVT::Flag));
-
- // fold (addc a, b) -> (or a, b), CARRY_FALSE iff a and b share no bits.
- APInt LHSZero, LHSOne;
- APInt RHSZero, RHSOne;
- APInt Mask = APInt::getAllOnesValue(MVT::getSizeInBits(VT));
- DAG.ComputeMaskedBits(N0, Mask, LHSZero, LHSOne);
- if (LHSZero.getBoolValue()) {
- DAG.ComputeMaskedBits(N1, Mask, RHSZero, RHSOne);
-
- // If all possibly-set bits on the LHS are clear on the RHS, return an OR.
- // If all possibly-set bits on the RHS are clear on the LHS, return an OR.
- if ((RHSZero & (~LHSZero & Mask)) == (~LHSZero & Mask) ||
- (LHSZero & (~RHSZero & Mask)) == (~RHSZero & Mask))
- return CombineTo(N, DAG.getNode(ISD::OR, VT, N0, N1),
- DAG.getNode(ISD::CARRY_FALSE, MVT::Flag));
- }
-
- return SDOperand();
-}
-
-SDOperand DAGCombiner::visitADDE(SDNode *N) {
- SDOperand N0 = N->getOperand(0);
- SDOperand N1 = N->getOperand(1);
- SDOperand CarryIn = N->getOperand(2);
- ConstantSDNode *N0C = dyn_cast<ConstantSDNode>(N0);
- ConstantSDNode *N1C = dyn_cast<ConstantSDNode>(N1);
- //MVT::ValueType VT = N0.getValueType();
-
- // canonicalize constant to RHS
- if (N0C && !N1C) {
- SDOperand Ops[] = { N1, N0, CarryIn };
- return DAG.getNode(ISD::ADDE, N->getVTList(), Ops, 3);
- }
-
- // fold (adde x, y, false) -> (addc x, y)
- if (CarryIn.getOpcode() == ISD::CARRY_FALSE) {
- SDOperand Ops[] = { N1, N0 };
- return DAG.getNode(ISD::ADDC, N->getVTList(), Ops, 2);
- }
-
- return SDOperand();
-}
-
-
-
-SDOperand DAGCombiner::visitSUB(SDNode *N) {
- SDOperand N0 = N->getOperand(0);
- SDOperand N1 = N->getOperand(1);
- ConstantSDNode *N0C = dyn_cast<ConstantSDNode>(N0.Val);
- ConstantSDNode *N1C = dyn_cast<ConstantSDNode>(N1.Val);
- MVT::ValueType VT = N0.getValueType();
-
- // fold vector ops
- if (MVT::isVector(VT)) {
- SDOperand FoldedVOp = SimplifyVBinOp(N);
- if (FoldedVOp.Val) return FoldedVOp;
- }
-
- // fold (sub x, x) -> 0
- if (N0 == N1)
- return DAG.getConstant(0, N->getValueType(0));
- // fold (sub c1, c2) -> c1-c2
- if (N0C && N1C)
- return DAG.getNode(ISD::SUB, VT, N0, N1);
- // fold (sub x, c) -> (add x, -c)
- if (N1C)
- return DAG.getNode(ISD::ADD, VT, N0,
- DAG.getConstant(-N1C->getAPIntValue(), VT));
- // fold (A+B)-A -> B
- if (N0.getOpcode() == ISD::ADD && N0.getOperand(0) == N1)
- return N0.getOperand(1);
- // fold (A+B)-B -> A
- if (N0.getOpcode() == ISD::ADD && N0.getOperand(1) == N1)
- return N0.getOperand(0);
- // fold (sub x, (select cc, 0, c)) -> (select cc, x, (sub, x, c))
- if (N1.getOpcode() == ISD::SELECT && N1.Val->hasOneUse()) {
- SDOperand Result = combineSelectAndUse(N, N1, N0, DAG);
- if (Result.Val) return Result;
- }
- // If either operand of a sub is undef, the result is undef
- if (N0.getOpcode() == ISD::UNDEF)
- return N0;
- if (N1.getOpcode() == ISD::UNDEF)
- return N1;
-
- return SDOperand();
-}
-
-SDOperand DAGCombiner::visitMUL(SDNode *N) {
- SDOperand N0 = N->getOperand(0);
- SDOperand N1 = N->getOperand(1);
- ConstantSDNode *N0C = dyn_cast<ConstantSDNode>(N0);
- ConstantSDNode *N1C = dyn_cast<ConstantSDNode>(N1);
- MVT::ValueType VT = N0.getValueType();
-
- // fold vector ops
- if (MVT::isVector(VT)) {
- SDOperand FoldedVOp = SimplifyVBinOp(N);
- if (FoldedVOp.Val) return FoldedVOp;
- }
-
- // fold (mul x, undef) -> 0
- if (N0.getOpcode() == ISD::UNDEF || N1.getOpcode() == ISD::UNDEF)
- return DAG.getConstant(0, VT);
- // fold (mul c1, c2) -> c1*c2
- if (N0C && N1C)
- return DAG.getNode(ISD::MUL, VT, N0, N1);
- // canonicalize constant to RHS
- if (N0C && !N1C)
- return DAG.getNode(ISD::MUL, VT, N1, N0);
- // fold (mul x, 0) -> 0
- if (N1C && N1C->isNullValue())
- return N1;
- // fold (mul x, -1) -> 0-x
- if (N1C && N1C->isAllOnesValue())
- return DAG.getNode(ISD::SUB, VT, DAG.getConstant(0, VT), N0);
- // fold (mul x, (1 << c)) -> x << c
- if (N1C && N1C->getAPIntValue().isPowerOf2())
- return DAG.getNode(ISD::SHL, VT, N0,
- DAG.getConstant(N1C->getAPIntValue().logBase2(),
- TLI.getShiftAmountTy()));
- // fold (mul x, -(1 << c)) -> -(x << c) or (-x) << c
- if (N1C && isPowerOf2_64(-N1C->getSignExtended())) {
- // FIXME: If the input is something that is easily negated (e.g. a
- // single-use add), we should put the negate there.
- return DAG.getNode(ISD::SUB, VT, DAG.getConstant(0, VT),
- DAG.getNode(ISD::SHL, VT, N0,
- DAG.getConstant(Log2_64(-N1C->getSignExtended()),
- TLI.getShiftAmountTy())));
- }
-
- // (mul (shl X, c1), c2) -> (mul X, c2 << c1)
- if (N1C && N0.getOpcode() == ISD::SHL &&
- isa<ConstantSDNode>(N0.getOperand(1))) {
- SDOperand C3 = DAG.getNode(ISD::SHL, VT, N1, N0.getOperand(1));
- AddToWorkList(C3.Val);
- return DAG.getNode(ISD::MUL, VT, N0.getOperand(0), C3);
- }
-
- // Change (mul (shl X, C), Y) -> (shl (mul X, Y), C) when the shift has one
- // use.
- {
- SDOperand Sh(0,0), Y(0,0);
- // Check for both (mul (shl X, C), Y) and (mul Y, (shl X, C)).
- if (N0.getOpcode() == ISD::SHL && isa<ConstantSDNode>(N0.getOperand(1)) &&
- N0.Val->hasOneUse()) {
- Sh = N0; Y = N1;
- } else if (N1.getOpcode() == ISD::SHL &&
- isa<ConstantSDNode>(N1.getOperand(1)) && N1.Val->hasOneUse()) {
- Sh = N1; Y = N0;
- }
- if (Sh.Val) {
- SDOperand Mul = DAG.getNode(ISD::MUL, VT, Sh.getOperand(0), Y);
- return DAG.getNode(ISD::SHL, VT, Mul, Sh.getOperand(1));
- }
- }
- // fold (mul (add x, c1), c2) -> (add (mul x, c2), c1*c2)
- if (N1C && N0.getOpcode() == ISD::ADD && N0.Val->hasOneUse() &&
- isa<ConstantSDNode>(N0.getOperand(1))) {
- return DAG.getNode(ISD::ADD, VT,
- DAG.getNode(ISD::MUL, VT, N0.getOperand(0), N1),
- DAG.getNode(ISD::MUL, VT, N0.getOperand(1), N1));
- }
-
- // reassociate mul
- SDOperand RMUL = ReassociateOps(ISD::MUL, N0, N1);
- if (RMUL.Val != 0)
- return RMUL;
-
- return SDOperand();
-}
-
-SDOperand DAGCombiner::visitSDIV(SDNode *N) {
- SDOperand N0 = N->getOperand(0);
- SDOperand N1 = N->getOperand(1);
- ConstantSDNode *N0C = dyn_cast<ConstantSDNode>(N0.Val);
- ConstantSDNode *N1C = dyn_cast<ConstantSDNode>(N1.Val);
- MVT::ValueType VT = N->getValueType(0);
-
- // fold vector ops
- if (MVT::isVector(VT)) {
- SDOperand FoldedVOp = SimplifyVBinOp(N);
- if (FoldedVOp.Val) return FoldedVOp;
- }
-
- // fold (sdiv c1, c2) -> c1/c2
- if (N0C && N1C && !N1C->isNullValue())
- return DAG.getNode(ISD::SDIV, VT, N0, N1);
- // fold (sdiv X, 1) -> X
- if (N1C && N1C->getSignExtended() == 1LL)
- return N0;
- // fold (sdiv X, -1) -> 0-X
- if (N1C && N1C->isAllOnesValue())
- return DAG.getNode(ISD::SUB, VT, DAG.getConstant(0, VT), N0);
- // If we know the sign bits of both operands are zero, strength reduce to a
- // udiv instead. Handles (X&15) /s 4 -> X&15 >> 2
- if (!MVT::isVector(VT)) {
- if (DAG.SignBitIsZero(N1) && DAG.SignBitIsZero(N0))
- return DAG.getNode(ISD::UDIV, N1.getValueType(), N0, N1);
- }
- // fold (sdiv X, pow2) -> simple ops after legalize
- if (N1C && !N1C->isNullValue() && !TLI.isIntDivCheap() &&
- (isPowerOf2_64(N1C->getSignExtended()) ||
- isPowerOf2_64(-N1C->getSignExtended()))) {
- // If dividing by powers of two is cheap, then don't perform the following
- // fold.
- if (TLI.isPow2DivCheap())
- return SDOperand();
- int64_t pow2 = N1C->getSignExtended();
- int64_t abs2 = pow2 > 0 ? pow2 : -pow2;
- unsigned lg2 = Log2_64(abs2);
- // Splat the sign bit into the register
- SDOperand SGN = DAG.getNode(ISD::SRA, VT, N0,
- DAG.getConstant(MVT::getSizeInBits(VT)-1,
- TLI.getShiftAmountTy()));
- AddToWorkList(SGN.Val);
- // Add (N0 < 0) ? abs2 - 1 : 0;
- SDOperand SRL = DAG.getNode(ISD::SRL, VT, SGN,
- DAG.getConstant(MVT::getSizeInBits(VT)-lg2,
- TLI.getShiftAmountTy()));
- SDOperand ADD = DAG.getNode(ISD::ADD, VT, N0, SRL);
- AddToWorkList(SRL.Val);
- AddToWorkList(ADD.Val); // Divide by pow2
- SDOperand SRA = DAG.getNode(ISD::SRA, VT, ADD,
- DAG.getConstant(lg2, TLI.getShiftAmountTy()));
- // If we're dividing by a positive value, we're done. Otherwise, we must
- // negate the result.
- if (pow2 > 0)
- return SRA;
- AddToWorkList(SRA.Val);
- return DAG.getNode(ISD::SUB, VT, DAG.getConstant(0, VT), SRA);
- }
- // if integer divide is expensive and we satisfy the requirements, emit an
- // alternate sequence.
- if (N1C && (N1C->getSignExtended() < -1 || N1C->getSignExtended() > 1) &&
- !TLI.isIntDivCheap()) {
- SDOperand Op = BuildSDIV(N);
- if (Op.Val) return Op;
- }
-
- // undef / X -> 0
- if (N0.getOpcode() == ISD::UNDEF)
- return DAG.getConstant(0, VT);
- // X / undef -> undef
- if (N1.getOpcode() == ISD::UNDEF)
- return N1;
-
- return SDOperand();
-}
-
-SDOperand DAGCombiner::visitUDIV(SDNode *N) {
- SDOperand N0 = N->getOperand(0);
- SDOperand N1 = N->getOperand(1);
- ConstantSDNode *N0C = dyn_cast<ConstantSDNode>(N0.Val);
- ConstantSDNode *N1C = dyn_cast<ConstantSDNode>(N1.Val);
- MVT::ValueType VT = N->getValueType(0);
-
- // fold vector ops
- if (MVT::isVector(VT)) {
- SDOperand FoldedVOp = SimplifyVBinOp(N);
- if (FoldedVOp.Val) return FoldedVOp;
- }
-
- // fold (udiv c1, c2) -> c1/c2
- if (N0C && N1C && !N1C->isNullValue())
- return DAG.getNode(ISD::UDIV, VT, N0, N1);
- // fold (udiv x, (1 << c)) -> x >>u c
- if (N1C && N1C->getAPIntValue().isPowerOf2())
- return DAG.getNode(ISD::SRL, VT, N0,
- DAG.getConstant(N1C->getAPIntValue().logBase2(),
- TLI.getShiftAmountTy()));
- // fold (udiv x, (shl c, y)) -> x >>u (log2(c)+y) iff c is power of 2
- if (N1.getOpcode() == ISD::SHL) {
- if (ConstantSDNode *SHC = dyn_cast<ConstantSDNode>(N1.getOperand(0))) {
- if (SHC->getAPIntValue().isPowerOf2()) {
- MVT::ValueType ADDVT = N1.getOperand(1).getValueType();
- SDOperand Add = DAG.getNode(ISD::ADD, ADDVT, N1.getOperand(1),
- DAG.getConstant(SHC->getAPIntValue()
- .logBase2(),
- ADDVT));
- AddToWorkList(Add.Val);
- return DAG.getNode(ISD::SRL, VT, N0, Add);
- }
- }
- }
- // fold (udiv x, c) -> alternate
- if (N1C && !N1C->isNullValue() && !TLI.isIntDivCheap()) {
- SDOperand Op = BuildUDIV(N);
- if (Op.Val) return Op;
- }
-
- // undef / X -> 0
- if (N0.getOpcode() == ISD::UNDEF)
- return DAG.getConstant(0, VT);
- // X / undef -> undef
- if (N1.getOpcode() == ISD::UNDEF)
- return N1;
-
- return SDOperand();
-}
-
-SDOperand DAGCombiner::visitSREM(SDNode *N) {
- SDOperand N0 = N->getOperand(0);
- SDOperand N1 = N->getOperand(1);
- ConstantSDNode *N0C = dyn_cast<ConstantSDNode>(N0);
- ConstantSDNode *N1C = dyn_cast<ConstantSDNode>(N1);
- MVT::ValueType VT = N->getValueType(0);
-
- // fold (srem c1, c2) -> c1%c2
- if (N0C && N1C && !N1C->isNullValue())
- return DAG.getNode(ISD::SREM, VT, N0, N1);
- // If we know the sign bits of both operands are zero, strength reduce to a
- // urem instead. Handles (X & 0x0FFFFFFF) %s 16 -> X&15
- if (!MVT::isVector(VT)) {
- if (DAG.SignBitIsZero(N1) && DAG.SignBitIsZero(N0))
- return DAG.getNode(ISD::UREM, VT, N0, N1);
- }
-
- // If X/C can be simplified by the division-by-constant logic, lower
- // X%C to the equivalent of X-X/C*C.
- if (N1C && !N1C->isNullValue()) {
- SDOperand Div = DAG.getNode(ISD::SDIV, VT, N0, N1);
- AddToWorkList(Div.Val);
- SDOperand OptimizedDiv = combine(Div.Val);
- if (OptimizedDiv.Val && OptimizedDiv.Val != Div.Val) {
- SDOperand Mul = DAG.getNode(ISD::MUL, VT, OptimizedDiv, N1);
- SDOperand Sub = DAG.getNode(ISD::SUB, VT, N0, Mul);
- AddToWorkList(Mul.Val);
- return Sub;
- }
- }
-
- // undef % X -> 0
- if (N0.getOpcode() == ISD::UNDEF)
- return DAG.getConstant(0, VT);
- // X % undef -> undef
- if (N1.getOpcode() == ISD::UNDEF)
- return N1;
-
- return SDOperand();
-}
-
-SDOperand DAGCombiner::visitUREM(SDNode *N) {
- SDOperand N0 = N->getOperand(0);
- SDOperand N1 = N->getOperand(1);
- ConstantSDNode *N0C = dyn_cast<ConstantSDNode>(N0);
- ConstantSDNode *N1C = dyn_cast<ConstantSDNode>(N1);
- MVT::ValueType VT = N->getValueType(0);
-
- // fold (urem c1, c2) -> c1%c2
- if (N0C && N1C && !N1C->isNullValue())
- return DAG.getNode(ISD::UREM, VT, N0, N1);
- // fold (urem x, pow2) -> (and x, pow2-1)
- if (N1C && !N1C->isNullValue() && N1C->getAPIntValue().isPowerOf2())
- return DAG.getNode(ISD::AND, VT, N0,
- DAG.getConstant(N1C->getAPIntValue()-1,VT));
- // fold (urem x, (shl pow2, y)) -> (and x, (add (shl pow2, y), -1))
- if (N1.getOpcode() == ISD::SHL) {
- if (ConstantSDNode *SHC = dyn_cast<ConstantSDNode>(N1.getOperand(0))) {
- if (SHC->getAPIntValue().isPowerOf2()) {
- SDOperand Add =
- DAG.getNode(ISD::ADD, VT, N1,
- DAG.getConstant(APInt::getAllOnesValue(MVT::getSizeInBits(VT)),
- VT));
- AddToWorkList(Add.Val);
- return DAG.getNode(ISD::AND, VT, N0, Add);
- }
- }
- }
-
- // If X/C can be simplified by the division-by-constant logic, lower
- // X%C to the equivalent of X-X/C*C.
- if (N1C && !N1C->isNullValue()) {
- SDOperand Div = DAG.getNode(ISD::UDIV, VT, N0, N1);
- SDOperand OptimizedDiv = combine(Div.Val);
- if (OptimizedDiv.Val && OptimizedDiv.Val != Div.Val) {
- SDOperand Mul = DAG.getNode(ISD::MUL, VT, OptimizedDiv, N1);
- SDOperand Sub = DAG.getNode(ISD::SUB, VT, N0, Mul);
- AddToWorkList(Mul.Val);
- return Sub;
- }
- }
-
- // undef % X -> 0
- if (N0.getOpcode() == ISD::UNDEF)
- return DAG.getConstant(0, VT);
- // X % undef -> undef
- if (N1.getOpcode() == ISD::UNDEF)
- return N1;
-
- return SDOperand();
-}
-
-SDOperand DAGCombiner::visitMULHS(SDNode *N) {
- SDOperand N0 = N->getOperand(0);
- SDOperand N1 = N->getOperand(1);
- ConstantSDNode *N1C = dyn_cast<ConstantSDNode>(N1);
- MVT::ValueType VT = N->getValueType(0);
-
- // fold (mulhs x, 0) -> 0
- if (N1C && N1C->isNullValue())
- return N1;
- // fold (mulhs x, 1) -> (sra x, size(x)-1)
- if (N1C && N1C->getAPIntValue() == 1)
- return DAG.getNode(ISD::SRA, N0.getValueType(), N0,
- DAG.getConstant(MVT::getSizeInBits(N0.getValueType())-1,
- TLI.getShiftAmountTy()));
- // fold (mulhs x, undef) -> 0
- if (N0.getOpcode() == ISD::UNDEF || N1.getOpcode() == ISD::UNDEF)
- return DAG.getConstant(0, VT);
-
- return SDOperand();
-}
-
-SDOperand DAGCombiner::visitMULHU(SDNode *N) {
- SDOperand N0 = N->getOperand(0);
- SDOperand N1 = N->getOperand(1);
- ConstantSDNode *N1C = dyn_cast<ConstantSDNode>(N1);
- MVT::ValueType VT = N->getValueType(0);
-
- // fold (mulhu x, 0) -> 0
- if (N1C && N1C->isNullValue())
- return N1;
- // fold (mulhu x, 1) -> 0
- if (N1C && N1C->getAPIntValue() == 1)
- return DAG.getConstant(0, N0.getValueType());
- // fold (mulhu x, undef) -> 0
- if (N0.getOpcode() == ISD::UNDEF || N1.getOpcode() == ISD::UNDEF)
- return DAG.getConstant(0, VT);
-
- return SDOperand();
-}
-
-/// SimplifyNodeWithTwoResults - Perform optimizations common to nodes that
-/// compute two values. LoOp and HiOp give the opcodes for the two computations
-/// that are being performed. Return true if a simplification was made.
-///
-SDOperand DAGCombiner::SimplifyNodeWithTwoResults(SDNode *N, unsigned LoOp,
- unsigned HiOp) {
- // If the high half is not needed, just compute the low half.
- bool HiExists = N->hasAnyUseOfValue(1);
- if (!HiExists &&
- (!AfterLegalize ||
- TLI.isOperationLegal(LoOp, N->getValueType(0)))) {
- SDOperand Res = DAG.getNode(LoOp, N->getValueType(0), N->op_begin(),
- N->getNumOperands());
- return CombineTo(N, Res, Res);
- }
-
- // If the low half is not needed, just compute the high half.
- bool LoExists = N->hasAnyUseOfValue(0);
- if (!LoExists &&
- (!AfterLegalize ||
- TLI.isOperationLegal(HiOp, N->getValueType(1)))) {
- SDOperand Res = DAG.getNode(HiOp, N->getValueType(1), N->op_begin(),
- N->getNumOperands());
- return CombineTo(N, Res, Res);
- }
-
- // If both halves are used, return as it is.
- if (LoExists && HiExists)
- return SDOperand();
-
- // If the two computed results can be simplified separately, separate them.
- if (LoExists) {
- SDOperand Lo = DAG.getNode(LoOp, N->getValueType(0),
- N->op_begin(), N->getNumOperands());
- AddToWorkList(Lo.Val);
- SDOperand LoOpt = combine(Lo.Val);
- if (LoOpt.Val && LoOpt.Val != Lo.Val &&
- TLI.isOperationLegal(LoOpt.getOpcode(), LoOpt.getValueType()))
- return CombineTo(N, LoOpt, LoOpt);
- }
-
- if (HiExists) {
- SDOperand Hi = DAG.getNode(HiOp, N->getValueType(1),
- N->op_begin(), N->getNumOperands());
- AddToWorkList(Hi.Val);
- SDOperand HiOpt = combine(Hi.Val);
- if (HiOpt.Val && HiOpt != Hi &&
- TLI.isOperationLegal(HiOpt.getOpcode(), HiOpt.getValueType()))
- return CombineTo(N, HiOpt, HiOpt);
- }
- return SDOperand();
-}
-
-SDOperand DAGCombiner::visitSMUL_LOHI(SDNode *N) {
- SDOperand Res = SimplifyNodeWithTwoResults(N, ISD::MUL, ISD::MULHS);
- if (Res.Val) return Res;
-
- return SDOperand();
-}
-
-SDOperand DAGCombiner::visitUMUL_LOHI(SDNode *N) {
- SDOperand Res = SimplifyNodeWithTwoResults(N, ISD::MUL, ISD::MULHU);
- if (Res.Val) return Res;
-
- return SDOperand();
-}
-
-SDOperand DAGCombiner::visitSDIVREM(SDNode *N) {
- SDOperand Res = SimplifyNodeWithTwoResults(N, ISD::SDIV, ISD::SREM);
- if (Res.Val) return Res;
-
- return SDOperand();
-}
-
-SDOperand DAGCombiner::visitUDIVREM(SDNode *N) {
- SDOperand Res = SimplifyNodeWithTwoResults(N, ISD::UDIV, ISD::UREM);
- if (Res.Val) return Res;
-
- return SDOperand();
-}
-
-/// SimplifyBinOpWithSameOpcodeHands - If this is a binary operator with
-/// two operands of the same opcode, try to simplify it.
-SDOperand DAGCombiner::SimplifyBinOpWithSameOpcodeHands(SDNode *N) {
- SDOperand N0 = N->getOperand(0), N1 = N->getOperand(1);
- MVT::ValueType VT = N0.getValueType();
- assert(N0.getOpcode() == N1.getOpcode() && "Bad input!");
-
- // For each of OP in AND/OR/XOR:
- // fold (OP (zext x), (zext y)) -> (zext (OP x, y))
- // fold (OP (sext x), (sext y)) -> (sext (OP x, y))
- // fold (OP (aext x), (aext y)) -> (aext (OP x, y))
- // fold (OP (trunc x), (trunc y)) -> (trunc (OP x, y))
- if ((N0.getOpcode() == ISD::ZERO_EXTEND || N0.getOpcode() == ISD::ANY_EXTEND||
- N0.getOpcode() == ISD::SIGN_EXTEND || N0.getOpcode() == ISD::TRUNCATE) &&
- N0.getOperand(0).getValueType() == N1.getOperand(0).getValueType()) {
- SDOperand ORNode = DAG.getNode(N->getOpcode(),
- N0.getOperand(0).getValueType(),
- N0.getOperand(0), N1.getOperand(0));
- AddToWorkList(ORNode.Val);
- return DAG.getNode(N0.getOpcode(), VT, ORNode);
- }
-
- // For each of OP in SHL/SRL/SRA/AND...
- // fold (and (OP x, z), (OP y, z)) -> (OP (and x, y), z)
- // fold (or (OP x, z), (OP y, z)) -> (OP (or x, y), z)
- // fold (xor (OP x, z), (OP y, z)) -> (OP (xor x, y), z)
- if ((N0.getOpcode() == ISD::SHL || N0.getOpcode() == ISD::SRL ||
- N0.getOpcode() == ISD::SRA || N0.getOpcode() == ISD::AND) &&
- N0.getOperand(1) == N1.getOperand(1)) {
- SDOperand ORNode = DAG.getNode(N->getOpcode(),
- N0.getOperand(0).getValueType(),
- N0.getOperand(0), N1.getOperand(0));
- AddToWorkList(ORNode.Val);
- return DAG.getNode(N0.getOpcode(), VT, ORNode, N0.getOperand(1));
- }
-
- return SDOperand();
-}
-
-SDOperand DAGCombiner::visitAND(SDNode *N) {
- SDOperand N0 = N->getOperand(0);
- SDOperand N1 = N->getOperand(1);
- SDOperand LL, LR, RL, RR, CC0, CC1;
- ConstantSDNode *N0C = dyn_cast<ConstantSDNode>(N0);
- ConstantSDNode *N1C = dyn_cast<ConstantSDNode>(N1);
- MVT::ValueType VT = N1.getValueType();
- unsigned BitWidth = MVT::getSizeInBits(VT);
-
- // fold vector ops
- if (MVT::isVector(VT)) {
- SDOperand FoldedVOp = SimplifyVBinOp(N);
- if (FoldedVOp.Val) return FoldedVOp;
- }
-
- // fold (and x, undef) -> 0
- if (N0.getOpcode() == ISD::UNDEF || N1.getOpcode() == ISD::UNDEF)
- return DAG.getConstant(0, VT);
- // fold (and c1, c2) -> c1&c2
- if (N0C && N1C)
- return DAG.getNode(ISD::AND, VT, N0, N1);
- // canonicalize constant to RHS
- if (N0C && !N1C)
- return DAG.getNode(ISD::AND, VT, N1, N0);
- // fold (and x, -1) -> x
- if (N1C && N1C->isAllOnesValue())
- return N0;
- // if (and x, c) is known to be zero, return 0
- if (N1C && DAG.MaskedValueIsZero(SDOperand(N, 0),
- APInt::getAllOnesValue(BitWidth)))
- return DAG.getConstant(0, VT);
- // reassociate and
- SDOperand RAND = ReassociateOps(ISD::AND, N0, N1);
- if (RAND.Val != 0)
- return RAND;
- // fold (and (or x, 0xFFFF), 0xFF) -> 0xFF
- if (N1C && N0.getOpcode() == ISD::OR)
- if (ConstantSDNode *ORI = dyn_cast<ConstantSDNode>(N0.getOperand(1)))
- if ((ORI->getAPIntValue() & N1C->getAPIntValue()) == N1C->getAPIntValue())
- return N1;
- // fold (and (any_ext V), c) -> (zero_ext V) if 'and' only clears top bits.
- if (N1C && N0.getOpcode() == ISD::ANY_EXTEND) {
- SDOperand N0Op0 = N0.getOperand(0);
- APInt Mask = ~N1C->getAPIntValue();
- Mask.trunc(N0Op0.getValueSizeInBits());
- if (DAG.MaskedValueIsZero(N0Op0, Mask)) {
- SDOperand Zext = DAG.getNode(ISD::ZERO_EXTEND, N0.getValueType(),
- N0Op0);
-
- // Replace uses of the AND with uses of the Zero extend node.
- CombineTo(N, Zext);
-
- // We actually want to replace all uses of the any_extend with the
- // zero_extend, to avoid duplicating things. This will later cause this
- // AND to be folded.
- CombineTo(N0.Val, Zext);
- return SDOperand(N, 0); // Return N so it doesn't get rechecked!
- }
- }
- // fold (and (setcc x), (setcc y)) -> (setcc (and x, y))
- if (isSetCCEquivalent(N0, LL, LR, CC0) && isSetCCEquivalent(N1, RL, RR, CC1)){
- ISD::CondCode Op0 = cast<CondCodeSDNode>(CC0)->get();
- ISD::CondCode Op1 = cast<CondCodeSDNode>(CC1)->get();
-
- if (LR == RR && isa<ConstantSDNode>(LR) && Op0 == Op1 &&
- MVT::isInteger(LL.getValueType())) {
- // fold (X == 0) & (Y == 0) -> (X|Y == 0)
- if (cast<ConstantSDNode>(LR)->isNullValue() && Op1 == ISD::SETEQ) {
- SDOperand ORNode = DAG.getNode(ISD::OR, LR.getValueType(), LL, RL);
- AddToWorkList(ORNode.Val);
- return DAG.getSetCC(VT, ORNode, LR, Op1);
- }
- // fold (X == -1) & (Y == -1) -> (X&Y == -1)
- if (cast<ConstantSDNode>(LR)->isAllOnesValue() && Op1 == ISD::SETEQ) {
- SDOperand ANDNode = DAG.getNode(ISD::AND, LR.getValueType(), LL, RL);
- AddToWorkList(ANDNode.Val);
- return DAG.getSetCC(VT, ANDNode, LR, Op1);
- }
- // fold (X > -1) & (Y > -1) -> (X|Y > -1)
- if (cast<ConstantSDNode>(LR)->isAllOnesValue() && Op1 == ISD::SETGT) {
- SDOperand ORNode = DAG.getNode(ISD::OR, LR.getValueType(), LL, RL);
- AddToWorkList(ORNode.Val);
- return DAG.getSetCC(VT, ORNode, LR, Op1);
- }
- }
- // canonicalize equivalent to ll == rl
- if (LL == RR && LR == RL) {
- Op1 = ISD::getSetCCSwappedOperands(Op1);
- std::swap(RL, RR);
- }
- if (LL == RL && LR == RR) {
- bool isInteger = MVT::isInteger(LL.getValueType());
- ISD::CondCode Result = ISD::getSetCCAndOperation(Op0, Op1, isInteger);
- if (Result != ISD::SETCC_INVALID)
- return DAG.getSetCC(N0.getValueType(), LL, LR, Result);
- }
- }
-
- // Simplify: and (op x...), (op y...) -> (op (and x, y))
- if (N0.getOpcode() == N1.getOpcode()) {
- SDOperand Tmp = SimplifyBinOpWithSameOpcodeHands(N);
- if (Tmp.Val) return Tmp;
- }
-
- // fold (and (sign_extend_inreg x, i16 to i32), 1) -> (and x, 1)
- // fold (and (sra)) -> (and (srl)) when possible.
- if (!MVT::isVector(VT) &&
- SimplifyDemandedBits(SDOperand(N, 0)))
- return SDOperand(N, 0);
- // fold (zext_inreg (extload x)) -> (zextload x)
- if (ISD::isEXTLoad(N0.Val) && ISD::isUNINDEXEDLoad(N0.Val)) {
- LoadSDNode *LN0 = cast<LoadSDNode>(N0);
- MVT::ValueType EVT = LN0->getMemoryVT();
- // If we zero all the possible extended bits, then we can turn this into
- // a zextload if we are running before legalize or the operation is legal.
- unsigned BitWidth = N1.getValueSizeInBits();
- if (DAG.MaskedValueIsZero(N1, APInt::getHighBitsSet(BitWidth,
- BitWidth - MVT::getSizeInBits(EVT))) &&
- (!AfterLegalize || TLI.isLoadXLegal(ISD::ZEXTLOAD, EVT))) {
- SDOperand ExtLoad = DAG.getExtLoad(ISD::ZEXTLOAD, VT, LN0->getChain(),
- LN0->getBasePtr(), LN0->getSrcValue(),
- LN0->getSrcValueOffset(), EVT,
- LN0->isVolatile(),
- LN0->getAlignment());
- AddToWorkList(N);
- CombineTo(N0.Val, ExtLoad, ExtLoad.getValue(1));
- return SDOperand(N, 0); // Return N so it doesn't get rechecked!
- }
- }
- // fold (zext_inreg (sextload x)) -> (zextload x) iff load has one use
- if (ISD::isSEXTLoad(N0.Val) && ISD::isUNINDEXEDLoad(N0.Val) &&
- N0.hasOneUse()) {
- LoadSDNode *LN0 = cast<LoadSDNode>(N0);
- MVT::ValueType EVT = LN0->getMemoryVT();
- // If we zero all the possible extended bits, then we can turn this into
- // a zextload if we are running before legalize or the operation is legal.
- unsigned BitWidth = N1.getValueSizeInBits();
- if (DAG.MaskedValueIsZero(N1, APInt::getHighBitsSet(BitWidth,
- BitWidth - MVT::getSizeInBits(EVT))) &&
- (!AfterLegalize || TLI.isLoadXLegal(ISD::ZEXTLOAD, EVT))) {
- SDOperand ExtLoad = DAG.getExtLoad(ISD::ZEXTLOAD, VT, LN0->getChain(),
- LN0->getBasePtr(), LN0->getSrcValue(),
- LN0->getSrcValueOffset(), EVT,
- LN0->isVolatile(),
- LN0->getAlignment());
- AddToWorkList(N);
- CombineTo(N0.Val, ExtLoad, ExtLoad.getValue(1));
- return SDOperand(N, 0); // Return N so it doesn't get rechecked!
- }
- }
-
- // fold (and (load x), 255) -> (zextload x, i8)
- // fold (and (extload x, i16), 255) -> (zextload x, i8)
- if (N1C && N0.getOpcode() == ISD::LOAD) {
- LoadSDNode *LN0 = cast<LoadSDNode>(N0);
- if (LN0->getExtensionType() != ISD::SEXTLOAD &&
- LN0->isUnindexed() && N0.hasOneUse()) {
- MVT::ValueType EVT, LoadedVT;
- if (N1C->getAPIntValue() == 255)
- EVT = MVT::i8;
- else if (N1C->getAPIntValue() == 65535)
- EVT = MVT::i16;
- else if (N1C->getAPIntValue() == ~0U)
- EVT = MVT::i32;
- else
- EVT = MVT::Other;
-
- LoadedVT = LN0->getMemoryVT();
- if (EVT != MVT::Other && LoadedVT > EVT &&
- (!AfterLegalize || TLI.isLoadXLegal(ISD::ZEXTLOAD, EVT))) {
- MVT::ValueType PtrType = N0.getOperand(1).getValueType();
- // For big endian targets, we need to add an offset to the pointer to
- // load the correct bytes. For little endian systems, we merely need to
- // read fewer bytes from the same pointer.
- unsigned LVTStoreBytes = MVT::getStoreSizeInBits(LoadedVT)/8;
- unsigned EVTStoreBytes = MVT::getStoreSizeInBits(EVT)/8;
- unsigned PtrOff = LVTStoreBytes - EVTStoreBytes;
- unsigned Alignment = LN0->getAlignment();
- SDOperand NewPtr = LN0->getBasePtr();
- if (TLI.isBigEndian()) {
- NewPtr = DAG.getNode(ISD::ADD, PtrType, NewPtr,
- DAG.getConstant(PtrOff, PtrType));
- Alignment = MinAlign(Alignment, PtrOff);
- }
- AddToWorkList(NewPtr.Val);
- SDOperand Load =
- DAG.getExtLoad(ISD::ZEXTLOAD, VT, LN0->getChain(), NewPtr,
- LN0->getSrcValue(), LN0->getSrcValueOffset(), EVT,
- LN0->isVolatile(), Alignment);
- AddToWorkList(N);
- CombineTo(N0.Val, Load, Load.getValue(1));
- return SDOperand(N, 0); // Return N so it doesn't get rechecked!
- }
- }
- }
-
- return SDOperand();
-}
-
-SDOperand DAGCombiner::visitOR(SDNode *N) {
- SDOperand N0 = N->getOperand(0);
- SDOperand N1 = N->getOperand(1);
- SDOperand LL, LR, RL, RR, CC0, CC1;
- ConstantSDNode *N0C = dyn_cast<ConstantSDNode>(N0);
- ConstantSDNode *N1C = dyn_cast<ConstantSDNode>(N1);
- MVT::ValueType VT = N1.getValueType();
-
- // fold vector ops
- if (MVT::isVector(VT)) {
- SDOperand FoldedVOp = SimplifyVBinOp(N);
- if (FoldedVOp.Val) return FoldedVOp;
- }
-
- // fold (or x, undef) -> -1
- if (N0.getOpcode() == ISD::UNDEF || N1.getOpcode() == ISD::UNDEF)
- return DAG.getConstant(~0ULL, VT);
- // fold (or c1, c2) -> c1|c2
- if (N0C && N1C)
- return DAG.getNode(ISD::OR, VT, N0, N1);
- // canonicalize constant to RHS
- if (N0C && !N1C)
- return DAG.getNode(ISD::OR, VT, N1, N0);
- // fold (or x, 0) -> x
- if (N1C && N1C->isNullValue())
- return N0;
- // fold (or x, -1) -> -1
- if (N1C && N1C->isAllOnesValue())
- return N1;
- // fold (or x, c) -> c iff (x & ~c) == 0
- if (N1C && DAG.MaskedValueIsZero(N0, ~N1C->getAPIntValue()))
- return N1;
- // reassociate or
- SDOperand ROR = ReassociateOps(ISD::OR, N0, N1);
- if (ROR.Val != 0)
- return ROR;
- // Canonicalize (or (and X, c1), c2) -> (and (or X, c2), c1|c2)
- if (N1C && N0.getOpcode() == ISD::AND && N0.Val->hasOneUse() &&
- isa<ConstantSDNode>(N0.getOperand(1))) {
- ConstantSDNode *C1 = cast<ConstantSDNode>(N0.getOperand(1));
- return DAG.getNode(ISD::AND, VT, DAG.getNode(ISD::OR, VT, N0.getOperand(0),
- N1),
- DAG.getConstant(N1C->getAPIntValue() |
- C1->getAPIntValue(), VT));
- }
- // fold (or (setcc x), (setcc y)) -> (setcc (or x, y))
- if (isSetCCEquivalent(N0, LL, LR, CC0) && isSetCCEquivalent(N1, RL, RR, CC1)){
- ISD::CondCode Op0 = cast<CondCodeSDNode>(CC0)->get();
- ISD::CondCode Op1 = cast<CondCodeSDNode>(CC1)->get();
-
- if (LR == RR && isa<ConstantSDNode>(LR) && Op0 == Op1 &&
- MVT::isInteger(LL.getValueType())) {
- // fold (X != 0) | (Y != 0) -> (X|Y != 0)
- // fold (X < 0) | (Y < 0) -> (X|Y < 0)
- if (cast<ConstantSDNode>(LR)->isNullValue() &&
- (Op1 == ISD::SETNE || Op1 == ISD::SETLT)) {
- SDOperand ORNode = DAG.getNode(ISD::OR, LR.getValueType(), LL, RL);
- AddToWorkList(ORNode.Val);
- return DAG.getSetCC(VT, ORNode, LR, Op1);
- }
- // fold (X != -1) | (Y != -1) -> (X&Y != -1)
- // fold (X > -1) | (Y > -1) -> (X&Y > -1)
- if (cast<ConstantSDNode>(LR)->isAllOnesValue() &&
- (Op1 == ISD::SETNE || Op1 == ISD::SETGT)) {
- SDOperand ANDNode = DAG.getNode(ISD::AND, LR.getValueType(), LL, RL);
- AddToWorkList(ANDNode.Val);
- return DAG.getSetCC(VT, ANDNode, LR, Op1);
- }
- }
- // canonicalize equivalent to ll == rl
- if (LL == RR && LR == RL) {
- Op1 = ISD::getSetCCSwappedOperands(Op1);
- std::swap(RL, RR);
- }
- if (LL == RL && LR == RR) {
- bool isInteger = MVT::isInteger(LL.getValueType());
- ISD::CondCode Result = ISD::getSetCCOrOperation(Op0, Op1, isInteger);
- if (Result != ISD::SETCC_INVALID)
- return DAG.getSetCC(N0.getValueType(), LL, LR, Result);
- }
- }
-
- // Simplify: or (op x...), (op y...) -> (op (or x, y))
- if (N0.getOpcode() == N1.getOpcode()) {
- SDOperand Tmp = SimplifyBinOpWithSameOpcodeHands(N);
- if (Tmp.Val) return Tmp;
- }
-
- // (X & C1) | (Y & C2) -> (X|Y) & C3 if possible.
- if (N0.getOpcode() == ISD::AND &&
- N1.getOpcode() == ISD::AND &&
- N0.getOperand(1).getOpcode() == ISD::Constant &&
- N1.getOperand(1).getOpcode() == ISD::Constant &&
- // Don't increase # computations.
- (N0.Val->hasOneUse() || N1.Val->hasOneUse())) {
- // We can only do this xform if we know that bits from X that are set in C2
- // but not in C1 are already zero. Likewise for Y.
- const APInt &LHSMask =
- cast<ConstantSDNode>(N0.getOperand(1))->getAPIntValue();
- const APInt &RHSMask =
- cast<ConstantSDNode>(N1.getOperand(1))->getAPIntValue();
-
- if (DAG.MaskedValueIsZero(N0.getOperand(0), RHSMask&~LHSMask) &&
- DAG.MaskedValueIsZero(N1.getOperand(0), LHSMask&~RHSMask)) {
- SDOperand X =DAG.getNode(ISD::OR, VT, N0.getOperand(0), N1.getOperand(0));
- return DAG.getNode(ISD::AND, VT, X, DAG.getConstant(LHSMask|RHSMask, VT));
- }
- }
-
-
- // See if this is some rotate idiom.
- if (SDNode *Rot = MatchRotate(N0, N1))
- return SDOperand(Rot, 0);
-
- return SDOperand();
-}
-
-
-/// MatchRotateHalf - Match "(X shl/srl V1) & V2" where V2 may not be present.
-static bool MatchRotateHalf(SDOperand Op, SDOperand &Shift, SDOperand &Mask) {
- if (Op.getOpcode() == ISD::AND) {
- if (isa<ConstantSDNode>(Op.getOperand(1))) {
- Mask = Op.getOperand(1);
- Op = Op.getOperand(0);
- } else {
- return false;
- }
- }
-
- if (Op.getOpcode() == ISD::SRL || Op.getOpcode() == ISD::SHL) {
- Shift = Op;
- return true;
- }
- return false;
-}
-
-
-// MatchRotate - Handle an 'or' of two operands. If this is one of the many
-// idioms for rotate, and if the target supports rotation instructions, generate
-// a rot[lr].
-SDNode *DAGCombiner::MatchRotate(SDOperand LHS, SDOperand RHS) {
- // Must be a legal type. Expanded an promoted things won't work with rotates.
- MVT::ValueType VT = LHS.getValueType();
- if (!TLI.isTypeLegal(VT)) return 0;
-
- // The target must have at least one rotate flavor.
- bool HasROTL = TLI.isOperationLegal(ISD::ROTL, VT);
- bool HasROTR = TLI.isOperationLegal(ISD::ROTR, VT);
- if (!HasROTL && !HasROTR) return 0;
-
- // Match "(X shl/srl V1) & V2" where V2 may not be present.
- SDOperand LHSShift; // The shift.
- SDOperand LHSMask; // AND value if any.
- if (!MatchRotateHalf(LHS, LHSShift, LHSMask))
- return 0; // Not part of a rotate.
-
- SDOperand RHSShift; // The shift.
- SDOperand RHSMask; // AND value if any.
- if (!MatchRotateHalf(RHS, RHSShift, RHSMask))
- return 0; // Not part of a rotate.
-
- if (LHSShift.getOperand(0) != RHSShift.getOperand(0))
- return 0; // Not shifting the same value.
-
- if (LHSShift.getOpcode() == RHSShift.getOpcode())
- return 0; // Shifts must disagree.
-
- // Canonicalize shl to left side in a shl/srl pair.
- if (RHSShift.getOpcode() == ISD::SHL) {
- std::swap(LHS, RHS);
- std::swap(LHSShift, RHSShift);
- std::swap(LHSMask , RHSMask );
- }
-
- unsigned OpSizeInBits = MVT::getSizeInBits(VT);
- SDOperand LHSShiftArg = LHSShift.getOperand(0);
- SDOperand LHSShiftAmt = LHSShift.getOperand(1);
- SDOperand RHSShiftAmt = RHSShift.getOperand(1);
-
- // fold (or (shl x, C1), (srl x, C2)) -> (rotl x, C1)
- // fold (or (shl x, C1), (srl x, C2)) -> (rotr x, C2)
- if (LHSShiftAmt.getOpcode() == ISD::Constant &&
- RHSShiftAmt.getOpcode() == ISD::Constant) {
- uint64_t LShVal = cast<ConstantSDNode>(LHSShiftAmt)->getValue();
- uint64_t RShVal = cast<ConstantSDNode>(RHSShiftAmt)->getValue();
- if ((LShVal + RShVal) != OpSizeInBits)
- return 0;
-
- SDOperand Rot;
- if (HasROTL)
- Rot = DAG.getNode(ISD::ROTL, VT, LHSShiftArg, LHSShiftAmt);
- else
- Rot = DAG.getNode(ISD::ROTR, VT, LHSShiftArg, RHSShiftAmt);
-
- // If there is an AND of either shifted operand, apply it to the result.
- if (LHSMask.Val || RHSMask.Val) {
- APInt Mask = APInt::getAllOnesValue(OpSizeInBits);
-
- if (LHSMask.Val) {
- APInt RHSBits = APInt::getLowBitsSet(OpSizeInBits, LShVal);
- Mask &= cast<ConstantSDNode>(LHSMask)->getAPIntValue() | RHSBits;
- }
- if (RHSMask.Val) {
- APInt LHSBits = APInt::getHighBitsSet(OpSizeInBits, RShVal);
- Mask &= cast<ConstantSDNode>(RHSMask)->getAPIntValue() | LHSBits;
- }
-
- Rot = DAG.getNode(ISD::AND, VT, Rot, DAG.getConstant(Mask, VT));
- }
-
- return Rot.Val;
- }
-
- // If there is a mask here, and we have a variable shift, we can't be sure
- // that we're masking out the right stuff.
- if (LHSMask.Val || RHSMask.Val)
- return 0;
-
- // fold (or (shl x, y), (srl x, (sub 32, y))) -> (rotl x, y)
- // fold (or (shl x, y), (srl x, (sub 32, y))) -> (rotr x, (sub 32, y))
- if (RHSShiftAmt.getOpcode() == ISD::SUB &&
- LHSShiftAmt == RHSShiftAmt.getOperand(1)) {
- if (ConstantSDNode *SUBC =
- dyn_cast<ConstantSDNode>(RHSShiftAmt.getOperand(0))) {
- if (SUBC->getAPIntValue() == OpSizeInBits) {
- if (HasROTL)
- return DAG.getNode(ISD::ROTL, VT, LHSShiftArg, LHSShiftAmt).Val;
- else
- return DAG.getNode(ISD::ROTR, VT, LHSShiftArg, RHSShiftAmt).Val;
- }
- }
- }
-
- // fold (or (shl x, (sub 32, y)), (srl x, r)) -> (rotr x, y)
- // fold (or (shl x, (sub 32, y)), (srl x, r)) -> (rotl x, (sub 32, y))
- if (LHSShiftAmt.getOpcode() == ISD::SUB &&
- RHSShiftAmt == LHSShiftAmt.getOperand(1)) {
- if (ConstantSDNode *SUBC =
- dyn_cast<ConstantSDNode>(LHSShiftAmt.getOperand(0))) {
- if (SUBC->getAPIntValue() == OpSizeInBits) {
- if (HasROTL)
- return DAG.getNode(ISD::ROTL, VT, LHSShiftArg, LHSShiftAmt).Val;
- else
- return DAG.getNode(ISD::ROTR, VT, LHSShiftArg, RHSShiftAmt).Val;
- }
- }
- }
-
- // Look for sign/zext/any-extended cases:
- if ((LHSShiftAmt.getOpcode() == ISD::SIGN_EXTEND
- || LHSShiftAmt.getOpcode() == ISD::ZERO_EXTEND
- || LHSShiftAmt.getOpcode() == ISD::ANY_EXTEND) &&
- (RHSShiftAmt.getOpcode() == ISD::SIGN_EXTEND
- || RHSShiftAmt.getOpcode() == ISD::ZERO_EXTEND
- || RHSShiftAmt.getOpcode() == ISD::ANY_EXTEND)) {
- SDOperand LExtOp0 = LHSShiftAmt.getOperand(0);
- SDOperand RExtOp0 = RHSShiftAmt.getOperand(0);
- if (RExtOp0.getOpcode() == ISD::SUB &&
- RExtOp0.getOperand(1) == LExtOp0) {
- // fold (or (shl x, (*ext y)), (srl x, (*ext (sub 32, y)))) ->
- // (rotr x, y)
- // fold (or (shl x, (*ext y)), (srl x, (*ext (sub 32, y)))) ->
- // (rotl x, (sub 32, y))
- if (ConstantSDNode *SUBC = cast<ConstantSDNode>(RExtOp0.getOperand(0))) {
- if (SUBC->getAPIntValue() == OpSizeInBits) {
- if (HasROTL)
- return DAG.getNode(ISD::ROTL, VT, LHSShiftArg, LHSShiftAmt).Val;
- else
- return DAG.getNode(ISD::ROTR, VT, LHSShiftArg, RHSShiftAmt).Val;
- }
- }
- } else if (LExtOp0.getOpcode() == ISD::SUB &&
- RExtOp0 == LExtOp0.getOperand(1)) {
- // fold (or (shl x, (*ext (sub 32, y))), (srl x, (*ext r))) ->
- // (rotl x, y)
- // fold (or (shl x, (*ext (sub 32, y))), (srl x, (*ext r))) ->
- // (rotr x, (sub 32, y))
- if (ConstantSDNode *SUBC = cast<ConstantSDNode>(LExtOp0.getOperand(0))) {
- if (SUBC->getAPIntValue() == OpSizeInBits) {
- if (HasROTL)
- return DAG.getNode(ISD::ROTL, VT, LHSShiftArg, RHSShiftAmt).Val;
- else
- return DAG.getNode(ISD::ROTL, VT, LHSShiftArg, LHSShiftAmt).Val;
- }
- }
- }
- }
-
- return 0;
-}
-
-
-SDOperand DAGCombiner::visitXOR(SDNode *N) {
- SDOperand N0 = N->getOperand(0);
- SDOperand N1 = N->getOperand(1);
- SDOperand LHS, RHS, CC;
- ConstantSDNode *N0C = dyn_cast<ConstantSDNode>(N0);
- ConstantSDNode *N1C = dyn_cast<ConstantSDNode>(N1);
- MVT::ValueType VT = N0.getValueType();
-
- // fold vector ops
- if (MVT::isVector(VT)) {
- SDOperand FoldedVOp = SimplifyVBinOp(N);
- if (FoldedVOp.Val) return FoldedVOp;
- }
-
- // fold (xor undef, undef) -> 0. This is a common idiom (misuse).
- if (N0.getOpcode() == ISD::UNDEF && N1.getOpcode() == ISD::UNDEF)
- return DAG.getConstant(0, VT);
- // fold (xor x, undef) -> undef
- if (N0.getOpcode() == ISD::UNDEF)
- return N0;
- if (N1.getOpcode() == ISD::UNDEF)
- return N1;
- // fold (xor c1, c2) -> c1^c2
- if (N0C && N1C)
- return DAG.getNode(ISD::XOR, VT, N0, N1);
- // canonicalize constant to RHS
- if (N0C && !N1C)
- return DAG.getNode(ISD::XOR, VT, N1, N0);
- // fold (xor x, 0) -> x
- if (N1C && N1C->isNullValue())
- return N0;
- // reassociate xor
- SDOperand RXOR = ReassociateOps(ISD::XOR, N0, N1);
- if (RXOR.Val != 0)
- return RXOR;
- // fold !(x cc y) -> (x !cc y)
- if (N1C && N1C->getAPIntValue() == 1 && isSetCCEquivalent(N0, LHS, RHS, CC)) {
- bool isInt = MVT::isInteger(LHS.getValueType());
- ISD::CondCode NotCC = ISD::getSetCCInverse(cast<CondCodeSDNode>(CC)->get(),
- isInt);
- if (N0.getOpcode() == ISD::SETCC)
- return DAG.getSetCC(VT, LHS, RHS, NotCC);
- if (N0.getOpcode() == ISD::SELECT_CC)
- return DAG.getSelectCC(LHS, RHS, N0.getOperand(2),N0.getOperand(3),NotCC);
- assert(0 && "Unhandled SetCC Equivalent!");
- abort();
- }
- // fold (not (zext (setcc x, y))) -> (zext (not (setcc x, y)))
- if (N1C && N1C->getAPIntValue() == 1 && N0.getOpcode() == ISD::ZERO_EXTEND &&
- N0.Val->hasOneUse() && isSetCCEquivalent(N0.getOperand(0), LHS, RHS, CC)){
- SDOperand V = N0.getOperand(0);
- V = DAG.getNode(ISD::XOR, V.getValueType(), V,
- DAG.getConstant(1, V.getValueType()));
- AddToWorkList(V.Val);
- return DAG.getNode(ISD::ZERO_EXTEND, VT, V);
- }
-
- // fold !(x or y) -> (!x and !y) iff x or y are setcc
- if (N1C && N1C->getAPIntValue() == 1 && VT == MVT::i1 &&
- (N0.getOpcode() == ISD::OR || N0.getOpcode() == ISD::AND)) {
- SDOperand LHS = N0.getOperand(0), RHS = N0.getOperand(1);
- if (isOneUseSetCC(RHS) || isOneUseSetCC(LHS)) {
- unsigned NewOpcode = N0.getOpcode() == ISD::AND ? ISD::OR : ISD::AND;
- LHS = DAG.getNode(ISD::XOR, VT, LHS, N1); // RHS = ~LHS
- RHS = DAG.getNode(ISD::XOR, VT, RHS, N1); // RHS = ~RHS
- AddToWorkList(LHS.Val); AddToWorkList(RHS.Val);
- return DAG.getNode(NewOpcode, VT, LHS, RHS);
- }
- }
- // fold !(x or y) -> (!x and !y) iff x or y are constants
- if (N1C && N1C->isAllOnesValue() &&
- (N0.getOpcode() == ISD::OR || N0.getOpcode() == ISD::AND)) {
- SDOperand LHS = N0.getOperand(0), RHS = N0.getOperand(1);
- if (isa<ConstantSDNode>(RHS) || isa<ConstantSDNode>(LHS)) {
- unsigned NewOpcode = N0.getOpcode() == ISD::AND ? ISD::OR : ISD::AND;
- LHS = DAG.getNode(ISD::XOR, VT, LHS, N1); // RHS = ~LHS
- RHS = DAG.getNode(ISD::XOR, VT, RHS, N1); // RHS = ~RHS
- AddToWorkList(LHS.Val); AddToWorkList(RHS.Val);
- return DAG.getNode(NewOpcode, VT, LHS, RHS);
- }
- }
- // fold (xor (xor x, c1), c2) -> (xor x, c1^c2)
- if (N1C && N0.getOpcode() == ISD::XOR) {
- ConstantSDNode *N00C = dyn_cast<ConstantSDNode>(N0.getOperand(0));
- ConstantSDNode *N01C = dyn_cast<ConstantSDNode>(N0.getOperand(1));
- if (N00C)
- return DAG.getNode(ISD::XOR, VT, N0.getOperand(1),
- DAG.getConstant(N1C->getAPIntValue()^
- N00C->getAPIntValue(), VT));
- if (N01C)
- return DAG.getNode(ISD::XOR, VT, N0.getOperand(0),
- DAG.getConstant(N1C->getAPIntValue()^
- N01C->getAPIntValue(), VT));
- }
- // fold (xor x, x) -> 0
- if (N0 == N1) {
- if (!MVT::isVector(VT)) {
- return DAG.getConstant(0, VT);
- } else if (!AfterLegalize || TLI.isOperationLegal(ISD::BUILD_VECTOR, VT)) {
- // Produce a vector of zeros.
- SDOperand El = DAG.getConstant(0, MVT::getVectorElementType(VT));
- std::vector<SDOperand> Ops(MVT::getVectorNumElements(VT), El);
- return DAG.getNode(ISD::BUILD_VECTOR, VT, &Ops[0], Ops.size());
- }
- }
-
- // Simplify: xor (op x...), (op y...) -> (op (xor x, y))
- if (N0.getOpcode() == N1.getOpcode()) {
- SDOperand Tmp = SimplifyBinOpWithSameOpcodeHands(N);
- if (Tmp.Val) return Tmp;
- }
-
- // Simplify the expression using non-local knowledge.
- if (!MVT::isVector(VT) &&
- SimplifyDemandedBits(SDOperand(N, 0)))
- return SDOperand(N, 0);
-
- return SDOperand();
-}
-
-/// visitShiftByConstant - Handle transforms common to the three shifts, when
-/// the shift amount is a constant.
-SDOperand DAGCombiner::visitShiftByConstant(SDNode *N, unsigned Amt) {
- SDNode *LHS = N->getOperand(0).Val;
- if (!LHS->hasOneUse()) return SDOperand();
-
- // We want to pull some binops through shifts, so that we have (and (shift))
- // instead of (shift (and)), likewise for add, or, xor, etc. This sort of
- // thing happens with address calculations, so it's important to canonicalize
- // it.
- bool HighBitSet = false; // Can we transform this if the high bit is set?
-
- switch (LHS->getOpcode()) {
- default: return SDOperand();
- case ISD::OR:
- case ISD::XOR:
- HighBitSet = false; // We can only transform sra if the high bit is clear.
- break;
- case ISD::AND:
- HighBitSet = true; // We can only transform sra if the high bit is set.
- break;
- case ISD::ADD:
- if (N->getOpcode() != ISD::SHL)
- return SDOperand(); // only shl(add) not sr[al](add).
- HighBitSet = false; // We can only transform sra if the high bit is clear.
- break;
- }
-
- // We require the RHS of the binop to be a constant as well.
- ConstantSDNode *BinOpCst = dyn_cast<ConstantSDNode>(LHS->getOperand(1));
- if (!BinOpCst) return SDOperand();
-
-
- // FIXME: disable this for unless the input to the binop is a shift by a
- // constant. If it is not a shift, it pessimizes some common cases like:
- //
- //void foo(int *X, int i) { X[i & 1235] = 1; }
- //int bar(int *X, int i) { return X[i & 255]; }
- SDNode *BinOpLHSVal = LHS->getOperand(0).Val;
- if ((BinOpLHSVal->getOpcode() != ISD::SHL &&
- BinOpLHSVal->getOpcode() != ISD::SRA &&
- BinOpLHSVal->getOpcode() != ISD::SRL) ||
- !isa<ConstantSDNode>(BinOpLHSVal->getOperand(1)))
- return SDOperand();
-
- MVT::ValueType VT = N->getValueType(0);
-
- // If this is a signed shift right, and the high bit is modified
- // by the logical operation, do not perform the transformation.
- // The highBitSet boolean indicates the value of the high bit of
- // the constant which would cause it to be modified for this
- // operation.
- if (N->getOpcode() == ISD::SRA) {
- bool BinOpRHSSignSet = BinOpCst->getAPIntValue().isNegative();
- if (BinOpRHSSignSet != HighBitSet)
- return SDOperand();
- }
-
- // Fold the constants, shifting the binop RHS by the shift amount.
- SDOperand NewRHS = DAG.getNode(N->getOpcode(), N->getValueType(0),
- LHS->getOperand(1), N->getOperand(1));
-
- // Create the new shift.
- SDOperand NewShift = DAG.getNode(N->getOpcode(), VT, LHS->getOperand(0),
- N->getOperand(1));
-
- // Create the new binop.
- return DAG.getNode(LHS->getOpcode(), VT, NewShift, NewRHS);
-}
-
-
-SDOperand DAGCombiner::visitSHL(SDNode *N) {
- SDOperand N0 = N->getOperand(0);
- SDOperand N1 = N->getOperand(1);
- ConstantSDNode *N0C = dyn_cast<ConstantSDNode>(N0);
- ConstantSDNode *N1C = dyn_cast<ConstantSDNode>(N1);
- MVT::ValueType VT = N0.getValueType();
- unsigned OpSizeInBits = MVT::getSizeInBits(VT);
-
- // fold (shl c1, c2) -> c1<<c2
- if (N0C && N1C)
- return DAG.getNode(ISD::SHL, VT, N0, N1);
- // fold (shl 0, x) -> 0
- if (N0C && N0C->isNullValue())
- return N0;
- // fold (shl x, c >= size(x)) -> undef
- if (N1C && N1C->getValue() >= OpSizeInBits)
- return DAG.getNode(ISD::UNDEF, VT);
- // fold (shl x, 0) -> x
- if (N1C && N1C->isNullValue())
- return N0;
- // if (shl x, c) is known to be zero, return 0
- if (DAG.MaskedValueIsZero(SDOperand(N, 0),
- APInt::getAllOnesValue(MVT::getSizeInBits(VT))))
- return DAG.getConstant(0, VT);
- if (N1C && SimplifyDemandedBits(SDOperand(N, 0)))
- return SDOperand(N, 0);
- // fold (shl (shl x, c1), c2) -> 0 or (shl x, c1+c2)
- if (N1C && N0.getOpcode() == ISD::SHL &&
- N0.getOperand(1).getOpcode() == ISD::Constant) {
- uint64_t c1 = cast<ConstantSDNode>(N0.getOperand(1))->getValue();
- uint64_t c2 = N1C->getValue();
- if (c1 + c2 > OpSizeInBits)
- return DAG.getConstant(0, VT);
- return DAG.getNode(ISD::SHL, VT, N0.getOperand(0),
- DAG.getConstant(c1 + c2, N1.getValueType()));
- }
- // fold (shl (srl x, c1), c2) -> (shl (and x, -1 << c1), c2-c1) or
- // (srl (and x, -1 << c1), c1-c2)
- if (N1C && N0.getOpcode() == ISD::SRL &&
- N0.getOperand(1).getOpcode() == ISD::Constant) {
- uint64_t c1 = cast<ConstantSDNode>(N0.getOperand(1))->getValue();
- uint64_t c2 = N1C->getValue();
- SDOperand Mask = DAG.getNode(ISD::AND, VT, N0.getOperand(0),
- DAG.getConstant(~0ULL << c1, VT));
- if (c2 > c1)
- return DAG.getNode(ISD::SHL, VT, Mask,
- DAG.getConstant(c2-c1, N1.getValueType()));
- else
- return DAG.getNode(ISD::SRL, VT, Mask,
- DAG.getConstant(c1-c2, N1.getValueType()));
- }
- // fold (shl (sra x, c1), c1) -> (and x, -1 << c1)
- if (N1C && N0.getOpcode() == ISD::SRA && N1 == N0.getOperand(1))
- return DAG.getNode(ISD::AND, VT, N0.getOperand(0),
- DAG.getConstant(~0ULL << N1C->getValue(), VT));
-
- return N1C ? visitShiftByConstant(N, N1C->getValue()) : SDOperand();
-}
-
-SDOperand DAGCombiner::visitSRA(SDNode *N) {
- SDOperand N0 = N->getOperand(0);
- SDOperand N1 = N->getOperand(1);
- ConstantSDNode *N0C = dyn_cast<ConstantSDNode>(N0);
- ConstantSDNode *N1C = dyn_cast<ConstantSDNode>(N1);
- MVT::ValueType VT = N0.getValueType();
-
- // fold (sra c1, c2) -> c1>>c2
- if (N0C && N1C)
- return DAG.getNode(ISD::SRA, VT, N0, N1);
- // fold (sra 0, x) -> 0
- if (N0C && N0C->isNullValue())
- return N0;
- // fold (sra -1, x) -> -1
- if (N0C && N0C->isAllOnesValue())
- return N0;
- // fold (sra x, c >= size(x)) -> undef
- if (N1C && N1C->getValue() >= MVT::getSizeInBits(VT))
- return DAG.getNode(ISD::UNDEF, VT);
- // fold (sra x, 0) -> x
- if (N1C && N1C->isNullValue())
- return N0;
- // fold (sra (shl x, c1), c1) -> sext_inreg for some c1 and target supports
- // sext_inreg.
- if (N1C && N0.getOpcode() == ISD::SHL && N1 == N0.getOperand(1)) {
- unsigned LowBits = MVT::getSizeInBits(VT) - (unsigned)N1C->getValue();
- MVT::ValueType EVT;
- switch (LowBits) {
- default: EVT = MVT::Other; break;
- case 1: EVT = MVT::i1; break;
- case 8: EVT = MVT::i8; break;
- case 16: EVT = MVT::i16; break;
- case 32: EVT = MVT::i32; break;
- }
- if (EVT > MVT::Other && TLI.isOperationLegal(ISD::SIGN_EXTEND_INREG, EVT))
- return DAG.getNode(ISD::SIGN_EXTEND_INREG, VT, N0.getOperand(0),
- DAG.getValueType(EVT));
- }
-
- // fold (sra (sra x, c1), c2) -> (sra x, c1+c2)
- if (N1C && N0.getOpcode() == ISD::SRA) {
- if (ConstantSDNode *C1 = dyn_cast<ConstantSDNode>(N0.getOperand(1))) {
- unsigned Sum = N1C->getValue() + C1->getValue();
- if (Sum >= MVT::getSizeInBits(VT)) Sum = MVT::getSizeInBits(VT)-1;
- return DAG.getNode(ISD::SRA, VT, N0.getOperand(0),
- DAG.getConstant(Sum, N1C->getValueType(0)));
- }
- }
-
- // fold sra (shl X, m), result_size - n
- // -> (sign_extend (trunc (shl X, result_size - n - m))) for
- // result_size - n != m.
- // If truncate is free for the target sext(shl) is likely to result in better
- // code.
- if (N0.getOpcode() == ISD::SHL) {
- // Get the two constanst of the shifts, CN0 = m, CN = n.
- const ConstantSDNode *N01C = dyn_cast<ConstantSDNode>(N0.getOperand(1));
- if (N01C && N1C) {
- // Determine what the truncate's result bitsize and type would be.
- unsigned VTValSize = MVT::getSizeInBits(VT);
- MVT::ValueType TruncVT = MVT::getIntegerType(VTValSize - N1C->getValue());
- // Determine the residual right-shift amount.
- unsigned ShiftAmt = N1C->getValue() - N01C->getValue();
-
- // If the shift is not a no-op (in which case this should be just a sign
- // extend already), the truncated to type is legal, sign_extend is legal
- // on that type, and the the truncate to that type is both legal and free,
- // perform the transform.
- if (ShiftAmt &&
- TLI.isTypeLegal(TruncVT) &&
- TLI.isOperationLegal(ISD::SIGN_EXTEND, TruncVT) &&
- TLI.isOperationLegal(ISD::TRUNCATE, VT) &&
- TLI.isTruncateFree(VT, TruncVT)) {
-
- SDOperand Amt = DAG.getConstant(ShiftAmt, TLI.getShiftAmountTy());
- SDOperand Shift = DAG.getNode(ISD::SRL, VT, N0.getOperand(0), Amt);
- SDOperand Trunc = DAG.getNode(ISD::TRUNCATE, TruncVT, Shift);
- return DAG.getNode(ISD::SIGN_EXTEND, N->getValueType(0), Trunc);
- }
- }
- }
-
- // Simplify, based on bits shifted out of the LHS.
- if (N1C && SimplifyDemandedBits(SDOperand(N, 0)))
- return SDOperand(N, 0);
-
-
- // If the sign bit is known to be zero, switch this to a SRL.
- if (DAG.SignBitIsZero(N0))
- return DAG.getNode(ISD::SRL, VT, N0, N1);
-
- return N1C ? visitShiftByConstant(N, N1C->getValue()) : SDOperand();
-}
-
-SDOperand DAGCombiner::visitSRL(SDNode *N) {
- SDOperand N0 = N->getOperand(0);
- SDOperand N1 = N->getOperand(1);
- ConstantSDNode *N0C = dyn_cast<ConstantSDNode>(N0);
- ConstantSDNode *N1C = dyn_cast<ConstantSDNode>(N1);
- MVT::ValueType VT = N0.getValueType();
- unsigned OpSizeInBits = MVT::getSizeInBits(VT);
-
- // fold (srl c1, c2) -> c1 >>u c2
- if (N0C && N1C)
- return DAG.getNode(ISD::SRL, VT, N0, N1);
- // fold (srl 0, x) -> 0
- if (N0C && N0C->isNullValue())
- return N0;
- // fold (srl x, c >= size(x)) -> undef
- if (N1C && N1C->getValue() >= OpSizeInBits)
- return DAG.getNode(ISD::UNDEF, VT);
- // fold (srl x, 0) -> x
- if (N1C && N1C->isNullValue())
- return N0;
- // if (srl x, c) is known to be zero, return 0
- if (N1C && DAG.MaskedValueIsZero(SDOperand(N, 0),
- APInt::getAllOnesValue(OpSizeInBits)))
- return DAG.getConstant(0, VT);
-
- // fold (srl (srl x, c1), c2) -> 0 or (srl x, c1+c2)
- if (N1C && N0.getOpcode() == ISD::SRL &&
- N0.getOperand(1).getOpcode() == ISD::Constant) {
- uint64_t c1 = cast<ConstantSDNode>(N0.getOperand(1))->getValue();
- uint64_t c2 = N1C->getValue();
- if (c1 + c2 > OpSizeInBits)
- return DAG.getConstant(0, VT);
- return DAG.getNode(ISD::SRL, VT, N0.getOperand(0),
- DAG.getConstant(c1 + c2, N1.getValueType()));
- }
-
- // fold (srl (anyextend x), c) -> (anyextend (srl x, c))
- if (N1C && N0.getOpcode() == ISD::ANY_EXTEND) {
- // Shifting in all undef bits?
- MVT::ValueType SmallVT = N0.getOperand(0).getValueType();
- if (N1C->getValue() >= MVT::getSizeInBits(SmallVT))
- return DAG.getNode(ISD::UNDEF, VT);
-
- SDOperand SmallShift = DAG.getNode(ISD::SRL, SmallVT, N0.getOperand(0), N1);
- AddToWorkList(SmallShift.Val);
- return DAG.getNode(ISD::ANY_EXTEND, VT, SmallShift);
- }
-
- // fold (srl (sra X, Y), 31) -> (srl X, 31). This srl only looks at the sign
- // bit, which is unmodified by sra.
- if (N1C && N1C->getValue()+1 == MVT::getSizeInBits(VT)) {
- if (N0.getOpcode() == ISD::SRA)
- return DAG.getNode(ISD::SRL, VT, N0.getOperand(0), N1);
- }
-
- // fold (srl (ctlz x), "5") -> x iff x has one bit set (the low bit).
- if (N1C && N0.getOpcode() == ISD::CTLZ &&
- N1C->getAPIntValue() == Log2_32(MVT::getSizeInBits(VT))) {
- APInt KnownZero, KnownOne;
- APInt Mask = APInt::getAllOnesValue(MVT::getSizeInBits(VT));
- DAG.ComputeMaskedBits(N0.getOperand(0), Mask, KnownZero, KnownOne);
-
- // If any of the input bits are KnownOne, then the input couldn't be all
- // zeros, thus the result of the srl will always be zero.
- if (KnownOne.getBoolValue()) return DAG.getConstant(0, VT);
-
- // If all of the bits input the to ctlz node are known to be zero, then
- // the result of the ctlz is "32" and the result of the shift is one.
- APInt UnknownBits = ~KnownZero & Mask;
- if (UnknownBits == 0) return DAG.getConstant(1, VT);
-
- // Otherwise, check to see if there is exactly one bit input to the ctlz.
- if ((UnknownBits & (UnknownBits-1)) == 0) {
- // Okay, we know that only that the single bit specified by UnknownBits
- // could be set on input to the CTLZ node. If this bit is set, the SRL
- // will return 0, if it is clear, it returns 1. Change the CTLZ/SRL pair
- // to an SRL,XOR pair, which is likely to simplify more.
- unsigned ShAmt = UnknownBits.countTrailingZeros();
- SDOperand Op = N0.getOperand(0);
- if (ShAmt) {
- Op = DAG.getNode(ISD::SRL, VT, Op,
- DAG.getConstant(ShAmt, TLI.getShiftAmountTy()));
- AddToWorkList(Op.Val);
- }
- return DAG.getNode(ISD::XOR, VT, Op, DAG.getConstant(1, VT));
- }
- }
-
- // fold operands of srl based on knowledge that the low bits are not
- // demanded.
- if (N1C && SimplifyDemandedBits(SDOperand(N, 0)))
- return SDOperand(N, 0);
-
- return N1C ? visitShiftByConstant(N, N1C->getValue()) : SDOperand();
-}
-
-SDOperand DAGCombiner::visitCTLZ(SDNode *N) {
- SDOperand N0 = N->getOperand(0);
- MVT::ValueType VT = N->getValueType(0);
-
- // fold (ctlz c1) -> c2
- if (isa<ConstantSDNode>(N0))
- return DAG.getNode(ISD::CTLZ, VT, N0);
- return SDOperand();
-}
-
-SDOperand DAGCombiner::visitCTTZ(SDNode *N) {
- SDOperand N0 = N->getOperand(0);
- MVT::ValueType VT = N->getValueType(0);
-
- // fold (cttz c1) -> c2
- if (isa<ConstantSDNode>(N0))
- return DAG.getNode(ISD::CTTZ, VT, N0);
- return SDOperand();
-}
-
-SDOperand DAGCombiner::visitCTPOP(SDNode *N) {
- SDOperand N0 = N->getOperand(0);
- MVT::ValueType VT = N->getValueType(0);
-
- // fold (ctpop c1) -> c2
- if (isa<ConstantSDNode>(N0))
- return DAG.getNode(ISD::CTPOP, VT, N0);
- return SDOperand();
-}
-
-SDOperand DAGCombiner::visitSELECT(SDNode *N) {
- SDOperand N0 = N->getOperand(0);
- SDOperand N1 = N->getOperand(1);
- SDOperand N2 = N->getOperand(2);
- ConstantSDNode *N0C = dyn_cast<ConstantSDNode>(N0);
- ConstantSDNode *N1C = dyn_cast<ConstantSDNode>(N1);
- ConstantSDNode *N2C = dyn_cast<ConstantSDNode>(N2);
- MVT::ValueType VT = N->getValueType(0);
- MVT::ValueType VT0 = N0.getValueType();
-
- // fold select C, X, X -> X
- if (N1 == N2)
- return N1;
- // fold select true, X, Y -> X
- if (N0C && !N0C->isNullValue())
- return N1;
- // fold select false, X, Y -> Y
- if (N0C && N0C->isNullValue())
- return N2;
- // fold select C, 1, X -> C | X
- if (MVT::i1 == VT && N1C && N1C->getAPIntValue() == 1)
- return DAG.getNode(ISD::OR, VT, N0, N2);
- // fold select C, 0, 1 -> ~C
- if (MVT::isInteger(VT) && MVT::isInteger(VT0) &&
- N1C && N2C && N1C->isNullValue() && N2C->getAPIntValue() == 1) {
- SDOperand XORNode = DAG.getNode(ISD::XOR, VT0, N0, DAG.getConstant(1, VT0));
- if (VT == VT0)
- return XORNode;
- AddToWorkList(XORNode.Val);
- if (MVT::getSizeInBits(VT) > MVT::getSizeInBits(VT0))
- return DAG.getNode(ISD::ZERO_EXTEND, VT, XORNode);
- return DAG.getNode(ISD::TRUNCATE, VT, XORNode);
- }
- // fold select C, 0, X -> ~C & X
- if (VT == VT0 && VT == MVT::i1 && N1C && N1C->isNullValue()) {
- SDOperand XORNode = DAG.getNode(ISD::XOR, VT, N0, DAG.getConstant(1, VT));
- AddToWorkList(XORNode.Val);
- return DAG.getNode(ISD::AND, VT, XORNode, N2);
- }
- // fold select C, X, 1 -> ~C | X
- if (VT == VT0 && VT == MVT::i1 && N2C && N2C->getAPIntValue() == 1) {
- SDOperand XORNode = DAG.getNode(ISD::XOR, VT, N0, DAG.getConstant(1, VT));
- AddToWorkList(XORNode.Val);
- return DAG.getNode(ISD::OR, VT, XORNode, N1);
- }
- // fold select C, X, 0 -> C & X
- // FIXME: this should check for C type == X type, not i1?
- if (MVT::i1 == VT && N2C && N2C->isNullValue())
- return DAG.getNode(ISD::AND, VT, N0, N1);
- // fold X ? X : Y --> X ? 1 : Y --> X | Y
- if (MVT::i1 == VT && N0 == N1)
- return DAG.getNode(ISD::OR, VT, N0, N2);
- // fold X ? Y : X --> X ? Y : 0 --> X & Y
- if (MVT::i1 == VT && N0 == N2)
- return DAG.getNode(ISD::AND, VT, N0, N1);
-
- // If we can fold this based on the true/false value, do so.
- if (SimplifySelectOps(N, N1, N2))
- return SDOperand(N, 0); // Don't revisit N.
-
- // fold selects based on a setcc into other things, such as min/max/abs
- if (N0.getOpcode() == ISD::SETCC) {
- // FIXME:
- // Check against MVT::Other for SELECT_CC, which is a workaround for targets
- // having to say they don't support SELECT_CC on every type the DAG knows
- // about, since there is no way to mark an opcode illegal at all value types
- if (TLI.isOperationLegal(ISD::SELECT_CC, MVT::Other))
- return DAG.getNode(ISD::SELECT_CC, VT, N0.getOperand(0), N0.getOperand(1),
- N1, N2, N0.getOperand(2));
- else
- return SimplifySelect(N0, N1, N2);
- }
- return SDOperand();
-}
-
-SDOperand DAGCombiner::visitSELECT_CC(SDNode *N) {
- SDOperand N0 = N->getOperand(0);
- SDOperand N1 = N->getOperand(1);
- SDOperand N2 = N->getOperand(2);
- SDOperand N3 = N->getOperand(3);
- SDOperand N4 = N->getOperand(4);
- ISD::CondCode CC = cast<CondCodeSDNode>(N4)->get();
-
- // fold select_cc lhs, rhs, x, x, cc -> x
- if (N2 == N3)
- return N2;
-
- // Determine if the condition we're dealing with is constant
- SDOperand SCC = SimplifySetCC(TLI.getSetCCResultType(N0), N0, N1, CC, false);
- if (SCC.Val) AddToWorkList(SCC.Val);
-
- if (ConstantSDNode *SCCC = dyn_cast_or_null<ConstantSDNode>(SCC.Val)) {
- if (!SCCC->isNullValue())
- return N2; // cond always true -> true val
- else
- return N3; // cond always false -> false val
- }
-
- // Fold to a simpler select_cc
- if (SCC.Val && SCC.getOpcode() == ISD::SETCC)
- return DAG.getNode(ISD::SELECT_CC, N2.getValueType(),
- SCC.getOperand(0), SCC.getOperand(1), N2, N3,
- SCC.getOperand(2));
-
- // If we can fold this based on the true/false value, do so.
- if (SimplifySelectOps(N, N2, N3))
- return SDOperand(N, 0); // Don't revisit N.
-
- // fold select_cc into other things, such as min/max/abs
- return SimplifySelectCC(N0, N1, N2, N3, CC);
-}
-
-SDOperand DAGCombiner::visitSETCC(SDNode *N) {
- return SimplifySetCC(N->getValueType(0), N->getOperand(0), N->getOperand(1),
- cast<CondCodeSDNode>(N->getOperand(2))->get());
-}
-
-// ExtendUsesToFormExtLoad - Trying to extend uses of a load to enable this:
-// "fold ({s|z}ext (load x)) -> ({s|z}ext (truncate ({s|z}extload x)))"
-// transformation. Returns true if extension are possible and the above
-// mentioned transformation is profitable.
-static bool ExtendUsesToFormExtLoad(SDNode *N, SDOperand N0,
- unsigned ExtOpc,
- SmallVector<SDNode*, 4> &ExtendNodes,
- TargetLowering &TLI) {
- bool HasCopyToRegUses = false;
- bool isTruncFree = TLI.isTruncateFree(N->getValueType(0), N0.getValueType());
- for (SDNode::use_iterator UI = N0.Val->use_begin(), UE = N0.Val->use_end();
- UI != UE; ++UI) {
- SDNode *User = UI->getUser();
- if (User == N)
- continue;
- // FIXME: Only extend SETCC N, N and SETCC N, c for now.
- if (User->getOpcode() == ISD::SETCC) {
- ISD::CondCode CC = cast<CondCodeSDNode>(User->getOperand(2))->get();
- if (ExtOpc == ISD::ZERO_EXTEND && ISD::isSignedIntSetCC(CC))
- // Sign bits will be lost after a zext.
- return false;
- bool Add = false;
- for (unsigned i = 0; i != 2; ++i) {
- SDOperand UseOp = User->getOperand(i);
- if (UseOp == N0)
- continue;
- if (!isa<ConstantSDNode>(UseOp))
- return false;
- Add = true;
- }
- if (Add)
- ExtendNodes.push_back(User);
- } else {
- for (unsigned i = 0, e = User->getNumOperands(); i != e; ++i) {
- SDOperand UseOp = User->getOperand(i);
- if (UseOp == N0) {
- // If truncate from extended type to original load type is free
- // on this target, then it's ok to extend a CopyToReg.
- if (isTruncFree && User->getOpcode() == ISD::CopyToReg)
- HasCopyToRegUses = true;
- else
- return false;
- }
- }
- }
- }
-
- if (HasCopyToRegUses) {
- bool BothLiveOut = false;
- for (SDNode::use_iterator UI = N->use_begin(), UE = N->use_end();
- UI != UE; ++UI) {
- SDNode *User = UI->getUser();
- for (unsigned i = 0, e = User->getNumOperands(); i != e; ++i) {
- SDOperand UseOp = User->getOperand(i);
- if (UseOp.Val == N && UseOp.ResNo == 0) {
- BothLiveOut = true;
- break;
- }
- }
- }
- if (BothLiveOut)
- // Both unextended and extended values are live out. There had better be
- // good a reason for the transformation.
- return ExtendNodes.size();
- }
- return true;
-}
-
-SDOperand DAGCombiner::visitSIGN_EXTEND(SDNode *N) {
- SDOperand N0 = N->getOperand(0);
- MVT::ValueType VT = N->getValueType(0);
-
- // fold (sext c1) -> c1
- if (isa<ConstantSDNode>(N0))
- return DAG.getNode(ISD::SIGN_EXTEND, VT, N0);
-
- // fold (sext (sext x)) -> (sext x)
- // fold (sext (aext x)) -> (sext x)
- if (N0.getOpcode() == ISD::SIGN_EXTEND || N0.getOpcode() == ISD::ANY_EXTEND)
- return DAG.getNode(ISD::SIGN_EXTEND, VT, N0.getOperand(0));
-
- // fold (sext (truncate (load x))) -> (sext (smaller load x))
- // fold (sext (truncate (srl (load x), c))) -> (sext (smaller load (x+c/n)))
- if (N0.getOpcode() == ISD::TRUNCATE) {
- SDOperand NarrowLoad = ReduceLoadWidth(N0.Val);
- if (NarrowLoad.Val) {
- if (NarrowLoad.Val != N0.Val)
- CombineTo(N0.Val, NarrowLoad);
- return DAG.getNode(ISD::SIGN_EXTEND, VT, NarrowLoad);
- }
- }
-
- // See if the value being truncated is already sign extended. If so, just
- // eliminate the trunc/sext pair.
- if (N0.getOpcode() == ISD::TRUNCATE) {
- SDOperand Op = N0.getOperand(0);
- unsigned OpBits = MVT::getSizeInBits(Op.getValueType());
- unsigned MidBits = MVT::getSizeInBits(N0.getValueType());
- unsigned DestBits = MVT::getSizeInBits(VT);
- unsigned NumSignBits = DAG.ComputeNumSignBits(Op);
-
- if (OpBits == DestBits) {
- // Op is i32, Mid is i8, and Dest is i32. If Op has more than 24 sign
- // bits, it is already ready.
- if (NumSignBits > DestBits-MidBits)
- return Op;
- } else if (OpBits < DestBits) {
- // Op is i32, Mid is i8, and Dest is i64. If Op has more than 24 sign
- // bits, just sext from i32.
- if (NumSignBits > OpBits-MidBits)
- return DAG.getNode(ISD::SIGN_EXTEND, VT, Op);
- } else {
- // Op is i64, Mid is i8, and Dest is i32. If Op has more than 56 sign
- // bits, just truncate to i32.
- if (NumSignBits > OpBits-MidBits)
- return DAG.getNode(ISD::TRUNCATE, VT, Op);
- }
-
- // fold (sext (truncate x)) -> (sextinreg x).
- if (!AfterLegalize || TLI.isOperationLegal(ISD::SIGN_EXTEND_INREG,
- N0.getValueType())) {
- if (Op.getValueType() < VT)
- Op = DAG.getNode(ISD::ANY_EXTEND, VT, Op);
- else if (Op.getValueType() > VT)
- Op = DAG.getNode(ISD::TRUNCATE, VT, Op);
- return DAG.getNode(ISD::SIGN_EXTEND_INREG, VT, Op,
- DAG.getValueType(N0.getValueType()));
- }
- }
-
- // fold (sext (load x)) -> (sext (truncate (sextload x)))
- if (ISD::isNON_EXTLoad(N0.Val) &&
- (!AfterLegalize||TLI.isLoadXLegal(ISD::SEXTLOAD, N0.getValueType()))){
- bool DoXform = true;
- SmallVector<SDNode*, 4> SetCCs;
- if (!N0.hasOneUse())
- DoXform = ExtendUsesToFormExtLoad(N, N0, ISD::SIGN_EXTEND, SetCCs, TLI);
- if (DoXform) {
- LoadSDNode *LN0 = cast<LoadSDNode>(N0);
- SDOperand ExtLoad = DAG.getExtLoad(ISD::SEXTLOAD, VT, LN0->getChain(),
- LN0->getBasePtr(), LN0->getSrcValue(),
- LN0->getSrcValueOffset(),
- N0.getValueType(),
- LN0->isVolatile(),
- LN0->getAlignment());
- CombineTo(N, ExtLoad);
- SDOperand Trunc = DAG.getNode(ISD::TRUNCATE, N0.getValueType(), ExtLoad);
- CombineTo(N0.Val, Trunc, ExtLoad.getValue(1));
- // Extend SetCC uses if necessary.
- for (unsigned i = 0, e = SetCCs.size(); i != e; ++i) {
- SDNode *SetCC = SetCCs[i];
- SmallVector<SDOperand, 4> Ops;
- for (unsigned j = 0; j != 2; ++j) {
- SDOperand SOp = SetCC->getOperand(j);
- if (SOp == Trunc)
- Ops.push_back(ExtLoad);
- else
- Ops.push_back(DAG.getNode(ISD::SIGN_EXTEND, VT, SOp));
- }
- Ops.push_back(SetCC->getOperand(2));
- CombineTo(SetCC, DAG.getNode(ISD::SETCC, SetCC->getValueType(0),
- &Ops[0], Ops.size()));
- }
- return SDOperand(N, 0); // Return N so it doesn't get rechecked!
- }
- }
-
- // fold (sext (sextload x)) -> (sext (truncate (sextload x)))
- // fold (sext ( extload x)) -> (sext (truncate (sextload x)))
- if ((ISD::isSEXTLoad(N0.Val) || ISD::isEXTLoad(N0.Val)) &&
- ISD::isUNINDEXEDLoad(N0.Val) && N0.hasOneUse()) {
- LoadSDNode *LN0 = cast<LoadSDNode>(N0);
- MVT::ValueType EVT = LN0->getMemoryVT();
- if (!AfterLegalize || TLI.isLoadXLegal(ISD::SEXTLOAD, EVT)) {
- SDOperand ExtLoad = DAG.getExtLoad(ISD::SEXTLOAD, VT, LN0->getChain(),
- LN0->getBasePtr(), LN0->getSrcValue(),
- LN0->getSrcValueOffset(), EVT,
- LN0->isVolatile(),
- LN0->getAlignment());
- CombineTo(N, ExtLoad);
- CombineTo(N0.Val, DAG.getNode(ISD::TRUNCATE, N0.getValueType(), ExtLoad),
- ExtLoad.getValue(1));
- return SDOperand(N, 0); // Return N so it doesn't get rechecked!
- }
- }
-
- // sext(setcc x,y,cc) -> select_cc x, y, -1, 0, cc
- if (N0.getOpcode() == ISD::SETCC) {
- SDOperand SCC =
- SimplifySelectCC(N0.getOperand(0), N0.getOperand(1),
- DAG.getConstant(~0ULL, VT), DAG.getConstant(0, VT),
- cast<CondCodeSDNode>(N0.getOperand(2))->get(), true);
- if (SCC.Val) return SCC;
- }
-
- // fold (sext x) -> (zext x) if the sign bit is known zero.
- if ((!AfterLegalize || TLI.isOperationLegal(ISD::ZERO_EXTEND, VT)) &&
- DAG.SignBitIsZero(N0))
- return DAG.getNode(ISD::ZERO_EXTEND, VT, N0);
-
- return SDOperand();
-}
-
-SDOperand DAGCombiner::visitZERO_EXTEND(SDNode *N) {
- SDOperand N0 = N->getOperand(0);
- MVT::ValueType VT = N->getValueType(0);
-
- // fold (zext c1) -> c1
- if (isa<ConstantSDNode>(N0))
- return DAG.getNode(ISD::ZERO_EXTEND, VT, N0);
- // fold (zext (zext x)) -> (zext x)
- // fold (zext (aext x)) -> (zext x)
- if (N0.getOpcode() == ISD::ZERO_EXTEND || N0.getOpcode() == ISD::ANY_EXTEND)
- return DAG.getNode(ISD::ZERO_EXTEND, VT, N0.getOperand(0));
-
- // fold (zext (truncate (load x))) -> (zext (smaller load x))
- // fold (zext (truncate (srl (load x), c))) -> (zext (small load (x+c/n)))
- if (N0.getOpcode() == ISD::TRUNCATE) {
- SDOperand NarrowLoad = ReduceLoadWidth(N0.Val);
- if (NarrowLoad.Val) {
- if (NarrowLoad.Val != N0.Val)
- CombineTo(N0.Val, NarrowLoad);
- return DAG.getNode(ISD::ZERO_EXTEND, VT, NarrowLoad);
- }
- }
-
- // fold (zext (truncate x)) -> (and x, mask)
- if (N0.getOpcode() == ISD::TRUNCATE &&
- (!AfterLegalize || TLI.isOperationLegal(ISD::AND, VT))) {
- SDOperand Op = N0.getOperand(0);
- if (Op.getValueType() < VT) {
- Op = DAG.getNode(ISD::ANY_EXTEND, VT, Op);
- } else if (Op.getValueType() > VT) {
- Op = DAG.getNode(ISD::TRUNCATE, VT, Op);
- }
- return DAG.getZeroExtendInReg(Op, N0.getValueType());
- }
-
- // fold (zext (and (trunc x), cst)) -> (and x, cst).
- if (N0.getOpcode() == ISD::AND &&
- N0.getOperand(0).getOpcode() == ISD::TRUNCATE &&
- N0.getOperand(1).getOpcode() == ISD::Constant) {
- SDOperand X = N0.getOperand(0).getOperand(0);
- if (X.getValueType() < VT) {
- X = DAG.getNode(ISD::ANY_EXTEND, VT, X);
- } else if (X.getValueType() > VT) {
- X = DAG.getNode(ISD::TRUNCATE, VT, X);
- }
- APInt Mask = cast<ConstantSDNode>(N0.getOperand(1))->getAPIntValue();
- Mask.zext(MVT::getSizeInBits(VT));
- return DAG.getNode(ISD::AND, VT, X, DAG.getConstant(Mask, VT));
- }
-
- // fold (zext (load x)) -> (zext (truncate (zextload x)))
- if (ISD::isNON_EXTLoad(N0.Val) &&
- (!AfterLegalize||TLI.isLoadXLegal(ISD::ZEXTLOAD, N0.getValueType()))) {
- bool DoXform = true;
- SmallVector<SDNode*, 4> SetCCs;
- if (!N0.hasOneUse())
- DoXform = ExtendUsesToFormExtLoad(N, N0, ISD::ZERO_EXTEND, SetCCs, TLI);
- if (DoXform) {
- LoadSDNode *LN0 = cast<LoadSDNode>(N0);
- SDOperand ExtLoad = DAG.getExtLoad(ISD::ZEXTLOAD, VT, LN0->getChain(),
- LN0->getBasePtr(), LN0->getSrcValue(),
- LN0->getSrcValueOffset(),
- N0.getValueType(),
- LN0->isVolatile(),
- LN0->getAlignment());
- CombineTo(N, ExtLoad);
- SDOperand Trunc = DAG.getNode(ISD::TRUNCATE, N0.getValueType(), ExtLoad);
- CombineTo(N0.Val, Trunc, ExtLoad.getValue(1));
- // Extend SetCC uses if necessary.
- for (unsigned i = 0, e = SetCCs.size(); i != e; ++i) {
- SDNode *SetCC = SetCCs[i];
- SmallVector<SDOperand, 4> Ops;
- for (unsigned j = 0; j != 2; ++j) {
- SDOperand SOp = SetCC->getOperand(j);
- if (SOp == Trunc)
- Ops.push_back(ExtLoad);
- else
- Ops.push_back(DAG.getNode(ISD::ZERO_EXTEND, VT, SOp));
- }
- Ops.push_back(SetCC->getOperand(2));
- CombineTo(SetCC, DAG.getNode(ISD::SETCC, SetCC->getValueType(0),
- &Ops[0], Ops.size()));
- }
- return SDOperand(N, 0); // Return N so it doesn't get rechecked!
- }
- }
-
- // fold (zext (zextload x)) -> (zext (truncate (zextload x)))
- // fold (zext ( extload x)) -> (zext (truncate (zextload x)))
- if ((ISD::isZEXTLoad(N0.Val) || ISD::isEXTLoad(N0.Val)) &&
- ISD::isUNINDEXEDLoad(N0.Val) && N0.hasOneUse()) {
- LoadSDNode *LN0 = cast<LoadSDNode>(N0);
- MVT::ValueType EVT = LN0->getMemoryVT();
- SDOperand ExtLoad = DAG.getExtLoad(ISD::ZEXTLOAD, VT, LN0->getChain(),
- LN0->getBasePtr(), LN0->getSrcValue(),
- LN0->getSrcValueOffset(), EVT,
- LN0->isVolatile(),
- LN0->getAlignment());
- CombineTo(N, ExtLoad);
- CombineTo(N0.Val, DAG.getNode(ISD::TRUNCATE, N0.getValueType(), ExtLoad),
- ExtLoad.getValue(1));
- return SDOperand(N, 0); // Return N so it doesn't get rechecked!
- }
-
- // zext(setcc x,y,cc) -> select_cc x, y, 1, 0, cc
- if (N0.getOpcode() == ISD::SETCC) {
- SDOperand SCC =
- SimplifySelectCC(N0.getOperand(0), N0.getOperand(1),
- DAG.getConstant(1, VT), DAG.getConstant(0, VT),
- cast<CondCodeSDNode>(N0.getOperand(2))->get(), true);
- if (SCC.Val) return SCC;
- }
-
- return SDOperand();
-}
-
-SDOperand DAGCombiner::visitANY_EXTEND(SDNode *N) {
- SDOperand N0 = N->getOperand(0);
- MVT::ValueType VT = N->getValueType(0);
-
- // fold (aext c1) -> c1
- if (isa<ConstantSDNode>(N0))
- return DAG.getNode(ISD::ANY_EXTEND, VT, N0);
- // fold (aext (aext x)) -> (aext x)
- // fold (aext (zext x)) -> (zext x)
- // fold (aext (sext x)) -> (sext x)
- if (N0.getOpcode() == ISD::ANY_EXTEND ||
- N0.getOpcode() == ISD::ZERO_EXTEND ||
- N0.getOpcode() == ISD::SIGN_EXTEND)
- return DAG.getNode(N0.getOpcode(), VT, N0.getOperand(0));
-
- // fold (aext (truncate (load x))) -> (aext (smaller load x))
- // fold (aext (truncate (srl (load x), c))) -> (aext (small load (x+c/n)))
- if (N0.getOpcode() == ISD::TRUNCATE) {
- SDOperand NarrowLoad = ReduceLoadWidth(N0.Val);
- if (NarrowLoad.Val) {
- if (NarrowLoad.Val != N0.Val)
- CombineTo(N0.Val, NarrowLoad);
- return DAG.getNode(ISD::ANY_EXTEND, VT, NarrowLoad);
- }
- }
-
- // fold (aext (truncate x))
- if (N0.getOpcode() == ISD::TRUNCATE) {
- SDOperand TruncOp = N0.getOperand(0);
- if (TruncOp.getValueType() == VT)
- return TruncOp; // x iff x size == zext size.
- if (TruncOp.getValueType() > VT)
- return DAG.getNode(ISD::TRUNCATE, VT, TruncOp);
- return DAG.getNode(ISD::ANY_EXTEND, VT, TruncOp);
- }
-
- // fold (aext (and (trunc x), cst)) -> (and x, cst).
- if (N0.getOpcode() == ISD::AND &&
- N0.getOperand(0).getOpcode() == ISD::TRUNCATE &&
- N0.getOperand(1).getOpcode() == ISD::Constant) {
- SDOperand X = N0.getOperand(0).getOperand(0);
- if (X.getValueType() < VT) {
- X = DAG.getNode(ISD::ANY_EXTEND, VT, X);
- } else if (X.getValueType() > VT) {
- X = DAG.getNode(ISD::TRUNCATE, VT, X);
- }
- APInt Mask = cast<ConstantSDNode>(N0.getOperand(1))->getAPIntValue();
- Mask.zext(MVT::getSizeInBits(VT));
- return DAG.getNode(ISD::AND, VT, X, DAG.getConstant(Mask, VT));
- }
-
- // fold (aext (load x)) -> (aext (truncate (extload x)))
- if (ISD::isNON_EXTLoad(N0.Val) && N0.hasOneUse() &&
- (!AfterLegalize||TLI.isLoadXLegal(ISD::EXTLOAD, N0.getValueType()))) {
- LoadSDNode *LN0 = cast<LoadSDNode>(N0);
- SDOperand ExtLoad = DAG.getExtLoad(ISD::EXTLOAD, VT, LN0->getChain(),
- LN0->getBasePtr(), LN0->getSrcValue(),
- LN0->getSrcValueOffset(),
- N0.getValueType(),
- LN0->isVolatile(),
- LN0->getAlignment());
- CombineTo(N, ExtLoad);
- CombineTo(N0.Val, DAG.getNode(ISD::TRUNCATE, N0.getValueType(), ExtLoad),
- ExtLoad.getValue(1));
- return SDOperand(N, 0); // Return N so it doesn't get rechecked!
- }
-
- // fold (aext (zextload x)) -> (aext (truncate (zextload x)))
- // fold (aext (sextload x)) -> (aext (truncate (sextload x)))
- // fold (aext ( extload x)) -> (aext (truncate (extload x)))
- if (N0.getOpcode() == ISD::LOAD &&
- !ISD::isNON_EXTLoad(N0.Val) && ISD::isUNINDEXEDLoad(N0.Val) &&
- N0.hasOneUse()) {
- LoadSDNode *LN0 = cast<LoadSDNode>(N0);
- MVT::ValueType EVT = LN0->getMemoryVT();
- SDOperand ExtLoad = DAG.getExtLoad(LN0->getExtensionType(), VT,
- LN0->getChain(), LN0->getBasePtr(),
- LN0->getSrcValue(),
- LN0->getSrcValueOffset(), EVT,
- LN0->isVolatile(),
- LN0->getAlignment());
- CombineTo(N, ExtLoad);
- CombineTo(N0.Val, DAG.getNode(ISD::TRUNCATE, N0.getValueType(), ExtLoad),
- ExtLoad.getValue(1));
- return SDOperand(N, 0); // Return N so it doesn't get rechecked!
- }
-
- // aext(setcc x,y,cc) -> select_cc x, y, 1, 0, cc
- if (N0.getOpcode() == ISD::SETCC) {
- SDOperand SCC =
- SimplifySelectCC(N0.getOperand(0), N0.getOperand(1),
- DAG.getConstant(1, VT), DAG.getConstant(0, VT),
- cast<CondCodeSDNode>(N0.getOperand(2))->get(), true);
- if (SCC.Val)
- return SCC;
- }
-
- return SDOperand();
-}
-
-/// GetDemandedBits - See if the specified operand can be simplified with the
-/// knowledge that only the bits specified by Mask are used. If so, return the
-/// simpler operand, otherwise return a null SDOperand.
-SDOperand DAGCombiner::GetDemandedBits(SDOperand V, const APInt &Mask) {
- switch (V.getOpcode()) {
- default: break;
- case ISD::OR:
- case ISD::XOR:
- // If the LHS or RHS don't contribute bits to the or, drop them.
- if (DAG.MaskedValueIsZero(V.getOperand(0), Mask))
- return V.getOperand(1);
- if (DAG.MaskedValueIsZero(V.getOperand(1), Mask))
- return V.getOperand(0);
- break;
- case ISD::SRL:
- // Only look at single-use SRLs.
- if (!V.Val->hasOneUse())
- break;
- if (ConstantSDNode *RHSC = dyn_cast<ConstantSDNode>(V.getOperand(1))) {
- // See if we can recursively simplify the LHS.
- unsigned Amt = RHSC->getValue();
- APInt NewMask = Mask << Amt;
- SDOperand SimplifyLHS = GetDemandedBits(V.getOperand(0), NewMask);
- if (SimplifyLHS.Val) {
- return DAG.getNode(ISD::SRL, V.getValueType(),
- SimplifyLHS, V.getOperand(1));
- }
- }
- }
- return SDOperand();
-}
-
-/// ReduceLoadWidth - If the result of a wider load is shifted to right of N
-/// bits and then truncated to a narrower type and where N is a multiple
-/// of number of bits of the narrower type, transform it to a narrower load
-/// from address + N / num of bits of new type. If the result is to be
-/// extended, also fold the extension to form a extending load.
-SDOperand DAGCombiner::ReduceLoadWidth(SDNode *N) {
- unsigned Opc = N->getOpcode();
- ISD::LoadExtType ExtType = ISD::NON_EXTLOAD;
- SDOperand N0 = N->getOperand(0);
- MVT::ValueType VT = N->getValueType(0);
- MVT::ValueType EVT = N->getValueType(0);
-
- // Special case: SIGN_EXTEND_INREG is basically truncating to EVT then
- // extended to VT.
- if (Opc == ISD::SIGN_EXTEND_INREG) {
- ExtType = ISD::SEXTLOAD;
- EVT = cast<VTSDNode>(N->getOperand(1))->getVT();
- if (AfterLegalize && !TLI.isLoadXLegal(ISD::SEXTLOAD, EVT))
- return SDOperand();
- }
-
- unsigned EVTBits = MVT::getSizeInBits(EVT);
- unsigned ShAmt = 0;
- bool CombineSRL = false;
- if (N0.getOpcode() == ISD::SRL && N0.hasOneUse()) {
- if (ConstantSDNode *N01 = dyn_cast<ConstantSDNode>(N0.getOperand(1))) {
- ShAmt = N01->getValue();
- // Is the shift amount a multiple of size of VT?
- if ((ShAmt & (EVTBits-1)) == 0) {
- N0 = N0.getOperand(0);
- if (MVT::getSizeInBits(N0.getValueType()) <= EVTBits)
- return SDOperand();
- CombineSRL = true;
- }
- }
- }
-
- if (ISD::isNON_EXTLoad(N0.Val) && N0.hasOneUse() &&
- // Do not allow folding to i1 here. i1 is implicitly stored in memory in
- // zero extended form: by shrinking the load, we lose track of the fact
- // that it is already zero extended.
- // FIXME: This should be reevaluated.
- VT != MVT::i1) {
- assert(MVT::getSizeInBits(N0.getValueType()) > EVTBits &&
- "Cannot truncate to larger type!");
- LoadSDNode *LN0 = cast<LoadSDNode>(N0);
- MVT::ValueType PtrType = N0.getOperand(1).getValueType();
- // For big endian targets, we need to adjust the offset to the pointer to
- // load the correct bytes.
- if (TLI.isBigEndian()) {
- unsigned LVTStoreBits = MVT::getStoreSizeInBits(N0.getValueType());
- unsigned EVTStoreBits = MVT::getStoreSizeInBits(EVT);
- ShAmt = LVTStoreBits - EVTStoreBits - ShAmt;
- }
- uint64_t PtrOff = ShAmt / 8;
- unsigned NewAlign = MinAlign(LN0->getAlignment(), PtrOff);
- SDOperand NewPtr = DAG.getNode(ISD::ADD, PtrType, LN0->getBasePtr(),
- DAG.getConstant(PtrOff, PtrType));
- AddToWorkList(NewPtr.Val);
- SDOperand Load = (ExtType == ISD::NON_EXTLOAD)
- ? DAG.getLoad(VT, LN0->getChain(), NewPtr,
- LN0->getSrcValue(), LN0->getSrcValueOffset(),
- LN0->isVolatile(), NewAlign)
- : DAG.getExtLoad(ExtType, VT, LN0->getChain(), NewPtr,
- LN0->getSrcValue(), LN0->getSrcValueOffset(), EVT,
- LN0->isVolatile(), NewAlign);
- AddToWorkList(N);
- if (CombineSRL) {
- WorkListRemover DeadNodes(*this);
- DAG.ReplaceAllUsesOfValueWith(N0.getValue(1), Load.getValue(1),
- &DeadNodes);
- CombineTo(N->getOperand(0).Val, Load);
- } else
- CombineTo(N0.Val, Load, Load.getValue(1));
- if (ShAmt) {
- if (Opc == ISD::SIGN_EXTEND_INREG)
- return DAG.getNode(Opc, VT, Load, N->getOperand(1));
- else
- return DAG.getNode(Opc, VT, Load);
- }
- return SDOperand(N, 0); // Return N so it doesn't get rechecked!
- }
-
- return SDOperand();
-}
-
-
-SDOperand DAGCombiner::visitSIGN_EXTEND_INREG(SDNode *N) {
- SDOperand N0 = N->getOperand(0);
- SDOperand N1 = N->getOperand(1);
- MVT::ValueType VT = N->getValueType(0);
- MVT::ValueType EVT = cast<VTSDNode>(N1)->getVT();
- unsigned VTBits = MVT::getSizeInBits(VT);
- unsigned EVTBits = MVT::getSizeInBits(EVT);
-
- // fold (sext_in_reg c1) -> c1
- if (isa<ConstantSDNode>(N0) || N0.getOpcode() == ISD::UNDEF)
- return DAG.getNode(ISD::SIGN_EXTEND_INREG, VT, N0, N1);
-
- // If the input is already sign extended, just drop the extension.
- if (DAG.ComputeNumSignBits(N0) >= MVT::getSizeInBits(VT)-EVTBits+1)
- return N0;
-
- // fold (sext_in_reg (sext_in_reg x, VT2), VT1) -> (sext_in_reg x, minVT) pt2
- if (N0.getOpcode() == ISD::SIGN_EXTEND_INREG &&
- EVT < cast<VTSDNode>(N0.getOperand(1))->getVT()) {
- return DAG.getNode(ISD::SIGN_EXTEND_INREG, VT, N0.getOperand(0), N1);
- }
-
- // fold (sext_in_reg x) -> (zext_in_reg x) if the sign bit is known zero.
- if (DAG.MaskedValueIsZero(N0, APInt::getBitsSet(VTBits, EVTBits-1, EVTBits)))
- return DAG.getZeroExtendInReg(N0, EVT);
-
- // fold operands of sext_in_reg based on knowledge that the top bits are not
- // demanded.
- if (SimplifyDemandedBits(SDOperand(N, 0)))
- return SDOperand(N, 0);
-
- // fold (sext_in_reg (load x)) -> (smaller sextload x)
- // fold (sext_in_reg (srl (load x), c)) -> (smaller sextload (x+c/evtbits))
- SDOperand NarrowLoad = ReduceLoadWidth(N);
- if (NarrowLoad.Val)
- return NarrowLoad;
-
- // fold (sext_in_reg (srl X, 24), i8) -> sra X, 24
- // fold (sext_in_reg (srl X, 23), i8) -> sra X, 23 iff possible.
- // We already fold "(sext_in_reg (srl X, 25), i8) -> srl X, 25" above.
- if (N0.getOpcode() == ISD::SRL) {
- if (ConstantSDNode *ShAmt = dyn_cast<ConstantSDNode>(N0.getOperand(1)))
- if (ShAmt->getValue()+EVTBits <= MVT::getSizeInBits(VT)) {
- // We can turn this into an SRA iff the input to the SRL is already sign
- // extended enough.
- unsigned InSignBits = DAG.ComputeNumSignBits(N0.getOperand(0));
- if (MVT::getSizeInBits(VT)-(ShAmt->getValue()+EVTBits) < InSignBits)
- return DAG.getNode(ISD::SRA, VT, N0.getOperand(0), N0.getOperand(1));
- }
- }
-
- // fold (sext_inreg (extload x)) -> (sextload x)
- if (ISD::isEXTLoad(N0.Val) &&
- ISD::isUNINDEXEDLoad(N0.Val) &&
- EVT == cast<LoadSDNode>(N0)->getMemoryVT() &&
- (!AfterLegalize || TLI.isLoadXLegal(ISD::SEXTLOAD, EVT))) {
- LoadSDNode *LN0 = cast<LoadSDNode>(N0);
- SDOperand ExtLoad = DAG.getExtLoad(ISD::SEXTLOAD, VT, LN0->getChain(),
- LN0->getBasePtr(), LN0->getSrcValue(),
- LN0->getSrcValueOffset(), EVT,
- LN0->isVolatile(),
- LN0->getAlignment());
- CombineTo(N, ExtLoad);
- CombineTo(N0.Val, ExtLoad, ExtLoad.getValue(1));
- return SDOperand(N, 0); // Return N so it doesn't get rechecked!
- }
- // fold (sext_inreg (zextload x)) -> (sextload x) iff load has one use
- if (ISD::isZEXTLoad(N0.Val) && ISD::isUNINDEXEDLoad(N0.Val) &&
- N0.hasOneUse() &&
- EVT == cast<LoadSDNode>(N0)->getMemoryVT() &&
- (!AfterLegalize || TLI.isLoadXLegal(ISD::SEXTLOAD, EVT))) {
- LoadSDNode *LN0 = cast<LoadSDNode>(N0);
- SDOperand ExtLoad = DAG.getExtLoad(ISD::SEXTLOAD, VT, LN0->getChain(),
- LN0->getBasePtr(), LN0->getSrcValue(),
- LN0->getSrcValueOffset(), EVT,
- LN0->isVolatile(),
- LN0->getAlignment());
- CombineTo(N, ExtLoad);
- CombineTo(N0.Val, ExtLoad, ExtLoad.getValue(1));
- return SDOperand(N, 0); // Return N so it doesn't get rechecked!
- }
- return SDOperand();
-}
-
-SDOperand DAGCombiner::visitTRUNCATE(SDNode *N) {
- SDOperand N0 = N->getOperand(0);
- MVT::ValueType VT = N->getValueType(0);
-
- // noop truncate
- if (N0.getValueType() == N->getValueType(0))
- return N0;
- // fold (truncate c1) -> c1
- if (isa<ConstantSDNode>(N0))
- return DAG.getNode(ISD::TRUNCATE, VT, N0);
- // fold (truncate (truncate x)) -> (truncate x)
- if (N0.getOpcode() == ISD::TRUNCATE)
- return DAG.getNode(ISD::TRUNCATE, VT, N0.getOperand(0));
- // fold (truncate (ext x)) -> (ext x) or (truncate x) or x
- if (N0.getOpcode() == ISD::ZERO_EXTEND || N0.getOpcode() == ISD::SIGN_EXTEND||
- N0.getOpcode() == ISD::ANY_EXTEND) {
- if (N0.getOperand(0).getValueType() < VT)
- // if the source is smaller than the dest, we still need an extend
- return DAG.getNode(N0.getOpcode(), VT, N0.getOperand(0));
- else if (N0.getOperand(0).getValueType() > VT)
- // if the source is larger than the dest, than we just need the truncate
- return DAG.getNode(ISD::TRUNCATE, VT, N0.getOperand(0));
- else
- // if the source and dest are the same type, we can drop both the extend
- // and the truncate
- return N0.getOperand(0);
- }
-
- // See if we can simplify the input to this truncate through knowledge that
- // only the low bits are being used. For example "trunc (or (shl x, 8), y)"
- // -> trunc y
- SDOperand Shorter =
- GetDemandedBits(N0, APInt::getLowBitsSet(N0.getValueSizeInBits(),
- MVT::getSizeInBits(VT)));
- if (Shorter.Val)
- return DAG.getNode(ISD::TRUNCATE, VT, Shorter);
-
- // fold (truncate (load x)) -> (smaller load x)
- // fold (truncate (srl (load x), c)) -> (smaller load (x+c/evtbits))
- return ReduceLoadWidth(N);
-}
-
-SDOperand DAGCombiner::visitBIT_CONVERT(SDNode *N) {
- SDOperand N0 = N->getOperand(0);
- MVT::ValueType VT = N->getValueType(0);
-
- // If the input is a BUILD_VECTOR with all constant elements, fold this now.
- // Only do this before legalize, since afterward the target may be depending
- // on the bitconvert.
- // First check to see if this is all constant.
- if (!AfterLegalize &&
- N0.getOpcode() == ISD::BUILD_VECTOR && N0.Val->hasOneUse() &&
- MVT::isVector(VT)) {
- bool isSimple = true;
- for (unsigned i = 0, e = N0.getNumOperands(); i != e; ++i)
- if (N0.getOperand(i).getOpcode() != ISD::UNDEF &&
- N0.getOperand(i).getOpcode() != ISD::Constant &&
- N0.getOperand(i).getOpcode() != ISD::ConstantFP) {
- isSimple = false;
- break;
- }
-
- MVT::ValueType DestEltVT = MVT::getVectorElementType(N->getValueType(0));
- assert(!MVT::isVector(DestEltVT) &&
- "Element type of vector ValueType must not be vector!");
- if (isSimple) {
- return ConstantFoldBIT_CONVERTofBUILD_VECTOR(N0.Val, DestEltVT);
- }
- }
-
- // If the input is a constant, let getNode() fold it.
- if (isa<ConstantSDNode>(N0) || isa<ConstantFPSDNode>(N0)) {
- SDOperand Res = DAG.getNode(ISD::BIT_CONVERT, VT, N0);
- if (Res.Val != N) return Res;
- }
-
- if (N0.getOpcode() == ISD::BIT_CONVERT) // conv(conv(x,t1),t2) -> conv(x,t2)
- return DAG.getNode(ISD::BIT_CONVERT, VT, N0.getOperand(0));
-
- // fold (conv (load x)) -> (load (conv*)x)
- // If the resultant load doesn't need a higher alignment than the original!
- if (ISD::isNormalLoad(N0.Val) && N0.hasOneUse() &&
- TLI.isOperationLegal(ISD::LOAD, VT)) {
- LoadSDNode *LN0 = cast<LoadSDNode>(N0);
- unsigned Align = TLI.getTargetMachine().getTargetData()->
- getABITypeAlignment(MVT::getTypeForValueType(VT));
- unsigned OrigAlign = LN0->getAlignment();
- if (Align <= OrigAlign) {
- SDOperand Load = DAG.getLoad(VT, LN0->getChain(), LN0->getBasePtr(),
- LN0->getSrcValue(), LN0->getSrcValueOffset(),
- LN0->isVolatile(), Align);
- AddToWorkList(N);
- CombineTo(N0.Val, DAG.getNode(ISD::BIT_CONVERT, N0.getValueType(), Load),
- Load.getValue(1));
- return Load;
- }
- }
-
- // Fold bitconvert(fneg(x)) -> xor(bitconvert(x), signbit)
- // Fold bitconvert(fabs(x)) -> and(bitconvert(x), ~signbit)
- // This often reduces constant pool loads.
- if ((N0.getOpcode() == ISD::FNEG || N0.getOpcode() == ISD::FABS) &&
- N0.Val->hasOneUse() && MVT::isInteger(VT) && !MVT::isVector(VT)) {
- SDOperand NewConv = DAG.getNode(ISD::BIT_CONVERT, VT, N0.getOperand(0));
- AddToWorkList(NewConv.Val);
-
- APInt SignBit = APInt::getSignBit(MVT::getSizeInBits(VT));
- if (N0.getOpcode() == ISD::FNEG)
- return DAG.getNode(ISD::XOR, VT, NewConv, DAG.getConstant(SignBit, VT));
- assert(N0.getOpcode() == ISD::FABS);
- return DAG.getNode(ISD::AND, VT, NewConv, DAG.getConstant(~SignBit, VT));
- }
-
- // Fold bitconvert(fcopysign(cst, x)) -> bitconvert(x)&sign | cst&~sign'
- // Note that we don't handle copysign(x,cst) because this can always be folded
- // to an fneg or fabs.
- if (N0.getOpcode() == ISD::FCOPYSIGN && N0.Val->hasOneUse() &&
- isa<ConstantFPSDNode>(N0.getOperand(0)) &&
- MVT::isInteger(VT) && !MVT::isVector(VT)) {
- unsigned OrigXWidth = MVT::getSizeInBits(N0.getOperand(1).getValueType());
- SDOperand X = DAG.getNode(ISD::BIT_CONVERT, MVT::getIntegerType(OrigXWidth),
- N0.getOperand(1));
- AddToWorkList(X.Val);
-
- // If X has a different width than the result/lhs, sext it or truncate it.
- unsigned VTWidth = MVT::getSizeInBits(VT);
- if (OrigXWidth < VTWidth) {
- X = DAG.getNode(ISD::SIGN_EXTEND, VT, X);
- AddToWorkList(X.Val);
- } else if (OrigXWidth > VTWidth) {
- // To get the sign bit in the right place, we have to shift it right
- // before truncating.
- X = DAG.getNode(ISD::SRL, X.getValueType(), X,
- DAG.getConstant(OrigXWidth-VTWidth, X.getValueType()));
- AddToWorkList(X.Val);
- X = DAG.getNode(ISD::TRUNCATE, VT, X);
- AddToWorkList(X.Val);
- }
-
- APInt SignBit = APInt::getSignBit(MVT::getSizeInBits(VT));
- X = DAG.getNode(ISD::AND, VT, X, DAG.getConstant(SignBit, VT));
- AddToWorkList(X.Val);
-
- SDOperand Cst = DAG.getNode(ISD::BIT_CONVERT, VT, N0.getOperand(0));
- Cst = DAG.getNode(ISD::AND, VT, Cst, DAG.getConstant(~SignBit, VT));
- AddToWorkList(Cst.Val);
-
- return DAG.getNode(ISD::OR, VT, X, Cst);
- }
-
- return SDOperand();
-}
-
-/// ConstantFoldBIT_CONVERTofBUILD_VECTOR - We know that BV is a build_vector
-/// node with Constant, ConstantFP or Undef operands. DstEltVT indicates the
-/// destination element value type.
-SDOperand DAGCombiner::
-ConstantFoldBIT_CONVERTofBUILD_VECTOR(SDNode *BV, MVT::ValueType DstEltVT) {
- MVT::ValueType SrcEltVT = BV->getOperand(0).getValueType();
-
- // If this is already the right type, we're done.
- if (SrcEltVT == DstEltVT) return SDOperand(BV, 0);
-
- unsigned SrcBitSize = MVT::getSizeInBits(SrcEltVT);
- unsigned DstBitSize = MVT::getSizeInBits(DstEltVT);
-
- // If this is a conversion of N elements of one type to N elements of another
- // type, convert each element. This handles FP<->INT cases.
- if (SrcBitSize == DstBitSize) {
- SmallVector<SDOperand, 8> Ops;
- for (unsigned i = 0, e = BV->getNumOperands(); i != e; ++i) {
- Ops.push_back(DAG.getNode(ISD::BIT_CONVERT, DstEltVT, BV->getOperand(i)));
- AddToWorkList(Ops.back().Val);
- }
- MVT::ValueType VT =
- MVT::getVectorType(DstEltVT,
- MVT::getVectorNumElements(BV->getValueType(0)));
- return DAG.getNode(ISD::BUILD_VECTOR, VT, &Ops[0], Ops.size());
- }
-
- // Otherwise, we're growing or shrinking the elements. To avoid having to
- // handle annoying details of growing/shrinking FP values, we convert them to
- // int first.
- if (MVT::isFloatingPoint(SrcEltVT)) {
- // Convert the input float vector to a int vector where the elements are the
- // same sizes.
- assert((SrcEltVT == MVT::f32 || SrcEltVT == MVT::f64) && "Unknown FP VT!");
- MVT::ValueType IntVT = SrcEltVT == MVT::f32 ? MVT::i32 : MVT::i64;
- BV = ConstantFoldBIT_CONVERTofBUILD_VECTOR(BV, IntVT).Val;
- SrcEltVT = IntVT;
- }
-
- // Now we know the input is an integer vector. If the output is a FP type,
- // convert to integer first, then to FP of the right size.
- if (MVT::isFloatingPoint(DstEltVT)) {
- assert((DstEltVT == MVT::f32 || DstEltVT == MVT::f64) && "Unknown FP VT!");
- MVT::ValueType TmpVT = DstEltVT == MVT::f32 ? MVT::i32 : MVT::i64;
- SDNode *Tmp = ConstantFoldBIT_CONVERTofBUILD_VECTOR(BV, TmpVT).Val;
-
- // Next, convert to FP elements of the same size.
- return ConstantFoldBIT_CONVERTofBUILD_VECTOR(Tmp, DstEltVT);
- }
-
- // Okay, we know the src/dst types are both integers of differing types.
- // Handling growing first.
- assert(MVT::isInteger(SrcEltVT) && MVT::isInteger(DstEltVT));
- if (SrcBitSize < DstBitSize) {
- unsigned NumInputsPerOutput = DstBitSize/SrcBitSize;
-
- SmallVector<SDOperand, 8> Ops;
- for (unsigned i = 0, e = BV->getNumOperands(); i != e;
- i += NumInputsPerOutput) {
- bool isLE = TLI.isLittleEndian();
- APInt NewBits = APInt(DstBitSize, 0);
- bool EltIsUndef = true;
- for (unsigned j = 0; j != NumInputsPerOutput; ++j) {
- // Shift the previously computed bits over.
- NewBits <<= SrcBitSize;
- SDOperand Op = BV->getOperand(i+ (isLE ? (NumInputsPerOutput-j-1) : j));
- if (Op.getOpcode() == ISD::UNDEF) continue;
- EltIsUndef = false;
-
- NewBits |=
- APInt(cast<ConstantSDNode>(Op)->getAPIntValue()).zext(DstBitSize);
- }
-
- if (EltIsUndef)
- Ops.push_back(DAG.getNode(ISD::UNDEF, DstEltVT));
- else
- Ops.push_back(DAG.getConstant(NewBits, DstEltVT));
- }
-
- MVT::ValueType VT = MVT::getVectorType(DstEltVT, Ops.size());
- return DAG.getNode(ISD::BUILD_VECTOR, VT, &Ops[0], Ops.size());
- }
-
- // Finally, this must be the case where we are shrinking elements: each input
- // turns into multiple outputs.
- bool isS2V = ISD::isScalarToVector(BV);
- unsigned NumOutputsPerInput = SrcBitSize/DstBitSize;
- MVT::ValueType VT = MVT::getVectorType(DstEltVT,
- NumOutputsPerInput * BV->getNumOperands());
- SmallVector<SDOperand, 8> Ops;
- for (unsigned i = 0, e = BV->getNumOperands(); i != e; ++i) {
- if (BV->getOperand(i).getOpcode() == ISD::UNDEF) {
- for (unsigned j = 0; j != NumOutputsPerInput; ++j)
- Ops.push_back(DAG.getNode(ISD::UNDEF, DstEltVT));
- continue;
- }
- APInt OpVal = cast<ConstantSDNode>(BV->getOperand(i))->getAPIntValue();
- for (unsigned j = 0; j != NumOutputsPerInput; ++j) {
- APInt ThisVal = APInt(OpVal).trunc(DstBitSize);
- Ops.push_back(DAG.getConstant(ThisVal, DstEltVT));
- if (isS2V && i == 0 && j == 0 && APInt(ThisVal).zext(SrcBitSize) == OpVal)
- // Simply turn this into a SCALAR_TO_VECTOR of the new type.
- return DAG.getNode(ISD::SCALAR_TO_VECTOR, VT, Ops[0]);
- OpVal = OpVal.lshr(DstBitSize);
- }
-
- // For big endian targets, swap the order of the pieces of each element.
- if (TLI.isBigEndian())
- std::reverse(Ops.end()-NumOutputsPerInput, Ops.end());
- }
- return DAG.getNode(ISD::BUILD_VECTOR, VT, &Ops[0], Ops.size());
-}
-
-
-
-SDOperand DAGCombiner::visitFADD(SDNode *N) {
- SDOperand N0 = N->getOperand(0);
- SDOperand N1 = N->getOperand(1);
- ConstantFPSDNode *N0CFP = dyn_cast<ConstantFPSDNode>(N0);
- ConstantFPSDNode *N1CFP = dyn_cast<ConstantFPSDNode>(N1);
- MVT::ValueType VT = N->getValueType(0);
-
- // fold vector ops
- if (MVT::isVector(VT)) {
- SDOperand FoldedVOp = SimplifyVBinOp(N);
- if (FoldedVOp.Val) return FoldedVOp;
- }
-
- // fold (fadd c1, c2) -> c1+c2
- if (N0CFP && N1CFP && VT != MVT::ppcf128)
- return DAG.getNode(ISD::FADD, VT, N0, N1);
- // canonicalize constant to RHS
- if (N0CFP && !N1CFP)
- return DAG.getNode(ISD::FADD, VT, N1, N0);
- // fold (A + (-B)) -> A-B
- if (isNegatibleForFree(N1, AfterLegalize) == 2)
- return DAG.getNode(ISD::FSUB, VT, N0,
- GetNegatedExpression(N1, DAG, AfterLegalize));
- // fold ((-A) + B) -> B-A
- if (isNegatibleForFree(N0, AfterLegalize) == 2)
- return DAG.getNode(ISD::FSUB, VT, N1,
- GetNegatedExpression(N0, DAG, AfterLegalize));
-
- // If allowed, fold (fadd (fadd x, c1), c2) -> (fadd x, (fadd c1, c2))
- if (UnsafeFPMath && N1CFP && N0.getOpcode() == ISD::FADD &&
- N0.Val->hasOneUse() && isa<ConstantFPSDNode>(N0.getOperand(1)))
- return DAG.getNode(ISD::FADD, VT, N0.getOperand(0),
- DAG.getNode(ISD::FADD, VT, N0.getOperand(1), N1));
-
- return SDOperand();
-}
-
-SDOperand DAGCombiner::visitFSUB(SDNode *N) {
- SDOperand N0 = N->getOperand(0);
- SDOperand N1 = N->getOperand(1);
- ConstantFPSDNode *N0CFP = dyn_cast<ConstantFPSDNode>(N0);
- ConstantFPSDNode *N1CFP = dyn_cast<ConstantFPSDNode>(N1);
- MVT::ValueType VT = N->getValueType(0);
-
- // fold vector ops
- if (MVT::isVector(VT)) {
- SDOperand FoldedVOp = SimplifyVBinOp(N);
- if (FoldedVOp.Val) return FoldedVOp;
- }
-
- // fold (fsub c1, c2) -> c1-c2
- if (N0CFP && N1CFP && VT != MVT::ppcf128)
- return DAG.getNode(ISD::FSUB, VT, N0, N1);
- // fold (0-B) -> -B
- if (UnsafeFPMath && N0CFP && N0CFP->getValueAPF().isZero()) {
- if (isNegatibleForFree(N1, AfterLegalize))
- return GetNegatedExpression(N1, DAG, AfterLegalize);
- return DAG.getNode(ISD::FNEG, VT, N1);
- }
- // fold (A-(-B)) -> A+B
- if (isNegatibleForFree(N1, AfterLegalize))
- return DAG.getNode(ISD::FADD, VT, N0,
- GetNegatedExpression(N1, DAG, AfterLegalize));
-
- return SDOperand();
-}
-
-SDOperand DAGCombiner::visitFMUL(SDNode *N) {
- SDOperand N0 = N->getOperand(0);
- SDOperand N1 = N->getOperand(1);
- ConstantFPSDNode *N0CFP = dyn_cast<ConstantFPSDNode>(N0);
- ConstantFPSDNode *N1CFP = dyn_cast<ConstantFPSDNode>(N1);
- MVT::ValueType VT = N->getValueType(0);
-
- // fold vector ops
- if (MVT::isVector(VT)) {
- SDOperand FoldedVOp = SimplifyVBinOp(N);
- if (FoldedVOp.Val) return FoldedVOp;
- }
-
- // fold (fmul c1, c2) -> c1*c2
- if (N0CFP && N1CFP && VT != MVT::ppcf128)
- return DAG.getNode(ISD::FMUL, VT, N0, N1);
- // canonicalize constant to RHS
- if (N0CFP && !N1CFP)
- return DAG.getNode(ISD::FMUL, VT, N1, N0);
- // fold (fmul X, 2.0) -> (fadd X, X)
- if (N1CFP && N1CFP->isExactlyValue(+2.0))
- return DAG.getNode(ISD::FADD, VT, N0, N0);
- // fold (fmul X, -1.0) -> (fneg X)
- if (N1CFP && N1CFP->isExactlyValue(-1.0))
- return DAG.getNode(ISD::FNEG, VT, N0);
-
- // -X * -Y -> X*Y
- if (char LHSNeg = isNegatibleForFree(N0, AfterLegalize)) {
- if (char RHSNeg = isNegatibleForFree(N1, AfterLegalize)) {
- // Both can be negated for free, check to see if at least one is cheaper
- // negated.
- if (LHSNeg == 2 || RHSNeg == 2)
- return DAG.getNode(ISD::FMUL, VT,
- GetNegatedExpression(N0, DAG, AfterLegalize),
- GetNegatedExpression(N1, DAG, AfterLegalize));
- }
- }
-
- // If allowed, fold (fmul (fmul x, c1), c2) -> (fmul x, (fmul c1, c2))
- if (UnsafeFPMath && N1CFP && N0.getOpcode() == ISD::FMUL &&
- N0.Val->hasOneUse() && isa<ConstantFPSDNode>(N0.getOperand(1)))
- return DAG.getNode(ISD::FMUL, VT, N0.getOperand(0),
- DAG.getNode(ISD::FMUL, VT, N0.getOperand(1), N1));
-
- return SDOperand();
-}
-
-SDOperand DAGCombiner::visitFDIV(SDNode *N) {
- SDOperand N0 = N->getOperand(0);
- SDOperand N1 = N->getOperand(1);
- ConstantFPSDNode *N0CFP = dyn_cast<ConstantFPSDNode>(N0);
- ConstantFPSDNode *N1CFP = dyn_cast<ConstantFPSDNode>(N1);
- MVT::ValueType VT = N->getValueType(0);
-
- // fold vector ops
- if (MVT::isVector(VT)) {
- SDOperand FoldedVOp = SimplifyVBinOp(N);
- if (FoldedVOp.Val) return FoldedVOp;
- }
-
- // fold (fdiv c1, c2) -> c1/c2
- if (N0CFP && N1CFP && VT != MVT::ppcf128)
- return DAG.getNode(ISD::FDIV, VT, N0, N1);
-
-
- // -X / -Y -> X*Y
- if (char LHSNeg = isNegatibleForFree(N0, AfterLegalize)) {
- if (char RHSNeg = isNegatibleForFree(N1, AfterLegalize)) {
- // Both can be negated for free, check to see if at least one is cheaper
- // negated.
- if (LHSNeg == 2 || RHSNeg == 2)
- return DAG.getNode(ISD::FDIV, VT,
- GetNegatedExpression(N0, DAG, AfterLegalize),
- GetNegatedExpression(N1, DAG, AfterLegalize));
- }
- }
-
- return SDOperand();
-}
-
-SDOperand DAGCombiner::visitFREM(SDNode *N) {
- SDOperand N0 = N->getOperand(0);
- SDOperand N1 = N->getOperand(1);
- ConstantFPSDNode *N0CFP = dyn_cast<ConstantFPSDNode>(N0);
- ConstantFPSDNode *N1CFP = dyn_cast<ConstantFPSDNode>(N1);
- MVT::ValueType VT = N->getValueType(0);
-
- // fold (frem c1, c2) -> fmod(c1,c2)
- if (N0CFP && N1CFP && VT != MVT::ppcf128)
- return DAG.getNode(ISD::FREM, VT, N0, N1);
-
- return SDOperand();
-}
-
-SDOperand DAGCombiner::visitFCOPYSIGN(SDNode *N) {
- SDOperand N0 = N->getOperand(0);
- SDOperand N1 = N->getOperand(1);
- ConstantFPSDNode *N0CFP = dyn_cast<ConstantFPSDNode>(N0);
- ConstantFPSDNode *N1CFP = dyn_cast<ConstantFPSDNode>(N1);
- MVT::ValueType VT = N->getValueType(0);
-
- if (N0CFP && N1CFP && VT != MVT::ppcf128) // Constant fold
- return DAG.getNode(ISD::FCOPYSIGN, VT, N0, N1);
-
- if (N1CFP) {
- const APFloat& V = N1CFP->getValueAPF();
- // copysign(x, c1) -> fabs(x) iff ispos(c1)
- // copysign(x, c1) -> fneg(fabs(x)) iff isneg(c1)
- if (!V.isNegative())
- return DAG.getNode(ISD::FABS, VT, N0);
- else
- return DAG.getNode(ISD::FNEG, VT, DAG.getNode(ISD::FABS, VT, N0));
- }
-
- // copysign(fabs(x), y) -> copysign(x, y)
- // copysign(fneg(x), y) -> copysign(x, y)
- // copysign(copysign(x,z), y) -> copysign(x, y)
- if (N0.getOpcode() == ISD::FABS || N0.getOpcode() == ISD::FNEG ||
- N0.getOpcode() == ISD::FCOPYSIGN)
- return DAG.getNode(ISD::FCOPYSIGN, VT, N0.getOperand(0), N1);
-
- // copysign(x, abs(y)) -> abs(x)
- if (N1.getOpcode() == ISD::FABS)
- return DAG.getNode(ISD::FABS, VT, N0);
-
- // copysign(x, copysign(y,z)) -> copysign(x, z)
- if (N1.getOpcode() == ISD::FCOPYSIGN)
- return DAG.getNode(ISD::FCOPYSIGN, VT, N0, N1.getOperand(1));
-
- // copysign(x, fp_extend(y)) -> copysign(x, y)
- // copysign(x, fp_round(y)) -> copysign(x, y)
- if (N1.getOpcode() == ISD::FP_EXTEND || N1.getOpcode() == ISD::FP_ROUND)
- return DAG.getNode(ISD::FCOPYSIGN, VT, N0, N1.getOperand(0));
-
- return SDOperand();
-}
-
-
-
-SDOperand DAGCombiner::visitSINT_TO_FP(SDNode *N) {
- SDOperand N0 = N->getOperand(0);
- ConstantSDNode *N0C = dyn_cast<ConstantSDNode>(N0);
- MVT::ValueType VT = N->getValueType(0);
-
- // fold (sint_to_fp c1) -> c1fp
- if (N0C && N0.getValueType() != MVT::ppcf128)
- return DAG.getNode(ISD::SINT_TO_FP, VT, N0);
- return SDOperand();
-}
-
-SDOperand DAGCombiner::visitUINT_TO_FP(SDNode *N) {
- SDOperand N0 = N->getOperand(0);
- ConstantSDNode *N0C = dyn_cast<ConstantSDNode>(N0);
- MVT::ValueType VT = N->getValueType(0);
-
- // fold (uint_to_fp c1) -> c1fp
- if (N0C && N0.getValueType() != MVT::ppcf128)
- return DAG.getNode(ISD::UINT_TO_FP, VT, N0);
- return SDOperand();
-}
-
-SDOperand DAGCombiner::visitFP_TO_SINT(SDNode *N) {
- SDOperand N0 = N->getOperand(0);
- ConstantFPSDNode *N0CFP = dyn_cast<ConstantFPSDNode>(N0);
- MVT::ValueType VT = N->getValueType(0);
-
- // fold (fp_to_sint c1fp) -> c1
- if (N0CFP)
- return DAG.getNode(ISD::FP_TO_SINT, VT, N0);
- return SDOperand();
-}
-
-SDOperand DAGCombiner::visitFP_TO_UINT(SDNode *N) {
- SDOperand N0 = N->getOperand(0);
- ConstantFPSDNode *N0CFP = dyn_cast<ConstantFPSDNode>(N0);
- MVT::ValueType VT = N->getValueType(0);
-
- // fold (fp_to_uint c1fp) -> c1
- if (N0CFP && VT != MVT::ppcf128)
- return DAG.getNode(ISD::FP_TO_UINT, VT, N0);
- return SDOperand();
-}
-
-SDOperand DAGCombiner::visitFP_ROUND(SDNode *N) {
- SDOperand N0 = N->getOperand(0);
- SDOperand N1 = N->getOperand(1);
- ConstantFPSDNode *N0CFP = dyn_cast<ConstantFPSDNode>(N0);
- MVT::ValueType VT = N->getValueType(0);
-
- // fold (fp_round c1fp) -> c1fp
- if (N0CFP && N0.getValueType() != MVT::ppcf128)
- return DAG.getNode(ISD::FP_ROUND, VT, N0, N1);
-
- // fold (fp_round (fp_extend x)) -> x
- if (N0.getOpcode() == ISD::FP_EXTEND && VT == N0.getOperand(0).getValueType())
- return N0.getOperand(0);
-
- // fold (fp_round (fp_round x)) -> (fp_round x)
- if (N0.getOpcode() == ISD::FP_ROUND) {
- // This is a value preserving truncation if both round's are.
- bool IsTrunc = N->getConstantOperandVal(1) == 1 &&
- N0.Val->getConstantOperandVal(1) == 1;
- return DAG.getNode(ISD::FP_ROUND, VT, N0.getOperand(0),
- DAG.getIntPtrConstant(IsTrunc));
- }
-
- // fold (fp_round (copysign X, Y)) -> (copysign (fp_round X), Y)
- if (N0.getOpcode() == ISD::FCOPYSIGN && N0.Val->hasOneUse()) {
- SDOperand Tmp = DAG.getNode(ISD::FP_ROUND, VT, N0.getOperand(0), N1);
- AddToWorkList(Tmp.Val);
- return DAG.getNode(ISD::FCOPYSIGN, VT, Tmp, N0.getOperand(1));
- }
-
- return SDOperand();
-}
-
-SDOperand DAGCombiner::visitFP_ROUND_INREG(SDNode *N) {
- SDOperand N0 = N->getOperand(0);
- MVT::ValueType VT = N->getValueType(0);
- MVT::ValueType EVT = cast<VTSDNode>(N->getOperand(1))->getVT();
- ConstantFPSDNode *N0CFP = dyn_cast<ConstantFPSDNode>(N0);
-
- // fold (fp_round_inreg c1fp) -> c1fp
- if (N0CFP) {
- SDOperand Round = DAG.getConstantFP(N0CFP->getValueAPF(), EVT);
- return DAG.getNode(ISD::FP_EXTEND, VT, Round);
- }
- return SDOperand();
-}
-
-SDOperand DAGCombiner::visitFP_EXTEND(SDNode *N) {
- SDOperand N0 = N->getOperand(0);
- ConstantFPSDNode *N0CFP = dyn_cast<ConstantFPSDNode>(N0);
- MVT::ValueType VT = N->getValueType(0);
-
- // If this is fp_round(fpextend), don't fold it, allow ourselves to be folded.
- if (N->hasOneUse() &&
- N->use_begin()->getSDOperand().getOpcode() == ISD::FP_ROUND)
- return SDOperand();
-
- // fold (fp_extend c1fp) -> c1fp
- if (N0CFP && VT != MVT::ppcf128)
- return DAG.getNode(ISD::FP_EXTEND, VT, N0);
-
- // Turn fp_extend(fp_round(X, 1)) -> x since the fp_round doesn't affect the
- // value of X.
- if (N0.getOpcode() == ISD::FP_ROUND && N0.Val->getConstantOperandVal(1) == 1){
- SDOperand In = N0.getOperand(0);
- if (In.getValueType() == VT) return In;
- if (VT < In.getValueType())
- return DAG.getNode(ISD::FP_ROUND, VT, In, N0.getOperand(1));
- return DAG.getNode(ISD::FP_EXTEND, VT, In);
- }
-
- // fold (fpext (load x)) -> (fpext (fptrunc (extload x)))
- if (ISD::isNON_EXTLoad(N0.Val) && N0.hasOneUse() &&
- (!AfterLegalize||TLI.isLoadXLegal(ISD::EXTLOAD, N0.getValueType()))) {
- LoadSDNode *LN0 = cast<LoadSDNode>(N0);
- SDOperand ExtLoad = DAG.getExtLoad(ISD::EXTLOAD, VT, LN0->getChain(),
- LN0->getBasePtr(), LN0->getSrcValue(),
- LN0->getSrcValueOffset(),
- N0.getValueType(),
- LN0->isVolatile(),
- LN0->getAlignment());
- CombineTo(N, ExtLoad);
- CombineTo(N0.Val, DAG.getNode(ISD::FP_ROUND, N0.getValueType(), ExtLoad,
- DAG.getIntPtrConstant(1)),
- ExtLoad.getValue(1));
- return SDOperand(N, 0); // Return N so it doesn't get rechecked!
- }
-
-
- return SDOperand();
-}
-
-SDOperand DAGCombiner::visitFNEG(SDNode *N) {
- SDOperand N0 = N->getOperand(0);
-
- if (isNegatibleForFree(N0, AfterLegalize))
- return GetNegatedExpression(N0, DAG, AfterLegalize);
-
- // Transform fneg(bitconvert(x)) -> bitconvert(x^sign) to avoid loading
- // constant pool values.
- if (N0.getOpcode() == ISD::BIT_CONVERT && N0.Val->hasOneUse() &&
- MVT::isInteger(N0.getOperand(0).getValueType()) &&
- !MVT::isVector(N0.getOperand(0).getValueType())) {
- SDOperand Int = N0.getOperand(0);
- MVT::ValueType IntVT = Int.getValueType();
- if (MVT::isInteger(IntVT) && !MVT::isVector(IntVT)) {
- Int = DAG.getNode(ISD::XOR, IntVT, Int,
- DAG.getConstant(MVT::getIntVTSignBit(IntVT), IntVT));
- AddToWorkList(Int.Val);
- return DAG.getNode(ISD::BIT_CONVERT, N->getValueType(0), Int);
- }
- }
-
- return SDOperand();
-}
-
-SDOperand DAGCombiner::visitFABS(SDNode *N) {
- SDOperand N0 = N->getOperand(0);
- ConstantFPSDNode *N0CFP = dyn_cast<ConstantFPSDNode>(N0);
- MVT::ValueType VT = N->getValueType(0);
-
- // fold (fabs c1) -> fabs(c1)
- if (N0CFP && VT != MVT::ppcf128)
- return DAG.getNode(ISD::FABS, VT, N0);
- // fold (fabs (fabs x)) -> (fabs x)
- if (N0.getOpcode() == ISD::FABS)
- return N->getOperand(0);
- // fold (fabs (fneg x)) -> (fabs x)
- // fold (fabs (fcopysign x, y)) -> (fabs x)
- if (N0.getOpcode() == ISD::FNEG || N0.getOpcode() == ISD::FCOPYSIGN)
- return DAG.getNode(ISD::FABS, VT, N0.getOperand(0));
-
- // Transform fabs(bitconvert(x)) -> bitconvert(x&~sign) to avoid loading
- // constant pool values.
- if (N0.getOpcode() == ISD::BIT_CONVERT && N0.Val->hasOneUse() &&
- MVT::isInteger(N0.getOperand(0).getValueType()) &&
- !MVT::isVector(N0.getOperand(0).getValueType())) {
- SDOperand Int = N0.getOperand(0);
- MVT::ValueType IntVT = Int.getValueType();
- if (MVT::isInteger(IntVT) && !MVT::isVector(IntVT)) {
- Int = DAG.getNode(ISD::AND, IntVT, Int,
- DAG.getConstant(~MVT::getIntVTSignBit(IntVT), IntVT));
- AddToWorkList(Int.Val);
- return DAG.getNode(ISD::BIT_CONVERT, N->getValueType(0), Int);
- }
- }
-
- return SDOperand();
-}
-
-SDOperand DAGCombiner::visitBRCOND(SDNode *N) {
- SDOperand Chain = N->getOperand(0);
- SDOperand N1 = N->getOperand(1);
- SDOperand N2 = N->getOperand(2);
- ConstantSDNode *N1C = dyn_cast<ConstantSDNode>(N1);
-
- // never taken branch, fold to chain
- if (N1C && N1C->isNullValue())
- return Chain;
- // unconditional branch
- if (N1C && N1C->getAPIntValue() == 1)
- return DAG.getNode(ISD::BR, MVT::Other, Chain, N2);
- // fold a brcond with a setcc condition into a BR_CC node if BR_CC is legal
- // on the target.
- if (N1.getOpcode() == ISD::SETCC &&
- TLI.isOperationLegal(ISD::BR_CC, MVT::Other)) {
- return DAG.getNode(ISD::BR_CC, MVT::Other, Chain, N1.getOperand(2),
- N1.getOperand(0), N1.getOperand(1), N2);
- }
- return SDOperand();
-}
-
-// Operand List for BR_CC: Chain, CondCC, CondLHS, CondRHS, DestBB.
-//
-SDOperand DAGCombiner::visitBR_CC(SDNode *N) {
- CondCodeSDNode *CC = cast<CondCodeSDNode>(N->getOperand(1));
- SDOperand CondLHS = N->getOperand(2), CondRHS = N->getOperand(3);
-
- // Use SimplifySetCC to simplify SETCC's.
- SDOperand Simp = SimplifySetCC(MVT::i1, CondLHS, CondRHS, CC->get(), false);
- if (Simp.Val) AddToWorkList(Simp.Val);
-
- ConstantSDNode *SCCC = dyn_cast_or_null<ConstantSDNode>(Simp.Val);
-
- // fold br_cc true, dest -> br dest (unconditional branch)
- if (SCCC && !SCCC->isNullValue())
- return DAG.getNode(ISD::BR, MVT::Other, N->getOperand(0),
- N->getOperand(4));
- // fold br_cc false, dest -> unconditional fall through
- if (SCCC && SCCC->isNullValue())
- return N->getOperand(0);
-
- // fold to a simpler setcc
- if (Simp.Val && Simp.getOpcode() == ISD::SETCC)
- return DAG.getNode(ISD::BR_CC, MVT::Other, N->getOperand(0),
- Simp.getOperand(2), Simp.getOperand(0),
- Simp.getOperand(1), N->getOperand(4));
- return SDOperand();
-}
-
-
-/// CombineToPreIndexedLoadStore - Try turning a load / store and a
-/// pre-indexed load / store when the base pointer is a add or subtract
-/// and it has other uses besides the load / store. After the
-/// transformation, the new indexed load / store has effectively folded
-/// the add / subtract in and all of its other uses are redirected to the
-/// new load / store.
-bool DAGCombiner::CombineToPreIndexedLoadStore(SDNode *N) {
- if (!AfterLegalize)
- return false;
-
- bool isLoad = true;
- SDOperand Ptr;
- MVT::ValueType VT;
- if (LoadSDNode *LD = dyn_cast<LoadSDNode>(N)) {
- if (LD->isIndexed())
- return false;
- VT = LD->getMemoryVT();
- if (!TLI.isIndexedLoadLegal(ISD::PRE_INC, VT) &&
- !TLI.isIndexedLoadLegal(ISD::PRE_DEC, VT))
- return false;
- Ptr = LD->getBasePtr();
- } else if (StoreSDNode *ST = dyn_cast<StoreSDNode>(N)) {
- if (ST->isIndexed())
- return false;
- VT = ST->getMemoryVT();
- if (!TLI.isIndexedStoreLegal(ISD::PRE_INC, VT) &&
- !TLI.isIndexedStoreLegal(ISD::PRE_DEC, VT))
- return false;
- Ptr = ST->getBasePtr();
- isLoad = false;
- } else
- return false;
-
- // If the pointer is not an add/sub, or if it doesn't have multiple uses, bail
- // out. There is no reason to make this a preinc/predec.
- if ((Ptr.getOpcode() != ISD::ADD && Ptr.getOpcode() != ISD::SUB) ||
- Ptr.Val->hasOneUse())
- return false;
-
- // Ask the target to do addressing mode selection.
- SDOperand BasePtr;
- SDOperand Offset;
- ISD::MemIndexedMode AM = ISD::UNINDEXED;
- if (!TLI.getPreIndexedAddressParts(N, BasePtr, Offset, AM, DAG))
- return false;
- // Don't create a indexed load / store with zero offset.
- if (isa<ConstantSDNode>(Offset) &&
- cast<ConstantSDNode>(Offset)->isNullValue())
- return false;
-
- // Try turning it into a pre-indexed load / store except when:
- // 1) The new base ptr is a frame index.
- // 2) If N is a store and the new base ptr is either the same as or is a
- // predecessor of the value being stored.
- // 3) Another use of old base ptr is a predecessor of N. If ptr is folded
- // that would create a cycle.
- // 4) All uses are load / store ops that use it as old base ptr.
-
- // Check #1. Preinc'ing a frame index would require copying the stack pointer
- // (plus the implicit offset) to a register to preinc anyway.
- if (isa<FrameIndexSDNode>(BasePtr))
- return false;
-
- // Check #2.
- if (!isLoad) {
- SDOperand Val = cast<StoreSDNode>(N)->getValue();
- if (Val == BasePtr || BasePtr.Val->isPredecessorOf(Val.Val))
- return false;
- }
-
- // Now check for #3 and #4.
- bool RealUse = false;
- for (SDNode::use_iterator I = Ptr.Val->use_begin(),
- E = Ptr.Val->use_end(); I != E; ++I) {
- SDNode *Use = I->getUser();
- if (Use == N)
- continue;
- if (Use->isPredecessorOf(N))
- return false;
-
- if (!((Use->getOpcode() == ISD::LOAD &&
- cast<LoadSDNode>(Use)->getBasePtr() == Ptr) ||
- (Use->getOpcode() == ISD::STORE &&
- cast<StoreSDNode>(Use)->getBasePtr() == Ptr)))
- RealUse = true;
- }
- if (!RealUse)
- return false;
-
- SDOperand Result;
- if (isLoad)
- Result = DAG.getIndexedLoad(SDOperand(N,0), BasePtr, Offset, AM);
- else
- Result = DAG.getIndexedStore(SDOperand(N,0), BasePtr, Offset, AM);
- ++PreIndexedNodes;
- ++NodesCombined;
- DOUT << "\nReplacing.4 "; DEBUG(N->dump(&DAG));
- DOUT << "\nWith: "; DEBUG(Result.Val->dump(&DAG));
- DOUT << '\n';
- WorkListRemover DeadNodes(*this);
- if (isLoad) {
- DAG.ReplaceAllUsesOfValueWith(SDOperand(N, 0), Result.getValue(0),
- &DeadNodes);
- DAG.ReplaceAllUsesOfValueWith(SDOperand(N, 1), Result.getValue(2),
- &DeadNodes);
- } else {
- DAG.ReplaceAllUsesOfValueWith(SDOperand(N, 0), Result.getValue(1),
- &DeadNodes);
- }
-
- // Finally, since the node is now dead, remove it from the graph.
- DAG.DeleteNode(N);
-
- // Replace the uses of Ptr with uses of the updated base value.
- DAG.ReplaceAllUsesOfValueWith(Ptr, Result.getValue(isLoad ? 1 : 0),
- &DeadNodes);
- removeFromWorkList(Ptr.Val);
- DAG.DeleteNode(Ptr.Val);
-
- return true;
-}
-
-/// CombineToPostIndexedLoadStore - Try combine a load / store with a
-/// add / sub of the base pointer node into a post-indexed load / store.
-/// The transformation folded the add / subtract into the new indexed
-/// load / store effectively and all of its uses are redirected to the
-/// new load / store.
-bool DAGCombiner::CombineToPostIndexedLoadStore(SDNode *N) {
- if (!AfterLegalize)
- return false;
-
- bool isLoad = true;
- SDOperand Ptr;
- MVT::ValueType VT;
- if (LoadSDNode *LD = dyn_cast<LoadSDNode>(N)) {
- if (LD->isIndexed())
- return false;
- VT = LD->getMemoryVT();
- if (!TLI.isIndexedLoadLegal(ISD::POST_INC, VT) &&
- !TLI.isIndexedLoadLegal(ISD::POST_DEC, VT))
- return false;
- Ptr = LD->getBasePtr();
- } else if (StoreSDNode *ST = dyn_cast<StoreSDNode>(N)) {
- if (ST->isIndexed())
- return false;
- VT = ST->getMemoryVT();
- if (!TLI.isIndexedStoreLegal(ISD::POST_INC, VT) &&
- !TLI.isIndexedStoreLegal(ISD::POST_DEC, VT))
- return false;
- Ptr = ST->getBasePtr();
- isLoad = false;
- } else
- return false;
-
- if (Ptr.Val->hasOneUse())
- return false;
-
- for (SDNode::use_iterator I = Ptr.Val->use_begin(),
- E = Ptr.Val->use_end(); I != E; ++I) {
- SDNode *Op = I->getUser();
- if (Op == N ||
- (Op->getOpcode() != ISD::ADD && Op->getOpcode() != ISD::SUB))
- continue;
-
- SDOperand BasePtr;
- SDOperand Offset;
- ISD::MemIndexedMode AM = ISD::UNINDEXED;
- if (TLI.getPostIndexedAddressParts(N, Op, BasePtr, Offset, AM, DAG)) {
- if (Ptr == Offset)
- std::swap(BasePtr, Offset);
- if (Ptr != BasePtr)
- continue;
- // Don't create a indexed load / store with zero offset.
- if (isa<ConstantSDNode>(Offset) &&
- cast<ConstantSDNode>(Offset)->isNullValue())
- continue;
-
- // Try turning it into a post-indexed load / store except when
- // 1) All uses are load / store ops that use it as base ptr.
- // 2) Op must be independent of N, i.e. Op is neither a predecessor
- // nor a successor of N. Otherwise, if Op is folded that would
- // create a cycle.
-
- // Check for #1.
- bool TryNext = false;
- for (SDNode::use_iterator II = BasePtr.Val->use_begin(),
- EE = BasePtr.Val->use_end(); II != EE; ++II) {
- SDNode *Use = II->getUser();
- if (Use == Ptr.Val)
- continue;
-
- // If all the uses are load / store addresses, then don't do the
- // transformation.
- if (Use->getOpcode() == ISD::ADD || Use->getOpcode() == ISD::SUB){
- bool RealUse = false;
- for (SDNode::use_iterator III = Use->use_begin(),
- EEE = Use->use_end(); III != EEE; ++III) {
- SDNode *UseUse = III->getUser();
- if (!((UseUse->getOpcode() == ISD::LOAD &&
- cast<LoadSDNode>(UseUse)->getBasePtr().Val == Use) ||
- (UseUse->getOpcode() == ISD::STORE &&
- cast<StoreSDNode>(UseUse)->getBasePtr().Val == Use)))
- RealUse = true;
- }
-
- if (!RealUse) {
- TryNext = true;
- break;
- }
- }
- }
- if (TryNext)
- continue;
-
- // Check for #2
- if (!Op->isPredecessorOf(N) && !N->isPredecessorOf(Op)) {
- SDOperand Result = isLoad
- ? DAG.getIndexedLoad(SDOperand(N,0), BasePtr, Offset, AM)
- : DAG.getIndexedStore(SDOperand(N,0), BasePtr, Offset, AM);
- ++PostIndexedNodes;
- ++NodesCombined;
- DOUT << "\nReplacing.5 "; DEBUG(N->dump(&DAG));
- DOUT << "\nWith: "; DEBUG(Result.Val->dump(&DAG));
- DOUT << '\n';
- WorkListRemover DeadNodes(*this);
- if (isLoad) {
- DAG.ReplaceAllUsesOfValueWith(SDOperand(N, 0), Result.getValue(0),
- &DeadNodes);
- DAG.ReplaceAllUsesOfValueWith(SDOperand(N, 1), Result.getValue(2),
- &DeadNodes);
- } else {
- DAG.ReplaceAllUsesOfValueWith(SDOperand(N, 0), Result.getValue(1),
- &DeadNodes);
- }
-
- // Finally, since the node is now dead, remove it from the graph.
- DAG.DeleteNode(N);
-
- // Replace the uses of Use with uses of the updated base value.
- DAG.ReplaceAllUsesOfValueWith(SDOperand(Op, 0),
- Result.getValue(isLoad ? 1 : 0),
- &DeadNodes);
- removeFromWorkList(Op);
- DAG.DeleteNode(Op);
- return true;
- }
- }
- }
- return false;
-}
-
-/// InferAlignment - If we can infer some alignment information from this
-/// pointer, return it.
-static unsigned InferAlignment(SDOperand Ptr, SelectionDAG &DAG) {
- // If this is a direct reference to a stack slot, use information about the
- // stack slot's alignment.
- int FrameIdx = 1 << 31;
- int64_t FrameOffset = 0;
- if (FrameIndexSDNode *FI = dyn_cast<FrameIndexSDNode>(Ptr)) {
- FrameIdx = FI->getIndex();
- } else if (Ptr.getOpcode() == ISD::ADD &&
- isa<ConstantSDNode>(Ptr.getOperand(1)) &&
- isa<FrameIndexSDNode>(Ptr.getOperand(0))) {
- FrameIdx = cast<FrameIndexSDNode>(Ptr.getOperand(0))->getIndex();
- FrameOffset = Ptr.getConstantOperandVal(1);
- }
-
- if (FrameIdx != (1 << 31)) {
- // FIXME: Handle FI+CST.
- const MachineFrameInfo &MFI = *DAG.getMachineFunction().getFrameInfo();
- if (MFI.isFixedObjectIndex(FrameIdx)) {
- int64_t ObjectOffset = MFI.getObjectOffset(FrameIdx);
-
- // The alignment of the frame index can be determined from its offset from
- // the incoming frame position. If the frame object is at offset 32 and
- // the stack is guaranteed to be 16-byte aligned, then we know that the
- // object is 16-byte aligned.
- unsigned StackAlign = DAG.getTarget().getFrameInfo()->getStackAlignment();
- unsigned Align = MinAlign(ObjectOffset, StackAlign);
-
- // Finally, the frame object itself may have a known alignment. Factor
- // the alignment + offset into a new alignment. For example, if we know
- // the FI is 8 byte aligned, but the pointer is 4 off, we really have a
- // 4-byte alignment of the resultant pointer. Likewise align 4 + 4-byte
- // offset = 4-byte alignment, align 4 + 1-byte offset = align 1, etc.
- unsigned FIInfoAlign = MinAlign(MFI.getObjectAlignment(FrameIdx),
- FrameOffset);
- return std::max(Align, FIInfoAlign);
- }
- }
-
- return 0;
-}
-
-SDOperand DAGCombiner::visitLOAD(SDNode *N) {
- LoadSDNode *LD = cast<LoadSDNode>(N);
- SDOperand Chain = LD->getChain();
- SDOperand Ptr = LD->getBasePtr();
-
- // Try to infer better alignment information than the load already has.
- if (LD->isUnindexed()) {
- if (unsigned Align = InferAlignment(Ptr, DAG)) {
- if (Align > LD->getAlignment())
- return DAG.getExtLoad(LD->getExtensionType(), LD->getValueType(0),
- Chain, Ptr, LD->getSrcValue(),
- LD->getSrcValueOffset(), LD->getMemoryVT(),
- LD->isVolatile(), Align);
- }
- }
-
-
- // If load is not volatile and there are no uses of the loaded value (and
- // the updated indexed value in case of indexed loads), change uses of the
- // chain value into uses of the chain input (i.e. delete the dead load).
- if (!LD->isVolatile()) {
- if (N->getValueType(1) == MVT::Other) {
- // Unindexed loads.
- if (N->hasNUsesOfValue(0, 0)) {
- // It's not safe to use the two value CombineTo variant here. e.g.
- // v1, chain2 = load chain1, loc
- // v2, chain3 = load chain2, loc
- // v3 = add v2, c
- // Now we replace use of chain2 with chain1. This makes the second load
- // isomorphic to the one we are deleting, and thus makes this load live.
- DOUT << "\nReplacing.6 "; DEBUG(N->dump(&DAG));
- DOUT << "\nWith chain: "; DEBUG(Chain.Val->dump(&DAG));
- DOUT << "\n";
- WorkListRemover DeadNodes(*this);
- DAG.ReplaceAllUsesOfValueWith(SDOperand(N, 1), Chain, &DeadNodes);
- if (N->use_empty()) {
- removeFromWorkList(N);
- DAG.DeleteNode(N);
- }
- return SDOperand(N, 0); // Return N so it doesn't get rechecked!
- }
- } else {
- // Indexed loads.
- assert(N->getValueType(2) == MVT::Other && "Malformed indexed loads?");
- if (N->hasNUsesOfValue(0, 0) && N->hasNUsesOfValue(0, 1)) {
- SDOperand Undef = DAG.getNode(ISD::UNDEF, N->getValueType(0));
- DOUT << "\nReplacing.6 "; DEBUG(N->dump(&DAG));
- DOUT << "\nWith: "; DEBUG(Undef.Val->dump(&DAG));
- DOUT << " and 2 other values\n";
- WorkListRemover DeadNodes(*this);
- DAG.ReplaceAllUsesOfValueWith(SDOperand(N, 0), Undef, &DeadNodes);
- DAG.ReplaceAllUsesOfValueWith(SDOperand(N, 1),
- DAG.getNode(ISD::UNDEF, N->getValueType(1)),
- &DeadNodes);
- DAG.ReplaceAllUsesOfValueWith(SDOperand(N, 2), Chain, &DeadNodes);
- removeFromWorkList(N);
- DAG.DeleteNode(N);
- return SDOperand(N, 0); // Return N so it doesn't get rechecked!
- }
- }
- }
-
- // If this load is directly stored, replace the load value with the stored
- // value.
- // TODO: Handle store large -> read small portion.
- // TODO: Handle TRUNCSTORE/LOADEXT
- if (LD->getExtensionType() == ISD::NON_EXTLOAD &&
- !LD->isVolatile()) {
- if (ISD::isNON_TRUNCStore(Chain.Val)) {
- StoreSDNode *PrevST = cast<StoreSDNode>(Chain);
- if (PrevST->getBasePtr() == Ptr &&
- PrevST->getValue().getValueType() == N->getValueType(0))
- return CombineTo(N, Chain.getOperand(1), Chain);
- }
- }
-
- if (CombinerAA) {
- // Walk up chain skipping non-aliasing memory nodes.
- SDOperand BetterChain = FindBetterChain(N, Chain);
-
- // If there is a better chain.
- if (Chain != BetterChain) {
- SDOperand ReplLoad;
-
- // Replace the chain to void dependency.
- if (LD->getExtensionType() == ISD::NON_EXTLOAD) {
- ReplLoad = DAG.getLoad(N->getValueType(0), BetterChain, Ptr,
- LD->getSrcValue(), LD->getSrcValueOffset(),
- LD->isVolatile(), LD->getAlignment());
- } else {
- ReplLoad = DAG.getExtLoad(LD->getExtensionType(),
- LD->getValueType(0),
- BetterChain, Ptr, LD->getSrcValue(),
- LD->getSrcValueOffset(),
- LD->getMemoryVT(),
- LD->isVolatile(),
- LD->getAlignment());
- }
-
- // Create token factor to keep old chain connected.
- SDOperand Token = DAG.getNode(ISD::TokenFactor, MVT::Other,
- Chain, ReplLoad.getValue(1));
-
- // Replace uses with load result and token factor. Don't add users
- // to work list.
- return CombineTo(N, ReplLoad.getValue(0), Token, false);
- }
- }
-
- // Try transforming N to an indexed load.
- if (CombineToPreIndexedLoadStore(N) || CombineToPostIndexedLoadStore(N))
- return SDOperand(N, 0);
-
- return SDOperand();
-}
-
-
-SDOperand DAGCombiner::visitSTORE(SDNode *N) {
- StoreSDNode *ST = cast<StoreSDNode>(N);
- SDOperand Chain = ST->getChain();
- SDOperand Value = ST->getValue();
- SDOperand Ptr = ST->getBasePtr();
-
- // Try to infer better alignment information than the store already has.
- if (ST->isUnindexed()) {
- if (unsigned Align = InferAlignment(Ptr, DAG)) {
- if (Align > ST->getAlignment())
- return DAG.getTruncStore(Chain, Value, Ptr, ST->getSrcValue(),
- ST->getSrcValueOffset(), ST->getMemoryVT(),
- ST->isVolatile(), Align);
- }
- }
-
- // If this is a store of a bit convert, store the input value if the
- // resultant store does not need a higher alignment than the original.
- if (Value.getOpcode() == ISD::BIT_CONVERT && !ST->isTruncatingStore() &&
- ST->isUnindexed()) {
- unsigned Align = ST->getAlignment();
- MVT::ValueType SVT = Value.getOperand(0).getValueType();
- unsigned OrigAlign = TLI.getTargetMachine().getTargetData()->
- getABITypeAlignment(MVT::getTypeForValueType(SVT));
- if (Align <= OrigAlign && TLI.isOperationLegal(ISD::STORE, SVT))
- return DAG.getStore(Chain, Value.getOperand(0), Ptr, ST->getSrcValue(),
- ST->getSrcValueOffset(), ST->isVolatile(), Align);
- }
-
- // Turn 'store float 1.0, Ptr' -> 'store int 0x12345678, Ptr'
- if (ConstantFPSDNode *CFP = dyn_cast<ConstantFPSDNode>(Value)) {
- if (Value.getOpcode() != ISD::TargetConstantFP) {
- SDOperand Tmp;
- switch (CFP->getValueType(0)) {
- default: assert(0 && "Unknown FP type");
- case MVT::f80: // We don't do this for these yet.
- case MVT::f128:
- case MVT::ppcf128:
- break;
- case MVT::f32:
- if (!AfterLegalize || TLI.isTypeLegal(MVT::i32)) {
- Tmp = DAG.getConstant((uint32_t)CFP->getValueAPF().
- convertToAPInt().getZExtValue(), MVT::i32);
- return DAG.getStore(Chain, Tmp, Ptr, ST->getSrcValue(),
- ST->getSrcValueOffset(), ST->isVolatile(),
- ST->getAlignment());
- }
- break;
- case MVT::f64:
- if (!AfterLegalize || TLI.isTypeLegal(MVT::i64)) {
- Tmp = DAG.getConstant(CFP->getValueAPF().convertToAPInt().
- getZExtValue(), MVT::i64);
- return DAG.getStore(Chain, Tmp, Ptr, ST->getSrcValue(),
- ST->getSrcValueOffset(), ST->isVolatile(),
- ST->getAlignment());
- } else if (TLI.isTypeLegal(MVT::i32)) {
- // Many FP stores are not made apparent until after legalize, e.g. for
- // argument passing. Since this is so common, custom legalize the
- // 64-bit integer store into two 32-bit stores.
- uint64_t Val = CFP->getValueAPF().convertToAPInt().getZExtValue();
- SDOperand Lo = DAG.getConstant(Val & 0xFFFFFFFF, MVT::i32);
- SDOperand Hi = DAG.getConstant(Val >> 32, MVT::i32);
- if (TLI.isBigEndian()) std::swap(Lo, Hi);
-
- int SVOffset = ST->getSrcValueOffset();
- unsigned Alignment = ST->getAlignment();
- bool isVolatile = ST->isVolatile();
-
- SDOperand St0 = DAG.getStore(Chain, Lo, Ptr, ST->getSrcValue(),
- ST->getSrcValueOffset(),
- isVolatile, ST->getAlignment());
- Ptr = DAG.getNode(ISD::ADD, Ptr.getValueType(), Ptr,
- DAG.getConstant(4, Ptr.getValueType()));
- SVOffset += 4;
- Alignment = MinAlign(Alignment, 4U);
- SDOperand St1 = DAG.getStore(Chain, Hi, Ptr, ST->getSrcValue(),
- SVOffset, isVolatile, Alignment);
- return DAG.getNode(ISD::TokenFactor, MVT::Other, St0, St1);
- }
- break;
- }
- }
- }
-
- if (CombinerAA) {
- // Walk up chain skipping non-aliasing memory nodes.
- SDOperand BetterChain = FindBetterChain(N, Chain);
-
- // If there is a better chain.
- if (Chain != BetterChain) {
- // Replace the chain to avoid dependency.
- SDOperand ReplStore;
- if (ST->isTruncatingStore()) {
- ReplStore = DAG.getTruncStore(BetterChain, Value, Ptr,
- ST->getSrcValue(),ST->getSrcValueOffset(),
- ST->getMemoryVT(),
- ST->isVolatile(), ST->getAlignment());
- } else {
- ReplStore = DAG.getStore(BetterChain, Value, Ptr,
- ST->getSrcValue(), ST->getSrcValueOffset(),
- ST->isVolatile(), ST->getAlignment());
- }
-
- // Create token to keep both nodes around.
- SDOperand Token =
- DAG.getNode(ISD::TokenFactor, MVT::Other, Chain, ReplStore);
-
- // Don't add users to work list.
- return CombineTo(N, Token, false);
- }
- }
-
- // Try transforming N to an indexed store.
- if (CombineToPreIndexedLoadStore(N) || CombineToPostIndexedLoadStore(N))
- return SDOperand(N, 0);
-
- // FIXME: is there such a thing as a truncating indexed store?
- if (ST->isTruncatingStore() && ST->isUnindexed() &&
- MVT::isInteger(Value.getValueType())) {
- // See if we can simplify the input to this truncstore with knowledge that
- // only the low bits are being used. For example:
- // "truncstore (or (shl x, 8), y), i8" -> "truncstore y, i8"
- SDOperand Shorter =
- GetDemandedBits(Value,
- APInt::getLowBitsSet(Value.getValueSizeInBits(),
- MVT::getSizeInBits(ST->getMemoryVT())));
- AddToWorkList(Value.Val);
- if (Shorter.Val)
- return DAG.getTruncStore(Chain, Shorter, Ptr, ST->getSrcValue(),
- ST->getSrcValueOffset(), ST->getMemoryVT(),
- ST->isVolatile(), ST->getAlignment());
-
- // Otherwise, see if we can simplify the operation with
- // SimplifyDemandedBits, which only works if the value has a single use.
- if (SimplifyDemandedBits(Value,
- APInt::getLowBitsSet(
- Value.getValueSizeInBits(),
- MVT::getSizeInBits(ST->getMemoryVT()))))
- return SDOperand(N, 0);
- }
-
- // If this is a load followed by a store to the same location, then the store
- // is dead/noop.
- if (LoadSDNode *Ld = dyn_cast<LoadSDNode>(Value)) {
- if (Ld->getBasePtr() == Ptr && ST->getMemoryVT() == Ld->getMemoryVT() &&
- ST->isUnindexed() && !ST->isVolatile() &&
- // There can't be any side effects between the load and store, such as
- // a call or store.
- Chain.reachesChainWithoutSideEffects(SDOperand(Ld, 1))) {
- // The store is dead, remove it.
- return Chain;
- }
- }
-
- // If this is an FP_ROUND or TRUNC followed by a store, fold this into a
- // truncating store. We can do this even if this is already a truncstore.
- if ((Value.getOpcode() == ISD::FP_ROUND || Value.getOpcode() == ISD::TRUNCATE)
- && TLI.isTypeLegal(Value.getOperand(0).getValueType()) &&
- Value.Val->hasOneUse() && ST->isUnindexed() &&
- TLI.isTruncStoreLegal(Value.getOperand(0).getValueType(),
- ST->getMemoryVT())) {
- return DAG.getTruncStore(Chain, Value.getOperand(0), Ptr, ST->getSrcValue(),
- ST->getSrcValueOffset(), ST->getMemoryVT(),
- ST->isVolatile(), ST->getAlignment());
- }
-
- return SDOperand();
-}
-
-SDOperand DAGCombiner::visitINSERT_VECTOR_ELT(SDNode *N) {
- SDOperand InVec = N->getOperand(0);
- SDOperand InVal = N->getOperand(1);
- SDOperand EltNo = N->getOperand(2);
-
- // If the invec is a BUILD_VECTOR and if EltNo is a constant, build a new
- // vector with the inserted element.
- if (InVec.getOpcode() == ISD::BUILD_VECTOR && isa<ConstantSDNode>(EltNo)) {
- unsigned Elt = cast<ConstantSDNode>(EltNo)->getValue();
- SmallVector<SDOperand, 8> Ops(InVec.Val->op_begin(), InVec.Val->op_end());
- if (Elt < Ops.size())
- Ops[Elt] = InVal;
- return DAG.getNode(ISD::BUILD_VECTOR, InVec.getValueType(),
- &Ops[0], Ops.size());
- }
-
- return SDOperand();
-}
-
-SDOperand DAGCombiner::visitEXTRACT_VECTOR_ELT(SDNode *N) {
- SDOperand InVec = N->getOperand(0);
- SDOperand EltNo = N->getOperand(1);
-
- // (vextract (v4f32 s2v (f32 load $addr)), 0) -> (f32 load $addr)
- // (vextract (v4i32 bc (v4f32 s2v (f32 load $addr))), 0) -> (i32 load $addr)
- if (isa<ConstantSDNode>(EltNo)) {
- unsigned Elt = cast<ConstantSDNode>(EltNo)->getValue();
- bool NewLoad = false;
- if (Elt == 0) {
- MVT::ValueType VT = InVec.getValueType();
- MVT::ValueType EVT = MVT::getVectorElementType(VT);
- MVT::ValueType LVT = EVT;
- unsigned NumElts = MVT::getVectorNumElements(VT);
- if (InVec.getOpcode() == ISD::BIT_CONVERT) {
- MVT::ValueType BCVT = InVec.getOperand(0).getValueType();
- if (!MVT::isVector(BCVT) ||
- NumElts != MVT::getVectorNumElements(BCVT))
- return SDOperand();
- InVec = InVec.getOperand(0);
- EVT = MVT::getVectorElementType(BCVT);
- NewLoad = true;
- }
- if (InVec.getOpcode() == ISD::SCALAR_TO_VECTOR &&
- InVec.getOperand(0).getValueType() == EVT &&
- ISD::isNormalLoad(InVec.getOperand(0).Val) &&
- InVec.getOperand(0).hasOneUse()) {
- LoadSDNode *LN0 = cast<LoadSDNode>(InVec.getOperand(0));
- unsigned Align = LN0->getAlignment();
- if (NewLoad) {
- // Check the resultant load doesn't need a higher alignment than the
- // original load.
- unsigned NewAlign = TLI.getTargetMachine().getTargetData()->
- getABITypeAlignment(MVT::getTypeForValueType(LVT));
- if (!TLI.isOperationLegal(ISD::LOAD, LVT) || NewAlign > Align)
- return SDOperand();
- Align = NewAlign;
- }
-
- return DAG.getLoad(LVT, LN0->getChain(), LN0->getBasePtr(),
- LN0->getSrcValue(), LN0->getSrcValueOffset(),
- LN0->isVolatile(), Align);
- }
- }
- }
- return SDOperand();
-}
-
-
-SDOperand DAGCombiner::visitBUILD_VECTOR(SDNode *N) {
- unsigned NumInScalars = N->getNumOperands();
- MVT::ValueType VT = N->getValueType(0);
- unsigned NumElts = MVT::getVectorNumElements(VT);
- MVT::ValueType EltType = MVT::getVectorElementType(VT);
-
- // Check to see if this is a BUILD_VECTOR of a bunch of EXTRACT_VECTOR_ELT
- // operations. If so, and if the EXTRACT_VECTOR_ELT vector inputs come from
- // at most two distinct vectors, turn this into a shuffle node.
- SDOperand VecIn1, VecIn2;
- for (unsigned i = 0; i != NumInScalars; ++i) {
- // Ignore undef inputs.
- if (N->getOperand(i).getOpcode() == ISD::UNDEF) continue;
-
- // If this input is something other than a EXTRACT_VECTOR_ELT with a
- // constant index, bail out.
- if (N->getOperand(i).getOpcode() != ISD::EXTRACT_VECTOR_ELT ||
- !isa<ConstantSDNode>(N->getOperand(i).getOperand(1))) {
- VecIn1 = VecIn2 = SDOperand(0, 0);
- break;
- }
-
- // If the input vector type disagrees with the result of the build_vector,
- // we can't make a shuffle.
- SDOperand ExtractedFromVec = N->getOperand(i).getOperand(0);
- if (ExtractedFromVec.getValueType() != VT) {
- VecIn1 = VecIn2 = SDOperand(0, 0);
- break;
- }
-
- // Otherwise, remember this. We allow up to two distinct input vectors.
- if (ExtractedFromVec == VecIn1 || ExtractedFromVec == VecIn2)
- continue;
-
- if (VecIn1.Val == 0) {
- VecIn1 = ExtractedFromVec;
- } else if (VecIn2.Val == 0) {
- VecIn2 = ExtractedFromVec;
- } else {
- // Too many inputs.
- VecIn1 = VecIn2 = SDOperand(0, 0);
- break;
- }
- }
-
- // If everything is good, we can make a shuffle operation.
- if (VecIn1.Val) {
- SmallVector<SDOperand, 8> BuildVecIndices;
- for (unsigned i = 0; i != NumInScalars; ++i) {
- if (N->getOperand(i).getOpcode() == ISD::UNDEF) {
- BuildVecIndices.push_back(DAG.getNode(ISD::UNDEF, TLI.getPointerTy()));
- continue;
- }
-
- SDOperand Extract = N->getOperand(i);
-
- // If extracting from the first vector, just use the index directly.
- if (Extract.getOperand(0) == VecIn1) {
- BuildVecIndices.push_back(Extract.getOperand(1));
- continue;
- }
-
- // Otherwise, use InIdx + VecSize
- unsigned Idx = cast<ConstantSDNode>(Extract.getOperand(1))->getValue();
- BuildVecIndices.push_back(DAG.getIntPtrConstant(Idx+NumInScalars));
- }
-
- // Add count and size info.
- MVT::ValueType BuildVecVT = MVT::getVectorType(TLI.getPointerTy(), NumElts);
-
- // Return the new VECTOR_SHUFFLE node.
- SDOperand Ops[5];
- Ops[0] = VecIn1;
- if (VecIn2.Val) {
- Ops[1] = VecIn2;
- } else {
- // Use an undef build_vector as input for the second operand.
- std::vector<SDOperand> UnOps(NumInScalars,
- DAG.getNode(ISD::UNDEF,
- EltType));
- Ops[1] = DAG.getNode(ISD::BUILD_VECTOR, VT,
- &UnOps[0], UnOps.size());
- AddToWorkList(Ops[1].Val);
- }
- Ops[2] = DAG.getNode(ISD::BUILD_VECTOR, BuildVecVT,
- &BuildVecIndices[0], BuildVecIndices.size());
- return DAG.getNode(ISD::VECTOR_SHUFFLE, VT, Ops, 3);
- }
-
- return SDOperand();
-}
-
-SDOperand DAGCombiner::visitCONCAT_VECTORS(SDNode *N) {
- // TODO: Check to see if this is a CONCAT_VECTORS of a bunch of
- // EXTRACT_SUBVECTOR operations. If so, and if the EXTRACT_SUBVECTOR vector
- // inputs come from at most two distinct vectors, turn this into a shuffle
- // node.
-
- // If we only have one input vector, we don't need to do any concatenation.
- if (N->getNumOperands() == 1) {
- return N->getOperand(0);
- }
-
- return SDOperand();
-}
-
-SDOperand DAGCombiner::visitVECTOR_SHUFFLE(SDNode *N) {
- SDOperand ShufMask = N->getOperand(2);
- unsigned NumElts = ShufMask.getNumOperands();
-
- // If the shuffle mask is an identity operation on the LHS, return the LHS.
- bool isIdentity = true;
- for (unsigned i = 0; i != NumElts; ++i) {
- if (ShufMask.getOperand(i).getOpcode() != ISD::UNDEF &&
- cast<ConstantSDNode>(ShufMask.getOperand(i))->getValue() != i) {
- isIdentity = false;
- break;
- }
- }
- if (isIdentity) return N->getOperand(0);
-
- // If the shuffle mask is an identity operation on the RHS, return the RHS.
- isIdentity = true;
- for (unsigned i = 0; i != NumElts; ++i) {
- if (ShufMask.getOperand(i).getOpcode() != ISD::UNDEF &&
- cast<ConstantSDNode>(ShufMask.getOperand(i))->getValue() != i+NumElts) {
- isIdentity = false;
- break;
- }
- }
- if (isIdentity) return N->getOperand(1);
-
- // Check if the shuffle is a unary shuffle, i.e. one of the vectors is not
- // needed at all.
- bool isUnary = true;
- bool isSplat = true;
- int VecNum = -1;
- unsigned BaseIdx = 0;
- for (unsigned i = 0; i != NumElts; ++i)
- if (ShufMask.getOperand(i).getOpcode() != ISD::UNDEF) {
- unsigned Idx = cast<ConstantSDNode>(ShufMask.getOperand(i))->getValue();
- int V = (Idx < NumElts) ? 0 : 1;
- if (VecNum == -1) {
- VecNum = V;
- BaseIdx = Idx;
- } else {
- if (BaseIdx != Idx)
- isSplat = false;
- if (VecNum != V) {
- isUnary = false;
- break;
- }
- }
- }
-
- SDOperand N0 = N->getOperand(0);
- SDOperand N1 = N->getOperand(1);
- // Normalize unary shuffle so the RHS is undef.
- if (isUnary && VecNum == 1)
- std::swap(N0, N1);
-
- // If it is a splat, check if the argument vector is a build_vector with
- // all scalar elements the same.
- if (isSplat) {
- SDNode *V = N0.Val;
-
- // If this is a bit convert that changes the element type of the vector but
- // not the number of vector elements, look through it. Be careful not to
- // look though conversions that change things like v4f32 to v2f64.
- if (V->getOpcode() == ISD::BIT_CONVERT) {
- SDOperand ConvInput = V->getOperand(0);
- if (MVT::getVectorNumElements(ConvInput.getValueType()) == NumElts)
- V = ConvInput.Val;
- }
-
- if (V->getOpcode() == ISD::BUILD_VECTOR) {
- unsigned NumElems = V->getNumOperands();
- if (NumElems > BaseIdx) {
- SDOperand Base;
- bool AllSame = true;
- for (unsigned i = 0; i != NumElems; ++i) {
- if (V->getOperand(i).getOpcode() != ISD::UNDEF) {
- Base = V->getOperand(i);
- break;
- }
- }
- // Splat of <u, u, u, u>, return <u, u, u, u>
- if (!Base.Val)
- return N0;
- for (unsigned i = 0; i != NumElems; ++i) {
- if (V->getOperand(i) != Base) {
- AllSame = false;
- break;
- }
- }
- // Splat of <x, x, x, x>, return <x, x, x, x>
- if (AllSame)
- return N0;
- }
- }
- }
-
- // If it is a unary or the LHS and the RHS are the same node, turn the RHS
- // into an undef.
- if (isUnary || N0 == N1) {
- // Check the SHUFFLE mask, mapping any inputs from the 2nd operand into the
- // first operand.
- SmallVector<SDOperand, 8> MappedOps;
- for (unsigned i = 0; i != NumElts; ++i) {
- if (ShufMask.getOperand(i).getOpcode() == ISD::UNDEF ||
- cast<ConstantSDNode>(ShufMask.getOperand(i))->getValue() < NumElts) {
- MappedOps.push_back(ShufMask.getOperand(i));
- } else {
- unsigned NewIdx =
- cast<ConstantSDNode>(ShufMask.getOperand(i))->getValue() - NumElts;
- MappedOps.push_back(DAG.getConstant(NewIdx, MVT::i32));
- }
- }
- ShufMask = DAG.getNode(ISD::BUILD_VECTOR, ShufMask.getValueType(),
- &MappedOps[0], MappedOps.size());
- AddToWorkList(ShufMask.Val);
- return DAG.getNode(ISD::VECTOR_SHUFFLE, N->getValueType(0),
- N0,
- DAG.getNode(ISD::UNDEF, N->getValueType(0)),
- ShufMask);
- }
-
- return SDOperand();
-}
-
-/// XformToShuffleWithZero - Returns a vector_shuffle if it able to transform
-/// an AND to a vector_shuffle with the destination vector and a zero vector.
-/// e.g. AND V, <0xffffffff, 0, 0xffffffff, 0>. ==>
-/// vector_shuffle V, Zero, <0, 4, 2, 4>
-SDOperand DAGCombiner::XformToShuffleWithZero(SDNode *N) {
- SDOperand LHS = N->getOperand(0);
- SDOperand RHS = N->getOperand(1);
- if (N->getOpcode() == ISD::AND) {
- if (RHS.getOpcode() == ISD::BIT_CONVERT)
- RHS = RHS.getOperand(0);
- if (RHS.getOpcode() == ISD::BUILD_VECTOR) {
- std::vector<SDOperand> IdxOps;
- unsigned NumOps = RHS.getNumOperands();
- unsigned NumElts = NumOps;
- MVT::ValueType EVT = MVT::getVectorElementType(RHS.getValueType());
- for (unsigned i = 0; i != NumElts; ++i) {
- SDOperand Elt = RHS.getOperand(i);
- if (!isa<ConstantSDNode>(Elt))
- return SDOperand();
- else if (cast<ConstantSDNode>(Elt)->isAllOnesValue())
- IdxOps.push_back(DAG.getConstant(i, EVT));
- else if (cast<ConstantSDNode>(Elt)->isNullValue())
- IdxOps.push_back(DAG.getConstant(NumElts, EVT));
- else
- return SDOperand();
- }
-
- // Let's see if the target supports this vector_shuffle.
- if (!TLI.isVectorClearMaskLegal(IdxOps, EVT, DAG))
- return SDOperand();
-
- // Return the new VECTOR_SHUFFLE node.
- MVT::ValueType VT = MVT::getVectorType(EVT, NumElts);
- std::vector<SDOperand> Ops;
- LHS = DAG.getNode(ISD::BIT_CONVERT, VT, LHS);
- Ops.push_back(LHS);
- AddToWorkList(LHS.Val);
- std::vector<SDOperand> ZeroOps(NumElts, DAG.getConstant(0, EVT));
- Ops.push_back(DAG.getNode(ISD::BUILD_VECTOR, VT,
- &ZeroOps[0], ZeroOps.size()));
- Ops.push_back(DAG.getNode(ISD::BUILD_VECTOR, VT,
- &IdxOps[0], IdxOps.size()));
- SDOperand Result = DAG.getNode(ISD::VECTOR_SHUFFLE, VT,
- &Ops[0], Ops.size());
- if (VT != LHS.getValueType()) {
- Result = DAG.getNode(ISD::BIT_CONVERT, LHS.getValueType(), Result);
- }
- return Result;
- }
- }
- return SDOperand();
-}
-
-/// SimplifyVBinOp - Visit a binary vector operation, like ADD.
-SDOperand DAGCombiner::SimplifyVBinOp(SDNode *N) {
- // After legalize, the target may be depending on adds and other
- // binary ops to provide legal ways to construct constants or other
- // things. Simplifying them may result in a loss of legality.
- if (AfterLegalize) return SDOperand();
-
- MVT::ValueType VT = N->getValueType(0);
- assert(MVT::isVector(VT) && "SimplifyVBinOp only works on vectors!");
-
- MVT::ValueType EltType = MVT::getVectorElementType(VT);
- SDOperand LHS = N->getOperand(0);
- SDOperand RHS = N->getOperand(1);
- SDOperand Shuffle = XformToShuffleWithZero(N);
- if (Shuffle.Val) return Shuffle;
-
- // If the LHS and RHS are BUILD_VECTOR nodes, see if we can constant fold
- // this operation.
- if (LHS.getOpcode() == ISD::BUILD_VECTOR &&
- RHS.getOpcode() == ISD::BUILD_VECTOR) {
- SmallVector<SDOperand, 8> Ops;
- for (unsigned i = 0, e = LHS.getNumOperands(); i != e; ++i) {
- SDOperand LHSOp = LHS.getOperand(i);
- SDOperand RHSOp = RHS.getOperand(i);
- // If these two elements can't be folded, bail out.
- if ((LHSOp.getOpcode() != ISD::UNDEF &&
- LHSOp.getOpcode() != ISD::Constant &&
- LHSOp.getOpcode() != ISD::ConstantFP) ||
- (RHSOp.getOpcode() != ISD::UNDEF &&
- RHSOp.getOpcode() != ISD::Constant &&
- RHSOp.getOpcode() != ISD::ConstantFP))
- break;
- // Can't fold divide by zero.
- if (N->getOpcode() == ISD::SDIV || N->getOpcode() == ISD::UDIV ||
- N->getOpcode() == ISD::FDIV) {
- if ((RHSOp.getOpcode() == ISD::Constant &&
- cast<ConstantSDNode>(RHSOp.Val)->isNullValue()) ||
- (RHSOp.getOpcode() == ISD::ConstantFP &&
- cast<ConstantFPSDNode>(RHSOp.Val)->getValueAPF().isZero()))
- break;
- }
- Ops.push_back(DAG.getNode(N->getOpcode(), EltType, LHSOp, RHSOp));
- AddToWorkList(Ops.back().Val);
- assert((Ops.back().getOpcode() == ISD::UNDEF ||
- Ops.back().getOpcode() == ISD::Constant ||
- Ops.back().getOpcode() == ISD::ConstantFP) &&
- "Scalar binop didn't fold!");
- }
-
- if (Ops.size() == LHS.getNumOperands()) {
- MVT::ValueType VT = LHS.getValueType();
- return DAG.getNode(ISD::BUILD_VECTOR, VT, &Ops[0], Ops.size());
- }
- }
-
- return SDOperand();
-}
-
-SDOperand DAGCombiner::SimplifySelect(SDOperand N0, SDOperand N1, SDOperand N2){
- assert(N0.getOpcode() ==ISD::SETCC && "First argument must be a SetCC node!");
-
- SDOperand SCC = SimplifySelectCC(N0.getOperand(0), N0.getOperand(1), N1, N2,
- cast<CondCodeSDNode>(N0.getOperand(2))->get());
- // If we got a simplified select_cc node back from SimplifySelectCC, then
- // break it down into a new SETCC node, and a new SELECT node, and then return
- // the SELECT node, since we were called with a SELECT node.
- if (SCC.Val) {
- // Check to see if we got a select_cc back (to turn into setcc/select).
- // Otherwise, just return whatever node we got back, like fabs.
- if (SCC.getOpcode() == ISD::SELECT_CC) {
- SDOperand SETCC = DAG.getNode(ISD::SETCC, N0.getValueType(),
- SCC.getOperand(0), SCC.getOperand(1),
- SCC.getOperand(4));
- AddToWorkList(SETCC.Val);
- return DAG.getNode(ISD::SELECT, SCC.getValueType(), SCC.getOperand(2),
- SCC.getOperand(3), SETCC);
- }
- return SCC;
- }
- return SDOperand();
-}
-
-/// SimplifySelectOps - Given a SELECT or a SELECT_CC node, where LHS and RHS
-/// are the two values being selected between, see if we can simplify the
-/// select. Callers of this should assume that TheSelect is deleted if this
-/// returns true. As such, they should return the appropriate thing (e.g. the
-/// node) back to the top-level of the DAG combiner loop to avoid it being
-/// looked at.
-///
-bool DAGCombiner::SimplifySelectOps(SDNode *TheSelect, SDOperand LHS,
- SDOperand RHS) {
-
- // If this is a select from two identical things, try to pull the operation
- // through the select.
- if (LHS.getOpcode() == RHS.getOpcode() && LHS.hasOneUse() && RHS.hasOneUse()){
- // If this is a load and the token chain is identical, replace the select
- // of two loads with a load through a select of the address to load from.
- // This triggers in things like "select bool X, 10.0, 123.0" after the FP
- // constants have been dropped into the constant pool.
- if (LHS.getOpcode() == ISD::LOAD &&
- // Token chains must be identical.
- LHS.getOperand(0) == RHS.getOperand(0)) {
- LoadSDNode *LLD = cast<LoadSDNode>(LHS);
- LoadSDNode *RLD = cast<LoadSDNode>(RHS);
-
- // If this is an EXTLOAD, the VT's must match.
- if (LLD->getMemoryVT() == RLD->getMemoryVT()) {
- // FIXME: this conflates two src values, discarding one. This is not
- // the right thing to do, but nothing uses srcvalues now. When they do,
- // turn SrcValue into a list of locations.
- SDOperand Addr;
- if (TheSelect->getOpcode() == ISD::SELECT) {
- // Check that the condition doesn't reach either load. If so, folding
- // this will induce a cycle into the DAG.
- if (!LLD->isPredecessorOf(TheSelect->getOperand(0).Val) &&
- !RLD->isPredecessorOf(TheSelect->getOperand(0).Val)) {
- Addr = DAG.getNode(ISD::SELECT, LLD->getBasePtr().getValueType(),
- TheSelect->getOperand(0), LLD->getBasePtr(),
- RLD->getBasePtr());
- }
- } else {
- // Check that the condition doesn't reach either load. If so, folding
- // this will induce a cycle into the DAG.
- if (!LLD->isPredecessorOf(TheSelect->getOperand(0).Val) &&
- !RLD->isPredecessorOf(TheSelect->getOperand(0).Val) &&
- !LLD->isPredecessorOf(TheSelect->getOperand(1).Val) &&
- !RLD->isPredecessorOf(TheSelect->getOperand(1).Val)) {
- Addr = DAG.getNode(ISD::SELECT_CC, LLD->getBasePtr().getValueType(),
- TheSelect->getOperand(0),
- TheSelect->getOperand(1),
- LLD->getBasePtr(), RLD->getBasePtr(),
- TheSelect->getOperand(4));
- }
- }
-
- if (Addr.Val) {
- SDOperand Load;
- if (LLD->getExtensionType() == ISD::NON_EXTLOAD)
- Load = DAG.getLoad(TheSelect->getValueType(0), LLD->getChain(),
- Addr,LLD->getSrcValue(),
- LLD->getSrcValueOffset(),
- LLD->isVolatile(),
- LLD->getAlignment());
- else {
- Load = DAG.getExtLoad(LLD->getExtensionType(),
- TheSelect->getValueType(0),
- LLD->getChain(), Addr, LLD->getSrcValue(),
- LLD->getSrcValueOffset(),
- LLD->getMemoryVT(),
- LLD->isVolatile(),
- LLD->getAlignment());
- }
- // Users of the select now use the result of the load.
- CombineTo(TheSelect, Load);
-
- // Users of the old loads now use the new load's chain. We know the
- // old-load value is dead now.
- CombineTo(LHS.Val, Load.getValue(0), Load.getValue(1));
- CombineTo(RHS.Val, Load.getValue(0), Load.getValue(1));
- return true;
- }
- }
- }
- }
-
- return false;
-}
-
-SDOperand DAGCombiner::SimplifySelectCC(SDOperand N0, SDOperand N1,
- SDOperand N2, SDOperand N3,
- ISD::CondCode CC, bool NotExtCompare) {
-
- MVT::ValueType VT = N2.getValueType();
- ConstantSDNode *N1C = dyn_cast<ConstantSDNode>(N1.Val);
- ConstantSDNode *N2C = dyn_cast<ConstantSDNode>(N2.Val);
- ConstantSDNode *N3C = dyn_cast<ConstantSDNode>(N3.Val);
-
- // Determine if the condition we're dealing with is constant
- SDOperand SCC = SimplifySetCC(TLI.getSetCCResultType(N0), N0, N1, CC, false);
- if (SCC.Val) AddToWorkList(SCC.Val);
- ConstantSDNode *SCCC = dyn_cast_or_null<ConstantSDNode>(SCC.Val);
-
- // fold select_cc true, x, y -> x
- if (SCCC && !SCCC->isNullValue())
- return N2;
- // fold select_cc false, x, y -> y
- if (SCCC && SCCC->isNullValue())
- return N3;
-
- // Check to see if we can simplify the select into an fabs node
- if (ConstantFPSDNode *CFP = dyn_cast<ConstantFPSDNode>(N1)) {
- // Allow either -0.0 or 0.0
- if (CFP->getValueAPF().isZero()) {
- // select (setg[te] X, +/-0.0), X, fneg(X) -> fabs
- if ((CC == ISD::SETGE || CC == ISD::SETGT) &&
- N0 == N2 && N3.getOpcode() == ISD::FNEG &&
- N2 == N3.getOperand(0))
- return DAG.getNode(ISD::FABS, VT, N0);
-
- // select (setl[te] X, +/-0.0), fneg(X), X -> fabs
- if ((CC == ISD::SETLT || CC == ISD::SETLE) &&
- N0 == N3 && N2.getOpcode() == ISD::FNEG &&
- N2.getOperand(0) == N3)
- return DAG.getNode(ISD::FABS, VT, N3);
- }
- }
-
- // Check to see if we can perform the "gzip trick", transforming
- // select_cc setlt X, 0, A, 0 -> and (sra X, size(X)-1), A
- if (N1C && N3C && N3C->isNullValue() && CC == ISD::SETLT &&
- MVT::isInteger(N0.getValueType()) &&
- MVT::isInteger(N2.getValueType()) &&
- (N1C->isNullValue() || // (a < 0) ? b : 0
- (N1C->getAPIntValue() == 1 && N0 == N2))) { // (a < 1) ? a : 0
- MVT::ValueType XType = N0.getValueType();
- MVT::ValueType AType = N2.getValueType();
- if (XType >= AType) {
- // and (sra X, size(X)-1, A) -> "and (srl X, C2), A" iff A is a
- // single-bit constant.
- if (N2C && ((N2C->getAPIntValue() & (N2C->getAPIntValue()-1)) == 0)) {
- unsigned ShCtV = N2C->getAPIntValue().logBase2();
- ShCtV = MVT::getSizeInBits(XType)-ShCtV-1;
- SDOperand ShCt = DAG.getConstant(ShCtV, TLI.getShiftAmountTy());
- SDOperand Shift = DAG.getNode(ISD::SRL, XType, N0, ShCt);
- AddToWorkList(Shift.Val);
- if (XType > AType) {
- Shift = DAG.getNode(ISD::TRUNCATE, AType, Shift);
- AddToWorkList(Shift.Val);
- }
- return DAG.getNode(ISD::AND, AType, Shift, N2);
- }
- SDOperand Shift = DAG.getNode(ISD::SRA, XType, N0,
- DAG.getConstant(MVT::getSizeInBits(XType)-1,
- TLI.getShiftAmountTy()));
- AddToWorkList(Shift.Val);
- if (XType > AType) {
- Shift = DAG.getNode(ISD::TRUNCATE, AType, Shift);
- AddToWorkList(Shift.Val);
- }
- return DAG.getNode(ISD::AND, AType, Shift, N2);
- }
- }
-
- // fold select C, 16, 0 -> shl C, 4
- if (N2C && N3C && N3C->isNullValue() && N2C->getAPIntValue().isPowerOf2() &&
- TLI.getSetCCResultContents() == TargetLowering::ZeroOrOneSetCCResult) {
-
- // If the caller doesn't want us to simplify this into a zext of a compare,
- // don't do it.
- if (NotExtCompare && N2C->getAPIntValue() == 1)
- return SDOperand();
-
- // Get a SetCC of the condition
- // FIXME: Should probably make sure that setcc is legal if we ever have a
- // target where it isn't.
- SDOperand Temp, SCC;
- // cast from setcc result type to select result type
- if (AfterLegalize) {
- SCC = DAG.getSetCC(TLI.getSetCCResultType(N0), N0, N1, CC);
- if (N2.getValueType() < SCC.getValueType())
- Temp = DAG.getZeroExtendInReg(SCC, N2.getValueType());
- else
- Temp = DAG.getNode(ISD::ZERO_EXTEND, N2.getValueType(), SCC);
- } else {
- SCC = DAG.getSetCC(MVT::i1, N0, N1, CC);
- Temp = DAG.getNode(ISD::ZERO_EXTEND, N2.getValueType(), SCC);
- }
- AddToWorkList(SCC.Val);
- AddToWorkList(Temp.Val);
-
- if (N2C->getAPIntValue() == 1)
- return Temp;
- // shl setcc result by log2 n2c
- return DAG.getNode(ISD::SHL, N2.getValueType(), Temp,
- DAG.getConstant(N2C->getAPIntValue().logBase2(),
- TLI.getShiftAmountTy()));
- }
-
- // Check to see if this is the equivalent of setcc
- // FIXME: Turn all of these into setcc if setcc if setcc is legal
- // otherwise, go ahead with the folds.
- if (0 && N3C && N3C->isNullValue() && N2C && (N2C->getAPIntValue() == 1ULL)) {
- MVT::ValueType XType = N0.getValueType();
- if (TLI.isOperationLegal(ISD::SETCC, TLI.getSetCCResultType(N0))) {
- SDOperand Res = DAG.getSetCC(TLI.getSetCCResultType(N0), N0, N1, CC);
- if (Res.getValueType() != VT)
- Res = DAG.getNode(ISD::ZERO_EXTEND, VT, Res);
- return Res;
- }
-
- // seteq X, 0 -> srl (ctlz X, log2(size(X)))
- if (N1C && N1C->isNullValue() && CC == ISD::SETEQ &&
- TLI.isOperationLegal(ISD::CTLZ, XType)) {
- SDOperand Ctlz = DAG.getNode(ISD::CTLZ, XType, N0);
- return DAG.getNode(ISD::SRL, XType, Ctlz,
- DAG.getConstant(Log2_32(MVT::getSizeInBits(XType)),
- TLI.getShiftAmountTy()));
- }
- // setgt X, 0 -> srl (and (-X, ~X), size(X)-1)
- if (N1C && N1C->isNullValue() && CC == ISD::SETGT) {
- SDOperand NegN0 = DAG.getNode(ISD::SUB, XType, DAG.getConstant(0, XType),
- N0);
- SDOperand NotN0 = DAG.getNode(ISD::XOR, XType, N0,
- DAG.getConstant(~0ULL, XType));
- return DAG.getNode(ISD::SRL, XType,
- DAG.getNode(ISD::AND, XType, NegN0, NotN0),
- DAG.getConstant(MVT::getSizeInBits(XType)-1,
- TLI.getShiftAmountTy()));
- }
- // setgt X, -1 -> xor (srl (X, size(X)-1), 1)
- if (N1C && N1C->isAllOnesValue() && CC == ISD::SETGT) {
- SDOperand Sign = DAG.getNode(ISD::SRL, XType, N0,
- DAG.getConstant(MVT::getSizeInBits(XType)-1,
- TLI.getShiftAmountTy()));
- return DAG.getNode(ISD::XOR, XType, Sign, DAG.getConstant(1, XType));
- }
- }
-
- // Check to see if this is an integer abs. select_cc setl[te] X, 0, -X, X ->
- // Y = sra (X, size(X)-1); xor (add (X, Y), Y)
- if (N1C && N1C->isNullValue() && (CC == ISD::SETLT || CC == ISD::SETLE) &&
- N0 == N3 && N2.getOpcode() == ISD::SUB && N0 == N2.getOperand(1) &&
- N2.getOperand(0) == N1 && MVT::isInteger(N0.getValueType())) {
- MVT::ValueType XType = N0.getValueType();
- SDOperand Shift = DAG.getNode(ISD::SRA, XType, N0,
- DAG.getConstant(MVT::getSizeInBits(XType)-1,
- TLI.getShiftAmountTy()));
- SDOperand Add = DAG.getNode(ISD::ADD, XType, N0, Shift);
- AddToWorkList(Shift.Val);
- AddToWorkList(Add.Val);
- return DAG.getNode(ISD::XOR, XType, Add, Shift);
- }
- // Check to see if this is an integer abs. select_cc setgt X, -1, X, -X ->
- // Y = sra (X, size(X)-1); xor (add (X, Y), Y)
- if (N1C && N1C->isAllOnesValue() && CC == ISD::SETGT &&
- N0 == N2 && N3.getOpcode() == ISD::SUB && N0 == N3.getOperand(1)) {
- if (ConstantSDNode *SubC = dyn_cast<ConstantSDNode>(N3.getOperand(0))) {
- MVT::ValueType XType = N0.getValueType();
- if (SubC->isNullValue() && MVT::isInteger(XType)) {
- SDOperand Shift = DAG.getNode(ISD::SRA, XType, N0,
- DAG.getConstant(MVT::getSizeInBits(XType)-1,
- TLI.getShiftAmountTy()));
- SDOperand Add = DAG.getNode(ISD::ADD, XType, N0, Shift);
- AddToWorkList(Shift.Val);
- AddToWorkList(Add.Val);
- return DAG.getNode(ISD::XOR, XType, Add, Shift);
- }
- }
- }
-
- return SDOperand();
-}
-
-/// SimplifySetCC - This is a stub for TargetLowering::SimplifySetCC.
-SDOperand DAGCombiner::SimplifySetCC(MVT::ValueType VT, SDOperand N0,
- SDOperand N1, ISD::CondCode Cond,
- bool foldBooleans) {
- TargetLowering::DAGCombinerInfo
- DagCombineInfo(DAG, !AfterLegalize, false, this);
- return TLI.SimplifySetCC(VT, N0, N1, Cond, foldBooleans, DagCombineInfo);
-}
-
-/// BuildSDIVSequence - Given an ISD::SDIV node expressing a divide by constant,
-/// return a DAG expression to select that will generate the same value by
-/// multiplying by a magic number. See:
-/// <http://the.wall.riscom.net/books/proc/ppc/cwg/code2.html>
-SDOperand DAGCombiner::BuildSDIV(SDNode *N) {
- std::vector<SDNode*> Built;
- SDOperand S = TLI.BuildSDIV(N, DAG, &Built);
-
- for (std::vector<SDNode*>::iterator ii = Built.begin(), ee = Built.end();
- ii != ee; ++ii)
- AddToWorkList(*ii);
- return S;
-}
-
-/// BuildUDIVSequence - Given an ISD::UDIV node expressing a divide by constant,
-/// return a DAG expression to select that will generate the same value by
-/// multiplying by a magic number. See:
-/// <http://the.wall.riscom.net/books/proc/ppc/cwg/code2.html>
-SDOperand DAGCombiner::BuildUDIV(SDNode *N) {
- std::vector<SDNode*> Built;
- SDOperand S = TLI.BuildUDIV(N, DAG, &Built);
-
- for (std::vector<SDNode*>::iterator ii = Built.begin(), ee = Built.end();
- ii != ee; ++ii)
- AddToWorkList(*ii);
- return S;
-}
-
-/// FindBaseOffset - Return true if base is known not to alias with anything
-/// but itself. Provides base object and offset as results.
-static bool FindBaseOffset(SDOperand Ptr, SDOperand &Base, int64_t &Offset) {
- // Assume it is a primitive operation.
- Base = Ptr; Offset = 0;
-
- // If it's an adding a simple constant then integrate the offset.
- if (Base.getOpcode() == ISD::ADD) {
- if (ConstantSDNode *C = dyn_cast<ConstantSDNode>(Base.getOperand(1))) {
- Base = Base.getOperand(0);
- Offset += C->getValue();
- }
- }
-
- // If it's any of the following then it can't alias with anything but itself.
- return isa<FrameIndexSDNode>(Base) ||
- isa<ConstantPoolSDNode>(Base) ||
- isa<GlobalAddressSDNode>(Base);
-}
-
-/// isAlias - Return true if there is any possibility that the two addresses
-/// overlap.
-bool DAGCombiner::isAlias(SDOperand Ptr1, int64_t Size1,
- const Value *SrcValue1, int SrcValueOffset1,
- SDOperand Ptr2, int64_t Size2,
- const Value *SrcValue2, int SrcValueOffset2)
-{
- // If they are the same then they must be aliases.
- if (Ptr1 == Ptr2) return true;
-
- // Gather base node and offset information.
- SDOperand Base1, Base2;
- int64_t Offset1, Offset2;
- bool KnownBase1 = FindBaseOffset(Ptr1, Base1, Offset1);
- bool KnownBase2 = FindBaseOffset(Ptr2, Base2, Offset2);
-
- // If they have a same base address then...
- if (Base1 == Base2) {
- // Check to see if the addresses overlap.
- return!((Offset1 + Size1) <= Offset2 || (Offset2 + Size2) <= Offset1);
- }
-
- // If we know both bases then they can't alias.
- if (KnownBase1 && KnownBase2) return false;
-
- if (CombinerGlobalAA) {
- // Use alias analysis information.
- int64_t MinOffset = std::min(SrcValueOffset1, SrcValueOffset2);
- int64_t Overlap1 = Size1 + SrcValueOffset1 - MinOffset;
- int64_t Overlap2 = Size2 + SrcValueOffset2 - MinOffset;
- AliasAnalysis::AliasResult AAResult =
- AA.alias(SrcValue1, Overlap1, SrcValue2, Overlap2);
- if (AAResult == AliasAnalysis::NoAlias)
- return false;
- }
-
- // Otherwise we have to assume they alias.
- return true;
-}
-
-/// FindAliasInfo - Extracts the relevant alias information from the memory
-/// node. Returns true if the operand was a load.
-bool DAGCombiner::FindAliasInfo(SDNode *N,
- SDOperand &Ptr, int64_t &Size,
- const Value *&SrcValue, int &SrcValueOffset) {
- if (LoadSDNode *LD = dyn_cast<LoadSDNode>(N)) {
- Ptr = LD->getBasePtr();
- Size = MVT::getSizeInBits(LD->getMemoryVT()) >> 3;
- SrcValue = LD->getSrcValue();
- SrcValueOffset = LD->getSrcValueOffset();
- return true;
- } else if (StoreSDNode *ST = dyn_cast<StoreSDNode>(N)) {
- Ptr = ST->getBasePtr();
- Size = MVT::getSizeInBits(ST->getMemoryVT()) >> 3;
- SrcValue = ST->getSrcValue();
- SrcValueOffset = ST->getSrcValueOffset();
- } else {
- assert(0 && "FindAliasInfo expected a memory operand");
- }
-
- return false;
-}
-
-/// GatherAllAliases - Walk up chain skipping non-aliasing memory nodes,
-/// looking for aliasing nodes and adding them to the Aliases vector.
-void DAGCombiner::GatherAllAliases(SDNode *N, SDOperand OriginalChain,
- SmallVector<SDOperand, 8> &Aliases) {
- SmallVector<SDOperand, 8> Chains; // List of chains to visit.
- std::set<SDNode *> Visited; // Visited node set.
-
- // Get alias information for node.
- SDOperand Ptr;
- int64_t Size;
- const Value *SrcValue;
- int SrcValueOffset;
- bool IsLoad = FindAliasInfo(N, Ptr, Size, SrcValue, SrcValueOffset);
-
- // Starting off.
- Chains.push_back(OriginalChain);
-
- // Look at each chain and determine if it is an alias. If so, add it to the
- // aliases list. If not, then continue up the chain looking for the next
- // candidate.
- while (!Chains.empty()) {
- SDOperand Chain = Chains.back();
- Chains.pop_back();
-
- // Don't bother if we've been before.
- if (Visited.find(Chain.Val) != Visited.end()) continue;
- Visited.insert(Chain.Val);
-
- switch (Chain.getOpcode()) {
- case ISD::EntryToken:
- // Entry token is ideal chain operand, but handled in FindBetterChain.
- break;
-
- case ISD::LOAD:
- case ISD::STORE: {
- // Get alias information for Chain.
- SDOperand OpPtr;
- int64_t OpSize;
- const Value *OpSrcValue;
- int OpSrcValueOffset;
- bool IsOpLoad = FindAliasInfo(Chain.Val, OpPtr, OpSize,
- OpSrcValue, OpSrcValueOffset);
-
- // If chain is alias then stop here.
- if (!(IsLoad && IsOpLoad) &&
- isAlias(Ptr, Size, SrcValue, SrcValueOffset,
- OpPtr, OpSize, OpSrcValue, OpSrcValueOffset)) {
- Aliases.push_back(Chain);
- } else {
- // Look further up the chain.
- Chains.push_back(Chain.getOperand(0));
- // Clean up old chain.
- AddToWorkList(Chain.Val);
- }
- break;
- }
-
- case ISD::TokenFactor:
- // We have to check each of the operands of the token factor, so we queue
- // then up. Adding the operands to the queue (stack) in reverse order
- // maintains the original order and increases the likelihood that getNode
- // will find a matching token factor (CSE.)
- for (unsigned n = Chain.getNumOperands(); n;)
- Chains.push_back(Chain.getOperand(--n));
- // Eliminate the token factor if we can.
- AddToWorkList(Chain.Val);
- break;
-
- default:
- // For all other instructions we will just have to take what we can get.
- Aliases.push_back(Chain);
- break;
- }
- }
-}
-
-/// FindBetterChain - Walk up chain skipping non-aliasing memory nodes, looking
-/// for a better chain (aliasing node.)
-SDOperand DAGCombiner::FindBetterChain(SDNode *N, SDOperand OldChain) {
- SmallVector<SDOperand, 8> Aliases; // Ops for replacing token factor.
-
- // Accumulate all the aliases to this node.
- GatherAllAliases(N, OldChain, Aliases);
-
- if (Aliases.size() == 0) {
- // If no operands then chain to entry token.
- return DAG.getEntryNode();
- } else if (Aliases.size() == 1) {
- // If a single operand then chain to it. We don't need to revisit it.
- return Aliases[0];
- }
-
- // Construct a custom tailored token factor.
- SDOperand NewChain = DAG.getNode(ISD::TokenFactor, MVT::Other,
- &Aliases[0], Aliases.size());
-
- // Make sure the old chain gets cleaned up.
- if (NewChain != OldChain) AddToWorkList(OldChain.Val);
-
- return NewChain;
-}
-
-// SelectionDAG::Combine - This is the entry point for the file.
-//
-void SelectionDAG::Combine(bool RunningAfterLegalize, AliasAnalysis &AA) {
- if (!RunningAfterLegalize && ViewDAGCombine1)
- viewGraph();
- if (RunningAfterLegalize && ViewDAGCombine2)
- viewGraph();
- /// run - This is the main entry point to this class.
- ///
- DAGCombiner(*this, AA).Run(RunningAfterLegalize);
-}
diff --git a/release_23/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/release_23/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
deleted file mode 100644
index dcdc554b5f2d..000000000000
--- a/release_23/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
+++ /dev/null
@@ -1,7113 +0,0 @@
-//===-- LegalizeDAG.cpp - Implement SelectionDAG::Legalize ----------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the SelectionDAG::Legalize method.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/CodeGen/SelectionDAG.h"
-#include "llvm/CodeGen/MachineFunction.h"
-#include "llvm/CodeGen/MachineFrameInfo.h"
-#include "llvm/CodeGen/MachineJumpTableInfo.h"
-#include "llvm/CodeGen/MachineModuleInfo.h"
-#include "llvm/CodeGen/PseudoSourceValue.h"
-#include "llvm/Target/TargetFrameInfo.h"
-#include "llvm/Target/TargetLowering.h"
-#include "llvm/Target/TargetData.h"
-#include "llvm/Target/TargetMachine.h"
-#include "llvm/Target/TargetOptions.h"
-#include "llvm/Target/TargetSubtarget.h"
-#include "llvm/CallingConv.h"
-#include "llvm/Constants.h"
-#include "llvm/DerivedTypes.h"
-#include "llvm/Support/CommandLine.h"
-#include "llvm/Support/Compiler.h"
-#include "llvm/Support/MathExtras.h"
-#include "llvm/ADT/DenseMap.h"
-#include "llvm/ADT/SmallVector.h"
-#include "llvm/ADT/SmallPtrSet.h"
-#include <map>
-using namespace llvm;
-
-#ifndef NDEBUG
-static cl::opt<bool>
-ViewLegalizeDAGs("view-legalize-dags", cl::Hidden,
- cl::desc("Pop up a window to show dags before legalize"));
-#else
-static const bool ViewLegalizeDAGs = 0;
-#endif
-
-//===----------------------------------------------------------------------===//
-/// SelectionDAGLegalize - This takes an arbitrary SelectionDAG as input and
-/// hacks on it until the target machine can handle it. This involves
-/// eliminating value sizes the machine cannot handle (promoting small sizes to
-/// large sizes or splitting up large values into small values) as well as
-/// eliminating operations the machine cannot handle.
-///
-/// This code also does a small amount of optimization and recognition of idioms
-/// as part of its processing. For example, if a target does not support a
-/// 'setcc' instruction efficiently, but does support 'brcc' instruction, this
-/// will attempt merge setcc and brc instructions into brcc's.
-///
-namespace {
-class VISIBILITY_HIDDEN SelectionDAGLegalize {
- TargetLowering &TLI;
- SelectionDAG &DAG;
-
- // Libcall insertion helpers.
-
- /// LastCALLSEQ_END - This keeps track of the CALLSEQ_END node that has been
- /// legalized. We use this to ensure that calls are properly serialized
- /// against each other, including inserted libcalls.
- SDOperand LastCALLSEQ_END;
-
- /// IsLegalizingCall - This member is used *only* for purposes of providing
- /// helpful assertions that a libcall isn't created while another call is
- /// being legalized (which could lead to non-serialized call sequences).
- bool IsLegalizingCall;
-
- enum LegalizeAction {
- Legal, // The target natively supports this operation.
- Promote, // This operation should be executed in a larger type.
- Expand // Try to expand this to other ops, otherwise use a libcall.
- };
-
- /// ValueTypeActions - This is a bitvector that contains two bits for each
- /// value type, where the two bits correspond to the LegalizeAction enum.
- /// This can be queried with "getTypeAction(VT)".
- TargetLowering::ValueTypeActionImpl ValueTypeActions;
-
- /// LegalizedNodes - For nodes that are of legal width, and that have more
- /// than one use, this map indicates what regularized operand to use. This
- /// allows us to avoid legalizing the same thing more than once.
- DenseMap<SDOperand, SDOperand> LegalizedNodes;
-
- /// PromotedNodes - For nodes that are below legal width, and that have more
- /// than one use, this map indicates what promoted value to use. This allows
- /// us to avoid promoting the same thing more than once.
- DenseMap<SDOperand, SDOperand> PromotedNodes;
-
- /// ExpandedNodes - For nodes that need to be expanded this map indicates
- /// which which operands are the expanded version of the input. This allows
- /// us to avoid expanding the same node more than once.
- DenseMap<SDOperand, std::pair<SDOperand, SDOperand> > ExpandedNodes;
-
- /// SplitNodes - For vector nodes that need to be split, this map indicates
- /// which which operands are the split version of the input. This allows us
- /// to avoid splitting the same node more than once.
- std::map<SDOperand, std::pair<SDOperand, SDOperand> > SplitNodes;
-
- /// ScalarizedNodes - For nodes that need to be converted from vector types to
- /// scalar types, this contains the mapping of ones we have already
- /// processed to the result.
- std::map<SDOperand, SDOperand> ScalarizedNodes;
-
- void AddLegalizedOperand(SDOperand From, SDOperand To) {
- LegalizedNodes.insert(std::make_pair(From, To));
- // If someone requests legalization of the new node, return itself.
- if (From != To)
- LegalizedNodes.insert(std::make_pair(To, To));
- }
- void AddPromotedOperand(SDOperand From, SDOperand To) {
- bool isNew = PromotedNodes.insert(std::make_pair(From, To));
- assert(isNew && "Got into the map somehow?");
- // If someone requests legalization of the new node, return itself.
- LegalizedNodes.insert(std::make_pair(To, To));
- }
-
-public:
-
- SelectionDAGLegalize(SelectionDAG &DAG);
-
- /// getTypeAction - Return how we should legalize values of this type, either
- /// it is already legal or we need to expand it into multiple registers of
- /// smaller integer type, or we need to promote it to a larger type.
- LegalizeAction getTypeAction(MVT::ValueType VT) const {
- return (LegalizeAction)ValueTypeActions.getTypeAction(VT);
- }
-
- /// isTypeLegal - Return true if this type is legal on this target.
- ///
- bool isTypeLegal(MVT::ValueType VT) const {
- return getTypeAction(VT) == Legal;
- }
-
- void LegalizeDAG();
-
-private:
- /// HandleOp - Legalize, Promote, or Expand the specified operand as
- /// appropriate for its type.
- void HandleOp(SDOperand Op);
-
- /// LegalizeOp - We know that the specified value has a legal type.
- /// Recursively ensure that the operands have legal types, then return the
- /// result.
- SDOperand LegalizeOp(SDOperand O);
-
- /// UnrollVectorOp - We know that the given vector has a legal type, however
- /// the operation it performs is not legal and is an operation that we have
- /// no way of lowering. "Unroll" the vector, splitting out the scalars and
- /// operating on each element individually.
- SDOperand UnrollVectorOp(SDOperand O);
-
- /// PerformInsertVectorEltInMemory - Some target cannot handle a variable
- /// insertion index for the INSERT_VECTOR_ELT instruction. In this case, it
- /// is necessary to spill the vector being inserted into to memory, perform
- /// the insert there, and then read the result back.
- SDOperand PerformInsertVectorEltInMemory(SDOperand Vec, SDOperand Val,
- SDOperand Idx);
-
- /// PromoteOp - Given an operation that produces a value in an invalid type,
- /// promote it to compute the value into a larger type. The produced value
- /// will have the correct bits for the low portion of the register, but no
- /// guarantee is made about the top bits: it may be zero, sign-extended, or
- /// garbage.
- SDOperand PromoteOp(SDOperand O);
-
- /// ExpandOp - Expand the specified SDOperand into its two component pieces
- /// Lo&Hi. Note that the Op MUST be an expanded type. As a result of this,
- /// the LegalizeNodes map is filled in for any results that are not expanded,
- /// the ExpandedNodes map is filled in for any results that are expanded, and
- /// the Lo/Hi values are returned. This applies to integer types and Vector
- /// types.
- void ExpandOp(SDOperand O, SDOperand &Lo, SDOperand &Hi);
-
- /// SplitVectorOp - Given an operand of vector type, break it down into
- /// two smaller values.
- void SplitVectorOp(SDOperand O, SDOperand &Lo, SDOperand &Hi);
-
- /// ScalarizeVectorOp - Given an operand of single-element vector type
- /// (e.g. v1f32), convert it into the equivalent operation that returns a
- /// scalar (e.g. f32) value.
- SDOperand ScalarizeVectorOp(SDOperand O);
-
- /// isShuffleLegal - Return true if a vector shuffle is legal with the
- /// specified mask and type. Targets can specify exactly which masks they
- /// support and the code generator is tasked with not creating illegal masks.
- ///
- /// Note that this will also return true for shuffles that are promoted to a
- /// different type.
- ///
- /// If this is a legal shuffle, this method returns the (possibly promoted)
- /// build_vector Mask. If it's not a legal shuffle, it returns null.
- SDNode *isShuffleLegal(MVT::ValueType VT, SDOperand Mask) const;
-
- bool LegalizeAllNodesNotLeadingTo(SDNode *N, SDNode *Dest,
- SmallPtrSet<SDNode*, 32> &NodesLeadingTo);
-
- void LegalizeSetCCOperands(SDOperand &LHS, SDOperand &RHS, SDOperand &CC);
-
- SDOperand ExpandLibCall(RTLIB::Libcall LC, SDNode *Node, bool isSigned,
- SDOperand &Hi);
- SDOperand ExpandIntToFP(bool isSigned, MVT::ValueType DestTy,
- SDOperand Source);
-
- SDOperand EmitStackConvert(SDOperand SrcOp, MVT::ValueType SlotVT,
- MVT::ValueType DestVT);
- SDOperand ExpandBUILD_VECTOR(SDNode *Node);
- SDOperand ExpandSCALAR_TO_VECTOR(SDNode *Node);
- SDOperand ExpandLegalINT_TO_FP(bool isSigned,
- SDOperand LegalOp,
- MVT::ValueType DestVT);
- SDOperand PromoteLegalINT_TO_FP(SDOperand LegalOp, MVT::ValueType DestVT,
- bool isSigned);
- SDOperand PromoteLegalFP_TO_INT(SDOperand LegalOp, MVT::ValueType DestVT,
- bool isSigned);
-
- SDOperand ExpandBSWAP(SDOperand Op);
- SDOperand ExpandBitCount(unsigned Opc, SDOperand Op);
- bool ExpandShift(unsigned Opc, SDOperand Op, SDOperand Amt,
- SDOperand &Lo, SDOperand &Hi);
- void ExpandShiftParts(unsigned NodeOp, SDOperand Op, SDOperand Amt,
- SDOperand &Lo, SDOperand &Hi);
-
- SDOperand ExpandEXTRACT_SUBVECTOR(SDOperand Op);
- SDOperand ExpandEXTRACT_VECTOR_ELT(SDOperand Op);
-};
-}
-
-/// isVectorShuffleLegal - Return true if a vector shuffle is legal with the
-/// specified mask and type. Targets can specify exactly which masks they
-/// support and the code generator is tasked with not creating illegal masks.
-///
-/// Note that this will also return true for shuffles that are promoted to a
-/// different type.
-SDNode *SelectionDAGLegalize::isShuffleLegal(MVT::ValueType VT,
- SDOperand Mask) const {
- switch (TLI.getOperationAction(ISD::VECTOR_SHUFFLE, VT)) {
- default: return 0;
- case TargetLowering::Legal:
- case TargetLowering::Custom:
- break;
- case TargetLowering::Promote: {
- // If this is promoted to a different type, convert the shuffle mask and
- // ask if it is legal in the promoted type!
- MVT::ValueType NVT = TLI.getTypeToPromoteTo(ISD::VECTOR_SHUFFLE, VT);
-
- // If we changed # elements, change the shuffle mask.
- unsigned NumEltsGrowth =
- MVT::getVectorNumElements(NVT) / MVT::getVectorNumElements(VT);
- assert(NumEltsGrowth && "Cannot promote to vector type with fewer elts!");
- if (NumEltsGrowth > 1) {
- // Renumber the elements.
- SmallVector<SDOperand, 8> Ops;
- for (unsigned i = 0, e = Mask.getNumOperands(); i != e; ++i) {
- SDOperand InOp = Mask.getOperand(i);
- for (unsigned j = 0; j != NumEltsGrowth; ++j) {
- if (InOp.getOpcode() == ISD::UNDEF)
- Ops.push_back(DAG.getNode(ISD::UNDEF, MVT::i32));
- else {
- unsigned InEltNo = cast<ConstantSDNode>(InOp)->getValue();
- Ops.push_back(DAG.getConstant(InEltNo*NumEltsGrowth+j, MVT::i32));
- }
- }
- }
- Mask = DAG.getNode(ISD::BUILD_VECTOR, NVT, &Ops[0], Ops.size());
- }
- VT = NVT;
- break;
- }
- }
- return TLI.isShuffleMaskLegal(Mask, VT) ? Mask.Val : 0;
-}
-
-SelectionDAGLegalize::SelectionDAGLegalize(SelectionDAG &dag)
- : TLI(dag.getTargetLoweringInfo()), DAG(dag),
- ValueTypeActions(TLI.getValueTypeActions()) {
- assert(MVT::LAST_VALUETYPE <= 32 &&
- "Too many value types for ValueTypeActions to hold!");
-}
-
-/// ComputeTopDownOrdering - Compute a top-down ordering of the dag, where Order
-/// contains all of a nodes operands before it contains the node.
-static void ComputeTopDownOrdering(SelectionDAG &DAG,
- SmallVector<SDNode*, 64> &Order) {
-
- DenseMap<SDNode*, unsigned> Visited;
- std::vector<SDNode*> Worklist;
- Worklist.reserve(128);
-
- // Compute ordering from all of the leaves in the graphs, those (like the
- // entry node) that have no operands.
- for (SelectionDAG::allnodes_iterator I = DAG.allnodes_begin(),
- E = DAG.allnodes_end(); I != E; ++I) {
- if (I->getNumOperands() == 0) {
- Visited[I] = 0 - 1U;
- Worklist.push_back(I);
- }
- }
-
- while (!Worklist.empty()) {
- SDNode *N = Worklist.back();
- Worklist.pop_back();
-
- if (++Visited[N] != N->getNumOperands())
- continue; // Haven't visited all operands yet
-
- Order.push_back(N);
-
- // Now that we have N in, add anything that uses it if all of their operands
- // are now done.
- for (SDNode::use_iterator UI = N->use_begin(), E = N->use_end();
- UI != E; ++UI)
- Worklist.push_back(UI->getUser());
- }
-
- assert(Order.size() == Visited.size() &&
- Order.size() ==
- (unsigned)std::distance(DAG.allnodes_begin(), DAG.allnodes_end()) &&
- "Error: DAG is cyclic!");
-}
-
-
-void SelectionDAGLegalize::LegalizeDAG() {
- LastCALLSEQ_END = DAG.getEntryNode();
- IsLegalizingCall = false;
-
- // The legalize process is inherently a bottom-up recursive process (users
- // legalize their uses before themselves). Given infinite stack space, we
- // could just start legalizing on the root and traverse the whole graph. In
- // practice however, this causes us to run out of stack space on large basic
- // blocks. To avoid this problem, compute an ordering of the nodes where each
- // node is only legalized after all of its operands are legalized.
- SmallVector<SDNode*, 64> Order;
- ComputeTopDownOrdering(DAG, Order);
-
- for (unsigned i = 0, e = Order.size(); i != e; ++i)
- HandleOp(SDOperand(Order[i], 0));
-
- // Finally, it's possible the root changed. Get the new root.
- SDOperand OldRoot = DAG.getRoot();
- assert(LegalizedNodes.count(OldRoot) && "Root didn't get legalized?");
- DAG.setRoot(LegalizedNodes[OldRoot]);
-
- ExpandedNodes.clear();
- LegalizedNodes.clear();
- PromotedNodes.clear();
- SplitNodes.clear();
- ScalarizedNodes.clear();
-
- // Remove dead nodes now.
- DAG.RemoveDeadNodes();
-}
-
-
-/// FindCallEndFromCallStart - Given a chained node that is part of a call
-/// sequence, find the CALLSEQ_END node that terminates the call sequence.
-static SDNode *FindCallEndFromCallStart(SDNode *Node) {
- if (Node->getOpcode() == ISD::CALLSEQ_END)
- return Node;
- if (Node->use_empty())
- return 0; // No CallSeqEnd
-
- // The chain is usually at the end.
- SDOperand TheChain(Node, Node->getNumValues()-1);
- if (TheChain.getValueType() != MVT::Other) {
- // Sometimes it's at the beginning.
- TheChain = SDOperand(Node, 0);
- if (TheChain.getValueType() != MVT::Other) {
- // Otherwise, hunt for it.
- for (unsigned i = 1, e = Node->getNumValues(); i != e; ++i)
- if (Node->getValueType(i) == MVT::Other) {
- TheChain = SDOperand(Node, i);
- break;
- }
-
- // Otherwise, we walked into a node without a chain.
- if (TheChain.getValueType() != MVT::Other)
- return 0;
- }
- }
-
- for (SDNode::use_iterator UI = Node->use_begin(),
- E = Node->use_end(); UI != E; ++UI) {
-
- // Make sure to only follow users of our token chain.
- SDNode *User = UI->getUser();
- for (unsigned i = 0, e = User->getNumOperands(); i != e; ++i)
- if (User->getOperand(i) == TheChain)
- if (SDNode *Result = FindCallEndFromCallStart(User))
- return Result;
- }
- return 0;
-}
-
-/// FindCallStartFromCallEnd - Given a chained node that is part of a call
-/// sequence, find the CALLSEQ_START node that initiates the call sequence.
-static SDNode *FindCallStartFromCallEnd(SDNode *Node) {
- assert(Node && "Didn't find callseq_start for a call??");
- if (Node->getOpcode() == ISD::CALLSEQ_START) return Node;
-
- assert(Node->getOperand(0).getValueType() == MVT::Other &&
- "Node doesn't have a token chain argument!");
- return FindCallStartFromCallEnd(Node->getOperand(0).Val);
-}
-
-/// LegalizeAllNodesNotLeadingTo - Recursively walk the uses of N, looking to
-/// see if any uses can reach Dest. If no dest operands can get to dest,
-/// legalize them, legalize ourself, and return false, otherwise, return true.
-///
-/// Keep track of the nodes we fine that actually do lead to Dest in
-/// NodesLeadingTo. This avoids retraversing them exponential number of times.
-///
-bool SelectionDAGLegalize::LegalizeAllNodesNotLeadingTo(SDNode *N, SDNode *Dest,
- SmallPtrSet<SDNode*, 32> &NodesLeadingTo) {
- if (N == Dest) return true; // N certainly leads to Dest :)
-
- // If we've already processed this node and it does lead to Dest, there is no
- // need to reprocess it.
- if (NodesLeadingTo.count(N)) return true;
-
- // If the first result of this node has been already legalized, then it cannot
- // reach N.
- switch (getTypeAction(N->getValueType(0))) {
- case Legal:
- if (LegalizedNodes.count(SDOperand(N, 0))) return false;
- break;
- case Promote:
- if (PromotedNodes.count(SDOperand(N, 0))) return false;
- break;
- case Expand:
- if (ExpandedNodes.count(SDOperand(N, 0))) return false;
- break;
- }
-
- // Okay, this node has not already been legalized. Check and legalize all
- // operands. If none lead to Dest, then we can legalize this node.
- bool OperandsLeadToDest = false;
- for (unsigned i = 0, e = N->getNumOperands(); i != e; ++i)
- OperandsLeadToDest |= // If an operand leads to Dest, so do we.
- LegalizeAllNodesNotLeadingTo(N->getOperand(i).Val, Dest, NodesLeadingTo);
-
- if (OperandsLeadToDest) {
- NodesLeadingTo.insert(N);
- return true;
- }
-
- // Okay, this node looks safe, legalize it and return false.
- HandleOp(SDOperand(N, 0));
- return false;
-}
-
-/// HandleOp - Legalize, Promote, or Expand the specified operand as
-/// appropriate for its type.
-void SelectionDAGLegalize::HandleOp(SDOperand Op) {
- MVT::ValueType VT = Op.getValueType();
- switch (getTypeAction(VT)) {
- default: assert(0 && "Bad type action!");
- case Legal: (void)LegalizeOp(Op); break;
- case Promote: (void)PromoteOp(Op); break;
- case Expand:
- if (!MVT::isVector(VT)) {
- // If this is an illegal scalar, expand it into its two component
- // pieces.
- SDOperand X, Y;
- if (Op.getOpcode() == ISD::TargetConstant)
- break; // Allow illegal target nodes.
- ExpandOp(Op, X, Y);
- } else if (MVT::getVectorNumElements(VT) == 1) {
- // If this is an illegal single element vector, convert it to a
- // scalar operation.
- (void)ScalarizeVectorOp(Op);
- } else {
- // Otherwise, this is an illegal multiple element vector.
- // Split it in half and legalize both parts.
- SDOperand X, Y;
- SplitVectorOp(Op, X, Y);
- }
- break;
- }
-}
-
-/// ExpandConstantFP - Expands the ConstantFP node to an integer constant or
-/// a load from the constant pool.
-static SDOperand ExpandConstantFP(ConstantFPSDNode *CFP, bool UseCP,
- SelectionDAG &DAG, TargetLowering &TLI) {
- bool Extend = false;
-
- // If a FP immediate is precise when represented as a float and if the
- // target can do an extending load from float to double, we put it into
- // the constant pool as a float, even if it's is statically typed as a
- // double. This shrinks FP constants and canonicalizes them for targets where
- // an FP extending load is the same cost as a normal load (such as on the x87
- // fp stack or PPC FP unit).
- MVT::ValueType VT = CFP->getValueType(0);
- ConstantFP *LLVMC = ConstantFP::get(CFP->getValueAPF());
- if (!UseCP) {
- if (VT!=MVT::f64 && VT!=MVT::f32)
- assert(0 && "Invalid type expansion");
- return DAG.getConstant(LLVMC->getValueAPF().convertToAPInt(),
- (VT == MVT::f64) ? MVT::i64 : MVT::i32);
- }
-
- MVT::ValueType OrigVT = VT;
- MVT::ValueType SVT = VT;
- while (SVT != MVT::f32) {
- SVT = (unsigned)SVT - 1;
- if (CFP->isValueValidForType(SVT, CFP->getValueAPF()) &&
- // Only do this if the target has a native EXTLOAD instruction from
- // smaller type.
- TLI.isLoadXLegal(ISD::EXTLOAD, SVT) &&
- TLI.ShouldShrinkFPConstant(OrigVT)) {
- const Type *SType = MVT::getTypeForValueType(SVT);
- LLVMC = cast<ConstantFP>(ConstantExpr::getFPTrunc(LLVMC, SType));
- VT = SVT;
- Extend = true;
- }
- }
-
- SDOperand CPIdx = DAG.getConstantPool(LLVMC, TLI.getPointerTy());
- if (Extend)
- return DAG.getExtLoad(ISD::EXTLOAD, OrigVT, DAG.getEntryNode(),
- CPIdx, PseudoSourceValue::getConstantPool(),
- 0, VT);
- return DAG.getLoad(OrigVT, DAG.getEntryNode(), CPIdx,
- PseudoSourceValue::getConstantPool(), 0);
-}
-
-
-/// ExpandFCOPYSIGNToBitwiseOps - Expands fcopysign to a series of bitwise
-/// operations.
-static
-SDOperand ExpandFCOPYSIGNToBitwiseOps(SDNode *Node, MVT::ValueType NVT,
- SelectionDAG &DAG, TargetLowering &TLI) {
- MVT::ValueType VT = Node->getValueType(0);
- MVT::ValueType SrcVT = Node->getOperand(1).getValueType();
- assert((SrcVT == MVT::f32 || SrcVT == MVT::f64) &&
- "fcopysign expansion only supported for f32 and f64");
- MVT::ValueType SrcNVT = (SrcVT == MVT::f64) ? MVT::i64 : MVT::i32;
-
- // First get the sign bit of second operand.
- SDOperand Mask1 = (SrcVT == MVT::f64)
- ? DAG.getConstantFP(BitsToDouble(1ULL << 63), SrcVT)
- : DAG.getConstantFP(BitsToFloat(1U << 31), SrcVT);
- Mask1 = DAG.getNode(ISD::BIT_CONVERT, SrcNVT, Mask1);
- SDOperand SignBit= DAG.getNode(ISD::BIT_CONVERT, SrcNVT, Node->getOperand(1));
- SignBit = DAG.getNode(ISD::AND, SrcNVT, SignBit, Mask1);
- // Shift right or sign-extend it if the two operands have different types.
- int SizeDiff = MVT::getSizeInBits(SrcNVT) - MVT::getSizeInBits(NVT);
- if (SizeDiff > 0) {
- SignBit = DAG.getNode(ISD::SRL, SrcNVT, SignBit,
- DAG.getConstant(SizeDiff, TLI.getShiftAmountTy()));
- SignBit = DAG.getNode(ISD::TRUNCATE, NVT, SignBit);
- } else if (SizeDiff < 0)
- SignBit = DAG.getNode(ISD::SIGN_EXTEND, NVT, SignBit);
-
- // Clear the sign bit of first operand.
- SDOperand Mask2 = (VT == MVT::f64)
- ? DAG.getConstantFP(BitsToDouble(~(1ULL << 63)), VT)
- : DAG.getConstantFP(BitsToFloat(~(1U << 31)), VT);
- Mask2 = DAG.getNode(ISD::BIT_CONVERT, NVT, Mask2);
- SDOperand Result = DAG.getNode(ISD::BIT_CONVERT, NVT, Node->getOperand(0));
- Result = DAG.getNode(ISD::AND, NVT, Result, Mask2);
-
- // Or the value with the sign bit.
- Result = DAG.getNode(ISD::OR, NVT, Result, SignBit);
- return Result;
-}
-
-/// ExpandUnalignedStore - Expands an unaligned store to 2 half-size stores.
-static
-SDOperand ExpandUnalignedStore(StoreSDNode *ST, SelectionDAG &DAG,
- TargetLowering &TLI) {
- SDOperand Chain = ST->getChain();
- SDOperand Ptr = ST->getBasePtr();
- SDOperand Val = ST->getValue();
- MVT::ValueType VT = Val.getValueType();
- int Alignment = ST->getAlignment();
- int SVOffset = ST->getSrcValueOffset();
- if (MVT::isFloatingPoint(ST->getMemoryVT()) ||
- MVT::isVector(ST->getMemoryVT())) {
- // Expand to a bitconvert of the value to the integer type of the
- // same size, then a (misaligned) int store.
- MVT::ValueType intVT;
- if (MVT::is128BitVector(VT) || VT == MVT::ppcf128 || VT == MVT::f128)
- intVT = MVT::i128;
- else if (MVT::is64BitVector(VT) || VT==MVT::f64)
- intVT = MVT::i64;
- else if (VT==MVT::f32)
- intVT = MVT::i32;
- else
- assert(0 && "Unaligned store of unsupported type");
-
- SDOperand Result = DAG.getNode(ISD::BIT_CONVERT, intVT, Val);
- return DAG.getStore(Chain, Result, Ptr, ST->getSrcValue(),
- SVOffset, ST->isVolatile(), Alignment);
- }
- assert(MVT::isInteger(ST->getMemoryVT()) &&
- !MVT::isVector(ST->getMemoryVT()) &&
- "Unaligned store of unknown type.");
- // Get the half-size VT
- MVT::ValueType NewStoredVT = ST->getMemoryVT() - 1;
- int NumBits = MVT::getSizeInBits(NewStoredVT);
- int IncrementSize = NumBits / 8;
-
- // Divide the stored value in two parts.
- SDOperand ShiftAmount = DAG.getConstant(NumBits, TLI.getShiftAmountTy());
- SDOperand Lo = Val;
- SDOperand Hi = DAG.getNode(ISD::SRL, VT, Val, ShiftAmount);
-
- // Store the two parts
- SDOperand Store1, Store2;
- Store1 = DAG.getTruncStore(Chain, TLI.isLittleEndian()?Lo:Hi, Ptr,
- ST->getSrcValue(), SVOffset, NewStoredVT,
- ST->isVolatile(), Alignment);
- Ptr = DAG.getNode(ISD::ADD, Ptr.getValueType(), Ptr,
- DAG.getConstant(IncrementSize, TLI.getPointerTy()));
- Alignment = MinAlign(Alignment, IncrementSize);
- Store2 = DAG.getTruncStore(Chain, TLI.isLittleEndian()?Hi:Lo, Ptr,
- ST->getSrcValue(), SVOffset + IncrementSize,
- NewStoredVT, ST->isVolatile(), Alignment);
-
- return DAG.getNode(ISD::TokenFactor, MVT::Other, Store1, Store2);
-}
-
-/// ExpandUnalignedLoad - Expands an unaligned load to 2 half-size loads.
-static
-SDOperand ExpandUnalignedLoad(LoadSDNode *LD, SelectionDAG &DAG,
- TargetLowering &TLI) {
- int SVOffset = LD->getSrcValueOffset();
- SDOperand Chain = LD->getChain();
- SDOperand Ptr = LD->getBasePtr();
- MVT::ValueType VT = LD->getValueType(0);
- MVT::ValueType LoadedVT = LD->getMemoryVT();
- if (MVT::isFloatingPoint(VT) || MVT::isVector(VT)) {
- // Expand to a (misaligned) integer load of the same size,
- // then bitconvert to floating point or vector.
- MVT::ValueType intVT;
- if (MVT::is128BitVector(LoadedVT) ||
- LoadedVT == MVT::ppcf128 || LoadedVT == MVT::f128)
- intVT = MVT::i128;
- else if (MVT::is64BitVector(LoadedVT) || LoadedVT == MVT::f64)
- intVT = MVT::i64;
- else if (LoadedVT == MVT::f32)
- intVT = MVT::i32;
- else
- assert(0 && "Unaligned load of unsupported type");
-
- SDOperand newLoad = DAG.getLoad(intVT, Chain, Ptr, LD->getSrcValue(),
- SVOffset, LD->isVolatile(),
- LD->getAlignment());
- SDOperand Result = DAG.getNode(ISD::BIT_CONVERT, LoadedVT, newLoad);
- if (MVT::isFloatingPoint(VT) && LoadedVT != VT)
- Result = DAG.getNode(ISD::FP_EXTEND, VT, Result);
-
- SDOperand Ops[] = { Result, Chain };
- return DAG.getNode(ISD::MERGE_VALUES, DAG.getVTList(VT, MVT::Other),
- Ops, 2);
- }
- assert(MVT::isInteger(LoadedVT) && !MVT::isVector(LoadedVT) &&
- "Unaligned load of unsupported type.");
-
- // Compute the new VT that is half the size of the old one. This is an
- // integer MVT.
- unsigned NumBits = MVT::getSizeInBits(LoadedVT);
- MVT::ValueType NewLoadedVT;
- NewLoadedVT = MVT::getIntegerType(NumBits/2);
- NumBits >>= 1;
-
- unsigned Alignment = LD->getAlignment();
- unsigned IncrementSize = NumBits / 8;
- ISD::LoadExtType HiExtType = LD->getExtensionType();
-
- // If the original load is NON_EXTLOAD, the hi part load must be ZEXTLOAD.
- if (HiExtType == ISD::NON_EXTLOAD)
- HiExtType = ISD::ZEXTLOAD;
-
- // Load the value in two parts
- SDOperand Lo, Hi;
- if (TLI.isLittleEndian()) {
- Lo = DAG.getExtLoad(ISD::ZEXTLOAD, VT, Chain, Ptr, LD->getSrcValue(),
- SVOffset, NewLoadedVT, LD->isVolatile(), Alignment);
- Ptr = DAG.getNode(ISD::ADD, Ptr.getValueType(), Ptr,
- DAG.getConstant(IncrementSize, TLI.getPointerTy()));
- Hi = DAG.getExtLoad(HiExtType, VT, Chain, Ptr, LD->getSrcValue(),
- SVOffset + IncrementSize, NewLoadedVT, LD->isVolatile(),
- MinAlign(Alignment, IncrementSize));
- } else {
- Hi = DAG.getExtLoad(HiExtType, VT, Chain, Ptr, LD->getSrcValue(), SVOffset,
- NewLoadedVT,LD->isVolatile(), Alignment);
- Ptr = DAG.getNode(ISD::ADD, Ptr.getValueType(), Ptr,
- DAG.getConstant(IncrementSize, TLI.getPointerTy()));
- Lo = DAG.getExtLoad(ISD::ZEXTLOAD, VT, Chain, Ptr, LD->getSrcValue(),
- SVOffset + IncrementSize, NewLoadedVT, LD->isVolatile(),
- MinAlign(Alignment, IncrementSize));
- }
-
- // aggregate the two parts
- SDOperand ShiftAmount = DAG.getConstant(NumBits, TLI.getShiftAmountTy());
- SDOperand Result = DAG.getNode(ISD::SHL, VT, Hi, ShiftAmount);
- Result = DAG.getNode(ISD::OR, VT, Result, Lo);
-
- SDOperand TF = DAG.getNode(ISD::TokenFactor, MVT::Other, Lo.getValue(1),
- Hi.getValue(1));
-
- SDOperand Ops[] = { Result, TF };
- return DAG.getNode(ISD::MERGE_VALUES, DAG.getVTList(VT, MVT::Other), Ops, 2);
-}
-
-/// UnrollVectorOp - We know that the given vector has a legal type, however
-/// the operation it performs is not legal and is an operation that we have
-/// no way of lowering. "Unroll" the vector, splitting out the scalars and
-/// operating on each element individually.
-SDOperand SelectionDAGLegalize::UnrollVectorOp(SDOperand Op) {
- MVT::ValueType VT = Op.getValueType();
- assert(isTypeLegal(VT) &&
- "Caller should expand or promote operands that are not legal!");
- assert(Op.Val->getNumValues() == 1 &&
- "Can't unroll a vector with multiple results!");
- unsigned NE = MVT::getVectorNumElements(VT);
- MVT::ValueType EltVT = MVT::getVectorElementType(VT);
-
- SmallVector<SDOperand, 8> Scalars;
- SmallVector<SDOperand, 4> Operands(Op.getNumOperands());
- for (unsigned i = 0; i != NE; ++i) {
- for (unsigned j = 0; j != Op.getNumOperands(); ++j) {
- SDOperand Operand = Op.getOperand(j);
- MVT::ValueType OperandVT = Operand.getValueType();
- if (MVT::isVector(OperandVT)) {
- // A vector operand; extract a single element.
- MVT::ValueType OperandEltVT = MVT::getVectorElementType(OperandVT);
- Operands[j] = DAG.getNode(ISD::EXTRACT_VECTOR_ELT,
- OperandEltVT,
- Operand,
- DAG.getConstant(i, MVT::i32));
- } else {
- // A scalar operand; just use it as is.
- Operands[j] = Operand;
- }
- }
- Scalars.push_back(DAG.getNode(Op.getOpcode(), EltVT,
- &Operands[0], Operands.size()));
- }
-
- return DAG.getNode(ISD::BUILD_VECTOR, VT, &Scalars[0], Scalars.size());
-}
-
-/// GetFPLibCall - Return the right libcall for the given floating point type.
-static RTLIB::Libcall GetFPLibCall(MVT::ValueType VT,
- RTLIB::Libcall Call_F32,
- RTLIB::Libcall Call_F64,
- RTLIB::Libcall Call_F80,
- RTLIB::Libcall Call_PPCF128) {
- return
- VT == MVT::f32 ? Call_F32 :
- VT == MVT::f64 ? Call_F64 :
- VT == MVT::f80 ? Call_F80 :
- VT == MVT::ppcf128 ? Call_PPCF128 :
- RTLIB::UNKNOWN_LIBCALL;
-}
-
-/// PerformInsertVectorEltInMemory - Some target cannot handle a variable
-/// insertion index for the INSERT_VECTOR_ELT instruction. In this case, it
-/// is necessary to spill the vector being inserted into to memory, perform
-/// the insert there, and then read the result back.
-SDOperand SelectionDAGLegalize::
-PerformInsertVectorEltInMemory(SDOperand Vec, SDOperand Val, SDOperand Idx) {
- SDOperand Tmp1 = Vec;
- SDOperand Tmp2 = Val;
- SDOperand Tmp3 = Idx;
-
- // If the target doesn't support this, we have to spill the input vector
- // to a temporary stack slot, update the element, then reload it. This is
- // badness. We could also load the value into a vector register (either
- // with a "move to register" or "extload into register" instruction, then
- // permute it into place, if the idx is a constant and if the idx is
- // supported by the target.
- MVT::ValueType VT = Tmp1.getValueType();
- MVT::ValueType EltVT = MVT::getVectorElementType(VT);
- MVT::ValueType IdxVT = Tmp3.getValueType();
- MVT::ValueType PtrVT = TLI.getPointerTy();
- SDOperand StackPtr = DAG.CreateStackTemporary(VT);
-
- FrameIndexSDNode *StackPtrFI = cast<FrameIndexSDNode>(StackPtr.Val);
- int SPFI = StackPtrFI->getIndex();
-
- // Store the vector.
- SDOperand Ch = DAG.getStore(DAG.getEntryNode(), Tmp1, StackPtr,
- PseudoSourceValue::getFixedStack(),
- SPFI);
-
- // Truncate or zero extend offset to target pointer type.
- unsigned CastOpc = (IdxVT > PtrVT) ? ISD::TRUNCATE : ISD::ZERO_EXTEND;
- Tmp3 = DAG.getNode(CastOpc, PtrVT, Tmp3);
- // Add the offset to the index.
- unsigned EltSize = MVT::getSizeInBits(EltVT)/8;
- Tmp3 = DAG.getNode(ISD::MUL, IdxVT, Tmp3,DAG.getConstant(EltSize, IdxVT));
- SDOperand StackPtr2 = DAG.getNode(ISD::ADD, IdxVT, Tmp3, StackPtr);
- // Store the scalar value.
- Ch = DAG.getTruncStore(Ch, Tmp2, StackPtr2,
- PseudoSourceValue::getFixedStack(), SPFI, EltVT);
- // Load the updated vector.
- return DAG.getLoad(VT, Ch, StackPtr, PseudoSourceValue::getFixedStack(),SPFI);
-}
-
-/// LegalizeOp - We know that the specified value has a legal type, and
-/// that its operands are legal. Now ensure that the operation itself
-/// is legal, recursively ensuring that the operands' operations remain
-/// legal.
-SDOperand SelectionDAGLegalize::LegalizeOp(SDOperand Op) {
- if (Op.getOpcode() == ISD::TargetConstant) // Allow illegal target nodes.
- return Op;
-
- assert(isTypeLegal(Op.getValueType()) &&
- "Caller should expand or promote operands that are not legal!");
- SDNode *Node = Op.Val;
-
- // If this operation defines any values that cannot be represented in a
- // register on this target, make sure to expand or promote them.
- if (Node->getNumValues() > 1) {
- for (unsigned i = 0, e = Node->getNumValues(); i != e; ++i)
- if (getTypeAction(Node->getValueType(i)) != Legal) {
- HandleOp(Op.getValue(i));
- assert(LegalizedNodes.count(Op) &&
- "Handling didn't add legal operands!");
- return LegalizedNodes[Op];
- }
- }
-
- // Note that LegalizeOp may be reentered even from single-use nodes, which
- // means that we always must cache transformed nodes.
- DenseMap<SDOperand, SDOperand>::iterator I = LegalizedNodes.find(Op);
- if (I != LegalizedNodes.end()) return I->second;
-
- SDOperand Tmp1, Tmp2, Tmp3, Tmp4;
- SDOperand Result = Op;
- bool isCustom = false;
-
- switch (Node->getOpcode()) {
- case ISD::FrameIndex:
- case ISD::EntryToken:
- case ISD::Register:
- case ISD::BasicBlock:
- case ISD::TargetFrameIndex:
- case ISD::TargetJumpTable:
- case ISD::TargetConstant:
- case ISD::TargetConstantFP:
- case ISD::TargetConstantPool:
- case ISD::TargetGlobalAddress:
- case ISD::TargetGlobalTLSAddress:
- case ISD::TargetExternalSymbol:
- case ISD::VALUETYPE:
- case ISD::SRCVALUE:
- case ISD::MEMOPERAND:
- case ISD::STRING:
- case ISD::CONDCODE:
- case ISD::ARG_FLAGS:
- // Primitives must all be legal.
- assert(TLI.isOperationLegal(Node->getOpcode(), Node->getValueType(0)) &&
- "This must be legal!");
- break;
- default:
- if (Node->getOpcode() >= ISD::BUILTIN_OP_END) {
- // If this is a target node, legalize it by legalizing the operands then
- // passing it through.
- SmallVector<SDOperand, 8> Ops;
- for (unsigned i = 0, e = Node->getNumOperands(); i != e; ++i)
- Ops.push_back(LegalizeOp(Node->getOperand(i)));
-
- Result = DAG.UpdateNodeOperands(Result.getValue(0), &Ops[0], Ops.size());
-
- for (unsigned i = 0, e = Node->getNumValues(); i != e; ++i)
- AddLegalizedOperand(Op.getValue(i), Result.getValue(i));
- return Result.getValue(Op.ResNo);
- }
- // Otherwise this is an unhandled builtin node. splat.
-#ifndef NDEBUG
- cerr << "NODE: "; Node->dump(&DAG); cerr << "\n";
-#endif
- assert(0 && "Do not know how to legalize this operator!");
- abort();
- case ISD::GLOBAL_OFFSET_TABLE:
- case ISD::GlobalAddress:
- case ISD::GlobalTLSAddress:
- case ISD::ExternalSymbol:
- case ISD::ConstantPool:
- case ISD::JumpTable: // Nothing to do.
- switch (TLI.getOperationAction(Node->getOpcode(), Node->getValueType(0))) {
- default: assert(0 && "This action is not supported yet!");
- case TargetLowering::Custom:
- Tmp1 = TLI.LowerOperation(Op, DAG);
- if (Tmp1.Val) Result = Tmp1;
- // FALLTHROUGH if the target doesn't want to lower this op after all.
- case TargetLowering::Legal:
- break;
- }
- break;
- case ISD::FRAMEADDR:
- case ISD::RETURNADDR:
- // The only option for these nodes is to custom lower them. If the target
- // does not custom lower them, then return zero.
- Tmp1 = TLI.LowerOperation(Op, DAG);
- if (Tmp1.Val)
- Result = Tmp1;
- else
- Result = DAG.getConstant(0, TLI.getPointerTy());
- break;
- case ISD::FRAME_TO_ARGS_OFFSET: {
- MVT::ValueType VT = Node->getValueType(0);
- switch (TLI.getOperationAction(Node->getOpcode(), VT)) {
- default: assert(0 && "This action is not supported yet!");
- case TargetLowering::Custom:
- Result = TLI.LowerOperation(Op, DAG);
- if (Result.Val) break;
- // Fall Thru
- case TargetLowering::Legal:
- Result = DAG.getConstant(0, VT);
- break;
- }
- }
- break;
- case ISD::EXCEPTIONADDR: {
- Tmp1 = LegalizeOp(Node->getOperand(0));
- MVT::ValueType VT = Node->getValueType(0);
- switch (TLI.getOperationAction(Node->getOpcode(), VT)) {
- default: assert(0 && "This action is not supported yet!");
- case TargetLowering::Expand: {
- unsigned Reg = TLI.getExceptionAddressRegister();
- Result = DAG.getCopyFromReg(Tmp1, Reg, VT);
- }
- break;
- case TargetLowering::Custom:
- Result = TLI.LowerOperation(Op, DAG);
- if (Result.Val) break;
- // Fall Thru
- case TargetLowering::Legal: {
- SDOperand Ops[] = { DAG.getConstant(0, VT), Tmp1 };
- Result = DAG.getNode(ISD::MERGE_VALUES, DAG.getVTList(VT, MVT::Other),
- Ops, 2);
- break;
- }
- }
- }
- if (Result.Val->getNumValues() == 1) break;
-
- assert(Result.Val->getNumValues() == 2 &&
- "Cannot return more than two values!");
-
- // Since we produced two values, make sure to remember that we
- // legalized both of them.
- Tmp1 = LegalizeOp(Result);
- Tmp2 = LegalizeOp(Result.getValue(1));
- AddLegalizedOperand(Op.getValue(0), Tmp1);
- AddLegalizedOperand(Op.getValue(1), Tmp2);
- return Op.ResNo ? Tmp2 : Tmp1;
- case ISD::EHSELECTION: {
- Tmp1 = LegalizeOp(Node->getOperand(0));
- Tmp2 = LegalizeOp(Node->getOperand(1));
- MVT::ValueType VT = Node->getValueType(0);
- switch (TLI.getOperationAction(Node->getOpcode(), VT)) {
- default: assert(0 && "This action is not supported yet!");
- case TargetLowering::Expand: {
- unsigned Reg = TLI.getExceptionSelectorRegister();
- Result = DAG.getCopyFromReg(Tmp2, Reg, VT);
- }
- break;
- case TargetLowering::Custom:
- Result = TLI.LowerOperation(Op, DAG);
- if (Result.Val) break;
- // Fall Thru
- case TargetLowering::Legal: {
- SDOperand Ops[] = { DAG.getConstant(0, VT), Tmp2 };
- Result = DAG.getNode(ISD::MERGE_VALUES, DAG.getVTList(VT, MVT::Other),
- Ops, 2);
- break;
- }
- }
- }
- if (Result.Val->getNumValues() == 1) break;
-
- assert(Result.Val->getNumValues() == 2 &&
- "Cannot return more than two values!");
-
- // Since we produced two values, make sure to remember that we
- // legalized both of them.
- Tmp1 = LegalizeOp(Result);
- Tmp2 = LegalizeOp(Result.getValue(1));
- AddLegalizedOperand(Op.getValue(0), Tmp1);
- AddLegalizedOperand(Op.getValue(1), Tmp2);
- return Op.ResNo ? Tmp2 : Tmp1;
- case ISD::EH_RETURN: {
- MVT::ValueType VT = Node->getValueType(0);
- // The only "good" option for this node is to custom lower it.
- switch (TLI.getOperationAction(Node->getOpcode(), VT)) {
- default: assert(0 && "This action is not supported at all!");
- case TargetLowering::Custom:
- Result = TLI.LowerOperation(Op, DAG);
- if (Result.Val) break;
- // Fall Thru
- case TargetLowering::Legal:
- // Target does not know, how to lower this, lower to noop
- Result = LegalizeOp(Node->getOperand(0));
- break;
- }
- }
- break;
- case ISD::AssertSext:
- case ISD::AssertZext:
- Tmp1 = LegalizeOp(Node->getOperand(0));
- Result = DAG.UpdateNodeOperands(Result, Tmp1, Node->getOperand(1));
- break;
- case ISD::MERGE_VALUES:
- // Legalize eliminates MERGE_VALUES nodes.
- Result = Node->getOperand(Op.ResNo);
- break;
- case ISD::CopyFromReg:
- Tmp1 = LegalizeOp(Node->getOperand(0));
- Result = Op.getValue(0);
- if (Node->getNumValues() == 2) {
- Result = DAG.UpdateNodeOperands(Result, Tmp1, Node->getOperand(1));
- } else {
- assert(Node->getNumValues() == 3 && "Invalid copyfromreg!");
- if (Node->getNumOperands() == 3) {
- Tmp2 = LegalizeOp(Node->getOperand(2));
- Result = DAG.UpdateNodeOperands(Result, Tmp1, Node->getOperand(1),Tmp2);
- } else {
- Result = DAG.UpdateNodeOperands(Result, Tmp1, Node->getOperand(1));
- }
- AddLegalizedOperand(Op.getValue(2), Result.getValue(2));
- }
- // Since CopyFromReg produces two values, make sure to remember that we
- // legalized both of them.
- AddLegalizedOperand(Op.getValue(0), Result);
- AddLegalizedOperand(Op.getValue(1), Result.getValue(1));
- return Result.getValue(Op.ResNo);
- case ISD::UNDEF: {
- MVT::ValueType VT = Op.getValueType();
- switch (TLI.getOperationAction(ISD::UNDEF, VT)) {
- default: assert(0 && "This action is not supported yet!");
- case TargetLowering::Expand:
- if (MVT::isInteger(VT))
- Result = DAG.getConstant(0, VT);
- else if (MVT::isFloatingPoint(VT))
- Result = DAG.getConstantFP(APFloat(APInt(MVT::getSizeInBits(VT), 0)),
- VT);
- else
- assert(0 && "Unknown value type!");
- break;
- case TargetLowering::Legal:
- break;
- }
- break;
- }
-
- case ISD::INTRINSIC_W_CHAIN:
- case ISD::INTRINSIC_WO_CHAIN:
- case ISD::INTRINSIC_VOID: {
- SmallVector<SDOperand, 8> Ops;
- for (unsigned i = 0, e = Node->getNumOperands(); i != e; ++i)
- Ops.push_back(LegalizeOp(Node->getOperand(i)));
- Result = DAG.UpdateNodeOperands(Result, &Ops[0], Ops.size());
-
- // Allow the target to custom lower its intrinsics if it wants to.
- if (TLI.getOperationAction(Node->getOpcode(), MVT::Other) ==
- TargetLowering::Custom) {
- Tmp3 = TLI.LowerOperation(Result, DAG);
- if (Tmp3.Val) Result = Tmp3;
- }
-
- if (Result.Val->getNumValues() == 1) break;
-
- // Must have return value and chain result.
- assert(Result.Val->getNumValues() == 2 &&
- "Cannot return more than two values!");
-
- // Since loads produce two values, make sure to remember that we
- // legalized both of them.
- AddLegalizedOperand(SDOperand(Node, 0), Result.getValue(0));
- AddLegalizedOperand(SDOperand(Node, 1), Result.getValue(1));
- return Result.getValue(Op.ResNo);
- }
-
- case ISD::LOCATION:
- assert(Node->getNumOperands() == 5 && "Invalid LOCATION node!");
- Tmp1 = LegalizeOp(Node->getOperand(0)); // Legalize the input chain.
-
- switch (TLI.getOperationAction(ISD::LOCATION, MVT::Other)) {
- case TargetLowering::Promote:
- default: assert(0 && "This action is not supported yet!");
- case TargetLowering::Expand: {
- MachineModuleInfo *MMI = DAG.getMachineModuleInfo();
- bool useDEBUG_LOC = TLI.isOperationLegal(ISD::DEBUG_LOC, MVT::Other);
- bool useLABEL = TLI.isOperationLegal(ISD::LABEL, MVT::Other);
-
- if (MMI && (useDEBUG_LOC || useLABEL)) {
- const std::string &FName =
- cast<StringSDNode>(Node->getOperand(3))->getValue();
- const std::string &DirName =
- cast<StringSDNode>(Node->getOperand(4))->getValue();
- unsigned SrcFile = MMI->RecordSource(DirName, FName);
-
- SmallVector<SDOperand, 8> Ops;
- Ops.push_back(Tmp1); // chain
- SDOperand LineOp = Node->getOperand(1);
- SDOperand ColOp = Node->getOperand(2);
-
- if (useDEBUG_LOC) {
- Ops.push_back(LineOp); // line #
- Ops.push_back(ColOp); // col #
- Ops.push_back(DAG.getConstant(SrcFile, MVT::i32)); // source file id
- Result = DAG.getNode(ISD::DEBUG_LOC, MVT::Other, &Ops[0], Ops.size());
- } else {
- unsigned Line = cast<ConstantSDNode>(LineOp)->getValue();
- unsigned Col = cast<ConstantSDNode>(ColOp)->getValue();
- unsigned ID = MMI->RecordSourceLine(Line, Col, SrcFile);
- Ops.push_back(DAG.getConstant(ID, MVT::i32));
- Ops.push_back(DAG.getConstant(0, MVT::i32)); // a debug label
- Result = DAG.getNode(ISD::LABEL, MVT::Other, &Ops[0], Ops.size());
- }
- } else {
- Result = Tmp1; // chain
- }
- break;
- }
- case TargetLowering::Legal:
- if (Tmp1 != Node->getOperand(0) ||
- getTypeAction(Node->getOperand(1).getValueType()) == Promote) {
- SmallVector<SDOperand, 8> Ops;
- Ops.push_back(Tmp1);
- if (getTypeAction(Node->getOperand(1).getValueType()) == Legal) {
- Ops.push_back(Node->getOperand(1)); // line # must be legal.
- Ops.push_back(Node->getOperand(2)); // col # must be legal.
- } else {
- // Otherwise promote them.
- Ops.push_back(PromoteOp(Node->getOperand(1)));
- Ops.push_back(PromoteOp(Node->getOperand(2)));
- }
- Ops.push_back(Node->getOperand(3)); // filename must be legal.
- Ops.push_back(Node->getOperand(4)); // working dir # must be legal.
- Result = DAG.UpdateNodeOperands(Result, &Ops[0], Ops.size());
- }
- break;
- }
- break;
-
- case ISD::DECLARE:
- assert(Node->getNumOperands() == 3 && "Invalid DECLARE node!");
- switch (TLI.getOperationAction(ISD::DECLARE, MVT::Other)) {
- default: assert(0 && "This action is not supported yet!");
- case TargetLowering::Legal:
- Tmp1 = LegalizeOp(Node->getOperand(0)); // Legalize the chain.
- Tmp2 = LegalizeOp(Node->getOperand(1)); // Legalize the address.
- Tmp3 = LegalizeOp(Node->getOperand(2)); // Legalize the variable.
- Result = DAG.UpdateNodeOperands(Result, Tmp1, Tmp2, Tmp3);
- break;
- case TargetLowering::Expand:
- Result = LegalizeOp(Node->getOperand(0));
- break;
- }
- break;
-
- case ISD::DEBUG_LOC:
- assert(Node->getNumOperands() == 4 && "Invalid DEBUG_LOC node!");
- switch (TLI.getOperationAction(ISD::DEBUG_LOC, MVT::Other)) {
- default: assert(0 && "This action is not supported yet!");
- case TargetLowering::Legal:
- Tmp1 = LegalizeOp(Node->getOperand(0)); // Legalize the chain.
- Tmp2 = LegalizeOp(Node->getOperand(1)); // Legalize the line #.
- Tmp3 = LegalizeOp(Node->getOperand(2)); // Legalize the col #.
- Tmp4 = LegalizeOp(Node->getOperand(3)); // Legalize the source file id.
- Result = DAG.UpdateNodeOperands(Result, Tmp1, Tmp2, Tmp3, Tmp4);
- break;
- }
- break;
-
- case ISD::LABEL:
- assert(Node->getNumOperands() == 3 && "Invalid LABEL node!");
- switch (TLI.getOperationAction(ISD::LABEL, MVT::Other)) {
- default: assert(0 && "This action is not supported yet!");
- case TargetLowering::Legal:
- Tmp1 = LegalizeOp(Node->getOperand(0)); // Legalize the chain.
- Tmp2 = LegalizeOp(Node->getOperand(1)); // Legalize the label id.
- Tmp3 = LegalizeOp(Node->getOperand(2)); // Legalize the "flavor" operand.
- Result = DAG.UpdateNodeOperands(Result, Tmp1, Tmp2, Tmp3);
- break;
- case TargetLowering::Expand:
- Result = LegalizeOp(Node->getOperand(0));
- break;
- }
- break;
-
- case ISD::PREFETCH:
- assert(Node->getNumOperands() == 4 && "Invalid Prefetch node!");
- switch (TLI.getOperationAction(ISD::PREFETCH, MVT::Other)) {
- default: assert(0 && "This action is not supported yet!");
- case TargetLowering::Legal:
- Tmp1 = LegalizeOp(Node->getOperand(0)); // Legalize the chain.
- Tmp2 = LegalizeOp(Node->getOperand(1)); // Legalize the address.
- Tmp3 = LegalizeOp(Node->getOperand(2)); // Legalize the rw specifier.
- Tmp4 = LegalizeOp(Node->getOperand(3)); // Legalize locality specifier.
- Result = DAG.UpdateNodeOperands(Result, Tmp1, Tmp2, Tmp3, Tmp4);
- break;
- case TargetLowering::Expand:
- // It's a noop.
- Result = LegalizeOp(Node->getOperand(0));
- break;
- }
- break;
-
- case ISD::MEMBARRIER: {
- assert(Node->getNumOperands() == 6 && "Invalid MemBarrier node!");
- switch (TLI.getOperationAction(ISD::MEMBARRIER, MVT::Other)) {
- default: assert(0 && "This action is not supported yet!");
- case TargetLowering::Legal: {
- SDOperand Ops[6];
- Ops[0] = LegalizeOp(Node->getOperand(0)); // Legalize the chain.
- for (int x = 1; x < 6; ++x) {
- Ops[x] = Node->getOperand(x);
- if (!isTypeLegal(Ops[x].getValueType()))
- Ops[x] = PromoteOp(Ops[x]);
- }
- Result = DAG.UpdateNodeOperands(Result, &Ops[0], 6);
- break;
- }
- case TargetLowering::Expand:
- //There is no libgcc call for this op
- Result = Node->getOperand(0); // Noop
- break;
- }
- break;
- }
-
- case ISD::ATOMIC_LCS: {
- unsigned int num_operands = 4;
- assert(Node->getNumOperands() == num_operands && "Invalid Atomic node!");
- SDOperand Ops[4];
- for (unsigned int x = 0; x < num_operands; ++x)
- Ops[x] = LegalizeOp(Node->getOperand(x));
- Result = DAG.UpdateNodeOperands(Result, &Ops[0], num_operands);
-
- switch (TLI.getOperationAction(Node->getOpcode(), Node->getValueType(0))) {
- default: assert(0 && "This action is not supported yet!");
- case TargetLowering::Custom:
- Result = TLI.LowerOperation(Result, DAG);
- break;
- case TargetLowering::Legal:
- break;
- }
- AddLegalizedOperand(SDOperand(Node, 0), Result.getValue(0));
- AddLegalizedOperand(SDOperand(Node, 1), Result.getValue(1));
- return Result.getValue(Op.ResNo);
- }
- case ISD::ATOMIC_LAS:
- case ISD::ATOMIC_LSS:
- case ISD::ATOMIC_LOAD_AND:
- case ISD::ATOMIC_LOAD_OR:
- case ISD::ATOMIC_LOAD_XOR:
- case ISD::ATOMIC_LOAD_MIN:
- case ISD::ATOMIC_LOAD_MAX:
- case ISD::ATOMIC_LOAD_UMIN:
- case ISD::ATOMIC_LOAD_UMAX:
- case ISD::ATOMIC_SWAP: {
- unsigned int num_operands = 3;
- assert(Node->getNumOperands() == num_operands && "Invalid Atomic node!");
- SDOperand Ops[3];
- for (unsigned int x = 0; x < num_operands; ++x)
- Ops[x] = LegalizeOp(Node->getOperand(x));
- Result = DAG.UpdateNodeOperands(Result, &Ops[0], num_operands);
-
- switch (TLI.getOperationAction(Node->getOpcode(), Node->getValueType(0))) {
- default: assert(0 && "This action is not supported yet!");
- case TargetLowering::Custom:
- Result = TLI.LowerOperation(Result, DAG);
- break;
- case TargetLowering::Expand:
- Result = SDOperand(TLI.ExpandOperationResult(Op.Val, DAG),0);
- break;
- case TargetLowering::Legal:
- break;
- }
- AddLegalizedOperand(SDOperand(Node, 0), Result.getValue(0));
- AddLegalizedOperand(SDOperand(Node, 1), Result.getValue(1));
- return Result.getValue(Op.ResNo);
- }
- case ISD::Constant: {
- ConstantSDNode *CN = cast<ConstantSDNode>(Node);
- unsigned opAction =
- TLI.getOperationAction(ISD::Constant, CN->getValueType(0));
-
- // We know we don't need to expand constants here, constants only have one
- // value and we check that it is fine above.
-
- if (opAction == TargetLowering::Custom) {
- Tmp1 = TLI.LowerOperation(Result, DAG);
- if (Tmp1.Val)
- Result = Tmp1;
- }
- break;
- }
- case ISD::ConstantFP: {
- // Spill FP immediates to the constant pool if the target cannot directly
- // codegen them. Targets often have some immediate values that can be
- // efficiently generated into an FP register without a load. We explicitly
- // leave these constants as ConstantFP nodes for the target to deal with.
- ConstantFPSDNode *CFP = cast<ConstantFPSDNode>(Node);
-
- switch (TLI.getOperationAction(ISD::ConstantFP, CFP->getValueType(0))) {
- default: assert(0 && "This action is not supported yet!");
- case TargetLowering::Legal:
- break;
- case TargetLowering::Custom:
- Tmp3 = TLI.LowerOperation(Result, DAG);
- if (Tmp3.Val) {
- Result = Tmp3;
- break;
- }
- // FALLTHROUGH
- case TargetLowering::Expand: {
- // Check to see if this FP immediate is already legal.
- bool isLegal = false;
- for (TargetLowering::legal_fpimm_iterator I = TLI.legal_fpimm_begin(),
- E = TLI.legal_fpimm_end(); I != E; ++I) {
- if (CFP->isExactlyValue(*I)) {
- isLegal = true;
- break;
- }
- }
- // If this is a legal constant, turn it into a TargetConstantFP node.
- if (isLegal)
- break;
- Result = ExpandConstantFP(CFP, true, DAG, TLI);
- }
- }
- break;
- }
- case ISD::TokenFactor:
- if (Node->getNumOperands() == 2) {
- Tmp1 = LegalizeOp(Node->getOperand(0));
- Tmp2 = LegalizeOp(Node->getOperand(1));
- Result = DAG.UpdateNodeOperands(Result, Tmp1, Tmp2);
- } else if (Node->getNumOperands() == 3) {
- Tmp1 = LegalizeOp(Node->getOperand(0));
- Tmp2 = LegalizeOp(Node->getOperand(1));
- Tmp3 = LegalizeOp(Node->getOperand(2));
- Result = DAG.UpdateNodeOperands(Result, Tmp1, Tmp2, Tmp3);
- } else {
- SmallVector<SDOperand, 8> Ops;
- // Legalize the operands.
- for (unsigned i = 0, e = Node->getNumOperands(); i != e; ++i)
- Ops.push_back(LegalizeOp(Node->getOperand(i)));
- Result = DAG.UpdateNodeOperands(Result, &Ops[0], Ops.size());
- }
- break;
-
- case ISD::FORMAL_ARGUMENTS:
- case ISD::CALL:
- // The only option for this is to custom lower it.
- Tmp3 = TLI.LowerOperation(Result.getValue(0), DAG);
- assert(Tmp3.Val && "Target didn't custom lower this node!");
- // A call within a calling sequence must be legalized to something
- // other than the normal CALLSEQ_END. Violating this gets Legalize
- // into an infinite loop.
- assert ((!IsLegalizingCall ||
- Node->getOpcode() != ISD::CALL ||
- Tmp3.Val->getOpcode() != ISD::CALLSEQ_END) &&
- "Nested CALLSEQ_START..CALLSEQ_END not supported.");
-
- // The number of incoming and outgoing values should match; unless the final
- // outgoing value is a flag.
- assert((Tmp3.Val->getNumValues() == Result.Val->getNumValues() ||
- (Tmp3.Val->getNumValues() == Result.Val->getNumValues() + 1 &&
- Tmp3.Val->getValueType(Tmp3.Val->getNumValues() - 1) ==
- MVT::Flag)) &&
- "Lowering call/formal_arguments produced unexpected # results!");
-
- // Since CALL/FORMAL_ARGUMENTS nodes produce multiple values, make sure to
- // remember that we legalized all of them, so it doesn't get relegalized.
- for (unsigned i = 0, e = Tmp3.Val->getNumValues(); i != e; ++i) {
- if (Tmp3.Val->getValueType(i) == MVT::Flag)
- continue;
- Tmp1 = LegalizeOp(Tmp3.getValue(i));
- if (Op.ResNo == i)
- Tmp2 = Tmp1;
- AddLegalizedOperand(SDOperand(Node, i), Tmp1);
- }
- return Tmp2;
- case ISD::EXTRACT_SUBREG: {
- Tmp1 = LegalizeOp(Node->getOperand(0));
- ConstantSDNode *idx = dyn_cast<ConstantSDNode>(Node->getOperand(1));
- assert(idx && "Operand must be a constant");
- Tmp2 = DAG.getTargetConstant(idx->getValue(), idx->getValueType(0));
- Result = DAG.UpdateNodeOperands(Result, Tmp1, Tmp2);
- }
- break;
- case ISD::INSERT_SUBREG: {
- Tmp1 = LegalizeOp(Node->getOperand(0));
- Tmp2 = LegalizeOp(Node->getOperand(1));
- ConstantSDNode *idx = dyn_cast<ConstantSDNode>(Node->getOperand(2));
- assert(idx && "Operand must be a constant");
- Tmp3 = DAG.getTargetConstant(idx->getValue(), idx->getValueType(0));
- Result = DAG.UpdateNodeOperands(Result, Tmp1, Tmp2, Tmp3);
- }
- break;
- case ISD::BUILD_VECTOR:
- switch (TLI.getOperationAction(ISD::BUILD_VECTOR, Node->getValueType(0))) {
- default: assert(0 && "This action is not supported yet!");
- case TargetLowering::Custom:
- Tmp3 = TLI.LowerOperation(Result, DAG);
- if (Tmp3.Val) {
- Result = Tmp3;
- break;
- }
- // FALLTHROUGH
- case TargetLowering::Expand:
- Result = ExpandBUILD_VECTOR(Result.Val);
- break;
- }
- break;
- case ISD::INSERT_VECTOR_ELT:
- Tmp1 = LegalizeOp(Node->getOperand(0)); // InVec
- Tmp3 = LegalizeOp(Node->getOperand(2)); // InEltNo
-
- // The type of the value to insert may not be legal, even though the vector
- // type is legal. Legalize/Promote accordingly. We do not handle Expand
- // here.
- switch (getTypeAction(Node->getOperand(1).getValueType())) {
- default: assert(0 && "Cannot expand insert element operand");
- case Legal: Tmp2 = LegalizeOp(Node->getOperand(1)); break;
- case Promote: Tmp2 = PromoteOp(Node->getOperand(1)); break;
- }
- Result = DAG.UpdateNodeOperands(Result, Tmp1, Tmp2, Tmp3);
-
- switch (TLI.getOperationAction(ISD::INSERT_VECTOR_ELT,
- Node->getValueType(0))) {
- default: assert(0 && "This action is not supported yet!");
- case TargetLowering::Legal:
- break;
- case TargetLowering::Custom:
- Tmp4 = TLI.LowerOperation(Result, DAG);
- if (Tmp4.Val) {
- Result = Tmp4;
- break;
- }
- // FALLTHROUGH
- case TargetLowering::Expand: {
- // If the insert index is a constant, codegen this as a scalar_to_vector,
- // then a shuffle that inserts it into the right position in the vector.
- if (ConstantSDNode *InsertPos = dyn_cast<ConstantSDNode>(Tmp3)) {
- // SCALAR_TO_VECTOR requires that the type of the value being inserted
- // match the element type of the vector being created.
- if (Tmp2.getValueType() ==
- MVT::getVectorElementType(Op.getValueType())) {
- SDOperand ScVec = DAG.getNode(ISD::SCALAR_TO_VECTOR,
- Tmp1.getValueType(), Tmp2);
-
- unsigned NumElts = MVT::getVectorNumElements(Tmp1.getValueType());
- MVT::ValueType ShufMaskVT = MVT::getIntVectorWithNumElements(NumElts);
- MVT::ValueType ShufMaskEltVT = MVT::getVectorElementType(ShufMaskVT);
-
- // We generate a shuffle of InVec and ScVec, so the shuffle mask
- // should be 0,1,2,3,4,5... with the appropriate element replaced with
- // elt 0 of the RHS.
- SmallVector<SDOperand, 8> ShufOps;
- for (unsigned i = 0; i != NumElts; ++i) {
- if (i != InsertPos->getValue())
- ShufOps.push_back(DAG.getConstant(i, ShufMaskEltVT));
- else
- ShufOps.push_back(DAG.getConstant(NumElts, ShufMaskEltVT));
- }
- SDOperand ShufMask = DAG.getNode(ISD::BUILD_VECTOR, ShufMaskVT,
- &ShufOps[0], ShufOps.size());
-
- Result = DAG.getNode(ISD::VECTOR_SHUFFLE, Tmp1.getValueType(),
- Tmp1, ScVec, ShufMask);
- Result = LegalizeOp(Result);
- break;
- }
- }
- Result = PerformInsertVectorEltInMemory(Tmp1, Tmp2, Tmp3);
- break;
- }
- }
- break;
- case ISD::SCALAR_TO_VECTOR:
- if (!TLI.isTypeLegal(Node->getOperand(0).getValueType())) {
- Result = LegalizeOp(ExpandSCALAR_TO_VECTOR(Node));
- break;
- }
-
- Tmp1 = LegalizeOp(Node->getOperand(0)); // InVal
- Result = DAG.UpdateNodeOperands(Result, Tmp1);
- switch (TLI.getOperationAction(ISD::SCALAR_TO_VECTOR,
- Node->getValueType(0))) {
- default: assert(0 && "This action is not supported yet!");
- case TargetLowering::Legal:
- break;
- case TargetLowering::Custom:
- Tmp3 = TLI.LowerOperation(Result, DAG);
- if (Tmp3.Val) {
- Result = Tmp3;
- break;
- }
- // FALLTHROUGH
- case TargetLowering::Expand:
- Result = LegalizeOp(ExpandSCALAR_TO_VECTOR(Node));
- break;
- }
- break;
- case ISD::VECTOR_SHUFFLE:
- Tmp1 = LegalizeOp(Node->getOperand(0)); // Legalize the input vectors,
- Tmp2 = LegalizeOp(Node->getOperand(1)); // but not the shuffle mask.
- Result = DAG.UpdateNodeOperands(Result, Tmp1, Tmp2, Node->getOperand(2));
-
- // Allow targets to custom lower the SHUFFLEs they support.
- switch (TLI.getOperationAction(ISD::VECTOR_SHUFFLE,Result.getValueType())) {
- default: assert(0 && "Unknown operation action!");
- case TargetLowering::Legal:
- assert(isShuffleLegal(Result.getValueType(), Node->getOperand(2)) &&
- "vector shuffle should not be created if not legal!");
- break;
- case TargetLowering::Custom:
- Tmp3 = TLI.LowerOperation(Result, DAG);
- if (Tmp3.Val) {
- Result = Tmp3;
- break;
- }
- // FALLTHROUGH
- case TargetLowering::Expand: {
- MVT::ValueType VT = Node->getValueType(0);
- MVT::ValueType EltVT = MVT::getVectorElementType(VT);
- MVT::ValueType PtrVT = TLI.getPointerTy();
- SDOperand Mask = Node->getOperand(2);
- unsigned NumElems = Mask.getNumOperands();
- SmallVector<SDOperand,8> Ops;
- for (unsigned i = 0; i != NumElems; ++i) {
- SDOperand Arg = Mask.getOperand(i);
- if (Arg.getOpcode() == ISD::UNDEF) {
- Ops.push_back(DAG.getNode(ISD::UNDEF, EltVT));
- } else {
- assert(isa<ConstantSDNode>(Arg) && "Invalid VECTOR_SHUFFLE mask!");
- unsigned Idx = cast<ConstantSDNode>(Arg)->getValue();
- if (Idx < NumElems)
- Ops.push_back(DAG.getNode(ISD::EXTRACT_VECTOR_ELT, EltVT, Tmp1,
- DAG.getConstant(Idx, PtrVT)));
- else
- Ops.push_back(DAG.getNode(ISD::EXTRACT_VECTOR_ELT, EltVT, Tmp2,
- DAG.getConstant(Idx - NumElems, PtrVT)));
- }
- }
- Result = DAG.getNode(ISD::BUILD_VECTOR, VT, &Ops[0], Ops.size());
- break;
- }
- case TargetLowering::Promote: {
- // Change base type to a different vector type.
- MVT::ValueType OVT = Node->getValueType(0);
- MVT::ValueType NVT = TLI.getTypeToPromoteTo(Node->getOpcode(), OVT);
-
- // Cast the two input vectors.
- Tmp1 = DAG.getNode(ISD::BIT_CONVERT, NVT, Tmp1);
- Tmp2 = DAG.getNode(ISD::BIT_CONVERT, NVT, Tmp2);
-
- // Convert the shuffle mask to the right # elements.
- Tmp3 = SDOperand(isShuffleLegal(OVT, Node->getOperand(2)), 0);
- assert(Tmp3.Val && "Shuffle not legal?");
- Result = DAG.getNode(ISD::VECTOR_SHUFFLE, NVT, Tmp1, Tmp2, Tmp3);
- Result = DAG.getNode(ISD::BIT_CONVERT, OVT, Result);
- break;
- }
- }
- break;
-
- case ISD::EXTRACT_VECTOR_ELT:
- Tmp1 = Node->getOperand(0);
- Tmp2 = LegalizeOp(Node->getOperand(1));
- Result = DAG.UpdateNodeOperands(Result, Tmp1, Tmp2);
- Result = ExpandEXTRACT_VECTOR_ELT(Result);
- break;
-
- case ISD::EXTRACT_SUBVECTOR:
- Tmp1 = Node->getOperand(0);
- Tmp2 = LegalizeOp(Node->getOperand(1));
- Result = DAG.UpdateNodeOperands(Result, Tmp1, Tmp2);
- Result = ExpandEXTRACT_SUBVECTOR(Result);
- break;
-
- case ISD::CALLSEQ_START: {
- SDNode *CallEnd = FindCallEndFromCallStart(Node);
-
- // Recursively Legalize all of the inputs of the call end that do not lead
- // to this call start. This ensures that any libcalls that need be inserted
- // are inserted *before* the CALLSEQ_START.
- {SmallPtrSet<SDNode*, 32> NodesLeadingTo;
- for (unsigned i = 0, e = CallEnd->getNumOperands(); i != e; ++i)
- LegalizeAllNodesNotLeadingTo(CallEnd->getOperand(i).Val, Node,
- NodesLeadingTo);
- }
-
- // Now that we legalized all of the inputs (which may have inserted
- // libcalls) create the new CALLSEQ_START node.
- Tmp1 = LegalizeOp(Node->getOperand(0)); // Legalize the chain.
-
- // Merge in the last call, to ensure that this call start after the last
- // call ended.
- if (LastCALLSEQ_END.getOpcode() != ISD::EntryToken) {
- Tmp1 = DAG.getNode(ISD::TokenFactor, MVT::Other, Tmp1, LastCALLSEQ_END);
- Tmp1 = LegalizeOp(Tmp1);
- }
-
- // Do not try to legalize the target-specific arguments (#1+).
- if (Tmp1 != Node->getOperand(0)) {
- SmallVector<SDOperand, 8> Ops(Node->op_begin(), Node->op_end());
- Ops[0] = Tmp1;
- Result = DAG.UpdateNodeOperands(Result, &Ops[0], Ops.size());
- }
-
- // Remember that the CALLSEQ_START is legalized.
- AddLegalizedOperand(Op.getValue(0), Result);
- if (Node->getNumValues() == 2) // If this has a flag result, remember it.
- AddLegalizedOperand(Op.getValue(1), Result.getValue(1));
-
- // Now that the callseq_start and all of the non-call nodes above this call
- // sequence have been legalized, legalize the call itself. During this
- // process, no libcalls can/will be inserted, guaranteeing that no calls
- // can overlap.
- assert(!IsLegalizingCall && "Inconsistent sequentialization of calls!");
- SDOperand InCallSEQ = LastCALLSEQ_END;
- // Note that we are selecting this call!
- LastCALLSEQ_END = SDOperand(CallEnd, 0);
- IsLegalizingCall = true;
-
- // Legalize the call, starting from the CALLSEQ_END.
- LegalizeOp(LastCALLSEQ_END);
- assert(!IsLegalizingCall && "CALLSEQ_END should have cleared this!");
- return Result;
- }
- case ISD::CALLSEQ_END:
- // If the CALLSEQ_START node hasn't been legalized first, legalize it. This
- // will cause this node to be legalized as well as handling libcalls right.
- if (LastCALLSEQ_END.Val != Node) {
- LegalizeOp(SDOperand(FindCallStartFromCallEnd(Node), 0));
- DenseMap<SDOperand, SDOperand>::iterator I = LegalizedNodes.find(Op);
- assert(I != LegalizedNodes.end() &&
- "Legalizing the call start should have legalized this node!");
- return I->second;
- }
-
- // Otherwise, the call start has been legalized and everything is going
- // according to plan. Just legalize ourselves normally here.
- Tmp1 = LegalizeOp(Node->getOperand(0)); // Legalize the chain.
- // Do not try to legalize the target-specific arguments (#1+), except for
- // an optional flag input.
- if (Node->getOperand(Node->getNumOperands()-1).getValueType() != MVT::Flag){
- if (Tmp1 != Node->getOperand(0)) {
- SmallVector<SDOperand, 8> Ops(Node->op_begin(), Node->op_end());
- Ops[0] = Tmp1;
- Result = DAG.UpdateNodeOperands(Result, &Ops[0], Ops.size());
- }
- } else {
- Tmp2 = LegalizeOp(Node->getOperand(Node->getNumOperands()-1));
- if (Tmp1 != Node->getOperand(0) ||
- Tmp2 != Node->getOperand(Node->getNumOperands()-1)) {
- SmallVector<SDOperand, 8> Ops(Node->op_begin(), Node->op_end());
- Ops[0] = Tmp1;
- Ops.back() = Tmp2;
- Result = DAG.UpdateNodeOperands(Result, &Ops[0], Ops.size());
- }
- }
- assert(IsLegalizingCall && "Call sequence imbalance between start/end?");
- // This finishes up call legalization.
- IsLegalizingCall = false;
-
- // If the CALLSEQ_END node has a flag, remember that we legalized it.
- AddLegalizedOperand(SDOperand(Node, 0), Result.getValue(0));
- if (Node->getNumValues() == 2)
- AddLegalizedOperand(SDOperand(Node, 1), Result.getValue(1));
- return Result.getValue(Op.ResNo);
- case ISD::DYNAMIC_STACKALLOC: {
- MVT::ValueType VT = Node->getValueType(0);
- Tmp1 = LegalizeOp(Node->getOperand(0)); // Legalize the chain.
- Tmp2 = LegalizeOp(Node->getOperand(1)); // Legalize the size.
- Tmp3 = LegalizeOp(Node->getOperand(2)); // Legalize the alignment.
- Result = DAG.UpdateNodeOperands(Result, Tmp1, Tmp2, Tmp3);
-
- Tmp1 = Result.getValue(0);
- Tmp2 = Result.getValue(1);
- switch (TLI.getOperationAction(Node->getOpcode(), VT)) {
- default: assert(0 && "This action is not supported yet!");
- case TargetLowering::Expand: {
- unsigned SPReg = TLI.getStackPointerRegisterToSaveRestore();
- assert(SPReg && "Target cannot require DYNAMIC_STACKALLOC expansion and"
- " not tell us which reg is the stack pointer!");
- SDOperand Chain = Tmp1.getOperand(0);
-
- // Chain the dynamic stack allocation so that it doesn't modify the stack
- // pointer when other instructions are using the stack.
- Chain = DAG.getCALLSEQ_START(Chain,
- DAG.getConstant(0, TLI.getPointerTy()));
-
- SDOperand Size = Tmp2.getOperand(1);
- SDOperand SP = DAG.getCopyFromReg(Chain, SPReg, VT);
- Chain = SP.getValue(1);
- unsigned Align = cast<ConstantSDNode>(Tmp3)->getValue();
- unsigned StackAlign =
- TLI.getTargetMachine().getFrameInfo()->getStackAlignment();
- if (Align > StackAlign)
- SP = DAG.getNode(ISD::AND, VT, SP,
- DAG.getConstant(-(uint64_t)Align, VT));
- Tmp1 = DAG.getNode(ISD::SUB, VT, SP, Size); // Value
- Chain = DAG.getCopyToReg(Chain, SPReg, Tmp1); // Output chain
-
- Tmp2 =
- DAG.getCALLSEQ_END(Chain,
- DAG.getConstant(0, TLI.getPointerTy()),
- DAG.getConstant(0, TLI.getPointerTy()),
- SDOperand());
-
- Tmp1 = LegalizeOp(Tmp1);
- Tmp2 = LegalizeOp(Tmp2);
- break;
- }
- case TargetLowering::Custom:
- Tmp3 = TLI.LowerOperation(Tmp1, DAG);
- if (Tmp3.Val) {
- Tmp1 = LegalizeOp(Tmp3);
- Tmp2 = LegalizeOp(Tmp3.getValue(1));
- }
- break;
- case TargetLowering::Legal:
- break;
- }
- // Since this op produce two values, make sure to remember that we
- // legalized both of them.
- AddLegalizedOperand(SDOperand(Node, 0), Tmp1);
- AddLegalizedOperand(SDOperand(Node, 1), Tmp2);
- return Op.ResNo ? Tmp2 : Tmp1;
- }
- case ISD::INLINEASM: {
- SmallVector<SDOperand, 8> Ops(Node->op_begin(), Node->op_end());
- bool Changed = false;
- // Legalize all of the operands of the inline asm, in case they are nodes
- // that need to be expanded or something. Note we skip the asm string and
- // all of the TargetConstant flags.
- SDOperand Op = LegalizeOp(Ops[0]);
- Changed = Op != Ops[0];
- Ops[0] = Op;
-
- bool HasInFlag = Ops.back().getValueType() == MVT::Flag;
- for (unsigned i = 2, e = Ops.size()-HasInFlag; i < e; ) {
- unsigned NumVals = cast<ConstantSDNode>(Ops[i])->getValue() >> 3;
- for (++i; NumVals; ++i, --NumVals) {
- SDOperand Op = LegalizeOp(Ops[i]);
- if (Op != Ops[i]) {
- Changed = true;
- Ops[i] = Op;
- }
- }
- }
-
- if (HasInFlag) {
- Op = LegalizeOp(Ops.back());
- Changed |= Op != Ops.back();
- Ops.back() = Op;
- }
-
- if (Changed)
- Result = DAG.UpdateNodeOperands(Result, &Ops[0], Ops.size());
-
- // INLINE asm returns a chain and flag, make sure to add both to the map.
- AddLegalizedOperand(SDOperand(Node, 0), Result.getValue(0));
- AddLegalizedOperand(SDOperand(Node, 1), Result.getValue(1));
- return Result.getValue(Op.ResNo);
- }
- case ISD::BR:
- Tmp1 = LegalizeOp(Node->getOperand(0)); // Legalize the chain.
- // Ensure that libcalls are emitted before a branch.
- Tmp1 = DAG.getNode(ISD::TokenFactor, MVT::Other, Tmp1, LastCALLSEQ_END);
- Tmp1 = LegalizeOp(Tmp1);
- LastCALLSEQ_END = DAG.getEntryNode();
-
- Result = DAG.UpdateNodeOperands(Result, Tmp1, Node->getOperand(1));
- break;
- case ISD::BRIND:
- Tmp1 = LegalizeOp(Node->getOperand(0)); // Legalize the chain.
- // Ensure that libcalls are emitted before a branch.
- Tmp1 = DAG.getNode(ISD::TokenFactor, MVT::Other, Tmp1, LastCALLSEQ_END);
- Tmp1 = LegalizeOp(Tmp1);
- LastCALLSEQ_END = DAG.getEntryNode();
-
- switch (getTypeAction(Node->getOperand(1).getValueType())) {
- default: assert(0 && "Indirect target must be legal type (pointer)!");
- case Legal:
- Tmp2 = LegalizeOp(Node->getOperand(1)); // Legalize the condition.
- break;
- }
- Result = DAG.UpdateNodeOperands(Result, Tmp1, Tmp2);
- break;
- case ISD::BR_JT:
- Tmp1 = LegalizeOp(Node->getOperand(0)); // Legalize the chain.
- // Ensure that libcalls are emitted before a branch.
- Tmp1 = DAG.getNode(ISD::TokenFactor, MVT::Other, Tmp1, LastCALLSEQ_END);
- Tmp1 = LegalizeOp(Tmp1);
- LastCALLSEQ_END = DAG.getEntryNode();
-
- Tmp2 = LegalizeOp(Node->getOperand(1)); // Legalize the jumptable node.
- Result = DAG.UpdateNodeOperands(Result, Tmp1, Tmp2, Node->getOperand(2));
-
- switch (TLI.getOperationAction(ISD::BR_JT, MVT::Other)) {
- default: assert(0 && "This action is not supported yet!");
- case TargetLowering::Legal: break;
- case TargetLowering::Custom:
- Tmp1 = TLI.LowerOperation(Result, DAG);
- if (Tmp1.Val) Result = Tmp1;
- break;
- case TargetLowering::Expand: {
- SDOperand Chain = Result.getOperand(0);
- SDOperand Table = Result.getOperand(1);
- SDOperand Index = Result.getOperand(2);
-
- MVT::ValueType PTy = TLI.getPointerTy();
- MachineFunction &MF = DAG.getMachineFunction();
- unsigned EntrySize = MF.getJumpTableInfo()->getEntrySize();
- Index= DAG.getNode(ISD::MUL, PTy, Index, DAG.getConstant(EntrySize, PTy));
- SDOperand Addr = DAG.getNode(ISD::ADD, PTy, Index, Table);
-
- SDOperand LD;
- switch (EntrySize) {
- default: assert(0 && "Size of jump table not supported yet."); break;
- case 4: LD = DAG.getLoad(MVT::i32, Chain, Addr,
- PseudoSourceValue::getJumpTable(), 0); break;
- case 8: LD = DAG.getLoad(MVT::i64, Chain, Addr,
- PseudoSourceValue::getJumpTable(), 0); break;
- }
-
- Addr = LD;
- if (TLI.getTargetMachine().getRelocationModel() == Reloc::PIC_) {
- // For PIC, the sequence is:
- // BRIND(load(Jumptable + index) + RelocBase)
- // RelocBase can be JumpTable, GOT or some sort of global base.
- if (PTy != MVT::i32)
- Addr = DAG.getNode(ISD::SIGN_EXTEND, PTy, Addr);
- Addr = DAG.getNode(ISD::ADD, PTy, Addr,
- TLI.getPICJumpTableRelocBase(Table, DAG));
- }
- Result = DAG.getNode(ISD::BRIND, MVT::Other, LD.getValue(1), Addr);
- }
- }
- break;
- case ISD::BRCOND:
- Tmp1 = LegalizeOp(Node->getOperand(0)); // Legalize the chain.
- // Ensure that libcalls are emitted before a return.
- Tmp1 = DAG.getNode(ISD::TokenFactor, MVT::Other, Tmp1, LastCALLSEQ_END);
- Tmp1 = LegalizeOp(Tmp1);
- LastCALLSEQ_END = DAG.getEntryNode();
-
- switch (getTypeAction(Node->getOperand(1).getValueType())) {
- case Expand: assert(0 && "It's impossible to expand bools");
- case Legal:
- Tmp2 = LegalizeOp(Node->getOperand(1)); // Legalize the condition.
- break;
- case Promote: {
- Tmp2 = PromoteOp(Node->getOperand(1)); // Promote the condition.
-
- // The top bits of the promoted condition are not necessarily zero, ensure
- // that the value is properly zero extended.
- unsigned BitWidth = Tmp2.getValueSizeInBits();
- if (!DAG.MaskedValueIsZero(Tmp2,
- APInt::getHighBitsSet(BitWidth, BitWidth-1)))
- Tmp2 = DAG.getZeroExtendInReg(Tmp2, MVT::i1);
- break;
- }
- }
-
- // Basic block destination (Op#2) is always legal.
- Result = DAG.UpdateNodeOperands(Result, Tmp1, Tmp2, Node->getOperand(2));
-
- switch (TLI.getOperationAction(ISD::BRCOND, MVT::Other)) {
- default: assert(0 && "This action is not supported yet!");
- case TargetLowering::Legal: break;
- case TargetLowering::Custom:
- Tmp1 = TLI.LowerOperation(Result, DAG);
- if (Tmp1.Val) Result = Tmp1;
- break;
- case TargetLowering::Expand:
- // Expand brcond's setcc into its constituent parts and create a BR_CC
- // Node.
- if (Tmp2.getOpcode() == ISD::SETCC) {
- Result = DAG.getNode(ISD::BR_CC, MVT::Other, Tmp1, Tmp2.getOperand(2),
- Tmp2.getOperand(0), Tmp2.getOperand(1),
- Node->getOperand(2));
- } else {
- Result = DAG.getNode(ISD::BR_CC, MVT::Other, Tmp1,
- DAG.getCondCode(ISD::SETNE), Tmp2,
- DAG.getConstant(0, Tmp2.getValueType()),
- Node->getOperand(2));
- }
- break;
- }
- break;
- case ISD::BR_CC:
- Tmp1 = LegalizeOp(Node->getOperand(0)); // Legalize the chain.
- // Ensure that libcalls are emitted before a branch.
- Tmp1 = DAG.getNode(ISD::TokenFactor, MVT::Other, Tmp1, LastCALLSEQ_END);
- Tmp1 = LegalizeOp(Tmp1);
- Tmp2 = Node->getOperand(2); // LHS
- Tmp3 = Node->getOperand(3); // RHS
- Tmp4 = Node->getOperand(1); // CC
-
- LegalizeSetCCOperands(Tmp2, Tmp3, Tmp4);
- LastCALLSEQ_END = DAG.getEntryNode();
-
- // If we didn't get both a LHS and RHS back from LegalizeSetCCOperands,
- // the LHS is a legal SETCC itself. In this case, we need to compare
- // the result against zero to select between true and false values.
- if (Tmp3.Val == 0) {
- Tmp3 = DAG.getConstant(0, Tmp2.getValueType());
- Tmp4 = DAG.getCondCode(ISD::SETNE);
- }
-
- Result = DAG.UpdateNodeOperands(Result, Tmp1, Tmp4, Tmp2, Tmp3,
- Node->getOperand(4));
-
- switch (TLI.getOperationAction(ISD::BR_CC, Tmp3.getValueType())) {
- default: assert(0 && "Unexpected action for BR_CC!");
- case TargetLowering::Legal: break;
- case TargetLowering::Custom:
- Tmp4 = TLI.LowerOperation(Result, DAG);
- if (Tmp4.Val) Result = Tmp4;
- break;
- }
- break;
- case ISD::LOAD: {
- LoadSDNode *LD = cast<LoadSDNode>(Node);
- Tmp1 = LegalizeOp(LD->getChain()); // Legalize the chain.
- Tmp2 = LegalizeOp(LD->getBasePtr()); // Legalize the base pointer.
-
- ISD::LoadExtType ExtType = LD->getExtensionType();
- if (ExtType == ISD::NON_EXTLOAD) {
- MVT::ValueType VT = Node->getValueType(0);
- Result = DAG.UpdateNodeOperands(Result, Tmp1, Tmp2, LD->getOffset());
- Tmp3 = Result.getValue(0);
- Tmp4 = Result.getValue(1);
-
- switch (TLI.getOperationAction(Node->getOpcode(), VT)) {
- default: assert(0 && "This action is not supported yet!");
- case TargetLowering::Legal:
- // If this is an unaligned load and the target doesn't support it,
- // expand it.
- if (!TLI.allowsUnalignedMemoryAccesses()) {
- unsigned ABIAlignment = TLI.getTargetData()->
- getABITypeAlignment(MVT::getTypeForValueType(LD->getMemoryVT()));
- if (LD->getAlignment() < ABIAlignment){
- Result = ExpandUnalignedLoad(cast<LoadSDNode>(Result.Val), DAG,
- TLI);
- Tmp3 = Result.getOperand(0);
- Tmp4 = Result.getOperand(1);
- Tmp3 = LegalizeOp(Tmp3);
- Tmp4 = LegalizeOp(Tmp4);
- }
- }
- break;
- case TargetLowering::Custom:
- Tmp1 = TLI.LowerOperation(Tmp3, DAG);
- if (Tmp1.Val) {
- Tmp3 = LegalizeOp(Tmp1);
- Tmp4 = LegalizeOp(Tmp1.getValue(1));
- }
- break;
- case TargetLowering::Promote: {
- // Only promote a load of vector type to another.
- assert(MVT::isVector(VT) && "Cannot promote this load!");
- // Change base type to a different vector type.
- MVT::ValueType NVT = TLI.getTypeToPromoteTo(Node->getOpcode(), VT);
-
- Tmp1 = DAG.getLoad(NVT, Tmp1, Tmp2, LD->getSrcValue(),
- LD->getSrcValueOffset(),
- LD->isVolatile(), LD->getAlignment());
- Tmp3 = LegalizeOp(DAG.getNode(ISD::BIT_CONVERT, VT, Tmp1));
- Tmp4 = LegalizeOp(Tmp1.getValue(1));
- break;
- }
- }
- // Since loads produce two values, make sure to remember that we
- // legalized both of them.
- AddLegalizedOperand(SDOperand(Node, 0), Tmp3);
- AddLegalizedOperand(SDOperand(Node, 1), Tmp4);
- return Op.ResNo ? Tmp4 : Tmp3;
- } else {
- MVT::ValueType SrcVT = LD->getMemoryVT();
- unsigned SrcWidth = MVT::getSizeInBits(SrcVT);
- int SVOffset = LD->getSrcValueOffset();
- unsigned Alignment = LD->getAlignment();
- bool isVolatile = LD->isVolatile();
-
- if (SrcWidth != MVT::getStoreSizeInBits(SrcVT) &&
- // Some targets pretend to have an i1 loading operation, and actually
- // load an i8. This trick is correct for ZEXTLOAD because the top 7
- // bits are guaranteed to be zero; it helps the optimizers understand
- // that these bits are zero. It is also useful for EXTLOAD, since it
- // tells the optimizers that those bits are undefined. It would be
- // nice to have an effective generic way of getting these benefits...
- // Until such a way is found, don't insist on promoting i1 here.
- (SrcVT != MVT::i1 ||
- TLI.getLoadXAction(ExtType, MVT::i1) == TargetLowering::Promote)) {
- // Promote to a byte-sized load if not loading an integral number of
- // bytes. For example, promote EXTLOAD:i20 -> EXTLOAD:i24.
- unsigned NewWidth = MVT::getStoreSizeInBits(SrcVT);
- MVT::ValueType NVT = MVT::getIntegerType(NewWidth);
- SDOperand Ch;
-
- // The extra bits are guaranteed to be zero, since we stored them that
- // way. A zext load from NVT thus automatically gives zext from SrcVT.
-
- ISD::LoadExtType NewExtType =
- ExtType == ISD::ZEXTLOAD ? ISD::ZEXTLOAD : ISD::EXTLOAD;
-
- Result = DAG.getExtLoad(NewExtType, Node->getValueType(0),
- Tmp1, Tmp2, LD->getSrcValue(), SVOffset,
- NVT, isVolatile, Alignment);
-
- Ch = Result.getValue(1); // The chain.
-
- if (ExtType == ISD::SEXTLOAD)
- // Having the top bits zero doesn't help when sign extending.
- Result = DAG.getNode(ISD::SIGN_EXTEND_INREG, Result.getValueType(),
- Result, DAG.getValueType(SrcVT));
- else if (ExtType == ISD::ZEXTLOAD || NVT == Result.getValueType())
- // All the top bits are guaranteed to be zero - inform the optimizers.
- Result = DAG.getNode(ISD::AssertZext, Result.getValueType(), Result,
- DAG.getValueType(SrcVT));
-
- Tmp1 = LegalizeOp(Result);
- Tmp2 = LegalizeOp(Ch);
- } else if (SrcWidth & (SrcWidth - 1)) {
- // If not loading a power-of-2 number of bits, expand as two loads.
- assert(MVT::isExtendedVT(SrcVT) && !MVT::isVector(SrcVT) &&
- "Unsupported extload!");
- unsigned RoundWidth = 1 << Log2_32(SrcWidth);
- assert(RoundWidth < SrcWidth);
- unsigned ExtraWidth = SrcWidth - RoundWidth;
- assert(ExtraWidth < RoundWidth);
- assert(!(RoundWidth % 8) && !(ExtraWidth % 8) &&
- "Load size not an integral number of bytes!");
- MVT::ValueType RoundVT = MVT::getIntegerType(RoundWidth);
- MVT::ValueType ExtraVT = MVT::getIntegerType(ExtraWidth);
- SDOperand Lo, Hi, Ch;
- unsigned IncrementSize;
-
- if (TLI.isLittleEndian()) {
- // EXTLOAD:i24 -> ZEXTLOAD:i16 | (shl EXTLOAD@+2:i8, 16)
- // Load the bottom RoundWidth bits.
- Lo = DAG.getExtLoad(ISD::ZEXTLOAD, Node->getValueType(0), Tmp1, Tmp2,
- LD->getSrcValue(), SVOffset, RoundVT, isVolatile,
- Alignment);
-
- // Load the remaining ExtraWidth bits.
- IncrementSize = RoundWidth / 8;
- Tmp2 = DAG.getNode(ISD::ADD, Tmp2.getValueType(), Tmp2,
- DAG.getIntPtrConstant(IncrementSize));
- Hi = DAG.getExtLoad(ExtType, Node->getValueType(0), Tmp1, Tmp2,
- LD->getSrcValue(), SVOffset + IncrementSize,
- ExtraVT, isVolatile,
- MinAlign(Alignment, IncrementSize));
-
- // Build a factor node to remember that this load is independent of the
- // other one.
- Ch = DAG.getNode(ISD::TokenFactor, MVT::Other, Lo.getValue(1),
- Hi.getValue(1));
-
- // Move the top bits to the right place.
- Hi = DAG.getNode(ISD::SHL, Hi.getValueType(), Hi,
- DAG.getConstant(RoundWidth, TLI.getShiftAmountTy()));
-
- // Join the hi and lo parts.
- Result = DAG.getNode(ISD::OR, Node->getValueType(0), Lo, Hi);
- } else {
- // Big endian - avoid unaligned loads.
- // EXTLOAD:i24 -> (shl EXTLOAD:i16, 8) | ZEXTLOAD@+2:i8
- // Load the top RoundWidth bits.
- Hi = DAG.getExtLoad(ExtType, Node->getValueType(0), Tmp1, Tmp2,
- LD->getSrcValue(), SVOffset, RoundVT, isVolatile,
- Alignment);
-
- // Load the remaining ExtraWidth bits.
- IncrementSize = RoundWidth / 8;
- Tmp2 = DAG.getNode(ISD::ADD, Tmp2.getValueType(), Tmp2,
- DAG.getIntPtrConstant(IncrementSize));
- Lo = DAG.getExtLoad(ISD::ZEXTLOAD, Node->getValueType(0), Tmp1, Tmp2,
- LD->getSrcValue(), SVOffset + IncrementSize,
- ExtraVT, isVolatile,
- MinAlign(Alignment, IncrementSize));
-
- // Build a factor node to remember that this load is independent of the
- // other one.
- Ch = DAG.getNode(ISD::TokenFactor, MVT::Other, Lo.getValue(1),
- Hi.getValue(1));
-
- // Move the top bits to the right place.
- Hi = DAG.getNode(ISD::SHL, Hi.getValueType(), Hi,
- DAG.getConstant(ExtraWidth, TLI.getShiftAmountTy()));
-
- // Join the hi and lo parts.
- Result = DAG.getNode(ISD::OR, Node->getValueType(0), Lo, Hi);
- }
-
- Tmp1 = LegalizeOp(Result);
- Tmp2 = LegalizeOp(Ch);
- } else {
- switch (TLI.getLoadXAction(ExtType, SrcVT)) {
- default: assert(0 && "This action is not supported yet!");
- case TargetLowering::Custom:
- isCustom = true;
- // FALLTHROUGH
- case TargetLowering::Legal:
- Result = DAG.UpdateNodeOperands(Result, Tmp1, Tmp2, LD->getOffset());
- Tmp1 = Result.getValue(0);
- Tmp2 = Result.getValue(1);
-
- if (isCustom) {
- Tmp3 = TLI.LowerOperation(Result, DAG);
- if (Tmp3.Val) {
- Tmp1 = LegalizeOp(Tmp3);
- Tmp2 = LegalizeOp(Tmp3.getValue(1));
- }
- } else {
- // If this is an unaligned load and the target doesn't support it,
- // expand it.
- if (!TLI.allowsUnalignedMemoryAccesses()) {
- unsigned ABIAlignment = TLI.getTargetData()->
- getABITypeAlignment(MVT::getTypeForValueType(LD->getMemoryVT()));
- if (LD->getAlignment() < ABIAlignment){
- Result = ExpandUnalignedLoad(cast<LoadSDNode>(Result.Val), DAG,
- TLI);
- Tmp1 = Result.getOperand(0);
- Tmp2 = Result.getOperand(1);
- Tmp1 = LegalizeOp(Tmp1);
- Tmp2 = LegalizeOp(Tmp2);
- }
- }
- }
- break;
- case TargetLowering::Expand:
- // f64 = EXTLOAD f32 should expand to LOAD, FP_EXTEND
- if (SrcVT == MVT::f32 && Node->getValueType(0) == MVT::f64) {
- SDOperand Load = DAG.getLoad(SrcVT, Tmp1, Tmp2, LD->getSrcValue(),
- LD->getSrcValueOffset(),
- LD->isVolatile(), LD->getAlignment());
- Result = DAG.getNode(ISD::FP_EXTEND, Node->getValueType(0), Load);
- Tmp1 = LegalizeOp(Result); // Relegalize new nodes.
- Tmp2 = LegalizeOp(Load.getValue(1));
- break;
- }
- assert(ExtType != ISD::EXTLOAD &&"EXTLOAD should always be supported!");
- // Turn the unsupported load into an EXTLOAD followed by an explicit
- // zero/sign extend inreg.
- Result = DAG.getExtLoad(ISD::EXTLOAD, Node->getValueType(0),
- Tmp1, Tmp2, LD->getSrcValue(),
- LD->getSrcValueOffset(), SrcVT,
- LD->isVolatile(), LD->getAlignment());
- SDOperand ValRes;
- if (ExtType == ISD::SEXTLOAD)
- ValRes = DAG.getNode(ISD::SIGN_EXTEND_INREG, Result.getValueType(),
- Result, DAG.getValueType(SrcVT));
- else
- ValRes = DAG.getZeroExtendInReg(Result, SrcVT);
- Tmp1 = LegalizeOp(ValRes); // Relegalize new nodes.
- Tmp2 = LegalizeOp(Result.getValue(1)); // Relegalize new nodes.
- break;
- }
- }
-
- // Since loads produce two values, make sure to remember that we legalized
- // both of them.
- AddLegalizedOperand(SDOperand(Node, 0), Tmp1);
- AddLegalizedOperand(SDOperand(Node, 1), Tmp2);
- return Op.ResNo ? Tmp2 : Tmp1;
- }
- }
- case ISD::EXTRACT_ELEMENT: {
- MVT::ValueType OpTy = Node->getOperand(0).getValueType();
- switch (getTypeAction(OpTy)) {
- default: assert(0 && "EXTRACT_ELEMENT action for type unimplemented!");
- case Legal:
- if (cast<ConstantSDNode>(Node->getOperand(1))->getValue()) {
- // 1 -> Hi
- Result = DAG.getNode(ISD::SRL, OpTy, Node->getOperand(0),
- DAG.getConstant(MVT::getSizeInBits(OpTy)/2,
- TLI.getShiftAmountTy()));
- Result = DAG.getNode(ISD::TRUNCATE, Node->getValueType(0), Result);
- } else {
- // 0 -> Lo
- Result = DAG.getNode(ISD::TRUNCATE, Node->getValueType(0),
- Node->getOperand(0));
- }
- break;
- case Expand:
- // Get both the low and high parts.
- ExpandOp(Node->getOperand(0), Tmp1, Tmp2);
- if (cast<ConstantSDNode>(Node->getOperand(1))->getValue())
- Result = Tmp2; // 1 -> Hi
- else
- Result = Tmp1; // 0 -> Lo
- break;
- }
- break;
- }
-
- case ISD::CopyToReg:
- Tmp1 = LegalizeOp(Node->getOperand(0)); // Legalize the chain.
-
- assert(isTypeLegal(Node->getOperand(2).getValueType()) &&
- "Register type must be legal!");
- // Legalize the incoming value (must be a legal type).
- Tmp2 = LegalizeOp(Node->getOperand(2));
- if (Node->getNumValues() == 1) {
- Result = DAG.UpdateNodeOperands(Result, Tmp1, Node->getOperand(1), Tmp2);
- } else {
- assert(Node->getNumValues() == 2 && "Unknown CopyToReg");
- if (Node->getNumOperands() == 4) {
- Tmp3 = LegalizeOp(Node->getOperand(3));
- Result = DAG.UpdateNodeOperands(Result, Tmp1, Node->getOperand(1), Tmp2,
- Tmp3);
- } else {
- Result = DAG.UpdateNodeOperands(Result, Tmp1, Node->getOperand(1),Tmp2);
- }
-
- // Since this produces two values, make sure to remember that we legalized
- // both of them.
- AddLegalizedOperand(SDOperand(Node, 0), Result.getValue(0));
- AddLegalizedOperand(SDOperand(Node, 1), Result.getValue(1));
- return Result;
- }
- break;
-
- case ISD::RET:
- Tmp1 = LegalizeOp(Node->getOperand(0)); // Legalize the chain.
-
- // Ensure that libcalls are emitted before a return.
- Tmp1 = DAG.getNode(ISD::TokenFactor, MVT::Other, Tmp1, LastCALLSEQ_END);
- Tmp1 = LegalizeOp(Tmp1);
- LastCALLSEQ_END = DAG.getEntryNode();
-
- switch (Node->getNumOperands()) {
- case 3: // ret val
- Tmp2 = Node->getOperand(1);
- Tmp3 = Node->getOperand(2); // Signness
- switch (getTypeAction(Tmp2.getValueType())) {
- case Legal:
- Result = DAG.UpdateNodeOperands(Result, Tmp1, LegalizeOp(Tmp2), Tmp3);
- break;
- case Expand:
- if (!MVT::isVector(Tmp2.getValueType())) {
- SDOperand Lo, Hi;
- ExpandOp(Tmp2, Lo, Hi);
-
- // Big endian systems want the hi reg first.
- if (TLI.isBigEndian())
- std::swap(Lo, Hi);
-
- if (Hi.Val)
- Result = DAG.getNode(ISD::RET, MVT::Other, Tmp1, Lo, Tmp3, Hi,Tmp3);
- else
- Result = DAG.getNode(ISD::RET, MVT::Other, Tmp1, Lo, Tmp3);
- Result = LegalizeOp(Result);
- } else {
- SDNode *InVal = Tmp2.Val;
- int InIx = Tmp2.ResNo;
- unsigned NumElems = MVT::getVectorNumElements(InVal->getValueType(InIx));
- MVT::ValueType EVT = MVT::getVectorElementType(InVal->getValueType(InIx));
-
- // Figure out if there is a simple type corresponding to this Vector
- // type. If so, convert to the vector type.
- MVT::ValueType TVT = MVT::getVectorType(EVT, NumElems);
- if (TLI.isTypeLegal(TVT)) {
- // Turn this into a return of the vector type.
- Tmp2 = LegalizeOp(Tmp2);
- Result = DAG.UpdateNodeOperands(Result, Tmp1, Tmp2, Tmp3);
- } else if (NumElems == 1) {
- // Turn this into a return of the scalar type.
- Tmp2 = ScalarizeVectorOp(Tmp2);
- Tmp2 = LegalizeOp(Tmp2);
- Result = DAG.UpdateNodeOperands(Result, Tmp1, Tmp2, Tmp3);
-
- // FIXME: Returns of gcc generic vectors smaller than a legal type
- // should be returned in integer registers!
-
- // The scalarized value type may not be legal, e.g. it might require
- // promotion or expansion. Relegalize the return.
- Result = LegalizeOp(Result);
- } else {
- // FIXME: Returns of gcc generic vectors larger than a legal vector
- // type should be returned by reference!
- SDOperand Lo, Hi;
- SplitVectorOp(Tmp2, Lo, Hi);
- Result = DAG.getNode(ISD::RET, MVT::Other, Tmp1, Lo, Tmp3, Hi,Tmp3);
- Result = LegalizeOp(Result);
- }
- }
- break;
- case Promote:
- Tmp2 = PromoteOp(Node->getOperand(1));
- Result = DAG.UpdateNodeOperands(Result, Tmp1, Tmp2, Tmp3);
- Result = LegalizeOp(Result);
- break;
- }
- break;
- case 1: // ret void
- Result = DAG.UpdateNodeOperands(Result, Tmp1);
- break;
- default: { // ret <values>
- SmallVector<SDOperand, 8> NewValues;
- NewValues.push_back(Tmp1);
- for (unsigned i = 1, e = Node->getNumOperands(); i < e; i += 2)
- switch (getTypeAction(Node->getOperand(i).getValueType())) {
- case Legal:
- NewValues.push_back(LegalizeOp(Node->getOperand(i)));
- NewValues.push_back(Node->getOperand(i+1));
- break;
- case Expand: {
- SDOperand Lo, Hi;
- assert(!MVT::isExtendedVT(Node->getOperand(i).getValueType()) &&
- "FIXME: TODO: implement returning non-legal vector types!");
- ExpandOp(Node->getOperand(i), Lo, Hi);
- NewValues.push_back(Lo);
- NewValues.push_back(Node->getOperand(i+1));
- if (Hi.Val) {
- NewValues.push_back(Hi);
- NewValues.push_back(Node->getOperand(i+1));
- }
- break;
- }
- case Promote:
- assert(0 && "Can't promote multiple return value yet!");
- }
-
- if (NewValues.size() == Node->getNumOperands())
- Result = DAG.UpdateNodeOperands(Result, &NewValues[0],NewValues.size());
- else
- Result = DAG.getNode(ISD::RET, MVT::Other,
- &NewValues[0], NewValues.size());
- break;
- }
- }
-
- if (Result.getOpcode() == ISD::RET) {
- switch (TLI.getOperationAction(Result.getOpcode(), MVT::Other)) {
- default: assert(0 && "This action is not supported yet!");
- case TargetLowering::Legal: break;
- case TargetLowering::Custom:
- Tmp1 = TLI.LowerOperation(Result, DAG);
- if (Tmp1.Val) Result = Tmp1;
- break;
- }
- }
- break;
- case ISD::STORE: {
- StoreSDNode *ST = cast<StoreSDNode>(Node);
- Tmp1 = LegalizeOp(ST->getChain()); // Legalize the chain.
- Tmp2 = LegalizeOp(ST->getBasePtr()); // Legalize the pointer.
- int SVOffset = ST->getSrcValueOffset();
- unsigned Alignment = ST->getAlignment();
- bool isVolatile = ST->isVolatile();
-
- if (!ST->isTruncatingStore()) {
- // Turn 'store float 1.0, Ptr' -> 'store int 0x12345678, Ptr'
- // FIXME: We shouldn't do this for TargetConstantFP's.
- // FIXME: move this to the DAG Combiner! Note that we can't regress due
- // to phase ordering between legalized code and the dag combiner. This
- // probably means that we need to integrate dag combiner and legalizer
- // together.
- // We generally can't do this one for long doubles.
- if (ConstantFPSDNode *CFP = dyn_cast<ConstantFPSDNode>(ST->getValue())) {
- if (CFP->getValueType(0) == MVT::f32 &&
- getTypeAction(MVT::i32) == Legal) {
- Tmp3 = DAG.getConstant(CFP->getValueAPF().
- convertToAPInt().zextOrTrunc(32),
- MVT::i32);
- Result = DAG.getStore(Tmp1, Tmp3, Tmp2, ST->getSrcValue(),
- SVOffset, isVolatile, Alignment);
- break;
- } else if (CFP->getValueType(0) == MVT::f64) {
- // If this target supports 64-bit registers, do a single 64-bit store.
- if (getTypeAction(MVT::i64) == Legal) {
- Tmp3 = DAG.getConstant(CFP->getValueAPF().convertToAPInt().
- zextOrTrunc(64), MVT::i64);
- Result = DAG.getStore(Tmp1, Tmp3, Tmp2, ST->getSrcValue(),
- SVOffset, isVolatile, Alignment);
- break;
- } else if (getTypeAction(MVT::i32) == Legal) {
- // Otherwise, if the target supports 32-bit registers, use 2 32-bit
- // stores. If the target supports neither 32- nor 64-bits, this
- // xform is certainly not worth it.
- const APInt &IntVal =CFP->getValueAPF().convertToAPInt();
- SDOperand Lo = DAG.getConstant(APInt(IntVal).trunc(32), MVT::i32);
- SDOperand Hi = DAG.getConstant(IntVal.lshr(32).trunc(32), MVT::i32);
- if (TLI.isBigEndian()) std::swap(Lo, Hi);
-
- Lo = DAG.getStore(Tmp1, Lo, Tmp2, ST->getSrcValue(),
- SVOffset, isVolatile, Alignment);
- Tmp2 = DAG.getNode(ISD::ADD, Tmp2.getValueType(), Tmp2,
- DAG.getIntPtrConstant(4));
- Hi = DAG.getStore(Tmp1, Hi, Tmp2, ST->getSrcValue(), SVOffset+4,
- isVolatile, MinAlign(Alignment, 4U));
-
- Result = DAG.getNode(ISD::TokenFactor, MVT::Other, Lo, Hi);
- break;
- }
- }
- }
-
- switch (getTypeAction(ST->getMemoryVT())) {
- case Legal: {
- Tmp3 = LegalizeOp(ST->getValue());
- Result = DAG.UpdateNodeOperands(Result, Tmp1, Tmp3, Tmp2,
- ST->getOffset());
-
- MVT::ValueType VT = Tmp3.getValueType();
- switch (TLI.getOperationAction(ISD::STORE, VT)) {
- default: assert(0 && "This action is not supported yet!");
- case TargetLowering::Legal:
- // If this is an unaligned store and the target doesn't support it,
- // expand it.
- if (!TLI.allowsUnalignedMemoryAccesses()) {
- unsigned ABIAlignment = TLI.getTargetData()->
- getABITypeAlignment(MVT::getTypeForValueType(ST->getMemoryVT()));
- if (ST->getAlignment() < ABIAlignment)
- Result = ExpandUnalignedStore(cast<StoreSDNode>(Result.Val), DAG,
- TLI);
- }
- break;
- case TargetLowering::Custom:
- Tmp1 = TLI.LowerOperation(Result, DAG);
- if (Tmp1.Val) Result = Tmp1;
- break;
- case TargetLowering::Promote:
- assert(MVT::isVector(VT) && "Unknown legal promote case!");
- Tmp3 = DAG.getNode(ISD::BIT_CONVERT,
- TLI.getTypeToPromoteTo(ISD::STORE, VT), Tmp3);
- Result = DAG.getStore(Tmp1, Tmp3, Tmp2,
- ST->getSrcValue(), SVOffset, isVolatile,
- Alignment);
- break;
- }
- break;
- }
- case Promote:
- // Truncate the value and store the result.
- Tmp3 = PromoteOp(ST->getValue());
- Result = DAG.getTruncStore(Tmp1, Tmp3, Tmp2, ST->getSrcValue(),
- SVOffset, ST->getMemoryVT(),
- isVolatile, Alignment);
- break;
-
- case Expand:
- unsigned IncrementSize = 0;
- SDOperand Lo, Hi;
-
- // If this is a vector type, then we have to calculate the increment as
- // the product of the element size in bytes, and the number of elements
- // in the high half of the vector.
- if (MVT::isVector(ST->getValue().getValueType())) {
- SDNode *InVal = ST->getValue().Val;
- int InIx = ST->getValue().ResNo;
- MVT::ValueType InVT = InVal->getValueType(InIx);
- unsigned NumElems = MVT::getVectorNumElements(InVT);
- MVT::ValueType EVT = MVT::getVectorElementType(InVT);
-
- // Figure out if there is a simple type corresponding to this Vector
- // type. If so, convert to the vector type.
- MVT::ValueType TVT = MVT::getVectorType(EVT, NumElems);
- if (TLI.isTypeLegal(TVT)) {
- // Turn this into a normal store of the vector type.
- Tmp3 = LegalizeOp(ST->getValue());
- Result = DAG.getStore(Tmp1, Tmp3, Tmp2, ST->getSrcValue(),
- SVOffset, isVolatile, Alignment);
- Result = LegalizeOp(Result);
- break;
- } else if (NumElems == 1) {
- // Turn this into a normal store of the scalar type.
- Tmp3 = ScalarizeVectorOp(ST->getValue());
- Result = DAG.getStore(Tmp1, Tmp3, Tmp2, ST->getSrcValue(),
- SVOffset, isVolatile, Alignment);
- // The scalarized value type may not be legal, e.g. it might require
- // promotion or expansion. Relegalize the scalar store.
- Result = LegalizeOp(Result);
- break;
- } else {
- SplitVectorOp(ST->getValue(), Lo, Hi);
- IncrementSize = MVT::getVectorNumElements(Lo.Val->getValueType(0)) *
- MVT::getSizeInBits(EVT)/8;
- }
- } else {
- ExpandOp(ST->getValue(), Lo, Hi);
- IncrementSize = Hi.Val ? MVT::getSizeInBits(Hi.getValueType())/8 : 0;
-
- if (TLI.isBigEndian())
- std::swap(Lo, Hi);
- }
-
- Lo = DAG.getStore(Tmp1, Lo, Tmp2, ST->getSrcValue(),
- SVOffset, isVolatile, Alignment);
-
- if (Hi.Val == NULL) {
- // Must be int <-> float one-to-one expansion.
- Result = Lo;
- break;
- }
-
- Tmp2 = DAG.getNode(ISD::ADD, Tmp2.getValueType(), Tmp2,
- DAG.getIntPtrConstant(IncrementSize));
- assert(isTypeLegal(Tmp2.getValueType()) &&
- "Pointers must be legal!");
- SVOffset += IncrementSize;
- Alignment = MinAlign(Alignment, IncrementSize);
- Hi = DAG.getStore(Tmp1, Hi, Tmp2, ST->getSrcValue(),
- SVOffset, isVolatile, Alignment);
- Result = DAG.getNode(ISD::TokenFactor, MVT::Other, Lo, Hi);
- break;
- }
- } else {
- switch (getTypeAction(ST->getValue().getValueType())) {
- case Legal:
- Tmp3 = LegalizeOp(ST->getValue());
- break;
- case Promote:
- // We can promote the value, the truncstore will still take care of it.
- Tmp3 = PromoteOp(ST->getValue());
- break;
- case Expand:
- // Just store the low part. This may become a non-trunc store, so make
- // sure to use getTruncStore, not UpdateNodeOperands below.
- ExpandOp(ST->getValue(), Tmp3, Tmp4);
- return DAG.getTruncStore(Tmp1, Tmp3, Tmp2, ST->getSrcValue(),
- SVOffset, MVT::i8, isVolatile, Alignment);
- }
-
- MVT::ValueType StVT = ST->getMemoryVT();
- unsigned StWidth = MVT::getSizeInBits(StVT);
-
- if (StWidth != MVT::getStoreSizeInBits(StVT)) {
- // Promote to a byte-sized store with upper bits zero if not
- // storing an integral number of bytes. For example, promote
- // TRUNCSTORE:i1 X -> TRUNCSTORE:i8 (and X, 1)
- MVT::ValueType NVT = MVT::getIntegerType(MVT::getStoreSizeInBits(StVT));
- Tmp3 = DAG.getZeroExtendInReg(Tmp3, StVT);
- Result = DAG.getTruncStore(Tmp1, Tmp3, Tmp2, ST->getSrcValue(),
- SVOffset, NVT, isVolatile, Alignment);
- } else if (StWidth & (StWidth - 1)) {
- // If not storing a power-of-2 number of bits, expand as two stores.
- assert(MVT::isExtendedVT(StVT) && !MVT::isVector(StVT) &&
- "Unsupported truncstore!");
- unsigned RoundWidth = 1 << Log2_32(StWidth);
- assert(RoundWidth < StWidth);
- unsigned ExtraWidth = StWidth - RoundWidth;
- assert(ExtraWidth < RoundWidth);
- assert(!(RoundWidth % 8) && !(ExtraWidth % 8) &&
- "Store size not an integral number of bytes!");
- MVT::ValueType RoundVT = MVT::getIntegerType(RoundWidth);
- MVT::ValueType ExtraVT = MVT::getIntegerType(ExtraWidth);
- SDOperand Lo, Hi;
- unsigned IncrementSize;
-
- if (TLI.isLittleEndian()) {
- // TRUNCSTORE:i24 X -> TRUNCSTORE:i16 X, TRUNCSTORE@+2:i8 (srl X, 16)
- // Store the bottom RoundWidth bits.
- Lo = DAG.getTruncStore(Tmp1, Tmp3, Tmp2, ST->getSrcValue(),
- SVOffset, RoundVT,
- isVolatile, Alignment);
-
- // Store the remaining ExtraWidth bits.
- IncrementSize = RoundWidth / 8;
- Tmp2 = DAG.getNode(ISD::ADD, Tmp2.getValueType(), Tmp2,
- DAG.getIntPtrConstant(IncrementSize));
- Hi = DAG.getNode(ISD::SRL, Tmp3.getValueType(), Tmp3,
- DAG.getConstant(RoundWidth, TLI.getShiftAmountTy()));
- Hi = DAG.getTruncStore(Tmp1, Hi, Tmp2, ST->getSrcValue(),
- SVOffset + IncrementSize, ExtraVT, isVolatile,
- MinAlign(Alignment, IncrementSize));
- } else {
- // Big endian - avoid unaligned stores.
- // TRUNCSTORE:i24 X -> TRUNCSTORE:i16 (srl X, 8), TRUNCSTORE@+2:i8 X
- // Store the top RoundWidth bits.
- Hi = DAG.getNode(ISD::SRL, Tmp3.getValueType(), Tmp3,
- DAG.getConstant(ExtraWidth, TLI.getShiftAmountTy()));
- Hi = DAG.getTruncStore(Tmp1, Hi, Tmp2, ST->getSrcValue(), SVOffset,
- RoundVT, isVolatile, Alignment);
-
- // Store the remaining ExtraWidth bits.
- IncrementSize = RoundWidth / 8;
- Tmp2 = DAG.getNode(ISD::ADD, Tmp2.getValueType(), Tmp2,
- DAG.getIntPtrConstant(IncrementSize));
- Lo = DAG.getTruncStore(Tmp1, Tmp3, Tmp2, ST->getSrcValue(),
- SVOffset + IncrementSize, ExtraVT, isVolatile,
- MinAlign(Alignment, IncrementSize));
- }
-
- // The order of the stores doesn't matter.
- Result = DAG.getNode(ISD::TokenFactor, MVT::Other, Lo, Hi);
- } else {
- if (Tmp1 != ST->getChain() || Tmp3 != ST->getValue() ||
- Tmp2 != ST->getBasePtr())
- Result = DAG.UpdateNodeOperands(Result, Tmp1, Tmp3, Tmp2,
- ST->getOffset());
-
- switch (TLI.getTruncStoreAction(ST->getValue().getValueType(), StVT)) {
- default: assert(0 && "This action is not supported yet!");
- case TargetLowering::Legal:
- // If this is an unaligned store and the target doesn't support it,
- // expand it.
- if (!TLI.allowsUnalignedMemoryAccesses()) {
- unsigned ABIAlignment = TLI.getTargetData()->
- getABITypeAlignment(MVT::getTypeForValueType(ST->getMemoryVT()));
- if (ST->getAlignment() < ABIAlignment)
- Result = ExpandUnalignedStore(cast<StoreSDNode>(Result.Val), DAG,
- TLI);
- }
- break;
- case TargetLowering::Custom:
- Result = TLI.LowerOperation(Result, DAG);
- break;
- case Expand:
- // TRUNCSTORE:i16 i32 -> STORE i16
- assert(isTypeLegal(StVT) && "Do not know how to expand this store!");
- Tmp3 = DAG.getNode(ISD::TRUNCATE, StVT, Tmp3);
- Result = DAG.getStore(Tmp1, Tmp3, Tmp2, ST->getSrcValue(), SVOffset,
- isVolatile, Alignment);
- break;
- }
- }
- }
- break;
- }
- case ISD::PCMARKER:
- Tmp1 = LegalizeOp(Node->getOperand(0)); // Legalize the chain.
- Result = DAG.UpdateNodeOperands(Result, Tmp1, Node->getOperand(1));
- break;
- case ISD::STACKSAVE:
- Tmp1 = LegalizeOp(Node->getOperand(0)); // Legalize the chain.
- Result = DAG.UpdateNodeOperands(Result, Tmp1);
- Tmp1 = Result.getValue(0);
- Tmp2 = Result.getValue(1);
-
- switch (TLI.getOperationAction(ISD::STACKSAVE, MVT::Other)) {
- default: assert(0 && "This action is not supported yet!");
- case TargetLowering::Legal: break;
- case TargetLowering::Custom:
- Tmp3 = TLI.LowerOperation(Result, DAG);
- if (Tmp3.Val) {
- Tmp1 = LegalizeOp(Tmp3);
- Tmp2 = LegalizeOp(Tmp3.getValue(1));
- }
- break;
- case TargetLowering::Expand:
- // Expand to CopyFromReg if the target set
- // StackPointerRegisterToSaveRestore.
- if (unsigned SP = TLI.getStackPointerRegisterToSaveRestore()) {
- Tmp1 = DAG.getCopyFromReg(Result.getOperand(0), SP,
- Node->getValueType(0));
- Tmp2 = Tmp1.getValue(1);
- } else {
- Tmp1 = DAG.getNode(ISD::UNDEF, Node->getValueType(0));
- Tmp2 = Node->getOperand(0);
- }
- break;
- }
-
- // Since stacksave produce two values, make sure to remember that we
- // legalized both of them.
- AddLegalizedOperand(SDOperand(Node, 0), Tmp1);
- AddLegalizedOperand(SDOperand(Node, 1), Tmp2);
- return Op.ResNo ? Tmp2 : Tmp1;
-
- case ISD::STACKRESTORE:
- Tmp1 = LegalizeOp(Node->getOperand(0)); // Legalize the chain.
- Tmp2 = LegalizeOp(Node->getOperand(1)); // Legalize the pointer.
- Result = DAG.UpdateNodeOperands(Result, Tmp1, Tmp2);
-
- switch (TLI.getOperationAction(ISD::STACKRESTORE, MVT::Other)) {
- default: assert(0 && "This action is not supported yet!");
- case TargetLowering::Legal: break;
- case TargetLowering::Custom:
- Tmp1 = TLI.LowerOperation(Result, DAG);
- if (Tmp1.Val) Result = Tmp1;
- break;
- case TargetLowering::Expand:
- // Expand to CopyToReg if the target set
- // StackPointerRegisterToSaveRestore.
- if (unsigned SP = TLI.getStackPointerRegisterToSaveRestore()) {
- Result = DAG.getCopyToReg(Tmp1, SP, Tmp2);
- } else {
- Result = Tmp1;
- }
- break;
- }
- break;
-
- case ISD::READCYCLECOUNTER:
- Tmp1 = LegalizeOp(Node->getOperand(0)); // Legalize the chain
- Result = DAG.UpdateNodeOperands(Result, Tmp1);
- switch (TLI.getOperationAction(ISD::READCYCLECOUNTER,
- Node->getValueType(0))) {
- default: assert(0 && "This action is not supported yet!");
- case TargetLowering::Legal:
- Tmp1 = Result.getValue(0);
- Tmp2 = Result.getValue(1);
- break;
- case TargetLowering::Custom:
- Result = TLI.LowerOperation(Result, DAG);
- Tmp1 = LegalizeOp(Result.getValue(0));
- Tmp2 = LegalizeOp(Result.getValue(1));
- break;
- }
-
- // Since rdcc produce two values, make sure to remember that we legalized
- // both of them.
- AddLegalizedOperand(SDOperand(Node, 0), Tmp1);
- AddLegalizedOperand(SDOperand(Node, 1), Tmp2);
- return Result;
-
- case ISD::SELECT:
- switch (getTypeAction(Node->getOperand(0).getValueType())) {
- case Expand: assert(0 && "It's impossible to expand bools");
- case Legal:
- Tmp1 = LegalizeOp(Node->getOperand(0)); // Legalize the condition.
- break;
- case Promote: {
- Tmp1 = PromoteOp(Node->getOperand(0)); // Promote the condition.
- // Make sure the condition is either zero or one.
- unsigned BitWidth = Tmp1.getValueSizeInBits();
- if (!DAG.MaskedValueIsZero(Tmp1,
- APInt::getHighBitsSet(BitWidth, BitWidth-1)))
- Tmp1 = DAG.getZeroExtendInReg(Tmp1, MVT::i1);
- break;
- }
- }
- Tmp2 = LegalizeOp(Node->getOperand(1)); // TrueVal
- Tmp3 = LegalizeOp(Node->getOperand(2)); // FalseVal
-
- Result = DAG.UpdateNodeOperands(Result, Tmp1, Tmp2, Tmp3);
-
- switch (TLI.getOperationAction(ISD::SELECT, Tmp2.getValueType())) {
- default: assert(0 && "This action is not supported yet!");
- case TargetLowering::Legal: break;
- case TargetLowering::Custom: {
- Tmp1 = TLI.LowerOperation(Result, DAG);
- if (Tmp1.Val) Result = Tmp1;
- break;
- }
- case TargetLowering::Expand:
- if (Tmp1.getOpcode() == ISD::SETCC) {
- Result = DAG.getSelectCC(Tmp1.getOperand(0), Tmp1.getOperand(1),
- Tmp2, Tmp3,
- cast<CondCodeSDNode>(Tmp1.getOperand(2))->get());
- } else {
- Result = DAG.getSelectCC(Tmp1,
- DAG.getConstant(0, Tmp1.getValueType()),
- Tmp2, Tmp3, ISD::SETNE);
- }
- break;
- case TargetLowering::Promote: {
- MVT::ValueType NVT =
- TLI.getTypeToPromoteTo(ISD::SELECT, Tmp2.getValueType());
- unsigned ExtOp, TruncOp;
- if (MVT::isVector(Tmp2.getValueType())) {
- ExtOp = ISD::BIT_CONVERT;
- TruncOp = ISD::BIT_CONVERT;
- } else if (MVT::isInteger(Tmp2.getValueType())) {
- ExtOp = ISD::ANY_EXTEND;
- TruncOp = ISD::TRUNCATE;
- } else {
- ExtOp = ISD::FP_EXTEND;
- TruncOp = ISD::FP_ROUND;
- }
- // Promote each of the values to the new type.
- Tmp2 = DAG.getNode(ExtOp, NVT, Tmp2);
- Tmp3 = DAG.getNode(ExtOp, NVT, Tmp3);
- // Perform the larger operation, then round down.
- Result = DAG.getNode(ISD::SELECT, NVT, Tmp1, Tmp2,Tmp3);
- if (TruncOp != ISD::FP_ROUND)
- Result = DAG.getNode(TruncOp, Node->getValueType(0), Result);
- else
- Result = DAG.getNode(TruncOp, Node->getValueType(0), Result,
- DAG.getIntPtrConstant(0));
- break;
- }
- }
- break;
- case ISD::SELECT_CC: {
- Tmp1 = Node->getOperand(0); // LHS
- Tmp2 = Node->getOperand(1); // RHS
- Tmp3 = LegalizeOp(Node->getOperand(2)); // True
- Tmp4 = LegalizeOp(Node->getOperand(3)); // False
- SDOperand CC = Node->getOperand(4);
-
- LegalizeSetCCOperands(Tmp1, Tmp2, CC);
-
- // If we didn't get both a LHS and RHS back from LegalizeSetCCOperands,
- // the LHS is a legal SETCC itself. In this case, we need to compare
- // the result against zero to select between true and false values.
- if (Tmp2.Val == 0) {
- Tmp2 = DAG.getConstant(0, Tmp1.getValueType());
- CC = DAG.getCondCode(ISD::SETNE);
- }
- Result = DAG.UpdateNodeOperands(Result, Tmp1, Tmp2, Tmp3, Tmp4, CC);
-
- // Everything is legal, see if we should expand this op or something.
- switch (TLI.getOperationAction(ISD::SELECT_CC, Tmp3.getValueType())) {
- default: assert(0 && "This action is not supported yet!");
- case TargetLowering::Legal: break;
- case TargetLowering::Custom:
- Tmp1 = TLI.LowerOperation(Result, DAG);
- if (Tmp1.Val) Result = Tmp1;
- break;
- }
- break;
- }
- case ISD::SETCC:
- Tmp1 = Node->getOperand(0);
- Tmp2 = Node->getOperand(1);
- Tmp3 = Node->getOperand(2);
- LegalizeSetCCOperands(Tmp1, Tmp2, Tmp3);
-
- // If we had to Expand the SetCC operands into a SELECT node, then it may
- // not always be possible to return a true LHS & RHS. In this case, just
- // return the value we legalized, returned in the LHS
- if (Tmp2.Val == 0) {
- Result = Tmp1;
- break;
- }
-
- switch (TLI.getOperationAction(ISD::SETCC, Tmp1.getValueType())) {
- default: assert(0 && "Cannot handle this action for SETCC yet!");
- case TargetLowering::Custom:
- isCustom = true;
- // FALLTHROUGH.
- case TargetLowering::Legal:
- Result = DAG.UpdateNodeOperands(Result, Tmp1, Tmp2, Tmp3);
- if (isCustom) {
- Tmp4 = TLI.LowerOperation(Result, DAG);
- if (Tmp4.Val) Result = Tmp4;
- }
- break;
- case TargetLowering::Promote: {
- // First step, figure out the appropriate operation to use.
- // Allow SETCC to not be supported for all legal data types
- // Mostly this targets FP
- MVT::ValueType NewInTy = Node->getOperand(0).getValueType();
- MVT::ValueType OldVT = NewInTy; OldVT = OldVT;
-
- // Scan for the appropriate larger type to use.
- while (1) {
- NewInTy = (MVT::ValueType)(NewInTy+1);
-
- assert(MVT::isInteger(NewInTy) == MVT::isInteger(OldVT) &&
- "Fell off of the edge of the integer world");
- assert(MVT::isFloatingPoint(NewInTy) == MVT::isFloatingPoint(OldVT) &&
- "Fell off of the edge of the floating point world");
-
- // If the target supports SETCC of this type, use it.
- if (TLI.isOperationLegal(ISD::SETCC, NewInTy))
- break;
- }
- if (MVT::isInteger(NewInTy))
- assert(0 && "Cannot promote Legal Integer SETCC yet");
- else {
- Tmp1 = DAG.getNode(ISD::FP_EXTEND, NewInTy, Tmp1);
- Tmp2 = DAG.getNode(ISD::FP_EXTEND, NewInTy, Tmp2);
- }
- Tmp1 = LegalizeOp(Tmp1);
- Tmp2 = LegalizeOp(Tmp2);
- Result = DAG.UpdateNodeOperands(Result, Tmp1, Tmp2, Tmp3);
- Result = LegalizeOp(Result);
- break;
- }
- case TargetLowering::Expand:
- // Expand a setcc node into a select_cc of the same condition, lhs, and
- // rhs that selects between const 1 (true) and const 0 (false).
- MVT::ValueType VT = Node->getValueType(0);
- Result = DAG.getNode(ISD::SELECT_CC, VT, Tmp1, Tmp2,
- DAG.getConstant(1, VT), DAG.getConstant(0, VT),
- Tmp3);
- break;
- }
- break;
-
- case ISD::SHL_PARTS:
- case ISD::SRA_PARTS:
- case ISD::SRL_PARTS: {
- SmallVector<SDOperand, 8> Ops;
- bool Changed = false;
- for (unsigned i = 0, e = Node->getNumOperands(); i != e; ++i) {
- Ops.push_back(LegalizeOp(Node->getOperand(i)));
- Changed |= Ops.back() != Node->getOperand(i);
- }
- if (Changed)
- Result = DAG.UpdateNodeOperands(Result, &Ops[0], Ops.size());
-
- switch (TLI.getOperationAction(Node->getOpcode(),
- Node->getValueType(0))) {
- default: assert(0 && "This action is not supported yet!");
- case TargetLowering::Legal: break;
- case TargetLowering::Custom:
- Tmp1 = TLI.LowerOperation(Result, DAG);
- if (Tmp1.Val) {
- SDOperand Tmp2, RetVal(0, 0);
- for (unsigned i = 0, e = Node->getNumValues(); i != e; ++i) {
- Tmp2 = LegalizeOp(Tmp1.getValue(i));
- AddLegalizedOperand(SDOperand(Node, i), Tmp2);
- if (i == Op.ResNo)
- RetVal = Tmp2;
- }
- assert(RetVal.Val && "Illegal result number");
- return RetVal;
- }
- break;
- }
-
- // Since these produce multiple values, make sure to remember that we
- // legalized all of them.
- for (unsigned i = 0, e = Node->getNumValues(); i != e; ++i)
- AddLegalizedOperand(SDOperand(Node, i), Result.getValue(i));
- return Result.getValue(Op.ResNo);
- }
-
- // Binary operators
- case ISD::ADD:
- case ISD::SUB:
- case ISD::MUL:
- case ISD::MULHS:
- case ISD::MULHU:
- case ISD::UDIV:
- case ISD::SDIV:
- case ISD::AND:
- case ISD::OR:
- case ISD::XOR:
- case ISD::SHL:
- case ISD::SRL:
- case ISD::SRA:
- case ISD::FADD:
- case ISD::FSUB:
- case ISD::FMUL:
- case ISD::FDIV:
- case ISD::FPOW:
- Tmp1 = LegalizeOp(Node->getOperand(0)); // LHS
- switch (getTypeAction(Node->getOperand(1).getValueType())) {
- case Expand: assert(0 && "Not possible");
- case Legal:
- Tmp2 = LegalizeOp(Node->getOperand(1)); // Legalize the RHS.
- break;
- case Promote:
- Tmp2 = PromoteOp(Node->getOperand(1)); // Promote the RHS.
- break;
- }
-
- Result = DAG.UpdateNodeOperands(Result, Tmp1, Tmp2);
-
- switch (TLI.getOperationAction(Node->getOpcode(), Node->getValueType(0))) {
- default: assert(0 && "BinOp legalize operation not supported");
- case TargetLowering::Legal: break;
- case TargetLowering::Custom:
- Tmp1 = TLI.LowerOperation(Result, DAG);
- if (Tmp1.Val) Result = Tmp1;
- break;
- case TargetLowering::Expand: {
- MVT::ValueType VT = Op.getValueType();
-
- // See if multiply or divide can be lowered using two-result operations.
- SDVTList VTs = DAG.getVTList(VT, VT);
- if (Node->getOpcode() == ISD::MUL) {
- // We just need the low half of the multiply; try both the signed
- // and unsigned forms. If the target supports both SMUL_LOHI and
- // UMUL_LOHI, form a preference by checking which forms of plain
- // MULH it supports.
- bool HasSMUL_LOHI = TLI.isOperationLegal(ISD::SMUL_LOHI, VT);
- bool HasUMUL_LOHI = TLI.isOperationLegal(ISD::UMUL_LOHI, VT);
- bool HasMULHS = TLI.isOperationLegal(ISD::MULHS, VT);
- bool HasMULHU = TLI.isOperationLegal(ISD::MULHU, VT);
- unsigned OpToUse = 0;
- if (HasSMUL_LOHI && !HasMULHS) {
- OpToUse = ISD::SMUL_LOHI;
- } else if (HasUMUL_LOHI && !HasMULHU) {
- OpToUse = ISD::UMUL_LOHI;
- } else if (HasSMUL_LOHI) {
- OpToUse = ISD::SMUL_LOHI;
- } else if (HasUMUL_LOHI) {
- OpToUse = ISD::UMUL_LOHI;
- }
- if (OpToUse) {
- Result = SDOperand(DAG.getNode(OpToUse, VTs, Tmp1, Tmp2).Val, 0);
- break;
- }
- }
- if (Node->getOpcode() == ISD::MULHS &&
- TLI.isOperationLegal(ISD::SMUL_LOHI, VT)) {
- Result = SDOperand(DAG.getNode(ISD::SMUL_LOHI, VTs, Tmp1, Tmp2).Val, 1);
- break;
- }
- if (Node->getOpcode() == ISD::MULHU &&
- TLI.isOperationLegal(ISD::UMUL_LOHI, VT)) {
- Result = SDOperand(DAG.getNode(ISD::UMUL_LOHI, VTs, Tmp1, Tmp2).Val, 1);
- break;
- }
- if (Node->getOpcode() == ISD::SDIV &&
- TLI.isOperationLegal(ISD::SDIVREM, VT)) {
- Result = SDOperand(DAG.getNode(ISD::SDIVREM, VTs, Tmp1, Tmp2).Val, 0);
- break;
- }
- if (Node->getOpcode() == ISD::UDIV &&
- TLI.isOperationLegal(ISD::UDIVREM, VT)) {
- Result = SDOperand(DAG.getNode(ISD::UDIVREM, VTs, Tmp1, Tmp2).Val, 0);
- break;
- }
-
- // Check to see if we have a libcall for this operator.
- RTLIB::Libcall LC = RTLIB::UNKNOWN_LIBCALL;
- bool isSigned = false;
- switch (Node->getOpcode()) {
- case ISD::UDIV:
- case ISD::SDIV:
- if (VT == MVT::i32) {
- LC = Node->getOpcode() == ISD::UDIV
- ? RTLIB::UDIV_I32 : RTLIB::SDIV_I32;
- isSigned = Node->getOpcode() == ISD::SDIV;
- }
- break;
- case ISD::FPOW:
- LC = GetFPLibCall(VT, RTLIB::POW_F32, RTLIB::POW_F64, RTLIB::POW_F80,
- RTLIB::POW_PPCF128);
- break;
- default: break;
- }
- if (LC != RTLIB::UNKNOWN_LIBCALL) {
- SDOperand Dummy;
- Result = ExpandLibCall(LC, Node, isSigned, Dummy);
- break;
- }
-
- assert(MVT::isVector(Node->getValueType(0)) &&
- "Cannot expand this binary operator!");
- // Expand the operation into a bunch of nasty scalar code.
- Result = LegalizeOp(UnrollVectorOp(Op));
- break;
- }
- case TargetLowering::Promote: {
- switch (Node->getOpcode()) {
- default: assert(0 && "Do not know how to promote this BinOp!");
- case ISD::AND:
- case ISD::OR:
- case ISD::XOR: {
- MVT::ValueType OVT = Node->getValueType(0);
- MVT::ValueType NVT = TLI.getTypeToPromoteTo(Node->getOpcode(), OVT);
- assert(MVT::isVector(OVT) && "Cannot promote this BinOp!");
- // Bit convert each of the values to the new type.
- Tmp1 = DAG.getNode(ISD::BIT_CONVERT, NVT, Tmp1);
- Tmp2 = DAG.getNode(ISD::BIT_CONVERT, NVT, Tmp2);
- Result = DAG.getNode(Node->getOpcode(), NVT, Tmp1, Tmp2);
- // Bit convert the result back the original type.
- Result = DAG.getNode(ISD::BIT_CONVERT, OVT, Result);
- break;
- }
- }
- }
- }
- break;
-
- case ISD::SMUL_LOHI:
- case ISD::UMUL_LOHI:
- case ISD::SDIVREM:
- case ISD::UDIVREM:
- // These nodes will only be produced by target-specific lowering, so
- // they shouldn't be here if they aren't legal.
- assert(TLI.isOperationLegal(Node->getOpcode(), Node->getValueType(0)) &&
- "This must be legal!");
-
- Tmp1 = LegalizeOp(Node->getOperand(0)); // LHS
- Tmp2 = LegalizeOp(Node->getOperand(1)); // RHS
- Result = DAG.UpdateNodeOperands(Result, Tmp1, Tmp2);
- break;
-
- case ISD::FCOPYSIGN: // FCOPYSIGN does not require LHS/RHS to match type!
- Tmp1 = LegalizeOp(Node->getOperand(0)); // LHS
- switch (getTypeAction(Node->getOperand(1).getValueType())) {
- case Expand: assert(0 && "Not possible");
- case Legal:
- Tmp2 = LegalizeOp(Node->getOperand(1)); // Legalize the RHS.
- break;
- case Promote:
- Tmp2 = PromoteOp(Node->getOperand(1)); // Promote the RHS.
- break;
- }
-
- Result = DAG.UpdateNodeOperands(Result, Tmp1, Tmp2);
-
- switch (TLI.getOperationAction(Node->getOpcode(), Node->getValueType(0))) {
- default: assert(0 && "Operation not supported");
- case TargetLowering::Custom:
- Tmp1 = TLI.LowerOperation(Result, DAG);
- if (Tmp1.Val) Result = Tmp1;
- break;
- case TargetLowering::Legal: break;
- case TargetLowering::Expand: {
- // If this target supports fabs/fneg natively and select is cheap,
- // do this efficiently.
- if (!TLI.isSelectExpensive() &&
- TLI.getOperationAction(ISD::FABS, Tmp1.getValueType()) ==
- TargetLowering::Legal &&
- TLI.getOperationAction(ISD::FNEG, Tmp1.getValueType()) ==
- TargetLowering::Legal) {
- // Get the sign bit of the RHS.
- MVT::ValueType IVT =
- Tmp2.getValueType() == MVT::f32 ? MVT::i32 : MVT::i64;
- SDOperand SignBit = DAG.getNode(ISD::BIT_CONVERT, IVT, Tmp2);
- SignBit = DAG.getSetCC(TLI.getSetCCResultType(SignBit),
- SignBit, DAG.getConstant(0, IVT), ISD::SETLT);
- // Get the absolute value of the result.
- SDOperand AbsVal = DAG.getNode(ISD::FABS, Tmp1.getValueType(), Tmp1);
- // Select between the nabs and abs value based on the sign bit of
- // the input.
- Result = DAG.getNode(ISD::SELECT, AbsVal.getValueType(), SignBit,
- DAG.getNode(ISD::FNEG, AbsVal.getValueType(),
- AbsVal),
- AbsVal);
- Result = LegalizeOp(Result);
- break;
- }
-
- // Otherwise, do bitwise ops!
- MVT::ValueType NVT =
- Node->getValueType(0) == MVT::f32 ? MVT::i32 : MVT::i64;
- Result = ExpandFCOPYSIGNToBitwiseOps(Node, NVT, DAG, TLI);
- Result = DAG.getNode(ISD::BIT_CONVERT, Node->getValueType(0), Result);
- Result = LegalizeOp(Result);
- break;
- }
- }
- break;
-
- case ISD::ADDC:
- case ISD::SUBC:
- Tmp1 = LegalizeOp(Node->getOperand(0));
- Tmp2 = LegalizeOp(Node->getOperand(1));
- Result = DAG.UpdateNodeOperands(Result, Tmp1, Tmp2);
- // Since this produces two values, make sure to remember that we legalized
- // both of them.
- AddLegalizedOperand(SDOperand(Node, 0), Result.getValue(0));
- AddLegalizedOperand(SDOperand(Node, 1), Result.getValue(1));
- return Result;
-
- case ISD::ADDE:
- case ISD::SUBE:
- Tmp1 = LegalizeOp(Node->getOperand(0));
- Tmp2 = LegalizeOp(Node->getOperand(1));
- Tmp3 = LegalizeOp(Node->getOperand(2));
- Result = DAG.UpdateNodeOperands(Result, Tmp1, Tmp2, Tmp3);
- // Since this produces two values, make sure to remember that we legalized
- // both of them.
- AddLegalizedOperand(SDOperand(Node, 0), Result.getValue(0));
- AddLegalizedOperand(SDOperand(Node, 1), Result.getValue(1));
- return Result;
-
- case ISD::BUILD_PAIR: {
- MVT::ValueType PairTy = Node->getValueType(0);
- // TODO: handle the case where the Lo and Hi operands are not of legal type
- Tmp1 = LegalizeOp(Node->getOperand(0)); // Lo
- Tmp2 = LegalizeOp(Node->getOperand(1)); // Hi
- switch (TLI.getOperationAction(ISD::BUILD_PAIR, PairTy)) {
- case TargetLowering::Promote:
- case TargetLowering::Custom:
- assert(0 && "Cannot promote/custom this yet!");
- case TargetLowering::Legal:
- if (Tmp1 != Node->getOperand(0) || Tmp2 != Node->getOperand(1))
- Result = DAG.getNode(ISD::BUILD_PAIR, PairTy, Tmp1, Tmp2);
- break;
- case TargetLowering::Expand:
- Tmp1 = DAG.getNode(ISD::ZERO_EXTEND, PairTy, Tmp1);
- Tmp2 = DAG.getNode(ISD::ANY_EXTEND, PairTy, Tmp2);
- Tmp2 = DAG.getNode(ISD::SHL, PairTy, Tmp2,
- DAG.getConstant(MVT::getSizeInBits(PairTy)/2,
- TLI.getShiftAmountTy()));
- Result = DAG.getNode(ISD::OR, PairTy, Tmp1, Tmp2);
- break;
- }
- break;
- }
-
- case ISD::UREM:
- case ISD::SREM:
- case ISD::FREM:
- Tmp1 = LegalizeOp(Node->getOperand(0)); // LHS
- Tmp2 = LegalizeOp(Node->getOperand(1)); // RHS
-
- switch (TLI.getOperationAction(Node->getOpcode(), Node->getValueType(0))) {
- case TargetLowering::Promote: assert(0 && "Cannot promote this yet!");
- case TargetLowering::Custom:
- isCustom = true;
- // FALLTHROUGH
- case TargetLowering::Legal:
- Result = DAG.UpdateNodeOperands(Result, Tmp1, Tmp2);
- if (isCustom) {
- Tmp1 = TLI.LowerOperation(Result, DAG);
- if (Tmp1.Val) Result = Tmp1;
- }
- break;
- case TargetLowering::Expand: {
- unsigned DivOpc= (Node->getOpcode() == ISD::UREM) ? ISD::UDIV : ISD::SDIV;
- bool isSigned = DivOpc == ISD::SDIV;
- MVT::ValueType VT = Node->getValueType(0);
-
- // See if remainder can be lowered using two-result operations.
- SDVTList VTs = DAG.getVTList(VT, VT);
- if (Node->getOpcode() == ISD::SREM &&
- TLI.isOperationLegal(ISD::SDIVREM, VT)) {
- Result = SDOperand(DAG.getNode(ISD::SDIVREM, VTs, Tmp1, Tmp2).Val, 1);
- break;
- }
- if (Node->getOpcode() == ISD::UREM &&
- TLI.isOperationLegal(ISD::UDIVREM, VT)) {
- Result = SDOperand(DAG.getNode(ISD::UDIVREM, VTs, Tmp1, Tmp2).Val, 1);
- break;
- }
-
- if (MVT::isInteger(VT)) {
- if (TLI.getOperationAction(DivOpc, VT) ==
- TargetLowering::Legal) {
- // X % Y -> X-X/Y*Y
- Result = DAG.getNode(DivOpc, VT, Tmp1, Tmp2);
- Result = DAG.getNode(ISD::MUL, VT, Result, Tmp2);
- Result = DAG.getNode(ISD::SUB, VT, Tmp1, Result);
- } else if (MVT::isVector(VT)) {
- Result = LegalizeOp(UnrollVectorOp(Op));
- } else {
- assert(VT == MVT::i32 &&
- "Cannot expand this binary operator!");
- RTLIB::Libcall LC = Node->getOpcode() == ISD::UREM
- ? RTLIB::UREM_I32 : RTLIB::SREM_I32;
- SDOperand Dummy;
- Result = ExpandLibCall(LC, Node, isSigned, Dummy);
- }
- } else {
- assert(MVT::isFloatingPoint(VT) &&
- "remainder op must have integer or floating-point type");
- if (MVT::isVector(VT)) {
- Result = LegalizeOp(UnrollVectorOp(Op));
- } else {
- // Floating point mod -> fmod libcall.
- RTLIB::Libcall LC = GetFPLibCall(VT, RTLIB::REM_F32, RTLIB::REM_F64,
- RTLIB::REM_F80, RTLIB::REM_PPCF128);
- SDOperand Dummy;
- Result = ExpandLibCall(LC, Node, false/*sign irrelevant*/, Dummy);
- }
- }
- break;
- }
- }
- break;
- case ISD::VAARG: {
- Tmp1 = LegalizeOp(Node->getOperand(0)); // Legalize the chain.
- Tmp2 = LegalizeOp(Node->getOperand(1)); // Legalize the pointer.
-
- MVT::ValueType VT = Node->getValueType(0);
- switch (TLI.getOperationAction(Node->getOpcode(), MVT::Other)) {
- default: assert(0 && "This action is not supported yet!");
- case TargetLowering::Custom:
- isCustom = true;
- // FALLTHROUGH
- case TargetLowering::Legal:
- Result = DAG.UpdateNodeOperands(Result, Tmp1, Tmp2, Node->getOperand(2));
- Result = Result.getValue(0);
- Tmp1 = Result.getValue(1);
-
- if (isCustom) {
- Tmp2 = TLI.LowerOperation(Result, DAG);
- if (Tmp2.Val) {
- Result = LegalizeOp(Tmp2);
- Tmp1 = LegalizeOp(Tmp2.getValue(1));
- }
- }
- break;
- case TargetLowering::Expand: {
- const Value *V = cast<SrcValueSDNode>(Node->getOperand(2))->getValue();
- SDOperand VAList = DAG.getLoad(TLI.getPointerTy(), Tmp1, Tmp2, V, 0);
- // Increment the pointer, VAList, to the next vaarg
- Tmp3 = DAG.getNode(ISD::ADD, TLI.getPointerTy(), VAList,
- DAG.getConstant(MVT::getSizeInBits(VT)/8,
- TLI.getPointerTy()));
- // Store the incremented VAList to the legalized pointer
- Tmp3 = DAG.getStore(VAList.getValue(1), Tmp3, Tmp2, V, 0);
- // Load the actual argument out of the pointer VAList
- Result = DAG.getLoad(VT, Tmp3, VAList, NULL, 0);
- Tmp1 = LegalizeOp(Result.getValue(1));
- Result = LegalizeOp(Result);
- break;
- }
- }
- // Since VAARG produces two values, make sure to remember that we
- // legalized both of them.
- AddLegalizedOperand(SDOperand(Node, 0), Result);
- AddLegalizedOperand(SDOperand(Node, 1), Tmp1);
- return Op.ResNo ? Tmp1 : Result;
- }
-
- case ISD::VACOPY:
- Tmp1 = LegalizeOp(Node->getOperand(0)); // Legalize the chain.
- Tmp2 = LegalizeOp(Node->getOperand(1)); // Legalize the dest pointer.
- Tmp3 = LegalizeOp(Node->getOperand(2)); // Legalize the source pointer.
-
- switch (TLI.getOperationAction(ISD::VACOPY, MVT::Other)) {
- default: assert(0 && "This action is not supported yet!");
- case TargetLowering::Custom:
- isCustom = true;
- // FALLTHROUGH
- case TargetLowering::Legal:
- Result = DAG.UpdateNodeOperands(Result, Tmp1, Tmp2, Tmp3,
- Node->getOperand(3), Node->getOperand(4));
- if (isCustom) {
- Tmp1 = TLI.LowerOperation(Result, DAG);
- if (Tmp1.Val) Result = Tmp1;
- }
- break;
- case TargetLowering::Expand:
- // This defaults to loading a pointer from the input and storing it to the
- // output, returning the chain.
- const Value *VD = cast<SrcValueSDNode>(Node->getOperand(3))->getValue();
- const Value *VS = cast<SrcValueSDNode>(Node->getOperand(4))->getValue();
- Tmp4 = DAG.getLoad(TLI.getPointerTy(), Tmp1, Tmp3, VS, 0);
- Result = DAG.getStore(Tmp4.getValue(1), Tmp4, Tmp2, VD, 0);
- break;
- }
- break;
-
- case ISD::VAEND:
- Tmp1 = LegalizeOp(Node->getOperand(0)); // Legalize the chain.
- Tmp2 = LegalizeOp(Node->getOperand(1)); // Legalize the pointer.
-
- switch (TLI.getOperationAction(ISD::VAEND, MVT::Other)) {
- default: assert(0 && "This action is not supported yet!");
- case TargetLowering::Custom:
- isCustom = true;
- // FALLTHROUGH
- case TargetLowering::Legal:
- Result = DAG.UpdateNodeOperands(Result, Tmp1, Tmp2, Node->getOperand(2));
- if (isCustom) {
- Tmp1 = TLI.LowerOperation(Tmp1, DAG);
- if (Tmp1.Val) Result = Tmp1;
- }
- break;
- case TargetLowering::Expand:
- Result = Tmp1; // Default to a no-op, return the chain
- break;
- }
- break;
-
- case ISD::VASTART:
- Tmp1 = LegalizeOp(Node->getOperand(0)); // Legalize the chain.
- Tmp2 = LegalizeOp(Node->getOperand(1)); // Legalize the pointer.
-
- Result = DAG.UpdateNodeOperands(Result, Tmp1, Tmp2, Node->getOperand(2));
-
- switch (TLI.getOperationAction(ISD::VASTART, MVT::Other)) {
- default: assert(0 && "This action is not supported yet!");
- case TargetLowering::Legal: break;
- case TargetLowering::Custom:
- Tmp1 = TLI.LowerOperation(Result, DAG);
- if (Tmp1.Val) Result = Tmp1;
- break;
- }
- break;
-
- case ISD::ROTL:
- case ISD::ROTR:
- Tmp1 = LegalizeOp(Node->getOperand(0)); // LHS
- Tmp2 = LegalizeOp(Node->getOperand(1)); // RHS
- Result = DAG.UpdateNodeOperands(Result, Tmp1, Tmp2);
- switch (TLI.getOperationAction(Node->getOpcode(), Node->getValueType(0))) {
- default:
- assert(0 && "ROTL/ROTR legalize operation not supported");
- break;
- case TargetLowering::Legal:
- break;
- case TargetLowering::Custom:
- Tmp1 = TLI.LowerOperation(Result, DAG);
- if (Tmp1.Val) Result = Tmp1;
- break;
- case TargetLowering::Promote:
- assert(0 && "Do not know how to promote ROTL/ROTR");
- break;
- case TargetLowering::Expand:
- assert(0 && "Do not know how to expand ROTL/ROTR");
- break;
- }
- break;
-
- case ISD::BSWAP:
- Tmp1 = LegalizeOp(Node->getOperand(0)); // Op
- switch (TLI.getOperationAction(Node->getOpcode(), Node->getValueType(0))) {
- case TargetLowering::Custom:
- assert(0 && "Cannot custom legalize this yet!");
- case TargetLowering::Legal:
- Result = DAG.UpdateNodeOperands(Result, Tmp1);
- break;
- case TargetLowering::Promote: {
- MVT::ValueType OVT = Tmp1.getValueType();
- MVT::ValueType NVT = TLI.getTypeToPromoteTo(Node->getOpcode(), OVT);
- unsigned DiffBits = MVT::getSizeInBits(NVT) - MVT::getSizeInBits(OVT);
-
- Tmp1 = DAG.getNode(ISD::ZERO_EXTEND, NVT, Tmp1);
- Tmp1 = DAG.getNode(ISD::BSWAP, NVT, Tmp1);
- Result = DAG.getNode(ISD::SRL, NVT, Tmp1,
- DAG.getConstant(DiffBits, TLI.getShiftAmountTy()));
- break;
- }
- case TargetLowering::Expand:
- Result = ExpandBSWAP(Tmp1);
- break;
- }
- break;
-
- case ISD::CTPOP:
- case ISD::CTTZ:
- case ISD::CTLZ:
- Tmp1 = LegalizeOp(Node->getOperand(0)); // Op
- switch (TLI.getOperationAction(Node->getOpcode(), Node->getValueType(0))) {
- case TargetLowering::Custom:
- case TargetLowering::Legal:
- Result = DAG.UpdateNodeOperands(Result, Tmp1);
- if (TLI.getOperationAction(Node->getOpcode(), Node->getValueType(0)) ==
- TargetLowering::Custom) {
- Tmp1 = TLI.LowerOperation(Result, DAG);
- if (Tmp1.Val) {
- Result = Tmp1;
- }
- }
- break;
- case TargetLowering::Promote: {
- MVT::ValueType OVT = Tmp1.getValueType();
- MVT::ValueType NVT = TLI.getTypeToPromoteTo(Node->getOpcode(), OVT);
-
- // Zero extend the argument.
- Tmp1 = DAG.getNode(ISD::ZERO_EXTEND, NVT, Tmp1);
- // Perform the larger operation, then subtract if needed.
- Tmp1 = DAG.getNode(Node->getOpcode(), Node->getValueType(0), Tmp1);
- switch (Node->getOpcode()) {
- case ISD::CTPOP:
- Result = Tmp1;
- break;
- case ISD::CTTZ:
- //if Tmp1 == sizeinbits(NVT) then Tmp1 = sizeinbits(Old VT)
- Tmp2 = DAG.getSetCC(TLI.getSetCCResultType(Tmp1), Tmp1,
- DAG.getConstant(MVT::getSizeInBits(NVT), NVT),
- ISD::SETEQ);
- Result = DAG.getNode(ISD::SELECT, NVT, Tmp2,
- DAG.getConstant(MVT::getSizeInBits(OVT),NVT), Tmp1);
- break;
- case ISD::CTLZ:
- // Tmp1 = Tmp1 - (sizeinbits(NVT) - sizeinbits(Old VT))
- Result = DAG.getNode(ISD::SUB, NVT, Tmp1,
- DAG.getConstant(MVT::getSizeInBits(NVT) -
- MVT::getSizeInBits(OVT), NVT));
- break;
- }
- break;
- }
- case TargetLowering::Expand:
- Result = ExpandBitCount(Node->getOpcode(), Tmp1);
- break;
- }
- break;
-
- // Unary operators
- case ISD::FABS:
- case ISD::FNEG:
- case ISD::FSQRT:
- case ISD::FSIN:
- case ISD::FCOS:
- Tmp1 = LegalizeOp(Node->getOperand(0));
- switch (TLI.getOperationAction(Node->getOpcode(), Node->getValueType(0))) {
- case TargetLowering::Promote:
- case TargetLowering::Custom:
- isCustom = true;
- // FALLTHROUGH
- case TargetLowering::Legal:
- Result = DAG.UpdateNodeOperands(Result, Tmp1);
- if (isCustom) {
- Tmp1 = TLI.LowerOperation(Result, DAG);
- if (Tmp1.Val) Result = Tmp1;
- }
- break;
- case TargetLowering::Expand:
- switch (Node->getOpcode()) {
- default: assert(0 && "Unreachable!");
- case ISD::FNEG:
- // Expand Y = FNEG(X) -> Y = SUB -0.0, X
- Tmp2 = DAG.getConstantFP(-0.0, Node->getValueType(0));
- Result = DAG.getNode(ISD::FSUB, Node->getValueType(0), Tmp2, Tmp1);
- break;
- case ISD::FABS: {
- // Expand Y = FABS(X) -> Y = (X >u 0.0) ? X : fneg(X).
- MVT::ValueType VT = Node->getValueType(0);
- Tmp2 = DAG.getConstantFP(0.0, VT);
- Tmp2 = DAG.getSetCC(TLI.getSetCCResultType(Tmp1), Tmp1, Tmp2,
- ISD::SETUGT);
- Tmp3 = DAG.getNode(ISD::FNEG, VT, Tmp1);
- Result = DAG.getNode(ISD::SELECT, VT, Tmp2, Tmp1, Tmp3);
- break;
- }
- case ISD::FSQRT:
- case ISD::FSIN:
- case ISD::FCOS: {
- MVT::ValueType VT = Node->getValueType(0);
-
- // Expand unsupported unary vector operators by unrolling them.
- if (MVT::isVector(VT)) {
- Result = LegalizeOp(UnrollVectorOp(Op));
- break;
- }
-
- RTLIB::Libcall LC = RTLIB::UNKNOWN_LIBCALL;
- switch(Node->getOpcode()) {
- case ISD::FSQRT:
- LC = GetFPLibCall(VT, RTLIB::SQRT_F32, RTLIB::SQRT_F64,
- RTLIB::SQRT_F80, RTLIB::SQRT_PPCF128);
- break;
- case ISD::FSIN:
- LC = GetFPLibCall(VT, RTLIB::SIN_F32, RTLIB::SIN_F64,
- RTLIB::SIN_F80, RTLIB::SIN_PPCF128);
- break;
- case ISD::FCOS:
- LC = GetFPLibCall(VT, RTLIB::COS_F32, RTLIB::COS_F64,
- RTLIB::COS_F80, RTLIB::COS_PPCF128);
- break;
- default: assert(0 && "Unreachable!");
- }
- SDOperand Dummy;
- Result = ExpandLibCall(LC, Node, false/*sign irrelevant*/, Dummy);
- break;
- }
- }
- break;
- }
- break;
- case ISD::FPOWI: {
- MVT::ValueType VT = Node->getValueType(0);
-
- // Expand unsupported unary vector operators by unrolling them.
- if (MVT::isVector(VT)) {
- Result = LegalizeOp(UnrollVectorOp(Op));
- break;
- }
-
- // We always lower FPOWI into a libcall. No target support for it yet.
- RTLIB::Libcall LC = GetFPLibCall(VT, RTLIB::POWI_F32, RTLIB::POWI_F64,
- RTLIB::POWI_F80, RTLIB::POWI_PPCF128);
- SDOperand Dummy;
- Result = ExpandLibCall(LC, Node, false/*sign irrelevant*/, Dummy);
- break;
- }
- case ISD::BIT_CONVERT:
- if (!isTypeLegal(Node->getOperand(0).getValueType())) {
- Result = EmitStackConvert(Node->getOperand(0), Node->getValueType(0),
- Node->getValueType(0));
- } else if (MVT::isVector(Op.getOperand(0).getValueType())) {
- // The input has to be a vector type, we have to either scalarize it, pack
- // it, or convert it based on whether the input vector type is legal.
- SDNode *InVal = Node->getOperand(0).Val;
- int InIx = Node->getOperand(0).ResNo;
- unsigned NumElems = MVT::getVectorNumElements(InVal->getValueType(InIx));
- MVT::ValueType EVT = MVT::getVectorElementType(InVal->getValueType(InIx));
-
- // Figure out if there is a simple type corresponding to this Vector
- // type. If so, convert to the vector type.
- MVT::ValueType TVT = MVT::getVectorType(EVT, NumElems);
- if (TLI.isTypeLegal(TVT)) {
- // Turn this into a bit convert of the vector input.
- Result = DAG.getNode(ISD::BIT_CONVERT, Node->getValueType(0),
- LegalizeOp(Node->getOperand(0)));
- break;
- } else if (NumElems == 1) {
- // Turn this into a bit convert of the scalar input.
- Result = DAG.getNode(ISD::BIT_CONVERT, Node->getValueType(0),
- ScalarizeVectorOp(Node->getOperand(0)));
- break;
- } else {
- // FIXME: UNIMP! Store then reload
- assert(0 && "Cast from unsupported vector type not implemented yet!");
- }
- } else {
- switch (TLI.getOperationAction(ISD::BIT_CONVERT,
- Node->getOperand(0).getValueType())) {
- default: assert(0 && "Unknown operation action!");
- case TargetLowering::Expand:
- Result = EmitStackConvert(Node->getOperand(0), Node->getValueType(0),
- Node->getValueType(0));
- break;
- case TargetLowering::Legal:
- Tmp1 = LegalizeOp(Node->getOperand(0));
- Result = DAG.UpdateNodeOperands(Result, Tmp1);
- break;
- }
- }
- break;
-
- // Conversion operators. The source and destination have different types.
- case ISD::SINT_TO_FP:
- case ISD::UINT_TO_FP: {
- bool isSigned = Node->getOpcode() == ISD::SINT_TO_FP;
- switch (getTypeAction(Node->getOperand(0).getValueType())) {
- case Legal:
- switch (TLI.getOperationAction(Node->getOpcode(),
- Node->getOperand(0).getValueType())) {
- default: assert(0 && "Unknown operation action!");
- case TargetLowering::Custom:
- isCustom = true;
- // FALLTHROUGH
- case TargetLowering::Legal:
- Tmp1 = LegalizeOp(Node->getOperand(0));
- Result = DAG.UpdateNodeOperands(Result, Tmp1);
- if (isCustom) {
- Tmp1 = TLI.LowerOperation(Result, DAG);
- if (Tmp1.Val) Result = Tmp1;
- }
- break;
- case TargetLowering::Expand:
- Result = ExpandLegalINT_TO_FP(isSigned,
- LegalizeOp(Node->getOperand(0)),
- Node->getValueType(0));
- break;
- case TargetLowering::Promote:
- Result = PromoteLegalINT_TO_FP(LegalizeOp(Node->getOperand(0)),
- Node->getValueType(0),
- isSigned);
- break;
- }
- break;
- case Expand:
- Result = ExpandIntToFP(Node->getOpcode() == ISD::SINT_TO_FP,
- Node->getValueType(0), Node->getOperand(0));
- break;
- case Promote:
- Tmp1 = PromoteOp(Node->getOperand(0));
- if (isSigned) {
- Tmp1 = DAG.getNode(ISD::SIGN_EXTEND_INREG, Tmp1.getValueType(),
- Tmp1, DAG.getValueType(Node->getOperand(0).getValueType()));
- } else {
- Tmp1 = DAG.getZeroExtendInReg(Tmp1,
- Node->getOperand(0).getValueType());
- }
- Result = DAG.UpdateNodeOperands(Result, Tmp1);
- Result = LegalizeOp(Result); // The 'op' is not necessarily legal!
- break;
- }
- break;
- }
- case ISD::TRUNCATE:
- switch (getTypeAction(Node->getOperand(0).getValueType())) {
- case Legal:
- Tmp1 = LegalizeOp(Node->getOperand(0));
- Result = DAG.UpdateNodeOperands(Result, Tmp1);
- break;
- case Expand:
- ExpandOp(Node->getOperand(0), Tmp1, Tmp2);
-
- // Since the result is legal, we should just be able to truncate the low
- // part of the source.
- Result = DAG.getNode(ISD::TRUNCATE, Node->getValueType(0), Tmp1);
- break;
- case Promote:
- Result = PromoteOp(Node->getOperand(0));
- Result = DAG.getNode(ISD::TRUNCATE, Op.getValueType(), Result);
- break;
- }
- break;
-
- case ISD::FP_TO_SINT:
- case ISD::FP_TO_UINT:
- switch (getTypeAction(Node->getOperand(0).getValueType())) {
- case Legal:
- Tmp1 = LegalizeOp(Node->getOperand(0));
-
- switch (TLI.getOperationAction(Node->getOpcode(), Node->getValueType(0))){
- default: assert(0 && "Unknown operation action!");
- case TargetLowering::Custom:
- isCustom = true;
- // FALLTHROUGH
- case TargetLowering::Legal:
- Result = DAG.UpdateNodeOperands(Result, Tmp1);
- if (isCustom) {
- Tmp1 = TLI.LowerOperation(Result, DAG);
- if (Tmp1.Val) Result = Tmp1;
- }
- break;
- case TargetLowering::Promote:
- Result = PromoteLegalFP_TO_INT(Tmp1, Node->getValueType(0),
- Node->getOpcode() == ISD::FP_TO_SINT);
- break;
- case TargetLowering::Expand:
- if (Node->getOpcode() == ISD::FP_TO_UINT) {
- SDOperand True, False;
- MVT::ValueType VT = Node->getOperand(0).getValueType();
- MVT::ValueType NVT = Node->getValueType(0);
- const uint64_t zero[] = {0, 0};
- APFloat apf = APFloat(APInt(MVT::getSizeInBits(VT), 2, zero));
- APInt x = APInt::getSignBit(MVT::getSizeInBits(NVT));
- (void)apf.convertFromAPInt(x, false, APFloat::rmNearestTiesToEven);
- Tmp2 = DAG.getConstantFP(apf, VT);
- Tmp3 = DAG.getSetCC(TLI.getSetCCResultType(Node->getOperand(0)),
- Node->getOperand(0), Tmp2, ISD::SETLT);
- True = DAG.getNode(ISD::FP_TO_SINT, NVT, Node->getOperand(0));
- False = DAG.getNode(ISD::FP_TO_SINT, NVT,
- DAG.getNode(ISD::FSUB, VT, Node->getOperand(0),
- Tmp2));
- False = DAG.getNode(ISD::XOR, NVT, False,
- DAG.getConstant(x, NVT));
- Result = DAG.getNode(ISD::SELECT, NVT, Tmp3, True, False);
- break;
- } else {
- assert(0 && "Do not know how to expand FP_TO_SINT yet!");
- }
- break;
- }
- break;
- case Expand: {
- MVT::ValueType VT = Op.getValueType();
- MVT::ValueType OVT = Node->getOperand(0).getValueType();
- // Convert ppcf128 to i32
- if (OVT == MVT::ppcf128 && VT == MVT::i32) {
- if (Node->getOpcode() == ISD::FP_TO_SINT) {
- Result = DAG.getNode(ISD::FP_ROUND_INREG, MVT::ppcf128,
- Node->getOperand(0), DAG.getValueType(MVT::f64));
- Result = DAG.getNode(ISD::FP_ROUND, MVT::f64, Result,
- DAG.getIntPtrConstant(1));
- Result = DAG.getNode(ISD::FP_TO_SINT, VT, Result);
- } else {
- const uint64_t TwoE31[] = {0x41e0000000000000LL, 0};
- APFloat apf = APFloat(APInt(128, 2, TwoE31));
- Tmp2 = DAG.getConstantFP(apf, OVT);
- // X>=2^31 ? (int)(X-2^31)+0x80000000 : (int)X
- // FIXME: generated code sucks.
- Result = DAG.getNode(ISD::SELECT_CC, VT, Node->getOperand(0), Tmp2,
- DAG.getNode(ISD::ADD, MVT::i32,
- DAG.getNode(ISD::FP_TO_SINT, VT,
- DAG.getNode(ISD::FSUB, OVT,
- Node->getOperand(0), Tmp2)),
- DAG.getConstant(0x80000000, MVT::i32)),
- DAG.getNode(ISD::FP_TO_SINT, VT,
- Node->getOperand(0)),
- DAG.getCondCode(ISD::SETGE));
- }
- break;
- }
- // Convert f32 / f64 to i32 / i64 / i128.
- RTLIB::Libcall LC = RTLIB::UNKNOWN_LIBCALL;
- switch (Node->getOpcode()) {
- case ISD::FP_TO_SINT: {
- if (VT == MVT::i32) {
- if (OVT == MVT::f32)
- LC = RTLIB::FPTOSINT_F32_I32;
- else if (OVT == MVT::f64)
- LC = RTLIB::FPTOSINT_F64_I32;
- else
- assert(0 && "Unexpected i32-to-fp conversion!");
- } else if (VT == MVT::i64) {
- if (OVT == MVT::f32)
- LC = RTLIB::FPTOSINT_F32_I64;
- else if (OVT == MVT::f64)
- LC = RTLIB::FPTOSINT_F64_I64;
- else if (OVT == MVT::f80)
- LC = RTLIB::FPTOSINT_F80_I64;
- else if (OVT == MVT::ppcf128)
- LC = RTLIB::FPTOSINT_PPCF128_I64;
- else
- assert(0 && "Unexpected i64-to-fp conversion!");
- } else if (VT == MVT::i128) {
- if (OVT == MVT::f32)
- LC = RTLIB::FPTOSINT_F32_I128;
- else if (OVT == MVT::f64)
- LC = RTLIB::FPTOSINT_F64_I128;
- else if (OVT == MVT::f80)
- LC = RTLIB::FPTOSINT_F80_I128;
- else if (OVT == MVT::ppcf128)
- LC = RTLIB::FPTOSINT_PPCF128_I128;
- else
- assert(0 && "Unexpected i128-to-fp conversion!");
- } else {
- assert(0 && "Unexpectd int-to-fp conversion!");
- }
- break;
- }
- case ISD::FP_TO_UINT: {
- if (VT == MVT::i32) {
- if (OVT == MVT::f32)
- LC = RTLIB::FPTOUINT_F32_I32;
- else if (OVT == MVT::f64)
- LC = RTLIB::FPTOUINT_F64_I32;
- else if (OVT == MVT::f80)
- LC = RTLIB::FPTOUINT_F80_I32;
- else
- assert(0 && "Unexpected i32-to-fp conversion!");
- } else if (VT == MVT::i64) {
- if (OVT == MVT::f32)
- LC = RTLIB::FPTOUINT_F32_I64;
- else if (OVT == MVT::f64)
- LC = RTLIB::FPTOUINT_F64_I64;
- else if (OVT == MVT::f80)
- LC = RTLIB::FPTOUINT_F80_I64;
- else if (OVT == MVT::ppcf128)
- LC = RTLIB::FPTOUINT_PPCF128_I64;
- else
- assert(0 && "Unexpected i64-to-fp conversion!");
- } else if (VT == MVT::i128) {
- if (OVT == MVT::f32)
- LC = RTLIB::FPTOUINT_F32_I128;
- else if (OVT == MVT::f64)
- LC = RTLIB::FPTOUINT_F64_I128;
- else if (OVT == MVT::f80)
- LC = RTLIB::FPTOUINT_F80_I128;
- else if (OVT == MVT::ppcf128)
- LC = RTLIB::FPTOUINT_PPCF128_I128;
- else
- assert(0 && "Unexpected i128-to-fp conversion!");
- } else {
- assert(0 && "Unexpectd int-to-fp conversion!");
- }
- break;
- }
- default: assert(0 && "Unreachable!");
- }
- SDOperand Dummy;
- Result = ExpandLibCall(LC, Node, false/*sign irrelevant*/, Dummy);
- break;
- }
- case Promote:
- Tmp1 = PromoteOp(Node->getOperand(0));
- Result = DAG.UpdateNodeOperands(Result, LegalizeOp(Tmp1));
- Result = LegalizeOp(Result);
- break;
- }
- break;
-
- case ISD::FP_EXTEND: {
- MVT::ValueType DstVT = Op.getValueType();
- MVT::ValueType SrcVT = Op.getOperand(0).getValueType();
- if (TLI.getConvertAction(SrcVT, DstVT) == TargetLowering::Expand) {
- // The only other way we can lower this is to turn it into a STORE,
- // LOAD pair, targetting a temporary location (a stack slot).
- Result = EmitStackConvert(Node->getOperand(0), SrcVT, DstVT);
- break;
- }
- switch (getTypeAction(Node->getOperand(0).getValueType())) {
- case Expand: assert(0 && "Shouldn't need to expand other operators here!");
- case Legal:
- Tmp1 = LegalizeOp(Node->getOperand(0));
- Result = DAG.UpdateNodeOperands(Result, Tmp1);
- break;
- case Promote:
- Tmp1 = PromoteOp(Node->getOperand(0));
- Result = DAG.getNode(ISD::FP_EXTEND, Op.getValueType(), Tmp1);
- break;
- }
- break;
- }
- case ISD::FP_ROUND: {
- MVT::ValueType DstVT = Op.getValueType();
- MVT::ValueType SrcVT = Op.getOperand(0).getValueType();
- if (TLI.getConvertAction(SrcVT, DstVT) == TargetLowering::Expand) {
- if (SrcVT == MVT::ppcf128) {
- SDOperand Lo;
- ExpandOp(Node->getOperand(0), Lo, Result);
- // Round it the rest of the way (e.g. to f32) if needed.
- if (DstVT!=MVT::f64)
- Result = DAG.getNode(ISD::FP_ROUND, DstVT, Result, Op.getOperand(1));
- break;
- }
- // The only other way we can lower this is to turn it into a STORE,
- // LOAD pair, targetting a temporary location (a stack slot).
- Result = EmitStackConvert(Node->getOperand(0), DstVT, DstVT);
- break;
- }
- switch (getTypeAction(Node->getOperand(0).getValueType())) {
- case Expand: assert(0 && "Shouldn't need to expand other operators here!");
- case Legal:
- Tmp1 = LegalizeOp(Node->getOperand(0));
- Result = DAG.UpdateNodeOperands(Result, Tmp1, Node->getOperand(1));
- break;
- case Promote:
- Tmp1 = PromoteOp(Node->getOperand(0));
- Result = DAG.getNode(ISD::FP_ROUND, Op.getValueType(), Tmp1,
- Node->getOperand(1));
- break;
- }
- break;
- }
- case ISD::ANY_EXTEND:
- case ISD::ZERO_EXTEND:
- case ISD::SIGN_EXTEND:
- switch (getTypeAction(Node->getOperand(0).getValueType())) {
- case Expand: assert(0 && "Shouldn't need to expand other operators here!");
- case Legal:
- Tmp1 = LegalizeOp(Node->getOperand(0));
- Result = DAG.UpdateNodeOperands(Result, Tmp1);
- if (TLI.getOperationAction(Node->getOpcode(), Node->getValueType(0)) ==
- TargetLowering::Custom) {
- Tmp1 = TLI.LowerOperation(Result, DAG);
- if (Tmp1.Val) Result = Tmp1;
- }
- break;
- case Promote:
- switch (Node->getOpcode()) {
- case ISD::ANY_EXTEND:
- Tmp1 = PromoteOp(Node->getOperand(0));
- Result = DAG.getNode(ISD::ANY_EXTEND, Op.getValueType(), Tmp1);
- break;
- case ISD::ZERO_EXTEND:
- Result = PromoteOp(Node->getOperand(0));
- Result = DAG.getNode(ISD::ANY_EXTEND, Op.getValueType(), Result);
- Result = DAG.getZeroExtendInReg(Result,
- Node->getOperand(0).getValueType());
- break;
- case ISD::SIGN_EXTEND:
- Result = PromoteOp(Node->getOperand(0));
- Result = DAG.getNode(ISD::ANY_EXTEND, Op.getValueType(), Result);
- Result = DAG.getNode(ISD::SIGN_EXTEND_INREG, Result.getValueType(),
- Result,
- DAG.getValueType(Node->getOperand(0).getValueType()));
- break;
- }
- }
- break;
- case ISD::FP_ROUND_INREG:
- case ISD::SIGN_EXTEND_INREG: {
- Tmp1 = LegalizeOp(Node->getOperand(0));
- MVT::ValueType ExtraVT = cast<VTSDNode>(Node->getOperand(1))->getVT();
-
- // If this operation is not supported, convert it to a shl/shr or load/store
- // pair.
- switch (TLI.getOperationAction(Node->getOpcode(), ExtraVT)) {
- default: assert(0 && "This action not supported for this op yet!");
- case TargetLowering::Legal:
- Result = DAG.UpdateNodeOperands(Result, Tmp1, Node->getOperand(1));
- break;
- case TargetLowering::Expand:
- // If this is an integer extend and shifts are supported, do that.
- if (Node->getOpcode() == ISD::SIGN_EXTEND_INREG) {
- // NOTE: we could fall back on load/store here too for targets without
- // SAR. However, it is doubtful that any exist.
- unsigned BitsDiff = MVT::getSizeInBits(Node->getValueType(0)) -
- MVT::getSizeInBits(ExtraVT);
- SDOperand ShiftCst = DAG.getConstant(BitsDiff, TLI.getShiftAmountTy());
- Result = DAG.getNode(ISD::SHL, Node->getValueType(0),
- Node->getOperand(0), ShiftCst);
- Result = DAG.getNode(ISD::SRA, Node->getValueType(0),
- Result, ShiftCst);
- } else if (Node->getOpcode() == ISD::FP_ROUND_INREG) {
- // The only way we can lower this is to turn it into a TRUNCSTORE,
- // EXTLOAD pair, targetting a temporary location (a stack slot).
-
- // NOTE: there is a choice here between constantly creating new stack
- // slots and always reusing the same one. We currently always create
- // new ones, as reuse may inhibit scheduling.
- Result = EmitStackConvert(Node->getOperand(0), ExtraVT,
- Node->getValueType(0));
- } else {
- assert(0 && "Unknown op");
- }
- break;
- }
- break;
- }
- case ISD::TRAMPOLINE: {
- SDOperand Ops[6];
- for (unsigned i = 0; i != 6; ++i)
- Ops[i] = LegalizeOp(Node->getOperand(i));
- Result = DAG.UpdateNodeOperands(Result, Ops, 6);
- // The only option for this node is to custom lower it.
- Result = TLI.LowerOperation(Result, DAG);
- assert(Result.Val && "Should always custom lower!");
-
- // Since trampoline produces two values, make sure to remember that we
- // legalized both of them.
- Tmp1 = LegalizeOp(Result.getValue(1));
- Result = LegalizeOp(Result);
- AddLegalizedOperand(SDOperand(Node, 0), Result);
- AddLegalizedOperand(SDOperand(Node, 1), Tmp1);
- return Op.ResNo ? Tmp1 : Result;
- }
- case ISD::FLT_ROUNDS_: {
- MVT::ValueType VT = Node->getValueType(0);
- switch (TLI.getOperationAction(Node->getOpcode(), VT)) {
- default: assert(0 && "This action not supported for this op yet!");
- case TargetLowering::Custom:
- Result = TLI.LowerOperation(Op, DAG);
- if (Result.Val) break;
- // Fall Thru
- case TargetLowering::Legal:
- // If this operation is not supported, lower it to constant 1
- Result = DAG.getConstant(1, VT);
- break;
- }
- break;
- }
- case ISD::TRAP: {
- MVT::ValueType VT = Node->getValueType(0);
- switch (TLI.getOperationAction(Node->getOpcode(), VT)) {
- default: assert(0 && "This action not supported for this op yet!");
- case TargetLowering::Legal:
- Tmp1 = LegalizeOp(Node->getOperand(0));
- Result = DAG.UpdateNodeOperands(Result, Tmp1);
- break;
- case TargetLowering::Custom:
- Result = TLI.LowerOperation(Op, DAG);
- if (Result.Val) break;
- // Fall Thru
- case TargetLowering::Expand:
- // If this operation is not supported, lower it to 'abort()' call
- Tmp1 = LegalizeOp(Node->getOperand(0));
- TargetLowering::ArgListTy Args;
- std::pair<SDOperand,SDOperand> CallResult =
- TLI.LowerCallTo(Tmp1, Type::VoidTy,
- false, false, false, CallingConv::C, false,
- DAG.getExternalSymbol("abort", TLI.getPointerTy()),
- Args, DAG);
- Result = CallResult.second;
- break;
- }
- break;
- }
- }
-
- assert(Result.getValueType() == Op.getValueType() &&
- "Bad legalization!");
-
- // Make sure that the generated code is itself legal.
- if (Result != Op)
- Result = LegalizeOp(Result);
-
- // Note that LegalizeOp may be reentered even from single-use nodes, which
- // means that we always must cache transformed nodes.
- AddLegalizedOperand(Op, Result);
- return Result;
-}
-
-/// PromoteOp - Given an operation that produces a value in an invalid type,
-/// promote it to compute the value into a larger type. The produced value will
-/// have the correct bits for the low portion of the register, but no guarantee
-/// is made about the top bits: it may be zero, sign-extended, or garbage.
-SDOperand SelectionDAGLegalize::PromoteOp(SDOperand Op) {
- MVT::ValueType VT = Op.getValueType();
- MVT::ValueType NVT = TLI.getTypeToTransformTo(VT);
- assert(getTypeAction(VT) == Promote &&
- "Caller should expand or legalize operands that are not promotable!");
- assert(NVT > VT && MVT::isInteger(NVT) == MVT::isInteger(VT) &&
- "Cannot promote to smaller type!");
-
- SDOperand Tmp1, Tmp2, Tmp3;
- SDOperand Result;
- SDNode *Node = Op.Val;
-
- DenseMap<SDOperand, SDOperand>::iterator I = PromotedNodes.find(Op);
- if (I != PromotedNodes.end()) return I->second;
-
- switch (Node->getOpcode()) {
- case ISD::CopyFromReg:
- assert(0 && "CopyFromReg must be legal!");
- default:
-#ifndef NDEBUG
- cerr << "NODE: "; Node->dump(&DAG); cerr << "\n";
-#endif
- assert(0 && "Do not know how to promote this operator!");
- abort();
- case ISD::UNDEF:
- Result = DAG.getNode(ISD::UNDEF, NVT);
- break;
- case ISD::Constant:
- if (VT != MVT::i1)
- Result = DAG.getNode(ISD::SIGN_EXTEND, NVT, Op);
- else
- Result = DAG.getNode(ISD::ZERO_EXTEND, NVT, Op);
- assert(isa<ConstantSDNode>(Result) && "Didn't constant fold zext?");
- break;
- case ISD::ConstantFP:
- Result = DAG.getNode(ISD::FP_EXTEND, NVT, Op);
- assert(isa<ConstantFPSDNode>(Result) && "Didn't constant fold fp_extend?");
- break;
-
- case ISD::SETCC:
- assert(isTypeLegal(TLI.getSetCCResultType(Node->getOperand(0)))
- && "SetCC type is not legal??");
- Result = DAG.getNode(ISD::SETCC,
- TLI.getSetCCResultType(Node->getOperand(0)),
- Node->getOperand(0), Node->getOperand(1),
- Node->getOperand(2));
- break;
-
- case ISD::TRUNCATE:
- switch (getTypeAction(Node->getOperand(0).getValueType())) {
- case Legal:
- Result = LegalizeOp(Node->getOperand(0));
- assert(Result.getValueType() >= NVT &&
- "This truncation doesn't make sense!");
- if (Result.getValueType() > NVT) // Truncate to NVT instead of VT
- Result = DAG.getNode(ISD::TRUNCATE, NVT, Result);
- break;
- case Promote:
- // The truncation is not required, because we don't guarantee anything
- // about high bits anyway.
- Result = PromoteOp(Node->getOperand(0));
- break;
- case Expand:
- ExpandOp(Node->getOperand(0), Tmp1, Tmp2);
- // Truncate the low part of the expanded value to the result type
- Result = DAG.getNode(ISD::TRUNCATE, NVT, Tmp1);
- }
- break;
- case ISD::SIGN_EXTEND:
- case ISD::ZERO_EXTEND:
- case ISD::ANY_EXTEND:
- switch (getTypeAction(Node->getOperand(0).getValueType())) {
- case Expand: assert(0 && "BUG: Smaller reg should have been promoted!");
- case Legal:
- // Input is legal? Just do extend all the way to the larger type.
- Result = DAG.getNode(Node->getOpcode(), NVT, Node->getOperand(0));
- break;
- case Promote:
- // Promote the reg if it's smaller.
- Result = PromoteOp(Node->getOperand(0));
- // The high bits are not guaranteed to be anything. Insert an extend.
- if (Node->getOpcode() == ISD::SIGN_EXTEND)
- Result = DAG.getNode(ISD::SIGN_EXTEND_INREG, NVT, Result,
- DAG.getValueType(Node->getOperand(0).getValueType()));
- else if (Node->getOpcode() == ISD::ZERO_EXTEND)
- Result = DAG.getZeroExtendInReg(Result,
- Node->getOperand(0).getValueType());
- break;
- }
- break;
- case ISD::BIT_CONVERT:
- Result = EmitStackConvert(Node->getOperand(0), Node->getValueType(0),
- Node->getValueType(0));
- Result = PromoteOp(Result);
- break;
-
- case ISD::FP_EXTEND:
- assert(0 && "Case not implemented. Dynamically dead with 2 FP types!");
- case ISD::FP_ROUND:
- switch (getTypeAction(Node->getOperand(0).getValueType())) {
- case Expand: assert(0 && "BUG: Cannot expand FP regs!");
- case Promote: assert(0 && "Unreachable with 2 FP types!");
- case Legal:
- if (Node->getConstantOperandVal(1) == 0) {
- // Input is legal? Do an FP_ROUND_INREG.
- Result = DAG.getNode(ISD::FP_ROUND_INREG, NVT, Node->getOperand(0),
- DAG.getValueType(VT));
- } else {
- // Just remove the truncate, it isn't affecting the value.
- Result = DAG.getNode(ISD::FP_ROUND, NVT, Node->getOperand(0),
- Node->getOperand(1));
- }
- break;
- }
- break;
- case ISD::SINT_TO_FP:
- case ISD::UINT_TO_FP:
- switch (getTypeAction(Node->getOperand(0).getValueType())) {
- case Legal:
- // No extra round required here.
- Result = DAG.getNode(Node->getOpcode(), NVT, Node->getOperand(0));
- break;
-
- case Promote:
- Result = PromoteOp(Node->getOperand(0));
- if (Node->getOpcode() == ISD::SINT_TO_FP)
- Result = DAG.getNode(ISD::SIGN_EXTEND_INREG, Result.getValueType(),
- Result,
- DAG.getValueType(Node->getOperand(0).getValueType()));
- else
- Result = DAG.getZeroExtendInReg(Result,
- Node->getOperand(0).getValueType());
- // No extra round required here.
- Result = DAG.getNode(Node->getOpcode(), NVT, Result);
- break;
- case Expand:
- Result = ExpandIntToFP(Node->getOpcode() == ISD::SINT_TO_FP, NVT,
- Node->getOperand(0));
- // Round if we cannot tolerate excess precision.
- if (NoExcessFPPrecision)
- Result = DAG.getNode(ISD::FP_ROUND_INREG, NVT, Result,
- DAG.getValueType(VT));
- break;
- }
- break;
-
- case ISD::SIGN_EXTEND_INREG:
- Result = PromoteOp(Node->getOperand(0));
- Result = DAG.getNode(ISD::SIGN_EXTEND_INREG, NVT, Result,
- Node->getOperand(1));
- break;
- case ISD::FP_TO_SINT:
- case ISD::FP_TO_UINT:
- switch (getTypeAction(Node->getOperand(0).getValueType())) {
- case Legal:
- case Expand:
- Tmp1 = Node->getOperand(0);
- break;
- case Promote:
- // The input result is prerounded, so we don't have to do anything
- // special.
- Tmp1 = PromoteOp(Node->getOperand(0));
- break;
- }
- // If we're promoting a UINT to a larger size, check to see if the new node
- // will be legal. If it isn't, check to see if FP_TO_SINT is legal, since
- // we can use that instead. This allows us to generate better code for
- // FP_TO_UINT for small destination sizes on targets where FP_TO_UINT is not
- // legal, such as PowerPC.
- if (Node->getOpcode() == ISD::FP_TO_UINT &&
- !TLI.isOperationLegal(ISD::FP_TO_UINT, NVT) &&
- (TLI.isOperationLegal(ISD::FP_TO_SINT, NVT) ||
- TLI.getOperationAction(ISD::FP_TO_SINT, NVT)==TargetLowering::Custom)){
- Result = DAG.getNode(ISD::FP_TO_SINT, NVT, Tmp1);
- } else {
- Result = DAG.getNode(Node->getOpcode(), NVT, Tmp1);
- }
- break;
-
- case ISD::FABS:
- case ISD::FNEG:
- Tmp1 = PromoteOp(Node->getOperand(0));
- assert(Tmp1.getValueType() == NVT);
- Result = DAG.getNode(Node->getOpcode(), NVT, Tmp1);
- // NOTE: we do not have to do any extra rounding here for
- // NoExcessFPPrecision, because we know the input will have the appropriate
- // precision, and these operations don't modify precision at all.
- break;
-
- case ISD::FSQRT:
- case ISD::FSIN:
- case ISD::FCOS:
- Tmp1 = PromoteOp(Node->getOperand(0));
- assert(Tmp1.getValueType() == NVT);
- Result = DAG.getNode(Node->getOpcode(), NVT, Tmp1);
- if (NoExcessFPPrecision)
- Result = DAG.getNode(ISD::FP_ROUND_INREG, NVT, Result,
- DAG.getValueType(VT));
- break;
-
- case ISD::FPOWI: {
- // Promote f32 powi to f64 powi. Note that this could insert a libcall
- // directly as well, which may be better.
- Tmp1 = PromoteOp(Node->getOperand(0));
- assert(Tmp1.getValueType() == NVT);
- Result = DAG.getNode(ISD::FPOWI, NVT, Tmp1, Node->getOperand(1));
- if (NoExcessFPPrecision)
- Result = DAG.getNode(ISD::FP_ROUND_INREG, NVT, Result,
- DAG.getValueType(VT));
- break;
- }
-
- case ISD::ATOMIC_LCS: {
- Tmp2 = PromoteOp(Node->getOperand(2));
- Tmp3 = PromoteOp(Node->getOperand(3));
- Result = DAG.getAtomic(Node->getOpcode(), Node->getOperand(0),
- Node->getOperand(1), Tmp2, Tmp3,
- cast<AtomicSDNode>(Node)->getVT());
- // Remember that we legalized the chain.
- AddLegalizedOperand(Op.getValue(1), LegalizeOp(Result.getValue(1)));
- break;
- }
- case ISD::ATOMIC_LAS:
- case ISD::ATOMIC_LSS:
- case ISD::ATOMIC_LOAD_AND:
- case ISD::ATOMIC_LOAD_OR:
- case ISD::ATOMIC_LOAD_XOR:
- case ISD::ATOMIC_LOAD_MIN:
- case ISD::ATOMIC_LOAD_MAX:
- case ISD::ATOMIC_LOAD_UMIN:
- case ISD::ATOMIC_LOAD_UMAX:
- case ISD::ATOMIC_SWAP: {
- Tmp2 = PromoteOp(Node->getOperand(2));
- Result = DAG.getAtomic(Node->getOpcode(), Node->getOperand(0),
- Node->getOperand(1), Tmp2,
- cast<AtomicSDNode>(Node)->getVT());
- // Remember that we legalized the chain.
- AddLegalizedOperand(Op.getValue(1), LegalizeOp(Result.getValue(1)));
- break;
- }
-
- case ISD::AND:
- case ISD::OR:
- case ISD::XOR:
- case ISD::ADD:
- case ISD::SUB:
- case ISD::MUL:
- // The input may have strange things in the top bits of the registers, but
- // these operations don't care. They may have weird bits going out, but
- // that too is okay if they are integer operations.
- Tmp1 = PromoteOp(Node->getOperand(0));
- Tmp2 = PromoteOp(Node->getOperand(1));
- assert(Tmp1.getValueType() == NVT && Tmp2.getValueType() == NVT);
- Result = DAG.getNode(Node->getOpcode(), NVT, Tmp1, Tmp2);
- break;
- case ISD::FADD:
- case ISD::FSUB:
- case ISD::FMUL:
- Tmp1 = PromoteOp(Node->getOperand(0));
- Tmp2 = PromoteOp(Node->getOperand(1));
- assert(Tmp1.getValueType() == NVT && Tmp2.getValueType() == NVT);
- Result = DAG.getNode(Node->getOpcode(), NVT, Tmp1, Tmp2);
-
- // Floating point operations will give excess precision that we may not be
- // able to tolerate. If we DO allow excess precision, just leave it,
- // otherwise excise it.
- // FIXME: Why would we need to round FP ops more than integer ones?
- // Is Round(Add(Add(A,B),C)) != Round(Add(Round(Add(A,B)), C))
- if (NoExcessFPPrecision)
- Result = DAG.getNode(ISD::FP_ROUND_INREG, NVT, Result,
- DAG.getValueType(VT));
- break;
-
- case ISD::SDIV:
- case ISD::SREM:
- // These operators require that their input be sign extended.
- Tmp1 = PromoteOp(Node->getOperand(0));
- Tmp2 = PromoteOp(Node->getOperand(1));
- if (MVT::isInteger(NVT)) {
- Tmp1 = DAG.getNode(ISD::SIGN_EXTEND_INREG, NVT, Tmp1,
- DAG.getValueType(VT));
- Tmp2 = DAG.getNode(ISD::SIGN_EXTEND_INREG, NVT, Tmp2,
- DAG.getValueType(VT));
- }
- Result = DAG.getNode(Node->getOpcode(), NVT, Tmp1, Tmp2);
-
- // Perform FP_ROUND: this is probably overly pessimistic.
- if (MVT::isFloatingPoint(NVT) && NoExcessFPPrecision)
- Result = DAG.getNode(ISD::FP_ROUND_INREG, NVT, Result,
- DAG.getValueType(VT));
- break;
- case ISD::FDIV:
- case ISD::FREM:
- case ISD::FCOPYSIGN:
- // These operators require that their input be fp extended.
- switch (getTypeAction(Node->getOperand(0).getValueType())) {
- case Expand: assert(0 && "not implemented");
- case Legal: Tmp1 = LegalizeOp(Node->getOperand(0)); break;
- case Promote: Tmp1 = PromoteOp(Node->getOperand(0)); break;
- }
- switch (getTypeAction(Node->getOperand(1).getValueType())) {
- case Expand: assert(0 && "not implemented");
- case Legal: Tmp2 = LegalizeOp(Node->getOperand(1)); break;
- case Promote: Tmp2 = PromoteOp(Node->getOperand(1)); break;
- }
- Result = DAG.getNode(Node->getOpcode(), NVT, Tmp1, Tmp2);
-
- // Perform FP_ROUND: this is probably overly pessimistic.
- if (NoExcessFPPrecision && Node->getOpcode() != ISD::FCOPYSIGN)
- Result = DAG.getNode(ISD::FP_ROUND_INREG, NVT, Result,
- DAG.getValueType(VT));
- break;
-
- case ISD::UDIV:
- case ISD::UREM:
- // These operators require that their input be zero extended.
- Tmp1 = PromoteOp(Node->getOperand(0));
- Tmp2 = PromoteOp(Node->getOperand(1));
- assert(MVT::isInteger(NVT) && "Operators don't apply to FP!");
- Tmp1 = DAG.getZeroExtendInReg(Tmp1, VT);
- Tmp2 = DAG.getZeroExtendInReg(Tmp2, VT);
- Result = DAG.getNode(Node->getOpcode(), NVT, Tmp1, Tmp2);
- break;
-
- case ISD::SHL:
- Tmp1 = PromoteOp(Node->getOperand(0));
- Result = DAG.getNode(ISD::SHL, NVT, Tmp1, Node->getOperand(1));
- break;
- case ISD::SRA:
- // The input value must be properly sign extended.
- Tmp1 = PromoteOp(Node->getOperand(0));
- Tmp1 = DAG.getNode(ISD::SIGN_EXTEND_INREG, NVT, Tmp1,
- DAG.getValueType(VT));
- Result = DAG.getNode(ISD::SRA, NVT, Tmp1, Node->getOperand(1));
- break;
- case ISD::SRL:
- // The input value must be properly zero extended.
- Tmp1 = PromoteOp(Node->getOperand(0));
- Tmp1 = DAG.getZeroExtendInReg(Tmp1, VT);
- Result = DAG.getNode(ISD::SRL, NVT, Tmp1, Node->getOperand(1));
- break;
-
- case ISD::VAARG:
- Tmp1 = Node->getOperand(0); // Get the chain.
- Tmp2 = Node->getOperand(1); // Get the pointer.
- if (TLI.getOperationAction(ISD::VAARG, VT) == TargetLowering::Custom) {
- Tmp3 = DAG.getVAArg(VT, Tmp1, Tmp2, Node->getOperand(2));
- Result = TLI.CustomPromoteOperation(Tmp3, DAG);
- } else {
- const Value *V = cast<SrcValueSDNode>(Node->getOperand(2))->getValue();
- SDOperand VAList = DAG.getLoad(TLI.getPointerTy(), Tmp1, Tmp2, V, 0);
- // Increment the pointer, VAList, to the next vaarg
- Tmp3 = DAG.getNode(ISD::ADD, TLI.getPointerTy(), VAList,
- DAG.getConstant(MVT::getSizeInBits(VT)/8,
- TLI.getPointerTy()));
- // Store the incremented VAList to the legalized pointer
- Tmp3 = DAG.getStore(VAList.getValue(1), Tmp3, Tmp2, V, 0);
- // Load the actual argument out of the pointer VAList
- Result = DAG.getExtLoad(ISD::EXTLOAD, NVT, Tmp3, VAList, NULL, 0, VT);
- }
- // Remember that we legalized the chain.
- AddLegalizedOperand(Op.getValue(1), LegalizeOp(Result.getValue(1)));
- break;
-
- case ISD::LOAD: {
- LoadSDNode *LD = cast<LoadSDNode>(Node);
- ISD::LoadExtType ExtType = ISD::isNON_EXTLoad(Node)
- ? ISD::EXTLOAD : LD->getExtensionType();
- Result = DAG.getExtLoad(ExtType, NVT,
- LD->getChain(), LD->getBasePtr(),
- LD->getSrcValue(), LD->getSrcValueOffset(),
- LD->getMemoryVT(),
- LD->isVolatile(),
- LD->getAlignment());
- // Remember that we legalized the chain.
- AddLegalizedOperand(Op.getValue(1), LegalizeOp(Result.getValue(1)));
- break;
- }
- case ISD::SELECT:
- Tmp2 = PromoteOp(Node->getOperand(1)); // Legalize the op0
- Tmp3 = PromoteOp(Node->getOperand(2)); // Legalize the op1
- Result = DAG.getNode(ISD::SELECT, NVT, Node->getOperand(0), Tmp2, Tmp3);
- break;
- case ISD::SELECT_CC:
- Tmp2 = PromoteOp(Node->getOperand(2)); // True
- Tmp3 = PromoteOp(Node->getOperand(3)); // False
- Result = DAG.getNode(ISD::SELECT_CC, NVT, Node->getOperand(0),
- Node->getOperand(1), Tmp2, Tmp3, Node->getOperand(4));
- break;
- case ISD::BSWAP:
- Tmp1 = Node->getOperand(0);
- Tmp1 = DAG.getNode(ISD::ZERO_EXTEND, NVT, Tmp1);
- Tmp1 = DAG.getNode(ISD::BSWAP, NVT, Tmp1);
- Result = DAG.getNode(ISD::SRL, NVT, Tmp1,
- DAG.getConstant(MVT::getSizeInBits(NVT) -
- MVT::getSizeInBits(VT),
- TLI.getShiftAmountTy()));
- break;
- case ISD::CTPOP:
- case ISD::CTTZ:
- case ISD::CTLZ:
- // Zero extend the argument
- Tmp1 = DAG.getNode(ISD::ZERO_EXTEND, NVT, Node->getOperand(0));
- // Perform the larger operation, then subtract if needed.
- Tmp1 = DAG.getNode(Node->getOpcode(), NVT, Tmp1);
- switch(Node->getOpcode()) {
- case ISD::CTPOP:
- Result = Tmp1;
- break;
- case ISD::CTTZ:
- // if Tmp1 == sizeinbits(NVT) then Tmp1 = sizeinbits(Old VT)
- Tmp2 = DAG.getSetCC(TLI.getSetCCResultType(Tmp1), Tmp1,
- DAG.getConstant(MVT::getSizeInBits(NVT), NVT),
- ISD::SETEQ);
- Result = DAG.getNode(ISD::SELECT, NVT, Tmp2,
- DAG.getConstant(MVT::getSizeInBits(VT), NVT), Tmp1);
- break;
- case ISD::CTLZ:
- //Tmp1 = Tmp1 - (sizeinbits(NVT) - sizeinbits(Old VT))
- Result = DAG.getNode(ISD::SUB, NVT, Tmp1,
- DAG.getConstant(MVT::getSizeInBits(NVT) -
- MVT::getSizeInBits(VT), NVT));
- break;
- }
- break;
- case ISD::EXTRACT_SUBVECTOR:
- Result = PromoteOp(ExpandEXTRACT_SUBVECTOR(Op));
- break;
- case ISD::EXTRACT_VECTOR_ELT:
- Result = PromoteOp(ExpandEXTRACT_VECTOR_ELT(Op));
- break;
- }
-
- assert(Result.Val && "Didn't set a result!");
-
- // Make sure the result is itself legal.
- Result = LegalizeOp(Result);
-
- // Remember that we promoted this!
- AddPromotedOperand(Op, Result);
- return Result;
-}
-
-/// ExpandEXTRACT_VECTOR_ELT - Expand an EXTRACT_VECTOR_ELT operation into
-/// a legal EXTRACT_VECTOR_ELT operation, scalar code, or memory traffic,
-/// based on the vector type. The return type of this matches the element type
-/// of the vector, which may not be legal for the target.
-SDOperand SelectionDAGLegalize::ExpandEXTRACT_VECTOR_ELT(SDOperand Op) {
- // We know that operand #0 is the Vec vector. If the index is a constant
- // or if the invec is a supported hardware type, we can use it. Otherwise,
- // lower to a store then an indexed load.
- SDOperand Vec = Op.getOperand(0);
- SDOperand Idx = Op.getOperand(1);
-
- MVT::ValueType TVT = Vec.getValueType();
- unsigned NumElems = MVT::getVectorNumElements(TVT);
-
- switch (TLI.getOperationAction(ISD::EXTRACT_VECTOR_ELT, TVT)) {
- default: assert(0 && "This action is not supported yet!");
- case TargetLowering::Custom: {
- Vec = LegalizeOp(Vec);
- Op = DAG.UpdateNodeOperands(Op, Vec, Idx);
- SDOperand Tmp3 = TLI.LowerOperation(Op, DAG);
- if (Tmp3.Val)
- return Tmp3;
- break;
- }
- case TargetLowering::Legal:
- if (isTypeLegal(TVT)) {
- Vec = LegalizeOp(Vec);
- Op = DAG.UpdateNodeOperands(Op, Vec, Idx);
- return Op;
- }
- break;
- case TargetLowering::Expand:
- break;
- }
-
- if (NumElems == 1) {
- // This must be an access of the only element. Return it.
- Op = ScalarizeVectorOp(Vec);
- } else if (!TLI.isTypeLegal(TVT) && isa<ConstantSDNode>(Idx)) {
- unsigned NumLoElts = 1 << Log2_32(NumElems-1);
- ConstantSDNode *CIdx = cast<ConstantSDNode>(Idx);
- SDOperand Lo, Hi;
- SplitVectorOp(Vec, Lo, Hi);
- if (CIdx->getValue() < NumLoElts) {
- Vec = Lo;
- } else {
- Vec = Hi;
- Idx = DAG.getConstant(CIdx->getValue() - NumLoElts,
- Idx.getValueType());
- }
-
- // It's now an extract from the appropriate high or low part. Recurse.
- Op = DAG.UpdateNodeOperands(Op, Vec, Idx);
- Op = ExpandEXTRACT_VECTOR_ELT(Op);
- } else {
- // Store the value to a temporary stack slot, then LOAD the scalar
- // element back out.
- SDOperand StackPtr = DAG.CreateStackTemporary(Vec.getValueType());
- SDOperand Ch = DAG.getStore(DAG.getEntryNode(), Vec, StackPtr, NULL, 0);
-
- // Add the offset to the index.
- unsigned EltSize = MVT::getSizeInBits(Op.getValueType())/8;
- Idx = DAG.getNode(ISD::MUL, Idx.getValueType(), Idx,
- DAG.getConstant(EltSize, Idx.getValueType()));
-
- if (MVT::getSizeInBits(Idx.getValueType()) >
- MVT::getSizeInBits(TLI.getPointerTy()))
- Idx = DAG.getNode(ISD::TRUNCATE, TLI.getPointerTy(), Idx);
- else
- Idx = DAG.getNode(ISD::ZERO_EXTEND, TLI.getPointerTy(), Idx);
-
- StackPtr = DAG.getNode(ISD::ADD, Idx.getValueType(), Idx, StackPtr);
-
- Op = DAG.getLoad(Op.getValueType(), Ch, StackPtr, NULL, 0);
- }
- return Op;
-}
-
-/// ExpandEXTRACT_SUBVECTOR - Expand a EXTRACT_SUBVECTOR operation. For now
-/// we assume the operation can be split if it is not already legal.
-SDOperand SelectionDAGLegalize::ExpandEXTRACT_SUBVECTOR(SDOperand Op) {
- // We know that operand #0 is the Vec vector. For now we assume the index
- // is a constant and that the extracted result is a supported hardware type.
- SDOperand Vec = Op.getOperand(0);
- SDOperand Idx = LegalizeOp(Op.getOperand(1));
-
- unsigned NumElems = MVT::getVectorNumElements(Vec.getValueType());
-
- if (NumElems == MVT::getVectorNumElements(Op.getValueType())) {
- // This must be an access of the desired vector length. Return it.
- return Vec;
- }
-
- ConstantSDNode *CIdx = cast<ConstantSDNode>(Idx);
- SDOperand Lo, Hi;
- SplitVectorOp(Vec, Lo, Hi);
- if (CIdx->getValue() < NumElems/2) {
- Vec = Lo;
- } else {
- Vec = Hi;
- Idx = DAG.getConstant(CIdx->getValue() - NumElems/2, Idx.getValueType());
- }
-
- // It's now an extract from the appropriate high or low part. Recurse.
- Op = DAG.UpdateNodeOperands(Op, Vec, Idx);
- return ExpandEXTRACT_SUBVECTOR(Op);
-}
-
-/// LegalizeSetCCOperands - Attempts to create a legal LHS and RHS for a SETCC
-/// with condition CC on the current target. This usually involves legalizing
-/// or promoting the arguments. In the case where LHS and RHS must be expanded,
-/// there may be no choice but to create a new SetCC node to represent the
-/// legalized value of setcc lhs, rhs. In this case, the value is returned in
-/// LHS, and the SDOperand returned in RHS has a nil SDNode value.
-void SelectionDAGLegalize::LegalizeSetCCOperands(SDOperand &LHS,
- SDOperand &RHS,
- SDOperand &CC) {
- SDOperand Tmp1, Tmp2, Tmp3, Result;
-
- switch (getTypeAction(LHS.getValueType())) {
- case Legal:
- Tmp1 = LegalizeOp(LHS); // LHS
- Tmp2 = LegalizeOp(RHS); // RHS
- break;
- case Promote:
- Tmp1 = PromoteOp(LHS); // LHS
- Tmp2 = PromoteOp(RHS); // RHS
-
- // If this is an FP compare, the operands have already been extended.
- if (MVT::isInteger(LHS.getValueType())) {
- MVT::ValueType VT = LHS.getValueType();
- MVT::ValueType NVT = TLI.getTypeToTransformTo(VT);
-
- // Otherwise, we have to insert explicit sign or zero extends. Note
- // that we could insert sign extends for ALL conditions, but zero extend
- // is cheaper on many machines (an AND instead of two shifts), so prefer
- // it.
- switch (cast<CondCodeSDNode>(CC)->get()) {
- default: assert(0 && "Unknown integer comparison!");
- case ISD::SETEQ:
- case ISD::SETNE:
- case ISD::SETUGE:
- case ISD::SETUGT:
- case ISD::SETULE:
- case ISD::SETULT:
- // ALL of these operations will work if we either sign or zero extend
- // the operands (including the unsigned comparisons!). Zero extend is
- // usually a simpler/cheaper operation, so prefer it.
- Tmp1 = DAG.getZeroExtendInReg(Tmp1, VT);
- Tmp2 = DAG.getZeroExtendInReg(Tmp2, VT);
- break;
- case ISD::SETGE:
- case ISD::SETGT:
- case ISD::SETLT:
- case ISD::SETLE:
- Tmp1 = DAG.getNode(ISD::SIGN_EXTEND_INREG, NVT, Tmp1,
- DAG.getValueType(VT));
- Tmp2 = DAG.getNode(ISD::SIGN_EXTEND_INREG, NVT, Tmp2,
- DAG.getValueType(VT));
- break;
- }
- }
- break;
- case Expand: {
- MVT::ValueType VT = LHS.getValueType();
- if (VT == MVT::f32 || VT == MVT::f64) {
- // Expand into one or more soft-fp libcall(s).
- RTLIB::Libcall LC1, LC2 = RTLIB::UNKNOWN_LIBCALL;
- switch (cast<CondCodeSDNode>(CC)->get()) {
- case ISD::SETEQ:
- case ISD::SETOEQ:
- LC1 = (VT == MVT::f32) ? RTLIB::OEQ_F32 : RTLIB::OEQ_F64;
- break;
- case ISD::SETNE:
- case ISD::SETUNE:
- LC1 = (VT == MVT::f32) ? RTLIB::UNE_F32 : RTLIB::UNE_F64;
- break;
- case ISD::SETGE:
- case ISD::SETOGE:
- LC1 = (VT == MVT::f32) ? RTLIB::OGE_F32 : RTLIB::OGE_F64;
- break;
- case ISD::SETLT:
- case ISD::SETOLT:
- LC1 = (VT == MVT::f32) ? RTLIB::OLT_F32 : RTLIB::OLT_F64;
- break;
- case ISD::SETLE:
- case ISD::SETOLE:
- LC1 = (VT == MVT::f32) ? RTLIB::OLE_F32 : RTLIB::OLE_F64;
- break;
- case ISD::SETGT:
- case ISD::SETOGT:
- LC1 = (VT == MVT::f32) ? RTLIB::OGT_F32 : RTLIB::OGT_F64;
- break;
- case ISD::SETUO:
- LC1 = (VT == MVT::f32) ? RTLIB::UO_F32 : RTLIB::UO_F64;
- break;
- case ISD::SETO:
- LC1 = (VT == MVT::f32) ? RTLIB::O_F32 : RTLIB::O_F64;
- break;
- default:
- LC1 = (VT == MVT::f32) ? RTLIB::UO_F32 : RTLIB::UO_F64;
- switch (cast<CondCodeSDNode>(CC)->get()) {
- case ISD::SETONE:
- // SETONE = SETOLT | SETOGT
- LC1 = (VT == MVT::f32) ? RTLIB::OLT_F32 : RTLIB::OLT_F64;
- // Fallthrough
- case ISD::SETUGT:
- LC2 = (VT == MVT::f32) ? RTLIB::OGT_F32 : RTLIB::OGT_F64;
- break;
- case ISD::SETUGE:
- LC2 = (VT == MVT::f32) ? RTLIB::OGE_F32 : RTLIB::OGE_F64;
- break;
- case ISD::SETULT:
- LC2 = (VT == MVT::f32) ? RTLIB::OLT_F32 : RTLIB::OLT_F64;
- break;
- case ISD::SETULE:
- LC2 = (VT == MVT::f32) ? RTLIB::OLE_F32 : RTLIB::OLE_F64;
- break;
- case ISD::SETUEQ:
- LC2 = (VT == MVT::f32) ? RTLIB::OEQ_F32 : RTLIB::OEQ_F64;
- break;
- default: assert(0 && "Unsupported FP setcc!");
- }
- }
-
- SDOperand Dummy;
- Tmp1 = ExpandLibCall(LC1,
- DAG.getNode(ISD::MERGE_VALUES, VT, LHS, RHS).Val,
- false /*sign irrelevant*/, Dummy);
- Tmp2 = DAG.getConstant(0, MVT::i32);
- CC = DAG.getCondCode(TLI.getCmpLibcallCC(LC1));
- if (LC2 != RTLIB::UNKNOWN_LIBCALL) {
- Tmp1 = DAG.getNode(ISD::SETCC, TLI.getSetCCResultType(Tmp1), Tmp1, Tmp2,
- CC);
- LHS = ExpandLibCall(LC2,
- DAG.getNode(ISD::MERGE_VALUES, VT, LHS, RHS).Val,
- false /*sign irrelevant*/, Dummy);
- Tmp2 = DAG.getNode(ISD::SETCC, TLI.getSetCCResultType(LHS), LHS, Tmp2,
- DAG.getCondCode(TLI.getCmpLibcallCC(LC2)));
- Tmp1 = DAG.getNode(ISD::OR, Tmp1.getValueType(), Tmp1, Tmp2);
- Tmp2 = SDOperand();
- }
- LHS = Tmp1;
- RHS = Tmp2;
- return;
- }
-
- SDOperand LHSLo, LHSHi, RHSLo, RHSHi;
- ExpandOp(LHS, LHSLo, LHSHi);
- ExpandOp(RHS, RHSLo, RHSHi);
- ISD::CondCode CCCode = cast<CondCodeSDNode>(CC)->get();
-
- if (VT==MVT::ppcf128) {
- // FIXME: This generated code sucks. We want to generate
- // FCMP crN, hi1, hi2
- // BNE crN, L:
- // FCMP crN, lo1, lo2
- // The following can be improved, but not that much.
- Tmp1 = DAG.getSetCC(TLI.getSetCCResultType(LHSHi), LHSHi, RHSHi, ISD::SETEQ);
- Tmp2 = DAG.getSetCC(TLI.getSetCCResultType(LHSLo), LHSLo, RHSLo, CCCode);
- Tmp3 = DAG.getNode(ISD::AND, Tmp1.getValueType(), Tmp1, Tmp2);
- Tmp1 = DAG.getSetCC(TLI.getSetCCResultType(LHSHi), LHSHi, RHSHi, ISD::SETNE);
- Tmp2 = DAG.getSetCC(TLI.getSetCCResultType(LHSHi), LHSHi, RHSHi, CCCode);
- Tmp1 = DAG.getNode(ISD::AND, Tmp1.getValueType(), Tmp1, Tmp2);
- Tmp1 = DAG.getNode(ISD::OR, Tmp1.getValueType(), Tmp1, Tmp3);
- Tmp2 = SDOperand();
- break;
- }
-
- switch (CCCode) {
- case ISD::SETEQ:
- case ISD::SETNE:
- if (RHSLo == RHSHi)
- if (ConstantSDNode *RHSCST = dyn_cast<ConstantSDNode>(RHSLo))
- if (RHSCST->isAllOnesValue()) {
- // Comparison to -1.
- Tmp1 = DAG.getNode(ISD::AND, LHSLo.getValueType(), LHSLo, LHSHi);
- Tmp2 = RHSLo;
- break;
- }
-
- Tmp1 = DAG.getNode(ISD::XOR, LHSLo.getValueType(), LHSLo, RHSLo);
- Tmp2 = DAG.getNode(ISD::XOR, LHSLo.getValueType(), LHSHi, RHSHi);
- Tmp1 = DAG.getNode(ISD::OR, Tmp1.getValueType(), Tmp1, Tmp2);
- Tmp2 = DAG.getConstant(0, Tmp1.getValueType());
- break;
- default:
- // If this is a comparison of the sign bit, just look at the top part.
- // X > -1, x < 0
- if (ConstantSDNode *CST = dyn_cast<ConstantSDNode>(RHS))
- if ((cast<CondCodeSDNode>(CC)->get() == ISD::SETLT &&
- CST->isNullValue()) || // X < 0
- (cast<CondCodeSDNode>(CC)->get() == ISD::SETGT &&
- CST->isAllOnesValue())) { // X > -1
- Tmp1 = LHSHi;
- Tmp2 = RHSHi;
- break;
- }
-
- // FIXME: This generated code sucks.
- ISD::CondCode LowCC;
- switch (CCCode) {
- default: assert(0 && "Unknown integer setcc!");
- case ISD::SETLT:
- case ISD::SETULT: LowCC = ISD::SETULT; break;
- case ISD::SETGT:
- case ISD::SETUGT: LowCC = ISD::SETUGT; break;
- case ISD::SETLE:
- case ISD::SETULE: LowCC = ISD::SETULE; break;
- case ISD::SETGE:
- case ISD::SETUGE: LowCC = ISD::SETUGE; break;
- }
-
- // Tmp1 = lo(op1) < lo(op2) // Always unsigned comparison
- // Tmp2 = hi(op1) < hi(op2) // Signedness depends on operands
- // dest = hi(op1) == hi(op2) ? Tmp1 : Tmp2;
-
- // NOTE: on targets without efficient SELECT of bools, we can always use
- // this identity: (B1 ? B2 : B3) --> (B1 & B2)|(!B1&B3)
- TargetLowering::DAGCombinerInfo DagCombineInfo(DAG, false, true, NULL);
- Tmp1 = TLI.SimplifySetCC(TLI.getSetCCResultType(LHSLo), LHSLo, RHSLo,
- LowCC, false, DagCombineInfo);
- if (!Tmp1.Val)
- Tmp1 = DAG.getSetCC(TLI.getSetCCResultType(LHSLo), LHSLo, RHSLo, LowCC);
- Tmp2 = TLI.SimplifySetCC(TLI.getSetCCResultType(LHSHi), LHSHi, RHSHi,
- CCCode, false, DagCombineInfo);
- if (!Tmp2.Val)
- Tmp2 = DAG.getNode(ISD::SETCC, TLI.getSetCCResultType(LHSHi), LHSHi,
- RHSHi,CC);
-
- ConstantSDNode *Tmp1C = dyn_cast<ConstantSDNode>(Tmp1.Val);
- ConstantSDNode *Tmp2C = dyn_cast<ConstantSDNode>(Tmp2.Val);
- if ((Tmp1C && Tmp1C->isNullValue()) ||
- (Tmp2C && Tmp2C->isNullValue() &&
- (CCCode == ISD::SETLE || CCCode == ISD::SETGE ||
- CCCode == ISD::SETUGE || CCCode == ISD::SETULE)) ||
- (Tmp2C && Tmp2C->getAPIntValue() == 1 &&
- (CCCode == ISD::SETLT || CCCode == ISD::SETGT ||
- CCCode == ISD::SETUGT || CCCode == ISD::SETULT))) {
- // low part is known false, returns high part.
- // For LE / GE, if high part is known false, ignore the low part.
- // For LT / GT, if high part is known true, ignore the low part.
- Tmp1 = Tmp2;
- Tmp2 = SDOperand();
- } else {
- Result = TLI.SimplifySetCC(TLI.getSetCCResultType(LHSHi), LHSHi, RHSHi,
- ISD::SETEQ, false, DagCombineInfo);
- if (!Result.Val)
- Result=DAG.getSetCC(TLI.getSetCCResultType(LHSHi), LHSHi, RHSHi,
- ISD::SETEQ);
- Result = LegalizeOp(DAG.getNode(ISD::SELECT, Tmp1.getValueType(),
- Result, Tmp1, Tmp2));
- Tmp1 = Result;
- Tmp2 = SDOperand();
- }
- }
- }
- }
- LHS = Tmp1;
- RHS = Tmp2;
-}
-
-/// EmitStackConvert - Emit a store/load combination to the stack. This stores
-/// SrcOp to a stack slot of type SlotVT, truncating it if needed. It then does
-/// a load from the stack slot to DestVT, extending it if needed.
-/// The resultant code need not be legal.
-SDOperand SelectionDAGLegalize::EmitStackConvert(SDOperand SrcOp,
- MVT::ValueType SlotVT,
- MVT::ValueType DestVT) {
- // Create the stack frame object.
- SDOperand FIPtr = DAG.CreateStackTemporary(SlotVT);
-
- FrameIndexSDNode *StackPtrFI = cast<FrameIndexSDNode>(FIPtr);
- int SPFI = StackPtrFI->getIndex();
-
- unsigned SrcSize = MVT::getSizeInBits(SrcOp.getValueType());
- unsigned SlotSize = MVT::getSizeInBits(SlotVT);
- unsigned DestSize = MVT::getSizeInBits(DestVT);
-
- // Emit a store to the stack slot. Use a truncstore if the input value is
- // later than DestVT.
- SDOperand Store;
- if (SrcSize > SlotSize)
- Store = DAG.getTruncStore(DAG.getEntryNode(), SrcOp, FIPtr,
- PseudoSourceValue::getFixedStack(),
- SPFI, SlotVT);
- else {
- assert(SrcSize == SlotSize && "Invalid store");
- Store = DAG.getStore(DAG.getEntryNode(), SrcOp, FIPtr,
- PseudoSourceValue::getFixedStack(),
- SPFI, SlotVT);
- }
-
- // Result is a load from the stack slot.
- if (SlotSize == DestSize)
- return DAG.getLoad(DestVT, Store, FIPtr, NULL, 0);
-
- assert(SlotSize < DestSize && "Unknown extension!");
- return DAG.getExtLoad(ISD::EXTLOAD, DestVT, Store, FIPtr, NULL, 0, SlotVT);
-}
-
-SDOperand SelectionDAGLegalize::ExpandSCALAR_TO_VECTOR(SDNode *Node) {
- // Create a vector sized/aligned stack slot, store the value to element #0,
- // then load the whole vector back out.
- SDOperand StackPtr = DAG.CreateStackTemporary(Node->getValueType(0));
-
- FrameIndexSDNode *StackPtrFI = cast<FrameIndexSDNode>(StackPtr);
- int SPFI = StackPtrFI->getIndex();
-
- SDOperand Ch = DAG.getStore(DAG.getEntryNode(), Node->getOperand(0), StackPtr,
- PseudoSourceValue::getFixedStack(), SPFI);
- return DAG.getLoad(Node->getValueType(0), Ch, StackPtr,
- PseudoSourceValue::getFixedStack(), SPFI);
-}
-
-
-/// ExpandBUILD_VECTOR - Expand a BUILD_VECTOR node on targets that don't
-/// support the operation, but do support the resultant vector type.
-SDOperand SelectionDAGLegalize::ExpandBUILD_VECTOR(SDNode *Node) {
-
- // If the only non-undef value is the low element, turn this into a
- // SCALAR_TO_VECTOR node. If this is { X, X, X, X }, determine X.
- unsigned NumElems = Node->getNumOperands();
- bool isOnlyLowElement = true;
- SDOperand SplatValue = Node->getOperand(0);
-
- // FIXME: it would be far nicer to change this into map<SDOperand,uint64_t>
- // and use a bitmask instead of a list of elements.
- std::map<SDOperand, std::vector<unsigned> > Values;
- Values[SplatValue].push_back(0);
- bool isConstant = true;
- if (!isa<ConstantFPSDNode>(SplatValue) && !isa<ConstantSDNode>(SplatValue) &&
- SplatValue.getOpcode() != ISD::UNDEF)
- isConstant = false;
-
- for (unsigned i = 1; i < NumElems; ++i) {
- SDOperand V = Node->getOperand(i);
- Values[V].push_back(i);
- if (V.getOpcode() != ISD::UNDEF)
- isOnlyLowElement = false;
- if (SplatValue != V)
- SplatValue = SDOperand(0,0);
-
- // If this isn't a constant element or an undef, we can't use a constant
- // pool load.
- if (!isa<ConstantFPSDNode>(V) && !isa<ConstantSDNode>(V) &&
- V.getOpcode() != ISD::UNDEF)
- isConstant = false;
- }
-
- if (isOnlyLowElement) {
- // If the low element is an undef too, then this whole things is an undef.
- if (Node->getOperand(0).getOpcode() == ISD::UNDEF)
- return DAG.getNode(ISD::UNDEF, Node->getValueType(0));
- // Otherwise, turn this into a scalar_to_vector node.
- return DAG.getNode(ISD::SCALAR_TO_VECTOR, Node->getValueType(0),
- Node->getOperand(0));
- }
-
- // If all elements are constants, create a load from the constant pool.
- if (isConstant) {
- MVT::ValueType VT = Node->getValueType(0);
- std::vector<Constant*> CV;
- for (unsigned i = 0, e = NumElems; i != e; ++i) {
- if (ConstantFPSDNode *V =
- dyn_cast<ConstantFPSDNode>(Node->getOperand(i))) {
- CV.push_back(ConstantFP::get(V->getValueAPF()));
- } else if (ConstantSDNode *V =
- dyn_cast<ConstantSDNode>(Node->getOperand(i))) {
- CV.push_back(ConstantInt::get(V->getAPIntValue()));
- } else {
- assert(Node->getOperand(i).getOpcode() == ISD::UNDEF);
- const Type *OpNTy =
- MVT::getTypeForValueType(Node->getOperand(0).getValueType());
- CV.push_back(UndefValue::get(OpNTy));
- }
- }
- Constant *CP = ConstantVector::get(CV);
- SDOperand CPIdx = DAG.getConstantPool(CP, TLI.getPointerTy());
- return DAG.getLoad(VT, DAG.getEntryNode(), CPIdx,
- PseudoSourceValue::getConstantPool(), 0);
- }
-
- if (SplatValue.Val) { // Splat of one value?
- // Build the shuffle constant vector: <0, 0, 0, 0>
- MVT::ValueType MaskVT =
- MVT::getIntVectorWithNumElements(NumElems);
- SDOperand Zero = DAG.getConstant(0, MVT::getVectorElementType(MaskVT));
- std::vector<SDOperand> ZeroVec(NumElems, Zero);
- SDOperand SplatMask = DAG.getNode(ISD::BUILD_VECTOR, MaskVT,
- &ZeroVec[0], ZeroVec.size());
-
- // If the target supports VECTOR_SHUFFLE and this shuffle mask, use it.
- if (isShuffleLegal(Node->getValueType(0), SplatMask)) {
- // Get the splatted value into the low element of a vector register.
- SDOperand LowValVec =
- DAG.getNode(ISD::SCALAR_TO_VECTOR, Node->getValueType(0), SplatValue);
-
- // Return shuffle(LowValVec, undef, <0,0,0,0>)
- return DAG.getNode(ISD::VECTOR_SHUFFLE, Node->getValueType(0), LowValVec,
- DAG.getNode(ISD::UNDEF, Node->getValueType(0)),
- SplatMask);
- }
- }
-
- // If there are only two unique elements, we may be able to turn this into a
- // vector shuffle.
- if (Values.size() == 2) {
- // Get the two values in deterministic order.
- SDOperand Val1 = Node->getOperand(1);
- SDOperand Val2;
- std::map<SDOperand, std::vector<unsigned> >::iterator MI = Values.begin();
- if (MI->first != Val1)
- Val2 = MI->first;
- else
- Val2 = (++MI)->first;
-
- // If Val1 is an undef, make sure end ends up as Val2, to ensure that our
- // vector shuffle has the undef vector on the RHS.
- if (Val1.getOpcode() == ISD::UNDEF)
- std::swap(Val1, Val2);
-
- // Build the shuffle constant vector: e.g. <0, 4, 0, 4>
- MVT::ValueType MaskVT = MVT::getIntVectorWithNumElements(NumElems);
- MVT::ValueType MaskEltVT = MVT::getVectorElementType(MaskVT);
- std::vector<SDOperand> MaskVec(NumElems);
-
- // Set elements of the shuffle mask for Val1.
- std::vector<unsigned> &Val1Elts = Values[Val1];
- for (unsigned i = 0, e = Val1Elts.size(); i != e; ++i)
- MaskVec[Val1Elts[i]] = DAG.getConstant(0, MaskEltVT);
-
- // Set elements of the shuffle mask for Val2.
- std::vector<unsigned> &Val2Elts = Values[Val2];
- for (unsigned i = 0, e = Val2Elts.size(); i != e; ++i)
- if (Val2.getOpcode() != ISD::UNDEF)
- MaskVec[Val2Elts[i]] = DAG.getConstant(NumElems, MaskEltVT);
- else
- MaskVec[Val2Elts[i]] = DAG.getNode(ISD::UNDEF, MaskEltVT);
-
- SDOperand ShuffleMask = DAG.getNode(ISD::BUILD_VECTOR, MaskVT,
- &MaskVec[0], MaskVec.size());
-
- // If the target supports SCALAR_TO_VECTOR and this shuffle mask, use it.
- if (TLI.isOperationLegal(ISD::SCALAR_TO_VECTOR, Node->getValueType(0)) &&
- isShuffleLegal(Node->getValueType(0), ShuffleMask)) {
- Val1 = DAG.getNode(ISD::SCALAR_TO_VECTOR, Node->getValueType(0), Val1);
- Val2 = DAG.getNode(ISD::SCALAR_TO_VECTOR, Node->getValueType(0), Val2);
- SDOperand Ops[] = { Val1, Val2, ShuffleMask };
-
- // Return shuffle(LoValVec, HiValVec, <0,1,0,1>)
- return DAG.getNode(ISD::VECTOR_SHUFFLE, Node->getValueType(0), Ops, 3);
- }
- }
-
- // Otherwise, we can't handle this case efficiently. Allocate a sufficiently
- // aligned object on the stack, store each element into it, then load
- // the result as a vector.
- MVT::ValueType VT = Node->getValueType(0);
- // Create the stack frame object.
- SDOperand FIPtr = DAG.CreateStackTemporary(VT);
-
- // Emit a store of each element to the stack slot.
- SmallVector<SDOperand, 8> Stores;
- unsigned TypeByteSize =
- MVT::getSizeInBits(Node->getOperand(0).getValueType())/8;
- // Store (in the right endianness) the elements to memory.
- for (unsigned i = 0, e = Node->getNumOperands(); i != e; ++i) {
- // Ignore undef elements.
- if (Node->getOperand(i).getOpcode() == ISD::UNDEF) continue;
-
- unsigned Offset = TypeByteSize*i;
-
- SDOperand Idx = DAG.getConstant(Offset, FIPtr.getValueType());
- Idx = DAG.getNode(ISD::ADD, FIPtr.getValueType(), FIPtr, Idx);
-
- Stores.push_back(DAG.getStore(DAG.getEntryNode(), Node->getOperand(i), Idx,
- NULL, 0));
- }
-
- SDOperand StoreChain;
- if (!Stores.empty()) // Not all undef elements?
- StoreChain = DAG.getNode(ISD::TokenFactor, MVT::Other,
- &Stores[0], Stores.size());
- else
- StoreChain = DAG.getEntryNode();
-
- // Result is a load from the stack slot.
- return DAG.getLoad(VT, StoreChain, FIPtr, NULL, 0);
-}
-
-void SelectionDAGLegalize::ExpandShiftParts(unsigned NodeOp,
- SDOperand Op, SDOperand Amt,
- SDOperand &Lo, SDOperand &Hi) {
- // Expand the subcomponents.
- SDOperand LHSL, LHSH;
- ExpandOp(Op, LHSL, LHSH);
-
- SDOperand Ops[] = { LHSL, LHSH, Amt };
- MVT::ValueType VT = LHSL.getValueType();
- Lo = DAG.getNode(NodeOp, DAG.getNodeValueTypes(VT, VT), 2, Ops, 3);
- Hi = Lo.getValue(1);
-}
-
-
-/// ExpandShift - Try to find a clever way to expand this shift operation out to
-/// smaller elements. If we can't find a way that is more efficient than a
-/// libcall on this target, return false. Otherwise, return true with the
-/// low-parts expanded into Lo and Hi.
-bool SelectionDAGLegalize::ExpandShift(unsigned Opc, SDOperand Op,SDOperand Amt,
- SDOperand &Lo, SDOperand &Hi) {
- assert((Opc == ISD::SHL || Opc == ISD::SRA || Opc == ISD::SRL) &&
- "This is not a shift!");
-
- MVT::ValueType NVT = TLI.getTypeToTransformTo(Op.getValueType());
- SDOperand ShAmt = LegalizeOp(Amt);
- MVT::ValueType ShTy = ShAmt.getValueType();
- unsigned ShBits = MVT::getSizeInBits(ShTy);
- unsigned VTBits = MVT::getSizeInBits(Op.getValueType());
- unsigned NVTBits = MVT::getSizeInBits(NVT);
-
- // Handle the case when Amt is an immediate.
- if (ConstantSDNode *CN = dyn_cast<ConstantSDNode>(Amt.Val)) {
- unsigned Cst = CN->getValue();
- // Expand the incoming operand to be shifted, so that we have its parts
- SDOperand InL, InH;
- ExpandOp(Op, InL, InH);
- switch(Opc) {
- case ISD::SHL:
- if (Cst > VTBits) {
- Lo = DAG.getConstant(0, NVT);
- Hi = DAG.getConstant(0, NVT);
- } else if (Cst > NVTBits) {
- Lo = DAG.getConstant(0, NVT);
- Hi = DAG.getNode(ISD::SHL, NVT, InL, DAG.getConstant(Cst-NVTBits,ShTy));
- } else if (Cst == NVTBits) {
- Lo = DAG.getConstant(0, NVT);
- Hi = InL;
- } else {
- Lo = DAG.getNode(ISD::SHL, NVT, InL, DAG.getConstant(Cst, ShTy));
- Hi = DAG.getNode(ISD::OR, NVT,
- DAG.getNode(ISD::SHL, NVT, InH, DAG.getConstant(Cst, ShTy)),
- DAG.getNode(ISD::SRL, NVT, InL, DAG.getConstant(NVTBits-Cst, ShTy)));
- }
- return true;
- case ISD::SRL:
- if (Cst > VTBits) {
- Lo = DAG.getConstant(0, NVT);
- Hi = DAG.getConstant(0, NVT);
- } else if (Cst > NVTBits) {
- Lo = DAG.getNode(ISD::SRL, NVT, InH, DAG.getConstant(Cst-NVTBits,ShTy));
- Hi = DAG.getConstant(0, NVT);
- } else if (Cst == NVTBits) {
- Lo = InH;
- Hi = DAG.getConstant(0, NVT);
- } else {
- Lo = DAG.getNode(ISD::OR, NVT,
- DAG.getNode(ISD::SRL, NVT, InL, DAG.getConstant(Cst, ShTy)),
- DAG.getNode(ISD::SHL, NVT, InH, DAG.getConstant(NVTBits-Cst, ShTy)));
- Hi = DAG.getNode(ISD::SRL, NVT, InH, DAG.getConstant(Cst, ShTy));
- }
- return true;
- case ISD::SRA:
- if (Cst > VTBits) {
- Hi = Lo = DAG.getNode(ISD::SRA, NVT, InH,
- DAG.getConstant(NVTBits-1, ShTy));
- } else if (Cst > NVTBits) {
- Lo = DAG.getNode(ISD::SRA, NVT, InH,
- DAG.getConstant(Cst-NVTBits, ShTy));
- Hi = DAG.getNode(ISD::SRA, NVT, InH,
- DAG.getConstant(NVTBits-1, ShTy));
- } else if (Cst == NVTBits) {
- Lo = InH;
- Hi = DAG.getNode(ISD::SRA, NVT, InH,
- DAG.getConstant(NVTBits-1, ShTy));
- } else {
- Lo = DAG.getNode(ISD::OR, NVT,
- DAG.getNode(ISD::SRL, NVT, InL, DAG.getConstant(Cst, ShTy)),
- DAG.getNode(ISD::SHL, NVT, InH, DAG.getConstant(NVTBits-Cst, ShTy)));
- Hi = DAG.getNode(ISD::SRA, NVT, InH, DAG.getConstant(Cst, ShTy));
- }
- return true;
- }
- }
-
- // Okay, the shift amount isn't constant. However, if we can tell that it is
- // >= 32 or < 32, we can still simplify it, without knowing the actual value.
- APInt Mask = APInt::getHighBitsSet(ShBits, ShBits - Log2_32(NVTBits));
- APInt KnownZero, KnownOne;
- DAG.ComputeMaskedBits(Amt, Mask, KnownZero, KnownOne);
-
- // If we know that if any of the high bits of the shift amount are one, then
- // we can do this as a couple of simple shifts.
- if (KnownOne.intersects(Mask)) {
- // Mask out the high bit, which we know is set.
- Amt = DAG.getNode(ISD::AND, Amt.getValueType(), Amt,
- DAG.getConstant(~Mask, Amt.getValueType()));
-
- // Expand the incoming operand to be shifted, so that we have its parts
- SDOperand InL, InH;
- ExpandOp(Op, InL, InH);
- switch(Opc) {
- case ISD::SHL:
- Lo = DAG.getConstant(0, NVT); // Low part is zero.
- Hi = DAG.getNode(ISD::SHL, NVT, InL, Amt); // High part from Lo part.
- return true;
- case ISD::SRL:
- Hi = DAG.getConstant(0, NVT); // Hi part is zero.
- Lo = DAG.getNode(ISD::SRL, NVT, InH, Amt); // Lo part from Hi part.
- return true;
- case ISD::SRA:
- Hi = DAG.getNode(ISD::SRA, NVT, InH, // Sign extend high part.
- DAG.getConstant(NVTBits-1, Amt.getValueType()));
- Lo = DAG.getNode(ISD::SRA, NVT, InH, Amt); // Lo part from Hi part.
- return true;
- }
- }
-
- // If we know that the high bits of the shift amount are all zero, then we can
- // do this as a couple of simple shifts.
- if ((KnownZero & Mask) == Mask) {
- // Compute 32-amt.
- SDOperand Amt2 = DAG.getNode(ISD::SUB, Amt.getValueType(),
- DAG.getConstant(NVTBits, Amt.getValueType()),
- Amt);
-
- // Expand the incoming operand to be shifted, so that we have its parts
- SDOperand InL, InH;
- ExpandOp(Op, InL, InH);
- switch(Opc) {
- case ISD::SHL:
- Lo = DAG.getNode(ISD::SHL, NVT, InL, Amt);
- Hi = DAG.getNode(ISD::OR, NVT,
- DAG.getNode(ISD::SHL, NVT, InH, Amt),
- DAG.getNode(ISD::SRL, NVT, InL, Amt2));
- return true;
- case ISD::SRL:
- Hi = DAG.getNode(ISD::SRL, NVT, InH, Amt);
- Lo = DAG.getNode(ISD::OR, NVT,
- DAG.getNode(ISD::SRL, NVT, InL, Amt),
- DAG.getNode(ISD::SHL, NVT, InH, Amt2));
- return true;
- case ISD::SRA:
- Hi = DAG.getNode(ISD::SRA, NVT, InH, Amt);
- Lo = DAG.getNode(ISD::OR, NVT,
- DAG.getNode(ISD::SRL, NVT, InL, Amt),
- DAG.getNode(ISD::SHL, NVT, InH, Amt2));
- return true;
- }
- }
-
- return false;
-}
-
-
-// ExpandLibCall - Expand a node into a call to a libcall. If the result value
-// does not fit into a register, return the lo part and set the hi part to the
-// by-reg argument. If it does fit into a single register, return the result
-// and leave the Hi part unset.
-SDOperand SelectionDAGLegalize::ExpandLibCall(RTLIB::Libcall LC, SDNode *Node,
- bool isSigned, SDOperand &Hi) {
- assert(!IsLegalizingCall && "Cannot overlap legalization of calls!");
- // The input chain to this libcall is the entry node of the function.
- // Legalizing the call will automatically add the previous call to the
- // dependence.
- SDOperand InChain = DAG.getEntryNode();
-
- TargetLowering::ArgListTy Args;
- TargetLowering::ArgListEntry Entry;
- for (unsigned i = 0, e = Node->getNumOperands(); i != e; ++i) {
- MVT::ValueType ArgVT = Node->getOperand(i).getValueType();
- const Type *ArgTy = MVT::getTypeForValueType(ArgVT);
- Entry.Node = Node->getOperand(i); Entry.Ty = ArgTy;
- Entry.isSExt = isSigned;
- Entry.isZExt = !isSigned;
- Args.push_back(Entry);
- }
- SDOperand Callee = DAG.getExternalSymbol(TLI.getLibcallName(LC),
- TLI.getPointerTy());
-
- // Splice the libcall in wherever FindInputOutputChains tells us to.
- const Type *RetTy = MVT::getTypeForValueType(Node->getValueType(0));
- std::pair<SDOperand,SDOperand> CallInfo =
- TLI.LowerCallTo(InChain, RetTy, isSigned, !isSigned, false, CallingConv::C,
- false, Callee, Args, DAG);
-
- // Legalize the call sequence, starting with the chain. This will advance
- // the LastCALLSEQ_END to the legalized version of the CALLSEQ_END node that
- // was added by LowerCallTo (guaranteeing proper serialization of calls).
- LegalizeOp(CallInfo.second);
- SDOperand Result;
- switch (getTypeAction(CallInfo.first.getValueType())) {
- default: assert(0 && "Unknown thing");
- case Legal:
- Result = CallInfo.first;
- break;
- case Expand:
- ExpandOp(CallInfo.first, Result, Hi);
- break;
- }
- return Result;
-}
-
-
-/// ExpandIntToFP - Expand a [US]INT_TO_FP operation.
-///
-SDOperand SelectionDAGLegalize::
-ExpandIntToFP(bool isSigned, MVT::ValueType DestTy, SDOperand Source) {
- MVT::ValueType SourceVT = Source.getValueType();
- bool ExpandSource = getTypeAction(SourceVT) == Expand;
-
- // Special case for i32 source to take advantage of UINTTOFP_I32_F32, etc.
- if (!isSigned && SourceVT != MVT::i32) {
- // The integer value loaded will be incorrectly if the 'sign bit' of the
- // incoming integer is set. To handle this, we dynamically test to see if
- // it is set, and, if so, add a fudge factor.
- SDOperand Hi;
- if (ExpandSource) {
- SDOperand Lo;
- ExpandOp(Source, Lo, Hi);
- Source = DAG.getNode(ISD::BUILD_PAIR, SourceVT, Lo, Hi);
- } else {
- // The comparison for the sign bit will use the entire operand.
- Hi = Source;
- }
-
- // If this is unsigned, and not supported, first perform the conversion to
- // signed, then adjust the result if the sign bit is set.
- SDOperand SignedConv = ExpandIntToFP(true, DestTy, Source);
-
- SDOperand SignSet = DAG.getSetCC(TLI.getSetCCResultType(Hi), Hi,
- DAG.getConstant(0, Hi.getValueType()),
- ISD::SETLT);
- SDOperand Zero = DAG.getIntPtrConstant(0), Four = DAG.getIntPtrConstant(4);
- SDOperand CstOffset = DAG.getNode(ISD::SELECT, Zero.getValueType(),
- SignSet, Four, Zero);
- uint64_t FF = 0x5f800000ULL;
- if (TLI.isLittleEndian()) FF <<= 32;
- static Constant *FudgeFactor = ConstantInt::get(Type::Int64Ty, FF);
-
- SDOperand CPIdx = DAG.getConstantPool(FudgeFactor, TLI.getPointerTy());
- CPIdx = DAG.getNode(ISD::ADD, TLI.getPointerTy(), CPIdx, CstOffset);
- SDOperand FudgeInReg;
- if (DestTy == MVT::f32)
- FudgeInReg = DAG.getLoad(MVT::f32, DAG.getEntryNode(), CPIdx,
- PseudoSourceValue::getConstantPool(), 0);
- else if (MVT::getSizeInBits(DestTy) > MVT::getSizeInBits(MVT::f32))
- // FIXME: Avoid the extend by construction the right constantpool?
- FudgeInReg = DAG.getExtLoad(ISD::EXTLOAD, DestTy, DAG.getEntryNode(),
- CPIdx,
- PseudoSourceValue::getConstantPool(), 0,
- MVT::f32);
- else
- assert(0 && "Unexpected conversion");
-
- MVT::ValueType SCVT = SignedConv.getValueType();
- if (SCVT != DestTy) {
- // Destination type needs to be expanded as well. The FADD now we are
- // constructing will be expanded into a libcall.
- if (MVT::getSizeInBits(SCVT) != MVT::getSizeInBits(DestTy)) {
- assert(MVT::getSizeInBits(SCVT) * 2 == MVT::getSizeInBits(DestTy));
- SignedConv = DAG.getNode(ISD::BUILD_PAIR, DestTy,
- SignedConv, SignedConv.getValue(1));
- }
- SignedConv = DAG.getNode(ISD::BIT_CONVERT, DestTy, SignedConv);
- }
- return DAG.getNode(ISD::FADD, DestTy, SignedConv, FudgeInReg);
- }
-
- // Check to see if the target has a custom way to lower this. If so, use it.
- switch (TLI.getOperationAction(ISD::SINT_TO_FP, SourceVT)) {
- default: assert(0 && "This action not implemented for this operation!");
- case TargetLowering::Legal:
- case TargetLowering::Expand:
- break; // This case is handled below.
- case TargetLowering::Custom: {
- SDOperand NV = TLI.LowerOperation(DAG.getNode(ISD::SINT_TO_FP, DestTy,
- Source), DAG);
- if (NV.Val)
- return LegalizeOp(NV);
- break; // The target decided this was legal after all
- }
- }
-
- // Expand the source, then glue it back together for the call. We must expand
- // the source in case it is shared (this pass of legalize must traverse it).
- if (ExpandSource) {
- SDOperand SrcLo, SrcHi;
- ExpandOp(Source, SrcLo, SrcHi);
- Source = DAG.getNode(ISD::BUILD_PAIR, SourceVT, SrcLo, SrcHi);
- }
-
- RTLIB::Libcall LC;
- if (SourceVT == MVT::i32) {
- if (DestTy == MVT::f32)
- LC = isSigned ? RTLIB::SINTTOFP_I32_F32 : RTLIB::UINTTOFP_I32_F32;
- else {
- assert(DestTy == MVT::f64 && "Unknown fp value type!");
- LC = isSigned ? RTLIB::SINTTOFP_I32_F64 : RTLIB::UINTTOFP_I32_F64;
- }
- } else if (SourceVT == MVT::i64) {
- if (DestTy == MVT::f32)
- LC = RTLIB::SINTTOFP_I64_F32;
- else if (DestTy == MVT::f64)
- LC = RTLIB::SINTTOFP_I64_F64;
- else if (DestTy == MVT::f80)
- LC = RTLIB::SINTTOFP_I64_F80;
- else {
- assert(DestTy == MVT::ppcf128 && "Unknown fp value type!");
- LC = RTLIB::SINTTOFP_I64_PPCF128;
- }
- } else if (SourceVT == MVT::i128) {
- if (DestTy == MVT::f32)
- LC = RTLIB::SINTTOFP_I128_F32;
- else if (DestTy == MVT::f64)
- LC = RTLIB::SINTTOFP_I128_F64;
- else if (DestTy == MVT::f80)
- LC = RTLIB::SINTTOFP_I128_F80;
- else {
- assert(DestTy == MVT::ppcf128 && "Unknown fp value type!");
- LC = RTLIB::SINTTOFP_I128_PPCF128;
- }
- } else {
- assert(0 && "Unknown int value type");
- }
-
- assert(TLI.getLibcallName(LC) && "Don't know how to expand this SINT_TO_FP!");
- Source = DAG.getNode(ISD::SINT_TO_FP, DestTy, Source);
- SDOperand HiPart;
- SDOperand Result = ExpandLibCall(LC, Source.Val, isSigned, HiPart);
- if (Result.getValueType() != DestTy && HiPart.Val)
- Result = DAG.getNode(ISD::BUILD_PAIR, DestTy, Result, HiPart);
- return Result;
-}
-
-/// ExpandLegalINT_TO_FP - This function is responsible for legalizing a
-/// INT_TO_FP operation of the specified operand when the target requests that
-/// we expand it. At this point, we know that the result and operand types are
-/// legal for the target.
-SDOperand SelectionDAGLegalize::ExpandLegalINT_TO_FP(bool isSigned,
- SDOperand Op0,
- MVT::ValueType DestVT) {
- if (Op0.getValueType() == MVT::i32) {
- // simple 32-bit [signed|unsigned] integer to float/double expansion
-
- // Get the stack frame index of a 8 byte buffer.
- SDOperand StackSlot = DAG.CreateStackTemporary(MVT::f64);
-
- // word offset constant for Hi/Lo address computation
- SDOperand WordOff = DAG.getConstant(sizeof(int), TLI.getPointerTy());
- // set up Hi and Lo (into buffer) address based on endian
- SDOperand Hi = StackSlot;
- SDOperand Lo = DAG.getNode(ISD::ADD, TLI.getPointerTy(), StackSlot,WordOff);
- if (TLI.isLittleEndian())
- std::swap(Hi, Lo);
-
- // if signed map to unsigned space
- SDOperand Op0Mapped;
- if (isSigned) {
- // constant used to invert sign bit (signed to unsigned mapping)
- SDOperand SignBit = DAG.getConstant(0x80000000u, MVT::i32);
- Op0Mapped = DAG.getNode(ISD::XOR, MVT::i32, Op0, SignBit);
- } else {
- Op0Mapped = Op0;
- }
- // store the lo of the constructed double - based on integer input
- SDOperand Store1 = DAG.getStore(DAG.getEntryNode(),
- Op0Mapped, Lo, NULL, 0);
- // initial hi portion of constructed double
- SDOperand InitialHi = DAG.getConstant(0x43300000u, MVT::i32);
- // store the hi of the constructed double - biased exponent
- SDOperand Store2=DAG.getStore(Store1, InitialHi, Hi, NULL, 0);
- // load the constructed double
- SDOperand Load = DAG.getLoad(MVT::f64, Store2, StackSlot, NULL, 0);
- // FP constant to bias correct the final result
- SDOperand Bias = DAG.getConstantFP(isSigned ?
- BitsToDouble(0x4330000080000000ULL)
- : BitsToDouble(0x4330000000000000ULL),
- MVT::f64);
- // subtract the bias
- SDOperand Sub = DAG.getNode(ISD::FSUB, MVT::f64, Load, Bias);
- // final result
- SDOperand Result;
- // handle final rounding
- if (DestVT == MVT::f64) {
- // do nothing
- Result = Sub;
- } else if (MVT::getSizeInBits(DestVT) < MVT::getSizeInBits(MVT::f64)) {
- Result = DAG.getNode(ISD::FP_ROUND, DestVT, Sub,
- DAG.getIntPtrConstant(0));
- } else if (MVT::getSizeInBits(DestVT) > MVT::getSizeInBits(MVT::f64)) {
- Result = DAG.getNode(ISD::FP_EXTEND, DestVT, Sub);
- }
- return Result;
- }
- assert(!isSigned && "Legalize cannot Expand SINT_TO_FP for i64 yet");
- SDOperand Tmp1 = DAG.getNode(ISD::SINT_TO_FP, DestVT, Op0);
-
- SDOperand SignSet = DAG.getSetCC(TLI.getSetCCResultType(Op0), Op0,
- DAG.getConstant(0, Op0.getValueType()),
- ISD::SETLT);
- SDOperand Zero = DAG.getIntPtrConstant(0), Four = DAG.getIntPtrConstant(4);
- SDOperand CstOffset = DAG.getNode(ISD::SELECT, Zero.getValueType(),
- SignSet, Four, Zero);
-
- // If the sign bit of the integer is set, the large number will be treated
- // as a negative number. To counteract this, the dynamic code adds an
- // offset depending on the data type.
- uint64_t FF;
- switch (Op0.getValueType()) {
- default: assert(0 && "Unsupported integer type!");
- case MVT::i8 : FF = 0x43800000ULL; break; // 2^8 (as a float)
- case MVT::i16: FF = 0x47800000ULL; break; // 2^16 (as a float)
- case MVT::i32: FF = 0x4F800000ULL; break; // 2^32 (as a float)
- case MVT::i64: FF = 0x5F800000ULL; break; // 2^64 (as a float)
- }
- if (TLI.isLittleEndian()) FF <<= 32;
- static Constant *FudgeFactor = ConstantInt::get(Type::Int64Ty, FF);
-
- SDOperand CPIdx = DAG.getConstantPool(FudgeFactor, TLI.getPointerTy());
- CPIdx = DAG.getNode(ISD::ADD, TLI.getPointerTy(), CPIdx, CstOffset);
- SDOperand FudgeInReg;
- if (DestVT == MVT::f32)
- FudgeInReg = DAG.getLoad(MVT::f32, DAG.getEntryNode(), CPIdx,
- PseudoSourceValue::getConstantPool(), 0);
- else {
- FudgeInReg =
- LegalizeOp(DAG.getExtLoad(ISD::EXTLOAD, DestVT,
- DAG.getEntryNode(), CPIdx,
- PseudoSourceValue::getConstantPool(), 0,
- MVT::f32));
- }
-
- return DAG.getNode(ISD::FADD, DestVT, Tmp1, FudgeInReg);
-}
-
-/// PromoteLegalINT_TO_FP - This function is responsible for legalizing a
-/// *INT_TO_FP operation of the specified operand when the target requests that
-/// we promote it. At this point, we know that the result and operand types are
-/// legal for the target, and that there is a legal UINT_TO_FP or SINT_TO_FP
-/// operation that takes a larger input.
-SDOperand SelectionDAGLegalize::PromoteLegalINT_TO_FP(SDOperand LegalOp,
- MVT::ValueType DestVT,
- bool isSigned) {
- // First step, figure out the appropriate *INT_TO_FP operation to use.
- MVT::ValueType NewInTy = LegalOp.getValueType();
-
- unsigned OpToUse = 0;
-
- // Scan for the appropriate larger type to use.
- while (1) {
- NewInTy = (MVT::ValueType)(NewInTy+1);
- assert(MVT::isInteger(NewInTy) && "Ran out of possibilities!");
-
- // If the target supports SINT_TO_FP of this type, use it.
- switch (TLI.getOperationAction(ISD::SINT_TO_FP, NewInTy)) {
- default: break;
- case TargetLowering::Legal:
- if (!TLI.isTypeLegal(NewInTy))
- break; // Can't use this datatype.
- // FALL THROUGH.
- case TargetLowering::Custom:
- OpToUse = ISD::SINT_TO_FP;
- break;
- }
- if (OpToUse) break;
- if (isSigned) continue;
-
- // If the target supports UINT_TO_FP of this type, use it.
- switch (TLI.getOperationAction(ISD::UINT_TO_FP, NewInTy)) {
- default: break;
- case TargetLowering::Legal:
- if (!TLI.isTypeLegal(NewInTy))
- break; // Can't use this datatype.
- // FALL THROUGH.
- case TargetLowering::Custom:
- OpToUse = ISD::UINT_TO_FP;
- break;
- }
- if (OpToUse) break;
-
- // Otherwise, try a larger type.
- }
-
- // Okay, we found the operation and type to use. Zero extend our input to the
- // desired type then run the operation on it.
- return DAG.getNode(OpToUse, DestVT,
- DAG.getNode(isSigned ? ISD::SIGN_EXTEND : ISD::ZERO_EXTEND,
- NewInTy, LegalOp));
-}
-
-/// PromoteLegalFP_TO_INT - This function is responsible for legalizing a
-/// FP_TO_*INT operation of the specified operand when the target requests that
-/// we promote it. At this point, we know that the result and operand types are
-/// legal for the target, and that there is a legal FP_TO_UINT or FP_TO_SINT
-/// operation that returns a larger result.
-SDOperand SelectionDAGLegalize::PromoteLegalFP_TO_INT(SDOperand LegalOp,
- MVT::ValueType DestVT,
- bool isSigned) {
- // First step, figure out the appropriate FP_TO*INT operation to use.
- MVT::ValueType NewOutTy = DestVT;
-
- unsigned OpToUse = 0;
-
- // Scan for the appropriate larger type to use.
- while (1) {
- NewOutTy = (MVT::ValueType)(NewOutTy+1);
- assert(MVT::isInteger(NewOutTy) && "Ran out of possibilities!");
-
- // If the target supports FP_TO_SINT returning this type, use it.
- switch (TLI.getOperationAction(ISD::FP_TO_SINT, NewOutTy)) {
- default: break;
- case TargetLowering::Legal:
- if (!TLI.isTypeLegal(NewOutTy))
- break; // Can't use this datatype.
- // FALL THROUGH.
- case TargetLowering::Custom:
- OpToUse = ISD::FP_TO_SINT;
- break;
- }
- if (OpToUse) break;
-
- // If the target supports FP_TO_UINT of this type, use it.
- switch (TLI.getOperationAction(ISD::FP_TO_UINT, NewOutTy)) {
- default: break;
- case TargetLowering::Legal:
- if (!TLI.isTypeLegal(NewOutTy))
- break; // Can't use this datatype.
- // FALL THROUGH.
- case TargetLowering::Custom:
- OpToUse = ISD::FP_TO_UINT;
- break;
- }
- if (OpToUse) break;
-
- // Otherwise, try a larger type.
- }
-
-
- // Okay, we found the operation and type to use.
- SDOperand Operation = DAG.getNode(OpToUse, NewOutTy, LegalOp);
-
- // If the operation produces an invalid type, it must be custom lowered. Use
- // the target lowering hooks to expand it. Just keep the low part of the
- // expanded operation, we know that we're truncating anyway.
- if (getTypeAction(NewOutTy) == Expand) {
- Operation = SDOperand(TLI.ExpandOperationResult(Operation.Val, DAG), 0);
- assert(Operation.Val && "Didn't return anything");
- }
-
- // Truncate the result of the extended FP_TO_*INT operation to the desired
- // size.
- return DAG.getNode(ISD::TRUNCATE, DestVT, Operation);
-}
-
-/// ExpandBSWAP - Open code the operations for BSWAP of the specified operation.
-///
-SDOperand SelectionDAGLegalize::ExpandBSWAP(SDOperand Op) {
- MVT::ValueType VT = Op.getValueType();
- MVT::ValueType SHVT = TLI.getShiftAmountTy();
- SDOperand Tmp1, Tmp2, Tmp3, Tmp4, Tmp5, Tmp6, Tmp7, Tmp8;
- switch (VT) {
- default: assert(0 && "Unhandled Expand type in BSWAP!"); abort();
- case MVT::i16:
- Tmp2 = DAG.getNode(ISD::SHL, VT, Op, DAG.getConstant(8, SHVT));
- Tmp1 = DAG.getNode(ISD::SRL, VT, Op, DAG.getConstant(8, SHVT));
- return DAG.getNode(ISD::OR, VT, Tmp1, Tmp2);
- case MVT::i32:
- Tmp4 = DAG.getNode(ISD::SHL, VT, Op, DAG.getConstant(24, SHVT));
- Tmp3 = DAG.getNode(ISD::SHL, VT, Op, DAG.getConstant(8, SHVT));
- Tmp2 = DAG.getNode(ISD::SRL, VT, Op, DAG.getConstant(8, SHVT));
- Tmp1 = DAG.getNode(ISD::SRL, VT, Op, DAG.getConstant(24, SHVT));
- Tmp3 = DAG.getNode(ISD::AND, VT, Tmp3, DAG.getConstant(0xFF0000, VT));
- Tmp2 = DAG.getNode(ISD::AND, VT, Tmp2, DAG.getConstant(0xFF00, VT));
- Tmp4 = DAG.getNode(ISD::OR, VT, Tmp4, Tmp3);
- Tmp2 = DAG.getNode(ISD::OR, VT, Tmp2, Tmp1);
- return DAG.getNode(ISD::OR, VT, Tmp4, Tmp2);
- case MVT::i64:
- Tmp8 = DAG.getNode(ISD::SHL, VT, Op, DAG.getConstant(56, SHVT));
- Tmp7 = DAG.getNode(ISD::SHL, VT, Op, DAG.getConstant(40, SHVT));
- Tmp6 = DAG.getNode(ISD::SHL, VT, Op, DAG.getConstant(24, SHVT));
- Tmp5 = DAG.getNode(ISD::SHL, VT, Op, DAG.getConstant(8, SHVT));
- Tmp4 = DAG.getNode(ISD::SRL, VT, Op, DAG.getConstant(8, SHVT));
- Tmp3 = DAG.getNode(ISD::SRL, VT, Op, DAG.getConstant(24, SHVT));
- Tmp2 = DAG.getNode(ISD::SRL, VT, Op, DAG.getConstant(40, SHVT));
- Tmp1 = DAG.getNode(ISD::SRL, VT, Op, DAG.getConstant(56, SHVT));
- Tmp7 = DAG.getNode(ISD::AND, VT, Tmp7, DAG.getConstant(255ULL<<48, VT));
- Tmp6 = DAG.getNode(ISD::AND, VT, Tmp6, DAG.getConstant(255ULL<<40, VT));
- Tmp5 = DAG.getNode(ISD::AND, VT, Tmp5, DAG.getConstant(255ULL<<32, VT));
- Tmp4 = DAG.getNode(ISD::AND, VT, Tmp4, DAG.getConstant(255ULL<<24, VT));
- Tmp3 = DAG.getNode(ISD::AND, VT, Tmp3, DAG.getConstant(255ULL<<16, VT));
- Tmp2 = DAG.getNode(ISD::AND, VT, Tmp2, DAG.getConstant(255ULL<<8 , VT));
- Tmp8 = DAG.getNode(ISD::OR, VT, Tmp8, Tmp7);
- Tmp6 = DAG.getNode(ISD::OR, VT, Tmp6, Tmp5);
- Tmp4 = DAG.getNode(ISD::OR, VT, Tmp4, Tmp3);
- Tmp2 = DAG.getNode(ISD::OR, VT, Tmp2, Tmp1);
- Tmp8 = DAG.getNode(ISD::OR, VT, Tmp8, Tmp6);
- Tmp4 = DAG.getNode(ISD::OR, VT, Tmp4, Tmp2);
- return DAG.getNode(ISD::OR, VT, Tmp8, Tmp4);
- }
-}
-
-/// ExpandBitCount - Expand the specified bitcount instruction into operations.
-///
-SDOperand SelectionDAGLegalize::ExpandBitCount(unsigned Opc, SDOperand Op) {
- switch (Opc) {
- default: assert(0 && "Cannot expand this yet!");
- case ISD::CTPOP: {
- static const uint64_t mask[6] = {
- 0x5555555555555555ULL, 0x3333333333333333ULL,
- 0x0F0F0F0F0F0F0F0FULL, 0x00FF00FF00FF00FFULL,
- 0x0000FFFF0000FFFFULL, 0x00000000FFFFFFFFULL
- };
- MVT::ValueType VT = Op.getValueType();
- MVT::ValueType ShVT = TLI.getShiftAmountTy();
- unsigned len = MVT::getSizeInBits(VT);
- for (unsigned i = 0; (1U << i) <= (len / 2); ++i) {
- //x = (x & mask[i][len/8]) + (x >> (1 << i) & mask[i][len/8])
- SDOperand Tmp2 = DAG.getConstant(mask[i], VT);
- SDOperand Tmp3 = DAG.getConstant(1ULL << i, ShVT);
- Op = DAG.getNode(ISD::ADD, VT, DAG.getNode(ISD::AND, VT, Op, Tmp2),
- DAG.getNode(ISD::AND, VT,
- DAG.getNode(ISD::SRL, VT, Op, Tmp3),Tmp2));
- }
- return Op;
- }
- case ISD::CTLZ: {
- // for now, we do this:
- // x = x | (x >> 1);
- // x = x | (x >> 2);
- // ...
- // x = x | (x >>16);
- // x = x | (x >>32); // for 64-bit input
- // return popcount(~x);
- //
- // but see also: http://www.hackersdelight.org/HDcode/nlz.cc
- MVT::ValueType VT = Op.getValueType();
- MVT::ValueType ShVT = TLI.getShiftAmountTy();
- unsigned len = MVT::getSizeInBits(VT);
- for (unsigned i = 0; (1U << i) <= (len / 2); ++i) {
- SDOperand Tmp3 = DAG.getConstant(1ULL << i, ShVT);
- Op = DAG.getNode(ISD::OR, VT, Op, DAG.getNode(ISD::SRL, VT, Op, Tmp3));
- }
- Op = DAG.getNode(ISD::XOR, VT, Op, DAG.getConstant(~0ULL, VT));
- return DAG.getNode(ISD::CTPOP, VT, Op);
- }
- case ISD::CTTZ: {
- // for now, we use: { return popcount(~x & (x - 1)); }
- // unless the target has ctlz but not ctpop, in which case we use:
- // { return 32 - nlz(~x & (x-1)); }
- // see also http://www.hackersdelight.org/HDcode/ntz.cc
- MVT::ValueType VT = Op.getValueType();
- SDOperand Tmp2 = DAG.getConstant(~0ULL, VT);
- SDOperand Tmp3 = DAG.getNode(ISD::AND, VT,
- DAG.getNode(ISD::XOR, VT, Op, Tmp2),
- DAG.getNode(ISD::SUB, VT, Op, DAG.getConstant(1, VT)));
- // If ISD::CTLZ is legal and CTPOP isn't, then do that instead.
- if (!TLI.isOperationLegal(ISD::CTPOP, VT) &&
- TLI.isOperationLegal(ISD::CTLZ, VT))
- return DAG.getNode(ISD::SUB, VT,
- DAG.getConstant(MVT::getSizeInBits(VT), VT),
- DAG.getNode(ISD::CTLZ, VT, Tmp3));
- return DAG.getNode(ISD::CTPOP, VT, Tmp3);
- }
- }
-}
-
-/// ExpandOp - Expand the specified SDOperand into its two component pieces
-/// Lo&Hi. Note that the Op MUST be an expanded type. As a result of this, the
-/// LegalizeNodes map is filled in for any results that are not expanded, the
-/// ExpandedNodes map is filled in for any results that are expanded, and the
-/// Lo/Hi values are returned.
-void SelectionDAGLegalize::ExpandOp(SDOperand Op, SDOperand &Lo, SDOperand &Hi){
- MVT::ValueType VT = Op.getValueType();
- MVT::ValueType NVT = TLI.getTypeToTransformTo(VT);
- SDNode *Node = Op.Val;
- assert(getTypeAction(VT) == Expand && "Not an expanded type!");
- assert(((MVT::isInteger(NVT) && NVT < VT) || MVT::isFloatingPoint(VT) ||
- MVT::isVector(VT)) &&
- "Cannot expand to FP value or to larger int value!");
-
- // See if we already expanded it.
- DenseMap<SDOperand, std::pair<SDOperand, SDOperand> >::iterator I
- = ExpandedNodes.find(Op);
- if (I != ExpandedNodes.end()) {
- Lo = I->second.first;
- Hi = I->second.second;
- return;
- }
-
- switch (Node->getOpcode()) {
- case ISD::CopyFromReg:
- assert(0 && "CopyFromReg must be legal!");
- case ISD::FP_ROUND_INREG:
- if (VT == MVT::ppcf128 &&
- TLI.getOperationAction(ISD::FP_ROUND_INREG, VT) ==
- TargetLowering::Custom) {
- SDOperand SrcLo, SrcHi, Src;
- ExpandOp(Op.getOperand(0), SrcLo, SrcHi);
- Src = DAG.getNode(ISD::BUILD_PAIR, VT, SrcLo, SrcHi);
- SDOperand Result = TLI.LowerOperation(
- DAG.getNode(ISD::FP_ROUND_INREG, VT, Src, Op.getOperand(1)), DAG);
- assert(Result.Val->getOpcode() == ISD::BUILD_PAIR);
- Lo = Result.Val->getOperand(0);
- Hi = Result.Val->getOperand(1);
- break;
- }
- // fall through
- default:
-#ifndef NDEBUG
- cerr << "NODE: "; Node->dump(&DAG); cerr << "\n";
-#endif
- assert(0 && "Do not know how to expand this operator!");
- abort();
- case ISD::EXTRACT_ELEMENT:
- ExpandOp(Node->getOperand(0), Lo, Hi);
- if (cast<ConstantSDNode>(Node->getOperand(1))->getValue())
- return ExpandOp(Hi, Lo, Hi);
- return ExpandOp(Lo, Lo, Hi);
- case ISD::EXTRACT_VECTOR_ELT:
- assert(VT==MVT::i64 && "Do not know how to expand this operator!");
- // ExpandEXTRACT_VECTOR_ELT tolerates invalid result types.
- Lo = ExpandEXTRACT_VECTOR_ELT(Op);
- return ExpandOp(Lo, Lo, Hi);
- case ISD::UNDEF:
- NVT = TLI.getTypeToExpandTo(VT);
- Lo = DAG.getNode(ISD::UNDEF, NVT);
- Hi = DAG.getNode(ISD::UNDEF, NVT);
- break;
- case ISD::Constant: {
- unsigned NVTBits = MVT::getSizeInBits(NVT);
- const APInt &Cst = cast<ConstantSDNode>(Node)->getAPIntValue();
- Lo = DAG.getConstant(APInt(Cst).trunc(NVTBits), NVT);
- Hi = DAG.getConstant(Cst.lshr(NVTBits).trunc(NVTBits), NVT);
- break;
- }
- case ISD::ConstantFP: {
- ConstantFPSDNode *CFP = cast<ConstantFPSDNode>(Node);
- if (CFP->getValueType(0) == MVT::ppcf128) {
- APInt api = CFP->getValueAPF().convertToAPInt();
- Lo = DAG.getConstantFP(APFloat(APInt(64, 1, &api.getRawData()[1])),
- MVT::f64);
- Hi = DAG.getConstantFP(APFloat(APInt(64, 1, &api.getRawData()[0])),
- MVT::f64);
- break;
- }
- Lo = ExpandConstantFP(CFP, false, DAG, TLI);
- if (getTypeAction(Lo.getValueType()) == Expand)
- ExpandOp(Lo, Lo, Hi);
- break;
- }
- case ISD::BUILD_PAIR:
- // Return the operands.
- Lo = Node->getOperand(0);
- Hi = Node->getOperand(1);
- break;
-
- case ISD::MERGE_VALUES:
- if (Node->getNumValues() == 1) {
- ExpandOp(Op.getOperand(0), Lo, Hi);
- break;
- }
- // FIXME: For now only expand i64,chain = MERGE_VALUES (x, y)
- assert(Op.ResNo == 0 && Node->getNumValues() == 2 &&
- Op.getValue(1).getValueType() == MVT::Other &&
- "unhandled MERGE_VALUES");
- ExpandOp(Op.getOperand(0), Lo, Hi);
- // Remember that we legalized the chain.
- AddLegalizedOperand(Op.getValue(1), LegalizeOp(Op.getOperand(1)));
- break;
-
- case ISD::SIGN_EXTEND_INREG:
- ExpandOp(Node->getOperand(0), Lo, Hi);
- // sext_inreg the low part if needed.
- Lo = DAG.getNode(ISD::SIGN_EXTEND_INREG, NVT, Lo, Node->getOperand(1));
-
- // The high part gets the sign extension from the lo-part. This handles
- // things like sextinreg V:i64 from i8.
- Hi = DAG.getNode(ISD::SRA, NVT, Lo,
- DAG.getConstant(MVT::getSizeInBits(NVT)-1,
- TLI.getShiftAmountTy()));
- break;
-
- case ISD::BSWAP: {
- ExpandOp(Node->getOperand(0), Lo, Hi);
- SDOperand TempLo = DAG.getNode(ISD::BSWAP, NVT, Hi);
- Hi = DAG.getNode(ISD::BSWAP, NVT, Lo);
- Lo = TempLo;
- break;
- }
-
- case ISD::CTPOP:
- ExpandOp(Node->getOperand(0), Lo, Hi);
- Lo = DAG.getNode(ISD::ADD, NVT, // ctpop(HL) -> ctpop(H)+ctpop(L)
- DAG.getNode(ISD::CTPOP, NVT, Lo),
- DAG.getNode(ISD::CTPOP, NVT, Hi));
- Hi = DAG.getConstant(0, NVT);
- break;
-
- case ISD::CTLZ: {
- // ctlz (HL) -> ctlz(H) != 32 ? ctlz(H) : (ctlz(L)+32)
- ExpandOp(Node->getOperand(0), Lo, Hi);
- SDOperand BitsC = DAG.getConstant(MVT::getSizeInBits(NVT), NVT);
- SDOperand HLZ = DAG.getNode(ISD::CTLZ, NVT, Hi);
- SDOperand TopNotZero = DAG.getSetCC(TLI.getSetCCResultType(HLZ), HLZ, BitsC,
- ISD::SETNE);
- SDOperand LowPart = DAG.getNode(ISD::CTLZ, NVT, Lo);
- LowPart = DAG.getNode(ISD::ADD, NVT, LowPart, BitsC);
-
- Lo = DAG.getNode(ISD::SELECT, NVT, TopNotZero, HLZ, LowPart);
- Hi = DAG.getConstant(0, NVT);
- break;
- }
-
- case ISD::CTTZ: {
- // cttz (HL) -> cttz(L) != 32 ? cttz(L) : (cttz(H)+32)
- ExpandOp(Node->getOperand(0), Lo, Hi);
- SDOperand BitsC = DAG.getConstant(MVT::getSizeInBits(NVT), NVT);
- SDOperand LTZ = DAG.getNode(ISD::CTTZ, NVT, Lo);
- SDOperand BotNotZero = DAG.getSetCC(TLI.getSetCCResultType(LTZ), LTZ, BitsC,
- ISD::SETNE);
- SDOperand HiPart = DAG.getNode(ISD::CTTZ, NVT, Hi);
- HiPart = DAG.getNode(ISD::ADD, NVT, HiPart, BitsC);
-
- Lo = DAG.getNode(ISD::SELECT, NVT, BotNotZero, LTZ, HiPart);
- Hi = DAG.getConstant(0, NVT);
- break;
- }
-
- case ISD::VAARG: {
- SDOperand Ch = Node->getOperand(0); // Legalize the chain.
- SDOperand Ptr = Node->getOperand(1); // Legalize the pointer.
- Lo = DAG.getVAArg(NVT, Ch, Ptr, Node->getOperand(2));
- Hi = DAG.getVAArg(NVT, Lo.getValue(1), Ptr, Node->getOperand(2));
-
- // Remember that we legalized the chain.
- Hi = LegalizeOp(Hi);
- AddLegalizedOperand(Op.getValue(1), Hi.getValue(1));
- if (TLI.isBigEndian())
- std::swap(Lo, Hi);
- break;
- }
-
- case ISD::LOAD: {
- LoadSDNode *LD = cast<LoadSDNode>(Node);
- SDOperand Ch = LD->getChain(); // Legalize the chain.
- SDOperand Ptr = LD->getBasePtr(); // Legalize the pointer.
- ISD::LoadExtType ExtType = LD->getExtensionType();
- int SVOffset = LD->getSrcValueOffset();
- unsigned Alignment = LD->getAlignment();
- bool isVolatile = LD->isVolatile();
-
- if (ExtType == ISD::NON_EXTLOAD) {
- Lo = DAG.getLoad(NVT, Ch, Ptr, LD->getSrcValue(), SVOffset,
- isVolatile, Alignment);
- if (VT == MVT::f32 || VT == MVT::f64) {
- // f32->i32 or f64->i64 one to one expansion.
- // Remember that we legalized the chain.
- AddLegalizedOperand(SDOperand(Node, 1), LegalizeOp(Lo.getValue(1)));
- // Recursively expand the new load.
- if (getTypeAction(NVT) == Expand)
- ExpandOp(Lo, Lo, Hi);
- break;
- }
-
- // Increment the pointer to the other half.
- unsigned IncrementSize = MVT::getSizeInBits(Lo.getValueType())/8;
- Ptr = DAG.getNode(ISD::ADD, Ptr.getValueType(), Ptr,
- DAG.getIntPtrConstant(IncrementSize));
- SVOffset += IncrementSize;
- Alignment = MinAlign(Alignment, IncrementSize);
- Hi = DAG.getLoad(NVT, Ch, Ptr, LD->getSrcValue(), SVOffset,
- isVolatile, Alignment);
-
- // Build a factor node to remember that this load is independent of the
- // other one.
- SDOperand TF = DAG.getNode(ISD::TokenFactor, MVT::Other, Lo.getValue(1),
- Hi.getValue(1));
-
- // Remember that we legalized the chain.
- AddLegalizedOperand(Op.getValue(1), LegalizeOp(TF));
- if (TLI.isBigEndian())
- std::swap(Lo, Hi);
- } else {
- MVT::ValueType EVT = LD->getMemoryVT();
-
- if ((VT == MVT::f64 && EVT == MVT::f32) ||
- (VT == MVT::ppcf128 && (EVT==MVT::f64 || EVT==MVT::f32))) {
- // f64 = EXTLOAD f32 should expand to LOAD, FP_EXTEND
- SDOperand Load = DAG.getLoad(EVT, Ch, Ptr, LD->getSrcValue(),
- SVOffset, isVolatile, Alignment);
- // Remember that we legalized the chain.
- AddLegalizedOperand(SDOperand(Node, 1), LegalizeOp(Load.getValue(1)));
- ExpandOp(DAG.getNode(ISD::FP_EXTEND, VT, Load), Lo, Hi);
- break;
- }
-
- if (EVT == NVT)
- Lo = DAG.getLoad(NVT, Ch, Ptr, LD->getSrcValue(),
- SVOffset, isVolatile, Alignment);
- else
- Lo = DAG.getExtLoad(ExtType, NVT, Ch, Ptr, LD->getSrcValue(),
- SVOffset, EVT, isVolatile,
- Alignment);
-
- // Remember that we legalized the chain.
- AddLegalizedOperand(SDOperand(Node, 1), LegalizeOp(Lo.getValue(1)));
-
- if (ExtType == ISD::SEXTLOAD) {
- // The high part is obtained by SRA'ing all but one of the bits of the
- // lo part.
- unsigned LoSize = MVT::getSizeInBits(Lo.getValueType());
- Hi = DAG.getNode(ISD::SRA, NVT, Lo,
- DAG.getConstant(LoSize-1, TLI.getShiftAmountTy()));
- } else if (ExtType == ISD::ZEXTLOAD) {
- // The high part is just a zero.
- Hi = DAG.getConstant(0, NVT);
- } else /* if (ExtType == ISD::EXTLOAD) */ {
- // The high part is undefined.
- Hi = DAG.getNode(ISD::UNDEF, NVT);
- }
- }
- break;
- }
- case ISD::AND:
- case ISD::OR:
- case ISD::XOR: { // Simple logical operators -> two trivial pieces.
- SDOperand LL, LH, RL, RH;
- ExpandOp(Node->getOperand(0), LL, LH);
- ExpandOp(Node->getOperand(1), RL, RH);
- Lo = DAG.getNode(Node->getOpcode(), NVT, LL, RL);
- Hi = DAG.getNode(Node->getOpcode(), NVT, LH, RH);
- break;
- }
- case ISD::SELECT: {
- SDOperand LL, LH, RL, RH;
- ExpandOp(Node->getOperand(1), LL, LH);
- ExpandOp(Node->getOperand(2), RL, RH);
- if (getTypeAction(NVT) == Expand)
- NVT = TLI.getTypeToExpandTo(NVT);
- Lo = DAG.getNode(ISD::SELECT, NVT, Node->getOperand(0), LL, RL);
- if (VT != MVT::f32)
- Hi = DAG.getNode(ISD::SELECT, NVT, Node->getOperand(0), LH, RH);
- break;
- }
- case ISD::SELECT_CC: {
- SDOperand TL, TH, FL, FH;
- ExpandOp(Node->getOperand(2), TL, TH);
- ExpandOp(Node->getOperand(3), FL, FH);
- if (getTypeAction(NVT) == Expand)
- NVT = TLI.getTypeToExpandTo(NVT);
- Lo = DAG.getNode(ISD::SELECT_CC, NVT, Node->getOperand(0),
- Node->getOperand(1), TL, FL, Node->getOperand(4));
- if (VT != MVT::f32)
- Hi = DAG.getNode(ISD::SELECT_CC, NVT, Node->getOperand(0),
- Node->getOperand(1), TH, FH, Node->getOperand(4));
- break;
- }
- case ISD::ANY_EXTEND:
- // The low part is any extension of the input (which degenerates to a copy).
- Lo = DAG.getNode(ISD::ANY_EXTEND, NVT, Node->getOperand(0));
- // The high part is undefined.
- Hi = DAG.getNode(ISD::UNDEF, NVT);
- break;
- case ISD::SIGN_EXTEND: {
- // The low part is just a sign extension of the input (which degenerates to
- // a copy).
- Lo = DAG.getNode(ISD::SIGN_EXTEND, NVT, Node->getOperand(0));
-
- // The high part is obtained by SRA'ing all but one of the bits of the lo
- // part.
- unsigned LoSize = MVT::getSizeInBits(Lo.getValueType());
- Hi = DAG.getNode(ISD::SRA, NVT, Lo,
- DAG.getConstant(LoSize-1, TLI.getShiftAmountTy()));
- break;
- }
- case ISD::ZERO_EXTEND:
- // The low part is just a zero extension of the input (which degenerates to
- // a copy).
- Lo = DAG.getNode(ISD::ZERO_EXTEND, NVT, Node->getOperand(0));
-
- // The high part is just a zero.
- Hi = DAG.getConstant(0, NVT);
- break;
-
- case ISD::TRUNCATE: {
- // The input value must be larger than this value. Expand *it*.
- SDOperand NewLo;
- ExpandOp(Node->getOperand(0), NewLo, Hi);
-
- // The low part is now either the right size, or it is closer. If not the
- // right size, make an illegal truncate so we recursively expand it.
- if (NewLo.getValueType() != Node->getValueType(0))
- NewLo = DAG.getNode(ISD::TRUNCATE, Node->getValueType(0), NewLo);
- ExpandOp(NewLo, Lo, Hi);
- break;
- }
-
- case ISD::BIT_CONVERT: {
- SDOperand Tmp;
- if (TLI.getOperationAction(ISD::BIT_CONVERT, VT) == TargetLowering::Custom){
- // If the target wants to, allow it to lower this itself.
- switch (getTypeAction(Node->getOperand(0).getValueType())) {
- case Expand: assert(0 && "cannot expand FP!");
- case Legal: Tmp = LegalizeOp(Node->getOperand(0)); break;
- case Promote: Tmp = PromoteOp (Node->getOperand(0)); break;
- }
- Tmp = TLI.LowerOperation(DAG.getNode(ISD::BIT_CONVERT, VT, Tmp), DAG);
- }
-
- // f32 / f64 must be expanded to i32 / i64.
- if (VT == MVT::f32 || VT == MVT::f64) {
- Lo = DAG.getNode(ISD::BIT_CONVERT, NVT, Node->getOperand(0));
- if (getTypeAction(NVT) == Expand)
- ExpandOp(Lo, Lo, Hi);
- break;
- }
-
- // If source operand will be expanded to the same type as VT, i.e.
- // i64 <- f64, i32 <- f32, expand the source operand instead.
- MVT::ValueType VT0 = Node->getOperand(0).getValueType();
- if (getTypeAction(VT0) == Expand && TLI.getTypeToTransformTo(VT0) == VT) {
- ExpandOp(Node->getOperand(0), Lo, Hi);
- break;
- }
-
- // Turn this into a load/store pair by default.
- if (Tmp.Val == 0)
- Tmp = EmitStackConvert(Node->getOperand(0), VT, VT);
-
- ExpandOp(Tmp, Lo, Hi);
- break;
- }
-
- case ISD::READCYCLECOUNTER: {
- assert(TLI.getOperationAction(ISD::READCYCLECOUNTER, VT) ==
- TargetLowering::Custom &&
- "Must custom expand ReadCycleCounter");
- SDOperand Tmp = TLI.LowerOperation(Op, DAG);
- assert(Tmp.Val && "Node must be custom expanded!");
- ExpandOp(Tmp.getValue(0), Lo, Hi);
- AddLegalizedOperand(SDOperand(Node, 1), // Remember we legalized the chain.
- LegalizeOp(Tmp.getValue(1)));
- break;
- }
-
- case ISD::ATOMIC_LCS: {
- SDOperand Tmp = TLI.LowerOperation(Op, DAG);
- assert(Tmp.Val && "Node must be custom expanded!");
- ExpandOp(Tmp.getValue(0), Lo, Hi);
- AddLegalizedOperand(SDOperand(Node, 1), // Remember we legalized the chain.
- LegalizeOp(Tmp.getValue(1)));
- break;
- }
-
-
-
- // These operators cannot be expanded directly, emit them as calls to
- // library functions.
- case ISD::FP_TO_SINT: {
- if (TLI.getOperationAction(ISD::FP_TO_SINT, VT) == TargetLowering::Custom) {
- SDOperand Op;
- switch (getTypeAction(Node->getOperand(0).getValueType())) {
- case Expand: assert(0 && "cannot expand FP!");
- case Legal: Op = LegalizeOp(Node->getOperand(0)); break;
- case Promote: Op = PromoteOp (Node->getOperand(0)); break;
- }
-
- Op = TLI.LowerOperation(DAG.getNode(ISD::FP_TO_SINT, VT, Op), DAG);
-
- // Now that the custom expander is done, expand the result, which is still
- // VT.
- if (Op.Val) {
- ExpandOp(Op, Lo, Hi);
- break;
- }
- }
-
- RTLIB::Libcall LC = RTLIB::UNKNOWN_LIBCALL;
- if (VT == MVT::i64) {
- if (Node->getOperand(0).getValueType() == MVT::f32)
- LC = RTLIB::FPTOSINT_F32_I64;
- else if (Node->getOperand(0).getValueType() == MVT::f64)
- LC = RTLIB::FPTOSINT_F64_I64;
- else if (Node->getOperand(0).getValueType() == MVT::f80)
- LC = RTLIB::FPTOSINT_F80_I64;
- else if (Node->getOperand(0).getValueType() == MVT::ppcf128)
- LC = RTLIB::FPTOSINT_PPCF128_I64;
- Lo = ExpandLibCall(LC, Node, false/*sign irrelevant*/, Hi);
- } else if (VT == MVT::i128) {
- if (Node->getOperand(0).getValueType() == MVT::f32)
- LC = RTLIB::FPTOSINT_F32_I128;
- else if (Node->getOperand(0).getValueType() == MVT::f64)
- LC = RTLIB::FPTOSINT_F64_I128;
- else if (Node->getOperand(0).getValueType() == MVT::f80)
- LC = RTLIB::FPTOSINT_F80_I128;
- else if (Node->getOperand(0).getValueType() == MVT::ppcf128)
- LC = RTLIB::FPTOSINT_PPCF128_I128;
- Lo = ExpandLibCall(LC, Node, false/*sign irrelevant*/, Hi);
- } else {
- assert(0 && "Unexpected uint-to-fp conversion!");
- }
- break;
- }
-
- case ISD::FP_TO_UINT: {
- if (TLI.getOperationAction(ISD::FP_TO_UINT, VT) == TargetLowering::Custom) {
- SDOperand Op;
- switch (getTypeAction(Node->getOperand(0).getValueType())) {
- case Expand: assert(0 && "cannot expand FP!");
- case Legal: Op = LegalizeOp(Node->getOperand(0)); break;
- case Promote: Op = PromoteOp (Node->getOperand(0)); break;
- }
-
- Op = TLI.LowerOperation(DAG.getNode(ISD::FP_TO_UINT, VT, Op), DAG);
-
- // Now that the custom expander is done, expand the result.
- if (Op.Val) {
- ExpandOp(Op, Lo, Hi);
- break;
- }
- }
-
- RTLIB::Libcall LC = RTLIB::UNKNOWN_LIBCALL;
- if (VT == MVT::i64) {
- if (Node->getOperand(0).getValueType() == MVT::f32)
- LC = RTLIB::FPTOUINT_F32_I64;
- else if (Node->getOperand(0).getValueType() == MVT::f64)
- LC = RTLIB::FPTOUINT_F64_I64;
- else if (Node->getOperand(0).getValueType() == MVT::f80)
- LC = RTLIB::FPTOUINT_F80_I64;
- else if (Node->getOperand(0).getValueType() == MVT::ppcf128)
- LC = RTLIB::FPTOUINT_PPCF128_I64;
- Lo = ExpandLibCall(LC, Node, false/*sign irrelevant*/, Hi);
- } else if (VT == MVT::i128) {
- if (Node->getOperand(0).getValueType() == MVT::f32)
- LC = RTLIB::FPTOUINT_F32_I128;
- else if (Node->getOperand(0).getValueType() == MVT::f64)
- LC = RTLIB::FPTOUINT_F64_I128;
- else if (Node->getOperand(0).getValueType() == MVT::f80)
- LC = RTLIB::FPTOUINT_F80_I128;
- else if (Node->getOperand(0).getValueType() == MVT::ppcf128)
- LC = RTLIB::FPTOUINT_PPCF128_I128;
- Lo = ExpandLibCall(LC, Node, false/*sign irrelevant*/, Hi);
- } else {
- assert(0 && "Unexpected uint-to-fp conversion!");
- }
- break;
- }
-
- case ISD::SHL: {
- // If the target wants custom lowering, do so.
- SDOperand ShiftAmt = LegalizeOp(Node->getOperand(1));
- if (TLI.getOperationAction(ISD::SHL, VT) == TargetLowering::Custom) {
- SDOperand Op = DAG.getNode(ISD::SHL, VT, Node->getOperand(0), ShiftAmt);
- Op = TLI.LowerOperation(Op, DAG);
- if (Op.Val) {
- // Now that the custom expander is done, expand the result, which is
- // still VT.
- ExpandOp(Op, Lo, Hi);
- break;
- }
- }
-
- // If ADDC/ADDE are supported and if the shift amount is a constant 1, emit
- // this X << 1 as X+X.
- if (ConstantSDNode *ShAmt = dyn_cast<ConstantSDNode>(ShiftAmt)) {
- if (ShAmt->getAPIntValue() == 1 && TLI.isOperationLegal(ISD::ADDC, NVT) &&
- TLI.isOperationLegal(ISD::ADDE, NVT)) {
- SDOperand LoOps[2], HiOps[3];
- ExpandOp(Node->getOperand(0), LoOps[0], HiOps[0]);
- SDVTList VTList = DAG.getVTList(LoOps[0].getValueType(), MVT::Flag);
- LoOps[1] = LoOps[0];
- Lo = DAG.getNode(ISD::ADDC, VTList, LoOps, 2);
-
- HiOps[1] = HiOps[0];
- HiOps[2] = Lo.getValue(1);
- Hi = DAG.getNode(ISD::ADDE, VTList, HiOps, 3);
- break;
- }
- }
-
- // If we can emit an efficient shift operation, do so now.
- if (ExpandShift(ISD::SHL, Node->getOperand(0), ShiftAmt, Lo, Hi))
- break;
-
- // If this target supports SHL_PARTS, use it.
- TargetLowering::LegalizeAction Action =
- TLI.getOperationAction(ISD::SHL_PARTS, NVT);
- if ((Action == TargetLowering::Legal && TLI.isTypeLegal(NVT)) ||
- Action == TargetLowering::Custom) {
- ExpandShiftParts(ISD::SHL_PARTS, Node->getOperand(0), ShiftAmt, Lo, Hi);
- break;
- }
-
- // Otherwise, emit a libcall.
- Lo = ExpandLibCall(RTLIB::SHL_I64, Node, false/*left shift=unsigned*/, Hi);
- break;
- }
-
- case ISD::SRA: {
- // If the target wants custom lowering, do so.
- SDOperand ShiftAmt = LegalizeOp(Node->getOperand(1));
- if (TLI.getOperationAction(ISD::SRA, VT) == TargetLowering::Custom) {
- SDOperand Op = DAG.getNode(ISD::SRA, VT, Node->getOperand(0), ShiftAmt);
- Op = TLI.LowerOperation(Op, DAG);
- if (Op.Val) {
- // Now that the custom expander is done, expand the result, which is
- // still VT.
- ExpandOp(Op, Lo, Hi);
- break;
- }
- }
-
- // If we can emit an efficient shift operation, do so now.
- if (ExpandShift(ISD::SRA, Node->getOperand(0), ShiftAmt, Lo, Hi))
- break;
-
- // If this target supports SRA_PARTS, use it.
- TargetLowering::LegalizeAction Action =
- TLI.getOperationAction(ISD::SRA_PARTS, NVT);
- if ((Action == TargetLowering::Legal && TLI.isTypeLegal(NVT)) ||
- Action == TargetLowering::Custom) {
- ExpandShiftParts(ISD::SRA_PARTS, Node->getOperand(0), ShiftAmt, Lo, Hi);
- break;
- }
-
- // Otherwise, emit a libcall.
- Lo = ExpandLibCall(RTLIB::SRA_I64, Node, true/*ashr is signed*/, Hi);
- break;
- }
-
- case ISD::SRL: {
- // If the target wants custom lowering, do so.
- SDOperand ShiftAmt = LegalizeOp(Node->getOperand(1));
- if (TLI.getOperationAction(ISD::SRL, VT) == TargetLowering::Custom) {
- SDOperand Op = DAG.getNode(ISD::SRL, VT, Node->getOperand(0), ShiftAmt);
- Op = TLI.LowerOperation(Op, DAG);
- if (Op.Val) {
- // Now that the custom expander is done, expand the result, which is
- // still VT.
- ExpandOp(Op, Lo, Hi);
- break;
- }
- }
-
- // If we can emit an efficient shift operation, do so now.
- if (ExpandShift(ISD::SRL, Node->getOperand(0), ShiftAmt, Lo, Hi))
- break;
-
- // If this target supports SRL_PARTS, use it.
- TargetLowering::LegalizeAction Action =
- TLI.getOperationAction(ISD::SRL_PARTS, NVT);
- if ((Action == TargetLowering::Legal && TLI.isTypeLegal(NVT)) ||
- Action == TargetLowering::Custom) {
- ExpandShiftParts(ISD::SRL_PARTS, Node->getOperand(0), ShiftAmt, Lo, Hi);
- break;
- }
-
- // Otherwise, emit a libcall.
- Lo = ExpandLibCall(RTLIB::SRL_I64, Node, false/*lshr is unsigned*/, Hi);
- break;
- }
-
- case ISD::ADD:
- case ISD::SUB: {
- // If the target wants to custom expand this, let them.
- if (TLI.getOperationAction(Node->getOpcode(), VT) ==
- TargetLowering::Custom) {
- Op = TLI.LowerOperation(Op, DAG);
- if (Op.Val) {
- ExpandOp(Op, Lo, Hi);
- break;
- }
- }
-
- // Expand the subcomponents.
- SDOperand LHSL, LHSH, RHSL, RHSH;
- ExpandOp(Node->getOperand(0), LHSL, LHSH);
- ExpandOp(Node->getOperand(1), RHSL, RHSH);
- SDVTList VTList = DAG.getVTList(LHSL.getValueType(), MVT::Flag);
- SDOperand LoOps[2], HiOps[3];
- LoOps[0] = LHSL;
- LoOps[1] = RHSL;
- HiOps[0] = LHSH;
- HiOps[1] = RHSH;
- if (Node->getOpcode() == ISD::ADD) {
- Lo = DAG.getNode(ISD::ADDC, VTList, LoOps, 2);
- HiOps[2] = Lo.getValue(1);
- Hi = DAG.getNode(ISD::ADDE, VTList, HiOps, 3);
- } else {
- Lo = DAG.getNode(ISD::SUBC, VTList, LoOps, 2);
- HiOps[2] = Lo.getValue(1);
- Hi = DAG.getNode(ISD::SUBE, VTList, HiOps, 3);
- }
- break;
- }
-
- case ISD::ADDC:
- case ISD::SUBC: {
- // Expand the subcomponents.
- SDOperand LHSL, LHSH, RHSL, RHSH;
- ExpandOp(Node->getOperand(0), LHSL, LHSH);
- ExpandOp(Node->getOperand(1), RHSL, RHSH);
- SDVTList VTList = DAG.getVTList(LHSL.getValueType(), MVT::Flag);
- SDOperand LoOps[2] = { LHSL, RHSL };
- SDOperand HiOps[3] = { LHSH, RHSH };
-
- if (Node->getOpcode() == ISD::ADDC) {
- Lo = DAG.getNode(ISD::ADDC, VTList, LoOps, 2);
- HiOps[2] = Lo.getValue(1);
- Hi = DAG.getNode(ISD::ADDE, VTList, HiOps, 3);
- } else {
- Lo = DAG.getNode(ISD::SUBC, VTList, LoOps, 2);
- HiOps[2] = Lo.getValue(1);
- Hi = DAG.getNode(ISD::SUBE, VTList, HiOps, 3);
- }
- // Remember that we legalized the flag.
- AddLegalizedOperand(Op.getValue(1), LegalizeOp(Hi.getValue(1)));
- break;
- }
- case ISD::ADDE:
- case ISD::SUBE: {
- // Expand the subcomponents.
- SDOperand LHSL, LHSH, RHSL, RHSH;
- ExpandOp(Node->getOperand(0), LHSL, LHSH);
- ExpandOp(Node->getOperand(1), RHSL, RHSH);
- SDVTList VTList = DAG.getVTList(LHSL.getValueType(), MVT::Flag);
- SDOperand LoOps[3] = { LHSL, RHSL, Node->getOperand(2) };
- SDOperand HiOps[3] = { LHSH, RHSH };
-
- Lo = DAG.getNode(Node->getOpcode(), VTList, LoOps, 3);
- HiOps[2] = Lo.getValue(1);
- Hi = DAG.getNode(Node->getOpcode(), VTList, HiOps, 3);
-
- // Remember that we legalized the flag.
- AddLegalizedOperand(Op.getValue(1), LegalizeOp(Hi.getValue(1)));
- break;
- }
- case ISD::MUL: {
- // If the target wants to custom expand this, let them.
- if (TLI.getOperationAction(ISD::MUL, VT) == TargetLowering::Custom) {
- SDOperand New = TLI.LowerOperation(Op, DAG);
- if (New.Val) {
- ExpandOp(New, Lo, Hi);
- break;
- }
- }
-
- bool HasMULHS = TLI.isOperationLegal(ISD::MULHS, NVT);
- bool HasMULHU = TLI.isOperationLegal(ISD::MULHU, NVT);
- bool HasSMUL_LOHI = TLI.isOperationLegal(ISD::SMUL_LOHI, NVT);
- bool HasUMUL_LOHI = TLI.isOperationLegal(ISD::UMUL_LOHI, NVT);
- if (HasMULHU || HasMULHS || HasUMUL_LOHI || HasSMUL_LOHI) {
- SDOperand LL, LH, RL, RH;
- ExpandOp(Node->getOperand(0), LL, LH);
- ExpandOp(Node->getOperand(1), RL, RH);
- unsigned OuterBitSize = Op.getValueSizeInBits();
- unsigned InnerBitSize = RH.getValueSizeInBits();
- unsigned LHSSB = DAG.ComputeNumSignBits(Op.getOperand(0));
- unsigned RHSSB = DAG.ComputeNumSignBits(Op.getOperand(1));
- APInt HighMask = APInt::getHighBitsSet(OuterBitSize, InnerBitSize);
- if (DAG.MaskedValueIsZero(Node->getOperand(0), HighMask) &&
- DAG.MaskedValueIsZero(Node->getOperand(1), HighMask)) {
- // The inputs are both zero-extended.
- if (HasUMUL_LOHI) {
- // We can emit a umul_lohi.
- Lo = DAG.getNode(ISD::UMUL_LOHI, DAG.getVTList(NVT, NVT), LL, RL);
- Hi = SDOperand(Lo.Val, 1);
- break;
- }
- if (HasMULHU) {
- // We can emit a mulhu+mul.
- Lo = DAG.getNode(ISD::MUL, NVT, LL, RL);
- Hi = DAG.getNode(ISD::MULHU, NVT, LL, RL);
- break;
- }
- }
- if (LHSSB > InnerBitSize && RHSSB > InnerBitSize) {
- // The input values are both sign-extended.
- if (HasSMUL_LOHI) {
- // We can emit a smul_lohi.
- Lo = DAG.getNode(ISD::SMUL_LOHI, DAG.getVTList(NVT, NVT), LL, RL);
- Hi = SDOperand(Lo.Val, 1);
- break;
- }
- if (HasMULHS) {
- // We can emit a mulhs+mul.
- Lo = DAG.getNode(ISD::MUL, NVT, LL, RL);
- Hi = DAG.getNode(ISD::MULHS, NVT, LL, RL);
- break;
- }
- }
- if (HasUMUL_LOHI) {
- // Lo,Hi = umul LHS, RHS.
- SDOperand UMulLOHI = DAG.getNode(ISD::UMUL_LOHI,
- DAG.getVTList(NVT, NVT), LL, RL);
- Lo = UMulLOHI;
- Hi = UMulLOHI.getValue(1);
- RH = DAG.getNode(ISD::MUL, NVT, LL, RH);
- LH = DAG.getNode(ISD::MUL, NVT, LH, RL);
- Hi = DAG.getNode(ISD::ADD, NVT, Hi, RH);
- Hi = DAG.getNode(ISD::ADD, NVT, Hi, LH);
- break;
- }
- if (HasMULHU) {
- Lo = DAG.getNode(ISD::MUL, NVT, LL, RL);
- Hi = DAG.getNode(ISD::MULHU, NVT, LL, RL);
- RH = DAG.getNode(ISD::MUL, NVT, LL, RH);
- LH = DAG.getNode(ISD::MUL, NVT, LH, RL);
- Hi = DAG.getNode(ISD::ADD, NVT, Hi, RH);
- Hi = DAG.getNode(ISD::ADD, NVT, Hi, LH);
- break;
- }
- }
-
- // If nothing else, we can make a libcall.
- Lo = ExpandLibCall(RTLIB::MUL_I64, Node, false/*sign irrelevant*/, Hi);
- break;
- }
- case ISD::SDIV:
- Lo = ExpandLibCall(RTLIB::SDIV_I64, Node, true, Hi);
- break;
- case ISD::UDIV:
- Lo = ExpandLibCall(RTLIB::UDIV_I64, Node, true, Hi);
- break;
- case ISD::SREM:
- Lo = ExpandLibCall(RTLIB::SREM_I64, Node, true, Hi);
- break;
- case ISD::UREM:
- Lo = ExpandLibCall(RTLIB::UREM_I64, Node, true, Hi);
- break;
-
- case ISD::FADD:
- Lo = ExpandLibCall(GetFPLibCall(VT, RTLIB::ADD_F32,
- RTLIB::ADD_F64,
- RTLIB::ADD_F80,
- RTLIB::ADD_PPCF128),
- Node, false, Hi);
- break;
- case ISD::FSUB:
- Lo = ExpandLibCall(GetFPLibCall(VT, RTLIB::SUB_F32,
- RTLIB::SUB_F64,
- RTLIB::SUB_F80,
- RTLIB::SUB_PPCF128),
- Node, false, Hi);
- break;
- case ISD::FMUL:
- Lo = ExpandLibCall(GetFPLibCall(VT, RTLIB::MUL_F32,
- RTLIB::MUL_F64,
- RTLIB::MUL_F80,
- RTLIB::MUL_PPCF128),
- Node, false, Hi);
- break;
- case ISD::FDIV:
- Lo = ExpandLibCall(GetFPLibCall(VT, RTLIB::DIV_F32,
- RTLIB::DIV_F64,
- RTLIB::DIV_F80,
- RTLIB::DIV_PPCF128),
- Node, false, Hi);
- break;
- case ISD::FP_EXTEND:
- if (VT == MVT::ppcf128) {
- assert(Node->getOperand(0).getValueType()==MVT::f32 ||
- Node->getOperand(0).getValueType()==MVT::f64);
- const uint64_t zero = 0;
- if (Node->getOperand(0).getValueType()==MVT::f32)
- Hi = DAG.getNode(ISD::FP_EXTEND, MVT::f64, Node->getOperand(0));
- else
- Hi = Node->getOperand(0);
- Lo = DAG.getConstantFP(APFloat(APInt(64, 1, &zero)), MVT::f64);
- break;
- }
- Lo = ExpandLibCall(RTLIB::FPEXT_F32_F64, Node, true, Hi);
- break;
- case ISD::FP_ROUND:
- Lo = ExpandLibCall(RTLIB::FPROUND_F64_F32, Node, true, Hi);
- break;
- case ISD::FPOWI:
- Lo = ExpandLibCall(GetFPLibCall(VT, RTLIB::POWI_F32,
- RTLIB::POWI_F64,
- RTLIB::POWI_F80,
- RTLIB::POWI_PPCF128),
- Node, false, Hi);
- break;
- case ISD::FSQRT:
- case ISD::FSIN:
- case ISD::FCOS: {
- RTLIB::Libcall LC = RTLIB::UNKNOWN_LIBCALL;
- switch(Node->getOpcode()) {
- case ISD::FSQRT:
- LC = GetFPLibCall(VT, RTLIB::SQRT_F32, RTLIB::SQRT_F64,
- RTLIB::SQRT_F80, RTLIB::SQRT_PPCF128);
- break;
- case ISD::FSIN:
- LC = GetFPLibCall(VT, RTLIB::SIN_F32, RTLIB::SIN_F64,
- RTLIB::SIN_F80, RTLIB::SIN_PPCF128);
- break;
- case ISD::FCOS:
- LC = GetFPLibCall(VT, RTLIB::COS_F32, RTLIB::COS_F64,
- RTLIB::COS_F80, RTLIB::COS_PPCF128);
- break;
- default: assert(0 && "Unreachable!");
- }
- Lo = ExpandLibCall(LC, Node, false, Hi);
- break;
- }
- case ISD::FABS: {
- if (VT == MVT::ppcf128) {
- SDOperand Tmp;
- ExpandOp(Node->getOperand(0), Lo, Tmp);
- Hi = DAG.getNode(ISD::FABS, NVT, Tmp);
- // lo = hi==fabs(hi) ? lo : -lo;
- Lo = DAG.getNode(ISD::SELECT_CC, NVT, Hi, Tmp,
- Lo, DAG.getNode(ISD::FNEG, NVT, Lo),
- DAG.getCondCode(ISD::SETEQ));
- break;
- }
- SDOperand Mask = (VT == MVT::f64)
- ? DAG.getConstantFP(BitsToDouble(~(1ULL << 63)), VT)
- : DAG.getConstantFP(BitsToFloat(~(1U << 31)), VT);
- Mask = DAG.getNode(ISD::BIT_CONVERT, NVT, Mask);
- Lo = DAG.getNode(ISD::BIT_CONVERT, NVT, Node->getOperand(0));
- Lo = DAG.getNode(ISD::AND, NVT, Lo, Mask);
- if (getTypeAction(NVT) == Expand)
- ExpandOp(Lo, Lo, Hi);
- break;
- }
- case ISD::FNEG: {
- if (VT == MVT::ppcf128) {
- ExpandOp(Node->getOperand(0), Lo, Hi);
- Lo = DAG.getNode(ISD::FNEG, MVT::f64, Lo);
- Hi = DAG.getNode(ISD::FNEG, MVT::f64, Hi);
- break;
- }
- SDOperand Mask = (VT == MVT::f64)
- ? DAG.getConstantFP(BitsToDouble(1ULL << 63), VT)
- : DAG.getConstantFP(BitsToFloat(1U << 31), VT);
- Mask = DAG.getNode(ISD::BIT_CONVERT, NVT, Mask);
- Lo = DAG.getNode(ISD::BIT_CONVERT, NVT, Node->getOperand(0));
- Lo = DAG.getNode(ISD::XOR, NVT, Lo, Mask);
- if (getTypeAction(NVT) == Expand)
- ExpandOp(Lo, Lo, Hi);
- break;
- }
- case ISD::FCOPYSIGN: {
- Lo = ExpandFCOPYSIGNToBitwiseOps(Node, NVT, DAG, TLI);
- if (getTypeAction(NVT) == Expand)
- ExpandOp(Lo, Lo, Hi);
- break;
- }
- case ISD::SINT_TO_FP:
- case ISD::UINT_TO_FP: {
- bool isSigned = Node->getOpcode() == ISD::SINT_TO_FP;
- MVT::ValueType SrcVT = Node->getOperand(0).getValueType();
-
- // Promote the operand if needed. Do this before checking for
- // ppcf128 so conversions of i16 and i8 work.
- if (getTypeAction(SrcVT) == Promote) {
- SDOperand Tmp = PromoteOp(Node->getOperand(0));
- Tmp = isSigned
- ? DAG.getNode(ISD::SIGN_EXTEND_INREG, Tmp.getValueType(), Tmp,
- DAG.getValueType(SrcVT))
- : DAG.getZeroExtendInReg(Tmp, SrcVT);
- Node = DAG.UpdateNodeOperands(Op, Tmp).Val;
- SrcVT = Node->getOperand(0).getValueType();
- }
-
- if (VT == MVT::ppcf128 && SrcVT == MVT::i32) {
- static const uint64_t zero = 0;
- if (isSigned) {
- Hi = LegalizeOp(DAG.getNode(ISD::SINT_TO_FP, MVT::f64,
- Node->getOperand(0)));
- Lo = DAG.getConstantFP(APFloat(APInt(64, 1, &zero)), MVT::f64);
- } else {
- static const uint64_t TwoE32[] = { 0x41f0000000000000LL, 0 };
- Hi = LegalizeOp(DAG.getNode(ISD::SINT_TO_FP, MVT::f64,
- Node->getOperand(0)));
- Lo = DAG.getConstantFP(APFloat(APInt(64, 1, &zero)), MVT::f64);
- Hi = DAG.getNode(ISD::BUILD_PAIR, VT, Lo, Hi);
- // X>=0 ? {(f64)x, 0} : {(f64)x, 0} + 2^32
- ExpandOp(DAG.getNode(ISD::SELECT_CC, MVT::ppcf128, Node->getOperand(0),
- DAG.getConstant(0, MVT::i32),
- DAG.getNode(ISD::FADD, MVT::ppcf128, Hi,
- DAG.getConstantFP(
- APFloat(APInt(128, 2, TwoE32)),
- MVT::ppcf128)),
- Hi,
- DAG.getCondCode(ISD::SETLT)),
- Lo, Hi);
- }
- break;
- }
- if (VT == MVT::ppcf128 && SrcVT == MVT::i64 && !isSigned) {
- // si64->ppcf128 done by libcall, below
- static const uint64_t TwoE64[] = { 0x43f0000000000000LL, 0 };
- ExpandOp(DAG.getNode(ISD::SINT_TO_FP, MVT::ppcf128, Node->getOperand(0)),
- Lo, Hi);
- Hi = DAG.getNode(ISD::BUILD_PAIR, VT, Lo, Hi);
- // x>=0 ? (ppcf128)(i64)x : (ppcf128)(i64)x + 2^64
- ExpandOp(DAG.getNode(ISD::SELECT_CC, MVT::ppcf128, Node->getOperand(0),
- DAG.getConstant(0, MVT::i64),
- DAG.getNode(ISD::FADD, MVT::ppcf128, Hi,
- DAG.getConstantFP(
- APFloat(APInt(128, 2, TwoE64)),
- MVT::ppcf128)),
- Hi,
- DAG.getCondCode(ISD::SETLT)),
- Lo, Hi);
- break;
- }
-
- Lo = ExpandIntToFP(Node->getOpcode() == ISD::SINT_TO_FP, VT,
- Node->getOperand(0));
- if (getTypeAction(Lo.getValueType()) == Expand)
- // float to i32 etc. can be 'expanded' to a single node.
- ExpandOp(Lo, Lo, Hi);
- break;
- }
- }
-
- // Make sure the resultant values have been legalized themselves, unless this
- // is a type that requires multi-step expansion.
- if (getTypeAction(NVT) != Expand && NVT != MVT::isVoid) {
- Lo = LegalizeOp(Lo);
- if (Hi.Val)
- // Don't legalize the high part if it is expanded to a single node.
- Hi = LegalizeOp(Hi);
- }
-
- // Remember in a map if the values will be reused later.
- bool isNew = ExpandedNodes.insert(std::make_pair(Op, std::make_pair(Lo, Hi)));
- assert(isNew && "Value already expanded?!?");
-}
-
-/// SplitVectorOp - Given an operand of vector type, break it down into
-/// two smaller values, still of vector type.
-void SelectionDAGLegalize::SplitVectorOp(SDOperand Op, SDOperand &Lo,
- SDOperand &Hi) {
- assert(MVT::isVector(Op.getValueType()) && "Cannot split non-vector type!");
- SDNode *Node = Op.Val;
- unsigned NumElements = MVT::getVectorNumElements(Op.getValueType());
- assert(NumElements > 1 && "Cannot split a single element vector!");
-
- MVT::ValueType NewEltVT = MVT::getVectorElementType(Op.getValueType());
-
- unsigned NewNumElts_Lo = 1 << Log2_32(NumElements-1);
- unsigned NewNumElts_Hi = NumElements - NewNumElts_Lo;
-
- MVT::ValueType NewVT_Lo = MVT::getVectorType(NewEltVT, NewNumElts_Lo);
- MVT::ValueType NewVT_Hi = MVT::getVectorType(NewEltVT, NewNumElts_Hi);
-
- // See if we already split it.
- std::map<SDOperand, std::pair<SDOperand, SDOperand> >::iterator I
- = SplitNodes.find(Op);
- if (I != SplitNodes.end()) {
- Lo = I->second.first;
- Hi = I->second.second;
- return;
- }
-
- switch (Node->getOpcode()) {
- default:
-#ifndef NDEBUG
- Node->dump(&DAG);
-#endif
- assert(0 && "Unhandled operation in SplitVectorOp!");
- case ISD::UNDEF:
- Lo = DAG.getNode(ISD::UNDEF, NewVT_Lo);
- Hi = DAG.getNode(ISD::UNDEF, NewVT_Hi);
- break;
- case ISD::BUILD_PAIR:
- Lo = Node->getOperand(0);
- Hi = Node->getOperand(1);
- break;
- case ISD::INSERT_VECTOR_ELT: {
- if (ConstantSDNode *Idx = dyn_cast<ConstantSDNode>(Node->getOperand(2))) {
- SplitVectorOp(Node->getOperand(0), Lo, Hi);
- unsigned Index = Idx->getValue();
- SDOperand ScalarOp = Node->getOperand(1);
- if (Index < NewNumElts_Lo)
- Lo = DAG.getNode(ISD::INSERT_VECTOR_ELT, NewVT_Lo, Lo, ScalarOp,
- DAG.getIntPtrConstant(Index));
- else
- Hi = DAG.getNode(ISD::INSERT_VECTOR_ELT, NewVT_Hi, Hi, ScalarOp,
- DAG.getIntPtrConstant(Index - NewNumElts_Lo));
- break;
- }
- SDOperand Tmp = PerformInsertVectorEltInMemory(Node->getOperand(0),
- Node->getOperand(1),
- Node->getOperand(2));
- SplitVectorOp(Tmp, Lo, Hi);
- break;
- }
- case ISD::VECTOR_SHUFFLE: {
- // Build the low part.
- SDOperand Mask = Node->getOperand(2);
- SmallVector<SDOperand, 8> Ops;
- MVT::ValueType PtrVT = TLI.getPointerTy();
-
- // Insert all of the elements from the input that are needed. We use
- // buildvector of extractelement here because the input vectors will have
- // to be legalized, so this makes the code simpler.
- for (unsigned i = 0; i != NewNumElts_Lo; ++i) {
- SDOperand IdxNode = Mask.getOperand(i);
- if (IdxNode.getOpcode() == ISD::UNDEF) {
- Ops.push_back(DAG.getNode(ISD::UNDEF, NewEltVT));
- continue;
- }
- unsigned Idx = cast<ConstantSDNode>(IdxNode)->getValue();
- SDOperand InVec = Node->getOperand(0);
- if (Idx >= NumElements) {
- InVec = Node->getOperand(1);
- Idx -= NumElements;
- }
- Ops.push_back(DAG.getNode(ISD::EXTRACT_VECTOR_ELT, NewEltVT, InVec,
- DAG.getConstant(Idx, PtrVT)));
- }
- Lo = DAG.getNode(ISD::BUILD_VECTOR, NewVT_Lo, &Ops[0], Ops.size());
- Ops.clear();
-
- for (unsigned i = NewNumElts_Lo; i != NumElements; ++i) {
- SDOperand IdxNode = Mask.getOperand(i);
- if (IdxNode.getOpcode() == ISD::UNDEF) {
- Ops.push_back(DAG.getNode(ISD::UNDEF, NewEltVT));
- continue;
- }
- unsigned Idx = cast<ConstantSDNode>(IdxNode)->getValue();
- SDOperand InVec = Node->getOperand(0);
- if (Idx >= NumElements) {
- InVec = Node->getOperand(1);
- Idx -= NumElements;
- }
- Ops.push_back(DAG.getNode(ISD::EXTRACT_VECTOR_ELT, NewEltVT, InVec,
- DAG.getConstant(Idx, PtrVT)));
- }
- Hi = DAG.getNode(ISD::BUILD_VECTOR, NewVT_Lo, &Ops[0], Ops.size());
- break;
- }
- case ISD::BUILD_VECTOR: {
- SmallVector<SDOperand, 8> LoOps(Node->op_begin(),
- Node->op_begin()+NewNumElts_Lo);
- Lo = DAG.getNode(ISD::BUILD_VECTOR, NewVT_Lo, &LoOps[0], LoOps.size());
-
- SmallVector<SDOperand, 8> HiOps(Node->op_begin()+NewNumElts_Lo,
- Node->op_end());
- Hi = DAG.getNode(ISD::BUILD_VECTOR, NewVT_Hi, &HiOps[0], HiOps.size());
- break;
- }
- case ISD::CONCAT_VECTORS: {
- // FIXME: Handle non-power-of-two vectors?
- unsigned NewNumSubvectors = Node->getNumOperands() / 2;
- if (NewNumSubvectors == 1) {
- Lo = Node->getOperand(0);
- Hi = Node->getOperand(1);
- } else {
- SmallVector<SDOperand, 8> LoOps(Node->op_begin(),
- Node->op_begin()+NewNumSubvectors);
- Lo = DAG.getNode(ISD::CONCAT_VECTORS, NewVT_Lo, &LoOps[0], LoOps.size());
-
- SmallVector<SDOperand, 8> HiOps(Node->op_begin()+NewNumSubvectors,
- Node->op_end());
- Hi = DAG.getNode(ISD::CONCAT_VECTORS, NewVT_Hi, &HiOps[0], HiOps.size());
- }
- break;
- }
- case ISD::SELECT: {
- SDOperand Cond = Node->getOperand(0);
-
- SDOperand LL, LH, RL, RH;
- SplitVectorOp(Node->getOperand(1), LL, LH);
- SplitVectorOp(Node->getOperand(2), RL, RH);
-
- if (MVT::isVector(Cond.getValueType())) {
- // Handle a vector merge.
- SDOperand CL, CH;
- SplitVectorOp(Cond, CL, CH);
- Lo = DAG.getNode(Node->getOpcode(), NewVT_Lo, CL, LL, RL);
- Hi = DAG.getNode(Node->getOpcode(), NewVT_Hi, CH, LH, RH);
- } else {
- // Handle a simple select with vector operands.
- Lo = DAG.getNode(Node->getOpcode(), NewVT_Lo, Cond, LL, RL);
- Hi = DAG.getNode(Node->getOpcode(), NewVT_Hi, Cond, LH, RH);
- }
- break;
- }
- case ISD::ADD:
- case ISD::SUB:
- case ISD::MUL:
- case ISD::FADD:
- case ISD::FSUB:
- case ISD::FMUL:
- case ISD::SDIV:
- case ISD::UDIV:
- case ISD::FDIV:
- case ISD::FPOW:
- case ISD::AND:
- case ISD::OR:
- case ISD::XOR:
- case ISD::UREM:
- case ISD::SREM:
- case ISD::FREM: {
- SDOperand LL, LH, RL, RH;
- SplitVectorOp(Node->getOperand(0), LL, LH);
- SplitVectorOp(Node->getOperand(1), RL, RH);
-
- Lo = DAG.getNode(Node->getOpcode(), NewVT_Lo, LL, RL);
- Hi = DAG.getNode(Node->getOpcode(), NewVT_Hi, LH, RH);
- break;
- }
- case ISD::FPOWI: {
- SDOperand L, H;
- SplitVectorOp(Node->getOperand(0), L, H);
-
- Lo = DAG.getNode(Node->getOpcode(), NewVT_Lo, L, Node->getOperand(1));
- Hi = DAG.getNode(Node->getOpcode(), NewVT_Hi, H, Node->getOperand(1));
- break;
- }
- case ISD::CTTZ:
- case ISD::CTLZ:
- case ISD::CTPOP:
- case ISD::FNEG:
- case ISD::FABS:
- case ISD::FSQRT:
- case ISD::FSIN:
- case ISD::FCOS:
- case ISD::FP_TO_SINT:
- case ISD::FP_TO_UINT:
- case ISD::SINT_TO_FP:
- case ISD::UINT_TO_FP: {
- SDOperand L, H;
- SplitVectorOp(Node->getOperand(0), L, H);
-
- Lo = DAG.getNode(Node->getOpcode(), NewVT_Lo, L);
- Hi = DAG.getNode(Node->getOpcode(), NewVT_Hi, H);
- break;
- }
- case ISD::LOAD: {
- LoadSDNode *LD = cast<LoadSDNode>(Node);
- SDOperand Ch = LD->getChain();
- SDOperand Ptr = LD->getBasePtr();
- const Value *SV = LD->getSrcValue();
- int SVOffset = LD->getSrcValueOffset();
- unsigned Alignment = LD->getAlignment();
- bool isVolatile = LD->isVolatile();
-
- Lo = DAG.getLoad(NewVT_Lo, Ch, Ptr, SV, SVOffset, isVolatile, Alignment);
- unsigned IncrementSize = NewNumElts_Lo * MVT::getSizeInBits(NewEltVT)/8;
- Ptr = DAG.getNode(ISD::ADD, Ptr.getValueType(), Ptr,
- DAG.getIntPtrConstant(IncrementSize));
- SVOffset += IncrementSize;
- Alignment = MinAlign(Alignment, IncrementSize);
- Hi = DAG.getLoad(NewVT_Hi, Ch, Ptr, SV, SVOffset, isVolatile, Alignment);
-
- // Build a factor node to remember that this load is independent of the
- // other one.
- SDOperand TF = DAG.getNode(ISD::TokenFactor, MVT::Other, Lo.getValue(1),
- Hi.getValue(1));
-
- // Remember that we legalized the chain.
- AddLegalizedOperand(Op.getValue(1), LegalizeOp(TF));
- break;
- }
- case ISD::BIT_CONVERT: {
- // We know the result is a vector. The input may be either a vector or a
- // scalar value.
- SDOperand InOp = Node->getOperand(0);
- if (!MVT::isVector(InOp.getValueType()) ||
- MVT::getVectorNumElements(InOp.getValueType()) == 1) {
- // The input is a scalar or single-element vector.
- // Lower to a store/load so that it can be split.
- // FIXME: this could be improved probably.
- SDOperand Ptr = DAG.CreateStackTemporary(InOp.getValueType());
- FrameIndexSDNode *FI = cast<FrameIndexSDNode>(Ptr.Val);
-
- SDOperand St = DAG.getStore(DAG.getEntryNode(),
- InOp, Ptr,
- PseudoSourceValue::getFixedStack(),
- FI->getIndex());
- InOp = DAG.getLoad(Op.getValueType(), St, Ptr,
- PseudoSourceValue::getFixedStack(),
- FI->getIndex());
- }
- // Split the vector and convert each of the pieces now.
- SplitVectorOp(InOp, Lo, Hi);
- Lo = DAG.getNode(ISD::BIT_CONVERT, NewVT_Lo, Lo);
- Hi = DAG.getNode(ISD::BIT_CONVERT, NewVT_Hi, Hi);
- break;
- }
- }
-
- // Remember in a map if the values will be reused later.
- bool isNew =
- SplitNodes.insert(std::make_pair(Op, std::make_pair(Lo, Hi))).second;
- assert(isNew && "Value already split?!?");
-}
-
-
-/// ScalarizeVectorOp - Given an operand of single-element vector type
-/// (e.g. v1f32), convert it into the equivalent operation that returns a
-/// scalar (e.g. f32) value.
-SDOperand SelectionDAGLegalize::ScalarizeVectorOp(SDOperand Op) {
- assert(MVT::isVector(Op.getValueType()) &&
- "Bad ScalarizeVectorOp invocation!");
- SDNode *Node = Op.Val;
- MVT::ValueType NewVT = MVT::getVectorElementType(Op.getValueType());
- assert(MVT::getVectorNumElements(Op.getValueType()) == 1);
-
- // See if we already scalarized it.
- std::map<SDOperand, SDOperand>::iterator I = ScalarizedNodes.find(Op);
- if (I != ScalarizedNodes.end()) return I->second;
-
- SDOperand Result;
- switch (Node->getOpcode()) {
- default:
-#ifndef NDEBUG
- Node->dump(&DAG); cerr << "\n";
-#endif
- assert(0 && "Unknown vector operation in ScalarizeVectorOp!");
- case ISD::ADD:
- case ISD::FADD:
- case ISD::SUB:
- case ISD::FSUB:
- case ISD::MUL:
- case ISD::FMUL:
- case ISD::SDIV:
- case ISD::UDIV:
- case ISD::FDIV:
- case ISD::SREM:
- case ISD::UREM:
- case ISD::FREM:
- case ISD::FPOW:
- case ISD::AND:
- case ISD::OR:
- case ISD::XOR:
- Result = DAG.getNode(Node->getOpcode(),
- NewVT,
- ScalarizeVectorOp(Node->getOperand(0)),
- ScalarizeVectorOp(Node->getOperand(1)));
- break;
- case ISD::FNEG:
- case ISD::FABS:
- case ISD::FSQRT:
- case ISD::FSIN:
- case ISD::FCOS:
- Result = DAG.getNode(Node->getOpcode(),
- NewVT,
- ScalarizeVectorOp(Node->getOperand(0)));
- break;
- case ISD::FPOWI:
- Result = DAG.getNode(Node->getOpcode(),
- NewVT,
- ScalarizeVectorOp(Node->getOperand(0)),
- Node->getOperand(1));
- break;
- case ISD::LOAD: {
- LoadSDNode *LD = cast<LoadSDNode>(Node);
- SDOperand Ch = LegalizeOp(LD->getChain()); // Legalize the chain.
- SDOperand Ptr = LegalizeOp(LD->getBasePtr()); // Legalize the pointer.
-
- const Value *SV = LD->getSrcValue();
- int SVOffset = LD->getSrcValueOffset();
- Result = DAG.getLoad(NewVT, Ch, Ptr, SV, SVOffset,
- LD->isVolatile(), LD->getAlignment());
-
- // Remember that we legalized the chain.
- AddLegalizedOperand(Op.getValue(1), LegalizeOp(Result.getValue(1)));
- break;
- }
- case ISD::BUILD_VECTOR:
- Result = Node->getOperand(0);
- break;
- case ISD::INSERT_VECTOR_ELT:
- // Returning the inserted scalar element.
- Result = Node->getOperand(1);
- break;
- case ISD::CONCAT_VECTORS:
- assert(Node->getOperand(0).getValueType() == NewVT &&
- "Concat of non-legal vectors not yet supported!");
- Result = Node->getOperand(0);
- break;
- case ISD::VECTOR_SHUFFLE: {
- // Figure out if the scalar is the LHS or RHS and return it.
- SDOperand EltNum = Node->getOperand(2).getOperand(0);
- if (cast<ConstantSDNode>(EltNum)->getValue())
- Result = ScalarizeVectorOp(Node->getOperand(1));
- else
- Result = ScalarizeVectorOp(Node->getOperand(0));
- break;
- }
- case ISD::EXTRACT_SUBVECTOR:
- Result = Node->getOperand(0);
- assert(Result.getValueType() == NewVT);
- break;
- case ISD::BIT_CONVERT:
- Result = DAG.getNode(ISD::BIT_CONVERT, NewVT, Op.getOperand(0));
- break;
- case ISD::SELECT:
- Result = DAG.getNode(ISD::SELECT, NewVT, Op.getOperand(0),
- ScalarizeVectorOp(Op.getOperand(1)),
- ScalarizeVectorOp(Op.getOperand(2)));
- break;
- }
-
- if (TLI.isTypeLegal(NewVT))
- Result = LegalizeOp(Result);
- bool isNew = ScalarizedNodes.insert(std::make_pair(Op, Result)).second;
- assert(isNew && "Value already scalarized?");
- return Result;
-}
-
-
-// SelectionDAG::Legalize - This is the entry point for the file.
-//
-void SelectionDAG::Legalize() {
- if (ViewLegalizeDAGs) viewGraph();
-
- /// run - This is the main entry point to this class.
- ///
- SelectionDAGLegalize(*this).LegalizeDAG();
-}
-
diff --git a/release_23/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp b/release_23/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp
deleted file mode 100644
index c0cfe216bfe2..000000000000
--- a/release_23/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp
+++ /dev/null
@@ -1,567 +0,0 @@
-//===-- LegalizeTypes.cpp - Common code for DAG type legalizer ------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the SelectionDAG::LegalizeTypes method. It transforms
-// an arbitrary well-formed SelectionDAG to only consist of legal types. This
-// is common code shared among the LegalizeTypes*.cpp files.
-//
-//===----------------------------------------------------------------------===//
-
-#include "LegalizeTypes.h"
-#include "llvm/CallingConv.h"
-#include "llvm/Constants.h"
-#include "llvm/DerivedTypes.h"
-#include "llvm/Support/CommandLine.h"
-#include "llvm/Support/MathExtras.h"
-using namespace llvm;
-
-#ifndef NDEBUG
-static cl::opt<bool>
-ViewLegalizeTypesDAGs("view-legalize-types-dags", cl::Hidden,
- cl::desc("Pop up a window to show dags before legalize types"));
-#else
-static const bool ViewLegalizeTypesDAGs = 0;
-#endif
-
-
-
-/// run - This is the main entry point for the type legalizer. This does a
-/// top-down traversal of the dag, legalizing types as it goes.
-void DAGTypeLegalizer::run() {
- // Create a dummy node (which is not added to allnodes), that adds a reference
- // to the root node, preventing it from being deleted, and tracking any
- // changes of the root.
- HandleSDNode Dummy(DAG.getRoot());
-
- // The root of the dag may dangle to deleted nodes until the type legalizer is
- // done. Set it to null to avoid confusion.
- DAG.setRoot(SDOperand());
-
- // Walk all nodes in the graph, assigning them a NodeID of 'ReadyToProcess'
- // (and remembering them) if they are leaves and assigning 'NewNode' if
- // non-leaves.
- for (SelectionDAG::allnodes_iterator I = DAG.allnodes_begin(),
- E = DAG.allnodes_end(); I != E; ++I) {
- if (I->getNumOperands() == 0) {
- I->setNodeId(ReadyToProcess);
- Worklist.push_back(I);
- } else {
- I->setNodeId(NewNode);
- }
- }
-
- // Now that we have a set of nodes to process, handle them all.
- while (!Worklist.empty()) {
- SDNode *N = Worklist.back();
- Worklist.pop_back();
- assert(N->getNodeId() == ReadyToProcess &&
- "Node should be ready if on worklist!");
-
- // Scan the values produced by the node, checking to see if any result
- // types are illegal.
- unsigned i = 0;
- unsigned NumResults = N->getNumValues();
- do {
- MVT::ValueType ResultVT = N->getValueType(i);
- switch (getTypeAction(ResultVT)) {
- default:
- assert(false && "Unknown action!");
- case Legal:
- break;
- case Promote:
- PromoteResult(N, i);
- goto NodeDone;
- case Expand:
- ExpandResult(N, i);
- goto NodeDone;
- case FloatToInt:
- FloatToIntResult(N, i);
- goto NodeDone;
- case Scalarize:
- ScalarizeResult(N, i);
- goto NodeDone;
- case Split:
- SplitResult(N, i);
- goto NodeDone;
- }
- } while (++i < NumResults);
-
- // Scan the operand list for the node, handling any nodes with operands that
- // are illegal.
- {
- unsigned NumOperands = N->getNumOperands();
- bool NeedsRevisit = false;
- for (i = 0; i != NumOperands; ++i) {
- MVT::ValueType OpVT = N->getOperand(i).getValueType();
- switch (getTypeAction(OpVT)) {
- default:
- assert(false && "Unknown action!");
- case Legal:
- continue;
- case Promote:
- NeedsRevisit = PromoteOperand(N, i);
- break;
- case Expand:
- NeedsRevisit = ExpandOperand(N, i);
- break;
- case FloatToInt:
- NeedsRevisit = FloatToIntOperand(N, i);
- break;
- case Scalarize:
- NeedsRevisit = ScalarizeOperand(N, i);
- break;
- case Split:
- NeedsRevisit = SplitOperand(N, i);
- break;
- }
- break;
- }
-
- // If the node needs revisiting, don't add all users to the worklist etc.
- if (NeedsRevisit)
- continue;
-
- if (i == NumOperands)
- DEBUG(cerr << "Legally typed node: "; N->dump(&DAG); cerr << "\n");
- }
-NodeDone:
-
- // If we reach here, the node was processed, potentially creating new nodes.
- // Mark it as processed and add its users to the worklist as appropriate.
- N->setNodeId(Processed);
-
- for (SDNode::use_iterator UI = N->use_begin(), E = N->use_end();
- UI != E; ++UI) {
- SDNode *User = UI->getUser();
- int NodeID = User->getNodeId();
- assert(NodeID != ReadyToProcess && NodeID != Processed &&
- "Invalid node id for user of unprocessed node!");
-
- // This node has two options: it can either be a new node or its Node ID
- // may be a count of the number of operands it has that are not ready.
- if (NodeID > 0) {
- User->setNodeId(NodeID-1);
-
- // If this was the last use it was waiting on, add it to the ready list.
- if (NodeID-1 == ReadyToProcess)
- Worklist.push_back(User);
- continue;
- }
-
- // Otherwise, this node is new: this is the first operand of it that
- // became ready. Its new NodeID is the number of operands it has minus 1
- // (as this node is now processed).
- assert(NodeID == NewNode && "Unknown node ID!");
- User->setNodeId(User->getNumOperands()-1);
-
- // If the node only has a single operand, it is now ready.
- if (User->getNumOperands() == 1)
- Worklist.push_back(User);
- }
- }
-
- // If the root changed (e.g. it was a dead load, update the root).
- DAG.setRoot(Dummy.getValue());
-
- //DAG.viewGraph();
-
- // Remove dead nodes. This is important to do for cleanliness but also before
- // the checking loop below. Implicit folding by the DAG.getNode operators can
- // cause unreachable nodes to be around with their flags set to new.
- DAG.RemoveDeadNodes();
-
- // In a debug build, scan all the nodes to make sure we found them all. This
- // ensures that there are no cycles and that everything got processed.
-#ifndef NDEBUG
- for (SelectionDAG::allnodes_iterator I = DAG.allnodes_begin(),
- E = DAG.allnodes_end(); I != E; ++I) {
- bool Failed = false;
-
- // Check that all result types are legal.
- for (unsigned i = 0, NumVals = I->getNumValues(); i < NumVals; ++i)
- if (!isTypeLegal(I->getValueType(i))) {
- cerr << "Result type " << i << " illegal!\n";
- Failed = true;
- }
-
- // Check that all operand types are legal.
- for (unsigned i = 0, NumOps = I->getNumOperands(); i < NumOps; ++i)
- if (!isTypeLegal(I->getOperand(i).getValueType())) {
- cerr << "Operand type " << i << " illegal!\n";
- Failed = true;
- }
-
- if (I->getNodeId() != Processed) {
- if (I->getNodeId() == NewNode)
- cerr << "New node not 'noticed'?\n";
- else if (I->getNodeId() > 0)
- cerr << "Operand not processed?\n";
- else if (I->getNodeId() == ReadyToProcess)
- cerr << "Not added to worklist?\n";
- Failed = true;
- }
-
- if (Failed) {
- I->dump(&DAG); cerr << "\n";
- abort();
- }
- }
-#endif
-}
-
-/// AnalyzeNewNode - The specified node is the root of a subtree of potentially
-/// new nodes. Correct any processed operands (this may change the node) and
-/// calculate the NodeId.
-void DAGTypeLegalizer::AnalyzeNewNode(SDNode *&N) {
- // If this was an existing node that is already done, we're done.
- if (N->getNodeId() != NewNode)
- return;
-
- // Okay, we know that this node is new. Recursively walk all of its operands
- // to see if they are new also. The depth of this walk is bounded by the size
- // of the new tree that was constructed (usually 2-3 nodes), so we don't worry
- // about revisiting of nodes.
- //
- // As we walk the operands, keep track of the number of nodes that are
- // processed. If non-zero, this will become the new nodeid of this node.
- // Already processed operands may need to be remapped to the node that
- // replaced them, which can result in our node changing. Since remapping
- // is rare, the code tries to minimize overhead in the non-remapping case.
-
- SmallVector<SDOperand, 8> NewOps;
- unsigned NumProcessed = 0;
- for (unsigned i = 0, e = N->getNumOperands(); i != e; ++i) {
- SDOperand OrigOp = N->getOperand(i);
- SDOperand Op = OrigOp;
-
- if (Op.Val->getNodeId() == Processed)
- RemapNode(Op);
-
- if (Op.Val->getNodeId() == NewNode)
- AnalyzeNewNode(Op.Val);
- else if (Op.Val->getNodeId() == Processed)
- ++NumProcessed;
-
- if (!NewOps.empty()) {
- // Some previous operand changed. Add this one to the list.
- NewOps.push_back(Op);
- } else if (Op != OrigOp) {
- // This is the first operand to change - add all operands so far.
- for (unsigned j = 0; j < i; ++j)
- NewOps.push_back(N->getOperand(j));
- NewOps.push_back(Op);
- }
- }
-
- // Some operands changed - update the node.
- if (!NewOps.empty())
- N = DAG.UpdateNodeOperands(SDOperand(N, 0), &NewOps[0], NewOps.size()).Val;
-
- N->setNodeId(N->getNumOperands()-NumProcessed);
- if (N->getNodeId() == ReadyToProcess)
- Worklist.push_back(N);
-}
-
-void DAGTypeLegalizer::SanityCheck(SDNode *N) {
- for (SmallVector<SDNode*, 128>::iterator I = Worklist.begin(),
- E = Worklist.end(); I != E; ++I)
- assert(*I != N);
-
- for (DenseMap<SDOperand, SDOperand>::iterator I = ReplacedNodes.begin(),
- E = ReplacedNodes.end(); I != E; ++I) {
- assert(I->first.Val != N);
- assert(I->second.Val != N);
- }
-
- for (DenseMap<SDOperand, SDOperand>::iterator I = PromotedNodes.begin(),
- E = PromotedNodes.end(); I != E; ++I) {
- assert(I->first.Val != N);
- assert(I->second.Val != N);
- }
-
- for (DenseMap<SDOperand, SDOperand>::iterator
- I = FloatToIntedNodes.begin(),
- E = FloatToIntedNodes.end(); I != E; ++I) {
- assert(I->first.Val != N);
- assert(I->second.Val != N);
- }
-
- for (DenseMap<SDOperand, SDOperand>::iterator I = ScalarizedNodes.begin(),
- E = ScalarizedNodes.end(); I != E; ++I) {
- assert(I->first.Val != N);
- assert(I->second.Val != N);
- }
-
- for (DenseMap<SDOperand, std::pair<SDOperand, SDOperand> >::iterator
- I = ExpandedNodes.begin(), E = ExpandedNodes.end(); I != E; ++I) {
- assert(I->first.Val != N);
- assert(I->second.first.Val != N);
- assert(I->second.second.Val != N);
- }
-
- for (DenseMap<SDOperand, std::pair<SDOperand, SDOperand> >::iterator
- I = SplitNodes.begin(), E = SplitNodes.end(); I != E; ++I) {
- assert(I->first.Val != N);
- assert(I->second.first.Val != N);
- assert(I->second.second.Val != N);
- }
-}
-
-namespace {
- /// NodeUpdateListener - This class is a DAGUpdateListener that listens for
- /// updates to nodes and recomputes their ready state.
- class VISIBILITY_HIDDEN NodeUpdateListener :
- public SelectionDAG::DAGUpdateListener {
- DAGTypeLegalizer &DTL;
- public:
- NodeUpdateListener(DAGTypeLegalizer &dtl) : DTL(dtl) {}
-
- virtual void NodeDeleted(SDNode *N) {
- // Ignore deletes.
- assert(N->getNodeId() != DAGTypeLegalizer::Processed &&
- N->getNodeId() != DAGTypeLegalizer::ReadyToProcess &&
- "RAUW deleted processed node!");
-#ifndef NDEBUG
- DTL.SanityCheck(N);
-#endif
- }
-
- virtual void NodeUpdated(SDNode *N) {
- // Node updates can mean pretty much anything. It is possible that an
- // operand was set to something already processed (f.e.) in which case
- // this node could become ready. Recompute its flags.
- assert(N->getNodeId() != DAGTypeLegalizer::Processed &&
- N->getNodeId() != DAGTypeLegalizer::ReadyToProcess &&
- "RAUW updated processed node!");
- DTL.ReanalyzeNode(N);
- }
- };
-}
-
-
-/// ReplaceValueWith - The specified value was legalized to the specified other
-/// value. If they are different, update the DAG and NodeIDs replacing any uses
-/// of From to use To instead.
-void DAGTypeLegalizer::ReplaceValueWith(SDOperand From, SDOperand To) {
- if (From == To) return;
-
- // If expansion produced new nodes, make sure they are properly marked.
- AnalyzeNewNode(To.Val);
-
- // Anything that used the old node should now use the new one. Note that this
- // can potentially cause recursive merging.
- NodeUpdateListener NUL(*this);
- DAG.ReplaceAllUsesOfValueWith(From, To, &NUL);
-
- // The old node may still be present in ExpandedNodes or PromotedNodes.
- // Inform them about the replacement.
- ReplacedNodes[From] = To;
-}
-
-/// ReplaceNodeWith - Replace uses of the 'from' node's results with the 'to'
-/// node's results. The from and to node must define identical result types.
-void DAGTypeLegalizer::ReplaceNodeWith(SDNode *From, SDNode *To) {
- if (From == To) return;
-
- // If expansion produced new nodes, make sure they are properly marked.
- AnalyzeNewNode(To);
-
- assert(From->getNumValues() == To->getNumValues() &&
- "Node results don't match");
-
- // Anything that used the old node should now use the new one. Note that this
- // can potentially cause recursive merging.
- NodeUpdateListener NUL(*this);
- DAG.ReplaceAllUsesWith(From, To, &NUL);
-
- // The old node may still be present in ExpandedNodes or PromotedNodes.
- // Inform them about the replacement.
- for (unsigned i = 0, e = From->getNumValues(); i != e; ++i) {
- assert(From->getValueType(i) == To->getValueType(i) &&
- "Node results don't match");
- ReplacedNodes[SDOperand(From, i)] = SDOperand(To, i);
- }
-}
-
-
-/// RemapNode - If the specified value was already legalized to another value,
-/// replace it by that value.
-void DAGTypeLegalizer::RemapNode(SDOperand &N) {
- DenseMap<SDOperand, SDOperand>::iterator I = ReplacedNodes.find(N);
- if (I != ReplacedNodes.end()) {
- // Use path compression to speed up future lookups if values get multiply
- // replaced with other values.
- RemapNode(I->second);
- N = I->second;
- }
-}
-
-void DAGTypeLegalizer::SetPromotedOp(SDOperand Op, SDOperand Result) {
- AnalyzeNewNode(Result.Val);
-
- SDOperand &OpEntry = PromotedNodes[Op];
- assert(OpEntry.Val == 0 && "Node is already promoted!");
- OpEntry = Result;
-}
-
-void DAGTypeLegalizer::SetIntegerOp(SDOperand Op, SDOperand Result) {
- AnalyzeNewNode(Result.Val);
-
- SDOperand &OpEntry = FloatToIntedNodes[Op];
- assert(OpEntry.Val == 0 && "Node is already converted to integer!");
- OpEntry = Result;
-}
-
-void DAGTypeLegalizer::SetScalarizedOp(SDOperand Op, SDOperand Result) {
- AnalyzeNewNode(Result.Val);
-
- SDOperand &OpEntry = ScalarizedNodes[Op];
- assert(OpEntry.Val == 0 && "Node is already scalarized!");
- OpEntry = Result;
-}
-
-void DAGTypeLegalizer::GetExpandedOp(SDOperand Op, SDOperand &Lo,
- SDOperand &Hi) {
- std::pair<SDOperand, SDOperand> &Entry = ExpandedNodes[Op];
- RemapNode(Entry.first);
- RemapNode(Entry.second);
- assert(Entry.first.Val && "Operand isn't expanded");
- Lo = Entry.first;
- Hi = Entry.second;
-}
-
-void DAGTypeLegalizer::SetExpandedOp(SDOperand Op, SDOperand Lo, SDOperand Hi) {
- // Lo/Hi may have been newly allocated, if so, add nodeid's as relevant.
- AnalyzeNewNode(Lo.Val);
- AnalyzeNewNode(Hi.Val);
-
- // Remember that this is the result of the node.
- std::pair<SDOperand, SDOperand> &Entry = ExpandedNodes[Op];
- assert(Entry.first.Val == 0 && "Node already expanded");
- Entry.first = Lo;
- Entry.second = Hi;
-}
-
-void DAGTypeLegalizer::GetSplitOp(SDOperand Op, SDOperand &Lo, SDOperand &Hi) {
- std::pair<SDOperand, SDOperand> &Entry = SplitNodes[Op];
- RemapNode(Entry.first);
- RemapNode(Entry.second);
- assert(Entry.first.Val && "Operand isn't split");
- Lo = Entry.first;
- Hi = Entry.second;
-}
-
-void DAGTypeLegalizer::SetSplitOp(SDOperand Op, SDOperand Lo, SDOperand Hi) {
- // Lo/Hi may have been newly allocated, if so, add nodeid's as relevant.
- AnalyzeNewNode(Lo.Val);
- AnalyzeNewNode(Hi.Val);
-
- // Remember that this is the result of the node.
- std::pair<SDOperand, SDOperand> &Entry = SplitNodes[Op];
- assert(Entry.first.Val == 0 && "Node already split");
- Entry.first = Lo;
- Entry.second = Hi;
-}
-
-
-/// BitConvertToInteger - Convert to an integer of the same size.
-SDOperand DAGTypeLegalizer::BitConvertToInteger(SDOperand Op) {
- return DAG.getNode(ISD::BIT_CONVERT,
- MVT::getIntegerType(MVT::getSizeInBits(Op.getValueType())),
- Op);
-}
-
-SDOperand DAGTypeLegalizer::CreateStackStoreLoad(SDOperand Op,
- MVT::ValueType DestVT) {
- // Create the stack frame object.
- SDOperand FIPtr = DAG.CreateStackTemporary(DestVT);
-
- // Emit a store to the stack slot.
- SDOperand Store = DAG.getStore(DAG.getEntryNode(), Op, FIPtr, NULL, 0);
- // Result is a load from the stack slot.
- return DAG.getLoad(DestVT, Store, FIPtr, NULL, 0);
-}
-
-/// JoinIntegers - Build an integer with low bits Lo and high bits Hi.
-SDOperand DAGTypeLegalizer::JoinIntegers(SDOperand Lo, SDOperand Hi) {
- MVT::ValueType LVT = Lo.getValueType();
- MVT::ValueType HVT = Hi.getValueType();
- MVT::ValueType NVT = MVT::getIntegerType(MVT::getSizeInBits(LVT) +
- MVT::getSizeInBits(HVT));
-
- Lo = DAG.getNode(ISD::ZERO_EXTEND, NVT, Lo);
- Hi = DAG.getNode(ISD::ANY_EXTEND, NVT, Hi);
- Hi = DAG.getNode(ISD::SHL, NVT, Hi, DAG.getConstant(MVT::getSizeInBits(LVT),
- TLI.getShiftAmountTy()));
- return DAG.getNode(ISD::OR, NVT, Lo, Hi);
-}
-
-/// SplitInteger - Return the lower LoVT bits of Op in Lo and the upper HiVT
-/// bits in Hi.
-void DAGTypeLegalizer::SplitInteger(SDOperand Op,
- MVT::ValueType LoVT, MVT::ValueType HiVT,
- SDOperand &Lo, SDOperand &Hi) {
- assert(MVT::getSizeInBits(LoVT) + MVT::getSizeInBits(HiVT) ==
- MVT::getSizeInBits(Op.getValueType()) && "Invalid integer splitting!");
- Lo = DAG.getNode(ISD::TRUNCATE, LoVT, Op);
- Hi = DAG.getNode(ISD::SRL, Op.getValueType(), Op,
- DAG.getConstant(MVT::getSizeInBits(LoVT),
- TLI.getShiftAmountTy()));
- Hi = DAG.getNode(ISD::TRUNCATE, HiVT, Hi);
-}
-
-/// SplitInteger - Return the lower and upper halves of Op's bits in a value type
-/// half the size of Op's.
-void DAGTypeLegalizer::SplitInteger(SDOperand Op,
- SDOperand &Lo, SDOperand &Hi) {
- MVT::ValueType HalfVT =
- MVT::getIntegerType(MVT::getSizeInBits(Op.getValueType())/2);
- SplitInteger(Op, HalfVT, HalfVT, Lo, Hi);
-}
-
-/// MakeLibCall - Generate a libcall taking the given operands as arguments and
-/// returning a result of type RetVT.
-SDOperand DAGTypeLegalizer::MakeLibCall(RTLIB::Libcall LC, MVT::ValueType RetVT,
- const SDOperand *Ops, unsigned NumOps,
- bool isSigned) {
- TargetLowering::ArgListTy Args;
- Args.reserve(NumOps);
-
- TargetLowering::ArgListEntry Entry;
- for (unsigned i = 0; i != NumOps; ++i) {
- Entry.Node = Ops[i];
- Entry.Ty = MVT::getTypeForValueType(Entry.Node.getValueType());
- Entry.isSExt = isSigned;
- Entry.isZExt = !isSigned;
- Args.push_back(Entry);
- }
- SDOperand Callee = DAG.getExternalSymbol(TLI.getLibcallName(LC),
- TLI.getPointerTy());
-
- const Type *RetTy = MVT::getTypeForValueType(RetVT);
- std::pair<SDOperand,SDOperand> CallInfo =
- TLI.LowerCallTo(DAG.getEntryNode(), RetTy, isSigned, !isSigned, false,
- CallingConv::C, false, Callee, Args, DAG);
- return CallInfo.first;
-}
-
-//===----------------------------------------------------------------------===//
-// Entry Point
-//===----------------------------------------------------------------------===//
-
-/// LegalizeTypes - This transforms the SelectionDAG into a SelectionDAG that
-/// only uses types natively supported by the target.
-///
-/// Note that this is an involved process that may invalidate pointers into
-/// the graph.
-void SelectionDAG::LegalizeTypes() {
- if (ViewLegalizeTypesDAGs) viewGraph();
-
- DAGTypeLegalizer(*this).run();
-}
diff --git a/release_23/lib/CodeGen/SelectionDAG/LegalizeTypes.h b/release_23/lib/CodeGen/SelectionDAG/LegalizeTypes.h
deleted file mode 100644
index a983c95cb68e..000000000000
--- a/release_23/lib/CodeGen/SelectionDAG/LegalizeTypes.h
+++ /dev/null
@@ -1,402 +0,0 @@
-//===-- LegalizeTypes.h - Definition of the DAG Type Legalizer class ------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines the DAGTypeLegalizer class. This is a private interface
-// shared between the code that implements the SelectionDAG::LegalizeTypes
-// method.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef SELECTIONDAG_LEGALIZETYPES_H
-#define SELECTIONDAG_LEGALIZETYPES_H
-
-#define DEBUG_TYPE "legalize-types"
-#include "llvm/CodeGen/SelectionDAG.h"
-#include "llvm/Target/TargetLowering.h"
-#include "llvm/ADT/DenseMap.h"
-#include "llvm/Support/Compiler.h"
-#include "llvm/Support/Debug.h"
-
-namespace llvm {
-
-//===----------------------------------------------------------------------===//
-/// DAGTypeLegalizer - This takes an arbitrary SelectionDAG as input and
-/// hacks on it until the target machine can handle it. This involves
-/// eliminating value sizes the machine cannot handle (promoting small sizes to
-/// large sizes or splitting up large values into small values) as well as
-/// eliminating operations the machine cannot handle.
-///
-/// This code also does a small amount of optimization and recognition of idioms
-/// as part of its processing. For example, if a target does not support a
-/// 'setcc' instruction efficiently, but does support 'brcc' instruction, this
-/// will attempt merge setcc and brc instructions into brcc's.
-///
-class VISIBILITY_HIDDEN DAGTypeLegalizer {
- TargetLowering &TLI;
- SelectionDAG &DAG;
-public:
- // NodeIDFlags - This pass uses the NodeID on the SDNodes to hold information
- // about the state of the node. The enum has all the values.
- enum NodeIDFlags {
- /// ReadyToProcess - All operands have been processed, so this node is ready
- /// to be handled.
- ReadyToProcess = 0,
-
- /// NewNode - This is a new node that was created in the process of
- /// legalizing some other node.
- NewNode = -1,
-
- /// Processed - This is a node that has already been processed.
- Processed = -2
-
- // 1+ - This is a node which has this many unlegalized operands.
- };
-private:
- enum LegalizeAction {
- Legal, // The target natively supports this type.
- Promote, // This type should be executed in a larger type.
- Expand, // This type should be split into two types of half the size.
- FloatToInt, // Convert a floating point type to an integer of the same size.
- Scalarize, // Replace this one-element vector type with its element type.
- Split // This vector type should be split into smaller vectors.
- };
-
- /// ValueTypeActions - This is a bitvector that contains two bits for each
- /// simple value type, where the two bits correspond to the LegalizeAction
- /// enum from TargetLowering. This can be queried with "getTypeAction(VT)".
- TargetLowering::ValueTypeActionImpl ValueTypeActions;
-
- /// getTypeAction - Return how we should legalize values of this type, either
- /// it is already legal, or we need to promote it to a larger integer type, or
- /// we need to expand it into multiple registers of a smaller integer type, or
- /// we need to scalarize a one-element vector type into the element type, or
- /// we need to split a vector type into smaller vector types.
- LegalizeAction getTypeAction(MVT::ValueType VT) const {
- switch (ValueTypeActions.getTypeAction(VT)) {
- default:
- assert(false && "Unknown legalize action!");
- case TargetLowering::Legal:
- return Legal;
- case TargetLowering::Promote:
- return Promote;
- case TargetLowering::Expand:
- // Expand can mean
- // 1) split scalar in half, 2) convert a float to an integer,
- // 3) scalarize a single-element vector, 4) split a vector in two.
- if (!MVT::isVector(VT)) {
- if (MVT::getSizeInBits(VT) ==
- MVT::getSizeInBits(TLI.getTypeToTransformTo(VT)))
- return FloatToInt;
- else
- return Expand;
- } else if (MVT::getVectorNumElements(VT) == 1) {
- return Scalarize;
- } else {
- return Split;
- }
- }
- }
-
- /// isTypeLegal - Return true if this type is legal on this target.
- bool isTypeLegal(MVT::ValueType VT) const {
- return ValueTypeActions.getTypeAction(VT) == TargetLowering::Legal;
- }
-
- /// PromotedNodes - For nodes that are below legal width, this map indicates
- /// what promoted value to use.
- DenseMap<SDOperand, SDOperand> PromotedNodes;
-
- /// ExpandedNodes - For nodes that need to be expanded this map indicates
- /// which operands are the expanded version of the input.
- DenseMap<SDOperand, std::pair<SDOperand, SDOperand> > ExpandedNodes;
-
- /// FloatToIntedNodes - For floating point nodes converted to integers of
- /// the same size, this map indicates the converted value to use.
- DenseMap<SDOperand, SDOperand> FloatToIntedNodes;
-
- /// ScalarizedNodes - For nodes that are <1 x ty>, this map indicates the
- /// scalar value of type 'ty' to use.
- DenseMap<SDOperand, SDOperand> ScalarizedNodes;
-
- /// SplitNodes - For nodes that need to be split this map indicates
- /// which operands are the expanded version of the input.
- DenseMap<SDOperand, std::pair<SDOperand, SDOperand> > SplitNodes;
-
- /// ReplacedNodes - For nodes that have been replaced with another,
- /// indicates the replacement node to use.
- DenseMap<SDOperand, SDOperand> ReplacedNodes;
-
- /// Worklist - This defines a worklist of nodes to process. In order to be
- /// pushed onto this worklist, all operands of a node must have already been
- /// processed.
- SmallVector<SDNode*, 128> Worklist;
-
-public:
- explicit DAGTypeLegalizer(SelectionDAG &dag)
- : TLI(dag.getTargetLoweringInfo()), DAG(dag),
- ValueTypeActions(TLI.getValueTypeActions()) {
- assert(MVT::LAST_VALUETYPE <= 32 &&
- "Too many value types for ValueTypeActions to hold!");
- }
-
- void run();
-
- /// ReanalyzeNode - Recompute the NodeID and correct processed operands
- /// for the specified node, adding it to the worklist if ready.
- void ReanalyzeNode(SDNode *N) {
- N->setNodeId(NewNode);
- AnalyzeNewNode(N);
- }
-
-private:
- void AnalyzeNewNode(SDNode *&N);
-
- void ReplaceValueWith(SDOperand From, SDOperand To);
- void ReplaceNodeWith(SDNode *From, SDNode *To);
-
- void RemapNode(SDOperand &N);
-
- // Common routines.
- SDOperand BitConvertToInteger(SDOperand Op);
- SDOperand CreateStackStoreLoad(SDOperand Op, MVT::ValueType DestVT);
- SDOperand JoinIntegers(SDOperand Lo, SDOperand Hi);
- void SplitInteger(SDOperand Op, SDOperand &Lo, SDOperand &Hi);
- void SplitInteger(SDOperand Op, MVT::ValueType LoVT, MVT::ValueType HiVT,
- SDOperand &Lo, SDOperand &Hi);
- SDOperand MakeLibCall(RTLIB::Libcall LC, MVT::ValueType RetVT,
- const SDOperand *Ops, unsigned NumOps, bool isSigned);
-
- //===--------------------------------------------------------------------===//
- // Promotion Support: LegalizeTypesPromote.cpp
- //===--------------------------------------------------------------------===//
-
- SDOperand GetPromotedOp(SDOperand Op) {
- SDOperand &PromotedOp = PromotedNodes[Op];
- RemapNode(PromotedOp);
- assert(PromotedOp.Val && "Operand wasn't promoted?");
- return PromotedOp;
- }
- void SetPromotedOp(SDOperand Op, SDOperand Result);
-
- /// GetPromotedZExtOp - Get a promoted operand and zero extend it to the final
- /// size.
- SDOperand GetPromotedZExtOp(SDOperand Op) {
- MVT::ValueType OldVT = Op.getValueType();
- Op = GetPromotedOp(Op);
- return DAG.getZeroExtendInReg(Op, OldVT);
- }
-
- // Result Promotion.
- void PromoteResult(SDNode *N, unsigned ResNo);
- SDOperand PromoteResult_BIT_CONVERT(SDNode *N);
- SDOperand PromoteResult_BUILD_PAIR(SDNode *N);
- SDOperand PromoteResult_Constant(SDNode *N);
- SDOperand PromoteResult_CTLZ(SDNode *N);
- SDOperand PromoteResult_CTPOP(SDNode *N);
- SDOperand PromoteResult_CTTZ(SDNode *N);
- SDOperand PromoteResult_EXTRACT_VECTOR_ELT(SDNode *N);
- SDOperand PromoteResult_FP_ROUND(SDNode *N);
- SDOperand PromoteResult_FP_TO_XINT(SDNode *N);
- SDOperand PromoteResult_INT_EXTEND(SDNode *N);
- SDOperand PromoteResult_LOAD(LoadSDNode *N);
- SDOperand PromoteResult_SDIV(SDNode *N);
- SDOperand PromoteResult_SELECT (SDNode *N);
- SDOperand PromoteResult_SELECT_CC(SDNode *N);
- SDOperand PromoteResult_SETCC(SDNode *N);
- SDOperand PromoteResult_SHL(SDNode *N);
- SDOperand PromoteResult_SimpleIntBinOp(SDNode *N);
- SDOperand PromoteResult_SRA(SDNode *N);
- SDOperand PromoteResult_SRL(SDNode *N);
- SDOperand PromoteResult_TRUNCATE(SDNode *N);
- SDOperand PromoteResult_UDIV(SDNode *N);
- SDOperand PromoteResult_UNDEF(SDNode *N);
-
- // Operand Promotion.
- bool PromoteOperand(SDNode *N, unsigned OperandNo);
- SDOperand PromoteOperand_ANY_EXTEND(SDNode *N);
- SDOperand PromoteOperand_BUILD_PAIR(SDNode *N);
- SDOperand PromoteOperand_BR_CC(SDNode *N, unsigned OpNo);
- SDOperand PromoteOperand_BRCOND(SDNode *N, unsigned OpNo);
- SDOperand PromoteOperand_BUILD_VECTOR(SDNode *N);
- SDOperand PromoteOperand_FP_EXTEND(SDNode *N);
- SDOperand PromoteOperand_FP_ROUND(SDNode *N);
- SDOperand PromoteOperand_INT_TO_FP(SDNode *N);
- SDOperand PromoteOperand_INSERT_VECTOR_ELT(SDNode *N, unsigned OpNo);
- SDOperand PromoteOperand_MEMBARRIER(SDNode *N);
- SDOperand PromoteOperand_RET(SDNode *N, unsigned OpNo);
- SDOperand PromoteOperand_SELECT(SDNode *N, unsigned OpNo);
- SDOperand PromoteOperand_SETCC(SDNode *N, unsigned OpNo);
- SDOperand PromoteOperand_SIGN_EXTEND(SDNode *N);
- SDOperand PromoteOperand_STORE(StoreSDNode *N, unsigned OpNo);
- SDOperand PromoteOperand_TRUNCATE(SDNode *N);
- SDOperand PromoteOperand_ZERO_EXTEND(SDNode *N);
-
- void PromoteSetCCOperands(SDOperand &LHS,SDOperand &RHS, ISD::CondCode Code);
-
- //===--------------------------------------------------------------------===//
- // Expansion Support: LegalizeTypesExpand.cpp
- //===--------------------------------------------------------------------===//
-
- void GetExpandedOp(SDOperand Op, SDOperand &Lo, SDOperand &Hi);
- void SetExpandedOp(SDOperand Op, SDOperand Lo, SDOperand Hi);
-
- // Result Expansion.
- void ExpandResult(SDNode *N, unsigned ResNo);
- void ExpandResult_ANY_EXTEND (SDNode *N, SDOperand &Lo, SDOperand &Hi);
- void ExpandResult_AssertZext (SDNode *N, SDOperand &Lo, SDOperand &Hi);
- void ExpandResult_BIT_CONVERT(SDNode *N, SDOperand &Lo, SDOperand &Hi);
- void ExpandResult_BUILD_PAIR (SDNode *N, SDOperand &Lo, SDOperand &Hi);
- void ExpandResult_Constant (SDNode *N, SDOperand &Lo, SDOperand &Hi);
- void ExpandResult_CTLZ (SDNode *N, SDOperand &Lo, SDOperand &Hi);
- void ExpandResult_CTPOP (SDNode *N, SDOperand &Lo, SDOperand &Hi);
- void ExpandResult_CTTZ (SDNode *N, SDOperand &Lo, SDOperand &Hi);
- void ExpandResult_EXTRACT_VECTOR_ELT(SDNode *N, SDOperand &Lo, SDOperand &Hi);
- void ExpandResult_LOAD (LoadSDNode *N, SDOperand &Lo, SDOperand &Hi);
- void ExpandResult_MERGE_VALUES(SDNode *N, SDOperand &Lo, SDOperand &Hi);
- void ExpandResult_SIGN_EXTEND(SDNode *N, SDOperand &Lo, SDOperand &Hi);
- void ExpandResult_SIGN_EXTEND_INREG(SDNode *N, SDOperand &Lo, SDOperand &Hi);
- void ExpandResult_TRUNCATE (SDNode *N, SDOperand &Lo, SDOperand &Hi);
- void ExpandResult_UNDEF (SDNode *N, SDOperand &Lo, SDOperand &Hi);
- void ExpandResult_ZERO_EXTEND(SDNode *N, SDOperand &Lo, SDOperand &Hi);
- void ExpandResult_FP_TO_SINT (SDNode *N, SDOperand &Lo, SDOperand &Hi);
- void ExpandResult_FP_TO_UINT (SDNode *N, SDOperand &Lo, SDOperand &Hi);
-
- void ExpandResult_Logical (SDNode *N, SDOperand &Lo, SDOperand &Hi);
- void ExpandResult_BSWAP (SDNode *N, SDOperand &Lo, SDOperand &Hi);
- void ExpandResult_ADDSUB (SDNode *N, SDOperand &Lo, SDOperand &Hi);
- void ExpandResult_ADDSUBC (SDNode *N, SDOperand &Lo, SDOperand &Hi);
- void ExpandResult_ADDSUBE (SDNode *N, SDOperand &Lo, SDOperand &Hi);
- void ExpandResult_SELECT (SDNode *N, SDOperand &Lo, SDOperand &Hi);
- void ExpandResult_SELECT_CC (SDNode *N, SDOperand &Lo, SDOperand &Hi);
- void ExpandResult_MUL (SDNode *N, SDOperand &Lo, SDOperand &Hi);
- void ExpandResult_SDIV (SDNode *N, SDOperand &Lo, SDOperand &Hi);
- void ExpandResult_SREM (SDNode *N, SDOperand &Lo, SDOperand &Hi);
- void ExpandResult_UDIV (SDNode *N, SDOperand &Lo, SDOperand &Hi);
- void ExpandResult_UREM (SDNode *N, SDOperand &Lo, SDOperand &Hi);
- void ExpandResult_Shift (SDNode *N, SDOperand &Lo, SDOperand &Hi);
-
- void ExpandShiftByConstant(SDNode *N, unsigned Amt,
- SDOperand &Lo, SDOperand &Hi);
- bool ExpandShiftWithKnownAmountBit(SDNode *N, SDOperand &Lo, SDOperand &Hi);
-
- // Operand Expansion.
- bool ExpandOperand(SDNode *N, unsigned OperandNo);
- SDOperand ExpandOperand_BIT_CONVERT(SDNode *N);
- SDOperand ExpandOperand_BR_CC(SDNode *N);
- SDOperand ExpandOperand_BUILD_VECTOR(SDNode *N);
- SDOperand ExpandOperand_EXTRACT_ELEMENT(SDNode *N);
- SDOperand ExpandOperand_SETCC(SDNode *N);
- SDOperand ExpandOperand_SINT_TO_FP(SDOperand Source, MVT::ValueType DestTy);
- SDOperand ExpandOperand_STORE(StoreSDNode *N, unsigned OpNo);
- SDOperand ExpandOperand_TRUNCATE(SDNode *N);
- SDOperand ExpandOperand_UINT_TO_FP(SDOperand Source, MVT::ValueType DestTy);
-
- void ExpandSetCCOperands(SDOperand &NewLHS, SDOperand &NewRHS,
- ISD::CondCode &CCCode);
-
- //===--------------------------------------------------------------------===//
- // Float to Integer Conversion Support: LegalizeTypesFloatToInt.cpp
- //===--------------------------------------------------------------------===//
-
- SDOperand GetIntegerOp(SDOperand Op) {
- SDOperand &IntegerOp = FloatToIntedNodes[Op];
- RemapNode(IntegerOp);
- assert(IntegerOp.Val && "Operand wasn't converted to integer?");
- return IntegerOp;
- }
- void SetIntegerOp(SDOperand Op, SDOperand Result);
-
- // Result Float to Integer Conversion.
- void FloatToIntResult(SDNode *N, unsigned OpNo);
- SDOperand FloatToIntRes_BIT_CONVERT(SDNode *N);
- SDOperand FloatToIntRes_BUILD_PAIR(SDNode *N);
- SDOperand FloatToIntRes_ConstantFP(ConstantFPSDNode *N);
- SDOperand FloatToIntRes_FADD(SDNode *N);
- SDOperand FloatToIntRes_FCOPYSIGN(SDNode *N);
- SDOperand FloatToIntRes_FMUL(SDNode *N);
- SDOperand FloatToIntRes_FSUB(SDNode *N);
- SDOperand FloatToIntRes_LOAD(SDNode *N);
- SDOperand FloatToIntRes_XINT_TO_FP(SDNode *N);
-
- // Operand Float to Integer Conversion.
- bool FloatToIntOperand(SDNode *N, unsigned OpNo);
- SDOperand FloatToIntOp_BIT_CONVERT(SDNode *N);
-
- //===--------------------------------------------------------------------===//
- // Scalarization Support: LegalizeTypesScalarize.cpp
- //===--------------------------------------------------------------------===//
-
- SDOperand GetScalarizedOp(SDOperand Op) {
- SDOperand &ScalarOp = ScalarizedNodes[Op];
- RemapNode(ScalarOp);
- assert(ScalarOp.Val && "Operand wasn't scalarized?");
- return ScalarOp;
- }
- void SetScalarizedOp(SDOperand Op, SDOperand Result);
-
- // Result Vector Scalarization: <1 x ty> -> ty.
- void ScalarizeResult(SDNode *N, unsigned OpNo);
- SDOperand ScalarizeRes_BinOp(SDNode *N);
- SDOperand ScalarizeRes_UnaryOp(SDNode *N);
-
- SDOperand ScalarizeRes_BIT_CONVERT(SDNode *N);
- SDOperand ScalarizeRes_FPOWI(SDNode *N);
- SDOperand ScalarizeRes_INSERT_VECTOR_ELT(SDNode *N);
- SDOperand ScalarizeRes_LOAD(LoadSDNode *N);
- SDOperand ScalarizeRes_SELECT(SDNode *N);
- SDOperand ScalarizeRes_UNDEF(SDNode *N);
- SDOperand ScalarizeRes_VECTOR_SHUFFLE(SDNode *N);
-
- // Operand Vector Scalarization: <1 x ty> -> ty.
- bool ScalarizeOperand(SDNode *N, unsigned OpNo);
- SDOperand ScalarizeOp_BIT_CONVERT(SDNode *N);
- SDOperand ScalarizeOp_EXTRACT_VECTOR_ELT(SDNode *N);
- SDOperand ScalarizeOp_STORE(StoreSDNode *N, unsigned OpNo);
-
- //===--------------------------------------------------------------------===//
- // Vector Splitting Support: LegalizeTypesSplit.cpp
- //===--------------------------------------------------------------------===//
-
- void GetSplitOp(SDOperand Op, SDOperand &Lo, SDOperand &Hi);
- void SetSplitOp(SDOperand Op, SDOperand Lo, SDOperand Hi);
-
- // Result Vector Splitting: <128 x ty> -> 2 x <64 x ty>.
- void SplitResult(SDNode *N, unsigned OpNo);
-
- void SplitRes_UNDEF(SDNode *N, SDOperand &Lo, SDOperand &Hi);
- void SplitRes_LOAD(LoadSDNode *N, SDOperand &Lo, SDOperand &Hi);
- void SplitRes_BUILD_PAIR(SDNode *N, SDOperand &Lo, SDOperand &Hi);
- void SplitRes_INSERT_VECTOR_ELT(SDNode *N, SDOperand &Lo, SDOperand &Hi);
- void SplitRes_VECTOR_SHUFFLE(SDNode *N, SDOperand &Lo, SDOperand &Hi);
-
- void SplitRes_BUILD_VECTOR(SDNode *N, SDOperand &Lo, SDOperand &Hi);
- void SplitRes_CONCAT_VECTORS(SDNode *N, SDOperand &Lo, SDOperand &Hi);
- void SplitRes_BIT_CONVERT(SDNode *N, SDOperand &Lo, SDOperand &Hi);
- void SplitRes_UnOp(SDNode *N, SDOperand &Lo, SDOperand &Hi);
- void SplitRes_BinOp(SDNode *N, SDOperand &Lo, SDOperand &Hi);
- void SplitRes_FPOWI(SDNode *N, SDOperand &Lo, SDOperand &Hi);
- void SplitRes_SELECT(SDNode *N, SDOperand &Lo, SDOperand &Hi);
-
- // Operand Vector Splitting: <128 x ty> -> 2 x <64 x ty>.
- bool SplitOperand(SDNode *N, unsigned OpNo);
-
- SDOperand SplitOp_BIT_CONVERT(SDNode *N);
- SDOperand SplitOp_EXTRACT_SUBVECTOR(SDNode *N);
- SDOperand SplitOp_EXTRACT_VECTOR_ELT(SDNode *N);
- SDOperand SplitOp_RET(SDNode *N, unsigned OpNo);
- SDOperand SplitOp_STORE(StoreSDNode *N, unsigned OpNo);
- SDOperand SplitOp_VECTOR_SHUFFLE(SDNode *N, unsigned OpNo);
-
-public:
- void SanityCheck(SDNode *N);
-};
-
-} // end namespace llvm.
-
-#endif
diff --git a/release_23/lib/CodeGen/SelectionDAG/LegalizeTypesExpand.cpp b/release_23/lib/CodeGen/SelectionDAG/LegalizeTypesExpand.cpp
deleted file mode 100644
index a07ef782cdbc..000000000000
--- a/release_23/lib/CodeGen/SelectionDAG/LegalizeTypesExpand.cpp
+++ /dev/null
@@ -1,1466 +0,0 @@
-//===-- LegalizeTypesExpand.cpp - Expansion for LegalizeTypes -------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements expansion support for LegalizeTypes. Expansion is the
-// act of changing a computation in an invalid type to be a computation in
-// multiple registers of a smaller type. For example, implementing i64
-// arithmetic in two i32 registers (as is often needed on 32-bit targets, for
-// example).
-//
-//===----------------------------------------------------------------------===//
-
-#include "LegalizeTypes.h"
-#include "llvm/Constants.h"
-using namespace llvm;
-
-//===----------------------------------------------------------------------===//
-// Result Expansion
-//===----------------------------------------------------------------------===//
-
-/// ExpandResult - This method is called when the specified result of the
-/// specified node is found to need expansion. At this point, the node may also
-/// have invalid operands or may have other results that need promotion, we just
-/// know that (at least) one result needs expansion.
-void DAGTypeLegalizer::ExpandResult(SDNode *N, unsigned ResNo) {
- DEBUG(cerr << "Expand node result: "; N->dump(&DAG); cerr << "\n");
- SDOperand Lo, Hi;
- Lo = Hi = SDOperand();
-
- // See if the target wants to custom expand this node.
- if (TLI.getOperationAction(N->getOpcode(), N->getValueType(0)) ==
- TargetLowering::Custom) {
- // If the target wants to, allow it to lower this itself.
- if (SDNode *P = TLI.ExpandOperationResult(N, DAG)) {
- // Everything that once used N now uses P. We are guaranteed that the
- // result value types of N and the result value types of P match.
- ReplaceNodeWith(N, P);
- return;
- }
- }
-
- switch (N->getOpcode()) {
- default:
-#ifndef NDEBUG
- cerr << "ExpandResult #" << ResNo << ": ";
- N->dump(&DAG); cerr << "\n";
-#endif
- assert(0 && "Do not know how to expand the result of this operator!");
- abort();
-
- case ISD::UNDEF: ExpandResult_UNDEF(N, Lo, Hi); break;
- case ISD::Constant: ExpandResult_Constant(N, Lo, Hi); break;
- case ISD::BUILD_PAIR: ExpandResult_BUILD_PAIR(N, Lo, Hi); break;
- case ISD::MERGE_VALUES: ExpandResult_MERGE_VALUES(N, Lo, Hi); break;
- case ISD::ANY_EXTEND: ExpandResult_ANY_EXTEND(N, Lo, Hi); break;
- case ISD::ZERO_EXTEND: ExpandResult_ZERO_EXTEND(N, Lo, Hi); break;
- case ISD::SIGN_EXTEND: ExpandResult_SIGN_EXTEND(N, Lo, Hi); break;
- case ISD::AssertZext: ExpandResult_AssertZext(N, Lo, Hi); break;
- case ISD::TRUNCATE: ExpandResult_TRUNCATE(N, Lo, Hi); break;
- case ISD::BIT_CONVERT: ExpandResult_BIT_CONVERT(N, Lo, Hi); break;
- case ISD::SIGN_EXTEND_INREG: ExpandResult_SIGN_EXTEND_INREG(N, Lo, Hi); break;
- case ISD::FP_TO_SINT: ExpandResult_FP_TO_SINT(N, Lo, Hi); break;
- case ISD::FP_TO_UINT: ExpandResult_FP_TO_UINT(N, Lo, Hi); break;
- case ISD::LOAD: ExpandResult_LOAD(cast<LoadSDNode>(N), Lo, Hi); break;
-
- case ISD::AND:
- case ISD::OR:
- case ISD::XOR: ExpandResult_Logical(N, Lo, Hi); break;
- case ISD::BSWAP: ExpandResult_BSWAP(N, Lo, Hi); break;
- case ISD::ADD:
- case ISD::SUB: ExpandResult_ADDSUB(N, Lo, Hi); break;
- case ISD::ADDC:
- case ISD::SUBC: ExpandResult_ADDSUBC(N, Lo, Hi); break;
- case ISD::ADDE:
- case ISD::SUBE: ExpandResult_ADDSUBE(N, Lo, Hi); break;
- case ISD::SELECT: ExpandResult_SELECT(N, Lo, Hi); break;
- case ISD::SELECT_CC: ExpandResult_SELECT_CC(N, Lo, Hi); break;
- case ISD::MUL: ExpandResult_MUL(N, Lo, Hi); break;
- case ISD::SDIV: ExpandResult_SDIV(N, Lo, Hi); break;
- case ISD::SREM: ExpandResult_SREM(N, Lo, Hi); break;
- case ISD::UDIV: ExpandResult_UDIV(N, Lo, Hi); break;
- case ISD::UREM: ExpandResult_UREM(N, Lo, Hi); break;
- case ISD::SHL:
- case ISD::SRA:
- case ISD::SRL: ExpandResult_Shift(N, Lo, Hi); break;
-
- case ISD::CTLZ: ExpandResult_CTLZ(N, Lo, Hi); break;
- case ISD::CTPOP: ExpandResult_CTPOP(N, Lo, Hi); break;
- case ISD::CTTZ: ExpandResult_CTTZ(N, Lo, Hi); break;
-
- case ISD::EXTRACT_VECTOR_ELT:
- ExpandResult_EXTRACT_VECTOR_ELT(N, Lo, Hi);
- break;
- }
-
- // If Lo/Hi is null, the sub-method took care of registering results etc.
- if (Lo.Val)
- SetExpandedOp(SDOperand(N, ResNo), Lo, Hi);
-}
-
-void DAGTypeLegalizer::ExpandResult_UNDEF(SDNode *N,
- SDOperand &Lo, SDOperand &Hi) {
- MVT::ValueType NVT = TLI.getTypeToTransformTo(N->getValueType(0));
- Lo = Hi = DAG.getNode(ISD::UNDEF, NVT);
-}
-
-void DAGTypeLegalizer::ExpandResult_Constant(SDNode *N,
- SDOperand &Lo, SDOperand &Hi) {
- MVT::ValueType NVT = TLI.getTypeToTransformTo(N->getValueType(0));
- unsigned NBitWidth = MVT::getSizeInBits(NVT);
- const APInt &Cst = cast<ConstantSDNode>(N)->getAPIntValue();
- Lo = DAG.getConstant(APInt(Cst).trunc(NBitWidth), NVT);
- Hi = DAG.getConstant(Cst.lshr(NBitWidth).trunc(NBitWidth), NVT);
-}
-
-void DAGTypeLegalizer::ExpandResult_BUILD_PAIR(SDNode *N,
- SDOperand &Lo, SDOperand &Hi) {
- // Return the operands.
- Lo = N->getOperand(0);
- Hi = N->getOperand(1);
-}
-
-void DAGTypeLegalizer::ExpandResult_MERGE_VALUES(SDNode *N,
- SDOperand &Lo, SDOperand &Hi) {
- // A MERGE_VALUES node can produce any number of values. We know that the
- // first illegal one needs to be expanded into Lo/Hi.
- unsigned i;
-
- // The string of legal results gets turns into the input operands, which have
- // the same type.
- for (i = 0; isTypeLegal(N->getValueType(i)); ++i)
- ReplaceValueWith(SDOperand(N, i), SDOperand(N->getOperand(i)));
-
- // The first illegal result must be the one that needs to be expanded.
- GetExpandedOp(N->getOperand(i), Lo, Hi);
-
- // Legalize the rest of the results into the input operands whether they are
- // legal or not.
- unsigned e = N->getNumValues();
- for (++i; i != e; ++i)
- ReplaceValueWith(SDOperand(N, i), SDOperand(N->getOperand(i)));
-}
-
-void DAGTypeLegalizer::ExpandResult_ANY_EXTEND(SDNode *N,
- SDOperand &Lo, SDOperand &Hi) {
- MVT::ValueType NVT = TLI.getTypeToTransformTo(N->getValueType(0));
- SDOperand Op = N->getOperand(0);
- if (MVT::getSizeInBits(Op.getValueType()) <= MVT::getSizeInBits(NVT)) {
- // The low part is any extension of the input (which degenerates to a copy).
- Lo = DAG.getNode(ISD::ANY_EXTEND, NVT, Op);
- Hi = DAG.getNode(ISD::UNDEF, NVT); // The high part is undefined.
- } else {
- // For example, extension of an i48 to an i64. The operand type necessarily
- // promotes to the result type, so will end up being expanded too.
- assert(getTypeAction(Op.getValueType()) == Promote &&
- "Only know how to promote this result!");
- SDOperand Res = GetPromotedOp(Op);
- assert(Res.getValueType() == N->getValueType(0) &&
- "Operand over promoted?");
- // Split the promoted operand. This will simplify when it is expanded.
- SplitInteger(Res, Lo, Hi);
- }
-}
-
-void DAGTypeLegalizer::ExpandResult_ZERO_EXTEND(SDNode *N,
- SDOperand &Lo, SDOperand &Hi) {
- MVT::ValueType NVT = TLI.getTypeToTransformTo(N->getValueType(0));
- SDOperand Op = N->getOperand(0);
- if (MVT::getSizeInBits(Op.getValueType()) <= MVT::getSizeInBits(NVT)) {
- // The low part is zero extension of the input (which degenerates to a copy).
- Lo = DAG.getNode(ISD::ZERO_EXTEND, NVT, N->getOperand(0));
- Hi = DAG.getConstant(0, NVT); // The high part is just a zero.
- } else {
- // For example, extension of an i48 to an i64. The operand type necessarily
- // promotes to the result type, so will end up being expanded too.
- assert(getTypeAction(Op.getValueType()) == Promote &&
- "Only know how to promote this result!");
- SDOperand Res = GetPromotedOp(Op);
- assert(Res.getValueType() == N->getValueType(0) &&
- "Operand over promoted?");
- // Split the promoted operand. This will simplify when it is expanded.
- SplitInteger(Res, Lo, Hi);
- unsigned ExcessBits =
- MVT::getSizeInBits(Op.getValueType()) - MVT::getSizeInBits(NVT);
- Hi = DAG.getZeroExtendInReg(Hi, MVT::getIntegerType(ExcessBits));
- }
-}
-
-void DAGTypeLegalizer::ExpandResult_SIGN_EXTEND(SDNode *N,
- SDOperand &Lo, SDOperand &Hi) {
- MVT::ValueType NVT = TLI.getTypeToTransformTo(N->getValueType(0));
- SDOperand Op = N->getOperand(0);
- if (MVT::getSizeInBits(Op.getValueType()) <= MVT::getSizeInBits(NVT)) {
- // The low part is sign extension of the input (which degenerates to a copy).
- Lo = DAG.getNode(ISD::SIGN_EXTEND, NVT, N->getOperand(0));
- // The high part is obtained by SRA'ing all but one of the bits of low part.
- unsigned LoSize = MVT::getSizeInBits(NVT);
- Hi = DAG.getNode(ISD::SRA, NVT, Lo,
- DAG.getConstant(LoSize-1, TLI.getShiftAmountTy()));
- } else {
- // For example, extension of an i48 to an i64. The operand type necessarily
- // promotes to the result type, so will end up being expanded too.
- assert(getTypeAction(Op.getValueType()) == Promote &&
- "Only know how to promote this result!");
- SDOperand Res = GetPromotedOp(Op);
- assert(Res.getValueType() == N->getValueType(0) &&
- "Operand over promoted?");
- // Split the promoted operand. This will simplify when it is expanded.
- SplitInteger(Res, Lo, Hi);
- unsigned ExcessBits =
- MVT::getSizeInBits(Op.getValueType()) - MVT::getSizeInBits(NVT);
- Hi = DAG.getNode(ISD::SIGN_EXTEND_INREG, Hi.getValueType(), Hi,
- DAG.getValueType(MVT::getIntegerType(ExcessBits)));
- }
-}
-
-void DAGTypeLegalizer::ExpandResult_AssertZext(SDNode *N,
- SDOperand &Lo, SDOperand &Hi) {
- GetExpandedOp(N->getOperand(0), Lo, Hi);
- MVT::ValueType NVT = Lo.getValueType();
- MVT::ValueType EVT = cast<VTSDNode>(N->getOperand(1))->getVT();
- unsigned NVTBits = MVT::getSizeInBits(NVT);
- unsigned EVTBits = MVT::getSizeInBits(EVT);
-
- if (NVTBits < EVTBits) {
- Hi = DAG.getNode(ISD::AssertZext, NVT, Hi,
- DAG.getValueType(MVT::getIntegerType(EVTBits - NVTBits)));
- } else {
- Lo = DAG.getNode(ISD::AssertZext, NVT, Lo, DAG.getValueType(EVT));
- // The high part must be zero, make it explicit.
- Hi = DAG.getConstant(0, NVT);
- }
-}
-
-void DAGTypeLegalizer::ExpandResult_TRUNCATE(SDNode *N,
- SDOperand &Lo, SDOperand &Hi) {
- MVT::ValueType NVT = TLI.getTypeToTransformTo(N->getValueType(0));
- Lo = DAG.getNode(ISD::TRUNCATE, NVT, N->getOperand(0));
- Hi = DAG.getNode(ISD::SRL, N->getOperand(0).getValueType(), N->getOperand(0),
- DAG.getConstant(MVT::getSizeInBits(NVT),
- TLI.getShiftAmountTy()));
- Hi = DAG.getNode(ISD::TRUNCATE, NVT, Hi);
-}
-
-void DAGTypeLegalizer::ExpandResult_BIT_CONVERT(SDNode *N,
- SDOperand &Lo, SDOperand &Hi) {
- MVT::ValueType NVT = TLI.getTypeToTransformTo(N->getValueType(0));
- SDOperand InOp = N->getOperand(0);
- MVT::ValueType InVT = InOp.getValueType();
-
- // Handle some special cases efficiently.
- switch (getTypeAction(InVT)) {
- default:
- assert(false && "Unknown type action!");
- case Legal:
- case Promote:
- break;
- case Expand:
- // Convert the expanded pieces of the input.
- GetExpandedOp(InOp, Lo, Hi);
- Lo = DAG.getNode(ISD::BIT_CONVERT, NVT, Lo);
- Hi = DAG.getNode(ISD::BIT_CONVERT, NVT, Hi);
- return;
- case FloatToInt:
- // Convert the integer operand instead.
- SplitInteger(GetIntegerOp(InOp), Lo, Hi);
- Lo = DAG.getNode(ISD::BIT_CONVERT, NVT, Lo);
- Hi = DAG.getNode(ISD::BIT_CONVERT, NVT, Hi);
- return;
- case Split:
- // Convert the split parts of the input if it was split in two.
- GetSplitOp(InOp, Lo, Hi);
- if (Lo.getValueType() == Hi.getValueType()) {
- if (TLI.isBigEndian())
- std::swap(Lo, Hi);
- Lo = DAG.getNode(ISD::BIT_CONVERT, NVT, Lo);
- Hi = DAG.getNode(ISD::BIT_CONVERT, NVT, Hi);
- return;
- }
- break;
- case Scalarize:
- // Convert the element instead.
- SplitInteger(BitConvertToInteger(GetScalarizedOp(InOp)), Lo, Hi);
- Lo = DAG.getNode(ISD::BIT_CONVERT, NVT, Lo);
- Hi = DAG.getNode(ISD::BIT_CONVERT, NVT, Hi);
- return;
- }
-
- // Lower the bit-convert to a store/load from the stack, then expand the load.
- SDOperand Op = CreateStackStoreLoad(InOp, N->getValueType(0));
- ExpandResult_LOAD(cast<LoadSDNode>(Op.Val), Lo, Hi);
-}
-
-void DAGTypeLegalizer::
-ExpandResult_SIGN_EXTEND_INREG(SDNode *N, SDOperand &Lo, SDOperand &Hi) {
- GetExpandedOp(N->getOperand(0), Lo, Hi);
- MVT::ValueType EVT = cast<VTSDNode>(N->getOperand(1))->getVT();
-
- if (MVT::getSizeInBits(EVT) <= MVT::getSizeInBits(Lo.getValueType())) {
- // sext_inreg the low part if needed.
- Lo = DAG.getNode(ISD::SIGN_EXTEND_INREG, Lo.getValueType(), Lo,
- N->getOperand(1));
-
- // The high part gets the sign extension from the lo-part. This handles
- // things like sextinreg V:i64 from i8.
- Hi = DAG.getNode(ISD::SRA, Hi.getValueType(), Lo,
- DAG.getConstant(MVT::getSizeInBits(Hi.getValueType())-1,
- TLI.getShiftAmountTy()));
- } else {
- // For example, extension of an i48 to an i64. Leave the low part alone,
- // sext_inreg the high part.
- unsigned ExcessBits =
- MVT::getSizeInBits(EVT) - MVT::getSizeInBits(Lo.getValueType());
- Hi = DAG.getNode(ISD::SIGN_EXTEND_INREG, Hi.getValueType(), Hi,
- DAG.getValueType(MVT::getIntegerType(ExcessBits)));
- }
-}
-
-void DAGTypeLegalizer::ExpandResult_FP_TO_SINT(SDNode *N, SDOperand &Lo,
- SDOperand &Hi) {
- MVT::ValueType VT = N->getValueType(0);
- SDOperand Op = N->getOperand(0);
- RTLIB::Libcall LC = RTLIB::UNKNOWN_LIBCALL;
- if (VT == MVT::i64) {
- if (Op.getValueType() == MVT::f32)
- LC = RTLIB::FPTOSINT_F32_I64;
- else if (Op.getValueType() == MVT::f64)
- LC = RTLIB::FPTOSINT_F64_I64;
- else if (Op.getValueType() == MVT::f80)
- LC = RTLIB::FPTOSINT_F80_I64;
- else if (Op.getValueType() == MVT::ppcf128)
- LC = RTLIB::FPTOSINT_PPCF128_I64;
- } else if (VT == MVT::i128) {
- if (Op.getValueType() == MVT::f32)
- LC = RTLIB::FPTOSINT_F32_I128;
- else if (Op.getValueType() == MVT::f64)
- LC = RTLIB::FPTOSINT_F64_I128;
- else if (Op.getValueType() == MVT::f80)
- LC = RTLIB::FPTOSINT_F80_I128;
- else if (Op.getValueType() == MVT::ppcf128)
- LC = RTLIB::FPTOSINT_PPCF128_I128;
- } else {
- assert(0 && "Unexpected fp-to-sint conversion!");
- }
- SplitInteger(MakeLibCall(LC, VT, &Op, 1, true/*sign irrelevant*/), Lo, Hi);
-}
-
-void DAGTypeLegalizer::ExpandResult_FP_TO_UINT(SDNode *N, SDOperand &Lo,
- SDOperand &Hi) {
- MVT::ValueType VT = N->getValueType(0);
- SDOperand Op = N->getOperand(0);
- RTLIB::Libcall LC = RTLIB::UNKNOWN_LIBCALL;
- if (VT == MVT::i64) {
- if (Op.getValueType() == MVT::f32)
- LC = RTLIB::FPTOUINT_F32_I64;
- else if (Op.getValueType() == MVT::f64)
- LC = RTLIB::FPTOUINT_F64_I64;
- else if (Op.getValueType() == MVT::f80)
- LC = RTLIB::FPTOUINT_F80_I64;
- else if (Op.getValueType() == MVT::ppcf128)
- LC = RTLIB::FPTOUINT_PPCF128_I64;
- } else if (VT == MVT::i128) {
- if (Op.getValueType() == MVT::f32)
- LC = RTLIB::FPTOUINT_F32_I128;
- else if (Op.getValueType() == MVT::f64)
- LC = RTLIB::FPTOUINT_F64_I128;
- else if (Op.getValueType() == MVT::f80)
- LC = RTLIB::FPTOUINT_F80_I128;
- else if (Op.getValueType() == MVT::ppcf128)
- LC = RTLIB::FPTOUINT_PPCF128_I128;
- } else {
- assert(0 && "Unexpected fp-to-uint conversion!");
- }
- SplitInteger(MakeLibCall(LC, VT, &Op, 1, false/*sign irrelevant*/), Lo, Hi);
-}
-
-void DAGTypeLegalizer::ExpandResult_LOAD(LoadSDNode *N,
- SDOperand &Lo, SDOperand &Hi) {
- // FIXME: Add support for indexed loads.
- MVT::ValueType VT = N->getValueType(0);
- MVT::ValueType NVT = TLI.getTypeToTransformTo(VT);
- SDOperand Ch = N->getChain(); // Legalize the chain.
- SDOperand Ptr = N->getBasePtr(); // Legalize the pointer.
- ISD::LoadExtType ExtType = N->getExtensionType();
- int SVOffset = N->getSrcValueOffset();
- unsigned Alignment = N->getAlignment();
- bool isVolatile = N->isVolatile();
-
- assert(!(MVT::getSizeInBits(NVT) & 7) && "Expanded type not byte sized!");
-
- if (ExtType == ISD::NON_EXTLOAD) {
- Lo = DAG.getLoad(NVT, Ch, Ptr, N->getSrcValue(), SVOffset,
- isVolatile, Alignment);
- // Increment the pointer to the other half.
- unsigned IncrementSize = MVT::getSizeInBits(NVT)/8;
- Ptr = DAG.getNode(ISD::ADD, Ptr.getValueType(), Ptr,
- DAG.getIntPtrConstant(IncrementSize));
- Hi = DAG.getLoad(NVT, Ch, Ptr, N->getSrcValue(), SVOffset+IncrementSize,
- isVolatile, MinAlign(Alignment, IncrementSize));
-
- // Build a factor node to remember that this load is independent of the
- // other one.
- Ch = DAG.getNode(ISD::TokenFactor, MVT::Other, Lo.getValue(1),
- Hi.getValue(1));
-
- // Handle endianness of the load.
- if (TLI.isBigEndian())
- std::swap(Lo, Hi);
- } else if (MVT::getSizeInBits(N->getMemoryVT()) <= MVT::getSizeInBits(NVT)) {
- MVT::ValueType EVT = N->getMemoryVT();
-
- Lo = DAG.getExtLoad(ExtType, NVT, Ch, Ptr, N->getSrcValue(), SVOffset, EVT,
- isVolatile, Alignment);
-
- // Remember the chain.
- Ch = Lo.getValue(1);
-
- if (ExtType == ISD::SEXTLOAD) {
- // The high part is obtained by SRA'ing all but one of the bits of the
- // lo part.
- unsigned LoSize = MVT::getSizeInBits(Lo.getValueType());
- Hi = DAG.getNode(ISD::SRA, NVT, Lo,
- DAG.getConstant(LoSize-1, TLI.getShiftAmountTy()));
- } else if (ExtType == ISD::ZEXTLOAD) {
- // The high part is just a zero.
- Hi = DAG.getConstant(0, NVT);
- } else {
- assert(ExtType == ISD::EXTLOAD && "Unknown extload!");
- // The high part is undefined.
- Hi = DAG.getNode(ISD::UNDEF, NVT);
- }
- } else if (TLI.isLittleEndian()) {
- // Little-endian - low bits are at low addresses.
- Lo = DAG.getLoad(NVT, Ch, Ptr, N->getSrcValue(), SVOffset,
- isVolatile, Alignment);
-
- unsigned ExcessBits =
- MVT::getSizeInBits(N->getMemoryVT()) - MVT::getSizeInBits(NVT);
- MVT::ValueType NEVT = MVT::getIntegerType(ExcessBits);
-
- // Increment the pointer to the other half.
- unsigned IncrementSize = MVT::getSizeInBits(NVT)/8;
- Ptr = DAG.getNode(ISD::ADD, Ptr.getValueType(), Ptr,
- DAG.getIntPtrConstant(IncrementSize));
- Hi = DAG.getExtLoad(ExtType, NVT, Ch, Ptr, N->getSrcValue(),
- SVOffset+IncrementSize, NEVT,
- isVolatile, MinAlign(Alignment, IncrementSize));
-
- // Build a factor node to remember that this load is independent of the
- // other one.
- Ch = DAG.getNode(ISD::TokenFactor, MVT::Other, Lo.getValue(1),
- Hi.getValue(1));
- } else {
- // Big-endian - high bits are at low addresses. Favor aligned loads at
- // the cost of some bit-fiddling.
- MVT::ValueType EVT = N->getMemoryVT();
- unsigned EBytes = MVT::getStoreSizeInBits(EVT)/8;
- unsigned IncrementSize = MVT::getSizeInBits(NVT)/8;
- unsigned ExcessBits = (EBytes - IncrementSize)*8;
-
- // Load both the high bits and maybe some of the low bits.
- Hi = DAG.getExtLoad(ExtType, NVT, Ch, Ptr, N->getSrcValue(), SVOffset,
- MVT::getIntegerType(MVT::getSizeInBits(EVT)-ExcessBits),
- isVolatile, Alignment);
-
- // Increment the pointer to the other half.
- Ptr = DAG.getNode(ISD::ADD, Ptr.getValueType(), Ptr,
- DAG.getIntPtrConstant(IncrementSize));
- // Load the rest of the low bits.
- Lo = DAG.getExtLoad(ISD::ZEXTLOAD, NVT, Ch, Ptr, N->getSrcValue(),
- SVOffset+IncrementSize, MVT::getIntegerType(ExcessBits),
- isVolatile, MinAlign(Alignment, IncrementSize));
-
- // Build a factor node to remember that this load is independent of the
- // other one.
- Ch = DAG.getNode(ISD::TokenFactor, MVT::Other, Lo.getValue(1),
- Hi.getValue(1));
-
- if (ExcessBits < MVT::getSizeInBits(NVT)) {
- // Transfer low bits from the bottom of Hi to the top of Lo.
- Lo = DAG.getNode(ISD::OR, NVT, Lo,
- DAG.getNode(ISD::SHL, NVT, Hi,
- DAG.getConstant(ExcessBits,
- TLI.getShiftAmountTy())));
- // Move high bits to the right position in Hi.
- Hi = DAG.getNode(ExtType == ISD::SEXTLOAD ? ISD::SRA : ISD::SRL, NVT, Hi,
- DAG.getConstant(MVT::getSizeInBits(NVT) - ExcessBits,
- TLI.getShiftAmountTy()));
- }
- }
-
- // Legalized the chain result - switch anything that used the old chain to
- // use the new one.
- ReplaceValueWith(SDOperand(N, 1), Ch);
-}
-
-void DAGTypeLegalizer::ExpandResult_Logical(SDNode *N,
- SDOperand &Lo, SDOperand &Hi) {
- SDOperand LL, LH, RL, RH;
- GetExpandedOp(N->getOperand(0), LL, LH);
- GetExpandedOp(N->getOperand(1), RL, RH);
- Lo = DAG.getNode(N->getOpcode(), LL.getValueType(), LL, RL);
- Hi = DAG.getNode(N->getOpcode(), LL.getValueType(), LH, RH);
-}
-
-void DAGTypeLegalizer::ExpandResult_BSWAP(SDNode *N,
- SDOperand &Lo, SDOperand &Hi) {
- GetExpandedOp(N->getOperand(0), Hi, Lo); // Note swapped operands.
- Lo = DAG.getNode(ISD::BSWAP, Lo.getValueType(), Lo);
- Hi = DAG.getNode(ISD::BSWAP, Hi.getValueType(), Hi);
-}
-
-void DAGTypeLegalizer::ExpandResult_SELECT(SDNode *N,
- SDOperand &Lo, SDOperand &Hi) {
- SDOperand LL, LH, RL, RH;
- GetExpandedOp(N->getOperand(1), LL, LH);
- GetExpandedOp(N->getOperand(2), RL, RH);
- Lo = DAG.getNode(ISD::SELECT, LL.getValueType(), N->getOperand(0), LL, RL);
- Hi = DAG.getNode(ISD::SELECT, LL.getValueType(), N->getOperand(0), LH, RH);
-}
-
-void DAGTypeLegalizer::ExpandResult_SELECT_CC(SDNode *N,
- SDOperand &Lo, SDOperand &Hi) {
- SDOperand LL, LH, RL, RH;
- GetExpandedOp(N->getOperand(2), LL, LH);
- GetExpandedOp(N->getOperand(3), RL, RH);
- Lo = DAG.getNode(ISD::SELECT_CC, LL.getValueType(), N->getOperand(0),
- N->getOperand(1), LL, RL, N->getOperand(4));
- Hi = DAG.getNode(ISD::SELECT_CC, LL.getValueType(), N->getOperand(0),
- N->getOperand(1), LH, RH, N->getOperand(4));
-}
-
-void DAGTypeLegalizer::ExpandResult_ADDSUB(SDNode *N,
- SDOperand &Lo, SDOperand &Hi) {
- // Expand the subcomponents.
- SDOperand LHSL, LHSH, RHSL, RHSH;
- GetExpandedOp(N->getOperand(0), LHSL, LHSH);
- GetExpandedOp(N->getOperand(1), RHSL, RHSH);
- SDVTList VTList = DAG.getVTList(LHSL.getValueType(), MVT::Flag);
- SDOperand LoOps[2] = { LHSL, RHSL };
- SDOperand HiOps[3] = { LHSH, RHSH };
-
- if (N->getOpcode() == ISD::ADD) {
- Lo = DAG.getNode(ISD::ADDC, VTList, LoOps, 2);
- HiOps[2] = Lo.getValue(1);
- Hi = DAG.getNode(ISD::ADDE, VTList, HiOps, 3);
- } else {
- Lo = DAG.getNode(ISD::SUBC, VTList, LoOps, 2);
- HiOps[2] = Lo.getValue(1);
- Hi = DAG.getNode(ISD::SUBE, VTList, HiOps, 3);
- }
-}
-
-void DAGTypeLegalizer::ExpandResult_ADDSUBC(SDNode *N,
- SDOperand &Lo, SDOperand &Hi) {
- // Expand the subcomponents.
- SDOperand LHSL, LHSH, RHSL, RHSH;
- GetExpandedOp(N->getOperand(0), LHSL, LHSH);
- GetExpandedOp(N->getOperand(1), RHSL, RHSH);
- SDVTList VTList = DAG.getVTList(LHSL.getValueType(), MVT::Flag);
- SDOperand LoOps[2] = { LHSL, RHSL };
- SDOperand HiOps[3] = { LHSH, RHSH };
-
- if (N->getOpcode() == ISD::ADDC) {
- Lo = DAG.getNode(ISD::ADDC, VTList, LoOps, 2);
- HiOps[2] = Lo.getValue(1);
- Hi = DAG.getNode(ISD::ADDE, VTList, HiOps, 3);
- } else {
- Lo = DAG.getNode(ISD::SUBC, VTList, LoOps, 2);
- HiOps[2] = Lo.getValue(1);
- Hi = DAG.getNode(ISD::SUBE, VTList, HiOps, 3);
- }
-
- // Legalized the flag result - switch anything that used the old flag to
- // use the new one.
- ReplaceValueWith(SDOperand(N, 1), Hi.getValue(1));
-}
-
-void DAGTypeLegalizer::ExpandResult_ADDSUBE(SDNode *N,
- SDOperand &Lo, SDOperand &Hi) {
- // Expand the subcomponents.
- SDOperand LHSL, LHSH, RHSL, RHSH;
- GetExpandedOp(N->getOperand(0), LHSL, LHSH);
- GetExpandedOp(N->getOperand(1), RHSL, RHSH);
- SDVTList VTList = DAG.getVTList(LHSL.getValueType(), MVT::Flag);
- SDOperand LoOps[3] = { LHSL, RHSL, N->getOperand(2) };
- SDOperand HiOps[3] = { LHSH, RHSH };
-
- Lo = DAG.getNode(N->getOpcode(), VTList, LoOps, 3);
- HiOps[2] = Lo.getValue(1);
- Hi = DAG.getNode(N->getOpcode(), VTList, HiOps, 3);
-
- // Legalized the flag result - switch anything that used the old flag to
- // use the new one.
- ReplaceValueWith(SDOperand(N, 1), Hi.getValue(1));
-}
-
-void DAGTypeLegalizer::ExpandResult_MUL(SDNode *N,
- SDOperand &Lo, SDOperand &Hi) {
- MVT::ValueType VT = N->getValueType(0);
- MVT::ValueType NVT = TLI.getTypeToTransformTo(VT);
-
- bool HasMULHS = TLI.isOperationLegal(ISD::MULHS, NVT);
- bool HasMULHU = TLI.isOperationLegal(ISD::MULHU, NVT);
- bool HasSMUL_LOHI = TLI.isOperationLegal(ISD::SMUL_LOHI, NVT);
- bool HasUMUL_LOHI = TLI.isOperationLegal(ISD::UMUL_LOHI, NVT);
- if (HasMULHU || HasMULHS || HasUMUL_LOHI || HasSMUL_LOHI) {
- SDOperand LL, LH, RL, RH;
- GetExpandedOp(N->getOperand(0), LL, LH);
- GetExpandedOp(N->getOperand(1), RL, RH);
- unsigned OuterBitSize = MVT::getSizeInBits(VT);
- unsigned BitSize = MVT::getSizeInBits(NVT);
- unsigned LHSSB = DAG.ComputeNumSignBits(N->getOperand(0));
- unsigned RHSSB = DAG.ComputeNumSignBits(N->getOperand(1));
-
- if (DAG.MaskedValueIsZero(N->getOperand(0),
- APInt::getHighBitsSet(OuterBitSize, LHSSB)) &&
- DAG.MaskedValueIsZero(N->getOperand(1),
- APInt::getHighBitsSet(OuterBitSize, RHSSB))) {
- // The inputs are both zero-extended.
- if (HasUMUL_LOHI) {
- // We can emit a umul_lohi.
- Lo = DAG.getNode(ISD::UMUL_LOHI, DAG.getVTList(NVT, NVT), LL, RL);
- Hi = SDOperand(Lo.Val, 1);
- return;
- }
- if (HasMULHU) {
- // We can emit a mulhu+mul.
- Lo = DAG.getNode(ISD::MUL, NVT, LL, RL);
- Hi = DAG.getNode(ISD::MULHU, NVT, LL, RL);
- return;
- }
- }
- if (LHSSB > BitSize && RHSSB > BitSize) {
- // The input values are both sign-extended.
- if (HasSMUL_LOHI) {
- // We can emit a smul_lohi.
- Lo = DAG.getNode(ISD::SMUL_LOHI, DAG.getVTList(NVT, NVT), LL, RL);
- Hi = SDOperand(Lo.Val, 1);
- return;
- }
- if (HasMULHS) {
- // We can emit a mulhs+mul.
- Lo = DAG.getNode(ISD::MUL, NVT, LL, RL);
- Hi = DAG.getNode(ISD::MULHS, NVT, LL, RL);
- return;
- }
- }
- if (HasUMUL_LOHI) {
- // Lo,Hi = umul LHS, RHS.
- SDOperand UMulLOHI = DAG.getNode(ISD::UMUL_LOHI,
- DAG.getVTList(NVT, NVT), LL, RL);
- Lo = UMulLOHI;
- Hi = UMulLOHI.getValue(1);
- RH = DAG.getNode(ISD::MUL, NVT, LL, RH);
- LH = DAG.getNode(ISD::MUL, NVT, LH, RL);
- Hi = DAG.getNode(ISD::ADD, NVT, Hi, RH);
- Hi = DAG.getNode(ISD::ADD, NVT, Hi, LH);
- return;
- }
- }
-
- // If nothing else, we can make a libcall.
- SDOperand Ops[2] = { N->getOperand(0), N->getOperand(1) };
- SplitInteger(MakeLibCall(RTLIB::MUL_I64, VT, Ops, 2, true/*sign irrelevant*/),
- Lo, Hi);
-}
-
-void DAGTypeLegalizer::ExpandResult_SDIV(SDNode *N,
- SDOperand &Lo, SDOperand &Hi) {
- assert(N->getValueType(0) == MVT::i64 && "Unsupported sdiv!");
- SDOperand Ops[2] = { N->getOperand(0), N->getOperand(1) };
- SplitInteger(MakeLibCall(RTLIB::SDIV_I64, N->getValueType(0), Ops, 2, true),
- Lo, Hi);
-}
-
-void DAGTypeLegalizer::ExpandResult_SREM(SDNode *N,
- SDOperand &Lo, SDOperand &Hi) {
- assert(N->getValueType(0) == MVT::i64 && "Unsupported srem!");
- SDOperand Ops[2] = { N->getOperand(0), N->getOperand(1) };
- SplitInteger(MakeLibCall(RTLIB::SREM_I64, N->getValueType(0), Ops, 2, true),
- Lo, Hi);
-}
-
-void DAGTypeLegalizer::ExpandResult_UDIV(SDNode *N,
- SDOperand &Lo, SDOperand &Hi) {
- assert(N->getValueType(0) == MVT::i64 && "Unsupported udiv!");
- SDOperand Ops[2] = { N->getOperand(0), N->getOperand(1) };
- SplitInteger(MakeLibCall(RTLIB::UDIV_I64, N->getValueType(0), Ops, 2, false),
- Lo, Hi);
-}
-
-void DAGTypeLegalizer::ExpandResult_UREM(SDNode *N,
- SDOperand &Lo, SDOperand &Hi) {
- assert(N->getValueType(0) == MVT::i64 && "Unsupported urem!");
- SDOperand Ops[2] = { N->getOperand(0), N->getOperand(1) };
- SplitInteger(MakeLibCall(RTLIB::UREM_I64, N->getValueType(0), Ops, 2, false),
- Lo, Hi);
-}
-
-void DAGTypeLegalizer::ExpandResult_Shift(SDNode *N,
- SDOperand &Lo, SDOperand &Hi) {
- MVT::ValueType VT = N->getValueType(0);
-
- // If we can emit an efficient shift operation, do so now. Check to see if
- // the RHS is a constant.
- if (ConstantSDNode *CN = dyn_cast<ConstantSDNode>(N->getOperand(1)))
- return ExpandShiftByConstant(N, CN->getValue(), Lo, Hi);
-
- // If we can determine that the high bit of the shift is zero or one, even if
- // the low bits are variable, emit this shift in an optimized form.
- if (ExpandShiftWithKnownAmountBit(N, Lo, Hi))
- return;
-
- // If this target supports shift_PARTS, use it. First, map to the _PARTS opc.
- unsigned PartsOpc;
- if (N->getOpcode() == ISD::SHL) {
- PartsOpc = ISD::SHL_PARTS;
- } else if (N->getOpcode() == ISD::SRL) {
- PartsOpc = ISD::SRL_PARTS;
- } else {
- assert(N->getOpcode() == ISD::SRA && "Unknown shift!");
- PartsOpc = ISD::SRA_PARTS;
- }
-
- // Next check to see if the target supports this SHL_PARTS operation or if it
- // will custom expand it.
- MVT::ValueType NVT = TLI.getTypeToTransformTo(VT);
- TargetLowering::LegalizeAction Action = TLI.getOperationAction(PartsOpc, NVT);
- if ((Action == TargetLowering::Legal && TLI.isTypeLegal(NVT)) ||
- Action == TargetLowering::Custom) {
- // Expand the subcomponents.
- SDOperand LHSL, LHSH;
- GetExpandedOp(N->getOperand(0), LHSL, LHSH);
-
- SDOperand Ops[] = { LHSL, LHSH, N->getOperand(1) };
- MVT::ValueType VT = LHSL.getValueType();
- Lo = DAG.getNode(PartsOpc, DAG.getNodeValueTypes(VT, VT), 2, Ops, 3);
- Hi = Lo.getValue(1);
- return;
- }
-
- // Otherwise, emit a libcall.
- assert(VT == MVT::i64 && "Unsupported shift!");
-
- RTLIB::Libcall LC;
- bool isSigned;
- if (N->getOpcode() == ISD::SHL) {
- LC = RTLIB::SHL_I64;
- isSigned = false; /*sign irrelevant*/
- } else if (N->getOpcode() == ISD::SRL) {
- LC = RTLIB::SRL_I64;
- isSigned = false;
- } else {
- assert(N->getOpcode() == ISD::SRA && "Unknown shift!");
- LC = RTLIB::SRA_I64;
- isSigned = true;
- }
-
- SDOperand Ops[2] = { N->getOperand(0), N->getOperand(1) };
- SplitInteger(MakeLibCall(LC, VT, Ops, 2, isSigned), Lo, Hi);
-}
-
-void DAGTypeLegalizer::ExpandResult_CTLZ(SDNode *N,
- SDOperand &Lo, SDOperand &Hi) {
- // ctlz (HiLo) -> Hi != 0 ? ctlz(Hi) : (ctlz(Lo)+32)
- GetExpandedOp(N->getOperand(0), Lo, Hi);
- MVT::ValueType NVT = Lo.getValueType();
-
- SDOperand HiNotZero = DAG.getSetCC(TLI.getSetCCResultType(Hi), Hi,
- DAG.getConstant(0, NVT), ISD::SETNE);
-
- SDOperand LoLZ = DAG.getNode(ISD::CTLZ, NVT, Lo);
- SDOperand HiLZ = DAG.getNode(ISD::CTLZ, NVT, Hi);
-
- Lo = DAG.getNode(ISD::SELECT, NVT, HiNotZero, HiLZ,
- DAG.getNode(ISD::ADD, NVT, LoLZ,
- DAG.getConstant(MVT::getSizeInBits(NVT), NVT)));
- Hi = DAG.getConstant(0, NVT);
-}
-
-void DAGTypeLegalizer::ExpandResult_CTPOP(SDNode *N,
- SDOperand &Lo, SDOperand &Hi) {
- // ctpop(HiLo) -> ctpop(Hi)+ctpop(Lo)
- GetExpandedOp(N->getOperand(0), Lo, Hi);
- MVT::ValueType NVT = Lo.getValueType();
- Lo = DAG.getNode(ISD::ADD, NVT, DAG.getNode(ISD::CTPOP, NVT, Lo),
- DAG.getNode(ISD::CTPOP, NVT, Hi));
- Hi = DAG.getConstant(0, NVT);
-}
-
-void DAGTypeLegalizer::ExpandResult_CTTZ(SDNode *N,
- SDOperand &Lo, SDOperand &Hi) {
- // cttz (HiLo) -> Lo != 0 ? cttz(Lo) : (cttz(Hi)+32)
- GetExpandedOp(N->getOperand(0), Lo, Hi);
- MVT::ValueType NVT = Lo.getValueType();
-
- SDOperand LoNotZero = DAG.getSetCC(TLI.getSetCCResultType(Lo), Lo,
- DAG.getConstant(0, NVT), ISD::SETNE);
-
- SDOperand LoLZ = DAG.getNode(ISD::CTTZ, NVT, Lo);
- SDOperand HiLZ = DAG.getNode(ISD::CTTZ, NVT, Hi);
-
- Lo = DAG.getNode(ISD::SELECT, NVT, LoNotZero, LoLZ,
- DAG.getNode(ISD::ADD, NVT, HiLZ,
- DAG.getConstant(MVT::getSizeInBits(NVT), NVT)));
- Hi = DAG.getConstant(0, NVT);
-}
-
-void DAGTypeLegalizer::ExpandResult_EXTRACT_VECTOR_ELT(SDNode *N,
- SDOperand &Lo,
- SDOperand &Hi) {
- SDOperand OldVec = N->getOperand(0);
- unsigned OldElts = MVT::getVectorNumElements(OldVec.getValueType());
-
- // Convert to a vector of the expanded element type, for example
- // <2 x i64> -> <4 x i32>.
- MVT::ValueType OldVT = N->getValueType(0);
- MVT::ValueType NewVT = TLI.getTypeToTransformTo(OldVT);
- assert(MVT::getSizeInBits(OldVT) == 2 * MVT::getSizeInBits(NewVT) &&
- "Do not know how to handle this expansion!");
-
- SDOperand NewVec = DAG.getNode(ISD::BIT_CONVERT,
- MVT::getVectorType(NewVT, 2 * OldElts),
- OldVec);
-
- // Extract the elements at 2 * Idx and 2 * Idx + 1 from the new vector.
- SDOperand Idx = N->getOperand(1);
-
- // Make sure the type of Idx is big enough to hold the new values.
- if (MVT::getSizeInBits(Idx.getValueType()) <
- MVT::getSizeInBits(TLI.getPointerTy()))
- Idx = DAG.getNode(ISD::ZERO_EXTEND, TLI.getPointerTy(), Idx);
-
- Idx = DAG.getNode(ISD::ADD, Idx.getValueType(), Idx, Idx);
- Lo = DAG.getNode(ISD::EXTRACT_VECTOR_ELT, NewVT, NewVec, Idx);
-
- Idx = DAG.getNode(ISD::ADD, Idx.getValueType(), Idx,
- DAG.getConstant(1, Idx.getValueType()));
- Hi = DAG.getNode(ISD::EXTRACT_VECTOR_ELT, NewVT, NewVec, Idx);
-
- if (TLI.isBigEndian())
- std::swap(Lo, Hi);
-}
-
-/// ExpandShiftByConstant - N is a shift by a value that needs to be expanded,
-/// and the shift amount is a constant 'Amt'. Expand the operation.
-void DAGTypeLegalizer::ExpandShiftByConstant(SDNode *N, unsigned Amt,
- SDOperand &Lo, SDOperand &Hi) {
- // Expand the incoming operand to be shifted, so that we have its parts
- SDOperand InL, InH;
- GetExpandedOp(N->getOperand(0), InL, InH);
-
- MVT::ValueType NVT = InL.getValueType();
- unsigned VTBits = MVT::getSizeInBits(N->getValueType(0));
- unsigned NVTBits = MVT::getSizeInBits(NVT);
- MVT::ValueType ShTy = N->getOperand(1).getValueType();
-
- if (N->getOpcode() == ISD::SHL) {
- if (Amt > VTBits) {
- Lo = Hi = DAG.getConstant(0, NVT);
- } else if (Amt > NVTBits) {
- Lo = DAG.getConstant(0, NVT);
- Hi = DAG.getNode(ISD::SHL, NVT, InL, DAG.getConstant(Amt-NVTBits,ShTy));
- } else if (Amt == NVTBits) {
- Lo = DAG.getConstant(0, NVT);
- Hi = InL;
- } else {
- Lo = DAG.getNode(ISD::SHL, NVT, InL, DAG.getConstant(Amt, ShTy));
- Hi = DAG.getNode(ISD::OR, NVT,
- DAG.getNode(ISD::SHL, NVT, InH,
- DAG.getConstant(Amt, ShTy)),
- DAG.getNode(ISD::SRL, NVT, InL,
- DAG.getConstant(NVTBits-Amt, ShTy)));
- }
- return;
- }
-
- if (N->getOpcode() == ISD::SRL) {
- if (Amt > VTBits) {
- Lo = DAG.getConstant(0, NVT);
- Hi = DAG.getConstant(0, NVT);
- } else if (Amt > NVTBits) {
- Lo = DAG.getNode(ISD::SRL, NVT, InH, DAG.getConstant(Amt-NVTBits,ShTy));
- Hi = DAG.getConstant(0, NVT);
- } else if (Amt == NVTBits) {
- Lo = InH;
- Hi = DAG.getConstant(0, NVT);
- } else {
- Lo = DAG.getNode(ISD::OR, NVT,
- DAG.getNode(ISD::SRL, NVT, InL,
- DAG.getConstant(Amt, ShTy)),
- DAG.getNode(ISD::SHL, NVT, InH,
- DAG.getConstant(NVTBits-Amt, ShTy)));
- Hi = DAG.getNode(ISD::SRL, NVT, InH, DAG.getConstant(Amt, ShTy));
- }
- return;
- }
-
- assert(N->getOpcode() == ISD::SRA && "Unknown shift!");
- if (Amt > VTBits) {
- Hi = Lo = DAG.getNode(ISD::SRA, NVT, InH,
- DAG.getConstant(NVTBits-1, ShTy));
- } else if (Amt > NVTBits) {
- Lo = DAG.getNode(ISD::SRA, NVT, InH,
- DAG.getConstant(Amt-NVTBits, ShTy));
- Hi = DAG.getNode(ISD::SRA, NVT, InH,
- DAG.getConstant(NVTBits-1, ShTy));
- } else if (Amt == NVTBits) {
- Lo = InH;
- Hi = DAG.getNode(ISD::SRA, NVT, InH,
- DAG.getConstant(NVTBits-1, ShTy));
- } else {
- Lo = DAG.getNode(ISD::OR, NVT,
- DAG.getNode(ISD::SRL, NVT, InL,
- DAG.getConstant(Amt, ShTy)),
- DAG.getNode(ISD::SHL, NVT, InH,
- DAG.getConstant(NVTBits-Amt, ShTy)));
- Hi = DAG.getNode(ISD::SRA, NVT, InH, DAG.getConstant(Amt, ShTy));
- }
-}
-
-/// ExpandShiftWithKnownAmountBit - Try to determine whether we can simplify
-/// this shift based on knowledge of the high bit of the shift amount. If we
-/// can tell this, we know that it is >= 32 or < 32, without knowing the actual
-/// shift amount.
-bool DAGTypeLegalizer::
-ExpandShiftWithKnownAmountBit(SDNode *N, SDOperand &Lo, SDOperand &Hi) {
- SDOperand Amt = N->getOperand(1);
- MVT::ValueType NVT = TLI.getTypeToTransformTo(N->getValueType(0));
- MVT::ValueType ShTy = Amt.getValueType();
- MVT::ValueType ShBits = MVT::getSizeInBits(ShTy);
- unsigned NVTBits = MVT::getSizeInBits(NVT);
- assert(isPowerOf2_32(NVTBits) &&
- "Expanded integer type size not a power of two!");
-
- APInt HighBitMask = APInt::getHighBitsSet(ShBits, ShBits - Log2_32(NVTBits));
- APInt KnownZero, KnownOne;
- DAG.ComputeMaskedBits(N->getOperand(1), HighBitMask, KnownZero, KnownOne);
-
- // If we don't know anything about the high bits, exit.
- if (((KnownZero|KnownOne) & HighBitMask) == 0)
- return false;
-
- // Get the incoming operand to be shifted.
- SDOperand InL, InH;
- GetExpandedOp(N->getOperand(0), InL, InH);
-
- // If we know that any of the high bits of the shift amount are one, then we
- // can do this as a couple of simple shifts.
- if (KnownOne.intersects(HighBitMask)) {
- // Mask out the high bit, which we know is set.
- Amt = DAG.getNode(ISD::AND, ShTy, Amt,
- DAG.getConstant(~HighBitMask, ShTy));
-
- switch (N->getOpcode()) {
- default: assert(0 && "Unknown shift");
- case ISD::SHL:
- Lo = DAG.getConstant(0, NVT); // Low part is zero.
- Hi = DAG.getNode(ISD::SHL, NVT, InL, Amt); // High part from Lo part.
- return true;
- case ISD::SRL:
- Hi = DAG.getConstant(0, NVT); // Hi part is zero.
- Lo = DAG.getNode(ISD::SRL, NVT, InH, Amt); // Lo part from Hi part.
- return true;
- case ISD::SRA:
- Hi = DAG.getNode(ISD::SRA, NVT, InH, // Sign extend high part.
- DAG.getConstant(NVTBits-1, ShTy));
- Lo = DAG.getNode(ISD::SRA, NVT, InH, Amt); // Lo part from Hi part.
- return true;
- }
- }
-
- // If we know that all of the high bits of the shift amount are zero, then we
- // can do this as a couple of simple shifts.
- if ((KnownZero & HighBitMask) == HighBitMask) {
- // Compute 32-amt.
- SDOperand Amt2 = DAG.getNode(ISD::SUB, ShTy,
- DAG.getConstant(NVTBits, ShTy),
- Amt);
- unsigned Op1, Op2;
- switch (N->getOpcode()) {
- default: assert(0 && "Unknown shift");
- case ISD::SHL: Op1 = ISD::SHL; Op2 = ISD::SRL; break;
- case ISD::SRL:
- case ISD::SRA: Op1 = ISD::SRL; Op2 = ISD::SHL; break;
- }
-
- Lo = DAG.getNode(N->getOpcode(), NVT, InL, Amt);
- Hi = DAG.getNode(ISD::OR, NVT,
- DAG.getNode(Op1, NVT, InH, Amt),
- DAG.getNode(Op2, NVT, InL, Amt2));
- return true;
- }
-
- return false;
-}
-
-
-//===----------------------------------------------------------------------===//
-// Operand Expansion
-//===----------------------------------------------------------------------===//
-
-/// ExpandOperand - This method is called when the specified operand of the
-/// specified node is found to need expansion. At this point, all of the result
-/// types of the node are known to be legal, but other operands of the node may
-/// need promotion or expansion as well as the specified one.
-bool DAGTypeLegalizer::ExpandOperand(SDNode *N, unsigned OpNo) {
- DEBUG(cerr << "Expand node operand: "; N->dump(&DAG); cerr << "\n");
- SDOperand Res(0, 0);
-
- if (TLI.getOperationAction(N->getOpcode(), N->getOperand(OpNo).getValueType())
- == TargetLowering::Custom)
- Res = TLI.LowerOperation(SDOperand(N, 0), DAG);
-
- if (Res.Val == 0) {
- switch (N->getOpcode()) {
- default:
- #ifndef NDEBUG
- cerr << "ExpandOperand Op #" << OpNo << ": ";
- N->dump(&DAG); cerr << "\n";
- #endif
- assert(0 && "Do not know how to expand this operator's operand!");
- abort();
-
- case ISD::TRUNCATE: Res = ExpandOperand_TRUNCATE(N); break;
- case ISD::BIT_CONVERT: Res = ExpandOperand_BIT_CONVERT(N); break;
-
- case ISD::SINT_TO_FP:
- Res = ExpandOperand_SINT_TO_FP(N->getOperand(0), N->getValueType(0));
- break;
- case ISD::UINT_TO_FP:
- Res = ExpandOperand_UINT_TO_FP(N->getOperand(0), N->getValueType(0));
- break;
- case ISD::EXTRACT_ELEMENT: Res = ExpandOperand_EXTRACT_ELEMENT(N); break;
-
- case ISD::BR_CC: Res = ExpandOperand_BR_CC(N); break;
- case ISD::SETCC: Res = ExpandOperand_SETCC(N); break;
-
- case ISD::STORE:
- Res = ExpandOperand_STORE(cast<StoreSDNode>(N), OpNo);
- break;
-
- case ISD::BUILD_VECTOR: Res = ExpandOperand_BUILD_VECTOR(N); break;
- }
- }
-
- // If the result is null, the sub-method took care of registering results etc.
- if (!Res.Val) return false;
- // If the result is N, the sub-method updated N in place. Check to see if any
- // operands are new, and if so, mark them.
- if (Res.Val == N) {
- // Mark N as new and remark N and its operands. This allows us to correctly
- // revisit N if it needs another step of promotion and allows us to visit
- // any new operands to N.
- ReanalyzeNode(N);
- return true;
- }
-
- assert(Res.getValueType() == N->getValueType(0) && N->getNumValues() == 1 &&
- "Invalid operand expansion");
-
- ReplaceValueWith(SDOperand(N, 0), Res);
- return false;
-}
-
-SDOperand DAGTypeLegalizer::ExpandOperand_TRUNCATE(SDNode *N) {
- SDOperand InL, InH;
- GetExpandedOp(N->getOperand(0), InL, InH);
- // Just truncate the low part of the source.
- return DAG.getNode(ISD::TRUNCATE, N->getValueType(0), InL);
-}
-
-SDOperand DAGTypeLegalizer::ExpandOperand_BIT_CONVERT(SDNode *N) {
- if (MVT::isVector(N->getValueType(0))) {
- // An illegal integer type is being converted to a legal vector type.
- // Make a two element vector out of the expanded parts and convert that
- // instead, but only if the new vector type is legal (otherwise there
- // is no point, and it might create expansion loops). For example, on
- // x86 this turns v1i64 = BIT_CONVERT i64 into v1i64 = BIT_CONVERT v2i32.
- MVT::ValueType OVT = N->getOperand(0).getValueType();
- MVT::ValueType NVT = MVT::getVectorType(TLI.getTypeToTransformTo(OVT), 2);
-
- if (isTypeLegal(NVT)) {
- SDOperand Parts[2];
- GetExpandedOp(N->getOperand(0), Parts[0], Parts[1]);
-
- if (TLI.isBigEndian())
- std::swap(Parts[0], Parts[1]);
-
- SDOperand Vec = DAG.getNode(ISD::BUILD_VECTOR, NVT, Parts, 2);
- return DAG.getNode(ISD::BIT_CONVERT, N->getValueType(0), Vec);
- }
- }
-
- // Otherwise, store to a temporary and load out again as the new type.
- return CreateStackStoreLoad(N->getOperand(0), N->getValueType(0));
-}
-
-SDOperand DAGTypeLegalizer::ExpandOperand_SINT_TO_FP(SDOperand Source,
- MVT::ValueType DestTy) {
- // We know the destination is legal, but that the input needs to be expanded.
- MVT::ValueType SourceVT = Source.getValueType();
-
- // Check to see if the target has a custom way to lower this. If so, use it.
- switch (TLI.getOperationAction(ISD::SINT_TO_FP, SourceVT)) {
- default: assert(0 && "This action not implemented for this operation!");
- case TargetLowering::Legal:
- case TargetLowering::Expand:
- break; // This case is handled below.
- case TargetLowering::Custom:
- SDOperand NV = TLI.LowerOperation(DAG.getNode(ISD::SINT_TO_FP, DestTy,
- Source), DAG);
- if (NV.Val) return NV;
- break; // The target lowered this.
- }
-
- RTLIB::Libcall LC = RTLIB::UNKNOWN_LIBCALL;
- if (SourceVT == MVT::i64) {
- if (DestTy == MVT::f32)
- LC = RTLIB::SINTTOFP_I64_F32;
- else {
- assert(DestTy == MVT::f64 && "Unknown fp value type!");
- LC = RTLIB::SINTTOFP_I64_F64;
- }
- } else if (SourceVT == MVT::i128) {
- if (DestTy == MVT::f32)
- LC = RTLIB::SINTTOFP_I128_F32;
- else if (DestTy == MVT::f64)
- LC = RTLIB::SINTTOFP_I128_F64;
- else if (DestTy == MVT::f80)
- LC = RTLIB::SINTTOFP_I128_F80;
- else {
- assert(DestTy == MVT::ppcf128 && "Unknown fp value type!");
- LC = RTLIB::SINTTOFP_I128_PPCF128;
- }
- } else {
- assert(0 && "Unknown int value type!");
- }
-
- assert(LC != RTLIB::UNKNOWN_LIBCALL &&
- "Don't know how to expand this SINT_TO_FP!");
- return MakeLibCall(LC, DestTy, &Source, 1, true);
-}
-
-SDOperand DAGTypeLegalizer::ExpandOperand_UINT_TO_FP(SDOperand Source,
- MVT::ValueType DestTy) {
- // We know the destination is legal, but that the input needs to be expanded.
- assert(getTypeAction(Source.getValueType()) == Expand &&
- "This is not an expansion!");
-
- // If this is unsigned, and not supported, first perform the conversion to
- // signed, then adjust the result if the sign bit is set.
- SDOperand SignedConv = ExpandOperand_SINT_TO_FP(Source, DestTy);
-
- // The 64-bit value loaded will be incorrectly if the 'sign bit' of the
- // incoming integer is set. To handle this, we dynamically test to see if
- // it is set, and, if so, add a fudge factor.
- SDOperand Lo, Hi;
- GetExpandedOp(Source, Lo, Hi);
-
- SDOperand SignSet = DAG.getSetCC(TLI.getSetCCResultType(Hi), Hi,
- DAG.getConstant(0, Hi.getValueType()),
- ISD::SETLT);
- SDOperand Zero = DAG.getIntPtrConstant(0), Four = DAG.getIntPtrConstant(4);
- SDOperand CstOffset = DAG.getNode(ISD::SELECT, Zero.getValueType(),
- SignSet, Four, Zero);
- uint64_t FF = 0x5f800000ULL;
- if (TLI.isLittleEndian()) FF <<= 32;
- Constant *FudgeFactor = ConstantInt::get((Type*)Type::Int64Ty, FF);
-
- SDOperand CPIdx = DAG.getConstantPool(FudgeFactor, TLI.getPointerTy());
- CPIdx = DAG.getNode(ISD::ADD, TLI.getPointerTy(), CPIdx, CstOffset);
- SDOperand FudgeInReg;
- if (DestTy == MVT::f32)
- FudgeInReg = DAG.getLoad(MVT::f32, DAG.getEntryNode(), CPIdx, NULL, 0);
- else if (MVT::getSizeInBits(DestTy) > MVT::getSizeInBits(MVT::f32))
- // FIXME: Avoid the extend by construction the right constantpool?
- FudgeInReg = DAG.getExtLoad(ISD::EXTLOAD, DestTy, DAG.getEntryNode(),
- CPIdx, NULL, 0, MVT::f32);
- else
- assert(0 && "Unexpected conversion");
-
- return DAG.getNode(ISD::FADD, DestTy, SignedConv, FudgeInReg);
-}
-
-SDOperand DAGTypeLegalizer::ExpandOperand_EXTRACT_ELEMENT(SDNode *N) {
- SDOperand Lo, Hi;
- GetExpandedOp(N->getOperand(0), Lo, Hi);
- return cast<ConstantSDNode>(N->getOperand(1))->getValue() ? Hi : Lo;
-}
-
-SDOperand DAGTypeLegalizer::ExpandOperand_BR_CC(SDNode *N) {
- SDOperand NewLHS = N->getOperand(2), NewRHS = N->getOperand(3);
- ISD::CondCode CCCode = cast<CondCodeSDNode>(N->getOperand(1))->get();
- ExpandSetCCOperands(NewLHS, NewRHS, CCCode);
-
- // If ExpandSetCCOperands returned a scalar, we need to compare the result
- // against zero to select between true and false values.
- if (NewRHS.Val == 0) {
- NewRHS = DAG.getConstant(0, NewLHS.getValueType());
- CCCode = ISD::SETNE;
- }
-
- // Update N to have the operands specified.
- return DAG.UpdateNodeOperands(SDOperand(N, 0), N->getOperand(0),
- DAG.getCondCode(CCCode), NewLHS, NewRHS,
- N->getOperand(4));
-}
-
-SDOperand DAGTypeLegalizer::ExpandOperand_SETCC(SDNode *N) {
- SDOperand NewLHS = N->getOperand(0), NewRHS = N->getOperand(1);
- ISD::CondCode CCCode = cast<CondCodeSDNode>(N->getOperand(2))->get();
- ExpandSetCCOperands(NewLHS, NewRHS, CCCode);
-
- // If ExpandSetCCOperands returned a scalar, use it.
- if (NewRHS.Val == 0) return NewLHS;
-
- // Otherwise, update N to have the operands specified.
- return DAG.UpdateNodeOperands(SDOperand(N, 0), NewLHS, NewRHS,
- DAG.getCondCode(CCCode));
-}
-
-/// ExpandSetCCOperands - Expand the operands of a comparison. This code is
-/// shared among BR_CC, SELECT_CC, and SETCC handlers.
-void DAGTypeLegalizer::ExpandSetCCOperands(SDOperand &NewLHS, SDOperand &NewRHS,
- ISD::CondCode &CCCode) {
- SDOperand LHSLo, LHSHi, RHSLo, RHSHi;
- GetExpandedOp(NewLHS, LHSLo, LHSHi);
- GetExpandedOp(NewRHS, RHSLo, RHSHi);
-
- MVT::ValueType VT = NewLHS.getValueType();
- if (VT == MVT::ppcf128) {
- // FIXME: This generated code sucks. We want to generate
- // FCMP crN, hi1, hi2
- // BNE crN, L:
- // FCMP crN, lo1, lo2
- // The following can be improved, but not that much.
- SDOperand Tmp1, Tmp2, Tmp3;
- Tmp1 = DAG.getSetCC(TLI.getSetCCResultType(LHSHi), LHSHi, RHSHi, ISD::SETEQ);
- Tmp2 = DAG.getSetCC(TLI.getSetCCResultType(LHSLo), LHSLo, RHSLo, CCCode);
- Tmp3 = DAG.getNode(ISD::AND, Tmp1.getValueType(), Tmp1, Tmp2);
- Tmp1 = DAG.getSetCC(TLI.getSetCCResultType(LHSHi), LHSHi, RHSHi, ISD::SETNE);
- Tmp2 = DAG.getSetCC(TLI.getSetCCResultType(LHSHi), LHSHi, RHSHi, CCCode);
- Tmp1 = DAG.getNode(ISD::AND, Tmp1.getValueType(), Tmp1, Tmp2);
- NewLHS = DAG.getNode(ISD::OR, Tmp1.getValueType(), Tmp1, Tmp3);
- NewRHS = SDOperand(); // LHS is the result, not a compare.
- return;
- }
-
- if (CCCode == ISD::SETEQ || CCCode == ISD::SETNE) {
- if (RHSLo == RHSHi)
- if (ConstantSDNode *RHSCST = dyn_cast<ConstantSDNode>(RHSLo))
- if (RHSCST->isAllOnesValue()) {
- // Equality comparison to -1.
- NewLHS = DAG.getNode(ISD::AND, LHSLo.getValueType(), LHSLo, LHSHi);
- NewRHS = RHSLo;
- return;
- }
-
- NewLHS = DAG.getNode(ISD::XOR, LHSLo.getValueType(), LHSLo, RHSLo);
- NewRHS = DAG.getNode(ISD::XOR, LHSLo.getValueType(), LHSHi, RHSHi);
- NewLHS = DAG.getNode(ISD::OR, NewLHS.getValueType(), NewLHS, NewRHS);
- NewRHS = DAG.getConstant(0, NewLHS.getValueType());
- return;
- }
-
- // If this is a comparison of the sign bit, just look at the top part.
- // X > -1, x < 0
- if (ConstantSDNode *CST = dyn_cast<ConstantSDNode>(NewRHS))
- if ((CCCode == ISD::SETLT && CST->isNullValue()) || // X < 0
- (CCCode == ISD::SETGT && CST->isAllOnesValue())) { // X > -1
- NewLHS = LHSHi;
- NewRHS = RHSHi;
- return;
- }
-
- // FIXME: This generated code sucks.
- ISD::CondCode LowCC;
- switch (CCCode) {
- default: assert(0 && "Unknown integer setcc!");
- case ISD::SETLT:
- case ISD::SETULT: LowCC = ISD::SETULT; break;
- case ISD::SETGT:
- case ISD::SETUGT: LowCC = ISD::SETUGT; break;
- case ISD::SETLE:
- case ISD::SETULE: LowCC = ISD::SETULE; break;
- case ISD::SETGE:
- case ISD::SETUGE: LowCC = ISD::SETUGE; break;
- }
-
- // Tmp1 = lo(op1) < lo(op2) // Always unsigned comparison
- // Tmp2 = hi(op1) < hi(op2) // Signedness depends on operands
- // dest = hi(op1) == hi(op2) ? Tmp1 : Tmp2;
-
- // NOTE: on targets without efficient SELECT of bools, we can always use
- // this identity: (B1 ? B2 : B3) --> (B1 & B2)|(!B1&B3)
- TargetLowering::DAGCombinerInfo DagCombineInfo(DAG, false, true, NULL);
- SDOperand Tmp1, Tmp2;
- Tmp1 = TLI.SimplifySetCC(TLI.getSetCCResultType(LHSLo), LHSLo, RHSLo, LowCC,
- false, DagCombineInfo);
- if (!Tmp1.Val)
- Tmp1 = DAG.getSetCC(TLI.getSetCCResultType(LHSLo), LHSLo, RHSLo, LowCC);
- Tmp2 = TLI.SimplifySetCC(TLI.getSetCCResultType(LHSHi), LHSHi, RHSHi,
- CCCode, false, DagCombineInfo);
- if (!Tmp2.Val)
- Tmp2 = DAG.getNode(ISD::SETCC, TLI.getSetCCResultType(LHSHi), LHSHi, RHSHi,
- DAG.getCondCode(CCCode));
-
- ConstantSDNode *Tmp1C = dyn_cast<ConstantSDNode>(Tmp1.Val);
- ConstantSDNode *Tmp2C = dyn_cast<ConstantSDNode>(Tmp2.Val);
- if ((Tmp1C && Tmp1C->isNullValue()) ||
- (Tmp2C && Tmp2C->isNullValue() &&
- (CCCode == ISD::SETLE || CCCode == ISD::SETGE ||
- CCCode == ISD::SETUGE || CCCode == ISD::SETULE)) ||
- (Tmp2C && Tmp2C->getAPIntValue() == 1 &&
- (CCCode == ISD::SETLT || CCCode == ISD::SETGT ||
- CCCode == ISD::SETUGT || CCCode == ISD::SETULT))) {
- // low part is known false, returns high part.
- // For LE / GE, if high part is known false, ignore the low part.
- // For LT / GT, if high part is known true, ignore the low part.
- NewLHS = Tmp2;
- NewRHS = SDOperand();
- return;
- }
-
- NewLHS = TLI.SimplifySetCC(TLI.getSetCCResultType(LHSHi), LHSHi, RHSHi,
- ISD::SETEQ, false, DagCombineInfo);
- if (!NewLHS.Val)
- NewLHS = DAG.getSetCC(TLI.getSetCCResultType(LHSHi), LHSHi, RHSHi,
- ISD::SETEQ);
- NewLHS = DAG.getNode(ISD::SELECT, Tmp1.getValueType(),
- NewLHS, Tmp1, Tmp2);
- NewRHS = SDOperand();
-}
-
-SDOperand DAGTypeLegalizer::ExpandOperand_STORE(StoreSDNode *N, unsigned OpNo) {
- // FIXME: Add support for indexed stores.
- assert(OpNo == 1 && "Can only expand the stored value so far");
-
- MVT::ValueType VT = N->getOperand(1).getValueType();
- MVT::ValueType NVT = TLI.getTypeToTransformTo(VT);
- SDOperand Ch = N->getChain();
- SDOperand Ptr = N->getBasePtr();
- int SVOffset = N->getSrcValueOffset();
- unsigned Alignment = N->getAlignment();
- bool isVolatile = N->isVolatile();
- SDOperand Lo, Hi;
-
- assert(!(MVT::getSizeInBits(NVT) & 7) && "Expanded type not byte sized!");
-
- if (!N->isTruncatingStore()) {
- unsigned IncrementSize = 0;
- GetExpandedOp(N->getValue(), Lo, Hi);
- IncrementSize = MVT::getSizeInBits(Hi.getValueType())/8;
-
- if (TLI.isBigEndian())
- std::swap(Lo, Hi);
-
- Lo = DAG.getStore(Ch, Lo, Ptr, N->getSrcValue(),
- SVOffset, isVolatile, Alignment);
-
- Ptr = DAG.getNode(ISD::ADD, Ptr.getValueType(), Ptr,
- DAG.getIntPtrConstant(IncrementSize));
- assert(isTypeLegal(Ptr.getValueType()) && "Pointers must be legal!");
- Hi = DAG.getStore(Ch, Hi, Ptr, N->getSrcValue(), SVOffset+IncrementSize,
- isVolatile, MinAlign(Alignment, IncrementSize));
- return DAG.getNode(ISD::TokenFactor, MVT::Other, Lo, Hi);
- } else if (MVT::getSizeInBits(N->getMemoryVT()) <= MVT::getSizeInBits(NVT)) {
- GetExpandedOp(N->getValue(), Lo, Hi);
- return DAG.getTruncStore(Ch, Lo, Ptr, N->getSrcValue(), SVOffset,
- N->getMemoryVT(), isVolatile, Alignment);
- } else if (TLI.isLittleEndian()) {
- // Little-endian - low bits are at low addresses.
- GetExpandedOp(N->getValue(), Lo, Hi);
-
- Lo = DAG.getStore(Ch, Lo, Ptr, N->getSrcValue(), SVOffset,
- isVolatile, Alignment);
-
- unsigned ExcessBits =
- MVT::getSizeInBits(N->getMemoryVT()) - MVT::getSizeInBits(NVT);
- MVT::ValueType NEVT = MVT::getIntegerType(ExcessBits);
-
- // Increment the pointer to the other half.
- unsigned IncrementSize = MVT::getSizeInBits(NVT)/8;
- Ptr = DAG.getNode(ISD::ADD, Ptr.getValueType(), Ptr,
- DAG.getIntPtrConstant(IncrementSize));
- Hi = DAG.getTruncStore(Ch, Hi, Ptr, N->getSrcValue(),
- SVOffset+IncrementSize, NEVT,
- isVolatile, MinAlign(Alignment, IncrementSize));
- return DAG.getNode(ISD::TokenFactor, MVT::Other, Lo, Hi);
- } else {
- // Big-endian - high bits are at low addresses. Favor aligned stores at
- // the cost of some bit-fiddling.
- GetExpandedOp(N->getValue(), Lo, Hi);
-
- MVT::ValueType EVT = N->getMemoryVT();
- unsigned EBytes = MVT::getStoreSizeInBits(EVT)/8;
- unsigned IncrementSize = MVT::getSizeInBits(NVT)/8;
- unsigned ExcessBits = (EBytes - IncrementSize)*8;
- MVT::ValueType HiVT =
- MVT::getIntegerType(MVT::getSizeInBits(EVT)-ExcessBits);
-
- if (ExcessBits < MVT::getSizeInBits(NVT)) {
- // Transfer high bits from the top of Lo to the bottom of Hi.
- Hi = DAG.getNode(ISD::SHL, NVT, Hi,
- DAG.getConstant(MVT::getSizeInBits(NVT) - ExcessBits,
- TLI.getShiftAmountTy()));
- Hi = DAG.getNode(ISD::OR, NVT, Hi,
- DAG.getNode(ISD::SRL, NVT, Lo,
- DAG.getConstant(ExcessBits,
- TLI.getShiftAmountTy())));
- }
-
- // Store both the high bits and maybe some of the low bits.
- Hi = DAG.getTruncStore(Ch, Hi, Ptr, N->getSrcValue(),
- SVOffset, HiVT, isVolatile, Alignment);
-
- // Increment the pointer to the other half.
- Ptr = DAG.getNode(ISD::ADD, Ptr.getValueType(), Ptr,
- DAG.getIntPtrConstant(IncrementSize));
- // Store the lowest ExcessBits bits in the second half.
- Lo = DAG.getTruncStore(Ch, Lo, Ptr, N->getSrcValue(),
- SVOffset+IncrementSize,
- MVT::getIntegerType(ExcessBits),
- isVolatile, MinAlign(Alignment, IncrementSize));
- return DAG.getNode(ISD::TokenFactor, MVT::Other, Lo, Hi);
- }
-}
-
-SDOperand DAGTypeLegalizer::ExpandOperand_BUILD_VECTOR(SDNode *N) {
- // The vector type is legal but the element type needs expansion.
- MVT::ValueType VecVT = N->getValueType(0);
- unsigned NumElts = MVT::getVectorNumElements(VecVT);
- MVT::ValueType OldVT = N->getOperand(0).getValueType();
- MVT::ValueType NewVT = TLI.getTypeToTransformTo(OldVT);
-
- assert(MVT::getSizeInBits(OldVT) == 2 * MVT::getSizeInBits(NewVT) &&
- "Do not know how to expand this operand!");
-
- // Build a vector of twice the length out of the expanded elements.
- // For example <2 x i64> -> <4 x i32>.
- std::vector<SDOperand> NewElts;
- NewElts.reserve(NumElts*2);
-
- for (unsigned i = 0; i < NumElts; ++i) {
- SDOperand Lo, Hi;
- GetExpandedOp(N->getOperand(i), Lo, Hi);
- if (TLI.isBigEndian())
- std::swap(Lo, Hi);
- NewElts.push_back(Lo);
- NewElts.push_back(Hi);
- }
-
- SDOperand NewVec = DAG.getNode(ISD::BUILD_VECTOR,
- MVT::getVectorType(NewVT, NewElts.size()),
- &NewElts[0], NewElts.size());
-
- // Convert the new vector to the old vector type.
- return DAG.getNode(ISD::BIT_CONVERT, VecVT, NewVec);
-}
diff --git a/release_23/lib/CodeGen/SelectionDAG/LegalizeTypesFloatToInt.cpp b/release_23/lib/CodeGen/SelectionDAG/LegalizeTypesFloatToInt.cpp
deleted file mode 100644
index f23b63eb1d57..000000000000
--- a/release_23/lib/CodeGen/SelectionDAG/LegalizeTypesFloatToInt.cpp
+++ /dev/null
@@ -1,356 +0,0 @@
-//===-- LegalizeTypesFloatToInt.cpp - LegalizeTypes float to int support --===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements float to integer conversion for LegalizeTypes. This
-// is the act of turning a computation in an invalid floating point type into
-// a computation in an integer type of the same size. For example, turning
-// f32 arithmetic into operations using i32. Also known as "soft float".
-// The result is equivalent to bitcasting the float value to the integer type.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/CodeGen/PseudoSourceValue.h"
-#include "llvm/DerivedTypes.h"
-#include "LegalizeTypes.h"
-using namespace llvm;
-
-/// GetFPLibCall - Return the right libcall for the given floating point type.
-static RTLIB::Libcall GetFPLibCall(MVT::ValueType VT,
- RTLIB::Libcall Call_F32,
- RTLIB::Libcall Call_F64,
- RTLIB::Libcall Call_F80,
- RTLIB::Libcall Call_PPCF128) {
- return
- VT == MVT::f32 ? Call_F32 :
- VT == MVT::f64 ? Call_F64 :
- VT == MVT::f80 ? Call_F80 :
- VT == MVT::ppcf128 ? Call_PPCF128 :
- RTLIB::UNKNOWN_LIBCALL;
-}
-
-//===----------------------------------------------------------------------===//
-// Result Float to Integer Conversion.
-//===----------------------------------------------------------------------===//
-
-void DAGTypeLegalizer::FloatToIntResult(SDNode *N, unsigned ResNo) {
- DEBUG(cerr << "FloatToInt node result " << ResNo << ": "; N->dump(&DAG);
- cerr << "\n");
- SDOperand R = SDOperand();
-
- // FIXME: Custom lowering for float-to-int?
-#if 0
- // See if the target wants to custom convert this node to an integer.
- if (TLI.getOperationAction(N->getOpcode(), N->getValueType(0)) ==
- TargetLowering::Custom) {
- // If the target wants to, allow it to lower this itself.
- if (SDNode *P = TLI.FloatToIntOperationResult(N, DAG)) {
- // Everything that once used N now uses P. We are guaranteed that the
- // result value types of N and the result value types of P match.
- ReplaceNodeWith(N, P);
- return;
- }
- }
-#endif
-
- switch (N->getOpcode()) {
- default:
-#ifndef NDEBUG
- cerr << "FloatToIntResult #" << ResNo << ": ";
- N->dump(&DAG); cerr << "\n";
-#endif
- assert(0 && "Do not know how to convert the result of this operator!");
- abort();
-
- case ISD::BIT_CONVERT: R = FloatToIntRes_BIT_CONVERT(N); break;
- case ISD::BUILD_PAIR: R = FloatToIntRes_BUILD_PAIR(N); break;
- case ISD::ConstantFP:
- R = FloatToIntRes_ConstantFP(cast<ConstantFPSDNode>(N));
- break;
- case ISD::FCOPYSIGN: R = FloatToIntRes_FCOPYSIGN(N); break;
- case ISD::LOAD: R = FloatToIntRes_LOAD(N); break;
- case ISD::SINT_TO_FP:
- case ISD::UINT_TO_FP: R = FloatToIntRes_XINT_TO_FP(N); break;
-
- case ISD::FADD: R = FloatToIntRes_FADD(N); break;
- case ISD::FMUL: R = FloatToIntRes_FMUL(N); break;
- case ISD::FSUB: R = FloatToIntRes_FSUB(N); break;
- }
-
- // If R is null, the sub-method took care of registering the result.
- if (R.Val)
- SetIntegerOp(SDOperand(N, ResNo), R);
-}
-
-SDOperand DAGTypeLegalizer::FloatToIntRes_BIT_CONVERT(SDNode *N) {
- return BitConvertToInteger(N->getOperand(0));
-}
-
-SDOperand DAGTypeLegalizer::FloatToIntRes_BUILD_PAIR(SDNode *N) {
- // Convert the inputs to integers, and build a new pair out of them.
- return DAG.getNode(ISD::BUILD_PAIR,
- TLI.getTypeToTransformTo(N->getValueType(0)),
- BitConvertToInteger(N->getOperand(0)),
- BitConvertToInteger(N->getOperand(1)));
-}
-
-SDOperand DAGTypeLegalizer::FloatToIntRes_ConstantFP(ConstantFPSDNode *N) {
- return DAG.getConstant(N->getValueAPF().convertToAPInt(),
- TLI.getTypeToTransformTo(N->getValueType(0)));
-}
-
-SDOperand DAGTypeLegalizer::FloatToIntRes_FADD(SDNode *N) {
- MVT::ValueType NVT = TLI.getTypeToTransformTo(N->getValueType(0));
- SDOperand Ops[2] = { GetIntegerOp(N->getOperand(0)),
- GetIntegerOp(N->getOperand(1)) };
- return MakeLibCall(GetFPLibCall(N->getValueType(0),
- RTLIB::ADD_F32,
- RTLIB::ADD_F64,
- RTLIB::ADD_F80,
- RTLIB::ADD_PPCF128),
- NVT, Ops, 2, false/*sign irrelevant*/);
-}
-
-SDOperand DAGTypeLegalizer::FloatToIntRes_FCOPYSIGN(SDNode *N) {
- SDOperand LHS = GetIntegerOp(N->getOperand(0));
- SDOperand RHS = BitConvertToInteger(N->getOperand(1));
-
- MVT::ValueType LVT = LHS.getValueType();
- MVT::ValueType RVT = RHS.getValueType();
-
- unsigned LSize = MVT::getSizeInBits(LVT);
- unsigned RSize = MVT::getSizeInBits(RVT);
-
- // First get the sign bit of second operand.
- SDOperand SignBit = DAG.getNode(ISD::SHL, RVT, DAG.getConstant(1, RVT),
- DAG.getConstant(RSize - 1,
- TLI.getShiftAmountTy()));
- SignBit = DAG.getNode(ISD::AND, RVT, RHS, SignBit);
-
- // Shift right or sign-extend it if the two operands have different types.
- int SizeDiff = MVT::getSizeInBits(RVT) - MVT::getSizeInBits(LVT);
- if (SizeDiff > 0) {
- SignBit = DAG.getNode(ISD::SRL, RVT, SignBit,
- DAG.getConstant(SizeDiff, TLI.getShiftAmountTy()));
- SignBit = DAG.getNode(ISD::TRUNCATE, LVT, SignBit);
- } else if (SizeDiff < 0) {
- SignBit = DAG.getNode(ISD::ANY_EXTEND, LVT, SignBit);
- SignBit = DAG.getNode(ISD::SHL, LVT, SignBit,
- DAG.getConstant(-SizeDiff, TLI.getShiftAmountTy()));
- }
-
- // Clear the sign bit of the first operand.
- SDOperand Mask = DAG.getNode(ISD::SHL, LVT, DAG.getConstant(1, LVT),
- DAG.getConstant(LSize - 1,
- TLI.getShiftAmountTy()));
- Mask = DAG.getNode(ISD::SUB, LVT, Mask, DAG.getConstant(1, LVT));
- LHS = DAG.getNode(ISD::AND, LVT, LHS, Mask);
-
- // Or the value with the sign bit.
- return DAG.getNode(ISD::OR, LVT, LHS, SignBit);
-}
-
-SDOperand DAGTypeLegalizer::FloatToIntRes_FMUL(SDNode *N) {
- MVT::ValueType NVT = TLI.getTypeToTransformTo(N->getValueType(0));
- SDOperand Ops[2] = { GetIntegerOp(N->getOperand(0)),
- GetIntegerOp(N->getOperand(1)) };
- return MakeLibCall(GetFPLibCall(N->getValueType(0),
- RTLIB::MUL_F32,
- RTLIB::MUL_F64,
- RTLIB::MUL_F80,
- RTLIB::MUL_PPCF128),
- NVT, Ops, 2, false/*sign irrelevant*/);
-}
-
-SDOperand DAGTypeLegalizer::FloatToIntRes_FSUB(SDNode *N) {
- MVT::ValueType NVT = TLI.getTypeToTransformTo(N->getValueType(0));
- SDOperand Ops[2] = { GetIntegerOp(N->getOperand(0)),
- GetIntegerOp(N->getOperand(1)) };
- return MakeLibCall(GetFPLibCall(N->getValueType(0),
- RTLIB::SUB_F32,
- RTLIB::SUB_F64,
- RTLIB::SUB_F80,
- RTLIB::SUB_PPCF128),
- NVT, Ops, 2, false/*sign irrelevant*/);
-}
-
-SDOperand DAGTypeLegalizer::FloatToIntRes_LOAD(SDNode *N) {
- LoadSDNode *L = cast<LoadSDNode>(N);
- MVT::ValueType VT = N->getValueType(0);
- MVT::ValueType NVT = TLI.getTypeToTransformTo(VT);
-
- if (L->getExtensionType() == ISD::NON_EXTLOAD)
- return DAG.getLoad(L->getAddressingMode(), L->getExtensionType(),
- NVT, L->getChain(), L->getBasePtr(), L->getOffset(),
- L->getSrcValue(), L->getSrcValueOffset(), NVT,
- L->isVolatile(), L->getAlignment());
-
- // Do a non-extending load followed by FP_EXTEND.
- SDOperand NL = DAG.getLoad(L->getAddressingMode(), ISD::NON_EXTLOAD,
- L->getMemoryVT(), L->getChain(),
- L->getBasePtr(), L->getOffset(),
- L->getSrcValue(), L->getSrcValueOffset(),
- L->getMemoryVT(),
- L->isVolatile(), L->getAlignment());
- return BitConvertToInteger(DAG.getNode(ISD::FP_EXTEND, VT, NL));
-}
-
-SDOperand DAGTypeLegalizer::FloatToIntRes_XINT_TO_FP(SDNode *N) {
- bool isSigned = N->getOpcode() == ISD::SINT_TO_FP;
- MVT::ValueType DestVT = N->getValueType(0);
- SDOperand Op = N->getOperand(0);
-
- if (Op.getValueType() == MVT::i32) {
- // simple 32-bit [signed|unsigned] integer to float/double expansion
-
- // Get the stack frame index of a 8 byte buffer.
- SDOperand StackSlot = DAG.CreateStackTemporary(MVT::f64);
-
- // word offset constant for Hi/Lo address computation
- SDOperand Offset = DAG.getConstant(MVT::getSizeInBits(MVT::i32) / 8,
- TLI.getPointerTy());
- // set up Hi and Lo (into buffer) address based on endian
- SDOperand Hi = StackSlot;
- SDOperand Lo = DAG.getNode(ISD::ADD, TLI.getPointerTy(), StackSlot, Offset);
- if (TLI.isLittleEndian())
- std::swap(Hi, Lo);
-
- // if signed map to unsigned space
- SDOperand OpMapped;
- if (isSigned) {
- // constant used to invert sign bit (signed to unsigned mapping)
- SDOperand SignBit = DAG.getConstant(0x80000000u, MVT::i32);
- OpMapped = DAG.getNode(ISD::XOR, MVT::i32, Op, SignBit);
- } else {
- OpMapped = Op;
- }
- // store the lo of the constructed double - based on integer input
- SDOperand Store1 = DAG.getStore(DAG.getEntryNode(),
- OpMapped, Lo, NULL, 0);
- // initial hi portion of constructed double
- SDOperand InitialHi = DAG.getConstant(0x43300000u, MVT::i32);
- // store the hi of the constructed double - biased exponent
- SDOperand Store2=DAG.getStore(Store1, InitialHi, Hi, NULL, 0);
- // load the constructed double
- SDOperand Load = DAG.getLoad(MVT::f64, Store2, StackSlot, NULL, 0);
- // FP constant to bias correct the final result
- SDOperand Bias = DAG.getConstantFP(isSigned ?
- BitsToDouble(0x4330000080000000ULL)
- : BitsToDouble(0x4330000000000000ULL),
- MVT::f64);
- // subtract the bias
- SDOperand Sub = DAG.getNode(ISD::FSUB, MVT::f64, Load, Bias);
- // final result
- SDOperand Result;
- // handle final rounding
- if (DestVT == MVT::f64) {
- // do nothing
- Result = Sub;
- } else if (MVT::getSizeInBits(DestVT) < MVT::getSizeInBits(MVT::f64)) {
- Result = DAG.getNode(ISD::FP_ROUND, DestVT, Sub,
- DAG.getIntPtrConstant(0));
- } else if (MVT::getSizeInBits(DestVT) > MVT::getSizeInBits(MVT::f64)) {
- Result = DAG.getNode(ISD::FP_EXTEND, DestVT, Sub);
- }
- return BitConvertToInteger(Result);
- }
- assert(!isSigned && "Legalize cannot Expand SINT_TO_FP for i64 yet");
- SDOperand Tmp1 = DAG.getNode(ISD::SINT_TO_FP, DestVT, Op);
-
- SDOperand SignSet = DAG.getSetCC(TLI.getSetCCResultType(Op), Op,
- DAG.getConstant(0, Op.getValueType()),
- ISD::SETLT);
- SDOperand Zero = DAG.getIntPtrConstant(0), Four = DAG.getIntPtrConstant(4);
- SDOperand CstOffset = DAG.getNode(ISD::SELECT, Zero.getValueType(),
- SignSet, Four, Zero);
-
- // If the sign bit of the integer is set, the large number will be treated
- // as a negative number. To counteract this, the dynamic code adds an
- // offset depending on the data type.
- uint64_t FF;
- switch (Op.getValueType()) {
- default: assert(0 && "Unsupported integer type!");
- case MVT::i8 : FF = 0x43800000ULL; break; // 2^8 (as a float)
- case MVT::i16: FF = 0x47800000ULL; break; // 2^16 (as a float)
- case MVT::i32: FF = 0x4F800000ULL; break; // 2^32 (as a float)
- case MVT::i64: FF = 0x5F800000ULL; break; // 2^64 (as a float)
- }
- if (TLI.isLittleEndian()) FF <<= 32;
- static Constant *FudgeFactor = ConstantInt::get(Type::Int64Ty, FF);
-
- SDOperand CPIdx = DAG.getConstantPool(FudgeFactor, TLI.getPointerTy());
- CPIdx = DAG.getNode(ISD::ADD, TLI.getPointerTy(), CPIdx, CstOffset);
- SDOperand FudgeInReg;
- if (DestVT == MVT::f32)
- FudgeInReg = DAG.getLoad(MVT::f32, DAG.getEntryNode(), CPIdx,
- PseudoSourceValue::getConstantPool(), 0);
- else {
- FudgeInReg = DAG.getExtLoad(ISD::EXTLOAD, DestVT,
- DAG.getEntryNode(), CPIdx,
- PseudoSourceValue::getConstantPool(), 0,
- MVT::f32);
- }
-
- return BitConvertToInteger(DAG.getNode(ISD::FADD, DestVT, Tmp1, FudgeInReg));
-}
-
-
-//===----------------------------------------------------------------------===//
-// Operand Float to Integer Conversion..
-//===----------------------------------------------------------------------===//
-
-bool DAGTypeLegalizer::FloatToIntOperand(SDNode *N, unsigned OpNo) {
- DEBUG(cerr << "FloatToInt node operand " << OpNo << ": "; N->dump(&DAG);
- cerr << "\n");
- SDOperand Res(0, 0);
-
- // FIXME: Custom lowering for float-to-int?
-#if 0
- if (TLI.getOperationAction(N->getOpcode(), N->getOperand(OpNo).getValueType())
- == TargetLowering::Custom)
- Res = TLI.LowerOperation(SDOperand(N, 0), DAG);
-#endif
-
- if (Res.Val == 0) {
- switch (N->getOpcode()) {
- default:
-#ifndef NDEBUG
- cerr << "FloatToIntOperand Op #" << OpNo << ": ";
- N->dump(&DAG); cerr << "\n";
-#endif
- assert(0 && "Do not know how to convert this operator's operand!");
- abort();
-
- case ISD::BIT_CONVERT: Res = FloatToIntOp_BIT_CONVERT(N); break;
- }
- }
-
- // If the result is null, the sub-method took care of registering results etc.
- if (!Res.Val) return false;
-
- // If the result is N, the sub-method updated N in place. Check to see if any
- // operands are new, and if so, mark them.
- if (Res.Val == N) {
- // Mark N as new and remark N and its operands. This allows us to correctly
- // revisit N if it needs another step of promotion and allows us to visit
- // any new operands to N.
- ReanalyzeNode(N);
- return true;
- }
-
- assert(Res.getValueType() == N->getValueType(0) && N->getNumValues() == 1 &&
- "Invalid operand expansion");
-
- ReplaceValueWith(SDOperand(N, 0), Res);
- return false;
-}
-
-SDOperand DAGTypeLegalizer::FloatToIntOp_BIT_CONVERT(SDNode *N) {
- return DAG.getNode(ISD::BIT_CONVERT, N->getValueType(0),
- GetIntegerOp(N->getOperand(0)));
-}
diff --git a/release_23/lib/CodeGen/SelectionDAG/LegalizeTypesPromote.cpp b/release_23/lib/CodeGen/SelectionDAG/LegalizeTypesPromote.cpp
deleted file mode 100644
index 6d7f0630aed1..000000000000
--- a/release_23/lib/CodeGen/SelectionDAG/LegalizeTypesPromote.cpp
+++ /dev/null
@@ -1,748 +0,0 @@
-//===-- LegalizeTypesPromote.cpp - Promotion for LegalizeTypes ------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements promotion support for LegalizeTypes. Promotion is the
-// act of changing a computation in an invalid type to be a computation in a
-// larger type. For example, implementing i8 arithmetic in an i32 register (as
-// is often needed on powerpc for example).
-//
-//===----------------------------------------------------------------------===//
-
-#include "LegalizeTypes.h"
-using namespace llvm;
-
-//===----------------------------------------------------------------------===//
-// Result Promotion
-//===----------------------------------------------------------------------===//
-
-/// PromoteResult - This method is called when a result of a node is found to be
-/// in need of promotion to a larger type. At this point, the node may also
-/// have invalid operands or may have other results that need expansion, we just
-/// know that (at least) one result needs promotion.
-void DAGTypeLegalizer::PromoteResult(SDNode *N, unsigned ResNo) {
- DEBUG(cerr << "Promote node result: "; N->dump(&DAG); cerr << "\n");
- SDOperand Result = SDOperand();
-
- switch (N->getOpcode()) {
- default:
-#ifndef NDEBUG
- cerr << "PromoteResult #" << ResNo << ": ";
- N->dump(&DAG); cerr << "\n";
-#endif
- assert(0 && "Do not know how to promote this operator!");
- abort();
- case ISD::UNDEF: Result = PromoteResult_UNDEF(N); break;
- case ISD::Constant: Result = PromoteResult_Constant(N); break;
-
- case ISD::TRUNCATE: Result = PromoteResult_TRUNCATE(N); break;
- case ISD::SIGN_EXTEND:
- case ISD::ZERO_EXTEND:
- case ISD::ANY_EXTEND: Result = PromoteResult_INT_EXTEND(N); break;
- case ISD::FP_ROUND: Result = PromoteResult_FP_ROUND(N); break;
- case ISD::FP_TO_SINT:
- case ISD::FP_TO_UINT: Result = PromoteResult_FP_TO_XINT(N); break;
- case ISD::SETCC: Result = PromoteResult_SETCC(N); break;
- case ISD::LOAD: Result = PromoteResult_LOAD(cast<LoadSDNode>(N)); break;
- case ISD::BUILD_PAIR: Result = PromoteResult_BUILD_PAIR(N); break;
- case ISD::BIT_CONVERT: Result = PromoteResult_BIT_CONVERT(N); break;
-
- case ISD::AND:
- case ISD::OR:
- case ISD::XOR:
- case ISD::ADD:
- case ISD::SUB:
- case ISD::MUL: Result = PromoteResult_SimpleIntBinOp(N); break;
-
- case ISD::SDIV:
- case ISD::SREM: Result = PromoteResult_SDIV(N); break;
-
- case ISD::UDIV:
- case ISD::UREM: Result = PromoteResult_UDIV(N); break;
-
- case ISD::SHL: Result = PromoteResult_SHL(N); break;
- case ISD::SRA: Result = PromoteResult_SRA(N); break;
- case ISD::SRL: Result = PromoteResult_SRL(N); break;
-
- case ISD::SELECT: Result = PromoteResult_SELECT(N); break;
- case ISD::SELECT_CC: Result = PromoteResult_SELECT_CC(N); break;
-
- case ISD::CTLZ: Result = PromoteResult_CTLZ(N); break;
- case ISD::CTPOP: Result = PromoteResult_CTPOP(N); break;
- case ISD::CTTZ: Result = PromoteResult_CTTZ(N); break;
-
- case ISD::EXTRACT_VECTOR_ELT:
- Result = PromoteResult_EXTRACT_VECTOR_ELT(N);
- break;
- }
-
- // If Result is null, the sub-method took care of registering the result.
- if (Result.Val)
- SetPromotedOp(SDOperand(N, ResNo), Result);
-}
-
-SDOperand DAGTypeLegalizer::PromoteResult_UNDEF(SDNode *N) {
- return DAG.getNode(ISD::UNDEF, TLI.getTypeToTransformTo(N->getValueType(0)));
-}
-
-SDOperand DAGTypeLegalizer::PromoteResult_Constant(SDNode *N) {
- MVT::ValueType VT = N->getValueType(0);
- // Zero extend things like i1, sign extend everything else. It shouldn't
- // matter in theory which one we pick, but this tends to give better code?
- unsigned Opc = VT != MVT::i1 ? ISD::SIGN_EXTEND : ISD::ZERO_EXTEND;
- SDOperand Result = DAG.getNode(Opc, TLI.getTypeToTransformTo(VT),
- SDOperand(N, 0));
- assert(isa<ConstantSDNode>(Result) && "Didn't constant fold ext?");
- return Result;
-}
-
-SDOperand DAGTypeLegalizer::PromoteResult_TRUNCATE(SDNode *N) {
- SDOperand Res;
-
- switch (getTypeAction(N->getOperand(0).getValueType())) {
- default: assert(0 && "Unknown type action!");
- case Legal:
- case Expand:
- Res = N->getOperand(0);
- break;
- case Promote:
- Res = GetPromotedOp(N->getOperand(0));
- break;
- }
-
- MVT::ValueType NVT = TLI.getTypeToTransformTo(N->getValueType(0));
- assert(MVT::getSizeInBits(Res.getValueType()) >= MVT::getSizeInBits(NVT) &&
- "Truncation doesn't make sense!");
- if (Res.getValueType() == NVT)
- return Res;
-
- // Truncate to NVT instead of VT
- return DAG.getNode(ISD::TRUNCATE, NVT, Res);
-}
-
-SDOperand DAGTypeLegalizer::PromoteResult_INT_EXTEND(SDNode *N) {
- MVT::ValueType NVT = TLI.getTypeToTransformTo(N->getValueType(0));
-
- if (getTypeAction(N->getOperand(0).getValueType()) == Promote) {
- SDOperand Res = GetPromotedOp(N->getOperand(0));
- assert(MVT::getSizeInBits(Res.getValueType()) <= MVT::getSizeInBits(NVT) &&
- "Extension doesn't make sense!");
-
- // If the result and operand types are the same after promotion, simplify
- // to an in-register extension.
- if (NVT == Res.getValueType()) {
- // The high bits are not guaranteed to be anything. Insert an extend.
- if (N->getOpcode() == ISD::SIGN_EXTEND)
- return DAG.getNode(ISD::SIGN_EXTEND_INREG, NVT, Res,
- DAG.getValueType(N->getOperand(0).getValueType()));
- if (N->getOpcode() == ISD::ZERO_EXTEND)
- return DAG.getZeroExtendInReg(Res, N->getOperand(0).getValueType());
- assert(N->getOpcode() == ISD::ANY_EXTEND && "Unknown integer extension!");
- return Res;
- }
- }
-
- // Otherwise, just extend the original operand all the way to the larger type.
- return DAG.getNode(N->getOpcode(), NVT, N->getOperand(0));
-}
-
-SDOperand DAGTypeLegalizer::PromoteResult_FP_ROUND(SDNode *N) {
- // NOTE: Assumes input is legal.
- if (N->getConstantOperandVal(1) == 0)
- return DAG.getNode(ISD::FP_ROUND_INREG, N->getOperand(0).getValueType(),
- N->getOperand(0), DAG.getValueType(N->getValueType(0)));
- // If the precision discard isn't needed, just return the operand unrounded.
- return N->getOperand(0);
-}
-
-SDOperand DAGTypeLegalizer::PromoteResult_FP_TO_XINT(SDNode *N) {
- SDOperand Op = N->getOperand(0);
- // If the operand needed to be promoted, do so now.
- if (getTypeAction(Op.getValueType()) == Promote)
- // The input result is prerounded, so we don't have to do anything special.
- Op = GetPromotedOp(Op);
-
- unsigned NewOpc = N->getOpcode();
- MVT::ValueType NVT = TLI.getTypeToTransformTo(N->getValueType(0));
-
- // If we're promoting a UINT to a larger size, check to see if the new node
- // will be legal. If it isn't, check to see if FP_TO_SINT is legal, since
- // we can use that instead. This allows us to generate better code for
- // FP_TO_UINT for small destination sizes on targets where FP_TO_UINT is not
- // legal, such as PowerPC.
- if (N->getOpcode() == ISD::FP_TO_UINT) {
- if (!TLI.isOperationLegal(ISD::FP_TO_UINT, NVT) &&
- (TLI.isOperationLegal(ISD::FP_TO_SINT, NVT) ||
- TLI.getOperationAction(ISD::FP_TO_SINT, NVT)==TargetLowering::Custom))
- NewOpc = ISD::FP_TO_SINT;
- }
-
- return DAG.getNode(NewOpc, NVT, Op);
-}
-
-SDOperand DAGTypeLegalizer::PromoteResult_SETCC(SDNode *N) {
- assert(isTypeLegal(TLI.getSetCCResultType(N->getOperand(0)))
- && "SetCC type is not legal??");
- return DAG.getNode(ISD::SETCC, TLI.getSetCCResultType(N->getOperand(0)),
- N->getOperand(0), N->getOperand(1), N->getOperand(2));
-}
-
-SDOperand DAGTypeLegalizer::PromoteResult_LOAD(LoadSDNode *N) {
- // FIXME: Add support for indexed loads.
- MVT::ValueType NVT = TLI.getTypeToTransformTo(N->getValueType(0));
- ISD::LoadExtType ExtType =
- ISD::isNON_EXTLoad(N) ? ISD::EXTLOAD : N->getExtensionType();
- SDOperand Res = DAG.getExtLoad(ExtType, NVT, N->getChain(), N->getBasePtr(),
- N->getSrcValue(), N->getSrcValueOffset(),
- N->getMemoryVT(), N->isVolatile(),
- N->getAlignment());
-
- // Legalized the chain result - switch anything that used the old chain to
- // use the new one.
- ReplaceValueWith(SDOperand(N, 1), Res.getValue(1));
- return Res;
-}
-
-SDOperand DAGTypeLegalizer::PromoteResult_BUILD_PAIR(SDNode *N) {
- // The pair element type may be legal, or may not promote to the same type as
- // the result, for example i14 = BUILD_PAIR (i7, i7). Handle all cases.
- return DAG.getNode(ISD::ANY_EXTEND,
- TLI.getTypeToTransformTo(N->getValueType(0)),
- JoinIntegers(N->getOperand(0), N->getOperand(1)));
-}
-
-SDOperand DAGTypeLegalizer::PromoteResult_BIT_CONVERT(SDNode *N) {
- SDOperand InOp = N->getOperand(0);
- MVT::ValueType InVT = InOp.getValueType();
- MVT::ValueType NInVT = TLI.getTypeToTransformTo(InVT);
- MVT::ValueType OutVT = TLI.getTypeToTransformTo(N->getValueType(0));
-
- switch (getTypeAction(InVT)) {
- default:
- assert(false && "Unknown type action!");
- break;
- case Legal:
- break;
- case Promote:
- if (MVT::getSizeInBits(OutVT) == MVT::getSizeInBits(NInVT))
- // The input promotes to the same size. Convert the promoted value.
- return DAG.getNode(ISD::BIT_CONVERT, OutVT, GetPromotedOp(InOp));
- break;
- case Expand:
- break;
- case FloatToInt:
- // Promote the integer operand by hand.
- return DAG.getNode(ISD::ANY_EXTEND, OutVT, GetIntegerOp(InOp));
- case Scalarize:
- // Convert the element to an integer and promote it by hand.
- return DAG.getNode(ISD::ANY_EXTEND, OutVT,
- BitConvertToInteger(GetScalarizedOp(InOp)));
- case Split:
- // For example, i32 = BIT_CONVERT v2i16 on alpha. Convert the split
- // pieces of the input into integers and reassemble in the final type.
- SDOperand Lo, Hi;
- GetSplitOp(N->getOperand(0), Lo, Hi);
- Lo = BitConvertToInteger(Lo);
- Hi = BitConvertToInteger(Hi);
-
- if (TLI.isBigEndian())
- std::swap(Lo, Hi);
-
- InOp = DAG.getNode(ISD::ANY_EXTEND,
- MVT::getIntegerType(MVT::getSizeInBits(OutVT)),
- JoinIntegers(Lo, Hi));
- return DAG.getNode(ISD::BIT_CONVERT, OutVT, InOp);
- }
-
- // Otherwise, lower the bit-convert to a store/load from the stack, then
- // promote the load.
- SDOperand Op = CreateStackStoreLoad(InOp, N->getValueType(0));
- return PromoteResult_LOAD(cast<LoadSDNode>(Op.Val));
-}
-
-SDOperand DAGTypeLegalizer::PromoteResult_SimpleIntBinOp(SDNode *N) {
- // The input may have strange things in the top bits of the registers, but
- // these operations don't care. They may have weird bits going out, but
- // that too is okay if they are integer operations.
- SDOperand LHS = GetPromotedOp(N->getOperand(0));
- SDOperand RHS = GetPromotedOp(N->getOperand(1));
- return DAG.getNode(N->getOpcode(), LHS.getValueType(), LHS, RHS);
-}
-
-SDOperand DAGTypeLegalizer::PromoteResult_SDIV(SDNode *N) {
- // Sign extend the input.
- SDOperand LHS = GetPromotedOp(N->getOperand(0));
- SDOperand RHS = GetPromotedOp(N->getOperand(1));
- MVT::ValueType VT = N->getValueType(0);
- LHS = DAG.getNode(ISD::SIGN_EXTEND_INREG, LHS.getValueType(), LHS,
- DAG.getValueType(VT));
- RHS = DAG.getNode(ISD::SIGN_EXTEND_INREG, RHS.getValueType(), RHS,
- DAG.getValueType(VT));
-
- return DAG.getNode(N->getOpcode(), LHS.getValueType(), LHS, RHS);
-}
-
-SDOperand DAGTypeLegalizer::PromoteResult_UDIV(SDNode *N) {
- // Zero extend the input.
- SDOperand LHS = GetPromotedOp(N->getOperand(0));
- SDOperand RHS = GetPromotedOp(N->getOperand(1));
- MVT::ValueType VT = N->getValueType(0);
- LHS = DAG.getZeroExtendInReg(LHS, VT);
- RHS = DAG.getZeroExtendInReg(RHS, VT);
-
- return DAG.getNode(N->getOpcode(), LHS.getValueType(), LHS, RHS);
-}
-
-SDOperand DAGTypeLegalizer::PromoteResult_SHL(SDNode *N) {
- return DAG.getNode(ISD::SHL, TLI.getTypeToTransformTo(N->getValueType(0)),
- GetPromotedOp(N->getOperand(0)), N->getOperand(1));
-}
-
-SDOperand DAGTypeLegalizer::PromoteResult_SRA(SDNode *N) {
- // The input value must be properly sign extended.
- MVT::ValueType VT = N->getValueType(0);
- MVT::ValueType NVT = TLI.getTypeToTransformTo(VT);
- SDOperand Res = GetPromotedOp(N->getOperand(0));
- Res = DAG.getNode(ISD::SIGN_EXTEND_INREG, NVT, Res, DAG.getValueType(VT));
- return DAG.getNode(ISD::SRA, NVT, Res, N->getOperand(1));
-}
-
-SDOperand DAGTypeLegalizer::PromoteResult_SRL(SDNode *N) {
- // The input value must be properly zero extended.
- MVT::ValueType VT = N->getValueType(0);
- MVT::ValueType NVT = TLI.getTypeToTransformTo(VT);
- SDOperand Res = GetPromotedZExtOp(N->getOperand(0));
- return DAG.getNode(ISD::SRL, NVT, Res, N->getOperand(1));
-}
-
-SDOperand DAGTypeLegalizer::PromoteResult_SELECT(SDNode *N) {
- SDOperand LHS = GetPromotedOp(N->getOperand(1));
- SDOperand RHS = GetPromotedOp(N->getOperand(2));
- return DAG.getNode(ISD::SELECT, LHS.getValueType(), N->getOperand(0),LHS,RHS);
-}
-
-SDOperand DAGTypeLegalizer::PromoteResult_SELECT_CC(SDNode *N) {
- SDOperand LHS = GetPromotedOp(N->getOperand(2));
- SDOperand RHS = GetPromotedOp(N->getOperand(3));
- return DAG.getNode(ISD::SELECT_CC, LHS.getValueType(), N->getOperand(0),
- N->getOperand(1), LHS, RHS, N->getOperand(4));
-}
-
-SDOperand DAGTypeLegalizer::PromoteResult_CTLZ(SDNode *N) {
- SDOperand Op = GetPromotedOp(N->getOperand(0));
- MVT::ValueType OVT = N->getValueType(0);
- MVT::ValueType NVT = Op.getValueType();
- // Zero extend to the promoted type and do the count there.
- Op = DAG.getNode(ISD::CTLZ, NVT, DAG.getZeroExtendInReg(Op, OVT));
- // Subtract off the extra leading bits in the bigger type.
- return DAG.getNode(ISD::SUB, NVT, Op,
- DAG.getConstant(MVT::getSizeInBits(NVT) -
- MVT::getSizeInBits(OVT), NVT));
-}
-
-SDOperand DAGTypeLegalizer::PromoteResult_CTPOP(SDNode *N) {
- SDOperand Op = GetPromotedOp(N->getOperand(0));
- MVT::ValueType OVT = N->getValueType(0);
- MVT::ValueType NVT = Op.getValueType();
- // Zero extend to the promoted type and do the count there.
- return DAG.getNode(ISD::CTPOP, NVT, DAG.getZeroExtendInReg(Op, OVT));
-}
-
-SDOperand DAGTypeLegalizer::PromoteResult_CTTZ(SDNode *N) {
- SDOperand Op = GetPromotedOp(N->getOperand(0));
- MVT::ValueType OVT = N->getValueType(0);
- MVT::ValueType NVT = Op.getValueType();
- // The count is the same in the promoted type except if the original
- // value was zero. This can be handled by setting the bit just off
- // the top of the original type.
- Op = DAG.getNode(ISD::OR, NVT, Op,
- // FIXME: Do this using an APINT constant.
- DAG.getConstant(1UL << MVT::getSizeInBits(OVT), NVT));
- return DAG.getNode(ISD::CTTZ, NVT, Op);
-}
-
-SDOperand DAGTypeLegalizer::PromoteResult_EXTRACT_VECTOR_ELT(SDNode *N) {
- MVT::ValueType OldVT = N->getValueType(0);
- SDOperand OldVec = N->getOperand(0);
- unsigned OldElts = MVT::getVectorNumElements(OldVec.getValueType());
-
- if (OldElts == 1) {
- assert(!isTypeLegal(OldVec.getValueType()) &&
- "Legal one-element vector of a type needing promotion!");
- // It is tempting to follow GetScalarizedOp by a call to GetPromotedOp,
- // but this would be wrong because the scalarized value may not yet have
- // been processed.
- return DAG.getNode(ISD::ANY_EXTEND, TLI.getTypeToTransformTo(OldVT),
- GetScalarizedOp(OldVec));
- }
-
- // Convert to a vector half as long with an element type of twice the width,
- // for example <4 x i16> -> <2 x i32>.
- assert(!(OldElts & 1) && "Odd length vectors not supported!");
- MVT::ValueType NewVT = MVT::getIntegerType(2 * MVT::getSizeInBits(OldVT));
- assert(!MVT::isExtendedVT(OldVT) && !MVT::isExtendedVT(NewVT));
-
- SDOperand NewVec = DAG.getNode(ISD::BIT_CONVERT,
- MVT::getVectorType(NewVT, OldElts / 2),
- OldVec);
-
- // Extract the element at OldIdx / 2 from the new vector.
- SDOperand OldIdx = N->getOperand(1);
- SDOperand NewIdx = DAG.getNode(ISD::SRL, OldIdx.getValueType(), OldIdx,
- DAG.getConstant(1, TLI.getShiftAmountTy()));
- SDOperand Elt = DAG.getNode(ISD::EXTRACT_VECTOR_ELT, NewVT, NewVec, NewIdx);
-
- // Select the appropriate half of the element: Lo if OldIdx was even,
- // Hi if it was odd.
- SDOperand Lo = Elt;
- SDOperand Hi = DAG.getNode(ISD::SRL, NewVT, Elt,
- DAG.getConstant(MVT::getSizeInBits(OldVT),
- TLI.getShiftAmountTy()));
- if (TLI.isBigEndian())
- std::swap(Lo, Hi);
-
- SDOperand Odd = DAG.getNode(ISD::AND, OldIdx.getValueType(), OldIdx,
- DAG.getConstant(1, TLI.getShiftAmountTy()));
- return DAG.getNode(ISD::SELECT, NewVT, Odd, Hi, Lo);
-}
-
-//===----------------------------------------------------------------------===//
-// Operand Promotion
-//===----------------------------------------------------------------------===//
-
-/// PromoteOperand - This method is called when the specified operand of the
-/// specified node is found to need promotion. At this point, all of the result
-/// types of the node are known to be legal, but other operands of the node may
-/// need promotion or expansion as well as the specified one.
-bool DAGTypeLegalizer::PromoteOperand(SDNode *N, unsigned OpNo) {
- DEBUG(cerr << "Promote node operand: "; N->dump(&DAG); cerr << "\n");
- SDOperand Res;
- switch (N->getOpcode()) {
- default:
-#ifndef NDEBUG
- cerr << "PromoteOperand Op #" << OpNo << ": ";
- N->dump(&DAG); cerr << "\n";
-#endif
- assert(0 && "Do not know how to promote this operator's operand!");
- abort();
-
- case ISD::ANY_EXTEND: Res = PromoteOperand_ANY_EXTEND(N); break;
- case ISD::ZERO_EXTEND: Res = PromoteOperand_ZERO_EXTEND(N); break;
- case ISD::SIGN_EXTEND: Res = PromoteOperand_SIGN_EXTEND(N); break;
- case ISD::TRUNCATE: Res = PromoteOperand_TRUNCATE(N); break;
- case ISD::FP_EXTEND: Res = PromoteOperand_FP_EXTEND(N); break;
- case ISD::FP_ROUND: Res = PromoteOperand_FP_ROUND(N); break;
- case ISD::SINT_TO_FP:
- case ISD::UINT_TO_FP: Res = PromoteOperand_INT_TO_FP(N); break;
- case ISD::BUILD_PAIR: Res = PromoteOperand_BUILD_PAIR(N); break;
-
- case ISD::SELECT: Res = PromoteOperand_SELECT(N, OpNo); break;
- case ISD::BRCOND: Res = PromoteOperand_BRCOND(N, OpNo); break;
- case ISD::BR_CC: Res = PromoteOperand_BR_CC(N, OpNo); break;
- case ISD::SETCC: Res = PromoteOperand_SETCC(N, OpNo); break;
-
- case ISD::STORE: Res = PromoteOperand_STORE(cast<StoreSDNode>(N),
- OpNo); break;
-
- case ISD::BUILD_VECTOR: Res = PromoteOperand_BUILD_VECTOR(N); break;
- case ISD::INSERT_VECTOR_ELT:
- Res = PromoteOperand_INSERT_VECTOR_ELT(N, OpNo);
- break;
-
- case ISD::RET: Res = PromoteOperand_RET(N, OpNo); break;
-
- case ISD::MEMBARRIER: Res = PromoteOperand_MEMBARRIER(N); break;
- }
-
- // If the result is null, the sub-method took care of registering results etc.
- if (!Res.Val) return false;
- // If the result is N, the sub-method updated N in place.
- if (Res.Val == N) {
- // Mark N as new and remark N and its operands. This allows us to correctly
- // revisit N if it needs another step of promotion and allows us to visit
- // any new operands to N.
- ReanalyzeNode(N);
- return true;
- }
-
- assert(Res.getValueType() == N->getValueType(0) && N->getNumValues() == 1 &&
- "Invalid operand expansion");
-
- ReplaceValueWith(SDOperand(N, 0), Res);
- return false;
-}
-
-SDOperand DAGTypeLegalizer::PromoteOperand_ANY_EXTEND(SDNode *N) {
- SDOperand Op = GetPromotedOp(N->getOperand(0));
- return DAG.getNode(ISD::ANY_EXTEND, N->getValueType(0), Op);
-}
-
-SDOperand DAGTypeLegalizer::PromoteOperand_ZERO_EXTEND(SDNode *N) {
- SDOperand Op = GetPromotedOp(N->getOperand(0));
- Op = DAG.getNode(ISD::ANY_EXTEND, N->getValueType(0), Op);
- return DAG.getZeroExtendInReg(Op, N->getOperand(0).getValueType());
-}
-
-SDOperand DAGTypeLegalizer::PromoteOperand_SIGN_EXTEND(SDNode *N) {
- SDOperand Op = GetPromotedOp(N->getOperand(0));
- Op = DAG.getNode(ISD::ANY_EXTEND, N->getValueType(0), Op);
- return DAG.getNode(ISD::SIGN_EXTEND_INREG, Op.getValueType(),
- Op, DAG.getValueType(N->getOperand(0).getValueType()));
-}
-
-SDOperand DAGTypeLegalizer::PromoteOperand_TRUNCATE(SDNode *N) {
- SDOperand Op = GetPromotedOp(N->getOperand(0));
- return DAG.getNode(ISD::TRUNCATE, N->getValueType(0), Op);
-}
-
-SDOperand DAGTypeLegalizer::PromoteOperand_FP_EXTEND(SDNode *N) {
- SDOperand Op = GetPromotedOp(N->getOperand(0));
- return DAG.getNode(ISD::FP_EXTEND, N->getValueType(0), Op);
-}
-
-SDOperand DAGTypeLegalizer::PromoteOperand_FP_ROUND(SDNode *N) {
- SDOperand Op = GetPromotedOp(N->getOperand(0));
- return DAG.getNode(ISD::FP_ROUND, N->getValueType(0), Op,
- DAG.getIntPtrConstant(0));
-}
-
-SDOperand DAGTypeLegalizer::PromoteOperand_INT_TO_FP(SDNode *N) {
- SDOperand In = GetPromotedOp(N->getOperand(0));
- MVT::ValueType OpVT = N->getOperand(0).getValueType();
- if (N->getOpcode() == ISD::UINT_TO_FP)
- In = DAG.getZeroExtendInReg(In, OpVT);
- else
- In = DAG.getNode(ISD::SIGN_EXTEND_INREG, In.getValueType(),
- In, DAG.getValueType(OpVT));
-
- return DAG.UpdateNodeOperands(SDOperand(N, 0), In);
-}
-
-SDOperand DAGTypeLegalizer::PromoteOperand_BUILD_PAIR(SDNode *N) {
- // Since the result type is legal, the operands must promote to it.
- MVT::ValueType OVT = N->getOperand(0).getValueType();
- SDOperand Lo = GetPromotedOp(N->getOperand(0));
- SDOperand Hi = GetPromotedOp(N->getOperand(1));
- assert(Lo.getValueType() == N->getValueType(0) && "Operand over promoted?");
-
- Lo = DAG.getZeroExtendInReg(Lo, OVT);
- Hi = DAG.getNode(ISD::SHL, N->getValueType(0), Hi,
- DAG.getConstant(MVT::getSizeInBits(OVT),
- TLI.getShiftAmountTy()));
- return DAG.getNode(ISD::OR, N->getValueType(0), Lo, Hi);
-}
-
-SDOperand DAGTypeLegalizer::PromoteOperand_SELECT(SDNode *N, unsigned OpNo) {
- assert(OpNo == 0 && "Only know how to promote condition");
- SDOperand Cond = GetPromotedOp(N->getOperand(0)); // Promote the condition.
-
- // The top bits of the promoted condition are not necessarily zero, ensure
- // that the value is properly zero extended.
- unsigned BitWidth = Cond.getValueSizeInBits();
- if (!DAG.MaskedValueIsZero(Cond,
- APInt::getHighBitsSet(BitWidth, BitWidth-1)))
- Cond = DAG.getZeroExtendInReg(Cond, MVT::i1);
-
- // The chain (Op#0) and basic block destination (Op#2) are always legal types.
- return DAG.UpdateNodeOperands(SDOperand(N, 0), Cond, N->getOperand(1),
- N->getOperand(2));
-}
-
-SDOperand DAGTypeLegalizer::PromoteOperand_BRCOND(SDNode *N, unsigned OpNo) {
- assert(OpNo == 1 && "only know how to promote condition");
- SDOperand Cond = GetPromotedOp(N->getOperand(1)); // Promote the condition.
-
- // The top bits of the promoted condition are not necessarily zero, ensure
- // that the value is properly zero extended.
- unsigned BitWidth = Cond.getValueSizeInBits();
- if (!DAG.MaskedValueIsZero(Cond,
- APInt::getHighBitsSet(BitWidth, BitWidth-1)))
- Cond = DAG.getZeroExtendInReg(Cond, MVT::i1);
-
- // The chain (Op#0) and basic block destination (Op#2) are always legal types.
- return DAG.UpdateNodeOperands(SDOperand(N, 0), N->getOperand(0), Cond,
- N->getOperand(2));
-}
-
-SDOperand DAGTypeLegalizer::PromoteOperand_BR_CC(SDNode *N, unsigned OpNo) {
- assert(OpNo == 2 && "Don't know how to promote this operand");
-
- SDOperand LHS = N->getOperand(2);
- SDOperand RHS = N->getOperand(3);
- PromoteSetCCOperands(LHS, RHS, cast<CondCodeSDNode>(N->getOperand(1))->get());
-
- // The chain (Op#0), CC (#1) and basic block destination (Op#4) are always
- // legal types.
- return DAG.UpdateNodeOperands(SDOperand(N, 0), N->getOperand(0),
- N->getOperand(1), LHS, RHS, N->getOperand(4));
-}
-
-SDOperand DAGTypeLegalizer::PromoteOperand_SETCC(SDNode *N, unsigned OpNo) {
- assert(OpNo == 0 && "Don't know how to promote this operand");
-
- SDOperand LHS = N->getOperand(0);
- SDOperand RHS = N->getOperand(1);
- PromoteSetCCOperands(LHS, RHS, cast<CondCodeSDNode>(N->getOperand(2))->get());
-
- // The CC (#2) is always legal.
- return DAG.UpdateNodeOperands(SDOperand(N, 0), LHS, RHS, N->getOperand(2));
-}
-
-/// PromoteSetCCOperands - Promote the operands of a comparison. This code is
-/// shared among BR_CC, SELECT_CC, and SETCC handlers.
-void DAGTypeLegalizer::PromoteSetCCOperands(SDOperand &NewLHS,SDOperand &NewRHS,
- ISD::CondCode CCCode) {
- MVT::ValueType VT = NewLHS.getValueType();
-
- // Get the promoted values.
- NewLHS = GetPromotedOp(NewLHS);
- NewRHS = GetPromotedOp(NewRHS);
-
- // If this is an FP compare, the operands have already been extended.
- if (!MVT::isInteger(NewLHS.getValueType()))
- return;
-
- // Otherwise, we have to insert explicit sign or zero extends. Note
- // that we could insert sign extends for ALL conditions, but zero extend
- // is cheaper on many machines (an AND instead of two shifts), so prefer
- // it.
- switch (CCCode) {
- default: assert(0 && "Unknown integer comparison!");
- case ISD::SETEQ:
- case ISD::SETNE:
- case ISD::SETUGE:
- case ISD::SETUGT:
- case ISD::SETULE:
- case ISD::SETULT:
- // ALL of these operations will work if we either sign or zero extend
- // the operands (including the unsigned comparisons!). Zero extend is
- // usually a simpler/cheaper operation, so prefer it.
- NewLHS = DAG.getZeroExtendInReg(NewLHS, VT);
- NewRHS = DAG.getZeroExtendInReg(NewRHS, VT);
- return;
- case ISD::SETGE:
- case ISD::SETGT:
- case ISD::SETLT:
- case ISD::SETLE:
- NewLHS = DAG.getNode(ISD::SIGN_EXTEND_INREG, NewLHS.getValueType(), NewLHS,
- DAG.getValueType(VT));
- NewRHS = DAG.getNode(ISD::SIGN_EXTEND_INREG, NewRHS.getValueType(), NewRHS,
- DAG.getValueType(VT));
- return;
- }
-}
-
-SDOperand DAGTypeLegalizer::PromoteOperand_STORE(StoreSDNode *N, unsigned OpNo){
- // FIXME: Add support for indexed stores.
- SDOperand Ch = N->getChain(), Ptr = N->getBasePtr();
- int SVOffset = N->getSrcValueOffset();
- unsigned Alignment = N->getAlignment();
- bool isVolatile = N->isVolatile();
-
- SDOperand Val = GetPromotedOp(N->getValue()); // Get promoted value.
-
- assert(!N->isTruncatingStore() && "Cannot promote this store operand!");
-
- // Truncate the value and store the result.
- return DAG.getTruncStore(Ch, Val, Ptr, N->getSrcValue(),
- SVOffset, N->getMemoryVT(),
- isVolatile, Alignment);
-}
-
-SDOperand DAGTypeLegalizer::PromoteOperand_BUILD_VECTOR(SDNode *N) {
- // The vector type is legal but the element type is not. This implies
- // that the vector is a power-of-two in length and that the element
- // type does not have a strange size (eg: it is not i1).
- MVT::ValueType VecVT = N->getValueType(0);
- unsigned NumElts = MVT::getVectorNumElements(VecVT);
- assert(!(NumElts & 1) && "Legal vector of one illegal element?");
-
- // Build a vector of half the length out of elements of twice the bitwidth.
- // For example <4 x i16> -> <2 x i32>.
- MVT::ValueType OldVT = N->getOperand(0).getValueType();
- MVT::ValueType NewVT = MVT::getIntegerType(2 * MVT::getSizeInBits(OldVT));
- assert(!MVT::isExtendedVT(OldVT) && !MVT::isExtendedVT(NewVT));
-
- std::vector<SDOperand> NewElts;
- NewElts.reserve(NumElts/2);
-
- for (unsigned i = 0; i < NumElts; i += 2) {
- // Combine two successive elements into one promoted element.
- SDOperand Lo = N->getOperand(i);
- SDOperand Hi = N->getOperand(i+1);
- if (TLI.isBigEndian())
- std::swap(Lo, Hi);
- NewElts.push_back(JoinIntegers(Lo, Hi));
- }
-
- SDOperand NewVec = DAG.getNode(ISD::BUILD_VECTOR,
- MVT::getVectorType(NewVT, NewElts.size()),
- &NewElts[0], NewElts.size());
-
- // Convert the new vector to the old vector type.
- return DAG.getNode(ISD::BIT_CONVERT, VecVT, NewVec);
-}
-
-SDOperand DAGTypeLegalizer::PromoteOperand_INSERT_VECTOR_ELT(SDNode *N,
- unsigned OpNo) {
- if (OpNo == 1) {
- // Promote the inserted value. This is valid because the type does not
- // have to match the vector element type.
-
- // Check that any extra bits introduced will be truncated away.
- assert(MVT::getSizeInBits(N->getOperand(1).getValueType()) >=
- MVT::getSizeInBits(MVT::getVectorElementType(N->getValueType(0))) &&
- "Type of inserted value narrower than vector element type!");
- return DAG.UpdateNodeOperands(SDOperand(N, 0), N->getOperand(0),
- GetPromotedOp(N->getOperand(1)),
- N->getOperand(2));
- }
-
- assert(OpNo == 2 && "Different operand and result vector types?");
-
- // Promote the index.
- SDOperand Idx = N->getOperand(2);
- Idx = DAG.getZeroExtendInReg(GetPromotedOp(Idx), Idx.getValueType());
- return DAG.UpdateNodeOperands(SDOperand(N, 0), N->getOperand(0),
- N->getOperand(1), Idx);
-}
-
-SDOperand DAGTypeLegalizer::PromoteOperand_RET(SDNode *N, unsigned OpNo) {
- assert(!(OpNo & 1) && "Return values should be legally typed!");
- assert((N->getNumOperands() & 1) && "Wrong number of operands!");
-
- // It's a flag. Promote all the flags in one hit, as an optimization.
- SmallVector<SDOperand, 8> NewValues(N->getNumOperands());
- NewValues[0] = N->getOperand(0); // The chain
- for (unsigned i = 1, e = N->getNumOperands(); i < e; i += 2) {
- // The return value.
- NewValues[i] = N->getOperand(i);
-
- // The flag.
- SDOperand Flag = N->getOperand(i + 1);
- if (getTypeAction(Flag.getValueType()) == Promote)
- // The promoted value may have rubbish in the new bits, but that
- // doesn't matter because those bits aren't queried anyway.
- Flag = GetPromotedOp(Flag);
- NewValues[i + 1] = Flag;
- }
-
- return DAG.UpdateNodeOperands(SDOperand (N, 0),
- &NewValues[0], NewValues.size());
-}
-
-SDOperand DAGTypeLegalizer::PromoteOperand_MEMBARRIER(SDNode *N) {
- SDOperand NewOps[6];
- NewOps[0] = N->getOperand(0);
- for (unsigned i = 1; i < array_lengthof(NewOps); ++i) {
- SDOperand Flag = GetPromotedOp(N->getOperand(i));
- NewOps[i] = DAG.getZeroExtendInReg(Flag, MVT::i1);
- }
- return DAG.UpdateNodeOperands(SDOperand (N, 0), NewOps,
- array_lengthof(NewOps));
-}
diff --git a/release_23/lib/CodeGen/SelectionDAG/LegalizeTypesScalarize.cpp b/release_23/lib/CodeGen/SelectionDAG/LegalizeTypesScalarize.cpp
deleted file mode 100644
index d9ba99fb8963..000000000000
--- a/release_23/lib/CodeGen/SelectionDAG/LegalizeTypesScalarize.cpp
+++ /dev/null
@@ -1,233 +0,0 @@
-//===-- LegalizeTypesScalarize.cpp - Scalarization for LegalizeTypes ------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements scalarization support for LegalizeTypes. Scalarization
-// is the act of changing a computation in an invalid single-element vector type
-// to be a computation in its scalar element type. For example, implementing
-// <1 x f32> arithmetic in a scalar f32 register. This is needed as a base case
-// when scalarizing vector arithmetic like <4 x f32>, which eventually
-// decomposes to scalars if the target doesn't support v4f32 or v2f32 types.
-//
-//===----------------------------------------------------------------------===//
-
-#include "LegalizeTypes.h"
-using namespace llvm;
-
-//===----------------------------------------------------------------------===//
-// Result Vector Scalarization: <1 x ty> -> ty.
-//===----------------------------------------------------------------------===//
-
-void DAGTypeLegalizer::ScalarizeResult(SDNode *N, unsigned ResNo) {
- DEBUG(cerr << "Scalarize node result " << ResNo << ": "; N->dump(&DAG);
- cerr << "\n");
- SDOperand R = SDOperand();
-
- // FIXME: Custom lowering for scalarization?
-#if 0
- // See if the target wants to custom expand this node.
- if (TLI.getOperationAction(N->getOpcode(), N->getValueType(0)) ==
- TargetLowering::Custom) {
- // If the target wants to, allow it to lower this itself.
- if (SDNode *P = TLI.ExpandOperationResult(N, DAG)) {
- // Everything that once used N now uses P. We are guaranteed that the
- // result value types of N and the result value types of P match.
- ReplaceNodeWith(N, P);
- return;
- }
- }
-#endif
-
- switch (N->getOpcode()) {
- default:
-#ifndef NDEBUG
- cerr << "ScalarizeResult #" << ResNo << ": ";
- N->dump(&DAG); cerr << "\n";
-#endif
- assert(0 && "Do not know how to scalarize the result of this operator!");
- abort();
-
- case ISD::UNDEF: R = ScalarizeRes_UNDEF(N); break;
- case ISD::LOAD: R = ScalarizeRes_LOAD(cast<LoadSDNode>(N)); break;
- case ISD::ADD:
- case ISD::FADD:
- case ISD::SUB:
- case ISD::FSUB:
- case ISD::MUL:
- case ISD::FMUL:
- case ISD::SDIV:
- case ISD::UDIV:
- case ISD::FDIV:
- case ISD::SREM:
- case ISD::UREM:
- case ISD::FREM:
- case ISD::FPOW:
- case ISD::AND:
- case ISD::OR:
- case ISD::XOR: R = ScalarizeRes_BinOp(N); break;
- case ISD::FNEG:
- case ISD::FABS:
- case ISD::FSQRT:
- case ISD::FSIN:
- case ISD::FCOS: R = ScalarizeRes_UnaryOp(N); break;
- case ISD::FPOWI: R = ScalarizeRes_FPOWI(N); break;
- case ISD::BUILD_VECTOR: R = N->getOperand(0); break;
- case ISD::INSERT_VECTOR_ELT: R = ScalarizeRes_INSERT_VECTOR_ELT(N); break;
- case ISD::VECTOR_SHUFFLE: R = ScalarizeRes_VECTOR_SHUFFLE(N); break;
- case ISD::BIT_CONVERT: R = ScalarizeRes_BIT_CONVERT(N); break;
- case ISD::SELECT: R = ScalarizeRes_SELECT(N); break;
- }
-
- // If R is null, the sub-method took care of registering the result.
- if (R.Val)
- SetScalarizedOp(SDOperand(N, ResNo), R);
-}
-
-SDOperand DAGTypeLegalizer::ScalarizeRes_UNDEF(SDNode *N) {
- return DAG.getNode(ISD::UNDEF, MVT::getVectorElementType(N->getValueType(0)));
-}
-
-SDOperand DAGTypeLegalizer::ScalarizeRes_LOAD(LoadSDNode *N) {
- // FIXME: Add support for indexed loads.
- SDOperand Result = DAG.getLoad(MVT::getVectorElementType(N->getValueType(0)),
- N->getChain(), N->getBasePtr(),
- N->getSrcValue(), N->getSrcValueOffset(),
- N->isVolatile(), N->getAlignment());
-
- // Legalized the chain result - switch anything that used the old chain to
- // use the new one.
- ReplaceValueWith(SDOperand(N, 1), Result.getValue(1));
- return Result;
-}
-
-SDOperand DAGTypeLegalizer::ScalarizeRes_BinOp(SDNode *N) {
- SDOperand LHS = GetScalarizedOp(N->getOperand(0));
- SDOperand RHS = GetScalarizedOp(N->getOperand(1));
- return DAG.getNode(N->getOpcode(), LHS.getValueType(), LHS, RHS);
-}
-
-SDOperand DAGTypeLegalizer::ScalarizeRes_UnaryOp(SDNode *N) {
- SDOperand Op = GetScalarizedOp(N->getOperand(0));
- return DAG.getNode(N->getOpcode(), Op.getValueType(), Op);
-}
-
-SDOperand DAGTypeLegalizer::ScalarizeRes_FPOWI(SDNode *N) {
- SDOperand Op = GetScalarizedOp(N->getOperand(0));
- return DAG.getNode(ISD::FPOWI, Op.getValueType(), Op, N->getOperand(1));
-}
-
-SDOperand DAGTypeLegalizer::ScalarizeRes_INSERT_VECTOR_ELT(SDNode *N) {
- // The value to insert may have a wider type than the vector element type,
- // so be sure to truncate it to the element type if necessary.
- SDOperand Op = N->getOperand(1);
- MVT::ValueType EltVT = MVT::getVectorElementType(N->getValueType(0));
- if (MVT::getSizeInBits(Op.getValueType()) > MVT::getSizeInBits(EltVT))
- Op = DAG.getNode(ISD::TRUNCATE, EltVT, Op);
- assert(Op.getValueType() == EltVT && "Invalid type for inserted value!");
- return Op;
-}
-
-SDOperand DAGTypeLegalizer::ScalarizeRes_VECTOR_SHUFFLE(SDNode *N) {
- // Figure out if the scalar is the LHS or RHS and return it.
- SDOperand EltNum = N->getOperand(2).getOperand(0);
- unsigned Op = cast<ConstantSDNode>(EltNum)->getValue() != 0;
- return GetScalarizedOp(N->getOperand(Op));
-}
-
-SDOperand DAGTypeLegalizer::ScalarizeRes_BIT_CONVERT(SDNode *N) {
- MVT::ValueType NewVT = MVT::getVectorElementType(N->getValueType(0));
- return DAG.getNode(ISD::BIT_CONVERT, NewVT, N->getOperand(0));
-}
-
-SDOperand DAGTypeLegalizer::ScalarizeRes_SELECT(SDNode *N) {
- SDOperand LHS = GetScalarizedOp(N->getOperand(1));
- return DAG.getNode(ISD::SELECT, LHS.getValueType(), N->getOperand(0), LHS,
- GetScalarizedOp(N->getOperand(2)));
-}
-
-
-//===----------------------------------------------------------------------===//
-// Operand Vector Scalarization <1 x ty> -> ty.
-//===----------------------------------------------------------------------===//
-
-bool DAGTypeLegalizer::ScalarizeOperand(SDNode *N, unsigned OpNo) {
- DEBUG(cerr << "Scalarize node operand " << OpNo << ": "; N->dump(&DAG);
- cerr << "\n");
- SDOperand Res(0, 0);
-
- // FIXME: Should we support custom lowering for scalarization?
-#if 0
- if (TLI.getOperationAction(N->getOpcode(), N->getValueType(0)) ==
- TargetLowering::Custom)
- Res = TLI.LowerOperation(SDOperand(N, 0), DAG);
-#endif
-
- if (Res.Val == 0) {
- switch (N->getOpcode()) {
- default:
-#ifndef NDEBUG
- cerr << "ScalarizeOperand Op #" << OpNo << ": ";
- N->dump(&DAG); cerr << "\n";
-#endif
- assert(0 && "Do not know how to scalarize this operator's operand!");
- abort();
-
- case ISD::BIT_CONVERT:
- Res = ScalarizeOp_BIT_CONVERT(N); break;
-
- case ISD::EXTRACT_VECTOR_ELT:
- Res = ScalarizeOp_EXTRACT_VECTOR_ELT(N); break;
-
- case ISD::STORE:
- Res = ScalarizeOp_STORE(cast<StoreSDNode>(N), OpNo); break;
- }
- }
-
- // If the result is null, the sub-method took care of registering results etc.
- if (!Res.Val) return false;
-
- // If the result is N, the sub-method updated N in place. Check to see if any
- // operands are new, and if so, mark them.
- if (Res.Val == N) {
- // Mark N as new and remark N and its operands. This allows us to correctly
- // revisit N if it needs another step of promotion and allows us to visit
- // any new operands to N.
- ReanalyzeNode(N);
- return true;
- }
-
- assert(Res.getValueType() == N->getValueType(0) && N->getNumValues() == 1 &&
- "Invalid operand expansion");
-
- ReplaceValueWith(SDOperand(N, 0), Res);
- return false;
-}
-
-/// ScalarizeOp_BIT_CONVERT - If the value to convert is a vector that needs
-/// to be scalarized, it must be <1 x ty>. Convert the element instead.
-SDOperand DAGTypeLegalizer::ScalarizeOp_BIT_CONVERT(SDNode *N) {
- SDOperand Elt = GetScalarizedOp(N->getOperand(0));
- return DAG.getNode(ISD::BIT_CONVERT, N->getValueType(0), Elt);
-}
-
-/// ScalarizeOp_EXTRACT_VECTOR_ELT - If the input is a vector that needs to be
-/// scalarized, it must be <1 x ty>, so just return the element, ignoring the
-/// index.
-SDOperand DAGTypeLegalizer::ScalarizeOp_EXTRACT_VECTOR_ELT(SDNode *N) {
- return GetScalarizedOp(N->getOperand(0));
-}
-
-/// ScalarizeOp_STORE - If the value to store is a vector that needs to be
-/// scalarized, it must be <1 x ty>. Just store the element.
-SDOperand DAGTypeLegalizer::ScalarizeOp_STORE(StoreSDNode *N, unsigned OpNo) {
- // FIXME: Add support for indexed stores.
- assert(OpNo == 1 && "Do not know how to scalarize this operand!");
- return DAG.getStore(N->getChain(), GetScalarizedOp(N->getOperand(1)),
- N->getBasePtr(), N->getSrcValue(), N->getSrcValueOffset(),
- N->isVolatile(), N->getAlignment());
-}
diff --git a/release_23/lib/CodeGen/SelectionDAG/LegalizeTypesSplit.cpp b/release_23/lib/CodeGen/SelectionDAG/LegalizeTypesSplit.cpp
deleted file mode 100644
index d1057c98cd09..000000000000
--- a/release_23/lib/CodeGen/SelectionDAG/LegalizeTypesSplit.cpp
+++ /dev/null
@@ -1,573 +0,0 @@
-//===-- LegalizeTypesSplit.cpp - Vector Splitting for LegalizeTypes -------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements vector splitting support for LegalizeTypes. Vector
-// splitting is the act of changing a computation in an invalid vector type to
-// be a computation in multiple vectors of a smaller type. For example,
-// implementing <128 x f32> operations in terms of two <64 x f32> operations.
-//
-//===----------------------------------------------------------------------===//
-
-#include "LegalizeTypes.h"
-using namespace llvm;
-
-/// GetSplitDestVTs - Compute the VTs needed for the low/hi parts of a vector
-/// type that needs to be split. This handles non-power of two vectors.
-static void GetSplitDestVTs(MVT::ValueType InVT,
- MVT::ValueType &Lo, MVT::ValueType &Hi) {
- MVT::ValueType NewEltVT = MVT::getVectorElementType(InVT);
- unsigned NumElements = MVT::getVectorNumElements(InVT);
- if ((NumElements & (NumElements-1)) == 0) { // Simple power of two vector.
- NumElements >>= 1;
- Lo = Hi = MVT::getVectorType(NewEltVT, NumElements);
- } else { // Non-power-of-two vectors.
- unsigned NewNumElts_Lo = 1 << Log2_32(NumElements);
- unsigned NewNumElts_Hi = NumElements - NewNumElts_Lo;
- Lo = MVT::getVectorType(NewEltVT, NewNumElts_Lo);
- Hi = MVT::getVectorType(NewEltVT, NewNumElts_Hi);
- }
-}
-
-
-//===----------------------------------------------------------------------===//
-// Result Vector Splitting
-//===----------------------------------------------------------------------===//
-
-/// SplitResult - This method is called when the specified result of the
-/// specified node is found to need vector splitting. At this point, the node
-/// may also have invalid operands or may have other results that need
-/// legalization, we just know that (at least) one result needs vector
-/// splitting.
-void DAGTypeLegalizer::SplitResult(SDNode *N, unsigned ResNo) {
- DEBUG(cerr << "Split node result: "; N->dump(&DAG); cerr << "\n");
- SDOperand Lo, Hi;
-
-#if 0
- // See if the target wants to custom expand this node.
- if (TLI.getOperationAction(N->getOpcode(), N->getValueType(0)) ==
- TargetLowering::Custom) {
- // If the target wants to, allow it to lower this itself.
- if (SDNode *P = TLI.ExpandOperationResult(N, DAG)) {
- // Everything that once used N now uses P. We are guaranteed that the
- // result value types of N and the result value types of P match.
- ReplaceNodeWith(N, P);
- return;
- }
- }
-#endif
-
- switch (N->getOpcode()) {
- default:
-#ifndef NDEBUG
- cerr << "SplitResult #" << ResNo << ": ";
- N->dump(&DAG); cerr << "\n";
-#endif
- assert(0 && "Do not know how to split the result of this operator!");
- abort();
-
- case ISD::UNDEF: SplitRes_UNDEF(N, Lo, Hi); break;
- case ISD::LOAD: SplitRes_LOAD(cast<LoadSDNode>(N), Lo, Hi); break;
- case ISD::BUILD_PAIR: SplitRes_BUILD_PAIR(N, Lo, Hi); break;
- case ISD::INSERT_VECTOR_ELT:SplitRes_INSERT_VECTOR_ELT(N, Lo, Hi); break;
- case ISD::VECTOR_SHUFFLE: SplitRes_VECTOR_SHUFFLE(N, Lo, Hi); break;
- case ISD::BUILD_VECTOR: SplitRes_BUILD_VECTOR(N, Lo, Hi); break;
- case ISD::CONCAT_VECTORS: SplitRes_CONCAT_VECTORS(N, Lo, Hi); break;
- case ISD::BIT_CONVERT: SplitRes_BIT_CONVERT(N, Lo, Hi); break;
- case ISD::CTTZ:
- case ISD::CTLZ:
- case ISD::CTPOP:
- case ISD::FNEG:
- case ISD::FABS:
- case ISD::FSQRT:
- case ISD::FSIN:
- case ISD::FCOS:
- case ISD::FP_TO_SINT:
- case ISD::FP_TO_UINT:
- case ISD::SINT_TO_FP:
- case ISD::UINT_TO_FP: SplitRes_UnOp(N, Lo, Hi); break;
- case ISD::ADD:
- case ISD::SUB:
- case ISD::MUL:
- case ISD::FADD:
- case ISD::FSUB:
- case ISD::FMUL:
- case ISD::SDIV:
- case ISD::UDIV:
- case ISD::FDIV:
- case ISD::FPOW:
- case ISD::AND:
- case ISD::OR:
- case ISD::XOR:
- case ISD::UREM:
- case ISD::SREM:
- case ISD::FREM: SplitRes_BinOp(N, Lo, Hi); break;
- case ISD::FPOWI: SplitRes_FPOWI(N, Lo, Hi); break;
- case ISD::SELECT: SplitRes_SELECT(N, Lo, Hi); break;
- }
-
- // If Lo/Hi is null, the sub-method took care of registering results etc.
- if (Lo.Val)
- SetSplitOp(SDOperand(N, ResNo), Lo, Hi);
-}
-
-void DAGTypeLegalizer::SplitRes_UNDEF(SDNode *N, SDOperand &Lo, SDOperand &Hi) {
- MVT::ValueType LoVT, HiVT;
- GetSplitDestVTs(N->getValueType(0), LoVT, HiVT);
-
- Lo = DAG.getNode(ISD::UNDEF, LoVT);
- Hi = DAG.getNode(ISD::UNDEF, HiVT);
-}
-
-void DAGTypeLegalizer::SplitRes_LOAD(LoadSDNode *LD,
- SDOperand &Lo, SDOperand &Hi) {
- // FIXME: Add support for indexed loads.
- MVT::ValueType LoVT, HiVT;
- GetSplitDestVTs(LD->getValueType(0), LoVT, HiVT);
-
- SDOperand Ch = LD->getChain();
- SDOperand Ptr = LD->getBasePtr();
- const Value *SV = LD->getSrcValue();
- int SVOffset = LD->getSrcValueOffset();
- unsigned Alignment = LD->getAlignment();
- bool isVolatile = LD->isVolatile();
-
- Lo = DAG.getLoad(LoVT, Ch, Ptr, SV, SVOffset, isVolatile, Alignment);
- unsigned IncrementSize = MVT::getSizeInBits(LoVT)/8;
- Ptr = DAG.getNode(ISD::ADD, Ptr.getValueType(), Ptr,
- DAG.getIntPtrConstant(IncrementSize));
- SVOffset += IncrementSize;
- Alignment = MinAlign(Alignment, IncrementSize);
- Hi = DAG.getLoad(HiVT, Ch, Ptr, SV, SVOffset, isVolatile, Alignment);
-
- // Build a factor node to remember that this load is independent of the
- // other one.
- SDOperand TF = DAG.getNode(ISD::TokenFactor, MVT::Other, Lo.getValue(1),
- Hi.getValue(1));
-
- // Legalized the chain result - switch anything that used the old chain to
- // use the new one.
- ReplaceValueWith(SDOperand(LD, 1), TF);
-}
-
-void DAGTypeLegalizer::SplitRes_BUILD_PAIR(SDNode *N, SDOperand &Lo,
- SDOperand &Hi) {
- Lo = N->getOperand(0);
- Hi = N->getOperand(1);
-}
-
-void DAGTypeLegalizer::SplitRes_INSERT_VECTOR_ELT(SDNode *N, SDOperand &Lo,
- SDOperand &Hi) {
- GetSplitOp(N->getOperand(0), Lo, Hi);
- unsigned Index = cast<ConstantSDNode>(N->getOperand(2))->getValue();
- SDOperand ScalarOp = N->getOperand(1);
- unsigned LoNumElts = MVT::getVectorNumElements(Lo.getValueType());
- if (Index < LoNumElts)
- Lo = DAG.getNode(ISD::INSERT_VECTOR_ELT, Lo.getValueType(), Lo, ScalarOp,
- N->getOperand(2));
- else
- Hi = DAG.getNode(ISD::INSERT_VECTOR_ELT, Hi.getValueType(), Hi, ScalarOp,
- DAG.getIntPtrConstant(Index - LoNumElts));
-}
-
-void DAGTypeLegalizer::SplitRes_VECTOR_SHUFFLE(SDNode *N,
- SDOperand &Lo, SDOperand &Hi) {
- // Build the low part.
- SDOperand Mask = N->getOperand(2);
- SmallVector<SDOperand, 16> Ops;
- MVT::ValueType LoVT, HiVT;
- GetSplitDestVTs(N->getValueType(0), LoVT, HiVT);
- MVT::ValueType EltVT = MVT::getVectorElementType(LoVT);
- unsigned LoNumElts = MVT::getVectorNumElements(LoVT);
- unsigned NumElements = Mask.getNumOperands();
-
- // Insert all of the elements from the input that are needed. We use
- // buildvector of extractelement here because the input vectors will have
- // to be legalized, so this makes the code simpler.
- for (unsigned i = 0; i != LoNumElts; ++i) {
- unsigned Idx = cast<ConstantSDNode>(Mask.getOperand(i))->getValue();
- SDOperand InVec = N->getOperand(0);
- if (Idx >= NumElements) {
- InVec = N->getOperand(1);
- Idx -= NumElements;
- }
- Ops.push_back(DAG.getNode(ISD::EXTRACT_VECTOR_ELT, EltVT, InVec,
- DAG.getIntPtrConstant(Idx)));
- }
- Lo = DAG.getNode(ISD::BUILD_VECTOR, LoVT, &Ops[0], Ops.size());
- Ops.clear();
-
- for (unsigned i = LoNumElts; i != NumElements; ++i) {
- unsigned Idx = cast<ConstantSDNode>(Mask.getOperand(i))->getValue();
- SDOperand InVec = N->getOperand(0);
- if (Idx >= NumElements) {
- InVec = N->getOperand(1);
- Idx -= NumElements;
- }
- Ops.push_back(DAG.getNode(ISD::EXTRACT_VECTOR_ELT, EltVT, InVec,
- DAG.getIntPtrConstant(Idx)));
- }
- Hi = DAG.getNode(ISD::BUILD_VECTOR, HiVT, &Ops[0], Ops.size());
-}
-
-void DAGTypeLegalizer::SplitRes_BUILD_VECTOR(SDNode *N, SDOperand &Lo,
- SDOperand &Hi) {
- MVT::ValueType LoVT, HiVT;
- GetSplitDestVTs(N->getValueType(0), LoVT, HiVT);
- unsigned LoNumElts = MVT::getVectorNumElements(LoVT);
- SmallVector<SDOperand, 8> LoOps(N->op_begin(), N->op_begin()+LoNumElts);
- Lo = DAG.getNode(ISD::BUILD_VECTOR, LoVT, &LoOps[0], LoOps.size());
-
- SmallVector<SDOperand, 8> HiOps(N->op_begin()+LoNumElts, N->op_end());
- Hi = DAG.getNode(ISD::BUILD_VECTOR, HiVT, &HiOps[0], HiOps.size());
-}
-
-void DAGTypeLegalizer::SplitRes_CONCAT_VECTORS(SDNode *N,
- SDOperand &Lo, SDOperand &Hi) {
- // FIXME: Handle non-power-of-two vectors?
- unsigned NumSubvectors = N->getNumOperands() / 2;
- if (NumSubvectors == 1) {
- Lo = N->getOperand(0);
- Hi = N->getOperand(1);
- return;
- }
-
- MVT::ValueType LoVT, HiVT;
- GetSplitDestVTs(N->getValueType(0), LoVT, HiVT);
-
- SmallVector<SDOperand, 8> LoOps(N->op_begin(), N->op_begin()+NumSubvectors);
- Lo = DAG.getNode(ISD::CONCAT_VECTORS, LoVT, &LoOps[0], LoOps.size());
-
- SmallVector<SDOperand, 8> HiOps(N->op_begin()+NumSubvectors, N->op_end());
- Hi = DAG.getNode(ISD::CONCAT_VECTORS, HiVT, &HiOps[0], HiOps.size());
-}
-
-void DAGTypeLegalizer::SplitRes_BIT_CONVERT(SDNode *N,
- SDOperand &Lo, SDOperand &Hi) {
- // We know the result is a vector. The input may be either a vector or a
- // scalar value.
- MVT::ValueType LoVT, HiVT;
- GetSplitDestVTs(N->getValueType(0), LoVT, HiVT);
-
- SDOperand InOp = N->getOperand(0);
- MVT::ValueType InVT = InOp.getValueType();
-
- // Handle some special cases efficiently.
- switch (getTypeAction(InVT)) {
- default:
- assert(false && "Unknown type action!");
- case Legal:
- case FloatToInt:
- case Promote:
- case Scalarize:
- break;
- case Expand:
- // A scalar to vector conversion, where the scalar needs expansion.
- // If the vector is being split in two then we can just convert the
- // expanded pieces.
- if (LoVT == HiVT) {
- GetExpandedOp(InOp, Lo, Hi);
- if (TLI.isBigEndian())
- std::swap(Lo, Hi);
- Lo = DAG.getNode(ISD::BIT_CONVERT, LoVT, Lo);
- Hi = DAG.getNode(ISD::BIT_CONVERT, HiVT, Hi);
- return;
- }
- break;
- case Split:
- // If the input is a vector that needs to be split, convert each split
- // piece of the input now.
- GetSplitOp(InOp, Lo, Hi);
- Lo = DAG.getNode(ISD::BIT_CONVERT, LoVT, Lo);
- Hi = DAG.getNode(ISD::BIT_CONVERT, HiVT, Hi);
- return;
- }
-
- // In the general case, convert the input to an integer and split it by hand.
- MVT::ValueType LoIntVT = MVT::getIntegerType(MVT::getSizeInBits(LoVT));
- MVT::ValueType HiIntVT = MVT::getIntegerType(MVT::getSizeInBits(HiVT));
- if (TLI.isBigEndian())
- std::swap(LoIntVT, HiIntVT);
-
- SplitInteger(BitConvertToInteger(InOp), LoIntVT, HiIntVT, Lo, Hi);
-
- if (TLI.isBigEndian())
- std::swap(Lo, Hi);
- Lo = DAG.getNode(ISD::BIT_CONVERT, LoVT, Lo);
- Hi = DAG.getNode(ISD::BIT_CONVERT, HiVT, Hi);
-}
-
-void DAGTypeLegalizer::SplitRes_BinOp(SDNode *N, SDOperand &Lo, SDOperand &Hi) {
- SDOperand LHSLo, LHSHi;
- GetSplitOp(N->getOperand(0), LHSLo, LHSHi);
- SDOperand RHSLo, RHSHi;
- GetSplitOp(N->getOperand(1), RHSLo, RHSHi);
-
- Lo = DAG.getNode(N->getOpcode(), LHSLo.getValueType(), LHSLo, RHSLo);
- Hi = DAG.getNode(N->getOpcode(), LHSHi.getValueType(), LHSHi, RHSHi);
-}
-
-void DAGTypeLegalizer::SplitRes_UnOp(SDNode *N, SDOperand &Lo, SDOperand &Hi) {
- // Get the dest types. This doesn't always match input types, e.g. int_to_fp.
- MVT::ValueType LoVT, HiVT;
- GetSplitDestVTs(N->getValueType(0), LoVT, HiVT);
-
- GetSplitOp(N->getOperand(0), Lo, Hi);
- Lo = DAG.getNode(N->getOpcode(), LoVT, Lo);
- Hi = DAG.getNode(N->getOpcode(), HiVT, Hi);
-}
-
-void DAGTypeLegalizer::SplitRes_FPOWI(SDNode *N, SDOperand &Lo, SDOperand &Hi) {
- GetSplitOp(N->getOperand(0), Lo, Hi);
- Lo = DAG.getNode(ISD::FPOWI, Lo.getValueType(), Lo, N->getOperand(1));
- Hi = DAG.getNode(ISD::FPOWI, Lo.getValueType(), Hi, N->getOperand(1));
-}
-
-
-void DAGTypeLegalizer::SplitRes_SELECT(SDNode *N, SDOperand &Lo, SDOperand &Hi){
- SDOperand LL, LH, RL, RH;
- GetSplitOp(N->getOperand(1), LL, LH);
- GetSplitOp(N->getOperand(2), RL, RH);
-
- SDOperand Cond = N->getOperand(0);
- Lo = DAG.getNode(ISD::SELECT, LL.getValueType(), Cond, LL, RL);
- Hi = DAG.getNode(ISD::SELECT, LH.getValueType(), Cond, LH, RH);
-}
-
-
-//===----------------------------------------------------------------------===//
-// Operand Vector Splitting
-//===----------------------------------------------------------------------===//
-
-/// SplitOperand - This method is called when the specified operand of the
-/// specified node is found to need vector splitting. At this point, all of the
-/// result types of the node are known to be legal, but other operands of the
-/// node may need legalization as well as the specified one.
-bool DAGTypeLegalizer::SplitOperand(SDNode *N, unsigned OpNo) {
- DEBUG(cerr << "Split node operand: "; N->dump(&DAG); cerr << "\n");
- SDOperand Res(0, 0);
-
-#if 0
- if (TLI.getOperationAction(N->getOpcode(), N->getValueType(0)) ==
- TargetLowering::Custom)
- Res = TLI.LowerOperation(SDOperand(N, 0), DAG);
-#endif
-
- if (Res.Val == 0) {
- switch (N->getOpcode()) {
- default:
-#ifndef NDEBUG
- cerr << "SplitOperand Op #" << OpNo << ": ";
- N->dump(&DAG); cerr << "\n";
-#endif
- assert(0 && "Do not know how to split this operator's operand!");
- abort();
- case ISD::STORE: Res = SplitOp_STORE(cast<StoreSDNode>(N), OpNo); break;
- case ISD::RET: Res = SplitOp_RET(N, OpNo); break;
-
- case ISD::BIT_CONVERT: Res = SplitOp_BIT_CONVERT(N); break;
-
- case ISD::EXTRACT_VECTOR_ELT: Res = SplitOp_EXTRACT_VECTOR_ELT(N); break;
- case ISD::EXTRACT_SUBVECTOR: Res = SplitOp_EXTRACT_SUBVECTOR(N); break;
- case ISD::VECTOR_SHUFFLE: Res = SplitOp_VECTOR_SHUFFLE(N, OpNo); break;
- }
- }
-
- // If the result is null, the sub-method took care of registering results etc.
- if (!Res.Val) return false;
-
- // If the result is N, the sub-method updated N in place. Check to see if any
- // operands are new, and if so, mark them.
- if (Res.Val == N) {
- // Mark N as new and remark N and its operands. This allows us to correctly
- // revisit N if it needs another step of promotion and allows us to visit
- // any new operands to N.
- ReanalyzeNode(N);
- return true;
- }
-
- assert(Res.getValueType() == N->getValueType(0) && N->getNumValues() == 1 &&
- "Invalid operand expansion");
-
- ReplaceValueWith(SDOperand(N, 0), Res);
- return false;
-}
-
-SDOperand DAGTypeLegalizer::SplitOp_STORE(StoreSDNode *N, unsigned OpNo) {
- // FIXME: Add support for indexed stores.
- assert(OpNo == 1 && "Can only split the stored value");
-
- SDOperand Ch = N->getChain();
- SDOperand Ptr = N->getBasePtr();
- int SVOffset = N->getSrcValueOffset();
- unsigned Alignment = N->getAlignment();
- bool isVol = N->isVolatile();
- SDOperand Lo, Hi;
- GetSplitOp(N->getOperand(1), Lo, Hi);
-
- unsigned IncrementSize = MVT::getSizeInBits(Lo.getValueType())/8;
-
- Lo = DAG.getStore(Ch, Lo, Ptr, N->getSrcValue(), SVOffset, isVol, Alignment);
-
- // Increment the pointer to the other half.
- Ptr = DAG.getNode(ISD::ADD, Ptr.getValueType(), Ptr,
- DAG.getIntPtrConstant(IncrementSize));
-
- Hi = DAG.getStore(Ch, Hi, Ptr, N->getSrcValue(), SVOffset+IncrementSize,
- isVol, MinAlign(Alignment, IncrementSize));
- return DAG.getNode(ISD::TokenFactor, MVT::Other, Lo, Hi);
-}
-
-SDOperand DAGTypeLegalizer::SplitOp_RET(SDNode *N, unsigned OpNo) {
- assert(N->getNumOperands() == 3 &&"Can only handle ret of one vector so far");
- // FIXME: Returns of gcc generic vectors larger than a legal vector
- // type should be returned by reference!
- SDOperand Lo, Hi;
- GetSplitOp(N->getOperand(1), Lo, Hi);
-
- SDOperand Chain = N->getOperand(0); // The chain.
- SDOperand Sign = N->getOperand(2); // Signness
-
- return DAG.getNode(ISD::RET, MVT::Other, Chain, Lo, Sign, Hi, Sign);
-}
-
-SDOperand DAGTypeLegalizer::SplitOp_BIT_CONVERT(SDNode *N) {
- // For example, i64 = BIT_CONVERT v4i16 on alpha. Typically the vector will
- // end up being split all the way down to individual components. Convert the
- // split pieces into integers and reassemble.
- SDOperand Lo, Hi;
- GetSplitOp(N->getOperand(0), Lo, Hi);
- Lo = BitConvertToInteger(Lo);
- Hi = BitConvertToInteger(Hi);
-
- if (TLI.isBigEndian())
- std::swap(Lo, Hi);
-
- return DAG.getNode(ISD::BIT_CONVERT, N->getValueType(0),
- JoinIntegers(Lo, Hi));
-}
-
-SDOperand DAGTypeLegalizer::SplitOp_EXTRACT_VECTOR_ELT(SDNode *N) {
- SDOperand Vec = N->getOperand(0);
- SDOperand Idx = N->getOperand(1);
- MVT::ValueType VecVT = Vec.getValueType();
-
- if (isa<ConstantSDNode>(Idx)) {
- uint64_t IdxVal = cast<ConstantSDNode>(Idx)->getValue();
- assert(IdxVal < MVT::getVectorNumElements(VecVT) &&
- "Invalid vector index!");
-
- SDOperand Lo, Hi;
- GetSplitOp(Vec, Lo, Hi);
-
- uint64_t LoElts = MVT::getVectorNumElements(Lo.getValueType());
-
- if (IdxVal < LoElts)
- return DAG.UpdateNodeOperands(SDOperand(N, 0), Lo, Idx);
- else
- return DAG.UpdateNodeOperands(SDOperand(N, 0), Hi,
- DAG.getConstant(IdxVal - LoElts,
- Idx.getValueType()));
- }
-
- // Store the vector to the stack and load back the required element.
- SDOperand StackPtr = DAG.CreateStackTemporary(VecVT);
- SDOperand Store = DAG.getStore(DAG.getEntryNode(), Vec, StackPtr, NULL, 0);
-
- // Add the offset to the index.
- MVT::ValueType EltVT = MVT::getVectorElementType(VecVT);
- unsigned EltSize = MVT::getSizeInBits(EltVT)/8; // FIXME: should be ABI size.
- Idx = DAG.getNode(ISD::MUL, Idx.getValueType(), Idx,
- DAG.getConstant(EltSize, Idx.getValueType()));
-
- if (MVT::getSizeInBits(Idx.getValueType()) >
- MVT::getSizeInBits(TLI.getPointerTy()))
- Idx = DAG.getNode(ISD::TRUNCATE, TLI.getPointerTy(), Idx);
- else
- Idx = DAG.getNode(ISD::ZERO_EXTEND, TLI.getPointerTy(), Idx);
-
- StackPtr = DAG.getNode(ISD::ADD, Idx.getValueType(), Idx, StackPtr);
- return DAG.getLoad(EltVT, Store, StackPtr, NULL, 0);
-}
-
-SDOperand DAGTypeLegalizer::SplitOp_EXTRACT_SUBVECTOR(SDNode *N) {
- // We know that the extracted result type is legal. For now, assume the index
- // is a constant.
- MVT::ValueType SubVT = N->getValueType(0);
- SDOperand Idx = N->getOperand(1);
- SDOperand Lo, Hi;
- GetSplitOp(N->getOperand(0), Lo, Hi);
-
- uint64_t LoElts = MVT::getVectorNumElements(Lo.getValueType());
- uint64_t IdxVal = cast<ConstantSDNode>(Idx)->getValue();
-
- if (IdxVal < LoElts) {
- assert(IdxVal + MVT::getVectorNumElements(SubVT) <= LoElts &&
- "Extracted subvector crosses vector split!");
- return DAG.getNode(ISD::EXTRACT_SUBVECTOR, SubVT, Lo, Idx);
- } else {
- return DAG.getNode(ISD::EXTRACT_SUBVECTOR, SubVT, Hi,
- DAG.getConstant(IdxVal - LoElts, Idx.getValueType()));
- }
-}
-
-SDOperand DAGTypeLegalizer::SplitOp_VECTOR_SHUFFLE(SDNode *N, unsigned OpNo) {
- assert(OpNo == 2 && "Shuffle source type differs from result type?");
- SDOperand Mask = N->getOperand(2);
- unsigned MaskLength = MVT::getVectorNumElements(Mask.getValueType());
- unsigned LargestMaskEntryPlusOne = 2 * MaskLength;
- unsigned MinimumBitWidth = Log2_32_Ceil(LargestMaskEntryPlusOne);
-
- // Look for a legal vector type to place the mask values in.
- // Note that there may not be *any* legal vector-of-integer
- // type for which the element type is legal!
- for (MVT::SimpleValueType EltVT = MVT::FIRST_INTEGER_VALUETYPE;
- EltVT <= MVT::LAST_INTEGER_VALUETYPE;
- // Integer values types are consecutively numbered. Exploit this.
- EltVT = MVT::SimpleValueType(EltVT + 1)) {
-
- // Is the element type big enough to hold the values?
- if (MVT::getSizeInBits(EltVT) < MinimumBitWidth)
- // Nope.
- continue;
-
- // Is the vector type legal?
- MVT::ValueType VecVT = MVT::getVectorType(EltVT, MaskLength);
- if (!isTypeLegal(VecVT))
- // Nope.
- continue;
-
- // If the element type is not legal, find a larger legal type to use for
- // the BUILD_VECTOR operands. This is an ugly hack, but seems to work!
- // FIXME: The real solution is to change VECTOR_SHUFFLE into a variadic
- // node where the shuffle mask is a list of integer operands, #2 .. #2+n.
- for (MVT::SimpleValueType OpVT = EltVT; OpVT <= MVT::LAST_INTEGER_VALUETYPE;
- // Integer values types are consecutively numbered. Exploit this.
- OpVT = MVT::SimpleValueType(OpVT + 1)) {
- if (!isTypeLegal(OpVT))
- continue;
-
- // Success! Rebuild the vector using the legal types.
- SmallVector<SDOperand, 16> Ops(MaskLength);
- for (unsigned i = 0; i < MaskLength; ++i) {
- uint64_t Idx =
- cast<ConstantSDNode>(Mask.getOperand(i))->getValue();
- Ops[i] = DAG.getConstant(Idx, OpVT);
- }
- return DAG.UpdateNodeOperands(SDOperand(N,0),
- N->getOperand(0), N->getOperand(1),
- DAG.getNode(ISD::BUILD_VECTOR,
- VecVT, &Ops[0], Ops.size()));
- }
-
- // Continuing is pointless - failure is certain.
- break;
- }
- assert(false && "Failed to find an appropriate mask type!");
- return SDOperand(N, 0);
-}
diff --git a/release_23/lib/CodeGen/SelectionDAG/Makefile b/release_23/lib/CodeGen/SelectionDAG/Makefile
deleted file mode 100644
index b235e1311e87..000000000000
--- a/release_23/lib/CodeGen/SelectionDAG/Makefile
+++ /dev/null
@@ -1,15 +0,0 @@
-##===- lib/CodeGen/SelectionDAG/Makefile -------------------*- Makefile -*-===##
-#
-# The LLVM Compiler Infrastructure
-#
-# This file is distributed under the University of Illinois Open Source
-# License. See LICENSE.TXT for details.
-#
-##===----------------------------------------------------------------------===##
-LEVEL = ../../..
-LIBRARYNAME = LLVMSelectionDAG
-PARALLEL_DIRS =
-BUILD_ARCHIVE = 1
-DONT_BUILD_RELINKED = 1
-
-include $(LEVEL)/Makefile.common
diff --git a/release_23/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp b/release_23/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp
deleted file mode 100644
index b4958d6d9468..000000000000
--- a/release_23/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp
+++ /dev/null
@@ -1,1199 +0,0 @@
-//===---- ScheduleDAG.cpp - Implement the ScheduleDAG class ---------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This implements a simple two pass scheduler. The first pass attempts to push
-// backward any lengthy instructions and critical paths. The second pass packs
-// instructions into semi-optimal time slots.
-//
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "pre-RA-sched"
-#include "llvm/Constants.h"
-#include "llvm/Type.h"
-#include "llvm/CodeGen/ScheduleDAG.h"
-#include "llvm/CodeGen/MachineConstantPool.h"
-#include "llvm/CodeGen/MachineFunction.h"
-#include "llvm/CodeGen/MachineInstrBuilder.h"
-#include "llvm/CodeGen/MachineRegisterInfo.h"
-#include "llvm/Target/TargetData.h"
-#include "llvm/Target/TargetMachine.h"
-#include "llvm/Target/TargetInstrInfo.h"
-#include "llvm/Target/TargetLowering.h"
-#include "llvm/ADT/Statistic.h"
-#include "llvm/Support/CommandLine.h"
-#include "llvm/Support/Debug.h"
-#include "llvm/Support/MathExtras.h"
-using namespace llvm;
-
-STATISTIC(NumCommutes, "Number of instructions commuted");
-
-namespace {
- static cl::opt<bool>
- SchedLiveInCopies("schedule-livein-copies",
- cl::desc("Schedule copies of livein registers"),
- cl::init(false));
-}
-
-ScheduleDAG::ScheduleDAG(SelectionDAG &dag, MachineBasicBlock *bb,
- const TargetMachine &tm)
- : DAG(dag), BB(bb), TM(tm), MRI(BB->getParent()->getRegInfo()) {
- TII = TM.getInstrInfo();
- MF = &DAG.getMachineFunction();
- TRI = TM.getRegisterInfo();
- TLI = &DAG.getTargetLoweringInfo();
- ConstPool = BB->getParent()->getConstantPool();
-}
-
-/// CheckForPhysRegDependency - Check if the dependency between def and use of
-/// a specified operand is a physical register dependency. If so, returns the
-/// register and the cost of copying the register.
-static void CheckForPhysRegDependency(SDNode *Def, SDNode *Use, unsigned Op,
- const TargetRegisterInfo *TRI,
- const TargetInstrInfo *TII,
- unsigned &PhysReg, int &Cost) {
- if (Op != 2 || Use->getOpcode() != ISD::CopyToReg)
- return;
-
- unsigned Reg = cast<RegisterSDNode>(Use->getOperand(1))->getReg();
- if (TargetRegisterInfo::isVirtualRegister(Reg))
- return;
-
- unsigned ResNo = Use->getOperand(2).ResNo;
- if (Def->isTargetOpcode()) {
- const TargetInstrDesc &II = TII->get(Def->getTargetOpcode());
- if (ResNo >= II.getNumDefs() &&
- II.ImplicitDefs[ResNo - II.getNumDefs()] == Reg) {
- PhysReg = Reg;
- const TargetRegisterClass *RC =
- TRI->getPhysicalRegisterRegClass(Reg, Def->getValueType(ResNo));
- Cost = RC->getCopyCost();
- }
- }
-}
-
-SUnit *ScheduleDAG::Clone(SUnit *Old) {
- SUnit *SU = NewSUnit(Old->Node);
- SU->FlaggedNodes = Old->FlaggedNodes;
- SU->InstanceNo = SUnitMap[Old->Node].size();
- SU->Latency = Old->Latency;
- SU->isTwoAddress = Old->isTwoAddress;
- SU->isCommutable = Old->isCommutable;
- SU->hasPhysRegDefs = Old->hasPhysRegDefs;
- SUnitMap[Old->Node].push_back(SU);
- return SU;
-}
-
-
-/// BuildSchedUnits - Build SUnits from the selection dag that we are input.
-/// This SUnit graph is similar to the SelectionDAG, but represents flagged
-/// together nodes with a single SUnit.
-void ScheduleDAG::BuildSchedUnits() {
- // Reserve entries in the vector for each of the SUnits we are creating. This
- // ensure that reallocation of the vector won't happen, so SUnit*'s won't get
- // invalidated.
- SUnits.reserve(std::distance(DAG.allnodes_begin(), DAG.allnodes_end()));
-
- for (SelectionDAG::allnodes_iterator NI = DAG.allnodes_begin(),
- E = DAG.allnodes_end(); NI != E; ++NI) {
- if (isPassiveNode(NI)) // Leaf node, e.g. a TargetImmediate.
- continue;
-
- // If this node has already been processed, stop now.
- if (SUnitMap[NI].size()) continue;
-
- SUnit *NodeSUnit = NewSUnit(NI);
-
- // See if anything is flagged to this node, if so, add them to flagged
- // nodes. Nodes can have at most one flag input and one flag output. Flags
- // are required the be the last operand and result of a node.
-
- // Scan up, adding flagged preds to FlaggedNodes.
- SDNode *N = NI;
- if (N->getNumOperands() &&
- N->getOperand(N->getNumOperands()-1).getValueType() == MVT::Flag) {
- do {
- N = N->getOperand(N->getNumOperands()-1).Val;
- NodeSUnit->FlaggedNodes.push_back(N);
- SUnitMap[N].push_back(NodeSUnit);
- } while (N->getNumOperands() &&
- N->getOperand(N->getNumOperands()-1).getValueType()== MVT::Flag);
- std::reverse(NodeSUnit->FlaggedNodes.begin(),
- NodeSUnit->FlaggedNodes.end());
- }
-
- // Scan down, adding this node and any flagged succs to FlaggedNodes if they
- // have a user of the flag operand.
- N = NI;
- while (N->getValueType(N->getNumValues()-1) == MVT::Flag) {
- SDOperand FlagVal(N, N->getNumValues()-1);
-
- // There are either zero or one users of the Flag result.
- bool HasFlagUse = false;
- for (SDNode::use_iterator UI = N->use_begin(), E = N->use_end();
- UI != E; ++UI)
- if (FlagVal.isOperandOf(UI->getUser())) {
- HasFlagUse = true;
- NodeSUnit->FlaggedNodes.push_back(N);
- SUnitMap[N].push_back(NodeSUnit);
- N = UI->getUser();
- break;
- }
- if (!HasFlagUse) break;
- }
-
- // Now all flagged nodes are in FlaggedNodes and N is the bottom-most node.
- // Update the SUnit
- NodeSUnit->Node = N;
- SUnitMap[N].push_back(NodeSUnit);
-
- ComputeLatency(NodeSUnit);
- }
-
- // Pass 2: add the preds, succs, etc.
- for (unsigned su = 0, e = SUnits.size(); su != e; ++su) {
- SUnit *SU = &SUnits[su];
- SDNode *MainNode = SU->Node;
-
- if (MainNode->isTargetOpcode()) {
- unsigned Opc = MainNode->getTargetOpcode();
- const TargetInstrDesc &TID = TII->get(Opc);
- for (unsigned i = 0; i != TID.getNumOperands(); ++i) {
- if (TID.getOperandConstraint(i, TOI::TIED_TO) != -1) {
- SU->isTwoAddress = true;
- break;
- }
- }
- if (TID.isCommutable())
- SU->isCommutable = true;
- }
-
- // Find all predecessors and successors of the group.
- // Temporarily add N to make code simpler.
- SU->FlaggedNodes.push_back(MainNode);
-
- for (unsigned n = 0, e = SU->FlaggedNodes.size(); n != e; ++n) {
- SDNode *N = SU->FlaggedNodes[n];
- if (N->isTargetOpcode() &&
- TII->get(N->getTargetOpcode()).getImplicitDefs() &&
- CountResults(N) > TII->get(N->getTargetOpcode()).getNumDefs())
- SU->hasPhysRegDefs = true;
-
- for (unsigned i = 0, e = N->getNumOperands(); i != e; ++i) {
- SDNode *OpN = N->getOperand(i).Val;
- if (isPassiveNode(OpN)) continue; // Not scheduled.
- SUnit *OpSU = SUnitMap[OpN].front();
- assert(OpSU && "Node has no SUnit!");
- if (OpSU == SU) continue; // In the same group.
-
- MVT::ValueType OpVT = N->getOperand(i).getValueType();
- assert(OpVT != MVT::Flag && "Flagged nodes should be in same sunit!");
- bool isChain = OpVT == MVT::Other;
-
- unsigned PhysReg = 0;
- int Cost = 1;
- // Determine if this is a physical register dependency.
- CheckForPhysRegDependency(OpN, N, i, TRI, TII, PhysReg, Cost);
- SU->addPred(OpSU, isChain, false, PhysReg, Cost);
- }
- }
-
- // Remove MainNode from FlaggedNodes again.
- SU->FlaggedNodes.pop_back();
- }
-
- return;
-}
-
-void ScheduleDAG::ComputeLatency(SUnit *SU) {
- const InstrItineraryData &InstrItins = TM.getInstrItineraryData();
-
- // Compute the latency for the node. We use the sum of the latencies for
- // all nodes flagged together into this SUnit.
- if (InstrItins.isEmpty()) {
- // No latency information.
- SU->Latency = 1;
- } else {
- SU->Latency = 0;
- if (SU->Node->isTargetOpcode()) {
- unsigned SchedClass =
- TII->get(SU->Node->getTargetOpcode()).getSchedClass();
- const InstrStage *S = InstrItins.begin(SchedClass);
- const InstrStage *E = InstrItins.end(SchedClass);
- for (; S != E; ++S)
- SU->Latency += S->Cycles;
- }
- for (unsigned i = 0, e = SU->FlaggedNodes.size(); i != e; ++i) {
- SDNode *FNode = SU->FlaggedNodes[i];
- if (FNode->isTargetOpcode()) {
- unsigned SchedClass =TII->get(FNode->getTargetOpcode()).getSchedClass();
- const InstrStage *S = InstrItins.begin(SchedClass);
- const InstrStage *E = InstrItins.end(SchedClass);
- for (; S != E; ++S)
- SU->Latency += S->Cycles;
- }
- }
- }
-}
-
-/// CalculateDepths - compute depths using algorithms for the longest
-/// paths in the DAG
-void ScheduleDAG::CalculateDepths() {
- unsigned DAGSize = SUnits.size();
- std::vector<unsigned> InDegree(DAGSize);
- std::vector<SUnit*> WorkList;
- WorkList.reserve(DAGSize);
-
- // Initialize the data structures
- for (unsigned i = 0, e = DAGSize; i != e; ++i) {
- SUnit *SU = &SUnits[i];
- int NodeNum = SU->NodeNum;
- unsigned Degree = SU->Preds.size();
- InDegree[NodeNum] = Degree;
- SU->Depth = 0;
-
- // Is it a node without dependencies?
- if (Degree == 0) {
- assert(SU->Preds.empty() && "SUnit should have no predecessors");
- // Collect leaf nodes
- WorkList.push_back(SU);
- }
- }
-
- // Process nodes in the topological order
- while (!WorkList.empty()) {
- SUnit *SU = WorkList.back();
- WorkList.pop_back();
- unsigned &SUDepth = SU->Depth;
-
- // Use dynamic programming:
- // When current node is being processed, all of its dependencies
- // are already processed.
- // So, just iterate over all predecessors and take the longest path
- for (SUnit::const_pred_iterator I = SU->Preds.begin(), E = SU->Preds.end();
- I != E; ++I) {
- unsigned PredDepth = I->Dep->Depth;
- if (PredDepth+1 > SUDepth) {
- SUDepth = PredDepth + 1;
- }
- }
-
- // Update InDegrees of all nodes depending on current SUnit
- for (SUnit::const_succ_iterator I = SU->Succs.begin(), E = SU->Succs.end();
- I != E; ++I) {
- SUnit *SU = I->Dep;
- if (!--InDegree[SU->NodeNum])
- // If all dependencies of the node are processed already,
- // then the longest path for the node can be computed now
- WorkList.push_back(SU);
- }
- }
-}
-
-/// CalculateHeights - compute heights using algorithms for the longest
-/// paths in the DAG
-void ScheduleDAG::CalculateHeights() {
- unsigned DAGSize = SUnits.size();
- std::vector<unsigned> InDegree(DAGSize);
- std::vector<SUnit*> WorkList;
- WorkList.reserve(DAGSize);
-
- // Initialize the data structures
- for (unsigned i = 0, e = DAGSize; i != e; ++i) {
- SUnit *SU = &SUnits[i];
- int NodeNum = SU->NodeNum;
- unsigned Degree = SU->Succs.size();
- InDegree[NodeNum] = Degree;
- SU->Height = 0;
-
- // Is it a node without dependencies?
- if (Degree == 0) {
- assert(SU->Succs.empty() && "Something wrong");
- assert(WorkList.empty() && "Should be empty");
- // Collect leaf nodes
- WorkList.push_back(SU);
- }
- }
-
- // Process nodes in the topological order
- while (!WorkList.empty()) {
- SUnit *SU = WorkList.back();
- WorkList.pop_back();
- unsigned &SUHeight = SU->Height;
-
- // Use dynamic programming:
- // When current node is being processed, all of its dependencies
- // are already processed.
- // So, just iterate over all successors and take the longest path
- for (SUnit::const_succ_iterator I = SU->Succs.begin(), E = SU->Succs.end();
- I != E; ++I) {
- unsigned SuccHeight = I->Dep->Height;
- if (SuccHeight+1 > SUHeight) {
- SUHeight = SuccHeight + 1;
- }
- }
-
- // Update InDegrees of all nodes depending on current SUnit
- for (SUnit::const_pred_iterator I = SU->Preds.begin(), E = SU->Preds.end();
- I != E; ++I) {
- SUnit *SU = I->Dep;
- if (!--InDegree[SU->NodeNum])
- // If all dependencies of the node are processed already,
- // then the longest path for the node can be computed now
- WorkList.push_back(SU);
- }
- }
-}
-
-/// CountResults - The results of target nodes have register or immediate
-/// operands first, then an optional chain, and optional flag operands (which do
-/// not go into the resulting MachineInstr).
-unsigned ScheduleDAG::CountResults(SDNode *Node) {
- unsigned N = Node->getNumValues();
- while (N && Node->getValueType(N - 1) == MVT::Flag)
- --N;
- if (N && Node->getValueType(N - 1) == MVT::Other)
- --N; // Skip over chain result.
- return N;
-}
-
-/// CountOperands - The inputs to target nodes have any actual inputs first,
-/// followed by special operands that describe memory references, then an
-/// optional chain operand, then flag operands. Compute the number of
-/// actual operands that will go into the resulting MachineInstr.
-unsigned ScheduleDAG::CountOperands(SDNode *Node) {
- unsigned N = ComputeMemOperandsEnd(Node);
- while (N && isa<MemOperandSDNode>(Node->getOperand(N - 1).Val))
- --N; // Ignore MEMOPERAND nodes
- return N;
-}
-
-/// ComputeMemOperandsEnd - Find the index one past the last MemOperandSDNode
-/// operand
-unsigned ScheduleDAG::ComputeMemOperandsEnd(SDNode *Node) {
- unsigned N = Node->getNumOperands();
- while (N && Node->getOperand(N - 1).getValueType() == MVT::Flag)
- --N;
- if (N && Node->getOperand(N - 1).getValueType() == MVT::Other)
- --N; // Ignore chain if it exists.
- return N;
-}
-
-static const TargetRegisterClass *getInstrOperandRegClass(
- const TargetRegisterInfo *TRI,
- const TargetInstrInfo *TII,
- const TargetInstrDesc &II,
- unsigned Op) {
- if (Op >= II.getNumOperands()) {
- assert(II.isVariadic() && "Invalid operand # of instruction");
- return NULL;
- }
- if (II.OpInfo[Op].isLookupPtrRegClass())
- return TII->getPointerRegClass();
- return TRI->getRegClass(II.OpInfo[Op].RegClass);
-}
-
-void ScheduleDAG::EmitCopyFromReg(SDNode *Node, unsigned ResNo,
- unsigned InstanceNo, unsigned SrcReg,
- DenseMap<SDOperand, unsigned> &VRBaseMap) {
- unsigned VRBase = 0;
- if (TargetRegisterInfo::isVirtualRegister(SrcReg)) {
- // Just use the input register directly!
- if (InstanceNo > 0)
- VRBaseMap.erase(SDOperand(Node, ResNo));
- bool isNew = VRBaseMap.insert(std::make_pair(SDOperand(Node,ResNo),SrcReg));
- assert(isNew && "Node emitted out of order - early");
- return;
- }
-
- // If the node is only used by a CopyToReg and the dest reg is a vreg, use
- // the CopyToReg'd destination register instead of creating a new vreg.
- bool MatchReg = true;
- for (SDNode::use_iterator UI = Node->use_begin(), E = Node->use_end();
- UI != E; ++UI) {
- SDNode *Use = UI->getUser();
- bool Match = true;
- if (Use->getOpcode() == ISD::CopyToReg &&
- Use->getOperand(2).Val == Node &&
- Use->getOperand(2).ResNo == ResNo) {
- unsigned DestReg = cast<RegisterSDNode>(Use->getOperand(1))->getReg();
- if (TargetRegisterInfo::isVirtualRegister(DestReg)) {
- VRBase = DestReg;
- Match = false;
- } else if (DestReg != SrcReg)
- Match = false;
- } else {
- for (unsigned i = 0, e = Use->getNumOperands(); i != e; ++i) {
- SDOperand Op = Use->getOperand(i);
- if (Op.Val != Node || Op.ResNo != ResNo)
- continue;
- MVT::ValueType VT = Node->getValueType(Op.ResNo);
- if (VT != MVT::Other && VT != MVT::Flag)
- Match = false;
- }
- }
- MatchReg &= Match;
- if (VRBase)
- break;
- }
-
- const TargetRegisterClass *SrcRC = 0, *DstRC = 0;
- SrcRC = TRI->getPhysicalRegisterRegClass(SrcReg, Node->getValueType(ResNo));
-
- // Figure out the register class to create for the destreg.
- if (VRBase) {
- DstRC = MRI.getRegClass(VRBase);
- } else {
- DstRC = TLI->getRegClassFor(Node->getValueType(ResNo));
- }
-
- // If all uses are reading from the src physical register and copying the
- // register is either impossible or very expensive, then don't create a copy.
- if (MatchReg && SrcRC->getCopyCost() < 0) {
- VRBase = SrcReg;
- } else {
- // Create the reg, emit the copy.
- VRBase = MRI.createVirtualRegister(DstRC);
- TII->copyRegToReg(*BB, BB->end(), VRBase, SrcReg, DstRC, SrcRC);
- }
-
- if (InstanceNo > 0)
- VRBaseMap.erase(SDOperand(Node, ResNo));
- bool isNew = VRBaseMap.insert(std::make_pair(SDOperand(Node,ResNo), VRBase));
- assert(isNew && "Node emitted out of order - early");
-}
-
-/// getDstOfCopyToRegUse - If the only use of the specified result number of
-/// node is a CopyToReg, return its destination register. Return 0 otherwise.
-unsigned ScheduleDAG::getDstOfOnlyCopyToRegUse(SDNode *Node,
- unsigned ResNo) const {
- if (!Node->hasOneUse())
- return 0;
-
- SDNode *Use = Node->use_begin()->getUser();
- if (Use->getOpcode() == ISD::CopyToReg &&
- Use->getOperand(2).Val == Node &&
- Use->getOperand(2).ResNo == ResNo) {
- unsigned Reg = cast<RegisterSDNode>(Use->getOperand(1))->getReg();
- if (TargetRegisterInfo::isVirtualRegister(Reg))
- return Reg;
- }
- return 0;
-}
-
-void ScheduleDAG::CreateVirtualRegisters(SDNode *Node, MachineInstr *MI,
- const TargetInstrDesc &II,
- DenseMap<SDOperand, unsigned> &VRBaseMap) {
- assert(Node->getTargetOpcode() != TargetInstrInfo::IMPLICIT_DEF &&
- "IMPLICIT_DEF should have been handled as a special case elsewhere!");
-
- for (unsigned i = 0; i < II.getNumDefs(); ++i) {
- // If the specific node value is only used by a CopyToReg and the dest reg
- // is a vreg, use the CopyToReg'd destination register instead of creating
- // a new vreg.
- unsigned VRBase = 0;
- for (SDNode::use_iterator UI = Node->use_begin(), E = Node->use_end();
- UI != E; ++UI) {
- SDNode *Use = UI->getUser();
- if (Use->getOpcode() == ISD::CopyToReg &&
- Use->getOperand(2).Val == Node &&
- Use->getOperand(2).ResNo == i) {
- unsigned Reg = cast<RegisterSDNode>(Use->getOperand(1))->getReg();
- if (TargetRegisterInfo::isVirtualRegister(Reg)) {
- VRBase = Reg;
- MI->addOperand(MachineOperand::CreateReg(Reg, true));
- break;
- }
- }
- }
-
- // Create the result registers for this node and add the result regs to
- // the machine instruction.
- if (VRBase == 0) {
- const TargetRegisterClass *RC = getInstrOperandRegClass(TRI, TII, II, i);
- assert(RC && "Isn't a register operand!");
- VRBase = MRI.createVirtualRegister(RC);
- MI->addOperand(MachineOperand::CreateReg(VRBase, true));
- }
-
- bool isNew = VRBaseMap.insert(std::make_pair(SDOperand(Node,i), VRBase));
- assert(isNew && "Node emitted out of order - early");
- }
-}
-
-/// getVR - Return the virtual register corresponding to the specified result
-/// of the specified node.
-unsigned ScheduleDAG::getVR(SDOperand Op,
- DenseMap<SDOperand, unsigned> &VRBaseMap) {
- if (Op.isTargetOpcode() &&
- Op.getTargetOpcode() == TargetInstrInfo::IMPLICIT_DEF) {
- // Add an IMPLICIT_DEF instruction before every use.
- unsigned VReg = getDstOfOnlyCopyToRegUse(Op.Val, Op.ResNo);
- // IMPLICIT_DEF can produce any type of result so its TargetInstrDesc
- // does not include operand register class info.
- if (!VReg) {
- const TargetRegisterClass *RC = TLI->getRegClassFor(Op.getValueType());
- VReg = MRI.createVirtualRegister(RC);
- }
- BuildMI(BB, TII->get(TargetInstrInfo::IMPLICIT_DEF), VReg);
- return VReg;
- }
-
- DenseMap<SDOperand, unsigned>::iterator I = VRBaseMap.find(Op);
- assert(I != VRBaseMap.end() && "Node emitted out of order - late");
- return I->second;
-}
-
-
-/// AddOperand - Add the specified operand to the specified machine instr. II
-/// specifies the instruction information for the node, and IIOpNum is the
-/// operand number (in the II) that we are adding. IIOpNum and II are used for
-/// assertions only.
-void ScheduleDAG::AddOperand(MachineInstr *MI, SDOperand Op,
- unsigned IIOpNum,
- const TargetInstrDesc *II,
- DenseMap<SDOperand, unsigned> &VRBaseMap) {
- if (Op.isTargetOpcode()) {
- // Note that this case is redundant with the final else block, but we
- // include it because it is the most common and it makes the logic
- // simpler here.
- assert(Op.getValueType() != MVT::Other &&
- Op.getValueType() != MVT::Flag &&
- "Chain and flag operands should occur at end of operand list!");
- // Get/emit the operand.
- unsigned VReg = getVR(Op, VRBaseMap);
- const TargetInstrDesc &TID = MI->getDesc();
- bool isOptDef = IIOpNum < TID.getNumOperands() &&
- TID.OpInfo[IIOpNum].isOptionalDef();
- MI->addOperand(MachineOperand::CreateReg(VReg, isOptDef));
-
- // Verify that it is right.
- assert(TargetRegisterInfo::isVirtualRegister(VReg) && "Not a vreg?");
-#ifndef NDEBUG
- if (II) {
- // There may be no register class for this operand if it is a variadic
- // argument (RC will be NULL in this case). In this case, we just assume
- // the regclass is ok.
- const TargetRegisterClass *RC =
- getInstrOperandRegClass(TRI, TII, *II, IIOpNum);
- assert((RC || II->isVariadic()) && "Expected reg class info!");
- const TargetRegisterClass *VRC = MRI.getRegClass(VReg);
- if (RC && VRC != RC) {
- cerr << "Register class of operand and regclass of use don't agree!\n";
- cerr << "Operand = " << IIOpNum << "\n";
- cerr << "Op->Val = "; Op.Val->dump(&DAG); cerr << "\n";
- cerr << "MI = "; MI->print(cerr);
- cerr << "VReg = " << VReg << "\n";
- cerr << "VReg RegClass size = " << VRC->getSize()
- << ", align = " << VRC->getAlignment() << "\n";
- cerr << "Expected RegClass size = " << RC->getSize()
- << ", align = " << RC->getAlignment() << "\n";
- cerr << "Fatal error, aborting.\n";
- abort();
- }
- }
-#endif
- } else if (ConstantSDNode *C = dyn_cast<ConstantSDNode>(Op)) {
- MI->addOperand(MachineOperand::CreateImm(C->getValue()));
- } else if (ConstantFPSDNode *F = dyn_cast<ConstantFPSDNode>(Op)) {
- ConstantFP *CFP = ConstantFP::get(F->getValueAPF());
- MI->addOperand(MachineOperand::CreateFPImm(CFP));
- } else if (RegisterSDNode *R = dyn_cast<RegisterSDNode>(Op)) {
- MI->addOperand(MachineOperand::CreateReg(R->getReg(), false));
- } else if (GlobalAddressSDNode *TGA = dyn_cast<GlobalAddressSDNode>(Op)) {
- MI->addOperand(MachineOperand::CreateGA(TGA->getGlobal(),TGA->getOffset()));
- } else if (BasicBlockSDNode *BB = dyn_cast<BasicBlockSDNode>(Op)) {
- MI->addOperand(MachineOperand::CreateMBB(BB->getBasicBlock()));
- } else if (FrameIndexSDNode *FI = dyn_cast<FrameIndexSDNode>(Op)) {
- MI->addOperand(MachineOperand::CreateFI(FI->getIndex()));
- } else if (JumpTableSDNode *JT = dyn_cast<JumpTableSDNode>(Op)) {
- MI->addOperand(MachineOperand::CreateJTI(JT->getIndex()));
- } else if (ConstantPoolSDNode *CP = dyn_cast<ConstantPoolSDNode>(Op)) {
- int Offset = CP->getOffset();
- unsigned Align = CP->getAlignment();
- const Type *Type = CP->getType();
- // MachineConstantPool wants an explicit alignment.
- if (Align == 0) {
- Align = TM.getTargetData()->getPreferredTypeAlignmentShift(Type);
- if (Align == 0) {
- // Alignment of vector types. FIXME!
- Align = TM.getTargetData()->getABITypeSize(Type);
- Align = Log2_64(Align);
- }
- }
-
- unsigned Idx;
- if (CP->isMachineConstantPoolEntry())
- Idx = ConstPool->getConstantPoolIndex(CP->getMachineCPVal(), Align);
- else
- Idx = ConstPool->getConstantPoolIndex(CP->getConstVal(), Align);
- MI->addOperand(MachineOperand::CreateCPI(Idx, Offset));
- } else if (ExternalSymbolSDNode *ES = dyn_cast<ExternalSymbolSDNode>(Op)) {
- MI->addOperand(MachineOperand::CreateES(ES->getSymbol()));
- } else {
- assert(Op.getValueType() != MVT::Other &&
- Op.getValueType() != MVT::Flag &&
- "Chain and flag operands should occur at end of operand list!");
- unsigned VReg = getVR(Op, VRBaseMap);
- MI->addOperand(MachineOperand::CreateReg(VReg, false));
-
- // Verify that it is right. Note that the reg class of the physreg and the
- // vreg don't necessarily need to match, but the target copy insertion has
- // to be able to handle it. This handles things like copies from ST(0) to
- // an FP vreg on x86.
- assert(TargetRegisterInfo::isVirtualRegister(VReg) && "Not a vreg?");
- if (II && !II->isVariadic()) {
- assert(getInstrOperandRegClass(TRI, TII, *II, IIOpNum) &&
- "Don't have operand info for this instruction!");
- }
- }
-
-}
-
-void ScheduleDAG::AddMemOperand(MachineInstr *MI, const MachineMemOperand &MO) {
- MI->addMemOperand(MO);
-}
-
-// Returns the Register Class of a subregister
-static const TargetRegisterClass *getSubRegisterRegClass(
- const TargetRegisterClass *TRC,
- unsigned SubIdx) {
- // Pick the register class of the subregister
- TargetRegisterInfo::regclass_iterator I =
- TRC->subregclasses_begin() + SubIdx-1;
- assert(I < TRC->subregclasses_end() &&
- "Invalid subregister index for register class");
- return *I;
-}
-
-static const TargetRegisterClass *getSuperregRegisterClass(
- const TargetRegisterClass *TRC,
- unsigned SubIdx,
- MVT::ValueType VT) {
- // Pick the register class of the superegister for this type
- for (TargetRegisterInfo::regclass_iterator I = TRC->superregclasses_begin(),
- E = TRC->superregclasses_end(); I != E; ++I)
- if ((*I)->hasType(VT) && getSubRegisterRegClass(*I, SubIdx) == TRC)
- return *I;
- assert(false && "Couldn't find the register class");
- return 0;
-}
-
-/// EmitSubregNode - Generate machine code for subreg nodes.
-///
-void ScheduleDAG::EmitSubregNode(SDNode *Node,
- DenseMap<SDOperand, unsigned> &VRBaseMap) {
- unsigned VRBase = 0;
- unsigned Opc = Node->getTargetOpcode();
-
- // If the node is only used by a CopyToReg and the dest reg is a vreg, use
- // the CopyToReg'd destination register instead of creating a new vreg.
- for (SDNode::use_iterator UI = Node->use_begin(), E = Node->use_end();
- UI != E; ++UI) {
- SDNode *Use = UI->getUser();
- if (Use->getOpcode() == ISD::CopyToReg &&
- Use->getOperand(2).Val == Node) {
- unsigned DestReg = cast<RegisterSDNode>(Use->getOperand(1))->getReg();
- if (TargetRegisterInfo::isVirtualRegister(DestReg)) {
- VRBase = DestReg;
- break;
- }
- }
- }
-
- if (Opc == TargetInstrInfo::EXTRACT_SUBREG) {
- unsigned SubIdx = cast<ConstantSDNode>(Node->getOperand(1))->getValue();
-
- // Create the extract_subreg machine instruction.
- MachineInstr *MI = BuildMI(TII->get(TargetInstrInfo::EXTRACT_SUBREG));
-
- // Figure out the register class to create for the destreg.
- unsigned VReg = getVR(Node->getOperand(0), VRBaseMap);
- const TargetRegisterClass *TRC = MRI.getRegClass(VReg);
- const TargetRegisterClass *SRC = getSubRegisterRegClass(TRC, SubIdx);
-
- if (VRBase) {
- // Grab the destination register
- const TargetRegisterClass *DRC = MRI.getRegClass(VRBase);
- assert(SRC && DRC && SRC == DRC &&
- "Source subregister and destination must have the same class");
- } else {
- // Create the reg
- assert(SRC && "Couldn't find source register class");
- VRBase = MRI.createVirtualRegister(SRC);
- }
-
- // Add def, source, and subreg index
- MI->addOperand(MachineOperand::CreateReg(VRBase, true));
- AddOperand(MI, Node->getOperand(0), 0, 0, VRBaseMap);
- MI->addOperand(MachineOperand::CreateImm(SubIdx));
- BB->push_back(MI);
- } else if (Opc == TargetInstrInfo::INSERT_SUBREG ||
- Opc == TargetInstrInfo::SUBREG_TO_REG) {
- SDOperand N0 = Node->getOperand(0);
- SDOperand N1 = Node->getOperand(1);
- SDOperand N2 = Node->getOperand(2);
- unsigned SubReg = getVR(N1, VRBaseMap);
- unsigned SubIdx = cast<ConstantSDNode>(N2)->getValue();
-
-
- // Figure out the register class to create for the destreg.
- const TargetRegisterClass *TRC = 0;
- if (VRBase) {
- TRC = MRI.getRegClass(VRBase);
- } else {
- TRC = getSuperregRegisterClass(MRI.getRegClass(SubReg), SubIdx,
- Node->getValueType(0));
- assert(TRC && "Couldn't determine register class for insert_subreg");
- VRBase = MRI.createVirtualRegister(TRC); // Create the reg
- }
-
- // Create the insert_subreg or subreg_to_reg machine instruction.
- MachineInstr *MI = BuildMI(TII->get(Opc));
- MI->addOperand(MachineOperand::CreateReg(VRBase, true));
-
- // If creating a subreg_to_reg, then the first input operand
- // is an implicit value immediate, otherwise it's a register
- if (Opc == TargetInstrInfo::SUBREG_TO_REG) {
- const ConstantSDNode *SD = cast<ConstantSDNode>(N0);
- MI->addOperand(MachineOperand::CreateImm(SD->getValue()));
- } else
- AddOperand(MI, N0, 0, 0, VRBaseMap);
- // Add the subregster being inserted
- AddOperand(MI, N1, 0, 0, VRBaseMap);
- MI->addOperand(MachineOperand::CreateImm(SubIdx));
- BB->push_back(MI);
- } else
- assert(0 && "Node is not insert_subreg, extract_subreg, or subreg_to_reg");
-
- bool isNew = VRBaseMap.insert(std::make_pair(SDOperand(Node,0), VRBase));
- assert(isNew && "Node emitted out of order - early");
-}
-
-/// EmitNode - Generate machine code for an node and needed dependencies.
-///
-void ScheduleDAG::EmitNode(SDNode *Node, unsigned InstanceNo,
- DenseMap<SDOperand, unsigned> &VRBaseMap) {
- // If machine instruction
- if (Node->isTargetOpcode()) {
- unsigned Opc = Node->getTargetOpcode();
-
- // Handle subreg insert/extract specially
- if (Opc == TargetInstrInfo::EXTRACT_SUBREG ||
- Opc == TargetInstrInfo::INSERT_SUBREG ||
- Opc == TargetInstrInfo::SUBREG_TO_REG) {
- EmitSubregNode(Node, VRBaseMap);
- return;
- }
-
- if (Opc == TargetInstrInfo::IMPLICIT_DEF)
- // We want a unique VR for each IMPLICIT_DEF use.
- return;
-
- const TargetInstrDesc &II = TII->get(Opc);
- unsigned NumResults = CountResults(Node);
- unsigned NodeOperands = CountOperands(Node);
- unsigned MemOperandsEnd = ComputeMemOperandsEnd(Node);
- unsigned NumMIOperands = NodeOperands + NumResults;
- bool HasPhysRegOuts = (NumResults > II.getNumDefs()) &&
- II.getImplicitDefs() != 0;
-#ifndef NDEBUG
- assert((II.getNumOperands() == NumMIOperands ||
- HasPhysRegOuts || II.isVariadic()) &&
- "#operands for dag node doesn't match .td file!");
-#endif
-
- // Create the new machine instruction.
- MachineInstr *MI = BuildMI(II);
-
- // Add result register values for things that are defined by this
- // instruction.
- if (NumResults)
- CreateVirtualRegisters(Node, MI, II, VRBaseMap);
-
- // Emit all of the actual operands of this instruction, adding them to the
- // instruction as appropriate.
- for (unsigned i = 0; i != NodeOperands; ++i)
- AddOperand(MI, Node->getOperand(i), i+II.getNumDefs(), &II, VRBaseMap);
-
- // Emit all of the memory operands of this instruction
- for (unsigned i = NodeOperands; i != MemOperandsEnd; ++i)
- AddMemOperand(MI, cast<MemOperandSDNode>(Node->getOperand(i))->MO);
-
- // Commute node if it has been determined to be profitable.
- if (CommuteSet.count(Node)) {
- MachineInstr *NewMI = TII->commuteInstruction(MI);
- if (NewMI == 0)
- DOUT << "Sched: COMMUTING FAILED!\n";
- else {
- DOUT << "Sched: COMMUTED TO: " << *NewMI;
- if (MI != NewMI) {
- delete MI;
- MI = NewMI;
- }
- ++NumCommutes;
- }
- }
-
- if (II.usesCustomDAGSchedInsertionHook())
- // Insert this instruction into the basic block using a target
- // specific inserter which may returns a new basic block.
- BB = TLI->EmitInstrWithCustomInserter(MI, BB);
- else
- BB->push_back(MI);
-
- // Additional results must be an physical register def.
- if (HasPhysRegOuts) {
- for (unsigned i = II.getNumDefs(); i < NumResults; ++i) {
- unsigned Reg = II.getImplicitDefs()[i - II.getNumDefs()];
- if (Node->hasAnyUseOfValue(i))
- EmitCopyFromReg(Node, i, InstanceNo, Reg, VRBaseMap);
- }
- }
- } else {
- switch (Node->getOpcode()) {
- default:
-#ifndef NDEBUG
- Node->dump(&DAG);
-#endif
- assert(0 && "This target-independent node should have been selected!");
- break;
- case ISD::EntryToken:
- assert(0 && "EntryToken should have been excluded from the schedule!");
- break;
- case ISD::TokenFactor: // fall thru
- case ISD::LABEL:
- case ISD::DECLARE:
- case ISD::SRCVALUE:
- break;
- case ISD::CopyToReg: {
- unsigned SrcReg;
- SDOperand SrcVal = Node->getOperand(2);
- if (RegisterSDNode *R = dyn_cast<RegisterSDNode>(SrcVal))
- SrcReg = R->getReg();
- else
- SrcReg = getVR(SrcVal, VRBaseMap);
-
- unsigned DestReg = cast<RegisterSDNode>(Node->getOperand(1))->getReg();
- if (SrcReg == DestReg) // Coalesced away the copy? Ignore.
- break;
-
- const TargetRegisterClass *SrcTRC = 0, *DstTRC = 0;
- // Get the register classes of the src/dst.
- if (TargetRegisterInfo::isVirtualRegister(SrcReg))
- SrcTRC = MRI.getRegClass(SrcReg);
- else
- SrcTRC = TRI->getPhysicalRegisterRegClass(SrcReg,SrcVal.getValueType());
-
- if (TargetRegisterInfo::isVirtualRegister(DestReg))
- DstTRC = MRI.getRegClass(DestReg);
- else
- DstTRC = TRI->getPhysicalRegisterRegClass(DestReg,
- Node->getOperand(1).getValueType());
- TII->copyRegToReg(*BB, BB->end(), DestReg, SrcReg, DstTRC, SrcTRC);
- break;
- }
- case ISD::CopyFromReg: {
- unsigned SrcReg = cast<RegisterSDNode>(Node->getOperand(1))->getReg();
- EmitCopyFromReg(Node, 0, InstanceNo, SrcReg, VRBaseMap);
- break;
- }
- case ISD::INLINEASM: {
- unsigned NumOps = Node->getNumOperands();
- if (Node->getOperand(NumOps-1).getValueType() == MVT::Flag)
- --NumOps; // Ignore the flag operand.
-
- // Create the inline asm machine instruction.
- MachineInstr *MI = BuildMI(TII->get(TargetInstrInfo::INLINEASM));
-
- // Add the asm string as an external symbol operand.
- const char *AsmStr =
- cast<ExternalSymbolSDNode>(Node->getOperand(1))->getSymbol();
- MI->addOperand(MachineOperand::CreateES(AsmStr));
-
- // Add all of the operand registers to the instruction.
- for (unsigned i = 2; i != NumOps;) {
- unsigned Flags = cast<ConstantSDNode>(Node->getOperand(i))->getValue();
- unsigned NumVals = Flags >> 3;
-
- MI->addOperand(MachineOperand::CreateImm(Flags));
- ++i; // Skip the ID value.
-
- switch (Flags & 7) {
- default: assert(0 && "Bad flags!");
- case 1: // Use of register.
- for (; NumVals; --NumVals, ++i) {
- unsigned Reg = cast<RegisterSDNode>(Node->getOperand(i))->getReg();
- MI->addOperand(MachineOperand::CreateReg(Reg, false));
- }
- break;
- case 2: // Def of register.
- for (; NumVals; --NumVals, ++i) {
- unsigned Reg = cast<RegisterSDNode>(Node->getOperand(i))->getReg();
- MI->addOperand(MachineOperand::CreateReg(Reg, true));
- }
- break;
- case 3: { // Immediate.
- for (; NumVals; --NumVals, ++i) {
- if (ConstantSDNode *CS =
- dyn_cast<ConstantSDNode>(Node->getOperand(i))) {
- MI->addOperand(MachineOperand::CreateImm(CS->getValue()));
- } else if (GlobalAddressSDNode *GA =
- dyn_cast<GlobalAddressSDNode>(Node->getOperand(i))) {
- MI->addOperand(MachineOperand::CreateGA(GA->getGlobal(),
- GA->getOffset()));
- } else {
- BasicBlockSDNode *BB =cast<BasicBlockSDNode>(Node->getOperand(i));
- MI->addOperand(MachineOperand::CreateMBB(BB->getBasicBlock()));
- }
- }
- break;
- }
- case 4: // Addressing mode.
- // The addressing mode has been selected, just add all of the
- // operands to the machine instruction.
- for (; NumVals; --NumVals, ++i)
- AddOperand(MI, Node->getOperand(i), 0, 0, VRBaseMap);
- break;
- }
- }
- BB->push_back(MI);
- break;
- }
- }
- }
-}
-
-void ScheduleDAG::EmitNoop() {
- TII->insertNoop(*BB, BB->end());
-}
-
-void ScheduleDAG::EmitCrossRCCopy(SUnit *SU,
- DenseMap<SUnit*, unsigned> &VRBaseMap) {
- for (SUnit::const_pred_iterator I = SU->Preds.begin(), E = SU->Preds.end();
- I != E; ++I) {
- if (I->isCtrl) continue; // ignore chain preds
- if (!I->Dep->Node) {
- // Copy to physical register.
- DenseMap<SUnit*, unsigned>::iterator VRI = VRBaseMap.find(I->Dep);
- assert(VRI != VRBaseMap.end() && "Node emitted out of order - late");
- // Find the destination physical register.
- unsigned Reg = 0;
- for (SUnit::const_succ_iterator II = SU->Succs.begin(),
- EE = SU->Succs.end(); II != EE; ++II) {
- if (I->Reg) {
- Reg = I->Reg;
- break;
- }
- }
- assert(I->Reg && "Unknown physical register!");
- TII->copyRegToReg(*BB, BB->end(), Reg, VRI->second,
- SU->CopyDstRC, SU->CopySrcRC);
- } else {
- // Copy from physical register.
- assert(I->Reg && "Unknown physical register!");
- unsigned VRBase = MRI.createVirtualRegister(SU->CopyDstRC);
- bool isNew = VRBaseMap.insert(std::make_pair(SU, VRBase));
- assert(isNew && "Node emitted out of order - early");
- TII->copyRegToReg(*BB, BB->end(), VRBase, I->Reg,
- SU->CopyDstRC, SU->CopySrcRC);
- }
- break;
- }
-}
-
-/// EmitLiveInCopy - Emit a copy for a live in physical register. If the
-/// physical register has only a single copy use, then coalesced the copy
-/// if possible.
-void ScheduleDAG::EmitLiveInCopy(MachineBasicBlock *MBB,
- MachineBasicBlock::iterator &InsertPos,
- unsigned VirtReg, unsigned PhysReg,
- const TargetRegisterClass *RC,
- DenseMap<MachineInstr*, unsigned> &CopyRegMap){
- unsigned NumUses = 0;
- MachineInstr *UseMI = NULL;
- for (MachineRegisterInfo::use_iterator UI = MRI.use_begin(VirtReg),
- UE = MRI.use_end(); UI != UE; ++UI) {
- UseMI = &*UI;
- if (++NumUses > 1)
- break;
- }
-
- // If the number of uses is not one, or the use is not a move instruction,
- // don't coalesce. Also, only coalesce away a virtual register to virtual
- // register copy.
- bool Coalesced = false;
- unsigned SrcReg, DstReg;
- if (NumUses == 1 &&
- TII->isMoveInstr(*UseMI, SrcReg, DstReg) &&
- TargetRegisterInfo::isVirtualRegister(DstReg)) {
- VirtReg = DstReg;
- Coalesced = true;
- }
-
- // Now find an ideal location to insert the copy.
- MachineBasicBlock::iterator Pos = InsertPos;
- while (Pos != MBB->begin()) {
- MachineInstr *PrevMI = prior(Pos);
- DenseMap<MachineInstr*, unsigned>::iterator RI = CopyRegMap.find(PrevMI);
- // copyRegToReg might emit multiple instructions to do a copy.
- unsigned CopyDstReg = (RI == CopyRegMap.end()) ? 0 : RI->second;
- if (CopyDstReg && !TRI->regsOverlap(CopyDstReg, PhysReg))
- // This is what the BB looks like right now:
- // r1024 = mov r0
- // ...
- // r1 = mov r1024
- //
- // We want to insert "r1025 = mov r1". Inserting this copy below the
- // move to r1024 makes it impossible for that move to be coalesced.
- //
- // r1025 = mov r1
- // r1024 = mov r0
- // ...
- // r1 = mov 1024
- // r2 = mov 1025
- break; // Woot! Found a good location.
- --Pos;
- }
-
- TII->copyRegToReg(*MBB, Pos, VirtReg, PhysReg, RC, RC);
- CopyRegMap.insert(std::make_pair(prior(Pos), VirtReg));
- if (Coalesced) {
- if (&*InsertPos == UseMI) ++InsertPos;
- MBB->erase(UseMI);
- }
-}
-
-/// EmitLiveInCopies - If this is the first basic block in the function,
-/// and if it has live ins that need to be copied into vregs, emit the
-/// copies into the top of the block.
-void ScheduleDAG::EmitLiveInCopies(MachineBasicBlock *MBB) {
- DenseMap<MachineInstr*, unsigned> CopyRegMap;
- MachineBasicBlock::iterator InsertPos = MBB->begin();
- for (MachineRegisterInfo::livein_iterator LI = MRI.livein_begin(),
- E = MRI.livein_end(); LI != E; ++LI)
- if (LI->second) {
- const TargetRegisterClass *RC = MRI.getRegClass(LI->second);
- EmitLiveInCopy(MBB, InsertPos, LI->second, LI->first, RC, CopyRegMap);
- }
-}
-
-/// EmitSchedule - Emit the machine code in scheduled order.
-void ScheduleDAG::EmitSchedule() {
- bool isEntryBB = &MF->front() == BB;
-
- if (isEntryBB && !SchedLiveInCopies) {
- // If this is the first basic block in the function, and if it has live ins
- // that need to be copied into vregs, emit the copies into the top of the
- // block before emitting the code for the block.
- for (MachineRegisterInfo::livein_iterator LI = MRI.livein_begin(),
- E = MRI.livein_end(); LI != E; ++LI)
- if (LI->second) {
- const TargetRegisterClass *RC = MRI.getRegClass(LI->second);
- TII->copyRegToReg(*MF->begin(), MF->begin()->end(), LI->second,
- LI->first, RC, RC);
- }
- }
-
- // Finally, emit the code for all of the scheduled instructions.
- DenseMap<SDOperand, unsigned> VRBaseMap;
- DenseMap<SUnit*, unsigned> CopyVRBaseMap;
- for (unsigned i = 0, e = Sequence.size(); i != e; i++) {
- SUnit *SU = Sequence[i];
- if (!SU) {
- // Null SUnit* is a noop.
- EmitNoop();
- continue;
- }
- for (unsigned j = 0, ee = SU->FlaggedNodes.size(); j != ee; ++j)
- EmitNode(SU->FlaggedNodes[j], SU->InstanceNo, VRBaseMap);
- if (!SU->Node)
- EmitCrossRCCopy(SU, CopyVRBaseMap);
- else
- EmitNode(SU->Node, SU->InstanceNo, VRBaseMap);
- }
-
- if (isEntryBB && SchedLiveInCopies)
- EmitLiveInCopies(MF->begin());
-}
-
-/// dump - dump the schedule.
-void ScheduleDAG::dumpSchedule() const {
- for (unsigned i = 0, e = Sequence.size(); i != e; i++) {
- if (SUnit *SU = Sequence[i])
- SU->dump(&DAG);
- else
- cerr << "**** NOOP ****\n";
- }
-}
-
-
-/// Run - perform scheduling.
-///
-MachineBasicBlock *ScheduleDAG::Run() {
- Schedule();
- return BB;
-}
-
-/// SUnit - Scheduling unit. It's an wrapper around either a single SDNode or
-/// a group of nodes flagged together.
-void SUnit::dump(const SelectionDAG *G) const {
- cerr << "SU(" << NodeNum << "): ";
- if (Node)
- Node->dump(G);
- else
- cerr << "CROSS RC COPY ";
- cerr << "\n";
- if (FlaggedNodes.size() != 0) {
- for (unsigned i = 0, e = FlaggedNodes.size(); i != e; i++) {
- cerr << " ";
- FlaggedNodes[i]->dump(G);
- cerr << "\n";
- }
- }
-}
-
-void SUnit::dumpAll(const SelectionDAG *G) const {
- dump(G);
-
- cerr << " # preds left : " << NumPredsLeft << "\n";
- cerr << " # succs left : " << NumSuccsLeft << "\n";
- cerr << " Latency : " << Latency << "\n";
- cerr << " Depth : " << Depth << "\n";
- cerr << " Height : " << Height << "\n";
-
- if (Preds.size() != 0) {
- cerr << " Predecessors:\n";
- for (SUnit::const_succ_iterator I = Preds.begin(), E = Preds.end();
- I != E; ++I) {
- if (I->isCtrl)
- cerr << " ch #";
- else
- cerr << " val #";
- cerr << I->Dep << " - SU(" << I->Dep->NodeNum << ")";
- if (I->isSpecial)
- cerr << " *";
- cerr << "\n";
- }
- }
- if (Succs.size() != 0) {
- cerr << " Successors:\n";
- for (SUnit::const_succ_iterator I = Succs.begin(), E = Succs.end();
- I != E; ++I) {
- if (I->isCtrl)
- cerr << " ch #";
- else
- cerr << " val #";
- cerr << I->Dep << " - SU(" << I->Dep->NodeNum << ")";
- if (I->isSpecial)
- cerr << " *";
- cerr << "\n";
- }
- }
- cerr << "\n";
-}
diff --git a/release_23/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp b/release_23/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp
deleted file mode 100644
index c2fae2506794..000000000000
--- a/release_23/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp
+++ /dev/null
@@ -1,571 +0,0 @@
-//===---- ScheduleDAGList.cpp - Implement a list scheduler for isel DAG ---===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This implements a top-down list scheduler, using standard algorithms.
-// The basic approach uses a priority queue of available nodes to schedule.
-// One at a time, nodes are taken from the priority queue (thus in priority
-// order), checked for legality to schedule, and emitted if legal.
-//
-// Nodes may not be legal to schedule either due to structural hazards (e.g.
-// pipeline or resource constraints) or because an input to the instruction has
-// not completed execution.
-//
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "pre-RA-sched"
-#include "llvm/CodeGen/ScheduleDAG.h"
-#include "llvm/CodeGen/SchedulerRegistry.h"
-#include "llvm/CodeGen/SelectionDAGISel.h"
-#include "llvm/Target/TargetRegisterInfo.h"
-#include "llvm/Target/TargetData.h"
-#include "llvm/Target/TargetMachine.h"
-#include "llvm/Target/TargetInstrInfo.h"
-#include "llvm/Support/Debug.h"
-#include "llvm/Support/Compiler.h"
-#include "llvm/ADT/Statistic.h"
-#include <climits>
-#include <queue>
-using namespace llvm;
-
-STATISTIC(NumNoops , "Number of noops inserted");
-STATISTIC(NumStalls, "Number of pipeline stalls");
-
-static RegisterScheduler
- tdListDAGScheduler("list-td", " Top-down list scheduler",
- createTDListDAGScheduler);
-
-namespace {
-//===----------------------------------------------------------------------===//
-/// ScheduleDAGList - The actual list scheduler implementation. This supports
-/// top-down scheduling.
-///
-class VISIBILITY_HIDDEN ScheduleDAGList : public ScheduleDAG {
-private:
- /// AvailableQueue - The priority queue to use for the available SUnits.
- ///
- SchedulingPriorityQueue *AvailableQueue;
-
- /// PendingQueue - This contains all of the instructions whose operands have
- /// been issued, but their results are not ready yet (due to the latency of
- /// the operation). Once the operands becomes available, the instruction is
- /// added to the AvailableQueue. This keeps track of each SUnit and the
- /// number of cycles left to execute before the operation is available.
- std::vector<std::pair<unsigned, SUnit*> > PendingQueue;
-
- /// HazardRec - The hazard recognizer to use.
- HazardRecognizer *HazardRec;
-
-public:
- ScheduleDAGList(SelectionDAG &dag, MachineBasicBlock *bb,
- const TargetMachine &tm,
- SchedulingPriorityQueue *availqueue,
- HazardRecognizer *HR)
- : ScheduleDAG(dag, bb, tm),
- AvailableQueue(availqueue), HazardRec(HR) {
- }
-
- ~ScheduleDAGList() {
- delete HazardRec;
- delete AvailableQueue;
- }
-
- void Schedule();
-
-private:
- void ReleaseSucc(SUnit *SuccSU, bool isChain);
- void ScheduleNodeTopDown(SUnit *SU, unsigned CurCycle);
- void ListScheduleTopDown();
-};
-} // end anonymous namespace
-
-HazardRecognizer::~HazardRecognizer() {}
-
-
-/// Schedule - Schedule the DAG using list scheduling.
-void ScheduleDAGList::Schedule() {
- DOUT << "********** List Scheduling **********\n";
-
- // Build scheduling units.
- BuildSchedUnits();
-
- AvailableQueue->initNodes(SUnitMap, SUnits);
-
- ListScheduleTopDown();
-
- AvailableQueue->releaseState();
-
- DOUT << "*** Final schedule ***\n";
- DEBUG(dumpSchedule());
- DOUT << "\n";
-
- // Emit in scheduled order
- EmitSchedule();
-}
-
-//===----------------------------------------------------------------------===//
-// Top-Down Scheduling
-//===----------------------------------------------------------------------===//
-
-/// ReleaseSucc - Decrement the NumPredsLeft count of a successor. Add it to
-/// the PendingQueue if the count reaches zero.
-void ScheduleDAGList::ReleaseSucc(SUnit *SuccSU, bool isChain) {
- SuccSU->NumPredsLeft--;
-
- assert(SuccSU->NumPredsLeft >= 0 &&
- "List scheduling internal error");
-
- if (SuccSU->NumPredsLeft == 0) {
- // Compute how many cycles it will be before this actually becomes
- // available. This is the max of the start time of all predecessors plus
- // their latencies.
- unsigned AvailableCycle = 0;
- for (SUnit::pred_iterator I = SuccSU->Preds.begin(),
- E = SuccSU->Preds.end(); I != E; ++I) {
- // If this is a token edge, we don't need to wait for the latency of the
- // preceeding instruction (e.g. a long-latency load) unless there is also
- // some other data dependence.
- SUnit &Pred = *I->Dep;
- unsigned PredDoneCycle = Pred.Cycle;
- if (!I->isCtrl)
- PredDoneCycle += Pred.Latency;
- else if (Pred.Latency)
- PredDoneCycle += 1;
-
- AvailableCycle = std::max(AvailableCycle, PredDoneCycle);
- }
-
- PendingQueue.push_back(std::make_pair(AvailableCycle, SuccSU));
- }
-}
-
-/// ScheduleNodeTopDown - Add the node to the schedule. Decrement the pending
-/// count of its successors. If a successor pending count is zero, add it to
-/// the Available queue.
-void ScheduleDAGList::ScheduleNodeTopDown(SUnit *SU, unsigned CurCycle) {
- DOUT << "*** Scheduling [" << CurCycle << "]: ";
- DEBUG(SU->dump(&DAG));
-
- Sequence.push_back(SU);
- SU->Cycle = CurCycle;
-
- // Bottom up: release successors.
- for (SUnit::succ_iterator I = SU->Succs.begin(), E = SU->Succs.end();
- I != E; ++I)
- ReleaseSucc(I->Dep, I->isCtrl);
-}
-
-/// ListScheduleTopDown - The main loop of list scheduling for top-down
-/// schedulers.
-void ScheduleDAGList::ListScheduleTopDown() {
- unsigned CurCycle = 0;
-
- // All leaves to Available queue.
- for (unsigned i = 0, e = SUnits.size(); i != e; ++i) {
- // It is available if it has no predecessors.
- if (SUnits[i].Preds.empty()) {
- AvailableQueue->push(&SUnits[i]);
- SUnits[i].isAvailable = SUnits[i].isPending = true;
- }
- }
-
- // While Available queue is not empty, grab the node with the highest
- // priority. If it is not ready put it back. Schedule the node.
- std::vector<SUnit*> NotReady;
- while (!AvailableQueue->empty() || !PendingQueue.empty()) {
- // Check to see if any of the pending instructions are ready to issue. If
- // so, add them to the available queue.
- for (unsigned i = 0, e = PendingQueue.size(); i != e; ++i) {
- if (PendingQueue[i].first == CurCycle) {
- AvailableQueue->push(PendingQueue[i].second);
- PendingQueue[i].second->isAvailable = true;
- PendingQueue[i] = PendingQueue.back();
- PendingQueue.pop_back();
- --i; --e;
- } else {
- assert(PendingQueue[i].first > CurCycle && "Negative latency?");
- }
- }
-
- // If there are no instructions available, don't try to issue anything, and
- // don't advance the hazard recognizer.
- if (AvailableQueue->empty()) {
- ++CurCycle;
- continue;
- }
-
- SUnit *FoundSUnit = 0;
- SDNode *FoundNode = 0;
-
- bool HasNoopHazards = false;
- while (!AvailableQueue->empty()) {
- SUnit *CurSUnit = AvailableQueue->pop();
-
- // Get the node represented by this SUnit.
- FoundNode = CurSUnit->Node;
-
- // If this is a pseudo op, like copyfromreg, look to see if there is a
- // real target node flagged to it. If so, use the target node.
- for (unsigned i = 0, e = CurSUnit->FlaggedNodes.size();
- FoundNode->getOpcode() < ISD::BUILTIN_OP_END && i != e; ++i)
- FoundNode = CurSUnit->FlaggedNodes[i];
-
- HazardRecognizer::HazardType HT = HazardRec->getHazardType(FoundNode);
- if (HT == HazardRecognizer::NoHazard) {
- FoundSUnit = CurSUnit;
- break;
- }
-
- // Remember if this is a noop hazard.
- HasNoopHazards |= HT == HazardRecognizer::NoopHazard;
-
- NotReady.push_back(CurSUnit);
- }
-
- // Add the nodes that aren't ready back onto the available list.
- if (!NotReady.empty()) {
- AvailableQueue->push_all(NotReady);
- NotReady.clear();
- }
-
- // If we found a node to schedule, do it now.
- if (FoundSUnit) {
- ScheduleNodeTopDown(FoundSUnit, CurCycle);
- HazardRec->EmitInstruction(FoundNode);
- FoundSUnit->isScheduled = true;
- AvailableQueue->ScheduledNode(FoundSUnit);
-
- // If this is a pseudo-op node, we don't want to increment the current
- // cycle.
- if (FoundSUnit->Latency) // Don't increment CurCycle for pseudo-ops!
- ++CurCycle;
- } else if (!HasNoopHazards) {
- // Otherwise, we have a pipeline stall, but no other problem, just advance
- // the current cycle and try again.
- DOUT << "*** Advancing cycle, no work to do\n";
- HazardRec->AdvanceCycle();
- ++NumStalls;
- ++CurCycle;
- } else {
- // Otherwise, we have no instructions to issue and we have instructions
- // that will fault if we don't do this right. This is the case for
- // processors without pipeline interlocks and other cases.
- DOUT << "*** Emitting noop\n";
- HazardRec->EmitNoop();
- Sequence.push_back(0); // NULL SUnit* -> noop
- ++NumNoops;
- ++CurCycle;
- }
- }
-
-#ifndef NDEBUG
- // Verify that all SUnits were scheduled.
- bool AnyNotSched = false;
- for (unsigned i = 0, e = SUnits.size(); i != e; ++i) {
- if (SUnits[i].NumPredsLeft != 0) {
- if (!AnyNotSched)
- cerr << "*** List scheduling failed! ***\n";
- SUnits[i].dump(&DAG);
- cerr << "has not been scheduled!\n";
- AnyNotSched = true;
- }
- }
- assert(!AnyNotSched);
-#endif
-}
-
-//===----------------------------------------------------------------------===//
-// LatencyPriorityQueue Implementation
-//===----------------------------------------------------------------------===//
-//
-// This is a SchedulingPriorityQueue that schedules using latency information to
-// reduce the length of the critical path through the basic block.
-//
-namespace {
- class LatencyPriorityQueue;
-
- /// Sorting functions for the Available queue.
- struct latency_sort : public std::binary_function<SUnit*, SUnit*, bool> {
- LatencyPriorityQueue *PQ;
- latency_sort(LatencyPriorityQueue *pq) : PQ(pq) {}
- latency_sort(const latency_sort &RHS) : PQ(RHS.PQ) {}
-
- bool operator()(const SUnit* left, const SUnit* right) const;
- };
-} // end anonymous namespace
-
-namespace {
- class LatencyPriorityQueue : public SchedulingPriorityQueue {
- // SUnits - The SUnits for the current graph.
- std::vector<SUnit> *SUnits;
-
- // Latencies - The latency (max of latency from this node to the bb exit)
- // for each node.
- std::vector<int> Latencies;
-
- /// NumNodesSolelyBlocking - This vector contains, for every node in the
- /// Queue, the number of nodes that the node is the sole unscheduled
- /// predecessor for. This is used as a tie-breaker heuristic for better
- /// mobility.
- std::vector<unsigned> NumNodesSolelyBlocking;
-
- std::priority_queue<SUnit*, std::vector<SUnit*>, latency_sort> Queue;
-public:
- LatencyPriorityQueue() : Queue(latency_sort(this)) {
- }
-
- void initNodes(DenseMap<SDNode*, std::vector<SUnit*> > &sumap,
- std::vector<SUnit> &sunits) {
- SUnits = &sunits;
- // Calculate node priorities.
- CalculatePriorities();
- }
-
- void addNode(const SUnit *SU) {
- Latencies.resize(SUnits->size(), -1);
- NumNodesSolelyBlocking.resize(SUnits->size(), 0);
- CalcLatency(*SU);
- }
-
- void updateNode(const SUnit *SU) {
- Latencies[SU->NodeNum] = -1;
- CalcLatency(*SU);
- }
-
- void releaseState() {
- SUnits = 0;
- Latencies.clear();
- }
-
- unsigned getLatency(unsigned NodeNum) const {
- assert(NodeNum < Latencies.size());
- return Latencies[NodeNum];
- }
-
- unsigned getNumSolelyBlockNodes(unsigned NodeNum) const {
- assert(NodeNum < NumNodesSolelyBlocking.size());
- return NumNodesSolelyBlocking[NodeNum];
- }
-
- unsigned size() const { return Queue.size(); }
-
- bool empty() const { return Queue.empty(); }
-
- virtual void push(SUnit *U) {
- push_impl(U);
- }
- void push_impl(SUnit *U);
-
- void push_all(const std::vector<SUnit *> &Nodes) {
- for (unsigned i = 0, e = Nodes.size(); i != e; ++i)
- push_impl(Nodes[i]);
- }
-
- SUnit *pop() {
- if (empty()) return NULL;
- SUnit *V = Queue.top();
- Queue.pop();
- return V;
- }
-
- /// remove - This is a really inefficient way to remove a node from a
- /// priority queue. We should roll our own heap to make this better or
- /// something.
- void remove(SUnit *SU) {
- std::vector<SUnit*> Temp;
-
- assert(!Queue.empty() && "Not in queue!");
- while (Queue.top() != SU) {
- Temp.push_back(Queue.top());
- Queue.pop();
- assert(!Queue.empty() && "Not in queue!");
- }
-
- // Remove the node from the PQ.
- Queue.pop();
-
- // Add all the other nodes back.
- for (unsigned i = 0, e = Temp.size(); i != e; ++i)
- Queue.push(Temp[i]);
- }
-
- // ScheduledNode - As nodes are scheduled, we look to see if there are any
- // successor nodes that have a single unscheduled predecessor. If so, that
- // single predecessor has a higher priority, since scheduling it will make
- // the node available.
- void ScheduledNode(SUnit *Node);
-
-private:
- void CalculatePriorities();
- int CalcLatency(const SUnit &SU);
- void AdjustPriorityOfUnscheduledPreds(SUnit *SU);
- SUnit *getSingleUnscheduledPred(SUnit *SU);
- };
-}
-
-bool latency_sort::operator()(const SUnit *LHS, const SUnit *RHS) const {
- unsigned LHSNum = LHS->NodeNum;
- unsigned RHSNum = RHS->NodeNum;
-
- // The most important heuristic is scheduling the critical path.
- unsigned LHSLatency = PQ->getLatency(LHSNum);
- unsigned RHSLatency = PQ->getLatency(RHSNum);
- if (LHSLatency < RHSLatency) return true;
- if (LHSLatency > RHSLatency) return false;
-
- // After that, if two nodes have identical latencies, look to see if one will
- // unblock more other nodes than the other.
- unsigned LHSBlocked = PQ->getNumSolelyBlockNodes(LHSNum);
- unsigned RHSBlocked = PQ->getNumSolelyBlockNodes(RHSNum);
- if (LHSBlocked < RHSBlocked) return true;
- if (LHSBlocked > RHSBlocked) return false;
-
- // Finally, just to provide a stable ordering, use the node number as a
- // deciding factor.
- return LHSNum < RHSNum;
-}
-
-
-/// CalcNodePriority - Calculate the maximal path from the node to the exit.
-///
-int LatencyPriorityQueue::CalcLatency(const SUnit &SU) {
- int &Latency = Latencies[SU.NodeNum];
- if (Latency != -1)
- return Latency;
-
- std::vector<const SUnit*> WorkList;
- WorkList.push_back(&SU);
- while (!WorkList.empty()) {
- const SUnit *Cur = WorkList.back();
- bool AllDone = true;
- int MaxSuccLatency = 0;
- for (SUnit::const_succ_iterator I = Cur->Succs.begin(),E = Cur->Succs.end();
- I != E; ++I) {
- int SuccLatency = Latencies[I->Dep->NodeNum];
- if (SuccLatency == -1) {
- AllDone = false;
- WorkList.push_back(I->Dep);
- } else {
- MaxSuccLatency = std::max(MaxSuccLatency, SuccLatency);
- }
- }
- if (AllDone) {
- Latencies[Cur->NodeNum] = MaxSuccLatency + Cur->Latency;
- WorkList.pop_back();
- }
- }
-
- return Latency;
-}
-
-/// CalculatePriorities - Calculate priorities of all scheduling units.
-void LatencyPriorityQueue::CalculatePriorities() {
- Latencies.assign(SUnits->size(), -1);
- NumNodesSolelyBlocking.assign(SUnits->size(), 0);
-
- // For each node, calculate the maximal path from the node to the exit.
- std::vector<std::pair<const SUnit*, unsigned> > WorkList;
- for (unsigned i = 0, e = SUnits->size(); i != e; ++i) {
- const SUnit *SU = &(*SUnits)[i];
- if (SU->Succs.empty())
- WorkList.push_back(std::make_pair(SU, 0U));
- }
-
- while (!WorkList.empty()) {
- const SUnit *SU = WorkList.back().first;
- unsigned SuccLat = WorkList.back().second;
- WorkList.pop_back();
- int &Latency = Latencies[SU->NodeNum];
- if (Latency == -1 || (SU->Latency + SuccLat) > (unsigned)Latency) {
- Latency = SU->Latency + SuccLat;
- for (SUnit::const_pred_iterator I = SU->Preds.begin(),E = SU->Preds.end();
- I != E; ++I)
- WorkList.push_back(std::make_pair(I->Dep, Latency));
- }
- }
-}
-
-/// getSingleUnscheduledPred - If there is exactly one unscheduled predecessor
-/// of SU, return it, otherwise return null.
-SUnit *LatencyPriorityQueue::getSingleUnscheduledPred(SUnit *SU) {
- SUnit *OnlyAvailablePred = 0;
- for (SUnit::const_pred_iterator I = SU->Preds.begin(), E = SU->Preds.end();
- I != E; ++I) {
- SUnit &Pred = *I->Dep;
- if (!Pred.isScheduled) {
- // We found an available, but not scheduled, predecessor. If it's the
- // only one we have found, keep track of it... otherwise give up.
- if (OnlyAvailablePred && OnlyAvailablePred != &Pred)
- return 0;
- OnlyAvailablePred = &Pred;
- }
- }
-
- return OnlyAvailablePred;
-}
-
-void LatencyPriorityQueue::push_impl(SUnit *SU) {
- // Look at all of the successors of this node. Count the number of nodes that
- // this node is the sole unscheduled node for.
- unsigned NumNodesBlocking = 0;
- for (SUnit::const_succ_iterator I = SU->Succs.begin(), E = SU->Succs.end();
- I != E; ++I)
- if (getSingleUnscheduledPred(I->Dep) == SU)
- ++NumNodesBlocking;
- NumNodesSolelyBlocking[SU->NodeNum] = NumNodesBlocking;
-
- Queue.push(SU);
-}
-
-
-// ScheduledNode - As nodes are scheduled, we look to see if there are any
-// successor nodes that have a single unscheduled predecessor. If so, that
-// single predecessor has a higher priority, since scheduling it will make
-// the node available.
-void LatencyPriorityQueue::ScheduledNode(SUnit *SU) {
- for (SUnit::const_succ_iterator I = SU->Succs.begin(), E = SU->Succs.end();
- I != E; ++I)
- AdjustPriorityOfUnscheduledPreds(I->Dep);
-}
-
-/// AdjustPriorityOfUnscheduledPreds - One of the predecessors of SU was just
-/// scheduled. If SU is not itself available, then there is at least one
-/// predecessor node that has not been scheduled yet. If SU has exactly ONE
-/// unscheduled predecessor, we want to increase its priority: it getting
-/// scheduled will make this node available, so it is better than some other
-/// node of the same priority that will not make a node available.
-void LatencyPriorityQueue::AdjustPriorityOfUnscheduledPreds(SUnit *SU) {
- if (SU->isPending) return; // All preds scheduled.
-
- SUnit *OnlyAvailablePred = getSingleUnscheduledPred(SU);
- if (OnlyAvailablePred == 0 || !OnlyAvailablePred->isAvailable) return;
-
- // Okay, we found a single predecessor that is available, but not scheduled.
- // Since it is available, it must be in the priority queue. First remove it.
- remove(OnlyAvailablePred);
-
- // Reinsert the node into the priority queue, which recomputes its
- // NumNodesSolelyBlocking value.
- push(OnlyAvailablePred);
-}
-
-
-//===----------------------------------------------------------------------===//
-// Public Constructor Functions
-//===----------------------------------------------------------------------===//
-
-/// createTDListDAGScheduler - This creates a top-down list scheduler with a
-/// new hazard recognizer. This scheduler takes ownership of the hazard
-/// recognizer and deletes it when done.
-ScheduleDAG* llvm::createTDListDAGScheduler(SelectionDAGISel *IS,
- SelectionDAG *DAG,
- MachineBasicBlock *BB) {
- return new ScheduleDAGList(*DAG, BB, DAG->getTarget(),
- new LatencyPriorityQueue(),
- IS->CreateTargetHazardRecognizer());
-}
diff --git a/release_23/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp b/release_23/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp
deleted file mode 100644
index 9c61ed8ab059..000000000000
--- a/release_23/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp
+++ /dev/null
@@ -1,1860 +0,0 @@
-//===----- ScheduleDAGList.cpp - Reg pressure reduction list scheduler ----===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This implements bottom-up and top-down register pressure reduction list
-// schedulers, using standard algorithms. The basic approach uses a priority
-// queue of available nodes to schedule. One at a time, nodes are taken from
-// the priority queue (thus in priority order), checked for legality to
-// schedule, and emitted if legal.
-//
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "pre-RA-sched"
-#include "llvm/CodeGen/ScheduleDAG.h"
-#include "llvm/CodeGen/SchedulerRegistry.h"
-#include "llvm/Target/TargetRegisterInfo.h"
-#include "llvm/Target/TargetData.h"
-#include "llvm/Target/TargetMachine.h"
-#include "llvm/Target/TargetInstrInfo.h"
-#include "llvm/Support/Debug.h"
-#include "llvm/Support/Compiler.h"
-#include "llvm/ADT/SmallPtrSet.h"
-#include "llvm/ADT/SmallSet.h"
-#include "llvm/ADT/Statistic.h"
-#include "llvm/ADT/STLExtras.h"
-#include <climits>
-#include <queue>
-#include "llvm/Support/CommandLine.h"
-using namespace llvm;
-
-STATISTIC(NumBacktracks, "Number of times scheduler backtracked");
-STATISTIC(NumUnfolds, "Number of nodes unfolded");
-STATISTIC(NumDups, "Number of duplicated nodes");
-STATISTIC(NumCCCopies, "Number of cross class copies");
-
-static RegisterScheduler
- burrListDAGScheduler("list-burr",
- " Bottom-up register reduction list scheduling",
- createBURRListDAGScheduler);
-static RegisterScheduler
- tdrListrDAGScheduler("list-tdrr",
- " Top-down register reduction list scheduling",
- createTDRRListDAGScheduler);
-
-namespace {
-//===----------------------------------------------------------------------===//
-/// ScheduleDAGRRList - The actual register reduction list scheduler
-/// implementation. This supports both top-down and bottom-up scheduling.
-///
-class VISIBILITY_HIDDEN ScheduleDAGRRList : public ScheduleDAG {
-private:
- /// isBottomUp - This is true if the scheduling problem is bottom-up, false if
- /// it is top-down.
- bool isBottomUp;
-
- /// AvailableQueue - The priority queue to use for the available SUnits.
- SchedulingPriorityQueue *AvailableQueue;
-
- /// LiveRegs / LiveRegDefs - A set of physical registers and their definition
- /// that are "live". These nodes must be scheduled before any other nodes that
- /// modifies the registers can be scheduled.
- SmallSet<unsigned, 4> LiveRegs;
- std::vector<SUnit*> LiveRegDefs;
- std::vector<unsigned> LiveRegCycles;
-
-public:
- ScheduleDAGRRList(SelectionDAG &dag, MachineBasicBlock *bb,
- const TargetMachine &tm, bool isbottomup,
- SchedulingPriorityQueue *availqueue)
- : ScheduleDAG(dag, bb, tm), isBottomUp(isbottomup),
- AvailableQueue(availqueue) {
- }
-
- ~ScheduleDAGRRList() {
- delete AvailableQueue;
- }
-
- void Schedule();
-
- /// IsReachable - Checks if SU is reachable from TargetSU.
- bool IsReachable(SUnit *SU, SUnit *TargetSU);
-
- /// willCreateCycle - Returns true if adding an edge from SU to TargetSU will
- /// create a cycle.
- bool WillCreateCycle(SUnit *SU, SUnit *TargetSU);
-
- /// AddPred - This adds the specified node X as a predecessor of
- /// the current node Y if not already.
- /// This returns true if this is a new predecessor.
- /// Updates the topological ordering if required.
- bool AddPred(SUnit *Y, SUnit *X, bool isCtrl, bool isSpecial,
- unsigned PhyReg = 0, int Cost = 1);
-
- /// RemovePred - This removes the specified node N from the predecessors of
- /// the current node M. Updates the topological ordering if required.
- bool RemovePred(SUnit *M, SUnit *N, bool isCtrl, bool isSpecial);
-
-private:
- void ReleasePred(SUnit*, bool, unsigned);
- void ReleaseSucc(SUnit*, bool isChain, unsigned);
- void CapturePred(SUnit*, SUnit*, bool);
- void ScheduleNodeBottomUp(SUnit*, unsigned);
- void ScheduleNodeTopDown(SUnit*, unsigned);
- void UnscheduleNodeBottomUp(SUnit*);
- void BacktrackBottomUp(SUnit*, unsigned, unsigned&);
- SUnit *CopyAndMoveSuccessors(SUnit*);
- void InsertCCCopiesAndMoveSuccs(SUnit*, unsigned,
- const TargetRegisterClass*,
- const TargetRegisterClass*,
- SmallVector<SUnit*, 2>&);
- bool DelayForLiveRegsBottomUp(SUnit*, SmallVector<unsigned, 4>&);
- void ListScheduleTopDown();
- void ListScheduleBottomUp();
- void CommuteNodesToReducePressure();
-
-
- /// CreateNewSUnit - Creates a new SUnit and returns a pointer to it.
- /// Updates the topological ordering if required.
- SUnit *CreateNewSUnit(SDNode *N) {
- SUnit *NewNode = NewSUnit(N);
- // Update the topological ordering.
- if (NewNode->NodeNum >= Node2Index.size())
- InitDAGTopologicalSorting();
- return NewNode;
- }
-
- /// CreateClone - Creates a new SUnit from an existing one.
- /// Updates the topological ordering if required.
- SUnit *CreateClone(SUnit *N) {
- SUnit *NewNode = Clone(N);
- // Update the topological ordering.
- if (NewNode->NodeNum >= Node2Index.size())
- InitDAGTopologicalSorting();
- return NewNode;
- }
-
- /// Functions for preserving the topological ordering
- /// even after dynamic insertions of new edges.
- /// This allows a very fast implementation of IsReachable.
-
-
- /**
- The idea of the algorithm is taken from
- "Online algorithms for managing the topological order of
- a directed acyclic graph" by David J. Pearce and Paul H.J. Kelly
- This is the MNR algorithm, which was first introduced by
- A. Marchetti-Spaccamela, U. Nanni and H. Rohnert in
- "Maintaining a topological order under edge insertions".
-
- Short description of the algorithm:
-
- Topological ordering, ord, of a DAG maps each node to a topological
- index so that for all edges X->Y it is the case that ord(X) < ord(Y).
-
- This means that if there is a path from the node X to the node Z,
- then ord(X) < ord(Z).
-
- This property can be used to check for reachability of nodes:
- if Z is reachable from X, then an insertion of the edge Z->X would
- create a cycle.
-
- The algorithm first computes a topological ordering for the DAG by initializing
- the Index2Node and Node2Index arrays and then tries to keep the ordering
- up-to-date after edge insertions by reordering the DAG.
-
- On insertion of the edge X->Y, the algorithm first marks by calling DFS the
- nodes reachable from Y, and then shifts them using Shift to lie immediately
- after X in Index2Node.
- */
-
- /// InitDAGTopologicalSorting - create the initial topological
- /// ordering from the DAG to be scheduled.
- void InitDAGTopologicalSorting();
-
- /// DFS - make a DFS traversal and mark all nodes affected by the
- /// edge insertion. These nodes will later get new topological indexes
- /// by means of the Shift method.
- void DFS(SUnit *SU, int UpperBound, bool& HasLoop);
-
- /// Shift - reassign topological indexes for the nodes in the DAG
- /// to preserve the topological ordering.
- void Shift(BitVector& Visited, int LowerBound, int UpperBound);
-
- /// Allocate - assign the topological index to the node n.
- void Allocate(int n, int index);
-
- /// Index2Node - Maps topological index to the node number.
- std::vector<int> Index2Node;
- /// Node2Index - Maps the node number to its topological index.
- std::vector<int> Node2Index;
- /// Visited - a set of nodes visited during a DFS traversal.
- BitVector Visited;
-};
-} // end anonymous namespace
-
-
-/// Schedule - Schedule the DAG using list scheduling.
-void ScheduleDAGRRList::Schedule() {
- DOUT << "********** List Scheduling **********\n";
-
- LiveRegDefs.resize(TRI->getNumRegs(), NULL);
- LiveRegCycles.resize(TRI->getNumRegs(), 0);
-
- // Build scheduling units.
- BuildSchedUnits();
-
- DEBUG(for (unsigned su = 0, e = SUnits.size(); su != e; ++su)
- SUnits[su].dumpAll(&DAG));
- CalculateDepths();
- CalculateHeights();
- InitDAGTopologicalSorting();
-
- AvailableQueue->initNodes(SUnitMap, SUnits);
-
- // Execute the actual scheduling loop Top-Down or Bottom-Up as appropriate.
- if (isBottomUp)
- ListScheduleBottomUp();
- else
- ListScheduleTopDown();
-
- AvailableQueue->releaseState();
-
- CommuteNodesToReducePressure();
-
- DOUT << "*** Final schedule ***\n";
- DEBUG(dumpSchedule());
- DOUT << "\n";
-
- // Emit in scheduled order
- EmitSchedule();
-}
-
-/// CommuteNodesToReducePressure - If a node is two-address and commutable, and
-/// it is not the last use of its first operand, add it to the CommuteSet if
-/// possible. It will be commuted when it is translated to a MI.
-void ScheduleDAGRRList::CommuteNodesToReducePressure() {
- SmallPtrSet<SUnit*, 4> OperandSeen;
- for (unsigned i = Sequence.size(); i != 0; ) {
- --i;
- SUnit *SU = Sequence[i];
- if (!SU || !SU->Node) continue;
- if (SU->isCommutable) {
- unsigned Opc = SU->Node->getTargetOpcode();
- const TargetInstrDesc &TID = TII->get(Opc);
- unsigned NumRes = TID.getNumDefs();
- unsigned NumOps = TID.getNumOperands() - NumRes;
- for (unsigned j = 0; j != NumOps; ++j) {
- if (TID.getOperandConstraint(j+NumRes, TOI::TIED_TO) == -1)
- continue;
-
- SDNode *OpN = SU->Node->getOperand(j).Val;
- SUnit *OpSU = isPassiveNode(OpN) ? NULL : SUnitMap[OpN][SU->InstanceNo];
- if (OpSU && OperandSeen.count(OpSU) == 1) {
- // Ok, so SU is not the last use of OpSU, but SU is two-address so
- // it will clobber OpSU. Try to commute SU if no other source operands
- // are live below.
- bool DoCommute = true;
- for (unsigned k = 0; k < NumOps; ++k) {
- if (k != j) {
- OpN = SU->Node->getOperand(k).Val;
- OpSU = isPassiveNode(OpN) ? NULL : SUnitMap[OpN][SU->InstanceNo];
- if (OpSU && OperandSeen.count(OpSU) == 1) {
- DoCommute = false;
- break;
- }
- }
- }
- if (DoCommute)
- CommuteSet.insert(SU->Node);
- }
-
- // Only look at the first use&def node for now.
- break;
- }
- }
-
- for (SUnit::pred_iterator I = SU->Preds.begin(), E = SU->Preds.end();
- I != E; ++I) {
- if (!I->isCtrl)
- OperandSeen.insert(I->Dep);
- }
- }
-}
-
-//===----------------------------------------------------------------------===//
-// Bottom-Up Scheduling
-//===----------------------------------------------------------------------===//
-
-/// ReleasePred - Decrement the NumSuccsLeft count of a predecessor. Add it to
-/// the AvailableQueue if the count reaches zero. Also update its cycle bound.
-void ScheduleDAGRRList::ReleasePred(SUnit *PredSU, bool isChain,
- unsigned CurCycle) {
- // FIXME: the distance between two nodes is not always == the predecessor's
- // latency. For example, the reader can very well read the register written
- // by the predecessor later than the issue cycle. It also depends on the
- // interrupt model (drain vs. freeze).
- PredSU->CycleBound = std::max(PredSU->CycleBound, CurCycle + PredSU->Latency);
-
- --PredSU->NumSuccsLeft;
-
-#ifndef NDEBUG
- if (PredSU->NumSuccsLeft < 0) {
- cerr << "*** List scheduling failed! ***\n";
- PredSU->dump(&DAG);
- cerr << " has been released too many times!\n";
- assert(0);
- }
-#endif
-
- if (PredSU->NumSuccsLeft == 0) {
- PredSU->isAvailable = true;
- AvailableQueue->push(PredSU);
- }
-}
-
-/// ScheduleNodeBottomUp - Add the node to the schedule. Decrement the pending
-/// count of its predecessors. If a predecessor pending count is zero, add it to
-/// the Available queue.
-void ScheduleDAGRRList::ScheduleNodeBottomUp(SUnit *SU, unsigned CurCycle) {
- DOUT << "*** Scheduling [" << CurCycle << "]: ";
- DEBUG(SU->dump(&DAG));
- SU->Cycle = CurCycle;
-
- AvailableQueue->ScheduledNode(SU);
-
- // Bottom up: release predecessors
- for (SUnit::pred_iterator I = SU->Preds.begin(), E = SU->Preds.end();
- I != E; ++I) {
- ReleasePred(I->Dep, I->isCtrl, CurCycle);
- if (I->Cost < 0) {
- // This is a physical register dependency and it's impossible or
- // expensive to copy the register. Make sure nothing that can
- // clobber the register is scheduled between the predecessor and
- // this node.
- if (LiveRegs.insert(I->Reg)) {
- LiveRegDefs[I->Reg] = I->Dep;
- LiveRegCycles[I->Reg] = CurCycle;
- }
- }
- }
-
- // Release all the implicit physical register defs that are live.
- for (SUnit::succ_iterator I = SU->Succs.begin(), E = SU->Succs.end();
- I != E; ++I) {
- if (I->Cost < 0) {
- if (LiveRegCycles[I->Reg] == I->Dep->Cycle) {
- LiveRegs.erase(I->Reg);
- assert(LiveRegDefs[I->Reg] == SU &&
- "Physical register dependency violated?");
- LiveRegDefs[I->Reg] = NULL;
- LiveRegCycles[I->Reg] = 0;
- }
- }
- }
-
- SU->isScheduled = true;
-}
-
-/// CapturePred - This does the opposite of ReleasePred. Since SU is being
-/// unscheduled, incrcease the succ left count of its predecessors. Remove
-/// them from AvailableQueue if necessary.
-void ScheduleDAGRRList::CapturePred(SUnit *PredSU, SUnit *SU, bool isChain) {
- unsigned CycleBound = 0;
- for (SUnit::succ_iterator I = PredSU->Succs.begin(), E = PredSU->Succs.end();
- I != E; ++I) {
- if (I->Dep == SU)
- continue;
- CycleBound = std::max(CycleBound,
- I->Dep->Cycle + PredSU->Latency);
- }
-
- if (PredSU->isAvailable) {
- PredSU->isAvailable = false;
- if (!PredSU->isPending)
- AvailableQueue->remove(PredSU);
- }
-
- PredSU->CycleBound = CycleBound;
- ++PredSU->NumSuccsLeft;
-}
-
-/// UnscheduleNodeBottomUp - Remove the node from the schedule, update its and
-/// its predecessor states to reflect the change.
-void ScheduleDAGRRList::UnscheduleNodeBottomUp(SUnit *SU) {
- DOUT << "*** Unscheduling [" << SU->Cycle << "]: ";
- DEBUG(SU->dump(&DAG));
-
- AvailableQueue->UnscheduledNode(SU);
-
- for (SUnit::pred_iterator I = SU->Preds.begin(), E = SU->Preds.end();
- I != E; ++I) {
- CapturePred(I->Dep, SU, I->isCtrl);
- if (I->Cost < 0 && SU->Cycle == LiveRegCycles[I->Reg]) {
- LiveRegs.erase(I->Reg);
- assert(LiveRegDefs[I->Reg] == I->Dep &&
- "Physical register dependency violated?");
- LiveRegDefs[I->Reg] = NULL;
- LiveRegCycles[I->Reg] = 0;
- }
- }
-
- for (SUnit::succ_iterator I = SU->Succs.begin(), E = SU->Succs.end();
- I != E; ++I) {
- if (I->Cost < 0) {
- if (LiveRegs.insert(I->Reg)) {
- assert(!LiveRegDefs[I->Reg] &&
- "Physical register dependency violated?");
- LiveRegDefs[I->Reg] = SU;
- }
- if (I->Dep->Cycle < LiveRegCycles[I->Reg])
- LiveRegCycles[I->Reg] = I->Dep->Cycle;
- }
- }
-
- SU->Cycle = 0;
- SU->isScheduled = false;
- SU->isAvailable = true;
- AvailableQueue->push(SU);
-}
-
-/// IsReachable - Checks if SU is reachable from TargetSU.
-bool ScheduleDAGRRList::IsReachable(SUnit *SU, SUnit *TargetSU) {
- // If insertion of the edge SU->TargetSU would create a cycle
- // then there is a path from TargetSU to SU.
- int UpperBound, LowerBound;
- LowerBound = Node2Index[TargetSU->NodeNum];
- UpperBound = Node2Index[SU->NodeNum];
- bool HasLoop = false;
- // Is Ord(TargetSU) < Ord(SU) ?
- if (LowerBound < UpperBound) {
- Visited.reset();
- // There may be a path from TargetSU to SU. Check for it.
- DFS(TargetSU, UpperBound, HasLoop);
- }
- return HasLoop;
-}
-
-/// Allocate - assign the topological index to the node n.
-inline void ScheduleDAGRRList::Allocate(int n, int index) {
- Node2Index[n] = index;
- Index2Node[index] = n;
-}
-
-/// InitDAGTopologicalSorting - create the initial topological
-/// ordering from the DAG to be scheduled.
-void ScheduleDAGRRList::InitDAGTopologicalSorting() {
- unsigned DAGSize = SUnits.size();
- std::vector<unsigned> InDegree(DAGSize);
- std::vector<SUnit*> WorkList;
- WorkList.reserve(DAGSize);
- std::vector<SUnit*> TopOrder;
- TopOrder.reserve(DAGSize);
-
- // Initialize the data structures.
- for (unsigned i = 0, e = DAGSize; i != e; ++i) {
- SUnit *SU = &SUnits[i];
- int NodeNum = SU->NodeNum;
- unsigned Degree = SU->Succs.size();
- InDegree[NodeNum] = Degree;
-
- // Is it a node without dependencies?
- if (Degree == 0) {
- assert(SU->Succs.empty() && "SUnit should have no successors");
- // Collect leaf nodes.
- WorkList.push_back(SU);
- }
- }
-
- while (!WorkList.empty()) {
- SUnit *SU = WorkList.back();
- WorkList.pop_back();
- TopOrder.push_back(SU);
- for (SUnit::const_pred_iterator I = SU->Preds.begin(), E = SU->Preds.end();
- I != E; ++I) {
- SUnit *SU = I->Dep;
- if (!--InDegree[SU->NodeNum])
- // If all dependencies of the node are processed already,
- // then the node can be computed now.
- WorkList.push_back(SU);
- }
- }
-
- // Second pass, assign the actual topological order as node ids.
- int Id = 0;
-
- Index2Node.clear();
- Node2Index.clear();
- Index2Node.resize(DAGSize);
- Node2Index.resize(DAGSize);
- Visited.resize(DAGSize);
-
- for (std::vector<SUnit*>::reverse_iterator TI = TopOrder.rbegin(),
- TE = TopOrder.rend();TI != TE; ++TI) {
- Allocate((*TI)->NodeNum, Id);
- Id++;
- }
-
-#ifndef NDEBUG
- // Check correctness of the ordering
- for (unsigned i = 0, e = DAGSize; i != e; ++i) {
- SUnit *SU = &SUnits[i];
- for (SUnit::const_pred_iterator I = SU->Preds.begin(), E = SU->Preds.end();
- I != E; ++I) {
- assert(Node2Index[SU->NodeNum] > Node2Index[I->Dep->NodeNum] &&
- "Wrong topological sorting");
- }
- }
-#endif
-}
-
-/// AddPred - adds an edge from SUnit X to SUnit Y.
-/// Updates the topological ordering if required.
-bool ScheduleDAGRRList::AddPred(SUnit *Y, SUnit *X, bool isCtrl, bool isSpecial,
- unsigned PhyReg, int Cost) {
- int UpperBound, LowerBound;
- LowerBound = Node2Index[Y->NodeNum];
- UpperBound = Node2Index[X->NodeNum];
- bool HasLoop = false;
- // Is Ord(X) < Ord(Y) ?
- if (LowerBound < UpperBound) {
- // Update the topological order.
- Visited.reset();
- DFS(Y, UpperBound, HasLoop);
- assert(!HasLoop && "Inserted edge creates a loop!");
- // Recompute topological indexes.
- Shift(Visited, LowerBound, UpperBound);
- }
- // Now really insert the edge.
- return Y->addPred(X, isCtrl, isSpecial, PhyReg, Cost);
-}
-
-/// RemovePred - This removes the specified node N from the predecessors of
-/// the current node M. Updates the topological ordering if required.
-bool ScheduleDAGRRList::RemovePred(SUnit *M, SUnit *N,
- bool isCtrl, bool isSpecial) {
- // InitDAGTopologicalSorting();
- return M->removePred(N, isCtrl, isSpecial);
-}
-
-/// DFS - Make a DFS traversal to mark all nodes reachable from SU and mark
-/// all nodes affected by the edge insertion. These nodes will later get new
-/// topological indexes by means of the Shift method.
-void ScheduleDAGRRList::DFS(SUnit *SU, int UpperBound, bool& HasLoop) {
- std::vector<SUnit*> WorkList;
- WorkList.reserve(SUnits.size());
-
- WorkList.push_back(SU);
- while (!WorkList.empty()) {
- SU = WorkList.back();
- WorkList.pop_back();
- Visited.set(SU->NodeNum);
- for (int I = SU->Succs.size()-1; I >= 0; --I) {
- int s = SU->Succs[I].Dep->NodeNum;
- if (Node2Index[s] == UpperBound) {
- HasLoop = true;
- return;
- }
- // Visit successors if not already and in affected region.
- if (!Visited.test(s) && Node2Index[s] < UpperBound) {
- WorkList.push_back(SU->Succs[I].Dep);
- }
- }
- }
-}
-
-/// Shift - Renumber the nodes so that the topological ordering is
-/// preserved.
-void ScheduleDAGRRList::Shift(BitVector& Visited, int LowerBound,
- int UpperBound) {
- std::vector<int> L;
- int shift = 0;
- int i;
-
- for (i = LowerBound; i <= UpperBound; ++i) {
- // w is node at topological index i.
- int w = Index2Node[i];
- if (Visited.test(w)) {
- // Unmark.
- Visited.reset(w);
- L.push_back(w);
- shift = shift + 1;
- } else {
- Allocate(w, i - shift);
- }
- }
-
- for (unsigned j = 0; j < L.size(); ++j) {
- Allocate(L[j], i - shift);
- i = i + 1;
- }
-}
-
-
-/// WillCreateCycle - Returns true if adding an edge from SU to TargetSU will
-/// create a cycle.
-bool ScheduleDAGRRList::WillCreateCycle(SUnit *SU, SUnit *TargetSU) {
- if (IsReachable(TargetSU, SU))
- return true;
- for (SUnit::pred_iterator I = SU->Preds.begin(), E = SU->Preds.end();
- I != E; ++I)
- if (I->Cost < 0 && IsReachable(TargetSU, I->Dep))
- return true;
- return false;
-}
-
-/// BacktrackBottomUp - Backtrack scheduling to a previous cycle specified in
-/// BTCycle in order to schedule a specific node. Returns the last unscheduled
-/// SUnit. Also returns if a successor is unscheduled in the process.
-void ScheduleDAGRRList::BacktrackBottomUp(SUnit *SU, unsigned BtCycle,
- unsigned &CurCycle) {
- SUnit *OldSU = NULL;
- while (CurCycle > BtCycle) {
- OldSU = Sequence.back();
- Sequence.pop_back();
- if (SU->isSucc(OldSU))
- // Don't try to remove SU from AvailableQueue.
- SU->isAvailable = false;
- UnscheduleNodeBottomUp(OldSU);
- --CurCycle;
- }
-
-
- if (SU->isSucc(OldSU)) {
- assert(false && "Something is wrong!");
- abort();
- }
-
- ++NumBacktracks;
-}
-
-/// CopyAndMoveSuccessors - Clone the specified node and move its scheduled
-/// successors to the newly created node.
-SUnit *ScheduleDAGRRList::CopyAndMoveSuccessors(SUnit *SU) {
- if (SU->FlaggedNodes.size())
- return NULL;
-
- SDNode *N = SU->Node;
- if (!N)
- return NULL;
-
- SUnit *NewSU;
- bool TryUnfold = false;
- for (unsigned i = 0, e = N->getNumValues(); i != e; ++i) {
- MVT::ValueType VT = N->getValueType(i);
- if (VT == MVT::Flag)
- return NULL;
- else if (VT == MVT::Other)
- TryUnfold = true;
- }
- for (unsigned i = 0, e = N->getNumOperands(); i != e; ++i) {
- const SDOperand &Op = N->getOperand(i);
- MVT::ValueType VT = Op.Val->getValueType(Op.ResNo);
- if (VT == MVT::Flag)
- return NULL;
- }
-
- if (TryUnfold) {
- SmallVector<SDNode*, 4> NewNodes;
- if (!TII->unfoldMemoryOperand(DAG, N, NewNodes))
- return NULL;
-
- DOUT << "Unfolding SU # " << SU->NodeNum << "\n";
- assert(NewNodes.size() == 2 && "Expected a load folding node!");
-
- N = NewNodes[1];
- SDNode *LoadNode = NewNodes[0];
- unsigned NumVals = N->getNumValues();
- unsigned OldNumVals = SU->Node->getNumValues();
- for (unsigned i = 0; i != NumVals; ++i)
- DAG.ReplaceAllUsesOfValueWith(SDOperand(SU->Node, i), SDOperand(N, i));
- DAG.ReplaceAllUsesOfValueWith(SDOperand(SU->Node, OldNumVals-1),
- SDOperand(LoadNode, 1));
-
- SUnit *NewSU = CreateNewSUnit(N);
- SUnitMap[N].push_back(NewSU);
- const TargetInstrDesc &TID = TII->get(N->getTargetOpcode());
- for (unsigned i = 0; i != TID.getNumOperands(); ++i) {
- if (TID.getOperandConstraint(i, TOI::TIED_TO) != -1) {
- NewSU->isTwoAddress = true;
- break;
- }
- }
- if (TID.isCommutable())
- NewSU->isCommutable = true;
- // FIXME: Calculate height / depth and propagate the changes?
- NewSU->Depth = SU->Depth;
- NewSU->Height = SU->Height;
- ComputeLatency(NewSU);
-
- // LoadNode may already exist. This can happen when there is another
- // load from the same location and producing the same type of value
- // but it has different alignment or volatileness.
- bool isNewLoad = true;
- SUnit *LoadSU;
- DenseMap<SDNode*, std::vector<SUnit*> >::iterator SMI =
- SUnitMap.find(LoadNode);
- if (SMI != SUnitMap.end()) {
- LoadSU = SMI->second.front();
- isNewLoad = false;
- } else {
- LoadSU = CreateNewSUnit(LoadNode);
- SUnitMap[LoadNode].push_back(LoadSU);
-
- LoadSU->Depth = SU->Depth;
- LoadSU->Height = SU->Height;
- ComputeLatency(LoadSU);
- }
-
- SUnit *ChainPred = NULL;
- SmallVector<SDep, 4> ChainSuccs;
- SmallVector<SDep, 4> LoadPreds;
- SmallVector<SDep, 4> NodePreds;
- SmallVector<SDep, 4> NodeSuccs;
- for (SUnit::pred_iterator I = SU->Preds.begin(), E = SU->Preds.end();
- I != E; ++I) {
- if (I->isCtrl)
- ChainPred = I->Dep;
- else if (I->Dep->Node && I->Dep->Node->isOperandOf(LoadNode))
- LoadPreds.push_back(SDep(I->Dep, I->Reg, I->Cost, false, false));
- else
- NodePreds.push_back(SDep(I->Dep, I->Reg, I->Cost, false, false));
- }
- for (SUnit::succ_iterator I = SU->Succs.begin(), E = SU->Succs.end();
- I != E; ++I) {
- if (I->isCtrl)
- ChainSuccs.push_back(SDep(I->Dep, I->Reg, I->Cost,
- I->isCtrl, I->isSpecial));
- else
- NodeSuccs.push_back(SDep(I->Dep, I->Reg, I->Cost,
- I->isCtrl, I->isSpecial));
- }
-
- if (ChainPred) {
- RemovePred(SU, ChainPred, true, false);
- if (isNewLoad)
- AddPred(LoadSU, ChainPred, true, false);
- }
- for (unsigned i = 0, e = LoadPreds.size(); i != e; ++i) {
- SDep *Pred = &LoadPreds[i];
- RemovePred(SU, Pred->Dep, Pred->isCtrl, Pred->isSpecial);
- if (isNewLoad) {
- AddPred(LoadSU, Pred->Dep, Pred->isCtrl, Pred->isSpecial,
- Pred->Reg, Pred->Cost);
- }
- }
- for (unsigned i = 0, e = NodePreds.size(); i != e; ++i) {
- SDep *Pred = &NodePreds[i];
- RemovePred(SU, Pred->Dep, Pred->isCtrl, Pred->isSpecial);
- AddPred(NewSU, Pred->Dep, Pred->isCtrl, Pred->isSpecial,
- Pred->Reg, Pred->Cost);
- }
- for (unsigned i = 0, e = NodeSuccs.size(); i != e; ++i) {
- SDep *Succ = &NodeSuccs[i];
- RemovePred(Succ->Dep, SU, Succ->isCtrl, Succ->isSpecial);
- AddPred(Succ->Dep, NewSU, Succ->isCtrl, Succ->isSpecial,
- Succ->Reg, Succ->Cost);
- }
- for (unsigned i = 0, e = ChainSuccs.size(); i != e; ++i) {
- SDep *Succ = &ChainSuccs[i];
- RemovePred(Succ->Dep, SU, Succ->isCtrl, Succ->isSpecial);
- if (isNewLoad) {
- AddPred(Succ->Dep, LoadSU, Succ->isCtrl, Succ->isSpecial,
- Succ->Reg, Succ->Cost);
- }
- }
- if (isNewLoad) {
- AddPred(NewSU, LoadSU, false, false);
- }
-
- if (isNewLoad)
- AvailableQueue->addNode(LoadSU);
- AvailableQueue->addNode(NewSU);
-
- ++NumUnfolds;
-
- if (NewSU->NumSuccsLeft == 0) {
- NewSU->isAvailable = true;
- return NewSU;
- }
- SU = NewSU;
- }
-
- DOUT << "Duplicating SU # " << SU->NodeNum << "\n";
- NewSU = CreateClone(SU);
-
- // New SUnit has the exact same predecessors.
- for (SUnit::pred_iterator I = SU->Preds.begin(), E = SU->Preds.end();
- I != E; ++I)
- if (!I->isSpecial) {
- AddPred(NewSU, I->Dep, I->isCtrl, false, I->Reg, I->Cost);
- NewSU->Depth = std::max(NewSU->Depth, I->Dep->Depth+1);
- }
-
- // Only copy scheduled successors. Cut them from old node's successor
- // list and move them over.
- SmallVector<std::pair<SUnit*, bool>, 4> DelDeps;
- for (SUnit::succ_iterator I = SU->Succs.begin(), E = SU->Succs.end();
- I != E; ++I) {
- if (I->isSpecial)
- continue;
- if (I->Dep->isScheduled) {
- NewSU->Height = std::max(NewSU->Height, I->Dep->Height+1);
- AddPred(I->Dep, NewSU, I->isCtrl, false, I->Reg, I->Cost);
- DelDeps.push_back(std::make_pair(I->Dep, I->isCtrl));
- }
- }
- for (unsigned i = 0, e = DelDeps.size(); i != e; ++i) {
- SUnit *Succ = DelDeps[i].first;
- bool isCtrl = DelDeps[i].second;
- RemovePred(Succ, SU, isCtrl, false);
- }
-
- AvailableQueue->updateNode(SU);
- AvailableQueue->addNode(NewSU);
-
- ++NumDups;
- return NewSU;
-}
-
-/// InsertCCCopiesAndMoveSuccs - Insert expensive cross register class copies
-/// and move all scheduled successors of the given SUnit to the last copy.
-void ScheduleDAGRRList::InsertCCCopiesAndMoveSuccs(SUnit *SU, unsigned Reg,
- const TargetRegisterClass *DestRC,
- const TargetRegisterClass *SrcRC,
- SmallVector<SUnit*, 2> &Copies) {
- SUnit *CopyFromSU = CreateNewSUnit(NULL);
- CopyFromSU->CopySrcRC = SrcRC;
- CopyFromSU->CopyDstRC = DestRC;
- CopyFromSU->Depth = SU->Depth;
- CopyFromSU->Height = SU->Height;
-
- SUnit *CopyToSU = CreateNewSUnit(NULL);
- CopyToSU->CopySrcRC = DestRC;
- CopyToSU->CopyDstRC = SrcRC;
-
- // Only copy scheduled successors. Cut them from old node's successor
- // list and move them over.
- SmallVector<std::pair<SUnit*, bool>, 4> DelDeps;
- for (SUnit::succ_iterator I = SU->Succs.begin(), E = SU->Succs.end();
- I != E; ++I) {
- if (I->isSpecial)
- continue;
- if (I->Dep->isScheduled) {
- CopyToSU->Height = std::max(CopyToSU->Height, I->Dep->Height+1);
- AddPred(I->Dep, CopyToSU, I->isCtrl, false, I->Reg, I->Cost);
- DelDeps.push_back(std::make_pair(I->Dep, I->isCtrl));
- }
- }
- for (unsigned i = 0, e = DelDeps.size(); i != e; ++i) {
- SUnit *Succ = DelDeps[i].first;
- bool isCtrl = DelDeps[i].second;
- RemovePred(Succ, SU, isCtrl, false);
- }
-
- AddPred(CopyFromSU, SU, false, false, Reg, -1);
- AddPred(CopyToSU, CopyFromSU, false, false, Reg, 1);
-
- AvailableQueue->updateNode(SU);
- AvailableQueue->addNode(CopyFromSU);
- AvailableQueue->addNode(CopyToSU);
- Copies.push_back(CopyFromSU);
- Copies.push_back(CopyToSU);
-
- ++NumCCCopies;
-}
-
-/// getPhysicalRegisterVT - Returns the ValueType of the physical register
-/// definition of the specified node.
-/// FIXME: Move to SelectionDAG?
-static MVT::ValueType getPhysicalRegisterVT(SDNode *N, unsigned Reg,
- const TargetInstrInfo *TII) {
- const TargetInstrDesc &TID = TII->get(N->getTargetOpcode());
- assert(TID.ImplicitDefs && "Physical reg def must be in implicit def list!");
- unsigned NumRes = TID.getNumDefs();
- for (const unsigned *ImpDef = TID.getImplicitDefs(); *ImpDef; ++ImpDef) {
- if (Reg == *ImpDef)
- break;
- ++NumRes;
- }
- return N->getValueType(NumRes);
-}
-
-/// DelayForLiveRegsBottomUp - Returns true if it is necessary to delay
-/// scheduling of the given node to satisfy live physical register dependencies.
-/// If the specific node is the last one that's available to schedule, do
-/// whatever is necessary (i.e. backtracking or cloning) to make it possible.
-bool ScheduleDAGRRList::DelayForLiveRegsBottomUp(SUnit *SU,
- SmallVector<unsigned, 4> &LRegs){
- if (LiveRegs.empty())
- return false;
-
- SmallSet<unsigned, 4> RegAdded;
- // If this node would clobber any "live" register, then it's not ready.
- for (SUnit::pred_iterator I = SU->Preds.begin(), E = SU->Preds.end();
- I != E; ++I) {
- if (I->Cost < 0) {
- unsigned Reg = I->Reg;
- if (LiveRegs.count(Reg) && LiveRegDefs[Reg] != I->Dep) {
- if (RegAdded.insert(Reg))
- LRegs.push_back(Reg);
- }
- for (const unsigned *Alias = TRI->getAliasSet(Reg);
- *Alias; ++Alias)
- if (LiveRegs.count(*Alias) && LiveRegDefs[*Alias] != I->Dep) {
- if (RegAdded.insert(*Alias))
- LRegs.push_back(*Alias);
- }
- }
- }
-
- for (unsigned i = 0, e = SU->FlaggedNodes.size()+1; i != e; ++i) {
- SDNode *Node = (i == 0) ? SU->Node : SU->FlaggedNodes[i-1];
- if (!Node || !Node->isTargetOpcode())
- continue;
- const TargetInstrDesc &TID = TII->get(Node->getTargetOpcode());
- if (!TID.ImplicitDefs)
- continue;
- for (const unsigned *Reg = TID.ImplicitDefs; *Reg; ++Reg) {
- if (LiveRegs.count(*Reg) && LiveRegDefs[*Reg] != SU) {
- if (RegAdded.insert(*Reg))
- LRegs.push_back(*Reg);
- }
- for (const unsigned *Alias = TRI->getAliasSet(*Reg);
- *Alias; ++Alias)
- if (LiveRegs.count(*Alias) && LiveRegDefs[*Alias] != SU) {
- if (RegAdded.insert(*Alias))
- LRegs.push_back(*Alias);
- }
- }
- }
- return !LRegs.empty();
-}
-
-
-/// ListScheduleBottomUp - The main loop of list scheduling for bottom-up
-/// schedulers.
-void ScheduleDAGRRList::ListScheduleBottomUp() {
- unsigned CurCycle = 0;
- // Add root to Available queue.
- if (!SUnits.empty()) {
- SUnit *RootSU = SUnitMap[DAG.getRoot().Val].front();
- assert(RootSU->Succs.empty() && "Graph root shouldn't have successors!");
- RootSU->isAvailable = true;
- AvailableQueue->push(RootSU);
- }
-
- // While Available queue is not empty, grab the node with the highest
- // priority. If it is not ready put it back. Schedule the node.
- SmallVector<SUnit*, 4> NotReady;
- while (!AvailableQueue->empty()) {
- bool Delayed = false;
- DenseMap<SUnit*, SmallVector<unsigned, 4> > LRegsMap;
- SUnit *CurSU = AvailableQueue->pop();
- while (CurSU) {
- if (CurSU->CycleBound <= CurCycle) {
- SmallVector<unsigned, 4> LRegs;
- if (!DelayForLiveRegsBottomUp(CurSU, LRegs))
- break;
- Delayed = true;
- LRegsMap.insert(std::make_pair(CurSU, LRegs));
- }
-
- CurSU->isPending = true; // This SU is not in AvailableQueue right now.
- NotReady.push_back(CurSU);
- CurSU = AvailableQueue->pop();
- }
-
- // All candidates are delayed due to live physical reg dependencies.
- // Try backtracking, code duplication, or inserting cross class copies
- // to resolve it.
- if (Delayed && !CurSU) {
- for (unsigned i = 0, e = NotReady.size(); i != e; ++i) {
- SUnit *TrySU = NotReady[i];
- SmallVector<unsigned, 4> &LRegs = LRegsMap[TrySU];
-
- // Try unscheduling up to the point where it's safe to schedule
- // this node.
- unsigned LiveCycle = CurCycle;
- for (unsigned j = 0, ee = LRegs.size(); j != ee; ++j) {
- unsigned Reg = LRegs[j];
- unsigned LCycle = LiveRegCycles[Reg];
- LiveCycle = std::min(LiveCycle, LCycle);
- }
- SUnit *OldSU = Sequence[LiveCycle];
- if (!WillCreateCycle(TrySU, OldSU)) {
- BacktrackBottomUp(TrySU, LiveCycle, CurCycle);
- // Force the current node to be scheduled before the node that
- // requires the physical reg dep.
- if (OldSU->isAvailable) {
- OldSU->isAvailable = false;
- AvailableQueue->remove(OldSU);
- }
- AddPred(TrySU, OldSU, true, true);
- // If one or more successors has been unscheduled, then the current
- // node is no longer avaialable. Schedule a successor that's now
- // available instead.
- if (!TrySU->isAvailable)
- CurSU = AvailableQueue->pop();
- else {
- CurSU = TrySU;
- TrySU->isPending = false;
- NotReady.erase(NotReady.begin()+i);
- }
- break;
- }
- }
-
- if (!CurSU) {
- // Can't backtrack. Try duplicating the nodes that produces these
- // "expensive to copy" values to break the dependency. In case even
- // that doesn't work, insert cross class copies.
- SUnit *TrySU = NotReady[0];
- SmallVector<unsigned, 4> &LRegs = LRegsMap[TrySU];
- assert(LRegs.size() == 1 && "Can't handle this yet!");
- unsigned Reg = LRegs[0];
- SUnit *LRDef = LiveRegDefs[Reg];
- SUnit *NewDef = CopyAndMoveSuccessors(LRDef);
- if (!NewDef) {
- // Issue expensive cross register class copies.
- MVT::ValueType VT = getPhysicalRegisterVT(LRDef->Node, Reg, TII);
- const TargetRegisterClass *RC =
- TRI->getPhysicalRegisterRegClass(Reg, VT);
- const TargetRegisterClass *DestRC = TRI->getCrossCopyRegClass(RC);
- if (!DestRC) {
- assert(false && "Don't know how to copy this physical register!");
- abort();
- }
- SmallVector<SUnit*, 2> Copies;
- InsertCCCopiesAndMoveSuccs(LRDef, Reg, DestRC, RC, Copies);
- DOUT << "Adding an edge from SU # " << TrySU->NodeNum
- << " to SU #" << Copies.front()->NodeNum << "\n";
- AddPred(TrySU, Copies.front(), true, true);
- NewDef = Copies.back();
- }
-
- DOUT << "Adding an edge from SU # " << NewDef->NodeNum
- << " to SU #" << TrySU->NodeNum << "\n";
- LiveRegDefs[Reg] = NewDef;
- AddPred(NewDef, TrySU, true, true);
- TrySU->isAvailable = false;
- CurSU = NewDef;
- }
-
- if (!CurSU) {
- assert(false && "Unable to resolve live physical register dependencies!");
- abort();
- }
- }
-
- // Add the nodes that aren't ready back onto the available list.
- for (unsigned i = 0, e = NotReady.size(); i != e; ++i) {
- NotReady[i]->isPending = false;
- // May no longer be available due to backtracking.
- if (NotReady[i]->isAvailable)
- AvailableQueue->push(NotReady[i]);
- }
- NotReady.clear();
-
- if (!CurSU)
- Sequence.push_back(0);
- else {
- ScheduleNodeBottomUp(CurSU, CurCycle);
- Sequence.push_back(CurSU);
- }
- ++CurCycle;
- }
-
- // Reverse the order if it is bottom up.
- std::reverse(Sequence.begin(), Sequence.end());
-
-
-#ifndef NDEBUG
- // Verify that all SUnits were scheduled.
- bool AnyNotSched = false;
- unsigned DeadNodes = 0;
- unsigned Noops = 0;
- for (unsigned i = 0, e = SUnits.size(); i != e; ++i) {
- if (!SUnits[i].isScheduled) {
- if (SUnits[i].NumPreds == 0 && SUnits[i].NumSuccs == 0) {
- ++DeadNodes;
- continue;
- }
- if (!AnyNotSched)
- cerr << "*** List scheduling failed! ***\n";
- SUnits[i].dump(&DAG);
- cerr << "has not been scheduled!\n";
- AnyNotSched = true;
- }
- if (SUnits[i].NumSuccsLeft != 0) {
- if (!AnyNotSched)
- cerr << "*** List scheduling failed! ***\n";
- SUnits[i].dump(&DAG);
- cerr << "has successors left!\n";
- AnyNotSched = true;
- }
- }
- for (unsigned i = 0, e = Sequence.size(); i != e; ++i)
- if (!Sequence[i])
- ++Noops;
- assert(!AnyNotSched);
- assert(Sequence.size() + DeadNodes - Noops == SUnits.size() &&
- "The number of nodes scheduled doesn't match the expected number!");
-#endif
-}
-
-//===----------------------------------------------------------------------===//
-// Top-Down Scheduling
-//===----------------------------------------------------------------------===//
-
-/// ReleaseSucc - Decrement the NumPredsLeft count of a successor. Add it to
-/// the AvailableQueue if the count reaches zero. Also update its cycle bound.
-void ScheduleDAGRRList::ReleaseSucc(SUnit *SuccSU, bool isChain,
- unsigned CurCycle) {
- // FIXME: the distance between two nodes is not always == the predecessor's
- // latency. For example, the reader can very well read the register written
- // by the predecessor later than the issue cycle. It also depends on the
- // interrupt model (drain vs. freeze).
- SuccSU->CycleBound = std::max(SuccSU->CycleBound, CurCycle + SuccSU->Latency);
-
- --SuccSU->NumPredsLeft;
-
-#ifndef NDEBUG
- if (SuccSU->NumPredsLeft < 0) {
- cerr << "*** List scheduling failed! ***\n";
- SuccSU->dump(&DAG);
- cerr << " has been released too many times!\n";
- assert(0);
- }
-#endif
-
- if (SuccSU->NumPredsLeft == 0) {
- SuccSU->isAvailable = true;
- AvailableQueue->push(SuccSU);
- }
-}
-
-
-/// ScheduleNodeTopDown - Add the node to the schedule. Decrement the pending
-/// count of its successors. If a successor pending count is zero, add it to
-/// the Available queue.
-void ScheduleDAGRRList::ScheduleNodeTopDown(SUnit *SU, unsigned CurCycle) {
- DOUT << "*** Scheduling [" << CurCycle << "]: ";
- DEBUG(SU->dump(&DAG));
- SU->Cycle = CurCycle;
-
- AvailableQueue->ScheduledNode(SU);
-
- // Top down: release successors
- for (SUnit::succ_iterator I = SU->Succs.begin(), E = SU->Succs.end();
- I != E; ++I)
- ReleaseSucc(I->Dep, I->isCtrl, CurCycle);
- SU->isScheduled = true;
-}
-
-/// ListScheduleTopDown - The main loop of list scheduling for top-down
-/// schedulers.
-void ScheduleDAGRRList::ListScheduleTopDown() {
- unsigned CurCycle = 0;
-
- // All leaves to Available queue.
- for (unsigned i = 0, e = SUnits.size(); i != e; ++i) {
- // It is available if it has no predecessors.
- if (SUnits[i].Preds.empty()) {
- AvailableQueue->push(&SUnits[i]);
- SUnits[i].isAvailable = true;
- }
- }
-
- // While Available queue is not empty, grab the node with the highest
- // priority. If it is not ready put it back. Schedule the node.
- std::vector<SUnit*> NotReady;
- while (!AvailableQueue->empty()) {
- SUnit *CurSU = AvailableQueue->pop();
- while (CurSU && CurSU->CycleBound > CurCycle) {
- NotReady.push_back(CurSU);
- CurSU = AvailableQueue->pop();
- }
-
- // Add the nodes that aren't ready back onto the available list.
- AvailableQueue->push_all(NotReady);
- NotReady.clear();
-
- if (!CurSU)
- Sequence.push_back(0);
- else {
- ScheduleNodeTopDown(CurSU, CurCycle);
- Sequence.push_back(CurSU);
- }
- ++CurCycle;
- }
-
-
-#ifndef NDEBUG
- // Verify that all SUnits were scheduled.
- bool AnyNotSched = false;
- unsigned DeadNodes = 0;
- unsigned Noops = 0;
- for (unsigned i = 0, e = SUnits.size(); i != e; ++i) {
- if (!SUnits[i].isScheduled) {
- if (SUnits[i].NumPreds == 0 && SUnits[i].NumSuccs == 0) {
- ++DeadNodes;
- continue;
- }
- if (!AnyNotSched)
- cerr << "*** List scheduling failed! ***\n";
- SUnits[i].dump(&DAG);
- cerr << "has not been scheduled!\n";
- AnyNotSched = true;
- }
- if (SUnits[i].NumPredsLeft != 0) {
- if (!AnyNotSched)
- cerr << "*** List scheduling failed! ***\n";
- SUnits[i].dump(&DAG);
- cerr << "has predecessors left!\n";
- AnyNotSched = true;
- }
- }
- for (unsigned i = 0, e = Sequence.size(); i != e; ++i)
- if (!Sequence[i])
- ++Noops;
- assert(!AnyNotSched);
- assert(Sequence.size() + DeadNodes - Noops == SUnits.size() &&
- "The number of nodes scheduled doesn't match the expected number!");
-#endif
-}
-
-
-
-//===----------------------------------------------------------------------===//
-// RegReductionPriorityQueue Implementation
-//===----------------------------------------------------------------------===//
-//
-// This is a SchedulingPriorityQueue that schedules using Sethi Ullman numbers
-// to reduce register pressure.
-//
-namespace {
- template<class SF>
- class RegReductionPriorityQueue;
-
- /// Sorting functions for the Available queue.
- struct bu_ls_rr_sort : public std::binary_function<SUnit*, SUnit*, bool> {
- RegReductionPriorityQueue<bu_ls_rr_sort> *SPQ;
- bu_ls_rr_sort(RegReductionPriorityQueue<bu_ls_rr_sort> *spq) : SPQ(spq) {}
- bu_ls_rr_sort(const bu_ls_rr_sort &RHS) : SPQ(RHS.SPQ) {}
-
- bool operator()(const SUnit* left, const SUnit* right) const;
- };
-
- struct td_ls_rr_sort : public std::binary_function<SUnit*, SUnit*, bool> {
- RegReductionPriorityQueue<td_ls_rr_sort> *SPQ;
- td_ls_rr_sort(RegReductionPriorityQueue<td_ls_rr_sort> *spq) : SPQ(spq) {}
- td_ls_rr_sort(const td_ls_rr_sort &RHS) : SPQ(RHS.SPQ) {}
-
- bool operator()(const SUnit* left, const SUnit* right) const;
- };
-} // end anonymous namespace
-
-static inline bool isCopyFromLiveIn(const SUnit *SU) {
- SDNode *N = SU->Node;
- return N && N->getOpcode() == ISD::CopyFromReg &&
- N->getOperand(N->getNumOperands()-1).getValueType() != MVT::Flag;
-}
-
-namespace {
- template<class SF>
- class VISIBILITY_HIDDEN RegReductionPriorityQueue
- : public SchedulingPriorityQueue {
- std::set<SUnit*, SF> Queue;
- unsigned currentQueueId;
-
- public:
- RegReductionPriorityQueue() :
- Queue(SF(this)), currentQueueId(0) {}
-
- virtual void initNodes(DenseMap<SDNode*, std::vector<SUnit*> > &sumap,
- std::vector<SUnit> &sunits) {}
-
- virtual void addNode(const SUnit *SU) {}
-
- virtual void updateNode(const SUnit *SU) {}
-
- virtual void releaseState() {}
-
- virtual unsigned getNodePriority(const SUnit *SU) const {
- return 0;
- }
-
- unsigned size() const { return Queue.size(); }
-
- bool empty() const { return Queue.empty(); }
-
- void push(SUnit *U) {
- assert(!U->NodeQueueId && "Node in the queue already");
- U->NodeQueueId = ++currentQueueId;
- Queue.insert(U);
- }
-
- void push_all(const std::vector<SUnit *> &Nodes) {
- for (unsigned i = 0, e = Nodes.size(); i != e; ++i)
- push(Nodes[i]);
- }
-
- SUnit *pop() {
- if (empty()) return NULL;
- typename std::set<SUnit*, SF>::iterator i = prior(Queue.end());
- SUnit *V = *i;
- Queue.erase(i);
- V->NodeQueueId = 0;
- return V;
- }
-
- void remove(SUnit *SU) {
- assert(!Queue.empty() && "Queue is empty!");
- size_t RemovedNum = Queue.erase(SU);
- assert(RemovedNum > 0 && "Not in queue!");
- assert(RemovedNum == 1 && "Multiple times in the queue!");
- SU->NodeQueueId = 0;
- }
- };
-
- template<class SF>
- class VISIBILITY_HIDDEN BURegReductionPriorityQueue
- : public RegReductionPriorityQueue<SF> {
- // SUnitMap SDNode to SUnit mapping (n -> n).
- DenseMap<SDNode*, std::vector<SUnit*> > *SUnitMap;
-
- // SUnits - The SUnits for the current graph.
- const std::vector<SUnit> *SUnits;
-
- // SethiUllmanNumbers - The SethiUllman number for each node.
- std::vector<unsigned> SethiUllmanNumbers;
-
- const TargetInstrInfo *TII;
- const TargetRegisterInfo *TRI;
- ScheduleDAGRRList *scheduleDAG;
- public:
- explicit BURegReductionPriorityQueue(const TargetInstrInfo *tii,
- const TargetRegisterInfo *tri)
- : TII(tii), TRI(tri), scheduleDAG(NULL) {}
-
- void initNodes(DenseMap<SDNode*, std::vector<SUnit*> > &sumap,
- std::vector<SUnit> &sunits) {
- SUnitMap = &sumap;
- SUnits = &sunits;
- // Add pseudo dependency edges for two-address nodes.
- AddPseudoTwoAddrDeps();
- // Calculate node priorities.
- CalculateSethiUllmanNumbers();
- }
-
- void addNode(const SUnit *SU) {
- SethiUllmanNumbers.resize(SUnits->size(), 0);
- CalcNodeSethiUllmanNumber(SU);
- }
-
- void updateNode(const SUnit *SU) {
- SethiUllmanNumbers[SU->NodeNum] = 0;
- CalcNodeSethiUllmanNumber(SU);
- }
-
- void releaseState() {
- SUnits = 0;
- SethiUllmanNumbers.clear();
- }
-
- unsigned getNodePriority(const SUnit *SU) const {
- assert(SU->NodeNum < SethiUllmanNumbers.size());
- unsigned Opc = SU->Node ? SU->Node->getOpcode() : 0;
- if (Opc == ISD::CopyFromReg && !isCopyFromLiveIn(SU))
- // CopyFromReg should be close to its def because it restricts
- // allocation choices. But if it is a livein then perhaps we want it
- // closer to its uses so it can be coalesced.
- return 0xffff;
- else if (Opc == ISD::TokenFactor || Opc == ISD::CopyToReg)
- // CopyToReg should be close to its uses to facilitate coalescing and
- // avoid spilling.
- return 0;
- else if (Opc == TargetInstrInfo::EXTRACT_SUBREG ||
- Opc == TargetInstrInfo::INSERT_SUBREG)
- // EXTRACT_SUBREG / INSERT_SUBREG should be close to its use to
- // facilitate coalescing.
- return 0;
- else if (SU->NumSuccs == 0)
- // If SU does not have a use, i.e. it doesn't produce a value that would
- // be consumed (e.g. store), then it terminates a chain of computation.
- // Give it a large SethiUllman number so it will be scheduled right
- // before its predecessors that it doesn't lengthen their live ranges.
- return 0xffff;
- else if (SU->NumPreds == 0)
- // If SU does not have a def, schedule it close to its uses because it
- // does not lengthen any live ranges.
- return 0;
- else
- return SethiUllmanNumbers[SU->NodeNum];
- }
-
- void setScheduleDAG(ScheduleDAGRRList *scheduleDag) {
- scheduleDAG = scheduleDag;
- }
-
- private:
- bool canClobber(const SUnit *SU, const SUnit *Op);
- void AddPseudoTwoAddrDeps();
- void CalculateSethiUllmanNumbers();
- unsigned CalcNodeSethiUllmanNumber(const SUnit *SU);
- };
-
-
- template<class SF>
- class VISIBILITY_HIDDEN TDRegReductionPriorityQueue
- : public RegReductionPriorityQueue<SF> {
- // SUnitMap SDNode to SUnit mapping (n -> n).
- DenseMap<SDNode*, std::vector<SUnit*> > *SUnitMap;
-
- // SUnits - The SUnits for the current graph.
- const std::vector<SUnit> *SUnits;
-
- // SethiUllmanNumbers - The SethiUllman number for each node.
- std::vector<unsigned> SethiUllmanNumbers;
-
- public:
- TDRegReductionPriorityQueue() {}
-
- void initNodes(DenseMap<SDNode*, std::vector<SUnit*> > &sumap,
- std::vector<SUnit> &sunits) {
- SUnitMap = &sumap;
- SUnits = &sunits;
- // Calculate node priorities.
- CalculateSethiUllmanNumbers();
- }
-
- void addNode(const SUnit *SU) {
- SethiUllmanNumbers.resize(SUnits->size(), 0);
- CalcNodeSethiUllmanNumber(SU);
- }
-
- void updateNode(const SUnit *SU) {
- SethiUllmanNumbers[SU->NodeNum] = 0;
- CalcNodeSethiUllmanNumber(SU);
- }
-
- void releaseState() {
- SUnits = 0;
- SethiUllmanNumbers.clear();
- }
-
- unsigned getNodePriority(const SUnit *SU) const {
- assert(SU->NodeNum < SethiUllmanNumbers.size());
- return SethiUllmanNumbers[SU->NodeNum];
- }
-
- private:
- void CalculateSethiUllmanNumbers();
- unsigned CalcNodeSethiUllmanNumber(const SUnit *SU);
- };
-}
-
-/// closestSucc - Returns the scheduled cycle of the successor which is
-/// closet to the current cycle.
-static unsigned closestSucc(const SUnit *SU) {
- unsigned MaxCycle = 0;
- for (SUnit::const_succ_iterator I = SU->Succs.begin(), E = SU->Succs.end();
- I != E; ++I) {
- unsigned Cycle = I->Dep->Cycle;
- // If there are bunch of CopyToRegs stacked up, they should be considered
- // to be at the same position.
- if (I->Dep->Node && I->Dep->Node->getOpcode() == ISD::CopyToReg)
- Cycle = closestSucc(I->Dep)+1;
- if (Cycle > MaxCycle)
- MaxCycle = Cycle;
- }
- return MaxCycle;
-}
-
-/// calcMaxScratches - Returns an cost estimate of the worse case requirement
-/// for scratch registers. Live-in operands and live-out results don't count
-/// since they are "fixed".
-static unsigned calcMaxScratches(const SUnit *SU) {
- unsigned Scratches = 0;
- for (SUnit::const_pred_iterator I = SU->Preds.begin(), E = SU->Preds.end();
- I != E; ++I) {
- if (I->isCtrl) continue; // ignore chain preds
- if (!I->Dep->Node || I->Dep->Node->getOpcode() != ISD::CopyFromReg)
- Scratches++;
- }
- for (SUnit::const_succ_iterator I = SU->Succs.begin(), E = SU->Succs.end();
- I != E; ++I) {
- if (I->isCtrl) continue; // ignore chain succs
- if (!I->Dep->Node || I->Dep->Node->getOpcode() != ISD::CopyToReg)
- Scratches += 10;
- }
- return Scratches;
-}
-
-// Bottom up
-bool bu_ls_rr_sort::operator()(const SUnit *left, const SUnit *right) const {
-
- unsigned LPriority = SPQ->getNodePriority(left);
- unsigned RPriority = SPQ->getNodePriority(right);
- if (LPriority != RPriority)
- return LPriority > RPriority;
-
- // Try schedule def + use closer when Sethi-Ullman numbers are the same.
- // e.g.
- // t1 = op t2, c1
- // t3 = op t4, c2
- //
- // and the following instructions are both ready.
- // t2 = op c3
- // t4 = op c4
- //
- // Then schedule t2 = op first.
- // i.e.
- // t4 = op c4
- // t2 = op c3
- // t1 = op t2, c1
- // t3 = op t4, c2
- //
- // This creates more short live intervals.
- unsigned LDist = closestSucc(left);
- unsigned RDist = closestSucc(right);
- if (LDist != RDist)
- return LDist < RDist;
-
- // Intuitively, it's good to push down instructions whose results are
- // liveout so their long live ranges won't conflict with other values
- // which are needed inside the BB. Further prioritize liveout instructions
- // by the number of operands which are calculated within the BB.
- unsigned LScratch = calcMaxScratches(left);
- unsigned RScratch = calcMaxScratches(right);
- if (LScratch != RScratch)
- return LScratch > RScratch;
-
- if (left->Height != right->Height)
- return left->Height > right->Height;
-
- if (left->Depth != right->Depth)
- return left->Depth < right->Depth;
-
- if (left->CycleBound != right->CycleBound)
- return left->CycleBound > right->CycleBound;
-
- assert(left->NodeQueueId && right->NodeQueueId &&
- "NodeQueueId cannot be zero");
- return (left->NodeQueueId > right->NodeQueueId);
-}
-
-template<class SF> bool
-BURegReductionPriorityQueue<SF>::canClobber(const SUnit *SU, const SUnit *Op) {
- if (SU->isTwoAddress) {
- unsigned Opc = SU->Node->getTargetOpcode();
- const TargetInstrDesc &TID = TII->get(Opc);
- unsigned NumRes = TID.getNumDefs();
- unsigned NumOps = TID.getNumOperands() - NumRes;
- for (unsigned i = 0; i != NumOps; ++i) {
- if (TID.getOperandConstraint(i+NumRes, TOI::TIED_TO) != -1) {
- SDNode *DU = SU->Node->getOperand(i).Val;
- if ((*SUnitMap).find(DU) != (*SUnitMap).end() &&
- Op == (*SUnitMap)[DU][SU->InstanceNo])
- return true;
- }
- }
- }
- return false;
-}
-
-
-/// hasCopyToRegUse - Return true if SU has a value successor that is a
-/// CopyToReg node.
-static bool hasCopyToRegUse(SUnit *SU) {
- for (SUnit::const_succ_iterator I = SU->Succs.begin(), E = SU->Succs.end();
- I != E; ++I) {
- if (I->isCtrl) continue;
- SUnit *SuccSU = I->Dep;
- if (SuccSU->Node && SuccSU->Node->getOpcode() == ISD::CopyToReg)
- return true;
- }
- return false;
-}
-
-/// canClobberPhysRegDefs - True if SU would clobber one of SuccSU's
-/// physical register def.
-static bool canClobberPhysRegDefs(SUnit *SuccSU, SUnit *SU,
- const TargetInstrInfo *TII,
- const TargetRegisterInfo *TRI) {
- SDNode *N = SuccSU->Node;
- unsigned NumDefs = TII->get(N->getTargetOpcode()).getNumDefs();
- const unsigned *ImpDefs = TII->get(N->getTargetOpcode()).getImplicitDefs();
- if (!ImpDefs)
- return false;
- const unsigned *SUImpDefs =
- TII->get(SU->Node->getTargetOpcode()).getImplicitDefs();
- if (!SUImpDefs)
- return false;
- for (unsigned i = NumDefs, e = N->getNumValues(); i != e; ++i) {
- MVT::ValueType VT = N->getValueType(i);
- if (VT == MVT::Flag || VT == MVT::Other)
- continue;
- unsigned Reg = ImpDefs[i - NumDefs];
- for (;*SUImpDefs; ++SUImpDefs) {
- unsigned SUReg = *SUImpDefs;
- if (TRI->regsOverlap(Reg, SUReg))
- return true;
- }
- }
- return false;
-}
-
-/// AddPseudoTwoAddrDeps - If two nodes share an operand and one of them uses
-/// it as a def&use operand. Add a pseudo control edge from it to the other
-/// node (if it won't create a cycle) so the two-address one will be scheduled
-/// first (lower in the schedule). If both nodes are two-address, favor the
-/// one that has a CopyToReg use (more likely to be a loop induction update).
-/// If both are two-address, but one is commutable while the other is not
-/// commutable, favor the one that's not commutable.
-template<class SF>
-void BURegReductionPriorityQueue<SF>::AddPseudoTwoAddrDeps() {
- for (unsigned i = 0, e = SUnits->size(); i != e; ++i) {
- SUnit *SU = (SUnit *)&((*SUnits)[i]);
- if (!SU->isTwoAddress)
- continue;
-
- SDNode *Node = SU->Node;
- if (!Node || !Node->isTargetOpcode() || SU->FlaggedNodes.size() > 0)
- continue;
-
- unsigned Opc = Node->getTargetOpcode();
- const TargetInstrDesc &TID = TII->get(Opc);
- unsigned NumRes = TID.getNumDefs();
- unsigned NumOps = TID.getNumOperands() - NumRes;
- for (unsigned j = 0; j != NumOps; ++j) {
- if (TID.getOperandConstraint(j+NumRes, TOI::TIED_TO) != -1) {
- SDNode *DU = SU->Node->getOperand(j).Val;
- if ((*SUnitMap).find(DU) == (*SUnitMap).end())
- continue;
- SUnit *DUSU = (*SUnitMap)[DU][SU->InstanceNo];
- if (!DUSU) continue;
- for (SUnit::succ_iterator I = DUSU->Succs.begin(),E = DUSU->Succs.end();
- I != E; ++I) {
- if (I->isCtrl) continue;
- SUnit *SuccSU = I->Dep;
- if (SuccSU == SU)
- continue;
- // Be conservative. Ignore if nodes aren't at roughly the same
- // depth and height.
- if (SuccSU->Height < SU->Height && (SU->Height - SuccSU->Height) > 1)
- continue;
- if (!SuccSU->Node || !SuccSU->Node->isTargetOpcode())
- continue;
- // Don't constrain nodes with physical register defs if the
- // predecessor can clobber them.
- if (SuccSU->hasPhysRegDefs) {
- if (canClobberPhysRegDefs(SuccSU, SU, TII, TRI))
- continue;
- }
- // Don't constraint extract_subreg / insert_subreg these may be
- // coalesced away. We don't them close to their uses.
- unsigned SuccOpc = SuccSU->Node->getTargetOpcode();
- if (SuccOpc == TargetInstrInfo::EXTRACT_SUBREG ||
- SuccOpc == TargetInstrInfo::INSERT_SUBREG)
- continue;
- if ((!canClobber(SuccSU, DUSU) ||
- (hasCopyToRegUse(SU) && !hasCopyToRegUse(SuccSU)) ||
- (!SU->isCommutable && SuccSU->isCommutable)) &&
- !scheduleDAG->IsReachable(SuccSU, SU)) {
- DOUT << "Adding an edge from SU # " << SU->NodeNum
- << " to SU #" << SuccSU->NodeNum << "\n";
- scheduleDAG->AddPred(SU, SuccSU, true, true);
- }
- }
- }
- }
- }
-}
-
-/// CalcNodeSethiUllmanNumber - Priority is the Sethi Ullman number.
-/// Smaller number is the higher priority.
-template<class SF>
-unsigned BURegReductionPriorityQueue<SF>::
-CalcNodeSethiUllmanNumber(const SUnit *SU) {
- unsigned &SethiUllmanNumber = SethiUllmanNumbers[SU->NodeNum];
- if (SethiUllmanNumber != 0)
- return SethiUllmanNumber;
-
- unsigned Extra = 0;
- for (SUnit::const_pred_iterator I = SU->Preds.begin(), E = SU->Preds.end();
- I != E; ++I) {
- if (I->isCtrl) continue; // ignore chain preds
- SUnit *PredSU = I->Dep;
- unsigned PredSethiUllman = CalcNodeSethiUllmanNumber(PredSU);
- if (PredSethiUllman > SethiUllmanNumber) {
- SethiUllmanNumber = PredSethiUllman;
- Extra = 0;
- } else if (PredSethiUllman == SethiUllmanNumber && !I->isCtrl)
- ++Extra;
- }
-
- SethiUllmanNumber += Extra;
-
- if (SethiUllmanNumber == 0)
- SethiUllmanNumber = 1;
-
- return SethiUllmanNumber;
-}
-
-/// CalculateSethiUllmanNumbers - Calculate Sethi-Ullman numbers of all
-/// scheduling units.
-template<class SF>
-void BURegReductionPriorityQueue<SF>::CalculateSethiUllmanNumbers() {
- SethiUllmanNumbers.assign(SUnits->size(), 0);
-
- for (unsigned i = 0, e = SUnits->size(); i != e; ++i)
- CalcNodeSethiUllmanNumber(&(*SUnits)[i]);
-}
-
-/// LimitedSumOfUnscheduledPredsOfSuccs - Compute the sum of the unscheduled
-/// predecessors of the successors of the SUnit SU. Stop when the provided
-/// limit is exceeded.
-static unsigned LimitedSumOfUnscheduledPredsOfSuccs(const SUnit *SU,
- unsigned Limit) {
- unsigned Sum = 0;
- for (SUnit::const_succ_iterator I = SU->Succs.begin(), E = SU->Succs.end();
- I != E; ++I) {
- SUnit *SuccSU = I->Dep;
- for (SUnit::const_pred_iterator II = SuccSU->Preds.begin(),
- EE = SuccSU->Preds.end(); II != EE; ++II) {
- SUnit *PredSU = II->Dep;
- if (!PredSU->isScheduled)
- if (++Sum > Limit)
- return Sum;
- }
- }
- return Sum;
-}
-
-
-// Top down
-bool td_ls_rr_sort::operator()(const SUnit *left, const SUnit *right) const {
- unsigned LPriority = SPQ->getNodePriority(left);
- unsigned RPriority = SPQ->getNodePriority(right);
- bool LIsTarget = left->Node && left->Node->isTargetOpcode();
- bool RIsTarget = right->Node && right->Node->isTargetOpcode();
- bool LIsFloater = LIsTarget && left->NumPreds == 0;
- bool RIsFloater = RIsTarget && right->NumPreds == 0;
- unsigned LBonus = (LimitedSumOfUnscheduledPredsOfSuccs(left,1) == 1) ? 2 : 0;
- unsigned RBonus = (LimitedSumOfUnscheduledPredsOfSuccs(right,1) == 1) ? 2 : 0;
-
- if (left->NumSuccs == 0 && right->NumSuccs != 0)
- return false;
- else if (left->NumSuccs != 0 && right->NumSuccs == 0)
- return true;
-
- if (LIsFloater)
- LBonus -= 2;
- if (RIsFloater)
- RBonus -= 2;
- if (left->NumSuccs == 1)
- LBonus += 2;
- if (right->NumSuccs == 1)
- RBonus += 2;
-
- if (LPriority+LBonus != RPriority+RBonus)
- return LPriority+LBonus < RPriority+RBonus;
-
- if (left->Depth != right->Depth)
- return left->Depth < right->Depth;
-
- if (left->NumSuccsLeft != right->NumSuccsLeft)
- return left->NumSuccsLeft > right->NumSuccsLeft;
-
- if (left->CycleBound != right->CycleBound)
- return left->CycleBound > right->CycleBound;
-
- assert(left->NodeQueueId && right->NodeQueueId &&
- "NodeQueueId cannot be zero");
- return (left->NodeQueueId > right->NodeQueueId);
-}
-
-/// CalcNodeSethiUllmanNumber - Priority is the Sethi Ullman number.
-/// Smaller number is the higher priority.
-template<class SF>
-unsigned TDRegReductionPriorityQueue<SF>::
-CalcNodeSethiUllmanNumber(const SUnit *SU) {
- unsigned &SethiUllmanNumber = SethiUllmanNumbers[SU->NodeNum];
- if (SethiUllmanNumber != 0)
- return SethiUllmanNumber;
-
- unsigned Opc = SU->Node ? SU->Node->getOpcode() : 0;
- if (Opc == ISD::TokenFactor || Opc == ISD::CopyToReg)
- SethiUllmanNumber = 0xffff;
- else if (SU->NumSuccsLeft == 0)
- // If SU does not have a use, i.e. it doesn't produce a value that would
- // be consumed (e.g. store), then it terminates a chain of computation.
- // Give it a small SethiUllman number so it will be scheduled right before
- // its predecessors that it doesn't lengthen their live ranges.
- SethiUllmanNumber = 0;
- else if (SU->NumPredsLeft == 0 &&
- (Opc != ISD::CopyFromReg || isCopyFromLiveIn(SU)))
- SethiUllmanNumber = 0xffff;
- else {
- int Extra = 0;
- for (SUnit::const_pred_iterator I = SU->Preds.begin(), E = SU->Preds.end();
- I != E; ++I) {
- if (I->isCtrl) continue; // ignore chain preds
- SUnit *PredSU = I->Dep;
- unsigned PredSethiUllman = CalcNodeSethiUllmanNumber(PredSU);
- if (PredSethiUllman > SethiUllmanNumber) {
- SethiUllmanNumber = PredSethiUllman;
- Extra = 0;
- } else if (PredSethiUllman == SethiUllmanNumber && !I->isCtrl)
- ++Extra;
- }
-
- SethiUllmanNumber += Extra;
- }
-
- return SethiUllmanNumber;
-}
-
-/// CalculateSethiUllmanNumbers - Calculate Sethi-Ullman numbers of all
-/// scheduling units.
-template<class SF>
-void TDRegReductionPriorityQueue<SF>::CalculateSethiUllmanNumbers() {
- SethiUllmanNumbers.assign(SUnits->size(), 0);
-
- for (unsigned i = 0, e = SUnits->size(); i != e; ++i)
- CalcNodeSethiUllmanNumber(&(*SUnits)[i]);
-}
-
-//===----------------------------------------------------------------------===//
-// Public Constructor Functions
-//===----------------------------------------------------------------------===//
-
-llvm::ScheduleDAG* llvm::createBURRListDAGScheduler(SelectionDAGISel *IS,
- SelectionDAG *DAG,
- MachineBasicBlock *BB) {
- const TargetInstrInfo *TII = DAG->getTarget().getInstrInfo();
- const TargetRegisterInfo *TRI = DAG->getTarget().getRegisterInfo();
-
- BURegReductionPriorityQueue<bu_ls_rr_sort> *priorityQueue =
- new BURegReductionPriorityQueue<bu_ls_rr_sort>(TII, TRI);
-
- ScheduleDAGRRList * scheduleDAG =
- new ScheduleDAGRRList(*DAG, BB, DAG->getTarget(), true, priorityQueue);
- priorityQueue->setScheduleDAG(scheduleDAG);
- return scheduleDAG;
-}
-
-llvm::ScheduleDAG* llvm::createTDRRListDAGScheduler(SelectionDAGISel *IS,
- SelectionDAG *DAG,
- MachineBasicBlock *BB) {
- return new ScheduleDAGRRList(*DAG, BB, DAG->getTarget(), false,
- new TDRegReductionPriorityQueue<td_ls_rr_sort>());
-}
-
diff --git a/release_23/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/release_23/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
deleted file mode 100644
index 3d5a126df1b8..000000000000
--- a/release_23/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+++ /dev/null
@@ -1,4718 +0,0 @@
-//===-- SelectionDAG.cpp - Implement the SelectionDAG data structures -----===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This implements the SelectionDAG class.
-//
-//===----------------------------------------------------------------------===//
-#include "llvm/CodeGen/SelectionDAG.h"
-#include "llvm/Constants.h"
-#include "llvm/GlobalAlias.h"
-#include "llvm/GlobalVariable.h"
-#include "llvm/Intrinsics.h"
-#include "llvm/DerivedTypes.h"
-#include "llvm/Assembly/Writer.h"
-#include "llvm/CallingConv.h"
-#include "llvm/CodeGen/MachineBasicBlock.h"
-#include "llvm/CodeGen/MachineConstantPool.h"
-#include "llvm/CodeGen/MachineFrameInfo.h"
-#include "llvm/CodeGen/MachineModuleInfo.h"
-#include "llvm/CodeGen/PseudoSourceValue.h"
-#include "llvm/Support/MathExtras.h"
-#include "llvm/Target/TargetRegisterInfo.h"
-#include "llvm/Target/TargetData.h"
-#include "llvm/Target/TargetLowering.h"
-#include "llvm/Target/TargetInstrInfo.h"
-#include "llvm/Target/TargetMachine.h"
-#include "llvm/ADT/SetVector.h"
-#include "llvm/ADT/SmallPtrSet.h"
-#include "llvm/ADT/SmallSet.h"
-#include "llvm/ADT/SmallVector.h"
-#include "llvm/ADT/StringExtras.h"
-#include <algorithm>
-#include <cmath>
-using namespace llvm;
-
-/// makeVTList - Return an instance of the SDVTList struct initialized with the
-/// specified members.
-static SDVTList makeVTList(const MVT::ValueType *VTs, unsigned NumVTs) {
- SDVTList Res = {VTs, NumVTs};
- return Res;
-}
-
-static const fltSemantics *MVTToAPFloatSemantics(MVT::ValueType VT) {
- switch (VT) {
- default: assert(0 && "Unknown FP format");
- case MVT::f32: return &APFloat::IEEEsingle;
- case MVT::f64: return &APFloat::IEEEdouble;
- case MVT::f80: return &APFloat::x87DoubleExtended;
- case MVT::f128: return &APFloat::IEEEquad;
- case MVT::ppcf128: return &APFloat::PPCDoubleDouble;
- }
-}
-
-SelectionDAG::DAGUpdateListener::~DAGUpdateListener() {}
-
-//===----------------------------------------------------------------------===//
-// ConstantFPSDNode Class
-//===----------------------------------------------------------------------===//
-
-/// isExactlyValue - We don't rely on operator== working on double values, as
-/// it returns true for things that are clearly not equal, like -0.0 and 0.0.
-/// As such, this method can be used to do an exact bit-for-bit comparison of
-/// two floating point values.
-bool ConstantFPSDNode::isExactlyValue(const APFloat& V) const {
- return Value.bitwiseIsEqual(V);
-}
-
-bool ConstantFPSDNode::isValueValidForType(MVT::ValueType VT,
- const APFloat& Val) {
- assert(MVT::isFloatingPoint(VT) && "Can only convert between FP types");
-
- // PPC long double cannot be converted to any other type.
- if (VT == MVT::ppcf128 ||
- &Val.getSemantics() == &APFloat::PPCDoubleDouble)
- return false;
-
- // convert modifies in place, so make a copy.
- APFloat Val2 = APFloat(Val);
- return Val2.convert(*MVTToAPFloatSemantics(VT),
- APFloat::rmNearestTiesToEven) == APFloat::opOK;
-}
-
-//===----------------------------------------------------------------------===//
-// ISD Namespace
-//===----------------------------------------------------------------------===//
-
-/// isBuildVectorAllOnes - Return true if the specified node is a
-/// BUILD_VECTOR where all of the elements are ~0 or undef.
-bool ISD::isBuildVectorAllOnes(const SDNode *N) {
- // Look through a bit convert.
- if (N->getOpcode() == ISD::BIT_CONVERT)
- N = N->getOperand(0).Val;
-
- if (N->getOpcode() != ISD::BUILD_VECTOR) return false;
-
- unsigned i = 0, e = N->getNumOperands();
-
- // Skip over all of the undef values.
- while (i != e && N->getOperand(i).getOpcode() == ISD::UNDEF)
- ++i;
-
- // Do not accept an all-undef vector.
- if (i == e) return false;
-
- // Do not accept build_vectors that aren't all constants or which have non-~0
- // elements.
- SDOperand NotZero = N->getOperand(i);
- if (isa<ConstantSDNode>(NotZero)) {
- if (!cast<ConstantSDNode>(NotZero)->isAllOnesValue())
- return false;
- } else if (isa<ConstantFPSDNode>(NotZero)) {
- if (!cast<ConstantFPSDNode>(NotZero)->getValueAPF().
- convertToAPInt().isAllOnesValue())
- return false;
- } else
- return false;
-
- // Okay, we have at least one ~0 value, check to see if the rest match or are
- // undefs.
- for (++i; i != e; ++i)
- if (N->getOperand(i) != NotZero &&
- N->getOperand(i).getOpcode() != ISD::UNDEF)
- return false;
- return true;
-}
-
-
-/// isBuildVectorAllZeros - Return true if the specified node is a
-/// BUILD_VECTOR where all of the elements are 0 or undef.
-bool ISD::isBuildVectorAllZeros(const SDNode *N) {
- // Look through a bit convert.
- if (N->getOpcode() == ISD::BIT_CONVERT)
- N = N->getOperand(0).Val;
-
- if (N->getOpcode() != ISD::BUILD_VECTOR) return false;
-
- unsigned i = 0, e = N->getNumOperands();
-
- // Skip over all of the undef values.
- while (i != e && N->getOperand(i).getOpcode() == ISD::UNDEF)
- ++i;
-
- // Do not accept an all-undef vector.
- if (i == e) return false;
-
- // Do not accept build_vectors that aren't all constants or which have non-~0
- // elements.
- SDOperand Zero = N->getOperand(i);
- if (isa<ConstantSDNode>(Zero)) {
- if (!cast<ConstantSDNode>(Zero)->isNullValue())
- return false;
- } else if (isa<ConstantFPSDNode>(Zero)) {
- if (!cast<ConstantFPSDNode>(Zero)->getValueAPF().isPosZero())
- return false;
- } else
- return false;
-
- // Okay, we have at least one ~0 value, check to see if the rest match or are
- // undefs.
- for (++i; i != e; ++i)
- if (N->getOperand(i) != Zero &&
- N->getOperand(i).getOpcode() != ISD::UNDEF)
- return false;
- return true;
-}
-
-/// isScalarToVector - Return true if the specified node is a
-/// ISD::SCALAR_TO_VECTOR node or a BUILD_VECTOR node where only the low
-/// element is not an undef.
-bool ISD::isScalarToVector(const SDNode *N) {
- if (N->getOpcode() == ISD::SCALAR_TO_VECTOR)
- return true;
-
- if (N->getOpcode() != ISD::BUILD_VECTOR)
- return false;
- if (N->getOperand(0).getOpcode() == ISD::UNDEF)
- return false;
- unsigned NumElems = N->getNumOperands();
- for (unsigned i = 1; i < NumElems; ++i) {
- SDOperand V = N->getOperand(i);
- if (V.getOpcode() != ISD::UNDEF)
- return false;
- }
- return true;
-}
-
-
-/// isDebugLabel - Return true if the specified node represents a debug
-/// label (i.e. ISD::LABEL or TargetInstrInfo::LABEL node and third operand
-/// is 0).
-bool ISD::isDebugLabel(const SDNode *N) {
- SDOperand Zero;
- if (N->getOpcode() == ISD::LABEL)
- Zero = N->getOperand(2);
- else if (N->isTargetOpcode() &&
- N->getTargetOpcode() == TargetInstrInfo::LABEL)
- // Chain moved to last operand.
- Zero = N->getOperand(1);
- else
- return false;
- return isa<ConstantSDNode>(Zero) && cast<ConstantSDNode>(Zero)->isNullValue();
-}
-
-/// getSetCCSwappedOperands - Return the operation corresponding to (Y op X)
-/// when given the operation for (X op Y).
-ISD::CondCode ISD::getSetCCSwappedOperands(ISD::CondCode Operation) {
- // To perform this operation, we just need to swap the L and G bits of the
- // operation.
- unsigned OldL = (Operation >> 2) & 1;
- unsigned OldG = (Operation >> 1) & 1;
- return ISD::CondCode((Operation & ~6) | // Keep the N, U, E bits
- (OldL << 1) | // New G bit
- (OldG << 2)); // New L bit.
-}
-
-/// getSetCCInverse - Return the operation corresponding to !(X op Y), where
-/// 'op' is a valid SetCC operation.
-ISD::CondCode ISD::getSetCCInverse(ISD::CondCode Op, bool isInteger) {
- unsigned Operation = Op;
- if (isInteger)
- Operation ^= 7; // Flip L, G, E bits, but not U.
- else
- Operation ^= 15; // Flip all of the condition bits.
- if (Operation > ISD::SETTRUE2)
- Operation &= ~8; // Don't let N and U bits get set.
- return ISD::CondCode(Operation);
-}
-
-
-/// isSignedOp - For an integer comparison, return 1 if the comparison is a
-/// signed operation and 2 if the result is an unsigned comparison. Return zero
-/// if the operation does not depend on the sign of the input (setne and seteq).
-static int isSignedOp(ISD::CondCode Opcode) {
- switch (Opcode) {
- default: assert(0 && "Illegal integer setcc operation!");
- case ISD::SETEQ:
- case ISD::SETNE: return 0;
- case ISD::SETLT:
- case ISD::SETLE:
- case ISD::SETGT:
- case ISD::SETGE: return 1;
- case ISD::SETULT:
- case ISD::SETULE:
- case ISD::SETUGT:
- case ISD::SETUGE: return 2;
- }
-}
-
-/// getSetCCOrOperation - Return the result of a logical OR between different
-/// comparisons of identical values: ((X op1 Y) | (X op2 Y)). This function
-/// returns SETCC_INVALID if it is not possible to represent the resultant
-/// comparison.
-ISD::CondCode ISD::getSetCCOrOperation(ISD::CondCode Op1, ISD::CondCode Op2,
- bool isInteger) {
- if (isInteger && (isSignedOp(Op1) | isSignedOp(Op2)) == 3)
- // Cannot fold a signed integer setcc with an unsigned integer setcc.
- return ISD::SETCC_INVALID;
-
- unsigned Op = Op1 | Op2; // Combine all of the condition bits.
-
- // If the N and U bits get set then the resultant comparison DOES suddenly
- // care about orderedness, and is true when ordered.
- if (Op > ISD::SETTRUE2)
- Op &= ~16; // Clear the U bit if the N bit is set.
-
- // Canonicalize illegal integer setcc's.
- if (isInteger && Op == ISD::SETUNE) // e.g. SETUGT | SETULT
- Op = ISD::SETNE;
-
- return ISD::CondCode(Op);
-}
-
-/// getSetCCAndOperation - Return the result of a logical AND between different
-/// comparisons of identical values: ((X op1 Y) & (X op2 Y)). This
-/// function returns zero if it is not possible to represent the resultant
-/// comparison.
-ISD::CondCode ISD::getSetCCAndOperation(ISD::CondCode Op1, ISD::CondCode Op2,
- bool isInteger) {
- if (isInteger && (isSignedOp(Op1) | isSignedOp(Op2)) == 3)
- // Cannot fold a signed setcc with an unsigned setcc.
- return ISD::SETCC_INVALID;
-
- // Combine all of the condition bits.
- ISD::CondCode Result = ISD::CondCode(Op1 & Op2);
-
- // Canonicalize illegal integer setcc's.
- if (isInteger) {
- switch (Result) {
- default: break;
- case ISD::SETUO : Result = ISD::SETFALSE; break; // SETUGT & SETULT
- case ISD::SETUEQ: Result = ISD::SETEQ ; break; // SETUGE & SETULE
- case ISD::SETOLT: Result = ISD::SETULT ; break; // SETULT & SETNE
- case ISD::SETOGT: Result = ISD::SETUGT ; break; // SETUGT & SETNE
- }
- }
-
- return Result;
-}
-
-const TargetMachine &SelectionDAG::getTarget() const {
- return TLI.getTargetMachine();
-}
-
-//===----------------------------------------------------------------------===//
-// SDNode Profile Support
-//===----------------------------------------------------------------------===//
-
-/// AddNodeIDOpcode - Add the node opcode to the NodeID data.
-///
-static void AddNodeIDOpcode(FoldingSetNodeID &ID, unsigned OpC) {
- ID.AddInteger(OpC);
-}
-
-/// AddNodeIDValueTypes - Value type lists are intern'd so we can represent them
-/// solely with their pointer.
-void AddNodeIDValueTypes(FoldingSetNodeID &ID, SDVTList VTList) {
- ID.AddPointer(VTList.VTs);
-}
-
-/// AddNodeIDOperands - Various routines for adding operands to the NodeID data.
-///
-static void AddNodeIDOperands(FoldingSetNodeID &ID,
- SDOperandPtr Ops, unsigned NumOps) {
- for (; NumOps; --NumOps, ++Ops) {
- ID.AddPointer(Ops->Val);
- ID.AddInteger(Ops->ResNo);
- }
-}
-
-static void AddNodeIDNode(FoldingSetNodeID &ID,
- unsigned short OpC, SDVTList VTList,
- SDOperandPtr OpList, unsigned N) {
- AddNodeIDOpcode(ID, OpC);
- AddNodeIDValueTypes(ID, VTList);
- AddNodeIDOperands(ID, OpList, N);
-}
-
-
-/// AddNodeIDNode - Generic routine for adding a nodes info to the NodeID
-/// data.
-static void AddNodeIDNode(FoldingSetNodeID &ID, SDNode *N) {
- AddNodeIDOpcode(ID, N->getOpcode());
- // Add the return value info.
- AddNodeIDValueTypes(ID, N->getVTList());
- // Add the operand info.
- AddNodeIDOperands(ID, N->op_begin(), N->getNumOperands());
-
- // Handle SDNode leafs with special info.
- switch (N->getOpcode()) {
- default: break; // Normal nodes don't need extra info.
- case ISD::ARG_FLAGS:
- ID.AddInteger(cast<ARG_FLAGSSDNode>(N)->getArgFlags().getRawBits());
- break;
- case ISD::TargetConstant:
- case ISD::Constant:
- ID.Add(cast<ConstantSDNode>(N)->getAPIntValue());
- break;
- case ISD::TargetConstantFP:
- case ISD::ConstantFP: {
- ID.Add(cast<ConstantFPSDNode>(N)->getValueAPF());
- break;
- }
- case ISD::TargetGlobalAddress:
- case ISD::GlobalAddress:
- case ISD::TargetGlobalTLSAddress:
- case ISD::GlobalTLSAddress: {
- GlobalAddressSDNode *GA = cast<GlobalAddressSDNode>(N);
- ID.AddPointer(GA->getGlobal());
- ID.AddInteger(GA->getOffset());
- break;
- }
- case ISD::BasicBlock:
- ID.AddPointer(cast<BasicBlockSDNode>(N)->getBasicBlock());
- break;
- case ISD::Register:
- ID.AddInteger(cast<RegisterSDNode>(N)->getReg());
- break;
- case ISD::SRCVALUE:
- ID.AddPointer(cast<SrcValueSDNode>(N)->getValue());
- break;
- case ISD::MEMOPERAND: {
- const MachineMemOperand &MO = cast<MemOperandSDNode>(N)->MO;
- ID.AddPointer(MO.getValue());
- ID.AddInteger(MO.getFlags());
- ID.AddInteger(MO.getOffset());
- ID.AddInteger(MO.getSize());
- ID.AddInteger(MO.getAlignment());
- break;
- }
- case ISD::FrameIndex:
- case ISD::TargetFrameIndex:
- ID.AddInteger(cast<FrameIndexSDNode>(N)->getIndex());
- break;
- case ISD::JumpTable:
- case ISD::TargetJumpTable:
- ID.AddInteger(cast<JumpTableSDNode>(N)->getIndex());
- break;
- case ISD::ConstantPool:
- case ISD::TargetConstantPool: {
- ConstantPoolSDNode *CP = cast<ConstantPoolSDNode>(N);
- ID.AddInteger(CP->getAlignment());
- ID.AddInteger(CP->getOffset());
- if (CP->isMachineConstantPoolEntry())
- CP->getMachineCPVal()->AddSelectionDAGCSEId(ID);
- else
- ID.AddPointer(CP->getConstVal());
- break;
- }
- case ISD::LOAD: {
- LoadSDNode *LD = cast<LoadSDNode>(N);
- ID.AddInteger(LD->getAddressingMode());
- ID.AddInteger(LD->getExtensionType());
- ID.AddInteger((unsigned int)(LD->getMemoryVT()));
- ID.AddInteger(LD->getAlignment());
- ID.AddInteger(LD->isVolatile());
- break;
- }
- case ISD::STORE: {
- StoreSDNode *ST = cast<StoreSDNode>(N);
- ID.AddInteger(ST->getAddressingMode());
- ID.AddInteger(ST->isTruncatingStore());
- ID.AddInteger((unsigned int)(ST->getMemoryVT()));
- ID.AddInteger(ST->getAlignment());
- ID.AddInteger(ST->isVolatile());
- break;
- }
- }
-}
-
-//===----------------------------------------------------------------------===//
-// SelectionDAG Class
-//===----------------------------------------------------------------------===//
-
-/// RemoveDeadNodes - This method deletes all unreachable nodes in the
-/// SelectionDAG.
-void SelectionDAG::RemoveDeadNodes() {
- // Create a dummy node (which is not added to allnodes), that adds a reference
- // to the root node, preventing it from being deleted.
- HandleSDNode Dummy(getRoot());
-
- SmallVector<SDNode*, 128> DeadNodes;
-
- // Add all obviously-dead nodes to the DeadNodes worklist.
- for (allnodes_iterator I = allnodes_begin(), E = allnodes_end(); I != E; ++I)
- if (I->use_empty())
- DeadNodes.push_back(I);
-
- // Process the worklist, deleting the nodes and adding their uses to the
- // worklist.
- while (!DeadNodes.empty()) {
- SDNode *N = DeadNodes.back();
- DeadNodes.pop_back();
-
- // Take the node out of the appropriate CSE map.
- RemoveNodeFromCSEMaps(N);
-
- // Next, brutally remove the operand list. This is safe to do, as there are
- // no cycles in the graph.
- for (SDNode::op_iterator I = N->op_begin(), E = N->op_end(); I != E; ++I) {
- SDNode *Operand = I->getVal();
- Operand->removeUser(std::distance(N->op_begin(), I), N);
-
- // Now that we removed this operand, see if there are no uses of it left.
- if (Operand->use_empty())
- DeadNodes.push_back(Operand);
- }
- if (N->OperandsNeedDelete) {
- delete[] N->OperandList;
- }
- N->OperandList = 0;
- N->NumOperands = 0;
-
- // Finally, remove N itself.
- AllNodes.erase(N);
- }
-
- // If the root changed (e.g. it was a dead load, update the root).
- setRoot(Dummy.getValue());
-}
-
-void SelectionDAG::RemoveDeadNode(SDNode *N, DAGUpdateListener *UpdateListener){
- SmallVector<SDNode*, 16> DeadNodes;
- DeadNodes.push_back(N);
-
- // Process the worklist, deleting the nodes and adding their uses to the
- // worklist.
- while (!DeadNodes.empty()) {
- SDNode *N = DeadNodes.back();
- DeadNodes.pop_back();
-
- if (UpdateListener)
- UpdateListener->NodeDeleted(N);
-
- // Take the node out of the appropriate CSE map.
- RemoveNodeFromCSEMaps(N);
-
- // Next, brutally remove the operand list. This is safe to do, as there are
- // no cycles in the graph.
- for (SDNode::op_iterator I = N->op_begin(), E = N->op_end(); I != E; ++I) {
- SDNode *Operand = I->getVal();
- Operand->removeUser(std::distance(N->op_begin(), I), N);
-
- // Now that we removed this operand, see if there are no uses of it left.
- if (Operand->use_empty())
- DeadNodes.push_back(Operand);
- }
- if (N->OperandsNeedDelete) {
- delete[] N->OperandList;
- }
- N->OperandList = 0;
- N->NumOperands = 0;
-
- // Finally, remove N itself.
- AllNodes.erase(N);
- }
-}
-
-void SelectionDAG::DeleteNode(SDNode *N) {
- assert(N->use_empty() && "Cannot delete a node that is not dead!");
-
- // First take this out of the appropriate CSE map.
- RemoveNodeFromCSEMaps(N);
-
- // Finally, remove uses due to operands of this node, remove from the
- // AllNodes list, and delete the node.
- DeleteNodeNotInCSEMaps(N);
-}
-
-void SelectionDAG::DeleteNodeNotInCSEMaps(SDNode *N) {
-
- // Remove it from the AllNodes list.
- AllNodes.remove(N);
-
- // Drop all of the operands and decrement used nodes use counts.
- for (SDNode::op_iterator I = N->op_begin(), E = N->op_end(); I != E; ++I)
- I->getVal()->removeUser(std::distance(N->op_begin(), I), N);
- if (N->OperandsNeedDelete) {
- delete[] N->OperandList;
- }
- N->OperandList = 0;
- N->NumOperands = 0;
-
- delete N;
-}
-
-/// RemoveNodeFromCSEMaps - Take the specified node out of the CSE map that
-/// correspond to it. This is useful when we're about to delete or repurpose
-/// the node. We don't want future request for structurally identical nodes
-/// to return N anymore.
-void SelectionDAG::RemoveNodeFromCSEMaps(SDNode *N) {
- bool Erased = false;
- switch (N->getOpcode()) {
- case ISD::HANDLENODE: return; // noop.
- case ISD::STRING:
- Erased = StringNodes.erase(cast<StringSDNode>(N)->getValue());
- break;
- case ISD::CONDCODE:
- assert(CondCodeNodes[cast<CondCodeSDNode>(N)->get()] &&
- "Cond code doesn't exist!");
- Erased = CondCodeNodes[cast<CondCodeSDNode>(N)->get()] != 0;
- CondCodeNodes[cast<CondCodeSDNode>(N)->get()] = 0;
- break;
- case ISD::ExternalSymbol:
- Erased = ExternalSymbols.erase(cast<ExternalSymbolSDNode>(N)->getSymbol());
- break;
- case ISD::TargetExternalSymbol:
- Erased =
- TargetExternalSymbols.erase(cast<ExternalSymbolSDNode>(N)->getSymbol());
- break;
- case ISD::VALUETYPE: {
- MVT::ValueType VT = cast<VTSDNode>(N)->getVT();
- if (MVT::isExtendedVT(VT)) {
- Erased = ExtendedValueTypeNodes.erase(VT);
- } else {
- Erased = ValueTypeNodes[VT] != 0;
- ValueTypeNodes[VT] = 0;
- }
- break;
- }
- default:
- // Remove it from the CSE Map.
- Erased = CSEMap.RemoveNode(N);
- break;
- }
-#ifndef NDEBUG
- // Verify that the node was actually in one of the CSE maps, unless it has a
- // flag result (which cannot be CSE'd) or is one of the special cases that are
- // not subject to CSE.
- if (!Erased && N->getValueType(N->getNumValues()-1) != MVT::Flag &&
- !N->isTargetOpcode()) {
- N->dump(this);
- cerr << "\n";
- assert(0 && "Node is not in map!");
- }
-#endif
-}
-
-/// AddNonLeafNodeToCSEMaps - Add the specified node back to the CSE maps. It
-/// has been taken out and modified in some way. If the specified node already
-/// exists in the CSE maps, do not modify the maps, but return the existing node
-/// instead. If it doesn't exist, add it and return null.
-///
-SDNode *SelectionDAG::AddNonLeafNodeToCSEMaps(SDNode *N) {
- assert(N->getNumOperands() && "This is a leaf node!");
- if (N->getOpcode() == ISD::HANDLENODE || N->getValueType(0) == MVT::Flag)
- return 0; // Never add these nodes.
-
- // Check that remaining values produced are not flags.
- for (unsigned i = 1, e = N->getNumValues(); i != e; ++i)
- if (N->getValueType(i) == MVT::Flag)
- return 0; // Never CSE anything that produces a flag.
-
- SDNode *New = CSEMap.GetOrInsertNode(N);
- if (New != N) return New; // Node already existed.
- return 0;
-}
-
-/// FindModifiedNodeSlot - Find a slot for the specified node if its operands
-/// were replaced with those specified. If this node is never memoized,
-/// return null, otherwise return a pointer to the slot it would take. If a
-/// node already exists with these operands, the slot will be non-null.
-SDNode *SelectionDAG::FindModifiedNodeSlot(SDNode *N, SDOperand Op,
- void *&InsertPos) {
- if (N->getOpcode() == ISD::HANDLENODE || N->getValueType(0) == MVT::Flag)
- return 0; // Never add these nodes.
-
- // Check that remaining values produced are not flags.
- for (unsigned i = 1, e = N->getNumValues(); i != e; ++i)
- if (N->getValueType(i) == MVT::Flag)
- return 0; // Never CSE anything that produces a flag.
-
- SDOperand Ops[] = { Op };
- FoldingSetNodeID ID;
- AddNodeIDNode(ID, N->getOpcode(), N->getVTList(), Ops, 1);
- return CSEMap.FindNodeOrInsertPos(ID, InsertPos);
-}
-
-/// FindModifiedNodeSlot - Find a slot for the specified node if its operands
-/// were replaced with those specified. If this node is never memoized,
-/// return null, otherwise return a pointer to the slot it would take. If a
-/// node already exists with these operands, the slot will be non-null.
-SDNode *SelectionDAG::FindModifiedNodeSlot(SDNode *N,
- SDOperand Op1, SDOperand Op2,
- void *&InsertPos) {
- if (N->getOpcode() == ISD::HANDLENODE || N->getValueType(0) == MVT::Flag)
- return 0; // Never add these nodes.
-
- // Check that remaining values produced are not flags.
- for (unsigned i = 1, e = N->getNumValues(); i != e; ++i)
- if (N->getValueType(i) == MVT::Flag)
- return 0; // Never CSE anything that produces a flag.
-
- SDOperand Ops[] = { Op1, Op2 };
- FoldingSetNodeID ID;
- AddNodeIDNode(ID, N->getOpcode(), N->getVTList(), Ops, 2);
- return CSEMap.FindNodeOrInsertPos(ID, InsertPos);
-}
-
-
-/// FindModifiedNodeSlot - Find a slot for the specified node if its operands
-/// were replaced with those specified. If this node is never memoized,
-/// return null, otherwise return a pointer to the slot it would take. If a
-/// node already exists with these operands, the slot will be non-null.
-SDNode *SelectionDAG::FindModifiedNodeSlot(SDNode *N,
- SDOperandPtr Ops,unsigned NumOps,
- void *&InsertPos) {
- if (N->getOpcode() == ISD::HANDLENODE || N->getValueType(0) == MVT::Flag)
- return 0; // Never add these nodes.
-
- // Check that remaining values produced are not flags.
- for (unsigned i = 1, e = N->getNumValues(); i != e; ++i)
- if (N->getValueType(i) == MVT::Flag)
- return 0; // Never CSE anything that produces a flag.
-
- FoldingSetNodeID ID;
- AddNodeIDNode(ID, N->getOpcode(), N->getVTList(), Ops, NumOps);
-
- if (const LoadSDNode *LD = dyn_cast<LoadSDNode>(N)) {
- ID.AddInteger(LD->getAddressingMode());
- ID.AddInteger(LD->getExtensionType());
- ID.AddInteger((unsigned int)(LD->getMemoryVT()));
- ID.AddInteger(LD->getAlignment());
- ID.AddInteger(LD->isVolatile());
- } else if (const StoreSDNode *ST = dyn_cast<StoreSDNode>(N)) {
- ID.AddInteger(ST->getAddressingMode());
- ID.AddInteger(ST->isTruncatingStore());
- ID.AddInteger((unsigned int)(ST->getMemoryVT()));
- ID.AddInteger(ST->getAlignment());
- ID.AddInteger(ST->isVolatile());
- }
-
- return CSEMap.FindNodeOrInsertPos(ID, InsertPos);
-}
-
-
-SelectionDAG::~SelectionDAG() {
- while (!AllNodes.empty()) {
- SDNode *N = AllNodes.begin();
- N->SetNextInBucket(0);
- if (N->OperandsNeedDelete) {
- delete [] N->OperandList;
- }
- N->OperandList = 0;
- N->NumOperands = 0;
- AllNodes.pop_front();
- }
-}
-
-SDOperand SelectionDAG::getZeroExtendInReg(SDOperand Op, MVT::ValueType VT) {
- if (Op.getValueType() == VT) return Op;
- APInt Imm = APInt::getLowBitsSet(Op.getValueSizeInBits(),
- MVT::getSizeInBits(VT));
- return getNode(ISD::AND, Op.getValueType(), Op,
- getConstant(Imm, Op.getValueType()));
-}
-
-SDOperand SelectionDAG::getString(const std::string &Val) {
- StringSDNode *&N = StringNodes[Val];
- if (!N) {
- N = new StringSDNode(Val);
- AllNodes.push_back(N);
- }
- return SDOperand(N, 0);
-}
-
-SDOperand SelectionDAG::getConstant(uint64_t Val, MVT::ValueType VT, bool isT) {
- MVT::ValueType EltVT =
- MVT::isVector(VT) ? MVT::getVectorElementType(VT) : VT;
-
- return getConstant(APInt(MVT::getSizeInBits(EltVT), Val), VT, isT);
-}
-
-SDOperand SelectionDAG::getConstant(const APInt &Val, MVT::ValueType VT, bool isT) {
- assert(MVT::isInteger(VT) && "Cannot create FP integer constant!");
-
- MVT::ValueType EltVT =
- MVT::isVector(VT) ? MVT::getVectorElementType(VT) : VT;
-
- assert(Val.getBitWidth() == MVT::getSizeInBits(EltVT) &&
- "APInt size does not match type size!");
-
- unsigned Opc = isT ? ISD::TargetConstant : ISD::Constant;
- FoldingSetNodeID ID;
- AddNodeIDNode(ID, Opc, getVTList(EltVT), (SDOperand*)0, 0);
- ID.Add(Val);
- void *IP = 0;
- SDNode *N = NULL;
- if ((N = CSEMap.FindNodeOrInsertPos(ID, IP)))
- if (!MVT::isVector(VT))
- return SDOperand(N, 0);
- if (!N) {
- N = new ConstantSDNode(isT, Val, EltVT);
- CSEMap.InsertNode(N, IP);
- AllNodes.push_back(N);
- }
-
- SDOperand Result(N, 0);
- if (MVT::isVector(VT)) {
- SmallVector<SDOperand, 8> Ops;
- Ops.assign(MVT::getVectorNumElements(VT), Result);
- Result = getNode(ISD::BUILD_VECTOR, VT, &Ops[0], Ops.size());
- }
- return Result;
-}
-
-SDOperand SelectionDAG::getIntPtrConstant(uint64_t Val, bool isTarget) {
- return getConstant(Val, TLI.getPointerTy(), isTarget);
-}
-
-
-SDOperand SelectionDAG::getConstantFP(const APFloat& V, MVT::ValueType VT,
- bool isTarget) {
- assert(MVT::isFloatingPoint(VT) && "Cannot create integer FP constant!");
-
- MVT::ValueType EltVT =
- MVT::isVector(VT) ? MVT::getVectorElementType(VT) : VT;
-
- // Do the map lookup using the actual bit pattern for the floating point
- // value, so that we don't have problems with 0.0 comparing equal to -0.0, and
- // we don't have issues with SNANs.
- unsigned Opc = isTarget ? ISD::TargetConstantFP : ISD::ConstantFP;
- FoldingSetNodeID ID;
- AddNodeIDNode(ID, Opc, getVTList(EltVT), (SDOperand*)0, 0);
- ID.Add(V);
- void *IP = 0;
- SDNode *N = NULL;
- if ((N = CSEMap.FindNodeOrInsertPos(ID, IP)))
- if (!MVT::isVector(VT))
- return SDOperand(N, 0);
- if (!N) {
- N = new ConstantFPSDNode(isTarget, V, EltVT);
- CSEMap.InsertNode(N, IP);
- AllNodes.push_back(N);
- }
-
- SDOperand Result(N, 0);
- if (MVT::isVector(VT)) {
- SmallVector<SDOperand, 8> Ops;
- Ops.assign(MVT::getVectorNumElements(VT), Result);
- Result = getNode(ISD::BUILD_VECTOR, VT, &Ops[0], Ops.size());
- }
- return Result;
-}
-
-SDOperand SelectionDAG::getConstantFP(double Val, MVT::ValueType VT,
- bool isTarget) {
- MVT::ValueType EltVT =
- MVT::isVector(VT) ? MVT::getVectorElementType(VT) : VT;
- if (EltVT==MVT::f32)
- return getConstantFP(APFloat((float)Val), VT, isTarget);
- else
- return getConstantFP(APFloat(Val), VT, isTarget);
-}
-
-SDOperand SelectionDAG::getGlobalAddress(const GlobalValue *GV,
- MVT::ValueType VT, int Offset,
- bool isTargetGA) {
- unsigned Opc;
-
- const GlobalVariable *GVar = dyn_cast<GlobalVariable>(GV);
- if (!GVar) {
- // If GV is an alias then use the aliasee for determining thread-localness.
- if (const GlobalAlias *GA = dyn_cast<GlobalAlias>(GV))
- GVar = dyn_cast_or_null<GlobalVariable>(GA->resolveAliasedGlobal());
- }
-
- if (GVar && GVar->isThreadLocal())
- Opc = isTargetGA ? ISD::TargetGlobalTLSAddress : ISD::GlobalTLSAddress;
- else
- Opc = isTargetGA ? ISD::TargetGlobalAddress : ISD::GlobalAddress;
-
- FoldingSetNodeID ID;
- AddNodeIDNode(ID, Opc, getVTList(VT), (SDOperand*)0, 0);
- ID.AddPointer(GV);
- ID.AddInteger(Offset);
- void *IP = 0;
- if (SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP))
- return SDOperand(E, 0);
- SDNode *N = new GlobalAddressSDNode(isTargetGA, GV, VT, Offset);
- CSEMap.InsertNode(N, IP);
- AllNodes.push_back(N);
- return SDOperand(N, 0);
-}
-
-SDOperand SelectionDAG::getFrameIndex(int FI, MVT::ValueType VT,
- bool isTarget) {
- unsigned Opc = isTarget ? ISD::TargetFrameIndex : ISD::FrameIndex;
- FoldingSetNodeID ID;
- AddNodeIDNode(ID, Opc, getVTList(VT), (SDOperand*)0, 0);
- ID.AddInteger(FI);
- void *IP = 0;
- if (SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP))
- return SDOperand(E, 0);
- SDNode *N = new FrameIndexSDNode(FI, VT, isTarget);
- CSEMap.InsertNode(N, IP);
- AllNodes.push_back(N);
- return SDOperand(N, 0);
-}
-
-SDOperand SelectionDAG::getJumpTable(int JTI, MVT::ValueType VT, bool isTarget){
- unsigned Opc = isTarget ? ISD::TargetJumpTable : ISD::JumpTable;
- FoldingSetNodeID ID;
- AddNodeIDNode(ID, Opc, getVTList(VT), (SDOperand*)0, 0);
- ID.AddInteger(JTI);
- void *IP = 0;
- if (SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP))
- return SDOperand(E, 0);
- SDNode *N = new JumpTableSDNode(JTI, VT, isTarget);
- CSEMap.InsertNode(N, IP);
- AllNodes.push_back(N);
- return SDOperand(N, 0);
-}
-
-SDOperand SelectionDAG::getConstantPool(Constant *C, MVT::ValueType VT,
- unsigned Alignment, int Offset,
- bool isTarget) {
- unsigned Opc = isTarget ? ISD::TargetConstantPool : ISD::ConstantPool;
- FoldingSetNodeID ID;
- AddNodeIDNode(ID, Opc, getVTList(VT), (SDOperand*)0, 0);
- ID.AddInteger(Alignment);
- ID.AddInteger(Offset);
- ID.AddPointer(C);
- void *IP = 0;
- if (SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP))
- return SDOperand(E, 0);
- SDNode *N = new ConstantPoolSDNode(isTarget, C, VT, Offset, Alignment);
- CSEMap.InsertNode(N, IP);
- AllNodes.push_back(N);
- return SDOperand(N, 0);
-}
-
-
-SDOperand SelectionDAG::getConstantPool(MachineConstantPoolValue *C,
- MVT::ValueType VT,
- unsigned Alignment, int Offset,
- bool isTarget) {
- unsigned Opc = isTarget ? ISD::TargetConstantPool : ISD::ConstantPool;
- FoldingSetNodeID ID;
- AddNodeIDNode(ID, Opc, getVTList(VT), (SDOperand*)0, 0);
- ID.AddInteger(Alignment);
- ID.AddInteger(Offset);
- C->AddSelectionDAGCSEId(ID);
- void *IP = 0;
- if (SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP))
- return SDOperand(E, 0);
- SDNode *N = new ConstantPoolSDNode(isTarget, C, VT, Offset, Alignment);
- CSEMap.InsertNode(N, IP);
- AllNodes.push_back(N);
- return SDOperand(N, 0);
-}
-
-
-SDOperand SelectionDAG::getBasicBlock(MachineBasicBlock *MBB) {
- FoldingSetNodeID ID;
- AddNodeIDNode(ID, ISD::BasicBlock, getVTList(MVT::Other), (SDOperand*)0, 0);
- ID.AddPointer(MBB);
- void *IP = 0;
- if (SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP))
- return SDOperand(E, 0);
- SDNode *N = new BasicBlockSDNode(MBB);
- CSEMap.InsertNode(N, IP);
- AllNodes.push_back(N);
- return SDOperand(N, 0);
-}
-
-SDOperand SelectionDAG::getArgFlags(ISD::ArgFlagsTy Flags) {
- FoldingSetNodeID ID;
- AddNodeIDNode(ID, ISD::ARG_FLAGS, getVTList(MVT::Other), (SDOperand*)0, 0);
- ID.AddInteger(Flags.getRawBits());
- void *IP = 0;
- if (SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP))
- return SDOperand(E, 0);
- SDNode *N = new ARG_FLAGSSDNode(Flags);
- CSEMap.InsertNode(N, IP);
- AllNodes.push_back(N);
- return SDOperand(N, 0);
-}
-
-SDOperand SelectionDAG::getValueType(MVT::ValueType VT) {
- if (!MVT::isExtendedVT(VT) && (unsigned)VT >= ValueTypeNodes.size())
- ValueTypeNodes.resize(VT+1);
-
- SDNode *&N = MVT::isExtendedVT(VT) ?
- ExtendedValueTypeNodes[VT] : ValueTypeNodes[VT];
-
- if (N) return SDOperand(N, 0);
- N = new VTSDNode(VT);
- AllNodes.push_back(N);
- return SDOperand(N, 0);
-}
-
-SDOperand SelectionDAG::getExternalSymbol(const char *Sym, MVT::ValueType VT) {
- SDNode *&N = ExternalSymbols[Sym];
- if (N) return SDOperand(N, 0);
- N = new ExternalSymbolSDNode(false, Sym, VT);
- AllNodes.push_back(N);
- return SDOperand(N, 0);
-}
-
-SDOperand SelectionDAG::getTargetExternalSymbol(const char *Sym,
- MVT::ValueType VT) {
- SDNode *&N = TargetExternalSymbols[Sym];
- if (N) return SDOperand(N, 0);
- N = new ExternalSymbolSDNode(true, Sym, VT);
- AllNodes.push_back(N);
- return SDOperand(N, 0);
-}
-
-SDOperand SelectionDAG::getCondCode(ISD::CondCode Cond) {
- if ((unsigned)Cond >= CondCodeNodes.size())
- CondCodeNodes.resize(Cond+1);
-
- if (CondCodeNodes[Cond] == 0) {
- CondCodeNodes[Cond] = new CondCodeSDNode(Cond);
- AllNodes.push_back(CondCodeNodes[Cond]);
- }
- return SDOperand(CondCodeNodes[Cond], 0);
-}
-
-SDOperand SelectionDAG::getRegister(unsigned RegNo, MVT::ValueType VT) {
- FoldingSetNodeID ID;
- AddNodeIDNode(ID, ISD::Register, getVTList(VT), (SDOperand*)0, 0);
- ID.AddInteger(RegNo);
- void *IP = 0;
- if (SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP))
- return SDOperand(E, 0);
- SDNode *N = new RegisterSDNode(RegNo, VT);
- CSEMap.InsertNode(N, IP);
- AllNodes.push_back(N);
- return SDOperand(N, 0);
-}
-
-SDOperand SelectionDAG::getSrcValue(const Value *V) {
- assert((!V || isa<PointerType>(V->getType())) &&
- "SrcValue is not a pointer?");
-
- FoldingSetNodeID ID;
- AddNodeIDNode(ID, ISD::SRCVALUE, getVTList(MVT::Other), (SDOperand*)0, 0);
- ID.AddPointer(V);
-
- void *IP = 0;
- if (SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP))
- return SDOperand(E, 0);
-
- SDNode *N = new SrcValueSDNode(V);
- CSEMap.InsertNode(N, IP);
- AllNodes.push_back(N);
- return SDOperand(N, 0);
-}
-
-SDOperand SelectionDAG::getMemOperand(const MachineMemOperand &MO) {
- const Value *v = MO.getValue();
- assert((!v || isa<PointerType>(v->getType())) &&
- "SrcValue is not a pointer?");
-
- FoldingSetNodeID ID;
- AddNodeIDNode(ID, ISD::MEMOPERAND, getVTList(MVT::Other), (SDOperand*)0, 0);
- ID.AddPointer(v);
- ID.AddInteger(MO.getFlags());
- ID.AddInteger(MO.getOffset());
- ID.AddInteger(MO.getSize());
- ID.AddInteger(MO.getAlignment());
-
- void *IP = 0;
- if (SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP))
- return SDOperand(E, 0);
-
- SDNode *N = new MemOperandSDNode(MO);
- CSEMap.InsertNode(N, IP);
- AllNodes.push_back(N);
- return SDOperand(N, 0);
-}
-
-/// CreateStackTemporary - Create a stack temporary, suitable for holding the
-/// specified value type.
-SDOperand SelectionDAG::CreateStackTemporary(MVT::ValueType VT) {
- MachineFrameInfo *FrameInfo = getMachineFunction().getFrameInfo();
- unsigned ByteSize = MVT::getSizeInBits(VT)/8;
- const Type *Ty = MVT::getTypeForValueType(VT);
- unsigned StackAlign = (unsigned)TLI.getTargetData()->getPrefTypeAlignment(Ty);
- int FrameIdx = FrameInfo->CreateStackObject(ByteSize, StackAlign);
- return getFrameIndex(FrameIdx, TLI.getPointerTy());
-}
-
-
-SDOperand SelectionDAG::FoldSetCC(MVT::ValueType VT, SDOperand N1,
- SDOperand N2, ISD::CondCode Cond) {
- // These setcc operations always fold.
- switch (Cond) {
- default: break;
- case ISD::SETFALSE:
- case ISD::SETFALSE2: return getConstant(0, VT);
- case ISD::SETTRUE:
- case ISD::SETTRUE2: return getConstant(1, VT);
-
- case ISD::SETOEQ:
- case ISD::SETOGT:
- case ISD::SETOGE:
- case ISD::SETOLT:
- case ISD::SETOLE:
- case ISD::SETONE:
- case ISD::SETO:
- case ISD::SETUO:
- case ISD::SETUEQ:
- case ISD::SETUNE:
- assert(!MVT::isInteger(N1.getValueType()) && "Illegal setcc for integer!");
- break;
- }
-
- if (ConstantSDNode *N2C = dyn_cast<ConstantSDNode>(N2.Val)) {
- const APInt &C2 = N2C->getAPIntValue();
- if (ConstantSDNode *N1C = dyn_cast<ConstantSDNode>(N1.Val)) {
- const APInt &C1 = N1C->getAPIntValue();
-
- switch (Cond) {
- default: assert(0 && "Unknown integer setcc!");
- case ISD::SETEQ: return getConstant(C1 == C2, VT);
- case ISD::SETNE: return getConstant(C1 != C2, VT);
- case ISD::SETULT: return getConstant(C1.ult(C2), VT);
- case ISD::SETUGT: return getConstant(C1.ugt(C2), VT);
- case ISD::SETULE: return getConstant(C1.ule(C2), VT);
- case ISD::SETUGE: return getConstant(C1.uge(C2), VT);
- case ISD::SETLT: return getConstant(C1.slt(C2), VT);
- case ISD::SETGT: return getConstant(C1.sgt(C2), VT);
- case ISD::SETLE: return getConstant(C1.sle(C2), VT);
- case ISD::SETGE: return getConstant(C1.sge(C2), VT);
- }
- }
- }
- if (ConstantFPSDNode *N1C = dyn_cast<ConstantFPSDNode>(N1.Val)) {
- if (ConstantFPSDNode *N2C = dyn_cast<ConstantFPSDNode>(N2.Val)) {
- // No compile time operations on this type yet.
- if (N1C->getValueType(0) == MVT::ppcf128)
- return SDOperand();
-
- APFloat::cmpResult R = N1C->getValueAPF().compare(N2C->getValueAPF());
- switch (Cond) {
- default: break;
- case ISD::SETEQ: if (R==APFloat::cmpUnordered)
- return getNode(ISD::UNDEF, VT);
- // fall through
- case ISD::SETOEQ: return getConstant(R==APFloat::cmpEqual, VT);
- case ISD::SETNE: if (R==APFloat::cmpUnordered)
- return getNode(ISD::UNDEF, VT);
- // fall through
- case ISD::SETONE: return getConstant(R==APFloat::cmpGreaterThan ||
- R==APFloat::cmpLessThan, VT);
- case ISD::SETLT: if (R==APFloat::cmpUnordered)
- return getNode(ISD::UNDEF, VT);
- // fall through
- case ISD::SETOLT: return getConstant(R==APFloat::cmpLessThan, VT);
- case ISD::SETGT: if (R==APFloat::cmpUnordered)
- return getNode(ISD::UNDEF, VT);
- // fall through
- case ISD::SETOGT: return getConstant(R==APFloat::cmpGreaterThan, VT);
- case ISD::SETLE: if (R==APFloat::cmpUnordered)
- return getNode(ISD::UNDEF, VT);
- // fall through
- case ISD::SETOLE: return getConstant(R==APFloat::cmpLessThan ||
- R==APFloat::cmpEqual, VT);
- case ISD::SETGE: if (R==APFloat::cmpUnordered)
- return getNode(ISD::UNDEF, VT);
- // fall through
- case ISD::SETOGE: return getConstant(R==APFloat::cmpGreaterThan ||
- R==APFloat::cmpEqual, VT);
- case ISD::SETO: return getConstant(R!=APFloat::cmpUnordered, VT);
- case ISD::SETUO: return getConstant(R==APFloat::cmpUnordered, VT);
- case ISD::SETUEQ: return getConstant(R==APFloat::cmpUnordered ||
- R==APFloat::cmpEqual, VT);
- case ISD::SETUNE: return getConstant(R!=APFloat::cmpEqual, VT);
- case ISD::SETULT: return getConstant(R==APFloat::cmpUnordered ||
- R==APFloat::cmpLessThan, VT);
- case ISD::SETUGT: return getConstant(R==APFloat::cmpGreaterThan ||
- R==APFloat::cmpUnordered, VT);
- case ISD::SETULE: return getConstant(R!=APFloat::cmpGreaterThan, VT);
- case ISD::SETUGE: return getConstant(R!=APFloat::cmpLessThan, VT);
- }
- } else {
- // Ensure that the constant occurs on the RHS.
- return getSetCC(VT, N2, N1, ISD::getSetCCSwappedOperands(Cond));
- }
- }
-
- // Could not fold it.
- return SDOperand();
-}
-
-/// SignBitIsZero - Return true if the sign bit of Op is known to be zero. We
-/// use this predicate to simplify operations downstream.
-bool SelectionDAG::SignBitIsZero(SDOperand Op, unsigned Depth) const {
- unsigned BitWidth = Op.getValueSizeInBits();
- return MaskedValueIsZero(Op, APInt::getSignBit(BitWidth), Depth);
-}
-
-/// MaskedValueIsZero - Return true if 'V & Mask' is known to be zero. We use
-/// this predicate to simplify operations downstream. Mask is known to be zero
-/// for bits that V cannot have.
-bool SelectionDAG::MaskedValueIsZero(SDOperand Op, const APInt &Mask,
- unsigned Depth) const {
- APInt KnownZero, KnownOne;
- ComputeMaskedBits(Op, Mask, KnownZero, KnownOne, Depth);
- assert((KnownZero & KnownOne) == 0 && "Bits known to be one AND zero?");
- return (KnownZero & Mask) == Mask;
-}
-
-/// ComputeMaskedBits - Determine which of the bits specified in Mask are
-/// known to be either zero or one and return them in the KnownZero/KnownOne
-/// bitsets. This code only analyzes bits in Mask, in order to short-circuit
-/// processing.
-void SelectionDAG::ComputeMaskedBits(SDOperand Op, const APInt &Mask,
- APInt &KnownZero, APInt &KnownOne,
- unsigned Depth) const {
- unsigned BitWidth = Mask.getBitWidth();
- assert(BitWidth == MVT::getSizeInBits(Op.getValueType()) &&
- "Mask size mismatches value type size!");
-
- KnownZero = KnownOne = APInt(BitWidth, 0); // Don't know anything.
- if (Depth == 6 || Mask == 0)
- return; // Limit search depth.
-
- APInt KnownZero2, KnownOne2;
-
- switch (Op.getOpcode()) {
- case ISD::Constant:
- // We know all of the bits for a constant!
- KnownOne = cast<ConstantSDNode>(Op)->getAPIntValue() & Mask;
- KnownZero = ~KnownOne & Mask;
- return;
- case ISD::AND:
- // If either the LHS or the RHS are Zero, the result is zero.
- ComputeMaskedBits(Op.getOperand(1), Mask, KnownZero, KnownOne, Depth+1);
- ComputeMaskedBits(Op.getOperand(0), Mask & ~KnownZero,
- KnownZero2, KnownOne2, Depth+1);
- assert((KnownZero & KnownOne) == 0 && "Bits known to be one AND zero?");
- assert((KnownZero2 & KnownOne2) == 0 && "Bits known to be one AND zero?");
-
- // Output known-1 bits are only known if set in both the LHS & RHS.
- KnownOne &= KnownOne2;
- // Output known-0 are known to be clear if zero in either the LHS | RHS.
- KnownZero |= KnownZero2;
- return;
- case ISD::OR:
- ComputeMaskedBits(Op.getOperand(1), Mask, KnownZero, KnownOne, Depth+1);
- ComputeMaskedBits(Op.getOperand(0), Mask & ~KnownOne,
- KnownZero2, KnownOne2, Depth+1);
- assert((KnownZero & KnownOne) == 0 && "Bits known to be one AND zero?");
- assert((KnownZero2 & KnownOne2) == 0 && "Bits known to be one AND zero?");
-
- // Output known-0 bits are only known if clear in both the LHS & RHS.
- KnownZero &= KnownZero2;
- // Output known-1 are known to be set if set in either the LHS | RHS.
- KnownOne |= KnownOne2;
- return;
- case ISD::XOR: {
- ComputeMaskedBits(Op.getOperand(1), Mask, KnownZero, KnownOne, Depth+1);
- ComputeMaskedBits(Op.getOperand(0), Mask, KnownZero2, KnownOne2, Depth+1);
- assert((KnownZero & KnownOne) == 0 && "Bits known to be one AND zero?");
- assert((KnownZero2 & KnownOne2) == 0 && "Bits known to be one AND zero?");
-
- // Output known-0 bits are known if clear or set in both the LHS & RHS.
- APInt KnownZeroOut = (KnownZero & KnownZero2) | (KnownOne & KnownOne2);
- // Output known-1 are known to be set if set in only one of the LHS, RHS.
- KnownOne = (KnownZero & KnownOne2) | (KnownOne & KnownZero2);
- KnownZero = KnownZeroOut;
- return;
- }
- case ISD::MUL: {
- APInt Mask2 = APInt::getAllOnesValue(BitWidth);
- ComputeMaskedBits(Op.getOperand(1), Mask2, KnownZero, KnownOne, Depth+1);
- ComputeMaskedBits(Op.getOperand(0), Mask2, KnownZero2, KnownOne2, Depth+1);
- assert((KnownZero & KnownOne) == 0 && "Bits known to be one AND zero?");
- assert((KnownZero2 & KnownOne2) == 0 && "Bits known to be one AND zero?");
-
- // If low bits are zero in either operand, output low known-0 bits.
- // Also compute a conserative estimate for high known-0 bits.
- // More trickiness is possible, but this is sufficient for the
- // interesting case of alignment computation.
- KnownOne.clear();
- unsigned TrailZ = KnownZero.countTrailingOnes() +
- KnownZero2.countTrailingOnes();
- unsigned LeadZ = std::max(KnownZero.countLeadingOnes() +
- KnownZero2.countLeadingOnes(),
- BitWidth) - BitWidth;
-
- TrailZ = std::min(TrailZ, BitWidth);
- LeadZ = std::min(LeadZ, BitWidth);
- KnownZero = APInt::getLowBitsSet(BitWidth, TrailZ) |
- APInt::getHighBitsSet(BitWidth, LeadZ);
- KnownZero &= Mask;
- return;
- }
- case ISD::UDIV: {
- // For the purposes of computing leading zeros we can conservatively
- // treat a udiv as a logical right shift by the power of 2 known to
- // be less than the denominator.
- APInt AllOnes = APInt::getAllOnesValue(BitWidth);
- ComputeMaskedBits(Op.getOperand(0),
- AllOnes, KnownZero2, KnownOne2, Depth+1);
- unsigned LeadZ = KnownZero2.countLeadingOnes();
-
- KnownOne2.clear();
- KnownZero2.clear();
- ComputeMaskedBits(Op.getOperand(1),
- AllOnes, KnownZero2, KnownOne2, Depth+1);
- unsigned RHSUnknownLeadingOnes = KnownOne2.countLeadingZeros();
- if (RHSUnknownLeadingOnes != BitWidth)
- LeadZ = std::min(BitWidth,
- LeadZ + BitWidth - RHSUnknownLeadingOnes - 1);
-
- KnownZero = APInt::getHighBitsSet(BitWidth, LeadZ) & Mask;
- return;
- }
- case ISD::SELECT:
- ComputeMaskedBits(Op.getOperand(2), Mask, KnownZero, KnownOne, Depth+1);
- ComputeMaskedBits(Op.getOperand(1), Mask, KnownZero2, KnownOne2, Depth+1);
- assert((KnownZero & KnownOne) == 0 && "Bits known to be one AND zero?");
- assert((KnownZero2 & KnownOne2) == 0 && "Bits known to be one AND zero?");
-
- // Only known if known in both the LHS and RHS.
- KnownOne &= KnownOne2;
- KnownZero &= KnownZero2;
- return;
- case ISD::SELECT_CC:
- ComputeMaskedBits(Op.getOperand(3), Mask, KnownZero, KnownOne, Depth+1);
- ComputeMaskedBits(Op.getOperand(2), Mask, KnownZero2, KnownOne2, Depth+1);
- assert((KnownZero & KnownOne) == 0 && "Bits known to be one AND zero?");
- assert((KnownZero2 & KnownOne2) == 0 && "Bits known to be one AND zero?");
-
- // Only known if known in both the LHS and RHS.
- KnownOne &= KnownOne2;
- KnownZero &= KnownZero2;
- return;
- case ISD::SETCC:
- // If we know the result of a setcc has the top bits zero, use this info.
- if (TLI.getSetCCResultContents() == TargetLowering::ZeroOrOneSetCCResult &&
- BitWidth > 1)
- KnownZero |= APInt::getHighBitsSet(BitWidth, BitWidth - 1);
- return;
- case ISD::SHL:
- // (shl X, C1) & C2 == 0 iff (X & C2 >>u C1) == 0
- if (ConstantSDNode *SA = dyn_cast<ConstantSDNode>(Op.getOperand(1))) {
- unsigned ShAmt = SA->getValue();
-
- // If the shift count is an invalid immediate, don't do anything.
- if (ShAmt >= BitWidth)
- return;
-
- ComputeMaskedBits(Op.getOperand(0), Mask.lshr(ShAmt),
- KnownZero, KnownOne, Depth+1);
- assert((KnownZero & KnownOne) == 0 && "Bits known to be one AND zero?");
- KnownZero <<= ShAmt;
- KnownOne <<= ShAmt;
- // low bits known zero.
- KnownZero |= APInt::getLowBitsSet(BitWidth, ShAmt);
- }
- return;
- case ISD::SRL:
- // (ushr X, C1) & C2 == 0 iff (-1 >> C1) & C2 == 0
- if (ConstantSDNode *SA = dyn_cast<ConstantSDNode>(Op.getOperand(1))) {
- unsigned ShAmt = SA->getValue();
-
- // If the shift count is an invalid immediate, don't do anything.
- if (ShAmt >= BitWidth)
- return;
-
- ComputeMaskedBits(Op.getOperand(0), (Mask << ShAmt),
- KnownZero, KnownOne, Depth+1);
- assert((KnownZero & KnownOne) == 0 && "Bits known to be one AND zero?");
- KnownZero = KnownZero.lshr(ShAmt);
- KnownOne = KnownOne.lshr(ShAmt);
-
- APInt HighBits = APInt::getHighBitsSet(BitWidth, ShAmt) & Mask;
- KnownZero |= HighBits; // High bits known zero.
- }
- return;
- case ISD::SRA:
- if (ConstantSDNode *SA = dyn_cast<ConstantSDNode>(Op.getOperand(1))) {
- unsigned ShAmt = SA->getValue();
-
- // If the shift count is an invalid immediate, don't do anything.
- if (ShAmt >= BitWidth)
- return;
-
- APInt InDemandedMask = (Mask << ShAmt);
- // If any of the demanded bits are produced by the sign extension, we also
- // demand the input sign bit.
- APInt HighBits = APInt::getHighBitsSet(BitWidth, ShAmt) & Mask;
- if (HighBits.getBoolValue())
- InDemandedMask |= APInt::getSignBit(BitWidth);
-
- ComputeMaskedBits(Op.getOperand(0), InDemandedMask, KnownZero, KnownOne,
- Depth+1);
- assert((KnownZero & KnownOne) == 0 && "Bits known to be one AND zero?");
- KnownZero = KnownZero.lshr(ShAmt);
- KnownOne = KnownOne.lshr(ShAmt);
-
- // Handle the sign bits.
- APInt SignBit = APInt::getSignBit(BitWidth);
- SignBit = SignBit.lshr(ShAmt); // Adjust to where it is now in the mask.
-
- if (KnownZero.intersects(SignBit)) {
- KnownZero |= HighBits; // New bits are known zero.
- } else if (KnownOne.intersects(SignBit)) {
- KnownOne |= HighBits; // New bits are known one.
- }
- }
- return;
- case ISD::SIGN_EXTEND_INREG: {
- MVT::ValueType EVT = cast<VTSDNode>(Op.getOperand(1))->getVT();
- unsigned EBits = MVT::getSizeInBits(EVT);
-
- // Sign extension. Compute the demanded bits in the result that are not
- // present in the input.
- APInt NewBits = APInt::getHighBitsSet(BitWidth, BitWidth - EBits) & Mask;
-
- APInt InSignBit = APInt::getSignBit(EBits);
- APInt InputDemandedBits = Mask & APInt::getLowBitsSet(BitWidth, EBits);
-
- // If the sign extended bits are demanded, we know that the sign
- // bit is demanded.
- InSignBit.zext(BitWidth);
- if (NewBits.getBoolValue())
- InputDemandedBits |= InSignBit;
-
- ComputeMaskedBits(Op.getOperand(0), InputDemandedBits,
- KnownZero, KnownOne, Depth+1);
- assert((KnownZero & KnownOne) == 0 && "Bits known to be one AND zero?");
-
- // If the sign bit of the input is known set or clear, then we know the
- // top bits of the result.
- if (KnownZero.intersects(InSignBit)) { // Input sign bit known clear
- KnownZero |= NewBits;
- KnownOne &= ~NewBits;
- } else if (KnownOne.intersects(InSignBit)) { // Input sign bit known set
- KnownOne |= NewBits;
- KnownZero &= ~NewBits;
- } else { // Input sign bit unknown
- KnownZero &= ~NewBits;
- KnownOne &= ~NewBits;
- }
- return;
- }
- case ISD::CTTZ:
- case ISD::CTLZ:
- case ISD::CTPOP: {
- unsigned LowBits = Log2_32(BitWidth)+1;
- KnownZero = APInt::getHighBitsSet(BitWidth, BitWidth - LowBits);
- KnownOne = APInt(BitWidth, 0);
- return;
- }
- case ISD::LOAD: {
- if (ISD::isZEXTLoad(Op.Val)) {
- LoadSDNode *LD = cast<LoadSDNode>(Op);
- MVT::ValueType VT = LD->getMemoryVT();
- unsigned MemBits = MVT::getSizeInBits(VT);
- KnownZero |= APInt::getHighBitsSet(BitWidth, BitWidth - MemBits) & Mask;
- }
- return;
- }
- case ISD::ZERO_EXTEND: {
- MVT::ValueType InVT = Op.getOperand(0).getValueType();
- unsigned InBits = MVT::getSizeInBits(InVT);
- APInt NewBits = APInt::getHighBitsSet(BitWidth, BitWidth - InBits) & Mask;
- APInt InMask = Mask;
- InMask.trunc(InBits);
- KnownZero.trunc(InBits);
- KnownOne.trunc(InBits);
- ComputeMaskedBits(Op.getOperand(0), InMask, KnownZero, KnownOne, Depth+1);
- KnownZero.zext(BitWidth);
- KnownOne.zext(BitWidth);
- KnownZero |= NewBits;
- return;
- }
- case ISD::SIGN_EXTEND: {
- MVT::ValueType InVT = Op.getOperand(0).getValueType();
- unsigned InBits = MVT::getSizeInBits(InVT);
- APInt InSignBit = APInt::getSignBit(InBits);
- APInt NewBits = APInt::getHighBitsSet(BitWidth, BitWidth - InBits) & Mask;
- APInt InMask = Mask;
- InMask.trunc(InBits);
-
- // If any of the sign extended bits are demanded, we know that the sign
- // bit is demanded. Temporarily set this bit in the mask for our callee.
- if (NewBits.getBoolValue())
- InMask |= InSignBit;
-
- KnownZero.trunc(InBits);
- KnownOne.trunc(InBits);
- ComputeMaskedBits(Op.getOperand(0), InMask, KnownZero, KnownOne, Depth+1);
-
- // Note if the sign bit is known to be zero or one.
- bool SignBitKnownZero = KnownZero.isNegative();
- bool SignBitKnownOne = KnownOne.isNegative();
- assert(!(SignBitKnownZero && SignBitKnownOne) &&
- "Sign bit can't be known to be both zero and one!");
-
- // If the sign bit wasn't actually demanded by our caller, we don't
- // want it set in the KnownZero and KnownOne result values. Reset the
- // mask and reapply it to the result values.
- InMask = Mask;
- InMask.trunc(InBits);
- KnownZero &= InMask;
- KnownOne &= InMask;
-
- KnownZero.zext(BitWidth);
- KnownOne.zext(BitWidth);
-
- // If the sign bit is known zero or one, the top bits match.
- if (SignBitKnownZero)
- KnownZero |= NewBits;
- else if (SignBitKnownOne)
- KnownOne |= NewBits;
- return;
- }
- case ISD::ANY_EXTEND: {
- MVT::ValueType InVT = Op.getOperand(0).getValueType();
- unsigned InBits = MVT::getSizeInBits(InVT);
- APInt InMask = Mask;
- InMask.trunc(InBits);
- KnownZero.trunc(InBits);
- KnownOne.trunc(InBits);
- ComputeMaskedBits(Op.getOperand(0), InMask, KnownZero, KnownOne, Depth+1);
- KnownZero.zext(BitWidth);
- KnownOne.zext(BitWidth);
- return;
- }
- case ISD::TRUNCATE: {
- MVT::ValueType InVT = Op.getOperand(0).getValueType();
- unsigned InBits = MVT::getSizeInBits(InVT);
- APInt InMask = Mask;
- InMask.zext(InBits);
- KnownZero.zext(InBits);
- KnownOne.zext(InBits);
- ComputeMaskedBits(Op.getOperand(0), InMask, KnownZero, KnownOne, Depth+1);
- assert((KnownZero & KnownOne) == 0 && "Bits known to be one AND zero?");
- KnownZero.trunc(BitWidth);
- KnownOne.trunc(BitWidth);
- break;
- }
- case ISD::AssertZext: {
- MVT::ValueType VT = cast<VTSDNode>(Op.getOperand(1))->getVT();
- APInt InMask = APInt::getLowBitsSet(BitWidth, MVT::getSizeInBits(VT));
- ComputeMaskedBits(Op.getOperand(0), Mask & InMask, KnownZero,
- KnownOne, Depth+1);
- KnownZero |= (~InMask) & Mask;
- return;
- }
- case ISD::FGETSIGN:
- // All bits are zero except the low bit.
- KnownZero = APInt::getHighBitsSet(BitWidth, BitWidth - 1);
- return;
-
- case ISD::SUB: {
- if (ConstantSDNode *CLHS = dyn_cast<ConstantSDNode>(Op.getOperand(0))) {
- // We know that the top bits of C-X are clear if X contains less bits
- // than C (i.e. no wrap-around can happen). For example, 20-X is
- // positive if we can prove that X is >= 0 and < 16.
- if (CLHS->getAPIntValue().isNonNegative()) {
- unsigned NLZ = (CLHS->getAPIntValue()+1).countLeadingZeros();
- // NLZ can't be BitWidth with no sign bit
- APInt MaskV = APInt::getHighBitsSet(BitWidth, NLZ+1);
- ComputeMaskedBits(Op.getOperand(1), MaskV, KnownZero2, KnownOne2,
- Depth+1);
-
- // If all of the MaskV bits are known to be zero, then we know the
- // output top bits are zero, because we now know that the output is
- // from [0-C].
- if ((KnownZero2 & MaskV) == MaskV) {
- unsigned NLZ2 = CLHS->getAPIntValue().countLeadingZeros();
- // Top bits known zero.
- KnownZero = APInt::getHighBitsSet(BitWidth, NLZ2) & Mask;
- }
- }
- }
- }
- // fall through
- case ISD::ADD: {
- // Output known-0 bits are known if clear or set in both the low clear bits
- // common to both LHS & RHS. For example, 8+(X<<3) is known to have the
- // low 3 bits clear.
- APInt Mask2 = APInt::getLowBitsSet(BitWidth, Mask.countTrailingOnes());
- ComputeMaskedBits(Op.getOperand(0), Mask2, KnownZero2, KnownOne2, Depth+1);
- assert((KnownZero2 & KnownOne2) == 0 && "Bits known to be one AND zero?");
- unsigned KnownZeroOut = KnownZero2.countTrailingOnes();
-
- ComputeMaskedBits(Op.getOperand(1), Mask2, KnownZero2, KnownOne2, Depth+1);
- assert((KnownZero2 & KnownOne2) == 0 && "Bits known to be one AND zero?");
- KnownZeroOut = std::min(KnownZeroOut,
- KnownZero2.countTrailingOnes());
-
- KnownZero |= APInt::getLowBitsSet(BitWidth, KnownZeroOut);
- return;
- }
- case ISD::SREM:
- if (ConstantSDNode *Rem = dyn_cast<ConstantSDNode>(Op.getOperand(1))) {
- APInt RA = Rem->getAPIntValue();
- if (RA.isPowerOf2() || (-RA).isPowerOf2()) {
- APInt LowBits = RA.isStrictlyPositive() ? (RA - 1) : ~RA;
- APInt Mask2 = LowBits | APInt::getSignBit(BitWidth);
- ComputeMaskedBits(Op.getOperand(0), Mask2,KnownZero2,KnownOne2,Depth+1);
-
- // The sign of a remainder is equal to the sign of the first
- // operand (zero being positive).
- if (KnownZero2[BitWidth-1] || ((KnownZero2 & LowBits) == LowBits))
- KnownZero2 |= ~LowBits;
- else if (KnownOne2[BitWidth-1])
- KnownOne2 |= ~LowBits;
-
- KnownZero |= KnownZero2 & Mask;
- KnownOne |= KnownOne2 & Mask;
-
- assert((KnownZero & KnownOne) == 0&&"Bits known to be one AND zero?");
- }
- }
- return;
- case ISD::UREM: {
- if (ConstantSDNode *Rem = dyn_cast<ConstantSDNode>(Op.getOperand(1))) {
- APInt RA = Rem->getAPIntValue();
- if (RA.isPowerOf2()) {
- APInt LowBits = (RA - 1);
- APInt Mask2 = LowBits & Mask;
- KnownZero |= ~LowBits & Mask;
- ComputeMaskedBits(Op.getOperand(0), Mask2, KnownZero, KnownOne,Depth+1);
- assert((KnownZero & KnownOne) == 0&&"Bits known to be one AND zero?");
- break;
- }
- }
-
- // Since the result is less than or equal to either operand, any leading
- // zero bits in either operand must also exist in the result.
- APInt AllOnes = APInt::getAllOnesValue(BitWidth);
- ComputeMaskedBits(Op.getOperand(0), AllOnes, KnownZero, KnownOne,
- Depth+1);
- ComputeMaskedBits(Op.getOperand(1), AllOnes, KnownZero2, KnownOne2,
- Depth+1);
-
- uint32_t Leaders = std::max(KnownZero.countLeadingOnes(),
- KnownZero2.countLeadingOnes());
- KnownOne.clear();
- KnownZero = APInt::getHighBitsSet(BitWidth, Leaders) & Mask;
- return;
- }
- default:
- // Allow the target to implement this method for its nodes.
- if (Op.getOpcode() >= ISD::BUILTIN_OP_END) {
- case ISD::INTRINSIC_WO_CHAIN:
- case ISD::INTRINSIC_W_CHAIN:
- case ISD::INTRINSIC_VOID:
- TLI.computeMaskedBitsForTargetNode(Op, Mask, KnownZero, KnownOne, *this);
- }
- return;
- }
-}
-
-/// ComputeNumSignBits - Return the number of times the sign bit of the
-/// register is replicated into the other bits. We know that at least 1 bit
-/// is always equal to the sign bit (itself), but other cases can give us
-/// information. For example, immediately after an "SRA X, 2", we know that
-/// the top 3 bits are all equal to each other, so we return 3.
-unsigned SelectionDAG::ComputeNumSignBits(SDOperand Op, unsigned Depth) const{
- MVT::ValueType VT = Op.getValueType();
- assert(MVT::isInteger(VT) && "Invalid VT!");
- unsigned VTBits = MVT::getSizeInBits(VT);
- unsigned Tmp, Tmp2;
-
- if (Depth == 6)
- return 1; // Limit search depth.
-
- switch (Op.getOpcode()) {
- default: break;
- case ISD::AssertSext:
- Tmp = MVT::getSizeInBits(cast<VTSDNode>(Op.getOperand(1))->getVT());
- return VTBits-Tmp+1;
- case ISD::AssertZext:
- Tmp = MVT::getSizeInBits(cast<VTSDNode>(Op.getOperand(1))->getVT());
- return VTBits-Tmp;
-
- case ISD::Constant: {
- const APInt &Val = cast<ConstantSDNode>(Op)->getAPIntValue();
- // If negative, return # leading ones.
- if (Val.isNegative())
- return Val.countLeadingOnes();
-
- // Return # leading zeros.
- return Val.countLeadingZeros();
- }
-
- case ISD::SIGN_EXTEND:
- Tmp = VTBits-MVT::getSizeInBits(Op.getOperand(0).getValueType());
- return ComputeNumSignBits(Op.getOperand(0), Depth+1) + Tmp;
-
- case ISD::SIGN_EXTEND_INREG:
- // Max of the input and what this extends.
- Tmp = MVT::getSizeInBits(cast<VTSDNode>(Op.getOperand(1))->getVT());
- Tmp = VTBits-Tmp+1;
-
- Tmp2 = ComputeNumSignBits(Op.getOperand(0), Depth+1);
- return std::max(Tmp, Tmp2);
-
- case ISD::SRA:
- Tmp = ComputeNumSignBits(Op.getOperand(0), Depth+1);
- // SRA X, C -> adds C sign bits.
- if (ConstantSDNode *C = dyn_cast<ConstantSDNode>(Op.getOperand(1))) {
- Tmp += C->getValue();
- if (Tmp > VTBits) Tmp = VTBits;
- }
- return Tmp;
- case ISD::SHL:
- if (ConstantSDNode *C = dyn_cast<ConstantSDNode>(Op.getOperand(1))) {
- // shl destroys sign bits.
- Tmp = ComputeNumSignBits(Op.getOperand(0), Depth+1);
- if (C->getValue() >= VTBits || // Bad shift.
- C->getValue() >= Tmp) break; // Shifted all sign bits out.
- return Tmp - C->getValue();
- }
- break;
- case ISD::AND:
- case ISD::OR:
- case ISD::XOR: // NOT is handled here.
- // Logical binary ops preserve the number of sign bits.
- Tmp = ComputeNumSignBits(Op.getOperand(0), Depth+1);
- if (Tmp == 1) return 1; // Early out.
- Tmp2 = ComputeNumSignBits(Op.getOperand(1), Depth+1);
- return std::min(Tmp, Tmp2);
-
- case ISD::SELECT:
- Tmp = ComputeNumSignBits(Op.getOperand(0), Depth+1);
- if (Tmp == 1) return 1; // Early out.
- Tmp2 = ComputeNumSignBits(Op.getOperand(1), Depth+1);
- return std::min(Tmp, Tmp2);
-
- case ISD::SETCC:
- // If setcc returns 0/-1, all bits are sign bits.
- if (TLI.getSetCCResultContents() ==
- TargetLowering::ZeroOrNegativeOneSetCCResult)
- return VTBits;
- break;
- case ISD::ROTL:
- case ISD::ROTR:
- if (ConstantSDNode *C = dyn_cast<ConstantSDNode>(Op.getOperand(1))) {
- unsigned RotAmt = C->getValue() & (VTBits-1);
-
- // Handle rotate right by N like a rotate left by 32-N.
- if (Op.getOpcode() == ISD::ROTR)
- RotAmt = (VTBits-RotAmt) & (VTBits-1);
-
- // If we aren't rotating out all of the known-in sign bits, return the
- // number that are left. This handles rotl(sext(x), 1) for example.
- Tmp = ComputeNumSignBits(Op.getOperand(0), Depth+1);
- if (Tmp > RotAmt+1) return Tmp-RotAmt;
- }
- break;
- case ISD::ADD:
- // Add can have at most one carry bit. Thus we know that the output
- // is, at worst, one more bit than the inputs.
- Tmp = ComputeNumSignBits(Op.getOperand(0), Depth+1);
- if (Tmp == 1) return 1; // Early out.
-
- // Special case decrementing a value (ADD X, -1):
- if (ConstantSDNode *CRHS = dyn_cast<ConstantSDNode>(Op.getOperand(0)))
- if (CRHS->isAllOnesValue()) {
- APInt KnownZero, KnownOne;
- APInt Mask = APInt::getAllOnesValue(VTBits);
- ComputeMaskedBits(Op.getOperand(0), Mask, KnownZero, KnownOne, Depth+1);
-
- // If the input is known to be 0 or 1, the output is 0/-1, which is all
- // sign bits set.
- if ((KnownZero | APInt(VTBits, 1)) == Mask)
- return VTBits;
-
- // If we are subtracting one from a positive number, there is no carry
- // out of the result.
- if (KnownZero.isNegative())
- return Tmp;
- }
-
- Tmp2 = ComputeNumSignBits(Op.getOperand(1), Depth+1);
- if (Tmp2 == 1) return 1;
- return std::min(Tmp, Tmp2)-1;
- break;
-
- case ISD::SUB:
- Tmp2 = ComputeNumSignBits(Op.getOperand(1), Depth+1);
- if (Tmp2 == 1) return 1;
-
- // Handle NEG.
- if (ConstantSDNode *CLHS = dyn_cast<ConstantSDNode>(Op.getOperand(0)))
- if (CLHS->isNullValue()) {
- APInt KnownZero, KnownOne;
- APInt Mask = APInt::getAllOnesValue(VTBits);
- ComputeMaskedBits(Op.getOperand(1), Mask, KnownZero, KnownOne, Depth+1);
- // If the input is known to be 0 or 1, the output is 0/-1, which is all
- // sign bits set.
- if ((KnownZero | APInt(VTBits, 1)) == Mask)
- return VTBits;
-
- // If the input is known to be positive (the sign bit is known clear),
- // the output of the NEG has the same number of sign bits as the input.
- if (KnownZero.isNegative())
- return Tmp2;
-
- // Otherwise, we treat this like a SUB.
- }
-
- // Sub can have at most one carry bit. Thus we know that the output
- // is, at worst, one more bit than the inputs.
- Tmp = ComputeNumSignBits(Op.getOperand(0), Depth+1);
- if (Tmp == 1) return 1; // Early out.
- return std::min(Tmp, Tmp2)-1;
- break;
- case ISD::TRUNCATE:
- // FIXME: it's tricky to do anything useful for this, but it is an important
- // case for targets like X86.
- break;
- }
-
- // Handle LOADX separately here. EXTLOAD case will fallthrough.
- if (Op.getOpcode() == ISD::LOAD) {
- LoadSDNode *LD = cast<LoadSDNode>(Op);
- unsigned ExtType = LD->getExtensionType();
- switch (ExtType) {
- default: break;
- case ISD::SEXTLOAD: // '17' bits known
- Tmp = MVT::getSizeInBits(LD->getMemoryVT());
- return VTBits-Tmp+1;
- case ISD::ZEXTLOAD: // '16' bits known
- Tmp = MVT::getSizeInBits(LD->getMemoryVT());
- return VTBits-Tmp;
- }
- }
-
- // Allow the target to implement this method for its nodes.
- if (Op.getOpcode() >= ISD::BUILTIN_OP_END ||
- Op.getOpcode() == ISD::INTRINSIC_WO_CHAIN ||
- Op.getOpcode() == ISD::INTRINSIC_W_CHAIN ||
- Op.getOpcode() == ISD::INTRINSIC_VOID) {
- unsigned NumBits = TLI.ComputeNumSignBitsForTargetNode(Op, Depth);
- if (NumBits > 1) return NumBits;
- }
-
- // Finally, if we can prove that the top bits of the result are 0's or 1's,
- // use this information.
- APInt KnownZero, KnownOne;
- APInt Mask = APInt::getAllOnesValue(VTBits);
- ComputeMaskedBits(Op, Mask, KnownZero, KnownOne, Depth);
-
- if (KnownZero.isNegative()) { // sign bit is 0
- Mask = KnownZero;
- } else if (KnownOne.isNegative()) { // sign bit is 1;
- Mask = KnownOne;
- } else {
- // Nothing known.
- return 1;
- }
-
- // Okay, we know that the sign bit in Mask is set. Use CLZ to determine
- // the number of identical bits in the top of the input value.
- Mask = ~Mask;
- Mask <<= Mask.getBitWidth()-VTBits;
- // Return # leading zeros. We use 'min' here in case Val was zero before
- // shifting. We don't want to return '64' as for an i32 "0".
- return std::min(VTBits, Mask.countLeadingZeros());
-}
-
-
-bool SelectionDAG::isVerifiedDebugInfoDesc(SDOperand Op) const {
- GlobalAddressSDNode *GA = dyn_cast<GlobalAddressSDNode>(Op);
- if (!GA) return false;
- GlobalVariable *GV = dyn_cast<GlobalVariable>(GA->getGlobal());
- if (!GV) return false;
- MachineModuleInfo *MMI = getMachineModuleInfo();
- return MMI && MMI->hasDebugInfo() && MMI->isVerified(GV);
-}
-
-
-/// getNode - Gets or creates the specified node.
-///
-SDOperand SelectionDAG::getNode(unsigned Opcode, MVT::ValueType VT) {
- FoldingSetNodeID ID;
- AddNodeIDNode(ID, Opcode, getVTList(VT), (SDOperand*)0, 0);
- void *IP = 0;
- if (SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP))
- return SDOperand(E, 0);
- SDNode *N = new SDNode(Opcode, SDNode::getSDVTList(VT));
- CSEMap.InsertNode(N, IP);
-
- AllNodes.push_back(N);
- return SDOperand(N, 0);
-}
-
-SDOperand SelectionDAG::getNode(unsigned Opcode, MVT::ValueType VT,
- SDOperand Operand) {
- // Constant fold unary operations with an integer constant operand.
- if (ConstantSDNode *C = dyn_cast<ConstantSDNode>(Operand.Val)) {
- const APInt &Val = C->getAPIntValue();
- unsigned BitWidth = MVT::getSizeInBits(VT);
- switch (Opcode) {
- default: break;
- case ISD::SIGN_EXTEND:
- return getConstant(APInt(Val).sextOrTrunc(BitWidth), VT);
- case ISD::ANY_EXTEND:
- case ISD::ZERO_EXTEND:
- case ISD::TRUNCATE:
- return getConstant(APInt(Val).zextOrTrunc(BitWidth), VT);
- case ISD::UINT_TO_FP:
- case ISD::SINT_TO_FP: {
- const uint64_t zero[] = {0, 0};
- // No compile time operations on this type.
- if (VT==MVT::ppcf128)
- break;
- APFloat apf = APFloat(APInt(BitWidth, 2, zero));
- (void)apf.convertFromAPInt(Val,
- Opcode==ISD::SINT_TO_FP,
- APFloat::rmNearestTiesToEven);
- return getConstantFP(apf, VT);
- }
- case ISD::BIT_CONVERT:
- if (VT == MVT::f32 && C->getValueType(0) == MVT::i32)
- return getConstantFP(Val.bitsToFloat(), VT);
- else if (VT == MVT::f64 && C->getValueType(0) == MVT::i64)
- return getConstantFP(Val.bitsToDouble(), VT);
- break;
- case ISD::BSWAP:
- return getConstant(Val.byteSwap(), VT);
- case ISD::CTPOP:
- return getConstant(Val.countPopulation(), VT);
- case ISD::CTLZ:
- return getConstant(Val.countLeadingZeros(), VT);
- case ISD::CTTZ:
- return getConstant(Val.countTrailingZeros(), VT);
- }
- }
-
- // Constant fold unary operations with a floating point constant operand.
- if (ConstantFPSDNode *C = dyn_cast<ConstantFPSDNode>(Operand.Val)) {
- APFloat V = C->getValueAPF(); // make copy
- if (VT != MVT::ppcf128 && Operand.getValueType() != MVT::ppcf128) {
- switch (Opcode) {
- case ISD::FNEG:
- V.changeSign();
- return getConstantFP(V, VT);
- case ISD::FABS:
- V.clearSign();
- return getConstantFP(V, VT);
- case ISD::FP_ROUND:
- case ISD::FP_EXTEND:
- // This can return overflow, underflow, or inexact; we don't care.
- // FIXME need to be more flexible about rounding mode.
- (void)V.convert(*MVTToAPFloatSemantics(VT),
- APFloat::rmNearestTiesToEven);
- return getConstantFP(V, VT);
- case ISD::FP_TO_SINT:
- case ISD::FP_TO_UINT: {
- integerPart x;
- assert(integerPartWidth >= 64);
- // FIXME need to be more flexible about rounding mode.
- APFloat::opStatus s = V.convertToInteger(&x, 64U,
- Opcode==ISD::FP_TO_SINT,
- APFloat::rmTowardZero);
- if (s==APFloat::opInvalidOp) // inexact is OK, in fact usual
- break;
- return getConstant(x, VT);
- }
- case ISD::BIT_CONVERT:
- if (VT == MVT::i32 && C->getValueType(0) == MVT::f32)
- return getConstant((uint32_t)V.convertToAPInt().getZExtValue(), VT);
- else if (VT == MVT::i64 && C->getValueType(0) == MVT::f64)
- return getConstant(V.convertToAPInt().getZExtValue(), VT);
- break;
- }
- }
- }
-
- unsigned OpOpcode = Operand.Val->getOpcode();
- switch (Opcode) {
- case ISD::TokenFactor:
- case ISD::MERGE_VALUES:
- return Operand; // Factor or merge of one node? No need.
- case ISD::FP_ROUND: assert(0 && "Invalid method to make FP_ROUND node");
- case ISD::FP_EXTEND:
- assert(MVT::isFloatingPoint(VT) &&
- MVT::isFloatingPoint(Operand.getValueType()) && "Invalid FP cast!");
- if (Operand.getValueType() == VT) return Operand; // noop conversion.
- if (Operand.getOpcode() == ISD::UNDEF)
- return getNode(ISD::UNDEF, VT);
- break;
- case ISD::SIGN_EXTEND:
- assert(MVT::isInteger(VT) && MVT::isInteger(Operand.getValueType()) &&
- "Invalid SIGN_EXTEND!");
- if (Operand.getValueType() == VT) return Operand; // noop extension
- assert(MVT::getSizeInBits(Operand.getValueType()) < MVT::getSizeInBits(VT)
- && "Invalid sext node, dst < src!");
- if (OpOpcode == ISD::SIGN_EXTEND || OpOpcode == ISD::ZERO_EXTEND)
- return getNode(OpOpcode, VT, Operand.Val->getOperand(0));
- break;
- case ISD::ZERO_EXTEND:
- assert(MVT::isInteger(VT) && MVT::isInteger(Operand.getValueType()) &&
- "Invalid ZERO_EXTEND!");
- if (Operand.getValueType() == VT) return Operand; // noop extension
- assert(MVT::getSizeInBits(Operand.getValueType()) < MVT::getSizeInBits(VT)
- && "Invalid zext node, dst < src!");
- if (OpOpcode == ISD::ZERO_EXTEND) // (zext (zext x)) -> (zext x)
- return getNode(ISD::ZERO_EXTEND, VT, Operand.Val->getOperand(0));
- break;
- case ISD::ANY_EXTEND:
- assert(MVT::isInteger(VT) && MVT::isInteger(Operand.getValueType()) &&
- "Invalid ANY_EXTEND!");
- if (Operand.getValueType() == VT) return Operand; // noop extension
- assert(MVT::getSizeInBits(Operand.getValueType()) < MVT::getSizeInBits(VT)
- && "Invalid anyext node, dst < src!");
- if (OpOpcode == ISD::ZERO_EXTEND || OpOpcode == ISD::SIGN_EXTEND)
- // (ext (zext x)) -> (zext x) and (ext (sext x)) -> (sext x)
- return getNode(OpOpcode, VT, Operand.Val->getOperand(0));
- break;
- case ISD::TRUNCATE:
- assert(MVT::isInteger(VT) && MVT::isInteger(Operand.getValueType()) &&
- "Invalid TRUNCATE!");
- if (Operand.getValueType() == VT) return Operand; // noop truncate
- assert(MVT::getSizeInBits(Operand.getValueType()) > MVT::getSizeInBits(VT)
- && "Invalid truncate node, src < dst!");
- if (OpOpcode == ISD::TRUNCATE)
- return getNode(ISD::TRUNCATE, VT, Operand.Val->getOperand(0));
- else if (OpOpcode == ISD::ZERO_EXTEND || OpOpcode == ISD::SIGN_EXTEND ||
- OpOpcode == ISD::ANY_EXTEND) {
- // If the source is smaller than the dest, we still need an extend.
- if (MVT::getSizeInBits(Operand.Val->getOperand(0).getValueType())
- < MVT::getSizeInBits(VT))
- return getNode(OpOpcode, VT, Operand.Val->getOperand(0));
- else if (MVT::getSizeInBits(Operand.Val->getOperand(0).getValueType())
- > MVT::getSizeInBits(VT))
- return getNode(ISD::TRUNCATE, VT, Operand.Val->getOperand(0));
- else
- return Operand.Val->getOperand(0);
- }
- break;
- case ISD::BIT_CONVERT:
- // Basic sanity checking.
- assert(MVT::getSizeInBits(VT) == MVT::getSizeInBits(Operand.getValueType())
- && "Cannot BIT_CONVERT between types of different sizes!");
- if (VT == Operand.getValueType()) return Operand; // noop conversion.
- if (OpOpcode == ISD::BIT_CONVERT) // bitconv(bitconv(x)) -> bitconv(x)
- return getNode(ISD::BIT_CONVERT, VT, Operand.getOperand(0));
- if (OpOpcode == ISD::UNDEF)
- return getNode(ISD::UNDEF, VT);
- break;
- case ISD::SCALAR_TO_VECTOR:
- assert(MVT::isVector(VT) && !MVT::isVector(Operand.getValueType()) &&
- MVT::getVectorElementType(VT) == Operand.getValueType() &&
- "Illegal SCALAR_TO_VECTOR node!");
- if (OpOpcode == ISD::UNDEF)
- return getNode(ISD::UNDEF, VT);
- // scalar_to_vector(extract_vector_elt V, 0) -> V, top bits are undefined.
- if (OpOpcode == ISD::EXTRACT_VECTOR_ELT &&
- isa<ConstantSDNode>(Operand.getOperand(1)) &&
- Operand.getConstantOperandVal(1) == 0 &&
- Operand.getOperand(0).getValueType() == VT)
- return Operand.getOperand(0);
- break;
- case ISD::FNEG:
- if (OpOpcode == ISD::FSUB) // -(X-Y) -> (Y-X)
- return getNode(ISD::FSUB, VT, Operand.Val->getOperand(1),
- Operand.Val->getOperand(0));
- if (OpOpcode == ISD::FNEG) // --X -> X
- return Operand.Val->getOperand(0);
- break;
- case ISD::FABS:
- if (OpOpcode == ISD::FNEG) // abs(-X) -> abs(X)
- return getNode(ISD::FABS, VT, Operand.Val->getOperand(0));
- break;
- }
-
- SDNode *N;
- SDVTList VTs = getVTList(VT);
- if (VT != MVT::Flag) { // Don't CSE flag producing nodes
- FoldingSetNodeID ID;
- SDOperand Ops[1] = { Operand };
- AddNodeIDNode(ID, Opcode, VTs, Ops, 1);
- void *IP = 0;
- if (SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP))
- return SDOperand(E, 0);
- N = new UnarySDNode(Opcode, VTs, Operand);
- CSEMap.InsertNode(N, IP);
- } else {
- N = new UnarySDNode(Opcode, VTs, Operand);
- }
- AllNodes.push_back(N);
- return SDOperand(N, 0);
-}
-
-
-
-SDOperand SelectionDAG::getNode(unsigned Opcode, MVT::ValueType VT,
- SDOperand N1, SDOperand N2) {
- ConstantSDNode *N1C = dyn_cast<ConstantSDNode>(N1.Val);
- ConstantSDNode *N2C = dyn_cast<ConstantSDNode>(N2.Val);
- switch (Opcode) {
- default: break;
- case ISD::TokenFactor:
- assert(VT == MVT::Other && N1.getValueType() == MVT::Other &&
- N2.getValueType() == MVT::Other && "Invalid token factor!");
- // Fold trivial token factors.
- if (N1.getOpcode() == ISD::EntryToken) return N2;
- if (N2.getOpcode() == ISD::EntryToken) return N1;
- break;
- case ISD::AND:
- assert(MVT::isInteger(VT) && N1.getValueType() == N2.getValueType() &&
- N1.getValueType() == VT && "Binary operator types must match!");
- // (X & 0) -> 0. This commonly occurs when legalizing i64 values, so it's
- // worth handling here.
- if (N2C && N2C->isNullValue())
- return N2;
- if (N2C && N2C->isAllOnesValue()) // X & -1 -> X
- return N1;
- break;
- case ISD::OR:
- case ISD::XOR:
- assert(MVT::isInteger(VT) && N1.getValueType() == N2.getValueType() &&
- N1.getValueType() == VT && "Binary operator types must match!");
- // (X ^| 0) -> X. This commonly occurs when legalizing i64 values, so it's
- // worth handling here.
- if (N2C && N2C->isNullValue())
- return N1;
- break;
- case ISD::UDIV:
- case ISD::UREM:
- case ISD::MULHU:
- case ISD::MULHS:
- assert(MVT::isInteger(VT) && "This operator does not apply to FP types!");
- // fall through
- case ISD::ADD:
- case ISD::SUB:
- case ISD::MUL:
- case ISD::SDIV:
- case ISD::SREM:
- case ISD::FADD:
- case ISD::FSUB:
- case ISD::FMUL:
- case ISD::FDIV:
- case ISD::FREM:
- assert(N1.getValueType() == N2.getValueType() &&
- N1.getValueType() == VT && "Binary operator types must match!");
- break;
- case ISD::FCOPYSIGN: // N1 and result must match. N1/N2 need not match.
- assert(N1.getValueType() == VT &&
- MVT::isFloatingPoint(N1.getValueType()) &&
- MVT::isFloatingPoint(N2.getValueType()) &&
- "Invalid FCOPYSIGN!");
- break;
- case ISD::SHL:
- case ISD::SRA:
- case ISD::SRL:
- case ISD::ROTL:
- case ISD::ROTR:
- assert(VT == N1.getValueType() &&
- "Shift operators return type must be the same as their first arg");
- assert(MVT::isInteger(VT) && MVT::isInteger(N2.getValueType()) &&
- VT != MVT::i1 && "Shifts only work on integers");
- break;
- case ISD::FP_ROUND_INREG: {
- MVT::ValueType EVT = cast<VTSDNode>(N2)->getVT();
- assert(VT == N1.getValueType() && "Not an inreg round!");
- assert(MVT::isFloatingPoint(VT) && MVT::isFloatingPoint(EVT) &&
- "Cannot FP_ROUND_INREG integer types");
- assert(MVT::getSizeInBits(EVT) <= MVT::getSizeInBits(VT) &&
- "Not rounding down!");
- if (cast<VTSDNode>(N2)->getVT() == VT) return N1; // Not actually rounding.
- break;
- }
- case ISD::FP_ROUND:
- assert(MVT::isFloatingPoint(VT) &&
- MVT::isFloatingPoint(N1.getValueType()) &&
- MVT::getSizeInBits(VT) <= MVT::getSizeInBits(N1.getValueType()) &&
- isa<ConstantSDNode>(N2) && "Invalid FP_ROUND!");
- if (N1.getValueType() == VT) return N1; // noop conversion.
- break;
- case ISD::AssertSext:
- case ISD::AssertZext: {
- MVT::ValueType EVT = cast<VTSDNode>(N2)->getVT();
- assert(VT == N1.getValueType() && "Not an inreg extend!");
- assert(MVT::isInteger(VT) && MVT::isInteger(EVT) &&
- "Cannot *_EXTEND_INREG FP types");
- assert(MVT::getSizeInBits(EVT) <= MVT::getSizeInBits(VT) &&
- "Not extending!");
- if (VT == EVT) return N1; // noop assertion.
- break;
- }
- case ISD::SIGN_EXTEND_INREG: {
- MVT::ValueType EVT = cast<VTSDNode>(N2)->getVT();
- assert(VT == N1.getValueType() && "Not an inreg extend!");
- assert(MVT::isInteger(VT) && MVT::isInteger(EVT) &&
- "Cannot *_EXTEND_INREG FP types");
- assert(MVT::getSizeInBits(EVT) <= MVT::getSizeInBits(VT) &&
- "Not extending!");
- if (EVT == VT) return N1; // Not actually extending
-
- if (N1C) {
- APInt Val = N1C->getAPIntValue();
- unsigned FromBits = MVT::getSizeInBits(cast<VTSDNode>(N2)->getVT());
- Val <<= Val.getBitWidth()-FromBits;
- Val = Val.ashr(Val.getBitWidth()-FromBits);
- return getConstant(Val, VT);
- }
- break;
- }
- case ISD::EXTRACT_VECTOR_ELT:
- assert(N2C && "Bad EXTRACT_VECTOR_ELT!");
-
- // EXTRACT_VECTOR_ELT of an UNDEF is an UNDEF.
- if (N1.getOpcode() == ISD::UNDEF)
- return getNode(ISD::UNDEF, VT);
-
- // EXTRACT_VECTOR_ELT of CONCAT_VECTORS is often formed while lowering is
- // expanding copies of large vectors from registers.
- if (N1.getOpcode() == ISD::CONCAT_VECTORS &&
- N1.getNumOperands() > 0) {
- unsigned Factor =
- MVT::getVectorNumElements(N1.getOperand(0).getValueType());
- return getNode(ISD::EXTRACT_VECTOR_ELT, VT,
- N1.getOperand(N2C->getValue() / Factor),
- getConstant(N2C->getValue() % Factor, N2.getValueType()));
- }
-
- // EXTRACT_VECTOR_ELT of BUILD_VECTOR is often formed while lowering is
- // expanding large vector constants.
- if (N1.getOpcode() == ISD::BUILD_VECTOR)
- return N1.getOperand(N2C->getValue());
-
- // EXTRACT_VECTOR_ELT of INSERT_VECTOR_ELT is often formed when vector
- // operations are lowered to scalars.
- if (N1.getOpcode() == ISD::INSERT_VECTOR_ELT)
- if (ConstantSDNode *IEC = dyn_cast<ConstantSDNode>(N1.getOperand(2))) {
- if (IEC == N2C)
- return N1.getOperand(1);
- else
- return getNode(ISD::EXTRACT_VECTOR_ELT, VT, N1.getOperand(0), N2);
- }
- break;
- case ISD::EXTRACT_ELEMENT:
- assert(N2C && (unsigned)N2C->getValue() < 2 && "Bad EXTRACT_ELEMENT!");
- assert(!MVT::isVector(N1.getValueType()) &&
- MVT::isInteger(N1.getValueType()) &&
- !MVT::isVector(VT) && MVT::isInteger(VT) &&
- "EXTRACT_ELEMENT only applies to integers!");
-
- // EXTRACT_ELEMENT of BUILD_PAIR is often formed while legalize is expanding
- // 64-bit integers into 32-bit parts. Instead of building the extract of
- // the BUILD_PAIR, only to have legalize rip it apart, just do it now.
- if (N1.getOpcode() == ISD::BUILD_PAIR)
- return N1.getOperand(N2C->getValue());
-
- // EXTRACT_ELEMENT of a constant int is also very common.
- if (ConstantSDNode *C = dyn_cast<ConstantSDNode>(N1)) {
- unsigned ElementSize = MVT::getSizeInBits(VT);
- unsigned Shift = ElementSize * N2C->getValue();
- APInt ShiftedVal = C->getAPIntValue().lshr(Shift);
- return getConstant(ShiftedVal.trunc(ElementSize), VT);
- }
- break;
- case ISD::EXTRACT_SUBVECTOR:
- if (N1.getValueType() == VT) // Trivial extraction.
- return N1;
- break;
- }
-
- if (N1C) {
- if (N2C) {
- APInt C1 = N1C->getAPIntValue(), C2 = N2C->getAPIntValue();
- switch (Opcode) {
- case ISD::ADD: return getConstant(C1 + C2, VT);
- case ISD::SUB: return getConstant(C1 - C2, VT);
- case ISD::MUL: return getConstant(C1 * C2, VT);
- case ISD::UDIV:
- if (C2.getBoolValue()) return getConstant(C1.udiv(C2), VT);
- break;
- case ISD::UREM :
- if (C2.getBoolValue()) return getConstant(C1.urem(C2), VT);
- break;
- case ISD::SDIV :
- if (C2.getBoolValue()) return getConstant(C1.sdiv(C2), VT);
- break;
- case ISD::SREM :
- if (C2.getBoolValue()) return getConstant(C1.srem(C2), VT);
- break;
- case ISD::AND : return getConstant(C1 & C2, VT);
- case ISD::OR : return getConstant(C1 | C2, VT);
- case ISD::XOR : return getConstant(C1 ^ C2, VT);
- case ISD::SHL : return getConstant(C1 << C2, VT);
- case ISD::SRL : return getConstant(C1.lshr(C2), VT);
- case ISD::SRA : return getConstant(C1.ashr(C2), VT);
- case ISD::ROTL : return getConstant(C1.rotl(C2), VT);
- case ISD::ROTR : return getConstant(C1.rotr(C2), VT);
- default: break;
- }
- } else { // Cannonicalize constant to RHS if commutative
- if (isCommutativeBinOp(Opcode)) {
- std::swap(N1C, N2C);
- std::swap(N1, N2);
- }
- }
- }
-
- // Constant fold FP operations.
- ConstantFPSDNode *N1CFP = dyn_cast<ConstantFPSDNode>(N1.Val);
- ConstantFPSDNode *N2CFP = dyn_cast<ConstantFPSDNode>(N2.Val);
- if (N1CFP) {
- if (!N2CFP && isCommutativeBinOp(Opcode)) {
- // Cannonicalize constant to RHS if commutative
- std::swap(N1CFP, N2CFP);
- std::swap(N1, N2);
- } else if (N2CFP && VT != MVT::ppcf128) {
- APFloat V1 = N1CFP->getValueAPF(), V2 = N2CFP->getValueAPF();
- APFloat::opStatus s;
- switch (Opcode) {
- case ISD::FADD:
- s = V1.add(V2, APFloat::rmNearestTiesToEven);
- if (s != APFloat::opInvalidOp)
- return getConstantFP(V1, VT);
- break;
- case ISD::FSUB:
- s = V1.subtract(V2, APFloat::rmNearestTiesToEven);
- if (s!=APFloat::opInvalidOp)
- return getConstantFP(V1, VT);
- break;
- case ISD::FMUL:
- s = V1.multiply(V2, APFloat::rmNearestTiesToEven);
- if (s!=APFloat::opInvalidOp)
- return getConstantFP(V1, VT);
- break;
- case ISD::FDIV:
- s = V1.divide(V2, APFloat::rmNearestTiesToEven);
- if (s!=APFloat::opInvalidOp && s!=APFloat::opDivByZero)
- return getConstantFP(V1, VT);
- break;
- case ISD::FREM :
- s = V1.mod(V2, APFloat::rmNearestTiesToEven);
- if (s!=APFloat::opInvalidOp && s!=APFloat::opDivByZero)
- return getConstantFP(V1, VT);
- break;
- case ISD::FCOPYSIGN:
- V1.copySign(V2);
- return getConstantFP(V1, VT);
- default: break;
- }
- }
- }
-
- // Canonicalize an UNDEF to the RHS, even over a constant.
- if (N1.getOpcode() == ISD::UNDEF) {
- if (isCommutativeBinOp(Opcode)) {
- std::swap(N1, N2);
- } else {
- switch (Opcode) {
- case ISD::FP_ROUND_INREG:
- case ISD::SIGN_EXTEND_INREG:
- case ISD::SUB:
- case ISD::FSUB:
- case ISD::FDIV:
- case ISD::FREM:
- case ISD::SRA:
- return N1; // fold op(undef, arg2) -> undef
- case ISD::UDIV:
- case ISD::SDIV:
- case ISD::UREM:
- case ISD::SREM:
- case ISD::SRL:
- case ISD::SHL:
- if (!MVT::isVector(VT))
- return getConstant(0, VT); // fold op(undef, arg2) -> 0
- // For vectors, we can't easily build an all zero vector, just return
- // the LHS.
- return N2;
- }
- }
- }
-
- // Fold a bunch of operators when the RHS is undef.
- if (N2.getOpcode() == ISD::UNDEF) {
- switch (Opcode) {
- case ISD::XOR:
- if (N1.getOpcode() == ISD::UNDEF)
- // Handle undef ^ undef -> 0 special case. This is a common
- // idiom (misuse).
- return getConstant(0, VT);
- // fallthrough
- case ISD::ADD:
- case ISD::ADDC:
- case ISD::ADDE:
- case ISD::SUB:
- case ISD::FADD:
- case ISD::FSUB:
- case ISD::FMUL:
- case ISD::FDIV:
- case ISD::FREM:
- case ISD::UDIV:
- case ISD::SDIV:
- case ISD::UREM:
- case ISD::SREM:
- return N2; // fold op(arg1, undef) -> undef
- case ISD::MUL:
- case ISD::AND:
- case ISD::SRL:
- case ISD::SHL:
- if (!MVT::isVector(VT))
- return getConstant(0, VT); // fold op(arg1, undef) -> 0
- // For vectors, we can't easily build an all zero vector, just return
- // the LHS.
- return N1;
- case ISD::OR:
- if (!MVT::isVector(VT))
- return getConstant(MVT::getIntVTBitMask(VT), VT);
- // For vectors, we can't easily build an all one vector, just return
- // the LHS.
- return N1;
- case ISD::SRA:
- return N1;
- }
- }
-
- // Memoize this node if possible.
- SDNode *N;
- SDVTList VTs = getVTList(VT);
- if (VT != MVT::Flag) {
- SDOperand Ops[] = { N1, N2 };
- FoldingSetNodeID ID;
- AddNodeIDNode(ID, Opcode, VTs, Ops, 2);
- void *IP = 0;
- if (SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP))
- return SDOperand(E, 0);
- N = new BinarySDNode(Opcode, VTs, N1, N2);
- CSEMap.InsertNode(N, IP);
- } else {
- N = new BinarySDNode(Opcode, VTs, N1, N2);
- }
-
- AllNodes.push_back(N);
- return SDOperand(N, 0);
-}
-
-SDOperand SelectionDAG::getNode(unsigned Opcode, MVT::ValueType VT,
- SDOperand N1, SDOperand N2, SDOperand N3) {
- // Perform various simplifications.
- ConstantSDNode *N1C = dyn_cast<ConstantSDNode>(N1.Val);
- ConstantSDNode *N2C = dyn_cast<ConstantSDNode>(N2.Val);
- switch (Opcode) {
- case ISD::SETCC: {
- // Use FoldSetCC to simplify SETCC's.
- SDOperand Simp = FoldSetCC(VT, N1, N2, cast<CondCodeSDNode>(N3)->get());
- if (Simp.Val) return Simp;
- break;
- }
- case ISD::SELECT:
- if (N1C) {
- if (N1C->getValue())
- return N2; // select true, X, Y -> X
- else
- return N3; // select false, X, Y -> Y
- }
-
- if (N2 == N3) return N2; // select C, X, X -> X
- break;
- case ISD::BRCOND:
- if (N2C) {
- if (N2C->getValue()) // Unconditional branch
- return getNode(ISD::BR, MVT::Other, N1, N3);
- else
- return N1; // Never-taken branch
- }
- break;
- case ISD::VECTOR_SHUFFLE:
- assert(VT == N1.getValueType() && VT == N2.getValueType() &&
- MVT::isVector(VT) && MVT::isVector(N3.getValueType()) &&
- N3.getOpcode() == ISD::BUILD_VECTOR &&
- MVT::getVectorNumElements(VT) == N3.getNumOperands() &&
- "Illegal VECTOR_SHUFFLE node!");
- break;
- case ISD::BIT_CONVERT:
- // Fold bit_convert nodes from a type to themselves.
- if (N1.getValueType() == VT)
- return N1;
- break;
- }
-
- // Memoize node if it doesn't produce a flag.
- SDNode *N;
- SDVTList VTs = getVTList(VT);
- if (VT != MVT::Flag) {
- SDOperand Ops[] = { N1, N2, N3 };
- FoldingSetNodeID ID;
- AddNodeIDNode(ID, Opcode, VTs, Ops, 3);
- void *IP = 0;
- if (SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP))
- return SDOperand(E, 0);
- N = new TernarySDNode(Opcode, VTs, N1, N2, N3);
- CSEMap.InsertNode(N, IP);
- } else {
- N = new TernarySDNode(Opcode, VTs, N1, N2, N3);
- }
- AllNodes.push_back(N);
- return SDOperand(N, 0);
-}
-
-SDOperand SelectionDAG::getNode(unsigned Opcode, MVT::ValueType VT,
- SDOperand N1, SDOperand N2, SDOperand N3,
- SDOperand N4) {
- SDOperand Ops[] = { N1, N2, N3, N4 };
- return getNode(Opcode, VT, Ops, 4);
-}
-
-SDOperand SelectionDAG::getNode(unsigned Opcode, MVT::ValueType VT,
- SDOperand N1, SDOperand N2, SDOperand N3,
- SDOperand N4, SDOperand N5) {
- SDOperand Ops[] = { N1, N2, N3, N4, N5 };
- return getNode(Opcode, VT, Ops, 5);
-}
-
-/// getMemsetValue - Vectorized representation of the memset value
-/// operand.
-static SDOperand getMemsetValue(SDOperand Value, MVT::ValueType VT,
- SelectionDAG &DAG) {
- MVT::ValueType CurVT = VT;
- if (ConstantSDNode *C = dyn_cast<ConstantSDNode>(Value)) {
- uint64_t Val = C->getValue() & 255;
- unsigned Shift = 8;
- while (CurVT != MVT::i8) {
- Val = (Val << Shift) | Val;
- Shift <<= 1;
- CurVT = (MVT::ValueType)((unsigned)CurVT - 1);
- }
- return DAG.getConstant(Val, VT);
- } else {
- Value = DAG.getNode(ISD::ZERO_EXTEND, VT, Value);
- unsigned Shift = 8;
- while (CurVT != MVT::i8) {
- Value =
- DAG.getNode(ISD::OR, VT,
- DAG.getNode(ISD::SHL, VT, Value,
- DAG.getConstant(Shift, MVT::i8)), Value);
- Shift <<= 1;
- CurVT = (MVT::ValueType)((unsigned)CurVT - 1);
- }
-
- return Value;
- }
-}
-
-/// getMemsetStringVal - Similar to getMemsetValue. Except this is only
-/// used when a memcpy is turned into a memset when the source is a constant
-/// string ptr.
-static SDOperand getMemsetStringVal(MVT::ValueType VT,
- SelectionDAG &DAG,
- const TargetLowering &TLI,
- std::string &Str, unsigned Offset) {
- uint64_t Val = 0;
- unsigned MSB = MVT::getSizeInBits(VT) / 8;
- if (TLI.isLittleEndian())
- Offset = Offset + MSB - 1;
- for (unsigned i = 0; i != MSB; ++i) {
- Val = (Val << 8) | (unsigned char)Str[Offset];
- Offset += TLI.isLittleEndian() ? -1 : 1;
- }
- return DAG.getConstant(Val, VT);
-}
-
-/// getMemBasePlusOffset - Returns base and offset node for the
-static SDOperand getMemBasePlusOffset(SDOperand Base, unsigned Offset,
- SelectionDAG &DAG) {
- MVT::ValueType VT = Base.getValueType();
- return DAG.getNode(ISD::ADD, VT, Base, DAG.getConstant(Offset, VT));
-}
-
-/// MeetsMaxMemopRequirement - Determines if the number of memory ops required
-/// to replace the memset / memcpy is below the threshold. It also returns the
-/// types of the sequence of memory ops to perform memset / memcpy.
-static bool MeetsMaxMemopRequirement(std::vector<MVT::ValueType> &MemOps,
- unsigned Limit, uint64_t Size,
- unsigned Align,
- const TargetLowering &TLI) {
- MVT::ValueType VT;
-
- if (TLI.allowsUnalignedMemoryAccesses()) {
- VT = MVT::i64;
- } else {
- switch (Align & 7) {
- case 0:
- VT = MVT::i64;
- break;
- case 4:
- VT = MVT::i32;
- break;
- case 2:
- VT = MVT::i16;
- break;
- default:
- VT = MVT::i8;
- break;
- }
- }
-
- MVT::ValueType LVT = MVT::i64;
- while (!TLI.isTypeLegal(LVT))
- LVT = (MVT::ValueType)((unsigned)LVT - 1);
- assert(MVT::isInteger(LVT));
-
- if (VT > LVT)
- VT = LVT;
-
- unsigned NumMemOps = 0;
- while (Size != 0) {
- unsigned VTSize = MVT::getSizeInBits(VT) / 8;
- while (VTSize > Size) {
- VT = (MVT::ValueType)((unsigned)VT - 1);
- VTSize >>= 1;
- }
- assert(MVT::isInteger(VT));
-
- if (++NumMemOps > Limit)
- return false;
- MemOps.push_back(VT);
- Size -= VTSize;
- }
-
- return true;
-}
-
-static SDOperand getMemcpyLoadsAndStores(SelectionDAG &DAG,
- SDOperand Chain, SDOperand Dst,
- SDOperand Src, uint64_t Size,
- unsigned Align,
- bool AlwaysInline,
- const Value *DstSV, uint64_t DstSVOff,
- const Value *SrcSV, uint64_t SrcSVOff){
- const TargetLowering &TLI = DAG.getTargetLoweringInfo();
-
- // Expand memcpy to a series of store ops if the size operand falls below
- // a certain threshold.
- std::vector<MVT::ValueType> MemOps;
- uint64_t Limit = -1;
- if (!AlwaysInline)
- Limit = TLI.getMaxStoresPerMemcpy();
- if (!MeetsMaxMemopRequirement(MemOps, Limit, Size, Align, TLI))
- return SDOperand();
-
- SmallVector<SDOperand, 8> OutChains;
-
- unsigned NumMemOps = MemOps.size();
- unsigned SrcDelta = 0;
- GlobalAddressSDNode *G = NULL;
- std::string Str;
- bool CopyFromStr = false;
- uint64_t SrcOff = 0, DstOff = 0;
-
- if (Src.getOpcode() == ISD::GlobalAddress)
- G = cast<GlobalAddressSDNode>(Src);
- else if (Src.getOpcode() == ISD::ADD &&
- Src.getOperand(0).getOpcode() == ISD::GlobalAddress &&
- Src.getOperand(1).getOpcode() == ISD::Constant) {
- G = cast<GlobalAddressSDNode>(Src.getOperand(0));
- SrcDelta = cast<ConstantSDNode>(Src.getOperand(1))->getValue();
- }
- if (G) {
- GlobalVariable *GV = dyn_cast<GlobalVariable>(G->getGlobal());
- if (GV && GV->isConstant()) {
- Str = GV->getStringValue(false);
- if (!Str.empty()) {
- CopyFromStr = true;
- SrcOff += SrcDelta;
- }
- }
- }
-
- for (unsigned i = 0; i < NumMemOps; i++) {
- MVT::ValueType VT = MemOps[i];
- unsigned VTSize = MVT::getSizeInBits(VT) / 8;
- SDOperand Value, Store;
-
- if (CopyFromStr) {
- Value = getMemsetStringVal(VT, DAG, TLI, Str, SrcOff);
- Store =
- DAG.getStore(Chain, Value,
- getMemBasePlusOffset(Dst, DstOff, DAG),
- DstSV, DstSVOff + DstOff);
- } else {
- Value = DAG.getLoad(VT, Chain,
- getMemBasePlusOffset(Src, SrcOff, DAG),
- SrcSV, SrcSVOff + SrcOff, false, Align);
- Store =
- DAG.getStore(Chain, Value,
- getMemBasePlusOffset(Dst, DstOff, DAG),
- DstSV, DstSVOff + DstOff, false, Align);
- }
- OutChains.push_back(Store);
- SrcOff += VTSize;
- DstOff += VTSize;
- }
-
- return DAG.getNode(ISD::TokenFactor, MVT::Other,
- &OutChains[0], OutChains.size());
-}
-
-static SDOperand getMemsetStores(SelectionDAG &DAG,
- SDOperand Chain, SDOperand Dst,
- SDOperand Src, uint64_t Size,
- unsigned Align,
- const Value *DstSV, uint64_t DstSVOff) {
- const TargetLowering &TLI = DAG.getTargetLoweringInfo();
-
- // Expand memset to a series of load/store ops if the size operand
- // falls below a certain threshold.
- std::vector<MVT::ValueType> MemOps;
- if (!MeetsMaxMemopRequirement(MemOps, TLI.getMaxStoresPerMemset(),
- Size, Align, TLI))
- return SDOperand();
-
- SmallVector<SDOperand, 8> OutChains;
- uint64_t DstOff = 0;
-
- unsigned NumMemOps = MemOps.size();
- for (unsigned i = 0; i < NumMemOps; i++) {
- MVT::ValueType VT = MemOps[i];
- unsigned VTSize = MVT::getSizeInBits(VT) / 8;
- SDOperand Value = getMemsetValue(Src, VT, DAG);
- SDOperand Store = DAG.getStore(Chain, Value,
- getMemBasePlusOffset(Dst, DstOff, DAG),
- DstSV, DstSVOff + DstOff);
- OutChains.push_back(Store);
- DstOff += VTSize;
- }
-
- return DAG.getNode(ISD::TokenFactor, MVT::Other,
- &OutChains[0], OutChains.size());
-}
-
-SDOperand SelectionDAG::getMemcpy(SDOperand Chain, SDOperand Dst,
- SDOperand Src, SDOperand Size,
- unsigned Align, bool AlwaysInline,
- const Value *DstSV, uint64_t DstSVOff,
- const Value *SrcSV, uint64_t SrcSVOff) {
-
- // Check to see if we should lower the memcpy to loads and stores first.
- // For cases within the target-specified limits, this is the best choice.
- ConstantSDNode *ConstantSize = dyn_cast<ConstantSDNode>(Size);
- if (ConstantSize) {
- // Memcpy with size zero? Just return the original chain.
- if (ConstantSize->isNullValue())
- return Chain;
-
- SDOperand Result =
- getMemcpyLoadsAndStores(*this, Chain, Dst, Src, ConstantSize->getValue(),
- Align, false, DstSV, DstSVOff, SrcSV, SrcSVOff);
- if (Result.Val)
- return Result;
- }
-
- // Then check to see if we should lower the memcpy with target-specific
- // code. If the target chooses to do this, this is the next best.
- SDOperand Result =
- TLI.EmitTargetCodeForMemcpy(*this, Chain, Dst, Src, Size, Align,
- AlwaysInline,
- DstSV, DstSVOff, SrcSV, SrcSVOff);
- if (Result.Val)
- return Result;
-
- // If we really need inline code and the target declined to provide it,
- // use a (potentially long) sequence of loads and stores.
- if (AlwaysInline) {
- assert(ConstantSize && "AlwaysInline requires a constant size!");
- return getMemcpyLoadsAndStores(*this, Chain, Dst, Src,
- ConstantSize->getValue(), Align, true,
- DstSV, DstSVOff, SrcSV, SrcSVOff);
- }
-
- // Emit a library call.
- TargetLowering::ArgListTy Args;
- TargetLowering::ArgListEntry Entry;
- Entry.Ty = TLI.getTargetData()->getIntPtrType();
- Entry.Node = Dst; Args.push_back(Entry);
- Entry.Node = Src; Args.push_back(Entry);
- Entry.Node = Size; Args.push_back(Entry);
- std::pair<SDOperand,SDOperand> CallResult =
- TLI.LowerCallTo(Chain, Type::VoidTy,
- false, false, false, CallingConv::C, false,
- getExternalSymbol("memcpy", TLI.getPointerTy()),
- Args, *this);
- return CallResult.second;
-}
-
-SDOperand SelectionDAG::getMemmove(SDOperand Chain, SDOperand Dst,
- SDOperand Src, SDOperand Size,
- unsigned Align,
- const Value *DstSV, uint64_t DstSVOff,
- const Value *SrcSV, uint64_t SrcSVOff) {
-
- // TODO: Optimize small memmove cases with simple loads and stores,
- // ensuring that all loads precede all stores. This can cause severe
- // register pressure, so targets should be careful with the size limit.
-
- // Then check to see if we should lower the memmove with target-specific
- // code. If the target chooses to do this, this is the next best.
- SDOperand Result =
- TLI.EmitTargetCodeForMemmove(*this, Chain, Dst, Src, Size, Align,
- DstSV, DstSVOff, SrcSV, SrcSVOff);
- if (Result.Val)
- return Result;
-
- // Emit a library call.
- TargetLowering::ArgListTy Args;
- TargetLowering::ArgListEntry Entry;
- Entry.Ty = TLI.getTargetData()->getIntPtrType();
- Entry.Node = Dst; Args.push_back(Entry);
- Entry.Node = Src; Args.push_back(Entry);
- Entry.Node = Size; Args.push_back(Entry);
- std::pair<SDOperand,SDOperand> CallResult =
- TLI.LowerCallTo(Chain, Type::VoidTy,
- false, false, false, CallingConv::C, false,
- getExternalSymbol("memmove", TLI.getPointerTy()),
- Args, *this);
- return CallResult.second;
-}
-
-SDOperand SelectionDAG::getMemset(SDOperand Chain, SDOperand Dst,
- SDOperand Src, SDOperand Size,
- unsigned Align,
- const Value *DstSV, uint64_t DstSVOff) {
-
- // Check to see if we should lower the memset to stores first.
- // For cases within the target-specified limits, this is the best choice.
- ConstantSDNode *ConstantSize = dyn_cast<ConstantSDNode>(Size);
- if (ConstantSize) {
- // Memset with size zero? Just return the original chain.
- if (ConstantSize->isNullValue())
- return Chain;
-
- SDOperand Result =
- getMemsetStores(*this, Chain, Dst, Src, ConstantSize->getValue(), Align,
- DstSV, DstSVOff);
- if (Result.Val)
- return Result;
- }
-
- // Then check to see if we should lower the memset with target-specific
- // code. If the target chooses to do this, this is the next best.
- SDOperand Result =
- TLI.EmitTargetCodeForMemset(*this, Chain, Dst, Src, Size, Align,
- DstSV, DstSVOff);
- if (Result.Val)
- return Result;
-
- // Emit a library call.
- const Type *IntPtrTy = TLI.getTargetData()->getIntPtrType();
- TargetLowering::ArgListTy Args;
- TargetLowering::ArgListEntry Entry;
- Entry.Node = Dst; Entry.Ty = IntPtrTy;
- Args.push_back(Entry);
- // Extend or truncate the argument to be an i32 value for the call.
- if (Src.getValueType() > MVT::i32)
- Src = getNode(ISD::TRUNCATE, MVT::i32, Src);
- else
- Src = getNode(ISD::ZERO_EXTEND, MVT::i32, Src);
- Entry.Node = Src; Entry.Ty = Type::Int32Ty; Entry.isSExt = true;
- Args.push_back(Entry);
- Entry.Node = Size; Entry.Ty = IntPtrTy; Entry.isSExt = false;
- Args.push_back(Entry);
- std::pair<SDOperand,SDOperand> CallResult =
- TLI.LowerCallTo(Chain, Type::VoidTy,
- false, false, false, CallingConv::C, false,
- getExternalSymbol("memset", TLI.getPointerTy()),
- Args, *this);
- return CallResult.second;
-}
-
-SDOperand SelectionDAG::getAtomic(unsigned Opcode, SDOperand Chain,
- SDOperand Ptr, SDOperand Cmp,
- SDOperand Swp, MVT::ValueType VT) {
- assert(Opcode == ISD::ATOMIC_LCS && "Invalid Atomic Op");
- assert(Cmp.getValueType() == Swp.getValueType() && "Invalid Atomic Op Types");
- SDVTList VTs = getVTList(Cmp.getValueType(), MVT::Other);
- FoldingSetNodeID ID;
- SDOperand Ops[] = {Chain, Ptr, Cmp, Swp};
- AddNodeIDNode(ID, Opcode, VTs, Ops, 4);
- ID.AddInteger((unsigned int)VT);
- void* IP = 0;
- if (SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP))
- return SDOperand(E, 0);
- SDNode* N = new AtomicSDNode(Opcode, VTs, Chain, Ptr, Cmp, Swp, VT);
- CSEMap.InsertNode(N, IP);
- AllNodes.push_back(N);
- return SDOperand(N, 0);
-}
-
-SDOperand SelectionDAG::getAtomic(unsigned Opcode, SDOperand Chain,
- SDOperand Ptr, SDOperand Val,
- MVT::ValueType VT) {
- assert(( Opcode == ISD::ATOMIC_LAS || Opcode == ISD::ATOMIC_LSS
- || Opcode == ISD::ATOMIC_SWAP || Opcode == ISD::ATOMIC_LOAD_AND
- || Opcode == ISD::ATOMIC_LOAD_OR || Opcode == ISD::ATOMIC_LOAD_XOR
- || Opcode == ISD::ATOMIC_LOAD_MIN || Opcode == ISD::ATOMIC_LOAD_MAX
- || Opcode == ISD::ATOMIC_LOAD_UMIN || Opcode == ISD::ATOMIC_LOAD_UMAX)
- && "Invalid Atomic Op");
- SDVTList VTs = getVTList(Val.getValueType(), MVT::Other);
- FoldingSetNodeID ID;
- SDOperand Ops[] = {Chain, Ptr, Val};
- AddNodeIDNode(ID, Opcode, VTs, Ops, 3);
- ID.AddInteger((unsigned int)VT);
- void* IP = 0;
- if (SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP))
- return SDOperand(E, 0);
- SDNode* N = new AtomicSDNode(Opcode, VTs, Chain, Ptr, Val, VT);
- CSEMap.InsertNode(N, IP);
- AllNodes.push_back(N);
- return SDOperand(N, 0);
-}
-
-SDOperand
-SelectionDAG::getLoad(ISD::MemIndexedMode AM, ISD::LoadExtType ExtType,
- MVT::ValueType VT, SDOperand Chain,
- SDOperand Ptr, SDOperand Offset,
- const Value *SV, int SVOffset, MVT::ValueType EVT,
- bool isVolatile, unsigned Alignment) {
- if (Alignment == 0) { // Ensure that codegen never sees alignment 0
- const Type *Ty = 0;
- if (VT != MVT::iPTR) {
- Ty = MVT::getTypeForValueType(VT);
- } else if (SV) {
- const PointerType *PT = dyn_cast<PointerType>(SV->getType());
- assert(PT && "Value for load must be a pointer");
- Ty = PT->getElementType();
- }
- assert(Ty && "Could not get type information for load");
- Alignment = TLI.getTargetData()->getABITypeAlignment(Ty);
- }
-
- if (VT == EVT) {
- ExtType = ISD::NON_EXTLOAD;
- } else if (ExtType == ISD::NON_EXTLOAD) {
- assert(VT == EVT && "Non-extending load from different memory type!");
- } else {
- // Extending load.
- if (MVT::isVector(VT))
- assert(EVT == MVT::getVectorElementType(VT) && "Invalid vector extload!");
- else
- assert(MVT::getSizeInBits(EVT) < MVT::getSizeInBits(VT) &&
- "Should only be an extending load, not truncating!");
- assert((ExtType == ISD::EXTLOAD || MVT::isInteger(VT)) &&
- "Cannot sign/zero extend a FP/Vector load!");
- assert(MVT::isInteger(VT) == MVT::isInteger(EVT) &&
- "Cannot convert from FP to Int or Int -> FP!");
- }
-
- bool Indexed = AM != ISD::UNINDEXED;
- assert(Indexed || Offset.getOpcode() == ISD::UNDEF &&
- "Unindexed load with an offset!");
-
- SDVTList VTs = Indexed ?
- getVTList(VT, Ptr.getValueType(), MVT::Other) : getVTList(VT, MVT::Other);
- SDOperand Ops[] = { Chain, Ptr, Offset };
- FoldingSetNodeID ID;
- AddNodeIDNode(ID, ISD::LOAD, VTs, Ops, 3);
- ID.AddInteger(AM);
- ID.AddInteger(ExtType);
- ID.AddInteger((unsigned int)EVT);
- ID.AddInteger(Alignment);
- ID.AddInteger(isVolatile);
- void *IP = 0;
- if (SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP))
- return SDOperand(E, 0);
- SDNode *N = new LoadSDNode(Ops, VTs, AM, ExtType, EVT, SV, SVOffset,
- Alignment, isVolatile);
- CSEMap.InsertNode(N, IP);
- AllNodes.push_back(N);
- return SDOperand(N, 0);
-}
-
-SDOperand SelectionDAG::getLoad(MVT::ValueType VT,
- SDOperand Chain, SDOperand Ptr,
- const Value *SV, int SVOffset,
- bool isVolatile, unsigned Alignment) {
- SDOperand Undef = getNode(ISD::UNDEF, Ptr.getValueType());
- return getLoad(ISD::UNINDEXED, ISD::NON_EXTLOAD, VT, Chain, Ptr, Undef,
- SV, SVOffset, VT, isVolatile, Alignment);
-}
-
-SDOperand SelectionDAG::getExtLoad(ISD::LoadExtType ExtType, MVT::ValueType VT,
- SDOperand Chain, SDOperand Ptr,
- const Value *SV,
- int SVOffset, MVT::ValueType EVT,
- bool isVolatile, unsigned Alignment) {
- SDOperand Undef = getNode(ISD::UNDEF, Ptr.getValueType());
- return getLoad(ISD::UNINDEXED, ExtType, VT, Chain, Ptr, Undef,
- SV, SVOffset, EVT, isVolatile, Alignment);
-}
-
-SDOperand
-SelectionDAG::getIndexedLoad(SDOperand OrigLoad, SDOperand Base,
- SDOperand Offset, ISD::MemIndexedMode AM) {
- LoadSDNode *LD = cast<LoadSDNode>(OrigLoad);
- assert(LD->getOffset().getOpcode() == ISD::UNDEF &&
- "Load is already a indexed load!");
- return getLoad(AM, LD->getExtensionType(), OrigLoad.getValueType(),
- LD->getChain(), Base, Offset, LD->getSrcValue(),
- LD->getSrcValueOffset(), LD->getMemoryVT(),
- LD->isVolatile(), LD->getAlignment());
-}
-
-SDOperand SelectionDAG::getStore(SDOperand Chain, SDOperand Val,
- SDOperand Ptr, const Value *SV, int SVOffset,
- bool isVolatile, unsigned Alignment) {
- MVT::ValueType VT = Val.getValueType();
-
- if (Alignment == 0) { // Ensure that codegen never sees alignment 0
- const Type *Ty = 0;
- if (VT != MVT::iPTR) {
- Ty = MVT::getTypeForValueType(VT);
- } else if (SV) {
- const PointerType *PT = dyn_cast<PointerType>(SV->getType());
- assert(PT && "Value for store must be a pointer");
- Ty = PT->getElementType();
- }
- assert(Ty && "Could not get type information for store");
- Alignment = TLI.getTargetData()->getABITypeAlignment(Ty);
- }
- SDVTList VTs = getVTList(MVT::Other);
- SDOperand Undef = getNode(ISD::UNDEF, Ptr.getValueType());
- SDOperand Ops[] = { Chain, Val, Ptr, Undef };
- FoldingSetNodeID ID;
- AddNodeIDNode(ID, ISD::STORE, VTs, Ops, 4);
- ID.AddInteger(ISD::UNINDEXED);
- ID.AddInteger(false);
- ID.AddInteger((unsigned int)VT);
- ID.AddInteger(Alignment);
- ID.AddInteger(isVolatile);
- void *IP = 0;
- if (SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP))
- return SDOperand(E, 0);
- SDNode *N = new StoreSDNode(Ops, VTs, ISD::UNINDEXED, false,
- VT, SV, SVOffset, Alignment, isVolatile);
- CSEMap.InsertNode(N, IP);
- AllNodes.push_back(N);
- return SDOperand(N, 0);
-}
-
-SDOperand SelectionDAG::getTruncStore(SDOperand Chain, SDOperand Val,
- SDOperand Ptr, const Value *SV,
- int SVOffset, MVT::ValueType SVT,
- bool isVolatile, unsigned Alignment) {
- MVT::ValueType VT = Val.getValueType();
-
- if (VT == SVT)
- return getStore(Chain, Val, Ptr, SV, SVOffset, isVolatile, Alignment);
-
- assert(MVT::getSizeInBits(VT) > MVT::getSizeInBits(SVT) &&
- "Not a truncation?");
- assert(MVT::isInteger(VT) == MVT::isInteger(SVT) &&
- "Can't do FP-INT conversion!");
-
- if (Alignment == 0) { // Ensure that codegen never sees alignment 0
- const Type *Ty = 0;
- if (VT != MVT::iPTR) {
- Ty = MVT::getTypeForValueType(VT);
- } else if (SV) {
- const PointerType *PT = dyn_cast<PointerType>(SV->getType());
- assert(PT && "Value for store must be a pointer");
- Ty = PT->getElementType();
- }
- assert(Ty && "Could not get type information for store");
- Alignment = TLI.getTargetData()->getABITypeAlignment(Ty);
- }
- SDVTList VTs = getVTList(MVT::Other);
- SDOperand Undef = getNode(ISD::UNDEF, Ptr.getValueType());
- SDOperand Ops[] = { Chain, Val, Ptr, Undef };
- FoldingSetNodeID ID;
- AddNodeIDNode(ID, ISD::STORE, VTs, Ops, 4);
- ID.AddInteger(ISD::UNINDEXED);
- ID.AddInteger(1);
- ID.AddInteger((unsigned int)SVT);
- ID.AddInteger(Alignment);
- ID.AddInteger(isVolatile);
- void *IP = 0;
- if (SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP))
- return SDOperand(E, 0);
- SDNode *N = new StoreSDNode(Ops, VTs, ISD::UNINDEXED, true,
- SVT, SV, SVOffset, Alignment, isVolatile);
- CSEMap.InsertNode(N, IP);
- AllNodes.push_back(N);
- return SDOperand(N, 0);
-}
-
-SDOperand
-SelectionDAG::getIndexedStore(SDOperand OrigStore, SDOperand Base,
- SDOperand Offset, ISD::MemIndexedMode AM) {
- StoreSDNode *ST = cast<StoreSDNode>(OrigStore);
- assert(ST->getOffset().getOpcode() == ISD::UNDEF &&
- "Store is already a indexed store!");
- SDVTList VTs = getVTList(Base.getValueType(), MVT::Other);
- SDOperand Ops[] = { ST->getChain(), ST->getValue(), Base, Offset };
- FoldingSetNodeID ID;
- AddNodeIDNode(ID, ISD::STORE, VTs, Ops, 4);
- ID.AddInteger(AM);
- ID.AddInteger(ST->isTruncatingStore());
- ID.AddInteger((unsigned int)(ST->getMemoryVT()));
- ID.AddInteger(ST->getAlignment());
- ID.AddInteger(ST->isVolatile());
- void *IP = 0;
- if (SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP))
- return SDOperand(E, 0);
- SDNode *N = new StoreSDNode(Ops, VTs, AM,
- ST->isTruncatingStore(), ST->getMemoryVT(),
- ST->getSrcValue(), ST->getSrcValueOffset(),
- ST->getAlignment(), ST->isVolatile());
- CSEMap.InsertNode(N, IP);
- AllNodes.push_back(N);
- return SDOperand(N, 0);
-}
-
-SDOperand SelectionDAG::getVAArg(MVT::ValueType VT,
- SDOperand Chain, SDOperand Ptr,
- SDOperand SV) {
- SDOperand Ops[] = { Chain, Ptr, SV };
- return getNode(ISD::VAARG, getVTList(VT, MVT::Other), Ops, 3);
-}
-
-SDOperand SelectionDAG::getNode(unsigned Opcode, MVT::ValueType VT,
- SDOperandPtr Ops, unsigned NumOps) {
- switch (NumOps) {
- case 0: return getNode(Opcode, VT);
- case 1: return getNode(Opcode, VT, Ops[0]);
- case 2: return getNode(Opcode, VT, Ops[0], Ops[1]);
- case 3: return getNode(Opcode, VT, Ops[0], Ops[1], Ops[2]);
- default: break;
- }
-
- switch (Opcode) {
- default: break;
- case ISD::SELECT_CC: {
- assert(NumOps == 5 && "SELECT_CC takes 5 operands!");
- assert(Ops[0].getValueType() == Ops[1].getValueType() &&
- "LHS and RHS of condition must have same type!");
- assert(Ops[2].getValueType() == Ops[3].getValueType() &&
- "True and False arms of SelectCC must have same type!");
- assert(Ops[2].getValueType() == VT &&
- "select_cc node must be of same type as true and false value!");
- break;
- }
- case ISD::BR_CC: {
- assert(NumOps == 5 && "BR_CC takes 5 operands!");
- assert(Ops[2].getValueType() == Ops[3].getValueType() &&
- "LHS/RHS of comparison should match types!");
- break;
- }
- }
-
- // Memoize nodes.
- SDNode *N;
- SDVTList VTs = getVTList(VT);
- if (VT != MVT::Flag) {
- FoldingSetNodeID ID;
- AddNodeIDNode(ID, Opcode, VTs, Ops, NumOps);
- void *IP = 0;
- if (SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP))
- return SDOperand(E, 0);
- N = new SDNode(Opcode, VTs, Ops, NumOps);
- CSEMap.InsertNode(N, IP);
- } else {
- N = new SDNode(Opcode, VTs, Ops, NumOps);
- }
- AllNodes.push_back(N);
- return SDOperand(N, 0);
-}
-
-SDOperand SelectionDAG::getNode(unsigned Opcode,
- std::vector<MVT::ValueType> &ResultTys,
- SDOperandPtr Ops, unsigned NumOps) {
- return getNode(Opcode, getNodeValueTypes(ResultTys), ResultTys.size(),
- Ops, NumOps);
-}
-
-SDOperand SelectionDAG::getNode(unsigned Opcode,
- const MVT::ValueType *VTs, unsigned NumVTs,
- SDOperandPtr Ops, unsigned NumOps) {
- if (NumVTs == 1)
- return getNode(Opcode, VTs[0], Ops, NumOps);
- return getNode(Opcode, makeVTList(VTs, NumVTs), Ops, NumOps);
-}
-
-SDOperand SelectionDAG::getNode(unsigned Opcode, SDVTList VTList,
- SDOperandPtr Ops, unsigned NumOps) {
- if (VTList.NumVTs == 1)
- return getNode(Opcode, VTList.VTs[0], Ops, NumOps);
-
- switch (Opcode) {
- // FIXME: figure out how to safely handle things like
- // int foo(int x) { return 1 << (x & 255); }
- // int bar() { return foo(256); }
-#if 0
- case ISD::SRA_PARTS:
- case ISD::SRL_PARTS:
- case ISD::SHL_PARTS:
- if (N3.getOpcode() == ISD::SIGN_EXTEND_INREG &&
- cast<VTSDNode>(N3.getOperand(1))->getVT() != MVT::i1)
- return getNode(Opcode, VT, N1, N2, N3.getOperand(0));
- else if (N3.getOpcode() == ISD::AND)
- if (ConstantSDNode *AndRHS = dyn_cast<ConstantSDNode>(N3.getOperand(1))) {
- // If the and is only masking out bits that cannot effect the shift,
- // eliminate the and.
- unsigned NumBits = MVT::getSizeInBits(VT)*2;
- if ((AndRHS->getValue() & (NumBits-1)) == NumBits-1)
- return getNode(Opcode, VT, N1, N2, N3.getOperand(0));
- }
- break;
-#endif
- }
-
- // Memoize the node unless it returns a flag.
- SDNode *N;
- if (VTList.VTs[VTList.NumVTs-1] != MVT::Flag) {
- FoldingSetNodeID ID;
- AddNodeIDNode(ID, Opcode, VTList, Ops, NumOps);
- void *IP = 0;
- if (SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP))
- return SDOperand(E, 0);
- if (NumOps == 1)
- N = new UnarySDNode(Opcode, VTList, Ops[0]);
- else if (NumOps == 2)
- N = new BinarySDNode(Opcode, VTList, Ops[0], Ops[1]);
- else if (NumOps == 3)
- N = new TernarySDNode(Opcode, VTList, Ops[0], Ops[1], Ops[2]);
- else
- N = new SDNode(Opcode, VTList, Ops, NumOps);
- CSEMap.InsertNode(N, IP);
- } else {
- if (NumOps == 1)
- N = new UnarySDNode(Opcode, VTList, Ops[0]);
- else if (NumOps == 2)
- N = new BinarySDNode(Opcode, VTList, Ops[0], Ops[1]);
- else if (NumOps == 3)
- N = new TernarySDNode(Opcode, VTList, Ops[0], Ops[1], Ops[2]);
- else
- N = new SDNode(Opcode, VTList, Ops, NumOps);
- }
- AllNodes.push_back(N);
- return SDOperand(N, 0);
-}
-
-SDOperand SelectionDAG::getNode(unsigned Opcode, SDVTList VTList) {
- return getNode(Opcode, VTList, (SDOperand*)0, 0);
-}
-
-SDOperand SelectionDAG::getNode(unsigned Opcode, SDVTList VTList,
- SDOperand N1) {
- SDOperand Ops[] = { N1 };
- return getNode(Opcode, VTList, Ops, 1);
-}
-
-SDOperand SelectionDAG::getNode(unsigned Opcode, SDVTList VTList,
- SDOperand N1, SDOperand N2) {
- SDOperand Ops[] = { N1, N2 };
- return getNode(Opcode, VTList, Ops, 2);
-}
-
-SDOperand SelectionDAG::getNode(unsigned Opcode, SDVTList VTList,
- SDOperand N1, SDOperand N2, SDOperand N3) {
- SDOperand Ops[] = { N1, N2, N3 };
- return getNode(Opcode, VTList, Ops, 3);
-}
-
-SDOperand SelectionDAG::getNode(unsigned Opcode, SDVTList VTList,
- SDOperand N1, SDOperand N2, SDOperand N3,
- SDOperand N4) {
- SDOperand Ops[] = { N1, N2, N3, N4 };
- return getNode(Opcode, VTList, Ops, 4);
-}
-
-SDOperand SelectionDAG::getNode(unsigned Opcode, SDVTList VTList,
- SDOperand N1, SDOperand N2, SDOperand N3,
- SDOperand N4, SDOperand N5) {
- SDOperand Ops[] = { N1, N2, N3, N4, N5 };
- return getNode(Opcode, VTList, Ops, 5);
-}
-
-SDVTList SelectionDAG::getVTList(MVT::ValueType VT) {
- return makeVTList(SDNode::getValueTypeList(VT), 1);
-}
-
-SDVTList SelectionDAG::getVTList(MVT::ValueType VT1, MVT::ValueType VT2) {
- for (std::list<std::vector<MVT::ValueType> >::iterator I = VTList.begin(),
- E = VTList.end(); I != E; ++I) {
- if (I->size() == 2 && (*I)[0] == VT1 && (*I)[1] == VT2)
- return makeVTList(&(*I)[0], 2);
- }
- std::vector<MVT::ValueType> V;
- V.push_back(VT1);
- V.push_back(VT2);
- VTList.push_front(V);
- return makeVTList(&(*VTList.begin())[0], 2);
-}
-SDVTList SelectionDAG::getVTList(MVT::ValueType VT1, MVT::ValueType VT2,
- MVT::ValueType VT3) {
- for (std::list<std::vector<MVT::ValueType> >::iterator I = VTList.begin(),
- E = VTList.end(); I != E; ++I) {
- if (I->size() == 3 && (*I)[0] == VT1 && (*I)[1] == VT2 &&
- (*I)[2] == VT3)
- return makeVTList(&(*I)[0], 3);
- }
- std::vector<MVT::ValueType> V;
- V.push_back(VT1);
- V.push_back(VT2);
- V.push_back(VT3);
- VTList.push_front(V);
- return makeVTList(&(*VTList.begin())[0], 3);
-}
-
-SDVTList SelectionDAG::getVTList(const MVT::ValueType *VTs, unsigned NumVTs) {
- switch (NumVTs) {
- case 0: assert(0 && "Cannot have nodes without results!");
- case 1: return getVTList(VTs[0]);
- case 2: return getVTList(VTs[0], VTs[1]);
- case 3: return getVTList(VTs[0], VTs[1], VTs[2]);
- default: break;
- }
-
- for (std::list<std::vector<MVT::ValueType> >::iterator I = VTList.begin(),
- E = VTList.end(); I != E; ++I) {
- if (I->size() != NumVTs || VTs[0] != (*I)[0] || VTs[1] != (*I)[1]) continue;
-
- bool NoMatch = false;
- for (unsigned i = 2; i != NumVTs; ++i)
- if (VTs[i] != (*I)[i]) {
- NoMatch = true;
- break;
- }
- if (!NoMatch)
- return makeVTList(&*I->begin(), NumVTs);
- }
-
- VTList.push_front(std::vector<MVT::ValueType>(VTs, VTs+NumVTs));
- return makeVTList(&*VTList.begin()->begin(), NumVTs);
-}
-
-
-/// UpdateNodeOperands - *Mutate* the specified node in-place to have the
-/// specified operands. If the resultant node already exists in the DAG,
-/// this does not modify the specified node, instead it returns the node that
-/// already exists. If the resultant node does not exist in the DAG, the
-/// input node is returned. As a degenerate case, if you specify the same
-/// input operands as the node already has, the input node is returned.
-SDOperand SelectionDAG::
-UpdateNodeOperands(SDOperand InN, SDOperand Op) {
- SDNode *N = InN.Val;
- assert(N->getNumOperands() == 1 && "Update with wrong number of operands");
-
- // Check to see if there is no change.
- if (Op == N->getOperand(0)) return InN;
-
- // See if the modified node already exists.
- void *InsertPos = 0;
- if (SDNode *Existing = FindModifiedNodeSlot(N, Op, InsertPos))
- return SDOperand(Existing, InN.ResNo);
-
- // Nope it doesn't. Remove the node from it's current place in the maps.
- if (InsertPos)
- RemoveNodeFromCSEMaps(N);
-
- // Now we update the operands.
- N->OperandList[0].getVal()->removeUser(0, N);
- N->OperandList[0] = Op;
- N->OperandList[0].setUser(N);
- Op.Val->addUser(0, N);
-
- // If this gets put into a CSE map, add it.
- if (InsertPos) CSEMap.InsertNode(N, InsertPos);
- return InN;
-}
-
-SDOperand SelectionDAG::
-UpdateNodeOperands(SDOperand InN, SDOperand Op1, SDOperand Op2) {
- SDNode *N = InN.Val;
- assert(N->getNumOperands() == 2 && "Update with wrong number of operands");
-
- // Check to see if there is no change.
- if (Op1 == N->getOperand(0) && Op2 == N->getOperand(1))
- return InN; // No operands changed, just return the input node.
-
- // See if the modified node already exists.
- void *InsertPos = 0;
- if (SDNode *Existing = FindModifiedNodeSlot(N, Op1, Op2, InsertPos))
- return SDOperand(Existing, InN.ResNo);
-
- // Nope it doesn't. Remove the node from it's current place in the maps.
- if (InsertPos)
- RemoveNodeFromCSEMaps(N);
-
- // Now we update the operands.
- if (N->OperandList[0] != Op1) {
- N->OperandList[0].getVal()->removeUser(0, N);
- N->OperandList[0] = Op1;
- N->OperandList[0].setUser(N);
- Op1.Val->addUser(0, N);
- }
- if (N->OperandList[1] != Op2) {
- N->OperandList[1].getVal()->removeUser(1, N);
- N->OperandList[1] = Op2;
- N->OperandList[1].setUser(N);
- Op2.Val->addUser(1, N);
- }
-
- // If this gets put into a CSE map, add it.
- if (InsertPos) CSEMap.InsertNode(N, InsertPos);
- return InN;
-}
-
-SDOperand SelectionDAG::
-UpdateNodeOperands(SDOperand N, SDOperand Op1, SDOperand Op2, SDOperand Op3) {
- SDOperand Ops[] = { Op1, Op2, Op3 };
- return UpdateNodeOperands(N, Ops, 3);
-}
-
-SDOperand SelectionDAG::
-UpdateNodeOperands(SDOperand N, SDOperand Op1, SDOperand Op2,
- SDOperand Op3, SDOperand Op4) {
- SDOperand Ops[] = { Op1, Op2, Op3, Op4 };
- return UpdateNodeOperands(N, Ops, 4);
-}
-
-SDOperand SelectionDAG::
-UpdateNodeOperands(SDOperand N, SDOperand Op1, SDOperand Op2,
- SDOperand Op3, SDOperand Op4, SDOperand Op5) {
- SDOperand Ops[] = { Op1, Op2, Op3, Op4, Op5 };
- return UpdateNodeOperands(N, Ops, 5);
-}
-
-SDOperand SelectionDAG::
-UpdateNodeOperands(SDOperand InN, SDOperandPtr Ops, unsigned NumOps) {
- SDNode *N = InN.Val;
- assert(N->getNumOperands() == NumOps &&
- "Update with wrong number of operands");
-
- // Check to see if there is no change.
- bool AnyChange = false;
- for (unsigned i = 0; i != NumOps; ++i) {
- if (Ops[i] != N->getOperand(i)) {
- AnyChange = true;
- break;
- }
- }
-
- // No operands changed, just return the input node.
- if (!AnyChange) return InN;
-
- // See if the modified node already exists.
- void *InsertPos = 0;
- if (SDNode *Existing = FindModifiedNodeSlot(N, Ops, NumOps, InsertPos))
- return SDOperand(Existing, InN.ResNo);
-
- // Nope it doesn't. Remove the node from its current place in the maps.
- if (InsertPos)
- RemoveNodeFromCSEMaps(N);
-
- // Now we update the operands.
- for (unsigned i = 0; i != NumOps; ++i) {
- if (N->OperandList[i] != Ops[i]) {
- N->OperandList[i].getVal()->removeUser(i, N);
- N->OperandList[i] = Ops[i];
- N->OperandList[i].setUser(N);
- Ops[i].Val->addUser(i, N);
- }
- }
-
- // If this gets put into a CSE map, add it.
- if (InsertPos) CSEMap.InsertNode(N, InsertPos);
- return InN;
-}
-
-/// MorphNodeTo - This frees the operands of the current node, resets the
-/// opcode, types, and operands to the specified value. This should only be
-/// used by the SelectionDAG class.
-void SDNode::MorphNodeTo(unsigned Opc, SDVTList L,
- SDOperandPtr Ops, unsigned NumOps) {
- NodeType = Opc;
- ValueList = L.VTs;
- NumValues = L.NumVTs;
-
- // Clear the operands list, updating used nodes to remove this from their
- // use list.
- for (op_iterator I = op_begin(), E = op_end(); I != E; ++I)
- I->getVal()->removeUser(std::distance(op_begin(), I), this);
-
- // If NumOps is larger than the # of operands we currently have, reallocate
- // the operand list.
- if (NumOps > NumOperands) {
- if (OperandsNeedDelete) {
- delete [] OperandList;
- }
- OperandList = new SDUse[NumOps];
- OperandsNeedDelete = true;
- }
-
- // Assign the new operands.
- NumOperands = NumOps;
-
- for (unsigned i = 0, e = NumOps; i != e; ++i) {
- OperandList[i] = Ops[i];
- OperandList[i].setUser(this);
- SDNode *N = OperandList[i].getVal();
- N->addUser(i, this);
- ++N->UsesSize;
- }
-}
-
-/// SelectNodeTo - These are used for target selectors to *mutate* the
-/// specified node to have the specified return type, Target opcode, and
-/// operands. Note that target opcodes are stored as
-/// ISD::BUILTIN_OP_END+TargetOpcode in the node opcode field.
-///
-/// Note that SelectNodeTo returns the resultant node. If there is already a
-/// node of the specified opcode and operands, it returns that node instead of
-/// the current one.
-SDNode *SelectionDAG::SelectNodeTo(SDNode *N, unsigned TargetOpc,
- MVT::ValueType VT) {
- SDVTList VTs = getVTList(VT);
- FoldingSetNodeID ID;
- AddNodeIDNode(ID, ISD::BUILTIN_OP_END+TargetOpc, VTs, (SDOperand*)0, 0);
- void *IP = 0;
- if (SDNode *ON = CSEMap.FindNodeOrInsertPos(ID, IP))
- return ON;
-
- RemoveNodeFromCSEMaps(N);
-
- N->MorphNodeTo(ISD::BUILTIN_OP_END+TargetOpc, VTs, SDOperandPtr(), 0);
-
- CSEMap.InsertNode(N, IP);
- return N;
-}
-
-SDNode *SelectionDAG::SelectNodeTo(SDNode *N, unsigned TargetOpc,
- MVT::ValueType VT, SDOperand Op1) {
- // If an identical node already exists, use it.
- SDVTList VTs = getVTList(VT);
- SDOperand Ops[] = { Op1 };
-
- FoldingSetNodeID ID;
- AddNodeIDNode(ID, ISD::BUILTIN_OP_END+TargetOpc, VTs, Ops, 1);
- void *IP = 0;
- if (SDNode *ON = CSEMap.FindNodeOrInsertPos(ID, IP))
- return ON;
-
- RemoveNodeFromCSEMaps(N);
- N->MorphNodeTo(ISD::BUILTIN_OP_END+TargetOpc, VTs, Ops, 1);
- CSEMap.InsertNode(N, IP);
- return N;
-}
-
-SDNode *SelectionDAG::SelectNodeTo(SDNode *N, unsigned TargetOpc,
- MVT::ValueType VT, SDOperand Op1,
- SDOperand Op2) {
- // If an identical node already exists, use it.
- SDVTList VTs = getVTList(VT);
- SDOperand Ops[] = { Op1, Op2 };
-
- FoldingSetNodeID ID;
- AddNodeIDNode(ID, ISD::BUILTIN_OP_END+TargetOpc, VTs, Ops, 2);
- void *IP = 0;
- if (SDNode *ON = CSEMap.FindNodeOrInsertPos(ID, IP))
- return ON;
-
- RemoveNodeFromCSEMaps(N);
-
- N->MorphNodeTo(ISD::BUILTIN_OP_END+TargetOpc, VTs, Ops, 2);
-
- CSEMap.InsertNode(N, IP); // Memoize the new node.
- return N;
-}
-
-SDNode *SelectionDAG::SelectNodeTo(SDNode *N, unsigned TargetOpc,
- MVT::ValueType VT, SDOperand Op1,
- SDOperand Op2, SDOperand Op3) {
- // If an identical node already exists, use it.
- SDVTList VTs = getVTList(VT);
- SDOperand Ops[] = { Op1, Op2, Op3 };
- FoldingSetNodeID ID;
- AddNodeIDNode(ID, ISD::BUILTIN_OP_END+TargetOpc, VTs, Ops, 3);
- void *IP = 0;
- if (SDNode *ON = CSEMap.FindNodeOrInsertPos(ID, IP))
- return ON;
-
- RemoveNodeFromCSEMaps(N);
-
- N->MorphNodeTo(ISD::BUILTIN_OP_END+TargetOpc, VTs, Ops, 3);
-
- CSEMap.InsertNode(N, IP); // Memoize the new node.
- return N;
-}
-
-SDNode *SelectionDAG::SelectNodeTo(SDNode *N, unsigned TargetOpc,
- MVT::ValueType VT, SDOperandPtr Ops,
- unsigned NumOps) {
- // If an identical node already exists, use it.
- SDVTList VTs = getVTList(VT);
- FoldingSetNodeID ID;
- AddNodeIDNode(ID, ISD::BUILTIN_OP_END+TargetOpc, VTs, Ops, NumOps);
- void *IP = 0;
- if (SDNode *ON = CSEMap.FindNodeOrInsertPos(ID, IP))
- return ON;
-
- RemoveNodeFromCSEMaps(N);
- N->MorphNodeTo(ISD::BUILTIN_OP_END+TargetOpc, VTs, Ops, NumOps);
-
- CSEMap.InsertNode(N, IP); // Memoize the new node.
- return N;
-}
-
-SDNode *SelectionDAG::SelectNodeTo(SDNode *N, unsigned TargetOpc,
- MVT::ValueType VT1, MVT::ValueType VT2,
- SDOperand Op1, SDOperand Op2) {
- SDVTList VTs = getVTList(VT1, VT2);
- FoldingSetNodeID ID;
- SDOperand Ops[] = { Op1, Op2 };
- AddNodeIDNode(ID, ISD::BUILTIN_OP_END+TargetOpc, VTs, Ops, 2);
- void *IP = 0;
- if (SDNode *ON = CSEMap.FindNodeOrInsertPos(ID, IP))
- return ON;
-
- RemoveNodeFromCSEMaps(N);
- N->MorphNodeTo(ISD::BUILTIN_OP_END+TargetOpc, VTs, Ops, 2);
- CSEMap.InsertNode(N, IP); // Memoize the new node.
- return N;
-}
-
-SDNode *SelectionDAG::SelectNodeTo(SDNode *N, unsigned TargetOpc,
- MVT::ValueType VT1, MVT::ValueType VT2,
- SDOperand Op1, SDOperand Op2,
- SDOperand Op3) {
- // If an identical node already exists, use it.
- SDVTList VTs = getVTList(VT1, VT2);
- SDOperand Ops[] = { Op1, Op2, Op3 };
- FoldingSetNodeID ID;
- AddNodeIDNode(ID, ISD::BUILTIN_OP_END+TargetOpc, VTs, Ops, 3);
- void *IP = 0;
- if (SDNode *ON = CSEMap.FindNodeOrInsertPos(ID, IP))
- return ON;
-
- RemoveNodeFromCSEMaps(N);
-
- N->MorphNodeTo(ISD::BUILTIN_OP_END+TargetOpc, VTs, Ops, 3);
- CSEMap.InsertNode(N, IP); // Memoize the new node.
- return N;
-}
-
-
-/// getTargetNode - These are used for target selectors to create a new node
-/// with specified return type(s), target opcode, and operands.
-///
-/// Note that getTargetNode returns the resultant node. If there is already a
-/// node of the specified opcode and operands, it returns that node instead of
-/// the current one.
-SDNode *SelectionDAG::getTargetNode(unsigned Opcode, MVT::ValueType VT) {
- return getNode(ISD::BUILTIN_OP_END+Opcode, VT).Val;
-}
-SDNode *SelectionDAG::getTargetNode(unsigned Opcode, MVT::ValueType VT,
- SDOperand Op1) {
- return getNode(ISD::BUILTIN_OP_END+Opcode, VT, Op1).Val;
-}
-SDNode *SelectionDAG::getTargetNode(unsigned Opcode, MVT::ValueType VT,
- SDOperand Op1, SDOperand Op2) {
- return getNode(ISD::BUILTIN_OP_END+Opcode, VT, Op1, Op2).Val;
-}
-SDNode *SelectionDAG::getTargetNode(unsigned Opcode, MVT::ValueType VT,
- SDOperand Op1, SDOperand Op2,
- SDOperand Op3) {
- return getNode(ISD::BUILTIN_OP_END+Opcode, VT, Op1, Op2, Op3).Val;
-}
-SDNode *SelectionDAG::getTargetNode(unsigned Opcode, MVT::ValueType VT,
- SDOperandPtr Ops, unsigned NumOps) {
- return getNode(ISD::BUILTIN_OP_END+Opcode, VT, Ops, NumOps).Val;
-}
-SDNode *SelectionDAG::getTargetNode(unsigned Opcode, MVT::ValueType VT1,
- MVT::ValueType VT2) {
- const MVT::ValueType *VTs = getNodeValueTypes(VT1, VT2);
- SDOperand Op;
- return getNode(ISD::BUILTIN_OP_END+Opcode, VTs, 2, &Op, 0).Val;
-}
-SDNode *SelectionDAG::getTargetNode(unsigned Opcode, MVT::ValueType VT1,
- MVT::ValueType VT2, SDOperand Op1) {
- const MVT::ValueType *VTs = getNodeValueTypes(VT1, VT2);
- return getNode(ISD::BUILTIN_OP_END+Opcode, VTs, 2, &Op1, 1).Val;
-}
-SDNode *SelectionDAG::getTargetNode(unsigned Opcode, MVT::ValueType VT1,
- MVT::ValueType VT2, SDOperand Op1,
- SDOperand Op2) {
- const MVT::ValueType *VTs = getNodeValueTypes(VT1, VT2);
- SDOperand Ops[] = { Op1, Op2 };
- return getNode(ISD::BUILTIN_OP_END+Opcode, VTs, 2, Ops, 2).Val;
-}
-SDNode *SelectionDAG::getTargetNode(unsigned Opcode, MVT::ValueType VT1,
- MVT::ValueType VT2, SDOperand Op1,
- SDOperand Op2, SDOperand Op3) {
- const MVT::ValueType *VTs = getNodeValueTypes(VT1, VT2);
- SDOperand Ops[] = { Op1, Op2, Op3 };
- return getNode(ISD::BUILTIN_OP_END+Opcode, VTs, 2, Ops, 3).Val;
-}
-SDNode *SelectionDAG::getTargetNode(unsigned Opcode, MVT::ValueType VT1,
- MVT::ValueType VT2,
- SDOperandPtr Ops, unsigned NumOps) {
- const MVT::ValueType *VTs = getNodeValueTypes(VT1, VT2);
- return getNode(ISD::BUILTIN_OP_END+Opcode, VTs, 2, Ops, NumOps).Val;
-}
-SDNode *SelectionDAG::getTargetNode(unsigned Opcode, MVT::ValueType VT1,
- MVT::ValueType VT2, MVT::ValueType VT3,
- SDOperand Op1, SDOperand Op2) {
- const MVT::ValueType *VTs = getNodeValueTypes(VT1, VT2, VT3);
- SDOperand Ops[] = { Op1, Op2 };
- return getNode(ISD::BUILTIN_OP_END+Opcode, VTs, 3, Ops, 2).Val;
-}
-SDNode *SelectionDAG::getTargetNode(unsigned Opcode, MVT::ValueType VT1,
- MVT::ValueType VT2, MVT::ValueType VT3,
- SDOperand Op1, SDOperand Op2,
- SDOperand Op3) {
- const MVT::ValueType *VTs = getNodeValueTypes(VT1, VT2, VT3);
- SDOperand Ops[] = { Op1, Op2, Op3 };
- return getNode(ISD::BUILTIN_OP_END+Opcode, VTs, 3, Ops, 3).Val;
-}
-SDNode *SelectionDAG::getTargetNode(unsigned Opcode, MVT::ValueType VT1,
- MVT::ValueType VT2, MVT::ValueType VT3,
- SDOperandPtr Ops, unsigned NumOps) {
- const MVT::ValueType *VTs = getNodeValueTypes(VT1, VT2, VT3);
- return getNode(ISD::BUILTIN_OP_END+Opcode, VTs, 3, Ops, NumOps).Val;
-}
-SDNode *SelectionDAG::getTargetNode(unsigned Opcode, MVT::ValueType VT1,
- MVT::ValueType VT2, MVT::ValueType VT3,
- MVT::ValueType VT4,
- SDOperandPtr Ops, unsigned NumOps) {
- std::vector<MVT::ValueType> VTList;
- VTList.push_back(VT1);
- VTList.push_back(VT2);
- VTList.push_back(VT3);
- VTList.push_back(VT4);
- const MVT::ValueType *VTs = getNodeValueTypes(VTList);
- return getNode(ISD::BUILTIN_OP_END+Opcode, VTs, 4, Ops, NumOps).Val;
-}
-SDNode *SelectionDAG::getTargetNode(unsigned Opcode,
- std::vector<MVT::ValueType> &ResultTys,
- SDOperandPtr Ops, unsigned NumOps) {
- const MVT::ValueType *VTs = getNodeValueTypes(ResultTys);
- return getNode(ISD::BUILTIN_OP_END+Opcode, VTs, ResultTys.size(),
- Ops, NumOps).Val;
-}
-
-/// getNodeIfExists - Get the specified node if it's already available, or
-/// else return NULL.
-SDNode *SelectionDAG::getNodeIfExists(unsigned Opcode, SDVTList VTList,
- SDOperandPtr Ops, unsigned NumOps) {
- if (VTList.VTs[VTList.NumVTs-1] != MVT::Flag) {
- FoldingSetNodeID ID;
- AddNodeIDNode(ID, Opcode, VTList, Ops, NumOps);
- void *IP = 0;
- if (SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP))
- return E;
- }
- return NULL;
-}
-
-
-/// ReplaceAllUsesWith - Modify anything using 'From' to use 'To' instead.
-/// This can cause recursive merging of nodes in the DAG.
-///
-/// This version assumes From has a single result value.
-///
-void SelectionDAG::ReplaceAllUsesWith(SDOperand FromN, SDOperand To,
- DAGUpdateListener *UpdateListener) {
- SDNode *From = FromN.Val;
- assert(From->getNumValues() == 1 && FromN.ResNo == 0 &&
- "Cannot replace with this method!");
- assert(From != To.Val && "Cannot replace uses of with self");
-
- while (!From->use_empty()) {
- SDNode::use_iterator UI = From->use_begin();
- SDNode *U = UI->getUser();
-
- // This node is about to morph, remove its old self from the CSE maps.
- RemoveNodeFromCSEMaps(U);
- int operandNum = 0;
- for (SDNode::op_iterator I = U->op_begin(), E = U->op_end();
- I != E; ++I, ++operandNum)
- if (I->getVal() == From) {
- From->removeUser(operandNum, U);
- *I = To;
- I->setUser(U);
- To.Val->addUser(operandNum, U);
- }
-
- // Now that we have modified U, add it back to the CSE maps. If it already
- // exists there, recursively merge the results together.
- if (SDNode *Existing = AddNonLeafNodeToCSEMaps(U)) {
- ReplaceAllUsesWith(U, Existing, UpdateListener);
- // U is now dead. Inform the listener if it exists and delete it.
- if (UpdateListener)
- UpdateListener->NodeDeleted(U);
- DeleteNodeNotInCSEMaps(U);
- } else {
- // If the node doesn't already exist, we updated it. Inform a listener if
- // it exists.
- if (UpdateListener)
- UpdateListener->NodeUpdated(U);
- }
- }
-}
-
-/// ReplaceAllUsesWith - Modify anything using 'From' to use 'To' instead.
-/// This can cause recursive merging of nodes in the DAG.
-///
-/// This version assumes From/To have matching types and numbers of result
-/// values.
-///
-void SelectionDAG::ReplaceAllUsesWith(SDNode *From, SDNode *To,
- DAGUpdateListener *UpdateListener) {
- assert(From != To && "Cannot replace uses of with self");
- assert(From->getNumValues() == To->getNumValues() &&
- "Cannot use this version of ReplaceAllUsesWith!");
- if (From->getNumValues() == 1) // If possible, use the faster version.
- return ReplaceAllUsesWith(SDOperand(From, 0), SDOperand(To, 0),
- UpdateListener);
-
- while (!From->use_empty()) {
- SDNode::use_iterator UI = From->use_begin();
- SDNode *U = UI->getUser();
-
- // This node is about to morph, remove its old self from the CSE maps.
- RemoveNodeFromCSEMaps(U);
- int operandNum = 0;
- for (SDNode::op_iterator I = U->op_begin(), E = U->op_end();
- I != E; ++I, ++operandNum)
- if (I->getVal() == From) {
- From->removeUser(operandNum, U);
- I->getVal() = To;
- To->addUser(operandNum, U);
- }
-
- // Now that we have modified U, add it back to the CSE maps. If it already
- // exists there, recursively merge the results together.
- if (SDNode *Existing = AddNonLeafNodeToCSEMaps(U)) {
- ReplaceAllUsesWith(U, Existing, UpdateListener);
- // U is now dead. Inform the listener if it exists and delete it.
- if (UpdateListener)
- UpdateListener->NodeDeleted(U);
- DeleteNodeNotInCSEMaps(U);
- } else {
- // If the node doesn't already exist, we updated it. Inform a listener if
- // it exists.
- if (UpdateListener)
- UpdateListener->NodeUpdated(U);
- }
- }
-}
-
-/// ReplaceAllUsesWith - Modify anything using 'From' to use 'To' instead.
-/// This can cause recursive merging of nodes in the DAG.
-///
-/// This version can replace From with any result values. To must match the
-/// number and types of values returned by From.
-void SelectionDAG::ReplaceAllUsesWith(SDNode *From,
- SDOperandPtr To,
- DAGUpdateListener *UpdateListener) {
- if (From->getNumValues() == 1) // Handle the simple case efficiently.
- return ReplaceAllUsesWith(SDOperand(From, 0), To[0], UpdateListener);
-
- while (!From->use_empty()) {
- SDNode::use_iterator UI = From->use_begin();
- SDNode *U = UI->getUser();
-
- // This node is about to morph, remove its old self from the CSE maps.
- RemoveNodeFromCSEMaps(U);
- int operandNum = 0;
- for (SDNode::op_iterator I = U->op_begin(), E = U->op_end();
- I != E; ++I, ++operandNum)
- if (I->getVal() == From) {
- const SDOperand &ToOp = To[I->getSDOperand().ResNo];
- From->removeUser(operandNum, U);
- *I = ToOp;
- I->setUser(U);
- ToOp.Val->addUser(operandNum, U);
- }
-
- // Now that we have modified U, add it back to the CSE maps. If it already
- // exists there, recursively merge the results together.
- if (SDNode *Existing = AddNonLeafNodeToCSEMaps(U)) {
- ReplaceAllUsesWith(U, Existing, UpdateListener);
- // U is now dead. Inform the listener if it exists and delete it.
- if (UpdateListener)
- UpdateListener->NodeDeleted(U);
- DeleteNodeNotInCSEMaps(U);
- } else {
- // If the node doesn't already exist, we updated it. Inform a listener if
- // it exists.
- if (UpdateListener)
- UpdateListener->NodeUpdated(U);
- }
- }
-}
-
-namespace {
- /// ChainedSetUpdaterListener - This class is a DAGUpdateListener that removes
- /// any deleted nodes from the set passed into its constructor and recursively
- /// notifies another update listener if specified.
- class ChainedSetUpdaterListener :
- public SelectionDAG::DAGUpdateListener {
- SmallSetVector<SDNode*, 16> &Set;
- SelectionDAG::DAGUpdateListener *Chain;
- public:
- ChainedSetUpdaterListener(SmallSetVector<SDNode*, 16> &set,
- SelectionDAG::DAGUpdateListener *chain)
- : Set(set), Chain(chain) {}
-
- virtual void NodeDeleted(SDNode *N) {
- Set.remove(N);
- if (Chain) Chain->NodeDeleted(N);
- }
- virtual void NodeUpdated(SDNode *N) {
- if (Chain) Chain->NodeUpdated(N);
- }
- };
-}
-
-/// ReplaceAllUsesOfValueWith - Replace any uses of From with To, leaving
-/// uses of other values produced by From.Val alone. The Deleted vector is
-/// handled the same way as for ReplaceAllUsesWith.
-void SelectionDAG::ReplaceAllUsesOfValueWith(SDOperand From, SDOperand To,
- DAGUpdateListener *UpdateListener){
- assert(From != To && "Cannot replace a value with itself");
-
- // Handle the simple, trivial, case efficiently.
- if (From.Val->getNumValues() == 1) {
- ReplaceAllUsesWith(From, To, UpdateListener);
- return;
- }
-
- if (From.use_empty()) return;
-
- // Get all of the users of From.Val. We want these in a nice,
- // deterministically ordered and uniqued set, so we use a SmallSetVector.
- SmallSetVector<SDNode*, 16> Users;
- for (SDNode::use_iterator UI = From.Val->use_begin(),
- E = From.Val->use_end(); UI != E; ++UI) {
- SDNode *User = UI->getUser();
- if (!Users.count(User))
- Users.insert(User);
- }
-
- // When one of the recursive merges deletes nodes from the graph, we need to
- // make sure that UpdateListener is notified *and* that the node is removed
- // from Users if present. CSUL does this.
- ChainedSetUpdaterListener CSUL(Users, UpdateListener);
-
- while (!Users.empty()) {
- // We know that this user uses some value of From. If it is the right
- // value, update it.
- SDNode *User = Users.back();
- Users.pop_back();
-
- // Scan for an operand that matches From.
- SDNode::op_iterator Op = User->op_begin(), E = User->op_end();
- for (; Op != E; ++Op)
- if (*Op == From) break;
-
- // If there are no matches, the user must use some other result of From.
- if (Op == E) continue;
-
- // Okay, we know this user needs to be updated. Remove its old self
- // from the CSE maps.
- RemoveNodeFromCSEMaps(User);
-
- // Update all operands that match "From" in case there are multiple uses.
- for (; Op != E; ++Op) {
- if (*Op == From) {
- From.Val->removeUser(Op-User->op_begin(), User);
- *Op = To;
- Op->setUser(User);
- To.Val->addUser(Op-User->op_begin(), User);
- }
- }
-
- // Now that we have modified User, add it back to the CSE maps. If it
- // already exists there, recursively merge the results together.
- SDNode *Existing = AddNonLeafNodeToCSEMaps(User);
- if (!Existing) {
- if (UpdateListener) UpdateListener->NodeUpdated(User);
- continue; // Continue on to next user.
- }
-
- // If there was already an existing matching node, use ReplaceAllUsesWith
- // to replace the dead one with the existing one. This can cause
- // recursive merging of other unrelated nodes down the line. The merging
- // can cause deletion of nodes that used the old value. To handle this, we
- // use CSUL to remove them from the Users set.
- ReplaceAllUsesWith(User, Existing, &CSUL);
-
- // User is now dead. Notify a listener if present.
- if (UpdateListener) UpdateListener->NodeDeleted(User);
- DeleteNodeNotInCSEMaps(User);
- }
-}
-
-/// AssignNodeIds - Assign a unique node id for each node in the DAG based on
-/// their allnodes order. It returns the maximum id.
-unsigned SelectionDAG::AssignNodeIds() {
- unsigned Id = 0;
- for (allnodes_iterator I = allnodes_begin(), E = allnodes_end(); I != E; ++I){
- SDNode *N = I;
- N->setNodeId(Id++);
- }
- return Id;
-}
-
-/// AssignTopologicalOrder - Assign a unique node id for each node in the DAG
-/// based on their topological order. It returns the maximum id and a vector
-/// of the SDNodes* in assigned order by reference.
-unsigned SelectionDAG::AssignTopologicalOrder(std::vector<SDNode*> &TopOrder) {
- unsigned DAGSize = AllNodes.size();
- std::vector<unsigned> InDegree(DAGSize);
- std::vector<SDNode*> Sources;
-
- // Use a two pass approach to avoid using a std::map which is slow.
- unsigned Id = 0;
- for (allnodes_iterator I = allnodes_begin(),E = allnodes_end(); I != E; ++I){
- SDNode *N = I;
- N->setNodeId(Id++);
- unsigned Degree = N->use_size();
- InDegree[N->getNodeId()] = Degree;
- if (Degree == 0)
- Sources.push_back(N);
- }
-
- TopOrder.clear();
- while (!Sources.empty()) {
- SDNode *N = Sources.back();
- Sources.pop_back();
- TopOrder.push_back(N);
- for (SDNode::op_iterator I = N->op_begin(), E = N->op_end(); I != E; ++I) {
- SDNode *P = I->getVal();
- unsigned Degree = --InDegree[P->getNodeId()];
- if (Degree == 0)
- Sources.push_back(P);
- }
- }
-
- // Second pass, assign the actual topological order as node ids.
- Id = 0;
- for (std::vector<SDNode*>::iterator TI = TopOrder.begin(),TE = TopOrder.end();
- TI != TE; ++TI)
- (*TI)->setNodeId(Id++);
-
- return Id;
-}
-
-
-
-//===----------------------------------------------------------------------===//
-// SDNode Class
-//===----------------------------------------------------------------------===//
-
-// Out-of-line virtual method to give class a home.
-void SDNode::ANCHOR() {}
-void UnarySDNode::ANCHOR() {}
-void BinarySDNode::ANCHOR() {}
-void TernarySDNode::ANCHOR() {}
-void HandleSDNode::ANCHOR() {}
-void StringSDNode::ANCHOR() {}
-void ConstantSDNode::ANCHOR() {}
-void ConstantFPSDNode::ANCHOR() {}
-void GlobalAddressSDNode::ANCHOR() {}
-void FrameIndexSDNode::ANCHOR() {}
-void JumpTableSDNode::ANCHOR() {}
-void ConstantPoolSDNode::ANCHOR() {}
-void BasicBlockSDNode::ANCHOR() {}
-void SrcValueSDNode::ANCHOR() {}
-void MemOperandSDNode::ANCHOR() {}
-void RegisterSDNode::ANCHOR() {}
-void ExternalSymbolSDNode::ANCHOR() {}
-void CondCodeSDNode::ANCHOR() {}
-void ARG_FLAGSSDNode::ANCHOR() {}
-void VTSDNode::ANCHOR() {}
-void LoadSDNode::ANCHOR() {}
-void StoreSDNode::ANCHOR() {}
-void AtomicSDNode::ANCHOR() {}
-
-HandleSDNode::~HandleSDNode() {
- SDVTList VTs = { 0, 0 };
- MorphNodeTo(ISD::HANDLENODE, VTs, SDOperandPtr(), 0); // Drops operand uses.
-}
-
-GlobalAddressSDNode::GlobalAddressSDNode(bool isTarget, const GlobalValue *GA,
- MVT::ValueType VT, int o)
- : SDNode(isa<GlobalVariable>(GA) &&
- cast<GlobalVariable>(GA)->isThreadLocal() ?
- // Thread Local
- (isTarget ? ISD::TargetGlobalTLSAddress : ISD::GlobalTLSAddress) :
- // Non Thread Local
- (isTarget ? ISD::TargetGlobalAddress : ISD::GlobalAddress),
- getSDVTList(VT)), Offset(o) {
- TheGlobal = const_cast<GlobalValue*>(GA);
-}
-
-/// getMemOperand - Return a MachineMemOperand object describing the memory
-/// reference performed by this load or store.
-MachineMemOperand LSBaseSDNode::getMemOperand() const {
- int Size = (MVT::getSizeInBits(getMemoryVT()) + 7) >> 3;
- int Flags =
- getOpcode() == ISD::LOAD ? MachineMemOperand::MOLoad :
- MachineMemOperand::MOStore;
- if (IsVolatile) Flags |= MachineMemOperand::MOVolatile;
-
- // Check if the load references a frame index, and does not have
- // an SV attached.
- const FrameIndexSDNode *FI =
- dyn_cast<const FrameIndexSDNode>(getBasePtr().Val);
- if (!getSrcValue() && FI)
- return MachineMemOperand(PseudoSourceValue::getFixedStack(), Flags,
- FI->getIndex(), Size, Alignment);
- else
- return MachineMemOperand(getSrcValue(), Flags,
- getSrcValueOffset(), Size, Alignment);
-}
-
-/// Profile - Gather unique data for the node.
-///
-void SDNode::Profile(FoldingSetNodeID &ID) {
- AddNodeIDNode(ID, this);
-}
-
-/// getValueTypeList - Return a pointer to the specified value type.
-///
-const MVT::ValueType *SDNode::getValueTypeList(MVT::ValueType VT) {
- if (MVT::isExtendedVT(VT)) {
- static std::set<MVT::ValueType> EVTs;
- return &(*EVTs.insert(VT).first);
- } else {
- static MVT::ValueType VTs[MVT::LAST_VALUETYPE];
- VTs[VT] = VT;
- return &VTs[VT];
- }
-}
-
-/// hasNUsesOfValue - Return true if there are exactly NUSES uses of the
-/// indicated value. This method ignores uses of other values defined by this
-/// operation.
-bool SDNode::hasNUsesOfValue(unsigned NUses, unsigned Value) const {
- assert(Value < getNumValues() && "Bad value!");
-
- // If there is only one value, this is easy.
- if (getNumValues() == 1)
- return use_size() == NUses;
- if (use_size() < NUses) return false;
-
- SDOperand TheValue(const_cast<SDNode *>(this), Value);
-
- SmallPtrSet<SDNode*, 32> UsersHandled;
-
- // TODO: Only iterate over uses of a given value of the node
- for (SDNode::use_iterator UI = use_begin(), E = use_end(); UI != E; ++UI) {
- if (*UI == TheValue) {
- if (NUses == 0)
- return false;
- --NUses;
- }
- }
-
- // Found exactly the right number of uses?
- return NUses == 0;
-}
-
-
-/// hasAnyUseOfValue - Return true if there are any use of the indicated
-/// value. This method ignores uses of other values defined by this operation.
-bool SDNode::hasAnyUseOfValue(unsigned Value) const {
- assert(Value < getNumValues() && "Bad value!");
-
- if (use_empty()) return false;
-
- SDOperand TheValue(const_cast<SDNode *>(this), Value);
-
- SmallPtrSet<SDNode*, 32> UsersHandled;
-
- for (SDNode::use_iterator UI = use_begin(), E = use_end(); UI != E; ++UI) {
- SDNode *User = UI->getUser();
- if (User->getNumOperands() == 1 ||
- UsersHandled.insert(User)) // First time we've seen this?
- for (unsigned i = 0, e = User->getNumOperands(); i != e; ++i)
- if (User->getOperand(i) == TheValue) {
- return true;
- }
- }
-
- return false;
-}
-
-
-/// isOnlyUseOf - Return true if this node is the only use of N.
-///
-bool SDNode::isOnlyUseOf(SDNode *N) const {
- bool Seen = false;
- for (SDNode::use_iterator I = N->use_begin(), E = N->use_end(); I != E; ++I) {
- SDNode *User = I->getUser();
- if (User == this)
- Seen = true;
- else
- return false;
- }
-
- return Seen;
-}
-
-/// isOperand - Return true if this node is an operand of N.
-///
-bool SDOperand::isOperandOf(SDNode *N) const {
- for (unsigned i = 0, e = N->getNumOperands(); i != e; ++i)
- if (*this == N->getOperand(i))
- return true;
- return false;
-}
-
-bool SDNode::isOperandOf(SDNode *N) const {
- for (unsigned i = 0, e = N->NumOperands; i != e; ++i)
- if (this == N->OperandList[i].getVal())
- return true;
- return false;
-}
-
-/// reachesChainWithoutSideEffects - Return true if this operand (which must
-/// be a chain) reaches the specified operand without crossing any
-/// side-effecting instructions. In practice, this looks through token
-/// factors and non-volatile loads. In order to remain efficient, this only
-/// looks a couple of nodes in, it does not do an exhaustive search.
-bool SDOperand::reachesChainWithoutSideEffects(SDOperand Dest,
- unsigned Depth) const {
- if (*this == Dest) return true;
-
- // Don't search too deeply, we just want to be able to see through
- // TokenFactor's etc.
- if (Depth == 0) return false;
-
- // If this is a token factor, all inputs to the TF happen in parallel. If any
- // of the operands of the TF reach dest, then we can do the xform.
- if (getOpcode() == ISD::TokenFactor) {
- for (unsigned i = 0, e = getNumOperands(); i != e; ++i)
- if (getOperand(i).reachesChainWithoutSideEffects(Dest, Depth-1))
- return true;
- return false;
- }
-
- // Loads don't have side effects, look through them.
- if (LoadSDNode *Ld = dyn_cast<LoadSDNode>(*this)) {
- if (!Ld->isVolatile())
- return Ld->getChain().reachesChainWithoutSideEffects(Dest, Depth-1);
- }
- return false;
-}
-
-
-static void findPredecessor(SDNode *N, const SDNode *P, bool &found,
- SmallPtrSet<SDNode *, 32> &Visited) {
- if (found || !Visited.insert(N))
- return;
-
- for (unsigned i = 0, e = N->getNumOperands(); !found && i != e; ++i) {
- SDNode *Op = N->getOperand(i).Val;
- if (Op == P) {
- found = true;
- return;
- }
- findPredecessor(Op, P, found, Visited);
- }
-}
-
-/// isPredecessorOf - Return true if this node is a predecessor of N. This node
-/// is either an operand of N or it can be reached by recursively traversing
-/// up the operands.
-/// NOTE: this is an expensive method. Use it carefully.
-bool SDNode::isPredecessorOf(SDNode *N) const {
- SmallPtrSet<SDNode *, 32> Visited;
- bool found = false;
- findPredecessor(N, this, found, Visited);
- return found;
-}
-
-uint64_t SDNode::getConstantOperandVal(unsigned Num) const {
- assert(Num < NumOperands && "Invalid child # of SDNode!");
- return cast<ConstantSDNode>(OperandList[Num])->getValue();
-}
-
-std::string SDNode::getOperationName(const SelectionDAG *G) const {
- switch (getOpcode()) {
- default:
- if (getOpcode() < ISD::BUILTIN_OP_END)
- return "<<Unknown DAG Node>>";
- else {
- if (G) {
- if (const TargetInstrInfo *TII = G->getTarget().getInstrInfo())
- if (getOpcode()-ISD::BUILTIN_OP_END < TII->getNumOpcodes())
- return TII->get(getOpcode()-ISD::BUILTIN_OP_END).getName();
-
- TargetLowering &TLI = G->getTargetLoweringInfo();
- const char *Name =
- TLI.getTargetNodeName(getOpcode());
- if (Name) return Name;
- }
-
- return "<<Unknown Target Node>>";
- }
-
- case ISD::PREFETCH: return "Prefetch";
- case ISD::MEMBARRIER: return "MemBarrier";
- case ISD::ATOMIC_LCS: return "AtomicLCS";
- case ISD::ATOMIC_LAS: return "AtomicLAS";
- case ISD::ATOMIC_LSS: return "AtomicLSS";
- case ISD::ATOMIC_LOAD_AND: return "AtomicLoadAnd";
- case ISD::ATOMIC_LOAD_OR: return "AtomicLoadOr";
- case ISD::ATOMIC_LOAD_XOR: return "AtomicLoadXor";
- case ISD::ATOMIC_LOAD_MIN: return "AtomicLoadMin";
- case ISD::ATOMIC_LOAD_MAX: return "AtomicLoadMax";
- case ISD::ATOMIC_LOAD_UMIN: return "AtomicLoadUMin";
- case ISD::ATOMIC_LOAD_UMAX: return "AtomicLoadUMax";
- case ISD::ATOMIC_SWAP: return "AtomicSWAP";
- case ISD::PCMARKER: return "PCMarker";
- case ISD::READCYCLECOUNTER: return "ReadCycleCounter";
- case ISD::SRCVALUE: return "SrcValue";
- case ISD::MEMOPERAND: return "MemOperand";
- case ISD::EntryToken: return "EntryToken";
- case ISD::TokenFactor: return "TokenFactor";
- case ISD::AssertSext: return "AssertSext";
- case ISD::AssertZext: return "AssertZext";
-
- case ISD::STRING: return "String";
- case ISD::BasicBlock: return "BasicBlock";
- case ISD::ARG_FLAGS: return "ArgFlags";
- case ISD::VALUETYPE: return "ValueType";
- case ISD::Register: return "Register";
-
- case ISD::Constant: return "Constant";
- case ISD::ConstantFP: return "ConstantFP";
- case ISD::GlobalAddress: return "GlobalAddress";
- case ISD::GlobalTLSAddress: return "GlobalTLSAddress";
- case ISD::FrameIndex: return "FrameIndex";
- case ISD::JumpTable: return "JumpTable";
- case ISD::GLOBAL_OFFSET_TABLE: return "GLOBAL_OFFSET_TABLE";
- case ISD::RETURNADDR: return "RETURNADDR";
- case ISD::FRAMEADDR: return "FRAMEADDR";
- case ISD::FRAME_TO_ARGS_OFFSET: return "FRAME_TO_ARGS_OFFSET";
- case ISD::EXCEPTIONADDR: return "EXCEPTIONADDR";
- case ISD::EHSELECTION: return "EHSELECTION";
- case ISD::EH_RETURN: return "EH_RETURN";
- case ISD::ConstantPool: return "ConstantPool";
- case ISD::ExternalSymbol: return "ExternalSymbol";
- case ISD::INTRINSIC_WO_CHAIN: {
- unsigned IID = cast<ConstantSDNode>(getOperand(0))->getValue();
- return Intrinsic::getName((Intrinsic::ID)IID);
- }
- case ISD::INTRINSIC_VOID:
- case ISD::INTRINSIC_W_CHAIN: {
- unsigned IID = cast<ConstantSDNode>(getOperand(1))->getValue();
- return Intrinsic::getName((Intrinsic::ID)IID);
- }
-
- case ISD::BUILD_VECTOR: return "BUILD_VECTOR";
- case ISD::TargetConstant: return "TargetConstant";
- case ISD::TargetConstantFP:return "TargetConstantFP";
- case ISD::TargetGlobalAddress: return "TargetGlobalAddress";
- case ISD::TargetGlobalTLSAddress: return "TargetGlobalTLSAddress";
- case ISD::TargetFrameIndex: return "TargetFrameIndex";
- case ISD::TargetJumpTable: return "TargetJumpTable";
- case ISD::TargetConstantPool: return "TargetConstantPool";
- case ISD::TargetExternalSymbol: return "TargetExternalSymbol";
-
- case ISD::CopyToReg: return "CopyToReg";
- case ISD::CopyFromReg: return "CopyFromReg";
- case ISD::UNDEF: return "undef";
- case ISD::MERGE_VALUES: return "merge_values";
- case ISD::INLINEASM: return "inlineasm";
- case ISD::LABEL: return "label";
- case ISD::DECLARE: return "declare";
- case ISD::HANDLENODE: return "handlenode";
- case ISD::FORMAL_ARGUMENTS: return "formal_arguments";
- case ISD::CALL: return "call";
-
- // Unary operators
- case ISD::FABS: return "fabs";
- case ISD::FNEG: return "fneg";
- case ISD::FSQRT: return "fsqrt";
- case ISD::FSIN: return "fsin";
- case ISD::FCOS: return "fcos";
- case ISD::FPOWI: return "fpowi";
- case ISD::FPOW: return "fpow";
-
- // Binary operators
- case ISD::ADD: return "add";
- case ISD::SUB: return "sub";
- case ISD::MUL: return "mul";
- case ISD::MULHU: return "mulhu";
- case ISD::MULHS: return "mulhs";
- case ISD::SDIV: return "sdiv";
- case ISD::UDIV: return "udiv";
- case ISD::SREM: return "srem";
- case ISD::UREM: return "urem";
- case ISD::SMUL_LOHI: return "smul_lohi";
- case ISD::UMUL_LOHI: return "umul_lohi";
- case ISD::SDIVREM: return "sdivrem";
- case ISD::UDIVREM: return "divrem";
- case ISD::AND: return "and";
- case ISD::OR: return "or";
- case ISD::XOR: return "xor";
- case ISD::SHL: return "shl";
- case ISD::SRA: return "sra";
- case ISD::SRL: return "srl";
- case ISD::ROTL: return "rotl";
- case ISD::ROTR: return "rotr";
- case ISD::FADD: return "fadd";
- case ISD::FSUB: return "fsub";
- case ISD::FMUL: return "fmul";
- case ISD::FDIV: return "fdiv";
- case ISD::FREM: return "frem";
- case ISD::FCOPYSIGN: return "fcopysign";
- case ISD::FGETSIGN: return "fgetsign";
-
- case ISD::SETCC: return "setcc";
- case ISD::SELECT: return "select";
- case ISD::SELECT_CC: return "select_cc";
- case ISD::INSERT_VECTOR_ELT: return "insert_vector_elt";
- case ISD::EXTRACT_VECTOR_ELT: return "extract_vector_elt";
- case ISD::CONCAT_VECTORS: return "concat_vectors";
- case ISD::EXTRACT_SUBVECTOR: return "extract_subvector";
- case ISD::SCALAR_TO_VECTOR: return "scalar_to_vector";
- case ISD::VECTOR_SHUFFLE: return "vector_shuffle";
- case ISD::CARRY_FALSE: return "carry_false";
- case ISD::ADDC: return "addc";
- case ISD::ADDE: return "adde";
- case ISD::SUBC: return "subc";
- case ISD::SUBE: return "sube";
- case ISD::SHL_PARTS: return "shl_parts";
- case ISD::SRA_PARTS: return "sra_parts";
- case ISD::SRL_PARTS: return "srl_parts";
-
- case ISD::EXTRACT_SUBREG: return "extract_subreg";
- case ISD::INSERT_SUBREG: return "insert_subreg";
-
- // Conversion operators.
- case ISD::SIGN_EXTEND: return "sign_extend";
- case ISD::ZERO_EXTEND: return "zero_extend";
- case ISD::ANY_EXTEND: return "any_extend";
- case ISD::SIGN_EXTEND_INREG: return "sign_extend_inreg";
- case ISD::TRUNCATE: return "truncate";
- case ISD::FP_ROUND: return "fp_round";
- case ISD::FLT_ROUNDS_: return "flt_rounds";
- case ISD::FP_ROUND_INREG: return "fp_round_inreg";
- case ISD::FP_EXTEND: return "fp_extend";
-
- case ISD::SINT_TO_FP: return "sint_to_fp";
- case ISD::UINT_TO_FP: return "uint_to_fp";
- case ISD::FP_TO_SINT: return "fp_to_sint";
- case ISD::FP_TO_UINT: return "fp_to_uint";
- case ISD::BIT_CONVERT: return "bit_convert";
-
- // Control flow instructions
- case ISD::BR: return "br";
- case ISD::BRIND: return "brind";
- case ISD::BR_JT: return "br_jt";
- case ISD::BRCOND: return "brcond";
- case ISD::BR_CC: return "br_cc";
- case ISD::RET: return "ret";
- case ISD::CALLSEQ_START: return "callseq_start";
- case ISD::CALLSEQ_END: return "callseq_end";
-
- // Other operators
- case ISD::LOAD: return "load";
- case ISD::STORE: return "store";
- case ISD::VAARG: return "vaarg";
- case ISD::VACOPY: return "vacopy";
- case ISD::VAEND: return "vaend";
- case ISD::VASTART: return "vastart";
- case ISD::DYNAMIC_STACKALLOC: return "dynamic_stackalloc";
- case ISD::EXTRACT_ELEMENT: return "extract_element";
- case ISD::BUILD_PAIR: return "build_pair";
- case ISD::STACKSAVE: return "stacksave";
- case ISD::STACKRESTORE: return "stackrestore";
- case ISD::TRAP: return "trap";
-
- // Bit manipulation
- case ISD::BSWAP: return "bswap";
- case ISD::CTPOP: return "ctpop";
- case ISD::CTTZ: return "cttz";
- case ISD::CTLZ: return "ctlz";
-
- // Debug info
- case ISD::LOCATION: return "location";
- case ISD::DEBUG_LOC: return "debug_loc";
-
- // Trampolines
- case ISD::TRAMPOLINE: return "trampoline";
-
- case ISD::CONDCODE:
- switch (cast<CondCodeSDNode>(this)->get()) {
- default: assert(0 && "Unknown setcc condition!");
- case ISD::SETOEQ: return "setoeq";
- case ISD::SETOGT: return "setogt";
- case ISD::SETOGE: return "setoge";
- case ISD::SETOLT: return "setolt";
- case ISD::SETOLE: return "setole";
- case ISD::SETONE: return "setone";
-
- case ISD::SETO: return "seto";
- case ISD::SETUO: return "setuo";
- case ISD::SETUEQ: return "setue";
- case ISD::SETUGT: return "setugt";
- case ISD::SETUGE: return "setuge";
- case ISD::SETULT: return "setult";
- case ISD::SETULE: return "setule";
- case ISD::SETUNE: return "setune";
-
- case ISD::SETEQ: return "seteq";
- case ISD::SETGT: return "setgt";
- case ISD::SETGE: return "setge";
- case ISD::SETLT: return "setlt";
- case ISD::SETLE: return "setle";
- case ISD::SETNE: return "setne";
- }
- }
-}
-
-const char *SDNode::getIndexedModeName(ISD::MemIndexedMode AM) {
- switch (AM) {
- default:
- return "";
- case ISD::PRE_INC:
- return "<pre-inc>";
- case ISD::PRE_DEC:
- return "<pre-dec>";
- case ISD::POST_INC:
- return "<post-inc>";
- case ISD::POST_DEC:
- return "<post-dec>";
- }
-}
-
-std::string ISD::ArgFlagsTy::getArgFlagsString() {
- std::string S = "< ";
-
- if (isZExt())
- S += "zext ";
- if (isSExt())
- S += "sext ";
- if (isInReg())
- S += "inreg ";
- if (isSRet())
- S += "sret ";
- if (isByVal())
- S += "byval ";
- if (isNest())
- S += "nest ";
- if (getByValAlign())
- S += "byval-align:" + utostr(getByValAlign()) + " ";
- if (getOrigAlign())
- S += "orig-align:" + utostr(getOrigAlign()) + " ";
- if (getByValSize())
- S += "byval-size:" + utostr(getByValSize()) + " ";
- return S + ">";
-}
-
-void SDNode::dump() const { dump(0); }
-void SDNode::dump(const SelectionDAG *G) const {
- cerr << (void*)this << ": ";
-
- for (unsigned i = 0, e = getNumValues(); i != e; ++i) {
- if (i) cerr << ",";
- if (getValueType(i) == MVT::Other)
- cerr << "ch";
- else
- cerr << MVT::getValueTypeString(getValueType(i));
- }
- cerr << " = " << getOperationName(G);
-
- cerr << " ";
- for (unsigned i = 0, e = getNumOperands(); i != e; ++i) {
- if (i) cerr << ", ";
- cerr << (void*)getOperand(i).Val;
- if (unsigned RN = getOperand(i).ResNo)
- cerr << ":" << RN;
- }
-
- if (!isTargetOpcode() && getOpcode() == ISD::VECTOR_SHUFFLE) {
- SDNode *Mask = getOperand(2).Val;
- cerr << "<";
- for (unsigned i = 0, e = Mask->getNumOperands(); i != e; ++i) {
- if (i) cerr << ",";
- if (Mask->getOperand(i).getOpcode() == ISD::UNDEF)
- cerr << "u";
- else
- cerr << cast<ConstantSDNode>(Mask->getOperand(i))->getValue();
- }
- cerr << ">";
- }
-
- if (const ConstantSDNode *CSDN = dyn_cast<ConstantSDNode>(this)) {
- cerr << "<" << CSDN->getValue() << ">";
- } else if (const ConstantFPSDNode *CSDN = dyn_cast<ConstantFPSDNode>(this)) {
- if (&CSDN->getValueAPF().getSemantics()==&APFloat::IEEEsingle)
- cerr << "<" << CSDN->getValueAPF().convertToFloat() << ">";
- else if (&CSDN->getValueAPF().getSemantics()==&APFloat::IEEEdouble)
- cerr << "<" << CSDN->getValueAPF().convertToDouble() << ">";
- else {
- cerr << "<APFloat(";
- CSDN->getValueAPF().convertToAPInt().dump();
- cerr << ")>";
- }
- } else if (const GlobalAddressSDNode *GADN =
- dyn_cast<GlobalAddressSDNode>(this)) {
- int offset = GADN->getOffset();
- cerr << "<";
- WriteAsOperand(*cerr.stream(), GADN->getGlobal()) << ">";
- if (offset > 0)
- cerr << " + " << offset;
- else
- cerr << " " << offset;
- } else if (const FrameIndexSDNode *FIDN = dyn_cast<FrameIndexSDNode>(this)) {
- cerr << "<" << FIDN->getIndex() << ">";
- } else if (const JumpTableSDNode *JTDN = dyn_cast<JumpTableSDNode>(this)) {
- cerr << "<" << JTDN->getIndex() << ">";
- } else if (const ConstantPoolSDNode *CP = dyn_cast<ConstantPoolSDNode>(this)){
- int offset = CP->getOffset();
- if (CP->isMachineConstantPoolEntry())
- cerr << "<" << *CP->getMachineCPVal() << ">";
- else
- cerr << "<" << *CP->getConstVal() << ">";
- if (offset > 0)
- cerr << " + " << offset;
- else
- cerr << " " << offset;
- } else if (const BasicBlockSDNode *BBDN = dyn_cast<BasicBlockSDNode>(this)) {
- cerr << "<";
- const Value *LBB = (const Value*)BBDN->getBasicBlock()->getBasicBlock();
- if (LBB)
- cerr << LBB->getName() << " ";
- cerr << (const void*)BBDN->getBasicBlock() << ">";
- } else if (const RegisterSDNode *R = dyn_cast<RegisterSDNode>(this)) {
- if (G && R->getReg() &&
- TargetRegisterInfo::isPhysicalRegister(R->getReg())) {
- cerr << " " << G->getTarget().getRegisterInfo()->getName(R->getReg());
- } else {
- cerr << " #" << R->getReg();
- }
- } else if (const ExternalSymbolSDNode *ES =
- dyn_cast<ExternalSymbolSDNode>(this)) {
- cerr << "'" << ES->getSymbol() << "'";
- } else if (const SrcValueSDNode *M = dyn_cast<SrcValueSDNode>(this)) {
- if (M->getValue())
- cerr << "<" << M->getValue() << ">";
- else
- cerr << "<null>";
- } else if (const MemOperandSDNode *M = dyn_cast<MemOperandSDNode>(this)) {
- if (M->MO.getValue())
- cerr << "<" << M->MO.getValue() << ":" << M->MO.getOffset() << ">";
- else
- cerr << "<null:" << M->MO.getOffset() << ">";
- } else if (const ARG_FLAGSSDNode *N = dyn_cast<ARG_FLAGSSDNode>(this)) {
- cerr << N->getArgFlags().getArgFlagsString();
- } else if (const VTSDNode *N = dyn_cast<VTSDNode>(this)) {
- cerr << ":" << MVT::getValueTypeString(N->getVT());
- } else if (const LoadSDNode *LD = dyn_cast<LoadSDNode>(this)) {
- const Value *SrcValue = LD->getSrcValue();
- int SrcOffset = LD->getSrcValueOffset();
- cerr << " <";
- if (SrcValue)
- cerr << SrcValue;
- else
- cerr << "null";
- cerr << ":" << SrcOffset << ">";
-
- bool doExt = true;
- switch (LD->getExtensionType()) {
- default: doExt = false; break;
- case ISD::EXTLOAD:
- cerr << " <anyext ";
- break;
- case ISD::SEXTLOAD:
- cerr << " <sext ";
- break;
- case ISD::ZEXTLOAD:
- cerr << " <zext ";
- break;
- }
- if (doExt)
- cerr << MVT::getValueTypeString(LD->getMemoryVT()) << ">";
-
- const char *AM = getIndexedModeName(LD->getAddressingMode());
- if (*AM)
- cerr << " " << AM;
- if (LD->isVolatile())
- cerr << " <volatile>";
- cerr << " alignment=" << LD->getAlignment();
- } else if (const StoreSDNode *ST = dyn_cast<StoreSDNode>(this)) {
- const Value *SrcValue = ST->getSrcValue();
- int SrcOffset = ST->getSrcValueOffset();
- cerr << " <";
- if (SrcValue)
- cerr << SrcValue;
- else
- cerr << "null";
- cerr << ":" << SrcOffset << ">";
-
- if (ST->isTruncatingStore())
- cerr << " <trunc "
- << MVT::getValueTypeString(ST->getMemoryVT()) << ">";
-
- const char *AM = getIndexedModeName(ST->getAddressingMode());
- if (*AM)
- cerr << " " << AM;
- if (ST->isVolatile())
- cerr << " <volatile>";
- cerr << " alignment=" << ST->getAlignment();
- }
-}
-
-static void DumpNodes(const SDNode *N, unsigned indent, const SelectionDAG *G) {
- for (unsigned i = 0, e = N->getNumOperands(); i != e; ++i)
- if (N->getOperand(i).Val->hasOneUse())
- DumpNodes(N->getOperand(i).Val, indent+2, G);
- else
- cerr << "\n" << std::string(indent+2, ' ')
- << (void*)N->getOperand(i).Val << ": <multiple use>";
-
-
- cerr << "\n" << std::string(indent, ' ');
- N->dump(G);
-}
-
-void SelectionDAG::dump() const {
- cerr << "SelectionDAG has " << AllNodes.size() << " nodes:";
- std::vector<const SDNode*> Nodes;
- for (allnodes_const_iterator I = allnodes_begin(), E = allnodes_end();
- I != E; ++I)
- Nodes.push_back(I);
-
- std::sort(Nodes.begin(), Nodes.end());
-
- for (unsigned i = 0, e = Nodes.size(); i != e; ++i) {
- if (!Nodes[i]->hasOneUse() && Nodes[i] != getRoot().Val)
- DumpNodes(Nodes[i], 2, this);
- }
-
- if (getRoot().Val) DumpNodes(getRoot().Val, 2, this);
-
- cerr << "\n\n";
-}
-
-const Type *ConstantPoolSDNode::getType() const {
- if (isMachineConstantPoolEntry())
- return Val.MachineCPVal->getType();
- return Val.ConstVal->getType();
-}
diff --git a/release_23/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/release_23/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
deleted file mode 100644
index 7ac5218ecfda..000000000000
--- a/release_23/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
+++ /dev/null
@@ -1,5290 +0,0 @@
-//===-- SelectionDAGISel.cpp - Implement the SelectionDAGISel class -------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This implements the SelectionDAGISel class.
-//
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "isel"
-#include "llvm/ADT/BitVector.h"
-#include "llvm/Analysis/AliasAnalysis.h"
-#include "llvm/CodeGen/SelectionDAGISel.h"
-#include "llvm/CodeGen/ScheduleDAG.h"
-#include "llvm/Constants.h"
-#include "llvm/CallingConv.h"
-#include "llvm/DerivedTypes.h"
-#include "llvm/Function.h"
-#include "llvm/GlobalVariable.h"
-#include "llvm/InlineAsm.h"
-#include "llvm/Instructions.h"
-#include "llvm/Intrinsics.h"
-#include "llvm/IntrinsicInst.h"
-#include "llvm/ParameterAttributes.h"
-#include "llvm/CodeGen/Collector.h"
-#include "llvm/CodeGen/MachineFunction.h"
-#include "llvm/CodeGen/MachineFrameInfo.h"
-#include "llvm/CodeGen/MachineInstrBuilder.h"
-#include "llvm/CodeGen/MachineJumpTableInfo.h"
-#include "llvm/CodeGen/MachineModuleInfo.h"
-#include "llvm/CodeGen/MachineRegisterInfo.h"
-#include "llvm/CodeGen/SchedulerRegistry.h"
-#include "llvm/CodeGen/SelectionDAG.h"
-#include "llvm/Target/TargetRegisterInfo.h"
-#include "llvm/Target/TargetData.h"
-#include "llvm/Target/TargetFrameInfo.h"
-#include "llvm/Target/TargetInstrInfo.h"
-#include "llvm/Target/TargetLowering.h"
-#include "llvm/Target/TargetMachine.h"
-#include "llvm/Target/TargetOptions.h"
-#include "llvm/Support/MathExtras.h"
-#include "llvm/Support/Debug.h"
-#include "llvm/Support/Compiler.h"
-#include <algorithm>
-using namespace llvm;
-
-#ifndef NDEBUG
-static cl::opt<bool>
-ViewISelDAGs("view-isel-dags", cl::Hidden,
- cl::desc("Pop up a window to show isel dags as they are selected"));
-static cl::opt<bool>
-ViewSchedDAGs("view-sched-dags", cl::Hidden,
- cl::desc("Pop up a window to show sched dags as they are processed"));
-static cl::opt<bool>
-ViewSUnitDAGs("view-sunit-dags", cl::Hidden,
- cl::desc("Pop up a window to show SUnit dags after they are processed"));
-#else
-static const bool ViewISelDAGs = 0, ViewSchedDAGs = 0, ViewSUnitDAGs = 0;
-#endif
-
-//===---------------------------------------------------------------------===//
-///
-/// RegisterScheduler class - Track the registration of instruction schedulers.
-///
-//===---------------------------------------------------------------------===//
-MachinePassRegistry RegisterScheduler::Registry;
-
-//===---------------------------------------------------------------------===//
-///
-/// ISHeuristic command line option for instruction schedulers.
-///
-//===---------------------------------------------------------------------===//
-namespace {
- static cl::opt<RegisterScheduler::FunctionPassCtor, false,
- RegisterPassParser<RegisterScheduler> >
- ISHeuristic("pre-RA-sched",
- cl::init(&createDefaultScheduler),
- cl::desc("Instruction schedulers available (before register"
- " allocation):"));
-
- static RegisterScheduler
- defaultListDAGScheduler("default", " Best scheduler for the target",
- createDefaultScheduler);
-} // namespace
-
-namespace { struct SDISelAsmOperandInfo; }
-
-/// ComputeValueVTs - Given an LLVM IR type, compute a sequence of
-/// MVT::ValueTypes that represent all the individual underlying
-/// non-aggregate types that comprise it.
-static void ComputeValueVTs(const TargetLowering &TLI, const Type *Ty,
- SmallVectorImpl<MVT::ValueType> &ValueVTs) {
- // Given a struct type, recursively traverse the elements.
- if (const StructType *STy = dyn_cast<StructType>(Ty)) {
- for (StructType::element_iterator EI = STy->element_begin(),
- EB = STy->element_end();
- EI != EB; ++EI)
- ComputeValueVTs(TLI, *EI, ValueVTs);
- return;
- }
- // Given an array type, recursively traverse the elements.
- if (const ArrayType *ATy = dyn_cast<ArrayType>(Ty)) {
- const Type *EltTy = ATy->getElementType();
- for (unsigned i = 0, e = ATy->getNumElements(); i != e; ++i)
- ComputeValueVTs(TLI, EltTy, ValueVTs);
- return;
- }
- // Base case: we can get an MVT::ValueType for this LLVM IR type.
- ValueVTs.push_back(TLI.getValueType(Ty));
-}
-
-namespace {
- /// RegsForValue - This struct represents the registers (physical or virtual)
- /// that a particular set of values is assigned, and the type information about
- /// the value. The most common situation is to represent one value at a time,
- /// but struct or array values are handled element-wise as multiple values.
- /// The splitting of aggregates is performed recursively, so that we never
- /// have aggregate-typed registers. The values at this point do not necessarily
- /// have legal types, so each value may require one or more registers of some
- /// legal type.
- ///
- struct VISIBILITY_HIDDEN RegsForValue {
- /// TLI - The TargetLowering object.
- ///
- const TargetLowering *TLI;
-
- /// ValueVTs - The value types of the values, which may not be legal, and
- /// may need be promoted or synthesized from one or more registers.
- ///
- SmallVector<MVT::ValueType, 4> ValueVTs;
-
- /// RegVTs - The value types of the registers. This is the same size as
- /// ValueVTs and it records, for each value, what the type of the assigned
- /// register or registers are. (Individual values are never synthesized
- /// from more than one type of register.)
- ///
- /// With virtual registers, the contents of RegVTs is redundant with TLI's
- /// getRegisterType member function, however when with physical registers
- /// it is necessary to have a separate record of the types.
- ///
- SmallVector<MVT::ValueType, 4> RegVTs;
-
- /// Regs - This list holds the registers assigned to the values.
- /// Each legal or promoted value requires one register, and each
- /// expanded value requires multiple registers.
- ///
- SmallVector<unsigned, 4> Regs;
-
- RegsForValue() : TLI(0) {}
-
- RegsForValue(const TargetLowering &tli,
- const SmallVector<unsigned, 4> &regs,
- MVT::ValueType regvt, MVT::ValueType valuevt)
- : TLI(&tli), ValueVTs(1, valuevt), RegVTs(1, regvt), Regs(regs) {}
- RegsForValue(const TargetLowering &tli,
- const SmallVector<unsigned, 4> &regs,
- const SmallVector<MVT::ValueType, 4> &regvts,
- const SmallVector<MVT::ValueType, 4> &valuevts)
- : TLI(&tli), ValueVTs(valuevts), RegVTs(regvts), Regs(regs) {}
- RegsForValue(const TargetLowering &tli,
- unsigned Reg, const Type *Ty) : TLI(&tli) {
- ComputeValueVTs(tli, Ty, ValueVTs);
-
- for (unsigned Value = 0, e = ValueVTs.size(); Value != e; ++Value) {
- MVT::ValueType ValueVT = ValueVTs[Value];
- unsigned NumRegs = TLI->getNumRegisters(ValueVT);
- MVT::ValueType RegisterVT = TLI->getRegisterType(ValueVT);
- for (unsigned i = 0; i != NumRegs; ++i)
- Regs.push_back(Reg + i);
- RegVTs.push_back(RegisterVT);
- Reg += NumRegs;
- }
- }
-
- /// append - Add the specified values to this one.
- void append(const RegsForValue &RHS) {
- TLI = RHS.TLI;
- ValueVTs.append(RHS.ValueVTs.begin(), RHS.ValueVTs.end());
- RegVTs.append(RHS.RegVTs.begin(), RHS.RegVTs.end());
- Regs.append(RHS.Regs.begin(), RHS.Regs.end());
- }
-
-
- /// getCopyFromRegs - Emit a series of CopyFromReg nodes that copies from
- /// this value and returns the result as a ValueVTs value. This uses
- /// Chain/Flag as the input and updates them for the output Chain/Flag.
- /// If the Flag pointer is NULL, no flag is used.
- SDOperand getCopyFromRegs(SelectionDAG &DAG,
- SDOperand &Chain, SDOperand *Flag) const;
-
- /// getCopyToRegs - Emit a series of CopyToReg nodes that copies the
- /// specified value into the registers specified by this object. This uses
- /// Chain/Flag as the input and updates them for the output Chain/Flag.
- /// If the Flag pointer is NULL, no flag is used.
- void getCopyToRegs(SDOperand Val, SelectionDAG &DAG,
- SDOperand &Chain, SDOperand *Flag) const;
-
- /// AddInlineAsmOperands - Add this value to the specified inlineasm node
- /// operand list. This adds the code marker and includes the number of
- /// values added into it.
- void AddInlineAsmOperands(unsigned Code, SelectionDAG &DAG,
- std::vector<SDOperand> &Ops) const;
- };
-}
-
-namespace llvm {
- //===--------------------------------------------------------------------===//
- /// createDefaultScheduler - This creates an instruction scheduler appropriate
- /// for the target.
- ScheduleDAG* createDefaultScheduler(SelectionDAGISel *IS,
- SelectionDAG *DAG,
- MachineBasicBlock *BB) {
- TargetLowering &TLI = IS->getTargetLowering();
-
- if (TLI.getSchedulingPreference() == TargetLowering::SchedulingForLatency) {
- return createTDListDAGScheduler(IS, DAG, BB);
- } else {
- assert(TLI.getSchedulingPreference() ==
- TargetLowering::SchedulingForRegPressure && "Unknown sched type!");
- return createBURRListDAGScheduler(IS, DAG, BB);
- }
- }
-
-
- //===--------------------------------------------------------------------===//
- /// FunctionLoweringInfo - This contains information that is global to a
- /// function that is used when lowering a region of the function.
- class FunctionLoweringInfo {
- public:
- TargetLowering &TLI;
- Function &Fn;
- MachineFunction &MF;
- MachineRegisterInfo &RegInfo;
-
- FunctionLoweringInfo(TargetLowering &TLI, Function &Fn,MachineFunction &MF);
-
- /// MBBMap - A mapping from LLVM basic blocks to their machine code entry.
- std::map<const BasicBlock*, MachineBasicBlock *> MBBMap;
-
- /// ValueMap - Since we emit code for the function a basic block at a time,
- /// we must remember which virtual registers hold the values for
- /// cross-basic-block values.
- DenseMap<const Value*, unsigned> ValueMap;
-
- /// StaticAllocaMap - Keep track of frame indices for fixed sized allocas in
- /// the entry block. This allows the allocas to be efficiently referenced
- /// anywhere in the function.
- std::map<const AllocaInst*, int> StaticAllocaMap;
-
-#ifndef NDEBUG
- SmallSet<Instruction*, 8> CatchInfoLost;
- SmallSet<Instruction*, 8> CatchInfoFound;
-#endif
-
- unsigned MakeReg(MVT::ValueType VT) {
- return RegInfo.createVirtualRegister(TLI.getRegClassFor(VT));
- }
-
- /// isExportedInst - Return true if the specified value is an instruction
- /// exported from its block.
- bool isExportedInst(const Value *V) {
- return ValueMap.count(V);
- }
-
- unsigned CreateRegForValue(const Value *V);
-
- unsigned InitializeRegForValue(const Value *V) {
- unsigned &R = ValueMap[V];
- assert(R == 0 && "Already initialized this value register!");
- return R = CreateRegForValue(V);
- }
- };
-}
-
-/// isSelector - Return true if this instruction is a call to the
-/// eh.selector intrinsic.
-static bool isSelector(Instruction *I) {
- if (IntrinsicInst *II = dyn_cast<IntrinsicInst>(I))
- return (II->getIntrinsicID() == Intrinsic::eh_selector_i32 ||
- II->getIntrinsicID() == Intrinsic::eh_selector_i64);
- return false;
-}
-
-/// isUsedOutsideOfDefiningBlock - Return true if this instruction is used by
-/// PHI nodes or outside of the basic block that defines it, or used by a
-/// switch or atomic instruction, which may expand to multiple basic blocks.
-static bool isUsedOutsideOfDefiningBlock(Instruction *I) {
- if (isa<PHINode>(I)) return true;
- BasicBlock *BB = I->getParent();
- for (Value::use_iterator UI = I->use_begin(), E = I->use_end(); UI != E; ++UI)
- if (cast<Instruction>(*UI)->getParent() != BB || isa<PHINode>(*UI) ||
- // FIXME: Remove switchinst special case.
- isa<SwitchInst>(*UI))
- return true;
- return false;
-}
-
-/// isOnlyUsedInEntryBlock - If the specified argument is only used in the
-/// entry block, return true. This includes arguments used by switches, since
-/// the switch may expand into multiple basic blocks.
-static bool isOnlyUsedInEntryBlock(Argument *A) {
- BasicBlock *Entry = A->getParent()->begin();
- for (Value::use_iterator UI = A->use_begin(), E = A->use_end(); UI != E; ++UI)
- if (cast<Instruction>(*UI)->getParent() != Entry || isa<SwitchInst>(*UI))
- return false; // Use not in entry block.
- return true;
-}
-
-FunctionLoweringInfo::FunctionLoweringInfo(TargetLowering &tli,
- Function &fn, MachineFunction &mf)
- : TLI(tli), Fn(fn), MF(mf), RegInfo(MF.getRegInfo()) {
-
- // Create a vreg for each argument register that is not dead and is used
- // outside of the entry block for the function.
- for (Function::arg_iterator AI = Fn.arg_begin(), E = Fn.arg_end();
- AI != E; ++AI)
- if (!isOnlyUsedInEntryBlock(AI))
- InitializeRegForValue(AI);
-
- // Initialize the mapping of values to registers. This is only set up for
- // instruction values that are used outside of the block that defines
- // them.
- Function::iterator BB = Fn.begin(), EB = Fn.end();
- for (BasicBlock::iterator I = BB->begin(), E = BB->end(); I != E; ++I)
- if (AllocaInst *AI = dyn_cast<AllocaInst>(I))
- if (ConstantInt *CUI = dyn_cast<ConstantInt>(AI->getArraySize())) {
- const Type *Ty = AI->getAllocatedType();
- uint64_t TySize = TLI.getTargetData()->getABITypeSize(Ty);
- unsigned Align =
- std::max((unsigned)TLI.getTargetData()->getPrefTypeAlignment(Ty),
- AI->getAlignment());
-
- TySize *= CUI->getZExtValue(); // Get total allocated size.
- if (TySize == 0) TySize = 1; // Don't create zero-sized stack objects.
- StaticAllocaMap[AI] =
- MF.getFrameInfo()->CreateStackObject(TySize, Align);
- }
-
- for (; BB != EB; ++BB)
- for (BasicBlock::iterator I = BB->begin(), E = BB->end(); I != E; ++I)
- if (!I->use_empty() && isUsedOutsideOfDefiningBlock(I))
- if (!isa<AllocaInst>(I) ||
- !StaticAllocaMap.count(cast<AllocaInst>(I)))
- InitializeRegForValue(I);
-
- // Create an initial MachineBasicBlock for each LLVM BasicBlock in F. This
- // also creates the initial PHI MachineInstrs, though none of the input
- // operands are populated.
- for (BB = Fn.begin(), EB = Fn.end(); BB != EB; ++BB) {
- MachineBasicBlock *MBB = new MachineBasicBlock(BB);
- MBBMap[BB] = MBB;
- MF.getBasicBlockList().push_back(MBB);
-
- // Create Machine PHI nodes for LLVM PHI nodes, lowering them as
- // appropriate.
- PHINode *PN;
- for (BasicBlock::iterator I = BB->begin();(PN = dyn_cast<PHINode>(I)); ++I){
- if (PN->use_empty()) continue;
-
- MVT::ValueType VT = TLI.getValueType(PN->getType());
- unsigned NumRegisters = TLI.getNumRegisters(VT);
- unsigned PHIReg = ValueMap[PN];
- assert(PHIReg && "PHI node does not have an assigned virtual register!");
- const TargetInstrInfo *TII = TLI.getTargetMachine().getInstrInfo();
- for (unsigned i = 0; i != NumRegisters; ++i)
- BuildMI(MBB, TII->get(TargetInstrInfo::PHI), PHIReg+i);
- }
- }
-}
-
-/// CreateRegForValue - Allocate the appropriate number of virtual registers of
-/// the correctly promoted or expanded types. Assign these registers
-/// consecutive vreg numbers and return the first assigned number.
-///
-/// In the case that the given value has struct or array type, this function
-/// will assign registers for each member or element.
-///
-unsigned FunctionLoweringInfo::CreateRegForValue(const Value *V) {
- SmallVector<MVT::ValueType, 4> ValueVTs;
- ComputeValueVTs(TLI, V->getType(), ValueVTs);
-
- unsigned FirstReg = 0;
- for (unsigned Value = 0, e = ValueVTs.size(); Value != e; ++Value) {
- MVT::ValueType ValueVT = ValueVTs[Value];
- MVT::ValueType RegisterVT = TLI.getRegisterType(ValueVT);
-
- unsigned NumRegs = TLI.getNumRegisters(ValueVT);
- for (unsigned i = 0; i != NumRegs; ++i) {
- unsigned R = MakeReg(RegisterVT);
- if (!FirstReg) FirstReg = R;
- }
- }
- return FirstReg;
-}
-
-//===----------------------------------------------------------------------===//
-/// SelectionDAGLowering - This is the common target-independent lowering
-/// implementation that is parameterized by a TargetLowering object.
-/// Also, targets can overload any lowering method.
-///
-namespace llvm {
-class SelectionDAGLowering {
- MachineBasicBlock *CurMBB;
-
- DenseMap<const Value*, SDOperand> NodeMap;
-
- /// PendingLoads - Loads are not emitted to the program immediately. We bunch
- /// them up and then emit token factor nodes when possible. This allows us to
- /// get simple disambiguation between loads without worrying about alias
- /// analysis.
- std::vector<SDOperand> PendingLoads;
-
- /// PendingExports - CopyToReg nodes that copy values to virtual registers
- /// for export to other blocks need to be emitted before any terminator
- /// instruction, but they have no other ordering requirements. We bunch them
- /// up and the emit a single tokenfactor for them just before terminator
- /// instructions.
- std::vector<SDOperand> PendingExports;
-
- /// Case - A struct to record the Value for a switch case, and the
- /// case's target basic block.
- struct Case {
- Constant* Low;
- Constant* High;
- MachineBasicBlock* BB;
-
- Case() : Low(0), High(0), BB(0) { }
- Case(Constant* low, Constant* high, MachineBasicBlock* bb) :
- Low(low), High(high), BB(bb) { }
- uint64_t size() const {
- uint64_t rHigh = cast<ConstantInt>(High)->getSExtValue();
- uint64_t rLow = cast<ConstantInt>(Low)->getSExtValue();
- return (rHigh - rLow + 1ULL);
- }
- };
-
- struct CaseBits {
- uint64_t Mask;
- MachineBasicBlock* BB;
- unsigned Bits;
-
- CaseBits(uint64_t mask, MachineBasicBlock* bb, unsigned bits):
- Mask(mask), BB(bb), Bits(bits) { }
- };
-
- typedef std::vector<Case> CaseVector;
- typedef std::vector<CaseBits> CaseBitsVector;
- typedef CaseVector::iterator CaseItr;
- typedef std::pair<CaseItr, CaseItr> CaseRange;
-
- /// CaseRec - A struct with ctor used in lowering switches to a binary tree
- /// of conditional branches.
- struct CaseRec {
- CaseRec(MachineBasicBlock *bb, Constant *lt, Constant *ge, CaseRange r) :
- CaseBB(bb), LT(lt), GE(ge), Range(r) {}
-
- /// CaseBB - The MBB in which to emit the compare and branch
- MachineBasicBlock *CaseBB;
- /// LT, GE - If nonzero, we know the current case value must be less-than or
- /// greater-than-or-equal-to these Constants.
- Constant *LT;
- Constant *GE;
- /// Range - A pair of iterators representing the range of case values to be
- /// processed at this point in the binary search tree.
- CaseRange Range;
- };
-
- typedef std::vector<CaseRec> CaseRecVector;
-
- /// The comparison function for sorting the switch case values in the vector.
- /// WARNING: Case ranges should be disjoint!
- struct CaseCmp {
- bool operator () (const Case& C1, const Case& C2) {
- assert(isa<ConstantInt>(C1.Low) && isa<ConstantInt>(C2.High));
- const ConstantInt* CI1 = cast<const ConstantInt>(C1.Low);
- const ConstantInt* CI2 = cast<const ConstantInt>(C2.High);
- return CI1->getValue().slt(CI2->getValue());
- }
- };
-
- struct CaseBitsCmp {
- bool operator () (const CaseBits& C1, const CaseBits& C2) {
- return C1.Bits > C2.Bits;
- }
- };
-
- unsigned Clusterify(CaseVector& Cases, const SwitchInst &SI);
-
-public:
- // TLI - This is information that describes the available target features we
- // need for lowering. This indicates when operations are unavailable,
- // implemented with a libcall, etc.
- TargetLowering &TLI;
- SelectionDAG &DAG;
- const TargetData *TD;
- AliasAnalysis &AA;
-
- /// SwitchCases - Vector of CaseBlock structures used to communicate
- /// SwitchInst code generation information.
- std::vector<SelectionDAGISel::CaseBlock> SwitchCases;
- /// JTCases - Vector of JumpTable structures used to communicate
- /// SwitchInst code generation information.
- std::vector<SelectionDAGISel::JumpTableBlock> JTCases;
- std::vector<SelectionDAGISel::BitTestBlock> BitTestCases;
-
- /// FuncInfo - Information about the function as a whole.
- ///
- FunctionLoweringInfo &FuncInfo;
-
- /// GCI - Garbage collection metadata for the function.
- CollectorMetadata *GCI;
-
- SelectionDAGLowering(SelectionDAG &dag, TargetLowering &tli,
- AliasAnalysis &aa,
- FunctionLoweringInfo &funcinfo,
- CollectorMetadata *gci)
- : TLI(tli), DAG(dag), TD(DAG.getTarget().getTargetData()), AA(aa),
- FuncInfo(funcinfo), GCI(gci) {
- }
-
- /// getRoot - Return the current virtual root of the Selection DAG,
- /// flushing any PendingLoad items. This must be done before emitting
- /// a store or any other node that may need to be ordered after any
- /// prior load instructions.
- ///
- SDOperand getRoot() {
- if (PendingLoads.empty())
- return DAG.getRoot();
-
- if (PendingLoads.size() == 1) {
- SDOperand Root = PendingLoads[0];
- DAG.setRoot(Root);
- PendingLoads.clear();
- return Root;
- }
-
- // Otherwise, we have to make a token factor node.
- SDOperand Root = DAG.getNode(ISD::TokenFactor, MVT::Other,
- &PendingLoads[0], PendingLoads.size());
- PendingLoads.clear();
- DAG.setRoot(Root);
- return Root;
- }
-
- /// getControlRoot - Similar to getRoot, but instead of flushing all the
- /// PendingLoad items, flush all the PendingExports items. It is necessary
- /// to do this before emitting a terminator instruction.
- ///
- SDOperand getControlRoot() {
- SDOperand Root = DAG.getRoot();
-
- if (PendingExports.empty())
- return Root;
-
- // Turn all of the CopyToReg chains into one factored node.
- if (Root.getOpcode() != ISD::EntryToken) {
- unsigned i = 0, e = PendingExports.size();
- for (; i != e; ++i) {
- assert(PendingExports[i].Val->getNumOperands() > 1);
- if (PendingExports[i].Val->getOperand(0) == Root)
- break; // Don't add the root if we already indirectly depend on it.
- }
-
- if (i == e)
- PendingExports.push_back(Root);
- }
-
- Root = DAG.getNode(ISD::TokenFactor, MVT::Other,
- &PendingExports[0],
- PendingExports.size());
- PendingExports.clear();
- DAG.setRoot(Root);
- return Root;
- }
-
- void CopyValueToVirtualRegister(Value *V, unsigned Reg);
-
- void visit(Instruction &I) { visit(I.getOpcode(), I); }
-
- void visit(unsigned Opcode, User &I) {
- // Note: this doesn't use InstVisitor, because it has to work with
- // ConstantExpr's in addition to instructions.
- switch (Opcode) {
- default: assert(0 && "Unknown instruction type encountered!");
- abort();
- // Build the switch statement using the Instruction.def file.
-#define HANDLE_INST(NUM, OPCODE, CLASS) \
- case Instruction::OPCODE:return visit##OPCODE((CLASS&)I);
-#include "llvm/Instruction.def"
- }
- }
-
- void setCurrentBasicBlock(MachineBasicBlock *MBB) { CurMBB = MBB; }
-
- SDOperand getLoadFrom(const Type *Ty, SDOperand Ptr,
- const Value *SV, SDOperand Root,
- bool isVolatile, unsigned Alignment);
-
- SDOperand getValue(const Value *V);
-
- void setValue(const Value *V, SDOperand NewN) {
- SDOperand &N = NodeMap[V];
- assert(N.Val == 0 && "Already set a value for this node!");
- N = NewN;
- }
-
- void GetRegistersForValue(SDISelAsmOperandInfo &OpInfo, bool HasEarlyClobber,
- std::set<unsigned> &OutputRegs,
- std::set<unsigned> &InputRegs);
-
- void FindMergedConditions(Value *Cond, MachineBasicBlock *TBB,
- MachineBasicBlock *FBB, MachineBasicBlock *CurBB,
- unsigned Opc);
- bool isExportableFromCurrentBlock(Value *V, const BasicBlock *FromBB);
- void ExportFromCurrentBlock(Value *V);
- void LowerCallTo(CallSite CS, SDOperand Callee, bool IsTailCall,
- MachineBasicBlock *LandingPad = NULL);
-
- // Terminator instructions.
- void visitRet(ReturnInst &I);
- void visitBr(BranchInst &I);
- void visitSwitch(SwitchInst &I);
- void visitUnreachable(UnreachableInst &I) { /* noop */ }
-
- // Helpers for visitSwitch
- bool handleSmallSwitchRange(CaseRec& CR,
- CaseRecVector& WorkList,
- Value* SV,
- MachineBasicBlock* Default);
- bool handleJTSwitchCase(CaseRec& CR,
- CaseRecVector& WorkList,
- Value* SV,
- MachineBasicBlock* Default);
- bool handleBTSplitSwitchCase(CaseRec& CR,
- CaseRecVector& WorkList,
- Value* SV,
- MachineBasicBlock* Default);
- bool handleBitTestsSwitchCase(CaseRec& CR,
- CaseRecVector& WorkList,
- Value* SV,
- MachineBasicBlock* Default);
- void visitSwitchCase(SelectionDAGISel::CaseBlock &CB);
- void visitBitTestHeader(SelectionDAGISel::BitTestBlock &B);
- void visitBitTestCase(MachineBasicBlock* NextMBB,
- unsigned Reg,
- SelectionDAGISel::BitTestCase &B);
- void visitJumpTable(SelectionDAGISel::JumpTable &JT);
- void visitJumpTableHeader(SelectionDAGISel::JumpTable &JT,
- SelectionDAGISel::JumpTableHeader &JTH);
-
- // These all get lowered before this pass.
- void visitInvoke(InvokeInst &I);
- void visitUnwind(UnwindInst &I);
-
- void visitBinary(User &I, unsigned OpCode);
- void visitShift(User &I, unsigned Opcode);
- void visitAdd(User &I) {
- if (I.getType()->isFPOrFPVector())
- visitBinary(I, ISD::FADD);
- else
- visitBinary(I, ISD::ADD);
- }
- void visitSub(User &I);
- void visitMul(User &I) {
- if (I.getType()->isFPOrFPVector())
- visitBinary(I, ISD::FMUL);
- else
- visitBinary(I, ISD::MUL);
- }
- void visitURem(User &I) { visitBinary(I, ISD::UREM); }
- void visitSRem(User &I) { visitBinary(I, ISD::SREM); }
- void visitFRem(User &I) { visitBinary(I, ISD::FREM); }
- void visitUDiv(User &I) { visitBinary(I, ISD::UDIV); }
- void visitSDiv(User &I) { visitBinary(I, ISD::SDIV); }
- void visitFDiv(User &I) { visitBinary(I, ISD::FDIV); }
- void visitAnd (User &I) { visitBinary(I, ISD::AND); }
- void visitOr (User &I) { visitBinary(I, ISD::OR); }
- void visitXor (User &I) { visitBinary(I, ISD::XOR); }
- void visitShl (User &I) { visitShift(I, ISD::SHL); }
- void visitLShr(User &I) { visitShift(I, ISD::SRL); }
- void visitAShr(User &I) { visitShift(I, ISD::SRA); }
- void visitICmp(User &I);
- void visitFCmp(User &I);
- // Visit the conversion instructions
- void visitTrunc(User &I);
- void visitZExt(User &I);
- void visitSExt(User &I);
- void visitFPTrunc(User &I);
- void visitFPExt(User &I);
- void visitFPToUI(User &I);
- void visitFPToSI(User &I);
- void visitUIToFP(User &I);
- void visitSIToFP(User &I);
- void visitPtrToInt(User &I);
- void visitIntToPtr(User &I);
- void visitBitCast(User &I);
-
- void visitExtractElement(User &I);
- void visitInsertElement(User &I);
- void visitShuffleVector(User &I);
-
- void visitGetElementPtr(User &I);
- void visitSelect(User &I);
-
- void visitMalloc(MallocInst &I);
- void visitFree(FreeInst &I);
- void visitAlloca(AllocaInst &I);
- void visitLoad(LoadInst &I);
- void visitStore(StoreInst &I);
- void visitPHI(PHINode &I) { } // PHI nodes are handled specially.
- void visitCall(CallInst &I);
- void visitInlineAsm(CallSite CS);
- const char *visitIntrinsicCall(CallInst &I, unsigned Intrinsic);
- void visitTargetIntrinsic(CallInst &I, unsigned Intrinsic);
-
- void visitVAStart(CallInst &I);
- void visitVAArg(VAArgInst &I);
- void visitVAEnd(CallInst &I);
- void visitVACopy(CallInst &I);
-
- void visitGetResult(GetResultInst &I);
-
- void visitUserOp1(Instruction &I) {
- assert(0 && "UserOp1 should not exist at instruction selection time!");
- abort();
- }
- void visitUserOp2(Instruction &I) {
- assert(0 && "UserOp2 should not exist at instruction selection time!");
- abort();
- }
-
-private:
- inline const char *implVisitBinaryAtomic(CallInst& I, ISD::NodeType Op);
-
-};
-} // end namespace llvm
-
-
-/// getCopyFromParts - Create a value that contains the specified legal parts
-/// combined into the value they represent. If the parts combine to a type
-/// larger then ValueVT then AssertOp can be used to specify whether the extra
-/// bits are known to be zero (ISD::AssertZext) or sign extended from ValueVT
-/// (ISD::AssertSext).
-static SDOperand getCopyFromParts(SelectionDAG &DAG,
- const SDOperand *Parts,
- unsigned NumParts,
- MVT::ValueType PartVT,
- MVT::ValueType ValueVT,
- ISD::NodeType AssertOp = ISD::DELETED_NODE) {
- assert(NumParts > 0 && "No parts to assemble!");
- TargetLowering &TLI = DAG.getTargetLoweringInfo();
- SDOperand Val = Parts[0];
-
- if (NumParts > 1) {
- // Assemble the value from multiple parts.
- if (!MVT::isVector(ValueVT)) {
- unsigned PartBits = MVT::getSizeInBits(PartVT);
- unsigned ValueBits = MVT::getSizeInBits(ValueVT);
-
- // Assemble the power of 2 part.
- unsigned RoundParts = NumParts & (NumParts - 1) ?
- 1 << Log2_32(NumParts) : NumParts;
- unsigned RoundBits = PartBits * RoundParts;
- MVT::ValueType RoundVT = RoundBits == ValueBits ?
- ValueVT : MVT::getIntegerType(RoundBits);
- SDOperand Lo, Hi;
-
- if (RoundParts > 2) {
- MVT::ValueType HalfVT = MVT::getIntegerType(RoundBits/2);
- Lo = getCopyFromParts(DAG, Parts, RoundParts/2, PartVT, HalfVT);
- Hi = getCopyFromParts(DAG, Parts+RoundParts/2, RoundParts/2,
- PartVT, HalfVT);
- } else {
- Lo = Parts[0];
- Hi = Parts[1];
- }
- if (TLI.isBigEndian())
- std::swap(Lo, Hi);
- Val = DAG.getNode(ISD::BUILD_PAIR, RoundVT, Lo, Hi);
-
- if (RoundParts < NumParts) {
- // Assemble the trailing non-power-of-2 part.
- unsigned OddParts = NumParts - RoundParts;
- MVT::ValueType OddVT = MVT::getIntegerType(OddParts * PartBits);
- Hi = getCopyFromParts(DAG, Parts+RoundParts, OddParts, PartVT, OddVT);
-
- // Combine the round and odd parts.
- Lo = Val;
- if (TLI.isBigEndian())
- std::swap(Lo, Hi);
- MVT::ValueType TotalVT = MVT::getIntegerType(NumParts * PartBits);
- Hi = DAG.getNode(ISD::ANY_EXTEND, TotalVT, Hi);
- Hi = DAG.getNode(ISD::SHL, TotalVT, Hi,
- DAG.getConstant(MVT::getSizeInBits(Lo.getValueType()),
- TLI.getShiftAmountTy()));
- Lo = DAG.getNode(ISD::ZERO_EXTEND, TotalVT, Lo);
- Val = DAG.getNode(ISD::OR, TotalVT, Lo, Hi);
- }
- } else {
- // Handle a multi-element vector.
- MVT::ValueType IntermediateVT, RegisterVT;
- unsigned NumIntermediates;
- unsigned NumRegs =
- TLI.getVectorTypeBreakdown(ValueVT, IntermediateVT, NumIntermediates,
- RegisterVT);
-
- assert(NumRegs == NumParts && "Part count doesn't match vector breakdown!");
- assert(RegisterVT == PartVT && "Part type doesn't match vector breakdown!");
- assert(RegisterVT == Parts[0].getValueType() &&
- "Part type doesn't match part!");
-
- // Assemble the parts into intermediate operands.
- SmallVector<SDOperand, 8> Ops(NumIntermediates);
- if (NumIntermediates == NumParts) {
- // If the register was not expanded, truncate or copy the value,
- // as appropriate.
- for (unsigned i = 0; i != NumParts; ++i)
- Ops[i] = getCopyFromParts(DAG, &Parts[i], 1,
- PartVT, IntermediateVT);
- } else if (NumParts > 0) {
- // If the intermediate type was expanded, build the intermediate operands
- // from the parts.
- assert(NumParts % NumIntermediates == 0 &&
- "Must expand into a divisible number of parts!");
- unsigned Factor = NumParts / NumIntermediates;
- for (unsigned i = 0; i != NumIntermediates; ++i)
- Ops[i] = getCopyFromParts(DAG, &Parts[i * Factor], Factor,
- PartVT, IntermediateVT);
- }
-
- // Build a vector with BUILD_VECTOR or CONCAT_VECTORS from the intermediate
- // operands.
- Val = DAG.getNode(MVT::isVector(IntermediateVT) ?
- ISD::CONCAT_VECTORS : ISD::BUILD_VECTOR,
- ValueVT, &Ops[0], NumIntermediates);
- }
- }
-
- // There is now one part, held in Val. Correct it to match ValueVT.
- PartVT = Val.getValueType();
-
- if (PartVT == ValueVT)
- return Val;
-
- if (MVT::isVector(PartVT)) {
- assert(MVT::isVector(ValueVT) && "Unknown vector conversion!");
- return DAG.getNode(ISD::BIT_CONVERT, ValueVT, Val);
- }
-
- if (MVT::isVector(ValueVT)) {
- assert(MVT::getVectorElementType(ValueVT) == PartVT &&
- MVT::getVectorNumElements(ValueVT) == 1 &&
- "Only trivial scalar-to-vector conversions should get here!");
- return DAG.getNode(ISD::BUILD_VECTOR, ValueVT, Val);
- }
-
- if (MVT::isInteger(PartVT) &&
- MVT::isInteger(ValueVT)) {
- if (MVT::getSizeInBits(ValueVT) < MVT::getSizeInBits(PartVT)) {
- // For a truncate, see if we have any information to
- // indicate whether the truncated bits will always be
- // zero or sign-extension.
- if (AssertOp != ISD::DELETED_NODE)
- Val = DAG.getNode(AssertOp, PartVT, Val,
- DAG.getValueType(ValueVT));
- return DAG.getNode(ISD::TRUNCATE, ValueVT, Val);
- } else {
- return DAG.getNode(ISD::ANY_EXTEND, ValueVT, Val);
- }
- }
-
- if (MVT::isFloatingPoint(PartVT) && MVT::isFloatingPoint(ValueVT)) {
- if (ValueVT < Val.getValueType())
- // FP_ROUND's are always exact here.
- return DAG.getNode(ISD::FP_ROUND, ValueVT, Val,
- DAG.getIntPtrConstant(1));
- return DAG.getNode(ISD::FP_EXTEND, ValueVT, Val);
- }
-
- if (MVT::getSizeInBits(PartVT) == MVT::getSizeInBits(ValueVT))
- return DAG.getNode(ISD::BIT_CONVERT, ValueVT, Val);
-
- assert(0 && "Unknown mismatch!");
- return SDOperand();
-}
-
-/// getCopyToParts - Create a series of nodes that contain the specified value
-/// split into legal parts. If the parts contain more bits than Val, then, for
-/// integers, ExtendKind can be used to specify how to generate the extra bits.
-static void getCopyToParts(SelectionDAG &DAG,
- SDOperand Val,
- SDOperand *Parts,
- unsigned NumParts,
- MVT::ValueType PartVT,
- ISD::NodeType ExtendKind = ISD::ANY_EXTEND) {
- TargetLowering &TLI = DAG.getTargetLoweringInfo();
- MVT::ValueType PtrVT = TLI.getPointerTy();
- MVT::ValueType ValueVT = Val.getValueType();
- unsigned PartBits = MVT::getSizeInBits(PartVT);
- assert(TLI.isTypeLegal(PartVT) && "Copying to an illegal type!");
-
- if (!NumParts)
- return;
-
- if (!MVT::isVector(ValueVT)) {
- if (PartVT == ValueVT) {
- assert(NumParts == 1 && "No-op copy with multiple parts!");
- Parts[0] = Val;
- return;
- }
-
- if (NumParts * PartBits > MVT::getSizeInBits(ValueVT)) {
- // If the parts cover more bits than the value has, promote the value.
- if (MVT::isFloatingPoint(PartVT) && MVT::isFloatingPoint(ValueVT)) {
- assert(NumParts == 1 && "Do not know what to promote to!");
- Val = DAG.getNode(ISD::FP_EXTEND, PartVT, Val);
- } else if (MVT::isInteger(PartVT) && MVT::isInteger(ValueVT)) {
- ValueVT = MVT::getIntegerType(NumParts * PartBits);
- Val = DAG.getNode(ExtendKind, ValueVT, Val);
- } else {
- assert(0 && "Unknown mismatch!");
- }
- } else if (PartBits == MVT::getSizeInBits(ValueVT)) {
- // Different types of the same size.
- assert(NumParts == 1 && PartVT != ValueVT);
- Val = DAG.getNode(ISD::BIT_CONVERT, PartVT, Val);
- } else if (NumParts * PartBits < MVT::getSizeInBits(ValueVT)) {
- // If the parts cover less bits than value has, truncate the value.
- if (MVT::isInteger(PartVT) && MVT::isInteger(ValueVT)) {
- ValueVT = MVT::getIntegerType(NumParts * PartBits);
- Val = DAG.getNode(ISD::TRUNCATE, ValueVT, Val);
- } else {
- assert(0 && "Unknown mismatch!");
- }
- }
-
- // The value may have changed - recompute ValueVT.
- ValueVT = Val.getValueType();
- assert(NumParts * PartBits == MVT::getSizeInBits(ValueVT) &&
- "Failed to tile the value with PartVT!");
-
- if (NumParts == 1) {
- assert(PartVT == ValueVT && "Type conversion failed!");
- Parts[0] = Val;
- return;
- }
-
- // Expand the value into multiple parts.
- if (NumParts & (NumParts - 1)) {
- // The number of parts is not a power of 2. Split off and copy the tail.
- assert(MVT::isInteger(PartVT) && MVT::isInteger(ValueVT) &&
- "Do not know what to expand to!");
- unsigned RoundParts = 1 << Log2_32(NumParts);
- unsigned RoundBits = RoundParts * PartBits;
- unsigned OddParts = NumParts - RoundParts;
- SDOperand OddVal = DAG.getNode(ISD::SRL, ValueVT, Val,
- DAG.getConstant(RoundBits,
- TLI.getShiftAmountTy()));
- getCopyToParts(DAG, OddVal, Parts + RoundParts, OddParts, PartVT);
- if (TLI.isBigEndian())
- // The odd parts were reversed by getCopyToParts - unreverse them.
- std::reverse(Parts + RoundParts, Parts + NumParts);
- NumParts = RoundParts;
- ValueVT = MVT::getIntegerType(NumParts * PartBits);
- Val = DAG.getNode(ISD::TRUNCATE, ValueVT, Val);
- }
-
- // The number of parts is a power of 2. Repeatedly bisect the value using
- // EXTRACT_ELEMENT.
- Parts[0] = DAG.getNode(ISD::BIT_CONVERT,
- MVT::getIntegerType(MVT::getSizeInBits(ValueVT)),
- Val);
- for (unsigned StepSize = NumParts; StepSize > 1; StepSize /= 2) {
- for (unsigned i = 0; i < NumParts; i += StepSize) {
- unsigned ThisBits = StepSize * PartBits / 2;
- MVT::ValueType ThisVT = MVT::getIntegerType (ThisBits);
- SDOperand &Part0 = Parts[i];
- SDOperand &Part1 = Parts[i+StepSize/2];
-
- Part1 = DAG.getNode(ISD::EXTRACT_ELEMENT, ThisVT, Part0,
- DAG.getConstant(1, PtrVT));
- Part0 = DAG.getNode(ISD::EXTRACT_ELEMENT, ThisVT, Part0,
- DAG.getConstant(0, PtrVT));
-
- if (ThisBits == PartBits && ThisVT != PartVT) {
- Part0 = DAG.getNode(ISD::BIT_CONVERT, PartVT, Part0);
- Part1 = DAG.getNode(ISD::BIT_CONVERT, PartVT, Part1);
- }
- }
- }
-
- if (TLI.isBigEndian())
- std::reverse(Parts, Parts + NumParts);
-
- return;
- }
-
- // Vector ValueVT.
- if (NumParts == 1) {
- if (PartVT != ValueVT) {
- if (MVT::isVector(PartVT)) {
- Val = DAG.getNode(ISD::BIT_CONVERT, PartVT, Val);
- } else {
- assert(MVT::getVectorElementType(ValueVT) == PartVT &&
- MVT::getVectorNumElements(ValueVT) == 1 &&
- "Only trivial vector-to-scalar conversions should get here!");
- Val = DAG.getNode(ISD::EXTRACT_VECTOR_ELT, PartVT, Val,
- DAG.getConstant(0, PtrVT));
- }
- }
-
- Parts[0] = Val;
- return;
- }
-
- // Handle a multi-element vector.
- MVT::ValueType IntermediateVT, RegisterVT;
- unsigned NumIntermediates;
- unsigned NumRegs =
- DAG.getTargetLoweringInfo()
- .getVectorTypeBreakdown(ValueVT, IntermediateVT, NumIntermediates,
- RegisterVT);
- unsigned NumElements = MVT::getVectorNumElements(ValueVT);
-
- assert(NumRegs == NumParts && "Part count doesn't match vector breakdown!");
- assert(RegisterVT == PartVT && "Part type doesn't match vector breakdown!");
-
- // Split the vector into intermediate operands.
- SmallVector<SDOperand, 8> Ops(NumIntermediates);
- for (unsigned i = 0; i != NumIntermediates; ++i)
- if (MVT::isVector(IntermediateVT))
- Ops[i] = DAG.getNode(ISD::EXTRACT_SUBVECTOR,
- IntermediateVT, Val,
- DAG.getConstant(i * (NumElements / NumIntermediates),
- PtrVT));
- else
- Ops[i] = DAG.getNode(ISD::EXTRACT_VECTOR_ELT,
- IntermediateVT, Val,
- DAG.getConstant(i, PtrVT));
-
- // Split the intermediate operands into legal parts.
- if (NumParts == NumIntermediates) {
- // If the register was not expanded, promote or copy the value,
- // as appropriate.
- for (unsigned i = 0; i != NumParts; ++i)
- getCopyToParts(DAG, Ops[i], &Parts[i], 1, PartVT);
- } else if (NumParts > 0) {
- // If the intermediate type was expanded, split each the value into
- // legal parts.
- assert(NumParts % NumIntermediates == 0 &&
- "Must expand into a divisible number of parts!");
- unsigned Factor = NumParts / NumIntermediates;
- for (unsigned i = 0; i != NumIntermediates; ++i)
- getCopyToParts(DAG, Ops[i], &Parts[i * Factor], Factor, PartVT);
- }
-}
-
-
-SDOperand SelectionDAGLowering::getValue(const Value *V) {
- SDOperand &N = NodeMap[V];
- if (N.Val) return N;
-
- if (Constant *C = const_cast<Constant*>(dyn_cast<Constant>(V))) {
- MVT::ValueType VT = TLI.getValueType(V->getType(), true);
-
- if (ConstantInt *CI = dyn_cast<ConstantInt>(C))
- return N = DAG.getConstant(CI->getValue(), VT);
-
- if (GlobalValue *GV = dyn_cast<GlobalValue>(C))
- return N = DAG.getGlobalAddress(GV, VT);
-
- if (isa<ConstantPointerNull>(C))
- return N = DAG.getConstant(0, TLI.getPointerTy());
-
- if (ConstantFP *CFP = dyn_cast<ConstantFP>(C))
- return N = DAG.getConstantFP(CFP->getValueAPF(), VT);
-
- if (isa<UndefValue>(C) && !isa<VectorType>(V->getType()))
- return N = DAG.getNode(ISD::UNDEF, VT);
-
- if (ConstantExpr *CE = dyn_cast<ConstantExpr>(C)) {
- visit(CE->getOpcode(), *CE);
- SDOperand N1 = NodeMap[V];
- assert(N1.Val && "visit didn't populate the ValueMap!");
- return N1;
- }
-
- const VectorType *VecTy = cast<VectorType>(V->getType());
- unsigned NumElements = VecTy->getNumElements();
-
- // Now that we know the number and type of the elements, get that number of
- // elements into the Ops array based on what kind of constant it is.
- SmallVector<SDOperand, 16> Ops;
- if (ConstantVector *CP = dyn_cast<ConstantVector>(C)) {
- for (unsigned i = 0; i != NumElements; ++i)
- Ops.push_back(getValue(CP->getOperand(i)));
- } else {
- assert((isa<ConstantAggregateZero>(C) || isa<UndefValue>(C)) &&
- "Unknown vector constant!");
- MVT::ValueType EltVT = TLI.getValueType(VecTy->getElementType());
-
- SDOperand Op;
- if (isa<UndefValue>(C))
- Op = DAG.getNode(ISD::UNDEF, EltVT);
- else if (MVT::isFloatingPoint(EltVT))
- Op = DAG.getConstantFP(0, EltVT);
- else
- Op = DAG.getConstant(0, EltVT);
- Ops.assign(NumElements, Op);
- }
-
- // Create a BUILD_VECTOR node.
- return NodeMap[V] = DAG.getNode(ISD::BUILD_VECTOR, VT, &Ops[0], Ops.size());
- }
-
- // If this is a static alloca, generate it as the frameindex instead of
- // computation.
- if (const AllocaInst *AI = dyn_cast<AllocaInst>(V)) {
- std::map<const AllocaInst*, int>::iterator SI =
- FuncInfo.StaticAllocaMap.find(AI);
- if (SI != FuncInfo.StaticAllocaMap.end())
- return DAG.getFrameIndex(SI->second, TLI.getPointerTy());
- }
-
- unsigned InReg = FuncInfo.ValueMap[V];
- assert(InReg && "Value not in map!");
-
- RegsForValue RFV(TLI, InReg, V->getType());
- SDOperand Chain = DAG.getEntryNode();
- return RFV.getCopyFromRegs(DAG, Chain, NULL);
-}
-
-
-void SelectionDAGLowering::visitRet(ReturnInst &I) {
- if (I.getNumOperands() == 0) {
- DAG.setRoot(DAG.getNode(ISD::RET, MVT::Other, getControlRoot()));
- return;
- }
-
- SmallVector<SDOperand, 8> NewValues;
- NewValues.push_back(getControlRoot());
- for (unsigned i = 0, e = I.getNumOperands(); i != e; ++i) {
- SDOperand RetOp = getValue(I.getOperand(i));
- MVT::ValueType VT = RetOp.getValueType();
-
- // FIXME: C calling convention requires the return type to be promoted to
- // at least 32-bit. But this is not necessary for non-C calling conventions.
- if (MVT::isInteger(VT)) {
- MVT::ValueType MinVT = TLI.getRegisterType(MVT::i32);
- if (MVT::getSizeInBits(VT) < MVT::getSizeInBits(MinVT))
- VT = MinVT;
- }
-
- unsigned NumParts = TLI.getNumRegisters(VT);
- MVT::ValueType PartVT = TLI.getRegisterType(VT);
- SmallVector<SDOperand, 4> Parts(NumParts);
- ISD::NodeType ExtendKind = ISD::ANY_EXTEND;
-
- const Function *F = I.getParent()->getParent();
- if (F->paramHasAttr(0, ParamAttr::SExt))
- ExtendKind = ISD::SIGN_EXTEND;
- else if (F->paramHasAttr(0, ParamAttr::ZExt))
- ExtendKind = ISD::ZERO_EXTEND;
-
- getCopyToParts(DAG, RetOp, &Parts[0], NumParts, PartVT, ExtendKind);
-
- for (unsigned i = 0; i < NumParts; ++i) {
- NewValues.push_back(Parts[i]);
- NewValues.push_back(DAG.getArgFlags(ISD::ArgFlagsTy()));
- }
- }
- DAG.setRoot(DAG.getNode(ISD::RET, MVT::Other,
- &NewValues[0], NewValues.size()));
-}
-
-/// ExportFromCurrentBlock - If this condition isn't known to be exported from
-/// the current basic block, add it to ValueMap now so that we'll get a
-/// CopyTo/FromReg.
-void SelectionDAGLowering::ExportFromCurrentBlock(Value *V) {
- // No need to export constants.
- if (!isa<Instruction>(V) && !isa<Argument>(V)) return;
-
- // Already exported?
- if (FuncInfo.isExportedInst(V)) return;
-
- unsigned Reg = FuncInfo.InitializeRegForValue(V);
- CopyValueToVirtualRegister(V, Reg);
-}
-
-bool SelectionDAGLowering::isExportableFromCurrentBlock(Value *V,
- const BasicBlock *FromBB) {
- // The operands of the setcc have to be in this block. We don't know
- // how to export them from some other block.
- if (Instruction *VI = dyn_cast<Instruction>(V)) {
- // Can export from current BB.
- if (VI->getParent() == FromBB)
- return true;
-
- // Is already exported, noop.
- return FuncInfo.isExportedInst(V);
- }
-
- // If this is an argument, we can export it if the BB is the entry block or
- // if it is already exported.
- if (isa<Argument>(V)) {
- if (FromBB == &FromBB->getParent()->getEntryBlock())
- return true;
-
- // Otherwise, can only export this if it is already exported.
- return FuncInfo.isExportedInst(V);
- }
-
- // Otherwise, constants can always be exported.
- return true;
-}
-
-static bool InBlock(const Value *V, const BasicBlock *BB) {
- if (const Instruction *I = dyn_cast<Instruction>(V))
- return I->getParent() == BB;
- return true;
-}
-
-/// FindMergedConditions - If Cond is an expression like
-void SelectionDAGLowering::FindMergedConditions(Value *Cond,
- MachineBasicBlock *TBB,
- MachineBasicBlock *FBB,
- MachineBasicBlock *CurBB,
- unsigned Opc) {
- // If this node is not part of the or/and tree, emit it as a branch.
- Instruction *BOp = dyn_cast<Instruction>(Cond);
-
- if (!BOp || !(isa<BinaryOperator>(BOp) || isa<CmpInst>(BOp)) ||
- (unsigned)BOp->getOpcode() != Opc || !BOp->hasOneUse() ||
- BOp->getParent() != CurBB->getBasicBlock() ||
- !InBlock(BOp->getOperand(0), CurBB->getBasicBlock()) ||
- !InBlock(BOp->getOperand(1), CurBB->getBasicBlock())) {
- const BasicBlock *BB = CurBB->getBasicBlock();
-
- // If the leaf of the tree is a comparison, merge the condition into
- // the caseblock.
- if ((isa<ICmpInst>(Cond) || isa<FCmpInst>(Cond)) &&
- // The operands of the cmp have to be in this block. We don't know
- // how to export them from some other block. If this is the first block
- // of the sequence, no exporting is needed.
- (CurBB == CurMBB ||
- (isExportableFromCurrentBlock(BOp->getOperand(0), BB) &&
- isExportableFromCurrentBlock(BOp->getOperand(1), BB)))) {
- BOp = cast<Instruction>(Cond);
- ISD::CondCode Condition;
- if (ICmpInst *IC = dyn_cast<ICmpInst>(Cond)) {
- switch (IC->getPredicate()) {
- default: assert(0 && "Unknown icmp predicate opcode!");
- case ICmpInst::ICMP_EQ: Condition = ISD::SETEQ; break;
- case ICmpInst::ICMP_NE: Condition = ISD::SETNE; break;
- case ICmpInst::ICMP_SLE: Condition = ISD::SETLE; break;
- case ICmpInst::ICMP_ULE: Condition = ISD::SETULE; break;
- case ICmpInst::ICMP_SGE: Condition = ISD::SETGE; break;
- case ICmpInst::ICMP_UGE: Condition = ISD::SETUGE; break;
- case ICmpInst::ICMP_SLT: Condition = ISD::SETLT; break;
- case ICmpInst::ICMP_ULT: Condition = ISD::SETULT; break;
- case ICmpInst::ICMP_SGT: Condition = ISD::SETGT; break;
- case ICmpInst::ICMP_UGT: Condition = ISD::SETUGT; break;
- }
- } else if (FCmpInst *FC = dyn_cast<FCmpInst>(Cond)) {
- ISD::CondCode FPC, FOC;
- switch (FC->getPredicate()) {
- default: assert(0 && "Unknown fcmp predicate opcode!");
- case FCmpInst::FCMP_FALSE: FOC = FPC = ISD::SETFALSE; break;
- case FCmpInst::FCMP_OEQ: FOC = ISD::SETEQ; FPC = ISD::SETOEQ; break;
- case FCmpInst::FCMP_OGT: FOC = ISD::SETGT; FPC = ISD::SETOGT; break;
- case FCmpInst::FCMP_OGE: FOC = ISD::SETGE; FPC = ISD::SETOGE; break;
- case FCmpInst::FCMP_OLT: FOC = ISD::SETLT; FPC = ISD::SETOLT; break;
- case FCmpInst::FCMP_OLE: FOC = ISD::SETLE; FPC = ISD::SETOLE; break;
- case FCmpInst::FCMP_ONE: FOC = ISD::SETNE; FPC = ISD::SETONE; break;
- case FCmpInst::FCMP_ORD: FOC = FPC = ISD::SETO; break;
- case FCmpInst::FCMP_UNO: FOC = FPC = ISD::SETUO; break;
- case FCmpInst::FCMP_UEQ: FOC = ISD::SETEQ; FPC = ISD::SETUEQ; break;
- case FCmpInst::FCMP_UGT: FOC = ISD::SETGT; FPC = ISD::SETUGT; break;
- case FCmpInst::FCMP_UGE: FOC = ISD::SETGE; FPC = ISD::SETUGE; break;
- case FCmpInst::FCMP_ULT: FOC = ISD::SETLT; FPC = ISD::SETULT; break;
- case FCmpInst::FCMP_ULE: FOC = ISD::SETLE; FPC = ISD::SETULE; break;
- case FCmpInst::FCMP_UNE: FOC = ISD::SETNE; FPC = ISD::SETUNE; break;
- case FCmpInst::FCMP_TRUE: FOC = FPC = ISD::SETTRUE; break;
- }
- if (FiniteOnlyFPMath())
- Condition = FOC;
- else
- Condition = FPC;
- } else {
- Condition = ISD::SETEQ; // silence warning.
- assert(0 && "Unknown compare instruction");
- }
-
- SelectionDAGISel::CaseBlock CB(Condition, BOp->getOperand(0),
- BOp->getOperand(1), NULL, TBB, FBB, CurBB);
- SwitchCases.push_back(CB);
- return;
- }
-
- // Create a CaseBlock record representing this branch.
- SelectionDAGISel::CaseBlock CB(ISD::SETEQ, Cond, ConstantInt::getTrue(),
- NULL, TBB, FBB, CurBB);
- SwitchCases.push_back(CB);
- return;
- }
-
-
- // Create TmpBB after CurBB.
- MachineFunction::iterator BBI = CurBB;
- MachineBasicBlock *TmpBB = new MachineBasicBlock(CurBB->getBasicBlock());
- CurBB->getParent()->getBasicBlockList().insert(++BBI, TmpBB);
-
- if (Opc == Instruction::Or) {
- // Codegen X | Y as:
- // jmp_if_X TBB
- // jmp TmpBB
- // TmpBB:
- // jmp_if_Y TBB
- // jmp FBB
- //
-
- // Emit the LHS condition.
- FindMergedConditions(BOp->getOperand(0), TBB, TmpBB, CurBB, Opc);
-
- // Emit the RHS condition into TmpBB.
- FindMergedConditions(BOp->getOperand(1), TBB, FBB, TmpBB, Opc);
- } else {
- assert(Opc == Instruction::And && "Unknown merge op!");
- // Codegen X & Y as:
- // jmp_if_X TmpBB
- // jmp FBB
- // TmpBB:
- // jmp_if_Y TBB
- // jmp FBB
- //
- // This requires creation of TmpBB after CurBB.
-
- // Emit the LHS condition.
- FindMergedConditions(BOp->getOperand(0), TmpBB, FBB, CurBB, Opc);
-
- // Emit the RHS condition into TmpBB.
- FindMergedConditions(BOp->getOperand(1), TBB, FBB, TmpBB, Opc);
- }
-}
-
-/// If the set of cases should be emitted as a series of branches, return true.
-/// If we should emit this as a bunch of and/or'd together conditions, return
-/// false.
-static bool
-ShouldEmitAsBranches(const std::vector<SelectionDAGISel::CaseBlock> &Cases) {
- if (Cases.size() != 2) return true;
-
- // If this is two comparisons of the same values or'd or and'd together, they
- // will get folded into a single comparison, so don't emit two blocks.
- if ((Cases[0].CmpLHS == Cases[1].CmpLHS &&
- Cases[0].CmpRHS == Cases[1].CmpRHS) ||
- (Cases[0].CmpRHS == Cases[1].CmpLHS &&
- Cases[0].CmpLHS == Cases[1].CmpRHS)) {
- return false;
- }
-
- return true;
-}
-
-void SelectionDAGLowering::visitBr(BranchInst &I) {
- // Update machine-CFG edges.
- MachineBasicBlock *Succ0MBB = FuncInfo.MBBMap[I.getSuccessor(0)];
-
- // Figure out which block is immediately after the current one.
- MachineBasicBlock *NextBlock = 0;
- MachineFunction::iterator BBI = CurMBB;
- if (++BBI != CurMBB->getParent()->end())
- NextBlock = BBI;
-
- if (I.isUnconditional()) {
- // If this is not a fall-through branch, emit the branch.
- if (Succ0MBB != NextBlock)
- DAG.setRoot(DAG.getNode(ISD::BR, MVT::Other, getControlRoot(),
- DAG.getBasicBlock(Succ0MBB)));
-
- // Update machine-CFG edges.
- CurMBB->addSuccessor(Succ0MBB);
- return;
- }
-
- // If this condition is one of the special cases we handle, do special stuff
- // now.
- Value *CondVal = I.getCondition();
- MachineBasicBlock *Succ1MBB = FuncInfo.MBBMap[I.getSuccessor(1)];
-
- // If this is a series of conditions that are or'd or and'd together, emit
- // this as a sequence of branches instead of setcc's with and/or operations.
- // For example, instead of something like:
- // cmp A, B
- // C = seteq
- // cmp D, E
- // F = setle
- // or C, F
- // jnz foo
- // Emit:
- // cmp A, B
- // je foo
- // cmp D, E
- // jle foo
- //
- if (BinaryOperator *BOp = dyn_cast<BinaryOperator>(CondVal)) {
- if (BOp->hasOneUse() &&
- (BOp->getOpcode() == Instruction::And ||
- BOp->getOpcode() == Instruction::Or)) {
- FindMergedConditions(BOp, Succ0MBB, Succ1MBB, CurMBB, BOp->getOpcode());
- // If the compares in later blocks need to use values not currently
- // exported from this block, export them now. This block should always
- // be the first entry.
- assert(SwitchCases[0].ThisBB == CurMBB && "Unexpected lowering!");
-
- // Allow some cases to be rejected.
- if (ShouldEmitAsBranches(SwitchCases)) {
- for (unsigned i = 1, e = SwitchCases.size(); i != e; ++i) {
- ExportFromCurrentBlock(SwitchCases[i].CmpLHS);
- ExportFromCurrentBlock(SwitchCases[i].CmpRHS);
- }
-
- // Emit the branch for this block.
- visitSwitchCase(SwitchCases[0]);
- SwitchCases.erase(SwitchCases.begin());
- return;
- }
-
- // Okay, we decided not to do this, remove any inserted MBB's and clear
- // SwitchCases.
- for (unsigned i = 1, e = SwitchCases.size(); i != e; ++i)
- CurMBB->getParent()->getBasicBlockList().erase(SwitchCases[i].ThisBB);
-
- SwitchCases.clear();
- }
- }
-
- // Create a CaseBlock record representing this branch.
- SelectionDAGISel::CaseBlock CB(ISD::SETEQ, CondVal, ConstantInt::getTrue(),
- NULL, Succ0MBB, Succ1MBB, CurMBB);
- // Use visitSwitchCase to actually insert the fast branch sequence for this
- // cond branch.
- visitSwitchCase(CB);
-}
-
-/// visitSwitchCase - Emits the necessary code to represent a single node in
-/// the binary search tree resulting from lowering a switch instruction.
-void SelectionDAGLowering::visitSwitchCase(SelectionDAGISel::CaseBlock &CB) {
- SDOperand Cond;
- SDOperand CondLHS = getValue(CB.CmpLHS);
-
- // Build the setcc now.
- if (CB.CmpMHS == NULL) {
- // Fold "(X == true)" to X and "(X == false)" to !X to
- // handle common cases produced by branch lowering.
- if (CB.CmpRHS == ConstantInt::getTrue() && CB.CC == ISD::SETEQ)
- Cond = CondLHS;
- else if (CB.CmpRHS == ConstantInt::getFalse() && CB.CC == ISD::SETEQ) {
- SDOperand True = DAG.getConstant(1, CondLHS.getValueType());
- Cond = DAG.getNode(ISD::XOR, CondLHS.getValueType(), CondLHS, True);
- } else
- Cond = DAG.getSetCC(MVT::i1, CondLHS, getValue(CB.CmpRHS), CB.CC);
- } else {
- assert(CB.CC == ISD::SETLE && "Can handle only LE ranges now");
-
- uint64_t Low = cast<ConstantInt>(CB.CmpLHS)->getSExtValue();
- uint64_t High = cast<ConstantInt>(CB.CmpRHS)->getSExtValue();
-
- SDOperand CmpOp = getValue(CB.CmpMHS);
- MVT::ValueType VT = CmpOp.getValueType();
-
- if (cast<ConstantInt>(CB.CmpLHS)->isMinValue(true)) {
- Cond = DAG.getSetCC(MVT::i1, CmpOp, DAG.getConstant(High, VT), ISD::SETLE);
- } else {
- SDOperand SUB = DAG.getNode(ISD::SUB, VT, CmpOp, DAG.getConstant(Low, VT));
- Cond = DAG.getSetCC(MVT::i1, SUB,
- DAG.getConstant(High-Low, VT), ISD::SETULE);
- }
-
- }
-
- // Set NextBlock to be the MBB immediately after the current one, if any.
- // This is used to avoid emitting unnecessary branches to the next block.
- MachineBasicBlock *NextBlock = 0;
- MachineFunction::iterator BBI = CurMBB;
- if (++BBI != CurMBB->getParent()->end())
- NextBlock = BBI;
-
- // If the lhs block is the next block, invert the condition so that we can
- // fall through to the lhs instead of the rhs block.
- if (CB.TrueBB == NextBlock) {
- std::swap(CB.TrueBB, CB.FalseBB);
- SDOperand True = DAG.getConstant(1, Cond.getValueType());
- Cond = DAG.getNode(ISD::XOR, Cond.getValueType(), Cond, True);
- }
- SDOperand BrCond = DAG.getNode(ISD::BRCOND, MVT::Other, getControlRoot(), Cond,
- DAG.getBasicBlock(CB.TrueBB));
- if (CB.FalseBB == NextBlock)
- DAG.setRoot(BrCond);
- else
- DAG.setRoot(DAG.getNode(ISD::BR, MVT::Other, BrCond,
- DAG.getBasicBlock(CB.FalseBB)));
- // Update successor info
- CurMBB->addSuccessor(CB.TrueBB);
- CurMBB->addSuccessor(CB.FalseBB);
-}
-
-/// visitJumpTable - Emit JumpTable node in the current MBB
-void SelectionDAGLowering::visitJumpTable(SelectionDAGISel::JumpTable &JT) {
- // Emit the code for the jump table
- assert(JT.Reg != -1U && "Should lower JT Header first!");
- MVT::ValueType PTy = TLI.getPointerTy();
- SDOperand Index = DAG.getCopyFromReg(getControlRoot(), JT.Reg, PTy);
- SDOperand Table = DAG.getJumpTable(JT.JTI, PTy);
- DAG.setRoot(DAG.getNode(ISD::BR_JT, MVT::Other, Index.getValue(1),
- Table, Index));
- return;
-}
-
-/// visitJumpTableHeader - This function emits necessary code to produce index
-/// in the JumpTable from switch case.
-void SelectionDAGLowering::visitJumpTableHeader(SelectionDAGISel::JumpTable &JT,
- SelectionDAGISel::JumpTableHeader &JTH) {
- // Subtract the lowest switch case value from the value being switched on
- // and conditional branch to default mbb if the result is greater than the
- // difference between smallest and largest cases.
- SDOperand SwitchOp = getValue(JTH.SValue);
- MVT::ValueType VT = SwitchOp.getValueType();
- SDOperand SUB = DAG.getNode(ISD::SUB, VT, SwitchOp,
- DAG.getConstant(JTH.First, VT));
-
- // The SDNode we just created, which holds the value being switched on
- // minus the the smallest case value, needs to be copied to a virtual
- // register so it can be used as an index into the jump table in a
- // subsequent basic block. This value may be smaller or larger than the
- // target's pointer type, and therefore require extension or truncating.
- if (MVT::getSizeInBits(VT) > MVT::getSizeInBits(TLI.getPointerTy()))
- SwitchOp = DAG.getNode(ISD::TRUNCATE, TLI.getPointerTy(), SUB);
- else
- SwitchOp = DAG.getNode(ISD::ZERO_EXTEND, TLI.getPointerTy(), SUB);
-
- unsigned JumpTableReg = FuncInfo.MakeReg(TLI.getPointerTy());
- SDOperand CopyTo = DAG.getCopyToReg(getControlRoot(), JumpTableReg, SwitchOp);
- JT.Reg = JumpTableReg;
-
- // Emit the range check for the jump table, and branch to the default
- // block for the switch statement if the value being switched on exceeds
- // the largest case in the switch.
- SDOperand CMP = DAG.getSetCC(TLI.getSetCCResultType(SUB), SUB,
- DAG.getConstant(JTH.Last-JTH.First,VT),
- ISD::SETUGT);
-
- // Set NextBlock to be the MBB immediately after the current one, if any.
- // This is used to avoid emitting unnecessary branches to the next block.
- MachineBasicBlock *NextBlock = 0;
- MachineFunction::iterator BBI = CurMBB;
- if (++BBI != CurMBB->getParent()->end())
- NextBlock = BBI;
-
- SDOperand BrCond = DAG.getNode(ISD::BRCOND, MVT::Other, CopyTo, CMP,
- DAG.getBasicBlock(JT.Default));
-
- if (JT.MBB == NextBlock)
- DAG.setRoot(BrCond);
- else
- DAG.setRoot(DAG.getNode(ISD::BR, MVT::Other, BrCond,
- DAG.getBasicBlock(JT.MBB)));
-
- return;
-}
-
-/// visitBitTestHeader - This function emits necessary code to produce value
-/// suitable for "bit tests"
-void SelectionDAGLowering::visitBitTestHeader(SelectionDAGISel::BitTestBlock &B) {
- // Subtract the minimum value
- SDOperand SwitchOp = getValue(B.SValue);
- MVT::ValueType VT = SwitchOp.getValueType();
- SDOperand SUB = DAG.getNode(ISD::SUB, VT, SwitchOp,
- DAG.getConstant(B.First, VT));
-
- // Check range
- SDOperand RangeCmp = DAG.getSetCC(TLI.getSetCCResultType(SUB), SUB,
- DAG.getConstant(B.Range, VT),
- ISD::SETUGT);
-
- SDOperand ShiftOp;
- if (MVT::getSizeInBits(VT) > MVT::getSizeInBits(TLI.getShiftAmountTy()))
- ShiftOp = DAG.getNode(ISD::TRUNCATE, TLI.getShiftAmountTy(), SUB);
- else
- ShiftOp = DAG.getNode(ISD::ZERO_EXTEND, TLI.getShiftAmountTy(), SUB);
-
- // Make desired shift
- SDOperand SwitchVal = DAG.getNode(ISD::SHL, TLI.getPointerTy(),
- DAG.getConstant(1, TLI.getPointerTy()),
- ShiftOp);
-
- unsigned SwitchReg = FuncInfo.MakeReg(TLI.getPointerTy());
- SDOperand CopyTo = DAG.getCopyToReg(getControlRoot(), SwitchReg, SwitchVal);
- B.Reg = SwitchReg;
-
- SDOperand BrRange = DAG.getNode(ISD::BRCOND, MVT::Other, CopyTo, RangeCmp,
- DAG.getBasicBlock(B.Default));
-
- // Set NextBlock to be the MBB immediately after the current one, if any.
- // This is used to avoid emitting unnecessary branches to the next block.
- MachineBasicBlock *NextBlock = 0;
- MachineFunction::iterator BBI = CurMBB;
- if (++BBI != CurMBB->getParent()->end())
- NextBlock = BBI;
-
- MachineBasicBlock* MBB = B.Cases[0].ThisBB;
- if (MBB == NextBlock)
- DAG.setRoot(BrRange);
- else
- DAG.setRoot(DAG.getNode(ISD::BR, MVT::Other, CopyTo,
- DAG.getBasicBlock(MBB)));
-
- CurMBB->addSuccessor(B.Default);
- CurMBB->addSuccessor(MBB);
-
- return;
-}
-
-/// visitBitTestCase - this function produces one "bit test"
-void SelectionDAGLowering::visitBitTestCase(MachineBasicBlock* NextMBB,
- unsigned Reg,
- SelectionDAGISel::BitTestCase &B) {
- // Emit bit tests and jumps
- SDOperand SwitchVal = DAG.getCopyFromReg(getControlRoot(), Reg, TLI.getPointerTy());
-
- SDOperand AndOp = DAG.getNode(ISD::AND, TLI.getPointerTy(),
- SwitchVal,
- DAG.getConstant(B.Mask,
- TLI.getPointerTy()));
- SDOperand AndCmp = DAG.getSetCC(TLI.getSetCCResultType(AndOp), AndOp,
- DAG.getConstant(0, TLI.getPointerTy()),
- ISD::SETNE);
- SDOperand BrAnd = DAG.getNode(ISD::BRCOND, MVT::Other, getControlRoot(),
- AndCmp, DAG.getBasicBlock(B.TargetBB));
-
- // Set NextBlock to be the MBB immediately after the current one, if any.
- // This is used to avoid emitting unnecessary branches to the next block.
- MachineBasicBlock *NextBlock = 0;
- MachineFunction::iterator BBI = CurMBB;
- if (++BBI != CurMBB->getParent()->end())
- NextBlock = BBI;
-
- if (NextMBB == NextBlock)
- DAG.setRoot(BrAnd);
- else
- DAG.setRoot(DAG.getNode(ISD::BR, MVT::Other, BrAnd,
- DAG.getBasicBlock(NextMBB)));
-
- CurMBB->addSuccessor(B.TargetBB);
- CurMBB->addSuccessor(NextMBB);
-
- return;
-}
-
-void SelectionDAGLowering::visitInvoke(InvokeInst &I) {
- // Retrieve successors.
- MachineBasicBlock *Return = FuncInfo.MBBMap[I.getSuccessor(0)];
- MachineBasicBlock *LandingPad = FuncInfo.MBBMap[I.getSuccessor(1)];
-
- if (isa<InlineAsm>(I.getCalledValue()))
- visitInlineAsm(&I);
- else
- LowerCallTo(&I, getValue(I.getOperand(0)), false, LandingPad);
-
- // If the value of the invoke is used outside of its defining block, make it
- // available as a virtual register.
- if (!I.use_empty()) {
- DenseMap<const Value*, unsigned>::iterator VMI = FuncInfo.ValueMap.find(&I);
- if (VMI != FuncInfo.ValueMap.end())
- CopyValueToVirtualRegister(&I, VMI->second);
- }
-
- // Drop into normal successor.
- DAG.setRoot(DAG.getNode(ISD::BR, MVT::Other, getControlRoot(),
- DAG.getBasicBlock(Return)));
-
- // Update successor info
- CurMBB->addSuccessor(Return);
- CurMBB->addSuccessor(LandingPad);
-}
-
-void SelectionDAGLowering::visitUnwind(UnwindInst &I) {
-}
-
-/// handleSmallSwitchCaseRange - Emit a series of specific tests (suitable for
-/// small case ranges).
-bool SelectionDAGLowering::handleSmallSwitchRange(CaseRec& CR,
- CaseRecVector& WorkList,
- Value* SV,
- MachineBasicBlock* Default) {
- Case& BackCase = *(CR.Range.second-1);
-
- // Size is the number of Cases represented by this range.
- unsigned Size = CR.Range.second - CR.Range.first;
- if (Size > 3)
- return false;
-
- // Get the MachineFunction which holds the current MBB. This is used when
- // inserting any additional MBBs necessary to represent the switch.
- MachineFunction *CurMF = CurMBB->getParent();
-
- // Figure out which block is immediately after the current one.
- MachineBasicBlock *NextBlock = 0;
- MachineFunction::iterator BBI = CR.CaseBB;
-
- if (++BBI != CurMBB->getParent()->end())
- NextBlock = BBI;
-
- // TODO: If any two of the cases has the same destination, and if one value
- // is the same as the other, but has one bit unset that the other has set,
- // use bit manipulation to do two compares at once. For example:
- // "if (X == 6 || X == 4)" -> "if ((X|2) == 6)"
-
- // Rearrange the case blocks so that the last one falls through if possible.
- if (NextBlock && Default != NextBlock && BackCase.BB != NextBlock) {
- // The last case block won't fall through into 'NextBlock' if we emit the
- // branches in this order. See if rearranging a case value would help.
- for (CaseItr I = CR.Range.first, E = CR.Range.second-1; I != E; ++I) {
- if (I->BB == NextBlock) {
- std::swap(*I, BackCase);
- break;
- }
- }
- }
-
- // Create a CaseBlock record representing a conditional branch to
- // the Case's target mbb if the value being switched on SV is equal
- // to C.
- MachineBasicBlock *CurBlock = CR.CaseBB;
- for (CaseItr I = CR.Range.first, E = CR.Range.second; I != E; ++I) {
- MachineBasicBlock *FallThrough;
- if (I != E-1) {
- FallThrough = new MachineBasicBlock(CurBlock->getBasicBlock());
- CurMF->getBasicBlockList().insert(BBI, FallThrough);
- } else {
- // If the last case doesn't match, go to the default block.
- FallThrough = Default;
- }
-
- Value *RHS, *LHS, *MHS;
- ISD::CondCode CC;
- if (I->High == I->Low) {
- // This is just small small case range :) containing exactly 1 case
- CC = ISD::SETEQ;
- LHS = SV; RHS = I->High; MHS = NULL;
- } else {
- CC = ISD::SETLE;
- LHS = I->Low; MHS = SV; RHS = I->High;
- }
- SelectionDAGISel::CaseBlock CB(CC, LHS, RHS, MHS,
- I->BB, FallThrough, CurBlock);
-
- // If emitting the first comparison, just call visitSwitchCase to emit the
- // code into the current block. Otherwise, push the CaseBlock onto the
- // vector to be later processed by SDISel, and insert the node's MBB
- // before the next MBB.
- if (CurBlock == CurMBB)
- visitSwitchCase(CB);
- else
- SwitchCases.push_back(CB);
-
- CurBlock = FallThrough;
- }
-
- return true;
-}
-
-static inline bool areJTsAllowed(const TargetLowering &TLI) {
- return (TLI.isOperationLegal(ISD::BR_JT, MVT::Other) ||
- TLI.isOperationLegal(ISD::BRIND, MVT::Other));
-}
-
-/// handleJTSwitchCase - Emit jumptable for current switch case range
-bool SelectionDAGLowering::handleJTSwitchCase(CaseRec& CR,
- CaseRecVector& WorkList,
- Value* SV,
- MachineBasicBlock* Default) {
- Case& FrontCase = *CR.Range.first;
- Case& BackCase = *(CR.Range.second-1);
-
- int64_t First = cast<ConstantInt>(FrontCase.Low)->getSExtValue();
- int64_t Last = cast<ConstantInt>(BackCase.High)->getSExtValue();
-
- uint64_t TSize = 0;
- for (CaseItr I = CR.Range.first, E = CR.Range.second;
- I!=E; ++I)
- TSize += I->size();
-
- if (!areJTsAllowed(TLI) || TSize <= 3)
- return false;
-
- double Density = (double)TSize / (double)((Last - First) + 1ULL);
- if (Density < 0.4)
- return false;
-
- DOUT << "Lowering jump table\n"
- << "First entry: " << First << ". Last entry: " << Last << "\n"
- << "Size: " << TSize << ". Density: " << Density << "\n\n";
-
- // Get the MachineFunction which holds the current MBB. This is used when
- // inserting any additional MBBs necessary to represent the switch.
- MachineFunction *CurMF = CurMBB->getParent();
-
- // Figure out which block is immediately after the current one.
- MachineBasicBlock *NextBlock = 0;
- MachineFunction::iterator BBI = CR.CaseBB;
-
- if (++BBI != CurMBB->getParent()->end())
- NextBlock = BBI;
-
- const BasicBlock *LLVMBB = CR.CaseBB->getBasicBlock();
-
- // Create a new basic block to hold the code for loading the address
- // of the jump table, and jumping to it. Update successor information;
- // we will either branch to the default case for the switch, or the jump
- // table.
- MachineBasicBlock *JumpTableBB = new MachineBasicBlock(LLVMBB);
- CurMF->getBasicBlockList().insert(BBI, JumpTableBB);
- CR.CaseBB->addSuccessor(Default);
- CR.CaseBB->addSuccessor(JumpTableBB);
-
- // Build a vector of destination BBs, corresponding to each target
- // of the jump table. If the value of the jump table slot corresponds to
- // a case statement, push the case's BB onto the vector, otherwise, push
- // the default BB.
- std::vector<MachineBasicBlock*> DestBBs;
- int64_t TEI = First;
- for (CaseItr I = CR.Range.first, E = CR.Range.second; I != E; ++TEI) {
- int64_t Low = cast<ConstantInt>(I->Low)->getSExtValue();
- int64_t High = cast<ConstantInt>(I->High)->getSExtValue();
-
- if ((Low <= TEI) && (TEI <= High)) {
- DestBBs.push_back(I->BB);
- if (TEI==High)
- ++I;
- } else {
- DestBBs.push_back(Default);
- }
- }
-
- // Update successor info. Add one edge to each unique successor.
- BitVector SuccsHandled(CR.CaseBB->getParent()->getNumBlockIDs());
- for (std::vector<MachineBasicBlock*>::iterator I = DestBBs.begin(),
- E = DestBBs.end(); I != E; ++I) {
- if (!SuccsHandled[(*I)->getNumber()]) {
- SuccsHandled[(*I)->getNumber()] = true;
- JumpTableBB->addSuccessor(*I);
- }
- }
-
- // Create a jump table index for this jump table, or return an existing
- // one.
- unsigned JTI = CurMF->getJumpTableInfo()->getJumpTableIndex(DestBBs);
-
- // Set the jump table information so that we can codegen it as a second
- // MachineBasicBlock
- SelectionDAGISel::JumpTable JT(-1U, JTI, JumpTableBB, Default);
- SelectionDAGISel::JumpTableHeader JTH(First, Last, SV, CR.CaseBB,
- (CR.CaseBB == CurMBB));
- if (CR.CaseBB == CurMBB)
- visitJumpTableHeader(JT, JTH);
-
- JTCases.push_back(SelectionDAGISel::JumpTableBlock(JTH, JT));
-
- return true;
-}
-
-/// handleBTSplitSwitchCase - emit comparison and split binary search tree into
-/// 2 subtrees.
-bool SelectionDAGLowering::handleBTSplitSwitchCase(CaseRec& CR,
- CaseRecVector& WorkList,
- Value* SV,
- MachineBasicBlock* Default) {
- // Get the MachineFunction which holds the current MBB. This is used when
- // inserting any additional MBBs necessary to represent the switch.
- MachineFunction *CurMF = CurMBB->getParent();
-
- // Figure out which block is immediately after the current one.
- MachineBasicBlock *NextBlock = 0;
- MachineFunction::iterator BBI = CR.CaseBB;
-
- if (++BBI != CurMBB->getParent()->end())
- NextBlock = BBI;
-
- Case& FrontCase = *CR.Range.first;
- Case& BackCase = *(CR.Range.second-1);
- const BasicBlock *LLVMBB = CR.CaseBB->getBasicBlock();
-
- // Size is the number of Cases represented by this range.
- unsigned Size = CR.Range.second - CR.Range.first;
-
- int64_t First = cast<ConstantInt>(FrontCase.Low)->getSExtValue();
- int64_t Last = cast<ConstantInt>(BackCase.High)->getSExtValue();
- double FMetric = 0;
- CaseItr Pivot = CR.Range.first + Size/2;
-
- // Select optimal pivot, maximizing sum density of LHS and RHS. This will
- // (heuristically) allow us to emit JumpTable's later.
- uint64_t TSize = 0;
- for (CaseItr I = CR.Range.first, E = CR.Range.second;
- I!=E; ++I)
- TSize += I->size();
-
- uint64_t LSize = FrontCase.size();
- uint64_t RSize = TSize-LSize;
- DOUT << "Selecting best pivot: \n"
- << "First: " << First << ", Last: " << Last <<"\n"
- << "LSize: " << LSize << ", RSize: " << RSize << "\n";
- for (CaseItr I = CR.Range.first, J=I+1, E = CR.Range.second;
- J!=E; ++I, ++J) {
- int64_t LEnd = cast<ConstantInt>(I->High)->getSExtValue();
- int64_t RBegin = cast<ConstantInt>(J->Low)->getSExtValue();
- assert((RBegin-LEnd>=1) && "Invalid case distance");
- double LDensity = (double)LSize / (double)((LEnd - First) + 1ULL);
- double RDensity = (double)RSize / (double)((Last - RBegin) + 1ULL);
- double Metric = Log2_64(RBegin-LEnd)*(LDensity+RDensity);
- // Should always split in some non-trivial place
- DOUT <<"=>Step\n"
- << "LEnd: " << LEnd << ", RBegin: " << RBegin << "\n"
- << "LDensity: " << LDensity << ", RDensity: " << RDensity << "\n"
- << "Metric: " << Metric << "\n";
- if (FMetric < Metric) {
- Pivot = J;
- FMetric = Metric;
- DOUT << "Current metric set to: " << FMetric << "\n";
- }
-
- LSize += J->size();
- RSize -= J->size();
- }
- if (areJTsAllowed(TLI)) {
- // If our case is dense we *really* should handle it earlier!
- assert((FMetric > 0) && "Should handle dense range earlier!");
- } else {
- Pivot = CR.Range.first + Size/2;
- }
-
- CaseRange LHSR(CR.Range.first, Pivot);
- CaseRange RHSR(Pivot, CR.Range.second);
- Constant *C = Pivot->Low;
- MachineBasicBlock *FalseBB = 0, *TrueBB = 0;
-
- // We know that we branch to the LHS if the Value being switched on is
- // less than the Pivot value, C. We use this to optimize our binary
- // tree a bit, by recognizing that if SV is greater than or equal to the
- // LHS's Case Value, and that Case Value is exactly one less than the
- // Pivot's Value, then we can branch directly to the LHS's Target,
- // rather than creating a leaf node for it.
- if ((LHSR.second - LHSR.first) == 1 &&
- LHSR.first->High == CR.GE &&
- cast<ConstantInt>(C)->getSExtValue() ==
- (cast<ConstantInt>(CR.GE)->getSExtValue() + 1LL)) {
- TrueBB = LHSR.first->BB;
- } else {
- TrueBB = new MachineBasicBlock(LLVMBB);
- CurMF->getBasicBlockList().insert(BBI, TrueBB);
- WorkList.push_back(CaseRec(TrueBB, C, CR.GE, LHSR));
- }
-
- // Similar to the optimization above, if the Value being switched on is
- // known to be less than the Constant CR.LT, and the current Case Value
- // is CR.LT - 1, then we can branch directly to the target block for
- // the current Case Value, rather than emitting a RHS leaf node for it.
- if ((RHSR.second - RHSR.first) == 1 && CR.LT &&
- cast<ConstantInt>(RHSR.first->Low)->getSExtValue() ==
- (cast<ConstantInt>(CR.LT)->getSExtValue() - 1LL)) {
- FalseBB = RHSR.first->BB;
- } else {
- FalseBB = new MachineBasicBlock(LLVMBB);
- CurMF->getBasicBlockList().insert(BBI, FalseBB);
- WorkList.push_back(CaseRec(FalseBB,CR.LT,C,RHSR));
- }
-
- // Create a CaseBlock record representing a conditional branch to
- // the LHS node if the value being switched on SV is less than C.
- // Otherwise, branch to LHS.
- SelectionDAGISel::CaseBlock CB(ISD::SETLT, SV, C, NULL,
- TrueBB, FalseBB, CR.CaseBB);
-
- if (CR.CaseBB == CurMBB)
- visitSwitchCase(CB);
- else
- SwitchCases.push_back(CB);
-
- return true;
-}
-
-/// handleBitTestsSwitchCase - if current case range has few destination and
-/// range span less, than machine word bitwidth, encode case range into series
-/// of masks and emit bit tests with these masks.
-bool SelectionDAGLowering::handleBitTestsSwitchCase(CaseRec& CR,
- CaseRecVector& WorkList,
- Value* SV,
- MachineBasicBlock* Default){
- unsigned IntPtrBits = MVT::getSizeInBits(TLI.getPointerTy());
-
- Case& FrontCase = *CR.Range.first;
- Case& BackCase = *(CR.Range.second-1);
-
- // Get the MachineFunction which holds the current MBB. This is used when
- // inserting any additional MBBs necessary to represent the switch.
- MachineFunction *CurMF = CurMBB->getParent();
-
- unsigned numCmps = 0;
- for (CaseItr I = CR.Range.first, E = CR.Range.second;
- I!=E; ++I) {
- // Single case counts one, case range - two.
- if (I->Low == I->High)
- numCmps +=1;
- else
- numCmps +=2;
- }
-
- // Count unique destinations
- SmallSet<MachineBasicBlock*, 4> Dests;
- for (CaseItr I = CR.Range.first, E = CR.Range.second; I!=E; ++I) {
- Dests.insert(I->BB);
- if (Dests.size() > 3)
- // Don't bother the code below, if there are too much unique destinations
- return false;
- }
- DOUT << "Total number of unique destinations: " << Dests.size() << "\n"
- << "Total number of comparisons: " << numCmps << "\n";
-
- // Compute span of values.
- Constant* minValue = FrontCase.Low;
- Constant* maxValue = BackCase.High;
- uint64_t range = cast<ConstantInt>(maxValue)->getSExtValue() -
- cast<ConstantInt>(minValue)->getSExtValue();
- DOUT << "Compare range: " << range << "\n"
- << "Low bound: " << cast<ConstantInt>(minValue)->getSExtValue() << "\n"
- << "High bound: " << cast<ConstantInt>(maxValue)->getSExtValue() << "\n";
-
- if (range>=IntPtrBits ||
- (!(Dests.size() == 1 && numCmps >= 3) &&
- !(Dests.size() == 2 && numCmps >= 5) &&
- !(Dests.size() >= 3 && numCmps >= 6)))
- return false;
-
- DOUT << "Emitting bit tests\n";
- int64_t lowBound = 0;
-
- // Optimize the case where all the case values fit in a
- // word without having to subtract minValue. In this case,
- // we can optimize away the subtraction.
- if (cast<ConstantInt>(minValue)->getSExtValue() >= 0 &&
- cast<ConstantInt>(maxValue)->getSExtValue() < IntPtrBits) {
- range = cast<ConstantInt>(maxValue)->getSExtValue();
- } else {
- lowBound = cast<ConstantInt>(minValue)->getSExtValue();
- }
-
- CaseBitsVector CasesBits;
- unsigned i, count = 0;
-
- for (CaseItr I = CR.Range.first, E = CR.Range.second; I!=E; ++I) {
- MachineBasicBlock* Dest = I->BB;
- for (i = 0; i < count; ++i)
- if (Dest == CasesBits[i].BB)
- break;
-
- if (i == count) {
- assert((count < 3) && "Too much destinations to test!");
- CasesBits.push_back(CaseBits(0, Dest, 0));
- count++;
- }
-
- uint64_t lo = cast<ConstantInt>(I->Low)->getSExtValue() - lowBound;
- uint64_t hi = cast<ConstantInt>(I->High)->getSExtValue() - lowBound;
-
- for (uint64_t j = lo; j <= hi; j++) {
- CasesBits[i].Mask |= 1ULL << j;
- CasesBits[i].Bits++;
- }
-
- }
- std::sort(CasesBits.begin(), CasesBits.end(), CaseBitsCmp());
-
- SelectionDAGISel::BitTestInfo BTC;
-
- // Figure out which block is immediately after the current one.
- MachineFunction::iterator BBI = CR.CaseBB;
- ++BBI;
-
- const BasicBlock *LLVMBB = CR.CaseBB->getBasicBlock();
-
- DOUT << "Cases:\n";
- for (unsigned i = 0, e = CasesBits.size(); i!=e; ++i) {
- DOUT << "Mask: " << CasesBits[i].Mask << ", Bits: " << CasesBits[i].Bits
- << ", BB: " << CasesBits[i].BB << "\n";
-
- MachineBasicBlock *CaseBB = new MachineBasicBlock(LLVMBB);
- CurMF->getBasicBlockList().insert(BBI, CaseBB);
- BTC.push_back(SelectionDAGISel::BitTestCase(CasesBits[i].Mask,
- CaseBB,
- CasesBits[i].BB));
- }
-
- SelectionDAGISel::BitTestBlock BTB(lowBound, range, SV,
- -1U, (CR.CaseBB == CurMBB),
- CR.CaseBB, Default, BTC);
-
- if (CR.CaseBB == CurMBB)
- visitBitTestHeader(BTB);
-
- BitTestCases.push_back(BTB);
-
- return true;
-}
-
-
-/// Clusterify - Transform simple list of Cases into list of CaseRange's
-unsigned SelectionDAGLowering::Clusterify(CaseVector& Cases,
- const SwitchInst& SI) {
- unsigned numCmps = 0;
-
- // Start with "simple" cases
- for (unsigned i = 1; i < SI.getNumSuccessors(); ++i) {
- MachineBasicBlock *SMBB = FuncInfo.MBBMap[SI.getSuccessor(i)];
- Cases.push_back(Case(SI.getSuccessorValue(i),
- SI.getSuccessorValue(i),
- SMBB));
- }
- std::sort(Cases.begin(), Cases.end(), CaseCmp());
-
- // Merge case into clusters
- if (Cases.size()>=2)
- // Must recompute end() each iteration because it may be
- // invalidated by erase if we hold on to it
- for (CaseItr I=Cases.begin(), J=++(Cases.begin()); J!=Cases.end(); ) {
- int64_t nextValue = cast<ConstantInt>(J->Low)->getSExtValue();
- int64_t currentValue = cast<ConstantInt>(I->High)->getSExtValue();
- MachineBasicBlock* nextBB = J->BB;
- MachineBasicBlock* currentBB = I->BB;
-
- // If the two neighboring cases go to the same destination, merge them
- // into a single case.
- if ((nextValue-currentValue==1) && (currentBB == nextBB)) {
- I->High = J->High;
- J = Cases.erase(J);
- } else {
- I = J++;
- }
- }
-
- for (CaseItr I=Cases.begin(), E=Cases.end(); I!=E; ++I, ++numCmps) {
- if (I->Low != I->High)
- // A range counts double, since it requires two compares.
- ++numCmps;
- }
-
- return numCmps;
-}
-
-void SelectionDAGLowering::visitSwitch(SwitchInst &SI) {
- // Figure out which block is immediately after the current one.
- MachineBasicBlock *NextBlock = 0;
- MachineFunction::iterator BBI = CurMBB;
-
- MachineBasicBlock *Default = FuncInfo.MBBMap[SI.getDefaultDest()];
-
- // If there is only the default destination, branch to it if it is not the
- // next basic block. Otherwise, just fall through.
- if (SI.getNumOperands() == 2) {
- // Update machine-CFG edges.
-
- // If this is not a fall-through branch, emit the branch.
- if (Default != NextBlock)
- DAG.setRoot(DAG.getNode(ISD::BR, MVT::Other, getControlRoot(),
- DAG.getBasicBlock(Default)));
-
- CurMBB->addSuccessor(Default);
- return;
- }
-
- // If there are any non-default case statements, create a vector of Cases
- // representing each one, and sort the vector so that we can efficiently
- // create a binary search tree from them.
- CaseVector Cases;
- unsigned numCmps = Clusterify(Cases, SI);
- DOUT << "Clusterify finished. Total clusters: " << Cases.size()
- << ". Total compares: " << numCmps << "\n";
-
- // Get the Value to be switched on and default basic blocks, which will be
- // inserted into CaseBlock records, representing basic blocks in the binary
- // search tree.
- Value *SV = SI.getOperand(0);
-
- // Push the initial CaseRec onto the worklist
- CaseRecVector WorkList;
- WorkList.push_back(CaseRec(CurMBB,0,0,CaseRange(Cases.begin(),Cases.end())));
-
- while (!WorkList.empty()) {
- // Grab a record representing a case range to process off the worklist
- CaseRec CR = WorkList.back();
- WorkList.pop_back();
-
- if (handleBitTestsSwitchCase(CR, WorkList, SV, Default))
- continue;
-
- // If the range has few cases (two or less) emit a series of specific
- // tests.
- if (handleSmallSwitchRange(CR, WorkList, SV, Default))
- continue;
-
- // If the switch has more than 5 blocks, and at least 40% dense, and the
- // target supports indirect branches, then emit a jump table rather than
- // lowering the switch to a binary tree of conditional branches.
- if (handleJTSwitchCase(CR, WorkList, SV, Default))
- continue;
-
- // Emit binary tree. We need to pick a pivot, and push left and right ranges
- // onto the worklist. Leafs are handled via handleSmallSwitchRange() call.
- handleBTSplitSwitchCase(CR, WorkList, SV, Default);
- }
-}
-
-
-void SelectionDAGLowering::visitSub(User &I) {
- // -0.0 - X --> fneg
- const Type *Ty = I.getType();
- if (isa<VectorType>(Ty)) {
- if (ConstantVector *CV = dyn_cast<ConstantVector>(I.getOperand(0))) {
- const VectorType *DestTy = cast<VectorType>(I.getType());
- const Type *ElTy = DestTy->getElementType();
- if (ElTy->isFloatingPoint()) {
- unsigned VL = DestTy->getNumElements();
- std::vector<Constant*> NZ(VL, ConstantFP::getNegativeZero(ElTy));
- Constant *CNZ = ConstantVector::get(&NZ[0], NZ.size());
- if (CV == CNZ) {
- SDOperand Op2 = getValue(I.getOperand(1));
- setValue(&I, DAG.getNode(ISD::FNEG, Op2.getValueType(), Op2));
- return;
- }
- }
- }
- }
- if (Ty->isFloatingPoint()) {
- if (ConstantFP *CFP = dyn_cast<ConstantFP>(I.getOperand(0)))
- if (CFP->isExactlyValue(ConstantFP::getNegativeZero(Ty)->getValueAPF())) {
- SDOperand Op2 = getValue(I.getOperand(1));
- setValue(&I, DAG.getNode(ISD::FNEG, Op2.getValueType(), Op2));
- return;
- }
- }
-
- visitBinary(I, Ty->isFPOrFPVector() ? ISD::FSUB : ISD::SUB);
-}
-
-void SelectionDAGLowering::visitBinary(User &I, unsigned OpCode) {
- SDOperand Op1 = getValue(I.getOperand(0));
- SDOperand Op2 = getValue(I.getOperand(1));
-
- setValue(&I, DAG.getNode(OpCode, Op1.getValueType(), Op1, Op2));
-}
-
-void SelectionDAGLowering::visitShift(User &I, unsigned Opcode) {
- SDOperand Op1 = getValue(I.getOperand(0));
- SDOperand Op2 = getValue(I.getOperand(1));
-
- if (MVT::getSizeInBits(TLI.getShiftAmountTy()) <
- MVT::getSizeInBits(Op2.getValueType()))
- Op2 = DAG.getNode(ISD::TRUNCATE, TLI.getShiftAmountTy(), Op2);
- else if (TLI.getShiftAmountTy() > Op2.getValueType())
- Op2 = DAG.getNode(ISD::ANY_EXTEND, TLI.getShiftAmountTy(), Op2);
-
- setValue(&I, DAG.getNode(Opcode, Op1.getValueType(), Op1, Op2));
-}
-
-void SelectionDAGLowering::visitICmp(User &I) {
- ICmpInst::Predicate predicate = ICmpInst::BAD_ICMP_PREDICATE;
- if (ICmpInst *IC = dyn_cast<ICmpInst>(&I))
- predicate = IC->getPredicate();
- else if (ConstantExpr *IC = dyn_cast<ConstantExpr>(&I))
- predicate = ICmpInst::Predicate(IC->getPredicate());
- SDOperand Op1 = getValue(I.getOperand(0));
- SDOperand Op2 = getValue(I.getOperand(1));
- ISD::CondCode Opcode;
- switch (predicate) {
- case ICmpInst::ICMP_EQ : Opcode = ISD::SETEQ; break;
- case ICmpInst::ICMP_NE : Opcode = ISD::SETNE; break;
- case ICmpInst::ICMP_UGT : Opcode = ISD::SETUGT; break;
- case ICmpInst::ICMP_UGE : Opcode = ISD::SETUGE; break;
- case ICmpInst::ICMP_ULT : Opcode = ISD::SETULT; break;
- case ICmpInst::ICMP_ULE : Opcode = ISD::SETULE; break;
- case ICmpInst::ICMP_SGT : Opcode = ISD::SETGT; break;
- case ICmpInst::ICMP_SGE : Opcode = ISD::SETGE; break;
- case ICmpInst::ICMP_SLT : Opcode = ISD::SETLT; break;
- case ICmpInst::ICMP_SLE : Opcode = ISD::SETLE; break;
- default:
- assert(!"Invalid ICmp predicate value");
- Opcode = ISD::SETEQ;
- break;
- }
- setValue(&I, DAG.getSetCC(MVT::i1, Op1, Op2, Opcode));
-}
-
-void SelectionDAGLowering::visitFCmp(User &I) {
- FCmpInst::Predicate predicate = FCmpInst::BAD_FCMP_PREDICATE;
- if (FCmpInst *FC = dyn_cast<FCmpInst>(&I))
- predicate = FC->getPredicate();
- else if (ConstantExpr *FC = dyn_cast<ConstantExpr>(&I))
- predicate = FCmpInst::Predicate(FC->getPredicate());
- SDOperand Op1 = getValue(I.getOperand(0));
- SDOperand Op2 = getValue(I.getOperand(1));
- ISD::CondCode Condition, FOC, FPC;
- switch (predicate) {
- case FCmpInst::FCMP_FALSE: FOC = FPC = ISD::SETFALSE; break;
- case FCmpInst::FCMP_OEQ: FOC = ISD::SETEQ; FPC = ISD::SETOEQ; break;
- case FCmpInst::FCMP_OGT: FOC = ISD::SETGT; FPC = ISD::SETOGT; break;
- case FCmpInst::FCMP_OGE: FOC = ISD::SETGE; FPC = ISD::SETOGE; break;
- case FCmpInst::FCMP_OLT: FOC = ISD::SETLT; FPC = ISD::SETOLT; break;
- case FCmpInst::FCMP_OLE: FOC = ISD::SETLE; FPC = ISD::SETOLE; break;
- case FCmpInst::FCMP_ONE: FOC = ISD::SETNE; FPC = ISD::SETONE; break;
- case FCmpInst::FCMP_ORD: FOC = FPC = ISD::SETO; break;
- case FCmpInst::FCMP_UNO: FOC = FPC = ISD::SETUO; break;
- case FCmpInst::FCMP_UEQ: FOC = ISD::SETEQ; FPC = ISD::SETUEQ; break;
- case FCmpInst::FCMP_UGT: FOC = ISD::SETGT; FPC = ISD::SETUGT; break;
- case FCmpInst::FCMP_UGE: FOC = ISD::SETGE; FPC = ISD::SETUGE; break;
- case FCmpInst::FCMP_ULT: FOC = ISD::SETLT; FPC = ISD::SETULT; break;
- case FCmpInst::FCMP_ULE: FOC = ISD::SETLE; FPC = ISD::SETULE; break;
- case FCmpInst::FCMP_UNE: FOC = ISD::SETNE; FPC = ISD::SETUNE; break;
- case FCmpInst::FCMP_TRUE: FOC = FPC = ISD::SETTRUE; break;
- default:
- assert(!"Invalid FCmp predicate value");
- FOC = FPC = ISD::SETFALSE;
- break;
- }
- if (FiniteOnlyFPMath())
- Condition = FOC;
- else
- Condition = FPC;
- setValue(&I, DAG.getSetCC(MVT::i1, Op1, Op2, Condition));
-}
-
-void SelectionDAGLowering::visitSelect(User &I) {
- SDOperand Cond = getValue(I.getOperand(0));
- SDOperand TrueVal = getValue(I.getOperand(1));
- SDOperand FalseVal = getValue(I.getOperand(2));
- setValue(&I, DAG.getNode(ISD::SELECT, TrueVal.getValueType(), Cond,
- TrueVal, FalseVal));
-}
-
-
-void SelectionDAGLowering::visitTrunc(User &I) {
- // TruncInst cannot be a no-op cast because sizeof(src) > sizeof(dest).
- SDOperand N = getValue(I.getOperand(0));
- MVT::ValueType DestVT = TLI.getValueType(I.getType());
- setValue(&I, DAG.getNode(ISD::TRUNCATE, DestVT, N));
-}
-
-void SelectionDAGLowering::visitZExt(User &I) {
- // ZExt cannot be a no-op cast because sizeof(src) < sizeof(dest).
- // ZExt also can't be a cast to bool for same reason. So, nothing much to do
- SDOperand N = getValue(I.getOperand(0));
- MVT::ValueType DestVT = TLI.getValueType(I.getType());
- setValue(&I, DAG.getNode(ISD::ZERO_EXTEND, DestVT, N));
-}
-
-void SelectionDAGLowering::visitSExt(User &I) {
- // SExt cannot be a no-op cast because sizeof(src) < sizeof(dest).
- // SExt also can't be a cast to bool for same reason. So, nothing much to do
- SDOperand N = getValue(I.getOperand(0));
- MVT::ValueType DestVT = TLI.getValueType(I.getType());
- setValue(&I, DAG.getNode(ISD::SIGN_EXTEND, DestVT, N));
-}
-
-void SelectionDAGLowering::visitFPTrunc(User &I) {
- // FPTrunc is never a no-op cast, no need to check
- SDOperand N = getValue(I.getOperand(0));
- MVT::ValueType DestVT = TLI.getValueType(I.getType());
- setValue(&I, DAG.getNode(ISD::FP_ROUND, DestVT, N, DAG.getIntPtrConstant(0)));
-}
-
-void SelectionDAGLowering::visitFPExt(User &I){
- // FPTrunc is never a no-op cast, no need to check
- SDOperand N = getValue(I.getOperand(0));
- MVT::ValueType DestVT = TLI.getValueType(I.getType());
- setValue(&I, DAG.getNode(ISD::FP_EXTEND, DestVT, N));
-}
-
-void SelectionDAGLowering::visitFPToUI(User &I) {
- // FPToUI is never a no-op cast, no need to check
- SDOperand N = getValue(I.getOperand(0));
- MVT::ValueType DestVT = TLI.getValueType(I.getType());
- setValue(&I, DAG.getNode(ISD::FP_TO_UINT, DestVT, N));
-}
-
-void SelectionDAGLowering::visitFPToSI(User &I) {
- // FPToSI is never a no-op cast, no need to check
- SDOperand N = getValue(I.getOperand(0));
- MVT::ValueType DestVT = TLI.getValueType(I.getType());
- setValue(&I, DAG.getNode(ISD::FP_TO_SINT, DestVT, N));
-}
-
-void SelectionDAGLowering::visitUIToFP(User &I) {
- // UIToFP is never a no-op cast, no need to check
- SDOperand N = getValue(I.getOperand(0));
- MVT::ValueType DestVT = TLI.getValueType(I.getType());
- setValue(&I, DAG.getNode(ISD::UINT_TO_FP, DestVT, N));
-}
-
-void SelectionDAGLowering::visitSIToFP(User &I){
- // UIToFP is never a no-op cast, no need to check
- SDOperand N = getValue(I.getOperand(0));
- MVT::ValueType DestVT = TLI.getValueType(I.getType());
- setValue(&I, DAG.getNode(ISD::SINT_TO_FP, DestVT, N));
-}
-
-void SelectionDAGLowering::visitPtrToInt(User &I) {
- // What to do depends on the size of the integer and the size of the pointer.
- // We can either truncate, zero extend, or no-op, accordingly.
- SDOperand N = getValue(I.getOperand(0));
- MVT::ValueType SrcVT = N.getValueType();
- MVT::ValueType DestVT = TLI.getValueType(I.getType());
- SDOperand Result;
- if (MVT::getSizeInBits(DestVT) < MVT::getSizeInBits(SrcVT))
- Result = DAG.getNode(ISD::TRUNCATE, DestVT, N);
- else
- // Note: ZERO_EXTEND can handle cases where the sizes are equal too
- Result = DAG.getNode(ISD::ZERO_EXTEND, DestVT, N);
- setValue(&I, Result);
-}
-
-void SelectionDAGLowering::visitIntToPtr(User &I) {
- // What to do depends on the size of the integer and the size of the pointer.
- // We can either truncate, zero extend, or no-op, accordingly.
- SDOperand N = getValue(I.getOperand(0));
- MVT::ValueType SrcVT = N.getValueType();
- MVT::ValueType DestVT = TLI.getValueType(I.getType());
- if (MVT::getSizeInBits(DestVT) < MVT::getSizeInBits(SrcVT))
- setValue(&I, DAG.getNode(ISD::TRUNCATE, DestVT, N));
- else
- // Note: ZERO_EXTEND can handle cases where the sizes are equal too
- setValue(&I, DAG.getNode(ISD::ZERO_EXTEND, DestVT, N));
-}
-
-void SelectionDAGLowering::visitBitCast(User &I) {
- SDOperand N = getValue(I.getOperand(0));
- MVT::ValueType DestVT = TLI.getValueType(I.getType());
-
- // BitCast assures us that source and destination are the same size so this
- // is either a BIT_CONVERT or a no-op.
- if (DestVT != N.getValueType())
- setValue(&I, DAG.getNode(ISD::BIT_CONVERT, DestVT, N)); // convert types
- else
- setValue(&I, N); // noop cast.
-}
-
-void SelectionDAGLowering::visitInsertElement(User &I) {
- SDOperand InVec = getValue(I.getOperand(0));
- SDOperand InVal = getValue(I.getOperand(1));
- SDOperand InIdx = DAG.getNode(ISD::ZERO_EXTEND, TLI.getPointerTy(),
- getValue(I.getOperand(2)));
-
- setValue(&I, DAG.getNode(ISD::INSERT_VECTOR_ELT,
- TLI.getValueType(I.getType()),
- InVec, InVal, InIdx));
-}
-
-void SelectionDAGLowering::visitExtractElement(User &I) {
- SDOperand InVec = getValue(I.getOperand(0));
- SDOperand InIdx = DAG.getNode(ISD::ZERO_EXTEND, TLI.getPointerTy(),
- getValue(I.getOperand(1)));
- setValue(&I, DAG.getNode(ISD::EXTRACT_VECTOR_ELT,
- TLI.getValueType(I.getType()), InVec, InIdx));
-}
-
-void SelectionDAGLowering::visitShuffleVector(User &I) {
- SDOperand V1 = getValue(I.getOperand(0));
- SDOperand V2 = getValue(I.getOperand(1));
- SDOperand Mask = getValue(I.getOperand(2));
-
- setValue(&I, DAG.getNode(ISD::VECTOR_SHUFFLE,
- TLI.getValueType(I.getType()),
- V1, V2, Mask));
-}
-
-
-void SelectionDAGLowering::visitGetElementPtr(User &I) {
- SDOperand N = getValue(I.getOperand(0));
- const Type *Ty = I.getOperand(0)->getType();
-
- for (GetElementPtrInst::op_iterator OI = I.op_begin()+1, E = I.op_end();
- OI != E; ++OI) {
- Value *Idx = *OI;
- if (const StructType *StTy = dyn_cast<StructType>(Ty)) {
- unsigned Field = cast<ConstantInt>(Idx)->getZExtValue();
- if (Field) {
- // N = N + Offset
- uint64_t Offset = TD->getStructLayout(StTy)->getElementOffset(Field);
- N = DAG.getNode(ISD::ADD, N.getValueType(), N,
- DAG.getIntPtrConstant(Offset));
- }
- Ty = StTy->getElementType(Field);
- } else {
- Ty = cast<SequentialType>(Ty)->getElementType();
-
- // If this is a constant subscript, handle it quickly.
- if (ConstantInt *CI = dyn_cast<ConstantInt>(Idx)) {
- if (CI->getZExtValue() == 0) continue;
- uint64_t Offs =
- TD->getABITypeSize(Ty)*cast<ConstantInt>(CI)->getSExtValue();
- N = DAG.getNode(ISD::ADD, N.getValueType(), N,
- DAG.getIntPtrConstant(Offs));
- continue;
- }
-
- // N = N + Idx * ElementSize;
- uint64_t ElementSize = TD->getABITypeSize(Ty);
- SDOperand IdxN = getValue(Idx);
-
- // If the index is smaller or larger than intptr_t, truncate or extend
- // it.
- if (IdxN.getValueType() < N.getValueType()) {
- IdxN = DAG.getNode(ISD::SIGN_EXTEND, N.getValueType(), IdxN);
- } else if (IdxN.getValueType() > N.getValueType())
- IdxN = DAG.getNode(ISD::TRUNCATE, N.getValueType(), IdxN);
-
- // If this is a multiply by a power of two, turn it into a shl
- // immediately. This is a very common case.
- if (isPowerOf2_64(ElementSize)) {
- unsigned Amt = Log2_64(ElementSize);
- IdxN = DAG.getNode(ISD::SHL, N.getValueType(), IdxN,
- DAG.getConstant(Amt, TLI.getShiftAmountTy()));
- N = DAG.getNode(ISD::ADD, N.getValueType(), N, IdxN);
- continue;
- }
-
- SDOperand Scale = DAG.getIntPtrConstant(ElementSize);
- IdxN = DAG.getNode(ISD::MUL, N.getValueType(), IdxN, Scale);
- N = DAG.getNode(ISD::ADD, N.getValueType(), N, IdxN);
- }
- }
- setValue(&I, N);
-}
-
-void SelectionDAGLowering::visitAlloca(AllocaInst &I) {
- // If this is a fixed sized alloca in the entry block of the function,
- // allocate it statically on the stack.
- if (FuncInfo.StaticAllocaMap.count(&I))
- return; // getValue will auto-populate this.
-
- const Type *Ty = I.getAllocatedType();
- uint64_t TySize = TLI.getTargetData()->getABITypeSize(Ty);
- unsigned Align =
- std::max((unsigned)TLI.getTargetData()->getPrefTypeAlignment(Ty),
- I.getAlignment());
-
- SDOperand AllocSize = getValue(I.getArraySize());
- MVT::ValueType IntPtr = TLI.getPointerTy();
- if (IntPtr < AllocSize.getValueType())
- AllocSize = DAG.getNode(ISD::TRUNCATE, IntPtr, AllocSize);
- else if (IntPtr > AllocSize.getValueType())
- AllocSize = DAG.getNode(ISD::ZERO_EXTEND, IntPtr, AllocSize);
-
- AllocSize = DAG.getNode(ISD::MUL, IntPtr, AllocSize,
- DAG.getIntPtrConstant(TySize));
-
- // Handle alignment. If the requested alignment is less than or equal to
- // the stack alignment, ignore it. If the size is greater than or equal to
- // the stack alignment, we note this in the DYNAMIC_STACKALLOC node.
- unsigned StackAlign =
- TLI.getTargetMachine().getFrameInfo()->getStackAlignment();
- if (Align <= StackAlign)
- Align = 0;
-
- // Round the size of the allocation up to the stack alignment size
- // by add SA-1 to the size.
- AllocSize = DAG.getNode(ISD::ADD, AllocSize.getValueType(), AllocSize,
- DAG.getIntPtrConstant(StackAlign-1));
- // Mask out the low bits for alignment purposes.
- AllocSize = DAG.getNode(ISD::AND, AllocSize.getValueType(), AllocSize,
- DAG.getIntPtrConstant(~(uint64_t)(StackAlign-1)));
-
- SDOperand Ops[] = { getRoot(), AllocSize, DAG.getIntPtrConstant(Align) };
- const MVT::ValueType *VTs = DAG.getNodeValueTypes(AllocSize.getValueType(),
- MVT::Other);
- SDOperand DSA = DAG.getNode(ISD::DYNAMIC_STACKALLOC, VTs, 2, Ops, 3);
- setValue(&I, DSA);
- DAG.setRoot(DSA.getValue(1));
-
- // Inform the Frame Information that we have just allocated a variable-sized
- // object.
- CurMBB->getParent()->getFrameInfo()->CreateVariableSizedObject();
-}
-
-void SelectionDAGLowering::visitLoad(LoadInst &I) {
- SDOperand Ptr = getValue(I.getOperand(0));
-
- SDOperand Root;
- if (I.isVolatile())
- Root = getRoot();
- else {
- // Do not serialize non-volatile loads against each other.
- Root = DAG.getRoot();
- }
-
- setValue(&I, getLoadFrom(I.getType(), Ptr, I.getOperand(0),
- Root, I.isVolatile(), I.getAlignment()));
-}
-
-SDOperand SelectionDAGLowering::getLoadFrom(const Type *Ty, SDOperand Ptr,
- const Value *SV, SDOperand Root,
- bool isVolatile,
- unsigned Alignment) {
- SDOperand L =
- DAG.getLoad(TLI.getValueType(Ty), Root, Ptr, SV, 0,
- isVolatile, Alignment);
-
- if (isVolatile)
- DAG.setRoot(L.getValue(1));
- else
- PendingLoads.push_back(L.getValue(1));
-
- return L;
-}
-
-
-void SelectionDAGLowering::visitStore(StoreInst &I) {
- Value *SrcV = I.getOperand(0);
- SDOperand Src = getValue(SrcV);
- SDOperand Ptr = getValue(I.getOperand(1));
- DAG.setRoot(DAG.getStore(getRoot(), Src, Ptr, I.getOperand(1), 0,
- I.isVolatile(), I.getAlignment()));
-}
-
-/// visitTargetIntrinsic - Lower a call of a target intrinsic to an INTRINSIC
-/// node.
-void SelectionDAGLowering::visitTargetIntrinsic(CallInst &I,
- unsigned Intrinsic) {
- bool HasChain = !I.doesNotAccessMemory();
- bool OnlyLoad = HasChain && I.onlyReadsMemory();
-
- // Build the operand list.
- SmallVector<SDOperand, 8> Ops;
- if (HasChain) { // If this intrinsic has side-effects, chainify it.
- if (OnlyLoad) {
- // We don't need to serialize loads against other loads.
- Ops.push_back(DAG.getRoot());
- } else {
- Ops.push_back(getRoot());
- }
- }
-
- // Add the intrinsic ID as an integer operand.
- Ops.push_back(DAG.getConstant(Intrinsic, TLI.getPointerTy()));
-
- // Add all operands of the call to the operand list.
- for (unsigned i = 1, e = I.getNumOperands(); i != e; ++i) {
- SDOperand Op = getValue(I.getOperand(i));
- assert(TLI.isTypeLegal(Op.getValueType()) &&
- "Intrinsic uses a non-legal type?");
- Ops.push_back(Op);
- }
-
- std::vector<MVT::ValueType> VTs;
- if (I.getType() != Type::VoidTy) {
- MVT::ValueType VT = TLI.getValueType(I.getType());
- if (MVT::isVector(VT)) {
- const VectorType *DestTy = cast<VectorType>(I.getType());
- MVT::ValueType EltVT = TLI.getValueType(DestTy->getElementType());
-
- VT = MVT::getVectorType(EltVT, DestTy->getNumElements());
- assert(VT != MVT::Other && "Intrinsic uses a non-legal type?");
- }
-
- assert(TLI.isTypeLegal(VT) && "Intrinsic uses a non-legal type?");
- VTs.push_back(VT);
- }
- if (HasChain)
- VTs.push_back(MVT::Other);
-
- const MVT::ValueType *VTList = DAG.getNodeValueTypes(VTs);
-
- // Create the node.
- SDOperand Result;
- if (!HasChain)
- Result = DAG.getNode(ISD::INTRINSIC_WO_CHAIN, VTList, VTs.size(),
- &Ops[0], Ops.size());
- else if (I.getType() != Type::VoidTy)
- Result = DAG.getNode(ISD::INTRINSIC_W_CHAIN, VTList, VTs.size(),
- &Ops[0], Ops.size());
- else
- Result = DAG.getNode(ISD::INTRINSIC_VOID, VTList, VTs.size(),
- &Ops[0], Ops.size());
-
- if (HasChain) {
- SDOperand Chain = Result.getValue(Result.Val->getNumValues()-1);
- if (OnlyLoad)
- PendingLoads.push_back(Chain);
- else
- DAG.setRoot(Chain);
- }
- if (I.getType() != Type::VoidTy) {
- if (const VectorType *PTy = dyn_cast<VectorType>(I.getType())) {
- MVT::ValueType VT = TLI.getValueType(PTy);
- Result = DAG.getNode(ISD::BIT_CONVERT, VT, Result);
- }
- setValue(&I, Result);
- }
-}
-
-/// ExtractTypeInfo - Returns the type info, possibly bitcast, encoded in V.
-static GlobalVariable *ExtractTypeInfo (Value *V) {
- V = V->stripPointerCasts();
- GlobalVariable *GV = dyn_cast<GlobalVariable>(V);
- assert ((GV || isa<ConstantPointerNull>(V)) &&
- "TypeInfo must be a global variable or NULL");
- return GV;
-}
-
-/// addCatchInfo - Extract the personality and type infos from an eh.selector
-/// call, and add them to the specified machine basic block.
-static void addCatchInfo(CallInst &I, MachineModuleInfo *MMI,
- MachineBasicBlock *MBB) {
- // Inform the MachineModuleInfo of the personality for this landing pad.
- ConstantExpr *CE = cast<ConstantExpr>(I.getOperand(2));
- assert(CE->getOpcode() == Instruction::BitCast &&
- isa<Function>(CE->getOperand(0)) &&
- "Personality should be a function");
- MMI->addPersonality(MBB, cast<Function>(CE->getOperand(0)));
-
- // Gather all the type infos for this landing pad and pass them along to
- // MachineModuleInfo.
- std::vector<GlobalVariable *> TyInfo;
- unsigned N = I.getNumOperands();
-
- for (unsigned i = N - 1; i > 2; --i) {
- if (ConstantInt *CI = dyn_cast<ConstantInt>(I.getOperand(i))) {
- unsigned FilterLength = CI->getZExtValue();
- unsigned FirstCatch = i + FilterLength + !FilterLength;
- assert (FirstCatch <= N && "Invalid filter length");
-
- if (FirstCatch < N) {
- TyInfo.reserve(N - FirstCatch);
- for (unsigned j = FirstCatch; j < N; ++j)
- TyInfo.push_back(ExtractTypeInfo(I.getOperand(j)));
- MMI->addCatchTypeInfo(MBB, TyInfo);
- TyInfo.clear();
- }
-
- if (!FilterLength) {
- // Cleanup.
- MMI->addCleanup(MBB);
- } else {
- // Filter.
- TyInfo.reserve(FilterLength - 1);
- for (unsigned j = i + 1; j < FirstCatch; ++j)
- TyInfo.push_back(ExtractTypeInfo(I.getOperand(j)));
- MMI->addFilterTypeInfo(MBB, TyInfo);
- TyInfo.clear();
- }
-
- N = i;
- }
- }
-
- if (N > 3) {
- TyInfo.reserve(N - 3);
- for (unsigned j = 3; j < N; ++j)
- TyInfo.push_back(ExtractTypeInfo(I.getOperand(j)));
- MMI->addCatchTypeInfo(MBB, TyInfo);
- }
-}
-
-
-/// Inlined utility function to implement binary input atomic intrinsics for
-// visitIntrinsicCall: I is a call instruction
-// Op is the associated NodeType for I
-const char *
-SelectionDAGLowering::implVisitBinaryAtomic(CallInst& I, ISD::NodeType Op) {
- SDOperand Root = getRoot();
- SDOperand O2 = getValue(I.getOperand(2));
- SDOperand L = DAG.getAtomic(Op, Root,
- getValue(I.getOperand(1)),
- O2, O2.getValueType());
- setValue(&I, L);
- DAG.setRoot(L.getValue(1));
- return 0;
-}
-
-/// visitIntrinsicCall - Lower the call to the specified intrinsic function. If
-/// we want to emit this as a call to a named external function, return the name
-/// otherwise lower it and return null.
-const char *
-SelectionDAGLowering::visitIntrinsicCall(CallInst &I, unsigned Intrinsic) {
- switch (Intrinsic) {
- default:
- // By default, turn this into a target intrinsic node.
- visitTargetIntrinsic(I, Intrinsic);
- return 0;
- case Intrinsic::vastart: visitVAStart(I); return 0;
- case Intrinsic::vaend: visitVAEnd(I); return 0;
- case Intrinsic::vacopy: visitVACopy(I); return 0;
- case Intrinsic::returnaddress:
- setValue(&I, DAG.getNode(ISD::RETURNADDR, TLI.getPointerTy(),
- getValue(I.getOperand(1))));
- return 0;
- case Intrinsic::frameaddress:
- setValue(&I, DAG.getNode(ISD::FRAMEADDR, TLI.getPointerTy(),
- getValue(I.getOperand(1))));
- return 0;
- case Intrinsic::setjmp:
- return "_setjmp"+!TLI.usesUnderscoreSetJmp();
- break;
- case Intrinsic::longjmp:
- return "_longjmp"+!TLI.usesUnderscoreLongJmp();
- break;
- case Intrinsic::memcpy_i32:
- case Intrinsic::memcpy_i64: {
- SDOperand Op1 = getValue(I.getOperand(1));
- SDOperand Op2 = getValue(I.getOperand(2));
- SDOperand Op3 = getValue(I.getOperand(3));
- unsigned Align = cast<ConstantInt>(I.getOperand(4))->getZExtValue();
- DAG.setRoot(DAG.getMemcpy(getRoot(), Op1, Op2, Op3, Align, false,
- I.getOperand(1), 0, I.getOperand(2), 0));
- return 0;
- }
- case Intrinsic::memset_i32:
- case Intrinsic::memset_i64: {
- SDOperand Op1 = getValue(I.getOperand(1));
- SDOperand Op2 = getValue(I.getOperand(2));
- SDOperand Op3 = getValue(I.getOperand(3));
- unsigned Align = cast<ConstantInt>(I.getOperand(4))->getZExtValue();
- DAG.setRoot(DAG.getMemset(getRoot(), Op1, Op2, Op3, Align,
- I.getOperand(1), 0));
- return 0;
- }
- case Intrinsic::memmove_i32:
- case Intrinsic::memmove_i64: {
- SDOperand Op1 = getValue(I.getOperand(1));
- SDOperand Op2 = getValue(I.getOperand(2));
- SDOperand Op3 = getValue(I.getOperand(3));
- unsigned Align = cast<ConstantInt>(I.getOperand(4))->getZExtValue();
-
- // If the source and destination are known to not be aliases, we can
- // lower memmove as memcpy.
- uint64_t Size = -1ULL;
- if (ConstantSDNode *C = dyn_cast<ConstantSDNode>(Op3))
- Size = C->getValue();
- if (AA.alias(I.getOperand(1), Size, I.getOperand(2), Size) ==
- AliasAnalysis::NoAlias) {
- DAG.setRoot(DAG.getMemcpy(getRoot(), Op1, Op2, Op3, Align, false,
- I.getOperand(1), 0, I.getOperand(2), 0));
- return 0;
- }
-
- DAG.setRoot(DAG.getMemmove(getRoot(), Op1, Op2, Op3, Align,
- I.getOperand(1), 0, I.getOperand(2), 0));
- return 0;
- }
- case Intrinsic::dbg_stoppoint: {
- MachineModuleInfo *MMI = DAG.getMachineModuleInfo();
- DbgStopPointInst &SPI = cast<DbgStopPointInst>(I);
- if (MMI && SPI.getContext() && MMI->Verify(SPI.getContext())) {
- SDOperand Ops[5];
-
- Ops[0] = getRoot();
- Ops[1] = getValue(SPI.getLineValue());
- Ops[2] = getValue(SPI.getColumnValue());
-
- DebugInfoDesc *DD = MMI->getDescFor(SPI.getContext());
- assert(DD && "Not a debug information descriptor");
- CompileUnitDesc *CompileUnit = cast<CompileUnitDesc>(DD);
-
- Ops[3] = DAG.getString(CompileUnit->getFileName());
- Ops[4] = DAG.getString(CompileUnit->getDirectory());
-
- DAG.setRoot(DAG.getNode(ISD::LOCATION, MVT::Other, Ops, 5));
- }
-
- return 0;
- }
- case Intrinsic::dbg_region_start: {
- MachineModuleInfo *MMI = DAG.getMachineModuleInfo();
- DbgRegionStartInst &RSI = cast<DbgRegionStartInst>(I);
- if (MMI && RSI.getContext() && MMI->Verify(RSI.getContext())) {
- unsigned LabelID = MMI->RecordRegionStart(RSI.getContext());
- DAG.setRoot(DAG.getNode(ISD::LABEL, MVT::Other, getRoot(),
- DAG.getConstant(LabelID, MVT::i32),
- DAG.getConstant(0, MVT::i32)));
- }
-
- return 0;
- }
- case Intrinsic::dbg_region_end: {
- MachineModuleInfo *MMI = DAG.getMachineModuleInfo();
- DbgRegionEndInst &REI = cast<DbgRegionEndInst>(I);
- if (MMI && REI.getContext() && MMI->Verify(REI.getContext())) {
- unsigned LabelID = MMI->RecordRegionEnd(REI.getContext());
- DAG.setRoot(DAG.getNode(ISD::LABEL, MVT::Other, getRoot(),
- DAG.getConstant(LabelID, MVT::i32),
- DAG.getConstant(0, MVT::i32)));
- }
-
- return 0;
- }
- case Intrinsic::dbg_func_start: {
- MachineModuleInfo *MMI = DAG.getMachineModuleInfo();
- if (!MMI) return 0;
- DbgFuncStartInst &FSI = cast<DbgFuncStartInst>(I);
- Value *SP = FSI.getSubprogram();
- if (SP && MMI->Verify(SP)) {
- // llvm.dbg.func.start implicitly defines a dbg_stoppoint which is
- // what (most?) gdb expects.
- DebugInfoDesc *DD = MMI->getDescFor(SP);
- assert(DD && "Not a debug information descriptor");
- SubprogramDesc *Subprogram = cast<SubprogramDesc>(DD);
- const CompileUnitDesc *CompileUnit = Subprogram->getFile();
- unsigned SrcFile = MMI->RecordSource(CompileUnit->getDirectory(),
- CompileUnit->getFileName());
- // Record the source line but does create a label. It will be emitted
- // at asm emission time.
- MMI->RecordSourceLine(Subprogram->getLine(), 0, SrcFile);
- }
-
- return 0;
- }
- case Intrinsic::dbg_declare: {
- MachineModuleInfo *MMI = DAG.getMachineModuleInfo();
- DbgDeclareInst &DI = cast<DbgDeclareInst>(I);
- Value *Variable = DI.getVariable();
- if (MMI && Variable && MMI->Verify(Variable))
- DAG.setRoot(DAG.getNode(ISD::DECLARE, MVT::Other, getRoot(),
- getValue(DI.getAddress()), getValue(Variable)));
- return 0;
- }
-
- case Intrinsic::eh_exception: {
- if (!CurMBB->isLandingPad()) {
- // FIXME: Mark exception register as live in. Hack for PR1508.
- unsigned Reg = TLI.getExceptionAddressRegister();
- if (Reg) CurMBB->addLiveIn(Reg);
- }
- // Insert the EXCEPTIONADDR instruction.
- SDVTList VTs = DAG.getVTList(TLI.getPointerTy(), MVT::Other);
- SDOperand Ops[1];
- Ops[0] = DAG.getRoot();
- SDOperand Op = DAG.getNode(ISD::EXCEPTIONADDR, VTs, Ops, 1);
- setValue(&I, Op);
- DAG.setRoot(Op.getValue(1));
- return 0;
- }
-
- case Intrinsic::eh_selector_i32:
- case Intrinsic::eh_selector_i64: {
- MachineModuleInfo *MMI = DAG.getMachineModuleInfo();
- MVT::ValueType VT = (Intrinsic == Intrinsic::eh_selector_i32 ?
- MVT::i32 : MVT::i64);
-
- if (MMI) {
- if (CurMBB->isLandingPad())
- addCatchInfo(I, MMI, CurMBB);
- else {
-#ifndef NDEBUG
- FuncInfo.CatchInfoLost.insert(&I);
-#endif
- // FIXME: Mark exception selector register as live in. Hack for PR1508.
- unsigned Reg = TLI.getExceptionSelectorRegister();
- if (Reg) CurMBB->addLiveIn(Reg);
- }
-
- // Insert the EHSELECTION instruction.
- SDVTList VTs = DAG.getVTList(VT, MVT::Other);
- SDOperand Ops[2];
- Ops[0] = getValue(I.getOperand(1));
- Ops[1] = getRoot();
- SDOperand Op = DAG.getNode(ISD::EHSELECTION, VTs, Ops, 2);
- setValue(&I, Op);
- DAG.setRoot(Op.getValue(1));
- } else {
- setValue(&I, DAG.getConstant(0, VT));
- }
-
- return 0;
- }
-
- case Intrinsic::eh_typeid_for_i32:
- case Intrinsic::eh_typeid_for_i64: {
- MachineModuleInfo *MMI = DAG.getMachineModuleInfo();
- MVT::ValueType VT = (Intrinsic == Intrinsic::eh_typeid_for_i32 ?
- MVT::i32 : MVT::i64);
-
- if (MMI) {
- // Find the type id for the given typeinfo.
- GlobalVariable *GV = ExtractTypeInfo(I.getOperand(1));
-
- unsigned TypeID = MMI->getTypeIDFor(GV);
- setValue(&I, DAG.getConstant(TypeID, VT));
- } else {
- // Return something different to eh_selector.
- setValue(&I, DAG.getConstant(1, VT));
- }
-
- return 0;
- }
-
- case Intrinsic::eh_return: {
- MachineModuleInfo *MMI = DAG.getMachineModuleInfo();
-
- if (MMI) {
- MMI->setCallsEHReturn(true);
- DAG.setRoot(DAG.getNode(ISD::EH_RETURN,
- MVT::Other,
- getControlRoot(),
- getValue(I.getOperand(1)),
- getValue(I.getOperand(2))));
- } else {
- setValue(&I, DAG.getConstant(0, TLI.getPointerTy()));
- }
-
- return 0;
- }
-
- case Intrinsic::eh_unwind_init: {
- if (MachineModuleInfo *MMI = DAG.getMachineModuleInfo()) {
- MMI->setCallsUnwindInit(true);
- }
-
- return 0;
- }
-
- case Intrinsic::eh_dwarf_cfa: {
- MVT::ValueType VT = getValue(I.getOperand(1)).getValueType();
- SDOperand CfaArg;
- if (MVT::getSizeInBits(VT) > MVT::getSizeInBits(TLI.getPointerTy()))
- CfaArg = DAG.getNode(ISD::TRUNCATE,
- TLI.getPointerTy(), getValue(I.getOperand(1)));
- else
- CfaArg = DAG.getNode(ISD::SIGN_EXTEND,
- TLI.getPointerTy(), getValue(I.getOperand(1)));
-
- SDOperand Offset = DAG.getNode(ISD::ADD,
- TLI.getPointerTy(),
- DAG.getNode(ISD::FRAME_TO_ARGS_OFFSET,
- TLI.getPointerTy()),
- CfaArg);
- setValue(&I, DAG.getNode(ISD::ADD,
- TLI.getPointerTy(),
- DAG.getNode(ISD::FRAMEADDR,
- TLI.getPointerTy(),
- DAG.getConstant(0,
- TLI.getPointerTy())),
- Offset));
- return 0;
- }
-
- case Intrinsic::sqrt:
- setValue(&I, DAG.getNode(ISD::FSQRT,
- getValue(I.getOperand(1)).getValueType(),
- getValue(I.getOperand(1))));
- return 0;
- case Intrinsic::powi:
- setValue(&I, DAG.getNode(ISD::FPOWI,
- getValue(I.getOperand(1)).getValueType(),
- getValue(I.getOperand(1)),
- getValue(I.getOperand(2))));
- return 0;
- case Intrinsic::sin:
- setValue(&I, DAG.getNode(ISD::FSIN,
- getValue(I.getOperand(1)).getValueType(),
- getValue(I.getOperand(1))));
- return 0;
- case Intrinsic::cos:
- setValue(&I, DAG.getNode(ISD::FCOS,
- getValue(I.getOperand(1)).getValueType(),
- getValue(I.getOperand(1))));
- return 0;
- case Intrinsic::pow:
- setValue(&I, DAG.getNode(ISD::FPOW,
- getValue(I.getOperand(1)).getValueType(),
- getValue(I.getOperand(1)),
- getValue(I.getOperand(2))));
- return 0;
- case Intrinsic::pcmarker: {
- SDOperand Tmp = getValue(I.getOperand(1));
- DAG.setRoot(DAG.getNode(ISD::PCMARKER, MVT::Other, getRoot(), Tmp));
- return 0;
- }
- case Intrinsic::readcyclecounter: {
- SDOperand Op = getRoot();
- SDOperand Tmp = DAG.getNode(ISD::READCYCLECOUNTER,
- DAG.getNodeValueTypes(MVT::i64, MVT::Other), 2,
- &Op, 1);
- setValue(&I, Tmp);
- DAG.setRoot(Tmp.getValue(1));
- return 0;
- }
- case Intrinsic::part_select: {
- // Currently not implemented: just abort
- assert(0 && "part_select intrinsic not implemented");
- abort();
- }
- case Intrinsic::part_set: {
- // Currently not implemented: just abort
- assert(0 && "part_set intrinsic not implemented");
- abort();
- }
- case Intrinsic::bswap:
- setValue(&I, DAG.getNode(ISD::BSWAP,
- getValue(I.getOperand(1)).getValueType(),
- getValue(I.getOperand(1))));
- return 0;
- case Intrinsic::cttz: {
- SDOperand Arg = getValue(I.getOperand(1));
- MVT::ValueType Ty = Arg.getValueType();
- SDOperand result = DAG.getNode(ISD::CTTZ, Ty, Arg);
- setValue(&I, result);
- return 0;
- }
- case Intrinsic::ctlz: {
- SDOperand Arg = getValue(I.getOperand(1));
- MVT::ValueType Ty = Arg.getValueType();
- SDOperand result = DAG.getNode(ISD::CTLZ, Ty, Arg);
- setValue(&I, result);
- return 0;
- }
- case Intrinsic::ctpop: {
- SDOperand Arg = getValue(I.getOperand(1));
- MVT::ValueType Ty = Arg.getValueType();
- SDOperand result = DAG.getNode(ISD::CTPOP, Ty, Arg);
- setValue(&I, result);
- return 0;
- }
- case Intrinsic::stacksave: {
- SDOperand Op = getRoot();
- SDOperand Tmp = DAG.getNode(ISD::STACKSAVE,
- DAG.getNodeValueTypes(TLI.getPointerTy(), MVT::Other), 2, &Op, 1);
- setValue(&I, Tmp);
- DAG.setRoot(Tmp.getValue(1));
- return 0;
- }
- case Intrinsic::stackrestore: {
- SDOperand Tmp = getValue(I.getOperand(1));
- DAG.setRoot(DAG.getNode(ISD::STACKRESTORE, MVT::Other, getRoot(), Tmp));
- return 0;
- }
- case Intrinsic::var_annotation:
- // Discard annotate attributes
- return 0;
-
- case Intrinsic::init_trampoline: {
- const Function *F = cast<Function>(I.getOperand(2)->stripPointerCasts());
-
- SDOperand Ops[6];
- Ops[0] = getRoot();
- Ops[1] = getValue(I.getOperand(1));
- Ops[2] = getValue(I.getOperand(2));
- Ops[3] = getValue(I.getOperand(3));
- Ops[4] = DAG.getSrcValue(I.getOperand(1));
- Ops[5] = DAG.getSrcValue(F);
-
- SDOperand Tmp = DAG.getNode(ISD::TRAMPOLINE,
- DAG.getNodeValueTypes(TLI.getPointerTy(),
- MVT::Other), 2,
- Ops, 6);
-
- setValue(&I, Tmp);
- DAG.setRoot(Tmp.getValue(1));
- return 0;
- }
-
- case Intrinsic::gcroot:
- if (GCI) {
- Value *Alloca = I.getOperand(1);
- Constant *TypeMap = cast<Constant>(I.getOperand(2));
-
- FrameIndexSDNode *FI = cast<FrameIndexSDNode>(getValue(Alloca).Val);
- GCI->addStackRoot(FI->getIndex(), TypeMap);
- }
- return 0;
-
- case Intrinsic::gcread:
- case Intrinsic::gcwrite:
- assert(0 && "Collector failed to lower gcread/gcwrite intrinsics!");
- return 0;
-
- case Intrinsic::flt_rounds: {
- setValue(&I, DAG.getNode(ISD::FLT_ROUNDS_, MVT::i32));
- return 0;
- }
-
- case Intrinsic::trap: {
- DAG.setRoot(DAG.getNode(ISD::TRAP, MVT::Other, getRoot()));
- return 0;
- }
- case Intrinsic::prefetch: {
- SDOperand Ops[4];
- Ops[0] = getRoot();
- Ops[1] = getValue(I.getOperand(1));
- Ops[2] = getValue(I.getOperand(2));
- Ops[3] = getValue(I.getOperand(3));
- DAG.setRoot(DAG.getNode(ISD::PREFETCH, MVT::Other, &Ops[0], 4));
- return 0;
- }
-
- case Intrinsic::memory_barrier: {
- SDOperand Ops[6];
- Ops[0] = getRoot();
- for (int x = 1; x < 6; ++x)
- Ops[x] = getValue(I.getOperand(x));
-
- DAG.setRoot(DAG.getNode(ISD::MEMBARRIER, MVT::Other, &Ops[0], 6));
- return 0;
- }
- case Intrinsic::atomic_lcs: {
- SDOperand Root = getRoot();
- SDOperand O3 = getValue(I.getOperand(3));
- SDOperand L = DAG.getAtomic(ISD::ATOMIC_LCS, Root,
- getValue(I.getOperand(1)),
- getValue(I.getOperand(2)),
- O3, O3.getValueType());
- setValue(&I, L);
- DAG.setRoot(L.getValue(1));
- return 0;
- }
- case Intrinsic::atomic_las:
- return implVisitBinaryAtomic(I, ISD::ATOMIC_LAS);
- case Intrinsic::atomic_lss:
- return implVisitBinaryAtomic(I, ISD::ATOMIC_LSS);
- case Intrinsic::atomic_load_and:
- return implVisitBinaryAtomic(I, ISD::ATOMIC_LOAD_AND);
- case Intrinsic::atomic_load_or:
- return implVisitBinaryAtomic(I, ISD::ATOMIC_LOAD_OR);
- case Intrinsic::atomic_load_xor:
- return implVisitBinaryAtomic(I, ISD::ATOMIC_LOAD_XOR);
- case Intrinsic::atomic_load_min:
- return implVisitBinaryAtomic(I, ISD::ATOMIC_LOAD_MIN);
- case Intrinsic::atomic_load_max:
- return implVisitBinaryAtomic(I, ISD::ATOMIC_LOAD_MAX);
- case Intrinsic::atomic_load_umin:
- return implVisitBinaryAtomic(I, ISD::ATOMIC_LOAD_UMIN);
- case Intrinsic::atomic_load_umax:
- return implVisitBinaryAtomic(I, ISD::ATOMIC_LOAD_UMAX);
- case Intrinsic::atomic_swap:
- return implVisitBinaryAtomic(I, ISD::ATOMIC_SWAP);
- }
-}
-
-
-void SelectionDAGLowering::LowerCallTo(CallSite CS, SDOperand Callee,
- bool IsTailCall,
- MachineBasicBlock *LandingPad) {
- const PointerType *PT = cast<PointerType>(CS.getCalledValue()->getType());
- const FunctionType *FTy = cast<FunctionType>(PT->getElementType());
- MachineModuleInfo *MMI = DAG.getMachineModuleInfo();
- unsigned BeginLabel = 0, EndLabel = 0;
-
- TargetLowering::ArgListTy Args;
- TargetLowering::ArgListEntry Entry;
- Args.reserve(CS.arg_size());
- for (CallSite::arg_iterator i = CS.arg_begin(), e = CS.arg_end();
- i != e; ++i) {
- SDOperand ArgNode = getValue(*i);
- Entry.Node = ArgNode; Entry.Ty = (*i)->getType();
-
- unsigned attrInd = i - CS.arg_begin() + 1;
- Entry.isSExt = CS.paramHasAttr(attrInd, ParamAttr::SExt);
- Entry.isZExt = CS.paramHasAttr(attrInd, ParamAttr::ZExt);
- Entry.isInReg = CS.paramHasAttr(attrInd, ParamAttr::InReg);
- Entry.isSRet = CS.paramHasAttr(attrInd, ParamAttr::StructRet);
- Entry.isNest = CS.paramHasAttr(attrInd, ParamAttr::Nest);
- Entry.isByVal = CS.paramHasAttr(attrInd, ParamAttr::ByVal);
- Entry.Alignment = CS.getParamAlignment(attrInd);
- Args.push_back(Entry);
- }
-
- if (LandingPad && MMI) {
- // Insert a label before the invoke call to mark the try range. This can be
- // used to detect deletion of the invoke via the MachineModuleInfo.
- BeginLabel = MMI->NextLabelID();
- // Both PendingLoads and PendingExports must be flushed here;
- // this call might not return.
- (void)getRoot();
- DAG.setRoot(DAG.getNode(ISD::LABEL, MVT::Other, getControlRoot(),
- DAG.getConstant(BeginLabel, MVT::i32),
- DAG.getConstant(1, MVT::i32)));
- }
-
- std::pair<SDOperand,SDOperand> Result =
- TLI.LowerCallTo(getRoot(), CS.getType(),
- CS.paramHasAttr(0, ParamAttr::SExt),
- CS.paramHasAttr(0, ParamAttr::ZExt),
- FTy->isVarArg(), CS.getCallingConv(), IsTailCall,
- Callee, Args, DAG);
- if (CS.getType() != Type::VoidTy)
- setValue(CS.getInstruction(), Result.first);
- DAG.setRoot(Result.second);
-
- if (LandingPad && MMI) {
- // Insert a label at the end of the invoke call to mark the try range. This
- // can be used to detect deletion of the invoke via the MachineModuleInfo.
- EndLabel = MMI->NextLabelID();
- DAG.setRoot(DAG.getNode(ISD::LABEL, MVT::Other, getRoot(),
- DAG.getConstant(EndLabel, MVT::i32),
- DAG.getConstant(1, MVT::i32)));
-
- // Inform MachineModuleInfo of range.
- MMI->addInvoke(LandingPad, BeginLabel, EndLabel);
- }
-}
-
-
-void SelectionDAGLowering::visitCall(CallInst &I) {
- const char *RenameFn = 0;
- if (Function *F = I.getCalledFunction()) {
- if (F->isDeclaration()) {
- if (unsigned IID = F->getIntrinsicID()) {
- RenameFn = visitIntrinsicCall(I, IID);
- if (!RenameFn)
- return;
- }
- }
-
- // Check for well-known libc/libm calls. If the function is internal, it
- // can't be a library call.
- unsigned NameLen = F->getNameLen();
- if (!F->hasInternalLinkage() && NameLen) {
- const char *NameStr = F->getNameStart();
- if (NameStr[0] == 'c' &&
- ((NameLen == 8 && !strcmp(NameStr, "copysign")) ||
- (NameLen == 9 && !strcmp(NameStr, "copysignf")))) {
- if (I.getNumOperands() == 3 && // Basic sanity checks.
- I.getOperand(1)->getType()->isFloatingPoint() &&
- I.getType() == I.getOperand(1)->getType() &&
- I.getType() == I.getOperand(2)->getType()) {
- SDOperand LHS = getValue(I.getOperand(1));
- SDOperand RHS = getValue(I.getOperand(2));
- setValue(&I, DAG.getNode(ISD::FCOPYSIGN, LHS.getValueType(),
- LHS, RHS));
- return;
- }
- } else if (NameStr[0] == 'f' &&
- ((NameLen == 4 && !strcmp(NameStr, "fabs")) ||
- (NameLen == 5 && !strcmp(NameStr, "fabsf")) ||
- (NameLen == 5 && !strcmp(NameStr, "fabsl")))) {
- if (I.getNumOperands() == 2 && // Basic sanity checks.
- I.getOperand(1)->getType()->isFloatingPoint() &&
- I.getType() == I.getOperand(1)->getType()) {
- SDOperand Tmp = getValue(I.getOperand(1));
- setValue(&I, DAG.getNode(ISD::FABS, Tmp.getValueType(), Tmp));
- return;
- }
- } else if (NameStr[0] == 's' &&
- ((NameLen == 3 && !strcmp(NameStr, "sin")) ||
- (NameLen == 4 && !strcmp(NameStr, "sinf")) ||
- (NameLen == 4 && !strcmp(NameStr, "sinl")))) {
- if (I.getNumOperands() == 2 && // Basic sanity checks.
- I.getOperand(1)->getType()->isFloatingPoint() &&
- I.getType() == I.getOperand(1)->getType()) {
- SDOperand Tmp = getValue(I.getOperand(1));
- setValue(&I, DAG.getNode(ISD::FSIN, Tmp.getValueType(), Tmp));
- return;
- }
- } else if (NameStr[0] == 'c' &&
- ((NameLen == 3 && !strcmp(NameStr, "cos")) ||
- (NameLen == 4 && !strcmp(NameStr, "cosf")) ||
- (NameLen == 4 && !strcmp(NameStr, "cosl")))) {
- if (I.getNumOperands() == 2 && // Basic sanity checks.
- I.getOperand(1)->getType()->isFloatingPoint() &&
- I.getType() == I.getOperand(1)->getType()) {
- SDOperand Tmp = getValue(I.getOperand(1));
- setValue(&I, DAG.getNode(ISD::FCOS, Tmp.getValueType(), Tmp));
- return;
- }
- }
- }
- } else if (isa<InlineAsm>(I.getOperand(0))) {
- visitInlineAsm(&I);
- return;
- }
-
- SDOperand Callee;
- if (!RenameFn)
- Callee = getValue(I.getOperand(0));
- else
- Callee = DAG.getExternalSymbol(RenameFn, TLI.getPointerTy());
-
- LowerCallTo(&I, Callee, I.isTailCall());
-}
-
-
-void SelectionDAGLowering::visitGetResult(GetResultInst &I) {
- if (isa<UndefValue>(I.getOperand(0))) {
- SDOperand Undef = DAG.getNode(ISD::UNDEF, TLI.getValueType(I.getType()));
- setValue(&I, Undef);
- return;
- }
-
- // To add support for individual return values with aggregate types,
- // we'd need a way to take a getresult index and determine which
- // values of the Call SDNode are associated with it.
- assert(TLI.getValueType(I.getType(), true) != MVT::Other &&
- "Individual return values must not be aggregates!");
-
- SDOperand Call = getValue(I.getOperand(0));
- setValue(&I, SDOperand(Call.Val, I.getIndex()));
-}
-
-
-/// getCopyFromRegs - Emit a series of CopyFromReg nodes that copies from
-/// this value and returns the result as a ValueVT value. This uses
-/// Chain/Flag as the input and updates them for the output Chain/Flag.
-/// If the Flag pointer is NULL, no flag is used.
-SDOperand RegsForValue::getCopyFromRegs(SelectionDAG &DAG,
- SDOperand &Chain,
- SDOperand *Flag) const {
- // Assemble the legal parts into the final values.
- SmallVector<SDOperand, 4> Values(ValueVTs.size());
- SmallVector<SDOperand, 8> Parts;
- for (unsigned Value = 0, Part = 0, e = ValueVTs.size(); Value != e; ++Value) {
- // Copy the legal parts from the registers.
- MVT::ValueType ValueVT = ValueVTs[Value];
- unsigned NumRegs = TLI->getNumRegisters(ValueVT);
- MVT::ValueType RegisterVT = RegVTs[Value];
-
- Parts.resize(NumRegs);
- for (unsigned i = 0; i != NumRegs; ++i) {
- SDOperand P;
- if (Flag == 0)
- P = DAG.getCopyFromReg(Chain, Regs[Part+i], RegisterVT);
- else {
- P = DAG.getCopyFromReg(Chain, Regs[Part+i], RegisterVT, *Flag);
- *Flag = P.getValue(2);
- }
- Chain = P.getValue(1);
- Parts[Part+i] = P;
- }
-
- Values[Value] = getCopyFromParts(DAG, &Parts[Part], NumRegs, RegisterVT,
- ValueVT);
- Part += NumRegs;
- }
-
- if (ValueVTs.size() == 1)
- return Values[0];
-
- return DAG.getNode(ISD::MERGE_VALUES,
- DAG.getVTList(&ValueVTs[0], ValueVTs.size()),
- &Values[0], ValueVTs.size());
-}
-
-/// getCopyToRegs - Emit a series of CopyToReg nodes that copies the
-/// specified value into the registers specified by this object. This uses
-/// Chain/Flag as the input and updates them for the output Chain/Flag.
-/// If the Flag pointer is NULL, no flag is used.
-void RegsForValue::getCopyToRegs(SDOperand Val, SelectionDAG &DAG,
- SDOperand &Chain, SDOperand *Flag) const {
- // Get the list of the values's legal parts.
- unsigned NumRegs = Regs.size();
- SmallVector<SDOperand, 8> Parts(NumRegs);
- for (unsigned Value = 0, Part = 0, e = ValueVTs.size(); Value != e; ++Value) {
- MVT::ValueType ValueVT = ValueVTs[Value];
- unsigned NumParts = TLI->getNumRegisters(ValueVT);
- MVT::ValueType RegisterVT = RegVTs[Value];
-
- getCopyToParts(DAG, Val.getValue(Val.ResNo + Value),
- &Parts[Part], NumParts, RegisterVT);
- Part += NumParts;
- }
-
- // Copy the parts into the registers.
- SmallVector<SDOperand, 8> Chains(NumRegs);
- for (unsigned i = 0; i != NumRegs; ++i) {
- SDOperand Part;
- if (Flag == 0)
- Part = DAG.getCopyToReg(Chain, Regs[i], Parts[i]);
- else {
- Part = DAG.getCopyToReg(Chain, Regs[i], Parts[i], *Flag);
- *Flag = Part.getValue(1);
- }
- Chains[i] = Part.getValue(0);
- }
-
- if (NumRegs == 1 || Flag)
- // If NumRegs > 1 && Flag is used then the use of the last CopyToReg is
- // flagged to it. That is the CopyToReg nodes and the user are considered
- // a single scheduling unit. If we create a TokenFactor and return it as
- // chain, then the TokenFactor is both a predecessor (operand) of the
- // user as well as a successor (the TF operands are flagged to the user).
- // c1, f1 = CopyToReg
- // c2, f2 = CopyToReg
- // c3 = TokenFactor c1, c2
- // ...
- // = op c3, ..., f2
- Chain = Chains[NumRegs-1];
- else
- Chain = DAG.getNode(ISD::TokenFactor, MVT::Other, &Chains[0], NumRegs);
-}
-
-/// AddInlineAsmOperands - Add this value to the specified inlineasm node
-/// operand list. This adds the code marker and includes the number of
-/// values added into it.
-void RegsForValue::AddInlineAsmOperands(unsigned Code, SelectionDAG &DAG,
- std::vector<SDOperand> &Ops) const {
- MVT::ValueType IntPtrTy = DAG.getTargetLoweringInfo().getPointerTy();
- Ops.push_back(DAG.getTargetConstant(Code | (Regs.size() << 3), IntPtrTy));
- for (unsigned Value = 0, Reg = 0, e = ValueVTs.size(); Value != e; ++Value) {
- unsigned NumRegs = TLI->getNumRegisters(ValueVTs[Value]);
- MVT::ValueType RegisterVT = RegVTs[Value];
- for (unsigned i = 0; i != NumRegs; ++i)
- Ops.push_back(DAG.getRegister(Regs[Reg++], RegisterVT));
- }
-}
-
-/// isAllocatableRegister - If the specified register is safe to allocate,
-/// i.e. it isn't a stack pointer or some other special register, return the
-/// register class for the register. Otherwise, return null.
-static const TargetRegisterClass *
-isAllocatableRegister(unsigned Reg, MachineFunction &MF,
- const TargetLowering &TLI,
- const TargetRegisterInfo *TRI) {
- MVT::ValueType FoundVT = MVT::Other;
- const TargetRegisterClass *FoundRC = 0;
- for (TargetRegisterInfo::regclass_iterator RCI = TRI->regclass_begin(),
- E = TRI->regclass_end(); RCI != E; ++RCI) {
- MVT::ValueType ThisVT = MVT::Other;
-
- const TargetRegisterClass *RC = *RCI;
- // If none of the the value types for this register class are valid, we
- // can't use it. For example, 64-bit reg classes on 32-bit targets.
- for (TargetRegisterClass::vt_iterator I = RC->vt_begin(), E = RC->vt_end();
- I != E; ++I) {
- if (TLI.isTypeLegal(*I)) {
- // If we have already found this register in a different register class,
- // choose the one with the largest VT specified. For example, on
- // PowerPC, we favor f64 register classes over f32.
- if (FoundVT == MVT::Other ||
- MVT::getSizeInBits(FoundVT) < MVT::getSizeInBits(*I)) {
- ThisVT = *I;
- break;
- }
- }
- }
-
- if (ThisVT == MVT::Other) continue;
-
- // NOTE: This isn't ideal. In particular, this might allocate the
- // frame pointer in functions that need it (due to them not being taken
- // out of allocation, because a variable sized allocation hasn't been seen
- // yet). This is a slight code pessimization, but should still work.
- for (TargetRegisterClass::iterator I = RC->allocation_order_begin(MF),
- E = RC->allocation_order_end(MF); I != E; ++I)
- if (*I == Reg) {
- // We found a matching register class. Keep looking at others in case
- // we find one with larger registers that this physreg is also in.
- FoundRC = RC;
- FoundVT = ThisVT;
- break;
- }
- }
- return FoundRC;
-}
-
-
-namespace {
-/// AsmOperandInfo - This contains information for each constraint that we are
-/// lowering.
-struct SDISelAsmOperandInfo : public TargetLowering::AsmOperandInfo {
- /// CallOperand - If this is the result output operand or a clobber
- /// this is null, otherwise it is the incoming operand to the CallInst.
- /// This gets modified as the asm is processed.
- SDOperand CallOperand;
-
- /// AssignedRegs - If this is a register or register class operand, this
- /// contains the set of register corresponding to the operand.
- RegsForValue AssignedRegs;
-
- explicit SDISelAsmOperandInfo(const InlineAsm::ConstraintInfo &info)
- : TargetLowering::AsmOperandInfo(info), CallOperand(0,0) {
- }
-
- /// MarkAllocatedRegs - Once AssignedRegs is set, mark the assigned registers
- /// busy in OutputRegs/InputRegs.
- void MarkAllocatedRegs(bool isOutReg, bool isInReg,
- std::set<unsigned> &OutputRegs,
- std::set<unsigned> &InputRegs,
- const TargetRegisterInfo &TRI) const {
- if (isOutReg) {
- for (unsigned i = 0, e = AssignedRegs.Regs.size(); i != e; ++i)
- MarkRegAndAliases(AssignedRegs.Regs[i], OutputRegs, TRI);
- }
- if (isInReg) {
- for (unsigned i = 0, e = AssignedRegs.Regs.size(); i != e; ++i)
- MarkRegAndAliases(AssignedRegs.Regs[i], InputRegs, TRI);
- }
- }
-
-private:
- /// MarkRegAndAliases - Mark the specified register and all aliases in the
- /// specified set.
- static void MarkRegAndAliases(unsigned Reg, std::set<unsigned> &Regs,
- const TargetRegisterInfo &TRI) {
- assert(TargetRegisterInfo::isPhysicalRegister(Reg) && "Isn't a physreg");
- Regs.insert(Reg);
- if (const unsigned *Aliases = TRI.getAliasSet(Reg))
- for (; *Aliases; ++Aliases)
- Regs.insert(*Aliases);
- }
-};
-} // end anon namespace.
-
-
-/// GetRegistersForValue - Assign registers (virtual or physical) for the
-/// specified operand. We prefer to assign virtual registers, to allow the
-/// register allocator handle the assignment process. However, if the asm uses
-/// features that we can't model on machineinstrs, we have SDISel do the
-/// allocation. This produces generally horrible, but correct, code.
-///
-/// OpInfo describes the operand.
-/// HasEarlyClobber is true if there are any early clobber constraints (=&r)
-/// or any explicitly clobbered registers.
-/// Input and OutputRegs are the set of already allocated physical registers.
-///
-void SelectionDAGLowering::
-GetRegistersForValue(SDISelAsmOperandInfo &OpInfo, bool HasEarlyClobber,
- std::set<unsigned> &OutputRegs,
- std::set<unsigned> &InputRegs) {
- // Compute whether this value requires an input register, an output register,
- // or both.
- bool isOutReg = false;
- bool isInReg = false;
- switch (OpInfo.Type) {
- case InlineAsm::isOutput:
- isOutReg = true;
-
- // If this is an early-clobber output, or if there is an input
- // constraint that matches this, we need to reserve the input register
- // so no other inputs allocate to it.
- isInReg = OpInfo.isEarlyClobber || OpInfo.hasMatchingInput;
- break;
- case InlineAsm::isInput:
- isInReg = true;
- isOutReg = false;
- break;
- case InlineAsm::isClobber:
- isOutReg = true;
- isInReg = true;
- break;
- }
-
-
- MachineFunction &MF = DAG.getMachineFunction();
- SmallVector<unsigned, 4> Regs;
-
- // If this is a constraint for a single physreg, or a constraint for a
- // register class, find it.
- std::pair<unsigned, const TargetRegisterClass*> PhysReg =
- TLI.getRegForInlineAsmConstraint(OpInfo.ConstraintCode,
- OpInfo.ConstraintVT);
-
- unsigned NumRegs = 1;
- if (OpInfo.ConstraintVT != MVT::Other)
- NumRegs = TLI.getNumRegisters(OpInfo.ConstraintVT);
- MVT::ValueType RegVT;
- MVT::ValueType ValueVT = OpInfo.ConstraintVT;
-
-
- // If this is a constraint for a specific physical register, like {r17},
- // assign it now.
- if (PhysReg.first) {
- if (OpInfo.ConstraintVT == MVT::Other)
- ValueVT = *PhysReg.second->vt_begin();
-
- // Get the actual register value type. This is important, because the user
- // may have asked for (e.g.) the AX register in i32 type. We need to
- // remember that AX is actually i16 to get the right extension.
- RegVT = *PhysReg.second->vt_begin();
-
- // This is a explicit reference to a physical register.
- Regs.push_back(PhysReg.first);
-
- // If this is an expanded reference, add the rest of the regs to Regs.
- if (NumRegs != 1) {
- TargetRegisterClass::iterator I = PhysReg.second->begin();
- TargetRegisterClass::iterator E = PhysReg.second->end();
- for (; *I != PhysReg.first; ++I)
- assert(I != E && "Didn't find reg!");
-
- // Already added the first reg.
- --NumRegs; ++I;
- for (; NumRegs; --NumRegs, ++I) {
- assert(I != E && "Ran out of registers to allocate!");
- Regs.push_back(*I);
- }
- }
- OpInfo.AssignedRegs = RegsForValue(TLI, Regs, RegVT, ValueVT);
- const TargetRegisterInfo *TRI = DAG.getTarget().getRegisterInfo();
- OpInfo.MarkAllocatedRegs(isOutReg, isInReg, OutputRegs, InputRegs, *TRI);
- return;
- }
-
- // Otherwise, if this was a reference to an LLVM register class, create vregs
- // for this reference.
- std::vector<unsigned> RegClassRegs;
- const TargetRegisterClass *RC = PhysReg.second;
- if (RC) {
- // If this is an early clobber or tied register, our regalloc doesn't know
- // how to maintain the constraint. If it isn't, go ahead and create vreg
- // and let the regalloc do the right thing.
- if (!OpInfo.hasMatchingInput && !OpInfo.isEarlyClobber &&
- // If there is some other early clobber and this is an input register,
- // then we are forced to pre-allocate the input reg so it doesn't
- // conflict with the earlyclobber.
- !(OpInfo.Type == InlineAsm::isInput && HasEarlyClobber)) {
- RegVT = *PhysReg.second->vt_begin();
-
- if (OpInfo.ConstraintVT == MVT::Other)
- ValueVT = RegVT;
-
- // Create the appropriate number of virtual registers.
- MachineRegisterInfo &RegInfo = MF.getRegInfo();
- for (; NumRegs; --NumRegs)
- Regs.push_back(RegInfo.createVirtualRegister(PhysReg.second));
-
- OpInfo.AssignedRegs = RegsForValue(TLI, Regs, RegVT, ValueVT);
- return;
- }
-
- // Otherwise, we can't allocate it. Let the code below figure out how to
- // maintain these constraints.
- RegClassRegs.assign(PhysReg.second->begin(), PhysReg.second->end());
-
- } else {
- // This is a reference to a register class that doesn't directly correspond
- // to an LLVM register class. Allocate NumRegs consecutive, available,
- // registers from the class.
- RegClassRegs = TLI.getRegClassForInlineAsmConstraint(OpInfo.ConstraintCode,
- OpInfo.ConstraintVT);
- }
-
- const TargetRegisterInfo *TRI = DAG.getTarget().getRegisterInfo();
- unsigned NumAllocated = 0;
- for (unsigned i = 0, e = RegClassRegs.size(); i != e; ++i) {
- unsigned Reg = RegClassRegs[i];
- // See if this register is available.
- if ((isOutReg && OutputRegs.count(Reg)) || // Already used.
- (isInReg && InputRegs.count(Reg))) { // Already used.
- // Make sure we find consecutive registers.
- NumAllocated = 0;
- continue;
- }
-
- // Check to see if this register is allocatable (i.e. don't give out the
- // stack pointer).
- if (RC == 0) {
- RC = isAllocatableRegister(Reg, MF, TLI, TRI);
- if (!RC) { // Couldn't allocate this register.
- // Reset NumAllocated to make sure we return consecutive registers.
- NumAllocated = 0;
- continue;
- }
- }
-
- // Okay, this register is good, we can use it.
- ++NumAllocated;
-
- // If we allocated enough consecutive registers, succeed.
- if (NumAllocated == NumRegs) {
- unsigned RegStart = (i-NumAllocated)+1;
- unsigned RegEnd = i+1;
- // Mark all of the allocated registers used.
- for (unsigned i = RegStart; i != RegEnd; ++i)
- Regs.push_back(RegClassRegs[i]);
-
- OpInfo.AssignedRegs = RegsForValue(TLI, Regs, *RC->vt_begin(),
- OpInfo.ConstraintVT);
- OpInfo.MarkAllocatedRegs(isOutReg, isInReg, OutputRegs, InputRegs, *TRI);
- return;
- }
- }
-
- // Otherwise, we couldn't allocate enough registers for this.
-}
-
-
-/// visitInlineAsm - Handle a call to an InlineAsm object.
-///
-void SelectionDAGLowering::visitInlineAsm(CallSite CS) {
- InlineAsm *IA = cast<InlineAsm>(CS.getCalledValue());
-
- /// ConstraintOperands - Information about all of the constraints.
- std::vector<SDISelAsmOperandInfo> ConstraintOperands;
-
- SDOperand Chain = getRoot();
- SDOperand Flag;
-
- std::set<unsigned> OutputRegs, InputRegs;
-
- // Do a prepass over the constraints, canonicalizing them, and building up the
- // ConstraintOperands list.
- std::vector<InlineAsm::ConstraintInfo>
- ConstraintInfos = IA->ParseConstraints();
-
- // SawEarlyClobber - Keep track of whether we saw an earlyclobber output
- // constraint. If so, we can't let the register allocator allocate any input
- // registers, because it will not know to avoid the earlyclobbered output reg.
- bool SawEarlyClobber = false;
-
- unsigned ArgNo = 0; // ArgNo - The argument of the CallInst.
- unsigned ResNo = 0; // ResNo - The result number of the next output.
- for (unsigned i = 0, e = ConstraintInfos.size(); i != e; ++i) {
- ConstraintOperands.push_back(SDISelAsmOperandInfo(ConstraintInfos[i]));
- SDISelAsmOperandInfo &OpInfo = ConstraintOperands.back();
-
- MVT::ValueType OpVT = MVT::Other;
-
- // Compute the value type for each operand.
- switch (OpInfo.Type) {
- case InlineAsm::isOutput:
- // Indirect outputs just consume an argument.
- if (OpInfo.isIndirect) {
- OpInfo.CallOperandVal = CS.getArgument(ArgNo++);
- break;
- }
- // The return value of the call is this value. As such, there is no
- // corresponding argument.
- assert(CS.getType() != Type::VoidTy && "Bad inline asm!");
- if (const StructType *STy = dyn_cast<StructType>(CS.getType())) {
- OpVT = TLI.getValueType(STy->getElementType(ResNo));
- } else {
- assert(ResNo == 0 && "Asm only has one result!");
- OpVT = TLI.getValueType(CS.getType());
- }
- ++ResNo;
- break;
- case InlineAsm::isInput:
- OpInfo.CallOperandVal = CS.getArgument(ArgNo++);
- break;
- case InlineAsm::isClobber:
- // Nothing to do.
- break;
- }
-
- // If this is an input or an indirect output, process the call argument.
- // BasicBlocks are labels, currently appearing only in asm's.
- if (OpInfo.CallOperandVal) {
- if (BasicBlock *BB = dyn_cast<BasicBlock>(OpInfo.CallOperandVal))
- OpInfo.CallOperand = DAG.getBasicBlock(FuncInfo.MBBMap[BB]);
- else {
- OpInfo.CallOperand = getValue(OpInfo.CallOperandVal);
- const Type *OpTy = OpInfo.CallOperandVal->getType();
- // If this is an indirect operand, the operand is a pointer to the
- // accessed type.
- if (OpInfo.isIndirect)
- OpTy = cast<PointerType>(OpTy)->getElementType();
-
- // If OpTy is not a first-class value, it may be a struct/union that we
- // can tile with integers.
- if (!OpTy->isFirstClassType() && OpTy->isSized()) {
- unsigned BitSize = TD->getTypeSizeInBits(OpTy);
- switch (BitSize) {
- default: break;
- case 1:
- case 8:
- case 16:
- case 32:
- case 64:
- OpTy = IntegerType::get(BitSize);
- break;
- }
- }
-
- OpVT = TLI.getValueType(OpTy, true);
- }
- }
-
- OpInfo.ConstraintVT = OpVT;
-
- // Compute the constraint code and ConstraintType to use.
- TLI.ComputeConstraintToUse(OpInfo, OpInfo.CallOperand, &DAG);
-
- // Keep track of whether we see an earlyclobber.
- SawEarlyClobber |= OpInfo.isEarlyClobber;
-
- // If we see a clobber of a register, it is an early clobber.
- if (!SawEarlyClobber &&
- OpInfo.Type == InlineAsm::isClobber &&
- OpInfo.ConstraintType == TargetLowering::C_Register) {
- // Note that we want to ignore things that we don't trick here, like
- // dirflag, fpsr, flags, etc.
- std::pair<unsigned, const TargetRegisterClass*> PhysReg =
- TLI.getRegForInlineAsmConstraint(OpInfo.ConstraintCode,
- OpInfo.ConstraintVT);
- if (PhysReg.first || PhysReg.second) {
- // This is a register we know of.
- SawEarlyClobber = true;
- }
- }
-
- // If this is a memory input, and if the operand is not indirect, do what we
- // need to to provide an address for the memory input.
- if (OpInfo.ConstraintType == TargetLowering::C_Memory &&
- !OpInfo.isIndirect) {
- assert(OpInfo.Type == InlineAsm::isInput &&
- "Can only indirectify direct input operands!");
-
- // Memory operands really want the address of the value. If we don't have
- // an indirect input, put it in the constpool if we can, otherwise spill
- // it to a stack slot.
-
- // If the operand is a float, integer, or vector constant, spill to a
- // constant pool entry to get its address.
- Value *OpVal = OpInfo.CallOperandVal;
- if (isa<ConstantFP>(OpVal) || isa<ConstantInt>(OpVal) ||
- isa<ConstantVector>(OpVal)) {
- OpInfo.CallOperand = DAG.getConstantPool(cast<Constant>(OpVal),
- TLI.getPointerTy());
- } else {
- // Otherwise, create a stack slot and emit a store to it before the
- // asm.
- const Type *Ty = OpVal->getType();
- uint64_t TySize = TLI.getTargetData()->getABITypeSize(Ty);
- unsigned Align = TLI.getTargetData()->getPrefTypeAlignment(Ty);
- MachineFunction &MF = DAG.getMachineFunction();
- int SSFI = MF.getFrameInfo()->CreateStackObject(TySize, Align);
- SDOperand StackSlot = DAG.getFrameIndex(SSFI, TLI.getPointerTy());
- Chain = DAG.getStore(Chain, OpInfo.CallOperand, StackSlot, NULL, 0);
- OpInfo.CallOperand = StackSlot;
- }
-
- // There is no longer a Value* corresponding to this operand.
- OpInfo.CallOperandVal = 0;
- // It is now an indirect operand.
- OpInfo.isIndirect = true;
- }
-
- // If this constraint is for a specific register, allocate it before
- // anything else.
- if (OpInfo.ConstraintType == TargetLowering::C_Register)
- GetRegistersForValue(OpInfo, SawEarlyClobber, OutputRegs, InputRegs);
- }
- ConstraintInfos.clear();
-
-
- // Second pass - Loop over all of the operands, assigning virtual or physregs
- // to registerclass operands.
- for (unsigned i = 0, e = ConstraintOperands.size(); i != e; ++i) {
- SDISelAsmOperandInfo &OpInfo = ConstraintOperands[i];
-
- // C_Register operands have already been allocated, Other/Memory don't need
- // to be.
- if (OpInfo.ConstraintType == TargetLowering::C_RegisterClass)
- GetRegistersForValue(OpInfo, SawEarlyClobber, OutputRegs, InputRegs);
- }
-
- // AsmNodeOperands - The operands for the ISD::INLINEASM node.
- std::vector<SDOperand> AsmNodeOperands;
- AsmNodeOperands.push_back(SDOperand()); // reserve space for input chain
- AsmNodeOperands.push_back(
- DAG.getTargetExternalSymbol(IA->getAsmString().c_str(), MVT::Other));
-
-
- // Loop over all of the inputs, copying the operand values into the
- // appropriate registers and processing the output regs.
- RegsForValue RetValRegs;
-
- // IndirectStoresToEmit - The set of stores to emit after the inline asm node.
- std::vector<std::pair<RegsForValue, Value*> > IndirectStoresToEmit;
-
- for (unsigned i = 0, e = ConstraintOperands.size(); i != e; ++i) {
- SDISelAsmOperandInfo &OpInfo = ConstraintOperands[i];
-
- switch (OpInfo.Type) {
- case InlineAsm::isOutput: {
- if (OpInfo.ConstraintType != TargetLowering::C_RegisterClass &&
- OpInfo.ConstraintType != TargetLowering::C_Register) {
- // Memory output, or 'other' output (e.g. 'X' constraint).
- assert(OpInfo.isIndirect && "Memory output must be indirect operand");
-
- // Add information to the INLINEASM node to know about this output.
- unsigned ResOpType = 4/*MEM*/ | (1 << 3);
- AsmNodeOperands.push_back(DAG.getTargetConstant(ResOpType,
- TLI.getPointerTy()));
- AsmNodeOperands.push_back(OpInfo.CallOperand);
- break;
- }
-
- // Otherwise, this is a register or register class output.
-
- // Copy the output from the appropriate register. Find a register that
- // we can use.
- if (OpInfo.AssignedRegs.Regs.empty()) {
- cerr << "Couldn't allocate output reg for contraint '"
- << OpInfo.ConstraintCode << "'!\n";
- exit(1);
- }
-
- // If this is an indirect operand, store through the pointer after the
- // asm.
- if (OpInfo.isIndirect) {
- IndirectStoresToEmit.push_back(std::make_pair(OpInfo.AssignedRegs,
- OpInfo.CallOperandVal));
- } else {
- // This is the result value of the call.
- assert(CS.getType() != Type::VoidTy && "Bad inline asm!");
- // Concatenate this output onto the outputs list.
- RetValRegs.append(OpInfo.AssignedRegs);
- }
-
- // Add information to the INLINEASM node to know that this register is
- // set.
- OpInfo.AssignedRegs.AddInlineAsmOperands(2 /*REGDEF*/, DAG,
- AsmNodeOperands);
- break;
- }
- case InlineAsm::isInput: {
- SDOperand InOperandVal = OpInfo.CallOperand;
-
- if (isdigit(OpInfo.ConstraintCode[0])) { // Matching constraint?
- // If this is required to match an output register we have already set,
- // just use its register.
- unsigned OperandNo = atoi(OpInfo.ConstraintCode.c_str());
-
- // Scan until we find the definition we already emitted of this operand.
- // When we find it, create a RegsForValue operand.
- unsigned CurOp = 2; // The first operand.
- for (; OperandNo; --OperandNo) {
- // Advance to the next operand.
- unsigned NumOps =
- cast<ConstantSDNode>(AsmNodeOperands[CurOp])->getValue();
- assert(((NumOps & 7) == 2 /*REGDEF*/ ||
- (NumOps & 7) == 4 /*MEM*/) &&
- "Skipped past definitions?");
- CurOp += (NumOps>>3)+1;
- }
-
- unsigned NumOps =
- cast<ConstantSDNode>(AsmNodeOperands[CurOp])->getValue();
- if ((NumOps & 7) == 2 /*REGDEF*/) {
- // Add NumOps>>3 registers to MatchedRegs.
- RegsForValue MatchedRegs;
- MatchedRegs.TLI = &TLI;
- MatchedRegs.ValueVTs.push_back(InOperandVal.getValueType());
- MatchedRegs.RegVTs.push_back(AsmNodeOperands[CurOp+1].getValueType());
- for (unsigned i = 0, e = NumOps>>3; i != e; ++i) {
- unsigned Reg =
- cast<RegisterSDNode>(AsmNodeOperands[++CurOp])->getReg();
- MatchedRegs.Regs.push_back(Reg);
- }
-
- // Use the produced MatchedRegs object to
- MatchedRegs.getCopyToRegs(InOperandVal, DAG, Chain, &Flag);
- MatchedRegs.AddInlineAsmOperands(1 /*REGUSE*/, DAG, AsmNodeOperands);
- break;
- } else {
- assert((NumOps & 7) == 4/*MEM*/ && "Unknown matching constraint!");
- assert((NumOps >> 3) == 1 && "Unexpected number of operands");
- // Add information to the INLINEASM node to know about this input.
- unsigned ResOpType = 4/*MEM*/ | (1 << 3);
- AsmNodeOperands.push_back(DAG.getTargetConstant(ResOpType,
- TLI.getPointerTy()));
- AsmNodeOperands.push_back(AsmNodeOperands[CurOp+1]);
- break;
- }
- }
-
- if (OpInfo.ConstraintType == TargetLowering::C_Other) {
- assert(!OpInfo.isIndirect &&
- "Don't know how to handle indirect other inputs yet!");
-
- std::vector<SDOperand> Ops;
- TLI.LowerAsmOperandForConstraint(InOperandVal, OpInfo.ConstraintCode[0],
- Ops, DAG);
- if (Ops.empty()) {
- cerr << "Invalid operand for inline asm constraint '"
- << OpInfo.ConstraintCode << "'!\n";
- exit(1);
- }
-
- // Add information to the INLINEASM node to know about this input.
- unsigned ResOpType = 3 /*IMM*/ | (Ops.size() << 3);
- AsmNodeOperands.push_back(DAG.getTargetConstant(ResOpType,
- TLI.getPointerTy()));
- AsmNodeOperands.insert(AsmNodeOperands.end(), Ops.begin(), Ops.end());
- break;
- } else if (OpInfo.ConstraintType == TargetLowering::C_Memory) {
- assert(OpInfo.isIndirect && "Operand must be indirect to be a mem!");
- assert(InOperandVal.getValueType() == TLI.getPointerTy() &&
- "Memory operands expect pointer values");
-
- // Add information to the INLINEASM node to know about this input.
- unsigned ResOpType = 4/*MEM*/ | (1 << 3);
- AsmNodeOperands.push_back(DAG.getTargetConstant(ResOpType,
- TLI.getPointerTy()));
- AsmNodeOperands.push_back(InOperandVal);
- break;
- }
-
- assert((OpInfo.ConstraintType == TargetLowering::C_RegisterClass ||
- OpInfo.ConstraintType == TargetLowering::C_Register) &&
- "Unknown constraint type!");
- assert(!OpInfo.isIndirect &&
- "Don't know how to handle indirect register inputs yet!");
-
- // Copy the input into the appropriate registers.
- assert(!OpInfo.AssignedRegs.Regs.empty() &&
- "Couldn't allocate input reg!");
-
- OpInfo.AssignedRegs.getCopyToRegs(InOperandVal, DAG, Chain, &Flag);
-
- OpInfo.AssignedRegs.AddInlineAsmOperands(1/*REGUSE*/, DAG,
- AsmNodeOperands);
- break;
- }
- case InlineAsm::isClobber: {
- // Add the clobbered value to the operand list, so that the register
- // allocator is aware that the physreg got clobbered.
- if (!OpInfo.AssignedRegs.Regs.empty())
- OpInfo.AssignedRegs.AddInlineAsmOperands(2/*REGDEF*/, DAG,
- AsmNodeOperands);
- break;
- }
- }
- }
-
- // Finish up input operands.
- AsmNodeOperands[0] = Chain;
- if (Flag.Val) AsmNodeOperands.push_back(Flag);
-
- Chain = DAG.getNode(ISD::INLINEASM,
- DAG.getNodeValueTypes(MVT::Other, MVT::Flag), 2,
- &AsmNodeOperands[0], AsmNodeOperands.size());
- Flag = Chain.getValue(1);
-
- // If this asm returns a register value, copy the result from that register
- // and set it as the value of the call.
- if (!RetValRegs.Regs.empty()) {
- SDOperand Val = RetValRegs.getCopyFromRegs(DAG, Chain, &Flag);
-
- // If any of the results of the inline asm is a vector, it may have the
- // wrong width/num elts. This can happen for register classes that can
- // contain multiple different value types. The preg or vreg allocated may
- // not have the same VT as was expected. Convert it to the right type with
- // bit_convert.
- if (const StructType *ResSTy = dyn_cast<StructType>(CS.getType())) {
- for (unsigned i = 0, e = ResSTy->getNumElements(); i != e; ++i) {
- if (MVT::isVector(Val.Val->getValueType(i)))
- Val = DAG.getNode(ISD::BIT_CONVERT,
- TLI.getValueType(ResSTy->getElementType(i)), Val);
- }
- } else {
- if (MVT::isVector(Val.getValueType()))
- Val = DAG.getNode(ISD::BIT_CONVERT, TLI.getValueType(CS.getType()),
- Val);
- }
-
- setValue(CS.getInstruction(), Val);
- }
-
- std::vector<std::pair<SDOperand, Value*> > StoresToEmit;
-
- // Process indirect outputs, first output all of the flagged copies out of
- // physregs.
- for (unsigned i = 0, e = IndirectStoresToEmit.size(); i != e; ++i) {
- RegsForValue &OutRegs = IndirectStoresToEmit[i].first;
- Value *Ptr = IndirectStoresToEmit[i].second;
- SDOperand OutVal = OutRegs.getCopyFromRegs(DAG, Chain, &Flag);
- StoresToEmit.push_back(std::make_pair(OutVal, Ptr));
- }
-
- // Emit the non-flagged stores from the physregs.
- SmallVector<SDOperand, 8> OutChains;
- for (unsigned i = 0, e = StoresToEmit.size(); i != e; ++i)
- OutChains.push_back(DAG.getStore(Chain, StoresToEmit[i].first,
- getValue(StoresToEmit[i].second),
- StoresToEmit[i].second, 0));
- if (!OutChains.empty())
- Chain = DAG.getNode(ISD::TokenFactor, MVT::Other,
- &OutChains[0], OutChains.size());
- DAG.setRoot(Chain);
-}
-
-
-void SelectionDAGLowering::visitMalloc(MallocInst &I) {
- SDOperand Src = getValue(I.getOperand(0));
-
- MVT::ValueType IntPtr = TLI.getPointerTy();
-
- if (IntPtr < Src.getValueType())
- Src = DAG.getNode(ISD::TRUNCATE, IntPtr, Src);
- else if (IntPtr > Src.getValueType())
- Src = DAG.getNode(ISD::ZERO_EXTEND, IntPtr, Src);
-
- // Scale the source by the type size.
- uint64_t ElementSize = TD->getABITypeSize(I.getType()->getElementType());
- Src = DAG.getNode(ISD::MUL, Src.getValueType(),
- Src, DAG.getIntPtrConstant(ElementSize));
-
- TargetLowering::ArgListTy Args;
- TargetLowering::ArgListEntry Entry;
- Entry.Node = Src;
- Entry.Ty = TLI.getTargetData()->getIntPtrType();
- Args.push_back(Entry);
-
- std::pair<SDOperand,SDOperand> Result =
- TLI.LowerCallTo(getRoot(), I.getType(), false, false, false, CallingConv::C,
- true, DAG.getExternalSymbol("malloc", IntPtr), Args, DAG);
- setValue(&I, Result.first); // Pointers always fit in registers
- DAG.setRoot(Result.second);
-}
-
-void SelectionDAGLowering::visitFree(FreeInst &I) {
- TargetLowering::ArgListTy Args;
- TargetLowering::ArgListEntry Entry;
- Entry.Node = getValue(I.getOperand(0));
- Entry.Ty = TLI.getTargetData()->getIntPtrType();
- Args.push_back(Entry);
- MVT::ValueType IntPtr = TLI.getPointerTy();
- std::pair<SDOperand,SDOperand> Result =
- TLI.LowerCallTo(getRoot(), Type::VoidTy, false, false, false,
- CallingConv::C, true,
- DAG.getExternalSymbol("free", IntPtr), Args, DAG);
- DAG.setRoot(Result.second);
-}
-
-// EmitInstrWithCustomInserter - This method should be implemented by targets
-// that mark instructions with the 'usesCustomDAGSchedInserter' flag. These
-// instructions are special in various ways, which require special support to
-// insert. The specified MachineInstr is created but not inserted into any
-// basic blocks, and the scheduler passes ownership of it to this method.
-MachineBasicBlock *TargetLowering::EmitInstrWithCustomInserter(MachineInstr *MI,
- MachineBasicBlock *MBB) {
- cerr << "If a target marks an instruction with "
- << "'usesCustomDAGSchedInserter', it must implement "
- << "TargetLowering::EmitInstrWithCustomInserter!\n";
- abort();
- return 0;
-}
-
-void SelectionDAGLowering::visitVAStart(CallInst &I) {
- DAG.setRoot(DAG.getNode(ISD::VASTART, MVT::Other, getRoot(),
- getValue(I.getOperand(1)),
- DAG.getSrcValue(I.getOperand(1))));
-}
-
-void SelectionDAGLowering::visitVAArg(VAArgInst &I) {
- SDOperand V = DAG.getVAArg(TLI.getValueType(I.getType()), getRoot(),
- getValue(I.getOperand(0)),
- DAG.getSrcValue(I.getOperand(0)));
- setValue(&I, V);
- DAG.setRoot(V.getValue(1));
-}
-
-void SelectionDAGLowering::visitVAEnd(CallInst &I) {
- DAG.setRoot(DAG.getNode(ISD::VAEND, MVT::Other, getRoot(),
- getValue(I.getOperand(1)),
- DAG.getSrcValue(I.getOperand(1))));
-}
-
-void SelectionDAGLowering::visitVACopy(CallInst &I) {
- DAG.setRoot(DAG.getNode(ISD::VACOPY, MVT::Other, getRoot(),
- getValue(I.getOperand(1)),
- getValue(I.getOperand(2)),
- DAG.getSrcValue(I.getOperand(1)),
- DAG.getSrcValue(I.getOperand(2))));
-}
-
-/// TargetLowering::LowerArguments - This is the default LowerArguments
-/// implementation, which just inserts a FORMAL_ARGUMENTS node. FIXME: When all
-/// targets are migrated to using FORMAL_ARGUMENTS, this hook should be
-/// integrated into SDISel.
-std::vector<SDOperand>
-TargetLowering::LowerArguments(Function &F, SelectionDAG &DAG) {
- // Add CC# and isVararg as operands to the FORMAL_ARGUMENTS node.
- std::vector<SDOperand> Ops;
- Ops.push_back(DAG.getRoot());
- Ops.push_back(DAG.getConstant(F.getCallingConv(), getPointerTy()));
- Ops.push_back(DAG.getConstant(F.isVarArg(), getPointerTy()));
-
- // Add one result value for each formal argument.
- std::vector<MVT::ValueType> RetVals;
- unsigned j = 1;
- for (Function::arg_iterator I = F.arg_begin(), E = F.arg_end();
- I != E; ++I, ++j) {
- MVT::ValueType VT = getValueType(I->getType());
- ISD::ArgFlagsTy Flags;
- unsigned OriginalAlignment =
- getTargetData()->getABITypeAlignment(I->getType());
-
- if (F.paramHasAttr(j, ParamAttr::ZExt))
- Flags.setZExt();
- if (F.paramHasAttr(j, ParamAttr::SExt))
- Flags.setSExt();
- if (F.paramHasAttr(j, ParamAttr::InReg))
- Flags.setInReg();
- if (F.paramHasAttr(j, ParamAttr::StructRet))
- Flags.setSRet();
- if (F.paramHasAttr(j, ParamAttr::ByVal)) {
- Flags.setByVal();
- const PointerType *Ty = cast<PointerType>(I->getType());
- const Type *ElementTy = Ty->getElementType();
- unsigned FrameAlign = getByValTypeAlignment(ElementTy);
- unsigned FrameSize = getTargetData()->getABITypeSize(ElementTy);
- // For ByVal, alignment should be passed from FE. BE will guess if
- // this info is not there but there are cases it cannot get right.
- if (F.getParamAlignment(j))
- FrameAlign = F.getParamAlignment(j);
- Flags.setByValAlign(FrameAlign);
- Flags.setByValSize(FrameSize);
- }
- if (F.paramHasAttr(j, ParamAttr::Nest))
- Flags.setNest();
- Flags.setOrigAlign(OriginalAlignment);
-
- MVT::ValueType RegisterVT = getRegisterType(VT);
- unsigned NumRegs = getNumRegisters(VT);
- for (unsigned i = 0; i != NumRegs; ++i) {
- RetVals.push_back(RegisterVT);
- ISD::ArgFlagsTy MyFlags = Flags;
- if (NumRegs > 1 && i == 0)
- MyFlags.setSplit();
- // if it isn't first piece, alignment must be 1
- else if (i > 0)
- MyFlags.setOrigAlign(1);
- Ops.push_back(DAG.getArgFlags(MyFlags));
- }
- }
-
- RetVals.push_back(MVT::Other);
-
- // Create the node.
- SDNode *Result = DAG.getNode(ISD::FORMAL_ARGUMENTS,
- DAG.getVTList(&RetVals[0], RetVals.size()),
- &Ops[0], Ops.size()).Val;
-
- // Prelower FORMAL_ARGUMENTS. This isn't required for functionality, but
- // allows exposing the loads that may be part of the argument access to the
- // first DAGCombiner pass.
- SDOperand TmpRes = LowerOperation(SDOperand(Result, 0), DAG);
-
- // The number of results should match up, except that the lowered one may have
- // an extra flag result.
- assert((Result->getNumValues() == TmpRes.Val->getNumValues() ||
- (Result->getNumValues()+1 == TmpRes.Val->getNumValues() &&
- TmpRes.getValue(Result->getNumValues()).getValueType() == MVT::Flag))
- && "Lowering produced unexpected number of results!");
- Result = TmpRes.Val;
-
- unsigned NumArgRegs = Result->getNumValues() - 1;
- DAG.setRoot(SDOperand(Result, NumArgRegs));
-
- // Set up the return result vector.
- Ops.clear();
- unsigned i = 0;
- unsigned Idx = 1;
- for (Function::arg_iterator I = F.arg_begin(), E = F.arg_end(); I != E;
- ++I, ++Idx) {
- MVT::ValueType VT = getValueType(I->getType());
- MVT::ValueType PartVT = getRegisterType(VT);
-
- unsigned NumParts = getNumRegisters(VT);
- SmallVector<SDOperand, 4> Parts(NumParts);
- for (unsigned j = 0; j != NumParts; ++j)
- Parts[j] = SDOperand(Result, i++);
-
- ISD::NodeType AssertOp = ISD::DELETED_NODE;
- if (F.paramHasAttr(Idx, ParamAttr::SExt))
- AssertOp = ISD::AssertSext;
- else if (F.paramHasAttr(Idx, ParamAttr::ZExt))
- AssertOp = ISD::AssertZext;
-
- Ops.push_back(getCopyFromParts(DAG, &Parts[0], NumParts, PartVT, VT,
- AssertOp));
- }
- assert(i == NumArgRegs && "Argument register count mismatch!");
- return Ops;
-}
-
-
-/// TargetLowering::LowerCallTo - This is the default LowerCallTo
-/// implementation, which just inserts an ISD::CALL node, which is later custom
-/// lowered by the target to something concrete. FIXME: When all targets are
-/// migrated to using ISD::CALL, this hook should be integrated into SDISel.
-std::pair<SDOperand, SDOperand>
-TargetLowering::LowerCallTo(SDOperand Chain, const Type *RetTy,
- bool RetSExt, bool RetZExt, bool isVarArg,
- unsigned CallingConv, bool isTailCall,
- SDOperand Callee,
- ArgListTy &Args, SelectionDAG &DAG) {
- SmallVector<SDOperand, 32> Ops;
- Ops.push_back(Chain); // Op#0 - Chain
- Ops.push_back(DAG.getConstant(CallingConv, getPointerTy())); // Op#1 - CC
- Ops.push_back(DAG.getConstant(isVarArg, getPointerTy())); // Op#2 - VarArg
- Ops.push_back(DAG.getConstant(isTailCall, getPointerTy())); // Op#3 - Tail
- Ops.push_back(Callee);
-
- // Handle all of the outgoing arguments.
- for (unsigned i = 0, e = Args.size(); i != e; ++i) {
- MVT::ValueType VT = getValueType(Args[i].Ty);
- SDOperand Op = Args[i].Node;
- ISD::ArgFlagsTy Flags;
- unsigned OriginalAlignment =
- getTargetData()->getABITypeAlignment(Args[i].Ty);
-
- if (Args[i].isZExt)
- Flags.setZExt();
- if (Args[i].isSExt)
- Flags.setSExt();
- if (Args[i].isInReg)
- Flags.setInReg();
- if (Args[i].isSRet)
- Flags.setSRet();
- if (Args[i].isByVal) {
- Flags.setByVal();
- const PointerType *Ty = cast<PointerType>(Args[i].Ty);
- const Type *ElementTy = Ty->getElementType();
- unsigned FrameAlign = getByValTypeAlignment(ElementTy);
- unsigned FrameSize = getTargetData()->getABITypeSize(ElementTy);
- // For ByVal, alignment should come from FE. BE will guess if this
- // info is not there but there are cases it cannot get right.
- if (Args[i].Alignment)
- FrameAlign = Args[i].Alignment;
- Flags.setByValAlign(FrameAlign);
- Flags.setByValSize(FrameSize);
- }
- if (Args[i].isNest)
- Flags.setNest();
- Flags.setOrigAlign(OriginalAlignment);
-
- MVT::ValueType PartVT = getRegisterType(VT);
- unsigned NumParts = getNumRegisters(VT);
- SmallVector<SDOperand, 4> Parts(NumParts);
- ISD::NodeType ExtendKind = ISD::ANY_EXTEND;
-
- if (Args[i].isSExt)
- ExtendKind = ISD::SIGN_EXTEND;
- else if (Args[i].isZExt)
- ExtendKind = ISD::ZERO_EXTEND;
-
- getCopyToParts(DAG, Op, &Parts[0], NumParts, PartVT, ExtendKind);
-
- for (unsigned i = 0; i != NumParts; ++i) {
- // if it isn't first piece, alignment must be 1
- ISD::ArgFlagsTy MyFlags = Flags;
- if (NumParts > 1 && i == 0)
- MyFlags.setSplit();
- else if (i != 0)
- MyFlags.setOrigAlign(1);
-
- Ops.push_back(Parts[i]);
- Ops.push_back(DAG.getArgFlags(MyFlags));
- }
- }
-
- // Figure out the result value types. We start by making a list of
- // the potentially illegal return value types.
- SmallVector<MVT::ValueType, 4> LoweredRetTys;
- SmallVector<MVT::ValueType, 4> RetTys;
- ComputeValueVTs(*this, RetTy, RetTys);
-
- // Then we translate that to a list of legal types.
- for (unsigned I = 0, E = RetTys.size(); I != E; ++I) {
- MVT::ValueType VT = RetTys[I];
- MVT::ValueType RegisterVT = getRegisterType(VT);
- unsigned NumRegs = getNumRegisters(VT);
- for (unsigned i = 0; i != NumRegs; ++i)
- LoweredRetTys.push_back(RegisterVT);
- }
-
- LoweredRetTys.push_back(MVT::Other); // Always has a chain.
-
- // Create the CALL node.
- SDOperand Res = DAG.getNode(ISD::CALL,
- DAG.getVTList(&LoweredRetTys[0],
- LoweredRetTys.size()),
- &Ops[0], Ops.size());
- Chain = Res.getValue(LoweredRetTys.size() - 1);
-
- // Gather up the call result into a single value.
- if (RetTy != Type::VoidTy) {
- ISD::NodeType AssertOp = ISD::DELETED_NODE;
-
- if (RetSExt)
- AssertOp = ISD::AssertSext;
- else if (RetZExt)
- AssertOp = ISD::AssertZext;
-
- SmallVector<SDOperand, 4> ReturnValues;
- unsigned RegNo = 0;
- for (unsigned I = 0, E = RetTys.size(); I != E; ++I) {
- MVT::ValueType VT = RetTys[I];
- MVT::ValueType RegisterVT = getRegisterType(VT);
- unsigned NumRegs = getNumRegisters(VT);
- unsigned RegNoEnd = NumRegs + RegNo;
- SmallVector<SDOperand, 4> Results;
- for (; RegNo != RegNoEnd; ++RegNo)
- Results.push_back(Res.getValue(RegNo));
- SDOperand ReturnValue =
- getCopyFromParts(DAG, &Results[0], NumRegs, RegisterVT, VT,
- AssertOp);
- ReturnValues.push_back(ReturnValue);
- }
- Res = ReturnValues.size() == 1 ? ReturnValues.front() :
- DAG.getNode(ISD::MERGE_VALUES,
- DAG.getVTList(&RetTys[0], RetTys.size()),
- &ReturnValues[0], ReturnValues.size());
- }
-
- return std::make_pair(Res, Chain);
-}
-
-SDOperand TargetLowering::LowerOperation(SDOperand Op, SelectionDAG &DAG) {
- assert(0 && "LowerOperation not implemented for this target!");
- abort();
- return SDOperand();
-}
-
-SDOperand TargetLowering::CustomPromoteOperation(SDOperand Op,
- SelectionDAG &DAG) {
- assert(0 && "CustomPromoteOperation not implemented for this target!");
- abort();
- return SDOperand();
-}
-
-//===----------------------------------------------------------------------===//
-// SelectionDAGISel code
-//===----------------------------------------------------------------------===//
-
-unsigned SelectionDAGISel::MakeReg(MVT::ValueType VT) {
- return RegInfo->createVirtualRegister(TLI.getRegClassFor(VT));
-}
-
-void SelectionDAGISel::getAnalysisUsage(AnalysisUsage &AU) const {
- AU.addRequired<AliasAnalysis>();
- AU.addRequired<CollectorModuleMetadata>();
- AU.setPreservesAll();
-}
-
-bool SelectionDAGISel::runOnFunction(Function &Fn) {
- // Get alias analysis for load/store combining.
- AA = &getAnalysis<AliasAnalysis>();
-
- MachineFunction &MF = MachineFunction::construct(&Fn, TLI.getTargetMachine());
- if (MF.getFunction()->hasCollector())
- GCI = &getAnalysis<CollectorModuleMetadata>().get(*MF.getFunction());
- else
- GCI = 0;
- RegInfo = &MF.getRegInfo();
- DOUT << "\n\n\n=== " << Fn.getName() << "\n";
-
- FunctionLoweringInfo FuncInfo(TLI, Fn, MF);
-
- for (Function::iterator I = Fn.begin(), E = Fn.end(); I != E; ++I)
- if (InvokeInst *Invoke = dyn_cast<InvokeInst>(I->getTerminator()))
- // Mark landing pad.
- FuncInfo.MBBMap[Invoke->getSuccessor(1)]->setIsLandingPad();
-
- for (Function::iterator I = Fn.begin(), E = Fn.end(); I != E; ++I)
- SelectBasicBlock(I, MF, FuncInfo);
-
- // Add function live-ins to entry block live-in set.
- BasicBlock *EntryBB = &Fn.getEntryBlock();
- BB = FuncInfo.MBBMap[EntryBB];
- if (!RegInfo->livein_empty())
- for (MachineRegisterInfo::livein_iterator I = RegInfo->livein_begin(),
- E = RegInfo->livein_end(); I != E; ++I)
- BB->addLiveIn(I->first);
-
-#ifndef NDEBUG
- assert(FuncInfo.CatchInfoFound.size() == FuncInfo.CatchInfoLost.size() &&
- "Not all catch info was assigned to a landing pad!");
-#endif
-
- return true;
-}
-
-void SelectionDAGLowering::CopyValueToVirtualRegister(Value *V, unsigned Reg) {
- SDOperand Op = getValue(V);
- assert((Op.getOpcode() != ISD::CopyFromReg ||
- cast<RegisterSDNode>(Op.getOperand(1))->getReg() != Reg) &&
- "Copy from a reg to the same reg!");
- assert(!TargetRegisterInfo::isPhysicalRegister(Reg) && "Is a physreg");
-
- RegsForValue RFV(TLI, Reg, V->getType());
- SDOperand Chain = DAG.getEntryNode();
- RFV.getCopyToRegs(Op, DAG, Chain, 0);
- PendingExports.push_back(Chain);
-}
-
-void SelectionDAGISel::
-LowerArguments(BasicBlock *LLVMBB, SelectionDAGLowering &SDL) {
- // If this is the entry block, emit arguments.
- Function &F = *LLVMBB->getParent();
- FunctionLoweringInfo &FuncInfo = SDL.FuncInfo;
- SDOperand OldRoot = SDL.DAG.getRoot();
- std::vector<SDOperand> Args = TLI.LowerArguments(F, SDL.DAG);
-
- unsigned a = 0;
- for (Function::arg_iterator AI = F.arg_begin(), E = F.arg_end();
- AI != E; ++AI, ++a)
- if (!AI->use_empty()) {
- SDL.setValue(AI, Args[a]);
-
- // If this argument is live outside of the entry block, insert a copy from
- // whereever we got it to the vreg that other BB's will reference it as.
- DenseMap<const Value*, unsigned>::iterator VMI=FuncInfo.ValueMap.find(AI);
- if (VMI != FuncInfo.ValueMap.end()) {
- SDL.CopyValueToVirtualRegister(AI, VMI->second);
- }
- }
-
- // Finally, if the target has anything special to do, allow it to do so.
- // FIXME: this should insert code into the DAG!
- EmitFunctionEntryCode(F, SDL.DAG.getMachineFunction());
-}
-
-static void copyCatchInfo(BasicBlock *SrcBB, BasicBlock *DestBB,
- MachineModuleInfo *MMI, FunctionLoweringInfo &FLI) {
- for (BasicBlock::iterator I = SrcBB->begin(), E = --SrcBB->end(); I != E; ++I)
- if (isSelector(I)) {
- // Apply the catch info to DestBB.
- addCatchInfo(cast<CallInst>(*I), MMI, FLI.MBBMap[DestBB]);
-#ifndef NDEBUG
- if (!FLI.MBBMap[SrcBB]->isLandingPad())
- FLI.CatchInfoFound.insert(I);
-#endif
- }
-}
-
-/// IsFixedFrameObjectWithPosOffset - Check if object is a fixed frame object and
-/// whether object offset >= 0.
-static bool
-IsFixedFrameObjectWithPosOffset(MachineFrameInfo * MFI, SDOperand Op) {
- if (!isa<FrameIndexSDNode>(Op)) return false;
-
- FrameIndexSDNode * FrameIdxNode = dyn_cast<FrameIndexSDNode>(Op);
- int FrameIdx = FrameIdxNode->getIndex();
- return MFI->isFixedObjectIndex(FrameIdx) &&
- MFI->getObjectOffset(FrameIdx) >= 0;
-}
-
-/// IsPossiblyOverwrittenArgumentOfTailCall - Check if the operand could
-/// possibly be overwritten when lowering the outgoing arguments in a tail
-/// call. Currently the implementation of this call is very conservative and
-/// assumes all arguments sourcing from FORMAL_ARGUMENTS or a CopyFromReg with
-/// virtual registers would be overwritten by direct lowering.
-static bool IsPossiblyOverwrittenArgumentOfTailCall(SDOperand Op,
- MachineFrameInfo * MFI) {
- RegisterSDNode * OpReg = NULL;
- if (Op.getOpcode() == ISD::FORMAL_ARGUMENTS ||
- (Op.getOpcode()== ISD::CopyFromReg &&
- (OpReg = dyn_cast<RegisterSDNode>(Op.getOperand(1))) &&
- (OpReg->getReg() >= TargetRegisterInfo::FirstVirtualRegister)) ||
- (Op.getOpcode() == ISD::LOAD &&
- IsFixedFrameObjectWithPosOffset(MFI, Op.getOperand(1))) ||
- (Op.getOpcode() == ISD::MERGE_VALUES &&
- Op.getOperand(Op.ResNo).getOpcode() == ISD::LOAD &&
- IsFixedFrameObjectWithPosOffset(MFI, Op.getOperand(Op.ResNo).
- getOperand(1))))
- return true;
- return false;
-}
-
-/// CheckDAGForTailCallsAndFixThem - This Function looks for CALL nodes in the
-/// DAG and fixes their tailcall attribute operand.
-static void CheckDAGForTailCallsAndFixThem(SelectionDAG &DAG,
- TargetLowering& TLI) {
- SDNode * Ret = NULL;
- SDOperand Terminator = DAG.getRoot();
-
- // Find RET node.
- if (Terminator.getOpcode() == ISD::RET) {
- Ret = Terminator.Val;
- }
-
- // Fix tail call attribute of CALL nodes.
- for (SelectionDAG::allnodes_iterator BE = DAG.allnodes_begin(),
- BI = prior(DAG.allnodes_end()); BI != BE; --BI) {
- if (BI->getOpcode() == ISD::CALL) {
- SDOperand OpRet(Ret, 0);
- SDOperand OpCall(static_cast<SDNode*>(BI), 0);
- bool isMarkedTailCall =
- cast<ConstantSDNode>(OpCall.getOperand(3))->getValue() != 0;
- // If CALL node has tail call attribute set to true and the call is not
- // eligible (no RET or the target rejects) the attribute is fixed to
- // false. The TargetLowering::IsEligibleForTailCallOptimization function
- // must correctly identify tail call optimizable calls.
- if (!isMarkedTailCall) continue;
- if (Ret==NULL ||
- !TLI.IsEligibleForTailCallOptimization(OpCall, OpRet, DAG)) {
- // Not eligible. Mark CALL node as non tail call.
- SmallVector<SDOperand, 32> Ops;
- unsigned idx=0;
- for(SDNode::op_iterator I =OpCall.Val->op_begin(),
- E = OpCall.Val->op_end(); I != E; I++, idx++) {
- if (idx!=3)
- Ops.push_back(*I);
- else
- Ops.push_back(DAG.getConstant(false, TLI.getPointerTy()));
- }
- DAG.UpdateNodeOperands(OpCall, Ops.begin(), Ops.size());
- } else {
- // Look for tail call clobbered arguments. Emit a series of
- // copyto/copyfrom virtual register nodes to protect them.
- SmallVector<SDOperand, 32> Ops;
- SDOperand Chain = OpCall.getOperand(0), InFlag;
- unsigned idx=0;
- for(SDNode::op_iterator I = OpCall.Val->op_begin(),
- E = OpCall.Val->op_end(); I != E; I++, idx++) {
- SDOperand Arg = *I;
- if (idx > 4 && (idx % 2)) {
- bool isByVal = cast<ARG_FLAGSSDNode>(OpCall.getOperand(idx+1))->
- getArgFlags().isByVal();
- MachineFunction &MF = DAG.getMachineFunction();
- MachineFrameInfo *MFI = MF.getFrameInfo();
- if (!isByVal &&
- IsPossiblyOverwrittenArgumentOfTailCall(Arg, MFI)) {
- MVT::ValueType VT = Arg.getValueType();
- unsigned VReg = MF.getRegInfo().
- createVirtualRegister(TLI.getRegClassFor(VT));
- Chain = DAG.getCopyToReg(Chain, VReg, Arg, InFlag);
- InFlag = Chain.getValue(1);
- Arg = DAG.getCopyFromReg(Chain, VReg, VT, InFlag);
- Chain = Arg.getValue(1);
- InFlag = Arg.getValue(2);
- }
- }
- Ops.push_back(Arg);
- }
- // Link in chain of CopyTo/CopyFromReg.
- Ops[0] = Chain;
- DAG.UpdateNodeOperands(OpCall, Ops.begin(), Ops.size());
- }
- }
- }
-}
-
-void SelectionDAGISel::BuildSelectionDAG(SelectionDAG &DAG, BasicBlock *LLVMBB,
- std::vector<std::pair<MachineInstr*, unsigned> > &PHINodesToUpdate,
- FunctionLoweringInfo &FuncInfo) {
- SelectionDAGLowering SDL(DAG, TLI, *AA, FuncInfo, GCI);
-
- // Lower any arguments needed in this block if this is the entry block.
- if (LLVMBB == &LLVMBB->getParent()->getEntryBlock())
- LowerArguments(LLVMBB, SDL);
-
- BB = FuncInfo.MBBMap[LLVMBB];
- SDL.setCurrentBasicBlock(BB);
-
- MachineModuleInfo *MMI = DAG.getMachineModuleInfo();
-
- if (MMI && BB->isLandingPad()) {
- // Add a label to mark the beginning of the landing pad. Deletion of the
- // landing pad can thus be detected via the MachineModuleInfo.
- unsigned LabelID = MMI->addLandingPad(BB);
- DAG.setRoot(DAG.getNode(ISD::LABEL, MVT::Other, DAG.getEntryNode(),
- DAG.getConstant(LabelID, MVT::i32),
- DAG.getConstant(1, MVT::i32)));
-
- // Mark exception register as live in.
- unsigned Reg = TLI.getExceptionAddressRegister();
- if (Reg) BB->addLiveIn(Reg);
-
- // Mark exception selector register as live in.
- Reg = TLI.getExceptionSelectorRegister();
- if (Reg) BB->addLiveIn(Reg);
-
- // FIXME: Hack around an exception handling flaw (PR1508): the personality
- // function and list of typeids logically belong to the invoke (or, if you
- // like, the basic block containing the invoke), and need to be associated
- // with it in the dwarf exception handling tables. Currently however the
- // information is provided by an intrinsic (eh.selector) that can be moved
- // to unexpected places by the optimizers: if the unwind edge is critical,
- // then breaking it can result in the intrinsics being in the successor of
- // the landing pad, not the landing pad itself. This results in exceptions
- // not being caught because no typeids are associated with the invoke.
- // This may not be the only way things can go wrong, but it is the only way
- // we try to work around for the moment.
- BranchInst *Br = dyn_cast<BranchInst>(LLVMBB->getTerminator());
-
- if (Br && Br->isUnconditional()) { // Critical edge?
- BasicBlock::iterator I, E;
- for (I = LLVMBB->begin(), E = --LLVMBB->end(); I != E; ++I)
- if (isSelector(I))
- break;
-
- if (I == E)
- // No catch info found - try to extract some from the successor.
- copyCatchInfo(Br->getSuccessor(0), LLVMBB, MMI, FuncInfo);
- }
- }
-
- // Lower all of the non-terminator instructions.
- for (BasicBlock::iterator I = LLVMBB->begin(), E = --LLVMBB->end();
- I != E; ++I)
- SDL.visit(*I);
-
- // Ensure that all instructions which are used outside of their defining
- // blocks are available as virtual registers. Invoke is handled elsewhere.
- for (BasicBlock::iterator I = LLVMBB->begin(), E = LLVMBB->end(); I != E;++I)
- if (!I->use_empty() && !isa<PHINode>(I) && !isa<InvokeInst>(I)) {
- DenseMap<const Value*, unsigned>::iterator VMI =FuncInfo.ValueMap.find(I);
- if (VMI != FuncInfo.ValueMap.end())
- SDL.CopyValueToVirtualRegister(I, VMI->second);
- }
-
- // Handle PHI nodes in successor blocks. Emit code into the SelectionDAG to
- // ensure constants are generated when needed. Remember the virtual registers
- // that need to be added to the Machine PHI nodes as input. We cannot just
- // directly add them, because expansion might result in multiple MBB's for one
- // BB. As such, the start of the BB might correspond to a different MBB than
- // the end.
- //
- TerminatorInst *TI = LLVMBB->getTerminator();
-
- // Emit constants only once even if used by multiple PHI nodes.
- std::map<Constant*, unsigned> ConstantsOut;
-
- // Vector bool would be better, but vector<bool> is really slow.
- std::vector<unsigned char> SuccsHandled;
- if (TI->getNumSuccessors())
- SuccsHandled.resize(BB->getParent()->getNumBlockIDs());
-
- // Check successor nodes' PHI nodes that expect a constant to be available
- // from this block.
- for (unsigned succ = 0, e = TI->getNumSuccessors(); succ != e; ++succ) {
- BasicBlock *SuccBB = TI->getSuccessor(succ);
- if (!isa<PHINode>(SuccBB->begin())) continue;
- MachineBasicBlock *SuccMBB = FuncInfo.MBBMap[SuccBB];
-
- // If this terminator has multiple identical successors (common for
- // switches), only handle each succ once.
- unsigned SuccMBBNo = SuccMBB->getNumber();
- if (SuccsHandled[SuccMBBNo]) continue;
- SuccsHandled[SuccMBBNo] = true;
-
- MachineBasicBlock::iterator MBBI = SuccMBB->begin();
- PHINode *PN;
-
- // At this point we know that there is a 1-1 correspondence between LLVM PHI
- // nodes and Machine PHI nodes, but the incoming operands have not been
- // emitted yet.
- for (BasicBlock::iterator I = SuccBB->begin();
- (PN = dyn_cast<PHINode>(I)); ++I) {
- // Ignore dead phi's.
- if (PN->use_empty()) continue;
-
- unsigned Reg;
- Value *PHIOp = PN->getIncomingValueForBlock(LLVMBB);
-
- if (Constant *C = dyn_cast<Constant>(PHIOp)) {
- unsigned &RegOut = ConstantsOut[C];
- if (RegOut == 0) {
- RegOut = FuncInfo.CreateRegForValue(C);
- SDL.CopyValueToVirtualRegister(C, RegOut);
- }
- Reg = RegOut;
- } else {
- Reg = FuncInfo.ValueMap[PHIOp];
- if (Reg == 0) {
- assert(isa<AllocaInst>(PHIOp) &&
- FuncInfo.StaticAllocaMap.count(cast<AllocaInst>(PHIOp)) &&
- "Didn't codegen value into a register!??");
- Reg = FuncInfo.CreateRegForValue(PHIOp);
- SDL.CopyValueToVirtualRegister(PHIOp, Reg);
- }
- }
-
- // Remember that this register needs to added to the machine PHI node as
- // the input for this MBB.
- MVT::ValueType VT = TLI.getValueType(PN->getType());
- unsigned NumRegisters = TLI.getNumRegisters(VT);
- for (unsigned i = 0, e = NumRegisters; i != e; ++i)
- PHINodesToUpdate.push_back(std::make_pair(MBBI++, Reg+i));
- }
- }
- ConstantsOut.clear();
-
- // Lower the terminator after the copies are emitted.
- SDL.visit(*LLVMBB->getTerminator());
-
- // Copy over any CaseBlock records that may now exist due to SwitchInst
- // lowering, as well as any jump table information.
- SwitchCases.clear();
- SwitchCases = SDL.SwitchCases;
- JTCases.clear();
- JTCases = SDL.JTCases;
- BitTestCases.clear();
- BitTestCases = SDL.BitTestCases;
-
- // Make sure the root of the DAG is up-to-date.
- DAG.setRoot(SDL.getControlRoot());
-
- // Check whether calls in this block are real tail calls. Fix up CALL nodes
- // with correct tailcall attribute so that the target can rely on the tailcall
- // attribute indicating whether the call is really eligible for tail call
- // optimization.
- CheckDAGForTailCallsAndFixThem(DAG, TLI);
-}
-
-void SelectionDAGISel::CodeGenAndEmitDAG(SelectionDAG &DAG) {
- DOUT << "Lowered selection DAG:\n";
- DEBUG(DAG.dump());
-
- // Run the DAG combiner in pre-legalize mode.
- DAG.Combine(false, *AA);
-
- DOUT << "Optimized lowered selection DAG:\n";
- DEBUG(DAG.dump());
-
- // Second step, hack on the DAG until it only uses operations and types that
- // the target supports.
-#if 0 // Enable this some day.
- DAG.LegalizeTypes();
- // Someday even later, enable a dag combine pass here.
-#endif
- DAG.Legalize();
-
- DOUT << "Legalized selection DAG:\n";
- DEBUG(DAG.dump());
-
- // Run the DAG combiner in post-legalize mode.
- DAG.Combine(true, *AA);
-
- DOUT << "Optimized legalized selection DAG:\n";
- DEBUG(DAG.dump());
-
- if (ViewISelDAGs) DAG.viewGraph();
-
- // Third, instruction select all of the operations to machine code, adding the
- // code to the MachineBasicBlock.
- InstructionSelectBasicBlock(DAG);
-
- DOUT << "Selected machine code:\n";
- DEBUG(BB->dump());
-}
-
-void SelectionDAGISel::SelectBasicBlock(BasicBlock *LLVMBB, MachineFunction &MF,
- FunctionLoweringInfo &FuncInfo) {
- std::vector<std::pair<MachineInstr*, unsigned> > PHINodesToUpdate;
- {
- SelectionDAG DAG(TLI, MF, getAnalysisToUpdate<MachineModuleInfo>());
- CurDAG = &DAG;
-
- // First step, lower LLVM code to some DAG. This DAG may use operations and
- // types that are not supported by the target.
- BuildSelectionDAG(DAG, LLVMBB, PHINodesToUpdate, FuncInfo);
-
- // Second step, emit the lowered DAG as machine code.
- CodeGenAndEmitDAG(DAG);
- }
-
- DOUT << "Total amount of phi nodes to update: "
- << PHINodesToUpdate.size() << "\n";
- DEBUG(for (unsigned i = 0, e = PHINodesToUpdate.size(); i != e; ++i)
- DOUT << "Node " << i << " : (" << PHINodesToUpdate[i].first
- << ", " << PHINodesToUpdate[i].second << ")\n";);
-
- // Next, now that we know what the last MBB the LLVM BB expanded is, update
- // PHI nodes in successors.
- if (SwitchCases.empty() && JTCases.empty() && BitTestCases.empty()) {
- for (unsigned i = 0, e = PHINodesToUpdate.size(); i != e; ++i) {
- MachineInstr *PHI = PHINodesToUpdate[i].first;
- assert(PHI->getOpcode() == TargetInstrInfo::PHI &&
- "This is not a machine PHI node that we are updating!");
- PHI->addOperand(MachineOperand::CreateReg(PHINodesToUpdate[i].second,
- false));
- PHI->addOperand(MachineOperand::CreateMBB(BB));
- }
- return;
- }
-
- for (unsigned i = 0, e = BitTestCases.size(); i != e; ++i) {
- // Lower header first, if it wasn't already lowered
- if (!BitTestCases[i].Emitted) {
- SelectionDAG HSDAG(TLI, MF, getAnalysisToUpdate<MachineModuleInfo>());
- CurDAG = &HSDAG;
- SelectionDAGLowering HSDL(HSDAG, TLI, *AA, FuncInfo, GCI);
- // Set the current basic block to the mbb we wish to insert the code into
- BB = BitTestCases[i].Parent;
- HSDL.setCurrentBasicBlock(BB);
- // Emit the code
- HSDL.visitBitTestHeader(BitTestCases[i]);
- HSDAG.setRoot(HSDL.getRoot());
- CodeGenAndEmitDAG(HSDAG);
- }
-
- for (unsigned j = 0, ej = BitTestCases[i].Cases.size(); j != ej; ++j) {
- SelectionDAG BSDAG(TLI, MF, getAnalysisToUpdate<MachineModuleInfo>());
- CurDAG = &BSDAG;
- SelectionDAGLowering BSDL(BSDAG, TLI, *AA, FuncInfo, GCI);
- // Set the current basic block to the mbb we wish to insert the code into
- BB = BitTestCases[i].Cases[j].ThisBB;
- BSDL.setCurrentBasicBlock(BB);
- // Emit the code
- if (j+1 != ej)
- BSDL.visitBitTestCase(BitTestCases[i].Cases[j+1].ThisBB,
- BitTestCases[i].Reg,
- BitTestCases[i].Cases[j]);
- else
- BSDL.visitBitTestCase(BitTestCases[i].Default,
- BitTestCases[i].Reg,
- BitTestCases[i].Cases[j]);
-
-
- BSDAG.setRoot(BSDL.getRoot());
- CodeGenAndEmitDAG(BSDAG);
- }
-
- // Update PHI Nodes
- for (unsigned pi = 0, pe = PHINodesToUpdate.size(); pi != pe; ++pi) {
- MachineInstr *PHI = PHINodesToUpdate[pi].first;
- MachineBasicBlock *PHIBB = PHI->getParent();
- assert(PHI->getOpcode() == TargetInstrInfo::PHI &&
- "This is not a machine PHI node that we are updating!");
- // This is "default" BB. We have two jumps to it. From "header" BB and
- // from last "case" BB.
- if (PHIBB == BitTestCases[i].Default) {
- PHI->addOperand(MachineOperand::CreateReg(PHINodesToUpdate[pi].second,
- false));
- PHI->addOperand(MachineOperand::CreateMBB(BitTestCases[i].Parent));
- PHI->addOperand(MachineOperand::CreateReg(PHINodesToUpdate[pi].second,
- false));
- PHI->addOperand(MachineOperand::CreateMBB(BitTestCases[i].Cases.
- back().ThisBB));
- }
- // One of "cases" BB.
- for (unsigned j = 0, ej = BitTestCases[i].Cases.size(); j != ej; ++j) {
- MachineBasicBlock* cBB = BitTestCases[i].Cases[j].ThisBB;
- if (cBB->succ_end() !=
- std::find(cBB->succ_begin(),cBB->succ_end(), PHIBB)) {
- PHI->addOperand(MachineOperand::CreateReg(PHINodesToUpdate[pi].second,
- false));
- PHI->addOperand(MachineOperand::CreateMBB(cBB));
- }
- }
- }
- }
-
- // If the JumpTable record is filled in, then we need to emit a jump table.
- // Updating the PHI nodes is tricky in this case, since we need to determine
- // whether the PHI is a successor of the range check MBB or the jump table MBB
- for (unsigned i = 0, e = JTCases.size(); i != e; ++i) {
- // Lower header first, if it wasn't already lowered
- if (!JTCases[i].first.Emitted) {
- SelectionDAG HSDAG(TLI, MF, getAnalysisToUpdate<MachineModuleInfo>());
- CurDAG = &HSDAG;
- SelectionDAGLowering HSDL(HSDAG, TLI, *AA, FuncInfo, GCI);
- // Set the current basic block to the mbb we wish to insert the code into
- BB = JTCases[i].first.HeaderBB;
- HSDL.setCurrentBasicBlock(BB);
- // Emit the code
- HSDL.visitJumpTableHeader(JTCases[i].second, JTCases[i].first);
- HSDAG.setRoot(HSDL.getRoot());
- CodeGenAndEmitDAG(HSDAG);
- }
-
- SelectionDAG JSDAG(TLI, MF, getAnalysisToUpdate<MachineModuleInfo>());
- CurDAG = &JSDAG;
- SelectionDAGLowering JSDL(JSDAG, TLI, *AA, FuncInfo, GCI);
- // Set the current basic block to the mbb we wish to insert the code into
- BB = JTCases[i].second.MBB;
- JSDL.setCurrentBasicBlock(BB);
- // Emit the code
- JSDL.visitJumpTable(JTCases[i].second);
- JSDAG.setRoot(JSDL.getRoot());
- CodeGenAndEmitDAG(JSDAG);
-
- // Update PHI Nodes
- for (unsigned pi = 0, pe = PHINodesToUpdate.size(); pi != pe; ++pi) {
- MachineInstr *PHI = PHINodesToUpdate[pi].first;
- MachineBasicBlock *PHIBB = PHI->getParent();
- assert(PHI->getOpcode() == TargetInstrInfo::PHI &&
- "This is not a machine PHI node that we are updating!");
- // "default" BB. We can go there only from header BB.
- if (PHIBB == JTCases[i].second.Default) {
- PHI->addOperand(MachineOperand::CreateReg(PHINodesToUpdate[pi].second,
- false));
- PHI->addOperand(MachineOperand::CreateMBB(JTCases[i].first.HeaderBB));
- }
- // JT BB. Just iterate over successors here
- if (BB->succ_end() != std::find(BB->succ_begin(),BB->succ_end(), PHIBB)) {
- PHI->addOperand(MachineOperand::CreateReg(PHINodesToUpdate[pi].second,
- false));
- PHI->addOperand(MachineOperand::CreateMBB(BB));
- }
- }
- }
-
- // If the switch block involved a branch to one of the actual successors, we
- // need to update PHI nodes in that block.
- for (unsigned i = 0, e = PHINodesToUpdate.size(); i != e; ++i) {
- MachineInstr *PHI = PHINodesToUpdate[i].first;
- assert(PHI->getOpcode() == TargetInstrInfo::PHI &&
- "This is not a machine PHI node that we are updating!");
- if (BB->isSuccessor(PHI->getParent())) {
- PHI->addOperand(MachineOperand::CreateReg(PHINodesToUpdate[i].second,
- false));
- PHI->addOperand(MachineOperand::CreateMBB(BB));
- }
- }
-
- // If we generated any switch lowering information, build and codegen any
- // additional DAGs necessary.
- for (unsigned i = 0, e = SwitchCases.size(); i != e; ++i) {
- SelectionDAG SDAG(TLI, MF, getAnalysisToUpdate<MachineModuleInfo>());
- CurDAG = &SDAG;
- SelectionDAGLowering SDL(SDAG, TLI, *AA, FuncInfo, GCI);
-
- // Set the current basic block to the mbb we wish to insert the code into
- BB = SwitchCases[i].ThisBB;
- SDL.setCurrentBasicBlock(BB);
-
- // Emit the code
- SDL.visitSwitchCase(SwitchCases[i]);
- SDAG.setRoot(SDL.getRoot());
- CodeGenAndEmitDAG(SDAG);
-
- // Handle any PHI nodes in successors of this chunk, as if we were coming
- // from the original BB before switch expansion. Note that PHI nodes can
- // occur multiple times in PHINodesToUpdate. We have to be very careful to
- // handle them the right number of times.
- while ((BB = SwitchCases[i].TrueBB)) { // Handle LHS and RHS.
- for (MachineBasicBlock::iterator Phi = BB->begin();
- Phi != BB->end() && Phi->getOpcode() == TargetInstrInfo::PHI; ++Phi){
- // This value for this PHI node is recorded in PHINodesToUpdate, get it.
- for (unsigned pn = 0; ; ++pn) {
- assert(pn != PHINodesToUpdate.size() && "Didn't find PHI entry!");
- if (PHINodesToUpdate[pn].first == Phi) {
- Phi->addOperand(MachineOperand::CreateReg(PHINodesToUpdate[pn].
- second, false));
- Phi->addOperand(MachineOperand::CreateMBB(SwitchCases[i].ThisBB));
- break;
- }
- }
- }
-
- // Don't process RHS if same block as LHS.
- if (BB == SwitchCases[i].FalseBB)
- SwitchCases[i].FalseBB = 0;
-
- // If we haven't handled the RHS, do so now. Otherwise, we're done.
- SwitchCases[i].TrueBB = SwitchCases[i].FalseBB;
- SwitchCases[i].FalseBB = 0;
- }
- assert(SwitchCases[i].TrueBB == 0 && SwitchCases[i].FalseBB == 0);
- }
-}
-
-
-//===----------------------------------------------------------------------===//
-/// ScheduleAndEmitDAG - Pick a safe ordering and emit instructions for each
-/// target node in the graph.
-void SelectionDAGISel::ScheduleAndEmitDAG(SelectionDAG &DAG) {
- if (ViewSchedDAGs) DAG.viewGraph();
-
- RegisterScheduler::FunctionPassCtor Ctor = RegisterScheduler::getDefault();
-
- if (!Ctor) {
- Ctor = ISHeuristic;
- RegisterScheduler::setDefault(Ctor);
- }
-
- ScheduleDAG *SL = Ctor(this, &DAG, BB);
- BB = SL->Run();
-
- if (ViewSUnitDAGs) SL->viewGraph();
-
- delete SL;
-}
-
-
-HazardRecognizer *SelectionDAGISel::CreateTargetHazardRecognizer() {
- return new HazardRecognizer();
-}
-
-//===----------------------------------------------------------------------===//
-// Helper functions used by the generated instruction selector.
-//===----------------------------------------------------------------------===//
-// Calls to these methods are generated by tblgen.
-
-/// CheckAndMask - The isel is trying to match something like (and X, 255). If
-/// the dag combiner simplified the 255, we still want to match. RHS is the
-/// actual value in the DAG on the RHS of an AND, and DesiredMaskS is the value
-/// specified in the .td file (e.g. 255).
-bool SelectionDAGISel::CheckAndMask(SDOperand LHS, ConstantSDNode *RHS,
- int64_t DesiredMaskS) const {
- const APInt &ActualMask = RHS->getAPIntValue();
- const APInt &DesiredMask = APInt(LHS.getValueSizeInBits(), DesiredMaskS);
-
- // If the actual mask exactly matches, success!
- if (ActualMask == DesiredMask)
- return true;
-
- // If the actual AND mask is allowing unallowed bits, this doesn't match.
- if (ActualMask.intersects(~DesiredMask))
- return false;
-
- // Otherwise, the DAG Combiner may have proven that the value coming in is
- // either already zero or is not demanded. Check for known zero input bits.
- APInt NeededMask = DesiredMask & ~ActualMask;
- if (CurDAG->MaskedValueIsZero(LHS, NeededMask))
- return true;
-
- // TODO: check to see if missing bits are just not demanded.
-
- // Otherwise, this pattern doesn't match.
- return false;
-}
-
-/// CheckOrMask - The isel is trying to match something like (or X, 255). If
-/// the dag combiner simplified the 255, we still want to match. RHS is the
-/// actual value in the DAG on the RHS of an OR, and DesiredMaskS is the value
-/// specified in the .td file (e.g. 255).
-bool SelectionDAGISel::CheckOrMask(SDOperand LHS, ConstantSDNode *RHS,
- int64_t DesiredMaskS) const {
- const APInt &ActualMask = RHS->getAPIntValue();
- const APInt &DesiredMask = APInt(LHS.getValueSizeInBits(), DesiredMaskS);
-
- // If the actual mask exactly matches, success!
- if (ActualMask == DesiredMask)
- return true;
-
- // If the actual AND mask is allowing unallowed bits, this doesn't match.
- if (ActualMask.intersects(~DesiredMask))
- return false;
-
- // Otherwise, the DAG Combiner may have proven that the value coming in is
- // either already zero or is not demanded. Check for known zero input bits.
- APInt NeededMask = DesiredMask & ~ActualMask;
-
- APInt KnownZero, KnownOne;
- CurDAG->ComputeMaskedBits(LHS, NeededMask, KnownZero, KnownOne);
-
- // If all the missing bits in the or are already known to be set, match!
- if ((NeededMask & KnownOne) == NeededMask)
- return true;
-
- // TODO: check to see if missing bits are just not demanded.
-
- // Otherwise, this pattern doesn't match.
- return false;
-}
-
-
-/// SelectInlineAsmMemoryOperands - Calls to this are automatically generated
-/// by tblgen. Others should not call it.
-void SelectionDAGISel::
-SelectInlineAsmMemoryOperands(std::vector<SDOperand> &Ops, SelectionDAG &DAG) {
- std::vector<SDOperand> InOps;
- std::swap(InOps, Ops);
-
- Ops.push_back(InOps[0]); // input chain.
- Ops.push_back(InOps[1]); // input asm string.
-
- unsigned i = 2, e = InOps.size();
- if (InOps[e-1].getValueType() == MVT::Flag)
- --e; // Don't process a flag operand if it is here.
-
- while (i != e) {
- unsigned Flags = cast<ConstantSDNode>(InOps[i])->getValue();
- if ((Flags & 7) != 4 /*MEM*/) {
- // Just skip over this operand, copying the operands verbatim.
- Ops.insert(Ops.end(), InOps.begin()+i, InOps.begin()+i+(Flags >> 3) + 1);
- i += (Flags >> 3) + 1;
- } else {
- assert((Flags >> 3) == 1 && "Memory operand with multiple values?");
- // Otherwise, this is a memory operand. Ask the target to select it.
- std::vector<SDOperand> SelOps;
- if (SelectInlineAsmMemoryOperand(InOps[i+1], 'm', SelOps, DAG)) {
- cerr << "Could not match memory address. Inline asm failure!\n";
- exit(1);
- }
-
- // Add this to the output node.
- MVT::ValueType IntPtrTy = DAG.getTargetLoweringInfo().getPointerTy();
- Ops.push_back(DAG.getTargetConstant(4/*MEM*/ | (SelOps.size() << 3),
- IntPtrTy));
- Ops.insert(Ops.end(), SelOps.begin(), SelOps.end());
- i += 2;
- }
- }
-
- // Add the flag input back if present.
- if (e != InOps.size())
- Ops.push_back(InOps.back());
-}
-
-char SelectionDAGISel::ID = 0;
diff --git a/release_23/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp b/release_23/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp
deleted file mode 100644
index 904638d4f7aa..000000000000
--- a/release_23/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp
+++ /dev/null
@@ -1,340 +0,0 @@
-//===-- SelectionDAGPrinter.cpp - Implement SelectionDAG::viewGraph() -----===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This implements the SelectionDAG::viewGraph method.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Constants.h"
-#include "llvm/Function.h"
-#include "llvm/Assembly/Writer.h"
-#include "llvm/CodeGen/SelectionDAG.h"
-#include "llvm/CodeGen/ScheduleDAG.h"
-#include "llvm/CodeGen/MachineConstantPool.h"
-#include "llvm/CodeGen/MachineFunction.h"
-#include "llvm/Target/TargetRegisterInfo.h"
-#include "llvm/Target/TargetMachine.h"
-#include "llvm/Support/GraphWriter.h"
-#include "llvm/ADT/StringExtras.h"
-#include "llvm/Config/config.h"
-#include <fstream>
-#include <sstream>
-using namespace llvm;
-
-namespace llvm {
- template<>
- struct DOTGraphTraits<SelectionDAG*> : public DefaultDOTGraphTraits {
- static std::string getGraphName(const SelectionDAG *G) {
- return G->getMachineFunction().getFunction()->getName();
- }
-
- static bool renderGraphFromBottomUp() {
- return true;
- }
-
- static bool hasNodeAddressLabel(const SDNode *Node,
- const SelectionDAG *Graph) {
- return true;
- }
-
- /// If you want to override the dot attributes printed for a particular
- /// edge, override this method.
- template<typename EdgeIter>
- static std::string getEdgeAttributes(const void *Node, EdgeIter EI) {
- SDOperand Op = EI.getNode()->getOperand(EI.getOperand());
- MVT::ValueType VT = Op.getValueType();
- if (VT == MVT::Flag)
- return "color=red,style=bold";
- else if (VT == MVT::Other)
- return "color=blue,style=dashed";
- return "";
- }
-
-
- static std::string getNodeLabel(const SDNode *Node,
- const SelectionDAG *Graph);
- static std::string getNodeAttributes(const SDNode *N,
- const SelectionDAG *Graph) {
-#ifndef NDEBUG
- const std::string &Attrs = Graph->getGraphAttrs(N);
- if (!Attrs.empty()) {
- if (Attrs.find("shape=") == std::string::npos)
- return std::string("shape=Mrecord,") + Attrs;
- else
- return Attrs;
- }
-#endif
- return "shape=Mrecord";
- }
-
- static void addCustomGraphFeatures(SelectionDAG *G,
- GraphWriter<SelectionDAG*> &GW) {
- GW.emitSimpleNode(0, "plaintext=circle", "GraphRoot");
- if (G->getRoot().Val)
- GW.emitEdge(0, -1, G->getRoot().Val, -1, "");
- }
- };
-}
-
-std::string DOTGraphTraits<SelectionDAG*>::getNodeLabel(const SDNode *Node,
- const SelectionDAG *G) {
- std::string Op = Node->getOperationName(G);
-
- for (unsigned i = 0, e = Node->getNumValues(); i != e; ++i)
- if (Node->getValueType(i) == MVT::Other)
- Op += ":ch";
- else
- Op = Op + ":" + MVT::getValueTypeString(Node->getValueType(i));
-
- if (const ConstantSDNode *CSDN = dyn_cast<ConstantSDNode>(Node)) {
- Op += ": " + utostr(CSDN->getValue());
- } else if (const ConstantFPSDNode *CSDN = dyn_cast<ConstantFPSDNode>(Node)) {
- Op += ": " + ftostr(CSDN->getValueAPF());
- } else if (const GlobalAddressSDNode *GADN =
- dyn_cast<GlobalAddressSDNode>(Node)) {
- int offset = GADN->getOffset();
- Op += ": " + GADN->getGlobal()->getName();
- if (offset > 0)
- Op += "+" + itostr(offset);
- else
- Op += itostr(offset);
- } else if (const FrameIndexSDNode *FIDN = dyn_cast<FrameIndexSDNode>(Node)) {
- Op += " " + itostr(FIDN->getIndex());
- } else if (const JumpTableSDNode *JTDN = dyn_cast<JumpTableSDNode>(Node)) {
- Op += " " + itostr(JTDN->getIndex());
- } else if (const ConstantPoolSDNode *CP = dyn_cast<ConstantPoolSDNode>(Node)){
- if (CP->isMachineConstantPoolEntry()) {
- std::ostringstream SS;
- CP->getMachineCPVal()->print(SS);
- Op += "<" + SS.str() + ">";
- } else {
- if (ConstantFP *CFP = dyn_cast<ConstantFP>(CP->getConstVal()))
- Op += "<" + ftostr(CFP->getValueAPF()) + ">";
- else if (ConstantInt *CI = dyn_cast<ConstantInt>(CP->getConstVal()))
- Op += "<" + utostr(CI->getZExtValue()) + ">";
- else {
- std::ostringstream SS;
- WriteAsOperand(SS, CP->getConstVal(), false);
- Op += "<" + SS.str() + ">";
- }
- }
- } else if (const BasicBlockSDNode *BBDN = dyn_cast<BasicBlockSDNode>(Node)) {
- Op = "BB: ";
- const Value *LBB = (const Value*)BBDN->getBasicBlock()->getBasicBlock();
- if (LBB)
- Op += LBB->getName();
- //Op += " " + (const void*)BBDN->getBasicBlock();
- } else if (const RegisterSDNode *R = dyn_cast<RegisterSDNode>(Node)) {
- if (G && R->getReg() != 0 &&
- TargetRegisterInfo::isPhysicalRegister(R->getReg())) {
- Op = Op + " " +
- G->getTarget().getRegisterInfo()->getName(R->getReg());
- } else {
- Op += " #" + utostr(R->getReg());
- }
- } else if (const ExternalSymbolSDNode *ES =
- dyn_cast<ExternalSymbolSDNode>(Node)) {
- Op += "'" + std::string(ES->getSymbol()) + "'";
- } else if (const SrcValueSDNode *M = dyn_cast<SrcValueSDNode>(Node)) {
- if (M->getValue())
- Op += "<" + M->getValue()->getName() + ">";
- else
- Op += "<null>";
- } else if (const MemOperandSDNode *M = dyn_cast<MemOperandSDNode>(Node)) {
- if (M->MO.getValue())
- Op += "<" + M->MO.getValue()->getName() + ":" + itostr(M->MO.getOffset()) + ">";
- else
- Op += "<null:" + itostr(M->MO.getOffset()) + ">";
- } else if (const ARG_FLAGSSDNode *N = dyn_cast<ARG_FLAGSSDNode>(Node)) {
- Op = Op + " AF=" + N->getArgFlags().getArgFlagsString();
- } else if (const VTSDNode *N = dyn_cast<VTSDNode>(Node)) {
- Op = Op + " VT=" + MVT::getValueTypeString(N->getVT());
- } else if (const StringSDNode *N = dyn_cast<StringSDNode>(Node)) {
- Op = Op + "\"" + N->getValue() + "\"";
- } else if (const LoadSDNode *LD = dyn_cast<LoadSDNode>(Node)) {
- bool doExt = true;
- switch (LD->getExtensionType()) {
- default: doExt = false; break;
- case ISD::EXTLOAD:
- Op = Op + "<anyext ";
- break;
- case ISD::SEXTLOAD:
- Op = Op + " <sext ";
- break;
- case ISD::ZEXTLOAD:
- Op = Op + " <zext ";
- break;
- }
- if (doExt)
- Op += MVT::getValueTypeString(LD->getMemoryVT()) + ">";
- if (LD->isVolatile())
- Op += "<V>";
- Op += LD->getIndexedModeName(LD->getAddressingMode());
- if (LD->getAlignment() > 1)
- Op += " A=" + utostr(LD->getAlignment());
- } else if (const StoreSDNode *ST = dyn_cast<StoreSDNode>(Node)) {
- if (ST->isTruncatingStore())
- Op += "<trunc " + MVT::getValueTypeString(ST->getMemoryVT()) + ">";
- if (ST->isVolatile())
- Op += "<V>";
- Op += ST->getIndexedModeName(ST->getAddressingMode());
- if (ST->getAlignment() > 1)
- Op += " A=" + utostr(ST->getAlignment());
- }
-
-#if 0
- Op += " Id=" + itostr(Node->getNodeId());
-#endif
-
- return Op;
-}
-
-
-/// viewGraph - Pop up a ghostview window with the reachable parts of the DAG
-/// rendered using 'dot'.
-///
-void SelectionDAG::viewGraph() {
-// This code is only for debugging!
-#ifndef NDEBUG
- ViewGraph(this, "dag." + getMachineFunction().getFunction()->getName());
-#else
- cerr << "SelectionDAG::viewGraph is only available in debug builds on "
- << "systems with Graphviz or gv!\n";
-#endif // NDEBUG
-}
-
-
-/// clearGraphAttrs - Clear all previously defined node graph attributes.
-/// Intended to be used from a debugging tool (eg. gdb).
-void SelectionDAG::clearGraphAttrs() {
-#ifndef NDEBUG
- NodeGraphAttrs.clear();
-#else
- cerr << "SelectionDAG::clearGraphAttrs is only available in debug builds"
- << " on systems with Graphviz or gv!\n";
-#endif
-}
-
-
-/// setGraphAttrs - Set graph attributes for a node. (eg. "color=red".)
-///
-void SelectionDAG::setGraphAttrs(const SDNode *N, const char *Attrs) {
-#ifndef NDEBUG
- NodeGraphAttrs[N] = Attrs;
-#else
- cerr << "SelectionDAG::setGraphAttrs is only available in debug builds"
- << " on systems with Graphviz or gv!\n";
-#endif
-}
-
-
-/// getGraphAttrs - Get graph attributes for a node. (eg. "color=red".)
-/// Used from getNodeAttributes.
-const std::string SelectionDAG::getGraphAttrs(const SDNode *N) const {
-#ifndef NDEBUG
- std::map<const SDNode *, std::string>::const_iterator I =
- NodeGraphAttrs.find(N);
-
- if (I != NodeGraphAttrs.end())
- return I->second;
- else
- return "";
-#else
- cerr << "SelectionDAG::getGraphAttrs is only available in debug builds"
- << " on systems with Graphviz or gv!\n";
- return std::string("");
-#endif
-}
-
-/// setGraphColor - Convenience for setting node color attribute.
-///
-void SelectionDAG::setGraphColor(const SDNode *N, const char *Color) {
-#ifndef NDEBUG
- NodeGraphAttrs[N] = std::string("color=") + Color;
-#else
- cerr << "SelectionDAG::setGraphColor is only available in debug builds"
- << " on systems with Graphviz or gv!\n";
-#endif
-}
-
-namespace llvm {
- template<>
- struct DOTGraphTraits<ScheduleDAG*> : public DefaultDOTGraphTraits {
- static std::string getGraphName(const ScheduleDAG *G) {
- return DOTGraphTraits<SelectionDAG*>::getGraphName(&G->DAG);
- }
-
- static bool renderGraphFromBottomUp() {
- return true;
- }
-
- static bool hasNodeAddressLabel(const SUnit *Node,
- const ScheduleDAG *Graph) {
- return true;
- }
-
- /// If you want to override the dot attributes printed for a particular
- /// edge, override this method.
- template<typename EdgeIter>
- static std::string getEdgeAttributes(const void *Node, EdgeIter EI) {
- if (EI.isSpecialDep())
- return "color=cyan,style=dashed";
- if (EI.isCtrlDep())
- return "color=blue,style=dashed";
- return "";
- }
-
-
- static std::string getNodeLabel(const SUnit *Node,
- const ScheduleDAG *Graph);
- static std::string getNodeAttributes(const SUnit *N,
- const ScheduleDAG *Graph) {
- return "shape=Mrecord";
- }
-
- static void addCustomGraphFeatures(ScheduleDAG *G,
- GraphWriter<ScheduleDAG*> &GW) {
- GW.emitSimpleNode(0, "plaintext=circle", "GraphRoot");
- if (G->DAG.getRoot().Val &&
- G->SUnitMap.find(G->DAG.getRoot().Val) != G->SUnitMap.end())
- GW.emitEdge(0, -1, G->SUnitMap[G->DAG.getRoot().Val].front(), -1, "");
- }
- };
-}
-
-std::string DOTGraphTraits<ScheduleDAG*>::getNodeLabel(const SUnit *SU,
- const ScheduleDAG *G) {
- std::string Op;
-
- for (unsigned i = 0; i < SU->FlaggedNodes.size(); ++i) {
- Op += DOTGraphTraits<SelectionDAG*>::getNodeLabel(SU->FlaggedNodes[i],
- &G->DAG) + "\n";
- }
-
- if (SU->Node)
- Op += DOTGraphTraits<SelectionDAG*>::getNodeLabel(SU->Node, &G->DAG);
- else
- Op += "<CROSS RC COPY>";
-
- return Op;
-}
-
-
-/// viewGraph - Pop up a ghostview window with the reachable parts of the DAG
-/// rendered using 'dot'.
-///
-void ScheduleDAG::viewGraph() {
-// This code is only for debugging!
-#ifndef NDEBUG
- ViewGraph(this, "dag." + DAG.getMachineFunction().getFunction()->getName());
-#else
- cerr << "ScheduleDAG::viewGraph is only available in debug builds on "
- << "systems with Graphviz or gv!\n";
-#endif // NDEBUG
-}
diff --git a/release_23/lib/CodeGen/SelectionDAG/TargetLowering.cpp b/release_23/lib/CodeGen/SelectionDAG/TargetLowering.cpp
deleted file mode 100644
index 7dab5aa109fe..000000000000
--- a/release_23/lib/CodeGen/SelectionDAG/TargetLowering.cpp
+++ /dev/null
@@ -1,2068 +0,0 @@
-//===-- TargetLowering.cpp - Implement the TargetLowering class -----------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This implements the TargetLowering class.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Target/TargetAsmInfo.h"
-#include "llvm/Target/TargetLowering.h"
-#include "llvm/Target/TargetSubtarget.h"
-#include "llvm/Target/TargetData.h"
-#include "llvm/Target/TargetMachine.h"
-#include "llvm/Target/TargetRegisterInfo.h"
-#include "llvm/GlobalVariable.h"
-#include "llvm/DerivedTypes.h"
-#include "llvm/CodeGen/SelectionDAG.h"
-#include "llvm/ADT/StringExtras.h"
-#include "llvm/ADT/STLExtras.h"
-#include "llvm/Support/MathExtras.h"
-using namespace llvm;
-
-/// InitLibcallNames - Set default libcall names.
-///
-static void InitLibcallNames(const char **Names) {
- Names[RTLIB::SHL_I32] = "__ashlsi3";
- Names[RTLIB::SHL_I64] = "__ashldi3";
- Names[RTLIB::SRL_I32] = "__lshrsi3";
- Names[RTLIB::SRL_I64] = "__lshrdi3";
- Names[RTLIB::SRA_I32] = "__ashrsi3";
- Names[RTLIB::SRA_I64] = "__ashrdi3";
- Names[RTLIB::MUL_I32] = "__mulsi3";
- Names[RTLIB::MUL_I64] = "__muldi3";
- Names[RTLIB::SDIV_I32] = "__divsi3";
- Names[RTLIB::SDIV_I64] = "__divdi3";
- Names[RTLIB::UDIV_I32] = "__udivsi3";
- Names[RTLIB::UDIV_I64] = "__udivdi3";
- Names[RTLIB::SREM_I32] = "__modsi3";
- Names[RTLIB::SREM_I64] = "__moddi3";
- Names[RTLIB::UREM_I32] = "__umodsi3";
- Names[RTLIB::UREM_I64] = "__umoddi3";
- Names[RTLIB::NEG_I32] = "__negsi2";
- Names[RTLIB::NEG_I64] = "__negdi2";
- Names[RTLIB::ADD_F32] = "__addsf3";
- Names[RTLIB::ADD_F64] = "__adddf3";
- Names[RTLIB::ADD_F80] = "__addxf3";
- Names[RTLIB::ADD_PPCF128] = "__gcc_qadd";
- Names[RTLIB::SUB_F32] = "__subsf3";
- Names[RTLIB::SUB_F64] = "__subdf3";
- Names[RTLIB::SUB_F80] = "__subxf3";
- Names[RTLIB::SUB_PPCF128] = "__gcc_qsub";
- Names[RTLIB::MUL_F32] = "__mulsf3";
- Names[RTLIB::MUL_F64] = "__muldf3";
- Names[RTLIB::MUL_F80] = "__mulxf3";
- Names[RTLIB::MUL_PPCF128] = "__gcc_qmul";
- Names[RTLIB::DIV_F32] = "__divsf3";
- Names[RTLIB::DIV_F64] = "__divdf3";
- Names[RTLIB::DIV_F80] = "__divxf3";
- Names[RTLIB::DIV_PPCF128] = "__gcc_qdiv";
- Names[RTLIB::REM_F32] = "fmodf";
- Names[RTLIB::REM_F64] = "fmod";
- Names[RTLIB::REM_F80] = "fmodl";
- Names[RTLIB::REM_PPCF128] = "fmodl";
- Names[RTLIB::POWI_F32] = "__powisf2";
- Names[RTLIB::POWI_F64] = "__powidf2";
- Names[RTLIB::POWI_F80] = "__powixf2";
- Names[RTLIB::POWI_PPCF128] = "__powitf2";
- Names[RTLIB::SQRT_F32] = "sqrtf";
- Names[RTLIB::SQRT_F64] = "sqrt";
- Names[RTLIB::SQRT_F80] = "sqrtl";
- Names[RTLIB::SQRT_PPCF128] = "sqrtl";
- Names[RTLIB::SIN_F32] = "sinf";
- Names[RTLIB::SIN_F64] = "sin";
- Names[RTLIB::SIN_F80] = "sinl";
- Names[RTLIB::SIN_PPCF128] = "sinl";
- Names[RTLIB::COS_F32] = "cosf";
- Names[RTLIB::COS_F64] = "cos";
- Names[RTLIB::COS_F80] = "cosl";
- Names[RTLIB::COS_PPCF128] = "cosl";
- Names[RTLIB::POW_F32] = "powf";
- Names[RTLIB::POW_F64] = "pow";
- Names[RTLIB::POW_F80] = "powl";
- Names[RTLIB::POW_PPCF128] = "powl";
- Names[RTLIB::FPEXT_F32_F64] = "__extendsfdf2";
- Names[RTLIB::FPROUND_F64_F32] = "__truncdfsf2";
- Names[RTLIB::FPTOSINT_F32_I32] = "__fixsfsi";
- Names[RTLIB::FPTOSINT_F32_I64] = "__fixsfdi";
- Names[RTLIB::FPTOSINT_F32_I128] = "__fixsfti";
- Names[RTLIB::FPTOSINT_F64_I32] = "__fixdfsi";
- Names[RTLIB::FPTOSINT_F64_I64] = "__fixdfdi";
- Names[RTLIB::FPTOSINT_F64_I128] = "__fixdfti";
- Names[RTLIB::FPTOSINT_F80_I64] = "__fixxfdi";
- Names[RTLIB::FPTOSINT_F80_I128] = "__fixxfti";
- Names[RTLIB::FPTOSINT_PPCF128_I64] = "__fixtfdi";
- Names[RTLIB::FPTOSINT_PPCF128_I128] = "__fixtfti";
- Names[RTLIB::FPTOUINT_F32_I32] = "__fixunssfsi";
- Names[RTLIB::FPTOUINT_F32_I64] = "__fixunssfdi";
- Names[RTLIB::FPTOUINT_F32_I128] = "__fixunssfti";
- Names[RTLIB::FPTOUINT_F64_I32] = "__fixunsdfsi";
- Names[RTLIB::FPTOUINT_F64_I64] = "__fixunsdfdi";
- Names[RTLIB::FPTOUINT_F64_I128] = "__fixunsdfti";
- Names[RTLIB::FPTOUINT_F80_I32] = "__fixunsxfsi";
- Names[RTLIB::FPTOUINT_F80_I64] = "__fixunsxfdi";
- Names[RTLIB::FPTOUINT_F80_I128] = "__fixunsxfti";
- Names[RTLIB::FPTOUINT_PPCF128_I64] = "__fixunstfdi";
- Names[RTLIB::FPTOUINT_PPCF128_I128] = "__fixunstfti";
- Names[RTLIB::SINTTOFP_I32_F32] = "__floatsisf";
- Names[RTLIB::SINTTOFP_I32_F64] = "__floatsidf";
- Names[RTLIB::SINTTOFP_I64_F32] = "__floatdisf";
- Names[RTLIB::SINTTOFP_I64_F64] = "__floatdidf";
- Names[RTLIB::SINTTOFP_I64_F80] = "__floatdixf";
- Names[RTLIB::SINTTOFP_I64_PPCF128] = "__floatditf";
- Names[RTLIB::SINTTOFP_I128_F32] = "__floattisf";
- Names[RTLIB::SINTTOFP_I128_F64] = "__floattidf";
- Names[RTLIB::SINTTOFP_I128_F80] = "__floattixf";
- Names[RTLIB::SINTTOFP_I128_PPCF128] = "__floattitf";
- Names[RTLIB::UINTTOFP_I32_F32] = "__floatunsisf";
- Names[RTLIB::UINTTOFP_I32_F64] = "__floatunsidf";
- Names[RTLIB::UINTTOFP_I64_F32] = "__floatundisf";
- Names[RTLIB::UINTTOFP_I64_F64] = "__floatundidf";
- Names[RTLIB::OEQ_F32] = "__eqsf2";
- Names[RTLIB::OEQ_F64] = "__eqdf2";
- Names[RTLIB::UNE_F32] = "__nesf2";
- Names[RTLIB::UNE_F64] = "__nedf2";
- Names[RTLIB::OGE_F32] = "__gesf2";
- Names[RTLIB::OGE_F64] = "__gedf2";
- Names[RTLIB::OLT_F32] = "__ltsf2";
- Names[RTLIB::OLT_F64] = "__ltdf2";
- Names[RTLIB::OLE_F32] = "__lesf2";
- Names[RTLIB::OLE_F64] = "__ledf2";
- Names[RTLIB::OGT_F32] = "__gtsf2";
- Names[RTLIB::OGT_F64] = "__gtdf2";
- Names[RTLIB::UO_F32] = "__unordsf2";
- Names[RTLIB::UO_F64] = "__unorddf2";
- Names[RTLIB::O_F32] = "__unordsf2";
- Names[RTLIB::O_F64] = "__unorddf2";
-}
-
-/// InitCmpLibcallCCs - Set default comparison libcall CC.
-///
-static void InitCmpLibcallCCs(ISD::CondCode *CCs) {
- memset(CCs, ISD::SETCC_INVALID, sizeof(ISD::CondCode)*RTLIB::UNKNOWN_LIBCALL);
- CCs[RTLIB::OEQ_F32] = ISD::SETEQ;
- CCs[RTLIB::OEQ_F64] = ISD::SETEQ;
- CCs[RTLIB::UNE_F32] = ISD::SETNE;
- CCs[RTLIB::UNE_F64] = ISD::SETNE;
- CCs[RTLIB::OGE_F32] = ISD::SETGE;
- CCs[RTLIB::OGE_F64] = ISD::SETGE;
- CCs[RTLIB::OLT_F32] = ISD::SETLT;
- CCs[RTLIB::OLT_F64] = ISD::SETLT;
- CCs[RTLIB::OLE_F32] = ISD::SETLE;
- CCs[RTLIB::OLE_F64] = ISD::SETLE;
- CCs[RTLIB::OGT_F32] = ISD::SETGT;
- CCs[RTLIB::OGT_F64] = ISD::SETGT;
- CCs[RTLIB::UO_F32] = ISD::SETNE;
- CCs[RTLIB::UO_F64] = ISD::SETNE;
- CCs[RTLIB::O_F32] = ISD::SETEQ;
- CCs[RTLIB::O_F64] = ISD::SETEQ;
-}
-
-TargetLowering::TargetLowering(TargetMachine &tm)
- : TM(tm), TD(TM.getTargetData()) {
- assert(ISD::BUILTIN_OP_END <= OpActionsCapacity &&
- "Fixed size array in TargetLowering is not large enough!");
- // All operations default to being supported.
- memset(OpActions, 0, sizeof(OpActions));
- memset(LoadXActions, 0, sizeof(LoadXActions));
- memset(TruncStoreActions, 0, sizeof(TruncStoreActions));
- memset(IndexedModeActions, 0, sizeof(IndexedModeActions));
- memset(ConvertActions, 0, sizeof(ConvertActions));
-
- // Set default actions for various operations.
- for (unsigned VT = 0; VT != (unsigned)MVT::LAST_VALUETYPE; ++VT) {
- // Default all indexed load / store to expand.
- for (unsigned IM = (unsigned)ISD::PRE_INC;
- IM != (unsigned)ISD::LAST_INDEXED_MODE; ++IM) {
- setIndexedLoadAction(IM, (MVT::ValueType)VT, Expand);
- setIndexedStoreAction(IM, (MVT::ValueType)VT, Expand);
- }
-
- // These operations default to expand.
- setOperationAction(ISD::FGETSIGN, (MVT::ValueType)VT, Expand);
- }
-
- // Most targets ignore the @llvm.prefetch intrinsic.
- setOperationAction(ISD::PREFETCH, MVT::Other, Expand);
-
- // ConstantFP nodes default to expand. Targets can either change this to
- // Legal, in which case all fp constants are legal, or use addLegalFPImmediate
- // to optimize expansions for certain constants.
- setOperationAction(ISD::ConstantFP, MVT::f32, Expand);
- setOperationAction(ISD::ConstantFP, MVT::f64, Expand);
- setOperationAction(ISD::ConstantFP, MVT::f80, Expand);
-
- // Default ISD::TRAP to expand (which turns it into abort).
- setOperationAction(ISD::TRAP, MVT::Other, Expand);
-
- IsLittleEndian = TD->isLittleEndian();
- UsesGlobalOffsetTable = false;
- ShiftAmountTy = PointerTy = getValueType(TD->getIntPtrType());
- ShiftAmtHandling = Undefined;
- memset(RegClassForVT, 0,MVT::LAST_VALUETYPE*sizeof(TargetRegisterClass*));
- memset(TargetDAGCombineArray, 0, array_lengthof(TargetDAGCombineArray));
- maxStoresPerMemset = maxStoresPerMemcpy = maxStoresPerMemmove = 8;
- allowUnalignedMemoryAccesses = false;
- UseUnderscoreSetJmp = false;
- UseUnderscoreLongJmp = false;
- SelectIsExpensive = false;
- IntDivIsCheap = false;
- Pow2DivIsCheap = false;
- StackPointerRegisterToSaveRestore = 0;
- ExceptionPointerRegister = 0;
- ExceptionSelectorRegister = 0;
- SetCCResultContents = UndefinedSetCCResult;
- SchedPreferenceInfo = SchedulingForLatency;
- JumpBufSize = 0;
- JumpBufAlignment = 0;
- IfCvtBlockSizeLimit = 2;
- IfCvtDupBlockSizeLimit = 0;
- PrefLoopAlignment = 0;
-
- InitLibcallNames(LibcallRoutineNames);
- InitCmpLibcallCCs(CmpLibcallCCs);
-
- // Tell Legalize whether the assembler supports DEBUG_LOC.
- if (!TM.getTargetAsmInfo()->hasDotLocAndDotFile())
- setOperationAction(ISD::DEBUG_LOC, MVT::Other, Expand);
-}
-
-TargetLowering::~TargetLowering() {}
-
-/// computeRegisterProperties - Once all of the register classes are added,
-/// this allows us to compute derived properties we expose.
-void TargetLowering::computeRegisterProperties() {
- assert(MVT::LAST_VALUETYPE <= 32 &&
- "Too many value types for ValueTypeActions to hold!");
-
- // Everything defaults to needing one register.
- for (unsigned i = 0; i != MVT::LAST_VALUETYPE; ++i) {
- NumRegistersForVT[i] = 1;
- RegisterTypeForVT[i] = TransformToType[i] = i;
- }
- // ...except isVoid, which doesn't need any registers.
- NumRegistersForVT[MVT::isVoid] = 0;
-
- // Find the largest integer register class.
- unsigned LargestIntReg = MVT::i128;
- for (; RegClassForVT[LargestIntReg] == 0; --LargestIntReg)
- assert(LargestIntReg != MVT::i1 && "No integer registers defined!");
-
- // Every integer value type larger than this largest register takes twice as
- // many registers to represent as the previous ValueType.
- for (MVT::ValueType ExpandedReg = LargestIntReg + 1;
- MVT::isInteger(ExpandedReg); ++ExpandedReg) {
- NumRegistersForVT[ExpandedReg] = 2*NumRegistersForVT[ExpandedReg-1];
- RegisterTypeForVT[ExpandedReg] = LargestIntReg;
- TransformToType[ExpandedReg] = ExpandedReg - 1;
- ValueTypeActions.setTypeAction(ExpandedReg, Expand);
- }
-
- // Inspect all of the ValueType's smaller than the largest integer
- // register to see which ones need promotion.
- MVT::ValueType LegalIntReg = LargestIntReg;
- for (MVT::ValueType IntReg = LargestIntReg - 1;
- IntReg >= MVT::i1; --IntReg) {
- if (isTypeLegal(IntReg)) {
- LegalIntReg = IntReg;
- } else {
- RegisterTypeForVT[IntReg] = TransformToType[IntReg] = LegalIntReg;
- ValueTypeActions.setTypeAction(IntReg, Promote);
- }
- }
-
- // ppcf128 type is really two f64's.
- if (!isTypeLegal(MVT::ppcf128)) {
- NumRegistersForVT[MVT::ppcf128] = 2*NumRegistersForVT[MVT::f64];
- RegisterTypeForVT[MVT::ppcf128] = MVT::f64;
- TransformToType[MVT::ppcf128] = MVT::f64;
- ValueTypeActions.setTypeAction(MVT::ppcf128, Expand);
- }
-
- // Decide how to handle f64. If the target does not have native f64 support,
- // expand it to i64 and we will be generating soft float library calls.
- if (!isTypeLegal(MVT::f64)) {
- NumRegistersForVT[MVT::f64] = NumRegistersForVT[MVT::i64];
- RegisterTypeForVT[MVT::f64] = RegisterTypeForVT[MVT::i64];
- TransformToType[MVT::f64] = MVT::i64;
- ValueTypeActions.setTypeAction(MVT::f64, Expand);
- }
-
- // Decide how to handle f32. If the target does not have native support for
- // f32, promote it to f64 if it is legal. Otherwise, expand it to i32.
- if (!isTypeLegal(MVT::f32)) {
- if (isTypeLegal(MVT::f64)) {
- NumRegistersForVT[MVT::f32] = NumRegistersForVT[MVT::f64];
- RegisterTypeForVT[MVT::f32] = RegisterTypeForVT[MVT::f64];
- TransformToType[MVT::f32] = MVT::f64;
- ValueTypeActions.setTypeAction(MVT::f32, Promote);
- } else {
- NumRegistersForVT[MVT::f32] = NumRegistersForVT[MVT::i32];
- RegisterTypeForVT[MVT::f32] = RegisterTypeForVT[MVT::i32];
- TransformToType[MVT::f32] = MVT::i32;
- ValueTypeActions.setTypeAction(MVT::f32, Expand);
- }
- }
-
- // Loop over all of the vector value types to see which need transformations.
- for (MVT::ValueType i = MVT::FIRST_VECTOR_VALUETYPE;
- i <= MVT::LAST_VECTOR_VALUETYPE; ++i) {
- if (!isTypeLegal(i)) {
- MVT::ValueType IntermediateVT, RegisterVT;
- unsigned NumIntermediates;
- NumRegistersForVT[i] =
- getVectorTypeBreakdown(i,
- IntermediateVT, NumIntermediates,
- RegisterVT);
- RegisterTypeForVT[i] = RegisterVT;
- TransformToType[i] = MVT::Other; // this isn't actually used
- ValueTypeActions.setTypeAction(i, Expand);
- }
- }
-}
-
-const char *TargetLowering::getTargetNodeName(unsigned Opcode) const {
- return NULL;
-}
-
-
-MVT::ValueType
-TargetLowering::getSetCCResultType(const SDOperand &) const {
- return getValueType(TD->getIntPtrType());
-}
-
-
-/// getVectorTypeBreakdown - Vector types are broken down into some number of
-/// legal first class types. For example, MVT::v8f32 maps to 2 MVT::v4f32
-/// with Altivec or SSE1, or 8 promoted MVT::f64 values with the X86 FP stack.
-/// Similarly, MVT::v2i64 turns into 4 MVT::i32 values with both PPC and X86.
-///
-/// This method returns the number of registers needed, and the VT for each
-/// register. It also returns the VT and quantity of the intermediate values
-/// before they are promoted/expanded.
-///
-unsigned TargetLowering::getVectorTypeBreakdown(MVT::ValueType VT,
- MVT::ValueType &IntermediateVT,
- unsigned &NumIntermediates,
- MVT::ValueType &RegisterVT) const {
- // Figure out the right, legal destination reg to copy into.
- unsigned NumElts = MVT::getVectorNumElements(VT);
- MVT::ValueType EltTy = MVT::getVectorElementType(VT);
-
- unsigned NumVectorRegs = 1;
-
- // FIXME: We don't support non-power-of-2-sized vectors for now. Ideally we
- // could break down into LHS/RHS like LegalizeDAG does.
- if (!isPowerOf2_32(NumElts)) {
- NumVectorRegs = NumElts;
- NumElts = 1;
- }
-
- // Divide the input until we get to a supported size. This will always
- // end with a scalar if the target doesn't support vectors.
- while (NumElts > 1 &&
- !isTypeLegal(MVT::getVectorType(EltTy, NumElts))) {
- NumElts >>= 1;
- NumVectorRegs <<= 1;
- }
-
- NumIntermediates = NumVectorRegs;
-
- MVT::ValueType NewVT = MVT::getVectorType(EltTy, NumElts);
- if (!isTypeLegal(NewVT))
- NewVT = EltTy;
- IntermediateVT = NewVT;
-
- MVT::ValueType DestVT = getTypeToTransformTo(NewVT);
- RegisterVT = DestVT;
- if (DestVT < NewVT) {
- // Value is expanded, e.g. i64 -> i16.
- return NumVectorRegs*(MVT::getSizeInBits(NewVT)/MVT::getSizeInBits(DestVT));
- } else {
- // Otherwise, promotion or legal types use the same number of registers as
- // the vector decimated to the appropriate level.
- return NumVectorRegs;
- }
-
- return 1;
-}
-
-/// getByValTypeAlignment - Return the desired alignment for ByVal aggregate
-/// function arguments in the caller parameter area. This is the actual
-/// alignment, not its logarithm.
-unsigned TargetLowering::getByValTypeAlignment(const Type *Ty) const {
- return TD->getCallFrameTypeAlignment(Ty);
-}
-
-SDOperand TargetLowering::getPICJumpTableRelocBase(SDOperand Table,
- SelectionDAG &DAG) const {
- if (usesGlobalOffsetTable())
- return DAG.getNode(ISD::GLOBAL_OFFSET_TABLE, getPointerTy());
- return Table;
-}
-
-//===----------------------------------------------------------------------===//
-// Optimization Methods
-//===----------------------------------------------------------------------===//
-
-/// ShrinkDemandedConstant - Check to see if the specified operand of the
-/// specified instruction is a constant integer. If so, check to see if there
-/// are any bits set in the constant that are not demanded. If so, shrink the
-/// constant and return true.
-bool TargetLowering::TargetLoweringOpt::ShrinkDemandedConstant(SDOperand Op,
- const APInt &Demanded) {
- // FIXME: ISD::SELECT, ISD::SELECT_CC
- switch(Op.getOpcode()) {
- default: break;
- case ISD::AND:
- case ISD::OR:
- case ISD::XOR:
- if (ConstantSDNode *C = dyn_cast<ConstantSDNode>(Op.getOperand(1)))
- if (C->getAPIntValue().intersects(~Demanded)) {
- MVT::ValueType VT = Op.getValueType();
- SDOperand New = DAG.getNode(Op.getOpcode(), VT, Op.getOperand(0),
- DAG.getConstant(Demanded &
- C->getAPIntValue(),
- VT));
- return CombineTo(Op, New);
- }
- break;
- }
- return false;
-}
-
-/// SimplifyDemandedBits - Look at Op. At this point, we know that only the
-/// DemandedMask bits of the result of Op are ever used downstream. If we can
-/// use this information to simplify Op, create a new simplified DAG node and
-/// return true, returning the original and new nodes in Old and New. Otherwise,
-/// analyze the expression and return a mask of KnownOne and KnownZero bits for
-/// the expression (used to simplify the caller). The KnownZero/One bits may
-/// only be accurate for those bits in the DemandedMask.
-bool TargetLowering::SimplifyDemandedBits(SDOperand Op,
- const APInt &DemandedMask,
- APInt &KnownZero,
- APInt &KnownOne,
- TargetLoweringOpt &TLO,
- unsigned Depth) const {
- unsigned BitWidth = DemandedMask.getBitWidth();
- assert(Op.getValueSizeInBits() == BitWidth &&
- "Mask size mismatches value type size!");
- APInt NewMask = DemandedMask;
-
- // Don't know anything.
- KnownZero = KnownOne = APInt(BitWidth, 0);
-
- // Other users may use these bits.
- if (!Op.Val->hasOneUse()) {
- if (Depth != 0) {
- // If not at the root, Just compute the KnownZero/KnownOne bits to
- // simplify things downstream.
- TLO.DAG.ComputeMaskedBits(Op, DemandedMask, KnownZero, KnownOne, Depth);
- return false;
- }
- // If this is the root being simplified, allow it to have multiple uses,
- // just set the NewMask to all bits.
- NewMask = APInt::getAllOnesValue(BitWidth);
- } else if (DemandedMask == 0) {
- // Not demanding any bits from Op.
- if (Op.getOpcode() != ISD::UNDEF)
- return TLO.CombineTo(Op, TLO.DAG.getNode(ISD::UNDEF, Op.getValueType()));
- return false;
- } else if (Depth == 6) { // Limit search depth.
- return false;
- }
-
- APInt KnownZero2, KnownOne2, KnownZeroOut, KnownOneOut;
- switch (Op.getOpcode()) {
- case ISD::Constant:
- // We know all of the bits for a constant!
- KnownOne = cast<ConstantSDNode>(Op)->getAPIntValue() & NewMask;
- KnownZero = ~KnownOne & NewMask;
- return false; // Don't fall through, will infinitely loop.
- case ISD::AND:
- // If the RHS is a constant, check to see if the LHS would be zero without
- // using the bits from the RHS. Below, we use knowledge about the RHS to
- // simplify the LHS, here we're using information from the LHS to simplify
- // the RHS.
- if (ConstantSDNode *RHSC = dyn_cast<ConstantSDNode>(Op.getOperand(1))) {
- APInt LHSZero, LHSOne;
- TLO.DAG.ComputeMaskedBits(Op.getOperand(0), NewMask,
- LHSZero, LHSOne, Depth+1);
- // If the LHS already has zeros where RHSC does, this and is dead.
- if ((LHSZero & NewMask) == (~RHSC->getAPIntValue() & NewMask))
- return TLO.CombineTo(Op, Op.getOperand(0));
- // If any of the set bits in the RHS are known zero on the LHS, shrink
- // the constant.
- if (TLO.ShrinkDemandedConstant(Op, ~LHSZero & NewMask))
- return true;
- }
-
- if (SimplifyDemandedBits(Op.getOperand(1), NewMask, KnownZero,
- KnownOne, TLO, Depth+1))
- return true;
- assert((KnownZero & KnownOne) == 0 && "Bits known to be one AND zero?");
- if (SimplifyDemandedBits(Op.getOperand(0), ~KnownZero & NewMask,
- KnownZero2, KnownOne2, TLO, Depth+1))
- return true;
- assert((KnownZero2 & KnownOne2) == 0 && "Bits known to be one AND zero?");
-
- // If all of the demanded bits are known one on one side, return the other.
- // These bits cannot contribute to the result of the 'and'.
- if ((NewMask & ~KnownZero2 & KnownOne) == (~KnownZero2 & NewMask))
- return TLO.CombineTo(Op, Op.getOperand(0));
- if ((NewMask & ~KnownZero & KnownOne2) == (~KnownZero & NewMask))
- return TLO.CombineTo(Op, Op.getOperand(1));
- // If all of the demanded bits in the inputs are known zeros, return zero.
- if ((NewMask & (KnownZero|KnownZero2)) == NewMask)
- return TLO.CombineTo(Op, TLO.DAG.getConstant(0, Op.getValueType()));
- // If the RHS is a constant, see if we can simplify it.
- if (TLO.ShrinkDemandedConstant(Op, ~KnownZero2 & NewMask))
- return true;
-
- // Output known-1 bits are only known if set in both the LHS & RHS.
- KnownOne &= KnownOne2;
- // Output known-0 are known to be clear if zero in either the LHS | RHS.
- KnownZero |= KnownZero2;
- break;
- case ISD::OR:
- if (SimplifyDemandedBits(Op.getOperand(1), NewMask, KnownZero,
- KnownOne, TLO, Depth+1))
- return true;
- assert((KnownZero & KnownOne) == 0 && "Bits known to be one AND zero?");
- if (SimplifyDemandedBits(Op.getOperand(0), ~KnownOne & NewMask,
- KnownZero2, KnownOne2, TLO, Depth+1))
- return true;
- assert((KnownZero2 & KnownOne2) == 0 && "Bits known to be one AND zero?");
-
- // If all of the demanded bits are known zero on one side, return the other.
- // These bits cannot contribute to the result of the 'or'.
- if ((NewMask & ~KnownOne2 & KnownZero) == (~KnownOne2 & NewMask))
- return TLO.CombineTo(Op, Op.getOperand(0));
- if ((NewMask & ~KnownOne & KnownZero2) == (~KnownOne & NewMask))
- return TLO.CombineTo(Op, Op.getOperand(1));
- // If all of the potentially set bits on one side are known to be set on
- // the other side, just use the 'other' side.
- if ((NewMask & ~KnownZero & KnownOne2) == (~KnownZero & NewMask))
- return TLO.CombineTo(Op, Op.getOperand(0));
- if ((NewMask & ~KnownZero2 & KnownOne) == (~KnownZero2 & NewMask))
- return TLO.CombineTo(Op, Op.getOperand(1));
- // If the RHS is a constant, see if we can simplify it.
- if (TLO.ShrinkDemandedConstant(Op, NewMask))
- return true;
-
- // Output known-0 bits are only known if clear in both the LHS & RHS.
- KnownZero &= KnownZero2;
- // Output known-1 are known to be set if set in either the LHS | RHS.
- KnownOne |= KnownOne2;
- break;
- case ISD::XOR:
- if (SimplifyDemandedBits(Op.getOperand(1), NewMask, KnownZero,
- KnownOne, TLO, Depth+1))
- return true;
- assert((KnownZero & KnownOne) == 0 && "Bits known to be one AND zero?");
- if (SimplifyDemandedBits(Op.getOperand(0), NewMask, KnownZero2,
- KnownOne2, TLO, Depth+1))
- return true;
- assert((KnownZero2 & KnownOne2) == 0 && "Bits known to be one AND zero?");
-
- // If all of the demanded bits are known zero on one side, return the other.
- // These bits cannot contribute to the result of the 'xor'.
- if ((KnownZero & NewMask) == NewMask)
- return TLO.CombineTo(Op, Op.getOperand(0));
- if ((KnownZero2 & NewMask) == NewMask)
- return TLO.CombineTo(Op, Op.getOperand(1));
-
- // If all of the unknown bits are known to be zero on one side or the other
- // (but not both) turn this into an *inclusive* or.
- // e.g. (A & C1)^(B & C2) -> (A & C1)|(B & C2) iff C1&C2 == 0
- if ((NewMask & ~KnownZero & ~KnownZero2) == 0)
- return TLO.CombineTo(Op, TLO.DAG.getNode(ISD::OR, Op.getValueType(),
- Op.getOperand(0),
- Op.getOperand(1)));
-
- // Output known-0 bits are known if clear or set in both the LHS & RHS.
- KnownZeroOut = (KnownZero & KnownZero2) | (KnownOne & KnownOne2);
- // Output known-1 are known to be set if set in only one of the LHS, RHS.
- KnownOneOut = (KnownZero & KnownOne2) | (KnownOne & KnownZero2);
-
- // If all of the demanded bits on one side are known, and all of the set
- // bits on that side are also known to be set on the other side, turn this
- // into an AND, as we know the bits will be cleared.
- // e.g. (X | C1) ^ C2 --> (X | C1) & ~C2 iff (C1&C2) == C2
- if ((NewMask & (KnownZero|KnownOne)) == NewMask) { // all known
- if ((KnownOne & KnownOne2) == KnownOne) {
- MVT::ValueType VT = Op.getValueType();
- SDOperand ANDC = TLO.DAG.getConstant(~KnownOne & NewMask, VT);
- return TLO.CombineTo(Op, TLO.DAG.getNode(ISD::AND, VT, Op.getOperand(0),
- ANDC));
- }
- }
-
- // If the RHS is a constant, see if we can simplify it.
- // for XOR, we prefer to force bits to 1 if they will make a -1.
- // if we can't force bits, try to shrink constant
- if (ConstantSDNode *C = dyn_cast<ConstantSDNode>(Op.getOperand(1))) {
- APInt Expanded = C->getAPIntValue() | (~NewMask);
- // if we can expand it to have all bits set, do it
- if (Expanded.isAllOnesValue()) {
- if (Expanded != C->getAPIntValue()) {
- MVT::ValueType VT = Op.getValueType();
- SDOperand New = TLO.DAG.getNode(Op.getOpcode(), VT, Op.getOperand(0),
- TLO.DAG.getConstant(Expanded, VT));
- return TLO.CombineTo(Op, New);
- }
- // if it already has all the bits set, nothing to change
- // but don't shrink either!
- } else if (TLO.ShrinkDemandedConstant(Op, NewMask)) {
- return true;
- }
- }
-
- KnownZero = KnownZeroOut;
- KnownOne = KnownOneOut;
- break;
- case ISD::SELECT:
- if (SimplifyDemandedBits(Op.getOperand(2), NewMask, KnownZero,
- KnownOne, TLO, Depth+1))
- return true;
- if (SimplifyDemandedBits(Op.getOperand(1), NewMask, KnownZero2,
- KnownOne2, TLO, Depth+1))
- return true;
- assert((KnownZero & KnownOne) == 0 && "Bits known to be one AND zero?");
- assert((KnownZero2 & KnownOne2) == 0 && "Bits known to be one AND zero?");
-
- // If the operands are constants, see if we can simplify them.
- if (TLO.ShrinkDemandedConstant(Op, NewMask))
- return true;
-
- // Only known if known in both the LHS and RHS.
- KnownOne &= KnownOne2;
- KnownZero &= KnownZero2;
- break;
- case ISD::SELECT_CC:
- if (SimplifyDemandedBits(Op.getOperand(3), NewMask, KnownZero,
- KnownOne, TLO, Depth+1))
- return true;
- if (SimplifyDemandedBits(Op.getOperand(2), NewMask, KnownZero2,
- KnownOne2, TLO, Depth+1))
- return true;
- assert((KnownZero & KnownOne) == 0 && "Bits known to be one AND zero?");
- assert((KnownZero2 & KnownOne2) == 0 && "Bits known to be one AND zero?");
-
- // If the operands are constants, see if we can simplify them.
- if (TLO.ShrinkDemandedConstant(Op, NewMask))
- return true;
-
- // Only known if known in both the LHS and RHS.
- KnownOne &= KnownOne2;
- KnownZero &= KnownZero2;
- break;
- case ISD::SHL:
- if (ConstantSDNode *SA = dyn_cast<ConstantSDNode>(Op.getOperand(1))) {
- unsigned ShAmt = SA->getValue();
- SDOperand InOp = Op.getOperand(0);
-
- // If the shift count is an invalid immediate, don't do anything.
- if (ShAmt >= BitWidth)
- break;
-
- // If this is ((X >>u C1) << ShAmt), see if we can simplify this into a
- // single shift. We can do this if the bottom bits (which are shifted
- // out) are never demanded.
- if (InOp.getOpcode() == ISD::SRL &&
- isa<ConstantSDNode>(InOp.getOperand(1))) {
- if (ShAmt && (NewMask & APInt::getLowBitsSet(BitWidth, ShAmt)) == 0) {
- unsigned C1 = cast<ConstantSDNode>(InOp.getOperand(1))->getValue();
- unsigned Opc = ISD::SHL;
- int Diff = ShAmt-C1;
- if (Diff < 0) {
- Diff = -Diff;
- Opc = ISD::SRL;
- }
-
- SDOperand NewSA =
- TLO.DAG.getConstant(Diff, Op.getOperand(1).getValueType());
- MVT::ValueType VT = Op.getValueType();
- return TLO.CombineTo(Op, TLO.DAG.getNode(Opc, VT,
- InOp.getOperand(0), NewSA));
- }
- }
-
- if (SimplifyDemandedBits(Op.getOperand(0), NewMask.lshr(ShAmt),
- KnownZero, KnownOne, TLO, Depth+1))
- return true;
- KnownZero <<= SA->getValue();
- KnownOne <<= SA->getValue();
- // low bits known zero.
- KnownZero |= APInt::getLowBitsSet(BitWidth, SA->getValue());
- }
- break;
- case ISD::SRL:
- if (ConstantSDNode *SA = dyn_cast<ConstantSDNode>(Op.getOperand(1))) {
- MVT::ValueType VT = Op.getValueType();
- unsigned ShAmt = SA->getValue();
- unsigned VTSize = MVT::getSizeInBits(VT);
- SDOperand InOp = Op.getOperand(0);
-
- // If the shift count is an invalid immediate, don't do anything.
- if (ShAmt >= BitWidth)
- break;
-
- // If this is ((X << C1) >>u ShAmt), see if we can simplify this into a
- // single shift. We can do this if the top bits (which are shifted out)
- // are never demanded.
- if (InOp.getOpcode() == ISD::SHL &&
- isa<ConstantSDNode>(InOp.getOperand(1))) {
- if (ShAmt && (NewMask & APInt::getHighBitsSet(VTSize, ShAmt)) == 0) {
- unsigned C1 = cast<ConstantSDNode>(InOp.getOperand(1))->getValue();
- unsigned Opc = ISD::SRL;
- int Diff = ShAmt-C1;
- if (Diff < 0) {
- Diff = -Diff;
- Opc = ISD::SHL;
- }
-
- SDOperand NewSA =
- TLO.DAG.getConstant(Diff, Op.getOperand(1).getValueType());
- return TLO.CombineTo(Op, TLO.DAG.getNode(Opc, VT,
- InOp.getOperand(0), NewSA));
- }
- }
-
- // Compute the new bits that are at the top now.
- if (SimplifyDemandedBits(InOp, (NewMask << ShAmt),
- KnownZero, KnownOne, TLO, Depth+1))
- return true;
- assert((KnownZero & KnownOne) == 0 && "Bits known to be one AND zero?");
- KnownZero = KnownZero.lshr(ShAmt);
- KnownOne = KnownOne.lshr(ShAmt);
-
- APInt HighBits = APInt::getHighBitsSet(BitWidth, ShAmt);
- KnownZero |= HighBits; // High bits known zero.
- }
- break;
- case ISD::SRA:
- if (ConstantSDNode *SA = dyn_cast<ConstantSDNode>(Op.getOperand(1))) {
- MVT::ValueType VT = Op.getValueType();
- unsigned ShAmt = SA->getValue();
-
- // If the shift count is an invalid immediate, don't do anything.
- if (ShAmt >= BitWidth)
- break;
-
- APInt InDemandedMask = (NewMask << ShAmt);
-
- // If any of the demanded bits are produced by the sign extension, we also
- // demand the input sign bit.
- APInt HighBits = APInt::getHighBitsSet(BitWidth, ShAmt);
- if (HighBits.intersects(NewMask))
- InDemandedMask |= APInt::getSignBit(MVT::getSizeInBits(VT));
-
- if (SimplifyDemandedBits(Op.getOperand(0), InDemandedMask,
- KnownZero, KnownOne, TLO, Depth+1))
- return true;
- assert((KnownZero & KnownOne) == 0 && "Bits known to be one AND zero?");
- KnownZero = KnownZero.lshr(ShAmt);
- KnownOne = KnownOne.lshr(ShAmt);
-
- // Handle the sign bit, adjusted to where it is now in the mask.
- APInt SignBit = APInt::getSignBit(BitWidth).lshr(ShAmt);
-
- // If the input sign bit is known to be zero, or if none of the top bits
- // are demanded, turn this into an unsigned shift right.
- if (KnownZero.intersects(SignBit) || (HighBits & ~NewMask) == HighBits) {
- return TLO.CombineTo(Op, TLO.DAG.getNode(ISD::SRL, VT, Op.getOperand(0),
- Op.getOperand(1)));
- } else if (KnownOne.intersects(SignBit)) { // New bits are known one.
- KnownOne |= HighBits;
- }
- }
- break;
- case ISD::SIGN_EXTEND_INREG: {
- MVT::ValueType EVT = cast<VTSDNode>(Op.getOperand(1))->getVT();
-
- // Sign extension. Compute the demanded bits in the result that are not
- // present in the input.
- APInt NewBits = APInt::getHighBitsSet(BitWidth,
- BitWidth - MVT::getSizeInBits(EVT)) &
- NewMask;
-
- // If none of the extended bits are demanded, eliminate the sextinreg.
- if (NewBits == 0)
- return TLO.CombineTo(Op, Op.getOperand(0));
-
- APInt InSignBit = APInt::getSignBit(MVT::getSizeInBits(EVT));
- InSignBit.zext(BitWidth);
- APInt InputDemandedBits = APInt::getLowBitsSet(BitWidth,
- MVT::getSizeInBits(EVT)) &
- NewMask;
-
- // Since the sign extended bits are demanded, we know that the sign
- // bit is demanded.
- InputDemandedBits |= InSignBit;
-
- if (SimplifyDemandedBits(Op.getOperand(0), InputDemandedBits,
- KnownZero, KnownOne, TLO, Depth+1))
- return true;
- assert((KnownZero & KnownOne) == 0 && "Bits known to be one AND zero?");
-
- // If the sign bit of the input is known set or clear, then we know the
- // top bits of the result.
-
- // If the input sign bit is known zero, convert this into a zero extension.
- if (KnownZero.intersects(InSignBit))
- return TLO.CombineTo(Op,
- TLO.DAG.getZeroExtendInReg(Op.getOperand(0), EVT));
-
- if (KnownOne.intersects(InSignBit)) { // Input sign bit known set
- KnownOne |= NewBits;
- KnownZero &= ~NewBits;
- } else { // Input sign bit unknown
- KnownZero &= ~NewBits;
- KnownOne &= ~NewBits;
- }
- break;
- }
- case ISD::ZERO_EXTEND: {
- unsigned OperandBitWidth = Op.getOperand(0).getValueSizeInBits();
- APInt InMask = NewMask;
- InMask.trunc(OperandBitWidth);
-
- // If none of the top bits are demanded, convert this into an any_extend.
- APInt NewBits =
- APInt::getHighBitsSet(BitWidth, BitWidth - OperandBitWidth) & NewMask;
- if (!NewBits.intersects(NewMask))
- return TLO.CombineTo(Op, TLO.DAG.getNode(ISD::ANY_EXTEND,
- Op.getValueType(),
- Op.getOperand(0)));
-
- if (SimplifyDemandedBits(Op.getOperand(0), InMask,
- KnownZero, KnownOne, TLO, Depth+1))
- return true;
- assert((KnownZero & KnownOne) == 0 && "Bits known to be one AND zero?");
- KnownZero.zext(BitWidth);
- KnownOne.zext(BitWidth);
- KnownZero |= NewBits;
- break;
- }
- case ISD::SIGN_EXTEND: {
- MVT::ValueType InVT = Op.getOperand(0).getValueType();
- unsigned InBits = MVT::getSizeInBits(InVT);
- APInt InMask = APInt::getLowBitsSet(BitWidth, InBits);
- APInt InSignBit = APInt::getBitsSet(BitWidth, InBits - 1, InBits);
- APInt NewBits = ~InMask & NewMask;
-
- // If none of the top bits are demanded, convert this into an any_extend.
- if (NewBits == 0)
- return TLO.CombineTo(Op,TLO.DAG.getNode(ISD::ANY_EXTEND,Op.getValueType(),
- Op.getOperand(0)));
-
- // Since some of the sign extended bits are demanded, we know that the sign
- // bit is demanded.
- APInt InDemandedBits = InMask & NewMask;
- InDemandedBits |= InSignBit;
- InDemandedBits.trunc(InBits);
-
- if (SimplifyDemandedBits(Op.getOperand(0), InDemandedBits, KnownZero,
- KnownOne, TLO, Depth+1))
- return true;
- KnownZero.zext(BitWidth);
- KnownOne.zext(BitWidth);
-
- // If the sign bit is known zero, convert this to a zero extend.
- if (KnownZero.intersects(InSignBit))
- return TLO.CombineTo(Op, TLO.DAG.getNode(ISD::ZERO_EXTEND,
- Op.getValueType(),
- Op.getOperand(0)));
-
- // If the sign bit is known one, the top bits match.
- if (KnownOne.intersects(InSignBit)) {
- KnownOne |= NewBits;
- KnownZero &= ~NewBits;
- } else { // Otherwise, top bits aren't known.
- KnownOne &= ~NewBits;
- KnownZero &= ~NewBits;
- }
- break;
- }
- case ISD::ANY_EXTEND: {
- unsigned OperandBitWidth = Op.getOperand(0).getValueSizeInBits();
- APInt InMask = NewMask;
- InMask.trunc(OperandBitWidth);
- if (SimplifyDemandedBits(Op.getOperand(0), InMask,
- KnownZero, KnownOne, TLO, Depth+1))
- return true;
- assert((KnownZero & KnownOne) == 0 && "Bits known to be one AND zero?");
- KnownZero.zext(BitWidth);
- KnownOne.zext(BitWidth);
- break;
- }
- case ISD::TRUNCATE: {
- // Simplify the input, using demanded bit information, and compute the known
- // zero/one bits live out.
- APInt TruncMask = NewMask;
- TruncMask.zext(Op.getOperand(0).getValueSizeInBits());
- if (SimplifyDemandedBits(Op.getOperand(0), TruncMask,
- KnownZero, KnownOne, TLO, Depth+1))
- return true;
- KnownZero.trunc(BitWidth);
- KnownOne.trunc(BitWidth);
-
- // If the input is only used by this truncate, see if we can shrink it based
- // on the known demanded bits.
- if (Op.getOperand(0).Val->hasOneUse()) {
- SDOperand In = Op.getOperand(0);
- unsigned InBitWidth = In.getValueSizeInBits();
- switch (In.getOpcode()) {
- default: break;
- case ISD::SRL:
- // Shrink SRL by a constant if none of the high bits shifted in are
- // demanded.
- if (ConstantSDNode *ShAmt = dyn_cast<ConstantSDNode>(In.getOperand(1))){
- APInt HighBits = APInt::getHighBitsSet(InBitWidth,
- InBitWidth - BitWidth);
- HighBits = HighBits.lshr(ShAmt->getValue());
- HighBits.trunc(BitWidth);
-
- if (ShAmt->getValue() < BitWidth && !(HighBits & NewMask)) {
- // None of the shifted in bits are needed. Add a truncate of the
- // shift input, then shift it.
- SDOperand NewTrunc = TLO.DAG.getNode(ISD::TRUNCATE,
- Op.getValueType(),
- In.getOperand(0));
- return TLO.CombineTo(Op, TLO.DAG.getNode(ISD::SRL,Op.getValueType(),
- NewTrunc, In.getOperand(1)));
- }
- }
- break;
- }
- }
-
- assert((KnownZero & KnownOne) == 0 && "Bits known to be one AND zero?");
- break;
- }
- case ISD::AssertZext: {
- MVT::ValueType VT = cast<VTSDNode>(Op.getOperand(1))->getVT();
- APInt InMask = APInt::getLowBitsSet(BitWidth,
- MVT::getSizeInBits(VT));
- if (SimplifyDemandedBits(Op.getOperand(0), InMask & NewMask,
- KnownZero, KnownOne, TLO, Depth+1))
- return true;
- assert((KnownZero & KnownOne) == 0 && "Bits known to be one AND zero?");
- KnownZero |= ~InMask & NewMask;
- break;
- }
- case ISD::BIT_CONVERT:
-#if 0
- // If this is an FP->Int bitcast and if the sign bit is the only thing that
- // is demanded, turn this into a FGETSIGN.
- if (NewMask == MVT::getIntVTSignBit(Op.getValueType()) &&
- MVT::isFloatingPoint(Op.getOperand(0).getValueType()) &&
- !MVT::isVector(Op.getOperand(0).getValueType())) {
- // Only do this xform if FGETSIGN is valid or if before legalize.
- if (!TLO.AfterLegalize ||
- isOperationLegal(ISD::FGETSIGN, Op.getValueType())) {
- // Make a FGETSIGN + SHL to move the sign bit into the appropriate
- // place. We expect the SHL to be eliminated by other optimizations.
- SDOperand Sign = TLO.DAG.getNode(ISD::FGETSIGN, Op.getValueType(),
- Op.getOperand(0));
- unsigned ShVal = MVT::getSizeInBits(Op.getValueType())-1;
- SDOperand ShAmt = TLO.DAG.getConstant(ShVal, getShiftAmountTy());
- return TLO.CombineTo(Op, TLO.DAG.getNode(ISD::SHL, Op.getValueType(),
- Sign, ShAmt));
- }
- }
-#endif
- break;
- default:
- // Just use ComputeMaskedBits to compute output bits.
- TLO.DAG.ComputeMaskedBits(Op, NewMask, KnownZero, KnownOne, Depth);
- break;
- }
-
- // If we know the value of all of the demanded bits, return this as a
- // constant.
- if ((NewMask & (KnownZero|KnownOne)) == NewMask)
- return TLO.CombineTo(Op, TLO.DAG.getConstant(KnownOne, Op.getValueType()));
-
- return false;
-}
-
-/// computeMaskedBitsForTargetNode - Determine which of the bits specified
-/// in Mask are known to be either zero or one and return them in the
-/// KnownZero/KnownOne bitsets.
-void TargetLowering::computeMaskedBitsForTargetNode(const SDOperand Op,
- const APInt &Mask,
- APInt &KnownZero,
- APInt &KnownOne,
- const SelectionDAG &DAG,
- unsigned Depth) const {
- assert((Op.getOpcode() >= ISD::BUILTIN_OP_END ||
- Op.getOpcode() == ISD::INTRINSIC_WO_CHAIN ||
- Op.getOpcode() == ISD::INTRINSIC_W_CHAIN ||
- Op.getOpcode() == ISD::INTRINSIC_VOID) &&
- "Should use MaskedValueIsZero if you don't know whether Op"
- " is a target node!");
- KnownZero = KnownOne = APInt(Mask.getBitWidth(), 0);
-}
-
-/// ComputeNumSignBitsForTargetNode - This method can be implemented by
-/// targets that want to expose additional information about sign bits to the
-/// DAG Combiner.
-unsigned TargetLowering::ComputeNumSignBitsForTargetNode(SDOperand Op,
- unsigned Depth) const {
- assert((Op.getOpcode() >= ISD::BUILTIN_OP_END ||
- Op.getOpcode() == ISD::INTRINSIC_WO_CHAIN ||
- Op.getOpcode() == ISD::INTRINSIC_W_CHAIN ||
- Op.getOpcode() == ISD::INTRINSIC_VOID) &&
- "Should use ComputeNumSignBits if you don't know whether Op"
- " is a target node!");
- return 1;
-}
-
-
-/// SimplifySetCC - Try to simplify a setcc built with the specified operands
-/// and cc. If it is unable to simplify it, return a null SDOperand.
-SDOperand
-TargetLowering::SimplifySetCC(MVT::ValueType VT, SDOperand N0, SDOperand N1,
- ISD::CondCode Cond, bool foldBooleans,
- DAGCombinerInfo &DCI) const {
- SelectionDAG &DAG = DCI.DAG;
-
- // These setcc operations always fold.
- switch (Cond) {
- default: break;
- case ISD::SETFALSE:
- case ISD::SETFALSE2: return DAG.getConstant(0, VT);
- case ISD::SETTRUE:
- case ISD::SETTRUE2: return DAG.getConstant(1, VT);
- }
-
- if (ConstantSDNode *N1C = dyn_cast<ConstantSDNode>(N1.Val)) {
- const APInt &C1 = N1C->getAPIntValue();
- if (isa<ConstantSDNode>(N0.Val)) {
- return DAG.FoldSetCC(VT, N0, N1, Cond);
- } else {
- // If the LHS is '(srl (ctlz x), 5)', the RHS is 0/1, and this is an
- // equality comparison, then we're just comparing whether X itself is
- // zero.
- if (N0.getOpcode() == ISD::SRL && (C1 == 0 || C1 == 1) &&
- N0.getOperand(0).getOpcode() == ISD::CTLZ &&
- N0.getOperand(1).getOpcode() == ISD::Constant) {
- unsigned ShAmt = cast<ConstantSDNode>(N0.getOperand(1))->getValue();
- if ((Cond == ISD::SETEQ || Cond == ISD::SETNE) &&
- ShAmt == Log2_32(MVT::getSizeInBits(N0.getValueType()))) {
- if ((C1 == 0) == (Cond == ISD::SETEQ)) {
- // (srl (ctlz x), 5) == 0 -> X != 0
- // (srl (ctlz x), 5) != 1 -> X != 0
- Cond = ISD::SETNE;
- } else {
- // (srl (ctlz x), 5) != 0 -> X == 0
- // (srl (ctlz x), 5) == 1 -> X == 0
- Cond = ISD::SETEQ;
- }
- SDOperand Zero = DAG.getConstant(0, N0.getValueType());
- return DAG.getSetCC(VT, N0.getOperand(0).getOperand(0),
- Zero, Cond);
- }
- }
-
- // If the LHS is a ZERO_EXTEND, perform the comparison on the input.
- if (N0.getOpcode() == ISD::ZERO_EXTEND) {
- unsigned InSize = MVT::getSizeInBits(N0.getOperand(0).getValueType());
-
- // If the comparison constant has bits in the upper part, the
- // zero-extended value could never match.
- if (C1.intersects(APInt::getHighBitsSet(C1.getBitWidth(),
- C1.getBitWidth() - InSize))) {
- switch (Cond) {
- case ISD::SETUGT:
- case ISD::SETUGE:
- case ISD::SETEQ: return DAG.getConstant(0, VT);
- case ISD::SETULT:
- case ISD::SETULE:
- case ISD::SETNE: return DAG.getConstant(1, VT);
- case ISD::SETGT:
- case ISD::SETGE:
- // True if the sign bit of C1 is set.
- return DAG.getConstant(C1.isNegative(), VT);
- case ISD::SETLT:
- case ISD::SETLE:
- // True if the sign bit of C1 isn't set.
- return DAG.getConstant(C1.isNonNegative(), VT);
- default:
- break;
- }
- }
-
- // Otherwise, we can perform the comparison with the low bits.
- switch (Cond) {
- case ISD::SETEQ:
- case ISD::SETNE:
- case ISD::SETUGT:
- case ISD::SETUGE:
- case ISD::SETULT:
- case ISD::SETULE:
- return DAG.getSetCC(VT, N0.getOperand(0),
- DAG.getConstant(APInt(C1).trunc(InSize),
- N0.getOperand(0).getValueType()),
- Cond);
- default:
- break; // todo, be more careful with signed comparisons
- }
- } else if (N0.getOpcode() == ISD::SIGN_EXTEND_INREG &&
- (Cond == ISD::SETEQ || Cond == ISD::SETNE)) {
- MVT::ValueType ExtSrcTy = cast<VTSDNode>(N0.getOperand(1))->getVT();
- unsigned ExtSrcTyBits = MVT::getSizeInBits(ExtSrcTy);
- MVT::ValueType ExtDstTy = N0.getValueType();
- unsigned ExtDstTyBits = MVT::getSizeInBits(ExtDstTy);
-
- // If the extended part has any inconsistent bits, it cannot ever
- // compare equal. In other words, they have to be all ones or all
- // zeros.
- APInt ExtBits =
- APInt::getHighBitsSet(ExtDstTyBits, ExtDstTyBits - ExtSrcTyBits);
- if ((C1 & ExtBits) != 0 && (C1 & ExtBits) != ExtBits)
- return DAG.getConstant(Cond == ISD::SETNE, VT);
-
- SDOperand ZextOp;
- MVT::ValueType Op0Ty = N0.getOperand(0).getValueType();
- if (Op0Ty == ExtSrcTy) {
- ZextOp = N0.getOperand(0);
- } else {
- APInt Imm = APInt::getLowBitsSet(ExtDstTyBits, ExtSrcTyBits);
- ZextOp = DAG.getNode(ISD::AND, Op0Ty, N0.getOperand(0),
- DAG.getConstant(Imm, Op0Ty));
- }
- if (!DCI.isCalledByLegalizer())
- DCI.AddToWorklist(ZextOp.Val);
- // Otherwise, make this a use of a zext.
- return DAG.getSetCC(VT, ZextOp,
- DAG.getConstant(C1 & APInt::getLowBitsSet(
- ExtDstTyBits,
- ExtSrcTyBits),
- ExtDstTy),
- Cond);
- } else if ((N1C->isNullValue() || N1C->getAPIntValue() == 1) &&
- (Cond == ISD::SETEQ || Cond == ISD::SETNE)) {
-
- // SETCC (SETCC), [0|1], [EQ|NE] -> SETCC
- if (N0.getOpcode() == ISD::SETCC) {
- bool TrueWhenTrue = (Cond == ISD::SETEQ) ^ (N1C->getValue() != 1);
- if (TrueWhenTrue)
- return N0;
-
- // Invert the condition.
- ISD::CondCode CC = cast<CondCodeSDNode>(N0.getOperand(2))->get();
- CC = ISD::getSetCCInverse(CC,
- MVT::isInteger(N0.getOperand(0).getValueType()));
- return DAG.getSetCC(VT, N0.getOperand(0), N0.getOperand(1), CC);
- }
-
- if ((N0.getOpcode() == ISD::XOR ||
- (N0.getOpcode() == ISD::AND &&
- N0.getOperand(0).getOpcode() == ISD::XOR &&
- N0.getOperand(1) == N0.getOperand(0).getOperand(1))) &&
- isa<ConstantSDNode>(N0.getOperand(1)) &&
- cast<ConstantSDNode>(N0.getOperand(1))->getAPIntValue() == 1) {
- // If this is (X^1) == 0/1, swap the RHS and eliminate the xor. We
- // can only do this if the top bits are known zero.
- unsigned BitWidth = N0.getValueSizeInBits();
- if (DAG.MaskedValueIsZero(N0,
- APInt::getHighBitsSet(BitWidth,
- BitWidth-1))) {
- // Okay, get the un-inverted input value.
- SDOperand Val;
- if (N0.getOpcode() == ISD::XOR)
- Val = N0.getOperand(0);
- else {
- assert(N0.getOpcode() == ISD::AND &&
- N0.getOperand(0).getOpcode() == ISD::XOR);
- // ((X^1)&1)^1 -> X & 1
- Val = DAG.getNode(ISD::AND, N0.getValueType(),
- N0.getOperand(0).getOperand(0),
- N0.getOperand(1));
- }
- return DAG.getSetCC(VT, Val, N1,
- Cond == ISD::SETEQ ? ISD::SETNE : ISD::SETEQ);
- }
- }
- }
-
- APInt MinVal, MaxVal;
- unsigned OperandBitSize = MVT::getSizeInBits(N1C->getValueType(0));
- if (ISD::isSignedIntSetCC(Cond)) {
- MinVal = APInt::getSignedMinValue(OperandBitSize);
- MaxVal = APInt::getSignedMaxValue(OperandBitSize);
- } else {
- MinVal = APInt::getMinValue(OperandBitSize);
- MaxVal = APInt::getMaxValue(OperandBitSize);
- }
-
- // Canonicalize GE/LE comparisons to use GT/LT comparisons.
- if (Cond == ISD::SETGE || Cond == ISD::SETUGE) {
- if (C1 == MinVal) return DAG.getConstant(1, VT); // X >= MIN --> true
- // X >= C0 --> X > (C0-1)
- return DAG.getSetCC(VT, N0, DAG.getConstant(C1-1, N1.getValueType()),
- (Cond == ISD::SETGE) ? ISD::SETGT : ISD::SETUGT);
- }
-
- if (Cond == ISD::SETLE || Cond == ISD::SETULE) {
- if (C1 == MaxVal) return DAG.getConstant(1, VT); // X <= MAX --> true
- // X <= C0 --> X < (C0+1)
- return DAG.getSetCC(VT, N0, DAG.getConstant(C1+1, N1.getValueType()),
- (Cond == ISD::SETLE) ? ISD::SETLT : ISD::SETULT);
- }
-
- if ((Cond == ISD::SETLT || Cond == ISD::SETULT) && C1 == MinVal)
- return DAG.getConstant(0, VT); // X < MIN --> false
- if ((Cond == ISD::SETGE || Cond == ISD::SETUGE) && C1 == MinVal)
- return DAG.getConstant(1, VT); // X >= MIN --> true
- if ((Cond == ISD::SETGT || Cond == ISD::SETUGT) && C1 == MaxVal)
- return DAG.getConstant(0, VT); // X > MAX --> false
- if ((Cond == ISD::SETLE || Cond == ISD::SETULE) && C1 == MaxVal)
- return DAG.getConstant(1, VT); // X <= MAX --> true
-
- // Canonicalize setgt X, Min --> setne X, Min
- if ((Cond == ISD::SETGT || Cond == ISD::SETUGT) && C1 == MinVal)
- return DAG.getSetCC(VT, N0, N1, ISD::SETNE);
- // Canonicalize setlt X, Max --> setne X, Max
- if ((Cond == ISD::SETLT || Cond == ISD::SETULT) && C1 == MaxVal)
- return DAG.getSetCC(VT, N0, N1, ISD::SETNE);
-
- // If we have setult X, 1, turn it into seteq X, 0
- if ((Cond == ISD::SETLT || Cond == ISD::SETULT) && C1 == MinVal+1)
- return DAG.getSetCC(VT, N0, DAG.getConstant(MinVal, N0.getValueType()),
- ISD::SETEQ);
- // If we have setugt X, Max-1, turn it into seteq X, Max
- else if ((Cond == ISD::SETGT || Cond == ISD::SETUGT) && C1 == MaxVal-1)
- return DAG.getSetCC(VT, N0, DAG.getConstant(MaxVal, N0.getValueType()),
- ISD::SETEQ);
-
- // If we have "setcc X, C0", check to see if we can shrink the immediate
- // by changing cc.
-
- // SETUGT X, SINTMAX -> SETLT X, 0
- if (Cond == ISD::SETUGT && OperandBitSize != 1 &&
- C1 == (~0ULL >> (65-OperandBitSize)))
- return DAG.getSetCC(VT, N0, DAG.getConstant(0, N1.getValueType()),
- ISD::SETLT);
-
- // FIXME: Implement the rest of these.
-
- // Fold bit comparisons when we can.
- if ((Cond == ISD::SETEQ || Cond == ISD::SETNE) &&
- VT == N0.getValueType() && N0.getOpcode() == ISD::AND)
- if (ConstantSDNode *AndRHS =
- dyn_cast<ConstantSDNode>(N0.getOperand(1))) {
- if (Cond == ISD::SETNE && C1 == 0) {// (X & 8) != 0 --> (X & 8) >> 3
- // Perform the xform if the AND RHS is a single bit.
- if (isPowerOf2_64(AndRHS->getValue())) {
- return DAG.getNode(ISD::SRL, VT, N0,
- DAG.getConstant(Log2_64(AndRHS->getValue()),
- getShiftAmountTy()));
- }
- } else if (Cond == ISD::SETEQ && C1 == AndRHS->getValue()) {
- // (X & 8) == 8 --> (X & 8) >> 3
- // Perform the xform if C1 is a single bit.
- if (C1.isPowerOf2()) {
- return DAG.getNode(ISD::SRL, VT, N0,
- DAG.getConstant(C1.logBase2(), getShiftAmountTy()));
- }
- }
- }
- }
- } else if (isa<ConstantSDNode>(N0.Val)) {
- // Ensure that the constant occurs on the RHS.
- return DAG.getSetCC(VT, N1, N0, ISD::getSetCCSwappedOperands(Cond));
- }
-
- if (isa<ConstantFPSDNode>(N0.Val)) {
- // Constant fold or commute setcc.
- SDOperand O = DAG.FoldSetCC(VT, N0, N1, Cond);
- if (O.Val) return O;
- } else if (ConstantFPSDNode *CFP = dyn_cast<ConstantFPSDNode>(N1.Val)) {
- // If the RHS of an FP comparison is a constant, simplify it away in
- // some cases.
- if (CFP->getValueAPF().isNaN()) {
- // If an operand is known to be a nan, we can fold it.
- switch (ISD::getUnorderedFlavor(Cond)) {
- default: assert(0 && "Unknown flavor!");
- case 0: // Known false.
- return DAG.getConstant(0, VT);
- case 1: // Known true.
- return DAG.getConstant(1, VT);
- case 2: // Undefined.
- return DAG.getNode(ISD::UNDEF, VT);
- }
- }
-
- // Otherwise, we know the RHS is not a NaN. Simplify the node to drop the
- // constant if knowing that the operand is non-nan is enough. We prefer to
- // have SETO(x,x) instead of SETO(x, 0.0) because this avoids having to
- // materialize 0.0.
- if (Cond == ISD::SETO || Cond == ISD::SETUO)
- return DAG.getSetCC(VT, N0, N0, Cond);
- }
-
- if (N0 == N1) {
- // We can always fold X == X for integer setcc's.
- if (MVT::isInteger(N0.getValueType()))
- return DAG.getConstant(ISD::isTrueWhenEqual(Cond), VT);
- unsigned UOF = ISD::getUnorderedFlavor(Cond);
- if (UOF == 2) // FP operators that are undefined on NaNs.
- return DAG.getConstant(ISD::isTrueWhenEqual(Cond), VT);
- if (UOF == unsigned(ISD::isTrueWhenEqual(Cond)))
- return DAG.getConstant(UOF, VT);
- // Otherwise, we can't fold it. However, we can simplify it to SETUO/SETO
- // if it is not already.
- ISD::CondCode NewCond = UOF == 0 ? ISD::SETO : ISD::SETUO;
- if (NewCond != Cond)
- return DAG.getSetCC(VT, N0, N1, NewCond);
- }
-
- if ((Cond == ISD::SETEQ || Cond == ISD::SETNE) &&
- MVT::isInteger(N0.getValueType())) {
- if (N0.getOpcode() == ISD::ADD || N0.getOpcode() == ISD::SUB ||
- N0.getOpcode() == ISD::XOR) {
- // Simplify (X+Y) == (X+Z) --> Y == Z
- if (N0.getOpcode() == N1.getOpcode()) {
- if (N0.getOperand(0) == N1.getOperand(0))
- return DAG.getSetCC(VT, N0.getOperand(1), N1.getOperand(1), Cond);
- if (N0.getOperand(1) == N1.getOperand(1))
- return DAG.getSetCC(VT, N0.getOperand(0), N1.getOperand(0), Cond);
- if (DAG.isCommutativeBinOp(N0.getOpcode())) {
- // If X op Y == Y op X, try other combinations.
- if (N0.getOperand(0) == N1.getOperand(1))
- return DAG.getSetCC(VT, N0.getOperand(1), N1.getOperand(0), Cond);
- if (N0.getOperand(1) == N1.getOperand(0))
- return DAG.getSetCC(VT, N0.getOperand(0), N1.getOperand(1), Cond);
- }
- }
-
- if (ConstantSDNode *RHSC = dyn_cast<ConstantSDNode>(N1)) {
- if (ConstantSDNode *LHSR = dyn_cast<ConstantSDNode>(N0.getOperand(1))) {
- // Turn (X+C1) == C2 --> X == C2-C1
- if (N0.getOpcode() == ISD::ADD && N0.Val->hasOneUse()) {
- return DAG.getSetCC(VT, N0.getOperand(0),
- DAG.getConstant(RHSC->getValue()-LHSR->getValue(),
- N0.getValueType()), Cond);
- }
-
- // Turn (X^C1) == C2 into X == C1^C2 iff X&~C1 = 0.
- if (N0.getOpcode() == ISD::XOR)
- // If we know that all of the inverted bits are zero, don't bother
- // performing the inversion.
- if (DAG.MaskedValueIsZero(N0.getOperand(0), ~LHSR->getAPIntValue()))
- return
- DAG.getSetCC(VT, N0.getOperand(0),
- DAG.getConstant(LHSR->getAPIntValue() ^
- RHSC->getAPIntValue(),
- N0.getValueType()),
- Cond);
- }
-
- // Turn (C1-X) == C2 --> X == C1-C2
- if (ConstantSDNode *SUBC = dyn_cast<ConstantSDNode>(N0.getOperand(0))) {
- if (N0.getOpcode() == ISD::SUB && N0.Val->hasOneUse()) {
- return
- DAG.getSetCC(VT, N0.getOperand(1),
- DAG.getConstant(SUBC->getAPIntValue() -
- RHSC->getAPIntValue(),
- N0.getValueType()),
- Cond);
- }
- }
- }
-
- // Simplify (X+Z) == X --> Z == 0
- if (N0.getOperand(0) == N1)
- return DAG.getSetCC(VT, N0.getOperand(1),
- DAG.getConstant(0, N0.getValueType()), Cond);
- if (N0.getOperand(1) == N1) {
- if (DAG.isCommutativeBinOp(N0.getOpcode()))
- return DAG.getSetCC(VT, N0.getOperand(0),
- DAG.getConstant(0, N0.getValueType()), Cond);
- else if (N0.Val->hasOneUse()) {
- assert(N0.getOpcode() == ISD::SUB && "Unexpected operation!");
- // (Z-X) == X --> Z == X<<1
- SDOperand SH = DAG.getNode(ISD::SHL, N1.getValueType(),
- N1,
- DAG.getConstant(1, getShiftAmountTy()));
- if (!DCI.isCalledByLegalizer())
- DCI.AddToWorklist(SH.Val);
- return DAG.getSetCC(VT, N0.getOperand(0), SH, Cond);
- }
- }
- }
-
- if (N1.getOpcode() == ISD::ADD || N1.getOpcode() == ISD::SUB ||
- N1.getOpcode() == ISD::XOR) {
- // Simplify X == (X+Z) --> Z == 0
- if (N1.getOperand(0) == N0) {
- return DAG.getSetCC(VT, N1.getOperand(1),
- DAG.getConstant(0, N1.getValueType()), Cond);
- } else if (N1.getOperand(1) == N0) {
- if (DAG.isCommutativeBinOp(N1.getOpcode())) {
- return DAG.getSetCC(VT, N1.getOperand(0),
- DAG.getConstant(0, N1.getValueType()), Cond);
- } else if (N1.Val->hasOneUse()) {
- assert(N1.getOpcode() == ISD::SUB && "Unexpected operation!");
- // X == (Z-X) --> X<<1 == Z
- SDOperand SH = DAG.getNode(ISD::SHL, N1.getValueType(), N0,
- DAG.getConstant(1, getShiftAmountTy()));
- if (!DCI.isCalledByLegalizer())
- DCI.AddToWorklist(SH.Val);
- return DAG.getSetCC(VT, SH, N1.getOperand(0), Cond);
- }
- }
- }
- }
-
- // Fold away ALL boolean setcc's.
- SDOperand Temp;
- if (N0.getValueType() == MVT::i1 && foldBooleans) {
- switch (Cond) {
- default: assert(0 && "Unknown integer setcc!");
- case ISD::SETEQ: // X == Y -> (X^Y)^1
- Temp = DAG.getNode(ISD::XOR, MVT::i1, N0, N1);
- N0 = DAG.getNode(ISD::XOR, MVT::i1, Temp, DAG.getConstant(1, MVT::i1));
- if (!DCI.isCalledByLegalizer())
- DCI.AddToWorklist(Temp.Val);
- break;
- case ISD::SETNE: // X != Y --> (X^Y)
- N0 = DAG.getNode(ISD::XOR, MVT::i1, N0, N1);
- break;
- case ISD::SETGT: // X >s Y --> X == 0 & Y == 1 --> X^1 & Y
- case ISD::SETULT: // X <u Y --> X == 0 & Y == 1 --> X^1 & Y
- Temp = DAG.getNode(ISD::XOR, MVT::i1, N0, DAG.getConstant(1, MVT::i1));
- N0 = DAG.getNode(ISD::AND, MVT::i1, N1, Temp);
- if (!DCI.isCalledByLegalizer())
- DCI.AddToWorklist(Temp.Val);
- break;
- case ISD::SETLT: // X <s Y --> X == 1 & Y == 0 --> Y^1 & X
- case ISD::SETUGT: // X >u Y --> X == 1 & Y == 0 --> Y^1 & X
- Temp = DAG.getNode(ISD::XOR, MVT::i1, N1, DAG.getConstant(1, MVT::i1));
- N0 = DAG.getNode(ISD::AND, MVT::i1, N0, Temp);
- if (!DCI.isCalledByLegalizer())
- DCI.AddToWorklist(Temp.Val);
- break;
- case ISD::SETULE: // X <=u Y --> X == 0 | Y == 1 --> X^1 | Y
- case ISD::SETGE: // X >=s Y --> X == 0 | Y == 1 --> X^1 | Y
- Temp = DAG.getNode(ISD::XOR, MVT::i1, N0, DAG.getConstant(1, MVT::i1));
- N0 = DAG.getNode(ISD::OR, MVT::i1, N1, Temp);
- if (!DCI.isCalledByLegalizer())
- DCI.AddToWorklist(Temp.Val);
- break;
- case ISD::SETUGE: // X >=u Y --> X == 1 | Y == 0 --> Y^1 | X
- case ISD::SETLE: // X <=s Y --> X == 1 | Y == 0 --> Y^1 | X
- Temp = DAG.getNode(ISD::XOR, MVT::i1, N1, DAG.getConstant(1, MVT::i1));
- N0 = DAG.getNode(ISD::OR, MVT::i1, N0, Temp);
- break;
- }
- if (VT != MVT::i1) {
- if (!DCI.isCalledByLegalizer())
- DCI.AddToWorklist(N0.Val);
- // FIXME: If running after legalize, we probably can't do this.
- N0 = DAG.getNode(ISD::ZERO_EXTEND, VT, N0);
- }
- return N0;
- }
-
- // Could not fold it.
- return SDOperand();
-}
-
-SDOperand TargetLowering::
-PerformDAGCombine(SDNode *N, DAGCombinerInfo &DCI) const {
- // Default implementation: no optimization.
- return SDOperand();
-}
-
-//===----------------------------------------------------------------------===//
-// Inline Assembler Implementation Methods
-//===----------------------------------------------------------------------===//
-
-
-TargetLowering::ConstraintType
-TargetLowering::getConstraintType(const std::string &Constraint) const {
- // FIXME: lots more standard ones to handle.
- if (Constraint.size() == 1) {
- switch (Constraint[0]) {
- default: break;
- case 'r': return C_RegisterClass;
- case 'm': // memory
- case 'o': // offsetable
- case 'V': // not offsetable
- return C_Memory;
- case 'i': // Simple Integer or Relocatable Constant
- case 'n': // Simple Integer
- case 's': // Relocatable Constant
- case 'X': // Allow ANY value.
- case 'I': // Target registers.
- case 'J':
- case 'K':
- case 'L':
- case 'M':
- case 'N':
- case 'O':
- case 'P':
- return C_Other;
- }
- }
-
- if (Constraint.size() > 1 && Constraint[0] == '{' &&
- Constraint[Constraint.size()-1] == '}')
- return C_Register;
- return C_Unknown;
-}
-
-/// LowerXConstraint - try to replace an X constraint, which matches anything,
-/// with another that has more specific requirements based on the type of the
-/// corresponding operand.
-const char *TargetLowering::LowerXConstraint(MVT::ValueType ConstraintVT) const{
- if (MVT::isInteger(ConstraintVT))
- return "r";
- if (MVT::isFloatingPoint(ConstraintVT))
- return "f"; // works for many targets
- return 0;
-}
-
-/// LowerAsmOperandForConstraint - Lower the specified operand into the Ops
-/// vector. If it is invalid, don't add anything to Ops.
-void TargetLowering::LowerAsmOperandForConstraint(SDOperand Op,
- char ConstraintLetter,
- std::vector<SDOperand> &Ops,
- SelectionDAG &DAG) const {
- switch (ConstraintLetter) {
- default: break;
- case 'X': // Allows any operand; labels (basic block) use this.
- if (Op.getOpcode() == ISD::BasicBlock) {
- Ops.push_back(Op);
- return;
- }
- // fall through
- case 'i': // Simple Integer or Relocatable Constant
- case 'n': // Simple Integer
- case 's': { // Relocatable Constant
- // These operands are interested in values of the form (GV+C), where C may
- // be folded in as an offset of GV, or it may be explicitly added. Also, it
- // is possible and fine if either GV or C are missing.
- ConstantSDNode *C = dyn_cast<ConstantSDNode>(Op);
- GlobalAddressSDNode *GA = dyn_cast<GlobalAddressSDNode>(Op);
-
- // If we have "(add GV, C)", pull out GV/C
- if (Op.getOpcode() == ISD::ADD) {
- C = dyn_cast<ConstantSDNode>(Op.getOperand(1));
- GA = dyn_cast<GlobalAddressSDNode>(Op.getOperand(0));
- if (C == 0 || GA == 0) {
- C = dyn_cast<ConstantSDNode>(Op.getOperand(0));
- GA = dyn_cast<GlobalAddressSDNode>(Op.getOperand(1));
- }
- if (C == 0 || GA == 0)
- C = 0, GA = 0;
- }
-
- // If we find a valid operand, map to the TargetXXX version so that the
- // value itself doesn't get selected.
- if (GA) { // Either &GV or &GV+C
- if (ConstraintLetter != 'n') {
- int64_t Offs = GA->getOffset();
- if (C) Offs += C->getValue();
- Ops.push_back(DAG.getTargetGlobalAddress(GA->getGlobal(),
- Op.getValueType(), Offs));
- return;
- }
- }
- if (C) { // just C, no GV.
- // Simple constants are not allowed for 's'.
- if (ConstraintLetter != 's') {
- Ops.push_back(DAG.getTargetConstant(C->getValue(), Op.getValueType()));
- return;
- }
- }
- break;
- }
- }
-}
-
-std::vector<unsigned> TargetLowering::
-getRegClassForInlineAsmConstraint(const std::string &Constraint,
- MVT::ValueType VT) const {
- return std::vector<unsigned>();
-}
-
-
-std::pair<unsigned, const TargetRegisterClass*> TargetLowering::
-getRegForInlineAsmConstraint(const std::string &Constraint,
- MVT::ValueType VT) const {
- if (Constraint[0] != '{')
- return std::pair<unsigned, const TargetRegisterClass*>(0, 0);
- assert(*(Constraint.end()-1) == '}' && "Not a brace enclosed constraint?");
-
- // Remove the braces from around the name.
- std::string RegName(Constraint.begin()+1, Constraint.end()-1);
-
- // Figure out which register class contains this reg.
- const TargetRegisterInfo *RI = TM.getRegisterInfo();
- for (TargetRegisterInfo::regclass_iterator RCI = RI->regclass_begin(),
- E = RI->regclass_end(); RCI != E; ++RCI) {
- const TargetRegisterClass *RC = *RCI;
-
- // If none of the the value types for this register class are valid, we
- // can't use it. For example, 64-bit reg classes on 32-bit targets.
- bool isLegal = false;
- for (TargetRegisterClass::vt_iterator I = RC->vt_begin(), E = RC->vt_end();
- I != E; ++I) {
- if (isTypeLegal(*I)) {
- isLegal = true;
- break;
- }
- }
-
- if (!isLegal) continue;
-
- for (TargetRegisterClass::iterator I = RC->begin(), E = RC->end();
- I != E; ++I) {
- if (StringsEqualNoCase(RegName, RI->get(*I).AsmName))
- return std::make_pair(*I, RC);
- }
- }
-
- return std::pair<unsigned, const TargetRegisterClass*>(0, 0);
-}
-
-//===----------------------------------------------------------------------===//
-// Constraint Selection.
-
-/// getConstraintGenerality - Return an integer indicating how general CT
-/// is.
-static unsigned getConstraintGenerality(TargetLowering::ConstraintType CT) {
- switch (CT) {
- default: assert(0 && "Unknown constraint type!");
- case TargetLowering::C_Other:
- case TargetLowering::C_Unknown:
- return 0;
- case TargetLowering::C_Register:
- return 1;
- case TargetLowering::C_RegisterClass:
- return 2;
- case TargetLowering::C_Memory:
- return 3;
- }
-}
-
-/// ChooseConstraint - If there are multiple different constraints that we
-/// could pick for this operand (e.g. "imr") try to pick the 'best' one.
-/// This is somewhat tricky: constraints fall into four classes:
-/// Other -> immediates and magic values
-/// Register -> one specific register
-/// RegisterClass -> a group of regs
-/// Memory -> memory
-/// Ideally, we would pick the most specific constraint possible: if we have
-/// something that fits into a register, we would pick it. The problem here
-/// is that if we have something that could either be in a register or in
-/// memory that use of the register could cause selection of *other*
-/// operands to fail: they might only succeed if we pick memory. Because of
-/// this the heuristic we use is:
-///
-/// 1) If there is an 'other' constraint, and if the operand is valid for
-/// that constraint, use it. This makes us take advantage of 'i'
-/// constraints when available.
-/// 2) Otherwise, pick the most general constraint present. This prefers
-/// 'm' over 'r', for example.
-///
-static void ChooseConstraint(TargetLowering::AsmOperandInfo &OpInfo,
- const TargetLowering &TLI,
- SDOperand Op, SelectionDAG *DAG) {
- assert(OpInfo.Codes.size() > 1 && "Doesn't have multiple constraint options");
- unsigned BestIdx = 0;
- TargetLowering::ConstraintType BestType = TargetLowering::C_Unknown;
- int BestGenerality = -1;
-
- // Loop over the options, keeping track of the most general one.
- for (unsigned i = 0, e = OpInfo.Codes.size(); i != e; ++i) {
- TargetLowering::ConstraintType CType =
- TLI.getConstraintType(OpInfo.Codes[i]);
-
- // If this is an 'other' constraint, see if the operand is valid for it.
- // For example, on X86 we might have an 'rI' constraint. If the operand
- // is an integer in the range [0..31] we want to use I (saving a load
- // of a register), otherwise we must use 'r'.
- if (CType == TargetLowering::C_Other && Op.Val) {
- assert(OpInfo.Codes[i].size() == 1 &&
- "Unhandled multi-letter 'other' constraint");
- std::vector<SDOperand> ResultOps;
- TLI.LowerAsmOperandForConstraint(Op, OpInfo.Codes[i][0],
- ResultOps, *DAG);
- if (!ResultOps.empty()) {
- BestType = CType;
- BestIdx = i;
- break;
- }
- }
-
- // This constraint letter is more general than the previous one, use it.
- int Generality = getConstraintGenerality(CType);
- if (Generality > BestGenerality) {
- BestType = CType;
- BestIdx = i;
- BestGenerality = Generality;
- }
- }
-
- OpInfo.ConstraintCode = OpInfo.Codes[BestIdx];
- OpInfo.ConstraintType = BestType;
-}
-
-/// ComputeConstraintToUse - Determines the constraint code and constraint
-/// type to use for the specific AsmOperandInfo, setting
-/// OpInfo.ConstraintCode and OpInfo.ConstraintType.
-void TargetLowering::ComputeConstraintToUse(AsmOperandInfo &OpInfo,
- SDOperand Op,
- SelectionDAG *DAG) const {
- assert(!OpInfo.Codes.empty() && "Must have at least one constraint");
-
- // Single-letter constraints ('r') are very common.
- if (OpInfo.Codes.size() == 1) {
- OpInfo.ConstraintCode = OpInfo.Codes[0];
- OpInfo.ConstraintType = getConstraintType(OpInfo.ConstraintCode);
- } else {
- ChooseConstraint(OpInfo, *this, Op, DAG);
- }
-
- // 'X' matches anything.
- if (OpInfo.ConstraintCode == "X" && OpInfo.CallOperandVal) {
- // Labels and constants are handled elsewhere ('X' is the only thing
- // that matches labels).
- if (isa<BasicBlock>(OpInfo.CallOperandVal) ||
- isa<ConstantInt>(OpInfo.CallOperandVal))
- return;
-
- // Otherwise, try to resolve it to something we know about by looking at
- // the actual operand type.
- if (const char *Repl = LowerXConstraint(OpInfo.ConstraintVT)) {
- OpInfo.ConstraintCode = Repl;
- OpInfo.ConstraintType = getConstraintType(OpInfo.ConstraintCode);
- }
- }
-}
-
-//===----------------------------------------------------------------------===//
-// Loop Strength Reduction hooks
-//===----------------------------------------------------------------------===//
-
-/// isLegalAddressingMode - Return true if the addressing mode represented
-/// by AM is legal for this target, for a load/store of the specified type.
-bool TargetLowering::isLegalAddressingMode(const AddrMode &AM,
- const Type *Ty) const {
- // The default implementation of this implements a conservative RISCy, r+r and
- // r+i addr mode.
-
- // Allows a sign-extended 16-bit immediate field.
- if (AM.BaseOffs <= -(1LL << 16) || AM.BaseOffs >= (1LL << 16)-1)
- return false;
-
- // No global is ever allowed as a base.
- if (AM.BaseGV)
- return false;
-
- // Only support r+r,
- switch (AM.Scale) {
- case 0: // "r+i" or just "i", depending on HasBaseReg.
- break;
- case 1:
- if (AM.HasBaseReg && AM.BaseOffs) // "r+r+i" is not allowed.
- return false;
- // Otherwise we have r+r or r+i.
- break;
- case 2:
- if (AM.HasBaseReg || AM.BaseOffs) // 2*r+r or 2*r+i is not allowed.
- return false;
- // Allow 2*r as r+r.
- break;
- }
-
- return true;
-}
-
-// Magic for divide replacement
-
-struct ms {
- int64_t m; // magic number
- int64_t s; // shift amount
-};
-
-struct mu {
- uint64_t m; // magic number
- int64_t a; // add indicator
- int64_t s; // shift amount
-};
-
-/// magic - calculate the magic numbers required to codegen an integer sdiv as
-/// a sequence of multiply and shifts. Requires that the divisor not be 0, 1,
-/// or -1.
-static ms magic32(int32_t d) {
- int32_t p;
- uint32_t ad, anc, delta, q1, r1, q2, r2, t;
- const uint32_t two31 = 0x80000000U;
- struct ms mag;
-
- ad = abs(d);
- t = two31 + ((uint32_t)d >> 31);
- anc = t - 1 - t%ad; // absolute value of nc
- p = 31; // initialize p
- q1 = two31/anc; // initialize q1 = 2p/abs(nc)
- r1 = two31 - q1*anc; // initialize r1 = rem(2p,abs(nc))
- q2 = two31/ad; // initialize q2 = 2p/abs(d)
- r2 = two31 - q2*ad; // initialize r2 = rem(2p,abs(d))
- do {
- p = p + 1;
- q1 = 2*q1; // update q1 = 2p/abs(nc)
- r1 = 2*r1; // update r1 = rem(2p/abs(nc))
- if (r1 >= anc) { // must be unsigned comparison
- q1 = q1 + 1;
- r1 = r1 - anc;
- }
- q2 = 2*q2; // update q2 = 2p/abs(d)
- r2 = 2*r2; // update r2 = rem(2p/abs(d))
- if (r2 >= ad) { // must be unsigned comparison
- q2 = q2 + 1;
- r2 = r2 - ad;
- }
- delta = ad - r2;
- } while (q1 < delta || (q1 == delta && r1 == 0));
-
- mag.m = (int32_t)(q2 + 1); // make sure to sign extend
- if (d < 0) mag.m = -mag.m; // resulting magic number
- mag.s = p - 32; // resulting shift
- return mag;
-}
-
-/// magicu - calculate the magic numbers required to codegen an integer udiv as
-/// a sequence of multiply, add and shifts. Requires that the divisor not be 0.
-static mu magicu32(uint32_t d) {
- int32_t p;
- uint32_t nc, delta, q1, r1, q2, r2;
- struct mu magu;
- magu.a = 0; // initialize "add" indicator
- nc = - 1 - (-d)%d;
- p = 31; // initialize p
- q1 = 0x80000000/nc; // initialize q1 = 2p/nc
- r1 = 0x80000000 - q1*nc; // initialize r1 = rem(2p,nc)
- q2 = 0x7FFFFFFF/d; // initialize q2 = (2p-1)/d
- r2 = 0x7FFFFFFF - q2*d; // initialize r2 = rem((2p-1),d)
- do {
- p = p + 1;
- if (r1 >= nc - r1 ) {
- q1 = 2*q1 + 1; // update q1
- r1 = 2*r1 - nc; // update r1
- }
- else {
- q1 = 2*q1; // update q1
- r1 = 2*r1; // update r1
- }
- if (r2 + 1 >= d - r2) {
- if (q2 >= 0x7FFFFFFF) magu.a = 1;
- q2 = 2*q2 + 1; // update q2
- r2 = 2*r2 + 1 - d; // update r2
- }
- else {
- if (q2 >= 0x80000000) magu.a = 1;
- q2 = 2*q2; // update q2
- r2 = 2*r2 + 1; // update r2
- }
- delta = d - 1 - r2;
- } while (p < 64 && (q1 < delta || (q1 == delta && r1 == 0)));
- magu.m = q2 + 1; // resulting magic number
- magu.s = p - 32; // resulting shift
- return magu;
-}
-
-/// magic - calculate the magic numbers required to codegen an integer sdiv as
-/// a sequence of multiply and shifts. Requires that the divisor not be 0, 1,
-/// or -1.
-static ms magic64(int64_t d) {
- int64_t p;
- uint64_t ad, anc, delta, q1, r1, q2, r2, t;
- const uint64_t two63 = 9223372036854775808ULL; // 2^63
- struct ms mag;
-
- ad = d >= 0 ? d : -d;
- t = two63 + ((uint64_t)d >> 63);
- anc = t - 1 - t%ad; // absolute value of nc
- p = 63; // initialize p
- q1 = two63/anc; // initialize q1 = 2p/abs(nc)
- r1 = two63 - q1*anc; // initialize r1 = rem(2p,abs(nc))
- q2 = two63/ad; // initialize q2 = 2p/abs(d)
- r2 = two63 - q2*ad; // initialize r2 = rem(2p,abs(d))
- do {
- p = p + 1;
- q1 = 2*q1; // update q1 = 2p/abs(nc)
- r1 = 2*r1; // update r1 = rem(2p/abs(nc))
- if (r1 >= anc) { // must be unsigned comparison
- q1 = q1 + 1;
- r1 = r1 - anc;
- }
- q2 = 2*q2; // update q2 = 2p/abs(d)
- r2 = 2*r2; // update r2 = rem(2p/abs(d))
- if (r2 >= ad) { // must be unsigned comparison
- q2 = q2 + 1;
- r2 = r2 - ad;
- }
- delta = ad - r2;
- } while (q1 < delta || (q1 == delta && r1 == 0));
-
- mag.m = q2 + 1;
- if (d < 0) mag.m = -mag.m; // resulting magic number
- mag.s = p - 64; // resulting shift
- return mag;
-}
-
-/// magicu - calculate the magic numbers required to codegen an integer udiv as
-/// a sequence of multiply, add and shifts. Requires that the divisor not be 0.
-static mu magicu64(uint64_t d)
-{
- int64_t p;
- uint64_t nc, delta, q1, r1, q2, r2;
- struct mu magu;
- magu.a = 0; // initialize "add" indicator
- nc = - 1 - (-d)%d;
- p = 63; // initialize p
- q1 = 0x8000000000000000ull/nc; // initialize q1 = 2p/nc
- r1 = 0x8000000000000000ull - q1*nc; // initialize r1 = rem(2p,nc)
- q2 = 0x7FFFFFFFFFFFFFFFull/d; // initialize q2 = (2p-1)/d
- r2 = 0x7FFFFFFFFFFFFFFFull - q2*d; // initialize r2 = rem((2p-1),d)
- do {
- p = p + 1;
- if (r1 >= nc - r1 ) {
- q1 = 2*q1 + 1; // update q1
- r1 = 2*r1 - nc; // update r1
- }
- else {
- q1 = 2*q1; // update q1
- r1 = 2*r1; // update r1
- }
- if (r2 + 1 >= d - r2) {
- if (q2 >= 0x7FFFFFFFFFFFFFFFull) magu.a = 1;
- q2 = 2*q2 + 1; // update q2
- r2 = 2*r2 + 1 - d; // update r2
- }
- else {
- if (q2 >= 0x8000000000000000ull) magu.a = 1;
- q2 = 2*q2; // update q2
- r2 = 2*r2 + 1; // update r2
- }
- delta = d - 1 - r2;
- } while (p < 128 && (q1 < delta || (q1 == delta && r1 == 0)));
- magu.m = q2 + 1; // resulting magic number
- magu.s = p - 64; // resulting shift
- return magu;
-}
-
-/// BuildSDIVSequence - Given an ISD::SDIV node expressing a divide by constant,
-/// return a DAG expression to select that will generate the same value by
-/// multiplying by a magic number. See:
-/// <http://the.wall.riscom.net/books/proc/ppc/cwg/code2.html>
-SDOperand TargetLowering::BuildSDIV(SDNode *N, SelectionDAG &DAG,
- std::vector<SDNode*>* Created) const {
- MVT::ValueType VT = N->getValueType(0);
-
- // Check to see if we can do this.
- if (!isTypeLegal(VT) || (VT != MVT::i32 && VT != MVT::i64))
- return SDOperand(); // BuildSDIV only operates on i32 or i64
-
- int64_t d = cast<ConstantSDNode>(N->getOperand(1))->getSignExtended();
- ms magics = (VT == MVT::i32) ? magic32(d) : magic64(d);
-
- // Multiply the numerator (operand 0) by the magic value
- SDOperand Q;
- if (isOperationLegal(ISD::MULHS, VT))
- Q = DAG.getNode(ISD::MULHS, VT, N->getOperand(0),
- DAG.getConstant(magics.m, VT));
- else if (isOperationLegal(ISD::SMUL_LOHI, VT))
- Q = SDOperand(DAG.getNode(ISD::SMUL_LOHI, DAG.getVTList(VT, VT),
- N->getOperand(0),
- DAG.getConstant(magics.m, VT)).Val, 1);
- else
- return SDOperand(); // No mulhs or equvialent
- // If d > 0 and m < 0, add the numerator
- if (d > 0 && magics.m < 0) {
- Q = DAG.getNode(ISD::ADD, VT, Q, N->getOperand(0));
- if (Created)
- Created->push_back(Q.Val);
- }
- // If d < 0 and m > 0, subtract the numerator.
- if (d < 0 && magics.m > 0) {
- Q = DAG.getNode(ISD::SUB, VT, Q, N->getOperand(0));
- if (Created)
- Created->push_back(Q.Val);
- }
- // Shift right algebraic if shift value is nonzero
- if (magics.s > 0) {
- Q = DAG.getNode(ISD::SRA, VT, Q,
- DAG.getConstant(magics.s, getShiftAmountTy()));
- if (Created)
- Created->push_back(Q.Val);
- }
- // Extract the sign bit and add it to the quotient
- SDOperand T =
- DAG.getNode(ISD::SRL, VT, Q, DAG.getConstant(MVT::getSizeInBits(VT)-1,
- getShiftAmountTy()));
- if (Created)
- Created->push_back(T.Val);
- return DAG.getNode(ISD::ADD, VT, Q, T);
-}
-
-/// BuildUDIVSequence - Given an ISD::UDIV node expressing a divide by constant,
-/// return a DAG expression to select that will generate the same value by
-/// multiplying by a magic number. See:
-/// <http://the.wall.riscom.net/books/proc/ppc/cwg/code2.html>
-SDOperand TargetLowering::BuildUDIV(SDNode *N, SelectionDAG &DAG,
- std::vector<SDNode*>* Created) const {
- MVT::ValueType VT = N->getValueType(0);
-
- // Check to see if we can do this.
- if (!isTypeLegal(VT) || (VT != MVT::i32 && VT != MVT::i64))
- return SDOperand(); // BuildUDIV only operates on i32 or i64
-
- uint64_t d = cast<ConstantSDNode>(N->getOperand(1))->getValue();
- mu magics = (VT == MVT::i32) ? magicu32(d) : magicu64(d);
-
- // Multiply the numerator (operand 0) by the magic value
- SDOperand Q;
- if (isOperationLegal(ISD::MULHU, VT))
- Q = DAG.getNode(ISD::MULHU, VT, N->getOperand(0),
- DAG.getConstant(magics.m, VT));
- else if (isOperationLegal(ISD::UMUL_LOHI, VT))
- Q = SDOperand(DAG.getNode(ISD::UMUL_LOHI, DAG.getVTList(VT, VT),
- N->getOperand(0),
- DAG.getConstant(magics.m, VT)).Val, 1);
- else
- return SDOperand(); // No mulhu or equvialent
- if (Created)
- Created->push_back(Q.Val);
-
- if (magics.a == 0) {
- return DAG.getNode(ISD::SRL, VT, Q,
- DAG.getConstant(magics.s, getShiftAmountTy()));
- } else {
- SDOperand NPQ = DAG.getNode(ISD::SUB, VT, N->getOperand(0), Q);
- if (Created)
- Created->push_back(NPQ.Val);
- NPQ = DAG.getNode(ISD::SRL, VT, NPQ,
- DAG.getConstant(1, getShiftAmountTy()));
- if (Created)
- Created->push_back(NPQ.Val);
- NPQ = DAG.getNode(ISD::ADD, VT, NPQ, Q);
- if (Created)
- Created->push_back(NPQ.Val);
- return DAG.getNode(ISD::SRL, VT, NPQ,
- DAG.getConstant(magics.s-1, getShiftAmountTy()));
- }
-}
diff --git a/release_23/lib/CodeGen/ShadowStackCollector.cpp b/release_23/lib/CodeGen/ShadowStackCollector.cpp
deleted file mode 100644
index 092671ce562f..000000000000
--- a/release_23/lib/CodeGen/ShadowStackCollector.cpp
+++ /dev/null
@@ -1,438 +0,0 @@
-//===-- ShadowStackCollector.cpp - GC support for uncooperative targets ---===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements lowering for the llvm.gc* intrinsics for targets that do
-// not natively support them (which includes the C backend). Note that the code
-// generated is not quite as efficient as collectors which generate stack maps
-// to identify roots.
-//
-// This pass implements the code transformation described in this paper:
-// "Accurate Garbage Collection in an Uncooperative Environment"
-// Fergus Henderson, ISMM, 2002
-//
-// In runtime/GC/SemiSpace.cpp is a prototype runtime which is compatible with
-// this collector.
-//
-// In order to support this particular transformation, all stack roots are
-// coallocated in the stack. This allows a fully target-independent stack map
-// while introducing only minor runtime overhead.
-//
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "shadowstackgc"
-#include "llvm/CodeGen/Collectors.h"
-#include "llvm/ADT/StringExtras.h"
-#include "llvm/CodeGen/Collector.h"
-#include "llvm/IntrinsicInst.h"
-#include "llvm/Module.h"
-#include "llvm/Support/IRBuilder.h"
-
-using namespace llvm;
-
-namespace {
-
- class VISIBILITY_HIDDEN ShadowStackCollector : public Collector {
- /// RootChain - This is the global linked-list that contains the chain of GC
- /// roots.
- GlobalVariable *Head;
-
- /// StackEntryTy - Abstract type of a link in the shadow stack.
- ///
- const StructType *StackEntryTy;
-
- /// Roots - GC roots in the current function. Each is a pair of the
- /// intrinsic call and its corresponding alloca.
- std::vector<std::pair<CallInst*,AllocaInst*> > Roots;
-
- public:
- ShadowStackCollector();
-
- bool initializeCustomLowering(Module &M);
- bool performCustomLowering(Function &F);
-
- private:
- bool IsNullValue(Value *V);
- Constant *GetFrameMap(Function &F);
- const Type* GetConcreteStackEntryType(Function &F);
- void CollectRoots(Function &F);
- static GetElementPtrInst *CreateGEP(IRBuilder &B, Value *BasePtr,
- int Idx1, const char *Name);
- static GetElementPtrInst *CreateGEP(IRBuilder &B, Value *BasePtr,
- int Idx1, int Idx2, const char *Name);
- };
-
- CollectorRegistry::Add<ShadowStackCollector>
- Y("shadow-stack",
- "Very portable collector for uncooperative code generators");
-
- /// EscapeEnumerator - This is a little algorithm to find all escape points
- /// from a function so that "finally"-style code can be inserted. In addition
- /// to finding the existing return and unwind instructions, it also (if
- /// necessary) transforms any call instructions into invokes and sends them to
- /// a landing pad.
- ///
- /// It's wrapped up in a state machine using the same transform C# uses for
- /// 'yield return' enumerators, This transform allows it to be non-allocating.
- class VISIBILITY_HIDDEN EscapeEnumerator {
- Function &F;
- const char *CleanupBBName;
-
- // State.
- int State;
- Function::iterator StateBB, StateE;
- IRBuilder Builder;
-
- public:
- EscapeEnumerator(Function &F, const char *N = "cleanup")
- : F(F), CleanupBBName(N), State(0) {}
-
- IRBuilder *Next() {
- switch (State) {
- default:
- return 0;
-
- case 0:
- StateBB = F.begin();
- StateE = F.end();
- State = 1;
-
- case 1:
- // Find all 'return' and 'unwind' instructions.
- while (StateBB != StateE) {
- BasicBlock *CurBB = StateBB++;
-
- // Branches and invokes do not escape, only unwind and return do.
- TerminatorInst *TI = CurBB->getTerminator();
- if (!isa<UnwindInst>(TI) && !isa<ReturnInst>(TI))
- continue;
-
- Builder.SetInsertPoint(TI->getParent(), TI);
- return &Builder;
- }
-
- State = 2;
-
- // Find all 'call' instructions.
- SmallVector<Instruction*,16> Calls;
- for (Function::iterator BB = F.begin(),
- E = F.end(); BB != E; ++BB)
- for (BasicBlock::iterator II = BB->begin(),
- EE = BB->end(); II != EE; ++II)
- if (CallInst *CI = dyn_cast<CallInst>(II))
- if (!CI->getCalledFunction() ||
- !CI->getCalledFunction()->getIntrinsicID())
- Calls.push_back(CI);
-
- if (Calls.empty())
- return 0;
-
- // Create a cleanup block.
- BasicBlock *CleanupBB = BasicBlock::Create(CleanupBBName, &F);
- UnwindInst *UI = new UnwindInst(CleanupBB);
-
- // Transform the 'call' instructions into 'invoke's branching to the
- // cleanup block. Go in reverse order to make prettier BB names.
- SmallVector<Value*,16> Args;
- for (unsigned I = Calls.size(); I != 0; ) {
- CallInst *CI = cast<CallInst>(Calls[--I]);
-
- // Split the basic block containing the function call.
- BasicBlock *CallBB = CI->getParent();
- BasicBlock *NewBB =
- CallBB->splitBasicBlock(CI, CallBB->getName() + ".cont");
-
- // Remove the unconditional branch inserted at the end of CallBB.
- CallBB->getInstList().pop_back();
- NewBB->getInstList().remove(CI);
-
- // Create a new invoke instruction.
- Args.clear();
- Args.append(CI->op_begin() + 1, CI->op_end());
-
- InvokeInst *II = InvokeInst::Create(CI->getOperand(0),
- NewBB, CleanupBB,
- Args.begin(), Args.end(),
- CI->getName(), CallBB);
- II->setCallingConv(CI->getCallingConv());
- II->setParamAttrs(CI->getParamAttrs());
- CI->replaceAllUsesWith(II);
- delete CI;
- }
-
- Builder.SetInsertPoint(UI->getParent(), UI);
- return &Builder;
- }
- }
- };
-
-}
-
-// -----------------------------------------------------------------------------
-
-Collector *llvm::createShadowStackCollector() {
- return new ShadowStackCollector();
-}
-
-ShadowStackCollector::ShadowStackCollector() : Head(0), StackEntryTy(0) {
- InitRoots = true;
- CustomRoots = true;
-}
-
-Constant *ShadowStackCollector::GetFrameMap(Function &F) {
- // doInitialization creates the abstract type of this value.
-
- Type *VoidPtr = PointerType::getUnqual(Type::Int8Ty);
-
- // Truncate the ShadowStackDescriptor if some metadata is null.
- unsigned NumMeta = 0;
- SmallVector<Constant*,16> Metadata;
- for (unsigned I = 0; I != Roots.size(); ++I) {
- Constant *C = cast<Constant>(Roots[I].first->getOperand(2));
- if (!C->isNullValue())
- NumMeta = I + 1;
- Metadata.push_back(ConstantExpr::getBitCast(C, VoidPtr));
- }
-
- Constant *BaseElts[] = {
- ConstantInt::get(Type::Int32Ty, Roots.size(), false),
- ConstantInt::get(Type::Int32Ty, NumMeta, false),
- };
-
- Constant *DescriptorElts[] = {
- ConstantStruct::get(BaseElts, 2),
- ConstantArray::get(ArrayType::get(VoidPtr, NumMeta),
- Metadata.begin(), NumMeta)
- };
-
- Constant *FrameMap = ConstantStruct::get(DescriptorElts, 2);
-
- std::string TypeName("gc_map.");
- TypeName += utostr(NumMeta);
- F.getParent()->addTypeName(TypeName, FrameMap->getType());
-
- // FIXME: Is this actually dangerous as WritingAnLLVMPass.html claims? Seems
- // that, short of multithreaded LLVM, it should be safe; all that is
- // necessary is that a simple Module::iterator loop not be invalidated.
- // Appending to the GlobalVariable list is safe in that sense.
- //
- // All of the output passes emit globals last. The ExecutionEngine
- // explicitly supports adding globals to the module after
- // initialization.
- //
- // Still, if it isn't deemed acceptable, then this transformation needs
- // to be a ModulePass (which means it cannot be in the 'llc' pipeline
- // (which uses a FunctionPassManager (which segfaults (not asserts) if
- // provided a ModulePass))).
- Constant *GV = new GlobalVariable(FrameMap->getType(), true,
- GlobalVariable::InternalLinkage,
- FrameMap, "__gc_" + F.getName(),
- F.getParent());
-
- Constant *GEPIndices[2] = { ConstantInt::get(Type::Int32Ty, 0),
- ConstantInt::get(Type::Int32Ty, 0) };
- return ConstantExpr::getGetElementPtr(GV, GEPIndices, 2);
-}
-
-const Type* ShadowStackCollector::GetConcreteStackEntryType(Function &F) {
- // doInitialization creates the generic version of this type.
- std::vector<const Type*> EltTys;
- EltTys.push_back(StackEntryTy);
- for (size_t I = 0; I != Roots.size(); I++)
- EltTys.push_back(Roots[I].second->getAllocatedType());
- Type *Ty = StructType::get(EltTys);
-
- std::string TypeName("gc_stackentry.");
- TypeName += F.getName();
- F.getParent()->addTypeName(TypeName, Ty);
-
- return Ty;
-}
-
-/// doInitialization - If this module uses the GC intrinsics, find them now. If
-/// not, exit fast.
-bool ShadowStackCollector::initializeCustomLowering(Module &M) {
- // struct FrameMap {
- // int32_t NumRoots; // Number of roots in stack frame.
- // int32_t NumMeta; // Number of metadata descriptors. May be < NumRoots.
- // void *Meta[]; // May be absent for roots without metadata.
- // };
- std::vector<const Type*> EltTys;
- EltTys.push_back(Type::Int32Ty); // 32 bits is ok up to a 32GB stack frame. :)
- EltTys.push_back(Type::Int32Ty); // Specifies length of variable length array.
- StructType *FrameMapTy = StructType::get(EltTys);
- M.addTypeName("gc_map", FrameMapTy);
- PointerType *FrameMapPtrTy = PointerType::getUnqual(FrameMapTy);
-
- // struct StackEntry {
- // ShadowStackEntry *Next; // Caller's stack entry.
- // FrameMap *Map; // Pointer to constant FrameMap.
- // void *Roots[]; // Stack roots (in-place array, so we pretend).
- // };
- OpaqueType *RecursiveTy = OpaqueType::get();
-
- EltTys.clear();
- EltTys.push_back(PointerType::getUnqual(RecursiveTy));
- EltTys.push_back(FrameMapPtrTy);
- PATypeHolder LinkTyH = StructType::get(EltTys);
-
- RecursiveTy->refineAbstractTypeTo(LinkTyH.get());
- StackEntryTy = cast<StructType>(LinkTyH.get());
- const PointerType *StackEntryPtrTy = PointerType::getUnqual(StackEntryTy);
- M.addTypeName("gc_stackentry", LinkTyH.get()); // FIXME: Is this safe from
- // a FunctionPass?
-
- // Get the root chain if it already exists.
- Head = M.getGlobalVariable("llvm_gc_root_chain");
- if (!Head) {
- // If the root chain does not exist, insert a new one with linkonce
- // linkage!
- Head = new GlobalVariable(StackEntryPtrTy, false,
- GlobalValue::LinkOnceLinkage,
- Constant::getNullValue(StackEntryPtrTy),
- "llvm_gc_root_chain", &M);
- } else if (Head->hasExternalLinkage() && Head->isDeclaration()) {
- Head->setInitializer(Constant::getNullValue(StackEntryPtrTy));
- Head->setLinkage(GlobalValue::LinkOnceLinkage);
- }
-
- return true;
-}
-
-bool ShadowStackCollector::IsNullValue(Value *V) {
- if (Constant *C = dyn_cast<Constant>(V))
- return C->isNullValue();
- return false;
-}
-
-void ShadowStackCollector::CollectRoots(Function &F) {
- // FIXME: Account for original alignment. Could fragment the root array.
- // Approach 1: Null initialize empty slots at runtime. Yuck.
- // Approach 2: Emit a map of the array instead of just a count.
-
- assert(Roots.empty() && "Not cleaned up?");
-
- SmallVector<std::pair<CallInst*,AllocaInst*>,16> MetaRoots;
-
- for (Function::iterator BB = F.begin(), E = F.end(); BB != E; ++BB)
- for (BasicBlock::iterator II = BB->begin(), E = BB->end(); II != E;)
- if (IntrinsicInst *CI = dyn_cast<IntrinsicInst>(II++))
- if (Function *F = CI->getCalledFunction())
- if (F->getIntrinsicID() == Intrinsic::gcroot) {
- std::pair<CallInst*,AllocaInst*> Pair = std::make_pair(
- CI, cast<AllocaInst>(CI->getOperand(1)->stripPointerCasts()));
- if (IsNullValue(CI->getOperand(2)))
- Roots.push_back(Pair);
- else
- MetaRoots.push_back(Pair);
- }
-
- // Number roots with metadata (usually empty) at the beginning, so that the
- // FrameMap::Meta array can be elided.
- Roots.insert(Roots.begin(), MetaRoots.begin(), MetaRoots.end());
-}
-
-GetElementPtrInst *
-ShadowStackCollector::CreateGEP(IRBuilder &B, Value *BasePtr,
- int Idx, int Idx2, const char *Name) {
- Value *Indices[] = { ConstantInt::get(Type::Int32Ty, 0),
- ConstantInt::get(Type::Int32Ty, Idx),
- ConstantInt::get(Type::Int32Ty, Idx2) };
- Value* Val = B.CreateGEP(BasePtr, Indices, Indices + 3, Name);
-
- assert(isa<GetElementPtrInst>(Val) && "Unexpected folded constant");
-
- return dyn_cast<GetElementPtrInst>(Val);
-}
-
-GetElementPtrInst *
-ShadowStackCollector::CreateGEP(IRBuilder &B, Value *BasePtr,
- int Idx, const char *Name) {
- Value *Indices[] = { ConstantInt::get(Type::Int32Ty, 0),
- ConstantInt::get(Type::Int32Ty, Idx) };
- Value *Val = B.CreateGEP(BasePtr, Indices, Indices + 2, Name);
-
- assert(isa<GetElementPtrInst>(Val) && "Unexpected folded constant");
-
- return dyn_cast<GetElementPtrInst>(Val);
-}
-
-/// runOnFunction - Insert code to maintain the shadow stack.
-bool ShadowStackCollector::performCustomLowering(Function &F) {
- // Find calls to llvm.gcroot.
- CollectRoots(F);
-
- // If there are no roots in this function, then there is no need to add a
- // stack map entry for it.
- if (Roots.empty())
- return false;
-
- // Build the constant map and figure the type of the shadow stack entry.
- Value *FrameMap = GetFrameMap(F);
- const Type *ConcreteStackEntryTy = GetConcreteStackEntryType(F);
-
- // Build the shadow stack entry at the very start of the function.
- BasicBlock::iterator IP = F.getEntryBlock().begin();
- IRBuilder AtEntry(IP->getParent(), IP);
-
- Instruction *StackEntry = AtEntry.CreateAlloca(ConcreteStackEntryTy, 0,
- "gc_frame");
-
- while (isa<AllocaInst>(IP)) ++IP;
- AtEntry.SetInsertPoint(IP->getParent(), IP);
-
- // Initialize the map pointer and load the current head of the shadow stack.
- Instruction *CurrentHead = AtEntry.CreateLoad(Head, "gc_currhead");
- Instruction *EntryMapPtr = CreateGEP(AtEntry, StackEntry,0,1,"gc_frame.map");
- AtEntry.CreateStore(FrameMap, EntryMapPtr);
-
- // After all the allocas...
- for (unsigned I = 0, E = Roots.size(); I != E; ++I) {
- // For each root, find the corresponding slot in the aggregate...
- Value *SlotPtr = CreateGEP(AtEntry, StackEntry, 1 + I, "gc_root");
-
- // And use it in lieu of the alloca.
- AllocaInst *OriginalAlloca = Roots[I].second;
- SlotPtr->takeName(OriginalAlloca);
- OriginalAlloca->replaceAllUsesWith(SlotPtr);
- }
-
- // Move past the original stores inserted by Collector::InitRoots. This isn't
- // really necessary (the collector would never see the intermediate state),
- // but it's nicer not to push the half-initialized entry onto the stack.
- while (isa<StoreInst>(IP)) ++IP;
- AtEntry.SetInsertPoint(IP->getParent(), IP);
-
- // Push the entry onto the shadow stack.
- Instruction *EntryNextPtr = CreateGEP(AtEntry,StackEntry,0,0,"gc_frame.next");
- Instruction *NewHeadVal = CreateGEP(AtEntry,StackEntry, 0, "gc_newhead");
- AtEntry.CreateStore(CurrentHead, EntryNextPtr);
- AtEntry.CreateStore(NewHeadVal, Head);
-
- // For each instruction that escapes...
- EscapeEnumerator EE(F, "gc_cleanup");
- while (IRBuilder *AtExit = EE.Next()) {
- // Pop the entry from the shadow stack. Don't reuse CurrentHead from
- // AtEntry, since that would make the value live for the entire function.
- Instruction *EntryNextPtr2 = CreateGEP(*AtExit, StackEntry, 0, 0,
- "gc_frame.next");
- Value *SavedHead = AtExit->CreateLoad(EntryNextPtr2, "gc_savedhead");
- AtExit->CreateStore(SavedHead, Head);
- }
-
- // Delete the original allocas (which are no longer used) and the intrinsic
- // calls (which are no longer valid). Doing this last avoids invalidating
- // iterators.
- for (unsigned I = 0, E = Roots.size(); I != E; ++I) {
- Roots[I].first->eraseFromParent();
- Roots[I].second->eraseFromParent();
- }
-
- Roots.clear();
- return true;
-}
diff --git a/release_23/lib/CodeGen/SimpleRegisterCoalescing.cpp b/release_23/lib/CodeGen/SimpleRegisterCoalescing.cpp
deleted file mode 100644
index 6a110f0b87d5..000000000000
--- a/release_23/lib/CodeGen/SimpleRegisterCoalescing.cpp
+++ /dev/null
@@ -1,2125 +0,0 @@
-//===-- SimpleRegisterCoalescing.cpp - Register Coalescing ----------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements a simple register coalescing pass that attempts to
-// aggressively coalesce every register copy that it can.
-//
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "regcoalescing"
-#include "SimpleRegisterCoalescing.h"
-#include "VirtRegMap.h"
-#include "llvm/CodeGen/LiveIntervalAnalysis.h"
-#include "llvm/Value.h"
-#include "llvm/CodeGen/LiveVariables.h"
-#include "llvm/CodeGen/MachineFrameInfo.h"
-#include "llvm/CodeGen/MachineInstr.h"
-#include "llvm/CodeGen/MachineLoopInfo.h"
-#include "llvm/CodeGen/MachineRegisterInfo.h"
-#include "llvm/CodeGen/Passes.h"
-#include "llvm/CodeGen/RegisterCoalescer.h"
-#include "llvm/Target/TargetInstrInfo.h"
-#include "llvm/Target/TargetMachine.h"
-#include "llvm/Support/CommandLine.h"
-#include "llvm/Support/Debug.h"
-#include "llvm/ADT/SmallSet.h"
-#include "llvm/ADT/Statistic.h"
-#include "llvm/ADT/STLExtras.h"
-#include <algorithm>
-#include <cmath>
-using namespace llvm;
-
-STATISTIC(numJoins , "Number of interval joins performed");
-STATISTIC(numCommutes , "Number of instruction commuting performed");
-STATISTIC(numExtends , "Number of copies extended");
-STATISTIC(numPeep , "Number of identity moves eliminated after coalescing");
-STATISTIC(numAborts , "Number of times interval joining aborted");
-
-char SimpleRegisterCoalescing::ID = 0;
-namespace {
- static cl::opt<bool>
- EnableJoining("join-liveintervals",
- cl::desc("Coalesce copies (default=true)"),
- cl::init(true));
-
- static cl::opt<bool>
- NewHeuristic("new-coalescer-heuristic",
- cl::desc("Use new coalescer heuristic"),
- cl::init(false));
-
- RegisterPass<SimpleRegisterCoalescing>
- X("simple-register-coalescing", "Simple Register Coalescing");
-
- // Declare that we implement the RegisterCoalescer interface
- RegisterAnalysisGroup<RegisterCoalescer, true/*The Default*/> V(X);
-}
-
-const PassInfo *llvm::SimpleRegisterCoalescingID = X.getPassInfo();
-
-void SimpleRegisterCoalescing::getAnalysisUsage(AnalysisUsage &AU) const {
- AU.addPreserved<LiveIntervals>();
- AU.addPreserved<MachineLoopInfo>();
- AU.addPreservedID(MachineDominatorsID);
- AU.addPreservedID(PHIEliminationID);
- AU.addPreservedID(TwoAddressInstructionPassID);
- AU.addRequired<LiveVariables>();
- AU.addRequired<LiveIntervals>();
- AU.addRequired<MachineLoopInfo>();
- MachineFunctionPass::getAnalysisUsage(AU);
-}
-
-/// AdjustCopiesBackFrom - We found a non-trivially-coalescable copy with IntA
-/// being the source and IntB being the dest, thus this defines a value number
-/// in IntB. If the source value number (in IntA) is defined by a copy from B,
-/// see if we can merge these two pieces of B into a single value number,
-/// eliminating a copy. For example:
-///
-/// A3 = B0
-/// ...
-/// B1 = A3 <- this copy
-///
-/// In this case, B0 can be extended to where the B1 copy lives, allowing the B1
-/// value number to be replaced with B0 (which simplifies the B liveinterval).
-///
-/// This returns true if an interval was modified.
-///
-bool SimpleRegisterCoalescing::AdjustCopiesBackFrom(LiveInterval &IntA,
- LiveInterval &IntB,
- MachineInstr *CopyMI) {
- unsigned CopyIdx = li_->getDefIndex(li_->getInstructionIndex(CopyMI));
-
- // BValNo is a value number in B that is defined by a copy from A. 'B3' in
- // the example above.
- LiveInterval::iterator BLR = IntB.FindLiveRangeContaining(CopyIdx);
- if (BLR == IntB.end()) // Should never happen!
- return false;
- VNInfo *BValNo = BLR->valno;
-
- // Get the location that B is defined at. Two options: either this value has
- // an unknown definition point or it is defined at CopyIdx. If unknown, we
- // can't process it.
- if (!BValNo->copy) return false;
- assert(BValNo->def == CopyIdx && "Copy doesn't define the value?");
-
- // AValNo is the value number in A that defines the copy, A3 in the example.
- LiveInterval::iterator ALR = IntA.FindLiveRangeContaining(CopyIdx-1);
- if (ALR == IntA.end()) // Should never happen!
- return false;
- VNInfo *AValNo = ALR->valno;
-
- // If AValNo is defined as a copy from IntB, we can potentially process this.
- // Get the instruction that defines this value number.
- unsigned SrcReg = li_->getVNInfoSourceReg(AValNo);
- if (!SrcReg) return false; // Not defined by a copy.
-
- // If the value number is not defined by a copy instruction, ignore it.
-
- // If the source register comes from an interval other than IntB, we can't
- // handle this.
- if (SrcReg != IntB.reg) return false;
-
- // Get the LiveRange in IntB that this value number starts with.
- LiveInterval::iterator ValLR = IntB.FindLiveRangeContaining(AValNo->def-1);
- if (ValLR == IntB.end()) // Should never happen!
- return false;
-
- // Make sure that the end of the live range is inside the same block as
- // CopyMI.
- MachineInstr *ValLREndInst = li_->getInstructionFromIndex(ValLR->end-1);
- if (!ValLREndInst ||
- ValLREndInst->getParent() != CopyMI->getParent()) return false;
-
- // Okay, we now know that ValLR ends in the same block that the CopyMI
- // live-range starts. If there are no intervening live ranges between them in
- // IntB, we can merge them.
- if (ValLR+1 != BLR) return false;
-
- // If a live interval is a physical register, conservatively check if any
- // of its sub-registers is overlapping the live interval of the virtual
- // register. If so, do not coalesce.
- if (TargetRegisterInfo::isPhysicalRegister(IntB.reg) &&
- *tri_->getSubRegisters(IntB.reg)) {
- for (const unsigned* SR = tri_->getSubRegisters(IntB.reg); *SR; ++SR)
- if (li_->hasInterval(*SR) && IntA.overlaps(li_->getInterval(*SR))) {
- DOUT << "Interfere with sub-register ";
- DEBUG(li_->getInterval(*SR).print(DOUT, tri_));
- return false;
- }
- }
-
- DOUT << "\nExtending: "; IntB.print(DOUT, tri_);
-
- unsigned FillerStart = ValLR->end, FillerEnd = BLR->start;
- // We are about to delete CopyMI, so need to remove it as the 'instruction
- // that defines this value #'. Update the the valnum with the new defining
- // instruction #.
- BValNo->def = FillerStart;
- BValNo->copy = NULL;
-
- // Okay, we can merge them. We need to insert a new liverange:
- // [ValLR.end, BLR.begin) of either value number, then we merge the
- // two value numbers.
- IntB.addRange(LiveRange(FillerStart, FillerEnd, BValNo));
-
- // If the IntB live range is assigned to a physical register, and if that
- // physreg has aliases,
- if (TargetRegisterInfo::isPhysicalRegister(IntB.reg)) {
- // Update the liveintervals of sub-registers.
- for (const unsigned *AS = tri_->getSubRegisters(IntB.reg); *AS; ++AS) {
- LiveInterval &AliasLI = li_->getInterval(*AS);
- AliasLI.addRange(LiveRange(FillerStart, FillerEnd,
- AliasLI.getNextValue(FillerStart, 0, li_->getVNInfoAllocator())));
- }
- }
-
- // Okay, merge "B1" into the same value number as "B0".
- if (BValNo != ValLR->valno)
- IntB.MergeValueNumberInto(BValNo, ValLR->valno);
- DOUT << " result = "; IntB.print(DOUT, tri_);
- DOUT << "\n";
-
- // If the source instruction was killing the source register before the
- // merge, unset the isKill marker given the live range has been extended.
- int UIdx = ValLREndInst->findRegisterUseOperandIdx(IntB.reg, true);
- if (UIdx != -1)
- ValLREndInst->getOperand(UIdx).setIsKill(false);
-
- ++numExtends;
- return true;
-}
-
-/// HasOtherReachingDefs - Return true if there are definitions of IntB
-/// other than BValNo val# that can reach uses of AValno val# of IntA.
-bool SimpleRegisterCoalescing::HasOtherReachingDefs(LiveInterval &IntA,
- LiveInterval &IntB,
- VNInfo *AValNo,
- VNInfo *BValNo) {
- for (LiveInterval::iterator AI = IntA.begin(), AE = IntA.end();
- AI != AE; ++AI) {
- if (AI->valno != AValNo) continue;
- LiveInterval::Ranges::iterator BI =
- std::upper_bound(IntB.ranges.begin(), IntB.ranges.end(), AI->start);
- if (BI != IntB.ranges.begin())
- --BI;
- for (; BI != IntB.ranges.end() && AI->end >= BI->start; ++BI) {
- if (BI->valno == BValNo)
- continue;
- if (BI->start <= AI->start && BI->end > AI->start)
- return true;
- if (BI->start > AI->start && BI->start < AI->end)
- return true;
- }
- }
- return false;
-}
-
-/// RemoveCopyByCommutingDef - We found a non-trivially-coalescable copy with IntA
-/// being the source and IntB being the dest, thus this defines a value number
-/// in IntB. If the source value number (in IntA) is defined by a commutable
-/// instruction and its other operand is coalesced to the copy dest register,
-/// see if we can transform the copy into a noop by commuting the definition. For
-/// example,
-///
-/// A3 = op A2 B0<kill>
-/// ...
-/// B1 = A3 <- this copy
-/// ...
-/// = op A3 <- more uses
-///
-/// ==>
-///
-/// B2 = op B0 A2<kill>
-/// ...
-/// B1 = B2 <- now an identify copy
-/// ...
-/// = op B2 <- more uses
-///
-/// This returns true if an interval was modified.
-///
-bool SimpleRegisterCoalescing::RemoveCopyByCommutingDef(LiveInterval &IntA,
- LiveInterval &IntB,
- MachineInstr *CopyMI) {
- unsigned CopyIdx = li_->getDefIndex(li_->getInstructionIndex(CopyMI));
-
- // FIXME: For now, only eliminate the copy by commuting its def when the
- // source register is a virtual register. We want to guard against cases
- // where the copy is a back edge copy and commuting the def lengthen the
- // live interval of the source register to the entire loop.
- if (TargetRegisterInfo::isPhysicalRegister(IntA.reg))
- return false;
-
- // BValNo is a value number in B that is defined by a copy from A. 'B3' in
- // the example above.
- LiveInterval::iterator BLR = IntB.FindLiveRangeContaining(CopyIdx);
- if (BLR == IntB.end()) // Should never happen!
- return false;
- VNInfo *BValNo = BLR->valno;
-
- // Get the location that B is defined at. Two options: either this value has
- // an unknown definition point or it is defined at CopyIdx. If unknown, we
- // can't process it.
- if (!BValNo->copy) return false;
- assert(BValNo->def == CopyIdx && "Copy doesn't define the value?");
-
- // AValNo is the value number in A that defines the copy, A3 in the example.
- LiveInterval::iterator ALR = IntA.FindLiveRangeContaining(CopyIdx-1);
- if (ALR == IntA.end()) // Should never happen!
- return false;
- VNInfo *AValNo = ALR->valno;
- // If other defs can reach uses of this def, then it's not safe to perform
- // the optimization.
- if (AValNo->def == ~0U || AValNo->def == ~1U || AValNo->hasPHIKill)
- return false;
- MachineInstr *DefMI = li_->getInstructionFromIndex(AValNo->def);
- const TargetInstrDesc &TID = DefMI->getDesc();
- unsigned NewDstIdx;
- if (!TID.isCommutable() ||
- !tii_->CommuteChangesDestination(DefMI, NewDstIdx))
- return false;
-
- MachineOperand &NewDstMO = DefMI->getOperand(NewDstIdx);
- unsigned NewReg = NewDstMO.getReg();
- if (NewReg != IntB.reg || !NewDstMO.isKill())
- return false;
-
- // Make sure there are no other definitions of IntB that would reach the
- // uses which the new definition can reach.
- if (HasOtherReachingDefs(IntA, IntB, AValNo, BValNo))
- return false;
-
- // If some of the uses of IntA.reg is already coalesced away, return false.
- // It's not possible to determine whether it's safe to perform the coalescing.
- for (MachineRegisterInfo::use_iterator UI = mri_->use_begin(IntA.reg),
- UE = mri_->use_end(); UI != UE; ++UI) {
- MachineInstr *UseMI = &*UI;
- unsigned UseIdx = li_->getInstructionIndex(UseMI);
- LiveInterval::iterator ULR = IntA.FindLiveRangeContaining(UseIdx);
- if (ULR == IntA.end())
- continue;
- if (ULR->valno == AValNo && JoinedCopies.count(UseMI))
- return false;
- }
-
- // At this point we have decided that it is legal to do this
- // transformation. Start by commuting the instruction.
- MachineBasicBlock *MBB = DefMI->getParent();
- MachineInstr *NewMI = tii_->commuteInstruction(DefMI);
- if (!NewMI)
- return false;
- if (NewMI != DefMI) {
- li_->ReplaceMachineInstrInMaps(DefMI, NewMI);
- MBB->insert(DefMI, NewMI);
- MBB->erase(DefMI);
- }
- unsigned OpIdx = NewMI->findRegisterUseOperandIdx(IntA.reg, false);
- NewMI->getOperand(OpIdx).setIsKill();
-
- bool BHasPHIKill = BValNo->hasPHIKill;
- SmallVector<VNInfo*, 4> BDeadValNos;
- SmallVector<unsigned, 4> BKills;
- std::map<unsigned, unsigned> BExtend;
-
- // If ALR and BLR overlaps and end of BLR extends beyond end of ALR, e.g.
- // A = or A, B
- // ...
- // B = A
- // ...
- // C = A<kill>
- // ...
- // = B
- //
- // then do not add kills of A to the newly created B interval.
- bool Extended = BLR->end > ALR->end && ALR->end != ALR->start;
- if (Extended)
- BExtend[ALR->end] = BLR->end;
-
- // Update uses of IntA of the specific Val# with IntB.
- for (MachineRegisterInfo::use_iterator UI = mri_->use_begin(IntA.reg),
- UE = mri_->use_end(); UI != UE;) {
- MachineOperand &UseMO = UI.getOperand();
- MachineInstr *UseMI = &*UI;
- ++UI;
- if (JoinedCopies.count(UseMI))
- continue;
- unsigned UseIdx = li_->getInstructionIndex(UseMI);
- LiveInterval::iterator ULR = IntA.FindLiveRangeContaining(UseIdx);
- if (ULR == IntA.end() || ULR->valno != AValNo)
- continue;
- UseMO.setReg(NewReg);
- if (UseMI == CopyMI)
- continue;
- if (UseMO.isKill()) {
- if (Extended)
- UseMO.setIsKill(false);
- else
- BKills.push_back(li_->getUseIndex(UseIdx)+1);
- }
- unsigned SrcReg, DstReg;
- if (!tii_->isMoveInstr(*UseMI, SrcReg, DstReg))
- continue;
- if (DstReg == IntB.reg) {
- // This copy will become a noop. If it's defining a new val#,
- // remove that val# as well. However this live range is being
- // extended to the end of the existing live range defined by the copy.
- unsigned DefIdx = li_->getDefIndex(UseIdx);
- const LiveRange *DLR = IntB.getLiveRangeContaining(DefIdx);
- BHasPHIKill |= DLR->valno->hasPHIKill;
- assert(DLR->valno->def == DefIdx);
- BDeadValNos.push_back(DLR->valno);
- BExtend[DLR->start] = DLR->end;
- JoinedCopies.insert(UseMI);
- // If this is a kill but it's going to be removed, the last use
- // of the same val# is the new kill.
- if (UseMO.isKill())
- BKills.pop_back();
- }
- }
-
- // We need to insert a new liverange: [ALR.start, LastUse). It may be we can
- // simply extend BLR if CopyMI doesn't end the range.
- DOUT << "\nExtending: "; IntB.print(DOUT, tri_);
-
- IntB.removeValNo(BValNo);
- for (unsigned i = 0, e = BDeadValNos.size(); i != e; ++i)
- IntB.removeValNo(BDeadValNos[i]);
- VNInfo *ValNo = IntB.getNextValue(AValNo->def, 0, li_->getVNInfoAllocator());
- for (LiveInterval::iterator AI = IntA.begin(), AE = IntA.end();
- AI != AE; ++AI) {
- if (AI->valno != AValNo) continue;
- unsigned End = AI->end;
- std::map<unsigned, unsigned>::iterator EI = BExtend.find(End);
- if (EI != BExtend.end())
- End = EI->second;
- IntB.addRange(LiveRange(AI->start, End, ValNo));
- }
- IntB.addKills(ValNo, BKills);
- ValNo->hasPHIKill = BHasPHIKill;
-
- DOUT << " result = "; IntB.print(DOUT, tri_);
- DOUT << "\n";
-
- DOUT << "\nShortening: "; IntA.print(DOUT, tri_);
- IntA.removeValNo(AValNo);
- DOUT << " result = "; IntA.print(DOUT, tri_);
- DOUT << "\n";
-
- ++numCommutes;
- return true;
-}
-
-/// isBackEdgeCopy - Returns true if CopyMI is a back edge copy.
-///
-bool SimpleRegisterCoalescing::isBackEdgeCopy(MachineInstr *CopyMI,
- unsigned DstReg) const {
- MachineBasicBlock *MBB = CopyMI->getParent();
- const MachineLoop *L = loopInfo->getLoopFor(MBB);
- if (!L)
- return false;
- if (MBB != L->getLoopLatch())
- return false;
-
- LiveInterval &LI = li_->getInterval(DstReg);
- unsigned DefIdx = li_->getInstructionIndex(CopyMI);
- LiveInterval::const_iterator DstLR =
- LI.FindLiveRangeContaining(li_->getDefIndex(DefIdx));
- if (DstLR == LI.end())
- return false;
- unsigned KillIdx = li_->getInstructionIndex(&MBB->back()) + InstrSlots::NUM;
- if (DstLR->valno->kills.size() == 1 &&
- DstLR->valno->kills[0] == KillIdx && DstLR->valno->hasPHIKill)
- return true;
- return false;
-}
-
-/// UpdateRegDefsUses - Replace all defs and uses of SrcReg to DstReg and
-/// update the subregister number if it is not zero. If DstReg is a
-/// physical register and the existing subregister number of the def / use
-/// being updated is not zero, make sure to set it to the correct physical
-/// subregister.
-void
-SimpleRegisterCoalescing::UpdateRegDefsUses(unsigned SrcReg, unsigned DstReg,
- unsigned SubIdx) {
- bool DstIsPhys = TargetRegisterInfo::isPhysicalRegister(DstReg);
- if (DstIsPhys && SubIdx) {
- // Figure out the real physical register we are updating with.
- DstReg = tri_->getSubReg(DstReg, SubIdx);
- SubIdx = 0;
- }
-
- for (MachineRegisterInfo::reg_iterator I = mri_->reg_begin(SrcReg),
- E = mri_->reg_end(); I != E; ) {
- MachineOperand &O = I.getOperand();
- MachineInstr *UseMI = &*I;
- ++I;
- unsigned OldSubIdx = O.getSubReg();
- if (DstIsPhys) {
- unsigned UseDstReg = DstReg;
- if (OldSubIdx)
- UseDstReg = tri_->getSubReg(DstReg, OldSubIdx);
- O.setReg(UseDstReg);
- O.setSubReg(0);
- } else {
- // Sub-register indexes goes from small to large. e.g.
- // RAX: 1 -> AL, 2 -> AX, 3 -> EAX
- // EAX: 1 -> AL, 2 -> AX
- // So RAX's sub-register 2 is AX, RAX's sub-regsiter 3 is EAX, whose
- // sub-register 2 is also AX.
- if (SubIdx && OldSubIdx && SubIdx != OldSubIdx)
- assert(OldSubIdx < SubIdx && "Conflicting sub-register index!");
- else if (SubIdx)
- O.setSubReg(SubIdx);
- // Remove would-be duplicated kill marker.
- if (O.isKill() && UseMI->killsRegister(DstReg))
- O.setIsKill(false);
- O.setReg(DstReg);
- }
- }
-}
-
-/// RemoveDeadImpDef - Remove implicit_def instructions which are "re-defining"
-/// registers due to insert_subreg coalescing. e.g.
-/// r1024 = op
-/// r1025 = implicit_def
-/// r1025 = insert_subreg r1025, r1024
-/// = op r1025
-/// =>
-/// r1025 = op
-/// r1025 = implicit_def
-/// r1025 = insert_subreg r1025, r1025
-/// = op r1025
-void
-SimpleRegisterCoalescing::RemoveDeadImpDef(unsigned Reg, LiveInterval &LI) {
- for (MachineRegisterInfo::reg_iterator I = mri_->reg_begin(Reg),
- E = mri_->reg_end(); I != E; ) {
- MachineOperand &O = I.getOperand();
- MachineInstr *DefMI = &*I;
- ++I;
- if (!O.isDef())
- continue;
- if (DefMI->getOpcode() != TargetInstrInfo::IMPLICIT_DEF)
- continue;
- if (!LI.liveBeforeAndAt(li_->getInstructionIndex(DefMI)))
- continue;
- li_->RemoveMachineInstrFromMaps(DefMI);
- DefMI->eraseFromParent();
- }
-}
-
-/// RemoveUnnecessaryKills - Remove kill markers that are no longer accurate
-/// due to live range lengthening as the result of coalescing.
-void SimpleRegisterCoalescing::RemoveUnnecessaryKills(unsigned Reg,
- LiveInterval &LI) {
- for (MachineRegisterInfo::use_iterator UI = mri_->use_begin(Reg),
- UE = mri_->use_end(); UI != UE; ++UI) {
- MachineOperand &UseMO = UI.getOperand();
- if (UseMO.isKill()) {
- MachineInstr *UseMI = UseMO.getParent();
- unsigned SReg, DReg;
- if (!tii_->isMoveInstr(*UseMI, SReg, DReg))
- continue;
- unsigned UseIdx = li_->getUseIndex(li_->getInstructionIndex(UseMI));
- if (JoinedCopies.count(UseMI))
- continue;
- const LiveRange *UI = LI.getLiveRangeContaining(UseIdx);
- if (!LI.isKill(UI->valno, UseIdx+1))
- UseMO.setIsKill(false);
- }
- }
-}
-
-/// removeRange - Wrapper for LiveInterval::removeRange. This removes a range
-/// from a physical register live interval as well as from the live intervals
-/// of its sub-registers.
-static void removeRange(LiveInterval &li, unsigned Start, unsigned End,
- LiveIntervals *li_, const TargetRegisterInfo *tri_) {
- li.removeRange(Start, End, true);
- if (TargetRegisterInfo::isPhysicalRegister(li.reg)) {
- for (const unsigned* SR = tri_->getSubRegisters(li.reg); *SR; ++SR) {
- if (!li_->hasInterval(*SR))
- continue;
- LiveInterval &sli = li_->getInterval(*SR);
- unsigned RemoveEnd = Start;
- while (RemoveEnd != End) {
- LiveInterval::iterator LR = sli.FindLiveRangeContaining(Start);
- if (LR == sli.end())
- break;
- RemoveEnd = (LR->end < End) ? LR->end : End;
- sli.removeRange(Start, RemoveEnd, true);
- Start = RemoveEnd;
- }
- }
- }
-}
-
-/// removeIntervalIfEmpty - Check if the live interval of a physical register
-/// is empty, if so remove it and also remove the empty intervals of its
-/// sub-registers. Return true if live interval is removed.
-static bool removeIntervalIfEmpty(LiveInterval &li, LiveIntervals *li_,
- const TargetRegisterInfo *tri_) {
- if (li.empty()) {
- if (TargetRegisterInfo::isPhysicalRegister(li.reg))
- for (const unsigned* SR = tri_->getSubRegisters(li.reg); *SR; ++SR) {
- if (!li_->hasInterval(*SR))
- continue;
- LiveInterval &sli = li_->getInterval(*SR);
- if (sli.empty())
- li_->removeInterval(*SR);
- }
- li_->removeInterval(li.reg);
- return true;
- }
- return false;
-}
-
-/// ShortenDeadCopyLiveRange - Shorten a live range defined by a dead copy.
-/// Return true if live interval is removed.
-bool SimpleRegisterCoalescing::ShortenDeadCopyLiveRange(LiveInterval &li,
- MachineInstr *CopyMI) {
- unsigned CopyIdx = li_->getInstructionIndex(CopyMI);
- LiveInterval::iterator MLR =
- li.FindLiveRangeContaining(li_->getDefIndex(CopyIdx));
- if (MLR == li.end())
- return false; // Already removed by ShortenDeadCopySrcLiveRange.
- unsigned RemoveStart = MLR->start;
- unsigned RemoveEnd = MLR->end;
- // Remove the liverange that's defined by this.
- if (RemoveEnd == li_->getDefIndex(CopyIdx)+1) {
- removeRange(li, RemoveStart, RemoveEnd, li_, tri_);
- return removeIntervalIfEmpty(li, li_, tri_);
- }
- return false;
-}
-
-/// PropagateDeadness - Propagate the dead marker to the instruction which
-/// defines the val#.
-static void PropagateDeadness(LiveInterval &li, MachineInstr *CopyMI,
- unsigned &LRStart, LiveIntervals *li_,
- const TargetRegisterInfo* tri_) {
- MachineInstr *DefMI =
- li_->getInstructionFromIndex(li_->getDefIndex(LRStart));
- if (DefMI && DefMI != CopyMI) {
- int DeadIdx = DefMI->findRegisterDefOperandIdx(li.reg, false, tri_);
- if (DeadIdx != -1) {
- DefMI->getOperand(DeadIdx).setIsDead();
- // A dead def should have a single cycle interval.
- ++LRStart;
- }
- }
-}
-
-/// isSameOrFallThroughBB - Return true if MBB == SuccMBB or MBB simply
-/// fallthoughs to SuccMBB.
-static bool isSameOrFallThroughBB(MachineBasicBlock *MBB,
- MachineBasicBlock *SuccMBB,
- const TargetInstrInfo *tii_) {
- if (MBB == SuccMBB)
- return true;
- MachineBasicBlock *TBB = 0, *FBB = 0;
- std::vector<MachineOperand> Cond;
- return !tii_->AnalyzeBranch(*MBB, TBB, FBB, Cond) && !TBB && !FBB &&
- MBB->isSuccessor(SuccMBB);
-}
-
-/// ShortenDeadCopySrcLiveRange - Shorten a live range as it's artificially
-/// extended by a dead copy. Mark the last use (if any) of the val# as kill as
-/// ends the live range there. If there isn't another use, then this live range
-/// is dead. Return true if live interval is removed.
-bool
-SimpleRegisterCoalescing::ShortenDeadCopySrcLiveRange(LiveInterval &li,
- MachineInstr *CopyMI) {
- unsigned CopyIdx = li_->getInstructionIndex(CopyMI);
- if (CopyIdx == 0) {
- // FIXME: special case: function live in. It can be a general case if the
- // first instruction index starts at > 0 value.
- assert(TargetRegisterInfo::isPhysicalRegister(li.reg));
- // Live-in to the function but dead. Remove it from entry live-in set.
- if (mf_->begin()->isLiveIn(li.reg))
- mf_->begin()->removeLiveIn(li.reg);
- const LiveRange *LR = li.getLiveRangeContaining(CopyIdx);
- removeRange(li, LR->start, LR->end, li_, tri_);
- return removeIntervalIfEmpty(li, li_, tri_);
- }
-
- LiveInterval::iterator LR = li.FindLiveRangeContaining(CopyIdx-1);
- if (LR == li.end())
- // Livein but defined by a phi.
- return false;
-
- unsigned RemoveStart = LR->start;
- unsigned RemoveEnd = li_->getDefIndex(CopyIdx)+1;
- if (LR->end > RemoveEnd)
- // More uses past this copy? Nothing to do.
- return false;
-
- MachineBasicBlock *CopyMBB = CopyMI->getParent();
- unsigned MBBStart = li_->getMBBStartIdx(CopyMBB);
- unsigned LastUseIdx;
- MachineOperand *LastUse = lastRegisterUse(LR->start, CopyIdx-1, li.reg,
- LastUseIdx);
- if (LastUse) {
- MachineInstr *LastUseMI = LastUse->getParent();
- if (!isSameOrFallThroughBB(LastUseMI->getParent(), CopyMBB, tii_)) {
- // r1024 = op
- // ...
- // BB1:
- // = r1024
- //
- // BB2:
- // r1025<dead> = r1024<kill>
- if (MBBStart < LR->end)
- removeRange(li, MBBStart, LR->end, li_, tri_);
- return false;
- }
-
- // There are uses before the copy, just shorten the live range to the end
- // of last use.
- LastUse->setIsKill();
- removeRange(li, li_->getDefIndex(LastUseIdx), LR->end, li_, tri_);
- unsigned SrcReg, DstReg;
- if (tii_->isMoveInstr(*LastUseMI, SrcReg, DstReg) &&
- DstReg == li.reg) {
- // Last use is itself an identity code.
- int DeadIdx = LastUseMI->findRegisterDefOperandIdx(li.reg, false, tri_);
- LastUseMI->getOperand(DeadIdx).setIsDead();
- }
- return false;
- }
-
- // Is it livein?
- if (LR->start <= MBBStart && LR->end > MBBStart) {
- if (LR->start == 0) {
- assert(TargetRegisterInfo::isPhysicalRegister(li.reg));
- // Live-in to the function but dead. Remove it from entry live-in set.
- mf_->begin()->removeLiveIn(li.reg);
- }
- // FIXME: Shorten intervals in BBs that reaches this BB.
- }
-
- if (LR->valno->def == RemoveStart)
- // If the def MI defines the val#, propagate the dead marker.
- PropagateDeadness(li, CopyMI, RemoveStart, li_, tri_);
-
- removeRange(li, RemoveStart, LR->end, li_, tri_);
- return removeIntervalIfEmpty(li, li_, tri_);
-}
-
-/// CanCoalesceWithImpDef - Returns true if the specified copy instruction
-/// from an implicit def to another register can be coalesced away.
-bool SimpleRegisterCoalescing::CanCoalesceWithImpDef(MachineInstr *CopyMI,
- LiveInterval &li,
- LiveInterval &ImpLi) const{
- if (!CopyMI->killsRegister(ImpLi.reg))
- return false;
- unsigned CopyIdx = li_->getDefIndex(li_->getInstructionIndex(CopyMI));
- LiveInterval::iterator LR = li.FindLiveRangeContaining(CopyIdx);
- if (LR == li.end())
- return false;
- if (LR->valno->hasPHIKill)
- return false;
- if (LR->valno->def != CopyIdx)
- return false;
- // Make sure all of val# uses are copies.
- for (MachineRegisterInfo::use_iterator UI = mri_->use_begin(li.reg),
- UE = mri_->use_end(); UI != UE;) {
- MachineInstr *UseMI = &*UI;
- ++UI;
- if (JoinedCopies.count(UseMI))
- continue;
- unsigned UseIdx = li_->getUseIndex(li_->getInstructionIndex(UseMI));
- LiveInterval::iterator ULR = li.FindLiveRangeContaining(UseIdx);
- if (ULR == li.end() || ULR->valno != LR->valno)
- continue;
- // If the use is not a use, then it's not safe to coalesce the move.
- unsigned SrcReg, DstReg;
- if (!tii_->isMoveInstr(*UseMI, SrcReg, DstReg)) {
- if (UseMI->getOpcode() == TargetInstrInfo::INSERT_SUBREG &&
- UseMI->getOperand(1).getReg() == li.reg)
- continue;
- return false;
- }
- }
- return true;
-}
-
-
-/// RemoveCopiesFromValNo - The specified value# is defined by an implicit
-/// def and it is being removed. Turn all copies from this value# into
-/// identity copies so they will be removed.
-void SimpleRegisterCoalescing::RemoveCopiesFromValNo(LiveInterval &li,
- VNInfo *VNI) {
- MachineInstr *ImpDef = NULL;
- MachineOperand *LastUse = NULL;
- unsigned LastUseIdx = li_->getUseIndex(VNI->def);
- for (MachineRegisterInfo::reg_iterator RI = mri_->reg_begin(li.reg),
- RE = mri_->reg_end(); RI != RE;) {
- MachineOperand *MO = &RI.getOperand();
- MachineInstr *MI = &*RI;
- ++RI;
- if (MO->isDef()) {
- if (MI->getOpcode() == TargetInstrInfo::IMPLICIT_DEF) {
- assert(!ImpDef && "Multiple implicit_def defining same register?");
- ImpDef = MI;
- }
- continue;
- }
- if (JoinedCopies.count(MI))
- continue;
- unsigned UseIdx = li_->getUseIndex(li_->getInstructionIndex(MI));
- LiveInterval::iterator ULR = li.FindLiveRangeContaining(UseIdx);
- if (ULR == li.end() || ULR->valno != VNI)
- continue;
- // If the use is a copy, turn it into an identity copy.
- unsigned SrcReg, DstReg;
- if (tii_->isMoveInstr(*MI, SrcReg, DstReg) && SrcReg == li.reg) {
- // Each use MI may have multiple uses of this register. Change them all.
- for (unsigned i = 0, e = MI->getNumOperands(); i != e; ++i) {
- MachineOperand &MO = MI->getOperand(i);
- if (MO.isReg() && MO.getReg() == li.reg)
- MO.setReg(DstReg);
- }
- JoinedCopies.insert(MI);
- } else if (UseIdx > LastUseIdx) {
- LastUseIdx = UseIdx;
- LastUse = MO;
- }
- }
- if (LastUse)
- LastUse->setIsKill();
- else {
- // Remove dead implicit_def.
- li_->RemoveMachineInstrFromMaps(ImpDef);
- ImpDef->eraseFromParent();
- }
-}
-
-static unsigned getMatchingSuperReg(unsigned Reg, unsigned SubIdx,
- const TargetRegisterClass *RC,
- const TargetRegisterInfo* TRI) {
- for (const unsigned *SRs = TRI->getSuperRegisters(Reg);
- unsigned SR = *SRs; ++SRs)
- if (Reg == TRI->getSubReg(SR, SubIdx) && RC->contains(SR))
- return SR;
- return 0;
-}
-
-/// JoinCopy - Attempt to join intervals corresponding to SrcReg/DstReg,
-/// which are the src/dst of the copy instruction CopyMI. This returns true
-/// if the copy was successfully coalesced away. If it is not currently
-/// possible to coalesce this interval, but it may be possible if other
-/// things get coalesced, then it returns true by reference in 'Again'.
-bool SimpleRegisterCoalescing::JoinCopy(CopyRec &TheCopy, bool &Again) {
- MachineInstr *CopyMI = TheCopy.MI;
-
- Again = false;
- if (JoinedCopies.count(CopyMI))
- return false; // Already done.
-
- DOUT << li_->getInstructionIndex(CopyMI) << '\t' << *CopyMI;
-
- unsigned SrcReg;
- unsigned DstReg;
- bool isExtSubReg = CopyMI->getOpcode() == TargetInstrInfo::EXTRACT_SUBREG;
- bool isInsSubReg = CopyMI->getOpcode() == TargetInstrInfo::INSERT_SUBREG;
- unsigned SubIdx = 0;
- if (isExtSubReg) {
- DstReg = CopyMI->getOperand(0).getReg();
- SrcReg = CopyMI->getOperand(1).getReg();
- } else if (isInsSubReg) {
- if (CopyMI->getOperand(2).getSubReg()) {
- DOUT << "\tSource of insert_subreg is already coalesced "
- << "to another register.\n";
- return false; // Not coalescable.
- }
- DstReg = CopyMI->getOperand(0).getReg();
- SrcReg = CopyMI->getOperand(2).getReg();
- } else if (!tii_->isMoveInstr(*CopyMI, SrcReg, DstReg)) {
- assert(0 && "Unrecognized copy instruction!");
- return false;
- }
-
- // If they are already joined we continue.
- if (SrcReg == DstReg) {
- DOUT << "\tCopy already coalesced.\n";
- return false; // Not coalescable.
- }
-
- bool SrcIsPhys = TargetRegisterInfo::isPhysicalRegister(SrcReg);
- bool DstIsPhys = TargetRegisterInfo::isPhysicalRegister(DstReg);
-
- // If they are both physical registers, we cannot join them.
- if (SrcIsPhys && DstIsPhys) {
- DOUT << "\tCan not coalesce physregs.\n";
- return false; // Not coalescable.
- }
-
- // We only join virtual registers with allocatable physical registers.
- if (SrcIsPhys && !allocatableRegs_[SrcReg]) {
- DOUT << "\tSrc reg is unallocatable physreg.\n";
- return false; // Not coalescable.
- }
- if (DstIsPhys && !allocatableRegs_[DstReg]) {
- DOUT << "\tDst reg is unallocatable physreg.\n";
- return false; // Not coalescable.
- }
-
- unsigned RealDstReg = 0;
- unsigned RealSrcReg = 0;
- if (isExtSubReg || isInsSubReg) {
- SubIdx = CopyMI->getOperand(isExtSubReg ? 2 : 3).getImm();
- if (SrcIsPhys && isExtSubReg) {
- // r1024 = EXTRACT_SUBREG EAX, 0 then r1024 is really going to be
- // coalesced with AX.
- unsigned DstSubIdx = CopyMI->getOperand(0).getSubReg();
- if (DstSubIdx) {
- // r1024<2> = EXTRACT_SUBREG EAX, 2. Then r1024 has already been
- // coalesced to a larger register so the subreg indices cancel out.
- if (DstSubIdx != SubIdx) {
- DOUT << "\t Sub-register indices mismatch.\n";
- return false; // Not coalescable.
- }
- } else
- SrcReg = tri_->getSubReg(SrcReg, SubIdx);
- SubIdx = 0;
- } else if (DstIsPhys && isInsSubReg) {
- // EAX = INSERT_SUBREG EAX, r1024, 0
- unsigned SrcSubIdx = CopyMI->getOperand(2).getSubReg();
- if (SrcSubIdx) {
- // EAX = INSERT_SUBREG EAX, r1024<2>, 2 Then r1024 has already been
- // coalesced to a larger register so the subreg indices cancel out.
- if (SrcSubIdx != SubIdx) {
- DOUT << "\t Sub-register indices mismatch.\n";
- return false; // Not coalescable.
- }
- } else
- DstReg = tri_->getSubReg(DstReg, SubIdx);
- SubIdx = 0;
- } else if ((DstIsPhys && isExtSubReg) || (SrcIsPhys && isInsSubReg)) {
- // If this is a extract_subreg where dst is a physical register, e.g.
- // cl = EXTRACT_SUBREG reg1024, 1
- // then create and update the actual physical register allocated to RHS.
- // Ditto for
- // reg1024 = INSERT_SUBREG r1024, cl, 1
- if (CopyMI->getOperand(1).getSubReg()) {
- DOUT << "\tSrc of extract_ / insert_subreg already coalesced with reg"
- << " of a super-class.\n";
- return false; // Not coalescable.
- }
- const TargetRegisterClass *RC =
- mri_->getRegClass(isExtSubReg ? SrcReg : DstReg);
- if (isExtSubReg) {
- RealDstReg = getMatchingSuperReg(DstReg, SubIdx, RC, tri_);
- assert(RealDstReg && "Invalid extra_subreg instruction!");
- } else {
- RealSrcReg = getMatchingSuperReg(SrcReg, SubIdx, RC, tri_);
- assert(RealSrcReg && "Invalid extra_subreg instruction!");
- }
-
- // For this type of EXTRACT_SUBREG, conservatively
- // check if the live interval of the source register interfere with the
- // actual super physical register we are trying to coalesce with.
- unsigned PhysReg = isExtSubReg ? RealDstReg : RealSrcReg;
- LiveInterval &RHS = li_->getInterval(isExtSubReg ? SrcReg : DstReg);
- if (li_->hasInterval(PhysReg) &&
- RHS.overlaps(li_->getInterval(PhysReg))) {
- DOUT << "Interfere with register ";
- DEBUG(li_->getInterval(PhysReg).print(DOUT, tri_));
- return false; // Not coalescable
- }
- for (const unsigned* SR = tri_->getSubRegisters(PhysReg); *SR; ++SR)
- if (li_->hasInterval(*SR) && RHS.overlaps(li_->getInterval(*SR))) {
- DOUT << "Interfere with sub-register ";
- DEBUG(li_->getInterval(*SR).print(DOUT, tri_));
- return false; // Not coalescable
- }
- SubIdx = 0;
- } else {
- unsigned OldSubIdx = isExtSubReg ? CopyMI->getOperand(0).getSubReg()
- : CopyMI->getOperand(2).getSubReg();
- if (OldSubIdx) {
- if (OldSubIdx == SubIdx && !differingRegisterClasses(SrcReg, DstReg))
- // r1024<2> = EXTRACT_SUBREG r1025, 2. Then r1024 has already been
- // coalesced to a larger register so the subreg indices cancel out.
- // Also check if the other larger register is of the same register
- // class as the would be resulting register.
- SubIdx = 0;
- else {
- DOUT << "\t Sub-register indices mismatch.\n";
- return false; // Not coalescable.
- }
- }
- if (SubIdx) {
- unsigned LargeReg = isExtSubReg ? SrcReg : DstReg;
- unsigned SmallReg = isExtSubReg ? DstReg : SrcReg;
- unsigned LargeRegSize =
- li_->getInterval(LargeReg).getSize() / InstrSlots::NUM;
- unsigned SmallRegSize =
- li_->getInterval(SmallReg).getSize() / InstrSlots::NUM;
- const TargetRegisterClass *RC = mri_->getRegClass(SmallReg);
- unsigned Threshold = allocatableRCRegs_[RC].count();
- // Be conservative. If both sides are virtual registers, do not coalesce
- // if this will cause a high use density interval to target a smaller
- // set of registers.
- if (SmallRegSize > Threshold || LargeRegSize > Threshold) {
- LiveVariables::VarInfo &svi = lv_->getVarInfo(LargeReg);
- LiveVariables::VarInfo &dvi = lv_->getVarInfo(SmallReg);
- if ((float)dvi.NumUses / SmallRegSize <
- (float)svi.NumUses / LargeRegSize) {
- Again = true; // May be possible to coalesce later.
- return false;
- }
- }
- }
- }
- } else if (differingRegisterClasses(SrcReg, DstReg)) {
- // FIXME: What if the resul of a EXTRACT_SUBREG is then coalesced
- // with another? If it's the resulting destination register, then
- // the subidx must be propagated to uses (but only those defined
- // by the EXTRACT_SUBREG). If it's being coalesced into another
- // register, it should be safe because register is assumed to have
- // the register class of the super-register.
-
- // If they are not of the same register class, we cannot join them.
- DOUT << "\tSrc/Dest are different register classes.\n";
- // Allow the coalescer to try again in case either side gets coalesced to
- // a physical register that's compatible with the other side. e.g.
- // r1024 = MOV32to32_ r1025
- // but later r1024 is assigned EAX then r1025 may be coalesced with EAX.
- Again = true; // May be possible to coalesce later.
- return false;
- }
-
- LiveInterval &SrcInt = li_->getInterval(SrcReg);
- LiveInterval &DstInt = li_->getInterval(DstReg);
- assert(SrcInt.reg == SrcReg && DstInt.reg == DstReg &&
- "Register mapping is horribly broken!");
-
- DOUT << "\t\tInspecting "; SrcInt.print(DOUT, tri_);
- DOUT << " and "; DstInt.print(DOUT, tri_);
- DOUT << ": ";
-
- // Check if it is necessary to propagate "isDead" property.
- if (!isExtSubReg && !isInsSubReg) {
- MachineOperand *mopd = CopyMI->findRegisterDefOperand(DstReg, false);
- bool isDead = mopd->isDead();
-
- // We need to be careful about coalescing a source physical register with a
- // virtual register. Once the coalescing is done, it cannot be broken and
- // these are not spillable! If the destination interval uses are far away,
- // think twice about coalescing them!
- if (!isDead && (SrcIsPhys || DstIsPhys)) {
- LiveInterval &JoinVInt = SrcIsPhys ? DstInt : SrcInt;
- unsigned JoinVReg = SrcIsPhys ? DstReg : SrcReg;
- unsigned JoinPReg = SrcIsPhys ? SrcReg : DstReg;
- const TargetRegisterClass *RC = mri_->getRegClass(JoinVReg);
- unsigned Threshold = allocatableRCRegs_[RC].count() * 2;
- if (TheCopy.isBackEdge)
- Threshold *= 2; // Favors back edge copies.
-
- // If the virtual register live interval is long but it has low use desity,
- // do not join them, instead mark the physical register as its allocation
- // preference.
- unsigned Length = JoinVInt.getSize() / InstrSlots::NUM;
- LiveVariables::VarInfo &vi = lv_->getVarInfo(JoinVReg);
- if (Length > Threshold &&
- (((float)vi.NumUses / Length) < (1.0 / Threshold))) {
- JoinVInt.preference = JoinPReg;
- ++numAborts;
- DOUT << "\tMay tie down a physical register, abort!\n";
- Again = true; // May be possible to coalesce later.
- return false;
- }
- }
- }
-
- // Okay, attempt to join these two intervals. On failure, this returns false.
- // Otherwise, if one of the intervals being joined is a physreg, this method
- // always canonicalizes DstInt to be it. The output "SrcInt" will not have
- // been modified, so we can use this information below to update aliases.
- bool Swapped = false;
- // If SrcInt is implicitly defined, it's safe to coalesce.
- bool isEmpty = SrcInt.empty();
- if (isEmpty && !CanCoalesceWithImpDef(CopyMI, DstInt, SrcInt)) {
- // Only coalesce an empty interval (defined by implicit_def) with
- // another interval which has a valno defined by the CopyMI and the CopyMI
- // is a kill of the implicit def.
- DOUT << "Not profitable!\n";
- return false;
- }
-
- if (!isEmpty && !JoinIntervals(DstInt, SrcInt, Swapped)) {
- // Coalescing failed.
-
- // If we can eliminate the copy without merging the live ranges, do so now.
- if (!isExtSubReg && !isInsSubReg &&
- (AdjustCopiesBackFrom(SrcInt, DstInt, CopyMI) ||
- RemoveCopyByCommutingDef(SrcInt, DstInt, CopyMI))) {
- JoinedCopies.insert(CopyMI);
- return true;
- }
-
- // Otherwise, we are unable to join the intervals.
- DOUT << "Interference!\n";
- Again = true; // May be possible to coalesce later.
- return false;
- }
-
- LiveInterval *ResSrcInt = &SrcInt;
- LiveInterval *ResDstInt = &DstInt;
- if (Swapped) {
- std::swap(SrcReg, DstReg);
- std::swap(ResSrcInt, ResDstInt);
- }
- assert(TargetRegisterInfo::isVirtualRegister(SrcReg) &&
- "LiveInterval::join didn't work right!");
-
- // If we're about to merge live ranges into a physical register live range,
- // we have to update any aliased register's live ranges to indicate that they
- // have clobbered values for this range.
- if (TargetRegisterInfo::isPhysicalRegister(DstReg)) {
- // If this is a extract_subreg where dst is a physical register, e.g.
- // cl = EXTRACT_SUBREG reg1024, 1
- // then create and update the actual physical register allocated to RHS.
- if (RealDstReg || RealSrcReg) {
- LiveInterval &RealInt =
- li_->getOrCreateInterval(RealDstReg ? RealDstReg : RealSrcReg);
- SmallSet<const VNInfo*, 4> CopiedValNos;
- for (LiveInterval::Ranges::const_iterator I = ResSrcInt->ranges.begin(),
- E = ResSrcInt->ranges.end(); I != E; ++I) {
- const LiveRange *DstLR = ResDstInt->getLiveRangeContaining(I->start);
- assert(DstLR && "Invalid joined interval!");
- const VNInfo *DstValNo = DstLR->valno;
- if (CopiedValNos.insert(DstValNo)) {
- VNInfo *ValNo = RealInt.getNextValue(DstValNo->def, DstValNo->copy,
- li_->getVNInfoAllocator());
- ValNo->hasPHIKill = DstValNo->hasPHIKill;
- RealInt.addKills(ValNo, DstValNo->kills);
- RealInt.MergeValueInAsValue(*ResDstInt, DstValNo, ValNo);
- }
- }
-
- DstReg = RealDstReg ? RealDstReg : RealSrcReg;
- }
-
- // Update the liveintervals of sub-registers.
- for (const unsigned *AS = tri_->getSubRegisters(DstReg); *AS; ++AS)
- li_->getOrCreateInterval(*AS).MergeInClobberRanges(*ResSrcInt,
- li_->getVNInfoAllocator());
- } else {
- // Merge use info if the destination is a virtual register.
- LiveVariables::VarInfo& dVI = lv_->getVarInfo(DstReg);
- LiveVariables::VarInfo& sVI = lv_->getVarInfo(SrcReg);
- dVI.NumUses += sVI.NumUses;
- }
-
- // If this is a EXTRACT_SUBREG, make sure the result of coalescing is the
- // larger super-register.
- if ((isExtSubReg || isInsSubReg) && !SrcIsPhys && !DstIsPhys) {
- if ((isExtSubReg && !Swapped) || (isInsSubReg && Swapped)) {
- ResSrcInt->Copy(*ResDstInt, li_->getVNInfoAllocator());
- std::swap(SrcReg, DstReg);
- std::swap(ResSrcInt, ResDstInt);
- }
- }
-
- if (NewHeuristic) {
- // Add all copies that define val# in the source interval into the queue.
- for (LiveInterval::const_vni_iterator i = ResSrcInt->vni_begin(),
- e = ResSrcInt->vni_end(); i != e; ++i) {
- const VNInfo *vni = *i;
- if (!vni->def || vni->def == ~1U || vni->def == ~0U)
- continue;
- MachineInstr *CopyMI = li_->getInstructionFromIndex(vni->def);
- unsigned NewSrcReg, NewDstReg;
- if (CopyMI &&
- JoinedCopies.count(CopyMI) == 0 &&
- tii_->isMoveInstr(*CopyMI, NewSrcReg, NewDstReg)) {
- unsigned LoopDepth = loopInfo->getLoopDepth(CopyMI->getParent());
- JoinQueue->push(CopyRec(CopyMI, LoopDepth,
- isBackEdgeCopy(CopyMI, DstReg)));
- }
- }
- }
-
- // Remember to delete the copy instruction.
- JoinedCopies.insert(CopyMI);
-
- // Some live range has been lengthened due to colaescing, eliminate the
- // unnecessary kills.
- RemoveUnnecessaryKills(SrcReg, *ResDstInt);
- if (TargetRegisterInfo::isVirtualRegister(DstReg))
- RemoveUnnecessaryKills(DstReg, *ResDstInt);
-
- // SrcReg is guarateed to be the register whose live interval that is
- // being merged.
- li_->removeInterval(SrcReg);
- if (isInsSubReg)
- // Avoid:
- // r1024 = op
- // r1024 = implicit_def
- // ...
- // = r1024
- RemoveDeadImpDef(DstReg, *ResDstInt);
- UpdateRegDefsUses(SrcReg, DstReg, SubIdx);
-
- if (isEmpty) {
- // Now the copy is being coalesced away, the val# previously defined
- // by the copy is being defined by an IMPLICIT_DEF which defines a zero
- // length interval. Remove the val#.
- unsigned CopyIdx = li_->getDefIndex(li_->getInstructionIndex(CopyMI));
- const LiveRange *LR = ResDstInt->getLiveRangeContaining(CopyIdx);
- VNInfo *ImpVal = LR->valno;
- assert(ImpVal->def == CopyIdx);
- unsigned NextDef = LR->end;
- RemoveCopiesFromValNo(*ResDstInt, ImpVal);
- ResDstInt->removeValNo(ImpVal);
- LR = ResDstInt->FindLiveRangeContaining(NextDef);
- if (LR != ResDstInt->end() && LR->valno->def == NextDef) {
- // Special case: vr1024 = implicit_def
- // vr1024 = insert_subreg vr1024, vr1025, c
- // The insert_subreg becomes a "copy" that defines a val# which can itself
- // be coalesced away.
- MachineInstr *DefMI = li_->getInstructionFromIndex(NextDef);
- if (DefMI->getOpcode() == TargetInstrInfo::INSERT_SUBREG)
- LR->valno->copy = DefMI;
- }
- }
-
- DOUT << "\n\t\tJoined. Result = "; ResDstInt->print(DOUT, tri_);
- DOUT << "\n";
-
- ++numJoins;
- return true;
-}
-
-/// ComputeUltimateVN - Assuming we are going to join two live intervals,
-/// compute what the resultant value numbers for each value in the input two
-/// ranges will be. This is complicated by copies between the two which can
-/// and will commonly cause multiple value numbers to be merged into one.
-///
-/// VN is the value number that we're trying to resolve. InstDefiningValue
-/// keeps track of the new InstDefiningValue assignment for the result
-/// LiveInterval. ThisFromOther/OtherFromThis are sets that keep track of
-/// whether a value in this or other is a copy from the opposite set.
-/// ThisValNoAssignments/OtherValNoAssignments keep track of value #'s that have
-/// already been assigned.
-///
-/// ThisFromOther[x] - If x is defined as a copy from the other interval, this
-/// contains the value number the copy is from.
-///
-static unsigned ComputeUltimateVN(VNInfo *VNI,
- SmallVector<VNInfo*, 16> &NewVNInfo,
- DenseMap<VNInfo*, VNInfo*> &ThisFromOther,
- DenseMap<VNInfo*, VNInfo*> &OtherFromThis,
- SmallVector<int, 16> &ThisValNoAssignments,
- SmallVector<int, 16> &OtherValNoAssignments) {
- unsigned VN = VNI->id;
-
- // If the VN has already been computed, just return it.
- if (ThisValNoAssignments[VN] >= 0)
- return ThisValNoAssignments[VN];
-// assert(ThisValNoAssignments[VN] != -2 && "Cyclic case?");
-
- // If this val is not a copy from the other val, then it must be a new value
- // number in the destination.
- DenseMap<VNInfo*, VNInfo*>::iterator I = ThisFromOther.find(VNI);
- if (I == ThisFromOther.end()) {
- NewVNInfo.push_back(VNI);
- return ThisValNoAssignments[VN] = NewVNInfo.size()-1;
- }
- VNInfo *OtherValNo = I->second;
-
- // Otherwise, this *is* a copy from the RHS. If the other side has already
- // been computed, return it.
- if (OtherValNoAssignments[OtherValNo->id] >= 0)
- return ThisValNoAssignments[VN] = OtherValNoAssignments[OtherValNo->id];
-
- // Mark this value number as currently being computed, then ask what the
- // ultimate value # of the other value is.
- ThisValNoAssignments[VN] = -2;
- unsigned UltimateVN =
- ComputeUltimateVN(OtherValNo, NewVNInfo, OtherFromThis, ThisFromOther,
- OtherValNoAssignments, ThisValNoAssignments);
- return ThisValNoAssignments[VN] = UltimateVN;
-}
-
-static bool InVector(VNInfo *Val, const SmallVector<VNInfo*, 8> &V) {
- return std::find(V.begin(), V.end(), Val) != V.end();
-}
-
-/// RangeIsDefinedByCopyFromReg - Return true if the specified live range of
-/// the specified live interval is defined by a copy from the specified
-/// register.
-bool SimpleRegisterCoalescing::RangeIsDefinedByCopyFromReg(LiveInterval &li,
- LiveRange *LR,
- unsigned Reg) {
- unsigned SrcReg = li_->getVNInfoSourceReg(LR->valno);
- if (SrcReg == Reg)
- return true;
- if (LR->valno->def == ~0U &&
- TargetRegisterInfo::isPhysicalRegister(li.reg) &&
- *tri_->getSuperRegisters(li.reg)) {
- // It's a sub-register live interval, we may not have precise information.
- // Re-compute it.
- MachineInstr *DefMI = li_->getInstructionFromIndex(LR->start);
- unsigned SrcReg, DstReg;
- if (tii_->isMoveInstr(*DefMI, SrcReg, DstReg) &&
- DstReg == li.reg && SrcReg == Reg) {
- // Cache computed info.
- LR->valno->def = LR->start;
- LR->valno->copy = DefMI;
- return true;
- }
- }
- return false;
-}
-
-/// SimpleJoin - Attempt to joint the specified interval into this one. The
-/// caller of this method must guarantee that the RHS only contains a single
-/// value number and that the RHS is not defined by a copy from this
-/// interval. This returns false if the intervals are not joinable, or it
-/// joins them and returns true.
-bool SimpleRegisterCoalescing::SimpleJoin(LiveInterval &LHS, LiveInterval &RHS){
- assert(RHS.containsOneValue());
-
- // Some number (potentially more than one) value numbers in the current
- // interval may be defined as copies from the RHS. Scan the overlapping
- // portions of the LHS and RHS, keeping track of this and looking for
- // overlapping live ranges that are NOT defined as copies. If these exist, we
- // cannot coalesce.
-
- LiveInterval::iterator LHSIt = LHS.begin(), LHSEnd = LHS.end();
- LiveInterval::iterator RHSIt = RHS.begin(), RHSEnd = RHS.end();
-
- if (LHSIt->start < RHSIt->start) {
- LHSIt = std::upper_bound(LHSIt, LHSEnd, RHSIt->start);
- if (LHSIt != LHS.begin()) --LHSIt;
- } else if (RHSIt->start < LHSIt->start) {
- RHSIt = std::upper_bound(RHSIt, RHSEnd, LHSIt->start);
- if (RHSIt != RHS.begin()) --RHSIt;
- }
-
- SmallVector<VNInfo*, 8> EliminatedLHSVals;
-
- while (1) {
- // Determine if these live intervals overlap.
- bool Overlaps = false;
- if (LHSIt->start <= RHSIt->start)
- Overlaps = LHSIt->end > RHSIt->start;
- else
- Overlaps = RHSIt->end > LHSIt->start;
-
- // If the live intervals overlap, there are two interesting cases: if the
- // LHS interval is defined by a copy from the RHS, it's ok and we record
- // that the LHS value # is the same as the RHS. If it's not, then we cannot
- // coalesce these live ranges and we bail out.
- if (Overlaps) {
- // If we haven't already recorded that this value # is safe, check it.
- if (!InVector(LHSIt->valno, EliminatedLHSVals)) {
- // Copy from the RHS?
- if (!RangeIsDefinedByCopyFromReg(LHS, LHSIt, RHS.reg))
- return false; // Nope, bail out.
-
- EliminatedLHSVals.push_back(LHSIt->valno);
- }
-
- // We know this entire LHS live range is okay, so skip it now.
- if (++LHSIt == LHSEnd) break;
- continue;
- }
-
- if (LHSIt->end < RHSIt->end) {
- if (++LHSIt == LHSEnd) break;
- } else {
- // One interesting case to check here. It's possible that we have
- // something like "X3 = Y" which defines a new value number in the LHS,
- // and is the last use of this liverange of the RHS. In this case, we
- // want to notice this copy (so that it gets coalesced away) even though
- // the live ranges don't actually overlap.
- if (LHSIt->start == RHSIt->end) {
- if (InVector(LHSIt->valno, EliminatedLHSVals)) {
- // We already know that this value number is going to be merged in
- // if coalescing succeeds. Just skip the liverange.
- if (++LHSIt == LHSEnd) break;
- } else {
- // Otherwise, if this is a copy from the RHS, mark it as being merged
- // in.
- if (RangeIsDefinedByCopyFromReg(LHS, LHSIt, RHS.reg)) {
- EliminatedLHSVals.push_back(LHSIt->valno);
-
- // We know this entire LHS live range is okay, so skip it now.
- if (++LHSIt == LHSEnd) break;
- }
- }
- }
-
- if (++RHSIt == RHSEnd) break;
- }
- }
-
- // If we got here, we know that the coalescing will be successful and that
- // the value numbers in EliminatedLHSVals will all be merged together. Since
- // the most common case is that EliminatedLHSVals has a single number, we
- // optimize for it: if there is more than one value, we merge them all into
- // the lowest numbered one, then handle the interval as if we were merging
- // with one value number.
- VNInfo *LHSValNo;
- if (EliminatedLHSVals.size() > 1) {
- // Loop through all the equal value numbers merging them into the smallest
- // one.
- VNInfo *Smallest = EliminatedLHSVals[0];
- for (unsigned i = 1, e = EliminatedLHSVals.size(); i != e; ++i) {
- if (EliminatedLHSVals[i]->id < Smallest->id) {
- // Merge the current notion of the smallest into the smaller one.
- LHS.MergeValueNumberInto(Smallest, EliminatedLHSVals[i]);
- Smallest = EliminatedLHSVals[i];
- } else {
- // Merge into the smallest.
- LHS.MergeValueNumberInto(EliminatedLHSVals[i], Smallest);
- }
- }
- LHSValNo = Smallest;
- } else if (EliminatedLHSVals.empty()) {
- if (TargetRegisterInfo::isPhysicalRegister(LHS.reg) &&
- *tri_->getSuperRegisters(LHS.reg))
- // Imprecise sub-register information. Can't handle it.
- return false;
- assert(0 && "No copies from the RHS?");
- } else {
- LHSValNo = EliminatedLHSVals[0];
- }
-
- // Okay, now that there is a single LHS value number that we're merging the
- // RHS into, update the value number info for the LHS to indicate that the
- // value number is defined where the RHS value number was.
- const VNInfo *VNI = RHS.getValNumInfo(0);
- LHSValNo->def = VNI->def;
- LHSValNo->copy = VNI->copy;
-
- // Okay, the final step is to loop over the RHS live intervals, adding them to
- // the LHS.
- LHSValNo->hasPHIKill |= VNI->hasPHIKill;
- LHS.addKills(LHSValNo, VNI->kills);
- LHS.MergeRangesInAsValue(RHS, LHSValNo);
- LHS.weight += RHS.weight;
- if (RHS.preference && !LHS.preference)
- LHS.preference = RHS.preference;
-
- return true;
-}
-
-/// JoinIntervals - Attempt to join these two intervals. On failure, this
-/// returns false. Otherwise, if one of the intervals being joined is a
-/// physreg, this method always canonicalizes LHS to be it. The output
-/// "RHS" will not have been modified, so we can use this information
-/// below to update aliases.
-bool SimpleRegisterCoalescing::JoinIntervals(LiveInterval &LHS,
- LiveInterval &RHS, bool &Swapped) {
- // Compute the final value assignment, assuming that the live ranges can be
- // coalesced.
- SmallVector<int, 16> LHSValNoAssignments;
- SmallVector<int, 16> RHSValNoAssignments;
- DenseMap<VNInfo*, VNInfo*> LHSValsDefinedFromRHS;
- DenseMap<VNInfo*, VNInfo*> RHSValsDefinedFromLHS;
- SmallVector<VNInfo*, 16> NewVNInfo;
-
- // If a live interval is a physical register, conservatively check if any
- // of its sub-registers is overlapping the live interval of the virtual
- // register. If so, do not coalesce.
- if (TargetRegisterInfo::isPhysicalRegister(LHS.reg) &&
- *tri_->getSubRegisters(LHS.reg)) {
- for (const unsigned* SR = tri_->getSubRegisters(LHS.reg); *SR; ++SR)
- if (li_->hasInterval(*SR) && RHS.overlaps(li_->getInterval(*SR))) {
- DOUT << "Interfere with sub-register ";
- DEBUG(li_->getInterval(*SR).print(DOUT, tri_));
- return false;
- }
- } else if (TargetRegisterInfo::isPhysicalRegister(RHS.reg) &&
- *tri_->getSubRegisters(RHS.reg)) {
- for (const unsigned* SR = tri_->getSubRegisters(RHS.reg); *SR; ++SR)
- if (li_->hasInterval(*SR) && LHS.overlaps(li_->getInterval(*SR))) {
- DOUT << "Interfere with sub-register ";
- DEBUG(li_->getInterval(*SR).print(DOUT, tri_));
- return false;
- }
- }
-
- // Compute ultimate value numbers for the LHS and RHS values.
- if (RHS.containsOneValue()) {
- // Copies from a liveinterval with a single value are simple to handle and
- // very common, handle the special case here. This is important, because
- // often RHS is small and LHS is large (e.g. a physreg).
-
- // Find out if the RHS is defined as a copy from some value in the LHS.
- int RHSVal0DefinedFromLHS = -1;
- int RHSValID = -1;
- VNInfo *RHSValNoInfo = NULL;
- VNInfo *RHSValNoInfo0 = RHS.getValNumInfo(0);
- unsigned RHSSrcReg = li_->getVNInfoSourceReg(RHSValNoInfo0);
- if ((RHSSrcReg == 0 || RHSSrcReg != LHS.reg)) {
- // If RHS is not defined as a copy from the LHS, we can use simpler and
- // faster checks to see if the live ranges are coalescable. This joiner
- // can't swap the LHS/RHS intervals though.
- if (!TargetRegisterInfo::isPhysicalRegister(RHS.reg)) {
- return SimpleJoin(LHS, RHS);
- } else {
- RHSValNoInfo = RHSValNoInfo0;
- }
- } else {
- // It was defined as a copy from the LHS, find out what value # it is.
- RHSValNoInfo = LHS.getLiveRangeContaining(RHSValNoInfo0->def-1)->valno;
- RHSValID = RHSValNoInfo->id;
- RHSVal0DefinedFromLHS = RHSValID;
- }
-
- LHSValNoAssignments.resize(LHS.getNumValNums(), -1);
- RHSValNoAssignments.resize(RHS.getNumValNums(), -1);
- NewVNInfo.resize(LHS.getNumValNums(), NULL);
-
- // Okay, *all* of the values in LHS that are defined as a copy from RHS
- // should now get updated.
- for (LiveInterval::vni_iterator i = LHS.vni_begin(), e = LHS.vni_end();
- i != e; ++i) {
- VNInfo *VNI = *i;
- unsigned VN = VNI->id;
- if (unsigned LHSSrcReg = li_->getVNInfoSourceReg(VNI)) {
- if (LHSSrcReg != RHS.reg) {
- // If this is not a copy from the RHS, its value number will be
- // unmodified by the coalescing.
- NewVNInfo[VN] = VNI;
- LHSValNoAssignments[VN] = VN;
- } else if (RHSValID == -1) {
- // Otherwise, it is a copy from the RHS, and we don't already have a
- // value# for it. Keep the current value number, but remember it.
- LHSValNoAssignments[VN] = RHSValID = VN;
- NewVNInfo[VN] = RHSValNoInfo;
- LHSValsDefinedFromRHS[VNI] = RHSValNoInfo0;
- } else {
- // Otherwise, use the specified value #.
- LHSValNoAssignments[VN] = RHSValID;
- if (VN == (unsigned)RHSValID) { // Else this val# is dead.
- NewVNInfo[VN] = RHSValNoInfo;
- LHSValsDefinedFromRHS[VNI] = RHSValNoInfo0;
- }
- }
- } else {
- NewVNInfo[VN] = VNI;
- LHSValNoAssignments[VN] = VN;
- }
- }
-
- assert(RHSValID != -1 && "Didn't find value #?");
- RHSValNoAssignments[0] = RHSValID;
- if (RHSVal0DefinedFromLHS != -1) {
- // This path doesn't go through ComputeUltimateVN so just set
- // it to anything.
- RHSValsDefinedFromLHS[RHSValNoInfo0] = (VNInfo*)1;
- }
- } else {
- // Loop over the value numbers of the LHS, seeing if any are defined from
- // the RHS.
- for (LiveInterval::vni_iterator i = LHS.vni_begin(), e = LHS.vni_end();
- i != e; ++i) {
- VNInfo *VNI = *i;
- if (VNI->def == ~1U || VNI->copy == 0) // Src not defined by a copy?
- continue;
-
- // DstReg is known to be a register in the LHS interval. If the src is
- // from the RHS interval, we can use its value #.
- if (li_->getVNInfoSourceReg(VNI) != RHS.reg)
- continue;
-
- // Figure out the value # from the RHS.
- LHSValsDefinedFromRHS[VNI]=RHS.getLiveRangeContaining(VNI->def-1)->valno;
- }
-
- // Loop over the value numbers of the RHS, seeing if any are defined from
- // the LHS.
- for (LiveInterval::vni_iterator i = RHS.vni_begin(), e = RHS.vni_end();
- i != e; ++i) {
- VNInfo *VNI = *i;
- if (VNI->def == ~1U || VNI->copy == 0) // Src not defined by a copy?
- continue;
-
- // DstReg is known to be a register in the RHS interval. If the src is
- // from the LHS interval, we can use its value #.
- if (li_->getVNInfoSourceReg(VNI) != LHS.reg)
- continue;
-
- // Figure out the value # from the LHS.
- RHSValsDefinedFromLHS[VNI]=LHS.getLiveRangeContaining(VNI->def-1)->valno;
- }
-
- LHSValNoAssignments.resize(LHS.getNumValNums(), -1);
- RHSValNoAssignments.resize(RHS.getNumValNums(), -1);
- NewVNInfo.reserve(LHS.getNumValNums() + RHS.getNumValNums());
-
- for (LiveInterval::vni_iterator i = LHS.vni_begin(), e = LHS.vni_end();
- i != e; ++i) {
- VNInfo *VNI = *i;
- unsigned VN = VNI->id;
- if (LHSValNoAssignments[VN] >= 0 || VNI->def == ~1U)
- continue;
- ComputeUltimateVN(VNI, NewVNInfo,
- LHSValsDefinedFromRHS, RHSValsDefinedFromLHS,
- LHSValNoAssignments, RHSValNoAssignments);
- }
- for (LiveInterval::vni_iterator i = RHS.vni_begin(), e = RHS.vni_end();
- i != e; ++i) {
- VNInfo *VNI = *i;
- unsigned VN = VNI->id;
- if (RHSValNoAssignments[VN] >= 0 || VNI->def == ~1U)
- continue;
- // If this value number isn't a copy from the LHS, it's a new number.
- if (RHSValsDefinedFromLHS.find(VNI) == RHSValsDefinedFromLHS.end()) {
- NewVNInfo.push_back(VNI);
- RHSValNoAssignments[VN] = NewVNInfo.size()-1;
- continue;
- }
-
- ComputeUltimateVN(VNI, NewVNInfo,
- RHSValsDefinedFromLHS, LHSValsDefinedFromRHS,
- RHSValNoAssignments, LHSValNoAssignments);
- }
- }
-
- // Armed with the mappings of LHS/RHS values to ultimate values, walk the
- // interval lists to see if these intervals are coalescable.
- LiveInterval::const_iterator I = LHS.begin();
- LiveInterval::const_iterator IE = LHS.end();
- LiveInterval::const_iterator J = RHS.begin();
- LiveInterval::const_iterator JE = RHS.end();
-
- // Skip ahead until the first place of potential sharing.
- if (I->start < J->start) {
- I = std::upper_bound(I, IE, J->start);
- if (I != LHS.begin()) --I;
- } else if (J->start < I->start) {
- J = std::upper_bound(J, JE, I->start);
- if (J != RHS.begin()) --J;
- }
-
- while (1) {
- // Determine if these two live ranges overlap.
- bool Overlaps;
- if (I->start < J->start) {
- Overlaps = I->end > J->start;
- } else {
- Overlaps = J->end > I->start;
- }
-
- // If so, check value # info to determine if they are really different.
- if (Overlaps) {
- // If the live range overlap will map to the same value number in the
- // result liverange, we can still coalesce them. If not, we can't.
- if (LHSValNoAssignments[I->valno->id] !=
- RHSValNoAssignments[J->valno->id])
- return false;
- }
-
- if (I->end < J->end) {
- ++I;
- if (I == IE) break;
- } else {
- ++J;
- if (J == JE) break;
- }
- }
-
- // Update kill info. Some live ranges are extended due to copy coalescing.
- for (DenseMap<VNInfo*, VNInfo*>::iterator I = LHSValsDefinedFromRHS.begin(),
- E = LHSValsDefinedFromRHS.end(); I != E; ++I) {
- VNInfo *VNI = I->first;
- unsigned LHSValID = LHSValNoAssignments[VNI->id];
- LiveInterval::removeKill(NewVNInfo[LHSValID], VNI->def);
- NewVNInfo[LHSValID]->hasPHIKill |= VNI->hasPHIKill;
- RHS.addKills(NewVNInfo[LHSValID], VNI->kills);
- }
-
- // Update kill info. Some live ranges are extended due to copy coalescing.
- for (DenseMap<VNInfo*, VNInfo*>::iterator I = RHSValsDefinedFromLHS.begin(),
- E = RHSValsDefinedFromLHS.end(); I != E; ++I) {
- VNInfo *VNI = I->first;
- unsigned RHSValID = RHSValNoAssignments[VNI->id];
- LiveInterval::removeKill(NewVNInfo[RHSValID], VNI->def);
- NewVNInfo[RHSValID]->hasPHIKill |= VNI->hasPHIKill;
- LHS.addKills(NewVNInfo[RHSValID], VNI->kills);
- }
-
- // If we get here, we know that we can coalesce the live ranges. Ask the
- // intervals to coalesce themselves now.
- if ((RHS.ranges.size() > LHS.ranges.size() &&
- TargetRegisterInfo::isVirtualRegister(LHS.reg)) ||
- TargetRegisterInfo::isPhysicalRegister(RHS.reg)) {
- RHS.join(LHS, &RHSValNoAssignments[0], &LHSValNoAssignments[0], NewVNInfo);
- Swapped = true;
- } else {
- LHS.join(RHS, &LHSValNoAssignments[0], &RHSValNoAssignments[0], NewVNInfo);
- Swapped = false;
- }
- return true;
-}
-
-namespace {
- // DepthMBBCompare - Comparison predicate that sort first based on the loop
- // depth of the basic block (the unsigned), and then on the MBB number.
- struct DepthMBBCompare {
- typedef std::pair<unsigned, MachineBasicBlock*> DepthMBBPair;
- bool operator()(const DepthMBBPair &LHS, const DepthMBBPair &RHS) const {
- if (LHS.first > RHS.first) return true; // Deeper loops first
- return LHS.first == RHS.first &&
- LHS.second->getNumber() < RHS.second->getNumber();
- }
- };
-}
-
-/// getRepIntervalSize - Returns the size of the interval that represents the
-/// specified register.
-template<class SF>
-unsigned JoinPriorityQueue<SF>::getRepIntervalSize(unsigned Reg) {
- return Rc->getRepIntervalSize(Reg);
-}
-
-/// CopyRecSort::operator - Join priority queue sorting function.
-///
-bool CopyRecSort::operator()(CopyRec left, CopyRec right) const {
- // Inner loops first.
- if (left.LoopDepth > right.LoopDepth)
- return false;
- else if (left.LoopDepth == right.LoopDepth)
- if (left.isBackEdge && !right.isBackEdge)
- return false;
- return true;
-}
-
-void SimpleRegisterCoalescing::CopyCoalesceInMBB(MachineBasicBlock *MBB,
- std::vector<CopyRec> &TryAgain) {
- DOUT << ((Value*)MBB->getBasicBlock())->getName() << ":\n";
-
- std::vector<CopyRec> VirtCopies;
- std::vector<CopyRec> PhysCopies;
- std::vector<CopyRec> ImpDefCopies;
- unsigned LoopDepth = loopInfo->getLoopDepth(MBB);
- for (MachineBasicBlock::iterator MII = MBB->begin(), E = MBB->end();
- MII != E;) {
- MachineInstr *Inst = MII++;
-
- // If this isn't a copy nor a extract_subreg, we can't join intervals.
- unsigned SrcReg, DstReg;
- if (Inst->getOpcode() == TargetInstrInfo::EXTRACT_SUBREG) {
- DstReg = Inst->getOperand(0).getReg();
- SrcReg = Inst->getOperand(1).getReg();
- } else if (Inst->getOpcode() == TargetInstrInfo::INSERT_SUBREG) {
- DstReg = Inst->getOperand(0).getReg();
- SrcReg = Inst->getOperand(2).getReg();
- } else if (!tii_->isMoveInstr(*Inst, SrcReg, DstReg))
- continue;
-
- bool SrcIsPhys = TargetRegisterInfo::isPhysicalRegister(SrcReg);
- bool DstIsPhys = TargetRegisterInfo::isPhysicalRegister(DstReg);
- if (NewHeuristic) {
- JoinQueue->push(CopyRec(Inst, LoopDepth, isBackEdgeCopy(Inst, DstReg)));
- } else {
- if (li_->hasInterval(SrcReg) && li_->getInterval(SrcReg).empty())
- ImpDefCopies.push_back(CopyRec(Inst, 0, false));
- else if (SrcIsPhys || DstIsPhys)
- PhysCopies.push_back(CopyRec(Inst, 0, false));
- else
- VirtCopies.push_back(CopyRec(Inst, 0, false));
- }
- }
-
- if (NewHeuristic)
- return;
-
- // Try coalescing implicit copies first, followed by copies to / from
- // physical registers, then finally copies from virtual registers to
- // virtual registers.
- for (unsigned i = 0, e = ImpDefCopies.size(); i != e; ++i) {
- CopyRec &TheCopy = ImpDefCopies[i];
- bool Again = false;
- if (!JoinCopy(TheCopy, Again))
- if (Again)
- TryAgain.push_back(TheCopy);
- }
- for (unsigned i = 0, e = PhysCopies.size(); i != e; ++i) {
- CopyRec &TheCopy = PhysCopies[i];
- bool Again = false;
- if (!JoinCopy(TheCopy, Again))
- if (Again)
- TryAgain.push_back(TheCopy);
- }
- for (unsigned i = 0, e = VirtCopies.size(); i != e; ++i) {
- CopyRec &TheCopy = VirtCopies[i];
- bool Again = false;
- if (!JoinCopy(TheCopy, Again))
- if (Again)
- TryAgain.push_back(TheCopy);
- }
-}
-
-void SimpleRegisterCoalescing::joinIntervals() {
- DOUT << "********** JOINING INTERVALS ***********\n";
-
- if (NewHeuristic)
- JoinQueue = new JoinPriorityQueue<CopyRecSort>(this);
-
- std::vector<CopyRec> TryAgainList;
- if (loopInfo->begin() == loopInfo->end()) {
- // If there are no loops in the function, join intervals in function order.
- for (MachineFunction::iterator I = mf_->begin(), E = mf_->end();
- I != E; ++I)
- CopyCoalesceInMBB(I, TryAgainList);
- } else {
- // Otherwise, join intervals in inner loops before other intervals.
- // Unfortunately we can't just iterate over loop hierarchy here because
- // there may be more MBB's than BB's. Collect MBB's for sorting.
-
- // Join intervals in the function prolog first. We want to join physical
- // registers with virtual registers before the intervals got too long.
- std::vector<std::pair<unsigned, MachineBasicBlock*> > MBBs;
- for (MachineFunction::iterator I = mf_->begin(), E = mf_->end();I != E;++I){
- MachineBasicBlock *MBB = I;
- MBBs.push_back(std::make_pair(loopInfo->getLoopDepth(MBB), I));
- }
-
- // Sort by loop depth.
- std::sort(MBBs.begin(), MBBs.end(), DepthMBBCompare());
-
- // Finally, join intervals in loop nest order.
- for (unsigned i = 0, e = MBBs.size(); i != e; ++i)
- CopyCoalesceInMBB(MBBs[i].second, TryAgainList);
- }
-
- // Joining intervals can allow other intervals to be joined. Iteratively join
- // until we make no progress.
- if (NewHeuristic) {
- SmallVector<CopyRec, 16> TryAgain;
- bool ProgressMade = true;
- while (ProgressMade) {
- ProgressMade = false;
- while (!JoinQueue->empty()) {
- CopyRec R = JoinQueue->pop();
- bool Again = false;
- bool Success = JoinCopy(R, Again);
- if (Success)
- ProgressMade = true;
- else if (Again)
- TryAgain.push_back(R);
- }
-
- if (ProgressMade) {
- while (!TryAgain.empty()) {
- JoinQueue->push(TryAgain.back());
- TryAgain.pop_back();
- }
- }
- }
- } else {
- bool ProgressMade = true;
- while (ProgressMade) {
- ProgressMade = false;
-
- for (unsigned i = 0, e = TryAgainList.size(); i != e; ++i) {
- CopyRec &TheCopy = TryAgainList[i];
- if (TheCopy.MI) {
- bool Again = false;
- bool Success = JoinCopy(TheCopy, Again);
- if (Success || !Again) {
- TheCopy.MI = 0; // Mark this one as done.
- ProgressMade = true;
- }
- }
- }
- }
- }
-
- if (NewHeuristic)
- delete JoinQueue;
-}
-
-/// Return true if the two specified registers belong to different register
-/// classes. The registers may be either phys or virt regs.
-bool SimpleRegisterCoalescing::differingRegisterClasses(unsigned RegA,
- unsigned RegB) const {
-
- // Get the register classes for the first reg.
- if (TargetRegisterInfo::isPhysicalRegister(RegA)) {
- assert(TargetRegisterInfo::isVirtualRegister(RegB) &&
- "Shouldn't consider two physregs!");
- return !mri_->getRegClass(RegB)->contains(RegA);
- }
-
- // Compare against the regclass for the second reg.
- const TargetRegisterClass *RegClass = mri_->getRegClass(RegA);
- if (TargetRegisterInfo::isVirtualRegister(RegB))
- return RegClass != mri_->getRegClass(RegB);
- else
- return !RegClass->contains(RegB);
-}
-
-/// lastRegisterUse - Returns the last use of the specific register between
-/// cycles Start and End or NULL if there are no uses.
-MachineOperand *
-SimpleRegisterCoalescing::lastRegisterUse(unsigned Start, unsigned End,
- unsigned Reg, unsigned &UseIdx) const{
- UseIdx = 0;
- if (TargetRegisterInfo::isVirtualRegister(Reg)) {
- MachineOperand *LastUse = NULL;
- for (MachineRegisterInfo::use_iterator I = mri_->use_begin(Reg),
- E = mri_->use_end(); I != E; ++I) {
- MachineOperand &Use = I.getOperand();
- MachineInstr *UseMI = Use.getParent();
- unsigned SrcReg, DstReg;
- if (tii_->isMoveInstr(*UseMI, SrcReg, DstReg) && SrcReg == DstReg)
- // Ignore identity copies.
- continue;
- unsigned Idx = li_->getInstructionIndex(UseMI);
- if (Idx >= Start && Idx < End && Idx >= UseIdx) {
- LastUse = &Use;
- UseIdx = Idx;
- }
- }
- return LastUse;
- }
-
- int e = (End-1) / InstrSlots::NUM * InstrSlots::NUM;
- int s = Start;
- while (e >= s) {
- // Skip deleted instructions
- MachineInstr *MI = li_->getInstructionFromIndex(e);
- while ((e - InstrSlots::NUM) >= s && !MI) {
- e -= InstrSlots::NUM;
- MI = li_->getInstructionFromIndex(e);
- }
- if (e < s || MI == NULL)
- return NULL;
-
- // Ignore identity copies.
- unsigned SrcReg, DstReg;
- if (!(tii_->isMoveInstr(*MI, SrcReg, DstReg) && SrcReg == DstReg))
- for (unsigned i = 0, NumOps = MI->getNumOperands(); i != NumOps; ++i) {
- MachineOperand &Use = MI->getOperand(i);
- if (Use.isRegister() && Use.isUse() && Use.getReg() &&
- tri_->regsOverlap(Use.getReg(), Reg)) {
- UseIdx = e;
- return &Use;
- }
- }
-
- e -= InstrSlots::NUM;
- }
-
- return NULL;
-}
-
-
-void SimpleRegisterCoalescing::printRegName(unsigned reg) const {
- if (TargetRegisterInfo::isPhysicalRegister(reg))
- cerr << tri_->getName(reg);
- else
- cerr << "%reg" << reg;
-}
-
-void SimpleRegisterCoalescing::releaseMemory() {
- JoinedCopies.clear();
-}
-
-static bool isZeroLengthInterval(LiveInterval *li) {
- for (LiveInterval::Ranges::const_iterator
- i = li->ranges.begin(), e = li->ranges.end(); i != e; ++i)
- if (i->end - i->start > LiveIntervals::InstrSlots::NUM)
- return false;
- return true;
-}
-
-/// TurnCopyIntoImpDef - If source of the specified copy is an implicit def,
-/// turn the copy into an implicit def.
-bool
-SimpleRegisterCoalescing::TurnCopyIntoImpDef(MachineBasicBlock::iterator &I,
- MachineBasicBlock *MBB,
- unsigned DstReg, unsigned SrcReg) {
- MachineInstr *CopyMI = &*I;
- unsigned CopyIdx = li_->getDefIndex(li_->getInstructionIndex(CopyMI));
- if (!li_->hasInterval(SrcReg))
- return false;
- LiveInterval &SrcInt = li_->getInterval(SrcReg);
- if (!SrcInt.empty())
- return false;
- if (!li_->hasInterval(DstReg))
- return false;
- LiveInterval &DstInt = li_->getInterval(DstReg);
- const LiveRange *DstLR = DstInt.getLiveRangeContaining(CopyIdx);
- DstInt.removeValNo(DstLR->valno);
- CopyMI->setDesc(tii_->get(TargetInstrInfo::IMPLICIT_DEF));
- for (int i = CopyMI->getNumOperands() - 1, e = 0; i > e; --i)
- CopyMI->RemoveOperand(i);
- bool NoUse = mri_->use_begin(SrcReg) == mri_->use_end();
- if (NoUse) {
- for (MachineRegisterInfo::reg_iterator I = mri_->reg_begin(SrcReg),
- E = mri_->reg_end(); I != E; ) {
- assert(I.getOperand().isDef());
- MachineInstr *DefMI = &*I;
- ++I;
- // The implicit_def source has no other uses, delete it.
- assert(DefMI->getOpcode() == TargetInstrInfo::IMPLICIT_DEF);
- li_->RemoveMachineInstrFromMaps(DefMI);
- DefMI->eraseFromParent();
- }
- }
- ++I;
- return true;
-}
-
-
-bool SimpleRegisterCoalescing::runOnMachineFunction(MachineFunction &fn) {
- mf_ = &fn;
- mri_ = &fn.getRegInfo();
- tm_ = &fn.getTarget();
- tri_ = tm_->getRegisterInfo();
- tii_ = tm_->getInstrInfo();
- li_ = &getAnalysis<LiveIntervals>();
- lv_ = &getAnalysis<LiveVariables>();
- loopInfo = &getAnalysis<MachineLoopInfo>();
-
- DOUT << "********** SIMPLE REGISTER COALESCING **********\n"
- << "********** Function: "
- << ((Value*)mf_->getFunction())->getName() << '\n';
-
- allocatableRegs_ = tri_->getAllocatableSet(fn);
- for (TargetRegisterInfo::regclass_iterator I = tri_->regclass_begin(),
- E = tri_->regclass_end(); I != E; ++I)
- allocatableRCRegs_.insert(std::make_pair(*I,
- tri_->getAllocatableSet(fn, *I)));
-
- // Join (coalesce) intervals if requested.
- if (EnableJoining) {
- joinIntervals();
- DOUT << "********** INTERVALS POST JOINING **********\n";
- for (LiveIntervals::iterator I = li_->begin(), E = li_->end(); I != E; ++I){
- I->second.print(DOUT, tri_);
- DOUT << "\n";
- }
- }
-
- // Perform a final pass over the instructions and compute spill weights
- // and remove identity moves.
- for (MachineFunction::iterator mbbi = mf_->begin(), mbbe = mf_->end();
- mbbi != mbbe; ++mbbi) {
- MachineBasicBlock* mbb = mbbi;
- unsigned loopDepth = loopInfo->getLoopDepth(mbb);
-
- for (MachineBasicBlock::iterator mii = mbb->begin(), mie = mbb->end();
- mii != mie; ) {
- MachineInstr *MI = mii;
- unsigned SrcReg, DstReg;
- if (JoinedCopies.count(MI)) {
- // Delete all coalesced copies.
- if (!tii_->isMoveInstr(*MI, SrcReg, DstReg)) {
- assert((MI->getOpcode() == TargetInstrInfo::EXTRACT_SUBREG ||
- MI->getOpcode() == TargetInstrInfo::INSERT_SUBREG) &&
- "Unrecognized copy instruction");
- DstReg = MI->getOperand(0).getReg();
- }
- if (MI->registerDefIsDead(DstReg)) {
- LiveInterval &li = li_->getInterval(DstReg);
- if (!ShortenDeadCopySrcLiveRange(li, MI))
- ShortenDeadCopyLiveRange(li, MI);
- }
- li_->RemoveMachineInstrFromMaps(MI);
- mii = mbbi->erase(mii);
- ++numPeep;
- continue;
- }
-
- // If the move will be an identity move delete it
- bool isMove = tii_->isMoveInstr(*mii, SrcReg, DstReg);
- if (isMove && SrcReg == DstReg) {
- if (li_->hasInterval(SrcReg)) {
- LiveInterval &RegInt = li_->getInterval(SrcReg);
- // If def of this move instruction is dead, remove its live range
- // from the dstination register's live interval.
- if (mii->registerDefIsDead(DstReg)) {
- if (!ShortenDeadCopySrcLiveRange(RegInt, mii))
- ShortenDeadCopyLiveRange(RegInt, mii);
- }
- }
- li_->RemoveMachineInstrFromMaps(mii);
- mii = mbbi->erase(mii);
- ++numPeep;
- } else if (!isMove || !TurnCopyIntoImpDef(mii, mbb, DstReg, SrcReg)) {
- SmallSet<unsigned, 4> UniqueUses;
- for (unsigned i = 0, e = mii->getNumOperands(); i != e; ++i) {
- const MachineOperand &mop = mii->getOperand(i);
- if (mop.isRegister() && mop.getReg() &&
- TargetRegisterInfo::isVirtualRegister(mop.getReg())) {
- unsigned reg = mop.getReg();
- // Multiple uses of reg by the same instruction. It should not
- // contribute to spill weight again.
- if (UniqueUses.count(reg) != 0)
- continue;
- LiveInterval &RegInt = li_->getInterval(reg);
- RegInt.weight +=
- li_->getSpillWeight(mop.isDef(), mop.isUse(), loopDepth);
- UniqueUses.insert(reg);
- }
- }
- ++mii;
- }
- }
- }
-
- for (LiveIntervals::iterator I = li_->begin(), E = li_->end(); I != E; ++I) {
- LiveInterval &LI = I->second;
- if (TargetRegisterInfo::isVirtualRegister(LI.reg)) {
- // If the live interval length is essentially zero, i.e. in every live
- // range the use follows def immediately, it doesn't make sense to spill
- // it and hope it will be easier to allocate for this li.
- if (isZeroLengthInterval(&LI))
- LI.weight = HUGE_VALF;
- else {
- bool isLoad = false;
- if (li_->isReMaterializable(LI, isLoad)) {
- // If all of the definitions of the interval are re-materializable,
- // it is a preferred candidate for spilling. If non of the defs are
- // loads, then it's potentially very cheap to re-materialize.
- // FIXME: this gets much more complicated once we support non-trivial
- // re-materialization.
- if (isLoad)
- LI.weight *= 0.9F;
- else
- LI.weight *= 0.5F;
- }
- }
-
- // Slightly prefer live interval that has been assigned a preferred reg.
- if (LI.preference)
- LI.weight *= 1.01F;
-
- // Divide the weight of the interval by its size. This encourages
- // spilling of intervals that are large and have few uses, and
- // discourages spilling of small intervals with many uses.
- LI.weight /= LI.getSize();
- }
- }
-
- DEBUG(dump());
- return true;
-}
-
-/// print - Implement the dump method.
-void SimpleRegisterCoalescing::print(std::ostream &O, const Module* m) const {
- li_->print(O, m);
-}
-
-RegisterCoalescer* llvm::createSimpleRegisterCoalescer() {
- return new SimpleRegisterCoalescing();
-}
-
-// Make sure that anything that uses RegisterCoalescer pulls in this file...
-DEFINING_FILE_FOR(SimpleRegisterCoalescing)
diff --git a/release_23/lib/CodeGen/SimpleRegisterCoalescing.h b/release_23/lib/CodeGen/SimpleRegisterCoalescing.h
deleted file mode 100644
index 5b3d6b67a91b..000000000000
--- a/release_23/lib/CodeGen/SimpleRegisterCoalescing.h
+++ /dev/null
@@ -1,254 +0,0 @@
-//===-- SimpleRegisterCoalescing.h - Register Coalescing --------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements a simple register copy coalescing phase.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_CODEGEN_SIMPLE_REGISTER_COALESCING_H
-#define LLVM_CODEGEN_SIMPLE_REGISTER_COALESCING_H
-
-#include "llvm/CodeGen/MachineFunctionPass.h"
-#include "llvm/CodeGen/LiveInterval.h"
-#include "llvm/CodeGen/LiveIntervalAnalysis.h"
-#include "llvm/CodeGen/RegisterCoalescer.h"
-#include "llvm/ADT/BitVector.h"
-#include "llvm/ADT/IndexedMap.h"
-#include <queue>
-
-namespace llvm {
- class SimpleRegisterCoalescing;
- class LiveVariables;
- class TargetRegisterInfo;
- class TargetInstrInfo;
- class VirtRegMap;
- class MachineLoopInfo;
-
- /// CopyRec - Representation for copy instructions in coalescer queue.
- ///
- struct CopyRec {
- MachineInstr *MI;
- unsigned LoopDepth;
- bool isBackEdge;
- CopyRec(MachineInstr *mi, unsigned depth, bool be)
- : MI(mi), LoopDepth(depth), isBackEdge(be) {};
- };
-
- template<class SF> class JoinPriorityQueue;
-
- /// CopyRecSort - Sorting function for coalescer queue.
- ///
- struct CopyRecSort : public std::binary_function<CopyRec,CopyRec,bool> {
- JoinPriorityQueue<CopyRecSort> *JPQ;
- explicit CopyRecSort(JoinPriorityQueue<CopyRecSort> *jpq) : JPQ(jpq) {}
- CopyRecSort(const CopyRecSort &RHS) : JPQ(RHS.JPQ) {}
- bool operator()(CopyRec left, CopyRec right) const;
- };
-
- /// JoinQueue - A priority queue of copy instructions the coalescer is
- /// going to process.
- template<class SF>
- class JoinPriorityQueue {
- SimpleRegisterCoalescing *Rc;
- std::priority_queue<CopyRec, std::vector<CopyRec>, SF> Queue;
-
- public:
- explicit JoinPriorityQueue(SimpleRegisterCoalescing *rc)
- : Rc(rc), Queue(SF(this)) {}
-
- bool empty() const { return Queue.empty(); }
- void push(CopyRec R) { Queue.push(R); }
- CopyRec pop() {
- if (empty()) return CopyRec(0, 0, false);
- CopyRec R = Queue.top();
- Queue.pop();
- return R;
- }
-
- // Callbacks to SimpleRegisterCoalescing.
- unsigned getRepIntervalSize(unsigned Reg);
- };
-
- class SimpleRegisterCoalescing : public MachineFunctionPass,
- public RegisterCoalescer {
- MachineFunction* mf_;
- MachineRegisterInfo* mri_;
- const TargetMachine* tm_;
- const TargetRegisterInfo* tri_;
- const TargetInstrInfo* tii_;
- LiveIntervals *li_;
- LiveVariables *lv_;
- const MachineLoopInfo* loopInfo;
-
- BitVector allocatableRegs_;
- DenseMap<const TargetRegisterClass*, BitVector> allocatableRCRegs_;
-
- /// JoinQueue - A priority queue of copy instructions the coalescer is
- /// going to process.
- JoinPriorityQueue<CopyRecSort> *JoinQueue;
-
- /// JoinedCopies - Keep track of copies eliminated due to coalescing.
- ///
- SmallPtrSet<MachineInstr*, 32> JoinedCopies;
-
- public:
- static char ID; // Pass identifcation, replacement for typeid
- SimpleRegisterCoalescing() : MachineFunctionPass((intptr_t)&ID) {}
-
- struct InstrSlots {
- enum {
- LOAD = 0,
- USE = 1,
- DEF = 2,
- STORE = 3,
- NUM = 4
- };
- };
-
- virtual void getAnalysisUsage(AnalysisUsage &AU) const;
- virtual void releaseMemory();
-
- /// runOnMachineFunction - pass entry point
- virtual bool runOnMachineFunction(MachineFunction&);
-
- bool coalesceFunction(MachineFunction &mf, RegallocQuery &) {
- // This runs as an independent pass, so don't do anything.
- return false;
- };
-
- /// getRepIntervalSize - Called from join priority queue sorting function.
- /// It returns the size of the interval that represent the given register.
- unsigned getRepIntervalSize(unsigned Reg) {
- if (!li_->hasInterval(Reg))
- return 0;
- return li_->getInterval(Reg).getSize();
- }
-
- /// print - Implement the dump method.
- virtual void print(std::ostream &O, const Module* = 0) const;
- void print(std::ostream *O, const Module* M = 0) const {
- if (O) print(*O, M);
- }
-
- private:
- /// joinIntervals - join compatible live intervals
- void joinIntervals();
-
- /// CopyCoalesceInMBB - Coalesce copies in the specified MBB, putting
- /// copies that cannot yet be coalesced into the "TryAgain" list.
- void CopyCoalesceInMBB(MachineBasicBlock *MBB,
- std::vector<CopyRec> &TryAgain);
-
- /// JoinCopy - Attempt to join intervals corresponding to SrcReg/DstReg,
- /// which are the src/dst of the copy instruction CopyMI. This returns true
- /// if the copy was successfully coalesced away. If it is not currently
- /// possible to coalesce this interval, but it may be possible if other
- /// things get coalesced, then it returns true by reference in 'Again'.
- bool JoinCopy(CopyRec &TheCopy, bool &Again);
-
- /// JoinIntervals - Attempt to join these two intervals. On failure, this
- /// returns false. Otherwise, if one of the intervals being joined is a
- /// physreg, this method always canonicalizes DestInt to be it. The output
- /// "SrcInt" will not have been modified, so we can use this information
- /// below to update aliases.
- bool JoinIntervals(LiveInterval &LHS, LiveInterval &RHS, bool &Swapped);
-
- /// SimpleJoin - Attempt to join the specified interval into this one. The
- /// caller of this method must guarantee that the RHS only contains a single
- /// value number and that the RHS is not defined by a copy from this
- /// interval. This returns false if the intervals are not joinable, or it
- /// joins them and returns true.
- bool SimpleJoin(LiveInterval &LHS, LiveInterval &RHS);
-
- /// Return true if the two specified registers belong to different
- /// register classes. The registers may be either phys or virt regs.
- bool differingRegisterClasses(unsigned RegA, unsigned RegB) const;
-
-
- /// AdjustCopiesBackFrom - We found a non-trivially-coalescable copy. If
- /// the source value number is defined by a copy from the destination reg
- /// see if we can merge these two destination reg valno# into a single
- /// value number, eliminating a copy.
- bool AdjustCopiesBackFrom(LiveInterval &IntA, LiveInterval &IntB,
- MachineInstr *CopyMI);
-
- /// HasOtherReachingDefs - Return true if there are definitions of IntB
- /// other than BValNo val# that can reach uses of AValno val# of IntA.
- bool HasOtherReachingDefs(LiveInterval &IntA, LiveInterval &IntB,
- VNInfo *AValNo, VNInfo *BValNo);
-
- /// RemoveCopyByCommutingDef - We found a non-trivially-coalescable copy.
- /// If the source value number is defined by a commutable instruction and
- /// its other operand is coalesced to the copy dest register, see if we
- /// can transform the copy into a noop by commuting the definition.
- bool RemoveCopyByCommutingDef(LiveInterval &IntA, LiveInterval &IntB,
- MachineInstr *CopyMI);
-
- /// TurnCopyIntoImpDef - If source of the specified copy is an implicit def,
- /// turn the copy into an implicit def.
- bool TurnCopyIntoImpDef(MachineBasicBlock::iterator &I,
- MachineBasicBlock *MBB,
- unsigned DstReg, unsigned SrcReg);
-
- /// CanCoalesceWithImpDef - Returns true if the specified copy instruction
- /// from an implicit def to another register can be coalesced away.
- bool CanCoalesceWithImpDef(MachineInstr *CopyMI,
- LiveInterval &li, LiveInterval &ImpLi) const;
-
- /// RemoveCopiesFromValNo - The specified value# is defined by an implicit
- /// def and it is being removed. Turn all copies from this value# into
- /// identity copies so they will be removed.
- void RemoveCopiesFromValNo(LiveInterval &li, VNInfo *VNI);
-
- /// RangeIsDefinedByCopyFromReg - Return true if the specified live range of
- /// the specified live interval is defined by a copy from the specified
- /// register.
- bool RangeIsDefinedByCopyFromReg(LiveInterval &li, LiveRange *LR,
- unsigned Reg);
-
- /// isBackEdgeCopy - Return true if CopyMI is a back edge copy.
- ///
- bool isBackEdgeCopy(MachineInstr *CopyMI, unsigned DstReg) const;
-
- /// UpdateRegDefsUses - Replace all defs and uses of SrcReg to DstReg and
- /// update the subregister number if it is not zero. If DstReg is a
- /// physical register and the existing subregister number of the def / use
- /// being updated is not zero, make sure to set it to the correct physical
- /// subregister.
- void UpdateRegDefsUses(unsigned SrcReg, unsigned DstReg, unsigned SubIdx);
-
- /// RemoveDeadImpDef - Remove implicit_def instructions which are
- /// "re-defining" registers due to insert_subreg coalescing. e.g.
- void RemoveDeadImpDef(unsigned Reg, LiveInterval &LI);
-
- /// RemoveUnnecessaryKills - Remove kill markers that are no longer accurate
- /// due to live range lengthening as the result of coalescing.
- void RemoveUnnecessaryKills(unsigned Reg, LiveInterval &LI);
-
- /// ShortenDeadCopyLiveRange - Shorten a live range defined by a dead copy.
- /// Return true if live interval is removed.
- bool ShortenDeadCopyLiveRange(LiveInterval &li, MachineInstr *CopyMI);
-
- /// ShortenDeadCopyLiveRange - Shorten a live range as it's artificially
- /// extended by a dead copy. Mark the last use (if any) of the val# as kill
- /// as ends the live range there. If there isn't another use, then this
- /// live range is dead. Return true if live interval is removed.
- bool ShortenDeadCopySrcLiveRange(LiveInterval &li, MachineInstr *CopyMI);
-
- /// lastRegisterUse - Returns the last use of the specific register between
- /// cycles Start and End or NULL if there are no uses.
- MachineOperand *lastRegisterUse(unsigned Start, unsigned End, unsigned Reg,
- unsigned &LastUseIdx) const;
-
- void printRegName(unsigned reg) const;
- };
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/lib/CodeGen/StrongPHIElimination.cpp b/release_23/lib/CodeGen/StrongPHIElimination.cpp
deleted file mode 100644
index a632da6de09c..000000000000
--- a/release_23/lib/CodeGen/StrongPHIElimination.cpp
+++ /dev/null
@@ -1,920 +0,0 @@
-//===- StrongPhiElimination.cpp - Eliminate PHI nodes by inserting copies -===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This pass eliminates machine instruction PHI nodes by inserting copy
-// instructions, using an intelligent copy-folding technique based on
-// dominator information. This is technique is derived from:
-//
-// Budimlic, et al. Fast copy coalescing and live-range identification.
-// In Proceedings of the ACM SIGPLAN 2002 Conference on Programming Language
-// Design and Implementation (Berlin, Germany, June 17 - 19, 2002).
-// PLDI '02. ACM, New York, NY, 25-32.
-// DOI= http://doi.acm.org/10.1145/512529.512534
-//
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "strongphielim"
-#include "llvm/CodeGen/Passes.h"
-#include "llvm/CodeGen/LiveIntervalAnalysis.h"
-#include "llvm/CodeGen/MachineDominators.h"
-#include "llvm/CodeGen/MachineFunctionPass.h"
-#include "llvm/CodeGen/MachineInstr.h"
-#include "llvm/CodeGen/MachineLoopInfo.h"
-#include "llvm/CodeGen/MachineRegisterInfo.h"
-#include "llvm/Target/TargetInstrInfo.h"
-#include "llvm/Target/TargetMachine.h"
-#include "llvm/ADT/DepthFirstIterator.h"
-#include "llvm/ADT/Statistic.h"
-#include "llvm/Support/Compiler.h"
-using namespace llvm;
-
-
-namespace {
- struct VISIBILITY_HIDDEN StrongPHIElimination : public MachineFunctionPass {
- static char ID; // Pass identification, replacement for typeid
- StrongPHIElimination() : MachineFunctionPass((intptr_t)&ID) {}
-
- // Waiting stores, for each MBB, the set of copies that need to
- // be inserted into that MBB
- DenseMap<MachineBasicBlock*,
- std::map<unsigned, unsigned> > Waiting;
-
- // Stacks holds the renaming stack for each register
- std::map<unsigned, std::vector<unsigned> > Stacks;
-
- // Registers in UsedByAnother are PHI nodes that are themselves
- // used as operands to another another PHI node
- std::set<unsigned> UsedByAnother;
-
- // RenameSets are the sets of operands (and their VNInfo IDs) to a PHI
- // (the defining instruction of the key) that can be renamed without copies.
- std::map<unsigned, std::map<unsigned, unsigned> > RenameSets;
-
- // PhiValueNumber holds the ID numbers of the VNs for each phi that we're
- // eliminating, indexed by the register defined by that phi.
- std::map<unsigned, unsigned> PhiValueNumber;
-
- // Store the DFS-in number of each block
- DenseMap<MachineBasicBlock*, unsigned> preorder;
-
- // Store the DFS-out number of each block
- DenseMap<MachineBasicBlock*, unsigned> maxpreorder;
-
- bool runOnMachineFunction(MachineFunction &Fn);
-
- virtual void getAnalysisUsage(AnalysisUsage &AU) const {
- AU.addRequired<MachineDominatorTree>();
- AU.addRequired<LiveIntervals>();
-
- // TODO: Actually make this true.
- AU.addPreserved<LiveIntervals>();
- MachineFunctionPass::getAnalysisUsage(AU);
- }
-
- virtual void releaseMemory() {
- preorder.clear();
- maxpreorder.clear();
-
- Waiting.clear();
- Stacks.clear();
- UsedByAnother.clear();
- RenameSets.clear();
- }
-
- private:
-
- /// DomForestNode - Represents a node in the "dominator forest". This is
- /// a forest in which the nodes represent registers and the edges
- /// represent a dominance relation in the block defining those registers.
- struct DomForestNode {
- private:
- // Store references to our children
- std::vector<DomForestNode*> children;
- // The register we represent
- unsigned reg;
-
- // Add another node as our child
- void addChild(DomForestNode* DFN) { children.push_back(DFN); }
-
- public:
- typedef std::vector<DomForestNode*>::iterator iterator;
-
- // Create a DomForestNode by providing the register it represents, and
- // the node to be its parent. The virtual root node has register 0
- // and a null parent.
- DomForestNode(unsigned r, DomForestNode* parent) : reg(r) {
- if (parent)
- parent->addChild(this);
- }
-
- ~DomForestNode() {
- for (iterator I = begin(), E = end(); I != E; ++I)
- delete *I;
- }
-
- /// getReg - Return the regiser that this node represents
- inline unsigned getReg() { return reg; }
-
- // Provide iterator access to our children
- inline DomForestNode::iterator begin() { return children.begin(); }
- inline DomForestNode::iterator end() { return children.end(); }
- };
-
- void computeDFS(MachineFunction& MF);
- void processBlock(MachineBasicBlock* MBB);
-
- std::vector<DomForestNode*> computeDomForest(std::map<unsigned, unsigned>& instrs,
- MachineRegisterInfo& MRI);
- void processPHIUnion(MachineInstr* Inst,
- std::map<unsigned, unsigned>& PHIUnion,
- std::vector<StrongPHIElimination::DomForestNode*>& DF,
- std::vector<std::pair<unsigned, unsigned> >& locals);
- void ScheduleCopies(MachineBasicBlock* MBB, std::set<unsigned>& pushed);
- void InsertCopies(MachineBasicBlock* MBB,
- SmallPtrSet<MachineBasicBlock*, 16>& v);
- void mergeLiveIntervals(unsigned primary, unsigned secondary, unsigned VN);
- };
-
- char StrongPHIElimination::ID = 0;
- RegisterPass<StrongPHIElimination> X("strong-phi-node-elimination",
- "Eliminate PHI nodes for register allocation, intelligently");
-}
-
-const PassInfo *llvm::StrongPHIEliminationID = X.getPassInfo();
-
-/// computeDFS - Computes the DFS-in and DFS-out numbers of the dominator tree
-/// of the given MachineFunction. These numbers are then used in other parts
-/// of the PHI elimination process.
-void StrongPHIElimination::computeDFS(MachineFunction& MF) {
- SmallPtrSet<MachineDomTreeNode*, 8> frontier;
- SmallPtrSet<MachineDomTreeNode*, 8> visited;
-
- unsigned time = 0;
-
- MachineDominatorTree& DT = getAnalysis<MachineDominatorTree>();
-
- MachineDomTreeNode* node = DT.getRootNode();
-
- std::vector<MachineDomTreeNode*> worklist;
- worklist.push_back(node);
-
- while (!worklist.empty()) {
- MachineDomTreeNode* currNode = worklist.back();
-
- if (!frontier.count(currNode)) {
- frontier.insert(currNode);
- ++time;
- preorder.insert(std::make_pair(currNode->getBlock(), time));
- }
-
- bool inserted = false;
- for (MachineDomTreeNode::iterator I = currNode->begin(), E = currNode->end();
- I != E; ++I)
- if (!frontier.count(*I) && !visited.count(*I)) {
- worklist.push_back(*I);
- inserted = true;
- break;
- }
-
- if (!inserted) {
- frontier.erase(currNode);
- visited.insert(currNode);
- maxpreorder.insert(std::make_pair(currNode->getBlock(), time));
-
- worklist.pop_back();
- }
- }
-}
-
-/// PreorderSorter - a helper class that is used to sort registers
-/// according to the preorder number of their defining blocks
-class PreorderSorter {
-private:
- DenseMap<MachineBasicBlock*, unsigned>& preorder;
- MachineRegisterInfo& MRI;
-
-public:
- PreorderSorter(DenseMap<MachineBasicBlock*, unsigned>& p,
- MachineRegisterInfo& M) : preorder(p), MRI(M) { }
-
- bool operator()(unsigned A, unsigned B) {
- if (A == B)
- return false;
-
- MachineBasicBlock* ABlock = MRI.getVRegDef(A)->getParent();
- MachineBasicBlock* BBlock = MRI.getVRegDef(B)->getParent();
-
- if (preorder[ABlock] < preorder[BBlock])
- return true;
- else if (preorder[ABlock] > preorder[BBlock])
- return false;
-
- return false;
- }
-};
-
-/// computeDomForest - compute the subforest of the DomTree corresponding
-/// to the defining blocks of the registers in question
-std::vector<StrongPHIElimination::DomForestNode*>
-StrongPHIElimination::computeDomForest(std::map<unsigned, unsigned>& regs,
- MachineRegisterInfo& MRI) {
- // Begin by creating a virtual root node, since the actual results
- // may well be a forest. Assume this node has maximum DFS-out number.
- DomForestNode* VirtualRoot = new DomForestNode(0, 0);
- maxpreorder.insert(std::make_pair((MachineBasicBlock*)0, ~0UL));
-
- // Populate a worklist with the registers
- std::vector<unsigned> worklist;
- worklist.reserve(regs.size());
- for (std::map<unsigned, unsigned>::iterator I = regs.begin(), E = regs.end();
- I != E; ++I)
- worklist.push_back(I->first);
-
- // Sort the registers by the DFS-in number of their defining block
- PreorderSorter PS(preorder, MRI);
- std::sort(worklist.begin(), worklist.end(), PS);
-
- // Create a "current parent" stack, and put the virtual root on top of it
- DomForestNode* CurrentParent = VirtualRoot;
- std::vector<DomForestNode*> stack;
- stack.push_back(VirtualRoot);
-
- // Iterate over all the registers in the previously computed order
- for (std::vector<unsigned>::iterator I = worklist.begin(), E = worklist.end();
- I != E; ++I) {
- unsigned pre = preorder[MRI.getVRegDef(*I)->getParent()];
- MachineBasicBlock* parentBlock = CurrentParent->getReg() ?
- MRI.getVRegDef(CurrentParent->getReg())->getParent() :
- 0;
-
- // If the DFS-in number of the register is greater than the DFS-out number
- // of the current parent, repeatedly pop the parent stack until it isn't.
- while (pre > maxpreorder[parentBlock]) {
- stack.pop_back();
- CurrentParent = stack.back();
-
- parentBlock = CurrentParent->getReg() ?
- MRI.getVRegDef(CurrentParent->getReg())->getParent() :
- 0;
- }
-
- // Now that we've found the appropriate parent, create a DomForestNode for
- // this register and attach it to the forest
- DomForestNode* child = new DomForestNode(*I, CurrentParent);
-
- // Push this new node on the "current parent" stack
- stack.push_back(child);
- CurrentParent = child;
- }
-
- // Return a vector containing the children of the virtual root node
- std::vector<DomForestNode*> ret;
- ret.insert(ret.end(), VirtualRoot->begin(), VirtualRoot->end());
- return ret;
-}
-
-/// isLiveIn - helper method that determines, from a regno, if a register
-/// is live into a block
-static bool isLiveIn(unsigned r, MachineBasicBlock* MBB,
- LiveIntervals& LI) {
- LiveInterval& I = LI.getOrCreateInterval(r);
- unsigned idx = LI.getMBBStartIdx(MBB);
- return I.liveBeforeAndAt(idx);
-}
-
-/// isLiveOut - help method that determines, from a regno, if a register is
-/// live out of a block.
-static bool isLiveOut(unsigned r, MachineBasicBlock* MBB,
- LiveIntervals& LI) {
- for (MachineBasicBlock::succ_iterator PI = MBB->succ_begin(),
- E = MBB->succ_end(); PI != E; ++PI) {
- if (isLiveIn(r, *PI, LI))
- return true;
- }
-
- return false;
-}
-
-/// interferes - checks for local interferences by scanning a block. The only
-/// trick parameter is 'mode' which tells it the relationship of the two
-/// registers. 0 - defined in the same block, 1 - first properly dominates
-/// second, 2 - second properly dominates first
-static bool interferes(unsigned a, unsigned b, MachineBasicBlock* scan,
- LiveIntervals& LV, unsigned mode) {
- MachineInstr* def = 0;
- MachineInstr* kill = 0;
-
- // The code is still in SSA form at this point, so there is only one
- // definition per VReg. Thus we can safely use MRI->getVRegDef().
- const MachineRegisterInfo* MRI = &scan->getParent()->getRegInfo();
-
- bool interference = false;
-
- // Wallk the block, checking for interferences
- for (MachineBasicBlock::iterator MBI = scan->begin(), MBE = scan->end();
- MBI != MBE; ++MBI) {
- MachineInstr* curr = MBI;
-
- // Same defining block...
- if (mode == 0) {
- if (curr == MRI->getVRegDef(a)) {
- // If we find our first definition, save it
- if (!def) {
- def = curr;
- // If there's already an unkilled definition, then
- // this is an interference
- } else if (!kill) {
- interference = true;
- break;
- // If there's a definition followed by a KillInst, then
- // they can't interfere
- } else {
- interference = false;
- break;
- }
- // Symmetric with the above
- } else if (curr == MRI->getVRegDef(b)) {
- if (!def) {
- def = curr;
- } else if (!kill) {
- interference = true;
- break;
- } else {
- interference = false;
- break;
- }
- // Store KillInsts if they match up with the definition
- } else if (curr->killsRegister(a)) {
- if (def == MRI->getVRegDef(a)) {
- kill = curr;
- } else if (curr->killsRegister(b)) {
- if (def == MRI->getVRegDef(b)) {
- kill = curr;
- }
- }
- }
- // First properly dominates second...
- } else if (mode == 1) {
- if (curr == MRI->getVRegDef(b)) {
- // Definition of second without kill of first is an interference
- if (!kill) {
- interference = true;
- break;
- // Definition after a kill is a non-interference
- } else {
- interference = false;
- break;
- }
- // Save KillInsts of First
- } else if (curr->killsRegister(a)) {
- kill = curr;
- }
- // Symmetric with the above
- } else if (mode == 2) {
- if (curr == MRI->getVRegDef(a)) {
- if (!kill) {
- interference = true;
- break;
- } else {
- interference = false;
- break;
- }
- } else if (curr->killsRegister(b)) {
- kill = curr;
- }
- }
- }
-
- return interference;
-}
-
-/// processBlock - Determine how to break up PHIs in the current block. Each
-/// PHI is broken up by some combination of renaming its operands and inserting
-/// copies. This method is responsible for determining which operands receive
-/// which treatment.
-void StrongPHIElimination::processBlock(MachineBasicBlock* MBB) {
- LiveIntervals& LI = getAnalysis<LiveIntervals>();
- MachineRegisterInfo& MRI = MBB->getParent()->getRegInfo();
-
- // Holds names that have been added to a set in any PHI within this block
- // before the current one.
- std::set<unsigned> ProcessedNames;
-
- // Iterate over all the PHI nodes in this block
- MachineBasicBlock::iterator P = MBB->begin();
- while (P != MBB->end() && P->getOpcode() == TargetInstrInfo::PHI) {
- unsigned DestReg = P->getOperand(0).getReg();
-
- // Don't both doing PHI elimination for dead PHI's.
- if (P->registerDefIsDead(DestReg)) {
- ++P;
- continue;
- }
-
- LiveInterval& PI = LI.getOrCreateInterval(DestReg);
- unsigned pIdx = LI.getDefIndex(LI.getInstructionIndex(P));
- VNInfo* PVN = PI.getLiveRangeContaining(pIdx)->valno;
- PhiValueNumber.insert(std::make_pair(DestReg, PVN->id));
-
- // PHIUnion is the set of incoming registers to the PHI node that
- // are going to be renames rather than having copies inserted. This set
- // is refinded over the course of this function. UnionedBlocks is the set
- // of corresponding MBBs.
- std::map<unsigned, unsigned> PHIUnion;
- SmallPtrSet<MachineBasicBlock*, 8> UnionedBlocks;
-
- // Iterate over the operands of the PHI node
- for (int i = P->getNumOperands() - 1; i >= 2; i-=2) {
- unsigned SrcReg = P->getOperand(i-1).getReg();
-
- // Check for trivial interferences via liveness information, allowing us
- // to avoid extra work later. Any registers that interfere cannot both
- // be in the renaming set, so choose one and add copies for it instead.
- // The conditions are:
- // 1) if the operand is live into the PHI node's block OR
- // 2) if the PHI node is live out of the operand's defining block OR
- // 3) if the operand is itself a PHI node and the original PHI is
- // live into the operand's defining block OR
- // 4) if the operand is already being renamed for another PHI node
- // in this block OR
- // 5) if any two operands are defined in the same block, insert copies
- // for one of them
- if (isLiveIn(SrcReg, P->getParent(), LI) ||
- isLiveOut(P->getOperand(0).getReg(),
- MRI.getVRegDef(SrcReg)->getParent(), LI) ||
- ( MRI.getVRegDef(SrcReg)->getOpcode() == TargetInstrInfo::PHI &&
- isLiveIn(P->getOperand(0).getReg(),
- MRI.getVRegDef(SrcReg)->getParent(), LI) ) ||
- ProcessedNames.count(SrcReg) ||
- UnionedBlocks.count(MRI.getVRegDef(SrcReg)->getParent())) {
-
- // Add a copy for the selected register
- MachineBasicBlock* From = P->getOperand(i).getMBB();
- Waiting[From].insert(std::make_pair(SrcReg, DestReg));
- UsedByAnother.insert(SrcReg);
- } else {
- // Otherwise, add it to the renaming set
- LiveInterval& I = LI.getOrCreateInterval(SrcReg);
- unsigned idx = LI.getMBBEndIdx(P->getOperand(i).getMBB());
- VNInfo* VN = I.getLiveRangeContaining(idx)->valno;
-
- assert(VN && "No VNInfo for register?");
-
- PHIUnion.insert(std::make_pair(SrcReg, VN->id));
- UnionedBlocks.insert(MRI.getVRegDef(SrcReg)->getParent());
- }
- }
-
- // Compute the dominator forest for the renaming set. This is a forest
- // where the nodes are the registers and the edges represent dominance
- // relations between the defining blocks of the registers
- std::vector<StrongPHIElimination::DomForestNode*> DF =
- computeDomForest(PHIUnion, MRI);
-
- // Walk DomForest to resolve interferences at an inter-block level. This
- // will remove registers from the renaming set (and insert copies for them)
- // if interferences are found.
- std::vector<std::pair<unsigned, unsigned> > localInterferences;
- processPHIUnion(P, PHIUnion, DF, localInterferences);
-
- // If one of the inputs is defined in the same block as the current PHI
- // then we need to check for a local interference between that input and
- // the PHI.
- for (std::map<unsigned, unsigned>::iterator I = PHIUnion.begin(),
- E = PHIUnion.end(); I != E; ++I)
- if (MRI.getVRegDef(I->first)->getParent() == P->getParent())
- localInterferences.push_back(std::make_pair(I->first,
- P->getOperand(0).getReg()));
-
- // The dominator forest walk may have returned some register pairs whose
- // interference cannot be determined from dominator analysis. We now
- // examine these pairs for local interferences.
- for (std::vector<std::pair<unsigned, unsigned> >::iterator I =
- localInterferences.begin(), E = localInterferences.end(); I != E; ++I) {
- std::pair<unsigned, unsigned> p = *I;
-
- MachineDominatorTree& MDT = getAnalysis<MachineDominatorTree>();
-
- // Determine the block we need to scan and the relationship between
- // the two registers
- MachineBasicBlock* scan = 0;
- unsigned mode = 0;
- if (MRI.getVRegDef(p.first)->getParent() ==
- MRI.getVRegDef(p.second)->getParent()) {
- scan = MRI.getVRegDef(p.first)->getParent();
- mode = 0; // Same block
- } else if (MDT.dominates(MRI.getVRegDef(p.first)->getParent(),
- MRI.getVRegDef(p.second)->getParent())) {
- scan = MRI.getVRegDef(p.second)->getParent();
- mode = 1; // First dominates second
- } else {
- scan = MRI.getVRegDef(p.first)->getParent();
- mode = 2; // Second dominates first
- }
-
- // If there's an interference, we need to insert copies
- if (interferes(p.first, p.second, scan, LI, mode)) {
- // Insert copies for First
- for (int i = P->getNumOperands() - 1; i >= 2; i-=2) {
- if (P->getOperand(i-1).getReg() == p.first) {
- unsigned SrcReg = p.first;
- MachineBasicBlock* From = P->getOperand(i).getMBB();
-
- Waiting[From].insert(std::make_pair(SrcReg,
- P->getOperand(0).getReg()));
- UsedByAnother.insert(SrcReg);
-
- PHIUnion.erase(SrcReg);
- }
- }
- }
- }
-
- // Add the renaming set for this PHI node to our overall renaming information
- RenameSets.insert(std::make_pair(P->getOperand(0).getReg(), PHIUnion));
-
- // Remember which registers are already renamed, so that we don't try to
- // rename them for another PHI node in this block
- for (std::map<unsigned, unsigned>::iterator I = PHIUnion.begin(),
- E = PHIUnion.end(); I != E; ++I)
- ProcessedNames.insert(I->first);
-
- ++P;
- }
-}
-
-/// processPHIUnion - Take a set of candidate registers to be coalesced when
-/// decomposing the PHI instruction. Use the DominanceForest to remove the ones
-/// that are known to interfere, and flag others that need to be checked for
-/// local interferences.
-void StrongPHIElimination::processPHIUnion(MachineInstr* Inst,
- std::map<unsigned, unsigned>& PHIUnion,
- std::vector<StrongPHIElimination::DomForestNode*>& DF,
- std::vector<std::pair<unsigned, unsigned> >& locals) {
-
- std::vector<DomForestNode*> worklist(DF.begin(), DF.end());
- SmallPtrSet<DomForestNode*, 4> visited;
-
- // Code is still in SSA form, so we can use MRI::getVRegDef()
- MachineRegisterInfo& MRI = Inst->getParent()->getParent()->getRegInfo();
-
- LiveIntervals& LI = getAnalysis<LiveIntervals>();
- unsigned DestReg = Inst->getOperand(0).getReg();
-
- // DF walk on the DomForest
- while (!worklist.empty()) {
- DomForestNode* DFNode = worklist.back();
-
- visited.insert(DFNode);
-
- bool inserted = false;
- for (DomForestNode::iterator CI = DFNode->begin(), CE = DFNode->end();
- CI != CE; ++CI) {
- DomForestNode* child = *CI;
-
- // If the current node is live-out of the defining block of one of its
- // children, insert a copy for it. NOTE: The paper actually calls for
- // a more elaborate heuristic for determining whether to insert copies
- // for the child or the parent. In the interest of simplicity, we're
- // just always choosing the parent.
- if (isLiveOut(DFNode->getReg(),
- MRI.getVRegDef(child->getReg())->getParent(), LI)) {
- // Insert copies for parent
- for (int i = Inst->getNumOperands() - 1; i >= 2; i-=2) {
- if (Inst->getOperand(i-1).getReg() == DFNode->getReg()) {
- unsigned SrcReg = DFNode->getReg();
- MachineBasicBlock* From = Inst->getOperand(i).getMBB();
-
- Waiting[From].insert(std::make_pair(SrcReg, DestReg));
- UsedByAnother.insert(SrcReg);
-
- PHIUnion.erase(SrcReg);
- }
- }
-
- // If a node is live-in to the defining block of one of its children, but
- // not live-out, then we need to scan that block for local interferences.
- } else if (isLiveIn(DFNode->getReg(),
- MRI.getVRegDef(child->getReg())->getParent(), LI) ||
- MRI.getVRegDef(DFNode->getReg())->getParent() ==
- MRI.getVRegDef(child->getReg())->getParent()) {
- // Add (p, c) to possible local interferences
- locals.push_back(std::make_pair(DFNode->getReg(), child->getReg()));
- }
-
- if (!visited.count(child)) {
- worklist.push_back(child);
- inserted = true;
- }
- }
-
- if (!inserted) worklist.pop_back();
- }
-}
-
-/// ScheduleCopies - Insert copies into predecessor blocks, scheduling
-/// them properly so as to avoid the 'lost copy' and the 'virtual swap'
-/// problems.
-///
-/// Based on "Practical Improvements to the Construction and Destruction
-/// of Static Single Assignment Form" by Briggs, et al.
-void StrongPHIElimination::ScheduleCopies(MachineBasicBlock* MBB,
- std::set<unsigned>& pushed) {
- // FIXME: This function needs to update LiveVariables
- std::map<unsigned, unsigned>& copy_set= Waiting[MBB];
-
- std::map<unsigned, unsigned> worklist;
- std::map<unsigned, unsigned> map;
-
- // Setup worklist of initial copies
- for (std::map<unsigned, unsigned>::iterator I = copy_set.begin(),
- E = copy_set.end(); I != E; ) {
- map.insert(std::make_pair(I->first, I->first));
- map.insert(std::make_pair(I->second, I->second));
-
- if (!UsedByAnother.count(I->second)) {
- worklist.insert(*I);
-
- // Avoid iterator invalidation
- unsigned first = I->first;
- ++I;
- copy_set.erase(first);
- } else {
- ++I;
- }
- }
-
- LiveIntervals& LI = getAnalysis<LiveIntervals>();
- MachineFunction* MF = MBB->getParent();
- MachineRegisterInfo& MRI = MF->getRegInfo();
- const TargetInstrInfo *TII = MF->getTarget().getInstrInfo();
-
- // Iterate over the worklist, inserting copies
- while (!worklist.empty() || !copy_set.empty()) {
- while (!worklist.empty()) {
- std::pair<unsigned, unsigned> curr = *worklist.begin();
- worklist.erase(curr.first);
-
- const TargetRegisterClass *RC = MF->getRegInfo().getRegClass(curr.first);
-
- if (isLiveOut(curr.second, MBB, LI)) {
- // Create a temporary
- unsigned t = MF->getRegInfo().createVirtualRegister(RC);
-
- // Insert copy from curr.second to a temporary at
- // the Phi defining curr.second
- MachineBasicBlock::iterator PI = MRI.getVRegDef(curr.second);
- TII->copyRegToReg(*PI->getParent(), PI, t,
- curr.second, RC, RC);
-
- // Push temporary on Stacks
- Stacks[curr.second].push_back(t);
-
- // Insert curr.second in pushed
- pushed.insert(curr.second);
- }
-
- // Insert copy from map[curr.first] to curr.second
- TII->copyRegToReg(*MBB, MBB->getFirstTerminator(), curr.second,
- map[curr.first], RC, RC);
- map[curr.first] = curr.second;
-
- // If curr.first is a destination in copy_set...
- for (std::map<unsigned, unsigned>::iterator I = copy_set.begin(),
- E = copy_set.end(); I != E; )
- if (curr.first == I->second) {
- std::pair<unsigned, unsigned> temp = *I;
-
- // Avoid iterator invalidation
- ++I;
- copy_set.erase(temp.first);
- worklist.insert(temp);
-
- break;
- } else {
- ++I;
- }
- }
-
- if (!copy_set.empty()) {
- std::pair<unsigned, unsigned> curr = *copy_set.begin();
- copy_set.erase(curr.first);
-
- const TargetRegisterClass *RC = MF->getRegInfo().getRegClass(curr.first);
-
- // Insert a copy from dest to a new temporary t at the end of b
- unsigned t = MF->getRegInfo().createVirtualRegister(RC);
- TII->copyRegToReg(*MBB, MBB->getFirstTerminator(), t,
- curr.second, RC, RC);
- map[curr.second] = t;
-
- worklist.insert(curr);
- }
- }
-}
-
-/// InsertCopies - insert copies into MBB and all of its successors
-void StrongPHIElimination::InsertCopies(MachineBasicBlock* MBB,
- SmallPtrSet<MachineBasicBlock*, 16>& visited) {
- visited.insert(MBB);
-
- std::set<unsigned> pushed;
-
- // Rewrite register uses from Stacks
- for (MachineBasicBlock::iterator I = MBB->begin(), E = MBB->end();
- I != E; ++I)
- for (unsigned i = 0; i < I->getNumOperands(); ++i)
- if (I->getOperand(i).isRegister() &&
- Stacks[I->getOperand(i).getReg()].size()) {
- I->getOperand(i).setReg(Stacks[I->getOperand(i).getReg()].back());
- }
-
- // Schedule the copies for this block
- ScheduleCopies(MBB, pushed);
-
- // Recur to our successors
- for (GraphTraits<MachineBasicBlock*>::ChildIteratorType I =
- GraphTraits<MachineBasicBlock*>::child_begin(MBB), E =
- GraphTraits<MachineBasicBlock*>::child_end(MBB); I != E; ++I)
- if (!visited.count(*I))
- InsertCopies(*I, visited);
-
- // As we exit this block, pop the names we pushed while processing it
- for (std::set<unsigned>::iterator I = pushed.begin(),
- E = pushed.end(); I != E; ++I)
- Stacks[*I].pop_back();
-}
-
-/// ComputeUltimateVN - Assuming we are going to join two live intervals,
-/// compute what the resultant value numbers for each value in the input two
-/// ranges will be. This is complicated by copies between the two which can
-/// and will commonly cause multiple value numbers to be merged into one.
-///
-/// VN is the value number that we're trying to resolve. InstDefiningValue
-/// keeps track of the new InstDefiningValue assignment for the result
-/// LiveInterval. ThisFromOther/OtherFromThis are sets that keep track of
-/// whether a value in this or other is a copy from the opposite set.
-/// ThisValNoAssignments/OtherValNoAssignments keep track of value #'s that have
-/// already been assigned.
-///
-/// ThisFromOther[x] - If x is defined as a copy from the other interval, this
-/// contains the value number the copy is from.
-///
-static unsigned ComputeUltimateVN(VNInfo *VNI,
- SmallVector<VNInfo*, 16> &NewVNInfo,
- DenseMap<VNInfo*, VNInfo*> &ThisFromOther,
- DenseMap<VNInfo*, VNInfo*> &OtherFromThis,
- SmallVector<int, 16> &ThisValNoAssignments,
- SmallVector<int, 16> &OtherValNoAssignments) {
- unsigned VN = VNI->id;
-
- // If the VN has already been computed, just return it.
- if (ThisValNoAssignments[VN] >= 0)
- return ThisValNoAssignments[VN];
-// assert(ThisValNoAssignments[VN] != -2 && "Cyclic case?");
-
- // If this val is not a copy from the other val, then it must be a new value
- // number in the destination.
- DenseMap<VNInfo*, VNInfo*>::iterator I = ThisFromOther.find(VNI);
- if (I == ThisFromOther.end()) {
- NewVNInfo.push_back(VNI);
- return ThisValNoAssignments[VN] = NewVNInfo.size()-1;
- }
- VNInfo *OtherValNo = I->second;
-
- // Otherwise, this *is* a copy from the RHS. If the other side has already
- // been computed, return it.
- if (OtherValNoAssignments[OtherValNo->id] >= 0)
- return ThisValNoAssignments[VN] = OtherValNoAssignments[OtherValNo->id];
-
- // Mark this value number as currently being computed, then ask what the
- // ultimate value # of the other value is.
- ThisValNoAssignments[VN] = -2;
- unsigned UltimateVN =
- ComputeUltimateVN(OtherValNo, NewVNInfo, OtherFromThis, ThisFromOther,
- OtherValNoAssignments, ThisValNoAssignments);
- return ThisValNoAssignments[VN] = UltimateVN;
-}
-
-void StrongPHIElimination::mergeLiveIntervals(unsigned primary,
- unsigned secondary,
- unsigned secondaryVN) {
-
- LiveIntervals& LI = getAnalysis<LiveIntervals>();
- LiveInterval& LHS = LI.getOrCreateInterval(primary);
- LiveInterval& RHS = LI.getOrCreateInterval(secondary);
-
- // Compute the final value assignment, assuming that the live ranges can be
- // coalesced.
- SmallVector<int, 16> LHSValNoAssignments;
- SmallVector<int, 16> RHSValNoAssignments;
- SmallVector<VNInfo*, 16> NewVNInfo;
-
- LHSValNoAssignments.resize(LHS.getNumValNums(), -1);
- RHSValNoAssignments.resize(RHS.getNumValNums(), -1);
- NewVNInfo.reserve(LHS.getNumValNums() + RHS.getNumValNums());
-
- for (LiveInterval::vni_iterator I = LHS.vni_begin(), E = LHS.vni_end();
- I != E; ++I) {
- VNInfo *VNI = *I;
- unsigned VN = VNI->id;
- if (LHSValNoAssignments[VN] >= 0 || VNI->def == ~1U)
- continue;
-
- NewVNInfo.push_back(VNI);
- LHSValNoAssignments[VN] = NewVNInfo.size()-1;
- }
-
- for (LiveInterval::vni_iterator I = RHS.vni_begin(), E = RHS.vni_end();
- I != E; ++I) {
- VNInfo *VNI = *I;
- unsigned VN = VNI->id;
- if (RHSValNoAssignments[VN] >= 0 || VNI->def == ~1U)
- continue;
-
- NewVNInfo.push_back(VNI);
- RHSValNoAssignments[VN] = NewVNInfo.size()-1;
- }
-
- // If we get here, we know that we can coalesce the live ranges. Ask the
- // intervals to coalesce themselves now.
-
- LHS.join(RHS, &LHSValNoAssignments[0], &RHSValNoAssignments[0], NewVNInfo);
- LI.removeInterval(secondary);
-
- // The valno that was previously the input to the PHI node
- // now has a PHIKill.
- LHS.getValNumInfo(RHSValNoAssignments[secondaryVN])->hasPHIKill = true;
-}
-
-bool StrongPHIElimination::runOnMachineFunction(MachineFunction &Fn) {
- LiveIntervals& LI = getAnalysis<LiveIntervals>();
-
- // Compute DFS numbers of each block
- computeDFS(Fn);
-
- // Determine which phi node operands need copies
- for (MachineFunction::iterator I = Fn.begin(), E = Fn.end(); I != E; ++I)
- if (!I->empty() &&
- I->begin()->getOpcode() == TargetInstrInfo::PHI)
- processBlock(I);
-
- // Insert copies
- // FIXME: This process should probably preserve LiveVariables
- SmallPtrSet<MachineBasicBlock*, 16> visited;
- InsertCopies(Fn.begin(), visited);
-
- // Perform renaming
- typedef std::map<unsigned, std::map<unsigned, unsigned> > RenameSetType;
- for (RenameSetType::iterator I = RenameSets.begin(), E = RenameSets.end();
- I != E; ++I)
- for (std::map<unsigned, unsigned>::iterator SI = I->second.begin(),
- SE = I->second.end(); SI != SE; ++SI) {
- mergeLiveIntervals(I->first, SI->first, SI->second);
- Fn.getRegInfo().replaceRegWith(SI->first, I->first);
- }
-
- // FIXME: Insert last-minute copies
-
- // Remove PHIs
- std::vector<MachineInstr*> phis;
- for (MachineFunction::iterator I = Fn.begin(), E = Fn.end(); I != E; ++I) {
- for (MachineBasicBlock::iterator BI = I->begin(), BE = I->end();
- BI != BE; ++BI)
- if (BI->getOpcode() == TargetInstrInfo::PHI)
- phis.push_back(BI);
- }
-
- for (std::vector<MachineInstr*>::iterator I = phis.begin(), E = phis.end();
- I != E; ) {
- MachineInstr* PInstr = *(I++);
-
- // If this is a dead PHI node, then remove it from LiveIntervals.
- unsigned DestReg = PInstr->getOperand(0).getReg();
- LiveInterval& PI = LI.getInterval(DestReg);
- if (PInstr->registerDefIsDead(DestReg)) {
- if (PI.containsOneValue()) {
- LI.removeInterval(DestReg);
- } else {
- unsigned idx = LI.getDefIndex(LI.getInstructionIndex(PInstr));
- PI.removeRange(*PI.getLiveRangeContaining(idx), true);
- }
- } else {
- // If the PHI is not dead, then the valno defined by the PHI
- // now has an unknown def.
- unsigned idx = LI.getDefIndex(LI.getInstructionIndex(PInstr));
- PI.getLiveRangeContaining(idx)->valno->def = ~0U;
- }
-
- LI.RemoveMachineInstrFromMaps(PInstr);
- PInstr->eraseFromParent();
- }
-
- return true;
-}
diff --git a/release_23/lib/CodeGen/TargetInstrInfoImpl.cpp b/release_23/lib/CodeGen/TargetInstrInfoImpl.cpp
deleted file mode 100644
index 1bb08ab93bb2..000000000000
--- a/release_23/lib/CodeGen/TargetInstrInfoImpl.cpp
+++ /dev/null
@@ -1,107 +0,0 @@
-//===-- TargetInstrInfoImpl.cpp - Target Instruction Information ----------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the TargetInstrInfoImpl class, it just provides default
-// implementations of various methods.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Target/TargetInstrInfo.h"
-#include "llvm/CodeGen/MachineInstr.h"
-using namespace llvm;
-
-// commuteInstruction - The default implementation of this method just exchanges
-// operand 1 and 2.
-MachineInstr *TargetInstrInfoImpl::commuteInstruction(MachineInstr *MI) const {
- assert(MI->getOperand(1).isRegister() && MI->getOperand(2).isRegister() &&
- "This only knows how to commute register operands so far");
- unsigned Reg1 = MI->getOperand(1).getReg();
- unsigned Reg2 = MI->getOperand(2).getReg();
- bool Reg1IsKill = MI->getOperand(1).isKill();
- bool Reg2IsKill = MI->getOperand(2).isKill();
- if (MI->getOperand(0).getReg() == Reg1) {
- // Must be two address instruction!
- assert(MI->getDesc().getOperandConstraint(0, TOI::TIED_TO) &&
- "Expecting a two-address instruction!");
- Reg2IsKill = false;
- MI->getOperand(0).setReg(Reg2);
- }
- MI->getOperand(2).setReg(Reg1);
- MI->getOperand(1).setReg(Reg2);
- MI->getOperand(2).setIsKill(Reg1IsKill);
- MI->getOperand(1).setIsKill(Reg2IsKill);
- return MI;
-}
-
-/// CommuteChangesDestination - Return true if commuting the specified
-/// instruction will also changes the destination operand. Also return the
-/// current operand index of the would be new destination register by
-/// reference. This can happen when the commutable instruction is also a
-/// two-address instruction.
-bool TargetInstrInfoImpl::CommuteChangesDestination(MachineInstr *MI,
- unsigned &OpIdx) const{
- assert(MI->getOperand(1).isRegister() && MI->getOperand(2).isRegister() &&
- "This only knows how to commute register operands so far");
- if (MI->getOperand(0).getReg() == MI->getOperand(1).getReg()) {
- // Must be two address instruction!
- assert(MI->getDesc().getOperandConstraint(0, TOI::TIED_TO) &&
- "Expecting a two-address instruction!");
- OpIdx = 2;
- return true;
- }
- return false;
-}
-
-
-bool TargetInstrInfoImpl::PredicateInstruction(MachineInstr *MI,
- const std::vector<MachineOperand> &Pred) const {
- bool MadeChange = false;
- const TargetInstrDesc &TID = MI->getDesc();
- if (!TID.isPredicable())
- return false;
-
- for (unsigned j = 0, i = 0, e = MI->getNumOperands(); i != e; ++i) {
- if (TID.OpInfo[i].isPredicate()) {
- MachineOperand &MO = MI->getOperand(i);
- if (MO.isReg()) {
- MO.setReg(Pred[j].getReg());
- MadeChange = true;
- } else if (MO.isImm()) {
- MO.setImm(Pred[j].getImm());
- MadeChange = true;
- } else if (MO.isMBB()) {
- MO.setMBB(Pred[j].getMBB());
- MadeChange = true;
- }
- ++j;
- }
- }
- return MadeChange;
-}
-
-void TargetInstrInfoImpl::reMaterialize(MachineBasicBlock &MBB,
- MachineBasicBlock::iterator I,
- unsigned DestReg,
- const MachineInstr *Orig) const {
- MachineInstr *MI = Orig->clone();
- MI->getOperand(0).setReg(DestReg);
- MBB.insert(I, MI);
-}
-
-unsigned
-TargetInstrInfoImpl::GetFunctionSizeInBytes(const MachineFunction &MF) const {
- unsigned FnSize = 0;
- for (MachineFunction::const_iterator MBBI = MF.begin(), E = MF.end();
- MBBI != E; ++MBBI) {
- const MachineBasicBlock &MBB = *MBBI;
- for (MachineBasicBlock::const_iterator I = MBB.begin(),E = MBB.end(); I != E; ++I)
- FnSize += GetInstSizeInBytes(I);
- }
- return FnSize;
-}
diff --git a/release_23/lib/CodeGen/TwoAddressInstructionPass.cpp b/release_23/lib/CodeGen/TwoAddressInstructionPass.cpp
deleted file mode 100644
index 5dc1d6998318..000000000000
--- a/release_23/lib/CodeGen/TwoAddressInstructionPass.cpp
+++ /dev/null
@@ -1,361 +0,0 @@
-//===-- TwoAddressInstructionPass.cpp - Two-Address instruction pass ------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the TwoAddress instruction pass which is used
-// by most register allocators. Two-Address instructions are rewritten
-// from:
-//
-// A = B op C
-//
-// to:
-//
-// A = B
-// A op= C
-//
-// Note that if a register allocator chooses to use this pass, that it
-// has to be capable of handling the non-SSA nature of these rewritten
-// virtual registers.
-//
-// It is also worth noting that the duplicate operand of the two
-// address instruction is removed.
-//
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "twoaddrinstr"
-#include "llvm/CodeGen/Passes.h"
-#include "llvm/Function.h"
-#include "llvm/CodeGen/LiveVariables.h"
-#include "llvm/CodeGen/MachineFunctionPass.h"
-#include "llvm/CodeGen/MachineInstr.h"
-#include "llvm/CodeGen/MachineRegisterInfo.h"
-#include "llvm/Target/TargetRegisterInfo.h"
-#include "llvm/Target/TargetInstrInfo.h"
-#include "llvm/Target/TargetMachine.h"
-#include "llvm/Support/Compiler.h"
-#include "llvm/Support/Debug.h"
-#include "llvm/ADT/Statistic.h"
-#include "llvm/ADT/STLExtras.h"
-using namespace llvm;
-
-STATISTIC(NumTwoAddressInstrs, "Number of two-address instructions");
-STATISTIC(NumCommuted , "Number of instructions commuted to coalesce");
-STATISTIC(NumConvertedTo3Addr, "Number of instructions promoted to 3-address");
-STATISTIC(Num3AddrSunk, "Number of 3-address instructions sunk");
-
-namespace {
- class VISIBILITY_HIDDEN TwoAddressInstructionPass
- : public MachineFunctionPass {
- const TargetInstrInfo *TII;
- const TargetRegisterInfo *TRI;
- MachineRegisterInfo *MRI;
- LiveVariables *LV;
-
- bool Sink3AddrInstruction(MachineBasicBlock *MBB, MachineInstr *MI,
- unsigned Reg,
- MachineBasicBlock::iterator OldPos);
- public:
- static char ID; // Pass identification, replacement for typeid
- TwoAddressInstructionPass() : MachineFunctionPass((intptr_t)&ID) {}
-
- virtual void getAnalysisUsage(AnalysisUsage &AU) const {
- AU.addRequired<LiveVariables>();
- AU.addPreserved<LiveVariables>();
- AU.addPreservedID(MachineLoopInfoID);
- AU.addPreservedID(MachineDominatorsID);
- AU.addPreservedID(PHIEliminationID);
- MachineFunctionPass::getAnalysisUsage(AU);
- }
-
- /// runOnMachineFunction - Pass entry point.
- bool runOnMachineFunction(MachineFunction&);
- };
-
- char TwoAddressInstructionPass::ID = 0;
- RegisterPass<TwoAddressInstructionPass>
- X("twoaddressinstruction", "Two-Address instruction pass");
-}
-
-const PassInfo *llvm::TwoAddressInstructionPassID = X.getPassInfo();
-
-/// Sink3AddrInstruction - A two-address instruction has been converted to a
-/// three-address instruction to avoid clobbering a register. Try to sink it
-/// past the instruction that would kill the above mentioned register to reduce
-/// register pressure.
-///
-bool TwoAddressInstructionPass::Sink3AddrInstruction(MachineBasicBlock *MBB,
- MachineInstr *MI, unsigned SavedReg,
- MachineBasicBlock::iterator OldPos) {
- // Check if it's safe to move this instruction.
- bool SeenStore = true; // Be conservative.
- if (!MI->isSafeToMove(TII, SeenStore))
- return false;
-
- unsigned DefReg = 0;
- SmallSet<unsigned, 4> UseRegs;
-
- for (unsigned i = 0, e = MI->getNumOperands(); i != e; ++i) {
- const MachineOperand &MO = MI->getOperand(i);
- if (!MO.isRegister())
- continue;
- unsigned MOReg = MO.getReg();
- if (!MOReg)
- continue;
- if (MO.isUse() && MOReg != SavedReg)
- UseRegs.insert(MO.getReg());
- if (!MO.isDef())
- continue;
- if (MO.isImplicit())
- // Don't try to move it if it implicitly defines a register.
- return false;
- if (DefReg)
- // For now, don't move any instructions that define multiple registers.
- return false;
- DefReg = MO.getReg();
- }
-
- // Find the instruction that kills SavedReg.
- MachineInstr *KillMI = NULL;
-
- for (MachineRegisterInfo::use_iterator UI = MRI->use_begin(SavedReg),
- UE = MRI->use_end(); UI != UE; ++UI) {
- MachineOperand &UseMO = UI.getOperand();
- if (!UseMO.isKill())
- continue;
- KillMI = UseMO.getParent();
- break;
- }
-
- if (!KillMI || KillMI->getParent() != MBB)
- return false;
-
- // If any of the definitions are used by another instruction between the
- // position and the kill use, then it's not safe to sink it.
- //
- // FIXME: This can be sped up if there is an easy way to query whether an
- // instruction if before or after another instruction. Then we can use
- // MachineRegisterInfo def / use instead.
- MachineOperand *KillMO = NULL;
- MachineBasicBlock::iterator KillPos = KillMI;
- ++KillPos;
-
- for (MachineBasicBlock::iterator I = next(OldPos); I != KillPos; ++I) {
- MachineInstr *OtherMI = I;
-
- for (unsigned i = 0, e = OtherMI->getNumOperands(); i != e; ++i) {
- MachineOperand &MO = OtherMI->getOperand(i);
- if (!MO.isRegister())
- continue;
- unsigned MOReg = MO.getReg();
- if (!MOReg)
- continue;
- if (DefReg == MOReg)
- return false;
-
- if (MO.isKill()) {
- if (OtherMI == KillMI && MOReg == SavedReg)
- // Save the operand that kills the register. We want unset the kill
- // marker is we can sink MI past it.
- KillMO = &MO;
- else if (UseRegs.count(MOReg))
- // One of the uses is killed before the destination.
- return false;
- }
- }
- }
-
- // Update kill and LV information.
- KillMO->setIsKill(false);
- KillMO = MI->findRegisterUseOperand(SavedReg, false, TRI);
- KillMO->setIsKill(true);
- LiveVariables::VarInfo& VarInfo = LV->getVarInfo(SavedReg);
- VarInfo.removeKill(KillMI);
- VarInfo.Kills.push_back(MI);
-
- // Move instruction to its destination.
- MBB->remove(MI);
- MBB->insert(KillPos, MI);
-
- ++Num3AddrSunk;
- return true;
-}
-
-/// runOnMachineFunction - Reduce two-address instructions to two operands.
-///
-bool TwoAddressInstructionPass::runOnMachineFunction(MachineFunction &MF) {
- DOUT << "Machine Function\n";
- const TargetMachine &TM = MF.getTarget();
- MRI = &MF.getRegInfo();
- TII = TM.getInstrInfo();
- TRI = TM.getRegisterInfo();
- LV = &getAnalysis<LiveVariables>();
-
- bool MadeChange = false;
-
- DOUT << "********** REWRITING TWO-ADDR INSTRS **********\n";
- DOUT << "********** Function: " << MF.getFunction()->getName() << '\n';
-
- for (MachineFunction::iterator mbbi = MF.begin(), mbbe = MF.end();
- mbbi != mbbe; ++mbbi) {
- for (MachineBasicBlock::iterator mi = mbbi->begin(), me = mbbi->end();
- mi != me; ) {
- MachineBasicBlock::iterator nmi = next(mi);
- const TargetInstrDesc &TID = mi->getDesc();
- bool FirstTied = true;
-
- for (unsigned si = 1, e = TID.getNumOperands(); si < e; ++si) {
- int ti = TID.getOperandConstraint(si, TOI::TIED_TO);
- if (ti == -1)
- continue;
-
- if (FirstTied) {
- ++NumTwoAddressInstrs;
- DOUT << '\t'; DEBUG(mi->print(*cerr.stream(), &TM));
- }
-
- FirstTied = false;
-
- assert(mi->getOperand(si).isRegister() && mi->getOperand(si).getReg() &&
- mi->getOperand(si).isUse() && "two address instruction invalid");
-
- // If the two operands are the same we just remove the use
- // and mark the def as def&use, otherwise we have to insert a copy.
- if (mi->getOperand(ti).getReg() != mi->getOperand(si).getReg()) {
- // Rewrite:
- // a = b op c
- // to:
- // a = b
- // a = a op c
- unsigned regA = mi->getOperand(ti).getReg();
- unsigned regB = mi->getOperand(si).getReg();
-
- assert(TargetRegisterInfo::isVirtualRegister(regA) &&
- TargetRegisterInfo::isVirtualRegister(regB) &&
- "cannot update physical register live information");
-
-#ifndef NDEBUG
- // First, verify that we don't have a use of a in the instruction (a =
- // b + a for example) because our transformation will not work. This
- // should never occur because we are in SSA form.
- for (unsigned i = 0; i != mi->getNumOperands(); ++i)
- assert((int)i == ti ||
- !mi->getOperand(i).isRegister() ||
- mi->getOperand(i).getReg() != regA);
-#endif
-
- // If this instruction is not the killing user of B, see if we can
- // rearrange the code to make it so. Making it the killing user will
- // allow us to coalesce A and B together, eliminating the copy we are
- // about to insert.
- if (!mi->killsRegister(regB)) {
- // If this instruction is commutative, check to see if C dies. If
- // so, swap the B and C operands. This makes the live ranges of A
- // and C joinable.
- // FIXME: This code also works for A := B op C instructions.
- if (TID.isCommutable() && mi->getNumOperands() >= 3) {
- assert(mi->getOperand(3-si).isRegister() &&
- "Not a proper commutative instruction!");
- unsigned regC = mi->getOperand(3-si).getReg();
-
- if (mi->killsRegister(regC)) {
- DOUT << "2addr: COMMUTING : " << *mi;
- MachineInstr *NewMI = TII->commuteInstruction(mi);
-
- if (NewMI == 0) {
- DOUT << "2addr: COMMUTING FAILED!\n";
- } else {
- DOUT << "2addr: COMMUTED TO: " << *NewMI;
- // If the instruction changed to commute it, update livevar.
- if (NewMI != mi) {
- LV->instructionChanged(mi, NewMI); // Update live variables
- mbbi->insert(mi, NewMI); // Insert the new inst
- mbbi->erase(mi); // Nuke the old inst.
- mi = NewMI;
- }
-
- ++NumCommuted;
- regB = regC;
- goto InstructionRearranged;
- }
- }
- }
-
- // If this instruction is potentially convertible to a true
- // three-address instruction,
- if (TID.isConvertibleTo3Addr()) {
- // FIXME: This assumes there are no more operands which are tied
- // to another register.
-#ifndef NDEBUG
- for (unsigned i = si + 1, e = TID.getNumOperands(); i < e; ++i)
- assert(TID.getOperandConstraint(i, TOI::TIED_TO) == -1);
-#endif
-
- if (MachineInstr *New=TII->convertToThreeAddress(mbbi, mi, *LV)) {
- DOUT << "2addr: CONVERTING 2-ADDR: " << *mi;
- DOUT << "2addr: TO 3-ADDR: " << *New;
- bool Sunk = false;
-
- if (New->findRegisterUseOperand(regB, false, TRI))
- // FIXME: Temporary workaround. If the new instruction doesn't
- // uses regB, convertToThreeAddress must have created more
- // then one instruction.
- Sunk = Sink3AddrInstruction(mbbi, New, regB, mi);
-
- mbbi->erase(mi); // Nuke the old inst.
-
- if (!Sunk) {
- mi = New;
- nmi = next(mi);
- }
-
- ++NumConvertedTo3Addr;
- break; // Done with this instruction.
- }
- }
- }
-
- InstructionRearranged:
- const TargetRegisterClass* rc = MF.getRegInfo().getRegClass(regA);
- TII->copyRegToReg(*mbbi, mi, regA, regB, rc, rc);
-
- MachineBasicBlock::iterator prevMi = prior(mi);
- DOUT << "\t\tprepend:\t"; DEBUG(prevMi->print(*cerr.stream(), &TM));
-
- // Update live variables for regB.
- LiveVariables::VarInfo& varInfoB = LV->getVarInfo(regB);
-
- // regB is used in this BB.
- varInfoB.UsedBlocks[mbbi->getNumber()] = true;
-
- if (LV->removeVirtualRegisterKilled(regB, mbbi, mi))
- LV->addVirtualRegisterKilled(regB, prevMi);
-
- if (LV->removeVirtualRegisterDead(regB, mbbi, mi))
- LV->addVirtualRegisterDead(regB, prevMi);
-
- // Replace all occurences of regB with regA.
- for (unsigned i = 0, e = mi->getNumOperands(); i != e; ++i) {
- if (mi->getOperand(i).isRegister() &&
- mi->getOperand(i).getReg() == regB)
- mi->getOperand(i).setReg(regA);
- }
- }
-
- assert(mi->getOperand(ti).isDef() && mi->getOperand(si).isUse());
- mi->getOperand(ti).setReg(mi->getOperand(si).getReg());
- MadeChange = true;
-
- DOUT << "\t\trewrite to:\t"; DEBUG(mi->print(*cerr.stream(), &TM));
- }
-
- mi = nmi;
- }
- }
-
- return MadeChange;
-}
diff --git a/release_23/lib/CodeGen/UnreachableBlockElim.cpp b/release_23/lib/CodeGen/UnreachableBlockElim.cpp
deleted file mode 100644
index 9672dacd5067..000000000000
--- a/release_23/lib/CodeGen/UnreachableBlockElim.cpp
+++ /dev/null
@@ -1,81 +0,0 @@
-//===-- UnreachableBlockElim.cpp - Remove unreachable blocks for codegen --===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This pass is an extremely simple version of the SimplifyCFG pass. Its sole
-// job is to delete LLVM basic blocks that are not reachable from the entry
-// node. To do this, it performs a simple depth first traversal of the CFG,
-// then deletes any unvisited nodes.
-//
-// Note that this pass is really a hack. In particular, the instruction
-// selectors for various targets should just not generate code for unreachable
-// blocks. Until LLVM has a more systematic way of defining instruction
-// selectors, however, we cannot really expect them to handle additional
-// complexity.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/CodeGen/Passes.h"
-#include "llvm/Constant.h"
-#include "llvm/Instructions.h"
-#include "llvm/Function.h"
-#include "llvm/Pass.h"
-#include "llvm/Type.h"
-#include "llvm/Support/CFG.h"
-#include "llvm/Support/Compiler.h"
-#include "llvm/ADT/DepthFirstIterator.h"
-using namespace llvm;
-
-namespace {
- class VISIBILITY_HIDDEN UnreachableBlockElim : public FunctionPass {
- virtual bool runOnFunction(Function &F);
- public:
- static char ID; // Pass identification, replacement for typeid
- UnreachableBlockElim() : FunctionPass((intptr_t)&ID) {}
- };
- char UnreachableBlockElim::ID = 0;
- RegisterPass<UnreachableBlockElim>
- X("unreachableblockelim", "Remove unreachable blocks from the CFG");
-}
-
-FunctionPass *llvm::createUnreachableBlockEliminationPass() {
- return new UnreachableBlockElim();
-}
-
-bool UnreachableBlockElim::runOnFunction(Function &F) {
- std::set<BasicBlock*> Reachable;
-
- // Mark all reachable blocks.
- for (df_ext_iterator<Function*> I = df_ext_begin(&F, Reachable),
- E = df_ext_end(&F, Reachable); I != E; ++I)
- /* Mark all reachable blocks */;
-
- // Loop over all dead blocks, remembering them and deleting all instructions
- // in them.
- std::vector<BasicBlock*> DeadBlocks;
- for (Function::iterator I = F.begin(), E = F.end(); I != E; ++I)
- if (!Reachable.count(I)) {
- BasicBlock *BB = I;
- DeadBlocks.push_back(BB);
- while (PHINode *PN = dyn_cast<PHINode>(BB->begin())) {
- PN->replaceAllUsesWith(Constant::getNullValue(PN->getType()));
- BB->getInstList().pop_front();
- }
- for (succ_iterator SI = succ_begin(BB), E = succ_end(BB); SI != E; ++SI)
- (*SI)->removePredecessor(BB);
- BB->dropAllReferences();
- }
-
- if (DeadBlocks.empty()) return false;
-
- // Actually remove the blocks now.
- for (unsigned i = 0, e = DeadBlocks.size(); i != e; ++i)
- F.getBasicBlockList().erase(DeadBlocks[i]);
-
- return true;
-}
diff --git a/release_23/lib/CodeGen/VirtRegMap.cpp b/release_23/lib/CodeGen/VirtRegMap.cpp
deleted file mode 100644
index fe8b6a5a63a5..000000000000
--- a/release_23/lib/CodeGen/VirtRegMap.cpp
+++ /dev/null
@@ -1,1655 +0,0 @@
-//===-- llvm/CodeGen/VirtRegMap.cpp - Virtual Register Map ----------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the VirtRegMap class.
-//
-// It also contains implementations of the the Spiller interface, which, given a
-// virtual register map and a machine function, eliminates all virtual
-// references by replacing them with physical register references - adding spill
-// code as necessary.
-//
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "spiller"
-#include "VirtRegMap.h"
-#include "llvm/Function.h"
-#include "llvm/CodeGen/MachineFrameInfo.h"
-#include "llvm/CodeGen/MachineFunction.h"
-#include "llvm/CodeGen/MachineInstrBuilder.h"
-#include "llvm/CodeGen/MachineRegisterInfo.h"
-#include "llvm/Target/TargetMachine.h"
-#include "llvm/Target/TargetInstrInfo.h"
-#include "llvm/Support/CommandLine.h"
-#include "llvm/Support/Debug.h"
-#include "llvm/Support/Compiler.h"
-#include "llvm/ADT/BitVector.h"
-#include "llvm/ADT/Statistic.h"
-#include "llvm/ADT/STLExtras.h"
-#include "llvm/ADT/SmallSet.h"
-#include <algorithm>
-using namespace llvm;
-
-STATISTIC(NumSpills, "Number of register spills");
-STATISTIC(NumPSpills,"Number of physical register spills");
-STATISTIC(NumReMats, "Number of re-materialization");
-STATISTIC(NumDRM , "Number of re-materializable defs elided");
-STATISTIC(NumStores, "Number of stores added");
-STATISTIC(NumLoads , "Number of loads added");
-STATISTIC(NumReused, "Number of values reused");
-STATISTIC(NumDSE , "Number of dead stores elided");
-STATISTIC(NumDCE , "Number of copies elided");
-STATISTIC(NumDSS , "Number of dead spill slots removed");
-
-namespace {
- enum SpillerName { simple, local };
-
- static cl::opt<SpillerName>
- SpillerOpt("spiller",
- cl::desc("Spiller to use: (default: local)"),
- cl::Prefix,
- cl::values(clEnumVal(simple, " simple spiller"),
- clEnumVal(local, " local spiller"),
- clEnumValEnd),
- cl::init(local));
-}
-
-//===----------------------------------------------------------------------===//
-// VirtRegMap implementation
-//===----------------------------------------------------------------------===//
-
-VirtRegMap::VirtRegMap(MachineFunction &mf)
- : TII(*mf.getTarget().getInstrInfo()), MF(mf),
- Virt2PhysMap(NO_PHYS_REG), Virt2StackSlotMap(NO_STACK_SLOT),
- Virt2ReMatIdMap(NO_STACK_SLOT), Virt2SplitMap(0),
- Virt2SplitKillMap(0), ReMatMap(NULL), ReMatId(MAX_STACK_SLOT+1),
- LowSpillSlot(NO_STACK_SLOT), HighSpillSlot(NO_STACK_SLOT) {
- SpillSlotToUsesMap.resize(8);
- ImplicitDefed.resize(MF.getRegInfo().getLastVirtReg()+1-
- TargetRegisterInfo::FirstVirtualRegister);
- grow();
-}
-
-void VirtRegMap::grow() {
- unsigned LastVirtReg = MF.getRegInfo().getLastVirtReg();
- Virt2PhysMap.grow(LastVirtReg);
- Virt2StackSlotMap.grow(LastVirtReg);
- Virt2ReMatIdMap.grow(LastVirtReg);
- Virt2SplitMap.grow(LastVirtReg);
- Virt2SplitKillMap.grow(LastVirtReg);
- ReMatMap.grow(LastVirtReg);
- ImplicitDefed.resize(LastVirtReg-TargetRegisterInfo::FirstVirtualRegister+1);
-}
-
-int VirtRegMap::assignVirt2StackSlot(unsigned virtReg) {
- assert(TargetRegisterInfo::isVirtualRegister(virtReg));
- assert(Virt2StackSlotMap[virtReg] == NO_STACK_SLOT &&
- "attempt to assign stack slot to already spilled register");
- const TargetRegisterClass* RC = MF.getRegInfo().getRegClass(virtReg);
- int SS = MF.getFrameInfo()->CreateStackObject(RC->getSize(),
- RC->getAlignment());
- if (LowSpillSlot == NO_STACK_SLOT)
- LowSpillSlot = SS;
- if (HighSpillSlot == NO_STACK_SLOT || SS > HighSpillSlot)
- HighSpillSlot = SS;
- unsigned Idx = SS-LowSpillSlot;
- while (Idx >= SpillSlotToUsesMap.size())
- SpillSlotToUsesMap.resize(SpillSlotToUsesMap.size()*2);
- Virt2StackSlotMap[virtReg] = SS;
- ++NumSpills;
- return SS;
-}
-
-void VirtRegMap::assignVirt2StackSlot(unsigned virtReg, int SS) {
- assert(TargetRegisterInfo::isVirtualRegister(virtReg));
- assert(Virt2StackSlotMap[virtReg] == NO_STACK_SLOT &&
- "attempt to assign stack slot to already spilled register");
- assert((SS >= 0 ||
- (SS >= MF.getFrameInfo()->getObjectIndexBegin())) &&
- "illegal fixed frame index");
- Virt2StackSlotMap[virtReg] = SS;
-}
-
-int VirtRegMap::assignVirtReMatId(unsigned virtReg) {
- assert(TargetRegisterInfo::isVirtualRegister(virtReg));
- assert(Virt2ReMatIdMap[virtReg] == NO_STACK_SLOT &&
- "attempt to assign re-mat id to already spilled register");
- Virt2ReMatIdMap[virtReg] = ReMatId;
- return ReMatId++;
-}
-
-void VirtRegMap::assignVirtReMatId(unsigned virtReg, int id) {
- assert(TargetRegisterInfo::isVirtualRegister(virtReg));
- assert(Virt2ReMatIdMap[virtReg] == NO_STACK_SLOT &&
- "attempt to assign re-mat id to already spilled register");
- Virt2ReMatIdMap[virtReg] = id;
-}
-
-int VirtRegMap::getEmergencySpillSlot(const TargetRegisterClass *RC) {
- std::map<const TargetRegisterClass*, int>::iterator I =
- EmergencySpillSlots.find(RC);
- if (I != EmergencySpillSlots.end())
- return I->second;
- int SS = MF.getFrameInfo()->CreateStackObject(RC->getSize(),
- RC->getAlignment());
- if (LowSpillSlot == NO_STACK_SLOT)
- LowSpillSlot = SS;
- if (HighSpillSlot == NO_STACK_SLOT || SS > HighSpillSlot)
- HighSpillSlot = SS;
- I->second = SS;
- return SS;
-}
-
-void VirtRegMap::addSpillSlotUse(int FI, MachineInstr *MI) {
- if (!MF.getFrameInfo()->isFixedObjectIndex(FI)) {
- assert(FI >= 0 && "Spill slot index should not be negative!");
- SpillSlotToUsesMap[FI-LowSpillSlot].insert(MI);
- }
-}
-
-void VirtRegMap::virtFolded(unsigned VirtReg, MachineInstr *OldMI,
- MachineInstr *NewMI, ModRef MRInfo) {
- // Move previous memory references folded to new instruction.
- MI2VirtMapTy::iterator IP = MI2VirtMap.lower_bound(NewMI);
- for (MI2VirtMapTy::iterator I = MI2VirtMap.lower_bound(OldMI),
- E = MI2VirtMap.end(); I != E && I->first == OldMI; ) {
- MI2VirtMap.insert(IP, std::make_pair(NewMI, I->second));
- MI2VirtMap.erase(I++);
- }
-
- // add new memory reference
- MI2VirtMap.insert(IP, std::make_pair(NewMI, std::make_pair(VirtReg, MRInfo)));
-}
-
-void VirtRegMap::virtFolded(unsigned VirtReg, MachineInstr *MI, ModRef MRInfo) {
- MI2VirtMapTy::iterator IP = MI2VirtMap.lower_bound(MI);
- MI2VirtMap.insert(IP, std::make_pair(MI, std::make_pair(VirtReg, MRInfo)));
-}
-
-void VirtRegMap::RemoveMachineInstrFromMaps(MachineInstr *MI) {
- for (unsigned i = 0, e = MI->getNumOperands(); i != e; ++i) {
- MachineOperand &MO = MI->getOperand(i);
- if (!MO.isFrameIndex())
- continue;
- int FI = MO.getIndex();
- if (MF.getFrameInfo()->isFixedObjectIndex(FI))
- continue;
- SpillSlotToUsesMap[FI-LowSpillSlot].erase(MI);
- }
- MI2VirtMap.erase(MI);
- SpillPt2VirtMap.erase(MI);
- RestorePt2VirtMap.erase(MI);
- EmergencySpillMap.erase(MI);
-}
-
-void VirtRegMap::print(std::ostream &OS) const {
- const TargetRegisterInfo* TRI = MF.getTarget().getRegisterInfo();
-
- OS << "********** REGISTER MAP **********\n";
- for (unsigned i = TargetRegisterInfo::FirstVirtualRegister,
- e = MF.getRegInfo().getLastVirtReg(); i <= e; ++i) {
- if (Virt2PhysMap[i] != (unsigned)VirtRegMap::NO_PHYS_REG)
- OS << "[reg" << i << " -> " << TRI->getName(Virt2PhysMap[i])
- << "]\n";
- }
-
- for (unsigned i = TargetRegisterInfo::FirstVirtualRegister,
- e = MF.getRegInfo().getLastVirtReg(); i <= e; ++i)
- if (Virt2StackSlotMap[i] != VirtRegMap::NO_STACK_SLOT)
- OS << "[reg" << i << " -> fi#" << Virt2StackSlotMap[i] << "]\n";
- OS << '\n';
-}
-
-void VirtRegMap::dump() const {
- print(cerr);
-}
-
-
-//===----------------------------------------------------------------------===//
-// Simple Spiller Implementation
-//===----------------------------------------------------------------------===//
-
-Spiller::~Spiller() {}
-
-namespace {
- struct VISIBILITY_HIDDEN SimpleSpiller : public Spiller {
- bool runOnMachineFunction(MachineFunction& mf, VirtRegMap &VRM);
- };
-}
-
-bool SimpleSpiller::runOnMachineFunction(MachineFunction &MF, VirtRegMap &VRM) {
- DOUT << "********** REWRITE MACHINE CODE **********\n";
- DOUT << "********** Function: " << MF.getFunction()->getName() << '\n';
- const TargetMachine &TM = MF.getTarget();
- const TargetInstrInfo &TII = *TM.getInstrInfo();
-
-
- // LoadedRegs - Keep track of which vregs are loaded, so that we only load
- // each vreg once (in the case where a spilled vreg is used by multiple
- // operands). This is always smaller than the number of operands to the
- // current machine instr, so it should be small.
- std::vector<unsigned> LoadedRegs;
-
- for (MachineFunction::iterator MBBI = MF.begin(), E = MF.end();
- MBBI != E; ++MBBI) {
- DOUT << MBBI->getBasicBlock()->getName() << ":\n";
- MachineBasicBlock &MBB = *MBBI;
- for (MachineBasicBlock::iterator MII = MBB.begin(),
- E = MBB.end(); MII != E; ++MII) {
- MachineInstr &MI = *MII;
- for (unsigned i = 0, e = MI.getNumOperands(); i != e; ++i) {
- MachineOperand &MO = MI.getOperand(i);
- if (MO.isRegister() && MO.getReg()) {
- if (TargetRegisterInfo::isVirtualRegister(MO.getReg())) {
- unsigned VirtReg = MO.getReg();
- unsigned PhysReg = VRM.getPhys(VirtReg);
- if (!VRM.isAssignedReg(VirtReg)) {
- int StackSlot = VRM.getStackSlot(VirtReg);
- const TargetRegisterClass* RC =
- MF.getRegInfo().getRegClass(VirtReg);
-
- if (MO.isUse() &&
- std::find(LoadedRegs.begin(), LoadedRegs.end(), VirtReg)
- == LoadedRegs.end()) {
- TII.loadRegFromStackSlot(MBB, &MI, PhysReg, StackSlot, RC);
- MachineInstr *LoadMI = prior(MII);
- VRM.addSpillSlotUse(StackSlot, LoadMI);
- LoadedRegs.push_back(VirtReg);
- ++NumLoads;
- DOUT << '\t' << *LoadMI;
- }
-
- if (MO.isDef()) {
- TII.storeRegToStackSlot(MBB, next(MII), PhysReg, true,
- StackSlot, RC);
- MachineInstr *StoreMI = next(MII);
- VRM.addSpillSlotUse(StackSlot, StoreMI);
- ++NumStores;
- }
- }
- MF.getRegInfo().setPhysRegUsed(PhysReg);
- MI.getOperand(i).setReg(PhysReg);
- } else {
- MF.getRegInfo().setPhysRegUsed(MO.getReg());
- }
- }
- }
-
- DOUT << '\t' << MI;
- LoadedRegs.clear();
- }
- }
- return true;
-}
-
-//===----------------------------------------------------------------------===//
-// Local Spiller Implementation
-//===----------------------------------------------------------------------===//
-
-namespace {
- class AvailableSpills;
-
- /// LocalSpiller - This spiller does a simple pass over the machine basic
- /// block to attempt to keep spills in registers as much as possible for
- /// blocks that have low register pressure (the vreg may be spilled due to
- /// register pressure in other blocks).
- class VISIBILITY_HIDDEN LocalSpiller : public Spiller {
- MachineRegisterInfo *RegInfo;
- const TargetRegisterInfo *TRI;
- const TargetInstrInfo *TII;
- public:
- bool runOnMachineFunction(MachineFunction &MF, VirtRegMap &VRM) {
- RegInfo = &MF.getRegInfo();
- TRI = MF.getTarget().getRegisterInfo();
- TII = MF.getTarget().getInstrInfo();
- DOUT << "\n**** Local spiller rewriting function '"
- << MF.getFunction()->getName() << "':\n";
- DOUT << "**** Machine Instrs (NOTE! Does not include spills and reloads!)"
- " ****\n";
- DEBUG(MF.dump());
-
- for (MachineFunction::iterator MBB = MF.begin(), E = MF.end();
- MBB != E; ++MBB)
- RewriteMBB(*MBB, VRM);
-
- // Mark unused spill slots.
- MachineFrameInfo *MFI = MF.getFrameInfo();
- int SS = VRM.getLowSpillSlot();
- if (SS != VirtRegMap::NO_STACK_SLOT)
- for (int e = VRM.getHighSpillSlot(); SS <= e; ++SS)
- if (!VRM.isSpillSlotUsed(SS)) {
- MFI->RemoveStackObject(SS);
- ++NumDSS;
- }
-
- DOUT << "**** Post Machine Instrs ****\n";
- DEBUG(MF.dump());
-
- return true;
- }
- private:
- bool PrepForUnfoldOpti(MachineBasicBlock &MBB,
- MachineBasicBlock::iterator &MII,
- std::vector<MachineInstr*> &MaybeDeadStores,
- AvailableSpills &Spills, BitVector &RegKills,
- std::vector<MachineOperand*> &KillOps,
- VirtRegMap &VRM);
- void SpillRegToStackSlot(MachineBasicBlock &MBB,
- MachineBasicBlock::iterator &MII,
- int Idx, unsigned PhysReg, int StackSlot,
- const TargetRegisterClass *RC,
- bool isAvailable, MachineInstr *&LastStore,
- AvailableSpills &Spills,
- SmallSet<MachineInstr*, 4> &ReMatDefs,
- BitVector &RegKills,
- std::vector<MachineOperand*> &KillOps,
- VirtRegMap &VRM);
- void RewriteMBB(MachineBasicBlock &MBB, VirtRegMap &VRM);
- };
-}
-
-/// AvailableSpills - As the local spiller is scanning and rewriting an MBB from
-/// top down, keep track of which spills slots or remat are available in each
-/// register.
-///
-/// Note that not all physregs are created equal here. In particular, some
-/// physregs are reloads that we are allowed to clobber or ignore at any time.
-/// Other physregs are values that the register allocated program is using that
-/// we cannot CHANGE, but we can read if we like. We keep track of this on a
-/// per-stack-slot / remat id basis as the low bit in the value of the
-/// SpillSlotsAvailable entries. The predicate 'canClobberPhysReg()' checks
-/// this bit and addAvailable sets it if.
-namespace {
-class VISIBILITY_HIDDEN AvailableSpills {
- const TargetRegisterInfo *TRI;
- const TargetInstrInfo *TII;
-
- // SpillSlotsOrReMatsAvailable - This map keeps track of all of the spilled
- // or remat'ed virtual register values that are still available, due to being
- // loaded or stored to, but not invalidated yet.
- std::map<int, unsigned> SpillSlotsOrReMatsAvailable;
-
- // PhysRegsAvailable - This is the inverse of SpillSlotsOrReMatsAvailable,
- // indicating which stack slot values are currently held by a physreg. This
- // is used to invalidate entries in SpillSlotsOrReMatsAvailable when a
- // physreg is modified.
- std::multimap<unsigned, int> PhysRegsAvailable;
-
- void disallowClobberPhysRegOnly(unsigned PhysReg);
-
- void ClobberPhysRegOnly(unsigned PhysReg);
-public:
- AvailableSpills(const TargetRegisterInfo *tri, const TargetInstrInfo *tii)
- : TRI(tri), TII(tii) {
- }
-
- const TargetRegisterInfo *getRegInfo() const { return TRI; }
-
- /// getSpillSlotOrReMatPhysReg - If the specified stack slot or remat is
- /// available in a physical register, return that PhysReg, otherwise
- /// return 0.
- unsigned getSpillSlotOrReMatPhysReg(int Slot) const {
- std::map<int, unsigned>::const_iterator I =
- SpillSlotsOrReMatsAvailable.find(Slot);
- if (I != SpillSlotsOrReMatsAvailable.end()) {
- return I->second >> 1; // Remove the CanClobber bit.
- }
- return 0;
- }
-
- /// addAvailable - Mark that the specified stack slot / remat is available in
- /// the specified physreg. If CanClobber is true, the physreg can be modified
- /// at any time without changing the semantics of the program.
- void addAvailable(int SlotOrReMat, MachineInstr *MI, unsigned Reg,
- bool CanClobber = true) {
- // If this stack slot is thought to be available in some other physreg,
- // remove its record.
- ModifyStackSlotOrReMat(SlotOrReMat);
-
- PhysRegsAvailable.insert(std::make_pair(Reg, SlotOrReMat));
- SpillSlotsOrReMatsAvailable[SlotOrReMat]= (Reg << 1) | (unsigned)CanClobber;
-
- if (SlotOrReMat > VirtRegMap::MAX_STACK_SLOT)
- DOUT << "Remembering RM#" << SlotOrReMat-VirtRegMap::MAX_STACK_SLOT-1;
- else
- DOUT << "Remembering SS#" << SlotOrReMat;
- DOUT << " in physreg " << TRI->getName(Reg) << "\n";
- }
-
- /// canClobberPhysReg - Return true if the spiller is allowed to change the
- /// value of the specified stackslot register if it desires. The specified
- /// stack slot must be available in a physreg for this query to make sense.
- bool canClobberPhysReg(int SlotOrReMat) const {
- assert(SpillSlotsOrReMatsAvailable.count(SlotOrReMat) &&
- "Value not available!");
- return SpillSlotsOrReMatsAvailable.find(SlotOrReMat)->second & 1;
- }
-
- /// disallowClobberPhysReg - Unset the CanClobber bit of the specified
- /// stackslot register. The register is still available but is no longer
- /// allowed to be modifed.
- void disallowClobberPhysReg(unsigned PhysReg);
-
- /// ClobberPhysReg - This is called when the specified physreg changes
- /// value. We use this to invalidate any info about stuff that lives in
- /// it and any of its aliases.
- void ClobberPhysReg(unsigned PhysReg);
-
- /// ModifyStackSlotOrReMat - This method is called when the value in a stack
- /// slot changes. This removes information about which register the previous
- /// value for this slot lives in (as the previous value is dead now).
- void ModifyStackSlotOrReMat(int SlotOrReMat);
-};
-}
-
-/// disallowClobberPhysRegOnly - Unset the CanClobber bit of the specified
-/// stackslot register. The register is still available but is no longer
-/// allowed to be modifed.
-void AvailableSpills::disallowClobberPhysRegOnly(unsigned PhysReg) {
- std::multimap<unsigned, int>::iterator I =
- PhysRegsAvailable.lower_bound(PhysReg);
- while (I != PhysRegsAvailable.end() && I->first == PhysReg) {
- int SlotOrReMat = I->second;
- I++;
- assert((SpillSlotsOrReMatsAvailable[SlotOrReMat] >> 1) == PhysReg &&
- "Bidirectional map mismatch!");
- SpillSlotsOrReMatsAvailable[SlotOrReMat] &= ~1;
- DOUT << "PhysReg " << TRI->getName(PhysReg)
- << " copied, it is available for use but can no longer be modified\n";
- }
-}
-
-/// disallowClobberPhysReg - Unset the CanClobber bit of the specified
-/// stackslot register and its aliases. The register and its aliases may
-/// still available but is no longer allowed to be modifed.
-void AvailableSpills::disallowClobberPhysReg(unsigned PhysReg) {
- for (const unsigned *AS = TRI->getAliasSet(PhysReg); *AS; ++AS)
- disallowClobberPhysRegOnly(*AS);
- disallowClobberPhysRegOnly(PhysReg);
-}
-
-/// ClobberPhysRegOnly - This is called when the specified physreg changes
-/// value. We use this to invalidate any info about stuff we thing lives in it.
-void AvailableSpills::ClobberPhysRegOnly(unsigned PhysReg) {
- std::multimap<unsigned, int>::iterator I =
- PhysRegsAvailable.lower_bound(PhysReg);
- while (I != PhysRegsAvailable.end() && I->first == PhysReg) {
- int SlotOrReMat = I->second;
- PhysRegsAvailable.erase(I++);
- assert((SpillSlotsOrReMatsAvailable[SlotOrReMat] >> 1) == PhysReg &&
- "Bidirectional map mismatch!");
- SpillSlotsOrReMatsAvailable.erase(SlotOrReMat);
- DOUT << "PhysReg " << TRI->getName(PhysReg)
- << " clobbered, invalidating ";
- if (SlotOrReMat > VirtRegMap::MAX_STACK_SLOT)
- DOUT << "RM#" << SlotOrReMat-VirtRegMap::MAX_STACK_SLOT-1 << "\n";
- else
- DOUT << "SS#" << SlotOrReMat << "\n";
- }
-}
-
-/// ClobberPhysReg - This is called when the specified physreg changes
-/// value. We use this to invalidate any info about stuff we thing lives in
-/// it and any of its aliases.
-void AvailableSpills::ClobberPhysReg(unsigned PhysReg) {
- for (const unsigned *AS = TRI->getAliasSet(PhysReg); *AS; ++AS)
- ClobberPhysRegOnly(*AS);
- ClobberPhysRegOnly(PhysReg);
-}
-
-/// ModifyStackSlotOrReMat - This method is called when the value in a stack
-/// slot changes. This removes information about which register the previous
-/// value for this slot lives in (as the previous value is dead now).
-void AvailableSpills::ModifyStackSlotOrReMat(int SlotOrReMat) {
- std::map<int, unsigned>::iterator It =
- SpillSlotsOrReMatsAvailable.find(SlotOrReMat);
- if (It == SpillSlotsOrReMatsAvailable.end()) return;
- unsigned Reg = It->second >> 1;
- SpillSlotsOrReMatsAvailable.erase(It);
-
- // This register may hold the value of multiple stack slots, only remove this
- // stack slot from the set of values the register contains.
- std::multimap<unsigned, int>::iterator I = PhysRegsAvailable.lower_bound(Reg);
- for (; ; ++I) {
- assert(I != PhysRegsAvailable.end() && I->first == Reg &&
- "Map inverse broken!");
- if (I->second == SlotOrReMat) break;
- }
- PhysRegsAvailable.erase(I);
-}
-
-
-
-/// InvalidateKills - MI is going to be deleted. If any of its operands are
-/// marked kill, then invalidate the information.
-static void InvalidateKills(MachineInstr &MI, BitVector &RegKills,
- std::vector<MachineOperand*> &KillOps,
- SmallVector<unsigned, 2> *KillRegs = NULL) {
- for (unsigned i = 0, e = MI.getNumOperands(); i != e; ++i) {
- MachineOperand &MO = MI.getOperand(i);
- if (!MO.isRegister() || !MO.isUse() || !MO.isKill())
- continue;
- unsigned Reg = MO.getReg();
- if (KillRegs)
- KillRegs->push_back(Reg);
- if (KillOps[Reg] == &MO) {
- RegKills.reset(Reg);
- KillOps[Reg] = NULL;
- }
- }
-}
-
-/// InvalidateKill - A MI that defines the specified register is being deleted,
-/// invalidate the register kill information.
-static void InvalidateKill(unsigned Reg, BitVector &RegKills,
- std::vector<MachineOperand*> &KillOps) {
- if (RegKills[Reg]) {
- KillOps[Reg]->setIsKill(false);
- KillOps[Reg] = NULL;
- RegKills.reset(Reg);
- }
-}
-
-/// InvalidateRegDef - If the def operand of the specified def MI is now dead
-/// (since it's spill instruction is removed), mark it isDead. Also checks if
-/// the def MI has other definition operands that are not dead. Returns it by
-/// reference.
-static bool InvalidateRegDef(MachineBasicBlock::iterator I,
- MachineInstr &NewDef, unsigned Reg,
- bool &HasLiveDef) {
- // Due to remat, it's possible this reg isn't being reused. That is,
- // the def of this reg (by prev MI) is now dead.
- MachineInstr *DefMI = I;
- MachineOperand *DefOp = NULL;
- for (unsigned i = 0, e = DefMI->getNumOperands(); i != e; ++i) {
- MachineOperand &MO = DefMI->getOperand(i);
- if (MO.isRegister() && MO.isDef()) {
- if (MO.getReg() == Reg)
- DefOp = &MO;
- else if (!MO.isDead())
- HasLiveDef = true;
- }
- }
- if (!DefOp)
- return false;
-
- bool FoundUse = false, Done = false;
- MachineBasicBlock::iterator E = NewDef;
- ++I; ++E;
- for (; !Done && I != E; ++I) {
- MachineInstr *NMI = I;
- for (unsigned j = 0, ee = NMI->getNumOperands(); j != ee; ++j) {
- MachineOperand &MO = NMI->getOperand(j);
- if (!MO.isRegister() || MO.getReg() != Reg)
- continue;
- if (MO.isUse())
- FoundUse = true;
- Done = true; // Stop after scanning all the operands of this MI.
- }
- }
- if (!FoundUse) {
- // Def is dead!
- DefOp->setIsDead();
- return true;
- }
- return false;
-}
-
-/// UpdateKills - Track and update kill info. If a MI reads a register that is
-/// marked kill, then it must be due to register reuse. Transfer the kill info
-/// over.
-static void UpdateKills(MachineInstr &MI, BitVector &RegKills,
- std::vector<MachineOperand*> &KillOps) {
- const TargetInstrDesc &TID = MI.getDesc();
- for (unsigned i = 0, e = MI.getNumOperands(); i != e; ++i) {
- MachineOperand &MO = MI.getOperand(i);
- if (!MO.isRegister() || !MO.isUse())
- continue;
- unsigned Reg = MO.getReg();
- if (Reg == 0)
- continue;
-
- if (RegKills[Reg] && KillOps[Reg]->getParent() != &MI) {
- // That can't be right. Register is killed but not re-defined and it's
- // being reused. Let's fix that.
- KillOps[Reg]->setIsKill(false);
- KillOps[Reg] = NULL;
- RegKills.reset(Reg);
- if (i < TID.getNumOperands() &&
- TID.getOperandConstraint(i, TOI::TIED_TO) == -1)
- // Unless it's a two-address operand, this is the new kill.
- MO.setIsKill();
- }
- if (MO.isKill()) {
- RegKills.set(Reg);
- KillOps[Reg] = &MO;
- }
- }
-
- for (unsigned i = 0, e = MI.getNumOperands(); i != e; ++i) {
- const MachineOperand &MO = MI.getOperand(i);
- if (!MO.isRegister() || !MO.isDef())
- continue;
- unsigned Reg = MO.getReg();
- RegKills.reset(Reg);
- KillOps[Reg] = NULL;
- }
-}
-
-/// ReMaterialize - Re-materialize definition for Reg targetting DestReg.
-///
-static void ReMaterialize(MachineBasicBlock &MBB,
- MachineBasicBlock::iterator &MII,
- unsigned DestReg, unsigned Reg,
- const TargetInstrInfo *TII,
- const TargetRegisterInfo *TRI,
- VirtRegMap &VRM) {
- TII->reMaterialize(MBB, MII, DestReg, VRM.getReMaterializedMI(Reg));
- MachineInstr *NewMI = prior(MII);
- for (unsigned i = 0, e = NewMI->getNumOperands(); i != e; ++i) {
- MachineOperand &MO = NewMI->getOperand(i);
- if (!MO.isRegister() || MO.getReg() == 0)
- continue;
- unsigned VirtReg = MO.getReg();
- if (TargetRegisterInfo::isPhysicalRegister(VirtReg))
- continue;
- assert(MO.isUse());
- unsigned SubIdx = MO.getSubReg();
- unsigned Phys = VRM.getPhys(VirtReg);
- assert(Phys);
- unsigned RReg = SubIdx ? TRI->getSubReg(Phys, SubIdx) : Phys;
- MO.setReg(RReg);
- }
- ++NumReMats;
-}
-
-
-// ReusedOp - For each reused operand, we keep track of a bit of information, in
-// case we need to rollback upon processing a new operand. See comments below.
-namespace {
- struct ReusedOp {
- // The MachineInstr operand that reused an available value.
- unsigned Operand;
-
- // StackSlotOrReMat - The spill slot or remat id of the value being reused.
- unsigned StackSlotOrReMat;
-
- // PhysRegReused - The physical register the value was available in.
- unsigned PhysRegReused;
-
- // AssignedPhysReg - The physreg that was assigned for use by the reload.
- unsigned AssignedPhysReg;
-
- // VirtReg - The virtual register itself.
- unsigned VirtReg;
-
- ReusedOp(unsigned o, unsigned ss, unsigned prr, unsigned apr,
- unsigned vreg)
- : Operand(o), StackSlotOrReMat(ss), PhysRegReused(prr),
- AssignedPhysReg(apr), VirtReg(vreg) {}
- };
-
- /// ReuseInfo - This maintains a collection of ReuseOp's for each operand that
- /// is reused instead of reloaded.
- class VISIBILITY_HIDDEN ReuseInfo {
- MachineInstr &MI;
- std::vector<ReusedOp> Reuses;
- BitVector PhysRegsClobbered;
- public:
- ReuseInfo(MachineInstr &mi, const TargetRegisterInfo *tri) : MI(mi) {
- PhysRegsClobbered.resize(tri->getNumRegs());
- }
-
- bool hasReuses() const {
- return !Reuses.empty();
- }
-
- /// addReuse - If we choose to reuse a virtual register that is already
- /// available instead of reloading it, remember that we did so.
- void addReuse(unsigned OpNo, unsigned StackSlotOrReMat,
- unsigned PhysRegReused, unsigned AssignedPhysReg,
- unsigned VirtReg) {
- // If the reload is to the assigned register anyway, no undo will be
- // required.
- if (PhysRegReused == AssignedPhysReg) return;
-
- // Otherwise, remember this.
- Reuses.push_back(ReusedOp(OpNo, StackSlotOrReMat, PhysRegReused,
- AssignedPhysReg, VirtReg));
- }
-
- void markClobbered(unsigned PhysReg) {
- PhysRegsClobbered.set(PhysReg);
- }
-
- bool isClobbered(unsigned PhysReg) const {
- return PhysRegsClobbered.test(PhysReg);
- }
-
- /// GetRegForReload - We are about to emit a reload into PhysReg. If there
- /// is some other operand that is using the specified register, either pick
- /// a new register to use, or evict the previous reload and use this reg.
- unsigned GetRegForReload(unsigned PhysReg, MachineInstr *MI,
- AvailableSpills &Spills,
- std::vector<MachineInstr*> &MaybeDeadStores,
- SmallSet<unsigned, 8> &Rejected,
- BitVector &RegKills,
- std::vector<MachineOperand*> &KillOps,
- VirtRegMap &VRM) {
- const TargetInstrInfo* TII = MI->getParent()->getParent()->getTarget()
- .getInstrInfo();
-
- if (Reuses.empty()) return PhysReg; // This is most often empty.
-
- for (unsigned ro = 0, e = Reuses.size(); ro != e; ++ro) {
- ReusedOp &Op = Reuses[ro];
- // If we find some other reuse that was supposed to use this register
- // exactly for its reload, we can change this reload to use ITS reload
- // register. That is, unless its reload register has already been
- // considered and subsequently rejected because it has also been reused
- // by another operand.
- if (Op.PhysRegReused == PhysReg &&
- Rejected.count(Op.AssignedPhysReg) == 0) {
- // Yup, use the reload register that we didn't use before.
- unsigned NewReg = Op.AssignedPhysReg;
- Rejected.insert(PhysReg);
- return GetRegForReload(NewReg, MI, Spills, MaybeDeadStores, Rejected,
- RegKills, KillOps, VRM);
- } else {
- // Otherwise, we might also have a problem if a previously reused
- // value aliases the new register. If so, codegen the previous reload
- // and use this one.
- unsigned PRRU = Op.PhysRegReused;
- const TargetRegisterInfo *TRI = Spills.getRegInfo();
- if (TRI->areAliases(PRRU, PhysReg)) {
- // Okay, we found out that an alias of a reused register
- // was used. This isn't good because it means we have
- // to undo a previous reuse.
- MachineBasicBlock *MBB = MI->getParent();
- const TargetRegisterClass *AliasRC =
- MBB->getParent()->getRegInfo().getRegClass(Op.VirtReg);
-
- // Copy Op out of the vector and remove it, we're going to insert an
- // explicit load for it.
- ReusedOp NewOp = Op;
- Reuses.erase(Reuses.begin()+ro);
-
- // Ok, we're going to try to reload the assigned physreg into the
- // slot that we were supposed to in the first place. However, that
- // register could hold a reuse. Check to see if it conflicts or
- // would prefer us to use a different register.
- unsigned NewPhysReg = GetRegForReload(NewOp.AssignedPhysReg,
- MI, Spills, MaybeDeadStores,
- Rejected, RegKills, KillOps, VRM);
-
- MachineBasicBlock::iterator MII = MI;
- if (NewOp.StackSlotOrReMat > VirtRegMap::MAX_STACK_SLOT) {
- ReMaterialize(*MBB, MII, NewPhysReg, NewOp.VirtReg, TII, TRI,VRM);
- } else {
- TII->loadRegFromStackSlot(*MBB, MII, NewPhysReg,
- NewOp.StackSlotOrReMat, AliasRC);
- MachineInstr *LoadMI = prior(MII);
- VRM.addSpillSlotUse(NewOp.StackSlotOrReMat, LoadMI);
- // Any stores to this stack slot are not dead anymore.
- MaybeDeadStores[NewOp.StackSlotOrReMat] = NULL;
- ++NumLoads;
- }
- Spills.ClobberPhysReg(NewPhysReg);
- Spills.ClobberPhysReg(NewOp.PhysRegReused);
-
- MI->getOperand(NewOp.Operand).setReg(NewPhysReg);
-
- Spills.addAvailable(NewOp.StackSlotOrReMat, MI, NewPhysReg);
- --MII;
- UpdateKills(*MII, RegKills, KillOps);
- DOUT << '\t' << *MII;
-
- DOUT << "Reuse undone!\n";
- --NumReused;
-
- // Finally, PhysReg is now available, go ahead and use it.
- return PhysReg;
- }
- }
- }
- return PhysReg;
- }
-
- /// GetRegForReload - Helper for the above GetRegForReload(). Add a
- /// 'Rejected' set to remember which registers have been considered and
- /// rejected for the reload. This avoids infinite looping in case like
- /// this:
- /// t1 := op t2, t3
- /// t2 <- assigned r0 for use by the reload but ended up reuse r1
- /// t3 <- assigned r1 for use by the reload but ended up reuse r0
- /// t1 <- desires r1
- /// sees r1 is taken by t2, tries t2's reload register r0
- /// sees r0 is taken by t3, tries t3's reload register r1
- /// sees r1 is taken by t2, tries t2's reload register r0 ...
- unsigned GetRegForReload(unsigned PhysReg, MachineInstr *MI,
- AvailableSpills &Spills,
- std::vector<MachineInstr*> &MaybeDeadStores,
- BitVector &RegKills,
- std::vector<MachineOperand*> &KillOps,
- VirtRegMap &VRM) {
- SmallSet<unsigned, 8> Rejected;
- return GetRegForReload(PhysReg, MI, Spills, MaybeDeadStores, Rejected,
- RegKills, KillOps, VRM);
- }
- };
-}
-
-/// PrepForUnfoldOpti - Turn a store folding instruction into a load folding
-/// instruction. e.g.
-/// xorl %edi, %eax
-/// movl %eax, -32(%ebp)
-/// movl -36(%ebp), %eax
-/// orl %eax, -32(%ebp)
-/// ==>
-/// xorl %edi, %eax
-/// orl -36(%ebp), %eax
-/// mov %eax, -32(%ebp)
-/// This enables unfolding optimization for a subsequent instruction which will
-/// also eliminate the newly introduced store instruction.
-bool LocalSpiller::PrepForUnfoldOpti(MachineBasicBlock &MBB,
- MachineBasicBlock::iterator &MII,
- std::vector<MachineInstr*> &MaybeDeadStores,
- AvailableSpills &Spills,
- BitVector &RegKills,
- std::vector<MachineOperand*> &KillOps,
- VirtRegMap &VRM) {
- MachineFunction &MF = *MBB.getParent();
- MachineInstr &MI = *MII;
- unsigned UnfoldedOpc = 0;
- unsigned UnfoldPR = 0;
- unsigned UnfoldVR = 0;
- int FoldedSS = VirtRegMap::NO_STACK_SLOT;
- VirtRegMap::MI2VirtMapTy::const_iterator I, End;
- for (tie(I, End) = VRM.getFoldedVirts(&MI); I != End; ) {
- // Only transform a MI that folds a single register.
- if (UnfoldedOpc)
- return false;
- UnfoldVR = I->second.first;
- VirtRegMap::ModRef MR = I->second.second;
- // MI2VirtMap be can updated which invalidate the iterator.
- // Increment the iterator first.
- ++I;
- if (VRM.isAssignedReg(UnfoldVR))
- continue;
- // If this reference is not a use, any previous store is now dead.
- // Otherwise, the store to this stack slot is not dead anymore.
- FoldedSS = VRM.getStackSlot(UnfoldVR);
- MachineInstr* DeadStore = MaybeDeadStores[FoldedSS];
- if (DeadStore && (MR & VirtRegMap::isModRef)) {
- unsigned PhysReg = Spills.getSpillSlotOrReMatPhysReg(FoldedSS);
- if (!PhysReg || !DeadStore->readsRegister(PhysReg))
- continue;
- UnfoldPR = PhysReg;
- UnfoldedOpc = TII->getOpcodeAfterMemoryUnfold(MI.getOpcode(),
- false, true);
- }
- }
-
- if (!UnfoldedOpc)
- return false;
-
- for (unsigned i = 0, e = MI.getNumOperands(); i != e; ++i) {
- MachineOperand &MO = MI.getOperand(i);
- if (!MO.isRegister() || MO.getReg() == 0 || !MO.isUse())
- continue;
- unsigned VirtReg = MO.getReg();
- if (TargetRegisterInfo::isPhysicalRegister(VirtReg) || MO.getSubReg())
- continue;
- if (VRM.isAssignedReg(VirtReg)) {
- unsigned PhysReg = VRM.getPhys(VirtReg);
- if (PhysReg && TRI->regsOverlap(PhysReg, UnfoldPR))
- return false;
- } else if (VRM.isReMaterialized(VirtReg))
- continue;
- int SS = VRM.getStackSlot(VirtReg);
- unsigned PhysReg = Spills.getSpillSlotOrReMatPhysReg(SS);
- if (PhysReg) {
- if (TRI->regsOverlap(PhysReg, UnfoldPR))
- return false;
- continue;
- }
- PhysReg = VRM.getPhys(VirtReg);
- if (!TRI->regsOverlap(PhysReg, UnfoldPR))
- continue;
-
- // Ok, we'll need to reload the value into a register which makes
- // it impossible to perform the store unfolding optimization later.
- // Let's see if it is possible to fold the load if the store is
- // unfolded. This allows us to perform the store unfolding
- // optimization.
- SmallVector<MachineInstr*, 4> NewMIs;
- if (TII->unfoldMemoryOperand(MF, &MI, UnfoldVR, false, false, NewMIs)) {
- assert(NewMIs.size() == 1);
- MachineInstr *NewMI = NewMIs.back();
- NewMIs.clear();
- int Idx = NewMI->findRegisterUseOperandIdx(VirtReg, false);
- assert(Idx != -1);
- SmallVector<unsigned, 2> Ops;
- Ops.push_back(Idx);
- MachineInstr *FoldedMI = TII->foldMemoryOperand(MF, NewMI, Ops, SS);
- if (FoldedMI) {
- VRM.addSpillSlotUse(SS, FoldedMI);
- if (!VRM.hasPhys(UnfoldVR))
- VRM.assignVirt2Phys(UnfoldVR, UnfoldPR);
- VRM.virtFolded(VirtReg, FoldedMI, VirtRegMap::isRef);
- MII = MBB.insert(MII, FoldedMI);
- VRM.RemoveMachineInstrFromMaps(&MI);
- MBB.erase(&MI);
- return true;
- }
- delete NewMI;
- }
- }
- return false;
-}
-
-/// findSuperReg - Find the SubReg's super-register of given register class
-/// where its SubIdx sub-register is SubReg.
-static unsigned findSuperReg(const TargetRegisterClass *RC, unsigned SubReg,
- unsigned SubIdx, const TargetRegisterInfo *TRI) {
- for (TargetRegisterClass::iterator I = RC->begin(), E = RC->end();
- I != E; ++I) {
- unsigned Reg = *I;
- if (TRI->getSubReg(Reg, SubIdx) == SubReg)
- return Reg;
- }
- return 0;
-}
-
-/// SpillRegToStackSlot - Spill a register to a specified stack slot. Check if
-/// the last store to the same slot is now dead. If so, remove the last store.
-void LocalSpiller::SpillRegToStackSlot(MachineBasicBlock &MBB,
- MachineBasicBlock::iterator &MII,
- int Idx, unsigned PhysReg, int StackSlot,
- const TargetRegisterClass *RC,
- bool isAvailable, MachineInstr *&LastStore,
- AvailableSpills &Spills,
- SmallSet<MachineInstr*, 4> &ReMatDefs,
- BitVector &RegKills,
- std::vector<MachineOperand*> &KillOps,
- VirtRegMap &VRM) {
- TII->storeRegToStackSlot(MBB, next(MII), PhysReg, true, StackSlot, RC);
- MachineInstr *StoreMI = next(MII);
- VRM.addSpillSlotUse(StackSlot, StoreMI);
- DOUT << "Store:\t" << *StoreMI;
-
- // If there is a dead store to this stack slot, nuke it now.
- if (LastStore) {
- DOUT << "Removed dead store:\t" << *LastStore;
- ++NumDSE;
- SmallVector<unsigned, 2> KillRegs;
- InvalidateKills(*LastStore, RegKills, KillOps, &KillRegs);
- MachineBasicBlock::iterator PrevMII = LastStore;
- bool CheckDef = PrevMII != MBB.begin();
- if (CheckDef)
- --PrevMII;
- VRM.RemoveMachineInstrFromMaps(LastStore);
- MBB.erase(LastStore);
- if (CheckDef) {
- // Look at defs of killed registers on the store. Mark the defs
- // as dead since the store has been deleted and they aren't
- // being reused.
- for (unsigned j = 0, ee = KillRegs.size(); j != ee; ++j) {
- bool HasOtherDef = false;
- if (InvalidateRegDef(PrevMII, *MII, KillRegs[j], HasOtherDef)) {
- MachineInstr *DeadDef = PrevMII;
- if (ReMatDefs.count(DeadDef) && !HasOtherDef) {
- // FIXME: This assumes a remat def does not have side
- // effects.
- VRM.RemoveMachineInstrFromMaps(DeadDef);
- MBB.erase(DeadDef);
- ++NumDRM;
- }
- }
- }
- }
- }
-
- LastStore = next(MII);
-
- // If the stack slot value was previously available in some other
- // register, change it now. Otherwise, make the register available,
- // in PhysReg.
- Spills.ModifyStackSlotOrReMat(StackSlot);
- Spills.ClobberPhysReg(PhysReg);
- Spills.addAvailable(StackSlot, LastStore, PhysReg, isAvailable);
- ++NumStores;
-}
-
-/// rewriteMBB - Keep track of which spills are available even after the
-/// register allocator is done with them. If possible, avid reloading vregs.
-void LocalSpiller::RewriteMBB(MachineBasicBlock &MBB, VirtRegMap &VRM) {
- DOUT << MBB.getBasicBlock()->getName() << ":\n";
-
- MachineFunction &MF = *MBB.getParent();
-
- // Spills - Keep track of which spilled values are available in physregs so
- // that we can choose to reuse the physregs instead of emitting reloads.
- AvailableSpills Spills(TRI, TII);
-
- // MaybeDeadStores - When we need to write a value back into a stack slot,
- // keep track of the inserted store. If the stack slot value is never read
- // (because the value was used from some available register, for example), and
- // subsequently stored to, the original store is dead. This map keeps track
- // of inserted stores that are not used. If we see a subsequent store to the
- // same stack slot, the original store is deleted.
- std::vector<MachineInstr*> MaybeDeadStores;
- MaybeDeadStores.resize(MF.getFrameInfo()->getObjectIndexEnd(), NULL);
-
- // ReMatDefs - These are rematerializable def MIs which are not deleted.
- SmallSet<MachineInstr*, 4> ReMatDefs;
-
- // Keep track of kill information.
- BitVector RegKills(TRI->getNumRegs());
- std::vector<MachineOperand*> KillOps;
- KillOps.resize(TRI->getNumRegs(), NULL);
-
- for (MachineBasicBlock::iterator MII = MBB.begin(), E = MBB.end();
- MII != E; ) {
- MachineBasicBlock::iterator NextMII = MII; ++NextMII;
-
- VirtRegMap::MI2VirtMapTy::const_iterator I, End;
- bool Erased = false;
- bool BackTracked = false;
- if (PrepForUnfoldOpti(MBB, MII,
- MaybeDeadStores, Spills, RegKills, KillOps, VRM))
- NextMII = next(MII);
-
- MachineInstr &MI = *MII;
- const TargetInstrDesc &TID = MI.getDesc();
-
- if (VRM.hasEmergencySpills(&MI)) {
- // Spill physical register(s) in the rare case the allocator has run out
- // of registers to allocate.
- SmallSet<int, 4> UsedSS;
- std::vector<unsigned> &EmSpills = VRM.getEmergencySpills(&MI);
- for (unsigned i = 0, e = EmSpills.size(); i != e; ++i) {
- unsigned PhysReg = EmSpills[i];
- const TargetRegisterClass *RC =
- TRI->getPhysicalRegisterRegClass(PhysReg);
- assert(RC && "Unable to determine register class!");
- int SS = VRM.getEmergencySpillSlot(RC);
- if (UsedSS.count(SS))
- assert(0 && "Need to spill more than one physical registers!");
- UsedSS.insert(SS);
- TII->storeRegToStackSlot(MBB, MII, PhysReg, true, SS, RC);
- MachineInstr *StoreMI = prior(MII);
- VRM.addSpillSlotUse(SS, StoreMI);
- TII->loadRegFromStackSlot(MBB, next(MII), PhysReg, SS, RC);
- MachineInstr *LoadMI = next(MII);
- VRM.addSpillSlotUse(SS, LoadMI);
- ++NumPSpills;
- }
- NextMII = next(MII);
- }
-
- // Insert restores here if asked to.
- if (VRM.isRestorePt(&MI)) {
- std::vector<unsigned> &RestoreRegs = VRM.getRestorePtRestores(&MI);
- for (unsigned i = 0, e = RestoreRegs.size(); i != e; ++i) {
- unsigned VirtReg = RestoreRegs[e-i-1]; // Reverse order.
- if (!VRM.getPreSplitReg(VirtReg))
- continue; // Split interval spilled again.
- unsigned Phys = VRM.getPhys(VirtReg);
- RegInfo->setPhysRegUsed(Phys);
- if (VRM.isReMaterialized(VirtReg)) {
- ReMaterialize(MBB, MII, Phys, VirtReg, TII, TRI, VRM);
- } else {
- const TargetRegisterClass* RC = RegInfo->getRegClass(VirtReg);
- int SS = VRM.getStackSlot(VirtReg);
- TII->loadRegFromStackSlot(MBB, &MI, Phys, SS, RC);
- MachineInstr *LoadMI = prior(MII);
- VRM.addSpillSlotUse(SS, LoadMI);
- ++NumLoads;
- }
- // This invalidates Phys.
- Spills.ClobberPhysReg(Phys);
- UpdateKills(*prior(MII), RegKills, KillOps);
- DOUT << '\t' << *prior(MII);
- }
- }
-
- // Insert spills here if asked to.
- if (VRM.isSpillPt(&MI)) {
- std::vector<std::pair<unsigned,bool> > &SpillRegs =
- VRM.getSpillPtSpills(&MI);
- for (unsigned i = 0, e = SpillRegs.size(); i != e; ++i) {
- unsigned VirtReg = SpillRegs[i].first;
- bool isKill = SpillRegs[i].second;
- if (!VRM.getPreSplitReg(VirtReg))
- continue; // Split interval spilled again.
- const TargetRegisterClass *RC = RegInfo->getRegClass(VirtReg);
- unsigned Phys = VRM.getPhys(VirtReg);
- int StackSlot = VRM.getStackSlot(VirtReg);
- TII->storeRegToStackSlot(MBB, next(MII), Phys, isKill, StackSlot, RC);
- MachineInstr *StoreMI = next(MII);
- VRM.addSpillSlotUse(StackSlot, StoreMI);
- DOUT << "Store:\t" << *StoreMI;
- VRM.virtFolded(VirtReg, StoreMI, VirtRegMap::isMod);
- }
- NextMII = next(MII);
- }
-
- /// ReusedOperands - Keep track of operand reuse in case we need to undo
- /// reuse.
- ReuseInfo ReusedOperands(MI, TRI);
- SmallVector<unsigned, 4> VirtUseOps;
- for (unsigned i = 0, e = MI.getNumOperands(); i != e; ++i) {
- MachineOperand &MO = MI.getOperand(i);
- if (!MO.isRegister() || MO.getReg() == 0)
- continue; // Ignore non-register operands.
-
- unsigned VirtReg = MO.getReg();
- if (TargetRegisterInfo::isPhysicalRegister(VirtReg)) {
- // Ignore physregs for spilling, but remember that it is used by this
- // function.
- RegInfo->setPhysRegUsed(VirtReg);
- continue;
- }
-
- // We want to process implicit virtual register uses first.
- if (MO.isImplicit())
- // If the virtual register is implicitly defined, emit a implicit_def
- // before so scavenger knows it's "defined".
- VirtUseOps.insert(VirtUseOps.begin(), i);
- else
- VirtUseOps.push_back(i);
- }
-
- // Process all of the spilled uses and all non spilled reg references.
- for (unsigned j = 0, e = VirtUseOps.size(); j != e; ++j) {
- unsigned i = VirtUseOps[j];
- MachineOperand &MO = MI.getOperand(i);
- unsigned VirtReg = MO.getReg();
- assert(TargetRegisterInfo::isVirtualRegister(VirtReg) &&
- "Not a virtual register?");
-
- unsigned SubIdx = MO.getSubReg();
- if (VRM.isAssignedReg(VirtReg)) {
- // This virtual register was assigned a physreg!
- unsigned Phys = VRM.getPhys(VirtReg);
- RegInfo->setPhysRegUsed(Phys);
- if (MO.isDef())
- ReusedOperands.markClobbered(Phys);
- unsigned RReg = SubIdx ? TRI->getSubReg(Phys, SubIdx) : Phys;
- MI.getOperand(i).setReg(RReg);
- if (VRM.isImplicitlyDefined(VirtReg))
- BuildMI(MBB, MI, TII->get(TargetInstrInfo::IMPLICIT_DEF), RReg);
- continue;
- }
-
- // This virtual register is now known to be a spilled value.
- if (!MO.isUse())
- continue; // Handle defs in the loop below (handle use&def here though)
-
- bool DoReMat = VRM.isReMaterialized(VirtReg);
- int SSorRMId = DoReMat
- ? VRM.getReMatId(VirtReg) : VRM.getStackSlot(VirtReg);
- int ReuseSlot = SSorRMId;
-
- // Check to see if this stack slot is available.
- unsigned PhysReg = Spills.getSpillSlotOrReMatPhysReg(SSorRMId);
-
- // If this is a sub-register use, make sure the reuse register is in the
- // right register class. For example, for x86 not all of the 32-bit
- // registers have accessible sub-registers.
- // Similarly so for EXTRACT_SUBREG. Consider this:
- // EDI = op
- // MOV32_mr fi#1, EDI
- // ...
- // = EXTRACT_SUBREG fi#1
- // fi#1 is available in EDI, but it cannot be reused because it's not in
- // the right register file.
- if (PhysReg &&
- (SubIdx || MI.getOpcode() == TargetInstrInfo::EXTRACT_SUBREG)) {
- const TargetRegisterClass* RC = RegInfo->getRegClass(VirtReg);
- if (!RC->contains(PhysReg))
- PhysReg = 0;
- }
-
- if (PhysReg) {
- // This spilled operand might be part of a two-address operand. If this
- // is the case, then changing it will necessarily require changing the
- // def part of the instruction as well. However, in some cases, we
- // aren't allowed to modify the reused register. If none of these cases
- // apply, reuse it.
- bool CanReuse = true;
- int ti = TID.getOperandConstraint(i, TOI::TIED_TO);
- if (ti != -1 &&
- MI.getOperand(ti).isRegister() &&
- MI.getOperand(ti).getReg() == VirtReg) {
- // Okay, we have a two address operand. We can reuse this physreg as
- // long as we are allowed to clobber the value and there isn't an
- // earlier def that has already clobbered the physreg.
- CanReuse = Spills.canClobberPhysReg(ReuseSlot) &&
- !ReusedOperands.isClobbered(PhysReg);
- }
-
- if (CanReuse) {
- // If this stack slot value is already available, reuse it!
- if (ReuseSlot > VirtRegMap::MAX_STACK_SLOT)
- DOUT << "Reusing RM#" << ReuseSlot-VirtRegMap::MAX_STACK_SLOT-1;
- else
- DOUT << "Reusing SS#" << ReuseSlot;
- DOUT << " from physreg "
- << TRI->getName(PhysReg) << " for vreg"
- << VirtReg <<" instead of reloading into physreg "
- << TRI->getName(VRM.getPhys(VirtReg)) << "\n";
- unsigned RReg = SubIdx ? TRI->getSubReg(PhysReg, SubIdx) : PhysReg;
- MI.getOperand(i).setReg(RReg);
-
- // The only technical detail we have is that we don't know that
- // PhysReg won't be clobbered by a reloaded stack slot that occurs
- // later in the instruction. In particular, consider 'op V1, V2'.
- // If V1 is available in physreg R0, we would choose to reuse it
- // here, instead of reloading it into the register the allocator
- // indicated (say R1). However, V2 might have to be reloaded
- // later, and it might indicate that it needs to live in R0. When
- // this occurs, we need to have information available that
- // indicates it is safe to use R1 for the reload instead of R0.
- //
- // To further complicate matters, we might conflict with an alias,
- // or R0 and R1 might not be compatible with each other. In this
- // case, we actually insert a reload for V1 in R1, ensuring that
- // we can get at R0 or its alias.
- ReusedOperands.addReuse(i, ReuseSlot, PhysReg,
- VRM.getPhys(VirtReg), VirtReg);
- if (ti != -1)
- // Only mark it clobbered if this is a use&def operand.
- ReusedOperands.markClobbered(PhysReg);
- ++NumReused;
-
- if (MI.getOperand(i).isKill() &&
- ReuseSlot <= VirtRegMap::MAX_STACK_SLOT) {
- // This was the last use and the spilled value is still available
- // for reuse. That means the spill was unnecessary!
- MachineInstr* DeadStore = MaybeDeadStores[ReuseSlot];
- if (DeadStore) {
- DOUT << "Removed dead store:\t" << *DeadStore;
- InvalidateKills(*DeadStore, RegKills, KillOps);
- VRM.RemoveMachineInstrFromMaps(DeadStore);
- MBB.erase(DeadStore);
- MaybeDeadStores[ReuseSlot] = NULL;
- ++NumDSE;
- }
- }
- continue;
- } // CanReuse
-
- // Otherwise we have a situation where we have a two-address instruction
- // whose mod/ref operand needs to be reloaded. This reload is already
- // available in some register "PhysReg", but if we used PhysReg as the
- // operand to our 2-addr instruction, the instruction would modify
- // PhysReg. This isn't cool if something later uses PhysReg and expects
- // to get its initial value.
- //
- // To avoid this problem, and to avoid doing a load right after a store,
- // we emit a copy from PhysReg into the designated register for this
- // operand.
- unsigned DesignatedReg = VRM.getPhys(VirtReg);
- assert(DesignatedReg && "Must map virtreg to physreg!");
-
- // Note that, if we reused a register for a previous operand, the
- // register we want to reload into might not actually be
- // available. If this occurs, use the register indicated by the
- // reuser.
- if (ReusedOperands.hasReuses())
- DesignatedReg = ReusedOperands.GetRegForReload(DesignatedReg, &MI,
- Spills, MaybeDeadStores, RegKills, KillOps, VRM);
-
- // If the mapped designated register is actually the physreg we have
- // incoming, we don't need to inserted a dead copy.
- if (DesignatedReg == PhysReg) {
- // If this stack slot value is already available, reuse it!
- if (ReuseSlot > VirtRegMap::MAX_STACK_SLOT)
- DOUT << "Reusing RM#" << ReuseSlot-VirtRegMap::MAX_STACK_SLOT-1;
- else
- DOUT << "Reusing SS#" << ReuseSlot;
- DOUT << " from physreg " << TRI->getName(PhysReg)
- << " for vreg" << VirtReg
- << " instead of reloading into same physreg.\n";
- unsigned RReg = SubIdx ? TRI->getSubReg(PhysReg, SubIdx) : PhysReg;
- MI.getOperand(i).setReg(RReg);
- ReusedOperands.markClobbered(RReg);
- ++NumReused;
- continue;
- }
-
- const TargetRegisterClass* RC = RegInfo->getRegClass(VirtReg);
- RegInfo->setPhysRegUsed(DesignatedReg);
- ReusedOperands.markClobbered(DesignatedReg);
- TII->copyRegToReg(MBB, &MI, DesignatedReg, PhysReg, RC, RC);
-
- MachineInstr *CopyMI = prior(MII);
- UpdateKills(*CopyMI, RegKills, KillOps);
-
- // This invalidates DesignatedReg.
- Spills.ClobberPhysReg(DesignatedReg);
-
- Spills.addAvailable(ReuseSlot, &MI, DesignatedReg);
- unsigned RReg =
- SubIdx ? TRI->getSubReg(DesignatedReg, SubIdx) : DesignatedReg;
- MI.getOperand(i).setReg(RReg);
- DOUT << '\t' << *prior(MII);
- ++NumReused;
- continue;
- } // if (PhysReg)
-
- // Otherwise, reload it and remember that we have it.
- PhysReg = VRM.getPhys(VirtReg);
- assert(PhysReg && "Must map virtreg to physreg!");
-
- // Note that, if we reused a register for a previous operand, the
- // register we want to reload into might not actually be
- // available. If this occurs, use the register indicated by the
- // reuser.
- if (ReusedOperands.hasReuses())
- PhysReg = ReusedOperands.GetRegForReload(PhysReg, &MI,
- Spills, MaybeDeadStores, RegKills, KillOps, VRM);
-
- RegInfo->setPhysRegUsed(PhysReg);
- ReusedOperands.markClobbered(PhysReg);
- if (DoReMat) {
- ReMaterialize(MBB, MII, PhysReg, VirtReg, TII, TRI, VRM);
- } else {
- const TargetRegisterClass* RC = RegInfo->getRegClass(VirtReg);
- TII->loadRegFromStackSlot(MBB, &MI, PhysReg, SSorRMId, RC);
- MachineInstr *LoadMI = prior(MII);
- VRM.addSpillSlotUse(SSorRMId, LoadMI);
- ++NumLoads;
- }
- // This invalidates PhysReg.
- Spills.ClobberPhysReg(PhysReg);
-
- // Any stores to this stack slot are not dead anymore.
- if (!DoReMat)
- MaybeDeadStores[SSorRMId] = NULL;
- Spills.addAvailable(SSorRMId, &MI, PhysReg);
- // Assumes this is the last use. IsKill will be unset if reg is reused
- // unless it's a two-address operand.
- if (TID.getOperandConstraint(i, TOI::TIED_TO) == -1)
- MI.getOperand(i).setIsKill();
- unsigned RReg = SubIdx ? TRI->getSubReg(PhysReg, SubIdx) : PhysReg;
- MI.getOperand(i).setReg(RReg);
- UpdateKills(*prior(MII), RegKills, KillOps);
- DOUT << '\t' << *prior(MII);
- }
-
- DOUT << '\t' << MI;
-
-
- // If we have folded references to memory operands, make sure we clear all
- // physical registers that may contain the value of the spilled virtual
- // register
- SmallSet<int, 2> FoldedSS;
- for (tie(I, End) = VRM.getFoldedVirts(&MI); I != End; ) {
- unsigned VirtReg = I->second.first;
- VirtRegMap::ModRef MR = I->second.second;
- DOUT << "Folded vreg: " << VirtReg << " MR: " << MR;
-
- // MI2VirtMap be can updated which invalidate the iterator.
- // Increment the iterator first.
- ++I;
- int SS = VRM.getStackSlot(VirtReg);
- if (SS == VirtRegMap::NO_STACK_SLOT)
- continue;
- FoldedSS.insert(SS);
- DOUT << " - StackSlot: " << SS << "\n";
-
- // If this folded instruction is just a use, check to see if it's a
- // straight load from the virt reg slot.
- if ((MR & VirtRegMap::isRef) && !(MR & VirtRegMap::isMod)) {
- int FrameIdx;
- unsigned DestReg = TII->isLoadFromStackSlot(&MI, FrameIdx);
- if (DestReg && FrameIdx == SS) {
- // If this spill slot is available, turn it into a copy (or nothing)
- // instead of leaving it as a load!
- if (unsigned InReg = Spills.getSpillSlotOrReMatPhysReg(SS)) {
- DOUT << "Promoted Load To Copy: " << MI;
- if (DestReg != InReg) {
- const TargetRegisterClass *RC = RegInfo->getRegClass(VirtReg);
- TII->copyRegToReg(MBB, &MI, DestReg, InReg, RC, RC);
- // Revisit the copy so we make sure to notice the effects of the
- // operation on the destreg (either needing to RA it if it's
- // virtual or needing to clobber any values if it's physical).
- NextMII = &MI;
- --NextMII; // backtrack to the copy.
- BackTracked = true;
- } else {
- DOUT << "Removing now-noop copy: " << MI;
- // Unset last kill since it's being reused.
- InvalidateKill(InReg, RegKills, KillOps);
- }
-
- VRM.RemoveMachineInstrFromMaps(&MI);
- MBB.erase(&MI);
- Erased = true;
- goto ProcessNextInst;
- }
- } else {
- unsigned PhysReg = Spills.getSpillSlotOrReMatPhysReg(SS);
- SmallVector<MachineInstr*, 4> NewMIs;
- if (PhysReg &&
- TII->unfoldMemoryOperand(MF, &MI, PhysReg, false, false, NewMIs)) {
- MBB.insert(MII, NewMIs[0]);
- VRM.RemoveMachineInstrFromMaps(&MI);
- MBB.erase(&MI);
- Erased = true;
- --NextMII; // backtrack to the unfolded instruction.
- BackTracked = true;
- goto ProcessNextInst;
- }
- }
- }
-
- // If this reference is not a use, any previous store is now dead.
- // Otherwise, the store to this stack slot is not dead anymore.
- MachineInstr* DeadStore = MaybeDeadStores[SS];
- if (DeadStore) {
- bool isDead = !(MR & VirtRegMap::isRef);
- MachineInstr *NewStore = NULL;
- if (MR & VirtRegMap::isModRef) {
- unsigned PhysReg = Spills.getSpillSlotOrReMatPhysReg(SS);
- SmallVector<MachineInstr*, 4> NewMIs;
- // We can reuse this physreg as long as we are allowed to clobber
- // the value and there isn't an earlier def that has already clobbered
- // the physreg.
- if (PhysReg &&
- !TII->isStoreToStackSlot(&MI, SS)) { // Not profitable!
- MachineOperand *KillOpnd =
- DeadStore->findRegisterUseOperand(PhysReg, true);
- // Note, if the store is storing a sub-register, it's possible the
- // super-register is needed below.
- if (KillOpnd && !KillOpnd->getSubReg() &&
- TII->unfoldMemoryOperand(MF, &MI, PhysReg, false, true,NewMIs)){
- MBB.insert(MII, NewMIs[0]);
- NewStore = NewMIs[1];
- MBB.insert(MII, NewStore);
- VRM.addSpillSlotUse(SS, NewStore);
- VRM.RemoveMachineInstrFromMaps(&MI);
- MBB.erase(&MI);
- Erased = true;
- --NextMII;
- --NextMII; // backtrack to the unfolded instruction.
- BackTracked = true;
- isDead = true;
- }
- }
- }
-
- if (isDead) { // Previous store is dead.
- // If we get here, the store is dead, nuke it now.
- DOUT << "Removed dead store:\t" << *DeadStore;
- InvalidateKills(*DeadStore, RegKills, KillOps);
- VRM.RemoveMachineInstrFromMaps(DeadStore);
- MBB.erase(DeadStore);
- if (!NewStore)
- ++NumDSE;
- }
-
- MaybeDeadStores[SS] = NULL;
- if (NewStore) {
- // Treat this store as a spill merged into a copy. That makes the
- // stack slot value available.
- VRM.virtFolded(VirtReg, NewStore, VirtRegMap::isMod);
- goto ProcessNextInst;
- }
- }
-
- // If the spill slot value is available, and this is a new definition of
- // the value, the value is not available anymore.
- if (MR & VirtRegMap::isMod) {
- // Notice that the value in this stack slot has been modified.
- Spills.ModifyStackSlotOrReMat(SS);
-
- // If this is *just* a mod of the value, check to see if this is just a
- // store to the spill slot (i.e. the spill got merged into the copy). If
- // so, realize that the vreg is available now, and add the store to the
- // MaybeDeadStore info.
- int StackSlot;
- if (!(MR & VirtRegMap::isRef)) {
- if (unsigned SrcReg = TII->isStoreToStackSlot(&MI, StackSlot)) {
- assert(TargetRegisterInfo::isPhysicalRegister(SrcReg) &&
- "Src hasn't been allocated yet?");
- // Okay, this is certainly a store of SrcReg to [StackSlot]. Mark
- // this as a potentially dead store in case there is a subsequent
- // store into the stack slot without a read from it.
- MaybeDeadStores[StackSlot] = &MI;
-
- // If the stack slot value was previously available in some other
- // register, change it now. Otherwise, make the register available,
- // in PhysReg.
- Spills.addAvailable(StackSlot, &MI, SrcReg, false/*don't clobber*/);
- }
- }
- }
- }
-
- // Process all of the spilled defs.
- for (unsigned i = 0, e = MI.getNumOperands(); i != e; ++i) {
- MachineOperand &MO = MI.getOperand(i);
- if (!(MO.isRegister() && MO.getReg() && MO.isDef()))
- continue;
-
- unsigned VirtReg = MO.getReg();
- if (!TargetRegisterInfo::isVirtualRegister(VirtReg)) {
- // Check to see if this is a noop copy. If so, eliminate the
- // instruction before considering the dest reg to be changed.
- unsigned Src, Dst;
- if (TII->isMoveInstr(MI, Src, Dst) && Src == Dst) {
- ++NumDCE;
- DOUT << "Removing now-noop copy: " << MI;
- VRM.RemoveMachineInstrFromMaps(&MI);
- MBB.erase(&MI);
- Erased = true;
- Spills.disallowClobberPhysReg(VirtReg);
- goto ProcessNextInst;
- }
-
- // If it's not a no-op copy, it clobbers the value in the destreg.
- Spills.ClobberPhysReg(VirtReg);
- ReusedOperands.markClobbered(VirtReg);
-
- // Check to see if this instruction is a load from a stack slot into
- // a register. If so, this provides the stack slot value in the reg.
- int FrameIdx;
- if (unsigned DestReg = TII->isLoadFromStackSlot(&MI, FrameIdx)) {
- assert(DestReg == VirtReg && "Unknown load situation!");
-
- // If it is a folded reference, then it's not safe to clobber.
- bool Folded = FoldedSS.count(FrameIdx);
- // Otherwise, if it wasn't available, remember that it is now!
- Spills.addAvailable(FrameIdx, &MI, DestReg, !Folded);
- goto ProcessNextInst;
- }
-
- continue;
- }
-
- unsigned SubIdx = MO.getSubReg();
- bool DoReMat = VRM.isReMaterialized(VirtReg);
- if (DoReMat)
- ReMatDefs.insert(&MI);
-
- // The only vregs left are stack slot definitions.
- int StackSlot = VRM.getStackSlot(VirtReg);
- const TargetRegisterClass *RC = RegInfo->getRegClass(VirtReg);
-
- // If this def is part of a two-address operand, make sure to execute
- // the store from the correct physical register.
- unsigned PhysReg;
- int TiedOp = MI.getDesc().findTiedToSrcOperand(i);
- if (TiedOp != -1) {
- PhysReg = MI.getOperand(TiedOp).getReg();
- if (SubIdx) {
- unsigned SuperReg = findSuperReg(RC, PhysReg, SubIdx, TRI);
- assert(SuperReg && TRI->getSubReg(SuperReg, SubIdx) == PhysReg &&
- "Can't find corresponding super-register!");
- PhysReg = SuperReg;
- }
- } else {
- PhysReg = VRM.getPhys(VirtReg);
- if (ReusedOperands.isClobbered(PhysReg)) {
- // Another def has taken the assigned physreg. It must have been a
- // use&def which got it due to reuse. Undo the reuse!
- PhysReg = ReusedOperands.GetRegForReload(PhysReg, &MI,
- Spills, MaybeDeadStores, RegKills, KillOps, VRM);
- }
- }
-
- assert(PhysReg && "VR not assigned a physical register?");
- RegInfo->setPhysRegUsed(PhysReg);
- unsigned RReg = SubIdx ? TRI->getSubReg(PhysReg, SubIdx) : PhysReg;
- ReusedOperands.markClobbered(RReg);
- MI.getOperand(i).setReg(RReg);
-
- if (!MO.isDead()) {
- MachineInstr *&LastStore = MaybeDeadStores[StackSlot];
- SpillRegToStackSlot(MBB, MII, -1, PhysReg, StackSlot, RC, true,
- LastStore, Spills, ReMatDefs, RegKills, KillOps, VRM);
- NextMII = next(MII);
-
- // Check to see if this is a noop copy. If so, eliminate the
- // instruction before considering the dest reg to be changed.
- {
- unsigned Src, Dst;
- if (TII->isMoveInstr(MI, Src, Dst) && Src == Dst) {
- ++NumDCE;
- DOUT << "Removing now-noop copy: " << MI;
- VRM.RemoveMachineInstrFromMaps(&MI);
- MBB.erase(&MI);
- Erased = true;
- UpdateKills(*LastStore, RegKills, KillOps);
- goto ProcessNextInst;
- }
- }
- }
- }
- ProcessNextInst:
- if (!Erased && !BackTracked) {
- for (MachineBasicBlock::iterator II = MI; II != NextMII; ++II)
- UpdateKills(*II, RegKills, KillOps);
- }
- MII = NextMII;
- }
-}
-
-llvm::Spiller* llvm::createSpiller() {
- switch (SpillerOpt) {
- default: assert(0 && "Unreachable!");
- case local:
- return new LocalSpiller();
- case simple:
- return new SimpleSpiller();
- }
-}
diff --git a/release_23/lib/CodeGen/VirtRegMap.h b/release_23/lib/CodeGen/VirtRegMap.h
deleted file mode 100644
index 46f177d4f5c6..000000000000
--- a/release_23/lib/CodeGen/VirtRegMap.h
+++ /dev/null
@@ -1,448 +0,0 @@
-//===-- llvm/CodeGen/VirtRegMap.h - Virtual Register Map -*- C++ -*--------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements a virtual register map. This maps virtual registers to
-// physical registers and virtual registers to stack slots. It is created and
-// updated by a register allocator and then used by a machine code rewriter that
-// adds spill code and rewrites virtual into physical register references.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_CODEGEN_VIRTREGMAP_H
-#define LLVM_CODEGEN_VIRTREGMAP_H
-
-#include "llvm/Target/TargetRegisterInfo.h"
-#include "llvm/ADT/BitVector.h"
-#include "llvm/ADT/DenseMap.h"
-#include "llvm/ADT/IndexedMap.h"
-#include "llvm/ADT/SmallPtrSet.h"
-#include "llvm/Support/Streams.h"
-#include <map>
-
-namespace llvm {
- class MachineInstr;
- class MachineFunction;
- class TargetInstrInfo;
-
- class VirtRegMap {
- public:
- enum {
- NO_PHYS_REG = 0,
- NO_STACK_SLOT = (1L << 30)-1,
- MAX_STACK_SLOT = (1L << 18)-1
- };
-
- enum ModRef { isRef = 1, isMod = 2, isModRef = 3 };
- typedef std::multimap<MachineInstr*,
- std::pair<unsigned, ModRef> > MI2VirtMapTy;
-
- private:
- const TargetInstrInfo &TII;
-
- MachineFunction &MF;
- /// Virt2PhysMap - This is a virtual to physical register
- /// mapping. Each virtual register is required to have an entry in
- /// it; even spilled virtual registers (the register mapped to a
- /// spilled register is the temporary used to load it from the
- /// stack).
- IndexedMap<unsigned, VirtReg2IndexFunctor> Virt2PhysMap;
-
- /// Virt2StackSlotMap - This is virtual register to stack slot
- /// mapping. Each spilled virtual register has an entry in it
- /// which corresponds to the stack slot this register is spilled
- /// at.
- IndexedMap<int, VirtReg2IndexFunctor> Virt2StackSlotMap;
-
- /// Virt2ReMatIdMap - This is virtual register to rematerialization id
- /// mapping. Each spilled virtual register that should be remat'd has an
- /// entry in it which corresponds to the remat id.
- IndexedMap<int, VirtReg2IndexFunctor> Virt2ReMatIdMap;
-
- /// Virt2SplitMap - This is virtual register to splitted virtual register
- /// mapping.
- IndexedMap<unsigned, VirtReg2IndexFunctor> Virt2SplitMap;
-
- /// Virt2SplitKillMap - This is splitted virtual register to its last use
- /// (kill) index mapping.
- IndexedMap<unsigned> Virt2SplitKillMap;
-
- /// ReMatMap - This is virtual register to re-materialized instruction
- /// mapping. Each virtual register whose definition is going to be
- /// re-materialized has an entry in it.
- IndexedMap<MachineInstr*, VirtReg2IndexFunctor> ReMatMap;
-
- /// MI2VirtMap - This is MachineInstr to virtual register
- /// mapping. In the case of memory spill code being folded into
- /// instructions, we need to know which virtual register was
- /// read/written by this instruction.
- MI2VirtMapTy MI2VirtMap;
-
- /// SpillPt2VirtMap - This records the virtual registers which should
- /// be spilled right after the MachineInstr due to live interval
- /// splitting.
- std::map<MachineInstr*, std::vector<std::pair<unsigned,bool> > >
- SpillPt2VirtMap;
-
- /// RestorePt2VirtMap - This records the virtual registers which should
- /// be restored right before the MachineInstr due to live interval
- /// splitting.
- std::map<MachineInstr*, std::vector<unsigned> > RestorePt2VirtMap;
-
- /// EmergencySpillMap - This records the physical registers that should
- /// be spilled / restored around the MachineInstr since the register
- /// allocator has run out of registers.
- std::map<MachineInstr*, std::vector<unsigned> > EmergencySpillMap;
-
- /// EmergencySpillSlots - This records emergency spill slots used to
- /// spill physical registers when the register allocator runs out of
- /// registers. Ideally only one stack slot is used per function per
- /// register class.
- std::map<const TargetRegisterClass*, int> EmergencySpillSlots;
-
- /// ReMatId - Instead of assigning a stack slot to a to be rematerialized
- /// virtual register, an unique id is being assigned. This keeps track of
- /// the highest id used so far. Note, this starts at (1<<18) to avoid
- /// conflicts with stack slot numbers.
- int ReMatId;
-
- /// LowSpillSlot, HighSpillSlot - Lowest and highest spill slot indexes.
- int LowSpillSlot, HighSpillSlot;
-
- /// SpillSlotToUsesMap - Records uses for each register spill slot.
- SmallVector<SmallPtrSet<MachineInstr*, 4>, 8> SpillSlotToUsesMap;
-
- /// ImplicitDefed - One bit for each virtual register. If set it indicates
- /// the register is implicitly defined.
- BitVector ImplicitDefed;
-
- VirtRegMap(const VirtRegMap&); // DO NOT IMPLEMENT
- void operator=(const VirtRegMap&); // DO NOT IMPLEMENT
-
- public:
- explicit VirtRegMap(MachineFunction &mf);
-
- void grow();
-
- /// @brief returns true if the specified virtual register is
- /// mapped to a physical register
- bool hasPhys(unsigned virtReg) const {
- return getPhys(virtReg) != NO_PHYS_REG;
- }
-
- /// @brief returns the physical register mapped to the specified
- /// virtual register
- unsigned getPhys(unsigned virtReg) const {
- assert(TargetRegisterInfo::isVirtualRegister(virtReg));
- return Virt2PhysMap[virtReg];
- }
-
- /// @brief creates a mapping for the specified virtual register to
- /// the specified physical register
- void assignVirt2Phys(unsigned virtReg, unsigned physReg) {
- assert(TargetRegisterInfo::isVirtualRegister(virtReg) &&
- TargetRegisterInfo::isPhysicalRegister(physReg));
- assert(Virt2PhysMap[virtReg] == NO_PHYS_REG &&
- "attempt to assign physical register to already mapped "
- "virtual register");
- Virt2PhysMap[virtReg] = physReg;
- }
-
- /// @brief clears the specified virtual register's, physical
- /// register mapping
- void clearVirt(unsigned virtReg) {
- assert(TargetRegisterInfo::isVirtualRegister(virtReg));
- assert(Virt2PhysMap[virtReg] != NO_PHYS_REG &&
- "attempt to clear a not assigned virtual register");
- Virt2PhysMap[virtReg] = NO_PHYS_REG;
- }
-
- /// @brief clears all virtual to physical register mappings
- void clearAllVirt() {
- Virt2PhysMap.clear();
- grow();
- }
-
- /// @brief records virtReg is a split live interval from SReg.
- void setIsSplitFromReg(unsigned virtReg, unsigned SReg) {
- Virt2SplitMap[virtReg] = SReg;
- }
-
- /// @brief returns the live interval virtReg is split from.
- unsigned getPreSplitReg(unsigned virtReg) {
- return Virt2SplitMap[virtReg];
- }
-
- /// @brief returns true if the specified virtual register is not
- /// mapped to a stack slot or rematerialized.
- bool isAssignedReg(unsigned virtReg) const {
- if (getStackSlot(virtReg) == NO_STACK_SLOT &&
- getReMatId(virtReg) == NO_STACK_SLOT)
- return true;
- // Split register can be assigned a physical register as well as a
- // stack slot or remat id.
- return (Virt2SplitMap[virtReg] && Virt2PhysMap[virtReg] != NO_PHYS_REG);
- }
-
- /// @brief returns the stack slot mapped to the specified virtual
- /// register
- int getStackSlot(unsigned virtReg) const {
- assert(TargetRegisterInfo::isVirtualRegister(virtReg));
- return Virt2StackSlotMap[virtReg];
- }
-
- /// @brief returns the rematerialization id mapped to the specified virtual
- /// register
- int getReMatId(unsigned virtReg) const {
- assert(TargetRegisterInfo::isVirtualRegister(virtReg));
- return Virt2ReMatIdMap[virtReg];
- }
-
- /// @brief create a mapping for the specifed virtual register to
- /// the next available stack slot
- int assignVirt2StackSlot(unsigned virtReg);
- /// @brief create a mapping for the specified virtual register to
- /// the specified stack slot
- void assignVirt2StackSlot(unsigned virtReg, int frameIndex);
-
- /// @brief assign an unique re-materialization id to the specified
- /// virtual register.
- int assignVirtReMatId(unsigned virtReg);
- /// @brief assign an unique re-materialization id to the specified
- /// virtual register.
- void assignVirtReMatId(unsigned virtReg, int id);
-
- /// @brief returns true if the specified virtual register is being
- /// re-materialized.
- bool isReMaterialized(unsigned virtReg) const {
- return ReMatMap[virtReg] != NULL;
- }
-
- /// @brief returns the original machine instruction being re-issued
- /// to re-materialize the specified virtual register.
- MachineInstr *getReMaterializedMI(unsigned virtReg) const {
- return ReMatMap[virtReg];
- }
-
- /// @brief records the specified virtual register will be
- /// re-materialized and the original instruction which will be re-issed
- /// for this purpose. If parameter all is true, then all uses of the
- /// registers are rematerialized and it's safe to delete the definition.
- void setVirtIsReMaterialized(unsigned virtReg, MachineInstr *def) {
- ReMatMap[virtReg] = def;
- }
-
- /// @brief record the last use (kill) of a split virtual register.
- void addKillPoint(unsigned virtReg, unsigned index) {
- Virt2SplitKillMap[virtReg] = index;
- }
-
- unsigned getKillPoint(unsigned virtReg) const {
- return Virt2SplitKillMap[virtReg];
- }
-
- /// @brief remove the last use (kill) of a split virtual register.
- void removeKillPoint(unsigned virtReg) {
- Virt2SplitKillMap[virtReg] = 0;
- }
-
- /// @brief returns true if the specified MachineInstr is a spill point.
- bool isSpillPt(MachineInstr *Pt) const {
- return SpillPt2VirtMap.find(Pt) != SpillPt2VirtMap.end();
- }
-
- /// @brief returns the virtual registers that should be spilled due to
- /// splitting right after the specified MachineInstr.
- std::vector<std::pair<unsigned,bool> > &getSpillPtSpills(MachineInstr *Pt) {
- return SpillPt2VirtMap[Pt];
- }
-
- /// @brief records the specified MachineInstr as a spill point for virtReg.
- void addSpillPoint(unsigned virtReg, bool isKill, MachineInstr *Pt) {
- if (SpillPt2VirtMap.find(Pt) != SpillPt2VirtMap.end())
- SpillPt2VirtMap[Pt].push_back(std::make_pair(virtReg, isKill));
- else {
- std::vector<std::pair<unsigned,bool> > Virts;
- Virts.push_back(std::make_pair(virtReg, isKill));
- SpillPt2VirtMap.insert(std::make_pair(Pt, Virts));
- }
- }
-
- /// @brief - transfer spill point information from one instruction to
- /// another.
- void transferSpillPts(MachineInstr *Old, MachineInstr *New) {
- std::map<MachineInstr*,std::vector<std::pair<unsigned,bool> > >::iterator
- I = SpillPt2VirtMap.find(Old);
- if (I == SpillPt2VirtMap.end())
- return;
- while (!I->second.empty()) {
- unsigned virtReg = I->second.back().first;
- bool isKill = I->second.back().second;
- I->second.pop_back();
- addSpillPoint(virtReg, isKill, New);
- }
- SpillPt2VirtMap.erase(I);
- }
-
- /// @brief returns true if the specified MachineInstr is a restore point.
- bool isRestorePt(MachineInstr *Pt) const {
- return RestorePt2VirtMap.find(Pt) != RestorePt2VirtMap.end();
- }
-
- /// @brief returns the virtual registers that should be restoreed due to
- /// splitting right after the specified MachineInstr.
- std::vector<unsigned> &getRestorePtRestores(MachineInstr *Pt) {
- return RestorePt2VirtMap[Pt];
- }
-
- /// @brief records the specified MachineInstr as a restore point for virtReg.
- void addRestorePoint(unsigned virtReg, MachineInstr *Pt) {
- if (RestorePt2VirtMap.find(Pt) != RestorePt2VirtMap.end())
- RestorePt2VirtMap[Pt].push_back(virtReg);
- else {
- std::vector<unsigned> Virts;
- Virts.push_back(virtReg);
- RestorePt2VirtMap.insert(std::make_pair(Pt, Virts));
- }
- }
-
- /// @brief - transfer restore point information from one instruction to
- /// another.
- void transferRestorePts(MachineInstr *Old, MachineInstr *New) {
- std::map<MachineInstr*,std::vector<unsigned> >::iterator I =
- RestorePt2VirtMap.find(Old);
- if (I == RestorePt2VirtMap.end())
- return;
- while (!I->second.empty()) {
- unsigned virtReg = I->second.back();
- I->second.pop_back();
- addRestorePoint(virtReg, New);
- }
- RestorePt2VirtMap.erase(I);
- }
-
- /// @brief records that the specified physical register must be spilled
- /// around the specified machine instr.
- void addEmergencySpill(unsigned PhysReg, MachineInstr *MI) {
- if (EmergencySpillMap.find(MI) != EmergencySpillMap.end())
- EmergencySpillMap[MI].push_back(PhysReg);
- else {
- std::vector<unsigned> PhysRegs;
- PhysRegs.push_back(PhysReg);
- EmergencySpillMap.insert(std::make_pair(MI, PhysRegs));
- }
- }
-
- /// @brief returns true if one or more physical registers must be spilled
- /// around the specified instruction.
- bool hasEmergencySpills(MachineInstr *MI) const {
- return EmergencySpillMap.find(MI) != EmergencySpillMap.end();
- }
-
- /// @brief returns the physical registers to be spilled and restored around
- /// the instruction.
- std::vector<unsigned> &getEmergencySpills(MachineInstr *MI) {
- return EmergencySpillMap[MI];
- }
-
- /// @brief - transfer emergency spill information from one instruction to
- /// another.
- void transferEmergencySpills(MachineInstr *Old, MachineInstr *New) {
- std::map<MachineInstr*,std::vector<unsigned> >::iterator I =
- EmergencySpillMap.find(Old);
- if (I == EmergencySpillMap.end())
- return;
- while (!I->second.empty()) {
- unsigned virtReg = I->second.back();
- I->second.pop_back();
- addEmergencySpill(virtReg, New);
- }
- EmergencySpillMap.erase(I);
- }
-
- /// @brief return or get a emergency spill slot for the register class.
- int getEmergencySpillSlot(const TargetRegisterClass *RC);
-
- /// @brief Return lowest spill slot index.
- int getLowSpillSlot() const {
- return LowSpillSlot;
- }
-
- /// @brief Return highest spill slot index.
- int getHighSpillSlot() const {
- return HighSpillSlot;
- }
-
- /// @brief Records a spill slot use.
- void addSpillSlotUse(int FrameIndex, MachineInstr *MI);
-
- /// @brief Returns true if spill slot has been used.
- bool isSpillSlotUsed(int FrameIndex) const {
- assert(FrameIndex >= 0 && "Spill slot index should not be negative!");
- return !SpillSlotToUsesMap[FrameIndex-LowSpillSlot].empty();
- }
-
- /// @brief Mark the specified register as being implicitly defined.
- void setIsImplicitlyDefined(unsigned VirtReg) {
- ImplicitDefed.set(VirtReg-TargetRegisterInfo::FirstVirtualRegister);
- }
-
- /// @brief Returns true if the virtual register is implicitly defined.
- bool isImplicitlyDefined(unsigned VirtReg) const {
- return ImplicitDefed[VirtReg-TargetRegisterInfo::FirstVirtualRegister];
- }
-
- /// @brief Updates information about the specified virtual register's value
- /// folded into newMI machine instruction.
- void virtFolded(unsigned VirtReg, MachineInstr *OldMI, MachineInstr *NewMI,
- ModRef MRInfo);
-
- /// @brief Updates information about the specified virtual register's value
- /// folded into the specified machine instruction.
- void virtFolded(unsigned VirtReg, MachineInstr *MI, ModRef MRInfo);
-
- /// @brief returns the virtual registers' values folded in memory
- /// operands of this instruction
- std::pair<MI2VirtMapTy::const_iterator, MI2VirtMapTy::const_iterator>
- getFoldedVirts(MachineInstr* MI) const {
- return MI2VirtMap.equal_range(MI);
- }
-
- /// RemoveMachineInstrFromMaps - MI is being erased, remove it from the
- /// the folded instruction map and spill point map.
- void RemoveMachineInstrFromMaps(MachineInstr *MI);
-
- void print(std::ostream &OS) const;
- void print(std::ostream *OS) const { if (OS) print(*OS); }
- void dump() const;
- };
-
- inline std::ostream *operator<<(std::ostream *OS, const VirtRegMap &VRM) {
- VRM.print(OS);
- return OS;
- }
- inline std::ostream &operator<<(std::ostream &OS, const VirtRegMap &VRM) {
- VRM.print(OS);
- return OS;
- }
-
- /// Spiller interface: Implementations of this interface assign spilled
- /// virtual registers to stack slots, rewriting the code.
- struct Spiller {
- virtual ~Spiller();
- virtual bool runOnMachineFunction(MachineFunction &MF,
- VirtRegMap &VRM) = 0;
- };
-
- /// createSpiller - Create an return a spiller object, as specified on the
- /// command line.
- Spiller* createSpiller();
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/lib/Debugger/Debugger.cpp b/release_23/lib/Debugger/Debugger.cpp
deleted file mode 100644
index 78f48f6f731a..000000000000
--- a/release_23/lib/Debugger/Debugger.cpp
+++ /dev/null
@@ -1,229 +0,0 @@
-//===-- Debugger.cpp - LLVM debugger library implementation ---------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains the main implementation of the LLVM debugger library.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Debugger/Debugger.h"
-#include "llvm/Module.h"
-#include "llvm/ModuleProvider.h"
-#include "llvm/Bitcode/ReaderWriter.h"
-#include "llvm/Debugger/InferiorProcess.h"
-#include "llvm/Support/MemoryBuffer.h"
-#include "llvm/ADT/StringExtras.h"
-#include <memory>
-using namespace llvm;
-
-/// Debugger constructor - Initialize the debugger to its initial, empty, state.
-///
-Debugger::Debugger() : Environment(0), Program(0), Process(0) {
-}
-
-Debugger::~Debugger() {
- // Killing the program could throw an exception. We don't want to progagate
- // the exception out of our destructor though.
- try {
- killProgram();
- } catch (const char *) {
- } catch (const std::string &) {
- }
-
- unloadProgram();
-}
-
-/// getProgramPath - Get the path of the currently loaded program, or an
-/// empty string if none is loaded.
-std::string Debugger::getProgramPath() const {
- return Program ? Program->getModuleIdentifier() : "";
-}
-
-static Module *
-getMaterializedModuleProvider(const std::string &Filename) {
- std::auto_ptr<MemoryBuffer> Buffer;
- Buffer.reset(MemoryBuffer::getFileOrSTDIN(Filename.c_str()));
- if (Buffer.get())
- return ParseBitcodeFile(Buffer.get());
- return 0;
-}
-
-/// loadProgram - If a program is currently loaded, unload it. Then search
-/// the PATH for the specified program, loading it when found. If the
-/// specified program cannot be found, an exception is thrown to indicate the
-/// error.
-void Debugger::loadProgram(const std::string &Filename) {
- if ((Program = getMaterializedModuleProvider(Filename)) ||
- (Program = getMaterializedModuleProvider(Filename+".bc")))
- return; // Successfully loaded the program.
-
- // Search the program path for the file...
- if (const char *PathS = getenv("PATH")) {
- std::string Path = PathS;
-
- std::string Directory = getToken(Path, ":");
- while (!Directory.empty()) {
- if ((Program = getMaterializedModuleProvider(Directory +"/"+ Filename)) ||
- (Program = getMaterializedModuleProvider(Directory +"/"+ Filename
- + ".bc")))
- return; // Successfully loaded the program.
-
- Directory = getToken(Path, ":");
- }
- }
-
- throw "Could not find program '" + Filename + "'!";
-}
-
-/// unloadProgram - If a program is running, kill it, then unload all traces
-/// of the current program. If no program is loaded, this method silently
-/// succeeds.
-void Debugger::unloadProgram() {
- if (!isProgramLoaded()) return;
- killProgram();
- delete Program;
- Program = 0;
-}
-
-
-/// createProgram - Create an instance of the currently loaded program,
-/// killing off any existing one. This creates the program and stops it at
-/// the first possible moment. If there is no program loaded or if there is a
-/// problem starting the program, this method throws an exception.
-void Debugger::createProgram() {
- if (!isProgramLoaded())
- throw "Cannot start program: none is loaded.";
-
- // Kill any existing program.
- killProgram();
-
- // Add argv[0] to the arguments vector..
- std::vector<std::string> Args(ProgramArguments);
- Args.insert(Args.begin(), getProgramPath());
-
- // Start the new program... this could throw if the program cannot be started.
- Process = InferiorProcess::create(Program, Args, Environment);
-}
-
-InferiorProcess *
-InferiorProcess::create(Module *M, const std::vector<std::string> &Arguments,
- const char * const *envp) {
- throw"No supported binding to inferior processes (debugger not implemented).";
-}
-
-/// killProgram - If the program is currently executing, kill off the
-/// process and free up any state related to the currently running program. If
-/// there is no program currently running, this just silently succeeds.
-void Debugger::killProgram() {
- // The destructor takes care of the dirty work.
- try {
- delete Process;
- } catch (...) {
- Process = 0;
- throw;
- }
- Process = 0;
-}
-
-/// stepProgram - Implement the 'step' command, continuing execution until
-/// the next possible stop point.
-void Debugger::stepProgram() {
- assert(isProgramRunning() && "Cannot step if the program isn't running!");
- try {
- Process->stepProgram();
- } catch (InferiorProcessDead &IPD) {
- killProgram();
- throw NonErrorException("The program stopped with exit code " +
- itostr(IPD.getExitCode()));
- } catch (...) {
- killProgram();
- throw;
- }
-}
-
-/// nextProgram - Implement the 'next' command, continuing execution until
-/// the next possible stop point that is in the current function.
-void Debugger::nextProgram() {
- assert(isProgramRunning() && "Cannot next if the program isn't running!");
- try {
- // This should step the process. If the process enters a function, then it
- // should 'finish' it. However, figuring this out is tricky. In
- // particular, the program can do any of:
- // 0. Not change current frame.
- // 1. Entering or exiting a region within the current function
- // (which changes the frame ID, but which we shouldn't 'finish')
- // 2. Exiting the current function (which changes the frame ID)
- // 3. Entering a function (which should be 'finish'ed)
- // For this reason, we have to be very careful about when we decide to do
- // the 'finish'.
-
- // Get the current frame, but don't trust it. It could change...
- void *CurrentFrame = Process->getPreviousFrame(0);
-
- // Don't trust the current frame: get the caller frame.
- void *ParentFrame = Process->getPreviousFrame(CurrentFrame);
-
- // Ok, we have some information, run the program one step.
- Process->stepProgram();
-
- // Where is the new frame? The most common case, by far is that it has not
- // been modified (Case #0), in which case we don't need to do anything more.
- void *NewFrame = Process->getPreviousFrame(0);
- if (NewFrame != CurrentFrame) {
- // Ok, the frame changed. If we are case #1, then the parent frame will
- // be identical.
- void *NewParentFrame = Process->getPreviousFrame(NewFrame);
- if (ParentFrame != NewParentFrame) {
- // Ok, now we know we aren't case #0 or #1. Check to see if we entered
- // a new function. If so, the parent frame will be "CurrentFrame".
- if (CurrentFrame == NewParentFrame)
- Process->finishProgram(NewFrame);
- }
- }
-
- } catch (InferiorProcessDead &IPD) {
- killProgram();
- throw NonErrorException("The program stopped with exit code " +
- itostr(IPD.getExitCode()));
- } catch (...) {
- killProgram();
- throw;
- }
-}
-
-/// finishProgram - Implement the 'finish' command, continuing execution
-/// until the specified frame ID returns.
-void Debugger::finishProgram(void *Frame) {
- assert(isProgramRunning() && "Cannot cont if the program isn't running!");
- try {
- Process->finishProgram(Frame);
- } catch (InferiorProcessDead &IPD) {
- killProgram();
- throw NonErrorException("The program stopped with exit code " +
- itostr(IPD.getExitCode()));
- } catch (...) {
- killProgram();
- throw;
- }
-}
-
-/// contProgram - Implement the 'cont' command, continuing execution until
-/// the next breakpoint is encountered.
-void Debugger::contProgram() {
- assert(isProgramRunning() && "Cannot cont if the program isn't running!");
- try {
- Process->contProgram();
- } catch (InferiorProcessDead &IPD) {
- killProgram();
- throw NonErrorException("The program stopped with exit code " +
- itostr(IPD.getExitCode()));
- } catch (...) {
- killProgram();
- throw;
- }
-}
diff --git a/release_23/lib/Debugger/Makefile b/release_23/lib/Debugger/Makefile
deleted file mode 100644
index 7eb4485a6e87..000000000000
--- a/release_23/lib/Debugger/Makefile
+++ /dev/null
@@ -1,16 +0,0 @@
-##===- lib/Debugger/Makefile -------------------------------*- Makefile -*-===##
-#
-# The LLVM Compiler Infrastructure
-#
-# This file is distributed under the University of Illinois Open Source
-# License. See LICENSE.TXT for details.
-#
-##===----------------------------------------------------------------------===##
-
-LEVEL = ../..
-LIBRARYNAME = LLVMDebugger
-EXTRA_DIST = README.txt
-REQUIRES_EH := 1
-BUILD_ARCHIVE = 1
-
-include $(LEVEL)/Makefile.common
diff --git a/release_23/lib/Debugger/ProgramInfo.cpp b/release_23/lib/Debugger/ProgramInfo.cpp
deleted file mode 100644
index e4380ea42783..000000000000
--- a/release_23/lib/Debugger/ProgramInfo.cpp
+++ /dev/null
@@ -1,372 +0,0 @@
-//===-- ProgramInfo.cpp - Compute and cache info about a program ----------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the ProgramInfo and related classes, by sorting through
-// the loaded Module.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Debugger/ProgramInfo.h"
-#include "llvm/Constants.h"
-#include "llvm/DerivedTypes.h"
-#include "llvm/Intrinsics.h"
-#include "llvm/IntrinsicInst.h"
-#include "llvm/Instructions.h"
-#include "llvm/Module.h"
-#include "llvm/Debugger/SourceFile.h"
-#include "llvm/Debugger/SourceLanguage.h"
-#include "llvm/Support/SlowOperationInformer.h"
-#include "llvm/ADT/STLExtras.h"
-using namespace llvm;
-
-/// getGlobalVariablesUsing - Return all of the global variables which have the
-/// specified value in their initializer somewhere.
-static void getGlobalVariablesUsing(Value *V,
- std::vector<GlobalVariable*> &Found) {
- for (Value::use_iterator I = V->use_begin(), E = V->use_end(); I != E; ++I) {
- if (GlobalVariable *GV = dyn_cast<GlobalVariable>(*I))
- Found.push_back(GV);
- else if (Constant *C = dyn_cast<Constant>(*I))
- getGlobalVariablesUsing(C, Found);
- }
-}
-
-/// getNextStopPoint - Follow the def-use chains of the specified LLVM value,
-/// traversing the use chains until we get to a stoppoint. When we do, return
-/// the source location of the stoppoint. If we don't find a stoppoint, return
-/// null.
-static const GlobalVariable *getNextStopPoint(const Value *V, unsigned &LineNo,
- unsigned &ColNo) {
- // The use-def chains can fork. As such, we pick the lowest numbered one we
- // find.
- const GlobalVariable *LastDesc = 0;
- unsigned LastLineNo = ~0;
- unsigned LastColNo = ~0;
-
- for (Value::use_const_iterator UI = V->use_begin(), E = V->use_end();
- UI != E; ++UI) {
- bool ShouldRecurse = true;
- if (cast<Instruction>(*UI)->getOpcode() == Instruction::PHI) {
- // Infinite loops == bad, ignore PHI nodes.
- ShouldRecurse = false;
- } else if (const CallInst *CI = dyn_cast<CallInst>(*UI)) {
-
- // If we found a stop point, check to see if it is earlier than what we
- // already have. If so, remember it.
- if (CI->getCalledFunction())
- if (const DbgStopPointInst *SPI = dyn_cast<DbgStopPointInst>(CI)) {
- unsigned CurLineNo = SPI->getLine();
- unsigned CurColNo = SPI->getColumn();
- const GlobalVariable *CurDesc = 0;
- const Value *Op = SPI->getContext();
-
- if ((CurDesc = dyn_cast<GlobalVariable>(Op)) &&
- (LineNo < LastLineNo ||
- (LineNo == LastLineNo && ColNo < LastColNo))) {
- LastDesc = CurDesc;
- LastLineNo = CurLineNo;
- LastColNo = CurColNo;
- }
- ShouldRecurse = false;
- }
- }
-
- // If this is not a phi node or a stopping point, recursively scan the users
- // of this instruction to skip over region.begin's and the like.
- if (ShouldRecurse) {
- unsigned CurLineNo, CurColNo;
- if (const GlobalVariable *GV = getNextStopPoint(*UI, CurLineNo,CurColNo)){
- if (LineNo < LastLineNo || (LineNo == LastLineNo && ColNo < LastColNo)){
- LastDesc = GV;
- LastLineNo = CurLineNo;
- LastColNo = CurColNo;
- }
- }
- }
- }
-
- if (LastDesc) {
- LineNo = LastLineNo != ~0U ? LastLineNo : 0;
- ColNo = LastColNo != ~0U ? LastColNo : 0;
- }
- return LastDesc;
-}
-
-
-//===----------------------------------------------------------------------===//
-// SourceFileInfo implementation
-//
-
-SourceFileInfo::SourceFileInfo(const GlobalVariable *Desc,
- const SourceLanguage &Lang)
- : Language(&Lang), Descriptor(Desc) {
- Version = 0;
- SourceText = 0;
-
- if (Desc && Desc->hasInitializer())
- if (ConstantStruct *CS = dyn_cast<ConstantStruct>(Desc->getInitializer()))
- if (CS->getNumOperands() > 4) {
- if (ConstantInt *CUI = dyn_cast<ConstantInt>(CS->getOperand(1)))
- Version = CUI->getZExtValue();
-
- BaseName = CS->getOperand(3)->getStringValue();
- Directory = CS->getOperand(4)->getStringValue();
- }
-}
-
-SourceFileInfo::~SourceFileInfo() {
- delete SourceText;
-}
-
-SourceFile &SourceFileInfo::getSourceText() const {
- // FIXME: this should take into account the source search directories!
- if (SourceText == 0) { // Read the file in if we haven't already.
- sys::Path tmpPath;
- if (!Directory.empty())
- tmpPath.set(Directory);
- tmpPath.appendComponent(BaseName);
- if (tmpPath.canRead())
- SourceText = new SourceFile(tmpPath.toString(), Descriptor);
- else
- SourceText = new SourceFile(BaseName, Descriptor);
- }
- return *SourceText;
-}
-
-
-//===----------------------------------------------------------------------===//
-// SourceFunctionInfo implementation
-//
-SourceFunctionInfo::SourceFunctionInfo(ProgramInfo &PI,
- const GlobalVariable *Desc)
- : Descriptor(Desc) {
- LineNo = ColNo = 0;
- if (Desc && Desc->hasInitializer())
- if (ConstantStruct *CS = dyn_cast<ConstantStruct>(Desc->getInitializer()))
- if (CS->getNumOperands() > 2) {
- // Entry #1 is the file descriptor.
- if (const GlobalVariable *GV =
- dyn_cast<GlobalVariable>(CS->getOperand(1)))
- SourceFile = &PI.getSourceFile(GV);
-
- // Entry #2 is the function name.
- Name = CS->getOperand(2)->getStringValue();
- }
-}
-
-/// getSourceLocation - This method returns the location of the first stopping
-/// point in the function.
-void SourceFunctionInfo::getSourceLocation(unsigned &RetLineNo,
- unsigned &RetColNo) const {
- // If we haven't computed this yet...
- if (!LineNo) {
- // Look at all of the users of the function descriptor, looking for calls to
- // %llvm.dbg.func.start.
- for (Value::use_const_iterator UI = Descriptor->use_begin(),
- E = Descriptor->use_end(); UI != E; ++UI)
- if (const CallInst *CI = dyn_cast<CallInst>(*UI))
- if (const Function *F = CI->getCalledFunction())
- if (F->getIntrinsicID() == Intrinsic::dbg_func_start) {
- // We found the start of the function. Check to see if there are
- // any stop points on the use-list of the function start.
- const GlobalVariable *SD = getNextStopPoint(CI, LineNo, ColNo);
- if (SD) { // We found the first stop point!
- // This is just a sanity check.
- if (getSourceFile().getDescriptor() != SD)
- cout << "WARNING: first line of function is not in the"
- << " file that the function descriptor claims it is in.\n";
- break;
- }
- }
- }
- RetLineNo = LineNo; RetColNo = ColNo;
-}
-
-//===----------------------------------------------------------------------===//
-// ProgramInfo implementation
-//
-
-ProgramInfo::ProgramInfo(Module *m) : M(m), ProgramTimeStamp(0,0) {
- assert(M && "Cannot create program information with a null module!");
- sys::PathWithStatus ModPath(M->getModuleIdentifier());
- const sys::FileStatus *Stat = ModPath.getFileStatus();
- if (Stat)
- ProgramTimeStamp = Stat->getTimestamp();
-
- SourceFilesIsComplete = false;
- SourceFunctionsIsComplete = false;
-}
-
-ProgramInfo::~ProgramInfo() {
- // Delete cached information about source program objects...
- for (std::map<const GlobalVariable*, SourceFileInfo*>::iterator
- I = SourceFiles.begin(), E = SourceFiles.end(); I != E; ++I)
- delete I->second;
- for (std::map<const GlobalVariable*, SourceFunctionInfo*>::iterator
- I = SourceFunctions.begin(), E = SourceFunctions.end(); I != E; ++I)
- delete I->second;
-
- // Delete the source language caches.
- for (unsigned i = 0, e = LanguageCaches.size(); i != e; ++i)
- delete LanguageCaches[i].second;
-}
-
-
-//===----------------------------------------------------------------------===//
-// SourceFileInfo tracking...
-//
-
-/// getSourceFile - Return source file information for the specified source file
-/// descriptor object, adding it to the collection as needed. This method
-/// always succeeds (is unambiguous), and is always efficient.
-///
-const SourceFileInfo &
-ProgramInfo::getSourceFile(const GlobalVariable *Desc) {
- SourceFileInfo *&Result = SourceFiles[Desc];
- if (Result) return *Result;
-
- // Figure out what language this source file comes from...
- unsigned LangID = 0; // Zero is unknown language
- if (Desc && Desc->hasInitializer())
- if (ConstantStruct *CS = dyn_cast<ConstantStruct>(Desc->getInitializer()))
- if (CS->getNumOperands() > 2)
- if (ConstantInt *CUI = dyn_cast<ConstantInt>(CS->getOperand(2)))
- LangID = CUI->getZExtValue();
-
- const SourceLanguage &Lang = SourceLanguage::get(LangID);
- SourceFileInfo *New = Lang.createSourceFileInfo(Desc, *this);
-
- // FIXME: this should check to see if there is already a Filename/WorkingDir
- // pair that matches this one. If so, we shouldn't create the duplicate!
- //
- SourceFileIndex.insert(std::make_pair(New->getBaseName(), New));
- return *(Result = New);
-}
-
-
-/// getSourceFiles - Index all of the source files in the program and return
-/// a mapping of it. This information is lazily computed the first time
-/// that it is requested. Since this information can take a long time to
-/// compute, the user is given a chance to cancel it. If this occurs, an
-/// exception is thrown.
-const std::map<const GlobalVariable*, SourceFileInfo*> &
-ProgramInfo::getSourceFiles(bool RequiresCompleteMap) {
- // If we have a fully populated map, or if the client doesn't need one, just
- // return what we have.
- if (SourceFilesIsComplete || !RequiresCompleteMap)
- return SourceFiles;
-
- // Ok, all of the source file descriptors (compile_unit in dwarf terms),
- // should be on the use list of the llvm.dbg.translation_units global.
- //
- GlobalVariable *Units =
- M->getGlobalVariable("llvm.dbg.translation_units",
- StructType::get(std::vector<const Type*>()));
- if (Units == 0)
- throw "Program contains no debugging information!";
-
- std::vector<GlobalVariable*> TranslationUnits;
- getGlobalVariablesUsing(Units, TranslationUnits);
-
- SlowOperationInformer SOI("building source files index");
-
- // Loop over all of the translation units found, building the SourceFiles
- // mapping.
- for (unsigned i = 0, e = TranslationUnits.size(); i != e; ++i) {
- getSourceFile(TranslationUnits[i]);
- if (SOI.progress(i+1, e))
- throw "While building source files index, operation cancelled.";
- }
-
- // Ok, if we got this far, then we indexed the whole program.
- SourceFilesIsComplete = true;
- return SourceFiles;
-}
-
-/// getSourceFile - Look up the file with the specified name. If there is
-/// more than one match for the specified filename, prompt the user to pick
-/// one. If there is no source file that matches the specified name, throw
-/// an exception indicating that we can't find the file. Otherwise, return
-/// the file information for that file.
-const SourceFileInfo &ProgramInfo::getSourceFile(const std::string &Filename) {
- std::multimap<std::string, SourceFileInfo*>::const_iterator Start, End;
- getSourceFiles();
- tie(Start, End) = SourceFileIndex.equal_range(Filename);
-
- if (Start == End) throw "Could not find source file '" + Filename + "'!";
- const SourceFileInfo &SFI = *Start->second;
- ++Start;
- if (Start == End) return SFI;
-
- throw "FIXME: Multiple source files with the same name not implemented!";
-}
-
-
-//===----------------------------------------------------------------------===//
-// SourceFunctionInfo tracking...
-//
-
-
-/// getFunction - Return function information for the specified function
-/// descriptor object, adding it to the collection as needed. This method
-/// always succeeds (is unambiguous), and is always efficient.
-///
-const SourceFunctionInfo &
-ProgramInfo::getFunction(const GlobalVariable *Desc) {
- SourceFunctionInfo *&Result = SourceFunctions[Desc];
- if (Result) return *Result;
-
- // Figure out what language this function comes from...
- const GlobalVariable *SourceFileDesc = 0;
- if (Desc && Desc->hasInitializer())
- if (ConstantStruct *CS = dyn_cast<ConstantStruct>(Desc->getInitializer()))
- if (CS->getNumOperands() > 0)
- if (const GlobalVariable *GV =
- dyn_cast<GlobalVariable>(CS->getOperand(1)))
- SourceFileDesc = GV;
-
- const SourceLanguage &Lang = getSourceFile(SourceFileDesc).getLanguage();
- return *(Result = Lang.createSourceFunctionInfo(Desc, *this));
-}
-
-
-// getSourceFunctions - Index all of the functions in the program and return
-// them. This information is lazily computed the first time that it is
-// requested. Since this information can take a long time to compute, the user
-// is given a chance to cancel it. If this occurs, an exception is thrown.
-const std::map<const GlobalVariable*, SourceFunctionInfo*> &
-ProgramInfo::getSourceFunctions(bool RequiresCompleteMap) {
- if (SourceFunctionsIsComplete || !RequiresCompleteMap)
- return SourceFunctions;
-
- // Ok, all of the source function descriptors (subprogram in dwarf terms),
- // should be on the use list of the llvm.dbg.translation_units global.
- //
- GlobalVariable *Units =
- M->getGlobalVariable("llvm.dbg.globals",
- StructType::get(std::vector<const Type*>()));
- if (Units == 0)
- throw "Program contains no debugging information!";
-
- std::vector<GlobalVariable*> Functions;
- getGlobalVariablesUsing(Units, Functions);
-
- SlowOperationInformer SOI("building functions index");
-
- // Loop over all of the functions found, building the SourceFunctions mapping.
- for (unsigned i = 0, e = Functions.size(); i != e; ++i) {
- getFunction(Functions[i]);
- if (SOI.progress(i+1, e))
- throw "While functions index, operation cancelled.";
- }
-
- // Ok, if we got this far, then we indexed the whole program.
- SourceFunctionsIsComplete = true;
- return SourceFunctions;
-}
diff --git a/release_23/lib/Debugger/README.txt b/release_23/lib/Debugger/README.txt
deleted file mode 100644
index 04a18febc65a..000000000000
--- a/release_23/lib/Debugger/README.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-//===-- llvm/lib/Debugger/ - LLVM Debugger interfaces ---------------------===//
-
-This directory contains the implementation of the LLVM debugger backend. This
-directory builds into a library which can be used by various debugger
-front-ends to debug LLVM programs. The current command line LLVM debugger,
-llvm-db is currently the only client of this library, but others could be
-built, to provide a GUI front-end for example.
-
diff --git a/release_23/lib/Debugger/RuntimeInfo.cpp b/release_23/lib/Debugger/RuntimeInfo.cpp
deleted file mode 100644
index 2f0ff72a771e..000000000000
--- a/release_23/lib/Debugger/RuntimeInfo.cpp
+++ /dev/null
@@ -1,69 +0,0 @@
-//===-- RuntimeInfo.cpp - Compute and cache info about running program ----===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the RuntimeInfo and related classes, by querying and
-// cachine information from the running inferior process.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Debugger/InferiorProcess.h"
-#include "llvm/Debugger/ProgramInfo.h"
-#include "llvm/Debugger/RuntimeInfo.h"
-using namespace llvm;
-
-//===----------------------------------------------------------------------===//
-// StackFrame class implementation
-
-StackFrame::StackFrame(RuntimeInfo &ri, void *ParentFrameID)
- : RI(ri), SourceInfo(0) {
- FrameID = RI.getInferiorProcess().getPreviousFrame(ParentFrameID);
- if (FrameID == 0) throw "Stack frame does not exist!";
-
- // Compute lazily as needed.
- FunctionDesc = 0;
-}
-
-const GlobalVariable *StackFrame::getFunctionDesc() {
- if (FunctionDesc == 0)
- FunctionDesc = RI.getInferiorProcess().getSubprogramDesc(FrameID);
- return FunctionDesc;
-}
-
-/// getSourceLocation - Return the source location that this stack frame is
-/// sitting at.
-void StackFrame::getSourceLocation(unsigned &lineNo, unsigned &colNo,
- const SourceFileInfo *&sourceInfo) {
- if (SourceInfo == 0) {
- const GlobalVariable *SourceDesc = 0;
- RI.getInferiorProcess().getFrameLocation(FrameID, LineNo,ColNo, SourceDesc);
- SourceInfo = &RI.getProgramInfo().getSourceFile(SourceDesc);
- }
-
- lineNo = LineNo;
- colNo = ColNo;
- sourceInfo = SourceInfo;
-}
-
-//===----------------------------------------------------------------------===//
-// RuntimeInfo class implementation
-
-/// materializeFrame - Create and process all frames up to and including the
-/// specified frame number. This throws an exception if the specified frame
-/// ID is nonexistant.
-void RuntimeInfo::materializeFrame(unsigned ID) {
- assert(ID >= CallStack.size() && "no need to materialize this frame!");
- void *CurFrame = 0;
- if (!CallStack.empty())
- CurFrame = CallStack.back().getFrameID();
-
- while (CallStack.size() <= ID) {
- CallStack.push_back(StackFrame(*this, CurFrame));
- CurFrame = CallStack.back().getFrameID();
- }
-}
diff --git a/release_23/lib/Debugger/SourceFile.cpp b/release_23/lib/Debugger/SourceFile.cpp
deleted file mode 100644
index 03c60f87f785..000000000000
--- a/release_23/lib/Debugger/SourceFile.cpp
+++ /dev/null
@@ -1,82 +0,0 @@
-//===-- SourceFile.cpp - SourceFile implementation for the debugger -------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the SourceFile class for the LLVM debugger.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Debugger/SourceFile.h"
-#include "llvm/Support/MemoryBuffer.h"
-#include <cassert>
-using namespace llvm;
-
-static const char EmptyFile = 0;
-
-SourceFile::SourceFile(const std::string &fn, const GlobalVariable *Desc)
- : Filename(fn), Descriptor(Desc) {
- File.reset(MemoryBuffer::getFileOrSTDIN(fn));
-
- // On error, return an empty buffer.
- if (File == 0)
- File.reset(MemoryBuffer::getMemBuffer(&EmptyFile, &EmptyFile));
-}
-
-SourceFile::~SourceFile() {
-}
-
-
-/// calculateLineOffsets - Compute the LineOffset vector for the current file.
-///
-void SourceFile::calculateLineOffsets() const {
- assert(LineOffset.empty() && "Line offsets already computed!");
- const char *BufPtr = File->getBufferStart();
- const char *FileStart = BufPtr;
- const char *FileEnd = File->getBufferEnd();
- do {
- LineOffset.push_back(BufPtr-FileStart);
-
- // Scan until we get to a newline.
- while (BufPtr != FileEnd && *BufPtr != '\n' && *BufPtr != '\r')
- ++BufPtr;
-
- if (BufPtr != FileEnd) {
- ++BufPtr; // Skip over the \n or \r
- if (BufPtr[-1] == '\r' && BufPtr != FileEnd && BufPtr[0] == '\n')
- ++BufPtr; // Skip over dos/windows style \r\n's
- }
- } while (BufPtr != FileEnd);
-}
-
-
-/// getSourceLine - Given a line number, return the start and end of the line
-/// in the file. If the line number is invalid, or if the file could not be
-/// loaded, null pointers are returned for the start and end of the file. Note
-/// that line numbers start with 0, not 1.
-void SourceFile::getSourceLine(unsigned LineNo, const char *&LineStart,
- const char *&LineEnd) const {
- LineStart = LineEnd = 0;
- if (LineOffset.empty()) calculateLineOffsets();
-
- // Asking for an out-of-range line number?
- if (LineNo >= LineOffset.size()) return;
-
- // Otherwise, they are asking for a valid line, which we can fulfill.
- LineStart = File->getBufferStart()+LineOffset[LineNo];
-
- if (LineNo+1 < LineOffset.size())
- LineEnd = File->getBufferStart()+LineOffset[LineNo+1];
- else
- LineEnd = File->getBufferEnd();
-
- // If the line ended with a newline, strip it off.
- while (LineEnd != LineStart && (LineEnd[-1] == '\n' || LineEnd[-1] == '\r'))
- --LineEnd;
-
- assert(LineEnd >= LineStart && "We somehow got our pointers swizzled!");
-}
diff --git a/release_23/lib/Debugger/SourceLanguage-CFamily.cpp b/release_23/lib/Debugger/SourceLanguage-CFamily.cpp
deleted file mode 100644
index f329db495f73..000000000000
--- a/release_23/lib/Debugger/SourceLanguage-CFamily.cpp
+++ /dev/null
@@ -1,28 +0,0 @@
-//===-- SourceLanguage-CFamily.cpp - C family SourceLanguage impl ---------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the SourceLanguage class for the C family of languages
-// (K&R C, C89, C99, etc).
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Debugger/SourceLanguage.h"
-using namespace llvm;
-
-#if 0
-namespace {
- struct CSL : public SourceLanguage {
- } TheCSourceLanguageInstance;
-}
-#endif
-
-const SourceLanguage &SourceLanguage::getCFamilyInstance() {
- return get(0); // We don't have an implementation for C yet fall back on
- // generic
-}
diff --git a/release_23/lib/Debugger/SourceLanguage-CPlusPlus.cpp b/release_23/lib/Debugger/SourceLanguage-CPlusPlus.cpp
deleted file mode 100644
index ce94ff4a4cb2..000000000000
--- a/release_23/lib/Debugger/SourceLanguage-CPlusPlus.cpp
+++ /dev/null
@@ -1,27 +0,0 @@
-//===-- SourceLanguage-CPlusPlus.cpp - C++ SourceLanguage impl ------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the SourceLanguage class for the C++ language.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Debugger/SourceLanguage.h"
-using namespace llvm;
-
-#if 0
-namespace {
- struct CPPSL : public SourceLanguage {
- } TheCPlusPlusLanguageInstance;
-}
-#endif
-
-const SourceLanguage &SourceLanguage::getCPlusPlusInstance() {
- return get(0); // We don't have an implementation for C yet fall back on
- // generic
-}
diff --git a/release_23/lib/Debugger/SourceLanguage-Unknown.cpp b/release_23/lib/Debugger/SourceLanguage-Unknown.cpp
deleted file mode 100644
index b806fc779ef7..000000000000
--- a/release_23/lib/Debugger/SourceLanguage-Unknown.cpp
+++ /dev/null
@@ -1,138 +0,0 @@
-//===-- SourceLanguage-Unknown.cpp - Implement itf for unknown languages --===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// If the LLVM debugger does not have a module for a particular language, it
-// falls back on using this one to perform the source-language interface. This
-// interface is not wonderful, but it gets the job done.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Debugger/SourceLanguage.h"
-#include "llvm/Debugger/ProgramInfo.h"
-#include "llvm/Support/Streams.h"
-#include <cassert>
-#include <ostream>
-using namespace llvm;
-
-//===----------------------------------------------------------------------===//
-// Implement the SourceLanguage cache for the Unknown language.
-//
-
-namespace {
- /// SLUCache - This cache allows for efficient lookup of source functions by
- /// name.
- ///
- struct SLUCache : public SourceLanguageCache {
- ProgramInfo &PI;
- std::multimap<std::string, SourceFunctionInfo*> FunctionMap;
- public:
- SLUCache(ProgramInfo &pi);
-
- typedef std::multimap<std::string, SourceFunctionInfo*>::const_iterator
- fm_iterator;
-
- std::pair<fm_iterator, fm_iterator>
- getFunction(const std::string &Name) const {
- return FunctionMap.equal_range(Name);
- }
-
- SourceFunctionInfo *addSourceFunction(SourceFunctionInfo *SF) {
- FunctionMap.insert(std::make_pair(SF->getSymbolicName(), SF));
- return SF;
- }
- };
-}
-
-SLUCache::SLUCache(ProgramInfo &pi) : PI(pi) {
-}
-
-
-//===----------------------------------------------------------------------===//
-// Implement SourceLanguageUnknown class, which is used to handle unrecognized
-// languages.
-//
-
-namespace {
- static struct SLU : public SourceLanguage {
- //===------------------------------------------------------------------===//
- // Implement the miscellaneous methods...
- //
- virtual const char *getSourceLanguageName() const {
- return "unknown";
- }
-
- /// lookupFunction - Given a textual function name, return the
- /// SourceFunctionInfo descriptor for that function, or null if it cannot be
- /// found. If the program is currently running, the RuntimeInfo object
- /// provides information about the current evaluation context, otherwise it
- /// will be null.
- ///
- virtual SourceFunctionInfo *lookupFunction(const std::string &FunctionName,
- ProgramInfo &PI,
- RuntimeInfo *RI = 0) const;
-
- //===------------------------------------------------------------------===//
- // We do use a cache for information...
- //
- typedef SLUCache CacheType;
- SLUCache *createSourceLanguageCache(ProgramInfo &PI) const {
- return new SLUCache(PI);
- }
-
- /// createSourceFunctionInfo - Create the new object and inform the cache of
- /// the new function.
- virtual SourceFunctionInfo *
- createSourceFunctionInfo(const GlobalVariable *Desc, ProgramInfo &PI) const;
-
- } TheUnknownSourceLanguageInstance;
-}
-
-const SourceLanguage &SourceLanguage::getUnknownLanguageInstance() {
- return TheUnknownSourceLanguageInstance;
-}
-
-
-SourceFunctionInfo *
-SLU::createSourceFunctionInfo(const GlobalVariable *Desc,
- ProgramInfo &PI) const {
- SourceFunctionInfo *Result = new SourceFunctionInfo(PI, Desc);
- return PI.getLanguageCache(this).addSourceFunction(Result);
-}
-
-
-/// lookupFunction - Given a textual function name, return the
-/// SourceFunctionInfo descriptor for that function, or null if it cannot be
-/// found. If the program is currently running, the RuntimeInfo object
-/// provides information about the current evaluation context, otherwise it will
-/// be null.
-///
-SourceFunctionInfo *SLU::lookupFunction(const std::string &FunctionName,
- ProgramInfo &PI, RuntimeInfo *RI) const{
- SLUCache &Cache = PI.getLanguageCache(this);
- std::pair<SLUCache::fm_iterator, SLUCache::fm_iterator> IP
- = Cache.getFunction(FunctionName);
-
- if (IP.first == IP.second) {
- if (PI.allSourceFunctionsRead())
- return 0; // Nothing found
-
- // Otherwise, we might be able to find the function if we read all of them
- // in. Do so now.
- PI.getSourceFunctions();
- assert(PI.allSourceFunctionsRead() && "Didn't read in all functions?");
- return lookupFunction(FunctionName, PI, RI);
- }
-
- SourceFunctionInfo *Found = IP.first->second;
- ++IP.first;
- if (IP.first != IP.second)
- cout << "Whoa, found multiple functions with the same name. I should"
- << " ask the user which one to use: FIXME!\n";
- return Found;
-}
diff --git a/release_23/lib/Debugger/SourceLanguage.cpp b/release_23/lib/Debugger/SourceLanguage.cpp
deleted file mode 100644
index 4fcc38bd3344..000000000000
--- a/release_23/lib/Debugger/SourceLanguage.cpp
+++ /dev/null
@@ -1,54 +0,0 @@
-//===-- SourceLanguage.cpp - Implement the SourceLanguage class -----------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the SourceLanguage class.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Debugger/SourceLanguage.h"
-#include "llvm/Debugger/ProgramInfo.h"
-using namespace llvm;
-
-const SourceLanguage &SourceLanguage::get(unsigned ID) {
- switch (ID) {
- case 1: // DW_LANG_C89
- case 2: // DW_LANG_C
- case 12: // DW_LANG_C99
- return getCFamilyInstance();
-
- case 4: // DW_LANG_C_plus_plus
- return getCPlusPlusInstance();
-
- case 3: // DW_LANG_Ada83
- case 5: // DW_LANG_Cobol74
- case 6: // DW_LANG_Cobol85
- case 7: // DW_LANG_Fortran77
- case 8: // DW_LANG_Fortran90
- case 9: // DW_LANG_Pascal83
- case 10: // DW_LANG_Modula2
- case 11: // DW_LANG_Java
- case 13: // DW_LANG_Ada95
- case 14: // DW_LANG_Fortran95
- default:
- return getUnknownLanguageInstance();
- }
-}
-
-
-SourceFileInfo *
-SourceLanguage::createSourceFileInfo(const GlobalVariable *Desc,
- ProgramInfo &PI) const {
- return new SourceFileInfo(Desc, *this);
-}
-
-SourceFunctionInfo *
-SourceLanguage::createSourceFunctionInfo(const GlobalVariable *Desc,
- ProgramInfo &PI) const {
- return new SourceFunctionInfo(PI, Desc);
-}
diff --git a/release_23/lib/ExecutionEngine/ExecutionEngine.cpp b/release_23/lib/ExecutionEngine/ExecutionEngine.cpp
deleted file mode 100644
index a56951d2c526..000000000000
--- a/release_23/lib/ExecutionEngine/ExecutionEngine.cpp
+++ /dev/null
@@ -1,980 +0,0 @@
-//===-- ExecutionEngine.cpp - Common Implementation shared by EEs ---------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines the common interface used by the various execution engine
-// subclasses.
-//
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "jit"
-#include "llvm/Constants.h"
-#include "llvm/DerivedTypes.h"
-#include "llvm/Module.h"
-#include "llvm/ModuleProvider.h"
-#include "llvm/ADT/Statistic.h"
-#include "llvm/Config/alloca.h"
-#include "llvm/ExecutionEngine/ExecutionEngine.h"
-#include "llvm/ExecutionEngine/GenericValue.h"
-#include "llvm/Support/Debug.h"
-#include "llvm/Support/MutexGuard.h"
-#include "llvm/System/DynamicLibrary.h"
-#include "llvm/System/Host.h"
-#include "llvm/Target/TargetData.h"
-#include <cmath>
-#include <cstring>
-using namespace llvm;
-
-STATISTIC(NumInitBytes, "Number of bytes of global vars initialized");
-STATISTIC(NumGlobals , "Number of global vars initialized");
-
-ExecutionEngine::EECtorFn ExecutionEngine::JITCtor = 0;
-ExecutionEngine::EECtorFn ExecutionEngine::InterpCtor = 0;
-ExecutionEngine::EERegisterFn ExecutionEngine::ExceptionTableRegister = 0;
-
-
-ExecutionEngine::ExecutionEngine(ModuleProvider *P) : LazyFunctionCreator(0) {
- LazyCompilationDisabled = false;
- Modules.push_back(P);
- assert(P && "ModuleProvider is null?");
-}
-
-ExecutionEngine::~ExecutionEngine() {
- clearAllGlobalMappings();
- for (unsigned i = 0, e = Modules.size(); i != e; ++i)
- delete Modules[i];
-}
-
-/// removeModuleProvider - Remove a ModuleProvider from the list of modules.
-/// Release module from ModuleProvider.
-Module* ExecutionEngine::removeModuleProvider(ModuleProvider *P,
- std::string *ErrInfo) {
- for(SmallVector<ModuleProvider *, 1>::iterator I = Modules.begin(),
- E = Modules.end(); I != E; ++I) {
- ModuleProvider *MP = *I;
- if (MP == P) {
- Modules.erase(I);
- return MP->releaseModule(ErrInfo);
- }
- }
- return NULL;
-}
-
-/// FindFunctionNamed - Search all of the active modules to find the one that
-/// defines FnName. This is very slow operation and shouldn't be used for
-/// general code.
-Function *ExecutionEngine::FindFunctionNamed(const char *FnName) {
- for (unsigned i = 0, e = Modules.size(); i != e; ++i) {
- if (Function *F = Modules[i]->getModule()->getFunction(FnName))
- return F;
- }
- return 0;
-}
-
-
-/// addGlobalMapping - Tell the execution engine that the specified global is
-/// at the specified location. This is used internally as functions are JIT'd
-/// and as global variables are laid out in memory. It can and should also be
-/// used by clients of the EE that want to have an LLVM global overlay
-/// existing data in memory.
-void ExecutionEngine::addGlobalMapping(const GlobalValue *GV, void *Addr) {
- MutexGuard locked(lock);
-
- void *&CurVal = state.getGlobalAddressMap(locked)[GV];
- assert((CurVal == 0 || Addr == 0) && "GlobalMapping already established!");
- CurVal = Addr;
-
- // If we are using the reverse mapping, add it too
- if (!state.getGlobalAddressReverseMap(locked).empty()) {
- const GlobalValue *&V = state.getGlobalAddressReverseMap(locked)[Addr];
- assert((V == 0 || GV == 0) && "GlobalMapping already established!");
- V = GV;
- }
-}
-
-/// clearAllGlobalMappings - Clear all global mappings and start over again
-/// use in dynamic compilation scenarios when you want to move globals
-void ExecutionEngine::clearAllGlobalMappings() {
- MutexGuard locked(lock);
-
- state.getGlobalAddressMap(locked).clear();
- state.getGlobalAddressReverseMap(locked).clear();
-}
-
-/// updateGlobalMapping - Replace an existing mapping for GV with a new
-/// address. This updates both maps as required. If "Addr" is null, the
-/// entry for the global is removed from the mappings.
-void *ExecutionEngine::updateGlobalMapping(const GlobalValue *GV, void *Addr) {
- MutexGuard locked(lock);
-
- std::map<const GlobalValue*, void *> &Map = state.getGlobalAddressMap(locked);
-
- // Deleting from the mapping?
- if (Addr == 0) {
- std::map<const GlobalValue*, void *>::iterator I = Map.find(GV);
- void *OldVal;
- if (I == Map.end())
- OldVal = 0;
- else {
- OldVal = I->second;
- Map.erase(I);
- }
-
- if (!state.getGlobalAddressReverseMap(locked).empty())
- state.getGlobalAddressReverseMap(locked).erase(Addr);
- return OldVal;
- }
-
- void *&CurVal = Map[GV];
- void *OldVal = CurVal;
-
- if (CurVal && !state.getGlobalAddressReverseMap(locked).empty())
- state.getGlobalAddressReverseMap(locked).erase(CurVal);
- CurVal = Addr;
-
- // If we are using the reverse mapping, add it too
- if (!state.getGlobalAddressReverseMap(locked).empty()) {
- const GlobalValue *&V = state.getGlobalAddressReverseMap(locked)[Addr];
- assert((V == 0 || GV == 0) && "GlobalMapping already established!");
- V = GV;
- }
- return OldVal;
-}
-
-/// getPointerToGlobalIfAvailable - This returns the address of the specified
-/// global value if it is has already been codegen'd, otherwise it returns null.
-///
-void *ExecutionEngine::getPointerToGlobalIfAvailable(const GlobalValue *GV) {
- MutexGuard locked(lock);
-
- std::map<const GlobalValue*, void*>::iterator I =
- state.getGlobalAddressMap(locked).find(GV);
- return I != state.getGlobalAddressMap(locked).end() ? I->second : 0;
-}
-
-/// getGlobalValueAtAddress - Return the LLVM global value object that starts
-/// at the specified address.
-///
-const GlobalValue *ExecutionEngine::getGlobalValueAtAddress(void *Addr) {
- MutexGuard locked(lock);
-
- // If we haven't computed the reverse mapping yet, do so first.
- if (state.getGlobalAddressReverseMap(locked).empty()) {
- for (std::map<const GlobalValue*, void *>::iterator
- I = state.getGlobalAddressMap(locked).begin(),
- E = state.getGlobalAddressMap(locked).end(); I != E; ++I)
- state.getGlobalAddressReverseMap(locked).insert(std::make_pair(I->second,
- I->first));
- }
-
- std::map<void *, const GlobalValue*>::iterator I =
- state.getGlobalAddressReverseMap(locked).find(Addr);
- return I != state.getGlobalAddressReverseMap(locked).end() ? I->second : 0;
-}
-
-// CreateArgv - Turn a vector of strings into a nice argv style array of
-// pointers to null terminated strings.
-//
-static void *CreateArgv(ExecutionEngine *EE,
- const std::vector<std::string> &InputArgv) {
- unsigned PtrSize = EE->getTargetData()->getPointerSize();
- char *Result = new char[(InputArgv.size()+1)*PtrSize];
-
- DOUT << "ARGV = " << (void*)Result << "\n";
- const Type *SBytePtr = PointerType::getUnqual(Type::Int8Ty);
-
- for (unsigned i = 0; i != InputArgv.size(); ++i) {
- unsigned Size = InputArgv[i].size()+1;
- char *Dest = new char[Size];
- DOUT << "ARGV[" << i << "] = " << (void*)Dest << "\n";
-
- std::copy(InputArgv[i].begin(), InputArgv[i].end(), Dest);
- Dest[Size-1] = 0;
-
- // Endian safe: Result[i] = (PointerTy)Dest;
- EE->StoreValueToMemory(PTOGV(Dest), (GenericValue*)(Result+i*PtrSize),
- SBytePtr);
- }
-
- // Null terminate it
- EE->StoreValueToMemory(PTOGV(0),
- (GenericValue*)(Result+InputArgv.size()*PtrSize),
- SBytePtr);
- return Result;
-}
-
-
-/// runStaticConstructorsDestructors - This method is used to execute all of
-/// the static constructors or destructors for a program, depending on the
-/// value of isDtors.
-void ExecutionEngine::runStaticConstructorsDestructors(bool isDtors) {
- const char *Name = isDtors ? "llvm.global_dtors" : "llvm.global_ctors";
-
- // Execute global ctors/dtors for each module in the program.
- for (unsigned m = 0, e = Modules.size(); m != e; ++m) {
- GlobalVariable *GV = Modules[m]->getModule()->getNamedGlobal(Name);
-
- // If this global has internal linkage, or if it has a use, then it must be
- // an old-style (llvmgcc3) static ctor with __main linked in and in use. If
- // this is the case, don't execute any of the global ctors, __main will do
- // it.
- if (!GV || GV->isDeclaration() || GV->hasInternalLinkage()) continue;
-
- // Should be an array of '{ int, void ()* }' structs. The first value is
- // the init priority, which we ignore.
- ConstantArray *InitList = dyn_cast<ConstantArray>(GV->getInitializer());
- if (!InitList) continue;
- for (unsigned i = 0, e = InitList->getNumOperands(); i != e; ++i)
- if (ConstantStruct *CS =
- dyn_cast<ConstantStruct>(InitList->getOperand(i))) {
- if (CS->getNumOperands() != 2) break; // Not array of 2-element structs.
-
- Constant *FP = CS->getOperand(1);
- if (FP->isNullValue())
- break; // Found a null terminator, exit.
-
- if (ConstantExpr *CE = dyn_cast<ConstantExpr>(FP))
- if (CE->isCast())
- FP = CE->getOperand(0);
- if (Function *F = dyn_cast<Function>(FP)) {
- // Execute the ctor/dtor function!
- runFunction(F, std::vector<GenericValue>());
- }
- }
- }
-}
-
-/// isTargetNullPtr - Return whether the target pointer stored at Loc is null.
-static bool isTargetNullPtr(ExecutionEngine *EE, void *Loc) {
- unsigned PtrSize = EE->getTargetData()->getPointerSize();
- for (unsigned i = 0; i < PtrSize; ++i)
- if (*(i + (uint8_t*)Loc))
- return false;
- return true;
-}
-
-/// runFunctionAsMain - This is a helper function which wraps runFunction to
-/// handle the common task of starting up main with the specified argc, argv,
-/// and envp parameters.
-int ExecutionEngine::runFunctionAsMain(Function *Fn,
- const std::vector<std::string> &argv,
- const char * const * envp) {
- std::vector<GenericValue> GVArgs;
- GenericValue GVArgc;
- GVArgc.IntVal = APInt(32, argv.size());
-
- // Check main() type
- unsigned NumArgs = Fn->getFunctionType()->getNumParams();
- const FunctionType *FTy = Fn->getFunctionType();
- const Type* PPInt8Ty =
- PointerType::getUnqual(PointerType::getUnqual(Type::Int8Ty));
- switch (NumArgs) {
- case 3:
- if (FTy->getParamType(2) != PPInt8Ty) {
- cerr << "Invalid type for third argument of main() supplied\n";
- abort();
- }
- // FALLS THROUGH
- case 2:
- if (FTy->getParamType(1) != PPInt8Ty) {
- cerr << "Invalid type for second argument of main() supplied\n";
- abort();
- }
- // FALLS THROUGH
- case 1:
- if (FTy->getParamType(0) != Type::Int32Ty) {
- cerr << "Invalid type for first argument of main() supplied\n";
- abort();
- }
- // FALLS THROUGH
- case 0:
- if (FTy->getReturnType() != Type::Int32Ty &&
- FTy->getReturnType() != Type::VoidTy) {
- cerr << "Invalid return type of main() supplied\n";
- abort();
- }
- break;
- default:
- cerr << "Invalid number of arguments of main() supplied\n";
- abort();
- }
-
- if (NumArgs) {
- GVArgs.push_back(GVArgc); // Arg #0 = argc.
- if (NumArgs > 1) {
- GVArgs.push_back(PTOGV(CreateArgv(this, argv))); // Arg #1 = argv.
- assert(!isTargetNullPtr(this, GVTOP(GVArgs[1])) &&
- "argv[0] was null after CreateArgv");
- if (NumArgs > 2) {
- std::vector<std::string> EnvVars;
- for (unsigned i = 0; envp[i]; ++i)
- EnvVars.push_back(envp[i]);
- GVArgs.push_back(PTOGV(CreateArgv(this, EnvVars))); // Arg #2 = envp.
- }
- }
- }
- return runFunction(Fn, GVArgs).IntVal.getZExtValue();
-}
-
-/// If possible, create a JIT, unless the caller specifically requests an
-/// Interpreter or there's an error. If even an Interpreter cannot be created,
-/// NULL is returned.
-///
-ExecutionEngine *ExecutionEngine::create(ModuleProvider *MP,
- bool ForceInterpreter,
- std::string *ErrorStr) {
- ExecutionEngine *EE = 0;
-
- // Make sure we can resolve symbols in the program as well. The zero arg
- // to the function tells DynamicLibrary to load the program, not a library.
- if (sys::DynamicLibrary::LoadLibraryPermanently(0, ErrorStr))
- return 0;
-
- // Unless the interpreter was explicitly selected, try making a JIT.
- if (!ForceInterpreter && JITCtor)
- EE = JITCtor(MP, ErrorStr);
-
- // If we can't make a JIT, make an interpreter instead.
- if (EE == 0 && InterpCtor)
- EE = InterpCtor(MP, ErrorStr);
-
- return EE;
-}
-
-ExecutionEngine *ExecutionEngine::create(Module *M) {
- return create(new ExistingModuleProvider(M));
-}
-
-/// getPointerToGlobal - This returns the address of the specified global
-/// value. This may involve code generation if it's a function.
-///
-void *ExecutionEngine::getPointerToGlobal(const GlobalValue *GV) {
- if (Function *F = const_cast<Function*>(dyn_cast<Function>(GV)))
- return getPointerToFunction(F);
-
- MutexGuard locked(lock);
- void *p = state.getGlobalAddressMap(locked)[GV];
- if (p)
- return p;
-
- // Global variable might have been added since interpreter started.
- if (GlobalVariable *GVar =
- const_cast<GlobalVariable *>(dyn_cast<GlobalVariable>(GV)))
- EmitGlobalVariable(GVar);
- else
- assert(0 && "Global hasn't had an address allocated yet!");
- return state.getGlobalAddressMap(locked)[GV];
-}
-
-/// This function converts a Constant* into a GenericValue. The interesting
-/// part is if C is a ConstantExpr.
-/// @brief Get a GenericValue for a Constant*
-GenericValue ExecutionEngine::getConstantValue(const Constant *C) {
- // If its undefined, return the garbage.
- if (isa<UndefValue>(C))
- return GenericValue();
-
- // If the value is a ConstantExpr
- if (const ConstantExpr *CE = dyn_cast<ConstantExpr>(C)) {
- Constant *Op0 = CE->getOperand(0);
- switch (CE->getOpcode()) {
- case Instruction::GetElementPtr: {
- // Compute the index
- GenericValue Result = getConstantValue(Op0);
- SmallVector<Value*, 8> Indices(CE->op_begin()+1, CE->op_end());
- uint64_t Offset =
- TD->getIndexedOffset(Op0->getType(), &Indices[0], Indices.size());
-
- char* tmp = (char*) Result.PointerVal;
- Result = PTOGV(tmp + Offset);
- return Result;
- }
- case Instruction::Trunc: {
- GenericValue GV = getConstantValue(Op0);
- uint32_t BitWidth = cast<IntegerType>(CE->getType())->getBitWidth();
- GV.IntVal = GV.IntVal.trunc(BitWidth);
- return GV;
- }
- case Instruction::ZExt: {
- GenericValue GV = getConstantValue(Op0);
- uint32_t BitWidth = cast<IntegerType>(CE->getType())->getBitWidth();
- GV.IntVal = GV.IntVal.zext(BitWidth);
- return GV;
- }
- case Instruction::SExt: {
- GenericValue GV = getConstantValue(Op0);
- uint32_t BitWidth = cast<IntegerType>(CE->getType())->getBitWidth();
- GV.IntVal = GV.IntVal.sext(BitWidth);
- return GV;
- }
- case Instruction::FPTrunc: {
- // FIXME long double
- GenericValue GV = getConstantValue(Op0);
- GV.FloatVal = float(GV.DoubleVal);
- return GV;
- }
- case Instruction::FPExt:{
- // FIXME long double
- GenericValue GV = getConstantValue(Op0);
- GV.DoubleVal = double(GV.FloatVal);
- return GV;
- }
- case Instruction::UIToFP: {
- GenericValue GV = getConstantValue(Op0);
- if (CE->getType() == Type::FloatTy)
- GV.FloatVal = float(GV.IntVal.roundToDouble());
- else if (CE->getType() == Type::DoubleTy)
- GV.DoubleVal = GV.IntVal.roundToDouble();
- else if (CE->getType() == Type::X86_FP80Ty) {
- const uint64_t zero[] = {0, 0};
- APFloat apf = APFloat(APInt(80, 2, zero));
- (void)apf.convertFromAPInt(GV.IntVal,
- false,
- APFloat::rmNearestTiesToEven);
- GV.IntVal = apf.convertToAPInt();
- }
- return GV;
- }
- case Instruction::SIToFP: {
- GenericValue GV = getConstantValue(Op0);
- if (CE->getType() == Type::FloatTy)
- GV.FloatVal = float(GV.IntVal.signedRoundToDouble());
- else if (CE->getType() == Type::DoubleTy)
- GV.DoubleVal = GV.IntVal.signedRoundToDouble();
- else if (CE->getType() == Type::X86_FP80Ty) {
- const uint64_t zero[] = { 0, 0};
- APFloat apf = APFloat(APInt(80, 2, zero));
- (void)apf.convertFromAPInt(GV.IntVal,
- true,
- APFloat::rmNearestTiesToEven);
- GV.IntVal = apf.convertToAPInt();
- }
- return GV;
- }
- case Instruction::FPToUI: // double->APInt conversion handles sign
- case Instruction::FPToSI: {
- GenericValue GV = getConstantValue(Op0);
- uint32_t BitWidth = cast<IntegerType>(CE->getType())->getBitWidth();
- if (Op0->getType() == Type::FloatTy)
- GV.IntVal = APIntOps::RoundFloatToAPInt(GV.FloatVal, BitWidth);
- else if (Op0->getType() == Type::DoubleTy)
- GV.IntVal = APIntOps::RoundDoubleToAPInt(GV.DoubleVal, BitWidth);
- else if (Op0->getType() == Type::X86_FP80Ty) {
- APFloat apf = APFloat(GV.IntVal);
- uint64_t v;
- (void)apf.convertToInteger(&v, BitWidth,
- CE->getOpcode()==Instruction::FPToSI,
- APFloat::rmTowardZero);
- GV.IntVal = v; // endian?
- }
- return GV;
- }
- case Instruction::PtrToInt: {
- GenericValue GV = getConstantValue(Op0);
- uint32_t PtrWidth = TD->getPointerSizeInBits();
- GV.IntVal = APInt(PtrWidth, uintptr_t(GV.PointerVal));
- return GV;
- }
- case Instruction::IntToPtr: {
- GenericValue GV = getConstantValue(Op0);
- uint32_t PtrWidth = TD->getPointerSizeInBits();
- if (PtrWidth != GV.IntVal.getBitWidth())
- GV.IntVal = GV.IntVal.zextOrTrunc(PtrWidth);
- assert(GV.IntVal.getBitWidth() <= 64 && "Bad pointer width");
- GV.PointerVal = PointerTy(uintptr_t(GV.IntVal.getZExtValue()));
- return GV;
- }
- case Instruction::BitCast: {
- GenericValue GV = getConstantValue(Op0);
- const Type* DestTy = CE->getType();
- switch (Op0->getType()->getTypeID()) {
- default: assert(0 && "Invalid bitcast operand");
- case Type::IntegerTyID:
- assert(DestTy->isFloatingPoint() && "invalid bitcast");
- if (DestTy == Type::FloatTy)
- GV.FloatVal = GV.IntVal.bitsToFloat();
- else if (DestTy == Type::DoubleTy)
- GV.DoubleVal = GV.IntVal.bitsToDouble();
- break;
- case Type::FloatTyID:
- assert(DestTy == Type::Int32Ty && "Invalid bitcast");
- GV.IntVal.floatToBits(GV.FloatVal);
- break;
- case Type::DoubleTyID:
- assert(DestTy == Type::Int64Ty && "Invalid bitcast");
- GV.IntVal.doubleToBits(GV.DoubleVal);
- break;
- case Type::PointerTyID:
- assert(isa<PointerType>(DestTy) && "Invalid bitcast");
- break; // getConstantValue(Op0) above already converted it
- }
- return GV;
- }
- case Instruction::Add:
- case Instruction::Sub:
- case Instruction::Mul:
- case Instruction::UDiv:
- case Instruction::SDiv:
- case Instruction::URem:
- case Instruction::SRem:
- case Instruction::And:
- case Instruction::Or:
- case Instruction::Xor: {
- GenericValue LHS = getConstantValue(Op0);
- GenericValue RHS = getConstantValue(CE->getOperand(1));
- GenericValue GV;
- switch (CE->getOperand(0)->getType()->getTypeID()) {
- default: assert(0 && "Bad add type!"); abort();
- case Type::IntegerTyID:
- switch (CE->getOpcode()) {
- default: assert(0 && "Invalid integer opcode");
- case Instruction::Add: GV.IntVal = LHS.IntVal + RHS.IntVal; break;
- case Instruction::Sub: GV.IntVal = LHS.IntVal - RHS.IntVal; break;
- case Instruction::Mul: GV.IntVal = LHS.IntVal * RHS.IntVal; break;
- case Instruction::UDiv:GV.IntVal = LHS.IntVal.udiv(RHS.IntVal); break;
- case Instruction::SDiv:GV.IntVal = LHS.IntVal.sdiv(RHS.IntVal); break;
- case Instruction::URem:GV.IntVal = LHS.IntVal.urem(RHS.IntVal); break;
- case Instruction::SRem:GV.IntVal = LHS.IntVal.srem(RHS.IntVal); break;
- case Instruction::And: GV.IntVal = LHS.IntVal & RHS.IntVal; break;
- case Instruction::Or: GV.IntVal = LHS.IntVal | RHS.IntVal; break;
- case Instruction::Xor: GV.IntVal = LHS.IntVal ^ RHS.IntVal; break;
- }
- break;
- case Type::FloatTyID:
- switch (CE->getOpcode()) {
- default: assert(0 && "Invalid float opcode"); abort();
- case Instruction::Add:
- GV.FloatVal = LHS.FloatVal + RHS.FloatVal; break;
- case Instruction::Sub:
- GV.FloatVal = LHS.FloatVal - RHS.FloatVal; break;
- case Instruction::Mul:
- GV.FloatVal = LHS.FloatVal * RHS.FloatVal; break;
- case Instruction::FDiv:
- GV.FloatVal = LHS.FloatVal / RHS.FloatVal; break;
- case Instruction::FRem:
- GV.FloatVal = ::fmodf(LHS.FloatVal,RHS.FloatVal); break;
- }
- break;
- case Type::DoubleTyID:
- switch (CE->getOpcode()) {
- default: assert(0 && "Invalid double opcode"); abort();
- case Instruction::Add:
- GV.DoubleVal = LHS.DoubleVal + RHS.DoubleVal; break;
- case Instruction::Sub:
- GV.DoubleVal = LHS.DoubleVal - RHS.DoubleVal; break;
- case Instruction::Mul:
- GV.DoubleVal = LHS.DoubleVal * RHS.DoubleVal; break;
- case Instruction::FDiv:
- GV.DoubleVal = LHS.DoubleVal / RHS.DoubleVal; break;
- case Instruction::FRem:
- GV.DoubleVal = ::fmod(LHS.DoubleVal,RHS.DoubleVal); break;
- }
- break;
- case Type::X86_FP80TyID:
- case Type::PPC_FP128TyID:
- case Type::FP128TyID: {
- APFloat apfLHS = APFloat(LHS.IntVal);
- switch (CE->getOpcode()) {
- default: assert(0 && "Invalid long double opcode"); abort();
- case Instruction::Add:
- apfLHS.add(APFloat(RHS.IntVal), APFloat::rmNearestTiesToEven);
- GV.IntVal = apfLHS.convertToAPInt();
- break;
- case Instruction::Sub:
- apfLHS.subtract(APFloat(RHS.IntVal), APFloat::rmNearestTiesToEven);
- GV.IntVal = apfLHS.convertToAPInt();
- break;
- case Instruction::Mul:
- apfLHS.multiply(APFloat(RHS.IntVal), APFloat::rmNearestTiesToEven);
- GV.IntVal = apfLHS.convertToAPInt();
- break;
- case Instruction::FDiv:
- apfLHS.divide(APFloat(RHS.IntVal), APFloat::rmNearestTiesToEven);
- GV.IntVal = apfLHS.convertToAPInt();
- break;
- case Instruction::FRem:
- apfLHS.mod(APFloat(RHS.IntVal), APFloat::rmNearestTiesToEven);
- GV.IntVal = apfLHS.convertToAPInt();
- break;
- }
- }
- break;
- }
- return GV;
- }
- default:
- break;
- }
- cerr << "ConstantExpr not handled: " << *CE << "\n";
- abort();
- }
-
- GenericValue Result;
- switch (C->getType()->getTypeID()) {
- case Type::FloatTyID:
- Result.FloatVal = cast<ConstantFP>(C)->getValueAPF().convertToFloat();
- break;
- case Type::DoubleTyID:
- Result.DoubleVal = cast<ConstantFP>(C)->getValueAPF().convertToDouble();
- break;
- case Type::X86_FP80TyID:
- case Type::FP128TyID:
- case Type::PPC_FP128TyID:
- Result.IntVal = cast <ConstantFP>(C)->getValueAPF().convertToAPInt();
- break;
- case Type::IntegerTyID:
- Result.IntVal = cast<ConstantInt>(C)->getValue();
- break;
- case Type::PointerTyID:
- if (isa<ConstantPointerNull>(C))
- Result.PointerVal = 0;
- else if (const Function *F = dyn_cast<Function>(C))
- Result = PTOGV(getPointerToFunctionOrStub(const_cast<Function*>(F)));
- else if (const GlobalVariable* GV = dyn_cast<GlobalVariable>(C))
- Result = PTOGV(getOrEmitGlobalVariable(const_cast<GlobalVariable*>(GV)));
- else
- assert(0 && "Unknown constant pointer type!");
- break;
- default:
- cerr << "ERROR: Constant unimplemented for type: " << *C->getType() << "\n";
- abort();
- }
- return Result;
-}
-
-/// StoreIntToMemory - Fills the StoreBytes bytes of memory starting from Dst
-/// with the integer held in IntVal.
-static void StoreIntToMemory(const APInt &IntVal, uint8_t *Dst,
- unsigned StoreBytes) {
- assert((IntVal.getBitWidth()+7)/8 >= StoreBytes && "Integer too small!");
- uint8_t *Src = (uint8_t *)IntVal.getRawData();
-
- if (sys::littleEndianHost())
- // Little-endian host - the source is ordered from LSB to MSB. Order the
- // destination from LSB to MSB: Do a straight copy.
- memcpy(Dst, Src, StoreBytes);
- else {
- // Big-endian host - the source is an array of 64 bit words ordered from
- // LSW to MSW. Each word is ordered from MSB to LSB. Order the destination
- // from MSB to LSB: Reverse the word order, but not the bytes in a word.
- while (StoreBytes > sizeof(uint64_t)) {
- StoreBytes -= sizeof(uint64_t);
- // May not be aligned so use memcpy.
- memcpy(Dst + StoreBytes, Src, sizeof(uint64_t));
- Src += sizeof(uint64_t);
- }
-
- memcpy(Dst, Src + sizeof(uint64_t) - StoreBytes, StoreBytes);
- }
-}
-
-/// StoreValueToMemory - Stores the data in Val of type Ty at address Ptr. Ptr
-/// is the address of the memory at which to store Val, cast to GenericValue *.
-/// It is not a pointer to a GenericValue containing the address at which to
-/// store Val.
-void ExecutionEngine::StoreValueToMemory(const GenericValue &Val, GenericValue *Ptr,
- const Type *Ty) {
- const unsigned StoreBytes = getTargetData()->getTypeStoreSize(Ty);
-
- switch (Ty->getTypeID()) {
- case Type::IntegerTyID:
- StoreIntToMemory(Val.IntVal, (uint8_t*)Ptr, StoreBytes);
- break;
- case Type::FloatTyID:
- *((float*)Ptr) = Val.FloatVal;
- break;
- case Type::DoubleTyID:
- *((double*)Ptr) = Val.DoubleVal;
- break;
- case Type::X86_FP80TyID: {
- uint16_t *Dest = (uint16_t*)Ptr;
- const uint16_t *Src = (uint16_t*)Val.IntVal.getRawData();
- // This is endian dependent, but it will only work on x86 anyway.
- Dest[0] = Src[4];
- Dest[1] = Src[0];
- Dest[2] = Src[1];
- Dest[3] = Src[2];
- Dest[4] = Src[3];
- break;
- }
- case Type::PointerTyID:
- // Ensure 64 bit target pointers are fully initialized on 32 bit hosts.
- if (StoreBytes != sizeof(PointerTy))
- memset(Ptr, 0, StoreBytes);
-
- *((PointerTy*)Ptr) = Val.PointerVal;
- break;
- default:
- cerr << "Cannot store value of type " << *Ty << "!\n";
- }
-
- if (sys::littleEndianHost() != getTargetData()->isLittleEndian())
- // Host and target are different endian - reverse the stored bytes.
- std::reverse((uint8_t*)Ptr, StoreBytes + (uint8_t*)Ptr);
-}
-
-/// LoadIntFromMemory - Loads the integer stored in the LoadBytes bytes starting
-/// from Src into IntVal, which is assumed to be wide enough and to hold zero.
-static void LoadIntFromMemory(APInt &IntVal, uint8_t *Src, unsigned LoadBytes) {
- assert((IntVal.getBitWidth()+7)/8 >= LoadBytes && "Integer too small!");
- uint8_t *Dst = (uint8_t *)IntVal.getRawData();
-
- if (sys::littleEndianHost())
- // Little-endian host - the destination must be ordered from LSB to MSB.
- // The source is ordered from LSB to MSB: Do a straight copy.
- memcpy(Dst, Src, LoadBytes);
- else {
- // Big-endian - the destination is an array of 64 bit words ordered from
- // LSW to MSW. Each word must be ordered from MSB to LSB. The source is
- // ordered from MSB to LSB: Reverse the word order, but not the bytes in
- // a word.
- while (LoadBytes > sizeof(uint64_t)) {
- LoadBytes -= sizeof(uint64_t);
- // May not be aligned so use memcpy.
- memcpy(Dst, Src + LoadBytes, sizeof(uint64_t));
- Dst += sizeof(uint64_t);
- }
-
- memcpy(Dst + sizeof(uint64_t) - LoadBytes, Src, LoadBytes);
- }
-}
-
-/// FIXME: document
-///
-void ExecutionEngine::LoadValueFromMemory(GenericValue &Result,
- GenericValue *Ptr,
- const Type *Ty) {
- const unsigned LoadBytes = getTargetData()->getTypeStoreSize(Ty);
-
- if (sys::littleEndianHost() != getTargetData()->isLittleEndian()) {
- // Host and target are different endian - reverse copy the stored
- // bytes into a buffer, and load from that.
- uint8_t *Src = (uint8_t*)Ptr;
- uint8_t *Buf = (uint8_t*)alloca(LoadBytes);
- std::reverse_copy(Src, Src + LoadBytes, Buf);
- Ptr = (GenericValue*)Buf;
- }
-
- switch (Ty->getTypeID()) {
- case Type::IntegerTyID:
- // An APInt with all words initially zero.
- Result.IntVal = APInt(cast<IntegerType>(Ty)->getBitWidth(), 0);
- LoadIntFromMemory(Result.IntVal, (uint8_t*)Ptr, LoadBytes);
- break;
- case Type::FloatTyID:
- Result.FloatVal = *((float*)Ptr);
- break;
- case Type::DoubleTyID:
- Result.DoubleVal = *((double*)Ptr);
- break;
- case Type::PointerTyID:
- Result.PointerVal = *((PointerTy*)Ptr);
- break;
- case Type::X86_FP80TyID: {
- // This is endian dependent, but it will only work on x86 anyway.
- // FIXME: Will not trap if loading a signaling NaN.
- uint16_t *p = (uint16_t*)Ptr;
- union {
- uint16_t x[8];
- uint64_t y[2];
- };
- x[0] = p[1];
- x[1] = p[2];
- x[2] = p[3];
- x[3] = p[4];
- x[4] = p[0];
- Result.IntVal = APInt(80, 2, y);
- break;
- }
- default:
- cerr << "Cannot load value of type " << *Ty << "!\n";
- abort();
- }
-}
-
-// InitializeMemory - Recursive function to apply a Constant value into the
-// specified memory location...
-//
-void ExecutionEngine::InitializeMemory(const Constant *Init, void *Addr) {
- if (isa<UndefValue>(Init)) {
- return;
- } else if (const ConstantVector *CP = dyn_cast<ConstantVector>(Init)) {
- unsigned ElementSize =
- getTargetData()->getABITypeSize(CP->getType()->getElementType());
- for (unsigned i = 0, e = CP->getNumOperands(); i != e; ++i)
- InitializeMemory(CP->getOperand(i), (char*)Addr+i*ElementSize);
- return;
- } else if (isa<ConstantAggregateZero>(Init)) {
- memset(Addr, 0, (size_t)getTargetData()->getABITypeSize(Init->getType()));
- return;
- } else if (Init->getType()->isFirstClassType()) {
- GenericValue Val = getConstantValue(Init);
- StoreValueToMemory(Val, (GenericValue*)Addr, Init->getType());
- return;
- }
-
- switch (Init->getType()->getTypeID()) {
- case Type::ArrayTyID: {
- const ConstantArray *CPA = cast<ConstantArray>(Init);
- unsigned ElementSize =
- getTargetData()->getABITypeSize(CPA->getType()->getElementType());
- for (unsigned i = 0, e = CPA->getNumOperands(); i != e; ++i)
- InitializeMemory(CPA->getOperand(i), (char*)Addr+i*ElementSize);
- return;
- }
-
- case Type::StructTyID: {
- const ConstantStruct *CPS = cast<ConstantStruct>(Init);
- const StructLayout *SL =
- getTargetData()->getStructLayout(cast<StructType>(CPS->getType()));
- for (unsigned i = 0, e = CPS->getNumOperands(); i != e; ++i)
- InitializeMemory(CPS->getOperand(i), (char*)Addr+SL->getElementOffset(i));
- return;
- }
-
- default:
- cerr << "Bad Type: " << *Init->getType() << "\n";
- assert(0 && "Unknown constant type to initialize memory with!");
- }
-}
-
-/// EmitGlobals - Emit all of the global variables to memory, storing their
-/// addresses into GlobalAddress. This must make sure to copy the contents of
-/// their initializers into the memory.
-///
-void ExecutionEngine::emitGlobals() {
- const TargetData *TD = getTargetData();
-
- // Loop over all of the global variables in the program, allocating the memory
- // to hold them. If there is more than one module, do a prepass over globals
- // to figure out how the different modules should link together.
- //
- std::map<std::pair<std::string, const Type*>,
- const GlobalValue*> LinkedGlobalsMap;
-
- if (Modules.size() != 1) {
- for (unsigned m = 0, e = Modules.size(); m != e; ++m) {
- Module &M = *Modules[m]->getModule();
- for (Module::const_global_iterator I = M.global_begin(),
- E = M.global_end(); I != E; ++I) {
- const GlobalValue *GV = I;
- if (GV->hasInternalLinkage() || GV->isDeclaration() ||
- GV->hasAppendingLinkage() || !GV->hasName())
- continue;// Ignore external globals and globals with internal linkage.
-
- const GlobalValue *&GVEntry =
- LinkedGlobalsMap[std::make_pair(GV->getName(), GV->getType())];
-
- // If this is the first time we've seen this global, it is the canonical
- // version.
- if (!GVEntry) {
- GVEntry = GV;
- continue;
- }
-
- // If the existing global is strong, never replace it.
- if (GVEntry->hasExternalLinkage() ||
- GVEntry->hasDLLImportLinkage() ||
- GVEntry->hasDLLExportLinkage())
- continue;
-
- // Otherwise, we know it's linkonce/weak, replace it if this is a strong
- // symbol.
- if (GV->hasExternalLinkage() || GVEntry->hasExternalWeakLinkage())
- GVEntry = GV;
- }
- }
- }
-
- std::vector<const GlobalValue*> NonCanonicalGlobals;
- for (unsigned m = 0, e = Modules.size(); m != e; ++m) {
- Module &M = *Modules[m]->getModule();
- for (Module::const_global_iterator I = M.global_begin(), E = M.global_end();
- I != E; ++I) {
- // In the multi-module case, see what this global maps to.
- if (!LinkedGlobalsMap.empty()) {
- if (const GlobalValue *GVEntry =
- LinkedGlobalsMap[std::make_pair(I->getName(), I->getType())]) {
- // If something else is the canonical global, ignore this one.
- if (GVEntry != &*I) {
- NonCanonicalGlobals.push_back(I);
- continue;
- }
- }
- }
-
- if (!I->isDeclaration()) {
- // Get the type of the global.
- const Type *Ty = I->getType()->getElementType();
-
- // Allocate some memory for it!
- unsigned Size = TD->getABITypeSize(Ty);
- addGlobalMapping(I, new char[Size]);
- } else {
- // External variable reference. Try to use the dynamic loader to
- // get a pointer to it.
- if (void *SymAddr =
- sys::DynamicLibrary::SearchForAddressOfSymbol(I->getName().c_str()))
- addGlobalMapping(I, SymAddr);
- else {
- cerr << "Could not resolve external global address: "
- << I->getName() << "\n";
- abort();
- }
- }
- }
-
- // If there are multiple modules, map the non-canonical globals to their
- // canonical location.
- if (!NonCanonicalGlobals.empty()) {
- for (unsigned i = 0, e = NonCanonicalGlobals.size(); i != e; ++i) {
- const GlobalValue *GV = NonCanonicalGlobals[i];
- const GlobalValue *CGV =
- LinkedGlobalsMap[std::make_pair(GV->getName(), GV->getType())];
- void *Ptr = getPointerToGlobalIfAvailable(CGV);
- assert(Ptr && "Canonical global wasn't codegen'd!");
- addGlobalMapping(GV, getPointerToGlobalIfAvailable(CGV));
- }
- }
-
- // Now that all of the globals are set up in memory, loop through them all
- // and initialize their contents.
- for (Module::const_global_iterator I = M.global_begin(), E = M.global_end();
- I != E; ++I) {
- if (!I->isDeclaration()) {
- if (!LinkedGlobalsMap.empty()) {
- if (const GlobalValue *GVEntry =
- LinkedGlobalsMap[std::make_pair(I->getName(), I->getType())])
- if (GVEntry != &*I) // Not the canonical variable.
- continue;
- }
- EmitGlobalVariable(I);
- }
- }
- }
-}
-
-// EmitGlobalVariable - This method emits the specified global variable to the
-// address specified in GlobalAddresses, or allocates new memory if it's not
-// already in the map.
-void ExecutionEngine::EmitGlobalVariable(const GlobalVariable *GV) {
- void *GA = getPointerToGlobalIfAvailable(GV);
- DOUT << "Global '" << GV->getName() << "' -> " << GA << "\n";
-
- const Type *ElTy = GV->getType()->getElementType();
- size_t GVSize = (size_t)getTargetData()->getABITypeSize(ElTy);
- if (GA == 0) {
- // If it's not already specified, allocate memory for the global.
- GA = new char[GVSize];
- addGlobalMapping(GV, GA);
- }
-
- InitializeMemory(GV->getInitializer(), GA);
- NumInitBytes += (unsigned)GVSize;
- ++NumGlobals;
-}
diff --git a/release_23/lib/ExecutionEngine/ExecutionEngineBindings.cpp b/release_23/lib/ExecutionEngine/ExecutionEngineBindings.cpp
deleted file mode 100644
index 00195f099c14..000000000000
--- a/release_23/lib/ExecutionEngine/ExecutionEngineBindings.cpp
+++ /dev/null
@@ -1,194 +0,0 @@
-//===-- ExecutionEngineBindings.cpp - C bindings for EEs ------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines the C bindings for the ExecutionEngine library.
-//
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "jit"
-#include "llvm-c/ExecutionEngine.h"
-#include "llvm/ExecutionEngine/GenericValue.h"
-#include "llvm/ExecutionEngine/ExecutionEngine.h"
-#include <cstring>
-
-using namespace llvm;
-
-/*===-- Operations on generic values --------------------------------------===*/
-
-LLVMGenericValueRef LLVMCreateGenericValueOfInt(LLVMTypeRef Ty,
- unsigned long long N,
- int IsSigned) {
- GenericValue *GenVal = new GenericValue();
- GenVal->IntVal = APInt(unwrap<IntegerType>(Ty)->getBitWidth(), N, IsSigned);
- return wrap(GenVal);
-}
-
-LLVMGenericValueRef LLVMCreateGenericValueOfPointer(void *P) {
- GenericValue *GenVal = new GenericValue();
- GenVal->PointerVal = P;
- return wrap(GenVal);
-}
-
-LLVMGenericValueRef LLVMCreateGenericValueOfFloat(LLVMTypeRef TyRef, double N) {
- GenericValue *GenVal = new GenericValue();
- switch (unwrap(TyRef)->getTypeID()) {
- case Type::FloatTyID:
- GenVal->FloatVal = N;
- break;
- case Type::DoubleTyID:
- GenVal->DoubleVal = N;
- break;
- default:
- assert(0 && "LLVMGenericValueToFloat supports only float and double.");
- break;
- }
- return wrap(GenVal);
-}
-
-unsigned LLVMGenericValueIntWidth(LLVMGenericValueRef GenValRef) {
- return unwrap(GenValRef)->IntVal.getBitWidth();
-}
-
-unsigned long long LLVMGenericValueToInt(LLVMGenericValueRef GenValRef,
- int IsSigned) {
- GenericValue *GenVal = unwrap(GenValRef);
- if (IsSigned)
- return GenVal->IntVal.getSExtValue();
- else
- return GenVal->IntVal.getZExtValue();
-}
-
-void *LLVMGenericValueToPointer(LLVMGenericValueRef GenVal) {
- return unwrap(GenVal)->PointerVal;
-}
-
-double LLVMGenericValueToFloat(LLVMTypeRef TyRef, LLVMGenericValueRef GenVal) {
- switch (unwrap(TyRef)->getTypeID()) {
- case Type::FloatTyID:
- return unwrap(GenVal)->FloatVal;
- case Type::DoubleTyID:
- return unwrap(GenVal)->DoubleVal;
- default:
- assert(0 && "LLVMGenericValueToFloat supports only float and double.");
- break;
- }
- return 0; // Not reached
-}
-
-void LLVMDisposeGenericValue(LLVMGenericValueRef GenVal) {
- delete unwrap(GenVal);
-}
-
-/*===-- Operations on execution engines -----------------------------------===*/
-
-int LLVMCreateExecutionEngine(LLVMExecutionEngineRef *OutEE,
- LLVMModuleProviderRef MP,
- char **OutError) {
- std::string Error;
- if (ExecutionEngine *EE = ExecutionEngine::create(unwrap(MP), false, &Error)){
- *OutEE = wrap(EE);
- return 0;
- }
- *OutError = strdup(Error.c_str());
- return 1;
-}
-
-int LLVMCreateInterpreter(LLVMExecutionEngineRef *OutInterp,
- LLVMModuleProviderRef MP,
- char **OutError) {
- std::string Error;
- if (ExecutionEngine *Interp =
- ExecutionEngine::create(unwrap(MP), true, &Error)) {
- *OutInterp = wrap(Interp);
- return 0;
- }
- *OutError = strdup(Error.c_str());
- return 1;
-}
-
-int LLVMCreateJITCompiler(LLVMExecutionEngineRef *OutJIT,
- LLVMModuleProviderRef MP,
- char **OutError) {
- std::string Error;
- if (ExecutionEngine *JIT = ExecutionEngine::createJIT(unwrap(MP), &Error)) {
- *OutJIT = wrap(JIT);
- return 0;
- }
- *OutError = strdup(Error.c_str());
- return 1;
-}
-
-void LLVMDisposeExecutionEngine(LLVMExecutionEngineRef EE) {
- delete unwrap(EE);
-}
-
-void LLVMRunStaticConstructors(LLVMExecutionEngineRef EE) {
- unwrap(EE)->runStaticConstructorsDestructors(false);
-}
-
-void LLVMRunStaticDestructors(LLVMExecutionEngineRef EE) {
- unwrap(EE)->runStaticConstructorsDestructors(true);
-}
-
-int LLVMRunFunctionAsMain(LLVMExecutionEngineRef EE, LLVMValueRef F,
- unsigned ArgC, const char * const *ArgV,
- const char * const *EnvP) {
- std::vector<std::string> ArgVec;
- for (unsigned I = 0; I != ArgC; ++I)
- ArgVec.push_back(ArgV[I]);
-
- return unwrap(EE)->runFunctionAsMain(unwrap<Function>(F), ArgVec, EnvP);
-}
-
-LLVMGenericValueRef LLVMRunFunction(LLVMExecutionEngineRef EE, LLVMValueRef F,
- unsigned NumArgs,
- LLVMGenericValueRef *Args) {
- std::vector<GenericValue> ArgVec;
- ArgVec.reserve(NumArgs);
- for (unsigned I = 0; I != NumArgs; ++I)
- ArgVec.push_back(*unwrap(Args[I]));
-
- GenericValue *Result = new GenericValue();
- *Result = unwrap(EE)->runFunction(unwrap<Function>(F), ArgVec);
- return wrap(Result);
-}
-
-void LLVMFreeMachineCodeForFunction(LLVMExecutionEngineRef EE, LLVMValueRef F) {
- unwrap(EE)->freeMachineCodeForFunction(unwrap<Function>(F));
-}
-
-void LLVMAddModuleProvider(LLVMExecutionEngineRef EE, LLVMModuleProviderRef MP){
- unwrap(EE)->addModuleProvider(unwrap(MP));
-}
-
-int LLVMRemoveModuleProvider(LLVMExecutionEngineRef EE,
- LLVMModuleProviderRef MP,
- LLVMModuleRef *OutMod, char **OutError) {
- std::string Error;
- if (Module *Gone = unwrap(EE)->removeModuleProvider(unwrap(MP), &Error)) {
- *OutMod = wrap(Gone);
- return 0;
- }
- if (OutError)
- *OutError = strdup(Error.c_str());
- return 1;
-}
-
-int LLVMFindFunction(LLVMExecutionEngineRef EE, const char *Name,
- LLVMValueRef *OutFn) {
- if (Function *F = unwrap(EE)->FindFunctionNamed(Name)) {
- *OutFn = wrap(F);
- return 0;
- }
- return 1;
-}
-
-LLVMTargetDataRef LLVMGetExecutionEngineTargetData(LLVMExecutionEngineRef EE) {
- return wrap(unwrap(EE)->getTargetData());
-}
diff --git a/release_23/lib/ExecutionEngine/Interpreter/Execution.cpp b/release_23/lib/ExecutionEngine/Interpreter/Execution.cpp
deleted file mode 100644
index d05e8d010c18..000000000000
--- a/release_23/lib/ExecutionEngine/Interpreter/Execution.cpp
+++ /dev/null
@@ -1,1363 +0,0 @@
-//===-- Execution.cpp - Implement code to simulate the program ------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains the actual instruction interpreter.
-//
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "interpreter"
-#include "Interpreter.h"
-#include "llvm/Constants.h"
-#include "llvm/DerivedTypes.h"
-#include "llvm/Instructions.h"
-#include "llvm/ParameterAttributes.h"
-#include "llvm/CodeGen/IntrinsicLowering.h"
-#include "llvm/Support/GetElementPtrTypeIterator.h"
-#include "llvm/ADT/APInt.h"
-#include "llvm/ADT/Statistic.h"
-#include "llvm/Support/Debug.h"
-#include "llvm/Support/MathExtras.h"
-#include <algorithm>
-#include <cmath>
-#include <cstring>
-using namespace llvm;
-
-STATISTIC(NumDynamicInsts, "Number of dynamic instructions executed");
-static Interpreter *TheEE = 0;
-
-//===----------------------------------------------------------------------===//
-// Various Helper Functions
-//===----------------------------------------------------------------------===//
-
-static inline uint64_t doSignExtension(uint64_t Val, const IntegerType* ITy) {
- // Determine if the value is signed or not
- bool isSigned = (Val & (1 << (ITy->getBitWidth()-1))) != 0;
- // If its signed, extend the sign bits
- if (isSigned)
- Val |= ~ITy->getBitMask();
- return Val;
-}
-
-static void SetValue(Value *V, GenericValue Val, ExecutionContext &SF) {
- SF.Values[V] = Val;
-}
-
-void Interpreter::initializeExecutionEngine() {
- TheEE = this;
-}
-
-//===----------------------------------------------------------------------===//
-// Binary Instruction Implementations
-//===----------------------------------------------------------------------===//
-
-#define IMPLEMENT_BINARY_OPERATOR(OP, TY) \
- case Type::TY##TyID: \
- Dest.TY##Val = Src1.TY##Val OP Src2.TY##Val; \
- break
-
-#define IMPLEMENT_INTEGER_BINOP1(OP, TY) \
- case Type::IntegerTyID: { \
- Dest.IntVal = Src1.IntVal OP Src2.IntVal; \
- break; \
- }
-
-
-static void executeAddInst(GenericValue &Dest, GenericValue Src1,
- GenericValue Src2, const Type *Ty) {
- switch (Ty->getTypeID()) {
- IMPLEMENT_INTEGER_BINOP1(+, Ty);
- IMPLEMENT_BINARY_OPERATOR(+, Float);
- IMPLEMENT_BINARY_OPERATOR(+, Double);
- default:
- cerr << "Unhandled type for Add instruction: " << *Ty << "\n";
- abort();
- }
-}
-
-static void executeSubInst(GenericValue &Dest, GenericValue Src1,
- GenericValue Src2, const Type *Ty) {
- switch (Ty->getTypeID()) {
- IMPLEMENT_INTEGER_BINOP1(-, Ty);
- IMPLEMENT_BINARY_OPERATOR(-, Float);
- IMPLEMENT_BINARY_OPERATOR(-, Double);
- default:
- cerr << "Unhandled type for Sub instruction: " << *Ty << "\n";
- abort();
- }
-}
-
-static void executeMulInst(GenericValue &Dest, GenericValue Src1,
- GenericValue Src2, const Type *Ty) {
- switch (Ty->getTypeID()) {
- IMPLEMENT_INTEGER_BINOP1(*, Ty);
- IMPLEMENT_BINARY_OPERATOR(*, Float);
- IMPLEMENT_BINARY_OPERATOR(*, Double);
- default:
- cerr << "Unhandled type for Mul instruction: " << *Ty << "\n";
- abort();
- }
-}
-
-static void executeFDivInst(GenericValue &Dest, GenericValue Src1,
- GenericValue Src2, const Type *Ty) {
- switch (Ty->getTypeID()) {
- IMPLEMENT_BINARY_OPERATOR(/, Float);
- IMPLEMENT_BINARY_OPERATOR(/, Double);
- default:
- cerr << "Unhandled type for FDiv instruction: " << *Ty << "\n";
- abort();
- }
-}
-
-static void executeFRemInst(GenericValue &Dest, GenericValue Src1,
- GenericValue Src2, const Type *Ty) {
- switch (Ty->getTypeID()) {
- case Type::FloatTyID:
- Dest.FloatVal = fmod(Src1.FloatVal, Src2.FloatVal);
- break;
- case Type::DoubleTyID:
- Dest.DoubleVal = fmod(Src1.DoubleVal, Src2.DoubleVal);
- break;
- default:
- cerr << "Unhandled type for Rem instruction: " << *Ty << "\n";
- abort();
- }
-}
-
-#define IMPLEMENT_INTEGER_ICMP(OP, TY) \
- case Type::IntegerTyID: \
- Dest.IntVal = APInt(1,Src1.IntVal.OP(Src2.IntVal)); \
- break;
-
-// Handle pointers specially because they must be compared with only as much
-// width as the host has. We _do not_ want to be comparing 64 bit values when
-// running on a 32-bit target, otherwise the upper 32 bits might mess up
-// comparisons if they contain garbage.
-#define IMPLEMENT_POINTER_ICMP(OP) \
- case Type::PointerTyID: \
- Dest.IntVal = APInt(1,(void*)(intptr_t)Src1.PointerVal OP \
- (void*)(intptr_t)Src2.PointerVal); \
- break;
-
-static GenericValue executeICMP_EQ(GenericValue Src1, GenericValue Src2,
- const Type *Ty) {
- GenericValue Dest;
- switch (Ty->getTypeID()) {
- IMPLEMENT_INTEGER_ICMP(eq,Ty);
- IMPLEMENT_POINTER_ICMP(==);
- default:
- cerr << "Unhandled type for ICMP_EQ predicate: " << *Ty << "\n";
- abort();
- }
- return Dest;
-}
-
-static GenericValue executeICMP_NE(GenericValue Src1, GenericValue Src2,
- const Type *Ty) {
- GenericValue Dest;
- switch (Ty->getTypeID()) {
- IMPLEMENT_INTEGER_ICMP(ne,Ty);
- IMPLEMENT_POINTER_ICMP(!=);
- default:
- cerr << "Unhandled type for ICMP_NE predicate: " << *Ty << "\n";
- abort();
- }
- return Dest;
-}
-
-static GenericValue executeICMP_ULT(GenericValue Src1, GenericValue Src2,
- const Type *Ty) {
- GenericValue Dest;
- switch (Ty->getTypeID()) {
- IMPLEMENT_INTEGER_ICMP(ult,Ty);
- IMPLEMENT_POINTER_ICMP(<);
- default:
- cerr << "Unhandled type for ICMP_ULT predicate: " << *Ty << "\n";
- abort();
- }
- return Dest;
-}
-
-static GenericValue executeICMP_SLT(GenericValue Src1, GenericValue Src2,
- const Type *Ty) {
- GenericValue Dest;
- switch (Ty->getTypeID()) {
- IMPLEMENT_INTEGER_ICMP(slt,Ty);
- IMPLEMENT_POINTER_ICMP(<);
- default:
- cerr << "Unhandled type for ICMP_SLT predicate: " << *Ty << "\n";
- abort();
- }
- return Dest;
-}
-
-static GenericValue executeICMP_UGT(GenericValue Src1, GenericValue Src2,
- const Type *Ty) {
- GenericValue Dest;
- switch (Ty->getTypeID()) {
- IMPLEMENT_INTEGER_ICMP(ugt,Ty);
- IMPLEMENT_POINTER_ICMP(>);
- default:
- cerr << "Unhandled type for ICMP_UGT predicate: " << *Ty << "\n";
- abort();
- }
- return Dest;
-}
-
-static GenericValue executeICMP_SGT(GenericValue Src1, GenericValue Src2,
- const Type *Ty) {
- GenericValue Dest;
- switch (Ty->getTypeID()) {
- IMPLEMENT_INTEGER_ICMP(sgt,Ty);
- IMPLEMENT_POINTER_ICMP(>);
- default:
- cerr << "Unhandled type for ICMP_SGT predicate: " << *Ty << "\n";
- abort();
- }
- return Dest;
-}
-
-static GenericValue executeICMP_ULE(GenericValue Src1, GenericValue Src2,
- const Type *Ty) {
- GenericValue Dest;
- switch (Ty->getTypeID()) {
- IMPLEMENT_INTEGER_ICMP(ule,Ty);
- IMPLEMENT_POINTER_ICMP(<=);
- default:
- cerr << "Unhandled type for ICMP_ULE predicate: " << *Ty << "\n";
- abort();
- }
- return Dest;
-}
-
-static GenericValue executeICMP_SLE(GenericValue Src1, GenericValue Src2,
- const Type *Ty) {
- GenericValue Dest;
- switch (Ty->getTypeID()) {
- IMPLEMENT_INTEGER_ICMP(sle,Ty);
- IMPLEMENT_POINTER_ICMP(<=);
- default:
- cerr << "Unhandled type for ICMP_SLE predicate: " << *Ty << "\n";
- abort();
- }
- return Dest;
-}
-
-static GenericValue executeICMP_UGE(GenericValue Src1, GenericValue Src2,
- const Type *Ty) {
- GenericValue Dest;
- switch (Ty->getTypeID()) {
- IMPLEMENT_INTEGER_ICMP(uge,Ty);
- IMPLEMENT_POINTER_ICMP(>=);
- default:
- cerr << "Unhandled type for ICMP_UGE predicate: " << *Ty << "\n";
- abort();
- }
- return Dest;
-}
-
-static GenericValue executeICMP_SGE(GenericValue Src1, GenericValue Src2,
- const Type *Ty) {
- GenericValue Dest;
- switch (Ty->getTypeID()) {
- IMPLEMENT_INTEGER_ICMP(sge,Ty);
- IMPLEMENT_POINTER_ICMP(>=);
- default:
- cerr << "Unhandled type for ICMP_SGE predicate: " << *Ty << "\n";
- abort();
- }
- return Dest;
-}
-
-void Interpreter::visitICmpInst(ICmpInst &I) {
- ExecutionContext &SF = ECStack.back();
- const Type *Ty = I.getOperand(0)->getType();
- GenericValue Src1 = getOperandValue(I.getOperand(0), SF);
- GenericValue Src2 = getOperandValue(I.getOperand(1), SF);
- GenericValue R; // Result
-
- switch (I.getPredicate()) {
- case ICmpInst::ICMP_EQ: R = executeICMP_EQ(Src1, Src2, Ty); break;
- case ICmpInst::ICMP_NE: R = executeICMP_NE(Src1, Src2, Ty); break;
- case ICmpInst::ICMP_ULT: R = executeICMP_ULT(Src1, Src2, Ty); break;
- case ICmpInst::ICMP_SLT: R = executeICMP_SLT(Src1, Src2, Ty); break;
- case ICmpInst::ICMP_UGT: R = executeICMP_UGT(Src1, Src2, Ty); break;
- case ICmpInst::ICMP_SGT: R = executeICMP_SGT(Src1, Src2, Ty); break;
- case ICmpInst::ICMP_ULE: R = executeICMP_ULE(Src1, Src2, Ty); break;
- case ICmpInst::ICMP_SLE: R = executeICMP_SLE(Src1, Src2, Ty); break;
- case ICmpInst::ICMP_UGE: R = executeICMP_UGE(Src1, Src2, Ty); break;
- case ICmpInst::ICMP_SGE: R = executeICMP_SGE(Src1, Src2, Ty); break;
- default:
- cerr << "Don't know how to handle this ICmp predicate!\n-->" << I;
- abort();
- }
-
- SetValue(&I, R, SF);
-}
-
-#define IMPLEMENT_FCMP(OP, TY) \
- case Type::TY##TyID: \
- Dest.IntVal = APInt(1,Src1.TY##Val OP Src2.TY##Val); \
- break
-
-static GenericValue executeFCMP_OEQ(GenericValue Src1, GenericValue Src2,
- const Type *Ty) {
- GenericValue Dest;
- switch (Ty->getTypeID()) {
- IMPLEMENT_FCMP(==, Float);
- IMPLEMENT_FCMP(==, Double);
- default:
- cerr << "Unhandled type for FCmp EQ instruction: " << *Ty << "\n";
- abort();
- }
- return Dest;
-}
-
-static GenericValue executeFCMP_ONE(GenericValue Src1, GenericValue Src2,
- const Type *Ty) {
- GenericValue Dest;
- switch (Ty->getTypeID()) {
- IMPLEMENT_FCMP(!=, Float);
- IMPLEMENT_FCMP(!=, Double);
-
- default:
- cerr << "Unhandled type for FCmp NE instruction: " << *Ty << "\n";
- abort();
- }
- return Dest;
-}
-
-static GenericValue executeFCMP_OLE(GenericValue Src1, GenericValue Src2,
- const Type *Ty) {
- GenericValue Dest;
- switch (Ty->getTypeID()) {
- IMPLEMENT_FCMP(<=, Float);
- IMPLEMENT_FCMP(<=, Double);
- default:
- cerr << "Unhandled type for FCmp LE instruction: " << *Ty << "\n";
- abort();
- }
- return Dest;
-}
-
-static GenericValue executeFCMP_OGE(GenericValue Src1, GenericValue Src2,
- const Type *Ty) {
- GenericValue Dest;
- switch (Ty->getTypeID()) {
- IMPLEMENT_FCMP(>=, Float);
- IMPLEMENT_FCMP(>=, Double);
- default:
- cerr << "Unhandled type for FCmp GE instruction: " << *Ty << "\n";
- abort();
- }
- return Dest;
-}
-
-static GenericValue executeFCMP_OLT(GenericValue Src1, GenericValue Src2,
- const Type *Ty) {
- GenericValue Dest;
- switch (Ty->getTypeID()) {
- IMPLEMENT_FCMP(<, Float);
- IMPLEMENT_FCMP(<, Double);
- default:
- cerr << "Unhandled type for FCmp LT instruction: " << *Ty << "\n";
- abort();
- }
- return Dest;
-}
-
-static GenericValue executeFCMP_OGT(GenericValue Src1, GenericValue Src2,
- const Type *Ty) {
- GenericValue Dest;
- switch (Ty->getTypeID()) {
- IMPLEMENT_FCMP(>, Float);
- IMPLEMENT_FCMP(>, Double);
- default:
- cerr << "Unhandled type for FCmp GT instruction: " << *Ty << "\n";
- abort();
- }
- return Dest;
-}
-
-#define IMPLEMENT_UNORDERED(TY, X,Y) \
- if (TY == Type::FloatTy) { \
- if (X.FloatVal != X.FloatVal || Y.FloatVal != Y.FloatVal) { \
- Dest.IntVal = APInt(1,true); \
- return Dest; \
- } \
- } else if (X.DoubleVal != X.DoubleVal || Y.DoubleVal != Y.DoubleVal) { \
- Dest.IntVal = APInt(1,true); \
- return Dest; \
- }
-
-
-static GenericValue executeFCMP_UEQ(GenericValue Src1, GenericValue Src2,
- const Type *Ty) {
- GenericValue Dest;
- IMPLEMENT_UNORDERED(Ty, Src1, Src2)
- return executeFCMP_OEQ(Src1, Src2, Ty);
-}
-
-static GenericValue executeFCMP_UNE(GenericValue Src1, GenericValue Src2,
- const Type *Ty) {
- GenericValue Dest;
- IMPLEMENT_UNORDERED(Ty, Src1, Src2)
- return executeFCMP_ONE(Src1, Src2, Ty);
-}
-
-static GenericValue executeFCMP_ULE(GenericValue Src1, GenericValue Src2,
- const Type *Ty) {
- GenericValue Dest;
- IMPLEMENT_UNORDERED(Ty, Src1, Src2)
- return executeFCMP_OLE(Src1, Src2, Ty);
-}
-
-static GenericValue executeFCMP_UGE(GenericValue Src1, GenericValue Src2,
- const Type *Ty) {
- GenericValue Dest;
- IMPLEMENT_UNORDERED(Ty, Src1, Src2)
- return executeFCMP_OGE(Src1, Src2, Ty);
-}
-
-static GenericValue executeFCMP_ULT(GenericValue Src1, GenericValue Src2,
- const Type *Ty) {
- GenericValue Dest;
- IMPLEMENT_UNORDERED(Ty, Src1, Src2)
- return executeFCMP_OLT(Src1, Src2, Ty);
-}
-
-static GenericValue executeFCMP_UGT(GenericValue Src1, GenericValue Src2,
- const Type *Ty) {
- GenericValue Dest;
- IMPLEMENT_UNORDERED(Ty, Src1, Src2)
- return executeFCMP_OGT(Src1, Src2, Ty);
-}
-
-static GenericValue executeFCMP_ORD(GenericValue Src1, GenericValue Src2,
- const Type *Ty) {
- GenericValue Dest;
- if (Ty == Type::FloatTy)
- Dest.IntVal = APInt(1,(Src1.FloatVal == Src1.FloatVal &&
- Src2.FloatVal == Src2.FloatVal));
- else
- Dest.IntVal = APInt(1,(Src1.DoubleVal == Src1.DoubleVal &&
- Src2.DoubleVal == Src2.DoubleVal));
- return Dest;
-}
-
-static GenericValue executeFCMP_UNO(GenericValue Src1, GenericValue Src2,
- const Type *Ty) {
- GenericValue Dest;
- if (Ty == Type::FloatTy)
- Dest.IntVal = APInt(1,(Src1.FloatVal != Src1.FloatVal ||
- Src2.FloatVal != Src2.FloatVal));
- else
- Dest.IntVal = APInt(1,(Src1.DoubleVal != Src1.DoubleVal ||
- Src2.DoubleVal != Src2.DoubleVal));
- return Dest;
-}
-
-void Interpreter::visitFCmpInst(FCmpInst &I) {
- ExecutionContext &SF = ECStack.back();
- const Type *Ty = I.getOperand(0)->getType();
- GenericValue Src1 = getOperandValue(I.getOperand(0), SF);
- GenericValue Src2 = getOperandValue(I.getOperand(1), SF);
- GenericValue R; // Result
-
- switch (I.getPredicate()) {
- case FCmpInst::FCMP_FALSE: R.IntVal = APInt(1,false); break;
- case FCmpInst::FCMP_TRUE: R.IntVal = APInt(1,true); break;
- case FCmpInst::FCMP_ORD: R = executeFCMP_ORD(Src1, Src2, Ty); break;
- case FCmpInst::FCMP_UNO: R = executeFCMP_UNO(Src1, Src2, Ty); break;
- case FCmpInst::FCMP_UEQ: R = executeFCMP_UEQ(Src1, Src2, Ty); break;
- case FCmpInst::FCMP_OEQ: R = executeFCMP_OEQ(Src1, Src2, Ty); break;
- case FCmpInst::FCMP_UNE: R = executeFCMP_UNE(Src1, Src2, Ty); break;
- case FCmpInst::FCMP_ONE: R = executeFCMP_ONE(Src1, Src2, Ty); break;
- case FCmpInst::FCMP_ULT: R = executeFCMP_ULT(Src1, Src2, Ty); break;
- case FCmpInst::FCMP_OLT: R = executeFCMP_OLT(Src1, Src2, Ty); break;
- case FCmpInst::FCMP_UGT: R = executeFCMP_UGT(Src1, Src2, Ty); break;
- case FCmpInst::FCMP_OGT: R = executeFCMP_OGT(Src1, Src2, Ty); break;
- case FCmpInst::FCMP_ULE: R = executeFCMP_ULE(Src1, Src2, Ty); break;
- case FCmpInst::FCMP_OLE: R = executeFCMP_OLE(Src1, Src2, Ty); break;
- case FCmpInst::FCMP_UGE: R = executeFCMP_UGE(Src1, Src2, Ty); break;
- case FCmpInst::FCMP_OGE: R = executeFCMP_OGE(Src1, Src2, Ty); break;
- default:
- cerr << "Don't know how to handle this FCmp predicate!\n-->" << I;
- abort();
- }
-
- SetValue(&I, R, SF);
-}
-
-static GenericValue executeCmpInst(unsigned predicate, GenericValue Src1,
- GenericValue Src2, const Type *Ty) {
- GenericValue Result;
- switch (predicate) {
- case ICmpInst::ICMP_EQ: return executeICMP_EQ(Src1, Src2, Ty);
- case ICmpInst::ICMP_NE: return executeICMP_NE(Src1, Src2, Ty);
- case ICmpInst::ICMP_UGT: return executeICMP_UGT(Src1, Src2, Ty);
- case ICmpInst::ICMP_SGT: return executeICMP_SGT(Src1, Src2, Ty);
- case ICmpInst::ICMP_ULT: return executeICMP_ULT(Src1, Src2, Ty);
- case ICmpInst::ICMP_SLT: return executeICMP_SLT(Src1, Src2, Ty);
- case ICmpInst::ICMP_UGE: return executeICMP_UGE(Src1, Src2, Ty);
- case ICmpInst::ICMP_SGE: return executeICMP_SGE(Src1, Src2, Ty);
- case ICmpInst::ICMP_ULE: return executeICMP_ULE(Src1, Src2, Ty);
- case ICmpInst::ICMP_SLE: return executeICMP_SLE(Src1, Src2, Ty);
- case FCmpInst::FCMP_ORD: return executeFCMP_ORD(Src1, Src2, Ty);
- case FCmpInst::FCMP_UNO: return executeFCMP_UNO(Src1, Src2, Ty);
- case FCmpInst::FCMP_OEQ: return executeFCMP_OEQ(Src1, Src2, Ty);
- case FCmpInst::FCMP_UEQ: return executeFCMP_UEQ(Src1, Src2, Ty);
- case FCmpInst::FCMP_ONE: return executeFCMP_ONE(Src1, Src2, Ty);
- case FCmpInst::FCMP_UNE: return executeFCMP_UNE(Src1, Src2, Ty);
- case FCmpInst::FCMP_OLT: return executeFCMP_OLT(Src1, Src2, Ty);
- case FCmpInst::FCMP_ULT: return executeFCMP_ULT(Src1, Src2, Ty);
- case FCmpInst::FCMP_OGT: return executeFCMP_OGT(Src1, Src2, Ty);
- case FCmpInst::FCMP_UGT: return executeFCMP_UGT(Src1, Src2, Ty);
- case FCmpInst::FCMP_OLE: return executeFCMP_OLE(Src1, Src2, Ty);
- case FCmpInst::FCMP_ULE: return executeFCMP_ULE(Src1, Src2, Ty);
- case FCmpInst::FCMP_OGE: return executeFCMP_OGE(Src1, Src2, Ty);
- case FCmpInst::FCMP_UGE: return executeFCMP_UGE(Src1, Src2, Ty);
- case FCmpInst::FCMP_FALSE: {
- GenericValue Result;
- Result.IntVal = APInt(1, false);
- return Result;
- }
- case FCmpInst::FCMP_TRUE: {
- GenericValue Result;
- Result.IntVal = APInt(1, true);
- return Result;
- }
- default:
- cerr << "Unhandled Cmp predicate\n";
- abort();
- }
-}
-
-void Interpreter::visitBinaryOperator(BinaryOperator &I) {
- ExecutionContext &SF = ECStack.back();
- const Type *Ty = I.getOperand(0)->getType();
- GenericValue Src1 = getOperandValue(I.getOperand(0), SF);
- GenericValue Src2 = getOperandValue(I.getOperand(1), SF);
- GenericValue R; // Result
-
- switch (I.getOpcode()) {
- case Instruction::Add: executeAddInst (R, Src1, Src2, Ty); break;
- case Instruction::Sub: executeSubInst (R, Src1, Src2, Ty); break;
- case Instruction::Mul: executeMulInst (R, Src1, Src2, Ty); break;
- case Instruction::FDiv: executeFDivInst (R, Src1, Src2, Ty); break;
- case Instruction::FRem: executeFRemInst (R, Src1, Src2, Ty); break;
- case Instruction::UDiv: R.IntVal = Src1.IntVal.udiv(Src2.IntVal); break;
- case Instruction::SDiv: R.IntVal = Src1.IntVal.sdiv(Src2.IntVal); break;
- case Instruction::URem: R.IntVal = Src1.IntVal.urem(Src2.IntVal); break;
- case Instruction::SRem: R.IntVal = Src1.IntVal.srem(Src2.IntVal); break;
- case Instruction::And: R.IntVal = Src1.IntVal & Src2.IntVal; break;
- case Instruction::Or: R.IntVal = Src1.IntVal | Src2.IntVal; break;
- case Instruction::Xor: R.IntVal = Src1.IntVal ^ Src2.IntVal; break;
- default:
- cerr << "Don't know how to handle this binary operator!\n-->" << I;
- abort();
- }
-
- SetValue(&I, R, SF);
-}
-
-static GenericValue executeSelectInst(GenericValue Src1, GenericValue Src2,
- GenericValue Src3) {
- return Src1.IntVal == 0 ? Src3 : Src2;
-}
-
-void Interpreter::visitSelectInst(SelectInst &I) {
- ExecutionContext &SF = ECStack.back();
- GenericValue Src1 = getOperandValue(I.getOperand(0), SF);
- GenericValue Src2 = getOperandValue(I.getOperand(1), SF);
- GenericValue Src3 = getOperandValue(I.getOperand(2), SF);
- GenericValue R = executeSelectInst(Src1, Src2, Src3);
- SetValue(&I, R, SF);
-}
-
-
-//===----------------------------------------------------------------------===//
-// Terminator Instruction Implementations
-//===----------------------------------------------------------------------===//
-
-void Interpreter::exitCalled(GenericValue GV) {
- // runAtExitHandlers() assumes there are no stack frames, but
- // if exit() was called, then it had a stack frame. Blow away
- // the stack before interpreting atexit handlers.
- ECStack.clear ();
- runAtExitHandlers ();
- exit (GV.IntVal.zextOrTrunc(32).getZExtValue());
-}
-
-/// Pop the last stack frame off of ECStack and then copy the result
-/// back into the result variable if we are not returning void. The
-/// result variable may be the ExitValue, or the Value of the calling
-/// CallInst if there was a previous stack frame. This method may
-/// invalidate any ECStack iterators you have. This method also takes
-/// care of switching to the normal destination BB, if we are returning
-/// from an invoke.
-///
-void Interpreter::popStackAndReturnValueToCaller (const Type *RetTy,
- GenericValue Result) {
- // Pop the current stack frame.
- ECStack.pop_back();
-
- if (ECStack.empty()) { // Finished main. Put result into exit code...
- if (RetTy && RetTy->isInteger()) { // Nonvoid return type?
- ExitValue = Result; // Capture the exit value of the program
- } else {
- memset(&ExitValue.Untyped, 0, sizeof(ExitValue.Untyped));
- }
- } else {
- // If we have a previous stack frame, and we have a previous call,
- // fill in the return value...
- ExecutionContext &CallingSF = ECStack.back();
- if (Instruction *I = CallingSF.Caller.getInstruction()) {
- if (CallingSF.Caller.getType() != Type::VoidTy) // Save result...
- SetValue(I, Result, CallingSF);
- if (InvokeInst *II = dyn_cast<InvokeInst> (I))
- SwitchToNewBasicBlock (II->getNormalDest (), CallingSF);
- CallingSF.Caller = CallSite(); // We returned from the call...
- }
- }
-}
-
-void Interpreter::visitReturnInst(ReturnInst &I) {
- ExecutionContext &SF = ECStack.back();
- const Type *RetTy = Type::VoidTy;
- GenericValue Result;
-
- // Save away the return value... (if we are not 'ret void')
- if (I.getNumOperands()) {
- RetTy = I.getReturnValue()->getType();
- Result = getOperandValue(I.getReturnValue(), SF);
- }
-
- popStackAndReturnValueToCaller(RetTy, Result);
-}
-
-void Interpreter::visitUnwindInst(UnwindInst &I) {
- // Unwind stack
- Instruction *Inst;
- do {
- ECStack.pop_back ();
- if (ECStack.empty ())
- abort ();
- Inst = ECStack.back ().Caller.getInstruction ();
- } while (!(Inst && isa<InvokeInst> (Inst)));
-
- // Return from invoke
- ExecutionContext &InvokingSF = ECStack.back ();
- InvokingSF.Caller = CallSite ();
-
- // Go to exceptional destination BB of invoke instruction
- SwitchToNewBasicBlock(cast<InvokeInst>(Inst)->getUnwindDest(), InvokingSF);
-}
-
-void Interpreter::visitUnreachableInst(UnreachableInst &I) {
- cerr << "ERROR: Program executed an 'unreachable' instruction!\n";
- abort();
-}
-
-void Interpreter::visitBranchInst(BranchInst &I) {
- ExecutionContext &SF = ECStack.back();
- BasicBlock *Dest;
-
- Dest = I.getSuccessor(0); // Uncond branches have a fixed dest...
- if (!I.isUnconditional()) {
- Value *Cond = I.getCondition();
- if (getOperandValue(Cond, SF).IntVal == 0) // If false cond...
- Dest = I.getSuccessor(1);
- }
- SwitchToNewBasicBlock(Dest, SF);
-}
-
-void Interpreter::visitSwitchInst(SwitchInst &I) {
- ExecutionContext &SF = ECStack.back();
- GenericValue CondVal = getOperandValue(I.getOperand(0), SF);
- const Type *ElTy = I.getOperand(0)->getType();
-
- // Check to see if any of the cases match...
- BasicBlock *Dest = 0;
- for (unsigned i = 2, e = I.getNumOperands(); i != e; i += 2)
- if (executeICMP_EQ(CondVal, getOperandValue(I.getOperand(i), SF), ElTy)
- .IntVal != 0) {
- Dest = cast<BasicBlock>(I.getOperand(i+1));
- break;
- }
-
- if (!Dest) Dest = I.getDefaultDest(); // No cases matched: use default
- SwitchToNewBasicBlock(Dest, SF);
-}
-
-// SwitchToNewBasicBlock - This method is used to jump to a new basic block.
-// This function handles the actual updating of block and instruction iterators
-// as well as execution of all of the PHI nodes in the destination block.
-//
-// This method does this because all of the PHI nodes must be executed
-// atomically, reading their inputs before any of the results are updated. Not
-// doing this can cause problems if the PHI nodes depend on other PHI nodes for
-// their inputs. If the input PHI node is updated before it is read, incorrect
-// results can happen. Thus we use a two phase approach.
-//
-void Interpreter::SwitchToNewBasicBlock(BasicBlock *Dest, ExecutionContext &SF){
- BasicBlock *PrevBB = SF.CurBB; // Remember where we came from...
- SF.CurBB = Dest; // Update CurBB to branch destination
- SF.CurInst = SF.CurBB->begin(); // Update new instruction ptr...
-
- if (!isa<PHINode>(SF.CurInst)) return; // Nothing fancy to do
-
- // Loop over all of the PHI nodes in the current block, reading their inputs.
- std::vector<GenericValue> ResultValues;
-
- for (; PHINode *PN = dyn_cast<PHINode>(SF.CurInst); ++SF.CurInst) {
- // Search for the value corresponding to this previous bb...
- int i = PN->getBasicBlockIndex(PrevBB);
- assert(i != -1 && "PHINode doesn't contain entry for predecessor??");
- Value *IncomingValue = PN->getIncomingValue(i);
-
- // Save the incoming value for this PHI node...
- ResultValues.push_back(getOperandValue(IncomingValue, SF));
- }
-
- // Now loop over all of the PHI nodes setting their values...
- SF.CurInst = SF.CurBB->begin();
- for (unsigned i = 0; isa<PHINode>(SF.CurInst); ++SF.CurInst, ++i) {
- PHINode *PN = cast<PHINode>(SF.CurInst);
- SetValue(PN, ResultValues[i], SF);
- }
-}
-
-//===----------------------------------------------------------------------===//
-// Memory Instruction Implementations
-//===----------------------------------------------------------------------===//
-
-void Interpreter::visitAllocationInst(AllocationInst &I) {
- ExecutionContext &SF = ECStack.back();
-
- const Type *Ty = I.getType()->getElementType(); // Type to be allocated
-
- // Get the number of elements being allocated by the array...
- unsigned NumElements =
- getOperandValue(I.getOperand(0), SF).IntVal.getZExtValue();
-
- unsigned TypeSize = (size_t)TD.getABITypeSize(Ty);
-
- // Avoid malloc-ing zero bytes, use max()...
- unsigned MemToAlloc = std::max(1U, NumElements * TypeSize);
-
- // Allocate enough memory to hold the type...
- void *Memory = malloc(MemToAlloc);
-
- DOUT << "Allocated Type: " << *Ty << " (" << TypeSize << " bytes) x "
- << NumElements << " (Total: " << MemToAlloc << ") at "
- << uintptr_t(Memory) << '\n';
-
- GenericValue Result = PTOGV(Memory);
- assert(Result.PointerVal != 0 && "Null pointer returned by malloc!");
- SetValue(&I, Result, SF);
-
- if (I.getOpcode() == Instruction::Alloca)
- ECStack.back().Allocas.add(Memory);
-}
-
-void Interpreter::visitFreeInst(FreeInst &I) {
- ExecutionContext &SF = ECStack.back();
- assert(isa<PointerType>(I.getOperand(0)->getType()) && "Freeing nonptr?");
- GenericValue Value = getOperandValue(I.getOperand(0), SF);
- // TODO: Check to make sure memory is allocated
- free(GVTOP(Value)); // Free memory
-}
-
-// getElementOffset - The workhorse for getelementptr.
-//
-GenericValue Interpreter::executeGEPOperation(Value *Ptr, gep_type_iterator I,
- gep_type_iterator E,
- ExecutionContext &SF) {
- assert(isa<PointerType>(Ptr->getType()) &&
- "Cannot getElementOffset of a nonpointer type!");
-
- uint64_t Total = 0;
-
- for (; I != E; ++I) {
- if (const StructType *STy = dyn_cast<StructType>(*I)) {
- const StructLayout *SLO = TD.getStructLayout(STy);
-
- const ConstantInt *CPU = cast<ConstantInt>(I.getOperand());
- unsigned Index = unsigned(CPU->getZExtValue());
-
- Total += SLO->getElementOffset(Index);
- } else {
- const SequentialType *ST = cast<SequentialType>(*I);
- // Get the index number for the array... which must be long type...
- GenericValue IdxGV = getOperandValue(I.getOperand(), SF);
-
- int64_t Idx;
- unsigned BitWidth =
- cast<IntegerType>(I.getOperand()->getType())->getBitWidth();
- if (BitWidth == 32)
- Idx = (int64_t)(int32_t)IdxGV.IntVal.getZExtValue();
- else {
- assert(BitWidth == 64 && "Invalid index type for getelementptr");
- Idx = (int64_t)IdxGV.IntVal.getZExtValue();
- }
- Total += TD.getABITypeSize(ST->getElementType())*Idx;
- }
- }
-
- GenericValue Result;
- Result.PointerVal = ((char*)getOperandValue(Ptr, SF).PointerVal) + Total;
- DOUT << "GEP Index " << Total << " bytes.\n";
- return Result;
-}
-
-void Interpreter::visitGetElementPtrInst(GetElementPtrInst &I) {
- ExecutionContext &SF = ECStack.back();
- SetValue(&I, TheEE->executeGEPOperation(I.getPointerOperand(),
- gep_type_begin(I), gep_type_end(I), SF), SF);
-}
-
-void Interpreter::visitLoadInst(LoadInst &I) {
- ExecutionContext &SF = ECStack.back();
- GenericValue SRC = getOperandValue(I.getPointerOperand(), SF);
- GenericValue *Ptr = (GenericValue*)GVTOP(SRC);
- GenericValue Result;
- LoadValueFromMemory(Result, Ptr, I.getType());
- SetValue(&I, Result, SF);
-}
-
-void Interpreter::visitStoreInst(StoreInst &I) {
- ExecutionContext &SF = ECStack.back();
- GenericValue Val = getOperandValue(I.getOperand(0), SF);
- GenericValue SRC = getOperandValue(I.getPointerOperand(), SF);
- StoreValueToMemory(Val, (GenericValue *)GVTOP(SRC),
- I.getOperand(0)->getType());
-}
-
-//===----------------------------------------------------------------------===//
-// Miscellaneous Instruction Implementations
-//===----------------------------------------------------------------------===//
-
-void Interpreter::visitCallSite(CallSite CS) {
- ExecutionContext &SF = ECStack.back();
-
- // Check to see if this is an intrinsic function call...
- Function *F = CS.getCalledFunction();
- if (F && F->isDeclaration ())
- switch (F->getIntrinsicID()) {
- case Intrinsic::not_intrinsic:
- break;
- case Intrinsic::vastart: { // va_start
- GenericValue ArgIndex;
- ArgIndex.UIntPairVal.first = ECStack.size() - 1;
- ArgIndex.UIntPairVal.second = 0;
- SetValue(CS.getInstruction(), ArgIndex, SF);
- return;
- }
- case Intrinsic::vaend: // va_end is a noop for the interpreter
- return;
- case Intrinsic::vacopy: // va_copy: dest = src
- SetValue(CS.getInstruction(), getOperandValue(*CS.arg_begin(), SF), SF);
- return;
- default:
- // If it is an unknown intrinsic function, use the intrinsic lowering
- // class to transform it into hopefully tasty LLVM code.
- //
- BasicBlock::iterator me(CS.getInstruction());
- BasicBlock *Parent = CS.getInstruction()->getParent();
- bool atBegin(Parent->begin() == me);
- if (!atBegin)
- --me;
- IL->LowerIntrinsicCall(cast<CallInst>(CS.getInstruction()));
-
- // Restore the CurInst pointer to the first instruction newly inserted, if
- // any.
- if (atBegin) {
- SF.CurInst = Parent->begin();
- } else {
- SF.CurInst = me;
- ++SF.CurInst;
- }
- return;
- }
-
-
- SF.Caller = CS;
- std::vector<GenericValue> ArgVals;
- const unsigned NumArgs = SF.Caller.arg_size();
- ArgVals.reserve(NumArgs);
- uint16_t pNum = 1;
- for (CallSite::arg_iterator i = SF.Caller.arg_begin(),
- e = SF.Caller.arg_end(); i != e; ++i, ++pNum) {
- Value *V = *i;
- ArgVals.push_back(getOperandValue(V, SF));
- // Promote all integral types whose size is < sizeof(i32) into i32.
- // We do this by zero or sign extending the value as appropriate
- // according to the parameter attributes
- const Type *Ty = V->getType();
- if (Ty->isInteger() && (ArgVals.back().IntVal.getBitWidth() < 32)) {
- if (CS.paramHasAttr(pNum, ParamAttr::ZExt))
- ArgVals.back().IntVal = ArgVals.back().IntVal.zext(32);
- else if (CS.paramHasAttr(pNum, ParamAttr::SExt))
- ArgVals.back().IntVal = ArgVals.back().IntVal.sext(32);
- }
- }
-
- // To handle indirect calls, we must get the pointer value from the argument
- // and treat it as a function pointer.
- GenericValue SRC = getOperandValue(SF.Caller.getCalledValue(), SF);
- callFunction((Function*)GVTOP(SRC), ArgVals);
-}
-
-void Interpreter::visitShl(BinaryOperator &I) {
- ExecutionContext &SF = ECStack.back();
- GenericValue Src1 = getOperandValue(I.getOperand(0), SF);
- GenericValue Src2 = getOperandValue(I.getOperand(1), SF);
- GenericValue Dest;
- Dest.IntVal = Src1.IntVal.shl(Src2.IntVal.getZExtValue());
- SetValue(&I, Dest, SF);
-}
-
-void Interpreter::visitLShr(BinaryOperator &I) {
- ExecutionContext &SF = ECStack.back();
- GenericValue Src1 = getOperandValue(I.getOperand(0), SF);
- GenericValue Src2 = getOperandValue(I.getOperand(1), SF);
- GenericValue Dest;
- Dest.IntVal = Src1.IntVal.lshr(Src2.IntVal.getZExtValue());
- SetValue(&I, Dest, SF);
-}
-
-void Interpreter::visitAShr(BinaryOperator &I) {
- ExecutionContext &SF = ECStack.back();
- GenericValue Src1 = getOperandValue(I.getOperand(0), SF);
- GenericValue Src2 = getOperandValue(I.getOperand(1), SF);
- GenericValue Dest;
- Dest.IntVal = Src1.IntVal.ashr(Src2.IntVal.getZExtValue());
- SetValue(&I, Dest, SF);
-}
-
-GenericValue Interpreter::executeTruncInst(Value *SrcVal, const Type *DstTy,
- ExecutionContext &SF) {
- GenericValue Dest, Src = getOperandValue(SrcVal, SF);
- const IntegerType *DITy = cast<IntegerType>(DstTy);
- unsigned DBitWidth = DITy->getBitWidth();
- Dest.IntVal = Src.IntVal.trunc(DBitWidth);
- return Dest;
-}
-
-GenericValue Interpreter::executeSExtInst(Value *SrcVal, const Type *DstTy,
- ExecutionContext &SF) {
- GenericValue Dest, Src = getOperandValue(SrcVal, SF);
- const IntegerType *DITy = cast<IntegerType>(DstTy);
- unsigned DBitWidth = DITy->getBitWidth();
- Dest.IntVal = Src.IntVal.sext(DBitWidth);
- return Dest;
-}
-
-GenericValue Interpreter::executeZExtInst(Value *SrcVal, const Type *DstTy,
- ExecutionContext &SF) {
- GenericValue Dest, Src = getOperandValue(SrcVal, SF);
- const IntegerType *DITy = cast<IntegerType>(DstTy);
- unsigned DBitWidth = DITy->getBitWidth();
- Dest.IntVal = Src.IntVal.zext(DBitWidth);
- return Dest;
-}
-
-GenericValue Interpreter::executeFPTruncInst(Value *SrcVal, const Type *DstTy,
- ExecutionContext &SF) {
- GenericValue Dest, Src = getOperandValue(SrcVal, SF);
- assert(SrcVal->getType() == Type::DoubleTy && DstTy == Type::FloatTy &&
- "Invalid FPTrunc instruction");
- Dest.FloatVal = (float) Src.DoubleVal;
- return Dest;
-}
-
-GenericValue Interpreter::executeFPExtInst(Value *SrcVal, const Type *DstTy,
- ExecutionContext &SF) {
- GenericValue Dest, Src = getOperandValue(SrcVal, SF);
- assert(SrcVal->getType() == Type::FloatTy && DstTy == Type::DoubleTy &&
- "Invalid FPTrunc instruction");
- Dest.DoubleVal = (double) Src.FloatVal;
- return Dest;
-}
-
-GenericValue Interpreter::executeFPToUIInst(Value *SrcVal, const Type *DstTy,
- ExecutionContext &SF) {
- const Type *SrcTy = SrcVal->getType();
- uint32_t DBitWidth = cast<IntegerType>(DstTy)->getBitWidth();
- GenericValue Dest, Src = getOperandValue(SrcVal, SF);
- assert(SrcTy->isFloatingPoint() && "Invalid FPToUI instruction");
-
- if (SrcTy->getTypeID() == Type::FloatTyID)
- Dest.IntVal = APIntOps::RoundFloatToAPInt(Src.FloatVal, DBitWidth);
- else
- Dest.IntVal = APIntOps::RoundDoubleToAPInt(Src.DoubleVal, DBitWidth);
- return Dest;
-}
-
-GenericValue Interpreter::executeFPToSIInst(Value *SrcVal, const Type *DstTy,
- ExecutionContext &SF) {
- const Type *SrcTy = SrcVal->getType();
- uint32_t DBitWidth = cast<IntegerType>(DstTy)->getBitWidth();
- GenericValue Dest, Src = getOperandValue(SrcVal, SF);
- assert(SrcTy->isFloatingPoint() && "Invalid FPToSI instruction");
-
- if (SrcTy->getTypeID() == Type::FloatTyID)
- Dest.IntVal = APIntOps::RoundFloatToAPInt(Src.FloatVal, DBitWidth);
- else
- Dest.IntVal = APIntOps::RoundDoubleToAPInt(Src.DoubleVal, DBitWidth);
- return Dest;
-}
-
-GenericValue Interpreter::executeUIToFPInst(Value *SrcVal, const Type *DstTy,
- ExecutionContext &SF) {
- GenericValue Dest, Src = getOperandValue(SrcVal, SF);
- assert(DstTy->isFloatingPoint() && "Invalid UIToFP instruction");
-
- if (DstTy->getTypeID() == Type::FloatTyID)
- Dest.FloatVal = APIntOps::RoundAPIntToFloat(Src.IntVal);
- else
- Dest.DoubleVal = APIntOps::RoundAPIntToDouble(Src.IntVal);
- return Dest;
-}
-
-GenericValue Interpreter::executeSIToFPInst(Value *SrcVal, const Type *DstTy,
- ExecutionContext &SF) {
- GenericValue Dest, Src = getOperandValue(SrcVal, SF);
- assert(DstTy->isFloatingPoint() && "Invalid SIToFP instruction");
-
- if (DstTy->getTypeID() == Type::FloatTyID)
- Dest.FloatVal = APIntOps::RoundSignedAPIntToFloat(Src.IntVal);
- else
- Dest.DoubleVal = APIntOps::RoundSignedAPIntToDouble(Src.IntVal);
- return Dest;
-
-}
-
-GenericValue Interpreter::executePtrToIntInst(Value *SrcVal, const Type *DstTy,
- ExecutionContext &SF) {
- uint32_t DBitWidth = cast<IntegerType>(DstTy)->getBitWidth();
- GenericValue Dest, Src = getOperandValue(SrcVal, SF);
- assert(isa<PointerType>(SrcVal->getType()) && "Invalid PtrToInt instruction");
-
- Dest.IntVal = APInt(DBitWidth, (intptr_t) Src.PointerVal);
- return Dest;
-}
-
-GenericValue Interpreter::executeIntToPtrInst(Value *SrcVal, const Type *DstTy,
- ExecutionContext &SF) {
- GenericValue Dest, Src = getOperandValue(SrcVal, SF);
- assert(isa<PointerType>(DstTy) && "Invalid PtrToInt instruction");
-
- uint32_t PtrSize = TD.getPointerSizeInBits();
- if (PtrSize != Src.IntVal.getBitWidth())
- Src.IntVal = Src.IntVal.zextOrTrunc(PtrSize);
-
- Dest.PointerVal = PointerTy(intptr_t(Src.IntVal.getZExtValue()));
- return Dest;
-}
-
-GenericValue Interpreter::executeBitCastInst(Value *SrcVal, const Type *DstTy,
- ExecutionContext &SF) {
-
- const Type *SrcTy = SrcVal->getType();
- GenericValue Dest, Src = getOperandValue(SrcVal, SF);
- if (isa<PointerType>(DstTy)) {
- assert(isa<PointerType>(SrcTy) && "Invalid BitCast");
- Dest.PointerVal = Src.PointerVal;
- } else if (DstTy->isInteger()) {
- if (SrcTy == Type::FloatTy) {
- Dest.IntVal.zext(sizeof(Src.FloatVal) * 8);
- Dest.IntVal.floatToBits(Src.FloatVal);
- } else if (SrcTy == Type::DoubleTy) {
- Dest.IntVal.zext(sizeof(Src.DoubleVal) * 8);
- Dest.IntVal.doubleToBits(Src.DoubleVal);
- } else if (SrcTy->isInteger()) {
- Dest.IntVal = Src.IntVal;
- } else
- assert(0 && "Invalid BitCast");
- } else if (DstTy == Type::FloatTy) {
- if (SrcTy->isInteger())
- Dest.FloatVal = Src.IntVal.bitsToFloat();
- else
- Dest.FloatVal = Src.FloatVal;
- } else if (DstTy == Type::DoubleTy) {
- if (SrcTy->isInteger())
- Dest.DoubleVal = Src.IntVal.bitsToDouble();
- else
- Dest.DoubleVal = Src.DoubleVal;
- } else
- assert(0 && "Invalid Bitcast");
-
- return Dest;
-}
-
-void Interpreter::visitTruncInst(TruncInst &I) {
- ExecutionContext &SF = ECStack.back();
- SetValue(&I, executeTruncInst(I.getOperand(0), I.getType(), SF), SF);
-}
-
-void Interpreter::visitSExtInst(SExtInst &I) {
- ExecutionContext &SF = ECStack.back();
- SetValue(&I, executeSExtInst(I.getOperand(0), I.getType(), SF), SF);
-}
-
-void Interpreter::visitZExtInst(ZExtInst &I) {
- ExecutionContext &SF = ECStack.back();
- SetValue(&I, executeZExtInst(I.getOperand(0), I.getType(), SF), SF);
-}
-
-void Interpreter::visitFPTruncInst(FPTruncInst &I) {
- ExecutionContext &SF = ECStack.back();
- SetValue(&I, executeFPTruncInst(I.getOperand(0), I.getType(), SF), SF);
-}
-
-void Interpreter::visitFPExtInst(FPExtInst &I) {
- ExecutionContext &SF = ECStack.back();
- SetValue(&I, executeFPExtInst(I.getOperand(0), I.getType(), SF), SF);
-}
-
-void Interpreter::visitUIToFPInst(UIToFPInst &I) {
- ExecutionContext &SF = ECStack.back();
- SetValue(&I, executeUIToFPInst(I.getOperand(0), I.getType(), SF), SF);
-}
-
-void Interpreter::visitSIToFPInst(SIToFPInst &I) {
- ExecutionContext &SF = ECStack.back();
- SetValue(&I, executeSIToFPInst(I.getOperand(0), I.getType(), SF), SF);
-}
-
-void Interpreter::visitFPToUIInst(FPToUIInst &I) {
- ExecutionContext &SF = ECStack.back();
- SetValue(&I, executeFPToUIInst(I.getOperand(0), I.getType(), SF), SF);
-}
-
-void Interpreter::visitFPToSIInst(FPToSIInst &I) {
- ExecutionContext &SF = ECStack.back();
- SetValue(&I, executeFPToSIInst(I.getOperand(0), I.getType(), SF), SF);
-}
-
-void Interpreter::visitPtrToIntInst(PtrToIntInst &I) {
- ExecutionContext &SF = ECStack.back();
- SetValue(&I, executePtrToIntInst(I.getOperand(0), I.getType(), SF), SF);
-}
-
-void Interpreter::visitIntToPtrInst(IntToPtrInst &I) {
- ExecutionContext &SF = ECStack.back();
- SetValue(&I, executeIntToPtrInst(I.getOperand(0), I.getType(), SF), SF);
-}
-
-void Interpreter::visitBitCastInst(BitCastInst &I) {
- ExecutionContext &SF = ECStack.back();
- SetValue(&I, executeBitCastInst(I.getOperand(0), I.getType(), SF), SF);
-}
-
-#define IMPLEMENT_VAARG(TY) \
- case Type::TY##TyID: Dest.TY##Val = Src.TY##Val; break
-
-void Interpreter::visitVAArgInst(VAArgInst &I) {
- ExecutionContext &SF = ECStack.back();
-
- // Get the incoming valist parameter. LLI treats the valist as a
- // (ec-stack-depth var-arg-index) pair.
- GenericValue VAList = getOperandValue(I.getOperand(0), SF);
- GenericValue Dest;
- GenericValue Src = ECStack[VAList.UIntPairVal.first]
- .VarArgs[VAList.UIntPairVal.second];
- const Type *Ty = I.getType();
- switch (Ty->getTypeID()) {
- case Type::IntegerTyID: Dest.IntVal = Src.IntVal;
- IMPLEMENT_VAARG(Pointer);
- IMPLEMENT_VAARG(Float);
- IMPLEMENT_VAARG(Double);
- default:
- cerr << "Unhandled dest type for vaarg instruction: " << *Ty << "\n";
- abort();
- }
-
- // Set the Value of this Instruction.
- SetValue(&I, Dest, SF);
-
- // Move the pointer to the next vararg.
- ++VAList.UIntPairVal.second;
-}
-
-GenericValue Interpreter::getConstantExprValue (ConstantExpr *CE,
- ExecutionContext &SF) {
- switch (CE->getOpcode()) {
- case Instruction::Trunc:
- return executeTruncInst(CE->getOperand(0), CE->getType(), SF);
- case Instruction::ZExt:
- return executeZExtInst(CE->getOperand(0), CE->getType(), SF);
- case Instruction::SExt:
- return executeSExtInst(CE->getOperand(0), CE->getType(), SF);
- case Instruction::FPTrunc:
- return executeFPTruncInst(CE->getOperand(0), CE->getType(), SF);
- case Instruction::FPExt:
- return executeFPExtInst(CE->getOperand(0), CE->getType(), SF);
- case Instruction::UIToFP:
- return executeUIToFPInst(CE->getOperand(0), CE->getType(), SF);
- case Instruction::SIToFP:
- return executeSIToFPInst(CE->getOperand(0), CE->getType(), SF);
- case Instruction::FPToUI:
- return executeFPToUIInst(CE->getOperand(0), CE->getType(), SF);
- case Instruction::FPToSI:
- return executeFPToSIInst(CE->getOperand(0), CE->getType(), SF);
- case Instruction::PtrToInt:
- return executePtrToIntInst(CE->getOperand(0), CE->getType(), SF);
- case Instruction::IntToPtr:
- return executeIntToPtrInst(CE->getOperand(0), CE->getType(), SF);
- case Instruction::BitCast:
- return executeBitCastInst(CE->getOperand(0), CE->getType(), SF);
- case Instruction::GetElementPtr:
- return executeGEPOperation(CE->getOperand(0), gep_type_begin(CE),
- gep_type_end(CE), SF);
- case Instruction::FCmp:
- case Instruction::ICmp:
- return executeCmpInst(CE->getPredicate(),
- getOperandValue(CE->getOperand(0), SF),
- getOperandValue(CE->getOperand(1), SF),
- CE->getOperand(0)->getType());
- case Instruction::Select:
- return executeSelectInst(getOperandValue(CE->getOperand(0), SF),
- getOperandValue(CE->getOperand(1), SF),
- getOperandValue(CE->getOperand(2), SF));
- default :
- break;
- }
-
- // The cases below here require a GenericValue parameter for the result
- // so we initialize one, compute it and then return it.
- GenericValue Op0 = getOperandValue(CE->getOperand(0), SF);
- GenericValue Op1 = getOperandValue(CE->getOperand(1), SF);
- GenericValue Dest;
- const Type * Ty = CE->getOperand(0)->getType();
- switch (CE->getOpcode()) {
- case Instruction::Add: executeAddInst (Dest, Op0, Op1, Ty); break;
- case Instruction::Sub: executeSubInst (Dest, Op0, Op1, Ty); break;
- case Instruction::Mul: executeMulInst (Dest, Op0, Op1, Ty); break;
- case Instruction::FDiv: executeFDivInst(Dest, Op0, Op1, Ty); break;
- case Instruction::FRem: executeFRemInst(Dest, Op0, Op1, Ty); break;
- case Instruction::SDiv: Dest.IntVal = Op0.IntVal.sdiv(Op1.IntVal); break;
- case Instruction::UDiv: Dest.IntVal = Op0.IntVal.udiv(Op1.IntVal); break;
- case Instruction::URem: Dest.IntVal = Op0.IntVal.urem(Op1.IntVal); break;
- case Instruction::SRem: Dest.IntVal = Op0.IntVal.srem(Op1.IntVal); break;
- case Instruction::And: Dest.IntVal = Op0.IntVal.And(Op1.IntVal); break;
- case Instruction::Or: Dest.IntVal = Op0.IntVal.Or(Op1.IntVal); break;
- case Instruction::Xor: Dest.IntVal = Op0.IntVal.Xor(Op1.IntVal); break;
- case Instruction::Shl:
- Dest.IntVal = Op0.IntVal.shl(Op1.IntVal.getZExtValue());
- break;
- case Instruction::LShr:
- Dest.IntVal = Op0.IntVal.lshr(Op1.IntVal.getZExtValue());
- break;
- case Instruction::AShr:
- Dest.IntVal = Op0.IntVal.ashr(Op1.IntVal.getZExtValue());
- break;
- default:
- cerr << "Unhandled ConstantExpr: " << *CE << "\n";
- abort();
- return GenericValue();
- }
- return Dest;
-}
-
-GenericValue Interpreter::getOperandValue(Value *V, ExecutionContext &SF) {
- if (ConstantExpr *CE = dyn_cast<ConstantExpr>(V)) {
- return getConstantExprValue(CE, SF);
- } else if (Constant *CPV = dyn_cast<Constant>(V)) {
- return getConstantValue(CPV);
- } else if (GlobalValue *GV = dyn_cast<GlobalValue>(V)) {
- return PTOGV(getPointerToGlobal(GV));
- } else {
- return SF.Values[V];
- }
-}
-
-//===----------------------------------------------------------------------===//
-// Dispatch and Execution Code
-//===----------------------------------------------------------------------===//
-
-//===----------------------------------------------------------------------===//
-// callFunction - Execute the specified function...
-//
-void Interpreter::callFunction(Function *F,
- const std::vector<GenericValue> &ArgVals) {
- assert((ECStack.empty() || ECStack.back().Caller.getInstruction() == 0 ||
- ECStack.back().Caller.arg_size() == ArgVals.size()) &&
- "Incorrect number of arguments passed into function call!");
- // Make a new stack frame... and fill it in.
- ECStack.push_back(ExecutionContext());
- ExecutionContext &StackFrame = ECStack.back();
- StackFrame.CurFunction = F;
-
- // Special handling for external functions.
- if (F->isDeclaration()) {
- GenericValue Result = callExternalFunction (F, ArgVals);
- // Simulate a 'ret' instruction of the appropriate type.
- popStackAndReturnValueToCaller (F->getReturnType (), Result);
- return;
- }
-
- // Get pointers to first LLVM BB & Instruction in function.
- StackFrame.CurBB = F->begin();
- StackFrame.CurInst = StackFrame.CurBB->begin();
-
- // Run through the function arguments and initialize their values...
- assert((ArgVals.size() == F->arg_size() ||
- (ArgVals.size() > F->arg_size() && F->getFunctionType()->isVarArg()))&&
- "Invalid number of values passed to function invocation!");
-
- // Handle non-varargs arguments...
- unsigned i = 0;
- for (Function::arg_iterator AI = F->arg_begin(), E = F->arg_end();
- AI != E; ++AI, ++i)
- SetValue(AI, ArgVals[i], StackFrame);
-
- // Handle varargs arguments...
- StackFrame.VarArgs.assign(ArgVals.begin()+i, ArgVals.end());
-}
-
-
-void Interpreter::run() {
- while (!ECStack.empty()) {
- // Interpret a single instruction & increment the "PC".
- ExecutionContext &SF = ECStack.back(); // Current stack frame
- Instruction &I = *SF.CurInst++; // Increment before execute
-
- // Track the number of dynamic instructions executed.
- ++NumDynamicInsts;
-
- DOUT << "About to interpret: " << I;
- visit(I); // Dispatch to one of the visit* methods...
-#if 0
- // This is not safe, as visiting the instruction could lower it and free I.
-#ifndef NDEBUG
- if (!isa<CallInst>(I) && !isa<InvokeInst>(I) &&
- I.getType() != Type::VoidTy) {
- DOUT << " --> ";
- const GenericValue &Val = SF.Values[&I];
- switch (I.getType()->getTypeID()) {
- default: assert(0 && "Invalid GenericValue Type");
- case Type::VoidTyID: DOUT << "void"; break;
- case Type::FloatTyID: DOUT << "float " << Val.FloatVal; break;
- case Type::DoubleTyID: DOUT << "double " << Val.DoubleVal; break;
- case Type::PointerTyID: DOUT << "void* " << intptr_t(Val.PointerVal);
- break;
- case Type::IntegerTyID:
- DOUT << "i" << Val.IntVal.getBitWidth() << " "
- << Val.IntVal.toStringUnsigned(10)
- << " (0x" << Val.IntVal.toStringUnsigned(16) << ")\n";
- break;
- }
- }
-#endif
-#endif
- }
-}
diff --git a/release_23/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp b/release_23/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp
deleted file mode 100644
index b85f270f9e0a..000000000000
--- a/release_23/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp
+++ /dev/null
@@ -1,825 +0,0 @@
-//===-- ExternalFunctions.cpp - Implement External Functions --------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains both code to deal with invoking "external" functions, but
-// also contains code that implements "exported" external functions.
-//
-// External functions in the interpreter are implemented by
-// using the system's dynamic loader to look up the address of the function
-// we want to invoke. If a function is found, then one of the
-// many lle_* wrapper functions in this file will translate its arguments from
-// GenericValues to the types the function is actually expecting, before the
-// function is called.
-//
-//===----------------------------------------------------------------------===//
-
-#include "Interpreter.h"
-#include "llvm/DerivedTypes.h"
-#include "llvm/Module.h"
-#include "llvm/Support/Streams.h"
-#include "llvm/System/DynamicLibrary.h"
-#include "llvm/Target/TargetData.h"
-#include "llvm/Support/ManagedStatic.h"
-#include <csignal>
-#include <map>
-#include <cmath>
-#include <cstring>
-
-#ifdef __linux__
-#include <cxxabi.h>
-#endif
-
-using std::vector;
-
-using namespace llvm;
-
-typedef GenericValue (*ExFunc)(FunctionType *, const vector<GenericValue> &);
-static ManagedStatic<std::map<const Function *, ExFunc> > Functions;
-static std::map<std::string, ExFunc> FuncNames;
-
-static Interpreter *TheInterpreter;
-
-static char getTypeID(const Type *Ty) {
- switch (Ty->getTypeID()) {
- case Type::VoidTyID: return 'V';
- case Type::IntegerTyID:
- switch (cast<IntegerType>(Ty)->getBitWidth()) {
- case 1: return 'o';
- case 8: return 'B';
- case 16: return 'S';
- case 32: return 'I';
- case 64: return 'L';
- default: return 'N';
- }
- case Type::FloatTyID: return 'F';
- case Type::DoubleTyID: return 'D';
- case Type::PointerTyID: return 'P';
- case Type::FunctionTyID:return 'M';
- case Type::StructTyID: return 'T';
- case Type::ArrayTyID: return 'A';
- case Type::OpaqueTyID: return 'O';
- default: return 'U';
- }
-}
-
-// Try to find address of external function given a Function object.
-// Please note, that interpreter doesn't know how to assemble a
-// real call in general case (this is JIT job), that's why it assumes,
-// that all external functions has the same (and pretty "general") signature.
-// The typical example of such functions are "lle_X_" ones.
-static ExFunc lookupFunction(const Function *F) {
- // Function not found, look it up... start by figuring out what the
- // composite function name should be.
- std::string ExtName = "lle_";
- const FunctionType *FT = F->getFunctionType();
- for (unsigned i = 0, e = FT->getNumContainedTypes(); i != e; ++i)
- ExtName += getTypeID(FT->getContainedType(i));
- ExtName += "_" + F->getName();
-
- ExFunc FnPtr = FuncNames[ExtName];
- if (FnPtr == 0)
- FnPtr = FuncNames["lle_X_"+F->getName()];
- if (FnPtr == 0) // Try calling a generic function... if it exists...
- FnPtr = (ExFunc)(intptr_t)sys::DynamicLibrary::SearchForAddressOfSymbol(
- ("lle_X_"+F->getName()).c_str());
- if (FnPtr == 0)
- FnPtr = (ExFunc)(intptr_t)
- sys::DynamicLibrary::SearchForAddressOfSymbol(F->getName());
- if (FnPtr != 0)
- Functions->insert(std::make_pair(F, FnPtr)); // Cache for later
- return FnPtr;
-}
-
-GenericValue Interpreter::callExternalFunction(Function *F,
- const std::vector<GenericValue> &ArgVals) {
- TheInterpreter = this;
-
- // Do a lookup to see if the function is in our cache... this should just be a
- // deferred annotation!
- std::map<const Function *, ExFunc>::iterator FI = Functions->find(F);
- ExFunc Fn = (FI == Functions->end()) ? lookupFunction(F) : FI->second;
- if (Fn == 0) {
- cerr << "Tried to execute an unknown external function: "
- << F->getType()->getDescription() << " " << F->getName() << "\n";
- if (F->getName() == "__main")
- return GenericValue();
- abort();
- }
-
- // TODO: FIXME when types are not const!
- GenericValue Result = Fn(const_cast<FunctionType*>(F->getFunctionType()),
- ArgVals);
- return Result;
-}
-
-
-//===----------------------------------------------------------------------===//
-// Functions "exported" to the running application...
-//
-extern "C" { // Don't add C++ manglings to llvm mangling :)
-
-// void putchar(ubyte)
-GenericValue lle_X_putchar(FunctionType *FT, const vector<GenericValue> &Args){
- cout << ((char)Args[0].IntVal.getZExtValue()) << std::flush;
- return Args[0];
-}
-
-// void _IO_putc(int c, FILE* fp)
-GenericValue lle_X__IO_putc(FunctionType *FT, const vector<GenericValue> &Args){
-#ifdef __linux__
- _IO_putc((char)Args[0].IntVal.getZExtValue(), (FILE*) Args[1].PointerVal);
-#else
- assert(0 && "Can't call _IO_putc on this platform");
-#endif
- return Args[0];
-}
-
-// void atexit(Function*)
-GenericValue lle_X_atexit(FunctionType *FT, const vector<GenericValue> &Args) {
- assert(Args.size() == 1);
- TheInterpreter->addAtExitHandler((Function*)GVTOP(Args[0]));
- GenericValue GV;
- GV.IntVal = 0;
- return GV;
-}
-
-// void exit(int)
-GenericValue lle_X_exit(FunctionType *FT, const vector<GenericValue> &Args) {
- TheInterpreter->exitCalled(Args[0]);
- return GenericValue();
-}
-
-// void abort(void)
-GenericValue lle_X_abort(FunctionType *FT, const vector<GenericValue> &Args) {
- raise (SIGABRT);
- return GenericValue();
-}
-
-// void *malloc(uint)
-GenericValue lle_X_malloc(FunctionType *FT, const vector<GenericValue> &Args) {
- assert(Args.size() == 1 && "Malloc expects one argument!");
- assert(isa<PointerType>(FT->getReturnType()) && "malloc must return pointer");
- return PTOGV(malloc(Args[0].IntVal.getZExtValue()));
-}
-
-// void *calloc(uint, uint)
-GenericValue lle_X_calloc(FunctionType *FT, const vector<GenericValue> &Args) {
- assert(Args.size() == 2 && "calloc expects two arguments!");
- assert(isa<PointerType>(FT->getReturnType()) && "calloc must return pointer");
- return PTOGV(calloc(Args[0].IntVal.getZExtValue(),
- Args[1].IntVal.getZExtValue()));
-}
-
-// void *calloc(uint, uint)
-GenericValue lle_X_realloc(FunctionType *FT, const vector<GenericValue> &Args) {
- assert(Args.size() == 2 && "calloc expects two arguments!");
- assert(isa<PointerType>(FT->getReturnType()) &&"realloc must return pointer");
- return PTOGV(realloc(GVTOP(Args[0]), Args[1].IntVal.getZExtValue()));
-}
-
-// void free(void *)
-GenericValue lle_X_free(FunctionType *FT, const vector<GenericValue> &Args) {
- assert(Args.size() == 1);
- free(GVTOP(Args[0]));
- return GenericValue();
-}
-
-// int atoi(char *)
-GenericValue lle_X_atoi(FunctionType *FT, const vector<GenericValue> &Args) {
- assert(Args.size() == 1);
- GenericValue GV;
- GV.IntVal = APInt(32, atoi((char*)GVTOP(Args[0])));
- return GV;
-}
-
-// double pow(double, double)
-GenericValue lle_X_pow(FunctionType *FT, const vector<GenericValue> &Args) {
- assert(Args.size() == 2);
- GenericValue GV;
- GV.DoubleVal = pow(Args[0].DoubleVal, Args[1].DoubleVal);
- return GV;
-}
-
-// double sin(double)
-GenericValue lle_X_sin(FunctionType *FT, const vector<GenericValue> &Args) {
- assert(Args.size() == 1);
- GenericValue GV;
- GV.DoubleVal = sin(Args[0].DoubleVal);
- return GV;
-}
-
-// double cos(double)
-GenericValue lle_X_cos(FunctionType *FT, const vector<GenericValue> &Args) {
- assert(Args.size() == 1);
- GenericValue GV;
- GV.DoubleVal = cos(Args[0].DoubleVal);
- return GV;
-}
-
-// double exp(double)
-GenericValue lle_X_exp(FunctionType *FT, const vector<GenericValue> &Args) {
- assert(Args.size() == 1);
- GenericValue GV;
- GV.DoubleVal = exp(Args[0].DoubleVal);
- return GV;
-}
-
-// double sqrt(double)
-GenericValue lle_X_sqrt(FunctionType *FT, const vector<GenericValue> &Args) {
- assert(Args.size() == 1);
- GenericValue GV;
- GV.DoubleVal = sqrt(Args[0].DoubleVal);
- return GV;
-}
-
-// double log(double)
-GenericValue lle_X_log(FunctionType *FT, const vector<GenericValue> &Args) {
- assert(Args.size() == 1);
- GenericValue GV;
- GV.DoubleVal = log(Args[0].DoubleVal);
- return GV;
-}
-
-// double floor(double)
-GenericValue lle_X_floor(FunctionType *FT, const vector<GenericValue> &Args) {
- assert(Args.size() == 1);
- GenericValue GV;
- GV.DoubleVal = floor(Args[0].DoubleVal);
- return GV;
-}
-
-#ifdef HAVE_RAND48
-
-// double drand48()
-GenericValue lle_X_drand48(FunctionType *FT, const vector<GenericValue> &Args) {
- assert(Args.empty());
- GenericValue GV;
- GV.DoubleVal = drand48();
- return GV;
-}
-
-// long lrand48()
-GenericValue lle_X_lrand48(FunctionType *FT, const vector<GenericValue> &Args) {
- assert(Args.empty());
- GenericValue GV;
- GV.IntVal = APInt(32, lrand48());
- return GV;
-}
-
-// void srand48(long)
-GenericValue lle_X_srand48(FunctionType *FT, const vector<GenericValue> &Args) {
- assert(Args.size() == 1);
- srand48(Args[0].IntVal.getZExtValue());
- return GenericValue();
-}
-
-#endif
-
-// int rand()
-GenericValue lle_X_rand(FunctionType *FT, const vector<GenericValue> &Args) {
- assert(Args.empty());
- GenericValue GV;
- GV.IntVal = APInt(32, rand());
- return GV;
-}
-
-// void srand(uint)
-GenericValue lle_X_srand(FunctionType *FT, const vector<GenericValue> &Args) {
- assert(Args.size() == 1);
- srand(Args[0].IntVal.getZExtValue());
- return GenericValue();
-}
-
-// int puts(const char*)
-GenericValue lle_X_puts(FunctionType *FT, const vector<GenericValue> &Args) {
- assert(Args.size() == 1);
- GenericValue GV;
- GV.IntVal = APInt(32, puts((char*)GVTOP(Args[0])));
- return GV;
-}
-
-// int sprintf(sbyte *, sbyte *, ...) - a very rough implementation to make
-// output useful.
-GenericValue lle_X_sprintf(FunctionType *FT, const vector<GenericValue> &Args) {
- char *OutputBuffer = (char *)GVTOP(Args[0]);
- const char *FmtStr = (const char *)GVTOP(Args[1]);
- unsigned ArgNo = 2;
-
- // printf should return # chars printed. This is completely incorrect, but
- // close enough for now.
- GenericValue GV;
- GV.IntVal = APInt(32, strlen(FmtStr));
- while (1) {
- switch (*FmtStr) {
- case 0: return GV; // Null terminator...
- default: // Normal nonspecial character
- sprintf(OutputBuffer++, "%c", *FmtStr++);
- break;
- case '\\': { // Handle escape codes
- sprintf(OutputBuffer, "%c%c", *FmtStr, *(FmtStr+1));
- FmtStr += 2; OutputBuffer += 2;
- break;
- }
- case '%': { // Handle format specifiers
- char FmtBuf[100] = "", Buffer[1000] = "";
- char *FB = FmtBuf;
- *FB++ = *FmtStr++;
- char Last = *FB++ = *FmtStr++;
- unsigned HowLong = 0;
- while (Last != 'c' && Last != 'd' && Last != 'i' && Last != 'u' &&
- Last != 'o' && Last != 'x' && Last != 'X' && Last != 'e' &&
- Last != 'E' && Last != 'g' && Last != 'G' && Last != 'f' &&
- Last != 'p' && Last != 's' && Last != '%') {
- if (Last == 'l' || Last == 'L') HowLong++; // Keep track of l's
- Last = *FB++ = *FmtStr++;
- }
- *FB = 0;
-
- switch (Last) {
- case '%':
- sprintf(Buffer, FmtBuf); break;
- case 'c':
- sprintf(Buffer, FmtBuf, uint32_t(Args[ArgNo++].IntVal.getZExtValue()));
- break;
- case 'd': case 'i':
- case 'u': case 'o':
- case 'x': case 'X':
- if (HowLong >= 1) {
- if (HowLong == 1 &&
- TheInterpreter->getTargetData()->getPointerSizeInBits() == 64 &&
- sizeof(long) < sizeof(int64_t)) {
- // Make sure we use %lld with a 64 bit argument because we might be
- // compiling LLI on a 32 bit compiler.
- unsigned Size = strlen(FmtBuf);
- FmtBuf[Size] = FmtBuf[Size-1];
- FmtBuf[Size+1] = 0;
- FmtBuf[Size-1] = 'l';
- }
- sprintf(Buffer, FmtBuf, Args[ArgNo++].IntVal.getZExtValue());
- } else
- sprintf(Buffer, FmtBuf,uint32_t(Args[ArgNo++].IntVal.getZExtValue()));
- break;
- case 'e': case 'E': case 'g': case 'G': case 'f':
- sprintf(Buffer, FmtBuf, Args[ArgNo++].DoubleVal); break;
- case 'p':
- sprintf(Buffer, FmtBuf, (void*)GVTOP(Args[ArgNo++])); break;
- case 's':
- sprintf(Buffer, FmtBuf, (char*)GVTOP(Args[ArgNo++])); break;
- default: cerr << "<unknown printf code '" << *FmtStr << "'!>";
- ArgNo++; break;
- }
- strcpy(OutputBuffer, Buffer);
- OutputBuffer += strlen(Buffer);
- }
- break;
- }
- }
- return GV;
-}
-
-// int printf(sbyte *, ...) - a very rough implementation to make output useful.
-GenericValue lle_X_printf(FunctionType *FT, const vector<GenericValue> &Args) {
- char Buffer[10000];
- vector<GenericValue> NewArgs;
- NewArgs.push_back(PTOGV((void*)&Buffer[0]));
- NewArgs.insert(NewArgs.end(), Args.begin(), Args.end());
- GenericValue GV = lle_X_sprintf(FT, NewArgs);
- cout << Buffer;
- return GV;
-}
-
-static void ByteswapSCANFResults(const char *Fmt, void *Arg0, void *Arg1,
- void *Arg2, void *Arg3, void *Arg4, void *Arg5,
- void *Arg6, void *Arg7, void *Arg8) {
- void *Args[] = { Arg0, Arg1, Arg2, Arg3, Arg4, Arg5, Arg6, Arg7, Arg8, 0 };
-
- // Loop over the format string, munging read values as appropriate (performs
- // byteswaps as necessary).
- unsigned ArgNo = 0;
- while (*Fmt) {
- if (*Fmt++ == '%') {
- // Read any flag characters that may be present...
- bool Suppress = false;
- bool Half = false;
- bool Long = false;
- bool LongLong = false; // long long or long double
-
- while (1) {
- switch (*Fmt++) {
- case '*': Suppress = true; break;
- case 'a': /*Allocate = true;*/ break; // We don't need to track this
- case 'h': Half = true; break;
- case 'l': Long = true; break;
- case 'q':
- case 'L': LongLong = true; break;
- default:
- if (Fmt[-1] > '9' || Fmt[-1] < '0') // Ignore field width specs
- goto Out;
- }
- }
- Out:
-
- // Read the conversion character
- if (!Suppress && Fmt[-1] != '%') { // Nothing to do?
- unsigned Size = 0;
- const Type *Ty = 0;
-
- switch (Fmt[-1]) {
- case 'i': case 'o': case 'u': case 'x': case 'X': case 'n': case 'p':
- case 'd':
- if (Long || LongLong) {
- Size = 8; Ty = Type::Int64Ty;
- } else if (Half) {
- Size = 4; Ty = Type::Int16Ty;
- } else {
- Size = 4; Ty = Type::Int32Ty;
- }
- break;
-
- case 'e': case 'g': case 'E':
- case 'f':
- if (Long || LongLong) {
- Size = 8; Ty = Type::DoubleTy;
- } else {
- Size = 4; Ty = Type::FloatTy;
- }
- break;
-
- case 's': case 'c': case '[': // No byteswap needed
- Size = 1;
- Ty = Type::Int8Ty;
- break;
-
- default: break;
- }
-
- if (Size) {
- GenericValue GV;
- void *Arg = Args[ArgNo++];
- memcpy(&GV, Arg, Size);
- TheInterpreter->StoreValueToMemory(GV, (GenericValue*)Arg, Ty);
- }
- }
- }
- }
-}
-
-// int sscanf(const char *format, ...);
-GenericValue lle_X_sscanf(FunctionType *FT, const vector<GenericValue> &args) {
- assert(args.size() < 10 && "Only handle up to 10 args to sscanf right now!");
-
- char *Args[10];
- for (unsigned i = 0; i < args.size(); ++i)
- Args[i] = (char*)GVTOP(args[i]);
-
- GenericValue GV;
- GV.IntVal = APInt(32, sscanf(Args[0], Args[1], Args[2], Args[3], Args[4],
- Args[5], Args[6], Args[7], Args[8], Args[9]));
- ByteswapSCANFResults(Args[1], Args[2], Args[3], Args[4],
- Args[5], Args[6], Args[7], Args[8], Args[9], 0);
- return GV;
-}
-
-// int scanf(const char *format, ...);
-GenericValue lle_X_scanf(FunctionType *FT, const vector<GenericValue> &args) {
- assert(args.size() < 10 && "Only handle up to 10 args to scanf right now!");
-
- char *Args[10];
- for (unsigned i = 0; i < args.size(); ++i)
- Args[i] = (char*)GVTOP(args[i]);
-
- GenericValue GV;
- GV.IntVal = APInt(32, scanf( Args[0], Args[1], Args[2], Args[3], Args[4],
- Args[5], Args[6], Args[7], Args[8], Args[9]));
- ByteswapSCANFResults(Args[0], Args[1], Args[2], Args[3], Args[4],
- Args[5], Args[6], Args[7], Args[8], Args[9]);
- return GV;
-}
-
-
-// int clock(void) - Profiling implementation
-GenericValue lle_i_clock(FunctionType *FT, const vector<GenericValue> &Args) {
- extern unsigned int clock(void);
- GenericValue GV;
- GV.IntVal = APInt(32, clock());
- return GV;
-}
-
-
-//===----------------------------------------------------------------------===//
-// String Functions...
-//===----------------------------------------------------------------------===//
-
-// int strcmp(const char *S1, const char *S2);
-GenericValue lle_X_strcmp(FunctionType *FT, const vector<GenericValue> &Args) {
- assert(Args.size() == 2);
- GenericValue Ret;
- Ret.IntVal = APInt(32, strcmp((char*)GVTOP(Args[0]), (char*)GVTOP(Args[1])));
- return Ret;
-}
-
-// char *strcat(char *Dest, const char *src);
-GenericValue lle_X_strcat(FunctionType *FT, const vector<GenericValue> &Args) {
- assert(Args.size() == 2);
- assert(isa<PointerType>(FT->getReturnType()) &&"strcat must return pointer");
- return PTOGV(strcat((char*)GVTOP(Args[0]), (char*)GVTOP(Args[1])));
-}
-
-// char *strcpy(char *Dest, const char *src);
-GenericValue lle_X_strcpy(FunctionType *FT, const vector<GenericValue> &Args) {
- assert(Args.size() == 2);
- assert(isa<PointerType>(FT->getReturnType()) &&"strcpy must return pointer");
- return PTOGV(strcpy((char*)GVTOP(Args[0]), (char*)GVTOP(Args[1])));
-}
-
-static GenericValue size_t_to_GV (size_t n) {
- GenericValue Ret;
- if (sizeof (size_t) == sizeof (uint64_t)) {
- Ret.IntVal = APInt(64, n);
- } else {
- assert (sizeof (size_t) == sizeof (unsigned int));
- Ret.IntVal = APInt(32, n);
- }
- return Ret;
-}
-
-static size_t GV_to_size_t (GenericValue GV) {
- size_t count;
- if (sizeof (size_t) == sizeof (uint64_t)) {
- count = (size_t)GV.IntVal.getZExtValue();
- } else {
- assert (sizeof (size_t) == sizeof (unsigned int));
- count = (size_t)GV.IntVal.getZExtValue();
- }
- return count;
-}
-
-// size_t strlen(const char *src);
-GenericValue lle_X_strlen(FunctionType *FT, const vector<GenericValue> &Args) {
- assert(Args.size() == 1);
- size_t strlenResult = strlen ((char *) GVTOP (Args[0]));
- return size_t_to_GV (strlenResult);
-}
-
-// char *strdup(const char *src);
-GenericValue lle_X_strdup(FunctionType *FT, const vector<GenericValue> &Args) {
- assert(Args.size() == 1);
- assert(isa<PointerType>(FT->getReturnType()) && "strdup must return pointer");
- return PTOGV(strdup((char*)GVTOP(Args[0])));
-}
-
-// char *__strdup(const char *src);
-GenericValue lle_X___strdup(FunctionType *FT, const vector<GenericValue> &Args) {
- assert(Args.size() == 1);
- assert(isa<PointerType>(FT->getReturnType()) &&"_strdup must return pointer");
- return PTOGV(strdup((char*)GVTOP(Args[0])));
-}
-
-// void *memset(void *S, int C, size_t N)
-GenericValue lle_X_memset(FunctionType *FT, const vector<GenericValue> &Args) {
- assert(Args.size() == 3);
- size_t count = GV_to_size_t (Args[2]);
- assert(isa<PointerType>(FT->getReturnType()) && "memset must return pointer");
- return PTOGV(memset(GVTOP(Args[0]), uint32_t(Args[1].IntVal.getZExtValue()),
- count));
-}
-
-// void *memcpy(void *Dest, void *src, size_t Size);
-GenericValue lle_X_memcpy(FunctionType *FT, const vector<GenericValue> &Args) {
- assert(Args.size() == 3);
- assert(isa<PointerType>(FT->getReturnType()) && "memcpy must return pointer");
- size_t count = GV_to_size_t (Args[2]);
- return PTOGV(memcpy((char*)GVTOP(Args[0]), (char*)GVTOP(Args[1]), count));
-}
-
-// void *memcpy(void *Dest, void *src, size_t Size);
-GenericValue lle_X_memmove(FunctionType *FT, const vector<GenericValue> &Args) {
- assert(Args.size() == 3);
- assert(isa<PointerType>(FT->getReturnType()) && "memmove must return pointer");
- size_t count = GV_to_size_t (Args[2]);
- return PTOGV(memmove((char*)GVTOP(Args[0]), (char*)GVTOP(Args[1]), count));
-}
-
-//===----------------------------------------------------------------------===//
-// IO Functions...
-//===----------------------------------------------------------------------===//
-
-// getFILE - Turn a pointer in the host address space into a legit pointer in
-// the interpreter address space. This is an identity transformation.
-#define getFILE(ptr) ((FILE*)ptr)
-
-// FILE *fopen(const char *filename, const char *mode);
-GenericValue lle_X_fopen(FunctionType *FT, const vector<GenericValue> &Args) {
- assert(Args.size() == 2);
- assert(isa<PointerType>(FT->getReturnType()) && "fopen must return pointer");
- return PTOGV(fopen((const char *)GVTOP(Args[0]),
- (const char *)GVTOP(Args[1])));
-}
-
-// int fclose(FILE *F);
-GenericValue lle_X_fclose(FunctionType *FT, const vector<GenericValue> &Args) {
- assert(Args.size() == 1);
- GenericValue GV;
- GV.IntVal = APInt(32, fclose(getFILE(GVTOP(Args[0]))));
- return GV;
-}
-
-// int feof(FILE *stream);
-GenericValue lle_X_feof(FunctionType *FT, const vector<GenericValue> &Args) {
- assert(Args.size() == 1);
- GenericValue GV;
-
- GV.IntVal = APInt(32, feof(getFILE(GVTOP(Args[0]))));
- return GV;
-}
-
-// size_t fread(void *ptr, size_t size, size_t nitems, FILE *stream);
-GenericValue lle_X_fread(FunctionType *FT, const vector<GenericValue> &Args) {
- assert(Args.size() == 4);
- size_t result;
-
- result = fread((void*)GVTOP(Args[0]), GV_to_size_t (Args[1]),
- GV_to_size_t (Args[2]), getFILE(GVTOP(Args[3])));
- return size_t_to_GV (result);
-}
-
-// size_t fwrite(const void *ptr, size_t size, size_t nitems, FILE *stream);
-GenericValue lle_X_fwrite(FunctionType *FT, const vector<GenericValue> &Args) {
- assert(Args.size() == 4);
- size_t result;
-
- result = fwrite((void*)GVTOP(Args[0]), GV_to_size_t (Args[1]),
- GV_to_size_t (Args[2]), getFILE(GVTOP(Args[3])));
- return size_t_to_GV (result);
-}
-
-// char *fgets(char *s, int n, FILE *stream);
-GenericValue lle_X_fgets(FunctionType *FT, const vector<GenericValue> &Args) {
- assert(Args.size() == 3);
- return PTOGV(fgets((char*)GVTOP(Args[0]), Args[1].IntVal.getZExtValue(),
- getFILE(GVTOP(Args[2]))));
-}
-
-// FILE *freopen(const char *path, const char *mode, FILE *stream);
-GenericValue lle_X_freopen(FunctionType *FT, const vector<GenericValue> &Args) {
- assert(Args.size() == 3);
- assert(isa<PointerType>(FT->getReturnType()) &&"freopen must return pointer");
- return PTOGV(freopen((char*)GVTOP(Args[0]), (char*)GVTOP(Args[1]),
- getFILE(GVTOP(Args[2]))));
-}
-
-// int fflush(FILE *stream);
-GenericValue lle_X_fflush(FunctionType *FT, const vector<GenericValue> &Args) {
- assert(Args.size() == 1);
- GenericValue GV;
- GV.IntVal = APInt(32, fflush(getFILE(GVTOP(Args[0]))));
- return GV;
-}
-
-// int getc(FILE *stream);
-GenericValue lle_X_getc(FunctionType *FT, const vector<GenericValue> &Args) {
- assert(Args.size() == 1);
- GenericValue GV;
- GV.IntVal = APInt(32, getc(getFILE(GVTOP(Args[0]))));
- return GV;
-}
-
-// int _IO_getc(FILE *stream);
-GenericValue lle_X__IO_getc(FunctionType *F, const vector<GenericValue> &Args) {
- return lle_X_getc(F, Args);
-}
-
-// int fputc(int C, FILE *stream);
-GenericValue lle_X_fputc(FunctionType *FT, const vector<GenericValue> &Args) {
- assert(Args.size() == 2);
- GenericValue GV;
- GV.IntVal = APInt(32, fputc(Args[0].IntVal.getZExtValue(),
- getFILE(GVTOP(Args[1]))));
- return GV;
-}
-
-// int ungetc(int C, FILE *stream);
-GenericValue lle_X_ungetc(FunctionType *FT, const vector<GenericValue> &Args) {
- assert(Args.size() == 2);
- GenericValue GV;
- GV.IntVal = APInt(32, ungetc(Args[0].IntVal.getZExtValue(),
- getFILE(GVTOP(Args[1]))));
- return GV;
-}
-
-// int ferror (FILE *stream);
-GenericValue lle_X_ferror(FunctionType *FT, const vector<GenericValue> &Args) {
- assert(Args.size() == 1);
- GenericValue GV;
- GV.IntVal = APInt(32, ferror (getFILE(GVTOP(Args[0]))));
- return GV;
-}
-
-// int fprintf(FILE *,sbyte *, ...) - a very rough implementation to make output
-// useful.
-GenericValue lle_X_fprintf(FunctionType *FT, const vector<GenericValue> &Args) {
- assert(Args.size() >= 2);
- char Buffer[10000];
- vector<GenericValue> NewArgs;
- NewArgs.push_back(PTOGV(Buffer));
- NewArgs.insert(NewArgs.end(), Args.begin()+1, Args.end());
- GenericValue GV = lle_X_sprintf(FT, NewArgs);
-
- fputs(Buffer, getFILE(GVTOP(Args[0])));
- return GV;
-}
-
-// int __cxa_guard_acquire (__guard *g);
-GenericValue lle_X___cxa_guard_acquire(FunctionType *FT,
- const vector<GenericValue> &Args) {
- assert(Args.size() == 1);
- GenericValue GV;
-#ifdef __linux__
- GV.IntVal = APInt(32, __cxxabiv1::__cxa_guard_acquire (
- (__cxxabiv1::__guard*)GVTOP(Args[0])));
-#else
- assert(0 && "Can't call __cxa_guard_acquire on this platform");
-#endif
- return GV;
-}
-
-// void __cxa_guard_release (__guard *g);
-GenericValue lle_X___cxa_guard_release(FunctionType *FT,
- const vector<GenericValue> &Args) {
- assert(Args.size() == 1);
-#ifdef __linux__
- __cxxabiv1::__cxa_guard_release ((__cxxabiv1::__guard*)GVTOP(Args[0]));
-#else
- assert(0 && "Can't call __cxa_guard_release on this platform");
-#endif
- return GenericValue();
-}
-
-} // End extern "C"
-
-
-void Interpreter::initializeExternalFunctions() {
- FuncNames["lle_X_putchar"] = lle_X_putchar;
- FuncNames["lle_X__IO_putc"] = lle_X__IO_putc;
- FuncNames["lle_X_exit"] = lle_X_exit;
- FuncNames["lle_X_abort"] = lle_X_abort;
- FuncNames["lle_X_malloc"] = lle_X_malloc;
- FuncNames["lle_X_calloc"] = lle_X_calloc;
- FuncNames["lle_X_realloc"] = lle_X_realloc;
- FuncNames["lle_X_free"] = lle_X_free;
- FuncNames["lle_X_atoi"] = lle_X_atoi;
- FuncNames["lle_X_pow"] = lle_X_pow;
- FuncNames["lle_X_sin"] = lle_X_sin;
- FuncNames["lle_X_cos"] = lle_X_cos;
- FuncNames["lle_X_exp"] = lle_X_exp;
- FuncNames["lle_X_log"] = lle_X_log;
- FuncNames["lle_X_floor"] = lle_X_floor;
- FuncNames["lle_X_srand"] = lle_X_srand;
- FuncNames["lle_X_rand"] = lle_X_rand;
-#ifdef HAVE_RAND48
- FuncNames["lle_X_drand48"] = lle_X_drand48;
- FuncNames["lle_X_srand48"] = lle_X_srand48;
- FuncNames["lle_X_lrand48"] = lle_X_lrand48;
-#endif
- FuncNames["lle_X_sqrt"] = lle_X_sqrt;
- FuncNames["lle_X_puts"] = lle_X_puts;
- FuncNames["lle_X_printf"] = lle_X_printf;
- FuncNames["lle_X_sprintf"] = lle_X_sprintf;
- FuncNames["lle_X_sscanf"] = lle_X_sscanf;
- FuncNames["lle_X_scanf"] = lle_X_scanf;
- FuncNames["lle_i_clock"] = lle_i_clock;
-
- FuncNames["lle_X_strcmp"] = lle_X_strcmp;
- FuncNames["lle_X_strcat"] = lle_X_strcat;
- FuncNames["lle_X_strcpy"] = lle_X_strcpy;
- FuncNames["lle_X_strlen"] = lle_X_strlen;
- FuncNames["lle_X___strdup"] = lle_X___strdup;
- FuncNames["lle_X_memset"] = lle_X_memset;
- FuncNames["lle_X_memcpy"] = lle_X_memcpy;
- FuncNames["lle_X_memmove"] = lle_X_memmove;
-
- FuncNames["lle_X_fopen"] = lle_X_fopen;
- FuncNames["lle_X_fclose"] = lle_X_fclose;
- FuncNames["lle_X_feof"] = lle_X_feof;
- FuncNames["lle_X_fread"] = lle_X_fread;
- FuncNames["lle_X_fwrite"] = lle_X_fwrite;
- FuncNames["lle_X_fgets"] = lle_X_fgets;
- FuncNames["lle_X_fflush"] = lle_X_fflush;
- FuncNames["lle_X_fgetc"] = lle_X_getc;
- FuncNames["lle_X_getc"] = lle_X_getc;
- FuncNames["lle_X__IO_getc"] = lle_X__IO_getc;
- FuncNames["lle_X_fputc"] = lle_X_fputc;
- FuncNames["lle_X_ungetc"] = lle_X_ungetc;
- FuncNames["lle_X_fprintf"] = lle_X_fprintf;
- FuncNames["lle_X_freopen"] = lle_X_freopen;
-
- FuncNames["lle_X___cxa_guard_acquire"] = lle_X___cxa_guard_acquire;
- FuncNames["lle_X____cxa_guard_release"] = lle_X___cxa_guard_release;
-}
-
diff --git a/release_23/lib/ExecutionEngine/Interpreter/Interpreter.cpp b/release_23/lib/ExecutionEngine/Interpreter/Interpreter.cpp
deleted file mode 100644
index 5d7f9018542c..000000000000
--- a/release_23/lib/ExecutionEngine/Interpreter/Interpreter.cpp
+++ /dev/null
@@ -1,99 +0,0 @@
-//===- Interpreter.cpp - Top-Level LLVM Interpreter Implementation --------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the top-level functionality for the LLVM interpreter.
-// This interpreter is designed to be a very simple, portable, inefficient
-// interpreter.
-//
-//===----------------------------------------------------------------------===//
-
-#include "Interpreter.h"
-#include "llvm/CodeGen/IntrinsicLowering.h"
-#include "llvm/DerivedTypes.h"
-#include "llvm/Module.h"
-#include "llvm/ModuleProvider.h"
-#include <cstring>
-using namespace llvm;
-
-static struct RegisterInterp {
- RegisterInterp() { Interpreter::Register(); }
-} InterpRegistrator;
-
-namespace llvm {
- void LinkInInterpreter() {
- }
-}
-
-/// create - Create a new interpreter object. This can never fail.
-///
-ExecutionEngine *Interpreter::create(ModuleProvider *MP, std::string* ErrStr) {
- // Tell this ModuleProvide to materialize and release the module
- if (!MP->materializeModule(ErrStr))
- // We got an error, just return 0
- return 0;
-
- return new Interpreter(MP);
-}
-
-//===----------------------------------------------------------------------===//
-// Interpreter ctor - Initialize stuff
-//
-Interpreter::Interpreter(ModuleProvider *M)
- : ExecutionEngine(M), TD(M->getModule()) {
-
- memset(&ExitValue.Untyped, 0, sizeof(ExitValue.Untyped));
- setTargetData(&TD);
- // Initialize the "backend"
- initializeExecutionEngine();
- initializeExternalFunctions();
- emitGlobals();
-
- IL = new IntrinsicLowering(TD);
-}
-
-Interpreter::~Interpreter() {
- delete IL;
-}
-
-void Interpreter::runAtExitHandlers () {
- while (!AtExitHandlers.empty()) {
- callFunction(AtExitHandlers.back(), std::vector<GenericValue>());
- AtExitHandlers.pop_back();
- run();
- }
-}
-
-/// run - Start execution with the specified function and arguments.
-///
-GenericValue
-Interpreter::runFunction(Function *F,
- const std::vector<GenericValue> &ArgValues) {
- assert (F && "Function *F was null at entry to run()");
-
- // Try extra hard not to pass extra args to a function that isn't
- // expecting them. C programmers frequently bend the rules and
- // declare main() with fewer parameters than it actually gets
- // passed, and the interpreter barfs if you pass a function more
- // parameters than it is declared to take. This does not attempt to
- // take into account gratuitous differences in declared types,
- // though.
- std::vector<GenericValue> ActualArgs;
- const unsigned ArgCount = F->getFunctionType()->getNumParams();
- for (unsigned i = 0; i < ArgCount; ++i)
- ActualArgs.push_back(ArgValues[i]);
-
- // Set up the function call.
- callFunction(F, ActualArgs);
-
- // Start executing the function.
- run();
-
- return ExitValue;
-}
-
diff --git a/release_23/lib/ExecutionEngine/Interpreter/Interpreter.h b/release_23/lib/ExecutionEngine/Interpreter/Interpreter.h
deleted file mode 100644
index 02edaa026401..000000000000
--- a/release_23/lib/ExecutionEngine/Interpreter/Interpreter.h
+++ /dev/null
@@ -1,241 +0,0 @@
-//===-- Interpreter.h ------------------------------------------*- C++ -*--===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This header file defines the interpreter structure
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLI_INTERPRETER_H
-#define LLI_INTERPRETER_H
-
-#include "llvm/Function.h"
-#include "llvm/ExecutionEngine/ExecutionEngine.h"
-#include "llvm/ExecutionEngine/GenericValue.h"
-#include "llvm/ADT/APInt.h"
-#include "llvm/Support/InstVisitor.h"
-#include "llvm/Support/CallSite.h"
-#include "llvm/Target/TargetData.h"
-#include "llvm/Support/DataTypes.h"
-
-namespace llvm {
-
-class IntrinsicLowering;
-struct FunctionInfo;
-template<typename T> class generic_gep_type_iterator;
-class ConstantExpr;
-typedef generic_gep_type_iterator<User::const_op_iterator> gep_type_iterator;
-
-
-// AllocaHolder - Object to track all of the blocks of memory allocated by
-// alloca. When the function returns, this object is popped off the execution
-// stack, which causes the dtor to be run, which frees all the alloca'd memory.
-//
-class AllocaHolder {
- friend class AllocaHolderHandle;
- std::vector<void*> Allocations;
- unsigned RefCnt;
-public:
- AllocaHolder() : RefCnt(0) {}
- void add(void *mem) { Allocations.push_back(mem); }
- ~AllocaHolder() {
- for (unsigned i = 0; i < Allocations.size(); ++i)
- free(Allocations[i]);
- }
-};
-
-// AllocaHolderHandle gives AllocaHolder value semantics so we can stick it into
-// a vector...
-//
-class AllocaHolderHandle {
- AllocaHolder *H;
-public:
- AllocaHolderHandle() : H(new AllocaHolder()) { H->RefCnt++; }
- AllocaHolderHandle(const AllocaHolderHandle &AH) : H(AH.H) { H->RefCnt++; }
- ~AllocaHolderHandle() { if (--H->RefCnt == 0) delete H; }
-
- void add(void *mem) { H->add(mem); }
-};
-
-typedef std::vector<GenericValue> ValuePlaneTy;
-
-// ExecutionContext struct - This struct represents one stack frame currently
-// executing.
-//
-struct ExecutionContext {
- Function *CurFunction;// The currently executing function
- BasicBlock *CurBB; // The currently executing BB
- BasicBlock::iterator CurInst; // The next instruction to execute
- std::map<Value *, GenericValue> Values; // LLVM values used in this invocation
- std::vector<GenericValue> VarArgs; // Values passed through an ellipsis
- CallSite Caller; // Holds the call that called subframes.
- // NULL if main func or debugger invoked fn
- AllocaHolderHandle Allocas; // Track memory allocated by alloca
-};
-
-// Interpreter - This class represents the entirety of the interpreter.
-//
-class Interpreter : public ExecutionEngine, public InstVisitor<Interpreter> {
- GenericValue ExitValue; // The return value of the called function
- TargetData TD;
- IntrinsicLowering *IL;
-
- // The runtime stack of executing code. The top of the stack is the current
- // function record.
- std::vector<ExecutionContext> ECStack;
-
- // AtExitHandlers - List of functions to call when the program exits,
- // registered with the atexit() library function.
- std::vector<Function*> AtExitHandlers;
-
-public:
- explicit Interpreter(ModuleProvider *M);
- ~Interpreter();
-
- /// runAtExitHandlers - Run any functions registered by the program's calls to
- /// atexit(3), which we intercept and store in AtExitHandlers.
- ///
- void runAtExitHandlers();
-
- static void Register() {
- InterpCtor = create;
- }
-
- /// create - Create an interpreter ExecutionEngine. This can never fail.
- ///
- static ExecutionEngine *create(ModuleProvider *M, std::string *ErrorStr = 0);
-
- /// run - Start execution with the specified function and arguments.
- ///
- virtual GenericValue runFunction(Function *F,
- const std::vector<GenericValue> &ArgValues);
-
- /// recompileAndRelinkFunction - For the interpreter, functions are always
- /// up-to-date.
- ///
- virtual void *recompileAndRelinkFunction(Function *F) {
- return getPointerToFunction(F);
- }
-
- /// freeMachineCodeForFunction - The interpreter does not generate any code.
- ///
- void freeMachineCodeForFunction(Function *F) { }
-
- // Methods used to execute code:
- // Place a call on the stack
- void callFunction(Function *F, const std::vector<GenericValue> &ArgVals);
- void run(); // Execute instructions until nothing left to do
-
- // Opcode Implementations
- void visitReturnInst(ReturnInst &I);
- void visitBranchInst(BranchInst &I);
- void visitSwitchInst(SwitchInst &I);
-
- void visitBinaryOperator(BinaryOperator &I);
- void visitICmpInst(ICmpInst &I);
- void visitFCmpInst(FCmpInst &I);
- void visitAllocationInst(AllocationInst &I);
- void visitFreeInst(FreeInst &I);
- void visitLoadInst(LoadInst &I);
- void visitStoreInst(StoreInst &I);
- void visitGetElementPtrInst(GetElementPtrInst &I);
- void visitPHINode(PHINode &PN) { assert(0 && "PHI nodes already handled!"); }
- void visitTruncInst(TruncInst &I);
- void visitZExtInst(ZExtInst &I);
- void visitSExtInst(SExtInst &I);
- void visitFPTruncInst(FPTruncInst &I);
- void visitFPExtInst(FPExtInst &I);
- void visitUIToFPInst(UIToFPInst &I);
- void visitSIToFPInst(SIToFPInst &I);
- void visitFPToUIInst(FPToUIInst &I);
- void visitFPToSIInst(FPToSIInst &I);
- void visitPtrToIntInst(PtrToIntInst &I);
- void visitIntToPtrInst(IntToPtrInst &I);
- void visitBitCastInst(BitCastInst &I);
- void visitSelectInst(SelectInst &I);
-
-
- void visitCallSite(CallSite CS);
- void visitCallInst(CallInst &I) { visitCallSite (CallSite (&I)); }
- void visitInvokeInst(InvokeInst &I) { visitCallSite (CallSite (&I)); }
- void visitUnwindInst(UnwindInst &I);
- void visitUnreachableInst(UnreachableInst &I);
-
- void visitShl(BinaryOperator &I);
- void visitLShr(BinaryOperator &I);
- void visitAShr(BinaryOperator &I);
-
- void visitVAArgInst(VAArgInst &I);
- void visitInstruction(Instruction &I) {
- cerr << I;
- assert(0 && "Instruction not interpretable yet!");
- }
-
- GenericValue callExternalFunction(Function *F,
- const std::vector<GenericValue> &ArgVals);
- void exitCalled(GenericValue GV);
-
- void addAtExitHandler(Function *F) {
- AtExitHandlers.push_back(F);
- }
-
- GenericValue *getFirstVarArg () {
- return &(ECStack.back ().VarArgs[0]);
- }
-
- //FIXME: private:
-public:
- GenericValue executeGEPOperation(Value *Ptr, gep_type_iterator I,
- gep_type_iterator E, ExecutionContext &SF);
-
-private: // Helper functions
- // SwitchToNewBasicBlock - Start execution in a new basic block and run any
- // PHI nodes in the top of the block. This is used for intraprocedural
- // control flow.
- //
- void SwitchToNewBasicBlock(BasicBlock *Dest, ExecutionContext &SF);
-
- void *getPointerToFunction(Function *F) { return (void*)F; }
-
- void initializeExecutionEngine();
- void initializeExternalFunctions();
- GenericValue getConstantExprValue(ConstantExpr *CE, ExecutionContext &SF);
- GenericValue getOperandValue(Value *V, ExecutionContext &SF);
- GenericValue executeTruncInst(Value *SrcVal, const Type *DstTy,
- ExecutionContext &SF);
- GenericValue executeSExtInst(Value *SrcVal, const Type *DstTy,
- ExecutionContext &SF);
- GenericValue executeZExtInst(Value *SrcVal, const Type *DstTy,
- ExecutionContext &SF);
- GenericValue executeFPTruncInst(Value *SrcVal, const Type *DstTy,
- ExecutionContext &SF);
- GenericValue executeFPExtInst(Value *SrcVal, const Type *DstTy,
- ExecutionContext &SF);
- GenericValue executeFPToUIInst(Value *SrcVal, const Type *DstTy,
- ExecutionContext &SF);
- GenericValue executeFPToSIInst(Value *SrcVal, const Type *DstTy,
- ExecutionContext &SF);
- GenericValue executeUIToFPInst(Value *SrcVal, const Type *DstTy,
- ExecutionContext &SF);
- GenericValue executeSIToFPInst(Value *SrcVal, const Type *DstTy,
- ExecutionContext &SF);
- GenericValue executePtrToIntInst(Value *SrcVal, const Type *DstTy,
- ExecutionContext &SF);
- GenericValue executeIntToPtrInst(Value *SrcVal, const Type *DstTy,
- ExecutionContext &SF);
- GenericValue executeBitCastInst(Value *SrcVal, const Type *DstTy,
- ExecutionContext &SF);
- GenericValue executeCastOperation(Instruction::CastOps opcode, Value *SrcVal,
- const Type *Ty, ExecutionContext &SF);
- void popStackAndReturnValueToCaller(const Type *RetTy, GenericValue Result);
-
-};
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/lib/ExecutionEngine/Interpreter/Makefile b/release_23/lib/ExecutionEngine/Interpreter/Makefile
deleted file mode 100644
index deb49691a135..000000000000
--- a/release_23/lib/ExecutionEngine/Interpreter/Makefile
+++ /dev/null
@@ -1,12 +0,0 @@
-##===- lib/ExecutionEngine/Interpreter/Makefile ------------*- Makefile -*-===##
-#
-# The LLVM Compiler Infrastructure
-#
-# This file is distributed under the University of Illinois Open Source
-# License. See LICENSE.TXT for details.
-#
-##===----------------------------------------------------------------------===##
-LEVEL = ../../..
-LIBRARYNAME = LLVMInterpreter
-
-include $(LEVEL)/Makefile.common
diff --git a/release_23/lib/ExecutionEngine/JIT/Intercept.cpp b/release_23/lib/ExecutionEngine/JIT/Intercept.cpp
deleted file mode 100644
index 0e4c75dd4f17..000000000000
--- a/release_23/lib/ExecutionEngine/JIT/Intercept.cpp
+++ /dev/null
@@ -1,139 +0,0 @@
-//===-- Intercept.cpp - System function interception routines -------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// If a function call occurs to an external function, the JIT is designed to use
-// the dynamic loader interface to find a function to call. This is useful for
-// calling system calls and library functions that are not available in LLVM.
-// Some system calls, however, need to be handled specially. For this reason,
-// we intercept some of them here and use our own stubs to handle them.
-//
-//===----------------------------------------------------------------------===//
-
-#include "JIT.h"
-#include "llvm/System/DynamicLibrary.h"
-#include "llvm/Config/config.h"
-using namespace llvm;
-
-// AtExitHandlers - List of functions to call when the program exits,
-// registered with the atexit() library function.
-static std::vector<void (*)()> AtExitHandlers;
-
-/// runAtExitHandlers - Run any functions registered by the program's
-/// calls to atexit(3), which we intercept and store in
-/// AtExitHandlers.
-///
-static void runAtExitHandlers() {
- while (!AtExitHandlers.empty()) {
- void (*Fn)() = AtExitHandlers.back();
- AtExitHandlers.pop_back();
- Fn();
- }
-}
-
-//===----------------------------------------------------------------------===//
-// Function stubs that are invoked instead of certain library calls
-//===----------------------------------------------------------------------===//
-
-// Force the following functions to be linked in to anything that uses the
-// JIT. This is a hack designed to work around the all-too-clever Glibc
-// strategy of making these functions work differently when inlined vs. when
-// not inlined, and hiding their real definitions in a separate archive file
-// that the dynamic linker can't see. For more info, search for
-// 'libc_nonshared.a' on Google, or read http://llvm.org/PR274.
-#if defined(__linux__)
-#if defined(HAVE_SYS_STAT_H)
-#include <sys/stat.h>
-#endif
-
-/* stat functions are redirecting to __xstat with a version number. On x86-64
- * linking with libc_nonshared.a and -Wl,--export-dynamic doesn't make 'stat'
- * available as an exported symbol, so we have to add it explicitly.
- */
-class StatSymbols {
-public:
- StatSymbols() {
- sys::DynamicLibrary::AddSymbol("stat", (void*)(intptr_t)stat);
- sys::DynamicLibrary::AddSymbol("fstat", (void*)(intptr_t)fstat);
- sys::DynamicLibrary::AddSymbol("lstat", (void*)(intptr_t)lstat);
- sys::DynamicLibrary::AddSymbol("stat64", (void*)(intptr_t)stat64);
- sys::DynamicLibrary::AddSymbol("fstat64", (void*)(intptr_t)fstat64);
- sys::DynamicLibrary::AddSymbol("lstat64", (void*)(intptr_t)lstat64);
- sys::DynamicLibrary::AddSymbol("atexit", (void*)(intptr_t)atexit);
- sys::DynamicLibrary::AddSymbol("mknod", (void*)(intptr_t)mknod);
- }
-};
-static StatSymbols initStatSymbols;
-#endif // __linux__
-
-// jit_exit - Used to intercept the "exit" library call.
-static void jit_exit(int Status) {
- runAtExitHandlers(); // Run atexit handlers...
- exit(Status);
-}
-
-// jit_atexit - Used to intercept the "atexit" library call.
-static int jit_atexit(void (*Fn)(void)) {
- AtExitHandlers.push_back(Fn); // Take note of atexit handler...
- return 0; // Always successful
-}
-
-//===----------------------------------------------------------------------===//
-//
-/// getPointerToNamedFunction - This method returns the address of the specified
-/// function by using the dynamic loader interface. As such it is only useful
-/// for resolving library symbols, not code generated symbols.
-///
-void *JIT::getPointerToNamedFunction(const std::string &Name) {
- // Check to see if this is one of the functions we want to intercept. Note,
- // we cast to intptr_t here to silence a -pedantic warning that complains
- // about casting a function pointer to a normal pointer.
- if (Name == "exit") return (void*)(intptr_t)&jit_exit;
- if (Name == "atexit") return (void*)(intptr_t)&jit_atexit;
-
- const char *NameStr = Name.c_str();
- // If this is an asm specifier, skip the sentinal.
- if (NameStr[0] == 1) ++NameStr;
-
- // If it's an external function, look it up in the process image...
- void *Ptr = sys::DynamicLibrary::SearchForAddressOfSymbol(NameStr);
- if (Ptr) return Ptr;
-
- // If it wasn't found and if it starts with an underscore ('_') character, and
- // has an asm specifier, try again without the underscore.
- if (Name[0] == 1 && NameStr[0] == '_') {
- Ptr = sys::DynamicLibrary::SearchForAddressOfSymbol(NameStr+1);
- if (Ptr) return Ptr;
- }
-
- // darwin/ppc adds $LDBLStub suffixes to various symbols like printf. These
- // are references to hidden visibility symbols that dlsym cannot resolve. If
- // we have one of these, strip off $LDBLStub and try again.
-#if defined(__APPLE__) && defined(__ppc__)
- if (Name.size() > 9 && Name[Name.size()-9] == '$' &&
- memcmp(&Name[Name.size()-8], "LDBLStub", 8) == 0) {
- // First try turning $LDBLStub into $LDBL128. If that fails, strip it off.
- // This mirrors logic in libSystemStubs.a.
- std::string Prefix = std::string(Name.begin(), Name.end()-9);
- if (void *Ptr = getPointerToNamedFunction(Prefix+"$LDBL128"))
- return Ptr;
- if (void *Ptr = getPointerToNamedFunction(Prefix))
- return Ptr;
- }
-#endif
-
- /// If a LazyFunctionCreator is installed, use it to get/create the function.
- if (LazyFunctionCreator)
- if (void *RP = LazyFunctionCreator(Name))
- return RP;
-
- cerr << "ERROR: Program used external function '" << Name
- << "' which could not be resolved!\n";
- abort();
- return 0;
-}
diff --git a/release_23/lib/ExecutionEngine/JIT/JIT.cpp b/release_23/lib/ExecutionEngine/JIT/JIT.cpp
deleted file mode 100644
index 9e89e3c0e1d9..000000000000
--- a/release_23/lib/ExecutionEngine/JIT/JIT.cpp
+++ /dev/null
@@ -1,416 +0,0 @@
-//===-- JIT.cpp - LLVM Just in Time Compiler ------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This tool implements a just-in-time compiler for LLVM, allowing direct
-// execution of LLVM bitcode in an efficient manner.
-//
-//===----------------------------------------------------------------------===//
-
-#include "JIT.h"
-#include "llvm/Constants.h"
-#include "llvm/DerivedTypes.h"
-#include "llvm/Function.h"
-#include "llvm/GlobalVariable.h"
-#include "llvm/Instructions.h"
-#include "llvm/ModuleProvider.h"
-#include "llvm/CodeGen/MachineCodeEmitter.h"
-#include "llvm/CodeGen/MachineFunction.h"
-#include "llvm/ExecutionEngine/GenericValue.h"
-#include "llvm/Support/MutexGuard.h"
-#include "llvm/System/DynamicLibrary.h"
-#include "llvm/Target/TargetData.h"
-#include "llvm/Target/TargetMachine.h"
-#include "llvm/Target/TargetJITInfo.h"
-
-#include "llvm/Config/config.h"
-
-using namespace llvm;
-
-#ifdef __APPLE__
-// Apple gcc defaults to -fuse-cxa-atexit (i.e. calls __cxa_atexit instead
-// of atexit). It passes the address of linker generated symbol __dso_handle
-// to the function.
-// This configuration change happened at version 5330.
-# include <AvailabilityMacros.h>
-# if defined(MAC_OS_X_VERSION_10_4) && \
- ((MAC_OS_X_VERSION_MIN_REQUIRED > MAC_OS_X_VERSION_10_4) || \
- (MAC_OS_X_VERSION_MIN_REQUIRED == MAC_OS_X_VERSION_10_4 && \
- __APPLE_CC__ >= 5330))
-# ifndef HAVE___DSO_HANDLE
-# define HAVE___DSO_HANDLE 1
-# endif
-# endif
-#endif
-
-#if HAVE___DSO_HANDLE
-extern void *__dso_handle __attribute__ ((__visibility__ ("hidden")));
-#endif
-
-static struct RegisterJIT {
- RegisterJIT() { JIT::Register(); }
-} JITRegistrator;
-
-namespace llvm {
- void LinkInJIT() {
- }
-}
-
-#if defined (__GNUC__)
-extern "C" void __register_frame(void*);
-#endif
-
-/// createJIT - This is the factory method for creating a JIT for the current
-/// machine, it does not fall back to the interpreter. This takes ownership
-/// of the module provider.
-ExecutionEngine *ExecutionEngine::createJIT(ModuleProvider *MP,
- std::string *ErrorStr,
- JITMemoryManager *JMM) {
- ExecutionEngine *EE = JIT::createJIT(MP, ErrorStr, JMM);
- if (!EE) return 0;
-
- // Register routine for informing unwinding runtime about new EH frames
-#if defined(__GNUC__)
- EE->InstallExceptionTableRegister(__register_frame);
-#endif
-
- // Make sure we can resolve symbols in the program as well. The zero arg
- // to the function tells DynamicLibrary to load the program, not a library.
- sys::DynamicLibrary::LoadLibraryPermanently(0, ErrorStr);
- return EE;
-}
-
-JIT::JIT(ModuleProvider *MP, TargetMachine &tm, TargetJITInfo &tji,
- JITMemoryManager *JMM)
- : ExecutionEngine(MP), TM(tm), TJI(tji), jitstate(MP) {
- setTargetData(TM.getTargetData());
-
- // Initialize MCE
- MCE = createEmitter(*this, JMM);
-
- // Add target data
- MutexGuard locked(lock);
- FunctionPassManager &PM = jitstate.getPM(locked);
- PM.add(new TargetData(*TM.getTargetData()));
-
- // Turn the machine code intermediate representation into bytes in memory that
- // may be executed.
- if (TM.addPassesToEmitMachineCode(PM, *MCE, false /*fast*/)) {
- cerr << "Target does not support machine code emission!\n";
- abort();
- }
-
- // Initialize passes.
- PM.doInitialization();
-}
-
-JIT::~JIT() {
- delete MCE;
- delete &TM;
-}
-
-/// run - Start execution with the specified function and arguments.
-///
-GenericValue JIT::runFunction(Function *F,
- const std::vector<GenericValue> &ArgValues) {
- assert(F && "Function *F was null at entry to run()");
-
- void *FPtr = getPointerToFunction(F);
- assert(FPtr && "Pointer to fn's code was null after getPointerToFunction");
- const FunctionType *FTy = F->getFunctionType();
- const Type *RetTy = FTy->getReturnType();
-
- assert((FTy->getNumParams() <= ArgValues.size() || FTy->isVarArg()) &&
- "Too many arguments passed into function!");
- assert(FTy->getNumParams() == ArgValues.size() &&
- "This doesn't support passing arguments through varargs (yet)!");
-
- // Handle some common cases first. These cases correspond to common `main'
- // prototypes.
- if (RetTy == Type::Int32Ty || RetTy == Type::VoidTy) {
- switch (ArgValues.size()) {
- case 3:
- if (FTy->getParamType(0) == Type::Int32Ty &&
- isa<PointerType>(FTy->getParamType(1)) &&
- isa<PointerType>(FTy->getParamType(2))) {
- int (*PF)(int, char **, const char **) =
- (int(*)(int, char **, const char **))(intptr_t)FPtr;
-
- // Call the function.
- GenericValue rv;
- rv.IntVal = APInt(32, PF(ArgValues[0].IntVal.getZExtValue(),
- (char **)GVTOP(ArgValues[1]),
- (const char **)GVTOP(ArgValues[2])));
- return rv;
- }
- break;
- case 2:
- if (FTy->getParamType(0) == Type::Int32Ty &&
- isa<PointerType>(FTy->getParamType(1))) {
- int (*PF)(int, char **) = (int(*)(int, char **))(intptr_t)FPtr;
-
- // Call the function.
- GenericValue rv;
- rv.IntVal = APInt(32, PF(ArgValues[0].IntVal.getZExtValue(),
- (char **)GVTOP(ArgValues[1])));
- return rv;
- }
- break;
- case 1:
- if (FTy->getNumParams() == 1 &&
- FTy->getParamType(0) == Type::Int32Ty) {
- GenericValue rv;
- int (*PF)(int) = (int(*)(int))(intptr_t)FPtr;
- rv.IntVal = APInt(32, PF(ArgValues[0].IntVal.getZExtValue()));
- return rv;
- }
- break;
- }
- }
-
- // Handle cases where no arguments are passed first.
- if (ArgValues.empty()) {
- GenericValue rv;
- switch (RetTy->getTypeID()) {
- default: assert(0 && "Unknown return type for function call!");
- case Type::IntegerTyID: {
- unsigned BitWidth = cast<IntegerType>(RetTy)->getBitWidth();
- if (BitWidth == 1)
- rv.IntVal = APInt(BitWidth, ((bool(*)())(intptr_t)FPtr)());
- else if (BitWidth <= 8)
- rv.IntVal = APInt(BitWidth, ((char(*)())(intptr_t)FPtr)());
- else if (BitWidth <= 16)
- rv.IntVal = APInt(BitWidth, ((short(*)())(intptr_t)FPtr)());
- else if (BitWidth <= 32)
- rv.IntVal = APInt(BitWidth, ((int(*)())(intptr_t)FPtr)());
- else if (BitWidth <= 64)
- rv.IntVal = APInt(BitWidth, ((int64_t(*)())(intptr_t)FPtr)());
- else
- assert(0 && "Integer types > 64 bits not supported");
- return rv;
- }
- case Type::VoidTyID:
- rv.IntVal = APInt(32, ((int(*)())(intptr_t)FPtr)());
- return rv;
- case Type::FloatTyID:
- rv.FloatVal = ((float(*)())(intptr_t)FPtr)();
- return rv;
- case Type::DoubleTyID:
- rv.DoubleVal = ((double(*)())(intptr_t)FPtr)();
- return rv;
- case Type::X86_FP80TyID:
- case Type::FP128TyID:
- case Type::PPC_FP128TyID:
- assert(0 && "long double not supported yet");
- return rv;
- case Type::PointerTyID:
- return PTOGV(((void*(*)())(intptr_t)FPtr)());
- }
- }
-
- // Okay, this is not one of our quick and easy cases. Because we don't have a
- // full FFI, we have to codegen a nullary stub function that just calls the
- // function we are interested in, passing in constants for all of the
- // arguments. Make this function and return.
-
- // First, create the function.
- FunctionType *STy=FunctionType::get(RetTy, std::vector<const Type*>(), false);
- Function *Stub = Function::Create(STy, Function::InternalLinkage, "",
- F->getParent());
-
- // Insert a basic block.
- BasicBlock *StubBB = BasicBlock::Create("", Stub);
-
- // Convert all of the GenericValue arguments over to constants. Note that we
- // currently don't support varargs.
- SmallVector<Value*, 8> Args;
- for (unsigned i = 0, e = ArgValues.size(); i != e; ++i) {
- Constant *C = 0;
- const Type *ArgTy = FTy->getParamType(i);
- const GenericValue &AV = ArgValues[i];
- switch (ArgTy->getTypeID()) {
- default: assert(0 && "Unknown argument type for function call!");
- case Type::IntegerTyID:
- C = ConstantInt::get(AV.IntVal);
- break;
- case Type::FloatTyID:
- C = ConstantFP::get(APFloat(AV.FloatVal));
- break;
- case Type::DoubleTyID:
- C = ConstantFP::get(APFloat(AV.DoubleVal));
- break;
- case Type::PPC_FP128TyID:
- case Type::X86_FP80TyID:
- case Type::FP128TyID:
- C = ConstantFP::get(APFloat(AV.IntVal));
- break;
- case Type::PointerTyID:
- void *ArgPtr = GVTOP(AV);
- if (sizeof(void*) == 4)
- C = ConstantInt::get(Type::Int32Ty, (int)(intptr_t)ArgPtr);
- else
- C = ConstantInt::get(Type::Int64Ty, (intptr_t)ArgPtr);
- C = ConstantExpr::getIntToPtr(C, ArgTy); // Cast the integer to pointer
- break;
- }
- Args.push_back(C);
- }
-
- CallInst *TheCall = CallInst::Create(F, Args.begin(), Args.end(), "", StubBB);
- TheCall->setTailCall();
- if (TheCall->getType() != Type::VoidTy)
- ReturnInst::Create(TheCall, StubBB); // Return result of the call.
- else
- ReturnInst::Create(StubBB); // Just return void.
-
- // Finally, return the value returned by our nullary stub function.
- return runFunction(Stub, std::vector<GenericValue>());
-}
-
-/// runJITOnFunction - Run the FunctionPassManager full of
-/// just-in-time compilation passes on F, hopefully filling in
-/// GlobalAddress[F] with the address of F's machine code.
-///
-void JIT::runJITOnFunction(Function *F) {
- static bool isAlreadyCodeGenerating = false;
-
- MutexGuard locked(lock);
- assert(!isAlreadyCodeGenerating && "Error: Recursive compilation detected!");
-
- // JIT the function
- isAlreadyCodeGenerating = true;
- jitstate.getPM(locked).run(*F);
- isAlreadyCodeGenerating = false;
-
- // If the function referred to a global variable that had not yet been
- // emitted, it allocates memory for the global, but doesn't emit it yet. Emit
- // all of these globals now.
- while (!jitstate.getPendingGlobals(locked).empty()) {
- const GlobalVariable *GV = jitstate.getPendingGlobals(locked).back();
- jitstate.getPendingGlobals(locked).pop_back();
- EmitGlobalVariable(GV);
- }
-}
-
-/// getPointerToFunction - This method is used to get the address of the
-/// specified function, compiling it if neccesary.
-///
-void *JIT::getPointerToFunction(Function *F) {
-
- if (void *Addr = getPointerToGlobalIfAvailable(F))
- return Addr; // Check if function already code gen'd
-
- // Make sure we read in the function if it exists in this Module.
- if (F->hasNotBeenReadFromBitcode()) {
- // Determine the module provider this function is provided by.
- Module *M = F->getParent();
- ModuleProvider *MP = 0;
- for (unsigned i = 0, e = Modules.size(); i != e; ++i) {
- if (Modules[i]->getModule() == M) {
- MP = Modules[i];
- break;
- }
- }
- assert(MP && "Function isn't in a module we know about!");
-
- std::string ErrorMsg;
- if (MP->materializeFunction(F, &ErrorMsg)) {
- cerr << "Error reading function '" << F->getName()
- << "' from bitcode file: " << ErrorMsg << "\n";
- abort();
- }
- }
-
- if (void *Addr = getPointerToGlobalIfAvailable(F)) {
- return Addr;
- }
-
- MutexGuard locked(lock);
-
- if (F->isDeclaration()) {
- void *Addr = getPointerToNamedFunction(F->getName());
- addGlobalMapping(F, Addr);
- return Addr;
- }
-
- runJITOnFunction(F);
-
- void *Addr = getPointerToGlobalIfAvailable(F);
- assert(Addr && "Code generation didn't add function to GlobalAddress table!");
- return Addr;
-}
-
-/// getOrEmitGlobalVariable - Return the address of the specified global
-/// variable, possibly emitting it to memory if needed. This is used by the
-/// Emitter.
-void *JIT::getOrEmitGlobalVariable(const GlobalVariable *GV) {
- MutexGuard locked(lock);
-
- void *Ptr = getPointerToGlobalIfAvailable(GV);
- if (Ptr) return Ptr;
-
- // If the global is external, just remember the address.
- if (GV->isDeclaration()) {
-#if HAVE___DSO_HANDLE
- if (GV->getName() == "__dso_handle")
- return (void*)&__dso_handle;
-#endif
- Ptr = sys::DynamicLibrary::SearchForAddressOfSymbol(GV->getName().c_str());
- if (Ptr == 0) {
- cerr << "Could not resolve external global address: "
- << GV->getName() << "\n";
- abort();
- }
- } else {
- // If the global hasn't been emitted to memory yet, allocate space. We will
- // actually initialize the global after current function has finished
- // compilation.
- const Type *GlobalType = GV->getType()->getElementType();
- size_t S = getTargetData()->getABITypeSize(GlobalType);
- size_t A = getTargetData()->getPreferredAlignment(GV);
- if (A <= 8) {
- Ptr = malloc(S);
- } else {
- // Allocate S+A bytes of memory, then use an aligned pointer within that
- // space.
- Ptr = malloc(S+A);
- unsigned MisAligned = ((intptr_t)Ptr & (A-1));
- Ptr = (char*)Ptr + (MisAligned ? (A-MisAligned) : 0);
- }
- jitstate.getPendingGlobals(locked).push_back(GV);
- }
- addGlobalMapping(GV, Ptr);
- return Ptr;
-}
-
-
-/// recompileAndRelinkFunction - This method is used to force a function
-/// which has already been compiled, to be compiled again, possibly
-/// after it has been modified. Then the entry to the old copy is overwritten
-/// with a branch to the new copy. If there was no old copy, this acts
-/// just like JIT::getPointerToFunction().
-///
-void *JIT::recompileAndRelinkFunction(Function *F) {
- void *OldAddr = getPointerToGlobalIfAvailable(F);
-
- // If it's not already compiled there is no reason to patch it up.
- if (OldAddr == 0) { return getPointerToFunction(F); }
-
- // Delete the old function mapping.
- addGlobalMapping(F, 0);
-
- // Recodegen the function
- runJITOnFunction(F);
-
- // Update state, forward the old function to the new function.
- void *Addr = getPointerToGlobalIfAvailable(F);
- assert(Addr && "Code generation didn't add function to GlobalAddress table!");
- TJI.replaceMachineCodeForFunction(OldAddr, Addr);
- return Addr;
-}
-
diff --git a/release_23/lib/ExecutionEngine/JIT/JIT.h b/release_23/lib/ExecutionEngine/JIT/JIT.h
deleted file mode 100644
index 69e301bf6d04..000000000000
--- a/release_23/lib/ExecutionEngine/JIT/JIT.h
+++ /dev/null
@@ -1,137 +0,0 @@
-//===-- JIT.h - Class definition for the JIT --------------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines the top-level JIT data structure.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef JIT_H
-#define JIT_H
-
-#include "llvm/ExecutionEngine/ExecutionEngine.h"
-#include "llvm/PassManager.h"
-#include <map>
-
-namespace llvm {
-
-class Function;
-class GlobalValue;
-class Constant;
-class TargetMachine;
-class TargetJITInfo;
-class MachineCodeEmitter;
-
-class JITState {
-private:
- FunctionPassManager PM; // Passes to compile a function
-
- /// PendingGlobals - Global variables which have had memory allocated for them
- /// while a function was code generated, but which have not been initialized
- /// yet.
- std::vector<const GlobalVariable*> PendingGlobals;
-
-public:
- explicit JITState(ModuleProvider *MP) : PM(MP) {}
-
- FunctionPassManager &getPM(const MutexGuard &L) {
- return PM;
- }
-
- std::vector<const GlobalVariable*> &getPendingGlobals(const MutexGuard &L) {
- return PendingGlobals;
- }
-};
-
-
-class JIT : public ExecutionEngine {
- TargetMachine &TM; // The current target we are compiling to
- TargetJITInfo &TJI; // The JITInfo for the target we are compiling to
- MachineCodeEmitter *MCE; // MCE object
-
- JITState jitstate;
-
- JIT(ModuleProvider *MP, TargetMachine &tm, TargetJITInfo &tji,
- JITMemoryManager *JMM);
-public:
- ~JIT();
-
- static void Register() {
- JITCtor = create;
- }
-
- /// getJITInfo - Return the target JIT information structure.
- ///
- TargetJITInfo &getJITInfo() const { return TJI; }
-
- /// create - Create an return a new JIT compiler if there is one available
- /// for the current target. Otherwise, return null.
- ///
- static ExecutionEngine *create(ModuleProvider *MP, std::string *Err) {
- return createJIT(MP, Err, 0);
- }
-
- /// run - Start execution with the specified function and arguments.
- ///
- virtual GenericValue runFunction(Function *F,
- const std::vector<GenericValue> &ArgValues);
-
- /// getPointerToNamedFunction - This method returns the address of the
- /// specified function by using the dlsym function call. As such it is only
- /// useful for resolving library symbols, not code generated symbols.
- ///
- void *getPointerToNamedFunction(const std::string &Name);
-
- // CompilationCallback - Invoked the first time that a call site is found,
- // which causes lazy compilation of the target function.
- //
- static void CompilationCallback();
-
- /// getPointerToFunction - This returns the address of the specified function,
- /// compiling it if necessary.
- ///
- void *getPointerToFunction(Function *F);
-
- /// getOrEmitGlobalVariable - Return the address of the specified global
- /// variable, possibly emitting it to memory if needed. This is used by the
- /// Emitter.
- void *getOrEmitGlobalVariable(const GlobalVariable *GV);
-
- /// getPointerToFunctionOrStub - If the specified function has been
- /// code-gen'd, return a pointer to the function. If not, compile it, or use
- /// a stub to implement lazy compilation if available.
- ///
- void *getPointerToFunctionOrStub(Function *F);
-
- /// recompileAndRelinkFunction - This method is used to force a function
- /// which has already been compiled, to be compiled again, possibly
- /// after it has been modified. Then the entry to the old copy is overwritten
- /// with a branch to the new copy. If there was no old copy, this acts
- /// just like JIT::getPointerToFunction().
- ///
- void *recompileAndRelinkFunction(Function *F);
-
- /// freeMachineCodeForFunction - deallocate memory used to code-generate this
- /// Function.
- ///
- void freeMachineCodeForFunction(Function *F);
-
- /// getCodeEmitter - Return the code emitter this JIT is emitting into.
- MachineCodeEmitter *getCodeEmitter() const { return MCE; }
-
- static ExecutionEngine *createJIT(ModuleProvider *MP, std::string *Err,
- JITMemoryManager *JMM);
-
-private:
- static MachineCodeEmitter *createEmitter(JIT &J, JITMemoryManager *JMM);
- void runJITOnFunction (Function *F);
-};
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/lib/ExecutionEngine/JIT/JITDwarfEmitter.cpp b/release_23/lib/ExecutionEngine/JIT/JITDwarfEmitter.cpp
deleted file mode 100644
index b73b0bd76c32..000000000000
--- a/release_23/lib/ExecutionEngine/JIT/JITDwarfEmitter.cpp
+++ /dev/null
@@ -1,1082 +0,0 @@
-//===----- JITDwarfEmitter.cpp - Write dwarf tables into memory -----------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines a JITDwarfEmitter object that is used by the JIT to
-// write dwarf tables to memory.
-//
-//===----------------------------------------------------------------------===//
-
-#include "JIT.h"
-#include "JITDwarfEmitter.h"
-#include "llvm/Function.h"
-#include "llvm/ADT/DenseMap.h"
-#include "llvm/CodeGen/AsmPrinter.h"
-#include "llvm/CodeGen/MachineCodeEmitter.h"
-#include "llvm/CodeGen/MachineFunction.h"
-#include "llvm/CodeGen/MachineLocation.h"
-#include "llvm/CodeGen/MachineModuleInfo.h"
-#include "llvm/ExecutionEngine/JITMemoryManager.h"
-#include "llvm/Target/TargetAsmInfo.h"
-#include "llvm/Target/TargetData.h"
-#include "llvm/Target/TargetInstrInfo.h"
-#include "llvm/Target/TargetFrameInfo.h"
-#include "llvm/Target/TargetMachine.h"
-#include "llvm/Target/TargetRegisterInfo.h"
-
-using namespace llvm;
-
-JITDwarfEmitter::JITDwarfEmitter(JIT& theJit) : Jit(theJit) {}
-
-
-unsigned char* JITDwarfEmitter::EmitDwarfTable(MachineFunction& F,
- MachineCodeEmitter& mce,
- unsigned char* StartFunction,
- unsigned char* EndFunction) {
- const TargetMachine& TM = F.getTarget();
- TD = TM.getTargetData();
- needsIndirectEncoding = TM.getTargetAsmInfo()->getNeedsIndirectEncoding();
- stackGrowthDirection = TM.getFrameInfo()->getStackGrowthDirection();
- RI = TM.getRegisterInfo();
- MCE = &mce;
-
- unsigned char* ExceptionTable = EmitExceptionTable(&F, StartFunction,
- EndFunction);
-
- unsigned char* Result = 0;
- unsigned char* EHFramePtr = 0;
-
- const std::vector<Function *> Personalities = MMI->getPersonalities();
- EHFramePtr = EmitCommonEHFrame(Personalities[MMI->getPersonalityIndex()]);
-
- Result = EmitEHFrame(Personalities[MMI->getPersonalityIndex()], EHFramePtr,
- StartFunction, EndFunction, ExceptionTable);
-
- return Result;
-}
-
-
-void
-JITDwarfEmitter::EmitFrameMoves(intptr_t BaseLabelPtr,
- const std::vector<MachineMove> &Moves) const {
- unsigned PointerSize = TD->getPointerSize();
- int stackGrowth = stackGrowthDirection == TargetFrameInfo::StackGrowsUp ?
- PointerSize : -PointerSize;
- bool IsLocal = BaseLabelPtr;
-
- for (unsigned i = 0, N = Moves.size(); i < N; ++i) {
- const MachineMove &Move = Moves[i];
- unsigned LabelID = Move.getLabelID();
-
- if (LabelID) {
- LabelID = MMI->MappedLabel(LabelID);
-
- // Throw out move if the label is invalid.
- if (!LabelID) continue;
- }
-
- intptr_t LabelPtr = 0;
- if (LabelID) LabelPtr = MCE->getLabelAddress(LabelID);
-
- const MachineLocation &Dst = Move.getDestination();
- const MachineLocation &Src = Move.getSource();
-
- // Advance row if new location.
- if (BaseLabelPtr && LabelID && (BaseLabelPtr != LabelPtr || !IsLocal)) {
- MCE->emitByte(dwarf::DW_CFA_advance_loc4);
- if (PointerSize == 8) {
- MCE->emitInt64(LabelPtr - BaseLabelPtr);
- } else {
- MCE->emitInt32(LabelPtr - BaseLabelPtr);
- }
-
- BaseLabelPtr = LabelPtr;
- IsLocal = true;
- }
-
- // If advancing cfa.
- if (Dst.isRegister() && Dst.getRegister() == MachineLocation::VirtualFP) {
- if (!Src.isRegister()) {
- if (Src.getRegister() == MachineLocation::VirtualFP) {
- MCE->emitByte(dwarf::DW_CFA_def_cfa_offset);
- } else {
- MCE->emitByte(dwarf::DW_CFA_def_cfa);
- MCE->emitULEB128Bytes(RI->getDwarfRegNum(Src.getRegister(), true));
- }
-
- int Offset = -Src.getOffset();
-
- MCE->emitULEB128Bytes(Offset);
- } else {
- assert(0 && "Machine move no supported yet.");
- }
- } else if (Src.isRegister() &&
- Src.getRegister() == MachineLocation::VirtualFP) {
- if (Dst.isRegister()) {
- MCE->emitByte(dwarf::DW_CFA_def_cfa_register);
- MCE->emitULEB128Bytes(RI->getDwarfRegNum(Dst.getRegister(), true));
- } else {
- assert(0 && "Machine move no supported yet.");
- }
- } else {
- unsigned Reg = RI->getDwarfRegNum(Src.getRegister(), true);
- int Offset = Dst.getOffset() / stackGrowth;
-
- if (Offset < 0) {
- MCE->emitByte(dwarf::DW_CFA_offset_extended_sf);
- MCE->emitULEB128Bytes(Reg);
- MCE->emitSLEB128Bytes(Offset);
- } else if (Reg < 64) {
- MCE->emitByte(dwarf::DW_CFA_offset + Reg);
- MCE->emitULEB128Bytes(Offset);
- } else {
- MCE->emitByte(dwarf::DW_CFA_offset_extended);
- MCE->emitULEB128Bytes(Reg);
- MCE->emitULEB128Bytes(Offset);
- }
- }
- }
-}
-
-/// SharedTypeIds - How many leading type ids two landing pads have in common.
-static unsigned SharedTypeIds(const LandingPadInfo *L,
- const LandingPadInfo *R) {
- const std::vector<int> &LIds = L->TypeIds, &RIds = R->TypeIds;
- unsigned LSize = LIds.size(), RSize = RIds.size();
- unsigned MinSize = LSize < RSize ? LSize : RSize;
- unsigned Count = 0;
-
- for (; Count != MinSize; ++Count)
- if (LIds[Count] != RIds[Count])
- return Count;
-
- return Count;
-}
-
-
-/// PadLT - Order landing pads lexicographically by type id.
-static bool PadLT(const LandingPadInfo *L, const LandingPadInfo *R) {
- const std::vector<int> &LIds = L->TypeIds, &RIds = R->TypeIds;
- unsigned LSize = LIds.size(), RSize = RIds.size();
- unsigned MinSize = LSize < RSize ? LSize : RSize;
-
- for (unsigned i = 0; i != MinSize; ++i)
- if (LIds[i] != RIds[i])
- return LIds[i] < RIds[i];
-
- return LSize < RSize;
-}
-
-struct KeyInfo {
- static inline unsigned getEmptyKey() { return -1U; }
- static inline unsigned getTombstoneKey() { return -2U; }
- static unsigned getHashValue(const unsigned &Key) { return Key; }
- static bool isEqual(unsigned LHS, unsigned RHS) { return LHS == RHS; }
- static bool isPod() { return true; }
-};
-
-/// ActionEntry - Structure describing an entry in the actions table.
-struct ActionEntry {
- int ValueForTypeID; // The value to write - may not be equal to the type id.
- int NextAction;
- struct ActionEntry *Previous;
-};
-
-/// PadRange - Structure holding a try-range and the associated landing pad.
-struct PadRange {
- // The index of the landing pad.
- unsigned PadIndex;
- // The index of the begin and end labels in the landing pad's label lists.
- unsigned RangeIndex;
-};
-
-typedef DenseMap<unsigned, PadRange, KeyInfo> RangeMapType;
-
-/// CallSiteEntry - Structure describing an entry in the call-site table.
-struct CallSiteEntry {
- unsigned BeginLabel; // zero indicates the start of the function.
- unsigned EndLabel; // zero indicates the end of the function.
- unsigned PadLabel; // zero indicates that there is no landing pad.
- unsigned Action;
-};
-
-unsigned char* JITDwarfEmitter::EmitExceptionTable(MachineFunction* MF,
- unsigned char* StartFunction,
- unsigned char* EndFunction) const {
- // Map all labels and get rid of any dead landing pads.
- MMI->TidyLandingPads();
-
- const std::vector<GlobalVariable *> &TypeInfos = MMI->getTypeInfos();
- const std::vector<unsigned> &FilterIds = MMI->getFilterIds();
- const std::vector<LandingPadInfo> &PadInfos = MMI->getLandingPads();
- if (PadInfos.empty()) return 0;
-
- // Sort the landing pads in order of their type ids. This is used to fold
- // duplicate actions.
- SmallVector<const LandingPadInfo *, 64> LandingPads;
- LandingPads.reserve(PadInfos.size());
- for (unsigned i = 0, N = PadInfos.size(); i != N; ++i)
- LandingPads.push_back(&PadInfos[i]);
- std::sort(LandingPads.begin(), LandingPads.end(), PadLT);
-
- // Negative type ids index into FilterIds, positive type ids index into
- // TypeInfos. The value written for a positive type id is just the type
- // id itself. For a negative type id, however, the value written is the
- // (negative) byte offset of the corresponding FilterIds entry. The byte
- // offset is usually equal to the type id, because the FilterIds entries
- // are written using a variable width encoding which outputs one byte per
- // entry as long as the value written is not too large, but can differ.
- // This kind of complication does not occur for positive type ids because
- // type infos are output using a fixed width encoding.
- // FilterOffsets[i] holds the byte offset corresponding to FilterIds[i].
- SmallVector<int, 16> FilterOffsets;
- FilterOffsets.reserve(FilterIds.size());
- int Offset = -1;
- for(std::vector<unsigned>::const_iterator I = FilterIds.begin(),
- E = FilterIds.end(); I != E; ++I) {
- FilterOffsets.push_back(Offset);
- Offset -= AsmPrinter::SizeULEB128(*I);
- }
-
- // Compute the actions table and gather the first action index for each
- // landing pad site.
- SmallVector<ActionEntry, 32> Actions;
- SmallVector<unsigned, 64> FirstActions;
- FirstActions.reserve(LandingPads.size());
-
- int FirstAction = 0;
- unsigned SizeActions = 0;
- for (unsigned i = 0, N = LandingPads.size(); i != N; ++i) {
- const LandingPadInfo *LP = LandingPads[i];
- const std::vector<int> &TypeIds = LP->TypeIds;
- const unsigned NumShared = i ? SharedTypeIds(LP, LandingPads[i-1]) : 0;
- unsigned SizeSiteActions = 0;
-
- if (NumShared < TypeIds.size()) {
- unsigned SizeAction = 0;
- ActionEntry *PrevAction = 0;
-
- if (NumShared) {
- const unsigned SizePrevIds = LandingPads[i-1]->TypeIds.size();
- assert(Actions.size());
- PrevAction = &Actions.back();
- SizeAction = AsmPrinter::SizeSLEB128(PrevAction->NextAction) +
- AsmPrinter::SizeSLEB128(PrevAction->ValueForTypeID);
- for (unsigned j = NumShared; j != SizePrevIds; ++j) {
- SizeAction -= AsmPrinter::SizeSLEB128(PrevAction->ValueForTypeID);
- SizeAction += -PrevAction->NextAction;
- PrevAction = PrevAction->Previous;
- }
- }
-
- // Compute the actions.
- for (unsigned I = NumShared, M = TypeIds.size(); I != M; ++I) {
- int TypeID = TypeIds[I];
- assert(-1-TypeID < (int)FilterOffsets.size() && "Unknown filter id!");
- int ValueForTypeID = TypeID < 0 ? FilterOffsets[-1 - TypeID] : TypeID;
- unsigned SizeTypeID = AsmPrinter::SizeSLEB128(ValueForTypeID);
-
- int NextAction = SizeAction ? -(SizeAction + SizeTypeID) : 0;
- SizeAction = SizeTypeID + AsmPrinter::SizeSLEB128(NextAction);
- SizeSiteActions += SizeAction;
-
- ActionEntry Action = {ValueForTypeID, NextAction, PrevAction};
- Actions.push_back(Action);
-
- PrevAction = &Actions.back();
- }
-
- // Record the first action of the landing pad site.
- FirstAction = SizeActions + SizeSiteActions - SizeAction + 1;
- } // else identical - re-use previous FirstAction
-
- FirstActions.push_back(FirstAction);
-
- // Compute this sites contribution to size.
- SizeActions += SizeSiteActions;
- }
-
- // Compute the call-site table. Entries must be ordered by address.
- SmallVector<CallSiteEntry, 64> CallSites;
-
- RangeMapType PadMap;
- for (unsigned i = 0, N = LandingPads.size(); i != N; ++i) {
- const LandingPadInfo *LandingPad = LandingPads[i];
- for (unsigned j=0, E = LandingPad->BeginLabels.size(); j != E; ++j) {
- unsigned BeginLabel = LandingPad->BeginLabels[j];
- assert(!PadMap.count(BeginLabel) && "Duplicate landing pad labels!");
- PadRange P = { i, j };
- PadMap[BeginLabel] = P;
- }
- }
-
- bool MayThrow = false;
- unsigned LastLabel = 0;
- for (MachineFunction::const_iterator I = MF->begin(), E = MF->end();
- I != E; ++I) {
- for (MachineBasicBlock::const_iterator MI = I->begin(), E = I->end();
- MI != E; ++MI) {
- if (MI->getOpcode() != TargetInstrInfo::LABEL) {
- MayThrow |= MI->getDesc().isCall();
- continue;
- }
-
- unsigned BeginLabel = MI->getOperand(0).getImm();
- assert(BeginLabel && "Invalid label!");
-
- if (BeginLabel == LastLabel)
- MayThrow = false;
-
- RangeMapType::iterator L = PadMap.find(BeginLabel);
-
- if (L == PadMap.end())
- continue;
-
- PadRange P = L->second;
- const LandingPadInfo *LandingPad = LandingPads[P.PadIndex];
-
- assert(BeginLabel == LandingPad->BeginLabels[P.RangeIndex] &&
- "Inconsistent landing pad map!");
-
- // If some instruction between the previous try-range and this one may
- // throw, create a call-site entry with no landing pad for the region
- // between the try-ranges.
- if (MayThrow) {
- CallSiteEntry Site = {LastLabel, BeginLabel, 0, 0};
- CallSites.push_back(Site);
- }
-
- LastLabel = LandingPad->EndLabels[P.RangeIndex];
- CallSiteEntry Site = {BeginLabel, LastLabel,
- LandingPad->LandingPadLabel, FirstActions[P.PadIndex]};
-
- assert(Site.BeginLabel && Site.EndLabel && Site.PadLabel &&
- "Invalid landing pad!");
-
- // Try to merge with the previous call-site.
- if (CallSites.size()) {
- CallSiteEntry &Prev = CallSites[CallSites.size()-1];
- if (Site.PadLabel == Prev.PadLabel && Site.Action == Prev.Action) {
- // Extend the range of the previous entry.
- Prev.EndLabel = Site.EndLabel;
- continue;
- }
- }
-
- // Otherwise, create a new call-site.
- CallSites.push_back(Site);
- }
- }
- // If some instruction between the previous try-range and the end of the
- // function may throw, create a call-site entry with no landing pad for the
- // region following the try-range.
- if (MayThrow) {
- CallSiteEntry Site = {LastLabel, 0, 0, 0};
- CallSites.push_back(Site);
- }
-
- // Final tallies.
- unsigned SizeSites = CallSites.size() * (sizeof(int32_t) + // Site start.
- sizeof(int32_t) + // Site length.
- sizeof(int32_t)); // Landing pad.
- for (unsigned i = 0, e = CallSites.size(); i < e; ++i)
- SizeSites += AsmPrinter::SizeULEB128(CallSites[i].Action);
-
- unsigned SizeTypes = TypeInfos.size() * TD->getPointerSize();
-
- unsigned TypeOffset = sizeof(int8_t) + // Call site format
- // Call-site table length
- AsmPrinter::SizeULEB128(SizeSites) +
- SizeSites + SizeActions + SizeTypes;
-
- unsigned TotalSize = sizeof(int8_t) + // LPStart format
- sizeof(int8_t) + // TType format
- AsmPrinter::SizeULEB128(TypeOffset) + // TType base offset
- TypeOffset;
-
- unsigned SizeAlign = (4 - TotalSize) & 3;
-
- // Begin the exception table.
- MCE->emitAlignment(4);
- for (unsigned i = 0; i != SizeAlign; ++i) {
- MCE->emitByte(0);
- // Asm->EOL("Padding");
- }
-
- unsigned char* DwarfExceptionTable = (unsigned char*)MCE->getCurrentPCValue();
-
- // Emit the header.
- MCE->emitByte(dwarf::DW_EH_PE_omit);
- // Asm->EOL("LPStart format (DW_EH_PE_omit)");
- MCE->emitByte(dwarf::DW_EH_PE_absptr);
- // Asm->EOL("TType format (DW_EH_PE_absptr)");
- MCE->emitULEB128Bytes(TypeOffset);
- // Asm->EOL("TType base offset");
- MCE->emitByte(dwarf::DW_EH_PE_udata4);
- // Asm->EOL("Call site format (DW_EH_PE_udata4)");
- MCE->emitULEB128Bytes(SizeSites);
- // Asm->EOL("Call-site table length");
-
- // Emit the landing pad site information.
- for (unsigned i = 0; i < CallSites.size(); ++i) {
- CallSiteEntry &S = CallSites[i];
- intptr_t BeginLabelPtr = 0;
- intptr_t EndLabelPtr = 0;
-
- if (!S.BeginLabel) {
- BeginLabelPtr = (intptr_t)StartFunction;
- if (TD->getPointerSize() == sizeof(int32_t))
- MCE->emitInt32(0);
- else
- MCE->emitInt64(0);
- } else {
- BeginLabelPtr = MCE->getLabelAddress(S.BeginLabel);
- if (TD->getPointerSize() == sizeof(int32_t))
- MCE->emitInt32(BeginLabelPtr - (intptr_t)StartFunction);
- else
- MCE->emitInt64(BeginLabelPtr - (intptr_t)StartFunction);
- }
-
- // Asm->EOL("Region start");
-
- if (!S.EndLabel) {
- EndLabelPtr = (intptr_t)EndFunction;
- if (TD->getPointerSize() == sizeof(int32_t))
- MCE->emitInt32((intptr_t)EndFunction - BeginLabelPtr);
- else
- MCE->emitInt64((intptr_t)EndFunction - BeginLabelPtr);
- } else {
- EndLabelPtr = MCE->getLabelAddress(S.EndLabel);
- if (TD->getPointerSize() == sizeof(int32_t))
- MCE->emitInt32(EndLabelPtr - BeginLabelPtr);
- else
- MCE->emitInt64(EndLabelPtr - BeginLabelPtr);
- }
- //Asm->EOL("Region length");
-
- if (!S.PadLabel) {
- if (TD->getPointerSize() == sizeof(int32_t))
- MCE->emitInt32(0);
- else
- MCE->emitInt64(0);
- } else {
- unsigned PadLabelPtr = MCE->getLabelAddress(S.PadLabel);
- if (TD->getPointerSize() == sizeof(int32_t))
- MCE->emitInt32(PadLabelPtr - (intptr_t)StartFunction);
- else
- MCE->emitInt64(PadLabelPtr - (intptr_t)StartFunction);
- }
- // Asm->EOL("Landing pad");
-
- MCE->emitULEB128Bytes(S.Action);
- // Asm->EOL("Action");
- }
-
- // Emit the actions.
- for (unsigned I = 0, N = Actions.size(); I != N; ++I) {
- ActionEntry &Action = Actions[I];
-
- MCE->emitSLEB128Bytes(Action.ValueForTypeID);
- //Asm->EOL("TypeInfo index");
- MCE->emitSLEB128Bytes(Action.NextAction);
- //Asm->EOL("Next action");
- }
-
- // Emit the type ids.
- for (unsigned M = TypeInfos.size(); M; --M) {
- GlobalVariable *GV = TypeInfos[M - 1];
-
- if (GV) {
- if (TD->getPointerSize() == sizeof(int32_t)) {
- MCE->emitInt32((intptr_t)Jit.getOrEmitGlobalVariable(GV));
- } else {
- MCE->emitInt64((intptr_t)Jit.getOrEmitGlobalVariable(GV));
- }
- } else {
- if (TD->getPointerSize() == sizeof(int32_t))
- MCE->emitInt32(0);
- else
- MCE->emitInt64(0);
- }
- // Asm->EOL("TypeInfo");
- }
-
- // Emit the filter typeids.
- for (unsigned j = 0, M = FilterIds.size(); j < M; ++j) {
- unsigned TypeID = FilterIds[j];
- MCE->emitULEB128Bytes(TypeID);
- //Asm->EOL("Filter TypeInfo index");
- }
-
- MCE->emitAlignment(4);
-
- return DwarfExceptionTable;
-}
-
-unsigned char*
-JITDwarfEmitter::EmitCommonEHFrame(const Function* Personality) const {
- unsigned PointerSize = TD->getPointerSize();
- int stackGrowth = stackGrowthDirection == TargetFrameInfo::StackGrowsUp ?
- PointerSize : -PointerSize;
-
- unsigned char* StartCommonPtr = (unsigned char*)MCE->getCurrentPCValue();
- // EH Common Frame header
- MCE->allocateSpace(PointerSize, 0);
- unsigned char* FrameCommonBeginPtr = (unsigned char*)MCE->getCurrentPCValue();
- MCE->emitInt32((int)0);
- MCE->emitByte(dwarf::DW_CIE_VERSION);
- MCE->emitString(Personality ? "zPLR" : "zR");
- MCE->emitULEB128Bytes(1);
- MCE->emitSLEB128Bytes(stackGrowth);
- MCE->emitByte(RI->getDwarfRegNum(RI->getRARegister(), true));
-
- if (Personality) {
- MCE->emitULEB128Bytes(7);
-
- if (needsIndirectEncoding)
- MCE->emitByte(dwarf::DW_EH_PE_pcrel | dwarf::DW_EH_PE_sdata4 |
- dwarf::DW_EH_PE_indirect);
- else
- MCE->emitByte(dwarf::DW_EH_PE_pcrel | dwarf::DW_EH_PE_sdata4);
-
- if (PointerSize == 8)
- MCE->emitInt64((intptr_t)Jit.getPointerToGlobal(Personality) -
- MCE->getCurrentPCValue());
- else
- MCE->emitInt32((intptr_t)Jit.getPointerToGlobal(Personality) -
- MCE->getCurrentPCValue());
-
- MCE->emitULEB128Bytes(dwarf::DW_EH_PE_pcrel);
- MCE->emitULEB128Bytes(dwarf::DW_EH_PE_pcrel);
-
- } else {
- MCE->emitULEB128Bytes(1);
- MCE->emitULEB128Bytes(dwarf::DW_EH_PE_pcrel);
- }
-
- std::vector<MachineMove> Moves;
- RI->getInitialFrameState(Moves);
- EmitFrameMoves(0, Moves);
- MCE->emitAlignment(4);
-
- MCE->emitAt((uintptr_t*)StartCommonPtr,
- (uintptr_t)((unsigned char*)MCE->getCurrentPCValue() -
- FrameCommonBeginPtr));
-
- return StartCommonPtr;
-}
-
-
-unsigned char*
-JITDwarfEmitter::EmitEHFrame(const Function* Personality,
- unsigned char* StartCommonPtr,
- unsigned char* StartFunction,
- unsigned char* EndFunction,
- unsigned char* ExceptionTable) const {
- unsigned PointerSize = TD->getPointerSize();
-
- // EH frame header.
- unsigned char* StartEHPtr = (unsigned char*)MCE->getCurrentPCValue();
- MCE->allocateSpace(PointerSize, 0);
- unsigned char* FrameBeginPtr = (unsigned char*)MCE->getCurrentPCValue();
- // FDE CIE Offset
- if (PointerSize == 8) {
- MCE->emitInt64(FrameBeginPtr - StartCommonPtr);
- MCE->emitInt64(StartFunction - (unsigned char*)MCE->getCurrentPCValue());
- MCE->emitInt64(EndFunction - StartFunction);
- } else {
- MCE->emitInt32(FrameBeginPtr - StartCommonPtr);
- MCE->emitInt32(StartFunction - (unsigned char*)MCE->getCurrentPCValue());
- MCE->emitInt32(EndFunction - StartFunction);
- }
-
- // If there is a personality and landing pads then point to the language
- // specific data area in the exception table.
- if (MMI->getPersonalityIndex()) {
- MCE->emitULEB128Bytes(4);
-
- if (!MMI->getLandingPads().empty()) {
- if (PointerSize == 8)
- MCE->emitInt64(ExceptionTable - (unsigned char*)MCE->getCurrentPCValue());
- else
- MCE->emitInt32(ExceptionTable - (unsigned char*)MCE->getCurrentPCValue());
- } else if (PointerSize == 8) {
- MCE->emitInt64((int)0);
- } else {
- MCE->emitInt32((int)0);
- }
- } else {
- MCE->emitULEB128Bytes(0);
- }
-
- // Indicate locations of function specific callee saved registers in
- // frame.
- EmitFrameMoves((intptr_t)StartFunction, MMI->getFrameMoves());
-
- MCE->emitAlignment(4);
-
- // Indicate the size of the table
- MCE->emitAt((uintptr_t*)StartEHPtr,
- (uintptr_t)((unsigned char*)MCE->getCurrentPCValue() -
- StartEHPtr));
-
- // Double zeroes for the unwind runtime
- if (PointerSize == 8) {
- MCE->emitInt64(0);
- MCE->emitInt64(0);
- } else {
- MCE->emitInt32(0);
- MCE->emitInt32(0);
- }
-
-
- return StartEHPtr;
-}
-
-unsigned JITDwarfEmitter::GetDwarfTableSizeInBytes(MachineFunction& F,
- MachineCodeEmitter& mce,
- unsigned char* StartFunction,
- unsigned char* EndFunction) {
- const TargetMachine& TM = F.getTarget();
- TD = TM.getTargetData();
- needsIndirectEncoding = TM.getTargetAsmInfo()->getNeedsIndirectEncoding();
- stackGrowthDirection = TM.getFrameInfo()->getStackGrowthDirection();
- RI = TM.getRegisterInfo();
- MCE = &mce;
- unsigned FinalSize = 0;
-
- FinalSize += GetExceptionTableSizeInBytes(&F);
-
- const std::vector<Function *> Personalities = MMI->getPersonalities();
- FinalSize += GetCommonEHFrameSizeInBytes(Personalities[MMI->getPersonalityIndex()]);
-
- FinalSize += GetEHFrameSizeInBytes(Personalities[MMI->getPersonalityIndex()], StartFunction);
-
- return FinalSize;
-}
-
-/// RoundUpToAlign - Add the specified alignment to FinalSize and returns
-/// the new value.
-static unsigned RoundUpToAlign(unsigned FinalSize, unsigned Alignment) {
- if (Alignment == 0) Alignment = 1;
- // Since we do not know where the buffer will be allocated, be pessimistic.
- return FinalSize + Alignment;
-}
-
-unsigned
-JITDwarfEmitter::GetEHFrameSizeInBytes(const Function* Personality,
- unsigned char* StartFunction) const {
- unsigned PointerSize = TD->getPointerSize();
- unsigned FinalSize = 0;
- // EH frame header.
- FinalSize += PointerSize;
- // FDE CIE Offset
- FinalSize += 3 * PointerSize;
- // If there is a personality and landing pads then point to the language
- // specific data area in the exception table.
- if (MMI->getPersonalityIndex()) {
- FinalSize += AsmPrinter::SizeULEB128(4);
- FinalSize += PointerSize;
- } else {
- FinalSize += AsmPrinter::SizeULEB128(0);
- }
-
- // Indicate locations of function specific callee saved registers in
- // frame.
- FinalSize += GetFrameMovesSizeInBytes((intptr_t)StartFunction,
- MMI->getFrameMoves());
-
- FinalSize = RoundUpToAlign(FinalSize, 4);
-
- // Double zeroes for the unwind runtime
- FinalSize += 2 * PointerSize;
-
- return FinalSize;
-}
-
-unsigned JITDwarfEmitter::GetCommonEHFrameSizeInBytes(const Function* Personality)
- const {
-
- unsigned PointerSize = TD->getPointerSize();
- int stackGrowth = stackGrowthDirection == TargetFrameInfo::StackGrowsUp ?
- PointerSize : -PointerSize;
- unsigned FinalSize = 0;
- // EH Common Frame header
- FinalSize += PointerSize;
- FinalSize += 4;
- FinalSize += 1;
- FinalSize += Personality ? 5 : 3; // "zPLR" or "zR"
- FinalSize += AsmPrinter::SizeULEB128(1);
- FinalSize += AsmPrinter::SizeSLEB128(stackGrowth);
- FinalSize += 1;
-
- if (Personality) {
- FinalSize += AsmPrinter::SizeULEB128(7);
-
- // Encoding
- FinalSize+= 1;
- //Personality
- FinalSize += PointerSize;
-
- FinalSize += AsmPrinter::SizeULEB128(dwarf::DW_EH_PE_pcrel);
- FinalSize += AsmPrinter::SizeULEB128(dwarf::DW_EH_PE_pcrel);
-
- } else {
- FinalSize += AsmPrinter::SizeULEB128(1);
- FinalSize += AsmPrinter::SizeULEB128(dwarf::DW_EH_PE_pcrel);
- }
-
- std::vector<MachineMove> Moves;
- RI->getInitialFrameState(Moves);
- FinalSize += GetFrameMovesSizeInBytes(0, Moves);
- FinalSize = RoundUpToAlign(FinalSize, 4);
- return FinalSize;
-}
-
-unsigned
-JITDwarfEmitter::GetFrameMovesSizeInBytes(intptr_t BaseLabelPtr,
- const std::vector<MachineMove> &Moves) const {
- unsigned PointerSize = TD->getPointerSize();
- int stackGrowth = stackGrowthDirection == TargetFrameInfo::StackGrowsUp ?
- PointerSize : -PointerSize;
- bool IsLocal = BaseLabelPtr;
- unsigned FinalSize = 0;
-
- for (unsigned i = 0, N = Moves.size(); i < N; ++i) {
- const MachineMove &Move = Moves[i];
- unsigned LabelID = Move.getLabelID();
-
- if (LabelID) {
- LabelID = MMI->MappedLabel(LabelID);
-
- // Throw out move if the label is invalid.
- if (!LabelID) continue;
- }
-
- intptr_t LabelPtr = 0;
- if (LabelID) LabelPtr = MCE->getLabelAddress(LabelID);
-
- const MachineLocation &Dst = Move.getDestination();
- const MachineLocation &Src = Move.getSource();
-
- // Advance row if new location.
- if (BaseLabelPtr && LabelID && (BaseLabelPtr != LabelPtr || !IsLocal)) {
- FinalSize++;
- FinalSize += PointerSize;
- BaseLabelPtr = LabelPtr;
- IsLocal = true;
- }
-
- // If advancing cfa.
- if (Dst.isRegister() && Dst.getRegister() == MachineLocation::VirtualFP) {
- if (!Src.isRegister()) {
- if (Src.getRegister() == MachineLocation::VirtualFP) {
- ++FinalSize;
- } else {
- ++FinalSize;
- unsigned RegNum = RI->getDwarfRegNum(Src.getRegister(), true);
- FinalSize += AsmPrinter::SizeULEB128(RegNum);
- }
-
- int Offset = -Src.getOffset();
-
- FinalSize += AsmPrinter::SizeULEB128(Offset);
- } else {
- assert(0 && "Machine move no supported yet.");
- }
- } else if (Src.isRegister() &&
- Src.getRegister() == MachineLocation::VirtualFP) {
- if (Dst.isRegister()) {
- ++FinalSize;
- unsigned RegNum = RI->getDwarfRegNum(Dst.getRegister(), true);
- FinalSize += AsmPrinter::SizeULEB128(RegNum);
- } else {
- assert(0 && "Machine move no supported yet.");
- }
- } else {
- unsigned Reg = RI->getDwarfRegNum(Src.getRegister(), true);
- int Offset = Dst.getOffset() / stackGrowth;
-
- if (Offset < 0) {
- ++FinalSize;
- FinalSize += AsmPrinter::SizeULEB128(Reg);
- FinalSize += AsmPrinter::SizeSLEB128(Offset);
- } else if (Reg < 64) {
- ++FinalSize;
- FinalSize += AsmPrinter::SizeULEB128(Offset);
- } else {
- ++FinalSize;
- FinalSize += AsmPrinter::SizeULEB128(Reg);
- FinalSize += AsmPrinter::SizeULEB128(Offset);
- }
- }
- }
- return FinalSize;
-}
-
-unsigned
-JITDwarfEmitter::GetExceptionTableSizeInBytes(MachineFunction* MF) const {
- unsigned FinalSize = 0;
-
- // Map all labels and get rid of any dead landing pads.
- MMI->TidyLandingPads();
-
- const std::vector<GlobalVariable *> &TypeInfos = MMI->getTypeInfos();
- const std::vector<unsigned> &FilterIds = MMI->getFilterIds();
- const std::vector<LandingPadInfo> &PadInfos = MMI->getLandingPads();
- if (PadInfos.empty()) return 0;
-
- // Sort the landing pads in order of their type ids. This is used to fold
- // duplicate actions.
- SmallVector<const LandingPadInfo *, 64> LandingPads;
- LandingPads.reserve(PadInfos.size());
- for (unsigned i = 0, N = PadInfos.size(); i != N; ++i)
- LandingPads.push_back(&PadInfos[i]);
- std::sort(LandingPads.begin(), LandingPads.end(), PadLT);
-
- // Negative type ids index into FilterIds, positive type ids index into
- // TypeInfos. The value written for a positive type id is just the type
- // id itself. For a negative type id, however, the value written is the
- // (negative) byte offset of the corresponding FilterIds entry. The byte
- // offset is usually equal to the type id, because the FilterIds entries
- // are written using a variable width encoding which outputs one byte per
- // entry as long as the value written is not too large, but can differ.
- // This kind of complication does not occur for positive type ids because
- // type infos are output using a fixed width encoding.
- // FilterOffsets[i] holds the byte offset corresponding to FilterIds[i].
- SmallVector<int, 16> FilterOffsets;
- FilterOffsets.reserve(FilterIds.size());
- int Offset = -1;
- for(std::vector<unsigned>::const_iterator I = FilterIds.begin(),
- E = FilterIds.end(); I != E; ++I) {
- FilterOffsets.push_back(Offset);
- Offset -= AsmPrinter::SizeULEB128(*I);
- }
-
- // Compute the actions table and gather the first action index for each
- // landing pad site.
- SmallVector<ActionEntry, 32> Actions;
- SmallVector<unsigned, 64> FirstActions;
- FirstActions.reserve(LandingPads.size());
-
- int FirstAction = 0;
- unsigned SizeActions = 0;
- for (unsigned i = 0, N = LandingPads.size(); i != N; ++i) {
- const LandingPadInfo *LP = LandingPads[i];
- const std::vector<int> &TypeIds = LP->TypeIds;
- const unsigned NumShared = i ? SharedTypeIds(LP, LandingPads[i-1]) : 0;
- unsigned SizeSiteActions = 0;
-
- if (NumShared < TypeIds.size()) {
- unsigned SizeAction = 0;
- ActionEntry *PrevAction = 0;
-
- if (NumShared) {
- const unsigned SizePrevIds = LandingPads[i-1]->TypeIds.size();
- assert(Actions.size());
- PrevAction = &Actions.back();
- SizeAction = AsmPrinter::SizeSLEB128(PrevAction->NextAction) +
- AsmPrinter::SizeSLEB128(PrevAction->ValueForTypeID);
- for (unsigned j = NumShared; j != SizePrevIds; ++j) {
- SizeAction -= AsmPrinter::SizeSLEB128(PrevAction->ValueForTypeID);
- SizeAction += -PrevAction->NextAction;
- PrevAction = PrevAction->Previous;
- }
- }
-
- // Compute the actions.
- for (unsigned I = NumShared, M = TypeIds.size(); I != M; ++I) {
- int TypeID = TypeIds[I];
- assert(-1-TypeID < (int)FilterOffsets.size() && "Unknown filter id!");
- int ValueForTypeID = TypeID < 0 ? FilterOffsets[-1 - TypeID] : TypeID;
- unsigned SizeTypeID = AsmPrinter::SizeSLEB128(ValueForTypeID);
-
- int NextAction = SizeAction ? -(SizeAction + SizeTypeID) : 0;
- SizeAction = SizeTypeID + AsmPrinter::SizeSLEB128(NextAction);
- SizeSiteActions += SizeAction;
-
- ActionEntry Action = {ValueForTypeID, NextAction, PrevAction};
- Actions.push_back(Action);
-
- PrevAction = &Actions.back();
- }
-
- // Record the first action of the landing pad site.
- FirstAction = SizeActions + SizeSiteActions - SizeAction + 1;
- } // else identical - re-use previous FirstAction
-
- FirstActions.push_back(FirstAction);
-
- // Compute this sites contribution to size.
- SizeActions += SizeSiteActions;
- }
-
- // Compute the call-site table. Entries must be ordered by address.
- SmallVector<CallSiteEntry, 64> CallSites;
-
- RangeMapType PadMap;
- for (unsigned i = 0, N = LandingPads.size(); i != N; ++i) {
- const LandingPadInfo *LandingPad = LandingPads[i];
- for (unsigned j=0, E = LandingPad->BeginLabels.size(); j != E; ++j) {
- unsigned BeginLabel = LandingPad->BeginLabels[j];
- assert(!PadMap.count(BeginLabel) && "Duplicate landing pad labels!");
- PadRange P = { i, j };
- PadMap[BeginLabel] = P;
- }
- }
-
- bool MayThrow = false;
- unsigned LastLabel = 0;
- for (MachineFunction::const_iterator I = MF->begin(), E = MF->end();
- I != E; ++I) {
- for (MachineBasicBlock::const_iterator MI = I->begin(), E = I->end();
- MI != E; ++MI) {
- if (MI->getOpcode() != TargetInstrInfo::LABEL) {
- MayThrow |= MI->getDesc().isCall();
- continue;
- }
-
- unsigned BeginLabel = MI->getOperand(0).getImm();
- assert(BeginLabel && "Invalid label!");
-
- if (BeginLabel == LastLabel)
- MayThrow = false;
-
- RangeMapType::iterator L = PadMap.find(BeginLabel);
-
- if (L == PadMap.end())
- continue;
-
- PadRange P = L->second;
- const LandingPadInfo *LandingPad = LandingPads[P.PadIndex];
-
- assert(BeginLabel == LandingPad->BeginLabels[P.RangeIndex] &&
- "Inconsistent landing pad map!");
-
- // If some instruction between the previous try-range and this one may
- // throw, create a call-site entry with no landing pad for the region
- // between the try-ranges.
- if (MayThrow) {
- CallSiteEntry Site = {LastLabel, BeginLabel, 0, 0};
- CallSites.push_back(Site);
- }
-
- LastLabel = LandingPad->EndLabels[P.RangeIndex];
- CallSiteEntry Site = {BeginLabel, LastLabel,
- LandingPad->LandingPadLabel, FirstActions[P.PadIndex]};
-
- assert(Site.BeginLabel && Site.EndLabel && Site.PadLabel &&
- "Invalid landing pad!");
-
- // Try to merge with the previous call-site.
- if (CallSites.size()) {
- CallSiteEntry &Prev = CallSites[CallSites.size()-1];
- if (Site.PadLabel == Prev.PadLabel && Site.Action == Prev.Action) {
- // Extend the range of the previous entry.
- Prev.EndLabel = Site.EndLabel;
- continue;
- }
- }
-
- // Otherwise, create a new call-site.
- CallSites.push_back(Site);
- }
- }
- // If some instruction between the previous try-range and the end of the
- // function may throw, create a call-site entry with no landing pad for the
- // region following the try-range.
- if (MayThrow) {
- CallSiteEntry Site = {LastLabel, 0, 0, 0};
- CallSites.push_back(Site);
- }
-
- // Final tallies.
- unsigned SizeSites = CallSites.size() * (sizeof(int32_t) + // Site start.
- sizeof(int32_t) + // Site length.
- sizeof(int32_t)); // Landing pad.
- for (unsigned i = 0, e = CallSites.size(); i < e; ++i)
- SizeSites += AsmPrinter::SizeULEB128(CallSites[i].Action);
-
- unsigned SizeTypes = TypeInfos.size() * TD->getPointerSize();
-
- unsigned TypeOffset = sizeof(int8_t) + // Call site format
- // Call-site table length
- AsmPrinter::SizeULEB128(SizeSites) +
- SizeSites + SizeActions + SizeTypes;
-
- unsigned TotalSize = sizeof(int8_t) + // LPStart format
- sizeof(int8_t) + // TType format
- AsmPrinter::SizeULEB128(TypeOffset) + // TType base offset
- TypeOffset;
-
- unsigned SizeAlign = (4 - TotalSize) & 3;
-
- // Begin the exception table.
- FinalSize = RoundUpToAlign(FinalSize, 4);
- for (unsigned i = 0; i != SizeAlign; ++i) {
- ++FinalSize;
- }
-
- unsigned PointerSize = TD->getPointerSize();
-
- // Emit the header.
- ++FinalSize;
- // Asm->EOL("LPStart format (DW_EH_PE_omit)");
- ++FinalSize;
- // Asm->EOL("TType format (DW_EH_PE_absptr)");
- ++FinalSize;
- // Asm->EOL("TType base offset");
- ++FinalSize;
- // Asm->EOL("Call site format (DW_EH_PE_udata4)");
- ++FinalSize;
- // Asm->EOL("Call-site table length");
-
- // Emit the landing pad site information.
- for (unsigned i = 0; i < CallSites.size(); ++i) {
- CallSiteEntry &S = CallSites[i];
-
- // Asm->EOL("Region start");
- FinalSize += PointerSize;
-
- //Asm->EOL("Region length");
- FinalSize += PointerSize;
-
- // Asm->EOL("Landing pad");
- FinalSize += PointerSize;
-
- FinalSize += AsmPrinter::SizeULEB128(S.Action);
- // Asm->EOL("Action");
- }
-
- // Emit the actions.
- for (unsigned I = 0, N = Actions.size(); I != N; ++I) {
- ActionEntry &Action = Actions[I];
-
- //Asm->EOL("TypeInfo index");
- FinalSize += AsmPrinter::SizeSLEB128(Action.ValueForTypeID);
- //Asm->EOL("Next action");
- FinalSize += AsmPrinter::SizeSLEB128(Action.NextAction);
- }
-
- // Emit the type ids.
- for (unsigned M = TypeInfos.size(); M; --M) {
- // Asm->EOL("TypeInfo");
- FinalSize += PointerSize;
- }
-
- // Emit the filter typeids.
- for (unsigned j = 0, M = FilterIds.size(); j < M; ++j) {
- unsigned TypeID = FilterIds[j];
- FinalSize += AsmPrinter::SizeULEB128(TypeID);
- //Asm->EOL("Filter TypeInfo index");
- }
-
- FinalSize = RoundUpToAlign(FinalSize, 4);
-
- return FinalSize;
-}
diff --git a/release_23/lib/ExecutionEngine/JIT/JITDwarfEmitter.h b/release_23/lib/ExecutionEngine/JIT/JITDwarfEmitter.h
deleted file mode 100644
index cf5681e3c1ca..000000000000
--- a/release_23/lib/ExecutionEngine/JIT/JITDwarfEmitter.h
+++ /dev/null
@@ -1,87 +0,0 @@
-//===------ JITDwarfEmitter.h - Write dwarf tables into memory ------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines a JITDwarfEmitter object that is used by the JIT to
-// write dwarf tables to memory.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_EXECUTION_ENGINE_JIT_DWARFEMITTER_H
-#define LLVM_EXECUTION_ENGINE_JIT_DWARFEMITTER_H
-
-namespace llvm {
-
-class Function;
-class MachineCodeEmitter;
-class MachineFunction;
-class MachineModuleInfo;
-class MachineMove;
-class TargetData;
-class TargetMachine;
-class TargetRegisterInfo;
-
-class JITDwarfEmitter {
- const TargetData* TD;
- MachineCodeEmitter* MCE;
- const TargetRegisterInfo* RI;
- MachineModuleInfo* MMI;
- JIT& Jit;
- bool needsIndirectEncoding;
- bool stackGrowthDirection;
-
- unsigned char* EmitExceptionTable(MachineFunction* MF,
- unsigned char* StartFunction,
- unsigned char* EndFunction) const;
-
- void EmitFrameMoves(intptr_t BaseLabelPtr,
- const std::vector<MachineMove> &Moves) const;
-
- unsigned char* EmitCommonEHFrame(const Function* Personality) const;
-
- unsigned char* EmitEHFrame(const Function* Personality,
- unsigned char* StartBufferPtr,
- unsigned char* StartFunction,
- unsigned char* EndFunction,
- unsigned char* ExceptionTable) const;
-
- unsigned GetExceptionTableSizeInBytes(MachineFunction* MF) const;
-
- unsigned
- GetFrameMovesSizeInBytes(intptr_t BaseLabelPtr,
- const std::vector<MachineMove> &Moves) const;
-
- unsigned GetCommonEHFrameSizeInBytes(const Function* Personality) const;
-
- unsigned GetEHFrameSizeInBytes(const Function* Personality,
- unsigned char* StartFunction) const;
-
-public:
-
- JITDwarfEmitter(JIT& jit);
-
- unsigned char* EmitDwarfTable(MachineFunction& F,
- MachineCodeEmitter& MCE,
- unsigned char* StartFunction,
- unsigned char* EndFunction);
-
-
- unsigned GetDwarfTableSizeInBytes(MachineFunction& F,
- MachineCodeEmitter& MCE,
- unsigned char* StartFunction,
- unsigned char* EndFunction);
-
- void setModuleInfo(MachineModuleInfo* Info) {
- MMI = Info;
- }
-};
-
-
-} // end namespace llvm
-
-#endif // LLVM_EXECUTION_ENGINE_JIT_DWARFEMITTER_H
diff --git a/release_23/lib/ExecutionEngine/JIT/JITEmitter.cpp b/release_23/lib/ExecutionEngine/JIT/JITEmitter.cpp
deleted file mode 100644
index f0857c100efc..000000000000
--- a/release_23/lib/ExecutionEngine/JIT/JITEmitter.cpp
+++ /dev/null
@@ -1,988 +0,0 @@
-//===-- JITEmitter.cpp - Write machine code to executable memory ----------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines a MachineCodeEmitter object that is used by the JIT to
-// write machine code to memory and remember where relocatable values are.
-//
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "jit"
-#include "JIT.h"
-#include "JITDwarfEmitter.h"
-#include "llvm/Constant.h"
-#include "llvm/Module.h"
-#include "llvm/Type.h"
-#include "llvm/CodeGen/MachineCodeEmitter.h"
-#include "llvm/CodeGen/MachineFunction.h"
-#include "llvm/CodeGen/MachineConstantPool.h"
-#include "llvm/CodeGen/MachineJumpTableInfo.h"
-#include "llvm/CodeGen/MachineModuleInfo.h"
-#include "llvm/CodeGen/MachineRelocation.h"
-#include "llvm/ExecutionEngine/JITMemoryManager.h"
-#include "llvm/Target/TargetData.h"
-#include "llvm/Target/TargetJITInfo.h"
-#include "llvm/Target/TargetMachine.h"
-#include "llvm/Target/TargetOptions.h"
-#include "llvm/Support/Debug.h"
-#include "llvm/Support/MutexGuard.h"
-#include "llvm/System/Disassembler.h"
-#include "llvm/Target/TargetInstrInfo.h"
-#include "llvm/ADT/Statistic.h"
-#include <algorithm>
-using namespace llvm;
-
-STATISTIC(NumBytes, "Number of bytes of machine code compiled");
-STATISTIC(NumRelos, "Number of relocations applied");
-static JIT *TheJIT = 0;
-
-
-//===----------------------------------------------------------------------===//
-// JIT lazy compilation code.
-//
-namespace {
- class JITResolverState {
- private:
- /// FunctionToStubMap - Keep track of the stub created for a particular
- /// function so that we can reuse them if necessary.
- std::map<Function*, void*> FunctionToStubMap;
-
- /// StubToFunctionMap - Keep track of the function that each stub
- /// corresponds to.
- std::map<void*, Function*> StubToFunctionMap;
-
- /// GlobalToLazyPtrMap - Keep track of the lazy pointer created for a
- /// particular GlobalVariable so that we can reuse them if necessary.
- std::map<GlobalValue*, void*> GlobalToLazyPtrMap;
-
- public:
- std::map<Function*, void*>& getFunctionToStubMap(const MutexGuard& locked) {
- assert(locked.holds(TheJIT->lock));
- return FunctionToStubMap;
- }
-
- std::map<void*, Function*>& getStubToFunctionMap(const MutexGuard& locked) {
- assert(locked.holds(TheJIT->lock));
- return StubToFunctionMap;
- }
-
- std::map<GlobalValue*, void*>&
- getGlobalToLazyPtrMap(const MutexGuard& locked) {
- assert(locked.holds(TheJIT->lock));
- return GlobalToLazyPtrMap;
- }
- };
-
- /// JITResolver - Keep track of, and resolve, call sites for functions that
- /// have not yet been compiled.
- class JITResolver {
- /// LazyResolverFn - The target lazy resolver function that we actually
- /// rewrite instructions to use.
- TargetJITInfo::LazyResolverFn LazyResolverFn;
-
- JITResolverState state;
-
- /// ExternalFnToStubMap - This is the equivalent of FunctionToStubMap for
- /// external functions.
- std::map<void*, void*> ExternalFnToStubMap;
-
- //map addresses to indexes in the GOT
- std::map<void*, unsigned> revGOTMap;
- unsigned nextGOTIndex;
-
- static JITResolver *TheJITResolver;
- public:
- explicit JITResolver(JIT &jit) : nextGOTIndex(0) {
- TheJIT = &jit;
-
- LazyResolverFn = jit.getJITInfo().getLazyResolverFunction(JITCompilerFn);
- assert(TheJITResolver == 0 && "Multiple JIT resolvers?");
- TheJITResolver = this;
- }
-
- ~JITResolver() {
- TheJITResolver = 0;
- }
-
- /// getFunctionStub - This returns a pointer to a function stub, creating
- /// one on demand as needed.
- void *getFunctionStub(Function *F);
-
- /// getExternalFunctionStub - Return a stub for the function at the
- /// specified address, created lazily on demand.
- void *getExternalFunctionStub(void *FnAddr);
-
- /// getGlobalValueLazyPtr - Return a lazy pointer containing the specified
- /// GV address.
- void *getGlobalValueLazyPtr(GlobalValue *V, void *GVAddress);
-
- /// AddCallbackAtLocation - If the target is capable of rewriting an
- /// instruction without the use of a stub, record the location of the use so
- /// we know which function is being used at the location.
- void *AddCallbackAtLocation(Function *F, void *Location) {
- MutexGuard locked(TheJIT->lock);
- /// Get the target-specific JIT resolver function.
- state.getStubToFunctionMap(locked)[Location] = F;
- return (void*)(intptr_t)LazyResolverFn;
- }
-
- /// getGOTIndexForAddress - Return a new or existing index in the GOT for
- /// an address. This function only manages slots, it does not manage the
- /// contents of the slots or the memory associated with the GOT.
- unsigned getGOTIndexForAddr(void *addr);
-
- /// JITCompilerFn - This function is called to resolve a stub to a compiled
- /// address. If the LLVM Function corresponding to the stub has not yet
- /// been compiled, this function compiles it first.
- static void *JITCompilerFn(void *Stub);
- };
-}
-
-JITResolver *JITResolver::TheJITResolver = 0;
-
-#if (defined(__POWERPC__) || defined (__ppc__) || defined(_POWER)) && \
- defined(__APPLE__)
-extern "C" void sys_icache_invalidate(const void *Addr, size_t len);
-#endif
-
-/// synchronizeICache - On some targets, the JIT emitted code must be
-/// explicitly refetched to ensure correct execution.
-static void synchronizeICache(const void *Addr, size_t len) {
-#if (defined(__POWERPC__) || defined (__ppc__) || defined(_POWER)) && \
- defined(__APPLE__)
- sys_icache_invalidate(Addr, len);
-#endif
-}
-
-/// getFunctionStub - This returns a pointer to a function stub, creating
-/// one on demand as needed.
-void *JITResolver::getFunctionStub(Function *F) {
- MutexGuard locked(TheJIT->lock);
-
- // If we already have a stub for this function, recycle it.
- void *&Stub = state.getFunctionToStubMap(locked)[F];
- if (Stub) return Stub;
-
- // Call the lazy resolver function unless we already KNOW it is an external
- // function, in which case we just skip the lazy resolution step.
- void *Actual = (void*)(intptr_t)LazyResolverFn;
- if (F->isDeclaration() && !F->hasNotBeenReadFromBitcode())
- Actual = TheJIT->getPointerToFunction(F);
-
- // Otherwise, codegen a new stub. For now, the stub will call the lazy
- // resolver function.
- Stub = TheJIT->getJITInfo().emitFunctionStub(F, Actual,
- *TheJIT->getCodeEmitter());
-
- if (Actual != (void*)(intptr_t)LazyResolverFn) {
- // If we are getting the stub for an external function, we really want the
- // address of the stub in the GlobalAddressMap for the JIT, not the address
- // of the external function.
- TheJIT->updateGlobalMapping(F, Stub);
- }
-
- DOUT << "JIT: Stub emitted at [" << Stub << "] for function '"
- << F->getName() << "'\n";
-
- // Finally, keep track of the stub-to-Function mapping so that the
- // JITCompilerFn knows which function to compile!
- state.getStubToFunctionMap(locked)[Stub] = F;
- return Stub;
-}
-
-/// getGlobalValueLazyPtr - Return a lazy pointer containing the specified
-/// GV address.
-void *JITResolver::getGlobalValueLazyPtr(GlobalValue *GV, void *GVAddress) {
- MutexGuard locked(TheJIT->lock);
-
- // If we already have a stub for this global variable, recycle it.
- void *&LazyPtr = state.getGlobalToLazyPtrMap(locked)[GV];
- if (LazyPtr) return LazyPtr;
-
- // Otherwise, codegen a new lazy pointer.
- LazyPtr = TheJIT->getJITInfo().emitGlobalValueLazyPtr(GV, GVAddress,
- *TheJIT->getCodeEmitter());
-
- DOUT << "JIT: Stub emitted at [" << LazyPtr << "] for GV '"
- << GV->getName() << "'\n";
-
- return LazyPtr;
-}
-
-/// getExternalFunctionStub - Return a stub for the function at the
-/// specified address, created lazily on demand.
-void *JITResolver::getExternalFunctionStub(void *FnAddr) {
- // If we already have a stub for this function, recycle it.
- void *&Stub = ExternalFnToStubMap[FnAddr];
- if (Stub) return Stub;
-
- Stub = TheJIT->getJITInfo().emitFunctionStub(0, FnAddr,
- *TheJIT->getCodeEmitter());
-
- DOUT << "JIT: Stub emitted at [" << Stub
- << "] for external function at '" << FnAddr << "'\n";
- return Stub;
-}
-
-unsigned JITResolver::getGOTIndexForAddr(void* addr) {
- unsigned idx = revGOTMap[addr];
- if (!idx) {
- idx = ++nextGOTIndex;
- revGOTMap[addr] = idx;
- DOUT << "Adding GOT entry " << idx << " for addr " << addr << "\n";
- }
- return idx;
-}
-
-/// JITCompilerFn - This function is called when a lazy compilation stub has
-/// been entered. It looks up which function this stub corresponds to, compiles
-/// it if necessary, then returns the resultant function pointer.
-void *JITResolver::JITCompilerFn(void *Stub) {
- JITResolver &JR = *TheJITResolver;
-
- MutexGuard locked(TheJIT->lock);
-
- // The address given to us for the stub may not be exactly right, it might be
- // a little bit after the stub. As such, use upper_bound to find it.
- std::map<void*, Function*>::iterator I =
- JR.state.getStubToFunctionMap(locked).upper_bound(Stub);
- assert(I != JR.state.getStubToFunctionMap(locked).begin() &&
- "This is not a known stub!");
- Function *F = (--I)->second;
-
- // If we have already code generated the function, just return the address.
- void *Result = TheJIT->getPointerToGlobalIfAvailable(F);
-
- if (!Result) {
- // Otherwise we don't have it, do lazy compilation now.
-
- // If lazy compilation is disabled, emit a useful error message and abort.
- if (TheJIT->isLazyCompilationDisabled()) {
- cerr << "LLVM JIT requested to do lazy compilation of function '"
- << F->getName() << "' when lazy compiles are disabled!\n";
- abort();
- }
-
- // We might like to remove the stub from the StubToFunction map.
- // We can't do that! Multiple threads could be stuck, waiting to acquire the
- // lock above. As soon as the 1st function finishes compiling the function,
- // the next one will be released, and needs to be able to find the function
- // it needs to call.
- //JR.state.getStubToFunctionMap(locked).erase(I);
-
- DOUT << "JIT: Lazily resolving function '" << F->getName()
- << "' In stub ptr = " << Stub << " actual ptr = "
- << I->first << "\n";
-
- Result = TheJIT->getPointerToFunction(F);
- }
-
- // We don't need to reuse this stub in the future, as F is now compiled.
- JR.state.getFunctionToStubMap(locked).erase(F);
-
- // FIXME: We could rewrite all references to this stub if we knew them.
-
- // What we will do is set the compiled function address to map to the
- // same GOT entry as the stub so that later clients may update the GOT
- // if they see it still using the stub address.
- // Note: this is done so the Resolver doesn't have to manage GOT memory
- // Do this without allocating map space if the target isn't using a GOT
- if(JR.revGOTMap.find(Stub) != JR.revGOTMap.end())
- JR.revGOTMap[Result] = JR.revGOTMap[Stub];
-
- return Result;
-}
-
-//===----------------------------------------------------------------------===//
-// Function Index Support
-
-// On MacOS we generate an index of currently JIT'd functions so that
-// performance tools can determine a symbol name and accurate code range for a
-// PC value. Because performance tools are generally asynchronous, the code
-// below is written with the hope that it could be interrupted at any time and
-// have useful answers. However, we don't go crazy with atomic operations, we
-// just do a "reasonable effort".
-#ifdef __APPLE__
-#define ENABLE_JIT_SYMBOL_TABLE 1
-#endif
-
-/// JitSymbolEntry - Each function that is JIT compiled results in one of these
-/// being added to an array of symbols. This indicates the name of the function
-/// as well as the address range it occupies. This allows the client to map
-/// from a PC value to the name of the function.
-struct JitSymbolEntry {
- const char *FnName; // FnName - a strdup'd string.
- void *FnStart;
- intptr_t FnSize;
-};
-
-
-struct JitSymbolTable {
- /// NextPtr - This forms a linked list of JitSymbolTable entries. This
- /// pointer is not used right now, but might be used in the future. Consider
- /// it reserved for future use.
- JitSymbolTable *NextPtr;
-
- /// Symbols - This is an array of JitSymbolEntry entries. Only the first
- /// 'NumSymbols' symbols are valid.
- JitSymbolEntry *Symbols;
-
- /// NumSymbols - This indicates the number entries in the Symbols array that
- /// are valid.
- unsigned NumSymbols;
-
- /// NumAllocated - This indicates the amount of space we have in the Symbols
- /// array. This is a private field that should not be read by external tools.
- unsigned NumAllocated;
-};
-
-#if ENABLE_JIT_SYMBOL_TABLE
-JitSymbolTable *__jitSymbolTable;
-#endif
-
-static void AddFunctionToSymbolTable(const char *FnName,
- void *FnStart, intptr_t FnSize) {
- assert(FnName != 0 && FnStart != 0 && "Bad symbol to add");
- JitSymbolTable **SymTabPtrPtr = 0;
-#if !ENABLE_JIT_SYMBOL_TABLE
- return;
-#else
- SymTabPtrPtr = &__jitSymbolTable;
-#endif
-
- // If this is the first entry in the symbol table, add the JitSymbolTable
- // index.
- if (*SymTabPtrPtr == 0) {
- JitSymbolTable *New = new JitSymbolTable();
- New->NextPtr = 0;
- New->Symbols = 0;
- New->NumSymbols = 0;
- New->NumAllocated = 0;
- *SymTabPtrPtr = New;
- }
-
- JitSymbolTable *SymTabPtr = *SymTabPtrPtr;
-
- // If we have space in the table, reallocate the table.
- if (SymTabPtr->NumSymbols >= SymTabPtr->NumAllocated) {
- // If we don't have space, reallocate the table.
- unsigned NewSize = std::max(64U, SymTabPtr->NumAllocated*2);
- JitSymbolEntry *NewSymbols = new JitSymbolEntry[NewSize];
- JitSymbolEntry *OldSymbols = SymTabPtr->Symbols;
-
- // Copy the old entries over.
- memcpy(NewSymbols, OldSymbols,
- SymTabPtr->NumSymbols*sizeof(OldSymbols[0]));
-
- // Swap the new symbols in, delete the old ones.
- SymTabPtr->Symbols = NewSymbols;
- SymTabPtr->NumAllocated = NewSize;
- delete [] OldSymbols;
- }
-
- // Otherwise, we have enough space, just tack it onto the end of the array.
- JitSymbolEntry &Entry = SymTabPtr->Symbols[SymTabPtr->NumSymbols];
- Entry.FnName = strdup(FnName);
- Entry.FnStart = FnStart;
- Entry.FnSize = FnSize;
- ++SymTabPtr->NumSymbols;
-}
-
-static void RemoveFunctionFromSymbolTable(void *FnStart) {
- assert(FnStart && "Invalid function pointer");
- JitSymbolTable **SymTabPtrPtr = 0;
-#if !ENABLE_JIT_SYMBOL_TABLE
- return;
-#else
- SymTabPtrPtr = &__jitSymbolTable;
-#endif
-
- JitSymbolTable *SymTabPtr = *SymTabPtrPtr;
- JitSymbolEntry *Symbols = SymTabPtr->Symbols;
-
- // Scan the table to find its index. The table is not sorted, so do a linear
- // scan.
- unsigned Index;
- for (Index = 0; Symbols[Index].FnStart != FnStart; ++Index)
- assert(Index != SymTabPtr->NumSymbols && "Didn't find function!");
-
- // Once we have an index, we know to nuke this entry, overwrite it with the
- // entry at the end of the array, making the last entry redundant.
- const char *OldName = Symbols[Index].FnName;
- Symbols[Index] = Symbols[SymTabPtr->NumSymbols-1];
- free((void*)OldName);
-
- // Drop the number of symbols in the table.
- --SymTabPtr->NumSymbols;
-
- // Finally, if we deleted the final symbol, deallocate the table itself.
- if (SymTabPtr->NumSymbols == 0)
- return;
-
- *SymTabPtrPtr = 0;
- delete [] Symbols;
- delete SymTabPtr;
-}
-
-//===----------------------------------------------------------------------===//
-// JITEmitter code.
-//
-namespace {
- /// JITEmitter - The JIT implementation of the MachineCodeEmitter, which is
- /// used to output functions to memory for execution.
- class JITEmitter : public MachineCodeEmitter {
- JITMemoryManager *MemMgr;
-
- // When outputting a function stub in the context of some other function, we
- // save BufferBegin/BufferEnd/CurBufferPtr here.
- unsigned char *SavedBufferBegin, *SavedBufferEnd, *SavedCurBufferPtr;
-
- /// Relocations - These are the relocations that the function needs, as
- /// emitted.
- std::vector<MachineRelocation> Relocations;
-
- /// MBBLocations - This vector is a mapping from MBB ID's to their address.
- /// It is filled in by the StartMachineBasicBlock callback and queried by
- /// the getMachineBasicBlockAddress callback.
- std::vector<intptr_t> MBBLocations;
-
- /// ConstantPool - The constant pool for the current function.
- ///
- MachineConstantPool *ConstantPool;
-
- /// ConstantPoolBase - A pointer to the first entry in the constant pool.
- ///
- void *ConstantPoolBase;
-
- /// JumpTable - The jump tables for the current function.
- ///
- MachineJumpTableInfo *JumpTable;
-
- /// JumpTableBase - A pointer to the first entry in the jump table.
- ///
- void *JumpTableBase;
-
- /// Resolver - This contains info about the currently resolved functions.
- JITResolver Resolver;
-
- /// DE - The dwarf emitter for the jit.
- JITDwarfEmitter *DE;
-
- /// LabelLocations - This vector is a mapping from Label ID's to their
- /// address.
- std::vector<intptr_t> LabelLocations;
-
- /// MMI - Machine module info for exception informations
- MachineModuleInfo* MMI;
-
- public:
- JITEmitter(JIT &jit, JITMemoryManager *JMM) : Resolver(jit) {
- MemMgr = JMM ? JMM : JITMemoryManager::CreateDefaultMemManager();
- if (jit.getJITInfo().needsGOT()) {
- MemMgr->AllocateGOT();
- DOUT << "JIT is managing a GOT\n";
- }
-
- if (ExceptionHandling) DE = new JITDwarfEmitter(jit);
- }
- ~JITEmitter() {
- delete MemMgr;
- if (ExceptionHandling) delete DE;
- }
-
- JITResolver &getJITResolver() { return Resolver; }
-
- virtual void startFunction(MachineFunction &F);
- virtual bool finishFunction(MachineFunction &F);
-
- void emitConstantPool(MachineConstantPool *MCP);
- void initJumpTableInfo(MachineJumpTableInfo *MJTI);
- void emitJumpTableInfo(MachineJumpTableInfo *MJTI);
-
- virtual void startFunctionStub(const GlobalValue* F, unsigned StubSize,
- unsigned Alignment = 1);
- virtual void* finishFunctionStub(const GlobalValue *F);
-
- virtual void addRelocation(const MachineRelocation &MR) {
- Relocations.push_back(MR);
- }
-
- virtual void StartMachineBasicBlock(MachineBasicBlock *MBB) {
- if (MBBLocations.size() <= (unsigned)MBB->getNumber())
- MBBLocations.resize((MBB->getNumber()+1)*2);
- MBBLocations[MBB->getNumber()] = getCurrentPCValue();
- }
-
- virtual intptr_t getConstantPoolEntryAddress(unsigned Entry) const;
- virtual intptr_t getJumpTableEntryAddress(unsigned Entry) const;
-
- virtual intptr_t getMachineBasicBlockAddress(MachineBasicBlock *MBB) const {
- assert(MBBLocations.size() > (unsigned)MBB->getNumber() &&
- MBBLocations[MBB->getNumber()] && "MBB not emitted!");
- return MBBLocations[MBB->getNumber()];
- }
-
- /// deallocateMemForFunction - Deallocate all memory for the specified
- /// function body.
- void deallocateMemForFunction(Function *F) {
- MemMgr->deallocateMemForFunction(F);
- }
-
- virtual void emitLabel(uint64_t LabelID) {
- if (LabelLocations.size() <= LabelID)
- LabelLocations.resize((LabelID+1)*2);
- LabelLocations[LabelID] = getCurrentPCValue();
- }
-
- virtual intptr_t getLabelAddress(uint64_t LabelID) const {
- assert(LabelLocations.size() > (unsigned)LabelID &&
- LabelLocations[LabelID] && "Label not emitted!");
- return LabelLocations[LabelID];
- }
-
- virtual void setModuleInfo(MachineModuleInfo* Info) {
- MMI = Info;
- if (ExceptionHandling) DE->setModuleInfo(Info);
- }
-
- private:
- void *getPointerToGlobal(GlobalValue *GV, void *Reference, bool NoNeedStub);
- void *getPointerToGVLazyPtr(GlobalValue *V, void *Reference,
- bool NoNeedStub);
- };
-}
-
-void *JITEmitter::getPointerToGlobal(GlobalValue *V, void *Reference,
- bool DoesntNeedStub) {
- if (GlobalVariable *GV = dyn_cast<GlobalVariable>(V)) {
- /// FIXME: If we straightened things out, this could actually emit the
- /// global immediately instead of queuing it for codegen later!
- return TheJIT->getOrEmitGlobalVariable(GV);
- }
-
- // If we have already compiled the function, return a pointer to its body.
- Function *F = cast<Function>(V);
- void *ResultPtr = TheJIT->getPointerToGlobalIfAvailable(F);
- if (ResultPtr) return ResultPtr;
-
- if (F->isDeclaration() && !F->hasNotBeenReadFromBitcode()) {
- // If this is an external function pointer, we can force the JIT to
- // 'compile' it, which really just adds it to the map.
- if (DoesntNeedStub)
- return TheJIT->getPointerToFunction(F);
-
- return Resolver.getFunctionStub(F);
- }
-
- // Okay, the function has not been compiled yet, if the target callback
- // mechanism is capable of rewriting the instruction directly, prefer to do
- // that instead of emitting a stub.
- if (DoesntNeedStub)
- return Resolver.AddCallbackAtLocation(F, Reference);
-
- // Otherwise, we have to emit a lazy resolving stub.
- return Resolver.getFunctionStub(F);
-}
-
-void *JITEmitter::getPointerToGVLazyPtr(GlobalValue *V, void *Reference,
- bool DoesntNeedStub) {
- // Make sure GV is emitted first.
- // FIXME: For now, if the GV is an external function we force the JIT to
- // compile it so the lazy pointer will contain the fully resolved address.
- void *GVAddress = getPointerToGlobal(V, Reference, true);
- return Resolver.getGlobalValueLazyPtr(V, GVAddress);
-}
-
-static unsigned GetConstantPoolSizeInBytes(MachineConstantPool *MCP) {
- const std::vector<MachineConstantPoolEntry> &Constants = MCP->getConstants();
- if (Constants.empty()) return 0;
-
- MachineConstantPoolEntry CPE = Constants.back();
- unsigned Size = CPE.Offset;
- const Type *Ty = CPE.isMachineConstantPoolEntry()
- ? CPE.Val.MachineCPVal->getType() : CPE.Val.ConstVal->getType();
- Size += TheJIT->getTargetData()->getABITypeSize(Ty);
- return Size;
-}
-
-static unsigned GetJumpTableSizeInBytes(MachineJumpTableInfo *MJTI) {
- const std::vector<MachineJumpTableEntry> &JT = MJTI->getJumpTables();
- if (JT.empty()) return 0;
-
- unsigned NumEntries = 0;
- for (unsigned i = 0, e = JT.size(); i != e; ++i)
- NumEntries += JT[i].MBBs.size();
-
- unsigned EntrySize = MJTI->getEntrySize();
-
- return NumEntries * EntrySize;
-}
-
-static uintptr_t RoundUpToAlign(uintptr_t Size, unsigned Alignment) {
- if (Alignment == 0) Alignment = 1;
- // Since we do not know where the buffer will be allocated, be pessimistic.
- return Size + Alignment;
-}
-
-void JITEmitter::startFunction(MachineFunction &F) {
- uintptr_t ActualSize = 0;
- if (MemMgr->NeedsExactSize()) {
- const TargetInstrInfo* TII = F.getTarget().getInstrInfo();
- MachineJumpTableInfo *MJTI = F.getJumpTableInfo();
- MachineConstantPool *MCP = F.getConstantPool();
-
- // Ensure the constant pool/jump table info is at least 4-byte aligned.
- ActualSize = RoundUpToAlign(ActualSize, 16);
-
- // Add the alignment of the constant pool
- ActualSize = RoundUpToAlign(ActualSize,
- 1 << MCP->getConstantPoolAlignment());
-
- // Add the constant pool size
- ActualSize += GetConstantPoolSizeInBytes(MCP);
-
- // Add the aligment of the jump table info
- ActualSize = RoundUpToAlign(ActualSize, MJTI->getAlignment());
-
- // Add the jump table size
- ActualSize += GetJumpTableSizeInBytes(MJTI);
-
- // Add the alignment for the function
- ActualSize = RoundUpToAlign(ActualSize,
- std::max(F.getFunction()->getAlignment(), 8U));
-
- // Add the function size
- ActualSize += TII->GetFunctionSizeInBytes(F);
- }
-
- BufferBegin = CurBufferPtr = MemMgr->startFunctionBody(F.getFunction(),
- ActualSize);
- BufferEnd = BufferBegin+ActualSize;
-
- // Ensure the constant pool/jump table info is at least 4-byte aligned.
- emitAlignment(16);
-
- emitConstantPool(F.getConstantPool());
- initJumpTableInfo(F.getJumpTableInfo());
-
- // About to start emitting the machine code for the function.
- emitAlignment(std::max(F.getFunction()->getAlignment(), 8U));
- TheJIT->updateGlobalMapping(F.getFunction(), CurBufferPtr);
-
- MBBLocations.clear();
-}
-
-bool JITEmitter::finishFunction(MachineFunction &F) {
- if (CurBufferPtr == BufferEnd) {
- // FIXME: Allocate more space, then try again.
- cerr << "JIT: Ran out of space for generated machine code!\n";
- abort();
- }
-
- emitJumpTableInfo(F.getJumpTableInfo());
-
- // FnStart is the start of the text, not the start of the constant pool and
- // other per-function data.
- unsigned char *FnStart =
- (unsigned char *)TheJIT->getPointerToGlobalIfAvailable(F.getFunction());
- unsigned char *FnEnd = CurBufferPtr;
-
- MemMgr->endFunctionBody(F.getFunction(), BufferBegin, FnEnd);
- NumBytes += FnEnd-FnStart;
-
- if (!Relocations.empty()) {
- NumRelos += Relocations.size();
-
- // Resolve the relocations to concrete pointers.
- for (unsigned i = 0, e = Relocations.size(); i != e; ++i) {
- MachineRelocation &MR = Relocations[i];
- void *ResultPtr;
- if (MR.isString()) {
- ResultPtr = TheJIT->getPointerToNamedFunction(MR.getString());
-
- // If the target REALLY wants a stub for this function, emit it now.
- if (!MR.doesntNeedStub())
- ResultPtr = Resolver.getExternalFunctionStub(ResultPtr);
- } else if (MR.isGlobalValue()) {
- ResultPtr = getPointerToGlobal(MR.getGlobalValue(),
- BufferBegin+MR.getMachineCodeOffset(),
- MR.doesntNeedStub());
- } else if (MR.isGlobalValueLazyPtr()) {
- ResultPtr = getPointerToGVLazyPtr(MR.getGlobalValue(),
- BufferBegin+MR.getMachineCodeOffset(),
- MR.doesntNeedStub());
- } else if (MR.isBasicBlock()) {
- ResultPtr = (void*)getMachineBasicBlockAddress(MR.getBasicBlock());
- } else if (MR.isConstantPoolIndex()) {
- ResultPtr=(void*)getConstantPoolEntryAddress(MR.getConstantPoolIndex());
- } else {
- assert(MR.isJumpTableIndex());
- ResultPtr=(void*)getJumpTableEntryAddress(MR.getJumpTableIndex());
- }
-
- MR.setResultPointer(ResultPtr);
-
- // if we are managing the GOT and the relocation wants an index,
- // give it one
- if (MR.isGOTRelative() && MemMgr->isManagingGOT()) {
- unsigned idx = Resolver.getGOTIndexForAddr(ResultPtr);
- MR.setGOTIndex(idx);
- if (((void**)MemMgr->getGOTBase())[idx] != ResultPtr) {
- DOUT << "GOT was out of date for " << ResultPtr
- << " pointing at " << ((void**)MemMgr->getGOTBase())[idx]
- << "\n";
- ((void**)MemMgr->getGOTBase())[idx] = ResultPtr;
- }
- }
- }
-
- TheJIT->getJITInfo().relocate(BufferBegin, &Relocations[0],
- Relocations.size(), MemMgr->getGOTBase());
- }
-
- // Update the GOT entry for F to point to the new code.
- if (MemMgr->isManagingGOT()) {
- unsigned idx = Resolver.getGOTIndexForAddr((void*)BufferBegin);
- if (((void**)MemMgr->getGOTBase())[idx] != (void*)BufferBegin) {
- DOUT << "GOT was out of date for " << (void*)BufferBegin
- << " pointing at " << ((void**)MemMgr->getGOTBase())[idx] << "\n";
- ((void**)MemMgr->getGOTBase())[idx] = (void*)BufferBegin;
- }
- }
-
- // Invalidate the icache if necessary.
- synchronizeICache(FnStart, FnEnd-FnStart);
-
- // Add it to the JIT symbol table if the host wants it.
- AddFunctionToSymbolTable(F.getFunction()->getNameStart(),
- FnStart, FnEnd-FnStart);
-
- DOUT << "JIT: Finished CodeGen of [" << (void*)FnStart
- << "] Function: " << F.getFunction()->getName()
- << ": " << (FnEnd-FnStart) << " bytes of text, "
- << Relocations.size() << " relocations\n";
- Relocations.clear();
-
-#ifndef NDEBUG
- if (sys::hasDisassembler())
- DOUT << "Disassembled code:\n"
- << sys::disassembleBuffer(FnStart, FnEnd-FnStart, (uintptr_t)FnStart);
-#endif
- if (ExceptionHandling) {
- uintptr_t ActualSize = 0;
- SavedBufferBegin = BufferBegin;
- SavedBufferEnd = BufferEnd;
- SavedCurBufferPtr = CurBufferPtr;
-
- if (MemMgr->NeedsExactSize()) {
- ActualSize = DE->GetDwarfTableSizeInBytes(F, *this, FnStart, FnEnd);
- }
-
- BufferBegin = CurBufferPtr = MemMgr->startExceptionTable(F.getFunction(),
- ActualSize);
- BufferEnd = BufferBegin+ActualSize;
- unsigned char* FrameRegister = DE->EmitDwarfTable(F, *this, FnStart, FnEnd);
- MemMgr->endExceptionTable(F.getFunction(), BufferBegin, CurBufferPtr,
- FrameRegister);
- BufferBegin = SavedBufferBegin;
- BufferEnd = SavedBufferEnd;
- CurBufferPtr = SavedCurBufferPtr;
-
- TheJIT->RegisterTable(FrameRegister);
- }
- MMI->EndFunction();
-
- return false;
-}
-
-void JITEmitter::emitConstantPool(MachineConstantPool *MCP) {
- const std::vector<MachineConstantPoolEntry> &Constants = MCP->getConstants();
- if (Constants.empty()) return;
-
- MachineConstantPoolEntry CPE = Constants.back();
- unsigned Size = CPE.Offset;
- const Type *Ty = CPE.isMachineConstantPoolEntry()
- ? CPE.Val.MachineCPVal->getType() : CPE.Val.ConstVal->getType();
- Size += TheJIT->getTargetData()->getABITypeSize(Ty);
-
- unsigned Align = 1 << MCP->getConstantPoolAlignment();
- ConstantPoolBase = allocateSpace(Size, Align);
- ConstantPool = MCP;
-
- if (ConstantPoolBase == 0) return; // Buffer overflow.
-
- DOUT << "JIT: Emitted constant pool at [" << ConstantPoolBase
- << "] (size: " << Size << ", alignment: " << Align << ")\n";
-
- // Initialize the memory for all of the constant pool entries.
- for (unsigned i = 0, e = Constants.size(); i != e; ++i) {
- void *CAddr = (char*)ConstantPoolBase+Constants[i].Offset;
- if (Constants[i].isMachineConstantPoolEntry()) {
- // FIXME: add support to lower machine constant pool values into bytes!
- cerr << "Initialize memory with machine specific constant pool entry"
- << " has not been implemented!\n";
- abort();
- }
- TheJIT->InitializeMemory(Constants[i].Val.ConstVal, CAddr);
- DOUT << "JIT: CP" << i << " at [" << CAddr << "]\n";
- }
-}
-
-void JITEmitter::initJumpTableInfo(MachineJumpTableInfo *MJTI) {
- const std::vector<MachineJumpTableEntry> &JT = MJTI->getJumpTables();
- if (JT.empty()) return;
-
- unsigned NumEntries = 0;
- for (unsigned i = 0, e = JT.size(); i != e; ++i)
- NumEntries += JT[i].MBBs.size();
-
- unsigned EntrySize = MJTI->getEntrySize();
-
- // Just allocate space for all the jump tables now. We will fix up the actual
- // MBB entries in the tables after we emit the code for each block, since then
- // we will know the final locations of the MBBs in memory.
- JumpTable = MJTI;
- JumpTableBase = allocateSpace(NumEntries * EntrySize, MJTI->getAlignment());
-}
-
-void JITEmitter::emitJumpTableInfo(MachineJumpTableInfo *MJTI) {
- const std::vector<MachineJumpTableEntry> &JT = MJTI->getJumpTables();
- if (JT.empty() || JumpTableBase == 0) return;
-
- if (TargetMachine::getRelocationModel() == Reloc::PIC_) {
- assert(MJTI->getEntrySize() == 4 && "Cross JIT'ing?");
- // For each jump table, place the offset from the beginning of the table
- // to the target address.
- int *SlotPtr = (int*)JumpTableBase;
-
- for (unsigned i = 0, e = JT.size(); i != e; ++i) {
- const std::vector<MachineBasicBlock*> &MBBs = JT[i].MBBs;
- // Store the offset of the basic block for this jump table slot in the
- // memory we allocated for the jump table in 'initJumpTableInfo'
- intptr_t Base = (intptr_t)SlotPtr;
- for (unsigned mi = 0, me = MBBs.size(); mi != me; ++mi) {
- intptr_t MBBAddr = getMachineBasicBlockAddress(MBBs[mi]);
- *SlotPtr++ = TheJIT->getJITInfo().getPICJumpTableEntry(MBBAddr, Base);
- }
- }
- } else {
- assert(MJTI->getEntrySize() == sizeof(void*) && "Cross JIT'ing?");
-
- // For each jump table, map each target in the jump table to the address of
- // an emitted MachineBasicBlock.
- intptr_t *SlotPtr = (intptr_t*)JumpTableBase;
-
- for (unsigned i = 0, e = JT.size(); i != e; ++i) {
- const std::vector<MachineBasicBlock*> &MBBs = JT[i].MBBs;
- // Store the address of the basic block for this jump table slot in the
- // memory we allocated for the jump table in 'initJumpTableInfo'
- for (unsigned mi = 0, me = MBBs.size(); mi != me; ++mi)
- *SlotPtr++ = getMachineBasicBlockAddress(MBBs[mi]);
- }
- }
-}
-
-void JITEmitter::startFunctionStub(const GlobalValue* F, unsigned StubSize,
- unsigned Alignment) {
- SavedBufferBegin = BufferBegin;
- SavedBufferEnd = BufferEnd;
- SavedCurBufferPtr = CurBufferPtr;
-
- BufferBegin = CurBufferPtr = MemMgr->allocateStub(F, StubSize, Alignment);
- BufferEnd = BufferBegin+StubSize+1;
-}
-
-void *JITEmitter::finishFunctionStub(const GlobalValue* F) {
- NumBytes += getCurrentPCOffset();
- std::swap(SavedBufferBegin, BufferBegin);
- BufferEnd = SavedBufferEnd;
- CurBufferPtr = SavedCurBufferPtr;
- return SavedBufferBegin;
-}
-
-// getConstantPoolEntryAddress - Return the address of the 'ConstantNum' entry
-// in the constant pool that was last emitted with the 'emitConstantPool'
-// method.
-//
-intptr_t JITEmitter::getConstantPoolEntryAddress(unsigned ConstantNum) const {
- assert(ConstantNum < ConstantPool->getConstants().size() &&
- "Invalid ConstantPoolIndex!");
- return (intptr_t)ConstantPoolBase +
- ConstantPool->getConstants()[ConstantNum].Offset;
-}
-
-// getJumpTableEntryAddress - Return the address of the JumpTable with index
-// 'Index' in the jumpp table that was last initialized with 'initJumpTableInfo'
-//
-intptr_t JITEmitter::getJumpTableEntryAddress(unsigned Index) const {
- const std::vector<MachineJumpTableEntry> &JT = JumpTable->getJumpTables();
- assert(Index < JT.size() && "Invalid jump table index!");
-
- unsigned Offset = 0;
- unsigned EntrySize = JumpTable->getEntrySize();
-
- for (unsigned i = 0; i < Index; ++i)
- Offset += JT[i].MBBs.size();
-
- Offset *= EntrySize;
-
- return (intptr_t)((char *)JumpTableBase + Offset);
-}
-
-//===----------------------------------------------------------------------===//
-// Public interface to this file
-//===----------------------------------------------------------------------===//
-
-MachineCodeEmitter *JIT::createEmitter(JIT &jit, JITMemoryManager *JMM) {
- return new JITEmitter(jit, JMM);
-}
-
-// getPointerToNamedFunction - This function is used as a global wrapper to
-// JIT::getPointerToNamedFunction for the purpose of resolving symbols when
-// bugpoint is debugging the JIT. In that scenario, we are loading an .so and
-// need to resolve function(s) that are being mis-codegenerated, so we need to
-// resolve their addresses at runtime, and this is the way to do it.
-extern "C" {
- void *getPointerToNamedFunction(const char *Name) {
- if (Function *F = TheJIT->FindFunctionNamed(Name))
- return TheJIT->getPointerToFunction(F);
- return TheJIT->getPointerToNamedFunction(Name);
- }
-}
-
-// getPointerToFunctionOrStub - If the specified function has been
-// code-gen'd, return a pointer to the function. If not, compile it, or use
-// a stub to implement lazy compilation if available.
-//
-void *JIT::getPointerToFunctionOrStub(Function *F) {
- // If we have already code generated the function, just return the address.
- if (void *Addr = getPointerToGlobalIfAvailable(F))
- return Addr;
-
- // Get a stub if the target supports it.
- assert(dynamic_cast<JITEmitter*>(MCE) && "Unexpected MCE?");
- JITEmitter *JE = static_cast<JITEmitter*>(getCodeEmitter());
- return JE->getJITResolver().getFunctionStub(F);
-}
-
-/// freeMachineCodeForFunction - release machine code memory for given Function.
-///
-void JIT::freeMachineCodeForFunction(Function *F) {
-
- // Delete translation for this from the ExecutionEngine, so it will get
- // retranslated next time it is used.
- void *OldPtr = updateGlobalMapping(F, 0);
-
- if (OldPtr)
- RemoveFunctionFromSymbolTable(OldPtr);
-
- // Free the actual memory for the function body and related stuff.
- assert(dynamic_cast<JITEmitter*>(MCE) && "Unexpected MCE?");
- static_cast<JITEmitter*>(MCE)->deallocateMemForFunction(F);
-}
-
diff --git a/release_23/lib/ExecutionEngine/JIT/JITMemoryManager.cpp b/release_23/lib/ExecutionEngine/JIT/JITMemoryManager.cpp
deleted file mode 100644
index b07af2e11ddd..000000000000
--- a/release_23/lib/ExecutionEngine/JIT/JITMemoryManager.cpp
+++ /dev/null
@@ -1,475 +0,0 @@
-//===-- JITMemoryManager.cpp - Memory Allocator for JIT'd code ------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines the DefaultJITMemoryManager class.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/GlobalValue.h"
-#include "llvm/ExecutionEngine/JITMemoryManager.h"
-#include "llvm/Support/Compiler.h"
-#include "llvm/System/Memory.h"
-#include <map>
-#include <vector>
-#include <cassert>
-#include <cstdlib>
-#include <cstring>
-using namespace llvm;
-
-
-JITMemoryManager::~JITMemoryManager() {}
-
-//===----------------------------------------------------------------------===//
-// Memory Block Implementation.
-//===----------------------------------------------------------------------===//
-
-namespace {
- /// MemoryRangeHeader - For a range of memory, this is the header that we put
- /// on the block of memory. It is carefully crafted to be one word of memory.
- /// Allocated blocks have just this header, free'd blocks have FreeRangeHeader
- /// which starts with this.
- struct FreeRangeHeader;
- struct MemoryRangeHeader {
- /// ThisAllocated - This is true if this block is currently allocated. If
- /// not, this can be converted to a FreeRangeHeader.
- unsigned ThisAllocated : 1;
-
- /// PrevAllocated - Keep track of whether the block immediately before us is
- /// allocated. If not, the word immediately before this header is the size
- /// of the previous block.
- unsigned PrevAllocated : 1;
-
- /// BlockSize - This is the size in bytes of this memory block,
- /// including this header.
- uintptr_t BlockSize : (sizeof(intptr_t)*8 - 2);
-
-
- /// getBlockAfter - Return the memory block immediately after this one.
- ///
- MemoryRangeHeader &getBlockAfter() const {
- return *(MemoryRangeHeader*)((char*)this+BlockSize);
- }
-
- /// getFreeBlockBefore - If the block before this one is free, return it,
- /// otherwise return null.
- FreeRangeHeader *getFreeBlockBefore() const {
- if (PrevAllocated) return 0;
- intptr_t PrevSize = ((intptr_t *)this)[-1];
- return (FreeRangeHeader*)((char*)this-PrevSize);
- }
-
- /// FreeBlock - Turn an allocated block into a free block, adjusting
- /// bits in the object headers, and adding an end of region memory block.
- FreeRangeHeader *FreeBlock(FreeRangeHeader *FreeList);
-
- /// TrimAllocationToSize - If this allocated block is significantly larger
- /// than NewSize, split it into two pieces (where the former is NewSize
- /// bytes, including the header), and add the new block to the free list.
- FreeRangeHeader *TrimAllocationToSize(FreeRangeHeader *FreeList,
- uint64_t NewSize);
- };
-
- /// FreeRangeHeader - For a memory block that isn't already allocated, this
- /// keeps track of the current block and has a pointer to the next free block.
- /// Free blocks are kept on a circularly linked list.
- struct FreeRangeHeader : public MemoryRangeHeader {
- FreeRangeHeader *Prev;
- FreeRangeHeader *Next;
-
- /// getMinBlockSize - Get the minimum size for a memory block. Blocks
- /// smaller than this size cannot be created.
- static unsigned getMinBlockSize() {
- return sizeof(FreeRangeHeader)+sizeof(intptr_t);
- }
-
- /// SetEndOfBlockSizeMarker - The word at the end of every free block is
- /// known to be the size of the free block. Set it for this block.
- void SetEndOfBlockSizeMarker() {
- void *EndOfBlock = (char*)this + BlockSize;
- ((intptr_t *)EndOfBlock)[-1] = BlockSize;
- }
-
- FreeRangeHeader *RemoveFromFreeList() {
- assert(Next->Prev == this && Prev->Next == this && "Freelist broken!");
- Next->Prev = Prev;
- return Prev->Next = Next;
- }
-
- void AddToFreeList(FreeRangeHeader *FreeList) {
- Next = FreeList;
- Prev = FreeList->Prev;
- Prev->Next = this;
- Next->Prev = this;
- }
-
- /// GrowBlock - The block after this block just got deallocated. Merge it
- /// into the current block.
- void GrowBlock(uintptr_t NewSize);
-
- /// AllocateBlock - Mark this entire block allocated, updating freelists
- /// etc. This returns a pointer to the circular free-list.
- FreeRangeHeader *AllocateBlock();
- };
-}
-
-
-/// AllocateBlock - Mark this entire block allocated, updating freelists
-/// etc. This returns a pointer to the circular free-list.
-FreeRangeHeader *FreeRangeHeader::AllocateBlock() {
- assert(!ThisAllocated && !getBlockAfter().PrevAllocated &&
- "Cannot allocate an allocated block!");
- // Mark this block allocated.
- ThisAllocated = 1;
- getBlockAfter().PrevAllocated = 1;
-
- // Remove it from the free list.
- return RemoveFromFreeList();
-}
-
-/// FreeBlock - Turn an allocated block into a free block, adjusting
-/// bits in the object headers, and adding an end of region memory block.
-/// If possible, coalesce this block with neighboring blocks. Return the
-/// FreeRangeHeader to allocate from.
-FreeRangeHeader *MemoryRangeHeader::FreeBlock(FreeRangeHeader *FreeList) {
- MemoryRangeHeader *FollowingBlock = &getBlockAfter();
- assert(ThisAllocated && "This block is already allocated!");
- assert(FollowingBlock->PrevAllocated && "Flags out of sync!");
-
- FreeRangeHeader *FreeListToReturn = FreeList;
-
- // If the block after this one is free, merge it into this block.
- if (!FollowingBlock->ThisAllocated) {
- FreeRangeHeader &FollowingFreeBlock = *(FreeRangeHeader *)FollowingBlock;
- // "FreeList" always needs to be a valid free block. If we're about to
- // coalesce with it, update our notion of what the free list is.
- if (&FollowingFreeBlock == FreeList) {
- FreeList = FollowingFreeBlock.Next;
- FreeListToReturn = 0;
- assert(&FollowingFreeBlock != FreeList && "No tombstone block?");
- }
- FollowingFreeBlock.RemoveFromFreeList();
-
- // Include the following block into this one.
- BlockSize += FollowingFreeBlock.BlockSize;
- FollowingBlock = &FollowingFreeBlock.getBlockAfter();
-
- // Tell the block after the block we are coalescing that this block is
- // allocated.
- FollowingBlock->PrevAllocated = 1;
- }
-
- assert(FollowingBlock->ThisAllocated && "Missed coalescing?");
-
- if (FreeRangeHeader *PrevFreeBlock = getFreeBlockBefore()) {
- PrevFreeBlock->GrowBlock(PrevFreeBlock->BlockSize + BlockSize);
- return FreeListToReturn ? FreeListToReturn : PrevFreeBlock;
- }
-
- // Otherwise, mark this block free.
- FreeRangeHeader &FreeBlock = *(FreeRangeHeader*)this;
- FollowingBlock->PrevAllocated = 0;
- FreeBlock.ThisAllocated = 0;
-
- // Link this into the linked list of free blocks.
- FreeBlock.AddToFreeList(FreeList);
-
- // Add a marker at the end of the block, indicating the size of this free
- // block.
- FreeBlock.SetEndOfBlockSizeMarker();
- return FreeListToReturn ? FreeListToReturn : &FreeBlock;
-}
-
-/// GrowBlock - The block after this block just got deallocated. Merge it
-/// into the current block.
-void FreeRangeHeader::GrowBlock(uintptr_t NewSize) {
- assert(NewSize > BlockSize && "Not growing block?");
- BlockSize = NewSize;
- SetEndOfBlockSizeMarker();
- getBlockAfter().PrevAllocated = 0;
-}
-
-/// TrimAllocationToSize - If this allocated block is significantly larger
-/// than NewSize, split it into two pieces (where the former is NewSize
-/// bytes, including the header), and add the new block to the free list.
-FreeRangeHeader *MemoryRangeHeader::
-TrimAllocationToSize(FreeRangeHeader *FreeList, uint64_t NewSize) {
- assert(ThisAllocated && getBlockAfter().PrevAllocated &&
- "Cannot deallocate part of an allocated block!");
-
- // Round up size for alignment of header.
- unsigned HeaderAlign = __alignof(FreeRangeHeader);
- NewSize = (NewSize+ (HeaderAlign-1)) & ~(HeaderAlign-1);
-
- // Size is now the size of the block we will remove from the start of the
- // current block.
- assert(NewSize <= BlockSize &&
- "Allocating more space from this block than exists!");
-
- // If splitting this block will cause the remainder to be too small, do not
- // split the block.
- if (BlockSize <= NewSize+FreeRangeHeader::getMinBlockSize())
- return FreeList;
-
- // Otherwise, we splice the required number of bytes out of this block, form
- // a new block immediately after it, then mark this block allocated.
- MemoryRangeHeader &FormerNextBlock = getBlockAfter();
-
- // Change the size of this block.
- BlockSize = NewSize;
-
- // Get the new block we just sliced out and turn it into a free block.
- FreeRangeHeader &NewNextBlock = (FreeRangeHeader &)getBlockAfter();
- NewNextBlock.BlockSize = (char*)&FormerNextBlock - (char*)&NewNextBlock;
- NewNextBlock.ThisAllocated = 0;
- NewNextBlock.PrevAllocated = 1;
- NewNextBlock.SetEndOfBlockSizeMarker();
- FormerNextBlock.PrevAllocated = 0;
- NewNextBlock.AddToFreeList(FreeList);
- return &NewNextBlock;
-}
-
-//===----------------------------------------------------------------------===//
-// Memory Block Implementation.
-//===----------------------------------------------------------------------===//
-
-namespace {
- /// DefaultJITMemoryManager - Manage memory for the JIT code generation.
- /// This splits a large block of MAP_NORESERVE'd memory into two
- /// sections, one for function stubs, one for the functions themselves. We
- /// have to do this because we may need to emit a function stub while in the
- /// middle of emitting a function, and we don't know how large the function we
- /// are emitting is.
- class VISIBILITY_HIDDEN DefaultJITMemoryManager : public JITMemoryManager {
- std::vector<sys::MemoryBlock> Blocks; // Memory blocks allocated by the JIT
- FreeRangeHeader *FreeMemoryList; // Circular list of free blocks.
-
- // When emitting code into a memory block, this is the block.
- MemoryRangeHeader *CurBlock;
-
- unsigned char *CurStubPtr, *StubBase;
- unsigned char *GOTBase; // Target Specific reserved memory
-
- // Centralize memory block allocation.
- sys::MemoryBlock getNewMemoryBlock(unsigned size);
-
- std::map<const Function*, MemoryRangeHeader*> FunctionBlocks;
- std::map<const Function*, MemoryRangeHeader*> TableBlocks;
- public:
- DefaultJITMemoryManager();
- ~DefaultJITMemoryManager();
-
- void AllocateGOT();
-
- unsigned char *allocateStub(const GlobalValue* F, unsigned StubSize,
- unsigned Alignment);
-
- /// startFunctionBody - When a function starts, allocate a block of free
- /// executable memory, returning a pointer to it and its actual size.
- unsigned char *startFunctionBody(const Function *F, uintptr_t &ActualSize) {
- CurBlock = FreeMemoryList;
-
- // Allocate the entire memory block.
- FreeMemoryList = FreeMemoryList->AllocateBlock();
- ActualSize = CurBlock->BlockSize-sizeof(MemoryRangeHeader);
- return (unsigned char *)(CurBlock+1);
- }
-
- /// endFunctionBody - The function F is now allocated, and takes the memory
- /// in the range [FunctionStart,FunctionEnd).
- void endFunctionBody(const Function *F, unsigned char *FunctionStart,
- unsigned char *FunctionEnd) {
- assert(FunctionEnd > FunctionStart);
- assert(FunctionStart == (unsigned char *)(CurBlock+1) &&
- "Mismatched function start/end!");
-
- uintptr_t BlockSize = FunctionEnd - (unsigned char *)CurBlock;
- FunctionBlocks[F] = CurBlock;
-
- // Release the memory at the end of this block that isn't needed.
- FreeMemoryList =CurBlock->TrimAllocationToSize(FreeMemoryList, BlockSize);
- }
-
- /// startExceptionTable - Use startFunctionBody to allocate memory for the
- /// function's exception table.
- unsigned char* startExceptionTable(const Function* F,
- uintptr_t &ActualSize) {
- return startFunctionBody(F, ActualSize);
- }
-
- /// endExceptionTable - The exception table of F is now allocated,
- /// and takes the memory in the range [TableStart,TableEnd).
- void endExceptionTable(const Function *F, unsigned char *TableStart,
- unsigned char *TableEnd,
- unsigned char* FrameRegister) {
- assert(TableEnd > TableStart);
- assert(TableStart == (unsigned char *)(CurBlock+1) &&
- "Mismatched table start/end!");
-
- uintptr_t BlockSize = TableEnd - (unsigned char *)CurBlock;
- TableBlocks[F] = CurBlock;
-
- // Release the memory at the end of this block that isn't needed.
- FreeMemoryList =CurBlock->TrimAllocationToSize(FreeMemoryList, BlockSize);
- }
-
- unsigned char *getGOTBase() const {
- return GOTBase;
- }
-
- /// deallocateMemForFunction - Deallocate all memory for the specified
- /// function body.
- void deallocateMemForFunction(const Function *F) {
- std::map<const Function*, MemoryRangeHeader*>::iterator
- I = FunctionBlocks.find(F);
- if (I == FunctionBlocks.end()) return;
-
- // Find the block that is allocated for this function.
- MemoryRangeHeader *MemRange = I->second;
- assert(MemRange->ThisAllocated && "Block isn't allocated!");
-
- // Fill the buffer with garbage!
-#ifndef NDEBUG
- memset(MemRange+1, 0xCD, MemRange->BlockSize-sizeof(*MemRange));
-#endif
-
- // Free the memory.
- FreeMemoryList = MemRange->FreeBlock(FreeMemoryList);
-
- // Finally, remove this entry from FunctionBlocks.
- FunctionBlocks.erase(I);
-
- I = TableBlocks.find(F);
- if (I == TableBlocks.end()) return;
-
- // Find the block that is allocated for this function.
- MemRange = I->second;
- assert(MemRange->ThisAllocated && "Block isn't allocated!");
-
- // Fill the buffer with garbage!
-#ifndef NDEBUG
- memset(MemRange+1, 0xCD, MemRange->BlockSize-sizeof(*MemRange));
-#endif
-
- // Free the memory.
- FreeMemoryList = MemRange->FreeBlock(FreeMemoryList);
-
- // Finally, remove this entry from TableBlocks.
- TableBlocks.erase(I);
- }
- };
-}
-
-DefaultJITMemoryManager::DefaultJITMemoryManager() {
- // Allocate a 16M block of memory for functions.
- sys::MemoryBlock MemBlock = getNewMemoryBlock(16 << 20);
-
- unsigned char *MemBase = reinterpret_cast<unsigned char*>(MemBlock.base());
-
- // Allocate stubs backwards from the base, allocate functions forward
- // from the base.
- StubBase = MemBase;
- CurStubPtr = MemBase + 512*1024; // Use 512k for stubs, working backwards.
-
- // We set up the memory chunk with 4 mem regions, like this:
- // [ START
- // [ Free #0 ] -> Large space to allocate functions from.
- // [ Allocated #1 ] -> Tiny space to separate regions.
- // [ Free #2 ] -> Tiny space so there is always at least 1 free block.
- // [ Allocated #3 ] -> Tiny space to prevent looking past end of block.
- // END ]
- //
- // The last three blocks are never deallocated or touched.
-
- // Add MemoryRangeHeader to the end of the memory region, indicating that
- // the space after the block of memory is allocated. This is block #3.
- MemoryRangeHeader *Mem3 = (MemoryRangeHeader*)(MemBase+MemBlock.size())-1;
- Mem3->ThisAllocated = 1;
- Mem3->PrevAllocated = 0;
- Mem3->BlockSize = 0;
-
- /// Add a tiny free region so that the free list always has one entry.
- FreeRangeHeader *Mem2 =
- (FreeRangeHeader *)(((char*)Mem3)-FreeRangeHeader::getMinBlockSize());
- Mem2->ThisAllocated = 0;
- Mem2->PrevAllocated = 1;
- Mem2->BlockSize = FreeRangeHeader::getMinBlockSize();
- Mem2->SetEndOfBlockSizeMarker();
- Mem2->Prev = Mem2; // Mem2 *is* the free list for now.
- Mem2->Next = Mem2;
-
- /// Add a tiny allocated region so that Mem2 is never coalesced away.
- MemoryRangeHeader *Mem1 = (MemoryRangeHeader*)Mem2-1;
- Mem1->ThisAllocated = 1;
- Mem1->PrevAllocated = 0;
- Mem1->BlockSize = (char*)Mem2 - (char*)Mem1;
-
- // Add a FreeRangeHeader to the start of the function body region, indicating
- // that the space is free. Mark the previous block allocated so we never look
- // at it.
- FreeRangeHeader *Mem0 = (FreeRangeHeader*)CurStubPtr;
- Mem0->ThisAllocated = 0;
- Mem0->PrevAllocated = 1;
- Mem0->BlockSize = (char*)Mem1-(char*)Mem0;
- Mem0->SetEndOfBlockSizeMarker();
- Mem0->AddToFreeList(Mem2);
-
- // Start out with the freelist pointing to Mem0.
- FreeMemoryList = Mem0;
-
- GOTBase = NULL;
-}
-
-void DefaultJITMemoryManager::AllocateGOT() {
- assert(GOTBase == 0 && "Cannot allocate the got multiple times");
- GOTBase = new unsigned char[sizeof(void*) * 8192];
- HasGOT = true;
-}
-
-
-DefaultJITMemoryManager::~DefaultJITMemoryManager() {
- for (unsigned i = 0, e = Blocks.size(); i != e; ++i)
- sys::Memory::ReleaseRWX(Blocks[i]);
-
- delete[] GOTBase;
- Blocks.clear();
-}
-
-unsigned char *DefaultJITMemoryManager::allocateStub(const GlobalValue* F,
- unsigned StubSize,
- unsigned Alignment) {
- CurStubPtr -= StubSize;
- CurStubPtr = (unsigned char*)(((intptr_t)CurStubPtr) &
- ~(intptr_t)(Alignment-1));
- if (CurStubPtr < StubBase) {
- // FIXME: allocate a new block
- fprintf(stderr, "JIT ran out of memory for function stubs!\n");
- abort();
- }
- return CurStubPtr;
-}
-
-sys::MemoryBlock DefaultJITMemoryManager::getNewMemoryBlock(unsigned size) {
- // Allocate a new block close to the last one.
- const sys::MemoryBlock *BOld = Blocks.empty() ? 0 : &Blocks.front();
- std::string ErrMsg;
- sys::MemoryBlock B = sys::Memory::AllocateRWX(size, BOld, &ErrMsg);
- if (B.base() == 0) {
- fprintf(stderr,
- "Allocation failed when allocating new memory in the JIT\n%s\n",
- ErrMsg.c_str());
- abort();
- }
- Blocks.push_back(B);
- return B;
-}
-
-
-JITMemoryManager *JITMemoryManager::CreateDefaultMemManager() {
- return new DefaultJITMemoryManager();
-}
diff --git a/release_23/lib/ExecutionEngine/JIT/Makefile b/release_23/lib/ExecutionEngine/JIT/Makefile
deleted file mode 100644
index 66e06a9fd286..000000000000
--- a/release_23/lib/ExecutionEngine/JIT/Makefile
+++ /dev/null
@@ -1,37 +0,0 @@
-##===- lib/ExecutionEngine/JIT/Makefile --------------------*- Makefile -*-===##
-#
-# The LLVM Compiler Infrastructure
-#
-# This file is distributed under the University of Illinois Open Source
-# License. See LICENSE.TXT for details.
-#
-##===----------------------------------------------------------------------===##
-LEVEL = ../../..
-LIBRARYNAME = LLVMJIT
-
-# Get the $(ARCH) setting
-include $(LEVEL)/Makefile.config
-
-# Enable the X86 JIT if compiling on X86
-ifeq ($(ARCH), x86)
- ENABLE_X86_JIT = 1
-endif
-
-# This flag can also be used on the command line to force inclusion
-# of the X86 JIT on non-X86 hosts
-ifdef ENABLE_X86_JIT
- CPPFLAGS += -DENABLE_X86_JIT
-endif
-
-# Enable the Sparc JIT if compiling on Sparc
-ifeq ($(ARCH), Sparc)
- ENABLE_SPARC_JIT = 1
-endif
-
-# This flag can also be used on the command line to force inclusion
-# of the Sparc JIT on non-Sparc hosts
-ifdef ENABLE_SPARC_JIT
- CPPFLAGS += -DENABLE_SPARC_JIT
-endif
-
-include $(LEVEL)/Makefile.common
diff --git a/release_23/lib/ExecutionEngine/JIT/TargetSelect.cpp b/release_23/lib/ExecutionEngine/JIT/TargetSelect.cpp
deleted file mode 100644
index 0fb0b41999e4..000000000000
--- a/release_23/lib/ExecutionEngine/JIT/TargetSelect.cpp
+++ /dev/null
@@ -1,80 +0,0 @@
-//===-- TargetSelect.cpp - Target Chooser Code ----------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This just asks the TargetMachineRegistry for the appropriate JIT to use, and
-// allows the user to specify a specific one on the commandline with -march=x.
-//
-//===----------------------------------------------------------------------===//
-
-#include "JIT.h"
-#include "llvm/Module.h"
-#include "llvm/ModuleProvider.h"
-#include "llvm/Target/SubtargetFeature.h"
-#include "llvm/Target/TargetMachine.h"
-#include "llvm/Target/TargetMachineRegistry.h"
-using namespace llvm;
-
-static cl::opt<const TargetMachineRegistry::entry*, false,
- TargetMachineRegistry::Parser>
-MArch("march", cl::desc("Architecture to generate assembly for:"));
-
-static cl::opt<std::string>
-MCPU("mcpu",
- cl::desc("Target a specific cpu type (-mcpu=help for details)"),
- cl::value_desc("cpu-name"),
- cl::init(""));
-
-static cl::list<std::string>
-MAttrs("mattr",
- cl::CommaSeparated,
- cl::desc("Target specific attributes (-mattr=help for details)"),
- cl::value_desc("a1,+a2,-a3,..."));
-
-/// createInternal - Create an return a new JIT compiler if there is one
-/// available for the current target. Otherwise, return null.
-///
-ExecutionEngine *JIT::createJIT(ModuleProvider *MP, std::string *ErrorStr,
- JITMemoryManager *JMM) {
- const TargetMachineRegistry::entry *TheArch = MArch;
- if (TheArch == 0) {
- std::string Error;
- TheArch = TargetMachineRegistry::getClosestTargetForJIT(Error);
- if (TheArch == 0) {
- if (ErrorStr)
- *ErrorStr = Error;
- return 0;
- }
- } else if (TheArch->JITMatchQualityFn() == 0) {
- cerr << "WARNING: This target JIT is not designed for the host you are"
- << " running. If bad things happen, please choose a different "
- << "-march switch.\n";
- }
-
- // Package up features to be passed to target/subtarget
- std::string FeaturesStr;
- if (MCPU.size() || MAttrs.size()) {
- SubtargetFeatures Features;
- Features.setCPU(MCPU);
- for (unsigned i = 0; i != MAttrs.size(); ++i)
- Features.AddFeature(MAttrs[i]);
- FeaturesStr = Features.getString();
- }
-
- // Allocate a target...
- TargetMachine *Target = TheArch->CtorFn(*MP->getModule(), FeaturesStr);
- assert(Target && "Could not allocate target machine!");
-
- // If the target supports JIT code generation, return a new JIT now.
- if (TargetJITInfo *TJ = Target->getJITInfo())
- return new JIT(MP, *Target, *TJ, JMM);
-
- if (ErrorStr)
- *ErrorStr = "target does not support JIT code generation";
- return 0;
-}
diff --git a/release_23/lib/ExecutionEngine/Makefile b/release_23/lib/ExecutionEngine/Makefile
deleted file mode 100644
index 1c5a6307a9ee..000000000000
--- a/release_23/lib/ExecutionEngine/Makefile
+++ /dev/null
@@ -1,13 +0,0 @@
-##===- lib/ExecutionEngine/Makefile ------------------------*- Makefile -*-===##
-#
-# The LLVM Compiler Infrastructure
-#
-# This file is distributed under the University of Illinois Open Source
-# License. See LICENSE.TXT for details.
-#
-##===----------------------------------------------------------------------===##
-LEVEL = ../..
-LIBRARYNAME = LLVMExecutionEngine
-PARALLEL_DIRS = Interpreter JIT
-
-include $(LEVEL)/Makefile.common
diff --git a/release_23/lib/Linker/LinkArchives.cpp b/release_23/lib/Linker/LinkArchives.cpp
deleted file mode 100644
index 6cab77c60106..000000000000
--- a/release_23/lib/Linker/LinkArchives.cpp
+++ /dev/null
@@ -1,201 +0,0 @@
-//===- lib/Linker/LinkArchives.cpp - Link LLVM objects and libraries ------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains routines to handle linking together LLVM bitcode files,
-// and to handle annoying things like static libraries.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Linker.h"
-#include "llvm/Module.h"
-#include "llvm/ModuleProvider.h"
-#include "llvm/ADT/SetOperations.h"
-#include "llvm/Bitcode/Archive.h"
-#include "llvm/Config/config.h"
-#include <memory>
-#include <set>
-using namespace llvm;
-
-/// GetAllUndefinedSymbols - calculates the set of undefined symbols that still
-/// exist in an LLVM module. This is a bit tricky because there may be two
-/// symbols with the same name but different LLVM types that will be resolved to
-/// each other but aren't currently (thus we need to treat it as resolved).
-///
-/// Inputs:
-/// M - The module in which to find undefined symbols.
-///
-/// Outputs:
-/// UndefinedSymbols - A set of C++ strings containing the name of all
-/// undefined symbols.
-///
-static void
-GetAllUndefinedSymbols(Module *M, std::set<std::string> &UndefinedSymbols) {
- std::set<std::string> DefinedSymbols;
- UndefinedSymbols.clear();
-
- // If the program doesn't define a main, try pulling one in from a .a file.
- // This is needed for programs where the main function is defined in an
- // archive, such f2c'd programs.
- Function *Main = M->getFunction("main");
- if (Main == 0 || Main->isDeclaration())
- UndefinedSymbols.insert("main");
-
- for (Module::iterator I = M->begin(), E = M->end(); I != E; ++I)
- if (I->hasName()) {
- if (I->isDeclaration())
- UndefinedSymbols.insert(I->getName());
- else if (!I->hasInternalLinkage()) {
- assert(!I->hasDLLImportLinkage()
- && "Found dllimported non-external symbol!");
- DefinedSymbols.insert(I->getName());
- }
- }
-
- for (Module::global_iterator I = M->global_begin(), E = M->global_end();
- I != E; ++I)
- if (I->hasName()) {
- if (I->isDeclaration())
- UndefinedSymbols.insert(I->getName());
- else if (!I->hasInternalLinkage()) {
- assert(!I->hasDLLImportLinkage()
- && "Found dllimported non-external symbol!");
- DefinedSymbols.insert(I->getName());
- }
- }
-
- for (Module::alias_iterator I = M->alias_begin(), E = M->alias_end();
- I != E; ++I)
- if (I->hasName())
- DefinedSymbols.insert(I->getName());
-
- // Prune out any defined symbols from the undefined symbols set...
- for (std::set<std::string>::iterator I = UndefinedSymbols.begin();
- I != UndefinedSymbols.end(); )
- if (DefinedSymbols.count(*I))
- UndefinedSymbols.erase(I++); // This symbol really is defined!
- else
- ++I; // Keep this symbol in the undefined symbols list
-}
-
-/// LinkInArchive - opens an archive library and link in all objects which
-/// provide symbols that are currently undefined.
-///
-/// Inputs:
-/// Filename - The pathname of the archive.
-///
-/// Return Value:
-/// TRUE - An error occurred.
-/// FALSE - No errors.
-bool
-Linker::LinkInArchive(const sys::Path &Filename, bool &is_native) {
- // Make sure this is an archive file we're dealing with
- if (!Filename.isArchive())
- return error("File '" + Filename.toString() + "' is not an archive.");
-
- // Open the archive file
- verbose("Linking archive file '" + Filename.toString() + "'");
-
- // Find all of the symbols currently undefined in the bitcode program.
- // If all the symbols are defined, the program is complete, and there is
- // no reason to link in any archive files.
- std::set<std::string> UndefinedSymbols;
- GetAllUndefinedSymbols(Composite, UndefinedSymbols);
-
- if (UndefinedSymbols.empty()) {
- verbose("No symbols undefined, skipping library '" +
- Filename.toString() + "'");
- return false; // No need to link anything in!
- }
-
- std::string ErrMsg;
- std::auto_ptr<Archive> AutoArch (
- Archive::OpenAndLoadSymbols(Filename,&ErrMsg));
-
- Archive* arch = AutoArch.get();
-
- if (!arch)
- return error("Cannot read archive '" + Filename.toString() +
- "': " + ErrMsg);
- if (!arch->isBitcodeArchive()) {
- is_native = true;
- return false;
- }
- is_native = false;
-
- // Save a set of symbols that are not defined by the archive. Since we're
- // entering a loop, there's no point searching for these multiple times. This
- // variable is used to "set_subtract" from the set of undefined symbols.
- std::set<std::string> NotDefinedByArchive;
-
- // Save the current set of undefined symbols, because we may have to make
- // multiple passes over the archive:
- std::set<std::string> CurrentlyUndefinedSymbols;
-
- do {
- CurrentlyUndefinedSymbols = UndefinedSymbols;
-
- // Find the modules we need to link into the target module
- std::set<ModuleProvider*> Modules;
- if (!arch->findModulesDefiningSymbols(UndefinedSymbols, Modules, &ErrMsg))
- return error("Cannot find symbols in '" + Filename.toString() +
- "': " + ErrMsg);
-
- // If we didn't find any more modules to link this time, we are done
- // searching this archive.
- if (Modules.empty())
- break;
-
- // Any symbols remaining in UndefinedSymbols after
- // findModulesDefiningSymbols are ones that the archive does not define. So
- // we add them to the NotDefinedByArchive variable now.
- NotDefinedByArchive.insert(UndefinedSymbols.begin(),
- UndefinedSymbols.end());
-
- // Loop over all the ModuleProviders that we got back from the archive
- for (std::set<ModuleProvider*>::iterator I=Modules.begin(), E=Modules.end();
- I != E; ++I) {
-
- // Get the module we must link in.
- std::string moduleErrorMsg;
- std::auto_ptr<Module> AutoModule((*I)->releaseModule( &moduleErrorMsg ));
- if (!moduleErrorMsg.empty())
- return error("Could not load a module: " + moduleErrorMsg);
-
- Module* aModule = AutoModule.get();
-
- if (aModule != NULL) {
- verbose(" Linking in module: " + aModule->getModuleIdentifier());
-
- // Link it in
- if (LinkInModule(aModule, &moduleErrorMsg)) {
- return error("Cannot link in module '" +
- aModule->getModuleIdentifier() + "': " + moduleErrorMsg);
- }
- }
- }
-
- // Get the undefined symbols from the aggregate module. This recomputes the
- // symbols we still need after the new modules have been linked in.
- GetAllUndefinedSymbols(Composite, UndefinedSymbols);
-
- // At this point we have two sets of undefined symbols: UndefinedSymbols
- // which holds the undefined symbols from all the modules, and
- // NotDefinedByArchive which holds symbols we know the archive doesn't
- // define. There's no point searching for symbols that we won't find in the
- // archive so we subtract these sets.
- set_subtract(UndefinedSymbols, NotDefinedByArchive);
-
- // If there's no symbols left, no point in continuing to search the
- // archive.
- if (UndefinedSymbols.empty())
- break;
- } while (CurrentlyUndefinedSymbols != UndefinedSymbols);
-
- return false;
-}
diff --git a/release_23/lib/Linker/LinkItems.cpp b/release_23/lib/Linker/LinkItems.cpp
deleted file mode 100644
index 7c888aa498a3..000000000000
--- a/release_23/lib/Linker/LinkItems.cpp
+++ /dev/null
@@ -1,238 +0,0 @@
-//===- lib/Linker/LinkItems.cpp - Link LLVM objects and libraries ---------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains routines to handle linking together LLVM bitcode files,
-// and to handle annoying things like static libraries.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Linker.h"
-#include "llvm/Module.h"
-#include "llvm/Support/MemoryBuffer.h"
-#include "llvm/Bitcode/ReaderWriter.h"
-
-using namespace llvm;
-
-// LinkItems - This function is the main entry point into linking. It takes a
-// list of LinkItem which indicates the order the files should be linked and
-// how each file should be treated (plain file or with library search). The
-// function only links bitcode and produces a result list of items that are
-// native objects.
-bool
-Linker::LinkInItems(const ItemList& Items, ItemList& NativeItems) {
- // Clear the NativeItems just in case
- NativeItems.clear();
-
- // For each linkage item ...
- for (ItemList::const_iterator I = Items.begin(), E = Items.end();
- I != E; ++I) {
- if (I->second) {
- // Link in the library suggested.
- bool is_native = false;
- if (LinkInLibrary(I->first, is_native))
- return true;
- if (is_native)
- NativeItems.push_back(*I);
- } else {
- // Link in the file suggested
- bool is_native = false;
- if (LinkInFile(sys::Path(I->first), is_native))
- return true;
- if (is_native)
- NativeItems.push_back(*I);
- }
- }
-
- // At this point we have processed all the link items provided to us. Since
- // we have an aggregated module at this point, the dependent libraries in
- // that module should also be aggregated with duplicates eliminated. This is
- // now the time to process the dependent libraries to resolve any remaining
- // symbols.
- bool is_native;
- for (Module::lib_iterator I = Composite->lib_begin(),
- E = Composite->lib_end(); I != E; ++I) {
- if(LinkInLibrary(*I, is_native))
- return true;
- if (is_native)
- NativeItems.push_back(std::make_pair(*I, true));
- }
-
- return false;
-}
-
-
-/// LinkInLibrary - links one library into the HeadModule.
-///
-bool Linker::LinkInLibrary(const std::string& Lib, bool& is_native) {
- is_native = false;
- // Determine where this library lives.
- sys::Path Pathname = FindLib(Lib);
- if (Pathname.isEmpty())
- return error("Cannot find library '" + Lib + "'");
-
- // If its an archive, try to link it in
- std::string Magic;
- Pathname.getMagicNumber(Magic, 64);
- switch (sys::IdentifyFileType(Magic.c_str(), 64)) {
- default: assert(0 && "Bad file type identification");
- case sys::Unknown_FileType:
- return warning("Supposed library '" + Lib + "' isn't a library.");
-
- case sys::Bitcode_FileType:
- // LLVM ".so" file.
- if (LinkInFile(Pathname, is_native))
- return true;
- break;
-
- case sys::Archive_FileType:
- if (LinkInArchive(Pathname, is_native))
- return error("Cannot link archive '" + Pathname.toString() + "'");
- break;
-
- case sys::ELF_Relocatable_FileType:
- case sys::ELF_SharedObject_FileType:
- case sys::Mach_O_Object_FileType:
- case sys::Mach_O_FixedVirtualMemorySharedLib_FileType:
- case sys::Mach_O_DynamicallyLinkedSharedLib_FileType:
- case sys::Mach_O_DynamicallyLinkedSharedLibStub_FileType:
- case sys::COFF_FileType:
- is_native = true;
- break;
- }
- return false;
-}
-
-/// LinkLibraries - takes the specified library files and links them into the
-/// main bitcode object file.
-///
-/// Inputs:
-/// Libraries - The list of libraries to link into the module.
-///
-/// Return value:
-/// FALSE - No error.
-/// TRUE - Error.
-///
-bool Linker::LinkInLibraries(const std::vector<std::string> &Libraries) {
-
- // Process the set of libraries we've been provided.
- bool is_native = false;
- for (unsigned i = 0; i < Libraries.size(); ++i)
- if (LinkInLibrary(Libraries[i], is_native))
- return true;
-
- // At this point we have processed all the libraries provided to us. Since
- // we have an aggregated module at this point, the dependent libraries in
- // that module should also be aggregated with duplicates eliminated. This is
- // now the time to process the dependent libraries to resolve any remaining
- // symbols.
- const Module::LibraryListType& DepLibs = Composite->getLibraries();
- for (Module::LibraryListType::const_iterator I = DepLibs.begin(),
- E = DepLibs.end(); I != E; ++I)
- if (LinkInLibrary(*I, is_native))
- return true;
-
- return false;
-}
-
-/// LinkInFile - opens a bitcode file and links in all objects which
-/// provide symbols that are currently undefined.
-///
-/// Inputs:
-/// File - The pathname of the bitcode file.
-///
-/// Outputs:
-/// ErrorMessage - A C++ string detailing what error occurred, if any.
-///
-/// Return Value:
-/// TRUE - An error occurred.
-/// FALSE - No errors.
-///
-bool Linker::LinkInFile(const sys::Path &File, bool &is_native) {
- is_native = false;
-
- // Check for a file of name "-", which means "read standard input"
- if (File.toString() == "-") {
- std::auto_ptr<Module> M;
- if (MemoryBuffer *Buffer = MemoryBuffer::getSTDIN()) {
- M.reset(ParseBitcodeFile(Buffer, &Error));
- delete Buffer;
- if (M.get())
- if (!LinkInModule(M.get(), &Error))
- return false;
- } else
- Error = "standard input is empty";
- return error("Cannot link stdin: " + Error);
- }
-
- // Make sure we can at least read the file
- if (!File.canRead())
- return error("Cannot find linker input '" + File.toString() + "'");
-
- // If its an archive, try to link it in
- std::string Magic;
- File.getMagicNumber(Magic, 64);
- switch (sys::IdentifyFileType(Magic.c_str(), 64)) {
- default: assert(0 && "Bad file type identification");
- case sys::Unknown_FileType:
- return warning("Ignoring file '" + File.toString() +
- "' because does not contain bitcode.");
-
- case sys::Archive_FileType:
- // A user may specify an ar archive without -l, perhaps because it
- // is not installed as a library. Detect that and link the archive.
- verbose("Linking archive file '" + File.toString() + "'");
- if (LinkInArchive(File, is_native))
- return true;
- break;
-
- case sys::Bitcode_FileType: {
- verbose("Linking bitcode file '" + File.toString() + "'");
- std::auto_ptr<Module> M(LoadObject(File));
- if (M.get() == 0)
- return error("Cannot load file '" + File.toString() + "': " + Error);
- if (LinkInModule(M.get(), &Error))
- return error("Cannot link file '" + File.toString() + "': " + Error);
-
- verbose("Linked in file '" + File.toString() + "'");
- break;
- }
-
- case sys::ELF_Relocatable_FileType:
- case sys::ELF_SharedObject_FileType:
- case sys::Mach_O_Object_FileType:
- case sys::Mach_O_FixedVirtualMemorySharedLib_FileType:
- case sys::Mach_O_DynamicallyLinkedSharedLib_FileType:
- case sys::Mach_O_DynamicallyLinkedSharedLibStub_FileType:
- case sys::COFF_FileType:
- is_native = true;
- break;
- }
- return false;
-}
-
-/// LinkFiles - takes a module and a list of files and links them all together.
-/// It locates the file either in the current directory, as its absolute
-/// or relative pathname, or as a file somewhere in LLVM_LIB_SEARCH_PATH.
-///
-/// Inputs:
-/// Files - A vector of sys::Path indicating the LLVM bitcode filenames
-/// to be linked. The names can refer to a mixture of pure LLVM
-/// bitcode files and archive (ar) formatted files.
-///
-/// Return value:
-/// FALSE - No errors.
-/// TRUE - Some error occurred.
-///
-bool Linker::LinkInFiles(const std::vector<sys::Path> &Files) {
- bool is_native;
- for (unsigned i = 0; i < Files.size(); ++i)
- if (LinkInFile(Files[i], is_native))
- return true;
- return false;
-}
diff --git a/release_23/lib/Linker/LinkModules.cpp b/release_23/lib/Linker/LinkModules.cpp
deleted file mode 100644
index 57df01495b7c..000000000000
--- a/release_23/lib/Linker/LinkModules.cpp
+++ /dev/null
@@ -1,1224 +0,0 @@
-//===- lib/Linker/LinkModules.cpp - Module Linker Implementation ----------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the LLVM module linker.
-//
-// Specifically, this:
-// * Merges global variables between the two modules
-// * Uninit + Uninit = Init, Init + Uninit = Init, Init + Init = Error if !=
-// * Merges functions between two modules
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Linker.h"
-#include "llvm/Constants.h"
-#include "llvm/DerivedTypes.h"
-#include "llvm/Module.h"
-#include "llvm/TypeSymbolTable.h"
-#include "llvm/ValueSymbolTable.h"
-#include "llvm/Instructions.h"
-#include "llvm/Assembly/Writer.h"
-#include "llvm/Support/Streams.h"
-#include "llvm/System/Path.h"
-#include <sstream>
-using namespace llvm;
-
-// Error - Simple wrapper function to conditionally assign to E and return true.
-// This just makes error return conditions a little bit simpler...
-static inline bool Error(std::string *E, const std::string &Message) {
- if (E) *E = Message;
- return true;
-}
-
-// ToStr - Simple wrapper function to convert a type to a string.
-static std::string ToStr(const Type *Ty, const Module *M) {
- std::ostringstream OS;
- WriteTypeSymbolic(OS, Ty, M);
- return OS.str();
-}
-
-//
-// Function: ResolveTypes()
-//
-// Description:
-// Attempt to link the two specified types together.
-//
-// Inputs:
-// DestTy - The type to which we wish to resolve.
-// SrcTy - The original type which we want to resolve.
-// Name - The name of the type.
-//
-// Outputs:
-// DestST - The symbol table in which the new type should be placed.
-//
-// Return value:
-// true - There is an error and the types cannot yet be linked.
-// false - No errors.
-//
-static bool ResolveTypes(const Type *DestTy, const Type *SrcTy,
- TypeSymbolTable *DestST, const std::string &Name) {
- if (DestTy == SrcTy) return false; // If already equal, noop
-
- // Does the type already exist in the module?
- if (DestTy && !isa<OpaqueType>(DestTy)) { // Yup, the type already exists...
- if (const OpaqueType *OT = dyn_cast<OpaqueType>(SrcTy)) {
- const_cast<OpaqueType*>(OT)->refineAbstractTypeTo(DestTy);
- } else {
- return true; // Cannot link types... neither is opaque and not-equal
- }
- } else { // Type not in dest module. Add it now.
- if (DestTy) // Type _is_ in module, just opaque...
- const_cast<OpaqueType*>(cast<OpaqueType>(DestTy))
- ->refineAbstractTypeTo(SrcTy);
- else if (!Name.empty())
- DestST->insert(Name, const_cast<Type*>(SrcTy));
- }
- return false;
-}
-
-static const FunctionType *getFT(const PATypeHolder &TH) {
- return cast<FunctionType>(TH.get());
-}
-static const StructType *getST(const PATypeHolder &TH) {
- return cast<StructType>(TH.get());
-}
-
-// RecursiveResolveTypes - This is just like ResolveTypes, except that it
-// recurses down into derived types, merging the used types if the parent types
-// are compatible.
-static bool RecursiveResolveTypesI(const PATypeHolder &DestTy,
- const PATypeHolder &SrcTy,
- TypeSymbolTable *DestST,
- const std::string &Name,
- std::vector<std::pair<PATypeHolder, PATypeHolder> > &Pointers) {
- const Type *SrcTyT = SrcTy.get();
- const Type *DestTyT = DestTy.get();
- if (DestTyT == SrcTyT) return false; // If already equal, noop
-
- // If we found our opaque type, resolve it now!
- if (isa<OpaqueType>(DestTyT) || isa<OpaqueType>(SrcTyT))
- return ResolveTypes(DestTyT, SrcTyT, DestST, Name);
-
- // Two types cannot be resolved together if they are of different primitive
- // type. For example, we cannot resolve an int to a float.
- if (DestTyT->getTypeID() != SrcTyT->getTypeID()) return true;
-
- // Otherwise, resolve the used type used by this derived type...
- switch (DestTyT->getTypeID()) {
- case Type::IntegerTyID: {
- if (cast<IntegerType>(DestTyT)->getBitWidth() !=
- cast<IntegerType>(SrcTyT)->getBitWidth())
- return true;
- return false;
- }
- case Type::FunctionTyID: {
- if (cast<FunctionType>(DestTyT)->isVarArg() !=
- cast<FunctionType>(SrcTyT)->isVarArg() ||
- cast<FunctionType>(DestTyT)->getNumContainedTypes() !=
- cast<FunctionType>(SrcTyT)->getNumContainedTypes())
- return true;
- for (unsigned i = 0, e = getFT(DestTy)->getNumContainedTypes(); i != e; ++i)
- if (RecursiveResolveTypesI(getFT(DestTy)->getContainedType(i),
- getFT(SrcTy)->getContainedType(i), DestST, "",
- Pointers))
- return true;
- return false;
- }
- case Type::StructTyID: {
- if (getST(DestTy)->getNumContainedTypes() !=
- getST(SrcTy)->getNumContainedTypes()) return 1;
- for (unsigned i = 0, e = getST(DestTy)->getNumContainedTypes(); i != e; ++i)
- if (RecursiveResolveTypesI(getST(DestTy)->getContainedType(i),
- getST(SrcTy)->getContainedType(i), DestST, "",
- Pointers))
- return true;
- return false;
- }
- case Type::ArrayTyID: {
- const ArrayType *DAT = cast<ArrayType>(DestTy.get());
- const ArrayType *SAT = cast<ArrayType>(SrcTy.get());
- if (DAT->getNumElements() != SAT->getNumElements()) return true;
- return RecursiveResolveTypesI(DAT->getElementType(), SAT->getElementType(),
- DestST, "", Pointers);
- }
- case Type::PointerTyID: {
- // If this is a pointer type, check to see if we have already seen it. If
- // so, we are in a recursive branch. Cut off the search now. We cannot use
- // an associative container for this search, because the type pointers (keys
- // in the container) change whenever types get resolved...
- for (unsigned i = 0, e = Pointers.size(); i != e; ++i)
- if (Pointers[i].first == DestTy)
- return Pointers[i].second != SrcTy;
-
- // Otherwise, add the current pointers to the vector to stop recursion on
- // this pair.
- Pointers.push_back(std::make_pair(DestTyT, SrcTyT));
- bool Result =
- RecursiveResolveTypesI(cast<PointerType>(DestTy.get())->getElementType(),
- cast<PointerType>(SrcTy.get())->getElementType(),
- DestST, "", Pointers);
- Pointers.pop_back();
- return Result;
- }
- default: assert(0 && "Unexpected type!"); return true;
- }
-}
-
-static bool RecursiveResolveTypes(const PATypeHolder &DestTy,
- const PATypeHolder &SrcTy,
- TypeSymbolTable *DestST,
- const std::string &Name){
- std::vector<std::pair<PATypeHolder, PATypeHolder> > PointerTypes;
- return RecursiveResolveTypesI(DestTy, SrcTy, DestST, Name, PointerTypes);
-}
-
-
-// LinkTypes - Go through the symbol table of the Src module and see if any
-// types are named in the src module that are not named in the Dst module.
-// Make sure there are no type name conflicts.
-static bool LinkTypes(Module *Dest, const Module *Src, std::string *Err) {
- TypeSymbolTable *DestST = &Dest->getTypeSymbolTable();
- const TypeSymbolTable *SrcST = &Src->getTypeSymbolTable();
-
- // Look for a type plane for Type's...
- TypeSymbolTable::const_iterator TI = SrcST->begin();
- TypeSymbolTable::const_iterator TE = SrcST->end();
- if (TI == TE) return false; // No named types, do nothing.
-
- // Some types cannot be resolved immediately because they depend on other
- // types being resolved to each other first. This contains a list of types we
- // are waiting to recheck.
- std::vector<std::string> DelayedTypesToResolve;
-
- for ( ; TI != TE; ++TI ) {
- const std::string &Name = TI->first;
- const Type *RHS = TI->second;
-
- // Check to see if this type name is already in the dest module...
- Type *Entry = DestST->lookup(Name);
-
- if (ResolveTypes(Entry, RHS, DestST, Name)) {
- // They look different, save the types 'till later to resolve.
- DelayedTypesToResolve.push_back(Name);
- }
- }
-
- // Iteratively resolve types while we can...
- while (!DelayedTypesToResolve.empty()) {
- // Loop over all of the types, attempting to resolve them if possible...
- unsigned OldSize = DelayedTypesToResolve.size();
-
- // Try direct resolution by name...
- for (unsigned i = 0; i != DelayedTypesToResolve.size(); ++i) {
- const std::string &Name = DelayedTypesToResolve[i];
- Type *T1 = SrcST->lookup(Name);
- Type *T2 = DestST->lookup(Name);
- if (!ResolveTypes(T2, T1, DestST, Name)) {
- // We are making progress!
- DelayedTypesToResolve.erase(DelayedTypesToResolve.begin()+i);
- --i;
- }
- }
-
- // Did we not eliminate any types?
- if (DelayedTypesToResolve.size() == OldSize) {
- // Attempt to resolve subelements of types. This allows us to merge these
- // two types: { int* } and { opaque* }
- for (unsigned i = 0, e = DelayedTypesToResolve.size(); i != e; ++i) {
- const std::string &Name = DelayedTypesToResolve[i];
- PATypeHolder T1(SrcST->lookup(Name));
- PATypeHolder T2(DestST->lookup(Name));
-
- if (!RecursiveResolveTypes(T2, T1, DestST, Name)) {
- // We are making progress!
- DelayedTypesToResolve.erase(DelayedTypesToResolve.begin()+i);
-
- // Go back to the main loop, perhaps we can resolve directly by name
- // now...
- break;
- }
- }
-
- // If we STILL cannot resolve the types, then there is something wrong.
- if (DelayedTypesToResolve.size() == OldSize) {
- // Remove the symbol name from the destination.
- DelayedTypesToResolve.pop_back();
- }
- }
- }
-
-
- return false;
-}
-
-static void PrintMap(const std::map<const Value*, Value*> &M) {
- for (std::map<const Value*, Value*>::const_iterator I = M.begin(), E =M.end();
- I != E; ++I) {
- cerr << " Fr: " << (void*)I->first << " ";
- I->first->dump();
- cerr << " To: " << (void*)I->second << " ";
- I->second->dump();
- cerr << "\n";
- }
-}
-
-
-// RemapOperand - Use ValueMap to convert constants from one module to another.
-static Value *RemapOperand(const Value *In,
- std::map<const Value*, Value*> &ValueMap) {
- std::map<const Value*,Value*>::const_iterator I = ValueMap.find(In);
- if (I != ValueMap.end())
- return I->second;
-
- // Check to see if it's a constant that we are interested in transforming.
- Value *Result = 0;
- if (const Constant *CPV = dyn_cast<Constant>(In)) {
- if ((!isa<DerivedType>(CPV->getType()) && !isa<ConstantExpr>(CPV)) ||
- isa<ConstantInt>(CPV) || isa<ConstantAggregateZero>(CPV))
- return const_cast<Constant*>(CPV); // Simple constants stay identical.
-
- if (const ConstantArray *CPA = dyn_cast<ConstantArray>(CPV)) {
- std::vector<Constant*> Operands(CPA->getNumOperands());
- for (unsigned i = 0, e = CPA->getNumOperands(); i != e; ++i)
- Operands[i] =cast<Constant>(RemapOperand(CPA->getOperand(i), ValueMap));
- Result = ConstantArray::get(cast<ArrayType>(CPA->getType()), Operands);
- } else if (const ConstantStruct *CPS = dyn_cast<ConstantStruct>(CPV)) {
- std::vector<Constant*> Operands(CPS->getNumOperands());
- for (unsigned i = 0, e = CPS->getNumOperands(); i != e; ++i)
- Operands[i] =cast<Constant>(RemapOperand(CPS->getOperand(i), ValueMap));
- Result = ConstantStruct::get(cast<StructType>(CPS->getType()), Operands);
- } else if (isa<ConstantPointerNull>(CPV) || isa<UndefValue>(CPV)) {
- Result = const_cast<Constant*>(CPV);
- } else if (const ConstantVector *CP = dyn_cast<ConstantVector>(CPV)) {
- std::vector<Constant*> Operands(CP->getNumOperands());
- for (unsigned i = 0, e = CP->getNumOperands(); i != e; ++i)
- Operands[i] = cast<Constant>(RemapOperand(CP->getOperand(i), ValueMap));
- Result = ConstantVector::get(Operands);
- } else if (const ConstantExpr *CE = dyn_cast<ConstantExpr>(CPV)) {
- std::vector<Constant*> Ops;
- for (unsigned i = 0, e = CE->getNumOperands(); i != e; ++i)
- Ops.push_back(cast<Constant>(RemapOperand(CE->getOperand(i),ValueMap)));
- Result = CE->getWithOperands(Ops);
- } else if (isa<GlobalValue>(CPV)) {
- assert(0 && "Unmapped global?");
- } else {
- assert(0 && "Unknown type of derived type constant value!");
- }
- } else if (isa<InlineAsm>(In)) {
- Result = const_cast<Value*>(In);
- }
-
- // Cache the mapping in our local map structure
- if (Result) {
- ValueMap[In] = Result;
- return Result;
- }
-
-
- cerr << "LinkModules ValueMap: \n";
- PrintMap(ValueMap);
-
- cerr << "Couldn't remap value: " << (void*)In << " " << *In << "\n";
- assert(0 && "Couldn't remap value!");
- return 0;
-}
-
-/// ForceRenaming - The LLVM SymbolTable class autorenames globals that conflict
-/// in the symbol table. This is good for all clients except for us. Go
-/// through the trouble to force this back.
-static void ForceRenaming(GlobalValue *GV, const std::string &Name) {
- assert(GV->getName() != Name && "Can't force rename to self");
- ValueSymbolTable &ST = GV->getParent()->getValueSymbolTable();
-
- // If there is a conflict, rename the conflict.
- if (GlobalValue *ConflictGV = cast_or_null<GlobalValue>(ST.lookup(Name))) {
- assert(ConflictGV->hasInternalLinkage() &&
- "Not conflicting with a static global, should link instead!");
- GV->takeName(ConflictGV);
- ConflictGV->setName(Name); // This will cause ConflictGV to get renamed
- assert(ConflictGV->getName() != Name && "ForceRenaming didn't work");
- } else {
- GV->setName(Name); // Force the name back
- }
-}
-
-/// CopyGVAttributes - copy additional attributes (those not needed to construct
-/// a GlobalValue) from the SrcGV to the DestGV.
-static void CopyGVAttributes(GlobalValue *DestGV, const GlobalValue *SrcGV) {
- // Propagate alignment, visibility and section info.
- DestGV->setAlignment(std::max(DestGV->getAlignment(), SrcGV->getAlignment()));
- DestGV->setSection(SrcGV->getSection());
- DestGV->setVisibility(SrcGV->getVisibility());
- if (const Function *SrcF = dyn_cast<Function>(SrcGV)) {
- Function *DestF = cast<Function>(DestGV);
- DestF->setCallingConv(SrcF->getCallingConv());
- DestF->setParamAttrs(SrcF->getParamAttrs());
- if (SrcF->hasCollector())
- DestF->setCollector(SrcF->getCollector());
- } else if (const GlobalVariable *SrcVar = dyn_cast<GlobalVariable>(SrcGV)) {
- GlobalVariable *DestVar = cast<GlobalVariable>(DestGV);
- DestVar->setThreadLocal(SrcVar->isThreadLocal());
- }
-}
-
-/// GetLinkageResult - This analyzes the two global values and determines what
-/// the result will look like in the destination module. In particular, it
-/// computes the resultant linkage type, computes whether the global in the
-/// source should be copied over to the destination (replacing the existing
-/// one), and computes whether this linkage is an error or not. It also performs
-/// visibility checks: we cannot link together two symbols with different
-/// visibilities.
-static bool GetLinkageResult(GlobalValue *Dest, const GlobalValue *Src,
- GlobalValue::LinkageTypes &LT, bool &LinkFromSrc,
- std::string *Err) {
- assert((!Dest || !Src->hasInternalLinkage()) &&
- "If Src has internal linkage, Dest shouldn't be set!");
- if (!Dest) {
- // Linking something to nothing.
- LinkFromSrc = true;
- LT = Src->getLinkage();
- } else if (Src->isDeclaration()) {
- // If Src is external or if both Src & Dest are external.. Just link the
- // external globals, we aren't adding anything.
- if (Src->hasDLLImportLinkage()) {
- // If one of GVs has DLLImport linkage, result should be dllimport'ed.
- if (Dest->isDeclaration()) {
- LinkFromSrc = true;
- LT = Src->getLinkage();
- }
- } else if (Dest->hasExternalWeakLinkage()) {
- //If the Dest is weak, use the source linkage
- LinkFromSrc = true;
- LT = Src->getLinkage();
- } else {
- LinkFromSrc = false;
- LT = Dest->getLinkage();
- }
- } else if (Dest->isDeclaration() && !Dest->hasDLLImportLinkage()) {
- // If Dest is external but Src is not:
- LinkFromSrc = true;
- LT = Src->getLinkage();
- } else if (Src->hasAppendingLinkage() || Dest->hasAppendingLinkage()) {
- if (Src->getLinkage() != Dest->getLinkage())
- return Error(Err, "Linking globals named '" + Src->getName() +
- "': can only link appending global with another appending global!");
- LinkFromSrc = true; // Special cased.
- LT = Src->getLinkage();
- } else if (Src->hasWeakLinkage() || Src->hasLinkOnceLinkage()) {
- // At this point we know that Dest has LinkOnce, External*, Weak, or
- // DLL* linkage.
- if ((Dest->hasLinkOnceLinkage() && Src->hasWeakLinkage()) ||
- Dest->hasExternalWeakLinkage()) {
- LinkFromSrc = true;
- LT = Src->getLinkage();
- } else {
- LinkFromSrc = false;
- LT = Dest->getLinkage();
- }
- } else if (Dest->hasWeakLinkage() || Dest->hasLinkOnceLinkage()) {
- // At this point we know that Src has External* or DLL* linkage.
- if (Src->hasExternalWeakLinkage()) {
- LinkFromSrc = false;
- LT = Dest->getLinkage();
- } else {
- LinkFromSrc = true;
- LT = GlobalValue::ExternalLinkage;
- }
- } else {
- assert((Dest->hasExternalLinkage() ||
- Dest->hasDLLImportLinkage() ||
- Dest->hasDLLExportLinkage() ||
- Dest->hasExternalWeakLinkage()) &&
- (Src->hasExternalLinkage() ||
- Src->hasDLLImportLinkage() ||
- Src->hasDLLExportLinkage() ||
- Src->hasExternalWeakLinkage()) &&
- "Unexpected linkage type!");
- return Error(Err, "Linking globals named '" + Src->getName() +
- "': symbol multiply defined!");
- }
-
- // Check visibility
- if (Dest && Src->getVisibility() != Dest->getVisibility())
- if (!Src->isDeclaration() && !Dest->isDeclaration())
- return Error(Err, "Linking globals named '" + Src->getName() +
- "': symbols have different visibilities!");
- return false;
-}
-
-// LinkGlobals - Loop through the global variables in the src module and merge
-// them into the dest module.
-static bool LinkGlobals(Module *Dest, const Module *Src,
- std::map<const Value*, Value*> &ValueMap,
- std::multimap<std::string, GlobalVariable *> &AppendingVars,
- std::string *Err) {
- // Loop over all of the globals in the src module, mapping them over as we go
- for (Module::const_global_iterator I = Src->global_begin(), E = Src->global_end();
- I != E; ++I) {
- const GlobalVariable *SGV = I;
- GlobalValue *DGV = 0;
-
- // Check to see if may have to link the global with the global
- if (SGV->hasName() && !SGV->hasInternalLinkage()) {
- DGV = Dest->getGlobalVariable(SGV->getName());
- if (DGV && DGV->getType() != SGV->getType())
- // If types don't agree due to opaque types, try to resolve them.
- RecursiveResolveTypes(SGV->getType(), DGV->getType(),
- &Dest->getTypeSymbolTable(), "");
- }
-
- // Check to see if may have to link the global with the alias
- if (!DGV && SGV->hasName() && !SGV->hasInternalLinkage()) {
- DGV = Dest->getNamedAlias(SGV->getName());
- if (DGV && DGV->getType() != SGV->getType())
- // If types don't agree due to opaque types, try to resolve them.
- RecursiveResolveTypes(SGV->getType(), DGV->getType(),
- &Dest->getTypeSymbolTable(), "");
- }
-
- if (DGV && DGV->hasInternalLinkage())
- DGV = 0;
-
- assert((SGV->hasInitializer() || SGV->hasExternalWeakLinkage() ||
- SGV->hasExternalLinkage() || SGV->hasDLLImportLinkage()) &&
- "Global must either be external or have an initializer!");
-
- GlobalValue::LinkageTypes NewLinkage = GlobalValue::InternalLinkage;
- bool LinkFromSrc = false;
- if (GetLinkageResult(DGV, SGV, NewLinkage, LinkFromSrc, Err))
- return true;
-
- if (!DGV) {
- // No linking to be performed, simply create an identical version of the
- // symbol over in the dest module... the initializer will be filled in
- // later by LinkGlobalInits...
- GlobalVariable *NewDGV =
- new GlobalVariable(SGV->getType()->getElementType(),
- SGV->isConstant(), SGV->getLinkage(), /*init*/0,
- SGV->getName(), Dest);
- // Propagate alignment, visibility and section info.
- CopyGVAttributes(NewDGV, SGV);
-
- // If the LLVM runtime renamed the global, but it is an externally visible
- // symbol, DGV must be an existing global with internal linkage. Rename
- // it.
- if (NewDGV->getName() != SGV->getName() && !NewDGV->hasInternalLinkage())
- ForceRenaming(NewDGV, SGV->getName());
-
- // Make sure to remember this mapping...
- ValueMap[SGV] = NewDGV;
-
- if (SGV->hasAppendingLinkage())
- // Keep track that this is an appending variable...
- AppendingVars.insert(std::make_pair(SGV->getName(), NewDGV));
- } else if (DGV->hasAppendingLinkage()) {
- // No linking is performed yet. Just insert a new copy of the global, and
- // keep track of the fact that it is an appending variable in the
- // AppendingVars map. The name is cleared out so that no linkage is
- // performed.
- GlobalVariable *NewDGV =
- new GlobalVariable(SGV->getType()->getElementType(),
- SGV->isConstant(), SGV->getLinkage(), /*init*/0,
- "", Dest);
-
- // Set alignment allowing CopyGVAttributes merge it with alignment of SGV.
- NewDGV->setAlignment(DGV->getAlignment());
- // Propagate alignment, section and visibility info.
- CopyGVAttributes(NewDGV, SGV);
-
- // Make sure to remember this mapping...
- ValueMap[SGV] = NewDGV;
-
- // Keep track that this is an appending variable...
- AppendingVars.insert(std::make_pair(SGV->getName(), NewDGV));
- } else if (GlobalAlias *DGA = dyn_cast<GlobalAlias>(DGV)) {
- // SGV is global, but DGV is alias. The only valid mapping is when SGV is
- // external declaration, which is effectively a no-op. Also make sure
- // linkage calculation was correct.
- if (SGV->isDeclaration() && !LinkFromSrc) {
- // Make sure to remember this mapping...
- ValueMap[SGV] = DGA;
- } else
- return Error(Err, "Global-Alias Collision on '" + SGV->getName() +
- "': symbol multiple defined");
- } else if (GlobalVariable *DGVar = dyn_cast<GlobalVariable>(DGV)) {
- // Otherwise, perform the global-global mapping as instructed by
- // GetLinkageResult.
- if (LinkFromSrc) {
- // Propagate alignment, section, and visibility info.
- CopyGVAttributes(DGVar, SGV);
-
- // If the types don't match, and if we are to link from the source, nuke
- // DGV and create a new one of the appropriate type.
- if (SGV->getType() != DGVar->getType()) {
- GlobalVariable *NewDGV =
- new GlobalVariable(SGV->getType()->getElementType(),
- DGVar->isConstant(), DGVar->getLinkage(),
- /*init*/0, DGVar->getName(), Dest);
- CopyGVAttributes(NewDGV, DGVar);
- DGV->replaceAllUsesWith(ConstantExpr::getBitCast(NewDGV,
- DGVar->getType()));
- // DGVar will conflict with NewDGV because they both had the same
- // name. We must erase this now so ForceRenaming doesn't assert
- // because DGV might not have internal linkage.
- DGVar->eraseFromParent();
-
- // If the symbol table renamed the global, but it is an externally
- // visible symbol, DGV must be an existing global with internal
- // linkage. Rename it.
- if (NewDGV->getName() != SGV->getName() &&
- !NewDGV->hasInternalLinkage())
- ForceRenaming(NewDGV, SGV->getName());
-
- DGVar = NewDGV;
- }
-
- // Inherit const as appropriate
- DGVar->setConstant(SGV->isConstant());
-
- // Set initializer to zero, so we can link the stuff later
- DGVar->setInitializer(0);
- } else {
- // Special case for const propagation
- if (DGVar->isDeclaration() && SGV->isConstant() && !DGVar->isConstant())
- DGVar->setConstant(true);
- }
-
- // Set calculated linkage
- DGVar->setLinkage(NewLinkage);
-
- // Make sure to remember this mapping...
- ValueMap[SGV] = ConstantExpr::getBitCast(DGVar, SGV->getType());
- }
- }
- return false;
-}
-
-static GlobalValue::LinkageTypes
-CalculateAliasLinkage(const GlobalValue *SGV, const GlobalValue *DGV) {
- if (SGV->hasExternalLinkage() || DGV->hasExternalLinkage())
- return GlobalValue::ExternalLinkage;
- else if (SGV->hasWeakLinkage() || DGV->hasWeakLinkage())
- return GlobalValue::WeakLinkage;
- else {
- assert(SGV->hasInternalLinkage() && DGV->hasInternalLinkage() &&
- "Unexpected linkage type");
- return GlobalValue::InternalLinkage;
- }
-}
-
-// LinkAlias - Loop through the alias in the src module and link them into the
-// dest module. We're assuming, that all functions/global variables were already
-// linked in.
-static bool LinkAlias(Module *Dest, const Module *Src,
- std::map<const Value*, Value*> &ValueMap,
- std::string *Err) {
- // Loop over all alias in the src module
- for (Module::const_alias_iterator I = Src->alias_begin(),
- E = Src->alias_end(); I != E; ++I) {
- const GlobalAlias *SGA = I;
- const GlobalValue *SAliasee = SGA->getAliasedGlobal();
- GlobalAlias *NewGA = NULL;
-
- // Globals were already linked, thus we can just query ValueMap for variant
- // of SAliasee in Dest
- std::map<const Value*,Value*>::const_iterator VMI = ValueMap.find(SAliasee);
- assert(VMI != ValueMap.end() && "Aliasee not linked");
- GlobalValue* DAliasee = cast<GlobalValue>(VMI->second);
-
- // Try to find something 'similar' to SGA in destination module.
- if (GlobalAlias *DGA = Dest->getNamedAlias(SGA->getName())) {
- // If types don't agree due to opaque types, try to resolve them.
- if (RecursiveResolveTypes(SGA->getType(), DGA->getType(),
- &Dest->getTypeSymbolTable(), ""))
- return Error(Err, "Alias Collision on '" + SGA->getName()+
- "': aliases have different types");
-
- // Now types are known to be the same, check whether aliasees equal. As
- // globals are already linked we just need query ValueMap to find the
- // mapping.
- if (DAliasee == DGA->getAliasedGlobal()) {
- // This is just two copies of the same alias. Propagate linkage, if
- // necessary.
- DGA->setLinkage(CalculateAliasLinkage(SGA, DGA));
-
- NewGA = DGA;
- // Proceed to 'common' steps
- } else
- return Error(Err, "Alias Collision on '" + SGA->getName()+
- "': aliases have different aliasees");
- } else if (GlobalVariable *DGV = Dest->getGlobalVariable(SGA->getName())) {
- RecursiveResolveTypes(SGA->getType(), DGV->getType(),
- &Dest->getTypeSymbolTable(), "");
-
- // The only allowed way is to link alias with external declaration.
- if (DGV->isDeclaration()) {
- // But only if aliasee is global too...
- if (!isa<GlobalVariable>(DAliasee))
- return Error(Err, "Global-Alias Collision on '" + SGA->getName() +
- "': aliasee is not global variable");
-
- NewGA = new GlobalAlias(SGA->getType(), SGA->getLinkage(),
- SGA->getName(), DAliasee, Dest);
- CopyGVAttributes(NewGA, SGA);
-
- // Any uses of DGV need to change to NewGA, with cast, if needed.
- if (SGA->getType() != DGV->getType())
- DGV->replaceAllUsesWith(ConstantExpr::getBitCast(NewGA,
- DGV->getType()));
- else
- DGV->replaceAllUsesWith(NewGA);
-
- // DGV will conflict with NewGA because they both had the same
- // name. We must erase this now so ForceRenaming doesn't assert
- // because DGV might not have internal linkage.
- DGV->eraseFromParent();
-
- // Proceed to 'common' steps
- } else
- return Error(Err, "Global-Alias Collision on '" + SGA->getName() +
- "': symbol multiple defined");
- } else if (Function *DF = Dest->getFunction(SGA->getName())) {
- RecursiveResolveTypes(SGA->getType(), DF->getType(),
- &Dest->getTypeSymbolTable(), "");
-
- // The only allowed way is to link alias with external declaration.
- if (DF->isDeclaration()) {
- // But only if aliasee is function too...
- if (!isa<Function>(DAliasee))
- return Error(Err, "Function-Alias Collision on '" + SGA->getName() +
- "': aliasee is not function");
-
- NewGA = new GlobalAlias(SGA->getType(), SGA->getLinkage(),
- SGA->getName(), DAliasee, Dest);
- CopyGVAttributes(NewGA, SGA);
-
- // Any uses of DF need to change to NewGA, with cast, if needed.
- if (SGA->getType() != DF->getType())
- DF->replaceAllUsesWith(ConstantExpr::getBitCast(NewGA,
- DF->getType()));
- else
- DF->replaceAllUsesWith(NewGA);
-
- // DF will conflict with NewGA because they both had the same
- // name. We must erase this now so ForceRenaming doesn't assert
- // because DF might not have internal linkage.
- DF->eraseFromParent();
-
- // Proceed to 'common' steps
- } else
- return Error(Err, "Function-Alias Collision on '" + SGA->getName() +
- "': symbol multiple defined");
- } else {
- // Nothing similar found, just copy alias into destination module.
-
- NewGA = new GlobalAlias(SGA->getType(), SGA->getLinkage(),
- SGA->getName(), DAliasee, Dest);
- CopyGVAttributes(NewGA, SGA);
-
- // Proceed to 'common' steps
- }
-
- assert(NewGA && "No alias was created in destination module!");
-
- // If the symbol table renamed the alias, but it is an externally visible
- // symbol, DGV must be an global value with internal linkage. Rename it.
- if (NewGA->getName() != SGA->getName() &&
- !NewGA->hasInternalLinkage())
- ForceRenaming(NewGA, SGA->getName());
-
- // Remember this mapping so uses in the source module get remapped
- // later by RemapOperand.
- ValueMap[SGA] = NewGA;
- }
-
- return false;
-}
-
-
-// LinkGlobalInits - Update the initializers in the Dest module now that all
-// globals that may be referenced are in Dest.
-static bool LinkGlobalInits(Module *Dest, const Module *Src,
- std::map<const Value*, Value*> &ValueMap,
- std::string *Err) {
-
- // Loop over all of the globals in the src module, mapping them over as we go
- for (Module::const_global_iterator I = Src->global_begin(),
- E = Src->global_end(); I != E; ++I) {
- const GlobalVariable *SGV = I;
-
- if (SGV->hasInitializer()) { // Only process initialized GV's
- // Figure out what the initializer looks like in the dest module...
- Constant *SInit =
- cast<Constant>(RemapOperand(SGV->getInitializer(), ValueMap));
-
- GlobalVariable *DGV =
- cast<GlobalVariable>(ValueMap[SGV]->stripPointerCasts());
- if (DGV->hasInitializer()) {
- if (SGV->hasExternalLinkage()) {
- if (DGV->getInitializer() != SInit)
- return Error(Err, "Global Variable Collision on '" + SGV->getName() +
- "': global variables have different initializers");
- } else if (DGV->hasLinkOnceLinkage() || DGV->hasWeakLinkage()) {
- // Nothing is required, mapped values will take the new global
- // automatically.
- } else if (SGV->hasLinkOnceLinkage() || SGV->hasWeakLinkage()) {
- // Nothing is required, mapped values will take the new global
- // automatically.
- } else if (DGV->hasAppendingLinkage()) {
- assert(0 && "Appending linkage unimplemented!");
- } else {
- assert(0 && "Unknown linkage!");
- }
- } else {
- // Copy the initializer over now...
- DGV->setInitializer(SInit);
- }
- }
- }
- return false;
-}
-
-// LinkFunctionProtos - Link the functions together between the two modules,
-// without doing function bodies... this just adds external function prototypes
-// to the Dest function...
-//
-static bool LinkFunctionProtos(Module *Dest, const Module *Src,
- std::map<const Value*, Value*> &ValueMap,
- std::string *Err) {
- // Loop over all of the functions in the src module, mapping them over
- for (Module::const_iterator I = Src->begin(), E = Src->end(); I != E; ++I) {
- const Function *SF = I; // SrcFunction
- Function *DF = 0;
- if (SF->hasName() && !SF->hasInternalLinkage()) {
- // Check to see if may have to link the function.
- DF = Dest->getFunction(SF->getName());
- if (DF && SF->getType() != DF->getType())
- // If types don't agree because of opaque, try to resolve them
- RecursiveResolveTypes(SF->getType(), DF->getType(),
- &Dest->getTypeSymbolTable(), "");
- }
-
- // Check visibility
- if (DF && !DF->hasInternalLinkage() &&
- SF->getVisibility() != DF->getVisibility()) {
- // If one is a prototype, ignore its visibility. Prototypes are always
- // overridden by the definition.
- if (!SF->isDeclaration() && !DF->isDeclaration())
- return Error(Err, "Linking functions named '" + SF->getName() +
- "': symbols have different visibilities!");
- }
-
- if (DF && DF->hasInternalLinkage())
- DF = NULL;
-
- if (DF && DF->getType() != SF->getType()) {
- if (DF->isDeclaration() && !SF->isDeclaration()) {
- // We have a definition of the same name but different type in the
- // source module. Copy the prototype to the destination and replace
- // uses of the destination's prototype with the new prototype.
- Function *NewDF = Function::Create(SF->getFunctionType(), SF->getLinkage(),
- SF->getName(), Dest);
- CopyGVAttributes(NewDF, SF);
-
- // Any uses of DF need to change to NewDF, with cast
- DF->replaceAllUsesWith(ConstantExpr::getBitCast(NewDF, DF->getType()));
-
- // DF will conflict with NewDF because they both had the same. We must
- // erase this now so ForceRenaming doesn't assert because DF might
- // not have internal linkage.
- DF->eraseFromParent();
-
- // If the symbol table renamed the function, but it is an externally
- // visible symbol, DF must be an existing function with internal
- // linkage. Rename it.
- if (NewDF->getName() != SF->getName() && !NewDF->hasInternalLinkage())
- ForceRenaming(NewDF, SF->getName());
-
- // Remember this mapping so uses in the source module get remapped
- // later by RemapOperand.
- ValueMap[SF] = NewDF;
- } else if (SF->isDeclaration()) {
- // We have two functions of the same name but different type and the
- // source is a declaration while the destination is not. Any use of
- // the source must be mapped to the destination, with a cast.
- ValueMap[SF] = ConstantExpr::getBitCast(DF, SF->getType());
- } else {
- // We have two functions of the same name but different types and they
- // are both definitions. This is an error.
- return Error(Err, "Function '" + DF->getName() + "' defined as both '" +
- ToStr(SF->getFunctionType(), Src) + "' and '" +
- ToStr(DF->getFunctionType(), Dest) + "'");
- }
- } else if (!DF || SF->hasInternalLinkage() || DF->hasInternalLinkage()) {
- // Function does not already exist, simply insert an function signature
- // identical to SF into the dest module.
- Function *NewDF = Function::Create(SF->getFunctionType(), SF->getLinkage(),
- SF->getName(), Dest);
- CopyGVAttributes(NewDF, SF);
-
- // If the LLVM runtime renamed the function, but it is an externally
- // visible symbol, DF must be an existing function with internal linkage.
- // Rename it.
- if (NewDF->getName() != SF->getName() && !NewDF->hasInternalLinkage())
- ForceRenaming(NewDF, SF->getName());
-
- // ... and remember this mapping...
- ValueMap[SF] = NewDF;
- } else if (SF->isDeclaration()) {
- // If SF is a declaration or if both SF & DF are declarations, just link
- // the declarations, we aren't adding anything.
- if (SF->hasDLLImportLinkage()) {
- if (DF->isDeclaration()) {
- ValueMap.insert(std::make_pair(SF, DF));
- DF->setLinkage(SF->getLinkage());
- }
- } else {
- ValueMap[SF] = DF;
- }
- } else if (DF->isDeclaration() && !DF->hasDLLImportLinkage()) {
- // If DF is external but SF is not...
- // Link the external functions, update linkage qualifiers
- ValueMap.insert(std::make_pair(SF, DF));
- DF->setLinkage(SF->getLinkage());
- // Visibility of prototype is overridden by vis of definition.
- DF->setVisibility(SF->getVisibility());
- } else if (SF->hasWeakLinkage() || SF->hasLinkOnceLinkage()) {
- // At this point we know that DF has LinkOnce, Weak, or External* linkage.
- ValueMap[SF] = DF;
-
- // Linkonce+Weak = Weak
- // *+External Weak = *
- if ((DF->hasLinkOnceLinkage() && SF->hasWeakLinkage()) ||
- DF->hasExternalWeakLinkage())
- DF->setLinkage(SF->getLinkage());
- } else if (DF->hasWeakLinkage() || DF->hasLinkOnceLinkage()) {
- // At this point we know that SF has LinkOnce or External* linkage.
- ValueMap[SF] = DF;
- if (!SF->hasLinkOnceLinkage() && !SF->hasExternalWeakLinkage())
- // Don't inherit linkonce & external weak linkage
- DF->setLinkage(SF->getLinkage());
- } else if (SF->getLinkage() != DF->getLinkage()) {
- return Error(Err, "Functions named '" + SF->getName() +
- "' have different linkage specifiers!");
- } else if (SF->hasExternalLinkage()) {
- // The function is defined identically in both modules!!
- return Error(Err, "Function '" +
- ToStr(SF->getFunctionType(), Src) + "':\"" +
- SF->getName() + "\" - Function is already defined!");
- } else {
- assert(0 && "Unknown linkage configuration found!");
- }
- }
- return false;
-}
-
-// LinkFunctionBody - Copy the source function over into the dest function and
-// fix up references to values. At this point we know that Dest is an external
-// function, and that Src is not.
-static bool LinkFunctionBody(Function *Dest, Function *Src,
- std::map<const Value*, Value*> &ValueMap,
- std::string *Err) {
- assert(Src && Dest && Dest->isDeclaration() && !Src->isDeclaration());
-
- // Go through and convert function arguments over, remembering the mapping.
- Function::arg_iterator DI = Dest->arg_begin();
- for (Function::arg_iterator I = Src->arg_begin(), E = Src->arg_end();
- I != E; ++I, ++DI) {
- DI->setName(I->getName()); // Copy the name information over...
-
- // Add a mapping to our local map
- ValueMap[I] = DI;
- }
-
- // Splice the body of the source function into the dest function.
- Dest->getBasicBlockList().splice(Dest->end(), Src->getBasicBlockList());
-
- // At this point, all of the instructions and values of the function are now
- // copied over. The only problem is that they are still referencing values in
- // the Source function as operands. Loop through all of the operands of the
- // functions and patch them up to point to the local versions...
- //
- for (Function::iterator BB = Dest->begin(), BE = Dest->end(); BB != BE; ++BB)
- for (BasicBlock::iterator I = BB->begin(), E = BB->end(); I != E; ++I)
- for (Instruction::op_iterator OI = I->op_begin(), OE = I->op_end();
- OI != OE; ++OI)
- if (!isa<Instruction>(*OI) && !isa<BasicBlock>(*OI))
- *OI = RemapOperand(*OI, ValueMap);
-
- // There is no need to map the arguments anymore.
- for (Function::arg_iterator I = Src->arg_begin(), E = Src->arg_end();
- I != E; ++I)
- ValueMap.erase(I);
-
- return false;
-}
-
-
-// LinkFunctionBodies - Link in the function bodies that are defined in the
-// source module into the DestModule. This consists basically of copying the
-// function over and fixing up references to values.
-static bool LinkFunctionBodies(Module *Dest, Module *Src,
- std::map<const Value*, Value*> &ValueMap,
- std::string *Err) {
-
- // Loop over all of the functions in the src module, mapping them over as we
- // go
- for (Module::iterator SF = Src->begin(), E = Src->end(); SF != E; ++SF) {
- if (!SF->isDeclaration()) { // No body if function is external
- Function *DF = cast<Function>(ValueMap[SF]); // Destination function
-
- // DF not external SF external?
- if (DF->isDeclaration())
- // Only provide the function body if there isn't one already.
- if (LinkFunctionBody(DF, SF, ValueMap, Err))
- return true;
- }
- }
- return false;
-}
-
-// LinkAppendingVars - If there were any appending global variables, link them
-// together now. Return true on error.
-static bool LinkAppendingVars(Module *M,
- std::multimap<std::string, GlobalVariable *> &AppendingVars,
- std::string *ErrorMsg) {
- if (AppendingVars.empty()) return false; // Nothing to do.
-
- // Loop over the multimap of appending vars, processing any variables with the
- // same name, forming a new appending global variable with both of the
- // initializers merged together, then rewrite references to the old variables
- // and delete them.
- std::vector<Constant*> Inits;
- while (AppendingVars.size() > 1) {
- // Get the first two elements in the map...
- std::multimap<std::string,
- GlobalVariable*>::iterator Second = AppendingVars.begin(), First=Second++;
-
- // If the first two elements are for different names, there is no pair...
- // Otherwise there is a pair, so link them together...
- if (First->first == Second->first) {
- GlobalVariable *G1 = First->second, *G2 = Second->second;
- const ArrayType *T1 = cast<ArrayType>(G1->getType()->getElementType());
- const ArrayType *T2 = cast<ArrayType>(G2->getType()->getElementType());
-
- // Check to see that they two arrays agree on type...
- if (T1->getElementType() != T2->getElementType())
- return Error(ErrorMsg,
- "Appending variables with different element types need to be linked!");
- if (G1->isConstant() != G2->isConstant())
- return Error(ErrorMsg,
- "Appending variables linked with different const'ness!");
-
- if (G1->getAlignment() != G2->getAlignment())
- return Error(ErrorMsg,
- "Appending variables with different alignment need to be linked!");
-
- if (G1->getVisibility() != G2->getVisibility())
- return Error(ErrorMsg,
- "Appending variables with different visibility need to be linked!");
-
- if (G1->getSection() != G2->getSection())
- return Error(ErrorMsg,
- "Appending variables with different section name need to be linked!");
-
- unsigned NewSize = T1->getNumElements() + T2->getNumElements();
- ArrayType *NewType = ArrayType::get(T1->getElementType(), NewSize);
-
- G1->setName(""); // Clear G1's name in case of a conflict!
-
- // Create the new global variable...
- GlobalVariable *NG =
- new GlobalVariable(NewType, G1->isConstant(), G1->getLinkage(),
- /*init*/0, First->first, M, G1->isThreadLocal());
-
- // Propagate alignment, visibility and section info.
- CopyGVAttributes(NG, G1);
-
- // Merge the initializer...
- Inits.reserve(NewSize);
- if (ConstantArray *I = dyn_cast<ConstantArray>(G1->getInitializer())) {
- for (unsigned i = 0, e = T1->getNumElements(); i != e; ++i)
- Inits.push_back(I->getOperand(i));
- } else {
- assert(isa<ConstantAggregateZero>(G1->getInitializer()));
- Constant *CV = Constant::getNullValue(T1->getElementType());
- for (unsigned i = 0, e = T1->getNumElements(); i != e; ++i)
- Inits.push_back(CV);
- }
- if (ConstantArray *I = dyn_cast<ConstantArray>(G2->getInitializer())) {
- for (unsigned i = 0, e = T2->getNumElements(); i != e; ++i)
- Inits.push_back(I->getOperand(i));
- } else {
- assert(isa<ConstantAggregateZero>(G2->getInitializer()));
- Constant *CV = Constant::getNullValue(T2->getElementType());
- for (unsigned i = 0, e = T2->getNumElements(); i != e; ++i)
- Inits.push_back(CV);
- }
- NG->setInitializer(ConstantArray::get(NewType, Inits));
- Inits.clear();
-
- // Replace any uses of the two global variables with uses of the new
- // global...
-
- // FIXME: This should rewrite simple/straight-forward uses such as
- // getelementptr instructions to not use the Cast!
- G1->replaceAllUsesWith(ConstantExpr::getBitCast(NG, G1->getType()));
- G2->replaceAllUsesWith(ConstantExpr::getBitCast(NG, G2->getType()));
-
- // Remove the two globals from the module now...
- M->getGlobalList().erase(G1);
- M->getGlobalList().erase(G2);
-
- // Put the new global into the AppendingVars map so that we can handle
- // linking of more than two vars...
- Second->second = NG;
- }
- AppendingVars.erase(First);
- }
-
- return false;
-}
-
-static bool ResolveAliases(Module *Dest) {
- for (Module::alias_iterator I = Dest->alias_begin(), E = Dest->alias_end();
- I != E; ++I)
- if (const GlobalValue *GV = I->resolveAliasedGlobal())
- if (!GV->isDeclaration())
- I->replaceAllUsesWith(const_cast<GlobalValue*>(GV));
-
- return false;
-}
-
-// LinkModules - This function links two modules together, with the resulting
-// left module modified to be the composite of the two input modules. If an
-// error occurs, true is returned and ErrorMsg (if not null) is set to indicate
-// the problem. Upon failure, the Dest module could be in a modified state, and
-// shouldn't be relied on to be consistent.
-bool
-Linker::LinkModules(Module *Dest, Module *Src, std::string *ErrorMsg) {
- assert(Dest != 0 && "Invalid Destination module");
- assert(Src != 0 && "Invalid Source Module");
-
- if (Dest->getDataLayout().empty()) {
- if (!Src->getDataLayout().empty()) {
- Dest->setDataLayout(Src->getDataLayout());
- } else {
- std::string DataLayout;
-
- if (Dest->getEndianness() == Module::AnyEndianness) {
- if (Src->getEndianness() == Module::BigEndian)
- DataLayout.append("E");
- else if (Src->getEndianness() == Module::LittleEndian)
- DataLayout.append("e");
- }
-
- if (Dest->getPointerSize() == Module::AnyPointerSize) {
- if (Src->getPointerSize() == Module::Pointer64)
- DataLayout.append(DataLayout.length() == 0 ? "p:64:64" : "-p:64:64");
- else if (Src->getPointerSize() == Module::Pointer32)
- DataLayout.append(DataLayout.length() == 0 ? "p:32:32" : "-p:32:32");
- }
- Dest->setDataLayout(DataLayout);
- }
- }
-
- // Copy the target triple from the source to dest if the dest's is empty.
- if (Dest->getTargetTriple().empty() && !Src->getTargetTriple().empty())
- Dest->setTargetTriple(Src->getTargetTriple());
-
- if (!Src->getDataLayout().empty() && !Dest->getDataLayout().empty() &&
- Src->getDataLayout() != Dest->getDataLayout())
- cerr << "WARNING: Linking two modules of different data layouts!\n";
- if (!Src->getTargetTriple().empty() &&
- Dest->getTargetTriple() != Src->getTargetTriple())
- cerr << "WARNING: Linking two modules of different target triples!\n";
-
- // Append the module inline asm string.
- if (!Src->getModuleInlineAsm().empty()) {
- if (Dest->getModuleInlineAsm().empty())
- Dest->setModuleInlineAsm(Src->getModuleInlineAsm());
- else
- Dest->setModuleInlineAsm(Dest->getModuleInlineAsm()+"\n"+
- Src->getModuleInlineAsm());
- }
-
- // Update the destination module's dependent libraries list with the libraries
- // from the source module. There's no opportunity for duplicates here as the
- // Module ensures that duplicate insertions are discarded.
- for (Module::lib_iterator SI = Src->lib_begin(), SE = Src->lib_end();
- SI != SE; ++SI)
- Dest->addLibrary(*SI);
-
- // LinkTypes - Go through the symbol table of the Src module and see if any
- // types are named in the src module that are not named in the Dst module.
- // Make sure there are no type name conflicts.
- if (LinkTypes(Dest, Src, ErrorMsg))
- return true;
-
- // ValueMap - Mapping of values from what they used to be in Src, to what they
- // are now in Dest.
- std::map<const Value*, Value*> ValueMap;
-
- // AppendingVars - Keep track of global variables in the destination module
- // with appending linkage. After the module is linked together, they are
- // appended and the module is rewritten.
- std::multimap<std::string, GlobalVariable *> AppendingVars;
- for (Module::global_iterator I = Dest->global_begin(), E = Dest->global_end();
- I != E; ++I) {
- // Add all of the appending globals already in the Dest module to
- // AppendingVars.
- if (I->hasAppendingLinkage())
- AppendingVars.insert(std::make_pair(I->getName(), I));
- }
-
- // Insert all of the globals in src into the Dest module... without linking
- // initializers (which could refer to functions not yet mapped over).
- if (LinkGlobals(Dest, Src, ValueMap, AppendingVars, ErrorMsg))
- return true;
-
- // Link the functions together between the two modules, without doing function
- // bodies... this just adds external function prototypes to the Dest
- // function... We do this so that when we begin processing function bodies,
- // all of the global values that may be referenced are available in our
- // ValueMap.
- if (LinkFunctionProtos(Dest, Src, ValueMap, ErrorMsg))
- return true;
-
- // If there were any alias, link them now. We really need to do this now,
- // because all of the aliases that may be referenced need to be available in
- // ValueMap
- if (LinkAlias(Dest, Src, ValueMap, ErrorMsg)) return true;
-
- // Update the initializers in the Dest module now that all globals that may
- // be referenced are in Dest.
- if (LinkGlobalInits(Dest, Src, ValueMap, ErrorMsg)) return true;
-
- // Link in the function bodies that are defined in the source module into the
- // DestModule. This consists basically of copying the function over and
- // fixing up references to values.
- if (LinkFunctionBodies(Dest, Src, ValueMap, ErrorMsg)) return true;
-
- // If there were any appending global variables, link them together now.
- if (LinkAppendingVars(Dest, AppendingVars, ErrorMsg)) return true;
-
- // Resolve all uses of aliases with aliasees
- if (ResolveAliases(Dest)) return true;
-
- // If the source library's module id is in the dependent library list of the
- // destination library, remove it since that module is now linked in.
- sys::Path modId;
- modId.set(Src->getModuleIdentifier());
- if (!modId.isEmpty())
- Dest->removeLibrary(modId.getBasename());
-
- return false;
-}
-
-// vim: sw=2
diff --git a/release_23/lib/Linker/Linker.cpp b/release_23/lib/Linker/Linker.cpp
deleted file mode 100644
index ef242e5c798d..000000000000
--- a/release_23/lib/Linker/Linker.cpp
+++ /dev/null
@@ -1,178 +0,0 @@
-//===- lib/Linker/Linker.cpp - Basic Linker functionality ----------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains basic Linker functionality that all usages will need.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Linker.h"
-#include "llvm/Module.h"
-#include "llvm/Bitcode/ReaderWriter.h"
-#include "llvm/Config/config.h"
-#include "llvm/Support/MemoryBuffer.h"
-#include "llvm/Support/Streams.h"
-using namespace llvm;
-
-Linker::Linker(const std::string& progname, const std::string& modname,
- unsigned flags)
- : Composite(0)
- , LibPaths()
- , Flags(flags)
- , Error()
- , ProgramName(progname)
-{
- Composite = new Module(modname);
-}
-
-Linker::Linker(const std::string& progname, Module* aModule, unsigned flags)
- : Composite(aModule)
- , LibPaths()
- , Flags(flags)
- , Error()
- , ProgramName(progname)
-{
-}
-
-Linker::~Linker() {
- delete Composite;
-}
-
-bool
-Linker::error(const std::string& message) {
- Error = message;
- if (!(Flags&QuietErrors))
- cerr << ProgramName << ": error: " << message << "\n";
- return true;
-}
-
-bool
-Linker::warning(const std::string& message) {
- Error = message;
- if (!(Flags&QuietErrors))
- cerr << ProgramName << ": warning: " << message << "\n";
- return false;
-}
-
-void
-Linker::verbose(const std::string& message) {
- if (Flags&Verbose)
- cerr << " " << message << "\n";
-}
-
-void
-Linker::addPath(const sys::Path& path) {
- LibPaths.push_back(path);
-}
-
-void
-Linker::addPaths(const std::vector<std::string>& paths) {
- for (unsigned i = 0; i != paths.size(); ++i) {
- sys::Path aPath;
- aPath.set(paths[i]);
- LibPaths.push_back(aPath);
- }
-}
-
-void
-Linker::addSystemPaths() {
- sys::Path::GetBitcodeLibraryPaths(LibPaths);
- LibPaths.insert(LibPaths.begin(),sys::Path("./"));
-}
-
-Module*
-Linker::releaseModule() {
- Module* result = Composite;
- LibPaths.clear();
- Error.clear();
- Composite = 0;
- Flags = 0;
- return result;
-}
-
-// LoadObject - Read in and parse the bitcode file named by FN and return the
-// module it contains (wrapped in an auto_ptr), or auto_ptr<Module>() and set
-// Error if an error occurs.
-std::auto_ptr<Module>
-Linker::LoadObject(const sys::Path &FN) {
- std::string ParseErrorMessage;
- Module *Result = 0;
-
- const std::string &FNS = FN.toString();
- std::auto_ptr<MemoryBuffer> Buffer(MemoryBuffer::getFileOrSTDIN(FNS.c_str()));
- if (Buffer.get())
- Result = ParseBitcodeFile(Buffer.get(), &ParseErrorMessage);
- else
- ParseErrorMessage = "Error reading file '" + FNS + "'";
-
- if (Result)
- return std::auto_ptr<Module>(Result);
- Error = "Bitcode file '" + FN.toString() + "' could not be loaded";
- if (ParseErrorMessage.size())
- Error += ": " + ParseErrorMessage;
- return std::auto_ptr<Module>();
-}
-
-// IsLibrary - Determine if "Name" is a library in "Directory". Return
-// a non-empty sys::Path if its found, an empty one otherwise.
-static inline sys::Path IsLibrary(const std::string& Name,
- const sys::Path& Directory) {
-
- sys::Path FullPath(Directory);
-
- // Try the libX.a form
- FullPath.appendComponent("lib" + Name);
- FullPath.appendSuffix("a");
- if (FullPath.isArchive())
- return FullPath;
-
- // Try the libX.bca form
- FullPath.eraseSuffix();
- FullPath.appendSuffix("bca");
- if (FullPath.isArchive())
- return FullPath;
-
- // Try the libX.so (or .dylib) form
- FullPath.eraseSuffix();
- FullPath.appendSuffix(&(LTDL_SHLIB_EXT[1]));
- if (FullPath.isDynamicLibrary()) // Native shared library?
- return FullPath;
- if (FullPath.isBitcodeFile()) // .so file containing bitcode?
- return FullPath;
-
- // Not found .. fall through
-
- // Indicate that the library was not found in the directory.
- FullPath.clear();
- return FullPath;
-}
-
-/// FindLib - Try to convert Filename into the name of a file that we can open,
-/// if it does not already name a file we can open, by first trying to open
-/// Filename, then libFilename.[suffix] for each of a set of several common
-/// library suffixes, in each of the directories in LibPaths. Returns an empty
-/// Path if no matching file can be found.
-///
-sys::Path
-Linker::FindLib(const std::string &Filename) {
- // Determine if the pathname can be found as it stands.
- sys::Path FilePath(Filename);
- if (FilePath.canRead() &&
- (FilePath.isArchive() || FilePath.isDynamicLibrary()))
- return FilePath;
-
- // Iterate over the directories in Paths to see if we can find the library
- // there.
- for (unsigned Index = 0; Index != LibPaths.size(); ++Index) {
- sys::Path Directory(LibPaths[Index]);
- sys::Path FullPath = IsLibrary(Filename,Directory);
- if (!FullPath.isEmpty())
- return FullPath;
- }
- return sys::Path();
-}
diff --git a/release_23/lib/Linker/Makefile b/release_23/lib/Linker/Makefile
deleted file mode 100644
index 37f0f01a7857..000000000000
--- a/release_23/lib/Linker/Makefile
+++ /dev/null
@@ -1,15 +0,0 @@
-##===- lib/Linker/Makefile ---------------------------------*- Makefile -*-===##
-#
-# The LLVM Compiler Infrastructure
-#
-# This file is distributed under the University of Illinois Open Source
-# License. See LICENSE.TXT for details.
-#
-##===----------------------------------------------------------------------===##
-
-LEVEL = ../..
-LIBRARYNAME = LLVMLinker
-BUILD_ARCHIVE := 1
-
-include $(LEVEL)/Makefile.common
-
diff --git a/release_23/lib/Makefile b/release_23/lib/Makefile
deleted file mode 100644
index 522295937b34..000000000000
--- a/release_23/lib/Makefile
+++ /dev/null
@@ -1,15 +0,0 @@
-##===- lib/Makefile ----------------------------------------*- Makefile -*-===##
-#
-# The LLVM Compiler Infrastructure
-#
-# This file is distributed under the University of Illinois Open Source
-# License. See LICENSE.TXT for details.
-#
-##===----------------------------------------------------------------------===##
-LEVEL = ..
-
-PARALLEL_DIRS = VMCore AsmParser Bitcode Archive Analysis Transforms CodeGen \
- Target ExecutionEngine Debugger Linker
-
-include $(LEVEL)/Makefile.common
-
diff --git a/release_23/lib/Support/APFloat.cpp b/release_23/lib/Support/APFloat.cpp
deleted file mode 100644
index 7d6c4dc0bfc5..000000000000
--- a/release_23/lib/Support/APFloat.cpp
+++ /dev/null
@@ -1,2826 +0,0 @@
-//===-- APFloat.cpp - Implement APFloat class -----------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements a class to represent arbitrary precision floating
-// point values and provide a variety of arithmetic operations on them.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/ADT/APFloat.h"
-#include "llvm/ADT/FoldingSet.h"
-#include <cassert>
-#include <cstring>
-#include "llvm/Support/MathExtras.h"
-
-using namespace llvm;
-
-#define convolve(lhs, rhs) ((lhs) * 4 + (rhs))
-
-/* Assumed in hexadecimal significand parsing, and conversion to
- hexadecimal strings. */
-COMPILE_TIME_ASSERT(integerPartWidth % 4 == 0);
-
-namespace llvm {
-
- /* Represents floating point arithmetic semantics. */
- struct fltSemantics {
- /* The largest E such that 2^E is representable; this matches the
- definition of IEEE 754. */
- exponent_t maxExponent;
-
- /* The smallest E such that 2^E is a normalized number; this
- matches the definition of IEEE 754. */
- exponent_t minExponent;
-
- /* Number of bits in the significand. This includes the integer
- bit. */
- unsigned int precision;
-
- /* True if arithmetic is supported. */
- unsigned int arithmeticOK;
- };
-
- const fltSemantics APFloat::IEEEsingle = { 127, -126, 24, true };
- const fltSemantics APFloat::IEEEdouble = { 1023, -1022, 53, true };
- const fltSemantics APFloat::IEEEquad = { 16383, -16382, 113, true };
- const fltSemantics APFloat::x87DoubleExtended = { 16383, -16382, 64, true };
- const fltSemantics APFloat::Bogus = { 0, 0, 0, true };
-
- // The PowerPC format consists of two doubles. It does not map cleanly
- // onto the usual format above. For now only storage of constants of
- // this type is supported, no arithmetic.
- const fltSemantics APFloat::PPCDoubleDouble = { 1023, -1022, 106, false };
-
- /* A tight upper bound on number of parts required to hold the value
- pow(5, power) is
-
- power * 815 / (351 * integerPartWidth) + 1
-
- However, whilst the result may require only this many parts,
- because we are multiplying two values to get it, the
- multiplication may require an extra part with the excess part
- being zero (consider the trivial case of 1 * 1, tcFullMultiply
- requires two parts to hold the single-part result). So we add an
- extra one to guarantee enough space whilst multiplying. */
- const unsigned int maxExponent = 16383;
- const unsigned int maxPrecision = 113;
- const unsigned int maxPowerOfFiveExponent = maxExponent + maxPrecision - 1;
- const unsigned int maxPowerOfFiveParts = 2 + ((maxPowerOfFiveExponent * 815)
- / (351 * integerPartWidth));
-}
-
-/* Put a bunch of private, handy routines in an anonymous namespace. */
-namespace {
-
- static inline unsigned int
- partCountForBits(unsigned int bits)
- {
- return ((bits) + integerPartWidth - 1) / integerPartWidth;
- }
-
- /* Returns 0U-9U. Return values >= 10U are not digits. */
- static inline unsigned int
- decDigitValue(unsigned int c)
- {
- return c - '0';
- }
-
- static unsigned int
- hexDigitValue(unsigned int c)
- {
- unsigned int r;
-
- r = c - '0';
- if(r <= 9)
- return r;
-
- r = c - 'A';
- if(r <= 5)
- return r + 10;
-
- r = c - 'a';
- if(r <= 5)
- return r + 10;
-
- return -1U;
- }
-
- static inline void
- assertArithmeticOK(const llvm::fltSemantics &semantics) {
- assert(semantics.arithmeticOK
- && "Compile-time arithmetic does not support these semantics");
- }
-
- /* Return the value of a decimal exponent of the form
- [+-]ddddddd.
-
- If the exponent overflows, returns a large exponent with the
- appropriate sign. */
- static int
- readExponent(const char *p)
- {
- bool isNegative;
- unsigned int absExponent;
- const unsigned int overlargeExponent = 24000; /* FIXME. */
-
- isNegative = (*p == '-');
- if (*p == '-' || *p == '+')
- p++;
-
- absExponent = decDigitValue(*p++);
- assert (absExponent < 10U);
-
- for (;;) {
- unsigned int value;
-
- value = decDigitValue(*p);
- if (value >= 10U)
- break;
-
- p++;
- value += absExponent * 10;
- if (absExponent >= overlargeExponent) {
- absExponent = overlargeExponent;
- break;
- }
- absExponent = value;
- }
-
- if (isNegative)
- return -(int) absExponent;
- else
- return (int) absExponent;
- }
-
- /* This is ugly and needs cleaning up, but I don't immediately see
- how whilst remaining safe. */
- static int
- totalExponent(const char *p, int exponentAdjustment)
- {
- int unsignedExponent;
- bool negative, overflow;
- int exponent;
-
- /* Move past the exponent letter and sign to the digits. */
- p++;
- negative = *p == '-';
- if(*p == '-' || *p == '+')
- p++;
-
- unsignedExponent = 0;
- overflow = false;
- for(;;) {
- unsigned int value;
-
- value = decDigitValue(*p);
- if(value >= 10U)
- break;
-
- p++;
- unsignedExponent = unsignedExponent * 10 + value;
- if(unsignedExponent > 65535)
- overflow = true;
- }
-
- if(exponentAdjustment > 65535 || exponentAdjustment < -65536)
- overflow = true;
-
- if(!overflow) {
- exponent = unsignedExponent;
- if(negative)
- exponent = -exponent;
- exponent += exponentAdjustment;
- if(exponent > 65535 || exponent < -65536)
- overflow = true;
- }
-
- if(overflow)
- exponent = negative ? -65536: 65535;
-
- return exponent;
- }
-
- static const char *
- skipLeadingZeroesAndAnyDot(const char *p, const char **dot)
- {
- *dot = 0;
- while(*p == '0')
- p++;
-
- if(*p == '.') {
- *dot = p++;
- while(*p == '0')
- p++;
- }
-
- return p;
- }
-
- /* Given a normal decimal floating point number of the form
-
- dddd.dddd[eE][+-]ddd
-
- where the decimal point and exponent are optional, fill out the
- structure D. Exponent is appropriate if the significand is
- treated as an integer, and normalizedExponent if the significand
- is taken to have the decimal point after a single leading
- non-zero digit.
-
- If the value is zero, V->firstSigDigit points to a non-digit, and
- the return exponent is zero.
- */
- struct decimalInfo {
- const char *firstSigDigit;
- const char *lastSigDigit;
- int exponent;
- int normalizedExponent;
- };
-
- static void
- interpretDecimal(const char *p, decimalInfo *D)
- {
- const char *dot;
-
- p = skipLeadingZeroesAndAnyDot (p, &dot);
-
- D->firstSigDigit = p;
- D->exponent = 0;
- D->normalizedExponent = 0;
-
- for (;;) {
- if (*p == '.') {
- assert(dot == 0);
- dot = p++;
- }
- if (decDigitValue(*p) >= 10U)
- break;
- p++;
- }
-
- /* If number is all zerooes accept any exponent. */
- if (p != D->firstSigDigit) {
- if (*p == 'e' || *p == 'E')
- D->exponent = readExponent(p + 1);
-
- /* Implied decimal point? */
- if (!dot)
- dot = p;
-
- /* Drop insignificant trailing zeroes. */
- do
- do
- p--;
- while (*p == '0');
- while (*p == '.');
-
- /* Adjust the exponents for any decimal point. */
- D->exponent += static_cast<exponent_t>((dot - p) - (dot > p));
- D->normalizedExponent = (D->exponent +
- static_cast<exponent_t>((p - D->firstSigDigit)
- - (dot > D->firstSigDigit && dot < p)));
- }
-
- D->lastSigDigit = p;
- }
-
- /* Return the trailing fraction of a hexadecimal number.
- DIGITVALUE is the first hex digit of the fraction, P points to
- the next digit. */
- static lostFraction
- trailingHexadecimalFraction(const char *p, unsigned int digitValue)
- {
- unsigned int hexDigit;
-
- /* If the first trailing digit isn't 0 or 8 we can work out the
- fraction immediately. */
- if(digitValue > 8)
- return lfMoreThanHalf;
- else if(digitValue < 8 && digitValue > 0)
- return lfLessThanHalf;
-
- /* Otherwise we need to find the first non-zero digit. */
- while(*p == '0')
- p++;
-
- hexDigit = hexDigitValue(*p);
-
- /* If we ran off the end it is exactly zero or one-half, otherwise
- a little more. */
- if(hexDigit == -1U)
- return digitValue == 0 ? lfExactlyZero: lfExactlyHalf;
- else
- return digitValue == 0 ? lfLessThanHalf: lfMoreThanHalf;
- }
-
- /* Return the fraction lost were a bignum truncated losing the least
- significant BITS bits. */
- static lostFraction
- lostFractionThroughTruncation(const integerPart *parts,
- unsigned int partCount,
- unsigned int bits)
- {
- unsigned int lsb;
-
- lsb = APInt::tcLSB(parts, partCount);
-
- /* Note this is guaranteed true if bits == 0, or LSB == -1U. */
- if(bits <= lsb)
- return lfExactlyZero;
- if(bits == lsb + 1)
- return lfExactlyHalf;
- if(bits <= partCount * integerPartWidth
- && APInt::tcExtractBit(parts, bits - 1))
- return lfMoreThanHalf;
-
- return lfLessThanHalf;
- }
-
- /* Shift DST right BITS bits noting lost fraction. */
- static lostFraction
- shiftRight(integerPart *dst, unsigned int parts, unsigned int bits)
- {
- lostFraction lost_fraction;
-
- lost_fraction = lostFractionThroughTruncation(dst, parts, bits);
-
- APInt::tcShiftRight(dst, parts, bits);
-
- return lost_fraction;
- }
-
- /* Combine the effect of two lost fractions. */
- static lostFraction
- combineLostFractions(lostFraction moreSignificant,
- lostFraction lessSignificant)
- {
- if(lessSignificant != lfExactlyZero) {
- if(moreSignificant == lfExactlyZero)
- moreSignificant = lfLessThanHalf;
- else if(moreSignificant == lfExactlyHalf)
- moreSignificant = lfMoreThanHalf;
- }
-
- return moreSignificant;
- }
-
- /* The error from the true value, in half-ulps, on multiplying two
- floating point numbers, which differ from the value they
- approximate by at most HUE1 and HUE2 half-ulps, is strictly less
- than the returned value.
-
- See "How to Read Floating Point Numbers Accurately" by William D
- Clinger. */
- static unsigned int
- HUerrBound(bool inexactMultiply, unsigned int HUerr1, unsigned int HUerr2)
- {
- assert(HUerr1 < 2 || HUerr2 < 2 || (HUerr1 + HUerr2 < 8));
-
- if (HUerr1 + HUerr2 == 0)
- return inexactMultiply * 2; /* <= inexactMultiply half-ulps. */
- else
- return inexactMultiply + 2 * (HUerr1 + HUerr2);
- }
-
- /* The number of ulps from the boundary (zero, or half if ISNEAREST)
- when the least significant BITS are truncated. BITS cannot be
- zero. */
- static integerPart
- ulpsFromBoundary(const integerPart *parts, unsigned int bits, bool isNearest)
- {
- unsigned int count, partBits;
- integerPart part, boundary;
-
- assert (bits != 0);
-
- bits--;
- count = bits / integerPartWidth;
- partBits = bits % integerPartWidth + 1;
-
- part = parts[count] & (~(integerPart) 0 >> (integerPartWidth - partBits));
-
- if (isNearest)
- boundary = (integerPart) 1 << (partBits - 1);
- else
- boundary = 0;
-
- if (count == 0) {
- if (part - boundary <= boundary - part)
- return part - boundary;
- else
- return boundary - part;
- }
-
- if (part == boundary) {
- while (--count)
- if (parts[count])
- return ~(integerPart) 0; /* A lot. */
-
- return parts[0];
- } else if (part == boundary - 1) {
- while (--count)
- if (~parts[count])
- return ~(integerPart) 0; /* A lot. */
-
- return -parts[0];
- }
-
- return ~(integerPart) 0; /* A lot. */
- }
-
- /* Place pow(5, power) in DST, and return the number of parts used.
- DST must be at least one part larger than size of the answer. */
- static unsigned int
- powerOf5(integerPart *dst, unsigned int power)
- {
- static integerPart firstEightPowers[] = { 1, 5, 25, 125, 625, 3125,
- 15625, 78125 };
- static integerPart pow5s[maxPowerOfFiveParts * 2 + 5] = { 78125 * 5 };
- static unsigned int partsCount[16] = { 1 };
-
- integerPart scratch[maxPowerOfFiveParts], *p1, *p2, *pow5;
- unsigned int result;
-
- assert(power <= maxExponent);
-
- p1 = dst;
- p2 = scratch;
-
- *p1 = firstEightPowers[power & 7];
- power >>= 3;
-
- result = 1;
- pow5 = pow5s;
-
- for (unsigned int n = 0; power; power >>= 1, n++) {
- unsigned int pc;
-
- pc = partsCount[n];
-
- /* Calculate pow(5,pow(2,n+3)) if we haven't yet. */
- if (pc == 0) {
- pc = partsCount[n - 1];
- APInt::tcFullMultiply(pow5, pow5 - pc, pow5 - pc, pc, pc);
- pc *= 2;
- if (pow5[pc - 1] == 0)
- pc--;
- partsCount[n] = pc;
- }
-
- if (power & 1) {
- integerPart *tmp;
-
- APInt::tcFullMultiply(p2, p1, pow5, result, pc);
- result += pc;
- if (p2[result - 1] == 0)
- result--;
-
- /* Now result is in p1 with partsCount parts and p2 is scratch
- space. */
- tmp = p1, p1 = p2, p2 = tmp;
- }
-
- pow5 += pc;
- }
-
- if (p1 != dst)
- APInt::tcAssign(dst, p1, result);
-
- return result;
- }
-
- /* Zero at the end to avoid modular arithmetic when adding one; used
- when rounding up during hexadecimal output. */
- static const char hexDigitsLower[] = "0123456789abcdef0";
- static const char hexDigitsUpper[] = "0123456789ABCDEF0";
- static const char infinityL[] = "infinity";
- static const char infinityU[] = "INFINITY";
- static const char NaNL[] = "nan";
- static const char NaNU[] = "NAN";
-
- /* Write out an integerPart in hexadecimal, starting with the most
- significant nibble. Write out exactly COUNT hexdigits, return
- COUNT. */
- static unsigned int
- partAsHex (char *dst, integerPart part, unsigned int count,
- const char *hexDigitChars)
- {
- unsigned int result = count;
-
- assert (count != 0 && count <= integerPartWidth / 4);
-
- part >>= (integerPartWidth - 4 * count);
- while (count--) {
- dst[count] = hexDigitChars[part & 0xf];
- part >>= 4;
- }
-
- return result;
- }
-
- /* Write out an unsigned decimal integer. */
- static char *
- writeUnsignedDecimal (char *dst, unsigned int n)
- {
- char buff[40], *p;
-
- p = buff;
- do
- *p++ = '0' + n % 10;
- while (n /= 10);
-
- do
- *dst++ = *--p;
- while (p != buff);
-
- return dst;
- }
-
- /* Write out a signed decimal integer. */
- static char *
- writeSignedDecimal (char *dst, int value)
- {
- if (value < 0) {
- *dst++ = '-';
- dst = writeUnsignedDecimal(dst, -(unsigned) value);
- } else
- dst = writeUnsignedDecimal(dst, value);
-
- return dst;
- }
-}
-
-/* Constructors. */
-void
-APFloat::initialize(const fltSemantics *ourSemantics)
-{
- unsigned int count;
-
- semantics = ourSemantics;
- count = partCount();
- if(count > 1)
- significand.parts = new integerPart[count];
-}
-
-void
-APFloat::freeSignificand()
-{
- if(partCount() > 1)
- delete [] significand.parts;
-}
-
-void
-APFloat::assign(const APFloat &rhs)
-{
- assert(semantics == rhs.semantics);
-
- sign = rhs.sign;
- category = rhs.category;
- exponent = rhs.exponent;
- sign2 = rhs.sign2;
- exponent2 = rhs.exponent2;
- if(category == fcNormal || category == fcNaN)
- copySignificand(rhs);
-}
-
-void
-APFloat::copySignificand(const APFloat &rhs)
-{
- assert(category == fcNormal || category == fcNaN);
- assert(rhs.partCount() >= partCount());
-
- APInt::tcAssign(significandParts(), rhs.significandParts(),
- partCount());
-}
-
-/* Make this number a NaN, with an arbitrary but deterministic value
- for the significand. */
-void
-APFloat::makeNaN(void)
-{
- category = fcNaN;
- APInt::tcSet(significandParts(), ~0U, partCount());
-}
-
-APFloat &
-APFloat::operator=(const APFloat &rhs)
-{
- if(this != &rhs) {
- if(semantics != rhs.semantics) {
- freeSignificand();
- initialize(rhs.semantics);
- }
- assign(rhs);
- }
-
- return *this;
-}
-
-bool
-APFloat::bitwiseIsEqual(const APFloat &rhs) const {
- if (this == &rhs)
- return true;
- if (semantics != rhs.semantics ||
- category != rhs.category ||
- sign != rhs.sign)
- return false;
- if (semantics==(const llvm::fltSemantics*)&PPCDoubleDouble &&
- sign2 != rhs.sign2)
- return false;
- if (category==fcZero || category==fcInfinity)
- return true;
- else if (category==fcNormal && exponent!=rhs.exponent)
- return false;
- else if (semantics==(const llvm::fltSemantics*)&PPCDoubleDouble &&
- exponent2!=rhs.exponent2)
- return false;
- else {
- int i= partCount();
- const integerPart* p=significandParts();
- const integerPart* q=rhs.significandParts();
- for (; i>0; i--, p++, q++) {
- if (*p != *q)
- return false;
- }
- return true;
- }
-}
-
-APFloat::APFloat(const fltSemantics &ourSemantics, integerPart value)
-{
- assertArithmeticOK(ourSemantics);
- initialize(&ourSemantics);
- sign = 0;
- zeroSignificand();
- exponent = ourSemantics.precision - 1;
- significandParts()[0] = value;
- normalize(rmNearestTiesToEven, lfExactlyZero);
-}
-
-APFloat::APFloat(const fltSemantics &ourSemantics,
- fltCategory ourCategory, bool negative)
-{
- assertArithmeticOK(ourSemantics);
- initialize(&ourSemantics);
- category = ourCategory;
- sign = negative;
- if(category == fcNormal)
- category = fcZero;
- else if (ourCategory == fcNaN)
- makeNaN();
-}
-
-APFloat::APFloat(const fltSemantics &ourSemantics, const char *text)
-{
- assertArithmeticOK(ourSemantics);
- initialize(&ourSemantics);
- convertFromString(text, rmNearestTiesToEven);
-}
-
-APFloat::APFloat(const APFloat &rhs)
-{
- initialize(rhs.semantics);
- assign(rhs);
-}
-
-APFloat::~APFloat()
-{
- freeSignificand();
-}
-
-// Profile - This method 'profiles' an APFloat for use with FoldingSet.
-void APFloat::Profile(FoldingSetNodeID& ID) const {
- ID.Add(convertToAPInt());
-}
-
-unsigned int
-APFloat::partCount() const
-{
- return partCountForBits(semantics->precision + 1);
-}
-
-unsigned int
-APFloat::semanticsPrecision(const fltSemantics &semantics)
-{
- return semantics.precision;
-}
-
-const integerPart *
-APFloat::significandParts() const
-{
- return const_cast<APFloat *>(this)->significandParts();
-}
-
-integerPart *
-APFloat::significandParts()
-{
- assert(category == fcNormal || category == fcNaN);
-
- if(partCount() > 1)
- return significand.parts;
- else
- return &significand.part;
-}
-
-void
-APFloat::zeroSignificand()
-{
- category = fcNormal;
- APInt::tcSet(significandParts(), 0, partCount());
-}
-
-/* Increment an fcNormal floating point number's significand. */
-void
-APFloat::incrementSignificand()
-{
- integerPart carry;
-
- carry = APInt::tcIncrement(significandParts(), partCount());
-
- /* Our callers should never cause us to overflow. */
- assert(carry == 0);
-}
-
-/* Add the significand of the RHS. Returns the carry flag. */
-integerPart
-APFloat::addSignificand(const APFloat &rhs)
-{
- integerPart *parts;
-
- parts = significandParts();
-
- assert(semantics == rhs.semantics);
- assert(exponent == rhs.exponent);
-
- return APInt::tcAdd(parts, rhs.significandParts(), 0, partCount());
-}
-
-/* Subtract the significand of the RHS with a borrow flag. Returns
- the borrow flag. */
-integerPart
-APFloat::subtractSignificand(const APFloat &rhs, integerPart borrow)
-{
- integerPart *parts;
-
- parts = significandParts();
-
- assert(semantics == rhs.semantics);
- assert(exponent == rhs.exponent);
-
- return APInt::tcSubtract(parts, rhs.significandParts(), borrow,
- partCount());
-}
-
-/* Multiply the significand of the RHS. If ADDEND is non-NULL, add it
- on to the full-precision result of the multiplication. Returns the
- lost fraction. */
-lostFraction
-APFloat::multiplySignificand(const APFloat &rhs, const APFloat *addend)
-{
- unsigned int omsb; // One, not zero, based MSB.
- unsigned int partsCount, newPartsCount, precision;
- integerPart *lhsSignificand;
- integerPart scratch[4];
- integerPart *fullSignificand;
- lostFraction lost_fraction;
-
- assert(semantics == rhs.semantics);
-
- precision = semantics->precision;
- newPartsCount = partCountForBits(precision * 2);
-
- if(newPartsCount > 4)
- fullSignificand = new integerPart[newPartsCount];
- else
- fullSignificand = scratch;
-
- lhsSignificand = significandParts();
- partsCount = partCount();
-
- APInt::tcFullMultiply(fullSignificand, lhsSignificand,
- rhs.significandParts(), partsCount, partsCount);
-
- lost_fraction = lfExactlyZero;
- omsb = APInt::tcMSB(fullSignificand, newPartsCount) + 1;
- exponent += rhs.exponent;
-
- if(addend) {
- Significand savedSignificand = significand;
- const fltSemantics *savedSemantics = semantics;
- fltSemantics extendedSemantics;
- opStatus status;
- unsigned int extendedPrecision;
-
- /* Normalize our MSB. */
- extendedPrecision = precision + precision - 1;
- if(omsb != extendedPrecision)
- {
- APInt::tcShiftLeft(fullSignificand, newPartsCount,
- extendedPrecision - omsb);
- exponent -= extendedPrecision - omsb;
- }
-
- /* Create new semantics. */
- extendedSemantics = *semantics;
- extendedSemantics.precision = extendedPrecision;
-
- if(newPartsCount == 1)
- significand.part = fullSignificand[0];
- else
- significand.parts = fullSignificand;
- semantics = &extendedSemantics;
-
- APFloat extendedAddend(*addend);
- status = extendedAddend.convert(extendedSemantics, rmTowardZero);
- assert(status == opOK);
- lost_fraction = addOrSubtractSignificand(extendedAddend, false);
-
- /* Restore our state. */
- if(newPartsCount == 1)
- fullSignificand[0] = significand.part;
- significand = savedSignificand;
- semantics = savedSemantics;
-
- omsb = APInt::tcMSB(fullSignificand, newPartsCount) + 1;
- }
-
- exponent -= (precision - 1);
-
- if(omsb > precision) {
- unsigned int bits, significantParts;
- lostFraction lf;
-
- bits = omsb - precision;
- significantParts = partCountForBits(omsb);
- lf = shiftRight(fullSignificand, significantParts, bits);
- lost_fraction = combineLostFractions(lf, lost_fraction);
- exponent += bits;
- }
-
- APInt::tcAssign(lhsSignificand, fullSignificand, partsCount);
-
- if(newPartsCount > 4)
- delete [] fullSignificand;
-
- return lost_fraction;
-}
-
-/* Multiply the significands of LHS and RHS to DST. */
-lostFraction
-APFloat::divideSignificand(const APFloat &rhs)
-{
- unsigned int bit, i, partsCount;
- const integerPart *rhsSignificand;
- integerPart *lhsSignificand, *dividend, *divisor;
- integerPart scratch[4];
- lostFraction lost_fraction;
-
- assert(semantics == rhs.semantics);
-
- lhsSignificand = significandParts();
- rhsSignificand = rhs.significandParts();
- partsCount = partCount();
-
- if(partsCount > 2)
- dividend = new integerPart[partsCount * 2];
- else
- dividend = scratch;
-
- divisor = dividend + partsCount;
-
- /* Copy the dividend and divisor as they will be modified in-place. */
- for(i = 0; i < partsCount; i++) {
- dividend[i] = lhsSignificand[i];
- divisor[i] = rhsSignificand[i];
- lhsSignificand[i] = 0;
- }
-
- exponent -= rhs.exponent;
-
- unsigned int precision = semantics->precision;
-
- /* Normalize the divisor. */
- bit = precision - APInt::tcMSB(divisor, partsCount) - 1;
- if(bit) {
- exponent += bit;
- APInt::tcShiftLeft(divisor, partsCount, bit);
- }
-
- /* Normalize the dividend. */
- bit = precision - APInt::tcMSB(dividend, partsCount) - 1;
- if(bit) {
- exponent -= bit;
- APInt::tcShiftLeft(dividend, partsCount, bit);
- }
-
- /* Ensure the dividend >= divisor initially for the loop below.
- Incidentally, this means that the division loop below is
- guaranteed to set the integer bit to one. */
- if(APInt::tcCompare(dividend, divisor, partsCount) < 0) {
- exponent--;
- APInt::tcShiftLeft(dividend, partsCount, 1);
- assert(APInt::tcCompare(dividend, divisor, partsCount) >= 0);
- }
-
- /* Long division. */
- for(bit = precision; bit; bit -= 1) {
- if(APInt::tcCompare(dividend, divisor, partsCount) >= 0) {
- APInt::tcSubtract(dividend, divisor, 0, partsCount);
- APInt::tcSetBit(lhsSignificand, bit - 1);
- }
-
- APInt::tcShiftLeft(dividend, partsCount, 1);
- }
-
- /* Figure out the lost fraction. */
- int cmp = APInt::tcCompare(dividend, divisor, partsCount);
-
- if(cmp > 0)
- lost_fraction = lfMoreThanHalf;
- else if(cmp == 0)
- lost_fraction = lfExactlyHalf;
- else if(APInt::tcIsZero(dividend, partsCount))
- lost_fraction = lfExactlyZero;
- else
- lost_fraction = lfLessThanHalf;
-
- if(partsCount > 2)
- delete [] dividend;
-
- return lost_fraction;
-}
-
-unsigned int
-APFloat::significandMSB() const
-{
- return APInt::tcMSB(significandParts(), partCount());
-}
-
-unsigned int
-APFloat::significandLSB() const
-{
- return APInt::tcLSB(significandParts(), partCount());
-}
-
-/* Note that a zero result is NOT normalized to fcZero. */
-lostFraction
-APFloat::shiftSignificandRight(unsigned int bits)
-{
- /* Our exponent should not overflow. */
- assert((exponent_t) (exponent + bits) >= exponent);
-
- exponent += bits;
-
- return shiftRight(significandParts(), partCount(), bits);
-}
-
-/* Shift the significand left BITS bits, subtract BITS from its exponent. */
-void
-APFloat::shiftSignificandLeft(unsigned int bits)
-{
- assert(bits < semantics->precision);
-
- if(bits) {
- unsigned int partsCount = partCount();
-
- APInt::tcShiftLeft(significandParts(), partsCount, bits);
- exponent -= bits;
-
- assert(!APInt::tcIsZero(significandParts(), partsCount));
- }
-}
-
-APFloat::cmpResult
-APFloat::compareAbsoluteValue(const APFloat &rhs) const
-{
- int compare;
-
- assert(semantics == rhs.semantics);
- assert(category == fcNormal);
- assert(rhs.category == fcNormal);
-
- compare = exponent - rhs.exponent;
-
- /* If exponents are equal, do an unsigned bignum comparison of the
- significands. */
- if(compare == 0)
- compare = APInt::tcCompare(significandParts(), rhs.significandParts(),
- partCount());
-
- if(compare > 0)
- return cmpGreaterThan;
- else if(compare < 0)
- return cmpLessThan;
- else
- return cmpEqual;
-}
-
-/* Handle overflow. Sign is preserved. We either become infinity or
- the largest finite number. */
-APFloat::opStatus
-APFloat::handleOverflow(roundingMode rounding_mode)
-{
- /* Infinity? */
- if(rounding_mode == rmNearestTiesToEven
- || rounding_mode == rmNearestTiesToAway
- || (rounding_mode == rmTowardPositive && !sign)
- || (rounding_mode == rmTowardNegative && sign))
- {
- category = fcInfinity;
- return (opStatus) (opOverflow | opInexact);
- }
-
- /* Otherwise we become the largest finite number. */
- category = fcNormal;
- exponent = semantics->maxExponent;
- APInt::tcSetLeastSignificantBits(significandParts(), partCount(),
- semantics->precision);
-
- return opInexact;
-}
-
-/* Returns TRUE if, when truncating the current number, with BIT the
- new LSB, with the given lost fraction and rounding mode, the result
- would need to be rounded away from zero (i.e., by increasing the
- signficand). This routine must work for fcZero of both signs, and
- fcNormal numbers. */
-bool
-APFloat::roundAwayFromZero(roundingMode rounding_mode,
- lostFraction lost_fraction,
- unsigned int bit) const
-{
- /* NaNs and infinities should not have lost fractions. */
- assert(category == fcNormal || category == fcZero);
-
- /* Current callers never pass this so we don't handle it. */
- assert(lost_fraction != lfExactlyZero);
-
- switch(rounding_mode) {
- default:
- assert(0);
-
- case rmNearestTiesToAway:
- return lost_fraction == lfExactlyHalf || lost_fraction == lfMoreThanHalf;
-
- case rmNearestTiesToEven:
- if(lost_fraction == lfMoreThanHalf)
- return true;
-
- /* Our zeroes don't have a significand to test. */
- if(lost_fraction == lfExactlyHalf && category != fcZero)
- return APInt::tcExtractBit(significandParts(), bit);
-
- return false;
-
- case rmTowardZero:
- return false;
-
- case rmTowardPositive:
- return sign == false;
-
- case rmTowardNegative:
- return sign == true;
- }
-}
-
-APFloat::opStatus
-APFloat::normalize(roundingMode rounding_mode,
- lostFraction lost_fraction)
-{
- unsigned int omsb; /* One, not zero, based MSB. */
- int exponentChange;
-
- if(category != fcNormal)
- return opOK;
-
- /* Before rounding normalize the exponent of fcNormal numbers. */
- omsb = significandMSB() + 1;
-
- if(omsb) {
- /* OMSB is numbered from 1. We want to place it in the integer
- bit numbered PRECISON if possible, with a compensating change in
- the exponent. */
- exponentChange = omsb - semantics->precision;
-
- /* If the resulting exponent is too high, overflow according to
- the rounding mode. */
- if(exponent + exponentChange > semantics->maxExponent)
- return handleOverflow(rounding_mode);
-
- /* Subnormal numbers have exponent minExponent, and their MSB
- is forced based on that. */
- if(exponent + exponentChange < semantics->minExponent)
- exponentChange = semantics->minExponent - exponent;
-
- /* Shifting left is easy as we don't lose precision. */
- if(exponentChange < 0) {
- assert(lost_fraction == lfExactlyZero);
-
- shiftSignificandLeft(-exponentChange);
-
- return opOK;
- }
-
- if(exponentChange > 0) {
- lostFraction lf;
-
- /* Shift right and capture any new lost fraction. */
- lf = shiftSignificandRight(exponentChange);
-
- lost_fraction = combineLostFractions(lf, lost_fraction);
-
- /* Keep OMSB up-to-date. */
- if(omsb > (unsigned) exponentChange)
- omsb -= exponentChange;
- else
- omsb = 0;
- }
- }
-
- /* Now round the number according to rounding_mode given the lost
- fraction. */
-
- /* As specified in IEEE 754, since we do not trap we do not report
- underflow for exact results. */
- if(lost_fraction == lfExactlyZero) {
- /* Canonicalize zeroes. */
- if(omsb == 0)
- category = fcZero;
-
- return opOK;
- }
-
- /* Increment the significand if we're rounding away from zero. */
- if(roundAwayFromZero(rounding_mode, lost_fraction, 0)) {
- if(omsb == 0)
- exponent = semantics->minExponent;
-
- incrementSignificand();
- omsb = significandMSB() + 1;
-
- /* Did the significand increment overflow? */
- if(omsb == (unsigned) semantics->precision + 1) {
- /* Renormalize by incrementing the exponent and shifting our
- significand right one. However if we already have the
- maximum exponent we overflow to infinity. */
- if(exponent == semantics->maxExponent) {
- category = fcInfinity;
-
- return (opStatus) (opOverflow | opInexact);
- }
-
- shiftSignificandRight(1);
-
- return opInexact;
- }
- }
-
- /* The normal case - we were and are not denormal, and any
- significand increment above didn't overflow. */
- if(omsb == semantics->precision)
- return opInexact;
-
- /* We have a non-zero denormal. */
- assert(omsb < semantics->precision);
-
- /* Canonicalize zeroes. */
- if(omsb == 0)
- category = fcZero;
-
- /* The fcZero case is a denormal that underflowed to zero. */
- return (opStatus) (opUnderflow | opInexact);
-}
-
-APFloat::opStatus
-APFloat::addOrSubtractSpecials(const APFloat &rhs, bool subtract)
-{
- switch(convolve(category, rhs.category)) {
- default:
- assert(0);
-
- case convolve(fcNaN, fcZero):
- case convolve(fcNaN, fcNormal):
- case convolve(fcNaN, fcInfinity):
- case convolve(fcNaN, fcNaN):
- case convolve(fcNormal, fcZero):
- case convolve(fcInfinity, fcNormal):
- case convolve(fcInfinity, fcZero):
- return opOK;
-
- case convolve(fcZero, fcNaN):
- case convolve(fcNormal, fcNaN):
- case convolve(fcInfinity, fcNaN):
- category = fcNaN;
- copySignificand(rhs);
- return opOK;
-
- case convolve(fcNormal, fcInfinity):
- case convolve(fcZero, fcInfinity):
- category = fcInfinity;
- sign = rhs.sign ^ subtract;
- return opOK;
-
- case convolve(fcZero, fcNormal):
- assign(rhs);
- sign = rhs.sign ^ subtract;
- return opOK;
-
- case convolve(fcZero, fcZero):
- /* Sign depends on rounding mode; handled by caller. */
- return opOK;
-
- case convolve(fcInfinity, fcInfinity):
- /* Differently signed infinities can only be validly
- subtracted. */
- if((sign ^ rhs.sign) != subtract) {
- makeNaN();
- return opInvalidOp;
- }
-
- return opOK;
-
- case convolve(fcNormal, fcNormal):
- return opDivByZero;
- }
-}
-
-/* Add or subtract two normal numbers. */
-lostFraction
-APFloat::addOrSubtractSignificand(const APFloat &rhs, bool subtract)
-{
- integerPart carry;
- lostFraction lost_fraction;
- int bits;
-
- /* Determine if the operation on the absolute values is effectively
- an addition or subtraction. */
- subtract ^= (sign ^ rhs.sign) ? true : false;
-
- /* Are we bigger exponent-wise than the RHS? */
- bits = exponent - rhs.exponent;
-
- /* Subtraction is more subtle than one might naively expect. */
- if(subtract) {
- APFloat temp_rhs(rhs);
- bool reverse;
-
- if (bits == 0) {
- reverse = compareAbsoluteValue(temp_rhs) == cmpLessThan;
- lost_fraction = lfExactlyZero;
- } else if (bits > 0) {
- lost_fraction = temp_rhs.shiftSignificandRight(bits - 1);
- shiftSignificandLeft(1);
- reverse = false;
- } else {
- lost_fraction = shiftSignificandRight(-bits - 1);
- temp_rhs.shiftSignificandLeft(1);
- reverse = true;
- }
-
- if (reverse) {
- carry = temp_rhs.subtractSignificand
- (*this, lost_fraction != lfExactlyZero);
- copySignificand(temp_rhs);
- sign = !sign;
- } else {
- carry = subtractSignificand
- (temp_rhs, lost_fraction != lfExactlyZero);
- }
-
- /* Invert the lost fraction - it was on the RHS and
- subtracted. */
- if(lost_fraction == lfLessThanHalf)
- lost_fraction = lfMoreThanHalf;
- else if(lost_fraction == lfMoreThanHalf)
- lost_fraction = lfLessThanHalf;
-
- /* The code above is intended to ensure that no borrow is
- necessary. */
- assert(!carry);
- } else {
- if(bits > 0) {
- APFloat temp_rhs(rhs);
-
- lost_fraction = temp_rhs.shiftSignificandRight(bits);
- carry = addSignificand(temp_rhs);
- } else {
- lost_fraction = shiftSignificandRight(-bits);
- carry = addSignificand(rhs);
- }
-
- /* We have a guard bit; generating a carry cannot happen. */
- assert(!carry);
- }
-
- return lost_fraction;
-}
-
-APFloat::opStatus
-APFloat::multiplySpecials(const APFloat &rhs)
-{
- switch(convolve(category, rhs.category)) {
- default:
- assert(0);
-
- case convolve(fcNaN, fcZero):
- case convolve(fcNaN, fcNormal):
- case convolve(fcNaN, fcInfinity):
- case convolve(fcNaN, fcNaN):
- return opOK;
-
- case convolve(fcZero, fcNaN):
- case convolve(fcNormal, fcNaN):
- case convolve(fcInfinity, fcNaN):
- category = fcNaN;
- copySignificand(rhs);
- return opOK;
-
- case convolve(fcNormal, fcInfinity):
- case convolve(fcInfinity, fcNormal):
- case convolve(fcInfinity, fcInfinity):
- category = fcInfinity;
- return opOK;
-
- case convolve(fcZero, fcNormal):
- case convolve(fcNormal, fcZero):
- case convolve(fcZero, fcZero):
- category = fcZero;
- return opOK;
-
- case convolve(fcZero, fcInfinity):
- case convolve(fcInfinity, fcZero):
- makeNaN();
- return opInvalidOp;
-
- case convolve(fcNormal, fcNormal):
- return opOK;
- }
-}
-
-APFloat::opStatus
-APFloat::divideSpecials(const APFloat &rhs)
-{
- switch(convolve(category, rhs.category)) {
- default:
- assert(0);
-
- case convolve(fcNaN, fcZero):
- case convolve(fcNaN, fcNormal):
- case convolve(fcNaN, fcInfinity):
- case convolve(fcNaN, fcNaN):
- case convolve(fcInfinity, fcZero):
- case convolve(fcInfinity, fcNormal):
- case convolve(fcZero, fcInfinity):
- case convolve(fcZero, fcNormal):
- return opOK;
-
- case convolve(fcZero, fcNaN):
- case convolve(fcNormal, fcNaN):
- case convolve(fcInfinity, fcNaN):
- category = fcNaN;
- copySignificand(rhs);
- return opOK;
-
- case convolve(fcNormal, fcInfinity):
- category = fcZero;
- return opOK;
-
- case convolve(fcNormal, fcZero):
- category = fcInfinity;
- return opDivByZero;
-
- case convolve(fcInfinity, fcInfinity):
- case convolve(fcZero, fcZero):
- makeNaN();
- return opInvalidOp;
-
- case convolve(fcNormal, fcNormal):
- return opOK;
- }
-}
-
-/* Change sign. */
-void
-APFloat::changeSign()
-{
- /* Look mummy, this one's easy. */
- sign = !sign;
-}
-
-void
-APFloat::clearSign()
-{
- /* So is this one. */
- sign = 0;
-}
-
-void
-APFloat::copySign(const APFloat &rhs)
-{
- /* And this one. */
- sign = rhs.sign;
-}
-
-/* Normalized addition or subtraction. */
-APFloat::opStatus
-APFloat::addOrSubtract(const APFloat &rhs, roundingMode rounding_mode,
- bool subtract)
-{
- opStatus fs;
-
- assertArithmeticOK(*semantics);
-
- fs = addOrSubtractSpecials(rhs, subtract);
-
- /* This return code means it was not a simple case. */
- if(fs == opDivByZero) {
- lostFraction lost_fraction;
-
- lost_fraction = addOrSubtractSignificand(rhs, subtract);
- fs = normalize(rounding_mode, lost_fraction);
-
- /* Can only be zero if we lost no fraction. */
- assert(category != fcZero || lost_fraction == lfExactlyZero);
- }
-
- /* If two numbers add (exactly) to zero, IEEE 754 decrees it is a
- positive zero unless rounding to minus infinity, except that
- adding two like-signed zeroes gives that zero. */
- if(category == fcZero) {
- if(rhs.category != fcZero || (sign == rhs.sign) == subtract)
- sign = (rounding_mode == rmTowardNegative);
- }
-
- return fs;
-}
-
-/* Normalized addition. */
-APFloat::opStatus
-APFloat::add(const APFloat &rhs, roundingMode rounding_mode)
-{
- return addOrSubtract(rhs, rounding_mode, false);
-}
-
-/* Normalized subtraction. */
-APFloat::opStatus
-APFloat::subtract(const APFloat &rhs, roundingMode rounding_mode)
-{
- return addOrSubtract(rhs, rounding_mode, true);
-}
-
-/* Normalized multiply. */
-APFloat::opStatus
-APFloat::multiply(const APFloat &rhs, roundingMode rounding_mode)
-{
- opStatus fs;
-
- assertArithmeticOK(*semantics);
- sign ^= rhs.sign;
- fs = multiplySpecials(rhs);
-
- if(category == fcNormal) {
- lostFraction lost_fraction = multiplySignificand(rhs, 0);
- fs = normalize(rounding_mode, lost_fraction);
- if(lost_fraction != lfExactlyZero)
- fs = (opStatus) (fs | opInexact);
- }
-
- return fs;
-}
-
-/* Normalized divide. */
-APFloat::opStatus
-APFloat::divide(const APFloat &rhs, roundingMode rounding_mode)
-{
- opStatus fs;
-
- assertArithmeticOK(*semantics);
- sign ^= rhs.sign;
- fs = divideSpecials(rhs);
-
- if(category == fcNormal) {
- lostFraction lost_fraction = divideSignificand(rhs);
- fs = normalize(rounding_mode, lost_fraction);
- if(lost_fraction != lfExactlyZero)
- fs = (opStatus) (fs | opInexact);
- }
-
- return fs;
-}
-
-/* Normalized remainder. This is not currently doing TRT. */
-APFloat::opStatus
-APFloat::mod(const APFloat &rhs, roundingMode rounding_mode)
-{
- opStatus fs;
- APFloat V = *this;
- unsigned int origSign = sign;
-
- assertArithmeticOK(*semantics);
- fs = V.divide(rhs, rmNearestTiesToEven);
- if (fs == opDivByZero)
- return fs;
-
- int parts = partCount();
- integerPart *x = new integerPart[parts];
- fs = V.convertToInteger(x, parts * integerPartWidth, true,
- rmNearestTiesToEven);
- if (fs==opInvalidOp)
- return fs;
-
- fs = V.convertFromZeroExtendedInteger(x, parts * integerPartWidth, true,
- rmNearestTiesToEven);
- assert(fs==opOK); // should always work
-
- fs = V.multiply(rhs, rounding_mode);
- assert(fs==opOK || fs==opInexact); // should not overflow or underflow
-
- fs = subtract(V, rounding_mode);
- assert(fs==opOK || fs==opInexact); // likewise
-
- if (isZero())
- sign = origSign; // IEEE754 requires this
- delete[] x;
- return fs;
-}
-
-/* Normalized fused-multiply-add. */
-APFloat::opStatus
-APFloat::fusedMultiplyAdd(const APFloat &multiplicand,
- const APFloat &addend,
- roundingMode rounding_mode)
-{
- opStatus fs;
-
- assertArithmeticOK(*semantics);
-
- /* Post-multiplication sign, before addition. */
- sign ^= multiplicand.sign;
-
- /* If and only if all arguments are normal do we need to do an
- extended-precision calculation. */
- if(category == fcNormal
- && multiplicand.category == fcNormal
- && addend.category == fcNormal) {
- lostFraction lost_fraction;
-
- lost_fraction = multiplySignificand(multiplicand, &addend);
- fs = normalize(rounding_mode, lost_fraction);
- if(lost_fraction != lfExactlyZero)
- fs = (opStatus) (fs | opInexact);
-
- /* If two numbers add (exactly) to zero, IEEE 754 decrees it is a
- positive zero unless rounding to minus infinity, except that
- adding two like-signed zeroes gives that zero. */
- if(category == fcZero && sign != addend.sign)
- sign = (rounding_mode == rmTowardNegative);
- } else {
- fs = multiplySpecials(multiplicand);
-
- /* FS can only be opOK or opInvalidOp. There is no more work
- to do in the latter case. The IEEE-754R standard says it is
- implementation-defined in this case whether, if ADDEND is a
- quiet NaN, we raise invalid op; this implementation does so.
-
- If we need to do the addition we can do so with normal
- precision. */
- if(fs == opOK)
- fs = addOrSubtract(addend, rounding_mode, false);
- }
-
- return fs;
-}
-
-/* Comparison requires normalized numbers. */
-APFloat::cmpResult
-APFloat::compare(const APFloat &rhs) const
-{
- cmpResult result;
-
- assertArithmeticOK(*semantics);
- assert(semantics == rhs.semantics);
-
- switch(convolve(category, rhs.category)) {
- default:
- assert(0);
-
- case convolve(fcNaN, fcZero):
- case convolve(fcNaN, fcNormal):
- case convolve(fcNaN, fcInfinity):
- case convolve(fcNaN, fcNaN):
- case convolve(fcZero, fcNaN):
- case convolve(fcNormal, fcNaN):
- case convolve(fcInfinity, fcNaN):
- return cmpUnordered;
-
- case convolve(fcInfinity, fcNormal):
- case convolve(fcInfinity, fcZero):
- case convolve(fcNormal, fcZero):
- if(sign)
- return cmpLessThan;
- else
- return cmpGreaterThan;
-
- case convolve(fcNormal, fcInfinity):
- case convolve(fcZero, fcInfinity):
- case convolve(fcZero, fcNormal):
- if(rhs.sign)
- return cmpGreaterThan;
- else
- return cmpLessThan;
-
- case convolve(fcInfinity, fcInfinity):
- if(sign == rhs.sign)
- return cmpEqual;
- else if(sign)
- return cmpLessThan;
- else
- return cmpGreaterThan;
-
- case convolve(fcZero, fcZero):
- return cmpEqual;
-
- case convolve(fcNormal, fcNormal):
- break;
- }
-
- /* Two normal numbers. Do they have the same sign? */
- if(sign != rhs.sign) {
- if(sign)
- result = cmpLessThan;
- else
- result = cmpGreaterThan;
- } else {
- /* Compare absolute values; invert result if negative. */
- result = compareAbsoluteValue(rhs);
-
- if(sign) {
- if(result == cmpLessThan)
- result = cmpGreaterThan;
- else if(result == cmpGreaterThan)
- result = cmpLessThan;
- }
- }
-
- return result;
-}
-
-APFloat::opStatus
-APFloat::convert(const fltSemantics &toSemantics,
- roundingMode rounding_mode)
-{
- lostFraction lostFraction;
- unsigned int newPartCount, oldPartCount;
- opStatus fs;
-
- assertArithmeticOK(*semantics);
- assertArithmeticOK(toSemantics);
- lostFraction = lfExactlyZero;
- newPartCount = partCountForBits(toSemantics.precision + 1);
- oldPartCount = partCount();
-
- /* Handle storage complications. If our new form is wider,
- re-allocate our bit pattern into wider storage. If it is
- narrower, we ignore the excess parts, but if narrowing to a
- single part we need to free the old storage.
- Be careful not to reference significandParts for zeroes
- and infinities, since it aborts. */
- if (newPartCount > oldPartCount) {
- integerPart *newParts;
- newParts = new integerPart[newPartCount];
- APInt::tcSet(newParts, 0, newPartCount);
- if (category==fcNormal || category==fcNaN)
- APInt::tcAssign(newParts, significandParts(), oldPartCount);
- freeSignificand();
- significand.parts = newParts;
- } else if (newPartCount < oldPartCount) {
- /* Capture any lost fraction through truncation of parts so we get
- correct rounding whilst normalizing. */
- if (category==fcNormal)
- lostFraction = lostFractionThroughTruncation
- (significandParts(), oldPartCount, toSemantics.precision);
- if (newPartCount == 1) {
- integerPart newPart = 0;
- if (category==fcNormal || category==fcNaN)
- newPart = significandParts()[0];
- freeSignificand();
- significand.part = newPart;
- }
- }
-
- if(category == fcNormal) {
- /* Re-interpret our bit-pattern. */
- exponent += toSemantics.precision - semantics->precision;
- semantics = &toSemantics;
- fs = normalize(rounding_mode, lostFraction);
- } else if (category == fcNaN) {
- int shift = toSemantics.precision - semantics->precision;
- // Do this now so significandParts gets the right answer
- semantics = &toSemantics;
- // No normalization here, just truncate
- if (shift>0)
- APInt::tcShiftLeft(significandParts(), newPartCount, shift);
- else if (shift < 0)
- APInt::tcShiftRight(significandParts(), newPartCount, -shift);
- // gcc forces the Quiet bit on, which means (float)(double)(float_sNan)
- // does not give you back the same bits. This is dubious, and we
- // don't currently do it. You're really supposed to get
- // an invalid operation signal at runtime, but nobody does that.
- fs = opOK;
- } else {
- semantics = &toSemantics;
- fs = opOK;
- }
-
- return fs;
-}
-
-/* Convert a floating point number to an integer according to the
- rounding mode. If the rounded integer value is out of range this
- returns an invalid operation exception and the contents of the
- destination parts are unspecified. If the rounded value is in
- range but the floating point number is not the exact integer, the C
- standard doesn't require an inexact exception to be raised. IEEE
- 854 does require it so we do that.
-
- Note that for conversions to integer type the C standard requires
- round-to-zero to always be used. */
-APFloat::opStatus
-APFloat::convertToSignExtendedInteger(integerPart *parts, unsigned int width,
- bool isSigned,
- roundingMode rounding_mode) const
-{
- lostFraction lost_fraction;
- const integerPart *src;
- unsigned int dstPartsCount, truncatedBits;
-
- assertArithmeticOK(*semantics);
-
- /* Handle the three special cases first. */
- if(category == fcInfinity || category == fcNaN)
- return opInvalidOp;
-
- dstPartsCount = partCountForBits(width);
-
- if(category == fcZero) {
- APInt::tcSet(parts, 0, dstPartsCount);
- return opOK;
- }
-
- src = significandParts();
-
- /* Step 1: place our absolute value, with any fraction truncated, in
- the destination. */
- if (exponent < 0) {
- /* Our absolute value is less than one; truncate everything. */
- APInt::tcSet(parts, 0, dstPartsCount);
- truncatedBits = semantics->precision;
- } else {
- /* We want the most significant (exponent + 1) bits; the rest are
- truncated. */
- unsigned int bits = exponent + 1U;
-
- /* Hopelessly large in magnitude? */
- if (bits > width)
- return opInvalidOp;
-
- if (bits < semantics->precision) {
- /* We truncate (semantics->precision - bits) bits. */
- truncatedBits = semantics->precision - bits;
- APInt::tcExtract(parts, dstPartsCount, src, bits, truncatedBits);
- } else {
- /* We want at least as many bits as are available. */
- APInt::tcExtract(parts, dstPartsCount, src, semantics->precision, 0);
- APInt::tcShiftLeft(parts, dstPartsCount, bits - semantics->precision);
- truncatedBits = 0;
- }
- }
-
- /* Step 2: work out any lost fraction, and increment the absolute
- value if we would round away from zero. */
- if (truncatedBits) {
- lost_fraction = lostFractionThroughTruncation(src, partCount(),
- truncatedBits);
- if (lost_fraction != lfExactlyZero
- && roundAwayFromZero(rounding_mode, lost_fraction, truncatedBits)) {
- if (APInt::tcIncrement(parts, dstPartsCount))
- return opInvalidOp; /* Overflow. */
- }
- } else {
- lost_fraction = lfExactlyZero;
- }
-
- /* Step 3: check if we fit in the destination. */
- unsigned int omsb = APInt::tcMSB(parts, dstPartsCount) + 1;
-
- if (sign) {
- if (!isSigned) {
- /* Negative numbers cannot be represented as unsigned. */
- if (omsb != 0)
- return opInvalidOp;
- } else {
- /* It takes omsb bits to represent the unsigned integer value.
- We lose a bit for the sign, but care is needed as the
- maximally negative integer is a special case. */
- if (omsb == width && APInt::tcLSB(parts, dstPartsCount) + 1 != omsb)
- return opInvalidOp;
-
- /* This case can happen because of rounding. */
- if (omsb > width)
- return opInvalidOp;
- }
-
- APInt::tcNegate (parts, dstPartsCount);
- } else {
- if (omsb >= width + !isSigned)
- return opInvalidOp;
- }
-
- if (lost_fraction == lfExactlyZero)
- return opOK;
- else
- return opInexact;
-}
-
-/* Same as convertToSignExtendedInteger, except we provide
- deterministic values in case of an invalid operation exception,
- namely zero for NaNs and the minimal or maximal value respectively
- for underflow or overflow. */
-APFloat::opStatus
-APFloat::convertToInteger(integerPart *parts, unsigned int width,
- bool isSigned,
- roundingMode rounding_mode) const
-{
- opStatus fs;
-
- fs = convertToSignExtendedInteger(parts, width, isSigned, rounding_mode);
-
- if (fs == opInvalidOp) {
- unsigned int bits, dstPartsCount;
-
- dstPartsCount = partCountForBits(width);
-
- if (category == fcNaN)
- bits = 0;
- else if (sign)
- bits = isSigned;
- else
- bits = width - isSigned;
-
- APInt::tcSetLeastSignificantBits(parts, dstPartsCount, bits);
- if (sign && isSigned)
- APInt::tcShiftLeft(parts, dstPartsCount, width - 1);
- }
-
- return fs;
-}
-
-/* Convert an unsigned integer SRC to a floating point number,
- rounding according to ROUNDING_MODE. The sign of the floating
- point number is not modified. */
-APFloat::opStatus
-APFloat::convertFromUnsignedParts(const integerPart *src,
- unsigned int srcCount,
- roundingMode rounding_mode)
-{
- unsigned int omsb, precision, dstCount;
- integerPart *dst;
- lostFraction lost_fraction;
-
- assertArithmeticOK(*semantics);
- category = fcNormal;
- omsb = APInt::tcMSB(src, srcCount) + 1;
- dst = significandParts();
- dstCount = partCount();
- precision = semantics->precision;
-
- /* We want the most significant PRECISON bits of SRC. There may not
- be that many; extract what we can. */
- if (precision <= omsb) {
- exponent = omsb - 1;
- lost_fraction = lostFractionThroughTruncation(src, srcCount,
- omsb - precision);
- APInt::tcExtract(dst, dstCount, src, precision, omsb - precision);
- } else {
- exponent = precision - 1;
- lost_fraction = lfExactlyZero;
- APInt::tcExtract(dst, dstCount, src, omsb, 0);
- }
-
- return normalize(rounding_mode, lost_fraction);
-}
-
-APFloat::opStatus
-APFloat::convertFromAPInt(const APInt &Val,
- bool isSigned,
- roundingMode rounding_mode)
-{
- unsigned int partCount = Val.getNumWords();
- APInt api = Val;
-
- sign = false;
- if (isSigned && api.isNegative()) {
- sign = true;
- api = -api;
- }
-
- return convertFromUnsignedParts(api.getRawData(), partCount, rounding_mode);
-}
-
-/* Convert a two's complement integer SRC to a floating point number,
- rounding according to ROUNDING_MODE. ISSIGNED is true if the
- integer is signed, in which case it must be sign-extended. */
-APFloat::opStatus
-APFloat::convertFromSignExtendedInteger(const integerPart *src,
- unsigned int srcCount,
- bool isSigned,
- roundingMode rounding_mode)
-{
- opStatus status;
-
- assertArithmeticOK(*semantics);
- if (isSigned
- && APInt::tcExtractBit(src, srcCount * integerPartWidth - 1)) {
- integerPart *copy;
-
- /* If we're signed and negative negate a copy. */
- sign = true;
- copy = new integerPart[srcCount];
- APInt::tcAssign(copy, src, srcCount);
- APInt::tcNegate(copy, srcCount);
- status = convertFromUnsignedParts(copy, srcCount, rounding_mode);
- delete [] copy;
- } else {
- sign = false;
- status = convertFromUnsignedParts(src, srcCount, rounding_mode);
- }
-
- return status;
-}
-
-/* FIXME: should this just take a const APInt reference? */
-APFloat::opStatus
-APFloat::convertFromZeroExtendedInteger(const integerPart *parts,
- unsigned int width, bool isSigned,
- roundingMode rounding_mode)
-{
- unsigned int partCount = partCountForBits(width);
- APInt api = APInt(width, partCount, parts);
-
- sign = false;
- if(isSigned && APInt::tcExtractBit(parts, width - 1)) {
- sign = true;
- api = -api;
- }
-
- return convertFromUnsignedParts(api.getRawData(), partCount, rounding_mode);
-}
-
-APFloat::opStatus
-APFloat::convertFromHexadecimalString(const char *p,
- roundingMode rounding_mode)
-{
- lostFraction lost_fraction;
- integerPart *significand;
- unsigned int bitPos, partsCount;
- const char *dot, *firstSignificantDigit;
-
- zeroSignificand();
- exponent = 0;
- category = fcNormal;
-
- significand = significandParts();
- partsCount = partCount();
- bitPos = partsCount * integerPartWidth;
-
- /* Skip leading zeroes and any (hexa)decimal point. */
- p = skipLeadingZeroesAndAnyDot(p, &dot);
- firstSignificantDigit = p;
-
- for(;;) {
- unsigned int hex_value;
-
- if(*p == '.') {
- assert(dot == 0);
- dot = p++;
- }
-
- hex_value = hexDigitValue(*p);
- if(hex_value == -1U) {
- lost_fraction = lfExactlyZero;
- break;
- }
-
- p++;
-
- /* Store the number whilst 4-bit nibbles remain. */
- if(bitPos) {
- bitPos -= 4;
- hex_value <<= bitPos % integerPartWidth;
- significand[bitPos / integerPartWidth] |= hex_value;
- } else {
- lost_fraction = trailingHexadecimalFraction(p, hex_value);
- while(hexDigitValue(*p) != -1U)
- p++;
- break;
- }
- }
-
- /* Hex floats require an exponent but not a hexadecimal point. */
- assert(*p == 'p' || *p == 'P');
-
- /* Ignore the exponent if we are zero. */
- if(p != firstSignificantDigit) {
- int expAdjustment;
-
- /* Implicit hexadecimal point? */
- if(!dot)
- dot = p;
-
- /* Calculate the exponent adjustment implicit in the number of
- significant digits. */
- expAdjustment = static_cast<int>(dot - firstSignificantDigit);
- if(expAdjustment < 0)
- expAdjustment++;
- expAdjustment = expAdjustment * 4 - 1;
-
- /* Adjust for writing the significand starting at the most
- significant nibble. */
- expAdjustment += semantics->precision;
- expAdjustment -= partsCount * integerPartWidth;
-
- /* Adjust for the given exponent. */
- exponent = totalExponent(p, expAdjustment);
- }
-
- return normalize(rounding_mode, lost_fraction);
-}
-
-APFloat::opStatus
-APFloat::roundSignificandWithExponent(const integerPart *decSigParts,
- unsigned sigPartCount, int exp,
- roundingMode rounding_mode)
-{
- unsigned int parts, pow5PartCount;
- fltSemantics calcSemantics = { 32767, -32767, 0, true };
- integerPart pow5Parts[maxPowerOfFiveParts];
- bool isNearest;
-
- isNearest = (rounding_mode == rmNearestTiesToEven
- || rounding_mode == rmNearestTiesToAway);
-
- parts = partCountForBits(semantics->precision + 11);
-
- /* Calculate pow(5, abs(exp)). */
- pow5PartCount = powerOf5(pow5Parts, exp >= 0 ? exp: -exp);
-
- for (;; parts *= 2) {
- opStatus sigStatus, powStatus;
- unsigned int excessPrecision, truncatedBits;
-
- calcSemantics.precision = parts * integerPartWidth - 1;
- excessPrecision = calcSemantics.precision - semantics->precision;
- truncatedBits = excessPrecision;
-
- APFloat decSig(calcSemantics, fcZero, sign);
- APFloat pow5(calcSemantics, fcZero, false);
-
- sigStatus = decSig.convertFromUnsignedParts(decSigParts, sigPartCount,
- rmNearestTiesToEven);
- powStatus = pow5.convertFromUnsignedParts(pow5Parts, pow5PartCount,
- rmNearestTiesToEven);
- /* Add exp, as 10^n = 5^n * 2^n. */
- decSig.exponent += exp;
-
- lostFraction calcLostFraction;
- integerPart HUerr, HUdistance;
- unsigned int powHUerr;
-
- if (exp >= 0) {
- /* multiplySignificand leaves the precision-th bit set to 1. */
- calcLostFraction = decSig.multiplySignificand(pow5, NULL);
- powHUerr = powStatus != opOK;
- } else {
- calcLostFraction = decSig.divideSignificand(pow5);
- /* Denormal numbers have less precision. */
- if (decSig.exponent < semantics->minExponent) {
- excessPrecision += (semantics->minExponent - decSig.exponent);
- truncatedBits = excessPrecision;
- if (excessPrecision > calcSemantics.precision)
- excessPrecision = calcSemantics.precision;
- }
- /* Extra half-ulp lost in reciprocal of exponent. */
- powHUerr = (powStatus == opOK && calcLostFraction == lfExactlyZero) ? 0:2;
- }
-
- /* Both multiplySignificand and divideSignificand return the
- result with the integer bit set. */
- assert (APInt::tcExtractBit
- (decSig.significandParts(), calcSemantics.precision - 1) == 1);
-
- HUerr = HUerrBound(calcLostFraction != lfExactlyZero, sigStatus != opOK,
- powHUerr);
- HUdistance = 2 * ulpsFromBoundary(decSig.significandParts(),
- excessPrecision, isNearest);
-
- /* Are we guaranteed to round correctly if we truncate? */
- if (HUdistance >= HUerr) {
- APInt::tcExtract(significandParts(), partCount(), decSig.significandParts(),
- calcSemantics.precision - excessPrecision,
- excessPrecision);
- /* Take the exponent of decSig. If we tcExtract-ed less bits
- above we must adjust our exponent to compensate for the
- implicit right shift. */
- exponent = (decSig.exponent + semantics->precision
- - (calcSemantics.precision - excessPrecision));
- calcLostFraction = lostFractionThroughTruncation(decSig.significandParts(),
- decSig.partCount(),
- truncatedBits);
- return normalize(rounding_mode, calcLostFraction);
- }
- }
-}
-
-APFloat::opStatus
-APFloat::convertFromDecimalString(const char *p, roundingMode rounding_mode)
-{
- decimalInfo D;
- opStatus fs;
-
- /* Scan the text. */
- interpretDecimal(p, &D);
-
- /* Handle the quick cases. First the case of no significant digits,
- i.e. zero, and then exponents that are obviously too large or too
- small. Writing L for log 10 / log 2, a number d.ddddd*10^exp
- definitely overflows if
-
- (exp - 1) * L >= maxExponent
-
- and definitely underflows to zero where
-
- (exp + 1) * L <= minExponent - precision
-
- With integer arithmetic the tightest bounds for L are
-
- 93/28 < L < 196/59 [ numerator <= 256 ]
- 42039/12655 < L < 28738/8651 [ numerator <= 65536 ]
- */
-
- if (decDigitValue(*D.firstSigDigit) >= 10U) {
- category = fcZero;
- fs = opOK;
- } else if ((D.normalizedExponent + 1) * 28738
- <= 8651 * (semantics->minExponent - (int) semantics->precision)) {
- /* Underflow to zero and round. */
- zeroSignificand();
- fs = normalize(rounding_mode, lfLessThanHalf);
- } else if ((D.normalizedExponent - 1) * 42039
- >= 12655 * semantics->maxExponent) {
- /* Overflow and round. */
- fs = handleOverflow(rounding_mode);
- } else {
- integerPart *decSignificand;
- unsigned int partCount;
-
- /* A tight upper bound on number of bits required to hold an
- N-digit decimal integer is N * 196 / 59. Allocate enough space
- to hold the full significand, and an extra part required by
- tcMultiplyPart. */
- partCount = static_cast<unsigned int>(D.lastSigDigit - D.firstSigDigit) + 1;
- partCount = partCountForBits(1 + 196 * partCount / 59);
- decSignificand = new integerPart[partCount + 1];
- partCount = 0;
-
- /* Convert to binary efficiently - we do almost all multiplication
- in an integerPart. When this would overflow do we do a single
- bignum multiplication, and then revert again to multiplication
- in an integerPart. */
- do {
- integerPart decValue, val, multiplier;
-
- val = 0;
- multiplier = 1;
-
- do {
- if (*p == '.')
- p++;
-
- decValue = decDigitValue(*p++);
- multiplier *= 10;
- val = val * 10 + decValue;
- /* The maximum number that can be multiplied by ten with any
- digit added without overflowing an integerPart. */
- } while (p <= D.lastSigDigit && multiplier <= (~ (integerPart) 0 - 9) / 10);
-
- /* Multiply out the current part. */
- APInt::tcMultiplyPart(decSignificand, decSignificand, multiplier, val,
- partCount, partCount + 1, false);
-
- /* If we used another part (likely but not guaranteed), increase
- the count. */
- if (decSignificand[partCount])
- partCount++;
- } while (p <= D.lastSigDigit);
-
- category = fcNormal;
- fs = roundSignificandWithExponent(decSignificand, partCount,
- D.exponent, rounding_mode);
-
- delete [] decSignificand;
- }
-
- return fs;
-}
-
-APFloat::opStatus
-APFloat::convertFromString(const char *p, roundingMode rounding_mode)
-{
- assertArithmeticOK(*semantics);
-
- /* Handle a leading minus sign. */
- if(*p == '-')
- sign = 1, p++;
- else
- sign = 0;
-
- if(p[0] == '0' && (p[1] == 'x' || p[1] == 'X'))
- return convertFromHexadecimalString(p + 2, rounding_mode);
- else
- return convertFromDecimalString(p, rounding_mode);
-}
-
-/* Write out a hexadecimal representation of the floating point value
- to DST, which must be of sufficient size, in the C99 form
- [-]0xh.hhhhp[+-]d. Return the number of characters written,
- excluding the terminating NUL.
-
- If UPPERCASE, the output is in upper case, otherwise in lower case.
-
- HEXDIGITS digits appear altogether, rounding the value if
- necessary. If HEXDIGITS is 0, the minimal precision to display the
- number precisely is used instead. If nothing would appear after
- the decimal point it is suppressed.
-
- The decimal exponent is always printed and has at least one digit.
- Zero values display an exponent of zero. Infinities and NaNs
- appear as "infinity" or "nan" respectively.
-
- The above rules are as specified by C99. There is ambiguity about
- what the leading hexadecimal digit should be. This implementation
- uses whatever is necessary so that the exponent is displayed as
- stored. This implies the exponent will fall within the IEEE format
- range, and the leading hexadecimal digit will be 0 (for denormals),
- 1 (normal numbers) or 2 (normal numbers rounded-away-from-zero with
- any other digits zero).
-*/
-unsigned int
-APFloat::convertToHexString(char *dst, unsigned int hexDigits,
- bool upperCase, roundingMode rounding_mode) const
-{
- char *p;
-
- assertArithmeticOK(*semantics);
-
- p = dst;
- if (sign)
- *dst++ = '-';
-
- switch (category) {
- case fcInfinity:
- memcpy (dst, upperCase ? infinityU: infinityL, sizeof infinityU - 1);
- dst += sizeof infinityL - 1;
- break;
-
- case fcNaN:
- memcpy (dst, upperCase ? NaNU: NaNL, sizeof NaNU - 1);
- dst += sizeof NaNU - 1;
- break;
-
- case fcZero:
- *dst++ = '0';
- *dst++ = upperCase ? 'X': 'x';
- *dst++ = '0';
- if (hexDigits > 1) {
- *dst++ = '.';
- memset (dst, '0', hexDigits - 1);
- dst += hexDigits - 1;
- }
- *dst++ = upperCase ? 'P': 'p';
- *dst++ = '0';
- break;
-
- case fcNormal:
- dst = convertNormalToHexString (dst, hexDigits, upperCase, rounding_mode);
- break;
- }
-
- *dst = 0;
-
- return static_cast<unsigned int>(dst - p);
-}
-
-/* Does the hard work of outputting the correctly rounded hexadecimal
- form of a normal floating point number with the specified number of
- hexadecimal digits. If HEXDIGITS is zero the minimum number of
- digits necessary to print the value precisely is output. */
-char *
-APFloat::convertNormalToHexString(char *dst, unsigned int hexDigits,
- bool upperCase,
- roundingMode rounding_mode) const
-{
- unsigned int count, valueBits, shift, partsCount, outputDigits;
- const char *hexDigitChars;
- const integerPart *significand;
- char *p;
- bool roundUp;
-
- *dst++ = '0';
- *dst++ = upperCase ? 'X': 'x';
-
- roundUp = false;
- hexDigitChars = upperCase ? hexDigitsUpper: hexDigitsLower;
-
- significand = significandParts();
- partsCount = partCount();
-
- /* +3 because the first digit only uses the single integer bit, so
- we have 3 virtual zero most-significant-bits. */
- valueBits = semantics->precision + 3;
- shift = integerPartWidth - valueBits % integerPartWidth;
-
- /* The natural number of digits required ignoring trailing
- insignificant zeroes. */
- outputDigits = (valueBits - significandLSB () + 3) / 4;
-
- /* hexDigits of zero means use the required number for the
- precision. Otherwise, see if we are truncating. If we are,
- find out if we need to round away from zero. */
- if (hexDigits) {
- if (hexDigits < outputDigits) {
- /* We are dropping non-zero bits, so need to check how to round.
- "bits" is the number of dropped bits. */
- unsigned int bits;
- lostFraction fraction;
-
- bits = valueBits - hexDigits * 4;
- fraction = lostFractionThroughTruncation (significand, partsCount, bits);
- roundUp = roundAwayFromZero(rounding_mode, fraction, bits);
- }
- outputDigits = hexDigits;
- }
-
- /* Write the digits consecutively, and start writing in the location
- of the hexadecimal point. We move the most significant digit
- left and add the hexadecimal point later. */
- p = ++dst;
-
- count = (valueBits + integerPartWidth - 1) / integerPartWidth;
-
- while (outputDigits && count) {
- integerPart part;
-
- /* Put the most significant integerPartWidth bits in "part". */
- if (--count == partsCount)
- part = 0; /* An imaginary higher zero part. */
- else
- part = significand[count] << shift;
-
- if (count && shift)
- part |= significand[count - 1] >> (integerPartWidth - shift);
-
- /* Convert as much of "part" to hexdigits as we can. */
- unsigned int curDigits = integerPartWidth / 4;
-
- if (curDigits > outputDigits)
- curDigits = outputDigits;
- dst += partAsHex (dst, part, curDigits, hexDigitChars);
- outputDigits -= curDigits;
- }
-
- if (roundUp) {
- char *q = dst;
-
- /* Note that hexDigitChars has a trailing '0'. */
- do {
- q--;
- *q = hexDigitChars[hexDigitValue (*q) + 1];
- } while (*q == '0');
- assert (q >= p);
- } else {
- /* Add trailing zeroes. */
- memset (dst, '0', outputDigits);
- dst += outputDigits;
- }
-
- /* Move the most significant digit to before the point, and if there
- is something after the decimal point add it. This must come
- after rounding above. */
- p[-1] = p[0];
- if (dst -1 == p)
- dst--;
- else
- p[0] = '.';
-
- /* Finally output the exponent. */
- *dst++ = upperCase ? 'P': 'p';
-
- return writeSignedDecimal (dst, exponent);
-}
-
-// For good performance it is desirable for different APFloats
-// to produce different integers.
-uint32_t
-APFloat::getHashValue() const
-{
- if (category==fcZero) return sign<<8 | semantics->precision ;
- else if (category==fcInfinity) return sign<<9 | semantics->precision;
- else if (category==fcNaN) return 1<<10 | semantics->precision;
- else {
- uint32_t hash = sign<<11 | semantics->precision | exponent<<12;
- const integerPart* p = significandParts();
- for (int i=partCount(); i>0; i--, p++)
- hash ^= ((uint32_t)*p) ^ (uint32_t)((*p)>>32);
- return hash;
- }
-}
-
-// Conversion from APFloat to/from host float/double. It may eventually be
-// possible to eliminate these and have everybody deal with APFloats, but that
-// will take a while. This approach will not easily extend to long double.
-// Current implementation requires integerPartWidth==64, which is correct at
-// the moment but could be made more general.
-
-// Denormals have exponent minExponent in APFloat, but minExponent-1 in
-// the actual IEEE respresentations. We compensate for that here.
-
-APInt
-APFloat::convertF80LongDoubleAPFloatToAPInt() const
-{
- assert(semantics == (const llvm::fltSemantics*)&x87DoubleExtended);
- assert (partCount()==2);
-
- uint64_t myexponent, mysignificand;
-
- if (category==fcNormal) {
- myexponent = exponent+16383; //bias
- mysignificand = significandParts()[0];
- if (myexponent==1 && !(mysignificand & 0x8000000000000000ULL))
- myexponent = 0; // denormal
- } else if (category==fcZero) {
- myexponent = 0;
- mysignificand = 0;
- } else if (category==fcInfinity) {
- myexponent = 0x7fff;
- mysignificand = 0x8000000000000000ULL;
- } else {
- assert(category == fcNaN && "Unknown category");
- myexponent = 0x7fff;
- mysignificand = significandParts()[0];
- }
-
- uint64_t words[2];
- words[0] = ((uint64_t)(sign & 1) << 63) |
- ((myexponent & 0x7fffLL) << 48) |
- ((mysignificand >>16) & 0xffffffffffffLL);
- words[1] = mysignificand & 0xffff;
- return APInt(80, 2, words);
-}
-
-APInt
-APFloat::convertPPCDoubleDoubleAPFloatToAPInt() const
-{
- assert(semantics == (const llvm::fltSemantics*)&PPCDoubleDouble);
- assert (partCount()==2);
-
- uint64_t myexponent, mysignificand, myexponent2, mysignificand2;
-
- if (category==fcNormal) {
- myexponent = exponent + 1023; //bias
- myexponent2 = exponent2 + 1023;
- mysignificand = significandParts()[0];
- mysignificand2 = significandParts()[1];
- if (myexponent==1 && !(mysignificand & 0x10000000000000LL))
- myexponent = 0; // denormal
- if (myexponent2==1 && !(mysignificand2 & 0x10000000000000LL))
- myexponent2 = 0; // denormal
- } else if (category==fcZero) {
- myexponent = 0;
- mysignificand = 0;
- myexponent2 = 0;
- mysignificand2 = 0;
- } else if (category==fcInfinity) {
- myexponent = 0x7ff;
- myexponent2 = 0;
- mysignificand = 0;
- mysignificand2 = 0;
- } else {
- assert(category == fcNaN && "Unknown category");
- myexponent = 0x7ff;
- mysignificand = significandParts()[0];
- myexponent2 = exponent2;
- mysignificand2 = significandParts()[1];
- }
-
- uint64_t words[2];
- words[0] = ((uint64_t)(sign & 1) << 63) |
- ((myexponent & 0x7ff) << 52) |
- (mysignificand & 0xfffffffffffffLL);
- words[1] = ((uint64_t)(sign2 & 1) << 63) |
- ((myexponent2 & 0x7ff) << 52) |
- (mysignificand2 & 0xfffffffffffffLL);
- return APInt(128, 2, words);
-}
-
-APInt
-APFloat::convertDoubleAPFloatToAPInt() const
-{
- assert(semantics == (const llvm::fltSemantics*)&IEEEdouble);
- assert (partCount()==1);
-
- uint64_t myexponent, mysignificand;
-
- if (category==fcNormal) {
- myexponent = exponent+1023; //bias
- mysignificand = *significandParts();
- if (myexponent==1 && !(mysignificand & 0x10000000000000LL))
- myexponent = 0; // denormal
- } else if (category==fcZero) {
- myexponent = 0;
- mysignificand = 0;
- } else if (category==fcInfinity) {
- myexponent = 0x7ff;
- mysignificand = 0;
- } else {
- assert(category == fcNaN && "Unknown category!");
- myexponent = 0x7ff;
- mysignificand = *significandParts();
- }
-
- return APInt(64, ((((uint64_t)(sign & 1) << 63) |
- ((myexponent & 0x7ff) << 52) |
- (mysignificand & 0xfffffffffffffLL))));
-}
-
-APInt
-APFloat::convertFloatAPFloatToAPInt() const
-{
- assert(semantics == (const llvm::fltSemantics*)&IEEEsingle);
- assert (partCount()==1);
-
- uint32_t myexponent, mysignificand;
-
- if (category==fcNormal) {
- myexponent = exponent+127; //bias
- mysignificand = (uint32_t)*significandParts();
- if (myexponent == 1 && !(mysignificand & 0x800000))
- myexponent = 0; // denormal
- } else if (category==fcZero) {
- myexponent = 0;
- mysignificand = 0;
- } else if (category==fcInfinity) {
- myexponent = 0xff;
- mysignificand = 0;
- } else {
- assert(category == fcNaN && "Unknown category!");
- myexponent = 0xff;
- mysignificand = (uint32_t)*significandParts();
- }
-
- return APInt(32, (((sign&1) << 31) | ((myexponent&0xff) << 23) |
- (mysignificand & 0x7fffff)));
-}
-
-// This function creates an APInt that is just a bit map of the floating
-// point constant as it would appear in memory. It is not a conversion,
-// and treating the result as a normal integer is unlikely to be useful.
-
-APInt
-APFloat::convertToAPInt() const
-{
- if (semantics == (const llvm::fltSemantics*)&IEEEsingle)
- return convertFloatAPFloatToAPInt();
-
- if (semantics == (const llvm::fltSemantics*)&IEEEdouble)
- return convertDoubleAPFloatToAPInt();
-
- if (semantics == (const llvm::fltSemantics*)&PPCDoubleDouble)
- return convertPPCDoubleDoubleAPFloatToAPInt();
-
- assert(semantics == (const llvm::fltSemantics*)&x87DoubleExtended &&
- "unknown format!");
- return convertF80LongDoubleAPFloatToAPInt();
-}
-
-float
-APFloat::convertToFloat() const
-{
- assert(semantics == (const llvm::fltSemantics*)&IEEEsingle);
- APInt api = convertToAPInt();
- return api.bitsToFloat();
-}
-
-double
-APFloat::convertToDouble() const
-{
- assert(semantics == (const llvm::fltSemantics*)&IEEEdouble);
- APInt api = convertToAPInt();
- return api.bitsToDouble();
-}
-
-/// Integer bit is explicit in this format. Current Intel book does not
-/// define meaning of:
-/// exponent = all 1's, integer bit not set.
-/// exponent = 0, integer bit set. (formerly "psuedodenormals")
-/// exponent!=0 nor all 1's, integer bit not set. (formerly "unnormals")
-void
-APFloat::initFromF80LongDoubleAPInt(const APInt &api)
-{
- assert(api.getBitWidth()==80);
- uint64_t i1 = api.getRawData()[0];
- uint64_t i2 = api.getRawData()[1];
- uint64_t myexponent = (i1 >> 48) & 0x7fff;
- uint64_t mysignificand = ((i1 << 16) & 0xffffffffffff0000ULL) |
- (i2 & 0xffff);
-
- initialize(&APFloat::x87DoubleExtended);
- assert(partCount()==2);
-
- sign = static_cast<unsigned int>(i1>>63);
- if (myexponent==0 && mysignificand==0) {
- // exponent, significand meaningless
- category = fcZero;
- } else if (myexponent==0x7fff && mysignificand==0x8000000000000000ULL) {
- // exponent, significand meaningless
- category = fcInfinity;
- } else if (myexponent==0x7fff && mysignificand!=0x8000000000000000ULL) {
- // exponent meaningless
- category = fcNaN;
- significandParts()[0] = mysignificand;
- significandParts()[1] = 0;
- } else {
- category = fcNormal;
- exponent = myexponent - 16383;
- significandParts()[0] = mysignificand;
- significandParts()[1] = 0;
- if (myexponent==0) // denormal
- exponent = -16382;
- }
-}
-
-void
-APFloat::initFromPPCDoubleDoubleAPInt(const APInt &api)
-{
- assert(api.getBitWidth()==128);
- uint64_t i1 = api.getRawData()[0];
- uint64_t i2 = api.getRawData()[1];
- uint64_t myexponent = (i1 >> 52) & 0x7ff;
- uint64_t mysignificand = i1 & 0xfffffffffffffLL;
- uint64_t myexponent2 = (i2 >> 52) & 0x7ff;
- uint64_t mysignificand2 = i2 & 0xfffffffffffffLL;
-
- initialize(&APFloat::PPCDoubleDouble);
- assert(partCount()==2);
-
- sign = static_cast<unsigned int>(i1>>63);
- sign2 = static_cast<unsigned int>(i2>>63);
- if (myexponent==0 && mysignificand==0) {
- // exponent, significand meaningless
- // exponent2 and significand2 are required to be 0; we don't check
- category = fcZero;
- } else if (myexponent==0x7ff && mysignificand==0) {
- // exponent, significand meaningless
- // exponent2 and significand2 are required to be 0; we don't check
- category = fcInfinity;
- } else if (myexponent==0x7ff && mysignificand!=0) {
- // exponent meaningless. So is the whole second word, but keep it
- // for determinism.
- category = fcNaN;
- exponent2 = myexponent2;
- significandParts()[0] = mysignificand;
- significandParts()[1] = mysignificand2;
- } else {
- category = fcNormal;
- // Note there is no category2; the second word is treated as if it is
- // fcNormal, although it might be something else considered by itself.
- exponent = myexponent - 1023;
- exponent2 = myexponent2 - 1023;
- significandParts()[0] = mysignificand;
- significandParts()[1] = mysignificand2;
- if (myexponent==0) // denormal
- exponent = -1022;
- else
- significandParts()[0] |= 0x10000000000000LL; // integer bit
- if (myexponent2==0)
- exponent2 = -1022;
- else
- significandParts()[1] |= 0x10000000000000LL; // integer bit
- }
-}
-
-void
-APFloat::initFromDoubleAPInt(const APInt &api)
-{
- assert(api.getBitWidth()==64);
- uint64_t i = *api.getRawData();
- uint64_t myexponent = (i >> 52) & 0x7ff;
- uint64_t mysignificand = i & 0xfffffffffffffLL;
-
- initialize(&APFloat::IEEEdouble);
- assert(partCount()==1);
-
- sign = static_cast<unsigned int>(i>>63);
- if (myexponent==0 && mysignificand==0) {
- // exponent, significand meaningless
- category = fcZero;
- } else if (myexponent==0x7ff && mysignificand==0) {
- // exponent, significand meaningless
- category = fcInfinity;
- } else if (myexponent==0x7ff && mysignificand!=0) {
- // exponent meaningless
- category = fcNaN;
- *significandParts() = mysignificand;
- } else {
- category = fcNormal;
- exponent = myexponent - 1023;
- *significandParts() = mysignificand;
- if (myexponent==0) // denormal
- exponent = -1022;
- else
- *significandParts() |= 0x10000000000000LL; // integer bit
- }
-}
-
-void
-APFloat::initFromFloatAPInt(const APInt & api)
-{
- assert(api.getBitWidth()==32);
- uint32_t i = (uint32_t)*api.getRawData();
- uint32_t myexponent = (i >> 23) & 0xff;
- uint32_t mysignificand = i & 0x7fffff;
-
- initialize(&APFloat::IEEEsingle);
- assert(partCount()==1);
-
- sign = i >> 31;
- if (myexponent==0 && mysignificand==0) {
- // exponent, significand meaningless
- category = fcZero;
- } else if (myexponent==0xff && mysignificand==0) {
- // exponent, significand meaningless
- category = fcInfinity;
- } else if (myexponent==0xff && mysignificand!=0) {
- // sign, exponent, significand meaningless
- category = fcNaN;
- *significandParts() = mysignificand;
- } else {
- category = fcNormal;
- exponent = myexponent - 127; //bias
- *significandParts() = mysignificand;
- if (myexponent==0) // denormal
- exponent = -126;
- else
- *significandParts() |= 0x800000; // integer bit
- }
-}
-
-/// Treat api as containing the bits of a floating point number. Currently
-/// we infer the floating point type from the size of the APInt. The
-/// isIEEE argument distinguishes between PPC128 and IEEE128 (not meaningful
-/// when the size is anything else).
-void
-APFloat::initFromAPInt(const APInt& api, bool isIEEE)
-{
- if (api.getBitWidth() == 32)
- return initFromFloatAPInt(api);
- else if (api.getBitWidth()==64)
- return initFromDoubleAPInt(api);
- else if (api.getBitWidth()==80)
- return initFromF80LongDoubleAPInt(api);
- else if (api.getBitWidth()==128 && !isIEEE)
- return initFromPPCDoubleDoubleAPInt(api);
- else
- assert(0);
-}
-
-APFloat::APFloat(const APInt& api, bool isIEEE)
-{
- initFromAPInt(api, isIEEE);
-}
-
-APFloat::APFloat(float f)
-{
- APInt api = APInt(32, 0);
- initFromAPInt(api.floatToBits(f));
-}
-
-APFloat::APFloat(double d)
-{
- APInt api = APInt(64, 0);
- initFromAPInt(api.doubleToBits(d));
-}
diff --git a/release_23/lib/Support/APInt.cpp b/release_23/lib/Support/APInt.cpp
deleted file mode 100644
index ef35e1c554c8..000000000000
--- a/release_23/lib/Support/APInt.cpp
+++ /dev/null
@@ -1,2713 +0,0 @@
-//===-- APInt.cpp - Implement APInt class ---------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements a class to represent arbitrary precision integer
-// constant values and provide a variety of arithmetic operations on them.
-//
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "apint"
-#include "llvm/ADT/APInt.h"
-#include "llvm/ADT/FoldingSet.h"
-#include "llvm/Support/Debug.h"
-#include "llvm/Support/MathExtras.h"
-#include <math.h>
-#include <limits>
-#include <cstring>
-#include <cstdlib>
-#include <iomanip>
-
-using namespace llvm;
-
-/// This enumeration just provides for internal constants used in this
-/// translation unit.
-enum {
- MIN_INT_BITS = 1, ///< Minimum number of bits that can be specified
- ///< Note that this must remain synchronized with IntegerType::MIN_INT_BITS
- MAX_INT_BITS = (1<<23)-1 ///< Maximum number of bits that can be specified
- ///< Note that this must remain synchronized with IntegerType::MAX_INT_BITS
-};
-
-/// A utility function for allocating memory, checking for allocation failures,
-/// and ensuring the contents are zeroed.
-inline static uint64_t* getClearedMemory(uint32_t numWords) {
- uint64_t * result = new uint64_t[numWords];
- assert(result && "APInt memory allocation fails!");
- memset(result, 0, numWords * sizeof(uint64_t));
- return result;
-}
-
-/// A utility function for allocating memory and checking for allocation
-/// failure. The content is not zeroed.
-inline static uint64_t* getMemory(uint32_t numWords) {
- uint64_t * result = new uint64_t[numWords];
- assert(result && "APInt memory allocation fails!");
- return result;
-}
-
-APInt::APInt(uint32_t numBits, uint64_t val, bool isSigned)
- : BitWidth(numBits), VAL(0) {
- assert(BitWidth >= MIN_INT_BITS && "bitwidth too small");
- assert(BitWidth <= MAX_INT_BITS && "bitwidth too large");
- if (isSingleWord())
- VAL = val;
- else {
- pVal = getClearedMemory(getNumWords());
- pVal[0] = val;
- if (isSigned && int64_t(val) < 0)
- for (unsigned i = 1; i < getNumWords(); ++i)
- pVal[i] = -1ULL;
- }
- clearUnusedBits();
-}
-
-APInt::APInt(uint32_t numBits, uint32_t numWords, const uint64_t bigVal[])
- : BitWidth(numBits), VAL(0) {
- assert(BitWidth >= MIN_INT_BITS && "bitwidth too small");
- assert(BitWidth <= MAX_INT_BITS && "bitwidth too large");
- assert(bigVal && "Null pointer detected!");
- if (isSingleWord())
- VAL = bigVal[0];
- else {
- // Get memory, cleared to 0
- pVal = getClearedMemory(getNumWords());
- // Calculate the number of words to copy
- uint32_t words = std::min<uint32_t>(numWords, getNumWords());
- // Copy the words from bigVal to pVal
- memcpy(pVal, bigVal, words * APINT_WORD_SIZE);
- }
- // Make sure unused high bits are cleared
- clearUnusedBits();
-}
-
-APInt::APInt(uint32_t numbits, const char StrStart[], uint32_t slen,
- uint8_t radix)
- : BitWidth(numbits), VAL(0) {
- assert(BitWidth >= MIN_INT_BITS && "bitwidth too small");
- assert(BitWidth <= MAX_INT_BITS && "bitwidth too large");
- fromString(numbits, StrStart, slen, radix);
-}
-
-APInt::APInt(uint32_t numbits, const std::string& Val, uint8_t radix)
- : BitWidth(numbits), VAL(0) {
- assert(BitWidth >= MIN_INT_BITS && "bitwidth too small");
- assert(BitWidth <= MAX_INT_BITS && "bitwidth too large");
- assert(!Val.empty() && "String empty?");
- fromString(numbits, Val.c_str(), (uint32_t)Val.size(), radix);
-}
-
-APInt::APInt(const APInt& that)
- : BitWidth(that.BitWidth), VAL(0) {
- assert(BitWidth >= MIN_INT_BITS && "bitwidth too small");
- assert(BitWidth <= MAX_INT_BITS && "bitwidth too large");
- if (isSingleWord())
- VAL = that.VAL;
- else {
- pVal = getMemory(getNumWords());
- memcpy(pVal, that.pVal, getNumWords() * APINT_WORD_SIZE);
- }
-}
-
-APInt::~APInt() {
- if (!isSingleWord() && pVal)
- delete [] pVal;
-}
-
-APInt& APInt::operator=(const APInt& RHS) {
- // Don't do anything for X = X
- if (this == &RHS)
- return *this;
-
- // If the bitwidths are the same, we can avoid mucking with memory
- if (BitWidth == RHS.getBitWidth()) {
- if (isSingleWord())
- VAL = RHS.VAL;
- else
- memcpy(pVal, RHS.pVal, getNumWords() * APINT_WORD_SIZE);
- return *this;
- }
-
- if (isSingleWord())
- if (RHS.isSingleWord())
- VAL = RHS.VAL;
- else {
- VAL = 0;
- pVal = getMemory(RHS.getNumWords());
- memcpy(pVal, RHS.pVal, RHS.getNumWords() * APINT_WORD_SIZE);
- }
- else if (getNumWords() == RHS.getNumWords())
- memcpy(pVal, RHS.pVal, RHS.getNumWords() * APINT_WORD_SIZE);
- else if (RHS.isSingleWord()) {
- delete [] pVal;
- VAL = RHS.VAL;
- } else {
- delete [] pVal;
- pVal = getMemory(RHS.getNumWords());
- memcpy(pVal, RHS.pVal, RHS.getNumWords() * APINT_WORD_SIZE);
- }
- BitWidth = RHS.BitWidth;
- return clearUnusedBits();
-}
-
-APInt& APInt::operator=(uint64_t RHS) {
- if (isSingleWord())
- VAL = RHS;
- else {
- pVal[0] = RHS;
- memset(pVal+1, 0, (getNumWords() - 1) * APINT_WORD_SIZE);
- }
- return clearUnusedBits();
-}
-
-/// Profile - This method 'profiles' an APInt for use with FoldingSet.
-void APInt::Profile(FoldingSetNodeID& ID) const {
- ID.AddInteger(BitWidth);
-
- if (isSingleWord()) {
- ID.AddInteger(VAL);
- return;
- }
-
- uint32_t NumWords = getNumWords();
- for (unsigned i = 0; i < NumWords; ++i)
- ID.AddInteger(pVal[i]);
-}
-
-/// add_1 - This function adds a single "digit" integer, y, to the multiple
-/// "digit" integer array, x[]. x[] is modified to reflect the addition and
-/// 1 is returned if there is a carry out, otherwise 0 is returned.
-/// @returns the carry of the addition.
-static bool add_1(uint64_t dest[], uint64_t x[], uint32_t len, uint64_t y) {
- for (uint32_t i = 0; i < len; ++i) {
- dest[i] = y + x[i];
- if (dest[i] < y)
- y = 1; // Carry one to next digit.
- else {
- y = 0; // No need to carry so exit early
- break;
- }
- }
- return y;
-}
-
-/// @brief Prefix increment operator. Increments the APInt by one.
-APInt& APInt::operator++() {
- if (isSingleWord())
- ++VAL;
- else
- add_1(pVal, pVal, getNumWords(), 1);
- return clearUnusedBits();
-}
-
-/// sub_1 - This function subtracts a single "digit" (64-bit word), y, from
-/// the multi-digit integer array, x[], propagating the borrowed 1 value until
-/// no further borrowing is neeeded or it runs out of "digits" in x. The result
-/// is 1 if "borrowing" exhausted the digits in x, or 0 if x was not exhausted.
-/// In other words, if y > x then this function returns 1, otherwise 0.
-/// @returns the borrow out of the subtraction
-static bool sub_1(uint64_t x[], uint32_t len, uint64_t y) {
- for (uint32_t i = 0; i < len; ++i) {
- uint64_t X = x[i];
- x[i] -= y;
- if (y > X)
- y = 1; // We have to "borrow 1" from next "digit"
- else {
- y = 0; // No need to borrow
- break; // Remaining digits are unchanged so exit early
- }
- }
- return bool(y);
-}
-
-/// @brief Prefix decrement operator. Decrements the APInt by one.
-APInt& APInt::operator--() {
- if (isSingleWord())
- --VAL;
- else
- sub_1(pVal, getNumWords(), 1);
- return clearUnusedBits();
-}
-
-/// add - This function adds the integer array x to the integer array Y and
-/// places the result in dest.
-/// @returns the carry out from the addition
-/// @brief General addition of 64-bit integer arrays
-static bool add(uint64_t *dest, const uint64_t *x, const uint64_t *y,
- uint32_t len) {
- bool carry = false;
- for (uint32_t i = 0; i< len; ++i) {
- uint64_t limit = std::min(x[i],y[i]); // must come first in case dest == x
- dest[i] = x[i] + y[i] + carry;
- carry = dest[i] < limit || (carry && dest[i] == limit);
- }
- return carry;
-}
-
-/// Adds the RHS APint to this APInt.
-/// @returns this, after addition of RHS.
-/// @brief Addition assignment operator.
-APInt& APInt::operator+=(const APInt& RHS) {
- assert(BitWidth == RHS.BitWidth && "Bit widths must be the same");
- if (isSingleWord())
- VAL += RHS.VAL;
- else {
- add(pVal, pVal, RHS.pVal, getNumWords());
- }
- return clearUnusedBits();
-}
-
-/// Subtracts the integer array y from the integer array x
-/// @returns returns the borrow out.
-/// @brief Generalized subtraction of 64-bit integer arrays.
-static bool sub(uint64_t *dest, const uint64_t *x, const uint64_t *y,
- uint32_t len) {
- bool borrow = false;
- for (uint32_t i = 0; i < len; ++i) {
- uint64_t x_tmp = borrow ? x[i] - 1 : x[i];
- borrow = y[i] > x_tmp || (borrow && x[i] == 0);
- dest[i] = x_tmp - y[i];
- }
- return borrow;
-}
-
-/// Subtracts the RHS APInt from this APInt
-/// @returns this, after subtraction
-/// @brief Subtraction assignment operator.
-APInt& APInt::operator-=(const APInt& RHS) {
- assert(BitWidth == RHS.BitWidth && "Bit widths must be the same");
- if (isSingleWord())
- VAL -= RHS.VAL;
- else
- sub(pVal, pVal, RHS.pVal, getNumWords());
- return clearUnusedBits();
-}
-
-/// Multiplies an integer array, x by a a uint64_t integer and places the result
-/// into dest.
-/// @returns the carry out of the multiplication.
-/// @brief Multiply a multi-digit APInt by a single digit (64-bit) integer.
-static uint64_t mul_1(uint64_t dest[], uint64_t x[], uint32_t len, uint64_t y) {
- // Split y into high 32-bit part (hy) and low 32-bit part (ly)
- uint64_t ly = y & 0xffffffffULL, hy = y >> 32;
- uint64_t carry = 0;
-
- // For each digit of x.
- for (uint32_t i = 0; i < len; ++i) {
- // Split x into high and low words
- uint64_t lx = x[i] & 0xffffffffULL;
- uint64_t hx = x[i] >> 32;
- // hasCarry - A flag to indicate if there is a carry to the next digit.
- // hasCarry == 0, no carry
- // hasCarry == 1, has carry
- // hasCarry == 2, no carry and the calculation result == 0.
- uint8_t hasCarry = 0;
- dest[i] = carry + lx * ly;
- // Determine if the add above introduces carry.
- hasCarry = (dest[i] < carry) ? 1 : 0;
- carry = hx * ly + (dest[i] >> 32) + (hasCarry ? (1ULL << 32) : 0);
- // The upper limit of carry can be (2^32 - 1)(2^32 - 1) +
- // (2^32 - 1) + 2^32 = 2^64.
- hasCarry = (!carry && hasCarry) ? 1 : (!carry ? 2 : 0);
-
- carry += (lx * hy) & 0xffffffffULL;
- dest[i] = (carry << 32) | (dest[i] & 0xffffffffULL);
- carry = (((!carry && hasCarry != 2) || hasCarry == 1) ? (1ULL << 32) : 0) +
- (carry >> 32) + ((lx * hy) >> 32) + hx * hy;
- }
- return carry;
-}
-
-/// Multiplies integer array x by integer array y and stores the result into
-/// the integer array dest. Note that dest's size must be >= xlen + ylen.
-/// @brief Generalized multiplicate of integer arrays.
-static void mul(uint64_t dest[], uint64_t x[], uint32_t xlen, uint64_t y[],
- uint32_t ylen) {
- dest[xlen] = mul_1(dest, x, xlen, y[0]);
- for (uint32_t i = 1; i < ylen; ++i) {
- uint64_t ly = y[i] & 0xffffffffULL, hy = y[i] >> 32;
- uint64_t carry = 0, lx = 0, hx = 0;
- for (uint32_t j = 0; j < xlen; ++j) {
- lx = x[j] & 0xffffffffULL;
- hx = x[j] >> 32;
- // hasCarry - A flag to indicate if has carry.
- // hasCarry == 0, no carry
- // hasCarry == 1, has carry
- // hasCarry == 2, no carry and the calculation result == 0.
- uint8_t hasCarry = 0;
- uint64_t resul = carry + lx * ly;
- hasCarry = (resul < carry) ? 1 : 0;
- carry = (hasCarry ? (1ULL << 32) : 0) + hx * ly + (resul >> 32);
- hasCarry = (!carry && hasCarry) ? 1 : (!carry ? 2 : 0);
-
- carry += (lx * hy) & 0xffffffffULL;
- resul = (carry << 32) | (resul & 0xffffffffULL);
- dest[i+j] += resul;
- carry = (((!carry && hasCarry != 2) || hasCarry == 1) ? (1ULL << 32) : 0)+
- (carry >> 32) + (dest[i+j] < resul ? 1 : 0) +
- ((lx * hy) >> 32) + hx * hy;
- }
- dest[i+xlen] = carry;
- }
-}
-
-APInt& APInt::operator*=(const APInt& RHS) {
- assert(BitWidth == RHS.BitWidth && "Bit widths must be the same");
- if (isSingleWord()) {
- VAL *= RHS.VAL;
- clearUnusedBits();
- return *this;
- }
-
- // Get some bit facts about LHS and check for zero
- uint32_t lhsBits = getActiveBits();
- uint32_t lhsWords = !lhsBits ? 0 : whichWord(lhsBits - 1) + 1;
- if (!lhsWords)
- // 0 * X ===> 0
- return *this;
-
- // Get some bit facts about RHS and check for zero
- uint32_t rhsBits = RHS.getActiveBits();
- uint32_t rhsWords = !rhsBits ? 0 : whichWord(rhsBits - 1) + 1;
- if (!rhsWords) {
- // X * 0 ===> 0
- clear();
- return *this;
- }
-
- // Allocate space for the result
- uint32_t destWords = rhsWords + lhsWords;
- uint64_t *dest = getMemory(destWords);
-
- // Perform the long multiply
- mul(dest, pVal, lhsWords, RHS.pVal, rhsWords);
-
- // Copy result back into *this
- clear();
- uint32_t wordsToCopy = destWords >= getNumWords() ? getNumWords() : destWords;
- memcpy(pVal, dest, wordsToCopy * APINT_WORD_SIZE);
-
- // delete dest array and return
- delete[] dest;
- return *this;
-}
-
-APInt& APInt::operator&=(const APInt& RHS) {
- assert(BitWidth == RHS.BitWidth && "Bit widths must be the same");
- if (isSingleWord()) {
- VAL &= RHS.VAL;
- return *this;
- }
- uint32_t numWords = getNumWords();
- for (uint32_t i = 0; i < numWords; ++i)
- pVal[i] &= RHS.pVal[i];
- return *this;
-}
-
-APInt& APInt::operator|=(const APInt& RHS) {
- assert(BitWidth == RHS.BitWidth && "Bit widths must be the same");
- if (isSingleWord()) {
- VAL |= RHS.VAL;
- return *this;
- }
- uint32_t numWords = getNumWords();
- for (uint32_t i = 0; i < numWords; ++i)
- pVal[i] |= RHS.pVal[i];
- return *this;
-}
-
-APInt& APInt::operator^=(const APInt& RHS) {
- assert(BitWidth == RHS.BitWidth && "Bit widths must be the same");
- if (isSingleWord()) {
- VAL ^= RHS.VAL;
- this->clearUnusedBits();
- return *this;
- }
- uint32_t numWords = getNumWords();
- for (uint32_t i = 0; i < numWords; ++i)
- pVal[i] ^= RHS.pVal[i];
- return clearUnusedBits();
-}
-
-APInt APInt::operator&(const APInt& RHS) const {
- assert(BitWidth == RHS.BitWidth && "Bit widths must be the same");
- if (isSingleWord())
- return APInt(getBitWidth(), VAL & RHS.VAL);
-
- uint32_t numWords = getNumWords();
- uint64_t* val = getMemory(numWords);
- for (uint32_t i = 0; i < numWords; ++i)
- val[i] = pVal[i] & RHS.pVal[i];
- return APInt(val, getBitWidth());
-}
-
-APInt APInt::operator|(const APInt& RHS) const {
- assert(BitWidth == RHS.BitWidth && "Bit widths must be the same");
- if (isSingleWord())
- return APInt(getBitWidth(), VAL | RHS.VAL);
-
- uint32_t numWords = getNumWords();
- uint64_t *val = getMemory(numWords);
- for (uint32_t i = 0; i < numWords; ++i)
- val[i] = pVal[i] | RHS.pVal[i];
- return APInt(val, getBitWidth());
-}
-
-APInt APInt::operator^(const APInt& RHS) const {
- assert(BitWidth == RHS.BitWidth && "Bit widths must be the same");
- if (isSingleWord())
- return APInt(BitWidth, VAL ^ RHS.VAL);
-
- uint32_t numWords = getNumWords();
- uint64_t *val = getMemory(numWords);
- for (uint32_t i = 0; i < numWords; ++i)
- val[i] = pVal[i] ^ RHS.pVal[i];
-
- // 0^0==1 so clear the high bits in case they got set.
- return APInt(val, getBitWidth()).clearUnusedBits();
-}
-
-bool APInt::operator !() const {
- if (isSingleWord())
- return !VAL;
-
- for (uint32_t i = 0; i < getNumWords(); ++i)
- if (pVal[i])
- return false;
- return true;
-}
-
-APInt APInt::operator*(const APInt& RHS) const {
- assert(BitWidth == RHS.BitWidth && "Bit widths must be the same");
- if (isSingleWord())
- return APInt(BitWidth, VAL * RHS.VAL);
- APInt Result(*this);
- Result *= RHS;
- return Result.clearUnusedBits();
-}
-
-APInt APInt::operator+(const APInt& RHS) const {
- assert(BitWidth == RHS.BitWidth && "Bit widths must be the same");
- if (isSingleWord())
- return APInt(BitWidth, VAL + RHS.VAL);
- APInt Result(BitWidth, 0);
- add(Result.pVal, this->pVal, RHS.pVal, getNumWords());
- return Result.clearUnusedBits();
-}
-
-APInt APInt::operator-(const APInt& RHS) const {
- assert(BitWidth == RHS.BitWidth && "Bit widths must be the same");
- if (isSingleWord())
- return APInt(BitWidth, VAL - RHS.VAL);
- APInt Result(BitWidth, 0);
- sub(Result.pVal, this->pVal, RHS.pVal, getNumWords());
- return Result.clearUnusedBits();
-}
-
-bool APInt::operator[](uint32_t bitPosition) const {
- return (maskBit(bitPosition) &
- (isSingleWord() ? VAL : pVal[whichWord(bitPosition)])) != 0;
-}
-
-bool APInt::operator==(const APInt& RHS) const {
- assert(BitWidth == RHS.BitWidth && "Comparison requires equal bit widths");
- if (isSingleWord())
- return VAL == RHS.VAL;
-
- // Get some facts about the number of bits used in the two operands.
- uint32_t n1 = getActiveBits();
- uint32_t n2 = RHS.getActiveBits();
-
- // If the number of bits isn't the same, they aren't equal
- if (n1 != n2)
- return false;
-
- // If the number of bits fits in a word, we only need to compare the low word.
- if (n1 <= APINT_BITS_PER_WORD)
- return pVal[0] == RHS.pVal[0];
-
- // Otherwise, compare everything
- for (int i = whichWord(n1 - 1); i >= 0; --i)
- if (pVal[i] != RHS.pVal[i])
- return false;
- return true;
-}
-
-bool APInt::operator==(uint64_t Val) const {
- if (isSingleWord())
- return VAL == Val;
-
- uint32_t n = getActiveBits();
- if (n <= APINT_BITS_PER_WORD)
- return pVal[0] == Val;
- else
- return false;
-}
-
-bool APInt::ult(const APInt& RHS) const {
- assert(BitWidth == RHS.BitWidth && "Bit widths must be same for comparison");
- if (isSingleWord())
- return VAL < RHS.VAL;
-
- // Get active bit length of both operands
- uint32_t n1 = getActiveBits();
- uint32_t n2 = RHS.getActiveBits();
-
- // If magnitude of LHS is less than RHS, return true.
- if (n1 < n2)
- return true;
-
- // If magnitude of RHS is greather than LHS, return false.
- if (n2 < n1)
- return false;
-
- // If they bot fit in a word, just compare the low order word
- if (n1 <= APINT_BITS_PER_WORD && n2 <= APINT_BITS_PER_WORD)
- return pVal[0] < RHS.pVal[0];
-
- // Otherwise, compare all words
- uint32_t topWord = whichWord(std::max(n1,n2)-1);
- for (int i = topWord; i >= 0; --i) {
- if (pVal[i] > RHS.pVal[i])
- return false;
- if (pVal[i] < RHS.pVal[i])
- return true;
- }
- return false;
-}
-
-bool APInt::slt(const APInt& RHS) const {
- assert(BitWidth == RHS.BitWidth && "Bit widths must be same for comparison");
- if (isSingleWord()) {
- int64_t lhsSext = (int64_t(VAL) << (64-BitWidth)) >> (64-BitWidth);
- int64_t rhsSext = (int64_t(RHS.VAL) << (64-BitWidth)) >> (64-BitWidth);
- return lhsSext < rhsSext;
- }
-
- APInt lhs(*this);
- APInt rhs(RHS);
- bool lhsNeg = isNegative();
- bool rhsNeg = rhs.isNegative();
- if (lhsNeg) {
- // Sign bit is set so perform two's complement to make it positive
- lhs.flip();
- lhs++;
- }
- if (rhsNeg) {
- // Sign bit is set so perform two's complement to make it positive
- rhs.flip();
- rhs++;
- }
-
- // Now we have unsigned values to compare so do the comparison if necessary
- // based on the negativeness of the values.
- if (lhsNeg)
- if (rhsNeg)
- return lhs.ugt(rhs);
- else
- return true;
- else if (rhsNeg)
- return false;
- else
- return lhs.ult(rhs);
-}
-
-APInt& APInt::set(uint32_t bitPosition) {
- if (isSingleWord())
- VAL |= maskBit(bitPosition);
- else
- pVal[whichWord(bitPosition)] |= maskBit(bitPosition);
- return *this;
-}
-
-APInt& APInt::set() {
- if (isSingleWord()) {
- VAL = -1ULL;
- return clearUnusedBits();
- }
-
- // Set all the bits in all the words.
- for (uint32_t i = 0; i < getNumWords(); ++i)
- pVal[i] = -1ULL;
- // Clear the unused ones
- return clearUnusedBits();
-}
-
-/// Set the given bit to 0 whose position is given as "bitPosition".
-/// @brief Set a given bit to 0.
-APInt& APInt::clear(uint32_t bitPosition) {
- if (isSingleWord())
- VAL &= ~maskBit(bitPosition);
- else
- pVal[whichWord(bitPosition)] &= ~maskBit(bitPosition);
- return *this;
-}
-
-/// @brief Set every bit to 0.
-APInt& APInt::clear() {
- if (isSingleWord())
- VAL = 0;
- else
- memset(pVal, 0, getNumWords() * APINT_WORD_SIZE);
- return *this;
-}
-
-/// @brief Bitwise NOT operator. Performs a bitwise logical NOT operation on
-/// this APInt.
-APInt APInt::operator~() const {
- APInt Result(*this);
- Result.flip();
- return Result;
-}
-
-/// @brief Toggle every bit to its opposite value.
-APInt& APInt::flip() {
- if (isSingleWord()) {
- VAL ^= -1ULL;
- return clearUnusedBits();
- }
- for (uint32_t i = 0; i < getNumWords(); ++i)
- pVal[i] ^= -1ULL;
- return clearUnusedBits();
-}
-
-/// Toggle a given bit to its opposite value whose position is given
-/// as "bitPosition".
-/// @brief Toggles a given bit to its opposite value.
-APInt& APInt::flip(uint32_t bitPosition) {
- assert(bitPosition < BitWidth && "Out of the bit-width range!");
- if ((*this)[bitPosition]) clear(bitPosition);
- else set(bitPosition);
- return *this;
-}
-
-uint32_t APInt::getBitsNeeded(const char* str, uint32_t slen, uint8_t radix) {
- assert(str != 0 && "Invalid value string");
- assert(slen > 0 && "Invalid string length");
-
- // Each computation below needs to know if its negative
- uint32_t isNegative = str[0] == '-';
- if (isNegative) {
- slen--;
- str++;
- }
- // For radixes of power-of-two values, the bits required is accurately and
- // easily computed
- if (radix == 2)
- return slen + isNegative;
- if (radix == 8)
- return slen * 3 + isNegative;
- if (radix == 16)
- return slen * 4 + isNegative;
-
- // Otherwise it must be radix == 10, the hard case
- assert(radix == 10 && "Invalid radix");
-
- // This is grossly inefficient but accurate. We could probably do something
- // with a computation of roughly slen*64/20 and then adjust by the value of
- // the first few digits. But, I'm not sure how accurate that could be.
-
- // Compute a sufficient number of bits that is always large enough but might
- // be too large. This avoids the assertion in the constructor.
- uint32_t sufficient = slen*64/18;
-
- // Convert to the actual binary value.
- APInt tmp(sufficient, str, slen, radix);
-
- // Compute how many bits are required.
- return isNegative + tmp.logBase2() + 1;
-}
-
-uint64_t APInt::getHashValue() const {
- // Put the bit width into the low order bits.
- uint64_t hash = BitWidth;
-
- // Add the sum of the words to the hash.
- if (isSingleWord())
- hash += VAL << 6; // clear separation of up to 64 bits
- else
- for (uint32_t i = 0; i < getNumWords(); ++i)
- hash += pVal[i] << 6; // clear sepration of up to 64 bits
- return hash;
-}
-
-/// HiBits - This function returns the high "numBits" bits of this APInt.
-APInt APInt::getHiBits(uint32_t numBits) const {
- return APIntOps::lshr(*this, BitWidth - numBits);
-}
-
-/// LoBits - This function returns the low "numBits" bits of this APInt.
-APInt APInt::getLoBits(uint32_t numBits) const {
- return APIntOps::lshr(APIntOps::shl(*this, BitWidth - numBits),
- BitWidth - numBits);
-}
-
-bool APInt::isPowerOf2() const {
- return (!!*this) && !(*this & (*this - APInt(BitWidth,1)));
-}
-
-uint32_t APInt::countLeadingZeros() const {
- uint32_t Count = 0;
- if (isSingleWord())
- Count = CountLeadingZeros_64(VAL);
- else {
- for (uint32_t i = getNumWords(); i > 0u; --i) {
- if (pVal[i-1] == 0)
- Count += APINT_BITS_PER_WORD;
- else {
- Count += CountLeadingZeros_64(pVal[i-1]);
- break;
- }
- }
- }
- uint32_t remainder = BitWidth % APINT_BITS_PER_WORD;
- if (remainder)
- Count -= APINT_BITS_PER_WORD - remainder;
- return std::min(Count, BitWidth);
-}
-
-static uint32_t countLeadingOnes_64(uint64_t V, uint32_t skip) {
- uint32_t Count = 0;
- if (skip)
- V <<= skip;
- while (V && (V & (1ULL << 63))) {
- Count++;
- V <<= 1;
- }
- return Count;
-}
-
-uint32_t APInt::countLeadingOnes() const {
- if (isSingleWord())
- return countLeadingOnes_64(VAL, APINT_BITS_PER_WORD - BitWidth);
-
- uint32_t highWordBits = BitWidth % APINT_BITS_PER_WORD;
- uint32_t shift = (highWordBits == 0 ? 0 : APINT_BITS_PER_WORD - highWordBits);
- int i = getNumWords() - 1;
- uint32_t Count = countLeadingOnes_64(pVal[i], shift);
- if (Count == highWordBits) {
- for (i--; i >= 0; --i) {
- if (pVal[i] == -1ULL)
- Count += APINT_BITS_PER_WORD;
- else {
- Count += countLeadingOnes_64(pVal[i], 0);
- break;
- }
- }
- }
- return Count;
-}
-
-uint32_t APInt::countTrailingZeros() const {
- if (isSingleWord())
- return std::min(uint32_t(CountTrailingZeros_64(VAL)), BitWidth);
- uint32_t Count = 0;
- uint32_t i = 0;
- for (; i < getNumWords() && pVal[i] == 0; ++i)
- Count += APINT_BITS_PER_WORD;
- if (i < getNumWords())
- Count += CountTrailingZeros_64(pVal[i]);
- return std::min(Count, BitWidth);
-}
-
-uint32_t APInt::countTrailingOnes() const {
- if (isSingleWord())
- return std::min(uint32_t(CountTrailingOnes_64(VAL)), BitWidth);
- uint32_t Count = 0;
- uint32_t i = 0;
- for (; i < getNumWords() && pVal[i] == -1ULL; ++i)
- Count += APINT_BITS_PER_WORD;
- if (i < getNumWords())
- Count += CountTrailingOnes_64(pVal[i]);
- return std::min(Count, BitWidth);
-}
-
-uint32_t APInt::countPopulation() const {
- if (isSingleWord())
- return CountPopulation_64(VAL);
- uint32_t Count = 0;
- for (uint32_t i = 0; i < getNumWords(); ++i)
- Count += CountPopulation_64(pVal[i]);
- return Count;
-}
-
-APInt APInt::byteSwap() const {
- assert(BitWidth >= 16 && BitWidth % 16 == 0 && "Cannot byteswap!");
- if (BitWidth == 16)
- return APInt(BitWidth, ByteSwap_16(uint16_t(VAL)));
- else if (BitWidth == 32)
- return APInt(BitWidth, ByteSwap_32(uint32_t(VAL)));
- else if (BitWidth == 48) {
- uint32_t Tmp1 = uint32_t(VAL >> 16);
- Tmp1 = ByteSwap_32(Tmp1);
- uint16_t Tmp2 = uint16_t(VAL);
- Tmp2 = ByteSwap_16(Tmp2);
- return APInt(BitWidth, (uint64_t(Tmp2) << 32) | Tmp1);
- } else if (BitWidth == 64)
- return APInt(BitWidth, ByteSwap_64(VAL));
- else {
- APInt Result(BitWidth, 0);
- char *pByte = (char*)Result.pVal;
- for (uint32_t i = 0; i < BitWidth / APINT_WORD_SIZE / 2; ++i) {
- char Tmp = pByte[i];
- pByte[i] = pByte[BitWidth / APINT_WORD_SIZE - 1 - i];
- pByte[BitWidth / APINT_WORD_SIZE - i - 1] = Tmp;
- }
- return Result;
- }
-}
-
-APInt llvm::APIntOps::GreatestCommonDivisor(const APInt& API1,
- const APInt& API2) {
- APInt A = API1, B = API2;
- while (!!B) {
- APInt T = B;
- B = APIntOps::urem(A, B);
- A = T;
- }
- return A;
-}
-
-APInt llvm::APIntOps::RoundDoubleToAPInt(double Double, uint32_t width) {
- union {
- double D;
- uint64_t I;
- } T;
- T.D = Double;
-
- // Get the sign bit from the highest order bit
- bool isNeg = T.I >> 63;
-
- // Get the 11-bit exponent and adjust for the 1023 bit bias
- int64_t exp = ((T.I >> 52) & 0x7ff) - 1023;
-
- // If the exponent is negative, the value is < 0 so just return 0.
- if (exp < 0)
- return APInt(width, 0u);
-
- // Extract the mantissa by clearing the top 12 bits (sign + exponent).
- uint64_t mantissa = (T.I & (~0ULL >> 12)) | 1ULL << 52;
-
- // If the exponent doesn't shift all bits out of the mantissa
- if (exp < 52)
- return isNeg ? -APInt(width, mantissa >> (52 - exp)) :
- APInt(width, mantissa >> (52 - exp));
-
- // If the client didn't provide enough bits for us to shift the mantissa into
- // then the result is undefined, just return 0
- if (width <= exp - 52)
- return APInt(width, 0);
-
- // Otherwise, we have to shift the mantissa bits up to the right location
- APInt Tmp(width, mantissa);
- Tmp = Tmp.shl((uint32_t)exp - 52);
- return isNeg ? -Tmp : Tmp;
-}
-
-/// RoundToDouble - This function convert this APInt to a double.
-/// The layout for double is as following (IEEE Standard 754):
-/// --------------------------------------
-/// | Sign Exponent Fraction Bias |
-/// |-------------------------------------- |
-/// | 1[63] 11[62-52] 52[51-00] 1023 |
-/// --------------------------------------
-double APInt::roundToDouble(bool isSigned) const {
-
- // Handle the simple case where the value is contained in one uint64_t.
- if (isSingleWord() || getActiveBits() <= APINT_BITS_PER_WORD) {
- if (isSigned) {
- int64_t sext = (int64_t(VAL) << (64-BitWidth)) >> (64-BitWidth);
- return double(sext);
- } else
- return double(VAL);
- }
-
- // Determine if the value is negative.
- bool isNeg = isSigned ? (*this)[BitWidth-1] : false;
-
- // Construct the absolute value if we're negative.
- APInt Tmp(isNeg ? -(*this) : (*this));
-
- // Figure out how many bits we're using.
- uint32_t n = Tmp.getActiveBits();
-
- // The exponent (without bias normalization) is just the number of bits
- // we are using. Note that the sign bit is gone since we constructed the
- // absolute value.
- uint64_t exp = n;
-
- // Return infinity for exponent overflow
- if (exp > 1023) {
- if (!isSigned || !isNeg)
- return std::numeric_limits<double>::infinity();
- else
- return -std::numeric_limits<double>::infinity();
- }
- exp += 1023; // Increment for 1023 bias
-
- // Number of bits in mantissa is 52. To obtain the mantissa value, we must
- // extract the high 52 bits from the correct words in pVal.
- uint64_t mantissa;
- unsigned hiWord = whichWord(n-1);
- if (hiWord == 0) {
- mantissa = Tmp.pVal[0];
- if (n > 52)
- mantissa >>= n - 52; // shift down, we want the top 52 bits.
- } else {
- assert(hiWord > 0 && "huh?");
- uint64_t hibits = Tmp.pVal[hiWord] << (52 - n % APINT_BITS_PER_WORD);
- uint64_t lobits = Tmp.pVal[hiWord-1] >> (11 + n % APINT_BITS_PER_WORD);
- mantissa = hibits | lobits;
- }
-
- // The leading bit of mantissa is implicit, so get rid of it.
- uint64_t sign = isNeg ? (1ULL << (APINT_BITS_PER_WORD - 1)) : 0;
- union {
- double D;
- uint64_t I;
- } T;
- T.I = sign | (exp << 52) | mantissa;
- return T.D;
-}
-
-// Truncate to new width.
-APInt &APInt::trunc(uint32_t width) {
- assert(width < BitWidth && "Invalid APInt Truncate request");
- assert(width >= MIN_INT_BITS && "Can't truncate to 0 bits");
- uint32_t wordsBefore = getNumWords();
- BitWidth = width;
- uint32_t wordsAfter = getNumWords();
- if (wordsBefore != wordsAfter) {
- if (wordsAfter == 1) {
- uint64_t *tmp = pVal;
- VAL = pVal[0];
- delete [] tmp;
- } else {
- uint64_t *newVal = getClearedMemory(wordsAfter);
- for (uint32_t i = 0; i < wordsAfter; ++i)
- newVal[i] = pVal[i];
- delete [] pVal;
- pVal = newVal;
- }
- }
- return clearUnusedBits();
-}
-
-// Sign extend to a new width.
-APInt &APInt::sext(uint32_t width) {
- assert(width > BitWidth && "Invalid APInt SignExtend request");
- assert(width <= MAX_INT_BITS && "Too many bits");
- // If the sign bit isn't set, this is the same as zext.
- if (!isNegative()) {
- zext(width);
- return *this;
- }
-
- // The sign bit is set. First, get some facts
- uint32_t wordsBefore = getNumWords();
- uint32_t wordBits = BitWidth % APINT_BITS_PER_WORD;
- BitWidth = width;
- uint32_t wordsAfter = getNumWords();
-
- // Mask the high order word appropriately
- if (wordsBefore == wordsAfter) {
- uint32_t newWordBits = width % APINT_BITS_PER_WORD;
- // The extension is contained to the wordsBefore-1th word.
- uint64_t mask = ~0ULL;
- if (newWordBits)
- mask >>= APINT_BITS_PER_WORD - newWordBits;
- mask <<= wordBits;
- if (wordsBefore == 1)
- VAL |= mask;
- else
- pVal[wordsBefore-1] |= mask;
- return clearUnusedBits();
- }
-
- uint64_t mask = wordBits == 0 ? 0 : ~0ULL << wordBits;
- uint64_t *newVal = getMemory(wordsAfter);
- if (wordsBefore == 1)
- newVal[0] = VAL | mask;
- else {
- for (uint32_t i = 0; i < wordsBefore; ++i)
- newVal[i] = pVal[i];
- newVal[wordsBefore-1] |= mask;
- }
- for (uint32_t i = wordsBefore; i < wordsAfter; i++)
- newVal[i] = -1ULL;
- if (wordsBefore != 1)
- delete [] pVal;
- pVal = newVal;
- return clearUnusedBits();
-}
-
-// Zero extend to a new width.
-APInt &APInt::zext(uint32_t width) {
- assert(width > BitWidth && "Invalid APInt ZeroExtend request");
- assert(width <= MAX_INT_BITS && "Too many bits");
- uint32_t wordsBefore = getNumWords();
- BitWidth = width;
- uint32_t wordsAfter = getNumWords();
- if (wordsBefore != wordsAfter) {
- uint64_t *newVal = getClearedMemory(wordsAfter);
- if (wordsBefore == 1)
- newVal[0] = VAL;
- else
- for (uint32_t i = 0; i < wordsBefore; ++i)
- newVal[i] = pVal[i];
- if (wordsBefore != 1)
- delete [] pVal;
- pVal = newVal;
- }
- return *this;
-}
-
-APInt &APInt::zextOrTrunc(uint32_t width) {
- if (BitWidth < width)
- return zext(width);
- if (BitWidth > width)
- return trunc(width);
- return *this;
-}
-
-APInt &APInt::sextOrTrunc(uint32_t width) {
- if (BitWidth < width)
- return sext(width);
- if (BitWidth > width)
- return trunc(width);
- return *this;
-}
-
-/// Arithmetic right-shift this APInt by shiftAmt.
-/// @brief Arithmetic right-shift function.
-APInt APInt::ashr(const APInt &shiftAmt) const {
- return ashr((uint32_t)shiftAmt.getLimitedValue(BitWidth));
-}
-
-/// Arithmetic right-shift this APInt by shiftAmt.
-/// @brief Arithmetic right-shift function.
-APInt APInt::ashr(uint32_t shiftAmt) const {
- assert(shiftAmt <= BitWidth && "Invalid shift amount");
- // Handle a degenerate case
- if (shiftAmt == 0)
- return *this;
-
- // Handle single word shifts with built-in ashr
- if (isSingleWord()) {
- if (shiftAmt == BitWidth)
- return APInt(BitWidth, 0); // undefined
- else {
- uint32_t SignBit = APINT_BITS_PER_WORD - BitWidth;
- return APInt(BitWidth,
- (((int64_t(VAL) << SignBit) >> SignBit) >> shiftAmt));
- }
- }
-
- // If all the bits were shifted out, the result is, technically, undefined.
- // We return -1 if it was negative, 0 otherwise. We check this early to avoid
- // issues in the algorithm below.
- if (shiftAmt == BitWidth) {
- if (isNegative())
- return APInt(BitWidth, -1ULL);
- else
- return APInt(BitWidth, 0);
- }
-
- // Create some space for the result.
- uint64_t * val = new uint64_t[getNumWords()];
-
- // Compute some values needed by the following shift algorithms
- uint32_t wordShift = shiftAmt % APINT_BITS_PER_WORD; // bits to shift per word
- uint32_t offset = shiftAmt / APINT_BITS_PER_WORD; // word offset for shift
- uint32_t breakWord = getNumWords() - 1 - offset; // last word affected
- uint32_t bitsInWord = whichBit(BitWidth); // how many bits in last word?
- if (bitsInWord == 0)
- bitsInWord = APINT_BITS_PER_WORD;
-
- // If we are shifting whole words, just move whole words
- if (wordShift == 0) {
- // Move the words containing significant bits
- for (uint32_t i = 0; i <= breakWord; ++i)
- val[i] = pVal[i+offset]; // move whole word
-
- // Adjust the top significant word for sign bit fill, if negative
- if (isNegative())
- if (bitsInWord < APINT_BITS_PER_WORD)
- val[breakWord] |= ~0ULL << bitsInWord; // set high bits
- } else {
- // Shift the low order words
- for (uint32_t i = 0; i < breakWord; ++i) {
- // This combines the shifted corresponding word with the low bits from
- // the next word (shifted into this word's high bits).
- val[i] = (pVal[i+offset] >> wordShift) |
- (pVal[i+offset+1] << (APINT_BITS_PER_WORD - wordShift));
- }
-
- // Shift the break word. In this case there are no bits from the next word
- // to include in this word.
- val[breakWord] = pVal[breakWord+offset] >> wordShift;
-
- // Deal with sign extenstion in the break word, and possibly the word before
- // it.
- if (isNegative()) {
- if (wordShift > bitsInWord) {
- if (breakWord > 0)
- val[breakWord-1] |=
- ~0ULL << (APINT_BITS_PER_WORD - (wordShift - bitsInWord));
- val[breakWord] |= ~0ULL;
- } else
- val[breakWord] |= (~0ULL << (bitsInWord - wordShift));
- }
- }
-
- // Remaining words are 0 or -1, just assign them.
- uint64_t fillValue = (isNegative() ? -1ULL : 0);
- for (uint32_t i = breakWord+1; i < getNumWords(); ++i)
- val[i] = fillValue;
- return APInt(val, BitWidth).clearUnusedBits();
-}
-
-/// Logical right-shift this APInt by shiftAmt.
-/// @brief Logical right-shift function.
-APInt APInt::lshr(const APInt &shiftAmt) const {
- return lshr((uint32_t)shiftAmt.getLimitedValue(BitWidth));
-}
-
-/// Logical right-shift this APInt by shiftAmt.
-/// @brief Logical right-shift function.
-APInt APInt::lshr(uint32_t shiftAmt) const {
- if (isSingleWord()) {
- if (shiftAmt == BitWidth)
- return APInt(BitWidth, 0);
- else
- return APInt(BitWidth, this->VAL >> shiftAmt);
- }
-
- // If all the bits were shifted out, the result is 0. This avoids issues
- // with shifting by the size of the integer type, which produces undefined
- // results. We define these "undefined results" to always be 0.
- if (shiftAmt == BitWidth)
- return APInt(BitWidth, 0);
-
- // If none of the bits are shifted out, the result is *this. This avoids
- // issues with shifting byt he size of the integer type, which produces
- // undefined results in the code below. This is also an optimization.
- if (shiftAmt == 0)
- return *this;
-
- // Create some space for the result.
- uint64_t * val = new uint64_t[getNumWords()];
-
- // If we are shifting less than a word, compute the shift with a simple carry
- if (shiftAmt < APINT_BITS_PER_WORD) {
- uint64_t carry = 0;
- for (int i = getNumWords()-1; i >= 0; --i) {
- val[i] = (pVal[i] >> shiftAmt) | carry;
- carry = pVal[i] << (APINT_BITS_PER_WORD - shiftAmt);
- }
- return APInt(val, BitWidth).clearUnusedBits();
- }
-
- // Compute some values needed by the remaining shift algorithms
- uint32_t wordShift = shiftAmt % APINT_BITS_PER_WORD;
- uint32_t offset = shiftAmt / APINT_BITS_PER_WORD;
-
- // If we are shifting whole words, just move whole words
- if (wordShift == 0) {
- for (uint32_t i = 0; i < getNumWords() - offset; ++i)
- val[i] = pVal[i+offset];
- for (uint32_t i = getNumWords()-offset; i < getNumWords(); i++)
- val[i] = 0;
- return APInt(val,BitWidth).clearUnusedBits();
- }
-
- // Shift the low order words
- uint32_t breakWord = getNumWords() - offset -1;
- for (uint32_t i = 0; i < breakWord; ++i)
- val[i] = (pVal[i+offset] >> wordShift) |
- (pVal[i+offset+1] << (APINT_BITS_PER_WORD - wordShift));
- // Shift the break word.
- val[breakWord] = pVal[breakWord+offset] >> wordShift;
-
- // Remaining words are 0
- for (uint32_t i = breakWord+1; i < getNumWords(); ++i)
- val[i] = 0;
- return APInt(val, BitWidth).clearUnusedBits();
-}
-
-/// Left-shift this APInt by shiftAmt.
-/// @brief Left-shift function.
-APInt APInt::shl(const APInt &shiftAmt) const {
- // It's undefined behavior in C to shift by BitWidth or greater, but
- return shl((uint32_t)shiftAmt.getLimitedValue(BitWidth));
-}
-
-/// Left-shift this APInt by shiftAmt.
-/// @brief Left-shift function.
-APInt APInt::shl(uint32_t shiftAmt) const {
- assert(shiftAmt <= BitWidth && "Invalid shift amount");
- if (isSingleWord()) {
- if (shiftAmt == BitWidth)
- return APInt(BitWidth, 0); // avoid undefined shift results
- return APInt(BitWidth, VAL << shiftAmt);
- }
-
- // If all the bits were shifted out, the result is 0. This avoids issues
- // with shifting by the size of the integer type, which produces undefined
- // results. We define these "undefined results" to always be 0.
- if (shiftAmt == BitWidth)
- return APInt(BitWidth, 0);
-
- // If none of the bits are shifted out, the result is *this. This avoids a
- // lshr by the words size in the loop below which can produce incorrect
- // results. It also avoids the expensive computation below for a common case.
- if (shiftAmt == 0)
- return *this;
-
- // Create some space for the result.
- uint64_t * val = new uint64_t[getNumWords()];
-
- // If we are shifting less than a word, do it the easy way
- if (shiftAmt < APINT_BITS_PER_WORD) {
- uint64_t carry = 0;
- for (uint32_t i = 0; i < getNumWords(); i++) {
- val[i] = pVal[i] << shiftAmt | carry;
- carry = pVal[i] >> (APINT_BITS_PER_WORD - shiftAmt);
- }
- return APInt(val, BitWidth).clearUnusedBits();
- }
-
- // Compute some values needed by the remaining shift algorithms
- uint32_t wordShift = shiftAmt % APINT_BITS_PER_WORD;
- uint32_t offset = shiftAmt / APINT_BITS_PER_WORD;
-
- // If we are shifting whole words, just move whole words
- if (wordShift == 0) {
- for (uint32_t i = 0; i < offset; i++)
- val[i] = 0;
- for (uint32_t i = offset; i < getNumWords(); i++)
- val[i] = pVal[i-offset];
- return APInt(val,BitWidth).clearUnusedBits();
- }
-
- // Copy whole words from this to Result.
- uint32_t i = getNumWords() - 1;
- for (; i > offset; --i)
- val[i] = pVal[i-offset] << wordShift |
- pVal[i-offset-1] >> (APINT_BITS_PER_WORD - wordShift);
- val[offset] = pVal[0] << wordShift;
- for (i = 0; i < offset; ++i)
- val[i] = 0;
- return APInt(val, BitWidth).clearUnusedBits();
-}
-
-APInt APInt::rotl(const APInt &rotateAmt) const {
- return rotl((uint32_t)rotateAmt.getLimitedValue(BitWidth));
-}
-
-APInt APInt::rotl(uint32_t rotateAmt) const {
- if (rotateAmt == 0)
- return *this;
- // Don't get too fancy, just use existing shift/or facilities
- APInt hi(*this);
- APInt lo(*this);
- hi.shl(rotateAmt);
- lo.lshr(BitWidth - rotateAmt);
- return hi | lo;
-}
-
-APInt APInt::rotr(const APInt &rotateAmt) const {
- return rotr((uint32_t)rotateAmt.getLimitedValue(BitWidth));
-}
-
-APInt APInt::rotr(uint32_t rotateAmt) const {
- if (rotateAmt == 0)
- return *this;
- // Don't get too fancy, just use existing shift/or facilities
- APInt hi(*this);
- APInt lo(*this);
- lo.lshr(rotateAmt);
- hi.shl(BitWidth - rotateAmt);
- return hi | lo;
-}
-
-// Square Root - this method computes and returns the square root of "this".
-// Three mechanisms are used for computation. For small values (<= 5 bits),
-// a table lookup is done. This gets some performance for common cases. For
-// values using less than 52 bits, the value is converted to double and then
-// the libc sqrt function is called. The result is rounded and then converted
-// back to a uint64_t which is then used to construct the result. Finally,
-// the Babylonian method for computing square roots is used.
-APInt APInt::sqrt() const {
-
- // Determine the magnitude of the value.
- uint32_t magnitude = getActiveBits();
-
- // Use a fast table for some small values. This also gets rid of some
- // rounding errors in libc sqrt for small values.
- if (magnitude <= 5) {
- static const uint8_t results[32] = {
- /* 0 */ 0,
- /* 1- 2 */ 1, 1,
- /* 3- 6 */ 2, 2, 2, 2,
- /* 7-12 */ 3, 3, 3, 3, 3, 3,
- /* 13-20 */ 4, 4, 4, 4, 4, 4, 4, 4,
- /* 21-30 */ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- /* 31 */ 6
- };
- return APInt(BitWidth, results[ (isSingleWord() ? VAL : pVal[0]) ]);
- }
-
- // If the magnitude of the value fits in less than 52 bits (the precision of
- // an IEEE double precision floating point value), then we can use the
- // libc sqrt function which will probably use a hardware sqrt computation.
- // This should be faster than the algorithm below.
- if (magnitude < 52) {
-#ifdef _MSC_VER
- // Amazingly, VC++ doesn't have round().
- return APInt(BitWidth,
- uint64_t(::sqrt(double(isSingleWord()?VAL:pVal[0]))) + 0.5);
-#else
- return APInt(BitWidth,
- uint64_t(::round(::sqrt(double(isSingleWord()?VAL:pVal[0])))));
-#endif
- }
-
- // Okay, all the short cuts are exhausted. We must compute it. The following
- // is a classical Babylonian method for computing the square root. This code
- // was adapted to APINt from a wikipedia article on such computations.
- // See http://www.wikipedia.org/ and go to the page named
- // Calculate_an_integer_square_root.
- uint32_t nbits = BitWidth, i = 4;
- APInt testy(BitWidth, 16);
- APInt x_old(BitWidth, 1);
- APInt x_new(BitWidth, 0);
- APInt two(BitWidth, 2);
-
- // Select a good starting value using binary logarithms.
- for (;; i += 2, testy = testy.shl(2))
- if (i >= nbits || this->ule(testy)) {
- x_old = x_old.shl(i / 2);
- break;
- }
-
- // Use the Babylonian method to arrive at the integer square root:
- for (;;) {
- x_new = (this->udiv(x_old) + x_old).udiv(two);
- if (x_old.ule(x_new))
- break;
- x_old = x_new;
- }
-
- // Make sure we return the closest approximation
- // NOTE: The rounding calculation below is correct. It will produce an
- // off-by-one discrepancy with results from pari/gp. That discrepancy has been
- // determined to be a rounding issue with pari/gp as it begins to use a
- // floating point representation after 192 bits. There are no discrepancies
- // between this algorithm and pari/gp for bit widths < 192 bits.
- APInt square(x_old * x_old);
- APInt nextSquare((x_old + 1) * (x_old +1));
- if (this->ult(square))
- return x_old;
- else if (this->ule(nextSquare)) {
- APInt midpoint((nextSquare - square).udiv(two));
- APInt offset(*this - square);
- if (offset.ult(midpoint))
- return x_old;
- else
- return x_old + 1;
- } else
- assert(0 && "Error in APInt::sqrt computation");
- return x_old + 1;
-}
-
-/// Implementation of Knuth's Algorithm D (Division of nonnegative integers)
-/// from "Art of Computer Programming, Volume 2", section 4.3.1, p. 272. The
-/// variables here have the same names as in the algorithm. Comments explain
-/// the algorithm and any deviation from it.
-static void KnuthDiv(uint32_t *u, uint32_t *v, uint32_t *q, uint32_t* r,
- uint32_t m, uint32_t n) {
- assert(u && "Must provide dividend");
- assert(v && "Must provide divisor");
- assert(q && "Must provide quotient");
- assert(u != v && u != q && v != q && "Must us different memory");
- assert(n>1 && "n must be > 1");
-
- // Knuth uses the value b as the base of the number system. In our case b
- // is 2^31 so we just set it to -1u.
- uint64_t b = uint64_t(1) << 32;
-
- DEBUG(cerr << "KnuthDiv: m=" << m << " n=" << n << '\n');
- DEBUG(cerr << "KnuthDiv: original:");
- DEBUG(for (int i = m+n; i >=0; i--) cerr << " " << std::setbase(16) << u[i]);
- DEBUG(cerr << " by");
- DEBUG(for (int i = n; i >0; i--) cerr << " " << std::setbase(16) << v[i-1]);
- DEBUG(cerr << '\n');
- // D1. [Normalize.] Set d = b / (v[n-1] + 1) and multiply all the digits of
- // u and v by d. Note that we have taken Knuth's advice here to use a power
- // of 2 value for d such that d * v[n-1] >= b/2 (b is the base). A power of
- // 2 allows us to shift instead of multiply and it is easy to determine the
- // shift amount from the leading zeros. We are basically normalizing the u
- // and v so that its high bits are shifted to the top of v's range without
- // overflow. Note that this can require an extra word in u so that u must
- // be of length m+n+1.
- uint32_t shift = CountLeadingZeros_32(v[n-1]);
- uint32_t v_carry = 0;
- uint32_t u_carry = 0;
- if (shift) {
- for (uint32_t i = 0; i < m+n; ++i) {
- uint32_t u_tmp = u[i] >> (32 - shift);
- u[i] = (u[i] << shift) | u_carry;
- u_carry = u_tmp;
- }
- for (uint32_t i = 0; i < n; ++i) {
- uint32_t v_tmp = v[i] >> (32 - shift);
- v[i] = (v[i] << shift) | v_carry;
- v_carry = v_tmp;
- }
- }
- u[m+n] = u_carry;
- DEBUG(cerr << "KnuthDiv: normal:");
- DEBUG(for (int i = m+n; i >=0; i--) cerr << " " << std::setbase(16) << u[i]);
- DEBUG(cerr << " by");
- DEBUG(for (int i = n; i >0; i--) cerr << " " << std::setbase(16) << v[i-1]);
- DEBUG(cerr << '\n');
-
- // D2. [Initialize j.] Set j to m. This is the loop counter over the places.
- int j = m;
- do {
- DEBUG(cerr << "KnuthDiv: quotient digit #" << j << '\n');
- // D3. [Calculate q'.].
- // Set qp = (u[j+n]*b + u[j+n-1]) / v[n-1]. (qp=qprime=q')
- // Set rp = (u[j+n]*b + u[j+n-1]) % v[n-1]. (rp=rprime=r')
- // Now test if qp == b or qp*v[n-2] > b*rp + u[j+n-2]; if so, decrease
- // qp by 1, inrease rp by v[n-1], and repeat this test if rp < b. The test
- // on v[n-2] determines at high speed most of the cases in which the trial
- // value qp is one too large, and it eliminates all cases where qp is two
- // too large.
- uint64_t dividend = ((uint64_t(u[j+n]) << 32) + u[j+n-1]);
- DEBUG(cerr << "KnuthDiv: dividend == " << dividend << '\n');
- uint64_t qp = dividend / v[n-1];
- uint64_t rp = dividend % v[n-1];
- if (qp == b || qp*v[n-2] > b*rp + u[j+n-2]) {
- qp--;
- rp += v[n-1];
- if (rp < b && (qp == b || qp*v[n-2] > b*rp + u[j+n-2]))
- qp--;
- }
- DEBUG(cerr << "KnuthDiv: qp == " << qp << ", rp == " << rp << '\n');
-
- // D4. [Multiply and subtract.] Replace (u[j+n]u[j+n-1]...u[j]) with
- // (u[j+n]u[j+n-1]..u[j]) - qp * (v[n-1]...v[1]v[0]). This computation
- // consists of a simple multiplication by a one-place number, combined with
- // a subtraction.
- bool isNeg = false;
- for (uint32_t i = 0; i < n; ++i) {
- uint64_t u_tmp = uint64_t(u[j+i]) | (uint64_t(u[j+i+1]) << 32);
- uint64_t subtrahend = uint64_t(qp) * uint64_t(v[i]);
- bool borrow = subtrahend > u_tmp;
- DEBUG(cerr << "KnuthDiv: u_tmp == " << u_tmp
- << ", subtrahend == " << subtrahend
- << ", borrow = " << borrow << '\n');
-
- uint64_t result = u_tmp - subtrahend;
- uint32_t k = j + i;
- u[k++] = (uint32_t)(result & (b-1)); // subtract low word
- u[k++] = (uint32_t)(result >> 32); // subtract high word
- while (borrow && k <= m+n) { // deal with borrow to the left
- borrow = u[k] == 0;
- u[k]--;
- k++;
- }
- isNeg |= borrow;
- DEBUG(cerr << "KnuthDiv: u[j+i] == " << u[j+i] << ", u[j+i+1] == " <<
- u[j+i+1] << '\n');
- }
- DEBUG(cerr << "KnuthDiv: after subtraction:");
- DEBUG(for (int i = m+n; i >=0; i--) cerr << " " << u[i]);
- DEBUG(cerr << '\n');
- // The digits (u[j+n]...u[j]) should be kept positive; if the result of
- // this step is actually negative, (u[j+n]...u[j]) should be left as the
- // true value plus b**(n+1), namely as the b's complement of
- // the true value, and a "borrow" to the left should be remembered.
- //
- if (isNeg) {
- bool carry = true; // true because b's complement is "complement + 1"
- for (uint32_t i = 0; i <= m+n; ++i) {
- u[i] = ~u[i] + carry; // b's complement
- carry = carry && u[i] == 0;
- }
- }
- DEBUG(cerr << "KnuthDiv: after complement:");
- DEBUG(for (int i = m+n; i >=0; i--) cerr << " " << u[i]);
- DEBUG(cerr << '\n');
-
- // D5. [Test remainder.] Set q[j] = qp. If the result of step D4 was
- // negative, go to step D6; otherwise go on to step D7.
- q[j] = (uint32_t)qp;
- if (isNeg) {
- // D6. [Add back]. The probability that this step is necessary is very
- // small, on the order of only 2/b. Make sure that test data accounts for
- // this possibility. Decrease q[j] by 1
- q[j]--;
- // and add (0v[n-1]...v[1]v[0]) to (u[j+n]u[j+n-1]...u[j+1]u[j]).
- // A carry will occur to the left of u[j+n], and it should be ignored
- // since it cancels with the borrow that occurred in D4.
- bool carry = false;
- for (uint32_t i = 0; i < n; i++) {
- uint32_t limit = std::min(u[j+i],v[i]);
- u[j+i] += v[i] + carry;
- carry = u[j+i] < limit || (carry && u[j+i] == limit);
- }
- u[j+n] += carry;
- }
- DEBUG(cerr << "KnuthDiv: after correction:");
- DEBUG(for (int i = m+n; i >=0; i--) cerr <<" " << u[i]);
- DEBUG(cerr << "\nKnuthDiv: digit result = " << q[j] << '\n');
-
- // D7. [Loop on j.] Decrease j by one. Now if j >= 0, go back to D3.
- } while (--j >= 0);
-
- DEBUG(cerr << "KnuthDiv: quotient:");
- DEBUG(for (int i = m; i >=0; i--) cerr <<" " << q[i]);
- DEBUG(cerr << '\n');
-
- // D8. [Unnormalize]. Now q[...] is the desired quotient, and the desired
- // remainder may be obtained by dividing u[...] by d. If r is non-null we
- // compute the remainder (urem uses this).
- if (r) {
- // The value d is expressed by the "shift" value above since we avoided
- // multiplication by d by using a shift left. So, all we have to do is
- // shift right here. In order to mak
- if (shift) {
- uint32_t carry = 0;
- DEBUG(cerr << "KnuthDiv: remainder:");
- for (int i = n-1; i >= 0; i--) {
- r[i] = (u[i] >> shift) | carry;
- carry = u[i] << (32 - shift);
- DEBUG(cerr << " " << r[i]);
- }
- } else {
- for (int i = n-1; i >= 0; i--) {
- r[i] = u[i];
- DEBUG(cerr << " " << r[i]);
- }
- }
- DEBUG(cerr << '\n');
- }
- DEBUG(cerr << std::setbase(10) << '\n');
-}
-
-void APInt::divide(const APInt LHS, uint32_t lhsWords,
- const APInt &RHS, uint32_t rhsWords,
- APInt *Quotient, APInt *Remainder)
-{
- assert(lhsWords >= rhsWords && "Fractional result");
-
- // First, compose the values into an array of 32-bit words instead of
- // 64-bit words. This is a necessity of both the "short division" algorithm
- // and the the Knuth "classical algorithm" which requires there to be native
- // operations for +, -, and * on an m bit value with an m*2 bit result. We
- // can't use 64-bit operands here because we don't have native results of
- // 128-bits. Furthremore, casting the 64-bit values to 32-bit values won't
- // work on large-endian machines.
- uint64_t mask = ~0ull >> (sizeof(uint32_t)*8);
- uint32_t n = rhsWords * 2;
- uint32_t m = (lhsWords * 2) - n;
-
- // Allocate space for the temporary values we need either on the stack, if
- // it will fit, or on the heap if it won't.
- uint32_t SPACE[128];
- uint32_t *U = 0;
- uint32_t *V = 0;
- uint32_t *Q = 0;
- uint32_t *R = 0;
- if ((Remainder?4:3)*n+2*m+1 <= 128) {
- U = &SPACE[0];
- V = &SPACE[m+n+1];
- Q = &SPACE[(m+n+1) + n];
- if (Remainder)
- R = &SPACE[(m+n+1) + n + (m+n)];
- } else {
- U = new uint32_t[m + n + 1];
- V = new uint32_t[n];
- Q = new uint32_t[m+n];
- if (Remainder)
- R = new uint32_t[n];
- }
-
- // Initialize the dividend
- memset(U, 0, (m+n+1)*sizeof(uint32_t));
- for (unsigned i = 0; i < lhsWords; ++i) {
- uint64_t tmp = (LHS.getNumWords() == 1 ? LHS.VAL : LHS.pVal[i]);
- U[i * 2] = (uint32_t)(tmp & mask);
- U[i * 2 + 1] = (uint32_t)(tmp >> (sizeof(uint32_t)*8));
- }
- U[m+n] = 0; // this extra word is for "spill" in the Knuth algorithm.
-
- // Initialize the divisor
- memset(V, 0, (n)*sizeof(uint32_t));
- for (unsigned i = 0; i < rhsWords; ++i) {
- uint64_t tmp = (RHS.getNumWords() == 1 ? RHS.VAL : RHS.pVal[i]);
- V[i * 2] = (uint32_t)(tmp & mask);
- V[i * 2 + 1] = (uint32_t)(tmp >> (sizeof(uint32_t)*8));
- }
-
- // initialize the quotient and remainder
- memset(Q, 0, (m+n) * sizeof(uint32_t));
- if (Remainder)
- memset(R, 0, n * sizeof(uint32_t));
-
- // Now, adjust m and n for the Knuth division. n is the number of words in
- // the divisor. m is the number of words by which the dividend exceeds the
- // divisor (i.e. m+n is the length of the dividend). These sizes must not
- // contain any zero words or the Knuth algorithm fails.
- for (unsigned i = n; i > 0 && V[i-1] == 0; i--) {
- n--;
- m++;
- }
- for (unsigned i = m+n; i > 0 && U[i-1] == 0; i--)
- m--;
-
- // If we're left with only a single word for the divisor, Knuth doesn't work
- // so we implement the short division algorithm here. This is much simpler
- // and faster because we are certain that we can divide a 64-bit quantity
- // by a 32-bit quantity at hardware speed and short division is simply a
- // series of such operations. This is just like doing short division but we
- // are using base 2^32 instead of base 10.
- assert(n != 0 && "Divide by zero?");
- if (n == 1) {
- uint32_t divisor = V[0];
- uint32_t remainder = 0;
- for (int i = m+n-1; i >= 0; i--) {
- uint64_t partial_dividend = uint64_t(remainder) << 32 | U[i];
- if (partial_dividend == 0) {
- Q[i] = 0;
- remainder = 0;
- } else if (partial_dividend < divisor) {
- Q[i] = 0;
- remainder = (uint32_t)partial_dividend;
- } else if (partial_dividend == divisor) {
- Q[i] = 1;
- remainder = 0;
- } else {
- Q[i] = (uint32_t)(partial_dividend / divisor);
- remainder = (uint32_t)(partial_dividend - (Q[i] * divisor));
- }
- }
- if (R)
- R[0] = remainder;
- } else {
- // Now we're ready to invoke the Knuth classical divide algorithm. In this
- // case n > 1.
- KnuthDiv(U, V, Q, R, m, n);
- }
-
- // If the caller wants the quotient
- if (Quotient) {
- // Set up the Quotient value's memory.
- if (Quotient->BitWidth != LHS.BitWidth) {
- if (Quotient->isSingleWord())
- Quotient->VAL = 0;
- else
- delete [] Quotient->pVal;
- Quotient->BitWidth = LHS.BitWidth;
- if (!Quotient->isSingleWord())
- Quotient->pVal = getClearedMemory(Quotient->getNumWords());
- } else
- Quotient->clear();
-
- // The quotient is in Q. Reconstitute the quotient into Quotient's low
- // order words.
- if (lhsWords == 1) {
- uint64_t tmp =
- uint64_t(Q[0]) | (uint64_t(Q[1]) << (APINT_BITS_PER_WORD / 2));
- if (Quotient->isSingleWord())
- Quotient->VAL = tmp;
- else
- Quotient->pVal[0] = tmp;
- } else {
- assert(!Quotient->isSingleWord() && "Quotient APInt not large enough");
- for (unsigned i = 0; i < lhsWords; ++i)
- Quotient->pVal[i] =
- uint64_t(Q[i*2]) | (uint64_t(Q[i*2+1]) << (APINT_BITS_PER_WORD / 2));
- }
- }
-
- // If the caller wants the remainder
- if (Remainder) {
- // Set up the Remainder value's memory.
- if (Remainder->BitWidth != RHS.BitWidth) {
- if (Remainder->isSingleWord())
- Remainder->VAL = 0;
- else
- delete [] Remainder->pVal;
- Remainder->BitWidth = RHS.BitWidth;
- if (!Remainder->isSingleWord())
- Remainder->pVal = getClearedMemory(Remainder->getNumWords());
- } else
- Remainder->clear();
-
- // The remainder is in R. Reconstitute the remainder into Remainder's low
- // order words.
- if (rhsWords == 1) {
- uint64_t tmp =
- uint64_t(R[0]) | (uint64_t(R[1]) << (APINT_BITS_PER_WORD / 2));
- if (Remainder->isSingleWord())
- Remainder->VAL = tmp;
- else
- Remainder->pVal[0] = tmp;
- } else {
- assert(!Remainder->isSingleWord() && "Remainder APInt not large enough");
- for (unsigned i = 0; i < rhsWords; ++i)
- Remainder->pVal[i] =
- uint64_t(R[i*2]) | (uint64_t(R[i*2+1]) << (APINT_BITS_PER_WORD / 2));
- }
- }
-
- // Clean up the memory we allocated.
- if (U != &SPACE[0]) {
- delete [] U;
- delete [] V;
- delete [] Q;
- delete [] R;
- }
-}
-
-APInt APInt::udiv(const APInt& RHS) const {
- assert(BitWidth == RHS.BitWidth && "Bit widths must be the same");
-
- // First, deal with the easy case
- if (isSingleWord()) {
- assert(RHS.VAL != 0 && "Divide by zero?");
- return APInt(BitWidth, VAL / RHS.VAL);
- }
-
- // Get some facts about the LHS and RHS number of bits and words
- uint32_t rhsBits = RHS.getActiveBits();
- uint32_t rhsWords = !rhsBits ? 0 : (APInt::whichWord(rhsBits - 1) + 1);
- assert(rhsWords && "Divided by zero???");
- uint32_t lhsBits = this->getActiveBits();
- uint32_t lhsWords = !lhsBits ? 0 : (APInt::whichWord(lhsBits - 1) + 1);
-
- // Deal with some degenerate cases
- if (!lhsWords)
- // 0 / X ===> 0
- return APInt(BitWidth, 0);
- else if (lhsWords < rhsWords || this->ult(RHS)) {
- // X / Y ===> 0, iff X < Y
- return APInt(BitWidth, 0);
- } else if (*this == RHS) {
- // X / X ===> 1
- return APInt(BitWidth, 1);
- } else if (lhsWords == 1 && rhsWords == 1) {
- // All high words are zero, just use native divide
- return APInt(BitWidth, this->pVal[0] / RHS.pVal[0]);
- }
-
- // We have to compute it the hard way. Invoke the Knuth divide algorithm.
- APInt Quotient(1,0); // to hold result.
- divide(*this, lhsWords, RHS, rhsWords, &Quotient, 0);
- return Quotient;
-}
-
-APInt APInt::urem(const APInt& RHS) const {
- assert(BitWidth == RHS.BitWidth && "Bit widths must be the same");
- if (isSingleWord()) {
- assert(RHS.VAL != 0 && "Remainder by zero?");
- return APInt(BitWidth, VAL % RHS.VAL);
- }
-
- // Get some facts about the LHS
- uint32_t lhsBits = getActiveBits();
- uint32_t lhsWords = !lhsBits ? 0 : (whichWord(lhsBits - 1) + 1);
-
- // Get some facts about the RHS
- uint32_t rhsBits = RHS.getActiveBits();
- uint32_t rhsWords = !rhsBits ? 0 : (APInt::whichWord(rhsBits - 1) + 1);
- assert(rhsWords && "Performing remainder operation by zero ???");
-
- // Check the degenerate cases
- if (lhsWords == 0) {
- // 0 % Y ===> 0
- return APInt(BitWidth, 0);
- } else if (lhsWords < rhsWords || this->ult(RHS)) {
- // X % Y ===> X, iff X < Y
- return *this;
- } else if (*this == RHS) {
- // X % X == 0;
- return APInt(BitWidth, 0);
- } else if (lhsWords == 1) {
- // All high words are zero, just use native remainder
- return APInt(BitWidth, pVal[0] % RHS.pVal[0]);
- }
-
- // We have to compute it the hard way. Invoke the Knuth divide algorithm.
- APInt Remainder(1,0);
- divide(*this, lhsWords, RHS, rhsWords, 0, &Remainder);
- return Remainder;
-}
-
-void APInt::udivrem(const APInt &LHS, const APInt &RHS,
- APInt &Quotient, APInt &Remainder) {
- // Get some size facts about the dividend and divisor
- uint32_t lhsBits = LHS.getActiveBits();
- uint32_t lhsWords = !lhsBits ? 0 : (APInt::whichWord(lhsBits - 1) + 1);
- uint32_t rhsBits = RHS.getActiveBits();
- uint32_t rhsWords = !rhsBits ? 0 : (APInt::whichWord(rhsBits - 1) + 1);
-
- // Check the degenerate cases
- if (lhsWords == 0) {
- Quotient = 0; // 0 / Y ===> 0
- Remainder = 0; // 0 % Y ===> 0
- return;
- }
-
- if (lhsWords < rhsWords || LHS.ult(RHS)) {
- Quotient = 0; // X / Y ===> 0, iff X < Y
- Remainder = LHS; // X % Y ===> X, iff X < Y
- return;
- }
-
- if (LHS == RHS) {
- Quotient = 1; // X / X ===> 1
- Remainder = 0; // X % X ===> 0;
- return;
- }
-
- if (lhsWords == 1 && rhsWords == 1) {
- // There is only one word to consider so use the native versions.
- if (LHS.isSingleWord()) {
- Quotient = APInt(LHS.getBitWidth(), LHS.VAL / RHS.VAL);
- Remainder = APInt(LHS.getBitWidth(), LHS.VAL % RHS.VAL);
- } else {
- Quotient = APInt(LHS.getBitWidth(), LHS.pVal[0] / RHS.pVal[0]);
- Remainder = APInt(LHS.getBitWidth(), LHS.pVal[0] % RHS.pVal[0]);
- }
- return;
- }
-
- // Okay, lets do it the long way
- divide(LHS, lhsWords, RHS, rhsWords, &Quotient, &Remainder);
-}
-
-void APInt::fromString(uint32_t numbits, const char *str, uint32_t slen,
- uint8_t radix) {
- // Check our assumptions here
- assert((radix == 10 || radix == 8 || radix == 16 || radix == 2) &&
- "Radix should be 2, 8, 10, or 16!");
- assert(str && "String is null?");
- bool isNeg = str[0] == '-';
- if (isNeg)
- str++, slen--;
- assert((slen <= numbits || radix != 2) && "Insufficient bit width");
- assert((slen*3 <= numbits || radix != 8) && "Insufficient bit width");
- assert((slen*4 <= numbits || radix != 16) && "Insufficient bit width");
- assert(((slen*64)/22 <= numbits || radix != 10) && "Insufficient bit width");
-
- // Allocate memory
- if (!isSingleWord())
- pVal = getClearedMemory(getNumWords());
-
- // Figure out if we can shift instead of multiply
- uint32_t shift = (radix == 16 ? 4 : radix == 8 ? 3 : radix == 2 ? 1 : 0);
-
- // Set up an APInt for the digit to add outside the loop so we don't
- // constantly construct/destruct it.
- APInt apdigit(getBitWidth(), 0);
- APInt apradix(getBitWidth(), radix);
-
- // Enter digit traversal loop
- for (unsigned i = 0; i < slen; i++) {
- // Get a digit
- uint32_t digit = 0;
- char cdigit = str[i];
- if (radix == 16) {
- if (!isxdigit(cdigit))
- assert(0 && "Invalid hex digit in string");
- if (isdigit(cdigit))
- digit = cdigit - '0';
- else if (cdigit >= 'a')
- digit = cdigit - 'a' + 10;
- else if (cdigit >= 'A')
- digit = cdigit - 'A' + 10;
- else
- assert(0 && "huh? we shouldn't get here");
- } else if (isdigit(cdigit)) {
- digit = cdigit - '0';
- assert((radix == 10 ||
- (radix == 8 && digit != 8 && digit != 9) ||
- (radix == 2 && (digit == 0 || digit == 1))) &&
- "Invalid digit in string for given radix");
- } else {
- assert(0 && "Invalid character in digit string");
- }
-
- // Shift or multiply the value by the radix
- if (shift)
- *this <<= shift;
- else
- *this *= apradix;
-
- // Add in the digit we just interpreted
- if (apdigit.isSingleWord())
- apdigit.VAL = digit;
- else
- apdigit.pVal[0] = digit;
- *this += apdigit;
- }
- // If its negative, put it in two's complement form
- if (isNeg) {
- (*this)--;
- this->flip();
- }
-}
-
-std::string APInt::toString(uint8_t radix, bool wantSigned) const {
- assert((radix == 10 || radix == 8 || radix == 16 || radix == 2) &&
- "Radix should be 2, 8, 10, or 16!");
- static const char *const digits[] = {
- "0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F"
- };
- std::string result;
- uint32_t bits_used = getActiveBits();
- if (isSingleWord()) {
- char buf[65];
- const char *format = (radix == 10 ? (wantSigned ? "%lld" : "%llu") :
- (radix == 16 ? "%llX" : (radix == 8 ? "%llo" : 0)));
- if (format) {
- if (wantSigned) {
- int64_t sextVal = (int64_t(VAL) << (APINT_BITS_PER_WORD-BitWidth)) >>
- (APINT_BITS_PER_WORD-BitWidth);
- sprintf(buf, format, sextVal);
- } else
- sprintf(buf, format, VAL);
- } else {
- memset(buf, 0, 65);
- uint64_t v = VAL;
- while (bits_used) {
- uint32_t bit = (uint32_t)v & 1;
- bits_used--;
- buf[bits_used] = digits[bit][0];
- v >>=1;
- }
- }
- result = buf;
- return result;
- }
-
- if (radix != 10) {
- // For the 2, 8 and 16 bit cases, we can just shift instead of divide
- // because the number of bits per digit (1,3 and 4 respectively) divides
- // equaly. We just shift until there value is zero.
-
- // First, check for a zero value and just short circuit the logic below.
- if (*this == 0)
- result = "0";
- else {
- APInt tmp(*this);
- size_t insert_at = 0;
- if (wantSigned && this->isNegative()) {
- // They want to print the signed version and it is a negative value
- // Flip the bits and add one to turn it into the equivalent positive
- // value and put a '-' in the result.
- tmp.flip();
- tmp++;
- result = "-";
- insert_at = 1;
- }
- // Just shift tmp right for each digit width until it becomes zero
- uint32_t shift = (radix == 16 ? 4 : (radix == 8 ? 3 : 1));
- uint64_t mask = radix - 1;
- APInt zero(tmp.getBitWidth(), 0);
- while (tmp.ne(zero)) {
- unsigned digit =
- (unsigned)((tmp.isSingleWord() ? tmp.VAL : tmp.pVal[0]) & mask);
- result.insert(insert_at, digits[digit]);
- tmp = tmp.lshr(shift);
- }
- }
- return result;
- }
-
- APInt tmp(*this);
- APInt divisor(4, radix);
- APInt zero(tmp.getBitWidth(), 0);
- size_t insert_at = 0;
- if (wantSigned && tmp[BitWidth-1]) {
- // They want to print the signed version and it is a negative value
- // Flip the bits and add one to turn it into the equivalent positive
- // value and put a '-' in the result.
- tmp.flip();
- tmp++;
- result = "-";
- insert_at = 1;
- }
- if (tmp == APInt(tmp.getBitWidth(), 0))
- result = "0";
- else while (tmp.ne(zero)) {
- APInt APdigit(1,0);
- APInt tmp2(tmp.getBitWidth(), 0);
- divide(tmp, tmp.getNumWords(), divisor, divisor.getNumWords(), &tmp2,
- &APdigit);
- uint32_t digit = (uint32_t)APdigit.getZExtValue();
- assert(digit < radix && "divide failed");
- result.insert(insert_at,digits[digit]);
- tmp = tmp2;
- }
-
- return result;
-}
-
-void APInt::dump() const
-{
- cerr << "APInt(" << BitWidth << ")=" << std::setbase(16);
- if (isSingleWord())
- cerr << VAL;
- else for (unsigned i = getNumWords(); i > 0; i--) {
- cerr << pVal[i-1] << " ";
- }
- cerr << " U(" << this->toStringUnsigned(10) << ") S("
- << this->toStringSigned(10) << ")" << std::setbase(10);
-}
-
-// This implements a variety of operations on a representation of
-// arbitrary precision, two's-complement, bignum integer values.
-
-/* Assumed by lowHalf, highHalf, partMSB and partLSB. A fairly safe
- and unrestricting assumption. */
-COMPILE_TIME_ASSERT(integerPartWidth % 2 == 0);
-
-/* Some handy functions local to this file. */
-namespace {
-
- /* Returns the integer part with the least significant BITS set.
- BITS cannot be zero. */
- static inline integerPart
- lowBitMask(unsigned int bits)
- {
- assert (bits != 0 && bits <= integerPartWidth);
-
- return ~(integerPart) 0 >> (integerPartWidth - bits);
- }
-
- /* Returns the value of the lower half of PART. */
- static inline integerPart
- lowHalf(integerPart part)
- {
- return part & lowBitMask(integerPartWidth / 2);
- }
-
- /* Returns the value of the upper half of PART. */
- static inline integerPart
- highHalf(integerPart part)
- {
- return part >> (integerPartWidth / 2);
- }
-
- /* Returns the bit number of the most significant set bit of a part.
- If the input number has no bits set -1U is returned. */
- static unsigned int
- partMSB(integerPart value)
- {
- unsigned int n, msb;
-
- if (value == 0)
- return -1U;
-
- n = integerPartWidth / 2;
-
- msb = 0;
- do {
- if (value >> n) {
- value >>= n;
- msb += n;
- }
-
- n >>= 1;
- } while (n);
-
- return msb;
- }
-
- /* Returns the bit number of the least significant set bit of a
- part. If the input number has no bits set -1U is returned. */
- static unsigned int
- partLSB(integerPart value)
- {
- unsigned int n, lsb;
-
- if (value == 0)
- return -1U;
-
- lsb = integerPartWidth - 1;
- n = integerPartWidth / 2;
-
- do {
- if (value << n) {
- value <<= n;
- lsb -= n;
- }
-
- n >>= 1;
- } while (n);
-
- return lsb;
- }
-}
-
-/* Sets the least significant part of a bignum to the input value, and
- zeroes out higher parts. */
-void
-APInt::tcSet(integerPart *dst, integerPart part, unsigned int parts)
-{
- unsigned int i;
-
- assert (parts > 0);
-
- dst[0] = part;
- for(i = 1; i < parts; i++)
- dst[i] = 0;
-}
-
-/* Assign one bignum to another. */
-void
-APInt::tcAssign(integerPart *dst, const integerPart *src, unsigned int parts)
-{
- unsigned int i;
-
- for(i = 0; i < parts; i++)
- dst[i] = src[i];
-}
-
-/* Returns true if a bignum is zero, false otherwise. */
-bool
-APInt::tcIsZero(const integerPart *src, unsigned int parts)
-{
- unsigned int i;
-
- for(i = 0; i < parts; i++)
- if (src[i])
- return false;
-
- return true;
-}
-
-/* Extract the given bit of a bignum; returns 0 or 1. */
-int
-APInt::tcExtractBit(const integerPart *parts, unsigned int bit)
-{
- return(parts[bit / integerPartWidth]
- & ((integerPart) 1 << bit % integerPartWidth)) != 0;
-}
-
-/* Set the given bit of a bignum. */
-void
-APInt::tcSetBit(integerPart *parts, unsigned int bit)
-{
- parts[bit / integerPartWidth] |= (integerPart) 1 << (bit % integerPartWidth);
-}
-
-/* Returns the bit number of the least significant set bit of a
- number. If the input number has no bits set -1U is returned. */
-unsigned int
-APInt::tcLSB(const integerPart *parts, unsigned int n)
-{
- unsigned int i, lsb;
-
- for(i = 0; i < n; i++) {
- if (parts[i] != 0) {
- lsb = partLSB(parts[i]);
-
- return lsb + i * integerPartWidth;
- }
- }
-
- return -1U;
-}
-
-/* Returns the bit number of the most significant set bit of a number.
- If the input number has no bits set -1U is returned. */
-unsigned int
-APInt::tcMSB(const integerPart *parts, unsigned int n)
-{
- unsigned int msb;
-
- do {
- --n;
-
- if (parts[n] != 0) {
- msb = partMSB(parts[n]);
-
- return msb + n * integerPartWidth;
- }
- } while (n);
-
- return -1U;
-}
-
-/* Copy the bit vector of width srcBITS from SRC, starting at bit
- srcLSB, to DST, of dstCOUNT parts, such that the bit srcLSB becomes
- the least significant bit of DST. All high bits above srcBITS in
- DST are zero-filled. */
-void
-APInt::tcExtract(integerPart *dst, unsigned int dstCount, const integerPart *src,
- unsigned int srcBits, unsigned int srcLSB)
-{
- unsigned int firstSrcPart, dstParts, shift, n;
-
- dstParts = (srcBits + integerPartWidth - 1) / integerPartWidth;
- assert (dstParts <= dstCount);
-
- firstSrcPart = srcLSB / integerPartWidth;
- tcAssign (dst, src + firstSrcPart, dstParts);
-
- shift = srcLSB % integerPartWidth;
- tcShiftRight (dst, dstParts, shift);
-
- /* We now have (dstParts * integerPartWidth - shift) bits from SRC
- in DST. If this is less that srcBits, append the rest, else
- clear the high bits. */
- n = dstParts * integerPartWidth - shift;
- if (n < srcBits) {
- integerPart mask = lowBitMask (srcBits - n);
- dst[dstParts - 1] |= ((src[firstSrcPart + dstParts] & mask)
- << n % integerPartWidth);
- } else if (n > srcBits) {
- if (srcBits % integerPartWidth)
- dst[dstParts - 1] &= lowBitMask (srcBits % integerPartWidth);
- }
-
- /* Clear high parts. */
- while (dstParts < dstCount)
- dst[dstParts++] = 0;
-}
-
-/* DST += RHS + C where C is zero or one. Returns the carry flag. */
-integerPart
-APInt::tcAdd(integerPart *dst, const integerPart *rhs,
- integerPart c, unsigned int parts)
-{
- unsigned int i;
-
- assert(c <= 1);
-
- for(i = 0; i < parts; i++) {
- integerPart l;
-
- l = dst[i];
- if (c) {
- dst[i] += rhs[i] + 1;
- c = (dst[i] <= l);
- } else {
- dst[i] += rhs[i];
- c = (dst[i] < l);
- }
- }
-
- return c;
-}
-
-/* DST -= RHS + C where C is zero or one. Returns the carry flag. */
-integerPart
-APInt::tcSubtract(integerPart *dst, const integerPart *rhs,
- integerPart c, unsigned int parts)
-{
- unsigned int i;
-
- assert(c <= 1);
-
- for(i = 0; i < parts; i++) {
- integerPart l;
-
- l = dst[i];
- if (c) {
- dst[i] -= rhs[i] + 1;
- c = (dst[i] >= l);
- } else {
- dst[i] -= rhs[i];
- c = (dst[i] > l);
- }
- }
-
- return c;
-}
-
-/* Negate a bignum in-place. */
-void
-APInt::tcNegate(integerPart *dst, unsigned int parts)
-{
- tcComplement(dst, parts);
- tcIncrement(dst, parts);
-}
-
-/* DST += SRC * MULTIPLIER + CARRY if add is true
- DST = SRC * MULTIPLIER + CARRY if add is false
-
- Requires 0 <= DSTPARTS <= SRCPARTS + 1. If DST overlaps SRC
- they must start at the same point, i.e. DST == SRC.
-
- If DSTPARTS == SRCPARTS + 1 no overflow occurs and zero is
- returned. Otherwise DST is filled with the least significant
- DSTPARTS parts of the result, and if all of the omitted higher
- parts were zero return zero, otherwise overflow occurred and
- return one. */
-int
-APInt::tcMultiplyPart(integerPart *dst, const integerPart *src,
- integerPart multiplier, integerPart carry,
- unsigned int srcParts, unsigned int dstParts,
- bool add)
-{
- unsigned int i, n;
-
- /* Otherwise our writes of DST kill our later reads of SRC. */
- assert(dst <= src || dst >= src + srcParts);
- assert(dstParts <= srcParts + 1);
-
- /* N loops; minimum of dstParts and srcParts. */
- n = dstParts < srcParts ? dstParts: srcParts;
-
- for(i = 0; i < n; i++) {
- integerPart low, mid, high, srcPart;
-
- /* [ LOW, HIGH ] = MULTIPLIER * SRC[i] + DST[i] + CARRY.
-
- This cannot overflow, because
-
- (n - 1) * (n - 1) + 2 (n - 1) = (n - 1) * (n + 1)
-
- which is less than n^2. */
-
- srcPart = src[i];
-
- if (multiplier == 0 || srcPart == 0) {
- low = carry;
- high = 0;
- } else {
- low = lowHalf(srcPart) * lowHalf(multiplier);
- high = highHalf(srcPart) * highHalf(multiplier);
-
- mid = lowHalf(srcPart) * highHalf(multiplier);
- high += highHalf(mid);
- mid <<= integerPartWidth / 2;
- if (low + mid < low)
- high++;
- low += mid;
-
- mid = highHalf(srcPart) * lowHalf(multiplier);
- high += highHalf(mid);
- mid <<= integerPartWidth / 2;
- if (low + mid < low)
- high++;
- low += mid;
-
- /* Now add carry. */
- if (low + carry < low)
- high++;
- low += carry;
- }
-
- if (add) {
- /* And now DST[i], and store the new low part there. */
- if (low + dst[i] < low)
- high++;
- dst[i] += low;
- } else
- dst[i] = low;
-
- carry = high;
- }
-
- if (i < dstParts) {
- /* Full multiplication, there is no overflow. */
- assert(i + 1 == dstParts);
- dst[i] = carry;
- return 0;
- } else {
- /* We overflowed if there is carry. */
- if (carry)
- return 1;
-
- /* We would overflow if any significant unwritten parts would be
- non-zero. This is true if any remaining src parts are non-zero
- and the multiplier is non-zero. */
- if (multiplier)
- for(; i < srcParts; i++)
- if (src[i])
- return 1;
-
- /* We fitted in the narrow destination. */
- return 0;
- }
-}
-
-/* DST = LHS * RHS, where DST has the same width as the operands and
- is filled with the least significant parts of the result. Returns
- one if overflow occurred, otherwise zero. DST must be disjoint
- from both operands. */
-int
-APInt::tcMultiply(integerPart *dst, const integerPart *lhs,
- const integerPart *rhs, unsigned int parts)
-{
- unsigned int i;
- int overflow;
-
- assert(dst != lhs && dst != rhs);
-
- overflow = 0;
- tcSet(dst, 0, parts);
-
- for(i = 0; i < parts; i++)
- overflow |= tcMultiplyPart(&dst[i], lhs, rhs[i], 0, parts,
- parts - i, true);
-
- return overflow;
-}
-
-/* DST = LHS * RHS, where DST has width the sum of the widths of the
- operands. No overflow occurs. DST must be disjoint from both
- operands. Returns the number of parts required to hold the
- result. */
-unsigned int
-APInt::tcFullMultiply(integerPart *dst, const integerPart *lhs,
- const integerPart *rhs, unsigned int lhsParts,
- unsigned int rhsParts)
-{
- /* Put the narrower number on the LHS for less loops below. */
- if (lhsParts > rhsParts) {
- return tcFullMultiply (dst, rhs, lhs, rhsParts, lhsParts);
- } else {
- unsigned int n;
-
- assert(dst != lhs && dst != rhs);
-
- tcSet(dst, 0, rhsParts);
-
- for(n = 0; n < lhsParts; n++)
- tcMultiplyPart(&dst[n], rhs, lhs[n], 0, rhsParts, rhsParts + 1, true);
-
- n = lhsParts + rhsParts;
-
- return n - (dst[n - 1] == 0);
- }
-}
-
-/* If RHS is zero LHS and REMAINDER are left unchanged, return one.
- Otherwise set LHS to LHS / RHS with the fractional part discarded,
- set REMAINDER to the remainder, return zero. i.e.
-
- OLD_LHS = RHS * LHS + REMAINDER
-
- SCRATCH is a bignum of the same size as the operands and result for
- use by the routine; its contents need not be initialized and are
- destroyed. LHS, REMAINDER and SCRATCH must be distinct.
-*/
-int
-APInt::tcDivide(integerPart *lhs, const integerPart *rhs,
- integerPart *remainder, integerPart *srhs,
- unsigned int parts)
-{
- unsigned int n, shiftCount;
- integerPart mask;
-
- assert(lhs != remainder && lhs != srhs && remainder != srhs);
-
- shiftCount = tcMSB(rhs, parts) + 1;
- if (shiftCount == 0)
- return true;
-
- shiftCount = parts * integerPartWidth - shiftCount;
- n = shiftCount / integerPartWidth;
- mask = (integerPart) 1 << (shiftCount % integerPartWidth);
-
- tcAssign(srhs, rhs, parts);
- tcShiftLeft(srhs, parts, shiftCount);
- tcAssign(remainder, lhs, parts);
- tcSet(lhs, 0, parts);
-
- /* Loop, subtracting SRHS if REMAINDER is greater and adding that to
- the total. */
- for(;;) {
- int compare;
-
- compare = tcCompare(remainder, srhs, parts);
- if (compare >= 0) {
- tcSubtract(remainder, srhs, 0, parts);
- lhs[n] |= mask;
- }
-
- if (shiftCount == 0)
- break;
- shiftCount--;
- tcShiftRight(srhs, parts, 1);
- if ((mask >>= 1) == 0)
- mask = (integerPart) 1 << (integerPartWidth - 1), n--;
- }
-
- return false;
-}
-
-/* Shift a bignum left COUNT bits in-place. Shifted in bits are zero.
- There are no restrictions on COUNT. */
-void
-APInt::tcShiftLeft(integerPart *dst, unsigned int parts, unsigned int count)
-{
- if (count) {
- unsigned int jump, shift;
-
- /* Jump is the inter-part jump; shift is is intra-part shift. */
- jump = count / integerPartWidth;
- shift = count % integerPartWidth;
-
- while (parts > jump) {
- integerPart part;
-
- parts--;
-
- /* dst[i] comes from the two parts src[i - jump] and, if we have
- an intra-part shift, src[i - jump - 1]. */
- part = dst[parts - jump];
- if (shift) {
- part <<= shift;
- if (parts >= jump + 1)
- part |= dst[parts - jump - 1] >> (integerPartWidth - shift);
- }
-
- dst[parts] = part;
- }
-
- while (parts > 0)
- dst[--parts] = 0;
- }
-}
-
-/* Shift a bignum right COUNT bits in-place. Shifted in bits are
- zero. There are no restrictions on COUNT. */
-void
-APInt::tcShiftRight(integerPart *dst, unsigned int parts, unsigned int count)
-{
- if (count) {
- unsigned int i, jump, shift;
-
- /* Jump is the inter-part jump; shift is is intra-part shift. */
- jump = count / integerPartWidth;
- shift = count % integerPartWidth;
-
- /* Perform the shift. This leaves the most significant COUNT bits
- of the result at zero. */
- for(i = 0; i < parts; i++) {
- integerPart part;
-
- if (i + jump >= parts) {
- part = 0;
- } else {
- part = dst[i + jump];
- if (shift) {
- part >>= shift;
- if (i + jump + 1 < parts)
- part |= dst[i + jump + 1] << (integerPartWidth - shift);
- }
- }
-
- dst[i] = part;
- }
- }
-}
-
-/* Bitwise and of two bignums. */
-void
-APInt::tcAnd(integerPart *dst, const integerPart *rhs, unsigned int parts)
-{
- unsigned int i;
-
- for(i = 0; i < parts; i++)
- dst[i] &= rhs[i];
-}
-
-/* Bitwise inclusive or of two bignums. */
-void
-APInt::tcOr(integerPart *dst, const integerPart *rhs, unsigned int parts)
-{
- unsigned int i;
-
- for(i = 0; i < parts; i++)
- dst[i] |= rhs[i];
-}
-
-/* Bitwise exclusive or of two bignums. */
-void
-APInt::tcXor(integerPart *dst, const integerPart *rhs, unsigned int parts)
-{
- unsigned int i;
-
- for(i = 0; i < parts; i++)
- dst[i] ^= rhs[i];
-}
-
-/* Complement a bignum in-place. */
-void
-APInt::tcComplement(integerPart *dst, unsigned int parts)
-{
- unsigned int i;
-
- for(i = 0; i < parts; i++)
- dst[i] = ~dst[i];
-}
-
-/* Comparison (unsigned) of two bignums. */
-int
-APInt::tcCompare(const integerPart *lhs, const integerPart *rhs,
- unsigned int parts)
-{
- while (parts) {
- parts--;
- if (lhs[parts] == rhs[parts])
- continue;
-
- if (lhs[parts] > rhs[parts])
- return 1;
- else
- return -1;
- }
-
- return 0;
-}
-
-/* Increment a bignum in-place, return the carry flag. */
-integerPart
-APInt::tcIncrement(integerPart *dst, unsigned int parts)
-{
- unsigned int i;
-
- for(i = 0; i < parts; i++)
- if (++dst[i] != 0)
- break;
-
- return i == parts;
-}
-
-/* Set the least significant BITS bits of a bignum, clear the
- rest. */
-void
-APInt::tcSetLeastSignificantBits(integerPart *dst, unsigned int parts,
- unsigned int bits)
-{
- unsigned int i;
-
- i = 0;
- while (bits > integerPartWidth) {
- dst[i++] = ~(integerPart) 0;
- bits -= integerPartWidth;
- }
-
- if (bits)
- dst[i++] = ~(integerPart) 0 >> (integerPartWidth - bits);
-
- while (i < parts)
- dst[i++] = 0;
-}
diff --git a/release_23/lib/Support/APSInt.cpp b/release_23/lib/Support/APSInt.cpp
deleted file mode 100644
index 73acafa690c7..000000000000
--- a/release_23/lib/Support/APSInt.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-//===-- llvm/ADT/APSInt.cpp - Arbitrary Precision Signed Int ---*- C++ -*--===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the APSInt class, which is a simple class that
-// represents an arbitrary sized integer that knows its signedness.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/ADT/APSInt.h"
-#include "llvm/ADT/FoldingSet.h"
-
-using namespace llvm;
-
-void APSInt::Profile(FoldingSetNodeID& ID) const {
- ID.AddInteger((unsigned) (IsUnsigned ? 1 : 0));
- APInt::Profile(ID);
-}
diff --git a/release_23/lib/Support/Allocator.cpp b/release_23/lib/Support/Allocator.cpp
deleted file mode 100644
index ba6a393c81fc..000000000000
--- a/release_23/lib/Support/Allocator.cpp
+++ /dev/null
@@ -1,132 +0,0 @@
-//===--- Allocator.cpp - Simple memory allocation abstraction -------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the BumpPtrAllocator interface.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Support/Allocator.h"
-#include "llvm/Support/DataTypes.h"
-#include "llvm/Support/Streams.h"
-#include <ostream>
-using namespace llvm;
-
-//===----------------------------------------------------------------------===//
-// MemRegion class implementation
-//===----------------------------------------------------------------------===//
-
-namespace {
-/// MemRegion - This is one chunk of the BumpPtrAllocator.
-class MemRegion {
- unsigned RegionSize;
- MemRegion *Next;
- char *NextPtr;
-public:
- void Init(unsigned size, unsigned Alignment, MemRegion *next) {
- RegionSize = size;
- Next = next;
- NextPtr = (char*)(this+1);
-
- // Align NextPtr.
- NextPtr = (char*)((intptr_t)(NextPtr+Alignment-1) &
- ~(intptr_t)(Alignment-1));
- }
-
- const MemRegion *getNext() const { return Next; }
- unsigned getNumBytesAllocated() const {
- return NextPtr-(const char*)this;
- }
-
- /// Allocate - Allocate and return at least the specified number of bytes.
- ///
- void *Allocate(size_t AllocSize, size_t Alignment, MemRegion **RegPtr) {
-
- char* Result = (char*) (((uintptr_t) (NextPtr+Alignment-1))
- & ~((uintptr_t) Alignment-1));
-
- // Speculate the new value of NextPtr.
- char* NextPtrTmp = Result + AllocSize;
-
- // If we are still within the current region, return Result.
- if (unsigned (NextPtrTmp - (char*) this) <= RegionSize) {
- NextPtr = NextPtrTmp;
- return Result;
- }
-
- // Otherwise, we have to allocate a new chunk. Create one twice as big as
- // this one.
- MemRegion *NewRegion = (MemRegion *)malloc(RegionSize*2);
- NewRegion->Init(RegionSize*2, Alignment, this);
-
- // Update the current "first region" pointer to point to the new region.
- *RegPtr = NewRegion;
-
- // Try allocating from it now.
- return NewRegion->Allocate(AllocSize, Alignment, RegPtr);
- }
-
- /// Deallocate - Recursively release all memory for this and its next regions
- /// to the system.
- void Deallocate() {
- MemRegion *next = Next;
- free(this);
- if (next)
- next->Deallocate();
- }
-
- /// DeallocateAllButLast - Recursively release all memory for this and its
- /// next regions to the system stopping at the last region in the list.
- /// Returns the pointer to the last region.
- MemRegion *DeallocateAllButLast() {
- MemRegion *next = Next;
- if (!next)
- return this;
- free(this);
- return next->DeallocateAllButLast();
- }
-};
-}
-
-//===----------------------------------------------------------------------===//
-// BumpPtrAllocator class implementation
-//===----------------------------------------------------------------------===//
-
-BumpPtrAllocator::BumpPtrAllocator() {
- TheMemory = malloc(4096);
- ((MemRegion*)TheMemory)->Init(4096, 1, 0);
-}
-
-BumpPtrAllocator::~BumpPtrAllocator() {
- ((MemRegion*)TheMemory)->Deallocate();
-}
-
-void BumpPtrAllocator::Reset() {
- MemRegion *MRP = (MemRegion*)TheMemory;
- MRP = MRP->DeallocateAllButLast();
- MRP->Init(4096, 1, 0);
- TheMemory = MRP;
-}
-
-void *BumpPtrAllocator::Allocate(size_t Size, size_t Align) {
- MemRegion *MRP = (MemRegion*)TheMemory;
- void *Ptr = MRP->Allocate(Size, Align, &MRP);
- TheMemory = MRP;
- return Ptr;
-}
-
-void BumpPtrAllocator::PrintStats() const {
- unsigned BytesUsed = 0;
- unsigned NumRegions = 0;
- const MemRegion *R = (MemRegion*)TheMemory;
- for (; R; R = R->getNext(), ++NumRegions)
- BytesUsed += R->getNumBytesAllocated();
-
- cerr << "\nNumber of memory regions: " << NumRegions << "\n";
- cerr << "Bytes allocated: " << BytesUsed << "\n";
-}
diff --git a/release_23/lib/Support/Annotation.cpp b/release_23/lib/Support/Annotation.cpp
deleted file mode 100644
index 3ecc42f782e2..000000000000
--- a/release_23/lib/Support/Annotation.cpp
+++ /dev/null
@@ -1,105 +0,0 @@
-//===-- Annotation.cpp - Implement the Annotation Classes -----------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the AnnotationManager class.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Support/Annotation.h"
-#include "llvm/Support/ManagedStatic.h"
-#include <map>
-using namespace llvm;
-
-Annotation::~Annotation() {} // Designed to be subclassed
-
-Annotable::~Annotable() { // Virtual because it's designed to be subclassed...
- Annotation *A = AnnotationList;
- while (A) {
- Annotation *Next = A->getNext();
- delete A;
- A = Next;
- }
-}
-
-typedef std::map<const std::string, unsigned> IDMapType;
-static unsigned IDCounter = 0; // Unique ID counter
-
-// Static member to ensure initialiation on demand.
-static ManagedStatic<IDMapType> IDMap;
-
-// On demand annotation creation support...
-typedef Annotation *(*AnnFactory)(AnnotationID, const Annotable *, void *);
-typedef std::map<unsigned, std::pair<AnnFactory,void*> > FactMapType;
-
-static FactMapType *TheFactMap = 0;
-static FactMapType &getFactMap() {
- if (TheFactMap == 0)
- TheFactMap = new FactMapType();
- return *TheFactMap;
-}
-
-static void eraseFromFactMap(unsigned ID) {
- assert(TheFactMap && "No entries found!");
- TheFactMap->erase(ID);
- if (TheFactMap->empty()) { // Delete when empty
- delete TheFactMap;
- TheFactMap = 0;
- }
-}
-
-AnnotationID AnnotationManager::getID(const std::string &Name) { // Name -> ID
- IDMapType::iterator I = IDMap->find(Name);
- if (I == IDMap->end()) {
- (*IDMap)[Name] = IDCounter++; // Add a new element
- return AnnotationID(IDCounter-1);
- }
- return AnnotationID(I->second);
-}
-
-// getID - Name -> ID + registration of a factory function for demand driven
-// annotation support.
-AnnotationID AnnotationManager::getID(const std::string &Name, Factory Fact,
- void *Data) {
- AnnotationID Result(getID(Name));
- registerAnnotationFactory(Result, Fact, Data);
- return Result;
-}
-
-// getName - This function is especially slow, but that's okay because it should
-// only be used for debugging.
-//
-const std::string &AnnotationManager::getName(AnnotationID ID) { // ID -> Name
- IDMapType &TheMap = *IDMap;
- for (IDMapType::iterator I = TheMap.begin(); ; ++I) {
- assert(I != TheMap.end() && "Annotation ID is unknown!");
- if (I->second == ID.ID) return I->first;
- }
-}
-
-// registerAnnotationFactory - This method is used to register a callback
-// function used to create an annotation on demand if it is needed by the
-// Annotable::findOrCreateAnnotation method.
-//
-void AnnotationManager::registerAnnotationFactory(AnnotationID ID, AnnFactory F,
- void *ExtraData) {
- if (F)
- getFactMap()[ID.ID] = std::make_pair(F, ExtraData);
- else
- eraseFromFactMap(ID.ID);
-}
-
-// createAnnotation - Create an annotation of the specified ID for the
-// specified object, using a register annotation creation function.
-//
-Annotation *AnnotationManager::createAnnotation(AnnotationID ID,
- const Annotable *Obj) {
- FactMapType::iterator I = getFactMap().find(ID.ID);
- if (I == getFactMap().end()) return 0;
- return I->second.first(ID, Obj, I->second.second);
-}
diff --git a/release_23/lib/Support/CommandLine.cpp b/release_23/lib/Support/CommandLine.cpp
deleted file mode 100644
index 412dcb61839e..000000000000
--- a/release_23/lib/Support/CommandLine.cpp
+++ /dev/null
@@ -1,1141 +0,0 @@
-//===-- CommandLine.cpp - Command line parser implementation --------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This class implements a command line argument processor that is useful when
-// creating a tool. It provides a simple, minimalistic interface that is easily
-// extensible and supports nonlocal (library) command line options.
-//
-// Note that rather than trying to figure out what this code does, you could try
-// reading the library documentation located in docs/CommandLine.html
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Config/config.h"
-#include "llvm/ADT/OwningPtr.h"
-#include "llvm/Support/CommandLine.h"
-#include "llvm/Support/MemoryBuffer.h"
-#include "llvm/Support/ManagedStatic.h"
-#include "llvm/Support/Streams.h"
-#include "llvm/System/Path.h"
-#include <algorithm>
-#include <functional>
-#include <map>
-#include <ostream>
-#include <set>
-#include <cstdlib>
-#include <cerrno>
-#include <cstring>
-#include <climits>
-using namespace llvm;
-using namespace cl;
-
-//===----------------------------------------------------------------------===//
-// Template instantiations and anchors.
-//
-TEMPLATE_INSTANTIATION(class basic_parser<bool>);
-TEMPLATE_INSTANTIATION(class basic_parser<boolOrDefault>);
-TEMPLATE_INSTANTIATION(class basic_parser<int>);
-TEMPLATE_INSTANTIATION(class basic_parser<unsigned>);
-TEMPLATE_INSTANTIATION(class basic_parser<double>);
-TEMPLATE_INSTANTIATION(class basic_parser<float>);
-TEMPLATE_INSTANTIATION(class basic_parser<std::string>);
-
-TEMPLATE_INSTANTIATION(class opt<unsigned>);
-TEMPLATE_INSTANTIATION(class opt<int>);
-TEMPLATE_INSTANTIATION(class opt<std::string>);
-TEMPLATE_INSTANTIATION(class opt<bool>);
-
-void Option::anchor() {}
-void basic_parser_impl::anchor() {}
-void parser<bool>::anchor() {}
-void parser<boolOrDefault>::anchor() {}
-void parser<int>::anchor() {}
-void parser<unsigned>::anchor() {}
-void parser<double>::anchor() {}
-void parser<float>::anchor() {}
-void parser<std::string>::anchor() {}
-
-//===----------------------------------------------------------------------===//
-
-// Globals for name and overview of program. Program name is not a string to
-// avoid static ctor/dtor issues.
-static char ProgramName[80] = "<premain>";
-static const char *ProgramOverview = 0;
-
-// This collects additional help to be printed.
-static ManagedStatic<std::vector<const char*> > MoreHelp;
-
-extrahelp::extrahelp(const char *Help)
- : morehelp(Help) {
- MoreHelp->push_back(Help);
-}
-
-static bool OptionListChanged = false;
-
-// MarkOptionsChanged - Internal helper function.
-void cl::MarkOptionsChanged() {
- OptionListChanged = true;
-}
-
-/// RegisteredOptionList - This is the list of the command line options that
-/// have statically constructed themselves.
-static Option *RegisteredOptionList = 0;
-
-void Option::addArgument() {
- assert(NextRegistered == 0 && "argument multiply registered!");
-
- NextRegistered = RegisteredOptionList;
- RegisteredOptionList = this;
- MarkOptionsChanged();
-}
-
-
-//===----------------------------------------------------------------------===//
-// Basic, shared command line option processing machinery.
-//
-
-/// GetOptionInfo - Scan the list of registered options, turning them into data
-/// structures that are easier to handle.
-static void GetOptionInfo(std::vector<Option*> &PositionalOpts,
- std::vector<Option*> &SinkOpts,
- std::map<std::string, Option*> &OptionsMap) {
- std::vector<const char*> OptionNames;
- Option *CAOpt = 0; // The ConsumeAfter option if it exists.
- for (Option *O = RegisteredOptionList; O; O = O->getNextRegisteredOption()) {
- // If this option wants to handle multiple option names, get the full set.
- // This handles enum options like "-O1 -O2" etc.
- O->getExtraOptionNames(OptionNames);
- if (O->ArgStr[0])
- OptionNames.push_back(O->ArgStr);
-
- // Handle named options.
- for (size_t i = 0, e = OptionNames.size(); i != e; ++i) {
- // Add argument to the argument map!
- if (!OptionsMap.insert(std::pair<std::string,Option*>(OptionNames[i],
- O)).second) {
- cerr << ProgramName << ": CommandLine Error: Argument '"
- << OptionNames[0] << "' defined more than once!\n";
- }
- }
-
- OptionNames.clear();
-
- // Remember information about positional options.
- if (O->getFormattingFlag() == cl::Positional)
- PositionalOpts.push_back(O);
- else if (O->getMiscFlags() & cl::Sink) // Remember sink options
- SinkOpts.push_back(O);
- else if (O->getNumOccurrencesFlag() == cl::ConsumeAfter) {
- if (CAOpt)
- O->error("Cannot specify more than one option with cl::ConsumeAfter!");
- CAOpt = O;
- }
- }
-
- if (CAOpt)
- PositionalOpts.push_back(CAOpt);
-
- // Make sure that they are in order of registration not backwards.
- std::reverse(PositionalOpts.begin(), PositionalOpts.end());
-}
-
-
-/// LookupOption - Lookup the option specified by the specified option on the
-/// command line. If there is a value specified (after an equal sign) return
-/// that as well.
-static Option *LookupOption(const char *&Arg, const char *&Value,
- std::map<std::string, Option*> &OptionsMap) {
- while (*Arg == '-') ++Arg; // Eat leading dashes
-
- const char *ArgEnd = Arg;
- while (*ArgEnd && *ArgEnd != '=')
- ++ArgEnd; // Scan till end of argument name.
-
- if (*ArgEnd == '=') // If we have an equals sign...
- Value = ArgEnd+1; // Get the value, not the equals
-
-
- if (*Arg == 0) return 0;
-
- // Look up the option.
- std::map<std::string, Option*>::iterator I =
- OptionsMap.find(std::string(Arg, ArgEnd));
- return I != OptionsMap.end() ? I->second : 0;
-}
-
-static inline bool ProvideOption(Option *Handler, const char *ArgName,
- const char *Value, int argc, char **argv,
- int &i) {
- // Enforce value requirements
- switch (Handler->getValueExpectedFlag()) {
- case ValueRequired:
- if (Value == 0) { // No value specified?
- if (i+1 < argc) { // Steal the next argument, like for '-o filename'
- Value = argv[++i];
- } else {
- return Handler->error(" requires a value!");
- }
- }
- break;
- case ValueDisallowed:
- if (Value)
- return Handler->error(" does not allow a value! '" +
- std::string(Value) + "' specified.");
- break;
- case ValueOptional:
- break;
- default:
- cerr << ProgramName
- << ": Bad ValueMask flag! CommandLine usage error:"
- << Handler->getValueExpectedFlag() << "\n";
- abort();
- break;
- }
-
- // Run the handler now!
- return Handler->addOccurrence(i, ArgName, Value ? Value : "");
-}
-
-static bool ProvidePositionalOption(Option *Handler, const std::string &Arg,
- int i) {
- int Dummy = i;
- return ProvideOption(Handler, Handler->ArgStr, Arg.c_str(), 0, 0, Dummy);
-}
-
-
-// Option predicates...
-static inline bool isGrouping(const Option *O) {
- return O->getFormattingFlag() == cl::Grouping;
-}
-static inline bool isPrefixedOrGrouping(const Option *O) {
- return isGrouping(O) || O->getFormattingFlag() == cl::Prefix;
-}
-
-// getOptionPred - Check to see if there are any options that satisfy the
-// specified predicate with names that are the prefixes in Name. This is
-// checked by progressively stripping characters off of the name, checking to
-// see if there options that satisfy the predicate. If we find one, return it,
-// otherwise return null.
-//
-static Option *getOptionPred(std::string Name, size_t &Length,
- bool (*Pred)(const Option*),
- std::map<std::string, Option*> &OptionsMap) {
-
- std::map<std::string, Option*>::iterator OMI = OptionsMap.find(Name);
- if (OMI != OptionsMap.end() && Pred(OMI->second)) {
- Length = Name.length();
- return OMI->second;
- }
-
- if (Name.size() == 1) return 0;
- do {
- Name.erase(Name.end()-1, Name.end()); // Chop off the last character...
- OMI = OptionsMap.find(Name);
-
- // Loop while we haven't found an option and Name still has at least two
- // characters in it (so that the next iteration will not be the empty
- // string...
- } while ((OMI == OptionsMap.end() || !Pred(OMI->second)) && Name.size() > 1);
-
- if (OMI != OptionsMap.end() && Pred(OMI->second)) {
- Length = Name.length();
- return OMI->second; // Found one!
- }
- return 0; // No option found!
-}
-
-static bool RequiresValue(const Option *O) {
- return O->getNumOccurrencesFlag() == cl::Required ||
- O->getNumOccurrencesFlag() == cl::OneOrMore;
-}
-
-static bool EatsUnboundedNumberOfValues(const Option *O) {
- return O->getNumOccurrencesFlag() == cl::ZeroOrMore ||
- O->getNumOccurrencesFlag() == cl::OneOrMore;
-}
-
-/// ParseCStringVector - Break INPUT up wherever one or more
-/// whitespace characters are found, and store the resulting tokens in
-/// OUTPUT. The tokens stored in OUTPUT are dynamically allocated
-/// using strdup (), so it is the caller's responsibility to free ()
-/// them later.
-///
-static void ParseCStringVector(std::vector<char *> &output,
- const char *input) {
- // Characters which will be treated as token separators:
- static const char *const delims = " \v\f\t\r\n";
-
- std::string work (input);
- // Skip past any delims at head of input string.
- size_t pos = work.find_first_not_of (delims);
- // If the string consists entirely of delims, then exit early.
- if (pos == std::string::npos) return;
- // Otherwise, jump forward to beginning of first word.
- work = work.substr (pos);
- // Find position of first delimiter.
- pos = work.find_first_of (delims);
-
- while (!work.empty() && pos != std::string::npos) {
- // Everything from 0 to POS is the next word to copy.
- output.push_back (strdup (work.substr (0,pos).c_str ()));
- // Is there another word in the string?
- size_t nextpos = work.find_first_not_of (delims, pos + 1);
- if (nextpos != std::string::npos) {
- // Yes? Then remove delims from beginning ...
- work = work.substr (work.find_first_not_of (delims, pos + 1));
- // and find the end of the word.
- pos = work.find_first_of (delims);
- } else {
- // No? (Remainder of string is delims.) End the loop.
- work = "";
- pos = std::string::npos;
- }
- }
-
- // If `input' ended with non-delim char, then we'll get here with
- // the last word of `input' in `work'; copy it now.
- if (!work.empty ()) {
- output.push_back (strdup (work.c_str ()));
- }
-}
-
-/// ParseEnvironmentOptions - An alternative entry point to the
-/// CommandLine library, which allows you to read the program's name
-/// from the caller (as PROGNAME) and its command-line arguments from
-/// an environment variable (whose name is given in ENVVAR).
-///
-void cl::ParseEnvironmentOptions(const char *progName, const char *envVar,
- const char *Overview, bool ReadResponseFiles) {
- // Check args.
- assert(progName && "Program name not specified");
- assert(envVar && "Environment variable name missing");
-
- // Get the environment variable they want us to parse options out of.
- const char *envValue = getenv(envVar);
- if (!envValue)
- return;
-
- // Get program's "name", which we wouldn't know without the caller
- // telling us.
- std::vector<char*> newArgv;
- newArgv.push_back(strdup(progName));
-
- // Parse the value of the environment variable into a "command line"
- // and hand it off to ParseCommandLineOptions().
- ParseCStringVector(newArgv, envValue);
- int newArgc = static_cast<int>(newArgv.size());
- ParseCommandLineOptions(newArgc, &newArgv[0], Overview, ReadResponseFiles);
-
- // Free all the strdup()ed strings.
- for (std::vector<char*>::iterator i = newArgv.begin(), e = newArgv.end();
- i != e; ++i)
- free (*i);
-}
-
-
-/// ExpandResponseFiles - Copy the contents of argv into newArgv,
-/// substituting the contents of the response files for the arguments
-/// of type @file.
-static void ExpandResponseFiles(int argc, char** argv,
- std::vector<char*>& newArgv) {
- for (int i = 1; i != argc; ++i) {
- char* arg = argv[i];
-
- if (arg[0] == '@') {
-
- sys::PathWithStatus respFile(++arg);
-
- // Check that the response file is not empty (mmap'ing empty
- // files can be problematic).
- const sys::FileStatus *FileStat = respFile.getFileStatus();
- if (!FileStat)
- continue;
- if (FileStat->getSize() == 0)
- continue;
-
- // Mmap the response file into memory.
- OwningPtr<MemoryBuffer>
- respFilePtr(MemoryBuffer::getFile(respFile.c_str()));
-
- if (respFilePtr == 0)
- continue;
-
- ParseCStringVector(newArgv, respFilePtr->getBufferStart());
- }
- else {
- newArgv.push_back(strdup(arg));
- }
- }
-}
-
-void cl::ParseCommandLineOptions(int argc, char **argv,
- const char *Overview, bool ReadResponseFiles) {
- // Process all registered options.
- std::vector<Option*> PositionalOpts;
- std::vector<Option*> SinkOpts;
- std::map<std::string, Option*> Opts;
- GetOptionInfo(PositionalOpts, SinkOpts, Opts);
-
- assert((!Opts.empty() || !PositionalOpts.empty()) &&
- "No options specified!");
-
- // Expand response files.
- std::vector<char*> newArgv;
- if (ReadResponseFiles) {
- newArgv.push_back(strdup(argv[0]));
- ExpandResponseFiles(argc, argv, newArgv);
- argv = &newArgv[0];
- argc = static_cast<int>(newArgv.size());
- }
-
- sys::Path progname(argv[0]);
-
- // Copy the program name into ProgName, making sure not to overflow it.
- std::string ProgName = sys::Path(argv[0]).getLast();
- if (ProgName.size() > 79) ProgName.resize(79);
- strcpy(ProgramName, ProgName.c_str());
-
- ProgramOverview = Overview;
- bool ErrorParsing = false;
-
- // Check out the positional arguments to collect information about them.
- unsigned NumPositionalRequired = 0;
-
- // Determine whether or not there are an unlimited number of positionals
- bool HasUnlimitedPositionals = false;
-
- Option *ConsumeAfterOpt = 0;
- if (!PositionalOpts.empty()) {
- if (PositionalOpts[0]->getNumOccurrencesFlag() == cl::ConsumeAfter) {
- assert(PositionalOpts.size() > 1 &&
- "Cannot specify cl::ConsumeAfter without a positional argument!");
- ConsumeAfterOpt = PositionalOpts[0];
- }
-
- // Calculate how many positional values are _required_.
- bool UnboundedFound = false;
- for (size_t i = ConsumeAfterOpt != 0, e = PositionalOpts.size();
- i != e; ++i) {
- Option *Opt = PositionalOpts[i];
- if (RequiresValue(Opt))
- ++NumPositionalRequired;
- else if (ConsumeAfterOpt) {
- // ConsumeAfter cannot be combined with "optional" positional options
- // unless there is only one positional argument...
- if (PositionalOpts.size() > 2)
- ErrorParsing |=
- Opt->error(" error - this positional option will never be matched, "
- "because it does not Require a value, and a "
- "cl::ConsumeAfter option is active!");
- } else if (UnboundedFound && !Opt->ArgStr[0]) {
- // This option does not "require" a value... Make sure this option is
- // not specified after an option that eats all extra arguments, or this
- // one will never get any!
- //
- ErrorParsing |= Opt->error(" error - option can never match, because "
- "another positional argument will match an "
- "unbounded number of values, and this option"
- " does not require a value!");
- }
- UnboundedFound |= EatsUnboundedNumberOfValues(Opt);
- }
- HasUnlimitedPositionals = UnboundedFound || ConsumeAfterOpt;
- }
-
- // PositionalVals - A vector of "positional" arguments we accumulate into
- // the process at the end...
- //
- std::vector<std::pair<std::string,unsigned> > PositionalVals;
-
- // If the program has named positional arguments, and the name has been run
- // across, keep track of which positional argument was named. Otherwise put
- // the positional args into the PositionalVals list...
- Option *ActivePositionalArg = 0;
-
- // Loop over all of the arguments... processing them.
- bool DashDashFound = false; // Have we read '--'?
- for (int i = 1; i < argc; ++i) {
- Option *Handler = 0;
- const char *Value = 0;
- const char *ArgName = "";
-
- // If the option list changed, this means that some command line
- // option has just been registered or deregistered. This can occur in
- // response to things like -load, etc. If this happens, rescan the options.
- if (OptionListChanged) {
- PositionalOpts.clear();
- SinkOpts.clear();
- Opts.clear();
- GetOptionInfo(PositionalOpts, SinkOpts, Opts);
- OptionListChanged = false;
- }
-
- // Check to see if this is a positional argument. This argument is
- // considered to be positional if it doesn't start with '-', if it is "-"
- // itself, or if we have seen "--" already.
- //
- if (argv[i][0] != '-' || argv[i][1] == 0 || DashDashFound) {
- // Positional argument!
- if (ActivePositionalArg) {
- ProvidePositionalOption(ActivePositionalArg, argv[i], i);
- continue; // We are done!
- } else if (!PositionalOpts.empty()) {
- PositionalVals.push_back(std::make_pair(argv[i],i));
-
- // All of the positional arguments have been fulfulled, give the rest to
- // the consume after option... if it's specified...
- //
- if (PositionalVals.size() >= NumPositionalRequired &&
- ConsumeAfterOpt != 0) {
- for (++i; i < argc; ++i)
- PositionalVals.push_back(std::make_pair(argv[i],i));
- break; // Handle outside of the argument processing loop...
- }
-
- // Delay processing positional arguments until the end...
- continue;
- }
- } else if (argv[i][0] == '-' && argv[i][1] == '-' && argv[i][2] == 0 &&
- !DashDashFound) {
- DashDashFound = true; // This is the mythical "--"?
- continue; // Don't try to process it as an argument itself.
- } else if (ActivePositionalArg &&
- (ActivePositionalArg->getMiscFlags() & PositionalEatsArgs)) {
- // If there is a positional argument eating options, check to see if this
- // option is another positional argument. If so, treat it as an argument,
- // otherwise feed it to the eating positional.
- ArgName = argv[i]+1;
- Handler = LookupOption(ArgName, Value, Opts);
- if (!Handler || Handler->getFormattingFlag() != cl::Positional) {
- ProvidePositionalOption(ActivePositionalArg, argv[i], i);
- continue; // We are done!
- }
-
- } else { // We start with a '-', must be an argument...
- ArgName = argv[i]+1;
- Handler = LookupOption(ArgName, Value, Opts);
-
- // Check to see if this "option" is really a prefixed or grouped argument.
- if (Handler == 0) {
- std::string RealName(ArgName);
- if (RealName.size() > 1) {
- size_t Length = 0;
- Option *PGOpt = getOptionPred(RealName, Length, isPrefixedOrGrouping,
- Opts);
-
- // If the option is a prefixed option, then the value is simply the
- // rest of the name... so fall through to later processing, by
- // setting up the argument name flags and value fields.
- //
- if (PGOpt && PGOpt->getFormattingFlag() == cl::Prefix) {
- Value = ArgName+Length;
- assert(Opts.find(std::string(ArgName, Value)) != Opts.end() &&
- Opts.find(std::string(ArgName, Value))->second == PGOpt);
- Handler = PGOpt;
- } else if (PGOpt) {
- // This must be a grouped option... handle them now.
- assert(isGrouping(PGOpt) && "Broken getOptionPred!");
-
- do {
- // Move current arg name out of RealName into RealArgName...
- std::string RealArgName(RealName.begin(),
- RealName.begin() + Length);
- RealName.erase(RealName.begin(), RealName.begin() + Length);
-
- // Because ValueRequired is an invalid flag for grouped arguments,
- // we don't need to pass argc/argv in...
- //
- assert(PGOpt->getValueExpectedFlag() != cl::ValueRequired &&
- "Option can not be cl::Grouping AND cl::ValueRequired!");
- int Dummy;
- ErrorParsing |= ProvideOption(PGOpt, RealArgName.c_str(),
- 0, 0, 0, Dummy);
-
- // Get the next grouping option...
- PGOpt = getOptionPred(RealName, Length, isGrouping, Opts);
- } while (PGOpt && Length != RealName.size());
-
- Handler = PGOpt; // Ate all of the options.
- }
- }
- }
- }
-
- if (Handler == 0) {
- if (SinkOpts.empty()) {
- cerr << ProgramName << ": Unknown command line argument '"
- << argv[i] << "'. Try: '" << argv[0] << " --help'\n";
- ErrorParsing = true;
- } else {
- for (std::vector<Option*>::iterator I = SinkOpts.begin(),
- E = SinkOpts.end(); I != E ; ++I)
- (*I)->addOccurrence(i, "", argv[i]);
- }
- continue;
- }
-
- // Check to see if this option accepts a comma separated list of values. If
- // it does, we have to split up the value into multiple values...
- if (Value && Handler->getMiscFlags() & CommaSeparated) {
- std::string Val(Value);
- std::string::size_type Pos = Val.find(',');
-
- while (Pos != std::string::npos) {
- // Process the portion before the comma...
- ErrorParsing |= ProvideOption(Handler, ArgName,
- std::string(Val.begin(),
- Val.begin()+Pos).c_str(),
- argc, argv, i);
- // Erase the portion before the comma, AND the comma...
- Val.erase(Val.begin(), Val.begin()+Pos+1);
- Value += Pos+1; // Increment the original value pointer as well...
-
- // Check for another comma...
- Pos = Val.find(',');
- }
- }
-
- // If this is a named positional argument, just remember that it is the
- // active one...
- if (Handler->getFormattingFlag() == cl::Positional)
- ActivePositionalArg = Handler;
- else
- ErrorParsing |= ProvideOption(Handler, ArgName, Value, argc, argv, i);
- }
-
- // Check and handle positional arguments now...
- if (NumPositionalRequired > PositionalVals.size()) {
- cerr << ProgramName
- << ": Not enough positional command line arguments specified!\n"
- << "Must specify at least " << NumPositionalRequired
- << " positional arguments: See: " << argv[0] << " --help\n";
-
- ErrorParsing = true;
- } else if (!HasUnlimitedPositionals
- && PositionalVals.size() > PositionalOpts.size()) {
- cerr << ProgramName
- << ": Too many positional arguments specified!\n"
- << "Can specify at most " << PositionalOpts.size()
- << " positional arguments: See: " << argv[0] << " --help\n";
- ErrorParsing = true;
-
- } else if (ConsumeAfterOpt == 0) {
- // Positional args have already been handled if ConsumeAfter is specified...
- unsigned ValNo = 0, NumVals = static_cast<unsigned>(PositionalVals.size());
- for (size_t i = 0, e = PositionalOpts.size(); i != e; ++i) {
- if (RequiresValue(PositionalOpts[i])) {
- ProvidePositionalOption(PositionalOpts[i], PositionalVals[ValNo].first,
- PositionalVals[ValNo].second);
- ValNo++;
- --NumPositionalRequired; // We fulfilled our duty...
- }
-
- // If we _can_ give this option more arguments, do so now, as long as we
- // do not give it values that others need. 'Done' controls whether the
- // option even _WANTS_ any more.
- //
- bool Done = PositionalOpts[i]->getNumOccurrencesFlag() == cl::Required;
- while (NumVals-ValNo > NumPositionalRequired && !Done) {
- switch (PositionalOpts[i]->getNumOccurrencesFlag()) {
- case cl::Optional:
- Done = true; // Optional arguments want _at most_ one value
- // FALL THROUGH
- case cl::ZeroOrMore: // Zero or more will take all they can get...
- case cl::OneOrMore: // One or more will take all they can get...
- ProvidePositionalOption(PositionalOpts[i],
- PositionalVals[ValNo].first,
- PositionalVals[ValNo].second);
- ValNo++;
- break;
- default:
- assert(0 && "Internal error, unexpected NumOccurrences flag in "
- "positional argument processing!");
- }
- }
- }
- } else {
- assert(ConsumeAfterOpt && NumPositionalRequired <= PositionalVals.size());
- unsigned ValNo = 0;
- for (size_t j = 1, e = PositionalOpts.size(); j != e; ++j)
- if (RequiresValue(PositionalOpts[j])) {
- ErrorParsing |= ProvidePositionalOption(PositionalOpts[j],
- PositionalVals[ValNo].first,
- PositionalVals[ValNo].second);
- ValNo++;
- }
-
- // Handle the case where there is just one positional option, and it's
- // optional. In this case, we want to give JUST THE FIRST option to the
- // positional option and keep the rest for the consume after. The above
- // loop would have assigned no values to positional options in this case.
- //
- if (PositionalOpts.size() == 2 && ValNo == 0 && !PositionalVals.empty()) {
- ErrorParsing |= ProvidePositionalOption(PositionalOpts[1],
- PositionalVals[ValNo].first,
- PositionalVals[ValNo].second);
- ValNo++;
- }
-
- // Handle over all of the rest of the arguments to the
- // cl::ConsumeAfter command line option...
- for (; ValNo != PositionalVals.size(); ++ValNo)
- ErrorParsing |= ProvidePositionalOption(ConsumeAfterOpt,
- PositionalVals[ValNo].first,
- PositionalVals[ValNo].second);
- }
-
- // Loop over args and make sure all required args are specified!
- for (std::map<std::string, Option*>::iterator I = Opts.begin(),
- E = Opts.end(); I != E; ++I) {
- switch (I->second->getNumOccurrencesFlag()) {
- case Required:
- case OneOrMore:
- if (I->second->getNumOccurrences() == 0) {
- I->second->error(" must be specified at least once!");
- ErrorParsing = true;
- }
- // Fall through
- default:
- break;
- }
- }
-
- // Free all of the memory allocated to the map. Command line options may only
- // be processed once!
- Opts.clear();
- PositionalOpts.clear();
- MoreHelp->clear();
-
- // Free the memory allocated by ExpandResponseFiles.
- if (ReadResponseFiles) {
- // Free all the strdup()ed strings.
- for (std::vector<char*>::iterator i = newArgv.begin(), e = newArgv.end();
- i != e; ++i)
- free (*i);
- }
-
- // If we had an error processing our arguments, don't let the program execute
- if (ErrorParsing) exit(1);
-}
-
-//===----------------------------------------------------------------------===//
-// Option Base class implementation
-//
-
-bool Option::error(std::string Message, const char *ArgName) {
- if (ArgName == 0) ArgName = ArgStr;
- if (ArgName[0] == 0)
- cerr << HelpStr; // Be nice for positional arguments
- else
- cerr << ProgramName << ": for the -" << ArgName;
-
- cerr << " option: " << Message << "\n";
- return true;
-}
-
-bool Option::addOccurrence(unsigned pos, const char *ArgName,
- const std::string &Value) {
- NumOccurrences++; // Increment the number of times we have been seen
-
- switch (getNumOccurrencesFlag()) {
- case Optional:
- if (NumOccurrences > 1)
- return error(": may only occur zero or one times!", ArgName);
- break;
- case Required:
- if (NumOccurrences > 1)
- return error(": must occur exactly one time!", ArgName);
- // Fall through
- case OneOrMore:
- case ZeroOrMore:
- case ConsumeAfter: break;
- default: return error(": bad num occurrences flag value!");
- }
-
- return handleOccurrence(pos, ArgName, Value);
-}
-
-
-// getValueStr - Get the value description string, using "DefaultMsg" if nothing
-// has been specified yet.
-//
-static const char *getValueStr(const Option &O, const char *DefaultMsg) {
- if (O.ValueStr[0] == 0) return DefaultMsg;
- return O.ValueStr;
-}
-
-//===----------------------------------------------------------------------===//
-// cl::alias class implementation
-//
-
-// Return the width of the option tag for printing...
-size_t alias::getOptionWidth() const {
- return std::strlen(ArgStr)+6;
-}
-
-// Print out the option for the alias.
-void alias::printOptionInfo(size_t GlobalWidth) const {
- size_t L = std::strlen(ArgStr);
- cout << " -" << ArgStr << std::string(GlobalWidth-L-6, ' ') << " - "
- << HelpStr << "\n";
-}
-
-
-
-//===----------------------------------------------------------------------===//
-// Parser Implementation code...
-//
-
-// basic_parser implementation
-//
-
-// Return the width of the option tag for printing...
-size_t basic_parser_impl::getOptionWidth(const Option &O) const {
- size_t Len = std::strlen(O.ArgStr);
- if (const char *ValName = getValueName())
- Len += std::strlen(getValueStr(O, ValName))+3;
-
- return Len + 6;
-}
-
-// printOptionInfo - Print out information about this option. The
-// to-be-maintained width is specified.
-//
-void basic_parser_impl::printOptionInfo(const Option &O,
- size_t GlobalWidth) const {
- cout << " -" << O.ArgStr;
-
- if (const char *ValName = getValueName())
- cout << "=<" << getValueStr(O, ValName) << ">";
-
- cout << std::string(GlobalWidth-getOptionWidth(O), ' ') << " - "
- << O.HelpStr << "\n";
-}
-
-
-
-
-// parser<bool> implementation
-//
-bool parser<bool>::parse(Option &O, const char *ArgName,
- const std::string &Arg, bool &Value) {
- if (Arg == "" || Arg == "true" || Arg == "TRUE" || Arg == "True" ||
- Arg == "1") {
- Value = true;
- } else if (Arg == "false" || Arg == "FALSE" || Arg == "False" || Arg == "0") {
- Value = false;
- } else {
- return O.error(": '" + Arg +
- "' is invalid value for boolean argument! Try 0 or 1");
- }
- return false;
-}
-
-// parser<boolOrDefault> implementation
-//
-bool parser<boolOrDefault>::parse(Option &O, const char *ArgName,
- const std::string &Arg, boolOrDefault &Value) {
- if (Arg == "" || Arg == "true" || Arg == "TRUE" || Arg == "True" ||
- Arg == "1") {
- Value = BOU_TRUE;
- } else if (Arg == "false" || Arg == "FALSE" || Arg == "False" || Arg == "0") {
- Value = BOU_FALSE;
- } else {
- return O.error(": '" + Arg +
- "' is invalid value for boolean argument! Try 0 or 1");
- }
- return false;
-}
-
-// parser<int> implementation
-//
-bool parser<int>::parse(Option &O, const char *ArgName,
- const std::string &Arg, int &Value) {
- char *End;
- Value = (int)strtol(Arg.c_str(), &End, 0);
- if (*End != 0)
- return O.error(": '" + Arg + "' value invalid for integer argument!");
- return false;
-}
-
-// parser<unsigned> implementation
-//
-bool parser<unsigned>::parse(Option &O, const char *ArgName,
- const std::string &Arg, unsigned &Value) {
- char *End;
- errno = 0;
- unsigned long V = strtoul(Arg.c_str(), &End, 0);
- Value = (unsigned)V;
- if (((V == ULONG_MAX) && (errno == ERANGE))
- || (*End != 0)
- || (Value != V))
- return O.error(": '" + Arg + "' value invalid for uint argument!");
- return false;
-}
-
-// parser<double>/parser<float> implementation
-//
-static bool parseDouble(Option &O, const std::string &Arg, double &Value) {
- const char *ArgStart = Arg.c_str();
- char *End;
- Value = strtod(ArgStart, &End);
- if (*End != 0)
- return O.error(": '" +Arg+ "' value invalid for floating point argument!");
- return false;
-}
-
-bool parser<double>::parse(Option &O, const char *AN,
- const std::string &Arg, double &Val) {
- return parseDouble(O, Arg, Val);
-}
-
-bool parser<float>::parse(Option &O, const char *AN,
- const std::string &Arg, float &Val) {
- double dVal;
- if (parseDouble(O, Arg, dVal))
- return true;
- Val = (float)dVal;
- return false;
-}
-
-
-
-// generic_parser_base implementation
-//
-
-// findOption - Return the option number corresponding to the specified
-// argument string. If the option is not found, getNumOptions() is returned.
-//
-unsigned generic_parser_base::findOption(const char *Name) {
- unsigned i = 0, e = getNumOptions();
- std::string N(Name);
-
- while (i != e)
- if (getOption(i) == N)
- return i;
- else
- ++i;
- return e;
-}
-
-
-// Return the width of the option tag for printing...
-size_t generic_parser_base::getOptionWidth(const Option &O) const {
- if (O.hasArgStr()) {
- size_t Size = std::strlen(O.ArgStr)+6;
- for (unsigned i = 0, e = getNumOptions(); i != e; ++i)
- Size = std::max(Size, std::strlen(getOption(i))+8);
- return Size;
- } else {
- size_t BaseSize = 0;
- for (unsigned i = 0, e = getNumOptions(); i != e; ++i)
- BaseSize = std::max(BaseSize, std::strlen(getOption(i))+8);
- return BaseSize;
- }
-}
-
-// printOptionInfo - Print out information about this option. The
-// to-be-maintained width is specified.
-//
-void generic_parser_base::printOptionInfo(const Option &O,
- size_t GlobalWidth) const {
- if (O.hasArgStr()) {
- size_t L = std::strlen(O.ArgStr);
- cout << " -" << O.ArgStr << std::string(GlobalWidth-L-6, ' ')
- << " - " << O.HelpStr << "\n";
-
- for (unsigned i = 0, e = getNumOptions(); i != e; ++i) {
- size_t NumSpaces = GlobalWidth-strlen(getOption(i))-8;
- cout << " =" << getOption(i) << std::string(NumSpaces, ' ')
- << " - " << getDescription(i) << "\n";
- }
- } else {
- if (O.HelpStr[0])
- cout << " " << O.HelpStr << "\n";
- for (unsigned i = 0, e = getNumOptions(); i != e; ++i) {
- size_t L = std::strlen(getOption(i));
- cout << " -" << getOption(i) << std::string(GlobalWidth-L-8, ' ')
- << " - " << getDescription(i) << "\n";
- }
- }
-}
-
-
-//===----------------------------------------------------------------------===//
-// --help and --help-hidden option implementation
-//
-
-namespace {
-
-class HelpPrinter {
- size_t MaxArgLen;
- const Option *EmptyArg;
- const bool ShowHidden;
-
- // isHidden/isReallyHidden - Predicates to be used to filter down arg lists.
- inline static bool isHidden(std::pair<std::string, Option *> &OptPair) {
- return OptPair.second->getOptionHiddenFlag() >= Hidden;
- }
- inline static bool isReallyHidden(std::pair<std::string, Option *> &OptPair) {
- return OptPair.second->getOptionHiddenFlag() == ReallyHidden;
- }
-
-public:
- explicit HelpPrinter(bool showHidden) : ShowHidden(showHidden) {
- EmptyArg = 0;
- }
-
- void operator=(bool Value) {
- if (Value == false) return;
-
- // Get all the options.
- std::vector<Option*> PositionalOpts;
- std::vector<Option*> SinkOpts;
- std::map<std::string, Option*> OptMap;
- GetOptionInfo(PositionalOpts, SinkOpts, OptMap);
-
- // Copy Options into a vector so we can sort them as we like...
- std::vector<std::pair<std::string, Option*> > Opts;
- copy(OptMap.begin(), OptMap.end(), std::back_inserter(Opts));
-
- // Eliminate Hidden or ReallyHidden arguments, depending on ShowHidden
- Opts.erase(std::remove_if(Opts.begin(), Opts.end(),
- std::ptr_fun(ShowHidden ? isReallyHidden : isHidden)),
- Opts.end());
-
- // Eliminate duplicate entries in table (from enum flags options, f.e.)
- { // Give OptionSet a scope
- std::set<Option*> OptionSet;
- for (unsigned i = 0; i != Opts.size(); ++i)
- if (OptionSet.count(Opts[i].second) == 0)
- OptionSet.insert(Opts[i].second); // Add new entry to set
- else
- Opts.erase(Opts.begin()+i--); // Erase duplicate
- }
-
- if (ProgramOverview)
- cout << "OVERVIEW: " << ProgramOverview << "\n";
-
- cout << "USAGE: " << ProgramName << " [options]";
-
- // Print out the positional options.
- Option *CAOpt = 0; // The cl::ConsumeAfter option, if it exists...
- if (!PositionalOpts.empty() &&
- PositionalOpts[0]->getNumOccurrencesFlag() == ConsumeAfter)
- CAOpt = PositionalOpts[0];
-
- for (size_t i = CAOpt != 0, e = PositionalOpts.size(); i != e; ++i) {
- if (PositionalOpts[i]->ArgStr[0])
- cout << " --" << PositionalOpts[i]->ArgStr;
- cout << " " << PositionalOpts[i]->HelpStr;
- }
-
- // Print the consume after option info if it exists...
- if (CAOpt) cout << " " << CAOpt->HelpStr;
-
- cout << "\n\n";
-
- // Compute the maximum argument length...
- MaxArgLen = 0;
- for (size_t i = 0, e = Opts.size(); i != e; ++i)
- MaxArgLen = std::max(MaxArgLen, Opts[i].second->getOptionWidth());
-
- cout << "OPTIONS:\n";
- for (size_t i = 0, e = Opts.size(); i != e; ++i)
- Opts[i].second->printOptionInfo(MaxArgLen);
-
- // Print any extra help the user has declared.
- for (std::vector<const char *>::iterator I = MoreHelp->begin(),
- E = MoreHelp->end(); I != E; ++I)
- cout << *I;
- MoreHelp->clear();
-
- // Halt the program since help information was printed
- exit(1);
- }
-};
-} // End anonymous namespace
-
-// Define the two HelpPrinter instances that are used to print out help, or
-// help-hidden...
-//
-static HelpPrinter NormalPrinter(false);
-static HelpPrinter HiddenPrinter(true);
-
-static cl::opt<HelpPrinter, true, parser<bool> >
-HOp("help", cl::desc("Display available options (--help-hidden for more)"),
- cl::location(NormalPrinter), cl::ValueDisallowed);
-
-static cl::opt<HelpPrinter, true, parser<bool> >
-HHOp("help-hidden", cl::desc("Display all available options"),
- cl::location(HiddenPrinter), cl::Hidden, cl::ValueDisallowed);
-
-static void (*OverrideVersionPrinter)() = 0;
-
-namespace {
-class VersionPrinter {
-public:
- void print() {
- cout << "Low Level Virtual Machine (http://llvm.org/):\n";
- cout << " " << PACKAGE_NAME << " version " << PACKAGE_VERSION;
-#ifdef LLVM_VERSION_INFO
- cout << LLVM_VERSION_INFO;
-#endif
- cout << "\n ";
-#ifndef __OPTIMIZE__
- cout << "DEBUG build";
-#else
- cout << "Optimized build";
-#endif
-#ifndef NDEBUG
- cout << " with assertions";
-#endif
- cout << ".\n";
- }
- void operator=(bool OptionWasSpecified) {
- if (OptionWasSpecified) {
- if (OverrideVersionPrinter == 0) {
- print();
- exit(1);
- } else {
- (*OverrideVersionPrinter)();
- exit(1);
- }
- }
- }
-};
-} // End anonymous namespace
-
-
-// Define the --version option that prints out the LLVM version for the tool
-static VersionPrinter VersionPrinterInstance;
-
-static cl::opt<VersionPrinter, true, parser<bool> >
-VersOp("version", cl::desc("Display the version of this program"),
- cl::location(VersionPrinterInstance), cl::ValueDisallowed);
-
-// Utility function for printing the help message.
-void cl::PrintHelpMessage() {
- // This looks weird, but it actually prints the help message. The
- // NormalPrinter variable is a HelpPrinter and the help gets printed when
- // its operator= is invoked. That's because the "normal" usages of the
- // help printer is to be assigned true/false depending on whether the
- // --help option was given or not. Since we're circumventing that we have
- // to make it look like --help was given, so we assign true.
- NormalPrinter = true;
-}
-
-/// Utility function for printing version number.
-void cl::PrintVersionMessage() {
- VersionPrinterInstance.print();
-}
-
-void cl::SetVersionPrinter(void (*func)()) {
- OverrideVersionPrinter = func;
-}
diff --git a/release_23/lib/Support/ConstantRange.cpp b/release_23/lib/Support/ConstantRange.cpp
deleted file mode 100644
index 4a74d4211638..000000000000
--- a/release_23/lib/Support/ConstantRange.cpp
+++ /dev/null
@@ -1,474 +0,0 @@
-//===-- ConstantRange.cpp - ConstantRange implementation ------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// Represent a range of possible values that may occur when the program is run
-// for an integral value. This keeps track of a lower and upper bound for the
-// constant, which MAY wrap around the end of the numeric range. To do this, it
-// keeps track of a [lower, upper) bound, which specifies an interval just like
-// STL iterators. When used with boolean values, the following are important
-// ranges (other integral ranges use min/max values for special range values):
-//
-// [F, F) = {} = Empty set
-// [T, F) = {T}
-// [F, T) = {F}
-// [T, T) = {F, T} = Full set
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Support/ConstantRange.h"
-#include "llvm/Support/Streams.h"
-#include <ostream>
-using namespace llvm;
-
-/// Initialize a full (the default) or empty set for the specified type.
-///
-ConstantRange::ConstantRange(uint32_t BitWidth, bool Full) :
- Lower(BitWidth, 0), Upper(BitWidth, 0) {
- if (Full)
- Lower = Upper = APInt::getMaxValue(BitWidth);
- else
- Lower = Upper = APInt::getMinValue(BitWidth);
-}
-
-/// Initialize a range to hold the single specified value.
-///
-ConstantRange::ConstantRange(const APInt & V) : Lower(V), Upper(V + 1) { }
-
-ConstantRange::ConstantRange(const APInt &L, const APInt &U) :
- Lower(L), Upper(U) {
- assert(L.getBitWidth() == U.getBitWidth() &&
- "ConstantRange with unequal bit widths");
- assert((L != U || (L.isMaxValue() || L.isMinValue())) &&
- "Lower == Upper, but they aren't min or max value!");
-}
-
-/// isFullSet - Return true if this set contains all of the elements possible
-/// for this data-type
-bool ConstantRange::isFullSet() const {
- return Lower == Upper && Lower.isMaxValue();
-}
-
-/// isEmptySet - Return true if this set contains no members.
-///
-bool ConstantRange::isEmptySet() const {
- return Lower == Upper && Lower.isMinValue();
-}
-
-/// isWrappedSet - Return true if this set wraps around the top of the range,
-/// for example: [100, 8)
-///
-bool ConstantRange::isWrappedSet() const {
- return Lower.ugt(Upper);
-}
-
-/// getSetSize - Return the number of elements in this set.
-///
-APInt ConstantRange::getSetSize() const {
- if (isEmptySet())
- return APInt(getBitWidth(), 0);
- if (getBitWidth() == 1) {
- if (Lower != Upper) // One of T or F in the set...
- return APInt(2, 1);
- return APInt(2, 2); // Must be full set...
- }
-
- // Simply subtract the bounds...
- return Upper - Lower;
-}
-
-/// getUnsignedMax - Return the largest unsigned value contained in the
-/// ConstantRange.
-///
-APInt ConstantRange::getUnsignedMax() const {
- if (isFullSet() || isWrappedSet())
- return APInt::getMaxValue(getBitWidth());
- else
- return getUpper() - 1;
-}
-
-/// getUnsignedMin - Return the smallest unsigned value contained in the
-/// ConstantRange.
-///
-APInt ConstantRange::getUnsignedMin() const {
- if (isFullSet() || (isWrappedSet() && getUpper() != 0))
- return APInt::getMinValue(getBitWidth());
- else
- return getLower();
-}
-
-/// getSignedMax - Return the largest signed value contained in the
-/// ConstantRange.
-///
-APInt ConstantRange::getSignedMax() const {
- APInt SignedMax(APInt::getSignedMaxValue(getBitWidth()));
- if (!isWrappedSet()) {
- if (getLower().sle(getUpper() - 1))
- return getUpper() - 1;
- else
- return SignedMax;
- } else {
- if ((getUpper() - 1).slt(getLower())) {
- if (getLower() != SignedMax)
- return SignedMax;
- else
- return getUpper() - 1;
- } else {
- return getUpper() - 1;
- }
- }
-}
-
-/// getSignedMin - Return the smallest signed value contained in the
-/// ConstantRange.
-///
-APInt ConstantRange::getSignedMin() const {
- APInt SignedMin(APInt::getSignedMinValue(getBitWidth()));
- if (!isWrappedSet()) {
- if (getLower().sle(getUpper() - 1))
- return getLower();
- else
- return SignedMin;
- } else {
- if ((getUpper() - 1).slt(getLower())) {
- if (getUpper() != SignedMin)
- return SignedMin;
- else
- return getLower();
- } else {
- return getLower();
- }
- }
-}
-
-/// contains - Return true if the specified value is in the set.
-///
-bool ConstantRange::contains(const APInt &V) const {
- if (Lower == Upper)
- return isFullSet();
-
- if (!isWrappedSet())
- return Lower.ule(V) && V.ult(Upper);
- else
- return Lower.ule(V) || V.ult(Upper);
-}
-
-/// subtract - Subtract the specified constant from the endpoints of this
-/// constant range.
-ConstantRange ConstantRange::subtract(const APInt &Val) const {
- assert(Val.getBitWidth() == getBitWidth() && "Wrong bit width");
- // If the set is empty or full, don't modify the endpoints.
- if (Lower == Upper)
- return *this;
- return ConstantRange(Lower - Val, Upper - Val);
-}
-
-
-// intersect1Wrapped - This helper function is used to intersect two ranges when
-// it is known that LHS is wrapped and RHS isn't.
-//
-ConstantRange
-ConstantRange::intersect1Wrapped(const ConstantRange &LHS,
- const ConstantRange &RHS) {
- assert(LHS.isWrappedSet() && !RHS.isWrappedSet());
-
- // Check to see if we overlap on the Left side of RHS...
- //
- if (RHS.Lower.ult(LHS.Upper)) {
- // We do overlap on the left side of RHS, see if we overlap on the right of
- // RHS...
- if (RHS.Upper.ugt(LHS.Lower)) {
- // Ok, the result overlaps on both the left and right sides. See if the
- // resultant interval will be smaller if we wrap or not...
- //
- if (LHS.getSetSize().ult(RHS.getSetSize()))
- return LHS;
- else
- return RHS;
-
- } else {
- // No overlap on the right, just on the left.
- return ConstantRange(RHS.Lower, LHS.Upper);
- }
- } else {
- // We don't overlap on the left side of RHS, see if we overlap on the right
- // of RHS...
- if (RHS.Upper.ugt(LHS.Lower)) {
- // Simple overlap...
- return ConstantRange(LHS.Lower, RHS.Upper);
- } else {
- // No overlap...
- return ConstantRange(LHS.getBitWidth(), false);
- }
- }
-}
-
-/// intersectWith - Return the range that results from the intersection of this
-/// range with another range.
-///
-ConstantRange ConstantRange::intersectWith(const ConstantRange &CR) const {
- assert(getBitWidth() == CR.getBitWidth() &&
- "ConstantRange types don't agree!");
- // Handle common special cases
- if (isEmptySet() || CR.isFullSet())
- return *this;
- if (isFullSet() || CR.isEmptySet())
- return CR;
-
- if (!isWrappedSet()) {
- if (!CR.isWrappedSet()) {
- using namespace APIntOps;
- APInt L = umax(Lower, CR.Lower);
- APInt U = umin(Upper, CR.Upper);
-
- if (L.ult(U)) // If range isn't empty...
- return ConstantRange(L, U);
- else
- return ConstantRange(getBitWidth(), false);// Otherwise, empty set
- } else
- return intersect1Wrapped(CR, *this);
- } else { // We know "this" is wrapped...
- if (!CR.isWrappedSet())
- return intersect1Wrapped(*this, CR);
- else {
- // Both ranges are wrapped...
- using namespace APIntOps;
- APInt L = umax(Lower, CR.Lower);
- APInt U = umin(Upper, CR.Upper);
- return ConstantRange(L, U);
- }
- }
- return *this;
-}
-
-/// maximalIntersectWith - Return the range that results from the intersection
-/// of this range with another range. The resultant range is guaranteed to
-/// include all elements contained in both input ranges, and to have the
-/// smallest possible set size that does so. Because there may be two
-/// intersections with the same set size, A.maximalIntersectWith(B) might not
-/// be equal to B.maximalIntersect(A).
-ConstantRange ConstantRange::maximalIntersectWith(const ConstantRange &CR) const {
- assert(getBitWidth() == CR.getBitWidth() &&
- "ConstantRange types don't agree!");
-
- // Handle common cases.
- if ( isEmptySet() || CR.isFullSet()) return *this;
- if (CR.isEmptySet() || isFullSet()) return CR;
-
- if (!isWrappedSet() && CR.isWrappedSet())
- return CR.maximalIntersectWith(*this);
-
- if (!isWrappedSet() && !CR.isWrappedSet()) {
- if (Lower.ult(CR.Lower)) {
- if (Upper.ule(CR.Lower))
- return ConstantRange(getBitWidth(), false);
-
- if (Upper.ult(CR.Upper))
- return ConstantRange(CR.Lower, Upper);
-
- return CR;
- } else {
- if (Upper.ult(CR.Upper))
- return *this;
-
- if (Lower.ult(CR.Upper))
- return ConstantRange(Lower, CR.Upper);
-
- return ConstantRange(getBitWidth(), false);
- }
- }
-
- if (isWrappedSet() && !CR.isWrappedSet()) {
- if (CR.Lower.ult(Upper)) {
- if (CR.Upper.ult(Upper))
- return CR;
-
- if (CR.Upper.ult(Lower))
- return ConstantRange(CR.Lower, Upper);
-
- if (getSetSize().ult(CR.getSetSize()))
- return *this;
- else
- return CR;
- } else if (CR.Lower.ult(Lower)) {
- if (CR.Upper.ule(Lower))
- return ConstantRange(getBitWidth(), false);
-
- return ConstantRange(Lower, CR.Upper);
- }
- return CR;
- }
-
- if (CR.Upper.ult(Upper)) {
- if (CR.Lower.ult(Upper)) {
- if (getSetSize().ult(CR.getSetSize()))
- return *this;
- else
- return CR;
- }
-
- if (CR.Lower.ult(Lower))
- return ConstantRange(Lower, CR.Upper);
-
- return CR;
- } else if (CR.Upper.ult(Lower)) {
- if (CR.Lower.ult(Lower))
- return *this;
-
- return ConstantRange(CR.Lower, Upper);
- }
- if (getSetSize().ult(CR.getSetSize()))
- return *this;
- else
- return CR;
-}
-
-
-/// unionWith - Return the range that results from the union of this range with
-/// another range. The resultant range is guaranteed to include the elements of
-/// both sets, but may contain more. For example, [3, 9) union [12,15) is
-/// [3, 15), which includes 9, 10, and 11, which were not included in either
-/// set before.
-///
-ConstantRange ConstantRange::unionWith(const ConstantRange &CR) const {
- assert(getBitWidth() == CR.getBitWidth() &&
- "ConstantRange types don't agree!");
-
- if ( isFullSet() || CR.isEmptySet()) return *this;
- if (CR.isFullSet() || isEmptySet()) return CR;
-
- if (!isWrappedSet() && CR.isWrappedSet()) return CR.unionWith(*this);
-
- APInt L = Lower, U = Upper;
-
- if (!isWrappedSet() && !CR.isWrappedSet()) {
- if (CR.Lower.ult(L))
- L = CR.Lower;
-
- if (CR.Upper.ugt(U))
- U = CR.Upper;
- }
-
- if (isWrappedSet() && !CR.isWrappedSet()) {
- if ((CR.Lower.ult(Upper) && CR.Upper.ult(Upper)) ||
- (CR.Lower.ugt(Lower) && CR.Upper.ugt(Lower))) {
- return *this;
- }
-
- if (CR.Lower.ule(Upper) && Lower.ule(CR.Upper)) {
- return ConstantRange(getBitWidth());
- }
-
- if (CR.Lower.ule(Upper) && CR.Upper.ule(Lower)) {
- APInt d1 = CR.Upper - Upper, d2 = Lower - CR.Upper;
- if (d1.ult(d2)) {
- U = CR.Upper;
- } else {
- L = CR.Upper;
- }
- }
-
- if (Upper.ult(CR.Lower) && CR.Upper.ult(Lower)) {
- APInt d1 = CR.Lower - Upper, d2 = Lower - CR.Upper;
- if (d1.ult(d2)) {
- U = CR.Lower + 1;
- } else {
- L = CR.Upper - 1;
- }
- }
-
- if (Upper.ult(CR.Lower) && Lower.ult(CR.Upper)) {
- APInt d1 = CR.Lower - Upper, d2 = Lower - CR.Lower;
-
- if (d1.ult(d2)) {
- U = CR.Lower + 1;
- } else {
- L = CR.Lower;
- }
- }
- }
-
- if (isWrappedSet() && CR.isWrappedSet()) {
- if (Lower.ult(CR.Upper) || CR.Lower.ult(Upper))
- return ConstantRange(getBitWidth());
-
- if (CR.Upper.ugt(U)) {
- U = CR.Upper;
- }
-
- if (CR.Lower.ult(L)) {
- L = CR.Lower;
- }
-
- if (L == U) return ConstantRange(getBitWidth());
- }
-
- return ConstantRange(L, U);
-}
-
-/// zeroExtend - Return a new range in the specified integer type, which must
-/// be strictly larger than the current type. The returned range will
-/// correspond to the possible range of values as if the source range had been
-/// zero extended.
-ConstantRange ConstantRange::zeroExtend(uint32_t DstTySize) const {
- unsigned SrcTySize = getBitWidth();
- assert(SrcTySize < DstTySize && "Not a value extension");
- if (isFullSet())
- // Change a source full set into [0, 1 << 8*numbytes)
- return ConstantRange(APInt(DstTySize,0), APInt(DstTySize,1).shl(SrcTySize));
-
- APInt L = Lower; L.zext(DstTySize);
- APInt U = Upper; U.zext(DstTySize);
- return ConstantRange(L, U);
-}
-
-/// signExtend - Return a new range in the specified integer type, which must
-/// be strictly larger than the current type. The returned range will
-/// correspond to the possible range of values as if the source range had been
-/// sign extended.
-ConstantRange ConstantRange::signExtend(uint32_t DstTySize) const {
- unsigned SrcTySize = getBitWidth();
- assert(SrcTySize < DstTySize && "Not a value extension");
- if (isFullSet()) {
- return ConstantRange(APInt::getHighBitsSet(DstTySize,DstTySize-SrcTySize+1),
- APInt::getLowBitsSet(DstTySize, SrcTySize-1));
- }
-
- APInt L = Lower; L.sext(DstTySize);
- APInt U = Upper; U.sext(DstTySize);
- return ConstantRange(L, U);
-}
-
-/// truncate - Return a new range in the specified integer type, which must be
-/// strictly smaller than the current type. The returned range will
-/// correspond to the possible range of values as if the source range had been
-/// truncated to the specified type.
-ConstantRange ConstantRange::truncate(uint32_t DstTySize) const {
- unsigned SrcTySize = getBitWidth();
- assert(SrcTySize > DstTySize && "Not a value truncation");
- APInt Size(APInt::getLowBitsSet(SrcTySize, DstTySize));
- if (isFullSet() || getSetSize().ugt(Size))
- return ConstantRange(DstTySize);
-
- APInt L = Lower; L.trunc(DstTySize);
- APInt U = Upper; U.trunc(DstTySize);
- return ConstantRange(L, U);
-}
-
-/// print - Print out the bounds to a stream...
-///
-void ConstantRange::print(std::ostream &OS) const {
- OS << "[" << Lower.toStringSigned(10) << ","
- << Upper.toStringSigned(10) << " )";
-}
-
-/// dump - Allow printing from a debugger easily...
-///
-void ConstantRange::dump() const {
- print(cerr);
-}
diff --git a/release_23/lib/Support/Debug.cpp b/release_23/lib/Support/Debug.cpp
deleted file mode 100644
index a09cddf9022a..000000000000
--- a/release_23/lib/Support/Debug.cpp
+++ /dev/null
@@ -1,77 +0,0 @@
-//===-- Debug.cpp - An easy way to add debug output to your code ----------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements a handle way of adding debugging information to your
-// code, without it being enabled all of the time, and without having to add
-// command line options to enable it.
-//
-// In particular, just wrap your code with the DEBUG() macro, and it will be
-// enabled automatically if you specify '-debug' on the command-line.
-// Alternatively, you can also use the SET_DEBUG_TYPE("foo") macro to specify
-// that your debug code belongs to class "foo". Then, on the command line, you
-// can specify '-debug-only=foo' to enable JUST the debug information for the
-// foo class.
-//
-// When compiling in release mode, the -debug-* options and all code in DEBUG()
-// statements disappears, so it does not effect the runtime of the code.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Support/CommandLine.h"
-#include "llvm/Support/Debug.h"
-using namespace llvm;
-
-bool llvm::DebugFlag; // DebugFlag - Exported boolean set by the -debug option
-
-namespace {
-#ifndef NDEBUG
- // -debug - Command line option to enable the DEBUG statements in the passes.
- // This flag may only be enabled in debug builds.
- static cl::opt<bool, true>
- Debug("debug", cl::desc("Enable debug output"), cl::Hidden,
- cl::location(DebugFlag));
-
- static std::string CurrentDebugType;
- static struct DebugOnlyOpt {
- void operator=(const std::string &Val) const {
- DebugFlag |= !Val.empty();
- CurrentDebugType = Val;
- }
- } DebugOnlyOptLoc;
-
- static cl::opt<DebugOnlyOpt, true, cl::parser<std::string> >
- DebugOnly("debug-only", cl::desc("Enable a specific type of debug output"),
- cl::Hidden, cl::value_desc("debug string"),
- cl::location(DebugOnlyOptLoc), cl::ValueRequired);
-#endif
-}
-
-// isCurrentDebugType - Return true if the specified string is the debug type
-// specified on the command line, or if none was specified on the command line
-// with the -debug-only=X option.
-//
-bool llvm::isCurrentDebugType(const char *DebugType) {
-#ifndef NDEBUG
- return CurrentDebugType.empty() || DebugType == CurrentDebugType;
-#else
- return false;
-#endif
-}
-
-// getErrorOutputStream - Returns the error output stream (std::cerr). This
-// places the std::c* I/O streams into one .cpp file and relieves the whole
-// program from having to have hundreds of static c'tor/d'tors for them.
-//
-OStream &llvm::getErrorOutputStream(const char *DebugType) {
- static OStream cnoout(0);
- if (DebugFlag && isCurrentDebugType(DebugType))
- return cerr;
- else
- return cnoout;
-}
diff --git a/release_23/lib/Support/Dwarf.cpp b/release_23/lib/Support/Dwarf.cpp
deleted file mode 100644
index f3f183436ec9..000000000000
--- a/release_23/lib/Support/Dwarf.cpp
+++ /dev/null
@@ -1,583 +0,0 @@
-//===-- llvm/Support/Dwarf.cpp - Dwarf Framework ----------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains support for generic dwarf information.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Support/Dwarf.h"
-
-#include <cassert>
-
-namespace llvm {
-
-namespace dwarf {
-
-/// TagString - Return the string for the specified tag.
-///
-const char *TagString(unsigned Tag) {
- switch(Tag) {
- case DW_TAG_array_type: return "TAG_array_type";
- case DW_TAG_class_type: return "TAG_class_type";
- case DW_TAG_entry_point: return "TAG_entry_point";
- case DW_TAG_enumeration_type: return "TAG_enumeration_type";
- case DW_TAG_formal_parameter: return "TAG_formal_parameter";
- case DW_TAG_imported_declaration: return "TAG_imported_declaration";
- case DW_TAG_label: return "TAG_label";
- case DW_TAG_lexical_block: return "TAG_lexical_block";
- case DW_TAG_member: return "TAG_member";
- case DW_TAG_pointer_type: return "TAG_pointer_type";
- case DW_TAG_reference_type: return "TAG_reference_type";
- case DW_TAG_compile_unit: return "TAG_compile_unit";
- case DW_TAG_string_type: return "TAG_string_type";
- case DW_TAG_structure_type: return "TAG_structure_type";
- case DW_TAG_subroutine_type: return "TAG_subroutine_type";
- case DW_TAG_typedef: return "TAG_typedef";
- case DW_TAG_union_type: return "TAG_union_type";
- case DW_TAG_unspecified_parameters: return "TAG_unspecified_parameters";
- case DW_TAG_variant: return "TAG_variant";
- case DW_TAG_common_block: return "TAG_common_block";
- case DW_TAG_common_inclusion: return "TAG_common_inclusion";
- case DW_TAG_inheritance: return "TAG_inheritance";
- case DW_TAG_inlined_subroutine: return "TAG_inlined_subroutine";
- case DW_TAG_module: return "TAG_module";
- case DW_TAG_ptr_to_member_type: return "TAG_ptr_to_member_type";
- case DW_TAG_set_type: return "TAG_set_type";
- case DW_TAG_subrange_type: return "TAG_subrange_type";
- case DW_TAG_with_stmt: return "TAG_with_stmt";
- case DW_TAG_access_declaration: return "TAG_access_declaration";
- case DW_TAG_base_type: return "TAG_base_type";
- case DW_TAG_catch_block: return "TAG_catch_block";
- case DW_TAG_const_type: return "TAG_const_type";
- case DW_TAG_constant: return "TAG_constant";
- case DW_TAG_enumerator: return "TAG_enumerator";
- case DW_TAG_file_type: return "TAG_file_type";
- case DW_TAG_friend: return "TAG_friend";
- case DW_TAG_namelist: return "TAG_namelist";
- case DW_TAG_namelist_item: return "TAG_namelist_item";
- case DW_TAG_packed_type: return "TAG_packed_type";
- case DW_TAG_subprogram: return "TAG_subprogram";
- case DW_TAG_template_type_parameter: return "TAG_template_type_parameter";
- case DW_TAG_template_value_parameter: return "TAG_template_value_parameter";
- case DW_TAG_thrown_type: return "TAG_thrown_type";
- case DW_TAG_try_block: return "TAG_try_block";
- case DW_TAG_variant_part: return "TAG_variant_part";
- case DW_TAG_variable: return "TAG_variable";
- case DW_TAG_volatile_type: return "TAG_volatile_type";
- case DW_TAG_dwarf_procedure: return "TAG_dwarf_procedure";
- case DW_TAG_restrict_type: return "TAG_restrict_type";
- case DW_TAG_interface_type: return "TAG_interface_type";
- case DW_TAG_namespace: return "TAG_namespace";
- case DW_TAG_imported_module: return "TAG_imported_module";
- case DW_TAG_unspecified_type: return "TAG_unspecified_type";
- case DW_TAG_partial_unit: return "TAG_partial_unit";
- case DW_TAG_imported_unit: return "TAG_imported_unit";
- case DW_TAG_condition: return "TAG_condition";
- case DW_TAG_shared_type: return "TAG_shared_type";
- case DW_TAG_lo_user: return "TAG_lo_user";
- case DW_TAG_hi_user: return "TAG_hi_user";
- }
- assert(0 && "Unknown Dwarf Tag");
- return "";
-}
-
-/// ChildrenString - Return the string for the specified children flag.
-///
-const char *ChildrenString(unsigned Children) {
- switch(Children) {
- case DW_CHILDREN_no: return "CHILDREN_no";
- case DW_CHILDREN_yes: return "CHILDREN_yes";
- }
- assert(0 && "Unknown Dwarf ChildrenFlag");
- return "";
-}
-
-/// AttributeString - Return the string for the specified attribute.
-///
-const char *AttributeString(unsigned Attribute) {
- switch(Attribute) {
- case DW_AT_sibling: return "AT_sibling";
- case DW_AT_location: return "AT_location";
- case DW_AT_name: return "AT_name";
- case DW_AT_ordering: return "AT_ordering";
- case DW_AT_byte_size: return "AT_byte_size";
- case DW_AT_bit_offset: return "AT_bit_offset";
- case DW_AT_bit_size: return "AT_bit_size";
- case DW_AT_stmt_list: return "AT_stmt_list";
- case DW_AT_low_pc: return "AT_low_pc";
- case DW_AT_high_pc: return "AT_high_pc";
- case DW_AT_language: return "AT_language";
- case DW_AT_discr: return "AT_discr";
- case DW_AT_discr_value: return "AT_discr_value";
- case DW_AT_visibility: return "AT_visibility";
- case DW_AT_import: return "AT_import";
- case DW_AT_string_length: return "AT_string_length";
- case DW_AT_common_reference: return "AT_common_reference";
- case DW_AT_comp_dir: return "AT_comp_dir";
- case DW_AT_const_value: return "AT_const_value";
- case DW_AT_containing_type: return "AT_containing_type";
- case DW_AT_default_value: return "AT_default_value";
- case DW_AT_inline: return "AT_inline";
- case DW_AT_is_optional: return "AT_is_optional";
- case DW_AT_lower_bound: return "AT_lower_bound";
- case DW_AT_producer: return "AT_producer";
- case DW_AT_prototyped: return "AT_prototyped";
- case DW_AT_return_addr: return "AT_return_addr";
- case DW_AT_start_scope: return "AT_start_scope";
- case DW_AT_bit_stride: return "AT_bit_stride";
- case DW_AT_upper_bound: return "AT_upper_bound";
- case DW_AT_abstract_origin: return "AT_abstract_origin";
- case DW_AT_accessibility: return "AT_accessibility";
- case DW_AT_address_class: return "AT_address_class";
- case DW_AT_artificial: return "AT_artificial";
- case DW_AT_base_types: return "AT_base_types";
- case DW_AT_calling_convention: return "AT_calling_convention";
- case DW_AT_count: return "AT_count";
- case DW_AT_data_member_location: return "AT_data_member_location";
- case DW_AT_decl_column: return "AT_decl_column";
- case DW_AT_decl_file: return "AT_decl_file";
- case DW_AT_decl_line: return "AT_decl_line";
- case DW_AT_declaration: return "AT_declaration";
- case DW_AT_discr_list: return "AT_discr_list";
- case DW_AT_encoding: return "AT_encoding";
- case DW_AT_external: return "AT_external";
- case DW_AT_frame_base: return "AT_frame_base";
- case DW_AT_friend: return "AT_friend";
- case DW_AT_identifier_case: return "AT_identifier_case";
- case DW_AT_macro_info: return "AT_macro_info";
- case DW_AT_namelist_item: return "AT_namelist_item";
- case DW_AT_priority: return "AT_priority";
- case DW_AT_segment: return "AT_segment";
- case DW_AT_specification: return "AT_specification";
- case DW_AT_static_link: return "AT_static_link";
- case DW_AT_type: return "AT_type";
- case DW_AT_use_location: return "AT_use_location";
- case DW_AT_variable_parameter: return "AT_variable_parameter";
- case DW_AT_virtuality: return "AT_virtuality";
- case DW_AT_vtable_elem_location: return "AT_vtable_elem_location";
- case DW_AT_allocated: return "AT_allocated";
- case DW_AT_associated: return "AT_associated";
- case DW_AT_data_location: return "AT_data_location";
- case DW_AT_byte_stride: return "AT_byte_stride";
- case DW_AT_entry_pc: return "AT_entry_pc";
- case DW_AT_use_UTF8: return "AT_use_UTF8";
- case DW_AT_extension: return "AT_extension";
- case DW_AT_ranges: return "AT_ranges";
- case DW_AT_trampoline: return "AT_trampoline";
- case DW_AT_call_column: return "AT_call_column";
- case DW_AT_call_file: return "AT_call_file";
- case DW_AT_call_line: return "AT_call_line";
- case DW_AT_description: return "AT_description";
- case DW_AT_binary_scale: return "AT_binary_scale";
- case DW_AT_decimal_scale: return "AT_decimal_scale";
- case DW_AT_small: return "AT_small";
- case DW_AT_decimal_sign: return "AT_decimal_sign";
- case DW_AT_digit_count: return "AT_digit_count";
- case DW_AT_picture_string: return "AT_picture_string";
- case DW_AT_mutable: return "AT_mutable";
- case DW_AT_threads_scaled: return "AT_threads_scaled";
- case DW_AT_explicit: return "AT_explicit";
- case DW_AT_object_pointer: return "AT_object_pointer";
- case DW_AT_endianity: return "AT_endianity";
- case DW_AT_elemental: return "AT_elemental";
- case DW_AT_pure: return "AT_pure";
- case DW_AT_recursive: return "AT_recursive";
- case DW_AT_MIPS_linkage_name: return "AT_MIPS_linkage_name";
- case DW_AT_sf_names: return "AT_sf_names";
- case DW_AT_src_info: return "AT_src_info";
- case DW_AT_mac_info: return "AT_mac_info";
- case DW_AT_src_coords: return "AT_src_coords";
- case DW_AT_body_begin: return "AT_body_begin";
- case DW_AT_body_end: return "AT_body_end";
- case DW_AT_GNU_vector: return "AT_GNU_vector";
- case DW_AT_lo_user: return "AT_lo_user";
- case DW_AT_hi_user: return "AT_hi_user";
- }
- assert(0 && "Unknown Dwarf Attribute");
- return "";
-}
-
-/// FormEncodingString - Return the string for the specified form encoding.
-///
-const char *FormEncodingString(unsigned Encoding) {
- switch(Encoding) {
- case DW_FORM_addr: return "FORM_addr";
- case DW_FORM_block2: return "FORM_block2";
- case DW_FORM_block4: return "FORM_block4";
- case DW_FORM_data2: return "FORM_data2";
- case DW_FORM_data4: return "FORM_data4";
- case DW_FORM_data8: return "FORM_data8";
- case DW_FORM_string: return "FORM_string";
- case DW_FORM_block: return "FORM_block";
- case DW_FORM_block1: return "FORM_block1";
- case DW_FORM_data1: return "FORM_data1";
- case DW_FORM_flag: return "FORM_flag";
- case DW_FORM_sdata: return "FORM_sdata";
- case DW_FORM_strp: return "FORM_strp";
- case DW_FORM_udata: return "FORM_udata";
- case DW_FORM_ref_addr: return "FORM_ref_addr";
- case DW_FORM_ref1: return "FORM_ref1";
- case DW_FORM_ref2: return "FORM_ref2";
- case DW_FORM_ref4: return "FORM_ref4";
- case DW_FORM_ref8: return "FORM_ref8";
- case DW_FORM_ref_udata: return "FORM_ref_udata";
- case DW_FORM_indirect: return "FORM_indirect";
- }
- assert(0 && "Unknown Dwarf Form Encoding");
- return "";
-}
-
-/// OperationEncodingString - Return the string for the specified operation
-/// encoding.
-const char *OperationEncodingString(unsigned Encoding) {
- switch(Encoding) {
- case DW_OP_addr: return "OP_addr";
- case DW_OP_deref: return "OP_deref";
- case DW_OP_const1u: return "OP_const1u";
- case DW_OP_const1s: return "OP_const1s";
- case DW_OP_const2u: return "OP_const2u";
- case DW_OP_const2s: return "OP_const2s";
- case DW_OP_const4u: return "OP_const4u";
- case DW_OP_const4s: return "OP_const4s";
- case DW_OP_const8u: return "OP_const8u";
- case DW_OP_const8s: return "OP_const8s";
- case DW_OP_constu: return "OP_constu";
- case DW_OP_consts: return "OP_consts";
- case DW_OP_dup: return "OP_dup";
- case DW_OP_drop: return "OP_drop";
- case DW_OP_over: return "OP_over";
- case DW_OP_pick: return "OP_pick";
- case DW_OP_swap: return "OP_swap";
- case DW_OP_rot: return "OP_rot";
- case DW_OP_xderef: return "OP_xderef";
- case DW_OP_abs: return "OP_abs";
- case DW_OP_and: return "OP_and";
- case DW_OP_div: return "OP_div";
- case DW_OP_minus: return "OP_minus";
- case DW_OP_mod: return "OP_mod";
- case DW_OP_mul: return "OP_mul";
- case DW_OP_neg: return "OP_neg";
- case DW_OP_not: return "OP_not";
- case DW_OP_or: return "OP_or";
- case DW_OP_plus: return "OP_plus";
- case DW_OP_plus_uconst: return "OP_plus_uconst";
- case DW_OP_shl: return "OP_shl";
- case DW_OP_shr: return "OP_shr";
- case DW_OP_shra: return "OP_shra";
- case DW_OP_xor: return "OP_xor";
- case DW_OP_skip: return "OP_skip";
- case DW_OP_bra: return "OP_bra";
- case DW_OP_eq: return "OP_eq";
- case DW_OP_ge: return "OP_ge";
- case DW_OP_gt: return "OP_gt";
- case DW_OP_le: return "OP_le";
- case DW_OP_lt: return "OP_lt";
- case DW_OP_ne: return "OP_ne";
- case DW_OP_lit0: return "OP_lit0";
- case DW_OP_lit1: return "OP_lit1";
- case DW_OP_lit31: return "OP_lit31";
- case DW_OP_reg0: return "OP_reg0";
- case DW_OP_reg1: return "OP_reg1";
- case DW_OP_reg31: return "OP_reg31";
- case DW_OP_breg0: return "OP_breg0";
- case DW_OP_breg1: return "OP_breg1";
- case DW_OP_breg31: return "OP_breg31";
- case DW_OP_regx: return "OP_regx";
- case DW_OP_fbreg: return "OP_fbreg";
- case DW_OP_bregx: return "OP_bregx";
- case DW_OP_piece: return "OP_piece";
- case DW_OP_deref_size: return "OP_deref_size";
- case DW_OP_xderef_size: return "OP_xderef_size";
- case DW_OP_nop: return "OP_nop";
- case DW_OP_push_object_address: return "OP_push_object_address";
- case DW_OP_call2: return "OP_call2";
- case DW_OP_call4: return "OP_call4";
- case DW_OP_call_ref: return "OP_call_ref";
- case DW_OP_form_tls_address: return "OP_form_tls_address";
- case DW_OP_call_frame_cfa: return "OP_call_frame_cfa";
- case DW_OP_lo_user: return "OP_lo_user";
- case DW_OP_hi_user: return "OP_hi_user";
- }
- assert(0 && "Unknown Dwarf Operation Encoding");
- return "";
-}
-
-/// AttributeEncodingString - Return the string for the specified attribute
-/// encoding.
-const char *AttributeEncodingString(unsigned Encoding) {
- switch(Encoding) {
- case DW_ATE_address: return "ATE_address";
- case DW_ATE_boolean: return "ATE_boolean";
- case DW_ATE_complex_float: return "ATE_complex_float";
- case DW_ATE_float: return "ATE_float";
- case DW_ATE_signed: return "ATE_signed";
- case DW_ATE_signed_char: return "ATE_signed_char";
- case DW_ATE_unsigned: return "ATE_unsigned";
- case DW_ATE_unsigned_char: return "ATE_unsigned_char";
- case DW_ATE_imaginary_float: return "ATE_imaginary_float";
- case DW_ATE_packed_decimal: return "ATE_packed_decimal";
- case DW_ATE_numeric_string: return "ATE_numeric_string";
- case DW_ATE_edited: return "ATE_edited";
- case DW_ATE_signed_fixed: return "ATE_signed_fixed";
- case DW_ATE_unsigned_fixed: return "ATE_unsigned_fixed";
- case DW_ATE_decimal_float: return "ATE_decimal_float";
- case DW_ATE_lo_user: return "ATE_lo_user";
- case DW_ATE_hi_user: return "ATE_hi_user";
- }
- assert(0 && "Unknown Dwarf Attribute Encoding");
- return "";
-}
-
-/// DecimalSignString - Return the string for the specified decimal sign
-/// attribute.
-const char *DecimalSignString(unsigned Sign) {
- switch(Sign) {
- case DW_DS_unsigned: return "DS_unsigned";
- case DW_DS_leading_overpunch: return "DS_leading_overpunch";
- case DW_DS_trailing_overpunch: return "DS_trailing_overpunch";
- case DW_DS_leading_separate: return "DS_leading_separate";
- case DW_DS_trailing_separate: return "DS_trailing_separate";
- }
- assert(0 && "Unknown Dwarf Decimal Sign Attribute");
- return "";
-}
-
-/// EndianityString - Return the string for the specified endianity.
-///
-const char *EndianityString(unsigned Endian) {
- switch(Endian) {
- case DW_END_default: return "END_default";
- case DW_END_big: return "END_big";
- case DW_END_little: return "END_little";
- case DW_END_lo_user: return "END_lo_user";
- case DW_END_hi_user: return "END_hi_user";
- }
- assert(0 && "Unknown Dwarf Endianity");
- return "";
-}
-
-/// AccessibilityString - Return the string for the specified accessibility.
-///
-const char *AccessibilityString(unsigned Access) {
- switch(Access) {
- // Accessibility codes
- case DW_ACCESS_public: return "ACCESS_public";
- case DW_ACCESS_protected: return "ACCESS_protected";
- case DW_ACCESS_private: return "ACCESS_private";
- }
- assert(0 && "Unknown Dwarf Accessibility");
- return "";
-}
-
-/// VisibilityString - Return the string for the specified visibility.
-///
-const char *VisibilityString(unsigned Visibility) {
- switch(Visibility) {
- case DW_VIS_local: return "VIS_local";
- case DW_VIS_exported: return "VIS_exported";
- case DW_VIS_qualified: return "VIS_qualified";
- }
- assert(0 && "Unknown Dwarf Visibility");
- return "";
-}
-
-/// VirtualityString - Return the string for the specified virtuality.
-///
-const char *VirtualityString(unsigned Virtuality) {
- switch(Virtuality) {
- case DW_VIRTUALITY_none: return "VIRTUALITY_none";
- case DW_VIRTUALITY_virtual: return "VIRTUALITY_virtual";
- case DW_VIRTUALITY_pure_virtual: return "VIRTUALITY_pure_virtual";
- }
- assert(0 && "Unknown Dwarf Virtuality");
- return "";
-}
-
-/// LanguageString - Return the string for the specified language.
-///
-const char *LanguageString(unsigned Language) {
- switch(Language) {
- case DW_LANG_C89: return "LANG_C89";
- case DW_LANG_C: return "LANG_C";
- case DW_LANG_Ada83: return "LANG_Ada83";
- case DW_LANG_C_plus_plus: return "LANG_C_plus_plus";
- case DW_LANG_Cobol74: return "LANG_Cobol74";
- case DW_LANG_Cobol85: return "LANG_Cobol85";
- case DW_LANG_Fortran77: return "LANG_Fortran77";
- case DW_LANG_Fortran90: return "LANG_Fortran90";
- case DW_LANG_Pascal83: return "LANG_Pascal83";
- case DW_LANG_Modula2: return "LANG_Modula2";
- case DW_LANG_Java: return "LANG_Java";
- case DW_LANG_C99: return "LANG_C99";
- case DW_LANG_Ada95: return "LANG_Ada95";
- case DW_LANG_Fortran95: return "LANG_Fortran95";
- case DW_LANG_PLI: return "LANG_PLI";
- case DW_LANG_ObjC: return "LANG_ObjC";
- case DW_LANG_ObjC_plus_plus: return "LANG_ObjC_plus_plus";
- case DW_LANG_UPC: return "LANG_UPC";
- case DW_LANG_D: return "LANG_D";
- case DW_LANG_lo_user: return "LANG_lo_user";
- case DW_LANG_hi_user: return "LANG_hi_user";
- }
- assert(0 && "Unknown Dwarf Language");
- return "";
-}
-
-/// CaseString - Return the string for the specified identifier case.
-///
-const char *CaseString(unsigned Case) {
- switch(Case) {
- case DW_ID_case_sensitive: return "ID_case_sensitive";
- case DW_ID_up_case: return "ID_up_case";
- case DW_ID_down_case: return "ID_down_case";
- case DW_ID_case_insensitive: return "ID_case_insensitive";
- }
- assert(0 && "Unknown Dwarf Identifier Case");
- return "";
-}
-
-/// ConventionString - Return the string for the specified calling convention.
-///
-const char *ConventionString(unsigned Convention) {
- switch(Convention) {
- case DW_CC_normal: return "CC_normal";
- case DW_CC_program: return "CC_program";
- case DW_CC_nocall: return "CC_nocall";
- case DW_CC_lo_user: return "CC_lo_user";
- case DW_CC_hi_user: return "CC_hi_user";
- }
- assert(0 && "Unknown Dwarf Calling Convention");
- return "";
-}
-
-/// InlineCodeString - Return the string for the specified inline code.
-///
-const char *InlineCodeString(unsigned Code) {
- switch(Code) {
- case DW_INL_not_inlined: return "INL_not_inlined";
- case DW_INL_inlined: return "INL_inlined";
- case DW_INL_declared_not_inlined: return "INL_declared_not_inlined";
- case DW_INL_declared_inlined: return "INL_declared_inlined";
- }
- assert(0 && "Unknown Dwarf Inline Code");
- return "";
-}
-
-/// ArrayOrderString - Return the string for the specified array order.
-///
-const char *ArrayOrderString(unsigned Order) {
- switch(Order) {
- case DW_ORD_row_major: return "ORD_row_major";
- case DW_ORD_col_major: return "ORD_col_major";
- }
- assert(0 && "Unknown Dwarf Array Order");
- return "";
-}
-
-/// DiscriminantString - Return the string for the specified discriminant
-/// descriptor.
-const char *DiscriminantString(unsigned Discriminant) {
- switch(Discriminant) {
- case DW_DSC_label: return "DSC_label";
- case DW_DSC_range: return "DSC_range";
- }
- assert(0 && "Unknown Dwarf Discriminant Descriptor");
- return "";
-}
-
-/// LNStandardString - Return the string for the specified line number standard.
-///
-const char *LNStandardString(unsigned Standard) {
- switch(Standard) {
- case DW_LNS_copy: return "LNS_copy";
- case DW_LNS_advance_pc: return "LNS_advance_pc";
- case DW_LNS_advance_line: return "LNS_advance_line";
- case DW_LNS_set_file: return "LNS_set_file";
- case DW_LNS_set_column: return "LNS_set_column";
- case DW_LNS_negate_stmt: return "LNS_negate_stmt";
- case DW_LNS_set_basic_block: return "LNS_set_basic_block";
- case DW_LNS_const_add_pc: return "LNS_const_add_pc";
- case DW_LNS_fixed_advance_pc: return "LNS_fixed_advance_pc";
- case DW_LNS_set_prologue_end: return "LNS_set_prologue_end";
- case DW_LNS_set_epilogue_begin: return "LNS_set_epilogue_begin";
- case DW_LNS_set_isa: return "LNS_set_isa";
- }
- assert(0 && "Unknown Dwarf Line Number Standard");
- return "";
-}
-
-/// LNExtendedString - Return the string for the specified line number extended
-/// opcode encodings.
-const char *LNExtendedString(unsigned Encoding) {
- switch(Encoding) {
- // Line Number Extended Opcode Encodings
- case DW_LNE_end_sequence: return "LNE_end_sequence";
- case DW_LNE_set_address: return "LNE_set_address";
- case DW_LNE_define_file: return "LNE_define_file";
- case DW_LNE_lo_user: return "LNE_lo_user";
- case DW_LNE_hi_user: return "LNE_hi_user";
- }
- assert(0 && "Unknown Dwarf Line Number Extended Opcode Encoding");
- return "";
-}
-
-/// MacinfoString - Return the string for the specified macinfo type encodings.
-///
-const char *MacinfoString(unsigned Encoding) {
- switch(Encoding) {
- // Macinfo Type Encodings
- case DW_MACINFO_define: return "MACINFO_define";
- case DW_MACINFO_undef: return "MACINFO_undef";
- case DW_MACINFO_start_file: return "MACINFO_start_file";
- case DW_MACINFO_end_file: return "MACINFO_end_file";
- case DW_MACINFO_vendor_ext: return "MACINFO_vendor_ext";
- }
- assert(0 && "Unknown Dwarf Macinfo Type Encodings");
- return "";
-}
-
-/// CallFrameString - Return the string for the specified call frame instruction
-/// encodings.
-const char *CallFrameString(unsigned Encoding) {
- switch(Encoding) {
- case DW_CFA_advance_loc: return "CFA_advance_loc";
- case DW_CFA_offset: return "CFA_offset";
- case DW_CFA_restore: return "CFA_restore";
- case DW_CFA_set_loc: return "CFA_set_loc";
- case DW_CFA_advance_loc1: return "CFA_advance_loc1";
- case DW_CFA_advance_loc2: return "CFA_advance_loc2";
- case DW_CFA_advance_loc4: return "CFA_advance_loc4";
- case DW_CFA_offset_extended: return "CFA_offset_extended";
- case DW_CFA_restore_extended: return "CFA_restore_extended";
- case DW_CFA_undefined: return "CFA_undefined";
- case DW_CFA_same_value: return "CFA_same_value";
- case DW_CFA_register: return "CFA_register";
- case DW_CFA_remember_state: return "CFA_remember_state";
- case DW_CFA_restore_state: return "CFA_restore_state";
- case DW_CFA_def_cfa: return "CFA_def_cfa";
- case DW_CFA_def_cfa_register: return "CFA_def_cfa_register";
- case DW_CFA_def_cfa_offset: return "CFA_def_cfa_offset";
- case DW_CFA_def_cfa_expression: return "CFA_def_cfa_expression";
- case DW_CFA_expression: return "CFA_expression";
- case DW_CFA_offset_extended_sf: return "CFA_offset_extended_sf";
- case DW_CFA_def_cfa_sf: return "CFA_def_cfa_sf";
- case DW_CFA_def_cfa_offset_sf: return "CFA_def_cfa_offset_sf";
- case DW_CFA_val_offset: return "CFA_val_offset";
- case DW_CFA_val_offset_sf: return "CFA_val_offset_sf";
- case DW_CFA_val_expression: return "CFA_val_expression";
- case DW_CFA_lo_user: return "CFA_lo_user";
- case DW_CFA_hi_user: return "CFA_hi_user";
- }
- assert(0 && "Unknown Dwarf Call Frame Instruction Encodings");
- return "";
-}
-
-} // End of namespace dwarf.
-
-} // End of namespace llvm.
diff --git a/release_23/lib/Support/FileUtilities.cpp b/release_23/lib/Support/FileUtilities.cpp
deleted file mode 100644
index 21080b64399e..000000000000
--- a/release_23/lib/Support/FileUtilities.cpp
+++ /dev/null
@@ -1,263 +0,0 @@
-//===- Support/FileUtilities.cpp - File System Utilities ------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements a family of utility functions which are useful for doing
-// various things with files.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Support/FileUtilities.h"
-#include "llvm/System/Path.h"
-#include "llvm/Support/MemoryBuffer.h"
-#include "llvm/ADT/OwningPtr.h"
-#include "llvm/ADT/SmallString.h"
-#include "llvm/ADT/StringExtras.h"
-#include <cstdlib>
-#include <cstring>
-#include <cctype>
-using namespace llvm;
-
-static bool isSignedChar(char C) {
- return (C == '+' || C == '-');
-}
-
-static bool isExponentChar(char C) {
- switch (C) {
- case 'D': // Strange exponential notation.
- case 'd': // Strange exponential notation.
- case 'e':
- case 'E': return true;
- default: return false;
- }
-}
-
-static bool isNumberChar(char C) {
- switch (C) {
- case '0': case '1': case '2': case '3': case '4':
- case '5': case '6': case '7': case '8': case '9':
- case '.': return true;
- default: return isSignedChar(C) || isExponentChar(C);
- }
-}
-
-static const char *BackupNumber(const char *Pos, const char *FirstChar) {
- // If we didn't stop in the middle of a number, don't backup.
- if (!isNumberChar(*Pos)) return Pos;
-
- // Otherwise, return to the start of the number.
- while (Pos > FirstChar && isNumberChar(Pos[-1])) {
- --Pos;
- if (Pos > FirstChar && isSignedChar(Pos[0]) && !isExponentChar(Pos[-1]))
- break;
- }
- return Pos;
-}
-
-/// EndOfNumber - Return the first character that is not part of the specified
-/// number. This assumes that the buffer is null terminated, so it won't fall
-/// off the end.
-static const char *EndOfNumber(const char *Pos) {
- while (isNumberChar(*Pos))
- ++Pos;
- return Pos;
-}
-
-/// CompareNumbers - compare two numbers, returning true if they are different.
-static bool CompareNumbers(const char *&F1P, const char *&F2P,
- const char *F1End, const char *F2End,
- double AbsTolerance, double RelTolerance,
- std::string *ErrorMsg) {
- const char *F1NumEnd, *F2NumEnd;
- double V1 = 0.0, V2 = 0.0;
-
- // If one of the positions is at a space and the other isn't, chomp up 'til
- // the end of the space.
- while (isspace(*F1P) && F1P != F1End)
- ++F1P;
- while (isspace(*F2P) && F2P != F2End)
- ++F2P;
-
- // If we stop on numbers, compare their difference.
- if (!isNumberChar(*F1P) || !isNumberChar(*F2P)) {
- // The diff failed.
- F1NumEnd = F1P;
- F2NumEnd = F2P;
- } else {
- // Note that some ugliness is built into this to permit support for numbers
- // that use "D" or "d" as their exponential marker, e.g. "1.234D45". This
- // occurs in 200.sixtrack in spec2k.
- V1 = strtod(F1P, const_cast<char**>(&F1NumEnd));
- V2 = strtod(F2P, const_cast<char**>(&F2NumEnd));
-
- if (*F1NumEnd == 'D' || *F1NumEnd == 'd') {
- // Copy string into tmp buffer to replace the 'D' with an 'e'.
- SmallString<200> StrTmp(F1P, EndOfNumber(F1NumEnd)+1);
- // Strange exponential notation!
- StrTmp[static_cast<unsigned>(F1NumEnd-F1P)] = 'e';
-
- V1 = strtod(&StrTmp[0], const_cast<char**>(&F1NumEnd));
- F1NumEnd = F1P + (F1NumEnd-&StrTmp[0]);
- }
-
- if (*F2NumEnd == 'D' || *F2NumEnd == 'd') {
- // Copy string into tmp buffer to replace the 'D' with an 'e'.
- SmallString<200> StrTmp(F2P, EndOfNumber(F2NumEnd)+1);
- // Strange exponential notation!
- StrTmp[static_cast<unsigned>(F2NumEnd-F2P)] = 'e';
-
- V2 = strtod(&StrTmp[0], const_cast<char**>(&F2NumEnd));
- F2NumEnd = F2P + (F2NumEnd-&StrTmp[0]);
- }
- }
-
- if (F1NumEnd == F1P || F2NumEnd == F2P) {
- if (ErrorMsg) {
- *ErrorMsg = "FP Comparison failed, not a numeric difference between '";
- *ErrorMsg += F1P[0];
- *ErrorMsg += "' and '";
- *ErrorMsg += F2P[0];
- *ErrorMsg += "'";
- }
- return true;
- }
-
- // Check to see if these are inside the absolute tolerance
- if (AbsTolerance < std::abs(V1-V2)) {
- // Nope, check the relative tolerance...
- double Diff;
- if (V2)
- Diff = std::abs(V1/V2 - 1.0);
- else if (V1)
- Diff = std::abs(V2/V1 - 1.0);
- else
- Diff = 0; // Both zero.
- if (Diff > RelTolerance) {
- if (ErrorMsg) {
- *ErrorMsg = "Compared: " + ftostr(V1) + " and " + ftostr(V2) + "\n";
- *ErrorMsg += "abs. diff = " + ftostr(std::abs(V1-V2)) +
- " rel.diff = " + ftostr(Diff) + "\n";
- *ErrorMsg += "Out of tolerance: rel/abs: " + ftostr(RelTolerance) +
- "/" + ftostr(AbsTolerance);
- }
- return true;
- }
- }
-
- // Otherwise, advance our read pointers to the end of the numbers.
- F1P = F1NumEnd; F2P = F2NumEnd;
- return false;
-}
-
-/// DiffFilesWithTolerance - Compare the two files specified, returning 0 if the
-/// files match, 1 if they are different, and 2 if there is a file error. This
-/// function differs from DiffFiles in that you can specify an absolete and
-/// relative FP error that is allowed to exist. If you specify a string to fill
-/// in for the error option, it will set the string to an error message if an
-/// error occurs, allowing the caller to distinguish between a failed diff and a
-/// file system error.
-///
-int llvm::DiffFilesWithTolerance(const sys::PathWithStatus &FileA,
- const sys::PathWithStatus &FileB,
- double AbsTol, double RelTol,
- std::string *Error) {
- const sys::FileStatus *FileAStat = FileA.getFileStatus(false, Error);
- if (!FileAStat)
- return 2;
- const sys::FileStatus *FileBStat = FileB.getFileStatus(false, Error);
- if (!FileBStat)
- return 2;
-
- // Check for zero length files because some systems croak when you try to
- // mmap an empty file.
- size_t A_size = FileAStat->getSize();
- size_t B_size = FileBStat->getSize();
-
- // If they are both zero sized then they're the same
- if (A_size == 0 && B_size == 0)
- return 0;
-
- // If only one of them is zero sized then they can't be the same
- if ((A_size == 0 || B_size == 0)) {
- if (Error)
- *Error = "Files differ: one is zero-sized, the other isn't";
- return 1;
- }
-
- // Now its safe to mmap the files into memory becasue both files
- // have a non-zero size.
- OwningPtr<MemoryBuffer> F1(MemoryBuffer::getFile(FileA.c_str(), Error));
- OwningPtr<MemoryBuffer> F2(MemoryBuffer::getFile(FileB.c_str(), Error));
- if (F1 == 0 || F2 == 0)
- return 2;
-
- // Okay, now that we opened the files, scan them for the first difference.
- const char *File1Start = F1->getBufferStart();
- const char *File2Start = F2->getBufferStart();
- const char *File1End = F1->getBufferEnd();
- const char *File2End = F2->getBufferEnd();
- const char *F1P = File1Start;
- const char *F2P = File2Start;
-
- if (A_size == B_size) {
- // Are the buffers identical? Common case: Handle this efficiently.
- if (std::memcmp(File1Start, File2Start, A_size) == 0)
- return 0;
-
- if (AbsTol == 0 && RelTol == 0) {
- if (Error)
- *Error = "Files differ without tolerance allowance";
- return 1; // Files different!
- }
- }
-
- bool CompareFailed = false;
- while (1) {
- // Scan for the end of file or next difference.
- while (F1P < File1End && F2P < File2End && *F1P == *F2P)
- ++F1P, ++F2P;
-
- if (F1P >= File1End || F2P >= File2End) break;
-
- // Okay, we must have found a difference. Backup to the start of the
- // current number each stream is at so that we can compare from the
- // beginning.
- F1P = BackupNumber(F1P, File1Start);
- F2P = BackupNumber(F2P, File2Start);
-
- // Now that we are at the start of the numbers, compare them, exiting if
- // they don't match.
- if (CompareNumbers(F1P, F2P, File1End, File2End, AbsTol, RelTol, Error)) {
- CompareFailed = true;
- break;
- }
- }
-
- // Okay, we reached the end of file. If both files are at the end, we
- // succeeded.
- bool F1AtEnd = F1P >= File1End;
- bool F2AtEnd = F2P >= File2End;
- if (!CompareFailed && (!F1AtEnd || !F2AtEnd)) {
- // Else, we might have run off the end due to a number: backup and retry.
- if (F1AtEnd && isNumberChar(F1P[-1])) --F1P;
- if (F2AtEnd && isNumberChar(F2P[-1])) --F2P;
- F1P = BackupNumber(F1P, File1Start);
- F2P = BackupNumber(F2P, File2Start);
-
- // Now that we are at the start of the numbers, compare them, exiting if
- // they don't match.
- if (CompareNumbers(F1P, F2P, File1End, File2End, AbsTol, RelTol, Error))
- CompareFailed = true;
-
- // If we found the end, we succeeded.
- if (F1P < File1End || F2P < File2End)
- CompareFailed = true;
- }
-
- return CompareFailed;
-}
diff --git a/release_23/lib/Support/FoldingSet.cpp b/release_23/lib/Support/FoldingSet.cpp
deleted file mode 100644
index 6daa157af131..000000000000
--- a/release_23/lib/Support/FoldingSet.cpp
+++ /dev/null
@@ -1,362 +0,0 @@
-//===-- Support/FoldingSet.cpp - Uniquing Hash Set --------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements a hash set that can be used to remove duplication of
-// nodes in a graph. This code was originally created by Chris Lattner for use
-// with SelectionDAGCSEMap, but was isolated to provide use across the llvm code
-// set.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/ADT/FoldingSet.h"
-#include "llvm/Support/MathExtras.h"
-#include <cassert>
-#include <cstring>
-using namespace llvm;
-
-//===----------------------------------------------------------------------===//
-// FoldingSetNodeID Implementation
-
-/// Add* - Add various data types to Bit data.
-///
-void FoldingSetNodeID::AddPointer(const void *Ptr) {
- // Note: this adds pointers to the hash using sizes and endianness that
- // depend on the host. It doesn't matter however, because hashing on
- // pointer values in inherently unstable. Nothing should depend on the
- // ordering of nodes in the folding set.
- intptr_t PtrI = (intptr_t)Ptr;
- Bits.push_back(unsigned(PtrI));
- if (sizeof(intptr_t) > sizeof(unsigned))
- Bits.push_back(unsigned(uint64_t(PtrI) >> 32));
-}
-void FoldingSetNodeID::AddInteger(signed I) {
- Bits.push_back(I);
-}
-void FoldingSetNodeID::AddInteger(unsigned I) {
- Bits.push_back(I);
-}
-void FoldingSetNodeID::AddInteger(int64_t I) {
- AddInteger((uint64_t)I);
-}
-void FoldingSetNodeID::AddInteger(uint64_t I) {
- Bits.push_back(unsigned(I));
-
- // If the integer is small, encode it just as 32-bits.
- if ((uint64_t)(int)I != I)
- Bits.push_back(unsigned(I >> 32));
-}
-void FoldingSetNodeID::AddFloat(float F) {
- Bits.push_back(FloatToBits(F));
-}
-void FoldingSetNodeID::AddDouble(double D) {
- AddInteger(DoubleToBits(D));
-}
-void FoldingSetNodeID::AddString(const std::string &String) {
- unsigned Size = static_cast<unsigned>(String.size());
- Bits.push_back(Size);
- if (!Size) return;
-
- unsigned Units = Size / 4;
- unsigned Pos = 0;
- const unsigned *Base = (const unsigned *)String.data();
-
- // If the string is aligned do a bulk transfer.
- if (!((intptr_t)Base & 3)) {
- Bits.append(Base, Base + Units);
- Pos = (Units + 1) * 4;
- } else {
- // Otherwise do it the hard way.
- for ( Pos += 4; Pos <= Size; Pos += 4) {
- unsigned V = ((unsigned char)String[Pos - 4] << 24) |
- ((unsigned char)String[Pos - 3] << 16) |
- ((unsigned char)String[Pos - 2] << 8) |
- (unsigned char)String[Pos - 1];
- Bits.push_back(V);
- }
- }
-
- // With the leftover bits.
- unsigned V = 0;
- // Pos will have overshot size by 4 - #bytes left over.
- switch (Pos - Size) {
- case 1: V = (V << 8) | (unsigned char)String[Size - 3]; // Fall thru.
- case 2: V = (V << 8) | (unsigned char)String[Size - 2]; // Fall thru.
- case 3: V = (V << 8) | (unsigned char)String[Size - 1]; break;
- default: return; // Nothing left.
- }
-
- Bits.push_back(V);
-}
-
-/// ComputeHash - Compute a strong hash value for this FoldingSetNodeID, used to
-/// lookup the node in the FoldingSetImpl.
-unsigned FoldingSetNodeID::ComputeHash() const {
- // This is adapted from SuperFastHash by Paul Hsieh.
- unsigned Hash = static_cast<unsigned>(Bits.size());
- for (const unsigned *BP = &Bits[0], *E = BP+Bits.size(); BP != E; ++BP) {
- unsigned Data = *BP;
- Hash += Data & 0xFFFF;
- unsigned Tmp = ((Data >> 16) << 11) ^ Hash;
- Hash = (Hash << 16) ^ Tmp;
- Hash += Hash >> 11;
- }
-
- // Force "avalanching" of final 127 bits.
- Hash ^= Hash << 3;
- Hash += Hash >> 5;
- Hash ^= Hash << 4;
- Hash += Hash >> 17;
- Hash ^= Hash << 25;
- Hash += Hash >> 6;
- return Hash;
-}
-
-/// operator== - Used to compare two nodes to each other.
-///
-bool FoldingSetNodeID::operator==(const FoldingSetNodeID &RHS)const{
- if (Bits.size() != RHS.Bits.size()) return false;
- return memcmp(&Bits[0], &RHS.Bits[0], Bits.size()*sizeof(Bits[0])) == 0;
-}
-
-
-//===----------------------------------------------------------------------===//
-/// Helper functions for FoldingSetImpl.
-
-/// GetNextPtr - In order to save space, each bucket is a
-/// singly-linked-list. In order to make deletion more efficient, we make
-/// the list circular, so we can delete a node without computing its hash.
-/// The problem with this is that the start of the hash buckets are not
-/// Nodes. If NextInBucketPtr is a bucket pointer, this method returns null:
-/// use GetBucketPtr when this happens.
-static FoldingSetImpl::Node *GetNextPtr(void *NextInBucketPtr) {
- // The low bit is set if this is the pointer back to the bucket.
- if (reinterpret_cast<intptr_t>(NextInBucketPtr) & 1)
- return 0;
-
- return static_cast<FoldingSetImpl::Node*>(NextInBucketPtr);
-}
-
-
-/// testing.
-static void **GetBucketPtr(void *NextInBucketPtr) {
- intptr_t Ptr = reinterpret_cast<intptr_t>(NextInBucketPtr);
- assert((Ptr & 1) && "Not a bucket pointer");
- return reinterpret_cast<void**>(Ptr & ~intptr_t(1));
-}
-
-/// GetBucketFor - Hash the specified node ID and return the hash bucket for
-/// the specified ID.
-static void **GetBucketFor(const FoldingSetNodeID &ID,
- void **Buckets, unsigned NumBuckets) {
- // NumBuckets is always a power of 2.
- unsigned BucketNum = ID.ComputeHash() & (NumBuckets-1);
- return Buckets + BucketNum;
-}
-
-//===----------------------------------------------------------------------===//
-// FoldingSetImpl Implementation
-
-FoldingSetImpl::FoldingSetImpl(unsigned Log2InitSize) : NumNodes(0) {
- assert(5 < Log2InitSize && Log2InitSize < 32 &&
- "Initial hash table size out of range");
- NumBuckets = 1 << Log2InitSize;
- Buckets = new void*[NumBuckets+1];
- memset(Buckets, 0, NumBuckets*sizeof(void*));
-
- // Set the very last bucket to be a non-null "pointer".
- Buckets[NumBuckets] = reinterpret_cast<void*>(-2);
-}
-FoldingSetImpl::~FoldingSetImpl() {
- delete [] Buckets;
-}
-
-/// GrowHashTable - Double the size of the hash table and rehash everything.
-///
-void FoldingSetImpl::GrowHashTable() {
- void **OldBuckets = Buckets;
- unsigned OldNumBuckets = NumBuckets;
- NumBuckets <<= 1;
-
- // Reset the node count to zero: we're going to reinsert everything.
- NumNodes = 0;
-
- // Clear out new buckets.
- Buckets = new void*[NumBuckets+1];
- memset(Buckets, 0, NumBuckets*sizeof(void*));
-
- // Set the very last bucket to be a non-null "pointer".
- Buckets[NumBuckets] = reinterpret_cast<void*>(-1);
-
- // Walk the old buckets, rehashing nodes into their new place.
- for (unsigned i = 0; i != OldNumBuckets; ++i) {
- void *Probe = OldBuckets[i];
- if (!Probe) continue;
- while (Node *NodeInBucket = GetNextPtr(Probe)) {
- // Figure out the next link, remove NodeInBucket from the old link.
- Probe = NodeInBucket->getNextInBucket();
- NodeInBucket->SetNextInBucket(0);
-
- // Insert the node into the new bucket, after recomputing the hash.
- FoldingSetNodeID ID;
- GetNodeProfile(ID, NodeInBucket);
- InsertNode(NodeInBucket, GetBucketFor(ID, Buckets, NumBuckets));
- }
- }
-
- delete[] OldBuckets;
-}
-
-/// FindNodeOrInsertPos - Look up the node specified by ID. If it exists,
-/// return it. If not, return the insertion token that will make insertion
-/// faster.
-FoldingSetImpl::Node
-*FoldingSetImpl::FindNodeOrInsertPos(const FoldingSetNodeID &ID,
- void *&InsertPos) {
-
- void **Bucket = GetBucketFor(ID, Buckets, NumBuckets);
- void *Probe = *Bucket;
-
- InsertPos = 0;
-
- while (Node *NodeInBucket = GetNextPtr(Probe)) {
- FoldingSetNodeID OtherID;
- GetNodeProfile(OtherID, NodeInBucket);
- if (OtherID == ID)
- return NodeInBucket;
-
- Probe = NodeInBucket->getNextInBucket();
- }
-
- // Didn't find the node, return null with the bucket as the InsertPos.
- InsertPos = Bucket;
- return 0;
-}
-
-/// InsertNode - Insert the specified node into the folding set, knowing that it
-/// is not already in the map. InsertPos must be obtained from
-/// FindNodeOrInsertPos.
-void FoldingSetImpl::InsertNode(Node *N, void *InsertPos) {
- assert(N->getNextInBucket() == 0);
- // Do we need to grow the hashtable?
- if (NumNodes+1 > NumBuckets*2) {
- GrowHashTable();
- FoldingSetNodeID ID;
- GetNodeProfile(ID, N);
- InsertPos = GetBucketFor(ID, Buckets, NumBuckets);
- }
-
- ++NumNodes;
-
- /// The insert position is actually a bucket pointer.
- void **Bucket = static_cast<void**>(InsertPos);
-
- void *Next = *Bucket;
-
- // If this is the first insertion into this bucket, its next pointer will be
- // null. Pretend as if it pointed to itself, setting the low bit to indicate
- // that it is a pointer to the bucket.
- if (Next == 0)
- Next = reinterpret_cast<void*>(reinterpret_cast<intptr_t>(Bucket)|1);
-
- // Set the node's next pointer, and make the bucket point to the node.
- N->SetNextInBucket(Next);
- *Bucket = N;
-}
-
-/// RemoveNode - Remove a node from the folding set, returning true if one was
-/// removed or false if the node was not in the folding set.
-bool FoldingSetImpl::RemoveNode(Node *N) {
- // Because each bucket is a circular list, we don't need to compute N's hash
- // to remove it.
- void *Ptr = N->getNextInBucket();
- if (Ptr == 0) return false; // Not in folding set.
-
- --NumNodes;
- N->SetNextInBucket(0);
-
- // Remember what N originally pointed to, either a bucket or another node.
- void *NodeNextPtr = Ptr;
-
- // Chase around the list until we find the node (or bucket) which points to N.
- while (true) {
- if (Node *NodeInBucket = GetNextPtr(Ptr)) {
- // Advance pointer.
- Ptr = NodeInBucket->getNextInBucket();
-
- // We found a node that points to N, change it to point to N's next node,
- // removing N from the list.
- if (Ptr == N) {
- NodeInBucket->SetNextInBucket(NodeNextPtr);
- return true;
- }
- } else {
- void **Bucket = GetBucketPtr(Ptr);
- Ptr = *Bucket;
-
- // If we found that the bucket points to N, update the bucket to point to
- // whatever is next.
- if (Ptr == N) {
- *Bucket = NodeNextPtr;
- return true;
- }
- }
- }
-}
-
-/// GetOrInsertNode - If there is an existing simple Node exactly
-/// equal to the specified node, return it. Otherwise, insert 'N' and it
-/// instead.
-FoldingSetImpl::Node *FoldingSetImpl::GetOrInsertNode(FoldingSetImpl::Node *N) {
- FoldingSetNodeID ID;
- GetNodeProfile(ID, N);
- void *IP;
- if (Node *E = FindNodeOrInsertPos(ID, IP))
- return E;
- InsertNode(N, IP);
- return N;
-}
-
-//===----------------------------------------------------------------------===//
-// FoldingSetIteratorImpl Implementation
-
-FoldingSetIteratorImpl::FoldingSetIteratorImpl(void **Bucket) {
- // Skip to the first non-null non-self-cycle bucket.
- while (*Bucket != reinterpret_cast<void*>(-1) &&
- (*Bucket == 0 || GetNextPtr(*Bucket) == 0))
- ++Bucket;
-
- NodePtr = static_cast<FoldingSetNode*>(*Bucket);
-}
-
-void FoldingSetIteratorImpl::advance() {
- // If there is another link within this bucket, go to it.
- void *Probe = NodePtr->getNextInBucket();
-
- if (FoldingSetNode *NextNodeInBucket = GetNextPtr(Probe))
- NodePtr = NextNodeInBucket;
- else {
- // Otherwise, this is the last link in this bucket.
- void **Bucket = GetBucketPtr(Probe);
-
- // Skip to the next non-null non-self-cycle bucket.
- do {
- ++Bucket;
- } while (*Bucket != reinterpret_cast<void*>(-1) &&
- (*Bucket == 0 || GetNextPtr(*Bucket) == 0));
-
- NodePtr = static_cast<FoldingSetNode*>(*Bucket);
- }
-}
-
-//===----------------------------------------------------------------------===//
-// FoldingSetBucketIteratorImpl Implementation
-
-FoldingSetBucketIteratorImpl::FoldingSetBucketIteratorImpl(void **Bucket) {
- Ptr = (*Bucket == 0 || GetNextPtr(*Bucket) == 0) ? (void*) Bucket : *Bucket;
-}
diff --git a/release_23/lib/Support/GraphWriter.cpp b/release_23/lib/Support/GraphWriter.cpp
deleted file mode 100644
index aad1818372a3..000000000000
--- a/release_23/lib/Support/GraphWriter.cpp
+++ /dev/null
@@ -1,89 +0,0 @@
-//===-- GraphWriter.cpp - Implements GraphWriter support routines ---------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements misc. GraphWriter support routines.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Support/GraphWriter.h"
-#include "llvm/Support/Streams.h"
-#include "llvm/System/Path.h"
-#include "llvm/System/Program.h"
-#include "llvm/Config/config.h"
-using namespace llvm;
-
-void llvm::DisplayGraph(const sys::Path &Filename) {
- std::string ErrMsg;
-#if HAVE_GRAPHVIZ
- sys::Path Graphviz(LLVM_PATH_GRAPHVIZ);
-
- std::vector<const char*> args;
- args.push_back(Graphviz.c_str());
- args.push_back(Filename.c_str());
- args.push_back(0);
-
- cerr << "Running 'Graphviz' program... " << std::flush;
- if (sys::Program::ExecuteAndWait(Graphviz, &args[0],0,0,0,0,&ErrMsg)) {
- cerr << "Error viewing graph: " << ErrMsg << "\n";
- }
-#elif (HAVE_GV && HAVE_DOT)
- sys::Path PSFilename = Filename;
- PSFilename.appendSuffix("ps");
-
- sys::Path dot(LLVM_PATH_DOT);
-
- std::vector<const char*> args;
- args.push_back(dot.c_str());
- args.push_back("-Tps");
- args.push_back("-Nfontname=Courier");
- args.push_back("-Gsize=7.5,10");
- args.push_back(Filename.c_str());
- args.push_back("-o");
- args.push_back(PSFilename.c_str());
- args.push_back(0);
-
- cerr << "Running 'dot' program... " << std::flush;
- if (sys::Program::ExecuteAndWait(dot, &args[0],0,0,0,0,&ErrMsg)) {
- cerr << "Error viewing graph: '" << ErrMsg << "\n";
- } else {
- cerr << " done. \n";
-
- sys::Path gv(LLVM_PATH_GV);
- args.clear();
- args.push_back(gv.c_str());
- args.push_back("--spartan");
- args.push_back(PSFilename.c_str());
- args.push_back(0);
-
- ErrMsg.clear();
- if (sys::Program::ExecuteAndWait(gv, &args[0],0,0,0,0,&ErrMsg)) {
- cerr << "Error viewing graph: " << ErrMsg << "\n";
- }
- }
- PSFilename.eraseFromDisk();
-#elif HAVE_DOTTY
- sys::Path dotty(LLVM_PATH_DOTTY);
-
- std::vector<const char*> args;
- args.push_back(dotty.c_str());
- args.push_back(Filename.c_str());
- args.push_back(0);
-
- cerr << "Running 'dotty' program... " << std::flush;
- if (sys::Program::ExecuteAndWait(dotty, &args[0],0,0,0,0,&ErrMsg)) {
- cerr << "Error viewing graph: " << ErrMsg << "\n";
- } else {
-#ifdef __MINGW32__ // Dotty spawns another app and doesn't wait until it returns
- return;
-#endif
- }
-#endif
-
- Filename.eraseFromDisk();
-}
diff --git a/release_23/lib/Support/IsInf.cpp b/release_23/lib/Support/IsInf.cpp
deleted file mode 100644
index d6da0c99e8d8..000000000000
--- a/release_23/lib/Support/IsInf.cpp
+++ /dev/null
@@ -1,49 +0,0 @@
-//===-- IsInf.cpp - Platform-independent wrapper around C99 isinf() -------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// Platform-independent wrapper around C99 isinf()
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Config/config.h"
-
-#if HAVE_ISINF_IN_MATH_H
-# include <math.h>
-#elif HAVE_ISINF_IN_CMATH
-# include <cmath>
-#elif HAVE_STD_ISINF_IN_CMATH
-# include <cmath>
-using std::isinf;
-#elif HAVE_FINITE_IN_IEEEFP_H
-// A handy workaround I found at http://www.unixguide.net/sun/faq ...
-// apparently this has been a problem with Solaris for years.
-# include <ieeefp.h>
-static int isinf(double x) { return !finite(x) && x==x; }
-#elif defined(_MSC_VER)
-#include <float.h>
-#define isinf(X) (!_finite(X))
-#elif defined(_AIX) && defined(__GNUC__)
-// GCC's fixincludes seems to be removing the isinf() declaration from the
-// system header /usr/include/math.h
-# include <math.h>
-static int isinf(double x) { return !finite(x) && x==x; }
-#elif defined(__hpux)
-// HP-UX is "special"
-#include <math.h>
-static int isinf(double x) { return ((x) == INFINITY) || ((x) == -INFINITY); }
-#else
-# error "Don't know how to get isinf()"
-#endif
-
-namespace llvm {
-
-int IsInf(float f) { return isinf(f); }
-int IsInf(double d) { return isinf(d); }
-
-} // end namespace llvm;
diff --git a/release_23/lib/Support/IsNAN.cpp b/release_23/lib/Support/IsNAN.cpp
deleted file mode 100644
index bdfdfbf3155d..000000000000
--- a/release_23/lib/Support/IsNAN.cpp
+++ /dev/null
@@ -1,33 +0,0 @@
-//===-- IsNAN.cpp ---------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// Platform-independent wrapper around C99 isnan().
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Config/config.h"
-
-#if HAVE_ISNAN_IN_MATH_H
-# include <math.h>
-#elif HAVE_ISNAN_IN_CMATH
-# include <cmath>
-#elif HAVE_STD_ISNAN_IN_CMATH
-# include <cmath>
-using std::isnan;
-#elif defined(_MSC_VER)
-#include <float.h>
-#define isnan _isnan
-#else
-# error "Don't know how to get isnan()"
-#endif
-
-namespace llvm {
- int IsNAN(float f) { return isnan(f); }
- int IsNAN(double d) { return isnan(d); }
-} // end namespace llvm;
diff --git a/release_23/lib/Support/Makefile b/release_23/lib/Support/Makefile
deleted file mode 100644
index 7f76ed702d2f..000000000000
--- a/release_23/lib/Support/Makefile
+++ /dev/null
@@ -1,17 +0,0 @@
-##===- lib/Support/Makefile --------------------------------*- Makefile -*-===##
-#
-# The LLVM Compiler Infrastructure
-#
-# This file is distributed under the University of Illinois Open Source
-# License. See LICENSE.TXT for details.
-#
-##===----------------------------------------------------------------------===##
-
-LEVEL = ../..
-LIBRARYNAME = LLVMSupport
-BUILD_ARCHIVE = 1
-
-## FIXME: This only requires RTTI because tblgen uses it. Fix that.
-REQUIRES_RTTI = 1
-
-include $(LEVEL)/Makefile.common
diff --git a/release_23/lib/Support/ManagedStatic.cpp b/release_23/lib/Support/ManagedStatic.cpp
deleted file mode 100644
index c365e013c6fc..000000000000
--- a/release_23/lib/Support/ManagedStatic.cpp
+++ /dev/null
@@ -1,53 +0,0 @@
-//===-- ManagedStatic.cpp - Static Global wrapper -------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the ManagedStatic class and llvm_shutdown().
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Support/ManagedStatic.h"
-#include <cassert>
-using namespace llvm;
-
-static const ManagedStaticBase *StaticList = 0;
-
-void ManagedStaticBase::RegisterManagedStatic(void *ObjPtr,
- void (*Deleter)(void*)) const {
- assert(Ptr == 0 && DeleterFn == 0 && Next == 0 &&
- "Partially init static?");
- Ptr = ObjPtr;
- DeleterFn = Deleter;
-
- // Add to list of managed statics.
- Next = StaticList;
- StaticList = this;
-}
-
-void ManagedStaticBase::destroy() const {
- assert(DeleterFn && "ManagedStatic not initialized correctly!");
- assert(StaticList == this &&
- "Not destroyed in reverse order of construction?");
- // Unlink from list.
- StaticList = Next;
- Next = 0;
-
- // Destroy memory.
- DeleterFn(Ptr);
-
- // Cleanup.
- Ptr = 0;
- DeleterFn = 0;
-}
-
-/// llvm_shutdown - Deallocate and destroy all ManagedStatic variables.
-void llvm::llvm_shutdown() {
- while (StaticList)
- StaticList->destroy();
-}
-
diff --git a/release_23/lib/Support/MemoryBuffer.cpp b/release_23/lib/Support/MemoryBuffer.cpp
deleted file mode 100644
index 83f149423c55..000000000000
--- a/release_23/lib/Support/MemoryBuffer.cpp
+++ /dev/null
@@ -1,267 +0,0 @@
-//===--- MemoryBuffer.cpp - Memory Buffer implementation ------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the MemoryBuffer interface.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Support/MemoryBuffer.h"
-#include "llvm/ADT/OwningPtr.h"
-#include "llvm/ADT/SmallString.h"
-#include "llvm/System/Path.h"
-#include "llvm/System/Process.h"
-#include "llvm/System/Program.h"
-#include <cassert>
-#include <cstdio>
-#include <cstring>
-#include <cerrno>
-#include <sys/types.h>
-#include <sys/stat.h>
-#if !defined(_MSC_VER) && !defined(__MINGW32__)
-#include <unistd.h>
-#include <sys/uio.h>
-#else
-#include <io.h>
-#endif
-#include <fcntl.h>
-using namespace llvm;
-
-//===----------------------------------------------------------------------===//
-// MemoryBuffer implementation itself.
-//===----------------------------------------------------------------------===//
-
-MemoryBuffer::~MemoryBuffer() {
- if (MustDeleteBuffer)
- delete [] BufferStart;
-}
-
-/// initCopyOf - Initialize this source buffer with a copy of the specified
-/// memory range. We make the copy so that we can null terminate it
-/// successfully.
-void MemoryBuffer::initCopyOf(const char *BufStart, const char *BufEnd) {
- size_t Size = BufEnd-BufStart;
- BufferStart = new char[Size+1];
- BufferEnd = BufferStart+Size;
- memcpy(const_cast<char*>(BufferStart), BufStart, Size);
- *const_cast<char*>(BufferEnd) = 0; // Null terminate buffer.
- MustDeleteBuffer = true;
-}
-
-/// init - Initialize this MemoryBuffer as a reference to externally allocated
-/// memory, memory that we know is already null terminated.
-void MemoryBuffer::init(const char *BufStart, const char *BufEnd) {
- assert(BufEnd[0] == 0 && "Buffer is not null terminated!");
- BufferStart = BufStart;
- BufferEnd = BufEnd;
- MustDeleteBuffer = false;
-}
-
-//===----------------------------------------------------------------------===//
-// MemoryBufferMem implementation.
-//===----------------------------------------------------------------------===//
-
-namespace {
-class MemoryBufferMem : public MemoryBuffer {
- std::string FileID;
-public:
- MemoryBufferMem(const char *Start, const char *End, const char *FID,
- bool Copy = false)
- : FileID(FID) {
- if (!Copy)
- init(Start, End);
- else
- initCopyOf(Start, End);
- }
-
- virtual const char *getBufferIdentifier() const {
- return FileID.c_str();
- }
-};
-}
-
-/// getMemBuffer - Open the specified memory range as a MemoryBuffer. Note
-/// that EndPtr[0] must be a null byte and be accessible!
-MemoryBuffer *MemoryBuffer::getMemBuffer(const char *StartPtr,
- const char *EndPtr,
- const char *BufferName) {
- return new MemoryBufferMem(StartPtr, EndPtr, BufferName);
-}
-
-/// getMemBufferCopy - Open the specified memory range as a MemoryBuffer,
-/// copying the contents and taking ownership of it. This has no requirements
-/// on EndPtr[0].
-MemoryBuffer *MemoryBuffer::getMemBufferCopy(const char *StartPtr,
- const char *EndPtr,
- const char *BufferName) {
- return new MemoryBufferMem(StartPtr, EndPtr, BufferName, true);
-}
-
-/// getNewUninitMemBuffer - Allocate a new MemoryBuffer of the specified size
-/// that is completely initialized to zeros. Note that the caller should
-/// initialize the memory allocated by this method. The memory is owned by
-/// the MemoryBuffer object.
-MemoryBuffer *MemoryBuffer::getNewUninitMemBuffer(size_t Size,
- const char *BufferName) {
- char *Buf = new char[Size+1];
- Buf[Size] = 0;
- MemoryBufferMem *SB = new MemoryBufferMem(Buf, Buf+Size, BufferName);
- // The memory for this buffer is owned by the MemoryBuffer.
- SB->MustDeleteBuffer = true;
- return SB;
-}
-
-/// getNewMemBuffer - Allocate a new MemoryBuffer of the specified size that
-/// is completely initialized to zeros. Note that the caller should
-/// initialize the memory allocated by this method. The memory is owned by
-/// the MemoryBuffer object.
-MemoryBuffer *MemoryBuffer::getNewMemBuffer(size_t Size,
- const char *BufferName) {
- MemoryBuffer *SB = getNewUninitMemBuffer(Size, BufferName);
- memset(const_cast<char*>(SB->getBufferStart()), 0, Size+1);
- return SB;
-}
-
-
-/// getFileOrSTDIN - Open the specified file as a MemoryBuffer, or open stdin
-/// if the Filename is "-". If an error occurs, this returns null and fills
-/// in *ErrStr with a reason. If stdin is empty, this API (unlike getSTDIN)
-/// returns an empty buffer.
-MemoryBuffer *MemoryBuffer::getFileOrSTDIN(const char *Filename,
- std::string *ErrStr,
- int64_t FileSize) {
- if (Filename[0] != '-' || Filename[1] != 0)
- return getFile(Filename, ErrStr, FileSize);
- MemoryBuffer *M = getSTDIN();
- if (M) return M;
-
- // If stdin was empty, M is null. Cons up an empty memory buffer now.
- const char *EmptyStr = "";
- return MemoryBuffer::getMemBuffer(EmptyStr, EmptyStr, "<stdin>");
-}
-
-//===----------------------------------------------------------------------===//
-// MemoryBuffer::getFile implementation.
-//===----------------------------------------------------------------------===//
-
-namespace {
-/// MemoryBufferMMapFile - This represents a file that was mapped in with the
-/// sys::Path::MapInFilePages method. When destroyed, it calls the
-/// sys::Path::UnMapFilePages method.
-class MemoryBufferMMapFile : public MemoryBuffer {
- std::string Filename;
-public:
- MemoryBufferMMapFile(const char *filename, const char *Pages, uint64_t Size)
- : Filename(filename) {
- init(Pages, Pages+Size);
- }
-
- virtual const char *getBufferIdentifier() const {
- return Filename.c_str();
- }
-
- ~MemoryBufferMMapFile() {
- sys::Path::UnMapFilePages(getBufferStart(), getBufferSize());
- }
-};
-}
-
-MemoryBuffer *MemoryBuffer::getFile(const char *Filename, std::string *ErrStr,
- int64_t FileSize) {
- int OpenFlags = 0;
-#ifdef O_BINARY
- OpenFlags |= O_BINARY; // Open input file in binary mode on win32.
-#endif
- int FD = ::open(Filename, O_RDONLY|OpenFlags);
- if (FD == -1) {
- if (ErrStr) *ErrStr = "could not open file";
- return 0;
- }
-
- // If we don't know the file size, use fstat to find out. fstat on an open
- // file descriptor is cheaper than stat on a random path.
- if (FileSize == -1) {
- struct stat FileInfo;
- // TODO: This should use fstat64 when available.
- if (fstat(FD, &FileInfo) == -1) {
- if (ErrStr) *ErrStr = "could not get file length";
- ::close(FD);
- return 0;
- }
- FileSize = FileInfo.st_size;
- }
-
-
- // If the file is large, try to use mmap to read it in. We don't use mmap
- // for small files, because this can severely fragment our address space. Also
- // don't try to map files that are exactly a multiple of the system page size,
- // as the file would not have the required null terminator.
- if (FileSize >= 4096*4 &&
- (FileSize & (sys::Process::GetPageSize()-1)) != 0) {
- if (const char *Pages = sys::Path::MapInFilePages(FD, FileSize)) {
- // Close the file descriptor, now that the whole file is in memory.
- ::close(FD);
- return new MemoryBufferMMapFile(Filename, Pages, FileSize);
- }
- }
-
- OwningPtr<MemoryBuffer> SB;
- SB.reset(MemoryBuffer::getNewUninitMemBuffer(FileSize, Filename));
- char *BufPtr = const_cast<char*>(SB->getBufferStart());
-
- size_t BytesLeft = FileSize;
- while (BytesLeft) {
- ssize_t NumRead = ::read(FD, BufPtr, BytesLeft);
- if (NumRead != -1) {
- BytesLeft -= NumRead;
- BufPtr += NumRead;
- } else if (errno == EINTR) {
- // try again
- } else {
- // error reading.
- close(FD);
- if (ErrStr) *ErrStr = "error reading file data";
- return 0;
- }
- }
- close(FD);
-
- return SB.take();
-}
-
-//===----------------------------------------------------------------------===//
-// MemoryBuffer::getSTDIN implementation.
-//===----------------------------------------------------------------------===//
-
-namespace {
-class STDINBufferFile : public MemoryBuffer {
-public:
- virtual const char *getBufferIdentifier() const {
- return "<stdin>";
- }
-};
-}
-
-MemoryBuffer *MemoryBuffer::getSTDIN() {
- char Buffer[4096*4];
-
- std::vector<char> FileData;
-
- // Read in all of the data from stdin, we cannot mmap stdin.
- sys::Program::ChangeStdinToBinary();
- while (size_t ReadBytes = fread(Buffer, sizeof(char), 4096*4, stdin))
- FileData.insert(FileData.end(), Buffer, Buffer+ReadBytes);
-
- FileData.push_back(0); // &FileData[Size] is invalid. So is &*FileData.end().
- size_t Size = FileData.size();
- if (Size <= 1)
- return 0;
- MemoryBuffer *B = new STDINBufferFile();
- B->initCopyOf(&FileData[0], &FileData[Size-1]);
- return B;
-}
diff --git a/release_23/lib/Support/PluginLoader.cpp b/release_23/lib/Support/PluginLoader.cpp
deleted file mode 100644
index 0635a9d52ca3..000000000000
--- a/release_23/lib/Support/PluginLoader.cpp
+++ /dev/null
@@ -1,44 +0,0 @@
-//===-- PluginLoader.cpp - Implement -load command line option ------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the -load <plugin> command line option handler.
-//
-//===----------------------------------------------------------------------===//
-
-#define DONT_GET_PLUGIN_LOADER_OPTION
-#include "llvm/Support/PluginLoader.h"
-#include "llvm/Support/Streams.h"
-#include "llvm/System/DynamicLibrary.h"
-#include <ostream>
-#include <vector>
-using namespace llvm;
-
-static std::vector<std::string> *Plugins;
-
-void PluginLoader::operator=(const std::string &Filename) {
- if (!Plugins)
- Plugins = new std::vector<std::string>();
-
- std::string Error;
- if (sys::DynamicLibrary::LoadLibraryPermanently(Filename.c_str(), &Error)) {
- cerr << "Error opening '" << Filename << "': " << Error
- << "\n -load request ignored.\n";
- } else {
- Plugins->push_back(Filename);
- }
-}
-
-unsigned PluginLoader::getNumPlugins() {
- return Plugins ? Plugins->size() : 0;
-}
-
-std::string &PluginLoader::getPlugin(unsigned num) {
- assert(Plugins && num < Plugins->size() && "Asking for an out of bounds plugin");
- return (*Plugins)[num];
-}
diff --git a/release_23/lib/Support/SlowOperationInformer.cpp b/release_23/lib/Support/SlowOperationInformer.cpp
deleted file mode 100644
index d5ffff9d937f..000000000000
--- a/release_23/lib/Support/SlowOperationInformer.cpp
+++ /dev/null
@@ -1,66 +0,0 @@
-//===-- SlowOperationInformer.cpp - Keep the user informed ----------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the SlowOperationInformer class for the LLVM debugger.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Support/SlowOperationInformer.h"
-#include "llvm/Support/Streams.h"
-#include "llvm/System/Alarm.h"
-#include <sstream>
-#include <cassert>
-using namespace llvm;
-
-SlowOperationInformer::SlowOperationInformer(const std::string &Name)
- : OperationName(Name), LastPrintAmount(0) {
- sys::SetupAlarm(1);
-}
-
-SlowOperationInformer::~SlowOperationInformer() {
- sys::TerminateAlarm();
- if (LastPrintAmount) {
- // If we have printed something, make _sure_ we print the 100% amount, and
- // also print a newline.
- cout << std::string(LastPrintAmount, '\b') << "Progress "
- << OperationName << ": 100% \n";
- }
-}
-
-/// progress - Clients should periodically call this method when they are in
-/// an exception-safe state. The Amount variable should indicate how far
-/// along the operation is, given in 1/10ths of a percent (in other words,
-/// Amount should range from 0 to 1000).
-bool SlowOperationInformer::progress(unsigned Amount) {
- int status = sys::AlarmStatus();
- if (status == -1) {
- cout << "\n";
- LastPrintAmount = 0;
- return true;
- }
-
- // If we haven't spent enough time in this operation to warrant displaying the
- // progress bar, don't do so yet.
- if (status == 0)
- return false;
-
- // Delete whatever we printed last time.
- std::string ToPrint = std::string(LastPrintAmount, '\b');
-
- std::ostringstream OS;
- OS << "Progress " << OperationName << ": " << Amount/10;
- if (unsigned Rem = Amount % 10)
- OS << "." << Rem << "%";
- else
- OS << "% ";
-
- LastPrintAmount = OS.str().size();
- cout << ToPrint+OS.str() << std::flush;
- return false;
-}
diff --git a/release_23/lib/Support/SmallPtrSet.cpp b/release_23/lib/Support/SmallPtrSet.cpp
deleted file mode 100644
index 4cbf2cd9e2fd..000000000000
--- a/release_23/lib/Support/SmallPtrSet.cpp
+++ /dev/null
@@ -1,223 +0,0 @@
-//===- llvm/ADT/SmallPtrSet.cpp - 'Normally small' pointer set ------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the SmallPtrSet class. See SmallPtrSet.h for an
-// overview of the algorithm.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/ADT/SmallPtrSet.h"
-#include "llvm/Support/MathExtras.h"
-#include <cstdlib>
-
-using namespace llvm;
-
-void SmallPtrSetImpl::shrink_and_clear() {
- assert(!isSmall() && "Can't shrink a small set!");
- free(CurArray);
-
- // Reduce the number of buckets.
- CurArraySize = NumElements > 16 ? 1 << (Log2_32_Ceil(NumElements) + 1) : 32;
- NumElements = NumTombstones = 0;
-
- // Install the new array. Clear all the buckets to empty.
- CurArray = (const void**)malloc(sizeof(void*) * (CurArraySize+1));
- assert(CurArray && "Failed to allocate memory?");
- memset(CurArray, -1, CurArraySize*sizeof(void*));
-
- // The end pointer, always valid, is set to a valid element to help the
- // iterator.
- CurArray[CurArraySize] = 0;
-}
-
-bool SmallPtrSetImpl::insert_imp(const void * Ptr) {
- if (isSmall()) {
- // Check to see if it is already in the set.
- for (const void **APtr = SmallArray, **E = SmallArray+NumElements;
- APtr != E; ++APtr)
- if (*APtr == Ptr)
- return false;
-
- // Nope, there isn't. If we stay small, just 'pushback' now.
- if (NumElements < CurArraySize-1) {
- SmallArray[NumElements++] = Ptr;
- return true;
- }
- // Otherwise, hit the big set case, which will call grow.
- }
-
- // If more than 3/4 of the array is full, grow.
- if (NumElements*4 >= CurArraySize*3 ||
- CurArraySize-(NumElements+NumTombstones) < CurArraySize/8)
- Grow();
-
- // Okay, we know we have space. Find a hash bucket.
- void **Bucket = const_cast<void**>(FindBucketFor((void*)Ptr));
- if (*Bucket == Ptr) return false; // Already inserted, good.
-
- // Otherwise, insert it!
- if (*Bucket == getTombstoneMarker())
- --NumTombstones;
- *Bucket = (void*)Ptr;
- ++NumElements; // Track density.
- return true;
-}
-
-bool SmallPtrSetImpl::erase_imp(const void * Ptr) {
- if (isSmall()) {
- // Check to see if it is in the set.
- for (const void **APtr = SmallArray, **E = SmallArray+NumElements;
- APtr != E; ++APtr)
- if (*APtr == Ptr) {
- // If it is in the set, replace this element.
- *APtr = E[-1];
- E[-1] = getEmptyMarker();
- --NumElements;
- return true;
- }
-
- return false;
- }
-
- // Okay, we know we have space. Find a hash bucket.
- void **Bucket = const_cast<void**>(FindBucketFor(Ptr));
- if (*Bucket != Ptr) return false; // Not in the set?
-
- // Set this as a tombstone.
- *Bucket = getTombstoneMarker();
- --NumElements;
- ++NumTombstones;
- return true;
-}
-
-const void * const *SmallPtrSetImpl::FindBucketFor(const void *Ptr) const {
- unsigned Bucket = Hash(Ptr);
- unsigned ArraySize = CurArraySize;
- unsigned ProbeAmt = 1;
- const void *const *Array = CurArray;
- const void *const *Tombstone = 0;
- while (1) {
- // Found Ptr's bucket?
- if (Array[Bucket] == Ptr)
- return Array+Bucket;
-
- // If we found an empty bucket, the pointer doesn't exist in the set.
- // Return a tombstone if we've seen one so far, or the empty bucket if
- // not.
- if (Array[Bucket] == getEmptyMarker())
- return Tombstone ? Tombstone : Array+Bucket;
-
- // If this is a tombstone, remember it. If Ptr ends up not in the set, we
- // prefer to return it than something that would require more probing.
- if (Array[Bucket] == getTombstoneMarker() && !Tombstone)
- Tombstone = Array+Bucket; // Remember the first tombstone found.
-
- // It's a hash collision or a tombstone. Reprobe.
- Bucket = (Bucket + ProbeAmt++) & (ArraySize-1);
- }
-}
-
-/// Grow - Allocate a larger backing store for the buckets and move it over.
-///
-void SmallPtrSetImpl::Grow() {
- // Allocate at twice as many buckets, but at least 128.
- unsigned OldSize = CurArraySize;
- unsigned NewSize = OldSize < 64 ? 128 : OldSize*2;
-
- const void **OldBuckets = CurArray;
- bool WasSmall = isSmall();
-
- // Install the new array. Clear all the buckets to empty.
- CurArray = (const void**)malloc(sizeof(void*) * (NewSize+1));
- assert(CurArray && "Failed to allocate memory?");
- CurArraySize = NewSize;
- memset(CurArray, -1, NewSize*sizeof(void*));
-
- // The end pointer, always valid, is set to a valid element to help the
- // iterator.
- CurArray[NewSize] = 0;
-
- // Copy over all the elements.
- if (WasSmall) {
- // Small sets store their elements in order.
- for (const void **BucketPtr = OldBuckets, **E = OldBuckets+NumElements;
- BucketPtr != E; ++BucketPtr) {
- const void *Elt = *BucketPtr;
- *const_cast<void**>(FindBucketFor(Elt)) = const_cast<void*>(Elt);
- }
- } else {
- // Copy over all valid entries.
- for (const void **BucketPtr = OldBuckets, **E = OldBuckets+OldSize;
- BucketPtr != E; ++BucketPtr) {
- // Copy over the element if it is valid.
- const void *Elt = *BucketPtr;
- if (Elt != getTombstoneMarker() && Elt != getEmptyMarker())
- *const_cast<void**>(FindBucketFor(Elt)) = const_cast<void*>(Elt);
- }
-
- free(OldBuckets);
- NumTombstones = 0;
- }
-}
-
-SmallPtrSetImpl::SmallPtrSetImpl(const SmallPtrSetImpl& that) {
- // If we're becoming small, prepare to insert into our stack space
- if (that.isSmall()) {
- CurArray = &SmallArray[0];
- // Otherwise, allocate new heap space (unless we were the same size)
- } else {
- CurArray = (const void**)malloc(sizeof(void*) * (that.CurArraySize+1));
- assert(CurArray && "Failed to allocate memory?");
- }
-
- // Copy over the new array size
- CurArraySize = that.CurArraySize;
-
- // Copy over the contents from the other set
- memcpy(CurArray, that.CurArray, sizeof(void*)*(CurArraySize+1));
-
- NumElements = that.NumElements;
- NumTombstones = that.NumTombstones;
-}
-
-/// CopyFrom - implement operator= from a smallptrset that has the same pointer
-/// type, but may have a different small size.
-void SmallPtrSetImpl::CopyFrom(const SmallPtrSetImpl &RHS) {
- if (isSmall() && RHS.isSmall())
- assert(CurArraySize == RHS.CurArraySize &&
- "Cannot assign sets with different small sizes");
-
- // If we're becoming small, prepare to insert into our stack space
- if (RHS.isSmall()) {
- if (!isSmall())
- free(CurArray);
- CurArray = &SmallArray[0];
- // Otherwise, allocate new heap space (unless we were the same size)
- } else if (CurArraySize != RHS.CurArraySize) {
- if (isSmall())
- CurArray = (const void**)malloc(sizeof(void*) * (RHS.CurArraySize+1));
- else
- CurArray = (const void**)realloc(CurArray, sizeof(void*)*(RHS.CurArraySize+1));
- assert(CurArray && "Failed to allocate memory?");
- }
-
- // Copy over the new array size
- CurArraySize = RHS.CurArraySize;
-
- // Copy over the contents from the other set
- memcpy(CurArray, RHS.CurArray, sizeof(void*)*(CurArraySize+1));
-
- NumElements = RHS.NumElements;
- NumTombstones = RHS.NumTombstones;
-}
-
-SmallPtrSetImpl::~SmallPtrSetImpl() {
- if (!isSmall())
- free(CurArray);
-}
diff --git a/release_23/lib/Support/Statistic.cpp b/release_23/lib/Support/Statistic.cpp
deleted file mode 100644
index 4516ebc6b344..000000000000
--- a/release_23/lib/Support/Statistic.cpp
+++ /dev/null
@@ -1,122 +0,0 @@
-//===-- Statistic.cpp - Easy way to expose stats information --------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the 'Statistic' class, which is designed to be an easy
-// way to expose various success metrics from passes. These statistics are
-// printed at the end of a run, when the -stats command line option is enabled
-// on the command line.
-//
-// This is useful for reporting information like the number of instructions
-// simplified, optimized or removed by various transformations, like this:
-//
-// static Statistic NumInstEliminated("GCSE", "Number of instructions killed");
-//
-// Later, in the code: ++NumInstEliminated;
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/ADT/Statistic.h"
-#include "llvm/Support/CommandLine.h"
-#include "llvm/Support/ManagedStatic.h"
-#include "llvm/Support/Streams.h"
-#include "llvm/ADT/StringExtras.h"
-#include <algorithm>
-#include <ostream>
-#include <cstring>
-using namespace llvm;
-
-// GetLibSupportInfoOutputFile - Return a file stream to print our output on.
-namespace llvm { extern std::ostream *GetLibSupportInfoOutputFile(); }
-
-/// -stats - Command line option to cause transformations to emit stats about
-/// what they did.
-///
-static cl::opt<bool>
-Enabled("stats", cl::desc("Enable statistics output from program"));
-
-
-namespace {
-/// StatisticInfo - This class is used in a ManagedStatic so that it is created
-/// on demand (when the first statistic is bumped) and destroyed only when
-/// llvm_shutdown is called. We print statistics from the destructor.
-class StatisticInfo {
- std::vector<const Statistic*> Stats;
-public:
- ~StatisticInfo();
-
- void addStatistic(const Statistic *S) {
- Stats.push_back(S);
- }
-};
-}
-
-static ManagedStatic<StatisticInfo> StatInfo;
-
-
-/// RegisterStatistic - The first time a statistic is bumped, this method is
-/// called.
-void Statistic::RegisterStatistic() {
- // If stats are enabled, inform StatInfo that this statistic should be
- // printed.
- if (Enabled)
- StatInfo->addStatistic(this);
- // Remember we have been registered.
- Initialized = true;
-}
-
-struct NameCompare {
- bool operator()(const Statistic *LHS, const Statistic *RHS) const {
- int Cmp = std::strcmp(LHS->getName(), RHS->getName());
- if (Cmp != 0) return Cmp < 0;
-
- // Secondary key is the description.
- return std::strcmp(LHS->getDesc(), RHS->getDesc()) < 0;
- }
-};
-
-// Print information when destroyed, iff command line option is specified.
-StatisticInfo::~StatisticInfo() {
- // Statistics not enabled?
- if (Stats.empty()) return;
-
- // Get the stream to write to.
- std::ostream &OutStream = *GetLibSupportInfoOutputFile();
-
- // Figure out how long the biggest Value and Name fields are.
- unsigned MaxNameLen = 0, MaxValLen = 0;
- for (size_t i = 0, e = Stats.size(); i != e; ++i) {
- MaxValLen = std::max(MaxValLen,
- (unsigned)utostr(Stats[i]->getValue()).size());
- MaxNameLen = std::max(MaxNameLen,
- (unsigned)std::strlen(Stats[i]->getName()));
- }
-
- // Sort the fields by name.
- std::stable_sort(Stats.begin(), Stats.end(), NameCompare());
-
- // Print out the statistics header...
- OutStream << "===" << std::string(73, '-') << "===\n"
- << " ... Statistics Collected ...\n"
- << "===" << std::string(73, '-') << "===\n\n";
-
- // Print all of the statistics.
- for (size_t i = 0, e = Stats.size(); i != e; ++i) {
- std::string CountStr = utostr(Stats[i]->getValue());
- OutStream << std::string(MaxValLen-CountStr.size(), ' ')
- << CountStr << " " << Stats[i]->getName()
- << std::string(MaxNameLen-std::strlen(Stats[i]->getName()), ' ')
- << " - " << Stats[i]->getDesc() << "\n";
-
- }
-
- OutStream << std::endl; // Flush the output stream...
-
- if (&OutStream != cerr.stream() && &OutStream != cout.stream())
- delete &OutStream; // Close the file.
-}
diff --git a/release_23/lib/Support/Streams.cpp b/release_23/lib/Support/Streams.cpp
deleted file mode 100644
index 122955ff4eb7..000000000000
--- a/release_23/lib/Support/Streams.cpp
+++ /dev/null
@@ -1,21 +0,0 @@
-//===-- Streams.cpp - Wrappers for iostreams ------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements a wrapper for the std::cout and std::cerr I/O streams.
-// It prevents the need to include <iostream> to each file just to get I/O.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Support/Streams.h"
-#include <iostream>
-using namespace llvm;
-
-OStream llvm::cout(std::cout);
-OStream llvm::cerr(std::cerr);
-IStream llvm::cin(std::cin);
diff --git a/release_23/lib/Support/StringExtras.cpp b/release_23/lib/Support/StringExtras.cpp
deleted file mode 100644
index d403a083d47f..000000000000
--- a/release_23/lib/Support/StringExtras.cpp
+++ /dev/null
@@ -1,111 +0,0 @@
-//===-- StringExtras.cpp - Implement the StringExtras header --------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the StringExtras.h header
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/ADT/StringExtras.h"
-#include <cstring>
-using namespace llvm;
-
-/// getToken - This function extracts one token from source, ignoring any
-/// leading characters that appear in the Delimiters string, and ending the
-/// token at any of the characters that appear in the Delimiters string. If
-/// there are no tokens in the source string, an empty string is returned.
-/// The Source source string is updated in place to remove the returned string
-/// and any delimiter prefix from it.
-std::string llvm::getToken(std::string &Source, const char *Delimiters) {
- size_t NumDelimiters = std::strlen(Delimiters);
-
- // Figure out where the token starts.
- std::string::size_type Start =
- Source.find_first_not_of(Delimiters, 0, NumDelimiters);
- if (Start == std::string::npos) Start = Source.size();
-
- // Find the next occurance of the delimiter.
- std::string::size_type End =
- Source.find_first_of(Delimiters, Start, NumDelimiters);
- if (End == std::string::npos) End = Source.size();
-
- // Create the return token.
- std::string Result = std::string(Source.begin()+Start, Source.begin()+End);
-
- // Erase the token that we read in.
- Source.erase(Source.begin(), Source.begin()+End);
-
- return Result;
-}
-
-/// SplitString - Split up the specified string according to the specified
-/// delimiters, appending the result fragments to the output list.
-void llvm::SplitString(const std::string &Source,
- std::vector<std::string> &OutFragments,
- const char *Delimiters) {
- std::string S = Source;
-
- std::string S2 = getToken(S, Delimiters);
- while (!S2.empty()) {
- OutFragments.push_back(S2);
- S2 = getToken(S, Delimiters);
- }
-}
-
-
-
-/// UnescapeString - Modify the argument string, turning two character sequences
-/// @verbatim
-/// like '\\' 'n' into '\n'. This handles: \e \a \b \f \n \r \t \v \' \ and
-/// \num (where num is a 1-3 byte octal value).
-/// @endverbatim
-void llvm::UnescapeString(std::string &Str) {
- for (unsigned i = 0; i != Str.size(); ++i) {
- if (Str[i] == '\\' && i != Str.size()-1) {
- switch (Str[i+1]) {
- default: continue; // Don't execute the code after the switch.
- case 'a': Str[i] = '\a'; break;
- case 'b': Str[i] = '\b'; break;
- case 'e': Str[i] = 27; break;
- case 'f': Str[i] = '\f'; break;
- case 'n': Str[i] = '\n'; break;
- case 'r': Str[i] = '\r'; break;
- case 't': Str[i] = '\t'; break;
- case 'v': Str[i] = '\v'; break;
- case '\'': Str[i] = '\''; break;
- case '\\': Str[i] = '\\'; break;
- }
- // Nuke the second character.
- Str.erase(Str.begin()+i+1);
- }
- }
-}
-
-/// EscapeString - Modify the argument string, turning '\\' and anything that
-/// doesn't satisfy std::isprint into an escape sequence.
-void llvm::EscapeString(std::string &Str) {
- for (unsigned i = 0; i != Str.size(); ++i) {
- if (Str[i] == '\\') {
- ++i;
- Str.insert(Str.begin()+i, '\\');
- } else if (Str[i] == '\t') {
- Str[i++] = '\\';
- Str.insert(Str.begin()+i, 't');
- } else if (Str[i] == '\n') {
- Str[i++] = '\\';
- Str.insert(Str.begin()+i, 'n');
- } else if (!std::isprint(Str[i])) {
- // Always expand to a 3-digit octal escape.
- unsigned Char = Str[i];
- Str[i++] = '\\';
- Str.insert(Str.begin()+i++, '0'+((Char/64) & 7));
- Str.insert(Str.begin()+i++, '0'+((Char/8) & 7));
- Str.insert(Str.begin()+i , '0'+( Char & 7));
- }
- }
-}
diff --git a/release_23/lib/Support/StringMap.cpp b/release_23/lib/Support/StringMap.cpp
deleted file mode 100644
index 0c61732a61b3..000000000000
--- a/release_23/lib/Support/StringMap.cpp
+++ /dev/null
@@ -1,234 +0,0 @@
-//===--- StringMap.cpp - String Hash table map implementation -------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the StringMap class.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/ADT/StringMap.h"
-#include <cassert>
-using namespace llvm;
-
-StringMapImpl::StringMapImpl(unsigned InitSize, unsigned itemSize) {
- ItemSize = itemSize;
-
- // If a size is specified, initialize the table with that many buckets.
- if (InitSize) {
- init(InitSize);
- return;
- }
-
- // Otherwise, initialize it with zero buckets to avoid the allocation.
- TheTable = 0;
- NumBuckets = 0;
- NumItems = 0;
- NumTombstones = 0;
-}
-
-void StringMapImpl::init(unsigned InitSize) {
- assert((InitSize & (InitSize-1)) == 0 &&
- "Init Size must be a power of 2 or zero!");
- NumBuckets = InitSize ? InitSize : 16;
- NumItems = 0;
- NumTombstones = 0;
-
- TheTable = (ItemBucket*)calloc(NumBuckets+1, sizeof(ItemBucket));
-
- // Allocate one extra bucket, set it to look filled so the iterators stop at
- // end.
- TheTable[NumBuckets].Item = (StringMapEntryBase*)2;
-}
-
-
-/// HashString - Compute a hash code for the specified string.
-///
-static unsigned HashString(const char *Start, const char *End) {
- // Bernstein hash function.
- unsigned int Result = 0;
- // TODO: investigate whether a modified bernstein hash function performs
- // better: http://eternallyconfuzzled.com/tuts/algorithms/jsw_tut_hashing.aspx
- // X*33+c -> X*33^c
- while (Start != End)
- Result = Result * 33 + *Start++;
- Result = Result + (Result >> 5);
- return Result;
-}
-
-/// LookupBucketFor - Look up the bucket that the specified string should end
-/// up in. If it already exists as a key in the map, the Item pointer for the
-/// specified bucket will be non-null. Otherwise, it will be null. In either
-/// case, the FullHashValue field of the bucket will be set to the hash value
-/// of the string.
-unsigned StringMapImpl::LookupBucketFor(const char *NameStart,
- const char *NameEnd) {
- unsigned HTSize = NumBuckets;
- if (HTSize == 0) { // Hash table unallocated so far?
- init(16);
- HTSize = NumBuckets;
- }
- unsigned FullHashValue = HashString(NameStart, NameEnd);
- unsigned BucketNo = FullHashValue & (HTSize-1);
-
- unsigned ProbeAmt = 1;
- int FirstTombstone = -1;
- while (1) {
- ItemBucket &Bucket = TheTable[BucketNo];
- StringMapEntryBase *BucketItem = Bucket.Item;
- // If we found an empty bucket, this key isn't in the table yet, return it.
- if (BucketItem == 0) {
- // If we found a tombstone, we want to reuse the tombstone instead of an
- // empty bucket. This reduces probing.
- if (FirstTombstone != -1) {
- TheTable[FirstTombstone].FullHashValue = FullHashValue;
- return FirstTombstone;
- }
-
- Bucket.FullHashValue = FullHashValue;
- return BucketNo;
- }
-
- if (BucketItem == getTombstoneVal()) {
- // Skip over tombstones. However, remember the first one we see.
- if (FirstTombstone == -1) FirstTombstone = BucketNo;
- } else if (Bucket.FullHashValue == FullHashValue) {
- // If the full hash value matches, check deeply for a match. The common
- // case here is that we are only looking at the buckets (for item info
- // being non-null and for the full hash value) not at the items. This
- // is important for cache locality.
-
- // Do the comparison like this because NameStart isn't necessarily
- // null-terminated!
- char *ItemStr = (char*)BucketItem+ItemSize;
- unsigned ItemStrLen = BucketItem->getKeyLength();
- if (unsigned(NameEnd-NameStart) == ItemStrLen &&
- memcmp(ItemStr, NameStart, ItemStrLen) == 0) {
- // We found a match!
- return BucketNo;
- }
- }
-
- // Okay, we didn't find the item. Probe to the next bucket.
- BucketNo = (BucketNo+ProbeAmt) & (HTSize-1);
-
- // Use quadratic probing, it has fewer clumping artifacts than linear
- // probing and has good cache behavior in the common case.
- ++ProbeAmt;
- }
-}
-
-
-/// FindKey - Look up the bucket that contains the specified key. If it exists
-/// in the map, return the bucket number of the key. Otherwise return -1.
-/// This does not modify the map.
-int StringMapImpl::FindKey(const char *KeyStart, const char *KeyEnd) const {
- unsigned HTSize = NumBuckets;
- if (HTSize == 0) return -1; // Really empty table?
- unsigned FullHashValue = HashString(KeyStart, KeyEnd);
- unsigned BucketNo = FullHashValue & (HTSize-1);
-
- unsigned ProbeAmt = 1;
- while (1) {
- ItemBucket &Bucket = TheTable[BucketNo];
- StringMapEntryBase *BucketItem = Bucket.Item;
- // If we found an empty bucket, this key isn't in the table yet, return.
- if (BucketItem == 0)
- return -1;
-
- if (BucketItem == getTombstoneVal()) {
- // Ignore tombstones.
- } else if (Bucket.FullHashValue == FullHashValue) {
- // If the full hash value matches, check deeply for a match. The common
- // case here is that we are only looking at the buckets (for item info
- // being non-null and for the full hash value) not at the items. This
- // is important for cache locality.
-
- // Do the comparison like this because NameStart isn't necessarily
- // null-terminated!
- char *ItemStr = (char*)BucketItem+ItemSize;
- unsigned ItemStrLen = BucketItem->getKeyLength();
- if (unsigned(KeyEnd-KeyStart) == ItemStrLen &&
- memcmp(ItemStr, KeyStart, ItemStrLen) == 0) {
- // We found a match!
- return BucketNo;
- }
- }
-
- // Okay, we didn't find the item. Probe to the next bucket.
- BucketNo = (BucketNo+ProbeAmt) & (HTSize-1);
-
- // Use quadratic probing, it has fewer clumping artifacts than linear
- // probing and has good cache behavior in the common case.
- ++ProbeAmt;
- }
-}
-
-/// RemoveKey - Remove the specified StringMapEntry from the table, but do not
-/// delete it. This aborts if the value isn't in the table.
-void StringMapImpl::RemoveKey(StringMapEntryBase *V) {
- const char *VStr = (char*)V + ItemSize;
- StringMapEntryBase *V2 = RemoveKey(VStr, VStr+V->getKeyLength());
- V2 = V2;
- assert(V == V2 && "Didn't find key?");
-}
-
-/// RemoveKey - Remove the StringMapEntry for the specified key from the
-/// table, returning it. If the key is not in the table, this returns null.
-StringMapEntryBase *StringMapImpl::RemoveKey(const char *KeyStart,
- const char *KeyEnd) {
- int Bucket = FindKey(KeyStart, KeyEnd);
- if (Bucket == -1) return 0;
-
- StringMapEntryBase *Result = TheTable[Bucket].Item;
- TheTable[Bucket].Item = getTombstoneVal();
- --NumItems;
- ++NumTombstones;
- return Result;
-}
-
-
-
-/// RehashTable - Grow the table, redistributing values into the buckets with
-/// the appropriate mod-of-hashtable-size.
-void StringMapImpl::RehashTable() {
- unsigned NewSize = NumBuckets*2;
- // Allocate one extra bucket which will always be non-empty. This allows the
- // iterators to stop at end.
- ItemBucket *NewTableArray =(ItemBucket*)calloc(NewSize+1, sizeof(ItemBucket));
- NewTableArray[NewSize].Item = (StringMapEntryBase*)2;
-
- // Rehash all the items into their new buckets. Luckily :) we already have
- // the hash values available, so we don't have to rehash any strings.
- for (ItemBucket *IB = TheTable, *E = TheTable+NumBuckets; IB != E; ++IB) {
- if (IB->Item && IB->Item != getTombstoneVal()) {
- // Fast case, bucket available.
- unsigned FullHash = IB->FullHashValue;
- unsigned NewBucket = FullHash & (NewSize-1);
- if (NewTableArray[NewBucket].Item == 0) {
- NewTableArray[FullHash & (NewSize-1)].Item = IB->Item;
- NewTableArray[FullHash & (NewSize-1)].FullHashValue = FullHash;
- continue;
- }
-
- // Otherwise probe for a spot.
- unsigned ProbeSize = 1;
- do {
- NewBucket = (NewBucket + ProbeSize++) & (NewSize-1);
- } while (NewTableArray[NewBucket].Item);
-
- // Finally found a slot. Fill it in.
- NewTableArray[NewBucket].Item = IB->Item;
- NewTableArray[NewBucket].FullHashValue = FullHash;
- }
- }
-
- free(TheTable);
-
- TheTable = NewTableArray;
- NumBuckets = NewSize;
-}
diff --git a/release_23/lib/Support/StringPool.cpp b/release_23/lib/Support/StringPool.cpp
deleted file mode 100644
index b9c1fd0465bd..000000000000
--- a/release_23/lib/Support/StringPool.cpp
+++ /dev/null
@@ -1,35 +0,0 @@
-//===-- StringPool.cpp - Interned string pool -----------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the StringPool class.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Support/StringPool.h"
-#include "llvm/Support/Streams.h"
-
-using namespace llvm;
-
-StringPool::StringPool() {}
-
-StringPool::~StringPool() {
- assert(InternTable.empty() && "PooledStringPtr leaked!");
-}
-
-PooledStringPtr StringPool::intern(const char *Begin, const char *End) {
- table_t::iterator I = InternTable.find(Begin, End);
- if (I != InternTable.end())
- return PooledStringPtr(&*I);
-
- entry_t *S = entry_t::Create(Begin, End);
- S->getValue().Pool = this;
- InternTable.insert(S);
-
- return PooledStringPtr(S);
-}
diff --git a/release_23/lib/Support/SystemUtils.cpp b/release_23/lib/Support/SystemUtils.cpp
deleted file mode 100644
index 80d6e4cba9fb..000000000000
--- a/release_23/lib/Support/SystemUtils.cpp
+++ /dev/null
@@ -1,58 +0,0 @@
-//===- SystemUtils.cpp - Utilities for low-level system tasks -------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains functions used to do a variety of low-level, often
-// system-specific, tasks.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Support/Streams.h"
-#include "llvm/Support/SystemUtils.h"
-#include "llvm/System/Process.h"
-#include "llvm/System/Program.h"
-#include <ostream>
-using namespace llvm;
-
-bool llvm::CheckBitcodeOutputToConsole(std::ostream* stream_to_check,
- bool print_warning) {
- if (stream_to_check == cout.stream() &&
- sys::Process::StandardOutIsDisplayed()) {
- if (print_warning) {
- cerr << "WARNING: You're attempting to print out a bitcode file.\n"
- << "This is inadvisable as it may cause display problems. If\n"
- << "you REALLY want to taste LLVM bitcode first-hand, you\n"
- << "can force output with the `-f' option.\n\n";
- }
- return true;
- }
- return false;
-}
-
-/// FindExecutable - Find a named executable, giving the argv[0] of program
-/// being executed. This allows us to find another LLVM tool if it is built
-/// into the same directory, but that directory is neither the current
-/// directory, nor in the PATH. If the executable cannot be found, return an
-/// empty string.
-///
-#undef FindExecutable // needed on windows :(
-sys::Path llvm::FindExecutable(const std::string &ExeName,
- const std::string &ProgramPath) {
- // First check the directory that the calling program is in. We can do this
- // if ProgramPath contains at least one / character, indicating that it is a
- // relative path to bugpoint itself.
- sys::Path Result ( ProgramPath );
- Result.eraseComponent();
- if (!Result.isEmpty()) {
- Result.appendComponent(ExeName);
- if (Result.canExecute())
- return Result;
- }
-
- return sys::Program::FindProgramByName(ExeName);
-}
diff --git a/release_23/lib/Support/Timer.cpp b/release_23/lib/Support/Timer.cpp
deleted file mode 100644
index 9cbb3c705c54..000000000000
--- a/release_23/lib/Support/Timer.cpp
+++ /dev/null
@@ -1,355 +0,0 @@
-//===-- Timer.cpp - Interval Timing Support -------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// Interval Timing implementation.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Support/Timer.h"
-#include "llvm/Support/CommandLine.h"
-#include "llvm/Support/ManagedStatic.h"
-#include "llvm/Support/Streams.h"
-#include "llvm/System/Process.h"
-#include <algorithm>
-#include <fstream>
-#include <functional>
-#include <map>
-using namespace llvm;
-
-// GetLibSupportInfoOutputFile - Return a file stream to print our output on.
-namespace llvm { extern std::ostream *GetLibSupportInfoOutputFile(); }
-
-// getLibSupportInfoOutputFilename - This ugly hack is brought to you courtesy
-// of constructor/destructor ordering being unspecified by C++. Basically the
-// problem is that a Statistic object gets destroyed, which ends up calling
-// 'GetLibSupportInfoOutputFile()' (below), which calls this function.
-// LibSupportInfoOutputFilename used to be a global variable, but sometimes it
-// would get destroyed before the Statistic, causing havoc to ensue. We "fix"
-// this by creating the string the first time it is needed and never destroying
-// it.
-static ManagedStatic<std::string> LibSupportInfoOutputFilename;
-static std::string &getLibSupportInfoOutputFilename() {
- return *LibSupportInfoOutputFilename;
-}
-
-namespace {
- static cl::opt<bool>
- TrackSpace("track-memory", cl::desc("Enable -time-passes memory "
- "tracking (this may be slow)"),
- cl::Hidden);
-
- static cl::opt<std::string, true>
- InfoOutputFilename("info-output-file", cl::value_desc("filename"),
- cl::desc("File to append -stats and -timer output to"),
- cl::Hidden, cl::location(getLibSupportInfoOutputFilename()));
-}
-
-static TimerGroup *DefaultTimerGroup = 0;
-static TimerGroup *getDefaultTimerGroup() {
- if (DefaultTimerGroup) return DefaultTimerGroup;
- return DefaultTimerGroup = new TimerGroup("Miscellaneous Ungrouped Timers");
-}
-
-Timer::Timer(const std::string &N)
- : Elapsed(0), UserTime(0), SystemTime(0), MemUsed(0), PeakMem(0), Name(N),
- Started(false), TG(getDefaultTimerGroup()) {
- TG->addTimer();
-}
-
-Timer::Timer(const std::string &N, TimerGroup &tg)
- : Elapsed(0), UserTime(0), SystemTime(0), MemUsed(0), PeakMem(0), Name(N),
- Started(false), TG(&tg) {
- TG->addTimer();
-}
-
-Timer::Timer(const Timer &T) {
- TG = T.TG;
- if (TG) TG->addTimer();
- operator=(T);
-}
-
-
-// Copy ctor, initialize with no TG member.
-Timer::Timer(bool, const Timer &T) {
- TG = T.TG; // Avoid assertion in operator=
- operator=(T); // Copy contents
- TG = 0;
-}
-
-
-Timer::~Timer() {
- if (TG) {
- if (Started) {
- Started = false;
- TG->addTimerToPrint(*this);
- }
- TG->removeTimer();
- }
-}
-
-static inline size_t getMemUsage() {
- if (TrackSpace)
- return sys::Process::GetMallocUsage();
- return 0;
-}
-
-struct TimeRecord {
- double Elapsed, UserTime, SystemTime;
- ssize_t MemUsed;
-};
-
-static TimeRecord getTimeRecord(bool Start) {
- TimeRecord Result;
-
- sys::TimeValue now(0,0);
- sys::TimeValue user(0,0);
- sys::TimeValue sys(0,0);
-
- ssize_t MemUsed = 0;
- if (Start) {
- MemUsed = getMemUsage();
- sys::Process::GetTimeUsage(now,user,sys);
- } else {
- sys::Process::GetTimeUsage(now,user,sys);
- MemUsed = getMemUsage();
- }
-
- Result.Elapsed = now.seconds() + now.microseconds() / 1000000.0;
- Result.UserTime = user.seconds() + user.microseconds() / 1000000.0;
- Result.SystemTime = sys.seconds() + sys.microseconds() / 1000000.0;
- Result.MemUsed = MemUsed;
-
- return Result;
-}
-
-static ManagedStatic<std::vector<Timer*> > ActiveTimers;
-
-void Timer::startTimer() {
- Started = true;
- TimeRecord TR = getTimeRecord(true);
- Elapsed -= TR.Elapsed;
- UserTime -= TR.UserTime;
- SystemTime -= TR.SystemTime;
- MemUsed -= TR.MemUsed;
- PeakMemBase = TR.MemUsed;
- ActiveTimers->push_back(this);
-}
-
-void Timer::stopTimer() {
- TimeRecord TR = getTimeRecord(false);
- Elapsed += TR.Elapsed;
- UserTime += TR.UserTime;
- SystemTime += TR.SystemTime;
- MemUsed += TR.MemUsed;
-
- if (ActiveTimers->back() == this) {
- ActiveTimers->pop_back();
- } else {
- std::vector<Timer*>::iterator I =
- std::find(ActiveTimers->begin(), ActiveTimers->end(), this);
- assert(I != ActiveTimers->end() && "stop but no startTimer?");
- ActiveTimers->erase(I);
- }
-}
-
-void Timer::sum(const Timer &T) {
- Elapsed += T.Elapsed;
- UserTime += T.UserTime;
- SystemTime += T.SystemTime;
- MemUsed += T.MemUsed;
- PeakMem += T.PeakMem;
-}
-
-/// addPeakMemoryMeasurement - This method should be called whenever memory
-/// usage needs to be checked. It adds a peak memory measurement to the
-/// currently active timers, which will be printed when the timer group prints
-///
-void Timer::addPeakMemoryMeasurement() {
- size_t MemUsed = getMemUsage();
-
- for (std::vector<Timer*>::iterator I = ActiveTimers->begin(),
- E = ActiveTimers->end(); I != E; ++I)
- (*I)->PeakMem = std::max((*I)->PeakMem, MemUsed-(*I)->PeakMemBase);
-}
-
-//===----------------------------------------------------------------------===//
-// NamedRegionTimer Implementation
-//===----------------------------------------------------------------------===//
-
-static ManagedStatic<std::map<std::string, Timer> > NamedTimers;
-
-static Timer &getNamedRegionTimer(const std::string &Name) {
- std::map<std::string, Timer>::iterator I = NamedTimers->lower_bound(Name);
- if (I != NamedTimers->end() && I->first == Name)
- return I->second;
-
- return NamedTimers->insert(I, std::make_pair(Name, Timer(Name)))->second;
-}
-
-NamedRegionTimer::NamedRegionTimer(const std::string &Name)
- : TimeRegion(getNamedRegionTimer(Name)) {}
-
-
-//===----------------------------------------------------------------------===//
-// TimerGroup Implementation
-//===----------------------------------------------------------------------===//
-
-// printAlignedFP - Simulate the printf "%A.Bf" format, where A is the
-// TotalWidth size, and B is the AfterDec size.
-//
-static void printAlignedFP(double Val, unsigned AfterDec, unsigned TotalWidth,
- std::ostream &OS) {
- assert(TotalWidth >= AfterDec+1 && "Bad FP Format!");
- OS.width(TotalWidth-AfterDec-1);
- char OldFill = OS.fill();
- OS.fill(' ');
- OS << (int)Val; // Integer part;
- OS << ".";
- OS.width(AfterDec);
- OS.fill('0');
- unsigned ResultFieldSize = 1;
- while (AfterDec--) ResultFieldSize *= 10;
- OS << (int)(Val*ResultFieldSize) % ResultFieldSize;
- OS.fill(OldFill);
-}
-
-static void printVal(double Val, double Total, std::ostream &OS) {
- if (Total < 1e-7) // Avoid dividing by zero...
- OS << " ----- ";
- else {
- OS << " ";
- printAlignedFP(Val, 4, 7, OS);
- OS << " (";
- printAlignedFP(Val*100/Total, 1, 5, OS);
- OS << "%)";
- }
-}
-
-void Timer::print(const Timer &Total, std::ostream &OS) {
- if (Total.UserTime)
- printVal(UserTime, Total.UserTime, OS);
- if (Total.SystemTime)
- printVal(SystemTime, Total.SystemTime, OS);
- if (Total.getProcessTime())
- printVal(getProcessTime(), Total.getProcessTime(), OS);
- printVal(Elapsed, Total.Elapsed, OS);
-
- OS << " ";
-
- if (Total.MemUsed) {
- OS.width(9);
- OS << MemUsed << " ";
- }
- if (Total.PeakMem) {
- if (PeakMem) {
- OS.width(9);
- OS << PeakMem << " ";
- } else
- OS << " ";
- }
- OS << Name << "\n";
-
- Started = false; // Once printed, don't print again
-}
-
-// GetLibSupportInfoOutputFile - Return a file stream to print our output on...
-std::ostream *
-llvm::GetLibSupportInfoOutputFile() {
- std::string &LibSupportInfoOutputFilename = getLibSupportInfoOutputFilename();
- if (LibSupportInfoOutputFilename.empty())
- return cerr.stream();
- if (LibSupportInfoOutputFilename == "-")
- return cout.stream();
-
- std::ostream *Result = new std::ofstream(LibSupportInfoOutputFilename.c_str(),
- std::ios::app);
- if (!Result->good()) {
- cerr << "Error opening info-output-file '"
- << LibSupportInfoOutputFilename << " for appending!\n";
- delete Result;
- return cerr.stream();
- }
- return Result;
-}
-
-
-void TimerGroup::removeTimer() {
- if (--NumTimers == 0 && !TimersToPrint.empty()) { // Print timing report...
- // Sort the timers in descending order by amount of time taken...
- std::sort(TimersToPrint.begin(), TimersToPrint.end(),
- std::greater<Timer>());
-
- // Figure out how many spaces to indent TimerGroup name...
- unsigned Padding = (80-Name.length())/2;
- if (Padding > 80) Padding = 0; // Don't allow "negative" numbers
-
- std::ostream *OutStream = GetLibSupportInfoOutputFile();
-
- ++NumTimers;
- { // Scope to contain Total timer... don't allow total timer to drop us to
- // zero timers...
- Timer Total("TOTAL");
-
- for (unsigned i = 0, e = TimersToPrint.size(); i != e; ++i)
- Total.sum(TimersToPrint[i]);
-
- // Print out timing header...
- *OutStream << "===" << std::string(73, '-') << "===\n"
- << std::string(Padding, ' ') << Name << "\n"
- << "===" << std::string(73, '-')
- << "===\n";
-
- // If this is not an collection of ungrouped times, print the total time.
- // Ungrouped timers don't really make sense to add up. We still print the
- // TOTAL line to make the percentages make sense.
- if (this != DefaultTimerGroup) {
- *OutStream << " Total Execution Time: ";
-
- printAlignedFP(Total.getProcessTime(), 4, 5, *OutStream);
- *OutStream << " seconds (";
- printAlignedFP(Total.getWallTime(), 4, 5, *OutStream);
- *OutStream << " wall clock)\n";
- }
- *OutStream << "\n";
-
- if (Total.UserTime)
- *OutStream << " ---User Time---";
- if (Total.SystemTime)
- *OutStream << " --System Time--";
- if (Total.getProcessTime())
- *OutStream << " --User+System--";
- *OutStream << " ---Wall Time---";
- if (Total.getMemUsed())
- *OutStream << " ---Mem---";
- if (Total.getPeakMem())
- *OutStream << " -PeakMem-";
- *OutStream << " --- Name ---\n";
-
- // Loop through all of the timing data, printing it out...
- for (unsigned i = 0, e = TimersToPrint.size(); i != e; ++i)
- TimersToPrint[i].print(Total, *OutStream);
-
- Total.print(Total, *OutStream);
- *OutStream << std::endl; // Flush output
- }
- --NumTimers;
-
- TimersToPrint.clear();
-
- if (OutStream != cerr.stream() && OutStream != cout.stream())
- delete OutStream; // Close the file...
- }
-
- // Delete default timer group!
- if (NumTimers == 0 && this == DefaultTimerGroup) {
- delete DefaultTimerGroup;
- DefaultTimerGroup = 0;
- }
-}
-
diff --git a/release_23/lib/System/Alarm.cpp b/release_23/lib/System/Alarm.cpp
deleted file mode 100644
index 0014ca716b33..000000000000
--- a/release_23/lib/System/Alarm.cpp
+++ /dev/null
@@ -1,33 +0,0 @@
-//===- Alarm.cpp - Alarm Generation Support ---------------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the Alarm functionality
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/System/Alarm.h"
-#include "llvm/Config/config.h"
-
-namespace llvm {
-using namespace sys;
-
-//===----------------------------------------------------------------------===//
-//=== WARNING: Implementation here must contain only TRULY operating system
-//=== independent code.
-//===----------------------------------------------------------------------===//
-
-}
-
-// Include the platform-specific parts of this class.
-#ifdef LLVM_ON_UNIX
-#include "Unix/Alarm.inc"
-#endif
-#ifdef LLVM_ON_WIN32
-#include "Win32/Alarm.inc"
-#endif
diff --git a/release_23/lib/System/Disassembler.cpp b/release_23/lib/System/Disassembler.cpp
deleted file mode 100644
index f44dd7f404f2..000000000000
--- a/release_23/lib/System/Disassembler.cpp
+++ /dev/null
@@ -1,75 +0,0 @@
-//===- lib/System/Disassembler.cpp ------------------------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the necessary glue to call external disassembler
-// libraries.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Config/config.h"
-#include "llvm/System/Disassembler.h"
-
-#include <cassert>
-#include <iomanip>
-#include <string>
-#include <sstream>
-
-#if USE_UDIS86
-#include <udis86.h>
-#endif
-
-using namespace llvm;
-
-bool llvm::sys::hasDisassembler(void)
-{
-#if defined (__i386__) || defined (__amd64__) || defined (__x86_64__)
- // We have option to enable udis86 library.
- return true;
-#else
- return false;
-#endif
-}
-
-std::string llvm::sys::disassembleBuffer(uint8_t* start, size_t length,
- uint64_t pc) {
- std::stringstream res;
-
-#if defined (__i386__) || defined (__amd64__) || defined (__x86_64__)
- unsigned bits;
-# if defined(__i386__)
- bits = 32;
-# else
- bits = 64;
-# endif
-
-# if USE_UDIS86
- ud_t ud_obj;
-
- ud_init(&ud_obj);
- ud_set_input_buffer(&ud_obj, start, length);
- ud_set_mode(&ud_obj, bits);
- ud_set_pc(&ud_obj, pc);
- ud_set_syntax(&ud_obj, UD_SYN_ATT);
-
- res << std::setbase(16)
- << std::setw(bits/4);
-
- while (ud_disassemble(&ud_obj)) {
- res << ud_insn_off(&ud_obj) << ":\t" << ud_insn_asm(&ud_obj) << "\n";
- }
-# else
- res << "No disassembler available. See configure help for options.\n";
-# endif
-
-#else
- res << "No disassembler available. See configure help for options.\n";
-#endif
-
- return res.str();
-}
diff --git a/release_23/lib/System/DynamicLibrary.cpp b/release_23/lib/System/DynamicLibrary.cpp
deleted file mode 100644
index 572ba496e191..000000000000
--- a/release_23/lib/System/DynamicLibrary.cpp
+++ /dev/null
@@ -1,161 +0,0 @@
-//===-- DynamicLibrary.cpp - Runtime link/load libraries --------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This header file implements the operating system DynamicLibrary concept.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/System/DynamicLibrary.h"
-#include "llvm/Config/config.h"
-#include <cstring>
-#include <map>
-
-// Collection of symbol name/value pairs to be searched prior to any libraries.
-static std::map<std::string, void *> g_symbols;
-
-void llvm::sys::DynamicLibrary::AddSymbol(const char* symbolName,
- void *symbolValue) {
- g_symbols[symbolName] = symbolValue;
-}
-
-// It is not possible to use ltdl.c on VC++ builds as the terms of its LGPL
-// license and special exception would cause all of LLVM to be placed under
-// the LGPL. This is because the exception applies only when libtool is
-// used, and obviously libtool is not used with Visual Studio. An entirely
-// separate implementation is provided in win32/DynamicLibrary.cpp.
-
-#ifdef LLVM_ON_WIN32
-
-#include "Win32/DynamicLibrary.inc"
-
-#else
-
-//#include "ltdl.h"
-#include <dlfcn.h>
-#include <cassert>
-using namespace llvm;
-using namespace llvm::sys;
-
-//===----------------------------------------------------------------------===//
-//=== WARNING: Implementation here must contain only TRULY operating system
-//=== independent code.
-//===----------------------------------------------------------------------===//
-
-//static std::vector<lt_dlhandle> OpenedHandles;
-static std::vector<void *> OpenedHandles;
-
-DynamicLibrary::DynamicLibrary() {}
-
-DynamicLibrary::~DynamicLibrary() {
- while(!OpenedHandles.empty()) {
- void *H = OpenedHandles.back(); OpenedHandles.pop_back();
- dlclose(H);
- }
-}
-
-bool DynamicLibrary::LoadLibraryPermanently(const char *Filename,
- std::string *ErrMsg) {
- void *H = dlopen(Filename, RTLD_LAZY);
- if (H == 0) {
- if (ErrMsg)
- *ErrMsg = dlerror();
- return true;
- }
- OpenedHandles.push_back(H);
- return false;
-}
-
-void* DynamicLibrary::SearchForAddressOfSymbol(const char* symbolName) {
- // check_ltdl_initialization();
-
- // First check symbols added via AddSymbol().
- std::map<std::string, void *>::iterator I = g_symbols.find(symbolName);
- if (I != g_symbols.end())
- return I->second;
-
- // Now search the libraries.
- for (std::vector<void *>::iterator I = OpenedHandles.begin(),
- E = OpenedHandles.end(); I != E; ++I) {
- //lt_ptr ptr = lt_dlsym(*I, symbolName);
- void *ptr = dlsym(*I, symbolName);
- if (ptr)
- return ptr;
- }
-
-#define EXPLICIT_SYMBOL(SYM) \
- extern void *SYM; if (!strcmp(symbolName, #SYM)) return &SYM
-
- // If this is darwin, it has some funky issues, try to solve them here. Some
- // important symbols are marked 'private external' which doesn't allow
- // SearchForAddressOfSymbol to find them. As such, we special case them here,
- // there is only a small handful of them.
-
-#ifdef __APPLE__
- {
- EXPLICIT_SYMBOL(__ashldi3);
- EXPLICIT_SYMBOL(__ashrdi3);
- EXPLICIT_SYMBOL(__cmpdi2);
- EXPLICIT_SYMBOL(__divdi3);
- EXPLICIT_SYMBOL(__eprintf);
- EXPLICIT_SYMBOL(__fixdfdi);
- EXPLICIT_SYMBOL(__fixsfdi);
- EXPLICIT_SYMBOL(__fixunsdfdi);
- EXPLICIT_SYMBOL(__fixunssfdi);
- EXPLICIT_SYMBOL(__floatdidf);
- EXPLICIT_SYMBOL(__floatdisf);
- EXPLICIT_SYMBOL(__lshrdi3);
- EXPLICIT_SYMBOL(__moddi3);
- EXPLICIT_SYMBOL(__udivdi3);
- EXPLICIT_SYMBOL(__umoddi3);
- }
-#endif
-
-#ifdef __CYGWIN__
- {
- EXPLICIT_SYMBOL(_alloca);
- EXPLICIT_SYMBOL(__main);
- }
-#endif
-
-#undef EXPLICIT_SYMBOL
-
-// This macro returns the address of a well-known, explicit symbol
-#define EXPLICIT_SYMBOL(SYM) \
- if (!strcmp(symbolName, #SYM)) return &SYM
-
-// On linux we have a weird situation. The stderr/out/in symbols are both
-// macros and global variables because of standards requirements. So, we
-// boldly use the EXPLICIT_SYMBOL macro without checking for a #define first.
-#if defined(__linux__)
- {
- EXPLICIT_SYMBOL(stderr);
- EXPLICIT_SYMBOL(stdout);
- EXPLICIT_SYMBOL(stdin);
- }
-#else
- // For everything else, we want to check to make sure the symbol isn't defined
- // as a macro before using EXPLICIT_SYMBOL.
- {
-#ifndef stdin
- EXPLICIT_SYMBOL(stdin);
-#endif
-#ifndef stdout
- EXPLICIT_SYMBOL(stdout);
-#endif
-#ifndef stderr
- EXPLICIT_SYMBOL(stderr);
-#endif
- }
-#endif
-#undef EXPLICIT_SYMBOL
-
- return 0;
-}
-
-#endif // LLVM_ON_WIN32
diff --git a/release_23/lib/System/IncludeFile.cpp b/release_23/lib/System/IncludeFile.cpp
deleted file mode 100644
index 8258d40326f9..000000000000
--- a/release_23/lib/System/IncludeFile.cpp
+++ /dev/null
@@ -1,20 +0,0 @@
-//===- lib/System/IncludeFile.cpp - Ensure Linking Of Implementation -----===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the IncludeFile constructor.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/System/IncludeFile.h"
-
-using namespace llvm;
-
-// This constructor is used to ensure linking of other modules. See the
-// llvm/System/IncludeFile.h header for details.
-IncludeFile::IncludeFile(const void*) {}
diff --git a/release_23/lib/System/LICENSE.TXT b/release_23/lib/System/LICENSE.TXT
deleted file mode 100644
index f569da205289..000000000000
--- a/release_23/lib/System/LICENSE.TXT
+++ /dev/null
@@ -1,6 +0,0 @@
-LLVM System Interface Library
--------------------------------------------------------------------------------
-The LLVM System Interface Library is licensed under the Illinois Open Source
-License and has the following additional copyright:
-
-Copyright (C) 2004 eXtensible Systems, Inc.
diff --git a/release_23/lib/System/Makefile b/release_23/lib/System/Makefile
deleted file mode 100644
index fe5bcece7eab..000000000000
--- a/release_23/lib/System/Makefile
+++ /dev/null
@@ -1,19 +0,0 @@
-##===- lib/System/Makefile ---------------------------------*- Makefile -*-===##
-#
-# The LLVM Compiler Infrastructure
-#
-# This file is distributed under the University of Illinois Open Source
-# License. See LICENSE.TXT for details.
-#
-##===----------------------------------------------------------------------===##
-
-LEVEL = ../..
-LIBRARYNAME = LLVMSystem
-BUILD_ARCHIVE = 1
-
-EXTRA_DIST = Unix Win32 README.txt
-
-include $(LEVEL)/Makefile.common
-
-CompileCommonOpts := $(filter-out -pedantic,$(CompileCommonOpts))
-CompileCommonOpts := $(filter-out -Wno-long-long,$(CompileCommonOpts))
diff --git a/release_23/lib/System/Memory.cpp b/release_23/lib/System/Memory.cpp
deleted file mode 100644
index 054cc966a3e7..000000000000
--- a/release_23/lib/System/Memory.cpp
+++ /dev/null
@@ -1,34 +0,0 @@
-//===- Memory.cpp - Memory Handling Support ---------------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines some helpful functions for allocating memory and dealing
-// with memory mapped files
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/System/Memory.h"
-#include "llvm/Config/config.h"
-
-namespace llvm {
-using namespace sys;
-
-//===----------------------------------------------------------------------===//
-//=== WARNING: Implementation here must contain only TRULY operating system
-//=== independent code.
-//===----------------------------------------------------------------------===//
-
-}
-
-// Include the platform-specific parts of this class.
-#ifdef LLVM_ON_UNIX
-#include "Unix/Memory.inc"
-#endif
-#ifdef LLVM_ON_WIN32
-#include "Win32/Memory.inc"
-#endif
diff --git a/release_23/lib/System/Mutex.cpp b/release_23/lib/System/Mutex.cpp
deleted file mode 100644
index 3bef7ce0b02e..000000000000
--- a/release_23/lib/System/Mutex.cpp
+++ /dev/null
@@ -1,160 +0,0 @@
-//===- Mutex.cpp - Mutual Exclusion Lock ------------------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the llvm::sys::Mutex class.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Config/config.h"
-#include "llvm/System/Mutex.h"
-
-//===----------------------------------------------------------------------===//
-//=== WARNING: Implementation here must contain only TRULY operating system
-//=== independent code.
-//===----------------------------------------------------------------------===//
-
-#if !defined(ENABLE_THREADS) || ENABLE_THREADS == 0
-// Define all methods as no-ops if threading is explicitly disabled
-namespace llvm {
-using namespace sys;
-Mutex::Mutex( bool recursive) { }
-Mutex::~Mutex() { }
-bool Mutex::acquire() { return true; }
-bool Mutex::release() { return true; }
-bool Mutex::tryacquire() { return true; }
-}
-#else
-
-#if defined(HAVE_PTHREAD_H) && defined(HAVE_PTHREAD_MUTEX_LOCK)
-
-#include <cassert>
-#include <pthread.h>
-#include <stdlib.h>
-
-namespace llvm {
-using namespace sys;
-
-
-// This variable is useful for situations where the pthread library has been
-// compiled with weak linkage for its interface symbols. This allows the
-// threading support to be turned off by simply not linking against -lpthread.
-// In that situation, the value of pthread_mutex_init will be 0 and
-// consequently pthread_enabled will be false. In such situations, all the
-// pthread operations become no-ops and the functions all return false. If
-// pthread_mutex_init does have an address, then mutex support is enabled.
-// Note: all LLVM tools will link against -lpthread if its available since it
-// is configured into the LIBS variable.
-// Note: this line of code generates a warning if pthread_mutex_init is not
-// declared with weak linkage. It's safe to ignore the warning.
-static const bool pthread_enabled = true;
-
-// Construct a Mutex using pthread calls
-Mutex::Mutex( bool recursive)
- : data_(0)
-{
- if (pthread_enabled)
- {
- // Declare the pthread_mutex data structures
- pthread_mutex_t* mutex =
- static_cast<pthread_mutex_t*>(malloc(sizeof(pthread_mutex_t)));
- pthread_mutexattr_t attr;
-
- // Initialize the mutex attributes
- int errorcode = pthread_mutexattr_init(&attr);
- assert(errorcode == 0);
-
- // Initialize the mutex as a recursive mutex, if requested, or normal
- // otherwise.
- int kind = ( recursive ? PTHREAD_MUTEX_RECURSIVE : PTHREAD_MUTEX_NORMAL );
- errorcode = pthread_mutexattr_settype(&attr, kind);
- assert(errorcode == 0);
-
-#if !defined(__FreeBSD__) && !defined(__OpenBSD__) && !defined(__NetBSD__)
- // Make it a process local mutex
- errorcode = pthread_mutexattr_setpshared(&attr, PTHREAD_PROCESS_PRIVATE);
-#endif
-
- // Initialize the mutex
- errorcode = pthread_mutex_init(mutex, &attr);
- assert(errorcode == 0);
-
- // Destroy the attributes
- errorcode = pthread_mutexattr_destroy(&attr);
- assert(errorcode == 0);
-
- // Assign the data member
- data_ = mutex;
- }
-}
-
-// Destruct a Mutex
-Mutex::~Mutex()
-{
- if (pthread_enabled)
- {
- pthread_mutex_t* mutex = reinterpret_cast<pthread_mutex_t*>(data_);
- assert(mutex != 0);
- pthread_mutex_destroy(mutex);
- assert(mutex != 0);
- }
-}
-
-bool
-Mutex::acquire()
-{
- if (pthread_enabled)
- {
- pthread_mutex_t* mutex = reinterpret_cast<pthread_mutex_t*>(data_);
- assert(mutex != 0);
-
- int errorcode = pthread_mutex_lock(mutex);
- return errorcode == 0;
- }
- return false;
-}
-
-bool
-Mutex::release()
-{
- if (pthread_enabled)
- {
- pthread_mutex_t* mutex = reinterpret_cast<pthread_mutex_t*>(data_);
- assert(mutex != 0);
-
- int errorcode = pthread_mutex_unlock(mutex);
- return errorcode == 0;
- }
- return false;
-}
-
-bool
-Mutex::tryacquire()
-{
- if (pthread_enabled)
- {
- pthread_mutex_t* mutex = reinterpret_cast<pthread_mutex_t*>(data_);
- assert(mutex != 0);
-
- int errorcode = pthread_mutex_trylock(mutex);
- return errorcode == 0;
- }
- return false;
-}
-
-}
-
-#elif defined(LLVM_ON_UNIX)
-#include "Unix/Mutex.inc"
-#elif defined( LLVM_ON_WIN32)
-#include "Win32/Mutex.inc"
-#else
-#warning Neither LLVM_ON_UNIX nor LLVM_ON_WIN32 was set in System/Mutex.cpp
-#endif
-#endif
-
diff --git a/release_23/lib/System/Path.cpp b/release_23/lib/System/Path.cpp
deleted file mode 100644
index 086c9f0238c4..000000000000
--- a/release_23/lib/System/Path.cpp
+++ /dev/null
@@ -1,246 +0,0 @@
-//===-- Path.cpp - Implement OS Path Concept --------------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This header file implements the operating system Path concept.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/System/Path.h"
-#include "llvm/Config/config.h"
-#include <cassert>
-#include <cstring>
-#include <ostream>
-using namespace llvm;
-using namespace sys;
-
-//===----------------------------------------------------------------------===//
-//=== WARNING: Implementation here must contain only TRULY operating system
-//=== independent code.
-//===----------------------------------------------------------------------===//
-
-std::ostream& llvm::operator<<(std::ostream &strm, const sys::Path &aPath) {
- strm << aPath.toString();
- return strm;
-}
-
-Path
-Path::GetLLVMConfigDir() {
- Path result;
-#ifdef LLVM_ETCDIR
- if (result.set(LLVM_ETCDIR))
- return result;
-#endif
- return GetLLVMDefaultConfigDir();
-}
-
-LLVMFileType
-sys::IdentifyFileType(const char*magic, unsigned length) {
- assert(magic && "Invalid magic number string");
- assert(length >=4 && "Invalid magic number length");
- switch (magic[0]) {
- case 'B':
- if (magic[1] == 'C' && magic[2] == (char)0xC0 && magic[3] == (char)0xDE)
- return Bitcode_FileType;
- break;
- case '!':
- if (length >= 8)
- if (memcmp(magic,"!<arch>\n",8) == 0)
- return Archive_FileType;
- break;
-
- case '\177':
- if (magic[1] == 'E' && magic[2] == 'L' && magic[3] == 'F') {
- if (length >= 18 && magic[17] == 0)
- switch (magic[16]) {
- default: break;
- case 1: return ELF_Relocatable_FileType;
- case 2: return ELF_Executable_FileType;
- case 3: return ELF_SharedObject_FileType;
- case 4: return ELF_Core_FileType;
- }
- }
- break;
-
- case 0xCA:
- // This is complicated by an overlap with Java class files.
- // See the Mach-O section in /usr/share/file/magic for details.
- if (magic[1] == char(0xFE) && magic[2] == char(0xBA) &&
- magic[3] == char(0xBE)) {
- return Mach_O_DynamicallyLinkedSharedLib_FileType;
-
- // FIXME: How does this work?
- if (length >= 14 && magic[13] == 0)
- switch (magic[12]) {
- default: break;
- case 1: return Mach_O_Object_FileType;
- case 2: return Mach_O_Executable_FileType;
- case 3: return Mach_O_FixedVirtualMemorySharedLib_FileType;
- case 4: return Mach_O_Core_FileType;
- case 5: return Mach_O_PreloadExectuable_FileType;
- case 6: return Mach_O_DynamicallyLinkedSharedLib_FileType;
- case 7: return Mach_O_DynamicLinker_FileType;
- case 8: return Mach_O_Bundle_FileType;
- case 9: return Mach_O_DynamicallyLinkedSharedLibStub_FileType;
- }
- }
- break;
-
- case 0xF0: // PowerPC Windows
- case 0x83: // Alpha 32-bit
- case 0x84: // Alpha 64-bit
- case 0x66: // MPS R4000 Windows
- case 0x50: // mc68K
- case 0x4c: // 80386 Windows
- if (magic[1] == 0x01)
- return COFF_FileType;
-
- case 0x90: // PA-RISC Windows
- case 0x68: // mc68K Windows
- if (magic[1] == 0x02)
- return COFF_FileType;
- break;
-
- default:
- break;
- }
- return Unknown_FileType;
-}
-
-bool
-Path::isArchive() const {
- if (canRead())
- return hasMagicNumber("!<arch>\012");
- return false;
-}
-
-bool
-Path::isDynamicLibrary() const {
- if (canRead()) {
- std::string Magic;
- if (getMagicNumber(Magic, 64))
- switch (IdentifyFileType(Magic.c_str(),
- static_cast<unsigned>(Magic.length()))) {
- default: return false;
- case Mach_O_FixedVirtualMemorySharedLib_FileType:
- case Mach_O_DynamicallyLinkedSharedLib_FileType:
- case Mach_O_DynamicallyLinkedSharedLibStub_FileType:
- case ELF_SharedObject_FileType:
- case COFF_FileType: return true;
- }
- }
- return false;
-}
-
-Path
-Path::FindLibrary(std::string& name) {
- std::vector<sys::Path> LibPaths;
- GetSystemLibraryPaths(LibPaths);
- for (unsigned i = 0; i < LibPaths.size(); ++i) {
- sys::Path FullPath(LibPaths[i]);
- FullPath.appendComponent("lib" + name + LTDL_SHLIB_EXT);
- if (FullPath.isDynamicLibrary())
- return FullPath;
- FullPath.eraseSuffix();
- FullPath.appendSuffix("a");
- if (FullPath.isArchive())
- return FullPath;
- }
- return sys::Path();
-}
-
-std::string Path::GetDLLSuffix() {
- return LTDL_SHLIB_EXT;
-}
-
-bool
-Path::isBitcodeFile() const {
- std::string actualMagic;
- if (!getMagicNumber(actualMagic, 4))
- return false;
- return actualMagic == "BC\xC0\xDE";
-}
-
-bool Path::hasMagicNumber(const std::string &Magic) const {
- std::string actualMagic;
- if (getMagicNumber(actualMagic, static_cast<unsigned>(Magic.size())))
- return Magic == actualMagic;
- return false;
-}
-
-std::string
-Path::getSuffix() const {
- return path.substr(path.rfind('.') + 1);
-}
-
-static void getPathList(const char*path, std::vector<Path>& Paths) {
- const char* at = path;
- const char* delim = strchr(at, PathSeparator);
- Path tmpPath;
- while (delim != 0) {
- std::string tmp(at, size_t(delim-at));
- if (tmpPath.set(tmp))
- if (tmpPath.canRead())
- Paths.push_back(tmpPath);
- at = delim + 1;
- delim = strchr(at, PathSeparator);
- }
-
- if (*at != 0)
- if (tmpPath.set(std::string(at)))
- if (tmpPath.canRead())
- Paths.push_back(tmpPath);
-}
-
-static std::string getDirnameCharSep(const std::string& path, char Sep) {
-
- if (path.empty())
- return ".";
-
- // If the path is all slashes, return a single slash.
- // Otherwise, remove all trailing slashes.
-
- signed pos = static_cast<signed>(path.size()) - 1;
-
- while (pos >= 0 && path[pos] == Sep)
- --pos;
-
- if (pos < 0)
- return path[0] == Sep ? std::string(1, Sep) : std::string(".");
-
- // Any slashes left?
- signed i = 0;
-
- while (i < pos && path[i] != Sep)
- ++i;
-
- if (i == pos) // No slashes? Return "."
- return ".";
-
- // There is at least one slash left. Remove all trailing non-slashes.
- while (pos >= 0 && path[pos] != Sep)
- --pos;
-
- // Remove any trailing slashes.
- while (pos >= 0 && path[pos] == Sep)
- --pos;
-
- if (pos < 0)
- return path[0] == Sep ? std::string(1, Sep) : std::string(".");
-
- return path.substr(0, pos+1);
-}
-
-// Include the truly platform-specific parts of this class.
-#if defined(LLVM_ON_UNIX)
-#include "Unix/Path.inc"
-#endif
-#if defined(LLVM_ON_WIN32)
-#include "Win32/Path.inc"
-#endif
-
diff --git a/release_23/lib/System/Process.cpp b/release_23/lib/System/Process.cpp
deleted file mode 100644
index e93b2af4c12b..000000000000
--- a/release_23/lib/System/Process.cpp
+++ /dev/null
@@ -1,33 +0,0 @@
-//===-- Process.cpp - Implement OS Process Concept --------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This header file implements the operating system Process concept.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/System/Process.h"
-#include "llvm/Config/config.h"
-
-namespace llvm {
-using namespace sys;
-
-//===----------------------------------------------------------------------===//
-//=== WARNING: Implementation here must contain only TRULY operating system
-//=== independent code.
-//===----------------------------------------------------------------------===//
-
-}
-
-// Include the platform-specific parts of this class.
-#ifdef LLVM_ON_UNIX
-#include "Unix/Process.inc"
-#endif
-#ifdef LLVM_ON_WIN32
-#include "Win32/Process.inc"
-#endif
diff --git a/release_23/lib/System/Program.cpp b/release_23/lib/System/Program.cpp
deleted file mode 100644
index eb289d81b2e1..000000000000
--- a/release_23/lib/System/Program.cpp
+++ /dev/null
@@ -1,33 +0,0 @@
-//===-- Program.cpp - Implement OS Program Concept --------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This header file implements the operating system Program concept.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/System/Program.h"
-#include "llvm/Config/config.h"
-
-namespace llvm {
-using namespace sys;
-
-//===----------------------------------------------------------------------===//
-//=== WARNING: Implementation here must contain only TRULY operating system
-//=== independent code.
-//===----------------------------------------------------------------------===//
-
-}
-
-// Include the platform-specific parts of this class.
-#ifdef LLVM_ON_UNIX
-#include "Unix/Program.inc"
-#endif
-#ifdef LLVM_ON_WIN32
-#include "Win32/Program.inc"
-#endif
diff --git a/release_23/lib/System/README.txt b/release_23/lib/System/README.txt
deleted file mode 100644
index eacb20094a61..000000000000
--- a/release_23/lib/System/README.txt
+++ /dev/null
@@ -1,43 +0,0 @@
-Design Of lib/System
-====================
-
-The software in this directory is designed to completely shield LLVM from any
-and all operating system specific functionality. It is not intended to be a
-complete operating system wrapper (such as ACE), but only to provide the
-functionality necessary to support LLVM.
-
-The software located here, of necessity, has very specific and stringent design
-rules. Violation of these rules means that cracks in the shield could form and
-the primary goal of the library is defeated. By consistently using this library,
-LLVM becomes more easily ported to new platforms since the only thing requiring
-porting is this library.
-
-Complete documentation for the library can be found in the file:
- llvm/docs/SystemLibrary.html
-or at this URL:
- http://llvm.org/docs/SystemLibrary.html
-
-While we recommend that you read the more detailed documentation, for the
-impatient, here's a high level summary of the library's requirements.
-
- 1. No system header files are to be exposed through the interface.
- 2. Std C++ and Std C header files are okay to be exposed through the interface.
- 3. No exposed system-specific functions.
- 4. No exposed system-specific data.
- 5. Data in lib/System classes must use only simple C++ intrinsic types.
- 6. Errors are handled by returning "true" and setting an optional std::string
- 7. Library must not throw any exceptions, period.
- 8. Interface functions must not have throw() specifications.
- 9. No duplicate function impementations are permitted within an operating
- system class.
-
-To accomplish these requirements, the library has numerous design criteria that
-must be satisfied. Here's a high level summary of the library's design criteria:
-
- 1. No unused functionality (only what LLVM needs)
- 2. High-Level Interfaces
- 3. Use Opaque Classes
- 4. Common Implementations</a></li>
- 5. Multiple Implementations</a></li>
- 6. Minimize Memory Allocation</a></li>
- 7. No Virtual Methods
diff --git a/release_23/lib/System/Signals.cpp b/release_23/lib/System/Signals.cpp
deleted file mode 100644
index d345b0a9aed4..000000000000
--- a/release_23/lib/System/Signals.cpp
+++ /dev/null
@@ -1,34 +0,0 @@
-//===- Signals.cpp - Signal Handling support --------------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines some helpful functions for dealing with the possibility of
-// Unix signals occuring while your program is running.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/System/Signals.h"
-#include "llvm/Config/config.h"
-
-namespace llvm {
-using namespace sys;
-
-//===----------------------------------------------------------------------===//
-//=== WARNING: Implementation here must contain only TRULY operating system
-//=== independent code.
-//===----------------------------------------------------------------------===//
-
-}
-
-// Include the platform-specific parts of this class.
-#ifdef LLVM_ON_UNIX
-#include "Unix/Signals.inc"
-#endif
-#ifdef LLVM_ON_WIN32
-#include "Win32/Signals.inc"
-#endif
diff --git a/release_23/lib/System/TimeValue.cpp b/release_23/lib/System/TimeValue.cpp
deleted file mode 100644
index cf4984cc4d1b..000000000000
--- a/release_23/lib/System/TimeValue.cpp
+++ /dev/null
@@ -1,58 +0,0 @@
-//===-- TimeValue.cpp - Implement OS TimeValue Concept ----------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the operating system TimeValue concept.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/System/TimeValue.h"
-#include "llvm/Config/config.h"
-
-namespace llvm {
-using namespace sys;
-
-const TimeValue TimeValue::MinTime = TimeValue ( INT64_MIN,0 );
-const TimeValue TimeValue::MaxTime = TimeValue ( INT64_MAX,0 );
-const TimeValue TimeValue::ZeroTime = TimeValue ( 0,0 );
-const TimeValue TimeValue::PosixZeroTime = TimeValue ( -946684800,0 );
-const TimeValue TimeValue::Win32ZeroTime = TimeValue ( -12591158400ULL,0 );
-
-void
-TimeValue::normalize( void ) {
- if ( nanos_ >= NANOSECONDS_PER_SECOND ) {
- do {
- seconds_++;
- nanos_ -= NANOSECONDS_PER_SECOND;
- } while ( nanos_ >= NANOSECONDS_PER_SECOND );
- } else if (nanos_ <= -NANOSECONDS_PER_SECOND ) {
- do {
- seconds_--;
- nanos_ += NANOSECONDS_PER_SECOND;
- } while (nanos_ <= -NANOSECONDS_PER_SECOND);
- }
-
- if (seconds_ >= 1 && nanos_ < 0) {
- seconds_--;
- nanos_ += NANOSECONDS_PER_SECOND;
- } else if (seconds_ < 0 && nanos_ > 0) {
- seconds_++;
- nanos_ -= NANOSECONDS_PER_SECOND;
- }
-}
-
-}
-
-/// Include the platform specific portion of TimeValue class
-#ifdef LLVM_ON_UNIX
-#include "Unix/TimeValue.inc"
-#endif
-#ifdef LLVM_ON_WIN32
-#include "Win32/TimeValue.inc"
-#endif
-
diff --git a/release_23/lib/System/Unix/Alarm.inc b/release_23/lib/System/Unix/Alarm.inc
deleted file mode 100644
index 853fcf503658..000000000000
--- a/release_23/lib/System/Unix/Alarm.inc
+++ /dev/null
@@ -1,68 +0,0 @@
-//===-- Alarm.inc - Implement Unix Alarm Support --------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the UNIX Alarm support.
-//
-//===----------------------------------------------------------------------===//
-
-#include <signal.h>
-#include <unistd.h>
-#include <cassert>
-using namespace llvm;
-
-/// AlarmCancelled - This flag is set by the SIGINT signal handler if the
-/// user presses CTRL-C.
-static volatile bool AlarmCancelled = false;
-
-/// AlarmTriggered - This flag is set by the SIGALRM signal handler if the
-/// alarm was triggered.
-static volatile bool AlarmTriggered = false;
-
-/// NestedSOI - Sanity check. Alarms cannot be nested or run in parallel.
-/// This ensures that they never do.
-static bool NestedSOI = false;
-
-static RETSIGTYPE SigIntHandler(int Sig) {
- AlarmCancelled = true;
- signal(SIGINT, SigIntHandler);
-}
-
-static RETSIGTYPE SigAlarmHandler(int Sig) {
- AlarmTriggered = true;
-}
-
-static void (*OldSigIntHandler) (int);
-
-void sys::SetupAlarm(unsigned seconds) {
- assert(!NestedSOI && "sys::SetupAlarm calls cannot be nested!");
- NestedSOI = true;
- AlarmCancelled = false;
- AlarmTriggered = false;
- ::signal(SIGALRM, SigAlarmHandler);
- OldSigIntHandler = ::signal(SIGINT, SigIntHandler);
- ::alarm(seconds);
-}
-
-void sys::TerminateAlarm() {
- assert(NestedSOI && "sys::TerminateAlarm called without sys::SetupAlarm!");
- ::alarm(0);
- ::signal(SIGALRM, SIG_DFL);
- ::signal(SIGINT, OldSigIntHandler);
- AlarmCancelled = false;
- AlarmTriggered = false;
- NestedSOI = false;
-}
-
-int sys::AlarmStatus() {
- if (AlarmCancelled)
- return -1;
- if (AlarmTriggered)
- return 1;
- return 0;
-}
diff --git a/release_23/lib/System/Unix/Memory.inc b/release_23/lib/System/Unix/Memory.inc
deleted file mode 100644
index 0b74f74f7b6e..000000000000
--- a/release_23/lib/System/Unix/Memory.inc
+++ /dev/null
@@ -1,76 +0,0 @@
-//===- Unix/Memory.cpp - Generic UNIX System Configuration ------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines some functions for various memory management utilities.
-//
-//===----------------------------------------------------------------------===//
-
-#include "Unix.h"
-#include "llvm/System/Process.h"
-
-#ifdef HAVE_SYS_MMAN_H
-#include <sys/mman.h>
-#endif
-
-/// AllocateRWXMemory - Allocate a slab of memory with read/write/execute
-/// permissions. This is typically used for JIT applications where we want
-/// to emit code to the memory then jump to it. Getting this type of memory
-/// is very OS specific.
-///
-llvm::sys::MemoryBlock
-llvm::sys::Memory::AllocateRWX(unsigned NumBytes, const MemoryBlock* NearBlock,
- std::string *ErrMsg) {
- if (NumBytes == 0) return MemoryBlock();
-
- unsigned pageSize = Process::GetPageSize();
- unsigned NumPages = (NumBytes+pageSize-1)/pageSize;
-
- int fd = -1;
-#ifdef NEED_DEV_ZERO_FOR_MMAP
- static int zero_fd = open("/dev/zero", O_RDWR);
- if (zero_fd == -1) {
- MakeErrMsg(ErrMsg, "Can't open /dev/zero device");
- return MemoryBlock();
- }
- fd = zero_fd;
-#endif
-
- int flags = MAP_PRIVATE |
-#ifdef HAVE_MMAP_ANONYMOUS
- MAP_ANONYMOUS
-#else
- MAP_ANON
-#endif
- ;
-
- void* start = NearBlock ? (unsigned char*)NearBlock->base() +
- NearBlock->size() : 0;
-
- void *pa = ::mmap(start, pageSize*NumPages, PROT_READ|PROT_WRITE|PROT_EXEC,
- flags, fd, 0);
- if (pa == MAP_FAILED) {
- if (NearBlock) //Try again without a near hint
- return AllocateRWX(NumBytes, 0);
-
- MakeErrMsg(ErrMsg, "Can't allocate RWX Memory");
- return MemoryBlock();
- }
- MemoryBlock result;
- result.Address = pa;
- result.Size = NumPages*pageSize;
- return result;
-}
-
-bool llvm::sys::Memory::ReleaseRWX(MemoryBlock &M, std::string *ErrMsg) {
- if (M.Address == 0 || M.Size == 0) return false;
- if (0 != ::munmap(M.Address, M.Size))
- return MakeErrMsg(ErrMsg, "Can't release RWX Memory");
- return false;
-}
-
diff --git a/release_23/lib/System/Unix/Mutex.inc b/release_23/lib/System/Unix/Mutex.inc
deleted file mode 100644
index 4a015a676fc7..000000000000
--- a/release_23/lib/System/Unix/Mutex.inc
+++ /dev/null
@@ -1,49 +0,0 @@
-//===- llvm/System/Unix/Mutex.inc - Unix Mutex Implementation ---*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the Unix specific (non-pthread) Mutex class.
-//
-//===----------------------------------------------------------------------===//
-
-//===----------------------------------------------------------------------===//
-//=== WARNING: Implementation here must contain only generic UNIX code that
-//=== is guaranteed to work on *all* UNIX variants.
-//===----------------------------------------------------------------------===//
-
-namespace llvm
-{
-using namespace sys;
-
-Mutex::Mutex( bool recursive)
-{
-}
-
-Mutex::~Mutex()
-{
-}
-
-bool
-Mutex::acquire()
-{
- return true;
-}
-
-bool
-Mutex::release()
-{
- return true;
-}
-
-bool
-Mutex::tryacquire( void )
-{
- return true;
-}
-
-}
diff --git a/release_23/lib/System/Unix/Path.inc b/release_23/lib/System/Unix/Path.inc
deleted file mode 100644
index 9f4b5914ce0e..000000000000
--- a/release_23/lib/System/Unix/Path.inc
+++ /dev/null
@@ -1,781 +0,0 @@
-//===- llvm/System/Unix/Path.cpp - Unix Path Implementation -----*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the Unix specific portion of the Path class.
-//
-//===----------------------------------------------------------------------===//
-
-//===----------------------------------------------------------------------===//
-//=== WARNING: Implementation here must contain only generic UNIX code that
-//=== is guaranteed to work on *all* UNIX variants.
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Config/alloca.h"
-#include "Unix.h"
-#if HAVE_SYS_STAT_H
-#include <sys/stat.h>
-#endif
-#if HAVE_FCNTL_H
-#include <fcntl.h>
-#endif
-#ifdef HAVE_SYS_MMAN_H
-#include <sys/mman.h>
-#endif
-#ifdef HAVE_SYS_STAT_H
-#include <sys/stat.h>
-#endif
-#if HAVE_UTIME_H
-#include <utime.h>
-#endif
-#if HAVE_TIME_H
-#include <time.h>
-#endif
-#if HAVE_DIRENT_H
-# include <dirent.h>
-# define NAMLEN(dirent) strlen((dirent)->d_name)
-#else
-# define dirent direct
-# define NAMLEN(dirent) (dirent)->d_namlen
-# if HAVE_SYS_NDIR_H
-# include <sys/ndir.h>
-# endif
-# if HAVE_SYS_DIR_H
-# include <sys/dir.h>
-# endif
-# if HAVE_NDIR_H
-# include <ndir.h>
-# endif
-#endif
-
-#if HAVE_DLFCN_H
-#include <dlfcn.h>
-#endif
-
-// Put in a hack for Cygwin which falsely reports that the mkdtemp function
-// is available when it is not.
-#ifdef __CYGWIN__
-# undef HAVE_MKDTEMP
-#endif
-
-namespace {
-inline bool lastIsSlash(const std::string& path) {
- return !path.empty() && path[path.length() - 1] == '/';
-}
-
-}
-
-namespace llvm {
-using namespace sys;
-
-extern const char sys::PathSeparator = ':';
-
-bool
-Path::isValid() const {
- // Check some obvious things
- if (path.empty())
- return false;
- else if (path.length() >= MAXPATHLEN)
- return false;
-
- // Check that the characters are ascii chars
- size_t len = path.length();
- unsigned i = 0;
- while (i < len && isascii(path[i]))
- ++i;
- return i >= len;
-}
-
-bool
-Path::isAbsolute() const {
- if (path.empty())
- return false;
- return path[0] == '/';
-}
-Path
-Path::GetRootDirectory() {
- Path result;
- result.set("/");
- return result;
-}
-
-Path
-Path::GetTemporaryDirectory(std::string* ErrMsg ) {
-#if defined(HAVE_MKDTEMP)
- // The best way is with mkdtemp but that's not available on many systems,
- // Linux and FreeBSD have it. Others probably won't.
- char pathname[MAXPATHLEN];
- strcpy(pathname,"/tmp/llvm_XXXXXX");
- if (0 == mkdtemp(pathname)) {
- MakeErrMsg(ErrMsg,
- std::string(pathname) + ": can't create temporary directory");
- return Path();
- }
- Path result;
- result.set(pathname);
- assert(result.isValid() && "mkdtemp didn't create a valid pathname!");
- return result;
-#elif defined(HAVE_MKSTEMP)
- // If no mkdtemp is available, mkstemp can be used to create a temporary file
- // which is then removed and created as a directory. We prefer this over
- // mktemp because of mktemp's inherent security and threading risks. We still
- // have a slight race condition from the time the temporary file is created to
- // the time it is re-created as a directoy.
- char pathname[MAXPATHLEN];
- strcpy(pathname, "/tmp/llvm_XXXXXX");
- int fd = 0;
- if (-1 == (fd = mkstemp(pathname))) {
- MakeErrMsg(ErrMsg,
- std::string(pathname) + ": can't create temporary directory");
- return Path();
- }
- ::close(fd);
- ::unlink(pathname); // start race condition, ignore errors
- if (-1 == ::mkdir(pathname, S_IRWXU)) { // end race condition
- MakeErrMsg(ErrMsg,
- std::string(pathname) + ": can't create temporary directory");
- return Path();
- }
- Path result;
- result.set(pathname);
- assert(result.isValid() && "mkstemp didn't create a valid pathname!");
- return result;
-#elif defined(HAVE_MKTEMP)
- // If a system doesn't have mkdtemp(3) or mkstemp(3) but it does have
- // mktemp(3) then we'll assume that system (e.g. AIX) has a reasonable
- // implementation of mktemp(3) and doesn't follow BSD 4.3's lead of replacing
- // the XXXXXX with the pid of the process and a letter. That leads to only
- // twenty six temporary files that can be generated.
- char pathname[MAXPATHLEN];
- strcpy(pathname, "/tmp/llvm_XXXXXX");
- char *TmpName = ::mktemp(pathname);
- if (TmpName == 0) {
- MakeErrMsg(ErrMsg,
- std::string(TmpName) + ": can't create unique directory name");
- return Path();
- }
- if (-1 == ::mkdir(TmpName, S_IRWXU)) {
- MakeErrMsg(ErrMsg,
- std::string(TmpName) + ": can't create temporary directory");
- return Path();
- }
- Path result;
- result.set(TmpName);
- assert(result.isValid() && "mktemp didn't create a valid pathname!");
- return result;
-#else
- // This is the worst case implementation. tempnam(3) leaks memory unless its
- // on an SVID2 (or later) system. On BSD 4.3 it leaks. tmpnam(3) has thread
- // issues. The mktemp(3) function doesn't have enough variability in the
- // temporary name generated. So, we provide our own implementation that
- // increments an integer from a random number seeded by the current time. This
- // should be sufficiently unique that we don't have many collisions between
- // processes. Generally LLVM processes don't run very long and don't use very
- // many temporary files so this shouldn't be a big issue for LLVM.
- static time_t num = ::time(0);
- char pathname[MAXPATHLEN];
- do {
- num++;
- sprintf(pathname, "/tmp/llvm_%010u", unsigned(num));
- } while ( 0 == access(pathname, F_OK ) );
- if (-1 == ::mkdir(pathname, S_IRWXU)) {
- MakeErrMsg(ErrMsg,
- std::string(pathname) + ": can't create temporary directory");
- return Path();
- }
- Path result;
- result.set(pathname);
- assert(result.isValid() && "mkstemp didn't create a valid pathname!");
- return result;
-#endif
-}
-
-void
-Path::GetSystemLibraryPaths(std::vector<sys::Path>& Paths) {
-#ifdef LTDL_SHLIBPATH_VAR
- char* env_var = getenv(LTDL_SHLIBPATH_VAR);
- if (env_var != 0) {
- getPathList(env_var,Paths);
- }
-#endif
- // FIXME: Should this look at LD_LIBRARY_PATH too?
- Paths.push_back(sys::Path("/usr/local/lib/"));
- Paths.push_back(sys::Path("/usr/X11R6/lib/"));
- Paths.push_back(sys::Path("/usr/lib/"));
- Paths.push_back(sys::Path("/lib/"));
-}
-
-void
-Path::GetBitcodeLibraryPaths(std::vector<sys::Path>& Paths) {
- char * env_var = getenv("LLVM_LIB_SEARCH_PATH");
- if (env_var != 0) {
- getPathList(env_var,Paths);
- }
-#ifdef LLVM_LIBDIR
- {
- Path tmpPath;
- if (tmpPath.set(LLVM_LIBDIR))
- if (tmpPath.canRead())
- Paths.push_back(tmpPath);
- }
-#endif
- GetSystemLibraryPaths(Paths);
-}
-
-Path
-Path::GetLLVMDefaultConfigDir() {
- return Path("/etc/llvm/");
-}
-
-Path
-Path::GetUserHomeDirectory() {
- const char* home = getenv("HOME");
- if (home) {
- Path result;
- if (result.set(home))
- return result;
- }
- return GetRootDirectory();
-}
-
-Path
-Path::GetCurrentDirectory() {
- char pathname[MAXPATHLEN];
- if (!getcwd(pathname,MAXPATHLEN)) {
- assert (false && "Could not query current working directory.");
- return Path("");
- }
-
- return Path(pathname);
-}
-
-/// GetMainExecutable - Return the path to the main executable, given the
-/// value of argv[0] from program startup.
-Path Path::GetMainExecutable(const char *argv0, void *MainAddr) {
-#if defined(__CYGWIN__)
- char exe_link[64];
- snprintf(exe_link, sizeof(exe_link), "/proc/%d/exe", getpid());
- char exe_path[MAXPATHLEN];
- ssize_t len = readlink(exe_link, exe_path, sizeof(exe_path));
- if (len > 0 && len < MAXPATHLEN - 1) {
- exe_path[len] = '\0';
- return Path(std::string(exe_path));
- }
-#elif defined(HAVE_DLFCN_H)
- // Use dladdr to get executable path if available.
- Dl_info DLInfo;
- int err = dladdr(MainAddr, &DLInfo);
- if (err != 0)
- return Path(std::string(DLInfo.dli_fname));
-#endif
- return Path();
-}
-
-
-std::string Path::getDirname() const {
- return getDirnameCharSep(path, '/');
-}
-
-std::string
-Path::getBasename() const {
- // Find the last slash
- std::string::size_type slash = path.rfind('/');
- if (slash == std::string::npos)
- slash = 0;
- else
- slash++;
-
- std::string::size_type dot = path.rfind('.');
- if (dot == std::string::npos || dot < slash)
- return path.substr(slash);
- else
- return path.substr(slash, dot - slash);
-}
-
-bool Path::getMagicNumber(std::string& Magic, unsigned len) const {
- assert(len < 1024 && "Request for magic string too long");
- char* buf = (char*) alloca(1 + len);
- int fd = ::open(path.c_str(), O_RDONLY);
- if (fd < 0)
- return false;
- ssize_t bytes_read = ::read(fd, buf, len);
- ::close(fd);
- if (ssize_t(len) != bytes_read) {
- Magic.clear();
- return false;
- }
- Magic.assign(buf,len);
- return true;
-}
-
-bool
-Path::exists() const {
- return 0 == access(path.c_str(), F_OK );
-}
-
-bool
-Path::isDirectory() const {
- struct stat buf;
- if (0 != stat(path.c_str(), &buf))
- return false;
- return buf.st_mode & S_IFDIR ? true : false;
-}
-
-bool
-Path::canRead() const {
- return 0 == access(path.c_str(), F_OK | R_OK );
-}
-
-bool
-Path::canWrite() const {
- return 0 == access(path.c_str(), F_OK | W_OK );
-}
-
-bool
-Path::canExecute() const {
- if (0 != access(path.c_str(), R_OK | X_OK ))
- return false;
- struct stat buf;
- if (0 != stat(path.c_str(), &buf))
- return false;
- if (!S_ISREG(buf.st_mode))
- return false;
- return true;
-}
-
-std::string
-Path::getLast() const {
- // Find the last slash
- size_t pos = path.rfind('/');
-
- // Handle the corner cases
- if (pos == std::string::npos)
- return path;
-
- // If the last character is a slash
- if (pos == path.length()-1) {
- // Find the second to last slash
- size_t pos2 = path.rfind('/', pos-1);
- if (pos2 == std::string::npos)
- return path.substr(0,pos);
- else
- return path.substr(pos2+1,pos-pos2-1);
- }
- // Return everything after the last slash
- return path.substr(pos+1);
-}
-
-const FileStatus *
-PathWithStatus::getFileStatus(bool update, std::string *ErrStr) const {
- if (!fsIsValid || update) {
- struct stat buf;
- if (0 != stat(path.c_str(), &buf)) {
- MakeErrMsg(ErrStr, path + ": can't get status of file");
- return 0;
- }
- status.fileSize = buf.st_size;
- status.modTime.fromEpochTime(buf.st_mtime);
- status.mode = buf.st_mode;
- status.user = buf.st_uid;
- status.group = buf.st_gid;
- status.uniqueID = uint64_t(buf.st_ino);
- status.isDir = S_ISDIR(buf.st_mode);
- status.isFile = S_ISREG(buf.st_mode);
- fsIsValid = true;
- }
- return &status;
-}
-
-static bool AddPermissionBits(const Path &File, int bits) {
- // Get the umask value from the operating system. We want to use it
- // when changing the file's permissions. Since calling umask() sets
- // the umask and returns its old value, we must call it a second
- // time to reset it to the user's preference.
- int mask = umask(0777); // The arg. to umask is arbitrary.
- umask(mask); // Restore the umask.
-
- // Get the file's current mode.
- struct stat buf;
- if (0 != stat(File.toString().c_str(), &buf))
- return false;
- // Change the file to have whichever permissions bits from 'bits'
- // that the umask would not disable.
- if ((chmod(File.c_str(), (buf.st_mode | (bits & ~mask)))) == -1)
- return false;
- return true;
-}
-
-bool Path::makeReadableOnDisk(std::string* ErrMsg) {
- if (!AddPermissionBits(*this, 0444))
- return MakeErrMsg(ErrMsg, path + ": can't make file readable");
- return false;
-}
-
-bool Path::makeWriteableOnDisk(std::string* ErrMsg) {
- if (!AddPermissionBits(*this, 0222))
- return MakeErrMsg(ErrMsg, path + ": can't make file writable");
- return false;
-}
-
-bool Path::makeExecutableOnDisk(std::string* ErrMsg) {
- if (!AddPermissionBits(*this, 0111))
- return MakeErrMsg(ErrMsg, path + ": can't make file executable");
- return false;
-}
-
-bool
-Path::getDirectoryContents(std::set<Path>& result, std::string* ErrMsg) const {
- DIR* direntries = ::opendir(path.c_str());
- if (direntries == 0)
- return MakeErrMsg(ErrMsg, path + ": can't open directory");
-
- std::string dirPath = path;
- if (!lastIsSlash(dirPath))
- dirPath += '/';
-
- result.clear();
- struct dirent* de = ::readdir(direntries);
- for ( ; de != 0; de = ::readdir(direntries)) {
- if (de->d_name[0] != '.') {
- Path aPath(dirPath + (const char*)de->d_name);
- struct stat st;
- if (0 != lstat(aPath.path.c_str(), &st)) {
- if (S_ISLNK(st.st_mode))
- continue; // dangling symlink -- ignore
- return MakeErrMsg(ErrMsg,
- aPath.path + ": can't determine file object type");
- }
- result.insert(aPath);
- }
- }
-
- closedir(direntries);
- return false;
-}
-
-bool
-Path::set(const std::string& a_path) {
- if (a_path.empty())
- return false;
- std::string save(path);
- path = a_path;
- if (!isValid()) {
- path = save;
- return false;
- }
- return true;
-}
-
-bool
-Path::appendComponent(const std::string& name) {
- if (name.empty())
- return false;
- std::string save(path);
- if (!lastIsSlash(path))
- path += '/';
- path += name;
- if (!isValid()) {
- path = save;
- return false;
- }
- return true;
-}
-
-bool
-Path::eraseComponent() {
- size_t slashpos = path.rfind('/',path.size());
- if (slashpos == 0 || slashpos == std::string::npos) {
- path.erase();
- return true;
- }
- if (slashpos == path.size() - 1)
- slashpos = path.rfind('/',slashpos-1);
- if (slashpos == std::string::npos) {
- path.erase();
- return true;
- }
- path.erase(slashpos);
- return true;
-}
-
-bool
-Path::appendSuffix(const std::string& suffix) {
- std::string save(path);
- path.append(".");
- path.append(suffix);
- if (!isValid()) {
- path = save;
- return false;
- }
- return true;
-}
-
-bool
-Path::eraseSuffix() {
- std::string save = path;
- size_t dotpos = path.rfind('.',path.size());
- size_t slashpos = path.rfind('/',path.size());
- if (dotpos != std::string::npos) {
- if (slashpos == std::string::npos || dotpos > slashpos+1) {
- path.erase(dotpos, path.size()-dotpos);
- return true;
- }
- }
- if (!isValid())
- path = save;
- return false;
-}
-
-static bool createDirectoryHelper(char* beg, char* end, bool create_parents) {
-
- if (access(beg, F_OK | R_OK | W_OK) == 0)
- return false;
-
- if (create_parents) {
-
- char* c = end;
-
- for (; c != beg; --c)
- if (*c == '/') {
-
- // Recurse to handling the parent directory.
- *c = '\0';
- bool x = createDirectoryHelper(beg, c, create_parents);
- *c = '/';
-
- // Return if we encountered an error.
- if (x)
- return true;
-
- break;
- }
- }
-
- return mkdir(beg, S_IRWXU | S_IRWXG) != 0;
-}
-
-bool
-Path::createDirectoryOnDisk( bool create_parents, std::string* ErrMsg ) {
- // Get a writeable copy of the path name
- char pathname[MAXPATHLEN];
- path.copy(pathname,MAXPATHLEN);
-
- // Null-terminate the last component
- size_t lastchar = path.length() - 1 ;
-
- if (pathname[lastchar] != '/')
- ++lastchar;
-
- pathname[lastchar] = 0;
-
- if (createDirectoryHelper(pathname, pathname+lastchar, create_parents))
- return MakeErrMsg(ErrMsg,
- std::string(pathname) + ": can't create directory");
-
- return false;
-}
-
-bool
-Path::createFileOnDisk(std::string* ErrMsg) {
- // Create the file
- int fd = ::creat(path.c_str(), S_IRUSR | S_IWUSR);
- if (fd < 0)
- return MakeErrMsg(ErrMsg, path + ": can't create file");
- ::close(fd);
- return false;
-}
-
-bool
-Path::createTemporaryFileOnDisk(bool reuse_current, std::string* ErrMsg) {
- // Make this into a unique file name
- if (makeUnique( reuse_current, ErrMsg ))
- return true;
-
- // create the file
- int fd = ::open(path.c_str(), O_WRONLY|O_CREAT|O_TRUNC, 0666);
- if (fd < 0)
- return MakeErrMsg(ErrMsg, path + ": can't create temporary file");
- ::close(fd);
- return false;
-}
-
-bool
-Path::eraseFromDisk(bool remove_contents, std::string *ErrStr) const {
- // Get the status so we can determin if its a file or directory
- struct stat buf;
- if (0 != stat(path.c_str(), &buf)) {
- MakeErrMsg(ErrStr, path + ": can't get status of file");
- return true;
- }
-
- // Note: this check catches strange situations. In all cases, LLVM should
- // only be involved in the creation and deletion of regular files. This
- // check ensures that what we're trying to erase is a regular file. It
- // effectively prevents LLVM from erasing things like /dev/null, any block
- // special file, or other things that aren't "regular" files.
- if (S_ISREG(buf.st_mode)) {
- if (unlink(path.c_str()) != 0)
- return MakeErrMsg(ErrStr, path + ": can't destroy file");
- return false;
- }
-
- if (!S_ISDIR(buf.st_mode)) {
- if (ErrStr) *ErrStr = "not a file or directory";
- return true;
- }
-
- if (remove_contents) {
- // Recursively descend the directory to remove its contents.
- std::string cmd = "/bin/rm -rf " + path;
- system(cmd.c_str());
- return false;
- }
-
- // Otherwise, try to just remove the one directory.
- char pathname[MAXPATHLEN];
- path.copy(pathname, MAXPATHLEN);
- size_t lastchar = path.length() - 1;
- if (pathname[lastchar] == '/')
- pathname[lastchar] = 0;
- else
- pathname[lastchar+1] = 0;
-
- if (rmdir(pathname) != 0)
- return MakeErrMsg(ErrStr,
- std::string(pathname) + ": can't erase directory");
- return false;
-}
-
-bool
-Path::renamePathOnDisk(const Path& newName, std::string* ErrMsg) {
- if (0 != ::rename(path.c_str(), newName.c_str()))
- return MakeErrMsg(ErrMsg, std::string("can't rename '") + path + "' as '" +
- newName.toString() + "' ");
- return false;
-}
-
-bool
-Path::setStatusInfoOnDisk(const FileStatus &si, std::string *ErrStr) const {
- struct utimbuf utb;
- utb.actime = si.modTime.toPosixTime();
- utb.modtime = utb.actime;
- if (0 != ::utime(path.c_str(),&utb))
- return MakeErrMsg(ErrStr, path + ": can't set file modification time");
- if (0 != ::chmod(path.c_str(),si.mode))
- return MakeErrMsg(ErrStr, path + ": can't set mode");
- return false;
-}
-
-bool
-sys::CopyFile(const sys::Path &Dest, const sys::Path &Src, std::string* ErrMsg){
- int inFile = -1;
- int outFile = -1;
- inFile = ::open(Src.c_str(), O_RDONLY);
- if (inFile == -1)
- return MakeErrMsg(ErrMsg, Src.toString() +
- ": can't open source file to copy");
-
- outFile = ::open(Dest.c_str(), O_WRONLY|O_CREAT, 0666);
- if (outFile == -1) {
- ::close(inFile);
- return MakeErrMsg(ErrMsg, Dest.toString() +
- ": can't create destination file for copy");
- }
-
- char Buffer[16*1024];
- while (ssize_t Amt = ::read(inFile, Buffer, 16*1024)) {
- if (Amt == -1) {
- if (errno != EINTR && errno != EAGAIN) {
- ::close(inFile);
- ::close(outFile);
- return MakeErrMsg(ErrMsg, Src.toString()+": can't read source file: ");
- }
- } else {
- char *BufPtr = Buffer;
- while (Amt) {
- ssize_t AmtWritten = ::write(outFile, BufPtr, Amt);
- if (AmtWritten == -1) {
- if (errno != EINTR && errno != EAGAIN) {
- ::close(inFile);
- ::close(outFile);
- return MakeErrMsg(ErrMsg, Dest.toString() +
- ": can't write destination file: ");
- }
- } else {
- Amt -= AmtWritten;
- BufPtr += AmtWritten;
- }
- }
- }
- }
- ::close(inFile);
- ::close(outFile);
- return false;
-}
-
-bool
-Path::makeUnique(bool reuse_current, std::string* ErrMsg) {
- if (reuse_current && !exists())
- return false; // File doesn't exist already, just use it!
-
- // Append an XXXXXX pattern to the end of the file for use with mkstemp,
- // mktemp or our own implementation.
- char *FNBuffer = (char*) alloca(path.size()+8);
- path.copy(FNBuffer,path.size());
- strcpy(FNBuffer+path.size(), "-XXXXXX");
-
-#if defined(HAVE_MKSTEMP)
- int TempFD;
- if ((TempFD = mkstemp(FNBuffer)) == -1)
- return MakeErrMsg(ErrMsg, path + ": can't make unique filename");
-
- // We don't need to hold the temp file descriptor... we will trust that no one
- // will overwrite/delete the file before we can open it again.
- close(TempFD);
-
- // Save the name
- path = FNBuffer;
-#elif defined(HAVE_MKTEMP)
- // If we don't have mkstemp, use the old and obsolete mktemp function.
- if (mktemp(FNBuffer) == 0)
- return MakeErrMsg(ErrMsg, path + ": can't make unique filename");
-
- // Save the name
- path = FNBuffer;
-#else
- // Okay, looks like we have to do it all by our lonesome.
- static unsigned FCounter = 0;
- unsigned offset = path.size() + 1;
- while ( FCounter < 999999 && exists()) {
- sprintf(FNBuffer+offset,"%06u",++FCounter);
- path = FNBuffer;
- }
- if (FCounter > 999999)
- return MakeErrMsg(ErrMsg,
- path + ": can't make unique filename: too many files");
-#endif
- return false;
-}
-
-const char *Path::MapInFilePages(int FD, uint64_t FileSize) {
- int Flags = MAP_PRIVATE;
-#ifdef MAP_FILE
- Flags |= MAP_FILE;
-#endif
- void *BasePtr = ::mmap(0, FileSize, PROT_READ, Flags, FD, 0);
- if (BasePtr == MAP_FAILED)
- return 0;
- return (const char*)BasePtr;
-}
-
-void Path::UnMapFilePages(const char *BasePtr, uint64_t FileSize) {
- ::munmap((void*)BasePtr, FileSize);
-}
-
-} // end llvm namespace
-
diff --git a/release_23/lib/System/Unix/Process.inc b/release_23/lib/System/Unix/Process.inc
deleted file mode 100644
index 8a2598bda4e3..000000000000
--- a/release_23/lib/System/Unix/Process.inc
+++ /dev/null
@@ -1,192 +0,0 @@
-//===- Unix/Process.cpp - Unix Process Implementation --------- -*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file provides the generic Unix implementation of the Process class.
-//
-//===----------------------------------------------------------------------===//
-
-#include "Unix.h"
-#ifdef HAVE_SYS_TIME_H
-#include <sys/time.h>
-#endif
-#ifdef HAVE_SYS_RESOURCE_H
-#include <sys/resource.h>
-#endif
-#ifdef HAVE_MALLOC_H
-#include <malloc.h>
-#endif
-#ifdef HAVE_MALLOC_MALLOC_H
-#include <malloc/malloc.h>
-#endif
-
-//===----------------------------------------------------------------------===//
-//=== WARNING: Implementation here must contain only generic UNIX code that
-//=== is guaranteed to work on *all* UNIX variants.
-//===----------------------------------------------------------------------===//
-
-using namespace llvm;
-using namespace sys;
-
-unsigned
-Process::GetPageSize()
-{
-#if defined(HAVE_GETPAGESIZE)
- static const int page_size = ::getpagesize();
-#elif defined(HAVE_SYSCONF)
- static long page_size = ::sysconf(_SC_PAGE_SIZE);
-#else
-#warning Cannot get the page size on this machine
-#endif
- return static_cast<unsigned>(page_size);
-}
-
-size_t Process::GetMallocUsage() {
-#if defined(HAVE_MALLINFO)
- struct mallinfo mi;
- mi = ::mallinfo();
- return mi.uordblks;
-#elif defined(HAVE_MALLOC_ZONE_STATISTICS) && defined(HAVE_MALLOC_MALLOC_H)
- malloc_statistics_t Stats;
- malloc_zone_statistics(malloc_default_zone(), &Stats);
- return Stats.size_in_use; // darwin
-#elif defined(HAVE_SBRK)
- // Note this is only an approximation and more closely resembles
- // the value returned by mallinfo in the arena field.
- static char *StartOfMemory = reinterpret_cast<char*>(::sbrk(0));
- char *EndOfMemory = (char*)sbrk(0);
- if (EndOfMemory != ((char*)-1) && StartOfMemory != ((char*)-1))
- return EndOfMemory - StartOfMemory;
- else
- return 0;
-#else
-#warning Cannot get malloc info on this platform
- return 0;
-#endif
-}
-
-size_t
-Process::GetTotalMemoryUsage()
-{
-#if defined(HAVE_MALLINFO)
- struct mallinfo mi = ::mallinfo();
- return mi.uordblks + mi.hblkhd;
-#elif defined(HAVE_MALLOC_ZONE_STATISTICS) && defined(HAVE_MALLOC_MALLOC_H)
- malloc_statistics_t Stats;
- malloc_zone_statistics(malloc_default_zone(), &Stats);
- return Stats.size_allocated; // darwin
-#elif defined(HAVE_GETRUSAGE)
- struct rusage usage;
- ::getrusage(RUSAGE_SELF, &usage);
- return usage.ru_maxrss;
-#else
-#warning Cannot get total memory size on this platform
- return 0;
-#endif
-}
-
-void
-Process::GetTimeUsage(TimeValue& elapsed, TimeValue& user_time,
- TimeValue& sys_time)
-{
- elapsed = TimeValue::now();
-#if defined(HAVE_GETRUSAGE)
- struct rusage usage;
- ::getrusage(RUSAGE_SELF, &usage);
- user_time = TimeValue(
- static_cast<TimeValue::SecondsType>( usage.ru_utime.tv_sec ),
- static_cast<TimeValue::NanoSecondsType>( usage.ru_utime.tv_usec *
- TimeValue::NANOSECONDS_PER_MICROSECOND ) );
- sys_time = TimeValue(
- static_cast<TimeValue::SecondsType>( usage.ru_stime.tv_sec ),
- static_cast<TimeValue::NanoSecondsType>( usage.ru_stime.tv_usec *
- TimeValue::NANOSECONDS_PER_MICROSECOND ) );
-#else
-#warning Cannot get usage times on this platform
- user_time.seconds(0);
- user_time.microseconds(0);
- sys_time.seconds(0);
- sys_time.microseconds(0);
-#endif
-}
-
-int Process::GetCurrentUserId() {
- return getuid();
-}
-
-int Process::GetCurrentGroupId() {
- return getgid();
-}
-
-#ifdef HAVE_MACH_MACH_H
-#include <mach/mach.h>
-#endif
-
-// Some LLVM programs such as bugpoint produce core files as a normal part of
-// their operation. To prevent the disk from filling up, this function
-// does what's necessary to prevent their generation.
-void Process::PreventCoreFiles() {
-#if HAVE_SETRLIMIT
- struct rlimit rlim;
- rlim.rlim_cur = rlim.rlim_max = 0;
- setrlimit(RLIMIT_CORE, &rlim);
-#endif
-
-#ifdef HAVE_MACH_MACH_H
- // Disable crash reporting on Mac OS X 10.0-10.4
-
- // get information about the original set of exception ports for the task
- mach_msg_type_number_t Count = 0;
- exception_mask_t OriginalMasks[EXC_TYPES_COUNT];
- exception_port_t OriginalPorts[EXC_TYPES_COUNT];
- exception_behavior_t OriginalBehaviors[EXC_TYPES_COUNT];
- thread_state_flavor_t OriginalFlavors[EXC_TYPES_COUNT];
- kern_return_t err =
- task_get_exception_ports(mach_task_self(), EXC_MASK_ALL, OriginalMasks,
- &Count, OriginalPorts, OriginalBehaviors,
- OriginalFlavors);
- if (err == KERN_SUCCESS) {
- // replace each with MACH_PORT_NULL.
- for (unsigned i = 0; i != Count; ++i)
- task_set_exception_ports(mach_task_self(), OriginalMasks[i],
- MACH_PORT_NULL, OriginalBehaviors[i],
- OriginalFlavors[i]);
- }
-
- // Disable crash reporting on Mac OS X 10.5
- signal(SIGABRT, _exit);
- signal(SIGILL, _exit);
- signal(SIGFPE, _exit);
- signal(SIGSEGV, _exit);
- signal(SIGBUS, _exit);
-#endif
-}
-
-bool Process::StandardInIsUserInput() {
-#if HAVE_ISATTY
- return isatty(0);
-#endif
- // If we don't have isatty, just return false.
- return false;
-}
-
-bool Process::StandardOutIsDisplayed() {
-#if HAVE_ISATTY
- return isatty(1);
-#endif
- // If we don't have isatty, just return false.
- return false;
-}
-
-bool Process::StandardErrIsDisplayed() {
-#if HAVE_ISATTY
- return isatty(2);
-#endif
- // If we don't have isatty, just return false.
- return false;
-}
diff --git a/release_23/lib/System/Unix/Program.inc b/release_23/lib/System/Unix/Program.inc
deleted file mode 100644
index d0dade1f8cad..000000000000
--- a/release_23/lib/System/Unix/Program.inc
+++ /dev/null
@@ -1,288 +0,0 @@
-//===- llvm/System/Unix/Program.cpp -----------------------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the Unix specific portion of the Program class.
-//
-//===----------------------------------------------------------------------===//
-
-//===----------------------------------------------------------------------===//
-//=== WARNING: Implementation here must contain only generic UNIX code that
-//=== is guaranteed to work on *all* UNIX variants.
-//===----------------------------------------------------------------------===//
-
-#include <llvm/Config/config.h>
-#include "Unix.h"
-#include <iostream>
-#if HAVE_SYS_STAT_H
-#include <sys/stat.h>
-#endif
-#if HAVE_SYS_RESOURCE_H
-#include <sys/resource.h>
-#endif
-#if HAVE_SIGNAL_H
-#include <signal.h>
-#endif
-#if HAVE_FCNTL_H
-#include <fcntl.h>
-#endif
-
-namespace llvm {
-using namespace sys;
-
-// This function just uses the PATH environment variable to find the program.
-Path
-Program::FindProgramByName(const std::string& progName) {
-
- // Check some degenerate cases
- if (progName.length() == 0) // no program
- return Path();
- Path temp;
- if (!temp.set(progName)) // invalid name
- return Path();
- // FIXME: have to check for absolute filename - we cannot assume anything
- // about "." being in $PATH
- if (temp.canExecute()) // already executable as is
- return temp;
-
- // At this point, the file name is valid and its not executable
-
- // Get the path. If its empty, we can't do anything to find it.
- const char *PathStr = getenv("PATH");
- if (PathStr == 0)
- return Path();
-
- // Now we have a colon separated list of directories to search; try them.
- size_t PathLen = strlen(PathStr);
- while (PathLen) {
- // Find the first colon...
- const char *Colon = std::find(PathStr, PathStr+PathLen, ':');
-
- // Check to see if this first directory contains the executable...
- Path FilePath;
- if (FilePath.set(std::string(PathStr,Colon))) {
- FilePath.appendComponent(progName);
- if (FilePath.canExecute())
- return FilePath; // Found the executable!
- }
-
- // Nope it wasn't in this directory, check the next path in the list!
- PathLen -= Colon-PathStr;
- PathStr = Colon;
-
- // Advance past duplicate colons
- while (*PathStr == ':') {
- PathStr++;
- PathLen--;
- }
- }
- return Path();
-}
-
-static bool RedirectFD(const std::string &File, int FD, std::string* ErrMsg) {
- if (File.empty()) return false; // Noop
-
- // Open the file
- int InFD = open(File.c_str(), FD == 0 ? O_RDONLY : O_WRONLY|O_CREAT, 0666);
- if (InFD == -1) {
- MakeErrMsg(ErrMsg, "Cannot open file '" + File + "' for "
- + (FD == 0 ? "input" : "output") + "!\n");
- return true;
- }
-
- // Install it as the requested FD
- if (-1 == dup2(InFD, FD)) {
- MakeErrMsg(ErrMsg, "Cannot dup2");
- return true;
- }
- close(InFD); // Close the original FD
- return false;
-}
-
-static bool Timeout = false;
-static void TimeOutHandler(int Sig) {
- Timeout = true;
-}
-
-static void SetMemoryLimits (unsigned size)
-{
-#if HAVE_SYS_RESOURCE_H
- struct rlimit r;
- __typeof__ (r.rlim_cur) limit = (__typeof__ (r.rlim_cur)) (size) * 1048576;
-
- // Heap size
- getrlimit (RLIMIT_DATA, &r);
- r.rlim_cur = limit;
- setrlimit (RLIMIT_DATA, &r);
-#ifdef RLIMIT_RSS
- // Resident set size.
- getrlimit (RLIMIT_RSS, &r);
- r.rlim_cur = limit;
- setrlimit (RLIMIT_RSS, &r);
-#endif
-#ifdef RLIMIT_AS // e.g. NetBSD doesn't have it.
- // Virtual memory.
- getrlimit (RLIMIT_AS, &r);
- r.rlim_cur = limit;
- setrlimit (RLIMIT_AS, &r);
-#endif
-#endif
-}
-
-int
-Program::ExecuteAndWait(const Path& path,
- const char** args,
- const char** envp,
- const Path** redirects,
- unsigned secondsToWait,
- unsigned memoryLimit,
- std::string* ErrMsg)
-{
- if (!path.canExecute()) {
- if (ErrMsg)
- *ErrMsg = path.toString() + " is not executable";
- return -1;
- }
-
-#ifdef HAVE_SYS_WAIT_H
- // Create a child process.
- int child = fork();
- switch (child) {
- // An error occured: Return to the caller.
- case -1:
- MakeErrMsg(ErrMsg, "Couldn't fork");
- return -1;
-
- // Child process: Execute the program.
- case 0: {
- // Redirect file descriptors...
- if (redirects) {
- if (redirects[0]) {
- if (redirects[0]->isEmpty()) {
- if (RedirectFD("/dev/null",0,ErrMsg)) { return -1; }
- } else {
- if (RedirectFD(redirects[0]->toString(), 0,ErrMsg)) { return -1; }
- }
- }
- if (redirects[1]) {
- if (redirects[1]->isEmpty()) {
- if (RedirectFD("/dev/null",1,ErrMsg)) { return -1; }
- } else {
- if (RedirectFD(redirects[1]->toString(),1,ErrMsg)) { return -1; }
- }
- }
- if (redirects[1] && redirects[2] &&
- *(redirects[1]) != *(redirects[2])) {
- if (redirects[2]->isEmpty()) {
- if (RedirectFD("/dev/null",2,ErrMsg)) { return -1; }
- } else {
- if (RedirectFD(redirects[2]->toString(), 2,ErrMsg)) { return -1; }
- }
- } else if (-1 == dup2(1,2)) {
- MakeErrMsg(ErrMsg, "Can't redirect");
- return -1;
- }
- }
-
- // Set memory limits
- if (memoryLimit!=0) {
- SetMemoryLimits(memoryLimit);
- }
-
- // Execute!
- if (envp != 0)
- execve (path.c_str(), (char**)args, (char**)envp);
- else
- execv (path.c_str(), (char**)args);
- // If the execve() failed, we should exit and let the parent pick up
- // our non-zero exit status.
- exit (errno);
- }
-
- // Parent process: Break out of the switch to do our processing.
- default:
- break;
- }
-
- // Make sure stderr and stdout have been flushed
- std::cerr << std::flush;
- std::cout << std::flush;
- fsync(1);
- fsync(2);
-
- struct sigaction Act, Old;
-
- // Install a timeout handler.
- if (secondsToWait) {
- Timeout = false;
- Act.sa_sigaction = 0;
- Act.sa_handler = TimeOutHandler;
- sigemptyset(&Act.sa_mask);
- Act.sa_flags = 0;
- sigaction(SIGALRM, &Act, &Old);
- alarm(secondsToWait);
- }
-
- // Parent process: Wait for the child process to terminate.
- int status;
- while (wait(&status) != child)
- if (secondsToWait && errno == EINTR) {
- // Kill the child.
- kill(child, SIGKILL);
-
- // Turn off the alarm and restore the signal handler
- alarm(0);
- sigaction(SIGALRM, &Old, 0);
-
- // Wait for child to die
- if (wait(&status) != child)
- MakeErrMsg(ErrMsg, "Child timed out but wouldn't die");
- else
- MakeErrMsg(ErrMsg, "Child timed out", 0);
-
- return -1; // Timeout detected
- } else if (errno != EINTR) {
- MakeErrMsg(ErrMsg, "Error waiting for child process");
- return -1;
- }
-
- // We exited normally without timeout, so turn off the timer.
- if (secondsToWait) {
- alarm(0);
- sigaction(SIGALRM, &Old, 0);
- }
-
- // Return the proper exit status. 0=success, >0 is programs' exit status,
- // <0 means a signal was returned, -9999999 means the program dumped core.
- int result = 0;
- if (WIFEXITED(status))
- result = WEXITSTATUS(status);
- else if (WIFSIGNALED(status))
- result = 0 - WTERMSIG(status);
-#ifdef WCOREDUMP
- else if (WCOREDUMP(status))
- result |= 0x01000000;
-#endif
- return result;
-#else
- return -99;
-#endif
-
-}
-
-bool Program::ChangeStdinToBinary(){
- // Do nothing, as Unix doesn't differentiate between text and binary.
- return false;
-}
-
-bool Program::ChangeStdoutToBinary(){
- // Do nothing, as Unix doesn't differentiate between text and binary.
- return false;
-}
-
-}
diff --git a/release_23/lib/System/Unix/README.txt b/release_23/lib/System/Unix/README.txt
deleted file mode 100644
index b3bace483e5d..000000000000
--- a/release_23/lib/System/Unix/README.txt
+++ /dev/null
@@ -1,16 +0,0 @@
-llvm/lib/System/Unix README
-===========================
-
-This directory provides implementations of the lib/System classes that
-are common to two or more variants of UNIX. For example, the directory
-structure underneath this directory could look like this:
-
-Unix - only code that is truly generic to all UNIX platforms
- Posix - code that is specific to Posix variants of UNIX
- SUS - code that is specific to the Single Unix Specification
- SysV - code that is specific to System V variants of UNIX
-
-As a rule, only those directories actually needing to be created should be
-created. Also, further subdirectories could be created to reflect versions of
-the various standards. For example, under SUS there could be v1, v2, and v3
-subdirectories to reflect the three major versions of SUS.
diff --git a/release_23/lib/System/Unix/Signals.inc b/release_23/lib/System/Unix/Signals.inc
deleted file mode 100644
index 79236cdad931..000000000000
--- a/release_23/lib/System/Unix/Signals.inc
+++ /dev/null
@@ -1,161 +0,0 @@
-//===- Signals.cpp - Generic Unix Signals Implementation -----*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines some helpful functions for dealing with the possibility of
-// Unix signals occuring while your program is running.
-//
-//===----------------------------------------------------------------------===//
-
-#include "Unix.h"
-#include "llvm/ADT/STLExtras.h"
-#include <vector>
-#include <algorithm>
-#if HAVE_EXECINFO_H
-# include <execinfo.h> // For backtrace().
-#endif
-#if HAVE_SIGNAL_H
-#include <signal.h>
-#endif
-#if HAVE_SYS_STAT_H
-#include <sys/stat.h>
-#endif
-using namespace llvm;
-
-namespace {
-
-static bool StackTraceRequested = false;
-
-/// InterruptFunction - The function to call if ctrl-c is pressed.
-static void (*InterruptFunction)() = 0;
-
-static std::vector<sys::Path> *FilesToRemove = 0 ;
-static std::vector<sys::Path> *DirectoriesToRemove = 0;
-
-// IntSigs - Signals that may interrupt the program at any time.
-static const int IntSigs[] = {
- SIGHUP, SIGINT, SIGQUIT, SIGPIPE, SIGTERM, SIGUSR1, SIGUSR2
-};
-static const int *IntSigsEnd = IntSigs + sizeof(IntSigs) / sizeof(IntSigs[0]);
-
-// KillSigs - Signals that are synchronous with the program that will cause it
-// to die.
-static const int KillSigs[] = {
- SIGILL, SIGTRAP, SIGABRT, SIGFPE, SIGBUS, SIGSEGV, SIGSYS, SIGXCPU, SIGXFSZ
-#ifdef SIGEMT
- , SIGEMT
-#endif
-};
-static const int *KillSigsEnd = KillSigs + sizeof(KillSigs) / sizeof(KillSigs[0]);
-
-#ifdef HAVE_BACKTRACE
-static void* StackTrace[256];
-#endif
-
-// PrintStackTrace - In the case of a program crash or fault, print out a stack
-// trace so that the user has an indication of why and where we died.
-//
-// On glibc systems we have the 'backtrace' function, which works nicely, but
-// doesn't demangle symbols.
-static void PrintStackTrace() {
-#ifdef HAVE_BACKTRACE
- // Use backtrace() to output a backtrace on Linux systems with glibc.
- int depth = backtrace(StackTrace,
- static_cast<int>(array_lengthof(StackTrace)));
- backtrace_symbols_fd(StackTrace, depth, STDERR_FILENO);
-#endif
-}
-
-// SignalHandler - The signal handler that runs...
-static RETSIGTYPE SignalHandler(int Sig) {
- if (FilesToRemove != 0)
- while (!FilesToRemove->empty()) {
- FilesToRemove->back().eraseFromDisk(true);
- FilesToRemove->pop_back();
- }
-
- if (DirectoriesToRemove != 0)
- while (!DirectoriesToRemove->empty()) {
- DirectoriesToRemove->back().eraseFromDisk(true);
- DirectoriesToRemove->pop_back();
- }
-
- if (std::find(IntSigs, IntSigsEnd, Sig) != IntSigsEnd) {
- if (InterruptFunction) {
- void (*IF)() = InterruptFunction;
- InterruptFunction = 0;
- IF(); // run the interrupt function.
- return;
- } else {
- exit(1); // If this is an interrupt signal, exit the program
- }
- }
-
- // Otherwise if it is a fault (like SEGV) output the stacktrace to
- // STDERR (if we can) and reissue the signal to die...
- if (StackTraceRequested)
- PrintStackTrace();
- signal(Sig, SIG_DFL);
-}
-
-// Just call signal
-static void RegisterHandler(int Signal) {
- signal(Signal, SignalHandler);
-}
-
-}
-
-
-void sys::SetInterruptFunction(void (*IF)()) {
- InterruptFunction = IF;
- RegisterHandler(SIGINT);
-}
-
-// RemoveFileOnSignal - The public API
-bool sys::RemoveFileOnSignal(const sys::Path &Filename, std::string* ErrMsg) {
- if (FilesToRemove == 0)
- FilesToRemove = new std::vector<sys::Path>;
-
- FilesToRemove->push_back(Filename);
-
- std::for_each(IntSigs, IntSigsEnd, RegisterHandler);
- std::for_each(KillSigs, KillSigsEnd, RegisterHandler);
- return false;
-}
-
-// RemoveDirectoryOnSignal - The public API
-bool sys::RemoveDirectoryOnSignal(const sys::Path& path, std::string* ErrMsg) {
- // Not a directory?
- struct stat buf;
- if (0 != stat(path.c_str(), &buf)) {
- MakeErrMsg(ErrMsg, path.toString() + ": can't get status of file");
- return true;
- }
-
- if (!S_ISDIR(buf.st_mode)) {
- if (ErrMsg)
- *ErrMsg = path.toString() + " is not a directory";
- return true;
- }
-
- if (DirectoriesToRemove == 0)
- DirectoriesToRemove = new std::vector<sys::Path>;
-
- DirectoriesToRemove->push_back(path);
-
- std::for_each(IntSigs, IntSigsEnd, RegisterHandler);
- std::for_each(KillSigs, KillSigsEnd, RegisterHandler);
- return false;
-}
-
-/// PrintStackTraceOnErrorSignal - When an error signal (such as SIBABRT or
-/// SIGSEGV) is delivered to the process, print a stack trace and then exit.
-void sys::PrintStackTraceOnErrorSignal() {
- StackTraceRequested = true;
- std::for_each(KillSigs, KillSigsEnd, RegisterHandler);
-}
diff --git a/release_23/lib/System/Unix/TimeValue.inc b/release_23/lib/System/Unix/TimeValue.inc
deleted file mode 100644
index 8dd30b9322f9..000000000000
--- a/release_23/lib/System/Unix/TimeValue.inc
+++ /dev/null
@@ -1,56 +0,0 @@
-//===- Unix/TimeValue.cpp - Unix TimeValue Implementation -------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the Unix specific portion of the TimeValue class.
-//
-//===----------------------------------------------------------------------===//
-
-//===----------------------------------------------------------------------===//
-//=== WARNING: Implementation here must contain only generic UNIX code that
-//=== is guaranteed to work on *all* UNIX variants.
-//===----------------------------------------------------------------------===//
-
-#include "Unix.h"
-
-namespace llvm {
- using namespace sys;
-
-std::string TimeValue::toString() const {
- char buffer[32];
-
- time_t ourTime = time_t(this->toEpochTime());
-#ifdef __hpux
-// note that the following line needs -D_REENTRANT on HP-UX to be picked up
- asctime_r(localtime(&ourTime), buffer);
-#else
- ::asctime_r(::localtime(&ourTime), buffer);
-#endif
-
- std::string result(buffer);
- return result.substr(0,24);
-}
-
-TimeValue TimeValue::now() {
- struct timeval the_time;
- timerclear(&the_time);
- if (0 != ::gettimeofday(&the_time,0)) {
- // This is *really* unlikely to occur because the only gettimeofday
- // errors concern the timezone parameter which we're passing in as 0.
- // In the unlikely case it does happen, just return MinTime, no error
- // message needed.
- return MinTime;
- }
-
- return TimeValue(
- static_cast<TimeValue::SecondsType>( the_time.tv_sec ),
- static_cast<TimeValue::NanoSecondsType>( the_time.tv_usec *
- NANOSECONDS_PER_MICROSECOND ) );
-}
-
-}
diff --git a/release_23/lib/System/Unix/Unix.h b/release_23/lib/System/Unix/Unix.h
deleted file mode 100644
index a7030fc7b27c..000000000000
--- a/release_23/lib/System/Unix/Unix.h
+++ /dev/null
@@ -1,101 +0,0 @@
-//===- llvm/System/Unix/Unix.h - Common Unix Include File -------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines things specific to Unix implementations.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_SYSTEM_UNIX_UNIX_H
-#define LLVM_SYSTEM_UNIX_UNIX_H
-
-//===----------------------------------------------------------------------===//
-//=== WARNING: Implementation here must contain only generic UNIX code that
-//=== is guaranteed to work on all UNIX variants.
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Config/config.h" // Get autoconf configuration settings
-#include <cstdlib>
-#include <cstdio>
-#include <cstring>
-#include <cerrno>
-#include <string>
-#include <algorithm>
-
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-
-#ifdef HAVE_SYS_PARAM_H
-#include <sys/param.h>
-#endif
-
-#ifdef HAVE_ASSERT_H
-#include <assert.h>
-#endif
-
-#ifdef TIME_WITH_SYS_TIME
-# include <sys/time.h>
-# include <time.h>
-#else
-# ifdef HAVE_SYS_TIME_H
-# include <sys/time.h>
-# else
-# include <time.h>
-# endif
-#endif
-
-#ifdef HAVE_SYS_WAIT_H
-# include <sys/wait.h>
-#endif
-
-#ifndef WEXITSTATUS
-# define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
-#endif
-
-#ifndef WIFEXITED
-# define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
-#endif
-
-/// This function builds an error message into \p ErrMsg using the \p prefix
-/// string and the Unix error number given by \p errnum. If errnum is -1, the
-/// default then the value of errno is used.
-/// @brief Make an error message
-inline bool MakeErrMsg(
- std::string* ErrMsg, const std::string& prefix, int errnum = -1) {
- if (!ErrMsg)
- return true;
- char buffer[MAXPATHLEN];
- buffer[0] = 0;
- if (errnum == -1)
- errnum = errno;
-#ifdef HAVE_STRERROR_R
- // strerror_r is thread-safe.
- if (errnum)
- strerror_r(errnum,buffer,MAXPATHLEN-1);
-#elif HAVE_STRERROR
- // Copy the thread un-safe result of strerror into
- // the buffer as fast as possible to minimize impact
- // of collision of strerror in multiple threads.
- if (errnum)
- strncpy(buffer,strerror(errnum),MAXPATHLEN-1);
- buffer[MAXPATHLEN-1] = 0;
-#else
- // Strange that this system doesn't even have strerror
- // but, oh well, just use a generic message
- sprintf(buffer, "Error #%d", errnum);
-#endif
- *ErrMsg = prefix + buffer;
- return true;
-}
-
-#endif
diff --git a/release_23/lib/System/Win32/Alarm.inc b/release_23/lib/System/Win32/Alarm.inc
deleted file mode 100644
index be23bf62faf2..000000000000
--- a/release_23/lib/System/Win32/Alarm.inc
+++ /dev/null
@@ -1,36 +0,0 @@
-//===-- Alarm.inc - Implement Win32 Alarm Support -------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the Win32 Alarm support.
-//
-//===----------------------------------------------------------------------===//
-
-#include <cassert>
-using namespace llvm;
-
-/// NestedSOI - Sanity check. Alarms cannot be nested or run in parallel.
-/// This ensures that they never do.
-static bool NestedSOI = false;
-
-void sys::SetupAlarm(unsigned seconds) {
- assert(!NestedSOI && "sys::SetupAlarm calls cannot be nested!");
- NestedSOI = true;
- // FIXME: Implement for Win32
-}
-
-void sys::TerminateAlarm() {
- assert(NestedSOI && "sys::TerminateAlarm called without sys::SetupAlarm!");
- // FIXME: Implement for Win32
- NestedSOI = false;
-}
-
-int sys::AlarmStatus() {
- // FIXME: Implement for Win32
- return 0;
-}
diff --git a/release_23/lib/System/Win32/DynamicLibrary.inc b/release_23/lib/System/Win32/DynamicLibrary.inc
deleted file mode 100644
index 3cc6a06bb6ce..000000000000
--- a/release_23/lib/System/Win32/DynamicLibrary.inc
+++ /dev/null
@@ -1,180 +0,0 @@
-//===- Win32/DynamicLibrary.cpp - Win32 DL Implementation -------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file provides the Win32 specific implementation of DynamicLibrary.
-//
-//===----------------------------------------------------------------------===//
-
-#include "Win32.h"
-
-#ifdef __MINGW32__
- #include <imagehlp.h>
-#else
- #include <dbghelp.h>
-#endif
-
-#ifdef __MINGW32__
- #if (HAVE_LIBIMAGEHLP != 1)
- #error "libimagehlp.a should be present"
- #endif
-#else
- #pragma comment(lib, "dbghelp.lib")
-#endif
-
-namespace llvm {
-using namespace sys;
-
-//===----------------------------------------------------------------------===//
-//=== WARNING: Implementation here must contain only Win32 specific code
-//=== and must not be UNIX code.
-//===----------------------------------------------------------------------===//
-
-static std::vector<HMODULE> OpenedHandles;
-
-#ifdef _WIN64
- typedef DWORD64 ModuleBaseType;
-#else
- typedef ULONG ModuleBaseType;
-#endif
-
-extern "C" {
-#if !defined(_MSC_VER) || _MSC_VER < 1500
- static BOOL CALLBACK ELM_Callback(PSTR ModuleName,
- ModuleBaseType ModuleBase,
- ULONG ModuleSize,
- PVOID UserContext)
-#else
- static BOOL CALLBACK ELM_Callback(PCSTR ModuleName,
- ModuleBaseType ModuleBase,
- ULONG ModuleSize,
- PVOID UserContext)
-#endif
- {
- // Ignore VC++ runtimes prior to 7.1. Somehow some of them get loaded
- // into the process.
- if (stricmp(ModuleName, "msvci70") != 0 &&
- stricmp(ModuleName, "msvcirt") != 0 &&
- stricmp(ModuleName, "msvcp50") != 0 &&
- stricmp(ModuleName, "msvcp60") != 0 &&
- stricmp(ModuleName, "msvcp70") != 0 &&
- stricmp(ModuleName, "msvcr70") != 0 &&
-#ifndef __MINGW32__
- // Mingw32 uses msvcrt.dll by default. Don't ignore it.
- // Otherwise, user should be aware, what he's doing :)
- stricmp(ModuleName, "msvcrt") != 0 &&
-#endif
- stricmp(ModuleName, "msvcrt20") != 0 &&
- stricmp(ModuleName, "msvcrt40") != 0) {
- OpenedHandles.push_back((HMODULE)ModuleBase);
- }
- return TRUE;
- }
-}
-
-DynamicLibrary::DynamicLibrary() : handle(0) {
- handle = GetModuleHandle(NULL);
- OpenedHandles.push_back((HMODULE)handle);
-}
-
-DynamicLibrary::~DynamicLibrary() {
- if (handle == 0)
- return;
-
- // GetModuleHandle() does not increment the ref count, so we must not free
- // the handle to the executable.
- if (handle != GetModuleHandle(NULL))
- FreeLibrary((HMODULE)handle);
- handle = 0;
-
- for (std::vector<HMODULE>::iterator I = OpenedHandles.begin(),
- E = OpenedHandles.end(); I != E; ++I) {
- if (*I == handle) {
- // Note: don't use the swap/pop_back trick here. Order is important.
- OpenedHandles.erase(I);
- }
- }
-}
-
-bool DynamicLibrary::LoadLibraryPermanently(const char *filename,
- std::string *ErrMsg) {
- if (filename) {
- HMODULE a_handle = LoadLibrary(filename);
-
- if (a_handle == 0)
- return MakeErrMsg(ErrMsg, std::string(filename) + ": Can't open : ");
-
- OpenedHandles.push_back(a_handle);
- } else {
- // When no file is specified, enumerate all DLLs and EXEs in the
- // process.
- EnumerateLoadedModules(GetCurrentProcess(), ELM_Callback, 0);
- }
-
- // Because we don't remember the handle, we will never free it; hence,
- // it is loaded permanently.
- return false;
-}
-
-// Stack probing routines are in the support library (e.g. libgcc), but we don't
-// have dynamic linking on windows. Provide a hook.
-#if defined(__MINGW32__) || defined (_MSC_VER)
- #define EXPLICIT_SYMBOL(SYM) \
- if (!strcmp(symbolName, #SYM)) return (void*)&SYM
- #define EXPLICIT_SYMBOL2(SYMFROM, SYMTO) \
- if (!strcmp(symbolName, #SYMFROM)) return (void*)&SYMTO
- #define EXPLICIT_SYMBOL_DEF(SYM) \
- extern "C" { extern void *SYM; }
-
- #if defined(__MINGW32__)
- EXPLICIT_SYMBOL_DEF(_alloca);
- EXPLICIT_SYMBOL_DEF(__main);
- #elif defined(_MSC_VER)
- EXPLICIT_SYMBOL_DEF(_alloca_probe);
- #endif
-#endif
-
-void* DynamicLibrary::SearchForAddressOfSymbol(const char* symbolName) {
- // First check symbols added via AddSymbol().
- std::map<std::string, void *>::iterator I = g_symbols.find(symbolName);
- if (I != g_symbols.end())
- return I->second;
-
- // Now search the libraries.
- for (std::vector<HMODULE>::iterator I = OpenedHandles.begin(),
- E = OpenedHandles.end(); I != E; ++I) {
- FARPROC ptr = GetProcAddress((HMODULE)*I, symbolName);
- if (ptr)
- return (void *) ptr;
- }
-
-#if defined(__MINGW32__)
- {
- EXPLICIT_SYMBOL(_alloca);
- EXPLICIT_SYMBOL(__main);
-
- EXPLICIT_SYMBOL2(alloca, _alloca);
-#undef EXPLICIT_SYMBOL
-#undef EXPLICIT_SYMBOL2
-#undef EXPLICIT_SYMBOL_DEF
- }
-#elif defined(_MSC_VER)
- {
- EXPLICIT_SYMBOL2(alloca, _alloca_probe);
- EXPLICIT_SYMBOL2(_alloca, _alloca_probe);
-#undef EXPLICIT_SYMBOL
-#undef EXPLICIT_SYMBOL2
-#undef EXPLICIT_SYMBOL_DEF
- }
-#endif
-
- return 0;
-}
-
-}
-
diff --git a/release_23/lib/System/Win32/Memory.inc b/release_23/lib/System/Win32/Memory.inc
deleted file mode 100644
index eed2b100e6d8..000000000000
--- a/release_23/lib/System/Win32/Memory.inc
+++ /dev/null
@@ -1,57 +0,0 @@
-//===- Win32/Memory.cpp - Win32 Memory Implementation -----------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file provides the Win32 specific implementation of various Memory
-// management utilities
-//
-//===----------------------------------------------------------------------===//
-
-#include "Win32.h"
-#include "llvm/System/Process.h"
-
-namespace llvm {
-using namespace sys;
-
-//===----------------------------------------------------------------------===//
-//=== WARNING: Implementation here must contain only Win32 specific code
-//=== and must not be UNIX code
-//===----------------------------------------------------------------------===//
-
-MemoryBlock Memory::AllocateRWX(unsigned NumBytes,
- const MemoryBlock *NearBlock,
- std::string *ErrMsg) {
- if (NumBytes == 0) return MemoryBlock();
-
- static const long pageSize = Process::GetPageSize();
- unsigned NumPages = (NumBytes+pageSize-1)/pageSize;
-
- //FIXME: support NearBlock if ever needed on Win64.
-
- void *pa = VirtualAlloc(NULL, NumPages*pageSize, MEM_COMMIT,
- PAGE_EXECUTE_READWRITE);
- if (pa == NULL) {
- MakeErrMsg(ErrMsg, "Can't allocate RWX Memory: ");
- return MemoryBlock();
- }
-
- MemoryBlock result;
- result.Address = pa;
- result.Size = NumPages*pageSize;
- return result;
-}
-
-bool Memory::ReleaseRWX(MemoryBlock &M, std::string *ErrMsg) {
- if (M.Address == 0 || M.Size == 0) return false;
- if (!VirtualFree(M.Address, 0, MEM_RELEASE))
- return MakeErrMsg(ErrMsg, "Can't release RWX Memory: ");
- return false;
-}
-
-}
-
diff --git a/release_23/lib/System/Win32/Mutex.inc b/release_23/lib/System/Win32/Mutex.inc
deleted file mode 100644
index 7c1723be73fc..000000000000
--- a/release_23/lib/System/Win32/Mutex.inc
+++ /dev/null
@@ -1,58 +0,0 @@
-//===- llvm/System/Win32/Mutex.inc - Win32 Mutex Implementation -*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the Win32 specific (non-pthread) Mutex class.
-//
-//===----------------------------------------------------------------------===//
-
-//===----------------------------------------------------------------------===//
-//=== WARNING: Implementation here must contain only generic Win32 code that
-//=== is guaranteed to work on *all* Win32 variants.
-//===----------------------------------------------------------------------===//
-
-#include "Win32.h"
-#include "llvm/System/Mutex.h"
-
-namespace llvm {
-using namespace sys;
-
-Mutex::Mutex(bool /*recursive*/)
-{
- data_ = new CRITICAL_SECTION;
- InitializeCriticalSection((LPCRITICAL_SECTION)data_);
-}
-
-Mutex::~Mutex()
-{
- DeleteCriticalSection((LPCRITICAL_SECTION)data_);
- delete (LPCRITICAL_SECTION)data_;
- data_ = 0;
-}
-
-bool
-Mutex::acquire()
-{
- EnterCriticalSection((LPCRITICAL_SECTION)data_);
- return true;
-}
-
-bool
-Mutex::release()
-{
- LeaveCriticalSection((LPCRITICAL_SECTION)data_);
- return true;
-}
-
-bool
-Mutex::tryacquire()
-{
- return TryEnterCriticalSection((LPCRITICAL_SECTION)data_);
-}
-
-}
diff --git a/release_23/lib/System/Win32/Path.inc b/release_23/lib/System/Win32/Path.inc
deleted file mode 100644
index ce5fe2a3a5fc..000000000000
--- a/release_23/lib/System/Win32/Path.inc
+++ /dev/null
@@ -1,791 +0,0 @@
-//===- llvm/System/Linux/Path.cpp - Linux Path Implementation ---*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-// Modified by Henrik Bach to comply with at least MinGW.
-// Ported to Win32 by Jeff Cohen.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file provides the Win32 specific implementation of the Path class.
-//
-//===----------------------------------------------------------------------===//
-
-//===----------------------------------------------------------------------===//
-//=== WARNING: Implementation here must contain only generic Win32 code that
-//=== is guaranteed to work on *all* Win32 variants.
-//===----------------------------------------------------------------------===//
-
-#include "Win32.h"
-#include <malloc.h>
-
-// We need to undo a macro defined in Windows.h, otherwise we won't compile:
-#undef CopyFile
-#undef GetCurrentDirectory
-
-// Windows happily accepts either forward or backward slashes, though any path
-// returned by a Win32 API will have backward slashes. As LLVM code basically
-// assumes forward slashes are used, backward slashs are converted where they
-// can be introduced into a path.
-//
-// Another invariant is that a path ends with a slash if and only if the path
-// is a root directory. Any other use of a trailing slash is stripped. Unlike
-// in Unix, Windows has a rather complicated notion of a root path and this
-// invariant helps simply the code.
-
-static void FlipBackSlashes(std::string& s) {
- for (size_t i = 0; i < s.size(); i++)
- if (s[i] == '\\')
- s[i] = '/';
-}
-
-namespace llvm {
-namespace sys {
-const char PathSeparator = ';';
-
-bool
-Path::isValid() const {
- if (path.empty())
- return false;
-
- // If there is a colon, it must be the second character, preceded by a letter
- // and followed by something.
- size_t len = path.size();
- size_t pos = path.rfind(':',len);
- size_t rootslash = 0;
- if (pos != std::string::npos) {
- if (pos != 1 || !isalpha(path[0]) || len < 3)
- return false;
- rootslash = 2;
- }
-
- // Look for a UNC path, and if found adjust our notion of the root slash.
- if (len > 3 && path[0] == '/' && path[1] == '/') {
- rootslash = path.find('/', 2);
- if (rootslash == std::string::npos)
- rootslash = 0;
- }
-
- // Check for illegal characters.
- if (path.find_first_of("\\<>\"|\001\002\003\004\005\006\007\010\011\012"
- "\013\014\015\016\017\020\021\022\023\024\025\026"
- "\027\030\031\032\033\034\035\036\037")
- != std::string::npos)
- return false;
-
- // Remove trailing slash, unless it's a root slash.
- if (len > rootslash+1 && path[len-1] == '/')
- path.erase(--len);
-
- // Check each component for legality.
- for (pos = 0; pos < len; ++pos) {
- // A component may not end in a space.
- if (path[pos] == ' ') {
- if (path[pos+1] == '/' || path[pos+1] == '\0')
- return false;
- }
-
- // A component may not end in a period.
- if (path[pos] == '.') {
- if (path[pos+1] == '/' || path[pos+1] == '\0') {
- // Unless it is the pseudo-directory "."...
- if (pos == 0 || path[pos-1] == '/' || path[pos-1] == ':')
- return true;
- // or "..".
- if (pos > 0 && path[pos-1] == '.') {
- if (pos == 1 || path[pos-2] == '/' || path[pos-2] == ':')
- return true;
- }
- return false;
- }
- }
- }
-
- return true;
-}
-
-bool
-Path::isAbsolute() const {
- switch (path.length()) {
- case 0:
- return false;
- case 1:
- case 2:
- return path[0] == '/';
- default:
- return path[0] == '/' || (path[1] == ':' && path[2] == '/');
- }
-}
-
-static Path *TempDirectory = NULL;
-
-Path
-Path::GetTemporaryDirectory(std::string* ErrMsg) {
- if (TempDirectory)
- return *TempDirectory;
-
- char pathname[MAX_PATH];
- if (!GetTempPath(MAX_PATH, pathname)) {
- if (ErrMsg)
- *ErrMsg = "Can't determine temporary directory";
- return Path();
- }
-
- Path result;
- result.set(pathname);
-
- // Append a subdirectory passed on our process id so multiple LLVMs don't
- // step on each other's toes.
-#ifdef __MINGW32__
- // Mingw's Win32 header files are broken.
- sprintf(pathname, "LLVM_%u", unsigned(GetCurrentProcessId()));
-#else
- sprintf(pathname, "LLVM_%u", GetCurrentProcessId());
-#endif
- result.appendComponent(pathname);
-
- // If there's a directory left over from a previous LLVM execution that
- // happened to have the same process id, get rid of it.
- result.eraseFromDisk(true);
-
- // And finally (re-)create the empty directory.
- result.createDirectoryOnDisk(false);
- TempDirectory = new Path(result);
- return *TempDirectory;
-}
-
-// FIXME: the following set of functions don't map to Windows very well.
-Path
-Path::GetRootDirectory() {
- Path result;
- result.set("C:/");
- return result;
-}
-
-void
-Path::GetSystemLibraryPaths(std::vector<sys::Path>& Paths) {
- Paths.push_back(sys::Path("C:/WINDOWS/SYSTEM32"));
- Paths.push_back(sys::Path("C:/WINDOWS"));
-}
-
-void
-Path::GetBitcodeLibraryPaths(std::vector<sys::Path>& Paths) {
- char * env_var = getenv("LLVM_LIB_SEARCH_PATH");
- if (env_var != 0) {
- getPathList(env_var,Paths);
- }
-#ifdef LLVM_LIBDIR
- {
- Path tmpPath;
- if (tmpPath.set(LLVM_LIBDIR))
- if (tmpPath.canRead())
- Paths.push_back(tmpPath);
- }
-#endif
- GetSystemLibraryPaths(Paths);
-}
-
-Path
-Path::GetLLVMDefaultConfigDir() {
- // TODO: this isn't going to fly on Windows
- return Path("/etc/llvm");
-}
-
-Path
-Path::GetUserHomeDirectory() {
- // TODO: Typical Windows setup doesn't define HOME.
- const char* home = getenv("HOME");
- if (home) {
- Path result;
- if (result.set(home))
- return result;
- }
- return GetRootDirectory();
-}
-
-Path
-Path::GetCurrentDirectory() {
- char pathname[MAX_PATH];
- ::GetCurrentDirectoryA(MAX_PATH,pathname);
- return Path(pathname);
-}
-
-/// GetMainExecutable - Return the path to the main executable, given the
-/// value of argv[0] from program startup.
-Path Path::GetMainExecutable(const char *argv0, void *MainAddr) {
- return Path();
-}
-
-
-// FIXME: the above set of functions don't map to Windows very well.
-
-
-bool
-Path::isRootDirectory() const {
- size_t len = path.size();
- return len > 0 && path[len-1] == '/';
-}
-
-std::string Path::getDirname() const {
- return getDirnameCharSep(path, '\\');
-}
-
-std::string
-Path::getBasename() const {
- // Find the last slash
- size_t slash = path.rfind('/');
- if (slash == std::string::npos)
- slash = 0;
- else
- slash++;
-
- size_t dot = path.rfind('.');
- if (dot == std::string::npos || dot < slash)
- return path.substr(slash);
- else
- return path.substr(slash, dot - slash);
-}
-
-bool
-Path::exists() const {
- DWORD attr = GetFileAttributes(path.c_str());
- return attr != INVALID_FILE_ATTRIBUTES;
-}
-
-bool
-Path::isDirectory() const {
- DWORD attr = GetFileAttributes(path.c_str());
- return (attr != INVALID_FILE_ATTRIBUTES) &&
- (attr & FILE_ATTRIBUTE_DIRECTORY);
-}
-
-bool
-Path::canRead() const {
- // FIXME: take security attributes into account.
- DWORD attr = GetFileAttributes(path.c_str());
- return attr != INVALID_FILE_ATTRIBUTES;
-}
-
-bool
-Path::canWrite() const {
- // FIXME: take security attributes into account.
- DWORD attr = GetFileAttributes(path.c_str());
- return (attr != INVALID_FILE_ATTRIBUTES) && !(attr & FILE_ATTRIBUTE_READONLY);
-}
-
-bool
-Path::canExecute() const {
- // FIXME: take security attributes into account.
- DWORD attr = GetFileAttributes(path.c_str());
- return attr != INVALID_FILE_ATTRIBUTES;
-}
-
-std::string
-Path::getLast() const {
- // Find the last slash
- size_t pos = path.rfind('/');
-
- // Handle the corner cases
- if (pos == std::string::npos)
- return path;
-
- // If the last character is a slash, we have a root directory
- if (pos == path.length()-1)
- return path;
-
- // Return everything after the last slash
- return path.substr(pos+1);
-}
-
-const FileStatus *
-PathWithStatus::getFileStatus(bool update, std::string *ErrStr) const {
- if (!fsIsValid || update) {
- WIN32_FILE_ATTRIBUTE_DATA fi;
- if (!GetFileAttributesEx(path.c_str(), GetFileExInfoStandard, &fi)) {
- MakeErrMsg(ErrStr, "getStatusInfo():" + std::string(path) +
- ": Can't get status: ");
- return 0;
- }
-
- status.fileSize = fi.nFileSizeHigh;
- status.fileSize <<= sizeof(fi.nFileSizeHigh)*8;
- status.fileSize += fi.nFileSizeLow;
-
- status.mode = fi.dwFileAttributes & FILE_ATTRIBUTE_READONLY ? 0555 : 0777;
- status.user = 9999; // Not applicable to Windows, so...
- status.group = 9999; // Not applicable to Windows, so...
-
- // FIXME: this is only unique if the file is accessed by the same file path.
- // How do we do this for C:\dir\file and ..\dir\file ? Unix has inode
- // numbers, but the concept doesn't exist in Windows.
- status.uniqueID = 0;
- for (unsigned i = 0; i < path.length(); ++i)
- status.uniqueID += path[i];
-
- __int64 ft = *reinterpret_cast<__int64*>(&fi.ftLastWriteTime);
- status.modTime.fromWin32Time(ft);
-
- status.isDir = fi.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY;
- fsIsValid = true;
- }
- return &status;
-}
-
-bool Path::makeReadableOnDisk(std::string* ErrMsg) {
- // All files are readable on Windows (ignoring security attributes).
- return false;
-}
-
-bool Path::makeWriteableOnDisk(std::string* ErrMsg) {
- DWORD attr = GetFileAttributes(path.c_str());
-
- // If it doesn't exist, we're done.
- if (attr == INVALID_FILE_ATTRIBUTES)
- return false;
-
- if (attr & FILE_ATTRIBUTE_READONLY) {
- if (!SetFileAttributes(path.c_str(), attr & ~FILE_ATTRIBUTE_READONLY)) {
- MakeErrMsg(ErrMsg, std::string(path) + ": Can't make file writable: ");
- return true;
- }
- }
- return false;
-}
-
-bool Path::makeExecutableOnDisk(std::string* ErrMsg) {
- // All files are executable on Windows (ignoring security attributes).
- return false;
-}
-
-bool
-Path::getDirectoryContents(std::set<Path>& result, std::string* ErrMsg) const {
- WIN32_FILE_ATTRIBUTE_DATA fi;
- if (!GetFileAttributesEx(path.c_str(), GetFileExInfoStandard, &fi)) {
- MakeErrMsg(ErrMsg, path + ": can't get status of file");
- return true;
- }
-
- if (!(fi.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) {
- if (ErrMsg)
- *ErrMsg = path + ": not a directory";
- return true;
- }
-
- result.clear();
- WIN32_FIND_DATA fd;
- std::string searchpath = path;
- if (path.size() == 0 || searchpath[path.size()-1] == '/')
- searchpath += "*";
- else
- searchpath += "/*";
-
- HANDLE h = FindFirstFile(searchpath.c_str(), &fd);
- if (h == INVALID_HANDLE_VALUE) {
- if (GetLastError() == ERROR_FILE_NOT_FOUND)
- return true; // not really an error, now is it?
- MakeErrMsg(ErrMsg, path + ": Can't read directory: ");
- return true;
- }
-
- do {
- if (fd.cFileName[0] == '.')
- continue;
- Path aPath(path);
- aPath.appendComponent(&fd.cFileName[0]);
- result.insert(aPath);
- } while (FindNextFile(h, &fd));
-
- DWORD err = GetLastError();
- FindClose(h);
- if (err != ERROR_NO_MORE_FILES) {
- SetLastError(err);
- MakeErrMsg(ErrMsg, path + ": Can't read directory: ");
- return true;
- }
- return false;
-}
-
-bool
-Path::set(const std::string& a_path) {
- if (a_path.empty())
- return false;
- std::string save(path);
- path = a_path;
- FlipBackSlashes(path);
- if (!isValid()) {
- path = save;
- return false;
- }
- return true;
-}
-
-bool
-Path::appendComponent(const std::string& name) {
- if (name.empty())
- return false;
- std::string save(path);
- if (!path.empty()) {
- size_t last = path.size() - 1;
- if (path[last] != '/')
- path += '/';
- }
- path += name;
- if (!isValid()) {
- path = save;
- return false;
- }
- return true;
-}
-
-bool
-Path::eraseComponent() {
- size_t slashpos = path.rfind('/',path.size());
- if (slashpos == path.size() - 1 || slashpos == std::string::npos)
- return false;
- std::string save(path);
- path.erase(slashpos);
- if (!isValid()) {
- path = save;
- return false;
- }
- return true;
-}
-
-bool
-Path::appendSuffix(const std::string& suffix) {
- std::string save(path);
- path.append(".");
- path.append(suffix);
- if (!isValid()) {
- path = save;
- return false;
- }
- return true;
-}
-
-bool
-Path::eraseSuffix() {
- size_t dotpos = path.rfind('.',path.size());
- size_t slashpos = path.rfind('/',path.size());
- if (dotpos != std::string::npos) {
- if (slashpos == std::string::npos || dotpos > slashpos+1) {
- std::string save(path);
- path.erase(dotpos, path.size()-dotpos);
- if (!isValid()) {
- path = save;
- return false;
- }
- return true;
- }
- }
- return false;
-}
-
-inline bool PathMsg(std::string* ErrMsg, const char* pathname, const char*msg) {
- if (ErrMsg)
- *ErrMsg = std::string(pathname) + ": " + std::string(msg);
- return true;
-}
-
-bool
-Path::createDirectoryOnDisk(bool create_parents, std::string* ErrMsg) {
- // Get a writeable copy of the path name
- size_t len = path.length();
- char *pathname = reinterpret_cast<char *>(_alloca(len+2));
- path.copy(pathname, len);
- pathname[len] = 0;
-
- // Make sure it ends with a slash.
- if (len == 0 || pathname[len - 1] != '/') {
- pathname[len] = '/';
- pathname[++len] = 0;
- }
-
- // Determine starting point for initial / search.
- char *next = pathname;
- if (pathname[0] == '/' && pathname[1] == '/') {
- // Skip host name.
- next = strchr(pathname+2, '/');
- if (next == NULL)
- return PathMsg(ErrMsg, pathname, "badly formed remote directory");
-
- // Skip share name.
- next = strchr(next+1, '/');
- if (next == NULL)
- return PathMsg(ErrMsg, pathname,"badly formed remote directory");
-
- next++;
- if (*next == 0)
- return PathMsg(ErrMsg, pathname, "badly formed remote directory");
-
- } else {
- if (pathname[1] == ':')
- next += 2; // skip drive letter
- if (*next == '/')
- next++; // skip root directory
- }
-
- // If we're supposed to create intermediate directories
- if (create_parents) {
- // Loop through the directory components until we're done
- while (*next) {
- next = strchr(next, '/');
- *next = 0;
- if (!CreateDirectory(pathname, NULL))
- return MakeErrMsg(ErrMsg,
- std::string(pathname) + ": Can't create directory: ");
- *next++ = '/';
- }
- } else {
- // Drop trailing slash.
- pathname[len-1] = 0;
- if (!CreateDirectory(pathname, NULL)) {
- return MakeErrMsg(ErrMsg, std::string(pathname) + ": Can't create directory: ");
- }
- }
- return false;
-}
-
-bool
-Path::createFileOnDisk(std::string* ErrMsg) {
- // Create the file
- HANDLE h = CreateFile(path.c_str(), GENERIC_WRITE, 0, NULL, CREATE_NEW,
- FILE_ATTRIBUTE_NORMAL, NULL);
- if (h == INVALID_HANDLE_VALUE)
- return MakeErrMsg(ErrMsg, path + ": Can't create file: ");
-
- CloseHandle(h);
- return false;
-}
-
-bool
-Path::eraseFromDisk(bool remove_contents, std::string *ErrStr) const {
- WIN32_FILE_ATTRIBUTE_DATA fi;
- if (!GetFileAttributesEx(path.c_str(), GetFileExInfoStandard, &fi))
- return true;
-
- if (fi.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
- // If it doesn't exist, we're done.
- if (!exists())
- return false;
-
- char *pathname = reinterpret_cast<char *>(_alloca(path.length()+3));
- int lastchar = path.length() - 1 ;
- path.copy(pathname, lastchar+1);
-
- // Make path end with '/*'.
- if (pathname[lastchar] != '/')
- pathname[++lastchar] = '/';
- pathname[lastchar+1] = '*';
- pathname[lastchar+2] = 0;
-
- if (remove_contents) {
- WIN32_FIND_DATA fd;
- HANDLE h = FindFirstFile(pathname, &fd);
-
- // It's a bad idea to alter the contents of a directory while enumerating
- // its contents. So build a list of its contents first, then destroy them.
-
- if (h != INVALID_HANDLE_VALUE) {
- std::vector<Path> list;
-
- do {
- if (strcmp(fd.cFileName, ".") == 0)
- continue;
- if (strcmp(fd.cFileName, "..") == 0)
- continue;
-
- Path aPath(path);
- aPath.appendComponent(&fd.cFileName[0]);
- list.push_back(aPath);
- } while (FindNextFile(h, &fd));
-
- DWORD err = GetLastError();
- FindClose(h);
- if (err != ERROR_NO_MORE_FILES) {
- SetLastError(err);
- return MakeErrMsg(ErrStr, path + ": Can't read directory: ");
- }
-
- for (std::vector<Path>::iterator I = list.begin(); I != list.end();
- ++I) {
- Path &aPath = *I;
- aPath.eraseFromDisk(true);
- }
- } else {
- if (GetLastError() != ERROR_FILE_NOT_FOUND)
- return MakeErrMsg(ErrStr, path + ": Can't read directory: ");
- }
- }
-
- pathname[lastchar] = 0;
- if (!RemoveDirectory(pathname))
- return MakeErrMsg(ErrStr,
- std::string(pathname) + ": Can't destroy directory: ");
- return false;
- } else {
- // Read-only files cannot be deleted on Windows. Must remove the read-only
- // attribute first.
- if (fi.dwFileAttributes & FILE_ATTRIBUTE_READONLY) {
- if (!SetFileAttributes(path.c_str(),
- fi.dwFileAttributes & ~FILE_ATTRIBUTE_READONLY))
- return MakeErrMsg(ErrStr, path + ": Can't destroy file: ");
- }
-
- if (!DeleteFile(path.c_str()))
- return MakeErrMsg(ErrStr, path + ": Can't destroy file: ");
- return false;
- }
-}
-
-bool Path::getMagicNumber(std::string& Magic, unsigned len) const {
- assert(len < 1024 && "Request for magic string too long");
- char* buf = (char*) alloca(1 + len);
-
- HANDLE h = CreateFile(path.c_str(),
- GENERIC_READ,
- FILE_SHARE_READ,
- NULL,
- OPEN_EXISTING,
- FILE_ATTRIBUTE_NORMAL,
- NULL);
- if (h == INVALID_HANDLE_VALUE)
- return false;
-
- DWORD nRead = 0;
- BOOL ret = ReadFile(h, buf, len, &nRead, NULL);
- CloseHandle(h);
-
- if (!ret || nRead != len)
- return false;
-
- buf[len] = '\0';
- Magic = buf;
- return true;
-}
-
-bool
-Path::renamePathOnDisk(const Path& newName, std::string* ErrMsg) {
- if (!MoveFileEx(path.c_str(), newName.c_str(), MOVEFILE_REPLACE_EXISTING))
- return MakeErrMsg(ErrMsg, "Can't move '" + path + "' to '" + newName.path
- + "': ");
- return false;
-}
-
-bool
-Path::setStatusInfoOnDisk(const FileStatus &si, std::string *ErrMsg) const {
- // FIXME: should work on directories also.
- if (!si.isFile) {
- return true;
- }
-
- HANDLE h = CreateFile(path.c_str(),
- FILE_READ_ATTRIBUTES | FILE_WRITE_ATTRIBUTES,
- FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
- NULL,
- OPEN_EXISTING,
- FILE_ATTRIBUTE_NORMAL,
- NULL);
- if (h == INVALID_HANDLE_VALUE)
- return true;
-
- BY_HANDLE_FILE_INFORMATION bhfi;
- if (!GetFileInformationByHandle(h, &bhfi)) {
- DWORD err = GetLastError();
- CloseHandle(h);
- SetLastError(err);
- return MakeErrMsg(ErrMsg, path + ": GetFileInformationByHandle: ");
- }
-
- FILETIME ft;
- (uint64_t&)ft = si.modTime.toWin32Time();
- BOOL ret = SetFileTime(h, NULL, &ft, &ft);
- DWORD err = GetLastError();
- CloseHandle(h);
- if (!ret) {
- SetLastError(err);
- return MakeErrMsg(ErrMsg, path + ": SetFileTime: ");
- }
-
- // Best we can do with Unix permission bits is to interpret the owner
- // writable bit.
- if (si.mode & 0200) {
- if (bhfi.dwFileAttributes & FILE_ATTRIBUTE_READONLY) {
- if (!SetFileAttributes(path.c_str(),
- bhfi.dwFileAttributes & ~FILE_ATTRIBUTE_READONLY))
- return MakeErrMsg(ErrMsg, path + ": SetFileAttributes: ");
- }
- } else {
- if (!(bhfi.dwFileAttributes & FILE_ATTRIBUTE_READONLY)) {
- if (!SetFileAttributes(path.c_str(),
- bhfi.dwFileAttributes | FILE_ATTRIBUTE_READONLY))
- return MakeErrMsg(ErrMsg, path + ": SetFileAttributes: ");
- }
- }
-
- return false;
-}
-
-bool
-CopyFile(const sys::Path &Dest, const sys::Path &Src, std::string* ErrMsg) {
- // Can't use CopyFile macro defined in Windows.h because it would mess up the
- // above line. We use the expansion it would have in a non-UNICODE build.
- if (!::CopyFileA(Src.c_str(), Dest.c_str(), false))
- return MakeErrMsg(ErrMsg, "Can't copy '" + Src.toString() +
- "' to '" + Dest.toString() + "': ");
- return false;
-}
-
-bool
-Path::makeUnique(bool reuse_current, std::string* ErrMsg) {
- if (reuse_current && !exists())
- return false; // File doesn't exist already, just use it!
-
- // Reserve space for -XXXXXX at the end.
- char *FNBuffer = (char*) alloca(path.size()+8);
- unsigned offset = path.size();
- path.copy(FNBuffer, offset);
-
- // Find a numeric suffix that isn't used by an existing file. Assume there
- // won't be more than 1 million files with the same prefix. Probably a safe
- // bet.
- static unsigned FCounter = 0;
- do {
- sprintf(FNBuffer+offset, "-%06u", FCounter);
- if (++FCounter > 999999)
- FCounter = 0;
- path = FNBuffer;
- } while (exists());
- return false;
-}
-
-bool
-Path::createTemporaryFileOnDisk(bool reuse_current, std::string* ErrMsg) {
- // Make this into a unique file name
- makeUnique(reuse_current, ErrMsg);
-
- // Now go and create it
- HANDLE h = CreateFile(path.c_str(), GENERIC_WRITE, 0, NULL, CREATE_NEW,
- FILE_ATTRIBUTE_NORMAL, NULL);
- if (h == INVALID_HANDLE_VALUE)
- return MakeErrMsg(ErrMsg, path + ": can't create file");
-
- CloseHandle(h);
- return false;
-}
-
-/// MapInFilePages - Not yet implemented on win32.
-const char *Path::MapInFilePages(int FD, uint64_t FileSize) {
- return 0;
-}
-
-/// MapInFilePages - Not yet implemented on win32.
-void Path::UnMapFilePages(const char *Base, uint64_t FileSize) {
- assert(0 && "NOT IMPLEMENTED");
-}
-
-}
-}
diff --git a/release_23/lib/System/Win32/Process.inc b/release_23/lib/System/Win32/Process.inc
deleted file mode 100644
index 157483a07ca8..000000000000
--- a/release_23/lib/System/Win32/Process.inc
+++ /dev/null
@@ -1,134 +0,0 @@
-//===- Win32/Process.cpp - Win32 Process Implementation ------- -*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file provides the Win32 specific implementation of the Process class.
-//
-//===----------------------------------------------------------------------===//
-
-#include "Win32.h"
-#include <psapi.h>
-#include <malloc.h>
-#include <io.h>
-
-#ifdef __MINGW32__
- #if (HAVE_LIBPSAPI != 1)
- #error "libpsapi.a should be present"
- #endif
-#else
- #pragma comment(lib, "psapi.lib")
-#endif
-
-//===----------------------------------------------------------------------===//
-//=== WARNING: Implementation here must contain only Win32 specific code
-//=== and must not be UNIX code
-//===----------------------------------------------------------------------===//
-
-#ifdef __MINGW32__
-// This ban should be lifted when MinGW 1.0+ has defined this value.
-# define _HEAPOK (-2)
-#endif
-
-namespace llvm {
-using namespace sys;
-
-// This function retrieves the page size using GetSystemInfo and is present
-// solely so it can be called once in Process::GetPageSize to initialize the
-// static variable PageSize.
-inline unsigned GetPageSizeOnce() {
- // NOTE: A 32-bit application running under WOW64 is supposed to use
- // GetNativeSystemInfo. However, this interface is not present prior
- // to Windows XP so to use it requires dynamic linking. It is not clear
- // how this affects the reported page size, if at all. One could argue
- // that LLVM ought to run as 64-bits on a 64-bit system, anyway.
- SYSTEM_INFO info;
- GetSystemInfo(&info);
- return static_cast<unsigned>(info.dwPageSize);
-}
-
-unsigned
-Process::GetPageSize() {
- static const unsigned PageSize = GetPageSizeOnce();
- return PageSize;
-}
-
-size_t
-Process::GetMallocUsage()
-{
- _HEAPINFO hinfo;
- hinfo._pentry = NULL;
-
- size_t size = 0;
-
- while (_heapwalk(&hinfo) == _HEAPOK)
- size += hinfo._size;
-
- return size;
-}
-
-size_t
-Process::GetTotalMemoryUsage()
-{
- PROCESS_MEMORY_COUNTERS pmc;
- GetProcessMemoryInfo(GetCurrentProcess(), &pmc, sizeof(pmc));
- return pmc.PagefileUsage;
-}
-
-void
-Process::GetTimeUsage(
- TimeValue& elapsed, TimeValue& user_time, TimeValue& sys_time)
-{
- elapsed = TimeValue::now();
-
- uint64_t ProcCreate, ProcExit, KernelTime, UserTime;
- GetProcessTimes(GetCurrentProcess(), (FILETIME*)&ProcCreate,
- (FILETIME*)&ProcExit, (FILETIME*)&KernelTime,
- (FILETIME*)&UserTime);
-
- // FILETIME's are # of 100 nanosecond ticks (1/10th of a microsecond)
- user_time.seconds( UserTime / 10000000 );
- user_time.nanoseconds( unsigned(UserTime % 10000000) * 100 );
- sys_time.seconds( KernelTime / 10000000 );
- sys_time.nanoseconds( unsigned(KernelTime % 10000000) * 100 );
-}
-
-int Process::GetCurrentUserId()
-{
- return 65536;
-}
-
-int Process::GetCurrentGroupId()
-{
- return 65536;
-}
-
-// Some LLVM programs such as bugpoint produce core files as a normal part of
-// their operation. To prevent the disk from filling up, this configuration item
-// does what's necessary to prevent their generation.
-void Process::PreventCoreFiles() {
- // Windows doesn't do core files, but it does do modal pop-up message
- // boxes. As this method is used by bugpoint, preventing these pop-ups
- // is the moral equivalent of suppressing core files.
- SetErrorMode(SEM_FAILCRITICALERRORS |
- SEM_NOGPFAULTERRORBOX |
- SEM_NOOPENFILEERRORBOX);
-}
-
-bool Process::StandardInIsUserInput() {
- return GetFileType((HANDLE)_get_osfhandle(0)) == FILE_TYPE_CHAR;
-}
-
-bool Process::StandardOutIsDisplayed() {
- return GetFileType((HANDLE)_get_osfhandle(1)) == FILE_TYPE_CHAR;
-}
-
-bool Process::StandardErrIsDisplayed() {
- return GetFileType((HANDLE)_get_osfhandle(2)) == FILE_TYPE_CHAR;
-}
-
-}
diff --git a/release_23/lib/System/Win32/Program.inc b/release_23/lib/System/Win32/Program.inc
deleted file mode 100644
index cb002132bfef..000000000000
--- a/release_23/lib/System/Win32/Program.inc
+++ /dev/null
@@ -1,284 +0,0 @@
-//===- Win32/Program.cpp - Win32 Program Implementation ------- -*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file provides the Win32 specific implementation of the Program class.
-//
-//===----------------------------------------------------------------------===//
-
-#include "Win32.h"
-#include <cstdio>
-#include <malloc.h>
-#include <io.h>
-#include <fcntl.h>
-
-//===----------------------------------------------------------------------===//
-//=== WARNING: Implementation here must contain only Win32 specific code
-//=== and must not be UNIX code
-//===----------------------------------------------------------------------===//
-
-namespace llvm {
-using namespace sys;
-
-// This function just uses the PATH environment variable to find the program.
-Path
-Program::FindProgramByName(const std::string& progName) {
-
- // Check some degenerate cases
- if (progName.length() == 0) // no program
- return Path();
- Path temp;
- if (!temp.set(progName)) // invalid name
- return Path();
- if (temp.canExecute()) // already executable as is
- return temp;
-
- // At this point, the file name is valid and its not executable.
- // Let Windows search for it.
- char buffer[MAX_PATH];
- char *dummy = NULL;
- DWORD len = SearchPath(NULL, progName.c_str(), ".exe", MAX_PATH,
- buffer, &dummy);
-
- // See if it wasn't found.
- if (len == 0)
- return Path();
-
- // See if we got the entire path.
- if (len < MAX_PATH)
- return Path(buffer);
-
- // Buffer was too small; grow and retry.
- while (true) {
- char *b = reinterpret_cast<char *>(_alloca(len+1));
- DWORD len2 = SearchPath(NULL, progName.c_str(), ".exe", len+1, b, &dummy);
-
- // It is unlikely the search failed, but it's always possible some file
- // was added or removed since the last search, so be paranoid...
- if (len2 == 0)
- return Path();
- else if (len2 <= len)
- return Path(b);
-
- len = len2;
- }
-}
-
-static HANDLE RedirectIO(const Path *path, int fd, std::string* ErrMsg) {
- HANDLE h;
- if (path == 0) {
- DuplicateHandle(GetCurrentProcess(), (HANDLE)_get_osfhandle(fd),
- GetCurrentProcess(), &h,
- 0, TRUE, DUPLICATE_SAME_ACCESS);
- return h;
- }
-
- const char *fname = path->toString().c_str();
- if (*fname == 0)
- fname = "NUL";
-
- SECURITY_ATTRIBUTES sa;
- sa.nLength = sizeof(sa);
- sa.lpSecurityDescriptor = 0;
- sa.bInheritHandle = TRUE;
-
- h = CreateFile(fname, fd ? GENERIC_WRITE : GENERIC_READ, FILE_SHARE_READ,
- &sa, fd == 0 ? OPEN_EXISTING : CREATE_ALWAYS,
- FILE_ATTRIBUTE_NORMAL, NULL);
- if (h == INVALID_HANDLE_VALUE) {
- MakeErrMsg(ErrMsg, std::string(fname) + ": Can't open file for " +
- (fd ? "input: " : "output: "));
- }
-
- return h;
-}
-
-#ifdef __MINGW32__
- // Due to unknown reason, mingw32's w32api doesn't have this declaration.
- extern "C"
- BOOL WINAPI SetInformationJobObject(HANDLE hJob,
- JOBOBJECTINFOCLASS JobObjectInfoClass,
- LPVOID lpJobObjectInfo,
- DWORD cbJobObjectInfoLength);
-#endif
-
-int
-Program::ExecuteAndWait(const Path& path,
- const char** args,
- const char** envp,
- const Path** redirects,
- unsigned secondsToWait,
- unsigned memoryLimit,
- std::string* ErrMsg) {
- if (!path.canExecute()) {
- if (ErrMsg)
- *ErrMsg = "program not executable";
- return -1;
- }
-
- // Windows wants a command line, not an array of args, to pass to the new
- // process. We have to concatenate them all, while quoting the args that
- // have embedded spaces.
-
- // First, determine the length of the command line.
- unsigned len = 0;
- for (unsigned i = 0; args[i]; i++) {
- len += strlen(args[i]) + 1;
- if (strchr(args[i], ' '))
- len += 2;
- }
-
- // Now build the command line.
- char *command = reinterpret_cast<char *>(_alloca(len+1));
- char *p = command;
-
- for (unsigned i = 0; args[i]; i++) {
- const char *arg = args[i];
- size_t len = strlen(arg);
- bool needsQuoting = strchr(arg, ' ') != 0;
- if (needsQuoting)
- *p++ = '"';
- memcpy(p, arg, len);
- p += len;
- if (needsQuoting)
- *p++ = '"';
- *p++ = ' ';
- }
-
- *p = 0;
-
- // Create a child process.
- STARTUPINFO si;
- memset(&si, 0, sizeof(si));
- si.cb = sizeof(si);
- si.hStdInput = INVALID_HANDLE_VALUE;
- si.hStdOutput = INVALID_HANDLE_VALUE;
- si.hStdError = INVALID_HANDLE_VALUE;
-
- if (redirects) {
- si.dwFlags = STARTF_USESTDHANDLES;
-
- si.hStdInput = RedirectIO(redirects[0], 0, ErrMsg);
- if (si.hStdInput == INVALID_HANDLE_VALUE) {
- MakeErrMsg(ErrMsg, "can't redirect stdin");
- return -1;
- }
- si.hStdOutput = RedirectIO(redirects[1], 1, ErrMsg);
- if (si.hStdOutput == INVALID_HANDLE_VALUE) {
- CloseHandle(si.hStdInput);
- MakeErrMsg(ErrMsg, "can't redirect stdout");
- return -1;
- }
- if (redirects[1] && redirects[2] && *(redirects[1]) != *(redirects[2])) {
- si.hStdError = RedirectIO(redirects[2], 2, ErrMsg);
- if (si.hStdError == INVALID_HANDLE_VALUE) {
- CloseHandle(si.hStdInput);
- CloseHandle(si.hStdOutput);
- MakeErrMsg(ErrMsg, "can't redirect stderr");
- return -1;
- }
- } else {
- DuplicateHandle(GetCurrentProcess(), si.hStdOutput,
- GetCurrentProcess(), &si.hStdError,
- 0, TRUE, DUPLICATE_SAME_ACCESS);
- }
- }
-
- PROCESS_INFORMATION pi;
- memset(&pi, 0, sizeof(pi));
-
- fflush(stdout);
- fflush(stderr);
- BOOL rc = CreateProcess(path.c_str(), command, NULL, NULL, FALSE, 0,
- envp, NULL, &si, &pi);
- DWORD err = GetLastError();
-
- // Regardless of whether the process got created or not, we are done with
- // the handles we created for it to inherit.
- CloseHandle(si.hStdInput);
- CloseHandle(si.hStdOutput);
- CloseHandle(si.hStdError);
-
- // Now return an error if the process didn't get created.
- if (!rc)
- {
- SetLastError(err);
- MakeErrMsg(ErrMsg, std::string("Couldn't execute program '") +
- path.toString() + "'");
- return -1;
- }
-
- // Make sure these get closed no matter what.
- AutoHandle hProcess(pi.hProcess);
- AutoHandle hThread(pi.hThread);
-
- // Assign the process to a job if a memory limit is defined.
- AutoHandle hJob(0);
- if (memoryLimit != 0) {
- hJob = CreateJobObject(0, 0);
- bool success = false;
- if (hJob != 0) {
- JOBOBJECT_EXTENDED_LIMIT_INFORMATION jeli;
- memset(&jeli, 0, sizeof(jeli));
- jeli.BasicLimitInformation.LimitFlags = JOB_OBJECT_LIMIT_PROCESS_MEMORY;
- jeli.ProcessMemoryLimit = uintptr_t(memoryLimit) * 1048576;
- if (SetInformationJobObject(hJob, JobObjectExtendedLimitInformation,
- &jeli, sizeof(jeli))) {
- if (AssignProcessToJobObject(hJob, pi.hProcess))
- success = true;
- }
- }
- if (!success) {
- SetLastError(GetLastError());
- MakeErrMsg(ErrMsg, std::string("Unable to set memory limit"));
- TerminateProcess(pi.hProcess, 1);
- WaitForSingleObject(pi.hProcess, INFINITE);
- return -1;
- }
- }
-
- // Wait for it to terminate.
- DWORD millisecondsToWait = INFINITE;
- if (secondsToWait > 0)
- millisecondsToWait = secondsToWait * 1000;
-
- if (WaitForSingleObject(pi.hProcess, millisecondsToWait) == WAIT_TIMEOUT) {
- if (!TerminateProcess(pi.hProcess, 1)) {
- MakeErrMsg(ErrMsg, std::string("Failed to terminate timed-out program '")
- + path.toString() + "'");
- return -1;
- }
- WaitForSingleObject(pi.hProcess, INFINITE);
- }
-
- // Get its exit status.
- DWORD status;
- rc = GetExitCodeProcess(pi.hProcess, &status);
- err = GetLastError();
-
- if (!rc) {
- SetLastError(err);
- MakeErrMsg(ErrMsg, std::string("Failed getting status for program '") +
- path.toString() + "'");
- return -1;
- }
-
- return status;
-}
-
-bool Program::ChangeStdinToBinary(){
- int result = _setmode( _fileno(stdin), _O_BINARY );
- return result == -1;
-}
-
-bool Program::ChangeStdoutToBinary(){
- int result = _setmode( _fileno(stdout), _O_BINARY );
- return result == -1;
-}
-
-}
diff --git a/release_23/lib/System/Win32/Signals.inc b/release_23/lib/System/Win32/Signals.inc
deleted file mode 100644
index 02dab86f22d8..000000000000
--- a/release_23/lib/System/Win32/Signals.inc
+++ /dev/null
@@ -1,294 +0,0 @@
-//===- Win32/Signals.cpp - Win32 Signals Implementation ---------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file provides the Win32 specific implementation of the Signals class.
-//
-//===----------------------------------------------------------------------===//
-
-#include "Win32.h"
-#include <stdio.h>
-#include <vector>
-
-#ifdef __MINGW32__
- #include <imagehlp.h>
-#else
- #include <dbghelp.h>
-#endif
-#include <psapi.h>
-
-#ifdef __MINGW32__
- #if ((HAVE_LIBIMAGEHLP != 1) || (HAVE_LIBPSAPI != 1))
- #error "libimagehlp.a & libpsapi.a should be present"
- #endif
-#else
- #pragma comment(lib, "psapi.lib")
- #pragma comment(lib, "dbghelp.lib")
-#endif
-
-// Forward declare.
-static LONG WINAPI LLVMUnhandledExceptionFilter(LPEXCEPTION_POINTERS ep);
-static BOOL WINAPI LLVMConsoleCtrlHandler(DWORD dwCtrlType);
-
-// InterruptFunction - The function to call if ctrl-c is pressed.
-static void (*InterruptFunction)() = 0;
-
-static std::vector<llvm::sys::Path> *FilesToRemove = NULL;
-static std::vector<llvm::sys::Path> *DirectoriesToRemove = NULL;
-static bool RegisteredUnhandledExceptionFilter = false;
-static bool CleanupExecuted = false;
-static PTOP_LEVEL_EXCEPTION_FILTER OldFilter = NULL;
-
-// Windows creates a new thread to execute the console handler when an event
-// (such as CTRL/C) occurs. This causes concurrency issues with the above
-// globals which this critical section addresses.
-static CRITICAL_SECTION CriticalSection;
-
-namespace llvm {
-
-//===----------------------------------------------------------------------===//
-//=== WARNING: Implementation here must contain only Win32 specific code
-//=== and must not be UNIX code
-//===----------------------------------------------------------------------===//
-
-
-static void RegisterHandler() {
- if (RegisteredUnhandledExceptionFilter) {
- EnterCriticalSection(&CriticalSection);
- return;
- }
-
- // Now's the time to create the critical section. This is the first time
- // through here, and there's only one thread.
- InitializeCriticalSection(&CriticalSection);
-
- // Enter it immediately. Now if someone hits CTRL/C, the console handler
- // can't proceed until the globals are updated.
- EnterCriticalSection(&CriticalSection);
-
- RegisteredUnhandledExceptionFilter = true;
- OldFilter = SetUnhandledExceptionFilter(LLVMUnhandledExceptionFilter);
- SetConsoleCtrlHandler(LLVMConsoleCtrlHandler, TRUE);
-
- // IMPORTANT NOTE: Caller must call LeaveCriticalSection(&CriticalSection) or
- // else multi-threading problems will ensue.
-}
-
-// RemoveFileOnSignal - The public API
-bool sys::RemoveFileOnSignal(const sys::Path &Filename, std::string* ErrMsg) {
- RegisterHandler();
-
- if (CleanupExecuted) {
- if (ErrMsg)
- *ErrMsg = "Process terminating -- cannot register for removal";
- return true;
- }
-
- if (FilesToRemove == NULL)
- FilesToRemove = new std::vector<sys::Path>;
-
- FilesToRemove->push_back(Filename);
-
- LeaveCriticalSection(&CriticalSection);
- return false;
-}
-
-// RemoveDirectoryOnSignal - The public API
-bool sys::RemoveDirectoryOnSignal(const sys::Path& path, std::string* ErrMsg) {
- // Not a directory?
- WIN32_FILE_ATTRIBUTE_DATA fi;
- if (!GetFileAttributesEx(path.c_str(), GetFileExInfoStandard, &fi)) {
- MakeErrMsg(ErrMsg, path.toString() + ": can't get status of file");
- return true;
- }
-
- if (!(fi.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) {
- if (ErrMsg)
- *ErrMsg = path.toString() + ": not a directory";
- return true;
- }
-
- RegisterHandler();
-
- if (CleanupExecuted) {
- if (ErrMsg)
- *ErrMsg = "Process terminating -- cannot register for removal";
- return true;
- }
-
- if (DirectoriesToRemove == NULL)
- DirectoriesToRemove = new std::vector<sys::Path>;
- DirectoriesToRemove->push_back(path);
-
- LeaveCriticalSection(&CriticalSection);
- return false;
-}
-
-/// PrintStackTraceOnErrorSignal - When an error signal (such as SIBABRT or
-/// SIGSEGV) is delivered to the process, print a stack trace and then exit.
-void sys::PrintStackTraceOnErrorSignal() {
- RegisterHandler();
- LeaveCriticalSection(&CriticalSection);
-}
-
-
-void sys::SetInterruptFunction(void (*IF)()) {
- RegisterHandler();
- InterruptFunction = IF;
- LeaveCriticalSection(&CriticalSection);
-}
-}
-
-static void Cleanup() {
- EnterCriticalSection(&CriticalSection);
-
- // Prevent other thread from registering new files and directories for
- // removal, should we be executing because of the console handler callback.
- CleanupExecuted = true;
-
- // FIXME: open files cannot be deleted.
-
- if (FilesToRemove != NULL)
- while (!FilesToRemove->empty()) {
- try {
- FilesToRemove->back().eraseFromDisk();
- } catch (...) {
- }
- FilesToRemove->pop_back();
- }
-
- if (DirectoriesToRemove != NULL)
- while (!DirectoriesToRemove->empty()) {
- try {
- DirectoriesToRemove->back().eraseFromDisk(true);
- } catch (...) {
- }
- DirectoriesToRemove->pop_back();
- }
-
- LeaveCriticalSection(&CriticalSection);
-}
-
-static LONG WINAPI LLVMUnhandledExceptionFilter(LPEXCEPTION_POINTERS ep) {
- try {
- Cleanup();
-
-#ifdef _WIN64
- // TODO: provide a x64 friendly version of the following
-#else
-
- // Initialize the STACKFRAME structure.
- STACKFRAME StackFrame;
- memset(&StackFrame, 0, sizeof(StackFrame));
-
- StackFrame.AddrPC.Offset = ep->ContextRecord->Eip;
- StackFrame.AddrPC.Mode = AddrModeFlat;
- StackFrame.AddrStack.Offset = ep->ContextRecord->Esp;
- StackFrame.AddrStack.Mode = AddrModeFlat;
- StackFrame.AddrFrame.Offset = ep->ContextRecord->Ebp;
- StackFrame.AddrFrame.Mode = AddrModeFlat;
-
- HANDLE hProcess = GetCurrentProcess();
- HANDLE hThread = GetCurrentThread();
-
- // Initialize the symbol handler.
- SymSetOptions(SYMOPT_DEFERRED_LOADS|SYMOPT_LOAD_LINES);
- SymInitialize(hProcess, NULL, TRUE);
-
- while (true) {
- if (!StackWalk(IMAGE_FILE_MACHINE_I386, hProcess, hThread, &StackFrame,
- ep->ContextRecord, NULL, SymFunctionTableAccess,
- SymGetModuleBase, NULL)) {
- break;
- }
-
- if (StackFrame.AddrFrame.Offset == 0)
- break;
-
- // Print the PC in hexadecimal.
- DWORD PC = StackFrame.AddrPC.Offset;
- fprintf(stderr, "%08X", PC);
-
- // Print the parameters. Assume there are four.
- fprintf(stderr, " (0x%08X 0x%08X 0x%08X 0x%08X)", StackFrame.Params[0],
- StackFrame.Params[1], StackFrame.Params[2], StackFrame.Params[3]);
-
- // Verify the PC belongs to a module in this process.
- if (!SymGetModuleBase(hProcess, PC)) {
- fputs(" <unknown module>\n", stderr);
- continue;
- }
-
- // Print the symbol name.
- char buffer[512];
- IMAGEHLP_SYMBOL *symbol = reinterpret_cast<IMAGEHLP_SYMBOL *>(buffer);
- memset(symbol, 0, sizeof(IMAGEHLP_SYMBOL));
- symbol->SizeOfStruct = sizeof(IMAGEHLP_SYMBOL);
- symbol->MaxNameLength = 512 - sizeof(IMAGEHLP_SYMBOL);
-
- DWORD dwDisp;
- if (!SymGetSymFromAddr(hProcess, PC, &dwDisp, symbol)) {
- fputc('\n', stderr);
- continue;
- }
-
- buffer[511] = 0;
- if (dwDisp > 0)
- fprintf(stderr, ", %s()+%04d bytes(s)", symbol->Name, dwDisp);
- else
- fprintf(stderr, ", %s", symbol->Name);
-
- // Print the source file and line number information.
- IMAGEHLP_LINE line;
- memset(&line, 0, sizeof(line));
- line.SizeOfStruct = sizeof(line);
- if (SymGetLineFromAddr(hProcess, PC, &dwDisp, &line)) {
- fprintf(stderr, ", %s, line %d", line.FileName, line.LineNumber);
- if (dwDisp > 0)
- fprintf(stderr, "+%04d byte(s)", dwDisp);
- }
-
- fputc('\n', stderr);
- }
-
-#endif
-
- } catch (...) {
- assert(!"Crashed in LLVMUnhandledExceptionFilter");
- }
-
- // Allow dialog box to pop up allowing choice to start debugger.
- if (OldFilter)
- return (*OldFilter)(ep);
- else
- return EXCEPTION_CONTINUE_SEARCH;
-}
-
-static BOOL WINAPI LLVMConsoleCtrlHandler(DWORD dwCtrlType) {
- // We are running in our very own thread, courtesy of Windows.
- EnterCriticalSection(&CriticalSection);
- Cleanup();
-
- // If an interrupt function has been set, go and run one it; otherwise,
- // the process dies.
- void (*IF)() = InterruptFunction;
- InterruptFunction = 0; // Don't run it on another CTRL-C.
-
- if (IF) {
- // Note: if the interrupt function throws an exception, there is nothing
- // to catch it in this thread so it will kill the process.
- IF(); // Run it now.
- LeaveCriticalSection(&CriticalSection);
- return TRUE; // Don't kill the process.
- }
-
- // Allow normal processing to take place; i.e., the process dies.
- LeaveCriticalSection(&CriticalSection);
- return FALSE;
-}
-
diff --git a/release_23/lib/System/Win32/TimeValue.inc b/release_23/lib/System/Win32/TimeValue.inc
deleted file mode 100644
index 0ca87d423325..000000000000
--- a/release_23/lib/System/Win32/TimeValue.inc
+++ /dev/null
@@ -1,51 +0,0 @@
-//===- Win32/TimeValue.cpp - Win32 TimeValue Implementation -----*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file provides the Win32 implementation of the TimeValue class.
-//
-//===----------------------------------------------------------------------===//
-
-#include "Win32.h"
-#include <time.h>
-
-namespace llvm {
-using namespace sys;
-
-//===----------------------------------------------------------------------===//
-//=== WARNING: Implementation here must contain only Win32 specific code.
-//===----------------------------------------------------------------------===//
-
-TimeValue TimeValue::now() {
- uint64_t ft;
- GetSystemTimeAsFileTime(reinterpret_cast<FILETIME *>(&ft));
-
- TimeValue t(0, 0);
- t.fromWin32Time(ft);
- return t;
-}
-
-std::string TimeValue::toString() const {
-#ifdef __MINGW32__
- // This ban may be lifted by either:
- // (i) a future MinGW version other than 1.0 inherents the __time64_t type, or
- // (ii) configure tests for either the time_t or __time64_t type.
- time_t ourTime = time_t(this->toEpochTime());
- struct tm *lt = ::localtime(&ourTime);
-#else
- __time64_t ourTime = this->toEpochTime();
- struct tm *lt = ::_localtime64(&ourTime);
-#endif
-
- char buffer[25];
- strftime(buffer, 25, "%a %b %d %H:%M:%S %Y", lt);
- return std::string(buffer);
-}
-
-
-}
diff --git a/release_23/lib/System/Win32/Win32.h b/release_23/lib/System/Win32/Win32.h
deleted file mode 100644
index 8f505b1a6cdb..000000000000
--- a/release_23/lib/System/Win32/Win32.h
+++ /dev/null
@@ -1,57 +0,0 @@
-//===- Win32/Win32.h - Common Win32 Include File ----------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines things specific to Win32 implementations.
-//
-//===----------------------------------------------------------------------===//
-
-//===----------------------------------------------------------------------===//
-//=== WARNING: Implementation here must contain only generic Win32 code that
-//=== is guaranteed to work on *all* Win32 variants.
-//===----------------------------------------------------------------------===//
-
-// Require at least Windows 2000 API.
-#define _WIN32_WINNT 0x0500
-
-#include "llvm/Config/config.h" // Get autoconf configuration settings
-#include "windows.h"
-#include <cassert>
-#include <string>
-
-inline bool MakeErrMsg(std::string* ErrMsg, const std::string& prefix) {
- if (!ErrMsg)
- return true;
- char *buffer = NULL;
- FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER|FORMAT_MESSAGE_FROM_SYSTEM,
- NULL, GetLastError(), 0, (LPSTR)&buffer, 1, NULL);
- *ErrMsg = prefix + buffer;
- LocalFree(buffer);
- return true;
-}
-
-class AutoHandle {
- HANDLE handle;
-
-public:
- AutoHandle(HANDLE h) : handle(h) {}
-
- ~AutoHandle() {
- if (handle)
- CloseHandle(handle);
- }
-
- operator HANDLE() {
- return handle;
- }
-
- AutoHandle &operator=(HANDLE h) {
- handle = h;
- return *this;
- }
-};
diff --git a/release_23/lib/Target/ARM/ARM.h b/release_23/lib/Target/ARM/ARM.h
deleted file mode 100644
index ef0c6bf8398c..000000000000
--- a/release_23/lib/Target/ARM/ARM.h
+++ /dev/null
@@ -1,108 +0,0 @@
-//===-- ARM.h - Top-level interface for ARM representation---- --*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains the entry points for global functions defined in the LLVM
-// ARM back-end.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef TARGET_ARM_H
-#define TARGET_ARM_H
-
-#include <iosfwd>
-#include <cassert>
-
-namespace llvm {
-
-class ARMTargetMachine;
-class FunctionPass;
-class MachineCodeEmitter;
-
-// Enums corresponding to ARM condition codes
-namespace ARMCC {
- enum CondCodes {
- EQ,
- NE,
- HS,
- LO,
- MI,
- PL,
- VS,
- VC,
- HI,
- LS,
- GE,
- LT,
- GT,
- LE,
- AL
- };
-
- inline static CondCodes getOppositeCondition(CondCodes CC){
- switch (CC) {
- default: assert(0 && "Unknown condition code");
- case EQ: return NE;
- case NE: return EQ;
- case HS: return LO;
- case LO: return HS;
- case MI: return PL;
- case PL: return MI;
- case VS: return VC;
- case VC: return VS;
- case HI: return LS;
- case LS: return HI;
- case GE: return LT;
- case LT: return GE;
- case GT: return LE;
- case LE: return GT;
- }
- }
-}
-
-inline static const char *ARMCondCodeToString(ARMCC::CondCodes CC) {
- switch (CC) {
- default: assert(0 && "Unknown condition code");
- case ARMCC::EQ: return "eq";
- case ARMCC::NE: return "ne";
- case ARMCC::HS: return "hs";
- case ARMCC::LO: return "lo";
- case ARMCC::MI: return "mi";
- case ARMCC::PL: return "pl";
- case ARMCC::VS: return "vs";
- case ARMCC::VC: return "vc";
- case ARMCC::HI: return "hi";
- case ARMCC::LS: return "ls";
- case ARMCC::GE: return "ge";
- case ARMCC::LT: return "lt";
- case ARMCC::GT: return "gt";
- case ARMCC::LE: return "le";
- case ARMCC::AL: return "al";
- }
-}
-
-FunctionPass *createARMISelDag(ARMTargetMachine &TM);
-FunctionPass *createARMCodePrinterPass(std::ostream &O, ARMTargetMachine &TM);
-FunctionPass *createARMCodeEmitterPass(ARMTargetMachine &TM,
- MachineCodeEmitter &MCE);
-FunctionPass *createARMLoadStoreOptimizationPass();
-FunctionPass *createARMConstantIslandPass();
-
-} // end namespace llvm;
-
-// Defines symbolic names for ARM registers. This defines a mapping from
-// register name to register number.
-//
-#include "ARMGenRegisterNames.inc"
-
-// Defines symbolic names for the ARM instructions.
-//
-#include "ARMGenInstrNames.inc"
-
-
-#endif
diff --git a/release_23/lib/Target/ARM/ARM.td b/release_23/lib/Target/ARM/ARM.td
deleted file mode 100644
index 290f8ff39991..000000000000
--- a/release_23/lib/Target/ARM/ARM.td
+++ /dev/null
@@ -1,120 +0,0 @@
-//===- ARM.td - Describe the ARM Target Machine -----------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-//
-//===----------------------------------------------------------------------===//
-
-//===----------------------------------------------------------------------===//
-// Target-independent interfaces which we are implementing
-//===----------------------------------------------------------------------===//
-
-include "../Target.td"
-
-//===----------------------------------------------------------------------===//
-// ARM Subtarget features.
-//
-
-def ArchV4T : SubtargetFeature<"v4t", "ARMArchVersion", "V4T",
- "ARM v4T">;
-def ArchV5T : SubtargetFeature<"v5t", "ARMArchVersion", "V5T",
- "ARM v5T">;
-def ArchV5TE : SubtargetFeature<"v5te", "ARMArchVersion", "V5TE",
- "ARM v5TE, v5TEj, v5TExp">;
-def ArchV6 : SubtargetFeature<"v6", "ARMArchVersion", "V6",
- "ARM v6">;
-def FeatureVFP2 : SubtargetFeature<"vfp2", "HasVFP2", "true",
- "Enable VFP2 instructions ">;
-
-//===----------------------------------------------------------------------===//
-// ARM Processors supported.
-//
-
-class Proc<string Name, list<SubtargetFeature> Features>
- : Processor<Name, NoItineraries, Features>;
-
-// V4 Processors.
-def : Proc<"generic", []>;
-def : Proc<"arm8", []>;
-def : Proc<"arm810", []>;
-def : Proc<"strongarm", []>;
-def : Proc<"strongarm110", []>;
-def : Proc<"strongarm1100", []>;
-def : Proc<"strongarm1110", []>;
-
-// V4T Processors.
-def : Proc<"arm7tdmi", [ArchV4T]>;
-def : Proc<"arm7tdmi-s", [ArchV4T]>;
-def : Proc<"arm710t", [ArchV4T]>;
-def : Proc<"arm720t", [ArchV4T]>;
-def : Proc<"arm9", [ArchV4T]>;
-def : Proc<"arm9tdmi", [ArchV4T]>;
-def : Proc<"arm920", [ArchV4T]>;
-def : Proc<"arm920t", [ArchV4T]>;
-def : Proc<"arm922t", [ArchV4T]>;
-def : Proc<"arm940t", [ArchV4T]>;
-def : Proc<"ep9312", [ArchV4T]>;
-
-// V5T Processors.
-def : Proc<"arm10tdmi", [ArchV5T]>;
-def : Proc<"arm1020t", [ArchV5T]>;
-
-// V5TE Processors.
-def : Proc<"arm9e", [ArchV5TE]>;
-def : Proc<"arm926ej-s", [ArchV5TE]>;
-def : Proc<"arm946e-s", [ArchV5TE]>;
-def : Proc<"arm966e-s", [ArchV5TE]>;
-def : Proc<"arm968e-s", [ArchV5TE]>;
-def : Proc<"arm10e", [ArchV5TE]>;
-def : Proc<"arm1020e", [ArchV5TE]>;
-def : Proc<"arm1022e", [ArchV5TE]>;
-def : Proc<"xscale", [ArchV5TE]>;
-def : Proc<"iwmmxt", [ArchV5TE]>;
-
-// V6 Processors.
-def : Proc<"arm1136j-s", [ArchV6]>;
-def : Proc<"arm1136jf-s", [ArchV6, FeatureVFP2]>;
-def : Proc<"arm1176jz-s", [ArchV6]>;
-def : Proc<"arm1176jzf-s", [ArchV6, FeatureVFP2]>;
-def : Proc<"mpcorenovfp", [ArchV6]>;
-def : Proc<"mpcore", [ArchV6, FeatureVFP2]>;
-
-//===----------------------------------------------------------------------===//
-// Register File Description
-//===----------------------------------------------------------------------===//
-
-include "ARMRegisterInfo.td"
-
-//===----------------------------------------------------------------------===//
-// Instruction Descriptions
-//===----------------------------------------------------------------------===//
-
-include "ARMInstrInfo.td"
-
-def ARMInstrInfo : InstrInfo {
- // Define how we want to layout our target-specific information field.
- let TSFlagsFields = ["AddrModeBits",
- "SizeFlag",
- "IndexModeBits",
- "Opcode",
- "Form"];
- let TSFlagsShifts = [0,
- 4,
- 7,
- 9,
- 13];
-}
-
-//===----------------------------------------------------------------------===//
-// Declare the target which we are implementing
-//===----------------------------------------------------------------------===//
-
-def ARM : Target {
- // Pull in Instruction Info:
- let InstructionSet = ARMInstrInfo;
-}
diff --git a/release_23/lib/Target/ARM/ARMAddressingModes.h b/release_23/lib/Target/ARM/ARMAddressingModes.h
deleted file mode 100644
index 0189c00cea35..000000000000
--- a/release_23/lib/Target/ARM/ARMAddressingModes.h
+++ /dev/null
@@ -1,394 +0,0 @@
-//===- ARMAddressingModes.h - ARM Addressing Modes --------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains the ARM addressing mode implementation stuff.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_TARGET_ARM_ARMADDRESSINGMODES_H
-#define LLVM_TARGET_ARM_ARMADDRESSINGMODES_H
-
-#include "llvm/CodeGen/SelectionDAGNodes.h"
-#include "llvm/Support/MathExtras.h"
-#include <cassert>
-
-namespace llvm {
-
-/// ARM_AM - ARM Addressing Mode Stuff
-namespace ARM_AM {
- enum ShiftOpc {
- no_shift = 0,
- asr,
- lsl,
- lsr,
- ror,
- rrx
- };
-
- enum AddrOpc {
- add = '+', sub = '-'
- };
-
- static inline const char *getShiftOpcStr(ShiftOpc Op) {
- switch (Op) {
- default: assert(0 && "Unknown shift opc!");
- case ARM_AM::asr: return "asr";
- case ARM_AM::lsl: return "lsl";
- case ARM_AM::lsr: return "lsr";
- case ARM_AM::ror: return "ror";
- case ARM_AM::rrx: return "rrx";
- }
- }
-
- static inline ShiftOpc getShiftOpcForNode(SDOperand N) {
- switch (N.getOpcode()) {
- default: return ARM_AM::no_shift;
- case ISD::SHL: return ARM_AM::lsl;
- case ISD::SRL: return ARM_AM::lsr;
- case ISD::SRA: return ARM_AM::asr;
- case ISD::ROTR: return ARM_AM::ror;
- //case ISD::ROTL: // Only if imm -> turn into ROTR.
- // Can't handle RRX here, because it would require folding a flag into
- // the addressing mode. :( This causes us to miss certain things.
- //case ARMISD::RRX: return ARM_AM::rrx;
- }
- }
-
- enum AMSubMode {
- bad_am_submode = 0,
- ia,
- ib,
- da,
- db
- };
-
- static inline const char *getAMSubModeStr(AMSubMode Mode) {
- switch (Mode) {
- default: assert(0 && "Unknown addressing sub-mode!");
- case ARM_AM::ia: return "ia";
- case ARM_AM::ib: return "ib";
- case ARM_AM::da: return "da";
- case ARM_AM::db: return "db";
- }
- }
-
- static inline const char *getAMSubModeAltStr(AMSubMode Mode, bool isLD) {
- switch (Mode) {
- default: assert(0 && "Unknown addressing sub-mode!");
- case ARM_AM::ia: return isLD ? "fd" : "ea";
- case ARM_AM::ib: return isLD ? "ed" : "fa";
- case ARM_AM::da: return isLD ? "fa" : "ed";
- case ARM_AM::db: return isLD ? "ea" : "fd";
- }
- }
-
- /// rotr32 - Rotate a 32-bit unsigned value right by a specified # bits.
- ///
- static inline unsigned rotr32(unsigned Val, unsigned Amt) {
- assert(Amt < 32 && "Invalid rotate amount");
- return (Val >> Amt) | (Val << ((32-Amt)&31));
- }
-
- /// rotl32 - Rotate a 32-bit unsigned value left by a specified # bits.
- ///
- static inline unsigned rotl32(unsigned Val, unsigned Amt) {
- assert(Amt < 32 && "Invalid rotate amount");
- return (Val << Amt) | (Val >> ((32-Amt)&31));
- }
-
- //===--------------------------------------------------------------------===//
- // Addressing Mode #1: shift_operand with registers
- //===--------------------------------------------------------------------===//
- //
- // This 'addressing mode' is used for arithmetic instructions. It can
- // represent things like:
- // reg
- // reg [asr|lsl|lsr|ror|rrx] reg
- // reg [asr|lsl|lsr|ror|rrx] imm
- //
- // This is stored three operands [rega, regb, opc]. The first is the base
- // reg, the second is the shift amount (or reg0 if not present or imm). The
- // third operand encodes the shift opcode and the imm if a reg isn't present.
- //
- static inline unsigned getSORegOpc(ShiftOpc ShOp, unsigned Imm) {
- return ShOp | (Imm << 3);
- }
- static inline unsigned getSORegOffset(unsigned Op) {
- return Op >> 3;
- }
- static inline ShiftOpc getSORegShOp(unsigned Op) {
- return (ShiftOpc)(Op & 7);
- }
-
- /// getSOImmValImm - Given an encoded imm field for the reg/imm form, return
- /// the 8-bit imm value.
- static inline unsigned getSOImmValImm(unsigned Imm) {
- return Imm & 0xFF;
- }
- /// getSOImmValRotate - Given an encoded imm field for the reg/imm form, return
- /// the rotate amount.
- static inline unsigned getSOImmValRot(unsigned Imm) {
- return (Imm >> 8) * 2;
- }
-
- /// getSOImmValRotate - Try to handle Imm with an immediate shifter operand,
- /// computing the rotate amount to use. If this immediate value cannot be
- /// handled with a single shifter-op, determine a good rotate amount that will
- /// take a maximal chunk of bits out of the immediate.
- static inline unsigned getSOImmValRotate(unsigned Imm) {
- // 8-bit (or less) immediates are trivially shifter_operands with a rotate
- // of zero.
- if ((Imm & ~255U) == 0) return 0;
-
- // Use CTZ to compute the rotate amount.
- unsigned TZ = CountTrailingZeros_32(Imm);
-
- // Rotate amount must be even. Something like 0x200 must be rotated 8 bits,
- // not 9.
- unsigned RotAmt = TZ & ~1;
-
- // If we can handle this spread, return it.
- if ((rotr32(Imm, RotAmt) & ~255U) == 0)
- return (32-RotAmt)&31; // HW rotates right, not left.
-
- // For values like 0xF000000F, we should skip the first run of ones, then
- // retry the hunt.
- if (Imm & 1) {
- unsigned TrailingOnes = CountTrailingZeros_32(~Imm);
- if (TrailingOnes != 32) { // Avoid overflow on 0xFFFFFFFF
- // Restart the search for a high-order bit after the initial seconds of
- // ones.
- unsigned TZ2 = CountTrailingZeros_32(Imm & ~((1 << TrailingOnes)-1));
-
- // Rotate amount must be even.
- unsigned RotAmt2 = TZ2 & ~1;
-
- // If this fits, use it.
- if (RotAmt2 != 32 && (rotr32(Imm, RotAmt2) & ~255U) == 0)
- return (32-RotAmt2)&31; // HW rotates right, not left.
- }
- }
-
- // Otherwise, we have no way to cover this span of bits with a single
- // shifter_op immediate. Return a chunk of bits that will be useful to
- // handle.
- return (32-RotAmt)&31; // HW rotates right, not left.
- }
-
- /// getSOImmVal - Given a 32-bit immediate, if it is something that can fit
- /// into an shifter_operand immediate operand, return the 12-bit encoding for
- /// it. If not, return -1.
- static inline int getSOImmVal(unsigned Arg) {
- // 8-bit (or less) immediates are trivially shifter_operands with a rotate
- // of zero.
- if ((Arg & ~255U) == 0) return Arg;
-
- unsigned RotAmt = getSOImmValRotate(Arg);
-
- // If this cannot be handled with a single shifter_op, bail out.
- if (rotr32(~255U, RotAmt) & Arg)
- return -1;
-
- // Encode this correctly.
- return rotl32(Arg, RotAmt) | ((RotAmt>>1) << 8);
- }
-
- /// isSOImmTwoPartVal - Return true if the specified value can be obtained by
- /// or'ing together two SOImmVal's.
- static inline bool isSOImmTwoPartVal(unsigned V) {
- // If this can be handled with a single shifter_op, bail out.
- V = rotr32(~255U, getSOImmValRotate(V)) & V;
- if (V == 0)
- return false;
-
- // If this can be handled with two shifter_op's, accept.
- V = rotr32(~255U, getSOImmValRotate(V)) & V;
- return V == 0;
- }
-
- /// getSOImmTwoPartFirst - If V is a value that satisfies isSOImmTwoPartVal,
- /// return the first chunk of it.
- static inline unsigned getSOImmTwoPartFirst(unsigned V) {
- return rotr32(255U, getSOImmValRotate(V)) & V;
- }
-
- /// getSOImmTwoPartSecond - If V is a value that satisfies isSOImmTwoPartVal,
- /// return the second chunk of it.
- static inline unsigned getSOImmTwoPartSecond(unsigned V) {
- // Mask out the first hunk.
- V = rotr32(~255U, getSOImmValRotate(V)) & V;
-
- // Take what's left.
- assert(V == (rotr32(255U, getSOImmValRotate(V)) & V));
- return V;
- }
-
- /// getThumbImmValShift - Try to handle Imm with a 8-bit immediate followed
- /// by a left shift. Returns the shift amount to use.
- static inline unsigned getThumbImmValShift(unsigned Imm) {
- // 8-bit (or less) immediates are trivially immediate operand with a shift
- // of zero.
- if ((Imm & ~255U) == 0) return 0;
-
- // Use CTZ to compute the shift amount.
- return CountTrailingZeros_32(Imm);
- }
-
- /// isThumbImmShiftedVal - Return true if the specified value can be obtained
- /// by left shifting a 8-bit immediate.
- static inline bool isThumbImmShiftedVal(unsigned V) {
- // If this can be handled with
- V = (~255U << getThumbImmValShift(V)) & V;
- return V == 0;
- }
-
- /// getThumbImmNonShiftedVal - If V is a value that satisfies
- /// isThumbImmShiftedVal, return the non-shiftd value.
- static inline unsigned getThumbImmNonShiftedVal(unsigned V) {
- return V >> getThumbImmValShift(V);
- }
-
- //===--------------------------------------------------------------------===//
- // Addressing Mode #2
- //===--------------------------------------------------------------------===//
- //
- // This is used for most simple load/store instructions.
- //
- // addrmode2 := reg +/- reg shop imm
- // addrmode2 := reg +/- imm12
- //
- // The first operand is always a Reg. The second operand is a reg if in
- // reg/reg form, otherwise it's reg#0. The third field encodes the operation
- // in bit 12, the immediate in bits 0-11, and the shift op in 13-15.
- //
- // If this addressing mode is a frame index (before prolog/epilog insertion
- // and code rewriting), this operand will have the form: FI#, reg0, <offs>
- // with no shift amount for the frame offset.
- //
- static inline unsigned getAM2Opc(AddrOpc Opc, unsigned Imm12, ShiftOpc SO) {
- assert(Imm12 < (1 << 12) && "Imm too large!");
- bool isSub = Opc == sub;
- return Imm12 | ((int)isSub << 12) | (SO << 13);
- }
- static inline unsigned getAM2Offset(unsigned AM2Opc) {
- return AM2Opc & ((1 << 12)-1);
- }
- static inline AddrOpc getAM2Op(unsigned AM2Opc) {
- return ((AM2Opc >> 12) & 1) ? sub : add;
- }
- static inline ShiftOpc getAM2ShiftOpc(unsigned AM2Opc) {
- return (ShiftOpc)(AM2Opc >> 13);
- }
-
-
- //===--------------------------------------------------------------------===//
- // Addressing Mode #3
- //===--------------------------------------------------------------------===//
- //
- // This is used for sign-extending loads, and load/store-pair instructions.
- //
- // addrmode3 := reg +/- reg
- // addrmode3 := reg +/- imm8
- //
- // The first operand is always a Reg. The second operand is a reg if in
- // reg/reg form, otherwise it's reg#0. The third field encodes the operation
- // in bit 8, the immediate in bits 0-7.
-
- /// getAM3Opc - This function encodes the addrmode3 opc field.
- static inline unsigned getAM3Opc(AddrOpc Opc, unsigned char Offset) {
- bool isSub = Opc == sub;
- return ((int)isSub << 8) | Offset;
- }
- static inline unsigned char getAM3Offset(unsigned AM3Opc) {
- return AM3Opc & 0xFF;
- }
- static inline AddrOpc getAM3Op(unsigned AM3Opc) {
- return ((AM3Opc >> 8) & 1) ? sub : add;
- }
-
- //===--------------------------------------------------------------------===//
- // Addressing Mode #4
- //===--------------------------------------------------------------------===//
- //
- // This is used for load / store multiple instructions.
- //
- // addrmode4 := reg, <mode>
- //
- // The four modes are:
- // IA - Increment after
- // IB - Increment before
- // DA - Decrement after
- // DB - Decrement before
- //
- // If the 4th bit (writeback)is set, then the base register is updated after
- // the memory transfer.
-
- static inline AMSubMode getAM4SubMode(unsigned Mode) {
- return (AMSubMode)(Mode & 0x7);
- }
-
- static inline unsigned getAM4ModeImm(AMSubMode SubMode, bool WB = false) {
- return (int)SubMode | ((int)WB << 3);
- }
-
- static inline bool getAM4WBFlag(unsigned Mode) {
- return (Mode >> 3) & 1;
- }
-
- //===--------------------------------------------------------------------===//
- // Addressing Mode #5
- //===--------------------------------------------------------------------===//
- //
- // This is used for coprocessor instructions, such as FP load/stores.
- //
- // addrmode5 := reg +/- imm8*4
- //
- // The first operand is always a Reg. The third field encodes the operation
- // in bit 8, the immediate in bits 0-7.
- //
- // This can also be used for FP load/store multiple ops. The third field encodes
- // writeback mode in bit 8, the number of registers (or 2 times the number of
- // registers for DPR ops) in bits 0-7. In addition, bit 9-11 encodes one of the
- // following two sub-modes:
- //
- // IA - Increment after
- // DB - Decrement before
-
- /// getAM5Opc - This function encodes the addrmode5 opc field.
- static inline unsigned getAM5Opc(AddrOpc Opc, unsigned char Offset) {
- bool isSub = Opc == sub;
- return ((int)isSub << 8) | Offset;
- }
- static inline unsigned char getAM5Offset(unsigned AM5Opc) {
- return AM5Opc & 0xFF;
- }
- static inline AddrOpc getAM5Op(unsigned AM5Opc) {
- return ((AM5Opc >> 8) & 1) ? sub : add;
- }
-
- /// getAM5Opc - This function encodes the addrmode5 opc field for FLDM and
- /// FSTM instructions.
- static inline unsigned getAM5Opc(AMSubMode SubMode, bool WB,
- unsigned char Offset) {
- assert((SubMode == ia || SubMode == db) &&
- "Illegal addressing mode 5 sub-mode!");
- return ((int)SubMode << 9) | ((int)WB << 8) | Offset;
- }
- static inline AMSubMode getAM5SubMode(unsigned AM5Opc) {
- return (AMSubMode)((AM5Opc >> 9) & 0x7);
- }
- static inline bool getAM5WBFlag(unsigned AM5Opc) {
- return ((AM5Opc >> 8) & 1);
- }
-
-} // end namespace ARM_AM
-} // end namespace llvm
-
-#endif
-
diff --git a/release_23/lib/Target/ARM/ARMAsmPrinter.cpp b/release_23/lib/Target/ARM/ARMAsmPrinter.cpp
deleted file mode 100644
index ed7077129c7d..000000000000
--- a/release_23/lib/Target/ARM/ARMAsmPrinter.cpp
+++ /dev/null
@@ -1,1052 +0,0 @@
-//===-- ARMAsmPrinter.cpp - ARM LLVM assembly writer ----------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains a printer that converts from our internal representation
-// of machine-dependent LLVM code to GAS-format ARM assembly language.
-//
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "asm-printer"
-#include "ARM.h"
-#include "ARMTargetMachine.h"
-#include "ARMAddressingModes.h"
-#include "ARMConstantPoolValue.h"
-#include "ARMMachineFunctionInfo.h"
-#include "llvm/Constants.h"
-#include "llvm/Module.h"
-#include "llvm/CodeGen/AsmPrinter.h"
-#include "llvm/CodeGen/DwarfWriter.h"
-#include "llvm/CodeGen/MachineModuleInfo.h"
-#include "llvm/CodeGen/MachineFunctionPass.h"
-#include "llvm/CodeGen/MachineJumpTableInfo.h"
-#include "llvm/Target/TargetAsmInfo.h"
-#include "llvm/Target/TargetData.h"
-#include "llvm/Target/TargetMachine.h"
-#include "llvm/Target/TargetOptions.h"
-#include "llvm/ADT/Statistic.h"
-#include "llvm/ADT/StringExtras.h"
-#include "llvm/Support/Compiler.h"
-#include "llvm/Support/Mangler.h"
-#include "llvm/Support/MathExtras.h"
-#include <cctype>
-using namespace llvm;
-
-STATISTIC(EmittedInsts, "Number of machine instrs printed");
-
-namespace {
- struct VISIBILITY_HIDDEN ARMAsmPrinter : public AsmPrinter {
- ARMAsmPrinter(std::ostream &O, TargetMachine &TM, const TargetAsmInfo *T)
- : AsmPrinter(O, TM, T), DW(O, this, T), AFI(NULL), InCPMode(false) {
- Subtarget = &TM.getSubtarget<ARMSubtarget>();
- }
-
- DwarfWriter DW;
-
- /// Subtarget - Keep a pointer to the ARMSubtarget around so that we can
- /// make the right decision when printing asm code for different targets.
- const ARMSubtarget *Subtarget;
-
- /// AFI - Keep a pointer to ARMFunctionInfo for the current
- /// MachineFunction
- ARMFunctionInfo *AFI;
-
- /// We name each basic block in a Function with a unique number, so
- /// that we can consistently refer to them later. This is cleared
- /// at the beginning of each call to runOnMachineFunction().
- ///
- typedef std::map<const Value *, unsigned> ValueMapTy;
- ValueMapTy NumberForBB;
-
- /// Keeps the set of GlobalValues that require non-lazy-pointers for
- /// indirect access.
- std::set<std::string> GVNonLazyPtrs;
-
- /// Keeps the set of external function GlobalAddresses that the asm
- /// printer should generate stubs for.
- std::set<std::string> FnStubs;
-
- /// True if asm printer is printing a series of CONSTPOOL_ENTRY.
- bool InCPMode;
-
- virtual const char *getPassName() const {
- return "ARM Assembly Printer";
- }
-
- void printOperand(const MachineInstr *MI, int opNum,
- const char *Modifier = 0);
- void printSOImmOperand(const MachineInstr *MI, int opNum);
- void printSOImm2PartOperand(const MachineInstr *MI, int opNum);
- void printSORegOperand(const MachineInstr *MI, int opNum);
- void printAddrMode2Operand(const MachineInstr *MI, int OpNo);
- void printAddrMode2OffsetOperand(const MachineInstr *MI, int OpNo);
- void printAddrMode3Operand(const MachineInstr *MI, int OpNo);
- void printAddrMode3OffsetOperand(const MachineInstr *MI, int OpNo);
- void printAddrMode4Operand(const MachineInstr *MI, int OpNo,
- const char *Modifier = 0);
- void printAddrMode5Operand(const MachineInstr *MI, int OpNo,
- const char *Modifier = 0);
- void printAddrModePCOperand(const MachineInstr *MI, int OpNo,
- const char *Modifier = 0);
- void printThumbAddrModeRROperand(const MachineInstr *MI, int OpNo);
- void printThumbAddrModeRI5Operand(const MachineInstr *MI, int OpNo,
- unsigned Scale);
- void printThumbAddrModeS1Operand(const MachineInstr *MI, int OpNo);
- void printThumbAddrModeS2Operand(const MachineInstr *MI, int OpNo);
- void printThumbAddrModeS4Operand(const MachineInstr *MI, int OpNo);
- void printThumbAddrModeSPOperand(const MachineInstr *MI, int OpNo);
- void printPredicateOperand(const MachineInstr *MI, int opNum);
- void printSBitModifierOperand(const MachineInstr *MI, int opNum);
- void printPCLabel(const MachineInstr *MI, int opNum);
- void printRegisterList(const MachineInstr *MI, int opNum);
- void printCPInstOperand(const MachineInstr *MI, int opNum,
- const char *Modifier);
- void printJTBlockOperand(const MachineInstr *MI, int opNum);
-
- virtual bool PrintAsmOperand(const MachineInstr *MI, unsigned OpNo,
- unsigned AsmVariant, const char *ExtraCode);
-
- bool printInstruction(const MachineInstr *MI); // autogenerated.
- void printMachineInstruction(const MachineInstr *MI);
- bool runOnMachineFunction(MachineFunction &F);
- bool doInitialization(Module &M);
- bool doFinalization(Module &M);
-
- virtual void EmitMachineConstantPoolValue(MachineConstantPoolValue *MCPV) {
- printDataDirective(MCPV->getType());
-
- ARMConstantPoolValue *ACPV = (ARMConstantPoolValue*)MCPV;
- GlobalValue *GV = ACPV->getGV();
- std::string Name = GV ? Mang->getValueName(GV) : TAI->getGlobalPrefix();
- if (!GV)
- Name += ACPV->getSymbol();
- if (ACPV->isNonLazyPointer()) {
- GVNonLazyPtrs.insert(Name);
- O << TAI->getPrivateGlobalPrefix() << Name << "$non_lazy_ptr";
- } else if (ACPV->isStub()) {
- FnStubs.insert(Name);
- O << TAI->getPrivateGlobalPrefix() << Name << "$stub";
- } else
- O << Name;
- if (ACPV->hasModifier()) O << "(" << ACPV->getModifier() << ")";
- if (ACPV->getPCAdjustment() != 0) {
- O << "-(" << TAI->getPrivateGlobalPrefix() << "PC"
- << utostr(ACPV->getLabelId())
- << "+" << (unsigned)ACPV->getPCAdjustment();
- if (ACPV->mustAddCurrentAddress())
- O << "-.";
- O << ")";
- }
- O << "\n";
-
- // If the constant pool value is a extern weak symbol, remember to emit
- // the weak reference.
- if (GV && GV->hasExternalWeakLinkage())
- ExtWeakSymbols.insert(GV);
- }
-
- void getAnalysisUsage(AnalysisUsage &AU) const {
- AsmPrinter::getAnalysisUsage(AU);
- AU.setPreservesAll();
- AU.addRequired<MachineModuleInfo>();
- }
- };
-} // end of anonymous namespace
-
-#include "ARMGenAsmWriter.inc"
-
-/// createARMCodePrinterPass - Returns a pass that prints the ARM
-/// assembly code for a MachineFunction to the given output stream,
-/// using the given target machine description. This should work
-/// regardless of whether the function is in SSA form.
-///
-FunctionPass *llvm::createARMCodePrinterPass(std::ostream &o,
- ARMTargetMachine &tm) {
- return new ARMAsmPrinter(o, tm, tm.getTargetAsmInfo());
-}
-
-/// runOnMachineFunction - This uses the printInstruction()
-/// method to print assembly for each instruction.
-///
-bool ARMAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
- AFI = MF.getInfo<ARMFunctionInfo>();
-
- DW.SetModuleInfo(&getAnalysis<MachineModuleInfo>());
-
- SetupMachineFunction(MF);
- O << "\n";
-
- // NOTE: we don't print out constant pools here, they are handled as
- // instructions.
-
- O << "\n";
- // Print out labels for the function.
- const Function *F = MF.getFunction();
- switch (F->getLinkage()) {
- default: assert(0 && "Unknown linkage type!");
- case Function::InternalLinkage:
- SwitchToTextSection("\t.text", F);
- break;
- case Function::ExternalLinkage:
- SwitchToTextSection("\t.text", F);
- O << "\t.globl\t" << CurrentFnName << "\n";
- break;
- case Function::WeakLinkage:
- case Function::LinkOnceLinkage:
- if (Subtarget->isTargetDarwin()) {
- SwitchToTextSection(
- ".section __TEXT,__textcoal_nt,coalesced,pure_instructions", F);
- O << "\t.globl\t" << CurrentFnName << "\n";
- O << "\t.weak_definition\t" << CurrentFnName << "\n";
- } else {
- O << TAI->getWeakRefDirective() << CurrentFnName << "\n";
- }
- break;
- }
-
- const char *VisibilityDirective = NULL;
- if (F->hasHiddenVisibility())
- VisibilityDirective = TAI->getHiddenDirective();
- else if (F->hasProtectedVisibility())
- VisibilityDirective = TAI->getProtectedDirective();
-
- if (VisibilityDirective)
- O << VisibilityDirective << CurrentFnName << "\n";
-
- if (AFI->isThumbFunction()) {
- EmitAlignment(1, F, AFI->getAlign());
- O << "\t.code\t16\n";
- O << "\t.thumb_func";
- if (Subtarget->isTargetDarwin())
- O << "\t" << CurrentFnName;
- O << "\n";
- InCPMode = false;
- } else
- EmitAlignment(2, F);
-
- O << CurrentFnName << ":\n";
- // Emit pre-function debug information.
- DW.BeginFunction(&MF);
-
- if (Subtarget->isTargetDarwin()) {
- // If the function is empty, then we need to emit *something*. Otherwise,
- // the function's label might be associated with something that it wasn't
- // meant to be associated with. We emit a noop in this situation.
- MachineFunction::iterator I = MF.begin();
-
- if (++I == MF.end() && MF.front().empty())
- O << "\tnop\n";
- }
-
- // Print out code for the function.
- for (MachineFunction::const_iterator I = MF.begin(), E = MF.end();
- I != E; ++I) {
- // Print a label for the basic block.
- if (I != MF.begin()) {
- printBasicBlockLabel(I, true, true);
- O << '\n';
- }
- for (MachineBasicBlock::const_iterator II = I->begin(), E = I->end();
- II != E; ++II) {
- // Print the assembly for the instruction.
- printMachineInstruction(II);
- }
- }
-
- if (TAI->hasDotTypeDotSizeDirective())
- O << "\t.size " << CurrentFnName << ", .-" << CurrentFnName << "\n";
-
- // Emit post-function debug information.
- DW.EndFunction();
-
- return false;
-}
-
-void ARMAsmPrinter::printOperand(const MachineInstr *MI, int opNum,
- const char *Modifier) {
- const MachineOperand &MO = MI->getOperand(opNum);
- switch (MO.getType()) {
- case MachineOperand::MO_Register:
- if (TargetRegisterInfo::isPhysicalRegister(MO.getReg()))
- O << TM.getRegisterInfo()->get(MO.getReg()).AsmName;
- else
- assert(0 && "not implemented");
- break;
- case MachineOperand::MO_Immediate: {
- if (!Modifier || strcmp(Modifier, "no_hash") != 0)
- O << "#";
-
- O << (int)MO.getImm();
- break;
- }
- case MachineOperand::MO_MachineBasicBlock:
- printBasicBlockLabel(MO.getMBB());
- return;
- case MachineOperand::MO_GlobalAddress: {
- bool isCallOp = Modifier && !strcmp(Modifier, "call");
- GlobalValue *GV = MO.getGlobal();
- std::string Name = Mang->getValueName(GV);
- bool isExt = (GV->isDeclaration() || GV->hasWeakLinkage() ||
- GV->hasLinkOnceLinkage());
- if (isExt && isCallOp && Subtarget->isTargetDarwin() &&
- TM.getRelocationModel() != Reloc::Static) {
- O << TAI->getPrivateGlobalPrefix() << Name << "$stub";
- FnStubs.insert(Name);
- } else
- O << Name;
-
- if (MO.getOffset() > 0)
- O << '+' << MO.getOffset();
- else if (MO.getOffset() < 0)
- O << MO.getOffset();
-
- if (isCallOp && Subtarget->isTargetELF() &&
- TM.getRelocationModel() == Reloc::PIC_)
- O << "(PLT)";
- if (GV->hasExternalWeakLinkage())
- ExtWeakSymbols.insert(GV);
- break;
- }
- case MachineOperand::MO_ExternalSymbol: {
- bool isCallOp = Modifier && !strcmp(Modifier, "call");
- std::string Name(TAI->getGlobalPrefix());
- Name += MO.getSymbolName();
- if (isCallOp && Subtarget->isTargetDarwin() &&
- TM.getRelocationModel() != Reloc::Static) {
- O << TAI->getPrivateGlobalPrefix() << Name << "$stub";
- FnStubs.insert(Name);
- } else
- O << Name;
- if (isCallOp && Subtarget->isTargetELF() &&
- TM.getRelocationModel() == Reloc::PIC_)
- O << "(PLT)";
- break;
- }
- case MachineOperand::MO_ConstantPoolIndex:
- O << TAI->getPrivateGlobalPrefix() << "CPI" << getFunctionNumber()
- << '_' << MO.getIndex();
- break;
- case MachineOperand::MO_JumpTableIndex:
- O << TAI->getPrivateGlobalPrefix() << "JTI" << getFunctionNumber()
- << '_' << MO.getIndex();
- break;
- default:
- O << "<unknown operand type>"; abort (); break;
- }
-}
-
-static void printSOImm(std::ostream &O, int64_t V, const TargetAsmInfo *TAI) {
- assert(V < (1 << 12) && "Not a valid so_imm value!");
- unsigned Imm = ARM_AM::getSOImmValImm(V);
- unsigned Rot = ARM_AM::getSOImmValRot(V);
-
- // Print low-level immediate formation info, per
- // A5.1.3: "Data-processing operands - Immediate".
- if (Rot) {
- O << "#" << Imm << ", " << Rot;
- // Pretty printed version.
- O << ' ' << TAI->getCommentString() << ' ' << (int)ARM_AM::rotr32(Imm, Rot);
- } else {
- O << "#" << Imm;
- }
-}
-
-/// printSOImmOperand - SOImm is 4-bit rotate amount in bits 8-11 with 8-bit
-/// immediate in bits 0-7.
-void ARMAsmPrinter::printSOImmOperand(const MachineInstr *MI, int OpNum) {
- const MachineOperand &MO = MI->getOperand(OpNum);
- assert(MO.isImmediate() && "Not a valid so_imm value!");
- printSOImm(O, MO.getImm(), TAI);
-}
-
-/// printSOImm2PartOperand - SOImm is broken into two pieces using a mov
-/// followed by a or to materialize.
-void ARMAsmPrinter::printSOImm2PartOperand(const MachineInstr *MI, int OpNum) {
- const MachineOperand &MO = MI->getOperand(OpNum);
- assert(MO.isImmediate() && "Not a valid so_imm value!");
- unsigned V1 = ARM_AM::getSOImmTwoPartFirst(MO.getImm());
- unsigned V2 = ARM_AM::getSOImmTwoPartSecond(MO.getImm());
- printSOImm(O, ARM_AM::getSOImmVal(V1), TAI);
- O << "\n\torr";
- printPredicateOperand(MI, 2);
- O << " ";
- printOperand(MI, 0);
- O << ", ";
- printOperand(MI, 0);
- O << ", ";
- printSOImm(O, ARM_AM::getSOImmVal(V2), TAI);
-}
-
-// so_reg is a 4-operand unit corresponding to register forms of the A5.1
-// "Addressing Mode 1 - Data-processing operands" forms. This includes:
-// REG 0 0 - e.g. R5
-// REG REG 0,SH_OPC - e.g. R5, ROR R3
-// REG 0 IMM,SH_OPC - e.g. R5, LSL #3
-void ARMAsmPrinter::printSORegOperand(const MachineInstr *MI, int Op) {
- const MachineOperand &MO1 = MI->getOperand(Op);
- const MachineOperand &MO2 = MI->getOperand(Op+1);
- const MachineOperand &MO3 = MI->getOperand(Op+2);
-
- assert(TargetRegisterInfo::isPhysicalRegister(MO1.getReg()));
- O << TM.getRegisterInfo()->get(MO1.getReg()).AsmName;
-
- // Print the shift opc.
- O << ", "
- << ARM_AM::getShiftOpcStr(ARM_AM::getSORegShOp(MO3.getImm()))
- << " ";
-
- if (MO2.getReg()) {
- assert(TargetRegisterInfo::isPhysicalRegister(MO2.getReg()));
- O << TM.getRegisterInfo()->get(MO2.getReg()).AsmName;
- assert(ARM_AM::getSORegOffset(MO3.getImm()) == 0);
- } else {
- O << "#" << ARM_AM::getSORegOffset(MO3.getImm());
- }
-}
-
-void ARMAsmPrinter::printAddrMode2Operand(const MachineInstr *MI, int Op) {
- const MachineOperand &MO1 = MI->getOperand(Op);
- const MachineOperand &MO2 = MI->getOperand(Op+1);
- const MachineOperand &MO3 = MI->getOperand(Op+2);
-
- if (!MO1.isRegister()) { // FIXME: This is for CP entries, but isn't right.
- printOperand(MI, Op);
- return;
- }
-
- O << "[" << TM.getRegisterInfo()->get(MO1.getReg()).AsmName;
-
- if (!MO2.getReg()) {
- if (ARM_AM::getAM2Offset(MO3.getImm())) // Don't print +0.
- O << ", #"
- << (char)ARM_AM::getAM2Op(MO3.getImm())
- << ARM_AM::getAM2Offset(MO3.getImm());
- O << "]";
- return;
- }
-
- O << ", "
- << (char)ARM_AM::getAM2Op(MO3.getImm())
- << TM.getRegisterInfo()->get(MO2.getReg()).AsmName;
-
- if (unsigned ShImm = ARM_AM::getAM2Offset(MO3.getImm()))
- O << ", "
- << ARM_AM::getShiftOpcStr(ARM_AM::getAM2ShiftOpc(MO3.getImm()))
- << " #" << ShImm;
- O << "]";
-}
-
-void ARMAsmPrinter::printAddrMode2OffsetOperand(const MachineInstr *MI, int Op){
- const MachineOperand &MO1 = MI->getOperand(Op);
- const MachineOperand &MO2 = MI->getOperand(Op+1);
-
- if (!MO1.getReg()) {
- unsigned ImmOffs = ARM_AM::getAM2Offset(MO2.getImm());
- assert(ImmOffs && "Malformed indexed load / store!");
- O << "#"
- << (char)ARM_AM::getAM2Op(MO2.getImm())
- << ImmOffs;
- return;
- }
-
- O << (char)ARM_AM::getAM2Op(MO2.getImm())
- << TM.getRegisterInfo()->get(MO1.getReg()).AsmName;
-
- if (unsigned ShImm = ARM_AM::getAM2Offset(MO2.getImm()))
- O << ", "
- << ARM_AM::getShiftOpcStr(ARM_AM::getAM2ShiftOpc(MO2.getImm()))
- << " #" << ShImm;
-}
-
-void ARMAsmPrinter::printAddrMode3Operand(const MachineInstr *MI, int Op) {
- const MachineOperand &MO1 = MI->getOperand(Op);
- const MachineOperand &MO2 = MI->getOperand(Op+1);
- const MachineOperand &MO3 = MI->getOperand(Op+2);
-
- assert(TargetRegisterInfo::isPhysicalRegister(MO1.getReg()));
- O << "[" << TM.getRegisterInfo()->get(MO1.getReg()).AsmName;
-
- if (MO2.getReg()) {
- O << ", "
- << (char)ARM_AM::getAM3Op(MO3.getImm())
- << TM.getRegisterInfo()->get(MO2.getReg()).AsmName
- << "]";
- return;
- }
-
- if (unsigned ImmOffs = ARM_AM::getAM3Offset(MO3.getImm()))
- O << ", #"
- << (char)ARM_AM::getAM3Op(MO3.getImm())
- << ImmOffs;
- O << "]";
-}
-
-void ARMAsmPrinter::printAddrMode3OffsetOperand(const MachineInstr *MI, int Op){
- const MachineOperand &MO1 = MI->getOperand(Op);
- const MachineOperand &MO2 = MI->getOperand(Op+1);
-
- if (MO1.getReg()) {
- O << (char)ARM_AM::getAM3Op(MO2.getImm())
- << TM.getRegisterInfo()->get(MO1.getReg()).AsmName;
- return;
- }
-
- unsigned ImmOffs = ARM_AM::getAM3Offset(MO2.getImm());
- assert(ImmOffs && "Malformed indexed load / store!");
- O << "#"
- << (char)ARM_AM::getAM3Op(MO2.getImm())
- << ImmOffs;
-}
-
-void ARMAsmPrinter::printAddrMode4Operand(const MachineInstr *MI, int Op,
- const char *Modifier) {
- const MachineOperand &MO1 = MI->getOperand(Op);
- const MachineOperand &MO2 = MI->getOperand(Op+1);
- ARM_AM::AMSubMode Mode = ARM_AM::getAM4SubMode(MO2.getImm());
- if (Modifier && strcmp(Modifier, "submode") == 0) {
- if (MO1.getReg() == ARM::SP) {
- bool isLDM = (MI->getOpcode() == ARM::LDM ||
- MI->getOpcode() == ARM::LDM_RET);
- O << ARM_AM::getAMSubModeAltStr(Mode, isLDM);
- } else
- O << ARM_AM::getAMSubModeStr(Mode);
- } else {
- printOperand(MI, Op);
- if (ARM_AM::getAM4WBFlag(MO2.getImm()))
- O << "!";
- }
-}
-
-void ARMAsmPrinter::printAddrMode5Operand(const MachineInstr *MI, int Op,
- const char *Modifier) {
- const MachineOperand &MO1 = MI->getOperand(Op);
- const MachineOperand &MO2 = MI->getOperand(Op+1);
-
- if (!MO1.isRegister()) { // FIXME: This is for CP entries, but isn't right.
- printOperand(MI, Op);
- return;
- }
-
- assert(TargetRegisterInfo::isPhysicalRegister(MO1.getReg()));
-
- if (Modifier && strcmp(Modifier, "submode") == 0) {
- ARM_AM::AMSubMode Mode = ARM_AM::getAM5SubMode(MO2.getImm());
- if (MO1.getReg() == ARM::SP) {
- bool isFLDM = (MI->getOpcode() == ARM::FLDMD ||
- MI->getOpcode() == ARM::FLDMS);
- O << ARM_AM::getAMSubModeAltStr(Mode, isFLDM);
- } else
- O << ARM_AM::getAMSubModeStr(Mode);
- return;
- } else if (Modifier && strcmp(Modifier, "base") == 0) {
- // Used for FSTM{D|S} and LSTM{D|S} operations.
- O << TM.getRegisterInfo()->get(MO1.getReg()).AsmName;
- if (ARM_AM::getAM5WBFlag(MO2.getImm()))
- O << "!";
- return;
- }
-
- O << "[" << TM.getRegisterInfo()->get(MO1.getReg()).AsmName;
-
- if (unsigned ImmOffs = ARM_AM::getAM5Offset(MO2.getImm())) {
- O << ", #"
- << (char)ARM_AM::getAM5Op(MO2.getImm())
- << ImmOffs*4;
- }
- O << "]";
-}
-
-void ARMAsmPrinter::printAddrModePCOperand(const MachineInstr *MI, int Op,
- const char *Modifier) {
- if (Modifier && strcmp(Modifier, "label") == 0) {
- printPCLabel(MI, Op+1);
- return;
- }
-
- const MachineOperand &MO1 = MI->getOperand(Op);
- assert(TargetRegisterInfo::isPhysicalRegister(MO1.getReg()));
- O << "[pc, +" << TM.getRegisterInfo()->get(MO1.getReg()).AsmName << "]";
-}
-
-void
-ARMAsmPrinter::printThumbAddrModeRROperand(const MachineInstr *MI, int Op) {
- const MachineOperand &MO1 = MI->getOperand(Op);
- const MachineOperand &MO2 = MI->getOperand(Op+1);
- O << "[" << TM.getRegisterInfo()->get(MO1.getReg()).AsmName;
- O << ", " << TM.getRegisterInfo()->get(MO2.getReg()).AsmName << "]";
-}
-
-void
-ARMAsmPrinter::printThumbAddrModeRI5Operand(const MachineInstr *MI, int Op,
- unsigned Scale) {
- const MachineOperand &MO1 = MI->getOperand(Op);
- const MachineOperand &MO2 = MI->getOperand(Op+1);
- const MachineOperand &MO3 = MI->getOperand(Op+2);
-
- if (!MO1.isRegister()) { // FIXME: This is for CP entries, but isn't right.
- printOperand(MI, Op);
- return;
- }
-
- O << "[" << TM.getRegisterInfo()->get(MO1.getReg()).AsmName;
- if (MO3.getReg())
- O << ", " << TM.getRegisterInfo()->get(MO3.getReg()).AsmName;
- else if (unsigned ImmOffs = MO2.getImm()) {
- O << ", #" << ImmOffs;
- if (Scale > 1)
- O << " * " << Scale;
- }
- O << "]";
-}
-
-void
-ARMAsmPrinter::printThumbAddrModeS1Operand(const MachineInstr *MI, int Op) {
- printThumbAddrModeRI5Operand(MI, Op, 1);
-}
-void
-ARMAsmPrinter::printThumbAddrModeS2Operand(const MachineInstr *MI, int Op) {
- printThumbAddrModeRI5Operand(MI, Op, 2);
-}
-void
-ARMAsmPrinter::printThumbAddrModeS4Operand(const MachineInstr *MI, int Op) {
- printThumbAddrModeRI5Operand(MI, Op, 4);
-}
-
-void ARMAsmPrinter::printThumbAddrModeSPOperand(const MachineInstr *MI,int Op) {
- const MachineOperand &MO1 = MI->getOperand(Op);
- const MachineOperand &MO2 = MI->getOperand(Op+1);
- O << "[" << TM.getRegisterInfo()->get(MO1.getReg()).AsmName;
- if (unsigned ImmOffs = MO2.getImm())
- O << ", #" << ImmOffs << " * 4";
- O << "]";
-}
-
-void ARMAsmPrinter::printPredicateOperand(const MachineInstr *MI, int opNum) {
- ARMCC::CondCodes CC = (ARMCC::CondCodes)MI->getOperand(opNum).getImm();
- if (CC != ARMCC::AL)
- O << ARMCondCodeToString(CC);
-}
-
-void ARMAsmPrinter::printSBitModifierOperand(const MachineInstr *MI, int opNum){
- unsigned Reg = MI->getOperand(opNum).getReg();
- if (Reg) {
- assert(Reg == ARM::CPSR && "Expect ARM CPSR register!");
- O << 's';
- }
-}
-
-void ARMAsmPrinter::printPCLabel(const MachineInstr *MI, int opNum) {
- int Id = (int)MI->getOperand(opNum).getImm();
- O << TAI->getPrivateGlobalPrefix() << "PC" << Id;
-}
-
-void ARMAsmPrinter::printRegisterList(const MachineInstr *MI, int opNum) {
- O << "{";
- for (unsigned i = opNum, e = MI->getNumOperands(); i != e; ++i) {
- printOperand(MI, i);
- if (i != e-1) O << ", ";
- }
- O << "}";
-}
-
-void ARMAsmPrinter::printCPInstOperand(const MachineInstr *MI, int OpNo,
- const char *Modifier) {
- assert(Modifier && "This operand only works with a modifier!");
- // There are two aspects to a CONSTANTPOOL_ENTRY operand, the label and the
- // data itself.
- if (!strcmp(Modifier, "label")) {
- unsigned ID = MI->getOperand(OpNo).getImm();
- O << TAI->getPrivateGlobalPrefix() << "CPI" << getFunctionNumber()
- << '_' << ID << ":\n";
- } else {
- assert(!strcmp(Modifier, "cpentry") && "Unknown modifier for CPE");
- unsigned CPI = MI->getOperand(OpNo).getIndex();
-
- const MachineConstantPoolEntry &MCPE = // Chasing pointers is fun?
- MI->getParent()->getParent()->getConstantPool()->getConstants()[CPI];
-
- if (MCPE.isMachineConstantPoolEntry())
- EmitMachineConstantPoolValue(MCPE.Val.MachineCPVal);
- else {
- EmitGlobalConstant(MCPE.Val.ConstVal);
- // remember to emit the weak reference
- if (const GlobalValue *GV = dyn_cast<GlobalValue>(MCPE.Val.ConstVal))
- if (GV->hasExternalWeakLinkage())
- ExtWeakSymbols.insert(GV);
- }
- }
-}
-
-void ARMAsmPrinter::printJTBlockOperand(const MachineInstr *MI, int OpNo) {
- const MachineOperand &MO1 = MI->getOperand(OpNo);
- const MachineOperand &MO2 = MI->getOperand(OpNo+1); // Unique Id
- unsigned JTI = MO1.getIndex();
- O << TAI->getPrivateGlobalPrefix() << "JTI" << getFunctionNumber()
- << '_' << JTI << '_' << MO2.getImm() << ":\n";
-
- const char *JTEntryDirective = TAI->getJumpTableDirective();
- if (!JTEntryDirective)
- JTEntryDirective = TAI->getData32bitsDirective();
-
- const MachineFunction *MF = MI->getParent()->getParent();
- MachineJumpTableInfo *MJTI = MF->getJumpTableInfo();
- const std::vector<MachineJumpTableEntry> &JT = MJTI->getJumpTables();
- const std::vector<MachineBasicBlock*> &JTBBs = JT[JTI].MBBs;
- bool UseSet= TAI->getSetDirective() && TM.getRelocationModel() == Reloc::PIC_;
- std::set<MachineBasicBlock*> JTSets;
- for (unsigned i = 0, e = JTBBs.size(); i != e; ++i) {
- MachineBasicBlock *MBB = JTBBs[i];
- if (UseSet && JTSets.insert(MBB).second)
- printPICJumpTableSetLabel(JTI, MO2.getImm(), MBB);
-
- O << JTEntryDirective << ' ';
- if (UseSet)
- O << TAI->getPrivateGlobalPrefix() << getFunctionNumber()
- << '_' << JTI << '_' << MO2.getImm()
- << "_set_" << MBB->getNumber();
- else if (TM.getRelocationModel() == Reloc::PIC_) {
- printBasicBlockLabel(MBB, false, false, false);
- // If the arch uses custom Jump Table directives, don't calc relative to JT
- if (!TAI->getJumpTableDirective())
- O << '-' << TAI->getPrivateGlobalPrefix() << "JTI"
- << getFunctionNumber() << '_' << JTI << '_' << MO2.getImm();
- } else
- printBasicBlockLabel(MBB, false, false, false);
- if (i != e-1)
- O << '\n';
- }
-}
-
-
-bool ARMAsmPrinter::PrintAsmOperand(const MachineInstr *MI, unsigned OpNo,
- unsigned AsmVariant, const char *ExtraCode){
- // Does this asm operand have a single letter operand modifier?
- if (ExtraCode && ExtraCode[0]) {
- if (ExtraCode[1] != 0) return true; // Unknown modifier.
-
- switch (ExtraCode[0]) {
- default: return true; // Unknown modifier.
- case 'c': // Don't print "$" before a global var name or constant.
- case 'P': // Print a VFP double precision register.
- printOperand(MI, OpNo);
- return false;
- case 'Q':
- if (TM.getTargetData()->isLittleEndian())
- break;
- // Fallthrough
- case 'R':
- if (TM.getTargetData()->isBigEndian())
- break;
- // Fallthrough
- case 'H': // Write second word of DI / DF reference.
- // Verify that this operand has two consecutive registers.
- if (!MI->getOperand(OpNo).isRegister() ||
- OpNo+1 == MI->getNumOperands() ||
- !MI->getOperand(OpNo+1).isRegister())
- return true;
- ++OpNo; // Return the high-part.
- }
- }
-
- printOperand(MI, OpNo);
- return false;
-}
-
-void ARMAsmPrinter::printMachineInstruction(const MachineInstr *MI) {
- ++EmittedInsts;
-
- int Opc = MI->getOpcode();
- switch (Opc) {
- case ARM::CONSTPOOL_ENTRY:
- if (!InCPMode && AFI->isThumbFunction()) {
- EmitAlignment(2);
- InCPMode = true;
- }
- break;
- default: {
- if (InCPMode && AFI->isThumbFunction())
- InCPMode = false;
- switch (Opc) {
- case ARM::PICADD:
- case ARM::PICLD:
- case ARM::PICLDZH:
- case ARM::PICLDZB:
- case ARM::PICLDH:
- case ARM::PICLDB:
- case ARM::PICLDSH:
- case ARM::PICLDSB:
- case ARM::PICSTR:
- case ARM::PICSTRH:
- case ARM::PICSTRB:
- case ARM::tPICADD:
- break;
- default:
- break;
- }
- }}
-
- // Call the autogenerated instruction printer routines.
- printInstruction(MI);
-}
-
-bool ARMAsmPrinter::doInitialization(Module &M) {
- // Emit initial debug information.
- DW.BeginModule(&M);
-
- bool Result = AsmPrinter::doInitialization(M);
-
- // Darwin wants symbols to be quoted if they have complex names.
- if (Subtarget->isTargetDarwin())
- Mang->setUseQuotes(true);
-
- return Result;
-}
-
-/// PrintUnmangledNameSafely - Print out the printable characters in the name.
-/// Don't print things like \n or \0.
-static void PrintUnmangledNameSafely(const Value *V, std::ostream &OS) {
- for (const char *Name = V->getNameStart(), *E = Name+V->getNameLen();
- Name != E; ++Name)
- if (isprint(*Name))
- OS << *Name;
-}
-
-bool ARMAsmPrinter::doFinalization(Module &M) {
- const TargetData *TD = TM.getTargetData();
-
- for (Module::const_global_iterator I = M.global_begin(), E = M.global_end();
- I != E; ++I) {
- if (!I->hasInitializer()) // External global require no code
- continue;
-
- if (EmitSpecialLLVMGlobal(I)) {
- if (Subtarget->isTargetDarwin() &&
- TM.getRelocationModel() == Reloc::Static) {
- if (I->getName() == "llvm.global_ctors")
- O << ".reference .constructors_used\n";
- else if (I->getName() == "llvm.global_dtors")
- O << ".reference .destructors_used\n";
- }
- continue;
- }
-
- std::string name = Mang->getValueName(I);
- Constant *C = I->getInitializer();
- const Type *Type = C->getType();
- unsigned Size = TD->getABITypeSize(Type);
- unsigned Align = TD->getPreferredAlignmentLog(I);
-
- const char *VisibilityDirective = NULL;
- if (I->hasHiddenVisibility())
- VisibilityDirective = TAI->getHiddenDirective();
- else if (I->hasProtectedVisibility())
- VisibilityDirective = TAI->getProtectedDirective();
-
- if (VisibilityDirective)
- O << VisibilityDirective << name << "\n";
-
- if (Subtarget->isTargetELF())
- O << "\t.type " << name << ",%object\n";
-
- if (C->isNullValue() && !I->hasSection() && !I->isThreadLocal()) {
- if (I->hasExternalLinkage()) {
- if (const char *Directive = TAI->getZeroFillDirective()) {
- O << "\t.globl\t" << name << "\n";
- O << Directive << "__DATA, __common, " << name << ", "
- << Size << ", " << Align << "\n";
- continue;
- }
- }
-
- if (I->hasInternalLinkage() || I->hasWeakLinkage() ||
- I->hasLinkOnceLinkage()) {
- if (Size == 0) Size = 1; // .comm Foo, 0 is undefined, avoid it.
- if (!NoZerosInBSS && TAI->getBSSSection())
- SwitchToDataSection(TAI->getBSSSection(), I);
- else
- SwitchToDataSection(TAI->getDataSection(), I);
- if (TAI->getLCOMMDirective() != NULL) {
- if (I->hasInternalLinkage()) {
- O << TAI->getLCOMMDirective() << name << "," << Size;
- if (Subtarget->isTargetDarwin())
- O << "," << Align;
- } else
- O << TAI->getCOMMDirective() << name << "," << Size;
- } else {
- if (I->hasInternalLinkage())
- O << "\t.local\t" << name << "\n";
- O << TAI->getCOMMDirective() << name << "," << Size;
- if (TAI->getCOMMDirectiveTakesAlignment())
- O << "," << (TAI->getAlignmentIsInBytes() ? (1 << Align) : Align);
- }
- O << "\t\t" << TAI->getCommentString() << " ";
- PrintUnmangledNameSafely(I, O);
- O << "\n";
- continue;
- }
- }
-
- switch (I->getLinkage()) {
- case GlobalValue::LinkOnceLinkage:
- case GlobalValue::WeakLinkage:
- if (Subtarget->isTargetDarwin()) {
- O << "\t.globl " << name << "\n"
- << "\t.weak_definition " << name << "\n";
- SwitchToDataSection("\t.section __DATA,__datacoal_nt,coalesced", I);
- } else {
- std::string SectionName("\t.section\t.llvm.linkonce.d." +
- name +
- ",\"aw\",%progbits");
- SwitchToDataSection(SectionName.c_str(), I);
- O << "\t.weak " << name << "\n";
- }
- break;
- case GlobalValue::AppendingLinkage:
- // FIXME: appending linkage variables should go into a section of
- // their name or something. For now, just emit them as external.
- case GlobalValue::ExternalLinkage:
- O << "\t.globl " << name << "\n";
- // FALL THROUGH
- case GlobalValue::InternalLinkage: {
- if (I->isConstant()) {
- const ConstantArray *CVA = dyn_cast<ConstantArray>(C);
- if (TAI->getCStringSection() && CVA && CVA->isCString()) {
- SwitchToDataSection(TAI->getCStringSection(), I);
- break;
- }
- }
- // FIXME: special handling for ".ctors" & ".dtors" sections
- if (I->hasSection() &&
- (I->getSection() == ".ctors" ||
- I->getSection() == ".dtors")) {
- assert(!Subtarget->isTargetDarwin());
- std::string SectionName = ".section " + I->getSection();
- SectionName += ",\"aw\",%progbits";
- SwitchToDataSection(SectionName.c_str());
- } else if (I->hasSection() && Subtarget->isTargetDarwin()) {
- // Honor all section names on Darwin; ObjC uses this
- std::string SectionName = ".section " + I->getSection();
- SwitchToDataSection(SectionName.c_str());
- } else {
- if (C->isNullValue() && !NoZerosInBSS && TAI->getBSSSection())
- SwitchToDataSection(I->isThreadLocal() ? TAI->getTLSBSSSection() :
- TAI->getBSSSection(), I);
- else if (!I->isConstant())
- SwitchToDataSection(I->isThreadLocal() ? TAI->getTLSDataSection() :
- TAI->getDataSection(), I);
- else if (I->isThreadLocal())
- SwitchToDataSection(TAI->getTLSDataSection());
- else {
- // Read-only data.
- bool HasReloc = C->ContainsRelocations();
- if (HasReloc &&
- Subtarget->isTargetDarwin() &&
- TM.getRelocationModel() != Reloc::Static)
- SwitchToDataSection("\t.const_data\n");
- else if (!HasReloc && Size == 4 &&
- TAI->getFourByteConstantSection())
- SwitchToDataSection(TAI->getFourByteConstantSection(), I);
- else if (!HasReloc && Size == 8 &&
- TAI->getEightByteConstantSection())
- SwitchToDataSection(TAI->getEightByteConstantSection(), I);
- else if (!HasReloc && Size == 16 &&
- TAI->getSixteenByteConstantSection())
- SwitchToDataSection(TAI->getSixteenByteConstantSection(), I);
- else if (TAI->getReadOnlySection())
- SwitchToDataSection(TAI->getReadOnlySection(), I);
- else
- SwitchToDataSection(TAI->getDataSection(), I);
- }
- }
-
- break;
- }
- default:
- assert(0 && "Unknown linkage type!");
- break;
- }
-
- EmitAlignment(Align, I);
- O << name << ":\t\t\t\t" << TAI->getCommentString() << " ";
- PrintUnmangledNameSafely(I, O);
- O << "\n";
- if (TAI->hasDotTypeDotSizeDirective())
- O << "\t.size " << name << ", " << Size << "\n";
- // If the initializer is a extern weak symbol, remember to emit the weak
- // reference!
- if (const GlobalValue *GV = dyn_cast<GlobalValue>(C))
- if (GV->hasExternalWeakLinkage())
- ExtWeakSymbols.insert(GV);
-
- EmitGlobalConstant(C);
- O << '\n';
- }
-
- if (Subtarget->isTargetDarwin()) {
- SwitchToDataSection("");
-
- // Output stubs for dynamically-linked functions
- unsigned j = 1;
- for (std::set<std::string>::iterator i = FnStubs.begin(), e = FnStubs.end();
- i != e; ++i, ++j) {
- if (TM.getRelocationModel() == Reloc::PIC_)
- SwitchToTextSection(".section __TEXT,__picsymbolstub4,symbol_stubs,"
- "none,16", 0);
- else
- SwitchToTextSection(".section __TEXT,__symbol_stub4,symbol_stubs,"
- "none,12", 0);
-
- EmitAlignment(2);
- O << "\t.code\t32\n";
-
- O << "L" << *i << "$stub:\n";
- O << "\t.indirect_symbol " << *i << "\n";
- O << "\tldr ip, L" << *i << "$slp\n";
- if (TM.getRelocationModel() == Reloc::PIC_) {
- O << "L" << *i << "$scv:\n";
- O << "\tadd ip, pc, ip\n";
- }
- O << "\tldr pc, [ip, #0]\n";
- O << "L" << *i << "$slp:\n";
- if (TM.getRelocationModel() == Reloc::PIC_)
- O << "\t.long\tL" << *i << "$lazy_ptr-(L" << *i << "$scv+8)\n";
- else
- O << "\t.long\tL" << *i << "$lazy_ptr\n";
- SwitchToDataSection(".lazy_symbol_pointer", 0);
- O << "L" << *i << "$lazy_ptr:\n";
- O << "\t.indirect_symbol " << *i << "\n";
- O << "\t.long\tdyld_stub_binding_helper\n";
- }
- O << "\n";
-
- // Output non-lazy-pointers for external and common global variables.
- if (!GVNonLazyPtrs.empty())
- SwitchToDataSection(".non_lazy_symbol_pointer", 0);
- for (std::set<std::string>::iterator i = GVNonLazyPtrs.begin(),
- e = GVNonLazyPtrs.end(); i != e; ++i) {
- O << "L" << *i << "$non_lazy_ptr:\n";
- O << "\t.indirect_symbol " << *i << "\n";
- O << "\t.long\t0\n";
- }
-
- // Emit initial debug information.
- DW.EndModule();
-
- // Funny Darwin hack: This flag tells the linker that no global symbols
- // contain code that falls through to other global symbols (e.g. the obvious
- // implementation of multiple entry points). If this doesn't occur, the
- // linker can safely perform dead code stripping. Since LLVM never
- // generates code that does this, it is always safe to set.
- O << "\t.subsections_via_symbols\n";
- } else {
- // Emit final debug information for ELF.
- DW.EndModule();
- }
-
- return AsmPrinter::doFinalization(M);
-}
diff --git a/release_23/lib/Target/ARM/ARMCodeEmitter.cpp b/release_23/lib/Target/ARM/ARMCodeEmitter.cpp
deleted file mode 100644
index f4ee6b0f6499..000000000000
--- a/release_23/lib/Target/ARM/ARMCodeEmitter.cpp
+++ /dev/null
@@ -1,654 +0,0 @@
-//===-- ARM/ARMCodeEmitter.cpp - Convert ARM code to machine code ---------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains the pass that transforms the ARM machine instructions into
-// relocatable machine code.
-//
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "arm-emitter"
-#include "ARMInstrInfo.h"
-#include "ARMSubtarget.h"
-#include "ARMTargetMachine.h"
-#include "ARMRelocations.h"
-#include "ARMAddressingModes.h"
-#include "ARM.h"
-#include "llvm/PassManager.h"
-#include "llvm/CodeGen/MachineCodeEmitter.h"
-#include "llvm/CodeGen/MachineFunctionPass.h"
-#include "llvm/CodeGen/MachineInstr.h"
-#include "llvm/CodeGen/Passes.h"
-#include "llvm/Function.h"
-#include "llvm/ADT/Statistic.h"
-#include "llvm/Support/Compiler.h"
-using namespace llvm;
-
-STATISTIC(NumEmitted, "Number of machine instructions emitted");
-
-namespace {
- class VISIBILITY_HIDDEN Emitter : public MachineFunctionPass {
- const ARMInstrInfo *II;
- const TargetData *TD;
- TargetMachine &TM;
- MachineCodeEmitter &MCE;
- public:
- static char ID;
- explicit Emitter(TargetMachine &tm, MachineCodeEmitter &mce)
- : MachineFunctionPass((intptr_t)&ID), II(0), TD(0), TM(tm),
- MCE(mce) {}
- Emitter(TargetMachine &tm, MachineCodeEmitter &mce,
- const ARMInstrInfo &ii, const TargetData &td)
- : MachineFunctionPass((intptr_t)&ID), II(&ii), TD(&td), TM(tm),
- MCE(mce) {}
-
- bool runOnMachineFunction(MachineFunction &MF);
-
- virtual const char *getPassName() const {
- return "ARM Machine Code Emitter";
- }
-
- void emitInstruction(const MachineInstr &MI);
- int getMachineOpValue(const MachineInstr &MI, unsigned OpIndex);
- unsigned getBaseOpcodeFor(const TargetInstrDesc &TID);
- unsigned getBinaryCodeForInstr(const MachineInstr &MI);
-
- void emitGlobalAddressForCall(GlobalValue *GV, bool DoesntNeedStub);
- void emitExternalSymbolAddress(const char *ES, unsigned Reloc);
- void emitConstPoolAddress(unsigned CPI, unsigned Reloc,
- int Disp = 0, unsigned PCAdj = 0 );
- void emitJumpTableAddress(unsigned JTI, unsigned Reloc,
- unsigned PCAdj = 0);
- void emitGlobalConstant(const Constant *CV);
- void emitMachineBasicBlock(MachineBasicBlock *BB);
-
- private:
- int getShiftOp(const MachineOperand &MO);
-
- };
- char Emitter::ID = 0;
-}
-
-/// createARMCodeEmitterPass - Return a pass that emits the collected ARM code
-/// to the specified MCE object.
-FunctionPass *llvm::createARMCodeEmitterPass(ARMTargetMachine &TM,
- MachineCodeEmitter &MCE) {
- return new Emitter(TM, MCE);
-}
-
-bool Emitter::runOnMachineFunction(MachineFunction &MF) {
- assert((MF.getTarget().getRelocationModel() != Reloc::Default ||
- MF.getTarget().getRelocationModel() != Reloc::Static) &&
- "JIT relocation model must be set to static or default!");
- II = ((ARMTargetMachine&)MF.getTarget()).getInstrInfo();
- TD = ((ARMTargetMachine&)MF.getTarget()).getTargetData();
-
- do {
- MCE.startFunction(MF);
- for (MachineFunction::iterator MBB = MF.begin(), E = MF.end();
- MBB != E; ++MBB) {
- MCE.StartMachineBasicBlock(MBB);
- for (MachineBasicBlock::const_iterator I = MBB->begin(), E = MBB->end();
- I != E; ++I)
- emitInstruction(*I);
- }
- } while (MCE.finishFunction(MF));
-
- return false;
-}
-
-/// getBaseOpcodeFor - Return the opcode value
-unsigned Emitter::getBaseOpcodeFor(const TargetInstrDesc &TID) {
- return (TID.TSFlags & ARMII::OpcodeMask) >> ARMII::OpcodeShift;
-}
-
-/// getShiftOp - Verify which is the shift opcode (bit[6:5]) of the
-/// machine operand.
-int Emitter::getShiftOp(const MachineOperand &MO) {
- unsigned ShiftOp = 0x0;
- switch(ARM_AM::getAM2ShiftOpc(MO.getImm())) {
- default: assert(0 && "Unknown shift opc!");
- case ARM_AM::asr:
- ShiftOp = 0X2;
- break;
- case ARM_AM::lsl:
- ShiftOp = 0X0;
- break;
- case ARM_AM::lsr:
- ShiftOp = 0X1;
- break;
- case ARM_AM::ror:
- case ARM_AM::rrx:
- ShiftOp = 0X3;
- break;
- }
- return ShiftOp;
-}
-
-int Emitter::getMachineOpValue(const MachineInstr &MI, unsigned OpIndex) {
- intptr_t rv = 0;
- const MachineOperand &MO = MI.getOperand(OpIndex);
- if (MO.isRegister()) {
- assert(TargetRegisterInfo::isPhysicalRegister(MO.getReg()));
- rv = ARMRegisterInfo::getRegisterNumbering(MO.getReg());
- } else if (MO.isImmediate()) {
- rv = MO.getImm();
- } else if (MO.isGlobalAddress()) {
- emitGlobalAddressForCall(MO.getGlobal(), false);
- } else if (MO.isExternalSymbol()) {
- emitExternalSymbolAddress(MO.getSymbolName(), ARM::reloc_arm_relative);
- } else if (MO.isConstantPoolIndex()) {
- emitConstPoolAddress(MO.getIndex(), ARM::reloc_arm_relative);
- } else if (MO.isJumpTableIndex()) {
- emitJumpTableAddress(MO.getIndex(), ARM::reloc_arm_relative);
- } else if (MO.isMachineBasicBlock()) {
- emitMachineBasicBlock(MO.getMBB());
- }
-
- return rv;
-}
-
-/// emitGlobalAddressForCall - Emit the specified address to the code stream
-/// assuming this is part of a function call, which is PC relative.
-///
-void Emitter::emitGlobalAddressForCall(GlobalValue *GV, bool DoesntNeedStub) {
- MCE.addRelocation(MachineRelocation::getGV(MCE.getCurrentPCOffset(),
- ARM::reloc_arm_branch, GV, 0,
- DoesntNeedStub));
-}
-
-/// emitExternalSymbolAddress - Arrange for the address of an external symbol to
-/// be emitted to the current location in the function, and allow it to be PC
-/// relative.
-void Emitter::emitExternalSymbolAddress(const char *ES, unsigned Reloc) {
- MCE.addRelocation(MachineRelocation::getExtSym(MCE.getCurrentPCOffset(),
- Reloc, ES));
-}
-
-/// emitConstPoolAddress - Arrange for the address of an constant pool
-/// to be emitted to the current location in the function, and allow it to be PC
-/// relative.
-void Emitter::emitConstPoolAddress(unsigned CPI, unsigned Reloc,
- int Disp /* = 0 */,
- unsigned PCAdj /* = 0 */) {
- MCE.addRelocation(MachineRelocation::getConstPool(MCE.getCurrentPCOffset(),
- Reloc, CPI, PCAdj));
-}
-
-/// emitJumpTableAddress - Arrange for the address of a jump table to
-/// be emitted to the current location in the function, and allow it to be PC
-/// relative.
-void Emitter::emitJumpTableAddress(unsigned JTI, unsigned Reloc,
- unsigned PCAdj /* = 0 */) {
- MCE.addRelocation(MachineRelocation::getJumpTable(MCE.getCurrentPCOffset(),
- Reloc, JTI, PCAdj));
-}
-
-/// emitMachineBasicBlock - Emit the specified address basic block.
-void Emitter::emitMachineBasicBlock(MachineBasicBlock *BB) {
- MCE.addRelocation(MachineRelocation::getBB(MCE.getCurrentPCOffset(),
- ARM::reloc_arm_branch, BB));
-}
-
-void Emitter::emitInstruction(const MachineInstr &MI) {
- NumEmitted++; // Keep track of the # of mi's emitted
- MCE.emitWordLE(getBinaryCodeForInstr(MI));
-}
-
-unsigned Emitter::getBinaryCodeForInstr(const MachineInstr &MI) {
- const TargetInstrDesc &Desc = MI.getDesc();
- unsigned opcode = Desc.Opcode;
- // initial instruction mask
- unsigned Value = 0xE0000000;
- unsigned op;
-
- switch (Desc.TSFlags & ARMII::AddrModeMask) {
- case ARMII::AddrModeNone: {
- switch(Desc.TSFlags & ARMII::FormMask) {
- default: {
- assert(0 && "Unknown instruction subtype!");
- // treat special instruction CLZ
- if(opcode == ARM::CLZ) {
- // set first operand
- op = getMachineOpValue(MI,0);
- Value |= op << ARMII::RegRdShift;
-
- // set second operand
- op = getMachineOpValue(MI,1);
- Value |= op;
- }
- break;
- }
- case ARMII::MulSMLAW:
- case ARMII::MulSMULW:
- // set bit W(21)
- Value |= 1 << 21;
- case ARMII::MulSMLA:
- case ARMII::MulSMUL: {
- // set bit W(21)
- Value |= 1 << 24;
-
- // set opcode (bit[7:4]). For more information, see ARM-ARM page A3-31
- // SMLA<x><y> - 1yx0
- // SMLAW<y> - 1y00
- // SMULW<y> - 1y10
- // SMUL<x><y> - 1yx0
- unsigned char BaseOpcode = getBaseOpcodeFor(Desc);
- Value |= BaseOpcode << 4;
-
- unsigned Format = (Desc.TSFlags & ARMII::FormMask);
- if (Format == ARMII::MulSMUL)
- Value |= 1 << 22;
-
- // set first operand
- op = getMachineOpValue(MI,0);
- Value |= op << ARMII::RegRnShift;
-
- // set second operand
- op = getMachineOpValue(MI,1);
- Value |= op;
-
- // set third operand
- op = getMachineOpValue(MI,2);
- Value |= op << ARMII::RegRsShift;
-
- // instructions SMLA and SMLAW have a fourth operand
- if (Format != ARMII::MulSMULW && Format != ARMII::MulSMUL) {
- op = getMachineOpValue(MI,3);
- Value |= op << ARMII::RegRdShift;
- }
-
- break;
- }
- case ARMII::MulFrm: {
- // bit[7:4] is always 9
- Value |= 9 << 4;
- // set opcode (bit[23:20])
- unsigned char BaseOpcode = getBaseOpcodeFor(Desc);
- Value |= BaseOpcode << 20;
-
- bool isMUL = opcode == ARM::MUL;
- bool isMLA = opcode == ARM::MLA;
-
- // set first operand
- op = getMachineOpValue(MI,0);
- Value |= op << (isMUL || isMLA ? ARMII::RegRnShift : ARMII::RegRdShift);
-
- // set second operand
- op = getMachineOpValue(MI,1);
- Value |= op << (isMUL || isMLA ? 0 : ARMII::RegRnShift);
-
- // set third operand
- op = getMachineOpValue(MI,2);
- Value |= op << (isMUL || isMLA ? ARMII::RegRsShift : 0);
-
- // multiply instructions (except MUL), have a fourth operand
- if (!isMUL) {
- op = getMachineOpValue(MI,3);
- Value |= op << (isMLA ? ARMII::RegRdShift : ARMII::RegRsShift);
- }
-
- break;
- }
- case ARMII::Branch: {
- // set opcode (bit[27:24])
- unsigned BaseOpcode = getBaseOpcodeFor(Desc);
- Value |= BaseOpcode << 24;
-
- // set signed_immed_24 field
- op = getMachineOpValue(MI,0);
- Value |= op;
-
- // if it is a conditional branch, set cond field
- if (opcode == ARM::Bcc) {
- op = getMachineOpValue(MI,1);
- Value &= 0x0FFFFFFF; // clear conditional field
- Value |= op << 28; // set conditional field
- }
-
- break;
- }
- case ARMII::BranchMisc: {
- // set opcode (bit[7:4])
- unsigned char BaseOpcode = getBaseOpcodeFor(Desc);
- Value |= BaseOpcode << 4;
- // set bit[27:24] to 1, set bit[23:20] to 2 and set bit[19:8] to 0xFFF
- Value |= 0x12fff << 8;
-
- if (opcode == ARM::BX_RET)
- op = 0xe; // the return register is LR
- else
- // otherwise, set the return register
- op = getMachineOpValue(MI,0);
- Value |= op;
-
- break;
- }
- case ARMII::Pseudo:
- break;
- }
-
- break;
- }
- case ARMII::AddrMode1: {
- // set opcode (bit[24:21]) of data-processing instructions
- unsigned char BaseOpcode = getBaseOpcodeFor(Desc);
- Value |= BaseOpcode << 21;
-
- // treat 3 special instructions: MOVsra_flag, MOVsrl_flag and
- // MOVrx.
- unsigned Format = Desc.TSFlags & ARMII::FormMask;
- if (Format == ARMII::DPRdMisc) {
- Value |= getMachineOpValue(MI,0) << ARMII::RegRdShift;
- Value |= getMachineOpValue(MI,1);
- switch(opcode) {
- case ARM::MOVsra_flag: {
- Value |= 0x1 << 6;
- Value |= 0x1 << 7;
- break;
- }
- case ARM::MOVsrl_flag: {
- Value |= 0x1 << 5;
- Value |= 0x1 << 7;
- break;
- }
- case ARM::MOVrx: {
- Value |= 0x3 << 5;
- break;
- }
- }
- break;
- }
-
- // Data processing operand instructions has 3 possible encodings (for more
- // information, see ARM-ARM page A3-10):
- // 1. <instr> <Rd>,<shifter_operand>
- // 2. <instr> <Rn>,<shifter_operand>
- // 3. <instr> <Rd>,<Rn>,<shifter_operand>
- bool IsDataProcessing1 = Format == ARMII::DPRdIm ||
- Format == ARMII::DPRdReg ||
- Format == ARMII::DPRdSoReg;
- bool IsDataProcessing2 = Format == ARMII::DPRnIm ||
- Format == ARMII::DPRnReg ||
- Format == ARMII::DPRnSoReg;
- bool IsDataProcessing3 = false;
-
- // set bit S(20)
- if (Format == ARMII::DPRImS || Format == ARMII::DPRRegS ||
- Format == ARMII::DPRSoRegS || IsDataProcessing2) {
- Value |= 1 << ARMII::S_BitShift;
- IsDataProcessing3 = !IsDataProcessing2;
- }
-
- IsDataProcessing3 = Format == ARMII::DPRIm ||
- Format == ARMII::DPRReg ||
- Format == ARMII::DPRSoReg ||
- IsDataProcessing3;
-
- // set first operand
- op = getMachineOpValue(MI,0);
- if (IsDataProcessing1 || IsDataProcessing3) {
- Value |= op << ARMII::RegRdShift;
- } else if (IsDataProcessing2) {
- Value |= op << ARMII::RegRnShift;
- }
-
- // set second operand of data processing #3 instructions
- if (IsDataProcessing3) {
- op = getMachineOpValue(MI,1);
- Value |= op << ARMII::RegRnShift;
- }
-
- unsigned OperandIndex = IsDataProcessing3 ? 2 : 1;
- switch (Format) {
- case ARMII::DPRdIm: case ARMII::DPRnIm:
- case ARMII::DPRIm: case ARMII::DPRImS: {
- // set bit I(25) to identify this is the immediate form of <shifter_op>
- Value |= 1 << ARMII::I_BitShift;
- // set immed_8 field
- const MachineOperand &MO = MI.getOperand(OperandIndex);
- op = ARM_AM::getSOImmVal(MO.getImm());
- Value |= op;
-
- break;
- }
- case ARMII::DPRdReg: case ARMII::DPRnReg:
- case ARMII::DPRReg: case ARMII::DPRRegS: {
- // set last operand (register Rm)
- op = getMachineOpValue(MI,OperandIndex);
- Value |= op;
-
- break;
- }
- case ARMII::DPRdSoReg: case ARMII::DPRnSoReg:
- case ARMII::DPRSoReg: case ARMII::DPRSoRegS: {
- // set last operand (register Rm)
- op = getMachineOpValue(MI,OperandIndex);
- Value |= op;
-
- const MachineOperand &MO1 = MI.getOperand(OperandIndex + 1);
- const MachineOperand &MO2 = MI.getOperand(OperandIndex + 2);
- // identify it the instr is in immed or register shifts encoding
- bool IsShiftByRegister = MO1.getReg() > 0;
- // set shift operand (bit[6:4]).
- // ASR - 101 if it is in register shifts encoding; 100, otherwise.
- // LSL - 001 if it is in register shifts encoding; 000, otherwise.
- // LSR - 011 if it is in register shifts encoding; 010, otherwise.
- // ROR - 111 if it is in register shifts encoding; 110, otherwise.
- // RRX - 110 and bit[11:7] clear.
- switch(ARM_AM::getSORegShOp(MO2.getImm())) {
- default: assert(0 && "Unknown shift opc!");
- case ARM_AM::asr: {
- if(IsShiftByRegister)
- Value |= 0x5 << 4;
- else
- Value |= 0x1 << 6;
- break;
- }
- case ARM_AM::lsl: {
- if(IsShiftByRegister)
- Value |= 0x1 << 4;
- break;
- }
- case ARM_AM::lsr: {
- if(IsShiftByRegister)
- Value |= 0x3 << 4;
- else
- Value |= 0x1 << 5;
- break;
- }
- case ARM_AM::ror: {
- if(IsShiftByRegister)
- Value |= 0x7 << 4;
- else
- Value |= 0x3 << 5;
- break;
- }
- case ARM_AM::rrx: {
- Value |= 0x3 << 5;
- break;
- }
- }
- // set the field related to shift operations (except rrx).
- if (ARM_AM::getSORegShOp(MO2.getImm()) != ARM_AM::rrx) {
- if (IsShiftByRegister) {
- // set the value of bit[11:8] (register Rs).
- assert(TargetRegisterInfo::isPhysicalRegister(MO1.getReg()));
- op = ARMRegisterInfo::getRegisterNumbering(MO1.getReg());
- assert(ARM_AM::getSORegOffset(MO2.getImm()) == 0);
- Value |= op << ARMII::RegRsShift;
- } else {
- // set the value of bit [11:7] (shift_immed field).
- op = ARM_AM::getSORegOffset(MO2.getImm());
- Value |= op << 7;
- }
- }
- break;
- }
- default: assert(false && "Unknown operand type!");
- break;
- }
-
- break;
- }
- case ARMII::AddrMode2: {
- // bit 26 is always 1
- Value |= 1 << 26;
-
- unsigned Index = Desc.TSFlags & ARMII::IndexModeMask;
- // if the instruction uses offset addressing or pre-indexed addressing,
- // set bit P(24) to 1
- if (Index == ARMII::IndexModePre || Index == 0)
- Value |= 1 << ARMII::IndexShift;
- // if the instruction uses post-indexed addressing, set bit W(21) to 1
- if (Index == ARMII::IndexModePre)
- Value |= 1 << 21;
-
- unsigned Format = Desc.TSFlags & ARMII::FormMask;
- // If it is a load instruction (except LDRD), set bit L(20) to 1
- if (Format == ARMII::LdFrm)
- Value |= 1 << ARMII::L_BitShift;
-
- // set bit B(22)
- unsigned BitByte = getBaseOpcodeFor(Desc);
- Value |= BitByte << 22;
-
- // set first operand
- op = getMachineOpValue(MI,0);
- Value |= op << ARMII::RegRdShift;
-
- // set second operand
- op = getMachineOpValue(MI,1);
- Value |= op << ARMII::RegRnShift;
-
- const MachineOperand &MO2 = MI.getOperand(2);
- const MachineOperand &MO3 = MI.getOperand(3);
-
- // set bit U(23) according to signal of immed value (positive or negative)
- Value |= (ARM_AM::getAM2Op(MO3.getImm()) == ARM_AM::add ? 1 : 0) <<
- ARMII::U_BitShift;
- if (!MO2.getReg()) { // is immediate
- if (ARM_AM::getAM2Offset(MO3.getImm()))
- // set the value of offset_12 field
- Value |= ARM_AM::getAM2Offset(MO3.getImm());
- break;
- }
-
- // set bit I(25), because this is not in immediate enconding.
- Value |= 1 << ARMII::I_BitShift;
- assert(TargetRegisterInfo::isPhysicalRegister(MO2.getReg()));
- // set bit[3:0] to the corresponding Rm register
- Value |= ARMRegisterInfo::getRegisterNumbering(MO2.getReg());
-
- // if this instr is in scaled register offset/index instruction, set
- // shift_immed(bit[11:7]) and shift(bit[6:5]) fields.
- if (unsigned ShImm = ARM_AM::getAM2Offset(MO3.getImm())) {
- unsigned ShiftOp = getShiftOp(MO3);
- Value |= ShiftOp << 5; // shift
- Value |= ShImm << 7; // shift_immed
- }
-
- break;
- }
- case ARMII::AddrMode3: {
- unsigned Index = Desc.TSFlags & ARMII::IndexModeMask;
- // if the instruction uses offset addressing or pre-indexed addressing,
- // set bit P(24) to 1
- if (Index == ARMII::IndexModePre || Index == 0)
- Value |= 1 << ARMII::IndexShift;
-
- unsigned Format = Desc.TSFlags & ARMII::FormMask;
- // If it is a load instruction (except LDRD), set bit L(20) to 1
- if (Format == ARMII::LdFrm && opcode != ARM::LDRD)
- Value |= 1 << ARMII::L_BitShift;
-
- // bit[7:4] is the opcode of this instruction class (bits S and H).
- unsigned char BaseOpcode = getBaseOpcodeFor(Desc);
- Value |= BaseOpcode << 4;
-
- // set first operand
- op = getMachineOpValue(MI,0);
- Value |= op << ARMII::RegRdShift;
-
- // set second operand
- op = getMachineOpValue(MI,1);
- Value |= op << ARMII::RegRnShift;
-
- const MachineOperand &MO2 = MI.getOperand(2);
- const MachineOperand &MO3 = MI.getOperand(3);
-
- // set bit U(23) according to signal of immed value (positive or negative)
- Value |= (ARM_AM::getAM2Op(MO3.getImm()) == ARM_AM::add ? 1 : 0) <<
- ARMII::U_BitShift;
-
- // if this instr is in register offset/index encoding, set bit[3:0]
- // to the corresponding Rm register.
- if (MO2.getReg()) {
- Value |= ARMRegisterInfo::getRegisterNumbering(MO2.getReg());
- break;
- }
-
- // if this instr is in immediate offset/index encoding, set bit 22 to 1
- if (unsigned ImmOffs = ARM_AM::getAM3Offset(MO3.getImm())) {
- Value |= 1 << 22;
- // set operands
- Value |= (ImmOffs >> 4) << 8; // immedH
- Value |= (ImmOffs & ~0xF); // immedL
- }
-
- break;
- }
- case ARMII::AddrMode4: {
- // bit 27 is always 1
- Value |= 1 << 27;
-
- unsigned Format = Desc.TSFlags & ARMII::FormMask;
- // if it is a load instr, set bit L(20) to 1
- if (Format == ARMII::LdFrm)
- Value |= 1 << ARMII::L_BitShift;
-
- unsigned OpIndex = 0;
-
- // set first operand
- op = getMachineOpValue(MI,OpIndex);
- Value |= op << ARMII::RegRnShift;
-
- // set addressing mode by modifying bits U(23) and P(24)
- // IA - Increment after - bit U = 1 and bit P = 0
- // IB - Increment before - bit U = 1 and bit P = 1
- // DA - Decrement after - bit U = 0 and bit P = 0
- // DB - Decrement before - bit U = 0 and bit P = 1
- const MachineOperand &MO = MI.getOperand(OpIndex + 1);
- ARM_AM::AMSubMode Mode = ARM_AM::getAM4SubMode(MO.getImm());
- switch(Mode) {
- default: assert(0 && "Unknown addressing sub-mode!");
- case ARM_AM::ia: Value |= 0x1 << 23; break;
- case ARM_AM::ib: Value |= 0x3 << 23; break;
- case ARM_AM::da: break;
- case ARM_AM::db: Value |= 0x1 << 24; break;
- }
-
- // set bit W(21)
- if (ARM_AM::getAM4WBFlag(MO.getImm()))
- Value |= 0x1 << 21;
-
- // set registers
- for (unsigned i = OpIndex + 4, e = MI.getNumOperands(); i != e; ++i) {
- const MachineOperand &MOR = MI.getOperand(i);
- unsigned RegNumber = ARMRegisterInfo::getRegisterNumbering(MOR.getReg());
- assert(TargetRegisterInfo::isPhysicalRegister(MOR.getReg()) &&
- RegNumber < 16);
- Value |= 0x1 << RegNumber;
- }
-
- break;
- }
- }
-
- return Value;
-}
diff --git a/release_23/lib/Target/ARM/ARMConstantIslandPass.cpp b/release_23/lib/Target/ARM/ARMConstantIslandPass.cpp
deleted file mode 100644
index e7da3cffcf75..000000000000
--- a/release_23/lib/Target/ARM/ARMConstantIslandPass.cpp
+++ /dev/null
@@ -1,1277 +0,0 @@
-//===-- ARMConstantIslandPass.cpp - ARM constant islands --------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains a pass that splits the constant pool up into 'islands'
-// which are scattered through-out the function. This is required due to the
-// limited pc-relative displacements that ARM has.
-//
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "arm-cp-islands"
-#include "ARM.h"
-#include "ARMMachineFunctionInfo.h"
-#include "ARMInstrInfo.h"
-#include "llvm/CodeGen/MachineConstantPool.h"
-#include "llvm/CodeGen/MachineFunctionPass.h"
-#include "llvm/CodeGen/MachineInstrBuilder.h"
-#include "llvm/Target/TargetData.h"
-#include "llvm/Target/TargetMachine.h"
-#include "llvm/Support/Compiler.h"
-#include "llvm/Support/Debug.h"
-#include "llvm/ADT/SmallVector.h"
-#include "llvm/ADT/STLExtras.h"
-#include "llvm/ADT/Statistic.h"
-using namespace llvm;
-
-STATISTIC(NumCPEs, "Number of constpool entries");
-STATISTIC(NumSplit, "Number of uncond branches inserted");
-STATISTIC(NumCBrFixed, "Number of cond branches fixed");
-STATISTIC(NumUBrFixed, "Number of uncond branches fixed");
-
-namespace {
- /// ARMConstantIslands - Due to limited PC-relative displacements, ARM
- /// requires constant pool entries to be scattered among the instructions
- /// inside a function. To do this, it completely ignores the normal LLVM
- /// constant pool; instead, it places constants wherever it feels like with
- /// special instructions.
- ///
- /// The terminology used in this pass includes:
- /// Islands - Clumps of constants placed in the function.
- /// Water - Potential places where an island could be formed.
- /// CPE - A constant pool entry that has been placed somewhere, which
- /// tracks a list of users.
- class VISIBILITY_HIDDEN ARMConstantIslands : public MachineFunctionPass {
- /// NextUID - Assign unique ID's to CPE's.
- unsigned NextUID;
-
- /// BBSizes - The size of each MachineBasicBlock in bytes of code, indexed
- /// by MBB Number. The two-byte pads required for Thumb alignment are
- /// counted as part of the following block (i.e., the offset and size for
- /// a padded block will both be ==2 mod 4).
- std::vector<unsigned> BBSizes;
-
- /// BBOffsets - the offset of each MBB in bytes, starting from 0.
- /// The two-byte pads required for Thumb alignment are counted as part of
- /// the following block.
- std::vector<unsigned> BBOffsets;
-
- /// WaterList - A sorted list of basic blocks where islands could be placed
- /// (i.e. blocks that don't fall through to the following block, due
- /// to a return, unreachable, or unconditional branch).
- std::vector<MachineBasicBlock*> WaterList;
-
- /// CPUser - One user of a constant pool, keeping the machine instruction
- /// pointer, the constant pool being referenced, and the max displacement
- /// allowed from the instruction to the CP.
- struct CPUser {
- MachineInstr *MI;
- MachineInstr *CPEMI;
- unsigned MaxDisp;
- CPUser(MachineInstr *mi, MachineInstr *cpemi, unsigned maxdisp)
- : MI(mi), CPEMI(cpemi), MaxDisp(maxdisp) {}
- };
-
- /// CPUsers - Keep track of all of the machine instructions that use various
- /// constant pools and their max displacement.
- std::vector<CPUser> CPUsers;
-
- /// CPEntry - One per constant pool entry, keeping the machine instruction
- /// pointer, the constpool index, and the number of CPUser's which
- /// reference this entry.
- struct CPEntry {
- MachineInstr *CPEMI;
- unsigned CPI;
- unsigned RefCount;
- CPEntry(MachineInstr *cpemi, unsigned cpi, unsigned rc = 0)
- : CPEMI(cpemi), CPI(cpi), RefCount(rc) {}
- };
-
- /// CPEntries - Keep track of all of the constant pool entry machine
- /// instructions. For each original constpool index (i.e. those that
- /// existed upon entry to this pass), it keeps a vector of entries.
- /// Original elements are cloned as we go along; the clones are
- /// put in the vector of the original element, but have distinct CPIs.
- std::vector<std::vector<CPEntry> > CPEntries;
-
- /// ImmBranch - One per immediate branch, keeping the machine instruction
- /// pointer, conditional or unconditional, the max displacement,
- /// and (if isCond is true) the corresponding unconditional branch
- /// opcode.
- struct ImmBranch {
- MachineInstr *MI;
- unsigned MaxDisp : 31;
- bool isCond : 1;
- int UncondBr;
- ImmBranch(MachineInstr *mi, unsigned maxdisp, bool cond, int ubr)
- : MI(mi), MaxDisp(maxdisp), isCond(cond), UncondBr(ubr) {}
- };
-
- /// ImmBranches - Keep track of all the immediate branch instructions.
- ///
- std::vector<ImmBranch> ImmBranches;
-
- /// PushPopMIs - Keep track of all the Thumb push / pop instructions.
- ///
- SmallVector<MachineInstr*, 4> PushPopMIs;
-
- /// HasFarJump - True if any far jump instruction has been emitted during
- /// the branch fix up pass.
- bool HasFarJump;
-
- const TargetInstrInfo *TII;
- ARMFunctionInfo *AFI;
- bool isThumb;
- public:
- static char ID;
- ARMConstantIslands() : MachineFunctionPass((intptr_t)&ID) {}
-
- virtual bool runOnMachineFunction(MachineFunction &Fn);
-
- virtual const char *getPassName() const {
- return "ARM constant island placement and branch shortening pass";
- }
-
- private:
- void DoInitialPlacement(MachineFunction &Fn,
- std::vector<MachineInstr*> &CPEMIs);
- CPEntry *findConstPoolEntry(unsigned CPI, const MachineInstr *CPEMI);
- void InitialFunctionScan(MachineFunction &Fn,
- const std::vector<MachineInstr*> &CPEMIs);
- MachineBasicBlock *SplitBlockBeforeInstr(MachineInstr *MI);
- void UpdateForInsertedWaterBlock(MachineBasicBlock *NewBB);
- void AdjustBBOffsetsAfter(MachineBasicBlock *BB, int delta);
- bool DecrementOldEntry(unsigned CPI, MachineInstr* CPEMI);
- int LookForExistingCPEntry(CPUser& U, unsigned UserOffset);
- bool LookForWater(CPUser&U, unsigned UserOffset,
- MachineBasicBlock** NewMBB);
- MachineBasicBlock* AcceptWater(MachineBasicBlock *WaterBB,
- std::vector<MachineBasicBlock*>::iterator IP);
- void CreateNewWater(unsigned CPUserIndex, unsigned UserOffset,
- MachineBasicBlock** NewMBB);
- bool HandleConstantPoolUser(MachineFunction &Fn, unsigned CPUserIndex);
- void RemoveDeadCPEMI(MachineInstr *CPEMI);
- bool RemoveUnusedCPEntries();
- bool CPEIsInRange(MachineInstr *MI, unsigned UserOffset,
- MachineInstr *CPEMI, unsigned Disp,
- bool DoDump);
- bool WaterIsInRange(unsigned UserOffset, MachineBasicBlock *Water,
- CPUser &U);
- bool OffsetIsInRange(unsigned UserOffset, unsigned TrialOffset,
- unsigned Disp, bool NegativeOK);
- bool BBIsInRange(MachineInstr *MI, MachineBasicBlock *BB, unsigned Disp);
- bool FixUpImmediateBr(MachineFunction &Fn, ImmBranch &Br);
- bool FixUpConditionalBr(MachineFunction &Fn, ImmBranch &Br);
- bool FixUpUnconditionalBr(MachineFunction &Fn, ImmBranch &Br);
- bool UndoLRSpillRestore();
-
- unsigned GetOffsetOf(MachineInstr *MI) const;
- void dumpBBs();
- void verify(MachineFunction &Fn);
- };
- char ARMConstantIslands::ID = 0;
-}
-
-/// verify - check BBOffsets, BBSizes, alignment of islands
-void ARMConstantIslands::verify(MachineFunction &Fn) {
- assert(BBOffsets.size() == BBSizes.size());
- for (unsigned i = 1, e = BBOffsets.size(); i != e; ++i)
- assert(BBOffsets[i-1]+BBSizes[i-1] == BBOffsets[i]);
- if (isThumb) {
- for (MachineFunction::iterator MBBI = Fn.begin(), E = Fn.end();
- MBBI != E; ++MBBI) {
- MachineBasicBlock *MBB = MBBI;
- if (!MBB->empty() &&
- MBB->begin()->getOpcode() == ARM::CONSTPOOL_ENTRY)
- assert((BBOffsets[MBB->getNumber()]%4 == 0 &&
- BBSizes[MBB->getNumber()]%4 == 0) ||
- (BBOffsets[MBB->getNumber()]%4 != 0 &&
- BBSizes[MBB->getNumber()]%4 != 0));
- }
- }
-}
-
-/// print block size and offset information - debugging
-void ARMConstantIslands::dumpBBs() {
- for (unsigned J = 0, E = BBOffsets.size(); J !=E; ++J) {
- DOUT << "block " << J << " offset " << BBOffsets[J] <<
- " size " << BBSizes[J] << "\n";
- }
-}
-
-/// createARMConstantIslandPass - returns an instance of the constpool
-/// island pass.
-FunctionPass *llvm::createARMConstantIslandPass() {
- return new ARMConstantIslands();
-}
-
-bool ARMConstantIslands::runOnMachineFunction(MachineFunction &Fn) {
- MachineConstantPool &MCP = *Fn.getConstantPool();
-
- TII = Fn.getTarget().getInstrInfo();
- AFI = Fn.getInfo<ARMFunctionInfo>();
- isThumb = AFI->isThumbFunction();
-
- HasFarJump = false;
-
- // Renumber all of the machine basic blocks in the function, guaranteeing that
- // the numbers agree with the position of the block in the function.
- Fn.RenumberBlocks();
-
- /// Thumb functions containing constant pools get 2-byte alignment. This is so
- /// we can keep exact track of where the alignment padding goes. Set default.
- AFI->setAlign(isThumb ? 1U : 2U);
-
- // Perform the initial placement of the constant pool entries. To start with,
- // we put them all at the end of the function.
- std::vector<MachineInstr*> CPEMIs;
- if (!MCP.isEmpty()) {
- DoInitialPlacement(Fn, CPEMIs);
- if (isThumb)
- AFI->setAlign(2U);
- }
-
- /// The next UID to take is the first unused one.
- NextUID = CPEMIs.size();
-
- // Do the initial scan of the function, building up information about the
- // sizes of each block, the location of all the water, and finding all of the
- // constant pool users.
- InitialFunctionScan(Fn, CPEMIs);
- CPEMIs.clear();
-
- /// Remove dead constant pool entries.
- RemoveUnusedCPEntries();
-
- // Iteratively place constant pool entries and fix up branches until there
- // is no change.
- bool MadeChange = false;
- while (true) {
- bool Change = false;
- for (unsigned i = 0, e = CPUsers.size(); i != e; ++i)
- Change |= HandleConstantPoolUser(Fn, i);
- DEBUG(dumpBBs());
- for (unsigned i = 0, e = ImmBranches.size(); i != e; ++i)
- Change |= FixUpImmediateBr(Fn, ImmBranches[i]);
- DEBUG(dumpBBs());
- if (!Change)
- break;
- MadeChange = true;
- }
-
- // After a while, this might be made debug-only, but it is not expensive.
- verify(Fn);
-
- // If LR has been forced spilled and no far jumps (i.e. BL) has been issued.
- // Undo the spill / restore of LR if possible.
- if (!HasFarJump && AFI->isLRSpilledForFarJump() && isThumb)
- MadeChange |= UndoLRSpillRestore();
-
- BBSizes.clear();
- BBOffsets.clear();
- WaterList.clear();
- CPUsers.clear();
- CPEntries.clear();
- ImmBranches.clear();
- PushPopMIs.clear();
-
- return MadeChange;
-}
-
-/// DoInitialPlacement - Perform the initial placement of the constant pool
-/// entries. To start with, we put them all at the end of the function.
-void ARMConstantIslands::DoInitialPlacement(MachineFunction &Fn,
- std::vector<MachineInstr*> &CPEMIs){
- // Create the basic block to hold the CPE's.
- MachineBasicBlock *BB = new MachineBasicBlock();
- Fn.getBasicBlockList().push_back(BB);
-
- // Add all of the constants from the constant pool to the end block, use an
- // identity mapping of CPI's to CPE's.
- const std::vector<MachineConstantPoolEntry> &CPs =
- Fn.getConstantPool()->getConstants();
-
- const TargetData &TD = *Fn.getTarget().getTargetData();
- for (unsigned i = 0, e = CPs.size(); i != e; ++i) {
- unsigned Size = TD.getABITypeSize(CPs[i].getType());
- // Verify that all constant pool entries are a multiple of 4 bytes. If not,
- // we would have to pad them out or something so that instructions stay
- // aligned.
- assert((Size & 3) == 0 && "CP Entry not multiple of 4 bytes!");
- MachineInstr *CPEMI =
- BuildMI(BB, TII->get(ARM::CONSTPOOL_ENTRY))
- .addImm(i).addConstantPoolIndex(i).addImm(Size);
- CPEMIs.push_back(CPEMI);
-
- // Add a new CPEntry, but no corresponding CPUser yet.
- std::vector<CPEntry> CPEs;
- CPEs.push_back(CPEntry(CPEMI, i));
- CPEntries.push_back(CPEs);
- NumCPEs++;
- DOUT << "Moved CPI#" << i << " to end of function as #" << i << "\n";
- }
-}
-
-/// BBHasFallthrough - Return true if the specified basic block can fallthrough
-/// into the block immediately after it.
-static bool BBHasFallthrough(MachineBasicBlock *MBB) {
- // Get the next machine basic block in the function.
- MachineFunction::iterator MBBI = MBB;
- if (next(MBBI) == MBB->getParent()->end()) // Can't fall off end of function.
- return false;
-
- MachineBasicBlock *NextBB = next(MBBI);
- for (MachineBasicBlock::succ_iterator I = MBB->succ_begin(),
- E = MBB->succ_end(); I != E; ++I)
- if (*I == NextBB)
- return true;
-
- return false;
-}
-
-/// findConstPoolEntry - Given the constpool index and CONSTPOOL_ENTRY MI,
-/// look up the corresponding CPEntry.
-ARMConstantIslands::CPEntry
-*ARMConstantIslands::findConstPoolEntry(unsigned CPI,
- const MachineInstr *CPEMI) {
- std::vector<CPEntry> &CPEs = CPEntries[CPI];
- // Number of entries per constpool index should be small, just do a
- // linear search.
- for (unsigned i = 0, e = CPEs.size(); i != e; ++i) {
- if (CPEs[i].CPEMI == CPEMI)
- return &CPEs[i];
- }
- return NULL;
-}
-
-/// InitialFunctionScan - Do the initial scan of the function, building up
-/// information about the sizes of each block, the location of all the water,
-/// and finding all of the constant pool users.
-void ARMConstantIslands::InitialFunctionScan(MachineFunction &Fn,
- const std::vector<MachineInstr*> &CPEMIs) {
- unsigned Offset = 0;
- for (MachineFunction::iterator MBBI = Fn.begin(), E = Fn.end();
- MBBI != E; ++MBBI) {
- MachineBasicBlock &MBB = *MBBI;
-
- // If this block doesn't fall through into the next MBB, then this is
- // 'water' that a constant pool island could be placed.
- if (!BBHasFallthrough(&MBB))
- WaterList.push_back(&MBB);
-
- unsigned MBBSize = 0;
- for (MachineBasicBlock::iterator I = MBB.begin(), E = MBB.end();
- I != E; ++I) {
- // Add instruction size to MBBSize.
- MBBSize += TII->GetInstSizeInBytes(I);
-
- int Opc = I->getOpcode();
- if (I->getDesc().isBranch()) {
- bool isCond = false;
- unsigned Bits = 0;
- unsigned Scale = 1;
- int UOpc = Opc;
- switch (Opc) {
- case ARM::tBR_JTr:
- // A Thumb table jump may involve padding; for the offsets to
- // be right, functions containing these must be 4-byte aligned.
- AFI->setAlign(2U);
- if ((Offset+MBBSize)%4 != 0)
- MBBSize += 2; // padding
- continue; // Does not get an entry in ImmBranches
- default:
- continue; // Ignore other JT branches
- case ARM::Bcc:
- isCond = true;
- UOpc = ARM::B;
- // Fallthrough
- case ARM::B:
- Bits = 24;
- Scale = 4;
- break;
- case ARM::tBcc:
- isCond = true;
- UOpc = ARM::tB;
- Bits = 8;
- Scale = 2;
- break;
- case ARM::tB:
- Bits = 11;
- Scale = 2;
- break;
- }
-
- // Record this immediate branch.
- unsigned MaxOffs = ((1 << (Bits-1))-1) * Scale;
- ImmBranches.push_back(ImmBranch(I, MaxOffs, isCond, UOpc));
- }
-
- if (Opc == ARM::tPUSH || Opc == ARM::tPOP_RET)
- PushPopMIs.push_back(I);
-
- // Scan the instructions for constant pool operands.
- for (unsigned op = 0, e = I->getNumOperands(); op != e; ++op)
- if (I->getOperand(op).isConstantPoolIndex()) {
- // We found one. The addressing mode tells us the max displacement
- // from the PC that this instruction permits.
-
- // Basic size info comes from the TSFlags field.
- unsigned Bits = 0;
- unsigned Scale = 1;
- unsigned TSFlags = I->getDesc().TSFlags;
- switch (TSFlags & ARMII::AddrModeMask) {
- default:
- // Constant pool entries can reach anything.
- if (I->getOpcode() == ARM::CONSTPOOL_ENTRY)
- continue;
- if (I->getOpcode() == ARM::tLEApcrel) {
- Bits = 8; // Taking the address of a CP entry.
- break;
- }
- assert(0 && "Unknown addressing mode for CP reference!");
- case ARMII::AddrMode1: // AM1: 8 bits << 2
- Bits = 8;
- Scale = 4; // Taking the address of a CP entry.
- break;
- case ARMII::AddrMode2:
- Bits = 12; // +-offset_12
- break;
- case ARMII::AddrMode3:
- Bits = 8; // +-offset_8
- break;
- // addrmode4 has no immediate offset.
- case ARMII::AddrMode5:
- Bits = 8;
- Scale = 4; // +-(offset_8*4)
- break;
- case ARMII::AddrModeT1:
- Bits = 5; // +offset_5
- break;
- case ARMII::AddrModeT2:
- Bits = 5;
- Scale = 2; // +(offset_5*2)
- break;
- case ARMII::AddrModeT4:
- Bits = 5;
- Scale = 4; // +(offset_5*4)
- break;
- case ARMII::AddrModeTs:
- Bits = 8;
- Scale = 4; // +(offset_8*4)
- break;
- }
-
- // Remember that this is a user of a CP entry.
- unsigned CPI = I->getOperand(op).getIndex();
- MachineInstr *CPEMI = CPEMIs[CPI];
- unsigned MaxOffs = ((1 << Bits)-1) * Scale;
- CPUsers.push_back(CPUser(I, CPEMI, MaxOffs));
-
- // Increment corresponding CPEntry reference count.
- CPEntry *CPE = findConstPoolEntry(CPI, CPEMI);
- assert(CPE && "Cannot find a corresponding CPEntry!");
- CPE->RefCount++;
-
- // Instructions can only use one CP entry, don't bother scanning the
- // rest of the operands.
- break;
- }
- }
-
- // In thumb mode, if this block is a constpool island, we may need padding
- // so it's aligned on 4 byte boundary.
- if (isThumb &&
- !MBB.empty() &&
- MBB.begin()->getOpcode() == ARM::CONSTPOOL_ENTRY &&
- (Offset%4) != 0)
- MBBSize += 2;
-
- BBSizes.push_back(MBBSize);
- BBOffsets.push_back(Offset);
- Offset += MBBSize;
- }
-}
-
-/// GetOffsetOf - Return the current offset of the specified machine instruction
-/// from the start of the function. This offset changes as stuff is moved
-/// around inside the function.
-unsigned ARMConstantIslands::GetOffsetOf(MachineInstr *MI) const {
- MachineBasicBlock *MBB = MI->getParent();
-
- // The offset is composed of two things: the sum of the sizes of all MBB's
- // before this instruction's block, and the offset from the start of the block
- // it is in.
- unsigned Offset = BBOffsets[MBB->getNumber()];
-
- // If we're looking for a CONSTPOOL_ENTRY in Thumb, see if this block has
- // alignment padding, and compensate if so.
- if (isThumb &&
- MI->getOpcode() == ARM::CONSTPOOL_ENTRY &&
- Offset%4 != 0)
- Offset += 2;
-
- // Sum instructions before MI in MBB.
- for (MachineBasicBlock::iterator I = MBB->begin(); ; ++I) {
- assert(I != MBB->end() && "Didn't find MI in its own basic block?");
- if (&*I == MI) return Offset;
- Offset += TII->GetInstSizeInBytes(I);
- }
-}
-
-/// CompareMBBNumbers - Little predicate function to sort the WaterList by MBB
-/// ID.
-static bool CompareMBBNumbers(const MachineBasicBlock *LHS,
- const MachineBasicBlock *RHS) {
- return LHS->getNumber() < RHS->getNumber();
-}
-
-/// UpdateForInsertedWaterBlock - When a block is newly inserted into the
-/// machine function, it upsets all of the block numbers. Renumber the blocks
-/// and update the arrays that parallel this numbering.
-void ARMConstantIslands::UpdateForInsertedWaterBlock(MachineBasicBlock *NewBB) {
- // Renumber the MBB's to keep them consequtive.
- NewBB->getParent()->RenumberBlocks(NewBB);
-
- // Insert a size into BBSizes to align it properly with the (newly
- // renumbered) block numbers.
- BBSizes.insert(BBSizes.begin()+NewBB->getNumber(), 0);
-
- // Likewise for BBOffsets.
- BBOffsets.insert(BBOffsets.begin()+NewBB->getNumber(), 0);
-
- // Next, update WaterList. Specifically, we need to add NewMBB as having
- // available water after it.
- std::vector<MachineBasicBlock*>::iterator IP =
- std::lower_bound(WaterList.begin(), WaterList.end(), NewBB,
- CompareMBBNumbers);
- WaterList.insert(IP, NewBB);
-}
-
-
-/// Split the basic block containing MI into two blocks, which are joined by
-/// an unconditional branch. Update datastructures and renumber blocks to
-/// account for this change and returns the newly created block.
-MachineBasicBlock *ARMConstantIslands::SplitBlockBeforeInstr(MachineInstr *MI) {
- MachineBasicBlock *OrigBB = MI->getParent();
-
- // Create a new MBB for the code after the OrigBB.
- MachineBasicBlock *NewBB = new MachineBasicBlock(OrigBB->getBasicBlock());
- MachineFunction::iterator MBBI = OrigBB; ++MBBI;
- OrigBB->getParent()->getBasicBlockList().insert(MBBI, NewBB);
-
- // Splice the instructions starting with MI over to NewBB.
- NewBB->splice(NewBB->end(), OrigBB, MI, OrigBB->end());
-
- // Add an unconditional branch from OrigBB to NewBB.
- // Note the new unconditional branch is not being recorded.
- BuildMI(OrigBB, TII->get(isThumb ? ARM::tB : ARM::B)).addMBB(NewBB);
- NumSplit++;
-
- // Update the CFG. All succs of OrigBB are now succs of NewBB.
- while (!OrigBB->succ_empty()) {
- MachineBasicBlock *Succ = *OrigBB->succ_begin();
- OrigBB->removeSuccessor(Succ);
- NewBB->addSuccessor(Succ);
-
- // This pass should be run after register allocation, so there should be no
- // PHI nodes to update.
- assert((Succ->empty() || Succ->begin()->getOpcode() != TargetInstrInfo::PHI)
- && "PHI nodes should be eliminated by now!");
- }
-
- // OrigBB branches to NewBB.
- OrigBB->addSuccessor(NewBB);
-
- // Update internal data structures to account for the newly inserted MBB.
- // This is almost the same as UpdateForInsertedWaterBlock, except that
- // the Water goes after OrigBB, not NewBB.
- NewBB->getParent()->RenumberBlocks(NewBB);
-
- // Insert a size into BBSizes to align it properly with the (newly
- // renumbered) block numbers.
- BBSizes.insert(BBSizes.begin()+NewBB->getNumber(), 0);
-
- // Likewise for BBOffsets.
- BBOffsets.insert(BBOffsets.begin()+NewBB->getNumber(), 0);
-
- // Next, update WaterList. Specifically, we need to add OrigMBB as having
- // available water after it (but not if it's already there, which happens
- // when splitting before a conditional branch that is followed by an
- // unconditional branch - in that case we want to insert NewBB).
- std::vector<MachineBasicBlock*>::iterator IP =
- std::lower_bound(WaterList.begin(), WaterList.end(), OrigBB,
- CompareMBBNumbers);
- MachineBasicBlock* WaterBB = *IP;
- if (WaterBB == OrigBB)
- WaterList.insert(next(IP), NewBB);
- else
- WaterList.insert(IP, OrigBB);
-
- // Figure out how large the first NewMBB is. (It cannot
- // contain a constpool_entry or tablejump.)
- unsigned NewBBSize = 0;
- for (MachineBasicBlock::iterator I = NewBB->begin(), E = NewBB->end();
- I != E; ++I)
- NewBBSize += TII->GetInstSizeInBytes(I);
-
- unsigned OrigBBI = OrigBB->getNumber();
- unsigned NewBBI = NewBB->getNumber();
- // Set the size of NewBB in BBSizes.
- BBSizes[NewBBI] = NewBBSize;
-
- // We removed instructions from UserMBB, subtract that off from its size.
- // Add 2 or 4 to the block to count the unconditional branch we added to it.
- unsigned delta = isThumb ? 2 : 4;
- BBSizes[OrigBBI] -= NewBBSize - delta;
-
- // ...and adjust BBOffsets for NewBB accordingly.
- BBOffsets[NewBBI] = BBOffsets[OrigBBI] + BBSizes[OrigBBI];
-
- // All BBOffsets following these blocks must be modified.
- AdjustBBOffsetsAfter(NewBB, delta);
-
- return NewBB;
-}
-
-/// OffsetIsInRange - Checks whether UserOffset (the location of a constant pool
-/// reference) is within MaxDisp of TrialOffset (a proposed location of a
-/// constant pool entry).
-bool ARMConstantIslands::OffsetIsInRange(unsigned UserOffset,
- unsigned TrialOffset, unsigned MaxDisp, bool NegativeOK) {
- // On Thumb offsets==2 mod 4 are rounded down by the hardware for
- // purposes of the displacement computation; compensate for that here.
- // Effectively, the valid range of displacements is 2 bytes smaller for such
- // references.
- if (isThumb && UserOffset%4 !=0)
- UserOffset -= 2;
- // CPEs will be rounded up to a multiple of 4.
- if (isThumb && TrialOffset%4 != 0)
- TrialOffset += 2;
-
- if (UserOffset <= TrialOffset) {
- // User before the Trial.
- if (TrialOffset-UserOffset <= MaxDisp)
- return true;
- } else if (NegativeOK) {
- if (UserOffset-TrialOffset <= MaxDisp)
- return true;
- }
- return false;
-}
-
-/// WaterIsInRange - Returns true if a CPE placed after the specified
-/// Water (a basic block) will be in range for the specific MI.
-
-bool ARMConstantIslands::WaterIsInRange(unsigned UserOffset,
- MachineBasicBlock* Water, CPUser &U)
-{
- unsigned MaxDisp = U.MaxDisp;
- MachineFunction::iterator I = next(MachineFunction::iterator(Water));
- unsigned CPEOffset = BBOffsets[Water->getNumber()] +
- BBSizes[Water->getNumber()];
-
- // If the CPE is to be inserted before the instruction, that will raise
- // the offset of the instruction. (Currently applies only to ARM, so
- // no alignment compensation attempted here.)
- if (CPEOffset < UserOffset)
- UserOffset += U.CPEMI->getOperand(2).getImm();
-
- return OffsetIsInRange (UserOffset, CPEOffset, MaxDisp, !isThumb);
-}
-
-/// CPEIsInRange - Returns true if the distance between specific MI and
-/// specific ConstPool entry instruction can fit in MI's displacement field.
-bool ARMConstantIslands::CPEIsInRange(MachineInstr *MI, unsigned UserOffset,
- MachineInstr *CPEMI,
- unsigned MaxDisp, bool DoDump) {
- unsigned CPEOffset = GetOffsetOf(CPEMI);
- assert(CPEOffset%4 == 0 && "Misaligned CPE");
-
- if (DoDump) {
- DOUT << "User of CPE#" << CPEMI->getOperand(0).getImm()
- << " max delta=" << MaxDisp
- << " insn address=" << UserOffset
- << " CPE address=" << CPEOffset
- << " offset=" << int(CPEOffset-UserOffset) << "\t" << *MI;
- }
-
- return OffsetIsInRange(UserOffset, CPEOffset, MaxDisp, !isThumb);
-}
-
-/// BBIsJumpedOver - Return true of the specified basic block's only predecessor
-/// unconditionally branches to its only successor.
-static bool BBIsJumpedOver(MachineBasicBlock *MBB) {
- if (MBB->pred_size() != 1 || MBB->succ_size() != 1)
- return false;
-
- MachineBasicBlock *Succ = *MBB->succ_begin();
- MachineBasicBlock *Pred = *MBB->pred_begin();
- MachineInstr *PredMI = &Pred->back();
- if (PredMI->getOpcode() == ARM::B || PredMI->getOpcode() == ARM::tB)
- return PredMI->getOperand(0).getMBB() == Succ;
- return false;
-}
-
-void ARMConstantIslands::AdjustBBOffsetsAfter(MachineBasicBlock *BB,
- int delta) {
- MachineFunction::iterator MBBI = BB; MBBI = next(MBBI);
- for(unsigned i=BB->getNumber()+1; i<BB->getParent()->getNumBlockIDs(); i++) {
- BBOffsets[i] += delta;
- // If some existing blocks have padding, adjust the padding as needed, a
- // bit tricky. delta can be negative so don't use % on that.
- if (isThumb) {
- MachineBasicBlock *MBB = MBBI;
- if (!MBB->empty()) {
- // Constant pool entries require padding.
- if (MBB->begin()->getOpcode() == ARM::CONSTPOOL_ENTRY) {
- unsigned oldOffset = BBOffsets[i] - delta;
- if (oldOffset%4==0 && BBOffsets[i]%4!=0) {
- // add new padding
- BBSizes[i] += 2;
- delta += 2;
- } else if (oldOffset%4!=0 && BBOffsets[i]%4==0) {
- // remove existing padding
- BBSizes[i] -=2;
- delta -= 2;
- }
- }
- // Thumb jump tables require padding. They should be at the end;
- // following unconditional branches are removed by AnalyzeBranch.
- MachineInstr *ThumbJTMI = NULL;
- if (prior(MBB->end())->getOpcode() == ARM::tBR_JTr)
- ThumbJTMI = prior(MBB->end());
- if (ThumbJTMI) {
- unsigned newMIOffset = GetOffsetOf(ThumbJTMI);
- unsigned oldMIOffset = newMIOffset - delta;
- if (oldMIOffset%4 == 0 && newMIOffset%4 != 0) {
- // remove existing padding
- BBSizes[i] -= 2;
- delta -= 2;
- } else if (oldMIOffset%4 != 0 && newMIOffset%4 == 0) {
- // add new padding
- BBSizes[i] += 2;
- delta += 2;
- }
- }
- if (delta==0)
- return;
- }
- MBBI = next(MBBI);
- }
- }
-}
-
-/// DecrementOldEntry - find the constant pool entry with index CPI
-/// and instruction CPEMI, and decrement its refcount. If the refcount
-/// becomes 0 remove the entry and instruction. Returns true if we removed
-/// the entry, false if we didn't.
-
-bool ARMConstantIslands::DecrementOldEntry(unsigned CPI, MachineInstr *CPEMI) {
- // Find the old entry. Eliminate it if it is no longer used.
- CPEntry *CPE = findConstPoolEntry(CPI, CPEMI);
- assert(CPE && "Unexpected!");
- if (--CPE->RefCount == 0) {
- RemoveDeadCPEMI(CPEMI);
- CPE->CPEMI = NULL;
- NumCPEs--;
- return true;
- }
- return false;
-}
-
-/// LookForCPEntryInRange - see if the currently referenced CPE is in range;
-/// if not, see if an in-range clone of the CPE is in range, and if so,
-/// change the data structures so the user references the clone. Returns:
-/// 0 = no existing entry found
-/// 1 = entry found, and there were no code insertions or deletions
-/// 2 = entry found, and there were code insertions or deletions
-int ARMConstantIslands::LookForExistingCPEntry(CPUser& U, unsigned UserOffset)
-{
- MachineInstr *UserMI = U.MI;
- MachineInstr *CPEMI = U.CPEMI;
-
- // Check to see if the CPE is already in-range.
- if (CPEIsInRange(UserMI, UserOffset, CPEMI, U.MaxDisp, true)) {
- DOUT << "In range\n";
- return 1;
- }
-
- // No. Look for previously created clones of the CPE that are in range.
- unsigned CPI = CPEMI->getOperand(1).getIndex();
- std::vector<CPEntry> &CPEs = CPEntries[CPI];
- for (unsigned i = 0, e = CPEs.size(); i != e; ++i) {
- // We already tried this one
- if (CPEs[i].CPEMI == CPEMI)
- continue;
- // Removing CPEs can leave empty entries, skip
- if (CPEs[i].CPEMI == NULL)
- continue;
- if (CPEIsInRange(UserMI, UserOffset, CPEs[i].CPEMI, U.MaxDisp, false)) {
- DOUT << "Replacing CPE#" << CPI << " with CPE#" << CPEs[i].CPI << "\n";
- // Point the CPUser node to the replacement
- U.CPEMI = CPEs[i].CPEMI;
- // Change the CPI in the instruction operand to refer to the clone.
- for (unsigned j = 0, e = UserMI->getNumOperands(); j != e; ++j)
- if (UserMI->getOperand(j).isConstantPoolIndex()) {
- UserMI->getOperand(j).setIndex(CPEs[i].CPI);
- break;
- }
- // Adjust the refcount of the clone...
- CPEs[i].RefCount++;
- // ...and the original. If we didn't remove the old entry, none of the
- // addresses changed, so we don't need another pass.
- return DecrementOldEntry(CPI, CPEMI) ? 2 : 1;
- }
- }
- return 0;
-}
-
-/// getUnconditionalBrDisp - Returns the maximum displacement that can fit in
-/// the specific unconditional branch instruction.
-static inline unsigned getUnconditionalBrDisp(int Opc) {
- return (Opc == ARM::tB) ? ((1<<10)-1)*2 : ((1<<23)-1)*4;
-}
-
-/// AcceptWater - Small amount of common code factored out of the following.
-
-MachineBasicBlock* ARMConstantIslands::AcceptWater(MachineBasicBlock *WaterBB,
- std::vector<MachineBasicBlock*>::iterator IP) {
- DOUT << "found water in range\n";
- // Remove the original WaterList entry; we want subsequent
- // insertions in this vicinity to go after the one we're
- // about to insert. This considerably reduces the number
- // of times we have to move the same CPE more than once.
- WaterList.erase(IP);
- // CPE goes before following block (NewMBB).
- return next(MachineFunction::iterator(WaterBB));
-}
-
-/// LookForWater - look for an existing entry in the WaterList in which
-/// we can place the CPE referenced from U so it's within range of U's MI.
-/// Returns true if found, false if not. If it returns true, *NewMBB
-/// is set to the WaterList entry.
-/// For ARM, we prefer the water that's farthest away. For Thumb, prefer
-/// water that will not introduce padding to water that will; within each
-/// group, prefer the water that's farthest away.
-
-bool ARMConstantIslands::LookForWater(CPUser &U, unsigned UserOffset,
- MachineBasicBlock** NewMBB) {
- std::vector<MachineBasicBlock*>::iterator IPThatWouldPad;
- MachineBasicBlock* WaterBBThatWouldPad = NULL;
- if (!WaterList.empty()) {
- for (std::vector<MachineBasicBlock*>::iterator IP = prior(WaterList.end()),
- B = WaterList.begin();; --IP) {
- MachineBasicBlock* WaterBB = *IP;
- if (WaterIsInRange(UserOffset, WaterBB, U)) {
- if (isThumb &&
- (BBOffsets[WaterBB->getNumber()] +
- BBSizes[WaterBB->getNumber()])%4 != 0) {
- // This is valid Water, but would introduce padding. Remember
- // it in case we don't find any Water that doesn't do this.
- if (!WaterBBThatWouldPad) {
- WaterBBThatWouldPad = WaterBB;
- IPThatWouldPad = IP;
- }
- } else {
- *NewMBB = AcceptWater(WaterBB, IP);
- return true;
- }
- }
- if (IP == B)
- break;
- }
- }
- if (isThumb && WaterBBThatWouldPad) {
- *NewMBB = AcceptWater(WaterBBThatWouldPad, IPThatWouldPad);
- return true;
- }
- return false;
-}
-
-/// CreateNewWater - No existing WaterList entry will work for
-/// CPUsers[CPUserIndex], so create a place to put the CPE. The end of the
-/// block is used if in range, and the conditional branch munged so control
-/// flow is correct. Otherwise the block is split to create a hole with an
-/// unconditional branch around it. In either case *NewMBB is set to a
-/// block following which the new island can be inserted (the WaterList
-/// is not adjusted).
-
-void ARMConstantIslands::CreateNewWater(unsigned CPUserIndex,
- unsigned UserOffset, MachineBasicBlock** NewMBB) {
- CPUser &U = CPUsers[CPUserIndex];
- MachineInstr *UserMI = U.MI;
- MachineInstr *CPEMI = U.CPEMI;
- MachineBasicBlock *UserMBB = UserMI->getParent();
- unsigned OffsetOfNextBlock = BBOffsets[UserMBB->getNumber()] +
- BBSizes[UserMBB->getNumber()];
- assert(OffsetOfNextBlock== BBOffsets[UserMBB->getNumber()+1]);
-
- // If the use is at the end of the block, or the end of the block
- // is within range, make new water there. (The addition below is
- // for the unconditional branch we will be adding: 4 bytes on ARM,
- // 2 on Thumb. Possible Thumb alignment padding is allowed for
- // inside OffsetIsInRange.
- // If the block ends in an unconditional branch already, it is water,
- // and is known to be out of range, so we'll always be adding a branch.)
- if (&UserMBB->back() == UserMI ||
- OffsetIsInRange(UserOffset, OffsetOfNextBlock + (isThumb ? 2: 4),
- U.MaxDisp, !isThumb)) {
- DOUT << "Split at end of block\n";
- if (&UserMBB->back() == UserMI)
- assert(BBHasFallthrough(UserMBB) && "Expected a fallthrough BB!");
- *NewMBB = next(MachineFunction::iterator(UserMBB));
- // Add an unconditional branch from UserMBB to fallthrough block.
- // Record it for branch lengthening; this new branch will not get out of
- // range, but if the preceding conditional branch is out of range, the
- // targets will be exchanged, and the altered branch may be out of
- // range, so the machinery has to know about it.
- int UncondBr = isThumb ? ARM::tB : ARM::B;
- BuildMI(UserMBB, TII->get(UncondBr)).addMBB(*NewMBB);
- unsigned MaxDisp = getUnconditionalBrDisp(UncondBr);
- ImmBranches.push_back(ImmBranch(&UserMBB->back(),
- MaxDisp, false, UncondBr));
- int delta = isThumb ? 2 : 4;
- BBSizes[UserMBB->getNumber()] += delta;
- AdjustBBOffsetsAfter(UserMBB, delta);
- } else {
- // What a big block. Find a place within the block to split it.
- // This is a little tricky on Thumb since instructions are 2 bytes
- // and constant pool entries are 4 bytes: if instruction I references
- // island CPE, and instruction I+1 references CPE', it will
- // not work well to put CPE as far forward as possible, since then
- // CPE' cannot immediately follow it (that location is 2 bytes
- // farther away from I+1 than CPE was from I) and we'd need to create
- // a new island. So, we make a first guess, then walk through the
- // instructions between the one currently being looked at and the
- // possible insertion point, and make sure any other instructions
- // that reference CPEs will be able to use the same island area;
- // if not, we back up the insertion point.
-
- // The 4 in the following is for the unconditional branch we'll be
- // inserting (allows for long branch on Thumb). Alignment of the
- // island is handled inside OffsetIsInRange.
- unsigned BaseInsertOffset = UserOffset + U.MaxDisp -4;
- // This could point off the end of the block if we've already got
- // constant pool entries following this block; only the last one is
- // in the water list. Back past any possible branches (allow for a
- // conditional and a maximally long unconditional).
- if (BaseInsertOffset >= BBOffsets[UserMBB->getNumber()+1])
- BaseInsertOffset = BBOffsets[UserMBB->getNumber()+1] -
- (isThumb ? 6 : 8);
- unsigned EndInsertOffset = BaseInsertOffset +
- CPEMI->getOperand(2).getImm();
- MachineBasicBlock::iterator MI = UserMI;
- ++MI;
- unsigned CPUIndex = CPUserIndex+1;
- for (unsigned Offset = UserOffset+TII->GetInstSizeInBytes(UserMI);
- Offset < BaseInsertOffset;
- Offset += TII->GetInstSizeInBytes(MI),
- MI = next(MI)) {
- if (CPUIndex < CPUsers.size() && CPUsers[CPUIndex].MI == MI) {
- if (!OffsetIsInRange(Offset, EndInsertOffset,
- CPUsers[CPUIndex].MaxDisp, !isThumb)) {
- BaseInsertOffset -= (isThumb ? 2 : 4);
- EndInsertOffset -= (isThumb ? 2 : 4);
- }
- // This is overly conservative, as we don't account for CPEMIs
- // being reused within the block, but it doesn't matter much.
- EndInsertOffset += CPUsers[CPUIndex].CPEMI->getOperand(2).getImm();
- CPUIndex++;
- }
- }
- DOUT << "Split in middle of big block\n";
- *NewMBB = SplitBlockBeforeInstr(prior(MI));
- }
-}
-
-/// HandleConstantPoolUser - Analyze the specified user, checking to see if it
-/// is out-of-range. If so, pick it up the constant pool value and move it some
-/// place in-range. Return true if we changed any addresses (thus must run
-/// another pass of branch lengthening), false otherwise.
-bool ARMConstantIslands::HandleConstantPoolUser(MachineFunction &Fn,
- unsigned CPUserIndex){
- CPUser &U = CPUsers[CPUserIndex];
- MachineInstr *UserMI = U.MI;
- MachineInstr *CPEMI = U.CPEMI;
- unsigned CPI = CPEMI->getOperand(1).getIndex();
- unsigned Size = CPEMI->getOperand(2).getImm();
- MachineBasicBlock *NewMBB;
- // Compute this only once, it's expensive. The 4 or 8 is the value the
- // hardware keeps in the PC (2 insns ahead of the reference).
- unsigned UserOffset = GetOffsetOf(UserMI) + (isThumb ? 4 : 8);
-
- // Special case: tLEApcrel are two instructions MI's. The actual user is the
- // second instruction.
- if (UserMI->getOpcode() == ARM::tLEApcrel)
- UserOffset += 2;
-
- // See if the current entry is within range, or there is a clone of it
- // in range.
- int result = LookForExistingCPEntry(U, UserOffset);
- if (result==1) return false;
- else if (result==2) return true;
-
- // No existing clone of this CPE is within range.
- // We will be generating a new clone. Get a UID for it.
- unsigned ID = NextUID++;
-
- // Look for water where we can place this CPE. We look for the farthest one
- // away that will work. Forward references only for now (although later
- // we might find some that are backwards).
-
- if (!LookForWater(U, UserOffset, &NewMBB)) {
- // No water found.
- DOUT << "No water found\n";
- CreateNewWater(CPUserIndex, UserOffset, &NewMBB);
- }
-
- // Okay, we know we can put an island before NewMBB now, do it!
- MachineBasicBlock *NewIsland = new MachineBasicBlock();
- Fn.getBasicBlockList().insert(NewMBB, NewIsland);
-
- // Update internal data structures to account for the newly inserted MBB.
- UpdateForInsertedWaterBlock(NewIsland);
-
- // Decrement the old entry, and remove it if refcount becomes 0.
- DecrementOldEntry(CPI, CPEMI);
-
- // Now that we have an island to add the CPE to, clone the original CPE and
- // add it to the island.
- U.CPEMI = BuildMI(NewIsland, TII->get(ARM::CONSTPOOL_ENTRY))
- .addImm(ID).addConstantPoolIndex(CPI).addImm(Size);
- CPEntries[CPI].push_back(CPEntry(U.CPEMI, ID, 1));
- NumCPEs++;
-
- BBOffsets[NewIsland->getNumber()] = BBOffsets[NewMBB->getNumber()];
- // Compensate for .align 2 in thumb mode.
- if (isThumb && BBOffsets[NewIsland->getNumber()]%4 != 0)
- Size += 2;
- // Increase the size of the island block to account for the new entry.
- BBSizes[NewIsland->getNumber()] += Size;
- AdjustBBOffsetsAfter(NewIsland, Size);
-
- // Finally, change the CPI in the instruction operand to be ID.
- for (unsigned i = 0, e = UserMI->getNumOperands(); i != e; ++i)
- if (UserMI->getOperand(i).isCPI()) {
- UserMI->getOperand(i).setIndex(ID);
- break;
- }
-
- DOUT << " Moved CPE to #" << ID << " CPI=" << CPI << "\t" << *UserMI;
-
- return true;
-}
-
-/// RemoveDeadCPEMI - Remove a dead constant pool entry instruction. Update
-/// sizes and offsets of impacted basic blocks.
-void ARMConstantIslands::RemoveDeadCPEMI(MachineInstr *CPEMI) {
- MachineBasicBlock *CPEBB = CPEMI->getParent();
- unsigned Size = CPEMI->getOperand(2).getImm();
- CPEMI->eraseFromParent();
- BBSizes[CPEBB->getNumber()] -= Size;
- // All succeeding offsets have the current size value added in, fix this.
- if (CPEBB->empty()) {
- // In thumb mode, the size of island may be padded by two to compensate for
- // the alignment requirement. Then it will now be 2 when the block is
- // empty, so fix this.
- // All succeeding offsets have the current size value added in, fix this.
- if (BBSizes[CPEBB->getNumber()] != 0) {
- Size += BBSizes[CPEBB->getNumber()];
- BBSizes[CPEBB->getNumber()] = 0;
- }
- }
- AdjustBBOffsetsAfter(CPEBB, -Size);
- // An island has only one predecessor BB and one successor BB. Check if
- // this BB's predecessor jumps directly to this BB's successor. This
- // shouldn't happen currently.
- assert(!BBIsJumpedOver(CPEBB) && "How did this happen?");
- // FIXME: remove the empty blocks after all the work is done?
-}
-
-/// RemoveUnusedCPEntries - Remove constant pool entries whose refcounts
-/// are zero.
-bool ARMConstantIslands::RemoveUnusedCPEntries() {
- unsigned MadeChange = false;
- for (unsigned i = 0, e = CPEntries.size(); i != e; ++i) {
- std::vector<CPEntry> &CPEs = CPEntries[i];
- for (unsigned j = 0, ee = CPEs.size(); j != ee; ++j) {
- if (CPEs[j].RefCount == 0 && CPEs[j].CPEMI) {
- RemoveDeadCPEMI(CPEs[j].CPEMI);
- CPEs[j].CPEMI = NULL;
- MadeChange = true;
- }
- }
- }
- return MadeChange;
-}
-
-/// BBIsInRange - Returns true if the distance between specific MI and
-/// specific BB can fit in MI's displacement field.
-bool ARMConstantIslands::BBIsInRange(MachineInstr *MI,MachineBasicBlock *DestBB,
- unsigned MaxDisp) {
- unsigned PCAdj = isThumb ? 4 : 8;
- unsigned BrOffset = GetOffsetOf(MI) + PCAdj;
- unsigned DestOffset = BBOffsets[DestBB->getNumber()];
-
- DOUT << "Branch of destination BB#" << DestBB->getNumber()
- << " from BB#" << MI->getParent()->getNumber()
- << " max delta=" << MaxDisp
- << " from " << GetOffsetOf(MI) << " to " << DestOffset
- << " offset " << int(DestOffset-BrOffset) << "\t" << *MI;
-
- if (BrOffset <= DestOffset) {
- // Branch before the Dest.
- if (DestOffset-BrOffset <= MaxDisp)
- return true;
- } else {
- if (BrOffset-DestOffset <= MaxDisp)
- return true;
- }
- return false;
-}
-
-/// FixUpImmediateBr - Fix up an immediate branch whose destination is too far
-/// away to fit in its displacement field.
-bool ARMConstantIslands::FixUpImmediateBr(MachineFunction &Fn, ImmBranch &Br) {
- MachineInstr *MI = Br.MI;
- MachineBasicBlock *DestBB = MI->getOperand(0).getMBB();
-
- // Check to see if the DestBB is already in-range.
- if (BBIsInRange(MI, DestBB, Br.MaxDisp))
- return false;
-
- if (!Br.isCond)
- return FixUpUnconditionalBr(Fn, Br);
- return FixUpConditionalBr(Fn, Br);
-}
-
-/// FixUpUnconditionalBr - Fix up an unconditional branch whose destination is
-/// too far away to fit in its displacement field. If the LR register has been
-/// spilled in the epilogue, then we can use BL to implement a far jump.
-/// Otherwise, add an intermediate branch instruction to to a branch.
-bool
-ARMConstantIslands::FixUpUnconditionalBr(MachineFunction &Fn, ImmBranch &Br) {
- MachineInstr *MI = Br.MI;
- MachineBasicBlock *MBB = MI->getParent();
- assert(isThumb && "Expected a Thumb function!");
-
- // Use BL to implement far jump.
- Br.MaxDisp = (1 << 21) * 2;
- MI->setDesc(TII->get(ARM::tBfar));
- BBSizes[MBB->getNumber()] += 2;
- AdjustBBOffsetsAfter(MBB, 2);
- HasFarJump = true;
- NumUBrFixed++;
-
- DOUT << " Changed B to long jump " << *MI;
-
- return true;
-}
-
-/// FixUpConditionalBr - Fix up a conditional branch whose destination is too
-/// far away to fit in its displacement field. It is converted to an inverse
-/// conditional branch + an unconditional branch to the destination.
-bool
-ARMConstantIslands::FixUpConditionalBr(MachineFunction &Fn, ImmBranch &Br) {
- MachineInstr *MI = Br.MI;
- MachineBasicBlock *DestBB = MI->getOperand(0).getMBB();
-
- // Add a unconditional branch to the destination and invert the branch
- // condition to jump over it:
- // blt L1
- // =>
- // bge L2
- // b L1
- // L2:
- ARMCC::CondCodes CC = (ARMCC::CondCodes)MI->getOperand(1).getImm();
- CC = ARMCC::getOppositeCondition(CC);
- unsigned CCReg = MI->getOperand(2).getReg();
-
- // If the branch is at the end of its MBB and that has a fall-through block,
- // direct the updated conditional branch to the fall-through block. Otherwise,
- // split the MBB before the next instruction.
- MachineBasicBlock *MBB = MI->getParent();
- MachineInstr *BMI = &MBB->back();
- bool NeedSplit = (BMI != MI) || !BBHasFallthrough(MBB);
-
- NumCBrFixed++;
- if (BMI != MI) {
- if (next(MachineBasicBlock::iterator(MI)) == MBB->back() &&
- BMI->getOpcode() == Br.UncondBr) {
- // Last MI in the BB is a unconditional branch. Can we simply invert the
- // condition and swap destinations:
- // beq L1
- // b L2
- // =>
- // bne L2
- // b L1
- MachineBasicBlock *NewDest = BMI->getOperand(0).getMBB();
- if (BBIsInRange(MI, NewDest, Br.MaxDisp)) {
- DOUT << " Invert Bcc condition and swap its destination with " << *BMI;
- BMI->getOperand(0).setMBB(DestBB);
- MI->getOperand(0).setMBB(NewDest);
- MI->getOperand(1).setImm(CC);
- return true;
- }
- }
- }
-
- if (NeedSplit) {
- SplitBlockBeforeInstr(MI);
- // No need for the branch to the next block. We're adding a unconditional
- // branch to the destination.
- int delta = TII->GetInstSizeInBytes(&MBB->back());
- BBSizes[MBB->getNumber()] -= delta;
- MachineBasicBlock* SplitBB = next(MachineFunction::iterator(MBB));
- AdjustBBOffsetsAfter(SplitBB, -delta);
- MBB->back().eraseFromParent();
- // BBOffsets[SplitBB] is wrong temporarily, fixed below
- }
- MachineBasicBlock *NextBB = next(MachineFunction::iterator(MBB));
-
- DOUT << " Insert B to BB#" << DestBB->getNumber()
- << " also invert condition and change dest. to BB#"
- << NextBB->getNumber() << "\n";
-
- // Insert a new conditional branch and a new unconditional branch.
- // Also update the ImmBranch as well as adding a new entry for the new branch.
- BuildMI(MBB, TII->get(MI->getOpcode())).addMBB(NextBB)
- .addImm(CC).addReg(CCReg);
- Br.MI = &MBB->back();
- BBSizes[MBB->getNumber()] += TII->GetInstSizeInBytes(&MBB->back());
- BuildMI(MBB, TII->get(Br.UncondBr)).addMBB(DestBB);
- BBSizes[MBB->getNumber()] += TII->GetInstSizeInBytes(&MBB->back());
- unsigned MaxDisp = getUnconditionalBrDisp(Br.UncondBr);
- ImmBranches.push_back(ImmBranch(&MBB->back(), MaxDisp, false, Br.UncondBr));
-
- // Remove the old conditional branch. It may or may not still be in MBB.
- BBSizes[MI->getParent()->getNumber()] -= TII->GetInstSizeInBytes(MI);
- MI->eraseFromParent();
-
- // The net size change is an addition of one unconditional branch.
- int delta = TII->GetInstSizeInBytes(&MBB->back());
- AdjustBBOffsetsAfter(MBB, delta);
- return true;
-}
-
-/// UndoLRSpillRestore - Remove Thumb push / pop instructions that only spills
-/// LR / restores LR to pc.
-bool ARMConstantIslands::UndoLRSpillRestore() {
- bool MadeChange = false;
- for (unsigned i = 0, e = PushPopMIs.size(); i != e; ++i) {
- MachineInstr *MI = PushPopMIs[i];
- if (MI->getOpcode() == ARM::tPOP_RET &&
- MI->getOperand(0).getReg() == ARM::PC &&
- MI->getNumExplicitOperands() == 1) {
- BuildMI(MI->getParent(), TII->get(ARM::tBX_RET));
- MI->eraseFromParent();
- MadeChange = true;
- }
- }
- return MadeChange;
-}
diff --git a/release_23/lib/Target/ARM/ARMConstantPoolValue.cpp b/release_23/lib/Target/ARM/ARMConstantPoolValue.cpp
deleted file mode 100644
index 6add3c38d377..000000000000
--- a/release_23/lib/Target/ARM/ARMConstantPoolValue.cpp
+++ /dev/null
@@ -1,90 +0,0 @@
-//===- ARMConstantPoolValue.cpp - ARM constantpool value --------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the ARM specific constantpool value class.
-//
-//===----------------------------------------------------------------------===//
-
-#include "ARMConstantPoolValue.h"
-#include "llvm/ADT/FoldingSet.h"
-#include "llvm/GlobalValue.h"
-#include "llvm/Type.h"
-using namespace llvm;
-
-ARMConstantPoolValue::ARMConstantPoolValue(GlobalValue *gv, unsigned id,
- ARMCP::ARMCPKind k,
- unsigned char PCAdj,
- const char *Modif,
- bool AddCA)
- : MachineConstantPoolValue((const Type*)gv->getType()),
- GV(gv), S(NULL), LabelId(id), Kind(k), PCAdjust(PCAdj),
- Modifier(Modif), AddCurrentAddress(AddCA) {}
-
-ARMConstantPoolValue::ARMConstantPoolValue(const char *s, unsigned id,
- ARMCP::ARMCPKind k,
- unsigned char PCAdj,
- const char *Modif,
- bool AddCA)
- : MachineConstantPoolValue((const Type*)Type::Int32Ty),
- GV(NULL), S(s), LabelId(id), Kind(k), PCAdjust(PCAdj),
- Modifier(Modif), AddCurrentAddress(AddCA) {}
-
-ARMConstantPoolValue::ARMConstantPoolValue(GlobalValue *gv,
- ARMCP::ARMCPKind k,
- const char *Modif)
- : MachineConstantPoolValue((const Type*)Type::Int32Ty),
- GV(gv), S(NULL), LabelId(0), Kind(k), PCAdjust(0),
- Modifier(Modif) {}
-
-int ARMConstantPoolValue::getExistingMachineCPValue(MachineConstantPool *CP,
- unsigned Alignment) {
- unsigned AlignMask = (1 << Alignment)-1;
- const std::vector<MachineConstantPoolEntry> Constants = CP->getConstants();
- for (unsigned i = 0, e = Constants.size(); i != e; ++i) {
- if (Constants[i].isMachineConstantPoolEntry() &&
- (Constants[i].Offset & AlignMask) == 0) {
- ARMConstantPoolValue *CPV =
- (ARMConstantPoolValue *)Constants[i].Val.MachineCPVal;
- if (CPV->GV == GV &&
- CPV->S == S &&
- CPV->LabelId == LabelId &&
- CPV->Kind == Kind &&
- CPV->PCAdjust == PCAdjust)
- return i;
- }
- }
-
- return -1;
-}
-
-void
-ARMConstantPoolValue::AddSelectionDAGCSEId(FoldingSetNodeID &ID) {
- ID.AddPointer(GV);
- ID.AddPointer(S);
- ID.AddInteger(LabelId);
- ID.AddInteger((unsigned)Kind);
- ID.AddInteger(PCAdjust);
-}
-
-void ARMConstantPoolValue::print(std::ostream &O) const {
- if (GV)
- O << GV->getName();
- else
- O << S;
- if (isNonLazyPointer()) O << "$non_lazy_ptr";
- else if (isStub()) O << "$stub";
- if (Modifier) O << "(" << Modifier << ")";
- if (PCAdjust != 0) {
- O << "-(LPIC" << LabelId << "+"
- << (unsigned)PCAdjust;
- if (AddCurrentAddress)
- O << "-.";
- O << ")";
- }
-}
diff --git a/release_23/lib/Target/ARM/ARMConstantPoolValue.h b/release_23/lib/Target/ARM/ARMConstantPoolValue.h
deleted file mode 100644
index db4c057a0a9a..000000000000
--- a/release_23/lib/Target/ARM/ARMConstantPoolValue.h
+++ /dev/null
@@ -1,75 +0,0 @@
-//===- ARMConstantPoolValue.h - ARM constantpool value ----------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the ARM specific constantpool value class.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_TARGET_ARM_CONSTANTPOOLVALUE_H
-#define LLVM_TARGET_ARM_CONSTANTPOOLVALUE_H
-
-#include "llvm/CodeGen/MachineConstantPool.h"
-
-namespace llvm {
-
-namespace ARMCP {
- enum ARMCPKind {
- CPValue,
- CPNonLazyPtr,
- CPStub
- };
-}
-
-/// ARMConstantPoolValue - ARM specific constantpool value. This is used to
-/// represent PC relative displacement between the address of the load
-/// instruction and the global value being loaded, i.e. (&GV-(LPIC+8)).
-class ARMConstantPoolValue : public MachineConstantPoolValue {
- GlobalValue *GV; // GlobalValue being loaded.
- const char *S; // ExtSymbol being loaded.
- unsigned LabelId; // Label id of the load.
- ARMCP::ARMCPKind Kind; // non_lazy_ptr or stub?
- unsigned char PCAdjust; // Extra adjustment if constantpool is pc relative.
- // 8 for ARM, 4 for Thumb.
- const char *Modifier; // GV modifier i.e. (&GV(modifier)-(LPIC+8))
- bool AddCurrentAddress;
-
-public:
- ARMConstantPoolValue(GlobalValue *gv, unsigned id,
- ARMCP::ARMCPKind Kind = ARMCP::CPValue,
- unsigned char PCAdj = 0, const char *Modifier = NULL,
- bool AddCurrentAddress = false);
- ARMConstantPoolValue(const char *s, unsigned id,
- ARMCP::ARMCPKind Kind = ARMCP::CPValue,
- unsigned char PCAdj = 0, const char *Modifier = NULL,
- bool AddCurrentAddress = false);
- ARMConstantPoolValue(GlobalValue *GV, ARMCP::ARMCPKind Kind,
- const char *Modifier);
-
-
- GlobalValue *getGV() const { return GV; }
- const char *getSymbol() const { return S; }
- const char *getModifier() const { return Modifier; }
- bool hasModifier() const { return Modifier != NULL; }
- bool mustAddCurrentAddress() const { return AddCurrentAddress; }
- unsigned getLabelId() const { return LabelId; }
- bool isNonLazyPointer() const { return Kind == ARMCP::CPNonLazyPtr; }
- bool isStub() const { return Kind == ARMCP::CPStub; }
- unsigned char getPCAdjustment() const { return PCAdjust; }
-
- virtual int getExistingMachineCPValue(MachineConstantPool *CP,
- unsigned Alignment);
-
- virtual void AddSelectionDAGCSEId(FoldingSetNodeID &ID);
-
- virtual void print(std::ostream &O) const;
-};
-
-}
-
-#endif
diff --git a/release_23/lib/Target/ARM/ARMFrameInfo.h b/release_23/lib/Target/ARM/ARMFrameInfo.h
deleted file mode 100644
index 405b8f2b9f28..000000000000
--- a/release_23/lib/Target/ARM/ARMFrameInfo.h
+++ /dev/null
@@ -1,32 +0,0 @@
-//===-- ARMTargetFrameInfo.h - Define TargetFrameInfo for ARM ---*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-//
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef ARM_FRAMEINFO_H
-#define ARM_FRAMEINFO_H
-
-#include "ARM.h"
-#include "llvm/Target/TargetFrameInfo.h"
-#include "ARMSubtarget.h"
-
-namespace llvm {
-
-class ARMFrameInfo : public TargetFrameInfo {
-public:
- explicit ARMFrameInfo(const ARMSubtarget &ST)
- : TargetFrameInfo(StackGrowsDown, ST.getStackAlignment(), 0) {
- }
-};
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/lib/Target/ARM/ARMISelDAGToDAG.cpp b/release_23/lib/Target/ARM/ARMISelDAGToDAG.cpp
deleted file mode 100644
index 5029a6952ab9..000000000000
--- a/release_23/lib/Target/ARM/ARMISelDAGToDAG.cpp
+++ /dev/null
@@ -1,861 +0,0 @@
-//===-- ARMISelDAGToDAG.cpp - A dag to dag inst selector for ARM ----------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines an instruction selector for the ARM target.
-//
-//===----------------------------------------------------------------------===//
-
-#include "ARM.h"
-#include "ARMISelLowering.h"
-#include "ARMTargetMachine.h"
-#include "ARMAddressingModes.h"
-#include "llvm/CallingConv.h"
-#include "llvm/Constants.h"
-#include "llvm/DerivedTypes.h"
-#include "llvm/Function.h"
-#include "llvm/Intrinsics.h"
-#include "llvm/CodeGen/MachineFrameInfo.h"
-#include "llvm/CodeGen/MachineFunction.h"
-#include "llvm/CodeGen/MachineInstrBuilder.h"
-#include "llvm/CodeGen/SelectionDAG.h"
-#include "llvm/CodeGen/SelectionDAGISel.h"
-#include "llvm/Target/TargetLowering.h"
-#include "llvm/Target/TargetOptions.h"
-#include "llvm/Support/Compiler.h"
-#include "llvm/Support/Debug.h"
-using namespace llvm;
-
-//===--------------------------------------------------------------------===//
-/// ARMDAGToDAGISel - ARM specific code to select ARM machine
-/// instructions for SelectionDAG operations.
-///
-namespace {
-class ARMDAGToDAGISel : public SelectionDAGISel {
- ARMTargetLowering Lowering;
-
- /// Subtarget - Keep a pointer to the ARMSubtarget around so that we can
- /// make the right decision when generating code for different targets.
- const ARMSubtarget *Subtarget;
-
-public:
- ARMDAGToDAGISel(ARMTargetMachine &TM)
- : SelectionDAGISel(Lowering), Lowering(TM),
- Subtarget(&TM.getSubtarget<ARMSubtarget>()) {
- }
-
- virtual const char *getPassName() const {
- return "ARM Instruction Selection";
- }
-
- SDNode *Select(SDOperand Op);
- virtual void InstructionSelectBasicBlock(SelectionDAG &DAG);
- bool SelectAddrMode2(SDOperand Op, SDOperand N, SDOperand &Base,
- SDOperand &Offset, SDOperand &Opc);
- bool SelectAddrMode2Offset(SDOperand Op, SDOperand N,
- SDOperand &Offset, SDOperand &Opc);
- bool SelectAddrMode3(SDOperand Op, SDOperand N, SDOperand &Base,
- SDOperand &Offset, SDOperand &Opc);
- bool SelectAddrMode3Offset(SDOperand Op, SDOperand N,
- SDOperand &Offset, SDOperand &Opc);
- bool SelectAddrMode5(SDOperand Op, SDOperand N, SDOperand &Base,
- SDOperand &Offset);
-
- bool SelectAddrModePC(SDOperand Op, SDOperand N, SDOperand &Offset,
- SDOperand &Label);
-
- bool SelectThumbAddrModeRR(SDOperand Op, SDOperand N, SDOperand &Base,
- SDOperand &Offset);
- bool SelectThumbAddrModeRI5(SDOperand Op, SDOperand N, unsigned Scale,
- SDOperand &Base, SDOperand &OffImm,
- SDOperand &Offset);
- bool SelectThumbAddrModeS1(SDOperand Op, SDOperand N, SDOperand &Base,
- SDOperand &OffImm, SDOperand &Offset);
- bool SelectThumbAddrModeS2(SDOperand Op, SDOperand N, SDOperand &Base,
- SDOperand &OffImm, SDOperand &Offset);
- bool SelectThumbAddrModeS4(SDOperand Op, SDOperand N, SDOperand &Base,
- SDOperand &OffImm, SDOperand &Offset);
- bool SelectThumbAddrModeSP(SDOperand Op, SDOperand N, SDOperand &Base,
- SDOperand &OffImm);
-
- bool SelectShifterOperandReg(SDOperand Op, SDOperand N, SDOperand &A,
- SDOperand &B, SDOperand &C);
-
- // Include the pieces autogenerated from the target description.
-#include "ARMGenDAGISel.inc"
-};
-}
-
-void ARMDAGToDAGISel::InstructionSelectBasicBlock(SelectionDAG &DAG) {
- DEBUG(BB->dump());
-
- DAG.setRoot(SelectRoot(DAG.getRoot()));
- DAG.RemoveDeadNodes();
-
- ScheduleAndEmitDAG(DAG);
-}
-
-bool ARMDAGToDAGISel::SelectAddrMode2(SDOperand Op, SDOperand N,
- SDOperand &Base, SDOperand &Offset,
- SDOperand &Opc) {
- if (N.getOpcode() == ISD::MUL) {
- if (ConstantSDNode *RHS = dyn_cast<ConstantSDNode>(N.getOperand(1))) {
- // X * [3,5,9] -> X + X * [2,4,8] etc.
- int RHSC = (int)RHS->getValue();
- if (RHSC & 1) {
- RHSC = RHSC & ~1;
- ARM_AM::AddrOpc AddSub = ARM_AM::add;
- if (RHSC < 0) {
- AddSub = ARM_AM::sub;
- RHSC = - RHSC;
- }
- if (isPowerOf2_32(RHSC)) {
- unsigned ShAmt = Log2_32(RHSC);
- Base = Offset = N.getOperand(0);
- Opc = CurDAG->getTargetConstant(ARM_AM::getAM2Opc(AddSub, ShAmt,
- ARM_AM::lsl),
- MVT::i32);
- return true;
- }
- }
- }
- }
-
- if (N.getOpcode() != ISD::ADD && N.getOpcode() != ISD::SUB) {
- Base = N;
- if (N.getOpcode() == ISD::FrameIndex) {
- int FI = cast<FrameIndexSDNode>(N)->getIndex();
- Base = CurDAG->getTargetFrameIndex(FI, TLI.getPointerTy());
- } else if (N.getOpcode() == ARMISD::Wrapper) {
- Base = N.getOperand(0);
- }
- Offset = CurDAG->getRegister(0, MVT::i32);
- Opc = CurDAG->getTargetConstant(ARM_AM::getAM2Opc(ARM_AM::add, 0,
- ARM_AM::no_shift),
- MVT::i32);
- return true;
- }
-
- // Match simple R +/- imm12 operands.
- if (N.getOpcode() == ISD::ADD)
- if (ConstantSDNode *RHS = dyn_cast<ConstantSDNode>(N.getOperand(1))) {
- int RHSC = (int)RHS->getValue();
- if ((RHSC >= 0 && RHSC < 0x1000) ||
- (RHSC < 0 && RHSC > -0x1000)) { // 12 bits.
- Base = N.getOperand(0);
- if (Base.getOpcode() == ISD::FrameIndex) {
- int FI = cast<FrameIndexSDNode>(Base)->getIndex();
- Base = CurDAG->getTargetFrameIndex(FI, TLI.getPointerTy());
- }
- Offset = CurDAG->getRegister(0, MVT::i32);
-
- ARM_AM::AddrOpc AddSub = ARM_AM::add;
- if (RHSC < 0) {
- AddSub = ARM_AM::sub;
- RHSC = - RHSC;
- }
- Opc = CurDAG->getTargetConstant(ARM_AM::getAM2Opc(AddSub, RHSC,
- ARM_AM::no_shift),
- MVT::i32);
- return true;
- }
- }
-
- // Otherwise this is R +/- [possibly shifted] R
- ARM_AM::AddrOpc AddSub = N.getOpcode() == ISD::ADD ? ARM_AM::add:ARM_AM::sub;
- ARM_AM::ShiftOpc ShOpcVal = ARM_AM::getShiftOpcForNode(N.getOperand(1));
- unsigned ShAmt = 0;
-
- Base = N.getOperand(0);
- Offset = N.getOperand(1);
-
- if (ShOpcVal != ARM_AM::no_shift) {
- // Check to see if the RHS of the shift is a constant, if not, we can't fold
- // it.
- if (ConstantSDNode *Sh =
- dyn_cast<ConstantSDNode>(N.getOperand(1).getOperand(1))) {
- ShAmt = Sh->getValue();
- Offset = N.getOperand(1).getOperand(0);
- } else {
- ShOpcVal = ARM_AM::no_shift;
- }
- }
-
- // Try matching (R shl C) + (R).
- if (N.getOpcode() == ISD::ADD && ShOpcVal == ARM_AM::no_shift) {
- ShOpcVal = ARM_AM::getShiftOpcForNode(N.getOperand(0));
- if (ShOpcVal != ARM_AM::no_shift) {
- // Check to see if the RHS of the shift is a constant, if not, we can't
- // fold it.
- if (ConstantSDNode *Sh =
- dyn_cast<ConstantSDNode>(N.getOperand(0).getOperand(1))) {
- ShAmt = Sh->getValue();
- Offset = N.getOperand(0).getOperand(0);
- Base = N.getOperand(1);
- } else {
- ShOpcVal = ARM_AM::no_shift;
- }
- }
- }
-
- Opc = CurDAG->getTargetConstant(ARM_AM::getAM2Opc(AddSub, ShAmt, ShOpcVal),
- MVT::i32);
- return true;
-}
-
-bool ARMDAGToDAGISel::SelectAddrMode2Offset(SDOperand Op, SDOperand N,
- SDOperand &Offset, SDOperand &Opc) {
- unsigned Opcode = Op.getOpcode();
- ISD::MemIndexedMode AM = (Opcode == ISD::LOAD)
- ? cast<LoadSDNode>(Op)->getAddressingMode()
- : cast<StoreSDNode>(Op)->getAddressingMode();
- ARM_AM::AddrOpc AddSub = (AM == ISD::PRE_INC || AM == ISD::POST_INC)
- ? ARM_AM::add : ARM_AM::sub;
- if (ConstantSDNode *C = dyn_cast<ConstantSDNode>(N)) {
- int Val = (int)C->getValue();
- if (Val >= 0 && Val < 0x1000) { // 12 bits.
- Offset = CurDAG->getRegister(0, MVT::i32);
- Opc = CurDAG->getTargetConstant(ARM_AM::getAM2Opc(AddSub, Val,
- ARM_AM::no_shift),
- MVT::i32);
- return true;
- }
- }
-
- Offset = N;
- ARM_AM::ShiftOpc ShOpcVal = ARM_AM::getShiftOpcForNode(N);
- unsigned ShAmt = 0;
- if (ShOpcVal != ARM_AM::no_shift) {
- // Check to see if the RHS of the shift is a constant, if not, we can't fold
- // it.
- if (ConstantSDNode *Sh = dyn_cast<ConstantSDNode>(N.getOperand(1))) {
- ShAmt = Sh->getValue();
- Offset = N.getOperand(0);
- } else {
- ShOpcVal = ARM_AM::no_shift;
- }
- }
-
- Opc = CurDAG->getTargetConstant(ARM_AM::getAM2Opc(AddSub, ShAmt, ShOpcVal),
- MVT::i32);
- return true;
-}
-
-
-bool ARMDAGToDAGISel::SelectAddrMode3(SDOperand Op, SDOperand N,
- SDOperand &Base, SDOperand &Offset,
- SDOperand &Opc) {
- if (N.getOpcode() == ISD::SUB) {
- // X - C is canonicalize to X + -C, no need to handle it here.
- Base = N.getOperand(0);
- Offset = N.getOperand(1);
- Opc = CurDAG->getTargetConstant(ARM_AM::getAM3Opc(ARM_AM::sub, 0),MVT::i32);
- return true;
- }
-
- if (N.getOpcode() != ISD::ADD) {
- Base = N;
- if (N.getOpcode() == ISD::FrameIndex) {
- int FI = cast<FrameIndexSDNode>(N)->getIndex();
- Base = CurDAG->getTargetFrameIndex(FI, TLI.getPointerTy());
- }
- Offset = CurDAG->getRegister(0, MVT::i32);
- Opc = CurDAG->getTargetConstant(ARM_AM::getAM3Opc(ARM_AM::add, 0),MVT::i32);
- return true;
- }
-
- // If the RHS is +/- imm8, fold into addr mode.
- if (ConstantSDNode *RHS = dyn_cast<ConstantSDNode>(N.getOperand(1))) {
- int RHSC = (int)RHS->getValue();
- if ((RHSC >= 0 && RHSC < 256) ||
- (RHSC < 0 && RHSC > -256)) { // note -256 itself isn't allowed.
- Base = N.getOperand(0);
- if (Base.getOpcode() == ISD::FrameIndex) {
- int FI = cast<FrameIndexSDNode>(Base)->getIndex();
- Base = CurDAG->getTargetFrameIndex(FI, TLI.getPointerTy());
- }
- Offset = CurDAG->getRegister(0, MVT::i32);
-
- ARM_AM::AddrOpc AddSub = ARM_AM::add;
- if (RHSC < 0) {
- AddSub = ARM_AM::sub;
- RHSC = - RHSC;
- }
- Opc = CurDAG->getTargetConstant(ARM_AM::getAM3Opc(AddSub, RHSC),MVT::i32);
- return true;
- }
- }
-
- Base = N.getOperand(0);
- Offset = N.getOperand(1);
- Opc = CurDAG->getTargetConstant(ARM_AM::getAM3Opc(ARM_AM::add, 0), MVT::i32);
- return true;
-}
-
-bool ARMDAGToDAGISel::SelectAddrMode3Offset(SDOperand Op, SDOperand N,
- SDOperand &Offset, SDOperand &Opc) {
- unsigned Opcode = Op.getOpcode();
- ISD::MemIndexedMode AM = (Opcode == ISD::LOAD)
- ? cast<LoadSDNode>(Op)->getAddressingMode()
- : cast<StoreSDNode>(Op)->getAddressingMode();
- ARM_AM::AddrOpc AddSub = (AM == ISD::PRE_INC || AM == ISD::POST_INC)
- ? ARM_AM::add : ARM_AM::sub;
- if (ConstantSDNode *C = dyn_cast<ConstantSDNode>(N)) {
- int Val = (int)C->getValue();
- if (Val >= 0 && Val < 256) {
- Offset = CurDAG->getRegister(0, MVT::i32);
- Opc = CurDAG->getTargetConstant(ARM_AM::getAM3Opc(AddSub, Val), MVT::i32);
- return true;
- }
- }
-
- Offset = N;
- Opc = CurDAG->getTargetConstant(ARM_AM::getAM3Opc(AddSub, 0), MVT::i32);
- return true;
-}
-
-
-bool ARMDAGToDAGISel::SelectAddrMode5(SDOperand Op, SDOperand N,
- SDOperand &Base, SDOperand &Offset) {
- if (N.getOpcode() != ISD::ADD) {
- Base = N;
- if (N.getOpcode() == ISD::FrameIndex) {
- int FI = cast<FrameIndexSDNode>(N)->getIndex();
- Base = CurDAG->getTargetFrameIndex(FI, TLI.getPointerTy());
- } else if (N.getOpcode() == ARMISD::Wrapper) {
- Base = N.getOperand(0);
- }
- Offset = CurDAG->getTargetConstant(ARM_AM::getAM5Opc(ARM_AM::add, 0),
- MVT::i32);
- return true;
- }
-
- // If the RHS is +/- imm8, fold into addr mode.
- if (ConstantSDNode *RHS = dyn_cast<ConstantSDNode>(N.getOperand(1))) {
- int RHSC = (int)RHS->getValue();
- if ((RHSC & 3) == 0) { // The constant is implicitly multiplied by 4.
- RHSC >>= 2;
- if ((RHSC >= 0 && RHSC < 256) ||
- (RHSC < 0 && RHSC > -256)) { // note -256 itself isn't allowed.
- Base = N.getOperand(0);
- if (Base.getOpcode() == ISD::FrameIndex) {
- int FI = cast<FrameIndexSDNode>(Base)->getIndex();
- Base = CurDAG->getTargetFrameIndex(FI, TLI.getPointerTy());
- }
-
- ARM_AM::AddrOpc AddSub = ARM_AM::add;
- if (RHSC < 0) {
- AddSub = ARM_AM::sub;
- RHSC = - RHSC;
- }
- Offset = CurDAG->getTargetConstant(ARM_AM::getAM5Opc(AddSub, RHSC),
- MVT::i32);
- return true;
- }
- }
- }
-
- Base = N;
- Offset = CurDAG->getTargetConstant(ARM_AM::getAM5Opc(ARM_AM::add, 0),
- MVT::i32);
- return true;
-}
-
-bool ARMDAGToDAGISel::SelectAddrModePC(SDOperand Op, SDOperand N,
- SDOperand &Offset, SDOperand &Label) {
- if (N.getOpcode() == ARMISD::PIC_ADD && N.hasOneUse()) {
- Offset = N.getOperand(0);
- SDOperand N1 = N.getOperand(1);
- Label = CurDAG->getTargetConstant(cast<ConstantSDNode>(N1)->getValue(),
- MVT::i32);
- return true;
- }
- return false;
-}
-
-bool ARMDAGToDAGISel::SelectThumbAddrModeRR(SDOperand Op, SDOperand N,
- SDOperand &Base, SDOperand &Offset){
- if (N.getOpcode() != ISD::ADD) {
- Base = N;
- // We must materialize a zero in a reg! Returning an constant here won't
- // work since its node is -1 so it won't get added to the selection queue.
- // Explicitly issue a tMOVri8 node!
- Offset = SDOperand(CurDAG->getTargetNode(ARM::tMOVi8, MVT::i32,
- CurDAG->getTargetConstant(0, MVT::i32)), 0);
- return true;
- }
-
- Base = N.getOperand(0);
- Offset = N.getOperand(1);
- return true;
-}
-
-bool
-ARMDAGToDAGISel::SelectThumbAddrModeRI5(SDOperand Op, SDOperand N,
- unsigned Scale, SDOperand &Base,
- SDOperand &OffImm, SDOperand &Offset) {
- if (Scale == 4) {
- SDOperand TmpBase, TmpOffImm;
- if (SelectThumbAddrModeSP(Op, N, TmpBase, TmpOffImm))
- return false; // We want to select tLDRspi / tSTRspi instead.
- if (N.getOpcode() == ARMISD::Wrapper &&
- N.getOperand(0).getOpcode() == ISD::TargetConstantPool)
- return false; // We want to select tLDRpci instead.
- }
-
- if (N.getOpcode() != ISD::ADD) {
- Base = (N.getOpcode() == ARMISD::Wrapper) ? N.getOperand(0) : N;
- Offset = CurDAG->getRegister(0, MVT::i32);
- OffImm = CurDAG->getTargetConstant(0, MVT::i32);
- return true;
- }
-
- // Thumb does not have [sp, r] address mode.
- RegisterSDNode *LHSR = dyn_cast<RegisterSDNode>(N.getOperand(0));
- RegisterSDNode *RHSR = dyn_cast<RegisterSDNode>(N.getOperand(1));
- if ((LHSR && LHSR->getReg() == ARM::SP) ||
- (RHSR && RHSR->getReg() == ARM::SP)) {
- Base = N;
- Offset = CurDAG->getRegister(0, MVT::i32);
- OffImm = CurDAG->getTargetConstant(0, MVT::i32);
- return true;
- }
-
- // If the RHS is + imm5 * scale, fold into addr mode.
- if (ConstantSDNode *RHS = dyn_cast<ConstantSDNode>(N.getOperand(1))) {
- int RHSC = (int)RHS->getValue();
- if ((RHSC & (Scale-1)) == 0) { // The constant is implicitly multiplied.
- RHSC /= Scale;
- if (RHSC >= 0 && RHSC < 32) {
- Base = N.getOperand(0);
- Offset = CurDAG->getRegister(0, MVT::i32);
- OffImm = CurDAG->getTargetConstant(RHSC, MVT::i32);
- return true;
- }
- }
- }
-
- Base = N.getOperand(0);
- Offset = N.getOperand(1);
- OffImm = CurDAG->getTargetConstant(0, MVT::i32);
- return true;
-}
-
-bool ARMDAGToDAGISel::SelectThumbAddrModeS1(SDOperand Op, SDOperand N,
- SDOperand &Base, SDOperand &OffImm,
- SDOperand &Offset) {
- return SelectThumbAddrModeRI5(Op, N, 1, Base, OffImm, Offset);
-}
-
-bool ARMDAGToDAGISel::SelectThumbAddrModeS2(SDOperand Op, SDOperand N,
- SDOperand &Base, SDOperand &OffImm,
- SDOperand &Offset) {
- return SelectThumbAddrModeRI5(Op, N, 2, Base, OffImm, Offset);
-}
-
-bool ARMDAGToDAGISel::SelectThumbAddrModeS4(SDOperand Op, SDOperand N,
- SDOperand &Base, SDOperand &OffImm,
- SDOperand &Offset) {
- return SelectThumbAddrModeRI5(Op, N, 4, Base, OffImm, Offset);
-}
-
-bool ARMDAGToDAGISel::SelectThumbAddrModeSP(SDOperand Op, SDOperand N,
- SDOperand &Base, SDOperand &OffImm) {
- if (N.getOpcode() == ISD::FrameIndex) {
- int FI = cast<FrameIndexSDNode>(N)->getIndex();
- Base = CurDAG->getTargetFrameIndex(FI, TLI.getPointerTy());
- OffImm = CurDAG->getTargetConstant(0, MVT::i32);
- return true;
- }
-
- if (N.getOpcode() != ISD::ADD)
- return false;
-
- RegisterSDNode *LHSR = dyn_cast<RegisterSDNode>(N.getOperand(0));
- if (N.getOperand(0).getOpcode() == ISD::FrameIndex ||
- (LHSR && LHSR->getReg() == ARM::SP)) {
- // If the RHS is + imm8 * scale, fold into addr mode.
- if (ConstantSDNode *RHS = dyn_cast<ConstantSDNode>(N.getOperand(1))) {
- int RHSC = (int)RHS->getValue();
- if ((RHSC & 3) == 0) { // The constant is implicitly multiplied.
- RHSC >>= 2;
- if (RHSC >= 0 && RHSC < 256) {
- Base = N.getOperand(0);
- if (Base.getOpcode() == ISD::FrameIndex) {
- int FI = cast<FrameIndexSDNode>(Base)->getIndex();
- Base = CurDAG->getTargetFrameIndex(FI, TLI.getPointerTy());
- }
- OffImm = CurDAG->getTargetConstant(RHSC, MVT::i32);
- return true;
- }
- }
- }
- }
-
- return false;
-}
-
-bool ARMDAGToDAGISel::SelectShifterOperandReg(SDOperand Op,
- SDOperand N,
- SDOperand &BaseReg,
- SDOperand &ShReg,
- SDOperand &Opc) {
- ARM_AM::ShiftOpc ShOpcVal = ARM_AM::getShiftOpcForNode(N);
-
- // Don't match base register only case. That is matched to a separate
- // lower complexity pattern with explicit register operand.
- if (ShOpcVal == ARM_AM::no_shift) return false;
-
- BaseReg = N.getOperand(0);
- unsigned ShImmVal = 0;
- if (ConstantSDNode *RHS = dyn_cast<ConstantSDNode>(N.getOperand(1))) {
- ShReg = CurDAG->getRegister(0, MVT::i32);
- ShImmVal = RHS->getValue() & 31;
- } else {
- ShReg = N.getOperand(1);
- }
- Opc = CurDAG->getTargetConstant(ARM_AM::getSORegOpc(ShOpcVal, ShImmVal),
- MVT::i32);
- return true;
-}
-
-/// getAL - Returns a ARMCC::AL immediate node.
-static inline SDOperand getAL(SelectionDAG *CurDAG) {
- return CurDAG->getTargetConstant((uint64_t)ARMCC::AL, MVT::i32);
-}
-
-
-SDNode *ARMDAGToDAGISel::Select(SDOperand Op) {
- SDNode *N = Op.Val;
- unsigned Opcode = N->getOpcode();
-
- if (Opcode >= ISD::BUILTIN_OP_END && Opcode < ARMISD::FIRST_NUMBER)
- return NULL; // Already selected.
-
- switch (N->getOpcode()) {
- default: break;
- case ISD::Constant: {
- unsigned Val = cast<ConstantSDNode>(N)->getValue();
- bool UseCP = true;
- if (Subtarget->isThumb())
- UseCP = (Val > 255 && // MOV
- ~Val > 255 && // MOV + MVN
- !ARM_AM::isThumbImmShiftedVal(Val)); // MOV + LSL
- else
- UseCP = (ARM_AM::getSOImmVal(Val) == -1 && // MOV
- ARM_AM::getSOImmVal(~Val) == -1 && // MVN
- !ARM_AM::isSOImmTwoPartVal(Val)); // two instrs.
- if (UseCP) {
- SDOperand CPIdx =
- CurDAG->getTargetConstantPool(ConstantInt::get(Type::Int32Ty, Val),
- TLI.getPointerTy());
-
- SDNode *ResNode;
- if (Subtarget->isThumb())
- ResNode = CurDAG->getTargetNode(ARM::tLDRcp, MVT::i32, MVT::Other,
- CPIdx, CurDAG->getEntryNode());
- else {
- SDOperand Ops[] = {
- CPIdx,
- CurDAG->getRegister(0, MVT::i32),
- CurDAG->getTargetConstant(0, MVT::i32),
- getAL(CurDAG),
- CurDAG->getRegister(0, MVT::i32),
- CurDAG->getEntryNode()
- };
- ResNode=CurDAG->getTargetNode(ARM::LDRcp, MVT::i32, MVT::Other, Ops, 6);
- }
- ReplaceUses(Op, SDOperand(ResNode, 0));
- return NULL;
- }
-
- // Other cases are autogenerated.
- break;
- }
- case ISD::FrameIndex: {
- // Selects to ADDri FI, 0 which in turn will become ADDri SP, imm.
- int FI = cast<FrameIndexSDNode>(N)->getIndex();
- SDOperand TFI = CurDAG->getTargetFrameIndex(FI, TLI.getPointerTy());
- if (Subtarget->isThumb())
- return CurDAG->SelectNodeTo(N, ARM::tADDrSPi, MVT::i32, TFI,
- CurDAG->getTargetConstant(0, MVT::i32));
- else {
- SDOperand Ops[] = { TFI, CurDAG->getTargetConstant(0, MVT::i32),
- getAL(CurDAG), CurDAG->getRegister(0, MVT::i32),
- CurDAG->getRegister(0, MVT::i32) };
- return CurDAG->SelectNodeTo(N, ARM::ADDri, MVT::i32, Ops, 5);
- }
- }
- case ISD::ADD: {
- // Select add sp, c to tADDhirr.
- SDOperand N0 = Op.getOperand(0);
- SDOperand N1 = Op.getOperand(1);
- RegisterSDNode *LHSR = dyn_cast<RegisterSDNode>(Op.getOperand(0));
- RegisterSDNode *RHSR = dyn_cast<RegisterSDNode>(Op.getOperand(1));
- if (LHSR && LHSR->getReg() == ARM::SP) {
- std::swap(N0, N1);
- std::swap(LHSR, RHSR);
- }
- if (RHSR && RHSR->getReg() == ARM::SP) {
- AddToISelQueue(N0);
- AddToISelQueue(N1);
- return CurDAG->SelectNodeTo(N, ARM::tADDhirr, Op.getValueType(), N0, N1);
- }
- break;
- }
- case ISD::MUL:
- if (Subtarget->isThumb())
- break;
- if (ConstantSDNode *C = dyn_cast<ConstantSDNode>(Op.getOperand(1))) {
- unsigned RHSV = C->getValue();
- if (!RHSV) break;
- if (isPowerOf2_32(RHSV-1)) { // 2^n+1?
- SDOperand V = Op.getOperand(0);
- AddToISelQueue(V);
- unsigned ShImm = ARM_AM::getSORegOpc(ARM_AM::lsl, Log2_32(RHSV-1));
- SDOperand Ops[] = { V, V, CurDAG->getRegister(0, MVT::i32),
- CurDAG->getTargetConstant(ShImm, MVT::i32),
- getAL(CurDAG), CurDAG->getRegister(0, MVT::i32),
- CurDAG->getRegister(0, MVT::i32) };
- return CurDAG->SelectNodeTo(N, ARM::ADDrs, MVT::i32, Ops, 7);
- }
- if (isPowerOf2_32(RHSV+1)) { // 2^n-1?
- SDOperand V = Op.getOperand(0);
- AddToISelQueue(V);
- unsigned ShImm = ARM_AM::getSORegOpc(ARM_AM::lsl, Log2_32(RHSV+1));
- SDOperand Ops[] = { V, V, CurDAG->getRegister(0, MVT::i32),
- CurDAG->getTargetConstant(ShImm, MVT::i32),
- getAL(CurDAG), CurDAG->getRegister(0, MVT::i32),
- CurDAG->getRegister(0, MVT::i32) };
- return CurDAG->SelectNodeTo(N, ARM::RSBrs, MVT::i32, Ops, 7);
- }
- }
- break;
- case ARMISD::FMRRD:
- AddToISelQueue(Op.getOperand(0));
- return CurDAG->getTargetNode(ARM::FMRRD, MVT::i32, MVT::i32,
- Op.getOperand(0), getAL(CurDAG),
- CurDAG->getRegister(0, MVT::i32));
- case ISD::UMUL_LOHI: {
- AddToISelQueue(Op.getOperand(0));
- AddToISelQueue(Op.getOperand(1));
- SDOperand Ops[] = { Op.getOperand(0), Op.getOperand(1),
- getAL(CurDAG), CurDAG->getRegister(0, MVT::i32),
- CurDAG->getRegister(0, MVT::i32) };
- return CurDAG->getTargetNode(ARM::UMULL, MVT::i32, MVT::i32, Ops, 5);
- }
- case ISD::SMUL_LOHI: {
- AddToISelQueue(Op.getOperand(0));
- AddToISelQueue(Op.getOperand(1));
- SDOperand Ops[] = { Op.getOperand(0), Op.getOperand(1),
- getAL(CurDAG), CurDAG->getRegister(0, MVT::i32),
- CurDAG->getRegister(0, MVT::i32) };
- return CurDAG->getTargetNode(ARM::SMULL, MVT::i32, MVT::i32, Ops, 5);
- }
- case ISD::LOAD: {
- LoadSDNode *LD = cast<LoadSDNode>(Op);
- ISD::MemIndexedMode AM = LD->getAddressingMode();
- MVT::ValueType LoadedVT = LD->getMemoryVT();
- if (AM != ISD::UNINDEXED) {
- SDOperand Offset, AMOpc;
- bool isPre = (AM == ISD::PRE_INC) || (AM == ISD::PRE_DEC);
- unsigned Opcode = 0;
- bool Match = false;
- if (LoadedVT == MVT::i32 &&
- SelectAddrMode2Offset(Op, LD->getOffset(), Offset, AMOpc)) {
- Opcode = isPre ? ARM::LDR_PRE : ARM::LDR_POST;
- Match = true;
- } else if (LoadedVT == MVT::i16 &&
- SelectAddrMode3Offset(Op, LD->getOffset(), Offset, AMOpc)) {
- Match = true;
- Opcode = (LD->getExtensionType() == ISD::SEXTLOAD)
- ? (isPre ? ARM::LDRSH_PRE : ARM::LDRSH_POST)
- : (isPre ? ARM::LDRH_PRE : ARM::LDRH_POST);
- } else if (LoadedVT == MVT::i8 || LoadedVT == MVT::i1) {
- if (LD->getExtensionType() == ISD::SEXTLOAD) {
- if (SelectAddrMode3Offset(Op, LD->getOffset(), Offset, AMOpc)) {
- Match = true;
- Opcode = isPre ? ARM::LDRSB_PRE : ARM::LDRSB_POST;
- }
- } else {
- if (SelectAddrMode2Offset(Op, LD->getOffset(), Offset, AMOpc)) {
- Match = true;
- Opcode = isPre ? ARM::LDRB_PRE : ARM::LDRB_POST;
- }
- }
- }
-
- if (Match) {
- SDOperand Chain = LD->getChain();
- SDOperand Base = LD->getBasePtr();
- AddToISelQueue(Chain);
- AddToISelQueue(Base);
- AddToISelQueue(Offset);
- SDOperand Ops[]= { Base, Offset, AMOpc, getAL(CurDAG),
- CurDAG->getRegister(0, MVT::i32), Chain };
- return CurDAG->getTargetNode(Opcode, MVT::i32, MVT::i32,
- MVT::Other, Ops, 6);
- }
- }
- // Other cases are autogenerated.
- break;
- }
- case ARMISD::BRCOND: {
- // Pattern: (ARMbrcond:void (bb:Other):$dst, (imm:i32):$cc)
- // Emits: (Bcc:void (bb:Other):$dst, (imm:i32):$cc)
- // Pattern complexity = 6 cost = 1 size = 0
-
- // Pattern: (ARMbrcond:void (bb:Other):$dst, (imm:i32):$cc)
- // Emits: (tBcc:void (bb:Other):$dst, (imm:i32):$cc)
- // Pattern complexity = 6 cost = 1 size = 0
-
- unsigned Opc = Subtarget->isThumb() ? ARM::tBcc : ARM::Bcc;
- SDOperand Chain = Op.getOperand(0);
- SDOperand N1 = Op.getOperand(1);
- SDOperand N2 = Op.getOperand(2);
- SDOperand N3 = Op.getOperand(3);
- SDOperand InFlag = Op.getOperand(4);
- assert(N1.getOpcode() == ISD::BasicBlock);
- assert(N2.getOpcode() == ISD::Constant);
- assert(N3.getOpcode() == ISD::Register);
-
- AddToISelQueue(Chain);
- AddToISelQueue(N1);
- AddToISelQueue(InFlag);
- SDOperand Tmp2 = CurDAG->getTargetConstant(((unsigned)
- cast<ConstantSDNode>(N2)->getValue()), MVT::i32);
- SDOperand Ops[] = { N1, Tmp2, N3, Chain, InFlag };
- SDNode *ResNode = CurDAG->getTargetNode(Opc, MVT::Other, MVT::Flag, Ops, 5);
- Chain = SDOperand(ResNode, 0);
- if (Op.Val->getNumValues() == 2) {
- InFlag = SDOperand(ResNode, 1);
- ReplaceUses(SDOperand(Op.Val, 1), InFlag);
- }
- ReplaceUses(SDOperand(Op.Val, 0), SDOperand(Chain.Val, Chain.ResNo));
- return NULL;
- }
- case ARMISD::CMOV: {
- bool isThumb = Subtarget->isThumb();
- MVT::ValueType VT = Op.getValueType();
- SDOperand N0 = Op.getOperand(0);
- SDOperand N1 = Op.getOperand(1);
- SDOperand N2 = Op.getOperand(2);
- SDOperand N3 = Op.getOperand(3);
- SDOperand InFlag = Op.getOperand(4);
- assert(N2.getOpcode() == ISD::Constant);
- assert(N3.getOpcode() == ISD::Register);
-
- // Pattern: (ARMcmov:i32 GPR:i32:$false, so_reg:i32:$true, (imm:i32):$cc)
- // Emits: (MOVCCs:i32 GPR:i32:$false, so_reg:i32:$true, (imm:i32):$cc)
- // Pattern complexity = 18 cost = 1 size = 0
- SDOperand CPTmp0;
- SDOperand CPTmp1;
- SDOperand CPTmp2;
- if (!isThumb && VT == MVT::i32 &&
- SelectShifterOperandReg(Op, N1, CPTmp0, CPTmp1, CPTmp2)) {
- AddToISelQueue(N0);
- AddToISelQueue(CPTmp0);
- AddToISelQueue(CPTmp1);
- AddToISelQueue(CPTmp2);
- AddToISelQueue(InFlag);
- SDOperand Tmp2 = CurDAG->getTargetConstant(((unsigned)
- cast<ConstantSDNode>(N2)->getValue()), MVT::i32);
- SDOperand Ops[] = { N0, CPTmp0, CPTmp1, CPTmp2, Tmp2, N3, InFlag };
- return CurDAG->SelectNodeTo(Op.Val, ARM::MOVCCs, MVT::i32, Ops, 7);
- }
-
- // Pattern: (ARMcmov:i32 GPR:i32:$false,
- // (imm:i32)<<P:Predicate_so_imm>><<X:so_imm_XFORM>>:$true,
- // (imm:i32):$cc)
- // Emits: (MOVCCi:i32 GPR:i32:$false,
- // (so_imm_XFORM:i32 (imm:i32):$true), (imm:i32):$cc)
- // Pattern complexity = 10 cost = 1 size = 0
- if (VT == MVT::i32 &&
- N3.getOpcode() == ISD::Constant &&
- Predicate_so_imm(N3.Val)) {
- AddToISelQueue(N0);
- AddToISelQueue(InFlag);
- SDOperand Tmp1 = CurDAG->getTargetConstant(((unsigned)
- cast<ConstantSDNode>(N1)->getValue()), MVT::i32);
- Tmp1 = Transform_so_imm_XFORM(Tmp1.Val);
- SDOperand Tmp2 = CurDAG->getTargetConstant(((unsigned)
- cast<ConstantSDNode>(N2)->getValue()), MVT::i32);
- SDOperand Ops[] = { N0, Tmp1, Tmp2, N3, InFlag };
- return CurDAG->SelectNodeTo(Op.Val, ARM::MOVCCi, MVT::i32, Ops, 5);
- }
-
- // Pattern: (ARMcmov:i32 GPR:i32:$false, GPR:i32:$true, (imm:i32):$cc)
- // Emits: (MOVCCr:i32 GPR:i32:$false, GPR:i32:$true, (imm:i32):$cc)
- // Pattern complexity = 6 cost = 1 size = 0
- //
- // Pattern: (ARMcmov:i32 GPR:i32:$false, GPR:i32:$true, (imm:i32):$cc)
- // Emits: (tMOVCCr:i32 GPR:i32:$false, GPR:i32:$true, (imm:i32):$cc)
- // Pattern complexity = 6 cost = 11 size = 0
- //
- // Also FCPYScc and FCPYDcc.
- AddToISelQueue(N0);
- AddToISelQueue(N1);
- AddToISelQueue(InFlag);
- SDOperand Tmp2 = CurDAG->getTargetConstant(((unsigned)
- cast<ConstantSDNode>(N2)->getValue()), MVT::i32);
- SDOperand Ops[] = { N0, N1, Tmp2, N3, InFlag };
- unsigned Opc = 0;
- switch (VT) {
- default: assert(false && "Illegal conditional move type!");
- break;
- case MVT::i32:
- Opc = isThumb ? ARM::tMOVCCr : ARM::MOVCCr;
- break;
- case MVT::f32:
- Opc = ARM::FCPYScc;
- break;
- case MVT::f64:
- Opc = ARM::FCPYDcc;
- break;
- }
- return CurDAG->SelectNodeTo(Op.Val, Opc, VT, Ops, 5);
- }
- case ARMISD::CNEG: {
- MVT::ValueType VT = Op.getValueType();
- SDOperand N0 = Op.getOperand(0);
- SDOperand N1 = Op.getOperand(1);
- SDOperand N2 = Op.getOperand(2);
- SDOperand N3 = Op.getOperand(3);
- SDOperand InFlag = Op.getOperand(4);
- assert(N2.getOpcode() == ISD::Constant);
- assert(N3.getOpcode() == ISD::Register);
-
- AddToISelQueue(N0);
- AddToISelQueue(N1);
- AddToISelQueue(InFlag);
- SDOperand Tmp2 = CurDAG->getTargetConstant(((unsigned)
- cast<ConstantSDNode>(N2)->getValue()), MVT::i32);
- SDOperand Ops[] = { N0, N1, Tmp2, N3, InFlag };
- unsigned Opc = 0;
- switch (VT) {
- default: assert(false && "Illegal conditional move type!");
- break;
- case MVT::f32:
- Opc = ARM::FNEGScc;
- break;
- case MVT::f64:
- Opc = ARM::FNEGDcc;
- break;
- }
- return CurDAG->SelectNodeTo(Op.Val, Opc, VT, Ops, 5);
- }
- }
- return SelectCode(Op);
-}
-
-/// createARMISelDag - This pass converts a legalized DAG into a
-/// ARM-specific DAG, ready for instruction scheduling.
-///
-FunctionPass *llvm::createARMISelDag(ARMTargetMachine &TM) {
- return new ARMDAGToDAGISel(TM);
-}
diff --git a/release_23/lib/Target/ARM/ARMISelLowering.cpp b/release_23/lib/Target/ARM/ARMISelLowering.cpp
deleted file mode 100644
index dc76b7b333fc..000000000000
--- a/release_23/lib/Target/ARM/ARMISelLowering.cpp
+++ /dev/null
@@ -1,1872 +0,0 @@
-//===-- ARMISelLowering.cpp - ARM DAG Lowering Implementation -------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines the interfaces that ARM uses to lower LLVM code into a
-// selection DAG.
-//
-//===----------------------------------------------------------------------===//
-
-#include "ARM.h"
-#include "ARMAddressingModes.h"
-#include "ARMConstantPoolValue.h"
-#include "ARMISelLowering.h"
-#include "ARMMachineFunctionInfo.h"
-#include "ARMRegisterInfo.h"
-#include "ARMSubtarget.h"
-#include "ARMTargetMachine.h"
-#include "llvm/CallingConv.h"
-#include "llvm/Constants.h"
-#include "llvm/Instruction.h"
-#include "llvm/Intrinsics.h"
-#include "llvm/GlobalValue.h"
-#include "llvm/CodeGen/MachineBasicBlock.h"
-#include "llvm/CodeGen/MachineFrameInfo.h"
-#include "llvm/CodeGen/MachineFunction.h"
-#include "llvm/CodeGen/MachineInstrBuilder.h"
-#include "llvm/CodeGen/MachineRegisterInfo.h"
-#include "llvm/CodeGen/SelectionDAG.h"
-#include "llvm/Target/TargetOptions.h"
-#include "llvm/ADT/VectorExtras.h"
-#include "llvm/Support/MathExtras.h"
-using namespace llvm;
-
-ARMTargetLowering::ARMTargetLowering(TargetMachine &TM)
- : TargetLowering(TM), ARMPCLabelIndex(0) {
- Subtarget = &TM.getSubtarget<ARMSubtarget>();
-
- if (Subtarget->isTargetDarwin()) {
- // Don't have these.
- setLibcallName(RTLIB::UINTTOFP_I64_F32, NULL);
- setLibcallName(RTLIB::UINTTOFP_I64_F64, NULL);
-
- // Uses VFP for Thumb libfuncs if available.
- if (Subtarget->isThumb() && Subtarget->hasVFP2()) {
- // Single-precision floating-point arithmetic.
- setLibcallName(RTLIB::ADD_F32, "__addsf3vfp");
- setLibcallName(RTLIB::SUB_F32, "__subsf3vfp");
- setLibcallName(RTLIB::MUL_F32, "__mulsf3vfp");
- setLibcallName(RTLIB::DIV_F32, "__divsf3vfp");
-
- // Double-precision floating-point arithmetic.
- setLibcallName(RTLIB::ADD_F64, "__adddf3vfp");
- setLibcallName(RTLIB::SUB_F64, "__subdf3vfp");
- setLibcallName(RTLIB::MUL_F64, "__muldf3vfp");
- setLibcallName(RTLIB::DIV_F64, "__divdf3vfp");
-
- // Single-precision comparisons.
- setLibcallName(RTLIB::OEQ_F32, "__eqsf2vfp");
- setLibcallName(RTLIB::UNE_F32, "__nesf2vfp");
- setLibcallName(RTLIB::OLT_F32, "__ltsf2vfp");
- setLibcallName(RTLIB::OLE_F32, "__lesf2vfp");
- setLibcallName(RTLIB::OGE_F32, "__gesf2vfp");
- setLibcallName(RTLIB::OGT_F32, "__gtsf2vfp");
- setLibcallName(RTLIB::UO_F32, "__unordsf2vfp");
- setLibcallName(RTLIB::O_F32, "__unordsf2vfp");
-
- setCmpLibcallCC(RTLIB::OEQ_F32, ISD::SETNE);
- setCmpLibcallCC(RTLIB::UNE_F32, ISD::SETNE);
- setCmpLibcallCC(RTLIB::OLT_F32, ISD::SETNE);
- setCmpLibcallCC(RTLIB::OLE_F32, ISD::SETNE);
- setCmpLibcallCC(RTLIB::OGE_F32, ISD::SETNE);
- setCmpLibcallCC(RTLIB::OGT_F32, ISD::SETNE);
- setCmpLibcallCC(RTLIB::UO_F32, ISD::SETNE);
- setCmpLibcallCC(RTLIB::O_F32, ISD::SETEQ);
-
- // Double-precision comparisons.
- setLibcallName(RTLIB::OEQ_F64, "__eqdf2vfp");
- setLibcallName(RTLIB::UNE_F64, "__nedf2vfp");
- setLibcallName(RTLIB::OLT_F64, "__ltdf2vfp");
- setLibcallName(RTLIB::OLE_F64, "__ledf2vfp");
- setLibcallName(RTLIB::OGE_F64, "__gedf2vfp");
- setLibcallName(RTLIB::OGT_F64, "__gtdf2vfp");
- setLibcallName(RTLIB::UO_F64, "__unorddf2vfp");
- setLibcallName(RTLIB::O_F64, "__unorddf2vfp");
-
- setCmpLibcallCC(RTLIB::OEQ_F64, ISD::SETNE);
- setCmpLibcallCC(RTLIB::UNE_F64, ISD::SETNE);
- setCmpLibcallCC(RTLIB::OLT_F64, ISD::SETNE);
- setCmpLibcallCC(RTLIB::OLE_F64, ISD::SETNE);
- setCmpLibcallCC(RTLIB::OGE_F64, ISD::SETNE);
- setCmpLibcallCC(RTLIB::OGT_F64, ISD::SETNE);
- setCmpLibcallCC(RTLIB::UO_F64, ISD::SETNE);
- setCmpLibcallCC(RTLIB::O_F64, ISD::SETEQ);
-
- // Floating-point to integer conversions.
- // i64 conversions are done via library routines even when generating VFP
- // instructions, so use the same ones.
- setLibcallName(RTLIB::FPTOSINT_F64_I32, "__fixdfsivfp");
- setLibcallName(RTLIB::FPTOUINT_F64_I32, "__fixunsdfsivfp");
- setLibcallName(RTLIB::FPTOSINT_F32_I32, "__fixsfsivfp");
- setLibcallName(RTLIB::FPTOUINT_F32_I32, "__fixunssfsivfp");
-
- // Conversions between floating types.
- setLibcallName(RTLIB::FPROUND_F64_F32, "__truncdfsf2vfp");
- setLibcallName(RTLIB::FPEXT_F32_F64, "__extendsfdf2vfp");
-
- // Integer to floating-point conversions.
- // i64 conversions are done via library routines even when generating VFP
- // instructions, so use the same ones.
- // FIXME: There appears to be some naming inconsistency in ARM libgcc: e.g.
- // __floatunsidf vs. __floatunssidfvfp.
- setLibcallName(RTLIB::SINTTOFP_I32_F64, "__floatsidfvfp");
- setLibcallName(RTLIB::UINTTOFP_I32_F64, "__floatunssidfvfp");
- setLibcallName(RTLIB::SINTTOFP_I32_F32, "__floatsisfvfp");
- setLibcallName(RTLIB::UINTTOFP_I32_F32, "__floatunssisfvfp");
- }
- }
-
- addRegisterClass(MVT::i32, ARM::GPRRegisterClass);
- if (!UseSoftFloat && Subtarget->hasVFP2() && !Subtarget->isThumb()) {
- addRegisterClass(MVT::f32, ARM::SPRRegisterClass);
- addRegisterClass(MVT::f64, ARM::DPRRegisterClass);
-
- setTruncStoreAction(MVT::f64, MVT::f32, Expand);
- }
- computeRegisterProperties();
-
- // ARM does not have f32 extending load.
- setLoadXAction(ISD::EXTLOAD, MVT::f32, Expand);
-
- // ARM does not have i1 sign extending load.
- setLoadXAction(ISD::SEXTLOAD, MVT::i1, Promote);
-
- // ARM supports all 4 flavors of integer indexed load / store.
- for (unsigned im = (unsigned)ISD::PRE_INC;
- im != (unsigned)ISD::LAST_INDEXED_MODE; ++im) {
- setIndexedLoadAction(im, MVT::i1, Legal);
- setIndexedLoadAction(im, MVT::i8, Legal);
- setIndexedLoadAction(im, MVT::i16, Legal);
- setIndexedLoadAction(im, MVT::i32, Legal);
- setIndexedStoreAction(im, MVT::i1, Legal);
- setIndexedStoreAction(im, MVT::i8, Legal);
- setIndexedStoreAction(im, MVT::i16, Legal);
- setIndexedStoreAction(im, MVT::i32, Legal);
- }
-
- // i64 operation support.
- if (Subtarget->isThumb()) {
- setOperationAction(ISD::MUL, MVT::i64, Expand);
- setOperationAction(ISD::MULHU, MVT::i32, Expand);
- setOperationAction(ISD::MULHS, MVT::i32, Expand);
- setOperationAction(ISD::UMUL_LOHI, MVT::i32, Expand);
- setOperationAction(ISD::SMUL_LOHI, MVT::i32, Expand);
- } else {
- setOperationAction(ISD::MUL, MVT::i64, Expand);
- setOperationAction(ISD::MULHU, MVT::i32, Expand);
- if (!Subtarget->hasV6Ops())
- setOperationAction(ISD::MULHS, MVT::i32, Expand);
- }
- setOperationAction(ISD::SHL_PARTS, MVT::i32, Expand);
- setOperationAction(ISD::SRA_PARTS, MVT::i32, Expand);
- setOperationAction(ISD::SRL_PARTS, MVT::i32, Expand);
- setOperationAction(ISD::SRL, MVT::i64, Custom);
- setOperationAction(ISD::SRA, MVT::i64, Custom);
-
- // ARM does not have ROTL.
- setOperationAction(ISD::ROTL, MVT::i32, Expand);
- setOperationAction(ISD::CTTZ , MVT::i32, Expand);
- setOperationAction(ISD::CTPOP, MVT::i32, Expand);
- if (!Subtarget->hasV5TOps() || Subtarget->isThumb())
- setOperationAction(ISD::CTLZ, MVT::i32, Expand);
-
- // Only ARMv6 has BSWAP.
- if (!Subtarget->hasV6Ops())
- setOperationAction(ISD::BSWAP, MVT::i32, Expand);
-
- // These are expanded into libcalls.
- setOperationAction(ISD::SDIV, MVT::i32, Expand);
- setOperationAction(ISD::UDIV, MVT::i32, Expand);
- setOperationAction(ISD::SREM, MVT::i32, Expand);
- setOperationAction(ISD::UREM, MVT::i32, Expand);
- setOperationAction(ISD::SDIVREM, MVT::i32, Expand);
- setOperationAction(ISD::UDIVREM, MVT::i32, Expand);
-
- // Support label based line numbers.
- setOperationAction(ISD::LOCATION, MVT::Other, Expand);
- setOperationAction(ISD::DEBUG_LOC, MVT::Other, Expand);
-
- setOperationAction(ISD::RET, MVT::Other, Custom);
- setOperationAction(ISD::GlobalAddress, MVT::i32, Custom);
- setOperationAction(ISD::ConstantPool, MVT::i32, Custom);
- setOperationAction(ISD::GLOBAL_OFFSET_TABLE, MVT::i32, Custom);
- setOperationAction(ISD::GlobalTLSAddress, MVT::i32, Custom);
-
- // Use the default implementation.
- setOperationAction(ISD::VASTART , MVT::Other, Custom);
- setOperationAction(ISD::VAARG , MVT::Other, Expand);
- setOperationAction(ISD::VACOPY , MVT::Other, Expand);
- setOperationAction(ISD::VAEND , MVT::Other, Expand);
- setOperationAction(ISD::STACKSAVE, MVT::Other, Expand);
- setOperationAction(ISD::STACKRESTORE, MVT::Other, Expand);
- setOperationAction(ISD::DYNAMIC_STACKALLOC, MVT::i32 , Expand);
- setOperationAction(ISD::MEMBARRIER , MVT::Other, Expand);
-
- if (!Subtarget->hasV6Ops()) {
- setOperationAction(ISD::SIGN_EXTEND_INREG, MVT::i16, Expand);
- setOperationAction(ISD::SIGN_EXTEND_INREG, MVT::i8, Expand);
- }
- setOperationAction(ISD::SIGN_EXTEND_INREG, MVT::i1, Expand);
-
- if (!UseSoftFloat && Subtarget->hasVFP2() && !Subtarget->isThumb())
- // Turn f64->i64 into FMRRD iff target supports vfp2.
- setOperationAction(ISD::BIT_CONVERT, MVT::i64, Custom);
-
- // We want to custom lower some of our intrinsics.
- setOperationAction(ISD::INTRINSIC_WO_CHAIN, MVT::Other, Custom);
-
- setOperationAction(ISD::SETCC , MVT::i32, Expand);
- setOperationAction(ISD::SETCC , MVT::f32, Expand);
- setOperationAction(ISD::SETCC , MVT::f64, Expand);
- setOperationAction(ISD::SELECT , MVT::i32, Expand);
- setOperationAction(ISD::SELECT , MVT::f32, Expand);
- setOperationAction(ISD::SELECT , MVT::f64, Expand);
- setOperationAction(ISD::SELECT_CC, MVT::i32, Custom);
- setOperationAction(ISD::SELECT_CC, MVT::f32, Custom);
- setOperationAction(ISD::SELECT_CC, MVT::f64, Custom);
-
- setOperationAction(ISD::BRCOND , MVT::Other, Expand);
- setOperationAction(ISD::BR_CC , MVT::i32, Custom);
- setOperationAction(ISD::BR_CC , MVT::f32, Custom);
- setOperationAction(ISD::BR_CC , MVT::f64, Custom);
- setOperationAction(ISD::BR_JT , MVT::Other, Custom);
-
- // We don't support sin/cos/fmod/copysign/pow
- setOperationAction(ISD::FSIN , MVT::f64, Expand);
- setOperationAction(ISD::FSIN , MVT::f32, Expand);
- setOperationAction(ISD::FCOS , MVT::f32, Expand);
- setOperationAction(ISD::FCOS , MVT::f64, Expand);
- setOperationAction(ISD::FREM , MVT::f64, Expand);
- setOperationAction(ISD::FREM , MVT::f32, Expand);
- if (!UseSoftFloat && Subtarget->hasVFP2() && !Subtarget->isThumb()) {
- setOperationAction(ISD::FCOPYSIGN, MVT::f64, Custom);
- setOperationAction(ISD::FCOPYSIGN, MVT::f32, Custom);
- }
- setOperationAction(ISD::FPOW , MVT::f64, Expand);
- setOperationAction(ISD::FPOW , MVT::f32, Expand);
-
- // int <-> fp are custom expanded into bit_convert + ARMISD ops.
- if (!UseSoftFloat && Subtarget->hasVFP2() && !Subtarget->isThumb()) {
- setOperationAction(ISD::SINT_TO_FP, MVT::i32, Custom);
- setOperationAction(ISD::UINT_TO_FP, MVT::i32, Custom);
- setOperationAction(ISD::FP_TO_UINT, MVT::i32, Custom);
- setOperationAction(ISD::FP_TO_SINT, MVT::i32, Custom);
- }
-
- // We have target-specific dag combine patterns for the following nodes:
- // ARMISD::FMRRD - No need to call setTargetDAGCombine
-
- setStackPointerRegisterToSaveRestore(ARM::SP);
- setSchedulingPreference(SchedulingForRegPressure);
- setIfCvtBlockSizeLimit(Subtarget->isThumb() ? 0 : 10);
- setIfCvtDupBlockSizeLimit(Subtarget->isThumb() ? 0 : 2);
-
- maxStoresPerMemcpy = 1; //// temporary - rewrite interface to use type
-}
-
-
-const char *ARMTargetLowering::getTargetNodeName(unsigned Opcode) const {
- switch (Opcode) {
- default: return 0;
- case ARMISD::Wrapper: return "ARMISD::Wrapper";
- case ARMISD::WrapperJT: return "ARMISD::WrapperJT";
- case ARMISD::CALL: return "ARMISD::CALL";
- case ARMISD::CALL_PRED: return "ARMISD::CALL_PRED";
- case ARMISD::CALL_NOLINK: return "ARMISD::CALL_NOLINK";
- case ARMISD::tCALL: return "ARMISD::tCALL";
- case ARMISD::BRCOND: return "ARMISD::BRCOND";
- case ARMISD::BR_JT: return "ARMISD::BR_JT";
- case ARMISD::RET_FLAG: return "ARMISD::RET_FLAG";
- case ARMISD::PIC_ADD: return "ARMISD::PIC_ADD";
- case ARMISD::CMP: return "ARMISD::CMP";
- case ARMISD::CMPNZ: return "ARMISD::CMPNZ";
- case ARMISD::CMPFP: return "ARMISD::CMPFP";
- case ARMISD::CMPFPw0: return "ARMISD::CMPFPw0";
- case ARMISD::FMSTAT: return "ARMISD::FMSTAT";
- case ARMISD::CMOV: return "ARMISD::CMOV";
- case ARMISD::CNEG: return "ARMISD::CNEG";
-
- case ARMISD::FTOSI: return "ARMISD::FTOSI";
- case ARMISD::FTOUI: return "ARMISD::FTOUI";
- case ARMISD::SITOF: return "ARMISD::SITOF";
- case ARMISD::UITOF: return "ARMISD::UITOF";
-
- case ARMISD::SRL_FLAG: return "ARMISD::SRL_FLAG";
- case ARMISD::SRA_FLAG: return "ARMISD::SRA_FLAG";
- case ARMISD::RRX: return "ARMISD::RRX";
-
- case ARMISD::FMRRD: return "ARMISD::FMRRD";
- case ARMISD::FMDRR: return "ARMISD::FMDRR";
-
- case ARMISD::THREAD_POINTER:return "ARMISD::THREAD_POINTER";
- }
-}
-
-//===----------------------------------------------------------------------===//
-// Lowering Code
-//===----------------------------------------------------------------------===//
-
-
-/// IntCCToARMCC - Convert a DAG integer condition code to an ARM CC
-static ARMCC::CondCodes IntCCToARMCC(ISD::CondCode CC) {
- switch (CC) {
- default: assert(0 && "Unknown condition code!");
- case ISD::SETNE: return ARMCC::NE;
- case ISD::SETEQ: return ARMCC::EQ;
- case ISD::SETGT: return ARMCC::GT;
- case ISD::SETGE: return ARMCC::GE;
- case ISD::SETLT: return ARMCC::LT;
- case ISD::SETLE: return ARMCC::LE;
- case ISD::SETUGT: return ARMCC::HI;
- case ISD::SETUGE: return ARMCC::HS;
- case ISD::SETULT: return ARMCC::LO;
- case ISD::SETULE: return ARMCC::LS;
- }
-}
-
-/// FPCCToARMCC - Convert a DAG fp condition code to an ARM CC. It
-/// returns true if the operands should be inverted to form the proper
-/// comparison.
-static bool FPCCToARMCC(ISD::CondCode CC, ARMCC::CondCodes &CondCode,
- ARMCC::CondCodes &CondCode2) {
- bool Invert = false;
- CondCode2 = ARMCC::AL;
- switch (CC) {
- default: assert(0 && "Unknown FP condition!");
- case ISD::SETEQ:
- case ISD::SETOEQ: CondCode = ARMCC::EQ; break;
- case ISD::SETGT:
- case ISD::SETOGT: CondCode = ARMCC::GT; break;
- case ISD::SETGE:
- case ISD::SETOGE: CondCode = ARMCC::GE; break;
- case ISD::SETOLT: CondCode = ARMCC::MI; break;
- case ISD::SETOLE: CondCode = ARMCC::GT; Invert = true; break;
- case ISD::SETONE: CondCode = ARMCC::MI; CondCode2 = ARMCC::GT; break;
- case ISD::SETO: CondCode = ARMCC::VC; break;
- case ISD::SETUO: CondCode = ARMCC::VS; break;
- case ISD::SETUEQ: CondCode = ARMCC::EQ; CondCode2 = ARMCC::VS; break;
- case ISD::SETUGT: CondCode = ARMCC::HI; break;
- case ISD::SETUGE: CondCode = ARMCC::PL; break;
- case ISD::SETLT:
- case ISD::SETULT: CondCode = ARMCC::LT; break;
- case ISD::SETLE:
- case ISD::SETULE: CondCode = ARMCC::LE; break;
- case ISD::SETNE:
- case ISD::SETUNE: CondCode = ARMCC::NE; break;
- }
- return Invert;
-}
-
-static void
-HowToPassArgument(MVT::ValueType ObjectVT, unsigned NumGPRs,
- unsigned StackOffset, unsigned &NeededGPRs,
- unsigned &NeededStackSize, unsigned &GPRPad,
- unsigned &StackPad, ISD::ArgFlagsTy Flags) {
- NeededStackSize = 0;
- NeededGPRs = 0;
- StackPad = 0;
- GPRPad = 0;
- unsigned align = Flags.getOrigAlign();
- GPRPad = NumGPRs % ((align + 3)/4);
- StackPad = StackOffset % align;
- unsigned firstGPR = NumGPRs + GPRPad;
- switch (ObjectVT) {
- default: assert(0 && "Unhandled argument type!");
- case MVT::i32:
- case MVT::f32:
- if (firstGPR < 4)
- NeededGPRs = 1;
- else
- NeededStackSize = 4;
- break;
- case MVT::i64:
- case MVT::f64:
- if (firstGPR < 3)
- NeededGPRs = 2;
- else if (firstGPR == 3) {
- NeededGPRs = 1;
- NeededStackSize = 4;
- } else
- NeededStackSize = 8;
- }
-}
-
-/// LowerCALL - Lowering a ISD::CALL node into a callseq_start <-
-/// ARMISD:CALL <- callseq_end chain. Also add input and output parameter
-/// nodes.
-SDOperand ARMTargetLowering::LowerCALL(SDOperand Op, SelectionDAG &DAG) {
- MVT::ValueType RetVT= Op.Val->getValueType(0);
- SDOperand Chain = Op.getOperand(0);
- unsigned CallConv = cast<ConstantSDNode>(Op.getOperand(1))->getValue();
- assert((CallConv == CallingConv::C ||
- CallConv == CallingConv::Fast) && "unknown calling convention");
- SDOperand Callee = Op.getOperand(4);
- unsigned NumOps = (Op.getNumOperands() - 5) / 2;
- unsigned ArgOffset = 0; // Frame mechanisms handle retaddr slot
- unsigned NumGPRs = 0; // GPRs used for parameter passing.
-
- // Count how many bytes are to be pushed on the stack.
- unsigned NumBytes = 0;
-
- // Add up all the space actually used.
- for (unsigned i = 0; i < NumOps; ++i) {
- unsigned ObjSize;
- unsigned ObjGPRs;
- unsigned StackPad;
- unsigned GPRPad;
- MVT::ValueType ObjectVT = Op.getOperand(5+2*i).getValueType();
- ISD::ArgFlagsTy Flags =
- cast<ARG_FLAGSSDNode>(Op.getOperand(5+2*i+1))->getArgFlags();
- HowToPassArgument(ObjectVT, NumGPRs, NumBytes, ObjGPRs, ObjSize,
- GPRPad, StackPad, Flags);
- NumBytes += ObjSize + StackPad;
- NumGPRs += ObjGPRs + GPRPad;
- }
-
- // Adjust the stack pointer for the new arguments...
- // These operations are automatically eliminated by the prolog/epilog pass
- Chain = DAG.getCALLSEQ_START(Chain,
- DAG.getConstant(NumBytes, MVT::i32));
-
- SDOperand StackPtr = DAG.getRegister(ARM::SP, MVT::i32);
-
- static const unsigned GPRArgRegs[] = {
- ARM::R0, ARM::R1, ARM::R2, ARM::R3
- };
-
- NumGPRs = 0;
- std::vector<std::pair<unsigned, SDOperand> > RegsToPass;
- std::vector<SDOperand> MemOpChains;
- for (unsigned i = 0; i != NumOps; ++i) {
- SDOperand Arg = Op.getOperand(5+2*i);
- ISD::ArgFlagsTy Flags =
- cast<ARG_FLAGSSDNode>(Op.getOperand(5+2*i+1))->getArgFlags();
- MVT::ValueType ArgVT = Arg.getValueType();
-
- unsigned ObjSize;
- unsigned ObjGPRs;
- unsigned GPRPad;
- unsigned StackPad;
- HowToPassArgument(ArgVT, NumGPRs, ArgOffset, ObjGPRs,
- ObjSize, GPRPad, StackPad, Flags);
- NumGPRs += GPRPad;
- ArgOffset += StackPad;
- if (ObjGPRs > 0) {
- switch (ArgVT) {
- default: assert(0 && "Unexpected ValueType for argument!");
- case MVT::i32:
- RegsToPass.push_back(std::make_pair(GPRArgRegs[NumGPRs], Arg));
- break;
- case MVT::f32:
- RegsToPass.push_back(std::make_pair(GPRArgRegs[NumGPRs],
- DAG.getNode(ISD::BIT_CONVERT, MVT::i32, Arg)));
- break;
- case MVT::i64: {
- SDOperand Lo = DAG.getNode(ISD::EXTRACT_ELEMENT, MVT::i32, Arg,
- DAG.getConstant(0, getPointerTy()));
- SDOperand Hi = DAG.getNode(ISD::EXTRACT_ELEMENT, MVT::i32, Arg,
- DAG.getConstant(1, getPointerTy()));
- RegsToPass.push_back(std::make_pair(GPRArgRegs[NumGPRs], Lo));
- if (ObjGPRs == 2)
- RegsToPass.push_back(std::make_pair(GPRArgRegs[NumGPRs+1], Hi));
- else {
- SDOperand PtrOff= DAG.getConstant(ArgOffset, StackPtr.getValueType());
- PtrOff = DAG.getNode(ISD::ADD, MVT::i32, StackPtr, PtrOff);
- MemOpChains.push_back(DAG.getStore(Chain, Hi, PtrOff, NULL, 0));
- }
- break;
- }
- case MVT::f64: {
- SDOperand Cvt = DAG.getNode(ARMISD::FMRRD,
- DAG.getVTList(MVT::i32, MVT::i32),
- &Arg, 1);
- RegsToPass.push_back(std::make_pair(GPRArgRegs[NumGPRs], Cvt));
- if (ObjGPRs == 2)
- RegsToPass.push_back(std::make_pair(GPRArgRegs[NumGPRs+1],
- Cvt.getValue(1)));
- else {
- SDOperand PtrOff= DAG.getConstant(ArgOffset, StackPtr.getValueType());
- PtrOff = DAG.getNode(ISD::ADD, MVT::i32, StackPtr, PtrOff);
- MemOpChains.push_back(DAG.getStore(Chain, Cvt.getValue(1), PtrOff,
- NULL, 0));
- }
- break;
- }
- }
- } else {
- assert(ObjSize != 0);
- SDOperand PtrOff = DAG.getConstant(ArgOffset, StackPtr.getValueType());
- PtrOff = DAG.getNode(ISD::ADD, MVT::i32, StackPtr, PtrOff);
- MemOpChains.push_back(DAG.getStore(Chain, Arg, PtrOff, NULL, 0));
- }
-
- NumGPRs += ObjGPRs;
- ArgOffset += ObjSize;
- }
-
- if (!MemOpChains.empty())
- Chain = DAG.getNode(ISD::TokenFactor, MVT::Other,
- &MemOpChains[0], MemOpChains.size());
-
- // Build a sequence of copy-to-reg nodes chained together with token chain
- // and flag operands which copy the outgoing args into the appropriate regs.
- SDOperand InFlag;
- for (unsigned i = 0, e = RegsToPass.size(); i != e; ++i) {
- Chain = DAG.getCopyToReg(Chain, RegsToPass[i].first, RegsToPass[i].second,
- InFlag);
- InFlag = Chain.getValue(1);
- }
-
- // If the callee is a GlobalAddress/ExternalSymbol node (quite common, every
- // direct call is) turn it into a TargetGlobalAddress/TargetExternalSymbol
- // node so that legalize doesn't hack it.
- bool isDirect = false;
- bool isARMFunc = false;
- bool isLocalARMFunc = false;
- if (GlobalAddressSDNode *G = dyn_cast<GlobalAddressSDNode>(Callee)) {
- GlobalValue *GV = G->getGlobal();
- isDirect = true;
- bool isExt = (GV->isDeclaration() || GV->hasWeakLinkage() ||
- GV->hasLinkOnceLinkage());
- bool isStub = (isExt && Subtarget->isTargetDarwin()) &&
- getTargetMachine().getRelocationModel() != Reloc::Static;
- isARMFunc = !Subtarget->isThumb() || isStub;
- // ARM call to a local ARM function is predicable.
- isLocalARMFunc = !Subtarget->isThumb() && !isExt;
- // tBX takes a register source operand.
- if (isARMFunc && Subtarget->isThumb() && !Subtarget->hasV5TOps()) {
- ARMConstantPoolValue *CPV = new ARMConstantPoolValue(GV, ARMPCLabelIndex,
- ARMCP::CPStub, 4);
- SDOperand CPAddr = DAG.getTargetConstantPool(CPV, getPointerTy(), 2);
- CPAddr = DAG.getNode(ARMISD::Wrapper, MVT::i32, CPAddr);
- Callee = DAG.getLoad(getPointerTy(), DAG.getEntryNode(), CPAddr, NULL, 0);
- SDOperand PICLabel = DAG.getConstant(ARMPCLabelIndex++, MVT::i32);
- Callee = DAG.getNode(ARMISD::PIC_ADD, getPointerTy(), Callee, PICLabel);
- } else
- Callee = DAG.getTargetGlobalAddress(GV, getPointerTy());
- } else if (ExternalSymbolSDNode *S = dyn_cast<ExternalSymbolSDNode>(Callee)) {
- isDirect = true;
- bool isStub = Subtarget->isTargetDarwin() &&
- getTargetMachine().getRelocationModel() != Reloc::Static;
- isARMFunc = !Subtarget->isThumb() || isStub;
- // tBX takes a register source operand.
- const char *Sym = S->getSymbol();
- if (isARMFunc && Subtarget->isThumb() && !Subtarget->hasV5TOps()) {
- ARMConstantPoolValue *CPV = new ARMConstantPoolValue(Sym, ARMPCLabelIndex,
- ARMCP::CPStub, 4);
- SDOperand CPAddr = DAG.getTargetConstantPool(CPV, getPointerTy(), 2);
- CPAddr = DAG.getNode(ARMISD::Wrapper, MVT::i32, CPAddr);
- Callee = DAG.getLoad(getPointerTy(), DAG.getEntryNode(), CPAddr, NULL, 0);
- SDOperand PICLabel = DAG.getConstant(ARMPCLabelIndex++, MVT::i32);
- Callee = DAG.getNode(ARMISD::PIC_ADD, getPointerTy(), Callee, PICLabel);
- } else
- Callee = DAG.getTargetExternalSymbol(Sym, getPointerTy());
- }
-
- // FIXME: handle tail calls differently.
- unsigned CallOpc;
- if (Subtarget->isThumb()) {
- if (!Subtarget->hasV5TOps() && (!isDirect || isARMFunc))
- CallOpc = ARMISD::CALL_NOLINK;
- else
- CallOpc = isARMFunc ? ARMISD::CALL : ARMISD::tCALL;
- } else {
- CallOpc = (isDirect || Subtarget->hasV5TOps())
- ? (isLocalARMFunc ? ARMISD::CALL_PRED : ARMISD::CALL)
- : ARMISD::CALL_NOLINK;
- }
- if (CallOpc == ARMISD::CALL_NOLINK && !Subtarget->isThumb()) {
- // implicit def LR - LR mustn't be allocated as GRP:$dst of CALL_NOLINK
- Chain = DAG.getCopyToReg(Chain, ARM::LR,
- DAG.getNode(ISD::UNDEF, MVT::i32), InFlag);
- InFlag = Chain.getValue(1);
- }
-
- std::vector<MVT::ValueType> NodeTys;
- NodeTys.push_back(MVT::Other); // Returns a chain
- NodeTys.push_back(MVT::Flag); // Returns a flag for retval copy to use.
-
- std::vector<SDOperand> Ops;
- Ops.push_back(Chain);
- Ops.push_back(Callee);
-
- // Add argument registers to the end of the list so that they are known live
- // into the call.
- for (unsigned i = 0, e = RegsToPass.size(); i != e; ++i)
- Ops.push_back(DAG.getRegister(RegsToPass[i].first,
- RegsToPass[i].second.getValueType()));
-
- if (InFlag.Val)
- Ops.push_back(InFlag);
- Chain = DAG.getNode(CallOpc, NodeTys, &Ops[0], Ops.size());
- InFlag = Chain.getValue(1);
-
- Chain = DAG.getCALLSEQ_END(Chain,
- DAG.getConstant(NumBytes, MVT::i32),
- DAG.getConstant(0, MVT::i32),
- InFlag);
- if (RetVT != MVT::Other)
- InFlag = Chain.getValue(1);
-
- std::vector<SDOperand> ResultVals;
- NodeTys.clear();
-
- // If the call has results, copy the values out of the ret val registers.
- switch (RetVT) {
- default: assert(0 && "Unexpected ret value!");
- case MVT::Other:
- break;
- case MVT::i32:
- Chain = DAG.getCopyFromReg(Chain, ARM::R0, MVT::i32, InFlag).getValue(1);
- ResultVals.push_back(Chain.getValue(0));
- if (Op.Val->getValueType(1) == MVT::i32) {
- // Returns a i64 value.
- Chain = DAG.getCopyFromReg(Chain, ARM::R1, MVT::i32,
- Chain.getValue(2)).getValue(1);
- ResultVals.push_back(Chain.getValue(0));
- NodeTys.push_back(MVT::i32);
- }
- NodeTys.push_back(MVT::i32);
- break;
- case MVT::f32:
- Chain = DAG.getCopyFromReg(Chain, ARM::R0, MVT::i32, InFlag).getValue(1);
- ResultVals.push_back(DAG.getNode(ISD::BIT_CONVERT, MVT::f32,
- Chain.getValue(0)));
- NodeTys.push_back(MVT::f32);
- break;
- case MVT::f64: {
- SDOperand Lo = DAG.getCopyFromReg(Chain, ARM::R0, MVT::i32, InFlag);
- SDOperand Hi = DAG.getCopyFromReg(Lo, ARM::R1, MVT::i32, Lo.getValue(2));
- ResultVals.push_back(DAG.getNode(ARMISD::FMDRR, MVT::f64, Lo, Hi));
- NodeTys.push_back(MVT::f64);
- break;
- }
- }
-
- NodeTys.push_back(MVT::Other);
-
- if (ResultVals.empty())
- return Chain;
-
- ResultVals.push_back(Chain);
- SDOperand Res = DAG.getNode(ISD::MERGE_VALUES, NodeTys, &ResultVals[0],
- ResultVals.size());
- return Res.getValue(Op.ResNo);
-}
-
-static SDOperand LowerRET(SDOperand Op, SelectionDAG &DAG) {
- SDOperand Copy;
- SDOperand Chain = Op.getOperand(0);
- switch(Op.getNumOperands()) {
- default:
- assert(0 && "Do not know how to return this many arguments!");
- abort();
- case 1: {
- SDOperand LR = DAG.getRegister(ARM::LR, MVT::i32);
- return DAG.getNode(ARMISD::RET_FLAG, MVT::Other, Chain);
- }
- case 3:
- Op = Op.getOperand(1);
- if (Op.getValueType() == MVT::f32) {
- Op = DAG.getNode(ISD::BIT_CONVERT, MVT::i32, Op);
- } else if (Op.getValueType() == MVT::f64) {
- // Legalize ret f64 -> ret 2 x i32. We always have fmrrd if f64 is
- // available.
- Op = DAG.getNode(ARMISD::FMRRD, DAG.getVTList(MVT::i32, MVT::i32), &Op,1);
- SDOperand Sign = DAG.getConstant(0, MVT::i32);
- return DAG.getNode(ISD::RET, MVT::Other, Chain, Op, Sign,
- Op.getValue(1), Sign);
- }
- Copy = DAG.getCopyToReg(Chain, ARM::R0, Op, SDOperand());
- if (DAG.getMachineFunction().getRegInfo().liveout_empty())
- DAG.getMachineFunction().getRegInfo().addLiveOut(ARM::R0);
- break;
- case 5:
- Copy = DAG.getCopyToReg(Chain, ARM::R1, Op.getOperand(3), SDOperand());
- Copy = DAG.getCopyToReg(Copy, ARM::R0, Op.getOperand(1), Copy.getValue(1));
- // If we haven't noted the R0+R1 are live out, do so now.
- if (DAG.getMachineFunction().getRegInfo().liveout_empty()) {
- DAG.getMachineFunction().getRegInfo().addLiveOut(ARM::R0);
- DAG.getMachineFunction().getRegInfo().addLiveOut(ARM::R1);
- }
- break;
- }
-
- //We must use RET_FLAG instead of BRIND because BRIND doesn't have a flag
- return DAG.getNode(ARMISD::RET_FLAG, MVT::Other, Copy, Copy.getValue(1));
-}
-
-// ConstantPool, JumpTable, GlobalAddress, and ExternalSymbol are lowered as
-// their target countpart wrapped in the ARMISD::Wrapper node. Suppose N is
-// one of the above mentioned nodes. It has to be wrapped because otherwise
-// Select(N) returns N. So the raw TargetGlobalAddress nodes, etc. can only
-// be used to form addressing mode. These wrapped nodes will be selected
-// into MOVi.
-static SDOperand LowerConstantPool(SDOperand Op, SelectionDAG &DAG) {
- MVT::ValueType PtrVT = Op.getValueType();
- ConstantPoolSDNode *CP = cast<ConstantPoolSDNode>(Op);
- SDOperand Res;
- if (CP->isMachineConstantPoolEntry())
- Res = DAG.getTargetConstantPool(CP->getMachineCPVal(), PtrVT,
- CP->getAlignment());
- else
- Res = DAG.getTargetConstantPool(CP->getConstVal(), PtrVT,
- CP->getAlignment());
- return DAG.getNode(ARMISD::Wrapper, MVT::i32, Res);
-}
-
-// Lower ISD::GlobalTLSAddress using the "general dynamic" model
-SDOperand
-ARMTargetLowering::LowerToTLSGeneralDynamicModel(GlobalAddressSDNode *GA,
- SelectionDAG &DAG) {
- MVT::ValueType PtrVT = getPointerTy();
- unsigned char PCAdj = Subtarget->isThumb() ? 4 : 8;
- ARMConstantPoolValue *CPV =
- new ARMConstantPoolValue(GA->getGlobal(), ARMPCLabelIndex, ARMCP::CPValue,
- PCAdj, "tlsgd", true);
- SDOperand Argument = DAG.getTargetConstantPool(CPV, PtrVT, 2);
- Argument = DAG.getNode(ARMISD::Wrapper, MVT::i32, Argument);
- Argument = DAG.getLoad(PtrVT, DAG.getEntryNode(), Argument, NULL, 0);
- SDOperand Chain = Argument.getValue(1);
-
- SDOperand PICLabel = DAG.getConstant(ARMPCLabelIndex++, MVT::i32);
- Argument = DAG.getNode(ARMISD::PIC_ADD, PtrVT, Argument, PICLabel);
-
- // call __tls_get_addr.
- ArgListTy Args;
- ArgListEntry Entry;
- Entry.Node = Argument;
- Entry.Ty = (const Type *) Type::Int32Ty;
- Args.push_back(Entry);
- std::pair<SDOperand, SDOperand> CallResult =
- LowerCallTo(Chain, (const Type *) Type::Int32Ty, false, false, false,
- CallingConv::C, false,
- DAG.getExternalSymbol("__tls_get_addr", PtrVT), Args, DAG);
- return CallResult.first;
-}
-
-// Lower ISD::GlobalTLSAddress using the "initial exec" or
-// "local exec" model.
-SDOperand
-ARMTargetLowering::LowerToTLSExecModels(GlobalAddressSDNode *GA,
- SelectionDAG &DAG) {
- GlobalValue *GV = GA->getGlobal();
- SDOperand Offset;
- SDOperand Chain = DAG.getEntryNode();
- MVT::ValueType PtrVT = getPointerTy();
- // Get the Thread Pointer
- SDOperand ThreadPointer = DAG.getNode(ARMISD::THREAD_POINTER, PtrVT);
-
- if (GV->isDeclaration()){
- // initial exec model
- unsigned char PCAdj = Subtarget->isThumb() ? 4 : 8;
- ARMConstantPoolValue *CPV =
- new ARMConstantPoolValue(GA->getGlobal(), ARMPCLabelIndex, ARMCP::CPValue,
- PCAdj, "gottpoff", true);
- Offset = DAG.getTargetConstantPool(CPV, PtrVT, 2);
- Offset = DAG.getNode(ARMISD::Wrapper, MVT::i32, Offset);
- Offset = DAG.getLoad(PtrVT, Chain, Offset, NULL, 0);
- Chain = Offset.getValue(1);
-
- SDOperand PICLabel = DAG.getConstant(ARMPCLabelIndex++, MVT::i32);
- Offset = DAG.getNode(ARMISD::PIC_ADD, PtrVT, Offset, PICLabel);
-
- Offset = DAG.getLoad(PtrVT, Chain, Offset, NULL, 0);
- } else {
- // local exec model
- ARMConstantPoolValue *CPV =
- new ARMConstantPoolValue(GV, ARMCP::CPValue, "tpoff");
- Offset = DAG.getTargetConstantPool(CPV, PtrVT, 2);
- Offset = DAG.getNode(ARMISD::Wrapper, MVT::i32, Offset);
- Offset = DAG.getLoad(PtrVT, Chain, Offset, NULL, 0);
- }
-
- // The address of the thread local variable is the add of the thread
- // pointer with the offset of the variable.
- return DAG.getNode(ISD::ADD, PtrVT, ThreadPointer, Offset);
-}
-
-SDOperand
-ARMTargetLowering::LowerGlobalTLSAddress(SDOperand Op, SelectionDAG &DAG) {
- // TODO: implement the "local dynamic" model
- assert(Subtarget->isTargetELF() &&
- "TLS not implemented for non-ELF targets");
- GlobalAddressSDNode *GA = cast<GlobalAddressSDNode>(Op);
- // If the relocation model is PIC, use the "General Dynamic" TLS Model,
- // otherwise use the "Local Exec" TLS Model
- if (getTargetMachine().getRelocationModel() == Reloc::PIC_)
- return LowerToTLSGeneralDynamicModel(GA, DAG);
- else
- return LowerToTLSExecModels(GA, DAG);
-}
-
-SDOperand ARMTargetLowering::LowerGlobalAddressELF(SDOperand Op,
- SelectionDAG &DAG) {
- MVT::ValueType PtrVT = getPointerTy();
- GlobalValue *GV = cast<GlobalAddressSDNode>(Op)->getGlobal();
- Reloc::Model RelocM = getTargetMachine().getRelocationModel();
- if (RelocM == Reloc::PIC_) {
- bool UseGOTOFF = GV->hasInternalLinkage() || GV->hasHiddenVisibility();
- ARMConstantPoolValue *CPV =
- new ARMConstantPoolValue(GV, ARMCP::CPValue, UseGOTOFF ? "GOTOFF":"GOT");
- SDOperand CPAddr = DAG.getTargetConstantPool(CPV, PtrVT, 2);
- CPAddr = DAG.getNode(ARMISD::Wrapper, MVT::i32, CPAddr);
- SDOperand Result = DAG.getLoad(PtrVT, DAG.getEntryNode(), CPAddr, NULL, 0);
- SDOperand Chain = Result.getValue(1);
- SDOperand GOT = DAG.getNode(ISD::GLOBAL_OFFSET_TABLE, PtrVT);
- Result = DAG.getNode(ISD::ADD, PtrVT, Result, GOT);
- if (!UseGOTOFF)
- Result = DAG.getLoad(PtrVT, Chain, Result, NULL, 0);
- return Result;
- } else {
- SDOperand CPAddr = DAG.getTargetConstantPool(GV, PtrVT, 2);
- CPAddr = DAG.getNode(ARMISD::Wrapper, MVT::i32, CPAddr);
- return DAG.getLoad(PtrVT, DAG.getEntryNode(), CPAddr, NULL, 0);
- }
-}
-
-/// GVIsIndirectSymbol - true if the GV will be accessed via an indirect symbol
-/// even in non-static mode.
-static bool GVIsIndirectSymbol(GlobalValue *GV, Reloc::Model RelocM) {
- return RelocM != Reloc::Static &&
- (GV->hasWeakLinkage() || GV->hasLinkOnceLinkage() ||
- (GV->isDeclaration() && !GV->hasNotBeenReadFromBitcode()));
-}
-
-SDOperand ARMTargetLowering::LowerGlobalAddressDarwin(SDOperand Op,
- SelectionDAG &DAG) {
- MVT::ValueType PtrVT = getPointerTy();
- GlobalValue *GV = cast<GlobalAddressSDNode>(Op)->getGlobal();
- Reloc::Model RelocM = getTargetMachine().getRelocationModel();
- bool IsIndirect = GVIsIndirectSymbol(GV, RelocM);
- SDOperand CPAddr;
- if (RelocM == Reloc::Static)
- CPAddr = DAG.getTargetConstantPool(GV, PtrVT, 2);
- else {
- unsigned PCAdj = (RelocM != Reloc::PIC_)
- ? 0 : (Subtarget->isThumb() ? 4 : 8);
- ARMCP::ARMCPKind Kind = IsIndirect ? ARMCP::CPNonLazyPtr
- : ARMCP::CPValue;
- ARMConstantPoolValue *CPV = new ARMConstantPoolValue(GV, ARMPCLabelIndex,
- Kind, PCAdj);
- CPAddr = DAG.getTargetConstantPool(CPV, PtrVT, 2);
- }
- CPAddr = DAG.getNode(ARMISD::Wrapper, MVT::i32, CPAddr);
-
- SDOperand Result = DAG.getLoad(PtrVT, DAG.getEntryNode(), CPAddr, NULL, 0);
- SDOperand Chain = Result.getValue(1);
-
- if (RelocM == Reloc::PIC_) {
- SDOperand PICLabel = DAG.getConstant(ARMPCLabelIndex++, MVT::i32);
- Result = DAG.getNode(ARMISD::PIC_ADD, PtrVT, Result, PICLabel);
- }
- if (IsIndirect)
- Result = DAG.getLoad(PtrVT, Chain, Result, NULL, 0);
-
- return Result;
-}
-
-SDOperand ARMTargetLowering::LowerGLOBAL_OFFSET_TABLE(SDOperand Op,
- SelectionDAG &DAG){
- assert(Subtarget->isTargetELF() &&
- "GLOBAL OFFSET TABLE not implemented for non-ELF targets");
- MVT::ValueType PtrVT = getPointerTy();
- unsigned PCAdj = Subtarget->isThumb() ? 4 : 8;
- ARMConstantPoolValue *CPV = new ARMConstantPoolValue("_GLOBAL_OFFSET_TABLE_",
- ARMPCLabelIndex,
- ARMCP::CPValue, PCAdj);
- SDOperand CPAddr = DAG.getTargetConstantPool(CPV, PtrVT, 2);
- CPAddr = DAG.getNode(ARMISD::Wrapper, MVT::i32, CPAddr);
- SDOperand Result = DAG.getLoad(PtrVT, DAG.getEntryNode(), CPAddr, NULL, 0);
- SDOperand PICLabel = DAG.getConstant(ARMPCLabelIndex++, MVT::i32);
- return DAG.getNode(ARMISD::PIC_ADD, PtrVT, Result, PICLabel);
-}
-
-static SDOperand LowerINTRINSIC_WO_CHAIN(SDOperand Op, SelectionDAG &DAG) {
- MVT::ValueType PtrVT = DAG.getTargetLoweringInfo().getPointerTy();
- unsigned IntNo = cast<ConstantSDNode>(Op.getOperand(0))->getValue();
- switch (IntNo) {
- default: return SDOperand(); // Don't custom lower most intrinsics.
- case Intrinsic::arm_thread_pointer:
- return DAG.getNode(ARMISD::THREAD_POINTER, PtrVT);
- }
-}
-
-static SDOperand LowerVASTART(SDOperand Op, SelectionDAG &DAG,
- unsigned VarArgsFrameIndex) {
- // vastart just stores the address of the VarArgsFrameIndex slot into the
- // memory location argument.
- MVT::ValueType PtrVT = DAG.getTargetLoweringInfo().getPointerTy();
- SDOperand FR = DAG.getFrameIndex(VarArgsFrameIndex, PtrVT);
- const Value *SV = cast<SrcValueSDNode>(Op.getOperand(2))->getValue();
- return DAG.getStore(Op.getOperand(0), FR, Op.getOperand(1), SV, 0);
-}
-
-static SDOperand LowerFORMAL_ARGUMENT(SDOperand Op, SelectionDAG &DAG,
- unsigned ArgNo, unsigned &NumGPRs,
- unsigned &ArgOffset) {
- MachineFunction &MF = DAG.getMachineFunction();
- MVT::ValueType ObjectVT = Op.getValue(ArgNo).getValueType();
- SDOperand Root = Op.getOperand(0);
- std::vector<SDOperand> ArgValues;
- MachineRegisterInfo &RegInfo = MF.getRegInfo();
-
- static const unsigned GPRArgRegs[] = {
- ARM::R0, ARM::R1, ARM::R2, ARM::R3
- };
-
- unsigned ObjSize;
- unsigned ObjGPRs;
- unsigned GPRPad;
- unsigned StackPad;
- ISD::ArgFlagsTy Flags =
- cast<ARG_FLAGSSDNode>(Op.getOperand(ArgNo + 3))->getArgFlags();
- HowToPassArgument(ObjectVT, NumGPRs, ArgOffset, ObjGPRs,
- ObjSize, GPRPad, StackPad, Flags);
- NumGPRs += GPRPad;
- ArgOffset += StackPad;
-
- SDOperand ArgValue;
- if (ObjGPRs == 1) {
- unsigned VReg = RegInfo.createVirtualRegister(&ARM::GPRRegClass);
- RegInfo.addLiveIn(GPRArgRegs[NumGPRs], VReg);
- ArgValue = DAG.getCopyFromReg(Root, VReg, MVT::i32);
- if (ObjectVT == MVT::f32)
- ArgValue = DAG.getNode(ISD::BIT_CONVERT, MVT::f32, ArgValue);
- } else if (ObjGPRs == 2) {
- unsigned VReg = RegInfo.createVirtualRegister(&ARM::GPRRegClass);
- RegInfo.addLiveIn(GPRArgRegs[NumGPRs], VReg);
- ArgValue = DAG.getCopyFromReg(Root, VReg, MVT::i32);
-
- VReg = RegInfo.createVirtualRegister(&ARM::GPRRegClass);
- RegInfo.addLiveIn(GPRArgRegs[NumGPRs+1], VReg);
- SDOperand ArgValue2 = DAG.getCopyFromReg(Root, VReg, MVT::i32);
-
- assert(ObjectVT != MVT::i64 && "i64 should already be lowered");
- ArgValue = DAG.getNode(ARMISD::FMDRR, MVT::f64, ArgValue, ArgValue2);
- }
- NumGPRs += ObjGPRs;
-
- if (ObjSize) {
- MachineFrameInfo *MFI = MF.getFrameInfo();
- int FI = MFI->CreateFixedObject(ObjSize, ArgOffset);
- SDOperand FIN = DAG.getFrameIndex(FI, MVT::i32);
- if (ObjGPRs == 0)
- ArgValue = DAG.getLoad(ObjectVT, Root, FIN, NULL, 0);
- else {
- SDOperand ArgValue2 = DAG.getLoad(MVT::i32, Root, FIN, NULL, 0);
- assert(ObjectVT != MVT::i64 && "i64 should already be lowered");
- ArgValue = DAG.getNode(ARMISD::FMDRR, MVT::f64, ArgValue, ArgValue2);
- }
-
- ArgOffset += ObjSize; // Move on to the next argument.
- }
-
- return ArgValue;
-}
-
-SDOperand
-ARMTargetLowering::LowerFORMAL_ARGUMENTS(SDOperand Op, SelectionDAG &DAG) {
- std::vector<SDOperand> ArgValues;
- SDOperand Root = Op.getOperand(0);
- unsigned ArgOffset = 0; // Frame mechanisms handle retaddr slot
- unsigned NumGPRs = 0; // GPRs used for parameter passing.
-
- unsigned NumArgs = Op.Val->getNumValues()-1;
- for (unsigned ArgNo = 0; ArgNo < NumArgs; ++ArgNo)
- ArgValues.push_back(LowerFORMAL_ARGUMENT(Op, DAG, ArgNo,
- NumGPRs, ArgOffset));
-
- bool isVarArg = cast<ConstantSDNode>(Op.getOperand(2))->getValue() != 0;
- if (isVarArg) {
- static const unsigned GPRArgRegs[] = {
- ARM::R0, ARM::R1, ARM::R2, ARM::R3
- };
-
- MachineFunction &MF = DAG.getMachineFunction();
- MachineRegisterInfo &RegInfo = MF.getRegInfo();
- MachineFrameInfo *MFI = MF.getFrameInfo();
- ARMFunctionInfo *AFI = MF.getInfo<ARMFunctionInfo>();
- unsigned Align = MF.getTarget().getFrameInfo()->getStackAlignment();
- unsigned VARegSize = (4 - NumGPRs) * 4;
- unsigned VARegSaveSize = (VARegSize + Align - 1) & ~(Align - 1);
- if (VARegSaveSize) {
- // If this function is vararg, store any remaining integer argument regs
- // to their spots on the stack so that they may be loaded by deferencing
- // the result of va_next.
- AFI->setVarArgsRegSaveSize(VARegSaveSize);
- VarArgsFrameIndex = MFI->CreateFixedObject(VARegSaveSize, ArgOffset +
- VARegSaveSize - VARegSize);
- SDOperand FIN = DAG.getFrameIndex(VarArgsFrameIndex, getPointerTy());
-
- SmallVector<SDOperand, 4> MemOps;
- for (; NumGPRs < 4; ++NumGPRs) {
- unsigned VReg = RegInfo.createVirtualRegister(&ARM::GPRRegClass);
- RegInfo.addLiveIn(GPRArgRegs[NumGPRs], VReg);
- SDOperand Val = DAG.getCopyFromReg(Root, VReg, MVT::i32);
- SDOperand Store = DAG.getStore(Val.getValue(1), Val, FIN, NULL, 0);
- MemOps.push_back(Store);
- FIN = DAG.getNode(ISD::ADD, getPointerTy(), FIN,
- DAG.getConstant(4, getPointerTy()));
- }
- if (!MemOps.empty())
- Root = DAG.getNode(ISD::TokenFactor, MVT::Other,
- &MemOps[0], MemOps.size());
- } else
- // This will point to the next argument passed via stack.
- VarArgsFrameIndex = MFI->CreateFixedObject(4, ArgOffset);
- }
-
- ArgValues.push_back(Root);
-
- // Return the new list of results.
- std::vector<MVT::ValueType> RetVT(Op.Val->value_begin(),
- Op.Val->value_end());
- return DAG.getNode(ISD::MERGE_VALUES, RetVT, &ArgValues[0], ArgValues.size());
-}
-
-/// isFloatingPointZero - Return true if this is +0.0.
-static bool isFloatingPointZero(SDOperand Op) {
- if (ConstantFPSDNode *CFP = dyn_cast<ConstantFPSDNode>(Op))
- return CFP->getValueAPF().isPosZero();
- else if (ISD::isEXTLoad(Op.Val) || ISD::isNON_EXTLoad(Op.Val)) {
- // Maybe this has already been legalized into the constant pool?
- if (Op.getOperand(1).getOpcode() == ARMISD::Wrapper) {
- SDOperand WrapperOp = Op.getOperand(1).getOperand(0);
- if (ConstantPoolSDNode *CP = dyn_cast<ConstantPoolSDNode>(WrapperOp))
- if (ConstantFP *CFP = dyn_cast<ConstantFP>(CP->getConstVal()))
- return CFP->getValueAPF().isPosZero();
- }
- }
- return false;
-}
-
-static bool isLegalCmpImmediate(unsigned C, bool isThumb) {
- return ( isThumb && (C & ~255U) == 0) ||
- (!isThumb && ARM_AM::getSOImmVal(C) != -1);
-}
-
-/// Returns appropriate ARM CMP (cmp) and corresponding condition code for
-/// the given operands.
-static SDOperand getARMCmp(SDOperand LHS, SDOperand RHS, ISD::CondCode CC,
- SDOperand &ARMCC, SelectionDAG &DAG, bool isThumb) {
- if (ConstantSDNode *RHSC = dyn_cast<ConstantSDNode>(RHS.Val)) {
- unsigned C = RHSC->getValue();
- if (!isLegalCmpImmediate(C, isThumb)) {
- // Constant does not fit, try adjusting it by one?
- switch (CC) {
- default: break;
- case ISD::SETLT:
- case ISD::SETGE:
- if (isLegalCmpImmediate(C-1, isThumb)) {
- CC = (CC == ISD::SETLT) ? ISD::SETLE : ISD::SETGT;
- RHS = DAG.getConstant(C-1, MVT::i32);
- }
- break;
- case ISD::SETULT:
- case ISD::SETUGE:
- if (C > 0 && isLegalCmpImmediate(C-1, isThumb)) {
- CC = (CC == ISD::SETULT) ? ISD::SETULE : ISD::SETUGT;
- RHS = DAG.getConstant(C-1, MVT::i32);
- }
- break;
- case ISD::SETLE:
- case ISD::SETGT:
- if (isLegalCmpImmediate(C+1, isThumb)) {
- CC = (CC == ISD::SETLE) ? ISD::SETLT : ISD::SETGE;
- RHS = DAG.getConstant(C+1, MVT::i32);
- }
- break;
- case ISD::SETULE:
- case ISD::SETUGT:
- if (C < 0xffffffff && isLegalCmpImmediate(C+1, isThumb)) {
- CC = (CC == ISD::SETULE) ? ISD::SETULT : ISD::SETUGE;
- RHS = DAG.getConstant(C+1, MVT::i32);
- }
- break;
- }
- }
- }
-
- ARMCC::CondCodes CondCode = IntCCToARMCC(CC);
- ARMISD::NodeType CompareType;
- switch (CondCode) {
- default:
- CompareType = ARMISD::CMP;
- break;
- case ARMCC::EQ:
- case ARMCC::NE:
- case ARMCC::MI:
- case ARMCC::PL:
- // Uses only N and Z Flags
- CompareType = ARMISD::CMPNZ;
- break;
- }
- ARMCC = DAG.getConstant(CondCode, MVT::i32);
- return DAG.getNode(CompareType, MVT::Flag, LHS, RHS);
-}
-
-/// Returns a appropriate VFP CMP (fcmp{s|d}+fmstat) for the given operands.
-static SDOperand getVFPCmp(SDOperand LHS, SDOperand RHS, SelectionDAG &DAG) {
- SDOperand Cmp;
- if (!isFloatingPointZero(RHS))
- Cmp = DAG.getNode(ARMISD::CMPFP, MVT::Flag, LHS, RHS);
- else
- Cmp = DAG.getNode(ARMISD::CMPFPw0, MVT::Flag, LHS);
- return DAG.getNode(ARMISD::FMSTAT, MVT::Flag, Cmp);
-}
-
-static SDOperand LowerSELECT_CC(SDOperand Op, SelectionDAG &DAG,
- const ARMSubtarget *ST) {
- MVT::ValueType VT = Op.getValueType();
- SDOperand LHS = Op.getOperand(0);
- SDOperand RHS = Op.getOperand(1);
- ISD::CondCode CC = cast<CondCodeSDNode>(Op.getOperand(4))->get();
- SDOperand TrueVal = Op.getOperand(2);
- SDOperand FalseVal = Op.getOperand(3);
-
- if (LHS.getValueType() == MVT::i32) {
- SDOperand ARMCC;
- SDOperand CCR = DAG.getRegister(ARM::CPSR, MVT::i32);
- SDOperand Cmp = getARMCmp(LHS, RHS, CC, ARMCC, DAG, ST->isThumb());
- return DAG.getNode(ARMISD::CMOV, VT, FalseVal, TrueVal, ARMCC, CCR, Cmp);
- }
-
- ARMCC::CondCodes CondCode, CondCode2;
- if (FPCCToARMCC(CC, CondCode, CondCode2))
- std::swap(TrueVal, FalseVal);
-
- SDOperand ARMCC = DAG.getConstant(CondCode, MVT::i32);
- SDOperand CCR = DAG.getRegister(ARM::CPSR, MVT::i32);
- SDOperand Cmp = getVFPCmp(LHS, RHS, DAG);
- SDOperand Result = DAG.getNode(ARMISD::CMOV, VT, FalseVal, TrueVal,
- ARMCC, CCR, Cmp);
- if (CondCode2 != ARMCC::AL) {
- SDOperand ARMCC2 = DAG.getConstant(CondCode2, MVT::i32);
- // FIXME: Needs another CMP because flag can have but one use.
- SDOperand Cmp2 = getVFPCmp(LHS, RHS, DAG);
- Result = DAG.getNode(ARMISD::CMOV, VT, Result, TrueVal, ARMCC2, CCR, Cmp2);
- }
- return Result;
-}
-
-static SDOperand LowerBR_CC(SDOperand Op, SelectionDAG &DAG,
- const ARMSubtarget *ST) {
- SDOperand Chain = Op.getOperand(0);
- ISD::CondCode CC = cast<CondCodeSDNode>(Op.getOperand(1))->get();
- SDOperand LHS = Op.getOperand(2);
- SDOperand RHS = Op.getOperand(3);
- SDOperand Dest = Op.getOperand(4);
-
- if (LHS.getValueType() == MVT::i32) {
- SDOperand ARMCC;
- SDOperand CCR = DAG.getRegister(ARM::CPSR, MVT::i32);
- SDOperand Cmp = getARMCmp(LHS, RHS, CC, ARMCC, DAG, ST->isThumb());
- return DAG.getNode(ARMISD::BRCOND, MVT::Other, Chain, Dest, ARMCC, CCR,Cmp);
- }
-
- assert(LHS.getValueType() == MVT::f32 || LHS.getValueType() == MVT::f64);
- ARMCC::CondCodes CondCode, CondCode2;
- if (FPCCToARMCC(CC, CondCode, CondCode2))
- // Swap the LHS/RHS of the comparison if needed.
- std::swap(LHS, RHS);
-
- SDOperand Cmp = getVFPCmp(LHS, RHS, DAG);
- SDOperand ARMCC = DAG.getConstant(CondCode, MVT::i32);
- SDOperand CCR = DAG.getRegister(ARM::CPSR, MVT::i32);
- SDVTList VTList = DAG.getVTList(MVT::Other, MVT::Flag);
- SDOperand Ops[] = { Chain, Dest, ARMCC, CCR, Cmp };
- SDOperand Res = DAG.getNode(ARMISD::BRCOND, VTList, Ops, 5);
- if (CondCode2 != ARMCC::AL) {
- ARMCC = DAG.getConstant(CondCode2, MVT::i32);
- SDOperand Ops[] = { Res, Dest, ARMCC, CCR, Res.getValue(1) };
- Res = DAG.getNode(ARMISD::BRCOND, VTList, Ops, 5);
- }
- return Res;
-}
-
-SDOperand ARMTargetLowering::LowerBR_JT(SDOperand Op, SelectionDAG &DAG) {
- SDOperand Chain = Op.getOperand(0);
- SDOperand Table = Op.getOperand(1);
- SDOperand Index = Op.getOperand(2);
-
- MVT::ValueType PTy = getPointerTy();
- JumpTableSDNode *JT = cast<JumpTableSDNode>(Table);
- ARMFunctionInfo *AFI = DAG.getMachineFunction().getInfo<ARMFunctionInfo>();
- SDOperand UId = DAG.getConstant(AFI->createJumpTableUId(), PTy);
- SDOperand JTI = DAG.getTargetJumpTable(JT->getIndex(), PTy);
- Table = DAG.getNode(ARMISD::WrapperJT, MVT::i32, JTI, UId);
- Index = DAG.getNode(ISD::MUL, PTy, Index, DAG.getConstant(4, PTy));
- SDOperand Addr = DAG.getNode(ISD::ADD, PTy, Index, Table);
- bool isPIC = getTargetMachine().getRelocationModel() == Reloc::PIC_;
- Addr = DAG.getLoad(isPIC ? (MVT::ValueType)MVT::i32 : PTy,
- Chain, Addr, NULL, 0);
- Chain = Addr.getValue(1);
- if (isPIC)
- Addr = DAG.getNode(ISD::ADD, PTy, Addr, Table);
- return DAG.getNode(ARMISD::BR_JT, MVT::Other, Chain, Addr, JTI, UId);
-}
-
-static SDOperand LowerFP_TO_INT(SDOperand Op, SelectionDAG &DAG) {
- unsigned Opc =
- Op.getOpcode() == ISD::FP_TO_SINT ? ARMISD::FTOSI : ARMISD::FTOUI;
- Op = DAG.getNode(Opc, MVT::f32, Op.getOperand(0));
- return DAG.getNode(ISD::BIT_CONVERT, MVT::i32, Op);
-}
-
-static SDOperand LowerINT_TO_FP(SDOperand Op, SelectionDAG &DAG) {
- MVT::ValueType VT = Op.getValueType();
- unsigned Opc =
- Op.getOpcode() == ISD::SINT_TO_FP ? ARMISD::SITOF : ARMISD::UITOF;
-
- Op = DAG.getNode(ISD::BIT_CONVERT, MVT::f32, Op.getOperand(0));
- return DAG.getNode(Opc, VT, Op);
-}
-
-static SDOperand LowerFCOPYSIGN(SDOperand Op, SelectionDAG &DAG) {
- // Implement fcopysign with a fabs and a conditional fneg.
- SDOperand Tmp0 = Op.getOperand(0);
- SDOperand Tmp1 = Op.getOperand(1);
- MVT::ValueType VT = Op.getValueType();
- MVT::ValueType SrcVT = Tmp1.getValueType();
- SDOperand AbsVal = DAG.getNode(ISD::FABS, VT, Tmp0);
- SDOperand Cmp = getVFPCmp(Tmp1, DAG.getConstantFP(0.0, SrcVT), DAG);
- SDOperand ARMCC = DAG.getConstant(ARMCC::LT, MVT::i32);
- SDOperand CCR = DAG.getRegister(ARM::CPSR, MVT::i32);
- return DAG.getNode(ARMISD::CNEG, VT, AbsVal, AbsVal, ARMCC, CCR, Cmp);
-}
-
-SDOperand
-ARMTargetLowering::EmitTargetCodeForMemcpy(SelectionDAG &DAG,
- SDOperand Chain,
- SDOperand Dst, SDOperand Src,
- SDOperand Size, unsigned Align,
- bool AlwaysInline,
- const Value *DstSV, uint64_t DstSVOff,
- const Value *SrcSV, uint64_t SrcSVOff){
- // Do repeated 4-byte loads and stores. To be improved.
- // This requires 4-byte alignment.
- if ((Align & 3) != 0)
- return SDOperand();
- // This requires the copy size to be a constant, preferrably
- // within a subtarget-specific limit.
- ConstantSDNode *ConstantSize = dyn_cast<ConstantSDNode>(Size);
- if (!ConstantSize)
- return SDOperand();
- uint64_t SizeVal = ConstantSize->getValue();
- if (!AlwaysInline && SizeVal > getSubtarget()->getMaxInlineSizeThreshold())
- return SDOperand();
-
- unsigned BytesLeft = SizeVal & 3;
- unsigned NumMemOps = SizeVal >> 2;
- unsigned EmittedNumMemOps = 0;
- MVT::ValueType VT = MVT::i32;
- unsigned VTSize = 4;
- unsigned i = 0;
- const unsigned MAX_LOADS_IN_LDM = 6;
- SDOperand TFOps[MAX_LOADS_IN_LDM];
- SDOperand Loads[MAX_LOADS_IN_LDM];
- uint64_t SrcOff = 0, DstOff = 0;
-
- // Emit up to MAX_LOADS_IN_LDM loads, then a TokenFactor barrier, then the
- // same number of stores. The loads and stores will get combined into
- // ldm/stm later on.
- while (EmittedNumMemOps < NumMemOps) {
- for (i = 0;
- i < MAX_LOADS_IN_LDM && EmittedNumMemOps + i < NumMemOps; ++i) {
- Loads[i] = DAG.getLoad(VT, Chain,
- DAG.getNode(ISD::ADD, MVT::i32, Src,
- DAG.getConstant(SrcOff, MVT::i32)),
- SrcSV, SrcSVOff + SrcOff);
- TFOps[i] = Loads[i].getValue(1);
- SrcOff += VTSize;
- }
- Chain = DAG.getNode(ISD::TokenFactor, MVT::Other, &TFOps[0], i);
-
- for (i = 0;
- i < MAX_LOADS_IN_LDM && EmittedNumMemOps + i < NumMemOps; ++i) {
- TFOps[i] = DAG.getStore(Chain, Loads[i],
- DAG.getNode(ISD::ADD, MVT::i32, Dst,
- DAG.getConstant(DstOff, MVT::i32)),
- DstSV, DstSVOff + DstOff);
- DstOff += VTSize;
- }
- Chain = DAG.getNode(ISD::TokenFactor, MVT::Other, &TFOps[0], i);
-
- EmittedNumMemOps += i;
- }
-
- if (BytesLeft == 0)
- return Chain;
-
- // Issue loads / stores for the trailing (1 - 3) bytes.
- unsigned BytesLeftSave = BytesLeft;
- i = 0;
- while (BytesLeft) {
- if (BytesLeft >= 2) {
- VT = MVT::i16;
- VTSize = 2;
- } else {
- VT = MVT::i8;
- VTSize = 1;
- }
-
- Loads[i] = DAG.getLoad(VT, Chain,
- DAG.getNode(ISD::ADD, MVT::i32, Src,
- DAG.getConstant(SrcOff, MVT::i32)),
- SrcSV, SrcSVOff + SrcOff);
- TFOps[i] = Loads[i].getValue(1);
- ++i;
- SrcOff += VTSize;
- BytesLeft -= VTSize;
- }
- Chain = DAG.getNode(ISD::TokenFactor, MVT::Other, &TFOps[0], i);
-
- i = 0;
- BytesLeft = BytesLeftSave;
- while (BytesLeft) {
- if (BytesLeft >= 2) {
- VT = MVT::i16;
- VTSize = 2;
- } else {
- VT = MVT::i8;
- VTSize = 1;
- }
-
- TFOps[i] = DAG.getStore(Chain, Loads[i],
- DAG.getNode(ISD::ADD, MVT::i32, Dst,
- DAG.getConstant(DstOff, MVT::i32)),
- DstSV, DstSVOff + DstOff);
- ++i;
- DstOff += VTSize;
- BytesLeft -= VTSize;
- }
- return DAG.getNode(ISD::TokenFactor, MVT::Other, &TFOps[0], i);
-}
-
-static SDNode *ExpandBIT_CONVERT(SDNode *N, SelectionDAG &DAG) {
- // Turn f64->i64 into FMRRD.
- assert(N->getValueType(0) == MVT::i64 &&
- N->getOperand(0).getValueType() == MVT::f64);
-
- SDOperand Op = N->getOperand(0);
- SDOperand Cvt = DAG.getNode(ARMISD::FMRRD, DAG.getVTList(MVT::i32, MVT::i32),
- &Op, 1);
-
- // Merge the pieces into a single i64 value.
- return DAG.getNode(ISD::BUILD_PAIR, MVT::i64, Cvt, Cvt.getValue(1)).Val;
-}
-
-static SDNode *ExpandSRx(SDNode *N, SelectionDAG &DAG, const ARMSubtarget *ST) {
- assert(N->getValueType(0) == MVT::i64 &&
- (N->getOpcode() == ISD::SRL || N->getOpcode() == ISD::SRA) &&
- "Unknown shift to lower!");
-
- // We only lower SRA, SRL of 1 here, all others use generic lowering.
- if (!isa<ConstantSDNode>(N->getOperand(1)) ||
- cast<ConstantSDNode>(N->getOperand(1))->getValue() != 1)
- return 0;
-
- // If we are in thumb mode, we don't have RRX.
- if (ST->isThumb()) return 0;
-
- // Okay, we have a 64-bit SRA or SRL of 1. Lower this to an RRX expr.
- SDOperand Lo = DAG.getNode(ISD::EXTRACT_ELEMENT, MVT::i32, N->getOperand(0),
- DAG.getConstant(0, MVT::i32));
- SDOperand Hi = DAG.getNode(ISD::EXTRACT_ELEMENT, MVT::i32, N->getOperand(0),
- DAG.getConstant(1, MVT::i32));
-
- // First, build a SRA_FLAG/SRL_FLAG op, which shifts the top part by one and
- // captures the result into a carry flag.
- unsigned Opc = N->getOpcode() == ISD::SRL ? ARMISD::SRL_FLAG:ARMISD::SRA_FLAG;
- Hi = DAG.getNode(Opc, DAG.getVTList(MVT::i32, MVT::Flag), &Hi, 1);
-
- // The low part is an ARMISD::RRX operand, which shifts the carry in.
- Lo = DAG.getNode(ARMISD::RRX, MVT::i32, Lo, Hi.getValue(1));
-
- // Merge the pieces into a single i64 value.
- return DAG.getNode(ISD::BUILD_PAIR, MVT::i64, Lo, Hi).Val;
-}
-
-
-SDOperand ARMTargetLowering::LowerOperation(SDOperand Op, SelectionDAG &DAG) {
- switch (Op.getOpcode()) {
- default: assert(0 && "Don't know how to custom lower this!"); abort();
- case ISD::ConstantPool: return LowerConstantPool(Op, DAG);
- case ISD::GlobalAddress:
- return Subtarget->isTargetDarwin() ? LowerGlobalAddressDarwin(Op, DAG) :
- LowerGlobalAddressELF(Op, DAG);
- case ISD::GlobalTLSAddress: return LowerGlobalTLSAddress(Op, DAG);
- case ISD::CALL: return LowerCALL(Op, DAG);
- case ISD::RET: return LowerRET(Op, DAG);
- case ISD::SELECT_CC: return LowerSELECT_CC(Op, DAG, Subtarget);
- case ISD::BR_CC: return LowerBR_CC(Op, DAG, Subtarget);
- case ISD::BR_JT: return LowerBR_JT(Op, DAG);
- case ISD::VASTART: return LowerVASTART(Op, DAG, VarArgsFrameIndex);
- case ISD::SINT_TO_FP:
- case ISD::UINT_TO_FP: return LowerINT_TO_FP(Op, DAG);
- case ISD::FP_TO_SINT:
- case ISD::FP_TO_UINT: return LowerFP_TO_INT(Op, DAG);
- case ISD::FCOPYSIGN: return LowerFCOPYSIGN(Op, DAG);
- case ISD::FORMAL_ARGUMENTS: return LowerFORMAL_ARGUMENTS(Op, DAG);
- case ISD::RETURNADDR: break;
- case ISD::FRAMEADDR: break;
- case ISD::GLOBAL_OFFSET_TABLE: return LowerGLOBAL_OFFSET_TABLE(Op, DAG);
- case ISD::INTRINSIC_WO_CHAIN: return LowerINTRINSIC_WO_CHAIN(Op, DAG);
-
-
- // FIXME: Remove these when LegalizeDAGTypes lands.
- case ISD::BIT_CONVERT: return SDOperand(ExpandBIT_CONVERT(Op.Val, DAG), 0);
- case ISD::SRL:
- case ISD::SRA: return SDOperand(ExpandSRx(Op.Val, DAG,Subtarget),0);
- }
- return SDOperand();
-}
-
-
-/// ExpandOperationResult - Provide custom lowering hooks for expanding
-/// operations.
-SDNode *ARMTargetLowering::ExpandOperationResult(SDNode *N, SelectionDAG &DAG) {
- switch (N->getOpcode()) {
- default: assert(0 && "Don't know how to custom expand this!"); abort();
- case ISD::BIT_CONVERT: return ExpandBIT_CONVERT(N, DAG);
- case ISD::SRL:
- case ISD::SRA: return ExpandSRx(N, DAG, Subtarget);
- }
-}
-
-
-//===----------------------------------------------------------------------===//
-// ARM Scheduler Hooks
-//===----------------------------------------------------------------------===//
-
-MachineBasicBlock *
-ARMTargetLowering::EmitInstrWithCustomInserter(MachineInstr *MI,
- MachineBasicBlock *BB) {
- const TargetInstrInfo *TII = getTargetMachine().getInstrInfo();
- switch (MI->getOpcode()) {
- default: assert(false && "Unexpected instr type to insert");
- case ARM::tMOVCCr: {
- // To "insert" a SELECT_CC instruction, we actually have to insert the
- // diamond control-flow pattern. The incoming instruction knows the
- // destination vreg to set, the condition code register to branch on, the
- // true/false values to select between, and a branch opcode to use.
- const BasicBlock *LLVM_BB = BB->getBasicBlock();
- ilist<MachineBasicBlock>::iterator It = BB;
- ++It;
-
- // thisMBB:
- // ...
- // TrueVal = ...
- // cmpTY ccX, r1, r2
- // bCC copy1MBB
- // fallthrough --> copy0MBB
- MachineBasicBlock *thisMBB = BB;
- MachineBasicBlock *copy0MBB = new MachineBasicBlock(LLVM_BB);
- MachineBasicBlock *sinkMBB = new MachineBasicBlock(LLVM_BB);
- BuildMI(BB, TII->get(ARM::tBcc)).addMBB(sinkMBB)
- .addImm(MI->getOperand(3).getImm()).addReg(MI->getOperand(4).getReg());
- MachineFunction *F = BB->getParent();
- F->getBasicBlockList().insert(It, copy0MBB);
- F->getBasicBlockList().insert(It, sinkMBB);
- // Update machine-CFG edges by first adding all successors of the current
- // block to the new block which will contain the Phi node for the select.
- for(MachineBasicBlock::succ_iterator i = BB->succ_begin(),
- e = BB->succ_end(); i != e; ++i)
- sinkMBB->addSuccessor(*i);
- // Next, remove all successors of the current block, and add the true
- // and fallthrough blocks as its successors.
- while(!BB->succ_empty())
- BB->removeSuccessor(BB->succ_begin());
- BB->addSuccessor(copy0MBB);
- BB->addSuccessor(sinkMBB);
-
- // copy0MBB:
- // %FalseValue = ...
- // # fallthrough to sinkMBB
- BB = copy0MBB;
-
- // Update machine-CFG edges
- BB->addSuccessor(sinkMBB);
-
- // sinkMBB:
- // %Result = phi [ %FalseValue, copy0MBB ], [ %TrueValue, thisMBB ]
- // ...
- BB = sinkMBB;
- BuildMI(BB, TII->get(ARM::PHI), MI->getOperand(0).getReg())
- .addReg(MI->getOperand(1).getReg()).addMBB(copy0MBB)
- .addReg(MI->getOperand(2).getReg()).addMBB(thisMBB);
-
- delete MI; // The pseudo instruction is gone now.
- return BB;
- }
- }
-}
-
-//===----------------------------------------------------------------------===//
-// ARM Optimization Hooks
-//===----------------------------------------------------------------------===//
-
-/// PerformFMRRDCombine - Target-specific dag combine xforms for ARMISD::FMRRD.
-static SDOperand PerformFMRRDCombine(SDNode *N,
- TargetLowering::DAGCombinerInfo &DCI) {
- // fmrrd(fmdrr x, y) -> x,y
- SDOperand InDouble = N->getOperand(0);
- if (InDouble.getOpcode() == ARMISD::FMDRR)
- return DCI.CombineTo(N, InDouble.getOperand(0), InDouble.getOperand(1));
- return SDOperand();
-}
-
-SDOperand ARMTargetLowering::PerformDAGCombine(SDNode *N,
- DAGCombinerInfo &DCI) const {
- switch (N->getOpcode()) {
- default: break;
- case ARMISD::FMRRD: return PerformFMRRDCombine(N, DCI);
- }
-
- return SDOperand();
-}
-
-
-/// isLegalAddressImmediate - Return true if the integer value can be used
-/// as the offset of the target addressing mode for load / store of the
-/// given type.
-static bool isLegalAddressImmediate(int64_t V, MVT::ValueType VT,
- const ARMSubtarget *Subtarget) {
- if (V == 0)
- return true;
-
- if (Subtarget->isThumb()) {
- if (V < 0)
- return false;
-
- unsigned Scale = 1;
- switch (VT) {
- default: return false;
- case MVT::i1:
- case MVT::i8:
- // Scale == 1;
- break;
- case MVT::i16:
- // Scale == 2;
- Scale = 2;
- break;
- case MVT::i32:
- // Scale == 4;
- Scale = 4;
- break;
- }
-
- if ((V & (Scale - 1)) != 0)
- return false;
- V /= Scale;
- return V == (V & ((1LL << 5) - 1));
- }
-
- if (V < 0)
- V = - V;
- switch (VT) {
- default: return false;
- case MVT::i1:
- case MVT::i8:
- case MVT::i32:
- // +- imm12
- return V == (V & ((1LL << 12) - 1));
- case MVT::i16:
- // +- imm8
- return V == (V & ((1LL << 8) - 1));
- case MVT::f32:
- case MVT::f64:
- if (!Subtarget->hasVFP2())
- return false;
- if ((V & 3) != 0)
- return false;
- V >>= 2;
- return V == (V & ((1LL << 8) - 1));
- }
-}
-
-/// isLegalAddressingMode - Return true if the addressing mode represented
-/// by AM is legal for this target, for a load/store of the specified type.
-bool ARMTargetLowering::isLegalAddressingMode(const AddrMode &AM,
- const Type *Ty) const {
- if (!isLegalAddressImmediate(AM.BaseOffs, getValueType(Ty), Subtarget))
- return false;
-
- // Can never fold addr of global into load/store.
- if (AM.BaseGV)
- return false;
-
- switch (AM.Scale) {
- case 0: // no scale reg, must be "r+i" or "r", or "i".
- break;
- case 1:
- if (Subtarget->isThumb())
- return false;
- // FALL THROUGH.
- default:
- // ARM doesn't support any R+R*scale+imm addr modes.
- if (AM.BaseOffs)
- return false;
-
- int Scale = AM.Scale;
- switch (getValueType(Ty)) {
- default: return false;
- case MVT::i1:
- case MVT::i8:
- case MVT::i32:
- case MVT::i64:
- // This assumes i64 is legalized to a pair of i32. If not (i.e.
- // ldrd / strd are used, then its address mode is same as i16.
- // r + r
- if (Scale < 0) Scale = -Scale;
- if (Scale == 1)
- return true;
- // r + r << imm
- return isPowerOf2_32(Scale & ~1);
- case MVT::i16:
- // r + r
- if (((unsigned)AM.HasBaseReg + Scale) <= 2)
- return true;
- return false;
-
- case MVT::isVoid:
- // Note, we allow "void" uses (basically, uses that aren't loads or
- // stores), because arm allows folding a scale into many arithmetic
- // operations. This should be made more precise and revisited later.
-
- // Allow r << imm, but the imm has to be a multiple of two.
- if (AM.Scale & 1) return false;
- return isPowerOf2_32(AM.Scale);
- }
- break;
- }
- return true;
-}
-
-
-static bool getIndexedAddressParts(SDNode *Ptr, MVT::ValueType VT,
- bool isSEXTLoad, SDOperand &Base,
- SDOperand &Offset, bool &isInc,
- SelectionDAG &DAG) {
- if (Ptr->getOpcode() != ISD::ADD && Ptr->getOpcode() != ISD::SUB)
- return false;
-
- if (VT == MVT::i16 || ((VT == MVT::i8 || VT == MVT::i1) && isSEXTLoad)) {
- // AddressingMode 3
- Base = Ptr->getOperand(0);
- if (ConstantSDNode *RHS = dyn_cast<ConstantSDNode>(Ptr->getOperand(1))) {
- int RHSC = (int)RHS->getValue();
- if (RHSC < 0 && RHSC > -256) {
- isInc = false;
- Offset = DAG.getConstant(-RHSC, RHS->getValueType(0));
- return true;
- }
- }
- isInc = (Ptr->getOpcode() == ISD::ADD);
- Offset = Ptr->getOperand(1);
- return true;
- } else if (VT == MVT::i32 || VT == MVT::i8 || VT == MVT::i1) {
- // AddressingMode 2
- if (ConstantSDNode *RHS = dyn_cast<ConstantSDNode>(Ptr->getOperand(1))) {
- int RHSC = (int)RHS->getValue();
- if (RHSC < 0 && RHSC > -0x1000) {
- isInc = false;
- Offset = DAG.getConstant(-RHSC, RHS->getValueType(0));
- Base = Ptr->getOperand(0);
- return true;
- }
- }
-
- if (Ptr->getOpcode() == ISD::ADD) {
- isInc = true;
- ARM_AM::ShiftOpc ShOpcVal= ARM_AM::getShiftOpcForNode(Ptr->getOperand(0));
- if (ShOpcVal != ARM_AM::no_shift) {
- Base = Ptr->getOperand(1);
- Offset = Ptr->getOperand(0);
- } else {
- Base = Ptr->getOperand(0);
- Offset = Ptr->getOperand(1);
- }
- return true;
- }
-
- isInc = (Ptr->getOpcode() == ISD::ADD);
- Base = Ptr->getOperand(0);
- Offset = Ptr->getOperand(1);
- return true;
- }
-
- // FIXME: Use FLDM / FSTM to emulate indexed FP load / store.
- return false;
-}
-
-/// getPreIndexedAddressParts - returns true by value, base pointer and
-/// offset pointer and addressing mode by reference if the node's address
-/// can be legally represented as pre-indexed load / store address.
-bool
-ARMTargetLowering::getPreIndexedAddressParts(SDNode *N, SDOperand &Base,
- SDOperand &Offset,
- ISD::MemIndexedMode &AM,
- SelectionDAG &DAG) {
- if (Subtarget->isThumb())
- return false;
-
- MVT::ValueType VT;
- SDOperand Ptr;
- bool isSEXTLoad = false;
- if (LoadSDNode *LD = dyn_cast<LoadSDNode>(N)) {
- Ptr = LD->getBasePtr();
- VT = LD->getMemoryVT();
- isSEXTLoad = LD->getExtensionType() == ISD::SEXTLOAD;
- } else if (StoreSDNode *ST = dyn_cast<StoreSDNode>(N)) {
- Ptr = ST->getBasePtr();
- VT = ST->getMemoryVT();
- } else
- return false;
-
- bool isInc;
- bool isLegal = getIndexedAddressParts(Ptr.Val, VT, isSEXTLoad, Base, Offset,
- isInc, DAG);
- if (isLegal) {
- AM = isInc ? ISD::PRE_INC : ISD::PRE_DEC;
- return true;
- }
- return false;
-}
-
-/// getPostIndexedAddressParts - returns true by value, base pointer and
-/// offset pointer and addressing mode by reference if this node can be
-/// combined with a load / store to form a post-indexed load / store.
-bool ARMTargetLowering::getPostIndexedAddressParts(SDNode *N, SDNode *Op,
- SDOperand &Base,
- SDOperand &Offset,
- ISD::MemIndexedMode &AM,
- SelectionDAG &DAG) {
- if (Subtarget->isThumb())
- return false;
-
- MVT::ValueType VT;
- SDOperand Ptr;
- bool isSEXTLoad = false;
- if (LoadSDNode *LD = dyn_cast<LoadSDNode>(N)) {
- VT = LD->getMemoryVT();
- isSEXTLoad = LD->getExtensionType() == ISD::SEXTLOAD;
- } else if (StoreSDNode *ST = dyn_cast<StoreSDNode>(N)) {
- VT = ST->getMemoryVT();
- } else
- return false;
-
- bool isInc;
- bool isLegal = getIndexedAddressParts(Op, VT, isSEXTLoad, Base, Offset,
- isInc, DAG);
- if (isLegal) {
- AM = isInc ? ISD::POST_INC : ISD::POST_DEC;
- return true;
- }
- return false;
-}
-
-void ARMTargetLowering::computeMaskedBitsForTargetNode(const SDOperand Op,
- const APInt &Mask,
- APInt &KnownZero,
- APInt &KnownOne,
- const SelectionDAG &DAG,
- unsigned Depth) const {
- KnownZero = KnownOne = APInt(Mask.getBitWidth(), 0);
- switch (Op.getOpcode()) {
- default: break;
- case ARMISD::CMOV: {
- // Bits are known zero/one if known on the LHS and RHS.
- DAG.ComputeMaskedBits(Op.getOperand(0), Mask, KnownZero, KnownOne, Depth+1);
- if (KnownZero == 0 && KnownOne == 0) return;
-
- APInt KnownZeroRHS, KnownOneRHS;
- DAG.ComputeMaskedBits(Op.getOperand(1), Mask,
- KnownZeroRHS, KnownOneRHS, Depth+1);
- KnownZero &= KnownZeroRHS;
- KnownOne &= KnownOneRHS;
- return;
- }
- }
-}
-
-//===----------------------------------------------------------------------===//
-// ARM Inline Assembly Support
-//===----------------------------------------------------------------------===//
-
-/// getConstraintType - Given a constraint letter, return the type of
-/// constraint it is for this target.
-ARMTargetLowering::ConstraintType
-ARMTargetLowering::getConstraintType(const std::string &Constraint) const {
- if (Constraint.size() == 1) {
- switch (Constraint[0]) {
- default: break;
- case 'l': return C_RegisterClass;
- case 'w': return C_RegisterClass;
- }
- }
- return TargetLowering::getConstraintType(Constraint);
-}
-
-std::pair<unsigned, const TargetRegisterClass*>
-ARMTargetLowering::getRegForInlineAsmConstraint(const std::string &Constraint,
- MVT::ValueType VT) const {
- if (Constraint.size() == 1) {
- // GCC RS6000 Constraint Letters
- switch (Constraint[0]) {
- case 'l':
- // FIXME: in thumb mode, 'l' is only low-regs.
- // FALL THROUGH.
- case 'r':
- return std::make_pair(0U, ARM::GPRRegisterClass);
- case 'w':
- if (VT == MVT::f32)
- return std::make_pair(0U, ARM::SPRRegisterClass);
- if (VT == MVT::f64)
- return std::make_pair(0U, ARM::DPRRegisterClass);
- break;
- }
- }
- return TargetLowering::getRegForInlineAsmConstraint(Constraint, VT);
-}
-
-std::vector<unsigned> ARMTargetLowering::
-getRegClassForInlineAsmConstraint(const std::string &Constraint,
- MVT::ValueType VT) const {
- if (Constraint.size() != 1)
- return std::vector<unsigned>();
-
- switch (Constraint[0]) { // GCC ARM Constraint Letters
- default: break;
- case 'l':
- case 'r':
- return make_vector<unsigned>(ARM::R0, ARM::R1, ARM::R2, ARM::R3,
- ARM::R4, ARM::R5, ARM::R6, ARM::R7,
- ARM::R8, ARM::R9, ARM::R10, ARM::R11,
- ARM::R12, ARM::LR, 0);
- case 'w':
- if (VT == MVT::f32)
- return make_vector<unsigned>(ARM::S0, ARM::S1, ARM::S2, ARM::S3,
- ARM::S4, ARM::S5, ARM::S6, ARM::S7,
- ARM::S8, ARM::S9, ARM::S10, ARM::S11,
- ARM::S12,ARM::S13,ARM::S14,ARM::S15,
- ARM::S16,ARM::S17,ARM::S18,ARM::S19,
- ARM::S20,ARM::S21,ARM::S22,ARM::S23,
- ARM::S24,ARM::S25,ARM::S26,ARM::S27,
- ARM::S28,ARM::S29,ARM::S30,ARM::S31, 0);
- if (VT == MVT::f64)
- return make_vector<unsigned>(ARM::D0, ARM::D1, ARM::D2, ARM::D3,
- ARM::D4, ARM::D5, ARM::D6, ARM::D7,
- ARM::D8, ARM::D9, ARM::D10,ARM::D11,
- ARM::D12,ARM::D13,ARM::D14,ARM::D15, 0);
- break;
- }
-
- return std::vector<unsigned>();
-}
diff --git a/release_23/lib/Target/ARM/ARMISelLowering.h b/release_23/lib/Target/ARM/ARMISelLowering.h
deleted file mode 100644
index ce6d5fe449ab..000000000000
--- a/release_23/lib/Target/ARM/ARMISelLowering.h
+++ /dev/null
@@ -1,157 +0,0 @@
-//===-- ARMISelLowering.h - ARM DAG Lowering Interface ----------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines the interfaces that ARM uses to lower LLVM code into a
-// selection DAG.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef ARMISELLOWERING_H
-#define ARMISELLOWERING_H
-
-#include "ARMSubtarget.h"
-#include "llvm/Target/TargetLowering.h"
-#include "llvm/CodeGen/SelectionDAG.h"
-#include <vector>
-
-namespace llvm {
- class ARMConstantPoolValue;
-
- namespace ARMISD {
- // ARM Specific DAG Nodes
- enum NodeType {
- // Start the numbering where the builting ops and target ops leave off.
- FIRST_NUMBER = ISD::BUILTIN_OP_END+ARM::INSTRUCTION_LIST_END,
-
- Wrapper, // Wrapper - A wrapper node for TargetConstantPool,
- // TargetExternalSymbol, and TargetGlobalAddress.
- WrapperJT, // WrapperJT - A wrapper node for TargetJumpTable
-
- CALL, // Function call.
- CALL_PRED, // Function call that's predicable.
- CALL_NOLINK, // Function call with branch not branch-and-link.
- tCALL, // Thumb function call.
- BRCOND, // Conditional branch.
- BR_JT, // Jumptable branch.
- RET_FLAG, // Return with a flag operand.
-
- PIC_ADD, // Add with a PC operand and a PIC label.
-
- CMP, // ARM compare instructions.
- CMPNZ, // ARM compare that uses only N or Z flags.
- CMPFP, // ARM VFP compare instruction, sets FPSCR.
- CMPFPw0, // ARM VFP compare against zero instruction, sets FPSCR.
- FMSTAT, // ARM fmstat instruction.
- CMOV, // ARM conditional move instructions.
- CNEG, // ARM conditional negate instructions.
-
- FTOSI, // FP to sint within a FP register.
- FTOUI, // FP to uint within a FP register.
- SITOF, // sint to FP within a FP register.
- UITOF, // uint to FP within a FP register.
-
- SRL_FLAG, // V,Flag = srl_flag X -> srl X, 1 + save carry out.
- SRA_FLAG, // V,Flag = sra_flag X -> sra X, 1 + save carry out.
- RRX, // V = RRX X, Flag -> srl X, 1 + shift in carry flag.
-
- FMRRD, // double to two gprs.
- FMDRR, // Two gprs to double.
-
- THREAD_POINTER
- };
- }
-
- //===----------------------------------------------------------------------===//
- // ARMTargetLowering - ARM Implementation of the TargetLowering interface
-
- class ARMTargetLowering : public TargetLowering {
- int VarArgsFrameIndex; // FrameIndex for start of varargs area.
- public:
- explicit ARMTargetLowering(TargetMachine &TM);
-
- virtual SDOperand LowerOperation(SDOperand Op, SelectionDAG &DAG);
- virtual SDNode *ExpandOperationResult(SDNode *N, SelectionDAG &DAG);
-
- virtual SDOperand PerformDAGCombine(SDNode *N, DAGCombinerInfo &DCI) const;
-
- virtual const char *getTargetNodeName(unsigned Opcode) const;
-
- virtual MachineBasicBlock *EmitInstrWithCustomInserter(MachineInstr *MI,
- MachineBasicBlock *MBB);
-
- /// isLegalAddressingMode - Return true if the addressing mode represented
- /// by AM is legal for this target, for a load/store of the specified type.
- virtual bool isLegalAddressingMode(const AddrMode &AM, const Type *Ty)const;
-
- /// getPreIndexedAddressParts - returns true by value, base pointer and
- /// offset pointer and addressing mode by reference if the node's address
- /// can be legally represented as pre-indexed load / store address.
- virtual bool getPreIndexedAddressParts(SDNode *N, SDOperand &Base,
- SDOperand &Offset,
- ISD::MemIndexedMode &AM,
- SelectionDAG &DAG);
-
- /// getPostIndexedAddressParts - returns true by value, base pointer and
- /// offset pointer and addressing mode by reference if this node can be
- /// combined with a load / store to form a post-indexed load / store.
- virtual bool getPostIndexedAddressParts(SDNode *N, SDNode *Op,
- SDOperand &Base, SDOperand &Offset,
- ISD::MemIndexedMode &AM,
- SelectionDAG &DAG);
-
- virtual void computeMaskedBitsForTargetNode(const SDOperand Op,
- const APInt &Mask,
- APInt &KnownZero,
- APInt &KnownOne,
- const SelectionDAG &DAG,
- unsigned Depth) const;
- ConstraintType getConstraintType(const std::string &Constraint) const;
- std::pair<unsigned, const TargetRegisterClass*>
- getRegForInlineAsmConstraint(const std::string &Constraint,
- MVT::ValueType VT) const;
- std::vector<unsigned>
- getRegClassForInlineAsmConstraint(const std::string &Constraint,
- MVT::ValueType VT) const;
-
- virtual const ARMSubtarget* getSubtarget() {
- return Subtarget;
- }
-
- private:
- /// Subtarget - Keep a pointer to the ARMSubtarget around so that we can
- /// make the right decision when generating code for different targets.
- const ARMSubtarget *Subtarget;
-
- /// ARMPCLabelIndex - Keep track the number of ARM PC labels created.
- ///
- unsigned ARMPCLabelIndex;
-
- SDOperand LowerCALL(SDOperand Op, SelectionDAG &DAG);
- SDOperand LowerGlobalAddressDarwin(SDOperand Op, SelectionDAG &DAG);
- SDOperand LowerGlobalAddressELF(SDOperand Op, SelectionDAG &DAG);
- SDOperand LowerGlobalTLSAddress(SDOperand Op, SelectionDAG &DAG);
- SDOperand LowerToTLSGeneralDynamicModel(GlobalAddressSDNode *GA,
- SelectionDAG &DAG);
- SDOperand LowerToTLSExecModels(GlobalAddressSDNode *GA,
- SelectionDAG &DAG);
- SDOperand LowerGLOBAL_OFFSET_TABLE(SDOperand Op, SelectionDAG &DAG);
- SDOperand LowerFORMAL_ARGUMENTS(SDOperand Op, SelectionDAG &DAG);
- SDOperand LowerBR_JT(SDOperand Op, SelectionDAG &DAG);
-
- SDOperand EmitTargetCodeForMemcpy(SelectionDAG &DAG,
- SDOperand Chain,
- SDOperand Dst, SDOperand Src,
- SDOperand Size, unsigned Align,
- bool AlwaysInline,
- const Value *DstSV, uint64_t DstSVOff,
- const Value *SrcSV, uint64_t SrcSVOff);
- };
-}
-
-#endif // ARMISELLOWERING_H
diff --git a/release_23/lib/Target/ARM/ARMInstrInfo.cpp b/release_23/lib/Target/ARM/ARMInstrInfo.cpp
deleted file mode 100644
index 94ca6b09fdee..000000000000
--- a/release_23/lib/Target/ARM/ARMInstrInfo.cpp
+++ /dev/null
@@ -1,939 +0,0 @@
-//===- ARMInstrInfo.cpp - ARM Instruction Information -----------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains the ARM implementation of the TargetInstrInfo class.
-//
-//===----------------------------------------------------------------------===//
-
-#include "ARMInstrInfo.h"
-#include "ARM.h"
-#include "ARMAddressingModes.h"
-#include "ARMGenInstrInfo.inc"
-#include "ARMMachineFunctionInfo.h"
-#include "llvm/ADT/STLExtras.h"
-#include "llvm/CodeGen/LiveVariables.h"
-#include "llvm/CodeGen/MachineFrameInfo.h"
-#include "llvm/CodeGen/MachineInstrBuilder.h"
-#include "llvm/CodeGen/MachineJumpTableInfo.h"
-#include "llvm/Target/TargetAsmInfo.h"
-#include "llvm/Support/CommandLine.h"
-using namespace llvm;
-
-static cl::opt<bool> EnableARM3Addr("enable-arm-3-addr-conv", cl::Hidden,
- cl::desc("Enable ARM 2-addr to 3-addr conv"));
-
-static inline
-const MachineInstrBuilder &AddDefaultPred(const MachineInstrBuilder &MIB) {
- return MIB.addImm((int64_t)ARMCC::AL).addReg(0);
-}
-
-static inline
-const MachineInstrBuilder &AddDefaultCC(const MachineInstrBuilder &MIB) {
- return MIB.addReg(0);
-}
-
-ARMInstrInfo::ARMInstrInfo(const ARMSubtarget &STI)
- : TargetInstrInfoImpl(ARMInsts, array_lengthof(ARMInsts)),
- RI(*this, STI) {
-}
-
-const TargetRegisterClass *ARMInstrInfo::getPointerRegClass() const {
- return &ARM::GPRRegClass;
-}
-
-/// Return true if the instruction is a register to register move and
-/// leave the source and dest operands in the passed parameters.
-///
-bool ARMInstrInfo::isMoveInstr(const MachineInstr &MI,
- unsigned &SrcReg, unsigned &DstReg) const {
- unsigned oc = MI.getOpcode();
- switch (oc) {
- default:
- return false;
- case ARM::FCPYS:
- case ARM::FCPYD:
- SrcReg = MI.getOperand(1).getReg();
- DstReg = MI.getOperand(0).getReg();
- return true;
- case ARM::MOVr:
- case ARM::tMOVr:
- assert(MI.getDesc().getNumOperands() >= 2 &&
- MI.getOperand(0).isRegister() &&
- MI.getOperand(1).isRegister() &&
- "Invalid ARM MOV instruction");
- SrcReg = MI.getOperand(1).getReg();
- DstReg = MI.getOperand(0).getReg();
- return true;
- }
-}
-
-unsigned ARMInstrInfo::isLoadFromStackSlot(MachineInstr *MI, int &FrameIndex) const{
- switch (MI->getOpcode()) {
- default: break;
- case ARM::LDR:
- if (MI->getOperand(1).isFrameIndex() &&
- MI->getOperand(2).isRegister() &&
- MI->getOperand(3).isImmediate() &&
- MI->getOperand(2).getReg() == 0 &&
- MI->getOperand(3).getImm() == 0) {
- FrameIndex = MI->getOperand(1).getIndex();
- return MI->getOperand(0).getReg();
- }
- break;
- case ARM::FLDD:
- case ARM::FLDS:
- if (MI->getOperand(1).isFrameIndex() &&
- MI->getOperand(2).isImmediate() &&
- MI->getOperand(2).getImm() == 0) {
- FrameIndex = MI->getOperand(1).getIndex();
- return MI->getOperand(0).getReg();
- }
- break;
- case ARM::tRestore:
- if (MI->getOperand(1).isFrameIndex() &&
- MI->getOperand(2).isImmediate() &&
- MI->getOperand(2).getImm() == 0) {
- FrameIndex = MI->getOperand(1).getIndex();
- return MI->getOperand(0).getReg();
- }
- break;
- }
- return 0;
-}
-
-unsigned ARMInstrInfo::isStoreToStackSlot(MachineInstr *MI, int &FrameIndex) const {
- switch (MI->getOpcode()) {
- default: break;
- case ARM::STR:
- if (MI->getOperand(1).isFrameIndex() &&
- MI->getOperand(2).isRegister() &&
- MI->getOperand(3).isImmediate() &&
- MI->getOperand(2).getReg() == 0 &&
- MI->getOperand(3).getImm() == 0) {
- FrameIndex = MI->getOperand(1).getIndex();
- return MI->getOperand(0).getReg();
- }
- break;
- case ARM::FSTD:
- case ARM::FSTS:
- if (MI->getOperand(1).isFrameIndex() &&
- MI->getOperand(2).isImmediate() &&
- MI->getOperand(2).getImm() == 0) {
- FrameIndex = MI->getOperand(1).getIndex();
- return MI->getOperand(0).getReg();
- }
- break;
- case ARM::tSpill:
- if (MI->getOperand(1).isFrameIndex() &&
- MI->getOperand(2).isImmediate() &&
- MI->getOperand(2).getImm() == 0) {
- FrameIndex = MI->getOperand(1).getIndex();
- return MI->getOperand(0).getReg();
- }
- break;
- }
- return 0;
-}
-
-void ARMInstrInfo::reMaterialize(MachineBasicBlock &MBB,
- MachineBasicBlock::iterator I,
- unsigned DestReg,
- const MachineInstr *Orig) const {
- if (Orig->getOpcode() == ARM::MOVi2pieces) {
- RI.emitLoadConstPool(MBB, I, DestReg, Orig->getOperand(1).getImm(),
- Orig->getOperand(2).getImm(),
- Orig->getOperand(3).getReg(), this, false);
- return;
- }
-
- MachineInstr *MI = Orig->clone();
- MI->getOperand(0).setReg(DestReg);
- MBB.insert(I, MI);
-}
-
-static unsigned getUnindexedOpcode(unsigned Opc) {
- switch (Opc) {
- default: break;
- case ARM::LDR_PRE:
- case ARM::LDR_POST:
- return ARM::LDR;
- case ARM::LDRH_PRE:
- case ARM::LDRH_POST:
- return ARM::LDRH;
- case ARM::LDRB_PRE:
- case ARM::LDRB_POST:
- return ARM::LDRB;
- case ARM::LDRSH_PRE:
- case ARM::LDRSH_POST:
- return ARM::LDRSH;
- case ARM::LDRSB_PRE:
- case ARM::LDRSB_POST:
- return ARM::LDRSB;
- case ARM::STR_PRE:
- case ARM::STR_POST:
- return ARM::STR;
- case ARM::STRH_PRE:
- case ARM::STRH_POST:
- return ARM::STRH;
- case ARM::STRB_PRE:
- case ARM::STRB_POST:
- return ARM::STRB;
- }
- return 0;
-}
-
-MachineInstr *
-ARMInstrInfo::convertToThreeAddress(MachineFunction::iterator &MFI,
- MachineBasicBlock::iterator &MBBI,
- LiveVariables &LV) const {
- if (!EnableARM3Addr)
- return NULL;
-
- MachineInstr *MI = MBBI;
- unsigned TSFlags = MI->getDesc().TSFlags;
- bool isPre = false;
- switch ((TSFlags & ARMII::IndexModeMask) >> ARMII::IndexModeShift) {
- default: return NULL;
- case ARMII::IndexModePre:
- isPre = true;
- break;
- case ARMII::IndexModePost:
- break;
- }
-
- // Try spliting an indexed load / store to a un-indexed one plus an add/sub
- // operation.
- unsigned MemOpc = getUnindexedOpcode(MI->getOpcode());
- if (MemOpc == 0)
- return NULL;
-
- MachineInstr *UpdateMI = NULL;
- MachineInstr *MemMI = NULL;
- unsigned AddrMode = (TSFlags & ARMII::AddrModeMask);
- const TargetInstrDesc &TID = MI->getDesc();
- unsigned NumOps = TID.getNumOperands();
- bool isLoad = !TID.mayStore();
- const MachineOperand &WB = isLoad ? MI->getOperand(1) : MI->getOperand(0);
- const MachineOperand &Base = MI->getOperand(2);
- const MachineOperand &Offset = MI->getOperand(NumOps-3);
- unsigned WBReg = WB.getReg();
- unsigned BaseReg = Base.getReg();
- unsigned OffReg = Offset.getReg();
- unsigned OffImm = MI->getOperand(NumOps-2).getImm();
- ARMCC::CondCodes Pred = (ARMCC::CondCodes)MI->getOperand(NumOps-1).getImm();
- switch (AddrMode) {
- default:
- assert(false && "Unknown indexed op!");
- return NULL;
- case ARMII::AddrMode2: {
- bool isSub = ARM_AM::getAM2Op(OffImm) == ARM_AM::sub;
- unsigned Amt = ARM_AM::getAM2Offset(OffImm);
- if (OffReg == 0) {
- int SOImmVal = ARM_AM::getSOImmVal(Amt);
- if (SOImmVal == -1)
- // Can't encode it in a so_imm operand. This transformation will
- // add more than 1 instruction. Abandon!
- return NULL;
- UpdateMI = BuildMI(get(isSub ? ARM::SUBri : ARM::ADDri), WBReg)
- .addReg(BaseReg).addImm(SOImmVal)
- .addImm(Pred).addReg(0).addReg(0);
- } else if (Amt != 0) {
- ARM_AM::ShiftOpc ShOpc = ARM_AM::getAM2ShiftOpc(OffImm);
- unsigned SOOpc = ARM_AM::getSORegOpc(ShOpc, Amt);
- UpdateMI = BuildMI(get(isSub ? ARM::SUBrs : ARM::ADDrs), WBReg)
- .addReg(BaseReg).addReg(OffReg).addReg(0).addImm(SOOpc)
- .addImm(Pred).addReg(0).addReg(0);
- } else
- UpdateMI = BuildMI(get(isSub ? ARM::SUBrr : ARM::ADDrr), WBReg)
- .addReg(BaseReg).addReg(OffReg)
- .addImm(Pred).addReg(0).addReg(0);
- break;
- }
- case ARMII::AddrMode3 : {
- bool isSub = ARM_AM::getAM3Op(OffImm) == ARM_AM::sub;
- unsigned Amt = ARM_AM::getAM3Offset(OffImm);
- if (OffReg == 0)
- // Immediate is 8-bits. It's guaranteed to fit in a so_imm operand.
- UpdateMI = BuildMI(get(isSub ? ARM::SUBri : ARM::ADDri), WBReg)
- .addReg(BaseReg).addImm(Amt)
- .addImm(Pred).addReg(0).addReg(0);
- else
- UpdateMI = BuildMI(get(isSub ? ARM::SUBrr : ARM::ADDrr), WBReg)
- .addReg(BaseReg).addReg(OffReg)
- .addImm(Pred).addReg(0).addReg(0);
- break;
- }
- }
-
- std::vector<MachineInstr*> NewMIs;
- if (isPre) {
- if (isLoad)
- MemMI = BuildMI(get(MemOpc), MI->getOperand(0).getReg())
- .addReg(WBReg).addReg(0).addImm(0).addImm(Pred);
- else
- MemMI = BuildMI(get(MemOpc)).addReg(MI->getOperand(1).getReg())
- .addReg(WBReg).addReg(0).addImm(0).addImm(Pred);
- NewMIs.push_back(MemMI);
- NewMIs.push_back(UpdateMI);
- } else {
- if (isLoad)
- MemMI = BuildMI(get(MemOpc), MI->getOperand(0).getReg())
- .addReg(BaseReg).addReg(0).addImm(0).addImm(Pred);
- else
- MemMI = BuildMI(get(MemOpc)).addReg(MI->getOperand(1).getReg())
- .addReg(BaseReg).addReg(0).addImm(0).addImm(Pred);
- if (WB.isDead())
- UpdateMI->getOperand(0).setIsDead();
- NewMIs.push_back(UpdateMI);
- NewMIs.push_back(MemMI);
- }
-
- // Transfer LiveVariables states, kill / dead info.
- for (unsigned i = 0, e = MI->getNumOperands(); i != e; ++i) {
- MachineOperand &MO = MI->getOperand(i);
- if (MO.isRegister() && MO.getReg() &&
- TargetRegisterInfo::isVirtualRegister(MO.getReg())) {
- unsigned Reg = MO.getReg();
- LiveVariables::VarInfo &VI = LV.getVarInfo(Reg);
- if (MO.isDef()) {
- MachineInstr *NewMI = (Reg == WBReg) ? UpdateMI : MemMI;
- if (MO.isDead())
- LV.addVirtualRegisterDead(Reg, NewMI);
- }
- if (MO.isUse() && MO.isKill()) {
- for (unsigned j = 0; j < 2; ++j) {
- // Look at the two new MI's in reverse order.
- MachineInstr *NewMI = NewMIs[j];
- if (!NewMI->readsRegister(Reg))
- continue;
- LV.addVirtualRegisterKilled(Reg, NewMI);
- if (VI.removeKill(MI))
- VI.Kills.push_back(NewMI);
- break;
- }
- }
- }
- }
-
- MFI->insert(MBBI, NewMIs[1]);
- MFI->insert(MBBI, NewMIs[0]);
- return NewMIs[0];
-}
-
-// Branch analysis.
-bool ARMInstrInfo::AnalyzeBranch(MachineBasicBlock &MBB,MachineBasicBlock *&TBB,
- MachineBasicBlock *&FBB,
- std::vector<MachineOperand> &Cond) const {
- // If the block has no terminators, it just falls into the block after it.
- MachineBasicBlock::iterator I = MBB.end();
- if (I == MBB.begin() || !isUnpredicatedTerminator(--I))
- return false;
-
- // Get the last instruction in the block.
- MachineInstr *LastInst = I;
-
- // If there is only one terminator instruction, process it.
- unsigned LastOpc = LastInst->getOpcode();
- if (I == MBB.begin() || !isUnpredicatedTerminator(--I)) {
- if (LastOpc == ARM::B || LastOpc == ARM::tB) {
- TBB = LastInst->getOperand(0).getMBB();
- return false;
- }
- if (LastOpc == ARM::Bcc || LastOpc == ARM::tBcc) {
- // Block ends with fall-through condbranch.
- TBB = LastInst->getOperand(0).getMBB();
- Cond.push_back(LastInst->getOperand(1));
- Cond.push_back(LastInst->getOperand(2));
- return false;
- }
- return true; // Can't handle indirect branch.
- }
-
- // Get the instruction before it if it is a terminator.
- MachineInstr *SecondLastInst = I;
-
- // If there are three terminators, we don't know what sort of block this is.
- if (SecondLastInst && I != MBB.begin() && isUnpredicatedTerminator(--I))
- return true;
-
- // If the block ends with ARM::B/ARM::tB and a ARM::Bcc/ARM::tBcc, handle it.
- unsigned SecondLastOpc = SecondLastInst->getOpcode();
- if ((SecondLastOpc == ARM::Bcc && LastOpc == ARM::B) ||
- (SecondLastOpc == ARM::tBcc && LastOpc == ARM::tB)) {
- TBB = SecondLastInst->getOperand(0).getMBB();
- Cond.push_back(SecondLastInst->getOperand(1));
- Cond.push_back(SecondLastInst->getOperand(2));
- FBB = LastInst->getOperand(0).getMBB();
- return false;
- }
-
- // If the block ends with two unconditional branches, handle it. The second
- // one is not executed, so remove it.
- if ((SecondLastOpc == ARM::B || SecondLastOpc==ARM::tB) &&
- (LastOpc == ARM::B || LastOpc == ARM::tB)) {
- TBB = SecondLastInst->getOperand(0).getMBB();
- I = LastInst;
- I->eraseFromParent();
- return false;
- }
-
- // Likewise if it ends with a branch table followed by an unconditional branch.
- // The branch folder can create these, and we must get rid of them for
- // correctness of Thumb constant islands.
- if ((SecondLastOpc == ARM::BR_JTr || SecondLastOpc==ARM::BR_JTm ||
- SecondLastOpc == ARM::BR_JTadd || SecondLastOpc==ARM::tBR_JTr) &&
- (LastOpc == ARM::B || LastOpc == ARM::tB)) {
- I = LastInst;
- I->eraseFromParent();
- return true;
- }
-
- // Otherwise, can't handle this.
- return true;
-}
-
-
-unsigned ARMInstrInfo::RemoveBranch(MachineBasicBlock &MBB) const {
- MachineFunction &MF = *MBB.getParent();
- ARMFunctionInfo *AFI = MF.getInfo<ARMFunctionInfo>();
- int BOpc = AFI->isThumbFunction() ? ARM::tB : ARM::B;
- int BccOpc = AFI->isThumbFunction() ? ARM::tBcc : ARM::Bcc;
-
- MachineBasicBlock::iterator I = MBB.end();
- if (I == MBB.begin()) return 0;
- --I;
- if (I->getOpcode() != BOpc && I->getOpcode() != BccOpc)
- return 0;
-
- // Remove the branch.
- I->eraseFromParent();
-
- I = MBB.end();
-
- if (I == MBB.begin()) return 1;
- --I;
- if (I->getOpcode() != BccOpc)
- return 1;
-
- // Remove the branch.
- I->eraseFromParent();
- return 2;
-}
-
-unsigned ARMInstrInfo::InsertBranch(MachineBasicBlock &MBB, MachineBasicBlock *TBB,
- MachineBasicBlock *FBB,
- const std::vector<MachineOperand> &Cond) const {
- MachineFunction &MF = *MBB.getParent();
- ARMFunctionInfo *AFI = MF.getInfo<ARMFunctionInfo>();
- int BOpc = AFI->isThumbFunction() ? ARM::tB : ARM::B;
- int BccOpc = AFI->isThumbFunction() ? ARM::tBcc : ARM::Bcc;
-
- // Shouldn't be a fall through.
- assert(TBB && "InsertBranch must not be told to insert a fallthrough");
- assert((Cond.size() == 2 || Cond.size() == 0) &&
- "ARM branch conditions have two components!");
-
- if (FBB == 0) {
- if (Cond.empty()) // Unconditional branch?
- BuildMI(&MBB, get(BOpc)).addMBB(TBB);
- else
- BuildMI(&MBB, get(BccOpc)).addMBB(TBB)
- .addImm(Cond[0].getImm()).addReg(Cond[1].getReg());
- return 1;
- }
-
- // Two-way conditional branch.
- BuildMI(&MBB, get(BccOpc)).addMBB(TBB)
- .addImm(Cond[0].getImm()).addReg(Cond[1].getReg());
- BuildMI(&MBB, get(BOpc)).addMBB(FBB);
- return 2;
-}
-
-void ARMInstrInfo::copyRegToReg(MachineBasicBlock &MBB,
- MachineBasicBlock::iterator I,
- unsigned DestReg, unsigned SrcReg,
- const TargetRegisterClass *DestRC,
- const TargetRegisterClass *SrcRC) const {
- if (DestRC != SrcRC) {
- cerr << "Not yet supported!";
- abort();
- }
-
- if (DestRC == ARM::GPRRegisterClass) {
- MachineFunction &MF = *MBB.getParent();
- ARMFunctionInfo *AFI = MF.getInfo<ARMFunctionInfo>();
- if (AFI->isThumbFunction())
- BuildMI(MBB, I, get(ARM::tMOVr), DestReg).addReg(SrcReg);
- else
- AddDefaultCC(AddDefaultPred(BuildMI(MBB, I, get(ARM::MOVr), DestReg)
- .addReg(SrcReg)));
- } else if (DestRC == ARM::SPRRegisterClass)
- AddDefaultPred(BuildMI(MBB, I, get(ARM::FCPYS), DestReg)
- .addReg(SrcReg));
- else if (DestRC == ARM::DPRRegisterClass)
- AddDefaultPred(BuildMI(MBB, I, get(ARM::FCPYD), DestReg)
- .addReg(SrcReg));
- else
- abort();
-}
-
-static const MachineInstrBuilder &ARMInstrAddOperand(MachineInstrBuilder &MIB,
- MachineOperand &MO) {
- if (MO.isRegister())
- MIB = MIB.addReg(MO.getReg(), MO.isDef(), MO.isImplicit());
- else if (MO.isImmediate())
- MIB = MIB.addImm(MO.getImm());
- else if (MO.isFrameIndex())
- MIB = MIB.addFrameIndex(MO.getIndex());
- else
- assert(0 && "Unknown operand for ARMInstrAddOperand!");
-
- return MIB;
-}
-
-void ARMInstrInfo::
-storeRegToStackSlot(MachineBasicBlock &MBB, MachineBasicBlock::iterator I,
- unsigned SrcReg, bool isKill, int FI,
- const TargetRegisterClass *RC) const {
- if (RC == ARM::GPRRegisterClass) {
- MachineFunction &MF = *MBB.getParent();
- ARMFunctionInfo *AFI = MF.getInfo<ARMFunctionInfo>();
- if (AFI->isThumbFunction())
- BuildMI(MBB, I, get(ARM::tSpill)).addReg(SrcReg, false, false, isKill)
- .addFrameIndex(FI).addImm(0);
- else
- AddDefaultPred(BuildMI(MBB, I, get(ARM::STR))
- .addReg(SrcReg, false, false, isKill)
- .addFrameIndex(FI).addReg(0).addImm(0));
- } else if (RC == ARM::DPRRegisterClass) {
- AddDefaultPred(BuildMI(MBB, I, get(ARM::FSTD))
- .addReg(SrcReg, false, false, isKill)
- .addFrameIndex(FI).addImm(0));
- } else {
- assert(RC == ARM::SPRRegisterClass && "Unknown regclass!");
- AddDefaultPred(BuildMI(MBB, I, get(ARM::FSTS))
- .addReg(SrcReg, false, false, isKill)
- .addFrameIndex(FI).addImm(0));
- }
-}
-
-void ARMInstrInfo::storeRegToAddr(MachineFunction &MF, unsigned SrcReg,
- bool isKill,
- SmallVectorImpl<MachineOperand> &Addr,
- const TargetRegisterClass *RC,
- SmallVectorImpl<MachineInstr*> &NewMIs) const {
- unsigned Opc = 0;
- if (RC == ARM::GPRRegisterClass) {
- ARMFunctionInfo *AFI = MF.getInfo<ARMFunctionInfo>();
- if (AFI->isThumbFunction()) {
- Opc = Addr[0].isFrameIndex() ? ARM::tSpill : ARM::tSTR;
- MachineInstrBuilder MIB =
- BuildMI(get(Opc)).addReg(SrcReg, false, false, isKill);
- for (unsigned i = 0, e = Addr.size(); i != e; ++i)
- MIB = ARMInstrAddOperand(MIB, Addr[i]);
- NewMIs.push_back(MIB);
- return;
- }
- Opc = ARM::STR;
- } else if (RC == ARM::DPRRegisterClass) {
- Opc = ARM::FSTD;
- } else {
- assert(RC == ARM::SPRRegisterClass && "Unknown regclass!");
- Opc = ARM::FSTS;
- }
-
- MachineInstrBuilder MIB =
- BuildMI(get(Opc)).addReg(SrcReg, false, false, isKill);
- for (unsigned i = 0, e = Addr.size(); i != e; ++i)
- MIB = ARMInstrAddOperand(MIB, Addr[i]);
- AddDefaultPred(MIB);
- NewMIs.push_back(MIB);
- return;
-}
-
-void ARMInstrInfo::
-loadRegFromStackSlot(MachineBasicBlock &MBB, MachineBasicBlock::iterator I,
- unsigned DestReg, int FI,
- const TargetRegisterClass *RC) const {
- if (RC == ARM::GPRRegisterClass) {
- MachineFunction &MF = *MBB.getParent();
- ARMFunctionInfo *AFI = MF.getInfo<ARMFunctionInfo>();
- if (AFI->isThumbFunction())
- BuildMI(MBB, I, get(ARM::tRestore), DestReg)
- .addFrameIndex(FI).addImm(0);
- else
- AddDefaultPred(BuildMI(MBB, I, get(ARM::LDR), DestReg)
- .addFrameIndex(FI).addReg(0).addImm(0));
- } else if (RC == ARM::DPRRegisterClass) {
- AddDefaultPred(BuildMI(MBB, I, get(ARM::FLDD), DestReg)
- .addFrameIndex(FI).addImm(0));
- } else {
- assert(RC == ARM::SPRRegisterClass && "Unknown regclass!");
- AddDefaultPred(BuildMI(MBB, I, get(ARM::FLDS), DestReg)
- .addFrameIndex(FI).addImm(0));
- }
-}
-
-void ARMInstrInfo::loadRegFromAddr(MachineFunction &MF, unsigned DestReg,
- SmallVectorImpl<MachineOperand> &Addr,
- const TargetRegisterClass *RC,
- SmallVectorImpl<MachineInstr*> &NewMIs) const {
- unsigned Opc = 0;
- if (RC == ARM::GPRRegisterClass) {
- ARMFunctionInfo *AFI = MF.getInfo<ARMFunctionInfo>();
- if (AFI->isThumbFunction()) {
- Opc = Addr[0].isFrameIndex() ? ARM::tRestore : ARM::tLDR;
- MachineInstrBuilder MIB = BuildMI(get(Opc), DestReg);
- for (unsigned i = 0, e = Addr.size(); i != e; ++i)
- MIB = ARMInstrAddOperand(MIB, Addr[i]);
- NewMIs.push_back(MIB);
- return;
- }
- Opc = ARM::LDR;
- } else if (RC == ARM::DPRRegisterClass) {
- Opc = ARM::FLDD;
- } else {
- assert(RC == ARM::SPRRegisterClass && "Unknown regclass!");
- Opc = ARM::FLDS;
- }
-
- MachineInstrBuilder MIB = BuildMI(get(Opc), DestReg);
- for (unsigned i = 0, e = Addr.size(); i != e; ++i)
- MIB = ARMInstrAddOperand(MIB, Addr[i]);
- AddDefaultPred(MIB);
- NewMIs.push_back(MIB);
- return;
-}
-
-bool ARMInstrInfo::spillCalleeSavedRegisters(MachineBasicBlock &MBB,
- MachineBasicBlock::iterator MI,
- const std::vector<CalleeSavedInfo> &CSI) const {
- MachineFunction &MF = *MBB.getParent();
- ARMFunctionInfo *AFI = MF.getInfo<ARMFunctionInfo>();
- if (!AFI->isThumbFunction() || CSI.empty())
- return false;
-
- MachineInstrBuilder MIB = BuildMI(MBB, MI, get(ARM::tPUSH));
- for (unsigned i = CSI.size(); i != 0; --i) {
- unsigned Reg = CSI[i-1].getReg();
- // Add the callee-saved register as live-in. It's killed at the spill.
- MBB.addLiveIn(Reg);
- MIB.addReg(Reg, false/*isDef*/,false/*isImp*/,true/*isKill*/);
- }
- return true;
-}
-
-bool ARMInstrInfo::restoreCalleeSavedRegisters(MachineBasicBlock &MBB,
- MachineBasicBlock::iterator MI,
- const std::vector<CalleeSavedInfo> &CSI) const {
- MachineFunction &MF = *MBB.getParent();
- ARMFunctionInfo *AFI = MF.getInfo<ARMFunctionInfo>();
- if (!AFI->isThumbFunction() || CSI.empty())
- return false;
-
- bool isVarArg = AFI->getVarArgsRegSaveSize() > 0;
- MachineInstr *PopMI = new MachineInstr(get(ARM::tPOP));
- MBB.insert(MI, PopMI);
- for (unsigned i = CSI.size(); i != 0; --i) {
- unsigned Reg = CSI[i-1].getReg();
- if (Reg == ARM::LR) {
- // Special epilogue for vararg functions. See emitEpilogue
- if (isVarArg)
- continue;
- Reg = ARM::PC;
- PopMI->setDesc(get(ARM::tPOP_RET));
- MBB.erase(MI);
- }
- PopMI->addOperand(MachineOperand::CreateReg(Reg, true));
- }
- return true;
-}
-
-MachineInstr *ARMInstrInfo::foldMemoryOperand(MachineFunction &MF,
- MachineInstr *MI,
- SmallVectorImpl<unsigned> &Ops,
- int FI) const {
- if (Ops.size() != 1) return NULL;
-
- unsigned OpNum = Ops[0];
- unsigned Opc = MI->getOpcode();
- MachineInstr *NewMI = NULL;
- switch (Opc) {
- default: break;
- case ARM::MOVr: {
- if (MI->getOperand(4).getReg() == ARM::CPSR)
- // If it is updating CPSR, then it cannot be foled.
- break;
- unsigned Pred = MI->getOperand(2).getImm();
- unsigned PredReg = MI->getOperand(3).getReg();
- if (OpNum == 0) { // move -> store
- unsigned SrcReg = MI->getOperand(1).getReg();
- NewMI = BuildMI(get(ARM::STR)).addReg(SrcReg).addFrameIndex(FI)
- .addReg(0).addImm(0).addImm(Pred).addReg(PredReg);
- } else { // move -> load
- unsigned DstReg = MI->getOperand(0).getReg();
- NewMI = BuildMI(get(ARM::LDR), DstReg).addFrameIndex(FI).addReg(0)
- .addImm(0).addImm(Pred).addReg(PredReg);
- }
- break;
- }
- case ARM::tMOVr: {
- if (OpNum == 0) { // move -> store
- unsigned SrcReg = MI->getOperand(1).getReg();
- if (RI.isPhysicalRegister(SrcReg) && !RI.isLowRegister(SrcReg))
- // tSpill cannot take a high register operand.
- break;
- NewMI = BuildMI(get(ARM::tSpill)).addReg(SrcReg).addFrameIndex(FI)
- .addImm(0);
- } else { // move -> load
- unsigned DstReg = MI->getOperand(0).getReg();
- if (RI.isPhysicalRegister(DstReg) && !RI.isLowRegister(DstReg))
- // tRestore cannot target a high register operand.
- break;
- NewMI = BuildMI(get(ARM::tRestore), DstReg).addFrameIndex(FI)
- .addImm(0);
- }
- break;
- }
- case ARM::FCPYS: {
- unsigned Pred = MI->getOperand(2).getImm();
- unsigned PredReg = MI->getOperand(3).getReg();
- if (OpNum == 0) { // move -> store
- unsigned SrcReg = MI->getOperand(1).getReg();
- NewMI = BuildMI(get(ARM::FSTS)).addReg(SrcReg).addFrameIndex(FI)
- .addImm(0).addImm(Pred).addReg(PredReg);
- } else { // move -> load
- unsigned DstReg = MI->getOperand(0).getReg();
- NewMI = BuildMI(get(ARM::FLDS), DstReg).addFrameIndex(FI)
- .addImm(0).addImm(Pred).addReg(PredReg);
- }
- break;
- }
- case ARM::FCPYD: {
- unsigned Pred = MI->getOperand(2).getImm();
- unsigned PredReg = MI->getOperand(3).getReg();
- if (OpNum == 0) { // move -> store
- unsigned SrcReg = MI->getOperand(1).getReg();
- NewMI = BuildMI(get(ARM::FSTD)).addReg(SrcReg).addFrameIndex(FI)
- .addImm(0).addImm(Pred).addReg(PredReg);
- } else { // move -> load
- unsigned DstReg = MI->getOperand(0).getReg();
- NewMI = BuildMI(get(ARM::FLDD), DstReg).addFrameIndex(FI)
- .addImm(0).addImm(Pred).addReg(PredReg);
- }
- break;
- }
- }
-
- if (NewMI)
- NewMI->copyKillDeadInfo(MI);
- return NewMI;
-}
-
-bool ARMInstrInfo::canFoldMemoryOperand(MachineInstr *MI,
- SmallVectorImpl<unsigned> &Ops) const {
- if (Ops.size() != 1) return false;
-
- unsigned OpNum = Ops[0];
- unsigned Opc = MI->getOpcode();
- switch (Opc) {
- default: break;
- case ARM::MOVr:
- // If it is updating CPSR, then it cannot be foled.
- return MI->getOperand(4).getReg() != ARM::CPSR;
- case ARM::tMOVr: {
- if (OpNum == 0) { // move -> store
- unsigned SrcReg = MI->getOperand(1).getReg();
- if (RI.isPhysicalRegister(SrcReg) && !RI.isLowRegister(SrcReg))
- // tSpill cannot take a high register operand.
- return false;
- } else { // move -> load
- unsigned DstReg = MI->getOperand(0).getReg();
- if (RI.isPhysicalRegister(DstReg) && !RI.isLowRegister(DstReg))
- // tRestore cannot target a high register operand.
- return false;
- }
- return true;
- }
- case ARM::FCPYS:
- case ARM::FCPYD:
- return true;
- }
-
- return false;
-}
-
-bool ARMInstrInfo::BlockHasNoFallThrough(MachineBasicBlock &MBB) const {
- if (MBB.empty()) return false;
-
- switch (MBB.back().getOpcode()) {
- case ARM::BX_RET: // Return.
- case ARM::LDM_RET:
- case ARM::tBX_RET:
- case ARM::tBX_RET_vararg:
- case ARM::tPOP_RET:
- case ARM::B:
- case ARM::tB: // Uncond branch.
- case ARM::tBR_JTr:
- case ARM::BR_JTr: // Jumptable branch.
- case ARM::BR_JTm: // Jumptable branch through mem.
- case ARM::BR_JTadd: // Jumptable branch add to pc.
- return true;
- default: return false;
- }
-}
-
-bool ARMInstrInfo::
-ReverseBranchCondition(std::vector<MachineOperand> &Cond) const {
- ARMCC::CondCodes CC = (ARMCC::CondCodes)(int)Cond[0].getImm();
- Cond[0].setImm(ARMCC::getOppositeCondition(CC));
- return false;
-}
-
-bool ARMInstrInfo::isPredicated(const MachineInstr *MI) const {
- int PIdx = MI->findFirstPredOperandIdx();
- return PIdx != -1 && MI->getOperand(PIdx).getImm() != ARMCC::AL;
-}
-
-bool ARMInstrInfo::PredicateInstruction(MachineInstr *MI,
- const std::vector<MachineOperand> &Pred) const {
- unsigned Opc = MI->getOpcode();
- if (Opc == ARM::B || Opc == ARM::tB) {
- MI->setDesc(get(Opc == ARM::B ? ARM::Bcc : ARM::tBcc));
- MI->addOperand(MachineOperand::CreateImm(Pred[0].getImm()));
- MI->addOperand(MachineOperand::CreateReg(Pred[1].getReg(), false));
- return true;
- }
-
- int PIdx = MI->findFirstPredOperandIdx();
- if (PIdx != -1) {
- MachineOperand &PMO = MI->getOperand(PIdx);
- PMO.setImm(Pred[0].getImm());
- MI->getOperand(PIdx+1).setReg(Pred[1].getReg());
- return true;
- }
- return false;
-}
-
-bool
-ARMInstrInfo::SubsumesPredicate(const std::vector<MachineOperand> &Pred1,
- const std::vector<MachineOperand> &Pred2) const{
- if (Pred1.size() > 2 || Pred2.size() > 2)
- return false;
-
- ARMCC::CondCodes CC1 = (ARMCC::CondCodes)Pred1[0].getImm();
- ARMCC::CondCodes CC2 = (ARMCC::CondCodes)Pred2[0].getImm();
- if (CC1 == CC2)
- return true;
-
- switch (CC1) {
- default:
- return false;
- case ARMCC::AL:
- return true;
- case ARMCC::HS:
- return CC2 == ARMCC::HI;
- case ARMCC::LS:
- return CC2 == ARMCC::LO || CC2 == ARMCC::EQ;
- case ARMCC::GE:
- return CC2 == ARMCC::GT;
- case ARMCC::LE:
- return CC2 == ARMCC::LT;
- }
-}
-
-bool ARMInstrInfo::DefinesPredicate(MachineInstr *MI,
- std::vector<MachineOperand> &Pred) const {
- const TargetInstrDesc &TID = MI->getDesc();
- if (!TID.getImplicitDefs() && !TID.hasOptionalDef())
- return false;
-
- bool Found = false;
- for (unsigned i = 0, e = MI->getNumOperands(); i != e; ++i) {
- const MachineOperand &MO = MI->getOperand(i);
- if (MO.isRegister() && MO.getReg() == ARM::CPSR) {
- Pred.push_back(MO);
- Found = true;
- }
- }
-
- return Found;
-}
-
-
-/// FIXME: Works around a gcc miscompilation with -fstrict-aliasing
-static unsigned getNumJTEntries(const std::vector<MachineJumpTableEntry> &JT,
- unsigned JTI) DISABLE_INLINE;
-static unsigned getNumJTEntries(const std::vector<MachineJumpTableEntry> &JT,
- unsigned JTI) {
- return JT[JTI].MBBs.size();
-}
-
-/// GetInstSize - Return the size of the specified MachineInstr.
-///
-unsigned ARMInstrInfo::GetInstSizeInBytes(const MachineInstr *MI) const {
- const MachineBasicBlock &MBB = *MI->getParent();
- const MachineFunction *MF = MBB.getParent();
- const TargetAsmInfo *TAI = MF->getTarget().getTargetAsmInfo();
-
- // Basic size info comes from the TSFlags field.
- const TargetInstrDesc &TID = MI->getDesc();
- unsigned TSFlags = TID.TSFlags;
-
- switch ((TSFlags & ARMII::SizeMask) >> ARMII::SizeShift) {
- default:
- // If this machine instr is an inline asm, measure it.
- if (MI->getOpcode() == ARM::INLINEASM)
- return TAI->getInlineAsmLength(MI->getOperand(0).getSymbolName());
- if (MI->getOpcode() == ARM::LABEL)
- return 0;
- if (MI->getOpcode() == TargetInstrInfo::IMPLICIT_DEF)
- return 0;
- assert(0 && "Unknown or unset size field for instr!");
- break;
- case ARMII::Size8Bytes: return 8; // Arm instruction x 2.
- case ARMII::Size4Bytes: return 4; // Arm instruction.
- case ARMII::Size2Bytes: return 2; // Thumb instruction.
- case ARMII::SizeSpecial: {
- switch (MI->getOpcode()) {
- case ARM::CONSTPOOL_ENTRY:
- // If this machine instr is a constant pool entry, its size is recorded as
- // operand #2.
- return MI->getOperand(2).getImm();
- case ARM::BR_JTr:
- case ARM::BR_JTm:
- case ARM::BR_JTadd:
- case ARM::tBR_JTr: {
- // These are jumptable branches, i.e. a branch followed by an inlined
- // jumptable. The size is 4 + 4 * number of entries.
- unsigned NumOps = TID.getNumOperands();
- MachineOperand JTOP =
- MI->getOperand(NumOps - (TID.isPredicable() ? 3 : 2));
- unsigned JTI = JTOP.getIndex();
- MachineJumpTableInfo *MJTI = MF->getJumpTableInfo();
- const std::vector<MachineJumpTableEntry> &JT = MJTI->getJumpTables();
- assert(JTI < JT.size());
- // Thumb instructions are 2 byte aligned, but JT entries are 4 byte
- // 4 aligned. The assembler / linker may add 2 byte padding just before
- // the JT entries. The size does not include this padding; the
- // constant islands pass does separate bookkeeping for it.
- // FIXME: If we know the size of the function is less than (1 << 16) *2
- // bytes, we can use 16-bit entries instead. Then there won't be an
- // alignment issue.
- return getNumJTEntries(JT, JTI) * 4 +
- (MI->getOpcode()==ARM::tBR_JTr ? 2 : 4);
- }
- default:
- // Otherwise, pseudo-instruction sizes are zero.
- return 0;
- }
- }
- }
- return 0; // Not reached
-}
diff --git a/release_23/lib/Target/ARM/ARMInstrInfo.h b/release_23/lib/Target/ARM/ARMInstrInfo.h
deleted file mode 100644
index 7bcedd8329b8..000000000000
--- a/release_23/lib/Target/ARM/ARMInstrInfo.h
+++ /dev/null
@@ -1,236 +0,0 @@
-//===- ARMInstrInfo.h - ARM Instruction Information -------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains the ARM implementation of the TargetInstrInfo class.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef ARMINSTRUCTIONINFO_H
-#define ARMINSTRUCTIONINFO_H
-
-#include "llvm/Target/TargetInstrInfo.h"
-#include "ARMRegisterInfo.h"
-
-namespace llvm {
- class ARMSubtarget;
-
-/// ARMII - This namespace holds all of the target specific flags that
-/// instruction info tracks.
-///
-namespace ARMII {
- enum {
- //===------------------------------------------------------------------===//
- // Instruction Flags.
-
- //===------------------------------------------------------------------===//
- // This three-bit field describes the addressing mode used. Zero is unused
- // so that we can tell if we forgot to set a value.
-
- AddrModeMask = 0xf,
- AddrModeNone = 0,
- AddrMode1 = 1,
- AddrMode2 = 2,
- AddrMode3 = 3,
- AddrMode4 = 4,
- AddrMode5 = 5,
- AddrModeT1 = 6,
- AddrModeT2 = 7,
- AddrModeT4 = 8,
- AddrModeTs = 9, // i8 * 4 for pc and sp relative data
-
- // Size* - Flags to keep track of the size of an instruction.
- SizeShift = 4,
- SizeMask = 7 << SizeShift,
- SizeSpecial = 1, // 0 byte pseudo or special case.
- Size8Bytes = 2,
- Size4Bytes = 3,
- Size2Bytes = 4,
-
- // IndexMode - Unindex, pre-indexed, or post-indexed. Only valid for load
- // and store ops
- IndexModeShift = 7,
- IndexModeMask = 3 << IndexModeShift,
- IndexModePre = 1,
- IndexModePost = 2,
-
- // Opcode
- OpcodeShift = 9,
- OpcodeMask = 0xf << OpcodeShift,
-
- // Format
- FormShift = 13,
- FormMask = 31 << FormShift,
-
- // Pseudo instructions
- Pseudo = 1 << FormShift,
-
- // Multiply instructions
- MulFrm = 2 << FormShift,
- MulSMLAW = 3 << FormShift,
- MulSMULW = 4 << FormShift,
- MulSMLA = 5 << FormShift,
- MulSMUL = 6 << FormShift,
-
- // Branch instructions
- Branch = 7 << FormShift,
- BranchMisc = 8 << FormShift,
-
- // Data Processing instructions
- DPRdIm = 9 << FormShift,
- DPRdReg = 10 << FormShift,
- DPRdSoReg = 11 << FormShift,
- DPRdMisc = 12 << FormShift,
-
- DPRnIm = 13 << FormShift,
- DPRnReg = 14 << FormShift,
- DPRnSoReg = 15 << FormShift,
-
- DPRIm = 16 << FormShift,
- DPRReg = 17 << FormShift,
- DPRSoReg = 18 << FormShift,
-
- DPRImS = 19 << FormShift,
- DPRRegS = 20 << FormShift,
- DPRSoRegS = 21 << FormShift,
-
- // Load and Store
- LdFrm = 22 << FormShift,
- StFrm = 23 << FormShift,
-
- // Miscellaneous arithmetic instructions
- ArithMisc = 24 << FormShift,
-
- // Thumb format
- ThumbFrm = 25 << FormShift,
-
- // VFP format
- VPFFrm = 26 << FormShift,
-
- // Field shifts - such shifts are used to set field while generating
- // machine instructions.
- RegRsShift = 8,
- RegRdShift = 12,
- RegRnShift = 16,
- L_BitShift = 20,
- S_BitShift = 20,
- U_BitShift = 23,
- IndexShift = 24,
- I_BitShift = 25
- };
-}
-
-class ARMInstrInfo : public TargetInstrInfoImpl {
- const ARMRegisterInfo RI;
-public:
- explicit ARMInstrInfo(const ARMSubtarget &STI);
-
- /// getRegisterInfo - TargetInstrInfo is a superset of MRegister info. As
- /// such, whenever a client has an instance of instruction info, it should
- /// always be able to get register info as well (through this method).
- ///
- virtual const TargetRegisterInfo &getRegisterInfo() const { return RI; }
-
- /// getPointerRegClass - Return the register class to use to hold pointers.
- /// This is used for addressing modes.
- virtual const TargetRegisterClass *getPointerRegClass() const;
-
- /// Return true if the instruction is a register to register move and
- /// leave the source and dest operands in the passed parameters.
- ///
- virtual bool isMoveInstr(const MachineInstr &MI,
- unsigned &SrcReg, unsigned &DstReg) const;
- virtual unsigned isLoadFromStackSlot(MachineInstr *MI, int &FrameIndex) const;
- virtual unsigned isStoreToStackSlot(MachineInstr *MI, int &FrameIndex) const;
-
- void reMaterialize(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI,
- unsigned DestReg, const MachineInstr *Orig) const;
-
- virtual MachineInstr *convertToThreeAddress(MachineFunction::iterator &MFI,
- MachineBasicBlock::iterator &MBBI,
- LiveVariables &LV) const;
-
- // Branch analysis.
- virtual bool AnalyzeBranch(MachineBasicBlock &MBB, MachineBasicBlock *&TBB,
- MachineBasicBlock *&FBB,
- std::vector<MachineOperand> &Cond) const;
- virtual unsigned RemoveBranch(MachineBasicBlock &MBB) const;
- virtual unsigned InsertBranch(MachineBasicBlock &MBB, MachineBasicBlock *TBB,
- MachineBasicBlock *FBB,
- const std::vector<MachineOperand> &Cond) const;
- virtual void copyRegToReg(MachineBasicBlock &MBB,
- MachineBasicBlock::iterator I,
- unsigned DestReg, unsigned SrcReg,
- const TargetRegisterClass *DestRC,
- const TargetRegisterClass *SrcRC) const;
- virtual void storeRegToStackSlot(MachineBasicBlock &MBB,
- MachineBasicBlock::iterator MBBI,
- unsigned SrcReg, bool isKill, int FrameIndex,
- const TargetRegisterClass *RC) const;
-
- virtual void storeRegToAddr(MachineFunction &MF, unsigned SrcReg, bool isKill,
- SmallVectorImpl<MachineOperand> &Addr,
- const TargetRegisterClass *RC,
- SmallVectorImpl<MachineInstr*> &NewMIs) const;
-
- virtual void loadRegFromStackSlot(MachineBasicBlock &MBB,
- MachineBasicBlock::iterator MBBI,
- unsigned DestReg, int FrameIndex,
- const TargetRegisterClass *RC) const;
-
- virtual void loadRegFromAddr(MachineFunction &MF, unsigned DestReg,
- SmallVectorImpl<MachineOperand> &Addr,
- const TargetRegisterClass *RC,
- SmallVectorImpl<MachineInstr*> &NewMIs) const;
- virtual bool spillCalleeSavedRegisters(MachineBasicBlock &MBB,
- MachineBasicBlock::iterator MI,
- const std::vector<CalleeSavedInfo> &CSI) const;
- virtual bool restoreCalleeSavedRegisters(MachineBasicBlock &MBB,
- MachineBasicBlock::iterator MI,
- const std::vector<CalleeSavedInfo> &CSI) const;
-
- virtual MachineInstr* foldMemoryOperand(MachineFunction &MF,
- MachineInstr* MI,
- SmallVectorImpl<unsigned> &Ops,
- int FrameIndex) const;
-
- virtual MachineInstr* foldMemoryOperand(MachineFunction &MF,
- MachineInstr* MI,
- SmallVectorImpl<unsigned> &Ops,
- MachineInstr* LoadMI) const {
- return 0;
- }
-
- virtual bool canFoldMemoryOperand(MachineInstr *MI,
- SmallVectorImpl<unsigned> &Ops) const;
-
- virtual bool BlockHasNoFallThrough(MachineBasicBlock &MBB) const;
- virtual bool ReverseBranchCondition(std::vector<MachineOperand> &Cond) const;
-
- // Predication support.
- virtual bool isPredicated(const MachineInstr *MI) const;
-
- virtual
- bool PredicateInstruction(MachineInstr *MI,
- const std::vector<MachineOperand> &Pred) const;
-
- virtual
- bool SubsumesPredicate(const std::vector<MachineOperand> &Pred1,
- const std::vector<MachineOperand> &Pred2) const;
-
- virtual bool DefinesPredicate(MachineInstr *MI,
- std::vector<MachineOperand> &Pred) const;
-
- /// GetInstSize - Returns the size of the specified MachineInstr.
- ///
- virtual unsigned GetInstSizeInBytes(const MachineInstr* MI) const;
-};
-
-}
-
-#endif
diff --git a/release_23/lib/Target/ARM/ARMInstrInfo.td b/release_23/lib/Target/ARM/ARMInstrInfo.td
deleted file mode 100644
index 34487ff5ef11..000000000000
--- a/release_23/lib/Target/ARM/ARMInstrInfo.td
+++ /dev/null
@@ -1,1455 +0,0 @@
-//===- ARMInstrInfo.td - Target Description for ARM Target -*- tablegen -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file describes the ARM instructions in TableGen format.
-//
-//===----------------------------------------------------------------------===//
-
-//===----------------------------------------------------------------------===//
-// ARM specific DAG Nodes.
-//
-
-// Type profiles.
-def SDT_ARMCallSeqStart : SDCallSeqStart<[ SDTCisVT<0, i32> ]>;
-def SDT_ARMCallSeqEnd : SDCallSeqEnd<[ SDTCisVT<0, i32>, SDTCisVT<1, i32> ]>;
-
-def SDT_ARMSaveCallPC : SDTypeProfile<0, 1, []>;
-
-def SDT_ARMcall : SDTypeProfile<0, -1, [SDTCisInt<0>]>;
-
-def SDT_ARMCMov : SDTypeProfile<1, 3,
- [SDTCisSameAs<0, 1>, SDTCisSameAs<0, 2>,
- SDTCisVT<3, i32>]>;
-
-def SDT_ARMBrcond : SDTypeProfile<0, 2,
- [SDTCisVT<0, OtherVT>, SDTCisVT<1, i32>]>;
-
-def SDT_ARMBrJT : SDTypeProfile<0, 3,
- [SDTCisPtrTy<0>, SDTCisVT<1, i32>,
- SDTCisVT<2, i32>]>;
-
-def SDT_ARMCmp : SDTypeProfile<0, 2, [SDTCisSameAs<0, 1>]>;
-
-def SDT_ARMPICAdd : SDTypeProfile<1, 2, [SDTCisSameAs<0, 1>,
- SDTCisPtrTy<1>, SDTCisVT<2, i32>]>;
-
-def SDT_ARMThreadPointer : SDTypeProfile<1, 0, [SDTCisPtrTy<0>]>;
-
-// Node definitions.
-def ARMWrapper : SDNode<"ARMISD::Wrapper", SDTIntUnaryOp>;
-def ARMWrapperJT : SDNode<"ARMISD::WrapperJT", SDTIntBinOp>;
-
-def ARMcallseq_start : SDNode<"ISD::CALLSEQ_START", SDT_ARMCallSeqStart,
- [SDNPHasChain, SDNPOutFlag]>;
-def ARMcallseq_end : SDNode<"ISD::CALLSEQ_END", SDT_ARMCallSeqEnd,
- [SDNPHasChain, SDNPOptInFlag, SDNPOutFlag]>;
-
-def ARMcall : SDNode<"ARMISD::CALL", SDT_ARMcall,
- [SDNPHasChain, SDNPOptInFlag, SDNPOutFlag]>;
-def ARMcall_pred : SDNode<"ARMISD::CALL_PRED", SDT_ARMcall,
- [SDNPHasChain, SDNPOptInFlag, SDNPOutFlag]>;
-def ARMcall_nolink : SDNode<"ARMISD::CALL_NOLINK", SDT_ARMcall,
- [SDNPHasChain, SDNPOptInFlag, SDNPOutFlag]>;
-
-def ARMretflag : SDNode<"ARMISD::RET_FLAG", SDTNone,
- [SDNPHasChain, SDNPOptInFlag]>;
-
-def ARMcmov : SDNode<"ARMISD::CMOV", SDT_ARMCMov,
- [SDNPInFlag]>;
-def ARMcneg : SDNode<"ARMISD::CNEG", SDT_ARMCMov,
- [SDNPInFlag]>;
-
-def ARMbrcond : SDNode<"ARMISD::BRCOND", SDT_ARMBrcond,
- [SDNPHasChain, SDNPInFlag, SDNPOutFlag]>;
-
-def ARMbrjt : SDNode<"ARMISD::BR_JT", SDT_ARMBrJT,
- [SDNPHasChain]>;
-
-def ARMcmp : SDNode<"ARMISD::CMP", SDT_ARMCmp,
- [SDNPOutFlag]>;
-
-def ARMcmpNZ : SDNode<"ARMISD::CMPNZ", SDT_ARMCmp,
- [SDNPOutFlag]>;
-
-def ARMpic_add : SDNode<"ARMISD::PIC_ADD", SDT_ARMPICAdd>;
-
-def ARMsrl_flag : SDNode<"ARMISD::SRL_FLAG", SDTIntUnaryOp, [SDNPOutFlag]>;
-def ARMsra_flag : SDNode<"ARMISD::SRA_FLAG", SDTIntUnaryOp, [SDNPOutFlag]>;
-def ARMrrx : SDNode<"ARMISD::RRX" , SDTIntUnaryOp, [SDNPInFlag ]>;
-
-def ARMthread_pointer: SDNode<"ARMISD::THREAD_POINTER", SDT_ARMThreadPointer>;
-
-//===----------------------------------------------------------------------===//
-// ARM Instruction Predicate Definitions.
-//
-def HasV5T : Predicate<"Subtarget->hasV5TOps()">;
-def HasV5TE : Predicate<"Subtarget->hasV5TEOps()">;
-def HasV6 : Predicate<"Subtarget->hasV6Ops()">;
-def IsThumb : Predicate<"Subtarget->isThumb()">;
-def IsARM : Predicate<"!Subtarget->isThumb()">;
-
-//===----------------------------------------------------------------------===//
-// ARM Flag Definitions.
-
-class RegConstraint<string C> {
- string Constraints = C;
-}
-
-//===----------------------------------------------------------------------===//
-// ARM specific transformation functions and pattern fragments.
-//
-
-// so_imm_XFORM - Return a so_imm value packed into the format described for
-// so_imm def below.
-def so_imm_XFORM : SDNodeXForm<imm, [{
- return CurDAG->getTargetConstant(ARM_AM::getSOImmVal(N->getValue()),
- MVT::i32);
-}]>;
-
-// so_imm_neg_XFORM - Return a so_imm value packed into the format described for
-// so_imm_neg def below.
-def so_imm_neg_XFORM : SDNodeXForm<imm, [{
- return CurDAG->getTargetConstant(ARM_AM::getSOImmVal(-(int)N->getValue()),
- MVT::i32);
-}]>;
-
-// so_imm_not_XFORM - Return a so_imm value packed into the format described for
-// so_imm_not def below.
-def so_imm_not_XFORM : SDNodeXForm<imm, [{
- return CurDAG->getTargetConstant(ARM_AM::getSOImmVal(~(int)N->getValue()),
- MVT::i32);
-}]>;
-
-// rot_imm predicate - True if the 32-bit immediate is equal to 8, 16, or 24.
-def rot_imm : PatLeaf<(i32 imm), [{
- int32_t v = (int32_t)N->getValue();
- return v == 8 || v == 16 || v == 24;
-}]>;
-
-/// imm1_15 predicate - True if the 32-bit immediate is in the range [1,15].
-def imm1_15 : PatLeaf<(i32 imm), [{
- return (int32_t)N->getValue() >= 1 && (int32_t)N->getValue() < 16;
-}]>;
-
-/// imm16_31 predicate - True if the 32-bit immediate is in the range [16,31].
-def imm16_31 : PatLeaf<(i32 imm), [{
- return (int32_t)N->getValue() >= 16 && (int32_t)N->getValue() < 32;
-}]>;
-
-def so_imm_neg :
- PatLeaf<(imm), [{ return ARM_AM::getSOImmVal(-(int)N->getValue()) != -1; }],
- so_imm_neg_XFORM>;
-
-def so_imm_not :
- PatLeaf<(imm), [{ return ARM_AM::getSOImmVal(~(int)N->getValue()) != -1; }],
- so_imm_not_XFORM>;
-
-// sext_16_node predicate - True if the SDNode is sign-extended 16 or more bits.
-def sext_16_node : PatLeaf<(i32 GPR:$a), [{
- return CurDAG->ComputeNumSignBits(SDOperand(N,0)) >= 17;
-}]>;
-
-
-
-//===----------------------------------------------------------------------===//
-// Operand Definitions.
-//
-
-// Branch target.
-def brtarget : Operand<OtherVT>;
-
-// A list of registers separated by comma. Used by load/store multiple.
-def reglist : Operand<i32> {
- let PrintMethod = "printRegisterList";
-}
-
-// An operand for the CONSTPOOL_ENTRY pseudo-instruction.
-def cpinst_operand : Operand<i32> {
- let PrintMethod = "printCPInstOperand";
-}
-
-def jtblock_operand : Operand<i32> {
- let PrintMethod = "printJTBlockOperand";
-}
-
-// Local PC labels.
-def pclabel : Operand<i32> {
- let PrintMethod = "printPCLabel";
-}
-
-// shifter_operand operands: so_reg and so_imm.
-def so_reg : Operand<i32>, // reg reg imm
- ComplexPattern<i32, 3, "SelectShifterOperandReg",
- [shl,srl,sra,rotr]> {
- let PrintMethod = "printSORegOperand";
- let MIOperandInfo = (ops GPR, GPR, i32imm);
-}
-
-// so_imm - Match a 32-bit shifter_operand immediate operand, which is an
-// 8-bit immediate rotated by an arbitrary number of bits. so_imm values are
-// represented in the imm field in the same 12-bit form that they are encoded
-// into so_imm instructions: the 8-bit immediate is the least significant bits
-// [bits 0-7], the 4-bit shift amount is the next 4 bits [bits 8-11].
-def so_imm : Operand<i32>,
- PatLeaf<(imm),
- [{ return ARM_AM::getSOImmVal(N->getValue()) != -1; }],
- so_imm_XFORM> {
- let PrintMethod = "printSOImmOperand";
-}
-
-// Break so_imm's up into two pieces. This handles immediates with up to 16
-// bits set in them. This uses so_imm2part to match and so_imm2part_[12] to
-// get the first/second pieces.
-def so_imm2part : Operand<i32>,
- PatLeaf<(imm),
- [{ return ARM_AM::isSOImmTwoPartVal((unsigned)N->getValue()); }]> {
- let PrintMethod = "printSOImm2PartOperand";
-}
-
-def so_imm2part_1 : SDNodeXForm<imm, [{
- unsigned V = ARM_AM::getSOImmTwoPartFirst((unsigned)N->getValue());
- return CurDAG->getTargetConstant(ARM_AM::getSOImmVal(V), MVT::i32);
-}]>;
-
-def so_imm2part_2 : SDNodeXForm<imm, [{
- unsigned V = ARM_AM::getSOImmTwoPartSecond((unsigned)N->getValue());
- return CurDAG->getTargetConstant(ARM_AM::getSOImmVal(V), MVT::i32);
-}]>;
-
-
-// Define ARM specific addressing modes.
-
-// addrmode2 := reg +/- reg shop imm
-// addrmode2 := reg +/- imm12
-//
-def addrmode2 : Operand<i32>,
- ComplexPattern<i32, 3, "SelectAddrMode2", []> {
- let PrintMethod = "printAddrMode2Operand";
- let MIOperandInfo = (ops GPR:$base, GPR:$offsreg, i32imm:$offsimm);
-}
-
-def am2offset : Operand<i32>,
- ComplexPattern<i32, 2, "SelectAddrMode2Offset", []> {
- let PrintMethod = "printAddrMode2OffsetOperand";
- let MIOperandInfo = (ops GPR, i32imm);
-}
-
-// addrmode3 := reg +/- reg
-// addrmode3 := reg +/- imm8
-//
-def addrmode3 : Operand<i32>,
- ComplexPattern<i32, 3, "SelectAddrMode3", []> {
- let PrintMethod = "printAddrMode3Operand";
- let MIOperandInfo = (ops GPR:$base, GPR:$offsreg, i32imm:$offsimm);
-}
-
-def am3offset : Operand<i32>,
- ComplexPattern<i32, 2, "SelectAddrMode3Offset", []> {
- let PrintMethod = "printAddrMode3OffsetOperand";
- let MIOperandInfo = (ops GPR, i32imm);
-}
-
-// addrmode4 := reg, <mode|W>
-//
-def addrmode4 : Operand<i32>,
- ComplexPattern<i32, 2, "", []> {
- let PrintMethod = "printAddrMode4Operand";
- let MIOperandInfo = (ops GPR, i32imm);
-}
-
-// addrmode5 := reg +/- imm8*4
-//
-def addrmode5 : Operand<i32>,
- ComplexPattern<i32, 2, "SelectAddrMode5", []> {
- let PrintMethod = "printAddrMode5Operand";
- let MIOperandInfo = (ops GPR, i32imm);
-}
-
-// addrmodepc := pc + reg
-//
-def addrmodepc : Operand<i32>,
- ComplexPattern<i32, 2, "SelectAddrModePC", []> {
- let PrintMethod = "printAddrModePCOperand";
- let MIOperandInfo = (ops GPR, i32imm);
-}
-
-// ARM Predicate operand. Default to 14 = always (AL). Second part is CC
-// register whose default is 0 (no register).
-def pred : PredicateOperand<OtherVT, (ops i32imm, CCR),
- (ops (i32 14), (i32 zero_reg))> {
- let PrintMethod = "printPredicateOperand";
-}
-
-// Conditional code result for instructions whose 's' bit is set, e.g. subs.
-//
-def cc_out : OptionalDefOperand<OtherVT, (ops CCR), (ops (i32 zero_reg))> {
- let PrintMethod = "printSBitModifierOperand";
-}
-
-//===----------------------------------------------------------------------===//
-// ARM Instruction flags. These need to match ARMInstrInfo.h.
-//
-
-// Addressing mode.
-class AddrMode<bits<4> val> {
- bits<4> Value = val;
-}
-def AddrModeNone : AddrMode<0>;
-def AddrMode1 : AddrMode<1>;
-def AddrMode2 : AddrMode<2>;
-def AddrMode3 : AddrMode<3>;
-def AddrMode4 : AddrMode<4>;
-def AddrMode5 : AddrMode<5>;
-def AddrModeT1 : AddrMode<6>;
-def AddrModeT2 : AddrMode<7>;
-def AddrModeT4 : AddrMode<8>;
-def AddrModeTs : AddrMode<9>;
-
-// Instruction size.
-class SizeFlagVal<bits<3> val> {
- bits<3> Value = val;
-}
-def SizeInvalid : SizeFlagVal<0>; // Unset.
-def SizeSpecial : SizeFlagVal<1>; // Pseudo or special.
-def Size8Bytes : SizeFlagVal<2>;
-def Size4Bytes : SizeFlagVal<3>;
-def Size2Bytes : SizeFlagVal<4>;
-
-// Load / store index mode.
-class IndexMode<bits<2> val> {
- bits<2> Value = val;
-}
-def IndexModeNone : IndexMode<0>;
-def IndexModePre : IndexMode<1>;
-def IndexModePost : IndexMode<2>;
-
-//===----------------------------------------------------------------------===//
-// ARM Instruction Format Definitions.
-//
-
-// Format specifies the encoding used by the instruction. This is part of the
-// ad-hoc solution used to emit machine instruction encodings by our machine
-// code emitter.
-class Format<bits<5> val> {
- bits<5> Value = val;
-}
-
-def Pseudo : Format<1>;
-def MulFrm : Format<2>;
-def MulSMLAW : Format<3>;
-def MulSMULW : Format<4>;
-def MulSMLA : Format<5>;
-def MulSMUL : Format<6>;
-def Branch : Format<7>;
-def BranchMisc : Format<8>;
-
-def DPRdIm : Format<9>;
-def DPRdReg : Format<10>;
-def DPRdSoReg : Format<11>;
-def DPRdMisc : Format<12>;
-def DPRnIm : Format<13>;
-def DPRnReg : Format<14>;
-def DPRnSoReg : Format<15>;
-def DPRIm : Format<16>;
-def DPRReg : Format<17>;
-def DPRSoReg : Format<18>;
-def DPRImS : Format<19>;
-def DPRRegS : Format<20>;
-def DPRSoRegS : Format<21>;
-
-def LdFrm : Format<22>;
-def StFrm : Format<23>;
-
-def ArithMisc : Format<24>;
-def ThumbFrm : Format<25>;
-def VFPFrm : Format<26>;
-
-
-
-//===----------------------------------------------------------------------===//
-
-// ARM Instruction templates.
-//
-
-// ARMPat - Same as Pat<>, but requires that the compiler be in ARM mode.
-class ARMPat<dag pattern, dag result> : Pat<pattern, result> {
- list<Predicate> Predicates = [IsARM];
-}
-class ARMV5TEPat<dag pattern, dag result> : Pat<pattern, result> {
- list<Predicate> Predicates = [IsARM, HasV5TE];
-}
-class ARMV6Pat<dag pattern, dag result> : Pat<pattern, result> {
- list<Predicate> Predicates = [IsARM, HasV6];
-}
-
-class InstARM<bits<4> opcod, AddrMode am, SizeFlagVal sz, IndexMode im,
- Format f, string cstr>
- : Instruction {
- let Namespace = "ARM";
-
- bits<4> Opcode = opcod;
- AddrMode AM = am;
- bits<4> AddrModeBits = AM.Value;
-
- SizeFlagVal SZ = sz;
- bits<3> SizeFlag = SZ.Value;
-
- IndexMode IM = im;
- bits<2> IndexModeBits = IM.Value;
-
- Format F = f;
- bits<5> Form = F.Value;
-
- let Constraints = cstr;
-}
-
-class PseudoInst<dag oops, dag iops, string asm, list<dag> pattern>
- : InstARM<0, AddrModeNone, SizeSpecial, IndexModeNone, Pseudo, ""> {
- let OutOperandList = oops;
- let InOperandList = iops;
- let AsmString = asm;
- let Pattern = pattern;
-}
-
-// Almost all ARM instructions are predicable.
-class I<bits<4> opcod, dag oops, dag iops, AddrMode am, SizeFlagVal sz,
- IndexMode im, Format f, string opc, string asm, string cstr,
- list<dag> pattern>
- : InstARM<opcod, am, sz, im, f, cstr> {
- let OutOperandList = oops;
- let InOperandList = !con(iops, (ops pred:$p));
- let AsmString = !strconcat(opc, !strconcat("${p}", asm));
- let Pattern = pattern;
- list<Predicate> Predicates = [IsARM];
-}
-
-// Same as I except it can optionally modify CPSR. Note it's modeled as
-// an input operand since by default it's a zero register. It will
-// become an implicit def once it's "flipped".
-class sI<bits<4> opcod, dag oops, dag iops, AddrMode am, SizeFlagVal sz,
- IndexMode im, Format f, string opc, string asm, string cstr,
- list<dag> pattern>
- : InstARM<opcod, am, sz, im, f, cstr> {
- let OutOperandList = oops;
- let InOperandList = !con(iops, (ops pred:$p, cc_out:$s));
- let AsmString = !strconcat(opc, !strconcat("${p}${s}", asm));
- let Pattern = pattern;
- list<Predicate> Predicates = [IsARM];
-}
-
-class AI<bits<4> opcod, dag oops, dag iops, Format f, string opc,
- string asm, list<dag> pattern>
- : I<opcod, oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, f, opc,
- asm,"",pattern>;
-class AsI<bits<4> opcod, dag oops, dag iops, Format f, string opc,
- string asm, list<dag> pattern>
- : sI<opcod, oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, f, opc,
- asm,"",pattern>;
-class AI1<bits<4> opcod, dag oops, dag iops, Format f, string opc,
- string asm, list<dag> pattern>
- : I<opcod, oops, iops, AddrMode1, Size4Bytes, IndexModeNone, f, opc,
- asm, "", pattern>;
-class AsI1<bits<4> opcod, dag oops, dag iops, Format f, string opc,
- string asm, list<dag> pattern>
- : sI<opcod, oops, iops, AddrMode1, Size4Bytes, IndexModeNone, f, opc,
- asm, "", pattern>;
-class AI2<bits<4> opcod, dag oops, dag iops, Format f, string opc,
- string asm, list<dag> pattern>
- : I<opcod, oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f, opc,
- asm, "", pattern>;
-class AI3<bits<4> opcod, dag oops, dag iops, Format f, string opc,
- string asm, list<dag> pattern>
- : I<opcod, oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, opc,
- asm, "", pattern>;
-class AI4<bits<4> opcod, dag oops, dag iops, Format f, string opc,
- string asm, list<dag> pattern>
- : I<opcod, oops, iops, AddrMode4, Size4Bytes, IndexModeNone, f, opc,
- asm, "", pattern>;
-class AI1x2<bits<4> opcod, dag oops, dag iops, Format f, string opc,
- string asm, list<dag> pattern>
- : I<opcod, oops, iops, AddrMode1, Size8Bytes, IndexModeNone, f, opc,
- asm, "", pattern>;
-
-// Pre-indexed ops
-class AI2pr<bits<4> opcod, dag oops, dag iops, Format f, string opc,
- string asm, string cstr, list<dag> pattern>
- : I<opcod, oops, iops, AddrMode2, Size4Bytes, IndexModePre, f, opc,
- asm, cstr, pattern>;
-class AI3pr<bits<4> opcod, dag oops, dag iops, Format f, string opc,
- string asm, string cstr, list<dag> pattern>
- : I<opcod, oops, iops, AddrMode3, Size4Bytes, IndexModePre, f, opc,
- asm, cstr, pattern>;
-
-// Post-indexed ops
-class AI2po<bits<4> opcod, dag oops, dag iops, Format f, string opc,
- string asm, string cstr, list<dag> pattern>
- : I<opcod, oops, iops, AddrMode2, Size4Bytes, IndexModePost, f, opc,
- asm, cstr,pattern>;
-class AI3po<bits<4> opcod, dag oops, dag iops, Format f, string opc,
- string asm, string cstr, list<dag> pattern>
- : I<opcod, oops, iops, AddrMode3, Size4Bytes, IndexModePost, f, opc,
- asm, cstr,pattern>;
-
-
-class BinOpFrag<dag res> : PatFrag<(ops node:$LHS, node:$RHS), res>;
-class UnOpFrag <dag res> : PatFrag<(ops node:$Src), res>;
-
-
-/// AI1_bin_irs - Defines a set of (op r, {so_imm|r|so_reg}) patterns for a
-/// binop that produces a value.
-multiclass AsI1_bin_irs<bits<4> opcod, string opc, PatFrag opnode> {
- def ri : AsI1<opcod, (outs GPR:$dst), (ins GPR:$a, so_imm:$b), DPRIm,
- opc, " $dst, $a, $b",
- [(set GPR:$dst, (opnode GPR:$a, so_imm:$b))]>;
- def rr : AsI1<opcod, (outs GPR:$dst), (ins GPR:$a, GPR:$b), DPRReg,
- opc, " $dst, $a, $b",
- [(set GPR:$dst, (opnode GPR:$a, GPR:$b))]>;
- def rs : AsI1<opcod, (outs GPR:$dst), (ins GPR:$a, so_reg:$b), DPRSoReg,
- opc, " $dst, $a, $b",
- [(set GPR:$dst, (opnode GPR:$a, so_reg:$b))]>;
-}
-
-/// ASI1_bin_s_irs - Similar to AsI1_bin_irs except it sets the 's' bit so the
-/// instruction modifies the CSPR register.
-let Defs = [CPSR] in {
-multiclass ASI1_bin_s_irs<bits<4> opcod, string opc, PatFrag opnode> {
- def ri : AI1<opcod, (outs GPR:$dst), (ins GPR:$a, so_imm:$b), DPRImS,
- opc, "s $dst, $a, $b",
- [(set GPR:$dst, (opnode GPR:$a, so_imm:$b))]>;
- def rr : AI1<opcod, (outs GPR:$dst), (ins GPR:$a, GPR:$b), DPRRegS,
- opc, "s $dst, $a, $b",
- [(set GPR:$dst, (opnode GPR:$a, GPR:$b))]>;
- def rs : AI1<opcod, (outs GPR:$dst), (ins GPR:$a, so_reg:$b), DPRSoRegS,
- opc, "s $dst, $a, $b",
- [(set GPR:$dst, (opnode GPR:$a, so_reg:$b))]>;
-}
-}
-
-/// AI1_cmp_irs - Defines a set of (op r, {so_imm|r|so_reg}) cmp / test
-/// patterns. Similar to AsI1_bin_irs except the instruction does not produce
-/// a explicit result, only implicitly set CPSR.
-let Defs = [CPSR] in {
-multiclass AI1_cmp_irs<bits<4> opcod, string opc, PatFrag opnode> {
- def ri : AI1<opcod, (outs), (ins GPR:$a, so_imm:$b), DPRnIm,
- opc, " $a, $b",
- [(opnode GPR:$a, so_imm:$b)]>;
- def rr : AI1<opcod, (outs), (ins GPR:$a, GPR:$b), DPRnReg,
- opc, " $a, $b",
- [(opnode GPR:$a, GPR:$b)]>;
- def rs : AI1<opcod, (outs), (ins GPR:$a, so_reg:$b), DPRnSoReg,
- opc, " $a, $b",
- [(opnode GPR:$a, so_reg:$b)]>;
-}
-}
-
-/// AI_unary_rrot - A unary operation with two forms: one whose operand is a
-/// register and one whose operand is a register rotated by 8/16/24.
-multiclass AI_unary_rrot<bits<4> opcod, string opc, PatFrag opnode> {
- def r : AI<opcod, (outs GPR:$dst), (ins GPR:$Src), Pseudo,
- opc, " $dst, $Src",
- [(set GPR:$dst, (opnode GPR:$Src))]>, Requires<[IsARM, HasV6]>;
- def r_rot : AI<opcod, (outs GPR:$dst), (ins GPR:$Src, i32imm:$rot), Pseudo,
- opc, " $dst, $Src, ror $rot",
- [(set GPR:$dst, (opnode (rotr GPR:$Src, rot_imm:$rot)))]>,
- Requires<[IsARM, HasV6]>;
-}
-
-/// AI_bin_rrot - A binary operation with two forms: one whose operand is a
-/// register and one whose operand is a register rotated by 8/16/24.
-multiclass AI_bin_rrot<bits<4> opcod, string opc, PatFrag opnode> {
- def rr : AI<opcod, (outs GPR:$dst), (ins GPR:$LHS, GPR:$RHS),
- Pseudo, opc, " $dst, $LHS, $RHS",
- [(set GPR:$dst, (opnode GPR:$LHS, GPR:$RHS))]>,
- Requires<[IsARM, HasV6]>;
- def rr_rot : AI<opcod, (outs GPR:$dst), (ins GPR:$LHS, GPR:$RHS, i32imm:$rot),
- Pseudo, opc, " $dst, $LHS, $RHS, ror $rot",
- [(set GPR:$dst, (opnode GPR:$LHS,
- (rotr GPR:$RHS, rot_imm:$rot)))]>,
- Requires<[IsARM, HasV6]>;
-}
-
-// Special cases.
-class XI<bits<4> opcod, dag oops, dag iops, AddrMode am, SizeFlagVal sz,
- IndexMode im, Format f, string asm, string cstr, list<dag> pattern>
- : InstARM<opcod, am, sz, im, f, cstr> {
- let OutOperandList = oops;
- let InOperandList = iops;
- let AsmString = asm;
- let Pattern = pattern;
- list<Predicate> Predicates = [IsARM];
-}
-
-class AXI<bits<4> opcod, dag oops, dag iops, Format f, string asm,
- list<dag> pattern>
- : XI<opcod, oops, iops, AddrModeNone, Size4Bytes, IndexModeNone, f, asm,
- "", pattern>;
-class AXI1<bits<4> opcod, dag oops, dag iops, Format f, string asm,
- list<dag> pattern>
- : XI<opcod, oops, iops, AddrMode1, Size4Bytes, IndexModeNone, f, asm,
- "", pattern>;
-class AXI2<bits<4> opcod, dag oops, dag iops, Format f, string asm,
- list<dag> pattern>
- : XI<opcod, oops, iops, AddrMode2, Size4Bytes, IndexModeNone, f, asm,
- "", pattern>;
-class AXI3<bits<4> opcod, dag oops, dag iops, Format f, string asm,
- list<dag> pattern>
- : XI<opcod, oops, iops, AddrMode3, Size4Bytes, IndexModeNone, f, asm,
- "", pattern>;
-class AXI4<bits<4> opcod, dag oops, dag iops, Format f, string asm,
- list<dag> pattern>
- : XI<opcod, oops, iops, AddrMode4, Size4Bytes, IndexModeNone, f, asm,
- "", pattern>;
-
-class AXIx2<bits<4> opcod, dag oops, dag iops, Format f, string asm,
- list<dag> pattern>
- : XI<opcod, oops, iops, AddrModeNone, Size8Bytes, IndexModeNone, f, asm,
- "", pattern>;
-
-// BR_JT instructions
-class JTI<bits<4> opcod, dag oops, dag iops, string asm, list<dag> pattern>
- : XI<opcod, oops, iops, AddrModeNone, SizeSpecial, IndexModeNone, BranchMisc,
- asm, "", pattern>;
-class JTI1<bits<4> opcod, dag oops, dag iops, string asm, list<dag> pattern>
- : XI<opcod, oops, iops, AddrMode1, SizeSpecial, IndexModeNone, BranchMisc,
- asm, "", pattern>;
-class JTI2<bits<4> opcod, dag oops, dag iops, string asm, list<dag> pattern>
- : XI<opcod, oops, iops, AddrMode2, SizeSpecial, IndexModeNone, BranchMisc,
- asm, "", pattern>;
-
-/// AsXI1_bin_c_irs - Same as AsI1_bin_irs but without the predicate operand and
-/// setting carry bit. But it can optionally set CPSR.
-let Uses = [CPSR] in {
-multiclass AsXI1_bin_c_irs<bits<4> opcod, string opc, PatFrag opnode> {
- def ri : AXI1<opcod, (outs GPR:$dst), (ins GPR:$a, so_imm:$b, cc_out:$s),
- DPRIm, !strconcat(opc, "${s} $dst, $a, $b"),
- [(set GPR:$dst, (opnode GPR:$a, so_imm:$b))]>;
- def rr : AXI1<opcod, (outs GPR:$dst), (ins GPR:$a, GPR:$b, cc_out:$s),
- DPRReg, !strconcat(opc, "${s} $dst, $a, $b"),
- [(set GPR:$dst, (opnode GPR:$a, GPR:$b))]>;
- def rs : AXI1<opcod, (outs GPR:$dst), (ins GPR:$a, so_reg:$b, cc_out:$s),
- DPRSoReg, !strconcat(opc, "${s} $dst, $a, $b"),
- [(set GPR:$dst, (opnode GPR:$a, so_reg:$b))]>;
-}
-}
-
-//===----------------------------------------------------------------------===//
-// Instructions
-//===----------------------------------------------------------------------===//
-
-//===----------------------------------------------------------------------===//
-// Miscellaneous Instructions.
-//
-
-/// CONSTPOOL_ENTRY - This instruction represents a floating constant pool in
-/// the function. The first operand is the ID# for this instruction, the second
-/// is the index into the MachineConstantPool that this is, the third is the
-/// size in bytes of this constant pool entry.
-let isNotDuplicable = 1 in
-def CONSTPOOL_ENTRY :
-PseudoInst<(outs), (ins cpinst_operand:$instid, cpinst_operand:$cpidx,
- i32imm:$size),
- "${instid:label} ${cpidx:cpentry}", []>;
-
-let Defs = [SP], Uses = [SP] in {
-def ADJCALLSTACKUP :
-PseudoInst<(outs), (ins i32imm:$amt1, i32imm:$amt2, pred:$p),
- "@ ADJCALLSTACKUP $amt1",
- [(ARMcallseq_end imm:$amt1, imm:$amt2)]>;
-
-def ADJCALLSTACKDOWN :
-PseudoInst<(outs), (ins i32imm:$amt, pred:$p),
- "@ ADJCALLSTACKDOWN $amt",
- [(ARMcallseq_start imm:$amt)]>;
-}
-
-def DWARF_LOC :
-PseudoInst<(outs), (ins i32imm:$line, i32imm:$col, i32imm:$file),
- ".loc $file, $line, $col",
- [(dwarf_loc (i32 imm:$line), (i32 imm:$col), (i32 imm:$file))]>;
-
-let isNotDuplicable = 1 in {
-def PICADD : AXI1<0x0, (outs GPR:$dst), (ins GPR:$a, pclabel:$cp, pred:$p),
- Pseudo, "$cp:\n\tadd$p $dst, pc, $a",
- [(set GPR:$dst, (ARMpic_add GPR:$a, imm:$cp))]>;
-
-let AddedComplexity = 10 in {
-let isSimpleLoad = 1 in
-def PICLD : AXI2<0x0, (outs GPR:$dst), (ins addrmodepc:$addr, pred:$p),
- Pseudo, "${addr:label}:\n\tldr$p $dst, $addr",
- [(set GPR:$dst, (load addrmodepc:$addr))]>;
-
-def PICLDZH : AXI3<0x0, (outs GPR:$dst), (ins addrmodepc:$addr, pred:$p),
- Pseudo, "${addr:label}:\n\tldr${p}h $dst, $addr",
- [(set GPR:$dst, (zextloadi16 addrmodepc:$addr))]>;
-
-def PICLDZB : AXI2<0x0, (outs GPR:$dst), (ins addrmodepc:$addr, pred:$p),
- Pseudo, "${addr:label}:\n\tldr${p}b $dst, $addr",
- [(set GPR:$dst, (zextloadi8 addrmodepc:$addr))]>;
-
-def PICLDH : AXI3<0x0, (outs GPR:$dst), (ins addrmodepc:$addr, pred:$p),
- Pseudo, "${addr:label}:\n\tldr${p}h $dst, $addr",
- [(set GPR:$dst, (extloadi16 addrmodepc:$addr))]>;
-
-def PICLDB : AXI2<0x0, (outs GPR:$dst), (ins addrmodepc:$addr, pred:$p),
- Pseudo, "${addr:label}:\n\tldr${p}b $dst, $addr",
- [(set GPR:$dst, (extloadi8 addrmodepc:$addr))]>;
-
-def PICLDSH : AXI3<0x0, (outs GPR:$dst), (ins addrmodepc:$addr, pred:$p),
- Pseudo, "${addr:label}:\n\tldr${p}sh $dst, $addr",
- [(set GPR:$dst, (sextloadi16 addrmodepc:$addr))]>;
-
-def PICLDSB : AXI3<0x0, (outs GPR:$dst), (ins addrmodepc:$addr, pred:$p),
- Pseudo, "${addr:label}:\n\tldr${p}sb $dst, $addr",
- [(set GPR:$dst, (sextloadi8 addrmodepc:$addr))]>;
-}
-let AddedComplexity = 10 in {
-def PICSTR : AXI2<0x0, (outs), (ins GPR:$src, addrmodepc:$addr, pred:$p),
- Pseudo, "${addr:label}:\n\tstr$p $src, $addr",
- [(store GPR:$src, addrmodepc:$addr)]>;
-
-def PICSTRH : AXI3<0x0, (outs), (ins GPR:$src, addrmodepc:$addr, pred:$p),
- Pseudo, "${addr:label}:\n\tstr${p}h $src, $addr",
- [(truncstorei16 GPR:$src, addrmodepc:$addr)]>;
-
-def PICSTRB : AXI2<0x0, (outs), (ins GPR:$src, addrmodepc:$addr, pred:$p),
- Pseudo, "${addr:label}:\n\tstr${p}b $src, $addr",
- [(truncstorei8 GPR:$src, addrmodepc:$addr)]>;
-}
-}
-
-//===----------------------------------------------------------------------===//
-// Control Flow Instructions.
-//
-
-let isReturn = 1, isTerminator = 1 in
- def BX_RET : AI<0x1, (outs), (ins), BranchMisc, "bx", " lr", [(ARMretflag)]>;
-
-// FIXME: remove when we have a way to marking a MI with these properties.
-// FIXME: $dst1 should be a def. But the extra ops must be in the end of the
-// operand list.
-let isReturn = 1, isTerminator = 1 in
- def LDM_RET : AXI4<0x0, (outs),
- (ins addrmode4:$addr, pred:$p, reglist:$dst1, variable_ops),
- LdFrm, "ldm${p}${addr:submode} $addr, $dst1",
- []>;
-
-let isCall = 1,
- Defs = [R0, R1, R2, R3, R12, LR,
- D0, D1, D2, D3, D4, D5, D6, D7, CPSR] in {
- def BL : AXI<0xB, (outs), (ins i32imm:$func, variable_ops), Branch,
- "bl ${func:call}",
- [(ARMcall tglobaladdr:$func)]>;
-
- def BL_pred : AI<0xB, (outs), (ins i32imm:$func, variable_ops),
- Branch, "bl", " ${func:call}",
- [(ARMcall_pred tglobaladdr:$func)]>;
-
- // ARMv5T and above
- def BLX : AXI<0x2, (outs), (ins GPR:$func, variable_ops), BranchMisc,
- "blx $func",
- [(ARMcall GPR:$func)]>, Requires<[IsARM, HasV5T]>;
- let Uses = [LR] in {
- // ARMv4T
- def BX : AXIx2<0x0, (outs), (ins GPR:$func, variable_ops),
- BranchMisc, "mov lr, pc\n\tbx $func",
- [(ARMcall_nolink GPR:$func)]>;
- }
-}
-
-let isBranch = 1, isTerminator = 1 in {
- // B is "predicable" since it can be xformed into a Bcc.
- let isBarrier = 1 in {
- let isPredicable = 1 in
- def B : AXI<0xA, (outs), (ins brtarget:$target), Branch, "b $target",
- [(br bb:$target)]>;
-
- let isNotDuplicable = 1, isIndirectBranch = 1 in {
- def BR_JTr : JTI<0x0, (outs), (ins GPR:$target, jtblock_operand:$jt, i32imm:$id),
- "mov pc, $target \n$jt",
- [(ARMbrjt GPR:$target, tjumptable:$jt, imm:$id)]>;
- def BR_JTm : JTI2<0x0, (outs), (ins addrmode2:$target, jtblock_operand:$jt, i32imm:$id),
- "ldr pc, $target \n$jt",
- [(ARMbrjt (i32 (load addrmode2:$target)), tjumptable:$jt,
- imm:$id)]>;
- def BR_JTadd : JTI1<0x0, (outs), (ins GPR:$target, GPR:$idx, jtblock_operand:$jt,
- i32imm:$id),
- "add pc, $target, $idx \n$jt",
- [(ARMbrjt (add GPR:$target, GPR:$idx), tjumptable:$jt,
- imm:$id)]>;
- }
- }
-
- // FIXME: should be able to write a pattern for ARMBrcond, but can't use
- // a two-value operand where a dag node expects two operands. :(
- def Bcc : AI<0xA, (outs), (ins brtarget:$target), Branch,
- "b", " $target",
- [/*(ARMbrcond bb:$target, imm:$cc, CCR:$ccr)*/]>;
-}
-
-//===----------------------------------------------------------------------===//
-// Load / store Instructions.
-//
-
-// Load
-let isSimpleLoad = 1 in
-def LDR : AI2<0x0, (outs GPR:$dst), (ins addrmode2:$addr), LdFrm,
- "ldr", " $dst, $addr",
- [(set GPR:$dst, (load addrmode2:$addr))]>;
-
-// Special LDR for loads from non-pc-relative constpools.
-let isSimpleLoad = 1, mayLoad = 1, isReMaterializable = 1 in
-def LDRcp : AI2<0x0, (outs GPR:$dst), (ins addrmode2:$addr), LdFrm,
- "ldr", " $dst, $addr", []>;
-
-// Loads with zero extension
-def LDRH : AI3<0xB, (outs GPR:$dst), (ins addrmode3:$addr), LdFrm,
- "ldr", "h $dst, $addr",
- [(set GPR:$dst, (zextloadi16 addrmode3:$addr))]>;
-
-def LDRB : AI2<0x1, (outs GPR:$dst), (ins addrmode2:$addr), LdFrm,
- "ldr", "b $dst, $addr",
- [(set GPR:$dst, (zextloadi8 addrmode2:$addr))]>;
-
-// Loads with sign extension
-def LDRSH : AI3<0xE, (outs GPR:$dst), (ins addrmode3:$addr), LdFrm,
- "ldr", "sh $dst, $addr",
- [(set GPR:$dst, (sextloadi16 addrmode3:$addr))]>;
-
-def LDRSB : AI3<0xD, (outs GPR:$dst), (ins addrmode3:$addr), LdFrm,
- "ldr", "sb $dst, $addr",
- [(set GPR:$dst, (sextloadi8 addrmode3:$addr))]>;
-
-let mayLoad = 1 in {
-// Load doubleword
-def LDRD : AI3<0xD, (outs GPR:$dst), (ins addrmode3:$addr), LdFrm,
- "ldr", "d $dst, $addr",
- []>, Requires<[IsARM, HasV5T]>;
-
-// Indexed loads
-def LDR_PRE : AI2pr<0x0, (outs GPR:$dst, GPR:$base_wb),
- (ins addrmode2:$addr), LdFrm,
- "ldr", " $dst, $addr!", "$addr.base = $base_wb", []>;
-
-def LDR_POST : AI2po<0x0, (outs GPR:$dst, GPR:$base_wb),
- (ins GPR:$base, am2offset:$offset), LdFrm,
- "ldr", " $dst, [$base], $offset", "$base = $base_wb", []>;
-
-def LDRH_PRE : AI3pr<0xB, (outs GPR:$dst, GPR:$base_wb),
- (ins addrmode3:$addr), LdFrm,
- "ldr", "h $dst, $addr!", "$addr.base = $base_wb", []>;
-
-def LDRH_POST : AI3po<0xB, (outs GPR:$dst, GPR:$base_wb),
- (ins GPR:$base,am3offset:$offset), LdFrm,
- "ldr", "h $dst, [$base], $offset", "$base = $base_wb", []>;
-
-def LDRB_PRE : AI2pr<0x1, (outs GPR:$dst, GPR:$base_wb),
- (ins addrmode2:$addr), LdFrm,
- "ldr", "b $dst, $addr!", "$addr.base = $base_wb", []>;
-
-def LDRB_POST : AI2po<0x1, (outs GPR:$dst, GPR:$base_wb),
- (ins GPR:$base,am2offset:$offset), LdFrm,
- "ldr", "b $dst, [$base], $offset", "$base = $base_wb", []>;
-
-def LDRSH_PRE : AI3pr<0xE, (outs GPR:$dst, GPR:$base_wb),
- (ins addrmode3:$addr), LdFrm,
- "ldr", "sh $dst, $addr!", "$addr.base = $base_wb", []>;
-
-def LDRSH_POST: AI3po<0xE, (outs GPR:$dst, GPR:$base_wb),
- (ins GPR:$base,am3offset:$offset), LdFrm,
- "ldr", "sh $dst, [$base], $offset", "$base = $base_wb", []>;
-
-def LDRSB_PRE : AI3pr<0xD, (outs GPR:$dst, GPR:$base_wb),
- (ins addrmode3:$addr), LdFrm,
- "ldr", "sb $dst, $addr!", "$addr.base = $base_wb", []>;
-
-def LDRSB_POST: AI3po<0xD, (outs GPR:$dst, GPR:$base_wb),
- (ins GPR:$base,am3offset:$offset), LdFrm,
- "ldr", "sb $dst, [$base], $offset", "$base = $base_wb", []>;
-}
-
-// Store
-def STR : AI2<0x0, (outs), (ins GPR:$src, addrmode2:$addr), StFrm,
- "str", " $src, $addr",
- [(store GPR:$src, addrmode2:$addr)]>;
-
-// Stores with truncate
-def STRH : AI3<0xB, (outs), (ins GPR:$src, addrmode3:$addr), StFrm,
- "str", "h $src, $addr",
- [(truncstorei16 GPR:$src, addrmode3:$addr)]>;
-
-def STRB : AI2<0x1, (outs), (ins GPR:$src, addrmode2:$addr), StFrm,
- "str", "b $src, $addr",
- [(truncstorei8 GPR:$src, addrmode2:$addr)]>;
-
-// Store doubleword
-let mayStore = 1 in
-def STRD : AI3<0xF, (outs), (ins GPR:$src, addrmode3:$addr), StFrm,
- "str", "d $src, $addr",
- []>, Requires<[IsARM, HasV5T]>;
-
-// Indexed stores
-def STR_PRE : AI2pr<0x0, (outs GPR:$base_wb),
- (ins GPR:$src, GPR:$base, am2offset:$offset), StFrm,
- "str", " $src, [$base, $offset]!", "$base = $base_wb",
- [(set GPR:$base_wb,
- (pre_store GPR:$src, GPR:$base, am2offset:$offset))]>;
-
-def STR_POST : AI2po<0x0, (outs GPR:$base_wb),
- (ins GPR:$src, GPR:$base,am2offset:$offset), StFrm,
- "str", " $src, [$base], $offset", "$base = $base_wb",
- [(set GPR:$base_wb,
- (post_store GPR:$src, GPR:$base, am2offset:$offset))]>;
-
-def STRH_PRE : AI3pr<0xB, (outs GPR:$base_wb),
- (ins GPR:$src, GPR:$base,am3offset:$offset), StFrm,
- "str", "h $src, [$base, $offset]!", "$base = $base_wb",
- [(set GPR:$base_wb,
- (pre_truncsti16 GPR:$src, GPR:$base,am3offset:$offset))]>;
-
-def STRH_POST: AI3po<0xB, (outs GPR:$base_wb),
- (ins GPR:$src, GPR:$base,am3offset:$offset), StFrm,
- "str", "h $src, [$base], $offset", "$base = $base_wb",
- [(set GPR:$base_wb, (post_truncsti16 GPR:$src,
- GPR:$base, am3offset:$offset))]>;
-
-def STRB_PRE : AI2pr<0x1, (outs GPR:$base_wb),
- (ins GPR:$src, GPR:$base,am2offset:$offset), StFrm,
- "str", "b $src, [$base, $offset]!", "$base = $base_wb",
- [(set GPR:$base_wb, (pre_truncsti8 GPR:$src,
- GPR:$base, am2offset:$offset))]>;
-
-def STRB_POST: AI2po<0x1, (outs GPR:$base_wb),
- (ins GPR:$src, GPR:$base,am2offset:$offset), StFrm,
- "str", "b $src, [$base], $offset", "$base = $base_wb",
- [(set GPR:$base_wb, (post_truncsti8 GPR:$src,
- GPR:$base, am2offset:$offset))]>;
-
-//===----------------------------------------------------------------------===//
-// Load / store multiple Instructions.
-//
-
-// FIXME: $dst1 should be a def.
-let mayLoad = 1 in
-def LDM : AXI4<0x0, (outs),
- (ins addrmode4:$addr, pred:$p, reglist:$dst1, variable_ops),
- LdFrm, "ldm${p}${addr:submode} $addr, $dst1",
- []>;
-
-let mayStore = 1 in
-def STM : AXI4<0x0, (outs),
- (ins addrmode4:$addr, pred:$p, reglist:$src1, variable_ops),
- StFrm, "stm${p}${addr:submode} $addr, $src1",
- []>;
-
-//===----------------------------------------------------------------------===//
-// Move Instructions.
-//
-
-def MOVr : AsI1<0xD, (outs GPR:$dst), (ins GPR:$src), DPRdReg,
- "mov", " $dst, $src", []>;
-def MOVs : AsI1<0xD, (outs GPR:$dst), (ins so_reg:$src), DPRdSoReg,
- "mov", " $dst, $src", [(set GPR:$dst, so_reg:$src)]>;
-
-let isReMaterializable = 1 in
-def MOVi : AsI1<0xD, (outs GPR:$dst), (ins so_imm:$src), DPRdIm,
- "mov", " $dst, $src", [(set GPR:$dst, so_imm:$src)]>;
-
-def MOVrx : AsI1<0xD, (outs GPR:$dst), (ins GPR:$src), DPRdMisc,
- "mov", " $dst, $src, rrx",
- [(set GPR:$dst, (ARMrrx GPR:$src))]>;
-
-// These aren't really mov instructions, but we have to define them this way
-// due to flag operands.
-
-let Defs = [CPSR] in {
-def MOVsrl_flag : AI1<0xD, (outs GPR:$dst), (ins GPR:$src), DPRdMisc,
- "mov", "s $dst, $src, lsr #1",
- [(set GPR:$dst, (ARMsrl_flag GPR:$src))]>;
-def MOVsra_flag : AI1<0xD, (outs GPR:$dst), (ins GPR:$src), DPRdMisc,
- "mov", "s $dst, $src, asr #1",
- [(set GPR:$dst, (ARMsra_flag GPR:$src))]>;
-}
-
-//===----------------------------------------------------------------------===//
-// Extend Instructions.
-//
-
-// Sign extenders
-
-defm SXTB : AI_unary_rrot<0x0, "sxtb", UnOpFrag<(sext_inreg node:$Src, i8)>>;
-defm SXTH : AI_unary_rrot<0x0, "sxth", UnOpFrag<(sext_inreg node:$Src, i16)>>;
-
-defm SXTAB : AI_bin_rrot<0x0, "sxtab",
- BinOpFrag<(add node:$LHS, (sext_inreg node:$RHS, i8))>>;
-defm SXTAH : AI_bin_rrot<0x0, "sxtah",
- BinOpFrag<(add node:$LHS, (sext_inreg node:$RHS,i16))>>;
-
-// TODO: SXT(A){B|H}16
-
-// Zero extenders
-
-let AddedComplexity = 16 in {
-defm UXTB : AI_unary_rrot<0x0, "uxtb" , UnOpFrag<(and node:$Src, 0x000000FF)>>;
-defm UXTH : AI_unary_rrot<0x0, "uxth" , UnOpFrag<(and node:$Src, 0x0000FFFF)>>;
-defm UXTB16 : AI_unary_rrot<0x0, "uxtb16", UnOpFrag<(and node:$Src, 0x00FF00FF)>>;
-
-def : ARMV6Pat<(and (shl GPR:$Src, 8), 0xFF00FF),
- (UXTB16r_rot GPR:$Src, 24)>;
-def : ARMV6Pat<(and (srl GPR:$Src, 8), 0xFF00FF),
- (UXTB16r_rot GPR:$Src, 8)>;
-
-defm UXTAB : AI_bin_rrot<0x0, "uxtab",
- BinOpFrag<(add node:$LHS, (and node:$RHS, 0x00FF))>>;
-defm UXTAH : AI_bin_rrot<0x0, "uxtah",
- BinOpFrag<(add node:$LHS, (and node:$RHS, 0xFFFF))>>;
-}
-
-// This isn't safe in general, the add is two 16-bit units, not a 32-bit add.
-//defm UXTAB16 : xxx<"uxtab16", 0xff00ff>;
-
-// TODO: UXT(A){B|H}16
-
-//===----------------------------------------------------------------------===//
-// Arithmetic Instructions.
-//
-
-defm ADD : AsI1_bin_irs<0x4, "add", BinOpFrag<(add node:$LHS, node:$RHS)>>;
-defm SUB : AsI1_bin_irs<0x2, "sub", BinOpFrag<(sub node:$LHS, node:$RHS)>>;
-
-// ADD and SUB with 's' bit set.
-defm ADDS : ASI1_bin_s_irs<0x4, "add", BinOpFrag<(addc node:$LHS, node:$RHS)>>;
-defm SUBS : ASI1_bin_s_irs<0x2, "sub", BinOpFrag<(subc node:$LHS, node:$RHS)>>;
-
-// FIXME: Do not allow ADC / SBC to be predicated for now.
-defm ADC : AsXI1_bin_c_irs<0x5, "adc", BinOpFrag<(adde node:$LHS, node:$RHS)>>;
-defm SBC : AsXI1_bin_c_irs<0x6, "sbc", BinOpFrag<(sube node:$LHS, node:$RHS)>>;
-
-// These don't define reg/reg forms, because they are handled above.
-def RSBri : AsI1<0x3, (outs GPR:$dst), (ins GPR:$a, so_imm:$b), DPRIm,
- "rsb", " $dst, $a, $b",
- [(set GPR:$dst, (sub so_imm:$b, GPR:$a))]>;
-
-def RSBrs : AsI1<0x3, (outs GPR:$dst), (ins GPR:$a, so_reg:$b), DPRSoReg,
- "rsb", " $dst, $a, $b",
- [(set GPR:$dst, (sub so_reg:$b, GPR:$a))]>;
-
-// RSB with 's' bit set.
-let Defs = [CPSR] in {
-def RSBSri : AI1<0x3, (outs GPR:$dst), (ins GPR:$a, so_imm:$b), DPRIm,
- "rsb", "s $dst, $a, $b",
- [(set GPR:$dst, (subc so_imm:$b, GPR:$a))]>;
-def RSBSrs : AI1<0x3, (outs GPR:$dst), (ins GPR:$a, so_reg:$b), DPRSoReg,
- "rsb", "s $dst, $a, $b",
- [(set GPR:$dst, (subc so_reg:$b, GPR:$a))]>;
-}
-
-// FIXME: Do not allow RSC to be predicated for now. But they can set CPSR.
-let Uses = [CPSR] in {
-def RSCri : AXI1<0x7, (outs GPR:$dst), (ins GPR:$a, so_imm:$b, cc_out:$s),
- DPRIm, "rsc${s} $dst, $a, $b",
- [(set GPR:$dst, (sube so_imm:$b, GPR:$a))]>;
-def RSCrs : AXI1<0x7, (outs GPR:$dst), (ins GPR:$a, so_reg:$b, cc_out:$s),
- DPRSoReg, "rsc${s} $dst, $a, $b",
- [(set GPR:$dst, (sube so_reg:$b, GPR:$a))]>;
-}
-
-// (sub X, imm) gets canonicalized to (add X, -imm). Match this form.
-def : ARMPat<(add GPR:$src, so_imm_neg:$imm),
- (SUBri GPR:$src, so_imm_neg:$imm)>;
-
-//def : ARMPat<(addc GPR:$src, so_imm_neg:$imm),
-// (SUBSri GPR:$src, so_imm_neg:$imm)>;
-//def : ARMPat<(adde GPR:$src, so_imm_neg:$imm),
-// (SBCri GPR:$src, so_imm_neg:$imm)>;
-
-// Note: These are implemented in C++ code, because they have to generate
-// ADD/SUBrs instructions, which use a complex pattern that a xform function
-// cannot produce.
-// (mul X, 2^n+1) -> (add (X << n), X)
-// (mul X, 2^n-1) -> (rsb X, (X << n))
-
-
-//===----------------------------------------------------------------------===//
-// Bitwise Instructions.
-//
-
-defm AND : AsI1_bin_irs<0x0, "and", BinOpFrag<(and node:$LHS, node:$RHS)>>;
-defm ORR : AsI1_bin_irs<0xC, "orr", BinOpFrag<(or node:$LHS, node:$RHS)>>;
-defm EOR : AsI1_bin_irs<0x1, "eor", BinOpFrag<(xor node:$LHS, node:$RHS)>>;
-defm BIC : AsI1_bin_irs<0xE, "bic", BinOpFrag<(and node:$LHS, (not node:$RHS))>>;
-
-def MVNr : AsI<0xE, (outs GPR:$dst), (ins GPR:$src), DPRdReg,
- "mvn", " $dst, $src", [(set GPR:$dst, (not GPR:$src))]>;
-def MVNs : AsI<0xE, (outs GPR:$dst), (ins so_reg:$src), DPRdSoReg,
- "mvn", " $dst, $src", [(set GPR:$dst, (not so_reg:$src))]>;
-let isReMaterializable = 1 in
-def MVNi : AsI<0xE, (outs GPR:$dst), (ins so_imm:$imm), DPRdIm,
- "mvn", " $dst, $imm", [(set GPR:$dst, so_imm_not:$imm)]>;
-
-def : ARMPat<(and GPR:$src, so_imm_not:$imm),
- (BICri GPR:$src, so_imm_not:$imm)>;
-
-//===----------------------------------------------------------------------===//
-// Multiply Instructions.
-//
-
-def MUL : AsI<0x0, (outs GPR:$dst), (ins GPR:$a, GPR:$b), MulFrm,
- "mul", " $dst, $a, $b",
- [(set GPR:$dst, (mul GPR:$a, GPR:$b))]>;
-
-def MLA : AsI<0x2, (outs GPR:$dst), (ins GPR:$a, GPR:$b, GPR:$c),
- MulFrm, "mla", " $dst, $a, $b, $c",
- [(set GPR:$dst, (add (mul GPR:$a, GPR:$b), GPR:$c))]>;
-
-// Extra precision multiplies with low / high results
-def SMULL : AsI<0xC, (outs GPR:$ldst, GPR:$hdst), (ins GPR:$a, GPR:$b),
- MulFrm, "smull", " $ldst, $hdst, $a, $b", []>;
-
-def UMULL : AsI<0x8, (outs GPR:$ldst, GPR:$hdst), (ins GPR:$a, GPR:$b),
- MulFrm, "umull", " $ldst, $hdst, $a, $b", []>;
-
-// Multiply + accumulate
-def SMLAL : AsI<0xE, (outs GPR:$ldst, GPR:$hdst), (ins GPR:$a, GPR:$b),
- MulFrm, "smlal", " $ldst, $hdst, $a, $b", []>;
-
-def UMLAL : AsI<0xA, (outs GPR:$ldst, GPR:$hdst), (ins GPR:$a, GPR:$b),
- MulFrm, "umlal", " $ldst, $hdst, $a, $b", []>;
-
-def UMAAL : AI<0x0, (outs GPR:$ldst, GPR:$hdst), (ins GPR:$a, GPR:$b), MulFrm,
- "umaal", " $ldst, $hdst, $a, $b", []>,
- Requires<[IsARM, HasV6]>;
-
-// Most significant word multiply
-def SMMUL : AI<0x0, (outs GPR:$dst), (ins GPR:$a, GPR:$b), MulFrm,
- "smmul", " $dst, $a, $b",
- [(set GPR:$dst, (mulhs GPR:$a, GPR:$b))]>,
- Requires<[IsARM, HasV6]>;
-
-def SMMLA : AI<0x0, (outs GPR:$dst), (ins GPR:$a, GPR:$b, GPR:$c), MulFrm,
- "smmla", " $dst, $a, $b, $c",
- [(set GPR:$dst, (add (mulhs GPR:$a, GPR:$b), GPR:$c))]>,
- Requires<[IsARM, HasV6]>;
-
-
-def SMMLS : AI<0x0, (outs GPR:$dst), (ins GPR:$a, GPR:$b, GPR:$c), MulFrm,
- "smmls", " $dst, $a, $b, $c",
- [(set GPR:$dst, (sub GPR:$c, (mulhs GPR:$a, GPR:$b)))]>,
- Requires<[IsARM, HasV6]>;
-
-multiclass AI_smul<string opc, PatFrag opnode> {
- def BB : AI<0x8, (outs GPR:$dst), (ins GPR:$a, GPR:$b), MulSMUL,
- !strconcat(opc, "bb"), " $dst, $a, $b",
- [(set GPR:$dst, (opnode (sext_inreg GPR:$a, i16),
- (sext_inreg GPR:$b, i16)))]>,
- Requires<[IsARM, HasV5TE]>;
-
- def BT : AI<0xC, (outs GPR:$dst), (ins GPR:$a, GPR:$b), MulSMUL,
- !strconcat(opc, "bt"), " $dst, $a, $b",
- [(set GPR:$dst, (opnode (sext_inreg GPR:$a, i16),
- (sra GPR:$b, 16)))]>,
- Requires<[IsARM, HasV5TE]>;
-
- def TB : AI<0xA, (outs GPR:$dst), (ins GPR:$a, GPR:$b), MulSMUL,
- !strconcat(opc, "tb"), " $dst, $a, $b",
- [(set GPR:$dst, (opnode (sra GPR:$a, 16),
- (sext_inreg GPR:$b, i16)))]>,
- Requires<[IsARM, HasV5TE]>;
-
- def TT : AI<0xE, (outs GPR:$dst), (ins GPR:$a, GPR:$b), MulSMUL,
- !strconcat(opc, "tt"), " $dst, $a, $b",
- [(set GPR:$dst, (opnode (sra GPR:$a, 16),
- (sra GPR:$b, 16)))]>,
- Requires<[IsARM, HasV5TE]>;
-
- def WB : AI<0xA, (outs GPR:$dst), (ins GPR:$a, GPR:$b), MulSMULW,
- !strconcat(opc, "wb"), " $dst, $a, $b",
- [(set GPR:$dst, (sra (opnode GPR:$a,
- (sext_inreg GPR:$b, i16)), 16))]>,
- Requires<[IsARM, HasV5TE]>;
-
- def WT : AI<0xE, (outs GPR:$dst), (ins GPR:$a, GPR:$b), MulSMULW,
- !strconcat(opc, "wt"), " $dst, $a, $b",
- [(set GPR:$dst, (sra (opnode GPR:$a,
- (sra GPR:$b, 16)), 16))]>,
- Requires<[IsARM, HasV5TE]>;
-}
-
-
-multiclass AI_smla<string opc, PatFrag opnode> {
- def BB : AI<0x8, (outs GPR:$dst), (ins GPR:$a, GPR:$b, GPR:$acc), MulSMLA,
- !strconcat(opc, "bb"), " $dst, $a, $b, $acc",
- [(set GPR:$dst, (add GPR:$acc,
- (opnode (sext_inreg GPR:$a, i16),
- (sext_inreg GPR:$b, i16))))]>,
- Requires<[IsARM, HasV5TE]>;
-
- def BT : AI<0xC, (outs GPR:$dst), (ins GPR:$a, GPR:$b, GPR:$acc), MulSMLA,
- !strconcat(opc, "bt"), " $dst, $a, $b, $acc",
- [(set GPR:$dst, (add GPR:$acc, (opnode (sext_inreg GPR:$a, i16),
- (sra GPR:$b, 16))))]>,
- Requires<[IsARM, HasV5TE]>;
-
- def TB : AI<0xA, (outs GPR:$dst), (ins GPR:$a, GPR:$b, GPR:$acc), MulSMLA,
- !strconcat(opc, "tb"), " $dst, $a, $b, $acc",
- [(set GPR:$dst, (add GPR:$acc, (opnode (sra GPR:$a, 16),
- (sext_inreg GPR:$b, i16))))]>,
- Requires<[IsARM, HasV5TE]>;
-
- def TT : AI<0xE, (outs GPR:$dst), (ins GPR:$a, GPR:$b, GPR:$acc), MulSMLA,
- !strconcat(opc, "tt"), " $dst, $a, $b, $acc",
- [(set GPR:$dst, (add GPR:$acc, (opnode (sra GPR:$a, 16),
- (sra GPR:$b, 16))))]>,
- Requires<[IsARM, HasV5TE]>;
-
- def WB : AI<0xA, (outs GPR:$dst), (ins GPR:$a, GPR:$b, GPR:$acc), MulSMLAW,
- !strconcat(opc, "wb"), " $dst, $a, $b, $acc",
- [(set GPR:$dst, (add GPR:$acc, (sra (opnode GPR:$a,
- (sext_inreg GPR:$b, i16)), 16)))]>,
- Requires<[IsARM, HasV5TE]>;
-
- def WT : AI<0xE, (outs GPR:$dst), (ins GPR:$a, GPR:$b, GPR:$acc), MulSMLAW,
- !strconcat(opc, "wt"), " $dst, $a, $b, $acc",
- [(set GPR:$dst, (add GPR:$acc, (sra (opnode GPR:$a,
- (sra GPR:$b, 16)), 16)))]>,
- Requires<[IsARM, HasV5TE]>;
-}
-
-defm SMUL : AI_smul<"smul", BinOpFrag<(mul node:$LHS, node:$RHS)>>;
-defm SMLA : AI_smla<"smla", BinOpFrag<(mul node:$LHS, node:$RHS)>>;
-
-// TODO: Halfword multiple accumulate long: SMLAL<x><y>
-// TODO: Dual halfword multiple: SMUAD, SMUSD, SMLAD, SMLSD, SMLALD, SMLSLD
-
-//===----------------------------------------------------------------------===//
-// Misc. Arithmetic Instructions.
-//
-
-def CLZ : AI<0x0, (outs GPR:$dst), (ins GPR:$src), ArithMisc,
- "clz", " $dst, $src",
- [(set GPR:$dst, (ctlz GPR:$src))]>, Requires<[IsARM, HasV5T]>;
-
-def REV : AI<0x0, (outs GPR:$dst), (ins GPR:$src), ArithMisc,
- "rev", " $dst, $src",
- [(set GPR:$dst, (bswap GPR:$src))]>, Requires<[IsARM, HasV6]>;
-
-def REV16 : AI<0x0, (outs GPR:$dst), (ins GPR:$src), ArithMisc,
- "rev16", " $dst, $src",
- [(set GPR:$dst,
- (or (and (srl GPR:$src, 8), 0xFF),
- (or (and (shl GPR:$src, 8), 0xFF00),
- (or (and (srl GPR:$src, 8), 0xFF0000),
- (and (shl GPR:$src, 8), 0xFF000000)))))]>,
- Requires<[IsARM, HasV6]>;
-
-def REVSH : AI<0x0, (outs GPR:$dst), (ins GPR:$src), ArithMisc,
- "revsh", " $dst, $src",
- [(set GPR:$dst,
- (sext_inreg
- (or (srl (and GPR:$src, 0xFF00), 8),
- (shl GPR:$src, 8)), i16))]>,
- Requires<[IsARM, HasV6]>;
-
-def PKHBT : AI<0x0, (outs GPR:$dst), (ins GPR:$src1, GPR:$src2, i32imm:$shamt),
- Pseudo, "pkhbt", " $dst, $src1, $src2, LSL $shamt",
- [(set GPR:$dst, (or (and GPR:$src1, 0xFFFF),
- (and (shl GPR:$src2, (i32 imm:$shamt)),
- 0xFFFF0000)))]>,
- Requires<[IsARM, HasV6]>;
-
-// Alternate cases for PKHBT where identities eliminate some nodes.
-def : ARMV6Pat<(or (and GPR:$src1, 0xFFFF), (and GPR:$src2, 0xFFFF0000)),
- (PKHBT GPR:$src1, GPR:$src2, 0)>;
-def : ARMV6Pat<(or (and GPR:$src1, 0xFFFF), (shl GPR:$src2, imm16_31:$shamt)),
- (PKHBT GPR:$src1, GPR:$src2, imm16_31:$shamt)>;
-
-
-def PKHTB : AI<0x0, (outs GPR:$dst), (ins GPR:$src1, GPR:$src2, i32imm:$shamt),
- Pseudo, "pkhtb", " $dst, $src1, $src2, ASR $shamt",
- [(set GPR:$dst, (or (and GPR:$src1, 0xFFFF0000),
- (and (sra GPR:$src2, imm16_31:$shamt),
- 0xFFFF)))]>, Requires<[IsARM, HasV6]>;
-
-// Alternate cases for PKHTB where identities eliminate some nodes. Note that
-// a shift amount of 0 is *not legal* here, it is PKHBT instead.
-def : ARMV6Pat<(or (and GPR:$src1, 0xFFFF0000), (srl GPR:$src2, 16)),
- (PKHTB GPR:$src1, GPR:$src2, 16)>;
-def : ARMV6Pat<(or (and GPR:$src1, 0xFFFF0000),
- (and (srl GPR:$src2, imm1_15:$shamt), 0xFFFF)),
- (PKHTB GPR:$src1, GPR:$src2, imm1_15:$shamt)>;
-
-
-//===----------------------------------------------------------------------===//
-// Comparison Instructions...
-//
-
-defm CMP : AI1_cmp_irs<0xA, "cmp",
- BinOpFrag<(ARMcmp node:$LHS, node:$RHS)>>;
-defm CMN : AI1_cmp_irs<0xB, "cmn",
- BinOpFrag<(ARMcmp node:$LHS,(ineg node:$RHS))>>;
-
-// Note that TST/TEQ don't set all the same flags that CMP does!
-defm TST : AI1_cmp_irs<0x8, "tst",
- BinOpFrag<(ARMcmpNZ (and node:$LHS, node:$RHS), 0)>>;
-defm TEQ : AI1_cmp_irs<0x9, "teq",
- BinOpFrag<(ARMcmpNZ (xor node:$LHS, node:$RHS), 0)>>;
-
-defm CMPnz : AI1_cmp_irs<0xA, "cmp",
- BinOpFrag<(ARMcmpNZ node:$LHS, node:$RHS)>>;
-defm CMNnz : AI1_cmp_irs<0xA, "cmn",
- BinOpFrag<(ARMcmpNZ node:$LHS,(ineg node:$RHS))>>;
-
-def : ARMPat<(ARMcmp GPR:$src, so_imm_neg:$imm),
- (CMNri GPR:$src, so_imm_neg:$imm)>;
-
-def : ARMPat<(ARMcmpNZ GPR:$src, so_imm_neg:$imm),
- (CMNri GPR:$src, so_imm_neg:$imm)>;
-
-
-// Conditional moves
-// FIXME: should be able to write a pattern for ARMcmov, but can't use
-// a two-value operand where a dag node expects two operands. :(
-def MOVCCr : AI<0xD, (outs GPR:$dst), (ins GPR:$false, GPR:$true),
- DPRdReg, "mov", " $dst, $true",
- [/*(set GPR:$dst, (ARMcmov GPR:$false, GPR:$true, imm:$cc, CCR:$ccr))*/]>,
- RegConstraint<"$false = $dst">;
-
-def MOVCCs : AI<0xD, (outs GPR:$dst), (ins GPR:$false, so_reg:$true),
- DPRdSoReg, "mov", " $dst, $true",
- [/*(set GPR:$dst, (ARMcmov GPR:$false, so_reg:$true, imm:$cc, CCR:$ccr))*/]>,
- RegConstraint<"$false = $dst">;
-
-def MOVCCi : AI<0xD, (outs GPR:$dst), (ins GPR:$false, so_imm:$true),
- DPRdIm, "mov", " $dst, $true",
- [/*(set GPR:$dst, (ARMcmov GPR:$false, so_imm:$true, imm:$cc, CCR:$ccr))*/]>,
- RegConstraint<"$false = $dst">;
-
-
-// LEApcrel - Load a pc-relative address into a register without offending the
-// assembler.
-def LEApcrel : AXI1<0x0, (outs GPR:$dst), (ins i32imm:$label, pred:$p), Pseudo,
- !strconcat(!strconcat(".set PCRELV${:uid}, ($label-(",
- "${:private}PCRELL${:uid}+8))\n"),
- !strconcat("${:private}PCRELL${:uid}:\n\t",
- "add$p $dst, pc, #PCRELV${:uid}")),
- []>;
-
-def LEApcrelJT : AXI1<0x0, (outs GPR:$dst), (ins i32imm:$label, i32imm:$id, pred:$p),
- Pseudo,
- !strconcat(!strconcat(".set PCRELV${:uid}, (${label}_${id:no_hash}-(",
- "${:private}PCRELL${:uid}+8))\n"),
- !strconcat("${:private}PCRELL${:uid}:\n\t",
- "add$p $dst, pc, #PCRELV${:uid}")),
- []>;
-
-//===----------------------------------------------------------------------===//
-// TLS Instructions
-//
-
-// __aeabi_read_tp preserves the registers r1-r3.
-let isCall = 1,
- Defs = [R0, R12, LR, CPSR] in {
- def TPsoft : AXI<0x0, (outs), (ins), BranchMisc,
- "bl __aeabi_read_tp",
- [(set R0, ARMthread_pointer)]>;
-}
-
-//===----------------------------------------------------------------------===//
-// Non-Instruction Patterns
-//
-
-// ConstantPool, GlobalAddress, and JumpTable
-def : ARMPat<(ARMWrapper tglobaladdr :$dst), (LEApcrel tglobaladdr :$dst)>;
-def : ARMPat<(ARMWrapper tconstpool :$dst), (LEApcrel tconstpool :$dst)>;
-def : ARMPat<(ARMWrapperJT tjumptable:$dst, imm:$id),
- (LEApcrelJT tjumptable:$dst, imm:$id)>;
-
-// Large immediate handling.
-
-// Two piece so_imms.
-let isReMaterializable = 1 in
-def MOVi2pieces : AI1x2<0x0, (outs GPR:$dst), (ins so_imm2part:$src), DPRdMisc,
- "mov", " $dst, $src",
- [(set GPR:$dst, so_imm2part:$src)]>;
-
-def : ARMPat<(or GPR:$LHS, so_imm2part:$RHS),
- (ORRri (ORRri GPR:$LHS, (so_imm2part_1 imm:$RHS)),
- (so_imm2part_2 imm:$RHS))>;
-def : ARMPat<(xor GPR:$LHS, so_imm2part:$RHS),
- (EORri (EORri GPR:$LHS, (so_imm2part_1 imm:$RHS)),
- (so_imm2part_2 imm:$RHS))>;
-
-// TODO: add,sub,and, 3-instr forms?
-
-
-// Direct calls
-def : ARMPat<(ARMcall texternalsym:$func), (BL texternalsym:$func)>;
-
-// zextload i1 -> zextload i8
-def : ARMPat<(zextloadi1 addrmode2:$addr), (LDRB addrmode2:$addr)>;
-
-// extload -> zextload
-def : ARMPat<(extloadi1 addrmode2:$addr), (LDRB addrmode2:$addr)>;
-def : ARMPat<(extloadi8 addrmode2:$addr), (LDRB addrmode2:$addr)>;
-def : ARMPat<(extloadi16 addrmode3:$addr), (LDRH addrmode3:$addr)>;
-
-// smul* and smla*
-def : ARMV5TEPat<(mul (sra (shl GPR:$a, 16), 16), (sra (shl GPR:$b, 16), 16)),
- (SMULBB GPR:$a, GPR:$b)>;
-def : ARMV5TEPat<(mul sext_16_node:$a, sext_16_node:$b),
- (SMULBB GPR:$a, GPR:$b)>;
-def : ARMV5TEPat<(mul (sra (shl GPR:$a, 16), 16), (sra GPR:$b, 16)),
- (SMULBT GPR:$a, GPR:$b)>;
-def : ARMV5TEPat<(mul sext_16_node:$a, (sra GPR:$b, 16)),
- (SMULBT GPR:$a, GPR:$b)>;
-def : ARMV5TEPat<(mul (sra GPR:$a, 16), (sra (shl GPR:$b, 16), 16)),
- (SMULTB GPR:$a, GPR:$b)>;
-def : ARMV5TEPat<(mul (sra GPR:$a, 16), sext_16_node:$b),
- (SMULTB GPR:$a, GPR:$b)>;
-def : ARMV5TEPat<(sra (mul GPR:$a, (sra (shl GPR:$b, 16), 16)), 16),
- (SMULWB GPR:$a, GPR:$b)>;
-def : ARMV5TEPat<(sra (mul GPR:$a, sext_16_node:$b), 16),
- (SMULWB GPR:$a, GPR:$b)>;
-
-def : ARMV5TEPat<(add GPR:$acc,
- (mul (sra (shl GPR:$a, 16), 16),
- (sra (shl GPR:$b, 16), 16))),
- (SMLABB GPR:$a, GPR:$b, GPR:$acc)>;
-def : ARMV5TEPat<(add GPR:$acc,
- (mul sext_16_node:$a, sext_16_node:$b)),
- (SMLABB GPR:$a, GPR:$b, GPR:$acc)>;
-def : ARMV5TEPat<(add GPR:$acc,
- (mul (sra (shl GPR:$a, 16), 16), (sra GPR:$b, 16))),
- (SMLABT GPR:$a, GPR:$b, GPR:$acc)>;
-def : ARMV5TEPat<(add GPR:$acc,
- (mul sext_16_node:$a, (sra GPR:$b, 16))),
- (SMLABT GPR:$a, GPR:$b, GPR:$acc)>;
-def : ARMV5TEPat<(add GPR:$acc,
- (mul (sra GPR:$a, 16), (sra (shl GPR:$b, 16), 16))),
- (SMLATB GPR:$a, GPR:$b, GPR:$acc)>;
-def : ARMV5TEPat<(add GPR:$acc,
- (mul (sra GPR:$a, 16), sext_16_node:$b)),
- (SMLATB GPR:$a, GPR:$b, GPR:$acc)>;
-def : ARMV5TEPat<(add GPR:$acc,
- (sra (mul GPR:$a, (sra (shl GPR:$b, 16), 16)), 16)),
- (SMLAWB GPR:$a, GPR:$b, GPR:$acc)>;
-def : ARMV5TEPat<(add GPR:$acc,
- (sra (mul GPR:$a, sext_16_node:$b), 16)),
- (SMLAWB GPR:$a, GPR:$b, GPR:$acc)>;
-
-//===----------------------------------------------------------------------===//
-// Thumb Support
-//
-
-include "ARMInstrThumb.td"
-
-//===----------------------------------------------------------------------===//
-// Floating Point Support
-//
-
-include "ARMInstrVFP.td"
diff --git a/release_23/lib/Target/ARM/ARMInstrThumb.td b/release_23/lib/Target/ARM/ARMInstrThumb.td
deleted file mode 100644
index 7880c235fccf..000000000000
--- a/release_23/lib/Target/ARM/ARMInstrThumb.td
+++ /dev/null
@@ -1,599 +0,0 @@
-//===- ARMInstrThumb.td - Thumb support for ARM ---------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file describes the Thumb instruction set.
-//
-//===----------------------------------------------------------------------===//
-
-//===----------------------------------------------------------------------===//
-// Thumb specific DAG Nodes.
-//
-
-def ARMtcall : SDNode<"ARMISD::tCALL", SDT_ARMcall,
- [SDNPHasChain, SDNPOptInFlag, SDNPOutFlag]>;
-
-// TI - Thumb instruction.
-
-// ThumbPat - Same as Pat<>, but requires that the compiler be in Thumb mode.
-class ThumbPat<dag pattern, dag result> : Pat<pattern, result> {
- list<Predicate> Predicates = [IsThumb];
-}
-
-class ThumbV5Pat<dag pattern, dag result> : Pat<pattern, result> {
- list<Predicate> Predicates = [IsThumb, HasV5T];
-}
-
-class ThumbI<dag outs, dag ins, AddrMode am, SizeFlagVal sz,
- string asm, string cstr, list<dag> pattern>
- // FIXME: Set all opcodes to 0 for now.
- : InstARM<0, am, sz, IndexModeNone, ThumbFrm, cstr> {
- let OutOperandList = outs;
- let InOperandList = ins;
- let AsmString = asm;
- let Pattern = pattern;
- list<Predicate> Predicates = [IsThumb];
-}
-
-class TI<dag outs, dag ins, string asm, list<dag> pattern>
- : ThumbI<outs, ins, AddrModeNone, Size2Bytes, asm, "", pattern>;
-class TI1<dag outs, dag ins, string asm, list<dag> pattern>
- : ThumbI<outs, ins, AddrModeT1, Size2Bytes, asm, "", pattern>;
-class TI2<dag outs, dag ins, string asm, list<dag> pattern>
- : ThumbI<outs, ins, AddrModeT2, Size2Bytes, asm, "", pattern>;
-class TI4<dag outs, dag ins, string asm, list<dag> pattern>
- : ThumbI<outs, ins, AddrModeT4, Size2Bytes, asm, "", pattern>;
-class TIs<dag outs, dag ins, string asm, list<dag> pattern>
- : ThumbI<outs, ins, AddrModeTs, Size2Bytes, asm, "", pattern>;
-
-// Two-address instructions
-class TIt<dag outs, dag ins, string asm, list<dag> pattern>
- : ThumbI<outs, ins, AddrModeNone, Size2Bytes, asm, "$lhs = $dst", pattern>;
-
-// BL, BLX(1) are translated by assembler into two instructions
-class TIx2<dag outs, dag ins, string asm, list<dag> pattern>
- : ThumbI<outs, ins, AddrModeNone, Size4Bytes, asm, "", pattern>;
-
-// BR_JT instructions
-class TJTI<dag outs, dag ins, string asm, list<dag> pattern>
- : ThumbI<outs, ins, AddrModeNone, SizeSpecial, asm, "", pattern>;
-
-def imm_neg_XFORM : SDNodeXForm<imm, [{
- return CurDAG->getTargetConstant(-(int)N->getValue(), MVT::i32);
-}]>;
-def imm_comp_XFORM : SDNodeXForm<imm, [{
- return CurDAG->getTargetConstant(~((uint32_t)N->getValue()), MVT::i32);
-}]>;
-
-
-/// imm0_7 predicate - True if the 32-bit immediate is in the range [0,7].
-def imm0_7 : PatLeaf<(i32 imm), [{
- return (uint32_t)N->getValue() < 8;
-}]>;
-def imm0_7_neg : PatLeaf<(i32 imm), [{
- return (uint32_t)-N->getValue() < 8;
-}], imm_neg_XFORM>;
-
-def imm0_255 : PatLeaf<(i32 imm), [{
- return (uint32_t)N->getValue() < 256;
-}]>;
-def imm0_255_comp : PatLeaf<(i32 imm), [{
- return ~((uint32_t)N->getValue()) < 256;
-}]>;
-
-def imm8_255 : PatLeaf<(i32 imm), [{
- return (uint32_t)N->getValue() >= 8 && (uint32_t)N->getValue() < 256;
-}]>;
-def imm8_255_neg : PatLeaf<(i32 imm), [{
- unsigned Val = -N->getValue();
- return Val >= 8 && Val < 256;
-}], imm_neg_XFORM>;
-
-// Break imm's up into two pieces: an immediate + a left shift.
-// This uses thumb_immshifted to match and thumb_immshifted_val and
-// thumb_immshifted_shamt to get the val/shift pieces.
-def thumb_immshifted : PatLeaf<(imm), [{
- return ARM_AM::isThumbImmShiftedVal((unsigned)N->getValue());
-}]>;
-
-def thumb_immshifted_val : SDNodeXForm<imm, [{
- unsigned V = ARM_AM::getThumbImmNonShiftedVal((unsigned)N->getValue());
- return CurDAG->getTargetConstant(V, MVT::i32);
-}]>;
-
-def thumb_immshifted_shamt : SDNodeXForm<imm, [{
- unsigned V = ARM_AM::getThumbImmValShift((unsigned)N->getValue());
- return CurDAG->getTargetConstant(V, MVT::i32);
-}]>;
-
-// Define Thumb specific addressing modes.
-
-// t_addrmode_rr := reg + reg
-//
-def t_addrmode_rr : Operand<i32>,
- ComplexPattern<i32, 2, "SelectThumbAddrModeRR", []> {
- let PrintMethod = "printThumbAddrModeRROperand";
- let MIOperandInfo = (ops GPR:$base, GPR:$offsreg);
-}
-
-// t_addrmode_s4 := reg + reg
-// reg + imm5 * 4
-//
-def t_addrmode_s4 : Operand<i32>,
- ComplexPattern<i32, 3, "SelectThumbAddrModeS4", []> {
- let PrintMethod = "printThumbAddrModeS4Operand";
- let MIOperandInfo = (ops GPR:$base, i32imm:$offsimm, GPR:$offsreg);
-}
-
-// t_addrmode_s2 := reg + reg
-// reg + imm5 * 2
-//
-def t_addrmode_s2 : Operand<i32>,
- ComplexPattern<i32, 3, "SelectThumbAddrModeS2", []> {
- let PrintMethod = "printThumbAddrModeS2Operand";
- let MIOperandInfo = (ops GPR:$base, i32imm:$offsimm, GPR:$offsreg);
-}
-
-// t_addrmode_s1 := reg + reg
-// reg + imm5
-//
-def t_addrmode_s1 : Operand<i32>,
- ComplexPattern<i32, 3, "SelectThumbAddrModeS1", []> {
- let PrintMethod = "printThumbAddrModeS1Operand";
- let MIOperandInfo = (ops GPR:$base, i32imm:$offsimm, GPR:$offsreg);
-}
-
-// t_addrmode_sp := sp + imm8 * 4
-//
-def t_addrmode_sp : Operand<i32>,
- ComplexPattern<i32, 2, "SelectThumbAddrModeSP", []> {
- let PrintMethod = "printThumbAddrModeSPOperand";
- let MIOperandInfo = (ops GPR:$base, i32imm:$offsimm);
-}
-
-//===----------------------------------------------------------------------===//
-// Miscellaneous Instructions.
-//
-
-let Defs = [SP], Uses = [SP] in {
-def tADJCALLSTACKUP :
-PseudoInst<(outs), (ins i32imm:$amt1, i32imm:$amt2),
- "@ tADJCALLSTACKUP $amt1",
- [(ARMcallseq_end imm:$amt1, imm:$amt2)]>, Requires<[IsThumb]>;
-
-def tADJCALLSTACKDOWN :
-PseudoInst<(outs), (ins i32imm:$amt),
- "@ tADJCALLSTACKDOWN $amt",
- [(ARMcallseq_start imm:$amt)]>, Requires<[IsThumb]>;
-}
-
-let isNotDuplicable = 1 in
-def tPICADD : TIt<(outs GPR:$dst), (ins GPR:$lhs, pclabel:$cp),
- "$cp:\n\tadd $dst, pc",
- [(set GPR:$dst, (ARMpic_add GPR:$lhs, imm:$cp))]>;
-
-//===----------------------------------------------------------------------===//
-// Control Flow Instructions.
-//
-
-let isReturn = 1, isTerminator = 1 in {
- def tBX_RET : TI<(outs), (ins), "bx lr", [(ARMretflag)]>;
- // Alternative return instruction used by vararg functions.
- def tBX_RET_vararg : TI<(outs), (ins GPR:$target), "bx $target", []>;
-}
-
-// FIXME: remove when we have a way to marking a MI with these properties.
-let isReturn = 1, isTerminator = 1 in
-def tPOP_RET : TI<(outs reglist:$dst1, variable_ops), (ins),
- "pop $dst1", []>;
-
-let isCall = 1,
- Defs = [R0, R1, R2, R3, LR,
- D0, D1, D2, D3, D4, D5, D6, D7] in {
- def tBL : TIx2<(outs), (ins i32imm:$func, variable_ops),
- "bl ${func:call}",
- [(ARMtcall tglobaladdr:$func)]>;
- // ARMv5T and above
- def tBLXi : TIx2<(outs), (ins i32imm:$func, variable_ops),
- "blx ${func:call}",
- [(ARMcall tglobaladdr:$func)]>, Requires<[HasV5T]>;
- def tBLXr : TI<(outs), (ins GPR:$func, variable_ops),
- "blx $func",
- [(ARMtcall GPR:$func)]>, Requires<[HasV5T]>;
- // ARMv4T
- def tBX : TIx2<(outs), (ins GPR:$func, variable_ops),
- "cpy lr, pc\n\tbx $func",
- [(ARMcall_nolink GPR:$func)]>;
-}
-
-let isBranch = 1, isTerminator = 1 in {
- let isBarrier = 1 in {
- let isPredicable = 1 in
- def tB : TI<(outs), (ins brtarget:$target), "b $target",
- [(br bb:$target)]>;
-
- // Far jump
- def tBfar : TIx2<(outs), (ins brtarget:$target), "bl $target\t@ far jump",[]>;
-
- def tBR_JTr : TJTI<(outs),
- (ins GPR:$target, jtblock_operand:$jt, i32imm:$id),
- "cpy pc, $target \n\t.align\t2\n$jt",
- [(ARMbrjt GPR:$target, tjumptable:$jt, imm:$id)]>;
- }
-}
-
-// FIXME: should be able to write a pattern for ARMBrcond, but can't use
-// a two-value operand where a dag node expects two operands. :(
-let isBranch = 1, isTerminator = 1 in
- def tBcc : TI<(outs), (ins brtarget:$target, pred:$cc), "b$cc $target",
- [/*(ARMbrcond bb:$target, imm:$cc)*/]>;
-
-//===----------------------------------------------------------------------===//
-// Load Store Instructions.
-//
-
-let isSimpleLoad = 1 in
-def tLDR : TI4<(outs GPR:$dst), (ins t_addrmode_s4:$addr),
- "ldr $dst, $addr",
- [(set GPR:$dst, (load t_addrmode_s4:$addr))]>;
-
-def tLDRB : TI1<(outs GPR:$dst), (ins t_addrmode_s1:$addr),
- "ldrb $dst, $addr",
- [(set GPR:$dst, (zextloadi8 t_addrmode_s1:$addr))]>;
-
-def tLDRH : TI2<(outs GPR:$dst), (ins t_addrmode_s2:$addr),
- "ldrh $dst, $addr",
- [(set GPR:$dst, (zextloadi16 t_addrmode_s2:$addr))]>;
-
-def tLDRSB : TI1<(outs GPR:$dst), (ins t_addrmode_rr:$addr),
- "ldrsb $dst, $addr",
- [(set GPR:$dst, (sextloadi8 t_addrmode_rr:$addr))]>;
-
-def tLDRSH : TI2<(outs GPR:$dst), (ins t_addrmode_rr:$addr),
- "ldrsh $dst, $addr",
- [(set GPR:$dst, (sextloadi16 t_addrmode_rr:$addr))]>;
-
-let isSimpleLoad = 1 in
-def tLDRspi : TIs<(outs GPR:$dst), (ins t_addrmode_sp:$addr),
- "ldr $dst, $addr",
- [(set GPR:$dst, (load t_addrmode_sp:$addr))]>;
-
-// Special instruction for restore. It cannot clobber condition register
-// when it's expanded by eliminateCallFramePseudoInstr().
-let isSimpleLoad = 1, mayLoad = 1 in
-def tRestore : TIs<(outs GPR:$dst), (ins t_addrmode_sp:$addr),
- "ldr $dst, $addr", []>;
-
-// Load tconstpool
-let isSimpleLoad = 1 in
-def tLDRpci : TIs<(outs GPR:$dst), (ins i32imm:$addr),
- "ldr $dst, $addr",
- [(set GPR:$dst, (load (ARMWrapper tconstpool:$addr)))]>;
-
-// Special LDR for loads from non-pc-relative constpools.
-let isSimpleLoad = 1, mayLoad = 1, isReMaterializable = 1 in
-def tLDRcp : TIs<(outs GPR:$dst), (ins i32imm:$addr),
- "ldr $dst, $addr", []>;
-
-def tSTR : TI4<(outs), (ins GPR:$src, t_addrmode_s4:$addr),
- "str $src, $addr",
- [(store GPR:$src, t_addrmode_s4:$addr)]>;
-
-def tSTRB : TI1<(outs), (ins GPR:$src, t_addrmode_s1:$addr),
- "strb $src, $addr",
- [(truncstorei8 GPR:$src, t_addrmode_s1:$addr)]>;
-
-def tSTRH : TI2<(outs), (ins GPR:$src, t_addrmode_s2:$addr),
- "strh $src, $addr",
- [(truncstorei16 GPR:$src, t_addrmode_s2:$addr)]>;
-
-def tSTRspi : TIs<(outs), (ins GPR:$src, t_addrmode_sp:$addr),
- "str $src, $addr",
- [(store GPR:$src, t_addrmode_sp:$addr)]>;
-
-let mayStore = 1 in {
-// Special instruction for spill. It cannot clobber condition register
-// when it's expanded by eliminateCallFramePseudoInstr().
-def tSpill : TIs<(outs), (ins GPR:$src, t_addrmode_sp:$addr),
- "str $src, $addr", []>;
-}
-
-//===----------------------------------------------------------------------===//
-// Load / store multiple Instructions.
-//
-
-// TODO: A7-44: LDMIA - load multiple
-
-let mayLoad = 1 in
-def tPOP : TI<(outs reglist:$dst1, variable_ops), (ins),
- "pop $dst1", []>;
-
-let mayStore = 1 in
-def tPUSH : TI<(outs), (ins reglist:$src1, variable_ops),
- "push $src1", []>;
-
-//===----------------------------------------------------------------------===//
-// Arithmetic Instructions.
-//
-
-// Add with carry
-def tADC : TIt<(outs GPR:$dst), (ins GPR:$lhs, GPR:$rhs),
- "adc $dst, $rhs",
- [(set GPR:$dst, (adde GPR:$lhs, GPR:$rhs))]>;
-
-def tADDS : TI<(outs GPR:$dst), (ins GPR:$lhs, GPR:$rhs),
- "add $dst, $lhs, $rhs",
- [(set GPR:$dst, (addc GPR:$lhs, GPR:$rhs))]>;
-
-
-def tADDi3 : TI<(outs GPR:$dst), (ins GPR:$lhs, i32imm:$rhs),
- "add $dst, $lhs, $rhs",
- [(set GPR:$dst, (add GPR:$lhs, imm0_7:$rhs))]>;
-
-def tADDi8 : TIt<(outs GPR:$dst), (ins GPR:$lhs, i32imm:$rhs),
- "add $dst, $rhs",
- [(set GPR:$dst, (add GPR:$lhs, imm8_255:$rhs))]>;
-
-def tADDrr : TI<(outs GPR:$dst), (ins GPR:$lhs, GPR:$rhs),
- "add $dst, $lhs, $rhs",
- [(set GPR:$dst, (add GPR:$lhs, GPR:$rhs))]>;
-
-def tADDhirr : TIt<(outs GPR:$dst), (ins GPR:$lhs, GPR:$rhs),
- "add $dst, $rhs", []>;
-
-def tADDrPCi : TI<(outs GPR:$dst), (ins i32imm:$rhs),
- "add $dst, pc, $rhs * 4", []>;
-def tADDrSPi : TI<(outs GPR:$dst), (ins GPR:$sp, i32imm:$rhs),
- "add $dst, $sp, $rhs * 4", []>;
-def tADDspi : TIt<(outs GPR:$dst), (ins GPR:$lhs, i32imm:$rhs),
- "add $dst, $rhs * 4", []>;
-
-def tAND : TIt<(outs GPR:$dst), (ins GPR:$lhs, GPR:$rhs),
- "and $dst, $rhs",
- [(set GPR:$dst, (and GPR:$lhs, GPR:$rhs))]>;
-
-def tASRri : TI<(outs GPR:$dst), (ins GPR:$lhs, i32imm:$rhs),
- "asr $dst, $lhs, $rhs",
- [(set GPR:$dst, (sra GPR:$lhs, imm:$rhs))]>;
-
-def tASRrr : TIt<(outs GPR:$dst), (ins GPR:$lhs, GPR:$rhs),
- "asr $dst, $rhs",
- [(set GPR:$dst, (sra GPR:$lhs, GPR:$rhs))]>;
-
-def tBIC : TIt<(outs GPR:$dst), (ins GPR:$lhs, GPR:$rhs),
- "bic $dst, $rhs",
- [(set GPR:$dst, (and GPR:$lhs, (not GPR:$rhs)))]>;
-
-
-def tCMN : TI<(outs), (ins GPR:$lhs, GPR:$rhs),
- "cmn $lhs, $rhs",
- [(ARMcmp GPR:$lhs, (ineg GPR:$rhs))]>;
-
-def tCMPi8 : TI<(outs), (ins GPR:$lhs, i32imm:$rhs),
- "cmp $lhs, $rhs",
- [(ARMcmp GPR:$lhs, imm0_255:$rhs)]>;
-
-def tCMPr : TI<(outs), (ins GPR:$lhs, GPR:$rhs),
- "cmp $lhs, $rhs",
- [(ARMcmp GPR:$lhs, GPR:$rhs)]>;
-
-def tTST : TI<(outs), (ins GPR:$lhs, GPR:$rhs),
- "tst $lhs, $rhs",
- [(ARMcmpNZ (and GPR:$lhs, GPR:$rhs), 0)]>;
-
-def tCMNNZ : TI<(outs), (ins GPR:$lhs, GPR:$rhs),
- "cmn $lhs, $rhs",
- [(ARMcmpNZ GPR:$lhs, (ineg GPR:$rhs))]>;
-
-def tCMPNZi8 : TI<(outs), (ins GPR:$lhs, i32imm:$rhs),
- "cmp $lhs, $rhs",
- [(ARMcmpNZ GPR:$lhs, imm0_255:$rhs)]>;
-
-def tCMPNZr : TI<(outs), (ins GPR:$lhs, GPR:$rhs),
- "cmp $lhs, $rhs",
- [(ARMcmpNZ GPR:$lhs, GPR:$rhs)]>;
-
-// TODO: A7-37: CMP(3) - cmp hi regs
-
-def tEOR : TIt<(outs GPR:$dst), (ins GPR:$lhs, GPR:$rhs),
- "eor $dst, $rhs",
- [(set GPR:$dst, (xor GPR:$lhs, GPR:$rhs))]>;
-
-def tLSLri : TI<(outs GPR:$dst), (ins GPR:$lhs, i32imm:$rhs),
- "lsl $dst, $lhs, $rhs",
- [(set GPR:$dst, (shl GPR:$lhs, imm:$rhs))]>;
-
-def tLSLrr : TIt<(outs GPR:$dst), (ins GPR:$lhs, GPR:$rhs),
- "lsl $dst, $rhs",
- [(set GPR:$dst, (shl GPR:$lhs, GPR:$rhs))]>;
-
-def tLSRri : TI<(outs GPR:$dst), (ins GPR:$lhs, i32imm:$rhs),
- "lsr $dst, $lhs, $rhs",
- [(set GPR:$dst, (srl GPR:$lhs, imm:$rhs))]>;
-
-def tLSRrr : TIt<(outs GPR:$dst), (ins GPR:$lhs, GPR:$rhs),
- "lsr $dst, $rhs",
- [(set GPR:$dst, (srl GPR:$lhs, GPR:$rhs))]>;
-
-// FIXME: This is not rematerializable because mov changes the condition code.
-def tMOVi8 : TI<(outs GPR:$dst), (ins i32imm:$src),
- "mov $dst, $src",
- [(set GPR:$dst, imm0_255:$src)]>;
-
-// TODO: A7-73: MOV(2) - mov setting flag.
-
-
-// Note: MOV(2) of two low regs updates the flags, so we emit this as 'cpy',
-// which is MOV(3). This also supports high registers.
-def tMOVr : TI<(outs GPR:$dst), (ins GPR:$src),
- "cpy $dst, $src", []>;
-
-def tMUL : TIt<(outs GPR:$dst), (ins GPR:$lhs, GPR:$rhs),
- "mul $dst, $rhs",
- [(set GPR:$dst, (mul GPR:$lhs, GPR:$rhs))]>;
-
-def tMVN : TI<(outs GPR:$dst), (ins GPR:$src),
- "mvn $dst, $src",
- [(set GPR:$dst, (not GPR:$src))]>;
-
-def tNEG : TI<(outs GPR:$dst), (ins GPR:$src),
- "neg $dst, $src",
- [(set GPR:$dst, (ineg GPR:$src))]>;
-
-def tORR : TIt<(outs GPR:$dst), (ins GPR:$lhs, GPR:$rhs),
- "orr $dst, $rhs",
- [(set GPR:$dst, (or GPR:$lhs, GPR:$rhs))]>;
-
-
-def tREV : TI<(outs GPR:$dst), (ins GPR:$src),
- "rev $dst, $src",
- [(set GPR:$dst, (bswap GPR:$src))]>,
- Requires<[IsThumb, HasV6]>;
-
-def tREV16 : TI<(outs GPR:$dst), (ins GPR:$src),
- "rev16 $dst, $src",
- [(set GPR:$dst,
- (or (and (srl GPR:$src, 8), 0xFF),
- (or (and (shl GPR:$src, 8), 0xFF00),
- (or (and (srl GPR:$src, 8), 0xFF0000),
- (and (shl GPR:$src, 8), 0xFF000000)))))]>,
- Requires<[IsThumb, HasV6]>;
-
-def tREVSH : TI<(outs GPR:$dst), (ins GPR:$src),
- "revsh $dst, $src",
- [(set GPR:$dst,
- (sext_inreg
- (or (srl (and GPR:$src, 0xFFFF), 8),
- (shl GPR:$src, 8)), i16))]>,
- Requires<[IsThumb, HasV6]>;
-
-def tROR : TIt<(outs GPR:$dst), (ins GPR:$lhs, GPR:$rhs),
- "ror $dst, $rhs",
- [(set GPR:$dst, (rotr GPR:$lhs, GPR:$rhs))]>;
-
-
-// Subtract with carry
-def tSBC : TIt<(outs GPR:$dst), (ins GPR:$lhs, GPR:$rhs),
- "sbc $dst, $rhs",
- [(set GPR:$dst, (sube GPR:$lhs, GPR:$rhs))]>;
-
-def tSUBS : TI<(outs GPR:$dst), (ins GPR:$lhs, GPR:$rhs),
- "sub $dst, $lhs, $rhs",
- [(set GPR:$dst, (subc GPR:$lhs, GPR:$rhs))]>;
-
-
-// TODO: A7-96: STMIA - store multiple.
-
-def tSUBi3 : TI<(outs GPR:$dst), (ins GPR:$lhs, i32imm:$rhs),
- "sub $dst, $lhs, $rhs",
- [(set GPR:$dst, (add GPR:$lhs, imm0_7_neg:$rhs))]>;
-
-def tSUBi8 : TIt<(outs GPR:$dst), (ins GPR:$lhs, i32imm:$rhs),
- "sub $dst, $rhs",
- [(set GPR:$dst, (add GPR:$lhs, imm8_255_neg:$rhs))]>;
-
-def tSUBrr : TI<(outs GPR:$dst), (ins GPR:$lhs, GPR:$rhs),
- "sub $dst, $lhs, $rhs",
- [(set GPR:$dst, (sub GPR:$lhs, GPR:$rhs))]>;
-
-def tSUBspi : TIt<(outs GPR:$dst), (ins GPR:$lhs, i32imm:$rhs),
- "sub $dst, $rhs * 4", []>;
-
-def tSXTB : TI<(outs GPR:$dst), (ins GPR:$src),
- "sxtb $dst, $src",
- [(set GPR:$dst, (sext_inreg GPR:$src, i8))]>,
- Requires<[IsThumb, HasV6]>;
-def tSXTH : TI<(outs GPR:$dst), (ins GPR:$src),
- "sxth $dst, $src",
- [(set GPR:$dst, (sext_inreg GPR:$src, i16))]>,
- Requires<[IsThumb, HasV6]>;
-
-
-def tUXTB : TI<(outs GPR:$dst), (ins GPR:$src),
- "uxtb $dst, $src",
- [(set GPR:$dst, (and GPR:$src, 0xFF))]>,
- Requires<[IsThumb, HasV6]>;
-def tUXTH : TI<(outs GPR:$dst), (ins GPR:$src),
- "uxth $dst, $src",
- [(set GPR:$dst, (and GPR:$src, 0xFFFF))]>,
- Requires<[IsThumb, HasV6]>;
-
-
-// Conditional move tMOVCCr - Used to implement the Thumb SELECT_CC DAG operation.
-// Expanded by the scheduler into a branch sequence.
-let usesCustomDAGSchedInserter = 1 in // Expanded by the scheduler.
- def tMOVCCr :
- PseudoInst<(outs GPR:$dst), (ins GPR:$false, GPR:$true, pred:$cc),
- "@ tMOVCCr $cc",
- [/*(set GPR:$dst, (ARMcmov GPR:$false, GPR:$true, imm:$cc))*/]>;
-
-// tLEApcrel - Load a pc-relative address into a register without offending the
-// assembler.
-def tLEApcrel : TIx2<(outs GPR:$dst), (ins i32imm:$label),
- !strconcat(!strconcat(".set PCRELV${:uid}, ($label-(",
- "${:private}PCRELL${:uid}+4))\n"),
- !strconcat("\tmov $dst, #PCRELV${:uid}\n",
- "${:private}PCRELL${:uid}:\n\tadd $dst, pc")),
- []>;
-
-def tLEApcrelJT : TIx2<(outs GPR:$dst), (ins i32imm:$label, i32imm:$id),
- !strconcat(!strconcat(".set PCRELV${:uid}, (${label}_${id:no_hash}-(",
- "${:private}PCRELL${:uid}+4))\n"),
- !strconcat("\tmov $dst, #PCRELV${:uid}\n",
- "${:private}PCRELL${:uid}:\n\tadd $dst, pc")),
- []>;
-
-//===----------------------------------------------------------------------===//
-// TLS Instructions
-//
-
-// __aeabi_read_tp preserves the registers r1-r3.
-let isCall = 1,
- Defs = [R0, LR] in {
- def tTPsoft : TIx2<(outs), (ins),
- "bl __aeabi_read_tp",
- [(set R0, ARMthread_pointer)]>;
-}
-
-//===----------------------------------------------------------------------===//
-// Non-Instruction Patterns
-//
-
-// ConstantPool, GlobalAddress
-def : ThumbPat<(ARMWrapper tglobaladdr :$dst), (tLEApcrel tglobaladdr :$dst)>;
-def : ThumbPat<(ARMWrapper tconstpool :$dst), (tLEApcrel tconstpool :$dst)>;
-
-// JumpTable
-def : ThumbPat<(ARMWrapperJT tjumptable:$dst, imm:$id),
- (tLEApcrelJT tjumptable:$dst, imm:$id)>;
-
-// Direct calls
-def : ThumbPat<(ARMtcall texternalsym:$func), (tBL texternalsym:$func)>;
-def : ThumbV5Pat<(ARMcall texternalsym:$func), (tBLXi texternalsym:$func)>;
-
-// Indirect calls to ARM routines
-def : ThumbV5Pat<(ARMcall GPR:$dst), (tBLXr GPR:$dst)>;
-
-// zextload i1 -> zextload i8
-def : ThumbPat<(zextloadi1 t_addrmode_s1:$addr),
- (tLDRB t_addrmode_s1:$addr)>;
-
-// extload -> zextload
-def : ThumbPat<(extloadi1 t_addrmode_s1:$addr), (tLDRB t_addrmode_s1:$addr)>;
-def : ThumbPat<(extloadi8 t_addrmode_s1:$addr), (tLDRB t_addrmode_s1:$addr)>;
-def : ThumbPat<(extloadi16 t_addrmode_s2:$addr), (tLDRH t_addrmode_s2:$addr)>;
-
-// Large immediate handling.
-
-// Two piece imms.
-def : ThumbPat<(i32 thumb_immshifted:$src),
- (tLSLri (tMOVi8 (thumb_immshifted_val imm:$src)),
- (thumb_immshifted_shamt imm:$src))>;
-
-def : ThumbPat<(i32 imm0_255_comp:$src),
- (tMVN (tMOVi8 (imm_comp_XFORM imm:$src)))>;
diff --git a/release_23/lib/Target/ARM/ARMInstrVFP.td b/release_23/lib/Target/ARM/ARMInstrVFP.td
deleted file mode 100644
index 9d775ac16669..000000000000
--- a/release_23/lib/Target/ARM/ARMInstrVFP.td
+++ /dev/null
@@ -1,388 +0,0 @@
-//===- ARMInstrVFP.td - VFP support for ARM -------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file describes the ARM VP instruction set.
-//
-//===----------------------------------------------------------------------===//
-
-//===----------------------------------------------------------------------===//
-// ARM VFP Instruction templates.
-//
-
-// ARM Float Instruction
-class ASI<dag outs, dag ins, string opc, string asm, list<dag> pattern>
- : AI<0x0, outs, ins, VFPFrm, opc, asm, pattern> {
- // TODO: Mark the instructions with the appropriate subtarget info.
-}
-
-class ASI5<dag outs, dag ins, string opc, string asm, list<dag> pattern>
- : I<0x0, outs, ins, AddrMode5, Size4Bytes, IndexModeNone,
- VFPFrm, opc, asm, "", pattern> {
- // TODO: Mark the instructions with the appropriate subtarget info.
-}
-
-// ARM Double Instruction
-class ADI<dag outs, dag ins, string opc, string asm, list<dag> pattern>
- : AI<0x0, outs, ins, VFPFrm, opc, asm, pattern> {
- // TODO: Mark the instructions with the appropriate subtarget info.
-}
-
-class ADI5<dag outs, dag ins, string opc, string asm, list<dag> pattern>
- : I<0x0, outs, ins, AddrMode5, Size4Bytes, IndexModeNone,
- VFPFrm, opc, asm, "", pattern> {
- // TODO: Mark the instructions with the appropriate subtarget info.
-}
-
-// Special cases.
-class AXSI<dag outs, dag ins, string asm, list<dag> pattern>
- : XI<0x0, outs, ins, AddrModeNone, Size4Bytes, IndexModeNone,
- VFPFrm, asm, "", pattern> {
- // TODO: Mark the instructions with the appropriate subtarget info.
-}
-
-class AXSI5<dag outs, dag ins, string asm, list<dag> pattern>
- : XI<0x0, outs, ins, AddrMode5, Size4Bytes, IndexModeNone,
- VFPFrm, asm, "", pattern> {
- // TODO: Mark the instructions with the appropriate subtarget info.
-}
-
-class AXDI<dag outs, dag ins, string asm, list<dag> pattern>
- : XI<0x0, outs, ins, AddrModeNone, Size4Bytes, IndexModeNone,
- VFPFrm, asm, "", pattern> {
- // TODO: Mark the instructions with the appropriate subtarget info.
-}
-
-class AXDI5<dag outs, dag ins, string asm, list<dag> pattern>
- : XI<0x0, outs, ins, AddrMode5, Size4Bytes, IndexModeNone,
- VFPFrm, asm, "", pattern> {
- // TODO: Mark the instructions with the appropriate subtarget info.
-}
-
-
-def SDT_FTOI :
-SDTypeProfile<1, 1, [SDTCisVT<0, f32>, SDTCisFP<1>]>;
-def SDT_ITOF :
-SDTypeProfile<1, 1, [SDTCisFP<0>, SDTCisVT<1, f32>]>;
-def SDT_CMPFP0 :
-SDTypeProfile<0, 1, [SDTCisFP<0>]>;
-def SDT_FMDRR :
-SDTypeProfile<1, 2, [SDTCisVT<0, f64>, SDTCisVT<1, i32>,
- SDTCisSameAs<1, 2>]>;
-
-def arm_ftoui : SDNode<"ARMISD::FTOUI", SDT_FTOI>;
-def arm_ftosi : SDNode<"ARMISD::FTOSI", SDT_FTOI>;
-def arm_sitof : SDNode<"ARMISD::SITOF", SDT_ITOF>;
-def arm_uitof : SDNode<"ARMISD::UITOF", SDT_ITOF>;
-def arm_fmstat : SDNode<"ARMISD::FMSTAT", SDTNone, [SDNPInFlag,SDNPOutFlag]>;
-def arm_cmpfp : SDNode<"ARMISD::CMPFP", SDT_ARMCmp, [SDNPOutFlag]>;
-def arm_cmpfp0 : SDNode<"ARMISD::CMPFPw0", SDT_CMPFP0, [SDNPOutFlag]>;
-def arm_fmdrr : SDNode<"ARMISD::FMDRR", SDT_FMDRR>;
-
-//===----------------------------------------------------------------------===//
-// Load / store Instructions.
-//
-
-let isSimpleLoad = 1 in {
-def FLDD : ADI5<(outs DPR:$dst), (ins addrmode5:$addr),
- "fldd", " $dst, $addr",
- [(set DPR:$dst, (load addrmode5:$addr))]>;
-
-def FLDS : ASI5<(outs SPR:$dst), (ins addrmode5:$addr),
- "flds", " $dst, $addr",
- [(set SPR:$dst, (load addrmode5:$addr))]>;
-} // isSimpleLoad
-
-def FSTD : ADI5<(outs), (ins DPR:$src, addrmode5:$addr),
- "fstd", " $src, $addr",
- [(store DPR:$src, addrmode5:$addr)]>;
-
-def FSTS : ASI5<(outs), (ins SPR:$src, addrmode5:$addr),
- "fsts", " $src, $addr",
- [(store SPR:$src, addrmode5:$addr)]>;
-
-//===----------------------------------------------------------------------===//
-// Load / store multiple Instructions.
-//
-
-let mayLoad = 1 in {
-def FLDMD : AXDI5<(outs), (ins addrmode5:$addr, pred:$p, reglist:$dst1,
- variable_ops),
- "fldm${addr:submode}d${p} ${addr:base}, $dst1",
- []>;
-
-def FLDMS : AXSI5<(outs), (ins addrmode5:$addr, pred:$p, reglist:$dst1,
- variable_ops),
- "fldm${addr:submode}s${p} ${addr:base}, $dst1",
- []>;
-}
-
-let mayStore = 1 in {
-def FSTMD : AXDI5<(outs), (ins addrmode5:$addr, pred:$p, reglist:$src1,
- variable_ops),
- "fstm${addr:submode}d${p} ${addr:base}, $src1",
- []>;
-
-def FSTMS : AXSI5<(outs), (ins addrmode5:$addr, pred:$p, reglist:$src1,
- variable_ops),
- "fstm${addr:submode}s${p} ${addr:base}, $src1",
- []>;
-} // mayStore
-
-// FLDMX, FSTMX - mixing S/D registers for pre-armv6 cores
-
-//===----------------------------------------------------------------------===//
-// FP Binary Operations.
-//
-
-def FADDD : ADI<(outs DPR:$dst), (ins DPR:$a, DPR:$b),
- "faddd", " $dst, $a, $b",
- [(set DPR:$dst, (fadd DPR:$a, DPR:$b))]>;
-
-def FADDS : ASI<(outs SPR:$dst), (ins SPR:$a, SPR:$b),
- "fadds", " $dst, $a, $b",
- [(set SPR:$dst, (fadd SPR:$a, SPR:$b))]>;
-
-def FCMPED : ADI<(outs), (ins DPR:$a, DPR:$b),
- "fcmped", " $a, $b",
- [(arm_cmpfp DPR:$a, DPR:$b)]>;
-
-def FCMPES : ASI<(outs), (ins SPR:$a, SPR:$b),
- "fcmpes", " $a, $b",
- [(arm_cmpfp SPR:$a, SPR:$b)]>;
-
-def FDIVD : ADI<(outs DPR:$dst), (ins DPR:$a, DPR:$b),
- "fdivd", " $dst, $a, $b",
- [(set DPR:$dst, (fdiv DPR:$a, DPR:$b))]>;
-
-def FDIVS : ASI<(outs SPR:$dst), (ins SPR:$a, SPR:$b),
- "fdivs", " $dst, $a, $b",
- [(set SPR:$dst, (fdiv SPR:$a, SPR:$b))]>;
-
-def FMULD : ADI<(outs DPR:$dst), (ins DPR:$a, DPR:$b),
- "fmuld", " $dst, $a, $b",
- [(set DPR:$dst, (fmul DPR:$a, DPR:$b))]>;
-
-def FMULS : ASI<(outs SPR:$dst), (ins SPR:$a, SPR:$b),
- "fmuls", " $dst, $a, $b",
- [(set SPR:$dst, (fmul SPR:$a, SPR:$b))]>;
-
-def FNMULD : ADI<(outs DPR:$dst), (ins DPR:$a, DPR:$b),
- "fnmuld", " $dst, $a, $b",
- [(set DPR:$dst, (fneg (fmul DPR:$a, DPR:$b)))]>;
-
-def FNMULS : ASI<(outs SPR:$dst), (ins SPR:$a, SPR:$b),
- "fnmuls", " $dst, $a, $b",
- [(set SPR:$dst, (fneg (fmul SPR:$a, SPR:$b)))]>;
-
-// Match reassociated forms only if not sign dependent rounding.
-def : Pat<(fmul (fneg DPR:$a), DPR:$b),
- (FNMULD DPR:$a, DPR:$b)>, Requires<[NoHonorSignDependentRounding]>;
-def : Pat<(fmul (fneg SPR:$a), SPR:$b),
- (FNMULS SPR:$a, SPR:$b)>, Requires<[NoHonorSignDependentRounding]>;
-
-
-def FSUBD : ADI<(outs DPR:$dst), (ins DPR:$a, DPR:$b),
- "fsubd", " $dst, $a, $b",
- [(set DPR:$dst, (fsub DPR:$a, DPR:$b))]>;
-
-def FSUBS : ASI<(outs SPR:$dst), (ins SPR:$a, SPR:$b),
- "fsubs", " $dst, $a, $b",
- [(set SPR:$dst, (fsub SPR:$a, SPR:$b))]>;
-
-//===----------------------------------------------------------------------===//
-// FP Unary Operations.
-//
-
-def FABSD : ADI<(outs DPR:$dst), (ins DPR:$a),
- "fabsd", " $dst, $a",
- [(set DPR:$dst, (fabs DPR:$a))]>;
-
-def FABSS : ASI<(outs SPR:$dst), (ins SPR:$a),
- "fabss", " $dst, $a",
- [(set SPR:$dst, (fabs SPR:$a))]>;
-
-def FCMPEZD : ADI<(outs), (ins DPR:$a),
- "fcmpezd", " $a",
- [(arm_cmpfp0 DPR:$a)]>;
-
-def FCMPEZS : ASI<(outs), (ins SPR:$a),
- "fcmpezs", " $a",
- [(arm_cmpfp0 SPR:$a)]>;
-
-def FCVTDS : ADI<(outs DPR:$dst), (ins SPR:$a),
- "fcvtds", " $dst, $a",
- [(set DPR:$dst, (fextend SPR:$a))]>;
-
-def FCVTSD : ADI<(outs SPR:$dst), (ins DPR:$a),
- "fcvtsd", " $dst, $a",
- [(set SPR:$dst, (fround DPR:$a))]>;
-
-def FCPYD : ADI<(outs DPR:$dst), (ins DPR:$a),
- "fcpyd", " $dst, $a", []>;
-
-def FCPYS : ASI<(outs SPR:$dst), (ins SPR:$a),
- "fcpys", " $dst, $a", []>;
-
-def FNEGD : ADI<(outs DPR:$dst), (ins DPR:$a),
- "fnegd", " $dst, $a",
- [(set DPR:$dst, (fneg DPR:$a))]>;
-
-def FNEGS : ASI<(outs SPR:$dst), (ins SPR:$a),
- "fnegs", " $dst, $a",
- [(set SPR:$dst, (fneg SPR:$a))]>;
-
-def FSQRTD : ADI<(outs DPR:$dst), (ins DPR:$a),
- "fsqrtd", " $dst, $a",
- [(set DPR:$dst, (fsqrt DPR:$a))]>;
-
-def FSQRTS : ASI<(outs SPR:$dst), (ins SPR:$a),
- "fsqrts", " $dst, $a",
- [(set SPR:$dst, (fsqrt SPR:$a))]>;
-
-//===----------------------------------------------------------------------===//
-// FP <-> GPR Copies. Int <-> FP Conversions.
-//
-
-def FMRS : ASI<(outs GPR:$dst), (ins SPR:$src),
- "fmrs", " $dst, $src",
- [(set GPR:$dst, (bitconvert SPR:$src))]>;
-
-def FMSR : ASI<(outs SPR:$dst), (ins GPR:$src),
- "fmsr", " $dst, $src",
- [(set SPR:$dst, (bitconvert GPR:$src))]>;
-
-
-def FMRRD : ADI<(outs GPR:$dst1, GPR:$dst2), (ins DPR:$src),
- "fmrrd", " $dst1, $dst2, $src",
- [/* FIXME: Can't write pattern for multiple result instr*/]>;
-
-// FMDHR: GPR -> SPR
-// FMDLR: GPR -> SPR
-
-def FMDRR : ADI<(outs DPR:$dst), (ins GPR:$src1, GPR:$src2),
- "fmdrr", " $dst, $src1, $src2",
- [(set DPR:$dst, (arm_fmdrr GPR:$src1, GPR:$src2))]>;
-
-// FMRDH: SPR -> GPR
-// FMRDL: SPR -> GPR
-// FMRRS: SPR -> GPR
-// FMRX : SPR system reg -> GPR
-
-// FMSRR: GPR -> SPR
-
-let Defs = [CPSR] in
-def FMSTAT : ASI<(outs), (ins), "fmstat", "", [(arm_fmstat)]>;
-
-// FMXR: GPR -> VFP Sstem reg
-
-
-// Int to FP:
-
-def FSITOD : ADI<(outs DPR:$dst), (ins SPR:$a),
- "fsitod", " $dst, $a",
- [(set DPR:$dst, (arm_sitof SPR:$a))]>;
-
-def FSITOS : ASI<(outs SPR:$dst), (ins SPR:$a),
- "fsitos", " $dst, $a",
- [(set SPR:$dst, (arm_sitof SPR:$a))]>;
-
-def FUITOD : ADI<(outs DPR:$dst), (ins SPR:$a),
- "fuitod", " $dst, $a",
- [(set DPR:$dst, (arm_uitof SPR:$a))]>;
-
-def FUITOS : ASI<(outs SPR:$dst), (ins SPR:$a),
- "fuitos", " $dst, $a",
- [(set SPR:$dst, (arm_uitof SPR:$a))]>;
-
-// FP to Int:
-// Always set Z bit in the instruction, i.e. "round towards zero" variants.
-
-def FTOSIZD : ADI<(outs SPR:$dst), (ins DPR:$a),
- "ftosizd", " $dst, $a",
- [(set SPR:$dst, (arm_ftosi DPR:$a))]>;
-
-def FTOSIZS : ASI<(outs SPR:$dst), (ins SPR:$a),
- "ftosizs", " $dst, $a",
- [(set SPR:$dst, (arm_ftosi SPR:$a))]>;
-
-def FTOUIZD : ADI<(outs SPR:$dst), (ins DPR:$a),
- "ftouizd", " $dst, $a",
- [(set SPR:$dst, (arm_ftoui DPR:$a))]>;
-
-def FTOUIZS : ASI<(outs SPR:$dst), (ins SPR:$a),
- "ftouizs", " $dst, $a",
- [(set SPR:$dst, (arm_ftoui SPR:$a))]>;
-
-//===----------------------------------------------------------------------===//
-// FP FMA Operations.
-//
-
-def FMACD : ADI<(outs DPR:$dst), (ins DPR:$dstin, DPR:$a, DPR:$b),
- "fmacd", " $dst, $a, $b",
- [(set DPR:$dst, (fadd (fmul DPR:$a, DPR:$b), DPR:$dstin))]>,
- RegConstraint<"$dstin = $dst">;
-
-def FMACS : ASI<(outs SPR:$dst), (ins SPR:$dstin, SPR:$a, SPR:$b),
- "fmacs", " $dst, $a, $b",
- [(set SPR:$dst, (fadd (fmul SPR:$a, SPR:$b), SPR:$dstin))]>,
- RegConstraint<"$dstin = $dst">;
-
-def FMSCD : ADI<(outs DPR:$dst), (ins DPR:$dstin, DPR:$a, DPR:$b),
- "fmscd", " $dst, $a, $b",
- [(set DPR:$dst, (fsub (fmul DPR:$a, DPR:$b), DPR:$dstin))]>,
- RegConstraint<"$dstin = $dst">;
-
-def FMSCS : ASI<(outs SPR:$dst), (ins SPR:$dstin, SPR:$a, SPR:$b),
- "fmscs", " $dst, $a, $b",
- [(set SPR:$dst, (fsub (fmul SPR:$a, SPR:$b), SPR:$dstin))]>,
- RegConstraint<"$dstin = $dst">;
-
-def FNMACD : ADI<(outs DPR:$dst), (ins DPR:$dstin, DPR:$a, DPR:$b),
- "fnmacd", " $dst, $a, $b",
- [(set DPR:$dst, (fadd (fneg (fmul DPR:$a, DPR:$b)), DPR:$dstin))]>,
- RegConstraint<"$dstin = $dst">;
-
-def FNMACS : ASI<(outs SPR:$dst), (ins SPR:$dstin, SPR:$a, SPR:$b),
- "fnmacs", " $dst, $a, $b",
- [(set SPR:$dst, (fadd (fneg (fmul SPR:$a, SPR:$b)), SPR:$dstin))]>,
- RegConstraint<"$dstin = $dst">;
-
-def FNMSCD : ADI<(outs DPR:$dst), (ins DPR:$dstin, DPR:$a, DPR:$b),
- "fnmscd", " $dst, $a, $b",
- [(set DPR:$dst, (fsub (fneg (fmul DPR:$a, DPR:$b)), DPR:$dstin))]>,
- RegConstraint<"$dstin = $dst">;
-
-def FNMSCS : ASI<(outs SPR:$dst), (ins SPR:$dstin, SPR:$a, SPR:$b),
- "fnmscs", " $dst, $a, $b",
- [(set SPR:$dst, (fsub (fneg (fmul SPR:$a, SPR:$b)), SPR:$dstin))]>,
- RegConstraint<"$dstin = $dst">;
-
-//===----------------------------------------------------------------------===//
-// FP Conditional moves.
-//
-
-def FCPYDcc : ADI<(outs DPR:$dst), (ins DPR:$false, DPR:$true),
- "fcpyd", " $dst, $true",
- [/*(set DPR:$dst, (ARMcmov DPR:$false, DPR:$true, imm:$cc))*/]>,
- RegConstraint<"$false = $dst">;
-
-def FCPYScc : ASI<(outs SPR:$dst), (ins SPR:$false, SPR:$true),
- "fcpys", " $dst, $true",
- [/*(set SPR:$dst, (ARMcmov SPR:$false, SPR:$true, imm:$cc))*/]>,
- RegConstraint<"$false = $dst">;
-
-def FNEGDcc : ADI<(outs DPR:$dst), (ins DPR:$false, DPR:$true),
- "fnegd", " $dst, $true",
- [/*(set DPR:$dst, (ARMcneg DPR:$false, DPR:$true, imm:$cc))*/]>,
- RegConstraint<"$false = $dst">;
-
-def FNEGScc : ASI<(outs SPR:$dst), (ins SPR:$false, SPR:$true),
- "fnegs", " $dst, $true",
- [/*(set SPR:$dst, (ARMcneg SPR:$false, SPR:$true, imm:$cc))*/]>,
- RegConstraint<"$false = $dst">;
diff --git a/release_23/lib/Target/ARM/ARMJITInfo.cpp b/release_23/lib/Target/ARM/ARMJITInfo.cpp
deleted file mode 100644
index bc2bba36c80a..000000000000
--- a/release_23/lib/Target/ARM/ARMJITInfo.cpp
+++ /dev/null
@@ -1,164 +0,0 @@
-//===-- ARMJITInfo.cpp - Implement the JIT interfaces for the ARM target --===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the JIT interfaces for the ARM target.
-//
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "jit"
-#include "ARMJITInfo.h"
-#include "ARMRelocations.h"
-#include "ARMSubtarget.h"
-#include "llvm/Function.h"
-#include "llvm/CodeGen/MachineCodeEmitter.h"
-#include "llvm/Config/alloca.h"
-#include <cstdlib>
-using namespace llvm;
-
-void ARMJITInfo::replaceMachineCodeForFunction(void *Old, void *New) {
- abort();
-}
-
-/// JITCompilerFunction - This contains the address of the JIT function used to
-/// compile a function lazily.
-static TargetJITInfo::JITCompilerFn JITCompilerFunction;
-
-// CompilationCallback stub - We can't use a C function with inline assembly in
-// it, because we the prolog/epilog inserted by GCC won't work for us. Instead,
-// write our own wrapper, which does things our way, so we have complete control
-// over register saving and restoring.
-extern "C" {
-#if defined(__arm__)
- void ARMCompilationCallback(void);
- asm(
- ".text\n"
- ".align 2\n"
- ".globl ARMCompilationCallback\n"
- "ARMCompilationCallback:\n"
- // save main registers
- "mov ip, sp\n"
- "stmfd sp!, {fp, ip, lr, pc}\n"
- "sub fp, ip, #4\n"
- // arguments to Compilation Callback
- // r0 - our lr (address of the call instruction in stub plus 4)
- // r1 - stub's lr (address of instruction that called the stub plus 4)
- "mov r0, fp\n" // stub's frame
- "mov r1, lr\n" // stub's lr
- "bl ARMCompilationCallbackC\n"
- // restore main registers
- "ldmfd sp, {fp, sp, pc}\n");
-#else // Not an ARM host
- void ARMCompilationCallback() {
- assert(0 && "Cannot call ARMCompilationCallback() on a non-ARM arch!\n");
- abort();
- }
-#endif
-}
-
-/// ARMCompilationCallbackC - This is the target-specific function invoked by the
-/// function stub when we did not know the real target of a call. This function
-/// must locate the start of the stub or call site and pass it into the JIT
-/// compiler function.
-extern "C" void ARMCompilationCallbackC(intptr_t *StackPtr, intptr_t RetAddr) {
- intptr_t *RetAddrLoc = &StackPtr[-1];
-
- assert(*RetAddrLoc == RetAddr &&
- "Could not find return address on the stack!");
-#if 0
- DOUT << "In callback! Addr=" << (void*)RetAddr
- << " FP=" << (void*)StackPtr
- << ": Resolving call to function: "
- << TheVM->getFunctionReferencedName((void*)RetAddr) << "\n";
-#endif
- intptr_t Addr = RetAddr - 4;
-
- intptr_t NewVal = (intptr_t)JITCompilerFunction((void*)Addr);
-
- // Rewrite the call target... so that we don't end up here every time we
- // execute the call.
- *(intptr_t *)Addr = NewVal;
-
- // Change the return address to reexecute the branch and link instruction...
- *RetAddrLoc -= 12;
-}
-
-TargetJITInfo::LazyResolverFn
-ARMJITInfo::getLazyResolverFunction(JITCompilerFn F) {
- JITCompilerFunction = F;
- return ARMCompilationCallback;
-}
-
-void *ARMJITInfo::emitFunctionStub(const Function* F, void *Fn,
- MachineCodeEmitter &MCE) {
- unsigned addr = (intptr_t)Fn;
- // If this is just a call to an external function, emit a branch instead of a
- // call. The code is the same except for one bit of the last instruction.
- if (Fn != (void*)(intptr_t)ARMCompilationCallback) {
- // branch to the corresponding function addr
- // the stub is 8-byte size and 4-aligned
- MCE.startFunctionStub(F, 8, 4);
- MCE.emitWordLE(0xE51FF004); // LDR PC, [PC,#-4]
- MCE.emitWordLE(addr); // addr of function
- } else {
- // branch and link to the corresponding function addr
- // the stub is 20-byte size and 4-aligned
- MCE.startFunctionStub(F, 20, 4);
- MCE.emitWordLE(0xE92D4800); // STMFD SP!, [R11, LR]
- MCE.emitWordLE(0xE28FE004); // ADD LR, PC, #4
- MCE.emitWordLE(0xE51FF004); // LDR PC, [PC,#-4]
- MCE.emitWordLE(addr); // addr of function
- MCE.emitWordLE(0xE8BD8800); // LDMFD SP!, [R11, PC]
- }
-
- return MCE.finishFunctionStub(F);
-}
-
-/// relocate - Before the JIT can run a block of code that has been emitted,
-/// it must rewrite the code to contain the actual addresses of any
-/// referenced global symbols.
-void ARMJITInfo::relocate(void *Function, MachineRelocation *MR,
- unsigned NumRelocs, unsigned char* GOTBase) {
- for (unsigned i = 0; i != NumRelocs; ++i, ++MR) {
- void *RelocPos = (char*)Function + MR->getMachineCodeOffset();
- intptr_t ResultPtr = (intptr_t)MR->getResultPointer();
- switch ((ARM::RelocationType)MR->getRelocationType()) {
- case ARM::reloc_arm_relative: {
- // It is necessary to calculate the correct PC relative value. We
- // subtract the base addr from the target addr to form a byte offset.
- ResultPtr = ResultPtr-(intptr_t)RelocPos-8;
- // If the result is positive, set bit U(23) to 1.
- if (ResultPtr >= 0)
- *((unsigned*)RelocPos) |= 1 << 23;
- else {
- // otherwise, obtain the absolute value and set
- // bit U(23) to 0.
- ResultPtr *= -1;
- *((unsigned*)RelocPos) &= 0xFF7FFFFF;
- }
- // set the immed value calculated
- *((unsigned*)RelocPos) |= (unsigned)ResultPtr;
- // set register Rn to PC
- *((unsigned*)RelocPos) |= 0xF << 16;
- break;
- }
- case ARM::reloc_arm_branch: {
- // It is necessary to calculate the correct value of signed_immed_24
- // field. We subtract the base addr from the target addr to form a
- // byte offset, which must be inside the range -33554432 and +33554428.
- // Then, we set the signed_immed_24 field of the instruction to bits
- // [25:2] of the byte offset. More details ARM-ARM p. A4-11.
- ResultPtr = ResultPtr-(intptr_t)RelocPos-8;
- ResultPtr = (ResultPtr & 0x03FFFFFC) >> 2;
- assert(ResultPtr >= -33554432 && ResultPtr <= 33554428);
- *((unsigned*)RelocPos) |= ResultPtr;
- break;
- }
- }
- }
-}
diff --git a/release_23/lib/Target/ARM/ARMJITInfo.h b/release_23/lib/Target/ARM/ARMJITInfo.h
deleted file mode 100644
index de3ff08ad2a2..000000000000
--- a/release_23/lib/Target/ARM/ARMJITInfo.h
+++ /dev/null
@@ -1,51 +0,0 @@
-//===- ARMJITInfo.h - ARM implementation of the JIT interface --*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains the declaration of the ARMJITInfo class.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef ARMJITINFO_H
-#define ARMJITINFO_H
-
-#include "llvm/Target/TargetJITInfo.h"
-
-namespace llvm {
- class ARMTargetMachine;
-
- class ARMJITInfo : public TargetJITInfo {
- ARMTargetMachine &TM;
- public:
- explicit ARMJITInfo(ARMTargetMachine &tm) : TM(tm) {useGOT = 0;}
-
- /// replaceMachineCodeForFunction - Make it so that calling the function
- /// whose machine code is at OLD turns into a call to NEW, perhaps by
- /// overwriting OLD with a branch to NEW. This is used for self-modifying
- /// code.
- ///
- virtual void replaceMachineCodeForFunction(void *Old, void *New);
-
- /// emitFunctionStub - Use the specified MachineCodeEmitter object to emit a
- /// small native function that simply calls the function at the specified
- /// address.
- virtual void *emitFunctionStub(const Function* F, void *Fn,
- MachineCodeEmitter &MCE);
-
- /// getLazyResolverFunction - Expose the lazy resolver to the JIT.
- virtual LazyResolverFn getLazyResolverFunction(JITCompilerFn);
-
- /// relocate - Before the JIT can run a block of code that has been emitted,
- /// it must rewrite the code to contain the actual addresses of any
- /// referenced global symbols.
- virtual void relocate(void *Function, MachineRelocation *MR,
- unsigned NumRelocs, unsigned char* GOTBase);
- };
-}
-
-#endif
diff --git a/release_23/lib/Target/ARM/ARMLoadStoreOptimizer.cpp b/release_23/lib/Target/ARM/ARMLoadStoreOptimizer.cpp
deleted file mode 100644
index 5eeeafbac1cc..000000000000
--- a/release_23/lib/Target/ARM/ARMLoadStoreOptimizer.cpp
+++ /dev/null
@@ -1,771 +0,0 @@
-//===-- ARMLoadStoreOptimizer.cpp - ARM load / store opt. pass ----*- C++ -*-=//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains a pass that performs load / store related peephole
-// optimizations. This pass should be run after register allocation.
-//
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "arm-ldst-opt"
-#include "ARM.h"
-#include "ARMAddressingModes.h"
-#include "ARMMachineFunctionInfo.h"
-#include "ARMRegisterInfo.h"
-#include "llvm/ADT/STLExtras.h"
-#include "llvm/ADT/SmallVector.h"
-#include "llvm/ADT/Statistic.h"
-#include "llvm/CodeGen/MachineBasicBlock.h"
-#include "llvm/CodeGen/MachineFunctionPass.h"
-#include "llvm/CodeGen/MachineInstr.h"
-#include "llvm/CodeGen/MachineInstrBuilder.h"
-#include "llvm/CodeGen/RegisterScavenging.h"
-#include "llvm/Support/Compiler.h"
-#include "llvm/Target/TargetRegisterInfo.h"
-#include "llvm/Target/TargetInstrInfo.h"
-#include "llvm/Target/TargetMachine.h"
-using namespace llvm;
-
-STATISTIC(NumLDMGened , "Number of ldm instructions generated");
-STATISTIC(NumSTMGened , "Number of stm instructions generated");
-STATISTIC(NumFLDMGened, "Number of fldm instructions generated");
-STATISTIC(NumFSTMGened, "Number of fstm instructions generated");
-
-namespace {
- struct VISIBILITY_HIDDEN ARMLoadStoreOpt : public MachineFunctionPass {
- static char ID;
- ARMLoadStoreOpt() : MachineFunctionPass((intptr_t)&ID) {}
-
- const TargetInstrInfo *TII;
- const TargetRegisterInfo *TRI;
- ARMFunctionInfo *AFI;
- RegScavenger *RS;
-
- virtual bool runOnMachineFunction(MachineFunction &Fn);
-
- virtual const char *getPassName() const {
- return "ARM load / store optimization pass";
- }
-
- private:
- struct MemOpQueueEntry {
- int Offset;
- unsigned Position;
- MachineBasicBlock::iterator MBBI;
- bool Merged;
- MemOpQueueEntry(int o, int p, MachineBasicBlock::iterator i)
- : Offset(o), Position(p), MBBI(i), Merged(false) {};
- };
- typedef SmallVector<MemOpQueueEntry,8> MemOpQueue;
- typedef MemOpQueue::iterator MemOpQueueIter;
-
- SmallVector<MachineBasicBlock::iterator, 4>
- MergeLDR_STR(MachineBasicBlock &MBB, unsigned SIndex, unsigned Base,
- int Opcode, unsigned Size,
- ARMCC::CondCodes Pred, unsigned PredReg,
- unsigned Scratch, MemOpQueue &MemOps);
-
- void AdvanceRS(MachineBasicBlock &MBB, MemOpQueue &MemOps);
- bool LoadStoreMultipleOpti(MachineBasicBlock &MBB);
- bool MergeReturnIntoLDM(MachineBasicBlock &MBB);
- };
- char ARMLoadStoreOpt::ID = 0;
-}
-
-/// createARMLoadStoreOptimizationPass - returns an instance of the load / store
-/// optimization pass.
-FunctionPass *llvm::createARMLoadStoreOptimizationPass() {
- return new ARMLoadStoreOpt();
-}
-
-static int getLoadStoreMultipleOpcode(int Opcode) {
- switch (Opcode) {
- case ARM::LDR:
- NumLDMGened++;
- return ARM::LDM;
- case ARM::STR:
- NumSTMGened++;
- return ARM::STM;
- case ARM::FLDS:
- NumFLDMGened++;
- return ARM::FLDMS;
- case ARM::FSTS:
- NumFSTMGened++;
- return ARM::FSTMS;
- case ARM::FLDD:
- NumFLDMGened++;
- return ARM::FLDMD;
- case ARM::FSTD:
- NumFSTMGened++;
- return ARM::FSTMD;
- default: abort();
- }
- return 0;
-}
-
-/// mergeOps - Create and insert a LDM or STM with Base as base register and
-/// registers in Regs as the register operands that would be loaded / stored.
-/// It returns true if the transformation is done.
-static bool mergeOps(MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI,
- int Offset, unsigned Base, bool BaseKill, int Opcode,
- ARMCC::CondCodes Pred, unsigned PredReg, unsigned Scratch,
- SmallVector<std::pair<unsigned, bool>, 8> &Regs,
- const TargetInstrInfo *TII) {
- // Only a single register to load / store. Don't bother.
- unsigned NumRegs = Regs.size();
- if (NumRegs <= 1)
- return false;
-
- ARM_AM::AMSubMode Mode = ARM_AM::ia;
- bool isAM4 = Opcode == ARM::LDR || Opcode == ARM::STR;
- if (isAM4 && Offset == 4)
- Mode = ARM_AM::ib;
- else if (isAM4 && Offset == -4 * (int)NumRegs + 4)
- Mode = ARM_AM::da;
- else if (isAM4 && Offset == -4 * (int)NumRegs)
- Mode = ARM_AM::db;
- else if (Offset != 0) {
- // If starting offset isn't zero, insert a MI to materialize a new base.
- // But only do so if it is cost effective, i.e. merging more than two
- // loads / stores.
- if (NumRegs <= 2)
- return false;
-
- unsigned NewBase;
- if (Opcode == ARM::LDR)
- // If it is a load, then just use one of the destination register to
- // use as the new base.
- NewBase = Regs[NumRegs-1].first;
- else {
- // Use the scratch register to use as a new base.
- NewBase = Scratch;
- if (NewBase == 0)
- return false;
- }
- int BaseOpc = ARM::ADDri;
- if (Offset < 0) {
- BaseOpc = ARM::SUBri;
- Offset = - Offset;
- }
- int ImmedOffset = ARM_AM::getSOImmVal(Offset);
- if (ImmedOffset == -1)
- return false; // Probably not worth it then.
-
- BuildMI(MBB, MBBI, TII->get(BaseOpc), NewBase)
- .addReg(Base, false, false, BaseKill).addImm(ImmedOffset)
- .addImm(Pred).addReg(PredReg).addReg(0);
- Base = NewBase;
- BaseKill = true; // New base is always killed right its use.
- }
-
- bool isDPR = Opcode == ARM::FLDD || Opcode == ARM::FSTD;
- bool isDef = Opcode == ARM::LDR || Opcode == ARM::FLDS || Opcode == ARM::FLDD;
- Opcode = getLoadStoreMultipleOpcode(Opcode);
- MachineInstrBuilder MIB = (isAM4)
- ? BuildMI(MBB, MBBI, TII->get(Opcode)).addReg(Base, false, false, BaseKill)
- .addImm(ARM_AM::getAM4ModeImm(Mode)).addImm(Pred).addReg(PredReg)
- : BuildMI(MBB, MBBI, TII->get(Opcode)).addReg(Base, false, false, BaseKill)
- .addImm(ARM_AM::getAM5Opc(Mode, false, isDPR ? NumRegs<<1 : NumRegs))
- .addImm(Pred).addReg(PredReg);
- for (unsigned i = 0; i != NumRegs; ++i)
- MIB = MIB.addReg(Regs[i].first, isDef, false, Regs[i].second);
-
- return true;
-}
-
-/// MergeLDR_STR - Merge a number of load / store instructions into one or more
-/// load / store multiple instructions.
-SmallVector<MachineBasicBlock::iterator, 4>
-ARMLoadStoreOpt::MergeLDR_STR(MachineBasicBlock &MBB, unsigned SIndex,
- unsigned Base, int Opcode, unsigned Size,
- ARMCC::CondCodes Pred, unsigned PredReg,
- unsigned Scratch, MemOpQueue &MemOps) {
- SmallVector<MachineBasicBlock::iterator, 4> Merges;
- bool isAM4 = Opcode == ARM::LDR || Opcode == ARM::STR;
- int Offset = MemOps[SIndex].Offset;
- int SOffset = Offset;
- unsigned Pos = MemOps[SIndex].Position;
- MachineBasicBlock::iterator Loc = MemOps[SIndex].MBBI;
- unsigned PReg = MemOps[SIndex].MBBI->getOperand(0).getReg();
- unsigned PRegNum = ARMRegisterInfo::getRegisterNumbering(PReg);
- bool isKill = MemOps[SIndex].MBBI->getOperand(0).isKill();
-
- SmallVector<std::pair<unsigned,bool>, 8> Regs;
- Regs.push_back(std::make_pair(PReg, isKill));
- for (unsigned i = SIndex+1, e = MemOps.size(); i != e; ++i) {
- int NewOffset = MemOps[i].Offset;
- unsigned Reg = MemOps[i].MBBI->getOperand(0).getReg();
- unsigned RegNum = ARMRegisterInfo::getRegisterNumbering(Reg);
- isKill = MemOps[i].MBBI->getOperand(0).isKill();
- // AM4 - register numbers in ascending order.
- // AM5 - consecutive register numbers in ascending order.
- if (NewOffset == Offset + (int)Size &&
- ((isAM4 && RegNum > PRegNum) || RegNum == PRegNum+1)) {
- Offset += Size;
- Regs.push_back(std::make_pair(Reg, isKill));
- PRegNum = RegNum;
- } else {
- // Can't merge this in. Try merge the earlier ones first.
- if (mergeOps(MBB, ++Loc, SOffset, Base, false, Opcode, Pred, PredReg,
- Scratch, Regs, TII)) {
- Merges.push_back(prior(Loc));
- for (unsigned j = SIndex; j < i; ++j) {
- MBB.erase(MemOps[j].MBBI);
- MemOps[j].Merged = true;
- }
- }
- SmallVector<MachineBasicBlock::iterator, 4> Merges2 =
- MergeLDR_STR(MBB, i, Base, Opcode, Size, Pred, PredReg, Scratch,MemOps);
- Merges.append(Merges2.begin(), Merges2.end());
- return Merges;
- }
-
- if (MemOps[i].Position > Pos) {
- Pos = MemOps[i].Position;
- Loc = MemOps[i].MBBI;
- }
- }
-
- bool BaseKill = Loc->findRegisterUseOperandIdx(Base, true) != -1;
- if (mergeOps(MBB, ++Loc, SOffset, Base, BaseKill, Opcode, Pred, PredReg,
- Scratch, Regs, TII)) {
- Merges.push_back(prior(Loc));
- for (unsigned i = SIndex, e = MemOps.size(); i != e; ++i) {
- MBB.erase(MemOps[i].MBBI);
- MemOps[i].Merged = true;
- }
- }
-
- return Merges;
-}
-
-/// getInstrPredicate - If instruction is predicated, returns its predicate
-/// condition, otherwise returns AL. It also returns the condition code
-/// register by reference.
-static ARMCC::CondCodes getInstrPredicate(MachineInstr *MI, unsigned &PredReg) {
- int PIdx = MI->findFirstPredOperandIdx();
- if (PIdx == -1) {
- PredReg = 0;
- return ARMCC::AL;
- }
-
- PredReg = MI->getOperand(PIdx+1).getReg();
- return (ARMCC::CondCodes)MI->getOperand(PIdx).getImm();
-}
-
-static inline bool isMatchingDecrement(MachineInstr *MI, unsigned Base,
- unsigned Bytes, ARMCC::CondCodes Pred,
- unsigned PredReg) {
- unsigned MyPredReg = 0;
- return (MI && MI->getOpcode() == ARM::SUBri &&
- MI->getOperand(0).getReg() == Base &&
- MI->getOperand(1).getReg() == Base &&
- ARM_AM::getAM2Offset(MI->getOperand(2).getImm()) == Bytes &&
- getInstrPredicate(MI, MyPredReg) == Pred &&
- MyPredReg == PredReg);
-}
-
-static inline bool isMatchingIncrement(MachineInstr *MI, unsigned Base,
- unsigned Bytes, ARMCC::CondCodes Pred,
- unsigned PredReg) {
- unsigned MyPredReg = 0;
- return (MI && MI->getOpcode() == ARM::ADDri &&
- MI->getOperand(0).getReg() == Base &&
- MI->getOperand(1).getReg() == Base &&
- ARM_AM::getAM2Offset(MI->getOperand(2).getImm()) == Bytes &&
- getInstrPredicate(MI, MyPredReg) == Pred &&
- MyPredReg == PredReg);
-}
-
-static inline unsigned getLSMultipleTransferSize(MachineInstr *MI) {
- switch (MI->getOpcode()) {
- default: return 0;
- case ARM::LDR:
- case ARM::STR:
- case ARM::FLDS:
- case ARM::FSTS:
- return 4;
- case ARM::FLDD:
- case ARM::FSTD:
- return 8;
- case ARM::LDM:
- case ARM::STM:
- return (MI->getNumOperands() - 4) * 4;
- case ARM::FLDMS:
- case ARM::FSTMS:
- case ARM::FLDMD:
- case ARM::FSTMD:
- return ARM_AM::getAM5Offset(MI->getOperand(1).getImm()) * 4;
- }
-}
-
-/// mergeBaseUpdateLSMultiple - Fold proceeding/trailing inc/dec of base
-/// register into the LDM/STM/FLDM{D|S}/FSTM{D|S} op when possible:
-///
-/// stmia rn, <ra, rb, rc>
-/// rn := rn + 4 * 3;
-/// =>
-/// stmia rn!, <ra, rb, rc>
-///
-/// rn := rn - 4 * 3;
-/// ldmia rn, <ra, rb, rc>
-/// =>
-/// ldmdb rn!, <ra, rb, rc>
-static bool mergeBaseUpdateLSMultiple(MachineBasicBlock &MBB,
- MachineBasicBlock::iterator MBBI,
- bool &Advance,
- MachineBasicBlock::iterator &I) {
- MachineInstr *MI = MBBI;
- unsigned Base = MI->getOperand(0).getReg();
- unsigned Bytes = getLSMultipleTransferSize(MI);
- unsigned PredReg = 0;
- ARMCC::CondCodes Pred = getInstrPredicate(MI, PredReg);
- int Opcode = MI->getOpcode();
- bool isAM4 = Opcode == ARM::LDM || Opcode == ARM::STM;
-
- if (isAM4) {
- if (ARM_AM::getAM4WBFlag(MI->getOperand(1).getImm()))
- return false;
-
- // Can't use the updating AM4 sub-mode if the base register is also a dest
- // register. e.g. ldmdb r0!, {r0, r1, r2}. The behavior is undefined.
- for (unsigned i = 3, e = MI->getNumOperands(); i != e; ++i) {
- if (MI->getOperand(i).getReg() == Base)
- return false;
- }
-
- ARM_AM::AMSubMode Mode = ARM_AM::getAM4SubMode(MI->getOperand(1).getImm());
- if (MBBI != MBB.begin()) {
- MachineBasicBlock::iterator PrevMBBI = prior(MBBI);
- if (Mode == ARM_AM::ia &&
- isMatchingDecrement(PrevMBBI, Base, Bytes, Pred, PredReg)) {
- MI->getOperand(1).setImm(ARM_AM::getAM4ModeImm(ARM_AM::db, true));
- MBB.erase(PrevMBBI);
- return true;
- } else if (Mode == ARM_AM::ib &&
- isMatchingDecrement(PrevMBBI, Base, Bytes, Pred, PredReg)) {
- MI->getOperand(1).setImm(ARM_AM::getAM4ModeImm(ARM_AM::da, true));
- MBB.erase(PrevMBBI);
- return true;
- }
- }
-
- if (MBBI != MBB.end()) {
- MachineBasicBlock::iterator NextMBBI = next(MBBI);
- if ((Mode == ARM_AM::ia || Mode == ARM_AM::ib) &&
- isMatchingIncrement(NextMBBI, Base, Bytes, Pred, PredReg)) {
- MI->getOperand(1).setImm(ARM_AM::getAM4ModeImm(Mode, true));
- if (NextMBBI == I) {
- Advance = true;
- ++I;
- }
- MBB.erase(NextMBBI);
- return true;
- } else if ((Mode == ARM_AM::da || Mode == ARM_AM::db) &&
- isMatchingDecrement(NextMBBI, Base, Bytes, Pred, PredReg)) {
- MI->getOperand(1).setImm(ARM_AM::getAM4ModeImm(Mode, true));
- if (NextMBBI == I) {
- Advance = true;
- ++I;
- }
- MBB.erase(NextMBBI);
- return true;
- }
- }
- } else {
- // FLDM{D|S}, FSTM{D|S} addressing mode 5 ops.
- if (ARM_AM::getAM5WBFlag(MI->getOperand(1).getImm()))
- return false;
-
- ARM_AM::AMSubMode Mode = ARM_AM::getAM5SubMode(MI->getOperand(1).getImm());
- unsigned Offset = ARM_AM::getAM5Offset(MI->getOperand(1).getImm());
- if (MBBI != MBB.begin()) {
- MachineBasicBlock::iterator PrevMBBI = prior(MBBI);
- if (Mode == ARM_AM::ia &&
- isMatchingDecrement(PrevMBBI, Base, Bytes, Pred, PredReg)) {
- MI->getOperand(1).setImm(ARM_AM::getAM5Opc(ARM_AM::db, true, Offset));
- MBB.erase(PrevMBBI);
- return true;
- }
- }
-
- if (MBBI != MBB.end()) {
- MachineBasicBlock::iterator NextMBBI = next(MBBI);
- if (Mode == ARM_AM::ia &&
- isMatchingIncrement(NextMBBI, Base, Bytes, Pred, PredReg)) {
- MI->getOperand(1).setImm(ARM_AM::getAM5Opc(ARM_AM::ia, true, Offset));
- if (NextMBBI == I) {
- Advance = true;
- ++I;
- }
- MBB.erase(NextMBBI);
- }
- return true;
- }
- }
-
- return false;
-}
-
-static unsigned getPreIndexedLoadStoreOpcode(unsigned Opc) {
- switch (Opc) {
- case ARM::LDR: return ARM::LDR_PRE;
- case ARM::STR: return ARM::STR_PRE;
- case ARM::FLDS: return ARM::FLDMS;
- case ARM::FLDD: return ARM::FLDMD;
- case ARM::FSTS: return ARM::FSTMS;
- case ARM::FSTD: return ARM::FSTMD;
- default: abort();
- }
- return 0;
-}
-
-static unsigned getPostIndexedLoadStoreOpcode(unsigned Opc) {
- switch (Opc) {
- case ARM::LDR: return ARM::LDR_POST;
- case ARM::STR: return ARM::STR_POST;
- case ARM::FLDS: return ARM::FLDMS;
- case ARM::FLDD: return ARM::FLDMD;
- case ARM::FSTS: return ARM::FSTMS;
- case ARM::FSTD: return ARM::FSTMD;
- default: abort();
- }
- return 0;
-}
-
-/// mergeBaseUpdateLoadStore - Fold proceeding/trailing inc/dec of base
-/// register into the LDR/STR/FLD{D|S}/FST{D|S} op when possible:
-static bool mergeBaseUpdateLoadStore(MachineBasicBlock &MBB,
- MachineBasicBlock::iterator MBBI,
- const TargetInstrInfo *TII,
- bool &Advance,
- MachineBasicBlock::iterator &I) {
- MachineInstr *MI = MBBI;
- unsigned Base = MI->getOperand(1).getReg();
- bool BaseKill = MI->getOperand(1).isKill();
- unsigned Bytes = getLSMultipleTransferSize(MI);
- int Opcode = MI->getOpcode();
- bool isAM2 = Opcode == ARM::LDR || Opcode == ARM::STR;
- if ((isAM2 && ARM_AM::getAM2Offset(MI->getOperand(3).getImm()) != 0) ||
- (!isAM2 && ARM_AM::getAM5Offset(MI->getOperand(2).getImm()) != 0))
- return false;
-
- bool isLd = Opcode == ARM::LDR || Opcode == ARM::FLDS || Opcode == ARM::FLDD;
- // Can't do the merge if the destination register is the same as the would-be
- // writeback register.
- if (isLd && MI->getOperand(0).getReg() == Base)
- return false;
-
- unsigned PredReg = 0;
- ARMCC::CondCodes Pred = getInstrPredicate(MI, PredReg);
- bool DoMerge = false;
- ARM_AM::AddrOpc AddSub = ARM_AM::add;
- unsigned NewOpc = 0;
- if (MBBI != MBB.begin()) {
- MachineBasicBlock::iterator PrevMBBI = prior(MBBI);
- if (isMatchingDecrement(PrevMBBI, Base, Bytes, Pred, PredReg)) {
- DoMerge = true;
- AddSub = ARM_AM::sub;
- NewOpc = getPreIndexedLoadStoreOpcode(Opcode);
- } else if (isAM2 && isMatchingIncrement(PrevMBBI, Base, Bytes,
- Pred, PredReg)) {
- DoMerge = true;
- NewOpc = getPreIndexedLoadStoreOpcode(Opcode);
- }
- if (DoMerge)
- MBB.erase(PrevMBBI);
- }
-
- if (!DoMerge && MBBI != MBB.end()) {
- MachineBasicBlock::iterator NextMBBI = next(MBBI);
- if (isAM2 && isMatchingDecrement(NextMBBI, Base, Bytes, Pred, PredReg)) {
- DoMerge = true;
- AddSub = ARM_AM::sub;
- NewOpc = getPostIndexedLoadStoreOpcode(Opcode);
- } else if (isMatchingIncrement(NextMBBI, Base, Bytes, Pred, PredReg)) {
- DoMerge = true;
- NewOpc = getPostIndexedLoadStoreOpcode(Opcode);
- }
- if (DoMerge) {
- if (NextMBBI == I) {
- Advance = true;
- ++I;
- }
- MBB.erase(NextMBBI);
- }
- }
-
- if (!DoMerge)
- return false;
-
- bool isDPR = NewOpc == ARM::FLDMD || NewOpc == ARM::FSTMD;
- unsigned Offset = isAM2 ? ARM_AM::getAM2Opc(AddSub, Bytes, ARM_AM::no_shift)
- : ARM_AM::getAM5Opc((AddSub == ARM_AM::sub) ? ARM_AM::db : ARM_AM::ia,
- true, isDPR ? 2 : 1);
- if (isLd) {
- if (isAM2)
- // LDR_PRE, LDR_POST;
- BuildMI(MBB, MBBI, TII->get(NewOpc), MI->getOperand(0).getReg())
- .addReg(Base, true)
- .addReg(Base).addReg(0).addImm(Offset).addImm(Pred).addReg(PredReg);
- else
- // FLDMS, FLDMD
- BuildMI(MBB, MBBI, TII->get(NewOpc)).addReg(Base, false, false, BaseKill)
- .addImm(Offset).addImm(Pred).addReg(PredReg)
- .addReg(MI->getOperand(0).getReg(), true);
- } else {
- MachineOperand &MO = MI->getOperand(0);
- if (isAM2)
- // STR_PRE, STR_POST;
- BuildMI(MBB, MBBI, TII->get(NewOpc), Base)
- .addReg(MO.getReg(), false, false, MO.isKill())
- .addReg(Base).addReg(0).addImm(Offset).addImm(Pred).addReg(PredReg);
- else
- // FSTMS, FSTMD
- BuildMI(MBB, MBBI, TII->get(NewOpc)).addReg(Base).addImm(Offset)
- .addImm(Pred).addReg(PredReg)
- .addReg(MO.getReg(), false, false, MO.isKill());
- }
- MBB.erase(MBBI);
-
- return true;
-}
-
-/// isMemoryOp - Returns true if instruction is a memory operations (that this
-/// pass is capable of operating on).
-static bool isMemoryOp(MachineInstr *MI) {
- int Opcode = MI->getOpcode();
- switch (Opcode) {
- default: break;
- case ARM::LDR:
- case ARM::STR:
- return MI->getOperand(1).isRegister() && MI->getOperand(2).getReg() == 0;
- case ARM::FLDS:
- case ARM::FSTS:
- return MI->getOperand(1).isRegister();
- case ARM::FLDD:
- case ARM::FSTD:
- return MI->getOperand(1).isRegister();
- }
- return false;
-}
-
-/// AdvanceRS - Advance register scavenger to just before the earliest memory
-/// op that is being merged.
-void ARMLoadStoreOpt::AdvanceRS(MachineBasicBlock &MBB, MemOpQueue &MemOps) {
- MachineBasicBlock::iterator Loc = MemOps[0].MBBI;
- unsigned Position = MemOps[0].Position;
- for (unsigned i = 1, e = MemOps.size(); i != e; ++i) {
- if (MemOps[i].Position < Position) {
- Position = MemOps[i].Position;
- Loc = MemOps[i].MBBI;
- }
- }
-
- if (Loc != MBB.begin())
- RS->forward(prior(Loc));
-}
-
-/// LoadStoreMultipleOpti - An optimization pass to turn multiple LDR / STR
-/// ops of the same base and incrementing offset into LDM / STM ops.
-bool ARMLoadStoreOpt::LoadStoreMultipleOpti(MachineBasicBlock &MBB) {
- unsigned NumMerges = 0;
- unsigned NumMemOps = 0;
- MemOpQueue MemOps;
- unsigned CurrBase = 0;
- int CurrOpc = -1;
- unsigned CurrSize = 0;
- ARMCC::CondCodes CurrPred = ARMCC::AL;
- unsigned CurrPredReg = 0;
- unsigned Position = 0;
-
- RS->enterBasicBlock(&MBB);
- MachineBasicBlock::iterator MBBI = MBB.begin(), E = MBB.end();
- while (MBBI != E) {
- bool Advance = false;
- bool TryMerge = false;
- bool Clobber = false;
-
- bool isMemOp = isMemoryOp(MBBI);
- if (isMemOp) {
- int Opcode = MBBI->getOpcode();
- bool isAM2 = Opcode == ARM::LDR || Opcode == ARM::STR;
- unsigned Size = getLSMultipleTransferSize(MBBI);
- unsigned Base = MBBI->getOperand(1).getReg();
- unsigned PredReg = 0;
- ARMCC::CondCodes Pred = getInstrPredicate(MBBI, PredReg);
- unsigned NumOperands = MBBI->getDesc().getNumOperands();
- unsigned OffField = MBBI->getOperand(NumOperands-3).getImm();
- int Offset = isAM2
- ? ARM_AM::getAM2Offset(OffField) : ARM_AM::getAM5Offset(OffField) * 4;
- if (isAM2) {
- if (ARM_AM::getAM2Op(OffField) == ARM_AM::sub)
- Offset = -Offset;
- } else {
- if (ARM_AM::getAM5Op(OffField) == ARM_AM::sub)
- Offset = -Offset;
- }
- // Watch out for:
- // r4 := ldr [r5]
- // r5 := ldr [r5, #4]
- // r6 := ldr [r5, #8]
- //
- // The second ldr has effectively broken the chain even though it
- // looks like the later ldr(s) use the same base register. Try to
- // merge the ldr's so far, including this one. But don't try to
- // combine the following ldr(s).
- Clobber = (Opcode == ARM::LDR && Base == MBBI->getOperand(0).getReg());
- if (CurrBase == 0 && !Clobber) {
- // Start of a new chain.
- CurrBase = Base;
- CurrOpc = Opcode;
- CurrSize = Size;
- CurrPred = Pred;
- CurrPredReg = PredReg;
- MemOps.push_back(MemOpQueueEntry(Offset, Position, MBBI));
- NumMemOps++;
- Advance = true;
- } else {
- if (Clobber) {
- TryMerge = true;
- Advance = true;
- }
-
- if (CurrOpc == Opcode && CurrBase == Base && CurrPred == Pred) {
- // No need to match PredReg.
- // Continue adding to the queue.
- if (Offset > MemOps.back().Offset) {
- MemOps.push_back(MemOpQueueEntry(Offset, Position, MBBI));
- NumMemOps++;
- Advance = true;
- } else {
- for (MemOpQueueIter I = MemOps.begin(), E = MemOps.end();
- I != E; ++I) {
- if (Offset < I->Offset) {
- MemOps.insert(I, MemOpQueueEntry(Offset, Position, MBBI));
- NumMemOps++;
- Advance = true;
- break;
- } else if (Offset == I->Offset) {
- // Collision! This can't be merged!
- break;
- }
- }
- }
- }
- }
- }
-
- if (Advance) {
- ++Position;
- ++MBBI;
- } else
- TryMerge = true;
-
- if (TryMerge) {
- if (NumMemOps > 1) {
- // Try to find a free register to use as a new base in case it's needed.
- // First advance to the instruction just before the start of the chain.
- AdvanceRS(MBB, MemOps);
- // Find a scratch register. Make sure it's a call clobbered register or
- // a spilled callee-saved register.
- unsigned Scratch = RS->FindUnusedReg(&ARM::GPRRegClass, true);
- if (!Scratch)
- Scratch = RS->FindUnusedReg(&ARM::GPRRegClass,
- AFI->getSpilledCSRegisters());
- // Process the load / store instructions.
- RS->forward(prior(MBBI));
-
- // Merge ops.
- SmallVector<MachineBasicBlock::iterator,4> MBBII =
- MergeLDR_STR(MBB, 0, CurrBase, CurrOpc, CurrSize,
- CurrPred, CurrPredReg, Scratch, MemOps);
-
- // Try folding preceeding/trailing base inc/dec into the generated
- // LDM/STM ops.
- for (unsigned i = 0, e = MBBII.size(); i < e; ++i)
- if (mergeBaseUpdateLSMultiple(MBB, MBBII[i], Advance, MBBI))
- NumMerges++;
- NumMerges += MBBII.size();
-
- // Try folding preceeding/trailing base inc/dec into those load/store
- // that were not merged to form LDM/STM ops.
- for (unsigned i = 0; i != NumMemOps; ++i)
- if (!MemOps[i].Merged)
- if (mergeBaseUpdateLoadStore(MBB, MemOps[i].MBBI, TII,Advance,MBBI))
- NumMerges++;
-
- // RS may be pointing to an instruction that's deleted.
- RS->skipTo(prior(MBBI));
- }
-
- CurrBase = 0;
- CurrOpc = -1;
- CurrSize = 0;
- CurrPred = ARMCC::AL;
- CurrPredReg = 0;
- if (NumMemOps) {
- MemOps.clear();
- NumMemOps = 0;
- }
-
- // If iterator hasn't been advanced and this is not a memory op, skip it.
- // It can't start a new chain anyway.
- if (!Advance && !isMemOp && MBBI != E) {
- ++Position;
- ++MBBI;
- }
- }
- }
- return NumMerges > 0;
-}
-
-/// MergeReturnIntoLDM - If this is a exit BB, try merging the return op
-/// (bx lr) into the preceeding stack restore so it directly restore the value
-/// of LR into pc.
-/// ldmfd sp!, {r7, lr}
-/// bx lr
-/// =>
-/// ldmfd sp!, {r7, pc}
-bool ARMLoadStoreOpt::MergeReturnIntoLDM(MachineBasicBlock &MBB) {
- if (MBB.empty()) return false;
-
- MachineBasicBlock::iterator MBBI = prior(MBB.end());
- if (MBBI->getOpcode() == ARM::BX_RET && MBBI != MBB.begin()) {
- MachineInstr *PrevMI = prior(MBBI);
- if (PrevMI->getOpcode() == ARM::LDM) {
- MachineOperand &MO = PrevMI->getOperand(PrevMI->getNumOperands()-1);
- if (MO.getReg() == ARM::LR) {
- PrevMI->setDesc(TII->get(ARM::LDM_RET));
- MO.setReg(ARM::PC);
- MBB.erase(MBBI);
- return true;
- }
- }
- }
- return false;
-}
-
-bool ARMLoadStoreOpt::runOnMachineFunction(MachineFunction &Fn) {
- const TargetMachine &TM = Fn.getTarget();
- AFI = Fn.getInfo<ARMFunctionInfo>();
- TII = TM.getInstrInfo();
- TRI = TM.getRegisterInfo();
- RS = new RegScavenger();
-
- bool Modified = false;
- for (MachineFunction::iterator MFI = Fn.begin(), E = Fn.end(); MFI != E;
- ++MFI) {
- MachineBasicBlock &MBB = *MFI;
- Modified |= LoadStoreMultipleOpti(MBB);
- Modified |= MergeReturnIntoLDM(MBB);
- }
-
- delete RS;
- return Modified;
-}
diff --git a/release_23/lib/Target/ARM/ARMMachineFunctionInfo.h b/release_23/lib/Target/ARM/ARMMachineFunctionInfo.h
deleted file mode 100644
index eeb61d76860e..000000000000
--- a/release_23/lib/Target/ARM/ARMMachineFunctionInfo.h
+++ /dev/null
@@ -1,220 +0,0 @@
-//====- ARMMachineFuctionInfo.h - ARM machine function info -----*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file declares ARM-specific per-machine-function information.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef ARMMACHINEFUNCTIONINFO_H
-#define ARMMACHINEFUNCTIONINFO_H
-
-#include "ARMSubtarget.h"
-#include "llvm/CodeGen/MachineFunction.h"
-#include "llvm/Target/TargetRegisterInfo.h"
-#include "llvm/Target/TargetMachine.h"
-#include "llvm/ADT/BitVector.h"
-
-namespace llvm {
-
-/// ARMFunctionInfo - This class is derived from MachineFunction private
-/// ARM target-specific information for each MachineFunction.
-class ARMFunctionInfo : public MachineFunctionInfo {
-
- /// isThumb - True if this function is compiled under Thumb mode.
- /// Used to initialized Align, so must precede it.
- bool isThumb;
-
- /// Align - required alignment. ARM functions and Thumb functions with
- /// constant pools require 4-byte alignment; other Thumb functions
- /// require only 2-byte alignment.
- unsigned Align;
-
- /// VarArgsRegSaveSize - Size of the register save area for vararg functions.
- ///
- unsigned VarArgsRegSaveSize;
-
- /// HasStackFrame - True if this function has a stack frame. Set by
- /// processFunctionBeforeCalleeSavedScan().
- bool HasStackFrame;
-
- /// LRSpilledForFarJump - True if the LR register has been for spilled to
- /// enable far jump.
- bool LRSpilledForFarJump;
-
- /// R3IsLiveIn - True if R3 is live in to this function.
- /// FIXME: Remove when register scavenger for Thumb is done.
- bool R3IsLiveIn;
-
- /// FramePtrSpillOffset - If HasStackFrame, this records the frame pointer
- /// spill stack offset.
- unsigned FramePtrSpillOffset;
-
- /// GPRCS1Offset, GPRCS2Offset, DPRCSOffset - Starting offset of callee saved
- /// register spills areas. For Mac OS X:
- ///
- /// GPR callee-saved (1) : r4, r5, r6, r7, lr
- /// --------------------------------------------
- /// GPR callee-saved (2) : r8, r10, r11
- /// --------------------------------------------
- /// DPR callee-saved : d8 - d15
- unsigned GPRCS1Offset;
- unsigned GPRCS2Offset;
- unsigned DPRCSOffset;
-
- /// GPRCS1Size, GPRCS2Size, DPRCSSize - Sizes of callee saved register spills
- /// areas.
- unsigned GPRCS1Size;
- unsigned GPRCS2Size;
- unsigned DPRCSSize;
-
- /// GPRCS1Frames, GPRCS2Frames, DPRCSFrames - Keeps track of frame indices
- /// which belong to these spill areas.
- BitVector GPRCS1Frames;
- BitVector GPRCS2Frames;
- BitVector DPRCSFrames;
-
- /// SpilledCSRegs - A BitVector mask of all spilled callee-saved registers.
- ///
- BitVector SpilledCSRegs;
-
- /// JumpTableUId - Unique id for jumptables.
- ///
- unsigned JumpTableUId;
-
-public:
- ARMFunctionInfo() :
- isThumb(false),
- Align(2U),
- VarArgsRegSaveSize(0), HasStackFrame(false),
- LRSpilledForFarJump(false), R3IsLiveIn(false),
- FramePtrSpillOffset(0), GPRCS1Offset(0), GPRCS2Offset(0), DPRCSOffset(0),
- GPRCS1Size(0), GPRCS2Size(0), DPRCSSize(0),
- GPRCS1Frames(0), GPRCS2Frames(0), DPRCSFrames(0),
- JumpTableUId(0) {}
-
- ARMFunctionInfo(MachineFunction &MF) :
- isThumb(MF.getTarget().getSubtarget<ARMSubtarget>().isThumb()),
- Align(isThumb ? 1U : 2U),
- VarArgsRegSaveSize(0), HasStackFrame(false),
- LRSpilledForFarJump(false), R3IsLiveIn(false),
- FramePtrSpillOffset(0), GPRCS1Offset(0), GPRCS2Offset(0), DPRCSOffset(0),
- GPRCS1Size(0), GPRCS2Size(0), DPRCSSize(0),
- GPRCS1Frames(32), GPRCS2Frames(32), DPRCSFrames(32),
- SpilledCSRegs(MF.getTarget().getRegisterInfo()->getNumRegs()),
- JumpTableUId(0) {}
-
- bool isThumbFunction() const { return isThumb; }
-
- unsigned getAlign() const { return Align; }
- void setAlign(unsigned a) { Align = a; }
-
- unsigned getVarArgsRegSaveSize() const { return VarArgsRegSaveSize; }
- void setVarArgsRegSaveSize(unsigned s) { VarArgsRegSaveSize = s; }
-
- bool hasStackFrame() const { return HasStackFrame; }
- void setHasStackFrame(bool s) { HasStackFrame = s; }
-
- bool isLRSpilledForFarJump() const { return LRSpilledForFarJump; }
- void setLRIsSpilledForFarJump(bool s) { LRSpilledForFarJump = s; }
-
- // FIXME: Remove when register scavenger for Thumb is done.
- bool isR3LiveIn() const { return R3IsLiveIn; }
- void setR3IsLiveIn(bool l) { R3IsLiveIn = l; }
-
- unsigned getFramePtrSpillOffset() const { return FramePtrSpillOffset; }
- void setFramePtrSpillOffset(unsigned o) { FramePtrSpillOffset = o; }
-
- unsigned getGPRCalleeSavedArea1Offset() const { return GPRCS1Offset; }
- unsigned getGPRCalleeSavedArea2Offset() const { return GPRCS2Offset; }
- unsigned getDPRCalleeSavedAreaOffset() const { return DPRCSOffset; }
-
- void setGPRCalleeSavedArea1Offset(unsigned o) { GPRCS1Offset = o; }
- void setGPRCalleeSavedArea2Offset(unsigned o) { GPRCS2Offset = o; }
- void setDPRCalleeSavedAreaOffset(unsigned o) { DPRCSOffset = o; }
-
- unsigned getGPRCalleeSavedArea1Size() const { return GPRCS1Size; }
- unsigned getGPRCalleeSavedArea2Size() const { return GPRCS2Size; }
- unsigned getDPRCalleeSavedAreaSize() const { return DPRCSSize; }
-
- void setGPRCalleeSavedArea1Size(unsigned s) { GPRCS1Size = s; }
- void setGPRCalleeSavedArea2Size(unsigned s) { GPRCS2Size = s; }
- void setDPRCalleeSavedAreaSize(unsigned s) { DPRCSSize = s; }
-
- bool isGPRCalleeSavedArea1Frame(int fi) const {
- if (fi < 0 || fi >= (int)GPRCS1Frames.size())
- return false;
- return GPRCS1Frames[fi];
- }
- bool isGPRCalleeSavedArea2Frame(int fi) const {
- if (fi < 0 || fi >= (int)GPRCS2Frames.size())
- return false;
- return GPRCS2Frames[fi];
- }
- bool isDPRCalleeSavedAreaFrame(int fi) const {
- if (fi < 0 || fi >= (int)DPRCSFrames.size())
- return false;
- return DPRCSFrames[fi];
- }
-
- void addGPRCalleeSavedArea1Frame(int fi) {
- if (fi >= 0) {
- int Size = GPRCS1Frames.size();
- if (fi >= Size) {
- Size *= 2;
- if (fi >= Size)
- Size = fi+1;
- GPRCS1Frames.resize(Size);
- }
- GPRCS1Frames[fi] = true;
- }
- }
- void addGPRCalleeSavedArea2Frame(int fi) {
- if (fi >= 0) {
- int Size = GPRCS2Frames.size();
- if (fi >= Size) {
- Size *= 2;
- if (fi >= Size)
- Size = fi+1;
- GPRCS2Frames.resize(Size);
- }
- GPRCS2Frames[fi] = true;
- }
- }
- void addDPRCalleeSavedAreaFrame(int fi) {
- if (fi >= 0) {
- int Size = DPRCSFrames.size();
- if (fi >= Size) {
- Size *= 2;
- if (fi >= Size)
- Size = fi+1;
- DPRCSFrames.resize(Size);
- }
- DPRCSFrames[fi] = true;
- }
- }
-
- void setCSRegisterIsSpilled(unsigned Reg) {
- SpilledCSRegs.set(Reg);
- }
-
- bool isCSRegisterSpilled(unsigned Reg) {
- return SpilledCSRegs[Reg];
- }
-
- const BitVector &getSpilledCSRegisters() const {
- return SpilledCSRegs;
- }
-
- unsigned createJumpTableUId() {
- return JumpTableUId++;
- }
-};
-} // End llvm namespace
-
-#endif // ARMMACHINEFUNCTIONINFO_H
diff --git a/release_23/lib/Target/ARM/ARMRegisterInfo.cpp b/release_23/lib/Target/ARM/ARMRegisterInfo.cpp
deleted file mode 100644
index 7787f43ff616..000000000000
--- a/release_23/lib/Target/ARM/ARMRegisterInfo.cpp
+++ /dev/null
@@ -1,1387 +0,0 @@
-//===- ARMRegisterInfo.cpp - ARM Register Information -----------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains the ARM implementation of the TargetRegisterInfo class.
-//
-//===----------------------------------------------------------------------===//
-
-#include "ARM.h"
-#include "ARMAddressingModes.h"
-#include "ARMInstrInfo.h"
-#include "ARMMachineFunctionInfo.h"
-#include "ARMRegisterInfo.h"
-#include "ARMSubtarget.h"
-#include "llvm/Constants.h"
-#include "llvm/DerivedTypes.h"
-#include "llvm/CodeGen/MachineConstantPool.h"
-#include "llvm/CodeGen/MachineFrameInfo.h"
-#include "llvm/CodeGen/MachineFunction.h"
-#include "llvm/CodeGen/MachineInstrBuilder.h"
-#include "llvm/CodeGen/MachineLocation.h"
-#include "llvm/CodeGen/MachineRegisterInfo.h"
-#include "llvm/CodeGen/RegisterScavenging.h"
-#include "llvm/Target/TargetFrameInfo.h"
-#include "llvm/Target/TargetMachine.h"
-#include "llvm/Target/TargetOptions.h"
-#include "llvm/ADT/BitVector.h"
-#include "llvm/ADT/SmallVector.h"
-#include "llvm/ADT/STLExtras.h"
-#include "llvm/Support/CommandLine.h"
-#include <algorithm>
-using namespace llvm;
-
-static cl::opt<bool> ThumbRegScavenging("enable-thumb-reg-scavenging",
- cl::Hidden,
- cl::desc("Enable register scavenging on Thumb"));
-
-unsigned ARMRegisterInfo::getRegisterNumbering(unsigned RegEnum) {
- using namespace ARM;
- switch (RegEnum) {
- case R0: case S0: case D0: return 0;
- case R1: case S1: case D1: return 1;
- case R2: case S2: case D2: return 2;
- case R3: case S3: case D3: return 3;
- case R4: case S4: case D4: return 4;
- case R5: case S5: case D5: return 5;
- case R6: case S6: case D6: return 6;
- case R7: case S7: case D7: return 7;
- case R8: case S8: case D8: return 8;
- case R9: case S9: case D9: return 9;
- case R10: case S10: case D10: return 10;
- case R11: case S11: case D11: return 11;
- case R12: case S12: case D12: return 12;
- case SP: case S13: case D13: return 13;
- case LR: case S14: case D14: return 14;
- case PC: case S15: case D15: return 15;
- case S16: return 16;
- case S17: return 17;
- case S18: return 18;
- case S19: return 19;
- case S20: return 20;
- case S21: return 21;
- case S22: return 22;
- case S23: return 23;
- case S24: return 24;
- case S25: return 25;
- case S26: return 26;
- case S27: return 27;
- case S28: return 28;
- case S29: return 29;
- case S30: return 30;
- case S31: return 31;
- default:
- assert(0 && "Unknown ARM register!");
- abort();
- }
-}
-
-ARMRegisterInfo::ARMRegisterInfo(const TargetInstrInfo &tii,
- const ARMSubtarget &sti)
- : ARMGenRegisterInfo(ARM::ADJCALLSTACKDOWN, ARM::ADJCALLSTACKUP),
- TII(tii), STI(sti),
- FramePtr((STI.useThumbBacktraces() || STI.isThumb()) ? ARM::R7 : ARM::R11) {
-}
-
-static inline
-const MachineInstrBuilder &AddDefaultPred(const MachineInstrBuilder &MIB) {
- return MIB.addImm((int64_t)ARMCC::AL).addReg(0);
-}
-
-static inline
-const MachineInstrBuilder &AddDefaultCC(const MachineInstrBuilder &MIB) {
- return MIB.addReg(0);
-}
-
-/// emitLoadConstPool - Emits a load from constpool to materialize the
-/// specified immediate.
-void ARMRegisterInfo::emitLoadConstPool(MachineBasicBlock &MBB,
- MachineBasicBlock::iterator &MBBI,
- unsigned DestReg, int Val,
- unsigned Pred, unsigned PredReg,
- const TargetInstrInfo *TII,
- bool isThumb) const {
- MachineFunction &MF = *MBB.getParent();
- MachineConstantPool *ConstantPool = MF.getConstantPool();
- Constant *C = ConstantInt::get(Type::Int32Ty, Val);
- unsigned Idx = ConstantPool->getConstantPoolIndex(C, 2);
- if (isThumb)
- BuildMI(MBB, MBBI, TII->get(ARM::tLDRcp),DestReg).addConstantPoolIndex(Idx);
- else
- BuildMI(MBB, MBBI, TII->get(ARM::LDRcp), DestReg).addConstantPoolIndex(Idx)
- .addReg(0).addImm(0).addImm(Pred).addReg(PredReg);
-}
-
-/// isLowRegister - Returns true if the register is low register r0-r7.
-///
-bool ARMRegisterInfo::isLowRegister(unsigned Reg) const {
- using namespace ARM;
- switch (Reg) {
- case R0: case R1: case R2: case R3:
- case R4: case R5: case R6: case R7:
- return true;
- default:
- return false;
- }
-}
-
-const unsigned*
-ARMRegisterInfo::getCalleeSavedRegs(const MachineFunction *MF) const {
- static const unsigned CalleeSavedRegs[] = {
- ARM::LR, ARM::R11, ARM::R10, ARM::R9, ARM::R8,
- ARM::R7, ARM::R6, ARM::R5, ARM::R4,
-
- ARM::D15, ARM::D14, ARM::D13, ARM::D12,
- ARM::D11, ARM::D10, ARM::D9, ARM::D8,
- 0
- };
-
- static const unsigned DarwinCalleeSavedRegs[] = {
- ARM::LR, ARM::R7, ARM::R6, ARM::R5, ARM::R4,
- ARM::R11, ARM::R10, ARM::R9, ARM::R8,
-
- ARM::D15, ARM::D14, ARM::D13, ARM::D12,
- ARM::D11, ARM::D10, ARM::D9, ARM::D8,
- 0
- };
- return STI.isTargetDarwin() ? DarwinCalleeSavedRegs : CalleeSavedRegs;
-}
-
-const TargetRegisterClass* const *
-ARMRegisterInfo::getCalleeSavedRegClasses(const MachineFunction *MF) const {
- static const TargetRegisterClass * const CalleeSavedRegClasses[] = {
- &ARM::GPRRegClass, &ARM::GPRRegClass, &ARM::GPRRegClass,
- &ARM::GPRRegClass, &ARM::GPRRegClass, &ARM::GPRRegClass,
- &ARM::GPRRegClass, &ARM::GPRRegClass, &ARM::GPRRegClass,
-
- &ARM::DPRRegClass, &ARM::DPRRegClass, &ARM::DPRRegClass, &ARM::DPRRegClass,
- &ARM::DPRRegClass, &ARM::DPRRegClass, &ARM::DPRRegClass, &ARM::DPRRegClass,
- 0
- };
- return CalleeSavedRegClasses;
-}
-
-BitVector ARMRegisterInfo::getReservedRegs(const MachineFunction &MF) const {
- // FIXME: avoid re-calculating this everytime.
- BitVector Reserved(getNumRegs());
- Reserved.set(ARM::SP);
- Reserved.set(ARM::PC);
- if (STI.isTargetDarwin() || hasFP(MF))
- Reserved.set(FramePtr);
- // Some targets reserve R9.
- if (STI.isR9Reserved())
- Reserved.set(ARM::R9);
- return Reserved;
-}
-
-bool
-ARMRegisterInfo::isReservedReg(const MachineFunction &MF, unsigned Reg) const {
- switch (Reg) {
- default: break;
- case ARM::SP:
- case ARM::PC:
- return true;
- case ARM::R7:
- case ARM::R11:
- if (FramePtr == Reg && (STI.isTargetDarwin() || hasFP(MF)))
- return true;
- break;
- case ARM::R9:
- return STI.isR9Reserved();
- }
-
- return false;
-}
-
-bool
-ARMRegisterInfo::requiresRegisterScavenging(const MachineFunction &MF) const {
- const ARMFunctionInfo *AFI = MF.getInfo<ARMFunctionInfo>();
- return ThumbRegScavenging || !AFI->isThumbFunction();
-}
-
-/// hasFP - Return true if the specified function should have a dedicated frame
-/// pointer register. This is true if the function has variable sized allocas
-/// or if frame pointer elimination is disabled.
-///
-bool ARMRegisterInfo::hasFP(const MachineFunction &MF) const {
- return NoFramePointerElim || MF.getFrameInfo()->hasVarSizedObjects();
-}
-
-// hasReservedCallFrame - Under normal circumstances, when a frame pointer is
-// not required, we reserve argument space for call sites in the function
-// immediately on entry to the current function. This eliminates the need for
-// add/sub sp brackets around call sites. Returns true if the call frame is
-// included as part of the stack frame.
-bool ARMRegisterInfo::hasReservedCallFrame(MachineFunction &MF) const {
- const MachineFrameInfo *FFI = MF.getFrameInfo();
- unsigned CFSize = FFI->getMaxCallFrameSize();
- ARMFunctionInfo *AFI = MF.getInfo<ARMFunctionInfo>();
- // It's not always a good idea to include the call frame as part of the
- // stack frame. ARM (especially Thumb) has small immediate offset to
- // address the stack frame. So a large call frame can cause poor codegen
- // and may even makes it impossible to scavenge a register.
- if (AFI->isThumbFunction()) {
- if (CFSize >= ((1 << 8) - 1) * 4 / 2) // Half of imm8 * 4
- return false;
- } else {
- if (CFSize >= ((1 << 12) - 1) / 2) // Half of imm12
- return false;
- }
- return !MF.getFrameInfo()->hasVarSizedObjects();
-}
-
-/// emitARMRegPlusImmediate - Emits a series of instructions to materialize
-/// a destreg = basereg + immediate in ARM code.
-static
-void emitARMRegPlusImmediate(MachineBasicBlock &MBB,
- MachineBasicBlock::iterator &MBBI,
- unsigned DestReg, unsigned BaseReg, int NumBytes,
- ARMCC::CondCodes Pred, unsigned PredReg,
- const TargetInstrInfo &TII) {
- bool isSub = NumBytes < 0;
- if (isSub) NumBytes = -NumBytes;
-
- while (NumBytes) {
- unsigned RotAmt = ARM_AM::getSOImmValRotate(NumBytes);
- unsigned ThisVal = NumBytes & ARM_AM::rotr32(0xFF, RotAmt);
- assert(ThisVal && "Didn't extract field correctly");
-
- // We will handle these bits from offset, clear them.
- NumBytes &= ~ThisVal;
-
- // Get the properly encoded SOImmVal field.
- int SOImmVal = ARM_AM::getSOImmVal(ThisVal);
- assert(SOImmVal != -1 && "Bit extraction didn't work?");
-
- // Build the new ADD / SUB.
- BuildMI(MBB, MBBI, TII.get(isSub ? ARM::SUBri : ARM::ADDri), DestReg)
- .addReg(BaseReg, false, false, true).addImm(SOImmVal)
- .addImm((unsigned)Pred).addReg(PredReg).addReg(0);
- BaseReg = DestReg;
- }
-}
-
-/// calcNumMI - Returns the number of instructions required to materialize
-/// the specific add / sub r, c instruction.
-static unsigned calcNumMI(int Opc, int ExtraOpc, unsigned Bytes,
- unsigned NumBits, unsigned Scale) {
- unsigned NumMIs = 0;
- unsigned Chunk = ((1 << NumBits) - 1) * Scale;
-
- if (Opc == ARM::tADDrSPi) {
- unsigned ThisVal = (Bytes > Chunk) ? Chunk : Bytes;
- Bytes -= ThisVal;
- NumMIs++;
- NumBits = 8;
- Scale = 1; // Followed by a number of tADDi8.
- Chunk = ((1 << NumBits) - 1) * Scale;
- }
-
- NumMIs += Bytes / Chunk;
- if ((Bytes % Chunk) != 0)
- NumMIs++;
- if (ExtraOpc)
- NumMIs++;
- return NumMIs;
-}
-
-/// emitThumbRegPlusImmInReg - Emits a series of instructions to materialize
-/// a destreg = basereg + immediate in Thumb code. Materialize the immediate
-/// in a register using mov / mvn sequences or load the immediate from a
-/// constpool entry.
-static
-void emitThumbRegPlusImmInReg(MachineBasicBlock &MBB,
- MachineBasicBlock::iterator &MBBI,
- unsigned DestReg, unsigned BaseReg,
- int NumBytes, bool CanChangeCC,
- const TargetInstrInfo &TII,
- const ARMRegisterInfo& MRI) {
- bool isHigh = !MRI.isLowRegister(DestReg) ||
- (BaseReg != 0 && !MRI.isLowRegister(BaseReg));
- bool isSub = false;
- // Subtract doesn't have high register version. Load the negative value
- // if either base or dest register is a high register. Also, if do not
- // issue sub as part of the sequence if condition register is to be
- // preserved.
- if (NumBytes < 0 && !isHigh && CanChangeCC) {
- isSub = true;
- NumBytes = -NumBytes;
- }
- unsigned LdReg = DestReg;
- if (DestReg == ARM::SP) {
- assert(BaseReg == ARM::SP && "Unexpected!");
- LdReg = ARM::R3;
- BuildMI(MBB, MBBI, TII.get(ARM::tMOVr), ARM::R12)
- .addReg(ARM::R3, false, false, true);
- }
-
- if (NumBytes <= 255 && NumBytes >= 0)
- BuildMI(MBB, MBBI, TII.get(ARM::tMOVi8), LdReg).addImm(NumBytes);
- else if (NumBytes < 0 && NumBytes >= -255) {
- BuildMI(MBB, MBBI, TII.get(ARM::tMOVi8), LdReg).addImm(NumBytes);
- BuildMI(MBB, MBBI, TII.get(ARM::tNEG), LdReg)
- .addReg(LdReg, false, false, true);
- } else
- MRI.emitLoadConstPool(MBB, MBBI, LdReg, NumBytes, ARMCC::AL, 0,&TII,true);
-
- // Emit add / sub.
- int Opc = (isSub) ? ARM::tSUBrr : (isHigh ? ARM::tADDhirr : ARM::tADDrr);
- const MachineInstrBuilder MIB = BuildMI(MBB, MBBI, TII.get(Opc), DestReg);
- if (DestReg == ARM::SP || isSub)
- MIB.addReg(BaseReg).addReg(LdReg, false, false, true);
- else
- MIB.addReg(LdReg).addReg(BaseReg, false, false, true);
- if (DestReg == ARM::SP)
- BuildMI(MBB, MBBI, TII.get(ARM::tMOVr), ARM::R3)
- .addReg(ARM::R12, false, false, true);
-}
-
-/// emitThumbRegPlusImmediate - Emits a series of instructions to materialize
-/// a destreg = basereg + immediate in Thumb code.
-static
-void emitThumbRegPlusImmediate(MachineBasicBlock &MBB,
- MachineBasicBlock::iterator &MBBI,
- unsigned DestReg, unsigned BaseReg,
- int NumBytes, const TargetInstrInfo &TII,
- const ARMRegisterInfo& MRI) {
- bool isSub = NumBytes < 0;
- unsigned Bytes = (unsigned)NumBytes;
- if (isSub) Bytes = -NumBytes;
- bool isMul4 = (Bytes & 3) == 0;
- bool isTwoAddr = false;
- bool DstNotEqBase = false;
- unsigned NumBits = 1;
- unsigned Scale = 1;
- int Opc = 0;
- int ExtraOpc = 0;
-
- if (DestReg == BaseReg && BaseReg == ARM::SP) {
- assert(isMul4 && "Thumb sp inc / dec size must be multiple of 4!");
- NumBits = 7;
- Scale = 4;
- Opc = isSub ? ARM::tSUBspi : ARM::tADDspi;
- isTwoAddr = true;
- } else if (!isSub && BaseReg == ARM::SP) {
- // r1 = add sp, 403
- // =>
- // r1 = add sp, 100 * 4
- // r1 = add r1, 3
- if (!isMul4) {
- Bytes &= ~3;
- ExtraOpc = ARM::tADDi3;
- }
- NumBits = 8;
- Scale = 4;
- Opc = ARM::tADDrSPi;
- } else {
- // sp = sub sp, c
- // r1 = sub sp, c
- // r8 = sub sp, c
- if (DestReg != BaseReg)
- DstNotEqBase = true;
- NumBits = 8;
- Opc = isSub ? ARM::tSUBi8 : ARM::tADDi8;
- isTwoAddr = true;
- }
-
- unsigned NumMIs = calcNumMI(Opc, ExtraOpc, Bytes, NumBits, Scale);
- unsigned Threshold = (DestReg == ARM::SP) ? 3 : 2;
- if (NumMIs > Threshold) {
- // This will expand into too many instructions. Load the immediate from a
- // constpool entry.
- emitThumbRegPlusImmInReg(MBB, MBBI, DestReg, BaseReg, NumBytes, true, TII, MRI);
- return;
- }
-
- if (DstNotEqBase) {
- if (MRI.isLowRegister(DestReg) && MRI.isLowRegister(BaseReg)) {
- // If both are low registers, emit DestReg = add BaseReg, max(Imm, 7)
- unsigned Chunk = (1 << 3) - 1;
- unsigned ThisVal = (Bytes > Chunk) ? Chunk : Bytes;
- Bytes -= ThisVal;
- BuildMI(MBB, MBBI, TII.get(isSub ? ARM::tSUBi3 : ARM::tADDi3), DestReg)
- .addReg(BaseReg, false, false, true).addImm(ThisVal);
- } else {
- BuildMI(MBB, MBBI, TII.get(ARM::tMOVr), DestReg)
- .addReg(BaseReg, false, false, true);
- }
- BaseReg = DestReg;
- }
-
- unsigned Chunk = ((1 << NumBits) - 1) * Scale;
- while (Bytes) {
- unsigned ThisVal = (Bytes > Chunk) ? Chunk : Bytes;
- Bytes -= ThisVal;
- ThisVal /= Scale;
- // Build the new tADD / tSUB.
- if (isTwoAddr)
- BuildMI(MBB, MBBI, TII.get(Opc), DestReg).addReg(DestReg).addImm(ThisVal);
- else {
- bool isKill = BaseReg != ARM::SP;
- BuildMI(MBB, MBBI, TII.get(Opc), DestReg)
- .addReg(BaseReg, false, false, isKill).addImm(ThisVal);
- BaseReg = DestReg;
-
- if (Opc == ARM::tADDrSPi) {
- // r4 = add sp, imm
- // r4 = add r4, imm
- // ...
- NumBits = 8;
- Scale = 1;
- Chunk = ((1 << NumBits) - 1) * Scale;
- Opc = isSub ? ARM::tSUBi8 : ARM::tADDi8;
- isTwoAddr = true;
- }
- }
- }
-
- if (ExtraOpc)
- BuildMI(MBB, MBBI, TII.get(ExtraOpc), DestReg)
- .addReg(DestReg, false, false, true)
- .addImm(((unsigned)NumBytes) & 3);
-}
-
-static
-void emitSPUpdate(MachineBasicBlock &MBB, MachineBasicBlock::iterator &MBBI,
- int NumBytes, ARMCC::CondCodes Pred, unsigned PredReg,
- bool isThumb, const TargetInstrInfo &TII,
- const ARMRegisterInfo& MRI) {
- if (isThumb)
- emitThumbRegPlusImmediate(MBB, MBBI, ARM::SP, ARM::SP, NumBytes, TII, MRI);
- else
- emitARMRegPlusImmediate(MBB, MBBI, ARM::SP, ARM::SP, NumBytes,
- Pred, PredReg, TII);
-}
-
-void ARMRegisterInfo::
-eliminateCallFramePseudoInstr(MachineFunction &MF, MachineBasicBlock &MBB,
- MachineBasicBlock::iterator I) const {
- if (!hasReservedCallFrame(MF)) {
- // If we have alloca, convert as follows:
- // ADJCALLSTACKDOWN -> sub, sp, sp, amount
- // ADJCALLSTACKUP -> add, sp, sp, amount
- MachineInstr *Old = I;
- unsigned Amount = Old->getOperand(0).getImm();
- if (Amount != 0) {
- ARMFunctionInfo *AFI = MF.getInfo<ARMFunctionInfo>();
- // We need to keep the stack aligned properly. To do this, we round the
- // amount of space needed for the outgoing arguments up to the next
- // alignment boundary.
- unsigned Align = MF.getTarget().getFrameInfo()->getStackAlignment();
- Amount = (Amount+Align-1)/Align*Align;
-
- // Replace the pseudo instruction with a new instruction...
- unsigned Opc = Old->getOpcode();
- bool isThumb = AFI->isThumbFunction();
- ARMCC::CondCodes Pred = isThumb
- ? ARMCC::AL : (ARMCC::CondCodes)Old->getOperand(1).getImm();
- if (Opc == ARM::ADJCALLSTACKDOWN || Opc == ARM::tADJCALLSTACKDOWN) {
- // Note: PredReg is operand 2 for ADJCALLSTACKDOWN.
- unsigned PredReg = isThumb ? 0 : Old->getOperand(2).getReg();
- emitSPUpdate(MBB, I, -Amount, Pred, PredReg, isThumb, TII, *this);
- } else {
- // Note: PredReg is operand 3 for ADJCALLSTACKUP.
- unsigned PredReg = isThumb ? 0 : Old->getOperand(3).getReg();
- assert(Opc == ARM::ADJCALLSTACKUP || Opc == ARM::tADJCALLSTACKUP);
- emitSPUpdate(MBB, I, Amount, Pred, PredReg, isThumb, TII, *this);
- }
- }
- }
- MBB.erase(I);
-}
-
-/// emitThumbConstant - Emit a series of instructions to materialize a
-/// constant.
-static void emitThumbConstant(MachineBasicBlock &MBB,
- MachineBasicBlock::iterator &MBBI,
- unsigned DestReg, int Imm,
- const TargetInstrInfo &TII,
- const ARMRegisterInfo& MRI) {
- bool isSub = Imm < 0;
- if (isSub) Imm = -Imm;
-
- int Chunk = (1 << 8) - 1;
- int ThisVal = (Imm > Chunk) ? Chunk : Imm;
- Imm -= ThisVal;
- BuildMI(MBB, MBBI, TII.get(ARM::tMOVi8), DestReg).addImm(ThisVal);
- if (Imm > 0)
- emitThumbRegPlusImmediate(MBB, MBBI, DestReg, DestReg, Imm, TII, MRI);
- if (isSub)
- BuildMI(MBB, MBBI, TII.get(ARM::tNEG), DestReg)
- .addReg(DestReg, false, false, true);
-}
-
-/// findScratchRegister - Find a 'free' ARM register. If register scavenger
-/// is not being used, R12 is available. Otherwise, try for a call-clobbered
-/// register first and then a spilled callee-saved register if that fails.
-static
-unsigned findScratchRegister(RegScavenger *RS, const TargetRegisterClass *RC,
- ARMFunctionInfo *AFI) {
- unsigned Reg = RS ? RS->FindUnusedReg(RC, true) : (unsigned) ARM::R12;
- if (Reg == 0)
- // Try a already spilled CS register.
- Reg = RS->FindUnusedReg(RC, AFI->getSpilledCSRegisters());
-
- return Reg;
-}
-
-void ARMRegisterInfo::eliminateFrameIndex(MachineBasicBlock::iterator II,
- int SPAdj, RegScavenger *RS) const{
- unsigned i = 0;
- MachineInstr &MI = *II;
- MachineBasicBlock &MBB = *MI.getParent();
- MachineFunction &MF = *MBB.getParent();
- ARMFunctionInfo *AFI = MF.getInfo<ARMFunctionInfo>();
- bool isThumb = AFI->isThumbFunction();
-
- while (!MI.getOperand(i).isFrameIndex()) {
- ++i;
- assert(i < MI.getNumOperands() && "Instr doesn't have FrameIndex operand!");
- }
-
- unsigned FrameReg = ARM::SP;
- int FrameIndex = MI.getOperand(i).getIndex();
- int Offset = MF.getFrameInfo()->getObjectOffset(FrameIndex) +
- MF.getFrameInfo()->getStackSize() + SPAdj;
-
- if (AFI->isGPRCalleeSavedArea1Frame(FrameIndex))
- Offset -= AFI->getGPRCalleeSavedArea1Offset();
- else if (AFI->isGPRCalleeSavedArea2Frame(FrameIndex))
- Offset -= AFI->getGPRCalleeSavedArea2Offset();
- else if (AFI->isDPRCalleeSavedAreaFrame(FrameIndex))
- Offset -= AFI->getDPRCalleeSavedAreaOffset();
- else if (hasFP(MF)) {
- assert(SPAdj == 0 && "Unexpected");
- // There is alloca()'s in this function, must reference off the frame
- // pointer instead.
- FrameReg = getFrameRegister(MF);
- Offset -= AFI->getFramePtrSpillOffset();
- }
-
- unsigned Opcode = MI.getOpcode();
- const TargetInstrDesc &Desc = MI.getDesc();
- unsigned AddrMode = (Desc.TSFlags & ARMII::AddrModeMask);
- bool isSub = false;
-
- if (Opcode == ARM::ADDri) {
- Offset += MI.getOperand(i+1).getImm();
- if (Offset == 0) {
- // Turn it into a move.
- MI.setDesc(TII.get(ARM::MOVr));
- MI.getOperand(i).ChangeToRegister(FrameReg, false);
- MI.RemoveOperand(i+1);
- return;
- } else if (Offset < 0) {
- Offset = -Offset;
- isSub = true;
- MI.setDesc(TII.get(ARM::SUBri));
- }
-
- // Common case: small offset, fits into instruction.
- int ImmedOffset = ARM_AM::getSOImmVal(Offset);
- if (ImmedOffset != -1) {
- // Replace the FrameIndex with sp / fp
- MI.getOperand(i).ChangeToRegister(FrameReg, false);
- MI.getOperand(i+1).ChangeToImmediate(ImmedOffset);
- return;
- }
-
- // Otherwise, we fallback to common code below to form the imm offset with
- // a sequence of ADDri instructions. First though, pull as much of the imm
- // into this ADDri as possible.
- unsigned RotAmt = ARM_AM::getSOImmValRotate(Offset);
- unsigned ThisImmVal = Offset & ARM_AM::rotr32(0xFF, RotAmt);
-
- // We will handle these bits from offset, clear them.
- Offset &= ~ThisImmVal;
-
- // Get the properly encoded SOImmVal field.
- int ThisSOImmVal = ARM_AM::getSOImmVal(ThisImmVal);
- assert(ThisSOImmVal != -1 && "Bit extraction didn't work?");
- MI.getOperand(i+1).ChangeToImmediate(ThisSOImmVal);
- } else if (Opcode == ARM::tADDrSPi) {
- Offset += MI.getOperand(i+1).getImm();
-
- // Can't use tADDrSPi if it's based off the frame pointer.
- unsigned NumBits = 0;
- unsigned Scale = 1;
- if (FrameReg != ARM::SP) {
- Opcode = ARM::tADDi3;
- MI.setDesc(TII.get(ARM::tADDi3));
- NumBits = 3;
- } else {
- NumBits = 8;
- Scale = 4;
- assert((Offset & 3) == 0 &&
- "Thumb add/sub sp, #imm immediate must be multiple of 4!");
- }
-
- if (Offset == 0) {
- // Turn it into a move.
- MI.setDesc(TII.get(ARM::tMOVr));
- MI.getOperand(i).ChangeToRegister(FrameReg, false);
- MI.RemoveOperand(i+1);
- return;
- }
-
- // Common case: small offset, fits into instruction.
- unsigned Mask = (1 << NumBits) - 1;
- if (((Offset / Scale) & ~Mask) == 0) {
- // Replace the FrameIndex with sp / fp
- MI.getOperand(i).ChangeToRegister(FrameReg, false);
- MI.getOperand(i+1).ChangeToImmediate(Offset / Scale);
- return;
- }
-
- unsigned DestReg = MI.getOperand(0).getReg();
- unsigned Bytes = (Offset > 0) ? Offset : -Offset;
- unsigned NumMIs = calcNumMI(Opcode, 0, Bytes, NumBits, Scale);
- // MI would expand into a large number of instructions. Don't try to
- // simplify the immediate.
- if (NumMIs > 2) {
- emitThumbRegPlusImmediate(MBB, II, DestReg, FrameReg, Offset, TII, *this);
- MBB.erase(II);
- return;
- }
-
- if (Offset > 0) {
- // Translate r0 = add sp, imm to
- // r0 = add sp, 255*4
- // r0 = add r0, (imm - 255*4)
- MI.getOperand(i).ChangeToRegister(FrameReg, false);
- MI.getOperand(i+1).ChangeToImmediate(Mask);
- Offset = (Offset - Mask * Scale);
- MachineBasicBlock::iterator NII = next(II);
- emitThumbRegPlusImmediate(MBB, NII, DestReg, DestReg, Offset, TII, *this);
- } else {
- // Translate r0 = add sp, -imm to
- // r0 = -imm (this is then translated into a series of instructons)
- // r0 = add r0, sp
- emitThumbConstant(MBB, II, DestReg, Offset, TII, *this);
- MI.setDesc(TII.get(ARM::tADDhirr));
- MI.getOperand(i).ChangeToRegister(DestReg, false, false, true);
- MI.getOperand(i+1).ChangeToRegister(FrameReg, false);
- }
- return;
- } else {
- unsigned ImmIdx = 0;
- int InstrOffs = 0;
- unsigned NumBits = 0;
- unsigned Scale = 1;
- switch (AddrMode) {
- case ARMII::AddrMode2: {
- ImmIdx = i+2;
- InstrOffs = ARM_AM::getAM2Offset(MI.getOperand(ImmIdx).getImm());
- if (ARM_AM::getAM2Op(MI.getOperand(ImmIdx).getImm()) == ARM_AM::sub)
- InstrOffs *= -1;
- NumBits = 12;
- break;
- }
- case ARMII::AddrMode3: {
- ImmIdx = i+2;
- InstrOffs = ARM_AM::getAM3Offset(MI.getOperand(ImmIdx).getImm());
- if (ARM_AM::getAM3Op(MI.getOperand(ImmIdx).getImm()) == ARM_AM::sub)
- InstrOffs *= -1;
- NumBits = 8;
- break;
- }
- case ARMII::AddrMode5: {
- ImmIdx = i+1;
- InstrOffs = ARM_AM::getAM5Offset(MI.getOperand(ImmIdx).getImm());
- if (ARM_AM::getAM5Op(MI.getOperand(ImmIdx).getImm()) == ARM_AM::sub)
- InstrOffs *= -1;
- NumBits = 8;
- Scale = 4;
- break;
- }
- case ARMII::AddrModeTs: {
- ImmIdx = i+1;
- InstrOffs = MI.getOperand(ImmIdx).getImm();
- NumBits = (FrameReg == ARM::SP) ? 8 : 5;
- Scale = 4;
- break;
- }
- default:
- assert(0 && "Unsupported addressing mode!");
- abort();
- break;
- }
-
- Offset += InstrOffs * Scale;
- assert((Offset & (Scale-1)) == 0 && "Can't encode this offset!");
- if (Offset < 0 && !isThumb) {
- Offset = -Offset;
- isSub = true;
- }
-
- // Common case: small offset, fits into instruction.
- MachineOperand &ImmOp = MI.getOperand(ImmIdx);
- int ImmedOffset = Offset / Scale;
- unsigned Mask = (1 << NumBits) - 1;
- if ((unsigned)Offset <= Mask * Scale) {
- // Replace the FrameIndex with sp
- MI.getOperand(i).ChangeToRegister(FrameReg, false);
- if (isSub)
- ImmedOffset |= 1 << NumBits;
- ImmOp.ChangeToImmediate(ImmedOffset);
- return;
- }
-
- bool isThumSpillRestore = Opcode == ARM::tRestore || Opcode == ARM::tSpill;
- if (AddrMode == ARMII::AddrModeTs) {
- // Thumb tLDRspi, tSTRspi. These will change to instructions that use
- // a different base register.
- NumBits = 5;
- Mask = (1 << NumBits) - 1;
- }
- // If this is a thumb spill / restore, we will be using a constpool load to
- // materialize the offset.
- if (AddrMode == ARMII::AddrModeTs && isThumSpillRestore)
- ImmOp.ChangeToImmediate(0);
- else {
- // Otherwise, it didn't fit. Pull in what we can to simplify the immed.
- ImmedOffset = ImmedOffset & Mask;
- if (isSub)
- ImmedOffset |= 1 << NumBits;
- ImmOp.ChangeToImmediate(ImmedOffset);
- Offset &= ~(Mask*Scale);
- }
- }
-
- // If we get here, the immediate doesn't fit into the instruction. We folded
- // as much as possible above, handle the rest, providing a register that is
- // SP+LargeImm.
- assert(Offset && "This code isn't needed if offset already handled!");
-
- if (isThumb) {
- if (Desc.isSimpleLoad()) {
- // Use the destination register to materialize sp + offset.
- unsigned TmpReg = MI.getOperand(0).getReg();
- bool UseRR = false;
- if (Opcode == ARM::tRestore) {
- if (FrameReg == ARM::SP)
- emitThumbRegPlusImmInReg(MBB, II, TmpReg, FrameReg,
- Offset, false, TII, *this);
- else {
- emitLoadConstPool(MBB, II, TmpReg, Offset, ARMCC::AL, 0, &TII, true);
- UseRR = true;
- }
- } else
- emitThumbRegPlusImmediate(MBB, II, TmpReg, FrameReg, Offset, TII, *this);
- MI.setDesc(TII.get(ARM::tLDR));
- MI.getOperand(i).ChangeToRegister(TmpReg, false, false, true);
- if (UseRR)
- // Use [reg, reg] addrmode.
- MI.addOperand(MachineOperand::CreateReg(FrameReg, false));
- else // tLDR has an extra register operand.
- MI.addOperand(MachineOperand::CreateReg(0, false));
- } else if (Desc.mayStore()) {
- // FIXME! This is horrific!!! We need register scavenging.
- // Our temporary workaround has marked r3 unavailable. Of course, r3 is
- // also a ABI register so it's possible that is is the register that is
- // being storing here. If that's the case, we do the following:
- // r12 = r2
- // Use r2 to materialize sp + offset
- // str r3, r2
- // r2 = r12
- unsigned ValReg = MI.getOperand(0).getReg();
- unsigned TmpReg = ARM::R3;
- bool UseRR = false;
- if (ValReg == ARM::R3) {
- BuildMI(MBB, II, TII.get(ARM::tMOVr), ARM::R12)
- .addReg(ARM::R2, false, false, true);
- TmpReg = ARM::R2;
- }
- if (TmpReg == ARM::R3 && AFI->isR3LiveIn())
- BuildMI(MBB, II, TII.get(ARM::tMOVr), ARM::R12)
- .addReg(ARM::R3, false, false, true);
- if (Opcode == ARM::tSpill) {
- if (FrameReg == ARM::SP)
- emitThumbRegPlusImmInReg(MBB, II, TmpReg, FrameReg,
- Offset, false, TII, *this);
- else {
- emitLoadConstPool(MBB, II, TmpReg, Offset, ARMCC::AL, 0, &TII, true);
- UseRR = true;
- }
- } else
- emitThumbRegPlusImmediate(MBB, II, TmpReg, FrameReg, Offset, TII, *this);
- MI.setDesc(TII.get(ARM::tSTR));
- MI.getOperand(i).ChangeToRegister(TmpReg, false, false, true);
- if (UseRR) // Use [reg, reg] addrmode.
- MI.addOperand(MachineOperand::CreateReg(FrameReg, false));
- else // tSTR has an extra register operand.
- MI.addOperand(MachineOperand::CreateReg(0, false));
-
- MachineBasicBlock::iterator NII = next(II);
- if (ValReg == ARM::R3)
- BuildMI(MBB, NII, TII.get(ARM::tMOVr), ARM::R2)
- .addReg(ARM::R12, false, false, true);
- if (TmpReg == ARM::R3 && AFI->isR3LiveIn())
- BuildMI(MBB, NII, TII.get(ARM::tMOVr), ARM::R3)
- .addReg(ARM::R12, false, false, true);
- } else
- assert(false && "Unexpected opcode!");
- } else {
- // Insert a set of r12 with the full address: r12 = sp + offset
- // If the offset we have is too large to fit into the instruction, we need
- // to form it with a series of ADDri's. Do this by taking 8-bit chunks
- // out of 'Offset'.
- unsigned ScratchReg = findScratchRegister(RS, &ARM::GPRRegClass, AFI);
- if (ScratchReg == 0)
- // No register is "free". Scavenge a register.
- ScratchReg = RS->scavengeRegister(&ARM::GPRRegClass, II, SPAdj);
- int PIdx = MI.findFirstPredOperandIdx();
- ARMCC::CondCodes Pred = (PIdx == -1)
- ? ARMCC::AL : (ARMCC::CondCodes)MI.getOperand(PIdx).getImm();
- unsigned PredReg = (PIdx == -1) ? 0 : MI.getOperand(PIdx+1).getReg();
- emitARMRegPlusImmediate(MBB, II, ScratchReg, FrameReg,
- isSub ? -Offset : Offset, Pred, PredReg, TII);
- MI.getOperand(i).ChangeToRegister(ScratchReg, false, false, true);
- }
-}
-
-static unsigned estimateStackSize(MachineFunction &MF, MachineFrameInfo *MFI) {
- const MachineFrameInfo *FFI = MF.getFrameInfo();
- int Offset = 0;
- for (int i = FFI->getObjectIndexBegin(); i != 0; ++i) {
- int FixedOff = -FFI->getObjectOffset(i);
- if (FixedOff > Offset) Offset = FixedOff;
- }
- for (unsigned i = 0, e = FFI->getObjectIndexEnd(); i != e; ++i) {
- if (FFI->isDeadObjectIndex(i))
- continue;
- Offset += FFI->getObjectSize(i);
- unsigned Align = FFI->getObjectAlignment(i);
- // Adjust to alignment boundary
- Offset = (Offset+Align-1)/Align*Align;
- }
- return (unsigned)Offset;
-}
-
-void
-ARMRegisterInfo::processFunctionBeforeCalleeSavedScan(MachineFunction &MF,
- RegScavenger *RS) const {
- // This tells PEI to spill the FP as if it is any other callee-save register
- // to take advantage the eliminateFrameIndex machinery. This also ensures it
- // is spilled in the order specified by getCalleeSavedRegs() to make it easier
- // to combine multiple loads / stores.
- bool CanEliminateFrame = true;
- bool CS1Spilled = false;
- bool LRSpilled = false;
- unsigned NumGPRSpills = 0;
- SmallVector<unsigned, 4> UnspilledCS1GPRs;
- SmallVector<unsigned, 4> UnspilledCS2GPRs;
- ARMFunctionInfo *AFI = MF.getInfo<ARMFunctionInfo>();
-
- // Don't spill FP if the frame can be eliminated. This is determined
- // by scanning the callee-save registers to see if any is used.
- const unsigned *CSRegs = getCalleeSavedRegs();
- const TargetRegisterClass* const *CSRegClasses = getCalleeSavedRegClasses();
- for (unsigned i = 0; CSRegs[i]; ++i) {
- unsigned Reg = CSRegs[i];
- bool Spilled = false;
- if (MF.getRegInfo().isPhysRegUsed(Reg)) {
- AFI->setCSRegisterIsSpilled(Reg);
- Spilled = true;
- CanEliminateFrame = false;
- } else {
- // Check alias registers too.
- for (const unsigned *Aliases = getAliasSet(Reg); *Aliases; ++Aliases) {
- if (MF.getRegInfo().isPhysRegUsed(*Aliases)) {
- Spilled = true;
- CanEliminateFrame = false;
- }
- }
- }
-
- if (CSRegClasses[i] == &ARM::GPRRegClass) {
- if (Spilled) {
- NumGPRSpills++;
-
- if (!STI.isTargetDarwin()) {
- if (Reg == ARM::LR)
- LRSpilled = true;
- CS1Spilled = true;
- continue;
- }
-
- // Keep track if LR and any of R4, R5, R6, and R7 is spilled.
- switch (Reg) {
- case ARM::LR:
- LRSpilled = true;
- // Fallthrough
- case ARM::R4:
- case ARM::R5:
- case ARM::R6:
- case ARM::R7:
- CS1Spilled = true;
- break;
- default:
- break;
- }
- } else {
- if (!STI.isTargetDarwin()) {
- UnspilledCS1GPRs.push_back(Reg);
- continue;
- }
-
- switch (Reg) {
- case ARM::R4:
- case ARM::R5:
- case ARM::R6:
- case ARM::R7:
- case ARM::LR:
- UnspilledCS1GPRs.push_back(Reg);
- break;
- default:
- UnspilledCS2GPRs.push_back(Reg);
- break;
- }
- }
- }
- }
-
- bool ForceLRSpill = false;
- if (!LRSpilled && AFI->isThumbFunction()) {
- unsigned FnSize = TII.GetFunctionSizeInBytes(MF);
- // Force LR to be spilled if the Thumb function size is > 2048. This enables
- // use of BL to implement far jump. If it turns out that it's not needed
- // then the branch fix up path will undo it.
- if (FnSize >= (1 << 11)) {
- CanEliminateFrame = false;
- ForceLRSpill = true;
- }
- }
-
- bool ExtraCSSpill = false;
- if (!CanEliminateFrame || hasFP(MF)) {
- AFI->setHasStackFrame(true);
-
- // If LR is not spilled, but at least one of R4, R5, R6, and R7 is spilled.
- // Spill LR as well so we can fold BX_RET to the registers restore (LDM).
- if (!LRSpilled && CS1Spilled) {
- MF.getRegInfo().setPhysRegUsed(ARM::LR);
- AFI->setCSRegisterIsSpilled(ARM::LR);
- NumGPRSpills++;
- UnspilledCS1GPRs.erase(std::find(UnspilledCS1GPRs.begin(),
- UnspilledCS1GPRs.end(), (unsigned)ARM::LR));
- ForceLRSpill = false;
- ExtraCSSpill = true;
- }
-
- // Darwin ABI requires FP to point to the stack slot that contains the
- // previous FP.
- if (STI.isTargetDarwin() || hasFP(MF)) {
- MF.getRegInfo().setPhysRegUsed(FramePtr);
- NumGPRSpills++;
- }
-
- // If stack and double are 8-byte aligned and we are spilling an odd number
- // of GPRs. Spill one extra callee save GPR so we won't have to pad between
- // the integer and double callee save areas.
- unsigned TargetAlign = MF.getTarget().getFrameInfo()->getStackAlignment();
- if (TargetAlign == 8 && (NumGPRSpills & 1)) {
- if (CS1Spilled && !UnspilledCS1GPRs.empty()) {
- for (unsigned i = 0, e = UnspilledCS1GPRs.size(); i != e; ++i) {
- unsigned Reg = UnspilledCS1GPRs[i];
- // Don't spiil high register if the function is thumb
- if (!AFI->isThumbFunction() || isLowRegister(Reg) || Reg == ARM::LR) {
- MF.getRegInfo().setPhysRegUsed(Reg);
- AFI->setCSRegisterIsSpilled(Reg);
- if (!isReservedReg(MF, Reg))
- ExtraCSSpill = true;
- break;
- }
- }
- } else if (!UnspilledCS2GPRs.empty() &&
- !AFI->isThumbFunction()) {
- unsigned Reg = UnspilledCS2GPRs.front();
- MF.getRegInfo().setPhysRegUsed(Reg);
- AFI->setCSRegisterIsSpilled(Reg);
- if (!isReservedReg(MF, Reg))
- ExtraCSSpill = true;
- }
- }
-
- // Estimate if we might need to scavenge a register at some point in order
- // to materialize a stack offset. If so, either spill one additiona
- // callee-saved register or reserve a special spill slot to facilitate
- // register scavenging.
- if (RS && !ExtraCSSpill && !AFI->isThumbFunction()) {
- MachineFrameInfo *MFI = MF.getFrameInfo();
- unsigned Size = estimateStackSize(MF, MFI);
- unsigned Limit = (1 << 12) - 1;
- for (MachineFunction::iterator BB = MF.begin(),E = MF.end();BB != E; ++BB)
- for (MachineBasicBlock::iterator I= BB->begin(); I != BB->end(); ++I) {
- for (unsigned i = 0, e = I->getNumOperands(); i != e; ++i)
- if (I->getOperand(i).isFrameIndex()) {
- unsigned Opcode = I->getOpcode();
- const TargetInstrDesc &Desc = TII.get(Opcode);
- unsigned AddrMode = (Desc.TSFlags & ARMII::AddrModeMask);
- if (AddrMode == ARMII::AddrMode3) {
- Limit = (1 << 8) - 1;
- goto DoneEstimating;
- } else if (AddrMode == ARMII::AddrMode5) {
- unsigned ThisLimit = ((1 << 8) - 1) * 4;
- if (ThisLimit < Limit)
- Limit = ThisLimit;
- }
- }
- }
- DoneEstimating:
- if (Size >= Limit) {
- // If any non-reserved CS register isn't spilled, just spill one or two
- // extra. That should take care of it!
- unsigned NumExtras = TargetAlign / 4;
- SmallVector<unsigned, 2> Extras;
- while (NumExtras && !UnspilledCS1GPRs.empty()) {
- unsigned Reg = UnspilledCS1GPRs.back();
- UnspilledCS1GPRs.pop_back();
- if (!isReservedReg(MF, Reg)) {
- Extras.push_back(Reg);
- NumExtras--;
- }
- }
- while (NumExtras && !UnspilledCS2GPRs.empty()) {
- unsigned Reg = UnspilledCS2GPRs.back();
- UnspilledCS2GPRs.pop_back();
- if (!isReservedReg(MF, Reg)) {
- Extras.push_back(Reg);
- NumExtras--;
- }
- }
- if (Extras.size() && NumExtras == 0) {
- for (unsigned i = 0, e = Extras.size(); i != e; ++i) {
- MF.getRegInfo().setPhysRegUsed(Extras[i]);
- AFI->setCSRegisterIsSpilled(Extras[i]);
- }
- } else {
- // Reserve a slot closest to SP or frame pointer.
- const TargetRegisterClass *RC = &ARM::GPRRegClass;
- RS->setScavengingFrameIndex(MFI->CreateStackObject(RC->getSize(),
- RC->getAlignment()));
- }
- }
- }
- }
-
- if (ForceLRSpill) {
- MF.getRegInfo().setPhysRegUsed(ARM::LR);
- AFI->setCSRegisterIsSpilled(ARM::LR);
- AFI->setLRIsSpilledForFarJump(true);
- }
-}
-
-/// Move iterator pass the next bunch of callee save load / store ops for
-/// the particular spill area (1: integer area 1, 2: integer area 2,
-/// 3: fp area, 0: don't care).
-static void movePastCSLoadStoreOps(MachineBasicBlock &MBB,
- MachineBasicBlock::iterator &MBBI,
- int Opc, unsigned Area,
- const ARMSubtarget &STI) {
- while (MBBI != MBB.end() &&
- MBBI->getOpcode() == Opc && MBBI->getOperand(1).isFrameIndex()) {
- if (Area != 0) {
- bool Done = false;
- unsigned Category = 0;
- switch (MBBI->getOperand(0).getReg()) {
- case ARM::R4: case ARM::R5: case ARM::R6: case ARM::R7:
- case ARM::LR:
- Category = 1;
- break;
- case ARM::R8: case ARM::R9: case ARM::R10: case ARM::R11:
- Category = STI.isTargetDarwin() ? 2 : 1;
- break;
- case ARM::D8: case ARM::D9: case ARM::D10: case ARM::D11:
- case ARM::D12: case ARM::D13: case ARM::D14: case ARM::D15:
- Category = 3;
- break;
- default:
- Done = true;
- break;
- }
- if (Done || Category != Area)
- break;
- }
-
- ++MBBI;
- }
-}
-
-void ARMRegisterInfo::emitPrologue(MachineFunction &MF) const {
- MachineBasicBlock &MBB = MF.front();
- MachineBasicBlock::iterator MBBI = MBB.begin();
- MachineFrameInfo *MFI = MF.getFrameInfo();
- ARMFunctionInfo *AFI = MF.getInfo<ARMFunctionInfo>();
- bool isThumb = AFI->isThumbFunction();
- unsigned VARegSaveSize = AFI->getVarArgsRegSaveSize();
- unsigned NumBytes = MFI->getStackSize();
- const std::vector<CalleeSavedInfo> &CSI = MFI->getCalleeSavedInfo();
-
- if (isThumb) {
- // Check if R3 is live in. It might have to be used as a scratch register.
- for (MachineRegisterInfo::livein_iterator I =MF.getRegInfo().livein_begin(),
- E = MF.getRegInfo().livein_end(); I != E; ++I) {
- if (I->first == ARM::R3) {
- AFI->setR3IsLiveIn(true);
- break;
- }
- }
-
- // Thumb add/sub sp, imm8 instructions implicitly multiply the offset by 4.
- NumBytes = (NumBytes + 3) & ~3;
- MFI->setStackSize(NumBytes);
- }
-
- // Determine the sizes of each callee-save spill areas and record which frame
- // belongs to which callee-save spill areas.
- unsigned GPRCS1Size = 0, GPRCS2Size = 0, DPRCSSize = 0;
- int FramePtrSpillFI = 0;
-
- if (VARegSaveSize)
- emitSPUpdate(MBB, MBBI, -VARegSaveSize, ARMCC::AL, 0, isThumb, TII, *this);
-
- if (!AFI->hasStackFrame()) {
- if (NumBytes != 0)
- emitSPUpdate(MBB, MBBI, -NumBytes, ARMCC::AL, 0, isThumb, TII, *this);
- return;
- }
-
- for (unsigned i = 0, e = CSI.size(); i != e; ++i) {
- unsigned Reg = CSI[i].getReg();
- int FI = CSI[i].getFrameIdx();
- switch (Reg) {
- case ARM::R4:
- case ARM::R5:
- case ARM::R6:
- case ARM::R7:
- case ARM::LR:
- if (Reg == FramePtr)
- FramePtrSpillFI = FI;
- AFI->addGPRCalleeSavedArea1Frame(FI);
- GPRCS1Size += 4;
- break;
- case ARM::R8:
- case ARM::R9:
- case ARM::R10:
- case ARM::R11:
- if (Reg == FramePtr)
- FramePtrSpillFI = FI;
- if (STI.isTargetDarwin()) {
- AFI->addGPRCalleeSavedArea2Frame(FI);
- GPRCS2Size += 4;
- } else {
- AFI->addGPRCalleeSavedArea1Frame(FI);
- GPRCS1Size += 4;
- }
- break;
- default:
- AFI->addDPRCalleeSavedAreaFrame(FI);
- DPRCSSize += 8;
- }
- }
-
- if (!isThumb) {
- // Build the new SUBri to adjust SP for integer callee-save spill area 1.
- emitSPUpdate(MBB, MBBI, -GPRCS1Size, ARMCC::AL, 0, isThumb, TII, *this);
- movePastCSLoadStoreOps(MBB, MBBI, ARM::STR, 1, STI);
- } else if (MBBI != MBB.end() && MBBI->getOpcode() == ARM::tPUSH)
- ++MBBI;
-
- // Darwin ABI requires FP to point to the stack slot that contains the
- // previous FP.
- if (STI.isTargetDarwin() || hasFP(MF)) {
- MachineInstrBuilder MIB =
- BuildMI(MBB, MBBI, TII.get(isThumb ? ARM::tADDrSPi : ARM::ADDri),FramePtr)
- .addFrameIndex(FramePtrSpillFI).addImm(0);
- if (!isThumb) AddDefaultCC(AddDefaultPred(MIB));
- }
-
- if (!isThumb) {
- // Build the new SUBri to adjust SP for integer callee-save spill area 2.
- emitSPUpdate(MBB, MBBI, -GPRCS2Size, ARMCC::AL, 0, false, TII, *this);
-
- // Build the new SUBri to adjust SP for FP callee-save spill area.
- movePastCSLoadStoreOps(MBB, MBBI, ARM::STR, 2, STI);
- emitSPUpdate(MBB, MBBI, -DPRCSSize, ARMCC::AL, 0, false, TII, *this);
- }
-
- // Determine starting offsets of spill areas.
- unsigned DPRCSOffset = NumBytes - (GPRCS1Size + GPRCS2Size + DPRCSSize);
- unsigned GPRCS2Offset = DPRCSOffset + DPRCSSize;
- unsigned GPRCS1Offset = GPRCS2Offset + GPRCS2Size;
- AFI->setFramePtrSpillOffset(MFI->getObjectOffset(FramePtrSpillFI) + NumBytes);
- AFI->setGPRCalleeSavedArea1Offset(GPRCS1Offset);
- AFI->setGPRCalleeSavedArea2Offset(GPRCS2Offset);
- AFI->setDPRCalleeSavedAreaOffset(DPRCSOffset);
-
- NumBytes = DPRCSOffset;
- if (NumBytes) {
- // Insert it after all the callee-save spills.
- if (!isThumb)
- movePastCSLoadStoreOps(MBB, MBBI, ARM::FSTD, 3, STI);
- emitSPUpdate(MBB, MBBI, -NumBytes, ARMCC::AL, 0, isThumb, TII, *this);
- }
-
- if(STI.isTargetELF() && hasFP(MF)) {
- MFI->setOffsetAdjustment(MFI->getOffsetAdjustment() -
- AFI->getFramePtrSpillOffset());
- }
-
- AFI->setGPRCalleeSavedArea1Size(GPRCS1Size);
- AFI->setGPRCalleeSavedArea2Size(GPRCS2Size);
- AFI->setDPRCalleeSavedAreaSize(DPRCSSize);
-}
-
-static bool isCalleeSavedRegister(unsigned Reg, const unsigned *CSRegs) {
- for (unsigned i = 0; CSRegs[i]; ++i)
- if (Reg == CSRegs[i])
- return true;
- return false;
-}
-
-static bool isCSRestore(MachineInstr *MI, const unsigned *CSRegs) {
- return ((MI->getOpcode() == ARM::FLDD ||
- MI->getOpcode() == ARM::LDR ||
- MI->getOpcode() == ARM::tRestore) &&
- MI->getOperand(1).isFrameIndex() &&
- isCalleeSavedRegister(MI->getOperand(0).getReg(), CSRegs));
-}
-
-void ARMRegisterInfo::emitEpilogue(MachineFunction &MF,
- MachineBasicBlock &MBB) const {
- MachineBasicBlock::iterator MBBI = prior(MBB.end());
- assert((MBBI->getOpcode() == ARM::BX_RET ||
- MBBI->getOpcode() == ARM::tBX_RET ||
- MBBI->getOpcode() == ARM::tPOP_RET) &&
- "Can only insert epilog into returning blocks");
-
- MachineFrameInfo *MFI = MF.getFrameInfo();
- ARMFunctionInfo *AFI = MF.getInfo<ARMFunctionInfo>();
- bool isThumb = AFI->isThumbFunction();
- unsigned VARegSaveSize = AFI->getVarArgsRegSaveSize();
- int NumBytes = (int)MFI->getStackSize();
- if (!AFI->hasStackFrame()) {
- if (NumBytes != 0)
- emitSPUpdate(MBB, MBBI, NumBytes, ARMCC::AL, 0, isThumb, TII, *this);
- } else {
- // Unwind MBBI to point to first LDR / FLDD.
- const unsigned *CSRegs = getCalleeSavedRegs();
- if (MBBI != MBB.begin()) {
- do
- --MBBI;
- while (MBBI != MBB.begin() && isCSRestore(MBBI, CSRegs));
- if (!isCSRestore(MBBI, CSRegs))
- ++MBBI;
- }
-
- // Move SP to start of FP callee save spill area.
- NumBytes -= (AFI->getGPRCalleeSavedArea1Size() +
- AFI->getGPRCalleeSavedArea2Size() +
- AFI->getDPRCalleeSavedAreaSize());
- if (isThumb) {
- if (hasFP(MF)) {
- NumBytes = AFI->getFramePtrSpillOffset() - NumBytes;
- // Reset SP based on frame pointer only if the stack frame extends beyond
- // frame pointer stack slot or target is ELF and the function has FP.
- if (NumBytes)
- emitThumbRegPlusImmediate(MBB, MBBI, ARM::SP, FramePtr, -NumBytes,
- TII, *this);
- else
- BuildMI(MBB, MBBI, TII.get(ARM::tMOVr), ARM::SP).addReg(FramePtr);
- } else {
- if (MBBI->getOpcode() == ARM::tBX_RET &&
- &MBB.front() != MBBI &&
- prior(MBBI)->getOpcode() == ARM::tPOP) {
- MachineBasicBlock::iterator PMBBI = prior(MBBI);
- emitSPUpdate(MBB, PMBBI, NumBytes, ARMCC::AL, 0, isThumb, TII, *this);
- } else
- emitSPUpdate(MBB, MBBI, NumBytes, ARMCC::AL, 0, isThumb, TII, *this);
- }
- } else {
- // Darwin ABI requires FP to point to the stack slot that contains the
- // previous FP.
- if ((STI.isTargetDarwin() && NumBytes) || hasFP(MF)) {
- NumBytes = AFI->getFramePtrSpillOffset() - NumBytes;
- // Reset SP based on frame pointer only if the stack frame extends beyond
- // frame pointer stack slot or target is ELF and the function has FP.
- if (AFI->getGPRCalleeSavedArea2Size() ||
- AFI->getDPRCalleeSavedAreaSize() ||
- AFI->getDPRCalleeSavedAreaOffset()||
- hasFP(MF)) {
- if (NumBytes)
- BuildMI(MBB, MBBI, TII.get(ARM::SUBri), ARM::SP).addReg(FramePtr)
- .addImm(NumBytes)
- .addImm((unsigned)ARMCC::AL).addReg(0).addReg(0);
- else
- BuildMI(MBB, MBBI, TII.get(ARM::MOVr), ARM::SP).addReg(FramePtr)
- .addImm((unsigned)ARMCC::AL).addReg(0).addReg(0);
- }
- } else if (NumBytes) {
- emitSPUpdate(MBB, MBBI, NumBytes, ARMCC::AL, 0, false, TII, *this);
- }
-
- // Move SP to start of integer callee save spill area 2.
- movePastCSLoadStoreOps(MBB, MBBI, ARM::FLDD, 3, STI);
- emitSPUpdate(MBB, MBBI, AFI->getDPRCalleeSavedAreaSize(), ARMCC::AL, 0,
- false, TII, *this);
-
- // Move SP to start of integer callee save spill area 1.
- movePastCSLoadStoreOps(MBB, MBBI, ARM::LDR, 2, STI);
- emitSPUpdate(MBB, MBBI, AFI->getGPRCalleeSavedArea2Size(), ARMCC::AL, 0,
- false, TII, *this);
-
- // Move SP to SP upon entry to the function.
- movePastCSLoadStoreOps(MBB, MBBI, ARM::LDR, 1, STI);
- emitSPUpdate(MBB, MBBI, AFI->getGPRCalleeSavedArea1Size(), ARMCC::AL, 0,
- false, TII, *this);
- }
- }
-
- if (VARegSaveSize) {
- if (isThumb)
- // Epilogue for vararg functions: pop LR to R3 and branch off it.
- // FIXME: Verify this is still ok when R3 is no longer being reserved.
- BuildMI(MBB, MBBI, TII.get(ARM::tPOP)).addReg(ARM::R3);
-
- emitSPUpdate(MBB, MBBI, VARegSaveSize, ARMCC::AL, 0, isThumb, TII, *this);
-
- if (isThumb) {
- BuildMI(MBB, MBBI, TII.get(ARM::tBX_RET_vararg)).addReg(ARM::R3);
- MBB.erase(MBBI);
- }
- }
-}
-
-unsigned ARMRegisterInfo::getRARegister() const {
- return ARM::LR;
-}
-
-unsigned ARMRegisterInfo::getFrameRegister(MachineFunction &MF) const {
- if (STI.isTargetDarwin() || hasFP(MF))
- return (STI.useThumbBacktraces() || STI.isThumb()) ? ARM::R7 : ARM::R11;
- else
- return ARM::SP;
-}
-
-unsigned ARMRegisterInfo::getEHExceptionRegister() const {
- assert(0 && "What is the exception register");
- return 0;
-}
-
-unsigned ARMRegisterInfo::getEHHandlerRegister() const {
- assert(0 && "What is the exception handler register");
- return 0;
-}
-
-int ARMRegisterInfo::getDwarfRegNum(unsigned RegNum, bool isEH) const {
- assert(0 && "What is the dwarf register number");
- return -1;
-}
-
-#include "ARMGenRegisterInfo.inc"
diff --git a/release_23/lib/Target/ARM/ARMRegisterInfo.h b/release_23/lib/Target/ARM/ARMRegisterInfo.h
deleted file mode 100644
index 5c75230cb127..000000000000
--- a/release_23/lib/Target/ARM/ARMRegisterInfo.h
+++ /dev/null
@@ -1,91 +0,0 @@
-//===- ARMRegisterInfo.h - ARM Register Information Impl --------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains the ARM implementation of the TargetRegisterInfo class.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef ARMREGISTERINFO_H
-#define ARMREGISTERINFO_H
-
-#include "llvm/Target/TargetRegisterInfo.h"
-#include "ARMGenRegisterInfo.h.inc"
-
-namespace llvm {
- class ARMSubtarget;
- class TargetInstrInfo;
- class Type;
-
-struct ARMRegisterInfo : public ARMGenRegisterInfo {
- const TargetInstrInfo &TII;
- const ARMSubtarget &STI;
-private:
- /// FramePtr - ARM physical register used as frame ptr.
- unsigned FramePtr;
-
-public:
- ARMRegisterInfo(const TargetInstrInfo &tii, const ARMSubtarget &STI);
-
- /// emitLoadConstPool - Emits a load from constpool to materialize the
- /// specified immediate.
- void emitLoadConstPool(MachineBasicBlock &MBB,
- MachineBasicBlock::iterator &MBBI,
- unsigned DestReg, int Val,
- unsigned Pred, unsigned PredReg,
- const TargetInstrInfo *TII, bool isThumb) const;
-
- /// getRegisterNumbering - Given the enum value for some register, e.g.
- /// ARM::LR, return the number that it corresponds to (e.g. 14).
- static unsigned getRegisterNumbering(unsigned RegEnum);
-
- /// Code Generation virtual methods...
- const unsigned *getCalleeSavedRegs(const MachineFunction *MF = 0) const;
-
- const TargetRegisterClass* const*
- getCalleeSavedRegClasses(const MachineFunction *MF = 0) const;
-
- BitVector getReservedRegs(const MachineFunction &MF) const;
-
- bool isReservedReg(const MachineFunction &MF, unsigned Reg) const;
-
- bool requiresRegisterScavenging(const MachineFunction &MF) const;
-
- bool hasFP(const MachineFunction &MF) const;
-
- bool hasReservedCallFrame(MachineFunction &MF) const;
-
- void eliminateCallFramePseudoInstr(MachineFunction &MF,
- MachineBasicBlock &MBB,
- MachineBasicBlock::iterator I) const;
-
- void eliminateFrameIndex(MachineBasicBlock::iterator II,
- int SPAdj, RegScavenger *RS = NULL) const;
-
- void processFunctionBeforeCalleeSavedScan(MachineFunction &MF,
- RegScavenger *RS = NULL) const;
-
- void emitPrologue(MachineFunction &MF) const;
- void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const;
-
- // Debug information queries.
- unsigned getRARegister() const;
- unsigned getFrameRegister(MachineFunction &MF) const;
-
- // Exception handling queries.
- unsigned getEHExceptionRegister() const;
- unsigned getEHHandlerRegister() const;
-
- int getDwarfRegNum(unsigned RegNum, bool isEH) const;
-
- bool isLowRegister(unsigned Reg) const;
-};
-
-} // end namespace llvm
-
-#endif
diff --git a/release_23/lib/Target/ARM/ARMRegisterInfo.td b/release_23/lib/Target/ARM/ARMRegisterInfo.td
deleted file mode 100644
index 61c77e64acf7..000000000000
--- a/release_23/lib/Target/ARM/ARMRegisterInfo.td
+++ /dev/null
@@ -1,195 +0,0 @@
-//===- ARMRegisterInfo.td - ARM Register defs -------------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-//===----------------------------------------------------------------------===//
-// Declarations that describe the ARM register file
-//===----------------------------------------------------------------------===//
-
-// Registers are identified with 4-bit ID numbers.
-class ARMReg<bits<4> num, string n, list<Register> subregs = []> : Register<n> {
- field bits<4> Num;
- let Namespace = "ARM";
- let SubRegs = subregs;
-}
-
-class ARMFReg<bits<5> num, string n> : Register<n> {
- field bits<5> Num;
- let Namespace = "ARM";
-}
-
-// Integer registers
-def R0 : ARMReg< 0, "r0">, DwarfRegNum<[0]>;
-def R1 : ARMReg< 1, "r1">, DwarfRegNum<[1]>;
-def R2 : ARMReg< 2, "r2">, DwarfRegNum<[2]>;
-def R3 : ARMReg< 3, "r3">, DwarfRegNum<[3]>;
-def R4 : ARMReg< 4, "r4">, DwarfRegNum<[4]>;
-def R5 : ARMReg< 5, "r5">, DwarfRegNum<[5]>;
-def R6 : ARMReg< 6, "r6">, DwarfRegNum<[6]>;
-def R7 : ARMReg< 7, "r7">, DwarfRegNum<[7]>;
-def R8 : ARMReg< 8, "r8">, DwarfRegNum<[8]>;
-def R9 : ARMReg< 9, "r9">, DwarfRegNum<[9]>;
-def R10 : ARMReg<10, "r10">, DwarfRegNum<[10]>;
-def R11 : ARMReg<11, "r11">, DwarfRegNum<[11]>;
-def R12 : ARMReg<12, "r12">, DwarfRegNum<[12]>;
-def SP : ARMReg<13, "sp">, DwarfRegNum<[13]>;
-def LR : ARMReg<14, "lr">, DwarfRegNum<[14]>;
-def PC : ARMReg<15, "pc">, DwarfRegNum<[15]>;
-
-// Float registers
-def S0 : ARMFReg< 0, "s0">; def S1 : ARMFReg< 1, "s1">;
-def S2 : ARMFReg< 2, "s2">; def S3 : ARMFReg< 3, "s3">;
-def S4 : ARMFReg< 4, "s4">; def S5 : ARMFReg< 5, "s5">;
-def S6 : ARMFReg< 6, "s6">; def S7 : ARMFReg< 7, "s7">;
-def S8 : ARMFReg< 8, "s8">; def S9 : ARMFReg< 9, "s9">;
-def S10 : ARMFReg<10, "s10">; def S11 : ARMFReg<11, "s11">;
-def S12 : ARMFReg<12, "s12">; def S13 : ARMFReg<13, "s13">;
-def S14 : ARMFReg<14, "s14">; def S15 : ARMFReg<15, "s15">;
-def S16 : ARMFReg<16, "s16">; def S17 : ARMFReg<17, "s17">;
-def S18 : ARMFReg<18, "s18">; def S19 : ARMFReg<19, "s19">;
-def S20 : ARMFReg<20, "s20">; def S21 : ARMFReg<21, "s21">;
-def S22 : ARMFReg<22, "s22">; def S23 : ARMFReg<23, "s23">;
-def S24 : ARMFReg<24, "s24">; def S25 : ARMFReg<25, "s25">;
-def S26 : ARMFReg<26, "s26">; def S27 : ARMFReg<27, "s27">;
-def S28 : ARMFReg<28, "s28">; def S29 : ARMFReg<29, "s29">;
-def S30 : ARMFReg<30, "s30">; def S31 : ARMFReg<31, "s31">;
-
-// Aliases of the F* registers used to hold 64-bit fp values (doubles)
-def D0 : ARMReg< 0, "d0", [S0, S1]>;
-def D1 : ARMReg< 1, "d1", [S2, S3]>;
-def D2 : ARMReg< 2, "d2", [S4, S5]>;
-def D3 : ARMReg< 3, "d3", [S6, S7]>;
-def D4 : ARMReg< 4, "d4", [S8, S9]>;
-def D5 : ARMReg< 5, "d5", [S10, S11]>;
-def D6 : ARMReg< 6, "d6", [S12, S13]>;
-def D7 : ARMReg< 7, "d7", [S14, S15]>;
-def D8 : ARMReg< 8, "d8", [S16, S17]>;
-def D9 : ARMReg< 9, "d9", [S18, S19]>;
-def D10 : ARMReg<10, "d10", [S20, S21]>;
-def D11 : ARMReg<11, "d11", [S22, S23]>;
-def D12 : ARMReg<12, "d12", [S24, S25]>;
-def D13 : ARMReg<13, "d13", [S26, S27]>;
-def D14 : ARMReg<14, "d14", [S28, S29]>;
-def D15 : ARMReg<15, "d15", [S30, S31]>;
-
-// Current Program Status Register.
-def CPSR : ARMReg<0, "cpsr">;
-
-// Register classes.
-//
-// pc == Program Counter
-// lr == Link Register
-// sp == Stack Pointer
-// r12 == ip (scratch)
-// r7 == Frame Pointer (thumb-style backtraces)
-// r11 == Frame Pointer (arm-style backtraces)
-// r10 == Stack Limit
-//
-def GPR : RegisterClass<"ARM", [i32], 32, [R0, R1, R2, R3, R4, R5, R6,
- R7, R8, R9, R10, R12, R11,
- LR, SP, PC]> {
- let MethodProtos = [{
- iterator allocation_order_begin(const MachineFunction &MF) const;
- iterator allocation_order_end(const MachineFunction &MF) const;
- }];
- // FIXME: We are reserving r12 in case the PEI needs to use it to
- // generate large stack offset. Make it available once we have register
- // scavenging. Similarly r3 is reserved in Thumb mode for now.
- let MethodBodies = [{
- // FP is R11, R9 is available.
- static const unsigned ARM_GPR_AO_1[] = {
- ARM::R3, ARM::R2, ARM::R1, ARM::R0,
- ARM::R12,ARM::LR,
- ARM::R4, ARM::R5, ARM::R6, ARM::R7,
- ARM::R8, ARM::R9, ARM::R10,
- ARM::R11 };
- // FP is R11, R9 is not available.
- static const unsigned ARM_GPR_AO_2[] = {
- ARM::R3, ARM::R2, ARM::R1, ARM::R0,
- ARM::R12,ARM::LR,
- ARM::R4, ARM::R5, ARM::R6, ARM::R7,
- ARM::R8, ARM::R10,
- ARM::R11 };
- // FP is R7, R9 is available.
- static const unsigned ARM_GPR_AO_3[] = {
- ARM::R3, ARM::R2, ARM::R1, ARM::R0,
- ARM::R12,ARM::LR,
- ARM::R4, ARM::R5, ARM::R6,
- ARM::R8, ARM::R9, ARM::R10,ARM::R11,
- ARM::R7 };
- // FP is R7, R9 is not available.
- static const unsigned ARM_GPR_AO_4[] = {
- ARM::R3, ARM::R2, ARM::R1, ARM::R0,
- ARM::R12,ARM::LR,
- ARM::R4, ARM::R5, ARM::R6,
- ARM::R8, ARM::R10,ARM::R11,
- ARM::R7 };
-
- // FP is R7, only low registers available.
- static const unsigned THUMB_GPR_AO[] = {
- ARM::R2, ARM::R1, ARM::R0,
- ARM::R4, ARM::R5, ARM::R6, ARM::R7 };
-
- GPRClass::iterator
- GPRClass::allocation_order_begin(const MachineFunction &MF) const {
- const TargetMachine &TM = MF.getTarget();
- const ARMSubtarget &Subtarget = TM.getSubtarget<ARMSubtarget>();
- if (Subtarget.isThumb())
- return THUMB_GPR_AO;
- if (Subtarget.useThumbBacktraces()) {
- if (Subtarget.isR9Reserved())
- return ARM_GPR_AO_4;
- else
- return ARM_GPR_AO_3;
- } else {
- if (Subtarget.isR9Reserved())
- return ARM_GPR_AO_2;
- else
- return ARM_GPR_AO_1;
- }
- }
-
- GPRClass::iterator
- GPRClass::allocation_order_end(const MachineFunction &MF) const {
- const TargetMachine &TM = MF.getTarget();
- const TargetRegisterInfo *RI = TM.getRegisterInfo();
- const ARMSubtarget &Subtarget = TM.getSubtarget<ARMSubtarget>();
- GPRClass::iterator I;
- if (Subtarget.isThumb())
- I = THUMB_GPR_AO + (sizeof(THUMB_GPR_AO)/sizeof(unsigned));
- else if (Subtarget.useThumbBacktraces()) {
- if (Subtarget.isR9Reserved()) {
- I = ARM_GPR_AO_4 + (sizeof(ARM_GPR_AO_4)/sizeof(unsigned));
- } else {
- I = ARM_GPR_AO_3 + (sizeof(ARM_GPR_AO_3)/sizeof(unsigned));
- }
- } else {
- if (Subtarget.isR9Reserved()) {
- I = ARM_GPR_AO_2 + (sizeof(ARM_GPR_AO_2)/sizeof(unsigned));
- } else {
- I = ARM_GPR_AO_1 + (sizeof(ARM_GPR_AO_1)/sizeof(unsigned));
- }
- }
-
- // Mac OS X requires FP not to be clobbered for backtracing purpose.
- return (Subtarget.isTargetDarwin() || RI->hasFP(MF)) ? I-1 : I;
- }
- }];
-}
-
-def SPR : RegisterClass<"ARM", [f32], 32, [S0, S1, S2, S3, S4, S5, S6, S7, S8,
- S9, S10, S11, S12, S13, S14, S15, S16, S17, S18, S19, S20, S21, S22,
- S23, S24, S25, S26, S27, S28, S29, S30, S31]>;
-
-// ARM requires only word alignment for double. It's more performant if it
-// is double-word alignment though.
-def DPR : RegisterClass<"ARM", [f64], 64, [D0, D1, D2, D3, D4, D5, D6, D7, D8,
- D9, D10, D11, D12, D13, D14, D15]>;
-
-// Condition code registers.
-def CCR : RegisterClass<"ARM", [i32], 32, [CPSR]>;
diff --git a/release_23/lib/Target/ARM/ARMRelocations.h b/release_23/lib/Target/ARM/ARMRelocations.h
deleted file mode 100644
index 6963980bc2e2..000000000000
--- a/release_23/lib/Target/ARM/ARMRelocations.h
+++ /dev/null
@@ -1,30 +0,0 @@
-//===- ARMRelocations.h - ARM Code Relocations ------------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines the ARM target-specific relocation types.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef ARMRELOCATIONS_H
-#define ARMRELOCATIONS_H
-
-#include "llvm/CodeGen/MachineRelocation.h"
-
-namespace llvm {
- namespace ARM {
- enum RelocationType {
- reloc_arm_relative,
-
- reloc_arm_branch
- };
- }
-}
-
-#endif
-
diff --git a/release_23/lib/Target/ARM/ARMSubtarget.cpp b/release_23/lib/Target/ARM/ARMSubtarget.cpp
deleted file mode 100644
index bbc2202c3ba2..000000000000
--- a/release_23/lib/Target/ARM/ARMSubtarget.cpp
+++ /dev/null
@@ -1,57 +0,0 @@
-//===-- ARMSubtarget.cpp - ARM Subtarget Information ------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the ARM specific subclass of TargetSubtarget.
-//
-//===----------------------------------------------------------------------===//
-
-#include "ARMSubtarget.h"
-#include "ARMGenSubtarget.inc"
-#include "llvm/Module.h"
-using namespace llvm;
-
-ARMSubtarget::ARMSubtarget(const Module &M, const std::string &FS, bool thumb)
- : ARMArchVersion(V4T)
- , HasVFP2(false)
- , IsThumb(thumb)
- , UseThumbBacktraces(false)
- , IsR9Reserved(false)
- , stackAlignment(4)
- , TargetType(isELF) // Default to ELF unless otherwise specified.
- , TargetABI(ARM_ABI_APCS) {
-
- // Determine default and user specified characteristics
- std::string CPU = "generic";
-
- // Parse features string.
- ParseSubtargetFeatures(FS, CPU);
-
- // Set the boolean corresponding to the current target triple, or the default
- // if one cannot be determined, to true.
- const std::string& TT = M.getTargetTriple();
- if (TT.length() > 5) {
- if (TT.find("-darwin") != std::string::npos)
- TargetType = isDarwin;
- } else if (TT.empty()) {
-#if defined(__APPLE__)
- TargetType = isDarwin;
-#endif
- }
-
- if (TT.find("eabi") != std::string::npos)
- TargetABI = ARM_ABI_AAPCS;
-
- if (isAAPCS_ABI())
- stackAlignment = 8;
-
- if (isTargetDarwin()) {
- UseThumbBacktraces = true;
- IsR9Reserved = true;
- }
-}
diff --git a/release_23/lib/Target/ARM/ARMSubtarget.h b/release_23/lib/Target/ARM/ARMSubtarget.h
deleted file mode 100644
index fbc9e579df1c..000000000000
--- a/release_23/lib/Target/ARM/ARMSubtarget.h
+++ /dev/null
@@ -1,101 +0,0 @@
-//=====---- ARMSubtarget.h - Define Subtarget for the ARM -----*- C++ -*--====//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file declares the ARM specific subclass of TargetSubtarget.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef ARMSUBTARGET_H
-#define ARMSUBTARGET_H
-
-#include "llvm/Target/TargetSubtarget.h"
-#include <string>
-
-namespace llvm {
-class Module;
-
-class ARMSubtarget : public TargetSubtarget {
-protected:
- enum ARMArchEnum {
- V4T, V5T, V5TE, V6
- };
-
- /// ARMArchVersion - ARM architecture vecrsion: V4T (base), V5T, V5TE,
- /// and V6.
- ARMArchEnum ARMArchVersion;
-
- /// HasVFP2 - True if the processor supports Vector Floating Point (VFP) V2
- /// instructions.
- bool HasVFP2;
-
- /// IsThumb - True if we are in thumb mode, false if in ARM mode.
- bool IsThumb;
-
- /// UseThumbBacktraces - True if we use thumb style backtraces.
- bool UseThumbBacktraces;
-
- /// IsR9Reserved - True if R9 is a not available as general purpose register.
- bool IsR9Reserved;
-
- /// stackAlignment - The minimum alignment known to hold of the stack frame on
- /// entry to the function and which must be maintained by every function.
- unsigned stackAlignment;
-
- public:
- enum {
- isELF, isDarwin
- } TargetType;
-
- enum {
- ARM_ABI_APCS,
- ARM_ABI_AAPCS // ARM EABI
- } TargetABI;
-
- /// This constructor initializes the data members to match that
- /// of the specified module.
- ///
- ARMSubtarget(const Module &M, const std::string &FS, bool thumb);
-
- /// getMaxInlineSizeThreshold - Returns the maximum memset / memcpy size
- /// that still makes it profitable to inline the call.
- unsigned getMaxInlineSizeThreshold() const {
- // FIXME: For now, we don't lower memcpy's to loads / stores for Thumb.
- // Change this once Thumb ldmia / stmia support is added.
- return isThumb() ? 0 : 64;
- }
- /// ParseSubtargetFeatures - Parses features string setting specified
- /// subtarget options. Definition of function is auto generated by tblgen.
- void ParseSubtargetFeatures(const std::string &FS, const std::string &CPU);
-
- bool hasV4TOps() const { return ARMArchVersion >= V4T; }
- bool hasV5TOps() const { return ARMArchVersion >= V5T; }
- bool hasV5TEOps() const { return ARMArchVersion >= V5TE; }
- bool hasV6Ops() const { return ARMArchVersion >= V6; }
-
- bool hasVFP2() const { return HasVFP2; }
-
- bool isTargetDarwin() const { return TargetType == isDarwin; }
- bool isTargetELF() const { return TargetType == isELF; }
-
- bool isAPCS_ABI() const { return TargetABI == ARM_ABI_APCS; }
- bool isAAPCS_ABI() const { return TargetABI == ARM_ABI_AAPCS; }
-
- bool isThumb() const { return IsThumb; }
-
- bool useThumbBacktraces() const { return UseThumbBacktraces; }
- bool isR9Reserved() const { return IsR9Reserved; }
-
- /// getStackAlignment - Returns the minimum alignment known to hold of the
- /// stack frame on entry to the function and which must be maintained by every
- /// function for this subtarget.
- unsigned getStackAlignment() const { return stackAlignment; }
-};
-} // End llvm namespace
-
-#endif // ARMSUBTARGET_H
diff --git a/release_23/lib/Target/ARM/ARMTargetAsmInfo.cpp b/release_23/lib/Target/ARM/ARMTargetAsmInfo.cpp
deleted file mode 100644
index 65947fb188fa..000000000000
--- a/release_23/lib/Target/ARM/ARMTargetAsmInfo.cpp
+++ /dev/null
@@ -1,286 +0,0 @@
-//===-- ARMTargetAsmInfo.cpp - ARM asm properties ---------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains the declarations of the ARMTargetAsmInfo properties.
-//
-//===----------------------------------------------------------------------===//
-
-#include "ARMTargetAsmInfo.h"
-#include "ARMTargetMachine.h"
-#include <cstring>
-#include <cctype>
-using namespace llvm;
-
-static const char *const arm_asm_table[] = {
- "{r0}", "r0",
- "{r1}", "r1",
- "{r2}", "r2",
- "{r3}", "r3",
- "{r4}", "r4",
- "{r5}", "r5",
- "{r6}", "r6",
- "{r7}", "r7",
- "{r8}", "r8",
- "{r9}", "r9",
- "{r10}", "r10",
- "{r11}", "r11",
- "{r12}", "r12",
- "{r13}", "r13",
- "{r14}", "r14",
- "{lr}", "lr",
- "{sp}", "sp",
- "{ip}", "ip",
- "{fp}", "fp",
- "{sl}", "sl",
- "{memory}", "memory",
- "{cc}", "cc",
- 0,0};
-
-ARMTargetAsmInfo::ARMTargetAsmInfo(const ARMTargetMachine &TM) {
- Subtarget = &TM.getSubtarget<ARMSubtarget>();
- AsmTransCBE = arm_asm_table;
- if (Subtarget->isTargetDarwin()) {
- GlobalPrefix = "_";
- PrivateGlobalPrefix = "L";
- BSSSection = 0; // no BSS section.
- ZeroFillDirective = "\t.zerofill\t"; // Uses .zerofill
- SetDirective = "\t.set\t";
- WeakRefDirective = "\t.weak_reference\t";
- HiddenDirective = "\t.private_extern\t";
- ProtectedDirective = NULL;
- JumpTableDataSection = ".const";
- CStringSection = "\t.cstring";
- FourByteConstantSection = "\t.literal4\n";
- EightByteConstantSection = "\t.literal8\n";
- ReadOnlySection = "\t.const\n";
- HasDotTypeDotSizeDirective = false;
- NeedsIndirectEncoding = true;
- if (TM.getRelocationModel() == Reloc::Static) {
- StaticCtorsSection = ".constructor";
- StaticDtorsSection = ".destructor";
- } else {
- StaticCtorsSection = ".mod_init_func";
- StaticDtorsSection = ".mod_term_func";
- }
-
- // In non-PIC modes, emit a special label before jump tables so that the
- // linker can perform more accurate dead code stripping.
- if (TM.getRelocationModel() != Reloc::PIC_) {
- // Emit a local label that is preserved until the linker runs.
- JumpTableSpecialLabelPrefix = "l";
- }
-
- NeedsSet = true;
- DwarfAbbrevSection = ".section __DWARF,__debug_abbrev,regular,debug";
- DwarfInfoSection = ".section __DWARF,__debug_info,regular,debug";
- DwarfLineSection = ".section __DWARF,__debug_line,regular,debug";
- DwarfFrameSection = ".section __DWARF,__debug_frame,regular,debug";
- DwarfPubNamesSection = ".section __DWARF,__debug_pubnames,regular,debug";
- DwarfPubTypesSection = ".section __DWARF,__debug_pubtypes,regular,debug";
- DwarfStrSection = ".section __DWARF,__debug_str,regular,debug";
- DwarfLocSection = ".section __DWARF,__debug_loc,regular,debug";
- DwarfARangesSection = ".section __DWARF,__debug_aranges,regular,debug";
- DwarfRangesSection = ".section __DWARF,__debug_ranges,regular,debug";
- DwarfMacInfoSection = ".section __DWARF,__debug_macinfo,regular,debug";
- } else {
- NeedsSet = false;
- HasLEB128 = true;
- AbsoluteDebugSectionOffsets = true;
- ReadOnlySection = "\t.section\t.rodata\n";
- PrivateGlobalPrefix = ".L";
- WeakRefDirective = "\t.weak\t";
- SetDirective = "\t.set\t";
- DwarfRequiresFrameSection = false;
- DwarfAbbrevSection = "\t.section\t.debug_abbrev,\"\",%progbits";
- DwarfInfoSection = "\t.section\t.debug_info,\"\",%progbits";
- DwarfLineSection = "\t.section\t.debug_line,\"\",%progbits";
- DwarfFrameSection = "\t.section\t.debug_frame,\"\",%progbits";
- DwarfPubNamesSection ="\t.section\t.debug_pubnames,\"\",%progbits";
- DwarfPubTypesSection ="\t.section\t.debug_pubtypes,\"\",%progbits";
- DwarfStrSection = "\t.section\t.debug_str,\"\",%progbits";
- DwarfLocSection = "\t.section\t.debug_loc,\"\",%progbits";
- DwarfARangesSection = "\t.section\t.debug_aranges,\"\",%progbits";
- DwarfRangesSection = "\t.section\t.debug_ranges,\"\",%progbits";
- DwarfMacInfoSection = "\t.section\t.debug_macinfo,\"\",%progbits";
-
- if (Subtarget->isAAPCS_ABI()) {
- StaticCtorsSection = "\t.section .init_array,\"aw\",%init_array";
- StaticDtorsSection = "\t.section .fini_array,\"aw\",%fini_array";
- } else {
- StaticCtorsSection = "\t.section .ctors,\"aw\",%progbits";
- StaticDtorsSection = "\t.section .dtors,\"aw\",%progbits";
- }
- TLSDataSection = "\t.section .tdata,\"awT\",%progbits";
- TLSBSSSection = "\t.section .tbss,\"awT\",%nobits";
- }
-
- ZeroDirective = "\t.space\t";
- AlignmentIsInBytes = false;
- Data64bitsDirective = 0;
- CommentString = "@";
- DataSection = "\t.data";
- ConstantPoolSection = "\t.text\n";
- COMMDirectiveTakesAlignment = false;
- InlineAsmStart = "@ InlineAsm Start";
- InlineAsmEnd = "@ InlineAsm End";
- LCOMMDirective = "\t.lcomm\t";
-}
-
-/// Count the number of comma-separated arguments.
-/// Do not try to detect errors.
-unsigned ARMTargetAsmInfo::countArguments(const char* p) const {
- unsigned count = 0;
- while (*p && isspace(*p) && *p != '\n')
- p++;
- count++;
- while (*p && *p!='\n' &&
- strncmp(p, CommentString, strlen(CommentString))!=0) {
- if (*p==',')
- count++;
- p++;
- }
- return count;
-}
-
-/// Count the length of a string enclosed in quote characters.
-/// Do not try to detect errors.
-unsigned ARMTargetAsmInfo::countString(const char* p) const {
- unsigned count = 0;
- while (*p && isspace(*p) && *p!='\n')
- p++;
- if (!*p || *p != '\"')
- return count;
- while (*++p && *p != '\"')
- count++;
- return count;
-}
-
-/// ARM-specific version of TargetAsmInfo::getInlineAsmLength.
-unsigned ARMTargetAsmInfo::getInlineAsmLength(const char *s) const {
- // Make a lowercase-folded version of s for counting purposes.
- char *q, *s_copy = (char *)malloc(strlen(s) + 1);
- strcpy(s_copy, s);
- for (q=s_copy; *q; q++)
- *q = tolower(*q);
- const char *Str = s_copy;
-
- // Count the number of bytes in the asm.
- bool atInsnStart = true;
- bool inTextSection = true;
- unsigned Length = 0;
- for (; *Str; ++Str) {
- if (atInsnStart) {
- // Skip whitespace
- while (*Str && isspace(*Str) && *Str != '\n')
- Str++;
- // Skip label
- for (const char* p = Str; *p && !isspace(*p); p++)
- if (*p == ':') {
- Str = p+1;
- while (*Str && isspace(*Str) && *Str != '\n')
- Str++;
- break;
- }
- // Ignore everything from comment char(s) to EOL
- if (strncmp(Str, CommentString, strlen(CommentString))==-0)
- atInsnStart = false;
- // FIXME do something like the following for non-Darwin
- else if (*Str == '.' && Subtarget->isTargetDarwin()) {
- // Directive.
- atInsnStart = false;
-
- // Some change the section, but don't generate code.
- if (strncmp(Str, ".literal4", strlen(".literal4"))==0 ||
- strncmp(Str, ".literal8", strlen(".literal8"))==0 ||
- strncmp(Str, ".const", strlen(".const"))==0 ||
- strncmp(Str, ".constructor", strlen(".constructor"))==0 ||
- strncmp(Str, ".cstring", strlen(".cstring"))==0 ||
- strncmp(Str, ".data", strlen(".data"))==0 ||
- strncmp(Str, ".destructor", strlen(".destructor"))==0 ||
- strncmp(Str, ".fvmlib_init0", strlen(".fvmlib_init0"))==0 ||
- strncmp(Str, ".fvmlib_init1", strlen(".fvmlib_init1"))==0 ||
- strncmp(Str, ".mod_init_func", strlen(".mod_init_func"))==0 ||
- strncmp(Str, ".mod_term_func", strlen(".mod_term_func"))==0 ||
- strncmp(Str, ".picsymbol_stub", strlen(".picsymbol_stub"))==0 ||
- strncmp(Str, ".symbol_stub", strlen(".symbol_stub"))==0 ||
- strncmp(Str, ".static_data", strlen(".static_data"))==0 ||
- strncmp(Str, ".section", strlen(".section"))==0 ||
- strncmp(Str, ".lazy_symbol_pointer", strlen(".lazy_symbol_pointer"))==0 ||
- strncmp(Str, ".non_lazy_symbol_pointer", strlen(".non_lazy_symbol_pointer"))==0 ||
- strncmp(Str, ".dyld", strlen(".dyld"))==0 ||
- strncmp(Str, ".const_data", strlen(".const_data"))==0 ||
- strncmp(Str, ".objc", strlen(".objc"))==0 || //// many directives
- strncmp(Str, ".static_const", strlen(".static_const"))==0)
- inTextSection=false;
- else if (strncmp(Str, ".text", strlen(".text"))==0)
- inTextSection = true;
- // Some can't really be handled without implementing significant pieces
- // of an assembler. Others require dynamic adjustment of block sizes in
- // AdjustBBOffsetsAfter; it's a big compile-time speed hit to check every
- // instruction in there, and none of these are currently used in the kernel.
- else if (strncmp(Str, ".macro", strlen(".macro"))==0 ||
- strncmp(Str, ".if", strlen(".if"))==0 ||
- strncmp(Str, ".align", strlen(".align"))==0 ||
- strncmp(Str, ".fill", strlen(".fill"))==0 ||
- strncmp(Str, ".space", strlen(".space"))==0 ||
- strncmp(Str, ".zerofill", strlen(".zerofill"))==0 ||
- strncmp(Str, ".p2align", strlen(".p2align"))==0 ||
- strncmp(Str, ".p2alignw", strlen(".p2alignw"))==0 ||
- strncmp(Str, ".p2alignl", strlen(".p2alignl"))==0 ||
- strncmp(Str, ".align32", strlen(".p2align32"))==0 ||
- strncmp(Str, ".include", strlen(".include"))==0)
- cerr << "Directive " << Str << " in asm may lead to invalid offsets for" <<
- " constant pools (the assembler will tell you if this happens).\n";
- // Some generate code, but this is only interesting in the text section.
- else if (inTextSection) {
- if (strncmp(Str, ".long", strlen(".long"))==0)
- Length += 4*countArguments(Str+strlen(".long"));
- else if (strncmp(Str, ".short", strlen(".short"))==0)
- Length += 2*countArguments(Str+strlen(".short"));
- else if (strncmp(Str, ".byte", strlen(".byte"))==0)
- Length += 1*countArguments(Str+strlen(".byte"));
- else if (strncmp(Str, ".single", strlen(".single"))==0)
- Length += 4*countArguments(Str+strlen(".single"));
- else if (strncmp(Str, ".double", strlen(".double"))==0)
- Length += 8*countArguments(Str+strlen(".double"));
- else if (strncmp(Str, ".quad", strlen(".quad"))==0)
- Length += 16*countArguments(Str+strlen(".quad"));
- else if (strncmp(Str, ".ascii", strlen(".ascii"))==0)
- Length += countString(Str+strlen(".ascii"));
- else if (strncmp(Str, ".asciz", strlen(".asciz"))==0)
- Length += countString(Str+strlen(".asciz"))+1;
- }
- } else if (inTextSection) {
- // An instruction
- atInsnStart = false;
- if (Subtarget->isThumb()) {
- // BL and BLX <non-reg> are 4 bytes, all others 2.
- if (strncmp(Str, "blx", strlen("blx"))==0) {
- const char* p = Str+3;
- while (*p && isspace(*p))
- p++;
- if (*p == 'r' || *p=='R')
- Length += 2; // BLX reg
- else
- Length += 4; // BLX non-reg
- } else if (strncmp(Str, "bl", strlen("bl"))==0)
- Length += 4; // BL
- else
- Length += 2; // Thumb anything else
- }
- else
- Length += 4; // ARM
- }
- }
- if (*Str == '\n' || *Str == SeparatorChar)
- atInsnStart = true;
- }
- free(s_copy);
- return Length;
-}
diff --git a/release_23/lib/Target/ARM/ARMTargetAsmInfo.h b/release_23/lib/Target/ARM/ARMTargetAsmInfo.h
deleted file mode 100644
index 56539696cde2..000000000000
--- a/release_23/lib/Target/ARM/ARMTargetAsmInfo.h
+++ /dev/null
@@ -1,38 +0,0 @@
-//=====-- ARMTargetAsmInfo.h - ARM asm properties -------------*- C++ -*--====//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains the declaration of the ARMTargetAsmInfo class.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef ARMTARGETASMINFO_H
-#define ARMTARGETASMINFO_H
-
-#include "llvm/Target/TargetAsmInfo.h"
-#include "ARMSubtarget.h"
-
-namespace llvm {
-
- // Forward declaration.
- class ARMTargetMachine;
-
- struct ARMTargetAsmInfo : public TargetAsmInfo {
- explicit ARMTargetAsmInfo(const ARMTargetMachine &TM);
-
- const ARMSubtarget *Subtarget;
-
- virtual unsigned getInlineAsmLength(const char *Str) const;
- unsigned countArguments(const char *p) const;
- unsigned countString(const char *p) const;
- };
-
-
-} // namespace llvm
-
-#endif
diff --git a/release_23/lib/Target/ARM/ARMTargetMachine.cpp b/release_23/lib/Target/ARM/ARMTargetMachine.cpp
deleted file mode 100644
index d084fffa22f4..000000000000
--- a/release_23/lib/Target/ARM/ARMTargetMachine.cpp
+++ /dev/null
@@ -1,164 +0,0 @@
-//===-- ARMTargetMachine.cpp - Define TargetMachine for ARM ---------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-//
-//===----------------------------------------------------------------------===//
-
-#include "ARMTargetMachine.h"
-#include "ARMTargetAsmInfo.h"
-#include "ARMFrameInfo.h"
-#include "ARM.h"
-#include "llvm/Module.h"
-#include "llvm/PassManager.h"
-#include "llvm/CodeGen/Passes.h"
-#include "llvm/Support/CommandLine.h"
-#include "llvm/Target/TargetMachineRegistry.h"
-#include "llvm/Target/TargetOptions.h"
-using namespace llvm;
-
-static cl::opt<bool> DisableLdStOpti("disable-arm-loadstore-opti", cl::Hidden,
- cl::desc("Disable load store optimization pass"));
-static cl::opt<bool> DisableIfConversion("disable-arm-if-conversion",cl::Hidden,
- cl::desc("Disable if-conversion pass"));
-
-namespace {
- // Register the target.
- RegisterTarget<ARMTargetMachine> X("arm", " ARM");
- RegisterTarget<ThumbTargetMachine> Y("thumb", " Thumb");
-}
-
-/// ThumbTargetMachine - Create an Thumb architecture model.
-///
-unsigned ThumbTargetMachine::getJITMatchQuality() {
-#if defined(__thumb__)
- return 10;
-#endif
- return 0;
-}
-
-unsigned ThumbTargetMachine::getModuleMatchQuality(const Module &M) {
- std::string TT = M.getTargetTriple();
- if (TT.size() >= 6 && std::string(TT.begin(), TT.begin()+6) == "thumb-")
- return 20;
-
- // If the target triple is something non-thumb, we don't match.
- if (!TT.empty()) return 0;
-
- if (M.getEndianness() == Module::LittleEndian &&
- M.getPointerSize() == Module::Pointer32)
- return 10; // Weak match
- else if (M.getEndianness() != Module::AnyEndianness ||
- M.getPointerSize() != Module::AnyPointerSize)
- return 0; // Match for some other target
-
- return getJITMatchQuality()/2;
-}
-
-ThumbTargetMachine::ThumbTargetMachine(const Module &M, const std::string &FS)
- : ARMTargetMachine(M, FS, true) {
-}
-
-/// TargetMachine ctor - Create an ARM architecture model.
-///
-ARMTargetMachine::ARMTargetMachine(const Module &M, const std::string &FS,
- bool isThumb)
- : Subtarget(M, FS, isThumb),
- DataLayout(Subtarget.isAPCS_ABI() ?
- // APCS ABI
- (isThumb ?
- std::string("e-p:32:32-f64:32:32-i64:32:32-"
- "i16:16:32-i8:8:32-i1:8:32-a:0:32") :
- std::string("e-p:32:32-f64:32:32-i64:32:32")) :
- // AAPCS ABI
- (isThumb ?
- std::string("e-p:32:32-f64:64:64-i64:64:64-"
- "i16:16:32-i8:8:32-i1:8:32-a:0:32") :
- std::string("e-p:32:32-f64:64:64-i64:64:64"))),
- InstrInfo(Subtarget),
- FrameInfo(Subtarget),
- JITInfo(*this),
- TLInfo(*this) {}
-
-unsigned ARMTargetMachine::getJITMatchQuality() {
-#if defined(__arm__)
- return 10;
-#endif
- return 0;
-}
-
-unsigned ARMTargetMachine::getModuleMatchQuality(const Module &M) {
- std::string TT = M.getTargetTriple();
- if (TT.size() >= 4 && // Match arm-foo-bar, as well as things like armv5blah-*
- (TT.substr(0, 4) == "arm-" || TT.substr(0, 4) == "armv"))
- return 20;
- // If the target triple is something non-arm, we don't match.
- if (!TT.empty()) return 0;
-
- if (M.getEndianness() == Module::LittleEndian &&
- M.getPointerSize() == Module::Pointer32)
- return 10; // Weak match
- else if (M.getEndianness() != Module::AnyEndianness ||
- M.getPointerSize() != Module::AnyPointerSize)
- return 0; // Match for some other target
-
- return getJITMatchQuality()/2;
-}
-
-
-const TargetAsmInfo *ARMTargetMachine::createTargetAsmInfo() const {
- return new ARMTargetAsmInfo(*this);
-}
-
-
-// Pass Pipeline Configuration
-bool ARMTargetMachine::addInstSelector(PassManagerBase &PM, bool Fast) {
- PM.add(createARMISelDag(*this));
- return false;
-}
-
-bool ARMTargetMachine::addPreEmitPass(PassManagerBase &PM, bool Fast) {
- // FIXME: temporarily disabling load / store optimization pass for Thumb mode.
- if (!Fast && !DisableLdStOpti && !Subtarget.isThumb())
- PM.add(createARMLoadStoreOptimizationPass());
-
- if (!Fast && !DisableIfConversion && !Subtarget.isThumb())
- PM.add(createIfConverterPass());
-
- PM.add(createARMConstantIslandPass());
- return true;
-}
-
-bool ARMTargetMachine::addAssemblyEmitter(PassManagerBase &PM, bool Fast,
- std::ostream &Out) {
- // Output assembly language.
- PM.add(createARMCodePrinterPass(Out, *this));
- return false;
-}
-
-
-bool ARMTargetMachine::addCodeEmitter(PassManagerBase &PM, bool Fast,
- bool DumpAsm, MachineCodeEmitter &MCE) {
- // FIXME: Move this to TargetJITInfo!
- setRelocationModel(Reloc::Static);
-
- // Machine code emitter pass for ARM.
- PM.add(createARMCodeEmitterPass(*this, MCE));
- if (DumpAsm)
- PM.add(createARMCodePrinterPass(*cerr.stream(), *this));
- return false;
-}
-
-bool ARMTargetMachine::addSimpleCodeEmitter(PassManagerBase &PM, bool Fast,
- bool DumpAsm, MachineCodeEmitter &MCE) {
- // Machine code emitter pass for ARM.
- PM.add(createARMCodeEmitterPass(*this, MCE));
- if (DumpAsm)
- PM.add(createARMCodePrinterPass(*cerr.stream(), *this));
- return false;
-}
diff --git a/release_23/lib/Target/ARM/ARMTargetMachine.h b/release_23/lib/Target/ARM/ARMTargetMachine.h
deleted file mode 100644
index d4c411857212..000000000000
--- a/release_23/lib/Target/ARM/ARMTargetMachine.h
+++ /dev/null
@@ -1,80 +0,0 @@
-//===-- ARMTargetMachine.h - Define TargetMachine for ARM -------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file declares the ARM specific subclass of TargetMachine.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef ARMTARGETMACHINE_H
-#define ARMTARGETMACHINE_H
-
-#include "llvm/Target/TargetMachine.h"
-#include "llvm/Target/TargetData.h"
-#include "llvm/Target/TargetFrameInfo.h"
-#include "ARMInstrInfo.h"
-#include "ARMFrameInfo.h"
-#include "ARMJITInfo.h"
-#include "ARMSubtarget.h"
-#include "ARMISelLowering.h"
-
-namespace llvm {
-
-class Module;
-
-class ARMTargetMachine : public LLVMTargetMachine {
- ARMSubtarget Subtarget;
- const TargetData DataLayout; // Calculates type size & alignment
- ARMInstrInfo InstrInfo;
- ARMFrameInfo FrameInfo;
- ARMJITInfo JITInfo;
- ARMTargetLowering TLInfo;
-
-public:
- ARMTargetMachine(const Module &M, const std::string &FS, bool isThumb = false);
-
- virtual const ARMInstrInfo *getInstrInfo() const { return &InstrInfo; }
- virtual const TargetFrameInfo *getFrameInfo() const { return &FrameInfo; }
- virtual TargetJITInfo *getJITInfo() { return &JITInfo; }
- virtual const TargetRegisterInfo *getRegisterInfo() const {
- return &InstrInfo.getRegisterInfo();
- }
- virtual const TargetData *getTargetData() const { return &DataLayout; }
- virtual const ARMSubtarget *getSubtargetImpl() const { return &Subtarget; }
- virtual ARMTargetLowering *getTargetLowering() const {
- return const_cast<ARMTargetLowering*>(&TLInfo);
- }
- static unsigned getModuleMatchQuality(const Module &M);
- static unsigned getJITMatchQuality();
-
- virtual const TargetAsmInfo *createTargetAsmInfo() const;
-
- // Pass Pipeline Configuration
- virtual bool addInstSelector(PassManagerBase &PM, bool Fast);
- virtual bool addPreEmitPass(PassManagerBase &PM, bool Fast);
- virtual bool addAssemblyEmitter(PassManagerBase &PM, bool Fast,
- std::ostream &Out);
- virtual bool addCodeEmitter(PassManagerBase &PM, bool Fast,
- bool DumpAsm, MachineCodeEmitter &MCE);
- virtual bool addSimpleCodeEmitter(PassManagerBase &PM, bool Fast,
- bool DumpAsm, MachineCodeEmitter &MCE);
-};
-
-/// ThumbTargetMachine - Thumb target machine.
-///
-class ThumbTargetMachine : public ARMTargetMachine {
-public:
- ThumbTargetMachine(const Module &M, const std::string &FS);
-
- static unsigned getJITMatchQuality();
- static unsigned getModuleMatchQuality(const Module &M);
-};
-
-} // end namespace llvm
-
-#endif
diff --git a/release_23/lib/Target/ARM/Makefile b/release_23/lib/Target/ARM/Makefile
deleted file mode 100644
index 50313a9ac219..000000000000
--- a/release_23/lib/Target/ARM/Makefile
+++ /dev/null
@@ -1,20 +0,0 @@
-##===- lib/Target/ARM/Makefile -----------------------------*- Makefile -*-===##
-#
-# The LLVM Compiler Infrastructure
-#
-# This file is distributed under the University of Illinois Open Source
-# License. See LICENSE.TXT for details.
-#
-##===----------------------------------------------------------------------===##
-
-LEVEL = ../../..
-LIBRARYNAME = LLVMARM
-TARGET = ARM
-
-# Make sure that tblgen is run, first thing.
-BUILT_SOURCES = ARMGenRegisterInfo.h.inc ARMGenRegisterNames.inc \
- ARMGenRegisterInfo.inc ARMGenInstrNames.inc \
- ARMGenInstrInfo.inc ARMGenAsmWriter.inc \
- ARMGenDAGISel.inc ARMGenSubtarget.inc
-
-include $(LEVEL)/Makefile.common
diff --git a/release_23/lib/Target/ARM/README-Thumb.txt b/release_23/lib/Target/ARM/README-Thumb.txt
deleted file mode 100644
index 5bd16a343356..000000000000
--- a/release_23/lib/Target/ARM/README-Thumb.txt
+++ /dev/null
@@ -1,227 +0,0 @@
-//===---------------------------------------------------------------------===//
-// Random ideas for the ARM backend (Thumb specific).
-//===---------------------------------------------------------------------===//
-
-* Add support for compiling functions in both ARM and Thumb mode, then taking
- the smallest.
-* Add support for compiling individual basic blocks in thumb mode, when in a
- larger ARM function. This can be used for presumed cold code, like paths
- to abort (failure path of asserts), EH handling code, etc.
-
-* Thumb doesn't have normal pre/post increment addressing modes, but you can
- load/store 32-bit integers with pre/postinc by using load/store multiple
- instrs with a single register.
-
-* Make better use of high registers r8, r10, r11, r12 (ip). Some variants of add
- and cmp instructions can use high registers. Also, we can use them as
- temporaries to spill values into.
-
-* In thumb mode, short, byte, and bool preferred alignments are currently set
- to 4 to accommodate ISA restriction (i.e. add sp, #imm, imm must be multiple
- of 4).
-
-//===---------------------------------------------------------------------===//
-
-Potential jumptable improvements:
-
-* If we know function size is less than (1 << 16) * 2 bytes, we can use 16-bit
- jumptable entries (e.g. (L1 - L2) >> 1). Or even smaller entries if the
- function is even smaller. This also applies to ARM.
-
-* Thumb jumptable codegen can improve given some help from the assembler. This
- is what we generate right now:
-
- .set PCRELV0, (LJTI1_0_0-(LPCRELL0+4))
-LPCRELL0:
- mov r1, #PCRELV0
- add r1, pc
- ldr r0, [r0, r1]
- cpy pc, r0
- .align 2
-LJTI1_0_0:
- .long LBB1_3
- ...
-
-Note there is another pc relative add that we can take advantage of.
- add r1, pc, #imm_8 * 4
-
-We should be able to generate:
-
-LPCRELL0:
- add r1, LJTI1_0_0
- ldr r0, [r0, r1]
- cpy pc, r0
- .align 2
-LJTI1_0_0:
- .long LBB1_3
-
-if the assembler can translate the add to:
- add r1, pc, #((LJTI1_0_0-(LPCRELL0+4))&0xfffffffc)
-
-Note the assembler also does something similar to constpool load:
-LPCRELL0:
- ldr r0, LCPI1_0
-=>
- ldr r0, pc, #((LCPI1_0-(LPCRELL0+4))&0xfffffffc)
-
-
-//===---------------------------------------------------------------------===//
-
-We compiles the following:
-
-define i16 @func_entry_2E_ce(i32 %i) {
- switch i32 %i, label %bb12.exitStub [
- i32 0, label %bb4.exitStub
- i32 1, label %bb9.exitStub
- i32 2, label %bb4.exitStub
- i32 3, label %bb4.exitStub
- i32 7, label %bb9.exitStub
- i32 8, label %bb.exitStub
- i32 9, label %bb9.exitStub
- ]
-
-bb12.exitStub:
- ret i16 0
-
-bb4.exitStub:
- ret i16 1
-
-bb9.exitStub:
- ret i16 2
-
-bb.exitStub:
- ret i16 3
-}
-
-into:
-
-_func_entry_2E_ce:
- mov r2, #1
- lsl r2, r0
- cmp r0, #9
- bhi LBB1_4 @bb12.exitStub
-LBB1_1: @newFuncRoot
- mov r1, #13
- tst r2, r1
- bne LBB1_5 @bb4.exitStub
-LBB1_2: @newFuncRoot
- ldr r1, LCPI1_0
- tst r2, r1
- bne LBB1_6 @bb9.exitStub
-LBB1_3: @newFuncRoot
- mov r1, #1
- lsl r1, r1, #8
- tst r2, r1
- bne LBB1_7 @bb.exitStub
-LBB1_4: @bb12.exitStub
- mov r0, #0
- bx lr
-LBB1_5: @bb4.exitStub
- mov r0, #1
- bx lr
-LBB1_6: @bb9.exitStub
- mov r0, #2
- bx lr
-LBB1_7: @bb.exitStub
- mov r0, #3
- bx lr
-LBB1_8:
- .align 2
-LCPI1_0:
- .long 642
-
-
-gcc compiles to:
-
- cmp r0, #9
- @ lr needed for prologue
- bhi L2
- ldr r3, L11
- mov r2, #1
- mov r1, r2, asl r0
- ands r0, r3, r2, asl r0
- movne r0, #2
- bxne lr
- tst r1, #13
- beq L9
-L3:
- mov r0, r2
- bx lr
-L9:
- tst r1, #256
- movne r0, #3
- bxne lr
-L2:
- mov r0, #0
- bx lr
-L12:
- .align 2
-L11:
- .long 642
-
-
-GCC is doing a couple of clever things here:
- 1. It is predicating one of the returns. This isn't a clear win though: in
- cases where that return isn't taken, it is replacing one condbranch with
- two 'ne' predicated instructions.
- 2. It is sinking the shift of "1 << i" into the tst, and using ands instead of
- tst. This will probably require whole function isel.
- 3. GCC emits:
- tst r1, #256
- we emit:
- mov r1, #1
- lsl r1, r1, #8
- tst r2, r1
-
-
-//===---------------------------------------------------------------------===//
-
-When spilling in thumb mode and the sp offset is too large to fit in the ldr /
-str offset field, we load the offset from a constpool entry and add it to sp:
-
-ldr r2, LCPI
-add r2, sp
-ldr r2, [r2]
-
-These instructions preserve the condition code which is important if the spill
-is between a cmp and a bcc instruction. However, we can use the (potentially)
-cheaper sequnce if we know it's ok to clobber the condition register.
-
-add r2, sp, #255 * 4
-add r2, #132
-ldr r2, [r2, #7 * 4]
-
-This is especially bad when dynamic alloca is used. The all fixed size stack
-objects are referenced off the frame pointer with negative offsets. See
-oggenc for an example.
-
-//===---------------------------------------------------------------------===//
-
-We are reserving R3 as a scratch register under thumb mode. So if it is live in
-to the function, we save / restore R3 to / from R12. Until register scavenging
-is done, we should save R3 to a high callee saved reg at emitPrologue time
-(when hasFP is true or stack size is large) and restore R3 from that register
-instead. This allows us to at least get rid of the save to r12 everytime it is
-used.
-
-//===---------------------------------------------------------------------===//
-
-Poor codegen test/CodeGen/ARM/select.ll f7:
-
- ldr r5, LCPI1_0
-LPC0:
- add r5, pc
- ldr r6, LCPI1_1
- ldr r2, LCPI1_2
- cpy r3, r6
- cpy lr, pc
- bx r5
-
-//===---------------------------------------------------------------------===//
-
-Make register allocator / spiller smarter so we can re-materialize "mov r, imm",
-etc. Almost all Thumb instructions clobber condition code.
-
-//===---------------------------------------------------------------------===//
-
-Add ldmia, stmia support.
diff --git a/release_23/lib/Target/ARM/README.txt b/release_23/lib/Target/ARM/README.txt
deleted file mode 100644
index 068c441ed737..000000000000
--- a/release_23/lib/Target/ARM/README.txt
+++ /dev/null
@@ -1,554 +0,0 @@
-//===---------------------------------------------------------------------===//
-// Random ideas for the ARM backend.
-//===---------------------------------------------------------------------===//
-
-Reimplement 'select' in terms of 'SEL'.
-
-* We would really like to support UXTAB16, but we need to prove that the
- add doesn't need to overflow between the two 16-bit chunks.
-
-* Implement pre/post increment support. (e.g. PR935)
-* Coalesce stack slots!
-* Implement smarter constant generation for binops with large immediates.
-
-* Consider materializing FP constants like 0.0f and 1.0f using integer
- immediate instructions then copy to FPU. Slower than load into FPU?
-
-//===---------------------------------------------------------------------===//
-
-Crazy idea: Consider code that uses lots of 8-bit or 16-bit values. By the
-time regalloc happens, these values are now in a 32-bit register, usually with
-the top-bits known to be sign or zero extended. If spilled, we should be able
-to spill these to a 8-bit or 16-bit stack slot, zero or sign extending as part
-of the reload.
-
-Doing this reduces the size of the stack frame (important for thumb etc), and
-also increases the likelihood that we will be able to reload multiple values
-from the stack with a single load.
-
-//===---------------------------------------------------------------------===//
-
-The constant island pass is in good shape. Some cleanups might be desirable,
-but there is unlikely to be much improvement in the generated code.
-
-1. There may be some advantage to trying to be smarter about the initial
-placement, rather than putting everything at the end.
-
-2. There might be some compile-time efficiency to be had by representing
-consecutive islands as a single block rather than multiple blocks.
-
-3. Use a priority queue to sort constant pool users in inverse order of
- position so we always process the one closed to the end of functions
- first. This may simply CreateNewWater.
-
-//===---------------------------------------------------------------------===//
-
-Eliminate copysign custom expansion. We are still generating crappy code with
-default expansion + if-conversion.
-
-//===---------------------------------------------------------------------===//
-
-Eliminate one instruction from:
-
-define i32 @_Z6slow4bii(i32 %x, i32 %y) {
- %tmp = icmp sgt i32 %x, %y
- %retval = select i1 %tmp, i32 %x, i32 %y
- ret i32 %retval
-}
-
-__Z6slow4bii:
- cmp r0, r1
- movgt r1, r0
- mov r0, r1
- bx lr
-=>
-
-__Z6slow4bii:
- cmp r0, r1
- movle r0, r1
- bx lr
-
-//===---------------------------------------------------------------------===//
-
-Implement long long "X-3" with instructions that fold the immediate in. These
-were disabled due to badness with the ARM carry flag on subtracts.
-
-//===---------------------------------------------------------------------===//
-
-We currently compile abs:
-int foo(int p) { return p < 0 ? -p : p; }
-
-into:
-
-_foo:
- rsb r1, r0, #0
- cmn r0, #1
- movgt r1, r0
- mov r0, r1
- bx lr
-
-This is very, uh, literal. This could be a 3 operation sequence:
- t = (p sra 31);
- res = (p xor t)-t
-
-Which would be better. This occurs in png decode.
-
-//===---------------------------------------------------------------------===//
-
-More load / store optimizations:
-1) Look past instructions without side-effects (not load, store, branch, etc.)
- when forming the list of loads / stores to optimize.
-
-2) Smarter register allocation?
-We are probably missing some opportunities to use ldm / stm. Consider:
-
-ldr r5, [r0]
-ldr r4, [r0, #4]
-
-This cannot be merged into a ldm. Perhaps we will need to do the transformation
-before register allocation. Then teach the register allocator to allocate a
-chunk of consecutive registers.
-
-3) Better representation for block transfer? This is from Olden/power:
-
- fldd d0, [r4]
- fstd d0, [r4, #+32]
- fldd d0, [r4, #+8]
- fstd d0, [r4, #+40]
- fldd d0, [r4, #+16]
- fstd d0, [r4, #+48]
- fldd d0, [r4, #+24]
- fstd d0, [r4, #+56]
-
-If we can spare the registers, it would be better to use fldm and fstm here.
-Need major register allocator enhancement though.
-
-4) Can we recognize the relative position of constantpool entries? i.e. Treat
-
- ldr r0, LCPI17_3
- ldr r1, LCPI17_4
- ldr r2, LCPI17_5
-
- as
- ldr r0, LCPI17
- ldr r1, LCPI17+4
- ldr r2, LCPI17+8
-
- Then the ldr's can be combined into a single ldm. See Olden/power.
-
-Note for ARM v4 gcc uses ldmia to load a pair of 32-bit values to represent a
-double 64-bit FP constant:
-
- adr r0, L6
- ldmia r0, {r0-r1}
-
- .align 2
-L6:
- .long -858993459
- .long 1074318540
-
-5) Can we make use of ldrd and strd? Instead of generating ldm / stm, use
-ldrd/strd instead if there are only two destination registers that form an
-odd/even pair. However, we probably would pay a penalty if the address is not
-aligned on 8-byte boundary. This requires more information on load / store
-nodes (and MI's?) then we currently carry.
-
-6) struct copies appear to be done field by field
-instead of by words, at least sometimes:
-
-struct foo { int x; short s; char c1; char c2; };
-void cpy(struct foo*a, struct foo*b) { *a = *b; }
-
-llvm code (-O2)
- ldrb r3, [r1, #+6]
- ldr r2, [r1]
- ldrb r12, [r1, #+7]
- ldrh r1, [r1, #+4]
- str r2, [r0]
- strh r1, [r0, #+4]
- strb r3, [r0, #+6]
- strb r12, [r0, #+7]
-gcc code (-O2)
- ldmia r1, {r1-r2}
- stmia r0, {r1-r2}
-
-In this benchmark poor handling of aggregate copies has shown up as
-having a large effect on size, and possibly speed as well (we don't have
-a good way to measure on ARM).
-
-//===---------------------------------------------------------------------===//
-
-* Consider this silly example:
-
-double bar(double x) {
- double r = foo(3.1);
- return x+r;
-}
-
-_bar:
- stmfd sp!, {r4, r5, r7, lr}
- add r7, sp, #8
- mov r4, r0
- mov r5, r1
- fldd d0, LCPI1_0
- fmrrd r0, r1, d0
- bl _foo
- fmdrr d0, r4, r5
- fmsr s2, r0
- fsitod d1, s2
- faddd d0, d1, d0
- fmrrd r0, r1, d0
- ldmfd sp!, {r4, r5, r7, pc}
-
-Ignore the prologue and epilogue stuff for a second. Note
- mov r4, r0
- mov r5, r1
-the copys to callee-save registers and the fact they are only being used by the
-fmdrr instruction. It would have been better had the fmdrr been scheduled
-before the call and place the result in a callee-save DPR register. The two
-mov ops would not have been necessary.
-
-//===---------------------------------------------------------------------===//
-
-Calling convention related stuff:
-
-* gcc's parameter passing implementation is terrible and we suffer as a result:
-
-e.g.
-struct s {
- double d1;
- int s1;
-};
-
-void foo(struct s S) {
- printf("%g, %d\n", S.d1, S.s1);
-}
-
-'S' is passed via registers r0, r1, r2. But gcc stores them to the stack, and
-then reload them to r1, r2, and r3 before issuing the call (r0 contains the
-address of the format string):
-
- stmfd sp!, {r7, lr}
- add r7, sp, #0
- sub sp, sp, #12
- stmia sp, {r0, r1, r2}
- ldmia sp, {r1-r2}
- ldr r0, L5
- ldr r3, [sp, #8]
-L2:
- add r0, pc, r0
- bl L_printf$stub
-
-Instead of a stmia, ldmia, and a ldr, wouldn't it be better to do three moves?
-
-* Return an aggregate type is even worse:
-
-e.g.
-struct s foo(void) {
- struct s S = {1.1, 2};
- return S;
-}
-
- mov ip, r0
- ldr r0, L5
- sub sp, sp, #12
-L2:
- add r0, pc, r0
- @ lr needed for prologue
- ldmia r0, {r0, r1, r2}
- stmia sp, {r0, r1, r2}
- stmia ip, {r0, r1, r2}
- mov r0, ip
- add sp, sp, #12
- bx lr
-
-r0 (and later ip) is the hidden parameter from caller to store the value in. The
-first ldmia loads the constants into r0, r1, r2. The last stmia stores r0, r1,
-r2 into the address passed in. However, there is one additional stmia that
-stores r0, r1, and r2 to some stack location. The store is dead.
-
-The llvm-gcc generated code looks like this:
-
-csretcc void %foo(%struct.s* %agg.result) {
-entry:
- %S = alloca %struct.s, align 4 ; <%struct.s*> [#uses=1]
- %memtmp = alloca %struct.s ; <%struct.s*> [#uses=1]
- cast %struct.s* %S to sbyte* ; <sbyte*>:0 [#uses=2]
- call void %llvm.memcpy.i32( sbyte* %0, sbyte* cast ({ double, int }* %C.0.904 to sbyte*), uint 12, uint 4 )
- cast %struct.s* %agg.result to sbyte* ; <sbyte*>:1 [#uses=2]
- call void %llvm.memcpy.i32( sbyte* %1, sbyte* %0, uint 12, uint 0 )
- cast %struct.s* %memtmp to sbyte* ; <sbyte*>:2 [#uses=1]
- call void %llvm.memcpy.i32( sbyte* %2, sbyte* %1, uint 12, uint 0 )
- ret void
-}
-
-llc ends up issuing two memcpy's (the first memcpy becomes 3 loads from
-constantpool). Perhaps we should 1) fix llvm-gcc so the memcpy is translated
-into a number of load and stores, or 2) custom lower memcpy (of small size) to
-be ldmia / stmia. I think option 2 is better but the current register
-allocator cannot allocate a chunk of registers at a time.
-
-A feasible temporary solution is to use specific physical registers at the
-lowering time for small (<= 4 words?) transfer size.
-
-* ARM CSRet calling convention requires the hidden argument to be returned by
-the callee.
-
-//===---------------------------------------------------------------------===//
-
-We can definitely do a better job on BB placements to eliminate some branches.
-It's very common to see llvm generated assembly code that looks like this:
-
-LBB3:
- ...
-LBB4:
-...
- beq LBB3
- b LBB2
-
-If BB4 is the only predecessor of BB3, then we can emit BB3 after BB4. We can
-then eliminate beq and and turn the unconditional branch to LBB2 to a bne.
-
-See McCat/18-imp/ComputeBoundingBoxes for an example.
-
-//===---------------------------------------------------------------------===//
-
-Register scavenging is now implemented. The example in the previous version
-of this document produces optimal code at -O2.
-
-//===---------------------------------------------------------------------===//
-
-Pre-/post- indexed load / stores:
-
-1) We should not make the pre/post- indexed load/store transform if the base ptr
-is guaranteed to be live beyond the load/store. This can happen if the base
-ptr is live out of the block we are performing the optimization. e.g.
-
-mov r1, r2
-ldr r3, [r1], #4
-...
-
-vs.
-
-ldr r3, [r2]
-add r1, r2, #4
-...
-
-In most cases, this is just a wasted optimization. However, sometimes it can
-negatively impact the performance because two-address code is more restrictive
-when it comes to scheduling.
-
-Unfortunately, liveout information is currently unavailable during DAG combine
-time.
-
-2) Consider spliting a indexed load / store into a pair of add/sub + load/store
- to solve #1 (in TwoAddressInstructionPass.cpp).
-
-3) Enhance LSR to generate more opportunities for indexed ops.
-
-4) Once we added support for multiple result patterns, write indexed loads
- patterns instead of C++ instruction selection code.
-
-5) Use FLDM / FSTM to emulate indexed FP load / store.
-
-//===---------------------------------------------------------------------===//
-
-We should add i64 support to take advantage of the 64-bit load / stores.
-We can add a pseudo i64 register class containing pseudo registers that are
-register pairs. All other ops (e.g. add, sub) would be expanded as usual.
-
-We need to add pseudo instructions (i.e. gethi / getlo) to extract i32 registers
-from the i64 register. These are single moves which can be eliminated if the
-destination register is a sub-register of the source. We should implement proper
-subreg support in the register allocator to coalesce these away.
-
-There are other minor issues such as multiple instructions for a spill / restore
-/ move.
-
-//===---------------------------------------------------------------------===//
-
-Implement support for some more tricky ways to materialize immediates. For
-example, to get 0xffff8000, we can use:
-
-mov r9, #&3f8000
-sub r9, r9, #&400000
-
-//===---------------------------------------------------------------------===//
-
-We sometimes generate multiple add / sub instructions to update sp in prologue
-and epilogue if the inc / dec value is too large to fit in a single immediate
-operand. In some cases, perhaps it might be better to load the value from a
-constantpool instead.
-
-//===---------------------------------------------------------------------===//
-
-GCC generates significantly better code for this function.
-
-int foo(int StackPtr, unsigned char *Line, unsigned char *Stack, int LineLen) {
- int i = 0;
-
- if (StackPtr != 0) {
- while (StackPtr != 0 && i < (((LineLen) < (32768))? (LineLen) : (32768)))
- Line[i++] = Stack[--StackPtr];
- if (LineLen > 32768)
- {
- while (StackPtr != 0 && i < LineLen)
- {
- i++;
- --StackPtr;
- }
- }
- }
- return StackPtr;
-}
-
-//===---------------------------------------------------------------------===//
-
-This should compile to the mlas instruction:
-int mlas(int x, int y, int z) { return ((x * y + z) < 0) ? 7 : 13; }
-
-//===---------------------------------------------------------------------===//
-
-At some point, we should triage these to see if they still apply to us:
-
-http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19598
-http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18560
-http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27016
-
-http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11831
-http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11826
-http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11825
-http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11824
-http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11823
-http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11820
-http://gcc.gnu.org/bugzilla/show_bug.cgi?id=10982
-
-http://gcc.gnu.org/bugzilla/show_bug.cgi?id=10242
-http://gcc.gnu.org/bugzilla/show_bug.cgi?id=9831
-http://gcc.gnu.org/bugzilla/show_bug.cgi?id=9760
-http://gcc.gnu.org/bugzilla/show_bug.cgi?id=9759
-http://gcc.gnu.org/bugzilla/show_bug.cgi?id=9703
-http://gcc.gnu.org/bugzilla/show_bug.cgi?id=9702
-http://gcc.gnu.org/bugzilla/show_bug.cgi?id=9663
-
-http://www.inf.u-szeged.hu/gcc-arm/
-http://citeseer.ist.psu.edu/debus04linktime.html
-
-//===---------------------------------------------------------------------===//
-
-gcc generates smaller code for this function at -O2 or -Os:
-
-void foo(signed char* p) {
- if (*p == 3)
- bar();
- else if (*p == 4)
- baz();
- else if (*p == 5)
- quux();
-}
-
-llvm decides it's a good idea to turn the repeated if...else into a
-binary tree, as if it were a switch; the resulting code requires -1
-compare-and-branches when *p<=2 or *p==5, the same number if *p==4
-or *p>6, and +1 if *p==3. So it should be a speed win
-(on balance). However, the revised code is larger, with 4 conditional
-branches instead of 3.
-
-More seriously, there is a byte->word extend before
-each comparison, where there should be only one, and the condition codes
-are not remembered when the same two values are compared twice.
-
-//===---------------------------------------------------------------------===//
-
-More register scavenging work:
-
-1. Use the register scavenger to track frame index materialized into registers
- (those that do not fit in addressing modes) to allow reuse in the same BB.
-2. Finish scavenging for Thumb.
-3. We know some spills and restores are unnecessary. The issue is once live
- intervals are merged, they are not never split. So every def is spilled
- and every use requires a restore if the register allocator decides the
- resulting live interval is not assigned a physical register. It may be
- possible (with the help of the scavenger) to turn some spill / restore
- pairs into register copies.
-
-//===---------------------------------------------------------------------===//
-
-More LSR enhancements possible:
-
-1. Teach LSR about pre- and post- indexed ops to allow iv increment be merged
- in a load / store.
-2. Allow iv reuse even when a type conversion is required. For example, i8
- and i32 load / store addressing modes are identical.
-
-
-//===---------------------------------------------------------------------===//
-
-This:
-
-int foo(int a, int b, int c, int d) {
- long long acc = (long long)a * (long long)b;
- acc += (long long)c * (long long)d;
- return (int)(acc >> 32);
-}
-
-Should compile to use SMLAL (Signed Multiply Accumulate Long) which multiplies
-two signed 32-bit values to produce a 64-bit value, and accumulates this with
-a 64-bit value.
-
-We currently get this with both v4 and v6:
-
-_foo:
- smull r1, r0, r1, r0
- smull r3, r2, r3, r2
- adds r3, r3, r1
- adc r0, r2, r0
- bx lr
-
-//===---------------------------------------------------------------------===//
-
-This:
- #include <algorithm>
- std::pair<unsigned, bool> full_add(unsigned a, unsigned b)
- { return std::make_pair(a + b, a + b < a); }
- bool no_overflow(unsigned a, unsigned b)
- { return !full_add(a, b).second; }
-
-Should compile to:
-
-_Z8full_addjj:
- adds r2, r1, r2
- movcc r1, #0
- movcs r1, #1
- str r2, [r0, #0]
- strb r1, [r0, #4]
- mov pc, lr
-
-_Z11no_overflowjj:
- cmn r0, r1
- movcs r0, #0
- movcc r0, #1
- mov pc, lr
-
-not:
-
-__Z8full_addjj:
- add r3, r2, r1
- str r3, [r0]
- mov r2, #1
- mov r12, #0
- cmp r3, r1
- movlo r12, r2
- str r12, [r0, #+4]
- bx lr
-__Z11no_overflowjj:
- add r3, r1, r0
- mov r2, #1
- mov r1, #0
- cmp r3, r0
- movhs r1, r2
- mov r0, r1
- bx lr
-
-//===---------------------------------------------------------------------===//
-
diff --git a/release_23/lib/Target/Alpha/Alpha.h b/release_23/lib/Target/Alpha/Alpha.h
deleted file mode 100644
index 40725afcfefd..000000000000
--- a/release_23/lib/Target/Alpha/Alpha.h
+++ /dev/null
@@ -1,48 +0,0 @@
-//===-- Alpha.h - Top-level interface for Alpha representation --*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains the entry points for global functions defined in the LLVM
-// Alpha back-end.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef TARGET_ALPHA_H
-#define TARGET_ALPHA_H
-
-#include <iosfwd>
-
-namespace llvm {
-
- class AlphaTargetMachine;
- class FunctionPass;
- class TargetMachine;
- class MachineCodeEmitter;
-
- FunctionPass *createAlphaSimpleInstructionSelector(TargetMachine &TM);
- FunctionPass *createAlphaISelDag(TargetMachine &TM);
- FunctionPass *createAlphaCodePrinterPass(std::ostream &OS,
- TargetMachine &TM);
- FunctionPass *createAlphaPatternInstructionSelector(TargetMachine &TM);
- FunctionPass *createAlphaCodeEmitterPass(AlphaTargetMachine &TM,
- MachineCodeEmitter &MCE);
- FunctionPass *createAlphaLLRPPass(AlphaTargetMachine &tm);
- FunctionPass *createAlphaBranchSelectionPass();
-
-} // end namespace llvm;
-
-// Defines symbolic names for Alpha registers. This defines a mapping from
-// register name to register number.
-//
-#include "AlphaGenRegisterNames.inc"
-
-// Defines symbolic names for the Alpha instructions.
-//
-#include "AlphaGenInstrNames.inc"
-
-#endif
diff --git a/release_23/lib/Target/Alpha/Alpha.td b/release_23/lib/Target/Alpha/Alpha.td
deleted file mode 100644
index 65a760bdbe0a..000000000000
--- a/release_23/lib/Target/Alpha/Alpha.td
+++ /dev/null
@@ -1,66 +0,0 @@
-//===- Alpha.td - Describe the Alpha Target Machine --------*- tablegen -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-//
-//===----------------------------------------------------------------------===//
-
-// Get the target-independent interfaces which we are implementing...
-//
-include "../Target.td"
-
-//Alpha is little endian
-
-//===----------------------------------------------------------------------===//
-// Subtarget Features
-//===----------------------------------------------------------------------===//
-
-def FeatureCIX : SubtargetFeature<"cix", "HasCT", "true",
- "Enable CIX extentions">;
-
-//===----------------------------------------------------------------------===//
-// Register File Description
-//===----------------------------------------------------------------------===//
-
-include "AlphaRegisterInfo.td"
-
-//===----------------------------------------------------------------------===//
-// Schedule Description
-//===----------------------------------------------------------------------===//
-
-include "AlphaSchedule.td"
-
-//===----------------------------------------------------------------------===//
-// Instruction Descriptions
-//===----------------------------------------------------------------------===//
-
-include "AlphaInstrInfo.td"
-
-def AlphaInstrInfo : InstrInfo {
- // Define how we want to layout our target-specific information field.
- // let TSFlagsFields = [];
- // let TSFlagsShifts = [];
-}
-
-//===----------------------------------------------------------------------===//
-// Alpha Processor Definitions
-//===----------------------------------------------------------------------===//
-
-def : Processor<"generic", Alpha21264Itineraries, []>;
-def : Processor<"ev6" , Alpha21264Itineraries, []>;
-def : Processor<"ev67" , Alpha21264Itineraries, [FeatureCIX]>;
-
-//===----------------------------------------------------------------------===//
-// The Alpha Target
-//===----------------------------------------------------------------------===//
-
-
-def Alpha : Target {
- // Pull in Instruction Info:
- let InstructionSet = AlphaInstrInfo;
-}
diff --git a/release_23/lib/Target/Alpha/AlphaAsmPrinter.cpp b/release_23/lib/Target/Alpha/AlphaAsmPrinter.cpp
deleted file mode 100644
index 42e4b7843cf2..000000000000
--- a/release_23/lib/Target/Alpha/AlphaAsmPrinter.cpp
+++ /dev/null
@@ -1,295 +0,0 @@
-//===-- AlphaAsmPrinter.cpp - Alpha LLVM assembly writer ------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains a printer that converts from our internal representation
-// of machine-dependent LLVM code to GAS-format Alpha assembly language.
-//
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "asm-printer"
-#include "Alpha.h"
-#include "AlphaInstrInfo.h"
-#include "AlphaTargetMachine.h"
-#include "llvm/Module.h"
-#include "llvm/Type.h"
-#include "llvm/Assembly/Writer.h"
-#include "llvm/CodeGen/AsmPrinter.h"
-#include "llvm/Target/TargetAsmInfo.h"
-#include "llvm/Target/TargetMachine.h"
-#include "llvm/Support/Compiler.h"
-#include "llvm/Support/Mangler.h"
-#include "llvm/ADT/Statistic.h"
-using namespace llvm;
-
-STATISTIC(EmittedInsts, "Number of machine instrs printed");
-
-namespace {
- struct VISIBILITY_HIDDEN AlphaAsmPrinter : public AsmPrinter {
-
- /// Unique incrementer for label values for referencing Global values.
- ///
-
- AlphaAsmPrinter(std::ostream &o, TargetMachine &tm, const TargetAsmInfo *T)
- : AsmPrinter(o, tm, T) {
- }
-
- virtual const char *getPassName() const {
- return "Alpha Assembly Printer";
- }
- bool printInstruction(const MachineInstr *MI);
- void printOp(const MachineOperand &MO, bool IsCallOp = false);
- void printOperand(const MachineInstr *MI, int opNum);
- void printBaseOffsetPair (const MachineInstr *MI, int i, bool brackets=true);
- bool runOnMachineFunction(MachineFunction &F);
- bool doInitialization(Module &M);
- bool doFinalization(Module &M);
-
- bool PrintAsmOperand(const MachineInstr *MI, unsigned OpNo,
- unsigned AsmVariant, const char *ExtraCode);
- bool PrintAsmMemoryOperand(const MachineInstr *MI,
- unsigned OpNo,
- unsigned AsmVariant,
- const char *ExtraCode);
- };
-} // end of anonymous namespace
-
-/// createAlphaCodePrinterPass - Returns a pass that prints the Alpha
-/// assembly code for a MachineFunction to the given output stream,
-/// using the given target machine description. This should work
-/// regardless of whether the function is in SSA form.
-///
-FunctionPass *llvm::createAlphaCodePrinterPass(std::ostream &o,
- TargetMachine &tm) {
- return new AlphaAsmPrinter(o, tm, tm.getTargetAsmInfo());
-}
-
-#include "AlphaGenAsmWriter.inc"
-
-void AlphaAsmPrinter::printOperand(const MachineInstr *MI, int opNum)
-{
- const MachineOperand &MO = MI->getOperand(opNum);
- if (MO.getType() == MachineOperand::MO_Register) {
- assert(TargetRegisterInfo::isPhysicalRegister(MO.getReg()) &&
- "Not physreg??");
- O << TM.getRegisterInfo()->get(MO.getReg()).AsmName;
- } else if (MO.isImmediate()) {
- O << MO.getImm();
- assert(MO.getImm() < (1 << 30));
- } else {
- printOp(MO);
- }
-}
-
-
-void AlphaAsmPrinter::printOp(const MachineOperand &MO, bool IsCallOp) {
- const TargetRegisterInfo &RI = *TM.getRegisterInfo();
-
- switch (MO.getType()) {
- case MachineOperand::MO_Register:
- O << RI.get(MO.getReg()).AsmName;
- return;
-
- case MachineOperand::MO_Immediate:
- cerr << "printOp() does not handle immediate values\n";
- abort();
- return;
-
- case MachineOperand::MO_MachineBasicBlock:
- printBasicBlockLabel(MO.getMBB());
- return;
-
- case MachineOperand::MO_ConstantPoolIndex:
- O << TAI->getPrivateGlobalPrefix() << "CPI" << getFunctionNumber() << "_"
- << MO.getIndex();
- return;
-
- case MachineOperand::MO_ExternalSymbol:
- O << MO.getSymbolName();
- return;
-
- case MachineOperand::MO_GlobalAddress: {
- GlobalValue *GV = MO.getGlobal();
- O << Mang->getValueName(GV);
- if (GV->isDeclaration() && GV->hasExternalWeakLinkage())
- ExtWeakSymbols.insert(GV);
- return;
- }
-
- case MachineOperand::MO_JumpTableIndex:
- O << TAI->getPrivateGlobalPrefix() << "JTI" << getFunctionNumber()
- << '_' << MO.getIndex();
- return;
-
- default:
- O << "<unknown operand type: " << MO.getType() << ">";
- return;
- }
-}
-
-/// runOnMachineFunction - This uses the printMachineInstruction()
-/// method to print assembly for each instruction.
-///
-bool AlphaAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
- SetupMachineFunction(MF);
- O << "\n\n";
-
- // Print out constants referenced by the function
- EmitConstantPool(MF.getConstantPool());
-
- // Print out jump tables referenced by the function
- EmitJumpTableInfo(MF.getJumpTableInfo(), MF);
-
- // Print out labels for the function.
- const Function *F = MF.getFunction();
- SwitchToTextSection(getSectionForFunction(*F).c_str(), F);
-
- EmitAlignment(4, F);
- switch (F->getLinkage()) {
- default: assert(0 && "Unknown linkage type!");
- case Function::InternalLinkage: // Symbols default to internal.
- break;
- case Function::ExternalLinkage:
- O << "\t.globl " << CurrentFnName << "\n";
- break;
- case Function::WeakLinkage:
- case Function::LinkOnceLinkage:
- O << TAI->getWeakRefDirective() << CurrentFnName << "\n";
- break;
- }
-
- O << "\t.ent " << CurrentFnName << "\n";
-
- O << CurrentFnName << ":\n";
-
- // Print out code for the function.
- for (MachineFunction::const_iterator I = MF.begin(), E = MF.end();
- I != E; ++I) {
- if (I != MF.begin()) {
- printBasicBlockLabel(I, true, true);
- O << '\n';
- }
- for (MachineBasicBlock::const_iterator II = I->begin(), E = I->end();
- II != E; ++II) {
- // Print the assembly for the instruction.
- ++EmittedInsts;
- if (!printInstruction(II)) {
- assert(0 && "Unhandled instruction in asm writer!");
- abort();
- }
- }
- }
-
- O << "\t.end " << CurrentFnName << "\n";
-
- // We didn't modify anything.
- return false;
-}
-
-bool AlphaAsmPrinter::doInitialization(Module &M)
-{
- if(TM.getSubtarget<AlphaSubtarget>().hasCT())
- O << "\t.arch ev6\n"; //This might need to be ev67, so leave this test here
- else
- O << "\t.arch ev6\n";
- O << "\t.set noat\n";
- return AsmPrinter::doInitialization(M);
-}
-
-bool AlphaAsmPrinter::doFinalization(Module &M) {
- const TargetData *TD = TM.getTargetData();
-
- for (Module::const_global_iterator I = M.global_begin(), E = M.global_end(); I != E; ++I) {
-
- if (!I->hasInitializer()) continue; // External global require no code
-
- // Check to see if this is a special global used by LLVM, if so, emit it.
- if (EmitSpecialLLVMGlobal(I))
- continue;
-
- std::string name = Mang->getValueName(I);
- Constant *C = I->getInitializer();
- unsigned Size = TD->getABITypeSize(C->getType());
- unsigned Align = TD->getPreferredAlignmentLog(I);
-
- //1: hidden?
- if (I->hasHiddenVisibility())
- O << TAI->getHiddenDirective() << name << "\n";
-
- //2: kind
- switch (I->getLinkage()) {
- case GlobalValue::LinkOnceLinkage:
- case GlobalValue::WeakLinkage:
- O << TAI->getWeakRefDirective() << name << '\n';
- break;
- case GlobalValue::AppendingLinkage:
- case GlobalValue::ExternalLinkage:
- O << "\t.globl " << name << "\n";
- break;
- case GlobalValue::InternalLinkage:
- break;
- default:
- assert(0 && "Unknown linkage type!");
- cerr << "Unknown linkage type!\n";
- abort();
- }
-
- //3: Section (if changed)
- if (I->hasSection() &&
- (I->getSection() == ".ctors" ||
- I->getSection() == ".dtors")) {
- std::string SectionName = ".section\t" + I->getSection()
- + ",\"aw\",@progbits";
- SwitchToDataSection(SectionName.c_str());
- } else {
- if (C->isNullValue())
- SwitchToDataSection("\t.section\t.bss", I);
- else
- SwitchToDataSection("\t.section\t.data", I);
- }
-
- //4: Type, Size, Align
- O << "\t.type\t" << name << ", @object\n";
- O << "\t.size\t" << name << ", " << Size << "\n";
- EmitAlignment(Align, I);
-
- O << name << ":\n";
-
- // If the initializer is a extern weak symbol, remember to emit the weak
- // reference!
- if (const GlobalValue *GV = dyn_cast<GlobalValue>(C))
- if (GV->hasExternalWeakLinkage())
- ExtWeakSymbols.insert(GV);
-
- EmitGlobalConstant(C);
- O << '\n';
- }
-
- return AsmPrinter::doFinalization(M);
-}
-
-/// PrintAsmOperand - Print out an operand for an inline asm expression.
-///
-bool AlphaAsmPrinter::PrintAsmOperand(const MachineInstr *MI, unsigned OpNo,
- unsigned AsmVariant,
- const char *ExtraCode) {
- printOperand(MI, OpNo);
- return false;
-}
-
-bool AlphaAsmPrinter::PrintAsmMemoryOperand(const MachineInstr *MI,
- unsigned OpNo,
- unsigned AsmVariant,
- const char *ExtraCode) {
- if (ExtraCode && ExtraCode[0])
- return true; // Unknown modifier.
- O << "0(";
- printOperand(MI, OpNo);
- O << ")";
- return false;
-}
diff --git a/release_23/lib/Target/Alpha/AlphaBranchSelector.cpp b/release_23/lib/Target/Alpha/AlphaBranchSelector.cpp
deleted file mode 100644
index f1d60c836f7b..000000000000
--- a/release_23/lib/Target/Alpha/AlphaBranchSelector.cpp
+++ /dev/null
@@ -1,67 +0,0 @@
-//===-- AlphaBranchSelector.cpp - Convert Pseudo branchs ----------*- C++ -*-=//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// Replace Pseudo COND_BRANCH_* with their appropriate real branch
-// Simplified version of the PPC Branch Selector
-//
-//===----------------------------------------------------------------------===//
-
-#include "Alpha.h"
-#include "AlphaInstrInfo.h"
-#include "llvm/CodeGen/MachineFunctionPass.h"
-#include "llvm/Support/Compiler.h"
-#include "llvm/Target/TargetMachine.h"
-#include "llvm/Target/TargetAsmInfo.h"
-using namespace llvm;
-
-namespace {
- struct VISIBILITY_HIDDEN AlphaBSel : public MachineFunctionPass {
- static char ID;
- AlphaBSel() : MachineFunctionPass((intptr_t)&ID) {}
-
- virtual bool runOnMachineFunction(MachineFunction &Fn);
-
- virtual const char *getPassName() const {
- return "Alpha Branch Selection";
- }
- };
- char AlphaBSel::ID = 0;
-}
-
-/// createAlphaBranchSelectionPass - returns an instance of the Branch Selection
-/// Pass
-///
-FunctionPass *llvm::createAlphaBranchSelectionPass() {
- return new AlphaBSel();
-}
-
-bool AlphaBSel::runOnMachineFunction(MachineFunction &Fn) {
-
- for (MachineFunction::iterator MFI = Fn.begin(), E = Fn.end(); MFI != E;
- ++MFI) {
- MachineBasicBlock *MBB = MFI;
-
- for (MachineBasicBlock::iterator MBBI = MBB->begin(), EE = MBB->end();
- MBBI != EE; ++MBBI) {
- if (MBBI->getOpcode() == Alpha::COND_BRANCH_I ||
- MBBI->getOpcode() == Alpha::COND_BRANCH_F) {
-
- // condbranch operands:
- // 0. bc opcode
- // 1. reg
- // 2. target MBB
- const TargetInstrInfo *TII = Fn.getTarget().getInstrInfo();
- MBBI->setDesc(TII->get(MBBI->getOperand(0).getImm()));
- }
- }
- }
-
- return true;
-}
-
diff --git a/release_23/lib/Target/Alpha/AlphaCodeEmitter.cpp b/release_23/lib/Target/Alpha/AlphaCodeEmitter.cpp
deleted file mode 100644
index 51a1404f32ca..000000000000
--- a/release_23/lib/Target/Alpha/AlphaCodeEmitter.cpp
+++ /dev/null
@@ -1,219 +0,0 @@
-//===-- Alpha/AlphaCodeEmitter.cpp - Convert Alpha code to machine code ---===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains the pass that transforms the Alpha machine instructions
-// into relocatable machine code.
-//
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "alpha-emitter"
-#include "AlphaTargetMachine.h"
-#include "AlphaRelocations.h"
-#include "Alpha.h"
-#include "llvm/PassManager.h"
-#include "llvm/CodeGen/MachineCodeEmitter.h"
-#include "llvm/CodeGen/MachineFunctionPass.h"
-#include "llvm/CodeGen/MachineInstr.h"
-#include "llvm/CodeGen/Passes.h"
-#include "llvm/Function.h"
-#include "llvm/Support/Debug.h"
-using namespace llvm;
-
-namespace {
- class AlphaCodeEmitter : public MachineFunctionPass {
- const AlphaInstrInfo *II;
- TargetMachine &TM;
- MachineCodeEmitter &MCE;
-
- /// getMachineOpValue - evaluates the MachineOperand of a given MachineInstr
- ///
- int getMachineOpValue(MachineInstr &MI, MachineOperand &MO);
-
- public:
- static char ID;
- explicit AlphaCodeEmitter(TargetMachine &tm, MachineCodeEmitter &mce)
- : MachineFunctionPass((intptr_t)&ID), II(0), TM(tm), MCE(mce) {}
- AlphaCodeEmitter(TargetMachine &tm, MachineCodeEmitter &mce,
- const AlphaInstrInfo& ii)
- : MachineFunctionPass((intptr_t)&ID), II(&ii), TM(tm), MCE(mce) {}
-
- bool runOnMachineFunction(MachineFunction &MF);
-
- virtual const char *getPassName() const {
- return "Alpha Machine Code Emitter";
- }
-
- void emitInstruction(const MachineInstr &MI);
-
- /// getBinaryCodeForInstr - This function, generated by the
- /// CodeEmitterGenerator using TableGen, produces the binary encoding for
- /// machine instructions.
- ///
- unsigned getBinaryCodeForInstr(MachineInstr &MI);
-
- private:
- void emitBasicBlock(MachineBasicBlock &MBB);
-
- };
- char AlphaCodeEmitter::ID = 0;
-}
-
-/// createAlphaCodeEmitterPass - Return a pass that emits the collected Alpha code
-/// to the specified MCE object.
-FunctionPass *llvm::createAlphaCodeEmitterPass(AlphaTargetMachine &TM,
- MachineCodeEmitter &MCE) {
- return new AlphaCodeEmitter(TM, MCE);
-}
-
-bool AlphaCodeEmitter::runOnMachineFunction(MachineFunction &MF) {
- II = ((AlphaTargetMachine&)MF.getTarget()).getInstrInfo();
-
- do {
- MCE.startFunction(MF);
- for (MachineFunction::iterator I = MF.begin(), E = MF.end(); I != E; ++I)
- emitBasicBlock(*I);
- } while (MCE.finishFunction(MF));
-
- return false;
-}
-
-void AlphaCodeEmitter::emitBasicBlock(MachineBasicBlock &MBB) {
- MCE.StartMachineBasicBlock(&MBB);
- for (MachineBasicBlock::iterator I = MBB.begin(), E = MBB.end();
- I != E; ++I) {
- MachineInstr &MI = *I;
- switch(MI.getOpcode()) {
- default:
- MCE.emitWordLE(getBinaryCodeForInstr(*I));
- break;
- case Alpha::ALTENT:
- case Alpha::PCLABEL:
- case Alpha::MEMLABEL:
- case TargetInstrInfo::IMPLICIT_DEF:
- break; //skip these
- }
- }
-}
-
-static unsigned getAlphaRegNumber(unsigned Reg) {
- switch (Reg) {
- case Alpha::R0 : case Alpha::F0 : return 0;
- case Alpha::R1 : case Alpha::F1 : return 1;
- case Alpha::R2 : case Alpha::F2 : return 2;
- case Alpha::R3 : case Alpha::F3 : return 3;
- case Alpha::R4 : case Alpha::F4 : return 4;
- case Alpha::R5 : case Alpha::F5 : return 5;
- case Alpha::R6 : case Alpha::F6 : return 6;
- case Alpha::R7 : case Alpha::F7 : return 7;
- case Alpha::R8 : case Alpha::F8 : return 8;
- case Alpha::R9 : case Alpha::F9 : return 9;
- case Alpha::R10 : case Alpha::F10 : return 10;
- case Alpha::R11 : case Alpha::F11 : return 11;
- case Alpha::R12 : case Alpha::F12 : return 12;
- case Alpha::R13 : case Alpha::F13 : return 13;
- case Alpha::R14 : case Alpha::F14 : return 14;
- case Alpha::R15 : case Alpha::F15 : return 15;
- case Alpha::R16 : case Alpha::F16 : return 16;
- case Alpha::R17 : case Alpha::F17 : return 17;
- case Alpha::R18 : case Alpha::F18 : return 18;
- case Alpha::R19 : case Alpha::F19 : return 19;
- case Alpha::R20 : case Alpha::F20 : return 20;
- case Alpha::R21 : case Alpha::F21 : return 21;
- case Alpha::R22 : case Alpha::F22 : return 22;
- case Alpha::R23 : case Alpha::F23 : return 23;
- case Alpha::R24 : case Alpha::F24 : return 24;
- case Alpha::R25 : case Alpha::F25 : return 25;
- case Alpha::R26 : case Alpha::F26 : return 26;
- case Alpha::R27 : case Alpha::F27 : return 27;
- case Alpha::R28 : case Alpha::F28 : return 28;
- case Alpha::R29 : case Alpha::F29 : return 29;
- case Alpha::R30 : case Alpha::F30 : return 30;
- case Alpha::R31 : case Alpha::F31 : return 31;
- default:
- assert(0 && "Unhandled reg");
- abort();
- }
-}
-
-int AlphaCodeEmitter::getMachineOpValue(MachineInstr &MI, MachineOperand &MO) {
-
- int rv = 0; // Return value; defaults to 0 for unhandled cases
- // or things that get fixed up later by the JIT.
-
- if (MO.isRegister()) {
- rv = getAlphaRegNumber(MO.getReg());
- } else if (MO.isImmediate()) {
- rv = MO.getImm();
- } else if (MO.isGlobalAddress() || MO.isExternalSymbol()
- || MO.isConstantPoolIndex()) {
- DOUT << MO << " is a relocated op for " << MI << "\n";
- unsigned Reloc = 0;
- int Offset = 0;
- bool useGOT = false;
- switch (MI.getOpcode()) {
- case Alpha::BSR:
- Reloc = Alpha::reloc_bsr;
- break;
- case Alpha::LDLr:
- case Alpha::LDQr:
- case Alpha::LDBUr:
- case Alpha::LDWUr:
- case Alpha::LDSr:
- case Alpha::LDTr:
- case Alpha::LDAr:
- case Alpha::STQr:
- case Alpha::STLr:
- case Alpha::STWr:
- case Alpha::STBr:
- case Alpha::STSr:
- case Alpha::STTr:
- Reloc = Alpha::reloc_gprellow;
- break;
- case Alpha::LDAHr:
- Reloc = Alpha::reloc_gprelhigh;
- break;
- case Alpha::LDQl:
- Reloc = Alpha::reloc_literal;
- useGOT = true;
- break;
- case Alpha::LDAg:
- case Alpha::LDAHg:
- Reloc = Alpha::reloc_gpdist;
- Offset = MI.getOperand(3).getImm();
- break;
- default:
- assert(0 && "unknown relocatable instruction");
- abort();
- }
- if (MO.isGlobalAddress())
- MCE.addRelocation(MachineRelocation::getGV(MCE.getCurrentPCOffset(),
- Reloc, MO.getGlobal(), Offset,
- isa<Function>(MO.getGlobal()),
- useGOT));
- else if (MO.isExternalSymbol())
- MCE.addRelocation(MachineRelocation::getExtSym(MCE.getCurrentPCOffset(),
- Reloc, MO.getSymbolName(),
- Offset, true));
- else
- MCE.addRelocation(MachineRelocation::getConstPool(MCE.getCurrentPCOffset(),
- Reloc, MO.getIndex(), Offset));
- } else if (MO.isMachineBasicBlock()) {
- MCE.addRelocation(MachineRelocation::getBB(MCE.getCurrentPCOffset(),
- Alpha::reloc_bsr, MO.getMBB()));
- }else {
- cerr << "ERROR: Unknown type of MachineOperand: " << MO << "\n";
- abort();
- }
-
- return rv;
-}
-
-
-#include "AlphaGenCodeEmitter.inc"
-
diff --git a/release_23/lib/Target/Alpha/AlphaISelDAGToDAG.cpp b/release_23/lib/Target/Alpha/AlphaISelDAGToDAG.cpp
deleted file mode 100644
index b0ca39b945c9..000000000000
--- a/release_23/lib/Target/Alpha/AlphaISelDAGToDAG.cpp
+++ /dev/null
@@ -1,564 +0,0 @@
-//===-- AlphaISelDAGToDAG.cpp - Alpha pattern matching inst selector ------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines a pattern matching instruction selector for Alpha,
-// converting from a legalized dag to a Alpha dag.
-//
-//===----------------------------------------------------------------------===//
-
-#include "Alpha.h"
-#include "AlphaTargetMachine.h"
-#include "AlphaISelLowering.h"
-#include "llvm/CodeGen/MachineInstrBuilder.h"
-#include "llvm/CodeGen/MachineFrameInfo.h"
-#include "llvm/CodeGen/MachineFunction.h"
-#include "llvm/CodeGen/MachineRegisterInfo.h"
-#include "llvm/CodeGen/SelectionDAG.h"
-#include "llvm/CodeGen/SelectionDAGISel.h"
-#include "llvm/Target/TargetOptions.h"
-#include "llvm/Constants.h"
-#include "llvm/DerivedTypes.h"
-#include "llvm/GlobalValue.h"
-#include "llvm/Intrinsics.h"
-#include "llvm/Support/Compiler.h"
-#include "llvm/Support/Debug.h"
-#include "llvm/Support/MathExtras.h"
-#include <algorithm>
-#include <queue>
-#include <set>
-using namespace llvm;
-
-namespace {
-
- //===--------------------------------------------------------------------===//
- /// AlphaDAGToDAGISel - Alpha specific code to select Alpha machine
- /// instructions for SelectionDAG operations.
- class AlphaDAGToDAGISel : public SelectionDAGISel {
- AlphaTargetLowering AlphaLowering;
-
- static const int64_t IMM_LOW = -32768;
- static const int64_t IMM_HIGH = 32767;
- static const int64_t IMM_MULT = 65536;
- static const int64_t IMM_FULLHIGH = IMM_HIGH + IMM_HIGH * IMM_MULT;
- static const int64_t IMM_FULLLOW = IMM_LOW + IMM_LOW * IMM_MULT;
-
- static int64_t get_ldah16(int64_t x) {
- int64_t y = x / IMM_MULT;
- if (x % IMM_MULT > IMM_HIGH)
- ++y;
- return y;
- }
-
- static int64_t get_lda16(int64_t x) {
- return x - get_ldah16(x) * IMM_MULT;
- }
-
- /// get_zapImm - Return a zap mask if X is a valid immediate for a zapnot
- /// instruction (if not, return 0). Note that this code accepts partial
- /// zap masks. For example (and LHS, 1) is a valid zap, as long we know
- /// that the bits 1-7 of LHS are already zero. If LHS is non-null, we are
- /// in checking mode. If LHS is null, we assume that the mask has already
- /// been validated before.
- uint64_t get_zapImm(SDOperand LHS, uint64_t Constant) {
- uint64_t BitsToCheck = 0;
- unsigned Result = 0;
- for (unsigned i = 0; i != 8; ++i) {
- if (((Constant >> 8*i) & 0xFF) == 0) {
- // nothing to do.
- } else {
- Result |= 1 << i;
- if (((Constant >> 8*i) & 0xFF) == 0xFF) {
- // If the entire byte is set, zapnot the byte.
- } else if (LHS.Val == 0) {
- // Otherwise, if the mask was previously validated, we know its okay
- // to zapnot this entire byte even though all the bits aren't set.
- } else {
- // Otherwise we don't know that the it's okay to zapnot this entire
- // byte. Only do this iff we can prove that the missing bits are
- // already null, so the bytezap doesn't need to really null them.
- BitsToCheck |= ~Constant & (0xFF << 8*i);
- }
- }
- }
-
- // If there are missing bits in a byte (for example, X & 0xEF00), check to
- // see if the missing bits (0x1000) are already known zero if not, the zap
- // isn't okay to do, as it won't clear all the required bits.
- if (BitsToCheck &&
- !CurDAG->MaskedValueIsZero(LHS,
- APInt(LHS.getValueSizeInBits(),
- BitsToCheck)))
- return 0;
-
- return Result;
- }
-
- static uint64_t get_zapImm(uint64_t x) {
- unsigned build = 0;
- for(int i = 0; i != 8; ++i) {
- if ((x & 0x00FF) == 0x00FF)
- build |= 1 << i;
- else if ((x & 0x00FF) != 0)
- return 0;
- x >>= 8;
- }
- return build;
- }
-
-
- static uint64_t getNearPower2(uint64_t x) {
- if (!x) return 0;
- unsigned at = CountLeadingZeros_64(x);
- uint64_t complow = 1 << (63 - at);
- uint64_t comphigh = 1 << (64 - at);
- //cerr << x << ":" << complow << ":" << comphigh << "\n";
- if (abs(complow - x) <= abs(comphigh - x))
- return complow;
- else
- return comphigh;
- }
-
- static bool chkRemNearPower2(uint64_t x, uint64_t r, bool swap) {
- uint64_t y = getNearPower2(x);
- if (swap)
- return (y - x) == r;
- else
- return (x - y) == r;
- }
-
- static bool isFPZ(SDOperand N) {
- ConstantFPSDNode *CN = dyn_cast<ConstantFPSDNode>(N);
- return (CN && (CN->getValueAPF().isZero()));
- }
- static bool isFPZn(SDOperand N) {
- ConstantFPSDNode *CN = dyn_cast<ConstantFPSDNode>(N);
- return (CN && CN->getValueAPF().isNegZero());
- }
- static bool isFPZp(SDOperand N) {
- ConstantFPSDNode *CN = dyn_cast<ConstantFPSDNode>(N);
- return (CN && CN->getValueAPF().isPosZero());
- }
-
- public:
- AlphaDAGToDAGISel(TargetMachine &TM)
- : SelectionDAGISel(AlphaLowering),
- AlphaLowering(*(AlphaTargetLowering*)(TM.getTargetLowering()))
- {}
-
- /// getI64Imm - Return a target constant with the specified value, of type
- /// i64.
- inline SDOperand getI64Imm(int64_t Imm) {
- return CurDAG->getTargetConstant(Imm, MVT::i64);
- }
-
- // Select - Convert the specified operand from a target-independent to a
- // target-specific node if it hasn't already been changed.
- SDNode *Select(SDOperand Op);
-
- /// InstructionSelectBasicBlock - This callback is invoked by
- /// SelectionDAGISel when it has created a SelectionDAG for us to codegen.
- virtual void InstructionSelectBasicBlock(SelectionDAG &DAG);
-
- virtual const char *getPassName() const {
- return "Alpha DAG->DAG Pattern Instruction Selection";
- }
-
- /// SelectInlineAsmMemoryOperand - Implement addressing mode selection for
- /// inline asm expressions.
- virtual bool SelectInlineAsmMemoryOperand(const SDOperand &Op,
- char ConstraintCode,
- std::vector<SDOperand> &OutOps,
- SelectionDAG &DAG) {
- SDOperand Op0;
- switch (ConstraintCode) {
- default: return true;
- case 'm': // memory
- Op0 = Op;
- AddToISelQueue(Op0);
- break;
- }
-
- OutOps.push_back(Op0);
- return false;
- }
-
-// Include the pieces autogenerated from the target description.
-#include "AlphaGenDAGISel.inc"
-
-private:
- SDOperand getGlobalBaseReg();
- SDOperand getGlobalRetAddr();
- void SelectCALL(SDOperand Op);
-
- };
-}
-
-/// getGlobalBaseReg - Output the instructions required to put the
-/// GOT address into a register.
-///
-SDOperand AlphaDAGToDAGISel::getGlobalBaseReg() {
- unsigned GP = 0;
- for(MachineRegisterInfo::livein_iterator ii = RegInfo->livein_begin(),
- ee = RegInfo->livein_end(); ii != ee; ++ii)
- if (ii->first == Alpha::R29) {
- GP = ii->second;
- break;
- }
- assert(GP && "GOT PTR not in liveins");
- return CurDAG->getCopyFromReg(CurDAG->getEntryNode(),
- GP, MVT::i64);
-}
-
-/// getRASaveReg - Grab the return address
-///
-SDOperand AlphaDAGToDAGISel::getGlobalRetAddr() {
- unsigned RA = 0;
- for(MachineRegisterInfo::livein_iterator ii = RegInfo->livein_begin(),
- ee = RegInfo->livein_end(); ii != ee; ++ii)
- if (ii->first == Alpha::R26) {
- RA = ii->second;
- break;
- }
- assert(RA && "RA PTR not in liveins");
- return CurDAG->getCopyFromReg(CurDAG->getEntryNode(),
- RA, MVT::i64);
-}
-
-/// InstructionSelectBasicBlock - This callback is invoked by
-/// SelectionDAGISel when it has created a SelectionDAG for us to codegen.
-void AlphaDAGToDAGISel::InstructionSelectBasicBlock(SelectionDAG &DAG) {
- DEBUG(BB->dump());
-
- // Select target instructions for the DAG.
- DAG.setRoot(SelectRoot(DAG.getRoot()));
- DAG.RemoveDeadNodes();
-
- // Emit machine code to BB.
- ScheduleAndEmitDAG(DAG);
-}
-
-// Select - Convert the specified operand from a target-independent to a
-// target-specific node if it hasn't already been changed.
-SDNode *AlphaDAGToDAGISel::Select(SDOperand Op) {
- SDNode *N = Op.Val;
- if (N->getOpcode() >= ISD::BUILTIN_OP_END &&
- N->getOpcode() < AlphaISD::FIRST_NUMBER) {
- return NULL; // Already selected.
- }
-
- switch (N->getOpcode()) {
- default: break;
- case AlphaISD::CALL:
- SelectCALL(Op);
- return NULL;
-
- case ISD::FrameIndex: {
- int FI = cast<FrameIndexSDNode>(N)->getIndex();
- return CurDAG->SelectNodeTo(N, Alpha::LDA, MVT::i64,
- CurDAG->getTargetFrameIndex(FI, MVT::i32),
- getI64Imm(0));
- }
- case ISD::GLOBAL_OFFSET_TABLE: {
- SDOperand Result = getGlobalBaseReg();
- ReplaceUses(Op, Result);
- return NULL;
- }
- case AlphaISD::GlobalRetAddr: {
- SDOperand Result = getGlobalRetAddr();
- ReplaceUses(Op, Result);
- return NULL;
- }
-
- case AlphaISD::DivCall: {
- SDOperand Chain = CurDAG->getEntryNode();
- SDOperand N0 = Op.getOperand(0);
- SDOperand N1 = Op.getOperand(1);
- SDOperand N2 = Op.getOperand(2);
- AddToISelQueue(N0);
- AddToISelQueue(N1);
- AddToISelQueue(N2);
- Chain = CurDAG->getCopyToReg(Chain, Alpha::R24, N1,
- SDOperand(0,0));
- Chain = CurDAG->getCopyToReg(Chain, Alpha::R25, N2,
- Chain.getValue(1));
- Chain = CurDAG->getCopyToReg(Chain, Alpha::R27, N0,
- Chain.getValue(1));
- SDNode *CNode =
- CurDAG->getTargetNode(Alpha::JSRs, MVT::Other, MVT::Flag,
- Chain, Chain.getValue(1));
- Chain = CurDAG->getCopyFromReg(Chain, Alpha::R27, MVT::i64,
- SDOperand(CNode, 1));
- return CurDAG->SelectNodeTo(N, Alpha::BISr, MVT::i64, Chain, Chain);
- }
-
- case ISD::READCYCLECOUNTER: {
- SDOperand Chain = N->getOperand(0);
- AddToISelQueue(Chain); //Select chain
- return CurDAG->getTargetNode(Alpha::RPCC, MVT::i64, MVT::Other,
- Chain);
- }
-
- case ISD::Constant: {
- uint64_t uval = cast<ConstantSDNode>(N)->getValue();
-
- if (uval == 0) {
- SDOperand Result = CurDAG->getCopyFromReg(CurDAG->getEntryNode(),
- Alpha::R31, MVT::i64);
- ReplaceUses(Op, Result);
- return NULL;
- }
-
- int64_t val = (int64_t)uval;
- int32_t val32 = (int32_t)val;
- if (val <= IMM_HIGH + IMM_HIGH * IMM_MULT &&
- val >= IMM_LOW + IMM_LOW * IMM_MULT)
- break; //(LDAH (LDA))
- if ((uval >> 32) == 0 && //empty upper bits
- val32 <= IMM_HIGH + IMM_HIGH * IMM_MULT)
- // val32 >= IMM_LOW + IMM_LOW * IMM_MULT) //always true
- break; //(zext (LDAH (LDA)))
- //Else use the constant pool
- ConstantInt *C = ConstantInt::get(Type::Int64Ty, uval);
- SDOperand CPI = CurDAG->getTargetConstantPool(C, MVT::i64);
- SDNode *Tmp = CurDAG->getTargetNode(Alpha::LDAHr, MVT::i64, CPI,
- getGlobalBaseReg());
- return CurDAG->SelectNodeTo(N, Alpha::LDQr, MVT::i64, MVT::Other,
- CPI, SDOperand(Tmp, 0), CurDAG->getEntryNode());
- }
- case ISD::TargetConstantFP: {
- ConstantFPSDNode *CN = cast<ConstantFPSDNode>(N);
- bool isDouble = N->getValueType(0) == MVT::f64;
- MVT::ValueType T = isDouble ? MVT::f64 : MVT::f32;
- if (CN->getValueAPF().isPosZero()) {
- return CurDAG->SelectNodeTo(N, isDouble ? Alpha::CPYST : Alpha::CPYSS,
- T, CurDAG->getRegister(Alpha::F31, T),
- CurDAG->getRegister(Alpha::F31, T));
- } else if (CN->getValueAPF().isNegZero()) {
- return CurDAG->SelectNodeTo(N, isDouble ? Alpha::CPYSNT : Alpha::CPYSNS,
- T, CurDAG->getRegister(Alpha::F31, T),
- CurDAG->getRegister(Alpha::F31, T));
- } else {
- abort();
- }
- break;
- }
-
- case ISD::SETCC:
- if (MVT::isFloatingPoint(N->getOperand(0).Val->getValueType(0))) {
- ISD::CondCode CC = cast<CondCodeSDNode>(N->getOperand(2))->get();
-
- unsigned Opc = Alpha::WTF;
- bool rev = false;
- bool inv = false;
- switch(CC) {
- default: DEBUG(N->dump(CurDAG)); assert(0 && "Unknown FP comparison!");
- case ISD::SETEQ: case ISD::SETOEQ: case ISD::SETUEQ:
- Opc = Alpha::CMPTEQ; break;
- case ISD::SETLT: case ISD::SETOLT: case ISD::SETULT:
- Opc = Alpha::CMPTLT; break;
- case ISD::SETLE: case ISD::SETOLE: case ISD::SETULE:
- Opc = Alpha::CMPTLE; break;
- case ISD::SETGT: case ISD::SETOGT: case ISD::SETUGT:
- Opc = Alpha::CMPTLT; rev = true; break;
- case ISD::SETGE: case ISD::SETOGE: case ISD::SETUGE:
- Opc = Alpha::CMPTLE; rev = true; break;
- case ISD::SETNE: case ISD::SETONE: case ISD::SETUNE:
- Opc = Alpha::CMPTEQ; inv = true; break;
- case ISD::SETO:
- Opc = Alpha::CMPTUN; inv = true; break;
- case ISD::SETUO:
- Opc = Alpha::CMPTUN; break;
- };
- SDOperand tmp1 = N->getOperand(rev?1:0);
- SDOperand tmp2 = N->getOperand(rev?0:1);
- AddToISelQueue(tmp1);
- AddToISelQueue(tmp2);
- SDNode *cmp = CurDAG->getTargetNode(Opc, MVT::f64, tmp1, tmp2);
- if (inv)
- cmp = CurDAG->getTargetNode(Alpha::CMPTEQ, MVT::f64, SDOperand(cmp, 0),
- CurDAG->getRegister(Alpha::F31, MVT::f64));
- switch(CC) {
- case ISD::SETUEQ: case ISD::SETULT: case ISD::SETULE:
- case ISD::SETUNE: case ISD::SETUGT: case ISD::SETUGE:
- {
- SDNode* cmp2 = CurDAG->getTargetNode(Alpha::CMPTUN, MVT::f64,
- tmp1, tmp2);
- cmp = CurDAG->getTargetNode(Alpha::ADDT, MVT::f64,
- SDOperand(cmp2, 0), SDOperand(cmp, 0));
- break;
- }
- default: break;
- }
-
- SDNode* LD = CurDAG->getTargetNode(Alpha::FTOIT, MVT::i64, SDOperand(cmp, 0));
- return CurDAG->getTargetNode(Alpha::CMPULT, MVT::i64,
- CurDAG->getRegister(Alpha::R31, MVT::i64),
- SDOperand(LD,0));
- }
- break;
-
- case ISD::SELECT:
- if (MVT::isFloatingPoint(N->getValueType(0)) &&
- (N->getOperand(0).getOpcode() != ISD::SETCC ||
- !MVT::isFloatingPoint(N->getOperand(0).getOperand(1).getValueType()))) {
- //This should be the condition not covered by the Patterns
- //FIXME: Don't have SelectCode die, but rather return something testable
- // so that things like this can be caught in fall though code
- //move int to fp
- bool isDouble = N->getValueType(0) == MVT::f64;
- SDOperand cond = N->getOperand(0);
- SDOperand TV = N->getOperand(1);
- SDOperand FV = N->getOperand(2);
- AddToISelQueue(cond);
- AddToISelQueue(TV);
- AddToISelQueue(FV);
-
- SDNode* LD = CurDAG->getTargetNode(Alpha::ITOFT, MVT::f64, cond);
- return CurDAG->getTargetNode(isDouble?Alpha::FCMOVNET:Alpha::FCMOVNES,
- MVT::f64, FV, TV, SDOperand(LD,0));
- }
- break;
-
- case ISD::AND: {
- ConstantSDNode* SC = NULL;
- ConstantSDNode* MC = NULL;
- if (N->getOperand(0).getOpcode() == ISD::SRL &&
- (MC = dyn_cast<ConstantSDNode>(N->getOperand(1))) &&
- (SC = dyn_cast<ConstantSDNode>(N->getOperand(0).getOperand(1)))) {
- uint64_t sval = SC->getValue();
- uint64_t mval = MC->getValue();
- // If the result is a zap, let the autogened stuff handle it.
- if (get_zapImm(N->getOperand(0), mval))
- break;
- // given mask X, and shift S, we want to see if there is any zap in the
- // mask if we play around with the botton S bits
- uint64_t dontcare = (~0ULL) >> (64 - sval);
- uint64_t mask = mval << sval;
-
- if (get_zapImm(mask | dontcare))
- mask = mask | dontcare;
-
- if (get_zapImm(mask)) {
- AddToISelQueue(N->getOperand(0).getOperand(0));
- SDOperand Z =
- SDOperand(CurDAG->getTargetNode(Alpha::ZAPNOTi, MVT::i64,
- N->getOperand(0).getOperand(0),
- getI64Imm(get_zapImm(mask))), 0);
- return CurDAG->getTargetNode(Alpha::SRLr, MVT::i64, Z,
- getI64Imm(sval));
- }
- }
- break;
- }
-
- }
-
- return SelectCode(Op);
-}
-
-void AlphaDAGToDAGISel::SelectCALL(SDOperand Op) {
- //TODO: add flag stuff to prevent nondeturministic breakage!
-
- SDNode *N = Op.Val;
- SDOperand Chain = N->getOperand(0);
- SDOperand Addr = N->getOperand(1);
- SDOperand InFlag(0,0); // Null incoming flag value.
- AddToISelQueue(Chain);
-
- std::vector<SDOperand> CallOperands;
- std::vector<MVT::ValueType> TypeOperands;
-
- //grab the arguments
- for(int i = 2, e = N->getNumOperands(); i < e; ++i) {
- TypeOperands.push_back(N->getOperand(i).getValueType());
- AddToISelQueue(N->getOperand(i));
- CallOperands.push_back(N->getOperand(i));
- }
- int count = N->getNumOperands() - 2;
-
- static const unsigned args_int[] = {Alpha::R16, Alpha::R17, Alpha::R18,
- Alpha::R19, Alpha::R20, Alpha::R21};
- static const unsigned args_float[] = {Alpha::F16, Alpha::F17, Alpha::F18,
- Alpha::F19, Alpha::F20, Alpha::F21};
-
- for (int i = 6; i < count; ++i) {
- unsigned Opc = Alpha::WTF;
- if (MVT::isInteger(TypeOperands[i])) {
- Opc = Alpha::STQ;
- } else if (TypeOperands[i] == MVT::f32) {
- Opc = Alpha::STS;
- } else if (TypeOperands[i] == MVT::f64) {
- Opc = Alpha::STT;
- } else
- assert(0 && "Unknown operand");
-
- SDOperand Ops[] = { CallOperands[i], getI64Imm((i - 6) * 8),
- CurDAG->getCopyFromReg(Chain, Alpha::R30, MVT::i64),
- Chain };
- Chain = SDOperand(CurDAG->getTargetNode(Opc, MVT::Other, Ops, 4), 0);
- }
- for (int i = 0; i < std::min(6, count); ++i) {
- if (MVT::isInteger(TypeOperands[i])) {
- Chain = CurDAG->getCopyToReg(Chain, args_int[i], CallOperands[i], InFlag);
- InFlag = Chain.getValue(1);
- } else if (TypeOperands[i] == MVT::f32 || TypeOperands[i] == MVT::f64) {
- Chain = CurDAG->getCopyToReg(Chain, args_float[i], CallOperands[i], InFlag);
- InFlag = Chain.getValue(1);
- } else
- assert(0 && "Unknown operand");
- }
-
- // Finally, once everything is in registers to pass to the call, emit the
- // call itself.
- if (Addr.getOpcode() == AlphaISD::GPRelLo) {
- SDOperand GOT = getGlobalBaseReg();
- Chain = CurDAG->getCopyToReg(Chain, Alpha::R29, GOT, InFlag);
- InFlag = Chain.getValue(1);
- Chain = SDOperand(CurDAG->getTargetNode(Alpha::BSR, MVT::Other, MVT::Flag,
- Addr.getOperand(0), Chain, InFlag), 0);
- } else {
- AddToISelQueue(Addr);
- Chain = CurDAG->getCopyToReg(Chain, Alpha::R27, Addr, InFlag);
- InFlag = Chain.getValue(1);
- Chain = SDOperand(CurDAG->getTargetNode(Alpha::JSR, MVT::Other, MVT::Flag,
- Chain, InFlag), 0);
- }
- InFlag = Chain.getValue(1);
-
- std::vector<SDOperand> CallResults;
-
- switch (N->getValueType(0)) {
- default: assert(0 && "Unexpected ret value!");
- case MVT::Other: break;
- case MVT::i64:
- Chain = CurDAG->getCopyFromReg(Chain, Alpha::R0, MVT::i64, InFlag).getValue(1);
- CallResults.push_back(Chain.getValue(0));
- break;
- case MVT::f32:
- Chain = CurDAG->getCopyFromReg(Chain, Alpha::F0, MVT::f32, InFlag).getValue(1);
- CallResults.push_back(Chain.getValue(0));
- break;
- case MVT::f64:
- Chain = CurDAG->getCopyFromReg(Chain, Alpha::F0, MVT::f64, InFlag).getValue(1);
- CallResults.push_back(Chain.getValue(0));
- break;
- }
-
- CallResults.push_back(Chain);
- for (unsigned i = 0, e = CallResults.size(); i != e; ++i)
- ReplaceUses(Op.getValue(i), CallResults[i]);
-}
-
-
-/// createAlphaISelDag - This pass converts a legalized DAG into a
-/// Alpha-specific DAG, ready for instruction scheduling.
-///
-FunctionPass *llvm::createAlphaISelDag(TargetMachine &TM) {
- return new AlphaDAGToDAGISel(TM);
-}
diff --git a/release_23/lib/Target/Alpha/AlphaISelLowering.cpp b/release_23/lib/Target/Alpha/AlphaISelLowering.cpp
deleted file mode 100644
index 91b118029a3d..000000000000
--- a/release_23/lib/Target/Alpha/AlphaISelLowering.cpp
+++ /dev/null
@@ -1,724 +0,0 @@
-//===-- AlphaISelLowering.cpp - Alpha DAG Lowering Implementation ---------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the AlphaISelLowering class.
-//
-//===----------------------------------------------------------------------===//
-
-#include "AlphaISelLowering.h"
-#include "AlphaTargetMachine.h"
-#include "llvm/CodeGen/MachineFrameInfo.h"
-#include "llvm/CodeGen/MachineFunction.h"
-#include "llvm/CodeGen/MachineInstrBuilder.h"
-#include "llvm/CodeGen/MachineRegisterInfo.h"
-#include "llvm/CodeGen/SelectionDAG.h"
-#include "llvm/CodeGen/MachineRegisterInfo.h"
-#include "llvm/Constants.h"
-#include "llvm/Function.h"
-#include "llvm/Module.h"
-#include "llvm/Support/CommandLine.h"
-using namespace llvm;
-
-/// AddLiveIn - This helper function adds the specified physical register to the
-/// MachineFunction as a live in value. It also creates a corresponding virtual
-/// register for it.
-static unsigned AddLiveIn(MachineFunction &MF, unsigned PReg,
- TargetRegisterClass *RC) {
- assert(RC->contains(PReg) && "Not the correct regclass!");
- unsigned VReg = MF.getRegInfo().createVirtualRegister(RC);
- MF.getRegInfo().addLiveIn(PReg, VReg);
- return VReg;
-}
-
-AlphaTargetLowering::AlphaTargetLowering(TargetMachine &TM) : TargetLowering(TM) {
- // Set up the TargetLowering object.
- //I am having problems with shr n ubyte 1
- setShiftAmountType(MVT::i64);
- setSetCCResultContents(ZeroOrOneSetCCResult);
-
- setUsesGlobalOffsetTable(true);
-
- addRegisterClass(MVT::i64, Alpha::GPRCRegisterClass);
- addRegisterClass(MVT::f64, Alpha::F8RCRegisterClass);
- addRegisterClass(MVT::f32, Alpha::F4RCRegisterClass);
-
- setLoadXAction(ISD::EXTLOAD, MVT::i1, Promote);
- setLoadXAction(ISD::EXTLOAD, MVT::f32, Expand);
-
- setLoadXAction(ISD::ZEXTLOAD, MVT::i1, Promote);
- setLoadXAction(ISD::ZEXTLOAD, MVT::i32, Expand);
-
- setLoadXAction(ISD::SEXTLOAD, MVT::i1, Promote);
- setLoadXAction(ISD::SEXTLOAD, MVT::i8, Expand);
- setLoadXAction(ISD::SEXTLOAD, MVT::i16, Expand);
-
- // setOperationAction(ISD::BRIND, MVT::Other, Expand);
- setOperationAction(ISD::BR_JT, MVT::Other, Expand);
- setOperationAction(ISD::BR_CC, MVT::Other, Expand);
- setOperationAction(ISD::SELECT_CC, MVT::Other, Expand);
-
- setOperationAction(ISD::SIGN_EXTEND_INREG, MVT::i1, Expand);
-
- setOperationAction(ISD::FREM, MVT::f32, Expand);
- setOperationAction(ISD::FREM, MVT::f64, Expand);
-
- setOperationAction(ISD::UINT_TO_FP, MVT::i64, Expand);
- setOperationAction(ISD::SINT_TO_FP, MVT::i64, Custom);
- setOperationAction(ISD::FP_TO_UINT, MVT::i64, Expand);
- setOperationAction(ISD::FP_TO_SINT, MVT::i64, Custom);
-
- if (!TM.getSubtarget<AlphaSubtarget>().hasCT()) {
- setOperationAction(ISD::CTPOP , MVT::i64 , Expand);
- setOperationAction(ISD::CTTZ , MVT::i64 , Expand);
- setOperationAction(ISD::CTLZ , MVT::i64 , Expand);
- }
- setOperationAction(ISD::BSWAP , MVT::i64, Expand);
- setOperationAction(ISD::ROTL , MVT::i64, Expand);
- setOperationAction(ISD::ROTR , MVT::i64, Expand);
-
- setOperationAction(ISD::SREM , MVT::i64, Custom);
- setOperationAction(ISD::UREM , MVT::i64, Custom);
- setOperationAction(ISD::SDIV , MVT::i64, Custom);
- setOperationAction(ISD::UDIV , MVT::i64, Custom);
-
- // We don't support sin/cos/sqrt/pow
- setOperationAction(ISD::FSIN , MVT::f64, Expand);
- setOperationAction(ISD::FCOS , MVT::f64, Expand);
- setOperationAction(ISD::FSIN , MVT::f32, Expand);
- setOperationAction(ISD::FCOS , MVT::f32, Expand);
-
- setOperationAction(ISD::FSQRT, MVT::f64, Expand);
- setOperationAction(ISD::FSQRT, MVT::f32, Expand);
-
- setOperationAction(ISD::FPOW , MVT::f32, Expand);
- setOperationAction(ISD::FPOW , MVT::f64, Expand);
-
- setOperationAction(ISD::SETCC, MVT::f32, Promote);
-
- setOperationAction(ISD::BIT_CONVERT, MVT::f32, Promote);
-
- // We don't have line number support yet.
- setOperationAction(ISD::LOCATION, MVT::Other, Expand);
- setOperationAction(ISD::DEBUG_LOC, MVT::Other, Expand);
- setOperationAction(ISD::LABEL, MVT::Other, Expand);
-
- // Not implemented yet.
- setOperationAction(ISD::STACKSAVE, MVT::Other, Expand);
- setOperationAction(ISD::STACKRESTORE, MVT::Other, Expand);
- setOperationAction(ISD::DYNAMIC_STACKALLOC, MVT::i64, Expand);
-
- // We want to legalize GlobalAddress and ConstantPool and
- // ExternalSymbols nodes into the appropriate instructions to
- // materialize the address.
- setOperationAction(ISD::GlobalAddress, MVT::i64, Custom);
- setOperationAction(ISD::ConstantPool, MVT::i64, Custom);
- setOperationAction(ISD::ExternalSymbol, MVT::i64, Custom);
- setOperationAction(ISD::GlobalTLSAddress, MVT::i64, Custom);
-
- setOperationAction(ISD::VASTART, MVT::Other, Custom);
- setOperationAction(ISD::VAEND, MVT::Other, Expand);
- setOperationAction(ISD::VACOPY, MVT::Other, Custom);
- setOperationAction(ISD::VAARG, MVT::Other, Custom);
- setOperationAction(ISD::VAARG, MVT::i32, Custom);
-
- setOperationAction(ISD::RET, MVT::Other, Custom);
-
- setOperationAction(ISD::JumpTable, MVT::i64, Custom);
- setOperationAction(ISD::JumpTable, MVT::i32, Custom);
-
- setStackPointerRegisterToSaveRestore(Alpha::R30);
-
- addLegalFPImmediate(APFloat(+0.0)); //F31
- addLegalFPImmediate(APFloat(+0.0f)); //F31
- addLegalFPImmediate(APFloat(-0.0)); //-F31
- addLegalFPImmediate(APFloat(-0.0f)); //-F31
-
- setJumpBufSize(272);
- setJumpBufAlignment(16);
-
- computeRegisterProperties();
-}
-
-MVT::ValueType
-AlphaTargetLowering::getSetCCResultType(const SDOperand &) const {
- return MVT::i64;
-}
-
-const char *AlphaTargetLowering::getTargetNodeName(unsigned Opcode) const {
- switch (Opcode) {
- default: return 0;
- case AlphaISD::CVTQT_: return "Alpha::CVTQT_";
- case AlphaISD::CVTQS_: return "Alpha::CVTQS_";
- case AlphaISD::CVTTQ_: return "Alpha::CVTTQ_";
- case AlphaISD::GPRelHi: return "Alpha::GPRelHi";
- case AlphaISD::GPRelLo: return "Alpha::GPRelLo";
- case AlphaISD::RelLit: return "Alpha::RelLit";
- case AlphaISD::GlobalRetAddr: return "Alpha::GlobalRetAddr";
- case AlphaISD::CALL: return "Alpha::CALL";
- case AlphaISD::DivCall: return "Alpha::DivCall";
- case AlphaISD::RET_FLAG: return "Alpha::RET_FLAG";
- case AlphaISD::COND_BRANCH_I: return "Alpha::COND_BRANCH_I";
- case AlphaISD::COND_BRANCH_F: return "Alpha::COND_BRANCH_F";
- }
-}
-
-static SDOperand LowerJumpTable(SDOperand Op, SelectionDAG &DAG) {
- MVT::ValueType PtrVT = Op.getValueType();
- JumpTableSDNode *JT = cast<JumpTableSDNode>(Op);
- SDOperand JTI = DAG.getTargetJumpTable(JT->getIndex(), PtrVT);
- SDOperand Zero = DAG.getConstant(0, PtrVT);
-
- SDOperand Hi = DAG.getNode(AlphaISD::GPRelHi, MVT::i64, JTI,
- DAG.getNode(ISD::GLOBAL_OFFSET_TABLE, MVT::i64));
- SDOperand Lo = DAG.getNode(AlphaISD::GPRelLo, MVT::i64, JTI, Hi);
- return Lo;
-}
-
-//http://www.cs.arizona.edu/computer.help/policy/DIGITAL_unix/
-//AA-PY8AC-TET1_html/callCH3.html#BLOCK21
-
-//For now, just use variable size stack frame format
-
-//In a standard call, the first six items are passed in registers $16
-//- $21 and/or registers $f16 - $f21. (See Section 4.1.2 for details
-//of argument-to-register correspondence.) The remaining items are
-//collected in a memory argument list that is a naturally aligned
-//array of quadwords. In a standard call, this list, if present, must
-//be passed at 0(SP).
-//7 ... n 0(SP) ... (n-7)*8(SP)
-
-// //#define FP $15
-// //#define RA $26
-// //#define PV $27
-// //#define GP $29
-// //#define SP $30
-
-static SDOperand LowerFORMAL_ARGUMENTS(SDOperand Op, SelectionDAG &DAG,
- int &VarArgsBase,
- int &VarArgsOffset) {
- MachineFunction &MF = DAG.getMachineFunction();
- MachineFrameInfo *MFI = MF.getFrameInfo();
- std::vector<SDOperand> ArgValues;
- SDOperand Root = Op.getOperand(0);
-
- AddLiveIn(MF, Alpha::R29, &Alpha::GPRCRegClass); //GP
- AddLiveIn(MF, Alpha::R26, &Alpha::GPRCRegClass); //RA
-
- unsigned args_int[] = {
- Alpha::R16, Alpha::R17, Alpha::R18, Alpha::R19, Alpha::R20, Alpha::R21};
- unsigned args_float[] = {
- Alpha::F16, Alpha::F17, Alpha::F18, Alpha::F19, Alpha::F20, Alpha::F21};
-
- for (unsigned ArgNo = 0, e = Op.Val->getNumValues()-1; ArgNo != e; ++ArgNo) {
- SDOperand argt;
- MVT::ValueType ObjectVT = Op.getValue(ArgNo).getValueType();
- SDOperand ArgVal;
-
- if (ArgNo < 6) {
- switch (ObjectVT) {
- default:
- cerr << "Unknown Type " << ObjectVT << "\n";
- abort();
- case MVT::f64:
- args_float[ArgNo] = AddLiveIn(MF, args_float[ArgNo],
- &Alpha::F8RCRegClass);
- ArgVal = DAG.getCopyFromReg(Root, args_float[ArgNo], ObjectVT);
- break;
- case MVT::f32:
- args_float[ArgNo] = AddLiveIn(MF, args_float[ArgNo],
- &Alpha::F4RCRegClass);
- ArgVal = DAG.getCopyFromReg(Root, args_float[ArgNo], ObjectVT);
- break;
- case MVT::i64:
- args_int[ArgNo] = AddLiveIn(MF, args_int[ArgNo],
- &Alpha::GPRCRegClass);
- ArgVal = DAG.getCopyFromReg(Root, args_int[ArgNo], MVT::i64);
- break;
- }
- } else { //more args
- // Create the frame index object for this incoming parameter...
- int FI = MFI->CreateFixedObject(8, 8 * (ArgNo - 6));
-
- // Create the SelectionDAG nodes corresponding to a load
- //from this parameter
- SDOperand FIN = DAG.getFrameIndex(FI, MVT::i64);
- ArgVal = DAG.getLoad(ObjectVT, Root, FIN, NULL, 0);
- }
- ArgValues.push_back(ArgVal);
- }
-
- // If the functions takes variable number of arguments, copy all regs to stack
- bool isVarArg = cast<ConstantSDNode>(Op.getOperand(2))->getValue() != 0;
- if (isVarArg) {
- VarArgsOffset = (Op.Val->getNumValues()-1) * 8;
- std::vector<SDOperand> LS;
- for (int i = 0; i < 6; ++i) {
- if (TargetRegisterInfo::isPhysicalRegister(args_int[i]))
- args_int[i] = AddLiveIn(MF, args_int[i], &Alpha::GPRCRegClass);
- SDOperand argt = DAG.getCopyFromReg(Root, args_int[i], MVT::i64);
- int FI = MFI->CreateFixedObject(8, -8 * (6 - i));
- if (i == 0) VarArgsBase = FI;
- SDOperand SDFI = DAG.getFrameIndex(FI, MVT::i64);
- LS.push_back(DAG.getStore(Root, argt, SDFI, NULL, 0));
-
- if (TargetRegisterInfo::isPhysicalRegister(args_float[i]))
- args_float[i] = AddLiveIn(MF, args_float[i], &Alpha::F8RCRegClass);
- argt = DAG.getCopyFromReg(Root, args_float[i], MVT::f64);
- FI = MFI->CreateFixedObject(8, - 8 * (12 - i));
- SDFI = DAG.getFrameIndex(FI, MVT::i64);
- LS.push_back(DAG.getStore(Root, argt, SDFI, NULL, 0));
- }
-
- //Set up a token factor with all the stack traffic
- Root = DAG.getNode(ISD::TokenFactor, MVT::Other, &LS[0], LS.size());
- }
-
- ArgValues.push_back(Root);
-
- // Return the new list of results.
- std::vector<MVT::ValueType> RetVT(Op.Val->value_begin(),
- Op.Val->value_end());
- return DAG.getNode(ISD::MERGE_VALUES, RetVT, &ArgValues[0], ArgValues.size());
-}
-
-static SDOperand LowerRET(SDOperand Op, SelectionDAG &DAG) {
- SDOperand Copy = DAG.getCopyToReg(Op.getOperand(0), Alpha::R26,
- DAG.getNode(AlphaISD::GlobalRetAddr,
- MVT::i64),
- SDOperand());
- switch (Op.getNumOperands()) {
- default:
- assert(0 && "Do not know how to return this many arguments!");
- abort();
- case 1:
- break;
- //return SDOperand(); // ret void is legal
- case 3: {
- MVT::ValueType ArgVT = Op.getOperand(1).getValueType();
- unsigned ArgReg;
- if (MVT::isInteger(ArgVT))
- ArgReg = Alpha::R0;
- else {
- assert(MVT::isFloatingPoint(ArgVT));
- ArgReg = Alpha::F0;
- }
- Copy = DAG.getCopyToReg(Copy, ArgReg, Op.getOperand(1), Copy.getValue(1));
- if (DAG.getMachineFunction().getRegInfo().liveout_empty())
- DAG.getMachineFunction().getRegInfo().addLiveOut(ArgReg);
- break;
- }
- }
- return DAG.getNode(AlphaISD::RET_FLAG, MVT::Other, Copy, Copy.getValue(1));
-}
-
-std::pair<SDOperand, SDOperand>
-AlphaTargetLowering::LowerCallTo(SDOperand Chain, const Type *RetTy,
- bool RetSExt, bool RetZExt, bool isVarArg,
- unsigned CallingConv, bool isTailCall,
- SDOperand Callee, ArgListTy &Args,
- SelectionDAG &DAG) {
- int NumBytes = 0;
- if (Args.size() > 6)
- NumBytes = (Args.size() - 6) * 8;
-
- Chain = DAG.getCALLSEQ_START(Chain,
- DAG.getConstant(NumBytes, getPointerTy()));
- std::vector<SDOperand> args_to_use;
- for (unsigned i = 0, e = Args.size(); i != e; ++i)
- {
- switch (getValueType(Args[i].Ty)) {
- default: assert(0 && "Unexpected ValueType for argument!");
- case MVT::i1:
- case MVT::i8:
- case MVT::i16:
- case MVT::i32:
- // Promote the integer to 64 bits. If the input type is signed use a
- // sign extend, otherwise use a zero extend.
- if (Args[i].isSExt)
- Args[i].Node = DAG.getNode(ISD::SIGN_EXTEND, MVT::i64, Args[i].Node);
- else if (Args[i].isZExt)
- Args[i].Node = DAG.getNode(ISD::ZERO_EXTEND, MVT::i64, Args[i].Node);
- else
- Args[i].Node = DAG.getNode(ISD::ANY_EXTEND, MVT::i64, Args[i].Node);
- break;
- case MVT::i64:
- case MVT::f64:
- case MVT::f32:
- break;
- }
- args_to_use.push_back(Args[i].Node);
- }
-
- std::vector<MVT::ValueType> RetVals;
- MVT::ValueType RetTyVT = getValueType(RetTy);
- MVT::ValueType ActualRetTyVT = RetTyVT;
- if (RetTyVT >= MVT::i1 && RetTyVT <= MVT::i32)
- ActualRetTyVT = MVT::i64;
-
- if (RetTyVT != MVT::isVoid)
- RetVals.push_back(ActualRetTyVT);
- RetVals.push_back(MVT::Other);
-
- std::vector<SDOperand> Ops;
- Ops.push_back(Chain);
- Ops.push_back(Callee);
- Ops.insert(Ops.end(), args_to_use.begin(), args_to_use.end());
- SDOperand TheCall = DAG.getNode(AlphaISD::CALL, RetVals, &Ops[0], Ops.size());
- Chain = TheCall.getValue(RetTyVT != MVT::isVoid);
- Chain = DAG.getCALLSEQ_END(Chain,
- DAG.getConstant(NumBytes, getPointerTy()),
- DAG.getConstant(0, getPointerTy()),
- SDOperand());
- SDOperand RetVal = TheCall;
-
- if (RetTyVT != ActualRetTyVT) {
- ISD::NodeType AssertKind = ISD::DELETED_NODE;
- if (RetSExt)
- AssertKind = ISD::AssertSext;
- else if (RetZExt)
- AssertKind = ISD::AssertZext;
-
- if (AssertKind != ISD::DELETED_NODE)
- RetVal = DAG.getNode(AssertKind, MVT::i64, RetVal,
- DAG.getValueType(RetTyVT));
-
- RetVal = DAG.getNode(ISD::TRUNCATE, RetTyVT, RetVal);
- }
-
- return std::make_pair(RetVal, Chain);
-}
-
-/// LowerOperation - Provide custom lowering hooks for some operations.
-///
-SDOperand AlphaTargetLowering::LowerOperation(SDOperand Op, SelectionDAG &DAG) {
- switch (Op.getOpcode()) {
- default: assert(0 && "Wasn't expecting to be able to lower this!");
- case ISD::FORMAL_ARGUMENTS: return LowerFORMAL_ARGUMENTS(Op, DAG,
- VarArgsBase,
- VarArgsOffset);
-
- case ISD::RET: return LowerRET(Op,DAG);
- case ISD::JumpTable: return LowerJumpTable(Op, DAG);
-
- case ISD::SINT_TO_FP: {
- assert(MVT::i64 == Op.getOperand(0).getValueType() &&
- "Unhandled SINT_TO_FP type in custom expander!");
- SDOperand LD;
- bool isDouble = MVT::f64 == Op.getValueType();
- LD = DAG.getNode(ISD::BIT_CONVERT, MVT::f64, Op.getOperand(0));
- SDOperand FP = DAG.getNode(isDouble?AlphaISD::CVTQT_:AlphaISD::CVTQS_,
- isDouble?MVT::f64:MVT::f32, LD);
- return FP;
- }
- case ISD::FP_TO_SINT: {
- bool isDouble = MVT::f64 == Op.getOperand(0).getValueType();
- SDOperand src = Op.getOperand(0);
-
- if (!isDouble) //Promote
- src = DAG.getNode(ISD::FP_EXTEND, MVT::f64, src);
-
- src = DAG.getNode(AlphaISD::CVTTQ_, MVT::f64, src);
-
- return DAG.getNode(ISD::BIT_CONVERT, MVT::i64, src);
- }
- case ISD::ConstantPool: {
- ConstantPoolSDNode *CP = cast<ConstantPoolSDNode>(Op);
- Constant *C = CP->getConstVal();
- SDOperand CPI = DAG.getTargetConstantPool(C, MVT::i64, CP->getAlignment());
-
- SDOperand Hi = DAG.getNode(AlphaISD::GPRelHi, MVT::i64, CPI,
- DAG.getNode(ISD::GLOBAL_OFFSET_TABLE, MVT::i64));
- SDOperand Lo = DAG.getNode(AlphaISD::GPRelLo, MVT::i64, CPI, Hi);
- return Lo;
- }
- case ISD::GlobalTLSAddress:
- assert(0 && "TLS not implemented for Alpha.");
- case ISD::GlobalAddress: {
- GlobalAddressSDNode *GSDN = cast<GlobalAddressSDNode>(Op);
- GlobalValue *GV = GSDN->getGlobal();
- SDOperand GA = DAG.getTargetGlobalAddress(GV, MVT::i64, GSDN->getOffset());
-
- // if (!GV->hasWeakLinkage() && !GV->isDeclaration() && !GV->hasLinkOnceLinkage()) {
- if (GV->hasInternalLinkage()) {
- SDOperand Hi = DAG.getNode(AlphaISD::GPRelHi, MVT::i64, GA,
- DAG.getNode(ISD::GLOBAL_OFFSET_TABLE, MVT::i64));
- SDOperand Lo = DAG.getNode(AlphaISD::GPRelLo, MVT::i64, GA, Hi);
- return Lo;
- } else
- return DAG.getNode(AlphaISD::RelLit, MVT::i64, GA,
- DAG.getNode(ISD::GLOBAL_OFFSET_TABLE, MVT::i64));
- }
- case ISD::ExternalSymbol: {
- return DAG.getNode(AlphaISD::RelLit, MVT::i64,
- DAG.getTargetExternalSymbol(cast<ExternalSymbolSDNode>(Op)
- ->getSymbol(), MVT::i64),
- DAG.getNode(ISD::GLOBAL_OFFSET_TABLE, MVT::i64));
- }
-
- case ISD::UREM:
- case ISD::SREM:
- //Expand only on constant case
- if (Op.getOperand(1).getOpcode() == ISD::Constant) {
- MVT::ValueType VT = Op.Val->getValueType(0);
- SDOperand Tmp1 = Op.Val->getOpcode() == ISD::UREM ?
- BuildUDIV(Op.Val, DAG, NULL) :
- BuildSDIV(Op.Val, DAG, NULL);
- Tmp1 = DAG.getNode(ISD::MUL, VT, Tmp1, Op.getOperand(1));
- Tmp1 = DAG.getNode(ISD::SUB, VT, Op.getOperand(0), Tmp1);
- return Tmp1;
- }
- //fall through
- case ISD::SDIV:
- case ISD::UDIV:
- if (MVT::isInteger(Op.getValueType())) {
- if (Op.getOperand(1).getOpcode() == ISD::Constant)
- return Op.getOpcode() == ISD::SDIV ? BuildSDIV(Op.Val, DAG, NULL)
- : BuildUDIV(Op.Val, DAG, NULL);
- const char* opstr = 0;
- switch (Op.getOpcode()) {
- case ISD::UREM: opstr = "__remqu"; break;
- case ISD::SREM: opstr = "__remq"; break;
- case ISD::UDIV: opstr = "__divqu"; break;
- case ISD::SDIV: opstr = "__divq"; break;
- }
- SDOperand Tmp1 = Op.getOperand(0),
- Tmp2 = Op.getOperand(1),
- Addr = DAG.getExternalSymbol(opstr, MVT::i64);
- return DAG.getNode(AlphaISD::DivCall, MVT::i64, Addr, Tmp1, Tmp2);
- }
- break;
-
- case ISD::VAARG: {
- SDOperand Chain = Op.getOperand(0);
- SDOperand VAListP = Op.getOperand(1);
- const Value *VAListS = cast<SrcValueSDNode>(Op.getOperand(2))->getValue();
-
- SDOperand Base = DAG.getLoad(MVT::i64, Chain, VAListP, VAListS, 0);
- SDOperand Tmp = DAG.getNode(ISD::ADD, MVT::i64, VAListP,
- DAG.getConstant(8, MVT::i64));
- SDOperand Offset = DAG.getExtLoad(ISD::SEXTLOAD, MVT::i64, Base.getValue(1),
- Tmp, NULL, 0, MVT::i32);
- SDOperand DataPtr = DAG.getNode(ISD::ADD, MVT::i64, Base, Offset);
- if (MVT::isFloatingPoint(Op.getValueType()))
- {
- //if fp && Offset < 6*8, then subtract 6*8 from DataPtr
- SDOperand FPDataPtr = DAG.getNode(ISD::SUB, MVT::i64, DataPtr,
- DAG.getConstant(8*6, MVT::i64));
- SDOperand CC = DAG.getSetCC(MVT::i64, Offset,
- DAG.getConstant(8*6, MVT::i64), ISD::SETLT);
- DataPtr = DAG.getNode(ISD::SELECT, MVT::i64, CC, FPDataPtr, DataPtr);
- }
-
- SDOperand NewOffset = DAG.getNode(ISD::ADD, MVT::i64, Offset,
- DAG.getConstant(8, MVT::i64));
- SDOperand Update = DAG.getTruncStore(Offset.getValue(1), NewOffset,
- Tmp, NULL, 0, MVT::i32);
-
- SDOperand Result;
- if (Op.getValueType() == MVT::i32)
- Result = DAG.getExtLoad(ISD::SEXTLOAD, MVT::i64, Update, DataPtr,
- NULL, 0, MVT::i32);
- else
- Result = DAG.getLoad(Op.getValueType(), Update, DataPtr, NULL, 0);
- return Result;
- }
- case ISD::VACOPY: {
- SDOperand Chain = Op.getOperand(0);
- SDOperand DestP = Op.getOperand(1);
- SDOperand SrcP = Op.getOperand(2);
- const Value *DestS = cast<SrcValueSDNode>(Op.getOperand(3))->getValue();
- const Value *SrcS = cast<SrcValueSDNode>(Op.getOperand(4))->getValue();
-
- SDOperand Val = DAG.getLoad(getPointerTy(), Chain, SrcP, SrcS, 0);
- SDOperand Result = DAG.getStore(Val.getValue(1), Val, DestP, DestS, 0);
- SDOperand NP = DAG.getNode(ISD::ADD, MVT::i64, SrcP,
- DAG.getConstant(8, MVT::i64));
- Val = DAG.getExtLoad(ISD::SEXTLOAD, MVT::i64, Result, NP, NULL,0, MVT::i32);
- SDOperand NPD = DAG.getNode(ISD::ADD, MVT::i64, DestP,
- DAG.getConstant(8, MVT::i64));
- return DAG.getTruncStore(Val.getValue(1), Val, NPD, NULL, 0, MVT::i32);
- }
- case ISD::VASTART: {
- SDOperand Chain = Op.getOperand(0);
- SDOperand VAListP = Op.getOperand(1);
- const Value *VAListS = cast<SrcValueSDNode>(Op.getOperand(2))->getValue();
-
- // vastart stores the address of the VarArgsBase and VarArgsOffset
- SDOperand FR = DAG.getFrameIndex(VarArgsBase, MVT::i64);
- SDOperand S1 = DAG.getStore(Chain, FR, VAListP, VAListS, 0);
- SDOperand SA2 = DAG.getNode(ISD::ADD, MVT::i64, VAListP,
- DAG.getConstant(8, MVT::i64));
- return DAG.getTruncStore(S1, DAG.getConstant(VarArgsOffset, MVT::i64),
- SA2, NULL, 0, MVT::i32);
- }
- case ISD::RETURNADDR:
- return DAG.getNode(AlphaISD::GlobalRetAddr, MVT::i64);
- //FIXME: implement
- case ISD::FRAMEADDR: break;
- }
-
- return SDOperand();
-}
-
-SDOperand AlphaTargetLowering::CustomPromoteOperation(SDOperand Op,
- SelectionDAG &DAG) {
- assert(Op.getValueType() == MVT::i32 &&
- Op.getOpcode() == ISD::VAARG &&
- "Unknown node to custom promote!");
-
- // The code in LowerOperation already handles i32 vaarg
- return LowerOperation(Op, DAG);
-}
-
-
-//Inline Asm
-
-/// getConstraintType - Given a constraint letter, return the type of
-/// constraint it is for this target.
-AlphaTargetLowering::ConstraintType
-AlphaTargetLowering::getConstraintType(const std::string &Constraint) const {
- if (Constraint.size() == 1) {
- switch (Constraint[0]) {
- default: break;
- case 'f':
- case 'r':
- return C_RegisterClass;
- }
- }
- return TargetLowering::getConstraintType(Constraint);
-}
-
-std::vector<unsigned> AlphaTargetLowering::
-getRegClassForInlineAsmConstraint(const std::string &Constraint,
- MVT::ValueType VT) const {
- if (Constraint.size() == 1) {
- switch (Constraint[0]) {
- default: break; // Unknown constriant letter
- case 'f':
- return make_vector<unsigned>(Alpha::F0 , Alpha::F1 , Alpha::F2 ,
- Alpha::F3 , Alpha::F4 , Alpha::F5 ,
- Alpha::F6 , Alpha::F7 , Alpha::F8 ,
- Alpha::F9 , Alpha::F10, Alpha::F11,
- Alpha::F12, Alpha::F13, Alpha::F14,
- Alpha::F15, Alpha::F16, Alpha::F17,
- Alpha::F18, Alpha::F19, Alpha::F20,
- Alpha::F21, Alpha::F22, Alpha::F23,
- Alpha::F24, Alpha::F25, Alpha::F26,
- Alpha::F27, Alpha::F28, Alpha::F29,
- Alpha::F30, Alpha::F31, 0);
- case 'r':
- return make_vector<unsigned>(Alpha::R0 , Alpha::R1 , Alpha::R2 ,
- Alpha::R3 , Alpha::R4 , Alpha::R5 ,
- Alpha::R6 , Alpha::R7 , Alpha::R8 ,
- Alpha::R9 , Alpha::R10, Alpha::R11,
- Alpha::R12, Alpha::R13, Alpha::R14,
- Alpha::R15, Alpha::R16, Alpha::R17,
- Alpha::R18, Alpha::R19, Alpha::R20,
- Alpha::R21, Alpha::R22, Alpha::R23,
- Alpha::R24, Alpha::R25, Alpha::R26,
- Alpha::R27, Alpha::R28, Alpha::R29,
- Alpha::R30, Alpha::R31, 0);
- }
- }
-
- return std::vector<unsigned>();
-}
-//===----------------------------------------------------------------------===//
-// Other Lowering Code
-//===----------------------------------------------------------------------===//
-
-MachineBasicBlock *
-AlphaTargetLowering::EmitInstrWithCustomInserter(MachineInstr *MI,
- MachineBasicBlock *BB) {
- const TargetInstrInfo *TII = getTargetMachine().getInstrInfo();
- assert((MI->getOpcode() == Alpha::CAS32 ||
- MI->getOpcode() == Alpha::CAS64 ||
- MI->getOpcode() == Alpha::LAS32 ||
- MI->getOpcode() == Alpha::LAS64 ||
- MI->getOpcode() == Alpha::SWAP32 ||
- MI->getOpcode() == Alpha::SWAP64) &&
- "Unexpected instr type to insert");
-
- bool is32 = MI->getOpcode() == Alpha::CAS32 ||
- MI->getOpcode() == Alpha::LAS32 ||
- MI->getOpcode() == Alpha::SWAP32;
-
- //Load locked store conditional for atomic ops take on the same form
- //start:
- //ll
- //do stuff (maybe branch to exit)
- //sc
- //test sc and maybe branck to start
- //exit:
- const BasicBlock *LLVM_BB = BB->getBasicBlock();
- ilist<MachineBasicBlock>::iterator It = BB;
- ++It;
-
- MachineBasicBlock *thisMBB = BB;
- MachineBasicBlock *llscMBB = new MachineBasicBlock(LLVM_BB);
- MachineBasicBlock *sinkMBB = new MachineBasicBlock(LLVM_BB);
-
- for(MachineBasicBlock::succ_iterator i = thisMBB->succ_begin(),
- e = thisMBB->succ_end(); i != e; ++i)
- sinkMBB->addSuccessor(*i);
- while(!thisMBB->succ_empty())
- thisMBB->removeSuccessor(thisMBB->succ_begin());
-
- MachineFunction *F = BB->getParent();
- F->getBasicBlockList().insert(It, llscMBB);
- F->getBasicBlockList().insert(It, sinkMBB);
-
- BuildMI(thisMBB, TII->get(Alpha::BR)).addMBB(llscMBB);
-
- unsigned reg_res = MI->getOperand(0).getReg(),
- reg_ptr = MI->getOperand(1).getReg(),
- reg_v2 = MI->getOperand(2).getReg(),
- reg_store = F->getRegInfo().createVirtualRegister(&Alpha::GPRCRegClass);
-
- BuildMI(llscMBB, TII->get(is32 ? Alpha::LDL_L : Alpha::LDQ_L),
- reg_res).addImm(0).addReg(reg_ptr);
- switch (MI->getOpcode()) {
- case Alpha::CAS32:
- case Alpha::CAS64: {
- unsigned reg_cmp
- = F->getRegInfo().createVirtualRegister(&Alpha::GPRCRegClass);
- BuildMI(llscMBB, TII->get(Alpha::CMPEQ), reg_cmp)
- .addReg(reg_v2).addReg(reg_res);
- BuildMI(llscMBB, TII->get(Alpha::BEQ))
- .addImm(0).addReg(reg_cmp).addMBB(sinkMBB);
- BuildMI(llscMBB, TII->get(Alpha::BISr), reg_store)
- .addReg(Alpha::R31).addReg(MI->getOperand(3).getReg());
- break;
- }
- case Alpha::LAS32:
- case Alpha::LAS64: {
- BuildMI(llscMBB, TII->get(is32 ? Alpha::ADDLr : Alpha::ADDQr), reg_store)
- .addReg(reg_res).addReg(reg_v2);
- break;
- }
- case Alpha::SWAP32:
- case Alpha::SWAP64: {
- BuildMI(llscMBB, TII->get(Alpha::BISr), reg_store)
- .addReg(reg_v2).addReg(reg_v2);
- break;
- }
- }
- BuildMI(llscMBB, TII->get(is32 ? Alpha::STL_C : Alpha::STQ_C), reg_store)
- .addReg(reg_store).addImm(0).addReg(reg_ptr);
- BuildMI(llscMBB, TII->get(Alpha::BEQ))
- .addImm(0).addReg(reg_store).addMBB(llscMBB);
- BuildMI(llscMBB, TII->get(Alpha::BR)).addMBB(sinkMBB);
-
- thisMBB->addSuccessor(llscMBB);
- llscMBB->addSuccessor(llscMBB);
- llscMBB->addSuccessor(sinkMBB);
- delete MI; // The pseudo instruction is gone now.
-
- return sinkMBB;
-}
diff --git a/release_23/lib/Target/Alpha/AlphaISelLowering.h b/release_23/lib/Target/Alpha/AlphaISelLowering.h
deleted file mode 100644
index 8738d02f4d3d..000000000000
--- a/release_23/lib/Target/Alpha/AlphaISelLowering.h
+++ /dev/null
@@ -1,100 +0,0 @@
-//===-- AlphaISelLowering.h - Alpha DAG Lowering Interface ------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines the interfaces that Alpha uses to lower LLVM code into a
-// selection DAG.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_TARGET_ALPHA_ALPHAISELLOWERING_H
-#define LLVM_TARGET_ALPHA_ALPHAISELLOWERING_H
-
-#include "llvm/ADT/VectorExtras.h"
-#include "llvm/Target/TargetLowering.h"
-#include "llvm/CodeGen/SelectionDAG.h"
-#include "Alpha.h"
-
-namespace llvm {
-
- namespace AlphaISD {
- enum NodeType {
- // Start the numbering where the builting ops and target ops leave off.
- FIRST_NUMBER = ISD::BUILTIN_OP_END+Alpha::INSTRUCTION_LIST_END,
- //These corrospond to the identical Instruction
- CVTQT_, CVTQS_, CVTTQ_,
-
- /// GPRelHi/GPRelLo - These represent the high and low 16-bit
- /// parts of a global address respectively.
- GPRelHi, GPRelLo,
-
- /// RetLit - Literal Relocation of a Global
- RelLit,
-
- /// GlobalRetAddr - used to restore the return address
- GlobalRetAddr,
-
- /// CALL - Normal call.
- CALL,
-
- /// DIVCALL - used for special library calls for div and rem
- DivCall,
-
- /// return flag operand
- RET_FLAG,
-
- /// CHAIN = COND_BRANCH CHAIN, OPC, (G|F)PRC, DESTBB [, INFLAG] - This
- /// corresponds to the COND_BRANCH pseudo instruction.
- /// *PRC is the input register to compare to zero,
- /// OPC is the branch opcode to use (e.g. Alpha::BEQ),
- /// DESTBB is the destination block to branch to, and INFLAG is
- /// an optional input flag argument.
- COND_BRANCH_I, COND_BRANCH_F
-
- };
- }
-
- class AlphaTargetLowering : public TargetLowering {
- int VarArgsOffset; // What is the offset to the first vaarg
- int VarArgsBase; // What is the base FrameIndex
- bool useITOF;
- public:
- explicit AlphaTargetLowering(TargetMachine &TM);
-
- /// getSetCCResultType - Get the SETCC result ValueType
- virtual MVT::ValueType getSetCCResultType(const SDOperand &) const;
-
- /// LowerOperation - Provide custom lowering hooks for some operations.
- ///
- virtual SDOperand LowerOperation(SDOperand Op, SelectionDAG &DAG);
- virtual SDOperand CustomPromoteOperation(SDOperand Op, SelectionDAG &DAG);
-
- //Friendly names for dumps
- const char *getTargetNodeName(unsigned Opcode) const;
-
- /// LowerCallTo - This hook lowers an abstract call to a function into an
- /// actual call.
- virtual std::pair<SDOperand, SDOperand>
- LowerCallTo(SDOperand Chain, const Type *RetTy, bool RetSExt, bool RetZExt,
- bool isVarArg, unsigned CC, bool isTailCall, SDOperand Callee,
- ArgListTy &Args, SelectionDAG &DAG);
-
- ConstraintType getConstraintType(const std::string &Constraint) const;
-
- std::vector<unsigned>
- getRegClassForInlineAsmConstraint(const std::string &Constraint,
- MVT::ValueType VT) const;
-
- bool hasITOF() { return useITOF; }
-
- MachineBasicBlock *EmitInstrWithCustomInserter(MachineInstr *MI,
- MachineBasicBlock *BB);
- };
-}
-
-#endif // LLVM_TARGET_ALPHA_ALPHAISELLOWERING_H
diff --git a/release_23/lib/Target/Alpha/AlphaInstrFormats.td b/release_23/lib/Target/Alpha/AlphaInstrFormats.td
deleted file mode 100644
index 6eb59e0eeca0..000000000000
--- a/release_23/lib/Target/Alpha/AlphaInstrFormats.td
+++ /dev/null
@@ -1,268 +0,0 @@
-//===- AlphaInstrFormats.td - Alpha Instruction Formats ----*- tablegen -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-//
-//===----------------------------------------------------------------------===//
-
-//3.3:
-//Memory
-//Branch
-//Operate
-//Floating-point
-//PALcode
-
-def u8imm : Operand<i64>;
-def s14imm : Operand<i64>;
-def s16imm : Operand<i64>;
-def s21imm : Operand<i64>;
-def s64imm : Operand<i64>;
-def u64imm : Operand<i64>;
-
-//===----------------------------------------------------------------------===//
-// Instruction format superclass
-//===----------------------------------------------------------------------===//
-// Alpha instruction baseline
-class InstAlpha<bits<6> op, string asmstr, InstrItinClass itin> : Instruction {
- field bits<32> Inst;
- let Namespace = "Alpha";
- let AsmString = asmstr;
- let Inst{31-26} = op;
- let Itinerary = itin;
-}
-
-
-//3.3.1
-class MForm<bits<6> opcode, bit load, string asmstr, list<dag> pattern, InstrItinClass itin>
- : InstAlpha<opcode, asmstr, itin> {
- let Pattern = pattern;
- let isSimpleLoad = load;
- let Defs = [R28]; //We may use this for frame index calculations, so reserve it here
-
- bits<5> Ra;
- bits<16> disp;
- bits<5> Rb;
-
- let Inst{25-21} = Ra;
- let Inst{20-16} = Rb;
- let Inst{15-0} = disp;
-}
-class MfcForm<bits<6> opcode, bits<16> fc, string asmstr, InstrItinClass itin>
- : InstAlpha<opcode, asmstr, itin> {
- bits<5> Ra;
-
- let OutOperandList = (ops GPRC:$RA);
- let InOperandList = (ops);
- let Inst{25-21} = Ra;
- let Inst{20-16} = 0;
- let Inst{15-0} = fc;
-}
-class MfcPForm<bits<6> opcode, bits<16> fc, string asmstr, InstrItinClass itin>
- : InstAlpha<opcode, asmstr, itin> {
- let OutOperandList = (ops);
- let InOperandList = (ops);
- let Inst{25-21} = 0;
- let Inst{20-16} = 0;
- let Inst{15-0} = fc;
-}
-
-class MbrForm<bits<6> opcode, bits<2> TB, dag OL, string asmstr, InstrItinClass itin>
- : InstAlpha<opcode, asmstr, itin> {
- bits<5> Ra;
- bits<5> Rb;
- bits<14> disp;
-
- let OutOperandList = (ops);
- let InOperandList = OL;
-
- let Inst{25-21} = Ra;
- let Inst{20-16} = Rb;
- let Inst{15-14} = TB;
- let Inst{13-0} = disp;
-}
-class MbrpForm<bits<6> opcode, bits<2> TB, dag OL, string asmstr, list<dag> pattern, InstrItinClass itin>
- : InstAlpha<opcode, asmstr, itin> {
- let Pattern=pattern;
- bits<5> Ra;
- bits<5> Rb;
- bits<14> disp;
-
- let OutOperandList = (ops);
- let InOperandList = OL;
-
- let Inst{25-21} = Ra;
- let Inst{20-16} = Rb;
- let Inst{15-14} = TB;
- let Inst{13-0} = disp;
-}
-
-//3.3.2
-def target : Operand<OtherVT> {}
-
-let isBranch = 1, isTerminator = 1, hasCtrlDep = 1 in {
-class BFormN<bits<6> opcode, dag OL, string asmstr, InstrItinClass itin>
- : InstAlpha<opcode, asmstr, itin> {
- let OutOperandList = (ops);
- let InOperandList = OL;
- bits<64> Opc; //dummy
- bits<5> Ra;
- bits<21> disp;
-
- let Inst{25-21} = Ra;
- let Inst{20-0} = disp;
-}
-}
-
-let isBranch = 1, isTerminator = 1 in
-class BFormD<bits<6> opcode, string asmstr, list<dag> pattern, InstrItinClass itin>
- : InstAlpha<opcode, asmstr, itin> {
- let Pattern = pattern;
- let OutOperandList = (ops);
- let InOperandList = (ops target:$DISP);
- bits<5> Ra;
- bits<21> disp;
-
- let Inst{25-21} = Ra;
- let Inst{20-0} = disp;
-}
-
-//3.3.3
-class OForm<bits<6> opcode, bits<7> fun, string asmstr, list<dag> pattern, InstrItinClass itin>
- : InstAlpha<opcode, asmstr, itin> {
- let Pattern = pattern;
- let OutOperandList = (outs GPRC:$RC);
- let InOperandList = (ins GPRC:$RA, GPRC:$RB);
-
- bits<5> Rc;
- bits<5> Ra;
- bits<5> Rb;
- bits<7> Function = fun;
-
- let Inst{25-21} = Ra;
- let Inst{20-16} = Rb;
- let Inst{15-13} = 0;
- let Inst{12} = 0;
- let Inst{11-5} = Function;
- let Inst{4-0} = Rc;
-}
-
-class OForm2<bits<6> opcode, bits<7> fun, string asmstr, list<dag> pattern, InstrItinClass itin>
- : InstAlpha<opcode, asmstr, itin> {
- let Pattern = pattern;
- let OutOperandList = (outs GPRC:$RC);
- let InOperandList = (ins GPRC:$RB);
-
- bits<5> Rc;
- bits<5> Rb;
- bits<7> Function = fun;
-
- let Inst{25-21} = 31;
- let Inst{20-16} = Rb;
- let Inst{15-13} = 0;
- let Inst{12} = 0;
- let Inst{11-5} = Function;
- let Inst{4-0} = Rc;
-}
-
-class OForm4<bits<6> opcode, bits<7> fun, string asmstr, list<dag> pattern, InstrItinClass itin>
- : InstAlpha<opcode, asmstr, itin> {
- let Pattern = pattern;
- let OutOperandList = (outs GPRC:$RDEST);
- let InOperandList = (ins GPRC:$RCOND, GPRC:$RTRUE, GPRC:$RFALSE);
- let Constraints = "$RFALSE = $RDEST";
- let DisableEncoding = "$RFALSE";
-
- bits<5> Rc;
- bits<5> Ra;
- bits<5> Rb;
- bits<7> Function = fun;
-
-// let isTwoAddress = 1;
- let Inst{25-21} = Ra;
- let Inst{20-16} = Rb;
- let Inst{15-13} = 0;
- let Inst{12} = 0;
- let Inst{11-5} = Function;
- let Inst{4-0} = Rc;
-}
-
-
-class OFormL<bits<6> opcode, bits<7> fun, string asmstr, list<dag> pattern, InstrItinClass itin>
- : InstAlpha<opcode, asmstr, itin> {
- let Pattern = pattern;
- let OutOperandList = (outs GPRC:$RC);
- let InOperandList = (ins GPRC:$RA, u8imm:$L);
-
- bits<5> Rc;
- bits<5> Ra;
- bits<8> LIT;
- bits<7> Function = fun;
-
- let Inst{25-21} = Ra;
- let Inst{20-13} = LIT;
- let Inst{12} = 1;
- let Inst{11-5} = Function;
- let Inst{4-0} = Rc;
-}
-
-class OForm4L<bits<6> opcode, bits<7> fun, string asmstr, list<dag> pattern, InstrItinClass itin>
- : InstAlpha<opcode, asmstr, itin> {
- let Pattern = pattern;
- let OutOperandList = (outs GPRC:$RDEST);
- let InOperandList = (ins GPRC:$RCOND, s64imm:$RTRUE, GPRC:$RFALSE);
- let Constraints = "$RFALSE = $RDEST";
- let DisableEncoding = "$RFALSE";
-
- bits<5> Rc;
- bits<5> Ra;
- bits<8> LIT;
- bits<7> Function = fun;
-
-// let isTwoAddress = 1;
- let Inst{25-21} = Ra;
- let Inst{20-13} = LIT;
- let Inst{12} = 1;
- let Inst{11-5} = Function;
- let Inst{4-0} = Rc;
-}
-
-//3.3.4
-class FPForm<bits<6> opcode, bits<11> fun, string asmstr, list<dag> pattern, InstrItinClass itin>
- : InstAlpha<opcode, asmstr, itin> {
- let Pattern = pattern;
-
- bits<5> Fc;
- bits<5> Fa;
- bits<5> Fb;
- bits<11> Function = fun;
-
- let Inst{25-21} = Fa;
- let Inst{20-16} = Fb;
- let Inst{15-5} = Function;
- let Inst{4-0} = Fc;
-}
-
-//3.3.5
-class PALForm<bits<6> opcode, dag OL, string asmstr, InstrItinClass itin>
- : InstAlpha<opcode, asmstr, itin> {
- let OutOperandList = (ops);
- let InOperandList = OL;
- bits<26> Function;
-
- let Inst{25-0} = Function;
-}
-
-
-// Pseudo instructions.
-class PseudoInstAlpha<dag OOL, dag IOL, string nm, list<dag> pattern, InstrItinClass itin>
- : InstAlpha<0, nm, itin> {
- let OutOperandList = OOL;
- let InOperandList = IOL;
- let Pattern = pattern;
-
-}
diff --git a/release_23/lib/Target/Alpha/AlphaInstrInfo.cpp b/release_23/lib/Target/Alpha/AlphaInstrInfo.cpp
deleted file mode 100644
index 96a75a6aa70d..000000000000
--- a/release_23/lib/Target/Alpha/AlphaInstrInfo.cpp
+++ /dev/null
@@ -1,424 +0,0 @@
-//===- AlphaInstrInfo.cpp - Alpha Instruction Information -------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains the Alpha implementation of the TargetInstrInfo class.
-//
-//===----------------------------------------------------------------------===//
-
-#include "Alpha.h"
-#include "AlphaInstrInfo.h"
-#include "AlphaGenInstrInfo.inc"
-#include "llvm/ADT/STLExtras.h"
-#include "llvm/CodeGen/MachineInstrBuilder.h"
-using namespace llvm;
-
-AlphaInstrInfo::AlphaInstrInfo()
- : TargetInstrInfoImpl(AlphaInsts, array_lengthof(AlphaInsts)),
- RI(*this) { }
-
-
-bool AlphaInstrInfo::isMoveInstr(const MachineInstr& MI,
- unsigned& sourceReg,
- unsigned& destReg) const {
- unsigned oc = MI.getOpcode();
- if (oc == Alpha::BISr ||
- oc == Alpha::CPYSS ||
- oc == Alpha::CPYST ||
- oc == Alpha::CPYSSt ||
- oc == Alpha::CPYSTs) {
- // or r1, r2, r2
- // cpys(s|t) r1 r2 r2
- assert(MI.getNumOperands() >= 3 &&
- MI.getOperand(0).isRegister() &&
- MI.getOperand(1).isRegister() &&
- MI.getOperand(2).isRegister() &&
- "invalid Alpha BIS instruction!");
- if (MI.getOperand(1).getReg() == MI.getOperand(2).getReg()) {
- sourceReg = MI.getOperand(1).getReg();
- destReg = MI.getOperand(0).getReg();
- return true;
- }
- }
- return false;
-}
-
-unsigned
-AlphaInstrInfo::isLoadFromStackSlot(MachineInstr *MI, int &FrameIndex) const {
- switch (MI->getOpcode()) {
- case Alpha::LDL:
- case Alpha::LDQ:
- case Alpha::LDBU:
- case Alpha::LDWU:
- case Alpha::LDS:
- case Alpha::LDT:
- if (MI->getOperand(1).isFrameIndex()) {
- FrameIndex = MI->getOperand(1).getIndex();
- return MI->getOperand(0).getReg();
- }
- break;
- }
- return 0;
-}
-
-unsigned
-AlphaInstrInfo::isStoreToStackSlot(MachineInstr *MI, int &FrameIndex) const {
- switch (MI->getOpcode()) {
- case Alpha::STL:
- case Alpha::STQ:
- case Alpha::STB:
- case Alpha::STW:
- case Alpha::STS:
- case Alpha::STT:
- if (MI->getOperand(1).isFrameIndex()) {
- FrameIndex = MI->getOperand(1).getIndex();
- return MI->getOperand(0).getReg();
- }
- break;
- }
- return 0;
-}
-
-static bool isAlphaIntCondCode(unsigned Opcode) {
- switch (Opcode) {
- case Alpha::BEQ:
- case Alpha::BNE:
- case Alpha::BGE:
- case Alpha::BGT:
- case Alpha::BLE:
- case Alpha::BLT:
- case Alpha::BLBC:
- case Alpha::BLBS:
- return true;
- default:
- return false;
- }
-}
-
-unsigned AlphaInstrInfo::InsertBranch(MachineBasicBlock &MBB,MachineBasicBlock *TBB,
- MachineBasicBlock *FBB,
- const std::vector<MachineOperand> &Cond)const{
- assert(TBB && "InsertBranch must not be told to insert a fallthrough");
- assert((Cond.size() == 2 || Cond.size() == 0) &&
- "Alpha branch conditions have two components!");
-
- // One-way branch.
- if (FBB == 0) {
- if (Cond.empty()) // Unconditional branch
- BuildMI(&MBB, get(Alpha::BR)).addMBB(TBB);
- else // Conditional branch
- if (isAlphaIntCondCode(Cond[0].getImm()))
- BuildMI(&MBB, get(Alpha::COND_BRANCH_I))
- .addImm(Cond[0].getImm()).addReg(Cond[1].getReg()).addMBB(TBB);
- else
- BuildMI(&MBB, get(Alpha::COND_BRANCH_F))
- .addImm(Cond[0].getImm()).addReg(Cond[1].getReg()).addMBB(TBB);
- return 1;
- }
-
- // Two-way Conditional Branch.
- if (isAlphaIntCondCode(Cond[0].getImm()))
- BuildMI(&MBB, get(Alpha::COND_BRANCH_I))
- .addImm(Cond[0].getImm()).addReg(Cond[1].getReg()).addMBB(TBB);
- else
- BuildMI(&MBB, get(Alpha::COND_BRANCH_F))
- .addImm(Cond[0].getImm()).addReg(Cond[1].getReg()).addMBB(TBB);
- BuildMI(&MBB, get(Alpha::BR)).addMBB(FBB);
- return 2;
-}
-
-void AlphaInstrInfo::copyRegToReg(MachineBasicBlock &MBB,
- MachineBasicBlock::iterator MI,
- unsigned DestReg, unsigned SrcReg,
- const TargetRegisterClass *DestRC,
- const TargetRegisterClass *SrcRC) const {
- //cerr << "copyRegToReg " << DestReg << " <- " << SrcReg << "\n";
- if (DestRC != SrcRC) {
- cerr << "Not yet supported!";
- abort();
- }
-
- if (DestRC == Alpha::GPRCRegisterClass) {
- BuildMI(MBB, MI, get(Alpha::BISr), DestReg).addReg(SrcReg).addReg(SrcReg);
- } else if (DestRC == Alpha::F4RCRegisterClass) {
- BuildMI(MBB, MI, get(Alpha::CPYSS), DestReg).addReg(SrcReg).addReg(SrcReg);
- } else if (DestRC == Alpha::F8RCRegisterClass) {
- BuildMI(MBB, MI, get(Alpha::CPYST), DestReg).addReg(SrcReg).addReg(SrcReg);
- } else {
- cerr << "Attempt to copy register that is not GPR or FPR";
- abort();
- }
-}
-
-void
-AlphaInstrInfo::storeRegToStackSlot(MachineBasicBlock &MBB,
- MachineBasicBlock::iterator MI,
- unsigned SrcReg, bool isKill, int FrameIdx,
- const TargetRegisterClass *RC) const {
- //cerr << "Trying to store " << getPrettyName(SrcReg) << " to "
- // << FrameIdx << "\n";
- //BuildMI(MBB, MI, Alpha::WTF, 0).addReg(SrcReg);
- if (RC == Alpha::F4RCRegisterClass)
- BuildMI(MBB, MI, get(Alpha::STS))
- .addReg(SrcReg, false, false, isKill)
- .addFrameIndex(FrameIdx).addReg(Alpha::F31);
- else if (RC == Alpha::F8RCRegisterClass)
- BuildMI(MBB, MI, get(Alpha::STT))
- .addReg(SrcReg, false, false, isKill)
- .addFrameIndex(FrameIdx).addReg(Alpha::F31);
- else if (RC == Alpha::GPRCRegisterClass)
- BuildMI(MBB, MI, get(Alpha::STQ))
- .addReg(SrcReg, false, false, isKill)
- .addFrameIndex(FrameIdx).addReg(Alpha::F31);
- else
- abort();
-}
-
-void AlphaInstrInfo::storeRegToAddr(MachineFunction &MF, unsigned SrcReg,
- bool isKill,
- SmallVectorImpl<MachineOperand> &Addr,
- const TargetRegisterClass *RC,
- SmallVectorImpl<MachineInstr*> &NewMIs) const {
- unsigned Opc = 0;
- if (RC == Alpha::F4RCRegisterClass)
- Opc = Alpha::STS;
- else if (RC == Alpha::F8RCRegisterClass)
- Opc = Alpha::STT;
- else if (RC == Alpha::GPRCRegisterClass)
- Opc = Alpha::STQ;
- else
- abort();
- MachineInstrBuilder MIB =
- BuildMI(get(Opc)).addReg(SrcReg, false, false, isKill);
- for (unsigned i = 0, e = Addr.size(); i != e; ++i) {
- MachineOperand &MO = Addr[i];
- if (MO.isRegister())
- MIB.addReg(MO.getReg(), MO.isDef(), MO.isImplicit());
- else
- MIB.addImm(MO.getImm());
- }
- NewMIs.push_back(MIB);
-}
-
-void
-AlphaInstrInfo::loadRegFromStackSlot(MachineBasicBlock &MBB,
- MachineBasicBlock::iterator MI,
- unsigned DestReg, int FrameIdx,
- const TargetRegisterClass *RC) const {
- //cerr << "Trying to load " << getPrettyName(DestReg) << " to "
- // << FrameIdx << "\n";
- if (RC == Alpha::F4RCRegisterClass)
- BuildMI(MBB, MI, get(Alpha::LDS), DestReg)
- .addFrameIndex(FrameIdx).addReg(Alpha::F31);
- else if (RC == Alpha::F8RCRegisterClass)
- BuildMI(MBB, MI, get(Alpha::LDT), DestReg)
- .addFrameIndex(FrameIdx).addReg(Alpha::F31);
- else if (RC == Alpha::GPRCRegisterClass)
- BuildMI(MBB, MI, get(Alpha::LDQ), DestReg)
- .addFrameIndex(FrameIdx).addReg(Alpha::F31);
- else
- abort();
-}
-
-void AlphaInstrInfo::loadRegFromAddr(MachineFunction &MF, unsigned DestReg,
- SmallVectorImpl<MachineOperand> &Addr,
- const TargetRegisterClass *RC,
- SmallVectorImpl<MachineInstr*> &NewMIs) const {
- unsigned Opc = 0;
- if (RC == Alpha::F4RCRegisterClass)
- Opc = Alpha::LDS;
- else if (RC == Alpha::F8RCRegisterClass)
- Opc = Alpha::LDT;
- else if (RC == Alpha::GPRCRegisterClass)
- Opc = Alpha::LDQ;
- else
- abort();
- MachineInstrBuilder MIB =
- BuildMI(get(Opc), DestReg);
- for (unsigned i = 0, e = Addr.size(); i != e; ++i) {
- MachineOperand &MO = Addr[i];
- if (MO.isRegister())
- MIB.addReg(MO.getReg(), MO.isDef(), MO.isImplicit());
- else
- MIB.addImm(MO.getImm());
- }
- NewMIs.push_back(MIB);
-}
-
-MachineInstr *AlphaInstrInfo::foldMemoryOperand(MachineFunction &MF,
- MachineInstr *MI,
- SmallVectorImpl<unsigned> &Ops,
- int FrameIndex) const {
- if (Ops.size() != 1) return NULL;
-
- // Make sure this is a reg-reg copy.
- unsigned Opc = MI->getOpcode();
-
- MachineInstr *NewMI = NULL;
- switch(Opc) {
- default:
- break;
- case Alpha::BISr:
- case Alpha::CPYSS:
- case Alpha::CPYST:
- if (MI->getOperand(1).getReg() == MI->getOperand(2).getReg()) {
- if (Ops[0] == 0) { // move -> store
- unsigned InReg = MI->getOperand(1).getReg();
- Opc = (Opc == Alpha::BISr) ? Alpha::STQ :
- ((Opc == Alpha::CPYSS) ? Alpha::STS : Alpha::STT);
- NewMI = BuildMI(get(Opc)).addReg(InReg).addFrameIndex(FrameIndex)
- .addReg(Alpha::F31);
- } else { // load -> move
- unsigned OutReg = MI->getOperand(0).getReg();
- Opc = (Opc == Alpha::BISr) ? Alpha::LDQ :
- ((Opc == Alpha::CPYSS) ? Alpha::LDS : Alpha::LDT);
- NewMI = BuildMI(get(Opc), OutReg).addFrameIndex(FrameIndex)
- .addReg(Alpha::F31);
- }
- }
- break;
- }
- if (NewMI)
- NewMI->copyKillDeadInfo(MI);
- return 0;
-}
-
-static unsigned AlphaRevCondCode(unsigned Opcode) {
- switch (Opcode) {
- case Alpha::BEQ: return Alpha::BNE;
- case Alpha::BNE: return Alpha::BEQ;
- case Alpha::BGE: return Alpha::BLT;
- case Alpha::BGT: return Alpha::BLE;
- case Alpha::BLE: return Alpha::BGT;
- case Alpha::BLT: return Alpha::BGE;
- case Alpha::BLBC: return Alpha::BLBS;
- case Alpha::BLBS: return Alpha::BLBC;
- case Alpha::FBEQ: return Alpha::FBNE;
- case Alpha::FBNE: return Alpha::FBEQ;
- case Alpha::FBGE: return Alpha::FBLT;
- case Alpha::FBGT: return Alpha::FBLE;
- case Alpha::FBLE: return Alpha::FBGT;
- case Alpha::FBLT: return Alpha::FBGE;
- default:
- assert(0 && "Unknown opcode");
- }
- return 0; // Not reached
-}
-
-// Branch analysis.
-bool AlphaInstrInfo::AnalyzeBranch(MachineBasicBlock &MBB,MachineBasicBlock *&TBB,
- MachineBasicBlock *&FBB,
- std::vector<MachineOperand> &Cond) const {
- // If the block has no terminators, it just falls into the block after it.
- MachineBasicBlock::iterator I = MBB.end();
- if (I == MBB.begin() || !isUnpredicatedTerminator(--I))
- return false;
-
- // Get the last instruction in the block.
- MachineInstr *LastInst = I;
-
- // If there is only one terminator instruction, process it.
- if (I == MBB.begin() || !isUnpredicatedTerminator(--I)) {
- if (LastInst->getOpcode() == Alpha::BR) {
- TBB = LastInst->getOperand(0).getMBB();
- return false;
- } else if (LastInst->getOpcode() == Alpha::COND_BRANCH_I ||
- LastInst->getOpcode() == Alpha::COND_BRANCH_F) {
- // Block ends with fall-through condbranch.
- TBB = LastInst->getOperand(2).getMBB();
- Cond.push_back(LastInst->getOperand(0));
- Cond.push_back(LastInst->getOperand(1));
- return false;
- }
- // Otherwise, don't know what this is.
- return true;
- }
-
- // Get the instruction before it if it's a terminator.
- MachineInstr *SecondLastInst = I;
-
- // If there are three terminators, we don't know what sort of block this is.
- if (SecondLastInst && I != MBB.begin() &&
- isUnpredicatedTerminator(--I))
- return true;
-
- // If the block ends with Alpha::BR and Alpha::COND_BRANCH_*, handle it.
- if ((SecondLastInst->getOpcode() == Alpha::COND_BRANCH_I ||
- SecondLastInst->getOpcode() == Alpha::COND_BRANCH_F) &&
- LastInst->getOpcode() == Alpha::BR) {
- TBB = SecondLastInst->getOperand(2).getMBB();
- Cond.push_back(SecondLastInst->getOperand(0));
- Cond.push_back(SecondLastInst->getOperand(1));
- FBB = LastInst->getOperand(0).getMBB();
- return false;
- }
-
- // If the block ends with two Alpha::BRs, handle it. The second one is not
- // executed, so remove it.
- if (SecondLastInst->getOpcode() == Alpha::BR &&
- LastInst->getOpcode() == Alpha::BR) {
- TBB = SecondLastInst->getOperand(0).getMBB();
- I = LastInst;
- I->eraseFromParent();
- return false;
- }
-
- // Otherwise, can't handle this.
- return true;
-}
-
-unsigned AlphaInstrInfo::RemoveBranch(MachineBasicBlock &MBB) const {
- MachineBasicBlock::iterator I = MBB.end();
- if (I == MBB.begin()) return 0;
- --I;
- if (I->getOpcode() != Alpha::BR &&
- I->getOpcode() != Alpha::COND_BRANCH_I &&
- I->getOpcode() != Alpha::COND_BRANCH_F)
- return 0;
-
- // Remove the branch.
- I->eraseFromParent();
-
- I = MBB.end();
-
- if (I == MBB.begin()) return 1;
- --I;
- if (I->getOpcode() != Alpha::COND_BRANCH_I &&
- I->getOpcode() != Alpha::COND_BRANCH_F)
- return 1;
-
- // Remove the branch.
- I->eraseFromParent();
- return 2;
-}
-
-void AlphaInstrInfo::insertNoop(MachineBasicBlock &MBB,
- MachineBasicBlock::iterator MI) const {
- BuildMI(MBB, MI, get(Alpha::BISr), Alpha::R31).addReg(Alpha::R31)
- .addReg(Alpha::R31);
-}
-
-bool AlphaInstrInfo::BlockHasNoFallThrough(MachineBasicBlock &MBB) const {
- if (MBB.empty()) return false;
-
- switch (MBB.back().getOpcode()) {
- case Alpha::RETDAG: // Return.
- case Alpha::RETDAGp:
- case Alpha::BR: // Uncond branch.
- case Alpha::JMP: // Indirect branch.
- return true;
- default: return false;
- }
-}
-bool AlphaInstrInfo::
-ReverseBranchCondition(std::vector<MachineOperand> &Cond) const {
- assert(Cond.size() == 2 && "Invalid Alpha branch opcode!");
- Cond[0].setImm(AlphaRevCondCode(Cond[0].getImm()));
- return false;
-}
-
diff --git a/release_23/lib/Target/Alpha/AlphaInstrInfo.h b/release_23/lib/Target/Alpha/AlphaInstrInfo.h
deleted file mode 100644
index 0b51f2d32200..000000000000
--- a/release_23/lib/Target/Alpha/AlphaInstrInfo.h
+++ /dev/null
@@ -1,94 +0,0 @@
-//===- AlphaInstrInfo.h - Alpha Instruction Information ---------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains the Alpha implementation of the TargetInstrInfo class.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef ALPHAINSTRUCTIONINFO_H
-#define ALPHAINSTRUCTIONINFO_H
-
-#include "llvm/Target/TargetInstrInfo.h"
-#include "AlphaRegisterInfo.h"
-
-namespace llvm {
-
-class AlphaInstrInfo : public TargetInstrInfoImpl {
- const AlphaRegisterInfo RI;
-public:
- AlphaInstrInfo();
-
- /// getRegisterInfo - TargetInstrInfo is a superset of MRegister info. As
- /// such, whenever a client has an instance of instruction info, it should
- /// always be able to get register info as well (through this method).
- ///
- virtual const TargetRegisterInfo &getRegisterInfo() const { return RI; }
-
- /// Return true if the instruction is a register to register move and
- /// leave the source and dest operands in the passed parameters.
- ///
- virtual bool isMoveInstr(const MachineInstr &MI,
- unsigned &SrcReg, unsigned &DstReg) const;
-
- virtual unsigned isLoadFromStackSlot(MachineInstr *MI, int &FrameIndex) const;
- virtual unsigned isStoreToStackSlot(MachineInstr *MI, int &FrameIndex) const;
-
- virtual unsigned InsertBranch(MachineBasicBlock &MBB, MachineBasicBlock *TBB,
- MachineBasicBlock *FBB,
- const std::vector<MachineOperand> &Cond) const;
- virtual void copyRegToReg(MachineBasicBlock &MBB,
- MachineBasicBlock::iterator MI,
- unsigned DestReg, unsigned SrcReg,
- const TargetRegisterClass *DestRC,
- const TargetRegisterClass *SrcRC) const;
- virtual void storeRegToStackSlot(MachineBasicBlock &MBB,
- MachineBasicBlock::iterator MBBI,
- unsigned SrcReg, bool isKill, int FrameIndex,
- const TargetRegisterClass *RC) const;
-
- virtual void storeRegToAddr(MachineFunction &MF, unsigned SrcReg, bool isKill,
- SmallVectorImpl<MachineOperand> &Addr,
- const TargetRegisterClass *RC,
- SmallVectorImpl<MachineInstr*> &NewMIs) const;
-
- virtual void loadRegFromStackSlot(MachineBasicBlock &MBB,
- MachineBasicBlock::iterator MBBI,
- unsigned DestReg, int FrameIndex,
- const TargetRegisterClass *RC) const;
-
- virtual void loadRegFromAddr(MachineFunction &MF, unsigned DestReg,
- SmallVectorImpl<MachineOperand> &Addr,
- const TargetRegisterClass *RC,
- SmallVectorImpl<MachineInstr*> &NewMIs) const;
-
- virtual MachineInstr* foldMemoryOperand(MachineFunction &MF,
- MachineInstr* MI,
- SmallVectorImpl<unsigned> &Ops,
- int FrameIndex) const;
-
- virtual MachineInstr* foldMemoryOperand(MachineFunction &MF,
- MachineInstr* MI,
- SmallVectorImpl<unsigned> &Ops,
- MachineInstr* LoadMI) const {
- return 0;
- }
-
- bool AnalyzeBranch(MachineBasicBlock &MBB,MachineBasicBlock *&TBB,
- MachineBasicBlock *&FBB,
- std::vector<MachineOperand> &Cond) const;
- unsigned RemoveBranch(MachineBasicBlock &MBB) const;
- void insertNoop(MachineBasicBlock &MBB,
- MachineBasicBlock::iterator MI) const;
- bool BlockHasNoFallThrough(MachineBasicBlock &MBB) const;
- bool ReverseBranchCondition(std::vector<MachineOperand> &Cond) const;
-};
-
-}
-
-#endif
diff --git a/release_23/lib/Target/Alpha/AlphaInstrInfo.td b/release_23/lib/Target/Alpha/AlphaInstrInfo.td
deleted file mode 100644
index ddefe858a264..000000000000
--- a/release_23/lib/Target/Alpha/AlphaInstrInfo.td
+++ /dev/null
@@ -1,1127 +0,0 @@
-//===- AlphaInstrInfo.td - The Alpha Instruction Set -------*- tablegen -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-//
-//===----------------------------------------------------------------------===//
-
-include "AlphaInstrFormats.td"
-
-//********************
-//Custom DAG Nodes
-//********************
-
-def SDTFPUnaryOpUnC : SDTypeProfile<1, 1, [
- SDTCisFP<1>, SDTCisFP<0>
-]>;
-def Alpha_cvtqt : SDNode<"AlphaISD::CVTQT_", SDTFPUnaryOpUnC, []>;
-def Alpha_cvtqs : SDNode<"AlphaISD::CVTQS_", SDTFPUnaryOpUnC, []>;
-def Alpha_cvttq : SDNode<"AlphaISD::CVTTQ_" , SDTFPUnaryOp, []>;
-def Alpha_gprello : SDNode<"AlphaISD::GPRelLo", SDTIntBinOp, []>;
-def Alpha_gprelhi : SDNode<"AlphaISD::GPRelHi", SDTIntBinOp, []>;
-def Alpha_rellit : SDNode<"AlphaISD::RelLit", SDTIntBinOp, [SDNPMayLoad]>;
-
-def retflag : SDNode<"AlphaISD::RET_FLAG", SDTNone,
- [SDNPHasChain, SDNPOptInFlag]>;
-
-// These are target-independent nodes, but have target-specific formats.
-def SDT_AlphaCallSeqStart : SDCallSeqStart<[ SDTCisVT<0, i64> ]>;
-def SDT_AlphaCallSeqEnd : SDCallSeqEnd<[ SDTCisVT<0, i64>,
- SDTCisVT<1, i64> ]>;
-
-def callseq_start : SDNode<"ISD::CALLSEQ_START", SDT_AlphaCallSeqStart,
- [SDNPHasChain, SDNPOutFlag]>;
-def callseq_end : SDNode<"ISD::CALLSEQ_END", SDT_AlphaCallSeqEnd,
- [SDNPHasChain, SDNPOptInFlag, SDNPOutFlag]>;
-
-//********************
-//Paterns for matching
-//********************
-def invX : SDNodeXForm<imm, [{ //invert
- return getI64Imm(~N->getValue());
-}]>;
-def negX : SDNodeXForm<imm, [{ //negate
- return getI64Imm(~N->getValue() + 1);
-}]>;
-def SExt32 : SDNodeXForm<imm, [{ //signed extend int to long
- return getI64Imm(((int64_t)N->getValue() << 32) >> 32);
-}]>;
-def SExt16 : SDNodeXForm<imm, [{ //signed extend int to long
- return getI64Imm(((int64_t)N->getValue() << 48) >> 48);
-}]>;
-def LL16 : SDNodeXForm<imm, [{ //lda part of constant
- return getI64Imm(get_lda16(N->getValue()));
-}]>;
-def LH16 : SDNodeXForm<imm, [{ //ldah part of constant (or more if too big)
- return getI64Imm(get_ldah16(N->getValue()));
-}]>;
-def iZAPX : SDNodeXForm<and, [{ // get imm to ZAPi
- ConstantSDNode *RHS = cast<ConstantSDNode>(N->getOperand(1));
- return getI64Imm(get_zapImm(SDOperand(), RHS->getValue()));
-}]>;
-def nearP2X : SDNodeXForm<imm, [{
- return getI64Imm(Log2_64(getNearPower2((uint64_t)N->getValue())));
-}]>;
-def nearP2RemX : SDNodeXForm<imm, [{
- uint64_t x = abs(N->getValue() - getNearPower2((uint64_t)N->getValue()));
- return getI64Imm(Log2_64(x));
-}]>;
-
-def immUExt8 : PatLeaf<(imm), [{ //imm fits in 8 bit zero extended field
- return (uint64_t)N->getValue() == (uint8_t)N->getValue();
-}]>;
-def immUExt8inv : PatLeaf<(imm), [{ //inverted imm fits in 8 bit zero extended field
- return (uint64_t)~N->getValue() == (uint8_t)~N->getValue();
-}], invX>;
-def immUExt8neg : PatLeaf<(imm), [{ //negated imm fits in 8 bit zero extended field
- return ((uint64_t)~N->getValue() + 1) == (uint8_t)((uint64_t)~N->getValue() + 1);
-}], negX>;
-def immSExt16 : PatLeaf<(imm), [{ //imm fits in 16 bit sign extended field
- return ((int64_t)N->getValue() << 48) >> 48 == (int64_t)N->getValue();
-}]>;
-def immSExt16int : PatLeaf<(imm), [{ //(int)imm fits in a 16 bit sign extended field
- return ((int64_t)N->getValue() << 48) >> 48 == ((int64_t)N->getValue() << 32) >> 32;
-}], SExt16>;
-
-def zappat : PatFrag<(ops node:$LHS), (and node:$LHS, imm:$L), [{
- if (ConstantSDNode *RHS = dyn_cast<ConstantSDNode>(N->getOperand(1))) {
- uint64_t build = get_zapImm(N->getOperand(0), (uint64_t)RHS->getValue());
- return build != 0;
- }
- return false;
-}]>;
-
-def immFPZ : PatLeaf<(fpimm), [{ //the only fpconstant nodes are +/- 0.0
- (void)N; // silence warning.
- return true;
-}]>;
-
-def immRem1 : PatLeaf<(imm), [{return chkRemNearPower2(N->getValue(),1, 0);}]>;
-def immRem2 : PatLeaf<(imm), [{return chkRemNearPower2(N->getValue(),2, 0);}]>;
-def immRem3 : PatLeaf<(imm), [{return chkRemNearPower2(N->getValue(),3, 0);}]>;
-def immRem4 : PatLeaf<(imm), [{return chkRemNearPower2(N->getValue(),4, 0);}]>;
-def immRem5 : PatLeaf<(imm), [{return chkRemNearPower2(N->getValue(),5, 0);}]>;
-def immRem1n : PatLeaf<(imm), [{return chkRemNearPower2(N->getValue(),1, 1);}]>;
-def immRem2n : PatLeaf<(imm), [{return chkRemNearPower2(N->getValue(),2, 1);}]>;
-def immRem3n : PatLeaf<(imm), [{return chkRemNearPower2(N->getValue(),3, 1);}]>;
-def immRem4n : PatLeaf<(imm), [{return chkRemNearPower2(N->getValue(),4, 1);}]>;
-def immRem5n : PatLeaf<(imm), [{return chkRemNearPower2(N->getValue(),5, 1);}]>;
-
-def immRemP2n : PatLeaf<(imm), [{
- return isPowerOf2_64(getNearPower2((uint64_t)N->getValue()) - N->getValue());
-}]>;
-def immRemP2 : PatLeaf<(imm), [{
- return isPowerOf2_64(N->getValue() - getNearPower2((uint64_t)N->getValue()));
-}]>;
-def immUExt8ME : PatLeaf<(imm), [{ //use this imm for mulqi
- int64_t d = abs((int64_t)N->getValue() - (int64_t)getNearPower2((uint64_t)N->getValue()));
- if (isPowerOf2_64(d)) return false;
- switch (d) {
- case 1: case 3: case 5: return false;
- default: return (uint64_t)N->getValue() == (uint8_t)N->getValue();
- };
-}]>;
-
-def intop : PatFrag<(ops node:$op), (sext_inreg node:$op, i32)>;
-def add4 : PatFrag<(ops node:$op1, node:$op2),
- (add (shl node:$op1, 2), node:$op2)>;
-def sub4 : PatFrag<(ops node:$op1, node:$op2),
- (sub (shl node:$op1, 2), node:$op2)>;
-def add8 : PatFrag<(ops node:$op1, node:$op2),
- (add (shl node:$op1, 3), node:$op2)>;
-def sub8 : PatFrag<(ops node:$op1, node:$op2),
- (sub (shl node:$op1, 3), node:$op2)>;
-class BinOpFrag<dag res> : PatFrag<(ops node:$LHS, node:$RHS), res>;
-class CmpOpFrag<dag res> : PatFrag<(ops node:$R), res>;
-
-//Pseudo ops for selection
-
-def WTF : PseudoInstAlpha<(outs), (ins variable_ops), "#wtf", [], s_pseudo>;
-
-let hasCtrlDep = 1, Defs = [R30], Uses = [R30] in {
-def ADJUSTSTACKUP : PseudoInstAlpha<(outs), (ins s64imm:$amt),
- "; ADJUP $amt",
- [(callseq_start imm:$amt)], s_pseudo>;
-def ADJUSTSTACKDOWN : PseudoInstAlpha<(outs), (ins s64imm:$amt1, s64imm:$amt2),
- "; ADJDOWN $amt1",
- [(callseq_end imm:$amt1, imm:$amt2)], s_pseudo>;
-}
-
-def ALTENT : PseudoInstAlpha<(outs), (ins s64imm:$TARGET), "$$$TARGET..ng:\n", [], s_pseudo>;
-def PCLABEL : PseudoInstAlpha<(outs), (ins s64imm:$num), "PCMARKER_$num:\n",[], s_pseudo>;
-def MEMLABEL : PseudoInstAlpha<(outs), (ins s64imm:$i, s64imm:$j, s64imm:$k, s64imm:$m),
- "LSMARKER$$$i$$$j$$$k$$$m:", [], s_pseudo>;
-
-
-let usesCustomDAGSchedInserter = 1 in { // Expanded by the scheduler.
-def CAS32 : PseudoInstAlpha<(outs GPRC:$dst), (ins GPRC:$ptr, GPRC:$cmp, GPRC:$swp), "",
- [(set GPRC:$dst, (atomic_lcs_32 GPRC:$ptr, GPRC:$cmp, GPRC:$swp))], s_pseudo>;
-def CAS64 : PseudoInstAlpha<(outs GPRC:$dst), (ins GPRC:$ptr, GPRC:$cmp, GPRC:$swp), "",
- [(set GPRC:$dst, (atomic_lcs_64 GPRC:$ptr, GPRC:$cmp, GPRC:$swp))], s_pseudo>;
-
-def LAS32 : PseudoInstAlpha<(outs GPRC:$dst), (ins GPRC:$ptr, GPRC:$swp), "",
- [(set GPRC:$dst, (atomic_las_32 GPRC:$ptr, GPRC:$swp))], s_pseudo>;
-def LAS64 :PseudoInstAlpha<(outs GPRC:$dst), (ins GPRC:$ptr, GPRC:$swp), "",
- [(set GPRC:$dst, (atomic_las_64 GPRC:$ptr, GPRC:$swp))], s_pseudo>;
-
-def SWAP32 : PseudoInstAlpha<(outs GPRC:$dst), (ins GPRC:$ptr, GPRC:$swp), "",
- [(set GPRC:$dst, (atomic_swap_32 GPRC:$ptr, GPRC:$swp))], s_pseudo>;
-def SWAP64 :PseudoInstAlpha<(outs GPRC:$dst), (ins GPRC:$ptr, GPRC:$swp), "",
- [(set GPRC:$dst, (atomic_swap_64 GPRC:$ptr, GPRC:$swp))], s_pseudo>;
-}
-
-//***********************
-//Real instructions
-//***********************
-
-//Operation Form:
-
-//conditional moves, int
-
-multiclass cmov_inst<bits<7> fun, string asmstr, PatFrag OpNode> {
-def r : OForm4<0x11, fun, !strconcat(asmstr, " $RCOND,$RTRUE,$RDEST"),
- [(set GPRC:$RDEST, (select (OpNode GPRC:$RCOND), GPRC:$RTRUE, GPRC:$RFALSE))], s_cmov>;
-def i : OForm4L<0x11, fun, !strconcat(asmstr, " $RCOND,$RTRUE,$RDEST"),
- [(set GPRC:$RDEST, (select (OpNode GPRC:$RCOND), immUExt8:$RTRUE, GPRC:$RFALSE))], s_cmov>;
-}
-
-defm CMOVEQ : cmov_inst<0x24, "cmoveq", CmpOpFrag<(seteq node:$R, 0)>>;
-defm CMOVNE : cmov_inst<0x26, "cmovne", CmpOpFrag<(setne node:$R, 0)>>;
-defm CMOVLT : cmov_inst<0x44, "cmovlt", CmpOpFrag<(setlt node:$R, 0)>>;
-defm CMOVLE : cmov_inst<0x64, "cmovle", CmpOpFrag<(setle node:$R, 0)>>;
-defm CMOVGT : cmov_inst<0x66, "cmovgt", CmpOpFrag<(setgt node:$R, 0)>>;
-defm CMOVGE : cmov_inst<0x46, "cmovge", CmpOpFrag<(setge node:$R, 0)>>;
-defm CMOVLBC : cmov_inst<0x16, "cmovlbc", CmpOpFrag<(xor node:$R, 1)>>;
-defm CMOVLBS : cmov_inst<0x14, "cmovlbs", CmpOpFrag<(and node:$R, 1)>>;
-
-//General pattern for cmov
-def : Pat<(select GPRC:$which, GPRC:$src1, GPRC:$src2),
- (CMOVNEr GPRC:$src2, GPRC:$src1, GPRC:$which)>;
-def : Pat<(select GPRC:$which, GPRC:$src1, immUExt8:$src2),
- (CMOVEQi GPRC:$src1, immUExt8:$src2, GPRC:$which)>;
-
-//Invert sense when we can for constants:
-def : Pat<(select (setne GPRC:$RCOND, 0), GPRC:$RTRUE, immUExt8:$RFALSE),
- (CMOVEQi GPRC:$RCOND, immUExt8:$RFALSE, GPRC:$RTRUE)>;
-def : Pat<(select (setgt GPRC:$RCOND, 0), GPRC:$RTRUE, immUExt8:$RFALSE),
- (CMOVLEi GPRC:$RCOND, immUExt8:$RFALSE, GPRC:$RTRUE)>;
-def : Pat<(select (setge GPRC:$RCOND, 0), GPRC:$RTRUE, immUExt8:$RFALSE),
- (CMOVLTi GPRC:$RCOND, immUExt8:$RFALSE, GPRC:$RTRUE)>;
-def : Pat<(select (setlt GPRC:$RCOND, 0), GPRC:$RTRUE, immUExt8:$RFALSE),
- (CMOVGEi GPRC:$RCOND, immUExt8:$RFALSE, GPRC:$RTRUE)>;
-def : Pat<(select (setle GPRC:$RCOND, 0), GPRC:$RTRUE, immUExt8:$RFALSE),
- (CMOVGTi GPRC:$RCOND, immUExt8:$RFALSE, GPRC:$RTRUE)>;
-
-multiclass all_inst<bits<6> opc, bits<7> funl, bits<7> funq,
- string asmstr, PatFrag OpNode, InstrItinClass itin> {
- def Lr : OForm< opc, funl, !strconcat(asmstr, "l $RA,$RB,$RC"),
- [(set GPRC:$RC, (intop (OpNode GPRC:$RA, GPRC:$RB)))], itin>;
- def Li : OFormL<opc, funl, !strconcat(asmstr, "l $RA,$L,$RC"),
- [(set GPRC:$RC, (intop (OpNode GPRC:$RA, immUExt8:$L)))], itin>;
- def Qr : OForm< opc, funq, !strconcat(asmstr, "q $RA,$RB,$RC"),
- [(set GPRC:$RC, (OpNode GPRC:$RA, GPRC:$RB))], itin>;
- def Qi : OFormL<opc, funq, !strconcat(asmstr, "q $RA,$L,$RC"),
- [(set GPRC:$RC, (OpNode GPRC:$RA, immUExt8:$L))], itin>;
-}
-
-defm MUL : all_inst<0x13, 0x00, 0x20, "mul", BinOpFrag<(mul node:$LHS, node:$RHS)>, s_imul>;
-defm ADD : all_inst<0x10, 0x00, 0x20, "add", BinOpFrag<(add node:$LHS, node:$RHS)>, s_iadd>;
-defm S4ADD : all_inst<0x10, 0x02, 0x22, "s4add", add4, s_iadd>;
-defm S8ADD : all_inst<0x10, 0x12, 0x32, "s8add", add8, s_iadd>;
-defm S4SUB : all_inst<0x10, 0x0B, 0x2B, "s4sub", sub4, s_iadd>;
-defm S8SUB : all_inst<0x10, 0x1B, 0x3B, "s8sub", sub8, s_iadd>;
-defm SUB : all_inst<0x10, 0x09, 0x29, "sub", BinOpFrag<(sub node:$LHS, node:$RHS)>, s_iadd>;
-//Const cases since legalize does sub x, int -> add x, inv(int) + 1
-def : Pat<(intop (add GPRC:$RA, immUExt8neg:$L)), (SUBLi GPRC:$RA, immUExt8neg:$L)>;
-def : Pat<(add GPRC:$RA, immUExt8neg:$L), (SUBQi GPRC:$RA, immUExt8neg:$L)>;
-def : Pat<(intop (add4 GPRC:$RA, immUExt8neg:$L)), (S4SUBLi GPRC:$RA, immUExt8neg:$L)>;
-def : Pat<(add4 GPRC:$RA, immUExt8neg:$L), (S4SUBQi GPRC:$RA, immUExt8neg:$L)>;
-def : Pat<(intop (add8 GPRC:$RA, immUExt8neg:$L)), (S8SUBLi GPRC:$RA, immUExt8neg:$L)>;
-def : Pat<(add8 GPRC:$RA, immUExt8neg:$L), (S8SUBQi GPRC:$RA, immUExt8neg:$L)>;
-
-multiclass log_inst<bits<6> opc, bits<7> fun, string asmstr, SDNode OpNode, InstrItinClass itin> {
-def r : OForm<opc, fun, !strconcat(asmstr, " $RA,$RB,$RC"),
- [(set GPRC:$RC, (OpNode GPRC:$RA, GPRC:$RB))], itin>;
-def i : OFormL<opc, fun, !strconcat(asmstr, " $RA,$L,$RC"),
- [(set GPRC:$RC, (OpNode GPRC:$RA, immUExt8:$L))], itin>;
-}
-multiclass inv_inst<bits<6> opc, bits<7> fun, string asmstr, SDNode OpNode, InstrItinClass itin> {
-def r : OForm<opc, fun, !strconcat(asmstr, " $RA,$RB,$RC"),
- [(set GPRC:$RC, (OpNode GPRC:$RA, (not GPRC:$RB)))], itin>;
-def i : OFormL<opc, fun, !strconcat(asmstr, " $RA,$L,$RC"),
- [(set GPRC:$RC, (OpNode GPRC:$RA, immUExt8inv:$L))], itin>;
-}
-
-defm AND : log_inst<0x11, 0x00, "and", and, s_ilog>;
-defm BIC : inv_inst<0x11, 0x08, "bic", and, s_ilog>;
-defm BIS : log_inst<0x11, 0x20, "bis", or, s_ilog>;
-defm ORNOT : inv_inst<0x11, 0x28, "ornot", or, s_ilog>;
-defm XOR : log_inst<0x11, 0x40, "xor", xor, s_ilog>;
-defm EQV : inv_inst<0x11, 0x48, "eqv", xor, s_ilog>;
-
-defm SL : log_inst<0x12, 0x39, "sll", shl, s_ishf>;
-defm SRA : log_inst<0x12, 0x3c, "sra", sra, s_ishf>;
-defm SRL : log_inst<0x12, 0x34, "srl", srl, s_ishf>;
-defm UMULH : log_inst<0x13, 0x30, "umulh", mulhu, s_imul>;
-
-def CTLZ : OForm2<0x1C, 0x32, "CTLZ $RB,$RC",
- [(set GPRC:$RC, (ctlz GPRC:$RB))], s_imisc>;
-def CTPOP : OForm2<0x1C, 0x30, "CTPOP $RB,$RC",
- [(set GPRC:$RC, (ctpop GPRC:$RB))], s_imisc>;
-def CTTZ : OForm2<0x1C, 0x33, "CTTZ $RB,$RC",
- [(set GPRC:$RC, (cttz GPRC:$RB))], s_imisc>;
-def EXTBL : OForm< 0x12, 0x06, "EXTBL $RA,$RB,$RC",
- [(set GPRC:$RC, (and (srl GPRC:$RA, (shl GPRC:$RB, 3)), 255))], s_ishf>;
-def EXTWL : OForm< 0x12, 0x16, "EXTWL $RA,$RB,$RC",
- [(set GPRC:$RC, (and (srl GPRC:$RA, (shl GPRC:$RB, 3)), 65535))], s_ishf>;
-def EXTLL : OForm< 0x12, 0x26, "EXTLL $RA,$RB,$RC",
- [(set GPRC:$RC, (and (srl GPRC:$RA, (shl GPRC:$RB, 3)), 4294967295))], s_ishf>;
-def SEXTB : OForm2<0x1C, 0x00, "sextb $RB,$RC",
- [(set GPRC:$RC, (sext_inreg GPRC:$RB, i8))], s_ishf>;
-def SEXTW : OForm2<0x1C, 0x01, "sextw $RB,$RC",
- [(set GPRC:$RC, (sext_inreg GPRC:$RB, i16))], s_ishf>;
-
-//def EXTBLi : OFormL<0x12, 0x06, "EXTBL $RA,$L,$RC", []>; //Extract byte low
-//def EXTLH : OForm< 0x12, 0x6A, "EXTLH $RA,$RB,$RC", []>; //Extract longword high
-//def EXTLHi : OFormL<0x12, 0x6A, "EXTLH $RA,$L,$RC", []>; //Extract longword high
-//def EXTLLi : OFormL<0x12, 0x26, "EXTLL $RA,$L,$RC", []>; //Extract longword low
-//def EXTQH : OForm< 0x12, 0x7A, "EXTQH $RA,$RB,$RC", []>; //Extract quadword high
-//def EXTQHi : OFormL<0x12, 0x7A, "EXTQH $RA,$L,$RC", []>; //Extract quadword high
-//def EXTQ : OForm< 0x12, 0x36, "EXTQ $RA,$RB,$RC", []>; //Extract quadword low
-//def EXTQi : OFormL<0x12, 0x36, "EXTQ $RA,$L,$RC", []>; //Extract quadword low
-//def EXTWH : OForm< 0x12, 0x5A, "EXTWH $RA,$RB,$RC", []>; //Extract word high
-//def EXTWHi : OFormL<0x12, 0x5A, "EXTWH $RA,$L,$RC", []>; //Extract word high
-//def EXTWLi : OFormL<0x12, 0x16, "EXTWL $RA,$L,$RC", []>; //Extract word low
-
-//def INSBL : OForm< 0x12, 0x0B, "INSBL $RA,$RB,$RC", []>; //Insert byte low
-//def INSBLi : OFormL<0x12, 0x0B, "INSBL $RA,$L,$RC", []>; //Insert byte low
-//def INSLH : OForm< 0x12, 0x67, "INSLH $RA,$RB,$RC", []>; //Insert longword high
-//def INSLHi : OFormL<0x12, 0x67, "INSLH $RA,$L,$RC", []>; //Insert longword high
-//def INSLL : OForm< 0x12, 0x2B, "INSLL $RA,$RB,$RC", []>; //Insert longword low
-//def INSLLi : OFormL<0x12, 0x2B, "INSLL $RA,$L,$RC", []>; //Insert longword low
-//def INSQH : OForm< 0x12, 0x77, "INSQH $RA,$RB,$RC", []>; //Insert quadword high
-//def INSQHi : OFormL<0x12, 0x77, "INSQH $RA,$L,$RC", []>; //Insert quadword high
-//def INSQL : OForm< 0x12, 0x3B, "INSQL $RA,$RB,$RC", []>; //Insert quadword low
-//def INSQLi : OFormL<0x12, 0x3B, "INSQL $RA,$L,$RC", []>; //Insert quadword low
-//def INSWH : OForm< 0x12, 0x57, "INSWH $RA,$RB,$RC", []>; //Insert word high
-//def INSWHi : OFormL<0x12, 0x57, "INSWH $RA,$L,$RC", []>; //Insert word high
-//def INSWL : OForm< 0x12, 0x1B, "INSWL $RA,$RB,$RC", []>; //Insert word low
-//def INSWLi : OFormL<0x12, 0x1B, "INSWL $RA,$L,$RC", []>; //Insert word low
-
-//def MSKBL : OForm< 0x12, 0x02, "MSKBL $RA,$RB,$RC", []>; //Mask byte low
-//def MSKBLi : OFormL<0x12, 0x02, "MSKBL $RA,$L,$RC", []>; //Mask byte low
-//def MSKLH : OForm< 0x12, 0x62, "MSKLH $RA,$RB,$RC", []>; //Mask longword high
-//def MSKLHi : OFormL<0x12, 0x62, "MSKLH $RA,$L,$RC", []>; //Mask longword high
-//def MSKLL : OForm< 0x12, 0x22, "MSKLL $RA,$RB,$RC", []>; //Mask longword low
-//def MSKLLi : OFormL<0x12, 0x22, "MSKLL $RA,$L,$RC", []>; //Mask longword low
-//def MSKQH : OForm< 0x12, 0x72, "MSKQH $RA,$RB,$RC", []>; //Mask quadword high
-//def MSKQHi : OFormL<0x12, 0x72, "MSKQH $RA,$L,$RC", []>; //Mask quadword high
-//def MSKQL : OForm< 0x12, 0x32, "MSKQL $RA,$RB,$RC", []>; //Mask quadword low
-//def MSKQLi : OFormL<0x12, 0x32, "MSKQL $RA,$L,$RC", []>; //Mask quadword low
-//def MSKWH : OForm< 0x12, 0x52, "MSKWH $RA,$RB,$RC", []>; //Mask word high
-//def MSKWHi : OFormL<0x12, 0x52, "MSKWH $RA,$L,$RC", []>; //Mask word high
-//def MSKWL : OForm< 0x12, 0x12, "MSKWL $RA,$RB,$RC", []>; //Mask word low
-//def MSKWLi : OFormL<0x12, 0x12, "MSKWL $RA,$L,$RC", []>; //Mask word low
-
-def ZAPNOTi : OFormL<0x12, 0x31, "zapnot $RA,$L,$RC", [], s_ishf>;
-
-// Define the pattern that produces ZAPNOTi.
-def : Pat<(i64 (zappat GPRC:$RA):$imm),
- (ZAPNOTi GPRC:$RA, (iZAPX GPRC:$imm))>;
-
-
-//Comparison, int
-//So this is a waste of what this instruction can do, but it still saves something
-def CMPBGE : OForm< 0x10, 0x0F, "cmpbge $RA,$RB,$RC",
- [(set GPRC:$RC, (setuge (and GPRC:$RA, 255), (and GPRC:$RB, 255)))], s_ilog>;
-def CMPBGEi : OFormL<0x10, 0x0F, "cmpbge $RA,$L,$RC",
- [(set GPRC:$RC, (setuge (and GPRC:$RA, 255), immUExt8:$L))], s_ilog>;
-def CMPEQ : OForm< 0x10, 0x2D, "cmpeq $RA,$RB,$RC",
- [(set GPRC:$RC, (seteq GPRC:$RA, GPRC:$RB))], s_iadd>;
-def CMPEQi : OFormL<0x10, 0x2D, "cmpeq $RA,$L,$RC",
- [(set GPRC:$RC, (seteq GPRC:$RA, immUExt8:$L))], s_iadd>;
-def CMPLE : OForm< 0x10, 0x6D, "cmple $RA,$RB,$RC",
- [(set GPRC:$RC, (setle GPRC:$RA, GPRC:$RB))], s_iadd>;
-def CMPLEi : OFormL<0x10, 0x6D, "cmple $RA,$L,$RC",
- [(set GPRC:$RC, (setle GPRC:$RA, immUExt8:$L))], s_iadd>;
-def CMPLT : OForm< 0x10, 0x4D, "cmplt $RA,$RB,$RC",
- [(set GPRC:$RC, (setlt GPRC:$RA, GPRC:$RB))], s_iadd>;
-def CMPLTi : OFormL<0x10, 0x4D, "cmplt $RA,$L,$RC",
- [(set GPRC:$RC, (setlt GPRC:$RA, immUExt8:$L))], s_iadd>;
-def CMPULE : OForm< 0x10, 0x3D, "cmpule $RA,$RB,$RC",
- [(set GPRC:$RC, (setule GPRC:$RA, GPRC:$RB))], s_iadd>;
-def CMPULEi : OFormL<0x10, 0x3D, "cmpule $RA,$L,$RC",
- [(set GPRC:$RC, (setule GPRC:$RA, immUExt8:$L))], s_iadd>;
-def CMPULT : OForm< 0x10, 0x1D, "cmpult $RA,$RB,$RC",
- [(set GPRC:$RC, (setult GPRC:$RA, GPRC:$RB))], s_iadd>;
-def CMPULTi : OFormL<0x10, 0x1D, "cmpult $RA,$L,$RC",
- [(set GPRC:$RC, (setult GPRC:$RA, immUExt8:$L))], s_iadd>;
-
-//Patterns for unsupported int comparisons
-def : Pat<(setueq GPRC:$X, GPRC:$Y), (CMPEQ GPRC:$X, GPRC:$Y)>;
-def : Pat<(setueq GPRC:$X, immUExt8:$Y), (CMPEQi GPRC:$X, immUExt8:$Y)>;
-
-def : Pat<(setugt GPRC:$X, GPRC:$Y), (CMPULT GPRC:$Y, GPRC:$X)>;
-def : Pat<(setugt immUExt8:$X, GPRC:$Y), (CMPULTi GPRC:$Y, immUExt8:$X)>;
-
-def : Pat<(setuge GPRC:$X, GPRC:$Y), (CMPULE GPRC:$Y, GPRC:$X)>;
-def : Pat<(setuge immUExt8:$X, GPRC:$Y), (CMPULEi GPRC:$Y, immUExt8:$X)>;
-
-def : Pat<(setgt GPRC:$X, GPRC:$Y), (CMPLT GPRC:$Y, GPRC:$X)>;
-def : Pat<(setgt immUExt8:$X, GPRC:$Y), (CMPLTi GPRC:$Y, immUExt8:$X)>;
-
-def : Pat<(setge GPRC:$X, GPRC:$Y), (CMPLE GPRC:$Y, GPRC:$X)>;
-def : Pat<(setge immUExt8:$X, GPRC:$Y), (CMPLEi GPRC:$Y, immUExt8:$X)>;
-
-def : Pat<(setne GPRC:$X, GPRC:$Y), (CMPEQi (CMPEQ GPRC:$X, GPRC:$Y), 0)>;
-def : Pat<(setne GPRC:$X, immUExt8:$Y), (CMPEQi (CMPEQi GPRC:$X, immUExt8:$Y), 0)>;
-
-def : Pat<(setune GPRC:$X, GPRC:$Y), (CMPEQi (CMPEQ GPRC:$X, GPRC:$Y), 0)>;
-def : Pat<(setune GPRC:$X, immUExt8:$Y), (CMPEQi (CMPEQ GPRC:$X, immUExt8:$Y), 0)>;
-
-
-let isReturn = 1, isTerminator = 1, Ra = 31, Rb = 26, disp = 1, Uses = [R26] in {
- def RETDAG : MbrForm< 0x1A, 0x02, (ops), "ret $$31,($$26),1", s_jsr>; //Return from subroutine
- def RETDAGp : MbrpForm< 0x1A, 0x02, (ops), "ret $$31,($$26),1", [(retflag)], s_jsr>; //Return from subroutine
-}
-
-let isBranch = 1, isTerminator = 1, isBarrier = 1, isIndirectBranch = 1, Ra = 31, disp = 0 in
-def JMP : MbrpForm< 0x1A, 0x00, (ops GPRC:$RS), "jmp $$31,($RS),0",
- [(brind GPRC:$RS)], s_jsr>; //Jump
-
-let isCall = 1, Ra = 26,
- Defs = [R0, R1, R2, R3, R4, R5, R6, R7, R8, R16, R17, R18, R19,
- R20, R21, R22, R23, R24, R25, R26, R27, R28, R29,
- F0, F1,
- F10, F11, F12, F13, F14, F15, F16, F17, F18, F19,
- F20, F21, F22, F23, F24, F25, F26, F27, F28, F29, F30], Uses = [R29] in {
- def BSR : BFormD<0x34, "bsr $$26,$$$DISP..ng", [], s_jsr>; //Branch to subroutine
-}
-let isCall = 1, Ra = 26, Rb = 27, disp = 0,
- Defs = [R0, R1, R2, R3, R4, R5, R6, R7, R8, R16, R17, R18, R19,
- R20, R21, R22, R23, R24, R25, R26, R27, R28, R29,
- F0, F1,
- F10, F11, F12, F13, F14, F15, F16, F17, F18, F19,
- F20, F21, F22, F23, F24, F25, F26, F27, F28, F29, F30], Uses = [R27, R29] in {
- def JSR : MbrForm< 0x1A, 0x01, (ops ), "jsr $$26,($$27),0", s_jsr>; //Jump to subroutine
-}
-
-let isCall = 1, Ra = 23, Rb = 27, disp = 0,
- Defs = [R23, R24, R25, R27, R28], Uses = [R24, R25, R27] in
- def JSRs : MbrForm< 0x1A, 0x01, (ops ), "jsr $$23,($$27),0", s_jsr>; //Jump to div or rem
-
-
-def JSR_COROUTINE : MbrForm< 0x1A, 0x03, (ops GPRC:$RD, GPRC:$RS, s14imm:$DISP), "jsr_coroutine $RD,($RS),$DISP", s_jsr>; //Jump to subroutine return
-
-
-let OutOperandList = (ops GPRC:$RA), InOperandList = (ops s64imm:$DISP, GPRC:$RB) in {
-def LDQ : MForm<0x29, 1, "ldq $RA,$DISP($RB)",
- [(set GPRC:$RA, (load (add GPRC:$RB, immSExt16:$DISP)))], s_ild>;
-def LDQr : MForm<0x29, 1, "ldq $RA,$DISP($RB)\t\t!gprellow",
- [(set GPRC:$RA, (load (Alpha_gprello tglobaladdr:$DISP, GPRC:$RB)))], s_ild>;
-def LDL : MForm<0x28, 1, "ldl $RA,$DISP($RB)",
- [(set GPRC:$RA, (sextloadi32 (add GPRC:$RB, immSExt16:$DISP)))], s_ild>;
-def LDLr : MForm<0x28, 1, "ldl $RA,$DISP($RB)\t\t!gprellow",
- [(set GPRC:$RA, (sextloadi32 (Alpha_gprello tglobaladdr:$DISP, GPRC:$RB)))], s_ild>;
-def LDBU : MForm<0x0A, 1, "ldbu $RA,$DISP($RB)",
- [(set GPRC:$RA, (zextloadi8 (add GPRC:$RB, immSExt16:$DISP)))], s_ild>;
-def LDBUr : MForm<0x0A, 1, "ldbu $RA,$DISP($RB)\t\t!gprellow",
- [(set GPRC:$RA, (zextloadi8 (Alpha_gprello tglobaladdr:$DISP, GPRC:$RB)))], s_ild>;
-def LDWU : MForm<0x0C, 1, "ldwu $RA,$DISP($RB)",
- [(set GPRC:$RA, (zextloadi16 (add GPRC:$RB, immSExt16:$DISP)))], s_ild>;
-def LDWUr : MForm<0x0C, 1, "ldwu $RA,$DISP($RB)\t\t!gprellow",
- [(set GPRC:$RA, (zextloadi16 (Alpha_gprello tglobaladdr:$DISP, GPRC:$RB)))], s_ild>;
-}
-
-
-let OutOperandList = (ops), InOperandList = (ops GPRC:$RA, s64imm:$DISP, GPRC:$RB) in {
-def STB : MForm<0x0E, 0, "stb $RA,$DISP($RB)",
- [(truncstorei8 GPRC:$RA, (add GPRC:$RB, immSExt16:$DISP))], s_ist>;
-def STBr : MForm<0x0E, 0, "stb $RA,$DISP($RB)\t\t!gprellow",
- [(truncstorei8 GPRC:$RA, (Alpha_gprello tglobaladdr:$DISP, GPRC:$RB))], s_ist>;
-def STW : MForm<0x0D, 0, "stw $RA,$DISP($RB)",
- [(truncstorei16 GPRC:$RA, (add GPRC:$RB, immSExt16:$DISP))], s_ist>;
-def STWr : MForm<0x0D, 0, "stw $RA,$DISP($RB)\t\t!gprellow",
- [(truncstorei16 GPRC:$RA, (Alpha_gprello tglobaladdr:$DISP, GPRC:$RB))], s_ist>;
-def STL : MForm<0x2C, 0, "stl $RA,$DISP($RB)",
- [(truncstorei32 GPRC:$RA, (add GPRC:$RB, immSExt16:$DISP))], s_ist>;
-def STLr : MForm<0x2C, 0, "stl $RA,$DISP($RB)\t\t!gprellow",
- [(truncstorei32 GPRC:$RA, (Alpha_gprello tglobaladdr:$DISP, GPRC:$RB))], s_ist>;
-def STQ : MForm<0x2D, 0, "stq $RA,$DISP($RB)",
- [(store GPRC:$RA, (add GPRC:$RB, immSExt16:$DISP))], s_ist>;
-def STQr : MForm<0x2D, 0, "stq $RA,$DISP($RB)\t\t!gprellow",
- [(store GPRC:$RA, (Alpha_gprello tglobaladdr:$DISP, GPRC:$RB))], s_ist>;
-}
-
-//Load address
-let OutOperandList = (ops GPRC:$RA), InOperandList = (ops s64imm:$DISP, GPRC:$RB) in {
-def LDA : MForm<0x08, 0, "lda $RA,$DISP($RB)",
- [(set GPRC:$RA, (add GPRC:$RB, immSExt16:$DISP))], s_lda>;
-def LDAr : MForm<0x08, 0, "lda $RA,$DISP($RB)\t\t!gprellow",
- [(set GPRC:$RA, (Alpha_gprello tglobaladdr:$DISP, GPRC:$RB))], s_lda>; //Load address
-def LDAH : MForm<0x09, 0, "ldah $RA,$DISP($RB)",
- [], s_lda>; //Load address high
-def LDAHr : MForm<0x09, 0, "ldah $RA,$DISP($RB)\t\t!gprelhigh",
- [(set GPRC:$RA, (Alpha_gprelhi tglobaladdr:$DISP, GPRC:$RB))], s_lda>; //Load address high
-}
-
-let OutOperandList = (ops), InOperandList = (ops F4RC:$RA, s64imm:$DISP, GPRC:$RB) in {
-def STS : MForm<0x26, 0, "sts $RA,$DISP($RB)",
- [(store F4RC:$RA, (add GPRC:$RB, immSExt16:$DISP))], s_fst>;
-def STSr : MForm<0x26, 0, "sts $RA,$DISP($RB)\t\t!gprellow",
- [(store F4RC:$RA, (Alpha_gprello tglobaladdr:$DISP, GPRC:$RB))], s_fst>;
-}
-let OutOperandList = (ops F4RC:$RA), InOperandList = (ops s64imm:$DISP, GPRC:$RB) in {
-def LDS : MForm<0x22, 1, "lds $RA,$DISP($RB)",
- [(set F4RC:$RA, (load (add GPRC:$RB, immSExt16:$DISP)))], s_fld>;
-def LDSr : MForm<0x22, 1, "lds $RA,$DISP($RB)\t\t!gprellow",
- [(set F4RC:$RA, (load (Alpha_gprello tglobaladdr:$DISP, GPRC:$RB)))], s_fld>;
-}
-let OutOperandList = (ops), InOperandList = (ops F8RC:$RA, s64imm:$DISP, GPRC:$RB) in {
-def STT : MForm<0x27, 0, "stt $RA,$DISP($RB)",
- [(store F8RC:$RA, (add GPRC:$RB, immSExt16:$DISP))], s_fst>;
-def STTr : MForm<0x27, 0, "stt $RA,$DISP($RB)\t\t!gprellow",
- [(store F8RC:$RA, (Alpha_gprello tglobaladdr:$DISP, GPRC:$RB))], s_fst>;
-}
-let OutOperandList = (ops F8RC:$RA), InOperandList = (ops s64imm:$DISP, GPRC:$RB) in {
-def LDT : MForm<0x23, 1, "ldt $RA,$DISP($RB)",
- [(set F8RC:$RA, (load (add GPRC:$RB, immSExt16:$DISP)))], s_fld>;
-def LDTr : MForm<0x23, 1, "ldt $RA,$DISP($RB)\t\t!gprellow",
- [(set F8RC:$RA, (load (Alpha_gprello tglobaladdr:$DISP, GPRC:$RB)))], s_fld>;
-}
-
-
-//constpool rels
-def : Pat<(i64 (load (Alpha_gprello tconstpool:$DISP, GPRC:$RB))),
- (LDQr tconstpool:$DISP, GPRC:$RB)>;
-def : Pat<(i64 (sextloadi32 (Alpha_gprello tconstpool:$DISP, GPRC:$RB))),
- (LDLr tconstpool:$DISP, GPRC:$RB)>;
-def : Pat<(i64 (zextloadi8 (Alpha_gprello tconstpool:$DISP, GPRC:$RB))),
- (LDBUr tconstpool:$DISP, GPRC:$RB)>;
-def : Pat<(i64 (zextloadi16 (Alpha_gprello tconstpool:$DISP, GPRC:$RB))),
- (LDWUr tconstpool:$DISP, GPRC:$RB)>;
-def : Pat<(i64 (Alpha_gprello tconstpool:$DISP, GPRC:$RB)),
- (LDAr tconstpool:$DISP, GPRC:$RB)>;
-def : Pat<(i64 (Alpha_gprelhi tconstpool:$DISP, GPRC:$RB)),
- (LDAHr tconstpool:$DISP, GPRC:$RB)>;
-def : Pat<(f32 (load (Alpha_gprello tconstpool:$DISP, GPRC:$RB))),
- (LDSr tconstpool:$DISP, GPRC:$RB)>;
-def : Pat<(f64 (load (Alpha_gprello tconstpool:$DISP, GPRC:$RB))),
- (LDTr tconstpool:$DISP, GPRC:$RB)>;
-
-//jumptable rels
-def : Pat<(i64 (Alpha_gprelhi tjumptable:$DISP, GPRC:$RB)),
- (LDAHr tjumptable:$DISP, GPRC:$RB)>;
-def : Pat<(i64 (Alpha_gprello tjumptable:$DISP, GPRC:$RB)),
- (LDAr tjumptable:$DISP, GPRC:$RB)>;
-
-
-//misc ext patterns
-def : Pat<(i64 (extloadi8 (add GPRC:$RB, immSExt16:$DISP))),
- (LDBU immSExt16:$DISP, GPRC:$RB)>;
-def : Pat<(i64 (extloadi16 (add GPRC:$RB, immSExt16:$DISP))),
- (LDWU immSExt16:$DISP, GPRC:$RB)>;
-def : Pat<(i64 (extloadi32 (add GPRC:$RB, immSExt16:$DISP))),
- (LDL immSExt16:$DISP, GPRC:$RB)>;
-
-//0 disp patterns
-def : Pat<(i64 (load GPRC:$addr)),
- (LDQ 0, GPRC:$addr)>;
-def : Pat<(f64 (load GPRC:$addr)),
- (LDT 0, GPRC:$addr)>;
-def : Pat<(f32 (load GPRC:$addr)),
- (LDS 0, GPRC:$addr)>;
-def : Pat<(i64 (sextloadi32 GPRC:$addr)),
- (LDL 0, GPRC:$addr)>;
-def : Pat<(i64 (zextloadi16 GPRC:$addr)),
- (LDWU 0, GPRC:$addr)>;
-def : Pat<(i64 (zextloadi8 GPRC:$addr)),
- (LDBU 0, GPRC:$addr)>;
-def : Pat<(i64 (extloadi8 GPRC:$addr)),
- (LDBU 0, GPRC:$addr)>;
-def : Pat<(i64 (extloadi16 GPRC:$addr)),
- (LDWU 0, GPRC:$addr)>;
-def : Pat<(i64 (extloadi32 GPRC:$addr)),
- (LDL 0, GPRC:$addr)>;
-
-def : Pat<(store GPRC:$DATA, GPRC:$addr),
- (STQ GPRC:$DATA, 0, GPRC:$addr)>;
-def : Pat<(store F8RC:$DATA, GPRC:$addr),
- (STT F8RC:$DATA, 0, GPRC:$addr)>;
-def : Pat<(store F4RC:$DATA, GPRC:$addr),
- (STS F4RC:$DATA, 0, GPRC:$addr)>;
-def : Pat<(truncstorei32 GPRC:$DATA, GPRC:$addr),
- (STL GPRC:$DATA, 0, GPRC:$addr)>;
-def : Pat<(truncstorei16 GPRC:$DATA, GPRC:$addr),
- (STW GPRC:$DATA, 0, GPRC:$addr)>;
-def : Pat<(truncstorei8 GPRC:$DATA, GPRC:$addr),
- (STB GPRC:$DATA, 0, GPRC:$addr)>;
-
-
-//load address, rellocated gpdist form
-let OutOperandList = (ops GPRC:$RA), InOperandList = (ops s16imm:$DISP, GPRC:$RB, s16imm:$NUM) in {
-def LDAg : MForm<0x08, 1, "lda $RA,0($RB)\t\t!gpdisp!$NUM", [], s_lda>; //Load address
-def LDAHg : MForm<0x09, 1, "ldah $RA,0($RB)\t\t!gpdisp!$NUM", [], s_lda>; //Load address
-}
-
-//Load quad, rellocated literal form
-let OutOperandList = (ops GPRC:$RA), InOperandList = (ops s64imm:$DISP, GPRC:$RB) in
-def LDQl : MForm<0x29, 1, "ldq $RA,$DISP($RB)\t\t!literal",
- [(set GPRC:$RA, (Alpha_rellit tglobaladdr:$DISP, GPRC:$RB))], s_ild>;
-def : Pat<(Alpha_rellit texternalsym:$ext, GPRC:$RB),
- (LDQl texternalsym:$ext, GPRC:$RB)>;
-
-let OutOperandList = (outs GPRC:$RR),
- InOperandList = (ins GPRC:$RA, s64imm:$DISP, GPRC:$RB),
- Constraints = "$RA = $RR",
- DisableEncoding = "$RR" in {
-def STQ_C : MForm<0x2F, 0, "stq_l $RA,$DISP($RB)", [], s_ist>;
-def STL_C : MForm<0x2E, 0, "stl_l $RA,$DISP($RB)", [], s_ist>;
-}
-let OutOperandList = (ops GPRC:$RA), InOperandList = (ops s64imm:$DISP, GPRC:$RB) in {
-def LDQ_L : MForm<0x2B, 1, "ldq_l $RA,$DISP($RB)", [], s_ild>;
-def LDL_L : MForm<0x2A, 1, "ldl_l $RA,$DISP($RB)", [], s_ild>;
-}
-
-def RPCC : MfcForm<0x18, 0xC000, "rpcc $RA", s_rpcc>; //Read process cycle counter
-def MB : MfcPForm<0x18, 0x4000, "mb", s_imisc>; //memory barrier
-def WMB : MfcPForm<0x18, 0x4400, "wmb", s_imisc>; //write memory barrier
-
-def : Pat<(membarrier (i64 imm:$ll), (i64 imm:$ls), (i64 imm:$sl), (i64 1), (i64 imm:$dev)),
- (WMB)>;
-def : Pat<(membarrier (i64 imm:$ll), (i64 imm:$ls), (i64 imm:$sl), (i64 imm:$ss), (i64 imm:$dev)),
- (MB)>;
-
-//Basic Floating point ops
-
-//Floats
-
-let OutOperandList = (ops F4RC:$RC), InOperandList = (ops F4RC:$RB), Fa = 31 in
-def SQRTS : FPForm<0x14, 0x58B, "sqrts/su $RB,$RC",
- [(set F4RC:$RC, (fsqrt F4RC:$RB))], s_fsqrts>;
-
-let OutOperandList = (ops F4RC:$RC), InOperandList = (ops F4RC:$RA, F4RC:$RB) in {
-def ADDS : FPForm<0x16, 0x580, "adds/su $RA,$RB,$RC",
- [(set F4RC:$RC, (fadd F4RC:$RA, F4RC:$RB))], s_fadd>;
-def SUBS : FPForm<0x16, 0x581, "subs/su $RA,$RB,$RC",
- [(set F4RC:$RC, (fsub F4RC:$RA, F4RC:$RB))], s_fadd>;
-def DIVS : FPForm<0x16, 0x583, "divs/su $RA,$RB,$RC",
- [(set F4RC:$RC, (fdiv F4RC:$RA, F4RC:$RB))], s_fdivs>;
-def MULS : FPForm<0x16, 0x582, "muls/su $RA,$RB,$RC",
- [(set F4RC:$RC, (fmul F4RC:$RA, F4RC:$RB))], s_fmul>;
-
-def CPYSS : FPForm<0x17, 0x020, "cpys $RA,$RB,$RC",
- [(set F4RC:$RC, (fcopysign F4RC:$RB, F4RC:$RA))], s_fadd>;
-def CPYSES : FPForm<0x17, 0x022, "cpyse $RA,$RB,$RC",[], s_fadd>; //Copy sign and exponent
-def CPYSNS : FPForm<0x17, 0x021, "cpysn $RA,$RB,$RC",
- [(set F4RC:$RC, (fneg (fcopysign F4RC:$RB, F4RC:$RA)))], s_fadd>;
-}
-
-//Doubles
-
-let OutOperandList = (ops F8RC:$RC), InOperandList = (ops F8RC:$RB), Fa = 31 in
-def SQRTT : FPForm<0x14, 0x5AB, "sqrtt/su $RB,$RC",
- [(set F8RC:$RC, (fsqrt F8RC:$RB))], s_fsqrtt>;
-
-let OutOperandList = (ops F8RC:$RC), InOperandList = (ops F8RC:$RA, F8RC:$RB) in {
-def ADDT : FPForm<0x16, 0x5A0, "addt/su $RA,$RB,$RC",
- [(set F8RC:$RC, (fadd F8RC:$RA, F8RC:$RB))], s_fadd>;
-def SUBT : FPForm<0x16, 0x5A1, "subt/su $RA,$RB,$RC",
- [(set F8RC:$RC, (fsub F8RC:$RA, F8RC:$RB))], s_fadd>;
-def DIVT : FPForm<0x16, 0x5A3, "divt/su $RA,$RB,$RC",
- [(set F8RC:$RC, (fdiv F8RC:$RA, F8RC:$RB))], s_fdivt>;
-def MULT : FPForm<0x16, 0x5A2, "mult/su $RA,$RB,$RC",
- [(set F8RC:$RC, (fmul F8RC:$RA, F8RC:$RB))], s_fmul>;
-
-def CPYST : FPForm<0x17, 0x020, "cpys $RA,$RB,$RC",
- [(set F8RC:$RC, (fcopysign F8RC:$RB, F8RC:$RA))], s_fadd>;
-def CPYSET : FPForm<0x17, 0x022, "cpyse $RA,$RB,$RC",[], s_fadd>; //Copy sign and exponent
-def CPYSNT : FPForm<0x17, 0x021, "cpysn $RA,$RB,$RC",
- [(set F8RC:$RC, (fneg (fcopysign F8RC:$RB, F8RC:$RA)))], s_fadd>;
-
-def CMPTEQ : FPForm<0x16, 0x5A5, "cmpteq/su $RA,$RB,$RC", [], s_fadd>;
-// [(set F8RC:$RC, (seteq F8RC:$RA, F8RC:$RB))]>;
-def CMPTLE : FPForm<0x16, 0x5A7, "cmptle/su $RA,$RB,$RC", [], s_fadd>;
-// [(set F8RC:$RC, (setle F8RC:$RA, F8RC:$RB))]>;
-def CMPTLT : FPForm<0x16, 0x5A6, "cmptlt/su $RA,$RB,$RC", [], s_fadd>;
-// [(set F8RC:$RC, (setlt F8RC:$RA, F8RC:$RB))]>;
-def CMPTUN : FPForm<0x16, 0x5A4, "cmptun/su $RA,$RB,$RC", [], s_fadd>;
-// [(set F8RC:$RC, (setuo F8RC:$RA, F8RC:$RB))]>;
-}
-
-//More CPYS forms:
-let OutOperandList = (ops F8RC:$RC), InOperandList = (ops F4RC:$RA, F8RC:$RB) in {
-def CPYSTs : FPForm<0x17, 0x020, "cpys $RA,$RB,$RC",
- [(set F8RC:$RC, (fcopysign F8RC:$RB, F4RC:$RA))], s_fadd>;
-def CPYSNTs : FPForm<0x17, 0x021, "cpysn $RA,$RB,$RC",
- [(set F8RC:$RC, (fneg (fcopysign F8RC:$RB, F4RC:$RA)))], s_fadd>;
-}
-let OutOperandList = (ops F4RC:$RC), InOperandList = (ops F8RC:$RA, F4RC:$RB) in {
-def CPYSSt : FPForm<0x17, 0x020, "cpys $RA,$RB,$RC",
- [(set F4RC:$RC, (fcopysign F4RC:$RB, F8RC:$RA))], s_fadd>;
-def CPYSESt : FPForm<0x17, 0x022, "cpyse $RA,$RB,$RC",[], s_fadd>; //Copy sign and exponent
-def CPYSNSt : FPForm<0x17, 0x021, "cpysn $RA,$RB,$RC",
- [(set F4RC:$RC, (fneg (fcopysign F4RC:$RB, F8RC:$RA)))], s_fadd>;
-}
-
-//conditional moves, floats
-let OutOperandList = (ops F4RC:$RDEST), InOperandList = (ops F4RC:$RFALSE, F4RC:$RTRUE, F8RC:$RCOND),
- isTwoAddress = 1 in {
-def FCMOVEQS : FPForm<0x17, 0x02A, "fcmoveq $RCOND,$RTRUE,$RDEST",[], s_fcmov>; //FCMOVE if = zero
-def FCMOVGES : FPForm<0x17, 0x02D, "fcmovge $RCOND,$RTRUE,$RDEST",[], s_fcmov>; //FCMOVE if >= zero
-def FCMOVGTS : FPForm<0x17, 0x02F, "fcmovgt $RCOND,$RTRUE,$RDEST",[], s_fcmov>; //FCMOVE if > zero
-def FCMOVLES : FPForm<0x17, 0x02E, "fcmovle $RCOND,$RTRUE,$RDEST",[], s_fcmov>; //FCMOVE if <= zero
-def FCMOVLTS : FPForm<0x17, 0x02C, "fcmovlt $RCOND,$RTRUE,$RDEST",[], s_fcmov>; // FCMOVE if < zero
-def FCMOVNES : FPForm<0x17, 0x02B, "fcmovne $RCOND,$RTRUE,$RDEST",[], s_fcmov>; //FCMOVE if != zero
-}
-//conditional moves, doubles
-let OutOperandList = (ops F8RC:$RDEST), InOperandList = (ops F8RC:$RFALSE, F8RC:$RTRUE, F8RC:$RCOND),
- isTwoAddress = 1 in {
-def FCMOVEQT : FPForm<0x17, 0x02A, "fcmoveq $RCOND,$RTRUE,$RDEST", [], s_fcmov>;
-def FCMOVGET : FPForm<0x17, 0x02D, "fcmovge $RCOND,$RTRUE,$RDEST", [], s_fcmov>;
-def FCMOVGTT : FPForm<0x17, 0x02F, "fcmovgt $RCOND,$RTRUE,$RDEST", [], s_fcmov>;
-def FCMOVLET : FPForm<0x17, 0x02E, "fcmovle $RCOND,$RTRUE,$RDEST", [], s_fcmov>;
-def FCMOVLTT : FPForm<0x17, 0x02C, "fcmovlt $RCOND,$RTRUE,$RDEST", [], s_fcmov>;
-def FCMOVNET : FPForm<0x17, 0x02B, "fcmovne $RCOND,$RTRUE,$RDEST", [], s_fcmov>;
-}
-
-//misc FP selects
-//Select double
-
-def : Pat<(select (seteq F8RC:$RA, F8RC:$RB), F8RC:$st, F8RC:$sf),
- (FCMOVNET F8RC:$sf, F8RC:$st, (CMPTEQ F8RC:$RA, F8RC:$RB))>;
-def : Pat<(select (setoeq F8RC:$RA, F8RC:$RB), F8RC:$st, F8RC:$sf),
- (FCMOVNET F8RC:$sf, F8RC:$st, (CMPTEQ F8RC:$RA, F8RC:$RB))>;
-def : Pat<(select (setueq F8RC:$RA, F8RC:$RB), F8RC:$st, F8RC:$sf),
- (FCMOVNET F8RC:$sf, F8RC:$st, (CMPTEQ F8RC:$RA, F8RC:$RB))>;
-
-def : Pat<(select (setne F8RC:$RA, F8RC:$RB), F8RC:$st, F8RC:$sf),
- (FCMOVEQT F8RC:$sf, F8RC:$st, (CMPTEQ F8RC:$RA, F8RC:$RB))>;
-def : Pat<(select (setone F8RC:$RA, F8RC:$RB), F8RC:$st, F8RC:$sf),
- (FCMOVEQT F8RC:$sf, F8RC:$st, (CMPTEQ F8RC:$RA, F8RC:$RB))>;
-def : Pat<(select (setune F8RC:$RA, F8RC:$RB), F8RC:$st, F8RC:$sf),
- (FCMOVEQT F8RC:$sf, F8RC:$st, (CMPTEQ F8RC:$RA, F8RC:$RB))>;
-
-def : Pat<(select (setgt F8RC:$RA, F8RC:$RB), F8RC:$st, F8RC:$sf),
- (FCMOVNET F8RC:$sf, F8RC:$st, (CMPTLT F8RC:$RB, F8RC:$RA))>;
-def : Pat<(select (setogt F8RC:$RA, F8RC:$RB), F8RC:$st, F8RC:$sf),
- (FCMOVNET F8RC:$sf, F8RC:$st, (CMPTLT F8RC:$RB, F8RC:$RA))>;
-def : Pat<(select (setugt F8RC:$RA, F8RC:$RB), F8RC:$st, F8RC:$sf),
- (FCMOVNET F8RC:$sf, F8RC:$st, (CMPTLT F8RC:$RB, F8RC:$RA))>;
-
-def : Pat<(select (setge F8RC:$RA, F8RC:$RB), F8RC:$st, F8RC:$sf),
- (FCMOVNET F8RC:$sf, F8RC:$st, (CMPTLE F8RC:$RB, F8RC:$RA))>;
-def : Pat<(select (setoge F8RC:$RA, F8RC:$RB), F8RC:$st, F8RC:$sf),
- (FCMOVNET F8RC:$sf, F8RC:$st, (CMPTLE F8RC:$RB, F8RC:$RA))>;
-def : Pat<(select (setuge F8RC:$RA, F8RC:$RB), F8RC:$st, F8RC:$sf),
- (FCMOVNET F8RC:$sf, F8RC:$st, (CMPTLE F8RC:$RB, F8RC:$RA))>;
-
-def : Pat<(select (setlt F8RC:$RA, F8RC:$RB), F8RC:$st, F8RC:$sf),
- (FCMOVNET F8RC:$sf, F8RC:$st, (CMPTLT F8RC:$RA, F8RC:$RB))>;
-def : Pat<(select (setolt F8RC:$RA, F8RC:$RB), F8RC:$st, F8RC:$sf),
- (FCMOVNET F8RC:$sf, F8RC:$st, (CMPTLT F8RC:$RA, F8RC:$RB))>;
-def : Pat<(select (setult F8RC:$RA, F8RC:$RB), F8RC:$st, F8RC:$sf),
- (FCMOVNET F8RC:$sf, F8RC:$st, (CMPTLT F8RC:$RA, F8RC:$RB))>;
-
-def : Pat<(select (setle F8RC:$RA, F8RC:$RB), F8RC:$st, F8RC:$sf),
- (FCMOVNET F8RC:$sf, F8RC:$st, (CMPTLE F8RC:$RA, F8RC:$RB))>;
-def : Pat<(select (setole F8RC:$RA, F8RC:$RB), F8RC:$st, F8RC:$sf),
- (FCMOVNET F8RC:$sf, F8RC:$st, (CMPTLE F8RC:$RA, F8RC:$RB))>;
-def : Pat<(select (setule F8RC:$RA, F8RC:$RB), F8RC:$st, F8RC:$sf),
- (FCMOVNET F8RC:$sf, F8RC:$st, (CMPTLE F8RC:$RA, F8RC:$RB))>;
-
-//Select single
-def : Pat<(select (seteq F8RC:$RA, F8RC:$RB), F4RC:$st, F4RC:$sf),
- (FCMOVNES F4RC:$sf, F4RC:$st, (CMPTEQ F8RC:$RA, F8RC:$RB))>;
-def : Pat<(select (setoeq F8RC:$RA, F8RC:$RB), F4RC:$st, F4RC:$sf),
- (FCMOVNES F4RC:$sf, F4RC:$st, (CMPTEQ F8RC:$RA, F8RC:$RB))>;
-def : Pat<(select (setueq F8RC:$RA, F8RC:$RB), F4RC:$st, F4RC:$sf),
- (FCMOVNES F4RC:$sf, F4RC:$st, (CMPTEQ F8RC:$RA, F8RC:$RB))>;
-
-def : Pat<(select (setne F8RC:$RA, F8RC:$RB), F4RC:$st, F4RC:$sf),
- (FCMOVEQS F4RC:$sf, F4RC:$st, (CMPTEQ F8RC:$RA, F8RC:$RB))>;
-def : Pat<(select (setone F8RC:$RA, F8RC:$RB), F4RC:$st, F4RC:$sf),
- (FCMOVEQS F4RC:$sf, F4RC:$st, (CMPTEQ F8RC:$RA, F8RC:$RB))>;
-def : Pat<(select (setune F8RC:$RA, F8RC:$RB), F4RC:$st, F4RC:$sf),
- (FCMOVEQS F4RC:$sf, F4RC:$st, (CMPTEQ F8RC:$RA, F8RC:$RB))>;
-
-def : Pat<(select (setgt F8RC:$RA, F8RC:$RB), F4RC:$st, F4RC:$sf),
- (FCMOVNES F4RC:$sf, F4RC:$st, (CMPTLT F8RC:$RB, F8RC:$RA))>;
-def : Pat<(select (setogt F8RC:$RA, F8RC:$RB), F4RC:$st, F4RC:$sf),
- (FCMOVNES F4RC:$sf, F4RC:$st, (CMPTLT F8RC:$RB, F8RC:$RA))>;
-def : Pat<(select (setugt F8RC:$RA, F8RC:$RB), F4RC:$st, F4RC:$sf),
- (FCMOVNES F4RC:$sf, F4RC:$st, (CMPTLT F8RC:$RB, F8RC:$RA))>;
-
-def : Pat<(select (setge F8RC:$RA, F8RC:$RB), F4RC:$st, F4RC:$sf),
- (FCMOVNES F4RC:$sf, F4RC:$st, (CMPTLE F8RC:$RB, F8RC:$RA))>;
-def : Pat<(select (setoge F8RC:$RA, F8RC:$RB), F4RC:$st, F4RC:$sf),
- (FCMOVNES F4RC:$sf, F4RC:$st, (CMPTLE F8RC:$RB, F8RC:$RA))>;
-def : Pat<(select (setuge F8RC:$RA, F8RC:$RB), F4RC:$st, F4RC:$sf),
- (FCMOVNES F4RC:$sf, F4RC:$st, (CMPTLE F8RC:$RB, F8RC:$RA))>;
-
-def : Pat<(select (setlt F8RC:$RA, F8RC:$RB), F4RC:$st, F4RC:$sf),
- (FCMOVNES F4RC:$sf, F4RC:$st, (CMPTLT F8RC:$RA, F8RC:$RB))>;
-def : Pat<(select (setolt F8RC:$RA, F8RC:$RB), F4RC:$st, F4RC:$sf),
- (FCMOVNES F4RC:$sf, F4RC:$st, (CMPTLT F8RC:$RA, F8RC:$RB))>;
-def : Pat<(select (setult F8RC:$RA, F8RC:$RB), F4RC:$st, F4RC:$sf),
- (FCMOVNES F4RC:$sf, F4RC:$st, (CMPTLT F8RC:$RA, F8RC:$RB))>;
-
-def : Pat<(select (setle F8RC:$RA, F8RC:$RB), F4RC:$st, F4RC:$sf),
- (FCMOVNES F4RC:$sf, F4RC:$st, (CMPTLE F8RC:$RA, F8RC:$RB))>;
-def : Pat<(select (setole F8RC:$RA, F8RC:$RB), F4RC:$st, F4RC:$sf),
- (FCMOVNES F4RC:$sf, F4RC:$st, (CMPTLE F8RC:$RA, F8RC:$RB))>;
-def : Pat<(select (setule F8RC:$RA, F8RC:$RB), F4RC:$st, F4RC:$sf),
- (FCMOVNES F4RC:$sf, F4RC:$st, (CMPTLE F8RC:$RA, F8RC:$RB))>;
-
-
-
-let OutOperandList = (ops GPRC:$RC), InOperandList = (ops F4RC:$RA), Fb = 31 in
-def FTOIS : FPForm<0x1C, 0x078, "ftois $RA,$RC",[], s_ftoi>; //Floating to integer move, S_floating
-let OutOperandList = (ops GPRC:$RC), InOperandList = (ops F8RC:$RA), Fb = 31 in
-def FTOIT : FPForm<0x1C, 0x070, "ftoit $RA,$RC",
- [(set GPRC:$RC, (bitconvert F8RC:$RA))], s_ftoi>; //Floating to integer move
-let OutOperandList = (ops F4RC:$RC), InOperandList = (ops GPRC:$RA), Fb = 31 in
-def ITOFS : FPForm<0x14, 0x004, "itofs $RA,$RC",[], s_itof>; //Integer to floating move, S_floating
-let OutOperandList = (ops F8RC:$RC), InOperandList = (ops GPRC:$RA), Fb = 31 in
-def ITOFT : FPForm<0x14, 0x024, "itoft $RA,$RC",
- [(set F8RC:$RC, (bitconvert GPRC:$RA))], s_itof>; //Integer to floating move
-
-
-let OutOperandList = (ops F4RC:$RC), InOperandList = (ops F8RC:$RB), Fa = 31 in
-def CVTQS : FPForm<0x16, 0x7BC, "cvtqs/sui $RB,$RC",
- [(set F4RC:$RC, (Alpha_cvtqs F8RC:$RB))], s_fadd>;
-let OutOperandList = (ops F8RC:$RC), InOperandList = (ops F8RC:$RB), Fa = 31 in
-def CVTQT : FPForm<0x16, 0x7BE, "cvtqt/sui $RB,$RC",
- [(set F8RC:$RC, (Alpha_cvtqt F8RC:$RB))], s_fadd>;
-let OutOperandList = (ops F8RC:$RC), InOperandList = (ops F8RC:$RB), Fa = 31 in
-def CVTTQ : FPForm<0x16, 0x52F, "cvttq/svc $RB,$RC",
- [(set F8RC:$RC, (Alpha_cvttq F8RC:$RB))], s_fadd>;
-let OutOperandList = (ops F8RC:$RC), InOperandList = (ops F4RC:$RB), Fa = 31 in
-def CVTST : FPForm<0x16, 0x6AC, "cvtst/s $RB,$RC",
- [(set F8RC:$RC, (fextend F4RC:$RB))], s_fadd>;
-let OutOperandList = (ops F4RC:$RC), InOperandList = (ops F8RC:$RB), Fa = 31 in
-def CVTTS : FPForm<0x16, 0x7AC, "cvtts/sui $RB,$RC",
- [(set F4RC:$RC, (fround F8RC:$RB))], s_fadd>;
-
-
-/////////////////////////////////////////////////////////
-//Branching
-/////////////////////////////////////////////////////////
-class br_icc<bits<6> opc, string asmstr>
- : BFormN<opc, (ops u64imm:$opc, GPRC:$R, target:$dst),
- !strconcat(asmstr, " $R,$dst"), s_icbr>;
-class br_fcc<bits<6> opc, string asmstr>
- : BFormN<opc, (ops u64imm:$opc, F8RC:$R, target:$dst),
- !strconcat(asmstr, " $R,$dst"), s_fbr>;
-
-let isBranch = 1, isTerminator = 1, hasCtrlDep = 1 in {
-let Ra = 31 in
-def BR : BFormD<0x30, "br $$31,$DISP", [(br bb:$DISP)], s_ubr>;
-
-def COND_BRANCH_I : BFormN<0, (ops u64imm:$opc, GPRC:$R, target:$dst),
- "{:comment} COND_BRANCH imm:$opc, GPRC:$R, bb:$dst",
- s_icbr>;
-def COND_BRANCH_F : BFormN<0, (ops u64imm:$opc, F8RC:$R, target:$dst),
- "{:comment} COND_BRANCH imm:$opc, F8RC:$R, bb:$dst",
- s_fbr>;
-//Branches, int
-def BEQ : br_icc<0x39, "beq">;
-def BGE : br_icc<0x3E, "bge">;
-def BGT : br_icc<0x3F, "bgt">;
-def BLBC : br_icc<0x38, "blbc">;
-def BLBS : br_icc<0x3C, "blbs">;
-def BLE : br_icc<0x3B, "ble">;
-def BLT : br_icc<0x3A, "blt">;
-def BNE : br_icc<0x3D, "bne">;
-
-//Branches, float
-def FBEQ : br_fcc<0x31, "fbeq">;
-def FBGE : br_fcc<0x36, "fbge">;
-def FBGT : br_fcc<0x37, "fbgt">;
-def FBLE : br_fcc<0x33, "fble">;
-def FBLT : br_fcc<0x32, "fblt">;
-def FBNE : br_fcc<0x36, "fbne">;
-}
-
-//An ugly trick to get the opcode as an imm I can use
-def immBRCond : SDNodeXForm<imm, [{
- switch((uint64_t)N->getValue()) {
- case 0: return getI64Imm(Alpha::BEQ);
- case 1: return getI64Imm(Alpha::BNE);
- case 2: return getI64Imm(Alpha::BGE);
- case 3: return getI64Imm(Alpha::BGT);
- case 4: return getI64Imm(Alpha::BLE);
- case 5: return getI64Imm(Alpha::BLT);
- case 6: return getI64Imm(Alpha::BLBS);
- case 7: return getI64Imm(Alpha::BLBC);
- case 20: return getI64Imm(Alpha::FBEQ);
- case 21: return getI64Imm(Alpha::FBNE);
- case 22: return getI64Imm(Alpha::FBGE);
- case 23: return getI64Imm(Alpha::FBGT);
- case 24: return getI64Imm(Alpha::FBLE);
- case 25: return getI64Imm(Alpha::FBLT);
- default: assert(0 && "Unknown branch type");
- }
-}]>;
-
-//Int cond patterns
-def : Pat<(brcond (seteq GPRC:$RA, 0), bb:$DISP),
- (COND_BRANCH_I (immBRCond 0), GPRC:$RA, bb:$DISP)>;
-def : Pat<(brcond (setge GPRC:$RA, 0), bb:$DISP),
- (COND_BRANCH_I (immBRCond 2), GPRC:$RA, bb:$DISP)>;
-def : Pat<(brcond (setgt GPRC:$RA, 0), bb:$DISP),
- (COND_BRANCH_I (immBRCond 3), GPRC:$RA, bb:$DISP)>;
-def : Pat<(brcond (and GPRC:$RA, 1), bb:$DISP),
- (COND_BRANCH_I (immBRCond 6), GPRC:$RA, bb:$DISP)>;
-def : Pat<(brcond (setle GPRC:$RA, 0), bb:$DISP),
- (COND_BRANCH_I (immBRCond 4), GPRC:$RA, bb:$DISP)>;
-def : Pat<(brcond (setlt GPRC:$RA, 0), bb:$DISP),
- (COND_BRANCH_I (immBRCond 5), GPRC:$RA, bb:$DISP)>;
-def : Pat<(brcond (setne GPRC:$RA, 0), bb:$DISP),
- (COND_BRANCH_I (immBRCond 1), GPRC:$RA, bb:$DISP)>;
-
-def : Pat<(brcond GPRC:$RA, bb:$DISP),
- (COND_BRANCH_I (immBRCond 1), GPRC:$RA, bb:$DISP)>;
-def : Pat<(brcond (setne GPRC:$RA, GPRC:$RB), bb:$DISP),
- (COND_BRANCH_I (immBRCond 0), (CMPEQ GPRC:$RA, GPRC:$RB), bb:$DISP)>;
-def : Pat<(brcond (setne GPRC:$RA, immUExt8:$L), bb:$DISP),
- (COND_BRANCH_I (immBRCond 0), (CMPEQi GPRC:$RA, immUExt8:$L), bb:$DISP)>;
-
-//FP cond patterns
-def : Pat<(brcond (seteq F8RC:$RA, immFPZ), bb:$DISP),
- (COND_BRANCH_F (immBRCond 20), F8RC:$RA, bb:$DISP)>;
-def : Pat<(brcond (setne F8RC:$RA, immFPZ), bb:$DISP),
- (COND_BRANCH_F (immBRCond 21), F8RC:$RA, bb:$DISP)>;
-def : Pat<(brcond (setge F8RC:$RA, immFPZ), bb:$DISP),
- (COND_BRANCH_F (immBRCond 22), F8RC:$RA, bb:$DISP)>;
-def : Pat<(brcond (setgt F8RC:$RA, immFPZ), bb:$DISP),
- (COND_BRANCH_F (immBRCond 23), F8RC:$RA, bb:$DISP)>;
-def : Pat<(brcond (setle F8RC:$RA, immFPZ), bb:$DISP),
- (COND_BRANCH_F (immBRCond 24), F8RC:$RA, bb:$DISP)>;
-def : Pat<(brcond (setlt F8RC:$RA, immFPZ), bb:$DISP),
- (COND_BRANCH_F (immBRCond 25), F8RC:$RA, bb:$DISP)>;
-
-
-def : Pat<(brcond (seteq F8RC:$RA, F8RC:$RB), bb:$DISP),
- (COND_BRANCH_F (immBRCond 21), (CMPTEQ F8RC:$RA, F8RC:$RB), bb:$DISP)>;
-def : Pat<(brcond (setoeq F8RC:$RA, F8RC:$RB), bb:$DISP),
- (COND_BRANCH_F (immBRCond 21), (CMPTEQ F8RC:$RA, F8RC:$RB), bb:$DISP)>;
-def : Pat<(brcond (setueq F8RC:$RA, F8RC:$RB), bb:$DISP),
- (COND_BRANCH_F (immBRCond 21), (CMPTEQ F8RC:$RA, F8RC:$RB), bb:$DISP)>;
-
-def : Pat<(brcond (setlt F8RC:$RA, F8RC:$RB), bb:$DISP),
- (COND_BRANCH_F (immBRCond 21), (CMPTLT F8RC:$RA, F8RC:$RB), bb:$DISP)>;
-def : Pat<(brcond (setolt F8RC:$RA, F8RC:$RB), bb:$DISP),
- (COND_BRANCH_F (immBRCond 21), (CMPTLT F8RC:$RA, F8RC:$RB), bb:$DISP)>;
-def : Pat<(brcond (setult F8RC:$RA, F8RC:$RB), bb:$DISP),
- (COND_BRANCH_F (immBRCond 21), (CMPTLT F8RC:$RA, F8RC:$RB), bb:$DISP)>;
-
-def : Pat<(brcond (setle F8RC:$RA, F8RC:$RB), bb:$DISP),
- (COND_BRANCH_F (immBRCond 21), (CMPTLE F8RC:$RA, F8RC:$RB), bb:$DISP)>;
-def : Pat<(brcond (setole F8RC:$RA, F8RC:$RB), bb:$DISP),
- (COND_BRANCH_F (immBRCond 21), (CMPTLE F8RC:$RA, F8RC:$RB), bb:$DISP)>;
-def : Pat<(brcond (setule F8RC:$RA, F8RC:$RB), bb:$DISP),
- (COND_BRANCH_F (immBRCond 21), (CMPTLE F8RC:$RA, F8RC:$RB), bb:$DISP)>;
-
-def : Pat<(brcond (setgt F8RC:$RA, F8RC:$RB), bb:$DISP),
- (COND_BRANCH_F (immBRCond 21), (CMPTLT F8RC:$RB, F8RC:$RA), bb:$DISP)>;
-def : Pat<(brcond (setogt F8RC:$RA, F8RC:$RB), bb:$DISP),
- (COND_BRANCH_F (immBRCond 21), (CMPTLT F8RC:$RB, F8RC:$RA), bb:$DISP)>;
-def : Pat<(brcond (setugt F8RC:$RA, F8RC:$RB), bb:$DISP),
- (COND_BRANCH_F (immBRCond 21), (CMPTLT F8RC:$RB, F8RC:$RA), bb:$DISP)>;
-
-def : Pat<(brcond (setge F8RC:$RA, F8RC:$RB), bb:$DISP),
- (COND_BRANCH_F (immBRCond 21), (CMPTLE F8RC:$RB, F8RC:$RA), bb:$DISP)>;
-def : Pat<(brcond (setoge F8RC:$RA, F8RC:$RB), bb:$DISP),
- (COND_BRANCH_F (immBRCond 21), (CMPTLE F8RC:$RB, F8RC:$RA), bb:$DISP)>;
-def : Pat<(brcond (setuge F8RC:$RA, F8RC:$RB), bb:$DISP),
- (COND_BRANCH_F (immBRCond 21), (CMPTLE F8RC:$RB, F8RC:$RA), bb:$DISP)>;
-
-def : Pat<(brcond (setne F8RC:$RA, F8RC:$RB), bb:$DISP),
- (COND_BRANCH_F (immBRCond 20), (CMPTEQ F8RC:$RA, F8RC:$RB), bb:$DISP)>;
-def : Pat<(brcond (setone F8RC:$RA, F8RC:$RB), bb:$DISP),
- (COND_BRANCH_F (immBRCond 20), (CMPTEQ F8RC:$RA, F8RC:$RB), bb:$DISP)>;
-def : Pat<(brcond (setune F8RC:$RA, F8RC:$RB), bb:$DISP),
- (COND_BRANCH_F (immBRCond 20), (CMPTEQ F8RC:$RA, F8RC:$RB), bb:$DISP)>;
-
-
-def : Pat<(brcond (setoeq F8RC:$RA, immFPZ), bb:$DISP),
- (COND_BRANCH_F (immBRCond 20), F8RC:$RA,bb:$DISP)>;
-def : Pat<(brcond (setueq F8RC:$RA, immFPZ), bb:$DISP),
- (COND_BRANCH_F (immBRCond 20), F8RC:$RA,bb:$DISP)>;
-
-def : Pat<(brcond (setoge F8RC:$RA, immFPZ), bb:$DISP),
- (COND_BRANCH_F (immBRCond 22), F8RC:$RA,bb:$DISP)>;
-def : Pat<(brcond (setuge F8RC:$RA, immFPZ), bb:$DISP),
- (COND_BRANCH_F (immBRCond 22), F8RC:$RA,bb:$DISP)>;
-
-def : Pat<(brcond (setogt F8RC:$RA, immFPZ), bb:$DISP),
- (COND_BRANCH_F (immBRCond 23), F8RC:$RA,bb:$DISP)>;
-def : Pat<(brcond (setugt F8RC:$RA, immFPZ), bb:$DISP),
- (COND_BRANCH_F (immBRCond 23), F8RC:$RA,bb:$DISP)>;
-
-def : Pat<(brcond (setole F8RC:$RA, immFPZ), bb:$DISP),
- (COND_BRANCH_F (immBRCond 24), F8RC:$RA,bb:$DISP)>;
-def : Pat<(brcond (setule F8RC:$RA, immFPZ), bb:$DISP),
- (COND_BRANCH_F (immBRCond 24), F8RC:$RA,bb:$DISP)>;
-
-def : Pat<(brcond (setolt F8RC:$RA, immFPZ), bb:$DISP),
- (COND_BRANCH_F (immBRCond 25), F8RC:$RA,bb:$DISP)>;
-def : Pat<(brcond (setult F8RC:$RA, immFPZ), bb:$DISP),
- (COND_BRANCH_F (immBRCond 25), F8RC:$RA,bb:$DISP)>;
-
-def : Pat<(brcond (setone F8RC:$RA, immFPZ), bb:$DISP),
- (COND_BRANCH_F (immBRCond 21), F8RC:$RA,bb:$DISP)>;
-def : Pat<(brcond (setune F8RC:$RA, immFPZ), bb:$DISP),
- (COND_BRANCH_F (immBRCond 21), F8RC:$RA,bb:$DISP)>;
-
-//End Branches
-
-//S_floating : IEEE Single
-//T_floating : IEEE Double
-
-//Unused instructions
-//Mnemonic Format Opcode Description
-//CALL_PAL Pcd 00 Trap to PALcode
-//ECB Mfc 18.E800 Evict cache block
-//EXCB Mfc 18.0400 Exception barrier
-//FETCH Mfc 18.8000 Prefetch data
-//FETCH_M Mfc 18.A000 Prefetch data, modify intent
-//LDQ_U Mem 0B Load unaligned quadword
-//MB Mfc 18.4000 Memory barrier
-//STQ_U Mem 0F Store unaligned quadword
-//TRAPB Mfc 18.0000 Trap barrier
-//WH64 Mfc 18.F800 Write hint  64 bytes
-//WMB Mfc 18.4400 Write memory barrier
-//MF_FPCR F-P 17.025 Move from FPCR
-//MT_FPCR F-P 17.024 Move to FPCR
-//There are in the Multimedia extentions, so let's not use them yet
-//def MAXSB8 : OForm<0x1C, 0x3E, "MAXSB8 $RA,$RB,$RC">; //Vector signed byte maximum
-//def MAXSW4 : OForm< 0x1C, 0x3F, "MAXSW4 $RA,$RB,$RC">; //Vector signed word maximum
-//def MAXUB8 : OForm<0x1C, 0x3C, "MAXUB8 $RA,$RB,$RC">; //Vector unsigned byte maximum
-//def MAXUW4 : OForm< 0x1C, 0x3D, "MAXUW4 $RA,$RB,$RC">; //Vector unsigned word maximum
-//def MINSB8 : OForm< 0x1C, 0x38, "MINSB8 $RA,$RB,$RC">; //Vector signed byte minimum
-//def MINSW4 : OForm< 0x1C, 0x39, "MINSW4 $RA,$RB,$RC">; //Vector signed word minimum
-//def MINUB8 : OForm< 0x1C, 0x3A, "MINUB8 $RA,$RB,$RC">; //Vector unsigned byte minimum
-//def MINUW4 : OForm< 0x1C, 0x3B, "MINUW4 $RA,$RB,$RC">; //Vector unsigned word minimum
-//def PERR : OForm< 0x1C, 0x31, "PERR $RA,$RB,$RC">; //Pixel error
-//def PKLB : OForm< 0x1C, 0x37, "PKLB $RA,$RB,$RC">; //Pack longwords to bytes
-//def PKWB : OForm<0x1C, 0x36, "PKWB $RA,$RB,$RC">; //Pack words to bytes
-//def UNPKBL : OForm< 0x1C, 0x35, "UNPKBL $RA,$RB,$RC">; //Unpack bytes to longwords
-//def UNPKBW : OForm< 0x1C, 0x34, "UNPKBW $RA,$RB,$RC">; //Unpack bytes to words
-//CVTLQ F-P 17.010 Convert longword to quadword
-//CVTQL F-P 17.030 Convert quadword to longword
-
-
-//Constant handling
-
-def immConst2Part : PatLeaf<(imm), [{
- //true if imm fits in a LDAH LDA pair
- int64_t val = (int64_t)N->getValue();
- return (val <= IMM_FULLHIGH && val >= IMM_FULLLOW);
-}]>;
-def immConst2PartInt : PatLeaf<(imm), [{
- //true if imm fits in a LDAH LDA pair with zeroext
- uint64_t uval = N->getValue();
- int32_t val32 = (int32_t)uval;
- return ((uval >> 32) == 0 && //empty upper bits
- val32 <= IMM_FULLHIGH);
-// val32 >= IMM_FULLLOW + IMM_LOW * IMM_MULT); //Always True
-}], SExt32>;
-
-def : Pat<(i64 immConst2Part:$imm),
- (LDA (LL16 immConst2Part:$imm), (LDAH (LH16 immConst2Part:$imm), R31))>;
-
-def : Pat<(i64 immSExt16:$imm),
- (LDA immSExt16:$imm, R31)>;
-
-def : Pat<(i64 immSExt16int:$imm),
- (ZAPNOTi (LDA (SExt16 immSExt16int:$imm), R31), 15)>;
-def : Pat<(i64 immConst2PartInt:$imm),
- (ZAPNOTi (LDA (LL16 (SExt32 immConst2PartInt:$imm)),
- (LDAH (LH16 (SExt32 immConst2PartInt:$imm)), R31)), 15)>;
-
-
-//TODO: I want to just define these like this!
-//def : Pat<(i64 0),
-// (R31)>;
-//def : Pat<(f64 0.0),
-// (F31)>;
-//def : Pat<(f64 -0.0),
-// (CPYSNT F31, F31)>;
-//def : Pat<(f32 0.0),
-// (F31)>;
-//def : Pat<(f32 -0.0),
-// (CPYSNS F31, F31)>;
-
-//Misc Patterns:
-
-def : Pat<(sext_inreg GPRC:$RB, i32),
- (ADDLi GPRC:$RB, 0)>;
-
-def : Pat<(fabs F8RC:$RB),
- (CPYST F31, F8RC:$RB)>;
-def : Pat<(fabs F4RC:$RB),
- (CPYSS F31, F4RC:$RB)>;
-def : Pat<(fneg F8RC:$RB),
- (CPYSNT F8RC:$RB, F8RC:$RB)>;
-def : Pat<(fneg F4RC:$RB),
- (CPYSNS F4RC:$RB, F4RC:$RB)>;
-
-def : Pat<(fcopysign F4RC:$A, (fneg F4RC:$B)),
- (CPYSNS F4RC:$B, F4RC:$A)>;
-def : Pat<(fcopysign F8RC:$A, (fneg F8RC:$B)),
- (CPYSNT F8RC:$B, F8RC:$A)>;
-def : Pat<(fcopysign F4RC:$A, (fneg F8RC:$B)),
- (CPYSNSt F8RC:$B, F4RC:$A)>;
-def : Pat<(fcopysign F8RC:$A, (fneg F4RC:$B)),
- (CPYSNTs F4RC:$B, F8RC:$A)>;
-
-//Yes, signed multiply high is ugly
-def : Pat<(mulhs GPRC:$RA, GPRC:$RB),
- (SUBQr (UMULHr GPRC:$RA, GPRC:$RB), (ADDQr (CMOVGEr GPRC:$RB, R31, GPRC:$RA),
- (CMOVGEr GPRC:$RA, R31, GPRC:$RB)))>;
-
-//Stupid crazy arithmetic stuff:
-let AddedComplexity = 1 in {
-def : Pat<(mul GPRC:$RA, 5), (S4ADDQr GPRC:$RA, GPRC:$RA)>;
-def : Pat<(mul GPRC:$RA, 9), (S8ADDQr GPRC:$RA, GPRC:$RA)>;
-def : Pat<(mul GPRC:$RA, 3), (S4SUBQr GPRC:$RA, GPRC:$RA)>;
-def : Pat<(mul GPRC:$RA, 7), (S8SUBQr GPRC:$RA, GPRC:$RA)>;
-
-//slight tree expansion if we are multiplying near to a power of 2
-//n is above a power of 2
-def : Pat<(mul GPRC:$RA, immRem1:$imm),
- (ADDQr (SLr GPRC:$RA, (nearP2X immRem1:$imm)), GPRC:$RA)>;
-def : Pat<(mul GPRC:$RA, immRem2:$imm),
- (ADDQr (SLr GPRC:$RA, (nearP2X immRem2:$imm)), (ADDQr GPRC:$RA, GPRC:$RA))>;
-def : Pat<(mul GPRC:$RA, immRem3:$imm),
- (ADDQr (SLr GPRC:$RA, (nearP2X immRem3:$imm)), (S4SUBQr GPRC:$RA, GPRC:$RA))>;
-def : Pat<(mul GPRC:$RA, immRem4:$imm),
- (S4ADDQr GPRC:$RA, (SLr GPRC:$RA, (nearP2X immRem4:$imm)))>;
-def : Pat<(mul GPRC:$RA, immRem5:$imm),
- (ADDQr (SLr GPRC:$RA, (nearP2X immRem5:$imm)), (S4ADDQr GPRC:$RA, GPRC:$RA))>;
-def : Pat<(mul GPRC:$RA, immRemP2:$imm),
- (ADDQr (SLr GPRC:$RA, (nearP2X immRemP2:$imm)), (SLi GPRC:$RA, (nearP2RemX immRemP2:$imm)))>;
-
-//n is below a power of 2
-//FIXME: figure out why something is truncating the imm to 32bits
-// this will fix 2007-11-27-mulneg3
-//def : Pat<(mul GPRC:$RA, immRem1n:$imm),
-// (SUBQr (SLr GPRC:$RA, (nearP2X immRem1n:$imm)), GPRC:$RA)>;
-//def : Pat<(mul GPRC:$RA, immRem2n:$imm),
-// (SUBQr (SLr GPRC:$RA, (nearP2X immRem2n:$imm)), (ADDQr GPRC:$RA, GPRC:$RA))>;
-//def : Pat<(mul GPRC:$RA, immRem3n:$imm),
-// (SUBQr (SLr GPRC:$RA, (nearP2X immRem3n:$imm)), (S4SUBQr GPRC:$RA, GPRC:$RA))>;
-//def : Pat<(mul GPRC:$RA, immRem4n:$imm),
-// (SUBQr (SLr GPRC:$RA, (nearP2X immRem4n:$imm)), (SLi GPRC:$RA, 2))>;
-//def : Pat<(mul GPRC:$RA, immRem5n:$imm),
-// (SUBQr (SLr GPRC:$RA, (nearP2X immRem5n:$imm)), (S4ADDQr GPRC:$RA, GPRC:$RA))>;
-//def : Pat<(mul GPRC:$RA, immRemP2n:$imm),
-// (SUBQr (SLr GPRC:$RA, (nearP2X immRemP2n:$imm)), (SLi GPRC:$RA, (nearP2RemX immRemP2n:$imm)))>;
-} //Added complexity
diff --git a/release_23/lib/Target/Alpha/AlphaJITInfo.cpp b/release_23/lib/Target/Alpha/AlphaJITInfo.cpp
deleted file mode 100644
index 4fd0ebcaef84..000000000000
--- a/release_23/lib/Target/Alpha/AlphaJITInfo.cpp
+++ /dev/null
@@ -1,307 +0,0 @@
-//===-- AlphaJITInfo.cpp - Implement the JIT interfaces for the Alpha ---===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the JIT interfaces for the Alpha target.
-//
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "jit"
-#include "AlphaJITInfo.h"
-#include "AlphaRelocations.h"
-#include "llvm/Function.h"
-#include "llvm/CodeGen/MachineCodeEmitter.h"
-#include "llvm/Config/alloca.h"
-#include "llvm/Support/Debug.h"
-#include <cstdlib>
-#include <map>
-using namespace llvm;
-
-#define BUILD_OFormatI(Op, RA, LIT, FUN, RC) \
- ((Op << 26) | (RA << 21) | (LIT << 13) | (1 << 12) | (FUN << 5) | (RC))
-#define BUILD_OFormat(Op, RA, RB, FUN, RC) \
- ((Op << 26) | (RA << 21) | (RB << 16) | (FUN << 5) | (RC))
-
-#define BUILD_LDA(RD, RS, IMM16) \
- ((0x08 << 26) | ((RD) << 21) | ((RS) << 16) | ((IMM16) & 65535))
-#define BUILD_LDAH(RD, RS, IMM16) \
- ((0x09 << 26) | ((RD) << 21) | ((RS) << 16) | ((IMM16) & 65535))
-
-#define BUILD_LDQ(RD, RS, IMM16) \
- ((0x29 << 26) | ((RD) << 21) | ((RS) << 16) | ((IMM16) & 0xFFFF))
-
-#define BUILD_JMP(RD, RS, IMM16) \
- ((0x1A << 26) | ((RD) << 21) | ((RS) << 16) | (0x00 << 14) | ((IMM16) & 0x3FFF))
-#define BUILD_JSR(RD, RS, IMM16) \
- ((0x1A << 26) | ((RD) << 21) | ((RS) << 16) | (0x01 << 14) | ((IMM16) & 0x3FFF))
-
-#define BUILD_SLLi(RD, RS, IMM8) \
- (BUILD_OFormatI(0x12, RS, IMM8, 0x39, RD))
-
-#define BUILD_ORi(RD, RS, IMM8) \
- (BUILD_OFormatI(0x11, RS, IMM8, 0x20, RD))
-
-#define BUILD_OR(RD, RS, RT) \
- (BUILD_OFormat(0x11, RS, RT, 0x20, RD))
-
-
-
-static void EmitBranchToAt(void *At, void *To) {
- unsigned long Fn = (unsigned long)To;
-
- unsigned *AtI = (unsigned*)At;
-
- AtI[0] = BUILD_OR(0, 27, 27);
-
- DOUT << "Stub targeting " << To << "\n";
-
- for (int x = 1; x <= 8; ++x) {
- AtI[2*x - 1] = BUILD_SLLi(27,27,8);
- unsigned d = (Fn >> (64 - 8 * x)) & 0x00FF;
- //DOUT << "outputing " << hex << d << dec << "\n";
- AtI[2*x] = BUILD_ORi(27, 27, d);
- }
- AtI[17] = BUILD_JMP(31,27,0); //jump, preserving ra, and setting pv
- AtI[18] = 0x00FFFFFF; //mark this as a stub
-}
-
-void AlphaJITInfo::replaceMachineCodeForFunction(void *Old, void *New) {
- //FIXME
- assert(0);
-}
-
-static TargetJITInfo::JITCompilerFn JITCompilerFunction;
-//static AlphaJITInfo* AlphaJTI;
-
-extern "C" {
-#ifdef __alpha
-
- void AlphaCompilationCallbackC(long* oldpv, void* CameFromStub)
- {
- void* Target = JITCompilerFunction(CameFromStub);
-
- //rewrite the stub to an unconditional branch
- if (((unsigned*)CameFromStub)[18] == 0x00FFFFFF) {
- DOUT << "Came from a stub, rewriting\n";
- EmitBranchToAt(CameFromStub, Target);
- } else {
- DOUT << "confused, didn't come from stub at " << CameFromStub
- << " old jump vector " << oldpv
- << " new jump vector " << Target << "\n";
- }
-
- //Change pv to new Target
- *oldpv = (long)Target;
- }
-
- void AlphaCompilationCallback(void);
-
- asm(
- ".text\n"
- ".globl AlphaComilationCallbackC\n"
- ".align 4\n"
- ".globl AlphaCompilationCallback\n"
- ".ent AlphaCompilationCallback\n"
-"AlphaCompilationCallback:\n"
- // //get JIT's GOT
- "ldgp $29, 0($27)\n"
- //Save args, callee saved, and perhaps others?
- //args: $16-$21 $f16-$f21 (12)
- //callee: $9-$14 $f2-$f9 (14)
- //others: fp:$15 ra:$26 pv:$27 (3)
- "lda $30, -232($30)\n"
- "stq $16, 0($30)\n"
- "stq $17, 8($30)\n"
- "stq $18, 16($30)\n"
- "stq $19, 24($30)\n"
- "stq $20, 32($30)\n"
- "stq $21, 40($30)\n"
- "stt $f16, 48($30)\n"
- "stt $f17, 56($30)\n"
- "stt $f18, 64($30)\n"
- "stt $f19, 72($30)\n"
- "stt $f20, 80($30)\n"
- "stt $f21, 88($30)\n"
- "stq $9, 96($30)\n"
- "stq $10, 104($30)\n"
- "stq $11, 112($30)\n"
- "stq $12, 120($30)\n"
- "stq $13, 128($30)\n"
- "stq $14, 136($30)\n"
- "stt $f2, 144($30)\n"
- "stt $f3, 152($30)\n"
- "stt $f4, 160($30)\n"
- "stt $f5, 168($30)\n"
- "stt $f6, 176($30)\n"
- "stt $f7, 184($30)\n"
- "stt $f8, 192($30)\n"
- "stt $f9, 200($30)\n"
- "stq $15, 208($30)\n"
- "stq $26, 216($30)\n"
- "stq $27, 224($30)\n"
-
- "addq $30, 224, $16\n" //pass the addr of saved pv as the first arg
- "bis $0, $0, $17\n" //pass the roughly stub addr in second arg
- "jsr $26, AlphaCompilationCallbackC\n" //call without saving ra
-
- "ldq $16, 0($30)\n"
- "ldq $17, 8($30)\n"
- "ldq $18, 16($30)\n"
- "ldq $19, 24($30)\n"
- "ldq $20, 32($30)\n"
- "ldq $21, 40($30)\n"
- "ldt $f16, 48($30)\n"
- "ldt $f17, 56($30)\n"
- "ldt $f18, 64($30)\n"
- "ldt $f19, 72($30)\n"
- "ldt $f20, 80($30)\n"
- "ldt $f21, 88($30)\n"
- "ldq $9, 96($30)\n"
- "ldq $10, 104($30)\n"
- "ldq $11, 112($30)\n"
- "ldq $12, 120($30)\n"
- "ldq $13, 128($30)\n"
- "ldq $14, 136($30)\n"
- "ldt $f2, 144($30)\n"
- "ldt $f3, 152($30)\n"
- "ldt $f4, 160($30)\n"
- "ldt $f5, 168($30)\n"
- "ldt $f6, 176($30)\n"
- "ldt $f7, 184($30)\n"
- "ldt $f8, 192($30)\n"
- "ldt $f9, 200($30)\n"
- "ldq $15, 208($30)\n"
- "ldq $26, 216($30)\n"
- "ldq $27, 224($30)\n" //this was updated in the callback with the target
-
- "lda $30, 232($30)\n" //restore sp
- "jmp $31, ($27)\n" //jump to the new function
- ".end AlphaCompilationCallback\n"
- );
-#else
- void AlphaCompilationCallback() {
- cerr << "Cannot call AlphaCompilationCallback() on a non-Alpha arch!\n";
- abort();
- }
-#endif
-}
-
-void *AlphaJITInfo::emitFunctionStub(const Function* F, void *Fn,
- MachineCodeEmitter &MCE) {
- //assert(Fn == AlphaCompilationCallback && "Where are you going?\n");
- //Do things in a stupid slow way!
- MCE.startFunctionStub(F, 19*4);
- void* Addr = (void*)(intptr_t)MCE.getCurrentPCValue();
- for (int x = 0; x < 19; ++ x)
- MCE.emitWordLE(0);
- EmitBranchToAt(Addr, Fn);
- DOUT << "Emitting Stub to " << Fn << " at [" << Addr << "]\n";
- return MCE.finishFunctionStub(F);
-}
-
-TargetJITInfo::LazyResolverFn
-AlphaJITInfo::getLazyResolverFunction(JITCompilerFn F) {
- JITCompilerFunction = F;
- // setZerothGOTEntry((void*)AlphaCompilationCallback);
- return AlphaCompilationCallback;
-}
-
-//These describe LDAx
-static const int IMM_LOW = -32768;
-static const int IMM_HIGH = 32767;
-static const int IMM_MULT = 65536;
-
-static long getUpper16(long l)
-{
- long y = l / IMM_MULT;
- if (l % IMM_MULT > IMM_HIGH)
- ++y;
- if (l % IMM_MULT < IMM_LOW)
- --y;
- assert((short)y == y && "displacement out of range");
- return y;
-}
-
-static long getLower16(long l)
-{
- long h = getUpper16(l);
- long y = l - h * IMM_MULT;
- assert(y == (short)y && "Displacement out of range");
- return y;
-}
-
-void AlphaJITInfo::relocate(void *Function, MachineRelocation *MR,
- unsigned NumRelocs, unsigned char* GOTBase) {
- //because gpdist are paired and relative to the pc of the first inst,
- //we need to have some state
-
- static std::map<std::pair<void*, int>, void*> gpdistmap;
-
- for (unsigned i = 0; i != NumRelocs; ++i, ++MR) {
- unsigned *RelocPos = (unsigned*)Function + MR->getMachineCodeOffset()/4;
- long idx = 0;
- bool doCommon = true;
- switch ((Alpha::RelocationType)MR->getRelocationType()) {
- default: assert(0 && "Unknown relocation type!");
- case Alpha::reloc_literal:
- //This is a LDQl
- idx = MR->getGOTIndex();
- DOUT << "Literal relocation to slot " << idx;
- idx = (idx - GOToffset) * 8;
- DOUT << " offset " << idx << "\n";
- break;
- case Alpha::reloc_gprellow:
- idx = (unsigned char*)MR->getResultPointer() - &GOTBase[GOToffset * 8];
- idx = getLower16(idx);
- DOUT << "gprellow relocation offset " << idx << "\n";
- DOUT << " Pointer is " << (void*)MR->getResultPointer()
- << " GOT is " << (void*)&GOTBase[GOToffset * 8] << "\n";
- break;
- case Alpha::reloc_gprelhigh:
- idx = (unsigned char*)MR->getResultPointer() - &GOTBase[GOToffset * 8];
- idx = getUpper16(idx);
- DOUT << "gprelhigh relocation offset " << idx << "\n";
- DOUT << " Pointer is " << (void*)MR->getResultPointer()
- << " GOT is " << (void*)&GOTBase[GOToffset * 8] << "\n";
- break;
- case Alpha::reloc_gpdist:
- switch (*RelocPos >> 26) {
- case 0x09: //LDAH
- idx = &GOTBase[GOToffset * 8] - (unsigned char*)RelocPos;
- idx = getUpper16(idx);
- DOUT << "LDAH: " << idx << "\n";
- //add the relocation to the map
- gpdistmap[std::make_pair(Function, MR->getConstantVal())] = RelocPos;
- break;
- case 0x08: //LDA
- assert(gpdistmap[std::make_pair(Function, MR->getConstantVal())] &&
- "LDAg without seeing LDAHg");
- idx = &GOTBase[GOToffset * 8] -
- (unsigned char*)gpdistmap[std::make_pair(Function, MR->getConstantVal())];
- idx = getLower16(idx);
- DOUT << "LDA: " << idx << "\n";
- break;
- default:
- assert(0 && "Cannot handle gpdist yet");
- }
- break;
- case Alpha::reloc_bsr: {
- idx = (((unsigned char*)MR->getResultPointer() -
- (unsigned char*)RelocPos) >> 2) + 1; //skip first 2 inst of fun
- *RelocPos |= (idx & ((1 << 21)-1));
- doCommon = false;
- break;
- }
- }
- if (doCommon) {
- short x = (short)idx;
- assert(x == idx);
- *(short*)RelocPos = x;
- }
- }
-}
diff --git a/release_23/lib/Target/Alpha/AlphaJITInfo.h b/release_23/lib/Target/Alpha/AlphaJITInfo.h
deleted file mode 100644
index 7bf51d628d40..000000000000
--- a/release_23/lib/Target/Alpha/AlphaJITInfo.h
+++ /dev/null
@@ -1,50 +0,0 @@
-//===- AlphaJITInfo.h - Alpha impl. of the JIT interface ----*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains the Alpha implementation of the TargetJITInfo class.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef ALPHA_JITINFO_H
-#define ALPHA_JITINFO_H
-
-#include "llvm/Target/TargetJITInfo.h"
-#include "llvm/GlobalValue.h"
-#include <string>
-#include <map>
-
-namespace llvm {
- class TargetMachine;
-
- class AlphaJITInfo : public TargetJITInfo {
- protected:
- TargetMachine &TM;
- public:
- explicit AlphaJITInfo(TargetMachine &tm) : TM(tm)
- { useGOT = true; }
-
- virtual void *emitFunctionStub(const Function* F, void *Fn,
- MachineCodeEmitter &MCE);
- virtual LazyResolverFn getLazyResolverFunction(JITCompilerFn);
- virtual void relocate(void *Function, MachineRelocation *MR,
- unsigned NumRelocs, unsigned char* GOTBase);
-
- /// replaceMachineCodeForFunction - Make it so that calling the function
- /// whose machine code is at OLD turns into a call to NEW, perhaps by
- /// overwriting OLD with a branch to NEW. This is used for self-modifying
- /// code.
- ///
- virtual void replaceMachineCodeForFunction(void *Old, void *New);
- private:
- static const unsigned GOToffset = 4096;
-
- };
-}
-
-#endif
diff --git a/release_23/lib/Target/Alpha/AlphaLLRP.cpp b/release_23/lib/Target/Alpha/AlphaLLRP.cpp
deleted file mode 100644
index f4dd199d3540..000000000000
--- a/release_23/lib/Target/Alpha/AlphaLLRP.cpp
+++ /dev/null
@@ -1,157 +0,0 @@
-//===-- AlphaLLRP.cpp - Alpha Load Load Replay Trap elimination pass. -- --===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// Here we check for potential replay traps introduced by the spiller
-// We also align some branch targets if we can do so for free.
-//
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "alpha-nops"
-#include "Alpha.h"
-#include "llvm/CodeGen/MachineFunctionPass.h"
-#include "llvm/CodeGen/MachineInstrBuilder.h"
-#include "llvm/Target/TargetMachine.h"
-#include "llvm/Target/TargetInstrInfo.h"
-#include "llvm/ADT/SetOperations.h"
-#include "llvm/ADT/Statistic.h"
-#include "llvm/Support/CommandLine.h"
-using namespace llvm;
-
-STATISTIC(nopintro, "Number of nops inserted");
-STATISTIC(nopalign, "Number of nops inserted for alignment");
-
-namespace {
- cl::opt<bool>
- AlignAll("alpha-align-all", cl::Hidden,
- cl::desc("Align all blocks"));
-
- struct AlphaLLRPPass : public MachineFunctionPass {
- /// Target machine description which we query for reg. names, data
- /// layout, etc.
- ///
- AlphaTargetMachine &TM;
-
- static char ID;
- AlphaLLRPPass(AlphaTargetMachine &tm)
- : MachineFunctionPass((intptr_t)&ID), TM(tm) { }
-
- virtual const char *getPassName() const {
- return "Alpha NOP inserter";
- }
-
- bool runOnMachineFunction(MachineFunction &F) {
- const TargetInstrInfo *TII = F.getTarget().getInstrInfo();
- bool Changed = false;
- MachineInstr* prev[3] = {0,0,0};
- unsigned count = 0;
- for (MachineFunction::iterator FI = F.begin(), FE = F.end();
- FI != FE; ++FI) {
- MachineBasicBlock& MBB = *FI;
- bool ub = false;
- for (MachineBasicBlock::iterator I = MBB.begin(); I != MBB.end(); ) {
- if (count%4 == 0)
- prev[0] = prev[1] = prev[2] = 0; //Slots cleared at fetch boundary
- ++count;
- MachineInstr *MI = I++;
- switch (MI->getOpcode()) {
- case Alpha::LDQ: case Alpha::LDL:
- case Alpha::LDWU: case Alpha::LDBU:
- case Alpha::LDT: case Alpha::LDS:
- case Alpha::STQ: case Alpha::STL:
- case Alpha::STW: case Alpha::STB:
- case Alpha::STT: case Alpha::STS:
- if (MI->getOperand(2).getReg() == Alpha::R30) {
- if (prev[0] &&
- prev[0]->getOperand(2).getReg() == MI->getOperand(2).getReg()&&
- prev[0]->getOperand(1).getImm() == MI->getOperand(1).getImm()){
- prev[0] = prev[1];
- prev[1] = prev[2];
- prev[2] = 0;
- BuildMI(MBB, MI, TII->get(Alpha::BISr), Alpha::R31)
- .addReg(Alpha::R31)
- .addReg(Alpha::R31);
- Changed = true; nopintro += 1;
- count += 1;
- } else if (prev[1]
- && prev[1]->getOperand(2).getReg() ==
- MI->getOperand(2).getReg()
- && prev[1]->getOperand(1).getImm() ==
- MI->getOperand(1).getImm()) {
- prev[0] = prev[2];
- prev[1] = prev[2] = 0;
- BuildMI(MBB, MI, TII->get(Alpha::BISr), Alpha::R31)
- .addReg(Alpha::R31)
- .addReg(Alpha::R31);
- BuildMI(MBB, MI, TII->get(Alpha::BISr), Alpha::R31)
- .addReg(Alpha::R31)
- .addReg(Alpha::R31);
- Changed = true; nopintro += 2;
- count += 2;
- } else if (prev[2]
- && prev[2]->getOperand(2).getReg() ==
- MI->getOperand(2).getReg()
- && prev[2]->getOperand(1).getImm() ==
- MI->getOperand(1).getImm()) {
- prev[0] = prev[1] = prev[2] = 0;
- BuildMI(MBB, MI, TII->get(Alpha::BISr), Alpha::R31).addReg(Alpha::R31)
- .addReg(Alpha::R31);
- BuildMI(MBB, MI, TII->get(Alpha::BISr), Alpha::R31).addReg(Alpha::R31)
- .addReg(Alpha::R31);
- BuildMI(MBB, MI, TII->get(Alpha::BISr), Alpha::R31).addReg(Alpha::R31)
- .addReg(Alpha::R31);
- Changed = true; nopintro += 3;
- count += 3;
- }
- prev[0] = prev[1];
- prev[1] = prev[2];
- prev[2] = MI;
- break;
- }
- prev[0] = prev[1];
- prev[1] = prev[2];
- prev[2] = 0;
- break;
- case Alpha::ALTENT:
- case Alpha::MEMLABEL:
- case Alpha::PCLABEL:
- --count;
- break;
- case Alpha::BR:
- case Alpha::JMP:
- ub = true;
- //fall through
- default:
- prev[0] = prev[1];
- prev[1] = prev[2];
- prev[2] = 0;
- break;
- }
- }
- if (ub || AlignAll) {
- //we can align stuff for free at this point
- while (count % 4) {
- BuildMI(MBB, MBB.end(), TII->get(Alpha::BISr), Alpha::R31)
- .addReg(Alpha::R31).addReg(Alpha::R31);
- ++count;
- ++nopalign;
- prev[0] = prev[1];
- prev[1] = prev[2];
- prev[2] = 0;
- }
- }
- }
- return Changed;
- }
- };
- char AlphaLLRPPass::ID = 0;
-} // end of anonymous namespace
-
-FunctionPass *llvm::createAlphaLLRPPass(AlphaTargetMachine &tm) {
- return new AlphaLLRPPass(tm);
-}
diff --git a/release_23/lib/Target/Alpha/AlphaRegisterInfo.cpp b/release_23/lib/Target/Alpha/AlphaRegisterInfo.cpp
deleted file mode 100644
index e0859b5f1ac7..000000000000
--- a/release_23/lib/Target/Alpha/AlphaRegisterInfo.cpp
+++ /dev/null
@@ -1,330 +0,0 @@
-//===- AlphaRegisterInfo.cpp - Alpha Register Information -------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains the Alpha implementation of the TargetRegisterInfo class.
-//
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "reginfo"
-#include "Alpha.h"
-#include "AlphaRegisterInfo.h"
-#include "llvm/Constants.h"
-#include "llvm/Type.h"
-#include "llvm/Function.h"
-#include "llvm/CodeGen/ValueTypes.h"
-#include "llvm/CodeGen/MachineInstrBuilder.h"
-#include "llvm/CodeGen/MachineFunction.h"
-#include "llvm/CodeGen/MachineFrameInfo.h"
-#include "llvm/CodeGen/MachineLocation.h"
-#include "llvm/Target/TargetFrameInfo.h"
-#include "llvm/Target/TargetMachine.h"
-#include "llvm/Target/TargetOptions.h"
-#include "llvm/Target/TargetInstrInfo.h"
-#include "llvm/Support/CommandLine.h"
-#include "llvm/Support/Debug.h"
-#include "llvm/ADT/BitVector.h"
-#include "llvm/ADT/STLExtras.h"
-#include <cstdlib>
-using namespace llvm;
-
-//These describe LDAx
-static const int IMM_LOW = -32768;
-static const int IMM_HIGH = 32767;
-static const int IMM_MULT = 65536;
-
-static long getUpper16(long l)
-{
- long y = l / IMM_MULT;
- if (l % IMM_MULT > IMM_HIGH)
- ++y;
- return y;
-}
-
-static long getLower16(long l)
-{
- long h = getUpper16(l);
- return l - h * IMM_MULT;
-}
-
-AlphaRegisterInfo::AlphaRegisterInfo(const TargetInstrInfo &tii)
- : AlphaGenRegisterInfo(Alpha::ADJUSTSTACKDOWN, Alpha::ADJUSTSTACKUP),
- TII(tii)
-{
-}
-
-const unsigned* AlphaRegisterInfo::getCalleeSavedRegs(const MachineFunction *MF)
- const {
- static const unsigned CalleeSavedRegs[] = {
- Alpha::R9, Alpha::R10,
- Alpha::R11, Alpha::R12,
- Alpha::R13, Alpha::R14,
- Alpha::F2, Alpha::F3,
- Alpha::F4, Alpha::F5,
- Alpha::F6, Alpha::F7,
- Alpha::F8, Alpha::F9, 0
- };
- return CalleeSavedRegs;
-}
-
-const TargetRegisterClass* const*
-AlphaRegisterInfo::getCalleeSavedRegClasses(const MachineFunction *MF) const {
- static const TargetRegisterClass * const CalleeSavedRegClasses[] = {
- &Alpha::GPRCRegClass, &Alpha::GPRCRegClass,
- &Alpha::GPRCRegClass, &Alpha::GPRCRegClass,
- &Alpha::GPRCRegClass, &Alpha::GPRCRegClass,
- &Alpha::F8RCRegClass, &Alpha::F8RCRegClass,
- &Alpha::F8RCRegClass, &Alpha::F8RCRegClass,
- &Alpha::F8RCRegClass, &Alpha::F8RCRegClass,
- &Alpha::F8RCRegClass, &Alpha::F8RCRegClass, 0
- };
- return CalleeSavedRegClasses;
-}
-
-BitVector AlphaRegisterInfo::getReservedRegs(const MachineFunction &MF) const {
- BitVector Reserved(getNumRegs());
- Reserved.set(Alpha::R15);
- Reserved.set(Alpha::R30);
- Reserved.set(Alpha::R31);
- return Reserved;
-}
-
-//===----------------------------------------------------------------------===//
-// Stack Frame Processing methods
-//===----------------------------------------------------------------------===//
-
-// hasFP - Return true if the specified function should have a dedicated frame
-// pointer register. This is true if the function has variable sized allocas or
-// if frame pointer elimination is disabled.
-//
-bool AlphaRegisterInfo::hasFP(const MachineFunction &MF) const {
- MachineFrameInfo *MFI = MF.getFrameInfo();
- return MFI->hasVarSizedObjects();
-}
-
-void AlphaRegisterInfo::
-eliminateCallFramePseudoInstr(MachineFunction &MF, MachineBasicBlock &MBB,
- MachineBasicBlock::iterator I) const {
- if (hasFP(MF)) {
- // If we have a frame pointer, turn the adjcallstackup instruction into a
- // 'sub ESP, <amt>' and the adjcallstackdown instruction into 'add ESP,
- // <amt>'
- MachineInstr *Old = I;
- uint64_t Amount = Old->getOperand(0).getImm();
- if (Amount != 0) {
- // We need to keep the stack aligned properly. To do this, we round the
- // amount of space needed for the outgoing arguments up to the next
- // alignment boundary.
- unsigned Align = MF.getTarget().getFrameInfo()->getStackAlignment();
- Amount = (Amount+Align-1)/Align*Align;
-
- MachineInstr *New;
- if (Old->getOpcode() == Alpha::ADJUSTSTACKDOWN) {
- New=BuildMI(TII.get(Alpha::LDA), Alpha::R30)
- .addImm(-Amount).addReg(Alpha::R30);
- } else {
- assert(Old->getOpcode() == Alpha::ADJUSTSTACKUP);
- New=BuildMI(TII.get(Alpha::LDA), Alpha::R30)
- .addImm(Amount).addReg(Alpha::R30);
- }
-
- // Replace the pseudo instruction with a new instruction...
- MBB.insert(I, New);
- }
- }
-
- MBB.erase(I);
-}
-
-//Alpha has a slightly funny stack:
-//Args
-//<- incoming SP
-//fixed locals (and spills, callee saved, etc)
-//<- FP
-//variable locals
-//<- SP
-
-void AlphaRegisterInfo::eliminateFrameIndex(MachineBasicBlock::iterator II,
- int SPAdj, RegScavenger *RS) const {
- assert(SPAdj == 0 && "Unexpected");
-
- unsigned i = 0;
- MachineInstr &MI = *II;
- MachineBasicBlock &MBB = *MI.getParent();
- MachineFunction &MF = *MBB.getParent();
- bool FP = hasFP(MF);
-
- while (!MI.getOperand(i).isFrameIndex()) {
- ++i;
- assert(i < MI.getNumOperands() && "Instr doesn't have FrameIndex operand!");
- }
-
- int FrameIndex = MI.getOperand(i).getIndex();
-
- // Add the base register of R30 (SP) or R15 (FP).
- MI.getOperand(i + 1).ChangeToRegister(FP ? Alpha::R15 : Alpha::R30, false);
-
- // Now add the frame object offset to the offset from the virtual frame index.
- int Offset = MF.getFrameInfo()->getObjectOffset(FrameIndex);
-
- DOUT << "FI: " << FrameIndex << " Offset: " << Offset << "\n";
-
- Offset += MF.getFrameInfo()->getStackSize();
-
- DOUT << "Corrected Offset " << Offset
- << " for stack size: " << MF.getFrameInfo()->getStackSize() << "\n";
-
- if (Offset > IMM_HIGH || Offset < IMM_LOW) {
- DOUT << "Unconditionally using R28 for evil purposes Offset: "
- << Offset << "\n";
- //so in this case, we need to use a temporary register, and move the
- //original inst off the SP/FP
- //fix up the old:
- MI.getOperand(i + 1).ChangeToRegister(Alpha::R28, false);
- MI.getOperand(i).ChangeToImmediate(getLower16(Offset));
- //insert the new
- MachineInstr* nMI=BuildMI(TII.get(Alpha::LDAH), Alpha::R28)
- .addImm(getUpper16(Offset)).addReg(FP ? Alpha::R15 : Alpha::R30);
- MBB.insert(II, nMI);
- } else {
- MI.getOperand(i).ChangeToImmediate(Offset);
- }
-}
-
-
-void AlphaRegisterInfo::emitPrologue(MachineFunction &MF) const {
- MachineBasicBlock &MBB = MF.front(); // Prolog goes in entry BB
- MachineBasicBlock::iterator MBBI = MBB.begin();
- MachineFrameInfo *MFI = MF.getFrameInfo();
- bool FP = hasFP(MF);
-
- static int curgpdist = 0;
-
- //handle GOP offset
- BuildMI(MBB, MBBI, TII.get(Alpha::LDAHg), Alpha::R29)
- .addGlobalAddress(const_cast<Function*>(MF.getFunction()))
- .addReg(Alpha::R27).addImm(++curgpdist);
- BuildMI(MBB, MBBI, TII.get(Alpha::LDAg), Alpha::R29)
- .addGlobalAddress(const_cast<Function*>(MF.getFunction()))
- .addReg(Alpha::R29).addImm(curgpdist);
-
- //evil const_cast until MO stuff setup to handle const
- BuildMI(MBB, MBBI, TII.get(Alpha::ALTENT))
- .addGlobalAddress(const_cast<Function*>(MF.getFunction()));
-
- // Get the number of bytes to allocate from the FrameInfo
- long NumBytes = MFI->getStackSize();
-
- if (FP)
- NumBytes += 8; //reserve space for the old FP
-
- // Do we need to allocate space on the stack?
- if (NumBytes == 0) return;
-
- unsigned Align = MF.getTarget().getFrameInfo()->getStackAlignment();
- NumBytes = (NumBytes+Align-1)/Align*Align;
-
- // Update frame info to pretend that this is part of the stack...
- MFI->setStackSize(NumBytes);
-
- // adjust stack pointer: r30 -= numbytes
- NumBytes = -NumBytes;
- if (NumBytes >= IMM_LOW) {
- BuildMI(MBB, MBBI, TII.get(Alpha::LDA), Alpha::R30).addImm(NumBytes)
- .addReg(Alpha::R30);
- } else if (getUpper16(NumBytes) >= IMM_LOW) {
- BuildMI(MBB, MBBI, TII.get(Alpha::LDAH), Alpha::R30).addImm(getUpper16(NumBytes))
- .addReg(Alpha::R30);
- BuildMI(MBB, MBBI, TII.get(Alpha::LDA), Alpha::R30).addImm(getLower16(NumBytes))
- .addReg(Alpha::R30);
- } else {
- cerr << "Too big a stack frame at " << NumBytes << "\n";
- abort();
- }
-
- //now if we need to, save the old FP and set the new
- if (FP)
- {
- BuildMI(MBB, MBBI, TII.get(Alpha::STQ))
- .addReg(Alpha::R15).addImm(0).addReg(Alpha::R30);
- //this must be the last instr in the prolog
- BuildMI(MBB, MBBI, TII.get(Alpha::BISr), Alpha::R15)
- .addReg(Alpha::R30).addReg(Alpha::R30);
- }
-
-}
-
-void AlphaRegisterInfo::emitEpilogue(MachineFunction &MF,
- MachineBasicBlock &MBB) const {
- const MachineFrameInfo *MFI = MF.getFrameInfo();
- MachineBasicBlock::iterator MBBI = prior(MBB.end());
- assert((MBBI->getOpcode() == Alpha::RETDAG ||
- MBBI->getOpcode() == Alpha::RETDAGp)
- && "Can only insert epilog into returning blocks");
-
- bool FP = hasFP(MF);
-
- // Get the number of bytes allocated from the FrameInfo...
- long NumBytes = MFI->getStackSize();
-
- //now if we need to, restore the old FP
- if (FP) {
- //copy the FP into the SP (discards allocas)
- BuildMI(MBB, MBBI, TII.get(Alpha::BISr), Alpha::R30).addReg(Alpha::R15)
- .addReg(Alpha::R15);
- //restore the FP
- BuildMI(MBB, MBBI, TII.get(Alpha::LDQ), Alpha::R15).addImm(0).addReg(Alpha::R15);
- }
-
- if (NumBytes != 0) {
- if (NumBytes <= IMM_HIGH) {
- BuildMI(MBB, MBBI, TII.get(Alpha::LDA), Alpha::R30).addImm(NumBytes)
- .addReg(Alpha::R30);
- } else if (getUpper16(NumBytes) <= IMM_HIGH) {
- BuildMI(MBB, MBBI, TII.get(Alpha::LDAH), Alpha::R30)
- .addImm(getUpper16(NumBytes)).addReg(Alpha::R30);
- BuildMI(MBB, MBBI, TII.get(Alpha::LDA), Alpha::R30)
- .addImm(getLower16(NumBytes)).addReg(Alpha::R30);
- } else {
- cerr << "Too big a stack frame at " << NumBytes << "\n";
- abort();
- }
- }
-}
-
-unsigned AlphaRegisterInfo::getRARegister() const {
- assert(0 && "What is the return address register");
- return 0;
-}
-
-unsigned AlphaRegisterInfo::getFrameRegister(MachineFunction &MF) const {
- return hasFP(MF) ? Alpha::R15 : Alpha::R30;
-}
-
-unsigned AlphaRegisterInfo::getEHExceptionRegister() const {
- assert(0 && "What is the exception register");
- return 0;
-}
-
-unsigned AlphaRegisterInfo::getEHHandlerRegister() const {
- assert(0 && "What is the exception handler register");
- return 0;
-}
-
-int AlphaRegisterInfo::getDwarfRegNum(unsigned RegNum, bool isEH) const {
- assert(0 && "What is the dwarf register number");
- return -1;
-}
-
-#include "AlphaGenRegisterInfo.inc"
-
-std::string AlphaRegisterInfo::getPrettyName(unsigned reg)
-{
- std::string s(RegisterDescriptors[reg].Name);
- return s;
-}
diff --git a/release_23/lib/Target/Alpha/AlphaRegisterInfo.h b/release_23/lib/Target/Alpha/AlphaRegisterInfo.h
deleted file mode 100644
index c4f5f7b421dd..000000000000
--- a/release_23/lib/Target/Alpha/AlphaRegisterInfo.h
+++ /dev/null
@@ -1,67 +0,0 @@
-//===- AlphaRegisterInfo.h - Alpha Register Information Impl ----*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains the Alpha implementation of the TargetRegisterInfo class.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef ALPHAREGISTERINFO_H
-#define ALPHAREGISTERINFO_H
-
-#include "llvm/Target/TargetRegisterInfo.h"
-#include "AlphaGenRegisterInfo.h.inc"
-
-namespace llvm {
-
-class TargetInstrInfo;
-class Type;
-
-struct AlphaRegisterInfo : public AlphaGenRegisterInfo {
- const TargetInstrInfo &TII;
-
- AlphaRegisterInfo(const TargetInstrInfo &tii);
-
- /// Code Generation virtual methods...
- const unsigned *getCalleeSavedRegs(const MachineFunction *MF = 0) const;
-
- const TargetRegisterClass* const* getCalleeSavedRegClasses(
- const MachineFunction *MF = 0) const;
-
- BitVector getReservedRegs(const MachineFunction &MF) const;
-
- bool hasFP(const MachineFunction &MF) const;
-
- void eliminateCallFramePseudoInstr(MachineFunction &MF,
- MachineBasicBlock &MBB,
- MachineBasicBlock::iterator I) const;
-
- void eliminateFrameIndex(MachineBasicBlock::iterator II,
- int SPAdj, RegScavenger *RS = NULL) const;
-
- //void processFunctionBeforeFrameFinalized(MachineFunction &MF) const;
-
- void emitPrologue(MachineFunction &MF) const;
- void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const;
-
- // Debug information queries.
- unsigned getRARegister() const;
- unsigned getFrameRegister(MachineFunction &MF) const;
-
- // Exception handling queries.
- unsigned getEHExceptionRegister() const;
- unsigned getEHHandlerRegister() const;
-
- int getDwarfRegNum(unsigned RegNum, bool isEH) const;
-
- static std::string getPrettyName(unsigned reg);
-};
-
-} // end namespace llvm
-
-#endif
diff --git a/release_23/lib/Target/Alpha/AlphaRegisterInfo.td b/release_23/lib/Target/Alpha/AlphaRegisterInfo.td
deleted file mode 100644
index 35e6804ea6ac..000000000000
--- a/release_23/lib/Target/Alpha/AlphaRegisterInfo.td
+++ /dev/null
@@ -1,171 +0,0 @@
-//===- AlphaRegisterInfo.td - The Alpha Register File ------*- tablegen -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file describes the Alpha register set.
-//
-//===----------------------------------------------------------------------===//
-
-class AlphaReg<string n> : Register<n> {
- field bits<5> Num;
- let Namespace = "Alpha";
-}
-
-// We identify all our registers with a 5-bit ID, for consistency's sake.
-
-// GPR - One of the 32 32-bit general-purpose registers
-class GPR<bits<5> num, string n> : AlphaReg<n> {
- let Num = num;
-}
-
-// FPR - One of the 32 64-bit floating-point registers
-class FPR<bits<5> num, string n> : AlphaReg<n> {
- let Num = num;
-}
-
-//#define FP $15
-//#define RA $26
-//#define PV $27
-//#define GP $29
-//#define SP $30
-
-// General-purpose registers
-def R0 : GPR< 0, "$0">, DwarfRegNum<[0]>;
-def R1 : GPR< 1, "$1">, DwarfRegNum<[1]>;
-def R2 : GPR< 2, "$2">, DwarfRegNum<[2]>;
-def R3 : GPR< 3, "$3">, DwarfRegNum<[3]>;
-def R4 : GPR< 4, "$4">, DwarfRegNum<[4]>;
-def R5 : GPR< 5, "$5">, DwarfRegNum<[5]>;
-def R6 : GPR< 6, "$6">, DwarfRegNum<[6]>;
-def R7 : GPR< 7, "$7">, DwarfRegNum<[7]>;
-def R8 : GPR< 8, "$8">, DwarfRegNum<[8]>;
-def R9 : GPR< 9, "$9">, DwarfRegNum<[9]>;
-def R10 : GPR<10, "$10">, DwarfRegNum<[10]>;
-def R11 : GPR<11, "$11">, DwarfRegNum<[11]>;
-def R12 : GPR<12, "$12">, DwarfRegNum<[12]>;
-def R13 : GPR<13, "$13">, DwarfRegNum<[13]>;
-def R14 : GPR<14, "$14">, DwarfRegNum<[14]>;
-def R15 : GPR<15, "$15">, DwarfRegNum<[15]>;
-def R16 : GPR<16, "$16">, DwarfRegNum<[16]>;
-def R17 : GPR<17, "$17">, DwarfRegNum<[17]>;
-def R18 : GPR<18, "$18">, DwarfRegNum<[18]>;
-def R19 : GPR<19, "$19">, DwarfRegNum<[19]>;
-def R20 : GPR<20, "$20">, DwarfRegNum<[20]>;
-def R21 : GPR<21, "$21">, DwarfRegNum<[21]>;
-def R22 : GPR<22, "$22">, DwarfRegNum<[22]>;
-def R23 : GPR<23, "$23">, DwarfRegNum<[23]>;
-def R24 : GPR<24, "$24">, DwarfRegNum<[24]>;
-def R25 : GPR<25, "$25">, DwarfRegNum<[25]>;
-def R26 : GPR<26, "$26">, DwarfRegNum<[26]>;
-def R27 : GPR<27, "$27">, DwarfRegNum<[27]>;
-def R28 : GPR<28, "$28">, DwarfRegNum<[28]>;
-def R29 : GPR<29, "$29">, DwarfRegNum<[29]>;
-def R30 : GPR<30, "$30">, DwarfRegNum<[30]>;
-def R31 : GPR<31, "$31">, DwarfRegNum<[31]>;
-
-// Floating-point registers
-def F0 : FPR< 0, "$f0">, DwarfRegNum<[33]>;
-def F1 : FPR< 1, "$f1">, DwarfRegNum<[34]>;
-def F2 : FPR< 2, "$f2">, DwarfRegNum<[35]>;
-def F3 : FPR< 3, "$f3">, DwarfRegNum<[36]>;
-def F4 : FPR< 4, "$f4">, DwarfRegNum<[37]>;
-def F5 : FPR< 5, "$f5">, DwarfRegNum<[38]>;
-def F6 : FPR< 6, "$f6">, DwarfRegNum<[39]>;
-def F7 : FPR< 7, "$f7">, DwarfRegNum<[40]>;
-def F8 : FPR< 8, "$f8">, DwarfRegNum<[41]>;
-def F9 : FPR< 9, "$f9">, DwarfRegNum<[42]>;
-def F10 : FPR<10, "$f10">, DwarfRegNum<[43]>;
-def F11 : FPR<11, "$f11">, DwarfRegNum<[44]>;
-def F12 : FPR<12, "$f12">, DwarfRegNum<[45]>;
-def F13 : FPR<13, "$f13">, DwarfRegNum<[46]>;
-def F14 : FPR<14, "$f14">, DwarfRegNum<[47]>;
-def F15 : FPR<15, "$f15">, DwarfRegNum<[48]>;
-def F16 : FPR<16, "$f16">, DwarfRegNum<[49]>;
-def F17 : FPR<17, "$f17">, DwarfRegNum<[50]>;
-def F18 : FPR<18, "$f18">, DwarfRegNum<[51]>;
-def F19 : FPR<19, "$f19">, DwarfRegNum<[52]>;
-def F20 : FPR<20, "$f20">, DwarfRegNum<[53]>;
-def F21 : FPR<21, "$f21">, DwarfRegNum<[54]>;
-def F22 : FPR<22, "$f22">, DwarfRegNum<[55]>;
-def F23 : FPR<23, "$f23">, DwarfRegNum<[56]>;
-def F24 : FPR<24, "$f24">, DwarfRegNum<[57]>;
-def F25 : FPR<25, "$f25">, DwarfRegNum<[58]>;
-def F26 : FPR<26, "$f26">, DwarfRegNum<[59]>;
-def F27 : FPR<27, "$f27">, DwarfRegNum<[60]>;
-def F28 : FPR<28, "$f28">, DwarfRegNum<[61]>;
-def F29 : FPR<29, "$f29">, DwarfRegNum<[62]>;
-def F30 : FPR<30, "$f30">, DwarfRegNum<[63]>;
-def F31 : FPR<31, "$f31">, DwarfRegNum<[64]>;
-
- // //#define FP $15
- // //#define RA $26
- // //#define PV $27
- // //#define GP $29
- // //#define SP $30
- // $28 is undefined after any and all calls
-
-/// Register classes
-def GPRC : RegisterClass<"Alpha", [i64], 64,
- // Volatile
- [R0, R1, R2, R3, R4, R5, R6, R7, R8, R16, R17, R18, R19, R20, R21, R22,
- R23, R24, R25, R28,
- //Special meaning, but volatile
- R27, //procedure address
- R26, //return address
- R29, //global offset table address
- // Non-volatile
- R9, R10, R11, R12, R13, R14,
-// Don't allocate 15, 30, 31
- R15, R30, R31 ]> //zero
-{
- let MethodProtos = [{
- iterator allocation_order_end(const MachineFunction &MF) const;
- }];
- let MethodBodies = [{
- GPRCClass::iterator
- GPRCClass::allocation_order_end(const MachineFunction &MF) const {
- return end()-3;
- }
- }];
-}
-
-def F4RC : RegisterClass<"Alpha", [f32], 64, [F0, F1,
- F10, F11, F12, F13, F14, F15, F16, F17, F18, F19,
- F20, F21, F22, F23, F24, F25, F26, F27, F28, F29, F30,
- // Saved:
- F2, F3, F4, F5, F6, F7, F8, F9,
- F31 ]> //zero
-{
- let MethodProtos = [{
- iterator allocation_order_end(const MachineFunction &MF) const;
- }];
- let MethodBodies = [{
- F4RCClass::iterator
- F4RCClass::allocation_order_end(const MachineFunction &MF) const {
- return end()-1;
- }
- }];
-}
-
-def F8RC : RegisterClass<"Alpha", [f64], 64, [F0, F1,
- F10, F11, F12, F13, F14, F15, F16, F17, F18, F19,
- F20, F21, F22, F23, F24, F25, F26, F27, F28, F29, F30,
- // Saved:
- F2, F3, F4, F5, F6, F7, F8, F9,
- F31 ]> //zero
-{
- let MethodProtos = [{
- iterator allocation_order_end(const MachineFunction &MF) const;
- }];
- let MethodBodies = [{
- F8RCClass::iterator
- F8RCClass::allocation_order_end(const MachineFunction &MF) const {
- return end()-1;
- }
- }];
-}
diff --git a/release_23/lib/Target/Alpha/AlphaRelocations.h b/release_23/lib/Target/Alpha/AlphaRelocations.h
deleted file mode 100644
index 4c92045d4696..000000000000
--- a/release_23/lib/Target/Alpha/AlphaRelocations.h
+++ /dev/null
@@ -1,31 +0,0 @@
-//===- AlphaRelocations.h - Alpha Code Relocations --------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines the Alpha target-specific relocation types.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef ALPHARELOCATIONS_H
-#define ALPHARELOCATIONS_H
-
-#include "llvm/CodeGen/MachineRelocation.h"
-
-namespace llvm {
- namespace Alpha {
- enum RelocationType {
- reloc_literal,
- reloc_gprellow,
- reloc_gprelhigh,
- reloc_gpdist,
- reloc_bsr
- };
- }
-}
-
-#endif
diff --git a/release_23/lib/Target/Alpha/AlphaSchedule.td b/release_23/lib/Target/Alpha/AlphaSchedule.td
deleted file mode 100644
index b7b456084709..000000000000
--- a/release_23/lib/Target/Alpha/AlphaSchedule.td
+++ /dev/null
@@ -1,84 +0,0 @@
-//===- AlphaSchedule.td - Alpha Scheduling Definitions -----*- tablegen -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-//This is table 2-2 from the 21264 compiler writers guide
-//modified some
-
-//Pipelines
-
-def L0 : FuncUnit;
-def L1 : FuncUnit;
-def FST0 : FuncUnit;
-def FST1 : FuncUnit;
-def U0 : FuncUnit;
-def U1 : FuncUnit;
-def FA : FuncUnit;
-def FM : FuncUnit;
-
-def s_ild : InstrItinClass;
-def s_fld : InstrItinClass;
-def s_ist : InstrItinClass;
-def s_fst : InstrItinClass;
-def s_lda : InstrItinClass;
-def s_rpcc : InstrItinClass;
-def s_rx : InstrItinClass;
-def s_mxpr : InstrItinClass;
-def s_icbr : InstrItinClass;
-def s_ubr : InstrItinClass;
-def s_jsr : InstrItinClass;
-def s_iadd : InstrItinClass;
-def s_ilog : InstrItinClass;
-def s_ishf : InstrItinClass;
-def s_cmov : InstrItinClass;
-def s_imul : InstrItinClass;
-def s_imisc : InstrItinClass;
-def s_fbr : InstrItinClass;
-def s_fadd : InstrItinClass;
-def s_fmul : InstrItinClass;
-def s_fcmov : InstrItinClass;
-def s_fdivt : InstrItinClass;
-def s_fdivs : InstrItinClass;
-def s_fsqrts: InstrItinClass;
-def s_fsqrtt: InstrItinClass;
-def s_ftoi : InstrItinClass;
-def s_itof : InstrItinClass;
-def s_pseudo : InstrItinClass;
-
-//Table 2­4 Instruction Class Latency in Cycles
-//modified some
-
-def Alpha21264Itineraries : ProcessorItineraries<[
- InstrItinData<s_ild , [InstrStage<3, [L0, L1]>]>,
- InstrItinData<s_fld , [InstrStage<4, [L0, L1]>]>,
- InstrItinData<s_ist , [InstrStage<0, [L0, L1]>]>,
- InstrItinData<s_fst , [InstrStage<0, [FST0, FST1, L0, L1]>]>,
- InstrItinData<s_lda , [InstrStage<1, [L0, L1, U0, U1]>]>,
- InstrItinData<s_rpcc , [InstrStage<1, [L1]>]>,
- InstrItinData<s_rx , [InstrStage<1, [L1]>]>,
- InstrItinData<s_mxpr , [InstrStage<1, [L0, L1]>]>,
- InstrItinData<s_icbr , [InstrStage<0, [U0, U1]>]>,
- InstrItinData<s_ubr , [InstrStage<3, [U0, U1]>]>,
- InstrItinData<s_jsr , [InstrStage<3, [L0]>]>,
- InstrItinData<s_iadd , [InstrStage<1, [L0, U0, L1, U1]>]>,
- InstrItinData<s_ilog , [InstrStage<1, [L0, U0, L1, U1]>]>,
- InstrItinData<s_ishf , [InstrStage<1, [U0, U1]>]>,
- InstrItinData<s_cmov , [InstrStage<1, [L0, U0, L1, U1]>]>,
- InstrItinData<s_imul , [InstrStage<7, [U1]>]>,
- InstrItinData<s_imisc , [InstrStage<3, [U0]>]>,
- InstrItinData<s_fbr , [InstrStage<0, [FA]>]>,
- InstrItinData<s_fadd , [InstrStage<6, [FA]>]>,
- InstrItinData<s_fmul , [InstrStage<6, [FM]>]>,
- InstrItinData<s_fcmov , [InstrStage<6, [FA]>]>,
- InstrItinData<s_fdivs , [InstrStage<12, [FA]>]>,
- InstrItinData<s_fdivt , [InstrStage<15, [FA]>]>,
- InstrItinData<s_fsqrts , [InstrStage<18, [FA]>]>,
- InstrItinData<s_fsqrtt , [InstrStage<33, [FA]>]>,
- InstrItinData<s_ftoi , [InstrStage<3, [FST0, FST1, L0, L1]>]>,
- InstrItinData<s_itof , [InstrStage<4, [L0, L1]>]>
-]>;
diff --git a/release_23/lib/Target/Alpha/AlphaSubtarget.cpp b/release_23/lib/Target/Alpha/AlphaSubtarget.cpp
deleted file mode 100644
index d5a9365d75c1..000000000000
--- a/release_23/lib/Target/Alpha/AlphaSubtarget.cpp
+++ /dev/null
@@ -1,25 +0,0 @@
-//===- AlphaSubtarget.cpp - Alpha Subtarget Information ---------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the Alpha specific subclass of TargetSubtarget.
-//
-//===----------------------------------------------------------------------===//
-
-#include "AlphaSubtarget.h"
-#include "Alpha.h"
-#include "AlphaGenSubtarget.inc"
-using namespace llvm;
-
-AlphaSubtarget::AlphaSubtarget(const Module &M, const std::string &FS)
- : HasCT(false) {
- std::string CPU = "generic";
-
- // Parse features string.
- ParseSubtargetFeatures(FS, CPU);
-}
diff --git a/release_23/lib/Target/Alpha/AlphaSubtarget.h b/release_23/lib/Target/Alpha/AlphaSubtarget.h
deleted file mode 100644
index bcbb62813e49..000000000000
--- a/release_23/lib/Target/Alpha/AlphaSubtarget.h
+++ /dev/null
@@ -1,46 +0,0 @@
-//=====-- AlphaSubtarget.h - Define Subtarget for the Alpha --*- C++ -*--====//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file declares the Alpha specific subclass of TargetSubtarget.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef ALPHASUBTARGET_H
-#define ALPHASUBTARGET_H
-
-#include "llvm/Target/TargetInstrItineraries.h"
-#include "llvm/Target/TargetSubtarget.h"
-
-#include <string>
-
-namespace llvm {
-class Module;
-
-class AlphaSubtarget : public TargetSubtarget {
-protected:
-
- bool HasCT;
-
- InstrItineraryData InstrItins;
-
-public:
- /// This constructor initializes the data members to match that
- /// of the specified module.
- ///
- AlphaSubtarget(const Module &M, const std::string &FS);
-
- /// ParseSubtargetFeatures - Parses features string setting specified
- /// subtarget options. Definition of function is auto generated by tblgen.
- void ParseSubtargetFeatures(const std::string &FS, const std::string &CPU);
-
- bool hasCT() const { return HasCT; }
-};
-} // End llvm namespace
-
-#endif
diff --git a/release_23/lib/Target/Alpha/AlphaTargetAsmInfo.cpp b/release_23/lib/Target/Alpha/AlphaTargetAsmInfo.cpp
deleted file mode 100644
index 90cbac58195f..000000000000
--- a/release_23/lib/Target/Alpha/AlphaTargetAsmInfo.cpp
+++ /dev/null
@@ -1,24 +0,0 @@
-//===-- AlphaTargetAsmInfo.cpp - Alpha asm properties -----------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains the declarations of the AlphaTargetAsmInfo properties.
-//
-//===----------------------------------------------------------------------===//
-
-#include "AlphaTargetAsmInfo.h"
-
-using namespace llvm;
-
-AlphaTargetAsmInfo::AlphaTargetAsmInfo(const AlphaTargetMachine &TM) {
- AlignmentIsInBytes = false;
- PrivateGlobalPrefix = "$";
- JumpTableDirective = ".gprel32";
- JumpTableDataSection = "\t.section .rodata\n";
- WeakRefDirective = "\t.weak\t";
-}
diff --git a/release_23/lib/Target/Alpha/AlphaTargetAsmInfo.h b/release_23/lib/Target/Alpha/AlphaTargetAsmInfo.h
deleted file mode 100644
index 0b50de858fc1..000000000000
--- a/release_23/lib/Target/Alpha/AlphaTargetAsmInfo.h
+++ /dev/null
@@ -1,30 +0,0 @@
-//=====-- AlphaTargetAsmInfo.h - Alpha asm properties ---------*- C++ -*--====//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains the declaration of the AlphaTargetAsmInfo class.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef ALPHATARGETASMINFO_H
-#define ALPHATARGETASMINFO_H
-
-#include "llvm/Target/TargetAsmInfo.h"
-
-namespace llvm {
-
- // Forward declaration.
- class AlphaTargetMachine;
-
- struct AlphaTargetAsmInfo : public TargetAsmInfo {
- explicit AlphaTargetAsmInfo(const AlphaTargetMachine &TM);
- };
-
-} // namespace llvm
-
-#endif
diff --git a/release_23/lib/Target/Alpha/AlphaTargetMachine.cpp b/release_23/lib/Target/Alpha/AlphaTargetMachine.cpp
deleted file mode 100644
index 0887b952bb53..000000000000
--- a/release_23/lib/Target/Alpha/AlphaTargetMachine.cpp
+++ /dev/null
@@ -1,99 +0,0 @@
-//===-- AlphaTargetMachine.cpp - Define TargetMachine for Alpha -----------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-//
-//===----------------------------------------------------------------------===//
-
-#include "Alpha.h"
-#include "AlphaJITInfo.h"
-#include "AlphaTargetAsmInfo.h"
-#include "AlphaTargetMachine.h"
-#include "llvm/Module.h"
-#include "llvm/PassManager.h"
-#include "llvm/Target/TargetMachineRegistry.h"
-
-using namespace llvm;
-
-namespace {
- // Register the targets
- RegisterTarget<AlphaTargetMachine> X("alpha", " Alpha (incomplete)");
-}
-
-const TargetAsmInfo *AlphaTargetMachine::createTargetAsmInfo() const {
- return new AlphaTargetAsmInfo(*this);
-}
-
-unsigned AlphaTargetMachine::getModuleMatchQuality(const Module &M) {
- // We strongly match "alpha*".
- std::string TT = M.getTargetTriple();
- if (TT.size() >= 5 && TT[0] == 'a' && TT[1] == 'l' && TT[2] == 'p' &&
- TT[3] == 'h' && TT[4] == 'a')
- return 20;
- // If the target triple is something non-alpha, we don't match.
- if (!TT.empty()) return 0;
-
- if (M.getEndianness() == Module::LittleEndian &&
- M.getPointerSize() == Module::Pointer64)
- return 10; // Weak match
- else if (M.getEndianness() != Module::AnyEndianness ||
- M.getPointerSize() != Module::AnyPointerSize)
- return 0; // Match for some other target
-
- return getJITMatchQuality()/2;
-}
-
-unsigned AlphaTargetMachine::getJITMatchQuality() {
-#ifdef __alpha
- return 10;
-#else
- return 0;
-#endif
-}
-
-AlphaTargetMachine::AlphaTargetMachine(const Module &M, const std::string &FS)
- : DataLayout("e-f128:128:128"),
- FrameInfo(TargetFrameInfo::StackGrowsDown, 16, 0),
- JITInfo(*this),
- Subtarget(M, FS),
- TLInfo(*this) {
- setRelocationModel(Reloc::PIC_);
-}
-
-
-//===----------------------------------------------------------------------===//
-// Pass Pipeline Configuration
-//===----------------------------------------------------------------------===//
-
-bool AlphaTargetMachine::addInstSelector(PassManagerBase &PM, bool Fast) {
- PM.add(createAlphaISelDag(*this));
- return false;
-}
-bool AlphaTargetMachine::addPreEmitPass(PassManagerBase &PM, bool Fast) {
- // Must run branch selection immediately preceding the asm printer
- PM.add(createAlphaBranchSelectionPass());
- return false;
-}
-bool AlphaTargetMachine::addAssemblyEmitter(PassManagerBase &PM, bool Fast,
- std::ostream &Out) {
- PM.add(createAlphaLLRPPass(*this));
- PM.add(createAlphaCodePrinterPass(Out, *this));
- return false;
-}
-bool AlphaTargetMachine::addCodeEmitter(PassManagerBase &PM, bool Fast,
- bool DumpAsm, MachineCodeEmitter &MCE) {
- PM.add(createAlphaCodeEmitterPass(*this, MCE));
- if (DumpAsm)
- PM.add(createAlphaCodePrinterPass(*cerr.stream(), *this));
- return false;
-}
-bool AlphaTargetMachine::addSimpleCodeEmitter(PassManagerBase &PM,
- bool Fast, bool DumpAsm,
- MachineCodeEmitter &MCE) {
- return addCodeEmitter(PM, Fast, DumpAsm, MCE);
-}
diff --git a/release_23/lib/Target/Alpha/AlphaTargetMachine.h b/release_23/lib/Target/Alpha/AlphaTargetMachine.h
deleted file mode 100644
index d365b7d29b0c..000000000000
--- a/release_23/lib/Target/Alpha/AlphaTargetMachine.h
+++ /dev/null
@@ -1,73 +0,0 @@
-//===-- AlphaTargetMachine.h - Define TargetMachine for Alpha ---*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file declares the Alpha-specific subclass of TargetMachine.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef ALPHA_TARGETMACHINE_H
-#define ALPHA_TARGETMACHINE_H
-
-#include "llvm/Target/TargetMachine.h"
-#include "llvm/Target/TargetData.h"
-#include "llvm/Target/TargetFrameInfo.h"
-#include "AlphaInstrInfo.h"
-#include "AlphaJITInfo.h"
-#include "AlphaISelLowering.h"
-#include "AlphaSubtarget.h"
-
-namespace llvm {
-
-class GlobalValue;
-
-class AlphaTargetMachine : public LLVMTargetMachine {
- const TargetData DataLayout; // Calculates type size & alignment
- AlphaInstrInfo InstrInfo;
- TargetFrameInfo FrameInfo;
- AlphaJITInfo JITInfo;
- AlphaSubtarget Subtarget;
- AlphaTargetLowering TLInfo;
-
-protected:
- virtual const TargetAsmInfo *createTargetAsmInfo() const;
-
-public:
- AlphaTargetMachine(const Module &M, const std::string &FS);
-
- virtual const AlphaInstrInfo *getInstrInfo() const { return &InstrInfo; }
- virtual const TargetFrameInfo *getFrameInfo() const { return &FrameInfo; }
- virtual const TargetSubtarget *getSubtargetImpl() const{ return &Subtarget; }
- virtual const TargetRegisterInfo *getRegisterInfo() const {
- return &InstrInfo.getRegisterInfo();
- }
- virtual TargetLowering* getTargetLowering() const {
- return const_cast<AlphaTargetLowering*>(&TLInfo);
- }
- virtual const TargetData *getTargetData() const { return &DataLayout; }
- virtual TargetJITInfo* getJITInfo() {
- return &JITInfo;
- }
-
- static unsigned getJITMatchQuality();
- static unsigned getModuleMatchQuality(const Module &M);
-
- // Pass Pipeline Configuration
- virtual bool addInstSelector(PassManagerBase &PM, bool Fast);
- virtual bool addPreEmitPass(PassManagerBase &PM, bool Fast);
- virtual bool addAssemblyEmitter(PassManagerBase &PM, bool Fast,
- std::ostream &Out);
- virtual bool addCodeEmitter(PassManagerBase &PM, bool Fast,
- bool DumpAsm, MachineCodeEmitter &MCE);
- virtual bool addSimpleCodeEmitter(PassManagerBase &PM, bool Fast,
- bool DumpAsm, MachineCodeEmitter &MCE);
-};
-
-} // end namespace llvm
-
-#endif
diff --git a/release_23/lib/Target/Alpha/Makefile b/release_23/lib/Target/Alpha/Makefile
deleted file mode 100644
index cc427d69f3df..000000000000
--- a/release_23/lib/Target/Alpha/Makefile
+++ /dev/null
@@ -1,20 +0,0 @@
-##===- lib/Target/Alpha/Makefile -------------------------*- Makefile -*-===##
-#
-# The LLVM Compiler Infrastructure
-#
-# This file is distributed under the University of Illinois Open Source
-# License. See LICENSE.TXT for details.
-#
-##===----------------------------------------------------------------------===##
-LEVEL = ../../..
-LIBRARYNAME = LLVMAlpha
-TARGET = Alpha
-
-# Make sure that tblgen is run, first thing.
-BUILT_SOURCES = AlphaGenRegisterInfo.h.inc AlphaGenRegisterNames.inc \
- AlphaGenRegisterInfo.inc AlphaGenInstrNames.inc \
- AlphaGenInstrInfo.inc AlphaGenCodeEmitter.inc \
- AlphaGenAsmWriter.inc AlphaGenDAGISel.inc \
- AlphaGenSubtarget.inc
-
-include $(LEVEL)/Makefile.common
diff --git a/release_23/lib/Target/Alpha/README.txt b/release_23/lib/Target/Alpha/README.txt
deleted file mode 100644
index 9ae15174c582..000000000000
--- a/release_23/lib/Target/Alpha/README.txt
+++ /dev/null
@@ -1,42 +0,0 @@
-***
-
-add gcc builtins for alpha instructions
-
-
-***
-
-custom expand byteswap into nifty
-extract/insert/mask byte/word/longword/quadword low/high
-sequences
-
-***
-
-see if any of the extract/insert/mask operations can be added
-
-***
-
-match more interesting things for cmovlbc cmovlbs (move if low bit clear/set)
-
-***
-
-lower srem and urem
-
-remq(i,j): i - (j * divq(i,j)) if j != 0
-remqu(i,j): i - (j * divqu(i,j)) if j != 0
-reml(i,j): i - (j * divl(i,j)) if j != 0
-remlu(i,j): i - (j * divlu(i,j)) if j != 0
-
-***
-
-add crazy vector instructions (MVI):
-
-(MIN|MAX)(U|S)(B8|W4) min and max, signed and unsigned, byte and word
-PKWB, UNPKBW pack/unpack word to byte
-PKLB UNPKBL pack/unpack long to byte
-PERR pixel error (sum accross bytes of bytewise abs(i8v8 a - i8v8 b))
-
-cmpbytes bytewise cmpeq of i8v8 a and i8v8 b (not part of MVI extentions)
-
-this has some good examples for other operations that can be synthesised well
-from these rather meager vector ops (such as saturating add).
-http://www.alphalinux.org/docs/MVI-full.html
diff --git a/release_23/lib/Target/CBackend/CBackend.cpp b/release_23/lib/Target/CBackend/CBackend.cpp
deleted file mode 100644
index 92fc40bcc6fc..000000000000
--- a/release_23/lib/Target/CBackend/CBackend.cpp
+++ /dev/null
@@ -1,3307 +0,0 @@
-//===-- CBackend.cpp - Library for converting LLVM code to C --------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This library converts LLVM code to C code, compilable by GCC and other C
-// compilers.
-//
-//===----------------------------------------------------------------------===//
-
-#include "CTargetMachine.h"
-#include "llvm/CallingConv.h"
-#include "llvm/Constants.h"
-#include "llvm/DerivedTypes.h"
-#include "llvm/Module.h"
-#include "llvm/Instructions.h"
-#include "llvm/Pass.h"
-#include "llvm/PassManager.h"
-#include "llvm/TypeSymbolTable.h"
-#include "llvm/Intrinsics.h"
-#include "llvm/IntrinsicInst.h"
-#include "llvm/InlineAsm.h"
-#include "llvm/Analysis/ConstantsScanner.h"
-#include "llvm/Analysis/FindUsedTypes.h"
-#include "llvm/Analysis/LoopInfo.h"
-#include "llvm/CodeGen/Passes.h"
-#include "llvm/CodeGen/IntrinsicLowering.h"
-#include "llvm/Transforms/Scalar.h"
-#include "llvm/Target/TargetMachineRegistry.h"
-#include "llvm/Target/TargetAsmInfo.h"
-#include "llvm/Target/TargetData.h"
-#include "llvm/Support/CallSite.h"
-#include "llvm/Support/CFG.h"
-#include "llvm/Support/GetElementPtrTypeIterator.h"
-#include "llvm/Support/InstVisitor.h"
-#include "llvm/Support/Mangler.h"
-#include "llvm/Support/MathExtras.h"
-#include "llvm/ADT/StringExtras.h"
-#include "llvm/ADT/STLExtras.h"
-#include "llvm/Support/MathExtras.h"
-#include "llvm/Config/config.h"
-#include <algorithm>
-#include <sstream>
-using namespace llvm;
-
-namespace {
- // Register the target.
- RegisterTarget<CTargetMachine> X("c", " C backend");
-
- /// CBackendNameAllUsedStructsAndMergeFunctions - This pass inserts names for
- /// any unnamed structure types that are used by the program, and merges
- /// external functions with the same name.
- ///
- class CBackendNameAllUsedStructsAndMergeFunctions : public ModulePass {
- public:
- static char ID;
- CBackendNameAllUsedStructsAndMergeFunctions()
- : ModulePass((intptr_t)&ID) {}
- void getAnalysisUsage(AnalysisUsage &AU) const {
- AU.addRequired<FindUsedTypes>();
- }
-
- virtual const char *getPassName() const {
- return "C backend type canonicalizer";
- }
-
- virtual bool runOnModule(Module &M);
- };
-
- char CBackendNameAllUsedStructsAndMergeFunctions::ID = 0;
-
- /// CWriter - This class is the main chunk of code that converts an LLVM
- /// module to a C translation unit.
- class CWriter : public FunctionPass, public InstVisitor<CWriter> {
- std::ostream &Out;
- IntrinsicLowering *IL;
- Mangler *Mang;
- LoopInfo *LI;
- const Module *TheModule;
- const TargetAsmInfo* TAsm;
- const TargetData* TD;
- std::map<const Type *, std::string> TypeNames;
- std::map<const ConstantFP *, unsigned> FPConstantMap;
- std::set<Function*> intrinsicPrototypesAlreadyGenerated;
- std::set<const Argument*> ByValParams;
-
- public:
- static char ID;
- explicit CWriter(std::ostream &o)
- : FunctionPass((intptr_t)&ID), Out(o), IL(0), Mang(0), LI(0),
- TheModule(0), TAsm(0), TD(0) {}
-
- virtual const char *getPassName() const { return "C backend"; }
-
- void getAnalysisUsage(AnalysisUsage &AU) const {
- AU.addRequired<LoopInfo>();
- AU.setPreservesAll();
- }
-
- virtual bool doInitialization(Module &M);
-
- bool runOnFunction(Function &F) {
- LI = &getAnalysis<LoopInfo>();
-
- // Get rid of intrinsics we can't handle.
- lowerIntrinsics(F);
-
- // Output all floating point constants that cannot be printed accurately.
- printFloatingPointConstants(F);
-
- printFunction(F);
- return false;
- }
-
- virtual bool doFinalization(Module &M) {
- // Free memory...
- delete Mang;
- FPConstantMap.clear();
- TypeNames.clear();
- ByValParams.clear();
- intrinsicPrototypesAlreadyGenerated.clear();
- return false;
- }
-
- std::ostream &printType(std::ostream &Out, const Type *Ty,
- bool isSigned = false,
- const std::string &VariableName = "",
- bool IgnoreName = false,
- const PAListPtr &PAL = PAListPtr());
- std::ostream &printSimpleType(std::ostream &Out, const Type *Ty,
- bool isSigned,
- const std::string &NameSoFar = "");
-
- void printStructReturnPointerFunctionType(std::ostream &Out,
- const PAListPtr &PAL,
- const PointerType *Ty);
-
- /// writeOperandDeref - Print the result of dereferencing the specified
- /// operand with '*'. This is equivalent to printing '*' then using
- /// writeOperand, but avoids excess syntax in some cases.
- void writeOperandDeref(Value *Operand) {
- if (isAddressExposed(Operand)) {
- // Already something with an address exposed.
- writeOperandInternal(Operand);
- } else {
- Out << "*(";
- writeOperand(Operand);
- Out << ")";
- }
- }
-
- void writeOperand(Value *Operand);
- void writeOperandRaw(Value *Operand);
- void writeInstComputationInline(Instruction &I);
- void writeOperandInternal(Value *Operand);
- void writeOperandWithCast(Value* Operand, unsigned Opcode);
- void writeOperandWithCast(Value* Operand, const ICmpInst &I);
- bool writeInstructionCast(const Instruction &I);
-
- void writeMemoryAccess(Value *Operand, const Type *OperandType,
- bool IsVolatile, unsigned Alignment);
-
- private :
- std::string InterpretASMConstraint(InlineAsm::ConstraintInfo& c);
-
- void lowerIntrinsics(Function &F);
-
- void printModule(Module *M);
- void printModuleTypes(const TypeSymbolTable &ST);
- void printContainedStructs(const Type *Ty, std::set<const StructType *> &);
- void printFloatingPointConstants(Function &F);
- void printFunctionSignature(const Function *F, bool Prototype);
-
- void printFunction(Function &);
- void printBasicBlock(BasicBlock *BB);
- void printLoop(Loop *L);
-
- void printCast(unsigned opcode, const Type *SrcTy, const Type *DstTy);
- void printConstant(Constant *CPV);
- void printConstantWithCast(Constant *CPV, unsigned Opcode);
- bool printConstExprCast(const ConstantExpr *CE);
- void printConstantArray(ConstantArray *CPA);
- void printConstantVector(ConstantVector *CV);
-
- /// isAddressExposed - Return true if the specified value's name needs to
- /// have its address taken in order to get a C value of the correct type.
- /// This happens for global variables, byval parameters, and direct allocas.
- bool isAddressExposed(const Value *V) const {
- if (const Argument *A = dyn_cast<Argument>(V))
- return ByValParams.count(A);
- return isa<GlobalVariable>(V) || isDirectAlloca(V);
- }
-
- // isInlinableInst - Attempt to inline instructions into their uses to build
- // trees as much as possible. To do this, we have to consistently decide
- // what is acceptable to inline, so that variable declarations don't get
- // printed and an extra copy of the expr is not emitted.
- //
- static bool isInlinableInst(const Instruction &I) {
- // Always inline cmp instructions, even if they are shared by multiple
- // expressions. GCC generates horrible code if we don't.
- if (isa<CmpInst>(I))
- return true;
-
- // Must be an expression, must be used exactly once. If it is dead, we
- // emit it inline where it would go.
- if (I.getType() == Type::VoidTy || !I.hasOneUse() ||
- isa<TerminatorInst>(I) || isa<CallInst>(I) || isa<PHINode>(I) ||
- isa<LoadInst>(I) || isa<VAArgInst>(I) || isa<InsertElementInst>(I))
- // Don't inline a load across a store or other bad things!
- return false;
-
- // Must not be used in inline asm, extractelement, or shufflevector.
- if (I.hasOneUse()) {
- const Instruction &User = cast<Instruction>(*I.use_back());
- if (isInlineAsm(User) || isa<ExtractElementInst>(User) ||
- isa<ShuffleVectorInst>(User))
- return false;
- }
-
- // Only inline instruction it if it's use is in the same BB as the inst.
- return I.getParent() == cast<Instruction>(I.use_back())->getParent();
- }
-
- // isDirectAlloca - Define fixed sized allocas in the entry block as direct
- // variables which are accessed with the & operator. This causes GCC to
- // generate significantly better code than to emit alloca calls directly.
- //
- static const AllocaInst *isDirectAlloca(const Value *V) {
- const AllocaInst *AI = dyn_cast<AllocaInst>(V);
- if (!AI) return false;
- if (AI->isArrayAllocation())
- return 0; // FIXME: we can also inline fixed size array allocas!
- if (AI->getParent() != &AI->getParent()->getParent()->getEntryBlock())
- return 0;
- return AI;
- }
-
- // isInlineAsm - Check if the instruction is a call to an inline asm chunk
- static bool isInlineAsm(const Instruction& I) {
- if (isa<CallInst>(&I) && isa<InlineAsm>(I.getOperand(0)))
- return true;
- return false;
- }
-
- // Instruction visitation functions
- friend class InstVisitor<CWriter>;
-
- void visitReturnInst(ReturnInst &I);
- void visitBranchInst(BranchInst &I);
- void visitSwitchInst(SwitchInst &I);
- void visitInvokeInst(InvokeInst &I) {
- assert(0 && "Lowerinvoke pass didn't work!");
- }
-
- void visitUnwindInst(UnwindInst &I) {
- assert(0 && "Lowerinvoke pass didn't work!");
- }
- void visitUnreachableInst(UnreachableInst &I);
-
- void visitPHINode(PHINode &I);
- void visitBinaryOperator(Instruction &I);
- void visitICmpInst(ICmpInst &I);
- void visitFCmpInst(FCmpInst &I);
-
- void visitCastInst (CastInst &I);
- void visitSelectInst(SelectInst &I);
- void visitCallInst (CallInst &I);
- void visitInlineAsm(CallInst &I);
- bool visitBuiltinCall(CallInst &I, Intrinsic::ID ID, bool &WroteCallee);
-
- void visitMallocInst(MallocInst &I);
- void visitAllocaInst(AllocaInst &I);
- void visitFreeInst (FreeInst &I);
- void visitLoadInst (LoadInst &I);
- void visitStoreInst (StoreInst &I);
- void visitGetElementPtrInst(GetElementPtrInst &I);
- void visitVAArgInst (VAArgInst &I);
-
- void visitInsertElementInst(InsertElementInst &I);
- void visitExtractElementInst(ExtractElementInst &I);
- void visitShuffleVectorInst(ShuffleVectorInst &SVI);
- void visitGetResultInst(GetResultInst &GRI);
-
- void visitInstruction(Instruction &I) {
- cerr << "C Writer does not know about " << I;
- abort();
- }
-
- void outputLValue(Instruction *I) {
- Out << " " << GetValueName(I) << " = ";
- }
-
- bool isGotoCodeNecessary(BasicBlock *From, BasicBlock *To);
- void printPHICopiesForSuccessor(BasicBlock *CurBlock,
- BasicBlock *Successor, unsigned Indent);
- void printBranchToBlock(BasicBlock *CurBlock, BasicBlock *SuccBlock,
- unsigned Indent);
- void printGEPExpression(Value *Ptr, gep_type_iterator I,
- gep_type_iterator E);
-
- std::string GetValueName(const Value *Operand);
- };
-}
-
-char CWriter::ID = 0;
-
-/// This method inserts names for any unnamed structure types that are used by
-/// the program, and removes names from structure types that are not used by the
-/// program.
-///
-bool CBackendNameAllUsedStructsAndMergeFunctions::runOnModule(Module &M) {
- // Get a set of types that are used by the program...
- std::set<const Type *> UT = getAnalysis<FindUsedTypes>().getTypes();
-
- // Loop over the module symbol table, removing types from UT that are
- // already named, and removing names for types that are not used.
- //
- TypeSymbolTable &TST = M.getTypeSymbolTable();
- for (TypeSymbolTable::iterator TI = TST.begin(), TE = TST.end();
- TI != TE; ) {
- TypeSymbolTable::iterator I = TI++;
-
- // If this isn't a struct type, remove it from our set of types to name.
- // This simplifies emission later.
- if (!isa<StructType>(I->second) && !isa<OpaqueType>(I->second)) {
- TST.remove(I);
- } else {
- // If this is not used, remove it from the symbol table.
- std::set<const Type *>::iterator UTI = UT.find(I->second);
- if (UTI == UT.end())
- TST.remove(I);
- else
- UT.erase(UTI); // Only keep one name for this type.
- }
- }
-
- // UT now contains types that are not named. Loop over it, naming
- // structure types.
- //
- bool Changed = false;
- unsigned RenameCounter = 0;
- for (std::set<const Type *>::const_iterator I = UT.begin(), E = UT.end();
- I != E; ++I)
- if (const StructType *ST = dyn_cast<StructType>(*I)) {
- while (M.addTypeName("unnamed"+utostr(RenameCounter), ST))
- ++RenameCounter;
- Changed = true;
- }
-
-
- // Loop over all external functions and globals. If we have two with
- // identical names, merge them.
- // FIXME: This code should disappear when we don't allow values with the same
- // names when they have different types!
- std::map<std::string, GlobalValue*> ExtSymbols;
- for (Module::iterator I = M.begin(), E = M.end(); I != E;) {
- Function *GV = I++;
- if (GV->isDeclaration() && GV->hasName()) {
- std::pair<std::map<std::string, GlobalValue*>::iterator, bool> X
- = ExtSymbols.insert(std::make_pair(GV->getName(), GV));
- if (!X.second) {
- // Found a conflict, replace this global with the previous one.
- GlobalValue *OldGV = X.first->second;
- GV->replaceAllUsesWith(ConstantExpr::getBitCast(OldGV, GV->getType()));
- GV->eraseFromParent();
- Changed = true;
- }
- }
- }
- // Do the same for globals.
- for (Module::global_iterator I = M.global_begin(), E = M.global_end();
- I != E;) {
- GlobalVariable *GV = I++;
- if (GV->isDeclaration() && GV->hasName()) {
- std::pair<std::map<std::string, GlobalValue*>::iterator, bool> X
- = ExtSymbols.insert(std::make_pair(GV->getName(), GV));
- if (!X.second) {
- // Found a conflict, replace this global with the previous one.
- GlobalValue *OldGV = X.first->second;
- GV->replaceAllUsesWith(ConstantExpr::getBitCast(OldGV, GV->getType()));
- GV->eraseFromParent();
- Changed = true;
- }
- }
- }
-
- return Changed;
-}
-
-/// printStructReturnPointerFunctionType - This is like printType for a struct
-/// return type, except, instead of printing the type as void (*)(Struct*, ...)
-/// print it as "Struct (*)(...)", for struct return functions.
-void CWriter::printStructReturnPointerFunctionType(std::ostream &Out,
- const PAListPtr &PAL,
- const PointerType *TheTy) {
- const FunctionType *FTy = cast<FunctionType>(TheTy->getElementType());
- std::stringstream FunctionInnards;
- FunctionInnards << " (*) (";
- bool PrintedType = false;
-
- FunctionType::param_iterator I = FTy->param_begin(), E = FTy->param_end();
- const Type *RetTy = cast<PointerType>(I->get())->getElementType();
- unsigned Idx = 1;
- for (++I, ++Idx; I != E; ++I, ++Idx) {
- if (PrintedType)
- FunctionInnards << ", ";
- const Type *ArgTy = *I;
- if (PAL.paramHasAttr(Idx, ParamAttr::ByVal)) {
- assert(isa<PointerType>(ArgTy));
- ArgTy = cast<PointerType>(ArgTy)->getElementType();
- }
- printType(FunctionInnards, ArgTy,
- /*isSigned=*/PAL.paramHasAttr(Idx, ParamAttr::SExt), "");
- PrintedType = true;
- }
- if (FTy->isVarArg()) {
- if (PrintedType)
- FunctionInnards << ", ...";
- } else if (!PrintedType) {
- FunctionInnards << "void";
- }
- FunctionInnards << ')';
- std::string tstr = FunctionInnards.str();
- printType(Out, RetTy,
- /*isSigned=*/PAL.paramHasAttr(0, ParamAttr::SExt), tstr);
-}
-
-std::ostream &
-CWriter::printSimpleType(std::ostream &Out, const Type *Ty, bool isSigned,
- const std::string &NameSoFar) {
- assert((Ty->isPrimitiveType() || Ty->isInteger() || isa<VectorType>(Ty)) &&
- "Invalid type for printSimpleType");
- switch (Ty->getTypeID()) {
- case Type::VoidTyID: return Out << "void " << NameSoFar;
- case Type::IntegerTyID: {
- unsigned NumBits = cast<IntegerType>(Ty)->getBitWidth();
- if (NumBits == 1)
- return Out << "bool " << NameSoFar;
- else if (NumBits <= 8)
- return Out << (isSigned?"signed":"unsigned") << " char " << NameSoFar;
- else if (NumBits <= 16)
- return Out << (isSigned?"signed":"unsigned") << " short " << NameSoFar;
- else if (NumBits <= 32)
- return Out << (isSigned?"signed":"unsigned") << " int " << NameSoFar;
- else if (NumBits <= 64)
- return Out << (isSigned?"signed":"unsigned") << " long long "<< NameSoFar;
- else {
- assert(NumBits <= 128 && "Bit widths > 128 not implemented yet");
- return Out << (isSigned?"llvmInt128":"llvmUInt128") << " " << NameSoFar;
- }
- }
- case Type::FloatTyID: return Out << "float " << NameSoFar;
- case Type::DoubleTyID: return Out << "double " << NameSoFar;
- // Lacking emulation of FP80 on PPC, etc., we assume whichever of these is
- // present matches host 'long double'.
- case Type::X86_FP80TyID:
- case Type::PPC_FP128TyID:
- case Type::FP128TyID: return Out << "long double " << NameSoFar;
-
- case Type::VectorTyID: {
- const VectorType *VTy = cast<VectorType>(Ty);
- return printSimpleType(Out, VTy->getElementType(), isSigned,
- " __attribute__((vector_size(" +
- utostr(TD->getABITypeSize(VTy)) + " ))) " + NameSoFar);
- }
-
- default:
- cerr << "Unknown primitive type: " << *Ty << "\n";
- abort();
- }
-}
-
-// Pass the Type* and the variable name and this prints out the variable
-// declaration.
-//
-std::ostream &CWriter::printType(std::ostream &Out, const Type *Ty,
- bool isSigned, const std::string &NameSoFar,
- bool IgnoreName, const PAListPtr &PAL) {
- if (Ty->isPrimitiveType() || Ty->isInteger() || isa<VectorType>(Ty)) {
- printSimpleType(Out, Ty, isSigned, NameSoFar);
- return Out;
- }
-
- // Check to see if the type is named.
- if (!IgnoreName || isa<OpaqueType>(Ty)) {
- std::map<const Type *, std::string>::iterator I = TypeNames.find(Ty);
- if (I != TypeNames.end()) return Out << I->second << ' ' << NameSoFar;
- }
-
- switch (Ty->getTypeID()) {
- case Type::FunctionTyID: {
- const FunctionType *FTy = cast<FunctionType>(Ty);
- std::stringstream FunctionInnards;
- FunctionInnards << " (" << NameSoFar << ") (";
- unsigned Idx = 1;
- for (FunctionType::param_iterator I = FTy->param_begin(),
- E = FTy->param_end(); I != E; ++I) {
- const Type *ArgTy = *I;
- if (PAL.paramHasAttr(Idx, ParamAttr::ByVal)) {
- assert(isa<PointerType>(ArgTy));
- ArgTy = cast<PointerType>(ArgTy)->getElementType();
- }
- if (I != FTy->param_begin())
- FunctionInnards << ", ";
- printType(FunctionInnards, ArgTy,
- /*isSigned=*/PAL.paramHasAttr(Idx, ParamAttr::SExt), "");
- ++Idx;
- }
- if (FTy->isVarArg()) {
- if (FTy->getNumParams())
- FunctionInnards << ", ...";
- } else if (!FTy->getNumParams()) {
- FunctionInnards << "void";
- }
- FunctionInnards << ')';
- std::string tstr = FunctionInnards.str();
- printType(Out, FTy->getReturnType(),
- /*isSigned=*/PAL.paramHasAttr(0, ParamAttr::SExt), tstr);
- return Out;
- }
- case Type::StructTyID: {
- const StructType *STy = cast<StructType>(Ty);
- Out << NameSoFar + " {\n";
- unsigned Idx = 0;
- for (StructType::element_iterator I = STy->element_begin(),
- E = STy->element_end(); I != E; ++I) {
- Out << " ";
- printType(Out, *I, false, "field" + utostr(Idx++));
- Out << ";\n";
- }
- Out << '}';
- if (STy->isPacked())
- Out << " __attribute__ ((packed))";
- return Out;
- }
-
- case Type::PointerTyID: {
- const PointerType *PTy = cast<PointerType>(Ty);
- std::string ptrName = "*" + NameSoFar;
-
- if (isa<ArrayType>(PTy->getElementType()) ||
- isa<VectorType>(PTy->getElementType()))
- ptrName = "(" + ptrName + ")";
-
- if (!PAL.isEmpty())
- // Must be a function ptr cast!
- return printType(Out, PTy->getElementType(), false, ptrName, true, PAL);
- return printType(Out, PTy->getElementType(), false, ptrName);
- }
-
- case Type::ArrayTyID: {
- const ArrayType *ATy = cast<ArrayType>(Ty);
- unsigned NumElements = ATy->getNumElements();
- if (NumElements == 0) NumElements = 1;
- return printType(Out, ATy->getElementType(), false,
- NameSoFar + "[" + utostr(NumElements) + "]");
- }
-
- case Type::OpaqueTyID: {
- static int Count = 0;
- std::string TyName = "struct opaque_" + itostr(Count++);
- assert(TypeNames.find(Ty) == TypeNames.end());
- TypeNames[Ty] = TyName;
- return Out << TyName << ' ' << NameSoFar;
- }
- default:
- assert(0 && "Unhandled case in getTypeProps!");
- abort();
- }
-
- return Out;
-}
-
-void CWriter::printConstantArray(ConstantArray *CPA) {
-
- // As a special case, print the array as a string if it is an array of
- // ubytes or an array of sbytes with positive values.
- //
- const Type *ETy = CPA->getType()->getElementType();
- bool isString = (ETy == Type::Int8Ty || ETy == Type::Int8Ty);
-
- // Make sure the last character is a null char, as automatically added by C
- if (isString && (CPA->getNumOperands() == 0 ||
- !cast<Constant>(*(CPA->op_end()-1))->isNullValue()))
- isString = false;
-
- if (isString) {
- Out << '\"';
- // Keep track of whether the last number was a hexadecimal escape
- bool LastWasHex = false;
-
- // Do not include the last character, which we know is null
- for (unsigned i = 0, e = CPA->getNumOperands()-1; i != e; ++i) {
- unsigned char C = cast<ConstantInt>(CPA->getOperand(i))->getZExtValue();
-
- // Print it out literally if it is a printable character. The only thing
- // to be careful about is when the last letter output was a hex escape
- // code, in which case we have to be careful not to print out hex digits
- // explicitly (the C compiler thinks it is a continuation of the previous
- // character, sheesh...)
- //
- if (isprint(C) && (!LastWasHex || !isxdigit(C))) {
- LastWasHex = false;
- if (C == '"' || C == '\\')
- Out << "\\" << C;
- else
- Out << C;
- } else {
- LastWasHex = false;
- switch (C) {
- case '\n': Out << "\\n"; break;
- case '\t': Out << "\\t"; break;
- case '\r': Out << "\\r"; break;
- case '\v': Out << "\\v"; break;
- case '\a': Out << "\\a"; break;
- case '\"': Out << "\\\""; break;
- case '\'': Out << "\\\'"; break;
- default:
- Out << "\\x";
- Out << (char)(( C/16 < 10) ? ( C/16 +'0') : ( C/16 -10+'A'));
- Out << (char)(((C&15) < 10) ? ((C&15)+'0') : ((C&15)-10+'A'));
- LastWasHex = true;
- break;
- }
- }
- }
- Out << '\"';
- } else {
- Out << '{';
- if (CPA->getNumOperands()) {
- Out << ' ';
- printConstant(cast<Constant>(CPA->getOperand(0)));
- for (unsigned i = 1, e = CPA->getNumOperands(); i != e; ++i) {
- Out << ", ";
- printConstant(cast<Constant>(CPA->getOperand(i)));
- }
- }
- Out << " }";
- }
-}
-
-void CWriter::printConstantVector(ConstantVector *CP) {
- Out << '{';
- if (CP->getNumOperands()) {
- Out << ' ';
- printConstant(cast<Constant>(CP->getOperand(0)));
- for (unsigned i = 1, e = CP->getNumOperands(); i != e; ++i) {
- Out << ", ";
- printConstant(cast<Constant>(CP->getOperand(i)));
- }
- }
- Out << " }";
-}
-
-// isFPCSafeToPrint - Returns true if we may assume that CFP may be written out
-// textually as a double (rather than as a reference to a stack-allocated
-// variable). We decide this by converting CFP to a string and back into a
-// double, and then checking whether the conversion results in a bit-equal
-// double to the original value of CFP. This depends on us and the target C
-// compiler agreeing on the conversion process (which is pretty likely since we
-// only deal in IEEE FP).
-//
-static bool isFPCSafeToPrint(const ConstantFP *CFP) {
- // Do long doubles in hex for now.
- if (CFP->getType()!=Type::FloatTy && CFP->getType()!=Type::DoubleTy)
- return false;
- APFloat APF = APFloat(CFP->getValueAPF()); // copy
- if (CFP->getType()==Type::FloatTy)
- APF.convert(APFloat::IEEEdouble, APFloat::rmNearestTiesToEven);
-#if HAVE_PRINTF_A && ENABLE_CBE_PRINTF_A
- char Buffer[100];
- sprintf(Buffer, "%a", APF.convertToDouble());
- if (!strncmp(Buffer, "0x", 2) ||
- !strncmp(Buffer, "-0x", 3) ||
- !strncmp(Buffer, "+0x", 3))
- return APF.bitwiseIsEqual(APFloat(atof(Buffer)));
- return false;
-#else
- std::string StrVal = ftostr(APF);
-
- while (StrVal[0] == ' ')
- StrVal.erase(StrVal.begin());
-
- // Check to make sure that the stringized number is not some string like "Inf"
- // or NaN. Check that the string matches the "[-+]?[0-9]" regex.
- if ((StrVal[0] >= '0' && StrVal[0] <= '9') ||
- ((StrVal[0] == '-' || StrVal[0] == '+') &&
- (StrVal[1] >= '0' && StrVal[1] <= '9')))
- // Reparse stringized version!
- return APF.bitwiseIsEqual(APFloat(atof(StrVal.c_str())));
- return false;
-#endif
-}
-
-/// Print out the casting for a cast operation. This does the double casting
-/// necessary for conversion to the destination type, if necessary.
-/// @brief Print a cast
-void CWriter::printCast(unsigned opc, const Type *SrcTy, const Type *DstTy) {
- // Print the destination type cast
- switch (opc) {
- case Instruction::UIToFP:
- case Instruction::SIToFP:
- case Instruction::IntToPtr:
- case Instruction::Trunc:
- case Instruction::BitCast:
- case Instruction::FPExt:
- case Instruction::FPTrunc: // For these the DstTy sign doesn't matter
- Out << '(';
- printType(Out, DstTy);
- Out << ')';
- break;
- case Instruction::ZExt:
- case Instruction::PtrToInt:
- case Instruction::FPToUI: // For these, make sure we get an unsigned dest
- Out << '(';
- printSimpleType(Out, DstTy, false);
- Out << ')';
- break;
- case Instruction::SExt:
- case Instruction::FPToSI: // For these, make sure we get a signed dest
- Out << '(';
- printSimpleType(Out, DstTy, true);
- Out << ')';
- break;
- default:
- assert(0 && "Invalid cast opcode");
- }
-
- // Print the source type cast
- switch (opc) {
- case Instruction::UIToFP:
- case Instruction::ZExt:
- Out << '(';
- printSimpleType(Out, SrcTy, false);
- Out << ')';
- break;
- case Instruction::SIToFP:
- case Instruction::SExt:
- Out << '(';
- printSimpleType(Out, SrcTy, true);
- Out << ')';
- break;
- case Instruction::IntToPtr:
- case Instruction::PtrToInt:
- // Avoid "cast to pointer from integer of different size" warnings
- Out << "(unsigned long)";
- break;
- case Instruction::Trunc:
- case Instruction::BitCast:
- case Instruction::FPExt:
- case Instruction::FPTrunc:
- case Instruction::FPToSI:
- case Instruction::FPToUI:
- break; // These don't need a source cast.
- default:
- assert(0 && "Invalid cast opcode");
- break;
- }
-}
-
-// printConstant - The LLVM Constant to C Constant converter.
-void CWriter::printConstant(Constant *CPV) {
- if (const ConstantExpr *CE = dyn_cast<ConstantExpr>(CPV)) {
- switch (CE->getOpcode()) {
- case Instruction::Trunc:
- case Instruction::ZExt:
- case Instruction::SExt:
- case Instruction::FPTrunc:
- case Instruction::FPExt:
- case Instruction::UIToFP:
- case Instruction::SIToFP:
- case Instruction::FPToUI:
- case Instruction::FPToSI:
- case Instruction::PtrToInt:
- case Instruction::IntToPtr:
- case Instruction::BitCast:
- Out << "(";
- printCast(CE->getOpcode(), CE->getOperand(0)->getType(), CE->getType());
- if (CE->getOpcode() == Instruction::SExt &&
- CE->getOperand(0)->getType() == Type::Int1Ty) {
- // Make sure we really sext from bool here by subtracting from 0
- Out << "0-";
- }
- printConstant(CE->getOperand(0));
- if (CE->getType() == Type::Int1Ty &&
- (CE->getOpcode() == Instruction::Trunc ||
- CE->getOpcode() == Instruction::FPToUI ||
- CE->getOpcode() == Instruction::FPToSI ||
- CE->getOpcode() == Instruction::PtrToInt)) {
- // Make sure we really truncate to bool here by anding with 1
- Out << "&1u";
- }
- Out << ')';
- return;
-
- case Instruction::GetElementPtr:
- Out << "(";
- printGEPExpression(CE->getOperand(0), gep_type_begin(CPV),
- gep_type_end(CPV));
- Out << ")";
- return;
- case Instruction::Select:
- Out << '(';
- printConstant(CE->getOperand(0));
- Out << '?';
- printConstant(CE->getOperand(1));
- Out << ':';
- printConstant(CE->getOperand(2));
- Out << ')';
- return;
- case Instruction::Add:
- case Instruction::Sub:
- case Instruction::Mul:
- case Instruction::SDiv:
- case Instruction::UDiv:
- case Instruction::FDiv:
- case Instruction::URem:
- case Instruction::SRem:
- case Instruction::FRem:
- case Instruction::And:
- case Instruction::Or:
- case Instruction::Xor:
- case Instruction::ICmp:
- case Instruction::Shl:
- case Instruction::LShr:
- case Instruction::AShr:
- {
- Out << '(';
- bool NeedsClosingParens = printConstExprCast(CE);
- printConstantWithCast(CE->getOperand(0), CE->getOpcode());
- switch (CE->getOpcode()) {
- case Instruction::Add: Out << " + "; break;
- case Instruction::Sub: Out << " - "; break;
- case Instruction::Mul: Out << " * "; break;
- case Instruction::URem:
- case Instruction::SRem:
- case Instruction::FRem: Out << " % "; break;
- case Instruction::UDiv:
- case Instruction::SDiv:
- case Instruction::FDiv: Out << " / "; break;
- case Instruction::And: Out << " & "; break;
- case Instruction::Or: Out << " | "; break;
- case Instruction::Xor: Out << " ^ "; break;
- case Instruction::Shl: Out << " << "; break;
- case Instruction::LShr:
- case Instruction::AShr: Out << " >> "; break;
- case Instruction::ICmp:
- switch (CE->getPredicate()) {
- case ICmpInst::ICMP_EQ: Out << " == "; break;
- case ICmpInst::ICMP_NE: Out << " != "; break;
- case ICmpInst::ICMP_SLT:
- case ICmpInst::ICMP_ULT: Out << " < "; break;
- case ICmpInst::ICMP_SLE:
- case ICmpInst::ICMP_ULE: Out << " <= "; break;
- case ICmpInst::ICMP_SGT:
- case ICmpInst::ICMP_UGT: Out << " > "; break;
- case ICmpInst::ICMP_SGE:
- case ICmpInst::ICMP_UGE: Out << " >= "; break;
- default: assert(0 && "Illegal ICmp predicate");
- }
- break;
- default: assert(0 && "Illegal opcode here!");
- }
- printConstantWithCast(CE->getOperand(1), CE->getOpcode());
- if (NeedsClosingParens)
- Out << "))";
- Out << ')';
- return;
- }
- case Instruction::FCmp: {
- Out << '(';
- bool NeedsClosingParens = printConstExprCast(CE);
- if (CE->getPredicate() == FCmpInst::FCMP_FALSE)
- Out << "0";
- else if (CE->getPredicate() == FCmpInst::FCMP_TRUE)
- Out << "1";
- else {
- const char* op = 0;
- switch (CE->getPredicate()) {
- default: assert(0 && "Illegal FCmp predicate");
- case FCmpInst::FCMP_ORD: op = "ord"; break;
- case FCmpInst::FCMP_UNO: op = "uno"; break;
- case FCmpInst::FCMP_UEQ: op = "ueq"; break;
- case FCmpInst::FCMP_UNE: op = "une"; break;
- case FCmpInst::FCMP_ULT: op = "ult"; break;
- case FCmpInst::FCMP_ULE: op = "ule"; break;
- case FCmpInst::FCMP_UGT: op = "ugt"; break;
- case FCmpInst::FCMP_UGE: op = "uge"; break;
- case FCmpInst::FCMP_OEQ: op = "oeq"; break;
- case FCmpInst::FCMP_ONE: op = "one"; break;
- case FCmpInst::FCMP_OLT: op = "olt"; break;
- case FCmpInst::FCMP_OLE: op = "ole"; break;
- case FCmpInst::FCMP_OGT: op = "ogt"; break;
- case FCmpInst::FCMP_OGE: op = "oge"; break;
- }
- Out << "llvm_fcmp_" << op << "(";
- printConstantWithCast(CE->getOperand(0), CE->getOpcode());
- Out << ", ";
- printConstantWithCast(CE->getOperand(1), CE->getOpcode());
- Out << ")";
- }
- if (NeedsClosingParens)
- Out << "))";
- Out << ')';
- return;
- }
- default:
- cerr << "CWriter Error: Unhandled constant expression: "
- << *CE << "\n";
- abort();
- }
- } else if (isa<UndefValue>(CPV) && CPV->getType()->isFirstClassType()) {
- Out << "((";
- printType(Out, CPV->getType()); // sign doesn't matter
- Out << ")/*UNDEF*/";
- if (!isa<VectorType>(CPV->getType())) {
- Out << "0)";
- } else {
- Out << "{})";
- }
- return;
- }
-
- if (ConstantInt *CI = dyn_cast<ConstantInt>(CPV)) {
- const Type* Ty = CI->getType();
- if (Ty == Type::Int1Ty)
- Out << (CI->getZExtValue() ? '1' : '0');
- else if (Ty == Type::Int32Ty)
- Out << CI->getZExtValue() << 'u';
- else if (Ty->getPrimitiveSizeInBits() > 32)
- Out << CI->getZExtValue() << "ull";
- else {
- Out << "((";
- printSimpleType(Out, Ty, false) << ')';
- if (CI->isMinValue(true))
- Out << CI->getZExtValue() << 'u';
- else
- Out << CI->getSExtValue();
- Out << ')';
- }
- return;
- }
-
- switch (CPV->getType()->getTypeID()) {
- case Type::FloatTyID:
- case Type::DoubleTyID:
- case Type::X86_FP80TyID:
- case Type::PPC_FP128TyID:
- case Type::FP128TyID: {
- ConstantFP *FPC = cast<ConstantFP>(CPV);
- std::map<const ConstantFP*, unsigned>::iterator I = FPConstantMap.find(FPC);
- if (I != FPConstantMap.end()) {
- // Because of FP precision problems we must load from a stack allocated
- // value that holds the value in hex.
- Out << "(*(" << (FPC->getType() == Type::FloatTy ? "float" :
- FPC->getType() == Type::DoubleTy ? "double" :
- "long double")
- << "*)&FPConstant" << I->second << ')';
- } else {
- assert(FPC->getType() == Type::FloatTy ||
- FPC->getType() == Type::DoubleTy);
- double V = FPC->getType() == Type::FloatTy ?
- FPC->getValueAPF().convertToFloat() :
- FPC->getValueAPF().convertToDouble();
- if (IsNAN(V)) {
- // The value is NaN
-
- // FIXME the actual NaN bits should be emitted.
- // The prefix for a quiet NaN is 0x7FF8. For a signalling NaN,
- // it's 0x7ff4.
- const unsigned long QuietNaN = 0x7ff8UL;
- //const unsigned long SignalNaN = 0x7ff4UL;
-
- // We need to grab the first part of the FP #
- char Buffer[100];
-
- uint64_t ll = DoubleToBits(V);
- sprintf(Buffer, "0x%llx", static_cast<long long>(ll));
-
- std::string Num(&Buffer[0], &Buffer[6]);
- unsigned long Val = strtoul(Num.c_str(), 0, 16);
-
- if (FPC->getType() == Type::FloatTy)
- Out << "LLVM_NAN" << (Val == QuietNaN ? "" : "S") << "F(\""
- << Buffer << "\") /*nan*/ ";
- else
- Out << "LLVM_NAN" << (Val == QuietNaN ? "" : "S") << "(\""
- << Buffer << "\") /*nan*/ ";
- } else if (IsInf(V)) {
- // The value is Inf
- if (V < 0) Out << '-';
- Out << "LLVM_INF" << (FPC->getType() == Type::FloatTy ? "F" : "")
- << " /*inf*/ ";
- } else {
- std::string Num;
-#if HAVE_PRINTF_A && ENABLE_CBE_PRINTF_A
- // Print out the constant as a floating point number.
- char Buffer[100];
- sprintf(Buffer, "%a", V);
- Num = Buffer;
-#else
- Num = ftostr(FPC->getValueAPF());
-#endif
- Out << Num;
- }
- }
- break;
- }
-
- case Type::ArrayTyID:
- if (ConstantArray *CA = dyn_cast<ConstantArray>(CPV)) {
- printConstantArray(CA);
- } else {
- assert(isa<ConstantAggregateZero>(CPV) || isa<UndefValue>(CPV));
- const ArrayType *AT = cast<ArrayType>(CPV->getType());
- Out << '{';
- if (AT->getNumElements()) {
- Out << ' ';
- Constant *CZ = Constant::getNullValue(AT->getElementType());
- printConstant(CZ);
- for (unsigned i = 1, e = AT->getNumElements(); i != e; ++i) {
- Out << ", ";
- printConstant(CZ);
- }
- }
- Out << " }";
- }
- break;
-
- case Type::VectorTyID:
- // Use C99 compound expression literal initializer syntax.
- Out << "(";
- printType(Out, CPV->getType());
- Out << ")";
- if (ConstantVector *CV = dyn_cast<ConstantVector>(CPV)) {
- printConstantVector(CV);
- } else {
- assert(isa<ConstantAggregateZero>(CPV) || isa<UndefValue>(CPV));
- const VectorType *VT = cast<VectorType>(CPV->getType());
- Out << "{ ";
- Constant *CZ = Constant::getNullValue(VT->getElementType());
- printConstant(CZ);
- for (unsigned i = 1, e = VT->getNumElements(); i != e; ++i) {
- Out << ", ";
- printConstant(CZ);
- }
- Out << " }";
- }
- break;
-
- case Type::StructTyID:
- if (isa<ConstantAggregateZero>(CPV) || isa<UndefValue>(CPV)) {
- const StructType *ST = cast<StructType>(CPV->getType());
- Out << '{';
- if (ST->getNumElements()) {
- Out << ' ';
- printConstant(Constant::getNullValue(ST->getElementType(0)));
- for (unsigned i = 1, e = ST->getNumElements(); i != e; ++i) {
- Out << ", ";
- printConstant(Constant::getNullValue(ST->getElementType(i)));
- }
- }
- Out << " }";
- } else {
- Out << '{';
- if (CPV->getNumOperands()) {
- Out << ' ';
- printConstant(cast<Constant>(CPV->getOperand(0)));
- for (unsigned i = 1, e = CPV->getNumOperands(); i != e; ++i) {
- Out << ", ";
- printConstant(cast<Constant>(CPV->getOperand(i)));
- }
- }
- Out << " }";
- }
- break;
-
- case Type::PointerTyID:
- if (isa<ConstantPointerNull>(CPV)) {
- Out << "((";
- printType(Out, CPV->getType()); // sign doesn't matter
- Out << ")/*NULL*/0)";
- break;
- } else if (GlobalValue *GV = dyn_cast<GlobalValue>(CPV)) {
- writeOperand(GV);
- break;
- }
- // FALL THROUGH
- default:
- cerr << "Unknown constant type: " << *CPV << "\n";
- abort();
- }
-}
-
-// Some constant expressions need to be casted back to the original types
-// because their operands were casted to the expected type. This function takes
-// care of detecting that case and printing the cast for the ConstantExpr.
-bool CWriter::printConstExprCast(const ConstantExpr* CE) {
- bool NeedsExplicitCast = false;
- const Type *Ty = CE->getOperand(0)->getType();
- bool TypeIsSigned = false;
- switch (CE->getOpcode()) {
- case Instruction::LShr:
- case Instruction::URem:
- case Instruction::UDiv: NeedsExplicitCast = true; break;
- case Instruction::AShr:
- case Instruction::SRem:
- case Instruction::SDiv: NeedsExplicitCast = true; TypeIsSigned = true; break;
- case Instruction::SExt:
- Ty = CE->getType();
- NeedsExplicitCast = true;
- TypeIsSigned = true;
- break;
- case Instruction::ZExt:
- case Instruction::Trunc:
- case Instruction::FPTrunc:
- case Instruction::FPExt:
- case Instruction::UIToFP:
- case Instruction::SIToFP:
- case Instruction::FPToUI:
- case Instruction::FPToSI:
- case Instruction::PtrToInt:
- case Instruction::IntToPtr:
- case Instruction::BitCast:
- Ty = CE->getType();
- NeedsExplicitCast = true;
- break;
- default: break;
- }
- if (NeedsExplicitCast) {
- Out << "((";
- if (Ty->isInteger() && Ty != Type::Int1Ty)
- printSimpleType(Out, Ty, TypeIsSigned);
- else
- printType(Out, Ty); // not integer, sign doesn't matter
- Out << ")(";
- }
- return NeedsExplicitCast;
-}
-
-// Print a constant assuming that it is the operand for a given Opcode. The
-// opcodes that care about sign need to cast their operands to the expected
-// type before the operation proceeds. This function does the casting.
-void CWriter::printConstantWithCast(Constant* CPV, unsigned Opcode) {
-
- // Extract the operand's type, we'll need it.
- const Type* OpTy = CPV->getType();
-
- // Indicate whether to do the cast or not.
- bool shouldCast = false;
- bool typeIsSigned = false;
-
- // Based on the Opcode for which this Constant is being written, determine
- // the new type to which the operand should be casted by setting the value
- // of OpTy. If we change OpTy, also set shouldCast to true so it gets
- // casted below.
- switch (Opcode) {
- default:
- // for most instructions, it doesn't matter
- break;
- case Instruction::LShr:
- case Instruction::UDiv:
- case Instruction::URem:
- shouldCast = true;
- break;
- case Instruction::AShr:
- case Instruction::SDiv:
- case Instruction::SRem:
- shouldCast = true;
- typeIsSigned = true;
- break;
- }
-
- // Write out the casted constant if we should, otherwise just write the
- // operand.
- if (shouldCast) {
- Out << "((";
- printSimpleType(Out, OpTy, typeIsSigned);
- Out << ")";
- printConstant(CPV);
- Out << ")";
- } else
- printConstant(CPV);
-}
-
-std::string CWriter::GetValueName(const Value *Operand) {
- std::string Name;
-
- if (!isa<GlobalValue>(Operand) && Operand->getName() != "") {
- std::string VarName;
-
- Name = Operand->getName();
- VarName.reserve(Name.capacity());
-
- for (std::string::iterator I = Name.begin(), E = Name.end();
- I != E; ++I) {
- char ch = *I;
-
- if (!((ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z') ||
- (ch >= '0' && ch <= '9') || ch == '_')) {
- char buffer[5];
- sprintf(buffer, "_%x_", ch);
- VarName += buffer;
- } else
- VarName += ch;
- }
-
- Name = "llvm_cbe_" + VarName;
- } else {
- Name = Mang->getValueName(Operand);
- }
-
- return Name;
-}
-
-/// writeInstComputationInline - Emit the computation for the specified
-/// instruction inline, with no destination provided.
-void CWriter::writeInstComputationInline(Instruction &I) {
- // If this is a non-trivial bool computation, make sure to truncate down to
- // a 1 bit value. This is important because we want "add i1 x, y" to return
- // "0" when x and y are true, not "2" for example.
- bool NeedBoolTrunc = false;
- if (I.getType() == Type::Int1Ty && !isa<ICmpInst>(I) && !isa<FCmpInst>(I))
- NeedBoolTrunc = true;
-
- if (NeedBoolTrunc)
- Out << "((";
-
- visit(I);
-
- if (NeedBoolTrunc)
- Out << ")&1)";
-}
-
-
-void CWriter::writeOperandInternal(Value *Operand) {
- if (Instruction *I = dyn_cast<Instruction>(Operand))
- // Should we inline this instruction to build a tree?
- if (isInlinableInst(*I) && !isDirectAlloca(I)) {
- Out << '(';
- writeInstComputationInline(*I);
- Out << ')';
- return;
- }
-
- Constant* CPV = dyn_cast<Constant>(Operand);
-
- if (CPV && !isa<GlobalValue>(CPV))
- printConstant(CPV);
- else
- Out << GetValueName(Operand);
-}
-
-void CWriter::writeOperandRaw(Value *Operand) {
- Constant* CPV = dyn_cast<Constant>(Operand);
- if (CPV && !isa<GlobalValue>(CPV)) {
- printConstant(CPV);
- } else {
- Out << GetValueName(Operand);
- }
-}
-
-void CWriter::writeOperand(Value *Operand) {
- bool isAddressImplicit = isAddressExposed(Operand);
- if (isAddressImplicit)
- Out << "(&"; // Global variables are referenced as their addresses by llvm
-
- writeOperandInternal(Operand);
-
- if (isAddressImplicit)
- Out << ')';
-}
-
-// Some instructions need to have their result value casted back to the
-// original types because their operands were casted to the expected type.
-// This function takes care of detecting that case and printing the cast
-// for the Instruction.
-bool CWriter::writeInstructionCast(const Instruction &I) {
- const Type *Ty = I.getOperand(0)->getType();
- switch (I.getOpcode()) {
- case Instruction::LShr:
- case Instruction::URem:
- case Instruction::UDiv:
- Out << "((";
- printSimpleType(Out, Ty, false);
- Out << ")(";
- return true;
- case Instruction::AShr:
- case Instruction::SRem:
- case Instruction::SDiv:
- Out << "((";
- printSimpleType(Out, Ty, true);
- Out << ")(";
- return true;
- default: break;
- }
- return false;
-}
-
-// Write the operand with a cast to another type based on the Opcode being used.
-// This will be used in cases where an instruction has specific type
-// requirements (usually signedness) for its operands.
-void CWriter::writeOperandWithCast(Value* Operand, unsigned Opcode) {
-
- // Extract the operand's type, we'll need it.
- const Type* OpTy = Operand->getType();
-
- // Indicate whether to do the cast or not.
- bool shouldCast = false;
-
- // Indicate whether the cast should be to a signed type or not.
- bool castIsSigned = false;
-
- // Based on the Opcode for which this Operand is being written, determine
- // the new type to which the operand should be casted by setting the value
- // of OpTy. If we change OpTy, also set shouldCast to true.
- switch (Opcode) {
- default:
- // for most instructions, it doesn't matter
- break;
- case Instruction::LShr:
- case Instruction::UDiv:
- case Instruction::URem: // Cast to unsigned first
- shouldCast = true;
- castIsSigned = false;
- break;
- case Instruction::GetElementPtr:
- case Instruction::AShr:
- case Instruction::SDiv:
- case Instruction::SRem: // Cast to signed first
- shouldCast = true;
- castIsSigned = true;
- break;
- }
-
- // Write out the casted operand if we should, otherwise just write the
- // operand.
- if (shouldCast) {
- Out << "((";
- printSimpleType(Out, OpTy, castIsSigned);
- Out << ")";
- writeOperand(Operand);
- Out << ")";
- } else
- writeOperand(Operand);
-}
-
-// Write the operand with a cast to another type based on the icmp predicate
-// being used.
-void CWriter::writeOperandWithCast(Value* Operand, const ICmpInst &Cmp) {
- // This has to do a cast to ensure the operand has the right signedness.
- // Also, if the operand is a pointer, we make sure to cast to an integer when
- // doing the comparison both for signedness and so that the C compiler doesn't
- // optimize things like "p < NULL" to false (p may contain an integer value
- // f.e.).
- bool shouldCast = Cmp.isRelational();
-
- // Write out the casted operand if we should, otherwise just write the
- // operand.
- if (!shouldCast) {
- writeOperand(Operand);
- return;
- }
-
- // Should this be a signed comparison? If so, convert to signed.
- bool castIsSigned = Cmp.isSignedPredicate();
-
- // If the operand was a pointer, convert to a large integer type.
- const Type* OpTy = Operand->getType();
- if (isa<PointerType>(OpTy))
- OpTy = TD->getIntPtrType();
-
- Out << "((";
- printSimpleType(Out, OpTy, castIsSigned);
- Out << ")";
- writeOperand(Operand);
- Out << ")";
-}
-
-// generateCompilerSpecificCode - This is where we add conditional compilation
-// directives to cater to specific compilers as need be.
-//
-static void generateCompilerSpecificCode(std::ostream& Out,
- const TargetData *TD) {
- // Alloca is hard to get, and we don't want to include stdlib.h here.
- Out << "/* get a declaration for alloca */\n"
- << "#if defined(__CYGWIN__) || defined(__MINGW32__)\n"
- << "#define alloca(x) __builtin_alloca((x))\n"
- << "#define _alloca(x) __builtin_alloca((x))\n"
- << "#elif defined(__APPLE__)\n"
- << "extern void *__builtin_alloca(unsigned long);\n"
- << "#define alloca(x) __builtin_alloca(x)\n"
- << "#define longjmp _longjmp\n"
- << "#define setjmp _setjmp\n"
- << "#elif defined(__sun__)\n"
- << "#if defined(__sparcv9)\n"
- << "extern void *__builtin_alloca(unsigned long);\n"
- << "#else\n"
- << "extern void *__builtin_alloca(unsigned int);\n"
- << "#endif\n"
- << "#define alloca(x) __builtin_alloca(x)\n"
- << "#elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)\n"
- << "#define alloca(x) __builtin_alloca(x)\n"
- << "#elif defined(_MSC_VER)\n"
- << "#define inline _inline\n"
- << "#define alloca(x) _alloca(x)\n"
- << "#else\n"
- << "#include <alloca.h>\n"
- << "#endif\n\n";
-
- // We output GCC specific attributes to preserve 'linkonce'ness on globals.
- // If we aren't being compiled with GCC, just drop these attributes.
- Out << "#ifndef __GNUC__ /* Can only support \"linkonce\" vars with GCC */\n"
- << "#define __attribute__(X)\n"
- << "#endif\n\n";
-
- // On Mac OS X, "external weak" is spelled "__attribute__((weak_import))".
- Out << "#if defined(__GNUC__) && defined(__APPLE_CC__)\n"
- << "#define __EXTERNAL_WEAK__ __attribute__((weak_import))\n"
- << "#elif defined(__GNUC__)\n"
- << "#define __EXTERNAL_WEAK__ __attribute__((weak))\n"
- << "#else\n"
- << "#define __EXTERNAL_WEAK__\n"
- << "#endif\n\n";
-
- // For now, turn off the weak linkage attribute on Mac OS X. (See above.)
- Out << "#if defined(__GNUC__) && defined(__APPLE_CC__)\n"
- << "#define __ATTRIBUTE_WEAK__\n"
- << "#elif defined(__GNUC__)\n"
- << "#define __ATTRIBUTE_WEAK__ __attribute__((weak))\n"
- << "#else\n"
- << "#define __ATTRIBUTE_WEAK__\n"
- << "#endif\n\n";
-
- // Add hidden visibility support. FIXME: APPLE_CC?
- Out << "#if defined(__GNUC__)\n"
- << "#define __HIDDEN__ __attribute__((visibility(\"hidden\")))\n"
- << "#endif\n\n";
-
- // Define NaN and Inf as GCC builtins if using GCC, as 0 otherwise
- // From the GCC documentation:
- //
- // double __builtin_nan (const char *str)
- //
- // This is an implementation of the ISO C99 function nan.
- //
- // Since ISO C99 defines this function in terms of strtod, which we do
- // not implement, a description of the parsing is in order. The string is
- // parsed as by strtol; that is, the base is recognized by leading 0 or
- // 0x prefixes. The number parsed is placed in the significand such that
- // the least significant bit of the number is at the least significant
- // bit of the significand. The number is truncated to fit the significand
- // field provided. The significand is forced to be a quiet NaN.
- //
- // This function, if given a string literal, is evaluated early enough
- // that it is considered a compile-time constant.
- //
- // float __builtin_nanf (const char *str)
- //
- // Similar to __builtin_nan, except the return type is float.
- //
- // double __builtin_inf (void)
- //
- // Similar to __builtin_huge_val, except a warning is generated if the
- // target floating-point format does not support infinities. This
- // function is suitable for implementing the ISO C99 macro INFINITY.
- //
- // float __builtin_inff (void)
- //
- // Similar to __builtin_inf, except the return type is float.
- Out << "#ifdef __GNUC__\n"
- << "#define LLVM_NAN(NanStr) __builtin_nan(NanStr) /* Double */\n"
- << "#define LLVM_NANF(NanStr) __builtin_nanf(NanStr) /* Float */\n"
- << "#define LLVM_NANS(NanStr) __builtin_nans(NanStr) /* Double */\n"
- << "#define LLVM_NANSF(NanStr) __builtin_nansf(NanStr) /* Float */\n"
- << "#define LLVM_INF __builtin_inf() /* Double */\n"
- << "#define LLVM_INFF __builtin_inff() /* Float */\n"
- << "#define LLVM_PREFETCH(addr,rw,locality) "
- "__builtin_prefetch(addr,rw,locality)\n"
- << "#define __ATTRIBUTE_CTOR__ __attribute__((constructor))\n"
- << "#define __ATTRIBUTE_DTOR__ __attribute__((destructor))\n"
- << "#define LLVM_ASM __asm__\n"
- << "#else\n"
- << "#define LLVM_NAN(NanStr) ((double)0.0) /* Double */\n"
- << "#define LLVM_NANF(NanStr) 0.0F /* Float */\n"
- << "#define LLVM_NANS(NanStr) ((double)0.0) /* Double */\n"
- << "#define LLVM_NANSF(NanStr) 0.0F /* Float */\n"
- << "#define LLVM_INF ((double)0.0) /* Double */\n"
- << "#define LLVM_INFF 0.0F /* Float */\n"
- << "#define LLVM_PREFETCH(addr,rw,locality) /* PREFETCH */\n"
- << "#define __ATTRIBUTE_CTOR__\n"
- << "#define __ATTRIBUTE_DTOR__\n"
- << "#define LLVM_ASM(X)\n"
- << "#endif\n\n";
-
- Out << "#if __GNUC__ < 4 /* Old GCC's, or compilers not GCC */ \n"
- << "#define __builtin_stack_save() 0 /* not implemented */\n"
- << "#define __builtin_stack_restore(X) /* noop */\n"
- << "#endif\n\n";
-
- // Output typedefs for 128-bit integers. If these are needed with a
- // 32-bit target or with a C compiler that doesn't support mode(TI),
- // more drastic measures will be needed.
- if (TD->getPointerSize() >= 8) {
- Out << "#ifdef __GNUC__ /* 128-bit integer types */\n"
- << "typedef int __attribute__((mode(TI))) llvmInt128;\n"
- << "typedef unsigned __attribute__((mode(TI))) llvmUInt128;\n"
- << "#endif\n\n";
- }
-
- // Output target-specific code that should be inserted into main.
- Out << "#define CODE_FOR_MAIN() /* Any target-specific code for main()*/\n";
-}
-
-/// FindStaticTors - Given a static ctor/dtor list, unpack its contents into
-/// the StaticTors set.
-static void FindStaticTors(GlobalVariable *GV, std::set<Function*> &StaticTors){
- ConstantArray *InitList = dyn_cast<ConstantArray>(GV->getInitializer());
- if (!InitList) return;
-
- for (unsigned i = 0, e = InitList->getNumOperands(); i != e; ++i)
- if (ConstantStruct *CS = dyn_cast<ConstantStruct>(InitList->getOperand(i))){
- if (CS->getNumOperands() != 2) return; // Not array of 2-element structs.
-
- if (CS->getOperand(1)->isNullValue())
- return; // Found a null terminator, exit printing.
- Constant *FP = CS->getOperand(1);
- if (ConstantExpr *CE = dyn_cast<ConstantExpr>(FP))
- if (CE->isCast())
- FP = CE->getOperand(0);
- if (Function *F = dyn_cast<Function>(FP))
- StaticTors.insert(F);
- }
-}
-
-enum SpecialGlobalClass {
- NotSpecial = 0,
- GlobalCtors, GlobalDtors,
- NotPrinted
-};
-
-/// getGlobalVariableClass - If this is a global that is specially recognized
-/// by LLVM, return a code that indicates how we should handle it.
-static SpecialGlobalClass getGlobalVariableClass(const GlobalVariable *GV) {
- // If this is a global ctors/dtors list, handle it now.
- if (GV->hasAppendingLinkage() && GV->use_empty()) {
- if (GV->getName() == "llvm.global_ctors")
- return GlobalCtors;
- else if (GV->getName() == "llvm.global_dtors")
- return GlobalDtors;
- }
-
- // Otherwise, it it is other metadata, don't print it. This catches things
- // like debug information.
- if (GV->getSection() == "llvm.metadata")
- return NotPrinted;
-
- return NotSpecial;
-}
-
-
-bool CWriter::doInitialization(Module &M) {
- // Initialize
- TheModule = &M;
-
- TD = new TargetData(&M);
- IL = new IntrinsicLowering(*TD);
- IL->AddPrototypes(M);
-
- // Ensure that all structure types have names...
- Mang = new Mangler(M);
- Mang->markCharUnacceptable('.');
-
- // Keep track of which functions are static ctors/dtors so they can have
- // an attribute added to their prototypes.
- std::set<Function*> StaticCtors, StaticDtors;
- for (Module::global_iterator I = M.global_begin(), E = M.global_end();
- I != E; ++I) {
- switch (getGlobalVariableClass(I)) {
- default: break;
- case GlobalCtors:
- FindStaticTors(I, StaticCtors);
- break;
- case GlobalDtors:
- FindStaticTors(I, StaticDtors);
- break;
- }
- }
-
- // get declaration for alloca
- Out << "/* Provide Declarations */\n";
- Out << "#include <stdarg.h>\n"; // Varargs support
- Out << "#include <setjmp.h>\n"; // Unwind support
- generateCompilerSpecificCode(Out, TD);
-
- // Provide a definition for `bool' if not compiling with a C++ compiler.
- Out << "\n"
- << "#ifndef __cplusplus\ntypedef unsigned char bool;\n#endif\n"
-
- << "\n\n/* Support for floating point constants */\n"
- << "typedef unsigned long long ConstantDoubleTy;\n"
- << "typedef unsigned int ConstantFloatTy;\n"
- << "typedef struct { unsigned long long f1; unsigned short f2; "
- "unsigned short pad[3]; } ConstantFP80Ty;\n"
- // This is used for both kinds of 128-bit long double; meaning differs.
- << "typedef struct { unsigned long long f1; unsigned long long f2; }"
- " ConstantFP128Ty;\n"
- << "\n\n/* Global Declarations */\n";
-
- // First output all the declarations for the program, because C requires
- // Functions & globals to be declared before they are used.
- //
-
- // Loop over the symbol table, emitting all named constants...
- printModuleTypes(M.getTypeSymbolTable());
-
- // Global variable declarations...
- if (!M.global_empty()) {
- Out << "\n/* External Global Variable Declarations */\n";
- for (Module::global_iterator I = M.global_begin(), E = M.global_end();
- I != E; ++I) {
-
- if (I->hasExternalLinkage() || I->hasExternalWeakLinkage())
- Out << "extern ";
- else if (I->hasDLLImportLinkage())
- Out << "__declspec(dllimport) ";
- else
- continue; // Internal Global
-
- // Thread Local Storage
- if (I->isThreadLocal())
- Out << "__thread ";
-
- printType(Out, I->getType()->getElementType(), false, GetValueName(I));
-
- if (I->hasExternalWeakLinkage())
- Out << " __EXTERNAL_WEAK__";
- Out << ";\n";
- }
- }
-
- // Function declarations
- Out << "\n/* Function Declarations */\n";
- Out << "double fmod(double, double);\n"; // Support for FP rem
- Out << "float fmodf(float, float);\n";
- Out << "long double fmodl(long double, long double);\n";
-
- for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I) {
- // Don't print declarations for intrinsic functions.
- if (!I->isIntrinsic() && I->getName() != "setjmp" &&
- I->getName() != "longjmp" && I->getName() != "_setjmp") {
- if (I->hasExternalWeakLinkage())
- Out << "extern ";
- printFunctionSignature(I, true);
- if (I->hasWeakLinkage() || I->hasLinkOnceLinkage())
- Out << " __ATTRIBUTE_WEAK__";
- if (I->hasExternalWeakLinkage())
- Out << " __EXTERNAL_WEAK__";
- if (StaticCtors.count(I))
- Out << " __ATTRIBUTE_CTOR__";
- if (StaticDtors.count(I))
- Out << " __ATTRIBUTE_DTOR__";
- if (I->hasHiddenVisibility())
- Out << " __HIDDEN__";
-
- if (I->hasName() && I->getName()[0] == 1)
- Out << " LLVM_ASM(\"" << I->getName().c_str()+1 << "\")";
-
- Out << ";\n";
- }
- }
-
- // Output the global variable declarations
- if (!M.global_empty()) {
- Out << "\n\n/* Global Variable Declarations */\n";
- for (Module::global_iterator I = M.global_begin(), E = M.global_end();
- I != E; ++I)
- if (!I->isDeclaration()) {
- // Ignore special globals, such as debug info.
- if (getGlobalVariableClass(I))
- continue;
-
- if (I->hasInternalLinkage())
- Out << "static ";
- else
- Out << "extern ";
-
- // Thread Local Storage
- if (I->isThreadLocal())
- Out << "__thread ";
-
- printType(Out, I->getType()->getElementType(), false,
- GetValueName(I));
-
- if (I->hasLinkOnceLinkage())
- Out << " __attribute__((common))";
- else if (I->hasWeakLinkage())
- Out << " __ATTRIBUTE_WEAK__";
- else if (I->hasExternalWeakLinkage())
- Out << " __EXTERNAL_WEAK__";
- if (I->hasHiddenVisibility())
- Out << " __HIDDEN__";
- Out << ";\n";
- }
- }
-
- // Output the global variable definitions and contents...
- if (!M.global_empty()) {
- Out << "\n\n/* Global Variable Definitions and Initialization */\n";
- for (Module::global_iterator I = M.global_begin(), E = M.global_end();
- I != E; ++I)
- if (!I->isDeclaration()) {
- // Ignore special globals, such as debug info.
- if (getGlobalVariableClass(I))
- continue;
-
- if (I->hasInternalLinkage())
- Out << "static ";
- else if (I->hasDLLImportLinkage())
- Out << "__declspec(dllimport) ";
- else if (I->hasDLLExportLinkage())
- Out << "__declspec(dllexport) ";
-
- // Thread Local Storage
- if (I->isThreadLocal())
- Out << "__thread ";
-
- printType(Out, I->getType()->getElementType(), false,
- GetValueName(I));
- if (I->hasLinkOnceLinkage())
- Out << " __attribute__((common))";
- else if (I->hasWeakLinkage())
- Out << " __ATTRIBUTE_WEAK__";
-
- if (I->hasHiddenVisibility())
- Out << " __HIDDEN__";
-
- // If the initializer is not null, emit the initializer. If it is null,
- // we try to avoid emitting large amounts of zeros. The problem with
- // this, however, occurs when the variable has weak linkage. In this
- // case, the assembler will complain about the variable being both weak
- // and common, so we disable this optimization.
- if (!I->getInitializer()->isNullValue()) {
- Out << " = " ;
- writeOperand(I->getInitializer());
- } else if (I->hasWeakLinkage()) {
- // We have to specify an initializer, but it doesn't have to be
- // complete. If the value is an aggregate, print out { 0 }, and let
- // the compiler figure out the rest of the zeros.
- Out << " = " ;
- if (isa<StructType>(I->getInitializer()->getType()) ||
- isa<ArrayType>(I->getInitializer()->getType()) ||
- isa<VectorType>(I->getInitializer()->getType())) {
- Out << "{ 0 }";
- } else {
- // Just print it out normally.
- writeOperand(I->getInitializer());
- }
- }
- Out << ";\n";
- }
- }
-
- if (!M.empty())
- Out << "\n\n/* Function Bodies */\n";
-
- // Emit some helper functions for dealing with FCMP instruction's
- // predicates
- Out << "static inline int llvm_fcmp_ord(double X, double Y) { ";
- Out << "return X == X && Y == Y; }\n";
- Out << "static inline int llvm_fcmp_uno(double X, double Y) { ";
- Out << "return X != X || Y != Y; }\n";
- Out << "static inline int llvm_fcmp_ueq(double X, double Y) { ";
- Out << "return X == Y || llvm_fcmp_uno(X, Y); }\n";
- Out << "static inline int llvm_fcmp_une(double X, double Y) { ";
- Out << "return X != Y; }\n";
- Out << "static inline int llvm_fcmp_ult(double X, double Y) { ";
- Out << "return X < Y || llvm_fcmp_uno(X, Y); }\n";
- Out << "static inline int llvm_fcmp_ugt(double X, double Y) { ";
- Out << "return X > Y || llvm_fcmp_uno(X, Y); }\n";
- Out << "static inline int llvm_fcmp_ule(double X, double Y) { ";
- Out << "return X <= Y || llvm_fcmp_uno(X, Y); }\n";
- Out << "static inline int llvm_fcmp_uge(double X, double Y) { ";
- Out << "return X >= Y || llvm_fcmp_uno(X, Y); }\n";
- Out << "static inline int llvm_fcmp_oeq(double X, double Y) { ";
- Out << "return X == Y ; }\n";
- Out << "static inline int llvm_fcmp_one(double X, double Y) { ";
- Out << "return X != Y && llvm_fcmp_ord(X, Y); }\n";
- Out << "static inline int llvm_fcmp_olt(double X, double Y) { ";
- Out << "return X < Y ; }\n";
- Out << "static inline int llvm_fcmp_ogt(double X, double Y) { ";
- Out << "return X > Y ; }\n";
- Out << "static inline int llvm_fcmp_ole(double X, double Y) { ";
- Out << "return X <= Y ; }\n";
- Out << "static inline int llvm_fcmp_oge(double X, double Y) { ";
- Out << "return X >= Y ; }\n";
- return false;
-}
-
-
-/// Output all floating point constants that cannot be printed accurately...
-void CWriter::printFloatingPointConstants(Function &F) {
- // Scan the module for floating point constants. If any FP constant is used
- // in the function, we want to redirect it here so that we do not depend on
- // the precision of the printed form, unless the printed form preserves
- // precision.
- //
- static unsigned FPCounter = 0;
- for (constant_iterator I = constant_begin(&F), E = constant_end(&F);
- I != E; ++I)
- if (const ConstantFP *FPC = dyn_cast<ConstantFP>(*I))
- if (!isFPCSafeToPrint(FPC) && // Do not put in FPConstantMap if safe.
- !FPConstantMap.count(FPC)) {
- FPConstantMap[FPC] = FPCounter; // Number the FP constants
-
- if (FPC->getType() == Type::DoubleTy) {
- double Val = FPC->getValueAPF().convertToDouble();
- uint64_t i = FPC->getValueAPF().convertToAPInt().getZExtValue();
- Out << "static const ConstantDoubleTy FPConstant" << FPCounter++
- << " = 0x" << std::hex << i << std::dec
- << "ULL; /* " << Val << " */\n";
- } else if (FPC->getType() == Type::FloatTy) {
- float Val = FPC->getValueAPF().convertToFloat();
- uint32_t i = (uint32_t)FPC->getValueAPF().convertToAPInt().
- getZExtValue();
- Out << "static const ConstantFloatTy FPConstant" << FPCounter++
- << " = 0x" << std::hex << i << std::dec
- << "U; /* " << Val << " */\n";
- } else if (FPC->getType() == Type::X86_FP80Ty) {
- // api needed to prevent premature destruction
- APInt api = FPC->getValueAPF().convertToAPInt();
- const uint64_t *p = api.getRawData();
- Out << "static const ConstantFP80Ty FPConstant" << FPCounter++
- << " = { 0x" << std::hex
- << ((uint16_t)p[1] | (p[0] & 0xffffffffffffLL)<<16)
- << ", 0x" << (uint16_t)(p[0] >> 48) << ",0,0,0"
- << "}; /* Long double constant */\n" << std::dec;
- } else if (FPC->getType() == Type::PPC_FP128Ty) {
- APInt api = FPC->getValueAPF().convertToAPInt();
- const uint64_t *p = api.getRawData();
- Out << "static const ConstantFP128Ty FPConstant" << FPCounter++
- << " = { 0x" << std::hex
- << p[0] << ", 0x" << p[1]
- << "}; /* Long double constant */\n" << std::dec;
-
- } else
- assert(0 && "Unknown float type!");
- }
-
- Out << '\n';
-}
-
-
-/// printSymbolTable - Run through symbol table looking for type names. If a
-/// type name is found, emit its declaration...
-///
-void CWriter::printModuleTypes(const TypeSymbolTable &TST) {
- Out << "/* Helper union for bitcasts */\n";
- Out << "typedef union {\n";
- Out << " unsigned int Int32;\n";
- Out << " unsigned long long Int64;\n";
- Out << " float Float;\n";
- Out << " double Double;\n";
- Out << "} llvmBitCastUnion;\n";
-
- // We are only interested in the type plane of the symbol table.
- TypeSymbolTable::const_iterator I = TST.begin();
- TypeSymbolTable::const_iterator End = TST.end();
-
- // If there are no type names, exit early.
- if (I == End) return;
-
- // Print out forward declarations for structure types before anything else!
- Out << "/* Structure forward decls */\n";
- for (; I != End; ++I) {
- std::string Name = "struct l_" + Mang->makeNameProper(I->first);
- Out << Name << ";\n";
- TypeNames.insert(std::make_pair(I->second, Name));
- }
-
- Out << '\n';
-
- // Now we can print out typedefs. Above, we guaranteed that this can only be
- // for struct or opaque types.
- Out << "/* Typedefs */\n";
- for (I = TST.begin(); I != End; ++I) {
- std::string Name = "l_" + Mang->makeNameProper(I->first);
- Out << "typedef ";
- printType(Out, I->second, false, Name);
- Out << ";\n";
- }
-
- Out << '\n';
-
- // Keep track of which structures have been printed so far...
- std::set<const StructType *> StructPrinted;
-
- // Loop over all structures then push them into the stack so they are
- // printed in the correct order.
- //
- Out << "/* Structure contents */\n";
- for (I = TST.begin(); I != End; ++I)
- if (const StructType *STy = dyn_cast<StructType>(I->second))
- // Only print out used types!
- printContainedStructs(STy, StructPrinted);
-}
-
-// Push the struct onto the stack and recursively push all structs
-// this one depends on.
-//
-// TODO: Make this work properly with vector types
-//
-void CWriter::printContainedStructs(const Type *Ty,
- std::set<const StructType*> &StructPrinted){
- // Don't walk through pointers.
- if (isa<PointerType>(Ty) || Ty->isPrimitiveType() || Ty->isInteger()) return;
-
- // Print all contained types first.
- for (Type::subtype_iterator I = Ty->subtype_begin(),
- E = Ty->subtype_end(); I != E; ++I)
- printContainedStructs(*I, StructPrinted);
-
- if (const StructType *STy = dyn_cast<StructType>(Ty)) {
- // Check to see if we have already printed this struct.
- if (StructPrinted.insert(STy).second) {
- // Print structure type out.
- std::string Name = TypeNames[STy];
- printType(Out, STy, false, Name, true);
- Out << ";\n\n";
- }
- }
-}
-
-void CWriter::printFunctionSignature(const Function *F, bool Prototype) {
- /// isStructReturn - Should this function actually return a struct by-value?
- bool isStructReturn = F->hasStructRetAttr();
-
- if (F->hasInternalLinkage()) Out << "static ";
- if (F->hasDLLImportLinkage()) Out << "__declspec(dllimport) ";
- if (F->hasDLLExportLinkage()) Out << "__declspec(dllexport) ";
- switch (F->getCallingConv()) {
- case CallingConv::X86_StdCall:
- Out << "__stdcall ";
- break;
- case CallingConv::X86_FastCall:
- Out << "__fastcall ";
- break;
- }
-
- // Loop over the arguments, printing them...
- const FunctionType *FT = cast<FunctionType>(F->getFunctionType());
- const PAListPtr &PAL = F->getParamAttrs();
-
- std::stringstream FunctionInnards;
-
- // Print out the name...
- FunctionInnards << GetValueName(F) << '(';
-
- bool PrintedArg = false;
- if (!F->isDeclaration()) {
- if (!F->arg_empty()) {
- Function::const_arg_iterator I = F->arg_begin(), E = F->arg_end();
- unsigned Idx = 1;
-
- // If this is a struct-return function, don't print the hidden
- // struct-return argument.
- if (isStructReturn) {
- assert(I != E && "Invalid struct return function!");
- ++I;
- ++Idx;
- }
-
- std::string ArgName;
- for (; I != E; ++I) {
- if (PrintedArg) FunctionInnards << ", ";
- if (I->hasName() || !Prototype)
- ArgName = GetValueName(I);
- else
- ArgName = "";
- const Type *ArgTy = I->getType();
- if (PAL.paramHasAttr(Idx, ParamAttr::ByVal)) {
- ArgTy = cast<PointerType>(ArgTy)->getElementType();
- ByValParams.insert(I);
- }
- printType(FunctionInnards, ArgTy,
- /*isSigned=*/PAL.paramHasAttr(Idx, ParamAttr::SExt),
- ArgName);
- PrintedArg = true;
- ++Idx;
- }
- }
- } else {
- // Loop over the arguments, printing them.
- FunctionType::param_iterator I = FT->param_begin(), E = FT->param_end();
- unsigned Idx = 1;
-
- // If this is a struct-return function, don't print the hidden
- // struct-return argument.
- if (isStructReturn) {
- assert(I != E && "Invalid struct return function!");
- ++I;
- ++Idx;
- }
-
- for (; I != E; ++I) {
- if (PrintedArg) FunctionInnards << ", ";
- const Type *ArgTy = *I;
- if (PAL.paramHasAttr(Idx, ParamAttr::ByVal)) {
- assert(isa<PointerType>(ArgTy));
- ArgTy = cast<PointerType>(ArgTy)->getElementType();
- }
- printType(FunctionInnards, ArgTy,
- /*isSigned=*/PAL.paramHasAttr(Idx, ParamAttr::SExt));
- PrintedArg = true;
- ++Idx;
- }
- }
-
- // Finish printing arguments... if this is a vararg function, print the ...,
- // unless there are no known types, in which case, we just emit ().
- //
- if (FT->isVarArg() && PrintedArg) {
- if (PrintedArg) FunctionInnards << ", ";
- FunctionInnards << "..."; // Output varargs portion of signature!
- } else if (!FT->isVarArg() && !PrintedArg) {
- FunctionInnards << "void"; // ret() -> ret(void) in C.
- }
- FunctionInnards << ')';
-
- // Get the return tpe for the function.
- const Type *RetTy;
- if (!isStructReturn)
- RetTy = F->getReturnType();
- else {
- // If this is a struct-return function, print the struct-return type.
- RetTy = cast<PointerType>(FT->getParamType(0))->getElementType();
- }
-
- // Print out the return type and the signature built above.
- printType(Out, RetTy,
- /*isSigned=*/PAL.paramHasAttr(0, ParamAttr::SExt),
- FunctionInnards.str());
-}
-
-static inline bool isFPIntBitCast(const Instruction &I) {
- if (!isa<BitCastInst>(I))
- return false;
- const Type *SrcTy = I.getOperand(0)->getType();
- const Type *DstTy = I.getType();
- return (SrcTy->isFloatingPoint() && DstTy->isInteger()) ||
- (DstTy->isFloatingPoint() && SrcTy->isInteger());
-}
-
-void CWriter::printFunction(Function &F) {
- /// isStructReturn - Should this function actually return a struct by-value?
- bool isStructReturn = F.hasStructRetAttr();
-
- printFunctionSignature(&F, false);
- Out << " {\n";
-
- // If this is a struct return function, handle the result with magic.
- if (isStructReturn) {
- const Type *StructTy =
- cast<PointerType>(F.arg_begin()->getType())->getElementType();
- Out << " ";
- printType(Out, StructTy, false, "StructReturn");
- Out << "; /* Struct return temporary */\n";
-
- Out << " ";
- printType(Out, F.arg_begin()->getType(), false,
- GetValueName(F.arg_begin()));
- Out << " = &StructReturn;\n";
- }
-
- bool PrintedVar = false;
-
- // print local variable information for the function
- for (inst_iterator I = inst_begin(&F), E = inst_end(&F); I != E; ++I) {
- if (const AllocaInst *AI = isDirectAlloca(&*I)) {
- Out << " ";
- printType(Out, AI->getAllocatedType(), false, GetValueName(AI));
- Out << "; /* Address-exposed local */\n";
- PrintedVar = true;
- } else if (I->getType() != Type::VoidTy && !isInlinableInst(*I)) {
- Out << " ";
- printType(Out, I->getType(), false, GetValueName(&*I));
- Out << ";\n";
-
- if (isa<PHINode>(*I)) { // Print out PHI node temporaries as well...
- Out << " ";
- printType(Out, I->getType(), false,
- GetValueName(&*I)+"__PHI_TEMPORARY");
- Out << ";\n";
- }
- PrintedVar = true;
- }
- // We need a temporary for the BitCast to use so it can pluck a value out
- // of a union to do the BitCast. This is separate from the need for a
- // variable to hold the result of the BitCast.
- if (isFPIntBitCast(*I)) {
- Out << " llvmBitCastUnion " << GetValueName(&*I)
- << "__BITCAST_TEMPORARY;\n";
- PrintedVar = true;
- }
- }
-
- if (PrintedVar)
- Out << '\n';
-
- if (F.hasExternalLinkage() && F.getName() == "main")
- Out << " CODE_FOR_MAIN();\n";
-
- // print the basic blocks
- for (Function::iterator BB = F.begin(), E = F.end(); BB != E; ++BB) {
- if (Loop *L = LI->getLoopFor(BB)) {
- if (L->getHeader() == BB && L->getParentLoop() == 0)
- printLoop(L);
- } else {
- printBasicBlock(BB);
- }
- }
-
- Out << "}\n\n";
-}
-
-void CWriter::printLoop(Loop *L) {
- Out << " do { /* Syntactic loop '" << L->getHeader()->getName()
- << "' to make GCC happy */\n";
- for (unsigned i = 0, e = L->getBlocks().size(); i != e; ++i) {
- BasicBlock *BB = L->getBlocks()[i];
- Loop *BBLoop = LI->getLoopFor(BB);
- if (BBLoop == L)
- printBasicBlock(BB);
- else if (BB == BBLoop->getHeader() && BBLoop->getParentLoop() == L)
- printLoop(BBLoop);
- }
- Out << " } while (1); /* end of syntactic loop '"
- << L->getHeader()->getName() << "' */\n";
-}
-
-void CWriter::printBasicBlock(BasicBlock *BB) {
-
- // Don't print the label for the basic block if there are no uses, or if
- // the only terminator use is the predecessor basic block's terminator.
- // We have to scan the use list because PHI nodes use basic blocks too but
- // do not require a label to be generated.
- //
- bool NeedsLabel = false;
- for (pred_iterator PI = pred_begin(BB), E = pred_end(BB); PI != E; ++PI)
- if (isGotoCodeNecessary(*PI, BB)) {
- NeedsLabel = true;
- break;
- }
-
- if (NeedsLabel) Out << GetValueName(BB) << ":\n";
-
- // Output all of the instructions in the basic block...
- for (BasicBlock::iterator II = BB->begin(), E = --BB->end(); II != E;
- ++II) {
- if (!isInlinableInst(*II) && !isDirectAlloca(II)) {
- if (II->getType() != Type::VoidTy && !isInlineAsm(*II))
- outputLValue(II);
- else
- Out << " ";
- writeInstComputationInline(*II);
- Out << ";\n";
- }
- }
-
- // Don't emit prefix or suffix for the terminator.
- visit(*BB->getTerminator());
-}
-
-
-// Specific Instruction type classes... note that all of the casts are
-// necessary because we use the instruction classes as opaque types...
-//
-void CWriter::visitReturnInst(ReturnInst &I) {
- // If this is a struct return function, return the temporary struct.
- bool isStructReturn = I.getParent()->getParent()->hasStructRetAttr();
-
- if (isStructReturn) {
- Out << " return StructReturn;\n";
- return;
- }
-
- // Don't output a void return if this is the last basic block in the function
- if (I.getNumOperands() == 0 &&
- &*--I.getParent()->getParent()->end() == I.getParent() &&
- !I.getParent()->size() == 1) {
- return;
- }
-
- if (I.getNumOperands() > 1) {
- Out << " {\n";
- Out << " ";
- printType(Out, I.getParent()->getParent()->getReturnType());
- Out << " llvm_cbe_mrv_temp = {\n";
- for (unsigned i = 0, e = I.getNumOperands(); i != e; ++i) {
- Out << " ";
- writeOperand(I.getOperand(i));
- if (i != e - 1)
- Out << ",";
- Out << "\n";
- }
- Out << " };\n";
- Out << " return llvm_cbe_mrv_temp;\n";
- Out << " }\n";
- return;
- }
-
- Out << " return";
- if (I.getNumOperands()) {
- Out << ' ';
- writeOperand(I.getOperand(0));
- }
- Out << ";\n";
-}
-
-void CWriter::visitSwitchInst(SwitchInst &SI) {
-
- Out << " switch (";
- writeOperand(SI.getOperand(0));
- Out << ") {\n default:\n";
- printPHICopiesForSuccessor (SI.getParent(), SI.getDefaultDest(), 2);
- printBranchToBlock(SI.getParent(), SI.getDefaultDest(), 2);
- Out << ";\n";
- for (unsigned i = 2, e = SI.getNumOperands(); i != e; i += 2) {
- Out << " case ";
- writeOperand(SI.getOperand(i));
- Out << ":\n";
- BasicBlock *Succ = cast<BasicBlock>(SI.getOperand(i+1));
- printPHICopiesForSuccessor (SI.getParent(), Succ, 2);
- printBranchToBlock(SI.getParent(), Succ, 2);
- if (Function::iterator(Succ) == next(Function::iterator(SI.getParent())))
- Out << " break;\n";
- }
- Out << " }\n";
-}
-
-void CWriter::visitUnreachableInst(UnreachableInst &I) {
- Out << " /*UNREACHABLE*/;\n";
-}
-
-bool CWriter::isGotoCodeNecessary(BasicBlock *From, BasicBlock *To) {
- /// FIXME: This should be reenabled, but loop reordering safe!!
- return true;
-
- if (next(Function::iterator(From)) != Function::iterator(To))
- return true; // Not the direct successor, we need a goto.
-
- //isa<SwitchInst>(From->getTerminator())
-
- if (LI->getLoopFor(From) != LI->getLoopFor(To))
- return true;
- return false;
-}
-
-void CWriter::printPHICopiesForSuccessor (BasicBlock *CurBlock,
- BasicBlock *Successor,
- unsigned Indent) {
- for (BasicBlock::iterator I = Successor->begin(); isa<PHINode>(I); ++I) {
- PHINode *PN = cast<PHINode>(I);
- // Now we have to do the printing.
- Value *IV = PN->getIncomingValueForBlock(CurBlock);
- if (!isa<UndefValue>(IV)) {
- Out << std::string(Indent, ' ');
- Out << " " << GetValueName(I) << "__PHI_TEMPORARY = ";
- writeOperand(IV);
- Out << "; /* for PHI node */\n";
- }
- }
-}
-
-void CWriter::printBranchToBlock(BasicBlock *CurBB, BasicBlock *Succ,
- unsigned Indent) {
- if (isGotoCodeNecessary(CurBB, Succ)) {
- Out << std::string(Indent, ' ') << " goto ";
- writeOperand(Succ);
- Out << ";\n";
- }
-}
-
-// Branch instruction printing - Avoid printing out a branch to a basic block
-// that immediately succeeds the current one.
-//
-void CWriter::visitBranchInst(BranchInst &I) {
-
- if (I.isConditional()) {
- if (isGotoCodeNecessary(I.getParent(), I.getSuccessor(0))) {
- Out << " if (";
- writeOperand(I.getCondition());
- Out << ") {\n";
-
- printPHICopiesForSuccessor (I.getParent(), I.getSuccessor(0), 2);
- printBranchToBlock(I.getParent(), I.getSuccessor(0), 2);
-
- if (isGotoCodeNecessary(I.getParent(), I.getSuccessor(1))) {
- Out << " } else {\n";
- printPHICopiesForSuccessor (I.getParent(), I.getSuccessor(1), 2);
- printBranchToBlock(I.getParent(), I.getSuccessor(1), 2);
- }
- } else {
- // First goto not necessary, assume second one is...
- Out << " if (!";
- writeOperand(I.getCondition());
- Out << ") {\n";
-
- printPHICopiesForSuccessor (I.getParent(), I.getSuccessor(1), 2);
- printBranchToBlock(I.getParent(), I.getSuccessor(1), 2);
- }
-
- Out << " }\n";
- } else {
- printPHICopiesForSuccessor (I.getParent(), I.getSuccessor(0), 0);
- printBranchToBlock(I.getParent(), I.getSuccessor(0), 0);
- }
- Out << "\n";
-}
-
-// PHI nodes get copied into temporary values at the end of predecessor basic
-// blocks. We now need to copy these temporary values into the REAL value for
-// the PHI.
-void CWriter::visitPHINode(PHINode &I) {
- writeOperand(&I);
- Out << "__PHI_TEMPORARY";
-}
-
-
-void CWriter::visitBinaryOperator(Instruction &I) {
- // binary instructions, shift instructions, setCond instructions.
- assert(!isa<PointerType>(I.getType()));
-
- // We must cast the results of binary operations which might be promoted.
- bool needsCast = false;
- if ((I.getType() == Type::Int8Ty) || (I.getType() == Type::Int16Ty)
- || (I.getType() == Type::FloatTy)) {
- needsCast = true;
- Out << "((";
- printType(Out, I.getType(), false);
- Out << ")(";
- }
-
- // If this is a negation operation, print it out as such. For FP, we don't
- // want to print "-0.0 - X".
- if (BinaryOperator::isNeg(&I)) {
- Out << "-(";
- writeOperand(BinaryOperator::getNegArgument(cast<BinaryOperator>(&I)));
- Out << ")";
- } else if (I.getOpcode() == Instruction::FRem) {
- // Output a call to fmod/fmodf instead of emitting a%b
- if (I.getType() == Type::FloatTy)
- Out << "fmodf(";
- else if (I.getType() == Type::DoubleTy)
- Out << "fmod(";
- else // all 3 flavors of long double
- Out << "fmodl(";
- writeOperand(I.getOperand(0));
- Out << ", ";
- writeOperand(I.getOperand(1));
- Out << ")";
- } else {
-
- // Write out the cast of the instruction's value back to the proper type
- // if necessary.
- bool NeedsClosingParens = writeInstructionCast(I);
-
- // Certain instructions require the operand to be forced to a specific type
- // so we use writeOperandWithCast here instead of writeOperand. Similarly
- // below for operand 1
- writeOperandWithCast(I.getOperand(0), I.getOpcode());
-
- switch (I.getOpcode()) {
- case Instruction::Add: Out << " + "; break;
- case Instruction::Sub: Out << " - "; break;
- case Instruction::Mul: Out << " * "; break;
- case Instruction::URem:
- case Instruction::SRem:
- case Instruction::FRem: Out << " % "; break;
- case Instruction::UDiv:
- case Instruction::SDiv:
- case Instruction::FDiv: Out << " / "; break;
- case Instruction::And: Out << " & "; break;
- case Instruction::Or: Out << " | "; break;
- case Instruction::Xor: Out << " ^ "; break;
- case Instruction::Shl : Out << " << "; break;
- case Instruction::LShr:
- case Instruction::AShr: Out << " >> "; break;
- default: cerr << "Invalid operator type!" << I; abort();
- }
-
- writeOperandWithCast(I.getOperand(1), I.getOpcode());
- if (NeedsClosingParens)
- Out << "))";
- }
-
- if (needsCast) {
- Out << "))";
- }
-}
-
-void CWriter::visitICmpInst(ICmpInst &I) {
- // We must cast the results of icmp which might be promoted.
- bool needsCast = false;
-
- // Write out the cast of the instruction's value back to the proper type
- // if necessary.
- bool NeedsClosingParens = writeInstructionCast(I);
-
- // Certain icmp predicate require the operand to be forced to a specific type
- // so we use writeOperandWithCast here instead of writeOperand. Similarly
- // below for operand 1
- writeOperandWithCast(I.getOperand(0), I);
-
- switch (I.getPredicate()) {
- case ICmpInst::ICMP_EQ: Out << " == "; break;
- case ICmpInst::ICMP_NE: Out << " != "; break;
- case ICmpInst::ICMP_ULE:
- case ICmpInst::ICMP_SLE: Out << " <= "; break;
- case ICmpInst::ICMP_UGE:
- case ICmpInst::ICMP_SGE: Out << " >= "; break;
- case ICmpInst::ICMP_ULT:
- case ICmpInst::ICMP_SLT: Out << " < "; break;
- case ICmpInst::ICMP_UGT:
- case ICmpInst::ICMP_SGT: Out << " > "; break;
- default: cerr << "Invalid icmp predicate!" << I; abort();
- }
-
- writeOperandWithCast(I.getOperand(1), I);
- if (NeedsClosingParens)
- Out << "))";
-
- if (needsCast) {
- Out << "))";
- }
-}
-
-void CWriter::visitFCmpInst(FCmpInst &I) {
- if (I.getPredicate() == FCmpInst::FCMP_FALSE) {
- Out << "0";
- return;
- }
- if (I.getPredicate() == FCmpInst::FCMP_TRUE) {
- Out << "1";
- return;
- }
-
- const char* op = 0;
- switch (I.getPredicate()) {
- default: assert(0 && "Illegal FCmp predicate");
- case FCmpInst::FCMP_ORD: op = "ord"; break;
- case FCmpInst::FCMP_UNO: op = "uno"; break;
- case FCmpInst::FCMP_UEQ: op = "ueq"; break;
- case FCmpInst::FCMP_UNE: op = "une"; break;
- case FCmpInst::FCMP_ULT: op = "ult"; break;
- case FCmpInst::FCMP_ULE: op = "ule"; break;
- case FCmpInst::FCMP_UGT: op = "ugt"; break;
- case FCmpInst::FCMP_UGE: op = "uge"; break;
- case FCmpInst::FCMP_OEQ: op = "oeq"; break;
- case FCmpInst::FCMP_ONE: op = "one"; break;
- case FCmpInst::FCMP_OLT: op = "olt"; break;
- case FCmpInst::FCMP_OLE: op = "ole"; break;
- case FCmpInst::FCMP_OGT: op = "ogt"; break;
- case FCmpInst::FCMP_OGE: op = "oge"; break;
- }
-
- Out << "llvm_fcmp_" << op << "(";
- // Write the first operand
- writeOperand(I.getOperand(0));
- Out << ", ";
- // Write the second operand
- writeOperand(I.getOperand(1));
- Out << ")";
-}
-
-static const char * getFloatBitCastField(const Type *Ty) {
- switch (Ty->getTypeID()) {
- default: assert(0 && "Invalid Type");
- case Type::FloatTyID: return "Float";
- case Type::DoubleTyID: return "Double";
- case Type::IntegerTyID: {
- unsigned NumBits = cast<IntegerType>(Ty)->getBitWidth();
- if (NumBits <= 32)
- return "Int32";
- else
- return "Int64";
- }
- }
-}
-
-void CWriter::visitCastInst(CastInst &I) {
- const Type *DstTy = I.getType();
- const Type *SrcTy = I.getOperand(0)->getType();
- if (isFPIntBitCast(I)) {
- Out << '(';
- // These int<->float and long<->double casts need to be handled specially
- Out << GetValueName(&I) << "__BITCAST_TEMPORARY."
- << getFloatBitCastField(I.getOperand(0)->getType()) << " = ";
- writeOperand(I.getOperand(0));
- Out << ", " << GetValueName(&I) << "__BITCAST_TEMPORARY."
- << getFloatBitCastField(I.getType());
- Out << ')';
- return;
- }
-
- Out << '(';
- printCast(I.getOpcode(), SrcTy, DstTy);
-
- // Make a sext from i1 work by subtracting the i1 from 0 (an int).
- if (SrcTy == Type::Int1Ty && I.getOpcode() == Instruction::SExt)
- Out << "0-";
-
- writeOperand(I.getOperand(0));
-
- if (DstTy == Type::Int1Ty &&
- (I.getOpcode() == Instruction::Trunc ||
- I.getOpcode() == Instruction::FPToUI ||
- I.getOpcode() == Instruction::FPToSI ||
- I.getOpcode() == Instruction::PtrToInt)) {
- // Make sure we really get a trunc to bool by anding the operand with 1
- Out << "&1u";
- }
- Out << ')';
-}
-
-void CWriter::visitSelectInst(SelectInst &I) {
- Out << "((";
- writeOperand(I.getCondition());
- Out << ") ? (";
- writeOperand(I.getTrueValue());
- Out << ") : (";
- writeOperand(I.getFalseValue());
- Out << "))";
-}
-
-
-void CWriter::lowerIntrinsics(Function &F) {
- // This is used to keep track of intrinsics that get generated to a lowered
- // function. We must generate the prototypes before the function body which
- // will only be expanded on first use (by the loop below).
- std::vector<Function*> prototypesToGen;
-
- // Examine all the instructions in this function to find the intrinsics that
- // need to be lowered.
- for (Function::iterator BB = F.begin(), EE = F.end(); BB != EE; ++BB)
- for (BasicBlock::iterator I = BB->begin(), E = BB->end(); I != E; )
- if (CallInst *CI = dyn_cast<CallInst>(I++))
- if (Function *F = CI->getCalledFunction())
- switch (F->getIntrinsicID()) {
- case Intrinsic::not_intrinsic:
- case Intrinsic::memory_barrier:
- case Intrinsic::vastart:
- case Intrinsic::vacopy:
- case Intrinsic::vaend:
- case Intrinsic::returnaddress:
- case Intrinsic::frameaddress:
- case Intrinsic::setjmp:
- case Intrinsic::longjmp:
- case Intrinsic::prefetch:
- case Intrinsic::dbg_stoppoint:
- case Intrinsic::powi:
- case Intrinsic::x86_sse_cmp_ss:
- case Intrinsic::x86_sse_cmp_ps:
- case Intrinsic::x86_sse2_cmp_sd:
- case Intrinsic::x86_sse2_cmp_pd:
- case Intrinsic::ppc_altivec_lvsl:
- // We directly implement these intrinsics
- break;
- default:
- // If this is an intrinsic that directly corresponds to a GCC
- // builtin, we handle it.
- const char *BuiltinName = "";
-#define GET_GCC_BUILTIN_NAME
-#include "llvm/Intrinsics.gen"
-#undef GET_GCC_BUILTIN_NAME
- // If we handle it, don't lower it.
- if (BuiltinName[0]) break;
-
- // All other intrinsic calls we must lower.
- Instruction *Before = 0;
- if (CI != &BB->front())
- Before = prior(BasicBlock::iterator(CI));
-
- IL->LowerIntrinsicCall(CI);
- if (Before) { // Move iterator to instruction after call
- I = Before; ++I;
- } else {
- I = BB->begin();
- }
- // If the intrinsic got lowered to another call, and that call has
- // a definition then we need to make sure its prototype is emitted
- // before any calls to it.
- if (CallInst *Call = dyn_cast<CallInst>(I))
- if (Function *NewF = Call->getCalledFunction())
- if (!NewF->isDeclaration())
- prototypesToGen.push_back(NewF);
-
- break;
- }
-
- // We may have collected some prototypes to emit in the loop above.
- // Emit them now, before the function that uses them is emitted. But,
- // be careful not to emit them twice.
- std::vector<Function*>::iterator I = prototypesToGen.begin();
- std::vector<Function*>::iterator E = prototypesToGen.end();
- for ( ; I != E; ++I) {
- if (intrinsicPrototypesAlreadyGenerated.insert(*I).second) {
- Out << '\n';
- printFunctionSignature(*I, true);
- Out << ";\n";
- }
- }
-}
-
-void CWriter::visitCallInst(CallInst &I) {
- if (isa<InlineAsm>(I.getOperand(0)))
- return visitInlineAsm(I);
-
- bool WroteCallee = false;
-
- // Handle intrinsic function calls first...
- if (Function *F = I.getCalledFunction())
- if (Intrinsic::ID ID = (Intrinsic::ID)F->getIntrinsicID())
- if (visitBuiltinCall(I, ID, WroteCallee))
- return;
-
- Value *Callee = I.getCalledValue();
-
- const PointerType *PTy = cast<PointerType>(Callee->getType());
- const FunctionType *FTy = cast<FunctionType>(PTy->getElementType());
-
- // If this is a call to a struct-return function, assign to the first
- // parameter instead of passing it to the call.
- const PAListPtr &PAL = I.getParamAttrs();
- bool hasByVal = I.hasByValArgument();
- bool isStructRet = I.hasStructRetAttr();
- if (isStructRet) {
- writeOperandDeref(I.getOperand(1));
- Out << " = ";
- }
-
- if (I.isTailCall()) Out << " /*tail*/ ";
-
- if (!WroteCallee) {
- // If this is an indirect call to a struct return function, we need to cast
- // the pointer. Ditto for indirect calls with byval arguments.
- bool NeedsCast = (hasByVal || isStructRet) && !isa<Function>(Callee);
-
- // GCC is a real PITA. It does not permit codegening casts of functions to
- // function pointers if they are in a call (it generates a trap instruction
- // instead!). We work around this by inserting a cast to void* in between
- // the function and the function pointer cast. Unfortunately, we can't just
- // form the constant expression here, because the folder will immediately
- // nuke it.
- //
- // Note finally, that this is completely unsafe. ANSI C does not guarantee
- // that void* and function pointers have the same size. :( To deal with this
- // in the common case, we handle casts where the number of arguments passed
- // match exactly.
- //
- if (ConstantExpr *CE = dyn_cast<ConstantExpr>(Callee))
- if (CE->isCast())
- if (Function *RF = dyn_cast<Function>(CE->getOperand(0))) {
- NeedsCast = true;
- Callee = RF;
- }
-
- if (NeedsCast) {
- // Ok, just cast the pointer type.
- Out << "((";
- if (isStructRet)
- printStructReturnPointerFunctionType(Out, PAL,
- cast<PointerType>(I.getCalledValue()->getType()));
- else if (hasByVal)
- printType(Out, I.getCalledValue()->getType(), false, "", true, PAL);
- else
- printType(Out, I.getCalledValue()->getType());
- Out << ")(void*)";
- }
- writeOperand(Callee);
- if (NeedsCast) Out << ')';
- }
-
- Out << '(';
-
- unsigned NumDeclaredParams = FTy->getNumParams();
-
- CallSite::arg_iterator AI = I.op_begin()+1, AE = I.op_end();
- unsigned ArgNo = 0;
- if (isStructRet) { // Skip struct return argument.
- ++AI;
- ++ArgNo;
- }
-
- bool PrintedArg = false;
- for (; AI != AE; ++AI, ++ArgNo) {
- if (PrintedArg) Out << ", ";
- if (ArgNo < NumDeclaredParams &&
- (*AI)->getType() != FTy->getParamType(ArgNo)) {
- Out << '(';
- printType(Out, FTy->getParamType(ArgNo),
- /*isSigned=*/PAL.paramHasAttr(ArgNo+1, ParamAttr::SExt));
- Out << ')';
- }
- // Check if the argument is expected to be passed by value.
- if (I.paramHasAttr(ArgNo+1, ParamAttr::ByVal))
- writeOperandDeref(*AI);
- else
- writeOperand(*AI);
- PrintedArg = true;
- }
- Out << ')';
-}
-
-/// visitBuiltinCall - Handle the call to the specified builtin. Returns true
-/// if the entire call is handled, return false it it wasn't handled, and
-/// optionally set 'WroteCallee' if the callee has already been printed out.
-bool CWriter::visitBuiltinCall(CallInst &I, Intrinsic::ID ID,
- bool &WroteCallee) {
- switch (ID) {
- default: {
- // If this is an intrinsic that directly corresponds to a GCC
- // builtin, we emit it here.
- const char *BuiltinName = "";
- Function *F = I.getCalledFunction();
-#define GET_GCC_BUILTIN_NAME
-#include "llvm/Intrinsics.gen"
-#undef GET_GCC_BUILTIN_NAME
- assert(BuiltinName[0] && "Unknown LLVM intrinsic!");
-
- Out << BuiltinName;
- WroteCallee = true;
- return false;
- }
- case Intrinsic::memory_barrier:
- Out << "__sync_synchronize()";
- return true;
- case Intrinsic::vastart:
- Out << "0; ";
-
- Out << "va_start(*(va_list*)";
- writeOperand(I.getOperand(1));
- Out << ", ";
- // Output the last argument to the enclosing function.
- if (I.getParent()->getParent()->arg_empty()) {
- cerr << "The C backend does not currently support zero "
- << "argument varargs functions, such as '"
- << I.getParent()->getParent()->getName() << "'!\n";
- abort();
- }
- writeOperand(--I.getParent()->getParent()->arg_end());
- Out << ')';
- return true;
- case Intrinsic::vaend:
- if (!isa<ConstantPointerNull>(I.getOperand(1))) {
- Out << "0; va_end(*(va_list*)";
- writeOperand(I.getOperand(1));
- Out << ')';
- } else {
- Out << "va_end(*(va_list*)0)";
- }
- return true;
- case Intrinsic::vacopy:
- Out << "0; ";
- Out << "va_copy(*(va_list*)";
- writeOperand(I.getOperand(1));
- Out << ", *(va_list*)";
- writeOperand(I.getOperand(2));
- Out << ')';
- return true;
- case Intrinsic::returnaddress:
- Out << "__builtin_return_address(";
- writeOperand(I.getOperand(1));
- Out << ')';
- return true;
- case Intrinsic::frameaddress:
- Out << "__builtin_frame_address(";
- writeOperand(I.getOperand(1));
- Out << ')';
- return true;
- case Intrinsic::powi:
- Out << "__builtin_powi(";
- writeOperand(I.getOperand(1));
- Out << ", ";
- writeOperand(I.getOperand(2));
- Out << ')';
- return true;
- case Intrinsic::setjmp:
- Out << "setjmp(*(jmp_buf*)";
- writeOperand(I.getOperand(1));
- Out << ')';
- return true;
- case Intrinsic::longjmp:
- Out << "longjmp(*(jmp_buf*)";
- writeOperand(I.getOperand(1));
- Out << ", ";
- writeOperand(I.getOperand(2));
- Out << ')';
- return true;
- case Intrinsic::prefetch:
- Out << "LLVM_PREFETCH((const void *)";
- writeOperand(I.getOperand(1));
- Out << ", ";
- writeOperand(I.getOperand(2));
- Out << ", ";
- writeOperand(I.getOperand(3));
- Out << ")";
- return true;
- case Intrinsic::stacksave:
- // Emit this as: Val = 0; *((void**)&Val) = __builtin_stack_save()
- // to work around GCC bugs (see PR1809).
- Out << "0; *((void**)&" << GetValueName(&I)
- << ") = __builtin_stack_save()";
- return true;
- case Intrinsic::dbg_stoppoint: {
- // If we use writeOperand directly we get a "u" suffix which is rejected
- // by gcc.
- DbgStopPointInst &SPI = cast<DbgStopPointInst>(I);
- Out << "\n#line "
- << SPI.getLine()
- << " \"" << SPI.getDirectory()
- << SPI.getFileName() << "\"\n";
- return true;
- }
- case Intrinsic::x86_sse_cmp_ss:
- case Intrinsic::x86_sse_cmp_ps:
- case Intrinsic::x86_sse2_cmp_sd:
- case Intrinsic::x86_sse2_cmp_pd:
- Out << '(';
- printType(Out, I.getType());
- Out << ')';
- // Multiple GCC builtins multiplex onto this intrinsic.
- switch (cast<ConstantInt>(I.getOperand(3))->getZExtValue()) {
- default: assert(0 && "Invalid llvm.x86.sse.cmp!");
- case 0: Out << "__builtin_ia32_cmpeq"; break;
- case 1: Out << "__builtin_ia32_cmplt"; break;
- case 2: Out << "__builtin_ia32_cmple"; break;
- case 3: Out << "__builtin_ia32_cmpunord"; break;
- case 4: Out << "__builtin_ia32_cmpneq"; break;
- case 5: Out << "__builtin_ia32_cmpnlt"; break;
- case 6: Out << "__builtin_ia32_cmpnle"; break;
- case 7: Out << "__builtin_ia32_cmpord"; break;
- }
- if (ID == Intrinsic::x86_sse_cmp_ps || ID == Intrinsic::x86_sse2_cmp_pd)
- Out << 'p';
- else
- Out << 's';
- if (ID == Intrinsic::x86_sse_cmp_ss || ID == Intrinsic::x86_sse_cmp_ps)
- Out << 's';
- else
- Out << 'd';
-
- Out << "(";
- writeOperand(I.getOperand(1));
- Out << ", ";
- writeOperand(I.getOperand(2));
- Out << ")";
- return true;
- case Intrinsic::ppc_altivec_lvsl:
- Out << '(';
- printType(Out, I.getType());
- Out << ')';
- Out << "__builtin_altivec_lvsl(0, (void*)";
- writeOperand(I.getOperand(1));
- Out << ")";
- return true;
- }
-}
-
-//This converts the llvm constraint string to something gcc is expecting.
-//TODO: work out platform independent constraints and factor those out
-// of the per target tables
-// handle multiple constraint codes
-std::string CWriter::InterpretASMConstraint(InlineAsm::ConstraintInfo& c) {
-
- assert(c.Codes.size() == 1 && "Too many asm constraint codes to handle");
-
- const char *const *table = 0;
-
- //Grab the translation table from TargetAsmInfo if it exists
- if (!TAsm) {
- std::string E;
- const TargetMachineRegistry::entry* Match =
- TargetMachineRegistry::getClosestStaticTargetForModule(*TheModule, E);
- if (Match) {
- //Per platform Target Machines don't exist, so create it
- // this must be done only once
- const TargetMachine* TM = Match->CtorFn(*TheModule, "");
- TAsm = TM->getTargetAsmInfo();
- }
- }
- if (TAsm)
- table = TAsm->getAsmCBE();
-
- //Search the translation table if it exists
- for (int i = 0; table && table[i]; i += 2)
- if (c.Codes[0] == table[i])
- return table[i+1];
-
- //default is identity
- return c.Codes[0];
-}
-
-//TODO: import logic from AsmPrinter.cpp
-static std::string gccifyAsm(std::string asmstr) {
- for (std::string::size_type i = 0; i != asmstr.size(); ++i)
- if (asmstr[i] == '\n')
- asmstr.replace(i, 1, "\\n");
- else if (asmstr[i] == '\t')
- asmstr.replace(i, 1, "\\t");
- else if (asmstr[i] == '$') {
- if (asmstr[i + 1] == '{') {
- std::string::size_type a = asmstr.find_first_of(':', i + 1);
- std::string::size_type b = asmstr.find_first_of('}', i + 1);
- std::string n = "%" +
- asmstr.substr(a + 1, b - a - 1) +
- asmstr.substr(i + 2, a - i - 2);
- asmstr.replace(i, b - i + 1, n);
- i += n.size() - 1;
- } else
- asmstr.replace(i, 1, "%");
- }
- else if (asmstr[i] == '%')//grr
- { asmstr.replace(i, 1, "%%"); ++i;}
-
- return asmstr;
-}
-
-//TODO: assumptions about what consume arguments from the call are likely wrong
-// handle communitivity
-void CWriter::visitInlineAsm(CallInst &CI) {
- InlineAsm* as = cast<InlineAsm>(CI.getOperand(0));
- std::vector<InlineAsm::ConstraintInfo> Constraints = as->ParseConstraints();
-
- std::vector<std::pair<Value*, int> > ResultVals;
- if (CI.getType() == Type::VoidTy)
- ;
- else if (const StructType *ST = dyn_cast<StructType>(CI.getType())) {
- for (unsigned i = 0, e = ST->getNumElements(); i != e; ++i)
- ResultVals.push_back(std::make_pair(&CI, (int)i));
- } else {
- ResultVals.push_back(std::make_pair(&CI, -1));
- }
-
- // Fix up the asm string for gcc and emit it.
- Out << "__asm__ volatile (\"" << gccifyAsm(as->getAsmString()) << "\"\n";
- Out << " :";
-
- unsigned ValueCount = 0;
- bool IsFirst = true;
-
- // Convert over all the output constraints.
- for (std::vector<InlineAsm::ConstraintInfo>::iterator I = Constraints.begin(),
- E = Constraints.end(); I != E; ++I) {
-
- if (I->Type != InlineAsm::isOutput) {
- ++ValueCount;
- continue; // Ignore non-output constraints.
- }
-
- assert(I->Codes.size() == 1 && "Too many asm constraint codes to handle");
- std::string C = InterpretASMConstraint(*I);
- if (C.empty()) continue;
-
- if (!IsFirst) {
- Out << ", ";
- IsFirst = false;
- }
-
- // Unpack the dest.
- Value *DestVal;
- int DestValNo = -1;
-
- if (ValueCount < ResultVals.size()) {
- DestVal = ResultVals[ValueCount].first;
- DestValNo = ResultVals[ValueCount].second;
- } else
- DestVal = CI.getOperand(ValueCount-ResultVals.size()+1);
-
- if (I->isEarlyClobber)
- C = "&"+C;
-
- Out << "\"=" << C << "\"(" << GetValueName(DestVal);
- if (DestValNo != -1)
- Out << ".field" << DestValNo; // Multiple retvals.
- Out << ")";
- ++ValueCount;
- }
-
-
- // Convert over all the input constraints.
- Out << "\n :";
- IsFirst = true;
- ValueCount = 0;
- for (std::vector<InlineAsm::ConstraintInfo>::iterator I = Constraints.begin(),
- E = Constraints.end(); I != E; ++I) {
- if (I->Type != InlineAsm::isInput) {
- ++ValueCount;
- continue; // Ignore non-input constraints.
- }
-
- assert(I->Codes.size() == 1 && "Too many asm constraint codes to handle");
- std::string C = InterpretASMConstraint(*I);
- if (C.empty()) continue;
-
- if (!IsFirst) {
- Out << ", ";
- IsFirst = false;
- }
-
- assert(ValueCount >= ResultVals.size() && "Input can't refer to result");
- Value *SrcVal = CI.getOperand(ValueCount-ResultVals.size()+1);
-
- Out << "\"" << C << "\"(";
- if (!I->isIndirect)
- writeOperand(SrcVal);
- else
- writeOperandDeref(SrcVal);
- Out << ")";
- }
-
- // Convert over the clobber constraints.
- IsFirst = true;
- ValueCount = 0;
- for (std::vector<InlineAsm::ConstraintInfo>::iterator I = Constraints.begin(),
- E = Constraints.end(); I != E; ++I) {
- if (I->Type != InlineAsm::isClobber)
- continue; // Ignore non-input constraints.
-
- assert(I->Codes.size() == 1 && "Too many asm constraint codes to handle");
- std::string C = InterpretASMConstraint(*I);
- if (C.empty()) continue;
-
- if (!IsFirst) {
- Out << ", ";
- IsFirst = false;
- }
-
- Out << '\"' << C << '"';
- }
-
- Out << ")";
-}
-
-void CWriter::visitMallocInst(MallocInst &I) {
- assert(0 && "lowerallocations pass didn't work!");
-}
-
-void CWriter::visitAllocaInst(AllocaInst &I) {
- Out << '(';
- printType(Out, I.getType());
- Out << ") alloca(sizeof(";
- printType(Out, I.getType()->getElementType());
- Out << ')';
- if (I.isArrayAllocation()) {
- Out << " * " ;
- writeOperand(I.getOperand(0));
- }
- Out << ')';
-}
-
-void CWriter::visitFreeInst(FreeInst &I) {
- assert(0 && "lowerallocations pass didn't work!");
-}
-
-void CWriter::printGEPExpression(Value *Ptr, gep_type_iterator I,
- gep_type_iterator E) {
-
- // If there are no indices, just print out the pointer.
- if (I == E) {
- writeOperand(Ptr);
- return;
- }
-
- // Find out if the last index is into a vector. If so, we have to print this
- // specially. Since vectors can't have elements of indexable type, only the
- // last index could possibly be of a vector element.
- const VectorType *LastIndexIsVector = 0;
- {
- for (gep_type_iterator TmpI = I; TmpI != E; ++TmpI)
- LastIndexIsVector = dyn_cast<VectorType>(*TmpI);
- }
-
- Out << "(";
-
- // If the last index is into a vector, we can't print it as &a[i][j] because
- // we can't index into a vector with j in GCC. Instead, emit this as
- // (((float*)&a[i])+j)
- if (LastIndexIsVector) {
- Out << "((";
- printType(Out, PointerType::getUnqual(LastIndexIsVector->getElementType()));
- Out << ")(";
- }
-
- Out << '&';
-
- // If the first index is 0 (very typical) we can do a number of
- // simplifications to clean up the code.
- Value *FirstOp = I.getOperand();
- if (!isa<Constant>(FirstOp) || !cast<Constant>(FirstOp)->isNullValue()) {
- // First index isn't simple, print it the hard way.
- writeOperand(Ptr);
- } else {
- ++I; // Skip the zero index.
-
- // Okay, emit the first operand. If Ptr is something that is already address
- // exposed, like a global, avoid emitting (&foo)[0], just emit foo instead.
- if (isAddressExposed(Ptr)) {
- writeOperandInternal(Ptr);
- } else if (I != E && isa<StructType>(*I)) {
- // If we didn't already emit the first operand, see if we can print it as
- // P->f instead of "P[0].f"
- writeOperand(Ptr);
- Out << "->field" << cast<ConstantInt>(I.getOperand())->getZExtValue();
- ++I; // eat the struct index as well.
- } else {
- // Instead of emitting P[0][1], emit (*P)[1], which is more idiomatic.
- Out << "(*";
- writeOperand(Ptr);
- Out << ")";
- }
- }
-
- for (; I != E; ++I) {
- if (isa<StructType>(*I)) {
- Out << ".field" << cast<ConstantInt>(I.getOperand())->getZExtValue();
- } else if (!isa<VectorType>(*I)) {
- Out << '[';
- writeOperandWithCast(I.getOperand(), Instruction::GetElementPtr);
- Out << ']';
- } else {
- // If the last index is into a vector, then print it out as "+j)". This
- // works with the 'LastIndexIsVector' code above.
- if (isa<Constant>(I.getOperand()) &&
- cast<Constant>(I.getOperand())->isNullValue()) {
- Out << "))"; // avoid "+0".
- } else {
- Out << ")+(";
- writeOperandWithCast(I.getOperand(), Instruction::GetElementPtr);
- Out << "))";
- }
- }
- }
- Out << ")";
-}
-
-void CWriter::writeMemoryAccess(Value *Operand, const Type *OperandType,
- bool IsVolatile, unsigned Alignment) {
-
- bool IsUnaligned = Alignment &&
- Alignment < TD->getABITypeAlignment(OperandType);
-
- if (!IsUnaligned)
- Out << '*';
- if (IsVolatile || IsUnaligned) {
- Out << "((";
- if (IsUnaligned)
- Out << "struct __attribute__ ((packed, aligned(" << Alignment << "))) {";
- printType(Out, OperandType, false, IsUnaligned ? "data" : "volatile*");
- if (IsUnaligned) {
- Out << "; } ";
- if (IsVolatile) Out << "volatile ";
- Out << "*";
- }
- Out << ")";
- }
-
- writeOperand(Operand);
-
- if (IsVolatile || IsUnaligned) {
- Out << ')';
- if (IsUnaligned)
- Out << "->data";
- }
-}
-
-void CWriter::visitLoadInst(LoadInst &I) {
- writeMemoryAccess(I.getOperand(0), I.getType(), I.isVolatile(),
- I.getAlignment());
-
-}
-
-void CWriter::visitStoreInst(StoreInst &I) {
- writeMemoryAccess(I.getPointerOperand(), I.getOperand(0)->getType(),
- I.isVolatile(), I.getAlignment());
- Out << " = ";
- Value *Operand = I.getOperand(0);
- Constant *BitMask = 0;
- if (const IntegerType* ITy = dyn_cast<IntegerType>(Operand->getType()))
- if (!ITy->isPowerOf2ByteWidth())
- // We have a bit width that doesn't match an even power-of-2 byte
- // size. Consequently we must & the value with the type's bit mask
- BitMask = ConstantInt::get(ITy, ITy->getBitMask());
- if (BitMask)
- Out << "((";
- writeOperand(Operand);
- if (BitMask) {
- Out << ") & ";
- printConstant(BitMask);
- Out << ")";
- }
-}
-
-void CWriter::visitGetElementPtrInst(GetElementPtrInst &I) {
- printGEPExpression(I.getPointerOperand(), gep_type_begin(I),
- gep_type_end(I));
-}
-
-void CWriter::visitVAArgInst(VAArgInst &I) {
- Out << "va_arg(*(va_list*)";
- writeOperand(I.getOperand(0));
- Out << ", ";
- printType(Out, I.getType());
- Out << ");\n ";
-}
-
-void CWriter::visitInsertElementInst(InsertElementInst &I) {
- const Type *EltTy = I.getType()->getElementType();
- writeOperand(I.getOperand(0));
- Out << ";\n ";
- Out << "((";
- printType(Out, PointerType::getUnqual(EltTy));
- Out << ")(&" << GetValueName(&I) << "))[";
- writeOperand(I.getOperand(2));
- Out << "] = (";
- writeOperand(I.getOperand(1));
- Out << ")";
-}
-
-void CWriter::visitExtractElementInst(ExtractElementInst &I) {
- // We know that our operand is not inlined.
- Out << "((";
- const Type *EltTy =
- cast<VectorType>(I.getOperand(0)->getType())->getElementType();
- printType(Out, PointerType::getUnqual(EltTy));
- Out << ")(&" << GetValueName(I.getOperand(0)) << "))[";
- writeOperand(I.getOperand(1));
- Out << "]";
-}
-
-void CWriter::visitShuffleVectorInst(ShuffleVectorInst &SVI) {
- Out << "(";
- printType(Out, SVI.getType());
- Out << "){ ";
- const VectorType *VT = SVI.getType();
- unsigned NumElts = VT->getNumElements();
- const Type *EltTy = VT->getElementType();
-
- for (unsigned i = 0; i != NumElts; ++i) {
- if (i) Out << ", ";
- int SrcVal = SVI.getMaskValue(i);
- if ((unsigned)SrcVal >= NumElts*2) {
- Out << " 0/*undef*/ ";
- } else {
- Value *Op = SVI.getOperand((unsigned)SrcVal >= NumElts);
- if (isa<Instruction>(Op)) {
- // Do an extractelement of this value from the appropriate input.
- Out << "((";
- printType(Out, PointerType::getUnqual(EltTy));
- Out << ")(&" << GetValueName(Op)
- << "))[" << (SrcVal & NumElts-1) << "]";
- } else if (isa<ConstantAggregateZero>(Op) || isa<UndefValue>(Op)) {
- Out << "0";
- } else {
- printConstant(cast<ConstantVector>(Op)->getOperand(SrcVal & NumElts-1));
- }
- }
- }
- Out << "}";
-}
-
-void CWriter::visitGetResultInst(GetResultInst &GRI) {
- Out << "(";
- if (isa<UndefValue>(GRI.getOperand(0))) {
- Out << "(";
- printType(Out, GRI.getType());
- Out << ") 0/*UNDEF*/";
- } else {
- Out << GetValueName(GRI.getOperand(0)) << ".field" << GRI.getIndex();
- }
- Out << ")";
-}
-
-//===----------------------------------------------------------------------===//
-// External Interface declaration
-//===----------------------------------------------------------------------===//
-
-bool CTargetMachine::addPassesToEmitWholeFile(PassManager &PM,
- std::ostream &o,
- CodeGenFileType FileType,
- bool Fast) {
- if (FileType != TargetMachine::AssemblyFile) return true;
-
- PM.add(createGCLoweringPass());
- PM.add(createLowerAllocationsPass(true));
- PM.add(createLowerInvokePass());
- PM.add(createCFGSimplificationPass()); // clean up after lower invoke.
- PM.add(new CBackendNameAllUsedStructsAndMergeFunctions());
- PM.add(new CWriter(o));
- PM.add(createCollectorMetadataDeleter());
- return false;
-}
diff --git a/release_23/lib/Target/CBackend/CTargetMachine.h b/release_23/lib/Target/CBackend/CTargetMachine.h
deleted file mode 100644
index 7b5775a947de..000000000000
--- a/release_23/lib/Target/CBackend/CTargetMachine.h
+++ /dev/null
@@ -1,41 +0,0 @@
-//===-- CTargetMachine.h - TargetMachine for the C backend ------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file declares the TargetMachine that is used by the C backend.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef CTARGETMACHINE_H
-#define CTARGETMACHINE_H
-
-#include "llvm/Target/TargetMachine.h"
-#include "llvm/Target/TargetData.h"
-
-namespace llvm {
-
-struct CTargetMachine : public TargetMachine {
- const TargetData DataLayout; // Calculates type size & alignment
-
- CTargetMachine(const Module &M, const std::string &FS)
- : DataLayout(&M) {}
-
- virtual bool WantsWholeFile() const { return true; }
- virtual bool addPassesToEmitWholeFile(PassManager &PM, std::ostream &Out,
- CodeGenFileType FileType, bool Fast);
-
- // This class always works, but shouldn't be the default in most cases.
- static unsigned getModuleMatchQuality(const Module &M) { return 1; }
-
- virtual const TargetData *getTargetData() const { return &DataLayout; }
-};
-
-} // End llvm namespace
-
-
-#endif
diff --git a/release_23/lib/Target/CBackend/Makefile b/release_23/lib/Target/CBackend/Makefile
deleted file mode 100644
index 511e320a8f14..000000000000
--- a/release_23/lib/Target/CBackend/Makefile
+++ /dev/null
@@ -1,14 +0,0 @@
-##===- lib/Target/CBackend/Makefile ------------------------*- Makefile -*-===##
-#
-# The LLVM Compiler Infrastructure
-#
-# This file is distributed under the University of Illinois Open Source
-# License. See LICENSE.TXT for details.
-#
-##===----------------------------------------------------------------------===##
-
-LEVEL = ../../..
-LIBRARYNAME = LLVMCBackend
-include $(LEVEL)/Makefile.common
-
-CompileCommonOpts += -Wno-format
diff --git a/release_23/lib/Target/CellSPU/CellSDKIntrinsics.td b/release_23/lib/Target/CellSPU/CellSDKIntrinsics.td
deleted file mode 100644
index 5d759a41c2c0..000000000000
--- a/release_23/lib/Target/CellSPU/CellSDKIntrinsics.td
+++ /dev/null
@@ -1,448 +0,0 @@
-//===-- CellSDKIntrinsics.td - Cell SDK Intrinsics ---------*- tablegen -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-///--==-- Arithmetic ops intrinsics --==--
-def CellSDKah:
- RR_Int_v8i16<0b00010011000, "ah", IntegerOp, int_spu_si_ah>;
-def CellSDKahi:
- RI10_Int_v8i16<0b00010011000, "ahi", IntegerOp, int_spu_si_ahi>;
-def CellSDKa:
- RR_Int_v4i32<0b00000011000, "a", IntegerOp, int_spu_si_a>;
-def CellSDKai:
- RI10_Int_v4i32<0b00111000, "ai", IntegerOp, int_spu_si_ai>;
-def CellSDKsfh:
- RR_Int_v8i16<0b00010010000, "sfh", IntegerOp, int_spu_si_sfh>;
-def CellSDKsfhi:
- RI10_Int_v8i16<0b10110000, "sfhi", IntegerOp, int_spu_si_sfhi>;
-def CellSDKsf:
- RR_Int_v4i32<0b00000010000, "sf", IntegerOp, int_spu_si_sf>;
-def CellSDKsfi:
- RI10_Int_v4i32<0b00110000, "sfi", IntegerOp, int_spu_si_sfi>;
-def CellSDKaddx:
- RR_Int_v4i32<0b00000010110, "addx", IntegerOp, int_spu_si_addx>;
-def CellSDKcg:
- RR_Int_v4i32<0b0100001100, "cg", IntegerOp, int_spu_si_cg>;
-def CellSDKcgx:
- RR_Int_v4i32<0b01000010110, "cgx", IntegerOp, int_spu_si_cgx>;
-def CellSDKsfx:
- RR_Int_v4i32<0b10000010110, "sfx", IntegerOp, int_spu_si_sfx>;
-def CellSDKbg:
- RR_Int_v4i32<0b01000010000, "bg", IntegerOp, int_spu_si_bg>;
-def CellSDKbgx:
- RR_Int_v4i32<0b11000010110, "bgx", IntegerOp, int_spu_si_bgx>;
-
-def CellSDKmpy:
- RRForm<0b00100011110, (outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB),
- "mpy $rT, $rA, $rB", IntegerMulDiv,
- [(set (v4i32 VECREG:$rT), (int_spu_si_mpy (v8i16 VECREG:$rA),
- (v8i16 VECREG:$rB)))]>;
-
-def CellSDKmpyu:
- RRForm<0b00110011110, (outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB),
- "mpyu $rT, $rA, $rB", IntegerMulDiv,
- [(set (v4i32 VECREG:$rT), (int_spu_si_mpyu (v8i16 VECREG:$rA),
- (v8i16 VECREG:$rB)))] >;
-
-def CellSDKmpyi:
- RI10Form<0b00101110, (outs VECREG:$rT), (ins VECREG:$rA, s10imm:$val),
- "mpyi $rT, $rA, $val", IntegerMulDiv,
- [(set (v4i32 VECREG:$rT), (int_spu_si_mpyi (v8i16 VECREG:$rA),
- i16ImmSExt10:$val))]>;
-
-def CellSDKmpyui:
- RI10Form<0b10101110, (outs VECREG:$rT), (ins VECREG:$rA, s10imm:$val),
- "mpyui $rT, $rA, $val", IntegerMulDiv,
- [(set (v4i32 VECREG:$rT), (int_spu_si_mpyui (v8i16 VECREG:$rA),
- i16ImmSExt10:$val))]>;
-
-def CellSDKmpya:
- RRRForm<0b0011, (outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB, VECREG:$rC),
- "mpya $rT, $rA, $rB, $rC", IntegerMulDiv,
- [(set (v4i32 VECREG:$rT), (int_spu_si_mpya (v8i16 VECREG:$rA),
- (v8i16 VECREG:$rB),
- (v8i16 VECREG:$rC)))]>;
-
-def CellSDKmpyh:
- RRForm<0b10100011110, (outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB),
- "mpyh $rT, $rA, $rB", IntegerMulDiv,
- [(set (v4i32 VECREG:$rT), (int_spu_si_mpyh (v4i32 VECREG:$rA),
- (v8i16 VECREG:$rB)))]>;
-
-def CellSDKmpys:
- RRForm<0b11100011110, (outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB),
- "mpys $rT, $rA, $rB", IntegerMulDiv,
- [(set (v4i32 VECREG:$rT), (int_spu_si_mpys (v8i16 VECREG:$rA),
- (v8i16 VECREG:$rB)))]>;
-
-def CellSDKmpyhh:
- RRForm<0b01100011110, (outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB),
- "mpyhh $rT, $rA, $rB", IntegerMulDiv,
- [(set (v4i32 VECREG:$rT), (int_spu_si_mpyhh (v8i16 VECREG:$rA),
- (v8i16 VECREG:$rB)))]>;
-
-def CellSDKmpyhha:
- RRForm<0b01100010110, (outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB),
- "mpyhha $rT, $rA, $rB", IntegerMulDiv,
- [(set (v4i32 VECREG:$rT), (int_spu_si_mpyhha (v8i16 VECREG:$rA),
- (v8i16 VECREG:$rB)))]>;
-
-// Not sure how to match a (set $rT, (add $rT (mpyhh $rA, $rB)))... so leave
-// as an intrinsic for the time being
-def CellSDKmpyhhu:
- RRForm<0b01110011110, (outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB),
- "mpyhhu $rT, $rA, $rB", IntegerMulDiv,
- [(set (v4i32 VECREG:$rT), (int_spu_si_mpyhhu (v8i16 VECREG:$rA),
- (v8i16 VECREG:$rB)))]>;
-
-def CellSDKmpyhhau:
- RRForm<0b01110010110, (outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB),
- "mpyhhau $rT, $rA, $rB", IntegerMulDiv,
- [(set (v4i32 VECREG:$rT), (int_spu_si_mpyhhau (v8i16 VECREG:$rA),
- (v8i16 VECREG:$rB)))]>;
-
-def CellSDKand:
- RRForm<0b1000011000, (outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB),
- "and\t $rT, $rA, $rB", IntegerOp,
- [(set (v4i32 VECREG:$rT),
- (int_spu_si_and (v4i32 VECREG:$rA), (v4i32 VECREG:$rB)))]>;
-
-def CellSDKandc:
- RRForm<0b10000011010, (outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB),
- "andc\t $rT, $rA, $rB", IntegerOp,
- [(set (v4i32 VECREG:$rT),
- (int_spu_si_andc (v4i32 VECREG:$rA), (v4i32 VECREG:$rB)))]>;
-
-def CellSDKandbi:
- RI10Form<0b01101000, (outs VECREG:$rT), (ins VECREG:$rA, u10imm_i8:$val),
- "andbi\t $rT, $rA, $val", BranchResolv,
- [(set (v16i8 VECREG:$rT),
- (int_spu_si_andbi (v16i8 VECREG:$rA), immU8:$val))]>;
-
-def CellSDKandhi:
- RI10Form<0b10101000, (outs VECREG:$rT), (ins VECREG:$rA, s10imm:$val),
- "andhi\t $rT, $rA, $val", BranchResolv,
- [(set (v8i16 VECREG:$rT),
- (int_spu_si_andhi (v8i16 VECREG:$rA), i16ImmSExt10:$val))]>;
-
-def CellSDKandi:
- RI10Form<0b00101000, (outs VECREG:$rT), (ins VECREG:$rA, s10imm:$val),
- "andi\t $rT, $rA, $val", BranchResolv,
- [(set (v4i32 VECREG:$rT),
- (int_spu_si_andi (v4i32 VECREG:$rA), i32ImmSExt10:$val))]>;
-
-def CellSDKor:
- RRForm<0b10000010000, (outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB),
- "or\t $rT, $rA, $rB", IntegerOp,
- [(set (v4i32 VECREG:$rT),
- (int_spu_si_or (v4i32 VECREG:$rA), (v4i32 VECREG:$rB)))]>;
-
-def CellSDKorc:
- RRForm<0b10010011010, (outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB),
- "addc\t $rT, $rA, $rB", IntegerOp,
- [(set (v4i32 VECREG:$rT),
- (int_spu_si_orc (v4i32 VECREG:$rA), (v4i32 VECREG:$rB)))]>;
-
-def CellSDKorbi:
- RI10Form<0b01100000, (outs VECREG:$rT), (ins VECREG:$rA, u10imm_i8:$val),
- "orbi\t $rT, $rA, $val", BranchResolv,
- [(set (v16i8 VECREG:$rT),
- (int_spu_si_orbi (v16i8 VECREG:$rA), immU8:$val))]>;
-
-def CellSDKorhi:
- RI10Form<0b10100000, (outs VECREG:$rT), (ins VECREG:$rA, s10imm:$val),
- "orhi\t $rT, $rA, $val", BranchResolv,
- [(set (v8i16 VECREG:$rT),
- (int_spu_si_orhi (v8i16 VECREG:$rA), i16ImmSExt10:$val))]>;
-
-def CellSDKori:
- RI10Form<0b00100000, (outs VECREG:$rT), (ins VECREG:$rA, s10imm:$val),
- "ori\t $rT, $rA, $val", BranchResolv,
- [(set (v4i32 VECREG:$rT),
- (int_spu_si_ori (v4i32 VECREG:$rA), i32ImmSExt10:$val))]>;
-
-def CellSDKxor:
- RRForm<0b10000010000, (outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB),
- "xor\t $rT, $rA, $rB", IntegerOp,
- [(set (v4i32 VECREG:$rT),
- (int_spu_si_xor (v4i32 VECREG:$rA), (v4i32 VECREG:$rB)))]>;
-
-def CellSDKxorbi:
- RI10Form<0b01100000, (outs VECREG:$rT), (ins VECREG:$rA, u10imm_i8:$val),
- "xorbi\t $rT, $rA, $val", BranchResolv,
- [(set (v16i8 VECREG:$rT), (int_spu_si_xorbi (v16i8 VECREG:$rA), immU8:$val))]>;
-
-def CellSDKxorhi:
- RI10Form<0b10100000, (outs VECREG:$rT), (ins VECREG:$rA, s10imm:$val),
- "xorhi\t $rT, $rA, $val", BranchResolv,
- [(set (v8i16 VECREG:$rT),
- (int_spu_si_xorhi (v8i16 VECREG:$rA), i16ImmSExt10:$val))]>;
-
-def CellSDKxori:
- RI10Form<0b00100000, (outs VECREG:$rT), (ins VECREG:$rA, s10imm:$val),
- "xori\t $rT, $rA, $val", BranchResolv,
- [(set (v4i32 VECREG:$rT),
- (int_spu_si_xori (v4i32 VECREG:$rA), i32ImmSExt10:$val))]>;
-
-def CellSDKnor:
- RRForm<0b10000010000, (outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB),
- "nor\t $rT, $rA, $rB", IntegerOp,
- [(set (v4i32 VECREG:$rT),
- (int_spu_si_nor (v4i32 VECREG:$rA), (v4i32 VECREG:$rB)))]>;
-
-def CellSDKnand:
- RRForm<0b10000010000, (outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB),
- "nand\t $rT, $rA, $rB", IntegerOp,
- [(set (v4i32 VECREG:$rT),
- (int_spu_si_nand (v4i32 VECREG:$rA), (v4i32 VECREG:$rB)))]>;
-
-//===----------------------------------------------------------------------===//
-// Shift/rotate intrinsics:
-//===----------------------------------------------------------------------===//
-
-def CellSDKshli:
- Pat<(int_spu_si_shli (v4i32 VECREG:$rA), uimm7:$val),
- (SHLIv4i32 VECREG:$rA, uimm7:$val)>;
-
-def CellSDKshlqbi:
- Pat<(int_spu_si_shlqbi VECREG:$rA, R32C:$rB),
- (SHLQBIv16i8 VECREG:$rA, R32C:$rB)>;
-
-def CellSDKshlqii:
- Pat<(int_spu_si_shlqbii VECREG:$rA, uimm7:$val),
- (SHLQBIIv16i8 VECREG:$rA, uimm7:$val)>;
-
-def CellSDKshlqby:
- Pat<(int_spu_si_shlqby VECREG:$rA, R32C:$rB),
- (SHLQBYv16i8 VECREG:$rA, R32C:$rB)>;
-
-def CellSDKshlqbyi:
- Pat<(int_spu_si_shlqbyi VECREG:$rA, uimm7:$val),
- (SHLQBYIv16i8 VECREG:$rA, uimm7:$val)>;
-
-//===----------------------------------------------------------------------===//
-// Branch/compare intrinsics:
-//===----------------------------------------------------------------------===//
-
-def CellSDKceq:
- RRForm<0b00000011110, (outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB),
- "ceq\t $rT, $rA, $rB", BranchResolv,
- [(set (v4i32 VECREG:$rT),
- (int_spu_si_ceq (v4i32 VECREG:$rA), (v4i32 VECREG:$rB)))]>;
-
-def CellSDKceqi:
- RI10Form<0b00111110, (outs VECREG:$rT), (ins VECREG:$rA, s10imm:$val),
- "ceqi\t $rT, $rA, $val", BranchResolv,
- [(set (v4i32 VECREG:$rT),
- (int_spu_si_ceqi (v4i32 VECREG:$rA), i32ImmSExt10:$val))]>;
-
-def CellSDKceqb:
- RRForm<0b00001011110, (outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB),
- "ceqb\t $rT, $rA, $rB", BranchResolv,
- [(set (v16i8 VECREG:$rT),
- (int_spu_si_ceqb (v16i8 VECREG:$rA), (v16i8 VECREG:$rB)))]>;
-
-def CellSDKceqbi:
- RI10Form<0b01111110, (outs VECREG:$rT), (ins VECREG:$rA, u10imm_i8:$val),
- "ceqbi\t $rT, $rA, $val", BranchResolv,
- [(set (v16i8 VECREG:$rT), (int_spu_si_ceqbi (v16i8 VECREG:$rA), immU8:$val))]>;
-
-def CellSDKceqh:
- RRForm<0b00010011110, (outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB),
- "ceqh\t $rT, $rA, $rB", BranchResolv,
- [(set (v8i16 VECREG:$rT),
- (int_spu_si_ceqh (v8i16 VECREG:$rA), (v8i16 VECREG:$rB)))]>;
-
-def CellSDKceqhi:
- RI10Form<0b10111110, (outs VECREG:$rT), (ins VECREG:$rA, s10imm:$val),
- "ceqhi\t $rT, $rA, $val", BranchResolv,
- [(set (v8i16 VECREG:$rT),
- (int_spu_si_ceqhi (v8i16 VECREG:$rA), i16ImmSExt10:$val))]>;
-def CellSDKcgth:
- RRForm<0b00010011110, (outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB),
- "cgth\t $rT, $rA, $rB", BranchResolv,
- [(set (v8i16 VECREG:$rT),
- (int_spu_si_cgth (v8i16 VECREG:$rA), (v8i16 VECREG:$rB)))]>;
-
-def CellSDKcgthi:
- RI10Form<0b10111110, (outs VECREG:$rT), (ins VECREG:$rA, s10imm:$val),
- "cgthi\t $rT, $rA, $val", BranchResolv,
- [(set (v8i16 VECREG:$rT),
- (int_spu_si_cgthi (v8i16 VECREG:$rA), i16ImmSExt10:$val))]>;
-
-def CellSDKcgt:
- RRForm<0b00000010010, (outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB),
- "cgt\t $rT, $rA, $rB", BranchResolv,
- [(set (v4i32 VECREG:$rT),
- (int_spu_si_cgt (v4i32 VECREG:$rA), (v4i32 VECREG:$rB)))]>;
-
-def CellSDKcgti:
- RI10Form<0b00110010, (outs VECREG:$rT), (ins VECREG:$rA, s10imm:$val),
- "cgti\t $rT, $rA, $val", BranchResolv,
- [(set (v4i32 VECREG:$rT),
- (int_spu_si_cgti (v4i32 VECREG:$rA), i32ImmSExt10:$val))]>;
-
-def CellSDKcgtb:
- RRForm<0b00001010010, (outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB),
- "cgtb\t $rT, $rA, $rB", BranchResolv,
- [(set (v16i8 VECREG:$rT),
- (int_spu_si_cgtb (v16i8 VECREG:$rA), (v16i8 VECREG:$rB)))]>;
-
-def CellSDKcgtbi:
- RI10Form<0b01110010, (outs VECREG:$rT), (ins VECREG:$rA, u10imm_i8:$val),
- "cgtbi\t $rT, $rA, $val", BranchResolv,
- [(set (v16i8 VECREG:$rT), (int_spu_si_cgtbi (v16i8 VECREG:$rA), immU8:$val))]>;
-
-def CellSDKclgth:
- RRForm<0b00010011010, (outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB),
- "clgth\t $rT, $rA, $rB", BranchResolv,
- [(set (v8i16 VECREG:$rT),
- (int_spu_si_clgth (v8i16 VECREG:$rA), (v8i16 VECREG:$rB)))]>;
-
-def CellSDKclgthi:
- RI10Form<0b10111010, (outs VECREG:$rT), (ins VECREG:$rA, s10imm:$val),
- "clgthi\t $rT, $rA, $val", BranchResolv,
- [(set (v8i16 VECREG:$rT),
- (int_spu_si_clgthi (v8i16 VECREG:$rA), i16ImmSExt10:$val))]>;
-
-def CellSDKclgt:
- RRForm<0b00000011010, (outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB),
- "clgt\t $rT, $rA, $rB", BranchResolv,
- [(set (v4i32 VECREG:$rT),
- (int_spu_si_clgt (v4i32 VECREG:$rA), (v4i32 VECREG:$rB)))]>;
-
-def CellSDKclgti:
- RI10Form<0b00111010, (outs VECREG:$rT), (ins VECREG:$rA, s10imm:$val),
- "clgti\t $rT, $rA, $val", BranchResolv,
- [(set (v4i32 VECREG:$rT),
- (int_spu_si_clgti (v4i32 VECREG:$rA), i32ImmSExt10:$val))]>;
-
-def CellSDKclgtb:
- RRForm<0b00001011010, (outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB),
- "clgtb\t $rT, $rA, $rB", BranchResolv,
- [(set (v16i8 VECREG:$rT),
- (int_spu_si_clgtb (v16i8 VECREG:$rA), (v16i8 VECREG:$rB)))]>;
-
-def CellSDKclgtbi:
- RI10Form<0b01111010, (outs VECREG:$rT), (ins VECREG:$rA, u10imm_i8:$val),
- "clgtbi\t $rT, $rA, $val", BranchResolv,
- [(set (v16i8 VECREG:$rT),
- (int_spu_si_clgtbi (v16i8 VECREG:$rA), immU8:$val))]>;
-
-//===----------------------------------------------------------------------===//
-// Floating-point intrinsics:
-//===----------------------------------------------------------------------===//
-
-def CellSDKfa:
- RRForm<0b00100011010, (outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB),
- "fa\t $rT, $rA, $rB", SPrecFP,
- [(set (v4f32 VECREG:$rT), (int_spu_si_fa (v4f32 VECREG:$rA),
- (v4f32 VECREG:$rB)))]>;
-
-def CellSDKfs:
- RRForm<0b10100011010, (outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB),
- "fs\t $rT, $rA, $rB", SPrecFP,
- [(set (v4f32 VECREG:$rT), (int_spu_si_fs (v4f32 VECREG:$rA),
- (v4f32 VECREG:$rB)))]>;
-
-def CellSDKfm:
- RRForm<0b01100011010, (outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB),
- "fm\t $rT, $rA, $rB", SPrecFP,
- [(set (v4f32 VECREG:$rT), (int_spu_si_fm (v4f32 VECREG:$rA),
- (v4f32 VECREG:$rB)))]>;
-
-def CellSDKfceq:
- RRForm<0b01000011110, (outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB),
- "fceq\t $rT, $rA, $rB", SPrecFP,
- [(set (v4f32 VECREG:$rT), (int_spu_si_fceq (v4f32 VECREG:$rA),
- (v4f32 VECREG:$rB)))]>;
-
-def CellSDKfcgt:
- RRForm<0b01000011010, (outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB),
- "fcgt\t $rT, $rA, $rB", SPrecFP,
- [(set (v4f32 VECREG:$rT), (int_spu_si_fcgt (v4f32 VECREG:$rA),
- (v4f32 VECREG:$rB)))]>;
-
-def CellSDKfcmeq:
- RRForm<0b01010011110, (outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB),
- "fcmeq\t $rT, $rA, $rB", SPrecFP,
- [(set (v4f32 VECREG:$rT), (int_spu_si_fcmeq (v4f32 VECREG:$rA),
- (v4f32 VECREG:$rB)))]>;
-
-def CellSDKfcmgt:
- RRForm<0b01010011010, (outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB),
- "fcmgt\t $rT, $rA, $rB", SPrecFP,
- [(set (v4f32 VECREG:$rT), (int_spu_si_fcmgt (v4f32 VECREG:$rA),
- (v4f32 VECREG:$rB)))]>;
-
-def CellSDKfma:
- RRRForm<0b0111, (outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB, VECREG:$rC),
- "fma\t $rT, $rA, $rB, $rC", SPrecFP,
- [(set (v4f32 VECREG:$rT), (int_spu_si_fma (v4f32 VECREG:$rA),
- (v4f32 VECREG:$rB),
- (v4f32 VECREG:$rC)))]>;
-
-def CellSDKfnms:
- RRRForm<0b1011, (outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB, VECREG:$rC),
- "fnms\t $rT, $rA, $rB, $rC", SPrecFP,
- [(set (v4f32 VECREG:$rT), (int_spu_si_fnms (v4f32 VECREG:$rA),
- (v4f32 VECREG:$rB),
- (v4f32 VECREG:$rC)))]>;
-
-def CellSDKfms:
- RRRForm<0b1111, (outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB, VECREG:$rC),
- "fms\t $rT, $rA, $rB, $rC", SPrecFP,
- [(set (v4f32 VECREG:$rT), (int_spu_si_fms (v4f32 VECREG:$rA),
- (v4f32 VECREG:$rB),
- (v4f32 VECREG:$rC)))]>;
-
-//===----------------------------------------------------------------------===//
-// Double precision floating-point intrinsics:
-//===----------------------------------------------------------------------===//
-
-def CellSDKdfa:
- RRForm<0b00110011010, (outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB),
- "dfa\t $rT, $rA, $rB", DPrecFP,
- [(set (v2f64 VECREG:$rT), (int_spu_si_dfa (v2f64 VECREG:$rA),
- (v2f64 VECREG:$rB)))]>;
-
-def CellSDKdfs:
- RRForm<0b10110011010, (outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB),
- "dfs\t $rT, $rA, $rB", DPrecFP,
- [(set (v2f64 VECREG:$rT), (int_spu_si_dfs (v2f64 VECREG:$rA),
- (v2f64 VECREG:$rB)))]>;
-
-def CellSDKdfm:
- RRForm<0b01110011010, (outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB),
- "dfm\t $rT, $rA, $rB", DPrecFP,
- [(set (v2f64 VECREG:$rT), (int_spu_si_dfm (v2f64 VECREG:$rA),
- (v2f64 VECREG:$rB)))]>;
-
-def CellSDKdfma:
- RRForm<0b00111010110, (outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB),
- "dfma\t $rT, $rA, $rB", DPrecFP,
- [(set (v2f64 VECREG:$rT), (int_spu_si_dfma (v2f64 VECREG:$rA),
- (v2f64 VECREG:$rB)))]>;
-
-def CellSDKdfnma:
- RRForm<0b11111010110, (outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB),
- "dfnma\t $rT, $rA, $rB", DPrecFP,
- [(set (v2f64 VECREG:$rT), (int_spu_si_dfnma (v2f64 VECREG:$rA),
- (v2f64 VECREG:$rB)))]>;
-
-def CellSDKdfnms:
- RRForm<0b01111010110, (outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB),
- "dfnms\t $rT, $rA, $rB", DPrecFP,
- [(set (v2f64 VECREG:$rT), (int_spu_si_dfnms (v2f64 VECREG:$rA),
- (v2f64 VECREG:$rB)))]>;
-
-def CellSDKdfms:
- RRForm<0b10111010110, (outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB),
- "dfms\t $rT, $rA, $rB", DPrecFP,
- [(set (v2f64 VECREG:$rT), (int_spu_si_dfms (v2f64 VECREG:$rA),
- (v2f64 VECREG:$rB)))]>;
diff --git a/release_23/lib/Target/CellSPU/Makefile b/release_23/lib/Target/CellSPU/Makefile
deleted file mode 100644
index 13fa78195ff8..000000000000
--- a/release_23/lib/Target/CellSPU/Makefile
+++ /dev/null
@@ -1,20 +0,0 @@
-##===- lib/Target/CellSPU/Makefile -------------------------*- Makefile -*-===##
-#
-# The LLVM Compiler Infrastructure
-#
-# This file is distributed under the University of Illinois Open Source
-# License. See LICENSE.TXT for details.
-#
-##===----------------------------------------------------------------------===##
-
-LEVEL = ../../..
-LIBRARYNAME = LLVMCellSPU
-TARGET = SPU
-
-BUILT_SOURCES = SPUGenInstrNames.inc SPUGenRegisterNames.inc \
- SPUGenAsmWriter.inc SPUGenCodeEmitter.inc \
- SPUGenRegisterInfo.h.inc SPUGenRegisterInfo.inc \
- SPUGenInstrInfo.inc SPUGenDAGISel.inc \
- SPUGenSubtarget.inc SPUGenCallingConv.inc
-
-include $(LEVEL)/Makefile.common
diff --git a/release_23/lib/Target/CellSPU/README.txt b/release_23/lib/Target/CellSPU/README.txt
deleted file mode 100644
index 1d90f2a77c3d..000000000000
--- a/release_23/lib/Target/CellSPU/README.txt
+++ /dev/null
@@ -1,50 +0,0 @@
-//===- README.txt - Notes for improving CellSPU-specific code gen ---------===//
-
-This code was contributed by a team from the Computer Systems Research
-Department in The Aerospace Corporation:
-
-- Scott Michel (head bottle washer and much of the non-floating point
- instructions)
-- Mark Thomas (floating point instructions)
-- Michael AuYeung (intrinsics)
-- Chandler Carruth (LLVM expertise)
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR
-OTHERWISE. IN NO EVENT SHALL THE AEROSPACE CORPORATION BE LIABLE FOR DAMAGES
-OF ANY KIND OR NATURE WHETHER BASED IN CONTRACT, TORT, OR OTHERWISE ARISING
-OUT OF OR IN CONNECTION WITH THE USE OF THE SOFTWARE INCLUDING, WITHOUT
-LIMITATION, DAMAGES RESULTING FROM LOST OR CONTAMINATED DATA, LOST PROFITS OR
-REVENUE, COMPUTER MALFUNCTION, OR FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL,
-OR PUNITIVE DAMAGES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES OR
-SUCH DAMAGES ARE FORESEEABLE.
-
----------------------------------------------------------------------------
---WARNING--:
---WARNING--: The CellSPU work is work-in-progress and "alpha" quality code.
---WARNING--:
-
-If you are brave enough to try this code or help to hack on it, be sure
-to add 'spu' to configure's --enable-targets option, e.g.:
-
- ./configure <your_configure_flags_here> \
- --enable-targets=x86,x86_64,powerpc,spu
-
----------------------------------------------------------------------------
-
-TODO:
-* Finish branch instructions, branch prediction
-
- These instructions were started, but only insofar as to get llvm-gcc-4.2's
- crtbegin.ll working (which doesn't.)
-
-* Double floating point support
-
- This was started. "What's missing?" to be filled in.
-
-* Intrinsics
-
- Lots of progress. "What's missing/incomplete?" to be filled in.
-
-===-------------------------------------------------------------------------===
diff --git a/release_23/lib/Target/CellSPU/SPU.h b/release_23/lib/Target/CellSPU/SPU.h
deleted file mode 100644
index 9fbf524e02ad..000000000000
--- a/release_23/lib/Target/CellSPU/SPU.h
+++ /dev/null
@@ -1,89 +0,0 @@
-//===-- SPU.h - Top-level interface for Cell SPU Target ----------*- C++ -*-==//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains the entry points for global functions defined in the LLVM
-// Cell SPU back-end.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_TARGET_IBMCELLSPU_H
-#define LLVM_TARGET_IBMCELLSPU_H
-
-#include <iosfwd>
-
-namespace llvm {
- class SPUTargetMachine;
- class FunctionPass;
-
- FunctionPass *createSPUISelDag(SPUTargetMachine &TM);
- FunctionPass *createSPUAsmPrinterPass(std::ostream &o, SPUTargetMachine &tm);
-
- /*--== Utility functions/predicates/etc used all over the place: --==*/
- //! Predicate test for a signed 10-bit value
- /*!
- \param Value The input value to be tested
-
- This predicate tests for a signed 10-bit value, returning the 10-bit value
- as a short if true.
- */
- inline bool isS10Constant(short Value) {
- int SExtValue = ((int) Value << (32 - 10)) >> (32 - 10);
- return ((Value > 0 && Value <= (1 << 9) - 1)
- || (Value < 0 && (short) SExtValue == Value));
- }
-
- inline bool isS10Constant(int Value) {
- return (Value >= -(1 << 9) && Value <= (1 << 9) - 1);
- }
-
- inline bool isS10Constant(uint32_t Value) {
- return (Value <= ((1 << 9) - 1));
- }
-
- inline bool isS10Constant(int64_t Value) {
- return (Value >= -(1 << 9) && Value <= (1 << 9) - 1);
- }
-
- inline bool isS10Constant(uint64_t Value) {
- return (Value <= ((1 << 9) - 1));
- }
-
- //! Predicate test for an unsigned 10-bit value
- /*!
- \param Value The input value to be tested
-
- This predicate tests for an unsigned 10-bit value, returning the 10-bit value
- as a short if true.
- */
- inline bool isU10Constant(short Value) {
- return (Value == (Value & 0x3ff));
- }
-
- inline bool isU10Constant(int Value) {
- return (Value == (Value & 0x3ff));
- }
-
- inline bool isU10Constant(uint32_t Value) {
- return (Value == (Value & 0x3ff));
- }
-
- inline bool isU10Constant(int64_t Value) {
- return (Value == (Value & 0x3ff));
- }
-
- inline bool isU10Constant(uint64_t Value) {
- return (Value == (Value & 0x3ff));
- }
-}
-
-// Defines symbolic names for the SPU instructions.
-//
-#include "SPUGenInstrNames.inc"
-
-#endif /* LLVM_TARGET_IBMCELLSPU_H */
diff --git a/release_23/lib/Target/CellSPU/SPU.td b/release_23/lib/Target/CellSPU/SPU.td
deleted file mode 100644
index 15809f208b2e..000000000000
--- a/release_23/lib/Target/CellSPU/SPU.td
+++ /dev/null
@@ -1,59 +0,0 @@
-//===- SPU.td - Describe the STI Cell SPU Target Machine ----*- tablegen -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This is the top level entry point for the STI Cell SPU target machine.
-//
-//===----------------------------------------------------------------------===//
-
-// Get the target-independent interfaces which we are implementing.
-//
-include "../Target.td"
-
-//===----------------------------------------------------------------------===//
-// Register File Description
-//===----------------------------------------------------------------------===//
-
-include "SPURegisterInfo.td"
-
-//===----------------------------------------------------------------------===//
-// Instruction formats, instructions
-//===----------------------------------------------------------------------===//
-
-include "SPUNodes.td"
-include "SPUOperands.td"
-include "SPUSchedule.td"
-include "SPUInstrFormats.td"
-include "SPUInstrInfo.td"
-
-//===----------------------------------------------------------------------===//
-// Subtarget features:
-//===----------------------------------------------------------------------===//
-
-def DefaultProc: SubtargetFeature<"", "ProcDirective", "SPU::DEFAULT_PROC", "">;
-def LargeMemFeature:
- SubtargetFeature<"large_mem","UseLargeMem", "true",
- "Use large (>256) LSA memory addressing [default = false]">;
-
-def SPURev0 : Processor<"v0", SPUItineraries, [DefaultProc]>;
-
-//===----------------------------------------------------------------------===//
-// Calling convention:
-//===----------------------------------------------------------------------===//
-
-include "SPUCallingConv.td"
-
-// Target:
-
-def SPUInstrInfo : InstrInfo {
- let isLittleEndianEncoding = 1;
-}
-
-def SPU : Target {
- let InstructionSet = SPUInstrInfo;
-}
diff --git a/release_23/lib/Target/CellSPU/SPUAsmPrinter.cpp b/release_23/lib/Target/CellSPU/SPUAsmPrinter.cpp
deleted file mode 100644
index f627896f6b89..000000000000
--- a/release_23/lib/Target/CellSPU/SPUAsmPrinter.cpp
+++ /dev/null
@@ -1,655 +0,0 @@
-//===-- SPUAsmPrinter.cpp - Print machine instrs to Cell SPU assembly -------=//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains a printer that converts from our internal representation
-// of machine-dependent LLVM code to Cell SPU assembly language. This printer
-// is the output mechanism used by `llc'.
-//
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "asmprinter"
-#include "SPU.h"
-#include "SPUTargetMachine.h"
-#include "llvm/Constants.h"
-#include "llvm/DerivedTypes.h"
-#include "llvm/Module.h"
-#include "llvm/Assembly/Writer.h"
-#include "llvm/CodeGen/AsmPrinter.h"
-#include "llvm/CodeGen/DwarfWriter.h"
-#include "llvm/CodeGen/MachineModuleInfo.h"
-#include "llvm/CodeGen/MachineFunctionPass.h"
-#include "llvm/CodeGen/MachineInstr.h"
-#include "llvm/Support/Mangler.h"
-#include "llvm/Support/MathExtras.h"
-#include "llvm/Support/CommandLine.h"
-#include "llvm/Support/Debug.h"
-#include "llvm/Support/Compiler.h"
-#include "llvm/Target/TargetAsmInfo.h"
-#include "llvm/Target/TargetRegisterInfo.h"
-#include "llvm/Target/TargetInstrInfo.h"
-#include "llvm/Target/TargetOptions.h"
-#include "llvm/ADT/Statistic.h"
-#include "llvm/ADT/StringExtras.h"
-#include <set>
-using namespace llvm;
-
-namespace {
- STATISTIC(EmittedInsts, "Number of machine instrs printed");
-
- const std::string bss_section(".bss");
-
- struct VISIBILITY_HIDDEN SPUAsmPrinter : public AsmPrinter {
- std::set<std::string> FnStubs, GVStubs;
-
- SPUAsmPrinter(std::ostream &O, TargetMachine &TM, const TargetAsmInfo *T) :
- AsmPrinter(O, TM, T)
- {
- }
-
- virtual const char *getPassName() const {
- return "STI CBEA SPU Assembly Printer";
- }
-
- SPUTargetMachine &getTM() {
- return static_cast<SPUTargetMachine&>(TM);
- }
-
- /// printInstruction - This method is automatically generated by tablegen
- /// from the instruction set description. This method returns true if the
- /// machine instruction was sufficiently described to print it, otherwise it
- /// returns false.
- bool printInstruction(const MachineInstr *MI);
-
- void printMachineInstruction(const MachineInstr *MI);
- void printOp(const MachineOperand &MO);
-
- /// printRegister - Print register according to target requirements.
- ///
- void printRegister(const MachineOperand &MO, bool R0AsZero) {
- unsigned RegNo = MO.getReg();
- assert(TargetRegisterInfo::isPhysicalRegister(RegNo) &&
- "Not physreg??");
- O << TM.getRegisterInfo()->get(RegNo).AsmName;
- }
-
- void printOperand(const MachineInstr *MI, unsigned OpNo) {
- const MachineOperand &MO = MI->getOperand(OpNo);
- if (MO.isRegister()) {
- assert(TargetRegisterInfo::isPhysicalRegister(MO.getReg())&&"Not physreg??");
- O << TM.getRegisterInfo()->get(MO.getReg()).AsmName;
- } else if (MO.isImmediate()) {
- O << MO.getImm();
- } else {
- printOp(MO);
- }
- }
-
- bool PrintAsmOperand(const MachineInstr *MI, unsigned OpNo,
- unsigned AsmVariant, const char *ExtraCode);
- bool PrintAsmMemoryOperand(const MachineInstr *MI, unsigned OpNo,
- unsigned AsmVariant, const char *ExtraCode);
-
-
- void
- printS7ImmOperand(const MachineInstr *MI, unsigned OpNo)
- {
- int value = MI->getOperand(OpNo).getImm();
- value = (value << (32 - 7)) >> (32 - 7);
-
- assert((value >= -(1 << 8) && value <= (1 << 7) - 1)
- && "Invalid s7 argument");
- O << value;
- }
-
- void
- printU7ImmOperand(const MachineInstr *MI, unsigned OpNo)
- {
- unsigned int value = MI->getOperand(OpNo).getImm();
- assert(value < (1 << 8) && "Invalid u7 argument");
- O << value;
- }
-
- void
- printMemRegImmS7(const MachineInstr *MI, unsigned OpNo)
- {
- char value = MI->getOperand(OpNo).getImm();
- O << (int) value;
- O << "(";
- printOperand(MI, OpNo+1);
- O << ")";
- }
-
- void
- printS16ImmOperand(const MachineInstr *MI, unsigned OpNo)
- {
- O << (short) MI->getOperand(OpNo).getImm();
- }
-
- void
- printU16ImmOperand(const MachineInstr *MI, unsigned OpNo)
- {
- O << (unsigned short)MI->getOperand(OpNo).getImm();
- }
-
- void
- printU32ImmOperand(const MachineInstr *MI, unsigned OpNo)
- {
- O << (unsigned)MI->getOperand(OpNo).getImm();
- }
-
- void
- printMemRegReg(const MachineInstr *MI, unsigned OpNo) {
- // When used as the base register, r0 reads constant zero rather than
- // the value contained in the register. For this reason, the darwin
- // assembler requires that we print r0 as 0 (no r) when used as the base.
- const MachineOperand &MO = MI->getOperand(OpNo);
- O << TM.getRegisterInfo()->get(MO.getReg()).AsmName;
- O << ", ";
- printOperand(MI, OpNo+1);
- }
-
- void
- printU18ImmOperand(const MachineInstr *MI, unsigned OpNo)
- {
- unsigned int value = MI->getOperand(OpNo).getImm();
- assert(value <= (1 << 19) - 1 && "Invalid u18 argument");
- O << value;
- }
-
- void
- printS10ImmOperand(const MachineInstr *MI, unsigned OpNo)
- {
- short value = (short) (((int) MI->getOperand(OpNo).getImm() << 16)
- >> 16);
- assert((value >= -(1 << 9) && value <= (1 << 9) - 1)
- && "Invalid s10 argument");
- O << value;
- }
-
- void
- printU10ImmOperand(const MachineInstr *MI, unsigned OpNo)
- {
- short value = (short) (((int) MI->getOperand(OpNo).getImm() << 16)
- >> 16);
- assert((value <= (1 << 10) - 1) && "Invalid u10 argument");
- O << value;
- }
-
- void
- printMemRegImmS10(const MachineInstr *MI, unsigned OpNo)
- {
- const MachineOperand &MO = MI->getOperand(OpNo);
- assert(MO.isImmediate()
- && "printMemRegImmS10 first operand is not immedate");
- printS10ImmOperand(MI, OpNo);
- O << "(";
- printOperand(MI, OpNo+1);
- O << ")";
- }
-
- void
- printAddr256K(const MachineInstr *MI, unsigned OpNo)
- {
- /* Note: operand 1 is an offset or symbol name. */
- if (MI->getOperand(OpNo).isImmediate()) {
- printS16ImmOperand(MI, OpNo);
- } else {
- printOp(MI->getOperand(OpNo));
- if (MI->getOperand(OpNo+1).isImmediate()) {
- int displ = int(MI->getOperand(OpNo+1).getImm());
- if (displ > 0)
- O << "+" << displ;
- else if (displ < 0)
- O << displ;
- }
- }
- }
-
- void printCallOperand(const MachineInstr *MI, unsigned OpNo) {
- printOp(MI->getOperand(OpNo));
- }
-
- void printPCRelativeOperand(const MachineInstr *MI, unsigned OpNo) {
- printOp(MI->getOperand(OpNo));
- O << "-.";
- }
-
- void printSymbolHi(const MachineInstr *MI, unsigned OpNo) {
- if (MI->getOperand(OpNo).isImmediate()) {
- printS16ImmOperand(MI, OpNo);
- } else {
- printOp(MI->getOperand(OpNo));
- O << "@h";
- }
- }
-
- void printSymbolLo(const MachineInstr *MI, unsigned OpNo) {
- if (MI->getOperand(OpNo).isImmediate()) {
- printS16ImmOperand(MI, OpNo);
- } else {
- printOp(MI->getOperand(OpNo));
- O << "@l";
- }
- }
-
- /// Print local store address
- void printSymbolLSA(const MachineInstr *MI, unsigned OpNo) {
- printOp(MI->getOperand(OpNo));
- }
-
- void printROTHNeg7Imm(const MachineInstr *MI, unsigned OpNo) {
- if (MI->getOperand(OpNo).isImmediate()) {
- int value = (int) MI->getOperand(OpNo).getImm();
- assert((value >= 0 && value < 16)
- && "Invalid negated immediate rotate 7-bit argument");
- O << -value;
- } else {
- assert(0 &&"Invalid/non-immediate rotate amount in printRotateNeg7Imm");
- }
- }
-
- void printROTNeg7Imm(const MachineInstr *MI, unsigned OpNo) {
- if (MI->getOperand(OpNo).isImmediate()) {
- int value = (int) MI->getOperand(OpNo).getImm();
- assert((value >= 0 && value < 32)
- && "Invalid negated immediate rotate 7-bit argument");
- O << -value;
- } else {
- assert(0 &&"Invalid/non-immediate rotate amount in printRotateNeg7Imm");
- }
- }
-
- virtual bool runOnMachineFunction(MachineFunction &F) = 0;
- virtual bool doFinalization(Module &M) = 0;
- };
-
- /// LinuxAsmPrinter - SPU assembly printer, customized for Linux
- struct VISIBILITY_HIDDEN LinuxAsmPrinter : public SPUAsmPrinter {
-
- DwarfWriter DW;
-
- LinuxAsmPrinter(std::ostream &O, SPUTargetMachine &TM,
- const TargetAsmInfo *T) :
- SPUAsmPrinter(O, TM, T),
- DW(O, this, T)
- { }
-
- virtual const char *getPassName() const {
- return "STI CBEA SPU Assembly Printer";
- }
-
- bool runOnMachineFunction(MachineFunction &F);
- bool doInitialization(Module &M);
- bool doFinalization(Module &M);
-
- void getAnalysisUsage(AnalysisUsage &AU) const {
- AU.setPreservesAll();
- AU.addRequired<MachineModuleInfo>();
- SPUAsmPrinter::getAnalysisUsage(AU);
- }
-
- /// getSectionForFunction - Return the section that we should emit the
- /// specified function body into.
- virtual std::string getSectionForFunction(const Function &F) const;
- };
-} // end of anonymous namespace
-
-// Include the auto-generated portion of the assembly writer
-#include "SPUGenAsmWriter.inc"
-
-void SPUAsmPrinter::printOp(const MachineOperand &MO) {
- switch (MO.getType()) {
- case MachineOperand::MO_Immediate:
- cerr << "printOp() does not handle immediate values\n";
- abort();
- return;
-
- case MachineOperand::MO_MachineBasicBlock:
- printBasicBlockLabel(MO.getMBB());
- return;
- case MachineOperand::MO_JumpTableIndex:
- O << TAI->getPrivateGlobalPrefix() << "JTI" << getFunctionNumber()
- << '_' << MO.getIndex();
- return;
- case MachineOperand::MO_ConstantPoolIndex:
- O << TAI->getPrivateGlobalPrefix() << "CPI" << getFunctionNumber()
- << '_' << MO.getIndex();
- return;
- case MachineOperand::MO_ExternalSymbol:
- // Computing the address of an external symbol, not calling it.
- if (TM.getRelocationModel() != Reloc::Static) {
- std::string Name(TAI->getGlobalPrefix()); Name += MO.getSymbolName();
- GVStubs.insert(Name);
- O << "L" << Name << "$non_lazy_ptr";
- return;
- }
- O << TAI->getGlobalPrefix() << MO.getSymbolName();
- return;
- case MachineOperand::MO_GlobalAddress: {
- // Computing the address of a global symbol, not calling it.
- GlobalValue *GV = MO.getGlobal();
- std::string Name = Mang->getValueName(GV);
-
- // External or weakly linked global variables need non-lazily-resolved
- // stubs
- if (TM.getRelocationModel() != Reloc::Static) {
- if (((GV->isDeclaration() || GV->hasWeakLinkage() ||
- GV->hasLinkOnceLinkage()))) {
- GVStubs.insert(Name);
- O << "L" << Name << "$non_lazy_ptr";
- return;
- }
- }
- O << Name;
-
- if (GV->hasExternalWeakLinkage())
- ExtWeakSymbols.insert(GV);
- return;
- }
-
- default:
- O << "<unknown operand type: " << MO.getType() << ">";
- return;
- }
-}
-
-/// PrintAsmOperand - Print out an operand for an inline asm expression.
-///
-bool SPUAsmPrinter::PrintAsmOperand(const MachineInstr *MI, unsigned OpNo,
- unsigned AsmVariant,
- const char *ExtraCode) {
- // Does this asm operand have a single letter operand modifier?
- if (ExtraCode && ExtraCode[0]) {
- if (ExtraCode[1] != 0) return true; // Unknown modifier.
-
- switch (ExtraCode[0]) {
- default: return true; // Unknown modifier.
- case 'L': // Write second word of DImode reference.
- // Verify that this operand has two consecutive registers.
- if (!MI->getOperand(OpNo).isRegister() ||
- OpNo+1 == MI->getNumOperands() ||
- !MI->getOperand(OpNo+1).isRegister())
- return true;
- ++OpNo; // Return the high-part.
- break;
- }
- }
-
- printOperand(MI, OpNo);
- return false;
-}
-
-bool SPUAsmPrinter::PrintAsmMemoryOperand(const MachineInstr *MI,
- unsigned OpNo,
- unsigned AsmVariant,
- const char *ExtraCode) {
- if (ExtraCode && ExtraCode[0])
- return true; // Unknown modifier.
- printMemRegReg(MI, OpNo);
- return false;
-}
-
-/// printMachineInstruction -- Print out a single PowerPC MI in Darwin syntax
-/// to the current output stream.
-///
-void SPUAsmPrinter::printMachineInstruction(const MachineInstr *MI) {
- ++EmittedInsts;
- printInstruction(MI);
-}
-
-
-
-std::string LinuxAsmPrinter::getSectionForFunction(const Function &F) const {
- switch (F.getLinkage()) {
- default: assert(0 && "Unknown linkage type!");
- case Function::ExternalLinkage:
- case Function::InternalLinkage: return TAI->getTextSection();
- case Function::WeakLinkage:
- case Function::LinkOnceLinkage:
- return ""; // Print nothing for the time being...
- }
-}
-
-/// runOnMachineFunction - This uses the printMachineInstruction()
-/// method to print assembly for each instruction.
-///
-bool
-LinuxAsmPrinter::runOnMachineFunction(MachineFunction &MF)
-{
- DW.SetModuleInfo(&getAnalysis<MachineModuleInfo>());
-
- SetupMachineFunction(MF);
- O << "\n\n";
-
- // Print out constants referenced by the function
- EmitConstantPool(MF.getConstantPool());
-
- // Print out labels for the function.
- const Function *F = MF.getFunction();
-
- SwitchToTextSection(getSectionForFunction(*F).c_str(), F);
- EmitAlignment(3, F);
-
- switch (F->getLinkage()) {
- default: assert(0 && "Unknown linkage type!");
- case Function::InternalLinkage: // Symbols default to internal.
- break;
- case Function::ExternalLinkage:
- O << "\t.global\t" << CurrentFnName << "\n"
- << "\t.type\t" << CurrentFnName << ", @function\n";
- break;
- case Function::WeakLinkage:
- case Function::LinkOnceLinkage:
- O << "\t.global\t" << CurrentFnName << "\n";
- O << "\t.weak_definition\t" << CurrentFnName << "\n";
- break;
- }
- O << CurrentFnName << ":\n";
-
- // Emit pre-function debug information.
- DW.BeginFunction(&MF);
-
- // Print out code for the function.
- for (MachineFunction::const_iterator I = MF.begin(), E = MF.end();
- I != E; ++I) {
- // Print a label for the basic block.
- if (I != MF.begin()) {
- printBasicBlockLabel(I, true, true);
- O << '\n';
- }
- for (MachineBasicBlock::const_iterator II = I->begin(), E = I->end();
- II != E; ++II) {
- // Print the assembly for the instruction.
- printMachineInstruction(II);
- }
- }
-
- O << "\t.size\t" << CurrentFnName << ",.-" << CurrentFnName << "\n";
-
- // Print out jump tables referenced by the function.
- EmitJumpTableInfo(MF.getJumpTableInfo(), MF);
-
- // Emit post-function debug information.
- DW.EndFunction();
-
- // We didn't modify anything.
- return false;
-}
-
-
-bool LinuxAsmPrinter::doInitialization(Module &M) {
- bool Result = AsmPrinter::doInitialization(M);
- SwitchToTextSection(TAI->getTextSection());
- // Emit initial debug information.
- DW.BeginModule(&M);
- return Result;
-}
-
-bool LinuxAsmPrinter::doFinalization(Module &M) {
- const TargetData *TD = TM.getTargetData();
-
- // Print out module-level global variables here.
- for (Module::const_global_iterator I = M.global_begin(), E = M.global_end();
- I != E; ++I) {
- if (!I->hasInitializer()) continue; // External global require no code
-
- // Check to see if this is a special global used by LLVM, if so, emit it.
- if (EmitSpecialLLVMGlobal(I))
- continue;
-
- std::string name = Mang->getValueName(I);
- Constant *C = I->getInitializer();
- unsigned Size = TD->getTypeStoreSize(C->getType());
- unsigned Align = TD->getPreferredAlignmentLog(I);
-
- if (C->isNullValue() && /* FIXME: Verify correct */
- (I->hasInternalLinkage() || I->hasWeakLinkage() ||
- I->hasLinkOnceLinkage() ||
- (I->hasExternalLinkage() && !I->hasSection()))) {
- if (Size == 0) Size = 1; // .comm Foo, 0 is undefined, avoid it.
- if (I->hasExternalLinkage()) {
- // External linkage globals -> .bss section
- // FIXME: Want to set the global variable's section so that
- // SwitchToDataSection emits the ".section" directive
- SwitchToDataSection("\t.section\t.bss", I);
- O << "\t.global\t" << name << '\n';
- O << "\t.align\t" << Align << '\n';
- O << "\t.type\t" << name << ", @object\n";
- O << "\t.size\t" << name << ", " << Size << '\n';
- O << name << ":\n";
- O << "\t.zero\t" << Size;
- } else if (I->hasInternalLinkage()) {
- SwitchToDataSection("\t.data", I);
- O << ".local " << name << "\n";
- O << TAI->getCOMMDirective() << name << "," << Size << "," << Align << "\n";
- } else {
- SwitchToDataSection("\t.data", I);
- O << ".comm " << name << "," << Size;
- }
- O << "\t\t# '" << I->getName() << "'\n";
- } else {
- switch (I->getLinkage()) {
- case GlobalValue::LinkOnceLinkage:
- case GlobalValue::WeakLinkage:
- O << "\t.global " << name << '\n'
- << "\t.weak_definition " << name << '\n';
- SwitchToDataSection(".section __DATA,__datacoal_nt,coalesced", I);
- break;
- case GlobalValue::AppendingLinkage:
- // FIXME: appending linkage variables should go into a section of
- // their name or something. For now, just emit them as external.
- case GlobalValue::ExternalLinkage:
- // If external or appending, declare as a global symbol
- O << "\t.global " << name << "\n";
- // FALL THROUGH
- case GlobalValue::InternalLinkage:
- if (I->isConstant()) {
- const ConstantArray *CVA = dyn_cast<ConstantArray>(C);
- if (TAI->getCStringSection() && CVA && CVA->isCString()) {
- SwitchToDataSection(TAI->getCStringSection(), I);
- break;
- }
- }
-
- SwitchToDataSection("\t.data", I);
- break;
- default:
- cerr << "Unknown linkage type!";
- abort();
- }
-
- EmitAlignment(Align, I);
- O << name << ":\t\t\t\t# '" << I->getName() << "'\n";
-
- // If the initializer is a extern weak symbol, remember to emit the weak
- // reference!
- if (const GlobalValue *GV = dyn_cast<GlobalValue>(C))
- if (GV->hasExternalWeakLinkage())
- ExtWeakSymbols.insert(GV);
-
- EmitGlobalConstant(C);
- O << '\n';
- }
- }
-
- // Output stubs for dynamically-linked functions
- if (TM.getRelocationModel() == Reloc::PIC_) {
- for (std::set<std::string>::iterator i = FnStubs.begin(), e = FnStubs.end();
- i != e; ++i) {
- SwitchToTextSection(".section __TEXT,__picsymbolstub1,symbol_stubs,"
- "pure_instructions,32");
- EmitAlignment(4);
- O << "L" << *i << "$stub:\n";
- O << "\t.indirect_symbol " << *i << "\n";
- O << "\tmflr r0\n";
- O << "\tbcl 20,31,L0$" << *i << "\n";
- O << "L0$" << *i << ":\n";
- O << "\tmflr r11\n";
- O << "\taddis r11,r11,ha16(L" << *i << "$lazy_ptr-L0$" << *i << ")\n";
- O << "\tmtlr r0\n";
- O << "\tlwzu r12,lo16(L" << *i << "$lazy_ptr-L0$" << *i << ")(r11)\n";
- O << "\tmtctr r12\n";
- O << "\tbctr\n";
- SwitchToDataSection(".lazy_symbol_pointer");
- O << "L" << *i << "$lazy_ptr:\n";
- O << "\t.indirect_symbol " << *i << "\n";
- O << "\t.long dyld_stub_binding_helper\n";
- }
- } else {
- for (std::set<std::string>::iterator i = FnStubs.begin(), e = FnStubs.end();
- i != e; ++i) {
- SwitchToTextSection(".section __TEXT,__symbol_stub1,symbol_stubs,"
- "pure_instructions,16");
- EmitAlignment(4);
- O << "L" << *i << "$stub:\n";
- O << "\t.indirect_symbol " << *i << "\n";
- O << "\tlis r11,ha16(L" << *i << "$lazy_ptr)\n";
- O << "\tlwzu r12,lo16(L" << *i << "$lazy_ptr)(r11)\n";
- O << "\tmtctr r12\n";
- O << "\tbctr\n";
- SwitchToDataSection(".lazy_symbol_pointer");
- O << "L" << *i << "$lazy_ptr:\n";
- O << "\t.indirect_symbol " << *i << "\n";
- O << "\t.long dyld_stub_binding_helper\n";
- }
- }
-
- O << "\n";
-
- // Output stubs for external and common global variables.
- if (GVStubs.begin() != GVStubs.end()) {
- SwitchToDataSection(".non_lazy_symbol_pointer");
- for (std::set<std::string>::iterator I = GVStubs.begin(),
- E = GVStubs.end(); I != E; ++I) {
- O << "L" << *I << "$non_lazy_ptr:\n";
- O << "\t.indirect_symbol " << *I << "\n";
- O << "\t.long\t0\n";
- }
- }
-
- // Emit initial debug information.
- DW.EndModule();
-
- // Emit ident information
- O << "\t.ident\t\"(llvm 2.2+) STI CBEA Cell SPU backend\"\n";
-
- return AsmPrinter::doFinalization(M);
-}
-
-
-
-/// createSPUCodePrinterPass - Returns a pass that prints the Cell SPU
-/// assembly code for a MachineFunction to the given output stream, in a format
-/// that the Linux SPU assembler can deal with.
-///
-FunctionPass *llvm::createSPUAsmPrinterPass(std::ostream &o,
- SPUTargetMachine &tm) {
- return new LinuxAsmPrinter(o, tm, tm.getTargetAsmInfo());
-}
-
diff --git a/release_23/lib/Target/CellSPU/SPUCallingConv.td b/release_23/lib/Target/CellSPU/SPUCallingConv.td
deleted file mode 100644
index e62473671ab0..000000000000
--- a/release_23/lib/Target/CellSPU/SPUCallingConv.td
+++ /dev/null
@@ -1,59 +0,0 @@
-//===- SPUCallingConv.td - Calling Conventions for CellSPU ------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This describes the calling conventions for the STI Cell SPU architecture.
-//
-//===----------------------------------------------------------------------===//
-
-/// CCIfSubtarget - Match if the current subtarget has a feature F.
-class CCIfSubtarget<string F, CCAction A>
- : CCIf<!strconcat("State.getTarget().getSubtarget<PPCSubtarget>().", F), A>;
-
-//===----------------------------------------------------------------------===//
-// Return Value Calling Convention
-//===----------------------------------------------------------------------===//
-
-// Return-value convention for Cell SPU: Everything can be passed back via $3:
-def RetCC_SPU : CallingConv<[
- CCIfType<[i32], CCAssignToReg<[R3]>>,
- CCIfType<[i64], CCAssignToReg<[R3]>>,
- CCIfType<[f32, f64], CCAssignToReg<[R3]>>,
- CCIfType<[v16i8, v8i16, v4i32, v2i64, v4f32, v2f64], CCAssignToReg<[R3]>>
-]>;
-
-
-//===----------------------------------------------------------------------===//
-// CellSPU Argument Calling Conventions
-// FIXME
-//===----------------------------------------------------------------------===//
-/*
-def CC_SPU : CallingConv<[
- // The first 8 integer arguments are passed in integer registers.
- CCIfType<[i32], CCAssignToReg<[R3, R4, R5, R6, R7, R8, R9, R10]>>,
- CCIfType<[i64], CCAssignToReg<[X3, X4, X5, X6, X7, X8, X9, X10]>>,
-
- // SPU can pass back arguments in all
- CCIfType<[f32, f64], CCIfSubtarget<"isMachoABI()",
- CCAssignToReg<[F1, F2, F3, F4, F5, F6, F7, F8,F9,F10,F11,F12,F13]>>>,
- // Other sub-targets pass FP values in F1-10.
- CCIfType<[f32, f64], CCAssignToReg<[F1, F2, F3, F4, F5, F6, F7, F8, F9,F10]>>,
-
- // The first 12 Vector arguments are passed in altivec registers.
- CCIfType<[v16i8, v8i16, v4i32, v4f32],
- CCAssignToReg<[V2, V3, V4, V5, V6, V7, V8, V9, V10,V11,V12,V13]>>
-/*
- // Integer/FP values get stored in stack slots that are 8 bytes in size and
- // 8-byte aligned if there are no more registers to hold them.
- CCIfType<[i32, i64, f32, f64], CCAssignToStack<8, 8>>,
-
- // Vectors get 16-byte stack slots that are 16-byte aligned.
- CCIfType<[v16i8, v8i16, v4i32, v2i64, v4f32, v2f64],
- CCAssignToStack<16, 16>>*/
-]>;
- */
diff --git a/release_23/lib/Target/CellSPU/SPUFrameInfo.cpp b/release_23/lib/Target/CellSPU/SPUFrameInfo.cpp
deleted file mode 100644
index 60d7ba736ac6..000000000000
--- a/release_23/lib/Target/CellSPU/SPUFrameInfo.cpp
+++ /dev/null
@@ -1,29 +0,0 @@
-//===-- SPUTargetMachine.cpp - Define TargetMachine for Cell SPU ----------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// Top-level implementation for the Cell SPU target.
-//
-//===----------------------------------------------------------------------===//
-
-#include "SPU.h"
-#include "SPUFrameInfo.h"
-#include "SPURegisterNames.h"
-using namespace llvm;
-
-//===----------------------------------------------------------------------===//
-// SPUFrameInfo:
-//===----------------------------------------------------------------------===//
-
-SPUFrameInfo::SPUFrameInfo(const TargetMachine &tm):
- TargetFrameInfo(TargetFrameInfo::StackGrowsDown, 16, 0),
- TM(tm)
-{
- LR[0].first = SPU::R0;
- LR[0].second = 16;
-}
diff --git a/release_23/lib/Target/CellSPU/SPUFrameInfo.h b/release_23/lib/Target/CellSPU/SPUFrameInfo.h
deleted file mode 100644
index e8ca333f0b69..000000000000
--- a/release_23/lib/Target/CellSPU/SPUFrameInfo.h
+++ /dev/null
@@ -1,79 +0,0 @@
-//===-- SPUFrameInfo.h - Top-level interface for Cell SPU Target -*- C++ -*-==//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains CellSPU frame information that doesn't fit anywhere else
-// cleanly...
-//
-//===----------------------------------------------------------------------===//
-
-#if !defined(SPUFRAMEINFO_H)
-
-#include "llvm/Target/TargetFrameInfo.h"
-#include "llvm/Target/TargetMachine.h"
-#include "SPURegisterInfo.h"
-
-namespace llvm {
- class SPUFrameInfo: public TargetFrameInfo {
- const TargetMachine &TM;
- std::pair<unsigned, int> LR[1];
-
- public:
- SPUFrameInfo(const TargetMachine &tm);
-
- //! Return a function's saved spill slots
- /*!
- For CellSPU, a function's saved spill slots is just the link register.
- */
- const std::pair<unsigned, int> *
- getCalleeSaveSpillSlots(unsigned &NumEntries) const;
-
- //! Stack slot size (16 bytes)
- static int stackSlotSize() {
- return 16;
- }
- //! Maximum frame offset representable by a signed 10-bit integer
- /*!
- This is the maximum frame offset that can be expressed as a 10-bit
- integer, used in D-form addresses.
- */
- static int maxFrameOffset() {
- return ((1 << 9) - 1) * stackSlotSize();
- }
- //! Minimum frame offset representable by a signed 10-bit integer
- static int minFrameOffset() {
- return -(1 << 9) * stackSlotSize();
- }
- //! Minimum frame size (enough to spill LR + SP)
- static int minStackSize() {
- return (2 * stackSlotSize());
- }
- //! Frame size required to spill all registers plus frame info
- static int fullSpillSize() {
- return (SPURegisterInfo::getNumArgRegs() * stackSlotSize());
- }
- //! Convert frame index to stack offset
- static int FItoStackOffset(int frame_index) {
- return frame_index * stackSlotSize();
- }
- //! Number of instructions required to overcome hint-for-branch latency
- /*!
- HBR (hint-for-branch) instructions can be inserted when, for example,
- we know that a given function is going to be called, such as printf(),
- in the control flow graph. HBRs are only inserted if a sufficient number
- of instructions occurs between the HBR and the target. Currently, HBRs
- take 6 cycles, ergo, the magic number 6.
- */
- static int branchHintPenalty() {
- return 6;
- }
- };
-}
-
-#define SPUFRAMEINFO_H 1
-#endif
diff --git a/release_23/lib/Target/CellSPU/SPUHazardRecognizers.cpp b/release_23/lib/Target/CellSPU/SPUHazardRecognizers.cpp
deleted file mode 100644
index 26392ed4b9a1..000000000000
--- a/release_23/lib/Target/CellSPU/SPUHazardRecognizers.cpp
+++ /dev/null
@@ -1,135 +0,0 @@
-//===-- SPUHazardRecognizers.cpp - Cell Hazard Recognizer Impls -----------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements hazard recognizers for scheduling on Cell SPU
-// processors.
-//
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "sched"
-
-#include "SPUHazardRecognizers.h"
-#include "SPU.h"
-#include "SPUInstrInfo.h"
-#include "llvm/Support/Debug.h"
-
-using namespace llvm;
-
-//===----------------------------------------------------------------------===//
-// Cell SPU hazard recognizer
-//
-// This is the pipeline hazard recognizer for the Cell SPU processor. It does
-// very little right now.
-//===----------------------------------------------------------------------===//
-
-SPUHazardRecognizer::SPUHazardRecognizer(const TargetInstrInfo &tii) :
- TII(tii),
- EvenOdd(0)
-{
-}
-
-/// Return the pipeline hazard type encountered or generated by this
-/// instruction. Currently returns NoHazard.
-///
-/// \return NoHazard
-HazardRecognizer::HazardType
-SPUHazardRecognizer::getHazardType(SDNode *Node)
-{
- // Initial thoughts on how to do this, but this code cannot work unless the
- // function's prolog and epilog code are also being scheduled so that we can
- // accurately determine which pipeline is being scheduled.
-#if 0
- HazardRecognizer::HazardType retval = NoHazard;
- bool mustBeOdd = false;
-
- switch (Node->getOpcode()) {
- case SPU::LQDv16i8:
- case SPU::LQDv8i16:
- case SPU::LQDv4i32:
- case SPU::LQDv4f32:
- case SPU::LQDv2f64:
- case SPU::LQDr128:
- case SPU::LQDr64:
- case SPU::LQDr32:
- case SPU::LQDr16:
- case SPU::LQAv16i8:
- case SPU::LQAv8i16:
- case SPU::LQAv4i32:
- case SPU::LQAv4f32:
- case SPU::LQAv2f64:
- case SPU::LQAr128:
- case SPU::LQAr64:
- case SPU::LQAr32:
- case SPU::LQXv4i32:
- case SPU::LQXr128:
- case SPU::LQXr64:
- case SPU::LQXr32:
- case SPU::LQXr16:
- case SPU::STQDv16i8:
- case SPU::STQDv8i16:
- case SPU::STQDv4i32:
- case SPU::STQDv4f32:
- case SPU::STQDv2f64:
- case SPU::STQDr128:
- case SPU::STQDr64:
- case SPU::STQDr32:
- case SPU::STQDr16:
- case SPU::STQDr8:
- case SPU::STQAv16i8:
- case SPU::STQAv8i16:
- case SPU::STQAv4i32:
- case SPU::STQAv4f32:
- case SPU::STQAv2f64:
- case SPU::STQAr128:
- case SPU::STQAr64:
- case SPU::STQAr32:
- case SPU::STQAr16:
- case SPU::STQAr8:
- case SPU::STQXv16i8:
- case SPU::STQXv8i16:
- case SPU::STQXv4i32:
- case SPU::STQXv4f32:
- case SPU::STQXv2f64:
- case SPU::STQXr128:
- case SPU::STQXr64:
- case SPU::STQXr32:
- case SPU::STQXr16:
- case SPU::STQXr8:
- case SPU::RET:
- mustBeOdd = true;
- break;
- default:
- // Assume that this instruction can be on the even pipe
- break;
- }
-
- if (mustBeOdd && !EvenOdd)
- retval = Hazard;
-
- DOUT << "SPUHazardRecognizer EvenOdd " << EvenOdd << " Hazard " << retval << "\n";
- EvenOdd ^= 1;
- return retval;
-#else
- return NoHazard;
-#endif
-}
-
-void SPUHazardRecognizer::EmitInstruction(SDNode *Node)
-{
-}
-
-void SPUHazardRecognizer::AdvanceCycle()
-{
- DOUT << "SPUHazardRecognizer::AdvanceCycle\n";
-}
-
-void SPUHazardRecognizer::EmitNoop()
-{
- AdvanceCycle();
-}
diff --git a/release_23/lib/Target/CellSPU/SPUHazardRecognizers.h b/release_23/lib/Target/CellSPU/SPUHazardRecognizers.h
deleted file mode 100644
index 8d74c5ccb767..000000000000
--- a/release_23/lib/Target/CellSPU/SPUHazardRecognizers.h
+++ /dev/null
@@ -1,41 +0,0 @@
-//===-- SPUHazardRecognizers.h - Cell SPU Hazard Recognizer -----*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines hazard recognizers for scheduling on the Cell SPU
-// processor.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef SPUHAZRECS_H
-#define SPUHAZRECS_H
-
-#include "llvm/CodeGen/ScheduleDAG.h"
-#include "SPUInstrInfo.h"
-
-namespace llvm {
-
-/// SPUHazardRecognizer
-class SPUHazardRecognizer : public HazardRecognizer
-{
-private:
- const TargetInstrInfo &TII;
- int EvenOdd;
-
-public:
- SPUHazardRecognizer(const TargetInstrInfo &TII);
- virtual HazardType getHazardType(SDNode *Node);
- virtual void EmitInstruction(SDNode *Node);
- virtual void AdvanceCycle();
- virtual void EmitNoop();
-};
-
-} // end namespace llvm
-
-#endif
-
diff --git a/release_23/lib/Target/CellSPU/SPUISelDAGToDAG.cpp b/release_23/lib/Target/CellSPU/SPUISelDAGToDAG.cpp
deleted file mode 100644
index 49a5e864d3e0..000000000000
--- a/release_23/lib/Target/CellSPU/SPUISelDAGToDAG.cpp
+++ /dev/null
@@ -1,705 +0,0 @@
-//===-- SPUISelDAGToDAG.cpp - CellSPU pattern matching inst selector ------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines a pattern matching instruction selector for the Cell SPU,
-// converting from a legalized dag to a SPU-target dag.
-//
-//===----------------------------------------------------------------------===//
-
-#include "SPU.h"
-#include "SPUTargetMachine.h"
-#include "SPUISelLowering.h"
-#include "SPUHazardRecognizers.h"
-#include "SPUFrameInfo.h"
-#include "SPURegisterNames.h"
-#include "llvm/CodeGen/MachineConstantPool.h"
-#include "llvm/CodeGen/MachineInstrBuilder.h"
-#include "llvm/CodeGen/MachineFunction.h"
-#include "llvm/CodeGen/SelectionDAG.h"
-#include "llvm/CodeGen/SelectionDAGISel.h"
-#include "llvm/Target/TargetOptions.h"
-#include "llvm/ADT/Statistic.h"
-#include "llvm/Constants.h"
-#include "llvm/GlobalValue.h"
-#include "llvm/Intrinsics.h"
-#include "llvm/Support/Debug.h"
-#include "llvm/Support/MathExtras.h"
-#include "llvm/Support/Compiler.h"
-#include <iostream>
-#include <queue>
-#include <set>
-
-using namespace llvm;
-
-namespace {
- //! ConstantSDNode predicate for i32 sign-extended, 10-bit immediates
- bool
- isI64IntS10Immediate(ConstantSDNode *CN)
- {
- return isS10Constant(CN->getSignExtended());
- }
-
- //! ConstantSDNode predicate for i32 sign-extended, 10-bit immediates
- bool
- isI32IntS10Immediate(ConstantSDNode *CN)
- {
- return isS10Constant(CN->getSignExtended());
- }
-
-#if 0
- //! SDNode predicate for sign-extended, 10-bit immediate values
- bool
- isI32IntS10Immediate(SDNode *N)
- {
- return (N->getOpcode() == ISD::Constant
- && isI32IntS10Immediate(cast<ConstantSDNode>(N)));
- }
-#endif
-
- //! ConstantSDNode predicate for i32 unsigned 10-bit immediate values
- bool
- isI32IntU10Immediate(ConstantSDNode *CN)
- {
- return isU10Constant(CN->getSignExtended());
- }
-
- //! ConstantSDNode predicate for i16 sign-extended, 10-bit immediate values
- bool
- isI16IntS10Immediate(ConstantSDNode *CN)
- {
- return isS10Constant(CN->getSignExtended());
- }
-
- //! SDNode predicate for i16 sign-extended, 10-bit immediate values
- bool
- isI16IntS10Immediate(SDNode *N)
- {
- return (N->getOpcode() == ISD::Constant
- && isI16IntS10Immediate(cast<ConstantSDNode>(N)));
- }
-
- //! ConstantSDNode predicate for i16 unsigned 10-bit immediate values
- bool
- isI16IntU10Immediate(ConstantSDNode *CN)
- {
- return isU10Constant((short) CN->getValue());
- }
-
- //! SDNode predicate for i16 sign-extended, 10-bit immediate values
- bool
- isI16IntU10Immediate(SDNode *N)
- {
- return (N->getOpcode() == ISD::Constant
- && isI16IntU10Immediate(cast<ConstantSDNode>(N)));
- }
-
- //! ConstantSDNode predicate for signed 16-bit values
- /*!
- \arg CN The constant SelectionDAG node holding the value
- \arg Imm The returned 16-bit value, if returning true
-
- This predicate tests the value in \a CN to see whether it can be
- represented as a 16-bit, sign-extended quantity. Returns true if
- this is the case.
- */
- bool
- isIntS16Immediate(ConstantSDNode *CN, short &Imm)
- {
- MVT::ValueType vt = CN->getValueType(0);
- Imm = (short) CN->getValue();
- if (vt >= MVT::i1 && vt <= MVT::i16) {
- return true;
- } else if (vt == MVT::i32) {
- int32_t i_val = (int32_t) CN->getValue();
- short s_val = (short) i_val;
- return i_val == s_val;
- } else {
- int64_t i_val = (int64_t) CN->getValue();
- short s_val = (short) i_val;
- return i_val == s_val;
- }
-
- return false;
- }
-
- //! SDNode predicate for signed 16-bit values.
- bool
- isIntS16Immediate(SDNode *N, short &Imm)
- {
- return (N->getOpcode() == ISD::Constant
- && isIntS16Immediate(cast<ConstantSDNode>(N), Imm));
- }
-
- //! ConstantFPSDNode predicate for representing floats as 16-bit sign ext.
- static bool
- isFPS16Immediate(ConstantFPSDNode *FPN, short &Imm)
- {
- MVT::ValueType vt = FPN->getValueType(0);
- if (vt == MVT::f32) {
- int val = FloatToBits(FPN->getValueAPF().convertToFloat());
- int sval = (int) ((val << 16) >> 16);
- Imm = (short) val;
- return val == sval;
- }
-
- return false;
- }
-
- bool
- isHighLow(const SDOperand &Op)
- {
- return (Op.getOpcode() == SPUISD::IndirectAddr
- && ((Op.getOperand(0).getOpcode() == SPUISD::Hi
- && Op.getOperand(1).getOpcode() == SPUISD::Lo)
- || (Op.getOperand(0).getOpcode() == SPUISD::Lo
- && Op.getOperand(1).getOpcode() == SPUISD::Hi)));
- }
-
- //===------------------------------------------------------------------===//
- //! MVT::ValueType to "useful stuff" mapping structure:
-
- struct valtype_map_s {
- MVT::ValueType VT;
- unsigned ldresult_ins; /// LDRESULT instruction (0 = undefined)
- bool ldresult_imm; /// LDRESULT instruction requires immediate?
- int prefslot_byte; /// Byte offset of the "preferred" slot
- };
-
- const valtype_map_s valtype_map[] = {
- { MVT::i1, 0, false, 3 },
- { MVT::i8, SPU::ORBIr8, true, 3 },
- { MVT::i16, SPU::ORHIr16, true, 2 },
- { MVT::i32, SPU::ORIr32, true, 0 },
- { MVT::i64, SPU::ORr64, false, 0 },
- { MVT::f32, SPU::ORf32, false, 0 },
- { MVT::f64, SPU::ORf64, false, 0 },
- // vector types... (sigh!)
- { MVT::v16i8, 0, false, 0 },
- { MVT::v8i16, 0, false, 0 },
- { MVT::v4i32, 0, false, 0 },
- { MVT::v2i64, 0, false, 0 },
- { MVT::v4f32, 0, false, 0 },
- { MVT::v2f64, 0, false, 0 }
- };
-
- const size_t n_valtype_map = sizeof(valtype_map) / sizeof(valtype_map[0]);
-
- const valtype_map_s *getValueTypeMapEntry(MVT::ValueType VT)
- {
- const valtype_map_s *retval = 0;
- for (size_t i = 0; i < n_valtype_map; ++i) {
- if (valtype_map[i].VT == VT) {
- retval = valtype_map + i;
- break;
- }
- }
-
-
-#ifndef NDEBUG
- if (retval == 0) {
- cerr << "SPUISelDAGToDAG.cpp: getValueTypeMapEntry returns NULL for "
- << MVT::getValueTypeString(VT)
- << "\n";
- abort();
- }
-#endif
-
- return retval;
- }
-}
-
-//===--------------------------------------------------------------------===//
-/// SPUDAGToDAGISel - Cell SPU-specific code to select SPU machine
-/// instructions for SelectionDAG operations.
-///
-class SPUDAGToDAGISel :
- public SelectionDAGISel
-{
- SPUTargetMachine &TM;
- SPUTargetLowering &SPUtli;
- unsigned GlobalBaseReg;
-
-public:
- SPUDAGToDAGISel(SPUTargetMachine &tm) :
- SelectionDAGISel(*tm.getTargetLowering()),
- TM(tm),
- SPUtli(*tm.getTargetLowering())
- {}
-
- virtual bool runOnFunction(Function &Fn) {
- // Make sure we re-emit a set of the global base reg if necessary
- GlobalBaseReg = 0;
- SelectionDAGISel::runOnFunction(Fn);
- return true;
- }
-
- /// getI32Imm - Return a target constant with the specified value, of type
- /// i32.
- inline SDOperand getI32Imm(uint32_t Imm) {
- return CurDAG->getTargetConstant(Imm, MVT::i32);
- }
-
- /// getI64Imm - Return a target constant with the specified value, of type
- /// i64.
- inline SDOperand getI64Imm(uint64_t Imm) {
- return CurDAG->getTargetConstant(Imm, MVT::i64);
- }
-
- /// getSmallIPtrImm - Return a target constant of pointer type.
- inline SDOperand getSmallIPtrImm(unsigned Imm) {
- return CurDAG->getTargetConstant(Imm, SPUtli.getPointerTy());
- }
-
- /// Select - Convert the specified operand from a target-independent to a
- /// target-specific node if it hasn't already been changed.
- SDNode *Select(SDOperand Op);
-
- //! Returns true if the address N is an A-form (local store) address
- bool SelectAFormAddr(SDOperand Op, SDOperand N, SDOperand &Base,
- SDOperand &Index);
-
- //! D-form address predicate
- bool SelectDFormAddr(SDOperand Op, SDOperand N, SDOperand &Base,
- SDOperand &Index);
-
- /// Alternate D-form address using i7 offset predicate
- bool SelectDForm2Addr(SDOperand Op, SDOperand N, SDOperand &Disp,
- SDOperand &Base);
-
- /// D-form address selection workhorse
- bool DFormAddressPredicate(SDOperand Op, SDOperand N, SDOperand &Disp,
- SDOperand &Base, int minOffset, int maxOffset);
-
- //! Address predicate if N can be expressed as an indexed [r+r] operation.
- bool SelectXFormAddr(SDOperand Op, SDOperand N, SDOperand &Base,
- SDOperand &Index);
-
- /// SelectInlineAsmMemoryOperand - Implement addressing mode selection for
- /// inline asm expressions.
- virtual bool SelectInlineAsmMemoryOperand(const SDOperand &Op,
- char ConstraintCode,
- std::vector<SDOperand> &OutOps,
- SelectionDAG &DAG) {
- SDOperand Op0, Op1;
- switch (ConstraintCode) {
- default: return true;
- case 'm': // memory
- if (!SelectDFormAddr(Op, Op, Op0, Op1)
- && !SelectAFormAddr(Op, Op, Op0, Op1))
- SelectXFormAddr(Op, Op, Op0, Op1);
- break;
- case 'o': // offsetable
- if (!SelectDFormAddr(Op, Op, Op0, Op1)
- && !SelectAFormAddr(Op, Op, Op0, Op1)) {
- Op0 = Op;
- AddToISelQueue(Op0); // r+0.
- Op1 = getSmallIPtrImm(0);
- }
- break;
- case 'v': // not offsetable
-#if 1
- assert(0 && "InlineAsmMemoryOperand 'v' constraint not handled.");
-#else
- SelectAddrIdxOnly(Op, Op, Op0, Op1);
-#endif
- break;
- }
-
- OutOps.push_back(Op0);
- OutOps.push_back(Op1);
- return false;
- }
-
- /// InstructionSelectBasicBlock - This callback is invoked by
- /// SelectionDAGISel when it has created a SelectionDAG for us to codegen.
- virtual void InstructionSelectBasicBlock(SelectionDAG &DAG);
-
- virtual const char *getPassName() const {
- return "Cell SPU DAG->DAG Pattern Instruction Selection";
- }
-
- /// CreateTargetHazardRecognizer - Return the hazard recognizer to use for
- /// this target when scheduling the DAG.
- virtual HazardRecognizer *CreateTargetHazardRecognizer() {
- const TargetInstrInfo *II = SPUtli.getTargetMachine().getInstrInfo();
- assert(II && "No InstrInfo?");
- return new SPUHazardRecognizer(*II);
- }
-
- // Include the pieces autogenerated from the target description.
-#include "SPUGenDAGISel.inc"
-};
-
-/// InstructionSelectBasicBlock - This callback is invoked by
-/// SelectionDAGISel when it has created a SelectionDAG for us to codegen.
-void
-SPUDAGToDAGISel::InstructionSelectBasicBlock(SelectionDAG &DAG)
-{
- DEBUG(BB->dump());
-
- // Select target instructions for the DAG.
- DAG.setRoot(SelectRoot(DAG.getRoot()));
- DAG.RemoveDeadNodes();
-
- // Emit machine code to BB.
- ScheduleAndEmitDAG(DAG);
-}
-
-/*!
- \arg Op The ISD instructio operand
- \arg N The address to be tested
- \arg Base The base address
- \arg Index The base address index
- */
-bool
-SPUDAGToDAGISel::SelectAFormAddr(SDOperand Op, SDOperand N, SDOperand &Base,
- SDOperand &Index) {
- // These match the addr256k operand type:
- MVT::ValueType OffsVT = MVT::i16;
- SDOperand Zero = CurDAG->getTargetConstant(0, OffsVT);
-
- switch (N.getOpcode()) {
- case ISD::Constant:
- case ISD::ConstantPool:
- case ISD::GlobalAddress:
- cerr << "SPU SelectAFormAddr: Constant/Pool/Global not lowered.\n";
- abort();
- /*NOTREACHED*/
-
- case ISD::TargetConstant:
- case ISD::TargetGlobalAddress:
- case ISD::TargetJumpTable:
- cerr << "SPUSelectAFormAddr: Target Constant/Pool/Global not wrapped as "
- << "A-form address.\n";
- abort();
- /*NOTREACHED*/
-
- case SPUISD::AFormAddr:
- // Just load from memory if there's only a single use of the location,
- // otherwise, this will get handled below with D-form offset addresses
- if (N.hasOneUse()) {
- SDOperand Op0 = N.getOperand(0);
- switch (Op0.getOpcode()) {
- case ISD::TargetConstantPool:
- case ISD::TargetJumpTable:
- Base = Op0;
- Index = Zero;
- return true;
-
- case ISD::TargetGlobalAddress: {
- GlobalAddressSDNode *GSDN = cast<GlobalAddressSDNode>(Op0);
- GlobalValue *GV = GSDN->getGlobal();
- if (GV->getAlignment() == 16) {
- Base = Op0;
- Index = Zero;
- return true;
- }
- break;
- }
- }
- }
- break;
- }
- return false;
-}
-
-bool
-SPUDAGToDAGISel::SelectDForm2Addr(SDOperand Op, SDOperand N, SDOperand &Disp,
- SDOperand &Base) {
- const int minDForm2Offset = -(1 << 7);
- const int maxDForm2Offset = (1 << 7) - 1;
- return DFormAddressPredicate(Op, N, Disp, Base, minDForm2Offset,
- maxDForm2Offset);
-}
-
-/*!
- \arg Op The ISD instruction (ignored)
- \arg N The address to be tested
- \arg Base Base address register/pointer
- \arg Index Base address index
-
- Examine the input address by a base register plus a signed 10-bit
- displacement, [r+I10] (D-form address).
-
- \return true if \a N is a D-form address with \a Base and \a Index set
- to non-empty SDOperand instances.
-*/
-bool
-SPUDAGToDAGISel::SelectDFormAddr(SDOperand Op, SDOperand N, SDOperand &Base,
- SDOperand &Index) {
- return DFormAddressPredicate(Op, N, Base, Index,
- SPUFrameInfo::minFrameOffset(),
- SPUFrameInfo::maxFrameOffset());
-}
-
-bool
-SPUDAGToDAGISel::DFormAddressPredicate(SDOperand Op, SDOperand N, SDOperand &Base,
- SDOperand &Index, int minOffset,
- int maxOffset) {
- unsigned Opc = N.getOpcode();
- unsigned PtrTy = SPUtli.getPointerTy();
-
- if (Opc == ISD::FrameIndex) {
- // Stack frame index must be less than 512 (divided by 16):
- FrameIndexSDNode *FIN = dyn_cast<FrameIndexSDNode>(N);
- int FI = int(FIN->getIndex());
- DEBUG(cerr << "SelectDFormAddr: ISD::FrameIndex = "
- << FI << "\n");
- if (SPUFrameInfo::FItoStackOffset(FI) < maxOffset) {
- Base = CurDAG->getTargetConstant(0, PtrTy);
- Index = CurDAG->getTargetFrameIndex(FI, PtrTy);
- return true;
- }
- } else if (Opc == ISD::ADD) {
- // Generated by getelementptr
- const SDOperand Op0 = N.getOperand(0);
- const SDOperand Op1 = N.getOperand(1);
-
- if ((Op0.getOpcode() == SPUISD::Hi && Op1.getOpcode() == SPUISD::Lo)
- || (Op1.getOpcode() == SPUISD::Hi && Op0.getOpcode() == SPUISD::Lo)) {
- Base = CurDAG->getTargetConstant(0, PtrTy);
- Index = N;
- return true;
- } else if (Op1.getOpcode() == ISD::Constant
- || Op1.getOpcode() == ISD::TargetConstant) {
- ConstantSDNode *CN = dyn_cast<ConstantSDNode>(Op1);
- int32_t offset = int32_t(CN->getSignExtended());
-
- if (Op0.getOpcode() == ISD::FrameIndex) {
- FrameIndexSDNode *FIN = dyn_cast<FrameIndexSDNode>(Op0);
- int FI = int(FIN->getIndex());
- DEBUG(cerr << "SelectDFormAddr: ISD::ADD offset = " << offset
- << " frame index = " << FI << "\n");
-
- if (SPUFrameInfo::FItoStackOffset(FI) < maxOffset) {
- Base = CurDAG->getTargetConstant(offset, PtrTy);
- Index = CurDAG->getTargetFrameIndex(FI, PtrTy);
- return true;
- }
- } else if (offset > minOffset && offset < maxOffset) {
- Base = CurDAG->getTargetConstant(offset, PtrTy);
- Index = Op0;
- return true;
- }
- } else if (Op0.getOpcode() == ISD::Constant
- || Op0.getOpcode() == ISD::TargetConstant) {
- ConstantSDNode *CN = dyn_cast<ConstantSDNode>(Op0);
- int32_t offset = int32_t(CN->getSignExtended());
-
- if (Op1.getOpcode() == ISD::FrameIndex) {
- FrameIndexSDNode *FIN = dyn_cast<FrameIndexSDNode>(Op1);
- int FI = int(FIN->getIndex());
- DEBUG(cerr << "SelectDFormAddr: ISD::ADD offset = " << offset
- << " frame index = " << FI << "\n");
-
- if (SPUFrameInfo::FItoStackOffset(FI) < maxOffset) {
- Base = CurDAG->getTargetConstant(offset, PtrTy);
- Index = CurDAG->getTargetFrameIndex(FI, PtrTy);
- return true;
- }
- } else if (offset > minOffset && offset < maxOffset) {
- Base = CurDAG->getTargetConstant(offset, PtrTy);
- Index = Op1;
- return true;
- }
- }
- } else if (Opc == SPUISD::IndirectAddr) {
- // Indirect with constant offset -> D-Form address
- const SDOperand Op0 = N.getOperand(0);
- const SDOperand Op1 = N.getOperand(1);
-
- if (Op0.getOpcode() == SPUISD::Hi
- && Op1.getOpcode() == SPUISD::Lo) {
- // (SPUindirect (SPUhi <arg>, 0), (SPUlo <arg>, 0))
- Base = CurDAG->getTargetConstant(0, PtrTy);
- Index = N;
- return true;
- } else if (isa<ConstantSDNode>(Op0) || isa<ConstantSDNode>(Op1)) {
- int32_t offset = 0;
- SDOperand idxOp;
-
- if (isa<ConstantSDNode>(Op1)) {
- ConstantSDNode *CN = cast<ConstantSDNode>(Op1);
- offset = int32_t(CN->getSignExtended());
- idxOp = Op0;
- } else if (isa<ConstantSDNode>(Op0)) {
- ConstantSDNode *CN = cast<ConstantSDNode>(Op0);
- offset = int32_t(CN->getSignExtended());
- idxOp = Op1;
- }
-
- if (offset >= minOffset && offset <= maxOffset) {
- Base = CurDAG->getTargetConstant(offset, PtrTy);
- Index = idxOp;
- return true;
- }
- }
- } else if (Opc == SPUISD::AFormAddr) {
- Base = CurDAG->getTargetConstant(0, N.getValueType());
- Index = N;
- return true;
- } else if (Opc == SPUISD::LDRESULT) {
- Base = CurDAG->getTargetConstant(0, N.getValueType());
- Index = N;
- return true;
- }
- return false;
-}
-
-/*!
- \arg Op The ISD instruction operand
- \arg N The address operand
- \arg Base The base pointer operand
- \arg Index The offset/index operand
-
- If the address \a N can be expressed as a [r + s10imm] address, returns false.
- Otherwise, creates two operands, Base and Index that will become the [r+r]
- address.
-*/
-bool
-SPUDAGToDAGISel::SelectXFormAddr(SDOperand Op, SDOperand N, SDOperand &Base,
- SDOperand &Index) {
- if (SelectAFormAddr(Op, N, Base, Index)
- || SelectDFormAddr(Op, N, Base, Index))
- return false;
-
- // All else fails, punt and use an X-form address:
- Base = N.getOperand(0);
- Index = N.getOperand(1);
- return true;
-}
-
-//! Convert the operand from a target-independent to a target-specific node
-/*!
- */
-SDNode *
-SPUDAGToDAGISel::Select(SDOperand Op) {
- SDNode *N = Op.Val;
- unsigned Opc = N->getOpcode();
- int n_ops = -1;
- unsigned NewOpc;
- MVT::ValueType OpVT = Op.getValueType();
- SDOperand Ops[8];
-
- if (Opc >= ISD::BUILTIN_OP_END && Opc < SPUISD::FIRST_NUMBER) {
- return NULL; // Already selected.
- } else if (Opc == ISD::FrameIndex) {
- // Selects to (add $sp, FI * stackSlotSize)
- int FI =
- SPUFrameInfo::FItoStackOffset(cast<FrameIndexSDNode>(N)->getIndex());
- MVT::ValueType PtrVT = SPUtli.getPointerTy();
-
- // Adjust stack slot to actual offset in frame:
- if (isS10Constant(FI)) {
- DEBUG(cerr << "SPUDAGToDAGISel: Replacing FrameIndex with AIr32 $sp, "
- << FI
- << "\n");
- NewOpc = SPU::AIr32;
- Ops[0] = CurDAG->getRegister(SPU::R1, PtrVT);
- Ops[1] = CurDAG->getTargetConstant(FI, PtrVT);
- n_ops = 2;
- } else {
- DEBUG(cerr << "SPUDAGToDAGISel: Replacing FrameIndex with Ar32 $sp, "
- << FI
- << "\n");
- NewOpc = SPU::Ar32;
- Ops[0] = CurDAG->getRegister(SPU::R1, PtrVT);
- Ops[1] = CurDAG->getConstant(FI, PtrVT);
- n_ops = 2;
-
- AddToISelQueue(Ops[1]);
- }
- } else if (Opc == ISD::ZERO_EXTEND) {
- // (zero_extend:i16 (and:i8 <arg>, <const>))
- const SDOperand &Op1 = N->getOperand(0);
-
- if (Op.getValueType() == MVT::i16 && Op1.getValueType() == MVT::i8) {
- if (Op1.getOpcode() == ISD::AND) {
- // Fold this into a single ANDHI. This is often seen in expansions of i1
- // to i8, then i8 to i16 in logical/branching operations.
- DEBUG(cerr << "CellSPU: Coalescing (zero_extend:i16 (and:i8 "
- "<arg>, <const>))\n");
- NewOpc = SPU::ANDHIi8i16;
- Ops[0] = Op1.getOperand(0);
- Ops[1] = Op1.getOperand(1);
- n_ops = 2;
- }
- }
- } else if (Opc == SPUISD::LDRESULT) {
- // Custom select instructions for LDRESULT
- unsigned VT = N->getValueType(0);
- SDOperand Arg = N->getOperand(0);
- SDOperand Chain = N->getOperand(1);
- SDNode *Result;
- const valtype_map_s *vtm = getValueTypeMapEntry(VT);
-
- if (vtm->ldresult_ins == 0) {
- cerr << "LDRESULT for unsupported type: "
- << MVT::getValueTypeString(VT)
- << "\n";
- abort();
- }
-
- AddToISelQueue(Arg);
- Opc = vtm->ldresult_ins;
- if (vtm->ldresult_imm) {
- SDOperand Zero = CurDAG->getTargetConstant(0, VT);
-
- AddToISelQueue(Zero);
- Result = CurDAG->getTargetNode(Opc, VT, MVT::Other, Arg, Zero, Chain);
- } else {
- Result = CurDAG->getTargetNode(Opc, MVT::Other, Arg, Arg, Chain);
- }
-
- Chain = SDOperand(Result, 1);
- AddToISelQueue(Chain);
-
- return Result;
- } else if (Opc == SPUISD::IndirectAddr) {
- SDOperand Op0 = Op.getOperand(0);
- if (Op0.getOpcode() == SPUISD::LDRESULT) {
- /* || Op0.getOpcode() == SPUISD::AFormAddr) */
- // (IndirectAddr (LDRESULT, imm))
- SDOperand Op1 = Op.getOperand(1);
- MVT::ValueType VT = Op.getValueType();
-
- DEBUG(cerr << "CellSPU: IndirectAddr(LDRESULT, imm):\nOp0 = ");
- DEBUG(Op.getOperand(0).Val->dump(CurDAG));
- DEBUG(cerr << "\nOp1 = ");
- DEBUG(Op.getOperand(1).Val->dump(CurDAG));
- DEBUG(cerr << "\n");
-
- if (Op1.getOpcode() == ISD::Constant) {
- ConstantSDNode *CN = cast<ConstantSDNode>(Op1);
- Op1 = CurDAG->getTargetConstant(CN->getValue(), VT);
- NewOpc = (isI32IntS10Immediate(CN) ? SPU::AIr32 : SPU::Ar32);
- AddToISelQueue(Op0);
- AddToISelQueue(Op1);
- Ops[0] = Op0;
- Ops[1] = Op1;
- n_ops = 2;
- }
- }
- }
-
- if (n_ops > 0) {
- if (N->hasOneUse())
- return CurDAG->SelectNodeTo(N, NewOpc, OpVT, Ops, n_ops);
- else
- return CurDAG->getTargetNode(NewOpc, OpVT, Ops, n_ops);
- } else
- return SelectCode(Op);
-}
-
-/// createPPCISelDag - This pass converts a legalized DAG into a
-/// SPU-specific DAG, ready for instruction scheduling.
-///
-FunctionPass *llvm::createSPUISelDag(SPUTargetMachine &TM) {
- return new SPUDAGToDAGISel(TM);
-}
diff --git a/release_23/lib/Target/CellSPU/SPUISelLowering.cpp b/release_23/lib/Target/CellSPU/SPUISelLowering.cpp
deleted file mode 100644
index ad797dda8ee2..000000000000
--- a/release_23/lib/Target/CellSPU/SPUISelLowering.cpp
+++ /dev/null
@@ -1,2930 +0,0 @@
-//===-- SPUISelLowering.cpp - Cell SPU DAG Lowering Implementation --------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the SPUTargetLowering class.
-//
-//===----------------------------------------------------------------------===//
-
-#include "SPURegisterNames.h"
-#include "SPUISelLowering.h"
-#include "SPUTargetMachine.h"
-#include "SPUFrameInfo.h"
-#include "llvm/ADT/VectorExtras.h"
-#include "llvm/Analysis/ScalarEvolutionExpressions.h"
-#include "llvm/CodeGen/CallingConvLower.h"
-#include "llvm/CodeGen/MachineFrameInfo.h"
-#include "llvm/CodeGen/MachineFunction.h"
-#include "llvm/CodeGen/MachineInstrBuilder.h"
-#include "llvm/CodeGen/MachineRegisterInfo.h"
-#include "llvm/CodeGen/SelectionDAG.h"
-#include "llvm/Constants.h"
-#include "llvm/Function.h"
-#include "llvm/Intrinsics.h"
-#include "llvm/Support/Debug.h"
-#include "llvm/Support/MathExtras.h"
-#include "llvm/Target/TargetOptions.h"
-
-#include <map>
-
-using namespace llvm;
-
-// Used in getTargetNodeName() below
-namespace {
- std::map<unsigned, const char *> node_names;
-
- //! MVT::ValueType mapping to useful data for Cell SPU
- struct valtype_map_s {
- const MVT::ValueType valtype;
- const int prefslot_byte;
- };
-
- const valtype_map_s valtype_map[] = {
- { MVT::i1, 3 },
- { MVT::i8, 3 },
- { MVT::i16, 2 },
- { MVT::i32, 0 },
- { MVT::f32, 0 },
- { MVT::i64, 0 },
- { MVT::f64, 0 },
- { MVT::i128, 0 }
- };
-
- const size_t n_valtype_map = sizeof(valtype_map) / sizeof(valtype_map[0]);
-
- const valtype_map_s *getValueTypeMapEntry(MVT::ValueType VT) {
- const valtype_map_s *retval = 0;
-
- for (size_t i = 0; i < n_valtype_map; ++i) {
- if (valtype_map[i].valtype == VT) {
- retval = valtype_map + i;
- break;
- }
- }
-
-#ifndef NDEBUG
- if (retval == 0) {
- cerr << "getValueTypeMapEntry returns NULL for "
- << MVT::getValueTypeString(VT)
- << "\n";
- abort();
- }
-#endif
-
- return retval;
- }
-
- //! Predicate that returns true if operand is a memory target
- /*!
- \arg Op Operand to test
- \return true if the operand is a memory target (i.e., global
- address, external symbol, constant pool) or an A-form
- address.
- */
- bool isMemoryOperand(const SDOperand &Op)
- {
- const unsigned Opc = Op.getOpcode();
- return (Opc == ISD::GlobalAddress
- || Opc == ISD::GlobalTLSAddress
- || Opc == ISD::JumpTable
- || Opc == ISD::ConstantPool
- || Opc == ISD::ExternalSymbol
- || Opc == ISD::TargetGlobalAddress
- || Opc == ISD::TargetGlobalTLSAddress
- || Opc == ISD::TargetJumpTable
- || Opc == ISD::TargetConstantPool
- || Opc == ISD::TargetExternalSymbol
- || Opc == SPUISD::AFormAddr);
- }
-
- //! Predicate that returns true if the operand is an indirect target
- bool isIndirectOperand(const SDOperand &Op)
- {
- const unsigned Opc = Op.getOpcode();
- return (Opc == ISD::Register
- || Opc == SPUISD::LDRESULT);
- }
-}
-
-SPUTargetLowering::SPUTargetLowering(SPUTargetMachine &TM)
- : TargetLowering(TM),
- SPUTM(TM)
-{
- // Fold away setcc operations if possible.
- setPow2DivIsCheap();
-
- // Use _setjmp/_longjmp instead of setjmp/longjmp.
- setUseUnderscoreSetJmp(true);
- setUseUnderscoreLongJmp(true);
-
- // Set up the SPU's register classes:
- addRegisterClass(MVT::i8, SPU::R8CRegisterClass);
- addRegisterClass(MVT::i16, SPU::R16CRegisterClass);
- addRegisterClass(MVT::i32, SPU::R32CRegisterClass);
- addRegisterClass(MVT::i64, SPU::R64CRegisterClass);
- addRegisterClass(MVT::f32, SPU::R32FPRegisterClass);
- addRegisterClass(MVT::f64, SPU::R64FPRegisterClass);
- addRegisterClass(MVT::i128, SPU::GPRCRegisterClass);
-
- // SPU has no sign or zero extended loads for i1, i8, i16:
- setLoadXAction(ISD::EXTLOAD, MVT::i1, Promote);
- setLoadXAction(ISD::SEXTLOAD, MVT::i1, Promote);
- setLoadXAction(ISD::ZEXTLOAD, MVT::i1, Promote);
- setTruncStoreAction(MVT::i8, MVT::i1, Custom);
- setTruncStoreAction(MVT::i16, MVT::i1, Custom);
- setTruncStoreAction(MVT::i32, MVT::i1, Custom);
- setTruncStoreAction(MVT::i64, MVT::i1, Custom);
- setTruncStoreAction(MVT::i128, MVT::i1, Custom);
-
- setLoadXAction(ISD::EXTLOAD, MVT::i8, Custom);
- setLoadXAction(ISD::SEXTLOAD, MVT::i8, Custom);
- setLoadXAction(ISD::ZEXTLOAD, MVT::i8, Custom);
- setTruncStoreAction(MVT::i8 , MVT::i8, Custom);
- setTruncStoreAction(MVT::i16 , MVT::i8, Custom);
- setTruncStoreAction(MVT::i32 , MVT::i8, Custom);
- setTruncStoreAction(MVT::i64 , MVT::i8, Custom);
- setTruncStoreAction(MVT::i128, MVT::i8, Custom);
-
- setLoadXAction(ISD::EXTLOAD, MVT::i16, Custom);
- setLoadXAction(ISD::SEXTLOAD, MVT::i16, Custom);
- setLoadXAction(ISD::ZEXTLOAD, MVT::i16, Custom);
-
- // SPU constant load actions are custom lowered:
- setOperationAction(ISD::Constant, MVT::i64, Custom);
- setOperationAction(ISD::ConstantFP, MVT::f32, Legal);
- setOperationAction(ISD::ConstantFP, MVT::f64, Custom);
-
- // SPU's loads and stores have to be custom lowered:
- for (unsigned sctype = (unsigned) MVT::i1; sctype < (unsigned) MVT::f128;
- ++sctype) {
- setOperationAction(ISD::LOAD, sctype, Custom);
- setOperationAction(ISD::STORE, sctype, Custom);
- }
-
- // Custom lower BRCOND for i1, i8 to "promote" the result to
- // i32 and i16, respectively.
- setOperationAction(ISD::BRCOND, MVT::Other, Custom);
-
- // Expand the jumptable branches
- setOperationAction(ISD::BR_JT, MVT::Other, Expand);
- setOperationAction(ISD::BR_CC, MVT::Other, Expand);
- setOperationAction(ISD::SELECT_CC, MVT::Other, Expand);
-
- // SPU has no intrinsics for these particular operations:
- setOperationAction(ISD::MEMBARRIER, MVT::Other, Expand);
-
- // PowerPC has no SREM/UREM instructions
- setOperationAction(ISD::SREM, MVT::i32, Expand);
- setOperationAction(ISD::UREM, MVT::i32, Expand);
- setOperationAction(ISD::SREM, MVT::i64, Expand);
- setOperationAction(ISD::UREM, MVT::i64, Expand);
-
- // We don't support sin/cos/sqrt/fmod
- setOperationAction(ISD::FSIN , MVT::f64, Expand);
- setOperationAction(ISD::FCOS , MVT::f64, Expand);
- setOperationAction(ISD::FREM , MVT::f64, Expand);
- setOperationAction(ISD::FSIN , MVT::f32, Expand);
- setOperationAction(ISD::FCOS , MVT::f32, Expand);
- setOperationAction(ISD::FREM , MVT::f32, Expand);
-
- // If we're enabling GP optimizations, use hardware square root
- setOperationAction(ISD::FSQRT, MVT::f64, Expand);
- setOperationAction(ISD::FSQRT, MVT::f32, Expand);
-
- setOperationAction(ISD::FCOPYSIGN, MVT::f64, Expand);
- setOperationAction(ISD::FCOPYSIGN, MVT::f32, Expand);
-
- // SPU can do rotate right and left, so legalize it... but customize for i8
- // because instructions don't exist.
- setOperationAction(ISD::ROTR, MVT::i32, Legal);
- setOperationAction(ISD::ROTR, MVT::i16, Legal);
- setOperationAction(ISD::ROTR, MVT::i8, Custom);
- setOperationAction(ISD::ROTL, MVT::i32, Legal);
- setOperationAction(ISD::ROTL, MVT::i16, Legal);
- setOperationAction(ISD::ROTL, MVT::i8, Custom);
- // SPU has no native version of shift left/right for i8
- setOperationAction(ISD::SHL, MVT::i8, Custom);
- setOperationAction(ISD::SRL, MVT::i8, Custom);
- setOperationAction(ISD::SRA, MVT::i8, Custom);
- // And SPU needs custom lowering for shift left/right for i64
- setOperationAction(ISD::SHL, MVT::i64, Custom);
- setOperationAction(ISD::SRL, MVT::i64, Custom);
- setOperationAction(ISD::SRA, MVT::i64, Custom);
-
- // Custom lower i32 multiplications
- setOperationAction(ISD::MUL, MVT::i32, Custom);
-
- // Need to custom handle (some) common i8 math ops
- setOperationAction(ISD::SUB, MVT::i8, Custom);
- setOperationAction(ISD::MUL, MVT::i8, Custom);
-
- // SPU does not have BSWAP. It does have i32 support CTLZ.
- // CTPOP has to be custom lowered.
- setOperationAction(ISD::BSWAP, MVT::i32, Expand);
- setOperationAction(ISD::BSWAP, MVT::i64, Expand);
-
- setOperationAction(ISD::CTPOP, MVT::i8, Custom);
- setOperationAction(ISD::CTPOP, MVT::i16, Custom);
- setOperationAction(ISD::CTPOP, MVT::i32, Custom);
- setOperationAction(ISD::CTPOP, MVT::i64, Custom);
-
- setOperationAction(ISD::CTTZ , MVT::i32, Expand);
- setOperationAction(ISD::CTTZ , MVT::i64, Expand);
-
- setOperationAction(ISD::CTLZ , MVT::i32, Legal);
-
- // SPU has a version of select that implements (a&~c)|(b|c), just like
- // select ought to work:
- setOperationAction(ISD::SELECT, MVT::i1, Promote);
- setOperationAction(ISD::SELECT, MVT::i8, Legal);
- setOperationAction(ISD::SELECT, MVT::i16, Legal);
- setOperationAction(ISD::SELECT, MVT::i32, Legal);
- setOperationAction(ISD::SELECT, MVT::i64, Expand);
-
- setOperationAction(ISD::SETCC, MVT::i1, Promote);
- setOperationAction(ISD::SETCC, MVT::i8, Legal);
- setOperationAction(ISD::SETCC, MVT::i16, Legal);
- setOperationAction(ISD::SETCC, MVT::i32, Legal);
- setOperationAction(ISD::SETCC, MVT::i64, Expand);
-
- // Zero extension and sign extension for i64 have to be
- // custom legalized
- setOperationAction(ISD::ZERO_EXTEND, MVT::i64, Custom);
- setOperationAction(ISD::SIGN_EXTEND, MVT::i64, Custom);
- setOperationAction(ISD::ANY_EXTEND, MVT::i64, Custom);
-
- // SPU has a legal FP -> signed INT instruction
- setOperationAction(ISD::FP_TO_SINT, MVT::i32, Legal);
- setOperationAction(ISD::FP_TO_SINT, MVT::i64, Custom);
- setOperationAction(ISD::FP_TO_UINT, MVT::i32, Legal);
- setOperationAction(ISD::FP_TO_UINT, MVT::i64, Custom);
-
- // FDIV on SPU requires custom lowering
- setOperationAction(ISD::FDIV, MVT::f32, Custom);
- //setOperationAction(ISD::FDIV, MVT::f64, Custom);
-
- // SPU has [U|S]INT_TO_FP
- setOperationAction(ISD::SINT_TO_FP, MVT::i32, Legal);
- setOperationAction(ISD::SINT_TO_FP, MVT::i16, Promote);
- setOperationAction(ISD::SINT_TO_FP, MVT::i8, Promote);
- setOperationAction(ISD::UINT_TO_FP, MVT::i32, Legal);
- setOperationAction(ISD::UINT_TO_FP, MVT::i16, Promote);
- setOperationAction(ISD::UINT_TO_FP, MVT::i8, Promote);
- setOperationAction(ISD::SINT_TO_FP, MVT::i64, Custom);
- setOperationAction(ISD::UINT_TO_FP, MVT::i64, Custom);
-
- setOperationAction(ISD::BIT_CONVERT, MVT::i32, Legal);
- setOperationAction(ISD::BIT_CONVERT, MVT::f32, Legal);
- setOperationAction(ISD::BIT_CONVERT, MVT::i64, Legal);
- setOperationAction(ISD::BIT_CONVERT, MVT::f64, Legal);
-
- // We cannot sextinreg(i1). Expand to shifts.
- setOperationAction(ISD::SIGN_EXTEND_INREG, MVT::i1, Expand);
-
- // Support label based line numbers.
- setOperationAction(ISD::LOCATION, MVT::Other, Expand);
- setOperationAction(ISD::DEBUG_LOC, MVT::Other, Expand);
-
- // We want to legalize GlobalAddress and ConstantPool nodes into the
- // appropriate instructions to materialize the address.
- for (unsigned sctype = (unsigned) MVT::i1; sctype < (unsigned) MVT::f128;
- ++sctype) {
- setOperationAction(ISD::GlobalAddress, sctype, Custom);
- setOperationAction(ISD::ConstantPool, sctype, Custom);
- setOperationAction(ISD::JumpTable, sctype, Custom);
- }
-
- // RET must be custom lowered, to meet ABI requirements
- setOperationAction(ISD::RET, MVT::Other, Custom);
-
- // VASTART needs to be custom lowered to use the VarArgsFrameIndex
- setOperationAction(ISD::VASTART , MVT::Other, Custom);
-
- // Use the default implementation.
- setOperationAction(ISD::VAARG , MVT::Other, Expand);
- setOperationAction(ISD::VACOPY , MVT::Other, Expand);
- setOperationAction(ISD::VAEND , MVT::Other, Expand);
- setOperationAction(ISD::STACKSAVE , MVT::Other, Expand);
- setOperationAction(ISD::STACKRESTORE , MVT::Other, Expand);
- setOperationAction(ISD::DYNAMIC_STACKALLOC, MVT::i32 , Expand);
- setOperationAction(ISD::DYNAMIC_STACKALLOC, MVT::i64 , Expand);
-
- // Cell SPU has instructions for converting between i64 and fp.
- setOperationAction(ISD::FP_TO_SINT, MVT::i64, Custom);
- setOperationAction(ISD::SINT_TO_FP, MVT::i64, Custom);
-
- // To take advantage of the above i64 FP_TO_SINT, promote i32 FP_TO_UINT
- setOperationAction(ISD::FP_TO_UINT, MVT::i32, Promote);
-
- // BUILD_PAIR can't be handled natively, and should be expanded to shl/or
- setOperationAction(ISD::BUILD_PAIR, MVT::i64, Expand);
-
- // First set operation action for all vector types to expand. Then we
- // will selectively turn on ones that can be effectively codegen'd.
- addRegisterClass(MVT::v16i8, SPU::VECREGRegisterClass);
- addRegisterClass(MVT::v8i16, SPU::VECREGRegisterClass);
- addRegisterClass(MVT::v4i32, SPU::VECREGRegisterClass);
- addRegisterClass(MVT::v2i64, SPU::VECREGRegisterClass);
- addRegisterClass(MVT::v4f32, SPU::VECREGRegisterClass);
- addRegisterClass(MVT::v2f64, SPU::VECREGRegisterClass);
-
- for (unsigned VT = (unsigned)MVT::FIRST_VECTOR_VALUETYPE;
- VT <= (unsigned)MVT::LAST_VECTOR_VALUETYPE; ++VT) {
- // add/sub are legal for all supported vector VT's.
- setOperationAction(ISD::ADD , (MVT::ValueType)VT, Legal);
- setOperationAction(ISD::SUB , (MVT::ValueType)VT, Legal);
- // mul has to be custom lowered.
- setOperationAction(ISD::MUL , (MVT::ValueType)VT, Custom);
-
- setOperationAction(ISD::AND , (MVT::ValueType)VT, Legal);
- setOperationAction(ISD::OR , (MVT::ValueType)VT, Legal);
- setOperationAction(ISD::XOR , (MVT::ValueType)VT, Legal);
- setOperationAction(ISD::LOAD , (MVT::ValueType)VT, Legal);
- setOperationAction(ISD::SELECT, (MVT::ValueType)VT, Legal);
- setOperationAction(ISD::STORE, (MVT::ValueType)VT, Legal);
-
- // These operations need to be expanded:
- setOperationAction(ISD::SDIV, (MVT::ValueType)VT, Expand);
- setOperationAction(ISD::SREM, (MVT::ValueType)VT, Expand);
- setOperationAction(ISD::UDIV, (MVT::ValueType)VT, Expand);
- setOperationAction(ISD::UREM, (MVT::ValueType)VT, Expand);
- setOperationAction(ISD::FDIV, (MVT::ValueType)VT, Custom);
-
- // Custom lower build_vector, constant pool spills, insert and
- // extract vector elements:
- setOperationAction(ISD::BUILD_VECTOR, (MVT::ValueType)VT, Custom);
- setOperationAction(ISD::ConstantPool, (MVT::ValueType)VT, Custom);
- setOperationAction(ISD::SCALAR_TO_VECTOR, (MVT::ValueType)VT, Custom);
- setOperationAction(ISD::EXTRACT_VECTOR_ELT, (MVT::ValueType)VT, Custom);
- setOperationAction(ISD::INSERT_VECTOR_ELT, (MVT::ValueType)VT, Custom);
- setOperationAction(ISD::VECTOR_SHUFFLE, (MVT::ValueType)VT, Custom);
- }
-
- setOperationAction(ISD::MUL, MVT::v16i8, Custom);
- setOperationAction(ISD::AND, MVT::v16i8, Custom);
- setOperationAction(ISD::OR, MVT::v16i8, Custom);
- setOperationAction(ISD::XOR, MVT::v16i8, Custom);
- setOperationAction(ISD::SCALAR_TO_VECTOR, MVT::v4f32, Custom);
-
- setShiftAmountType(MVT::i32);
- setSetCCResultContents(ZeroOrOneSetCCResult);
-
- setStackPointerRegisterToSaveRestore(SPU::R1);
-
- // We have target-specific dag combine patterns for the following nodes:
- setTargetDAGCombine(ISD::ADD);
- setTargetDAGCombine(ISD::ZERO_EXTEND);
- setTargetDAGCombine(ISD::SIGN_EXTEND);
- setTargetDAGCombine(ISD::ANY_EXTEND);
-
- computeRegisterProperties();
-}
-
-const char *
-SPUTargetLowering::getTargetNodeName(unsigned Opcode) const
-{
- if (node_names.empty()) {
- node_names[(unsigned) SPUISD::RET_FLAG] = "SPUISD::RET_FLAG";
- node_names[(unsigned) SPUISD::Hi] = "SPUISD::Hi";
- node_names[(unsigned) SPUISD::Lo] = "SPUISD::Lo";
- node_names[(unsigned) SPUISD::PCRelAddr] = "SPUISD::PCRelAddr";
- node_names[(unsigned) SPUISD::AFormAddr] = "SPUISD::AFormAddr";
- node_names[(unsigned) SPUISD::IndirectAddr] = "SPUISD::IndirectAddr";
- node_names[(unsigned) SPUISD::LDRESULT] = "SPUISD::LDRESULT";
- node_names[(unsigned) SPUISD::CALL] = "SPUISD::CALL";
- node_names[(unsigned) SPUISD::SHUFB] = "SPUISD::SHUFB";
- node_names[(unsigned) SPUISD::INSERT_MASK] = "SPUISD::INSERT_MASK";
- node_names[(unsigned) SPUISD::CNTB] = "SPUISD::CNTB";
- node_names[(unsigned) SPUISD::PROMOTE_SCALAR] = "SPUISD::PROMOTE_SCALAR";
- node_names[(unsigned) SPUISD::EXTRACT_ELT0] = "SPUISD::EXTRACT_ELT0";
- node_names[(unsigned) SPUISD::EXTRACT_ELT0_CHAINED] = "SPUISD::EXTRACT_ELT0_CHAINED";
- node_names[(unsigned) SPUISD::EXTRACT_I1_ZEXT] = "SPUISD::EXTRACT_I1_ZEXT";
- node_names[(unsigned) SPUISD::EXTRACT_I1_SEXT] = "SPUISD::EXTRACT_I1_SEXT";
- node_names[(unsigned) SPUISD::EXTRACT_I8_ZEXT] = "SPUISD::EXTRACT_I8_ZEXT";
- node_names[(unsigned) SPUISD::EXTRACT_I8_SEXT] = "SPUISD::EXTRACT_I8_SEXT";
- node_names[(unsigned) SPUISD::MPY] = "SPUISD::MPY";
- node_names[(unsigned) SPUISD::MPYU] = "SPUISD::MPYU";
- node_names[(unsigned) SPUISD::MPYH] = "SPUISD::MPYH";
- node_names[(unsigned) SPUISD::MPYHH] = "SPUISD::MPYHH";
- node_names[(unsigned) SPUISD::SHLQUAD_L_BITS] = "SPUISD::SHLQUAD_L_BITS";
- node_names[(unsigned) SPUISD::SHLQUAD_L_BYTES] = "SPUISD::SHLQUAD_L_BYTES";
- node_names[(unsigned) SPUISD::VEC_SHL] = "SPUISD::VEC_SHL";
- node_names[(unsigned) SPUISD::VEC_SRL] = "SPUISD::VEC_SRL";
- node_names[(unsigned) SPUISD::VEC_SRA] = "SPUISD::VEC_SRA";
- node_names[(unsigned) SPUISD::VEC_ROTL] = "SPUISD::VEC_ROTL";
- node_names[(unsigned) SPUISD::VEC_ROTR] = "SPUISD::VEC_ROTR";
- node_names[(unsigned) SPUISD::ROTQUAD_RZ_BYTES] =
- "SPUISD::ROTQUAD_RZ_BYTES";
- node_names[(unsigned) SPUISD::ROTQUAD_RZ_BITS] =
- "SPUISD::ROTQUAD_RZ_BITS";
- node_names[(unsigned) SPUISD::ROTBYTES_RIGHT_S] =
- "SPUISD::ROTBYTES_RIGHT_S";
- node_names[(unsigned) SPUISD::ROTBYTES_LEFT] = "SPUISD::ROTBYTES_LEFT";
- node_names[(unsigned) SPUISD::ROTBYTES_LEFT_CHAINED] =
- "SPUISD::ROTBYTES_LEFT_CHAINED";
- node_names[(unsigned) SPUISD::FSMBI] = "SPUISD::FSMBI";
- node_names[(unsigned) SPUISD::SELB] = "SPUISD::SELB";
- node_names[(unsigned) SPUISD::FPInterp] = "SPUISD::FPInterp";
- node_names[(unsigned) SPUISD::FPRecipEst] = "SPUISD::FPRecipEst";
- node_names[(unsigned) SPUISD::SEXT32TO64] = "SPUISD::SEXT32TO64";
- }
-
- std::map<unsigned, const char *>::iterator i = node_names.find(Opcode);
-
- return ((i != node_names.end()) ? i->second : 0);
-}
-
-MVT::ValueType
-SPUTargetLowering::getSetCCResultType(const SDOperand &Op) const {
- MVT::ValueType VT = Op.getValueType();
- if (MVT::isInteger(VT))
- return VT;
- else
- return MVT::i32;
-}
-
-//===----------------------------------------------------------------------===//
-// Calling convention code:
-//===----------------------------------------------------------------------===//
-
-#include "SPUGenCallingConv.inc"
-
-//===----------------------------------------------------------------------===//
-// LowerOperation implementation
-//===----------------------------------------------------------------------===//
-
-/// Aligned load common code for CellSPU
-/*!
- \param[in] Op The SelectionDAG load or store operand
- \param[in] DAG The selection DAG
- \param[in] ST CellSPU subtarget information structure
- \param[in,out] alignment Caller initializes this to the load or store node's
- value from getAlignment(), may be updated while generating the aligned load
- \param[in,out] alignOffs Aligned offset; set by AlignedLoad to the aligned
- offset (divisible by 16, modulo 16 == 0)
- \param[in,out] prefSlotOffs Preferred slot offset; set by AlignedLoad to the
- offset of the preferred slot (modulo 16 != 0)
- \param[in,out] VT Caller initializes this value type to the the load or store
- node's loaded or stored value type; may be updated if an i1-extended load or
- store.
- \param[out] was16aligned true if the base pointer had 16-byte alignment,
- otherwise false. Can help to determine if the chunk needs to be rotated.
-
- Both load and store lowering load a block of data aligned on a 16-byte
- boundary. This is the common aligned load code shared between both.
- */
-static SDOperand
-AlignedLoad(SDOperand Op, SelectionDAG &DAG, const SPUSubtarget *ST,
- LSBaseSDNode *LSN,
- unsigned &alignment, int &alignOffs, int &prefSlotOffs,
- MVT::ValueType &VT, bool &was16aligned)
-{
- MVT::ValueType PtrVT = DAG.getTargetLoweringInfo().getPointerTy();
- const valtype_map_s *vtm = getValueTypeMapEntry(VT);
- SDOperand basePtr = LSN->getBasePtr();
- SDOperand chain = LSN->getChain();
-
- if (basePtr.getOpcode() == ISD::ADD) {
- SDOperand Op1 = basePtr.Val->getOperand(1);
-
- if (Op1.getOpcode() == ISD::Constant || Op1.getOpcode() == ISD::TargetConstant) {
- const ConstantSDNode *CN = cast<ConstantSDNode>(basePtr.getOperand(1));
-
- alignOffs = (int) CN->getValue();
- prefSlotOffs = (int) (alignOffs & 0xf);
-
- // Adjust the rotation amount to ensure that the final result ends up in
- // the preferred slot:
- prefSlotOffs -= vtm->prefslot_byte;
- basePtr = basePtr.getOperand(0);
-
- // Loading from memory, can we adjust alignment?
- if (basePtr.getOpcode() == SPUISD::AFormAddr) {
- SDOperand APtr = basePtr.getOperand(0);
- if (APtr.getOpcode() == ISD::TargetGlobalAddress) {
- GlobalAddressSDNode *GSDN = cast<GlobalAddressSDNode>(APtr);
- alignment = GSDN->getGlobal()->getAlignment();
- }
- }
- } else {
- alignOffs = 0;
- prefSlotOffs = -vtm->prefslot_byte;
- }
- } else if (basePtr.getOpcode() == ISD::FrameIndex) {
- FrameIndexSDNode *FIN = cast<FrameIndexSDNode>(basePtr);
- alignOffs = int(FIN->getIndex() * SPUFrameInfo::stackSlotSize());
- prefSlotOffs = (int) (alignOffs & 0xf);
- prefSlotOffs -= vtm->prefslot_byte;
- basePtr = DAG.getRegister(SPU::R1, VT);
- } else {
- alignOffs = 0;
- prefSlotOffs = -vtm->prefslot_byte;
- }
-
- if (alignment == 16) {
- // Realign the base pointer as a D-Form address:
- if (!isMemoryOperand(basePtr) || (alignOffs & ~0xf) != 0) {
- basePtr = DAG.getNode(ISD::ADD, PtrVT,
- basePtr,
- DAG.getConstant((alignOffs & ~0xf), PtrVT));
- }
-
- // Emit the vector load:
- was16aligned = true;
- return DAG.getLoad(MVT::v16i8, chain, basePtr,
- LSN->getSrcValue(), LSN->getSrcValueOffset(),
- LSN->isVolatile(), 16);
- }
-
- // Unaligned load or we're using the "large memory" model, which means that
- // we have to be very pessimistic:
- if (isMemoryOperand(basePtr) || isIndirectOperand(basePtr)) {
- basePtr = DAG.getNode(SPUISD::IndirectAddr, PtrVT, basePtr, DAG.getConstant(0, PtrVT));
- }
-
- // Add the offset
- basePtr = DAG.getNode(ISD::ADD, PtrVT, basePtr,
- DAG.getConstant((alignOffs & ~0xf), PtrVT));
- was16aligned = false;
- return DAG.getLoad(MVT::v16i8, chain, basePtr,
- LSN->getSrcValue(), LSN->getSrcValueOffset(),
- LSN->isVolatile(), 16);
-}
-
-/// Custom lower loads for CellSPU
-/*!
- All CellSPU loads and stores are aligned to 16-byte boundaries, so for elements
- within a 16-byte block, we have to rotate to extract the requested element.
- */
-static SDOperand
-LowerLOAD(SDOperand Op, SelectionDAG &DAG, const SPUSubtarget *ST) {
- LoadSDNode *LN = cast<LoadSDNode>(Op);
- SDOperand the_chain = LN->getChain();
- MVT::ValueType VT = LN->getMemoryVT();
- MVT::ValueType OpVT = Op.Val->getValueType(0);
- ISD::LoadExtType ExtType = LN->getExtensionType();
- unsigned alignment = LN->getAlignment();
- SDOperand Ops[8];
-
- switch (LN->getAddressingMode()) {
- case ISD::UNINDEXED: {
- int offset, rotamt;
- bool was16aligned;
- SDOperand result =
- AlignedLoad(Op, DAG, ST, LN,alignment, offset, rotamt, VT, was16aligned);
-
- if (result.Val == 0)
- return result;
-
- the_chain = result.getValue(1);
- // Rotate the chunk if necessary
- if (rotamt < 0)
- rotamt += 16;
- if (rotamt != 0 || !was16aligned) {
- SDVTList vecvts = DAG.getVTList(MVT::v16i8, MVT::Other);
-
- Ops[0] = the_chain;
- Ops[1] = result;
- if (was16aligned) {
- Ops[2] = DAG.getConstant(rotamt, MVT::i16);
- } else {
- MVT::ValueType PtrVT = DAG.getTargetLoweringInfo().getPointerTy();
- LoadSDNode *LN1 = cast<LoadSDNode>(result);
- Ops[2] = DAG.getNode(ISD::ADD, PtrVT, LN1->getBasePtr(),
- DAG.getConstant(rotamt, PtrVT));
- }
-
- result = DAG.getNode(SPUISD::ROTBYTES_LEFT_CHAINED, vecvts, Ops, 3);
- the_chain = result.getValue(1);
- }
-
- if (VT == OpVT || ExtType == ISD::EXTLOAD) {
- SDVTList scalarvts;
- MVT::ValueType vecVT = MVT::v16i8;
-
- // Convert the loaded v16i8 vector to the appropriate vector type
- // specified by the operand:
- if (OpVT == VT) {
- if (VT != MVT::i1)
- vecVT = MVT::getVectorType(VT, (128 / MVT::getSizeInBits(VT)));
- } else
- vecVT = MVT::getVectorType(OpVT, (128 / MVT::getSizeInBits(OpVT)));
-
- Ops[0] = the_chain;
- Ops[1] = DAG.getNode(ISD::BIT_CONVERT, vecVT, result);
- scalarvts = DAG.getVTList((OpVT == VT ? VT : OpVT), MVT::Other);
- result = DAG.getNode(SPUISD::EXTRACT_ELT0_CHAINED, scalarvts, Ops, 2);
- the_chain = result.getValue(1);
- } else {
- // Handle the sign and zero-extending loads for i1 and i8:
- unsigned NewOpC;
-
- if (ExtType == ISD::SEXTLOAD) {
- NewOpC = (OpVT == MVT::i1
- ? SPUISD::EXTRACT_I1_SEXT
- : SPUISD::EXTRACT_I8_SEXT);
- } else {
- assert(ExtType == ISD::ZEXTLOAD);
- NewOpC = (OpVT == MVT::i1
- ? SPUISD::EXTRACT_I1_ZEXT
- : SPUISD::EXTRACT_I8_ZEXT);
- }
-
- result = DAG.getNode(NewOpC, OpVT, result);
- }
-
- SDVTList retvts = DAG.getVTList(OpVT, MVT::Other);
- SDOperand retops[2] = {
- result,
- the_chain
- };
-
- result = DAG.getNode(SPUISD::LDRESULT, retvts,
- retops, sizeof(retops) / sizeof(retops[0]));
- return result;
- }
- case ISD::PRE_INC:
- case ISD::PRE_DEC:
- case ISD::POST_INC:
- case ISD::POST_DEC:
- case ISD::LAST_INDEXED_MODE:
- cerr << "LowerLOAD: Got a LoadSDNode with an addr mode other than "
- "UNINDEXED\n";
- cerr << (unsigned) LN->getAddressingMode() << "\n";
- abort();
- /*NOTREACHED*/
- }
-
- return SDOperand();
-}
-
-/// Custom lower stores for CellSPU
-/*!
- All CellSPU stores are aligned to 16-byte boundaries, so for elements
- within a 16-byte block, we have to generate a shuffle to insert the
- requested element into its place, then store the resulting block.
- */
-static SDOperand
-LowerSTORE(SDOperand Op, SelectionDAG &DAG, const SPUSubtarget *ST) {
- StoreSDNode *SN = cast<StoreSDNode>(Op);
- SDOperand Value = SN->getValue();
- MVT::ValueType VT = Value.getValueType();
- MVT::ValueType StVT = (!SN->isTruncatingStore() ? VT : SN->getMemoryVT());
- MVT::ValueType PtrVT = DAG.getTargetLoweringInfo().getPointerTy();
- unsigned alignment = SN->getAlignment();
-
- switch (SN->getAddressingMode()) {
- case ISD::UNINDEXED: {
- int chunk_offset, slot_offset;
- bool was16aligned;
-
- // The vector type we really want to load from the 16-byte chunk, except
- // in the case of MVT::i1, which has to be v16i8.
- unsigned vecVT, stVecVT = MVT::v16i8;
-
- if (StVT != MVT::i1)
- stVecVT = MVT::getVectorType(StVT, (128 / MVT::getSizeInBits(StVT)));
- vecVT = MVT::getVectorType(VT, (128 / MVT::getSizeInBits(VT)));
-
- SDOperand alignLoadVec =
- AlignedLoad(Op, DAG, ST, SN, alignment,
- chunk_offset, slot_offset, VT, was16aligned);
-
- if (alignLoadVec.Val == 0)
- return alignLoadVec;
-
- LoadSDNode *LN = cast<LoadSDNode>(alignLoadVec);
- SDOperand basePtr = LN->getBasePtr();
- SDOperand the_chain = alignLoadVec.getValue(1);
- SDOperand theValue = SN->getValue();
- SDOperand result;
-
- if (StVT != VT
- && (theValue.getOpcode() == ISD::AssertZext
- || theValue.getOpcode() == ISD::AssertSext)) {
- // Drill down and get the value for zero- and sign-extended
- // quantities
- theValue = theValue.getOperand(0);
- }
-
- chunk_offset &= 0xf;
-
- SDOperand insertEltOffs = DAG.getConstant(chunk_offset, PtrVT);
- SDOperand insertEltPtr;
- SDOperand insertEltOp;
-
- // If the base pointer is already a D-form address, then just create
- // a new D-form address with a slot offset and the orignal base pointer.
- // Otherwise generate a D-form address with the slot offset relative
- // to the stack pointer, which is always aligned.
- DEBUG(cerr << "CellSPU LowerSTORE: basePtr = ");
- DEBUG(basePtr.Val->dump(&DAG));
- DEBUG(cerr << "\n");
-
- if (basePtr.getOpcode() == SPUISD::IndirectAddr ||
- (basePtr.getOpcode() == ISD::ADD
- && basePtr.getOperand(0).getOpcode() == SPUISD::IndirectAddr)) {
- insertEltPtr = basePtr;
- } else {
- insertEltPtr = DAG.getNode(ISD::ADD, PtrVT, basePtr, insertEltOffs);
- }
-
- insertEltOp = DAG.getNode(SPUISD::INSERT_MASK, stVecVT, insertEltPtr);
- result = DAG.getNode(SPUISD::SHUFB, vecVT,
- DAG.getNode(ISD::SCALAR_TO_VECTOR, vecVT, theValue),
- alignLoadVec,
- DAG.getNode(ISD::BIT_CONVERT, vecVT, insertEltOp));
-
- result = DAG.getStore(the_chain, result, basePtr,
- LN->getSrcValue(), LN->getSrcValueOffset(),
- LN->isVolatile(), LN->getAlignment());
-
- return result;
- /*UNREACHED*/
- }
- case ISD::PRE_INC:
- case ISD::PRE_DEC:
- case ISD::POST_INC:
- case ISD::POST_DEC:
- case ISD::LAST_INDEXED_MODE:
- cerr << "LowerLOAD: Got a LoadSDNode with an addr mode other than "
- "UNINDEXED\n";
- cerr << (unsigned) SN->getAddressingMode() << "\n";
- abort();
- /*NOTREACHED*/
- }
-
- return SDOperand();
-}
-
-/// Generate the address of a constant pool entry.
-static SDOperand
-LowerConstantPool(SDOperand Op, SelectionDAG &DAG, const SPUSubtarget *ST) {
- MVT::ValueType PtrVT = Op.getValueType();
- ConstantPoolSDNode *CP = cast<ConstantPoolSDNode>(Op);
- Constant *C = CP->getConstVal();
- SDOperand CPI = DAG.getTargetConstantPool(C, PtrVT, CP->getAlignment());
- SDOperand Zero = DAG.getConstant(0, PtrVT);
- const TargetMachine &TM = DAG.getTarget();
-
- if (TM.getRelocationModel() == Reloc::Static) {
- if (!ST->usingLargeMem()) {
- // Just return the SDOperand with the constant pool address in it.
- return DAG.getNode(SPUISD::AFormAddr, PtrVT, CPI, Zero);
- } else {
- SDOperand Hi = DAG.getNode(SPUISD::Hi, PtrVT, CPI, Zero);
- SDOperand Lo = DAG.getNode(SPUISD::Lo, PtrVT, CPI, Zero);
- return DAG.getNode(SPUISD::IndirectAddr, PtrVT, Hi, Lo);
- }
- }
-
- assert(0 &&
- "LowerConstantPool: Relocation model other than static not supported.");
- return SDOperand();
-}
-
-static SDOperand
-LowerJumpTable(SDOperand Op, SelectionDAG &DAG, const SPUSubtarget *ST) {
- MVT::ValueType PtrVT = Op.getValueType();
- JumpTableSDNode *JT = cast<JumpTableSDNode>(Op);
- SDOperand JTI = DAG.getTargetJumpTable(JT->getIndex(), PtrVT);
- SDOperand Zero = DAG.getConstant(0, PtrVT);
- const TargetMachine &TM = DAG.getTarget();
-
- if (TM.getRelocationModel() == Reloc::Static) {
- if (!ST->usingLargeMem()) {
- return DAG.getNode(SPUISD::AFormAddr, PtrVT, JTI, Zero);
- } else {
- SDOperand Hi = DAG.getNode(SPUISD::Hi, PtrVT, JTI, Zero);
- SDOperand Lo = DAG.getNode(SPUISD::Lo, PtrVT, JTI, Zero);
- return DAG.getNode(SPUISD::IndirectAddr, PtrVT, Hi, Lo);
- }
- }
-
- assert(0 &&
- "LowerJumpTable: Relocation model other than static not supported.");
- return SDOperand();
-}
-
-static SDOperand
-LowerGlobalAddress(SDOperand Op, SelectionDAG &DAG, const SPUSubtarget *ST) {
- MVT::ValueType PtrVT = Op.getValueType();
- GlobalAddressSDNode *GSDN = cast<GlobalAddressSDNode>(Op);
- GlobalValue *GV = GSDN->getGlobal();
- SDOperand GA = DAG.getTargetGlobalAddress(GV, PtrVT, GSDN->getOffset());
- const TargetMachine &TM = DAG.getTarget();
- SDOperand Zero = DAG.getConstant(0, PtrVT);
-
- if (TM.getRelocationModel() == Reloc::Static) {
- if (!ST->usingLargeMem()) {
- return DAG.getNode(SPUISD::AFormAddr, PtrVT, GA, Zero);
- } else {
- SDOperand Hi = DAG.getNode(SPUISD::Hi, PtrVT, GA, Zero);
- SDOperand Lo = DAG.getNode(SPUISD::Lo, PtrVT, GA, Zero);
- return DAG.getNode(SPUISD::IndirectAddr, PtrVT, Hi, Lo);
- }
- } else {
- cerr << "LowerGlobalAddress: Relocation model other than static not "
- << "supported.\n";
- abort();
- /*NOTREACHED*/
- }
-
- return SDOperand();
-}
-
-//! Custom lower i64 integer constants
-/*!
- This code inserts all of the necessary juggling that needs to occur to load
- a 64-bit constant into a register.
- */
-static SDOperand
-LowerConstant(SDOperand Op, SelectionDAG &DAG) {
- unsigned VT = Op.getValueType();
- ConstantSDNode *CN = cast<ConstantSDNode>(Op.Val);
-
- if (VT == MVT::i64) {
- SDOperand T = DAG.getConstant(CN->getValue(), MVT::i64);
- return DAG.getNode(SPUISD::EXTRACT_ELT0, VT,
- DAG.getNode(ISD::BUILD_VECTOR, MVT::v2i64, T, T));
- } else {
- cerr << "LowerConstant: unhandled constant type "
- << MVT::getValueTypeString(VT)
- << "\n";
- abort();
- /*NOTREACHED*/
- }
-
- return SDOperand();
-}
-
-//! Custom lower double precision floating point constants
-static SDOperand
-LowerConstantFP(SDOperand Op, SelectionDAG &DAG) {
- unsigned VT = Op.getValueType();
- ConstantFPSDNode *FP = cast<ConstantFPSDNode>(Op.Val);
-
- assert((FP != 0) &&
- "LowerConstantFP: Node is not ConstantFPSDNode");
-
- if (VT == MVT::f64) {
- uint64_t dbits = DoubleToBits(FP->getValueAPF().convertToDouble());
- return DAG.getNode(ISD::BIT_CONVERT, VT,
- LowerConstant(DAG.getConstant(dbits, MVT::i64), DAG));
- }
-
- return SDOperand();
-}
-
-//! Lower MVT::i1, MVT::i8 brcond to a promoted type (MVT::i32, MVT::i16)
-static SDOperand
-LowerBRCOND(SDOperand Op, SelectionDAG &DAG)
-{
- SDOperand Cond = Op.getOperand(1);
- MVT::ValueType CondVT = Cond.getValueType();
- MVT::ValueType CondNVT;
-
- if (CondVT == MVT::i1 || CondVT == MVT::i8) {
- CondNVT = (CondVT == MVT::i1 ? MVT::i32 : MVT::i16);
- return DAG.getNode(ISD::BRCOND, Op.getValueType(),
- Op.getOperand(0),
- DAG.getNode(ISD::ZERO_EXTEND, CondNVT, Op.getOperand(1)),
- Op.getOperand(2));
- } else
- return SDOperand(); // Unchanged
-}
-
-static SDOperand
-LowerFORMAL_ARGUMENTS(SDOperand Op, SelectionDAG &DAG, int &VarArgsFrameIndex)
-{
- MachineFunction &MF = DAG.getMachineFunction();
- MachineFrameInfo *MFI = MF.getFrameInfo();
- MachineRegisterInfo &RegInfo = MF.getRegInfo();
- SmallVector<SDOperand, 8> ArgValues;
- SDOperand Root = Op.getOperand(0);
- bool isVarArg = cast<ConstantSDNode>(Op.getOperand(2))->getValue() != 0;
-
- const unsigned *ArgRegs = SPURegisterInfo::getArgRegs();
- const unsigned NumArgRegs = SPURegisterInfo::getNumArgRegs();
-
- unsigned ArgOffset = SPUFrameInfo::minStackSize();
- unsigned ArgRegIdx = 0;
- unsigned StackSlotSize = SPUFrameInfo::stackSlotSize();
-
- MVT::ValueType PtrVT = DAG.getTargetLoweringInfo().getPointerTy();
-
- // Add DAG nodes to load the arguments or copy them out of registers.
- for (unsigned ArgNo = 0, e = Op.Val->getNumValues()-1; ArgNo != e; ++ArgNo) {
- SDOperand ArgVal;
- bool needsLoad = false;
- MVT::ValueType ObjectVT = Op.getValue(ArgNo).getValueType();
- unsigned ObjSize = MVT::getSizeInBits(ObjectVT)/8;
-
- switch (ObjectVT) {
- default: {
- cerr << "LowerFORMAL_ARGUMENTS Unhandled argument type: "
- << MVT::getValueTypeString(ObjectVT)
- << "\n";
- abort();
- }
- case MVT::i8:
- if (!isVarArg && ArgRegIdx < NumArgRegs) {
- unsigned VReg = RegInfo.createVirtualRegister(&SPU::R8CRegClass);
- RegInfo.addLiveIn(ArgRegs[ArgRegIdx], VReg);
- ArgVal = DAG.getCopyFromReg(Root, VReg, MVT::i8);
- ++ArgRegIdx;
- } else {
- needsLoad = true;
- }
- break;
- case MVT::i16:
- if (!isVarArg && ArgRegIdx < NumArgRegs) {
- unsigned VReg = RegInfo.createVirtualRegister(&SPU::R16CRegClass);
- RegInfo.addLiveIn(ArgRegs[ArgRegIdx], VReg);
- ArgVal = DAG.getCopyFromReg(Root, VReg, MVT::i16);
- ++ArgRegIdx;
- } else {
- needsLoad = true;
- }
- break;
- case MVT::i32:
- if (!isVarArg && ArgRegIdx < NumArgRegs) {
- unsigned VReg = RegInfo.createVirtualRegister(&SPU::R32CRegClass);
- RegInfo.addLiveIn(ArgRegs[ArgRegIdx], VReg);
- ArgVal = DAG.getCopyFromReg(Root, VReg, MVT::i32);
- ++ArgRegIdx;
- } else {
- needsLoad = true;
- }
- break;
- case MVT::i64:
- if (!isVarArg && ArgRegIdx < NumArgRegs) {
- unsigned VReg = RegInfo.createVirtualRegister(&SPU::R64CRegClass);
- RegInfo.addLiveIn(ArgRegs[ArgRegIdx], VReg);
- ArgVal = DAG.getCopyFromReg(Root, VReg, MVT::i64);
- ++ArgRegIdx;
- } else {
- needsLoad = true;
- }
- break;
- case MVT::f32:
- if (!isVarArg && ArgRegIdx < NumArgRegs) {
- unsigned VReg = RegInfo.createVirtualRegister(&SPU::R32FPRegClass);
- RegInfo.addLiveIn(ArgRegs[ArgRegIdx], VReg);
- ArgVal = DAG.getCopyFromReg(Root, VReg, MVT::f32);
- ++ArgRegIdx;
- } else {
- needsLoad = true;
- }
- break;
- case MVT::f64:
- if (!isVarArg && ArgRegIdx < NumArgRegs) {
- unsigned VReg = RegInfo.createVirtualRegister(&SPU::R64FPRegClass);
- RegInfo.addLiveIn(ArgRegs[ArgRegIdx], VReg);
- ArgVal = DAG.getCopyFromReg(Root, VReg, MVT::f64);
- ++ArgRegIdx;
- } else {
- needsLoad = true;
- }
- break;
- case MVT::v2f64:
- case MVT::v4f32:
- case MVT::v2i64:
- case MVT::v4i32:
- case MVT::v8i16:
- case MVT::v16i8:
- if (!isVarArg && ArgRegIdx < NumArgRegs) {
- unsigned VReg = RegInfo.createVirtualRegister(&SPU::VECREGRegClass);
- RegInfo.addLiveIn(ArgRegs[ArgRegIdx], VReg);
- ArgVal = DAG.getCopyFromReg(Root, VReg, ObjectVT);
- ++ArgRegIdx;
- } else {
- needsLoad = true;
- }
- break;
- }
-
- // We need to load the argument to a virtual register if we determined above
- // that we ran out of physical registers of the appropriate type
- if (needsLoad) {
- int FI = MFI->CreateFixedObject(ObjSize, ArgOffset);
- SDOperand FIN = DAG.getFrameIndex(FI, PtrVT);
- ArgVal = DAG.getLoad(ObjectVT, Root, FIN, NULL, 0);
- ArgOffset += StackSlotSize;
- }
-
- ArgValues.push_back(ArgVal);
- }
-
- // If the function takes variable number of arguments, make a frame index for
- // the start of the first vararg value... for expansion of llvm.va_start.
- if (isVarArg) {
- VarArgsFrameIndex = MFI->CreateFixedObject(MVT::getSizeInBits(PtrVT)/8,
- ArgOffset);
- SDOperand FIN = DAG.getFrameIndex(VarArgsFrameIndex, PtrVT);
- // If this function is vararg, store any remaining integer argument regs to
- // their spots on the stack so that they may be loaded by deferencing the
- // result of va_next.
- SmallVector<SDOperand, 8> MemOps;
- for (; ArgRegIdx != NumArgRegs; ++ArgRegIdx) {
- unsigned VReg = RegInfo.createVirtualRegister(&SPU::GPRCRegClass);
- RegInfo.addLiveIn(ArgRegs[ArgRegIdx], VReg);
- SDOperand Val = DAG.getCopyFromReg(Root, VReg, PtrVT);
- SDOperand Store = DAG.getStore(Val.getValue(1), Val, FIN, NULL, 0);
- MemOps.push_back(Store);
- // Increment the address by four for the next argument to store
- SDOperand PtrOff = DAG.getConstant(MVT::getSizeInBits(PtrVT)/8, PtrVT);
- FIN = DAG.getNode(ISD::ADD, PtrOff.getValueType(), FIN, PtrOff);
- }
- if (!MemOps.empty())
- Root = DAG.getNode(ISD::TokenFactor, MVT::Other,&MemOps[0],MemOps.size());
- }
-
- ArgValues.push_back(Root);
-
- // Return the new list of results.
- std::vector<MVT::ValueType> RetVT(Op.Val->value_begin(),
- Op.Val->value_end());
- return DAG.getNode(ISD::MERGE_VALUES, RetVT, &ArgValues[0], ArgValues.size());
-}
-
-/// isLSAAddress - Return the immediate to use if the specified
-/// value is representable as a LSA address.
-static SDNode *isLSAAddress(SDOperand Op, SelectionDAG &DAG) {
- ConstantSDNode *C = dyn_cast<ConstantSDNode>(Op);
- if (!C) return 0;
-
- int Addr = C->getValue();
- if ((Addr & 3) != 0 || // Low 2 bits are implicitly zero.
- (Addr << 14 >> 14) != Addr)
- return 0; // Top 14 bits have to be sext of immediate.
-
- return DAG.getConstant((int)C->getValue() >> 2, MVT::i32).Val;
-}
-
-static
-SDOperand
-LowerCALL(SDOperand Op, SelectionDAG &DAG, const SPUSubtarget *ST) {
- SDOperand Chain = Op.getOperand(0);
-#if 0
- bool isVarArg = cast<ConstantSDNode>(Op.getOperand(2))->getValue() != 0;
- bool isTailCall = cast<ConstantSDNode>(Op.getOperand(3))->getValue() != 0;
-#endif
- SDOperand Callee = Op.getOperand(4);
- unsigned NumOps = (Op.getNumOperands() - 5) / 2;
- unsigned StackSlotSize = SPUFrameInfo::stackSlotSize();
- const unsigned *ArgRegs = SPURegisterInfo::getArgRegs();
- const unsigned NumArgRegs = SPURegisterInfo::getNumArgRegs();
-
- // Handy pointer type
- MVT::ValueType PtrVT = DAG.getTargetLoweringInfo().getPointerTy();
-
- // Accumulate how many bytes are to be pushed on the stack, including the
- // linkage area, and parameter passing area. According to the SPU ABI,
- // we minimally need space for [LR] and [SP]
- unsigned NumStackBytes = SPUFrameInfo::minStackSize();
-
- // Set up a copy of the stack pointer for use loading and storing any
- // arguments that may not fit in the registers available for argument
- // passing.
- SDOperand StackPtr = DAG.getRegister(SPU::R1, MVT::i32);
-
- // Figure out which arguments are going to go in registers, and which in
- // memory.
- unsigned ArgOffset = SPUFrameInfo::minStackSize(); // Just below [LR]
- unsigned ArgRegIdx = 0;
-
- // Keep track of registers passing arguments
- std::vector<std::pair<unsigned, SDOperand> > RegsToPass;
- // And the arguments passed on the stack
- SmallVector<SDOperand, 8> MemOpChains;
-
- for (unsigned i = 0; i != NumOps; ++i) {
- SDOperand Arg = Op.getOperand(5+2*i);
-
- // PtrOff will be used to store the current argument to the stack if a
- // register cannot be found for it.
- SDOperand PtrOff = DAG.getConstant(ArgOffset, StackPtr.getValueType());
- PtrOff = DAG.getNode(ISD::ADD, PtrVT, StackPtr, PtrOff);
-
- switch (Arg.getValueType()) {
- default: assert(0 && "Unexpected ValueType for argument!");
- case MVT::i32:
- case MVT::i64:
- case MVT::i128:
- if (ArgRegIdx != NumArgRegs) {
- RegsToPass.push_back(std::make_pair(ArgRegs[ArgRegIdx++], Arg));
- } else {
- MemOpChains.push_back(DAG.getStore(Chain, Arg, PtrOff, NULL, 0));
- ArgOffset += StackSlotSize;
- }
- break;
- case MVT::f32:
- case MVT::f64:
- if (ArgRegIdx != NumArgRegs) {
- RegsToPass.push_back(std::make_pair(ArgRegs[ArgRegIdx++], Arg));
- } else {
- MemOpChains.push_back(DAG.getStore(Chain, Arg, PtrOff, NULL, 0));
- ArgOffset += StackSlotSize;
- }
- break;
- case MVT::v4f32:
- case MVT::v4i32:
- case MVT::v8i16:
- case MVT::v16i8:
- if (ArgRegIdx != NumArgRegs) {
- RegsToPass.push_back(std::make_pair(ArgRegs[ArgRegIdx++], Arg));
- } else {
- MemOpChains.push_back(DAG.getStore(Chain, Arg, PtrOff, NULL, 0));
- ArgOffset += StackSlotSize;
- }
- break;
- }
- }
-
- // Update number of stack bytes actually used, insert a call sequence start
- NumStackBytes = (ArgOffset - SPUFrameInfo::minStackSize());
- Chain = DAG.getCALLSEQ_START(Chain, DAG.getConstant(NumStackBytes, PtrVT));
-
- if (!MemOpChains.empty()) {
- // Adjust the stack pointer for the stack arguments.
- Chain = DAG.getNode(ISD::TokenFactor, MVT::Other,
- &MemOpChains[0], MemOpChains.size());
- }
-
- // Build a sequence of copy-to-reg nodes chained together with token chain
- // and flag operands which copy the outgoing args into the appropriate regs.
- SDOperand InFlag;
- for (unsigned i = 0, e = RegsToPass.size(); i != e; ++i) {
- Chain = DAG.getCopyToReg(Chain, RegsToPass[i].first, RegsToPass[i].second,
- InFlag);
- InFlag = Chain.getValue(1);
- }
-
- std::vector<MVT::ValueType> NodeTys;
- NodeTys.push_back(MVT::Other); // Returns a chain
- NodeTys.push_back(MVT::Flag); // Returns a flag for retval copy to use.
-
- SmallVector<SDOperand, 8> Ops;
- unsigned CallOpc = SPUISD::CALL;
-
- // If the callee is a GlobalAddress/ExternalSymbol node (quite common, every
- // direct call is) turn it into a TargetGlobalAddress/TargetExternalSymbol
- // node so that legalize doesn't hack it.
- if (GlobalAddressSDNode *G = dyn_cast<GlobalAddressSDNode>(Callee)) {
- GlobalValue *GV = G->getGlobal();
- unsigned CalleeVT = Callee.getValueType();
- SDOperand Zero = DAG.getConstant(0, PtrVT);
- SDOperand GA = DAG.getTargetGlobalAddress(GV, CalleeVT);
-
- if (!ST->usingLargeMem()) {
- // Turn calls to targets that are defined (i.e., have bodies) into BRSL
- // style calls, otherwise, external symbols are BRASL calls. This assumes
- // that declared/defined symbols are in the same compilation unit and can
- // be reached through PC-relative jumps.
- //
- // NOTE:
- // This may be an unsafe assumption for JIT and really large compilation
- // units.
- if (GV->isDeclaration()) {
- Callee = DAG.getNode(SPUISD::AFormAddr, CalleeVT, GA, Zero);
- } else {
- Callee = DAG.getNode(SPUISD::PCRelAddr, CalleeVT, GA, Zero);
- }
- } else {
- // "Large memory" mode: Turn all calls into indirect calls with a X-form
- // address pairs:
- Callee = DAG.getNode(SPUISD::IndirectAddr, PtrVT, GA, Zero);
- }
- } else if (ExternalSymbolSDNode *S = dyn_cast<ExternalSymbolSDNode>(Callee))
- Callee = DAG.getExternalSymbol(S->getSymbol(), Callee.getValueType());
- else if (SDNode *Dest = isLSAAddress(Callee, DAG)) {
- // If this is an absolute destination address that appears to be a legal
- // local store address, use the munged value.
- Callee = SDOperand(Dest, 0);
- }
-
- Ops.push_back(Chain);
- Ops.push_back(Callee);
-
- // Add argument registers to the end of the list so that they are known live
- // into the call.
- for (unsigned i = 0, e = RegsToPass.size(); i != e; ++i)
- Ops.push_back(DAG.getRegister(RegsToPass[i].first,
- RegsToPass[i].second.getValueType()));
-
- if (InFlag.Val)
- Ops.push_back(InFlag);
- Chain = DAG.getNode(CallOpc, NodeTys, &Ops[0], Ops.size());
- InFlag = Chain.getValue(1);
-
- Chain = DAG.getCALLSEQ_END(Chain,
- DAG.getConstant(NumStackBytes, PtrVT),
- DAG.getConstant(0, PtrVT),
- InFlag);
- if (Op.Val->getValueType(0) != MVT::Other)
- InFlag = Chain.getValue(1);
-
- SDOperand ResultVals[3];
- unsigned NumResults = 0;
- NodeTys.clear();
-
- // If the call has results, copy the values out of the ret val registers.
- switch (Op.Val->getValueType(0)) {
- default: assert(0 && "Unexpected ret value!");
- case MVT::Other: break;
- case MVT::i32:
- if (Op.Val->getValueType(1) == MVT::i32) {
- Chain = DAG.getCopyFromReg(Chain, SPU::R4, MVT::i32, InFlag).getValue(1);
- ResultVals[0] = Chain.getValue(0);
- Chain = DAG.getCopyFromReg(Chain, SPU::R3, MVT::i32,
- Chain.getValue(2)).getValue(1);
- ResultVals[1] = Chain.getValue(0);
- NumResults = 2;
- NodeTys.push_back(MVT::i32);
- } else {
- Chain = DAG.getCopyFromReg(Chain, SPU::R3, MVT::i32, InFlag).getValue(1);
- ResultVals[0] = Chain.getValue(0);
- NumResults = 1;
- }
- NodeTys.push_back(MVT::i32);
- break;
- case MVT::i64:
- Chain = DAG.getCopyFromReg(Chain, SPU::R3, MVT::i64, InFlag).getValue(1);
- ResultVals[0] = Chain.getValue(0);
- NumResults = 1;
- NodeTys.push_back(MVT::i64);
- break;
- case MVT::f32:
- case MVT::f64:
- Chain = DAG.getCopyFromReg(Chain, SPU::R3, Op.Val->getValueType(0),
- InFlag).getValue(1);
- ResultVals[0] = Chain.getValue(0);
- NumResults = 1;
- NodeTys.push_back(Op.Val->getValueType(0));
- break;
- case MVT::v2f64:
- case MVT::v4f32:
- case MVT::v4i32:
- case MVT::v8i16:
- case MVT::v16i8:
- Chain = DAG.getCopyFromReg(Chain, SPU::R3, Op.Val->getValueType(0),
- InFlag).getValue(1);
- ResultVals[0] = Chain.getValue(0);
- NumResults = 1;
- NodeTys.push_back(Op.Val->getValueType(0));
- break;
- }
-
- NodeTys.push_back(MVT::Other);
-
- // If the function returns void, just return the chain.
- if (NumResults == 0)
- return Chain;
-
- // Otherwise, merge everything together with a MERGE_VALUES node.
- ResultVals[NumResults++] = Chain;
- SDOperand Res = DAG.getNode(ISD::MERGE_VALUES, NodeTys,
- ResultVals, NumResults);
- return Res.getValue(Op.ResNo);
-}
-
-static SDOperand
-LowerRET(SDOperand Op, SelectionDAG &DAG, TargetMachine &TM) {
- SmallVector<CCValAssign, 16> RVLocs;
- unsigned CC = DAG.getMachineFunction().getFunction()->getCallingConv();
- bool isVarArg = DAG.getMachineFunction().getFunction()->isVarArg();
- CCState CCInfo(CC, isVarArg, TM, RVLocs);
- CCInfo.AnalyzeReturn(Op.Val, RetCC_SPU);
-
- // If this is the first return lowered for this function, add the regs to the
- // liveout set for the function.
- if (DAG.getMachineFunction().getRegInfo().liveout_empty()) {
- for (unsigned i = 0; i != RVLocs.size(); ++i)
- DAG.getMachineFunction().getRegInfo().addLiveOut(RVLocs[i].getLocReg());
- }
-
- SDOperand Chain = Op.getOperand(0);
- SDOperand Flag;
-
- // Copy the result values into the output registers.
- for (unsigned i = 0; i != RVLocs.size(); ++i) {
- CCValAssign &VA = RVLocs[i];
- assert(VA.isRegLoc() && "Can only return in registers!");
- Chain = DAG.getCopyToReg(Chain, VA.getLocReg(), Op.getOperand(i*2+1), Flag);
- Flag = Chain.getValue(1);
- }
-
- if (Flag.Val)
- return DAG.getNode(SPUISD::RET_FLAG, MVT::Other, Chain, Flag);
- else
- return DAG.getNode(SPUISD::RET_FLAG, MVT::Other, Chain);
-}
-
-
-//===----------------------------------------------------------------------===//
-// Vector related lowering:
-//===----------------------------------------------------------------------===//
-
-static ConstantSDNode *
-getVecImm(SDNode *N) {
- SDOperand OpVal(0, 0);
-
- // Check to see if this buildvec has a single non-undef value in its elements.
- for (unsigned i = 0, e = N->getNumOperands(); i != e; ++i) {
- if (N->getOperand(i).getOpcode() == ISD::UNDEF) continue;
- if (OpVal.Val == 0)
- OpVal = N->getOperand(i);
- else if (OpVal != N->getOperand(i))
- return 0;
- }
-
- if (OpVal.Val != 0) {
- if (ConstantSDNode *CN = dyn_cast<ConstantSDNode>(OpVal)) {
- return CN;
- }
- }
-
- return 0; // All UNDEF: use implicit def.; not Constant node
-}
-
-/// get_vec_i18imm - Test if this vector is a vector filled with the same value
-/// and the value fits into an unsigned 18-bit constant, and if so, return the
-/// constant
-SDOperand SPU::get_vec_u18imm(SDNode *N, SelectionDAG &DAG,
- MVT::ValueType ValueType) {
- if (ConstantSDNode *CN = getVecImm(N)) {
- uint64_t Value = CN->getValue();
- if (ValueType == MVT::i64) {
- uint64_t UValue = CN->getValue();
- uint32_t upper = uint32_t(UValue >> 32);
- uint32_t lower = uint32_t(UValue);
- if (upper != lower)
- return SDOperand();
- Value = Value >> 32;
- }
- if (Value <= 0x3ffff)
- return DAG.getConstant(Value, ValueType);
- }
-
- return SDOperand();
-}
-
-/// get_vec_i16imm - Test if this vector is a vector filled with the same value
-/// and the value fits into a signed 16-bit constant, and if so, return the
-/// constant
-SDOperand SPU::get_vec_i16imm(SDNode *N, SelectionDAG &DAG,
- MVT::ValueType ValueType) {
- if (ConstantSDNode *CN = getVecImm(N)) {
- int64_t Value = CN->getSignExtended();
- if (ValueType == MVT::i64) {
- uint64_t UValue = CN->getValue();
- uint32_t upper = uint32_t(UValue >> 32);
- uint32_t lower = uint32_t(UValue);
- if (upper != lower)
- return SDOperand();
- Value = Value >> 32;
- }
- if (Value >= -(1 << 15) && Value <= ((1 << 15) - 1)) {
- return DAG.getConstant(Value, ValueType);
- }
- }
-
- return SDOperand();
-}
-
-/// get_vec_i10imm - Test if this vector is a vector filled with the same value
-/// and the value fits into a signed 10-bit constant, and if so, return the
-/// constant
-SDOperand SPU::get_vec_i10imm(SDNode *N, SelectionDAG &DAG,
- MVT::ValueType ValueType) {
- if (ConstantSDNode *CN = getVecImm(N)) {
- int64_t Value = CN->getSignExtended();
- if (ValueType == MVT::i64) {
- uint64_t UValue = CN->getValue();
- uint32_t upper = uint32_t(UValue >> 32);
- uint32_t lower = uint32_t(UValue);
- if (upper != lower)
- return SDOperand();
- Value = Value >> 32;
- }
- if (isS10Constant(Value))
- return DAG.getConstant(Value, ValueType);
- }
-
- return SDOperand();
-}
-
-/// get_vec_i8imm - Test if this vector is a vector filled with the same value
-/// and the value fits into a signed 8-bit constant, and if so, return the
-/// constant.
-///
-/// @note: The incoming vector is v16i8 because that's the only way we can load
-/// constant vectors. Thus, we test to see if the upper and lower bytes are the
-/// same value.
-SDOperand SPU::get_vec_i8imm(SDNode *N, SelectionDAG &DAG,
- MVT::ValueType ValueType) {
- if (ConstantSDNode *CN = getVecImm(N)) {
- int Value = (int) CN->getValue();
- if (ValueType == MVT::i16
- && Value <= 0xffff /* truncated from uint64_t */
- && ((short) Value >> 8) == ((short) Value & 0xff))
- return DAG.getConstant(Value & 0xff, ValueType);
- else if (ValueType == MVT::i8
- && (Value & 0xff) == Value)
- return DAG.getConstant(Value, ValueType);
- }
-
- return SDOperand();
-}
-
-/// get_ILHUvec_imm - Test if this vector is a vector filled with the same value
-/// and the value fits into a signed 16-bit constant, and if so, return the
-/// constant
-SDOperand SPU::get_ILHUvec_imm(SDNode *N, SelectionDAG &DAG,
- MVT::ValueType ValueType) {
- if (ConstantSDNode *CN = getVecImm(N)) {
- uint64_t Value = CN->getValue();
- if ((ValueType == MVT::i32
- && ((unsigned) Value & 0xffff0000) == (unsigned) Value)
- || (ValueType == MVT::i64 && (Value & 0xffff0000) == Value))
- return DAG.getConstant(Value >> 16, ValueType);
- }
-
- return SDOperand();
-}
-
-/// get_v4i32_imm - Catch-all for general 32-bit constant vectors
-SDOperand SPU::get_v4i32_imm(SDNode *N, SelectionDAG &DAG) {
- if (ConstantSDNode *CN = getVecImm(N)) {
- return DAG.getConstant((unsigned) CN->getValue(), MVT::i32);
- }
-
- return SDOperand();
-}
-
-/// get_v4i32_imm - Catch-all for general 64-bit constant vectors
-SDOperand SPU::get_v2i64_imm(SDNode *N, SelectionDAG &DAG) {
- if (ConstantSDNode *CN = getVecImm(N)) {
- return DAG.getConstant((unsigned) CN->getValue(), MVT::i64);
- }
-
- return SDOperand();
-}
-
-// If this is a vector of constants or undefs, get the bits. A bit in
-// UndefBits is set if the corresponding element of the vector is an
-// ISD::UNDEF value. For undefs, the corresponding VectorBits values are
-// zero. Return true if this is not an array of constants, false if it is.
-//
-static bool GetConstantBuildVectorBits(SDNode *BV, uint64_t VectorBits[2],
- uint64_t UndefBits[2]) {
- // Start with zero'd results.
- VectorBits[0] = VectorBits[1] = UndefBits[0] = UndefBits[1] = 0;
-
- unsigned EltBitSize = MVT::getSizeInBits(BV->getOperand(0).getValueType());
- for (unsigned i = 0, e = BV->getNumOperands(); i != e; ++i) {
- SDOperand OpVal = BV->getOperand(i);
-
- unsigned PartNo = i >= e/2; // In the upper 128 bits?
- unsigned SlotNo = e/2 - (i & (e/2-1))-1; // Which subpiece of the uint64_t.
-
- uint64_t EltBits = 0;
- if (OpVal.getOpcode() == ISD::UNDEF) {
- uint64_t EltUndefBits = ~0ULL >> (64-EltBitSize);
- UndefBits[PartNo] |= EltUndefBits << (SlotNo*EltBitSize);
- continue;
- } else if (ConstantSDNode *CN = dyn_cast<ConstantSDNode>(OpVal)) {
- EltBits = CN->getValue() & (~0ULL >> (64-EltBitSize));
- } else if (ConstantFPSDNode *CN = dyn_cast<ConstantFPSDNode>(OpVal)) {
- const APFloat &apf = CN->getValueAPF();
- EltBits = (CN->getValueType(0) == MVT::f32
- ? FloatToBits(apf.convertToFloat())
- : DoubleToBits(apf.convertToDouble()));
- } else {
- // Nonconstant element.
- return true;
- }
-
- VectorBits[PartNo] |= EltBits << (SlotNo*EltBitSize);
- }
-
- //printf("%llx %llx %llx %llx\n",
- // VectorBits[0], VectorBits[1], UndefBits[0], UndefBits[1]);
- return false;
-}
-
-/// If this is a splat (repetition) of a value across the whole vector, return
-/// the smallest size that splats it. For example, "0x01010101010101..." is a
-/// splat of 0x01, 0x0101, and 0x01010101. We return SplatBits = 0x01 and
-/// SplatSize = 1 byte.
-static bool isConstantSplat(const uint64_t Bits128[2],
- const uint64_t Undef128[2],
- int MinSplatBits,
- uint64_t &SplatBits, uint64_t &SplatUndef,
- int &SplatSize) {
- // Don't let undefs prevent splats from matching. See if the top 64-bits are
- // the same as the lower 64-bits, ignoring undefs.
- uint64_t Bits64 = Bits128[0] | Bits128[1];
- uint64_t Undef64 = Undef128[0] & Undef128[1];
- uint32_t Bits32 = uint32_t(Bits64) | uint32_t(Bits64 >> 32);
- uint32_t Undef32 = uint32_t(Undef64) & uint32_t(Undef64 >> 32);
- uint16_t Bits16 = uint16_t(Bits32) | uint16_t(Bits32 >> 16);
- uint16_t Undef16 = uint16_t(Undef32) & uint16_t(Undef32 >> 16);
-
- if ((Bits128[0] & ~Undef128[1]) == (Bits128[1] & ~Undef128[0])) {
- if (MinSplatBits < 64) {
-
- // Check that the top 32-bits are the same as the lower 32-bits, ignoring
- // undefs.
- if ((Bits64 & (~Undef64 >> 32)) == ((Bits64 >> 32) & ~Undef64)) {
- if (MinSplatBits < 32) {
-
- // If the top 16-bits are different than the lower 16-bits, ignoring
- // undefs, we have an i32 splat.
- if ((Bits32 & (~Undef32 >> 16)) == ((Bits32 >> 16) & ~Undef32)) {
- if (MinSplatBits < 16) {
- // If the top 8-bits are different than the lower 8-bits, ignoring
- // undefs, we have an i16 splat.
- if ((Bits16 & (uint16_t(~Undef16) >> 8)) == ((Bits16 >> 8) & ~Undef16)) {
- // Otherwise, we have an 8-bit splat.
- SplatBits = uint8_t(Bits16) | uint8_t(Bits16 >> 8);
- SplatUndef = uint8_t(Undef16) & uint8_t(Undef16 >> 8);
- SplatSize = 1;
- return true;
- }
- } else {
- SplatBits = Bits16;
- SplatUndef = Undef16;
- SplatSize = 2;
- return true;
- }
- }
- } else {
- SplatBits = Bits32;
- SplatUndef = Undef32;
- SplatSize = 4;
- return true;
- }
- }
- } else {
- SplatBits = Bits128[0];
- SplatUndef = Undef128[0];
- SplatSize = 8;
- return true;
- }
- }
-
- return false; // Can't be a splat if two pieces don't match.
-}
-
-// If this is a case we can't handle, return null and let the default
-// expansion code take care of it. If we CAN select this case, and if it
-// selects to a single instruction, return Op. Otherwise, if we can codegen
-// this case more efficiently than a constant pool load, lower it to the
-// sequence of ops that should be used.
-static SDOperand LowerBUILD_VECTOR(SDOperand Op, SelectionDAG &DAG) {
- MVT::ValueType VT = Op.getValueType();
- // If this is a vector of constants or undefs, get the bits. A bit in
- // UndefBits is set if the corresponding element of the vector is an
- // ISD::UNDEF value. For undefs, the corresponding VectorBits values are
- // zero.
- uint64_t VectorBits[2];
- uint64_t UndefBits[2];
- uint64_t SplatBits, SplatUndef;
- int SplatSize;
- if (GetConstantBuildVectorBits(Op.Val, VectorBits, UndefBits)
- || !isConstantSplat(VectorBits, UndefBits,
- MVT::getSizeInBits(MVT::getVectorElementType(VT)),
- SplatBits, SplatUndef, SplatSize))
- return SDOperand(); // Not a constant vector, not a splat.
-
- switch (VT) {
- default:
- case MVT::v4f32: {
- uint32_t Value32 = SplatBits;
- assert(SplatSize == 4
- && "LowerBUILD_VECTOR: Unexpected floating point vector element.");
- // NOTE: pretend the constant is an integer. LLVM won't load FP constants
- SDOperand T = DAG.getConstant(Value32, MVT::i32);
- return DAG.getNode(ISD::BIT_CONVERT, MVT::v4f32,
- DAG.getNode(ISD::BUILD_VECTOR, MVT::v4i32, T, T, T, T));
- break;
- }
- case MVT::v2f64: {
- uint64_t f64val = SplatBits;
- assert(SplatSize == 8
- && "LowerBUILD_VECTOR: 64-bit float vector element: unexpected size.");
- // NOTE: pretend the constant is an integer. LLVM won't load FP constants
- SDOperand T = DAG.getConstant(f64val, MVT::i64);
- return DAG.getNode(ISD::BIT_CONVERT, MVT::v2f64,
- DAG.getNode(ISD::BUILD_VECTOR, MVT::v2i64, T, T));
- break;
- }
- case MVT::v16i8: {
- // 8-bit constants have to be expanded to 16-bits
- unsigned short Value16 = SplatBits | (SplatBits << 8);
- SDOperand Ops[8];
- for (int i = 0; i < 8; ++i)
- Ops[i] = DAG.getConstant(Value16, MVT::i16);
- return DAG.getNode(ISD::BIT_CONVERT, VT,
- DAG.getNode(ISD::BUILD_VECTOR, MVT::v8i16, Ops, 8));
- }
- case MVT::v8i16: {
- unsigned short Value16;
- if (SplatSize == 2)
- Value16 = (unsigned short) (SplatBits & 0xffff);
- else
- Value16 = (unsigned short) (SplatBits | (SplatBits << 8));
- SDOperand T = DAG.getConstant(Value16, MVT::getVectorElementType(VT));
- SDOperand Ops[8];
- for (int i = 0; i < 8; ++i) Ops[i] = T;
- return DAG.getNode(ISD::BUILD_VECTOR, VT, Ops, 8);
- }
- case MVT::v4i32: {
- unsigned int Value = SplatBits;
- SDOperand T = DAG.getConstant(Value, MVT::getVectorElementType(VT));
- return DAG.getNode(ISD::BUILD_VECTOR, VT, T, T, T, T);
- }
- case MVT::v2i64: {
- uint64_t val = SplatBits;
- uint32_t upper = uint32_t(val >> 32);
- uint32_t lower = uint32_t(val);
-
- if (upper == lower) {
- // Magic constant that can be matched by IL, ILA, et. al.
- SDOperand Val = DAG.getTargetConstant(val, MVT::i64);
- return DAG.getNode(ISD::BUILD_VECTOR, VT, Val, Val);
- } else {
- SDOperand LO32;
- SDOperand HI32;
- SmallVector<SDOperand, 16> ShufBytes;
- SDOperand Result;
- bool upper_special, lower_special;
-
- // NOTE: This code creates common-case shuffle masks that can be easily
- // detected as common expressions. It is not attempting to create highly
- // specialized masks to replace any and all 0's, 0xff's and 0x80's.
-
- // Detect if the upper or lower half is a special shuffle mask pattern:
- upper_special = (upper == 0 || upper == 0xffffffff || upper == 0x80000000);
- lower_special = (lower == 0 || lower == 0xffffffff || lower == 0x80000000);
-
- // Create lower vector if not a special pattern
- if (!lower_special) {
- SDOperand LO32C = DAG.getConstant(lower, MVT::i32);
- LO32 = DAG.getNode(ISD::BIT_CONVERT, VT,
- DAG.getNode(ISD::BUILD_VECTOR, MVT::v4i32,
- LO32C, LO32C, LO32C, LO32C));
- }
-
- // Create upper vector if not a special pattern
- if (!upper_special) {
- SDOperand HI32C = DAG.getConstant(upper, MVT::i32);
- HI32 = DAG.getNode(ISD::BIT_CONVERT, VT,
- DAG.getNode(ISD::BUILD_VECTOR, MVT::v4i32,
- HI32C, HI32C, HI32C, HI32C));
- }
-
- // If either upper or lower are special, then the two input operands are
- // the same (basically, one of them is a "don't care")
- if (lower_special)
- LO32 = HI32;
- if (upper_special)
- HI32 = LO32;
- if (lower_special && upper_special) {
- // Unhappy situation... both upper and lower are special, so punt with
- // a target constant:
- SDOperand Zero = DAG.getConstant(0, MVT::i32);
- HI32 = LO32 = DAG.getNode(ISD::BUILD_VECTOR, MVT::v4i32, Zero, Zero,
- Zero, Zero);
- }
-
- for (int i = 0; i < 4; ++i) {
- for (int j = 0; j < 4; ++j) {
- SDOperand V;
- bool process_upper, process_lower;
- uint64_t val = 0;
-
- process_upper = (upper_special && (i & 1) == 0);
- process_lower = (lower_special && (i & 1) == 1);
-
- if (process_upper || process_lower) {
- if ((process_upper && upper == 0)
- || (process_lower && lower == 0))
- val = 0x80;
- else if ((process_upper && upper == 0xffffffff)
- || (process_lower && lower == 0xffffffff))
- val = 0xc0;
- else if ((process_upper && upper == 0x80000000)
- || (process_lower && lower == 0x80000000))
- val = (j == 0 ? 0xe0 : 0x80);
- } else
- val = i * 4 + j + ((i & 1) * 16);
-
- ShufBytes.push_back(DAG.getConstant(val, MVT::i8));
- }
- }
-
- return DAG.getNode(SPUISD::SHUFB, VT, HI32, LO32,
- DAG.getNode(ISD::BUILD_VECTOR, MVT::v16i8,
- &ShufBytes[0], ShufBytes.size()));
- }
- }
- }
-
- return SDOperand();
-}
-
-/// LowerVECTOR_SHUFFLE - Lower a vector shuffle (V1, V2, V3) to something on
-/// which the Cell can operate. The code inspects V3 to ascertain whether the
-/// permutation vector, V3, is monotonically increasing with one "exception"
-/// element, e.g., (0, 1, _, 3). If this is the case, then generate a
-/// INSERT_MASK synthetic instruction. Otherwise, spill V3 to the constant pool.
-/// In either case, the net result is going to eventually invoke SHUFB to
-/// permute/shuffle the bytes from V1 and V2.
-/// \note
-/// INSERT_MASK is eventually selected as one of the C*D instructions, generate
-/// control word for byte/halfword/word insertion. This takes care of a single
-/// element move from V2 into V1.
-/// \note
-/// SPUISD::SHUFB is eventually selected as Cell's <i>shufb</i> instructions.
-static SDOperand LowerVECTOR_SHUFFLE(SDOperand Op, SelectionDAG &DAG) {
- SDOperand V1 = Op.getOperand(0);
- SDOperand V2 = Op.getOperand(1);
- SDOperand PermMask = Op.getOperand(2);
-
- if (V2.getOpcode() == ISD::UNDEF) V2 = V1;
-
- // If we have a single element being moved from V1 to V2, this can be handled
- // using the C*[DX] compute mask instructions, but the vector elements have
- // to be monotonically increasing with one exception element.
- MVT::ValueType EltVT = MVT::getVectorElementType(V1.getValueType());
- unsigned EltsFromV2 = 0;
- unsigned V2Elt = 0;
- unsigned V2EltIdx0 = 0;
- unsigned CurrElt = 0;
- bool monotonic = true;
- if (EltVT == MVT::i8)
- V2EltIdx0 = 16;
- else if (EltVT == MVT::i16)
- V2EltIdx0 = 8;
- else if (EltVT == MVT::i32)
- V2EltIdx0 = 4;
- else
- assert(0 && "Unhandled vector type in LowerVECTOR_SHUFFLE");
-
- for (unsigned i = 0, e = PermMask.getNumOperands();
- EltsFromV2 <= 1 && monotonic && i != e;
- ++i) {
- unsigned SrcElt;
- if (PermMask.getOperand(i).getOpcode() == ISD::UNDEF)
- SrcElt = 0;
- else
- SrcElt = cast<ConstantSDNode>(PermMask.getOperand(i))->getValue();
-
- if (SrcElt >= V2EltIdx0) {
- ++EltsFromV2;
- V2Elt = (V2EltIdx0 - SrcElt) << 2;
- } else if (CurrElt != SrcElt) {
- monotonic = false;
- }
-
- ++CurrElt;
- }
-
- if (EltsFromV2 == 1 && monotonic) {
- // Compute mask and shuffle
- MachineFunction &MF = DAG.getMachineFunction();
- MachineRegisterInfo &RegInfo = MF.getRegInfo();
- unsigned VReg = RegInfo.createVirtualRegister(&SPU::R32CRegClass);
- MVT::ValueType PtrVT = DAG.getTargetLoweringInfo().getPointerTy();
- // Initialize temporary register to 0
- SDOperand InitTempReg =
- DAG.getCopyToReg(DAG.getEntryNode(), VReg, DAG.getConstant(0, PtrVT));
- // Copy register's contents as index in INSERT_MASK:
- SDOperand ShufMaskOp =
- DAG.getNode(SPUISD::INSERT_MASK, V1.getValueType(),
- DAG.getTargetConstant(V2Elt, MVT::i32),
- DAG.getCopyFromReg(InitTempReg, VReg, PtrVT));
- // Use shuffle mask in SHUFB synthetic instruction:
- return DAG.getNode(SPUISD::SHUFB, V1.getValueType(), V2, V1, ShufMaskOp);
- } else {
- // Convert the SHUFFLE_VECTOR mask's input element units to the actual bytes.
- unsigned BytesPerElement = MVT::getSizeInBits(EltVT)/8;
-
- SmallVector<SDOperand, 16> ResultMask;
- for (unsigned i = 0, e = PermMask.getNumOperands(); i != e; ++i) {
- unsigned SrcElt;
- if (PermMask.getOperand(i).getOpcode() == ISD::UNDEF)
- SrcElt = 0;
- else
- SrcElt = cast<ConstantSDNode>(PermMask.getOperand(i))->getValue();
-
- for (unsigned j = 0; j < BytesPerElement; ++j) {
- ResultMask.push_back(DAG.getConstant(SrcElt*BytesPerElement+j,
- MVT::i8));
- }
- }
-
- SDOperand VPermMask = DAG.getNode(ISD::BUILD_VECTOR, MVT::v16i8,
- &ResultMask[0], ResultMask.size());
- return DAG.getNode(SPUISD::SHUFB, V1.getValueType(), V1, V2, VPermMask);
- }
-}
-
-static SDOperand LowerSCALAR_TO_VECTOR(SDOperand Op, SelectionDAG &DAG) {
- SDOperand Op0 = Op.getOperand(0); // Op0 = the scalar
-
- if (Op0.Val->getOpcode() == ISD::Constant) {
- // For a constant, build the appropriate constant vector, which will
- // eventually simplify to a vector register load.
-
- ConstantSDNode *CN = cast<ConstantSDNode>(Op0.Val);
- SmallVector<SDOperand, 16> ConstVecValues;
- MVT::ValueType VT;
- size_t n_copies;
-
- // Create a constant vector:
- switch (Op.getValueType()) {
- default: assert(0 && "Unexpected constant value type in "
- "LowerSCALAR_TO_VECTOR");
- case MVT::v16i8: n_copies = 16; VT = MVT::i8; break;
- case MVT::v8i16: n_copies = 8; VT = MVT::i16; break;
- case MVT::v4i32: n_copies = 4; VT = MVT::i32; break;
- case MVT::v4f32: n_copies = 4; VT = MVT::f32; break;
- case MVT::v2i64: n_copies = 2; VT = MVT::i64; break;
- case MVT::v2f64: n_copies = 2; VT = MVT::f64; break;
- }
-
- SDOperand CValue = DAG.getConstant(CN->getValue(), VT);
- for (size_t j = 0; j < n_copies; ++j)
- ConstVecValues.push_back(CValue);
-
- return DAG.getNode(ISD::BUILD_VECTOR, Op.getValueType(),
- &ConstVecValues[0], ConstVecValues.size());
- } else {
- // Otherwise, copy the value from one register to another:
- switch (Op0.getValueType()) {
- default: assert(0 && "Unexpected value type in LowerSCALAR_TO_VECTOR");
- case MVT::i8:
- case MVT::i16:
- case MVT::i32:
- case MVT::i64:
- case MVT::f32:
- case MVT::f64:
- return DAG.getNode(SPUISD::PROMOTE_SCALAR, Op.getValueType(), Op0, Op0);
- }
- }
-
- return SDOperand();
-}
-
-static SDOperand LowerVectorMUL(SDOperand Op, SelectionDAG &DAG) {
- switch (Op.getValueType()) {
- case MVT::v4i32: {
- SDOperand rA = Op.getOperand(0);
- SDOperand rB = Op.getOperand(1);
- SDOperand HiProd1 = DAG.getNode(SPUISD::MPYH, MVT::v4i32, rA, rB);
- SDOperand HiProd2 = DAG.getNode(SPUISD::MPYH, MVT::v4i32, rB, rA);
- SDOperand LoProd = DAG.getNode(SPUISD::MPYU, MVT::v4i32, rA, rB);
- SDOperand Residual1 = DAG.getNode(ISD::ADD, MVT::v4i32, LoProd, HiProd1);
-
- return DAG.getNode(ISD::ADD, MVT::v4i32, Residual1, HiProd2);
- break;
- }
-
- // Multiply two v8i16 vectors (pipeline friendly version):
- // a) multiply lower halves, mask off upper 16-bit of 32-bit product
- // b) multiply upper halves, rotate left by 16 bits (inserts 16 lower zeroes)
- // c) Use SELB to select upper and lower halves from the intermediate results
- //
- // NOTE: We really want to move the FSMBI to earlier to actually get the
- // dual-issue. This code does manage to do this, even if it's a little on
- // the wacky side
- case MVT::v8i16: {
- MachineFunction &MF = DAG.getMachineFunction();
- MachineRegisterInfo &RegInfo = MF.getRegInfo();
- SDOperand Chain = Op.getOperand(0);
- SDOperand rA = Op.getOperand(0);
- SDOperand rB = Op.getOperand(1);
- unsigned FSMBIreg = RegInfo.createVirtualRegister(&SPU::VECREGRegClass);
- unsigned HiProdReg = RegInfo.createVirtualRegister(&SPU::VECREGRegClass);
-
- SDOperand FSMBOp =
- DAG.getCopyToReg(Chain, FSMBIreg,
- DAG.getNode(SPUISD::FSMBI, MVT::v8i16,
- DAG.getConstant(0xcccc, MVT::i16)));
-
- SDOperand HHProd =
- DAG.getCopyToReg(FSMBOp, HiProdReg,
- DAG.getNode(SPUISD::MPYHH, MVT::v8i16, rA, rB));
-
- SDOperand HHProd_v4i32 =
- DAG.getNode(ISD::BIT_CONVERT, MVT::v4i32,
- DAG.getCopyFromReg(HHProd, HiProdReg, MVT::v4i32));
-
- return DAG.getNode(SPUISD::SELB, MVT::v8i16,
- DAG.getNode(SPUISD::MPY, MVT::v8i16, rA, rB),
- DAG.getNode(ISD::BIT_CONVERT, Op.getValueType(),
- DAG.getNode(SPUISD::VEC_SHL, MVT::v4i32,
- HHProd_v4i32,
- DAG.getConstant(16, MVT::i16))),
- DAG.getCopyFromReg(FSMBOp, FSMBIreg, MVT::v4i32));
- }
-
- // This M00sE is N@stI! (apologies to Monty Python)
- //
- // SPU doesn't know how to do any 8-bit multiplication, so the solution
- // is to break it all apart, sign extend, and reassemble the various
- // intermediate products.
- case MVT::v16i8: {
- SDOperand rA = Op.getOperand(0);
- SDOperand rB = Op.getOperand(1);
- SDOperand c8 = DAG.getConstant(8, MVT::i32);
- SDOperand c16 = DAG.getConstant(16, MVT::i32);
-
- SDOperand LLProd =
- DAG.getNode(SPUISD::MPY, MVT::v8i16,
- DAG.getNode(ISD::BIT_CONVERT, MVT::v8i16, rA),
- DAG.getNode(ISD::BIT_CONVERT, MVT::v8i16, rB));
-
- SDOperand rALH = DAG.getNode(SPUISD::VEC_SRA, MVT::v8i16, rA, c8);
-
- SDOperand rBLH = DAG.getNode(SPUISD::VEC_SRA, MVT::v8i16, rB, c8);
-
- SDOperand LHProd =
- DAG.getNode(SPUISD::VEC_SHL, MVT::v8i16,
- DAG.getNode(SPUISD::MPY, MVT::v8i16, rALH, rBLH), c8);
-
- SDOperand FSMBmask = DAG.getNode(SPUISD::FSMBI, MVT::v8i16,
- DAG.getConstant(0x2222, MVT::i16));
-
- SDOperand LoProdParts =
- DAG.getNode(ISD::BIT_CONVERT, MVT::v4i32,
- DAG.getNode(SPUISD::SELB, MVT::v8i16,
- LLProd, LHProd, FSMBmask));
-
- SDOperand LoProdMask = DAG.getConstant(0xffff, MVT::i32);
-
- SDOperand LoProd =
- DAG.getNode(ISD::AND, MVT::v4i32,
- LoProdParts,
- DAG.getNode(ISD::BUILD_VECTOR, MVT::v4i32,
- LoProdMask, LoProdMask,
- LoProdMask, LoProdMask));
-
- SDOperand rAH =
- DAG.getNode(SPUISD::VEC_SRA, MVT::v4i32,
- DAG.getNode(ISD::BIT_CONVERT, MVT::v4i32, rA), c16);
-
- SDOperand rBH =
- DAG.getNode(SPUISD::VEC_SRA, MVT::v4i32,
- DAG.getNode(ISD::BIT_CONVERT, MVT::v4i32, rB), c16);
-
- SDOperand HLProd =
- DAG.getNode(SPUISD::MPY, MVT::v8i16,
- DAG.getNode(ISD::BIT_CONVERT, MVT::v8i16, rAH),
- DAG.getNode(ISD::BIT_CONVERT, MVT::v8i16, rBH));
-
- SDOperand HHProd_1 =
- DAG.getNode(SPUISD::MPY, MVT::v8i16,
- DAG.getNode(ISD::BIT_CONVERT, MVT::v8i16,
- DAG.getNode(SPUISD::VEC_SRA, MVT::v4i32, rAH, c8)),
- DAG.getNode(ISD::BIT_CONVERT, MVT::v8i16,
- DAG.getNode(SPUISD::VEC_SRA, MVT::v4i32, rBH, c8)));
-
- SDOperand HHProd =
- DAG.getNode(SPUISD::SELB, MVT::v8i16,
- HLProd,
- DAG.getNode(SPUISD::VEC_SHL, MVT::v8i16, HHProd_1, c8),
- FSMBmask);
-
- SDOperand HiProd =
- DAG.getNode(SPUISD::VEC_SHL, MVT::v4i32, HHProd, c16);
-
- return DAG.getNode(ISD::BIT_CONVERT, MVT::v16i8,
- DAG.getNode(ISD::OR, MVT::v4i32,
- LoProd, HiProd));
- }
-
- default:
- cerr << "CellSPU: Unknown vector multiplication, got "
- << MVT::getValueTypeString(Op.getValueType())
- << "\n";
- abort();
- /*NOTREACHED*/
- }
-
- return SDOperand();
-}
-
-static SDOperand LowerFDIVf32(SDOperand Op, SelectionDAG &DAG) {
- MachineFunction &MF = DAG.getMachineFunction();
- MachineRegisterInfo &RegInfo = MF.getRegInfo();
-
- SDOperand A = Op.getOperand(0);
- SDOperand B = Op.getOperand(1);
- unsigned VT = Op.getValueType();
-
- unsigned VRegBR, VRegC;
-
- if (VT == MVT::f32) {
- VRegBR = RegInfo.createVirtualRegister(&SPU::R32FPRegClass);
- VRegC = RegInfo.createVirtualRegister(&SPU::R32FPRegClass);
- } else {
- VRegBR = RegInfo.createVirtualRegister(&SPU::VECREGRegClass);
- VRegC = RegInfo.createVirtualRegister(&SPU::VECREGRegClass);
- }
- // TODO: make sure we're feeding FPInterp the right arguments
- // Right now: fi B, frest(B)
-
- // Computes BRcpl =
- // (Floating Interpolate (FP Reciprocal Estimate B))
- SDOperand BRcpl =
- DAG.getCopyToReg(DAG.getEntryNode(), VRegBR,
- DAG.getNode(SPUISD::FPInterp, VT, B,
- DAG.getNode(SPUISD::FPRecipEst, VT, B)));
-
- // Computes A * BRcpl and stores in a temporary register
- SDOperand AxBRcpl =
- DAG.getCopyToReg(BRcpl, VRegC,
- DAG.getNode(ISD::FMUL, VT, A,
- DAG.getCopyFromReg(BRcpl, VRegBR, VT)));
- // What's the Chain variable do? It's magic!
- // TODO: set Chain = Op(0).getEntryNode()
-
- return DAG.getNode(ISD::FADD, VT,
- DAG.getCopyFromReg(AxBRcpl, VRegC, VT),
- DAG.getNode(ISD::FMUL, VT,
- DAG.getCopyFromReg(AxBRcpl, VRegBR, VT),
- DAG.getNode(ISD::FSUB, VT, A,
- DAG.getNode(ISD::FMUL, VT, B,
- DAG.getCopyFromReg(AxBRcpl, VRegC, VT)))));
-}
-
-static SDOperand LowerEXTRACT_VECTOR_ELT(SDOperand Op, SelectionDAG &DAG) {
- unsigned VT = Op.getValueType();
- SDOperand N = Op.getOperand(0);
- SDOperand Elt = Op.getOperand(1);
- SDOperand ShufMask[16];
- ConstantSDNode *C = dyn_cast<ConstantSDNode>(Elt);
-
- assert(C != 0 && "LowerEXTRACT_VECTOR_ELT expecting constant SDNode");
-
- int EltNo = (int) C->getValue();
-
- // sanity checks:
- if (VT == MVT::i8 && EltNo >= 16)
- assert(0 && "SPU LowerEXTRACT_VECTOR_ELT: i8 extraction slot > 15");
- else if (VT == MVT::i16 && EltNo >= 8)
- assert(0 && "SPU LowerEXTRACT_VECTOR_ELT: i16 extraction slot > 7");
- else if (VT == MVT::i32 && EltNo >= 4)
- assert(0 && "SPU LowerEXTRACT_VECTOR_ELT: i32 extraction slot > 4");
- else if (VT == MVT::i64 && EltNo >= 2)
- assert(0 && "SPU LowerEXTRACT_VECTOR_ELT: i64 extraction slot > 2");
-
- if (EltNo == 0 && (VT == MVT::i32 || VT == MVT::i64)) {
- // i32 and i64: Element 0 is the preferred slot
- return DAG.getNode(SPUISD::EXTRACT_ELT0, VT, N);
- }
-
- // Need to generate shuffle mask and extract:
- int prefslot_begin = -1, prefslot_end = -1;
- int elt_byte = EltNo * MVT::getSizeInBits(VT) / 8;
-
- switch (VT) {
- case MVT::i8: {
- prefslot_begin = prefslot_end = 3;
- break;
- }
- case MVT::i16: {
- prefslot_begin = 2; prefslot_end = 3;
- break;
- }
- case MVT::i32: {
- prefslot_begin = 0; prefslot_end = 3;
- break;
- }
- case MVT::i64: {
- prefslot_begin = 0; prefslot_end = 7;
- break;
- }
- }
-
- assert(prefslot_begin != -1 && prefslot_end != -1 &&
- "LowerEXTRACT_VECTOR_ELT: preferred slots uninitialized");
-
- for (int i = 0; i < 16; ++i) {
- // zero fill uppper part of preferred slot, don't care about the
- // other slots:
- unsigned int mask_val;
-
- if (i <= prefslot_end) {
- mask_val =
- ((i < prefslot_begin)
- ? 0x80
- : elt_byte + (i - prefslot_begin));
-
- ShufMask[i] = DAG.getConstant(mask_val, MVT::i8);
- } else
- ShufMask[i] = ShufMask[i % (prefslot_end + 1)];
- }
-
- SDOperand ShufMaskVec =
- DAG.getNode(ISD::BUILD_VECTOR, MVT::v16i8,
- &ShufMask[0],
- sizeof(ShufMask) / sizeof(ShufMask[0]));
-
- return DAG.getNode(SPUISD::EXTRACT_ELT0, VT,
- DAG.getNode(SPUISD::SHUFB, N.getValueType(),
- N, N, ShufMaskVec));
-
-}
-
-static SDOperand LowerINSERT_VECTOR_ELT(SDOperand Op, SelectionDAG &DAG) {
- SDOperand VecOp = Op.getOperand(0);
- SDOperand ValOp = Op.getOperand(1);
- SDOperand IdxOp = Op.getOperand(2);
- MVT::ValueType VT = Op.getValueType();
-
- ConstantSDNode *CN = cast<ConstantSDNode>(IdxOp);
- assert(CN != 0 && "LowerINSERT_VECTOR_ELT: Index is not constant!");
-
- MVT::ValueType PtrVT = DAG.getTargetLoweringInfo().getPointerTy();
- // Use $2 because it's always 16-byte aligned and it's available:
- SDOperand PtrBase = DAG.getRegister(SPU::R2, PtrVT);
-
- SDOperand result =
- DAG.getNode(SPUISD::SHUFB, VT,
- DAG.getNode(ISD::SCALAR_TO_VECTOR, VT, ValOp),
- VecOp,
- DAG.getNode(SPUISD::INSERT_MASK, VT,
- DAG.getNode(ISD::ADD, PtrVT,
- PtrBase,
- DAG.getConstant(CN->getValue(),
- PtrVT))));
-
- return result;
-}
-
-static SDOperand LowerI8Math(SDOperand Op, SelectionDAG &DAG, unsigned Opc)
-{
- SDOperand N0 = Op.getOperand(0); // Everything has at least one operand
-
- assert(Op.getValueType() == MVT::i8);
- switch (Opc) {
- default:
- assert(0 && "Unhandled i8 math operator");
- /*NOTREACHED*/
- break;
- case ISD::SUB: {
- // 8-bit subtraction: Promote the arguments up to 16-bits and truncate
- // the result:
- SDOperand N1 = Op.getOperand(1);
- N0 = (N0.getOpcode() != ISD::Constant
- ? DAG.getNode(ISD::SIGN_EXTEND, MVT::i16, N0)
- : DAG.getConstant(cast<ConstantSDNode>(N0)->getValue(), MVT::i16));
- N1 = (N1.getOpcode() != ISD::Constant
- ? DAG.getNode(ISD::SIGN_EXTEND, MVT::i16, N1)
- : DAG.getConstant(cast<ConstantSDNode>(N1)->getValue(), MVT::i16));
- return DAG.getNode(ISD::TRUNCATE, MVT::i8,
- DAG.getNode(Opc, MVT::i16, N0, N1));
- }
- case ISD::ROTR:
- case ISD::ROTL: {
- SDOperand N1 = Op.getOperand(1);
- unsigned N1Opc;
- N0 = (N0.getOpcode() != ISD::Constant
- ? DAG.getNode(ISD::ZERO_EXTEND, MVT::i16, N0)
- : DAG.getConstant(cast<ConstantSDNode>(N0)->getValue(), MVT::i16));
- N1Opc = (N1.getValueType() < MVT::i16 ? ISD::ZERO_EXTEND : ISD::TRUNCATE);
- N1 = (N1.getOpcode() != ISD::Constant
- ? DAG.getNode(N1Opc, MVT::i16, N1)
- : DAG.getConstant(cast<ConstantSDNode>(N1)->getValue(), MVT::i16));
- SDOperand ExpandArg =
- DAG.getNode(ISD::OR, MVT::i16, N0,
- DAG.getNode(ISD::SHL, MVT::i16,
- N0, DAG.getConstant(8, MVT::i16)));
- return DAG.getNode(ISD::TRUNCATE, MVT::i8,
- DAG.getNode(Opc, MVT::i16, ExpandArg, N1));
- }
- case ISD::SRL:
- case ISD::SHL: {
- SDOperand N1 = Op.getOperand(1);
- unsigned N1Opc;
- N0 = (N0.getOpcode() != ISD::Constant
- ? DAG.getNode(ISD::ZERO_EXTEND, MVT::i16, N0)
- : DAG.getConstant(cast<ConstantSDNode>(N0)->getValue(), MVT::i16));
- N1Opc = (N1.getValueType() < MVT::i16 ? ISD::ZERO_EXTEND : ISD::TRUNCATE);
- N1 = (N1.getOpcode() != ISD::Constant
- ? DAG.getNode(N1Opc, MVT::i16, N1)
- : DAG.getConstant(cast<ConstantSDNode>(N1)->getValue(), MVT::i16));
- return DAG.getNode(ISD::TRUNCATE, MVT::i8,
- DAG.getNode(Opc, MVT::i16, N0, N1));
- }
- case ISD::SRA: {
- SDOperand N1 = Op.getOperand(1);
- unsigned N1Opc;
- N0 = (N0.getOpcode() != ISD::Constant
- ? DAG.getNode(ISD::SIGN_EXTEND, MVT::i16, N0)
- : DAG.getConstant(cast<ConstantSDNode>(N0)->getValue(), MVT::i16));
- N1Opc = (N1.getValueType() < MVT::i16 ? ISD::SIGN_EXTEND : ISD::TRUNCATE);
- N1 = (N1.getOpcode() != ISD::Constant
- ? DAG.getNode(N1Opc, MVT::i16, N1)
- : DAG.getConstant(cast<ConstantSDNode>(N1)->getValue(), MVT::i16));
- return DAG.getNode(ISD::TRUNCATE, MVT::i8,
- DAG.getNode(Opc, MVT::i16, N0, N1));
- }
- case ISD::MUL: {
- SDOperand N1 = Op.getOperand(1);
- unsigned N1Opc;
- N0 = (N0.getOpcode() != ISD::Constant
- ? DAG.getNode(ISD::SIGN_EXTEND, MVT::i16, N0)
- : DAG.getConstant(cast<ConstantSDNode>(N0)->getValue(), MVT::i16));
- N1Opc = (N1.getValueType() < MVT::i16 ? ISD::SIGN_EXTEND : ISD::TRUNCATE);
- N1 = (N1.getOpcode() != ISD::Constant
- ? DAG.getNode(N1Opc, MVT::i16, N1)
- : DAG.getConstant(cast<ConstantSDNode>(N1)->getValue(), MVT::i16));
- return DAG.getNode(ISD::TRUNCATE, MVT::i8,
- DAG.getNode(Opc, MVT::i16, N0, N1));
- break;
- }
- }
-
- return SDOperand();
-}
-
-static SDOperand LowerI64Math(SDOperand Op, SelectionDAG &DAG, unsigned Opc)
-{
- MVT::ValueType VT = Op.getValueType();
- unsigned VecVT =
- MVT::getVectorType(VT, (128 / MVT::getSizeInBits(VT)));
-
- SDOperand Op0 = Op.getOperand(0);
-
- switch (Opc) {
- case ISD::ZERO_EXTEND:
- case ISD::SIGN_EXTEND:
- case ISD::ANY_EXTEND: {
- MVT::ValueType Op0VT = Op0.getValueType();
- unsigned Op0VecVT =
- MVT::getVectorType(Op0VT, (128 / MVT::getSizeInBits(Op0VT)));
-
- assert(Op0VT == MVT::i32
- && "CellSPU: Zero/sign extending something other than i32");
- DEBUG(cerr << "CellSPU: LowerI64Math custom lowering zero/sign/any extend\n");
-
- unsigned NewOpc = (Opc == ISD::SIGN_EXTEND
- ? SPUISD::ROTBYTES_RIGHT_S
- : SPUISD::ROTQUAD_RZ_BYTES);
- SDOperand PromoteScalar =
- DAG.getNode(SPUISD::PROMOTE_SCALAR, Op0VecVT, Op0);
-
- return DAG.getNode(SPUISD::EXTRACT_ELT0, VT,
- DAG.getNode(ISD::BIT_CONVERT, VecVT,
- DAG.getNode(NewOpc, Op0VecVT,
- PromoteScalar,
- DAG.getConstant(4, MVT::i32))));
- }
-
- case ISD::SHL: {
- SDOperand ShiftAmt = Op.getOperand(1);
- unsigned ShiftAmtVT = unsigned(ShiftAmt.getValueType());
- SDOperand Op0Vec = DAG.getNode(SPUISD::PROMOTE_SCALAR, VecVT, Op0);
- SDOperand MaskLower =
- DAG.getNode(SPUISD::SELB, VecVT,
- Op0Vec,
- DAG.getConstant(0, VecVT),
- DAG.getNode(SPUISD::FSMBI, VecVT,
- DAG.getConstant(0xff00ULL, MVT::i16)));
- SDOperand ShiftAmtBytes =
- DAG.getNode(ISD::SRL, ShiftAmtVT,
- ShiftAmt,
- DAG.getConstant(3, ShiftAmtVT));
- SDOperand ShiftAmtBits =
- DAG.getNode(ISD::AND, ShiftAmtVT,
- ShiftAmt,
- DAG.getConstant(7, ShiftAmtVT));
-
- return DAG.getNode(SPUISD::EXTRACT_ELT0, VT,
- DAG.getNode(SPUISD::SHLQUAD_L_BITS, VecVT,
- DAG.getNode(SPUISD::SHLQUAD_L_BYTES, VecVT,
- MaskLower, ShiftAmtBytes),
- ShiftAmtBits));
- }
-
- case ISD::SRL: {
- unsigned VT = unsigned(Op.getValueType());
- SDOperand ShiftAmt = Op.getOperand(1);
- unsigned ShiftAmtVT = unsigned(ShiftAmt.getValueType());
- SDOperand ShiftAmtBytes =
- DAG.getNode(ISD::SRL, ShiftAmtVT,
- ShiftAmt,
- DAG.getConstant(3, ShiftAmtVT));
- SDOperand ShiftAmtBits =
- DAG.getNode(ISD::AND, ShiftAmtVT,
- ShiftAmt,
- DAG.getConstant(7, ShiftAmtVT));
-
- return DAG.getNode(SPUISD::ROTQUAD_RZ_BITS, VT,
- DAG.getNode(SPUISD::ROTQUAD_RZ_BYTES, VT,
- Op0, ShiftAmtBytes),
- ShiftAmtBits);
- }
- }
-
- return SDOperand();
-}
-
-//! Lower byte immediate operations for v16i8 vectors:
-static SDOperand
-LowerByteImmed(SDOperand Op, SelectionDAG &DAG) {
- SDOperand ConstVec;
- SDOperand Arg;
- MVT::ValueType VT = Op.getValueType();
-
- ConstVec = Op.getOperand(0);
- Arg = Op.getOperand(1);
- if (ConstVec.Val->getOpcode() != ISD::BUILD_VECTOR) {
- if (ConstVec.Val->getOpcode() == ISD::BIT_CONVERT) {
- ConstVec = ConstVec.getOperand(0);
- } else {
- ConstVec = Op.getOperand(1);
- Arg = Op.getOperand(0);
- if (ConstVec.Val->getOpcode() == ISD::BIT_CONVERT) {
- ConstVec = ConstVec.getOperand(0);
- }
- }
- }
-
- if (ConstVec.Val->getOpcode() == ISD::BUILD_VECTOR) {
- uint64_t VectorBits[2];
- uint64_t UndefBits[2];
- uint64_t SplatBits, SplatUndef;
- int SplatSize;
-
- if (!GetConstantBuildVectorBits(ConstVec.Val, VectorBits, UndefBits)
- && isConstantSplat(VectorBits, UndefBits,
- MVT::getSizeInBits(MVT::getVectorElementType(VT)),
- SplatBits, SplatUndef, SplatSize)) {
- SDOperand tcVec[16];
- SDOperand tc = DAG.getTargetConstant(SplatBits & 0xff, MVT::i8);
- const size_t tcVecSize = sizeof(tcVec) / sizeof(tcVec[0]);
-
- // Turn the BUILD_VECTOR into a set of target constants:
- for (size_t i = 0; i < tcVecSize; ++i)
- tcVec[i] = tc;
-
- return DAG.getNode(Op.Val->getOpcode(), VT, Arg,
- DAG.getNode(ISD::BUILD_VECTOR, VT, tcVec, tcVecSize));
- }
- }
-
- return SDOperand();
-}
-
-//! Lower i32 multiplication
-static SDOperand LowerMUL(SDOperand Op, SelectionDAG &DAG, unsigned VT,
- unsigned Opc) {
- switch (VT) {
- default:
- cerr << "CellSPU: Unknown LowerMUL value type, got "
- << MVT::getValueTypeString(Op.getValueType())
- << "\n";
- abort();
- /*NOTREACHED*/
-
- case MVT::i32: {
- SDOperand rA = Op.getOperand(0);
- SDOperand rB = Op.getOperand(1);
-
- return DAG.getNode(ISD::ADD, MVT::i32,
- DAG.getNode(ISD::ADD, MVT::i32,
- DAG.getNode(SPUISD::MPYH, MVT::i32, rA, rB),
- DAG.getNode(SPUISD::MPYH, MVT::i32, rB, rA)),
- DAG.getNode(SPUISD::MPYU, MVT::i32, rA, rB));
- }
- }
-
- return SDOperand();
-}
-
-//! Custom lowering for CTPOP (count population)
-/*!
- Custom lowering code that counts the number ones in the input
- operand. SPU has such an instruction, but it counts the number of
- ones per byte, which then have to be accumulated.
-*/
-static SDOperand LowerCTPOP(SDOperand Op, SelectionDAG &DAG) {
- unsigned VT = Op.getValueType();
- unsigned vecVT = MVT::getVectorType(VT, (128 / MVT::getSizeInBits(VT)));
-
- switch (VT) {
- case MVT::i8: {
- SDOperand N = Op.getOperand(0);
- SDOperand Elt0 = DAG.getConstant(0, MVT::i32);
-
- SDOperand Promote = DAG.getNode(SPUISD::PROMOTE_SCALAR, vecVT, N, N);
- SDOperand CNTB = DAG.getNode(SPUISD::CNTB, vecVT, Promote);
-
- return DAG.getNode(ISD::EXTRACT_VECTOR_ELT, MVT::i8, CNTB, Elt0);
- }
-
- case MVT::i16: {
- MachineFunction &MF = DAG.getMachineFunction();
- MachineRegisterInfo &RegInfo = MF.getRegInfo();
-
- unsigned CNTB_reg = RegInfo.createVirtualRegister(&SPU::R16CRegClass);
-
- SDOperand N = Op.getOperand(0);
- SDOperand Elt0 = DAG.getConstant(0, MVT::i16);
- SDOperand Mask0 = DAG.getConstant(0x0f, MVT::i16);
- SDOperand Shift1 = DAG.getConstant(8, MVT::i16);
-
- SDOperand Promote = DAG.getNode(SPUISD::PROMOTE_SCALAR, vecVT, N, N);
- SDOperand CNTB = DAG.getNode(SPUISD::CNTB, vecVT, Promote);
-
- // CNTB_result becomes the chain to which all of the virtual registers
- // CNTB_reg, SUM1_reg become associated:
- SDOperand CNTB_result =
- DAG.getNode(ISD::EXTRACT_VECTOR_ELT, MVT::i16, CNTB, Elt0);
-
- SDOperand CNTB_rescopy =
- DAG.getCopyToReg(CNTB_result, CNTB_reg, CNTB_result);
-
- SDOperand Tmp1 = DAG.getCopyFromReg(CNTB_rescopy, CNTB_reg, MVT::i16);
-
- return DAG.getNode(ISD::AND, MVT::i16,
- DAG.getNode(ISD::ADD, MVT::i16,
- DAG.getNode(ISD::SRL, MVT::i16,
- Tmp1, Shift1),
- Tmp1),
- Mask0);
- }
-
- case MVT::i32: {
- MachineFunction &MF = DAG.getMachineFunction();
- MachineRegisterInfo &RegInfo = MF.getRegInfo();
-
- unsigned CNTB_reg = RegInfo.createVirtualRegister(&SPU::R32CRegClass);
- unsigned SUM1_reg = RegInfo.createVirtualRegister(&SPU::R32CRegClass);
-
- SDOperand N = Op.getOperand(0);
- SDOperand Elt0 = DAG.getConstant(0, MVT::i32);
- SDOperand Mask0 = DAG.getConstant(0xff, MVT::i32);
- SDOperand Shift1 = DAG.getConstant(16, MVT::i32);
- SDOperand Shift2 = DAG.getConstant(8, MVT::i32);
-
- SDOperand Promote = DAG.getNode(SPUISD::PROMOTE_SCALAR, vecVT, N, N);
- SDOperand CNTB = DAG.getNode(SPUISD::CNTB, vecVT, Promote);
-
- // CNTB_result becomes the chain to which all of the virtual registers
- // CNTB_reg, SUM1_reg become associated:
- SDOperand CNTB_result =
- DAG.getNode(ISD::EXTRACT_VECTOR_ELT, MVT::i32, CNTB, Elt0);
-
- SDOperand CNTB_rescopy =
- DAG.getCopyToReg(CNTB_result, CNTB_reg, CNTB_result);
-
- SDOperand Comp1 =
- DAG.getNode(ISD::SRL, MVT::i32,
- DAG.getCopyFromReg(CNTB_rescopy, CNTB_reg, MVT::i32), Shift1);
-
- SDOperand Sum1 =
- DAG.getNode(ISD::ADD, MVT::i32,
- Comp1, DAG.getCopyFromReg(CNTB_rescopy, CNTB_reg, MVT::i32));
-
- SDOperand Sum1_rescopy =
- DAG.getCopyToReg(CNTB_result, SUM1_reg, Sum1);
-
- SDOperand Comp2 =
- DAG.getNode(ISD::SRL, MVT::i32,
- DAG.getCopyFromReg(Sum1_rescopy, SUM1_reg, MVT::i32),
- Shift2);
- SDOperand Sum2 =
- DAG.getNode(ISD::ADD, MVT::i32, Comp2,
- DAG.getCopyFromReg(Sum1_rescopy, SUM1_reg, MVT::i32));
-
- return DAG.getNode(ISD::AND, MVT::i32, Sum2, Mask0);
- }
-
- case MVT::i64:
- break;
- }
-
- return SDOperand();
-}
-
-/// LowerOperation - Provide custom lowering hooks for some operations.
-///
-SDOperand
-SPUTargetLowering::LowerOperation(SDOperand Op, SelectionDAG &DAG)
-{
- unsigned Opc = (unsigned) Op.getOpcode();
- unsigned VT = (unsigned) Op.getValueType();
-
- switch (Opc) {
- default: {
- cerr << "SPUTargetLowering::LowerOperation(): need to lower this!\n";
- cerr << "Op.getOpcode() = " << Opc << "\n";
- cerr << "*Op.Val:\n";
- Op.Val->dump();
- abort();
- }
- case ISD::LOAD:
- case ISD::SEXTLOAD:
- case ISD::ZEXTLOAD:
- return LowerLOAD(Op, DAG, SPUTM.getSubtargetImpl());
- case ISD::STORE:
- return LowerSTORE(Op, DAG, SPUTM.getSubtargetImpl());
- case ISD::ConstantPool:
- return LowerConstantPool(Op, DAG, SPUTM.getSubtargetImpl());
- case ISD::GlobalAddress:
- return LowerGlobalAddress(Op, DAG, SPUTM.getSubtargetImpl());
- case ISD::JumpTable:
- return LowerJumpTable(Op, DAG, SPUTM.getSubtargetImpl());
- case ISD::Constant:
- return LowerConstant(Op, DAG);
- case ISD::ConstantFP:
- return LowerConstantFP(Op, DAG);
- case ISD::BRCOND:
- return LowerBRCOND(Op, DAG);
- case ISD::FORMAL_ARGUMENTS:
- return LowerFORMAL_ARGUMENTS(Op, DAG, VarArgsFrameIndex);
- case ISD::CALL:
- return LowerCALL(Op, DAG, SPUTM.getSubtargetImpl());
- case ISD::RET:
- return LowerRET(Op, DAG, getTargetMachine());
-
-
- // i8, i64 math ops:
- case ISD::ZERO_EXTEND:
- case ISD::SIGN_EXTEND:
- case ISD::ANY_EXTEND:
- case ISD::SUB:
- case ISD::ROTR:
- case ISD::ROTL:
- case ISD::SRL:
- case ISD::SHL:
- case ISD::SRA:
- if (VT == MVT::i8)
- return LowerI8Math(Op, DAG, Opc);
- else if (VT == MVT::i64)
- return LowerI64Math(Op, DAG, Opc);
- break;
-
- // Vector-related lowering.
- case ISD::BUILD_VECTOR:
- return LowerBUILD_VECTOR(Op, DAG);
- case ISD::SCALAR_TO_VECTOR:
- return LowerSCALAR_TO_VECTOR(Op, DAG);
- case ISD::VECTOR_SHUFFLE:
- return LowerVECTOR_SHUFFLE(Op, DAG);
- case ISD::EXTRACT_VECTOR_ELT:
- return LowerEXTRACT_VECTOR_ELT(Op, DAG);
- case ISD::INSERT_VECTOR_ELT:
- return LowerINSERT_VECTOR_ELT(Op, DAG);
-
- // Look for ANDBI, ORBI and XORBI opportunities and lower appropriately:
- case ISD::AND:
- case ISD::OR:
- case ISD::XOR:
- return LowerByteImmed(Op, DAG);
-
- // Vector and i8 multiply:
- case ISD::MUL:
- if (MVT::isVector(VT))
- return LowerVectorMUL(Op, DAG);
- else if (VT == MVT::i8)
- return LowerI8Math(Op, DAG, Opc);
- else
- return LowerMUL(Op, DAG, VT, Opc);
-
- case ISD::FDIV:
- if (VT == MVT::f32 || VT == MVT::v4f32)
- return LowerFDIVf32(Op, DAG);
-// else if (Op.getValueType() == MVT::f64)
-// return LowerFDIVf64(Op, DAG);
- else
- assert(0 && "Calling FDIV on unsupported MVT");
-
- case ISD::CTPOP:
- return LowerCTPOP(Op, DAG);
- }
-
- return SDOperand();
-}
-
-//===----------------------------------------------------------------------===//
-// Target Optimization Hooks
-//===----------------------------------------------------------------------===//
-
-SDOperand
-SPUTargetLowering::PerformDAGCombine(SDNode *N, DAGCombinerInfo &DCI) const
-{
-#if 0
- TargetMachine &TM = getTargetMachine();
-#endif
- const SPUSubtarget *ST = SPUTM.getSubtargetImpl();
- SelectionDAG &DAG = DCI.DAG;
- SDOperand Op0 = N->getOperand(0); // everything has at least one operand
- SDOperand Result; // Initially, NULL result
-
- switch (N->getOpcode()) {
- default: break;
- case ISD::ADD: {
- SDOperand Op1 = N->getOperand(1);
-
- if ((Op1.getOpcode() == ISD::Constant
- || Op1.getOpcode() == ISD::TargetConstant)
- && Op0.getOpcode() == SPUISD::IndirectAddr) {
- SDOperand Op01 = Op0.getOperand(1);
- if (Op01.getOpcode() == ISD::Constant
- || Op01.getOpcode() == ISD::TargetConstant) {
- // (add <const>, (SPUindirect <arg>, <const>)) ->
- // (SPUindirect <arg>, <const + const>)
- ConstantSDNode *CN0 = cast<ConstantSDNode>(Op1);
- ConstantSDNode *CN1 = cast<ConstantSDNode>(Op01);
- SDOperand combinedConst =
- DAG.getConstant(CN0->getValue() + CN1->getValue(),
- Op0.getValueType());
-
- DEBUG(cerr << "Replace: (add " << CN0->getValue() << ", "
- << "(SPUindirect <arg>, " << CN1->getValue() << "))\n");
- DEBUG(cerr << "With: (SPUindirect <arg>, "
- << CN0->getValue() + CN1->getValue() << ")\n");
- return DAG.getNode(SPUISD::IndirectAddr, Op0.getValueType(),
- Op0.getOperand(0), combinedConst);
- }
- } else if ((Op0.getOpcode() == ISD::Constant
- || Op0.getOpcode() == ISD::TargetConstant)
- && Op1.getOpcode() == SPUISD::IndirectAddr) {
- SDOperand Op11 = Op1.getOperand(1);
- if (Op11.getOpcode() == ISD::Constant
- || Op11.getOpcode() == ISD::TargetConstant) {
- // (add (SPUindirect <arg>, <const>), <const>) ->
- // (SPUindirect <arg>, <const + const>)
- ConstantSDNode *CN0 = cast<ConstantSDNode>(Op0);
- ConstantSDNode *CN1 = cast<ConstantSDNode>(Op11);
- SDOperand combinedConst =
- DAG.getConstant(CN0->getValue() + CN1->getValue(),
- Op0.getValueType());
-
- DEBUG(cerr << "Replace: (add " << CN0->getValue() << ", "
- << "(SPUindirect <arg>, " << CN1->getValue() << "))\n");
- DEBUG(cerr << "With: (SPUindirect <arg>, "
- << CN0->getValue() + CN1->getValue() << ")\n");
-
- return DAG.getNode(SPUISD::IndirectAddr, Op1.getValueType(),
- Op1.getOperand(0), combinedConst);
- }
- }
- break;
- }
- case ISD::SIGN_EXTEND:
- case ISD::ZERO_EXTEND:
- case ISD::ANY_EXTEND: {
- if (Op0.getOpcode() == SPUISD::EXTRACT_ELT0 &&
- N->getValueType(0) == Op0.getValueType()) {
- // (any_extend (SPUextract_elt0 <arg>)) ->
- // (SPUextract_elt0 <arg>)
- // Types must match, however...
- DEBUG(cerr << "Replace: ");
- DEBUG(N->dump(&DAG));
- DEBUG(cerr << "\nWith: ");
- DEBUG(Op0.Val->dump(&DAG));
- DEBUG(cerr << "\n");
-
- return Op0;
- }
- break;
- }
- case SPUISD::IndirectAddr: {
- if (!ST->usingLargeMem() && Op0.getOpcode() == SPUISD::AFormAddr) {
- ConstantSDNode *CN = cast<ConstantSDNode>(N->getOperand(1));
- if (CN->getValue() == 0) {
- // (SPUindirect (SPUaform <addr>, 0), 0) ->
- // (SPUaform <addr>, 0)
-
- DEBUG(cerr << "Replace: ");
- DEBUG(N->dump(&DAG));
- DEBUG(cerr << "\nWith: ");
- DEBUG(Op0.Val->dump(&DAG));
- DEBUG(cerr << "\n");
-
- return Op0;
- }
- }
- break;
- }
- case SPUISD::SHLQUAD_L_BITS:
- case SPUISD::SHLQUAD_L_BYTES:
- case SPUISD::VEC_SHL:
- case SPUISD::VEC_SRL:
- case SPUISD::VEC_SRA:
- case SPUISD::ROTQUAD_RZ_BYTES:
- case SPUISD::ROTQUAD_RZ_BITS: {
- SDOperand Op1 = N->getOperand(1);
-
- if (isa<ConstantSDNode>(Op1)) {
- // Kill degenerate vector shifts:
- ConstantSDNode *CN = cast<ConstantSDNode>(Op1);
-
- if (CN->getValue() == 0) {
- Result = Op0;
- }
- }
- break;
- }
- case SPUISD::PROMOTE_SCALAR: {
- switch (Op0.getOpcode()) {
- default:
- break;
- case ISD::ANY_EXTEND:
- case ISD::ZERO_EXTEND:
- case ISD::SIGN_EXTEND: {
- // (SPUpromote_scalar (any|sign|zero_extend (SPUextract_elt0 <arg>))) ->
- // <arg>
- // but only if the SPUpromote_scalar and <arg> types match.
- SDOperand Op00 = Op0.getOperand(0);
- if (Op00.getOpcode() == SPUISD::EXTRACT_ELT0) {
- SDOperand Op000 = Op00.getOperand(0);
- if (Op000.getValueType() == N->getValueType(0)) {
- Result = Op000;
- }
- }
- break;
- }
- case SPUISD::EXTRACT_ELT0: {
- // (SPUpromote_scalar (SPUextract_elt0 <arg>)) ->
- // <arg>
- Result = Op0.getOperand(0);
- break;
- }
- }
- break;
- }
- }
- // Otherwise, return unchanged.
-#if 1
- if (Result.Val) {
- DEBUG(cerr << "\nReplace.SPU: ");
- DEBUG(N->dump(&DAG));
- DEBUG(cerr << "\nWith: ");
- DEBUG(Result.Val->dump(&DAG));
- DEBUG(cerr << "\n");
- }
-#endif
-
- return Result;
-}
-
-//===----------------------------------------------------------------------===//
-// Inline Assembly Support
-//===----------------------------------------------------------------------===//
-
-/// getConstraintType - Given a constraint letter, return the type of
-/// constraint it is for this target.
-SPUTargetLowering::ConstraintType
-SPUTargetLowering::getConstraintType(const std::string &ConstraintLetter) const {
- if (ConstraintLetter.size() == 1) {
- switch (ConstraintLetter[0]) {
- default: break;
- case 'b':
- case 'r':
- case 'f':
- case 'v':
- case 'y':
- return C_RegisterClass;
- }
- }
- return TargetLowering::getConstraintType(ConstraintLetter);
-}
-
-std::pair<unsigned, const TargetRegisterClass*>
-SPUTargetLowering::getRegForInlineAsmConstraint(const std::string &Constraint,
- MVT::ValueType VT) const
-{
- if (Constraint.size() == 1) {
- // GCC RS6000 Constraint Letters
- switch (Constraint[0]) {
- case 'b': // R1-R31
- case 'r': // R0-R31
- if (VT == MVT::i64)
- return std::make_pair(0U, SPU::R64CRegisterClass);
- return std::make_pair(0U, SPU::R32CRegisterClass);
- case 'f':
- if (VT == MVT::f32)
- return std::make_pair(0U, SPU::R32FPRegisterClass);
- else if (VT == MVT::f64)
- return std::make_pair(0U, SPU::R64FPRegisterClass);
- break;
- case 'v':
- return std::make_pair(0U, SPU::GPRCRegisterClass);
- }
- }
-
- return TargetLowering::getRegForInlineAsmConstraint(Constraint, VT);
-}
-
-//! Compute used/known bits for a SPU operand
-void
-SPUTargetLowering::computeMaskedBitsForTargetNode(const SDOperand Op,
- const APInt &Mask,
- APInt &KnownZero,
- APInt &KnownOne,
- const SelectionDAG &DAG,
- unsigned Depth ) const {
-#if 0
- const uint64_t uint64_sizebits = sizeof(uint64_t) * 8;
-#endif
-
- switch (Op.getOpcode()) {
- default:
- // KnownZero = KnownOne = APInt(Mask.getBitWidth(), 0);
- break;
-
-#if 0
- case CALL:
- case SHUFB:
- case INSERT_MASK:
- case CNTB:
-#endif
-
- case SPUISD::PROMOTE_SCALAR: {
- SDOperand Op0 = Op.getOperand(0);
- MVT::ValueType Op0VT = Op0.getValueType();
- unsigned Op0VTBits = MVT::getSizeInBits(Op0VT);
- uint64_t InMask = MVT::getIntVTBitMask(Op0VT);
- KnownZero |= APInt(Op0VTBits, ~InMask, false);
- KnownOne |= APInt(Op0VTBits, InMask, false);
- break;
- }
-
- case SPUISD::LDRESULT:
- case SPUISD::EXTRACT_ELT0:
- case SPUISD::EXTRACT_ELT0_CHAINED: {
- MVT::ValueType OpVT = Op.getValueType();
- unsigned OpVTBits = MVT::getSizeInBits(OpVT);
- uint64_t InMask = MVT::getIntVTBitMask(OpVT);
- KnownZero |= APInt(OpVTBits, ~InMask, false);
- KnownOne |= APInt(OpVTBits, InMask, false);
- break;
- }
-
-#if 0
- case EXTRACT_I1_ZEXT:
- case EXTRACT_I1_SEXT:
- case EXTRACT_I8_ZEXT:
- case EXTRACT_I8_SEXT:
- case MPY:
- case MPYU:
- case MPYH:
- case MPYHH:
- case SPUISD::SHLQUAD_L_BITS:
- case SPUISD::SHLQUAD_L_BYTES:
- case SPUISD::VEC_SHL:
- case SPUISD::VEC_SRL:
- case SPUISD::VEC_SRA:
- case SPUISD::VEC_ROTL:
- case SPUISD::VEC_ROTR:
- case SPUISD::ROTQUAD_RZ_BYTES:
- case SPUISD::ROTQUAD_RZ_BITS:
- case SPUISD::ROTBYTES_RIGHT_S:
- case SPUISD::ROTBYTES_LEFT:
- case SPUISD::ROTBYTES_LEFT_CHAINED:
- case FSMBI:
- case SELB:
- case FPInterp:
- case FPRecipEst:
- case SEXT32TO64:
-#endif
- }
-}
-
-// LowerAsmOperandForConstraint
-void
-SPUTargetLowering::LowerAsmOperandForConstraint(SDOperand Op,
- char ConstraintLetter,
- std::vector<SDOperand> &Ops,
- SelectionDAG &DAG) const {
- // Default, for the time being, to the base class handler
- TargetLowering::LowerAsmOperandForConstraint(Op, ConstraintLetter, Ops, DAG);
-}
-
-/// isLegalAddressImmediate - Return true if the integer value can be used
-/// as the offset of the target addressing mode.
-bool SPUTargetLowering::isLegalAddressImmediate(int64_t V, const Type *Ty) const {
- // SPU's addresses are 256K:
- return (V > -(1 << 18) && V < (1 << 18) - 1);
-}
-
-bool SPUTargetLowering::isLegalAddressImmediate(llvm::GlobalValue* GV) const {
- return false;
-}
diff --git a/release_23/lib/Target/CellSPU/SPUISelLowering.h b/release_23/lib/Target/CellSPU/SPUISelLowering.h
deleted file mode 100644
index 3c73aa51c062..000000000000
--- a/release_23/lib/Target/CellSPU/SPUISelLowering.h
+++ /dev/null
@@ -1,139 +0,0 @@
-//===-- SPUISelLowering.h - Cell SPU DAG Lowering Interface -----*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines the interfaces that Cell SPU uses to lower LLVM code into
-// a selection DAG.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef SPU_ISELLOWERING_H
-#define SPU_ISELLOWERING_H
-
-#include "llvm/Target/TargetLowering.h"
-#include "llvm/CodeGen/SelectionDAG.h"
-#include "SPU.h"
-
-namespace llvm {
- namespace SPUISD {
- enum NodeType {
- // Start the numbering where the builting ops and target ops leave off.
- FIRST_NUMBER = ISD::BUILTIN_OP_END+SPU::INSTRUCTION_LIST_END,
-
- // Pseudo instructions:
- RET_FLAG, ///< Return with flag, matched by bi instruction
-
- Hi, ///< High address component (upper 16)
- Lo, ///< Low address component (lower 16)
- PCRelAddr, ///< Program counter relative address
- AFormAddr, ///< A-form address (local store)
- IndirectAddr, ///< D-Form "imm($r)" and X-form "$r($r)"
-
- LDRESULT, ///< Load result (value, chain)
- CALL, ///< CALL instruction
- SHUFB, ///< Vector shuffle (permute)
- INSERT_MASK, ///< Insert element shuffle mask
- CNTB, ///< Count leading ones in bytes
- PROMOTE_SCALAR, ///< Promote scalar->vector
- EXTRACT_ELT0, ///< Extract element 0
- EXTRACT_ELT0_CHAINED, ///< Extract element 0, with chain
- EXTRACT_I1_ZEXT, ///< Extract element 0 as i1, zero extend
- EXTRACT_I1_SEXT, ///< Extract element 0 as i1, sign extend
- EXTRACT_I8_ZEXT, ///< Extract element 0 as i8, zero extend
- EXTRACT_I8_SEXT, ///< Extract element 0 as i8, sign extend
- MPY, ///< 16-bit Multiply (low parts of a 32-bit)
- MPYU, ///< Multiply Unsigned
- MPYH, ///< Multiply High
- MPYHH, ///< Multiply High-High
- SHLQUAD_L_BITS, ///< Rotate quad left, by bits
- SHLQUAD_L_BYTES, ///< Rotate quad left, by bytes
- VEC_SHL, ///< Vector shift left
- VEC_SRL, ///< Vector shift right (logical)
- VEC_SRA, ///< Vector shift right (arithmetic)
- VEC_ROTL, ///< Vector rotate left
- VEC_ROTR, ///< Vector rotate right
- ROTQUAD_RZ_BYTES, ///< Rotate quad right, by bytes, zero fill
- ROTQUAD_RZ_BITS, ///< Rotate quad right, by bits, zero fill
- ROTBYTES_RIGHT_S, ///< Vector rotate right, by bytes, sign fill
- ROTBYTES_LEFT, ///< Rotate bytes (loads -> ROTQBYI)
- ROTBYTES_LEFT_CHAINED, ///< Rotate bytes (loads -> ROTQBYI), with chain
- FSMBI, ///< Form Select Mask for Bytes, Immediate
- SELB, ///< Select bits -> (b & mask) | (a & ~mask)
- FPInterp, ///< Floating point interpolate
- FPRecipEst, ///< Floating point reciprocal estimate
- SEXT32TO64, ///< Sign-extended 32-bit const -> 64-bits
- LAST_SPUISD ///< Last user-defined instruction
- };
- }
-
- /// Predicates that are used for node matching:
- namespace SPU {
- SDOperand get_vec_u18imm(SDNode *N, SelectionDAG &DAG,
- MVT::ValueType ValueType);
- SDOperand get_vec_i16imm(SDNode *N, SelectionDAG &DAG,
- MVT::ValueType ValueType);
- SDOperand get_vec_i10imm(SDNode *N, SelectionDAG &DAG,
- MVT::ValueType ValueType);
- SDOperand get_vec_i8imm(SDNode *N, SelectionDAG &DAG,
- MVT::ValueType ValueType);
- SDOperand get_ILHUvec_imm(SDNode *N, SelectionDAG &DAG,
- MVT::ValueType ValueType);
- SDOperand get_v4i32_imm(SDNode *N, SelectionDAG &DAG);
- SDOperand get_v2i64_imm(SDNode *N, SelectionDAG &DAG);
- }
-
- class SPUTargetMachine; // forward dec'l.
-
- class SPUTargetLowering :
- public TargetLowering
- {
- int VarArgsFrameIndex; // FrameIndex for start of varargs area.
- int ReturnAddrIndex; // FrameIndex for return slot.
- SPUTargetMachine &SPUTM;
-
- public:
- SPUTargetLowering(SPUTargetMachine &TM);
-
- /// getTargetNodeName() - This method returns the name of a target specific
- /// DAG node.
- virtual const char *getTargetNodeName(unsigned Opcode) const;
-
- /// getSetCCResultType - Return the ValueType for ISD::SETCC
- virtual MVT::ValueType getSetCCResultType(const SDOperand &) const;
-
- /// LowerOperation - Provide custom lowering hooks for some operations.
- ///
- virtual SDOperand LowerOperation(SDOperand Op, SelectionDAG &DAG);
-
- virtual SDOperand PerformDAGCombine(SDNode *N, DAGCombinerInfo &DCI) const;
-
- virtual void computeMaskedBitsForTargetNode(const SDOperand Op,
- const APInt &Mask,
- APInt &KnownZero,
- APInt &KnownOne,
- const SelectionDAG &DAG,
- unsigned Depth = 0) const;
-
- ConstraintType getConstraintType(const std::string &ConstraintLetter) const;
-
- std::pair<unsigned, const TargetRegisterClass*>
- getRegForInlineAsmConstraint(const std::string &Constraint,
- MVT::ValueType VT) const;
-
- void LowerAsmOperandForConstraint(SDOperand Op, char ConstraintLetter,
- std::vector<SDOperand> &Ops,
- SelectionDAG &DAG) const;
-
- /// isLegalAddressImmediate - Return true if the integer value can be used
- /// as the offset of the target addressing mode.
- virtual bool isLegalAddressImmediate(int64_t V, const Type *Ty) const;
- virtual bool isLegalAddressImmediate(GlobalValue *) const;
- };
-}
-
-#endif
diff --git a/release_23/lib/Target/CellSPU/SPUInstrBuilder.h b/release_23/lib/Target/CellSPU/SPUInstrBuilder.h
deleted file mode 100644
index 00721d1b97bd..000000000000
--- a/release_23/lib/Target/CellSPU/SPUInstrBuilder.h
+++ /dev/null
@@ -1,55 +0,0 @@
-//==-- SPUInstrBuilder.h - Aides for building Cell SPU insts -----*- C++ -*-==//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file exposes functions that may be used with BuildMI from the
-// MachineInstrBuilder.h file to simplify generating frame and constant pool
-// references.
-//
-// For reference, the order of operands for memory references is:
-// (Operand), Dest Reg, Base Reg, and either Reg Index or Immediate
-// Displacement.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef SPU_INSTRBUILDER_H
-#define SPU_INSTRBUILDER_H
-
-#include "llvm/CodeGen/MachineInstrBuilder.h"
-
-namespace llvm {
-
-/// addFrameReference - This function is used to add a reference to the base of
-/// an abstract object on the stack frame of the current function. This
-/// reference has base register as the FrameIndex offset until it is resolved.
-/// This allows a constant offset to be specified as well...
-///
-inline const MachineInstrBuilder&
-addFrameReference(const MachineInstrBuilder &MIB, int FI, int Offset = 0,
- bool mem = true) {
- if (mem)
- return MIB.addImm(Offset).addFrameIndex(FI);
- else
- return MIB.addFrameIndex(FI).addImm(Offset);
-}
-
-/// addConstantPoolReference - This function is used to add a reference to the
-/// base of a constant value spilled to the per-function constant pool. The
-/// reference has base register ConstantPoolIndex offset which is retained until
-/// either machine code emission or assembly output. This allows an optional
-/// offset to be added as well.
-///
-inline const MachineInstrBuilder&
-addConstantPoolReference(const MachineInstrBuilder &MIB, unsigned CPI,
- int Offset = 0) {
- return MIB.addImm(Offset).addConstantPoolIndex(CPI);
-}
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/lib/Target/CellSPU/SPUInstrFormats.td b/release_23/lib/Target/CellSPU/SPUInstrFormats.td
deleted file mode 100644
index f423dfa34207..000000000000
--- a/release_23/lib/Target/CellSPU/SPUInstrFormats.td
+++ /dev/null
@@ -1,296 +0,0 @@
-//==== SPUInstrFormats.td - Cell SPU Instruction Formats ---*- tablegen -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-//===----------------------------------------------------------------------===//
-//
-// Cell SPU instruction formats. Note that these are notationally similar to
-// PowerPC, like "A-Form". But the sizes of operands and fields differ.
-
-// This was kiped from the PPC instruction formats (seemed like a good idea...)
-
-class SPUInstr<dag OOL, dag IOL, string asmstr, InstrItinClass itin>
- : Instruction {
- field bits<32> Inst;
-
- let Namespace = "SPU";
- let OutOperandList = OOL;
- let InOperandList = IOL;
- let AsmString = asmstr;
- let Itinerary = itin;
-}
-
-// RR Format
-class RRForm<bits<11> opcode, dag OOL, dag IOL, string asmstr,
- InstrItinClass itin, list<dag> pattern>
- : SPUInstr<OOL, IOL, asmstr, itin> {
- bits<7> RA;
- bits<7> RB;
- bits<7> RT;
-
- let Pattern = pattern;
-
- let Inst{0-10} = opcode;
- let Inst{11-17} = RB;
- let Inst{18-24} = RA;
- let Inst{25-31} = RT;
-}
-
-let RB = 0 in {
- // RR Format, where RB is zeroed (dont care):
- class RRForm_1<bits<11> opcode, dag OOL, dag IOL, string asmstr,
- InstrItinClass itin, list<dag> pattern>
- : RRForm<opcode, OOL, IOL, asmstr, itin, pattern>
- { }
-
- let RA = 0 in {
- // RR Format, where RA and RB are zeroed (dont care):
- // Used for reads from status control registers (see FPSCRRr32)
- class RRForm_2<bits<11> opcode, dag OOL, dag IOL, string asmstr,
- InstrItinClass itin, list<dag> pattern>
- : RRForm<opcode, OOL, IOL, asmstr, itin, pattern>
- { }
- }
-}
-
-let RT = 0 in {
- // RR Format, where RT is zeroed (don't care), or as the instruction handbook
- // says, "RT is a false target." Used in "Halt if" instructions
- class RRForm_3<bits<11> opcode, dag OOL, dag IOL, string asmstr,
- InstrItinClass itin, list<dag> pattern>
- : RRForm<opcode, OOL, IOL, asmstr, itin, pattern>
- { }
-}
-
-// RRR Format
-class RRRForm<bits<4> opcode, dag OOL, dag IOL, string asmstr,
- InstrItinClass itin, list<dag> pattern>
- : SPUInstr<OOL, IOL, asmstr, itin>
-{
- bits<7> RA;
- bits<7> RB;
- bits<7> RC;
- bits<7> RT;
-
- let Pattern = pattern;
-
- let Inst{0-3} = opcode;
- let Inst{4-10} = RT;
- let Inst{11-17} = RB;
- let Inst{18-24} = RA;
- let Inst{25-31} = RC;
-}
-
-// RI7 Format
-class RI7Form<bits<11> opcode, dag OOL, dag IOL, string asmstr,
- InstrItinClass itin, list<dag> pattern>
- : SPUInstr<OOL, IOL, asmstr, itin>
-{
- bits<7> i7;
- bits<7> RA;
- bits<7> RT;
-
- let Pattern = pattern;
-
- let Inst{0-10} = opcode;
- let Inst{11-17} = i7;
- let Inst{18-24} = RA;
- let Inst{25-31} = RT;
-}
-
-// CVTIntFp Format
-class CVTIntFPForm<bits<10> opcode, dag OOL, dag IOL, string asmstr,
- InstrItinClass itin, list<dag> pattern>
- : SPUInstr<OOL, IOL, asmstr, itin>
-{
- bits<7> RA;
- bits<7> RT;
-
- let Pattern = pattern;
-
- let Inst{0-9} = opcode;
- let Inst{10-17} = 0;
- let Inst{18-24} = RA;
- let Inst{25-31} = RT;
-}
-
-let RA = 0 in {
- class BICondForm<bits<11> opcode, string asmstr, list<dag> pattern>
- : RRForm<opcode, (outs), (ins R32C:$rA, R32C:$func), asmstr,
- BranchResolv, pattern>
- { }
-
- let RT = 0 in {
- // Branch instruction format (without D/E flag settings)
- class BRForm<bits<11> opcode, dag OOL, dag IOL, string asmstr,
- InstrItinClass itin, list<dag> pattern>
- : RRForm<opcode, OOL, IOL, asmstr, itin, pattern>
- { }
-
- class BIForm<bits<11> opcode, string asmstr, list<dag> pattern>
- : RRForm<opcode, (outs), (ins R32C:$func), asmstr, BranchResolv,
- pattern>
- { }
-
- let RB = 0 in {
- // Return instruction (bi, branch indirect), RA is zero (LR):
- class RETForm<string asmstr, list<dag> pattern>
- : BRForm<0b00010101100, (outs), (ins), asmstr, BranchResolv,
- pattern>
- { }
- }
- }
-}
-
-// Branch indirect external data forms:
-class BISLEDForm<bits<2> DE_flag, string asmstr, list<dag> pattern>
- : SPUInstr<(outs), (ins indcalltarget:$func), asmstr, BranchResolv>
-{
- bits<7> Rcalldest;
-
- let Pattern = pattern;
-
- let Inst{0-10} = 0b11010101100;
- let Inst{11} = 0;
- let Inst{12-13} = DE_flag;
- let Inst{14-17} = 0b0000;
- let Inst{18-24} = Rcalldest;
- let Inst{25-31} = 0b0000000;
-}
-
-// RI10 Format
-class RI10Form<bits<8> opcode, dag OOL, dag IOL, string asmstr,
- InstrItinClass itin, list<dag> pattern>
- : SPUInstr<OOL, IOL, asmstr, itin>
-{
- bits<10> i10;
- bits<7> RA;
- bits<7> RT;
-
- let Pattern = pattern;
-
- let Inst{0-7} = opcode;
- let Inst{8-17} = i10;
- let Inst{18-24} = RA;
- let Inst{25-31} = RT;
-}
-
-// RI10 Format, where the constant is zero (or effectively ignored by the
-// SPU)
-let i10 = 0 in {
- class RI10Form_1<bits<8> opcode, dag OOL, dag IOL, string asmstr,
- InstrItinClass itin, list<dag> pattern>
- : RI10Form<opcode, OOL, IOL, asmstr, itin, pattern>
- { }
-}
-
-// RI10 Format, where RT is ignored.
-// This format is used primarily by the Halt If ... Immediate set of
-// instructions
-let RT = 0 in {
- class RI10Form_2<bits<8> opcode, dag OOL, dag IOL, string asmstr,
- InstrItinClass itin, list<dag> pattern>
- : RI10Form<opcode, OOL, IOL, asmstr, itin, pattern>
- { }
-}
-
-// RI16 Format
-class RI16Form<bits<9> opcode, dag OOL, dag IOL, string asmstr,
- InstrItinClass itin, list<dag> pattern>
- : SPUInstr<OOL, IOL, asmstr, itin>
-{
- bits<16> i16;
- bits<7> RT;
-
- let Pattern = pattern;
-
- let Inst{0-8} = opcode;
- let Inst{9-24} = i16;
- let Inst{25-31} = RT;
-}
-
-// Specialized version of the RI16 Format for unconditional branch relative and
-// branch absolute, branch and set link. Note that for branch and set link, the
-// link register doesn't have to be $lr, but this is actually hard coded into
-// the instruction pattern.
-
-let RT = 0 in {
- class UncondBranch<bits<9> opcode, dag OOL, dag IOL, string asmstr,
- list<dag> pattern>
- : RI16Form<opcode, OOL, IOL, asmstr, BranchResolv, pattern>
- { }
-
- class BranchSetLink<bits<9> opcode, dag OOL, dag IOL, string asmstr,
- list<dag> pattern>
- : RI16Form<opcode, OOL, IOL, asmstr, BranchResolv, pattern>
- { }
-}
-
-//===----------------------------------------------------------------------===//
-// Specialized versions of RI16:
-//===----------------------------------------------------------------------===//
-
-// RI18 Format
-class RI18Form<bits<7> opcode, dag OOL, dag IOL, string asmstr,
- InstrItinClass itin, list<dag> pattern>
- : SPUInstr<OOL, IOL, asmstr, itin>
-{
- bits<18> i18;
- bits<7> RT;
-
- let Pattern = pattern;
-
- let Inst{0-6} = opcode;
- let Inst{7-24} = i18;
- let Inst{25-31} = RT;
-}
-
-//===----------------------------------------------------------------------===//
-// Instruction formats for intrinsics:
-//===----------------------------------------------------------------------===//
-
-// RI10 Format for v8i16 intrinsics
-class RI10_Int_v8i16<bits<8> opcode, string opc, InstrItinClass itin,
- Intrinsic IntID> :
- RI10Form<opcode, (outs VECREG:$rT), (ins s10imm:$val, VECREG:$rA),
- !strconcat(opc, " $rT, $rA, $val"), itin,
- [(set (v8i16 VECREG:$rT), (IntID (v8i16 VECREG:$rA),
- i16ImmSExt10:$val))] >;
-
-class RI10_Int_v4i32<bits<8> opcode, string opc, InstrItinClass itin,
- Intrinsic IntID> :
- RI10Form<opcode, (outs VECREG:$rT), (ins s10imm:$val, VECREG:$rA),
- !strconcat(opc, " $rT, $rA, $val"), itin,
- [(set (v4i32 VECREG:$rT), (IntID (v4i32 VECREG:$rA),
- i32ImmSExt10:$val))] >;
-
-// RR Format for v8i16 intrinsics
-class RR_Int_v8i16<bits<11> opcode, string opc, InstrItinClass itin,
- Intrinsic IntID> :
- RRForm<opcode, (outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB),
- !strconcat(opc, " $rT, $rA, $rB"), itin,
- [(set (v8i16 VECREG:$rT), (IntID (v8i16 VECREG:$rA),
- (v8i16 VECREG:$rB)))] >;
-
-// RR Format for v4i32 intrinsics
-class RR_Int_v4i32<bits<11> opcode, string opc, InstrItinClass itin,
- Intrinsic IntID> :
- RRForm<opcode, (outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB),
- !strconcat(opc, " $rT, $rA, $rB"), itin,
- [(set (v4i32 VECREG:$rT), (IntID (v4i32 VECREG:$rA),
- (v4i32 VECREG:$rB)))] >;
-
-//===----------------------------------------------------------------------===//
-// Pseudo instructions, like call frames:
-//===----------------------------------------------------------------------===//
-
-class Pseudo<dag OOL, dag IOL, string asmstr, list<dag> pattern>
- : SPUInstr<OOL, IOL, asmstr, NoItinerary> {
- let Pattern = pattern;
- let Inst{31-0} = 0;
-}
diff --git a/release_23/lib/Target/CellSPU/SPUInstrInfo.cpp b/release_23/lib/Target/CellSPU/SPUInstrInfo.cpp
deleted file mode 100644
index bf94cdc0946e..000000000000
--- a/release_23/lib/Target/CellSPU/SPUInstrInfo.cpp
+++ /dev/null
@@ -1,434 +0,0 @@
-//===- SPUInstrInfo.cpp - Cell SPU Instruction Information ----------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains the Cell SPU implementation of the TargetInstrInfo class.
-//
-//===----------------------------------------------------------------------===//
-
-#include "SPURegisterNames.h"
-#include "SPUInstrInfo.h"
-#include "SPUInstrBuilder.h"
-#include "SPUTargetMachine.h"
-#include "SPUGenInstrInfo.inc"
-#include "llvm/CodeGen/MachineInstrBuilder.h"
-#include <iostream>
-
-using namespace llvm;
-
-SPUInstrInfo::SPUInstrInfo(SPUTargetMachine &tm)
- : TargetInstrInfoImpl(SPUInsts, sizeof(SPUInsts)/sizeof(SPUInsts[0])),
- TM(tm),
- RI(*TM.getSubtargetImpl(), *this)
-{
- /* NOP */
-}
-
-/// getPointerRegClass - Return the register class to use to hold pointers.
-/// This is used for addressing modes.
-const TargetRegisterClass *
-SPUInstrInfo::getPointerRegClass() const
-{
- return &SPU::R32CRegClass;
-}
-
-bool
-SPUInstrInfo::isMoveInstr(const MachineInstr& MI,
- unsigned& sourceReg,
- unsigned& destReg) const {
- // Primarily, ORI and OR are generated by copyRegToReg. But, there are other
- // cases where we can safely say that what's being done is really a move
- // (see how PowerPC does this -- it's the model for this code too.)
- switch (MI.getOpcode()) {
- default:
- break;
- case SPU::ORIv4i32:
- case SPU::ORIr32:
- case SPU::ORHIv8i16:
- case SPU::ORHIr16:
- case SPU::ORHIi8i16:
- case SPU::ORBIv16i8:
- case SPU::ORBIr8:
- case SPU::ORIi16i32:
- case SPU::ORIi8i32:
- case SPU::AHIvec:
- case SPU::AHIr16:
- case SPU::AIvec:
- assert(MI.getNumOperands() == 3 &&
- MI.getOperand(0).isRegister() &&
- MI.getOperand(1).isRegister() &&
- MI.getOperand(2).isImmediate() &&
- "invalid SPU ORI/ORHI/ORBI/AHI/AI/SFI/SFHI instruction!");
- if (MI.getOperand(2).getImm() == 0) {
- sourceReg = MI.getOperand(1).getReg();
- destReg = MI.getOperand(0).getReg();
- return true;
- }
- break;
- case SPU::AIr32:
- assert(MI.getNumOperands() == 3 &&
- "wrong number of operands to AIr32");
- if (MI.getOperand(0).isRegister() &&
- (MI.getOperand(1).isRegister() ||
- MI.getOperand(1).isFrameIndex()) &&
- (MI.getOperand(2).isImmediate() &&
- MI.getOperand(2).getImm() == 0)) {
- sourceReg = MI.getOperand(1).getReg();
- destReg = MI.getOperand(0).getReg();
- return true;
- }
- break;
- case SPU::ORv16i8_i8:
- case SPU::ORv8i16_i16:
- case SPU::ORv4i32_i32:
- case SPU::ORv2i64_i64:
- case SPU::ORv4f32_f32:
- case SPU::ORv2f64_f64:
- case SPU::ORi8_v16i8:
- case SPU::ORi16_v8i16:
- case SPU::ORi32_v4i32:
- case SPU::ORi64_v2i64:
- case SPU::ORf32_v4f32:
- case SPU::ORf64_v2f64:
- case SPU::ORv16i8:
- case SPU::ORv8i16:
- case SPU::ORv4i32:
- case SPU::ORr32:
- case SPU::ORr64:
- case SPU::ORf32:
- case SPU::ORf64:
- assert(MI.getNumOperands() == 3 &&
- MI.getOperand(0).isRegister() &&
- MI.getOperand(1).isRegister() &&
- MI.getOperand(2).isRegister() &&
- "invalid SPU OR(vec|r32|r64|gprc) instruction!");
- if (MI.getOperand(1).getReg() == MI.getOperand(2).getReg()) {
- sourceReg = MI.getOperand(1).getReg();
- destReg = MI.getOperand(0).getReg();
- return true;
- }
- break;
- }
-
- return false;
-}
-
-unsigned
-SPUInstrInfo::isLoadFromStackSlot(MachineInstr *MI, int &FrameIndex) const {
- switch (MI->getOpcode()) {
- default: break;
- case SPU::LQDv16i8:
- case SPU::LQDv8i16:
- case SPU::LQDv4i32:
- case SPU::LQDv4f32:
- case SPU::LQDv2f64:
- case SPU::LQDr128:
- case SPU::LQDr64:
- case SPU::LQDr32:
- case SPU::LQDr16:
- case SPU::LQXv4i32:
- case SPU::LQXr128:
- case SPU::LQXr64:
- case SPU::LQXr32:
- case SPU::LQXr16:
- if (MI->getOperand(1).isImmediate() && !MI->getOperand(1).getImm() &&
- MI->getOperand(2).isFrameIndex()) {
- FrameIndex = MI->getOperand(2).getIndex();
- return MI->getOperand(0).getReg();
- }
- break;
- }
- return 0;
-}
-
-unsigned
-SPUInstrInfo::isStoreToStackSlot(MachineInstr *MI, int &FrameIndex) const {
- switch (MI->getOpcode()) {
- default: break;
- case SPU::STQDv16i8:
- case SPU::STQDv8i16:
- case SPU::STQDv4i32:
- case SPU::STQDv4f32:
- case SPU::STQDv2f64:
- case SPU::STQDr128:
- case SPU::STQDr64:
- case SPU::STQDr32:
- case SPU::STQDr16:
- // case SPU::STQDr8:
- case SPU::STQXv16i8:
- case SPU::STQXv8i16:
- case SPU::STQXv4i32:
- case SPU::STQXv4f32:
- case SPU::STQXv2f64:
- case SPU::STQXr128:
- case SPU::STQXr64:
- case SPU::STQXr32:
- case SPU::STQXr16:
- // case SPU::STQXr8:
- if (MI->getOperand(1).isImmediate() && !MI->getOperand(1).getImm() &&
- MI->getOperand(2).isFrameIndex()) {
- FrameIndex = MI->getOperand(2).getIndex();
- return MI->getOperand(0).getReg();
- }
- break;
- }
- return 0;
-}
-
-void SPUInstrInfo::copyRegToReg(MachineBasicBlock &MBB,
- MachineBasicBlock::iterator MI,
- unsigned DestReg, unsigned SrcReg,
- const TargetRegisterClass *DestRC,
- const TargetRegisterClass *SrcRC) const
-{
- // We support cross register class moves for our aliases, such as R3 in any
- // reg class to any other reg class containing R3. This is required because
- // we instruction select bitconvert i64 -> f64 as a noop for example, so our
- // types have no specific meaning.
-
- //if (DestRC != SrcRC) {
- // cerr << "SPUInstrInfo::copyRegToReg(): DestRC != SrcRC not supported!\n";
- // abort();
- //}
-
- if (DestRC == SPU::R8CRegisterClass) {
- BuildMI(MBB, MI, get(SPU::ORBIr8), DestReg).addReg(SrcReg).addImm(0);
- } else if (DestRC == SPU::R16CRegisterClass) {
- BuildMI(MBB, MI, get(SPU::ORHIr16), DestReg).addReg(SrcReg).addImm(0);
- } else if (DestRC == SPU::R32CRegisterClass) {
- BuildMI(MBB, MI, get(SPU::ORIr32), DestReg).addReg(SrcReg).addImm(0);
- } else if (DestRC == SPU::R32FPRegisterClass) {
- BuildMI(MBB, MI, get(SPU::ORf32), DestReg).addReg(SrcReg)
- .addReg(SrcReg);
- } else if (DestRC == SPU::R64CRegisterClass) {
- BuildMI(MBB, MI, get(SPU::ORr64), DestReg).addReg(SrcReg)
- .addReg(SrcReg);
- } else if (DestRC == SPU::R64FPRegisterClass) {
- BuildMI(MBB, MI, get(SPU::ORf64), DestReg).addReg(SrcReg)
- .addReg(SrcReg);
- } /* else if (DestRC == SPU::GPRCRegisterClass) {
- BuildMI(MBB, MI, get(SPU::ORgprc), DestReg).addReg(SrcReg)
- .addReg(SrcReg);
- } */ else if (DestRC == SPU::VECREGRegisterClass) {
- BuildMI(MBB, MI, get(SPU::ORv4i32), DestReg).addReg(SrcReg)
- .addReg(SrcReg);
- } else {
- std::cerr << "Attempt to copy unknown/unsupported register class!\n";
- abort();
- }
-}
-
-void
-SPUInstrInfo::storeRegToStackSlot(MachineBasicBlock &MBB,
- MachineBasicBlock::iterator MI,
- unsigned SrcReg, bool isKill, int FrameIdx,
- const TargetRegisterClass *RC) const
-{
- unsigned opc;
- if (RC == SPU::GPRCRegisterClass) {
- opc = (FrameIdx < SPUFrameInfo::maxFrameOffset())
- ? SPU::STQDr128
- : SPU::STQXr128;
- } else if (RC == SPU::R64CRegisterClass) {
- opc = (FrameIdx < SPUFrameInfo::maxFrameOffset())
- ? SPU::STQDr64
- : SPU::STQXr64;
- } else if (RC == SPU::R64FPRegisterClass) {
- opc = (FrameIdx < SPUFrameInfo::maxFrameOffset())
- ? SPU::STQDr64
- : SPU::STQXr64;
- } else if (RC == SPU::R32CRegisterClass) {
- opc = (FrameIdx < SPUFrameInfo::maxFrameOffset())
- ? SPU::STQDr32
- : SPU::STQXr32;
- } else if (RC == SPU::R32FPRegisterClass) {
- opc = (FrameIdx < SPUFrameInfo::maxFrameOffset())
- ? SPU::STQDr32
- : SPU::STQXr32;
- } else if (RC == SPU::R16CRegisterClass) {
- opc = (FrameIdx < SPUFrameInfo::maxFrameOffset()) ?
- SPU::STQDr16
- : SPU::STQXr16;
- } else {
- assert(0 && "Unknown regclass!");
- abort();
- }
-
- addFrameReference(BuildMI(MBB, MI, get(opc))
- .addReg(SrcReg, false, false, isKill), FrameIdx);
-}
-
-void SPUInstrInfo::storeRegToAddr(MachineFunction &MF, unsigned SrcReg,
- bool isKill,
- SmallVectorImpl<MachineOperand> &Addr,
- const TargetRegisterClass *RC,
- SmallVectorImpl<MachineInstr*> &NewMIs) const {
- cerr << "storeRegToAddr() invoked!\n";
- abort();
-
- if (Addr[0].isFrameIndex()) {
- /* do what storeRegToStackSlot does here */
- } else {
- unsigned Opc = 0;
- if (RC == SPU::GPRCRegisterClass) {
- /* Opc = PPC::STW; */
- } else if (RC == SPU::R16CRegisterClass) {
- /* Opc = PPC::STD; */
- } else if (RC == SPU::R32CRegisterClass) {
- /* Opc = PPC::STFD; */
- } else if (RC == SPU::R32FPRegisterClass) {
- /* Opc = PPC::STFD; */
- } else if (RC == SPU::R64FPRegisterClass) {
- /* Opc = PPC::STFS; */
- } else if (RC == SPU::VECREGRegisterClass) {
- /* Opc = PPC::STVX; */
- } else {
- assert(0 && "Unknown regclass!");
- abort();
- }
- MachineInstrBuilder MIB = BuildMI(get(Opc))
- .addReg(SrcReg, false, false, isKill);
- for (unsigned i = 0, e = Addr.size(); i != e; ++i) {
- MachineOperand &MO = Addr[i];
- if (MO.isRegister())
- MIB.addReg(MO.getReg());
- else if (MO.isImmediate())
- MIB.addImm(MO.getImm());
- else
- MIB.addFrameIndex(MO.getIndex());
- }
- NewMIs.push_back(MIB);
- }
-}
-
-void
-SPUInstrInfo::loadRegFromStackSlot(MachineBasicBlock &MBB,
- MachineBasicBlock::iterator MI,
- unsigned DestReg, int FrameIdx,
- const TargetRegisterClass *RC) const
-{
- unsigned opc;
- if (RC == SPU::GPRCRegisterClass) {
- opc = (FrameIdx < SPUFrameInfo::maxFrameOffset())
- ? SPU::LQDr128
- : SPU::LQXr128;
- } else if (RC == SPU::R64CRegisterClass) {
- opc = (FrameIdx < SPUFrameInfo::maxFrameOffset())
- ? SPU::LQDr64
- : SPU::LQXr64;
- } else if (RC == SPU::R64FPRegisterClass) {
- opc = (FrameIdx < SPUFrameInfo::maxFrameOffset())
- ? SPU::LQDr64
- : SPU::LQXr64;
- } else if (RC == SPU::R32CRegisterClass) {
- opc = (FrameIdx < SPUFrameInfo::maxFrameOffset())
- ? SPU::LQDr32
- : SPU::LQXr32;
- } else if (RC == SPU::R32FPRegisterClass) {
- opc = (FrameIdx < SPUFrameInfo::maxFrameOffset())
- ? SPU::LQDr32
- : SPU::LQXr32;
- } else if (RC == SPU::R16CRegisterClass) {
- opc = (FrameIdx < SPUFrameInfo::maxFrameOffset())
- ? SPU::LQDr16
- : SPU::LQXr16;
- } else {
- assert(0 && "Unknown regclass in loadRegFromStackSlot!");
- abort();
- }
-
- addFrameReference(BuildMI(MBB, MI, get(opc)).addReg(DestReg), FrameIdx);
-}
-
-/*!
- \note We are really pessimistic here about what kind of a load we're doing.
- */
-void SPUInstrInfo::loadRegFromAddr(MachineFunction &MF, unsigned DestReg,
- SmallVectorImpl<MachineOperand> &Addr,
- const TargetRegisterClass *RC,
- SmallVectorImpl<MachineInstr*> &NewMIs)
- const {
- cerr << "loadRegToAddr() invoked!\n";
- abort();
-
- if (Addr[0].isFrameIndex()) {
- /* do what loadRegFromStackSlot does here... */
- } else {
- unsigned Opc = 0;
- if (RC == SPU::R8CRegisterClass) {
- /* do brilliance here */
- } else if (RC == SPU::R16CRegisterClass) {
- /* Opc = PPC::LWZ; */
- } else if (RC == SPU::R32CRegisterClass) {
- /* Opc = PPC::LD; */
- } else if (RC == SPU::R32FPRegisterClass) {
- /* Opc = PPC::LFD; */
- } else if (RC == SPU::R64FPRegisterClass) {
- /* Opc = PPC::LFS; */
- } else if (RC == SPU::VECREGRegisterClass) {
- /* Opc = PPC::LVX; */
- } else if (RC == SPU::GPRCRegisterClass) {
- /* Opc = something else! */
- } else {
- assert(0 && "Unknown regclass!");
- abort();
- }
- MachineInstrBuilder MIB = BuildMI(get(Opc), DestReg);
- for (unsigned i = 0, e = Addr.size(); i != e; ++i) {
- MachineOperand &MO = Addr[i];
- if (MO.isRegister())
- MIB.addReg(MO.getReg());
- else if (MO.isImmediate())
- MIB.addImm(MO.getImm());
- else
- MIB.addFrameIndex(MO.getIndex());
- }
- NewMIs.push_back(MIB);
- }
-}
-
-/// foldMemoryOperand - SPU, like PPC, can only fold spills into
-/// copy instructions, turning them into load/store instructions.
-MachineInstr *
-SPUInstrInfo::foldMemoryOperand(MachineFunction &MF,
- MachineInstr *MI,
- SmallVectorImpl<unsigned> &Ops,
- int FrameIndex) const
-{
-#if SOMEDAY_SCOTT_LOOKS_AT_ME_AGAIN
- if (Ops.size() != 1) return NULL;
-
- unsigned OpNum = Ops[0];
- unsigned Opc = MI->getOpcode();
- MachineInstr *NewMI = 0;
-
- if ((Opc == SPU::ORr32
- || Opc == SPU::ORv4i32)
- && MI->getOperand(1).getReg() == MI->getOperand(2).getReg()) {
- if (OpNum == 0) { // move -> store
- unsigned InReg = MI->getOperand(1).getReg();
- if (FrameIndex < SPUFrameInfo::maxFrameOffset()) {
- NewMI = addFrameReference(BuildMI(TII.get(SPU::STQDr32)).addReg(InReg),
- FrameIndex);
- }
- } else { // move -> load
- unsigned OutReg = MI->getOperand(0).getReg();
- Opc = (FrameIndex < SPUFrameInfo::maxFrameOffset()) ? SPU::STQDr32 : SPU::STQXr32;
- NewMI = addFrameReference(BuildMI(TII.get(Opc), OutReg), FrameIndex);
- }
- }
-
- if (NewMI)
- NewMI->copyKillDeadInfo(MI);
-
- return NewMI;
-#else
- return 0;
-#endif
-}
-
diff --git a/release_23/lib/Target/CellSPU/SPUInstrInfo.h b/release_23/lib/Target/CellSPU/SPUInstrInfo.h
deleted file mode 100644
index dc492023bb58..000000000000
--- a/release_23/lib/Target/CellSPU/SPUInstrInfo.h
+++ /dev/null
@@ -1,95 +0,0 @@
-//===- SPUInstrInfo.h - Cell SPU Instruction Information --------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains the CellSPU implementation of the TargetInstrInfo class.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef SPU_INSTRUCTIONINFO_H
-#define SPU_INSTRUCTIONINFO_H
-
-#include "SPU.h"
-#include "llvm/Target/TargetInstrInfo.h"
-#include "SPURegisterInfo.h"
-
-namespace llvm {
- //! Cell SPU instruction information class
- class SPUInstrInfo : public TargetInstrInfoImpl {
- SPUTargetMachine &TM;
- const SPURegisterInfo RI;
- public:
- explicit SPUInstrInfo(SPUTargetMachine &tm);
-
- /// getRegisterInfo - TargetInstrInfo is a superset of MRegister info. As
- /// such, whenever a client has an instance of instruction info, it should
- /// always be able to get register info as well (through this method).
- ///
- virtual const TargetRegisterInfo &getRegisterInfo() const { return RI; }
-
- /// getPointerRegClass - Return the register class to use to hold pointers.
- /// This is used for addressing modes.
- virtual const TargetRegisterClass *getPointerRegClass() const;
-
- // Return true if the instruction is a register to register move and
- // leave the source and dest operands in the passed parameters.
- //
- virtual bool isMoveInstr(const MachineInstr& MI,
- unsigned& sourceReg,
- unsigned& destReg) const;
-
- unsigned isLoadFromStackSlot(MachineInstr *MI, int &FrameIndex) const;
- unsigned isStoreToStackSlot(MachineInstr *MI, int &FrameIndex) const;
-
- virtual void copyRegToReg(MachineBasicBlock &MBB,
- MachineBasicBlock::iterator MI,
- unsigned DestReg, unsigned SrcReg,
- const TargetRegisterClass *DestRC,
- const TargetRegisterClass *SrcRC) const;
-
- //! Store a register to a stack slot, based on its register class.
- virtual void storeRegToStackSlot(MachineBasicBlock &MBB,
- MachineBasicBlock::iterator MBBI,
- unsigned SrcReg, bool isKill, int FrameIndex,
- const TargetRegisterClass *RC) const;
-
- //! Store a register to an address, based on its register class
- virtual void storeRegToAddr(MachineFunction &MF, unsigned SrcReg, bool isKill,
- SmallVectorImpl<MachineOperand> &Addr,
- const TargetRegisterClass *RC,
- SmallVectorImpl<MachineInstr*> &NewMIs) const;
-
- //! Load a register from a stack slot, based on its register class.
- virtual void loadRegFromStackSlot(MachineBasicBlock &MBB,
- MachineBasicBlock::iterator MBBI,
- unsigned DestReg, int FrameIndex,
- const TargetRegisterClass *RC) const;
-
- //! Loqad a register from an address, based on its register class
- virtual void loadRegFromAddr(MachineFunction &MF, unsigned DestReg,
- SmallVectorImpl<MachineOperand> &Addr,
- const TargetRegisterClass *RC,
- SmallVectorImpl<MachineInstr*> &NewMIs) const;
-
- //! Fold spills into load/store instructions
- virtual MachineInstr* foldMemoryOperand(MachineFunction &MF,
- MachineInstr* MI,
- SmallVectorImpl<unsigned> &Ops,
- int FrameIndex) const;
-
- //! Fold any load/store to an operand
- virtual MachineInstr* foldMemoryOperand(MachineFunction &MF,
- MachineInstr* MI,
- SmallVectorImpl<unsigned> &Ops,
- MachineInstr* LoadMI) const {
- return 0;
- }
- };
-}
-
-#endif
diff --git a/release_23/lib/Target/CellSPU/SPUInstrInfo.td b/release_23/lib/Target/CellSPU/SPUInstrInfo.td
deleted file mode 100644
index 8e1933c8ba02..000000000000
--- a/release_23/lib/Target/CellSPU/SPUInstrInfo.td
+++ /dev/null
@@ -1,3912 +0,0 @@
-//==- SPUInstrInfo.td - Describe the Cell SPU Instructions -*- tablegen -*-==//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-// Cell SPU Instructions:
-//===----------------------------------------------------------------------===//
-
-//===----------------------------------------------------------------------===//
-// TODO Items (not urgent today, but would be nice, low priority)
-//
-// ANDBI, ORBI: SPU constructs a 4-byte constant for these instructions by
-// concatenating the byte argument b as "bbbb". Could recognize this bit pattern
-// in 16-bit and 32-bit constants and reduce instruction count.
-//===----------------------------------------------------------------------===//
-
-//===----------------------------------------------------------------------===//
-// Pseudo instructions:
-//===----------------------------------------------------------------------===//
-
-let hasCtrlDep = 1, Defs = [R1], Uses = [R1] in {
- def ADJCALLSTACKDOWN : Pseudo<(outs), (ins u16imm_i32:$amt),
- "${:comment} ADJCALLSTACKDOWN",
- [(callseq_start imm:$amt)]>;
- def ADJCALLSTACKUP : Pseudo<(outs), (ins u16imm_i32:$amt),
- "${:comment} ADJCALLSTACKUP",
- [(callseq_end imm:$amt)]>;
-}
-
-//===----------------------------------------------------------------------===//
-// DWARF debugging Pseudo Instructions
-//===----------------------------------------------------------------------===//
-
-def DWARF_LOC : Pseudo<(outs), (ins i32imm:$line, i32imm:$col, i32imm:$file),
- "${:comment} .loc $file, $line, $col",
- [(dwarf_loc (i32 imm:$line), (i32 imm:$col),
- (i32 imm:$file))]>;
-
-//===----------------------------------------------------------------------===//
-// Loads:
-// NB: The ordering is actually important, since the instruction selection
-// will try each of the instructions in sequence, i.e., the D-form first with
-// the 10-bit displacement, then the A-form with the 16 bit displacement, and
-// finally the X-form with the register-register.
-//===----------------------------------------------------------------------===//
-
-let isSimpleLoad = 1 in {
- class LoadDFormVec<ValueType vectype>
- : RI10Form<0b00101100, (outs VECREG:$rT), (ins memri10:$src),
- "lqd\t$rT, $src",
- LoadStore,
- [(set (vectype VECREG:$rT), (load dform_addr:$src))]>
- { }
-
- class LoadDForm<RegisterClass rclass>
- : RI10Form<0b00101100, (outs rclass:$rT), (ins memri10:$src),
- "lqd\t$rT, $src",
- LoadStore,
- [(set rclass:$rT, (load dform_addr:$src))]>
- { }
-
- multiclass LoadDForms
- {
- def v16i8: LoadDFormVec<v16i8>;
- def v8i16: LoadDFormVec<v8i16>;
- def v4i32: LoadDFormVec<v4i32>;
- def v2i64: LoadDFormVec<v2i64>;
- def v4f32: LoadDFormVec<v4f32>;
- def v2f64: LoadDFormVec<v2f64>;
-
- def r128: LoadDForm<GPRC>;
- def r64: LoadDForm<R64C>;
- def r32: LoadDForm<R32C>;
- def f32: LoadDForm<R32FP>;
- def f64: LoadDForm<R64FP>;
- def r16: LoadDForm<R16C>;
- def r8: LoadDForm<R8C>;
- }
-
- class LoadAFormVec<ValueType vectype>
- : RI16Form<0b100001100, (outs VECREG:$rT), (ins addr256k:$src),
- "lqa\t$rT, $src",
- LoadStore,
- [(set (vectype VECREG:$rT), (load aform_addr:$src))]>
- { }
-
- class LoadAForm<RegisterClass rclass>
- : RI16Form<0b100001100, (outs rclass:$rT), (ins addr256k:$src),
- "lqa\t$rT, $src",
- LoadStore,
- [(set rclass:$rT, (load aform_addr:$src))]>
- { }
-
- multiclass LoadAForms
- {
- def v16i8: LoadAFormVec<v16i8>;
- def v8i16: LoadAFormVec<v8i16>;
- def v4i32: LoadAFormVec<v4i32>;
- def v2i64: LoadAFormVec<v2i64>;
- def v4f32: LoadAFormVec<v4f32>;
- def v2f64: LoadAFormVec<v2f64>;
-
- def r128: LoadAForm<GPRC>;
- def r64: LoadAForm<R64C>;
- def r32: LoadAForm<R32C>;
- def f32: LoadAForm<R32FP>;
- def f64: LoadAForm<R64FP>;
- def r16: LoadAForm<R16C>;
- def r8: LoadAForm<R8C>;
- }
-
- class LoadXFormVec<ValueType vectype>
- : RRForm<0b00100011100, (outs VECREG:$rT), (ins memrr:$src),
- "lqx\t$rT, $src",
- LoadStore,
- [(set (vectype VECREG:$rT), (load xform_addr:$src))]>
- { }
-
- class LoadXForm<RegisterClass rclass>
- : RRForm<0b00100011100, (outs rclass:$rT), (ins memrr:$src),
- "lqx\t$rT, $src",
- LoadStore,
- [(set rclass:$rT, (load xform_addr:$src))]>
- { }
-
- multiclass LoadXForms
- {
- def v16i8: LoadXFormVec<v16i8>;
- def v8i16: LoadXFormVec<v8i16>;
- def v4i32: LoadXFormVec<v4i32>;
- def v2i64: LoadXFormVec<v2i64>;
- def v4f32: LoadXFormVec<v4f32>;
- def v2f64: LoadXFormVec<v2f64>;
-
- def r128: LoadXForm<GPRC>;
- def r64: LoadXForm<R64C>;
- def r32: LoadXForm<R32C>;
- def f32: LoadXForm<R32FP>;
- def f64: LoadXForm<R64FP>;
- def r16: LoadXForm<R16C>;
- def r8: LoadXForm<R8C>;
- }
-
- defm LQA : LoadAForms;
- defm LQD : LoadDForms;
- defm LQX : LoadXForms;
-
-/* Load quadword, PC relative: Not much use at this point in time.
- Might be of use later for relocatable code. It's effectively the
- same as LQA, but uses PC-relative addressing.
- def LQR : RI16Form<0b111001100, (outs VECREG:$rT), (ins s16imm:$disp),
- "lqr\t$rT, $disp", LoadStore,
- [(set VECREG:$rT, (load iaddr:$disp))]>;
- */
-}
-
-//===----------------------------------------------------------------------===//
-// Stores:
-//===----------------------------------------------------------------------===//
-class StoreDFormVec<ValueType vectype>
- : RI10Form<0b00100100, (outs), (ins VECREG:$rT, memri10:$src),
- "stqd\t$rT, $src",
- LoadStore,
- [(store (vectype VECREG:$rT), dform_addr:$src)]>
-{ }
-
-class StoreDForm<RegisterClass rclass>
- : RI10Form<0b00100100, (outs), (ins rclass:$rT, memri10:$src),
- "stqd\t$rT, $src",
- LoadStore,
- [(store rclass:$rT, dform_addr:$src)]>
-{ }
-
-multiclass StoreDForms
-{
- def v16i8: StoreDFormVec<v16i8>;
- def v8i16: StoreDFormVec<v8i16>;
- def v4i32: StoreDFormVec<v4i32>;
- def v2i64: StoreDFormVec<v2i64>;
- def v4f32: StoreDFormVec<v4f32>;
- def v2f64: StoreDFormVec<v2f64>;
-
- def r128: StoreDForm<GPRC>;
- def r64: StoreDForm<R64C>;
- def r32: StoreDForm<R32C>;
- def f32: StoreDForm<R32FP>;
- def f64: StoreDForm<R64FP>;
- def r16: StoreDForm<R16C>;
- def r8: StoreDForm<R8C>;
-}
-
-class StoreAFormVec<ValueType vectype>
- : RI16Form<0b0010010, (outs), (ins VECREG:$rT, addr256k:$src),
- "stqa\t$rT, $src",
- LoadStore,
- [(store (vectype VECREG:$rT), aform_addr:$src)]>;
-
-class StoreAForm<RegisterClass rclass>
- : RI16Form<0b001001, (outs), (ins rclass:$rT, addr256k:$src),
- "stqa\t$rT, $src",
- LoadStore,
- [(store rclass:$rT, aform_addr:$src)]>;
-
-multiclass StoreAForms
-{
- def v16i8: StoreAFormVec<v16i8>;
- def v8i16: StoreAFormVec<v8i16>;
- def v4i32: StoreAFormVec<v4i32>;
- def v2i64: StoreAFormVec<v2i64>;
- def v4f32: StoreAFormVec<v4f32>;
- def v2f64: StoreAFormVec<v2f64>;
-
- def r128: StoreAForm<GPRC>;
- def r64: StoreAForm<R64C>;
- def r32: StoreAForm<R32C>;
- def f32: StoreAForm<R32FP>;
- def f64: StoreAForm<R64FP>;
- def r16: StoreAForm<R16C>;
- def r8: StoreAForm<R8C>;
-}
-
-class StoreXFormVec<ValueType vectype>
- : RRForm<0b00100100, (outs), (ins VECREG:$rT, memrr:$src),
- "stqx\t$rT, $src",
- LoadStore,
- [(store (vectype VECREG:$rT), xform_addr:$src)]>
-{ }
-
-class StoreXForm<RegisterClass rclass>
- : RRForm<0b00100100, (outs), (ins rclass:$rT, memrr:$src),
- "stqx\t$rT, $src",
- LoadStore,
- [(store rclass:$rT, xform_addr:$src)]>
-{ }
-
-multiclass StoreXForms
-{
- def v16i8: StoreXFormVec<v16i8>;
- def v8i16: StoreXFormVec<v8i16>;
- def v4i32: StoreXFormVec<v4i32>;
- def v2i64: StoreXFormVec<v2i64>;
- def v4f32: StoreXFormVec<v4f32>;
- def v2f64: StoreXFormVec<v2f64>;
-
- def r128: StoreXForm<GPRC>;
- def r64: StoreXForm<R64C>;
- def r32: StoreXForm<R32C>;
- def f32: StoreXForm<R32FP>;
- def f64: StoreXForm<R64FP>;
- def r16: StoreXForm<R16C>;
- def r8: StoreXForm<R8C>;
-}
-
-defm STQD : StoreDForms;
-defm STQA : StoreAForms;
-defm STQX : StoreXForms;
-
-/* Store quadword, PC relative: Not much use at this point in time. Might
- be useful for relocatable code.
-def STQR : RI16Form<0b111000100, (outs), (ins VECREG:$rT, s16imm:$disp),
- "stqr\t$rT, $disp", LoadStore,
- [(store VECREG:$rT, iaddr:$disp)]>;
-*/
-
-//===----------------------------------------------------------------------===//
-// Generate Controls for Insertion:
-//===----------------------------------------------------------------------===//
-
-def CBD :
- RI7Form<0b10101111100, (outs VECREG:$rT), (ins memri7:$src),
- "cbd\t$rT, $src", ShuffleOp,
- [(set (v16i8 VECREG:$rT), (SPUvecinsmask dform2_addr:$src))]>;
-
-def CBX : RRForm<0b00101011100, (outs VECREG:$rT), (ins memrr:$src),
- "cbx\t$rT, $src", ShuffleOp,
- [(set (v16i8 VECREG:$rT), (SPUvecinsmask xform_addr:$src))]>;
-
-def CHD : RI7Form<0b10101111100, (outs VECREG:$rT), (ins memri7:$src),
- "chd\t$rT, $src", ShuffleOp,
- [(set (v8i16 VECREG:$rT), (SPUvecinsmask dform2_addr:$src))]>;
-
-def CHX : RRForm<0b10101011100, (outs VECREG:$rT), (ins memrr:$src),
- "chx\t$rT, $src", ShuffleOp,
- [(set (v8i16 VECREG:$rT), (SPUvecinsmask xform_addr:$src))]>;
-
-def CWD : RI7Form<0b01101111100, (outs VECREG:$rT), (ins memri7:$src),
- "cwd\t$rT, $src", ShuffleOp,
- [(set (v4i32 VECREG:$rT), (SPUvecinsmask dform2_addr:$src))]>;
-
-def CWDf32 : RI7Form<0b01101111100, (outs VECREG:$rT), (ins memri7:$src),
- "cwd\t$rT, $src", ShuffleOp,
- [(set (v4f32 VECREG:$rT), (SPUvecinsmask dform2_addr:$src))]>;
-
-def CWX : RRForm<0b01101011100, (outs VECREG:$rT), (ins memrr:$src),
- "cwx\t$rT, $src", ShuffleOp,
- [(set (v4i32 VECREG:$rT), (SPUvecinsmask xform_addr:$src))]>;
-
-def CWXf32 : RRForm<0b01101011100, (outs VECREG:$rT), (ins memrr:$src),
- "cwx\t$rT, $src", ShuffleOp,
- [(set (v4f32 VECREG:$rT), (SPUvecinsmask xform_addr:$src))]>;
-
-def CDD : RI7Form<0b11101111100, (outs VECREG:$rT), (ins memri7:$src),
- "cdd\t$rT, $src", ShuffleOp,
- [(set (v2i64 VECREG:$rT), (SPUvecinsmask dform2_addr:$src))]>;
-
-def CDDf64 : RI7Form<0b11101111100, (outs VECREG:$rT), (ins memri7:$src),
- "cdd\t$rT, $src", ShuffleOp,
- [(set (v2f64 VECREG:$rT), (SPUvecinsmask dform2_addr:$src))]>;
-
-def CDX : RRForm<0b11101011100, (outs VECREG:$rT), (ins memrr:$src),
- "cdx\t$rT, $src", ShuffleOp,
- [(set (v2i64 VECREG:$rT), (SPUvecinsmask xform_addr:$src))]>;
-
-def CDXf64 : RRForm<0b11101011100, (outs VECREG:$rT), (ins memrr:$src),
- "cdx\t$rT, $src", ShuffleOp,
- [(set (v2f64 VECREG:$rT), (SPUvecinsmask xform_addr:$src))]>;
-
-//===----------------------------------------------------------------------===//
-// Constant formation:
-//===----------------------------------------------------------------------===//
-
-def ILHv8i16:
- RI16Form<0b110000010, (outs VECREG:$rT), (ins s16imm:$val),
- "ilh\t$rT, $val", ImmLoad,
- [(set (v8i16 VECREG:$rT), (v8i16 v8i16SExt16Imm:$val))]>;
-
-def ILHr16:
- RI16Form<0b110000010, (outs R16C:$rT), (ins s16imm:$val),
- "ilh\t$rT, $val", ImmLoad,
- [(set R16C:$rT, immSExt16:$val)]>;
-
-// Cell SPU doesn't have a native 8-bit immediate load, but ILH works ("with
-// the right constant")
-def ILHr8:
- RI16Form<0b110000010, (outs R8C:$rT), (ins s16imm_i8:$val),
- "ilh\t$rT, $val", ImmLoad,
- [(set R8C:$rT, immSExt8:$val)]>;
-
-// IL does sign extension!
-
-class ILInst<dag OOL, dag IOL, list<dag> pattern>:
- RI16Form<0b100000010, OOL, IOL, "il\t$rT, $val",
- ImmLoad, pattern>;
-
-class ILVecInst<ValueType vectype, Operand immtype, PatLeaf xform>:
- ILInst<(outs VECREG:$rT), (ins immtype:$val),
- [(set (vectype VECREG:$rT), (vectype xform:$val))]>;
-
-class ILRegInst<RegisterClass rclass, Operand immtype, PatLeaf xform>:
- ILInst<(outs rclass:$rT), (ins immtype:$val),
- [(set rclass:$rT, xform:$val)]>;
-
-multiclass ImmediateLoad
-{
- def v2i64: ILVecInst<v2i64, s16imm_i64, v2i64SExt16Imm>;
- def v4i32: ILVecInst<v4i32, s16imm_i32, v4i32SExt16Imm>;
-
- // TODO: Need v2f64, v4f32
-
- def r64: ILRegInst<R64C, s16imm_i64, immSExt16>;
- def r32: ILRegInst<R32C, s16imm_i32, immSExt16>;
- def f32: ILRegInst<R32FP, s16imm_f32, fpimmSExt16>;
- def f64: ILRegInst<R64FP, s16imm_f64, fpimmSExt16>;
-}
-
-defm IL : ImmediateLoad;
-
-class ILHUInst<dag OOL, dag IOL, list<dag> pattern>:
- RI16Form<0b010000010, OOL, IOL, "ilhu\t$rT, $val",
- ImmLoad, pattern>;
-
-class ILHUVecInst<ValueType vectype, Operand immtype, PatLeaf xform>:
- ILHUInst<(outs VECREG:$rT), (ins immtype:$val),
- [(set (vectype VECREG:$rT), (vectype xform:$val))]>;
-
-class ILHURegInst<RegisterClass rclass, Operand immtype, PatLeaf xform>:
- ILHUInst<(outs rclass:$rT), (ins immtype:$val),
- [(set rclass:$rT, xform:$val)]>;
-
-multiclass ImmLoadHalfwordUpper
-{
- def v2i64: ILHUVecInst<v2i64, u16imm_i64, immILHUvec_i64>;
- def v4i32: ILHUVecInst<v4i32, u16imm_i32, immILHUvec>;
-
- def r64: ILHURegInst<R64C, u16imm_i64, hi16>;
- def r32: ILHURegInst<R32C, u16imm_i32, hi16>;
-
- // Loads the high portion of an address
- def hi: ILHURegInst<R32C, symbolHi, hi16>;
-
- // Used in custom lowering constant SFP loads:
- def f32: ILHURegInst<R32FP, f16imm, hi16_f32>;
-}
-
-defm ILHU : ImmLoadHalfwordUpper;
-
-// Immediate load address (can also be used to load 18-bit unsigned constants,
-// see the zext 16->32 pattern)
-
-class ILAInst<dag OOL, dag IOL, list<dag> pattern>:
- RI18Form<0b1000010, OOL, IOL, "ila\t$rT, $val",
- LoadNOP, pattern>;
-
-class ILAVecInst<ValueType vectype, Operand immtype, PatLeaf xform>:
- ILAInst<(outs VECREG:$rT), (ins immtype:$val),
- [(set (vectype VECREG:$rT), (vectype xform:$val))]>;
-
-class ILARegInst<RegisterClass rclass, Operand immtype, PatLeaf xform>:
- ILAInst<(outs rclass:$rT), (ins immtype:$val),
- [(set rclass:$rT, xform:$val)]>;
-
-multiclass ImmLoadAddress
-{
- def v2i64: ILAVecInst<v2i64, u18imm, v2i64Uns18Imm>;
- def v4i32: ILAVecInst<v4i32, u18imm, v4i32Uns18Imm>;
-
- def r64: ILARegInst<R64C, u18imm_i64, imm18>;
- def r32: ILARegInst<R32C, u18imm, imm18>;
- def f32: ILARegInst<R32FP, f18imm, fpimm18>;
- def f64: ILARegInst<R64FP, f18imm_f64, fpimm18>;
-
- def lo: ILARegInst<R32C, symbolLo, imm18>;
-
- def lsa: ILAInst<(outs R32C:$rT), (ins symbolLSA:$val),
- [/* no pattern */]>;
-}
-
-defm ILA : ImmLoadAddress;
-
-// Immediate OR, Halfword Lower: The "other" part of loading large constants
-// into 32-bit registers. See the anonymous pattern Pat<(i32 imm:$imm), ...>
-// Note that these are really two operand instructions, but they're encoded
-// as three operands with the first two arguments tied-to each other.
-
-class IOHLInst<dag OOL, dag IOL, list<dag> pattern>:
- RI16Form<0b100000110, OOL, IOL, "iohl\t$rT, $val",
- ImmLoad, pattern>,
- RegConstraint<"$rS = $rT">,
- NoEncode<"$rS">;
-
-class IOHLVecInst<ValueType vectype, Operand immtype /* , PatLeaf xform */>:
- IOHLInst<(outs VECREG:$rT), (ins VECREG:$rS, immtype:$val),
- [/* no pattern */]>;
-
-class IOHLRegInst<RegisterClass rclass, Operand immtype /* , PatLeaf xform */>:
- IOHLInst<(outs rclass:$rT), (ins rclass:$rS, immtype:$val),
- [/* no pattern */]>;
-
-multiclass ImmOrHalfwordLower
-{
- def v2i64: IOHLVecInst<v2i64, u16imm_i64>;
- def v4i32: IOHLVecInst<v4i32, u16imm_i32>;
-
- def r32: IOHLRegInst<R32C, i32imm>;
- def f32: IOHLRegInst<R32FP, f32imm>;
-
- def lo: IOHLRegInst<R32C, symbolLo>;
-}
-
-defm IOHL: ImmOrHalfwordLower;
-
-// Form select mask for bytes using immediate, used in conjunction with the
-// SELB instruction:
-
-class FSMBIVec<ValueType vectype>:
- RI16Form<0b101001100, (outs VECREG:$rT), (ins u16imm:$val),
- "fsmbi\t$rT, $val",
- SelectOp,
- [(set (vectype VECREG:$rT), (SPUfsmbi (i16 immU16:$val)))]>;
-
-multiclass FormSelectMaskBytesImm
-{
- def v16i8: FSMBIVec<v16i8>;
- def v8i16: FSMBIVec<v8i16>;
- def v4i32: FSMBIVec<v4i32>;
- def v2i64: FSMBIVec<v2i64>;
-}
-
-defm FSMBI : FormSelectMaskBytesImm;
-
-// fsmb: Form select mask for bytes. N.B. Input operand, $rA, is 16-bits
-def FSMB:
- RRForm_1<0b01101101100, (outs VECREG:$rT), (ins R16C:$rA),
- "fsmb\t$rT, $rA", SelectOp,
- [(set (v16i8 VECREG:$rT), (SPUfsmbi R16C:$rA))]>;
-
-// fsmh: Form select mask for halfwords. N.B., Input operand, $rA, is
-// only 8-bits wide (even though it's input as 16-bits here)
-def FSMH:
- RRForm_1<0b10101101100, (outs VECREG:$rT), (ins R16C:$rA),
- "fsmh\t$rT, $rA", SelectOp,
- [(set (v8i16 VECREG:$rT), (SPUfsmbi R16C:$rA))]>;
-
-// fsm: Form select mask for words. Like the other fsm* instructions,
-// only the lower 4 bits of $rA are significant.
-def FSM:
- RRForm_1<0b00101101100, (outs VECREG:$rT), (ins R16C:$rA),
- "fsm\t$rT, $rA", SelectOp,
- [(set (v4i32 VECREG:$rT), (SPUfsmbi R16C:$rA))]>;
-
-//===----------------------------------------------------------------------===//
-// Integer and Logical Operations:
-//===----------------------------------------------------------------------===//
-
-def AHv8i16:
- RRForm<0b00010011000, (outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB),
- "ah\t$rT, $rA, $rB", IntegerOp,
- [(set (v8i16 VECREG:$rT), (int_spu_si_ah VECREG:$rA, VECREG:$rB))]>;
-
-def : Pat<(add (v8i16 VECREG:$rA), (v8i16 VECREG:$rB)),
- (AHv8i16 VECREG:$rA, VECREG:$rB)>;
-
-def AHr16:
- RRForm<0b00010011000, (outs R16C:$rT), (ins R16C:$rA, R16C:$rB),
- "ah\t$rT, $rA, $rB", IntegerOp,
- [(set R16C:$rT, (add R16C:$rA, R16C:$rB))]>;
-
-def AHIvec:
- RI10Form<0b10111000, (outs VECREG:$rT), (ins VECREG:$rA, s10imm:$val),
- "ahi\t$rT, $rA, $val", IntegerOp,
- [(set (v8i16 VECREG:$rT), (add (v8i16 VECREG:$rA),
- v8i16SExt10Imm:$val))]>;
-
-def AHIr16:
- RI10Form<0b10111000, (outs R16C:$rT), (ins R16C:$rA, s10imm:$val),
- "ahi\t$rT, $rA, $val", IntegerOp,
- [(set R16C:$rT, (add R16C:$rA, v8i16SExt10Imm:$val))]>;
-
-def Avec:
- RRForm<0b00000011000, (outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB),
- "a\t$rT, $rA, $rB", IntegerOp,
- [(set (v4i32 VECREG:$rT), (add (v4i32 VECREG:$rA), (v4i32 VECREG:$rB)))]>;
-
-def : Pat<(add (v16i8 VECREG:$rA), (v16i8 VECREG:$rB)),
- (Avec VECREG:$rA, VECREG:$rB)>;
-
-def Ar32:
- RRForm<0b00000011000, (outs R32C:$rT), (ins R32C:$rA, R32C:$rB),
- "a\t$rT, $rA, $rB", IntegerOp,
- [(set R32C:$rT, (add R32C:$rA, R32C:$rB))]>;
-
-def Ar8:
- RRForm<0b00000011000, (outs R8C:$rT), (ins R8C:$rA, R8C:$rB),
- "a\t$rT, $rA, $rB", IntegerOp,
- [(set R8C:$rT, (add R8C:$rA, R8C:$rB))]>;
-
-def AIvec:
- RI10Form<0b00111000, (outs VECREG:$rT), (ins VECREG:$rA, s10imm:$val),
- "ai\t$rT, $rA, $val", IntegerOp,
- [(set (v4i32 VECREG:$rT), (add (v4i32 VECREG:$rA),
- v4i32SExt10Imm:$val))]>;
-
-def AIr32:
- RI10Form<0b00111000, (outs R32C:$rT), (ins R32C:$rA, s10imm_i32:$val),
- "ai\t$rT, $rA, $val", IntegerOp,
- [(set R32C:$rT, (add R32C:$rA, i32ImmSExt10:$val))]>;
-
-def SFHvec:
- RRForm<0b00010010000, (outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB),
- "sfh\t$rT, $rA, $rB", IntegerOp,
- [(set (v8i16 VECREG:$rT), (sub (v8i16 VECREG:$rA),
- (v8i16 VECREG:$rB)))]>;
-
-def SFHr16:
- RRForm<0b00010010000, (outs R16C:$rT), (ins R16C:$rA, R16C:$rB),
- "sfh\t$rT, $rA, $rB", IntegerOp,
- [(set R16C:$rT, (sub R16C:$rA, R16C:$rB))]>;
-
-def SFHIvec:
- RI10Form<0b10110000, (outs VECREG:$rT), (ins VECREG:$rA, s10imm:$val),
- "sfhi\t$rT, $rA, $val", IntegerOp,
- [(set (v8i16 VECREG:$rT), (sub v8i16SExt10Imm:$val,
- (v8i16 VECREG:$rA)))]>;
-
-def SFHIr16 : RI10Form<0b10110000, (outs R16C:$rT), (ins R16C:$rA, s10imm:$val),
- "sfhi\t$rT, $rA, $val", IntegerOp,
- [(set R16C:$rT, (sub i16ImmSExt10:$val, R16C:$rA))]>;
-
-def SFvec : RRForm<0b00000010000, (outs VECREG:$rT),
- (ins VECREG:$rA, VECREG:$rB),
- "sf\t$rT, $rA, $rB", IntegerOp,
- [(set (v4i32 VECREG:$rT), (sub (v4i32 VECREG:$rA), (v4i32 VECREG:$rB)))]>;
-
-def SFr32 : RRForm<0b00000010000, (outs R32C:$rT), (ins R32C:$rA, R32C:$rB),
- "sf\t$rT, $rA, $rB", IntegerOp,
- [(set R32C:$rT, (sub R32C:$rA, R32C:$rB))]>;
-
-def SFIvec:
- RI10Form<0b00110000, (outs VECREG:$rT), (ins VECREG:$rA, s10imm:$val),
- "sfi\t$rT, $rA, $val", IntegerOp,
- [(set (v4i32 VECREG:$rT), (sub v4i32SExt10Imm:$val,
- (v4i32 VECREG:$rA)))]>;
-
-def SFIr32 : RI10Form<0b00110000, (outs R32C:$rT),
- (ins R32C:$rA, s10imm_i32:$val),
- "sfi\t$rT, $rA, $val", IntegerOp,
- [(set R32C:$rT, (sub i32ImmSExt10:$val, R32C:$rA))]>;
-
-// ADDX: only available in vector form, doesn't match a pattern.
-def ADDXvec:
- RRForm<0b00000010110, (outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB,
- VECREG:$rCarry),
- "addx\t$rT, $rA, $rB", IntegerOp,
- []>,
- RegConstraint<"$rCarry = $rT">,
- NoEncode<"$rCarry">;
-
-// CG: only available in vector form, doesn't match a pattern.
-def CGvec:
- RRForm<0b01000011000, (outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB,
- VECREG:$rCarry),
- "cg\t$rT, $rA, $rB", IntegerOp,
- []>,
- RegConstraint<"$rCarry = $rT">,
- NoEncode<"$rCarry">;
-
-// SFX: only available in vector form, doesn't match a pattern
-def SFXvec:
- RRForm<0b10000010110, (outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB,
- VECREG:$rCarry),
- "sfx\t$rT, $rA, $rB", IntegerOp,
- []>,
- RegConstraint<"$rCarry = $rT">,
- NoEncode<"$rCarry">;
-
-// BG: only available in vector form, doesn't match a pattern.
-def BGvec:
- RRForm<0b01000010000, (outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB,
- VECREG:$rCarry),
- "bg\t$rT, $rA, $rB", IntegerOp,
- []>,
- RegConstraint<"$rCarry = $rT">,
- NoEncode<"$rCarry">;
-
-// BGX: only available in vector form, doesn't match a pattern.
-def BGXvec:
- RRForm<0b11000010110, (outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB,
- VECREG:$rCarry),
- "bgx\t$rT, $rA, $rB", IntegerOp,
- []>,
- RegConstraint<"$rCarry = $rT">,
- NoEncode<"$rCarry">;
-
-// Halfword multiply variants:
-// N.B: These can be used to build up larger quantities (16x16 -> 32)
-
-def MPYv8i16:
- RRForm<0b00100011110, (outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB),
- "mpy\t$rT, $rA, $rB", IntegerMulDiv,
- [(set (v8i16 VECREG:$rT), (SPUmpy_v8i16 (v8i16 VECREG:$rA),
- (v8i16 VECREG:$rB)))]>;
-
-def MPYr16:
- RRForm<0b00100011110, (outs R16C:$rT), (ins R16C:$rA, R16C:$rB),
- "mpy\t$rT, $rA, $rB", IntegerMulDiv,
- [(set R16C:$rT, (mul R16C:$rA, R16C:$rB))]>;
-
-def MPYUv4i32:
- RRForm<0b00110011110, (outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB),
- "mpyu\t$rT, $rA, $rB", IntegerMulDiv,
- [(set (v4i32 VECREG:$rT),
- (SPUmpyu_v4i32 (v4i32 VECREG:$rA), (v4i32 VECREG:$rB)))]>;
-
-def MPYUr16:
- RRForm<0b00110011110, (outs R32C:$rT), (ins R16C:$rA, R16C:$rB),
- "mpyu\t$rT, $rA, $rB", IntegerMulDiv,
- [(set R32C:$rT, (mul (zext R16C:$rA),
- (zext R16C:$rB)))]>;
-
-def MPYUr32:
- RRForm<0b00110011110, (outs R32C:$rT), (ins R32C:$rA, R32C:$rB),
- "mpyu\t$rT, $rA, $rB", IntegerMulDiv,
- [(set R32C:$rT, (SPUmpyu_i32 R32C:$rA, R32C:$rB))]>;
-
-// mpyi: multiply 16 x s10imm -> 32 result (custom lowering for 32 bit result,
-// this only produces the lower 16 bits)
-def MPYIvec:
- RI10Form<0b00101110, (outs VECREG:$rT), (ins VECREG:$rA, s10imm:$val),
- "mpyi\t$rT, $rA, $val", IntegerMulDiv,
- [(set (v8i16 VECREG:$rT), (mul (v8i16 VECREG:$rA), v8i16SExt10Imm:$val))]>;
-
-def MPYIr16:
- RI10Form<0b00101110, (outs R16C:$rT), (ins R16C:$rA, s10imm:$val),
- "mpyi\t$rT, $rA, $val", IntegerMulDiv,
- [(set R16C:$rT, (mul R16C:$rA, i16ImmSExt10:$val))]>;
-
-// mpyui: same issues as other multiplies, plus, this doesn't match a
-// pattern... but may be used during target DAG selection or lowering
-def MPYUIvec:
- RI10Form<0b10101110, (outs VECREG:$rT), (ins VECREG:$rA, s10imm:$val),
- "mpyui\t$rT, $rA, $val", IntegerMulDiv,
- []>;
-
-def MPYUIr16:
- RI10Form<0b10101110, (outs R16C:$rT), (ins R16C:$rA, s10imm:$val),
- "mpyui\t$rT, $rA, $val", IntegerMulDiv,
- []>;
-
-// mpya: 16 x 16 + 16 -> 32 bit result
-def MPYAvec:
- RRRForm<0b0011, (outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB, VECREG:$rC),
- "mpya\t$rT, $rA, $rB, $rC", IntegerMulDiv,
- [(set (v4i32 VECREG:$rT), (add (v4i32 (bitconvert (mul (v8i16 VECREG:$rA),
- (v8i16 VECREG:$rB)))),
- (v4i32 VECREG:$rC)))]>;
-
-def MPYAr32:
- RRRForm<0b0011, (outs R32C:$rT), (ins R16C:$rA, R16C:$rB, R32C:$rC),
- "mpya\t$rT, $rA, $rB, $rC", IntegerMulDiv,
- [(set R32C:$rT, (add (sext (mul R16C:$rA, R16C:$rB)),
- R32C:$rC))]>;
-
-def : Pat<(add (mul (sext R16C:$rA), (sext R16C:$rB)), R32C:$rC),
- (MPYAr32 R16C:$rA, R16C:$rB, R32C:$rC)>;
-
-def MPYAr32_sextinreg:
- RRRForm<0b0011, (outs R32C:$rT), (ins R32C:$rA, R32C:$rB, R32C:$rC),
- "mpya\t$rT, $rA, $rB, $rC", IntegerMulDiv,
- [(set R32C:$rT, (add (mul (sext_inreg R32C:$rA, i16),
- (sext_inreg R32C:$rB, i16)),
- R32C:$rC))]>;
-
-//def MPYAr32:
-// RRRForm<0b0011, (outs R32C:$rT), (ins R16C:$rA, R16C:$rB, R32C:$rC),
-// "mpya\t$rT, $rA, $rB, $rC", IntegerMulDiv,
-// [(set R32C:$rT, (add (sext (mul R16C:$rA, R16C:$rB)),
-// R32C:$rC))]>;
-
-// mpyh: multiply high, used to synthesize 32-bit multiplies
-def MPYHv4i32:
- RRForm<0b10100011110, (outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB),
- "mpyh\t$rT, $rA, $rB", IntegerMulDiv,
- [(set (v4i32 VECREG:$rT),
- (SPUmpyh_v4i32 (v4i32 VECREG:$rA), (v4i32 VECREG:$rB)))]>;
-
-def MPYHr32:
- RRForm<0b10100011110, (outs R32C:$rT), (ins R32C:$rA, R32C:$rB),
- "mpyh\t$rT, $rA, $rB", IntegerMulDiv,
- [(set R32C:$rT, (SPUmpyh_i32 R32C:$rA, R32C:$rB))]>;
-
-// mpys: multiply high and shift right (returns the top half of
-// a 16-bit multiply, sign extended to 32 bits.)
-def MPYSvec:
- RRForm<0b11100011110, (outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB),
- "mpys\t$rT, $rA, $rB", IntegerMulDiv,
- []>;
-
-def MPYSr16:
- RRForm<0b11100011110, (outs R32C:$rT), (ins R16C:$rA, R16C:$rB),
- "mpys\t$rT, $rA, $rB", IntegerMulDiv,
- []>;
-
-// mpyhh: multiply high-high (returns the 32-bit result from multiplying
-// the top 16 bits of the $rA, $rB)
-def MPYHHv8i16:
- RRForm<0b01100011110, (outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB),
- "mpyhh\t$rT, $rA, $rB", IntegerMulDiv,
- [(set (v8i16 VECREG:$rT),
- (SPUmpyhh_v8i16 (v8i16 VECREG:$rA), (v8i16 VECREG:$rB)))]>;
-
-def MPYHHr32:
- RRForm<0b01100011110, (outs R32C:$rT), (ins R32C:$rA, R32C:$rB),
- "mpyhh\t$rT, $rA, $rB", IntegerMulDiv,
- []>;
-
-// mpyhha: Multiply high-high, add to $rT:
-def MPYHHAvec:
- RRForm<0b01100010110, (outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB),
- "mpyhha\t$rT, $rA, $rB", IntegerMulDiv,
- []>;
-
-def MPYHHAr32:
- RRForm<0b01100010110, (outs R32C:$rT), (ins R32C:$rA, R32C:$rB),
- "mpyhha\t$rT, $rA, $rB", IntegerMulDiv,
- []>;
-
-// mpyhhu: Multiply high-high, unsigned
-def MPYHHUvec:
- RRForm<0b01110011110, (outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB),
- "mpyhhu\t$rT, $rA, $rB", IntegerMulDiv,
- []>;
-
-def MPYHHUr32:
- RRForm<0b01110011110, (outs R32C:$rT), (ins R32C:$rA, R32C:$rB),
- "mpyhhu\t$rT, $rA, $rB", IntegerMulDiv,
- []>;
-
-// mpyhhau: Multiply high-high, unsigned
-def MPYHHAUvec:
- RRForm<0b01110010110, (outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB),
- "mpyhhau\t$rT, $rA, $rB", IntegerMulDiv,
- []>;
-
-def MPYHHAUr32:
- RRForm<0b01110010110, (outs R32C:$rT), (ins R32C:$rA, R32C:$rB),
- "mpyhhau\t$rT, $rA, $rB", IntegerMulDiv,
- []>;
-
-// clz: Count leading zeroes
-def CLZv4i32:
- RRForm_1<0b10100101010, (outs VECREG:$rT), (ins VECREG:$rA),
- "clz\t$rT, $rA", IntegerOp,
- [/* intrinsic */]>;
-
-def CLZr32:
- RRForm_1<0b10100101010, (outs R32C:$rT), (ins R32C:$rA),
- "clz\t$rT, $rA", IntegerOp,
- [(set R32C:$rT, (ctlz R32C:$rA))]>;
-
-// cntb: Count ones in bytes (aka "population count")
-// NOTE: This instruction is really a vector instruction, but the custom
-// lowering code uses it in unorthodox ways to support CTPOP for other
-// data types!
-def CNTBv16i8:
- RRForm_1<0b00101101010, (outs VECREG:$rT), (ins VECREG:$rA),
- "cntb\t$rT, $rA", IntegerOp,
- [(set (v16i8 VECREG:$rT), (SPUcntb_v16i8 (v16i8 VECREG:$rA)))]>;
-
-def CNTBv8i16 :
- RRForm_1<0b00101101010, (outs VECREG:$rT), (ins VECREG:$rA),
- "cntb\t$rT, $rA", IntegerOp,
- [(set (v8i16 VECREG:$rT), (SPUcntb_v8i16 (v8i16 VECREG:$rA)))]>;
-
-def CNTBv4i32 :
- RRForm_1<0b00101101010, (outs VECREG:$rT), (ins VECREG:$rA),
- "cntb\t$rT, $rA", IntegerOp,
- [(set (v4i32 VECREG:$rT), (SPUcntb_v4i32 (v4i32 VECREG:$rA)))]>;
-
-// gbb: Gather all low order bits from each byte in $rA into a single 16-bit
-// quantity stored into $rT
-def GBB:
- RRForm_1<0b01001101100, (outs R16C:$rT), (ins VECREG:$rA),
- "gbb\t$rT, $rA", GatherOp,
- []>;
-
-// gbh: Gather all low order bits from each halfword in $rA into a single
-// 8-bit quantity stored in $rT
-def GBH:
- RRForm_1<0b10001101100, (outs R16C:$rT), (ins VECREG:$rA),
- "gbh\t$rT, $rA", GatherOp,
- []>;
-
-// gb: Gather all low order bits from each word in $rA into a single
-// 4-bit quantity stored in $rT
-def GB:
- RRForm_1<0b00001101100, (outs R16C:$rT), (ins VECREG:$rA),
- "gb\t$rT, $rA", GatherOp,
- []>;
-
-// avgb: average bytes
-def AVGB:
- RRForm<0b11001011000, (outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB),
- "avgb\t$rT, $rA, $rB", ByteOp,
- []>;
-
-// absdb: absolute difference of bytes
-def ABSDB:
- RRForm<0b11001010000, (outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB),
- "absdb\t$rT, $rA, $rB", ByteOp,
- []>;
-
-// sumb: sum bytes into halfwords
-def SUMB:
- RRForm<0b11001010010, (outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB),
- "sumb\t$rT, $rA, $rB", ByteOp,
- []>;
-
-// Sign extension operations:
-def XSBHvec:
- RRForm_1<0b01101101010, (outs VECREG:$rDst), (ins VECREG:$rSrc),
- "xsbh\t$rDst, $rSrc", IntegerOp,
- [(set (v8i16 VECREG:$rDst), (sext (v16i8 VECREG:$rSrc)))]>;
-
-// Ordinary form for XSBH
-def XSBHr16:
- RRForm_1<0b01101101010, (outs R16C:$rDst), (ins R16C:$rSrc),
- "xsbh\t$rDst, $rSrc", IntegerOp,
- [(set R16C:$rDst, (sext_inreg R16C:$rSrc, i8))]>;
-
-def XSBHr8:
- RRForm_1<0b01101101010, (outs R16C:$rDst), (ins R8C:$rSrc),
- "xsbh\t$rDst, $rSrc", IntegerOp,
- [(set R16C:$rDst, (sext R8C:$rSrc))]>;
-
-// 32-bit form for XSBH: used to sign extend 8-bit quantities to 16-bit
-// quantities to 32-bit quantities via a 32-bit register (see the sext 8->32
-// pattern below). Intentionally doesn't match a pattern because we want the
-// sext 8->32 pattern to do the work for us, namely because we need the extra
-// XSHWr32.
-def XSBHr32:
- RRForm_1<0b01101101010, (outs R32C:$rDst), (ins R32C:$rSrc),
- "xsbh\t$rDst, $rSrc", IntegerOp,
- [(set R32C:$rDst, (sext_inreg R32C:$rSrc, i8))]>;
-
-// Sign extend halfwords to words:
-def XSHWvec:
- RRForm_1<0b01101101010, (outs VECREG:$rDest), (ins VECREG:$rSrc),
- "xshw\t$rDest, $rSrc", IntegerOp,
- [(set (v4i32 VECREG:$rDest), (sext (v8i16 VECREG:$rSrc)))]>;
-
-def XSHWr32:
- RRForm_1<0b01101101010, (outs R32C:$rDst), (ins R32C:$rSrc),
- "xshw\t$rDst, $rSrc", IntegerOp,
- [(set R32C:$rDst, (sext_inreg R32C:$rSrc, i16))]>;
-
-def XSHWr16:
- RRForm_1<0b01101101010, (outs R32C:$rDst), (ins R16C:$rSrc),
- "xshw\t$rDst, $rSrc", IntegerOp,
- [(set R32C:$rDst, (sext R16C:$rSrc))]>;
-
-def XSWDvec:
- RRForm_1<0b01100101010, (outs VECREG:$rDst), (ins VECREG:$rSrc),
- "xswd\t$rDst, $rSrc", IntegerOp,
- [(set (v2i64 VECREG:$rDst), (sext (v4i32 VECREG:$rSrc)))]>;
-
-def XSWDr64:
- RRForm_1<0b01100101010, (outs R64C:$rDst), (ins R64C:$rSrc),
- "xswd\t$rDst, $rSrc", IntegerOp,
- [(set R64C:$rDst, (sext_inreg R64C:$rSrc, i32))]>;
-
-def XSWDr32:
- RRForm_1<0b01100101010, (outs R64C:$rDst), (ins R32C:$rSrc),
- "xswd\t$rDst, $rSrc", IntegerOp,
- [(set R64C:$rDst, (SPUsext32_to_64 R32C:$rSrc))]>;
-
-def : Pat<(sext R32C:$inp),
- (XSWDr32 R32C:$inp)>;
-
-// AND operations
-
-class ANDInst<dag OOL, dag IOL, list<dag> pattern> :
- RRForm<0b10000011000, OOL, IOL, "and\t$rT, $rA, $rB",
- IntegerOp, pattern>;
-
-class ANDVecInst<ValueType vectype>:
- ANDInst<(outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB),
- [(set (vectype VECREG:$rT), (and (vectype VECREG:$rA),
- (vectype VECREG:$rB)))]>;
-
-class ANDRegInst<RegisterClass rclass>:
- ANDInst<(outs rclass:$rT), (ins rclass:$rA, rclass:$rB),
- [(set rclass:$rT, (and rclass:$rA, rclass:$rB))]>;
-
-multiclass BitwiseAnd
-{
- def v16i8: ANDVecInst<v16i8>;
- def v8i16: ANDVecInst<v8i16>;
- def v4i32: ANDVecInst<v4i32>;
- def v2i64: ANDVecInst<v2i64>;
-
- def r128: ANDRegInst<GPRC>;
- def r64: ANDRegInst<R64C>;
- def r32: ANDRegInst<R32C>;
- def r16: ANDRegInst<R16C>;
- def r8: ANDRegInst<R8C>;
-
- //===---------------------------------------------
- // Special instructions to perform the fabs instruction
- def fabs32: ANDInst<(outs R32FP:$rT), (ins R32FP:$rA, R32C:$rB),
- [/* Intentionally does not match a pattern */]>;
-
- def fabs64: ANDInst<(outs R64FP:$rT), (ins R64FP:$rA, VECREG:$rB),
- [/* Intentionally does not match a pattern */]>;
-
- // Could use v4i32, but won't for clarity
- def fabsvec: ANDInst<(outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB),
- [/* Intentionally does not match a pattern */]>;
-
- //===---------------------------------------------
-
- // Hacked form of AND to zero-extend 16-bit quantities to 32-bit
- // quantities -- see 16->32 zext pattern.
- //
- // This pattern is somewhat artificial, since it might match some
- // compiler generated pattern but it is unlikely to do so.
-
- def i16i32: ANDInst<(outs R32C:$rT), (ins R16C:$rA, R32C:$rB),
- [(set R32C:$rT, (and (zext R16C:$rA), R32C:$rB))]>;
-}
-
-defm AND : BitwiseAnd;
-
-// N.B.: vnot_conv is one of those special target selection pattern fragments,
-// in which we expect there to be a bit_convert on the constant. Bear in mind
-// that llvm translates "not <reg>" to "xor <reg>, -1" (or in this case, a
-// constant -1 vector.)
-
-class ANDCInst<dag OOL, dag IOL, list<dag> pattern>:
- RRForm<0b10000011010, OOL, IOL, "andc\t$rT, $rA, $rB",
- IntegerOp, pattern>;
-
-class ANDCVecInst<ValueType vectype>:
- ANDCInst<(outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB),
- [(set (vectype VECREG:$rT), (and (vectype VECREG:$rA),
- (vnot (vectype VECREG:$rB))))]>;
-
-class ANDCRegInst<RegisterClass rclass>:
- ANDCInst<(outs rclass:$rT), (ins rclass:$rA, rclass:$rB),
- [(set rclass:$rT, (and rclass:$rA, (not rclass:$rB)))]>;
-
-multiclass AndComplement
-{
- def v16i8: ANDCVecInst<v16i8>;
- def v8i16: ANDCVecInst<v8i16>;
- def v4i32: ANDCVecInst<v4i32>;
- def v2i64: ANDCVecInst<v2i64>;
-
- def r128: ANDCRegInst<GPRC>;
- def r64: ANDCRegInst<R64C>;
- def r32: ANDCRegInst<R32C>;
- def r16: ANDCRegInst<R16C>;
- def r8: ANDCRegInst<R8C>;
-}
-
-defm ANDC : AndComplement;
-
-class ANDBIInst<dag OOL, dag IOL, list<dag> pattern>:
- RI10Form<0b01101000, OOL, IOL, "andbi\t$rT, $rA, $val",
- IntegerOp, pattern>;
-
-multiclass AndByteImm
-{
- def v16i8: ANDBIInst<(outs VECREG:$rT), (ins VECREG:$rA, u10imm:$val),
- [(set (v16i8 VECREG:$rT),
- (and (v16i8 VECREG:$rA),
- (v16i8 v16i8U8Imm:$val)))]>;
-
- def r8: ANDBIInst<(outs R8C:$rT), (ins R8C:$rA, u10imm_i8:$val),
- [(set R8C:$rT, (and R8C:$rA, immU8:$val))]>;
-}
-
-defm ANDBI : AndByteImm;
-
-class ANDHIInst<dag OOL, dag IOL, list<dag> pattern> :
- RI10Form<0b10101000, OOL, IOL, "andhi\t$rT, $rA, $val",
- IntegerOp, pattern>;
-
-multiclass AndHalfwordImm
-{
- def v8i16: ANDHIInst<(outs VECREG:$rT), (ins VECREG:$rA, s10imm:$val),
- [(set (v8i16 VECREG:$rT),
- (and (v8i16 VECREG:$rA), v8i16SExt10Imm:$val))]>;
-
- def r16: ANDHIInst<(outs R16C:$rT), (ins R16C:$rA, u10imm:$val),
- [(set R16C:$rT, (and R16C:$rA, i16ImmUns10:$val))]>;
-
- // Zero-extend i8 to i16:
- def i8i16: ANDHIInst<(outs R16C:$rT), (ins R8C:$rA, u10imm:$val),
- [(set R16C:$rT, (and (zext R8C:$rA), i16ImmUns10:$val))]>;
-}
-
-defm ANDHI : AndHalfwordImm;
-
-class ANDIInst<dag OOL, dag IOL, list<dag> pattern> :
- RI10Form<0b00101000, OOL, IOL, "andi\t$rT, $rA, $val",
- IntegerOp, pattern>;
-
-multiclass AndWordImm
-{
- def v4i32: ANDIInst<(outs VECREG:$rT), (ins VECREG:$rA, s10imm:$val),
- [(set (v4i32 VECREG:$rT),
- (and (v4i32 VECREG:$rA), v4i32SExt10Imm:$val))]>;
-
- def r32: ANDIInst<(outs R32C:$rT), (ins R32C:$rA, s10imm_i32:$val),
- [(set R32C:$rT, (and R32C:$rA, i32ImmSExt10:$val))]>;
-
- // Hacked form of ANDI to zero-extend i8 quantities to i32. See the zext 8->32
- // pattern below.
- def i8i32: ANDIInst<(outs R32C:$rT), (ins R8C:$rA, s10imm_i32:$val),
- [(set R32C:$rT,
- (and (zext R8C:$rA), i32ImmSExt10:$val))]>;
-
- // Hacked form of ANDI to zero-extend i16 quantities to i32. See the
- // zext 16->32 pattern below.
- //
- // Note that this pattern is somewhat artificial, since it might match
- // something the compiler generates but is unlikely to occur in practice.
- def i16i32: ANDIInst<(outs R32C:$rT), (ins R16C:$rA, s10imm_i32:$val),
- [(set R32C:$rT,
- (and (zext R16C:$rA), i32ImmSExt10:$val))]>;
-}
-
-defm ANDI : AndWordImm;
-
-//-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
-// Bitwise OR group:
-//-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
-
-// Bitwise "or" (N.B.: These are also register-register copy instructions...)
-class ORInst<dag OOL, dag IOL, list<dag> pattern>:
- RRForm<0b10000010000, OOL, IOL, "or\t$rT, $rA, $rB",
- IntegerOp, pattern>;
-
-class ORVecInst<ValueType vectype>:
- ORInst<(outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB),
- [(set (vectype VECREG:$rT), (or (vectype VECREG:$rA),
- (vectype VECREG:$rB)))]>;
-
-class ORRegInst<RegisterClass rclass>:
- ORInst<(outs rclass:$rT), (ins rclass:$rA, rclass:$rB),
- [(set rclass:$rT, (or rclass:$rA, rclass:$rB))]>;
-
-class ORPromoteScalar<RegisterClass rclass>:
- ORInst<(outs VECREG:$rT), (ins rclass:$rA, rclass:$rB),
- [/* no pattern */]>;
-
-class ORExtractElt<RegisterClass rclass>:
- ORInst<(outs rclass:$rT), (ins VECREG:$rA, VECREG:$rB),
- [/* no pattern */]>;
-
-multiclass BitwiseOr
-{
- def v16i8: ORVecInst<v16i8>;
- def v8i16: ORVecInst<v8i16>;
- def v4i32: ORVecInst<v4i32>;
- def v2i64: ORVecInst<v2i64>;
-
- def v4f32: ORInst<(outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB),
- [(set (v4f32 VECREG:$rT),
- (v4f32 (bitconvert (or (v4i32 VECREG:$rA),
- (v4i32 VECREG:$rB)))))]>;
-
- def v2f64: ORInst<(outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB),
- [(set (v2f64 VECREG:$rT),
- (v2f64 (bitconvert (or (v2i64 VECREG:$rA),
- (v2i64 VECREG:$rB)))))]>;
-
- def r64: ORRegInst<R64C>;
- def r32: ORRegInst<R32C>;
- def r16: ORRegInst<R16C>;
- def r8: ORRegInst<R8C>;
-
- // OR instructions used to copy f32 and f64 registers.
- def f32: ORInst<(outs R32FP:$rT), (ins R32FP:$rA, R32FP:$rB),
- [/* no pattern */]>;
-
- def f64: ORInst<(outs R64FP:$rT), (ins R64FP:$rA, R64FP:$rB),
- [/* no pattern */]>;
-
- // scalar->vector promotion:
- def v16i8_i8: ORPromoteScalar<R8C>;
- def v8i16_i16: ORPromoteScalar<R16C>;
- def v4i32_i32: ORPromoteScalar<R32C>;
- def v2i64_i64: ORPromoteScalar<R64C>;
- def v4f32_f32: ORPromoteScalar<R32FP>;
- def v2f64_f64: ORPromoteScalar<R64FP>;
-
- // extract element 0:
- def i8_v16i8: ORExtractElt<R8C>;
- def i16_v8i16: ORExtractElt<R16C>;
- def i32_v4i32: ORExtractElt<R32C>;
- def i64_v2i64: ORExtractElt<R64C>;
- def f32_v4f32: ORExtractElt<R32FP>;
- def f64_v2f64: ORExtractElt<R64FP>;
-}
-
-defm OR : BitwiseOr;
-
-// scalar->vector promotion patterns:
-def : Pat<(v16i8 (SPUpromote_scalar R8C:$rA)),
- (ORv16i8_i8 R8C:$rA, R8C:$rA)>;
-
-def : Pat<(v8i16 (SPUpromote_scalar R16C:$rA)),
- (ORv8i16_i16 R16C:$rA, R16C:$rA)>;
-
-def : Pat<(v4i32 (SPUpromote_scalar R32C:$rA)),
- (ORv4i32_i32 R32C:$rA, R32C:$rA)>;
-
-def : Pat<(v2i64 (SPUpromote_scalar R64C:$rA)),
- (ORv2i64_i64 R64C:$rA, R64C:$rA)>;
-
-def : Pat<(v4f32 (SPUpromote_scalar R32FP:$rA)),
- (ORv4f32_f32 R32FP:$rA, R32FP:$rA)>;
-
-def : Pat<(v2f64 (SPUpromote_scalar R64FP:$rA)),
- (ORv2f64_f64 R64FP:$rA, R64FP:$rA)>;
-
-// ORi*_v*: Used to extract vector element 0 (the preferred slot)
-
-def : Pat<(SPUextract_elt0 (v16i8 VECREG:$rA)),
- (ORi8_v16i8 VECREG:$rA, VECREG:$rA)>;
-
-def : Pat<(SPUextract_elt0_chained (v16i8 VECREG:$rA)),
- (ORi8_v16i8 VECREG:$rA, VECREG:$rA)>;
-
-def : Pat<(SPUextract_elt0 (v8i16 VECREG:$rA)),
- (ORi16_v8i16 VECREG:$rA, VECREG:$rA)>;
-
-def : Pat<(SPUextract_elt0_chained (v8i16 VECREG:$rA)),
- (ORi16_v8i16 VECREG:$rA, VECREG:$rA)>;
-
-def : Pat<(SPUextract_elt0 (v4i32 VECREG:$rA)),
- (ORi32_v4i32 VECREG:$rA, VECREG:$rA)>;
-
-def : Pat<(SPUextract_elt0_chained (v4i32 VECREG:$rA)),
- (ORi32_v4i32 VECREG:$rA, VECREG:$rA)>;
-
-def : Pat<(SPUextract_elt0 (v2i64 VECREG:$rA)),
- (ORi64_v2i64 VECREG:$rA, VECREG:$rA)>;
-
-def : Pat<(SPUextract_elt0_chained (v2i64 VECREG:$rA)),
- (ORi64_v2i64 VECREG:$rA, VECREG:$rA)>;
-
-def : Pat<(SPUextract_elt0 (v4f32 VECREG:$rA)),
- (ORf32_v4f32 VECREG:$rA, VECREG:$rA)>;
-
-def : Pat<(SPUextract_elt0_chained (v4f32 VECREG:$rA)),
- (ORf32_v4f32 VECREG:$rA, VECREG:$rA)>;
-
-def : Pat<(SPUextract_elt0 (v2f64 VECREG:$rA)),
- (ORf64_v2f64 VECREG:$rA, VECREG:$rA)>;
-
-def : Pat<(SPUextract_elt0_chained (v2f64 VECREG:$rA)),
- (ORf64_v2f64 VECREG:$rA, VECREG:$rA)>;
-
-// ORC: Bitwise "or" with complement (c = a | ~b)
-
-class ORCInst<dag OOL, dag IOL, list<dag> pattern>:
- RRForm<0b10010010000, OOL, IOL, "orc\t$rT, $rA, $rB",
- IntegerOp, pattern>;
-
-class ORCVecInst<ValueType vectype>:
- ORCInst<(outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB),
- [(set (vectype VECREG:$rT), (or (vectype VECREG:$rA),
- (vnot (vectype VECREG:$rB))))]>;
-
-class ORCRegInst<RegisterClass rclass>:
- ORCInst<(outs rclass:$rT), (ins rclass:$rA, rclass:$rB),
- [(set rclass:$rT, (or rclass:$rA, (not rclass:$rB)))]>;
-
-multiclass BitwiseOrComplement
-{
- def v16i8: ORCVecInst<v16i8>;
- def v8i16: ORCVecInst<v8i16>;
- def v4i32: ORCVecInst<v4i32>;
- def v2i64: ORCVecInst<v2i64>;
-
- def r64: ORCRegInst<R64C>;
- def r32: ORCRegInst<R32C>;
- def r16: ORCRegInst<R16C>;
- def r8: ORCRegInst<R8C>;
-}
-
-defm ORC : BitwiseOrComplement;
-
-// OR byte immediate
-class ORBIInst<dag OOL, dag IOL, list<dag> pattern>:
- RI10Form<0b01100000, OOL, IOL, "orbi\t$rT, $rA, $val",
- IntegerOp, pattern>;
-
-class ORBIVecInst<ValueType vectype, PatLeaf immpred>:
- ORBIInst<(outs VECREG:$rT), (ins VECREG:$rA, u10imm:$val),
- [(set (v16i8 VECREG:$rT), (or (vectype VECREG:$rA),
- (vectype immpred:$val)))]>;
-
-multiclass BitwiseOrByteImm
-{
- def v16i8: ORBIVecInst<v16i8, v16i8U8Imm>;
-
- def r8: ORBIInst<(outs R8C:$rT), (ins R8C:$rA, u10imm_i8:$val),
- [(set R8C:$rT, (or R8C:$rA, immU8:$val))]>;
-}
-
-defm ORBI : BitwiseOrByteImm;
-
-// OR halfword immediate
-class ORHIInst<dag OOL, dag IOL, list<dag> pattern>:
- RI10Form<0b10100000, OOL, IOL, "orhi\t$rT, $rA, $val",
- IntegerOp, pattern>;
-
-class ORHIVecInst<ValueType vectype, PatLeaf immpred>:
- ORHIInst<(outs VECREG:$rT), (ins VECREG:$rA, u10imm:$val),
- [(set (vectype VECREG:$rT), (or (vectype VECREG:$rA),
- immpred:$val))]>;
-
-multiclass BitwiseOrHalfwordImm
-{
- def v8i16: ORHIVecInst<v8i16, v8i16Uns10Imm>;
-
- def r16: ORHIInst<(outs R16C:$rT), (ins R16C:$rA, u10imm:$val),
- [(set R16C:$rT, (or R16C:$rA, i16ImmUns10:$val))]>;
-
- // Specialized ORHI form used to promote 8-bit registers to 16-bit
- def i8i16: ORHIInst<(outs R16C:$rT), (ins R8C:$rA, s10imm:$val),
- [(set R16C:$rT, (or (anyext R8C:$rA),
- i16ImmSExt10:$val))]>;
-}
-
-defm ORHI : BitwiseOrHalfwordImm;
-
-class ORIInst<dag OOL, dag IOL, list<dag> pattern>:
- RI10Form<0b00100000, OOL, IOL, "ori\t$rT, $rA, $val",
- IntegerOp, pattern>;
-
-class ORIVecInst<ValueType vectype, PatLeaf immpred>:
- ORIInst<(outs VECREG:$rT), (ins VECREG:$rA, u10imm:$val),
- [(set (vectype VECREG:$rT), (or (vectype VECREG:$rA),
- immpred:$val))]>;
-
-// Bitwise "or" with immediate
-multiclass BitwiseOrImm
-{
- def v4i32: ORIVecInst<v4i32, v4i32Uns10Imm>;
-
- def r32: ORIInst<(outs R32C:$rT), (ins R32C:$rA, u10imm_i32:$val),
- [(set R32C:$rT, (or R32C:$rA, i32ImmUns10:$val))]>;
-
- // i16i32: hacked version of the ori instruction to extend 16-bit quantities
- // to 32-bit quantities. used exclusively to match "anyext" conversions (vide
- // infra "anyext 16->32" pattern.)
- def i16i32: ORIInst<(outs R32C:$rT), (ins R16C:$rA, s10imm_i32:$val),
- [(set R32C:$rT, (or (anyext R16C:$rA),
- i32ImmSExt10:$val))]>;
-
- // i8i32: Hacked version of the ORI instruction to extend 16-bit quantities
- // to 32-bit quantities. Used exclusively to match "anyext" conversions (vide
- // infra "anyext 16->32" pattern.)
- def i8i32: ORIInst<(outs R32C:$rT), (ins R8C:$rA, s10imm_i32:$val),
- [(set R32C:$rT, (or (anyext R8C:$rA),
- i32ImmSExt10:$val))]>;
-}
-
-defm ORI : BitwiseOrImm;
-
-// ORX: "or" across the vector: or's $rA's word slots leaving the result in
-// $rT[0], slots 1-3 are zeroed.
-//
-// FIXME: Needs to match an intrinsic pattern.
-def ORXv4i32:
- RRForm<0b10010010000, (outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB),
- "orx\t$rT, $rA, $rB", IntegerOp,
- []>;
-
-// XOR:
-
-class XORInst<dag OOL, dag IOL, list<dag> pattern> :
- RRForm<0b10010010000, OOL, IOL, "xor\t$rT, $rA, $rB",
- IntegerOp, pattern>;
-
-class XORVecInst<ValueType vectype>:
- XORInst<(outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB),
- [(set (vectype VECREG:$rT), (xor (vectype VECREG:$rA),
- (vectype VECREG:$rB)))]>;
-
-class XORRegInst<RegisterClass rclass>:
- XORInst<(outs rclass:$rT), (ins rclass:$rA, rclass:$rB),
- [(set rclass:$rT, (xor rclass:$rA, rclass:$rB))]>;
-
-multiclass BitwiseExclusiveOr
-{
- def v16i8: XORVecInst<v16i8>;
- def v8i16: XORVecInst<v8i16>;
- def v4i32: XORVecInst<v4i32>;
- def v2i64: XORVecInst<v2i64>;
-
- def r128: XORRegInst<GPRC>;
- def r64: XORRegInst<R64C>;
- def r32: XORRegInst<R32C>;
- def r16: XORRegInst<R16C>;
- def r8: XORRegInst<R8C>;
-
- // Special forms for floating point instructions.
- // fneg and fabs require bitwise logical ops to manipulate the sign bit.
-
- def fneg32: XORInst<(outs R32FP:$rT), (ins R32FP:$rA, R32C:$rB),
- [/* no pattern */]>;
-
- def fneg64: XORInst<(outs R64FP:$rT), (ins R64FP:$rA, VECREG:$rB),
- [/* no pattern */]>;
-
- def fnegvec: XORInst<(outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB),
- [/* no pattern, see fneg{32,64} */]>;
-}
-
-defm XOR : BitwiseExclusiveOr;
-
-//==----------------------------------------------------------
-
-class XORBIInst<dag OOL, dag IOL, list<dag> pattern>:
- RI10Form<0b01100000, OOL, IOL, "xorbi\t$rT, $rA, $val",
- IntegerOp, pattern>;
-
-multiclass XorByteImm
-{
- def v16i8:
- XORBIInst<(outs VECREG:$rT), (ins VECREG:$rA, u10imm:$val),
- [(set (v16i8 VECREG:$rT), (xor (v16i8 VECREG:$rA), v16i8U8Imm:$val))]>;
-
- def r8:
- XORBIInst<(outs R8C:$rT), (ins R8C:$rA, u10imm_i8:$val),
- [(set R8C:$rT, (xor R8C:$rA, immU8:$val))]>;
-}
-
-defm XORBI : XorByteImm;
-
-def XORHIv8i16:
- RI10Form<0b10100000, (outs VECREG:$rT), (ins VECREG:$rA, u10imm:$val),
- "xorhi\t$rT, $rA, $val", IntegerOp,
- [(set (v8i16 VECREG:$rT), (xor (v8i16 VECREG:$rA),
- v8i16SExt10Imm:$val))]>;
-
-def XORHIr16:
- RI10Form<0b10100000, (outs R16C:$rT), (ins R16C:$rA, s10imm:$val),
- "xorhi\t$rT, $rA, $val", IntegerOp,
- [(set R16C:$rT, (xor R16C:$rA, i16ImmSExt10:$val))]>;
-
-def XORIv4i32:
- RI10Form<0b00100000, (outs VECREG:$rT), (ins VECREG:$rA, s10imm_i32:$val),
- "xori\t$rT, $rA, $val", IntegerOp,
- [(set (v4i32 VECREG:$rT), (xor (v4i32 VECREG:$rA),
- v4i32SExt10Imm:$val))]>;
-
-def XORIr32:
- RI10Form<0b00100000, (outs R32C:$rT), (ins R32C:$rA, s10imm_i32:$val),
- "xori\t$rT, $rA, $val", IntegerOp,
- [(set R32C:$rT, (xor R32C:$rA, i32ImmSExt10:$val))]>;
-
-// NAND:
-def NANDv16i8:
- RRForm<0b10010010000, (outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB),
- "nand\t$rT, $rA, $rB", IntegerOp,
- [(set (v16i8 VECREG:$rT), (vnot (and (v16i8 VECREG:$rA),
- (v16i8 VECREG:$rB))))]>;
-
-def NANDv8i16:
- RRForm<0b10010010000, (outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB),
- "nand\t$rT, $rA, $rB", IntegerOp,
- [(set (v8i16 VECREG:$rT), (vnot (and (v8i16 VECREG:$rA),
- (v8i16 VECREG:$rB))))]>;
-
-def NANDv4i32:
- RRForm<0b10010010000, (outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB),
- "nand\t$rT, $rA, $rB", IntegerOp,
- [(set (v4i32 VECREG:$rT), (vnot (and (v4i32 VECREG:$rA),
- (v4i32 VECREG:$rB))))]>;
-
-def NANDr32:
- RRForm<0b10010010000, (outs R32C:$rT), (ins R32C:$rA, R32C:$rB),
- "nand\t$rT, $rA, $rB", IntegerOp,
- [(set R32C:$rT, (not (and R32C:$rA, R32C:$rB)))]>;
-
-def NANDr16:
- RRForm<0b10010010000, (outs R16C:$rT), (ins R16C:$rA, R16C:$rB),
- "nand\t$rT, $rA, $rB", IntegerOp,
- [(set R16C:$rT, (not (and R16C:$rA, R16C:$rB)))]>;
-
-def NANDr8:
- RRForm<0b10010010000, (outs R8C:$rT), (ins R8C:$rA, R8C:$rB),
- "nand\t$rT, $rA, $rB", IntegerOp,
- [(set R8C:$rT, (not (and R8C:$rA, R8C:$rB)))]>;
-
-// NOR:
-def NORv16i8:
- RRForm<0b10010010000, (outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB),
- "nor\t$rT, $rA, $rB", IntegerOp,
- [(set (v16i8 VECREG:$rT), (vnot (or (v16i8 VECREG:$rA),
- (v16i8 VECREG:$rB))))]>;
-
-def NORv8i16:
- RRForm<0b10010010000, (outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB),
- "nor\t$rT, $rA, $rB", IntegerOp,
- [(set (v8i16 VECREG:$rT), (vnot (or (v8i16 VECREG:$rA),
- (v8i16 VECREG:$rB))))]>;
-
-def NORv4i32:
- RRForm<0b10010010000, (outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB),
- "nor\t$rT, $rA, $rB", IntegerOp,
- [(set (v4i32 VECREG:$rT), (vnot (or (v4i32 VECREG:$rA),
- (v4i32 VECREG:$rB))))]>;
-
-def NORr32:
- RRForm<0b10010010000, (outs R32C:$rT), (ins R32C:$rA, R32C:$rB),
- "nor\t$rT, $rA, $rB", IntegerOp,
- [(set R32C:$rT, (not (or R32C:$rA, R32C:$rB)))]>;
-
-def NORr16:
- RRForm<0b10010010000, (outs R16C:$rT), (ins R16C:$rA, R16C:$rB),
- "nor\t$rT, $rA, $rB", IntegerOp,
- [(set R16C:$rT, (not (or R16C:$rA, R16C:$rB)))]>;
-
-def NORr8:
- RRForm<0b10010010000, (outs R8C:$rT), (ins R8C:$rA, R8C:$rB),
- "nor\t$rT, $rA, $rB", IntegerOp,
- [(set R8C:$rT, (not (or R8C:$rA, R8C:$rB)))]>;
-
-// Select bits:
-class SELBInst<dag OOL, dag IOL, list<dag> pattern>:
- RRRForm<0b1000, OOL, IOL, "selb\t$rT, $rA, $rB, $rC",
- IntegerOp, pattern>;
-
-class SELBVecInst<ValueType vectype>:
- SELBInst<(outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB, VECREG:$rC),
- [(set (vectype VECREG:$rT),
- (or (and (vectype VECREG:$rC), (vectype VECREG:$rB)),
- (and (vnot (vectype VECREG:$rC)),
- (vectype VECREG:$rA))))]>;
-
-class SELBRegInst<RegisterClass rclass>:
- SELBInst<(outs rclass:$rT), (ins rclass:$rA, rclass:$rB, rclass:$rC),
- [(set rclass:$rT,
- (or (and rclass:$rA, rclass:$rC),
- (and rclass:$rB, (not rclass:$rC))))]>;
-
-multiclass SelectBits
-{
- def v16i8: SELBVecInst<v16i8>;
- def v8i16: SELBVecInst<v8i16>;
- def v4i32: SELBVecInst<v4i32>;
- def v2i64: SELBVecInst<v2i64>;
-
- def r128: SELBRegInst<GPRC>;
- def r64: SELBRegInst<R64C>;
- def r32: SELBRegInst<R32C>;
- def r16: SELBRegInst<R16C>;
- def r8: SELBRegInst<R8C>;
-}
-
-defm SELB : SelectBits;
-
-class SPUselbPat<ValueType vectype, SPUInstr inst>:
- Pat<(SPUselb (vectype VECREG:$rA), (vectype VECREG:$rB), (vectype VECREG:$rC)),
- (inst VECREG:$rA, VECREG:$rB, VECREG:$rC)>;
-
-def : SPUselbPat<v16i8, SELBv16i8>;
-def : SPUselbPat<v8i16, SELBv8i16>;
-def : SPUselbPat<v4i32, SELBv4i32>;
-def : SPUselbPat<v2i64, SELBv2i64>;
-
-class SelectConditional<RegisterClass rclass, SPUInstr inst>:
- Pat<(select rclass:$rCond, rclass:$rTrue, rclass:$rFalse),
- (inst rclass:$rFalse, rclass:$rTrue, rclass:$rCond)>;
-
-def : SelectConditional<R32C, SELBr32>;
-def : SelectConditional<R16C, SELBr16>;
-def : SelectConditional<R8C, SELBr8>;
-
-// EQV: Equivalence (1 for each same bit, otherwise 0)
-//
-// Note: There are a lot of ways to match this bit operator and these patterns
-// attempt to be as exhaustive as possible.
-
-class EQVInst<dag OOL, dag IOL, list<dag> pattern>:
- RRForm<0b10010010000, OOL, IOL, "eqv\t$rT, $rA, $rB",
- IntegerOp, pattern>;
-
-class EQVVecInst<ValueType vectype>:
- EQVInst<(outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB),
- [(set (vectype VECREG:$rT),
- (or (and (vectype VECREG:$rA), (vectype VECREG:$rB)),
- (and (vnot (vectype VECREG:$rA)),
- (vnot (vectype VECREG:$rB)))))]>;
-
-class EQVRegInst<RegisterClass rclass>:
- EQVInst<(outs rclass:$rT), (ins rclass:$rA, rclass:$rB),
- [(set rclass:$rT, (or (and rclass:$rA, rclass:$rB),
- (and (not rclass:$rA), (not rclass:$rB))))]>;
-
-class EQVVecPattern1<ValueType vectype>:
- EQVInst<(outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB),
- [(set (vectype VECREG:$rT),
- (xor (vectype VECREG:$rA), (vnot (vectype VECREG:$rB))))]>;
-
-class EQVRegPattern1<RegisterClass rclass>:
- EQVInst<(outs rclass:$rT), (ins rclass:$rA, rclass:$rB),
- [(set rclass:$rT, (xor rclass:$rA, (not rclass:$rB)))]>;
-
-class EQVVecPattern2<ValueType vectype>:
- EQVInst<(outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB),
- [(set (vectype VECREG:$rT),
- (or (and (vectype VECREG:$rA), (vectype VECREG:$rB)),
- (vnot (or (vectype VECREG:$rA), (vectype VECREG:$rB)))))]>;
-
-class EQVRegPattern2<RegisterClass rclass>:
- EQVInst<(outs rclass:$rT), (ins rclass:$rA, rclass:$rB),
- [(set rclass:$rT,
- (or (and rclass:$rA, rclass:$rB),
- (not (or rclass:$rA, rclass:$rB))))]>;
-
-class EQVVecPattern3<ValueType vectype>:
- EQVInst<(outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB),
- [(set (vectype VECREG:$rT),
- (not (xor (vectype VECREG:$rA), (vectype VECREG:$rB))))]>;
-
-class EQVRegPattern3<RegisterClass rclass>:
- EQVInst<(outs rclass:$rT), (ins rclass:$rA, rclass:$rB),
- [(set rclass:$rT, (not (xor rclass:$rA, rclass:$rB)))]>;
-
-multiclass BitEquivalence
-{
- def v16i8: EQVVecInst<v16i8>;
- def v8i16: EQVVecInst<v8i16>;
- def v4i32: EQVVecInst<v4i32>;
- def v2i64: EQVVecInst<v2i64>;
-
- def v16i8_1: EQVVecPattern1<v16i8>;
- def v8i16_1: EQVVecPattern1<v8i16>;
- def v4i32_1: EQVVecPattern1<v4i32>;
- def v2i64_1: EQVVecPattern1<v2i64>;
-
- def v16i8_2: EQVVecPattern2<v16i8>;
- def v8i16_2: EQVVecPattern2<v8i16>;
- def v4i32_2: EQVVecPattern2<v4i32>;
- def v2i64_2: EQVVecPattern2<v2i64>;
-
- def v16i8_3: EQVVecPattern3<v16i8>;
- def v8i16_3: EQVVecPattern3<v8i16>;
- def v4i32_3: EQVVecPattern3<v4i32>;
- def v2i64_3: EQVVecPattern3<v2i64>;
-
- def r128: EQVRegInst<GPRC>;
- def r64: EQVRegInst<R64C>;
- def r32: EQVRegInst<R32C>;
- def r16: EQVRegInst<R16C>;
- def r8: EQVRegInst<R8C>;
-
- def r128_1: EQVRegPattern1<GPRC>;
- def r64_1: EQVRegPattern1<R64C>;
- def r32_1: EQVRegPattern1<R32C>;
- def r16_1: EQVRegPattern1<R16C>;
- def r8_1: EQVRegPattern1<R8C>;
-
- def r128_2: EQVRegPattern2<GPRC>;
- def r64_2: EQVRegPattern2<R64C>;
- def r32_2: EQVRegPattern2<R32C>;
- def r16_2: EQVRegPattern2<R16C>;
- def r8_2: EQVRegPattern2<R8C>;
-
- def r128_3: EQVRegPattern3<GPRC>;
- def r64_3: EQVRegPattern3<R64C>;
- def r32_3: EQVRegPattern3<R32C>;
- def r16_3: EQVRegPattern3<R16C>;
- def r8_3: EQVRegPattern3<R8C>;
-}
-
-defm EQV: BitEquivalence;
-
-//===----------------------------------------------------------------------===//
-// Vector shuffle...
-//===----------------------------------------------------------------------===//
-// SPUshuffle is generated in LowerVECTOR_SHUFFLE and gets replaced with SHUFB.
-// See the SPUshuffle SDNode operand above, which sets up the DAG pattern
-// matcher to emit something when the LowerVECTOR_SHUFFLE generates a node with
-// the SPUISD::SHUFB opcode.
-//===----------------------------------------------------------------------===//
-
-class SHUFBInst<dag OOL, dag IOL, list<dag> pattern>:
- RRRForm<0b1000, OOL, IOL, "shufb\t$rT, $rA, $rB, $rC",
- IntegerOp, pattern>;
-
-class SHUFBVecInst<ValueType vectype>:
- SHUFBInst<(outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB, VECREG:$rC),
- [(set (vectype VECREG:$rT), (SPUshuffle (vectype VECREG:$rA),
- (vectype VECREG:$rB),
- (vectype VECREG:$rC)))]>;
-
-// It's this pattern that's probably the most useful, since SPUISelLowering
-// methods create a v16i8 vector for $rC:
-class SHUFBVecPat1<ValueType vectype, SPUInstr inst>:
- Pat<(SPUshuffle (vectype VECREG:$rA), (vectype VECREG:$rB),
- (v16i8 VECREG:$rC)),
- (inst VECREG:$rA, VECREG:$rB, VECREG:$rC)>;
-
-multiclass ShuffleBytes
-{
- def v16i8 : SHUFBVecInst<v16i8>;
- def v8i16 : SHUFBVecInst<v8i16>;
- def v4i32 : SHUFBVecInst<v4i32>;
- def v2i64 : SHUFBVecInst<v2i64>;
-
- def v4f32 : SHUFBVecInst<v4f32>;
- def v2f64 : SHUFBVecInst<v2f64>;
-}
-
-defm SHUFB : ShuffleBytes;
-
-def : SHUFBVecPat1<v8i16, SHUFBv16i8>;
-def : SHUFBVecPat1<v4i32, SHUFBv16i8>;
-def : SHUFBVecPat1<v2i64, SHUFBv16i8>;
-def : SHUFBVecPat1<v4f32, SHUFBv16i8>;
-def : SHUFBVecPat1<v2f64, SHUFBv16i8>;
-
-//===----------------------------------------------------------------------===//
-// Shift and rotate group:
-//===----------------------------------------------------------------------===//
-
-class SHLHInst<dag OOL, dag IOL, list<dag> pattern>:
- RRForm<0b11111010000, OOL, IOL, "shlh\t$rT, $rA, $rB",
- RotateShift, pattern>;
-
-class SHLHVecInst<ValueType vectype>:
- SHLHInst<(outs VECREG:$rT), (ins VECREG:$rA, R16C:$rB),
- [(set (vectype VECREG:$rT),
- (SPUvec_shl (vectype VECREG:$rA), R16C:$rB))]>;
-
-// $rB gets promoted to 32-bit register type when confronted with
-// this llvm assembly code:
-//
-// define i16 @shlh_i16_1(i16 %arg1, i16 %arg2) {
-// %A = shl i16 %arg1, %arg2
-// ret i16 %A
-// }
-
-multiclass ShiftLeftHalfword
-{
- def v8i16: SHLHVecInst<v8i16>;
- def r16: SHLHInst<(outs R16C:$rT), (ins R16C:$rA, R16C:$rB),
- [(set R16C:$rT, (shl R16C:$rA, R16C:$rB))]>;
- def r16_r32: SHLHInst<(outs R16C:$rT), (ins R16C:$rA, R32C:$rB),
- [(set R16C:$rT, (shl R16C:$rA, R32C:$rB))]>;
-}
-
-defm SHLH : ShiftLeftHalfword;
-
-//===----------------------------------------------------------------------===//
-
-class SHLHIInst<dag OOL, dag IOL, list<dag> pattern>:
- RI7Form<0b11111010000, OOL, IOL, "shlhi\t$rT, $rA, $val",
- RotateShift, pattern>;
-
-class SHLHIVecInst<ValueType vectype>:
- SHLHIInst<(outs VECREG:$rT), (ins VECREG:$rA, u7imm:$val),
- [(set (vectype VECREG:$rT),
- (SPUvec_shl (vectype VECREG:$rA), (i16 uimm7:$val)))]>;
-
-multiclass ShiftLeftHalfwordImm
-{
- def v8i16: SHLHIVecInst<v8i16>;
- def r16: SHLHIInst<(outs R16C:$rT), (ins R16C:$rA, u7imm:$val),
- [(set R16C:$rT, (shl R16C:$rA, (i16 uimm7:$val)))]>;
-}
-
-defm SHLHI : ShiftLeftHalfwordImm;
-
-def : Pat<(SPUvec_shl (v8i16 VECREG:$rA), (i32 uimm7:$val)),
- (SHLHIv8i16 VECREG:$rA, uimm7:$val)>;
-
-def : Pat<(shl R16C:$rA, (i32 uimm7:$val)),
- (SHLHIr16 R16C:$rA, uimm7:$val)>;
-
-//===----------------------------------------------------------------------===//
-
-class SHLInst<dag OOL, dag IOL, list<dag> pattern>:
- RRForm<0b11111010000, OOL, IOL, "shl\t$rT, $rA, $rB",
- RotateShift, pattern>;
-
-multiclass ShiftLeftWord
-{
- def v4i32:
- SHLInst<(outs VECREG:$rT), (ins VECREG:$rA, R16C:$rB),
- [(set (v4i32 VECREG:$rT),
- (SPUvec_shl (v4i32 VECREG:$rA), R16C:$rB))]>;
- def r32:
- SHLInst<(outs R32C:$rT), (ins R32C:$rA, R32C:$rB),
- [(set R32C:$rT, (shl R32C:$rA, R32C:$rB))]>;
-}
-
-defm SHL: ShiftLeftWord;
-
-//===----------------------------------------------------------------------===//
-
-class SHLIInst<dag OOL, dag IOL, list<dag> pattern>:
- RI7Form<0b11111010000, OOL, IOL, "shli\t$rT, $rA, $val",
- RotateShift, pattern>;
-
-multiclass ShiftLeftWordImm
-{
- def v4i32:
- SHLIInst<(outs VECREG:$rT), (ins VECREG:$rA, u7imm_i32:$val),
- [(set (v4i32 VECREG:$rT),
- (SPUvec_shl (v4i32 VECREG:$rA), (i32 uimm7:$val)))]>;
-
- def r32:
- SHLIInst<(outs R32C:$rT), (ins R32C:$rA, u7imm_i32:$val),
- [(set R32C:$rT, (shl R32C:$rA, (i32 uimm7:$val)))]>;
-}
-
-defm SHLI : ShiftLeftWordImm;
-
-//===----------------------------------------------------------------------===//
-// SHLQBI vec form: Note that this will shift the entire vector (the 128-bit
-// register) to the left. Vector form is here to ensure type correctness.
-//
-// The shift count is in the lowest 3 bits (29-31) of $rB, so only a bit shift
-// of 7 bits is actually possible.
-//
-// Note also that SHLQBI/SHLQBII are used in conjunction with SHLQBY/SHLQBYI
-// to shift i64 and i128. SHLQBI is the residual left over after shifting by
-// bytes with SHLQBY.
-
-class SHLQBIInst<dag OOL, dag IOL, list<dag> pattern>:
- RRForm<0b11011011100, OOL, IOL, "shlqbi\t$rT, $rA, $rB",
- RotateShift, pattern>;
-
-class SHLQBIVecInst<ValueType vectype>:
- SHLQBIInst<(outs VECREG:$rT), (ins VECREG:$rA, R32C:$rB),
- [(set (vectype VECREG:$rT),
- (SPUshlquad_l_bits (vectype VECREG:$rA), R32C:$rB))]>;
-
-multiclass ShiftLeftQuadByBits
-{
- def v16i8: SHLQBIVecInst<v16i8>;
- def v8i16: SHLQBIVecInst<v8i16>;
- def v4i32: SHLQBIVecInst<v4i32>;
- def v2i64: SHLQBIVecInst<v2i64>;
-}
-
-defm SHLQBI : ShiftLeftQuadByBits;
-
-// See note above on SHLQBI. In this case, the predicate actually does then
-// enforcement, whereas with SHLQBI, we have to "take it on faith."
-class SHLQBIIInst<dag OOL, dag IOL, list<dag> pattern>:
- RI7Form<0b11011111100, OOL, IOL, "shlqbii\t$rT, $rA, $val",
- RotateShift, pattern>;
-
-class SHLQBIIVecInst<ValueType vectype>:
- SHLQBIIInst<(outs VECREG:$rT), (ins VECREG:$rA, u7imm_i32:$val),
- [(set (vectype VECREG:$rT),
- (SPUshlquad_l_bits (vectype VECREG:$rA), (i32 bitshift:$val)))]>;
-
-multiclass ShiftLeftQuadByBitsImm
-{
- def v16i8 : SHLQBIIVecInst<v16i8>;
- def v8i16 : SHLQBIIVecInst<v8i16>;
- def v4i32 : SHLQBIIVecInst<v4i32>;
- def v2i64 : SHLQBIIVecInst<v2i64>;
-}
-
-defm SHLQBII : ShiftLeftQuadByBitsImm;
-
-// SHLQBY, SHLQBYI vector forms: Shift the entire vector to the left by bytes,
-// not by bits. See notes above on SHLQBI.
-
-class SHLQBYInst<dag OOL, dag IOL, list<dag> pattern>:
- RI7Form<0b11111011100, OOL, IOL, "shlqbyi\t$rT, $rA, $rB",
- RotateShift, pattern>;
-
-class SHLQBYVecInst<ValueType vectype>:
- SHLQBYInst<(outs VECREG:$rT), (ins VECREG:$rA, R32C:$rB),
- [(set (vectype VECREG:$rT),
- (SPUshlquad_l_bytes (vectype VECREG:$rA), R32C:$rB))]>;
-
-multiclass ShiftLeftQuadBytes
-{
- def v16i8: SHLQBYVecInst<v16i8>;
- def v8i16: SHLQBYVecInst<v8i16>;
- def v4i32: SHLQBYVecInst<v4i32>;
- def v2i64: SHLQBYVecInst<v2i64>;
- def r128: SHLQBYInst<(outs GPRC:$rT), (ins GPRC:$rA, R32C:$rB),
- [(set GPRC:$rT, (SPUshlquad_l_bytes GPRC:$rA, R32C:$rB))]>;
-}
-
-defm SHLQBY: ShiftLeftQuadBytes;
-
-class SHLQBYIInst<dag OOL, dag IOL, list<dag> pattern>:
- RI7Form<0b11111111100, OOL, IOL, "shlqbyi\t$rT, $rA, $val",
- RotateShift, pattern>;
-
-class SHLQBYIVecInst<ValueType vectype>:
- SHLQBYIInst<(outs VECREG:$rT), (ins VECREG:$rA, u7imm_i32:$val),
- [(set (vectype VECREG:$rT),
- (SPUshlquad_l_bytes (vectype VECREG:$rA), (i32 uimm7:$val)))]>;
-
-multiclass ShiftLeftQuadBytesImm
-{
- def v16i8: SHLQBYIVecInst<v16i8>;
- def v8i16: SHLQBYIVecInst<v8i16>;
- def v4i32: SHLQBYIVecInst<v4i32>;
- def v2i64: SHLQBYIVecInst<v2i64>;
- def r128: SHLQBYIInst<(outs GPRC:$rT), (ins GPRC:$rA, u7imm_i32:$val),
- [(set GPRC:$rT,
- (SPUshlquad_l_bytes GPRC:$rA, (i32 uimm7:$val)))]>;
-}
-
-defm SHLQBYI : ShiftLeftQuadBytesImm;
-
-// Special form for truncating i64 to i32:
-def SHLQBYItrunc64: SHLQBYIInst<(outs R32C:$rT), (ins R64C:$rA, u7imm_i32:$val),
- [/* no pattern, see below */]>;
-
-def : Pat<(trunc R64C:$rSrc),
- (SHLQBYItrunc64 R64C:$rSrc, 4)>;
-
-//-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
-// Rotate halfword:
-//-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
-class ROTHInst<dag OOL, dag IOL, list<dag> pattern>:
- RRForm<0b00111010000, OOL, IOL, "roth\t$rT, $rA, $rB",
- RotateShift, pattern>;
-
-class ROTHVecInst<ValueType vectype>:
- ROTHInst<(outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB),
- [(set (vectype VECREG:$rT),
- (SPUvec_rotl VECREG:$rA, VECREG:$rB))]>;
-
-class ROTHRegInst<RegisterClass rclass>:
- ROTHInst<(outs rclass:$rT), (ins rclass:$rA, rclass:$rB),
- [(set rclass:$rT, (rotl rclass:$rA, rclass:$rB))]>;
-
-multiclass RotateLeftHalfword
-{
- def v8i16: ROTHVecInst<v8i16>;
- def r16: ROTHRegInst<R16C>;
-}
-
-defm ROTH: RotateLeftHalfword;
-
-def ROTHr16_r32: ROTHInst<(outs R16C:$rT), (ins R16C:$rA, R32C:$rB),
- [(set R16C:$rT, (rotl R16C:$rA, R32C:$rB))]>;
-
-//-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
-// Rotate halfword, immediate:
-//-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
-class ROTHIInst<dag OOL, dag IOL, list<dag> pattern>:
- RI7Form<0b00111110000, OOL, IOL, "rothi\t$rT, $rA, $val",
- RotateShift, pattern>;
-
-class ROTHIVecInst<ValueType vectype>:
- ROTHIInst<(outs VECREG:$rT), (ins VECREG:$rA, u7imm:$val),
- [(set (vectype VECREG:$rT),
- (SPUvec_rotl VECREG:$rA, (i16 uimm7:$val)))]>;
-
-multiclass RotateLeftHalfwordImm
-{
- def v8i16: ROTHIVecInst<v8i16>;
- def r16: ROTHIInst<(outs R16C:$rT), (ins R16C:$rA, u7imm:$val),
- [(set R16C:$rT, (rotl R16C:$rA, (i16 uimm7:$val)))]>;
- def r16_r32: ROTHIInst<(outs R16C:$rT), (ins R16C:$rA, u7imm_i32:$val),
- [(set R16C:$rT, (rotl R16C:$rA, (i32 uimm7:$val)))]>;
-}
-
-defm ROTHI: RotateLeftHalfwordImm;
-
-def : Pat<(SPUvec_rotl VECREG:$rA, (i32 uimm7:$val)),
- (ROTHIv8i16 VECREG:$rA, imm:$val)>;
-
-//-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
-// Rotate word:
-//-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
-
-class ROTInst<dag OOL, dag IOL, list<dag> pattern>:
- RRForm<0b00011010000, OOL, IOL, "rot\t$rT, $rA, $rB",
- RotateShift, pattern>;
-
-class ROTVecInst<ValueType vectype>:
- ROTInst<(outs VECREG:$rT), (ins VECREG:$rA, R32C:$rB),
- [(set (vectype VECREG:$rT),
- (SPUvec_rotl (vectype VECREG:$rA), R32C:$rB))]>;
-
-class ROTRegInst<RegisterClass rclass>:
- ROTInst<(outs rclass:$rT), (ins rclass:$rA, R32C:$rB),
- [(set rclass:$rT,
- (rotl rclass:$rA, R32C:$rB))]>;
-
-multiclass RotateLeftWord
-{
- def v4i32: ROTVecInst<v4i32>;
- def r32: ROTRegInst<R32C>;
-}
-
-defm ROT: RotateLeftWord;
-
-// The rotate amount is in the same bits whether we've got an 8-bit, 16-bit or
-// 32-bit register
-def ROTr32_r16_anyext:
- ROTInst<(outs R32C:$rT), (ins R32C:$rA, R16C:$rB),
- [(set R32C:$rT, (rotl R32C:$rA, (i32 (anyext R16C:$rB))))]>;
-
-def : Pat<(rotl R32C:$rA, (i32 (zext R16C:$rB))),
- (ROTr32_r16_anyext R32C:$rA, R16C:$rB)>;
-
-def : Pat<(rotl R32C:$rA, (i32 (sext R16C:$rB))),
- (ROTr32_r16_anyext R32C:$rA, R16C:$rB)>;
-
-def ROTr32_r8_anyext:
- ROTInst<(outs R32C:$rT), (ins R32C:$rA, R8C:$rB),
- [(set R32C:$rT, (rotl R32C:$rA, (i32 (anyext R8C:$rB))))]>;
-
-def : Pat<(rotl R32C:$rA, (i32 (zext R8C:$rB))),
- (ROTr32_r8_anyext R32C:$rA, R8C:$rB)>;
-
-def : Pat<(rotl R32C:$rA, (i32 (sext R8C:$rB))),
- (ROTr32_r8_anyext R32C:$rA, R8C:$rB)>;
-
-//-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
-// Rotate word, immediate
-//-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
-
-class ROTIInst<dag OOL, dag IOL, list<dag> pattern>:
- RI7Form<0b00011110000, OOL, IOL, "roti\t$rT, $rA, $val",
- RotateShift, pattern>;
-
-class ROTIVecInst<ValueType vectype, Operand optype, ValueType inttype, PatLeaf pred>:
- ROTIInst<(outs VECREG:$rT), (ins VECREG:$rA, optype:$val),
- [(set (vectype VECREG:$rT),
- (SPUvec_rotl (vectype VECREG:$rA), (inttype pred:$val)))]>;
-
-class ROTIRegInst<RegisterClass rclass, Operand optype, ValueType inttype, PatLeaf pred>:
- ROTIInst<(outs rclass:$rT), (ins rclass:$rA, optype:$val),
- [(set rclass:$rT, (rotl rclass:$rA, (inttype pred:$val)))]>;
-
-multiclass RotateLeftWordImm
-{
- def v4i32: ROTIVecInst<v4i32, u7imm_i32, i32, uimm7>;
- def v4i32_i16: ROTIVecInst<v4i32, u7imm, i16, uimm7>;
- def v4i32_i8: ROTIVecInst<v4i32, u7imm_i8, i8, uimm7>;
-
- def r32: ROTIRegInst<R32C, u7imm_i32, i32, uimm7>;
- def r32_i16: ROTIRegInst<R32C, u7imm, i16, uimm7>;
- def r32_i8: ROTIRegInst<R32C, u7imm_i8, i8, uimm7>;
-}
-
-defm ROTI : RotateLeftWordImm;
-
-//-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
-// Rotate quad by byte (count)
-//-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
-
-class ROTQBYInst<dag OOL, dag IOL, list<dag> pattern>:
- RRForm<0b00111011100, OOL, IOL, "rotqby\t$rT, $rA, $rB",
- RotateShift, pattern>;
-
-class ROTQBYVecInst<ValueType vectype>:
- ROTQBYInst<(outs VECREG:$rT), (ins VECREG:$rA, R32C:$rB),
- [(set (vectype VECREG:$rT),
- (SPUrotbytes_left (vectype VECREG:$rA), R32C:$rB))]>;
-
-multiclass RotateQuadLeftByBytes
-{
- def v16i8: ROTQBYVecInst<v16i8>;
- def v8i16: ROTQBYVecInst<v8i16>;
- def v4i32: ROTQBYVecInst<v4i32>;
- def v2i64: ROTQBYVecInst<v2i64>;
-}
-
-defm ROTQBY: RotateQuadLeftByBytes;
-
-def : Pat<(SPUrotbytes_left_chained (v16i8 VECREG:$rA), R32C:$rB),
- (ROTQBYv16i8 VECREG:$rA, R32C:$rB)>;
-def : Pat<(SPUrotbytes_left_chained (v8i16 VECREG:$rA), R32C:$rB),
- (ROTQBYv8i16 VECREG:$rA, R32C:$rB)>;
-def : Pat<(SPUrotbytes_left_chained (v4i32 VECREG:$rA), R32C:$rB),
- (ROTQBYv4i32 VECREG:$rA, R32C:$rB)>;
-def : Pat<(SPUrotbytes_left_chained (v2i64 VECREG:$rA), R32C:$rB),
- (ROTQBYv2i64 VECREG:$rA, R32C:$rB)>;
-
-//-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
-// Rotate quad by byte (count), immediate
-//-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
-
-class ROTQBYIInst<dag OOL, dag IOL, list<dag> pattern>:
- RI7Form<0b00111111100, OOL, IOL, "rotqbyi\t$rT, $rA, $val",
- RotateShift, pattern>;
-
-class ROTQBYIVecInst<ValueType vectype>:
- ROTQBYIInst<(outs VECREG:$rT), (ins VECREG:$rA, u7imm:$val),
- [(set (vectype VECREG:$rT),
- (SPUrotbytes_left (vectype VECREG:$rA), (i16 uimm7:$val)))]>;
-
-multiclass RotateQuadByBytesImm
-{
- def v16i8: ROTQBYIVecInst<v16i8>;
- def v8i16: ROTQBYIVecInst<v8i16>;
- def v4i32: ROTQBYIVecInst<v4i32>;
- def v2i64: ROTQBYIVecInst<v2i64>;
-}
-
-defm ROTQBYI: RotateQuadByBytesImm;
-
-def : Pat<(SPUrotbytes_left_chained (v16i8 VECREG:$rA), (i16 uimm7:$val)),
- (ROTQBYIv16i8 VECREG:$rA, uimm7:$val)>;
-def : Pat<(SPUrotbytes_left_chained (v8i16 VECREG:$rA), (i16 uimm7:$val)),
- (ROTQBYIv8i16 VECREG:$rA, uimm7:$val)>;
-def : Pat<(SPUrotbytes_left_chained (v4i32 VECREG:$rA), (i16 uimm7:$val)),
- (ROTQBYIv4i32 VECREG:$rA, uimm7:$val)>;
-def : Pat<(SPUrotbytes_left_chained (v2i64 VECREG:$rA), (i16 uimm7:$val)),
- (ROTQBYIv2i64 VECREG:$rA, uimm7:$val)>;
-
-// See ROTQBY note above.
-def ROTQBYBIvec:
- RI7Form<0b00110011100, (outs VECREG:$rT), (ins VECREG:$rA, u7imm:$val),
- "rotqbybi\t$rT, $rA, $val", RotateShift,
- [/* intrinsic */]>;
-
-//-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
-// See ROTQBY note above.
-//
-// Assume that the user of this instruction knows to shift the rotate count
-// into bit 29
-//-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
-
-class ROTQBIInst<dag OOL, dag IOL, list<dag> pattern>:
- RRForm<0b00011011100, OOL, IOL, "rotqbi\t$rT, $rA, $rB",
- RotateShift, pattern>;
-
-class ROTQBIVecInst<ValueType vectype>:
- ROTQBIInst<(outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB),
- [/* no pattern yet */]>;
-
-class ROTQBIRegInst<RegisterClass rclass>:
- ROTQBIInst<(outs rclass:$rT), (ins rclass:$rA, rclass:$rB),
- [/* no pattern yet */]>;
-
-multiclass RotateQuadByBitCount
-{
- def v16i8: ROTQBIVecInst<v16i8>;
- def v8i16: ROTQBIVecInst<v8i16>;
- def v4i32: ROTQBIVecInst<v4i32>;
- def v2i64: ROTQBIVecInst<v2i64>;
-
- def r128: ROTQBIRegInst<GPRC>;
- def r64: ROTQBIRegInst<R64C>;
-}
-
-defm ROTQBI: RotateQuadByBitCount;
-
-class ROTQBIIInst<dag OOL, dag IOL, list<dag> pattern>:
- RI7Form<0b00011111100, OOL, IOL, "rotqbii\t$rT, $rA, $val",
- RotateShift, pattern>;
-
-class ROTQBIIVecInst<ValueType vectype, Operand optype, ValueType inttype,
- PatLeaf pred>:
- ROTQBIIInst<(outs VECREG:$rT), (ins VECREG:$rA, optype:$val),
- [/* no pattern yet */]>;
-
-class ROTQBIIRegInst<RegisterClass rclass, Operand optype, ValueType inttype,
- PatLeaf pred>:
- ROTQBIIInst<(outs rclass:$rT), (ins rclass:$rA, optype:$val),
- [/* no pattern yet */]>;
-
-multiclass RotateQuadByBitCountImm
-{
- def v16i8: ROTQBIIVecInst<v16i8, u7imm_i32, i32, uimm7>;
- def v8i16: ROTQBIIVecInst<v8i16, u7imm_i32, i32, uimm7>;
- def v4i32: ROTQBIIVecInst<v4i32, u7imm_i32, i32, uimm7>;
- def v2i64: ROTQBIIVecInst<v2i64, u7imm_i32, i32, uimm7>;
-
- def r128: ROTQBIIRegInst<GPRC, u7imm_i32, i32, uimm7>;
- def r64: ROTQBIIRegInst<R64C, u7imm_i32, i32, uimm7>;
-}
-
-defm ROTQBII : RotateQuadByBitCountImm;
-
-//-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
-// ROTHM v8i16 form:
-// NOTE(1): No vector rotate is generated by the C/C++ frontend (today),
-// so this only matches a synthetically generated/lowered code
-// fragment.
-// NOTE(2): $rB must be negated before the right rotate!
-//-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
-
-class ROTHMInst<dag OOL, dag IOL, list<dag> pattern>:
- RRForm<0b10111010000, OOL, IOL, "rothm\t$rT, $rA, $rB",
- RotateShift, pattern>;
-
-def ROTHMv8i16:
- ROTHMInst<(outs VECREG:$rT), (ins VECREG:$rA, R32C:$rB),
- [/* see patterns below - $rB must be negated */]>;
-
-def : Pat<(SPUvec_srl (v8i16 VECREG:$rA), R32C:$rB),
- (ROTHMv8i16 VECREG:$rA, (SFIr32 R32C:$rB, 0))>;
-
-def : Pat<(SPUvec_srl (v8i16 VECREG:$rA), R16C:$rB),
- (ROTHMv8i16 VECREG:$rA,
- (SFIr32 (XSHWr16 R16C:$rB), 0))>;
-
-def : Pat<(SPUvec_srl (v8i16 VECREG:$rA), R8C:$rB),
- (ROTHMv8i16 VECREG:$rA,
- (SFIr32 (XSHWr16 (XSBHr8 R8C:$rB) ), 0))>;
-
-// ROTHM r16 form: Rotate 16-bit quantity to right, zero fill at the left
-// Note: This instruction doesn't match a pattern because rB must be negated
-// for the instruction to work. Thus, the pattern below the instruction!
-
-def ROTHMr16:
- ROTHMInst<(outs R16C:$rT), (ins R16C:$rA, R32C:$rB),
- [/* see patterns below - $rB must be negated! */]>;
-
-def : Pat<(srl R16C:$rA, R32C:$rB),
- (ROTHMr16 R16C:$rA, (SFIr32 R32C:$rB, 0))>;
-
-def : Pat<(srl R16C:$rA, R16C:$rB),
- (ROTHMr16 R16C:$rA,
- (SFIr32 (XSHWr16 R16C:$rB), 0))>;
-
-def : Pat<(srl R16C:$rA, R8C:$rB),
- (ROTHMr16 R16C:$rA,
- (SFIr32 (XSHWr16 (XSBHr8 R8C:$rB) ), 0))>;
-
-// ROTHMI v8i16 form: See the comment for ROTHM v8i16. The difference here is
-// that the immediate can be complemented, so that the user doesn't have to
-// worry about it.
-
-class ROTHMIInst<dag OOL, dag IOL, list<dag> pattern>:
- RI7Form<0b10111110000, OOL, IOL, "rothmi\t$rT, $rA, $val",
- RotateShift, pattern>;
-
-def ROTHMIv8i16:
- ROTHMIInst<(outs VECREG:$rT), (ins VECREG:$rA, rothNeg7imm:$val),
- [/* no pattern */]>;
-
-def : Pat<(SPUvec_srl (v8i16 VECREG:$rA), (i32 imm:$val)),
- (ROTHMIv8i16 VECREG:$rA, imm:$val)>;
-
-def: Pat<(SPUvec_srl (v8i16 VECREG:$rA), (i16 imm:$val)),
- (ROTHMIv8i16 VECREG:$rA, imm:$val)>;
-
-def: Pat<(SPUvec_srl (v8i16 VECREG:$rA), (i8 imm:$val)),
- (ROTHMIv8i16 VECREG:$rA, imm:$val)>;
-
-def ROTHMIr16:
- ROTHMIInst<(outs R16C:$rT), (ins R16C:$rA, rothNeg7imm:$val),
- [/* no pattern */]>;
-
-def: Pat<(srl R16C:$rA, (i32 uimm7:$val)),
- (ROTHMIr16 R16C:$rA, uimm7:$val)>;
-
-def: Pat<(srl R16C:$rA, (i16 uimm7:$val)),
- (ROTHMIr16 R16C:$rA, uimm7:$val)>;
-
-def: Pat<(srl R16C:$rA, (i8 uimm7:$val)),
- (ROTHMIr16 R16C:$rA, uimm7:$val)>;
-
-// ROTM v4i32 form: See the ROTHM v8i16 comments.
-class ROTMInst<dag OOL, dag IOL, list<dag> pattern>:
- RRForm<0b10011010000, OOL, IOL, "rotm\t$rT, $rA, $rB",
- RotateShift, pattern>;
-
-def ROTMv4i32:
- ROTMInst<(outs VECREG:$rT), (ins VECREG:$rA, R32C:$rB),
- [/* see patterns below - $rB must be negated */]>;
-
-def : Pat<(SPUvec_srl VECREG:$rA, R32C:$rB),
- (ROTMv4i32 VECREG:$rA, (SFIr32 R32C:$rB, 0))>;
-
-def : Pat<(SPUvec_srl VECREG:$rA, R16C:$rB),
- (ROTMv4i32 VECREG:$rA,
- (SFIr32 (XSHWr16 R16C:$rB), 0))>;
-
-def : Pat<(SPUvec_srl VECREG:$rA, R8C:$rB),
- (ROTMv4i32 VECREG:$rA,
- (SFIr32 (XSHWr16 (XSBHr8 R8C:$rB)), 0))>;
-
-def ROTMr32:
- ROTMInst<(outs R32C:$rT), (ins R32C:$rA, R32C:$rB),
- [/* see patterns below - $rB must be negated */]>;
-
-def : Pat<(srl R32C:$rA, R32C:$rB),
- (ROTMr32 R32C:$rA, (SFIr32 R32C:$rB, 0))>;
-
-def : Pat<(srl R32C:$rA, R16C:$rB),
- (ROTMr32 R32C:$rA,
- (SFIr32 (XSHWr16 R16C:$rB), 0))>;
-
-def : Pat<(srl R32C:$rA, R8C:$rB),
- (ROTMr32 R32C:$rA,
- (SFIr32 (XSHWr16 (XSBHr8 R8C:$rB)), 0))>;
-
-// ROTMI v4i32 form: See the comment for ROTHM v8i16.
-def ROTMIv4i32:
- RI7Form<0b10011110000, (outs VECREG:$rT), (ins VECREG:$rA, rotNeg7imm:$val),
- "rotmi\t$rT, $rA, $val", RotateShift,
- [(set (v4i32 VECREG:$rT),
- (SPUvec_srl VECREG:$rA, (i32 uimm7:$val)))]>;
-
-def : Pat<(SPUvec_srl VECREG:$rA, (i16 uimm7:$val)),
- (ROTMIv4i32 VECREG:$rA, uimm7:$val)>;
-
-def : Pat<(SPUvec_srl VECREG:$rA, (i8 uimm7:$val)),
- (ROTMIv4i32 VECREG:$rA, uimm7:$val)>;
-
-// ROTMI r32 form: know how to complement the immediate value.
-def ROTMIr32:
- RI7Form<0b10011110000, (outs R32C:$rT), (ins R32C:$rA, rotNeg7imm:$val),
- "rotmi\t$rT, $rA, $val", RotateShift,
- [(set R32C:$rT, (srl R32C:$rA, (i32 uimm7:$val)))]>;
-
-def : Pat<(srl R32C:$rA, (i16 imm:$val)),
- (ROTMIr32 R32C:$rA, uimm7:$val)>;
-
-def : Pat<(srl R32C:$rA, (i8 imm:$val)),
- (ROTMIr32 R32C:$rA, uimm7:$val)>;
-
-//-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
-// ROTQMBYvec: This is a vector form merely so that when used in an
-// instruction pattern, type checking will succeed. This instruction assumes
-// that the user knew to negate $rB.
-//
-// Using the SPUrotquad_rz_bytes target-specific DAG node, the patterns
-// ensure that $rB is negated.
-//-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
-
-class ROTQMBYInst<dag OOL, dag IOL, list<dag> pattern>:
- RRForm<0b10111011100, OOL, IOL, "rotqmby\t$rT, $rA, $rB",
- RotateShift, pattern>;
-
-class ROTQMBYVecInst<ValueType vectype>:
- ROTQMBYInst<(outs VECREG:$rT), (ins VECREG:$rA, R32C:$rB),
- [/* no pattern, $rB must be negated */]>;
-
-class ROTQMBYRegInst<RegisterClass rclass>:
- ROTQMBYInst<(outs rclass:$rT), (ins rclass:$rA, R32C:$rB),
- [(set rclass:$rT,
- (SPUrotquad_rz_bytes rclass:$rA, R32C:$rB))]>;
-
-multiclass RotateQuadBytes
-{
- def v16i8: ROTQMBYVecInst<v16i8>;
- def v8i16: ROTQMBYVecInst<v8i16>;
- def v4i32: ROTQMBYVecInst<v4i32>;
- def v2i64: ROTQMBYVecInst<v2i64>;
-
- def r128: ROTQMBYRegInst<GPRC>;
- def r64: ROTQMBYRegInst<R64C>;
-}
-
-defm ROTQMBY : RotateQuadBytes;
-
-def : Pat<(SPUrotquad_rz_bytes (v16i8 VECREG:$rA), R32C:$rB),
- (ROTQMBYv16i8 VECREG:$rA, (SFIr32 R32C:$rB, 0))>;
-def : Pat<(SPUrotquad_rz_bytes (v8i16 VECREG:$rA), R32C:$rB),
- (ROTQMBYv8i16 VECREG:$rA, (SFIr32 R32C:$rB, 0))>;
-def : Pat<(SPUrotquad_rz_bytes (v4i32 VECREG:$rA), R32C:$rB),
- (ROTQMBYv4i32 VECREG:$rA, (SFIr32 R32C:$rB, 0))>;
-def : Pat<(SPUrotquad_rz_bytes (v2i64 VECREG:$rA), R32C:$rB),
- (ROTQMBYv2i64 VECREG:$rA, (SFIr32 R32C:$rB, 0))>;
-def : Pat<(SPUrotquad_rz_bytes GPRC:$rA, R32C:$rB),
- (ROTQMBYr128 GPRC:$rA, (SFIr32 R32C:$rB, 0))>;
-def : Pat<(SPUrotquad_rz_bytes R64C:$rA, R32C:$rB),
- (ROTQMBYr64 R64C:$rA, (SFIr32 R32C:$rB, 0))>;
-
-class ROTQMBYIInst<dag OOL, dag IOL, list<dag> pattern>:
- RI7Form<0b10111111100, OOL, IOL, "rotqmbyi\t$rT, $rA, $val",
- RotateShift, pattern>;
-
-class ROTQMBYIVecInst<ValueType vectype>:
- ROTQMBYIInst<(outs VECREG:$rT), (ins VECREG:$rA, rotNeg7imm:$val),
- [(set (vectype VECREG:$rT),
- (SPUrotquad_rz_bytes (vectype VECREG:$rA), (i32 uimm7:$val)))]>;
-
-class ROTQMBYIRegInst<RegisterClass rclass, Operand optype, ValueType inttype, PatLeaf pred>:
- ROTQMBYIInst<(outs rclass:$rT), (ins rclass:$rA, optype:$val),
- [(set rclass:$rT,
- (SPUrotquad_rz_bytes rclass:$rA, (inttype pred:$val)))]>;
-
-multiclass RotateQuadBytesImm
-{
- def v16i8: ROTQMBYIVecInst<v16i8>;
- def v8i16: ROTQMBYIVecInst<v8i16>;
- def v4i32: ROTQMBYIVecInst<v4i32>;
- def v2i64: ROTQMBYIVecInst<v2i64>;
-
- def r128: ROTQMBYIRegInst<GPRC, rotNeg7imm, i32, uimm7>;
- def r64: ROTQMBYIRegInst<R64C, rotNeg7imm, i32, uimm7>;
-}
-
-defm ROTQMBYI : RotateQuadBytesImm;
-
-
-//-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
-// Rotate right and mask by bit count
-//-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
-
-class ROTQMBYBIInst<dag OOL, dag IOL, list<dag> pattern>:
- RRForm<0b10110011100, OOL, IOL, "rotqmbybi\t$rT, $rA, $rB",
- RotateShift, pattern>;
-
-class ROTQMBYBIVecInst<ValueType vectype>:
- ROTQMBYBIInst<(outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB),
- [/* no pattern, intrinsic? */]>;
-
-multiclass RotateMaskQuadByBitCount
-{
- def v16i8: ROTQMBYBIVecInst<v16i8>;
- def v8i16: ROTQMBYBIVecInst<v8i16>;
- def v4i32: ROTQMBYBIVecInst<v4i32>;
- def v2i64: ROTQMBYBIVecInst<v2i64>;
-}
-
-defm ROTQMBYBI: RotateMaskQuadByBitCount;
-
-//-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
-// Rotate quad and mask by bits
-// Note that the rotate amount has to be negated
-//-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
-
-class ROTQMBIInst<dag OOL, dag IOL, list<dag> pattern>:
- RRForm<0b10011011100, OOL, IOL, "rotqmbi\t$rT, $rA, $rB",
- RotateShift, pattern>;
-
-class ROTQMBIVecInst<ValueType vectype>:
- ROTQMBIInst<(outs VECREG:$rT), (ins VECREG:$rA, R32C:$rB),
- [/* no pattern */]>;
-
-class ROTQMBIRegInst<RegisterClass rclass>:
- ROTQMBIInst<(outs rclass:$rT), (ins rclass:$rA, R32C:$rB),
- [/* no pattern */]>;
-
-multiclass RotateMaskQuadByBits
-{
- def v16i8: ROTQMBIVecInst<v16i8>;
- def v8i16: ROTQMBIVecInst<v8i16>;
- def v4i32: ROTQMBIVecInst<v4i32>;
- def v2i64: ROTQMBIVecInst<v2i64>;
-
- def r128: ROTQMBIRegInst<GPRC>;
- def r64: ROTQMBIRegInst<R64C>;
-}
-
-defm ROTQMBI: RotateMaskQuadByBits;
-
-def : Pat<(SPUrotquad_rz_bits (v16i8 VECREG:$rA), R32C:$rB),
- (ROTQMBIv16i8 VECREG:$rA, (SFIr32 R32C:$rB, 0))>;
-def : Pat<(SPUrotquad_rz_bits (v8i16 VECREG:$rA), R32C:$rB),
- (ROTQMBIv8i16 VECREG:$rA, (SFIr32 R32C:$rB, 0))>;
-def : Pat<(SPUrotquad_rz_bits (v4i32 VECREG:$rA), R32C:$rB),
- (ROTQMBIv4i32 VECREG:$rA, (SFIr32 R32C:$rB, 0))>;
-def : Pat<(SPUrotquad_rz_bits (v2i64 VECREG:$rA), R32C:$rB),
- (ROTQMBIv2i64 VECREG:$rA, (SFIr32 R32C:$rB, 0))>;
-def : Pat<(SPUrotquad_rz_bits GPRC:$rA, R32C:$rB),
- (ROTQMBIr128 GPRC:$rA, (SFIr32 R32C:$rB, 0))>;
-def : Pat<(SPUrotquad_rz_bits R64C:$rA, R32C:$rB),
- (ROTQMBIr64 R64C:$rA, (SFIr32 R32C:$rB, 0))>;
-
-//-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
-// Rotate quad and mask by bits, immediate
-//-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
-
-class ROTQMBIIInst<dag OOL, dag IOL, list<dag> pattern>:
- RI7Form<0b10011111100, OOL, IOL, "rotqmbii\t$rT, $rA, $val",
- RotateShift, pattern>;
-
-class ROTQMBIIVecInst<ValueType vectype>:
- ROTQMBIIInst<(outs VECREG:$rT), (ins VECREG:$rA, rotNeg7imm:$val),
- [(set (vectype VECREG:$rT),
- (SPUrotquad_rz_bits (vectype VECREG:$rA), (i32 uimm7:$val)))]>;
-
-class ROTQMBIIRegInst<RegisterClass rclass>:
- ROTQMBIIInst<(outs rclass:$rT), (ins rclass:$rA, rotNeg7imm:$val),
- [(set rclass:$rT,
- (SPUrotquad_rz_bits rclass:$rA, (i32 uimm7:$val)))]>;
-
-multiclass RotateMaskQuadByBitsImm
-{
- def v16i8: ROTQMBIIVecInst<v16i8>;
- def v8i16: ROTQMBIIVecInst<v8i16>;
- def v4i32: ROTQMBIIVecInst<v4i32>;
- def v2i64: ROTQMBIIVecInst<v2i64>;
-
- def r128: ROTQMBIIRegInst<GPRC>;
- def r64: ROTQMBIIRegInst<R64C>;
-}
-
-defm ROTQMBII: RotateMaskQuadByBitsImm;
-
-//-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
-//-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
-
-def ROTMAHv8i16:
- RRForm<0b01111010000, (outs VECREG:$rT), (ins VECREG:$rA, R32C:$rB),
- "rotmah\t$rT, $rA, $rB", RotateShift,
- [/* see patterns below - $rB must be negated */]>;
-
-def : Pat<(SPUvec_sra VECREG:$rA, R32C:$rB),
- (ROTMAHv8i16 VECREG:$rA, (SFIr32 R32C:$rB, 0))>;
-
-def : Pat<(SPUvec_sra VECREG:$rA, R16C:$rB),
- (ROTMAHv8i16 VECREG:$rA,
- (SFIr32 (XSHWr16 R16C:$rB), 0))>;
-
-def : Pat<(SPUvec_sra VECREG:$rA, R8C:$rB),
- (ROTMAHv8i16 VECREG:$rA,
- (SFIr32 (XSHWr16 (XSBHr8 R8C:$rB)), 0))>;
-
-def ROTMAHr16:
- RRForm<0b01111010000, (outs R16C:$rT), (ins R16C:$rA, R32C:$rB),
- "rotmah\t$rT, $rA, $rB", RotateShift,
- [/* see patterns below - $rB must be negated */]>;
-
-def : Pat<(sra R16C:$rA, R32C:$rB),
- (ROTMAHr16 R16C:$rA, (SFIr32 R32C:$rB, 0))>;
-
-def : Pat<(sra R16C:$rA, R16C:$rB),
- (ROTMAHr16 R16C:$rA,
- (SFIr32 (XSHWr16 R16C:$rB), 0))>;
-
-def : Pat<(sra R16C:$rA, R8C:$rB),
- (ROTMAHr16 R16C:$rA,
- (SFIr32 (XSHWr16 (XSBHr8 R8C:$rB)), 0))>;
-
-def ROTMAHIv8i16:
- RRForm<0b01111110000, (outs VECREG:$rT), (ins VECREG:$rA, rothNeg7imm:$val),
- "rotmahi\t$rT, $rA, $val", RotateShift,
- [(set (v8i16 VECREG:$rT),
- (SPUvec_sra (v8i16 VECREG:$rA), (i32 uimm7:$val)))]>;
-
-def : Pat<(SPUvec_sra (v8i16 VECREG:$rA), (i16 uimm7:$val)),
- (ROTMAHIv8i16 (v8i16 VECREG:$rA), (i32 uimm7:$val))>;
-
-def : Pat<(SPUvec_sra (v8i16 VECREG:$rA), (i8 uimm7:$val)),
- (ROTMAHIv8i16 (v8i16 VECREG:$rA), (i32 uimm7:$val))>;
-
-def ROTMAHIr16:
- RRForm<0b01111110000, (outs R16C:$rT), (ins R16C:$rA, rothNeg7imm_i16:$val),
- "rotmahi\t$rT, $rA, $val", RotateShift,
- [(set R16C:$rT, (sra R16C:$rA, (i16 uimm7:$val)))]>;
-
-def : Pat<(sra R16C:$rA, (i32 imm:$val)),
- (ROTMAHIr16 R16C:$rA, uimm7:$val)>;
-
-def : Pat<(sra R16C:$rA, (i8 imm:$val)),
- (ROTMAHIr16 R16C:$rA, uimm7:$val)>;
-
-def ROTMAv4i32:
- RRForm<0b01011010000, (outs VECREG:$rT), (ins VECREG:$rA, R32C:$rB),
- "rotma\t$rT, $rA, $rB", RotateShift,
- [/* see patterns below - $rB must be negated */]>;
-
-def : Pat<(SPUvec_sra VECREG:$rA, R32C:$rB),
- (ROTMAv4i32 (v4i32 VECREG:$rA), (SFIr32 R32C:$rB, 0))>;
-
-def : Pat<(SPUvec_sra VECREG:$rA, R16C:$rB),
- (ROTMAv4i32 (v4i32 VECREG:$rA),
- (SFIr32 (XSHWr16 R16C:$rB), 0))>;
-
-def : Pat<(SPUvec_sra VECREG:$rA, R8C:$rB),
- (ROTMAv4i32 (v4i32 VECREG:$rA),
- (SFIr32 (XSHWr16 (XSBHr8 R8C:$rB)), 0))>;
-
-def ROTMAr32:
- RRForm<0b01011010000, (outs R32C:$rT), (ins R32C:$rA, R32C:$rB),
- "rotma\t$rT, $rA, $rB", RotateShift,
- [/* see patterns below - $rB must be negated */]>;
-
-def : Pat<(sra R32C:$rA, R32C:$rB),
- (ROTMAr32 R32C:$rA, (SFIr32 R32C:$rB, 0))>;
-
-def : Pat<(sra R32C:$rA, R16C:$rB),
- (ROTMAr32 R32C:$rA,
- (SFIr32 (XSHWr16 R16C:$rB), 0))>;
-
-def : Pat<(sra R32C:$rA, R8C:$rB),
- (ROTMAr32 R32C:$rA,
- (SFIr32 (XSHWr16 (XSBHr8 R8C:$rB)), 0))>;
-
-def ROTMAIv4i32:
- RRForm<0b01011110000, (outs VECREG:$rT), (ins VECREG:$rA, rotNeg7imm:$val),
- "rotmai\t$rT, $rA, $val", RotateShift,
- [(set (v4i32 VECREG:$rT),
- (SPUvec_sra VECREG:$rA, (i32 uimm7:$val)))]>;
-
-def : Pat<(SPUvec_sra VECREG:$rA, (i16 uimm7:$val)),
- (ROTMAIv4i32 VECREG:$rA, uimm7:$val)>;
-
-def ROTMAIr32:
- RRForm<0b01011110000, (outs R32C:$rT), (ins R32C:$rA, rotNeg7imm:$val),
- "rotmai\t$rT, $rA, $val", RotateShift,
- [(set R32C:$rT, (sra R32C:$rA, (i32 uimm7:$val)))]>;
-
-def : Pat<(sra R32C:$rA, (i16 uimm7:$val)),
- (ROTMAIr32 R32C:$rA, uimm7:$val)>;
-
-def : Pat<(sra R32C:$rA, (i8 uimm7:$val)),
- (ROTMAIr32 R32C:$rA, uimm7:$val)>;
-
-//===----------------------------------------------------------------------===//
-// Branch and conditionals:
-//===----------------------------------------------------------------------===//
-
-let isTerminator = 1, isBarrier = 1 in {
- // Halt If Equal (r32 preferred slot only, no vector form)
- def HEQr32:
- RRForm_3<0b00011011110, (outs), (ins R32C:$rA, R32C:$rB),
- "heq\t$rA, $rB", BranchResolv,
- [/* no pattern to match */]>;
-
- def HEQIr32 :
- RI10Form_2<0b11111110, (outs), (ins R32C:$rA, s10imm:$val),
- "heqi\t$rA, $val", BranchResolv,
- [/* no pattern to match */]>;
-
- // HGT/HGTI: These instructions use signed arithmetic for the comparison,
- // contrasting with HLGT/HLGTI, which use unsigned comparison:
- def HGTr32:
- RRForm_3<0b00011010010, (outs), (ins R32C:$rA, R32C:$rB),
- "hgt\t$rA, $rB", BranchResolv,
- [/* no pattern to match */]>;
-
- def HGTIr32:
- RI10Form_2<0b11110010, (outs), (ins R32C:$rA, s10imm:$val),
- "hgti\t$rA, $val", BranchResolv,
- [/* no pattern to match */]>;
-
- def HLGTr32:
- RRForm_3<0b00011011010, (outs), (ins R32C:$rA, R32C:$rB),
- "hlgt\t$rA, $rB", BranchResolv,
- [/* no pattern to match */]>;
-
- def HLGTIr32:
- RI10Form_2<0b11111010, (outs), (ins R32C:$rA, s10imm:$val),
- "hlgti\t$rA, $val", BranchResolv,
- [/* no pattern to match */]>;
-}
-
-//------------------------------------------------------------------------
-// Comparison operators:
-//------------------------------------------------------------------------
-
-class CEQBInst<dag OOL, dag IOL, list<dag> pattern> :
- RRForm<0b00001011110, OOL, IOL, "ceqb\t$rT, $rA, $rB",
- ByteOp, pattern>;
-
-multiclass CmpEqualByte
-{
- def v16i8 :
- CEQBInst<(outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB),
- [(set (v16i8 VECREG:$rT), (seteq (v8i16 VECREG:$rA),
- (v8i16 VECREG:$rB)))]>;
-
- def r8 :
- CEQBInst<(outs R8C:$rT), (ins R8C:$rA, R8C:$rB),
- [(set R8C:$rT, (seteq R8C:$rA, R8C:$rB))]>;
-}
-
-class CEQBIInst<dag OOL, dag IOL, list<dag> pattern> :
- RI10Form<0b01111110, OOL, IOL, "ceqbi\t$rT, $rA, $val",
- ByteOp, pattern>;
-
-multiclass CmpEqualByteImm
-{
- def v16i8 :
- CEQBIInst<(outs VECREG:$rT), (ins VECREG:$rA, s10imm_i8:$val),
- [(set (v16i8 VECREG:$rT), (seteq (v16i8 VECREG:$rA),
- v16i8SExt8Imm:$val))]>;
- def r8:
- CEQBIInst<(outs R8C:$rT), (ins R8C:$rA, s10imm_i8:$val),
- [(set R8C:$rT, (seteq R8C:$rA, immSExt8:$val))]>;
-}
-
-class CEQHInst<dag OOL, dag IOL, list<dag> pattern> :
- RRForm<0b00010011110, OOL, IOL, "ceqh\t$rT, $rA, $rB",
- ByteOp, pattern>;
-
-multiclass CmpEqualHalfword
-{
- def v8i16 : CEQHInst<(outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB),
- [(set (v8i16 VECREG:$rT), (seteq (v8i16 VECREG:$rA),
- (v8i16 VECREG:$rB)))]>;
-
- def r16 : CEQHInst<(outs R16C:$rT), (ins R16C:$rA, R16C:$rB),
- [(set R16C:$rT, (seteq R16C:$rA, R16C:$rB))]>;
-}
-
-class CEQHIInst<dag OOL, dag IOL, list<dag> pattern> :
- RI10Form<0b10111110, OOL, IOL, "ceqhi\t$rT, $rA, $val",
- ByteOp, pattern>;
-
-multiclass CmpEqualHalfwordImm
-{
- def v8i16 : CEQHIInst<(outs VECREG:$rT), (ins VECREG:$rA, s10imm:$val),
- [(set (v8i16 VECREG:$rT),
- (seteq (v8i16 VECREG:$rA),
- (v8i16 v8i16SExt10Imm:$val)))]>;
- def r16 : CEQHIInst<(outs R16C:$rT), (ins R16C:$rA, s10imm:$val),
- [(set R16C:$rT, (seteq R16C:$rA, i16ImmSExt10:$val))]>;
-}
-
-class CEQInst<dag OOL, dag IOL, list<dag> pattern> :
- RRForm<0b00000011110, OOL, IOL, "ceq\t$rT, $rA, $rB",
- ByteOp, pattern>;
-
-multiclass CmpEqualWord
-{
- def v4i32 : CEQInst<(outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB),
- [(set (v4i32 VECREG:$rT),
- (seteq (v4i32 VECREG:$rA), (v4i32 VECREG:$rB)))]>;
-
- def r32 : CEQInst<(outs R32C:$rT), (ins R32C:$rA, R32C:$rB),
- [(set R32C:$rT, (seteq R32C:$rA, R32C:$rB))]>;
-}
-
-class CEQIInst<dag OOL, dag IOL, list<dag> pattern> :
- RI10Form<0b00111110, OOL, IOL, "ceqi\t$rT, $rA, $val",
- ByteOp, pattern>;
-
-multiclass CmpEqualWordImm
-{
- def v4i32 : CEQIInst<(outs VECREG:$rT), (ins VECREG:$rA, s10imm:$val),
- [(set (v4i32 VECREG:$rT),
- (seteq (v4i32 VECREG:$rA),
- (v4i32 v4i32SExt16Imm:$val)))]>;
-
- def r32: CEQIInst<(outs R32C:$rT), (ins R32C:$rA, s10imm_i32:$val),
- [(set R32C:$rT, (seteq R32C:$rA, i32ImmSExt10:$val))]>;
-}
-
-class CGTBInst<dag OOL, dag IOL, list<dag> pattern> :
- RRForm<0b00001010010, OOL, IOL, "cgtb\t$rT, $rA, $rB",
- ByteOp, pattern>;
-
-multiclass CmpGtrByte
-{
- def v16i8 :
- CGTBInst<(outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB),
- [(set (v16i8 VECREG:$rT), (setgt (v8i16 VECREG:$rA),
- (v8i16 VECREG:$rB)))]>;
-
- def r8 :
- CGTBInst<(outs R8C:$rT), (ins R8C:$rA, R8C:$rB),
- [(set R8C:$rT, (setgt R8C:$rA, R8C:$rB))]>;
-}
-
-class CGTBIInst<dag OOL, dag IOL, list<dag> pattern> :
- RI10Form<0b01110010, OOL, IOL, "cgtbi\t$rT, $rA, $val",
- ByteOp, pattern>;
-
-multiclass CmpGtrByteImm
-{
- def v16i8 :
- CGTBIInst<(outs VECREG:$rT), (ins VECREG:$rA, s10imm_i8:$val),
- [(set (v16i8 VECREG:$rT), (setgt (v16i8 VECREG:$rA),
- v16i8SExt8Imm:$val))]>;
- def r8:
- CGTBIInst<(outs R8C:$rT), (ins R8C:$rA, s10imm_i8:$val),
- [(set R8C:$rT, (setgt R8C:$rA, immSExt8:$val))]>;
-}
-
-class CGTHInst<dag OOL, dag IOL, list<dag> pattern> :
- RRForm<0b00010010010, OOL, IOL, "cgth\t$rT, $rA, $rB",
- ByteOp, pattern>;
-
-multiclass CmpGtrHalfword
-{
- def v8i16 : CGTHInst<(outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB),
- [(set (v8i16 VECREG:$rT), (setgt (v8i16 VECREG:$rA),
- (v8i16 VECREG:$rB)))]>;
-
- def r16 : CGTHInst<(outs R16C:$rT), (ins R16C:$rA, R16C:$rB),
- [(set R16C:$rT, (setgt R16C:$rA, R16C:$rB))]>;
-}
-
-class CGTHIInst<dag OOL, dag IOL, list<dag> pattern> :
- RI10Form<0b10110010, OOL, IOL, "cgthi\t$rT, $rA, $val",
- ByteOp, pattern>;
-
-multiclass CmpGtrHalfwordImm
-{
- def v8i16 : CGTHIInst<(outs VECREG:$rT), (ins VECREG:$rA, s10imm:$val),
- [(set (v8i16 VECREG:$rT),
- (setgt (v8i16 VECREG:$rA),
- (v8i16 v8i16SExt10Imm:$val)))]>;
- def r16 : CGTHIInst<(outs R16C:$rT), (ins R16C:$rA, s10imm:$val),
- [(set R16C:$rT, (setgt R16C:$rA, i16ImmSExt10:$val))]>;
-}
-
-class CGTInst<dag OOL, dag IOL, list<dag> pattern> :
- RRForm<0b00000010010, OOL, IOL, "cgt\t$rT, $rA, $rB",
- ByteOp, pattern>;
-
-multiclass CmpGtrWord
-{
- def v4i32 : CGTInst<(outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB),
- [(set (v4i32 VECREG:$rT),
- (setgt (v4i32 VECREG:$rA), (v4i32 VECREG:$rB)))]>;
-
- def r32 : CGTInst<(outs R32C:$rT), (ins R32C:$rA, R32C:$rB),
- [(set R32C:$rT, (setgt R32C:$rA, R32C:$rB))]>;
-}
-
-class CGTIInst<dag OOL, dag IOL, list<dag> pattern> :
- RI10Form<0b00110010, OOL, IOL, "cgti\t$rT, $rA, $val",
- ByteOp, pattern>;
-
-multiclass CmpGtrWordImm
-{
- def v4i32 : CGTIInst<(outs VECREG:$rT), (ins VECREG:$rA, s10imm:$val),
- [(set (v4i32 VECREG:$rT),
- (setgt (v4i32 VECREG:$rA),
- (v4i32 v4i32SExt16Imm:$val)))]>;
-
- def r32: CGTIInst<(outs R32C:$rT), (ins R32C:$rA, s10imm_i32:$val),
- [(set R32C:$rT, (setgt R32C:$rA, i32ImmSExt10:$val))]>;
-}
-
-class CLGTBInst<dag OOL, dag IOL, list<dag> pattern> :
- RRForm<0b00001011010, OOL, IOL, "clgtb\t$rT, $rA, $rB",
- ByteOp, pattern>;
-
-multiclass CmpLGtrByte
-{
- def v16i8 :
- CLGTBInst<(outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB),
- [(set (v16i8 VECREG:$rT), (setugt (v8i16 VECREG:$rA),
- (v8i16 VECREG:$rB)))]>;
-
- def r8 :
- CLGTBInst<(outs R8C:$rT), (ins R8C:$rA, R8C:$rB),
- [(set R8C:$rT, (setugt R8C:$rA, R8C:$rB))]>;
-}
-
-class CLGTBIInst<dag OOL, dag IOL, list<dag> pattern> :
- RI10Form<0b01111010, OOL, IOL, "clgtbi\t$rT, $rA, $val",
- ByteOp, pattern>;
-
-multiclass CmpLGtrByteImm
-{
- def v16i8 :
- CLGTBIInst<(outs VECREG:$rT), (ins VECREG:$rA, s10imm_i8:$val),
- [(set (v16i8 VECREG:$rT), (setugt (v16i8 VECREG:$rA),
- v16i8SExt8Imm:$val))]>;
- def r8:
- CLGTBIInst<(outs R8C:$rT), (ins R8C:$rA, s10imm_i8:$val),
- [(set R8C:$rT, (setugt R8C:$rA, immSExt8:$val))]>;
-}
-
-class CLGTHInst<dag OOL, dag IOL, list<dag> pattern> :
- RRForm<0b00010011010, OOL, IOL, "clgth\t$rT, $rA, $rB",
- ByteOp, pattern>;
-
-multiclass CmpLGtrHalfword
-{
- def v8i16 : CLGTHInst<(outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB),
- [(set (v8i16 VECREG:$rT), (setugt (v8i16 VECREG:$rA),
- (v8i16 VECREG:$rB)))]>;
-
- def r16 : CLGTHInst<(outs R16C:$rT), (ins R16C:$rA, R16C:$rB),
- [(set R16C:$rT, (setugt R16C:$rA, R16C:$rB))]>;
-}
-
-class CLGTHIInst<dag OOL, dag IOL, list<dag> pattern> :
- RI10Form<0b10111010, OOL, IOL, "clgthi\t$rT, $rA, $val",
- ByteOp, pattern>;
-
-multiclass CmpLGtrHalfwordImm
-{
- def v8i16 : CLGTHIInst<(outs VECREG:$rT), (ins VECREG:$rA, s10imm:$val),
- [(set (v8i16 VECREG:$rT),
- (setugt (v8i16 VECREG:$rA),
- (v8i16 v8i16SExt10Imm:$val)))]>;
- def r16 : CLGTHIInst<(outs R16C:$rT), (ins R16C:$rA, s10imm:$val),
- [(set R16C:$rT, (setugt R16C:$rA, i16ImmSExt10:$val))]>;
-}
-
-class CLGTInst<dag OOL, dag IOL, list<dag> pattern> :
- RRForm<0b00000011010, OOL, IOL, "clgt\t$rT, $rA, $rB",
- ByteOp, pattern>;
-
-multiclass CmpLGtrWord
-{
- def v4i32 : CLGTInst<(outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB),
- [(set (v4i32 VECREG:$rT),
- (setugt (v4i32 VECREG:$rA), (v4i32 VECREG:$rB)))]>;
-
- def r32 : CLGTInst<(outs R32C:$rT), (ins R32C:$rA, R32C:$rB),
- [(set R32C:$rT, (setugt R32C:$rA, R32C:$rB))]>;
-}
-
-class CLGTIInst<dag OOL, dag IOL, list<dag> pattern> :
- RI10Form<0b00111010, OOL, IOL, "clgti\t$rT, $rA, $val",
- ByteOp, pattern>;
-
-multiclass CmpLGtrWordImm
-{
- def v4i32 : CLGTIInst<(outs VECREG:$rT), (ins VECREG:$rA, s10imm:$val),
- [(set (v4i32 VECREG:$rT),
- (setugt (v4i32 VECREG:$rA),
- (v4i32 v4i32SExt16Imm:$val)))]>;
-
- def r32: CLGTIInst<(outs R32C:$rT), (ins R32C:$rA, s10imm_i32:$val),
- [(set R32C:$rT, (setugt R32C:$rA, i32ImmSExt10:$val))]>;
-}
-
-defm CEQB : CmpEqualByte;
-defm CEQBI : CmpEqualByteImm;
-defm CEQH : CmpEqualHalfword;
-defm CEQHI : CmpEqualHalfwordImm;
-defm CEQ : CmpEqualWord;
-defm CEQI : CmpEqualWordImm;
-defm CGTB : CmpGtrByte;
-defm CGTBI : CmpGtrByteImm;
-defm CGTH : CmpGtrHalfword;
-defm CGTHI : CmpGtrHalfwordImm;
-defm CGT : CmpGtrWord;
-defm CGTI : CmpGtrWordImm;
-defm CLGTB : CmpLGtrByte;
-defm CLGTBI : CmpLGtrByteImm;
-defm CLGTH : CmpLGtrHalfword;
-defm CLGTHI : CmpLGtrHalfwordImm;
-defm CLGT : CmpLGtrWord;
-defm CLGTI : CmpLGtrWordImm;
-
-//-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
-// For SETCC primitives not supported above (setlt, setle, setge, etc.)
-// define a pattern to generate the right code, as a binary operator
-// (in a manner of speaking.)
-//
-// N.B.: This only matches the setcc set of conditionals. Special pattern
-// matching is used for select conditionals.
-//-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
-
-class SETCCNegCondReg<PatFrag cond, RegisterClass rclass, ValueType inttype,
- SPUInstr xorinst, SPUInstr cmpare>:
- Pat<(cond rclass:$rA, rclass:$rB),
- (xorinst (cmpare rclass:$rA, rclass:$rB), (inttype -1))>;
-
-class SETCCNegCondImm<PatFrag cond, RegisterClass rclass, ValueType inttype,
- PatLeaf immpred, SPUInstr xorinst, SPUInstr cmpare>:
- Pat<(cond rclass:$rA, (inttype immpred:$imm)),
- (xorinst (cmpare rclass:$rA, (inttype immpred:$imm)), (inttype -1))>;
-
-def : SETCCNegCondReg<setne, R8C, i8, XORBIr8, CEQBr8>;
-def : SETCCNegCondImm<setne, R8C, i8, immSExt8, XORBIr8, CEQBIr8>;
-
-def : SETCCNegCondReg<setne, R16C, i16, XORHIr16, CEQHr16>;
-def : SETCCNegCondImm<setne, R16C, i16, i16ImmSExt10, XORHIr16, CEQHIr16>;
-
-def : SETCCNegCondReg<setne, R32C, i32, XORIr32, CEQr32>;
-def : SETCCNegCondImm<setne, R32C, i32, i32ImmSExt10, XORIr32, CEQIr32>;
-
-class SETCCBinOpReg<PatFrag cond, RegisterClass rclass,
- SPUInstr binop, SPUInstr cmpOp1, SPUInstr cmpOp2>:
- Pat<(cond rclass:$rA, rclass:$rB),
- (binop (cmpOp1 rclass:$rA, rclass:$rB),
- (cmpOp2 rclass:$rA, rclass:$rB))>;
-
-class SETCCBinOpImm<PatFrag cond, RegisterClass rclass, PatLeaf immpred,
- ValueType immtype,
- SPUInstr binop, SPUInstr cmpOp1, SPUInstr cmpOp2>:
- Pat<(cond rclass:$rA, (immtype immpred:$imm)),
- (binop (cmpOp1 rclass:$rA, (immtype immpred:$imm)),
- (cmpOp2 rclass:$rA, (immtype immpred:$imm)))>;
-
-def : SETCCBinOpReg<setge, R8C, ORr8, CGTBr8, CEQBr8>;
-def : SETCCBinOpImm<setge, R8C, immSExt8, i8, ORr8, CGTBIr8, CEQBIr8>;
-def : SETCCBinOpReg<setlt, R8C, NORr8, CGTBr8, CEQBr8>;
-def : SETCCBinOpImm<setlt, R8C, immSExt8, i8, NORr8, CGTBIr8, CEQBIr8>;
-def : Pat<(setle R8C:$rA, R8C:$rB),
- (XORBIr8 (CGTBr8 R8C:$rA, R8C:$rB), 0xff)>;
-def : Pat<(setle R8C:$rA, immU8:$imm),
- (XORBIr8 (CGTBIr8 R8C:$rA, immU8:$imm), 0xff)>;
-
-def : SETCCBinOpReg<setge, R16C, ORr16, CGTHr16, CEQHr16>;
-def : SETCCBinOpImm<setge, R16C, i16ImmSExt10, i16,
- ORr16, CGTHIr16, CEQHIr16>;
-def : SETCCBinOpReg<setlt, R16C, NORr16, CGTHr16, CEQHr16>;
-def : SETCCBinOpImm<setlt, R16C, i16ImmSExt10, i16, NORr16, CGTHIr16, CEQHIr16>;
-def : Pat<(setle R16C:$rA, R16C:$rB),
- (XORHIr16 (CGTHr16 R16C:$rA, R16C:$rB), 0xffff)>;
-def : Pat<(setle R16C:$rA, i16ImmSExt10:$imm),
- (XORHIr16 (CGTHIr16 R16C:$rA, i16ImmSExt10:$imm), 0xffff)>;
-
-def : SETCCBinOpReg<setge, R32C, ORr32, CGTr32, CEQr32>;
-def : SETCCBinOpImm<setge, R32C, i32ImmSExt10, i32,
- ORr32, CGTIr32, CEQIr32>;
-def : SETCCBinOpReg<setlt, R32C, NORr32, CGTr32, CEQr32>;
-def : SETCCBinOpImm<setlt, R32C, i32ImmSExt10, i32, NORr32, CGTIr32, CEQIr32>;
-def : Pat<(setle R32C:$rA, R32C:$rB),
- (XORIr32 (CGTr32 R32C:$rA, R32C:$rB), 0xffffffff)>;
-def : Pat<(setle R32C:$rA, i32ImmSExt10:$imm),
- (XORIr32 (CGTIr32 R32C:$rA, i32ImmSExt10:$imm), 0xffffffff)>;
-
-def : SETCCBinOpReg<setuge, R8C, ORr8, CLGTBr8, CEQBr8>;
-def : SETCCBinOpImm<setuge, R8C, immSExt8, i8, ORr8, CLGTBIr8, CEQBIr8>;
-def : SETCCBinOpReg<setult, R8C, NORr8, CLGTBr8, CEQBr8>;
-def : SETCCBinOpImm<setult, R8C, immSExt8, i8, NORr8, CLGTBIr8, CEQBIr8>;
-def : Pat<(setule R8C:$rA, R8C:$rB),
- (XORBIr8 (CLGTBr8 R8C:$rA, R8C:$rB), 0xff)>;
-def : Pat<(setule R8C:$rA, immU8:$imm),
- (XORBIr8 (CLGTBIr8 R8C:$rA, immU8:$imm), 0xff)>;
-
-def : SETCCBinOpReg<setuge, R16C, ORr16, CLGTHr16, CEQHr16>;
-def : SETCCBinOpImm<setuge, R16C, i16ImmSExt10, i16,
- ORr16, CLGTHIr16, CEQHIr16>;
-def : SETCCBinOpReg<setult, R16C, NORr16, CLGTHr16, CEQHr16>;
-def : SETCCBinOpImm<setult, R16C, i16ImmSExt10, i16, NORr16,
- CLGTHIr16, CEQHIr16>;
-def : Pat<(setule R16C:$rA, R16C:$rB),
- (XORHIr16 (CLGTHr16 R16C:$rA, R16C:$rB), 0xffff)>;
-def : Pat<(setule R16C:$rA, i16ImmSExt10:$imm),
- (XORHIr16 (CLGTHIr16 R16C:$rA, i16ImmSExt10:$imm), 0xffff)>;
-
-def : SETCCBinOpReg<setuge, R32C, ORr32, CLGTr32, CEQr32>;
-def : SETCCBinOpImm<setuge, R32C, i32ImmSExt10, i32,
- ORr32, CLGTIr32, CEQIr32>;
-def : SETCCBinOpReg<setult, R32C, NORr32, CLGTr32, CEQr32>;
-def : SETCCBinOpImm<setult, R32C, i32ImmSExt10, i32, NORr32, CLGTIr32, CEQIr32>;
-def : Pat<(setule R32C:$rA, R32C:$rB),
- (XORIr32 (CLGTr32 R32C:$rA, R32C:$rB), 0xffffffff)>;
-def : Pat<(setule R32C:$rA, i32ImmSExt10:$imm),
- (XORIr32 (CLGTIr32 R32C:$rA, i32ImmSExt10:$imm), 0xffffffff)>;
-
-//-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
-// select conditional patterns:
-//-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
-
-class SELECTNegCondReg<PatFrag cond, RegisterClass rclass, ValueType inttype,
- SPUInstr selinstr, SPUInstr cmpare>:
- Pat<(select (inttype (cond rclass:$rA, rclass:$rB)),
- rclass:$rTrue, rclass:$rFalse),
- (selinstr rclass:$rTrue, rclass:$rFalse,
- (cmpare rclass:$rA, rclass:$rB))>;
-
-class SELECTNegCondImm<PatFrag cond, RegisterClass rclass, ValueType inttype,
- PatLeaf immpred, SPUInstr selinstr, SPUInstr cmpare>:
- Pat<(select (inttype (cond rclass:$rA, immpred:$imm)),
- rclass:$rTrue, rclass:$rFalse),
- (selinstr rclass:$rTrue, rclass:$rFalse,
- (cmpare rclass:$rA, immpred:$imm))>;
-
-def : SELECTNegCondReg<setne, R8C, i8, SELBr8, CEQBr8>;
-def : SELECTNegCondImm<setne, R8C, i8, immSExt8, SELBr8, CEQBIr8>;
-def : SELECTNegCondReg<setle, R8C, i8, SELBr8, CGTBr8>;
-def : SELECTNegCondImm<setle, R8C, i8, immSExt8, SELBr8, CGTBr8>;
-def : SELECTNegCondReg<setule, R8C, i8, SELBr8, CLGTBr8>;
-def : SELECTNegCondImm<setule, R8C, i8, immU8, SELBr8, CLGTBIr8>;
-
-def : SELECTNegCondReg<setne, R16C, i16, SELBr16, CEQHr16>;
-def : SELECTNegCondImm<setne, R16C, i16, i16ImmSExt10, SELBr16, CEQHIr16>;
-def : SELECTNegCondReg<setle, R16C, i16, SELBr16, CGTHr16>;
-def : SELECTNegCondImm<setle, R16C, i16, i16ImmSExt10, SELBr16, CGTHIr16>;
-def : SELECTNegCondReg<setule, R16C, i16, SELBr16, CLGTHr16>;
-def : SELECTNegCondImm<setule, R16C, i16, i16ImmSExt10, SELBr16, CLGTHIr16>;
-
-def : SELECTNegCondReg<setne, R32C, i32, SELBr32, CEQr32>;
-def : SELECTNegCondImm<setne, R32C, i32, i32ImmSExt10, SELBr32, CEQIr32>;
-def : SELECTNegCondReg<setle, R32C, i32, SELBr32, CGTr32>;
-def : SELECTNegCondImm<setle, R32C, i32, i32ImmSExt10, SELBr32, CGTIr32>;
-def : SELECTNegCondReg<setule, R32C, i32, SELBr32, CLGTr32>;
-def : SELECTNegCondImm<setule, R32C, i32, i32ImmSExt10, SELBr32, CLGTIr32>;
-
-class SELECTBinOpReg<PatFrag cond, RegisterClass rclass, ValueType inttype,
- SPUInstr selinstr, SPUInstr binop, SPUInstr cmpOp1,
- SPUInstr cmpOp2>:
- Pat<(select (inttype (cond rclass:$rA, rclass:$rB)),
- rclass:$rFalse, rclass:$rTrue),
- (selinstr rclass:$rTrue, rclass:$rFalse,
- (binop (cmpOp1 rclass:$rA, rclass:$rB),
- (cmpOp2 rclass:$rA, rclass:$rB)))>;
-
-class SELECTBinOpImm<PatFrag cond, RegisterClass rclass, PatLeaf immpred,
- ValueType inttype,
- SPUInstr selinstr, SPUInstr binop, SPUInstr cmpOp1,
- SPUInstr cmpOp2>:
- Pat<(select (inttype (cond rclass:$rA, (inttype immpred:$imm))),
- rclass:$rTrue, rclass:$rFalse),
- (selinstr rclass:$rFalse, rclass:$rTrue,
- (binop (cmpOp1 rclass:$rA, (inttype immpred:$imm)),
- (cmpOp2 rclass:$rA, (inttype immpred:$imm))))>;
-
-def : SELECTBinOpReg<setge, R8C, i8, SELBr8, ORr8, CGTBr8, CEQBr8>;
-def : SELECTBinOpImm<setge, R8C, immSExt8, i8,
- SELBr8, ORr8, CGTBIr8, CEQBIr8>;
-
-def : SELECTBinOpReg<setge, R16C, i16, SELBr16, ORr16, CGTHr16, CEQHr16>;
-def : SELECTBinOpImm<setge, R16C, i16ImmSExt10, i16,
- SELBr16, ORr16, CGTHIr16, CEQHIr16>;
-
-def : SELECTBinOpReg<setge, R32C, i32, SELBr32, ORr32, CGTr32, CEQr32>;
-def : SELECTBinOpImm<setge, R32C, i32ImmSExt10, i32,
- SELBr32, ORr32, CGTIr32, CEQIr32>;
-
-def : SELECTBinOpReg<setuge, R8C, i8, SELBr8, ORr8, CLGTBr8, CEQBr8>;
-def : SELECTBinOpImm<setuge, R8C, immSExt8, i8,
- SELBr8, ORr8, CLGTBIr8, CEQBIr8>;
-
-def : SELECTBinOpReg<setuge, R16C, i16, SELBr16, ORr16, CLGTHr16, CEQHr16>;
-def : SELECTBinOpImm<setuge, R16C, i16ImmUns10, i16,
- SELBr16, ORr16, CLGTHIr16, CEQHIr16>;
-
-def : SELECTBinOpReg<setuge, R32C, i32, SELBr32, ORr32, CLGTr32, CEQr32>;
-def : SELECTBinOpImm<setuge, R32C, i32ImmUns10, i32,
- SELBr32, ORr32, CLGTIr32, CEQIr32>;
-
-//-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
-
-let isCall = 1,
- // All calls clobber the non-callee-saved registers:
- Defs = [R0, R1, R2, R3, R4, R5, R6, R7, R8, R9,
- R10,R11,R12,R13,R14,R15,R16,R17,R18,R19,
- R20,R21,R22,R23,R24,R25,R26,R27,R28,R29,
- R30,R31,R32,R33,R34,R35,R36,R37,R38,R39,
- R40,R41,R42,R43,R44,R45,R46,R47,R48,R49,
- R50,R51,R52,R53,R54,R55,R56,R57,R58,R59,
- R60,R61,R62,R63,R64,R65,R66,R67,R68,R69,
- R70,R71,R72,R73,R74,R75,R76,R77,R78,R79],
- // All of these instructions use $lr (aka $0)
- Uses = [R0] in {
- // Branch relative and set link: Used if we actually know that the target
- // is within [-32768, 32767] bytes of the target
- def BRSL:
- BranchSetLink<0b011001100, (outs), (ins relcalltarget:$func, variable_ops),
- "brsl\t$$lr, $func",
- [(SPUcall (SPUpcrel tglobaladdr:$func, 0))]>;
-
- // Branch absolute and set link: Used if we actually know that the target
- // is an absolute address
- def BRASL:
- BranchSetLink<0b011001100, (outs), (ins calltarget:$func, variable_ops),
- "brasl\t$$lr, $func",
- [(SPUcall (SPUaform tglobaladdr:$func, 0))]>;
-
- // Branch indirect and set link if external data. These instructions are not
- // actually generated, matched by an intrinsic:
- def BISLED_00: BISLEDForm<0b11, "bisled\t$$lr, $func", [/* empty pattern */]>;
- def BISLED_E0: BISLEDForm<0b10, "bisled\t$$lr, $func", [/* empty pattern */]>;
- def BISLED_0D: BISLEDForm<0b01, "bisled\t$$lr, $func", [/* empty pattern */]>;
- def BISLED_ED: BISLEDForm<0b00, "bisled\t$$lr, $func", [/* empty pattern */]>;
-
- // Branch indirect and set link. This is the "X-form" address version of a
- // function call
- def BISL:
- BIForm<0b10010101100, "bisl\t$$lr, $func", [(SPUcall R32C:$func)]>;
-}
-
-// Unconditional branches:
-let isBranch = 1, isTerminator = 1, hasCtrlDep = 1, isBarrier = 1 in {
- def BR :
- UncondBranch<0b001001100, (outs), (ins brtarget:$dest),
- "br\t$dest",
- [(br bb:$dest)]>;
-
- // Unconditional, absolute address branch
- def BRA:
- UncondBranch<0b001100000, (outs), (ins brtarget:$dest),
- "bra\t$dest",
- [/* no pattern */]>;
-
- // Indirect branch
- def BI:
- BIForm<0b00010101100, "bi\t$func", [(brind R32C:$func)]>;
-
- // Various branches:
- def BRNZ:
- RI16Form<0b010000100, (outs), (ins R32C:$rCond, brtarget:$dest),
- "brnz\t$rCond,$dest",
- BranchResolv,
- [(brcond R32C:$rCond, bb:$dest)]>;
-
- def BRZ:
- RI16Form<0b000000100, (outs), (ins R32C:$rT, brtarget:$dest),
- "brz\t$rT,$dest",
- BranchResolv,
- [/* no pattern */]>;
-
- def BRHNZ:
- RI16Form<0b011000100, (outs), (ins R16C:$rCond, brtarget:$dest),
- "brhnz\t$rCond,$dest",
- BranchResolv,
- [(brcond R16C:$rCond, bb:$dest)]>;
-
- def BRHZ:
- RI16Form<0b001000100, (outs), (ins R16C:$rT, brtarget:$dest),
- "brhz\t$rT,$dest",
- BranchResolv,
- [/* no pattern */]>;
-
-/*
- def BINZ:
- BICondForm<0b10010100100, "binz\t$rA, $func",
- [(SPUbinz R32C:$rA, R32C:$func)]>;
-
- def BIZ:
- BICondForm<0b00010100100, "biz\t$rA, $func",
- [(SPUbiz R32C:$rA, R32C:$func)]>;
-*/
-}
-
-//===----------------------------------------------------------------------===//
-// setcc and brcond patterns:
-//===----------------------------------------------------------------------===//
-
-def : Pat<(brcond (i16 (seteq R16C:$rA, 0)), bb:$dest),
- (BRHZ R16C:$rA, bb:$dest)>;
-def : Pat<(brcond (i16 (setne R16C:$rA, 0)), bb:$dest),
- (BRHNZ R16C:$rA, bb:$dest)>;
-
-def : Pat<(brcond (i32 (seteq R32C:$rA, 0)), bb:$dest),
- (BRZ R32C:$rA, bb:$dest)>;
-def : Pat<(brcond (i32 (setne R32C:$rA, 0)), bb:$dest),
- (BRNZ R32C:$rA, bb:$dest)>;
-
-multiclass BranchCondEQ<PatFrag cond, SPUInstr brinst16, SPUInstr brinst32>
-{
- def r16imm: Pat<(brcond (i16 (cond R16C:$rA, i16ImmSExt10:$val)), bb:$dest),
- (brinst16 (CEQHIr16 R16C:$rA, i16ImmSExt10:$val), bb:$dest)>;
-
- def r16 : Pat<(brcond (i16 (cond R16C:$rA, R16C:$rB)), bb:$dest),
- (brinst16 (CEQHr16 R16C:$rA, R16:$rB), bb:$dest)>;
-
- def r32imm : Pat<(brcond (i32 (cond R32C:$rA, i32ImmSExt10:$val)), bb:$dest),
- (brinst32 (CEQIr32 R32C:$rA, i32ImmSExt10:$val), bb:$dest)>;
-
- def r32 : Pat<(brcond (i32 (cond R32C:$rA, R32C:$rB)), bb:$dest),
- (brinst32 (CEQr32 R32C:$rA, R32C:$rB), bb:$dest)>;
-}
-
-defm BRCONDeq : BranchCondEQ<seteq, BRHZ, BRZ>;
-defm BRCONDne : BranchCondEQ<setne, BRHNZ, BRNZ>;
-
-multiclass BranchCondLGT<PatFrag cond, SPUInstr brinst16, SPUInstr brinst32>
-{
- def r16imm : Pat<(brcond (i16 (cond R16C:$rA, i16ImmSExt10:$val)), bb:$dest),
- (brinst16 (CLGTHIr16 R16C:$rA, i16ImmSExt10:$val), bb:$dest)>;
-
- def r16 : Pat<(brcond (i16 (cond R16C:$rA, R16C:$rB)), bb:$dest),
- (brinst16 (CLGTHr16 R16C:$rA, R16:$rB), bb:$dest)>;
-
- def r32imm : Pat<(brcond (i32 (cond R32C:$rA, i32ImmSExt10:$val)), bb:$dest),
- (brinst32 (CLGTIr32 R32C:$rA, i32ImmSExt10:$val), bb:$dest)>;
-
- def r32 : Pat<(brcond (i32 (cond R32C:$rA, R32C:$rB)), bb:$dest),
- (brinst32 (CLGTr32 R32C:$rA, R32C:$rB), bb:$dest)>;
-}
-
-defm BRCONDugt : BranchCondLGT<setugt, BRHNZ, BRNZ>;
-defm BRCONDule : BranchCondLGT<setule, BRHZ, BRZ>;
-
-multiclass BranchCondLGTEQ<PatFrag cond, SPUInstr orinst16, SPUInstr brinst16,
- SPUInstr orinst32, SPUInstr brinst32>
-{
- def r16imm: Pat<(brcond (i16 (cond R16C:$rA, i16ImmSExt10:$val)), bb:$dest),
- (brinst16 (orinst16 (CLGTHIr16 R16C:$rA, i16ImmSExt10:$val),
- (CEQHIr16 R16C:$rA, i16ImmSExt10:$val)),
- bb:$dest)>;
-
- def r16: Pat<(brcond (i16 (cond R16C:$rA, R16C:$rB)), bb:$dest),
- (brinst16 (orinst16 (CLGTHr16 R16C:$rA, R16:$rB),
- (CEQHr16 R16C:$rA, R16:$rB)),
- bb:$dest)>;
-
- def r32imm : Pat<(brcond (i32 (cond R32C:$rA, i32ImmSExt10:$val)), bb:$dest),
- (brinst32 (orinst32 (CLGTIr32 R32C:$rA, i32ImmSExt10:$val),
- (CEQIr32 R32C:$rA, i32ImmSExt10:$val)),
- bb:$dest)>;
-
- def r32 : Pat<(brcond (i32 (cond R32C:$rA, R32C:$rB)), bb:$dest),
- (brinst32 (orinst32 (CLGTr32 R32C:$rA, R32C:$rB),
- (CEQr32 R32C:$rA, R32C:$rB)),
- bb:$dest)>;
-}
-
-defm BRCONDuge : BranchCondLGTEQ<setuge, ORr16, BRHNZ, ORr32, BRNZ>;
-defm BRCONDult : BranchCondLGTEQ<setult, ORr16, BRHZ, ORr32, BRZ>;
-
-multiclass BranchCondGT<PatFrag cond, SPUInstr brinst16, SPUInstr brinst32>
-{
- def r16imm : Pat<(brcond (i16 (cond R16C:$rA, i16ImmSExt10:$val)), bb:$dest),
- (brinst16 (CGTHIr16 R16C:$rA, i16ImmSExt10:$val), bb:$dest)>;
-
- def r16 : Pat<(brcond (i16 (cond R16C:$rA, R16C:$rB)), bb:$dest),
- (brinst16 (CGTHr16 R16C:$rA, R16:$rB), bb:$dest)>;
-
- def r32imm : Pat<(brcond (i32 (cond R32C:$rA, i32ImmSExt10:$val)), bb:$dest),
- (brinst32 (CGTIr32 R32C:$rA, i32ImmSExt10:$val), bb:$dest)>;
-
- def r32 : Pat<(brcond (i32 (cond R32C:$rA, R32C:$rB)), bb:$dest),
- (brinst32 (CGTr32 R32C:$rA, R32C:$rB), bb:$dest)>;
-}
-
-defm BRCONDgt : BranchCondGT<setgt, BRHNZ, BRNZ>;
-defm BRCONDle : BranchCondGT<setle, BRHZ, BRZ>;
-
-multiclass BranchCondGTEQ<PatFrag cond, SPUInstr orinst16, SPUInstr brinst16,
- SPUInstr orinst32, SPUInstr brinst32>
-{
- def r16imm: Pat<(brcond (i16 (cond R16C:$rA, i16ImmSExt10:$val)), bb:$dest),
- (brinst16 (orinst16 (CGTHIr16 R16C:$rA, i16ImmSExt10:$val),
- (CEQHIr16 R16C:$rA, i16ImmSExt10:$val)),
- bb:$dest)>;
-
- def r16: Pat<(brcond (i16 (cond R16C:$rA, R16C:$rB)), bb:$dest),
- (brinst16 (orinst16 (CGTHr16 R16C:$rA, R16:$rB),
- (CEQHr16 R16C:$rA, R16:$rB)),
- bb:$dest)>;
-
- def r32imm : Pat<(brcond (i32 (cond R32C:$rA, i32ImmSExt10:$val)), bb:$dest),
- (brinst32 (orinst32 (CGTIr32 R32C:$rA, i32ImmSExt10:$val),
- (CEQIr32 R32C:$rA, i32ImmSExt10:$val)),
- bb:$dest)>;
-
- def r32 : Pat<(brcond (i32 (cond R32C:$rA, R32C:$rB)), bb:$dest),
- (brinst32 (orinst32 (CGTr32 R32C:$rA, R32C:$rB),
- (CEQr32 R32C:$rA, R32C:$rB)),
- bb:$dest)>;
-}
-
-defm BRCONDge : BranchCondGTEQ<setge, ORr16, BRHNZ, ORr32, BRNZ>;
-defm BRCONDlt : BranchCondGTEQ<setlt, ORr16, BRHZ, ORr32, BRZ>;
-
-let isTerminator = 1, isBarrier = 1 in {
- let isReturn = 1 in {
- def RET:
- RETForm<"bi\t$$lr", [(retflag)]>;
- }
-}
-
-//===----------------------------------------------------------------------===//
-// Single precision floating point instructions
-//===----------------------------------------------------------------------===//
-
-def FAv4f32:
- RRForm<0b00100011010, (outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB),
- "fa\t$rT, $rA, $rB", SPrecFP,
- [(set (v4f32 VECREG:$rT), (fadd (v4f32 VECREG:$rA), (v4f32 VECREG:$rB)))]>;
-
-def FAf32 :
- RRForm<0b00100011010, (outs R32FP:$rT), (ins R32FP:$rA, R32FP:$rB),
- "fa\t$rT, $rA, $rB", SPrecFP,
- [(set R32FP:$rT, (fadd R32FP:$rA, R32FP:$rB))]>;
-
-def FSv4f32:
- RRForm<0b00100011010, (outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB),
- "fs\t$rT, $rA, $rB", SPrecFP,
- [(set (v4f32 VECREG:$rT), (fsub (v4f32 VECREG:$rA), (v4f32 VECREG:$rB)))]>;
-
-def FSf32 :
- RRForm<0b10100011010, (outs R32FP:$rT), (ins R32FP:$rA, R32FP:$rB),
- "fs\t$rT, $rA, $rB", SPrecFP,
- [(set R32FP:$rT, (fsub R32FP:$rA, R32FP:$rB))]>;
-
-// Floating point reciprocal estimate
-def FREv4f32 :
- RRForm_1<0b00011101100, (outs VECREG:$rT), (ins VECREG:$rA),
- "frest\t$rT, $rA", SPrecFP,
- [(set (v4f32 VECREG:$rT), (SPUreciprocalEst (v4f32 VECREG:$rA)))]>;
-
-def FREf32 :
- RRForm_1<0b00011101100, (outs R32FP:$rT), (ins R32FP:$rA),
- "frest\t$rT, $rA", SPrecFP,
- [(set R32FP:$rT, (SPUreciprocalEst R32FP:$rA))]>;
-
-// Floating point interpolate (used in conjunction with reciprocal estimate)
-def FIv4f32 :
- RRForm<0b00101011110, (outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB),
- "fi\t$rT, $rA, $rB", SPrecFP,
- [(set (v4f32 VECREG:$rT), (SPUinterpolate (v4f32 VECREG:$rA),
- (v4f32 VECREG:$rB)))]>;
-
-def FIf32 :
- RRForm<0b00101011110, (outs R32FP:$rT), (ins R32FP:$rA, R32FP:$rB),
- "fi\t$rT, $rA, $rB", SPrecFP,
- [(set R32FP:$rT, (SPUinterpolate R32FP:$rA, R32FP:$rB))]>;
-
-// Floating Compare Equal
-def FCEQf32 :
- RRForm<0b01000011110, (outs R32C:$rT), (ins R32FP:$rA, R32FP:$rB),
- "fceq\t$rT, $rA, $rB", SPrecFP,
- [(set R32C:$rT, (setoeq R32FP:$rA, R32FP:$rB))]>;
-
-def FCMEQf32 :
- RRForm<0b01010011110, (outs R32C:$rT), (ins R32FP:$rA, R32FP:$rB),
- "fcmeq\t$rT, $rA, $rB", SPrecFP,
- [(set R32C:$rT, (setoeq (fabs R32FP:$rA), (fabs R32FP:$rB)))]>;
-
-def FCGTf32 :
- RRForm<0b01000011010, (outs R32C:$rT), (ins R32FP:$rA, R32FP:$rB),
- "fcgt\t$rT, $rA, $rB", SPrecFP,
- [(set R32C:$rT, (setogt R32FP:$rA, R32FP:$rB))]>;
-
-def FCMGTf32 :
- RRForm<0b01010011010, (outs R32C:$rT), (ins R32FP:$rA, R32FP:$rB),
- "fcmgt\t$rT, $rA, $rB", SPrecFP,
- [(set R32C:$rT, (setogt (fabs R32FP:$rA), (fabs R32FP:$rB)))]>;
-
-// FP Status and Control Register Write
-// Why isn't rT a don't care in the ISA?
-// Should we create a special RRForm_3 for this guy and zero out the rT?
-def FSCRWf32 :
- RRForm_1<0b01011101110, (outs R32FP:$rT), (ins R32FP:$rA),
- "fscrwr\t$rA", SPrecFP,
- [/* This instruction requires an intrinsic. Note: rT is unused. */]>;
-
-// FP Status and Control Register Read
-def FSCRRf32 :
- RRForm_2<0b01011101110, (outs R32FP:$rT), (ins),
- "fscrrd\t$rT", SPrecFP,
- [/* This instruction requires an intrinsic */]>;
-
-// llvm instruction space
-// How do these map onto cell instructions?
-// fdiv rA rB
-// frest rC rB # c = 1/b (both lines)
-// fi rC rB rC
-// fm rD rA rC # d = a * 1/b
-// fnms rB rD rB rA # b = - (d * b - a) --should == 0 in a perfect world
-// fma rB rB rC rD # b = b * c + d
-// = -(d *b -a) * c + d
-// = a * c - c ( a *b *c - a)
-
-// fcopysign (???)
-
-// Library calls:
-// These llvm instructions will actually map to library calls.
-// All that's needed, then, is to check that the appropriate library is
-// imported and do a brsl to the proper function name.
-// frem # fmod(x, y): x - (x/y) * y
-// (Note: fmod(double, double), fmodf(float,float)
-// fsqrt?
-// fsin?
-// fcos?
-// Unimplemented SPU instruction space
-// floating reciprocal absolute square root estimate (frsqest)
-
-// The following are probably just intrinsics
-// status and control register write
-// status and control register read
-
-//--------------------------------------
-// Floating point multiply instructions
-//--------------------------------------
-
-def FMv4f32:
- RRForm<0b00100011010, (outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB),
- "fm\t$rT, $rA, $rB", SPrecFP,
- [(set (v4f32 VECREG:$rT), (fmul (v4f32 VECREG:$rA),
- (v4f32 VECREG:$rB)))]>;
-
-def FMf32 :
- RRForm<0b01100011010, (outs R32FP:$rT), (ins R32FP:$rA, R32FP:$rB),
- "fm\t$rT, $rA, $rB", SPrecFP,
- [(set R32FP:$rT, (fmul R32FP:$rA, R32FP:$rB))]>;
-
-// Floating point multiply and add
-// e.g. d = c + (a * b)
-def FMAv4f32:
- RRRForm<0b0111, (outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB, VECREG:$rC),
- "fma\t$rT, $rA, $rB, $rC", SPrecFP,
- [(set (v4f32 VECREG:$rT),
- (fadd (v4f32 VECREG:$rC),
- (fmul (v4f32 VECREG:$rA), (v4f32 VECREG:$rB))))]>;
-
-def FMAf32:
- RRRForm<0b0111, (outs R32FP:$rT), (ins R32FP:$rA, R32FP:$rB, R32FP:$rC),
- "fma\t$rT, $rA, $rB, $rC", SPrecFP,
- [(set R32FP:$rT, (fadd R32FP:$rC, (fmul R32FP:$rA, R32FP:$rB)))]>;
-
-// FP multiply and subtract
-// Subtracts value in rC from product
-// res = a * b - c
-def FMSv4f32 :
- RRRForm<0b0111, (outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB, VECREG:$rC),
- "fms\t$rT, $rA, $rB, $rC", SPrecFP,
- [(set (v4f32 VECREG:$rT),
- (fsub (fmul (v4f32 VECREG:$rA), (v4f32 VECREG:$rB)),
- (v4f32 VECREG:$rC)))]>;
-
-def FMSf32 :
- RRRForm<0b0111, (outs R32FP:$rT), (ins R32FP:$rA, R32FP:$rB, R32FP:$rC),
- "fms\t$rT, $rA, $rB, $rC", SPrecFP,
- [(set R32FP:$rT,
- (fsub (fmul R32FP:$rA, R32FP:$rB), R32FP:$rC))]>;
-
-// Floating Negative Mulitply and Subtract
-// Subtracts product from value in rC
-// res = fneg(fms a b c)
-// = - (a * b - c)
-// = c - a * b
-// NOTE: subtraction order
-// fsub a b = a - b
-// fs a b = b - a?
-def FNMSf32 :
- RRRForm<0b1101, (outs R32FP:$rT), (ins R32FP:$rA, R32FP:$rB, R32FP:$rC),
- "fnms\t$rT, $rA, $rB, $rC", SPrecFP,
- [(set R32FP:$rT, (fsub R32FP:$rC, (fmul R32FP:$rA, R32FP:$rB)))]>;
-
-def FNMSv4f32 :
- RRRForm<0b1101, (outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB, VECREG:$rC),
- "fnms\t$rT, $rA, $rB, $rC", SPrecFP,
- [(set (v4f32 VECREG:$rT),
- (fsub (v4f32 VECREG:$rC),
- (fmul (v4f32 VECREG:$rA),
- (v4f32 VECREG:$rB))))]>;
-
-//--------------------------------------
-// Floating Point Conversions
-// Signed conversions:
-def CSiFv4f32:
- CVTIntFPForm<0b0101101110, (outs VECREG:$rT), (ins VECREG:$rA),
- "csflt\t$rT, $rA, 0", SPrecFP,
- [(set (v4f32 VECREG:$rT), (sint_to_fp (v4i32 VECREG:$rA)))]>;
-
-// Convert signed integer to floating point
-def CSiFf32 :
- CVTIntFPForm<0b0101101110, (outs R32FP:$rT), (ins R32C:$rA),
- "csflt\t$rT, $rA, 0", SPrecFP,
- [(set R32FP:$rT, (sint_to_fp R32C:$rA))]>;
-
-// Convert unsigned into to float
-def CUiFv4f32 :
- CVTIntFPForm<0b1101101110, (outs VECREG:$rT), (ins VECREG:$rA),
- "cuflt\t$rT, $rA, 0", SPrecFP,
- [(set (v4f32 VECREG:$rT), (uint_to_fp (v4i32 VECREG:$rA)))]>;
-
-def CUiFf32 :
- CVTIntFPForm<0b1101101110, (outs R32FP:$rT), (ins R32C:$rA),
- "cuflt\t$rT, $rA, 0", SPrecFP,
- [(set R32FP:$rT, (uint_to_fp R32C:$rA))]>;
-
-// Convert float to unsigned int
-// Assume that scale = 0
-
-def CFUiv4f32 :
- CVTIntFPForm<0b1101101110, (outs VECREG:$rT), (ins VECREG:$rA),
- "cfltu\t$rT, $rA, 0", SPrecFP,
- [(set (v4i32 VECREG:$rT), (fp_to_uint (v4f32 VECREG:$rA)))]>;
-
-def CFUif32 :
- CVTIntFPForm<0b1101101110, (outs R32C:$rT), (ins R32FP:$rA),
- "cfltu\t$rT, $rA, 0", SPrecFP,
- [(set R32C:$rT, (fp_to_uint R32FP:$rA))]>;
-
-// Convert float to signed int
-// Assume that scale = 0
-
-def CFSiv4f32 :
- CVTIntFPForm<0b1101101110, (outs VECREG:$rT), (ins VECREG:$rA),
- "cflts\t$rT, $rA, 0", SPrecFP,
- [(set (v4i32 VECREG:$rT), (fp_to_sint (v4f32 VECREG:$rA)))]>;
-
-def CFSif32 :
- CVTIntFPForm<0b1101101110, (outs R32C:$rT), (ins R32FP:$rA),
- "cflts\t$rT, $rA, 0", SPrecFP,
- [(set R32C:$rT, (fp_to_sint R32FP:$rA))]>;
-
-//===----------------------------------------------------------------------==//
-// Single<->Double precision conversions
-//===----------------------------------------------------------------------==//
-
-// NOTE: We use "vec" name suffix here to avoid confusion (e.g. input is a
-// v4f32, output is v2f64--which goes in the name?)
-
-// Floating point extend single to double
-// NOTE: Not sure if passing in v4f32 to FESDvec is correct since it
-// operates on two double-word slots (i.e. 1st and 3rd fp numbers
-// are ignored).
-def FESDvec :
- RRForm_1<0b00011101110, (outs VECREG:$rT), (ins VECREG:$rA),
- "fesd\t$rT, $rA", SPrecFP,
- [(set (v2f64 VECREG:$rT), (fextend (v4f32 VECREG:$rA)))]>;
-
-def FESDf32 :
- RRForm_1<0b00011101110, (outs R64FP:$rT), (ins R32FP:$rA),
- "fesd\t$rT, $rA", SPrecFP,
- [(set R64FP:$rT, (fextend R32FP:$rA))]>;
-
-// Floating point round double to single
-//def FRDSvec :
-// RRForm_1<0b10011101110, (outs VECREG:$rT), (ins VECREG:$rA),
-// "frds\t$rT, $rA,", SPrecFP,
-// [(set (v4f32 R32FP:$rT), (fround (v2f64 R64FP:$rA)))]>;
-
-def FRDSf64 :
- RRForm_1<0b10011101110, (outs R32FP:$rT), (ins R64FP:$rA),
- "frds\t$rT, $rA", SPrecFP,
- [(set R32FP:$rT, (fround R64FP:$rA))]>;
-
-//ToDo include anyextend?
-
-//===----------------------------------------------------------------------==//
-// Double precision floating point instructions
-//===----------------------------------------------------------------------==//
-def FAf64 :
- RRForm<0b00110011010, (outs R64FP:$rT), (ins R64FP:$rA, R64FP:$rB),
- "dfa\t$rT, $rA, $rB", DPrecFP,
- [(set R64FP:$rT, (fadd R64FP:$rA, R64FP:$rB))]>;
-
-def FAv2f64 :
- RRForm<0b00110011010, (outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB),
- "dfa\t$rT, $rA, $rB", DPrecFP,
- [(set (v2f64 VECREG:$rT), (fadd (v2f64 VECREG:$rA), (v2f64 VECREG:$rB)))]>;
-
-def FSf64 :
- RRForm<0b10100011010, (outs R64FP:$rT), (ins R64FP:$rA, R64FP:$rB),
- "dfs\t$rT, $rA, $rB", DPrecFP,
- [(set R64FP:$rT, (fsub R64FP:$rA, R64FP:$rB))]>;
-
-def FSv2f64 :
- RRForm<0b10100011010, (outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB),
- "dfs\t$rT, $rA, $rB", DPrecFP,
- [(set (v2f64 VECREG:$rT),
- (fsub (v2f64 VECREG:$rA), (v2f64 VECREG:$rB)))]>;
-
-def FMf64 :
- RRForm<0b01100011010, (outs R64FP:$rT), (ins R64FP:$rA, R64FP:$rB),
- "dfm\t$rT, $rA, $rB", DPrecFP,
- [(set R64FP:$rT, (fmul R64FP:$rA, R64FP:$rB))]>;
-
-def FMv2f64:
- RRForm<0b00100011010, (outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB),
- "dfm\t$rT, $rA, $rB", DPrecFP,
- [(set (v2f64 VECREG:$rT),
- (fmul (v2f64 VECREG:$rA), (v2f64 VECREG:$rB)))]>;
-
-def FMAf64:
- RRForm<0b00111010110, (outs R64FP:$rT),
- (ins R64FP:$rA, R64FP:$rB, R64FP:$rC),
- "dfma\t$rT, $rA, $rB", DPrecFP,
- [(set R64FP:$rT, (fadd R64FP:$rC, (fmul R64FP:$rA, R64FP:$rB)))]>,
- RegConstraint<"$rC = $rT">,
- NoEncode<"$rC">;
-
-def FMAv2f64:
- RRForm<0b00111010110, (outs VECREG:$rT),
- (ins VECREG:$rA, VECREG:$rB, VECREG:$rC),
- "dfma\t$rT, $rA, $rB", DPrecFP,
- [(set (v2f64 VECREG:$rT),
- (fadd (v2f64 VECREG:$rC),
- (fmul (v2f64 VECREG:$rA), (v2f64 VECREG:$rB))))]>,
- RegConstraint<"$rC = $rT">,
- NoEncode<"$rC">;
-
-def FMSf64 :
- RRForm<0b10111010110, (outs R64FP:$rT),
- (ins R64FP:$rA, R64FP:$rB, R64FP:$rC),
- "dfms\t$rT, $rA, $rB", DPrecFP,
- [(set R64FP:$rT, (fsub (fmul R64FP:$rA, R64FP:$rB), R64FP:$rC))]>,
- RegConstraint<"$rC = $rT">,
- NoEncode<"$rC">;
-
-def FMSv2f64 :
- RRForm<0b10111010110, (outs VECREG:$rT),
- (ins VECREG:$rA, VECREG:$rB, VECREG:$rC),
- "dfms\t$rT, $rA, $rB", DPrecFP,
- [(set (v2f64 VECREG:$rT),
- (fsub (fmul (v2f64 VECREG:$rA), (v2f64 VECREG:$rB)),
- (v2f64 VECREG:$rC)))]>;
-
-// FNMS: - (a * b - c)
-// - (a * b) + c => c - (a * b)
-def FNMSf64 :
- RRForm<0b01111010110, (outs R64FP:$rT),
- (ins R64FP:$rA, R64FP:$rB, R64FP:$rC),
- "dfnms\t$rT, $rA, $rB", DPrecFP,
- [(set R64FP:$rT, (fsub R64FP:$rC, (fmul R64FP:$rA, R64FP:$rB)))]>,
- RegConstraint<"$rC = $rT">,
- NoEncode<"$rC">;
-
-def : Pat<(fneg (fsub (fmul R64FP:$rA, R64FP:$rB), R64FP:$rC)),
- (FNMSf64 R64FP:$rA, R64FP:$rB, R64FP:$rC)>;
-
-def FNMSv2f64 :
- RRForm<0b01111010110, (outs VECREG:$rT),
- (ins VECREG:$rA, VECREG:$rB, VECREG:$rC),
- "dfnms\t$rT, $rA, $rB", DPrecFP,
- [(set (v2f64 VECREG:$rT),
- (fsub (v2f64 VECREG:$rC),
- (fmul (v2f64 VECREG:$rA),
- (v2f64 VECREG:$rB))))]>,
- RegConstraint<"$rC = $rT">,
- NoEncode<"$rC">;
-
-def : Pat<(fneg (fsub (fmul (v2f64 VECREG:$rA), (v2f64 VECREG:$rB)),
- (v2f64 VECREG:$rC))),
- (FNMSv2f64 VECREG:$rA, VECREG:$rB, VECREG:$rC)>;
-
-// - (a * b + c)
-// - (a * b) - c
-def FNMAf64 :
- RRForm<0b11111010110, (outs R64FP:$rT),
- (ins R64FP:$rA, R64FP:$rB, R64FP:$rC),
- "dfnma\t$rT, $rA, $rB", DPrecFP,
- [(set R64FP:$rT, (fneg (fadd R64FP:$rC, (fmul R64FP:$rA, R64FP:$rB))))]>,
- RegConstraint<"$rC = $rT">,
- NoEncode<"$rC">;
-
-def FNMAv2f64 :
- RRForm<0b11111010110, (outs VECREG:$rT),
- (ins VECREG:$rA, VECREG:$rB, VECREG:$rC),
- "dfnma\t$rT, $rA, $rB", DPrecFP,
- [(set (v2f64 VECREG:$rT),
- (fneg (fadd (v2f64 VECREG:$rC),
- (fmul (v2f64 VECREG:$rA),
- (v2f64 VECREG:$rB)))))]>,
- RegConstraint<"$rC = $rT">,
- NoEncode<"$rC">;
-
-//===----------------------------------------------------------------------==//
-// Floating point negation and absolute value
-//===----------------------------------------------------------------------==//
-
-def : Pat<(fneg (v4f32 VECREG:$rA)),
- (XORfnegvec (v4f32 VECREG:$rA),
- (v4f32 (ILHUv4i32 0x8000)))>;
-
-def : Pat<(fneg R32FP:$rA),
- (XORfneg32 R32FP:$rA, (ILHUr32 0x8000))>;
-
-def : Pat<(fneg (v2f64 VECREG:$rA)),
- (XORfnegvec (v2f64 VECREG:$rA),
- (v2f64 (ANDBIv16i8 (FSMBIv16i8 0x8080), 0x80)))>;
-
-def : Pat<(fneg R64FP:$rA),
- (XORfneg64 R64FP:$rA,
- (ANDBIv16i8 (FSMBIv16i8 0x8080), 0x80))>;
-
-// Floating point absolute value
-
-def : Pat<(fabs R32FP:$rA),
- (ANDfabs32 R32FP:$rA, (IOHLr32 (ILHUr32 0x7fff), 0xffff))>;
-
-def : Pat<(fabs (v4f32 VECREG:$rA)),
- (ANDfabsvec (v4f32 VECREG:$rA),
- (v4f32 (ANDBIv16i8 (FSMBIv16i8 0xffff), 0x7f)))>;
-
-def : Pat<(fabs R64FP:$rA),
- (ANDfabs64 R64FP:$rA, (ANDBIv16i8 (FSMBIv16i8 0xffff), 0x7f))>;
-
-def : Pat<(fabs (v2f64 VECREG:$rA)),
- (ANDfabsvec (v2f64 VECREG:$rA),
- (v2f64 (ANDBIv16i8 (FSMBIv16i8 0xffff), 0x7f)))>;
-
-//===----------------------------------------------------------------------===//
-// Execution, Load NOP (execute NOPs belong in even pipeline, load NOPs belong
-// in the odd pipeline)
-//===----------------------------------------------------------------------===//
-
-def ENOP : SPUInstr<(outs), (ins), "enop", ExecNOP> {
- let Pattern = [];
-
- let Inst{0-10} = 0b10000000010;
- let Inst{11-17} = 0;
- let Inst{18-24} = 0;
- let Inst{25-31} = 0;
-}
-
-def LNOP : SPUInstr<(outs), (ins), "lnop", LoadNOP> {
- let Pattern = [];
-
- let Inst{0-10} = 0b10000000000;
- let Inst{11-17} = 0;
- let Inst{18-24} = 0;
- let Inst{25-31} = 0;
-}
-
-//===----------------------------------------------------------------------===//
-// Bit conversions (type conversions between vector/packed types)
-// NOTE: Promotions are handled using the XS* instructions. Truncation
-// is not handled.
-//===----------------------------------------------------------------------===//
-def : Pat<(v16i8 (bitconvert (v8i16 VECREG:$src))), (v16i8 VECREG:$src)>;
-def : Pat<(v16i8 (bitconvert (v4i32 VECREG:$src))), (v16i8 VECREG:$src)>;
-def : Pat<(v16i8 (bitconvert (v2i64 VECREG:$src))), (v16i8 VECREG:$src)>;
-def : Pat<(v16i8 (bitconvert (v4f32 VECREG:$src))), (v16i8 VECREG:$src)>;
-def : Pat<(v16i8 (bitconvert (v2f64 VECREG:$src))), (v16i8 VECREG:$src)>;
-
-def : Pat<(v8i16 (bitconvert (v16i8 VECREG:$src))), (v8i16 VECREG:$src)>;
-def : Pat<(v8i16 (bitconvert (v4i32 VECREG:$src))), (v8i16 VECREG:$src)>;
-def : Pat<(v8i16 (bitconvert (v2i64 VECREG:$src))), (v8i16 VECREG:$src)>;
-def : Pat<(v8i16 (bitconvert (v4f32 VECREG:$src))), (v8i16 VECREG:$src)>;
-def : Pat<(v8i16 (bitconvert (v2f64 VECREG:$src))), (v8i16 VECREG:$src)>;
-
-def : Pat<(v4i32 (bitconvert (v16i8 VECREG:$src))), (v4i32 VECREG:$src)>;
-def : Pat<(v4i32 (bitconvert (v8i16 VECREG:$src))), (v4i32 VECREG:$src)>;
-def : Pat<(v4i32 (bitconvert (v2i64 VECREG:$src))), (v4i32 VECREG:$src)>;
-def : Pat<(v4i32 (bitconvert (v4f32 VECREG:$src))), (v4i32 VECREG:$src)>;
-def : Pat<(v4i32 (bitconvert (v2f64 VECREG:$src))), (v4i32 VECREG:$src)>;
-
-def : Pat<(v2i64 (bitconvert (v16i8 VECREG:$src))), (v2i64 VECREG:$src)>;
-def : Pat<(v2i64 (bitconvert (v8i16 VECREG:$src))), (v2i64 VECREG:$src)>;
-def : Pat<(v2i64 (bitconvert (v4i32 VECREG:$src))), (v2i64 VECREG:$src)>;
-def : Pat<(v2i64 (bitconvert (v4f32 VECREG:$src))), (v2i64 VECREG:$src)>;
-def : Pat<(v2i64 (bitconvert (v2f64 VECREG:$src))), (v2i64 VECREG:$src)>;
-
-def : Pat<(v4f32 (bitconvert (v16i8 VECREG:$src))), (v4f32 VECREG:$src)>;
-def : Pat<(v4f32 (bitconvert (v8i16 VECREG:$src))), (v4f32 VECREG:$src)>;
-def : Pat<(v4f32 (bitconvert (v2i64 VECREG:$src))), (v4f32 VECREG:$src)>;
-def : Pat<(v4f32 (bitconvert (v4i32 VECREG:$src))), (v4f32 VECREG:$src)>;
-def : Pat<(v4f32 (bitconvert (v2f64 VECREG:$src))), (v4f32 VECREG:$src)>;
-
-def : Pat<(v2f64 (bitconvert (v16i8 VECREG:$src))), (v2f64 VECREG:$src)>;
-def : Pat<(v2f64 (bitconvert (v8i16 VECREG:$src))), (v2f64 VECREG:$src)>;
-def : Pat<(v2f64 (bitconvert (v4i32 VECREG:$src))), (v2f64 VECREG:$src)>;
-def : Pat<(v2f64 (bitconvert (v2i64 VECREG:$src))), (v2f64 VECREG:$src)>;
-def : Pat<(v2f64 (bitconvert (v2f64 VECREG:$src))), (v2f64 VECREG:$src)>;
-
-def : Pat<(f32 (bitconvert (i32 R32C:$src))), (f32 R32FP:$src)>;
-def : Pat<(f64 (bitconvert (i64 R64C:$src))), (f64 R64FP:$src)>;
-
-//===----------------------------------------------------------------------===//
-// Instruction patterns:
-//===----------------------------------------------------------------------===//
-
-// General 32-bit constants:
-def : Pat<(i32 imm:$imm),
- (IOHLr32 (ILHUr32 (HI16 imm:$imm)), (LO16 imm:$imm))>;
-
-// Single precision float constants:
-def : Pat<(f32 fpimm:$imm),
- (IOHLf32 (ILHUf32 (HI16_f32 fpimm:$imm)), (LO16_f32 fpimm:$imm))>;
-
-// General constant 32-bit vectors
-def : Pat<(v4i32 v4i32Imm:$imm),
- (IOHLv4i32 (v4i32 (ILHUv4i32 (HI16_vec v4i32Imm:$imm))),
- (LO16_vec v4i32Imm:$imm))>;
-
-// 8-bit constants
-def : Pat<(i8 imm:$imm),
- (ILHr8 imm:$imm)>;
-
-//===----------------------------------------------------------------------===//
-// Call instruction patterns:
-//===----------------------------------------------------------------------===//
-// Return void
-def : Pat<(ret),
- (RET)>;
-
-//===----------------------------------------------------------------------===//
-// Zero/Any/Sign extensions
-//===----------------------------------------------------------------------===//
-
-// zext 1->32: Zero extend i1 to i32
-def : Pat<(SPUextract_i1_zext R32C:$rSrc),
- (ANDIr32 R32C:$rSrc, 0x1)>;
-
-// sext 8->32: Sign extend bytes to words
-def : Pat<(sext_inreg R32C:$rSrc, i8),
- (XSHWr32 (XSBHr32 R32C:$rSrc))>;
-
-def : Pat<(i32 (sext R8C:$rSrc)),
- (XSHWr16 (XSBHr8 R8C:$rSrc))>;
-
-def : Pat<(SPUextract_i8_sext VECREG:$rSrc),
- (XSHWr32 (XSBHr32 (ORi32_v4i32 (v4i32 VECREG:$rSrc),
- (v4i32 VECREG:$rSrc))))>;
-
-// zext 8->16: Zero extend bytes to halfwords
-def : Pat<(i16 (zext R8C:$rSrc)),
- (ANDHIi8i16 R8C:$rSrc, 0xff)>;
-
-// zext 8->32 from preferred slot in load/store
-def : Pat<(SPUextract_i8_zext VECREG:$rSrc),
- (ANDIr32 (ORi32_v4i32 (v4i32 VECREG:$rSrc), (v4i32 VECREG:$rSrc)),
- 0xff)>;
-
-// zext 8->32: Zero extend bytes to words
-def : Pat<(i32 (zext R8C:$rSrc)),
- (ANDIi8i32 R8C:$rSrc, 0xff)>;
-
-// anyext 8->16: Extend 8->16 bits, irrespective of sign
-def : Pat<(i16 (anyext R8C:$rSrc)),
- (ORHIi8i16 R8C:$rSrc, 0)>;
-
-// anyext 8->32: Extend 8->32 bits, irrespective of sign
-def : Pat<(i32 (anyext R8C:$rSrc)),
- (ORIi8i32 R8C:$rSrc, 0)>;
-
-// zext 16->32: Zero extend halfwords to words
-def : Pat<(i32 (zext R16C:$rSrc)),
- (ANDi16i32 R16C:$rSrc, (ILAr32 0xffff))>;
-
-def : Pat<(i32 (zext (and R16C:$rSrc, 0xf))),
- (ANDIi16i32 R16C:$rSrc, 0xf)>;
-
-def : Pat<(i32 (zext (and R16C:$rSrc, 0xff))),
- (ANDIi16i32 R16C:$rSrc, 0xff)>;
-
-def : Pat<(i32 (zext (and R16C:$rSrc, 0xfff))),
- (ANDIi16i32 R16C:$rSrc, 0xfff)>;
-
-// anyext 16->32: Extend 16->32 bits, irrespective of sign
-def : Pat<(i32 (anyext R16C:$rSrc)),
- (ORIi16i32 R16C:$rSrc, 0)>;
-
-//===----------------------------------------------------------------------===//
-// Address generation: SPU, like PPC, has to split addresses into high and
-// low parts in order to load them into a register.
-//===----------------------------------------------------------------------===//
-
-def : Pat<(SPUaform tglobaladdr:$in, 0), (ILAlsa tglobaladdr:$in)>;
-def : Pat<(SPUaform texternalsym:$in, 0), (ILAlsa texternalsym:$in)>;
-def : Pat<(SPUaform tjumptable:$in, 0), (ILAlsa tjumptable:$in)>;
-def : Pat<(SPUaform tconstpool:$in, 0), (ILAlsa tconstpool:$in)>;
-
-def : Pat<(SPUindirect (SPUhi tglobaladdr:$in, 0),
- (SPUlo tglobaladdr:$in, 0)),
- (IOHLlo (ILHUhi tglobaladdr:$in), tglobaladdr:$in)>;
-
-def : Pat<(SPUindirect (SPUhi texternalsym:$in, 0),
- (SPUlo texternalsym:$in, 0)),
- (IOHLlo (ILHUhi texternalsym:$in), texternalsym:$in)>;
-
-def : Pat<(SPUindirect (SPUhi tjumptable:$in, 0),
- (SPUlo tjumptable:$in, 0)),
- (IOHLlo (ILHUhi tjumptable:$in), tjumptable:$in)>;
-
-def : Pat<(SPUindirect (SPUhi tconstpool:$in, 0),
- (SPUlo tconstpool:$in, 0)),
- (IOHLlo (ILHUhi tconstpool:$in), tconstpool:$in)>;
-
-def : Pat<(SPUindirect R32C:$sp, i32ImmSExt10:$imm),
- (AIr32 R32C:$sp, i32ImmSExt10:$imm)>;
-
-def : Pat<(SPUindirect R32C:$sp, imm:$imm),
- (Ar32 R32C:$sp,
- (IOHLr32 (ILHUr32 (HI16 imm:$imm)), (LO16 imm:$imm)))>;
-
-def : Pat<(add (SPUhi tglobaladdr:$in, 0), (SPUlo tglobaladdr:$in, 0)),
- (IOHLlo (ILHUhi tglobaladdr:$in), tglobaladdr:$in)>;
-
-def : Pat<(add (SPUhi texternalsym:$in, 0), (SPUlo texternalsym:$in, 0)),
- (IOHLlo (ILHUhi texternalsym:$in), texternalsym:$in)>;
-
-def : Pat<(add (SPUhi tjumptable:$in, 0), (SPUlo tjumptable:$in, 0)),
- (IOHLlo (ILHUhi tjumptable:$in), tjumptable:$in)>;
-
-def : Pat<(add (SPUhi tconstpool:$in, 0), (SPUlo tconstpool:$in, 0)),
- (IOHLlo (ILHUhi tconstpool:$in), tconstpool:$in)>;
-
-// Instrinsics:
-include "CellSDKIntrinsics.td"
diff --git a/release_23/lib/Target/CellSPU/SPUMachineFunction.h b/release_23/lib/Target/CellSPU/SPUMachineFunction.h
deleted file mode 100644
index 6a66967bc050..000000000000
--- a/release_23/lib/Target/CellSPU/SPUMachineFunction.h
+++ /dev/null
@@ -1,43 +0,0 @@
-//===-- SPUMachineFunctionInfo.h - Private data used for CellSPU --*- C++ -*-=//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file declares the IBM Cell SPU specific subclass of MachineFunctionInfo.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef SPU_MACHINE_FUNCTION_INFO_H
-#define SPU_MACHINE_FUNCTION_INFO_H
-
-#include "llvm/CodeGen/MachineFunction.h"
-
-namespace llvm {
-
-/// SPUFunctionInfo - Cell SPU target-specific information for each
-/// MachineFunction
-class SPUFunctionInfo : public MachineFunctionInfo {
-private:
- /// UsesLR - Indicates whether LR is used in the current function.
- ///
- bool UsesLR;
-
-public:
- SPUFunctionInfo(MachineFunction& MF)
- : UsesLR(false)
- {}
-
- void setUsesLR(bool U) { UsesLR = U; }
- bool usesLR() { return UsesLR; }
-
-};
-
-} // end of namespace llvm
-
-
-#endif
-
diff --git a/release_23/lib/Target/CellSPU/SPUNodes.td b/release_23/lib/Target/CellSPU/SPUNodes.td
deleted file mode 100644
index 00d0f94212a4..000000000000
--- a/release_23/lib/Target/CellSPU/SPUNodes.td
+++ /dev/null
@@ -1,197 +0,0 @@
-//===- SPUNodes.td - Specialized SelectionDAG nodes used for CellSPU ------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// Type profiles and SelectionDAG nodes used by CellSPU
-//
-//===----------------------------------------------------------------------===//
-
-// Type profile for a call sequence
-def SDT_SPUCallSeq : SDTypeProfile<0, 1, [ SDTCisVT<0, i32> ]>;
-
-// SPU_GenControl: Type profile for generating control words for insertions
-def SPU_GenControl : SDTypeProfile<1, 1, []>;
-def SPUvecinsmask : SDNode<"SPUISD::INSERT_MASK", SPU_GenControl, []>;
-
-def callseq_start : SDNode<"ISD::CALLSEQ_START", SDT_SPUCallSeq,
- [SDNPHasChain, SDNPOutFlag]>;
-def callseq_end : SDNode<"ISD::CALLSEQ_END", SDT_SPUCallSeq,
- [SDNPHasChain, SDNPOutFlag]>;
-//===----------------------------------------------------------------------===//
-// Operand constraints:
-//===----------------------------------------------------------------------===//
-
-def SDT_SPUCall : SDTypeProfile<0, -1, [SDTCisInt<0>]>;
-def SPUcall : SDNode<"SPUISD::CALL", SDT_SPUCall,
- [SDNPHasChain, SDNPOptInFlag, SDNPOutFlag]>;
-
-// Operand type constraints for vector shuffle/permute operations
-def SDT_SPUshuffle : SDTypeProfile<1, 3, [
- SDTCisSameAs<0, 1>, SDTCisSameAs<1, 2>
-]>;
-
-// Unary, binary v16i8 operator type constraints:
-def SPUv16i8_unop: SDTypeProfile<1, 1, [
- SDTCisVT<0, v16i8>, SDTCisSameAs<0, 1>]>;
-
-def SPUv16i8_binop: SDTypeProfile<1, 2, [
- SDTCisVT<0, v16i8>, SDTCisSameAs<0, 1>, SDTCisSameAs<1, 2>]>;
-
-// Binary v8i16 operator type constraints:
-def SPUv8i16_unop: SDTypeProfile<1, 1, [
- SDTCisVT<0, v8i16>, SDTCisSameAs<0, 1>]>;
-
-def SPUv8i16_binop: SDTypeProfile<1, 2, [
- SDTCisVT<0, v8i16>, SDTCisSameAs<0, 1>, SDTCisSameAs<1, 2>]>;
-
-// Binary v4i32 operator type constraints:
-def SPUv4i32_unop: SDTypeProfile<1, 1, [
- SDTCisVT<0, v4i32>, SDTCisSameAs<0, 1>]>;
-
-def SPUv4i32_binop: SDTypeProfile<1, 2, [
- SDTCisVT<0, v4i32>, SDTCisSameAs<0, 1>, SDTCisSameAs<1, 2>]>;
-
-// FSMBI type constraints: There are several variations for the various
-// vector types (this avoids having to bit_convert all over the place.)
-def SPUfsmbi_type: SDTypeProfile<1, 1, [
- SDTCisInt<1>
-]>;
-
-// SELB type constraints:
-def SPUselb_type: SDTypeProfile<1, 3, [
- SDTCisSameAs<0, 1>, SDTCisSameAs<1, 2>, SDTCisSameAs<0, 3> ]>;
-
-// SPU Vector shift pseudo-instruction type constraints
-def SPUvecshift_type: SDTypeProfile<1, 2, [
- SDTCisSameAs<0, 1>, SDTCisInt<2>]>;
-
-//===----------------------------------------------------------------------===//
-// Synthetic/pseudo-instructions
-//===----------------------------------------------------------------------===//
-
-// SPU CNTB:
-def SPUcntb_v16i8: SDNode<"SPUISD::CNTB", SPUv16i8_unop, []>;
-def SPUcntb_v8i16: SDNode<"SPUISD::CNTB", SPUv8i16_unop, []>;
-def SPUcntb_v4i32: SDNode<"SPUISD::CNTB", SPUv4i32_unop, []>;
-
-// SPU vector shuffle node, matched by the SPUISD::SHUFB enum (see
-// SPUISelLowering.h):
-def SPUshuffle: SDNode<"SPUISD::SHUFB", SDT_SPUshuffle, []>;
-
-// SPU 16-bit multiply
-def SPUmpy_v16i8: SDNode<"SPUISD::MPY", SPUv16i8_binop, []>;
-def SPUmpy_v8i16: SDNode<"SPUISD::MPY", SPUv8i16_binop, []>;
-def SPUmpy_v4i32: SDNode<"SPUISD::MPY", SPUv4i32_binop, []>;
-
-// SPU multiply unsigned, used in instruction lowering for v4i32
-// multiplies:
-def SPUmpyu_v4i32: SDNode<"SPUISD::MPYU", SPUv4i32_binop, []>;
-def SPUmpyu_i32: SDNode<"SPUISD::MPYU", SDTIntBinOp, []>;
-
-// SPU 16-bit multiply high x low, shift result 16-bits
-// Used to compute intermediate products for 32-bit multiplies
-def SPUmpyh_v4i32: SDNode<"SPUISD::MPYH", SPUv4i32_binop, []>;
-def SPUmpyh_i32: SDNode<"SPUISD::MPYH", SDTIntBinOp, []>;
-
-// SPU 16-bit multiply high x high, 32-bit product
-// Used to compute intermediate products for 16-bit multiplies
-def SPUmpyhh_v8i16: SDNode<"SPUISD::MPYHH", SPUv8i16_binop, []>;
-
-// Shift left quadword by bits and bytes
-def SPUshlquad_l_bits: SDNode<"SPUISD::SHLQUAD_L_BITS", SPUvecshift_type, []>;
-def SPUshlquad_l_bytes: SDNode<"SPUISD::SHLQUAD_L_BYTES", SPUvecshift_type, []>;
-
-// Vector shifts (ISD::SHL,SRL,SRA are for _integers_ only):
-def SPUvec_shl: SDNode<"SPUISD::VEC_SHL", SPUvecshift_type, []>;
-def SPUvec_srl: SDNode<"SPUISD::VEC_SRL", SPUvecshift_type, []>;
-def SPUvec_sra: SDNode<"SPUISD::VEC_SRA", SPUvecshift_type, []>;
-
-def SPUvec_rotl: SDNode<"SPUISD::VEC_ROTL", SPUvecshift_type, []>;
-def SPUvec_rotr: SDNode<"SPUISD::VEC_ROTR", SPUvecshift_type, []>;
-
-def SPUrotquad_rz_bytes: SDNode<"SPUISD::ROTQUAD_RZ_BYTES",
- SPUvecshift_type, []>;
-def SPUrotquad_rz_bits: SDNode<"SPUISD::ROTQUAD_RZ_BITS",
- SPUvecshift_type, []>;
-
-def SPUrotbytes_right_sfill: SDNode<"SPUISD::ROTBYTES_RIGHT_S",
- SPUvecshift_type, []>;
-
-def SPUrotbytes_left: SDNode<"SPUISD::ROTBYTES_LEFT",
- SPUvecshift_type, []>;
-
-def SPUrotbytes_left_chained : SDNode<"SPUISD::ROTBYTES_LEFT_CHAINED",
- SPUvecshift_type, [SDNPHasChain]>;
-
-// SPU form select mask for bytes, immediate
-def SPUfsmbi: SDNode<"SPUISD::FSMBI", SPUfsmbi_type, []>;
-
-// SPU select bits instruction
-def SPUselb: SDNode<"SPUISD::SELB", SPUselb_type, []>;
-
-// SPU floating point interpolate
-def SPUinterpolate : SDNode<"SPUISD::FPInterp", SDTFPBinOp, []>;
-
-// SPU floating point reciprocal estimate (used for fdiv)
-def SPUreciprocalEst: SDNode<"SPUISD::FPRecipEst", SDTFPUnaryOp, []>;
-
-def SDTpromote_scalar: SDTypeProfile<1, 1, []>;
-def SPUpromote_scalar: SDNode<"SPUISD::PROMOTE_SCALAR", SDTpromote_scalar, []>;
-
-def SPU_vec_demote : SDTypeProfile<1, 1, []>;
-def SPUextract_elt0: SDNode<"SPUISD::EXTRACT_ELT0", SPU_vec_demote, []>;
-def SPU_vec_demote_chained : SDTypeProfile<1, 2, []>;
-def SPUextract_elt0_chained: SDNode<"SPUISD::EXTRACT_ELT0_CHAINED",
- SPU_vec_demote_chained, [SDNPHasChain]>;
-def SPUextract_i1_sext: SDNode<"SPUISD::EXTRACT_I1_SEXT", SPU_vec_demote, []>;
-def SPUextract_i1_zext: SDNode<"SPUISD::EXTRACT_I1_ZEXT", SPU_vec_demote, []>;
-def SPUextract_i8_sext: SDNode<"SPUISD::EXTRACT_I8_SEXT", SPU_vec_demote, []>;
-def SPUextract_i8_zext: SDNode<"SPUISD::EXTRACT_I8_ZEXT", SPU_vec_demote, []>;
-
-// Address high and low components, used for [r+r] type addressing
-def SPUhi : SDNode<"SPUISD::Hi", SDTIntBinOp, []>;
-def SPUlo : SDNode<"SPUISD::Lo", SDTIntBinOp, []>;
-
-// PC-relative address
-def SPUpcrel : SDNode<"SPUISD::PCRelAddr", SDTIntBinOp, []>;
-
-// A-Form local store addresses
-def SPUaform : SDNode<"SPUISD::AFormAddr", SDTIntBinOp, []>;
-
-// Indirect [D-Form "imm($reg)" and X-Form "$reg($reg)"] addresses
-def SPUindirect : SDNode<"SPUISD::IndirectAddr", SDTIntBinOp, []>;
-
-// SPU 32-bit sign-extension to 64-bits
-def SPUsext32_to_64: SDNode<"SPUISD::SEXT32TO64", SDTIntExtendOp, []>;
-
-// Branches:
-
-def SPUbrnz : SDNode<"SPUISD::BR_NOTZERO", SDTBrcond, [SDNPHasChain]>;
-def SPUbrz : SDNode<"SPUISD::BR_ZERO", SDTBrcond, [SDNPHasChain]>;
-/* def SPUbinz : SDNode<"SPUISD::BR_NOTZERO", SDTBrind, [SDNPHasChain]>;
-def SPUbiz : SDNode<"SPUISD::BR_ZERO", SPUBrind, [SDNPHasChain]>; */
-
-//===----------------------------------------------------------------------===//
-// Constraints: (taken from PPCInstrInfo.td)
-//===----------------------------------------------------------------------===//
-
-class RegConstraint<string C> {
- string Constraints = C;
-}
-
-class NoEncode<string E> {
- string DisableEncoding = E;
-}
-
-//===----------------------------------------------------------------------===//
-// Return (flag isn't quite what it means: the operations are flagged so that
-// instruction scheduling doesn't disassociate them.)
-//===----------------------------------------------------------------------===//
-
-def retflag : SDNode<"SPUISD::RET_FLAG", SDTNone,
- [SDNPHasChain, SDNPOptInFlag]>;
diff --git a/release_23/lib/Target/CellSPU/SPUOperands.td b/release_23/lib/Target/CellSPU/SPUOperands.td
deleted file mode 100644
index aae79b509a17..000000000000
--- a/release_23/lib/Target/CellSPU/SPUOperands.td
+++ /dev/null
@@ -1,644 +0,0 @@
-//===- SPUOperands.td - Cell SPU Instruction Operands ------*- tablegen -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-// Cell SPU Instruction Operands:
-//===----------------------------------------------------------------------===//
-
-def LO16 : SDNodeXForm<imm, [{
- unsigned val = N->getValue();
- // Transformation function: get the low 16 bits.
- return getI32Imm(val & 0xffff);
-}]>;
-
-def LO16_vec : SDNodeXForm<scalar_to_vector, [{
- SDOperand OpVal(0, 0);
-
- // Transformation function: get the low 16 bit immediate from a build_vector
- // node.
- assert(N->getOpcode() == ISD::BUILD_VECTOR
- && "LO16_vec got something other than a BUILD_VECTOR");
-
- // Get first constant operand...
- for (unsigned i = 0, e = N->getNumOperands(); OpVal.Val == 0 && i != e; ++i) {
- if (N->getOperand(i).getOpcode() == ISD::UNDEF) continue;
- if (OpVal.Val == 0)
- OpVal = N->getOperand(i);
- }
-
- assert(OpVal.Val != 0 && "LO16_vec did not locate a <defined> node");
- ConstantSDNode *CN = dyn_cast<ConstantSDNode>(OpVal);
- return getI32Imm((unsigned)CN->getValue() & 0xffff);
-}]>;
-
-// Transform an immediate, returning the high 16 bits shifted down:
-def HI16 : SDNodeXForm<imm, [{
- return getI32Imm((unsigned)N->getValue() >> 16);
-}]>;
-
-// Transformation function: shift the high 16 bit immediate from a build_vector
-// node into the low 16 bits, and return a 16-bit constant.
-def HI16_vec : SDNodeXForm<scalar_to_vector, [{
- SDOperand OpVal(0, 0);
-
- assert(N->getOpcode() == ISD::BUILD_VECTOR
- && "HI16_vec got something other than a BUILD_VECTOR");
-
- // Get first constant operand...
- for (unsigned i = 0, e = N->getNumOperands(); OpVal.Val == 0 && i != e; ++i) {
- if (N->getOperand(i).getOpcode() == ISD::UNDEF) continue;
- if (OpVal.Val == 0)
- OpVal = N->getOperand(i);
- }
-
- assert(OpVal.Val != 0 && "HI16_vec did not locate a <defined> node");
- ConstantSDNode *CN = dyn_cast<ConstantSDNode>(OpVal);
- return getI32Imm((unsigned)CN->getValue() >> 16);
-}]>;
-
-// simm7 predicate - True if the immediate fits in an 7-bit signed
-// field.
-def simm7: PatLeaf<(imm), [{
- int sextVal = int(N->getSignExtended());
- return (sextVal >= -64 && sextVal <= 63);
-}]>;
-
-// uimm7 predicate - True if the immediate fits in an 7-bit unsigned
-// field.
-def uimm7: PatLeaf<(imm), [{
- return (N->getValue() <= 0x7f);
-}]>;
-
-// immSExt8 predicate - True if the immediate fits in an 8-bit sign extended
-// field.
-def immSExt8 : PatLeaf<(imm), [{
- int Value = int(N->getSignExtended());
- return (Value >= -(1 << 8) && Value <= (1 << 8) - 1);
-}]>;
-
-// immU8: immediate, unsigned 8-bit quantity
-def immU8 : PatLeaf<(imm), [{
- return (N->getValue() <= 0xff);
-}]>;
-
-// i64ImmSExt10 predicate - True if the i64 immediate fits in a 10-bit sign
-// extended field. Used by RI10Form instructions like 'ldq'.
-def i64ImmSExt10 : PatLeaf<(imm), [{
- return isI64IntS10Immediate(N);
-}]>;
-
-// i32ImmSExt10 predicate - True if the i32 immediate fits in a 10-bit sign
-// extended field. Used by RI10Form instructions like 'ldq'.
-def i32ImmSExt10 : PatLeaf<(imm), [{
- return isI32IntS10Immediate(N);
-}]>;
-
-// i32ImmUns10 predicate - True if the i32 immediate fits in a 10-bit unsigned
-// field. Used by RI10Form instructions like 'ldq'.
-def i32ImmUns10 : PatLeaf<(imm), [{
- return isI32IntU10Immediate(N);
-}]>;
-
-// i16ImmSExt10 predicate - True if the i16 immediate fits in a 10-bit sign
-// extended field. Used by RI10Form instructions like 'ldq'.
-def i16ImmSExt10 : PatLeaf<(imm), [{
- return isI16IntS10Immediate(N);
-}]>;
-
-// i16ImmUns10 predicate - True if the i16 immediate fits into a 10-bit unsigned
-// value. Used by RI10Form instructions.
-def i16ImmUns10 : PatLeaf<(imm), [{
- return isI16IntU10Immediate(N);
-}]>;
-
-def immSExt16 : PatLeaf<(imm), [{
- // immSExt16 predicate - True if the immediate fits in a 16-bit sign extended
- // field.
- short Ignored;
- return isIntS16Immediate(N, Ignored);
-}]>;
-
-def immZExt16 : PatLeaf<(imm), [{
- // immZExt16 predicate - True if the immediate fits in a 16-bit zero extended
- // field.
- return (uint64_t)N->getValue() == (unsigned short)N->getValue();
-}], LO16>;
-
-def immU16 : PatLeaf<(imm), [{
- // immU16 predicate- True if the immediate fits into a 16-bit unsigned field.
- return (uint64_t)N->getValue() == (N->getValue() & 0xffff);
-}]>;
-
-def imm18 : PatLeaf<(imm), [{
- // imm18 predicate: True if the immediate fits into an 18-bit unsigned field.
- int Value = (int) N->getValue();
- return ((Value & ((1 << 19) - 1)) == Value);
-}]>;
-
-def lo16 : PatLeaf<(imm), [{
- // lo16 predicate - returns true if the immediate has all zeros in the
- // low order bits and is a 32-bit constant:
- if (N->getValueType(0) == MVT::i32) {
- uint32_t val = N->getValue();
- return ((val & 0x0000ffff) == val);
- }
-
- return false;
-}], LO16>;
-
-def hi16 : PatLeaf<(imm), [{
- // hi16 predicate - returns true if the immediate has all zeros in the
- // low order bits and is a 32-bit constant:
- if (N->getValueType(0) == MVT::i32) {
- uint32_t val = uint32_t(N->getValue());
- return ((val & 0xffff0000) == val);
- } else if (N->getValueType(0) == MVT::i64) {
- uint64_t val = N->getValue();
- return ((val & 0xffff0000ULL) == val);
- }
-
- return false;
-}], HI16>;
-
-def bitshift : PatLeaf<(imm), [{
- // bitshift predicate - returns true if 0 < imm <= 7 for SHLQBII
- // (shift left quadword by bits immediate)
- int64_t Val = N->getValue();
- return (Val > 0 && Val <= 7);
-}]>;
-
-//===----------------------------------------------------------------------===//
-// Floating point operands:
-//===----------------------------------------------------------------------===//
-
-// Transform a float, returning the high 16 bits shifted down, as if
-// the float was really an unsigned integer:
-def HI16_f32 : SDNodeXForm<fpimm, [{
- float fval = N->getValueAPF().convertToFloat();
- return getI32Imm(FloatToBits(fval) >> 16);
-}]>;
-
-// Transformation function on floats: get the low 16 bits as if the float was
-// an unsigned integer.
-def LO16_f32 : SDNodeXForm<fpimm, [{
- float fval = N->getValueAPF().convertToFloat();
- return getI32Imm(FloatToBits(fval) & 0xffff);
-}]>;
-
-def FPimm_sext16 : SDNodeXForm<fpimm, [{
- float fval = N->getValueAPF().convertToFloat();
- return getI32Imm((int) ((FloatToBits(fval) << 16) >> 16));
-}]>;
-
-def FPimm_u18 : SDNodeXForm<fpimm, [{
- float fval = N->getValueAPF().convertToFloat();
- return getI32Imm(FloatToBits(fval) & ((1 << 19) - 1));
-}]>;
-
-def fpimmSExt16 : PatLeaf<(fpimm), [{
- short Ignored;
- return isFPS16Immediate(N, Ignored);
-}], FPimm_sext16>;
-
-// Does the SFP constant only have upp 16 bits set?
-def hi16_f32 : PatLeaf<(fpimm), [{
- if (N->getValueType(0) == MVT::f32) {
- uint32_t val = FloatToBits(N->getValueAPF().convertToFloat());
- return ((val & 0xffff0000) == val);
- }
-
- return false;
-}], HI16_f32>;
-
-// Does the SFP constant fit into 18 bits?
-def fpimm18 : PatLeaf<(fpimm), [{
- if (N->getValueType(0) == MVT::f32) {
- uint32_t Value = FloatToBits(N->getValueAPF().convertToFloat());
- return ((Value & ((1 << 19) - 1)) == Value);
- }
-
- return false;
-}], FPimm_u18>;
-
-//===----------------------------------------------------------------------===//
-// 64-bit operands (TODO):
-//===----------------------------------------------------------------------===//
-
-//===----------------------------------------------------------------------===//
-// build_vector operands:
-//===----------------------------------------------------------------------===//
-
-// v16i8SExt8Imm_xform function: convert build_vector to 8-bit sign extended
-// immediate constant load for v16i8 vectors. N.B.: The incoming constant has
-// to be a 16-bit quantity with the upper and lower bytes equal (e.g., 0x2a2a).
-def v16i8SExt8Imm_xform: SDNodeXForm<build_vector, [{
- return SPU::get_vec_i8imm(N, *CurDAG, MVT::i8);
-}]>;
-
-// v16i8SExt8Imm: Predicate test for 8-bit sign extended immediate constant
-// load, works in conjunction with its transform function. N.B.: This relies the
-// incoming constant being a 16-bit quantity, where the upper and lower bytes
-// are EXACTLY the same (e.g., 0x2a2a)
-def v16i8SExt8Imm: PatLeaf<(build_vector), [{
- return SPU::get_vec_i8imm(N, *CurDAG, MVT::i8).Val != 0;
-}], v16i8SExt8Imm_xform>;
-
-// v16i8U8Imm_xform function: convert build_vector to unsigned 8-bit
-// immediate constant load for v16i8 vectors. N.B.: The incoming constant has
-// to be a 16-bit quantity with the upper and lower bytes equal (e.g., 0x2a2a).
-def v16i8U8Imm_xform: SDNodeXForm<build_vector, [{
- return SPU::get_vec_i8imm(N, *CurDAG, MVT::i8);
-}]>;
-
-// v16i8U8Imm: Predicate test for unsigned 8-bit immediate constant
-// load, works in conjunction with its transform function. N.B.: This relies the
-// incoming constant being a 16-bit quantity, where the upper and lower bytes
-// are EXACTLY the same (e.g., 0x2a2a)
-def v16i8U8Imm: PatLeaf<(build_vector), [{
- return SPU::get_vec_i8imm(N, *CurDAG, MVT::i8).Val != 0;
-}], v16i8U8Imm_xform>;
-
-// v8i16SExt8Imm_xform function: convert build_vector to 8-bit sign extended
-// immediate constant load for v8i16 vectors.
-def v8i16SExt8Imm_xform: SDNodeXForm<build_vector, [{
- return SPU::get_vec_i8imm(N, *CurDAG, MVT::i16);
-}]>;
-
-// v8i16SExt8Imm: Predicate test for 8-bit sign extended immediate constant
-// load, works in conjunction with its transform function.
-def v8i16SExt8Imm: PatLeaf<(build_vector), [{
- return SPU::get_vec_i8imm(N, *CurDAG, MVT::i16).Val != 0;
-}], v8i16SExt8Imm_xform>;
-
-// v8i16SExt10Imm_xform function: convert build_vector to 16-bit sign extended
-// immediate constant load for v8i16 vectors.
-def v8i16SExt10Imm_xform: SDNodeXForm<build_vector, [{
- return SPU::get_vec_i10imm(N, *CurDAG, MVT::i16);
-}]>;
-
-// v8i16SExt10Imm: Predicate test for 16-bit sign extended immediate constant
-// load, works in conjunction with its transform function.
-def v8i16SExt10Imm: PatLeaf<(build_vector), [{
- return SPU::get_vec_i10imm(N, *CurDAG, MVT::i16).Val != 0;
-}], v8i16SExt10Imm_xform>;
-
-// v8i16Uns10Imm_xform function: convert build_vector to 16-bit unsigned
-// immediate constant load for v8i16 vectors.
-def v8i16Uns10Imm_xform: SDNodeXForm<build_vector, [{
- return SPU::get_vec_i10imm(N, *CurDAG, MVT::i16);
-}]>;
-
-// v8i16Uns10Imm: Predicate test for 16-bit unsigned immediate constant
-// load, works in conjunction with its transform function.
-def v8i16Uns10Imm: PatLeaf<(build_vector), [{
- return SPU::get_vec_i10imm(N, *CurDAG, MVT::i16).Val != 0;
-}], v8i16Uns10Imm_xform>;
-
-// v8i16SExt16Imm_xform function: convert build_vector to 16-bit sign extended
-// immediate constant load for v8i16 vectors.
-def v8i16Uns16Imm_xform: SDNodeXForm<build_vector, [{
- return SPU::get_vec_i16imm(N, *CurDAG, MVT::i16);
-}]>;
-
-// v8i16SExt16Imm: Predicate test for 16-bit sign extended immediate constant
-// load, works in conjunction with its transform function.
-def v8i16SExt16Imm: PatLeaf<(build_vector), [{
- return SPU::get_vec_i16imm(N, *CurDAG, MVT::i16).Val != 0;
-}], v8i16Uns16Imm_xform>;
-
-// v4i32SExt10Imm_xform function: convert build_vector to 10-bit sign extended
-// immediate constant load for v4i32 vectors.
-def v4i32SExt10Imm_xform: SDNodeXForm<build_vector, [{
- return SPU::get_vec_i10imm(N, *CurDAG, MVT::i32);
-}]>;
-
-// v4i32SExt10Imm: Predicate test for 10-bit sign extended immediate constant
-// load, works in conjunction with its transform function.
-def v4i32SExt10Imm: PatLeaf<(build_vector), [{
- return SPU::get_vec_i10imm(N, *CurDAG, MVT::i32).Val != 0;
-}], v4i32SExt10Imm_xform>;
-
-// v4i32Uns10Imm_xform function: convert build_vector to 10-bit unsigned
-// immediate constant load for v4i32 vectors.
-def v4i32Uns10Imm_xform: SDNodeXForm<build_vector, [{
- return SPU::get_vec_i10imm(N, *CurDAG, MVT::i32);
-}]>;
-
-// v4i32Uns10Imm: Predicate test for 10-bit unsigned immediate constant
-// load, works in conjunction with its transform function.
-def v4i32Uns10Imm: PatLeaf<(build_vector), [{
- return SPU::get_vec_i10imm(N, *CurDAG, MVT::i32).Val != 0;
-}], v4i32Uns10Imm_xform>;
-
-// v4i32SExt16Imm_xform function: convert build_vector to 16-bit sign extended
-// immediate constant load for v4i32 vectors.
-def v4i32SExt16Imm_xform: SDNodeXForm<build_vector, [{
- return SPU::get_vec_i16imm(N, *CurDAG, MVT::i32);
-}]>;
-
-// v4i32SExt16Imm: Predicate test for 16-bit sign extended immediate constant
-// load, works in conjunction with its transform function.
-def v4i32SExt16Imm: PatLeaf<(build_vector), [{
- return SPU::get_vec_i16imm(N, *CurDAG, MVT::i32).Val != 0;
-}], v4i32SExt16Imm_xform>;
-
-// v4i32Uns18Imm_xform function: convert build_vector to 18-bit unsigned
-// immediate constant load for v4i32 vectors.
-def v4i32Uns18Imm_xform: SDNodeXForm<build_vector, [{
- return SPU::get_vec_u18imm(N, *CurDAG, MVT::i32);
-}]>;
-
-// v4i32Uns18Imm: Predicate test for 18-bit unsigned immediate constant load,
-// works in conjunction with its transform function.
-def v4i32Uns18Imm: PatLeaf<(build_vector), [{
- return SPU::get_vec_u18imm(N, *CurDAG, MVT::i32).Val != 0;
-}], v4i32Uns18Imm_xform>;
-
-// ILHUvec_get_imm xform function: convert build_vector to ILHUvec imm constant
-// load.
-def ILHUvec_get_imm: SDNodeXForm<build_vector, [{
- return SPU::get_ILHUvec_imm(N, *CurDAG, MVT::i32);
-}]>;
-
-/// immILHUvec: Predicate test for a ILHU constant vector.
-def immILHUvec: PatLeaf<(build_vector), [{
- return SPU::get_ILHUvec_imm(N, *CurDAG, MVT::i32).Val != 0;
-}], ILHUvec_get_imm>;
-
-// Catch-all for any other i32 vector constants
-def v4i32_get_imm: SDNodeXForm<build_vector, [{
- return SPU::get_v4i32_imm(N, *CurDAG);
-}]>;
-
-def v4i32Imm: PatLeaf<(build_vector), [{
- return SPU::get_v4i32_imm(N, *CurDAG).Val != 0;
-}], v4i32_get_imm>;
-
-// v2i64SExt10Imm_xform function: convert build_vector to 10-bit sign extended
-// immediate constant load for v2i64 vectors.
-def v2i64SExt10Imm_xform: SDNodeXForm<build_vector, [{
- return SPU::get_vec_i10imm(N, *CurDAG, MVT::i64);
-}]>;
-
-// v2i64SExt10Imm: Predicate test for 10-bit sign extended immediate constant
-// load, works in conjunction with its transform function.
-def v2i64SExt10Imm: PatLeaf<(build_vector), [{
- return SPU::get_vec_i10imm(N, *CurDAG, MVT::i64).Val != 0;
-}], v2i64SExt10Imm_xform>;
-
-// v2i64SExt16Imm_xform function: convert build_vector to 16-bit sign extended
-// immediate constant load for v2i64 vectors.
-def v2i64SExt16Imm_xform: SDNodeXForm<build_vector, [{
- return SPU::get_vec_i16imm(N, *CurDAG, MVT::i64);
-}]>;
-
-// v2i64SExt16Imm: Predicate test for 16-bit sign extended immediate constant
-// load, works in conjunction with its transform function.
-def v2i64SExt16Imm: PatLeaf<(build_vector), [{
- return SPU::get_vec_i16imm(N, *CurDAG, MVT::i64).Val != 0;
-}], v2i64SExt16Imm_xform>;
-
-// v2i64Uns18Imm_xform function: convert build_vector to 18-bit unsigned
-// immediate constant load for v2i64 vectors.
-def v2i64Uns18Imm_xform: SDNodeXForm<build_vector, [{
- return SPU::get_vec_u18imm(N, *CurDAG, MVT::i64);
-}]>;
-
-// v2i64Uns18Imm: Predicate test for 18-bit unsigned immediate constant load,
-// works in conjunction with its transform function.
-def v2i64Uns18Imm: PatLeaf<(build_vector), [{
- return SPU::get_vec_u18imm(N, *CurDAG, MVT::i64).Val != 0;
-}], v2i64Uns18Imm_xform>;
-
-/// immILHUvec: Predicate test for a ILHU constant vector.
-def immILHUvec_i64: PatLeaf<(build_vector), [{
- return SPU::get_ILHUvec_imm(N, *CurDAG, MVT::i64).Val != 0;
-}], ILHUvec_get_imm>;
-
-// Catch-all for any other i32 vector constants
-def v2i64_get_imm: SDNodeXForm<build_vector, [{
- return SPU::get_v2i64_imm(N, *CurDAG);
-}]>;
-
-def v2i64Imm: PatLeaf<(build_vector), [{
- return SPU::get_v2i64_imm(N, *CurDAG).Val != 0;
-}], v2i64_get_imm>;
-
-//===----------------------------------------------------------------------===//
-// Operand Definitions.
-
-def s7imm: Operand<i8> {
- let PrintMethod = "printS7ImmOperand";
-}
-
-def s7imm_i8: Operand<i8> {
- let PrintMethod = "printS7ImmOperand";
-}
-
-def u7imm: Operand<i16> {
- let PrintMethod = "printU7ImmOperand";
-}
-
-def u7imm_i8: Operand<i8> {
- let PrintMethod = "printU7ImmOperand";
-}
-
-def u7imm_i32: Operand<i32> {
- let PrintMethod = "printU7ImmOperand";
-}
-
-// Halfword, signed 10-bit constant
-def s10imm : Operand<i16> {
- let PrintMethod = "printS10ImmOperand";
-}
-
-def s10imm_i8: Operand<i8> {
- let PrintMethod = "printS10ImmOperand";
-}
-
-def s10imm_i32: Operand<i32> {
- let PrintMethod = "printS10ImmOperand";
-}
-
-def s10imm_i64: Operand<i64> {
- let PrintMethod = "printS10ImmOperand";
-}
-
-// Unsigned 10-bit integers:
-def u10imm: Operand<i16> {
- let PrintMethod = "printU10ImmOperand";
-}
-
-def u10imm_i8: Operand<i8> {
- let PrintMethod = "printU10ImmOperand";
-}
-
-def u10imm_i32: Operand<i32> {
- let PrintMethod = "printU10ImmOperand";
-}
-
-def s16imm : Operand<i16> {
- let PrintMethod = "printS16ImmOperand";
-}
-
-def s16imm_i8: Operand<i8> {
- let PrintMethod = "printS16ImmOperand";
-}
-
-def s16imm_i32: Operand<i32> {
- let PrintMethod = "printS16ImmOperand";
-}
-
-def s16imm_i64: Operand<i64> {
- let PrintMethod = "printS16ImmOperand";
-}
-
-def s16imm_f32: Operand<f32> {
- let PrintMethod = "printS16ImmOperand";
-}
-
-def s16imm_f64: Operand<f64> {
- let PrintMethod = "printS16ImmOperand";
-}
-
-def u16imm_i64 : Operand<i64> {
- let PrintMethod = "printU16ImmOperand";
-}
-
-def u16imm_i32 : Operand<i32> {
- let PrintMethod = "printU16ImmOperand";
-}
-
-def u16imm : Operand<i16> {
- let PrintMethod = "printU16ImmOperand";
-}
-
-def f16imm : Operand<f32> {
- let PrintMethod = "printU16ImmOperand";
-}
-
-def s18imm : Operand<i32> {
- let PrintMethod = "printS18ImmOperand";
-}
-
-def u18imm : Operand<i32> {
- let PrintMethod = "printU18ImmOperand";
-}
-
-def u18imm_i64 : Operand<i64> {
- let PrintMethod = "printU18ImmOperand";
-}
-
-def f18imm : Operand<f32> {
- let PrintMethod = "printU18ImmOperand";
-}
-
-def f18imm_f64 : Operand<f64> {
- let PrintMethod = "printU18ImmOperand";
-}
-
-// Negated 7-bit halfword rotate immediate operands
-def rothNeg7imm : Operand<i32> {
- let PrintMethod = "printROTHNeg7Imm";
-}
-
-def rothNeg7imm_i16 : Operand<i16> {
- let PrintMethod = "printROTHNeg7Imm";
-}
-
-// Negated 7-bit word rotate immediate operands
-def rotNeg7imm : Operand<i32> {
- let PrintMethod = "printROTNeg7Imm";
-}
-
-def rotNeg7imm_i16 : Operand<i16> {
- let PrintMethod = "printROTNeg7Imm";
-}
-
-def target : Operand<OtherVT> {
- let PrintMethod = "printBranchOperand";
-}
-
-// Absolute address call target
-def calltarget : Operand<iPTR> {
- let PrintMethod = "printCallOperand";
- let MIOperandInfo = (ops u18imm:$calldest);
-}
-
-// Relative call target
-def relcalltarget : Operand<iPTR> {
- let PrintMethod = "printPCRelativeOperand";
- let MIOperandInfo = (ops s16imm:$calldest);
-}
-
-// Branch targets:
-def brtarget : Operand<OtherVT> {
- let PrintMethod = "printPCRelativeOperand";
-}
-
-// Indirect call target
-def indcalltarget : Operand<iPTR> {
- let PrintMethod = "printCallOperand";
- let MIOperandInfo = (ops ptr_rc:$calldest);
-}
-
-def symbolHi: Operand<i32> {
- let PrintMethod = "printSymbolHi";
-}
-
-def symbolLo: Operand<i32> {
- let PrintMethod = "printSymbolLo";
-}
-
-def symbolLSA: Operand<i32> {
- let PrintMethod = "printSymbolLSA";
-}
-
-// memory s7imm(reg) operaand
-def memri7 : Operand<iPTR> {
- let PrintMethod = "printMemRegImmS7";
- let MIOperandInfo = (ops s7imm:$imm, ptr_rc:$reg);
-}
-
-// memory s10imm(reg) operand
-def memri10 : Operand<iPTR> {
- let PrintMethod = "printMemRegImmS10";
- let MIOperandInfo = (ops s10imm:$imm, ptr_rc:$reg);
-}
-
-// 256K local store address
-// N.B.: The tblgen code generator expects to have two operands, an offset
-// and a pointer. Of these, only the immediate is actually used.
-def addr256k : Operand<iPTR> {
- let PrintMethod = "printAddr256K";
- let MIOperandInfo = (ops s16imm:$imm, ptr_rc:$reg);
-}
-
-// memory s18imm(reg) operand
-def memri18 : Operand<iPTR> {
- let PrintMethod = "printMemRegImmS18";
- let MIOperandInfo = (ops s18imm:$imm, ptr_rc:$reg);
-}
-
-// memory register + register operand
-def memrr : Operand<iPTR> {
- let PrintMethod = "printMemRegReg";
- let MIOperandInfo = (ops ptr_rc:$reg_a, ptr_rc:$reg_b);
-}
-
-// Define SPU-specific addressing modes: These come in three basic
-// flavors:
-//
-// D-form : [r+I10] (10-bit signed offset + reg)
-// X-form : [r+r] (reg+reg)
-// A-form : abs (256K LSA offset)
-// D-form(2): [r+I7] (7-bit signed offset + reg)
-
-def dform_addr : ComplexPattern<iPTR, 2, "SelectDFormAddr", [], []>;
-def xform_addr : ComplexPattern<iPTR, 2, "SelectXFormAddr", [], []>;
-def aform_addr : ComplexPattern<iPTR, 2, "SelectAFormAddr", [], []>;
-def dform2_addr : ComplexPattern<iPTR, 2, "SelectDForm2Addr", [], []>;
diff --git a/release_23/lib/Target/CellSPU/SPURegisterInfo.cpp b/release_23/lib/Target/CellSPU/SPURegisterInfo.cpp
deleted file mode 100644
index ea69d215a538..000000000000
--- a/release_23/lib/Target/CellSPU/SPURegisterInfo.cpp
+++ /dev/null
@@ -1,606 +0,0 @@
-//===- SPURegisterInfo.cpp - Cell SPU Register Information ----------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains the Cell implementation of the TargetRegisterInfo class.
-//
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "reginfo"
-#include "SPU.h"
-#include "SPURegisterInfo.h"
-#include "SPURegisterNames.h"
-#include "SPUInstrBuilder.h"
-#include "SPUSubtarget.h"
-#include "SPUMachineFunction.h"
-#include "SPUFrameInfo.h"
-#include "llvm/Constants.h"
-#include "llvm/Type.h"
-#include "llvm/CodeGen/ValueTypes.h"
-#include "llvm/CodeGen/MachineInstrBuilder.h"
-#include "llvm/CodeGen/MachineModuleInfo.h"
-#include "llvm/CodeGen/MachineFunction.h"
-#include "llvm/CodeGen/MachineFrameInfo.h"
-#include "llvm/CodeGen/MachineLocation.h"
-#include "llvm/CodeGen/MachineRegisterInfo.h"
-#include "llvm/CodeGen/SelectionDAGNodes.h"
-#include "llvm/CodeGen/ValueTypes.h"
-#include "llvm/Target/TargetFrameInfo.h"
-#include "llvm/Target/TargetInstrInfo.h"
-#include "llvm/Target/TargetMachine.h"
-#include "llvm/Target/TargetOptions.h"
-#include "llvm/Support/CommandLine.h"
-#include "llvm/Support/Debug.h"
-#include "llvm/Support/MathExtras.h"
-#include "llvm/ADT/BitVector.h"
-#include "llvm/ADT/STLExtras.h"
-#include <cstdlib>
-#include <iostream>
-
-using namespace llvm;
-
-/// getRegisterNumbering - Given the enum value for some register, e.g.
-/// PPC::F14, return the number that it corresponds to (e.g. 14).
-unsigned SPURegisterInfo::getRegisterNumbering(unsigned RegEnum) {
- using namespace SPU;
- switch (RegEnum) {
- case SPU::R0: return 0;
- case SPU::R1: return 1;
- case SPU::R2: return 2;
- case SPU::R3: return 3;
- case SPU::R4: return 4;
- case SPU::R5: return 5;
- case SPU::R6: return 6;
- case SPU::R7: return 7;
- case SPU::R8: return 8;
- case SPU::R9: return 9;
- case SPU::R10: return 10;
- case SPU::R11: return 11;
- case SPU::R12: return 12;
- case SPU::R13: return 13;
- case SPU::R14: return 14;
- case SPU::R15: return 15;
- case SPU::R16: return 16;
- case SPU::R17: return 17;
- case SPU::R18: return 18;
- case SPU::R19: return 19;
- case SPU::R20: return 20;
- case SPU::R21: return 21;
- case SPU::R22: return 22;
- case SPU::R23: return 23;
- case SPU::R24: return 24;
- case SPU::R25: return 25;
- case SPU::R26: return 26;
- case SPU::R27: return 27;
- case SPU::R28: return 28;
- case SPU::R29: return 29;
- case SPU::R30: return 30;
- case SPU::R31: return 31;
- case SPU::R32: return 32;
- case SPU::R33: return 33;
- case SPU::R34: return 34;
- case SPU::R35: return 35;
- case SPU::R36: return 36;
- case SPU::R37: return 37;
- case SPU::R38: return 38;
- case SPU::R39: return 39;
- case SPU::R40: return 40;
- case SPU::R41: return 41;
- case SPU::R42: return 42;
- case SPU::R43: return 43;
- case SPU::R44: return 44;
- case SPU::R45: return 45;
- case SPU::R46: return 46;
- case SPU::R47: return 47;
- case SPU::R48: return 48;
- case SPU::R49: return 49;
- case SPU::R50: return 50;
- case SPU::R51: return 51;
- case SPU::R52: return 52;
- case SPU::R53: return 53;
- case SPU::R54: return 54;
- case SPU::R55: return 55;
- case SPU::R56: return 56;
- case SPU::R57: return 57;
- case SPU::R58: return 58;
- case SPU::R59: return 59;
- case SPU::R60: return 60;
- case SPU::R61: return 61;
- case SPU::R62: return 62;
- case SPU::R63: return 63;
- case SPU::R64: return 64;
- case SPU::R65: return 65;
- case SPU::R66: return 66;
- case SPU::R67: return 67;
- case SPU::R68: return 68;
- case SPU::R69: return 69;
- case SPU::R70: return 70;
- case SPU::R71: return 71;
- case SPU::R72: return 72;
- case SPU::R73: return 73;
- case SPU::R74: return 74;
- case SPU::R75: return 75;
- case SPU::R76: return 76;
- case SPU::R77: return 77;
- case SPU::R78: return 78;
- case SPU::R79: return 79;
- case SPU::R80: return 80;
- case SPU::R81: return 81;
- case SPU::R82: return 82;
- case SPU::R83: return 83;
- case SPU::R84: return 84;
- case SPU::R85: return 85;
- case SPU::R86: return 86;
- case SPU::R87: return 87;
- case SPU::R88: return 88;
- case SPU::R89: return 89;
- case SPU::R90: return 90;
- case SPU::R91: return 91;
- case SPU::R92: return 92;
- case SPU::R93: return 93;
- case SPU::R94: return 94;
- case SPU::R95: return 95;
- case SPU::R96: return 96;
- case SPU::R97: return 97;
- case SPU::R98: return 98;
- case SPU::R99: return 99;
- case SPU::R100: return 100;
- case SPU::R101: return 101;
- case SPU::R102: return 102;
- case SPU::R103: return 103;
- case SPU::R104: return 104;
- case SPU::R105: return 105;
- case SPU::R106: return 106;
- case SPU::R107: return 107;
- case SPU::R108: return 108;
- case SPU::R109: return 109;
- case SPU::R110: return 110;
- case SPU::R111: return 111;
- case SPU::R112: return 112;
- case SPU::R113: return 113;
- case SPU::R114: return 114;
- case SPU::R115: return 115;
- case SPU::R116: return 116;
- case SPU::R117: return 117;
- case SPU::R118: return 118;
- case SPU::R119: return 119;
- case SPU::R120: return 120;
- case SPU::R121: return 121;
- case SPU::R122: return 122;
- case SPU::R123: return 123;
- case SPU::R124: return 124;
- case SPU::R125: return 125;
- case SPU::R126: return 126;
- case SPU::R127: return 127;
- default:
- std::cerr << "Unhandled reg in SPURegisterInfo::getRegisterNumbering!\n";
- abort();
- }
-}
-
-SPURegisterInfo::SPURegisterInfo(const SPUSubtarget &subtarget,
- const TargetInstrInfo &tii) :
- SPUGenRegisterInfo(SPU::ADJCALLSTACKDOWN, SPU::ADJCALLSTACKUP),
- Subtarget(subtarget),
- TII(tii)
-{
-}
-
-// SPU's 128-bit registers used for argument passing:
-static const unsigned SPU_ArgRegs[] = {
- SPU::R3, SPU::R4, SPU::R5, SPU::R6, SPU::R7, SPU::R8, SPU::R9,
- SPU::R10, SPU::R11, SPU::R12, SPU::R13, SPU::R14, SPU::R15, SPU::R16,
- SPU::R17, SPU::R18, SPU::R19, SPU::R20, SPU::R21, SPU::R22, SPU::R23,
- SPU::R24, SPU::R25, SPU::R26, SPU::R27, SPU::R28, SPU::R29, SPU::R30,
- SPU::R31, SPU::R32, SPU::R33, SPU::R34, SPU::R35, SPU::R36, SPU::R37,
- SPU::R38, SPU::R39, SPU::R40, SPU::R41, SPU::R42, SPU::R43, SPU::R44,
- SPU::R45, SPU::R46, SPU::R47, SPU::R48, SPU::R49, SPU::R50, SPU::R51,
- SPU::R52, SPU::R53, SPU::R54, SPU::R55, SPU::R56, SPU::R57, SPU::R58,
- SPU::R59, SPU::R60, SPU::R61, SPU::R62, SPU::R63, SPU::R64, SPU::R65,
- SPU::R66, SPU::R67, SPU::R68, SPU::R69, SPU::R70, SPU::R71, SPU::R72,
- SPU::R73, SPU::R74, SPU::R75, SPU::R76, SPU::R77, SPU::R78, SPU::R79
-};
-
-const unsigned *
-SPURegisterInfo::getArgRegs()
-{
- return SPU_ArgRegs;
-}
-
-unsigned
-SPURegisterInfo::getNumArgRegs()
-{
- return sizeof(SPU_ArgRegs) / sizeof(SPU_ArgRegs[0]);
-}
-
-const unsigned *
-SPURegisterInfo::getCalleeSavedRegs(const MachineFunction *MF) const
-{
- // Cell ABI calling convention
- static const unsigned SPU_CalleeSaveRegs[] = {
- SPU::R80, SPU::R81, SPU::R82, SPU::R83,
- SPU::R84, SPU::R85, SPU::R86, SPU::R87,
- SPU::R88, SPU::R89, SPU::R90, SPU::R91,
- SPU::R92, SPU::R93, SPU::R94, SPU::R95,
- SPU::R96, SPU::R97, SPU::R98, SPU::R99,
- SPU::R100, SPU::R101, SPU::R102, SPU::R103,
- SPU::R104, SPU::R105, SPU::R106, SPU::R107,
- SPU::R108, SPU::R109, SPU::R110, SPU::R111,
- SPU::R112, SPU::R113, SPU::R114, SPU::R115,
- SPU::R116, SPU::R117, SPU::R118, SPU::R119,
- SPU::R120, SPU::R121, SPU::R122, SPU::R123,
- SPU::R124, SPU::R125, SPU::R126, SPU::R127,
- SPU::R2, /* environment pointer */
- SPU::R1, /* stack pointer */
- SPU::R0, /* link register */
- 0 /* end */
- };
-
- return SPU_CalleeSaveRegs;
-}
-
-const TargetRegisterClass* const*
-SPURegisterInfo::getCalleeSavedRegClasses(const MachineFunction *MF) const
-{
- // Cell ABI Calling Convention
- static const TargetRegisterClass * const SPU_CalleeSaveRegClasses[] = {
- &SPU::GPRCRegClass, &SPU::GPRCRegClass, &SPU::GPRCRegClass,
- &SPU::GPRCRegClass, &SPU::GPRCRegClass, &SPU::GPRCRegClass,
- &SPU::GPRCRegClass, &SPU::GPRCRegClass, &SPU::GPRCRegClass,
- &SPU::GPRCRegClass, &SPU::GPRCRegClass, &SPU::GPRCRegClass,
- &SPU::GPRCRegClass, &SPU::GPRCRegClass, &SPU::GPRCRegClass,
- &SPU::GPRCRegClass, &SPU::GPRCRegClass, &SPU::GPRCRegClass,
- &SPU::GPRCRegClass, &SPU::GPRCRegClass, &SPU::GPRCRegClass,
- &SPU::GPRCRegClass, &SPU::GPRCRegClass, &SPU::GPRCRegClass,
- &SPU::GPRCRegClass, &SPU::GPRCRegClass, &SPU::GPRCRegClass,
- &SPU::GPRCRegClass, &SPU::GPRCRegClass, &SPU::GPRCRegClass,
- &SPU::GPRCRegClass, &SPU::GPRCRegClass, &SPU::GPRCRegClass,
- &SPU::GPRCRegClass, &SPU::GPRCRegClass, &SPU::GPRCRegClass,
- &SPU::GPRCRegClass, &SPU::GPRCRegClass, &SPU::GPRCRegClass,
- &SPU::GPRCRegClass, &SPU::GPRCRegClass, &SPU::GPRCRegClass,
- &SPU::GPRCRegClass, &SPU::GPRCRegClass, &SPU::GPRCRegClass,
- &SPU::GPRCRegClass, &SPU::GPRCRegClass, &SPU::GPRCRegClass,
- &SPU::GPRCRegClass, /* environment pointer */
- &SPU::GPRCRegClass, /* stack pointer */
- &SPU::GPRCRegClass, /* link register */
- 0 /* end */
- };
-
- return SPU_CalleeSaveRegClasses;
-}
-
-/*!
- R0 (link register), R1 (stack pointer) and R2 (environment pointer -- this is
- generally unused) are the Cell's reserved registers
- */
-BitVector SPURegisterInfo::getReservedRegs(const MachineFunction &MF) const {
- BitVector Reserved(getNumRegs());
- Reserved.set(SPU::R0); // LR
- Reserved.set(SPU::R1); // SP
- Reserved.set(SPU::R2); // environment pointer
- return Reserved;
-}
-
-//===----------------------------------------------------------------------===//
-// Stack Frame Processing methods
-//===----------------------------------------------------------------------===//
-
-// needsFP - Return true if the specified function should have a dedicated frame
-// pointer register. This is true if the function has variable sized allocas or
-// if frame pointer elimination is disabled.
-//
-static bool needsFP(const MachineFunction &MF) {
- const MachineFrameInfo *MFI = MF.getFrameInfo();
- return NoFramePointerElim || MFI->hasVarSizedObjects();
-}
-
-//--------------------------------------------------------------------------
-// hasFP - Return true if the specified function actually has a dedicated frame
-// pointer register. This is true if the function needs a frame pointer and has
-// a non-zero stack size.
-bool
-SPURegisterInfo::hasFP(const MachineFunction &MF) const {
- const MachineFrameInfo *MFI = MF.getFrameInfo();
- return MFI->getStackSize() && needsFP(MF);
-}
-
-//--------------------------------------------------------------------------
-void
-SPURegisterInfo::eliminateCallFramePseudoInstr(MachineFunction &MF,
- MachineBasicBlock &MBB,
- MachineBasicBlock::iterator I)
- const
-{
- // Simply discard ADJCALLSTACKDOWN, ADJCALLSTACKUP instructions.
- MBB.erase(I);
-}
-
-void
-SPURegisterInfo::eliminateFrameIndex(MachineBasicBlock::iterator II, int SPAdj,
- RegScavenger *RS) const
-{
- unsigned i = 0;
- MachineInstr &MI = *II;
- MachineBasicBlock &MBB = *MI.getParent();
- MachineFunction &MF = *MBB.getParent();
- MachineFrameInfo *MFI = MF.getFrameInfo();
-
- while (!MI.getOperand(i).isFrameIndex()) {
- ++i;
- assert(i < MI.getNumOperands() && "Instr doesn't have FrameIndex operand!");
- }
-
- MachineOperand &SPOp = MI.getOperand(i);
- int FrameIndex = SPOp.getIndex();
-
- // Now add the frame object offset to the offset from r1.
- int Offset = MFI->getObjectOffset(FrameIndex);
-
- // Most instructions, except for generated FrameIndex additions using AIr32,
- // have the immediate in operand 1. AIr32, in this case, has the immediate
- // in operand 2.
- unsigned OpNo = (MI.getOpcode() != SPU::AIr32 ? 1 : 2);
- MachineOperand &MO = MI.getOperand(OpNo);
-
- // Offset is biased by $lr's slot at the bottom.
- Offset += MO.getImm() + MFI->getStackSize() + SPUFrameInfo::minStackSize();
- assert((Offset & 0xf) == 0
- && "16-byte alignment violated in eliminateFrameIndex");
-
- // Replace the FrameIndex with base register with $sp (aka $r1)
- SPOp.ChangeToRegister(SPU::R1, false);
- if (Offset > SPUFrameInfo::maxFrameOffset()
- || Offset < SPUFrameInfo::minFrameOffset()) {
- cerr << "Large stack adjustment ("
- << Offset
- << ") in SPURegisterInfo::eliminateFrameIndex.";
- } else {
- MO.ChangeToImmediate(Offset);
- }
-}
-
-/// determineFrameLayout - Determine the size of the frame and maximum call
-/// frame size.
-void
-SPURegisterInfo::determineFrameLayout(MachineFunction &MF) const
-{
- MachineFrameInfo *MFI = MF.getFrameInfo();
-
- // Get the number of bytes to allocate from the FrameInfo
- unsigned FrameSize = MFI->getStackSize();
-
- // Get the alignments provided by the target, and the maximum alignment
- // (if any) of the fixed frame objects.
- unsigned TargetAlign = MF.getTarget().getFrameInfo()->getStackAlignment();
- unsigned Align = std::max(TargetAlign, MFI->getMaxAlignment());
- assert(isPowerOf2_32(Align) && "Alignment is not power of 2");
- unsigned AlignMask = Align - 1;
-
- // Get the maximum call frame size of all the calls.
- unsigned maxCallFrameSize = MFI->getMaxCallFrameSize();
-
- // If we have dynamic alloca then maxCallFrameSize needs to be aligned so
- // that allocations will be aligned.
- if (MFI->hasVarSizedObjects())
- maxCallFrameSize = (maxCallFrameSize + AlignMask) & ~AlignMask;
-
- // Update maximum call frame size.
- MFI->setMaxCallFrameSize(maxCallFrameSize);
-
- // Include call frame size in total.
- FrameSize += maxCallFrameSize;
-
- // Make sure the frame is aligned.
- FrameSize = (FrameSize + AlignMask) & ~AlignMask;
-
- // Update frame info.
- MFI->setStackSize(FrameSize);
-}
-
-void SPURegisterInfo::processFunctionBeforeCalleeSavedScan(MachineFunction &MF,
- RegScavenger *RS)
- const {
-#if 0
- // Save and clear the LR state.
- SPUFunctionInfo *FI = MF.getInfo<SPUFunctionInfo>();
- FI->setUsesLR(MF.getRegInfo().isPhysRegUsed(LR));
-#endif
- // Mark LR and SP unused, since the prolog spills them to stack and
- // we don't want anyone else to spill them for us.
- //
- // Also, unless R2 is really used someday, don't spill it automatically.
- MF.getRegInfo().setPhysRegUnused(SPU::R0);
- MF.getRegInfo().setPhysRegUnused(SPU::R1);
- MF.getRegInfo().setPhysRegUnused(SPU::R2);
-}
-
-void SPURegisterInfo::emitPrologue(MachineFunction &MF) const
-{
- MachineBasicBlock &MBB = MF.front(); // Prolog goes in entry BB
- MachineBasicBlock::iterator MBBI = MBB.begin();
- MachineFrameInfo *MFI = MF.getFrameInfo();
- MachineModuleInfo *MMI = MFI->getMachineModuleInfo();
-
- // Prepare for debug frame info.
- bool hasDebugInfo = MMI && MMI->hasDebugInfo();
- unsigned FrameLabelId = 0;
-
- // Move MBBI back to the beginning of the function.
- MBBI = MBB.begin();
-
- // Work out frame sizes.
- determineFrameLayout(MF);
- int FrameSize = MFI->getStackSize();
-
- assert((FrameSize & 0xf) == 0
- && "SPURegisterInfo::emitPrologue: FrameSize not aligned");
-
- if (FrameSize > 0) {
- FrameSize = -(FrameSize + SPUFrameInfo::minStackSize());
- if (hasDebugInfo) {
- // Mark effective beginning of when frame pointer becomes valid.
- FrameLabelId = MMI->NextLabelID();
- BuildMI(MBB, MBBI, TII.get(ISD::LABEL)).addImm(FrameLabelId).addImm(0);
- }
-
- // Adjust stack pointer, spilling $lr -> 16($sp) and $sp -> -FrameSize($sp)
- // for the ABI
- BuildMI(MBB, MBBI, TII.get(SPU::STQDr32), SPU::R0).addImm(16)
- .addReg(SPU::R1);
- if (isS10Constant(FrameSize)) {
- // Spill $sp to adjusted $sp
- BuildMI(MBB, MBBI, TII.get(SPU::STQDr32), SPU::R1).addImm(FrameSize)
- .addReg(SPU::R1);
- // Adjust $sp by required amout
- BuildMI(MBB, MBBI, TII.get(SPU::AIr32), SPU::R1).addReg(SPU::R1)
- .addImm(FrameSize);
- } else if (FrameSize <= (1 << 16) - 1 && FrameSize >= -(1 << 16)) {
- // Frame size can be loaded into ILr32n, so temporarily spill $r2 and use
- // $r2 to adjust $sp:
- BuildMI(MBB, MBBI, TII.get(SPU::STQDr128), SPU::R2)
- .addImm(-16)
- .addReg(SPU::R1);
- BuildMI(MBB, MBBI, TII.get(SPU::ILr32), SPU::R2)
- .addImm(FrameSize);
- BuildMI(MBB, MBBI, TII.get(SPU::STQDr32), SPU::R1)
- .addReg(SPU::R2)
- .addReg(SPU::R1);
- BuildMI(MBB, MBBI, TII.get(SPU::Ar32), SPU::R1)
- .addReg(SPU::R1)
- .addReg(SPU::R2);
- BuildMI(MBB, MBBI, TII.get(SPU::SFIr32), SPU::R2)
- .addReg(SPU::R2)
- .addImm(16);
- BuildMI(MBB, MBBI, TII.get(SPU::LQXr128), SPU::R2)
- .addReg(SPU::R2)
- .addReg(SPU::R1);
- } else {
- cerr << "Unhandled frame size: " << FrameSize << "\n";
- abort();
- }
-
- if (hasDebugInfo) {
- std::vector<MachineMove> &Moves = MMI->getFrameMoves();
-
- // Show update of SP.
- MachineLocation SPDst(MachineLocation::VirtualFP);
- MachineLocation SPSrc(MachineLocation::VirtualFP, -FrameSize);
- Moves.push_back(MachineMove(FrameLabelId, SPDst, SPSrc));
-
- // Add callee saved registers to move list.
- const std::vector<CalleeSavedInfo> &CSI = MFI->getCalleeSavedInfo();
- for (unsigned I = 0, E = CSI.size(); I != E; ++I) {
- int Offset = MFI->getObjectOffset(CSI[I].getFrameIdx());
- unsigned Reg = CSI[I].getReg();
- if (Reg == SPU::R0) continue;
- MachineLocation CSDst(MachineLocation::VirtualFP, Offset);
- MachineLocation CSSrc(Reg);
- Moves.push_back(MachineMove(FrameLabelId, CSDst, CSSrc));
- }
-
- // Mark effective beginning of when frame pointer is ready.
- unsigned ReadyLabelId = MMI->NextLabelID();
- BuildMI(MBB, MBBI, TII.get(ISD::LABEL)).addImm(ReadyLabelId).addImm(0);
-
- MachineLocation FPDst(SPU::R1);
- MachineLocation FPSrc(MachineLocation::VirtualFP);
- Moves.push_back(MachineMove(ReadyLabelId, FPDst, FPSrc));
- }
- } else {
- // This is a leaf function -- insert a branch hint iff there are
- // sufficient number instructions in the basic block. Note that
- // this is just a best guess based on the basic block's size.
- if (MBB.size() >= (unsigned) SPUFrameInfo::branchHintPenalty()) {
- MachineBasicBlock::iterator MBBI = prior(MBB.end());
- // Insert terminator label
- unsigned BranchLabelId = MMI->NextLabelID();
- BuildMI(MBB, MBBI, TII.get(SPU::LABEL)).addImm(BranchLabelId).addImm(0);
- }
- }
-}
-
-void
-SPURegisterInfo::emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const
-{
- MachineBasicBlock::iterator MBBI = prior(MBB.end());
- const MachineFrameInfo *MFI = MF.getFrameInfo();
- int FrameSize = MFI->getStackSize();
- int LinkSlotOffset = SPUFrameInfo::stackSlotSize();
-
- assert(MBBI->getOpcode() == SPU::RET &&
- "Can only insert epilog into returning blocks");
- assert((FrameSize & 0xf) == 0
- && "SPURegisterInfo::emitEpilogue: FrameSize not aligned");
- if (FrameSize > 0) {
- FrameSize = FrameSize + SPUFrameInfo::minStackSize();
- if (isS10Constant(FrameSize + LinkSlotOffset)) {
- // Reload $lr, adjust $sp by required amount
- // Note: We do this to slightly improve dual issue -- not by much, but it
- // is an opportunity for dual issue.
- BuildMI(MBB, MBBI, TII.get(SPU::LQDr128), SPU::R0)
- .addImm(FrameSize + LinkSlotOffset)
- .addReg(SPU::R1);
- BuildMI(MBB, MBBI, TII.get(SPU::AIr32), SPU::R1)
- .addReg(SPU::R1)
- .addImm(FrameSize);
- } else if (FrameSize <= (1 << 16) - 1 && FrameSize >= -(1 << 16)) {
- // Frame size can be loaded into ILr32n, so temporarily spill $r2 and use
- // $r2 to adjust $sp:
- BuildMI(MBB, MBBI, TII.get(SPU::STQDr128), SPU::R2)
- .addImm(16)
- .addReg(SPU::R1);
- BuildMI(MBB, MBBI, TII.get(SPU::ILr32), SPU::R2)
- .addImm(FrameSize);
- BuildMI(MBB, MBBI, TII.get(SPU::Ar32), SPU::R1)
- .addReg(SPU::R1)
- .addReg(SPU::R2);
- BuildMI(MBB, MBBI, TII.get(SPU::LQDr128), SPU::R0)
- .addImm(16)
- .addReg(SPU::R2);
- BuildMI(MBB, MBBI, TII.get(SPU::SFIr32), SPU::R2).
- addReg(SPU::R2)
- .addImm(16);
- BuildMI(MBB, MBBI, TII.get(SPU::LQXr128), SPU::R2)
- .addReg(SPU::R2)
- .addReg(SPU::R1);
- } else {
- cerr << "Unhandled frame size: " << FrameSize << "\n";
- abort();
- }
- }
-}
-
-unsigned
-SPURegisterInfo::getRARegister() const
-{
- return SPU::R0;
-}
-
-unsigned
-SPURegisterInfo::getFrameRegister(MachineFunction &MF) const
-{
- return SPU::R1;
-}
-
-void
-SPURegisterInfo::getInitialFrameState(std::vector<MachineMove> &Moves) const
-{
- // Initial state of the frame pointer is R1.
- MachineLocation Dst(MachineLocation::VirtualFP);
- MachineLocation Src(SPU::R1, 0);
- Moves.push_back(MachineMove(0, Dst, Src));
-}
-
-
-int
-SPURegisterInfo::getDwarfRegNum(unsigned RegNum, bool isEH) const {
- // FIXME: Most probably dwarf numbers differs for Linux and Darwin
- return SPUGenRegisterInfo::getDwarfRegNumFull(RegNum, 0);
-}
-
-#include "SPUGenRegisterInfo.inc"
diff --git a/release_23/lib/Target/CellSPU/SPURegisterInfo.h b/release_23/lib/Target/CellSPU/SPURegisterInfo.h
deleted file mode 100644
index 31d5c5b6a7d4..000000000000
--- a/release_23/lib/Target/CellSPU/SPURegisterInfo.h
+++ /dev/null
@@ -1,97 +0,0 @@
-//===- SPURegisterInfo.h - Cell SPU Register Information Impl ----*- C++ -*-==//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains the Cell SPU implementation of the TargetRegisterInfo
-// class.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef SPU_REGISTERINFO_H
-#define SPU_REGISTERINFO_H
-
-#include "SPU.h"
-#include "SPUGenRegisterInfo.h.inc"
-
-namespace llvm {
- class SPUSubtarget;
- class TargetInstrInfo;
- class Type;
-
- class SPURegisterInfo : public SPUGenRegisterInfo {
- private:
- const SPUSubtarget &Subtarget;
- const TargetInstrInfo &TII;
-
- //! Predicate: Does the machine function use the link register?
- bool usesLR(MachineFunction &MF) const;
-
- public:
- SPURegisterInfo(const SPUSubtarget &subtarget, const TargetInstrInfo &tii);
-
- //! Translate a register's enum value to a register number
- /*!
- This method translates a register's enum value to it's regiser number,
- e.g. SPU::R14 -> 14.
- */
- static unsigned getRegisterNumbering(unsigned RegEnum);
-
- //! Return the array of callee-saved registers
- virtual const unsigned* getCalleeSavedRegs(const MachineFunction *MF) const;
-
- //! Return the register class array of the callee-saved registers
- virtual const TargetRegisterClass* const *
- getCalleeSavedRegClasses(const MachineFunction *MF) const;
-
- //! Return the reserved registers
- BitVector getReservedRegs(const MachineFunction &MF) const;
-
- //! Prediate: Target has dedicated frame pointer
- bool hasFP(const MachineFunction &MF) const;
- //! Eliminate the call frame setup pseudo-instructions
- void eliminateCallFramePseudoInstr(MachineFunction &MF,
- MachineBasicBlock &MBB,
- MachineBasicBlock::iterator I) const;
- //! Convert frame indicies into machine operands
- void eliminateFrameIndex(MachineBasicBlock::iterator II, int,
- RegScavenger *RS) const;
- //! Determine the frame's layour
- void determineFrameLayout(MachineFunction &MF) const;
-
- void processFunctionBeforeCalleeSavedScan(MachineFunction &MF,
- RegScavenger *RS = NULL) const;
- //! Emit the function prologue
- void emitPrologue(MachineFunction &MF) const;
- //! Emit the function epilogue
- void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const;
- //! Get return address register (LR, aka R0)
- unsigned getRARegister() const;
- //! Get the stack frame register (SP, aka R1)
- unsigned getFrameRegister(MachineFunction &MF) const;
- //! Perform target-specific stack frame setup.
- void getInitialFrameState(std::vector<MachineMove> &Moves) const;
-
- //------------------------------------------------------------------------
- // New methods added:
- //------------------------------------------------------------------------
-
- //! Return the array of argument passing registers
- /*!
- \note The size of this array is returned by getArgRegsSize().
- */
- static const unsigned *getArgRegs();
-
- //! Return the size of the argument passing register array
- static unsigned getNumArgRegs();
-
- //! Get DWARF debugging register number
- int getDwarfRegNum(unsigned RegNum, bool isEH) const;
- };
-} // end namespace llvm
-
-#endif
diff --git a/release_23/lib/Target/CellSPU/SPURegisterInfo.td b/release_23/lib/Target/CellSPU/SPURegisterInfo.td
deleted file mode 100644
index 8ce6bc84e7aa..000000000000
--- a/release_23/lib/Target/CellSPU/SPURegisterInfo.td
+++ /dev/null
@@ -1,427 +0,0 @@
-//===- SPURegisterInfo.td - The Cell SPU Register File -----*- tablegen -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-//
-//===----------------------------------------------------------------------===//
-
-class SPUReg<string n> : Register<n> {
- let Namespace = "SPU";
-}
-
-// The SPU's register are all 128-bits wide, which makes specifying the
-// registers relatively easy, if relatively mundane:
-
-class SPUVecReg<bits<7> num, string n> : SPUReg<n> {
- field bits<7> Num = num;
-}
-
-def R0 : SPUVecReg<0, "$lr">, DwarfRegNum<[0]>;
-def R1 : SPUVecReg<1, "$sp">, DwarfRegNum<[1]>;
-def R2 : SPUVecReg<2, "$2">, DwarfRegNum<[2]>;
-def R3 : SPUVecReg<3, "$3">, DwarfRegNum<[3]>;
-def R4 : SPUVecReg<4, "$4">, DwarfRegNum<[4]>;
-def R5 : SPUVecReg<5, "$5">, DwarfRegNum<[5]>;
-def R6 : SPUVecReg<6, "$6">, DwarfRegNum<[6]>;
-def R7 : SPUVecReg<7, "$7">, DwarfRegNum<[7]>;
-def R8 : SPUVecReg<8, "$8">, DwarfRegNum<[8]>;
-def R9 : SPUVecReg<9, "$9">, DwarfRegNum<[9]>;
-def R10 : SPUVecReg<10, "$10">, DwarfRegNum<[10]>;
-def R11 : SPUVecReg<11, "$11">, DwarfRegNum<[11]>;
-def R12 : SPUVecReg<12, "$12">, DwarfRegNum<[12]>;
-def R13 : SPUVecReg<13, "$13">, DwarfRegNum<[13]>;
-def R14 : SPUVecReg<14, "$14">, DwarfRegNum<[14]>;
-def R15 : SPUVecReg<15, "$15">, DwarfRegNum<[15]>;
-def R16 : SPUVecReg<16, "$16">, DwarfRegNum<[16]>;
-def R17 : SPUVecReg<17, "$17">, DwarfRegNum<[17]>;
-def R18 : SPUVecReg<18, "$18">, DwarfRegNum<[18]>;
-def R19 : SPUVecReg<19, "$19">, DwarfRegNum<[19]>;
-def R20 : SPUVecReg<20, "$20">, DwarfRegNum<[20]>;
-def R21 : SPUVecReg<21, "$21">, DwarfRegNum<[21]>;
-def R22 : SPUVecReg<22, "$22">, DwarfRegNum<[22]>;
-def R23 : SPUVecReg<23, "$23">, DwarfRegNum<[23]>;
-def R24 : SPUVecReg<24, "$24">, DwarfRegNum<[24]>;
-def R25 : SPUVecReg<25, "$25">, DwarfRegNum<[25]>;
-def R26 : SPUVecReg<26, "$26">, DwarfRegNum<[26]>;
-def R27 : SPUVecReg<27, "$27">, DwarfRegNum<[27]>;
-def R28 : SPUVecReg<28, "$28">, DwarfRegNum<[28]>;
-def R29 : SPUVecReg<29, "$29">, DwarfRegNum<[29]>;
-def R30 : SPUVecReg<30, "$30">, DwarfRegNum<[30]>;
-def R31 : SPUVecReg<31, "$31">, DwarfRegNum<[31]>;
-def R32 : SPUVecReg<32, "$32">, DwarfRegNum<[32]>;
-def R33 : SPUVecReg<33, "$33">, DwarfRegNum<[33]>;
-def R34 : SPUVecReg<34, "$34">, DwarfRegNum<[34]>;
-def R35 : SPUVecReg<35, "$35">, DwarfRegNum<[35]>;
-def R36 : SPUVecReg<36, "$36">, DwarfRegNum<[36]>;
-def R37 : SPUVecReg<37, "$37">, DwarfRegNum<[37]>;
-def R38 : SPUVecReg<38, "$38">, DwarfRegNum<[38]>;
-def R39 : SPUVecReg<39, "$39">, DwarfRegNum<[39]>;
-def R40 : SPUVecReg<40, "$40">, DwarfRegNum<[40]>;
-def R41 : SPUVecReg<41, "$41">, DwarfRegNum<[41]>;
-def R42 : SPUVecReg<42, "$42">, DwarfRegNum<[42]>;
-def R43 : SPUVecReg<43, "$43">, DwarfRegNum<[43]>;
-def R44 : SPUVecReg<44, "$44">, DwarfRegNum<[44]>;
-def R45 : SPUVecReg<45, "$45">, DwarfRegNum<[45]>;
-def R46 : SPUVecReg<46, "$46">, DwarfRegNum<[46]>;
-def R47 : SPUVecReg<47, "$47">, DwarfRegNum<[47]>;
-def R48 : SPUVecReg<48, "$48">, DwarfRegNum<[48]>;
-def R49 : SPUVecReg<49, "$49">, DwarfRegNum<[49]>;
-def R50 : SPUVecReg<50, "$50">, DwarfRegNum<[50]>;
-def R51 : SPUVecReg<51, "$51">, DwarfRegNum<[51]>;
-def R52 : SPUVecReg<52, "$52">, DwarfRegNum<[52]>;
-def R53 : SPUVecReg<53, "$53">, DwarfRegNum<[53]>;
-def R54 : SPUVecReg<54, "$54">, DwarfRegNum<[54]>;
-def R55 : SPUVecReg<55, "$55">, DwarfRegNum<[55]>;
-def R56 : SPUVecReg<56, "$56">, DwarfRegNum<[56]>;
-def R57 : SPUVecReg<57, "$57">, DwarfRegNum<[57]>;
-def R58 : SPUVecReg<58, "$58">, DwarfRegNum<[58]>;
-def R59 : SPUVecReg<59, "$59">, DwarfRegNum<[59]>;
-def R60 : SPUVecReg<60, "$60">, DwarfRegNum<[60]>;
-def R61 : SPUVecReg<61, "$61">, DwarfRegNum<[61]>;
-def R62 : SPUVecReg<62, "$62">, DwarfRegNum<[62]>;
-def R63 : SPUVecReg<63, "$63">, DwarfRegNum<[63]>;
-def R64 : SPUVecReg<64, "$64">, DwarfRegNum<[64]>;
-def R65 : SPUVecReg<65, "$65">, DwarfRegNum<[65]>;
-def R66 : SPUVecReg<66, "$66">, DwarfRegNum<[66]>;
-def R67 : SPUVecReg<67, "$67">, DwarfRegNum<[67]>;
-def R68 : SPUVecReg<68, "$68">, DwarfRegNum<[68]>;
-def R69 : SPUVecReg<69, "$69">, DwarfRegNum<[69]>;
-def R70 : SPUVecReg<70, "$70">, DwarfRegNum<[70]>;
-def R71 : SPUVecReg<71, "$71">, DwarfRegNum<[71]>;
-def R72 : SPUVecReg<72, "$72">, DwarfRegNum<[72]>;
-def R73 : SPUVecReg<73, "$73">, DwarfRegNum<[73]>;
-def R74 : SPUVecReg<74, "$74">, DwarfRegNum<[74]>;
-def R75 : SPUVecReg<75, "$75">, DwarfRegNum<[75]>;
-def R76 : SPUVecReg<76, "$76">, DwarfRegNum<[76]>;
-def R77 : SPUVecReg<77, "$77">, DwarfRegNum<[77]>;
-def R78 : SPUVecReg<78, "$78">, DwarfRegNum<[78]>;
-def R79 : SPUVecReg<79, "$79">, DwarfRegNum<[79]>;
-def R80 : SPUVecReg<80, "$80">, DwarfRegNum<[80]>;
-def R81 : SPUVecReg<81, "$81">, DwarfRegNum<[81]>;
-def R82 : SPUVecReg<82, "$82">, DwarfRegNum<[82]>;
-def R83 : SPUVecReg<83, "$83">, DwarfRegNum<[83]>;
-def R84 : SPUVecReg<84, "$84">, DwarfRegNum<[84]>;
-def R85 : SPUVecReg<85, "$85">, DwarfRegNum<[85]>;
-def R86 : SPUVecReg<86, "$86">, DwarfRegNum<[86]>;
-def R87 : SPUVecReg<87, "$87">, DwarfRegNum<[87]>;
-def R88 : SPUVecReg<88, "$88">, DwarfRegNum<[88]>;
-def R89 : SPUVecReg<89, "$89">, DwarfRegNum<[89]>;
-def R90 : SPUVecReg<90, "$90">, DwarfRegNum<[90]>;
-def R91 : SPUVecReg<91, "$91">, DwarfRegNum<[91]>;
-def R92 : SPUVecReg<92, "$92">, DwarfRegNum<[92]>;
-def R93 : SPUVecReg<93, "$93">, DwarfRegNum<[93]>;
-def R94 : SPUVecReg<94, "$94">, DwarfRegNum<[94]>;
-def R95 : SPUVecReg<95, "$95">, DwarfRegNum<[95]>;
-def R96 : SPUVecReg<96, "$96">, DwarfRegNum<[96]>;
-def R97 : SPUVecReg<97, "$97">, DwarfRegNum<[97]>;
-def R98 : SPUVecReg<98, "$98">, DwarfRegNum<[98]>;
-def R99 : SPUVecReg<99, "$99">, DwarfRegNum<[99]>;
-def R100 : SPUVecReg<100, "$100">, DwarfRegNum<[100]>;
-def R101 : SPUVecReg<101, "$101">, DwarfRegNum<[101]>;
-def R102 : SPUVecReg<102, "$102">, DwarfRegNum<[102]>;
-def R103 : SPUVecReg<103, "$103">, DwarfRegNum<[103]>;
-def R104 : SPUVecReg<104, "$104">, DwarfRegNum<[104]>;
-def R105 : SPUVecReg<105, "$105">, DwarfRegNum<[105]>;
-def R106 : SPUVecReg<106, "$106">, DwarfRegNum<[106]>;
-def R107 : SPUVecReg<107, "$107">, DwarfRegNum<[107]>;
-def R108 : SPUVecReg<108, "$108">, DwarfRegNum<[108]>;
-def R109 : SPUVecReg<109, "$109">, DwarfRegNum<[109]>;
-def R110 : SPUVecReg<110, "$110">, DwarfRegNum<[110]>;
-def R111 : SPUVecReg<111, "$111">, DwarfRegNum<[111]>;
-def R112 : SPUVecReg<112, "$112">, DwarfRegNum<[112]>;
-def R113 : SPUVecReg<113, "$113">, DwarfRegNum<[113]>;
-def R114 : SPUVecReg<114, "$114">, DwarfRegNum<[114]>;
-def R115 : SPUVecReg<115, "$115">, DwarfRegNum<[115]>;
-def R116 : SPUVecReg<116, "$116">, DwarfRegNum<[116]>;
-def R117 : SPUVecReg<117, "$117">, DwarfRegNum<[117]>;
-def R118 : SPUVecReg<118, "$118">, DwarfRegNum<[118]>;
-def R119 : SPUVecReg<119, "$119">, DwarfRegNum<[119]>;
-def R120 : SPUVecReg<120, "$120">, DwarfRegNum<[120]>;
-def R121 : SPUVecReg<121, "$121">, DwarfRegNum<[121]>;
-def R122 : SPUVecReg<122, "$122">, DwarfRegNum<[122]>;
-def R123 : SPUVecReg<123, "$123">, DwarfRegNum<[123]>;
-def R124 : SPUVecReg<124, "$124">, DwarfRegNum<[124]>;
-def R125 : SPUVecReg<125, "$125">, DwarfRegNum<[125]>;
-def R126 : SPUVecReg<126, "$126">, DwarfRegNum<[126]>;
-def R127 : SPUVecReg<127, "$127">, DwarfRegNum<[127]>;
-
-/* Need floating point status register here: */
-/* def FPCSR : ... */
-
-// The SPU's registers as 128-bit wide entities, and can function as general
-// purpose registers, where the operands are in the "preferred slot":
-def GPRC : RegisterClass<"SPU", [i128], 128,
- [
- /* volatile register */
- R3, R4, R5, R6, R7, R8, R9, R10, R11, R12, R13, R14, R15, R16,
- R17, R18, R19, R20, R21, R22, R23, R24, R25, R26, R27, R28, R29, R30, R31,
- R32, R33, R34, R35, R36, R37, R38, R39, R40, R41, R42, R43, R44, R45, R46,
- R47, R48, R49, R50, R51, R52, R53, R54, R55, R56, R57, R58, R59, R60, R61,
- R62, R63, R64, R65, R66, R67, R68, R69, R70, R71, R72, R73, R74, R75, R76,
- R77, R78, R79,
- /* non-volatile register: take hint from PPC and allocate in reverse order */
- R127, R126, R125, R124, R123, R122, R121, R120, R119, R118, R117, R116, R115,
- R114, R113, R112, R111, R110, R109, R108, R107, R106, R105, R104, R103, R102,
- R101, R100, R99, R98, R97, R96, R95, R94, R93, R92, R91, R90, R89, R88, R87,
- R86, R85, R84, R83, R82, R81, R80,
- /* environment ptr, SP, LR */
- R2, R1, R0 ]>
-{
- let MethodProtos = [{
- iterator allocation_order_begin(const MachineFunction &MF) const;
- iterator allocation_order_end(const MachineFunction &MF) const;
- }];
- let MethodBodies = [{
- GPRCClass::iterator
- GPRCClass::allocation_order_begin(const MachineFunction &MF) const {
- return begin();
- }
- GPRCClass::iterator
- GPRCClass::allocation_order_end(const MachineFunction &MF) const {
- return end()-3; // don't allocate R2, R1, or R0 (envp, sp, lr)
- }
- }];
-}
-
-// The SPU's registers as 64-bit wide (double word integer) "preferred slot":
-def R64C : RegisterClass<"SPU", [i64], 128,
- [
- /* volatile register */
- R3, R4, R5, R6, R7, R8, R9, R10, R11, R12, R13, R14, R15, R16,
- R17, R18, R19, R20, R21, R22, R23, R24, R25, R26, R27, R28, R29, R30, R31,
- R32, R33, R34, R35, R36, R37, R38, R39, R40, R41, R42, R43, R44, R45, R46,
- R47, R48, R49, R50, R51, R52, R53, R54, R55, R56, R57, R58, R59, R60, R61,
- R62, R63, R64, R65, R66, R67, R68, R69, R70, R71, R72, R73, R74, R75, R76,
- R77, R78, R79,
- /* non-volatile register: take hint from PPC and allocate in reverse order */
- R127, R126, R125, R124, R123, R122, R121, R120, R119, R118, R117, R116, R115,
- R114, R113, R112, R111, R110, R109, R108, R107, R106, R105, R104, R103, R102,
- R101, R100, R99, R98, R97, R96, R95, R94, R93, R92, R91, R90, R89, R88, R87,
- R86, R85, R84, R83, R82, R81, R80,
- /* environment ptr, SP, LR */
- R2, R1, R0 ]>
-{
- let MethodProtos = [{
- iterator allocation_order_begin(const MachineFunction &MF) const;
- iterator allocation_order_end(const MachineFunction &MF) const;
- }];
- let MethodBodies = [{
- R64CClass::iterator
- R64CClass::allocation_order_begin(const MachineFunction &MF) const {
- return begin();
- }
- R64CClass::iterator
- R64CClass::allocation_order_end(const MachineFunction &MF) const {
- return end()-3; // don't allocate R2, R1, or R0 (envp, sp, lr)
- }
- }];
-}
-
-// The SPU's registers as 64-bit wide (double word) FP "preferred slot":
-def R64FP : RegisterClass<"SPU", [f64], 128,
- [
- /* volatile register */
- R3, R4, R5, R6, R7, R8, R9, R10, R11, R12, R13, R14, R15, R16,
- R17, R18, R19, R20, R21, R22, R23, R24, R25, R26, R27, R28, R29, R30, R31,
- R32, R33, R34, R35, R36, R37, R38, R39, R40, R41, R42, R43, R44, R45, R46,
- R47, R48, R49, R50, R51, R52, R53, R54, R55, R56, R57, R58, R59, R60, R61,
- R62, R63, R64, R65, R66, R67, R68, R69, R70, R71, R72, R73, R74, R75, R76,
- R77, R78, R79,
- /* non-volatile register: take hint from PPC and allocate in reverse order */
- R127, R126, R125, R124, R123, R122, R121, R120, R119, R118, R117, R116, R115,
- R114, R113, R112, R111, R110, R109, R108, R107, R106, R105, R104, R103, R102,
- R101, R100, R99, R98, R97, R96, R95, R94, R93, R92, R91, R90, R89, R88, R87,
- R86, R85, R84, R83, R82, R81, R80,
- /* environment ptr, SP, LR */
- R2, R1, R0 ]>
-{
- let MethodProtos = [{
- iterator allocation_order_begin(const MachineFunction &MF) const;
- iterator allocation_order_end(const MachineFunction &MF) const;
- }];
- let MethodBodies = [{
- R64FPClass::iterator
- R64FPClass::allocation_order_begin(const MachineFunction &MF) const {
- return begin();
- }
- R64FPClass::iterator
- R64FPClass::allocation_order_end(const MachineFunction &MF) const {
- return end()-3; // don't allocate R2, R1, or R0 (envp, sp, lr)
- }
- }];
-}
-
-// The SPU's registers as 32-bit wide (word) "preferred slot":
-def R32C : RegisterClass<"SPU", [i32], 128,
- [
- /* volatile register */
- R3, R4, R5, R6, R7, R8, R9, R10, R11, R12, R13, R14, R15, R16,
- R17, R18, R19, R20, R21, R22, R23, R24, R25, R26, R27, R28, R29, R30, R31,
- R32, R33, R34, R35, R36, R37, R38, R39, R40, R41, R42, R43, R44, R45, R46,
- R47, R48, R49, R50, R51, R52, R53, R54, R55, R56, R57, R58, R59, R60, R61,
- R62, R63, R64, R65, R66, R67, R68, R69, R70, R71, R72, R73, R74, R75, R76,
- R77, R78, R79,
- /* non-volatile register: take hint from PPC and allocate in reverse order */
- R127, R126, R125, R124, R123, R122, R121, R120, R119, R118, R117, R116, R115,
- R114, R113, R112, R111, R110, R109, R108, R107, R106, R105, R104, R103, R102,
- R101, R100, R99, R98, R97, R96, R95, R94, R93, R92, R91, R90, R89, R88, R87,
- R86, R85, R84, R83, R82, R81, R80,
- /* environment ptr, SP, LR */
- R2, R1, R0 ]>
-{
- let MethodProtos = [{
- iterator allocation_order_begin(const MachineFunction &MF) const;
- iterator allocation_order_end(const MachineFunction &MF) const;
- }];
- let MethodBodies = [{
- R32CClass::iterator
- R32CClass::allocation_order_begin(const MachineFunction &MF) const {
- return begin();
- }
- R32CClass::iterator
- R32CClass::allocation_order_end(const MachineFunction &MF) const {
- return end()-3; // don't allocate R2, R1, or R0 (envp, sp, lr)
- }
- }];
-}
-
-// The SPU's registers as single precision floating point "preferred slot":
-def R32FP : RegisterClass<"SPU", [f32], 128,
- [
- /* volatile register */
- R3, R4, R5, R6, R7, R8, R9, R10, R11, R12, R13, R14, R15, R16,
- R17, R18, R19, R20, R21, R22, R23, R24, R25, R26, R27, R28, R29, R30, R31,
- R32, R33, R34, R35, R36, R37, R38, R39, R40, R41, R42, R43, R44, R45, R46,
- R47, R48, R49, R50, R51, R52, R53, R54, R55, R56, R57, R58, R59, R60, R61,
- R62, R63, R64, R65, R66, R67, R68, R69, R70, R71, R72, R73, R74, R75, R76,
- R77, R78, R79,
- /* non-volatile register: take hint from PPC and allocate in reverse order */
- R127, R126, R125, R124, R123, R122, R121, R120, R119, R118, R117, R116, R115,
- R114, R113, R112, R111, R110, R109, R108, R107, R106, R105, R104, R103, R102,
- R101, R100, R99, R98, R97, R96, R95, R94, R93, R92, R91, R90, R89, R88, R87,
- R86, R85, R84, R83, R82, R81, R80,
- /* environment ptr, SP, LR */
- R2, R1, R0 ]>
-{
- let MethodProtos = [{
- iterator allocation_order_begin(const MachineFunction &MF) const;
- iterator allocation_order_end(const MachineFunction &MF) const;
- }];
- let MethodBodies = [{
- R32FPClass::iterator
- R32FPClass::allocation_order_begin(const MachineFunction &MF) const {
- return begin();
- }
- R32FPClass::iterator
- R32FPClass::allocation_order_end(const MachineFunction &MF) const {
- return end()-3; // don't allocate R2, R1, or R0 (envp, sp, lr)
- }
- }];
-}
-
-// The SPU's registers as 16-bit wide (halfword) "preferred slot":
-def R16C : RegisterClass<"SPU", [i16], 128,
- [
- /* volatile register */
- R3, R4, R5, R6, R7, R8, R9, R10, R11, R12, R13, R14, R15, R16,
- R17, R18, R19, R20, R21, R22, R23, R24, R25, R26, R27, R28, R29, R30, R31,
- R32, R33, R34, R35, R36, R37, R38, R39, R40, R41, R42, R43, R44, R45, R46,
- R47, R48, R49, R50, R51, R52, R53, R54, R55, R56, R57, R58, R59, R60, R61,
- R62, R63, R64, R65, R66, R67, R68, R69, R70, R71, R72, R73, R74, R75, R76,
- R77, R78, R79,
- /* non-volatile register: take hint from PPC and allocate in reverse order */
- R127, R126, R125, R124, R123, R122, R121, R120, R119, R118, R117, R116, R115,
- R114, R113, R112, R111, R110, R109, R108, R107, R106, R105, R104, R103, R102,
- R101, R100, R99, R98, R97, R96, R95, R94, R93, R92, R91, R90, R89, R88, R87,
- R86, R85, R84, R83, R82, R81, R80,
- /* environment ptr, SP, LR */
- R2, R1, R0 ]>
-{
- let MethodProtos = [{
- iterator allocation_order_begin(const MachineFunction &MF) const;
- iterator allocation_order_end(const MachineFunction &MF) const;
- }];
- let MethodBodies = [{
- R16CClass::iterator
- R16CClass::allocation_order_begin(const MachineFunction &MF) const {
- return begin();
- }
- R16CClass::iterator
- R16CClass::allocation_order_end(const MachineFunction &MF) const {
- return end()-3; // don't allocate R2, R1, or R0 (envp, sp, lr)
- }
- }];
-}
-
-// The SPU's registers as 8-bit wide (byte) "preferred slot":
-def R8C : RegisterClass<"SPU", [i8], 128,
- [
- /* volatile register */
- R3, R4, R5, R6, R7, R8, R9, R10, R11, R12, R13, R14, R15, R16,
- R17, R18, R19, R20, R21, R22, R23, R24, R25, R26, R27, R28, R29, R30, R31,
- R32, R33, R34, R35, R36, R37, R38, R39, R40, R41, R42, R43, R44, R45, R46,
- R47, R48, R49, R50, R51, R52, R53, R54, R55, R56, R57, R58, R59, R60, R61,
- R62, R63, R64, R65, R66, R67, R68, R69, R70, R71, R72, R73, R74, R75, R76,
- R77, R78, R79,
- /* non-volatile register: take hint from PPC and allocate in reverse order */
- R127, R126, R125, R124, R123, R122, R121, R120, R119, R118, R117, R116, R115,
- R114, R113, R112, R111, R110, R109, R108, R107, R106, R105, R104, R103, R102,
- R101, R100, R99, R98, R97, R96, R95, R94, R93, R92, R91, R90, R89, R88, R87,
- R86, R85, R84, R83, R82, R81, R80,
- /* environment ptr, SP, LR */
- R2, R1, R0 ]>
-{
- let MethodProtos = [{
- iterator allocation_order_begin(const MachineFunction &MF) const;
- iterator allocation_order_end(const MachineFunction &MF) const;
- }];
- let MethodBodies = [{
- R8CClass::iterator
- R8CClass::allocation_order_begin(const MachineFunction &MF) const {
- return begin();
- }
- R8CClass::iterator
- R8CClass::allocation_order_end(const MachineFunction &MF) const {
- return end()-3; // don't allocate R2, R1, or R0 (envp, sp, lr)
- }
- }];
-}
-
-// The SPU's registers as vector registers:
-def VECREG : RegisterClass<"SPU", [v16i8,v8i16,v4i32,v4f32,v2i64,v2f64], 128,
- [
- /* volatile register */
- R3, R4, R5, R6, R7, R8, R9, R10, R11, R12, R13, R14, R15, R16,
- R17, R18, R19, R20, R21, R22, R23, R24, R25, R26, R27, R28, R29, R30, R31,
- R32, R33, R34, R35, R36, R37, R38, R39, R40, R41, R42, R43, R44, R45, R46,
- R47, R48, R49, R50, R51, R52, R53, R54, R55, R56, R57, R58, R59, R60, R61,
- R62, R63, R64, R65, R66, R67, R68, R69, R70, R71, R72, R73, R74, R75, R76,
- R77, R78, R79,
- /* non-volatile register: take hint from PPC and allocate in reverse order */
- R127, R126, R125, R124, R123, R122, R121, R120, R119, R118, R117, R116, R115,
- R114, R113, R112, R111, R110, R109, R108, R107, R106, R105, R104, R103, R102,
- R101, R100, R99, R98, R97, R96, R95, R94, R93, R92, R91, R90, R89, R88, R87,
- R86, R85, R84, R83, R82, R81, R80,
- /* environment ptr, SP, LR */
- R2, R1, R0 ]>
-{
- let MethodProtos = [{
- iterator allocation_order_begin(const MachineFunction &MF) const;
- iterator allocation_order_end(const MachineFunction &MF) const;
- }];
- let MethodBodies = [{
- VECREGClass::iterator
- VECREGClass::allocation_order_begin(const MachineFunction &MF) const {
- return begin();
- }
- VECREGClass::iterator
- VECREGClass::allocation_order_end(const MachineFunction &MF) const {
- return end()-3; // don't allocate R2, R1, or R0 (envp, sp, lr)
- }
- }];
-}
diff --git a/release_23/lib/Target/CellSPU/SPURegisterNames.h b/release_23/lib/Target/CellSPU/SPURegisterNames.h
deleted file mode 100644
index 6c3afdf41fdc..000000000000
--- a/release_23/lib/Target/CellSPU/SPURegisterNames.h
+++ /dev/null
@@ -1,18 +0,0 @@
-//===- SPURegisterNames.h - Wrapper header for SPU register names -*- C++ -*-=//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef SPU_REGISTER_NAMES_H
-#define SPU_REGISTER_NAMES_H
-
-// Define symbolic names for Cell registers. This defines a mapping from
-// register name to register number.
-//
-#include "SPUGenRegisterNames.inc"
-
-#endif
diff --git a/release_23/lib/Target/CellSPU/SPUSchedule.td b/release_23/lib/Target/CellSPU/SPUSchedule.td
deleted file mode 100644
index 785dc4660110..000000000000
--- a/release_23/lib/Target/CellSPU/SPUSchedule.td
+++ /dev/null
@@ -1,57 +0,0 @@
-//===- SPUSchedule.td - Cell Scheduling Definitions --------*- tablegen -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-//===----------------------------------------------------------------------===//
-// Even pipeline:
-
-def EVEN_UNIT : FuncUnit; // Even execution unit: (PC & 0x7 == 000)
-def ODD_UNIT : FuncUnit; // Odd execution unit: (PC & 0x7 == 100)
-
-//===----------------------------------------------------------------------===//
-// Instruction Itinerary classes used for Cell SPU
-//===----------------------------------------------------------------------===//
-
-def LoadStore : InstrItinClass; // ODD_UNIT
-def BranchHints : InstrItinClass; // ODD_UNIT
-def BranchResolv : InstrItinClass; // ODD_UNIT
-def ChanOpSPR : InstrItinClass; // ODD_UNIT
-def ShuffleOp : InstrItinClass; // ODD_UNIT
-def SelectOp : InstrItinClass; // ODD_UNIT
-def GatherOp : InstrItinClass; // ODD_UNIT
-def LoadNOP : InstrItinClass; // ODD_UNIT
-def ExecNOP : InstrItinClass; // EVEN_UNIT
-def SPrecFP : InstrItinClass; // EVEN_UNIT
-def DPrecFP : InstrItinClass; // EVEN_UNIT
-def FPInt : InstrItinClass; // EVEN_UNIT (FP<->integer)
-def ByteOp : InstrItinClass; // EVEN_UNIT
-def IntegerOp : InstrItinClass; // EVEN_UNIT
-def IntegerMulDiv: InstrItinClass; // EVEN_UNIT
-def RotateShift : InstrItinClass; // EVEN_UNIT
-def ImmLoad : InstrItinClass; // EVEN_UNIT
-
-/* Note: The itinerary for the Cell SPU is somewhat contrived... */
-def SPUItineraries : ProcessorItineraries<[
- InstrItinData<LoadStore , [InstrStage<6, [ODD_UNIT]>]>,
- InstrItinData<BranchHints , [InstrStage<6, [ODD_UNIT]>]>,
- InstrItinData<BranchResolv, [InstrStage<4, [ODD_UNIT]>]>,
- InstrItinData<ChanOpSPR , [InstrStage<6, [ODD_UNIT]>]>,
- InstrItinData<ShuffleOp , [InstrStage<4, [ODD_UNIT]>]>,
- InstrItinData<SelectOp , [InstrStage<4, [ODD_UNIT]>]>,
- InstrItinData<GatherOp , [InstrStage<4, [ODD_UNIT]>]>,
- InstrItinData<LoadNOP , [InstrStage<1, [ODD_UNIT]>]>,
- InstrItinData<ExecNOP , [InstrStage<1, [EVEN_UNIT]>]>,
- InstrItinData<SPrecFP , [InstrStage<6, [EVEN_UNIT]>]>,
- InstrItinData<DPrecFP , [InstrStage<13, [EVEN_UNIT]>]>,
- InstrItinData<FPInt , [InstrStage<2, [EVEN_UNIT]>]>,
- InstrItinData<ByteOp , [InstrStage<4, [EVEN_UNIT]>]>,
- InstrItinData<IntegerOp , [InstrStage<2, [EVEN_UNIT]>]>,
- InstrItinData<RotateShift , [InstrStage<4, [EVEN_UNIT]>]>,
- InstrItinData<IntegerMulDiv,[InstrStage<7, [EVEN_UNIT]>]>,
- InstrItinData<ImmLoad , [InstrStage<2, [EVEN_UNIT]>]>
- ]>;
diff --git a/release_23/lib/Target/CellSPU/SPUSubtarget.cpp b/release_23/lib/Target/CellSPU/SPUSubtarget.cpp
deleted file mode 100644
index 0a1c2f75cfe5..000000000000
--- a/release_23/lib/Target/CellSPU/SPUSubtarget.cpp
+++ /dev/null
@@ -1,40 +0,0 @@
-//===- SPUSubtarget.cpp - STI Cell SPU Subtarget Information --------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the CellSPU-specific subclass of TargetSubtarget.
-//
-//===----------------------------------------------------------------------===//
-
-#include "SPUSubtarget.h"
-#include "SPU.h"
-#include "llvm/Module.h"
-#include "llvm/Target/TargetMachine.h"
-#include "SPUGenSubtarget.inc"
-
-using namespace llvm;
-
-SPUSubtarget::SPUSubtarget(const TargetMachine &tm, const Module &M,
- const std::string &FS) :
- TM(tm),
- StackAlignment(16),
- ProcDirective(SPU::DEFAULT_PROC),
- UseLargeMem(false)
-{
- // Should be the target SPU processor type. For now, since there's only
- // one, simply default to the current "v0" default:
- std::string default_cpu("v0");
-
- // Parse features string.
- ParseSubtargetFeatures(FS, default_cpu);
-}
-
-/// SetJITMode - This is called to inform the subtarget info that we are
-/// producing code for the JIT.
-void SPUSubtarget::SetJITMode() {
-}
diff --git a/release_23/lib/Target/CellSPU/SPUSubtarget.h b/release_23/lib/Target/CellSPU/SPUSubtarget.h
deleted file mode 100644
index 51dd44c5f9da..000000000000
--- a/release_23/lib/Target/CellSPU/SPUSubtarget.h
+++ /dev/null
@@ -1,94 +0,0 @@
-//===-- SPUSubtarget.h - Define Subtarget for the Cell SPU ------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file declares the Cell SPU-specific subclass of TargetSubtarget.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef CELLSUBTARGET_H
-#define CELLSUBTARGET_H
-
-#include "llvm/Target/TargetInstrItineraries.h"
-#include "llvm/Target/TargetSubtarget.h"
-
-#include <string>
-
-namespace llvm {
- class Module;
- class GlobalValue;
- class TargetMachine;
-
- namespace SPU {
- enum {
- PROC_NONE,
- DEFAULT_PROC
- };
- }
-
- class SPUSubtarget : public TargetSubtarget {
- protected:
- const TargetMachine &TM;
-
- /// stackAlignment - The minimum alignment known to hold of the stack frame
- /// on entry to the function and which must be maintained by every function.
- unsigned StackAlignment;
-
- /// Selected instruction itineraries (one entry per itinerary class.)
- InstrItineraryData InstrItins;
-
- /// Which SPU processor (this isn't really used, but it's there to keep
- /// the C compiler happy)
- unsigned ProcDirective;
-
- /// Use (assume) large memory -- effectively disables the LQA/STQA
- /// instructions that assume 259K local store.
- bool UseLargeMem;
-
- public:
- /// This constructor initializes the data members to match that
- /// of the specified module.
- ///
- SPUSubtarget(const TargetMachine &TM, const Module &M,
- const std::string &FS);
-
- /// ParseSubtargetFeatures - Parses features string setting specified
- /// subtarget options. Definition of function is auto generated by tblgen.
- void ParseSubtargetFeatures(const std::string &FS, const std::string &CPU);
-
- /// SetJITMode - This is called to inform the subtarget info that we are
- /// producing code for the JIT.
- void SetJITMode();
-
- /// getStackAlignment - Returns the minimum alignment known to hold of the
- /// stack frame on entry to the function and which must be maintained by
- /// every function for this subtarget.
- unsigned getStackAlignment() const { return StackAlignment; }
-
- /// getInstrItins - Return the instruction itineraies based on subtarget
- /// selection.
- const InstrItineraryData &getInstrItineraryData() const {
- return InstrItins;
- }
-
- /// Use large memory addressing predicate
- bool usingLargeMem() const {
- return UseLargeMem;
- }
-
- /// getTargetDataString - Return the pointer size and type alignment
- /// properties of this subtarget.
- const char *getTargetDataString() const {
- return "E-p:32:32:128-f64:64:128-f32:32:128-i64:32:128-i32:32:128"
- "-i16:16:128-i8:8:128-i1:8:128-a:0:128-v128:128:128"
- "-s:128:128";
- }
- };
-} // End llvm namespace
-
-#endif
diff --git a/release_23/lib/Target/CellSPU/SPUTargetAsmInfo.cpp b/release_23/lib/Target/CellSPU/SPUTargetAsmInfo.cpp
deleted file mode 100644
index 0d7aac15a05b..000000000000
--- a/release_23/lib/Target/CellSPU/SPUTargetAsmInfo.cpp
+++ /dev/null
@@ -1,52 +0,0 @@
-//===-- SPUTargetAsmInfo.cpp - Cell SPU asm properties ----------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains the declarations of the SPUTargetAsmInfo properties.
-//
-//===----------------------------------------------------------------------===//
-
-#include "SPUTargetAsmInfo.h"
-#include "SPUTargetMachine.h"
-#include "llvm/Function.h"
-using namespace llvm;
-
-SPUTargetAsmInfo::SPUTargetAsmInfo(const SPUTargetMachine &TM) {
- PCSymbol = ".";
- CommentString = "#";
- GlobalPrefix = "";
- PrivateGlobalPrefix = ".L";
- ZeroDirective = "\t.space\t";
- SetDirective = "\t.set";
- Data64bitsDirective = "\t.quad\t";
- AlignmentIsInBytes = false;
- SwitchToSectionDirective = ".section\t";
- ConstantPoolSection = "\t.const\t";
- JumpTableDataSection = ".const";
- CStringSection = "\t.cstring";
- StaticCtorsSection = ".mod_init_func";
- StaticDtorsSection = ".mod_term_func";
- FourByteConstantSection = ".const";
- SixteenByteConstantSection = "\t.section\t.rodata.cst16,\"aM\",@progbits,16";
- InlineAsmStart = "# InlineAsm Start";
- InlineAsmEnd = "# InlineAsm End";
-
- NeedsSet = true;
- /* FIXME: Need actual assembler syntax for DWARF info: */
- DwarfAbbrevSection = ".section __DWARF,__debug_abbrev,regular,debug";
- DwarfInfoSection = ".section __DWARF,__debug_info,regular,debug";
- DwarfLineSection = ".section __DWARF,__debug_line,regular,debug";
- DwarfFrameSection = ".section __DWARF,__debug_frame,regular,debug";
- DwarfPubNamesSection = ".section __DWARF,__debug_pubnames,regular,debug";
- DwarfPubTypesSection = ".section __DWARF,__debug_pubtypes,regular,debug";
- DwarfStrSection = ".section __DWARF,__debug_str,regular,debug";
- DwarfLocSection = ".section __DWARF,__debug_loc,regular,debug";
- DwarfARangesSection = ".section __DWARF,__debug_aranges,regular,debug";
- DwarfRangesSection = ".section __DWARF,__debug_ranges,regular,debug";
- DwarfMacInfoSection = ".section __DWARF,__debug_macinfo,regular,debug";
-}
diff --git a/release_23/lib/Target/CellSPU/SPUTargetAsmInfo.h b/release_23/lib/Target/CellSPU/SPUTargetAsmInfo.h
deleted file mode 100644
index 01036bc8c925..000000000000
--- a/release_23/lib/Target/CellSPU/SPUTargetAsmInfo.h
+++ /dev/null
@@ -1,30 +0,0 @@
-//===-- SPUTargetAsmInfo.h - Cell SPU asm properties -----------*- C++ -*--===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains the declaration of the SPUTargetAsmInfo class.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef PPCTARGETASMINFO_H
-#define PPCTARGETASMINFO_H
-
-#include "llvm/Target/TargetAsmInfo.h"
-
-namespace llvm {
-
- // Forward declaration.
- class SPUTargetMachine;
-
- struct SPUTargetAsmInfo : public TargetAsmInfo {
- SPUTargetAsmInfo(const SPUTargetMachine &TM);
- };
-
-} // namespace llvm
-
-#endif
diff --git a/release_23/lib/Target/CellSPU/SPUTargetMachine.cpp b/release_23/lib/Target/CellSPU/SPUTargetMachine.cpp
deleted file mode 100644
index 3019b55e36cc..000000000000
--- a/release_23/lib/Target/CellSPU/SPUTargetMachine.cpp
+++ /dev/null
@@ -1,85 +0,0 @@
-//===-- SPUTargetMachine.cpp - Define TargetMachine for Cell SPU ----------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// Top-level implementation for the Cell SPU target.
-//
-//===----------------------------------------------------------------------===//
-
-#include "SPU.h"
-#include "SPURegisterNames.h"
-#include "SPUTargetAsmInfo.h"
-#include "SPUTargetMachine.h"
-#include "llvm/Module.h"
-#include "llvm/PassManager.h"
-#include "llvm/Target/TargetMachineRegistry.h"
-
-using namespace llvm;
-
-namespace {
- // Register the targets
- RegisterTarget<SPUTargetMachine>
- CELLSPU("cellspu", " STI CBEA Cell SPU");
-}
-
-const std::pair<unsigned, int> *
-SPUFrameInfo::getCalleeSaveSpillSlots(unsigned &NumEntries) const {
- NumEntries = 1;
- return &LR[0];
-}
-
-const TargetAsmInfo *
-SPUTargetMachine::createTargetAsmInfo() const
-{
- return new SPUTargetAsmInfo(*this);
-}
-
-unsigned
-SPUTargetMachine::getModuleMatchQuality(const Module &M)
-{
- // We strongly match "spu-*" or "cellspu-*".
- std::string TT = M.getTargetTriple();
- if ((TT.size() == 3 && std::string(TT.begin(), TT.begin()+3) == "spu")
- || (TT.size() == 7 && std::string(TT.begin(), TT.begin()+7) == "cellspu")
- || (TT.size() >= 4 && std::string(TT.begin(), TT.begin()+4) == "spu-")
- || (TT.size() >= 8 && std::string(TT.begin(), TT.begin()+8) == "cellspu-"))
- return 20;
-
- return 0; // No match at all...
-}
-
-SPUTargetMachine::SPUTargetMachine(const Module &M, const std::string &FS)
- : Subtarget(*this, M, FS),
- DataLayout(Subtarget.getTargetDataString()),
- InstrInfo(*this),
- FrameInfo(*this),
- TLInfo(*this),
- InstrItins(Subtarget.getInstrItineraryData())
-{
- // For the time being, use static relocations, since there's really no
- // support for PIC yet.
- setRelocationModel(Reloc::Static);
-}
-
-//===----------------------------------------------------------------------===//
-// Pass Pipeline Configuration
-//===----------------------------------------------------------------------===//
-
-bool
-SPUTargetMachine::addInstSelector(PassManagerBase &PM, bool Fast)
-{
- // Install an instruction selector.
- PM.add(createSPUISelDag(*this));
- return false;
-}
-
-bool SPUTargetMachine::addAssemblyEmitter(PassManagerBase &PM, bool Fast,
- std::ostream &Out) {
- PM.add(createSPUAsmPrinterPass(Out, *this));
- return false;
-}
diff --git a/release_23/lib/Target/CellSPU/SPUTargetMachine.h b/release_23/lib/Target/CellSPU/SPUTargetMachine.h
deleted file mode 100644
index c8f70d768394..000000000000
--- a/release_23/lib/Target/CellSPU/SPUTargetMachine.h
+++ /dev/null
@@ -1,93 +0,0 @@
-//===-- SPUTargetMachine.h - Define TargetMachine for Cell SPU ----*- C++ -*-=//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file declares the CellSPU-specific subclass of TargetMachine.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef SPU_TARGETMACHINE_H
-#define SPU_TARGETMACHINE_H
-
-#include "SPUSubtarget.h"
-#include "SPUInstrInfo.h"
-#include "SPUISelLowering.h"
-#include "SPUFrameInfo.h"
-#include "llvm/Target/TargetMachine.h"
-#include "llvm/Target/TargetData.h"
-
-namespace llvm {
-class PassManager;
-class GlobalValue;
-class TargetFrameInfo;
-
-/// SPUTargetMachine
-///
-class SPUTargetMachine : public LLVMTargetMachine {
- SPUSubtarget Subtarget;
- const TargetData DataLayout;
- SPUInstrInfo InstrInfo;
- SPUFrameInfo FrameInfo;
- SPUTargetLowering TLInfo;
- InstrItineraryData InstrItins;
-
-protected:
- virtual const TargetAsmInfo *createTargetAsmInfo() const;
-
-public:
- SPUTargetMachine(const Module &M, const std::string &FS);
-
- /// Return the subtarget implementation object
- virtual const SPUSubtarget *getSubtargetImpl() const {
- return &Subtarget;
- }
- virtual const SPUInstrInfo *getInstrInfo() const {
- return &InstrInfo;
- }
- virtual const TargetFrameInfo *getFrameInfo() const {
- return &FrameInfo;
- }
- /*!
- \note Cell SPU does not support JIT today. It could support JIT at some
- point.
- */
- virtual TargetJITInfo *getJITInfo() {
- return NULL;
- }
-
- //! Module match function
- /*!
- Module matching function called by TargetMachineRegistry().
- */
- static unsigned getModuleMatchQuality(const Module &M);
-
- virtual SPUTargetLowering *getTargetLowering() const {
- return const_cast<SPUTargetLowering*>(&TLInfo);
- }
-
- virtual const TargetRegisterInfo *getRegisterInfo() const {
- return &InstrInfo.getRegisterInfo();
- }
-
- virtual const TargetData *getTargetData() const {
- return &DataLayout;
- }
-
- virtual const InstrItineraryData getInstrItineraryData() const {
- return InstrItins;
- }
-
- // Pass Pipeline Configuration
- virtual bool addInstSelector(PassManagerBase &PM, bool Fast);
- virtual bool addAssemblyEmitter(PassManagerBase &PM, bool Fast,
- std::ostream &Out);
-};
-
-} // end namespace llvm
-
-#endif
diff --git a/release_23/lib/Target/CppBackend/CPPBackend.cpp b/release_23/lib/Target/CppBackend/CPPBackend.cpp
deleted file mode 100644
index b42001fa284a..000000000000
--- a/release_23/lib/Target/CppBackend/CPPBackend.cpp
+++ /dev/null
@@ -1,1953 +0,0 @@
-//===-- CPPBackend.cpp - Library for converting LLVM code to C++ code -----===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the writing of the LLVM IR as a set of C++ calls to the
-// LLVM IR interface. The input module is assumed to be verified.
-//
-//===----------------------------------------------------------------------===//
-
-#include "CPPTargetMachine.h"
-#include "llvm/CallingConv.h"
-#include "llvm/Constants.h"
-#include "llvm/DerivedTypes.h"
-#include "llvm/InlineAsm.h"
-#include "llvm/Instruction.h"
-#include "llvm/Instructions.h"
-#include "llvm/Module.h"
-#include "llvm/Pass.h"
-#include "llvm/PassManager.h"
-#include "llvm/TypeSymbolTable.h"
-#include "llvm/Target/TargetMachineRegistry.h"
-#include "llvm/ADT/StringExtras.h"
-#include "llvm/ADT/STLExtras.h"
-#include "llvm/ADT/SmallPtrSet.h"
-#include "llvm/Support/CommandLine.h"
-#include "llvm/Config/config.h"
-#include <algorithm>
-#include <iostream>
-#include <set>
-
-using namespace llvm;
-
-static cl::opt<std::string>
-FuncName("cppfname", cl::desc("Specify the name of the generated function"),
- cl::value_desc("function name"));
-
-enum WhatToGenerate {
- GenProgram,
- GenModule,
- GenContents,
- GenFunction,
- GenFunctions,
- GenInline,
- GenVariable,
- GenType
-};
-
-static cl::opt<WhatToGenerate> GenerationType("cppgen", cl::Optional,
- cl::desc("Choose what kind of output to generate"),
- cl::init(GenProgram),
- cl::values(
- clEnumValN(GenProgram, "program", "Generate a complete program"),
- clEnumValN(GenModule, "module", "Generate a module definition"),
- clEnumValN(GenContents, "contents", "Generate contents of a module"),
- clEnumValN(GenFunction, "function", "Generate a function definition"),
- clEnumValN(GenFunctions,"functions", "Generate all function definitions"),
- clEnumValN(GenInline, "inline", "Generate an inline function"),
- clEnumValN(GenVariable, "variable", "Generate a variable definition"),
- clEnumValN(GenType, "type", "Generate a type definition"),
- clEnumValEnd
- )
-);
-
-static cl::opt<std::string> NameToGenerate("cppfor", cl::Optional,
- cl::desc("Specify the name of the thing to generate"),
- cl::init("!bad!"));
-
-namespace {
- // Register the target.
- RegisterTarget<CPPTargetMachine> X("cpp", " C++ backend");
-
- typedef std::vector<const Type*> TypeList;
- typedef std::map<const Type*,std::string> TypeMap;
- typedef std::map<const Value*,std::string> ValueMap;
- typedef std::set<std::string> NameSet;
- typedef std::set<const Type*> TypeSet;
- typedef std::set<const Value*> ValueSet;
- typedef std::map<const Value*,std::string> ForwardRefMap;
-
- /// CppWriter - This class is the main chunk of code that converts an LLVM
- /// module to a C++ translation unit.
- class CppWriter : public ModulePass {
- const char* progname;
- std::ostream &Out;
- const Module *TheModule;
- uint64_t uniqueNum;
- TypeMap TypeNames;
- ValueMap ValueNames;
- TypeMap UnresolvedTypes;
- TypeList TypeStack;
- NameSet UsedNames;
- TypeSet DefinedTypes;
- ValueSet DefinedValues;
- ForwardRefMap ForwardRefs;
- bool is_inline;
-
- public:
- static char ID;
- explicit CppWriter(std::ostream &o) :
- ModulePass((intptr_t)&ID), Out(o), uniqueNum(0), is_inline(false) {}
-
- virtual const char *getPassName() const { return "C++ backend"; }
-
- bool runOnModule(Module &M);
-
- void printProgram(const std::string& fname, const std::string& modName );
- void printModule(const std::string& fname, const std::string& modName );
- void printContents(const std::string& fname, const std::string& modName );
- void printFunction(const std::string& fname, const std::string& funcName );
- void printFunctions();
- void printInline(const std::string& fname, const std::string& funcName );
- void printVariable(const std::string& fname, const std::string& varName );
- void printType(const std::string& fname, const std::string& typeName );
-
- void error(const std::string& msg);
-
- private:
- void printLinkageType(GlobalValue::LinkageTypes LT);
- void printVisibilityType(GlobalValue::VisibilityTypes VisTypes);
- void printCallingConv(unsigned cc);
- void printEscapedString(const std::string& str);
- void printCFP(const ConstantFP* CFP);
-
- std::string getCppName(const Type* val);
- inline void printCppName(const Type* val);
-
- std::string getCppName(const Value* val);
- inline void printCppName(const Value* val);
-
- void printParamAttrs(const PAListPtr &PAL, const std::string &name);
- bool printTypeInternal(const Type* Ty);
- inline void printType(const Type* Ty);
- void printTypes(const Module* M);
-
- void printConstant(const Constant *CPV);
- void printConstants(const Module* M);
-
- void printVariableUses(const GlobalVariable *GV);
- void printVariableHead(const GlobalVariable *GV);
- void printVariableBody(const GlobalVariable *GV);
-
- void printFunctionUses(const Function *F);
- void printFunctionHead(const Function *F);
- void printFunctionBody(const Function *F);
- void printInstruction(const Instruction *I, const std::string& bbname);
- std::string getOpName(Value*);
-
- void printModuleBody();
- };
-
- static unsigned indent_level = 0;
- inline std::ostream& nl(std::ostream& Out, int delta = 0) {
- Out << "\n";
- if (delta >= 0 || indent_level >= unsigned(-delta))
- indent_level += delta;
- for (unsigned i = 0; i < indent_level; ++i)
- Out << " ";
- return Out;
- }
-
- inline void in() { indent_level++; }
- inline void out() { if (indent_level >0) indent_level--; }
-
- inline void
- sanitize(std::string& str) {
- for (size_t i = 0; i < str.length(); ++i)
- if (!isalnum(str[i]) && str[i] != '_')
- str[i] = '_';
- }
-
- inline std::string
- getTypePrefix(const Type* Ty ) {
- switch (Ty->getTypeID()) {
- case Type::VoidTyID: return "void_";
- case Type::IntegerTyID:
- return std::string("int") + utostr(cast<IntegerType>(Ty)->getBitWidth()) +
- "_";
- case Type::FloatTyID: return "float_";
- case Type::DoubleTyID: return "double_";
- case Type::LabelTyID: return "label_";
- case Type::FunctionTyID: return "func_";
- case Type::StructTyID: return "struct_";
- case Type::ArrayTyID: return "array_";
- case Type::PointerTyID: return "ptr_";
- case Type::VectorTyID: return "packed_";
- case Type::OpaqueTyID: return "opaque_";
- default: return "other_";
- }
- return "unknown_";
- }
-
- // Looks up the type in the symbol table and returns a pointer to its name or
- // a null pointer if it wasn't found. Note that this isn't the same as the
- // Mode::getTypeName function which will return an empty string, not a null
- // pointer if the name is not found.
- inline const std::string*
- findTypeName(const TypeSymbolTable& ST, const Type* Ty) {
- TypeSymbolTable::const_iterator TI = ST.begin();
- TypeSymbolTable::const_iterator TE = ST.end();
- for (;TI != TE; ++TI)
- if (TI->second == Ty)
- return &(TI->first);
- return 0;
- }
-
- void CppWriter::error(const std::string& msg) {
- std::cerr << progname << ": " << msg << "\n";
- exit(2);
- }
-
- // printCFP - Print a floating point constant .. very carefully :)
- // This makes sure that conversion to/from floating yields the same binary
- // result so that we don't lose precision.
- void CppWriter::printCFP(const ConstantFP *CFP) {
- APFloat APF = APFloat(CFP->getValueAPF()); // copy
- if (CFP->getType() == Type::FloatTy)
- APF.convert(APFloat::IEEEdouble, APFloat::rmNearestTiesToEven);
- Out << "ConstantFP::get(";
- if (CFP->getType() == Type::DoubleTy)
- Out << "Type::DoubleTy, ";
- else
- Out << "Type::FloatTy, ";
- Out << "APFloat(";
-#if HAVE_PRINTF_A
- char Buffer[100];
- sprintf(Buffer, "%A", APF.convertToDouble());
- if ((!strncmp(Buffer, "0x", 2) ||
- !strncmp(Buffer, "-0x", 3) ||
- !strncmp(Buffer, "+0x", 3)) &&
- APF.bitwiseIsEqual(APFloat(atof(Buffer)))) {
- if (CFP->getType() == Type::DoubleTy)
- Out << "BitsToDouble(" << Buffer << ")";
- else
- Out << "BitsToFloat((float)" << Buffer << ")";
- Out << ")";
- } else {
-#endif
- std::string StrVal = ftostr(CFP->getValueAPF());
-
- while (StrVal[0] == ' ')
- StrVal.erase(StrVal.begin());
-
- // Check to make sure that the stringized number is not some string like
- // "Inf" or NaN. Check that the string matches the "[-+]?[0-9]" regex.
- if (((StrVal[0] >= '0' && StrVal[0] <= '9') ||
- ((StrVal[0] == '-' || StrVal[0] == '+') &&
- (StrVal[1] >= '0' && StrVal[1] <= '9'))) &&
- (CFP->isExactlyValue(atof(StrVal.c_str())))) {
- if (CFP->getType() == Type::DoubleTy)
- Out << StrVal;
- else
- Out << StrVal << "f";
- } else if (CFP->getType() == Type::DoubleTy)
- Out << "BitsToDouble(0x" << std::hex
- << CFP->getValueAPF().convertToAPInt().getZExtValue()
- << std::dec << "ULL) /* " << StrVal << " */";
- else
- Out << "BitsToFloat(0x" << std::hex
- << (uint32_t)CFP->getValueAPF().convertToAPInt().getZExtValue()
- << std::dec << "U) /* " << StrVal << " */";
- Out << ")";
-#if HAVE_PRINTF_A
- }
-#endif
- Out << ")";
- }
-
- void CppWriter::printCallingConv(unsigned cc){
- // Print the calling convention.
- switch (cc) {
- case CallingConv::C: Out << "CallingConv::C"; break;
- case CallingConv::Fast: Out << "CallingConv::Fast"; break;
- case CallingConv::Cold: Out << "CallingConv::Cold"; break;
- case CallingConv::FirstTargetCC: Out << "CallingConv::FirstTargetCC"; break;
- default: Out << cc; break;
- }
- }
-
- void CppWriter::printLinkageType(GlobalValue::LinkageTypes LT) {
- switch (LT) {
- case GlobalValue::InternalLinkage:
- Out << "GlobalValue::InternalLinkage"; break;
- case GlobalValue::LinkOnceLinkage:
- Out << "GlobalValue::LinkOnceLinkage "; break;
- case GlobalValue::WeakLinkage:
- Out << "GlobalValue::WeakLinkage"; break;
- case GlobalValue::AppendingLinkage:
- Out << "GlobalValue::AppendingLinkage"; break;
- case GlobalValue::ExternalLinkage:
- Out << "GlobalValue::ExternalLinkage"; break;
- case GlobalValue::DLLImportLinkage:
- Out << "GlobalValue::DLLImportLinkage"; break;
- case GlobalValue::DLLExportLinkage:
- Out << "GlobalValue::DLLExportLinkage"; break;
- case GlobalValue::ExternalWeakLinkage:
- Out << "GlobalValue::ExternalWeakLinkage"; break;
- case GlobalValue::GhostLinkage:
- Out << "GlobalValue::GhostLinkage"; break;
- }
- }
-
- void CppWriter::printVisibilityType(GlobalValue::VisibilityTypes VisType) {
- switch (VisType) {
- default: assert(0 && "Unknown GVar visibility");
- case GlobalValue::DefaultVisibility:
- Out << "GlobalValue::DefaultVisibility";
- break;
- case GlobalValue::HiddenVisibility:
- Out << "GlobalValue::HiddenVisibility";
- break;
- case GlobalValue::ProtectedVisibility:
- Out << "GlobalValue::ProtectedVisibility";
- break;
- }
- }
-
- // printEscapedString - Print each character of the specified string, escaping
- // it if it is not printable or if it is an escape char.
- void CppWriter::printEscapedString(const std::string &Str) {
- for (unsigned i = 0, e = Str.size(); i != e; ++i) {
- unsigned char C = Str[i];
- if (isprint(C) && C != '"' && C != '\\') {
- Out << C;
- } else {
- Out << "\\x"
- << (char) ((C/16 < 10) ? ( C/16 +'0') : ( C/16 -10+'A'))
- << (char)(((C&15) < 10) ? ((C&15)+'0') : ((C&15)-10+'A'));
- }
- }
- }
-
- std::string CppWriter::getCppName(const Type* Ty) {
- // First, handle the primitive types .. easy
- if (Ty->isPrimitiveType() || Ty->isInteger()) {
- switch (Ty->getTypeID()) {
- case Type::VoidTyID: return "Type::VoidTy";
- case Type::IntegerTyID: {
- unsigned BitWidth = cast<IntegerType>(Ty)->getBitWidth();
- return "IntegerType::get(" + utostr(BitWidth) + ")";
- }
- case Type::FloatTyID: return "Type::FloatTy";
- case Type::DoubleTyID: return "Type::DoubleTy";
- case Type::LabelTyID: return "Type::LabelTy";
- default:
- error("Invalid primitive type");
- break;
- }
- return "Type::VoidTy"; // shouldn't be returned, but make it sensible
- }
-
- // Now, see if we've seen the type before and return that
- TypeMap::iterator I = TypeNames.find(Ty);
- if (I != TypeNames.end())
- return I->second;
-
- // Okay, let's build a new name for this type. Start with a prefix
- const char* prefix = 0;
- switch (Ty->getTypeID()) {
- case Type::FunctionTyID: prefix = "FuncTy_"; break;
- case Type::StructTyID: prefix = "StructTy_"; break;
- case Type::ArrayTyID: prefix = "ArrayTy_"; break;
- case Type::PointerTyID: prefix = "PointerTy_"; break;
- case Type::OpaqueTyID: prefix = "OpaqueTy_"; break;
- case Type::VectorTyID: prefix = "VectorTy_"; break;
- default: prefix = "OtherTy_"; break; // prevent breakage
- }
-
- // See if the type has a name in the symboltable and build accordingly
- const std::string* tName = findTypeName(TheModule->getTypeSymbolTable(), Ty);
- std::string name;
- if (tName)
- name = std::string(prefix) + *tName;
- else
- name = std::string(prefix) + utostr(uniqueNum++);
- sanitize(name);
-
- // Save the name
- return TypeNames[Ty] = name;
- }
-
- void CppWriter::printCppName(const Type* Ty) {
- printEscapedString(getCppName(Ty));
- }
-
- std::string CppWriter::getCppName(const Value* val) {
- std::string name;
- ValueMap::iterator I = ValueNames.find(val);
- if (I != ValueNames.end() && I->first == val)
- return I->second;
-
- if (const GlobalVariable* GV = dyn_cast<GlobalVariable>(val)) {
- name = std::string("gvar_") +
- getTypePrefix(GV->getType()->getElementType());
- } else if (isa<Function>(val)) {
- name = std::string("func_");
- } else if (const Constant* C = dyn_cast<Constant>(val)) {
- name = std::string("const_") + getTypePrefix(C->getType());
- } else if (const Argument* Arg = dyn_cast<Argument>(val)) {
- if (is_inline) {
- unsigned argNum = std::distance(Arg->getParent()->arg_begin(),
- Function::const_arg_iterator(Arg)) + 1;
- name = std::string("arg_") + utostr(argNum);
- NameSet::iterator NI = UsedNames.find(name);
- if (NI != UsedNames.end())
- name += std::string("_") + utostr(uniqueNum++);
- UsedNames.insert(name);
- return ValueNames[val] = name;
- } else {
- name = getTypePrefix(val->getType());
- }
- } else {
- name = getTypePrefix(val->getType());
- }
- name += (val->hasName() ? val->getName() : utostr(uniqueNum++));
- sanitize(name);
- NameSet::iterator NI = UsedNames.find(name);
- if (NI != UsedNames.end())
- name += std::string("_") + utostr(uniqueNum++);
- UsedNames.insert(name);
- return ValueNames[val] = name;
- }
-
- void CppWriter::printCppName(const Value* val) {
- printEscapedString(getCppName(val));
- }
-
- void CppWriter::printParamAttrs(const PAListPtr &PAL,
- const std::string &name) {
- Out << "PAListPtr " << name << "_PAL = 0;";
- nl(Out);
- if (!PAL.isEmpty()) {
- Out << '{'; in(); nl(Out);
- Out << "SmallVector<ParamAttrsWithIndex, 4> Attrs;"; nl(Out);
- Out << "ParamAttrsWithIndex PAWI;"; nl(Out);
- for (unsigned i = 0; i < PAL.getNumSlots(); ++i) {
- uint16_t index = PAL.getSlot(i).Index;
- ParameterAttributes attrs = PAL.getSlot(i).Attrs;
- Out << "PAWI.index = " << index << "; PAWI.attrs = 0 ";
- if (attrs & ParamAttr::SExt)
- Out << " | ParamAttr::SExt";
- if (attrs & ParamAttr::ZExt)
- Out << " | ParamAttr::ZExt";
- if (attrs & ParamAttr::StructRet)
- Out << " | ParamAttr::StructRet";
- if (attrs & ParamAttr::InReg)
- Out << " | ParamAttr::InReg";
- if (attrs & ParamAttr::NoReturn)
- Out << " | ParamAttr::NoReturn";
- if (attrs & ParamAttr::NoUnwind)
- Out << " | ParamAttr::NoUnwind";
- if (attrs & ParamAttr::ByVal)
- Out << " | ParamAttr::ByVal";
- if (attrs & ParamAttr::NoAlias)
- Out << " | ParamAttr::NoAlias";
- if (attrs & ParamAttr::Nest)
- Out << " | ParamAttr::Nest";
- if (attrs & ParamAttr::ReadNone)
- Out << " | ParamAttr::ReadNone";
- if (attrs & ParamAttr::ReadOnly)
- Out << " | ParamAttr::ReadOnly";
- Out << ";";
- nl(Out);
- Out << "Attrs.push_back(PAWI);";
- nl(Out);
- }
- Out << name << "_PAL = PAListPtr::get(Attrs.begin(), Attrs.end());";
- nl(Out);
- out(); nl(Out);
- Out << '}'; nl(Out);
- }
- }
-
- bool CppWriter::printTypeInternal(const Type* Ty) {
- // We don't print definitions for primitive types
- if (Ty->isPrimitiveType() || Ty->isInteger())
- return false;
-
- // If we already defined this type, we don't need to define it again.
- if (DefinedTypes.find(Ty) != DefinedTypes.end())
- return false;
-
- // Everything below needs the name for the type so get it now.
- std::string typeName(getCppName(Ty));
-
- // Search the type stack for recursion. If we find it, then generate this
- // as an OpaqueType, but make sure not to do this multiple times because
- // the type could appear in multiple places on the stack. Once the opaque
- // definition is issued, it must not be re-issued. Consequently we have to
- // check the UnresolvedTypes list as well.
- TypeList::const_iterator TI = std::find(TypeStack.begin(), TypeStack.end(),
- Ty);
- if (TI != TypeStack.end()) {
- TypeMap::const_iterator I = UnresolvedTypes.find(Ty);
- if (I == UnresolvedTypes.end()) {
- Out << "PATypeHolder " << typeName << "_fwd = OpaqueType::get();";
- nl(Out);
- UnresolvedTypes[Ty] = typeName;
- }
- return true;
- }
-
- // We're going to print a derived type which, by definition, contains other
- // types. So, push this one we're printing onto the type stack to assist with
- // recursive definitions.
- TypeStack.push_back(Ty);
-
- // Print the type definition
- switch (Ty->getTypeID()) {
- case Type::FunctionTyID: {
- const FunctionType* FT = cast<FunctionType>(Ty);
- Out << "std::vector<const Type*>" << typeName << "_args;";
- nl(Out);
- FunctionType::param_iterator PI = FT->param_begin();
- FunctionType::param_iterator PE = FT->param_end();
- for (; PI != PE; ++PI) {
- const Type* argTy = static_cast<const Type*>(*PI);
- bool isForward = printTypeInternal(argTy);
- std::string argName(getCppName(argTy));
- Out << typeName << "_args.push_back(" << argName;
- if (isForward)
- Out << "_fwd";
- Out << ");";
- nl(Out);
- }
- bool isForward = printTypeInternal(FT->getReturnType());
- std::string retTypeName(getCppName(FT->getReturnType()));
- Out << "FunctionType* " << typeName << " = FunctionType::get(";
- in(); nl(Out) << "/*Result=*/" << retTypeName;
- if (isForward)
- Out << "_fwd";
- Out << ",";
- nl(Out) << "/*Params=*/" << typeName << "_args,";
- nl(Out) << "/*isVarArg=*/" << (FT->isVarArg() ? "true" : "false") << ");";
- out();
- nl(Out);
- break;
- }
- case Type::StructTyID: {
- const StructType* ST = cast<StructType>(Ty);
- Out << "std::vector<const Type*>" << typeName << "_fields;";
- nl(Out);
- StructType::element_iterator EI = ST->element_begin();
- StructType::element_iterator EE = ST->element_end();
- for (; EI != EE; ++EI) {
- const Type* fieldTy = static_cast<const Type*>(*EI);
- bool isForward = printTypeInternal(fieldTy);
- std::string fieldName(getCppName(fieldTy));
- Out << typeName << "_fields.push_back(" << fieldName;
- if (isForward)
- Out << "_fwd";
- Out << ");";
- nl(Out);
- }
- Out << "StructType* " << typeName << " = StructType::get("
- << typeName << "_fields, /*isPacked=*/"
- << (ST->isPacked() ? "true" : "false") << ");";
- nl(Out);
- break;
- }
- case Type::ArrayTyID: {
- const ArrayType* AT = cast<ArrayType>(Ty);
- const Type* ET = AT->getElementType();
- bool isForward = printTypeInternal(ET);
- std::string elemName(getCppName(ET));
- Out << "ArrayType* " << typeName << " = ArrayType::get("
- << elemName << (isForward ? "_fwd" : "")
- << ", " << utostr(AT->getNumElements()) << ");";
- nl(Out);
- break;
- }
- case Type::PointerTyID: {
- const PointerType* PT = cast<PointerType>(Ty);
- const Type* ET = PT->getElementType();
- bool isForward = printTypeInternal(ET);
- std::string elemName(getCppName(ET));
- Out << "PointerType* " << typeName << " = PointerType::get("
- << elemName << (isForward ? "_fwd" : "")
- << ", " << utostr(PT->getAddressSpace()) << ");";
- nl(Out);
- break;
- }
- case Type::VectorTyID: {
- const VectorType* PT = cast<VectorType>(Ty);
- const Type* ET = PT->getElementType();
- bool isForward = printTypeInternal(ET);
- std::string elemName(getCppName(ET));
- Out << "VectorType* " << typeName << " = VectorType::get("
- << elemName << (isForward ? "_fwd" : "")
- << ", " << utostr(PT->getNumElements()) << ");";
- nl(Out);
- break;
- }
- case Type::OpaqueTyID: {
- Out << "OpaqueType* " << typeName << " = OpaqueType::get();";
- nl(Out);
- break;
- }
- default:
- error("Invalid TypeID");
- }
-
- // If the type had a name, make sure we recreate it.
- const std::string* progTypeName =
- findTypeName(TheModule->getTypeSymbolTable(),Ty);
- if (progTypeName) {
- Out << "mod->addTypeName(\"" << *progTypeName << "\", "
- << typeName << ");";
- nl(Out);
- }
-
- // Pop us off the type stack
- TypeStack.pop_back();
-
- // Indicate that this type is now defined.
- DefinedTypes.insert(Ty);
-
- // Early resolve as many unresolved types as possible. Search the unresolved
- // types map for the type we just printed. Now that its definition is complete
- // we can resolve any previous references to it. This prevents a cascade of
- // unresolved types.
- TypeMap::iterator I = UnresolvedTypes.find(Ty);
- if (I != UnresolvedTypes.end()) {
- Out << "cast<OpaqueType>(" << I->second
- << "_fwd.get())->refineAbstractTypeTo(" << I->second << ");";
- nl(Out);
- Out << I->second << " = cast<";
- switch (Ty->getTypeID()) {
- case Type::FunctionTyID: Out << "FunctionType"; break;
- case Type::ArrayTyID: Out << "ArrayType"; break;
- case Type::StructTyID: Out << "StructType"; break;
- case Type::VectorTyID: Out << "VectorType"; break;
- case Type::PointerTyID: Out << "PointerType"; break;
- case Type::OpaqueTyID: Out << "OpaqueType"; break;
- default: Out << "NoSuchDerivedType"; break;
- }
- Out << ">(" << I->second << "_fwd.get());";
- nl(Out); nl(Out);
- UnresolvedTypes.erase(I);
- }
-
- // Finally, separate the type definition from other with a newline.
- nl(Out);
-
- // We weren't a recursive type
- return false;
- }
-
- // Prints a type definition. Returns true if it could not resolve all the
- // types in the definition but had to use a forward reference.
- void CppWriter::printType(const Type* Ty) {
- assert(TypeStack.empty());
- TypeStack.clear();
- printTypeInternal(Ty);
- assert(TypeStack.empty());
- }
-
- void CppWriter::printTypes(const Module* M) {
- // Walk the symbol table and print out all its types
- const TypeSymbolTable& symtab = M->getTypeSymbolTable();
- for (TypeSymbolTable::const_iterator TI = symtab.begin(), TE = symtab.end();
- TI != TE; ++TI) {
-
- // For primitive types and types already defined, just add a name
- TypeMap::const_iterator TNI = TypeNames.find(TI->second);
- if (TI->second->isInteger() || TI->second->isPrimitiveType() ||
- TNI != TypeNames.end()) {
- Out << "mod->addTypeName(\"";
- printEscapedString(TI->first);
- Out << "\", " << getCppName(TI->second) << ");";
- nl(Out);
- // For everything else, define the type
- } else {
- printType(TI->second);
- }
- }
-
- // Add all of the global variables to the value table...
- for (Module::const_global_iterator I = TheModule->global_begin(),
- E = TheModule->global_end(); I != E; ++I) {
- if (I->hasInitializer())
- printType(I->getInitializer()->getType());
- printType(I->getType());
- }
-
- // Add all the functions to the table
- for (Module::const_iterator FI = TheModule->begin(), FE = TheModule->end();
- FI != FE; ++FI) {
- printType(FI->getReturnType());
- printType(FI->getFunctionType());
- // Add all the function arguments
- for (Function::const_arg_iterator AI = FI->arg_begin(),
- AE = FI->arg_end(); AI != AE; ++AI) {
- printType(AI->getType());
- }
-
- // Add all of the basic blocks and instructions
- for (Function::const_iterator BB = FI->begin(),
- E = FI->end(); BB != E; ++BB) {
- printType(BB->getType());
- for (BasicBlock::const_iterator I = BB->begin(), E = BB->end(); I!=E;
- ++I) {
- printType(I->getType());
- for (unsigned i = 0; i < I->getNumOperands(); ++i)
- printType(I->getOperand(i)->getType());
- }
- }
- }
- }
-
-
- // printConstant - Print out a constant pool entry...
- void CppWriter::printConstant(const Constant *CV) {
- // First, if the constant is actually a GlobalValue (variable or function)
- // or its already in the constant list then we've printed it already and we
- // can just return.
- if (isa<GlobalValue>(CV) || ValueNames.find(CV) != ValueNames.end())
- return;
-
- std::string constName(getCppName(CV));
- std::string typeName(getCppName(CV->getType()));
- if (CV->isNullValue()) {
- Out << "Constant* " << constName << " = Constant::getNullValue("
- << typeName << ");";
- nl(Out);
- return;
- }
- if (isa<GlobalValue>(CV)) {
- // Skip variables and functions, we emit them elsewhere
- return;
- }
- if (const ConstantInt *CI = dyn_cast<ConstantInt>(CV)) {
- Out << "ConstantInt* " << constName << " = ConstantInt::get(APInt("
- << cast<IntegerType>(CI->getType())->getBitWidth() << ", "
- << " \"" << CI->getValue().toStringSigned(10) << "\", 10));";
- } else if (isa<ConstantAggregateZero>(CV)) {
- Out << "ConstantAggregateZero* " << constName
- << " = ConstantAggregateZero::get(" << typeName << ");";
- } else if (isa<ConstantPointerNull>(CV)) {
- Out << "ConstantPointerNull* " << constName
- << " = ConstanPointerNull::get(" << typeName << ");";
- } else if (const ConstantFP *CFP = dyn_cast<ConstantFP>(CV)) {
- Out << "ConstantFP* " << constName << " = ";
- printCFP(CFP);
- Out << ";";
- } else if (const ConstantArray *CA = dyn_cast<ConstantArray>(CV)) {
- if (CA->isString() && CA->getType()->getElementType() == Type::Int8Ty) {
- Out << "Constant* " << constName << " = ConstantArray::get(\"";
- std::string tmp = CA->getAsString();
- bool nullTerminate = false;
- if (tmp[tmp.length()-1] == 0) {
- tmp.erase(tmp.length()-1);
- nullTerminate = true;
- }
- printEscapedString(tmp);
- // Determine if we want null termination or not.
- if (nullTerminate)
- Out << "\", true"; // Indicate that the null terminator should be
- // added.
- else
- Out << "\", false";// No null terminator
- Out << ");";
- } else {
- Out << "std::vector<Constant*> " << constName << "_elems;";
- nl(Out);
- unsigned N = CA->getNumOperands();
- for (unsigned i = 0; i < N; ++i) {
- printConstant(CA->getOperand(i)); // recurse to print operands
- Out << constName << "_elems.push_back("
- << getCppName(CA->getOperand(i)) << ");";
- nl(Out);
- }
- Out << "Constant* " << constName << " = ConstantArray::get("
- << typeName << ", " << constName << "_elems);";
- }
- } else if (const ConstantStruct *CS = dyn_cast<ConstantStruct>(CV)) {
- Out << "std::vector<Constant*> " << constName << "_fields;";
- nl(Out);
- unsigned N = CS->getNumOperands();
- for (unsigned i = 0; i < N; i++) {
- printConstant(CS->getOperand(i));
- Out << constName << "_fields.push_back("
- << getCppName(CS->getOperand(i)) << ");";
- nl(Out);
- }
- Out << "Constant* " << constName << " = ConstantStruct::get("
- << typeName << ", " << constName << "_fields);";
- } else if (const ConstantVector *CP = dyn_cast<ConstantVector>(CV)) {
- Out << "std::vector<Constant*> " << constName << "_elems;";
- nl(Out);
- unsigned N = CP->getNumOperands();
- for (unsigned i = 0; i < N; ++i) {
- printConstant(CP->getOperand(i));
- Out << constName << "_elems.push_back("
- << getCppName(CP->getOperand(i)) << ");";
- nl(Out);
- }
- Out << "Constant* " << constName << " = ConstantVector::get("
- << typeName << ", " << constName << "_elems);";
- } else if (isa<UndefValue>(CV)) {
- Out << "UndefValue* " << constName << " = UndefValue::get("
- << typeName << ");";
- } else if (const ConstantExpr *CE = dyn_cast<ConstantExpr>(CV)) {
- if (CE->getOpcode() == Instruction::GetElementPtr) {
- Out << "std::vector<Constant*> " << constName << "_indices;";
- nl(Out);
- printConstant(CE->getOperand(0));
- for (unsigned i = 1; i < CE->getNumOperands(); ++i ) {
- printConstant(CE->getOperand(i));
- Out << constName << "_indices.push_back("
- << getCppName(CE->getOperand(i)) << ");";
- nl(Out);
- }
- Out << "Constant* " << constName
- << " = ConstantExpr::getGetElementPtr("
- << getCppName(CE->getOperand(0)) << ", "
- << "&" << constName << "_indices[0], "
- << constName << "_indices.size()"
- << " );";
- } else if (CE->isCast()) {
- printConstant(CE->getOperand(0));
- Out << "Constant* " << constName << " = ConstantExpr::getCast(";
- switch (CE->getOpcode()) {
- default: assert(0 && "Invalid cast opcode");
- case Instruction::Trunc: Out << "Instruction::Trunc"; break;
- case Instruction::ZExt: Out << "Instruction::ZExt"; break;
- case Instruction::SExt: Out << "Instruction::SExt"; break;
- case Instruction::FPTrunc: Out << "Instruction::FPTrunc"; break;
- case Instruction::FPExt: Out << "Instruction::FPExt"; break;
- case Instruction::FPToUI: Out << "Instruction::FPToUI"; break;
- case Instruction::FPToSI: Out << "Instruction::FPToSI"; break;
- case Instruction::UIToFP: Out << "Instruction::UIToFP"; break;
- case Instruction::SIToFP: Out << "Instruction::SIToFP"; break;
- case Instruction::PtrToInt: Out << "Instruction::PtrToInt"; break;
- case Instruction::IntToPtr: Out << "Instruction::IntToPtr"; break;
- case Instruction::BitCast: Out << "Instruction::BitCast"; break;
- }
- Out << ", " << getCppName(CE->getOperand(0)) << ", "
- << getCppName(CE->getType()) << ");";
- } else {
- unsigned N = CE->getNumOperands();
- for (unsigned i = 0; i < N; ++i ) {
- printConstant(CE->getOperand(i));
- }
- Out << "Constant* " << constName << " = ConstantExpr::";
- switch (CE->getOpcode()) {
- case Instruction::Add: Out << "getAdd("; break;
- case Instruction::Sub: Out << "getSub("; break;
- case Instruction::Mul: Out << "getMul("; break;
- case Instruction::UDiv: Out << "getUDiv("; break;
- case Instruction::SDiv: Out << "getSDiv("; break;
- case Instruction::FDiv: Out << "getFDiv("; break;
- case Instruction::URem: Out << "getURem("; break;
- case Instruction::SRem: Out << "getSRem("; break;
- case Instruction::FRem: Out << "getFRem("; break;
- case Instruction::And: Out << "getAnd("; break;
- case Instruction::Or: Out << "getOr("; break;
- case Instruction::Xor: Out << "getXor("; break;
- case Instruction::ICmp:
- Out << "getICmp(ICmpInst::ICMP_";
- switch (CE->getPredicate()) {
- case ICmpInst::ICMP_EQ: Out << "EQ"; break;
- case ICmpInst::ICMP_NE: Out << "NE"; break;
- case ICmpInst::ICMP_SLT: Out << "SLT"; break;
- case ICmpInst::ICMP_ULT: Out << "ULT"; break;
- case ICmpInst::ICMP_SGT: Out << "SGT"; break;
- case ICmpInst::ICMP_UGT: Out << "UGT"; break;
- case ICmpInst::ICMP_SLE: Out << "SLE"; break;
- case ICmpInst::ICMP_ULE: Out << "ULE"; break;
- case ICmpInst::ICMP_SGE: Out << "SGE"; break;
- case ICmpInst::ICMP_UGE: Out << "UGE"; break;
- default: error("Invalid ICmp Predicate");
- }
- break;
- case Instruction::FCmp:
- Out << "getFCmp(FCmpInst::FCMP_";
- switch (CE->getPredicate()) {
- case FCmpInst::FCMP_FALSE: Out << "FALSE"; break;
- case FCmpInst::FCMP_ORD: Out << "ORD"; break;
- case FCmpInst::FCMP_UNO: Out << "UNO"; break;
- case FCmpInst::FCMP_OEQ: Out << "OEQ"; break;
- case FCmpInst::FCMP_UEQ: Out << "UEQ"; break;
- case FCmpInst::FCMP_ONE: Out << "ONE"; break;
- case FCmpInst::FCMP_UNE: Out << "UNE"; break;
- case FCmpInst::FCMP_OLT: Out << "OLT"; break;
- case FCmpInst::FCMP_ULT: Out << "ULT"; break;
- case FCmpInst::FCMP_OGT: Out << "OGT"; break;
- case FCmpInst::FCMP_UGT: Out << "UGT"; break;
- case FCmpInst::FCMP_OLE: Out << "OLE"; break;
- case FCmpInst::FCMP_ULE: Out << "ULE"; break;
- case FCmpInst::FCMP_OGE: Out << "OGE"; break;
- case FCmpInst::FCMP_UGE: Out << "UGE"; break;
- case FCmpInst::FCMP_TRUE: Out << "TRUE"; break;
- default: error("Invalid FCmp Predicate");
- }
- break;
- case Instruction::Shl: Out << "getShl("; break;
- case Instruction::LShr: Out << "getLShr("; break;
- case Instruction::AShr: Out << "getAShr("; break;
- case Instruction::Select: Out << "getSelect("; break;
- case Instruction::ExtractElement: Out << "getExtractElement("; break;
- case Instruction::InsertElement: Out << "getInsertElement("; break;
- case Instruction::ShuffleVector: Out << "getShuffleVector("; break;
- default:
- error("Invalid constant expression");
- break;
- }
- Out << getCppName(CE->getOperand(0));
- for (unsigned i = 1; i < CE->getNumOperands(); ++i)
- Out << ", " << getCppName(CE->getOperand(i));
- Out << ");";
- }
- } else {
- error("Bad Constant");
- Out << "Constant* " << constName << " = 0; ";
- }
- nl(Out);
- }
-
- void CppWriter::printConstants(const Module* M) {
- // Traverse all the global variables looking for constant initializers
- for (Module::const_global_iterator I = TheModule->global_begin(),
- E = TheModule->global_end(); I != E; ++I)
- if (I->hasInitializer())
- printConstant(I->getInitializer());
-
- // Traverse the LLVM functions looking for constants
- for (Module::const_iterator FI = TheModule->begin(), FE = TheModule->end();
- FI != FE; ++FI) {
- // Add all of the basic blocks and instructions
- for (Function::const_iterator BB = FI->begin(),
- E = FI->end(); BB != E; ++BB) {
- for (BasicBlock::const_iterator I = BB->begin(), E = BB->end(); I!=E;
- ++I) {
- for (unsigned i = 0; i < I->getNumOperands(); ++i) {
- if (Constant* C = dyn_cast<Constant>(I->getOperand(i))) {
- printConstant(C);
- }
- }
- }
- }
- }
- }
-
- void CppWriter::printVariableUses(const GlobalVariable *GV) {
- nl(Out) << "// Type Definitions";
- nl(Out);
- printType(GV->getType());
- if (GV->hasInitializer()) {
- Constant* Init = GV->getInitializer();
- printType(Init->getType());
- if (Function* F = dyn_cast<Function>(Init)) {
- nl(Out)<< "/ Function Declarations"; nl(Out);
- printFunctionHead(F);
- } else if (GlobalVariable* gv = dyn_cast<GlobalVariable>(Init)) {
- nl(Out) << "// Global Variable Declarations"; nl(Out);
- printVariableHead(gv);
- } else {
- nl(Out) << "// Constant Definitions"; nl(Out);
- printConstant(gv);
- }
- if (GlobalVariable* gv = dyn_cast<GlobalVariable>(Init)) {
- nl(Out) << "// Global Variable Definitions"; nl(Out);
- printVariableBody(gv);
- }
- }
- }
-
- void CppWriter::printVariableHead(const GlobalVariable *GV) {
- nl(Out) << "GlobalVariable* " << getCppName(GV);
- if (is_inline) {
- Out << " = mod->getGlobalVariable(";
- printEscapedString(GV->getName());
- Out << ", " << getCppName(GV->getType()->getElementType()) << ",true)";
- nl(Out) << "if (!" << getCppName(GV) << ") {";
- in(); nl(Out) << getCppName(GV);
- }
- Out << " = new GlobalVariable(";
- nl(Out) << "/*Type=*/";
- printCppName(GV->getType()->getElementType());
- Out << ",";
- nl(Out) << "/*isConstant=*/" << (GV->isConstant()?"true":"false");
- Out << ",";
- nl(Out) << "/*Linkage=*/";
- printLinkageType(GV->getLinkage());
- Out << ",";
- nl(Out) << "/*Initializer=*/0, ";
- if (GV->hasInitializer()) {
- Out << "// has initializer, specified below";
- }
- nl(Out) << "/*Name=*/\"";
- printEscapedString(GV->getName());
- Out << "\",";
- nl(Out) << "mod);";
- nl(Out);
-
- if (GV->hasSection()) {
- printCppName(GV);
- Out << "->setSection(\"";
- printEscapedString(GV->getSection());
- Out << "\");";
- nl(Out);
- }
- if (GV->getAlignment()) {
- printCppName(GV);
- Out << "->setAlignment(" << utostr(GV->getAlignment()) << ");";
- nl(Out);
- }
- if (GV->getVisibility() != GlobalValue::DefaultVisibility) {
- printCppName(GV);
- Out << "->setVisibility(";
- printVisibilityType(GV->getVisibility());
- Out << ");";
- nl(Out);
- }
- if (is_inline) {
- out(); Out << "}"; nl(Out);
- }
- }
-
- void CppWriter::printVariableBody(const GlobalVariable *GV) {
- if (GV->hasInitializer()) {
- printCppName(GV);
- Out << "->setInitializer(";
- Out << getCppName(GV->getInitializer()) << ");";
- nl(Out);
- }
- }
-
- std::string CppWriter::getOpName(Value* V) {
- if (!isa<Instruction>(V) || DefinedValues.find(V) != DefinedValues.end())
- return getCppName(V);
-
- // See if its alread in the map of forward references, if so just return the
- // name we already set up for it
- ForwardRefMap::const_iterator I = ForwardRefs.find(V);
- if (I != ForwardRefs.end())
- return I->second;
-
- // This is a new forward reference. Generate a unique name for it
- std::string result(std::string("fwdref_") + utostr(uniqueNum++));
-
- // Yes, this is a hack. An Argument is the smallest instantiable value that
- // we can make as a placeholder for the real value. We'll replace these
- // Argument instances later.
- Out << "Argument* " << result << " = new Argument("
- << getCppName(V->getType()) << ");";
- nl(Out);
- ForwardRefs[V] = result;
- return result;
- }
-
- // printInstruction - This member is called for each Instruction in a function.
- void CppWriter::printInstruction(const Instruction *I,
- const std::string& bbname) {
- std::string iName(getCppName(I));
-
- // Before we emit this instruction, we need to take care of generating any
- // forward references. So, we get the names of all the operands in advance
- std::string* opNames = new std::string[I->getNumOperands()];
- for (unsigned i = 0; i < I->getNumOperands(); i++) {
- opNames[i] = getOpName(I->getOperand(i));
- }
-
- switch (I->getOpcode()) {
- case Instruction::Ret: {
- const ReturnInst* ret = cast<ReturnInst>(I);
- Out << "ReturnInst::Create("
- << (ret->getReturnValue() ? opNames[0] + ", " : "") << bbname << ");";
- break;
- }
- case Instruction::Br: {
- const BranchInst* br = cast<BranchInst>(I);
- Out << "BranchInst::Create(" ;
- if (br->getNumOperands() == 3 ) {
- Out << opNames[0] << ", "
- << opNames[1] << ", "
- << opNames[2] << ", ";
-
- } else if (br->getNumOperands() == 1) {
- Out << opNames[0] << ", ";
- } else {
- error("Branch with 2 operands?");
- }
- Out << bbname << ");";
- break;
- }
- case Instruction::Switch: {
- const SwitchInst* sw = cast<SwitchInst>(I);
- Out << "SwitchInst* " << iName << " = SwitchInst::Create("
- << opNames[0] << ", "
- << opNames[1] << ", "
- << sw->getNumCases() << ", " << bbname << ");";
- nl(Out);
- for (unsigned i = 2; i < sw->getNumOperands(); i += 2 ) {
- Out << iName << "->addCase("
- << opNames[i] << ", "
- << opNames[i+1] << ");";
- nl(Out);
- }
- break;
- }
- case Instruction::Invoke: {
- const InvokeInst* inv = cast<InvokeInst>(I);
- Out << "std::vector<Value*> " << iName << "_params;";
- nl(Out);
- for (unsigned i = 3; i < inv->getNumOperands(); ++i) {
- Out << iName << "_params.push_back("
- << opNames[i] << ");";
- nl(Out);
- }
- Out << "InvokeInst *" << iName << " = InvokeInst::Create("
- << opNames[0] << ", "
- << opNames[1] << ", "
- << opNames[2] << ", "
- << iName << "_params.begin(), " << iName << "_params.end(), \"";
- printEscapedString(inv->getName());
- Out << "\", " << bbname << ");";
- nl(Out) << iName << "->setCallingConv(";
- printCallingConv(inv->getCallingConv());
- Out << ");";
- printParamAttrs(inv->getParamAttrs(), iName);
- Out << iName << "->setParamAttrs(" << iName << "_PAL);";
- nl(Out);
- break;
- }
- case Instruction::Unwind: {
- Out << "new UnwindInst("
- << bbname << ");";
- break;
- }
- case Instruction::Unreachable:{
- Out << "new UnreachableInst("
- << bbname << ");";
- break;
- }
- case Instruction::Add:
- case Instruction::Sub:
- case Instruction::Mul:
- case Instruction::UDiv:
- case Instruction::SDiv:
- case Instruction::FDiv:
- case Instruction::URem:
- case Instruction::SRem:
- case Instruction::FRem:
- case Instruction::And:
- case Instruction::Or:
- case Instruction::Xor:
- case Instruction::Shl:
- case Instruction::LShr:
- case Instruction::AShr:{
- Out << "BinaryOperator* " << iName << " = BinaryOperator::create(";
- switch (I->getOpcode()) {
- case Instruction::Add: Out << "Instruction::Add"; break;
- case Instruction::Sub: Out << "Instruction::Sub"; break;
- case Instruction::Mul: Out << "Instruction::Mul"; break;
- case Instruction::UDiv:Out << "Instruction::UDiv"; break;
- case Instruction::SDiv:Out << "Instruction::SDiv"; break;
- case Instruction::FDiv:Out << "Instruction::FDiv"; break;
- case Instruction::URem:Out << "Instruction::URem"; break;
- case Instruction::SRem:Out << "Instruction::SRem"; break;
- case Instruction::FRem:Out << "Instruction::FRem"; break;
- case Instruction::And: Out << "Instruction::And"; break;
- case Instruction::Or: Out << "Instruction::Or"; break;
- case Instruction::Xor: Out << "Instruction::Xor"; break;
- case Instruction::Shl: Out << "Instruction::Shl"; break;
- case Instruction::LShr:Out << "Instruction::LShr"; break;
- case Instruction::AShr:Out << "Instruction::AShr"; break;
- default: Out << "Instruction::BadOpCode"; break;
- }
- Out << ", " << opNames[0] << ", " << opNames[1] << ", \"";
- printEscapedString(I->getName());
- Out << "\", " << bbname << ");";
- break;
- }
- case Instruction::FCmp: {
- Out << "FCmpInst* " << iName << " = new FCmpInst(";
- switch (cast<FCmpInst>(I)->getPredicate()) {
- case FCmpInst::FCMP_FALSE: Out << "FCmpInst::FCMP_FALSE"; break;
- case FCmpInst::FCMP_OEQ : Out << "FCmpInst::FCMP_OEQ"; break;
- case FCmpInst::FCMP_OGT : Out << "FCmpInst::FCMP_OGT"; break;
- case FCmpInst::FCMP_OGE : Out << "FCmpInst::FCMP_OGE"; break;
- case FCmpInst::FCMP_OLT : Out << "FCmpInst::FCMP_OLT"; break;
- case FCmpInst::FCMP_OLE : Out << "FCmpInst::FCMP_OLE"; break;
- case FCmpInst::FCMP_ONE : Out << "FCmpInst::FCMP_ONE"; break;
- case FCmpInst::FCMP_ORD : Out << "FCmpInst::FCMP_ORD"; break;
- case FCmpInst::FCMP_UNO : Out << "FCmpInst::FCMP_UNO"; break;
- case FCmpInst::FCMP_UEQ : Out << "FCmpInst::FCMP_UEQ"; break;
- case FCmpInst::FCMP_UGT : Out << "FCmpInst::FCMP_UGT"; break;
- case FCmpInst::FCMP_UGE : Out << "FCmpInst::FCMP_UGE"; break;
- case FCmpInst::FCMP_ULT : Out << "FCmpInst::FCMP_ULT"; break;
- case FCmpInst::FCMP_ULE : Out << "FCmpInst::FCMP_ULE"; break;
- case FCmpInst::FCMP_UNE : Out << "FCmpInst::FCMP_UNE"; break;
- case FCmpInst::FCMP_TRUE : Out << "FCmpInst::FCMP_TRUE"; break;
- default: Out << "FCmpInst::BAD_ICMP_PREDICATE"; break;
- }
- Out << ", " << opNames[0] << ", " << opNames[1] << ", \"";
- printEscapedString(I->getName());
- Out << "\", " << bbname << ");";
- break;
- }
- case Instruction::ICmp: {
- Out << "ICmpInst* " << iName << " = new ICmpInst(";
- switch (cast<ICmpInst>(I)->getPredicate()) {
- case ICmpInst::ICMP_EQ: Out << "ICmpInst::ICMP_EQ"; break;
- case ICmpInst::ICMP_NE: Out << "ICmpInst::ICMP_NE"; break;
- case ICmpInst::ICMP_ULE: Out << "ICmpInst::ICMP_ULE"; break;
- case ICmpInst::ICMP_SLE: Out << "ICmpInst::ICMP_SLE"; break;
- case ICmpInst::ICMP_UGE: Out << "ICmpInst::ICMP_UGE"; break;
- case ICmpInst::ICMP_SGE: Out << "ICmpInst::ICMP_SGE"; break;
- case ICmpInst::ICMP_ULT: Out << "ICmpInst::ICMP_ULT"; break;
- case ICmpInst::ICMP_SLT: Out << "ICmpInst::ICMP_SLT"; break;
- case ICmpInst::ICMP_UGT: Out << "ICmpInst::ICMP_UGT"; break;
- case ICmpInst::ICMP_SGT: Out << "ICmpInst::ICMP_SGT"; break;
- default: Out << "ICmpInst::BAD_ICMP_PREDICATE"; break;
- }
- Out << ", " << opNames[0] << ", " << opNames[1] << ", \"";
- printEscapedString(I->getName());
- Out << "\", " << bbname << ");";
- break;
- }
- case Instruction::Malloc: {
- const MallocInst* mallocI = cast<MallocInst>(I);
- Out << "MallocInst* " << iName << " = new MallocInst("
- << getCppName(mallocI->getAllocatedType()) << ", ";
- if (mallocI->isArrayAllocation())
- Out << opNames[0] << ", " ;
- Out << "\"";
- printEscapedString(mallocI->getName());
- Out << "\", " << bbname << ");";
- if (mallocI->getAlignment())
- nl(Out) << iName << "->setAlignment("
- << mallocI->getAlignment() << ");";
- break;
- }
- case Instruction::Free: {
- Out << "FreeInst* " << iName << " = new FreeInst("
- << getCppName(I->getOperand(0)) << ", " << bbname << ");";
- break;
- }
- case Instruction::Alloca: {
- const AllocaInst* allocaI = cast<AllocaInst>(I);
- Out << "AllocaInst* " << iName << " = new AllocaInst("
- << getCppName(allocaI->getAllocatedType()) << ", ";
- if (allocaI->isArrayAllocation())
- Out << opNames[0] << ", ";
- Out << "\"";
- printEscapedString(allocaI->getName());
- Out << "\", " << bbname << ");";
- if (allocaI->getAlignment())
- nl(Out) << iName << "->setAlignment("
- << allocaI->getAlignment() << ");";
- break;
- }
- case Instruction::Load:{
- const LoadInst* load = cast<LoadInst>(I);
- Out << "LoadInst* " << iName << " = new LoadInst("
- << opNames[0] << ", \"";
- printEscapedString(load->getName());
- Out << "\", " << (load->isVolatile() ? "true" : "false" )
- << ", " << bbname << ");";
- break;
- }
- case Instruction::Store: {
- const StoreInst* store = cast<StoreInst>(I);
- Out << "StoreInst* " << iName << " = new StoreInst("
- << opNames[0] << ", "
- << opNames[1] << ", "
- << (store->isVolatile() ? "true" : "false")
- << ", " << bbname << ");";
- break;
- }
- case Instruction::GetElementPtr: {
- const GetElementPtrInst* gep = cast<GetElementPtrInst>(I);
- if (gep->getNumOperands() <= 2) {
- Out << "GetElementPtrInst* " << iName << " = GetElementPtrInst::Create("
- << opNames[0];
- if (gep->getNumOperands() == 2)
- Out << ", " << opNames[1];
- } else {
- Out << "std::vector<Value*> " << iName << "_indices;";
- nl(Out);
- for (unsigned i = 1; i < gep->getNumOperands(); ++i ) {
- Out << iName << "_indices.push_back("
- << opNames[i] << ");";
- nl(Out);
- }
- Out << "Instruction* " << iName << " = GetElementPtrInst::Create("
- << opNames[0] << ", " << iName << "_indices.begin(), "
- << iName << "_indices.end()";
- }
- Out << ", \"";
- printEscapedString(gep->getName());
- Out << "\", " << bbname << ");";
- break;
- }
- case Instruction::PHI: {
- const PHINode* phi = cast<PHINode>(I);
-
- Out << "PHINode* " << iName << " = PHINode::Create("
- << getCppName(phi->getType()) << ", \"";
- printEscapedString(phi->getName());
- Out << "\", " << bbname << ");";
- nl(Out) << iName << "->reserveOperandSpace("
- << phi->getNumIncomingValues()
- << ");";
- nl(Out);
- for (unsigned i = 0; i < phi->getNumOperands(); i+=2) {
- Out << iName << "->addIncoming("
- << opNames[i] << ", " << opNames[i+1] << ");";
- nl(Out);
- }
- break;
- }
- case Instruction::Trunc:
- case Instruction::ZExt:
- case Instruction::SExt:
- case Instruction::FPTrunc:
- case Instruction::FPExt:
- case Instruction::FPToUI:
- case Instruction::FPToSI:
- case Instruction::UIToFP:
- case Instruction::SIToFP:
- case Instruction::PtrToInt:
- case Instruction::IntToPtr:
- case Instruction::BitCast: {
- const CastInst* cst = cast<CastInst>(I);
- Out << "CastInst* " << iName << " = new ";
- switch (I->getOpcode()) {
- case Instruction::Trunc: Out << "TruncInst"; break;
- case Instruction::ZExt: Out << "ZExtInst"; break;
- case Instruction::SExt: Out << "SExtInst"; break;
- case Instruction::FPTrunc: Out << "FPTruncInst"; break;
- case Instruction::FPExt: Out << "FPExtInst"; break;
- case Instruction::FPToUI: Out << "FPToUIInst"; break;
- case Instruction::FPToSI: Out << "FPToSIInst"; break;
- case Instruction::UIToFP: Out << "UIToFPInst"; break;
- case Instruction::SIToFP: Out << "SIToFPInst"; break;
- case Instruction::PtrToInt: Out << "PtrToIntInst"; break;
- case Instruction::IntToPtr: Out << "IntToPtrInst"; break;
- case Instruction::BitCast: Out << "BitCastInst"; break;
- default: assert(!"Unreachable"); break;
- }
- Out << "(" << opNames[0] << ", "
- << getCppName(cst->getType()) << ", \"";
- printEscapedString(cst->getName());
- Out << "\", " << bbname << ");";
- break;
- }
- case Instruction::Call:{
- const CallInst* call = cast<CallInst>(I);
- if (InlineAsm* ila = dyn_cast<InlineAsm>(call->getOperand(0))) {
- Out << "InlineAsm* " << getCppName(ila) << " = InlineAsm::get("
- << getCppName(ila->getFunctionType()) << ", \""
- << ila->getAsmString() << "\", \""
- << ila->getConstraintString() << "\","
- << (ila->hasSideEffects() ? "true" : "false") << ");";
- nl(Out);
- }
- if (call->getNumOperands() > 2) {
- Out << "std::vector<Value*> " << iName << "_params;";
- nl(Out);
- for (unsigned i = 1; i < call->getNumOperands(); ++i) {
- Out << iName << "_params.push_back(" << opNames[i] << ");";
- nl(Out);
- }
- Out << "CallInst* " << iName << " = CallInst::Create("
- << opNames[0] << ", " << iName << "_params.begin(), "
- << iName << "_params.end(), \"";
- } else if (call->getNumOperands() == 2) {
- Out << "CallInst* " << iName << " = CallInst::Create("
- << opNames[0] << ", " << opNames[1] << ", \"";
- } else {
- Out << "CallInst* " << iName << " = CallInst::Create(" << opNames[0]
- << ", \"";
- }
- printEscapedString(call->getName());
- Out << "\", " << bbname << ");";
- nl(Out) << iName << "->setCallingConv(";
- printCallingConv(call->getCallingConv());
- Out << ");";
- nl(Out) << iName << "->setTailCall("
- << (call->isTailCall() ? "true":"false");
- Out << ");";
- printParamAttrs(call->getParamAttrs(), iName);
- Out << iName << "->setParamAttrs(" << iName << "_PAL);";
- nl(Out);
- break;
- }
- case Instruction::Select: {
- const SelectInst* sel = cast<SelectInst>(I);
- Out << "SelectInst* " << getCppName(sel) << " = SelectInst::Create(";
- Out << opNames[0] << ", " << opNames[1] << ", " << opNames[2] << ", \"";
- printEscapedString(sel->getName());
- Out << "\", " << bbname << ");";
- break;
- }
- case Instruction::UserOp1:
- /// FALL THROUGH
- case Instruction::UserOp2: {
- /// FIXME: What should be done here?
- break;
- }
- case Instruction::VAArg: {
- const VAArgInst* va = cast<VAArgInst>(I);
- Out << "VAArgInst* " << getCppName(va) << " = new VAArgInst("
- << opNames[0] << ", " << getCppName(va->getType()) << ", \"";
- printEscapedString(va->getName());
- Out << "\", " << bbname << ");";
- break;
- }
- case Instruction::ExtractElement: {
- const ExtractElementInst* eei = cast<ExtractElementInst>(I);
- Out << "ExtractElementInst* " << getCppName(eei)
- << " = new ExtractElementInst(" << opNames[0]
- << ", " << opNames[1] << ", \"";
- printEscapedString(eei->getName());
- Out << "\", " << bbname << ");";
- break;
- }
- case Instruction::InsertElement: {
- const InsertElementInst* iei = cast<InsertElementInst>(I);
- Out << "InsertElementInst* " << getCppName(iei)
- << " = InsertElementInst::Create(" << opNames[0]
- << ", " << opNames[1] << ", " << opNames[2] << ", \"";
- printEscapedString(iei->getName());
- Out << "\", " << bbname << ");";
- break;
- }
- case Instruction::ShuffleVector: {
- const ShuffleVectorInst* svi = cast<ShuffleVectorInst>(I);
- Out << "ShuffleVectorInst* " << getCppName(svi)
- << " = new ShuffleVectorInst(" << opNames[0]
- << ", " << opNames[1] << ", " << opNames[2] << ", \"";
- printEscapedString(svi->getName());
- Out << "\", " << bbname << ");";
- break;
- }
- }
- DefinedValues.insert(I);
- nl(Out);
- delete [] opNames;
-}
-
- // Print out the types, constants and declarations needed by one function
- void CppWriter::printFunctionUses(const Function* F) {
- nl(Out) << "// Type Definitions"; nl(Out);
- if (!is_inline) {
- // Print the function's return type
- printType(F->getReturnType());
-
- // Print the function's function type
- printType(F->getFunctionType());
-
- // Print the types of each of the function's arguments
- for (Function::const_arg_iterator AI = F->arg_begin(), AE = F->arg_end();
- AI != AE; ++AI) {
- printType(AI->getType());
- }
- }
-
- // Print type definitions for every type referenced by an instruction and
- // make a note of any global values or constants that are referenced
- SmallPtrSet<GlobalValue*,64> gvs;
- SmallPtrSet<Constant*,64> consts;
- for (Function::const_iterator BB = F->begin(), BE = F->end();
- BB != BE; ++BB){
- for (BasicBlock::const_iterator I = BB->begin(), E = BB->end();
- I != E; ++I) {
- // Print the type of the instruction itself
- printType(I->getType());
-
- // Print the type of each of the instruction's operands
- for (unsigned i = 0; i < I->getNumOperands(); ++i) {
- Value* operand = I->getOperand(i);
- printType(operand->getType());
-
- // If the operand references a GVal or Constant, make a note of it
- if (GlobalValue* GV = dyn_cast<GlobalValue>(operand)) {
- gvs.insert(GV);
- if (GlobalVariable *GVar = dyn_cast<GlobalVariable>(GV))
- if (GVar->hasInitializer())
- consts.insert(GVar->getInitializer());
- } else if (Constant* C = dyn_cast<Constant>(operand))
- consts.insert(C);
- }
- }
- }
-
- // Print the function declarations for any functions encountered
- nl(Out) << "// Function Declarations"; nl(Out);
- for (SmallPtrSet<GlobalValue*,64>::iterator I = gvs.begin(), E = gvs.end();
- I != E; ++I) {
- if (Function* Fun = dyn_cast<Function>(*I)) {
- if (!is_inline || Fun != F)
- printFunctionHead(Fun);
- }
- }
-
- // Print the global variable declarations for any variables encountered
- nl(Out) << "// Global Variable Declarations"; nl(Out);
- for (SmallPtrSet<GlobalValue*,64>::iterator I = gvs.begin(), E = gvs.end();
- I != E; ++I) {
- if (GlobalVariable* F = dyn_cast<GlobalVariable>(*I))
- printVariableHead(F);
- }
-
- // Print the constants found
- nl(Out) << "// Constant Definitions"; nl(Out);
- for (SmallPtrSet<Constant*,64>::iterator I = consts.begin(),
- E = consts.end(); I != E; ++I) {
- printConstant(*I);
- }
-
- // Process the global variables definitions now that all the constants have
- // been emitted. These definitions just couple the gvars with their constant
- // initializers.
- nl(Out) << "// Global Variable Definitions"; nl(Out);
- for (SmallPtrSet<GlobalValue*,64>::iterator I = gvs.begin(), E = gvs.end();
- I != E; ++I) {
- if (GlobalVariable* GV = dyn_cast<GlobalVariable>(*I))
- printVariableBody(GV);
- }
- }
-
- void CppWriter::printFunctionHead(const Function* F) {
- nl(Out) << "Function* " << getCppName(F);
- if (is_inline) {
- Out << " = mod->getFunction(\"";
- printEscapedString(F->getName());
- Out << "\", " << getCppName(F->getFunctionType()) << ");";
- nl(Out) << "if (!" << getCppName(F) << ") {";
- nl(Out) << getCppName(F);
- }
- Out<< " = Function::Create(";
- nl(Out,1) << "/*Type=*/" << getCppName(F->getFunctionType()) << ",";
- nl(Out) << "/*Linkage=*/";
- printLinkageType(F->getLinkage());
- Out << ",";
- nl(Out) << "/*Name=*/\"";
- printEscapedString(F->getName());
- Out << "\", mod); " << (F->isDeclaration()? "// (external, no body)" : "");
- nl(Out,-1);
- printCppName(F);
- Out << "->setCallingConv(";
- printCallingConv(F->getCallingConv());
- Out << ");";
- nl(Out);
- if (F->hasSection()) {
- printCppName(F);
- Out << "->setSection(\"" << F->getSection() << "\");";
- nl(Out);
- }
- if (F->getAlignment()) {
- printCppName(F);
- Out << "->setAlignment(" << F->getAlignment() << ");";
- nl(Out);
- }
- if (F->getVisibility() != GlobalValue::DefaultVisibility) {
- printCppName(F);
- Out << "->setVisibility(";
- printVisibilityType(F->getVisibility());
- Out << ");";
- nl(Out);
- }
- if (F->hasCollector()) {
- printCppName(F);
- Out << "->setCollector(\"" << F->getCollector() << "\");";
- nl(Out);
- }
- if (is_inline) {
- Out << "}";
- nl(Out);
- }
- printParamAttrs(F->getParamAttrs(), getCppName(F));
- printCppName(F);
- Out << "->setParamAttrs(" << getCppName(F) << "_PAL);";
- nl(Out);
- }
-
- void CppWriter::printFunctionBody(const Function *F) {
- if (F->isDeclaration())
- return; // external functions have no bodies.
-
- // Clear the DefinedValues and ForwardRefs maps because we can't have
- // cross-function forward refs
- ForwardRefs.clear();
- DefinedValues.clear();
-
- // Create all the argument values
- if (!is_inline) {
- if (!F->arg_empty()) {
- Out << "Function::arg_iterator args = " << getCppName(F)
- << "->arg_begin();";
- nl(Out);
- }
- for (Function::const_arg_iterator AI = F->arg_begin(), AE = F->arg_end();
- AI != AE; ++AI) {
- Out << "Value* " << getCppName(AI) << " = args++;";
- nl(Out);
- if (AI->hasName()) {
- Out << getCppName(AI) << "->setName(\"" << AI->getName() << "\");";
- nl(Out);
- }
- }
- }
-
- // Create all the basic blocks
- nl(Out);
- for (Function::const_iterator BI = F->begin(), BE = F->end();
- BI != BE; ++BI) {
- std::string bbname(getCppName(BI));
- Out << "BasicBlock* " << bbname << " = BasicBlock::Create(\"";
- if (BI->hasName())
- printEscapedString(BI->getName());
- Out << "\"," << getCppName(BI->getParent()) << ",0);";
- nl(Out);
- }
-
- // Output all of its basic blocks... for the function
- for (Function::const_iterator BI = F->begin(), BE = F->end();
- BI != BE; ++BI) {
- std::string bbname(getCppName(BI));
- nl(Out) << "// Block " << BI->getName() << " (" << bbname << ")";
- nl(Out);
-
- // Output all of the instructions in the basic block...
- for (BasicBlock::const_iterator I = BI->begin(), E = BI->end();
- I != E; ++I) {
- printInstruction(I,bbname);
- }
- }
-
- // Loop over the ForwardRefs and resolve them now that all instructions
- // are generated.
- if (!ForwardRefs.empty()) {
- nl(Out) << "// Resolve Forward References";
- nl(Out);
- }
-
- while (!ForwardRefs.empty()) {
- ForwardRefMap::iterator I = ForwardRefs.begin();
- Out << I->second << "->replaceAllUsesWith("
- << getCppName(I->first) << "); delete " << I->second << ";";
- nl(Out);
- ForwardRefs.erase(I);
- }
- }
-
- void CppWriter::printInline(const std::string& fname,
- const std::string& func) {
- const Function* F = TheModule->getFunction(func);
- if (!F) {
- error(std::string("Function '") + func + "' not found in input module");
- return;
- }
- if (F->isDeclaration()) {
- error(std::string("Function '") + func + "' is external!");
- return;
- }
- nl(Out) << "BasicBlock* " << fname << "(Module* mod, Function *"
- << getCppName(F);
- unsigned arg_count = 1;
- for (Function::const_arg_iterator AI = F->arg_begin(), AE = F->arg_end();
- AI != AE; ++AI) {
- Out << ", Value* arg_" << arg_count;
- }
- Out << ") {";
- nl(Out);
- is_inline = true;
- printFunctionUses(F);
- printFunctionBody(F);
- is_inline = false;
- Out << "return " << getCppName(F->begin()) << ";";
- nl(Out) << "}";
- nl(Out);
- }
-
- void CppWriter::printModuleBody() {
- // Print out all the type definitions
- nl(Out) << "// Type Definitions"; nl(Out);
- printTypes(TheModule);
-
- // Functions can call each other and global variables can reference them so
- // define all the functions first before emitting their function bodies.
- nl(Out) << "// Function Declarations"; nl(Out);
- for (Module::const_iterator I = TheModule->begin(), E = TheModule->end();
- I != E; ++I)
- printFunctionHead(I);
-
- // Process the global variables declarations. We can't initialze them until
- // after the constants are printed so just print a header for each global
- nl(Out) << "// Global Variable Declarations\n"; nl(Out);
- for (Module::const_global_iterator I = TheModule->global_begin(),
- E = TheModule->global_end(); I != E; ++I) {
- printVariableHead(I);
- }
-
- // Print out all the constants definitions. Constants don't recurse except
- // through GlobalValues. All GlobalValues have been declared at this point
- // so we can proceed to generate the constants.
- nl(Out) << "// Constant Definitions"; nl(Out);
- printConstants(TheModule);
-
- // Process the global variables definitions now that all the constants have
- // been emitted. These definitions just couple the gvars with their constant
- // initializers.
- nl(Out) << "// Global Variable Definitions"; nl(Out);
- for (Module::const_global_iterator I = TheModule->global_begin(),
- E = TheModule->global_end(); I != E; ++I) {
- printVariableBody(I);
- }
-
- // Finally, we can safely put out all of the function bodies.
- nl(Out) << "// Function Definitions"; nl(Out);
- for (Module::const_iterator I = TheModule->begin(), E = TheModule->end();
- I != E; ++I) {
- if (!I->isDeclaration()) {
- nl(Out) << "// Function: " << I->getName() << " (" << getCppName(I)
- << ")";
- nl(Out) << "{";
- nl(Out,1);
- printFunctionBody(I);
- nl(Out,-1) << "}";
- nl(Out);
- }
- }
- }
-
- void CppWriter::printProgram(const std::string& fname,
- const std::string& mName) {
- Out << "#include <llvm/Module.h>\n";
- Out << "#include <llvm/DerivedTypes.h>\n";
- Out << "#include <llvm/Constants.h>\n";
- Out << "#include <llvm/GlobalVariable.h>\n";
- Out << "#include <llvm/Function.h>\n";
- Out << "#include <llvm/CallingConv.h>\n";
- Out << "#include <llvm/BasicBlock.h>\n";
- Out << "#include <llvm/Instructions.h>\n";
- Out << "#include <llvm/InlineAsm.h>\n";
- Out << "#include <llvm/Support/MathExtras.h>\n";
- Out << "#include <llvm/Pass.h>\n";
- Out << "#include <llvm/PassManager.h>\n";
- Out << "#include <llvm/Analysis/Verifier.h>\n";
- Out << "#include <llvm/Assembly/PrintModulePass.h>\n";
- Out << "#include <algorithm>\n";
- Out << "#include <iostream>\n\n";
- Out << "using namespace llvm;\n\n";
- Out << "Module* " << fname << "();\n\n";
- Out << "int main(int argc, char**argv) {\n";
- Out << " Module* Mod = " << fname << "();\n";
- Out << " verifyModule(*Mod, PrintMessageAction);\n";
- Out << " std::cerr.flush();\n";
- Out << " std::cout.flush();\n";
- Out << " PassManager PM;\n";
- Out << " PM.add(new PrintModulePass(&llvm::cout));\n";
- Out << " PM.run(*Mod);\n";
- Out << " return 0;\n";
- Out << "}\n\n";
- printModule(fname,mName);
- }
-
- void CppWriter::printModule(const std::string& fname,
- const std::string& mName) {
- nl(Out) << "Module* " << fname << "() {";
- nl(Out,1) << "// Module Construction";
- nl(Out) << "Module* mod = new Module(\"" << mName << "\");";
- if (!TheModule->getTargetTriple().empty()) {
- nl(Out) << "mod->setDataLayout(\"" << TheModule->getDataLayout() << "\");";
- }
- if (!TheModule->getTargetTriple().empty()) {
- nl(Out) << "mod->setTargetTriple(\"" << TheModule->getTargetTriple()
- << "\");";
- }
-
- if (!TheModule->getModuleInlineAsm().empty()) {
- nl(Out) << "mod->setModuleInlineAsm(\"";
- printEscapedString(TheModule->getModuleInlineAsm());
- Out << "\");";
- }
- nl(Out);
-
- // Loop over the dependent libraries and emit them.
- Module::lib_iterator LI = TheModule->lib_begin();
- Module::lib_iterator LE = TheModule->lib_end();
- while (LI != LE) {
- Out << "mod->addLibrary(\"" << *LI << "\");";
- nl(Out);
- ++LI;
- }
- printModuleBody();
- nl(Out) << "return mod;";
- nl(Out,-1) << "}";
- nl(Out);
- }
-
- void CppWriter::printContents(const std::string& fname,
- const std::string& mName) {
- Out << "\nModule* " << fname << "(Module *mod) {\n";
- Out << "\nmod->setModuleIdentifier(\"" << mName << "\");\n";
- printModuleBody();
- Out << "\nreturn mod;\n";
- Out << "\n}\n";
- }
-
- void CppWriter::printFunction(const std::string& fname,
- const std::string& funcName) {
- const Function* F = TheModule->getFunction(funcName);
- if (!F) {
- error(std::string("Function '") + funcName + "' not found in input module");
- return;
- }
- Out << "\nFunction* " << fname << "(Module *mod) {\n";
- printFunctionUses(F);
- printFunctionHead(F);
- printFunctionBody(F);
- Out << "return " << getCppName(F) << ";\n";
- Out << "}\n";
- }
-
- void CppWriter::printFunctions() {
- const Module::FunctionListType &funcs = TheModule->getFunctionList();
- Module::const_iterator I = funcs.begin();
- Module::const_iterator IE = funcs.end();
-
- for (; I != IE; ++I) {
- const Function &func = *I;
- if (!func.isDeclaration()) {
- std::string name("define_");
- name += func.getName();
- printFunction(name, func.getName());
- }
- }
- }
-
- void CppWriter::printVariable(const std::string& fname,
- const std::string& varName) {
- const GlobalVariable* GV = TheModule->getNamedGlobal(varName);
-
- if (!GV) {
- error(std::string("Variable '") + varName + "' not found in input module");
- return;
- }
- Out << "\nGlobalVariable* " << fname << "(Module *mod) {\n";
- printVariableUses(GV);
- printVariableHead(GV);
- printVariableBody(GV);
- Out << "return " << getCppName(GV) << ";\n";
- Out << "}\n";
- }
-
- void CppWriter::printType(const std::string& fname,
- const std::string& typeName) {
- const Type* Ty = TheModule->getTypeByName(typeName);
- if (!Ty) {
- error(std::string("Type '") + typeName + "' not found in input module");
- return;
- }
- Out << "\nType* " << fname << "(Module *mod) {\n";
- printType(Ty);
- Out << "return " << getCppName(Ty) << ";\n";
- Out << "}\n";
- }
-
- bool CppWriter::runOnModule(Module &M) {
- TheModule = &M;
-
- // Emit a header
- Out << "// Generated by llvm2cpp - DO NOT MODIFY!\n\n";
-
- // Get the name of the function we're supposed to generate
- std::string fname = FuncName.getValue();
-
- // Get the name of the thing we are to generate
- std::string tgtname = NameToGenerate.getValue();
- if (GenerationType == GenModule ||
- GenerationType == GenContents ||
- GenerationType == GenProgram ||
- GenerationType == GenFunctions) {
- if (tgtname == "!bad!") {
- if (M.getModuleIdentifier() == "-")
- tgtname = "<stdin>";
- else
- tgtname = M.getModuleIdentifier();
- }
- } else if (tgtname == "!bad!")
- error("You must use the -for option with -gen-{function,variable,type}");
-
- switch (WhatToGenerate(GenerationType)) {
- case GenProgram:
- if (fname.empty())
- fname = "makeLLVMModule";
- printProgram(fname,tgtname);
- break;
- case GenModule:
- if (fname.empty())
- fname = "makeLLVMModule";
- printModule(fname,tgtname);
- break;
- case GenContents:
- if (fname.empty())
- fname = "makeLLVMModuleContents";
- printContents(fname,tgtname);
- break;
- case GenFunction:
- if (fname.empty())
- fname = "makeLLVMFunction";
- printFunction(fname,tgtname);
- break;
- case GenFunctions:
- printFunctions();
- break;
- case GenInline:
- if (fname.empty())
- fname = "makeLLVMInline";
- printInline(fname,tgtname);
- break;
- case GenVariable:
- if (fname.empty())
- fname = "makeLLVMVariable";
- printVariable(fname,tgtname);
- break;
- case GenType:
- if (fname.empty())
- fname = "makeLLVMType";
- printType(fname,tgtname);
- break;
- default:
- error("Invalid generation option");
- }
-
- return false;
- }
-}
-
-char CppWriter::ID = 0;
-
-//===----------------------------------------------------------------------===//
-// External Interface declaration
-//===----------------------------------------------------------------------===//
-
-bool CPPTargetMachine::addPassesToEmitWholeFile(PassManager &PM,
- std::ostream &o,
- CodeGenFileType FileType,
- bool Fast) {
- if (FileType != TargetMachine::AssemblyFile) return true;
- PM.add(new CppWriter(o));
- return false;
-}
diff --git a/release_23/lib/Target/CppBackend/CPPTargetMachine.h b/release_23/lib/Target/CppBackend/CPPTargetMachine.h
deleted file mode 100644
index 4170cdf4e4ff..000000000000
--- a/release_23/lib/Target/CppBackend/CPPTargetMachine.h
+++ /dev/null
@@ -1,41 +0,0 @@
-//===-- CPPTargetMachine.h - TargetMachine for the C++ backend --*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file declares the TargetMachine that is used by the C++ backend.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef CPPTARGETMACHINE_H
-#define CPPTARGETMACHINE_H
-
-#include "llvm/Target/TargetMachine.h"
-#include "llvm/Target/TargetData.h"
-
-namespace llvm {
-
-struct CPPTargetMachine : public TargetMachine {
- const TargetData DataLayout; // Calculates type size & alignment
-
- CPPTargetMachine(const Module &M, const std::string &FS)
- : DataLayout(&M) {}
-
- virtual bool WantsWholeFile() const { return true; }
- virtual bool addPassesToEmitWholeFile(PassManager &PM, std::ostream &Out,
- CodeGenFileType FileType, bool Fast);
-
- // This class always works, but shouldn't be the default in most cases.
- static unsigned getModuleMatchQuality(const Module &M) { return 1; }
-
- virtual const TargetData *getTargetData() const { return &DataLayout; }
-};
-
-} // End llvm namespace
-
-
-#endif
diff --git a/release_23/lib/Target/CppBackend/Makefile b/release_23/lib/Target/CppBackend/Makefile
deleted file mode 100644
index e607c636e9ae..000000000000
--- a/release_23/lib/Target/CppBackend/Makefile
+++ /dev/null
@@ -1,14 +0,0 @@
-##===- lib/Target/CppBackend/Makefile --- ------------------*- Makefile -*-===##
-#
-# The LLVM Compiler Infrastructure
-#
-# This file is distributed under the University of Illinois Open Source
-# License. See LICENSE.TXT for details.
-#
-##===----------------------------------------------------------------------===##
-
-LEVEL = ../../..
-LIBRARYNAME = LLVMCppBackend
-include $(LEVEL)/Makefile.common
-
-CompileCommonOpts += -Wno-format
diff --git a/release_23/lib/Target/IA64/IA64.h b/release_23/lib/Target/IA64/IA64.h
deleted file mode 100644
index b65af7714f2c..000000000000
--- a/release_23/lib/Target/IA64/IA64.h
+++ /dev/null
@@ -1,54 +0,0 @@
-//===-- IA64.h - Top-level interface for IA64 representation ------*- C++ -*-===//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains the entry points for global functions defined in the IA64
-// target library, as used by the LLVM JIT.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef TARGET_IA64_H
-#define TARGET_IA64_H
-
-#include <iosfwd>
-
-namespace llvm {
-
-class IA64TargetMachine;
-class FunctionPass;
-
-/// createIA64DAGToDAGInstructionSelector - This pass converts an LLVM
-/// function into IA64 machine code in a sane, DAG->DAG transform.
-///
-FunctionPass *createIA64DAGToDAGInstructionSelector(IA64TargetMachine &TM);
-
-/// createIA64BundlingPass - This pass adds stop bits and bundles
-/// instructions.
-///
-FunctionPass *createIA64BundlingPass(IA64TargetMachine &TM);
-
-/// createIA64CodePrinterPass - Returns a pass that prints the IA64
-/// assembly code for a MachineFunction to the given output stream,
-/// using the given target machine description. This should work
-/// regardless of whether the function is in SSA form.
-///
-FunctionPass *createIA64CodePrinterPass(std::ostream &o, IA64TargetMachine &tm);
-
-} // End llvm namespace
-
-// Defines symbolic names for IA64 registers. This defines a mapping from
-// register name to register number.
-//
-#include "IA64GenRegisterNames.inc"
-
-// Defines symbolic names for the IA64 instructions.
-//
-#include "IA64GenInstrNames.inc"
-
-#endif
-
-
diff --git a/release_23/lib/Target/IA64/IA64.td b/release_23/lib/Target/IA64/IA64.td
deleted file mode 100644
index 0cef72e5c45e..000000000000
--- a/release_23/lib/Target/IA64/IA64.td
+++ /dev/null
@@ -1,39 +0,0 @@
-//===-- IA64.td - Target definition file for Intel IA64 -------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This is a target description file for the Intel IA64 architecture,
-// also known variously as ia64, IA-64, IPF, "the Itanium architecture" etc.
-//
-//===----------------------------------------------------------------------===//
-
-// Get the target-independent interfaces which we are implementing...
-//
-include "../Target.td"
-
-//===----------------------------------------------------------------------===//
-// Register File Description
-//===----------------------------------------------------------------------===//
-
-include "IA64RegisterInfo.td"
-
-//===----------------------------------------------------------------------===//
-// Instruction Descriptions
-//===----------------------------------------------------------------------===//
-
-include "IA64InstrInfo.td"
-
-def IA64InstrInfo : InstrInfo { }
-
-def IA64 : Target {
- // Our instruction set
- let InstructionSet = IA64InstrInfo;
-
-}
-
-
diff --git a/release_23/lib/Target/IA64/IA64AsmPrinter.cpp b/release_23/lib/Target/IA64/IA64AsmPrinter.cpp
deleted file mode 100644
index 829730da2410..000000000000
--- a/release_23/lib/Target/IA64/IA64AsmPrinter.cpp
+++ /dev/null
@@ -1,358 +0,0 @@
-//===-- IA64AsmPrinter.cpp - Print out IA64 LLVM as assembly --------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains a printer that converts from our internal representation
-// of machine-dependent LLVM code to assembly accepted by the GNU binutils 'gas'
-// assembler. The Intel 'ias' and HP-UX 'as' assemblers *may* choke on this
-// output, but if so that's a bug I'd like to hear about: please file a bug
-// report in bugzilla. FYI, the not too bad 'ias' assembler is bundled with
-// the Intel C/C++ compiler for Itanium Linux.
-//
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "asm-printer"
-#include "IA64.h"
-#include "IA64TargetMachine.h"
-#include "llvm/Module.h"
-#include "llvm/Type.h"
-#include "llvm/CodeGen/AsmPrinter.h"
-#include "llvm/CodeGen/MachineFunctionPass.h"
-#include "llvm/Target/TargetAsmInfo.h"
-#include "llvm/Target/TargetMachine.h"
-#include "llvm/Support/Mangler.h"
-#include "llvm/ADT/Statistic.h"
-using namespace llvm;
-
-STATISTIC(EmittedInsts, "Number of machine instrs printed");
-
-namespace {
- struct IA64AsmPrinter : public AsmPrinter {
- std::set<std::string> ExternalFunctionNames, ExternalObjectNames;
-
- IA64AsmPrinter(std::ostream &O, TargetMachine &TM, const TargetAsmInfo *T)
- : AsmPrinter(O, TM, T) {
- }
-
- virtual const char *getPassName() const {
- return "IA64 Assembly Printer";
- }
-
- /// printInstruction - This method is automatically generated by tablegen
- /// from the instruction set description. This method returns true if the
- /// machine instruction was sufficiently described to print it, otherwise it
- /// returns false.
- bool printInstruction(const MachineInstr *MI);
-
- // This method is used by the tablegen'erated instruction printer.
- void printOperand(const MachineInstr *MI, unsigned OpNo){
- const MachineOperand &MO = MI->getOperand(OpNo);
- if (MO.getType() == MachineOperand::MO_Register) {
- assert(TargetRegisterInfo::isPhysicalRegister(MO.getReg()) &&
- "Not physref??");
- //XXX Bug Workaround: See note in Printer::doInitialization about %.
- O << TM.getRegisterInfo()->get(MO.getReg()).AsmName;
- } else {
- printOp(MO);
- }
- }
-
- void printS8ImmOperand(const MachineInstr *MI, unsigned OpNo) {
- int val=(unsigned int)MI->getOperand(OpNo).getImm();
- if(val>=128) val=val-256; // if negative, flip sign
- O << val;
- }
- void printS14ImmOperand(const MachineInstr *MI, unsigned OpNo) {
- int val=(unsigned int)MI->getOperand(OpNo).getImm();
- if(val>=8192) val=val-16384; // if negative, flip sign
- O << val;
- }
- void printS22ImmOperand(const MachineInstr *MI, unsigned OpNo) {
- int val=(unsigned int)MI->getOperand(OpNo).getImm();
- if(val>=2097152) val=val-4194304; // if negative, flip sign
- O << val;
- }
- void printU64ImmOperand(const MachineInstr *MI, unsigned OpNo) {
- O << (uint64_t)MI->getOperand(OpNo).getImm();
- }
- void printS64ImmOperand(const MachineInstr *MI, unsigned OpNo) {
-// XXX : nasty hack to avoid GPREL22 "relocation truncated to fit" linker
-// errors - instead of add rX = @gprel(CPI<whatever>), r1;; we now
-// emit movl rX = @gprel(CPI<whatever);;
-// add rX = rX, r1;
-// this gives us 64 bits instead of 22 (for the add long imm) to play
-// with, which shuts up the linker. The problem is that the constant
-// pool entries aren't immediates at this stage, so we check here.
-// If it's an immediate, print it the old fashioned way. If it's
-// not, we print it as a constant pool index.
- if(MI->getOperand(OpNo).isImmediate()) {
- O << (int64_t)MI->getOperand(OpNo).getImm();
- } else { // this is a constant pool reference: FIXME: assert this
- printOp(MI->getOperand(OpNo));
- }
- }
-
- void printGlobalOperand(const MachineInstr *MI, unsigned OpNo) {
- printOp(MI->getOperand(OpNo), false); // this is NOT a br.call instruction
- }
-
- void printCallOperand(const MachineInstr *MI, unsigned OpNo) {
- printOp(MI->getOperand(OpNo), true); // this is a br.call instruction
- }
-
- std::string getSectionForFunction(const Function &F) const;
-
- void printMachineInstruction(const MachineInstr *MI);
- void printOp(const MachineOperand &MO, bool isBRCALLinsn= false);
- bool runOnMachineFunction(MachineFunction &F);
- bool doInitialization(Module &M);
- bool doFinalization(Module &M);
- };
-} // end of anonymous namespace
-
-
-// Include the auto-generated portion of the assembly writer.
-#include "IA64GenAsmWriter.inc"
-
-
-std::string IA64AsmPrinter::getSectionForFunction(const Function &F) const {
- // This means "Allocated instruXions in mem, initialized".
- return "\n\t.section .text, \"ax\", \"progbits\"\n";
-}
-
-/// runOnMachineFunction - This uses the printMachineInstruction()
-/// method to print assembly for each instruction.
-///
-bool IA64AsmPrinter::runOnMachineFunction(MachineFunction &MF) {
- SetupMachineFunction(MF);
- O << "\n\n";
-
- // Print out constants referenced by the function
- EmitConstantPool(MF.getConstantPool());
-
- const Function *F = MF.getFunction();
- SwitchToTextSection(getSectionForFunction(*F).c_str(), F);
-
- // Print out labels for the function.
- EmitAlignment(5);
- O << "\t.global\t" << CurrentFnName << "\n";
- O << "\t.type\t" << CurrentFnName << ", @function\n";
- O << CurrentFnName << ":\n";
-
- // Print out code for the function.
- for (MachineFunction::const_iterator I = MF.begin(), E = MF.end();
- I != E; ++I) {
- // Print a label for the basic block if there are any predecessors.
- if (!I->pred_empty()) {
- printBasicBlockLabel(I, true, true);
- O << '\n';
- }
- for (MachineBasicBlock::const_iterator II = I->begin(), E = I->end();
- II != E; ++II) {
- // Print the assembly for the instruction.
- printMachineInstruction(II);
- }
- }
-
- // We didn't modify anything.
- return false;
-}
-
-void IA64AsmPrinter::printOp(const MachineOperand &MO,
- bool isBRCALLinsn /* = false */) {
- const TargetRegisterInfo &RI = *TM.getRegisterInfo();
- switch (MO.getType()) {
- case MachineOperand::MO_Register:
- O << RI.get(MO.getReg()).AsmName;
- return;
-
- case MachineOperand::MO_Immediate:
- O << MO.getImm();
- return;
- case MachineOperand::MO_MachineBasicBlock:
- printBasicBlockLabel(MO.getMBB());
- return;
- case MachineOperand::MO_ConstantPoolIndex: {
- O << "@gprel(" << TAI->getPrivateGlobalPrefix()
- << "CPI" << getFunctionNumber() << "_" << MO.getIndex() << ")";
- return;
- }
-
- case MachineOperand::MO_GlobalAddress: {
-
- // functions need @ltoff(@fptr(fn_name)) form
- GlobalValue *GV = MO.getGlobal();
- Function *F = dyn_cast<Function>(GV);
-
- bool Needfptr=false; // if we're computing an address @ltoff(X), do
- // we need to decorate it so it becomes
- // @ltoff(@fptr(X)) ?
- if (F && !isBRCALLinsn /*&& F->isDeclaration()*/)
- Needfptr=true;
-
- // if this is the target of a call instruction, we should define
- // the function somewhere (GNU gas has no problem without this, but
- // Intel ias rightly complains of an 'undefined symbol')
-
- if (F /*&& isBRCALLinsn*/ && F->isDeclaration())
- ExternalFunctionNames.insert(Mang->getValueName(MO.getGlobal()));
- else
- if (GV->isDeclaration()) // e.g. stuff like 'stdin'
- ExternalObjectNames.insert(Mang->getValueName(MO.getGlobal()));
-
- if (!isBRCALLinsn)
- O << "@ltoff(";
- if (Needfptr)
- O << "@fptr(";
- O << Mang->getValueName(MO.getGlobal());
-
- if (Needfptr && !isBRCALLinsn)
- O << "#))"; // close both fptr( and ltoff(
- else {
- if (Needfptr)
- O << "#)"; // close only fptr(
- if (!isBRCALLinsn)
- O << "#)"; // close only ltoff(
- }
-
- int Offset = MO.getOffset();
- if (Offset > 0)
- O << " + " << Offset;
- else if (Offset < 0)
- O << " - " << -Offset;
- return;
- }
- case MachineOperand::MO_ExternalSymbol:
- O << MO.getSymbolName();
- ExternalFunctionNames.insert(MO.getSymbolName());
- return;
- default:
- O << "<AsmPrinter: unknown operand type: " << MO.getType() << " >"; return;
- }
-}
-
-/// printMachineInstruction -- Print out a single IA64 LLVM instruction
-/// MI to the current output stream.
-///
-void IA64AsmPrinter::printMachineInstruction(const MachineInstr *MI) {
- ++EmittedInsts;
-
- // Call the autogenerated instruction printer routines.
- printInstruction(MI);
-}
-
-bool IA64AsmPrinter::doInitialization(Module &M) {
- bool Result = AsmPrinter::doInitialization(M);
-
- O << "\n.ident \"LLVM-ia64\"\n\n"
- << "\t.psr lsb\n" // should be "msb" on HP-UX, for starters
- << "\t.radix C\n"
- << "\t.psr abi64\n"; // we only support 64 bits for now
- return Result;
-}
-
-bool IA64AsmPrinter::doFinalization(Module &M) {
- const TargetData *TD = TM.getTargetData();
-
- // Print out module-level global variables here.
- for (Module::const_global_iterator I = M.global_begin(), E = M.global_end();
- I != E; ++I)
- if (I->hasInitializer()) { // External global require no code
- // Check to see if this is a special global used by LLVM, if so, emit it.
- if (EmitSpecialLLVMGlobal(I))
- continue;
-
- O << "\n\n";
- std::string name = Mang->getValueName(I);
- Constant *C = I->getInitializer();
- unsigned Size = TD->getABITypeSize(C->getType());
- unsigned Align = TD->getPreferredAlignmentLog(I);
-
- if (C->isNullValue() &&
- (I->hasLinkOnceLinkage() || I->hasInternalLinkage() ||
- I->hasWeakLinkage() /* FIXME: Verify correct */)) {
- SwitchToDataSection(".data", I);
- if (I->hasInternalLinkage()) {
- O << "\t.lcomm " << name << "#," << TD->getABITypeSize(C->getType())
- << "," << (1 << Align);
- O << "\n";
- } else {
- O << "\t.common " << name << "#," << TD->getABITypeSize(C->getType())
- << "," << (1 << Align);
- O << "\n";
- }
- } else {
- switch (I->getLinkage()) {
- case GlobalValue::LinkOnceLinkage:
- case GlobalValue::WeakLinkage: // FIXME: Verify correct for weak.
- // Nonnull linkonce -> weak
- O << "\t.weak " << name << "\n";
- O << "\t.section\t.llvm.linkonce.d." << name
- << ", \"aw\", \"progbits\"\n";
- SwitchToDataSection("", I);
- break;
- case GlobalValue::AppendingLinkage:
- // FIXME: appending linkage variables should go into a section of
- // their name or something. For now, just emit them as external.
- case GlobalValue::ExternalLinkage:
- // If external or appending, declare as a global symbol
- O << "\t.global " << name << "\n";
- // FALL THROUGH
- case GlobalValue::InternalLinkage:
- SwitchToDataSection(C->isNullValue() ? ".bss" : ".data", I);
- break;
- case GlobalValue::GhostLinkage:
- cerr << "GhostLinkage cannot appear in IA64AsmPrinter!\n";
- abort();
- case GlobalValue::DLLImportLinkage:
- cerr << "DLLImport linkage is not supported by this target!\n";
- abort();
- case GlobalValue::DLLExportLinkage:
- cerr << "DLLExport linkage is not supported by this target!\n";
- abort();
- default:
- assert(0 && "Unknown linkage type!");
- }
-
- EmitAlignment(Align);
- O << "\t.type " << name << ",@object\n";
- O << "\t.size " << name << "," << Size << "\n";
- O << name << ":\t\t\t\t// " << *C << "\n";
- EmitGlobalConstant(C);
- }
- }
-
- // we print out ".global X \n .type X, @function" for each external function
- O << "\n\n// br.call targets referenced (and not defined) above: \n";
- for (std::set<std::string>::iterator i = ExternalFunctionNames.begin(),
- e = ExternalFunctionNames.end(); i!=e; ++i) {
- O << "\t.global " << *i << "\n\t.type " << *i << ", @function\n";
- }
- O << "\n\n";
-
- // we print out ".global X \n .type X, @object" for each external object
- O << "\n\n// (external) symbols referenced (and not defined) above: \n";
- for (std::set<std::string>::iterator i = ExternalObjectNames.begin(),
- e = ExternalObjectNames.end(); i!=e; ++i) {
- O << "\t.global " << *i << "\n\t.type " << *i << ", @object\n";
- }
- O << "\n\n";
-
- return AsmPrinter::doFinalization(M);
-}
-
-/// createIA64CodePrinterPass - Returns a pass that prints the IA64
-/// assembly code for a MachineFunction to the given output stream, using
-/// the given target machine description.
-///
-FunctionPass *llvm::createIA64CodePrinterPass(std::ostream &o,
- IA64TargetMachine &tm) {
- return new IA64AsmPrinter(o, tm, tm.getTargetAsmInfo());
-}
-
-
diff --git a/release_23/lib/Target/IA64/IA64Bundling.cpp b/release_23/lib/Target/IA64/IA64Bundling.cpp
deleted file mode 100644
index cac007cef265..000000000000
--- a/release_23/lib/Target/IA64/IA64Bundling.cpp
+++ /dev/null
@@ -1,118 +0,0 @@
-//===-- IA64Bundling.cpp - IA-64 instruction bundling pass. ------------ --===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// Add stops where required to prevent read-after-write and write-after-write
-// dependencies, for both registers and memory addresses. There are exceptions:
-//
-// - Compare instructions (cmp*, tbit, tnat, fcmp, frcpa) are OK with
-// WAW dependencies so long as they all target p0, or are of parallel
-// type (.and*/.or*)
-//
-// FIXME: bundling, for now, is left to the assembler.
-// FIXME: this might be an appropriate place to translate between different
-// instructions that do the same thing, if this helps bundling.
-//
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "ia64-codegen"
-#include "IA64.h"
-#include "IA64InstrInfo.h"
-#include "IA64TargetMachine.h"
-#include "llvm/CodeGen/MachineFunctionPass.h"
-#include "llvm/CodeGen/MachineInstrBuilder.h"
-#include "llvm/ADT/SetOperations.h"
-#include "llvm/ADT/Statistic.h"
-#include "llvm/Support/Debug.h"
-#include <set>
-using namespace llvm;
-
-STATISTIC(StopBitsAdded, "Number of stop bits added");
-
-namespace {
- struct IA64BundlingPass : public MachineFunctionPass {
- static char ID;
- /// Target machine description which we query for reg. names, data
- /// layout, etc.
- ///
- IA64TargetMachine &TM;
-
- IA64BundlingPass(IA64TargetMachine &tm)
- : MachineFunctionPass((intptr_t)&ID), TM(tm) { }
-
- virtual const char *getPassName() const {
- return "IA64 (Itanium) Bundling Pass";
- }
-
- bool runOnMachineBasicBlock(MachineBasicBlock &MBB);
- bool runOnMachineFunction(MachineFunction &F) {
- bool Changed = false;
- for (MachineFunction::iterator FI = F.begin(), FE = F.end();
- FI != FE; ++FI)
- Changed |= runOnMachineBasicBlock(*FI);
- return Changed;
- }
-
- // XXX: ugly global, but pending writes can cross basic blocks. Note that
- // taken branches end instruction groups. So we only need to worry about
- // 'fallthrough' code
- std::set<unsigned> PendingRegWrites;
- };
- char IA64BundlingPass::ID = 0;
-} // end of anonymous namespace
-
-/// createIA64BundlingPass - Returns a pass that adds STOP (;;) instructions
-/// and arranges the result into bundles.
-///
-FunctionPass *llvm::createIA64BundlingPass(IA64TargetMachine &tm) {
- return new IA64BundlingPass(tm);
-}
-
-/// runOnMachineBasicBlock - add stops and bundle this MBB.
-///
-bool IA64BundlingPass::runOnMachineBasicBlock(MachineBasicBlock &MBB) {
- bool Changed = false;
-
- for (MachineBasicBlock::iterator I = MBB.begin(); I != MBB.end(); ) {
- MachineInstr *CurrentInsn = I++;
- std::set<unsigned> CurrentReads, CurrentWrites, OrigWrites;
-
- for(unsigned i=0; i < CurrentInsn->getNumOperands(); i++) {
- MachineOperand &MO=CurrentInsn->getOperand(i);
- if(MO.isRegister()) {
- if(MO.isUse()) { // TODO: exclude p0
- CurrentReads.insert(MO.getReg());
- }
- if(MO.isDef()) { // TODO: exclude p0
- CurrentWrites.insert(MO.getReg());
- OrigWrites.insert(MO.getReg()); // FIXME: use a nondestructive
- // set_intersect instead?
- }
- }
- }
-
- // CurrentReads/CurrentWrites contain info for the current instruction.
- // Does it read or write any registers that are pending a write?
- // (i.e. not separated by a stop)
- set_intersect(CurrentReads, PendingRegWrites);
- set_intersect(CurrentWrites, PendingRegWrites);
-
- if(! (CurrentReads.empty() && CurrentWrites.empty()) ) {
- // there is a conflict, insert a stop and reset PendingRegWrites
- CurrentInsn = BuildMI(MBB, CurrentInsn,
- TM.getInstrInfo()->get(IA64::STOP), 0);
- PendingRegWrites=OrigWrites; // carry over current writes to next insn
- Changed=true; StopBitsAdded++; // update stats
- } else { // otherwise, track additional pending writes
- set_union(PendingRegWrites, OrigWrites);
- }
- } // onto the next insn in the MBB
-
- return Changed;
-}
-
diff --git a/release_23/lib/Target/IA64/IA64ISelDAGToDAG.cpp b/release_23/lib/Target/IA64/IA64ISelDAGToDAG.cpp
deleted file mode 100644
index 93ff8b426e59..000000000000
--- a/release_23/lib/Target/IA64/IA64ISelDAGToDAG.cpp
+++ /dev/null
@@ -1,589 +0,0 @@
-//===---- IA64ISelDAGToDAG.cpp - IA64 pattern matching inst selector ------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines a pattern matching instruction selector for IA64,
-// converting a legalized dag to an IA64 dag.
-//
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "ia64-codegen"
-#include "IA64.h"
-#include "IA64TargetMachine.h"
-#include "IA64ISelLowering.h"
-#include "llvm/CodeGen/MachineInstrBuilder.h"
-#include "llvm/CodeGen/MachineFunction.h"
-#include "llvm/CodeGen/SelectionDAG.h"
-#include "llvm/CodeGen/SelectionDAGISel.h"
-#include "llvm/Target/TargetOptions.h"
-#include "llvm/Constants.h"
-#include "llvm/GlobalValue.h"
-#include "llvm/Intrinsics.h"
-#include "llvm/Support/Compiler.h"
-#include "llvm/Support/Debug.h"
-#include "llvm/Support/MathExtras.h"
-#include <queue>
-#include <set>
-using namespace llvm;
-
-namespace {
- //===--------------------------------------------------------------------===//
- /// IA64DAGToDAGISel - IA64 specific code to select IA64 machine
- /// instructions for SelectionDAG operations.
- ///
- class IA64DAGToDAGISel : public SelectionDAGISel {
- IA64TargetLowering IA64Lowering;
- unsigned GlobalBaseReg;
- public:
- IA64DAGToDAGISel(IA64TargetMachine &TM)
- : SelectionDAGISel(IA64Lowering), IA64Lowering(*TM.getTargetLowering()) {}
-
- virtual bool runOnFunction(Function &Fn) {
- // Make sure we re-emit a set of the global base reg if necessary
- GlobalBaseReg = 0;
- return SelectionDAGISel::runOnFunction(Fn);
- }
-
- /// getI64Imm - Return a target constant with the specified value, of type
- /// i64.
- inline SDOperand getI64Imm(uint64_t Imm) {
- return CurDAG->getTargetConstant(Imm, MVT::i64);
- }
-
- /// getGlobalBaseReg - insert code into the entry mbb to materialize the PIC
- /// base register. Return the virtual register that holds this value.
- // SDOperand getGlobalBaseReg(); TODO: hmm
-
- // Select - Convert the specified operand from a target-independent to a
- // target-specific node if it hasn't already been changed.
- SDNode *Select(SDOperand N);
-
- SDNode *SelectIntImmediateExpr(SDOperand LHS, SDOperand RHS,
- unsigned OCHi, unsigned OCLo,
- bool IsArithmetic = false,
- bool Negate = false);
- SDNode *SelectBitfieldInsert(SDNode *N);
-
- /// SelectCC - Select a comparison of the specified values with the
- /// specified condition code, returning the CR# of the expression.
- SDOperand SelectCC(SDOperand LHS, SDOperand RHS, ISD::CondCode CC);
-
- /// SelectAddr - Given the specified address, return the two operands for a
- /// load/store instruction, and return true if it should be an indexed [r+r]
- /// operation.
- bool SelectAddr(SDOperand Addr, SDOperand &Op1, SDOperand &Op2);
-
- /// InstructionSelectBasicBlock - This callback is invoked by
- /// SelectionDAGISel when it has created a SelectionDAG for us to codegen.
- virtual void InstructionSelectBasicBlock(SelectionDAG &DAG);
-
- virtual const char *getPassName() const {
- return "IA64 (Itanium) DAG->DAG Instruction Selector";
- }
-
-// Include the pieces autogenerated from the target description.
-#include "IA64GenDAGISel.inc"
-
-private:
- SDNode *SelectDIV(SDOperand Op);
- };
-}
-
-/// InstructionSelectBasicBlock - This callback is invoked by
-/// SelectionDAGISel when it has created a SelectionDAG for us to codegen.
-void IA64DAGToDAGISel::InstructionSelectBasicBlock(SelectionDAG &DAG) {
- DEBUG(BB->dump());
-
- // Select target instructions for the DAG.
- DAG.setRoot(SelectRoot(DAG.getRoot()));
- DAG.RemoveDeadNodes();
-
- // Emit machine code to BB.
- ScheduleAndEmitDAG(DAG);
-}
-
-SDNode *IA64DAGToDAGISel::SelectDIV(SDOperand Op) {
- SDNode *N = Op.Val;
- SDOperand Chain = N->getOperand(0);
- SDOperand Tmp1 = N->getOperand(0);
- SDOperand Tmp2 = N->getOperand(1);
- AddToISelQueue(Chain);
-
- AddToISelQueue(Tmp1);
- AddToISelQueue(Tmp2);
-
- bool isFP=false;
-
- if(MVT::isFloatingPoint(Tmp1.getValueType()))
- isFP=true;
-
- bool isModulus=false; // is it a division or a modulus?
- bool isSigned=false;
-
- switch(N->getOpcode()) {
- case ISD::FDIV:
- case ISD::SDIV: isModulus=false; isSigned=true; break;
- case ISD::UDIV: isModulus=false; isSigned=false; break;
- case ISD::FREM:
- case ISD::SREM: isModulus=true; isSigned=true; break;
- case ISD::UREM: isModulus=true; isSigned=false; break;
- }
-
- // TODO: check for integer divides by powers of 2 (or other simple patterns?)
-
- SDOperand TmpPR, TmpPR2;
- SDOperand TmpF1, TmpF2, TmpF3, TmpF4, TmpF5, TmpF6, TmpF7, TmpF8;
- SDOperand TmpF9, TmpF10,TmpF11,TmpF12,TmpF13,TmpF14,TmpF15;
- SDNode *Result;
-
- // we'll need copies of F0 and F1
- SDOperand F0 = CurDAG->getRegister(IA64::F0, MVT::f64);
- SDOperand F1 = CurDAG->getRegister(IA64::F1, MVT::f64);
-
- // OK, emit some code:
-
- if(!isFP) {
- // first, load the inputs into FP regs.
- TmpF1 =
- SDOperand(CurDAG->getTargetNode(IA64::SETFSIG, MVT::f64, Tmp1), 0);
- Chain = TmpF1.getValue(1);
- TmpF2 =
- SDOperand(CurDAG->getTargetNode(IA64::SETFSIG, MVT::f64, Tmp2), 0);
- Chain = TmpF2.getValue(1);
-
- // next, convert the inputs to FP
- if(isSigned) {
- TmpF3 =
- SDOperand(CurDAG->getTargetNode(IA64::FCVTXF, MVT::f64, TmpF1), 0);
- Chain = TmpF3.getValue(1);
- TmpF4 =
- SDOperand(CurDAG->getTargetNode(IA64::FCVTXF, MVT::f64, TmpF2), 0);
- Chain = TmpF4.getValue(1);
- } else { // is unsigned
- TmpF3 =
- SDOperand(CurDAG->getTargetNode(IA64::FCVTXUFS1, MVT::f64, TmpF1), 0);
- Chain = TmpF3.getValue(1);
- TmpF4 =
- SDOperand(CurDAG->getTargetNode(IA64::FCVTXUFS1, MVT::f64, TmpF2), 0);
- Chain = TmpF4.getValue(1);
- }
-
- } else { // this is an FP divide/remainder, so we 'leak' some temp
- // regs and assign TmpF3=Tmp1, TmpF4=Tmp2
- TmpF3=Tmp1;
- TmpF4=Tmp2;
- }
-
- // we start by computing an approximate reciprocal (good to 9 bits?)
- // note, this instruction writes _both_ TmpF5 (answer) and TmpPR (predicate)
- if(isFP)
- TmpF5 = SDOperand(CurDAG->getTargetNode(IA64::FRCPAS0, MVT::f64, MVT::i1,
- TmpF3, TmpF4), 0);
- else
- TmpF5 = SDOperand(CurDAG->getTargetNode(IA64::FRCPAS1, MVT::f64, MVT::i1,
- TmpF3, TmpF4), 0);
-
- TmpPR = TmpF5.getValue(1);
- Chain = TmpF5.getValue(2);
-
- SDOperand minusB;
- if(isModulus) { // for remainders, it'll be handy to have
- // copies of -input_b
- minusB = SDOperand(CurDAG->getTargetNode(IA64::SUB, MVT::i64,
- CurDAG->getRegister(IA64::r0, MVT::i64), Tmp2), 0);
- Chain = minusB.getValue(1);
- }
-
- SDOperand TmpE0, TmpY1, TmpE1, TmpY2;
-
- SDOperand OpsE0[] = { TmpF4, TmpF5, F1, TmpPR };
- TmpE0 = SDOperand(CurDAG->getTargetNode(IA64::CFNMAS1, MVT::f64,
- OpsE0, 4), 0);
- Chain = TmpE0.getValue(1);
- SDOperand OpsY1[] = { TmpF5, TmpE0, TmpF5, TmpPR };
- TmpY1 = SDOperand(CurDAG->getTargetNode(IA64::CFMAS1, MVT::f64,
- OpsY1, 4), 0);
- Chain = TmpY1.getValue(1);
- SDOperand OpsE1[] = { TmpE0, TmpE0, F0, TmpPR };
- TmpE1 = SDOperand(CurDAG->getTargetNode(IA64::CFMAS1, MVT::f64,
- OpsE1, 4), 0);
- Chain = TmpE1.getValue(1);
- SDOperand OpsY2[] = { TmpY1, TmpE1, TmpY1, TmpPR };
- TmpY2 = SDOperand(CurDAG->getTargetNode(IA64::CFMAS1, MVT::f64,
- OpsY2, 4), 0);
- Chain = TmpY2.getValue(1);
-
- if(isFP) { // if this is an FP divide, we finish up here and exit early
- if(isModulus)
- assert(0 && "Sorry, try another FORTRAN compiler.");
-
- SDOperand TmpE2, TmpY3, TmpQ0, TmpR0;
-
- SDOperand OpsE2[] = { TmpE1, TmpE1, F0, TmpPR };
- TmpE2 = SDOperand(CurDAG->getTargetNode(IA64::CFMAS1, MVT::f64,
- OpsE2, 4), 0);
- Chain = TmpE2.getValue(1);
- SDOperand OpsY3[] = { TmpY2, TmpE2, TmpY2, TmpPR };
- TmpY3 = SDOperand(CurDAG->getTargetNode(IA64::CFMAS1, MVT::f64,
- OpsY3, 4), 0);
- Chain = TmpY3.getValue(1);
- SDOperand OpsQ0[] = { Tmp1, TmpY3, F0, TmpPR };
- TmpQ0 =
- SDOperand(CurDAG->getTargetNode(IA64::CFMADS1, MVT::f64, // double prec!
- OpsQ0, 4), 0);
- Chain = TmpQ0.getValue(1);
- SDOperand OpsR0[] = { Tmp2, TmpQ0, Tmp1, TmpPR };
- TmpR0 =
- SDOperand(CurDAG->getTargetNode(IA64::CFNMADS1, MVT::f64, // double prec!
- OpsR0, 4), 0);
- Chain = TmpR0.getValue(1);
-
-// we want Result to have the same target register as the frcpa, so
-// we two-address hack it. See the comment "for this to work..." on
-// page 48 of Intel application note #245415
- SDOperand Ops[] = { TmpF5, TmpY3, TmpR0, TmpQ0, TmpPR };
- Result = CurDAG->getTargetNode(IA64::TCFMADS0, MVT::f64, // d.p. s0 rndg!
- Ops, 5);
- Chain = SDOperand(Result, 1);
- return Result; // XXX: early exit!
- } else { // this is *not* an FP divide, so there's a bit left to do:
-
- SDOperand TmpQ2, TmpR2, TmpQ3, TmpQ;
-
- SDOperand OpsQ2[] = { TmpF3, TmpY2, F0, TmpPR };
- TmpQ2 = SDOperand(CurDAG->getTargetNode(IA64::CFMAS1, MVT::f64,
- OpsQ2, 4), 0);
- Chain = TmpQ2.getValue(1);
- SDOperand OpsR2[] = { TmpF4, TmpQ2, TmpF3, TmpPR };
- TmpR2 = SDOperand(CurDAG->getTargetNode(IA64::CFNMAS1, MVT::f64,
- OpsR2, 4), 0);
- Chain = TmpR2.getValue(1);
-
-// we want TmpQ3 to have the same target register as the frcpa? maybe we
-// should two-address hack it. See the comment "for this to work..." on page
-// 48 of Intel application note #245415
- SDOperand OpsQ3[] = { TmpF5, TmpR2, TmpY2, TmpQ2, TmpPR };
- TmpQ3 = SDOperand(CurDAG->getTargetNode(IA64::TCFMAS1, MVT::f64,
- OpsQ3, 5), 0);
- Chain = TmpQ3.getValue(1);
-
- // STORY: without these two-address instructions (TCFMAS1 and TCFMADS0)
- // the FPSWA won't be able to help out in the case of large/tiny
- // arguments. Other fun bugs may also appear, e.g. 0/x = x, not 0.
-
- if(isSigned)
- TmpQ = SDOperand(CurDAG->getTargetNode(IA64::FCVTFXTRUNCS1,
- MVT::f64, TmpQ3), 0);
- else
- TmpQ = SDOperand(CurDAG->getTargetNode(IA64::FCVTFXUTRUNCS1,
- MVT::f64, TmpQ3), 0);
-
- Chain = TmpQ.getValue(1);
-
- if(isModulus) {
- SDOperand FPminusB =
- SDOperand(CurDAG->getTargetNode(IA64::SETFSIG, MVT::f64, minusB), 0);
- Chain = FPminusB.getValue(1);
- SDOperand Remainder =
- SDOperand(CurDAG->getTargetNode(IA64::XMAL, MVT::f64,
- TmpQ, FPminusB, TmpF1), 0);
- Chain = Remainder.getValue(1);
- Result = CurDAG->getTargetNode(IA64::GETFSIG, MVT::i64, Remainder);
- Chain = SDOperand(Result, 1);
- } else { // just an integer divide
- Result = CurDAG->getTargetNode(IA64::GETFSIG, MVT::i64, TmpQ);
- Chain = SDOperand(Result, 1);
- }
-
- return Result;
- } // wasn't an FP divide
-}
-
-// Select - Convert the specified operand from a target-independent to a
-// target-specific node if it hasn't already been changed.
-SDNode *IA64DAGToDAGISel::Select(SDOperand Op) {
- SDNode *N = Op.Val;
- if (N->getOpcode() >= ISD::BUILTIN_OP_END &&
- N->getOpcode() < IA64ISD::FIRST_NUMBER)
- return NULL; // Already selected.
-
- switch (N->getOpcode()) {
- default: break;
-
- case IA64ISD::BRCALL: { // XXX: this is also a hack!
- SDOperand Chain = N->getOperand(0);
- SDOperand InFlag; // Null incoming flag value.
-
- AddToISelQueue(Chain);
- if(N->getNumOperands()==3) { // we have an incoming chain, callee and flag
- InFlag = N->getOperand(2);
- AddToISelQueue(InFlag);
- }
-
- unsigned CallOpcode;
- SDOperand CallOperand;
-
- // if we can call directly, do so
- if (GlobalAddressSDNode *GASD =
- dyn_cast<GlobalAddressSDNode>(N->getOperand(1))) {
- CallOpcode = IA64::BRCALL_IPREL_GA;
- CallOperand = CurDAG->getTargetGlobalAddress(GASD->getGlobal(), MVT::i64);
- } else if (isa<ExternalSymbolSDNode>(N->getOperand(1))) {
- // FIXME: we currently NEED this case for correctness, to avoid
- // "non-pic code with imm reloc.n against dynamic symbol" errors
- CallOpcode = IA64::BRCALL_IPREL_ES;
- CallOperand = N->getOperand(1);
- } else {
- // otherwise we need to load the function descriptor,
- // load the branch target (function)'s entry point and GP,
- // branch (call) then restore the GP
- SDOperand FnDescriptor = N->getOperand(1);
- AddToISelQueue(FnDescriptor);
-
- // load the branch target's entry point [mem] and
- // GP value [mem+8]
- SDOperand targetEntryPoint=
- SDOperand(CurDAG->getTargetNode(IA64::LD8, MVT::i64, FnDescriptor), 0);
- Chain = targetEntryPoint.getValue(1);
- SDOperand targetGPAddr=
- SDOperand(CurDAG->getTargetNode(IA64::ADDS, MVT::i64,
- FnDescriptor,
- CurDAG->getConstant(8, MVT::i64)), 0);
- Chain = targetGPAddr.getValue(1);
- SDOperand targetGP =
- SDOperand(CurDAG->getTargetNode(IA64::LD8, MVT::i64, targetGPAddr), 0);
- Chain = targetGP.getValue(1);
-
- Chain = CurDAG->getCopyToReg(Chain, IA64::r1, targetGP, InFlag);
- InFlag = Chain.getValue(1);
- Chain = CurDAG->getCopyToReg(Chain, IA64::B6, targetEntryPoint, InFlag); // FLAG these?
- InFlag = Chain.getValue(1);
-
- CallOperand = CurDAG->getRegister(IA64::B6, MVT::i64);
- CallOpcode = IA64::BRCALL_INDIRECT;
- }
-
- // Finally, once everything is setup, emit the call itself
- if(InFlag.Val)
- Chain = SDOperand(CurDAG->getTargetNode(CallOpcode, MVT::Other, MVT::Flag,
- CallOperand, InFlag), 0);
- else // there might be no arguments
- Chain = SDOperand(CurDAG->getTargetNode(CallOpcode, MVT::Other, MVT::Flag,
- CallOperand, Chain), 0);
- InFlag = Chain.getValue(1);
-
- std::vector<SDOperand> CallResults;
-
- CallResults.push_back(Chain);
- CallResults.push_back(InFlag);
-
- for (unsigned i = 0, e = CallResults.size(); i != e; ++i)
- ReplaceUses(Op.getValue(i), CallResults[i]);
- return NULL;
- }
-
- case IA64ISD::GETFD: {
- SDOperand Input = N->getOperand(0);
- AddToISelQueue(Input);
- return CurDAG->getTargetNode(IA64::GETFD, MVT::i64, Input);
- }
-
- case ISD::FDIV:
- case ISD::SDIV:
- case ISD::UDIV:
- case ISD::SREM:
- case ISD::UREM:
- return SelectDIV(Op);
-
- case ISD::TargetConstantFP: {
- SDOperand Chain = CurDAG->getEntryNode(); // this is a constant, so..
-
- SDOperand V;
- ConstantFPSDNode* N2 = cast<ConstantFPSDNode>(N);
- if (N2->getValueAPF().isPosZero()) {
- V = CurDAG->getCopyFromReg(Chain, IA64::F0, MVT::f64);
- } else if (N2->isExactlyValue(N2->getValueType(0) == MVT::f32 ?
- APFloat(+1.0f) : APFloat(+1.0))) {
- V = CurDAG->getCopyFromReg(Chain, IA64::F1, MVT::f64);
- } else
- assert(0 && "Unexpected FP constant!");
-
- ReplaceUses(SDOperand(N, 0), V);
- return 0;
- }
-
- case ISD::FrameIndex: { // TODO: reduce creepyness
- int FI = cast<FrameIndexSDNode>(N)->getIndex();
- if (N->hasOneUse())
- return CurDAG->SelectNodeTo(N, IA64::MOV, MVT::i64,
- CurDAG->getTargetFrameIndex(FI, MVT::i64));
- else
- return CurDAG->getTargetNode(IA64::MOV, MVT::i64,
- CurDAG->getTargetFrameIndex(FI, MVT::i64));
- }
-
- case ISD::ConstantPool: { // TODO: nuke the constant pool
- // (ia64 doesn't need one)
- ConstantPoolSDNode *CP = cast<ConstantPoolSDNode>(N);
- Constant *C = CP->getConstVal();
- SDOperand CPI = CurDAG->getTargetConstantPool(C, MVT::i64,
- CP->getAlignment());
- return CurDAG->getTargetNode(IA64::ADDL_GA, MVT::i64, // ?
- CurDAG->getRegister(IA64::r1, MVT::i64), CPI);
- }
-
- case ISD::GlobalAddress: {
- GlobalValue *GV = cast<GlobalAddressSDNode>(N)->getGlobal();
- SDOperand GA = CurDAG->getTargetGlobalAddress(GV, MVT::i64);
- SDOperand Tmp =
- SDOperand(CurDAG->getTargetNode(IA64::ADDL_GA, MVT::i64,
- CurDAG->getRegister(IA64::r1,
- MVT::i64), GA), 0);
- return CurDAG->getTargetNode(IA64::LD8, MVT::i64, Tmp);
- }
-
-/* XXX
- case ISD::ExternalSymbol: {
- SDOperand EA = CurDAG->getTargetExternalSymbol(
- cast<ExternalSymbolSDNode>(N)->getSymbol(),
- MVT::i64);
- SDOperand Tmp = CurDAG->getTargetNode(IA64::ADDL_EA, MVT::i64,
- CurDAG->getRegister(IA64::r1,
- MVT::i64),
- EA);
- return CurDAG->getTargetNode(IA64::LD8, MVT::i64, Tmp);
- }
-*/
-
- case ISD::LOAD: { // FIXME: load -1, not 1, for bools?
- LoadSDNode *LD = cast<LoadSDNode>(N);
- SDOperand Chain = LD->getChain();
- SDOperand Address = LD->getBasePtr();
- AddToISelQueue(Chain);
- AddToISelQueue(Address);
-
- MVT::ValueType TypeBeingLoaded = LD->getMemoryVT();
- unsigned Opc;
- switch (TypeBeingLoaded) {
- default:
-#ifndef NDEBUG
- N->dump(CurDAG);
-#endif
- assert(0 && "Cannot load this type!");
- case MVT::i1: { // this is a bool
- Opc = IA64::LD1; // first we load a byte, then compare for != 0
- if(N->getValueType(0) == MVT::i1) { // XXX: early exit!
- return CurDAG->SelectNodeTo(N, IA64::CMPNE, MVT::i1, MVT::Other,
- SDOperand(CurDAG->getTargetNode(Opc, MVT::i64, Address), 0),
- CurDAG->getRegister(IA64::r0, MVT::i64),
- Chain);
- }
- /* otherwise, we want to load a bool into something bigger: LD1
- will do that for us, so we just fall through */
- }
- case MVT::i8: Opc = IA64::LD1; break;
- case MVT::i16: Opc = IA64::LD2; break;
- case MVT::i32: Opc = IA64::LD4; break;
- case MVT::i64: Opc = IA64::LD8; break;
-
- case MVT::f32: Opc = IA64::LDF4; break;
- case MVT::f64: Opc = IA64::LDF8; break;
- }
-
- // TODO: comment this
- return CurDAG->SelectNodeTo(N, Opc, N->getValueType(0), MVT::Other,
- Address, Chain);
- }
-
- case ISD::STORE: {
- StoreSDNode *ST = cast<StoreSDNode>(N);
- SDOperand Address = ST->getBasePtr();
- SDOperand Chain = ST->getChain();
- AddToISelQueue(Address);
- AddToISelQueue(Chain);
-
- unsigned Opc;
- if (ISD::isNON_TRUNCStore(N)) {
- switch (N->getOperand(1).getValueType()) {
- default: assert(0 && "unknown type in store");
- case MVT::i1: { // this is a bool
- Opc = IA64::ST1; // we store either 0 or 1 as a byte
- // first load zero!
- SDOperand Initial = CurDAG->getCopyFromReg(Chain, IA64::r0, MVT::i64);
- Chain = Initial.getValue(1);
- // then load 1 into the same reg iff the predicate to store is 1
- SDOperand Tmp = ST->getValue();
- AddToISelQueue(Tmp);
- Tmp =
- SDOperand(CurDAG->getTargetNode(IA64::TPCADDS, MVT::i64, Initial,
- CurDAG->getTargetConstant(1, MVT::i64),
- Tmp), 0);
- return CurDAG->SelectNodeTo(N, Opc, MVT::Other, Address, Tmp, Chain);
- }
- case MVT::i64: Opc = IA64::ST8; break;
- case MVT::f64: Opc = IA64::STF8; break;
- }
- } else { // Truncating store
- switch(ST->getMemoryVT()) {
- default: assert(0 && "unknown type in truncstore");
- case MVT::i8: Opc = IA64::ST1; break;
- case MVT::i16: Opc = IA64::ST2; break;
- case MVT::i32: Opc = IA64::ST4; break;
- case MVT::f32: Opc = IA64::STF4; break;
- }
- }
-
- SDOperand N1 = N->getOperand(1);
- SDOperand N2 = N->getOperand(2);
- AddToISelQueue(N1);
- AddToISelQueue(N2);
- return CurDAG->SelectNodeTo(N, Opc, MVT::Other, N2, N1, Chain);
- }
-
- case ISD::BRCOND: {
- SDOperand Chain = N->getOperand(0);
- SDOperand CC = N->getOperand(1);
- AddToISelQueue(Chain);
- AddToISelQueue(CC);
- MachineBasicBlock *Dest =
- cast<BasicBlockSDNode>(N->getOperand(2))->getBasicBlock();
- //FIXME - we do NOT need long branches all the time
- return CurDAG->SelectNodeTo(N, IA64::BRLCOND_NOTCALL, MVT::Other, CC,
- CurDAG->getBasicBlock(Dest), Chain);
- }
-
- case ISD::CALLSEQ_START:
- case ISD::CALLSEQ_END: {
- int64_t Amt = cast<ConstantSDNode>(N->getOperand(1))->getValue();
- unsigned Opc = N->getOpcode() == ISD::CALLSEQ_START ?
- IA64::ADJUSTCALLSTACKDOWN : IA64::ADJUSTCALLSTACKUP;
- SDOperand N0 = N->getOperand(0);
- AddToISelQueue(N0);
- return CurDAG->SelectNodeTo(N, Opc, MVT::Other, getI64Imm(Amt), N0);
- }
-
- case ISD::BR:
- // FIXME: we don't need long branches all the time!
- SDOperand N0 = N->getOperand(0);
- AddToISelQueue(N0);
- return CurDAG->SelectNodeTo(N, IA64::BRL_NOTCALL, MVT::Other,
- N->getOperand(1), N0);
- }
-
- return SelectCode(Op);
-}
-
-
-/// createIA64DAGToDAGInstructionSelector - This pass converts a legalized DAG
-/// into an IA64-specific DAG, ready for instruction scheduling.
-///
-FunctionPass
-*llvm::createIA64DAGToDAGInstructionSelector(IA64TargetMachine &TM) {
- return new IA64DAGToDAGISel(TM);
-}
-
diff --git a/release_23/lib/Target/IA64/IA64ISelLowering.cpp b/release_23/lib/Target/IA64/IA64ISelLowering.cpp
deleted file mode 100644
index c53f3b44eba2..000000000000
--- a/release_23/lib/Target/IA64/IA64ISelLowering.cpp
+++ /dev/null
@@ -1,609 +0,0 @@
-//===-- IA64ISelLowering.cpp - IA64 DAG Lowering Implementation -----------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the IA64ISelLowering class.
-//
-//===----------------------------------------------------------------------===//
-
-#include "IA64ISelLowering.h"
-#include "IA64MachineFunctionInfo.h"
-#include "IA64TargetMachine.h"
-#include "llvm/CodeGen/MachineFrameInfo.h"
-#include "llvm/CodeGen/MachineFunction.h"
-#include "llvm/CodeGen/MachineInstrBuilder.h"
-#include "llvm/CodeGen/SelectionDAG.h"
-#include "llvm/CodeGen/MachineRegisterInfo.h"
-#include "llvm/Constants.h"
-#include "llvm/Function.h"
-using namespace llvm;
-
-IA64TargetLowering::IA64TargetLowering(TargetMachine &TM)
- : TargetLowering(TM) {
-
- // register class for general registers
- addRegisterClass(MVT::i64, IA64::GRRegisterClass);
-
- // register class for FP registers
- addRegisterClass(MVT::f64, IA64::FPRegisterClass);
-
- // register class for predicate registers
- addRegisterClass(MVT::i1, IA64::PRRegisterClass);
-
- setLoadXAction(ISD::EXTLOAD , MVT::i1 , Promote);
-
- setLoadXAction(ISD::ZEXTLOAD , MVT::i1 , Promote);
-
- setLoadXAction(ISD::SEXTLOAD , MVT::i1 , Promote);
- setLoadXAction(ISD::SEXTLOAD , MVT::i8 , Expand);
- setLoadXAction(ISD::SEXTLOAD , MVT::i16 , Expand);
- setLoadXAction(ISD::SEXTLOAD , MVT::i32 , Expand);
-
- setOperationAction(ISD::BRIND , MVT::Other, Expand);
- setOperationAction(ISD::BR_JT , MVT::Other, Expand);
- setOperationAction(ISD::BR_CC , MVT::Other, Expand);
- setOperationAction(ISD::FP_ROUND_INREG , MVT::f32 , Expand);
-
- // ia64 uses SELECT not SELECT_CC
- setOperationAction(ISD::SELECT_CC , MVT::Other, Expand);
-
- // We need to handle ISD::RET for void functions ourselves,
- // so we get a chance to restore ar.pfs before adding a
- // br.ret insn
- setOperationAction(ISD::RET, MVT::Other, Custom);
-
- setShiftAmountType(MVT::i64);
-
- setOperationAction(ISD::FREM , MVT::f32 , Expand);
- setOperationAction(ISD::FREM , MVT::f64 , Expand);
-
- setOperationAction(ISD::UREM , MVT::f32 , Expand);
- setOperationAction(ISD::UREM , MVT::f64 , Expand);
-
- setOperationAction(ISD::MEMBARRIER , MVT::Other, Expand);
-
- setOperationAction(ISD::SINT_TO_FP , MVT::i1 , Promote);
- setOperationAction(ISD::UINT_TO_FP , MVT::i1 , Promote);
-
- // We don't support sin/cos/sqrt/pow
- setOperationAction(ISD::FSIN , MVT::f64, Expand);
- setOperationAction(ISD::FCOS , MVT::f64, Expand);
- setOperationAction(ISD::FSQRT, MVT::f64, Expand);
- setOperationAction(ISD::FPOW , MVT::f64, Expand);
- setOperationAction(ISD::FSIN , MVT::f32, Expand);
- setOperationAction(ISD::FCOS , MVT::f32, Expand);
- setOperationAction(ISD::FSQRT, MVT::f32, Expand);
- setOperationAction(ISD::FPOW , MVT::f32, Expand);
-
- // FIXME: IA64 supports fcopysign natively!
- setOperationAction(ISD::FCOPYSIGN, MVT::f64, Expand);
- setOperationAction(ISD::FCOPYSIGN, MVT::f32, Expand);
-
- // We don't have line number support yet.
- setOperationAction(ISD::LOCATION, MVT::Other, Expand);
- setOperationAction(ISD::DEBUG_LOC, MVT::Other, Expand);
- setOperationAction(ISD::LABEL, MVT::Other, Expand);
-
- //IA64 has these, but they are not implemented
- setOperationAction(ISD::CTTZ , MVT::i64 , Expand);
- setOperationAction(ISD::CTLZ , MVT::i64 , Expand);
- setOperationAction(ISD::ROTL , MVT::i64 , Expand);
- setOperationAction(ISD::ROTR , MVT::i64 , Expand);
- setOperationAction(ISD::BSWAP, MVT::i64 , Expand); // mux @rev
-
- // VASTART needs to be custom lowered to use the VarArgsFrameIndex
- setOperationAction(ISD::VAARG , MVT::Other, Custom);
- setOperationAction(ISD::VASTART , MVT::Other, Custom);
-
- // Use the default implementation.
- setOperationAction(ISD::VACOPY , MVT::Other, Expand);
- setOperationAction(ISD::VAEND , MVT::Other, Expand);
- setOperationAction(ISD::STACKSAVE, MVT::Other, Expand);
- setOperationAction(ISD::STACKRESTORE, MVT::Other, Expand);
- setOperationAction(ISD::DYNAMIC_STACKALLOC, MVT::i64, Expand);
-
- // Thread Local Storage
- setOperationAction(ISD::GlobalTLSAddress, MVT::i64, Custom);
-
- setStackPointerRegisterToSaveRestore(IA64::r12);
-
- setJumpBufSize(704); // on ia64-linux, jmp_bufs are 704 bytes..
- setJumpBufAlignment(16); // ...and must be 16-byte aligned
-
- computeRegisterProperties();
-
- addLegalFPImmediate(APFloat(+0.0));
- addLegalFPImmediate(APFloat(-0.0));
- addLegalFPImmediate(APFloat(+1.0));
- addLegalFPImmediate(APFloat(-1.0));
-}
-
-const char *IA64TargetLowering::getTargetNodeName(unsigned Opcode) const {
- switch (Opcode) {
- default: return 0;
- case IA64ISD::GETFD: return "IA64ISD::GETFD";
- case IA64ISD::BRCALL: return "IA64ISD::BRCALL";
- case IA64ISD::RET_FLAG: return "IA64ISD::RET_FLAG";
- }
-}
-
-MVT::ValueType
-IA64TargetLowering::getSetCCResultType(const SDOperand &) const {
- return MVT::i1;
-}
-
-std::vector<SDOperand>
-IA64TargetLowering::LowerArguments(Function &F, SelectionDAG &DAG) {
- std::vector<SDOperand> ArgValues;
- //
- // add beautiful description of IA64 stack frame format
- // here (from intel 24535803.pdf most likely)
- //
- MachineFunction &MF = DAG.getMachineFunction();
- MachineFrameInfo *MFI = MF.getFrameInfo();
- const TargetInstrInfo *TII = getTargetMachine().getInstrInfo();
-
- GP = MF.getRegInfo().createVirtualRegister(getRegClassFor(MVT::i64));
- SP = MF.getRegInfo().createVirtualRegister(getRegClassFor(MVT::i64));
- RP = MF.getRegInfo().createVirtualRegister(getRegClassFor(MVT::i64));
-
- MachineBasicBlock& BB = MF.front();
-
- unsigned args_int[] = {IA64::r32, IA64::r33, IA64::r34, IA64::r35,
- IA64::r36, IA64::r37, IA64::r38, IA64::r39};
-
- unsigned args_FP[] = {IA64::F8, IA64::F9, IA64::F10, IA64::F11,
- IA64::F12,IA64::F13,IA64::F14, IA64::F15};
-
- unsigned argVreg[8];
- unsigned argPreg[8];
- unsigned argOpc[8];
-
- unsigned used_FPArgs = 0; // how many FP args have been used so far?
-
- unsigned ArgOffset = 0;
- int count = 0;
-
- for (Function::arg_iterator I = F.arg_begin(), E = F.arg_end(); I != E; ++I)
- {
- SDOperand newroot, argt;
- if(count < 8) { // need to fix this logic? maybe.
-
- switch (getValueType(I->getType())) {
- default:
- assert(0 && "ERROR in LowerArgs: can't lower this type of arg.\n");
- case MVT::f32:
- // fixme? (well, will need to for weird FP structy stuff,
- // see intel ABI docs)
- case MVT::f64:
-//XXX BuildMI(&BB, IA64::IDEF, 0, args_FP[used_FPArgs]);
- MF.getRegInfo().addLiveIn(args_FP[used_FPArgs]);
- // mark this reg as liveIn
- // floating point args go into f8..f15 as-needed, the increment
- argVreg[count] = // is below..:
- MF.getRegInfo().createVirtualRegister(getRegClassFor(MVT::f64));
- // FP args go into f8..f15 as needed: (hence the ++)
- argPreg[count] = args_FP[used_FPArgs++];
- argOpc[count] = IA64::FMOV;
- argt = newroot = DAG.getCopyFromReg(DAG.getRoot(), argVreg[count],
- MVT::f64);
- if (I->getType() == Type::FloatTy)
- argt = DAG.getNode(ISD::FP_ROUND, MVT::f32, argt,
- DAG.getIntPtrConstant(0));
- break;
- case MVT::i1: // NOTE: as far as C abi stuff goes,
- // bools are just boring old ints
- case MVT::i8:
- case MVT::i16:
- case MVT::i32:
- case MVT::i64:
-//XXX BuildMI(&BB, IA64::IDEF, 0, args_int[count]);
- MF.getRegInfo().addLiveIn(args_int[count]);
- // mark this register as liveIn
- argVreg[count] =
- MF.getRegInfo().createVirtualRegister(getRegClassFor(MVT::i64));
- argPreg[count] = args_int[count];
- argOpc[count] = IA64::MOV;
- argt = newroot =
- DAG.getCopyFromReg(DAG.getRoot(), argVreg[count], MVT::i64);
- if ( getValueType(I->getType()) != MVT::i64)
- argt = DAG.getNode(ISD::TRUNCATE, getValueType(I->getType()),
- newroot);
- break;
- }
- } else { // more than 8 args go into the frame
- // Create the frame index object for this incoming parameter...
- ArgOffset = 16 + 8 * (count - 8);
- int FI = MFI->CreateFixedObject(8, ArgOffset);
-
- // Create the SelectionDAG nodes corresponding to a load
- //from this parameter
- SDOperand FIN = DAG.getFrameIndex(FI, MVT::i64);
- argt = newroot = DAG.getLoad(getValueType(I->getType()),
- DAG.getEntryNode(), FIN, NULL, 0);
- }
- ++count;
- DAG.setRoot(newroot.getValue(1));
- ArgValues.push_back(argt);
- }
-
-
- // Create a vreg to hold the output of (what will become)
- // the "alloc" instruction
- VirtGPR = MF.getRegInfo().createVirtualRegister(getRegClassFor(MVT::i64));
- BuildMI(&BB, TII->get(IA64::PSEUDO_ALLOC), VirtGPR);
- // we create a PSEUDO_ALLOC (pseudo)instruction for now
-/*
- BuildMI(&BB, IA64::IDEF, 0, IA64::r1);
-
- // hmm:
- BuildMI(&BB, IA64::IDEF, 0, IA64::r12);
- BuildMI(&BB, IA64::IDEF, 0, IA64::rp);
- // ..hmm.
-
- BuildMI(&BB, IA64::MOV, 1, GP).addReg(IA64::r1);
-
- // hmm:
- BuildMI(&BB, IA64::MOV, 1, SP).addReg(IA64::r12);
- BuildMI(&BB, IA64::MOV, 1, RP).addReg(IA64::rp);
- // ..hmm.
-*/
-
- unsigned tempOffset=0;
-
- // if this is a varargs function, we simply lower llvm.va_start by
- // pointing to the first entry
- if(F.isVarArg()) {
- tempOffset=0;
- VarArgsFrameIndex = MFI->CreateFixedObject(8, tempOffset);
- }
-
- // here we actually do the moving of args, and store them to the stack
- // too if this is a varargs function:
- for (int i = 0; i < count && i < 8; ++i) {
- BuildMI(&BB, TII->get(argOpc[i]), argVreg[i]).addReg(argPreg[i]);
- if(F.isVarArg()) {
- // if this is a varargs function, we copy the input registers to the stack
- int FI = MFI->CreateFixedObject(8, tempOffset);
- tempOffset+=8; //XXX: is it safe to use r22 like this?
- BuildMI(&BB, TII->get(IA64::MOV), IA64::r22).addFrameIndex(FI);
- // FIXME: we should use st8.spill here, one day
- BuildMI(&BB, TII->get(IA64::ST8), IA64::r22).addReg(argPreg[i]);
- }
- }
-
- // Finally, inform the code generator which regs we return values in.
- // (see the ISD::RET: case in the instruction selector)
- switch (getValueType(F.getReturnType())) {
- default: assert(0 && "i have no idea where to return this type!");
- case MVT::isVoid: break;
- case MVT::i1:
- case MVT::i8:
- case MVT::i16:
- case MVT::i32:
- case MVT::i64:
- MF.getRegInfo().addLiveOut(IA64::r8);
- break;
- case MVT::f32:
- case MVT::f64:
- MF.getRegInfo().addLiveOut(IA64::F8);
- break;
- }
-
- return ArgValues;
-}
-
-std::pair<SDOperand, SDOperand>
-IA64TargetLowering::LowerCallTo(SDOperand Chain, const Type *RetTy,
- bool RetSExt, bool RetZExt,
- bool isVarArg, unsigned CallingConv,
- bool isTailCall, SDOperand Callee,
- ArgListTy &Args, SelectionDAG &DAG) {
-
- MachineFunction &MF = DAG.getMachineFunction();
-
- unsigned NumBytes = 16;
- unsigned outRegsUsed = 0;
-
- if (Args.size() > 8) {
- NumBytes += (Args.size() - 8) * 8;
- outRegsUsed = 8;
- } else {
- outRegsUsed = Args.size();
- }
-
- // FIXME? this WILL fail if we ever try to pass around an arg that
- // consumes more than a single output slot (a 'real' double, int128
- // some sort of aggregate etc.), as we'll underestimate how many 'outX'
- // registers we use. Hopefully, the assembler will notice.
- MF.getInfo<IA64FunctionInfo>()->outRegsUsed=
- std::max(outRegsUsed, MF.getInfo<IA64FunctionInfo>()->outRegsUsed);
-
- // keep stack frame 16-byte aligned
- // assert(NumBytes==((NumBytes+15) & ~15) &&
- // "stack frame not 16-byte aligned!");
- NumBytes = (NumBytes+15) & ~15;
-
- Chain = DAG.getCALLSEQ_START(Chain,DAG.getConstant(NumBytes, getPointerTy()));
-
- SDOperand StackPtr;
- std::vector<SDOperand> Stores;
- std::vector<SDOperand> Converts;
- std::vector<SDOperand> RegValuesToPass;
- unsigned ArgOffset = 16;
-
- for (unsigned i = 0, e = Args.size(); i != e; ++i)
- {
- SDOperand Val = Args[i].Node;
- MVT::ValueType ObjectVT = Val.getValueType();
- SDOperand ValToStore(0, 0), ValToConvert(0, 0);
- unsigned ObjSize=8;
- switch (ObjectVT) {
- default: assert(0 && "unexpected argument type!");
- case MVT::i1:
- case MVT::i8:
- case MVT::i16:
- case MVT::i32: {
- //promote to 64-bits, sign/zero extending based on type
- //of the argument
- ISD::NodeType ExtendKind = ISD::ANY_EXTEND;
- if (Args[i].isSExt)
- ExtendKind = ISD::SIGN_EXTEND;
- else if (Args[i].isZExt)
- ExtendKind = ISD::ZERO_EXTEND;
- Val = DAG.getNode(ExtendKind, MVT::i64, Val);
- // XXX: fall through
- }
- case MVT::i64:
- //ObjSize = 8;
- if(RegValuesToPass.size() >= 8) {
- ValToStore = Val;
- } else {
- RegValuesToPass.push_back(Val);
- }
- break;
- case MVT::f32:
- //promote to 64-bits
- Val = DAG.getNode(ISD::FP_EXTEND, MVT::f64, Val);
- // XXX: fall through
- case MVT::f64:
- if(RegValuesToPass.size() >= 8) {
- ValToStore = Val;
- } else {
- RegValuesToPass.push_back(Val);
- if(1 /* TODO: if(calling external or varadic function)*/ ) {
- ValToConvert = Val; // additionally pass this FP value as an int
- }
- }
- break;
- }
-
- if(ValToStore.Val) {
- if(!StackPtr.Val) {
- StackPtr = DAG.getRegister(IA64::r12, MVT::i64);
- }
- SDOperand PtrOff = DAG.getConstant(ArgOffset, getPointerTy());
- PtrOff = DAG.getNode(ISD::ADD, MVT::i64, StackPtr, PtrOff);
- Stores.push_back(DAG.getStore(Chain, ValToStore, PtrOff, NULL, 0));
- ArgOffset += ObjSize;
- }
-
- if(ValToConvert.Val) {
- Converts.push_back(DAG.getNode(IA64ISD::GETFD, MVT::i64, ValToConvert));
- }
- }
-
- // Emit all stores, make sure they occur before any copies into physregs.
- if (!Stores.empty())
- Chain = DAG.getNode(ISD::TokenFactor, MVT::Other, &Stores[0],Stores.size());
-
- static const unsigned IntArgRegs[] = {
- IA64::out0, IA64::out1, IA64::out2, IA64::out3,
- IA64::out4, IA64::out5, IA64::out6, IA64::out7
- };
-
- static const unsigned FPArgRegs[] = {
- IA64::F8, IA64::F9, IA64::F10, IA64::F11,
- IA64::F12, IA64::F13, IA64::F14, IA64::F15
- };
-
- SDOperand InFlag;
-
- // save the current GP, SP and RP : FIXME: do we need to do all 3 always?
- SDOperand GPBeforeCall = DAG.getCopyFromReg(Chain, IA64::r1, MVT::i64, InFlag);
- Chain = GPBeforeCall.getValue(1);
- InFlag = Chain.getValue(2);
- SDOperand SPBeforeCall = DAG.getCopyFromReg(Chain, IA64::r12, MVT::i64, InFlag);
- Chain = SPBeforeCall.getValue(1);
- InFlag = Chain.getValue(2);
- SDOperand RPBeforeCall = DAG.getCopyFromReg(Chain, IA64::rp, MVT::i64, InFlag);
- Chain = RPBeforeCall.getValue(1);
- InFlag = Chain.getValue(2);
-
- // Build a sequence of copy-to-reg nodes chained together with token chain
- // and flag operands which copy the outgoing integer args into regs out[0-7]
- // mapped 1:1 and the FP args into regs F8-F15 "lazily"
- // TODO: for performance, we should only copy FP args into int regs when we
- // know this is required (i.e. for varardic or external (unknown) functions)
-
- // first to the FP->(integer representation) conversions, these are
- // flagged for now, but shouldn't have to be (TODO)
- unsigned seenConverts = 0;
- for (unsigned i = 0, e = RegValuesToPass.size(); i != e; ++i) {
- if(MVT::isFloatingPoint(RegValuesToPass[i].getValueType())) {
- Chain = DAG.getCopyToReg(Chain, IntArgRegs[i], Converts[seenConverts++],
- InFlag);
- InFlag = Chain.getValue(1);
- }
- }
-
- // next copy args into the usual places, these are flagged
- unsigned usedFPArgs = 0;
- for (unsigned i = 0, e = RegValuesToPass.size(); i != e; ++i) {
- Chain = DAG.getCopyToReg(Chain,
- MVT::isInteger(RegValuesToPass[i].getValueType()) ?
- IntArgRegs[i] : FPArgRegs[usedFPArgs++], RegValuesToPass[i], InFlag);
- InFlag = Chain.getValue(1);
- }
-
- // If the callee is a GlobalAddress node (quite common, every direct call is)
- // turn it into a TargetGlobalAddress node so that legalize doesn't hack it.
-/*
- if (GlobalAddressSDNode *G = dyn_cast<GlobalAddressSDNode>(Callee)) {
- Callee = DAG.getTargetGlobalAddress(G->getGlobal(), MVT::i64);
- }
-*/
-
- std::vector<MVT::ValueType> NodeTys;
- std::vector<SDOperand> CallOperands;
- NodeTys.push_back(MVT::Other); // Returns a chain
- NodeTys.push_back(MVT::Flag); // Returns a flag for retval copy to use.
- CallOperands.push_back(Chain);
- CallOperands.push_back(Callee);
-
- // emit the call itself
- if (InFlag.Val)
- CallOperands.push_back(InFlag);
- else
- assert(0 && "this should never happen!\n");
-
- // to make way for a hack:
- Chain = DAG.getNode(IA64ISD::BRCALL, NodeTys,
- &CallOperands[0], CallOperands.size());
- InFlag = Chain.getValue(1);
-
- // restore the GP, SP and RP after the call
- Chain = DAG.getCopyToReg(Chain, IA64::r1, GPBeforeCall, InFlag);
- InFlag = Chain.getValue(1);
- Chain = DAG.getCopyToReg(Chain, IA64::r12, SPBeforeCall, InFlag);
- InFlag = Chain.getValue(1);
- Chain = DAG.getCopyToReg(Chain, IA64::rp, RPBeforeCall, InFlag);
- InFlag = Chain.getValue(1);
-
- std::vector<MVT::ValueType> RetVals;
- RetVals.push_back(MVT::Other);
- RetVals.push_back(MVT::Flag);
-
- MVT::ValueType RetTyVT = getValueType(RetTy);
- SDOperand RetVal;
- if (RetTyVT != MVT::isVoid) {
- switch (RetTyVT) {
- default: assert(0 && "Unknown value type to return!");
- case MVT::i1: { // bools are just like other integers (returned in r8)
- // we *could* fall through to the truncate below, but this saves a
- // few redundant predicate ops
- SDOperand boolInR8 = DAG.getCopyFromReg(Chain, IA64::r8, MVT::i64,InFlag);
- InFlag = boolInR8.getValue(2);
- Chain = boolInR8.getValue(1);
- SDOperand zeroReg = DAG.getCopyFromReg(Chain, IA64::r0, MVT::i64, InFlag);
- InFlag = zeroReg.getValue(2);
- Chain = zeroReg.getValue(1);
-
- RetVal = DAG.getSetCC(MVT::i1, boolInR8, zeroReg, ISD::SETNE);
- break;
- }
- case MVT::i8:
- case MVT::i16:
- case MVT::i32:
- RetVal = DAG.getCopyFromReg(Chain, IA64::r8, MVT::i64, InFlag);
- Chain = RetVal.getValue(1);
-
- // keep track of whether it is sign or zero extended (todo: bools?)
-/* XXX
- RetVal = DAG.getNode(RetTy->isSigned() ? ISD::AssertSext :ISD::AssertZext,
- MVT::i64, RetVal, DAG.getValueType(RetTyVT));
-*/
- RetVal = DAG.getNode(ISD::TRUNCATE, RetTyVT, RetVal);
- break;
- case MVT::i64:
- RetVal = DAG.getCopyFromReg(Chain, IA64::r8, MVT::i64, InFlag);
- Chain = RetVal.getValue(1);
- InFlag = RetVal.getValue(2); // XXX dead
- break;
- case MVT::f32:
- RetVal = DAG.getCopyFromReg(Chain, IA64::F8, MVT::f64, InFlag);
- Chain = RetVal.getValue(1);
- RetVal = DAG.getNode(ISD::TRUNCATE, MVT::f32, RetVal);
- break;
- case MVT::f64:
- RetVal = DAG.getCopyFromReg(Chain, IA64::F8, MVT::f64, InFlag);
- Chain = RetVal.getValue(1);
- InFlag = RetVal.getValue(2); // XXX dead
- break;
- }
- }
-
- Chain = DAG.getCALLSEQ_END(Chain,
- DAG.getConstant(NumBytes, getPointerTy()),
- DAG.getConstant(0, getPointerTy()),
- SDOperand());
- return std::make_pair(RetVal, Chain);
-}
-
-SDOperand IA64TargetLowering::
-LowerOperation(SDOperand Op, SelectionDAG &DAG) {
- switch (Op.getOpcode()) {
- default: assert(0 && "Should not custom lower this!");
- case ISD::GlobalTLSAddress:
- assert(0 && "TLS not implemented for IA64.");
- case ISD::RET: {
- SDOperand AR_PFSVal, Copy;
-
- switch(Op.getNumOperands()) {
- default:
- assert(0 && "Do not know how to return this many arguments!");
- abort();
- case 1:
- AR_PFSVal = DAG.getCopyFromReg(Op.getOperand(0), VirtGPR, MVT::i64);
- AR_PFSVal = DAG.getCopyToReg(AR_PFSVal.getValue(1), IA64::AR_PFS,
- AR_PFSVal);
- return DAG.getNode(IA64ISD::RET_FLAG, MVT::Other, AR_PFSVal);
- case 3: {
- // Copy the result into the output register & restore ar.pfs
- MVT::ValueType ArgVT = Op.getOperand(1).getValueType();
- unsigned ArgReg = MVT::isInteger(ArgVT) ? IA64::r8 : IA64::F8;
-
- AR_PFSVal = DAG.getCopyFromReg(Op.getOperand(0), VirtGPR, MVT::i64);
- Copy = DAG.getCopyToReg(AR_PFSVal.getValue(1), ArgReg, Op.getOperand(1),
- SDOperand());
- AR_PFSVal = DAG.getCopyToReg(Copy.getValue(0), IA64::AR_PFS, AR_PFSVal,
- Copy.getValue(1));
- return DAG.getNode(IA64ISD::RET_FLAG, MVT::Other,
- AR_PFSVal, AR_PFSVal.getValue(1));
- }
- }
- return SDOperand();
- }
- case ISD::VAARG: {
- MVT::ValueType VT = getPointerTy();
- const Value *SV = cast<SrcValueSDNode>(Op.getOperand(2))->getValue();
- SDOperand VAList = DAG.getLoad(VT, Op.getOperand(0), Op.getOperand(1),
- SV, 0);
- // Increment the pointer, VAList, to the next vaarg
- SDOperand VAIncr = DAG.getNode(ISD::ADD, VT, VAList,
- DAG.getConstant(MVT::getSizeInBits(VT)/8,
- VT));
- // Store the incremented VAList to the legalized pointer
- VAIncr = DAG.getStore(VAList.getValue(1), VAIncr,
- Op.getOperand(1), SV, 0);
- // Load the actual argument out of the pointer VAList
- return DAG.getLoad(Op.getValueType(), VAIncr, VAList, NULL, 0);
- }
- case ISD::VASTART: {
- // vastart just stores the address of the VarArgsFrameIndex slot into the
- // memory location argument.
- SDOperand FR = DAG.getFrameIndex(VarArgsFrameIndex, MVT::i64);
- const Value *SV = cast<SrcValueSDNode>(Op.getOperand(2))->getValue();
- return DAG.getStore(Op.getOperand(0), FR, Op.getOperand(1), SV, 0);
- }
- // Frame & Return address. Currently unimplemented
- case ISD::RETURNADDR: break;
- case ISD::FRAMEADDR: break;
- }
- return SDOperand();
-}
diff --git a/release_23/lib/Target/IA64/IA64ISelLowering.h b/release_23/lib/Target/IA64/IA64ISelLowering.h
deleted file mode 100644
index aef51f0f1157..000000000000
--- a/release_23/lib/Target/IA64/IA64ISelLowering.h
+++ /dev/null
@@ -1,74 +0,0 @@
-//===-- IA64ISelLowering.h - IA64 DAG Lowering Interface --------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines the interfaces that IA64 uses to lower LLVM code into a
-// selection DAG.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_TARGET_IA64_IA64ISELLOWERING_H
-#define LLVM_TARGET_IA64_IA64ISELLOWERING_H
-
-#include "llvm/Target/TargetLowering.h"
-#include "llvm/CodeGen/SelectionDAG.h"
-#include "IA64.h"
-
-namespace llvm {
- namespace IA64ISD {
- enum NodeType {
- // Start the numbering where the builting ops and target ops leave off.
- FIRST_NUMBER = ISD::BUILTIN_OP_END+IA64::INSTRUCTION_LIST_END,
-
- /// GETFD - the getf.d instruction takes a floating point operand and
- /// returns its 64-bit memory representation as an i64
- GETFD,
-
- // TODO: explain this hack
- BRCALL,
-
- // RET_FLAG - Return with a flag operand
- RET_FLAG
- };
- }
-
- class IA64TargetLowering : public TargetLowering {
- int VarArgsFrameIndex; // FrameIndex for start of varargs area.
- //int ReturnAddrIndex; // FrameIndex for return slot.
- unsigned GP, SP, RP; // FIXME - clean this mess up
- public:
- explicit IA64TargetLowering(TargetMachine &TM);
-
- unsigned VirtGPR; // this is public so it can be accessed in the selector
- // for ISD::RET. add an accessor instead? FIXME
- const char *getTargetNodeName(unsigned Opcode) const;
-
- /// getSetCCResultType: return ISD::SETCC's result type.
- virtual MVT::ValueType getSetCCResultType(const SDOperand &) const;
-
- /// LowerArguments - This hook must be implemented to indicate how we should
- /// lower the arguments for the specified function, into the specified DAG.
- virtual std::vector<SDOperand>
- LowerArguments(Function &F, SelectionDAG &DAG);
-
- /// LowerCallTo - This hook lowers an abstract call to a function into an
- /// actual call.
- virtual std::pair<SDOperand, SDOperand>
- LowerCallTo(SDOperand Chain, const Type *RetTy,
- bool RetSExt, bool RetZExt, bool isVarArg,
- unsigned CC, bool isTailCall,
- SDOperand Callee, ArgListTy &Args, SelectionDAG &DAG);
-
- /// LowerOperation - for custom lowering specific ops
- /// (currently, only "ret void")
- virtual SDOperand LowerOperation(SDOperand Op, SelectionDAG &DAG);
-
- };
-}
-
-#endif // LLVM_TARGET_IA64_IA64ISELLOWERING_H
diff --git a/release_23/lib/Target/IA64/IA64InstrBuilder.h b/release_23/lib/Target/IA64/IA64InstrBuilder.h
deleted file mode 100644
index 51b3744312ed..000000000000
--- a/release_23/lib/Target/IA64/IA64InstrBuilder.h
+++ /dev/null
@@ -1,52 +0,0 @@
-//===-- IA64PCInstrBuilder.h - Aids for building IA64 insts -----*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file exposes functions that may be used with BuildMI from the
-// MachineInstrBuilder.h file to simplify generating frame and constant pool
-// references.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef IA64_INSTRBUILDER_H
-#define IA64_INSTRBUILDER_H
-
-#include "llvm/CodeGen/MachineInstrBuilder.h"
-
-namespace llvm {
-
-/// addFrameReference - This function is used to add a reference to the base of
-/// an abstract object on the stack frame of the current function. This
-/// reference has base register as the FrameIndex offset until it is resolved.
-/// This allows a constant offset to be specified as well...
-///
-inline const MachineInstrBuilder&
-addFrameReference(const MachineInstrBuilder &MIB, int FI, int Offset = 0,
- bool mem = true) {
- if (mem)
- return MIB.addImm(Offset).addFrameIndex(FI);
- else
- return MIB.addFrameIndex(FI).addImm(Offset);
-}
-
-/// addConstantPoolReference - This function is used to add a reference to the
-/// base of a constant value spilled to the per-function constant pool. The
-/// reference has base register ConstantPoolIndex offset which is retained until
-/// either machine code emission or assembly output. This allows an optional
-/// offset to be added as well.
-///
-inline const MachineInstrBuilder&
-addConstantPoolReference(const MachineInstrBuilder &MIB, unsigned CPI,
- int Offset = 0) {
- return MIB.addImm(Offset).addConstantPoolIndex(CPI);
-}
-
-} // End llvm namespace
-
-#endif
-
diff --git a/release_23/lib/Target/IA64/IA64InstrFormats.td b/release_23/lib/Target/IA64/IA64InstrFormats.td
deleted file mode 100644
index c465880d3e1a..000000000000
--- a/release_23/lib/Target/IA64/IA64InstrFormats.td
+++ /dev/null
@@ -1,80 +0,0 @@
-//===- IA64InstrFormats.td - IA64 Instruction Formats --*- tablegen -*-=//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// - Warning: the stuff in here isn't really being used, so is mostly
-// junk. It'll get fixed as the JIT gets built.
-//
-//===----------------------------------------------------------------------===//
-
-//===----------------------------------------------------------------------===//
-// Instruction format superclass
-//===----------------------------------------------------------------------===//
-
-class InstIA64<bits<4> op, dag OOL, dag IOL, string asmstr> : Instruction {
- // IA64 instruction baseline
- field bits<41> Inst;
- let Namespace = "IA64";
- let OutOperandList = OOL;
- let InOperandList = IOL;
- let AsmString = asmstr;
-
- let Inst{40-37} = op;
-}
-
-//"Each Itanium instruction is categorized into one of six types."
-//We should have:
-// A, I, M, F, B, L+X
-
-class AForm<bits<4> opcode, bits<6> qpReg, dag OOL, dag IOL, string asmstr> :
- InstIA64<opcode, OOL, IOL, asmstr> {
-
- let Inst{5-0} = qpReg;
-}
-
-class AForm_DAG<bits<4> opcode, bits<6> qpReg, dag OOL, dag IOL, string asmstr,
- list<dag> pattern> :
- InstIA64<opcode, OOL, IOL, asmstr> {
-
- let Pattern = pattern;
- let Inst{5-0} = qpReg;
-}
-
-let isBranch = 1, isTerminator = 1 in
-class BForm<bits<4> opcode, bits<6> x6, bits<3> btype, dag OOL, dag IOL, string asmstr> :
- InstIA64<opcode, OOL, IOL, asmstr> {
-
- let Inst{32-27} = x6;
- let Inst{8-6} = btype;
-}
-
-class MForm<bits<4> opcode, bits<6> x6, dag OOL, dag IOL, string asmstr> :
- InstIA64<opcode, OOL, IOL, asmstr> {
- bits<7> Ra;
- bits<7> Rb;
- bits<16> disp;
-
- let Inst{35-30} = x6;
-// let Inst{20-16} = Rb;
- let Inst{15-0} = disp;
-}
-
-class RawForm<bits<4> opcode, bits<26> rest, dag OOL, dag IOL, string asmstr> :
- InstIA64<opcode, OOL, IOL, asmstr> {
- let Inst{25-0} = rest;
-}
-
-// Pseudo instructions.
-class PseudoInstIA64<dag OOL, dag IOL, string nm> : InstIA64<0, OOL, IOL, nm> {
-}
-
-class PseudoInstIA64_DAG<dag OOL, dag IOL, string nm, list<dag> pattern>
- : InstIA64<0, OOL, IOL, nm> {
- let Pattern = pattern;
-}
-
diff --git a/release_23/lib/Target/IA64/IA64InstrInfo.cpp b/release_23/lib/Target/IA64/IA64InstrInfo.cpp
deleted file mode 100644
index 2ba2c8fe1d6c..000000000000
--- a/release_23/lib/Target/IA64/IA64InstrInfo.cpp
+++ /dev/null
@@ -1,184 +0,0 @@
-//===- IA64InstrInfo.cpp - IA64 Instruction Information -----------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains the IA64 implementation of the TargetInstrInfo class.
-//
-//===----------------------------------------------------------------------===//
-
-#include "IA64InstrInfo.h"
-#include "IA64.h"
-#include "IA64InstrBuilder.h"
-#include "llvm/CodeGen/MachineInstrBuilder.h"
-#include "IA64GenInstrInfo.inc"
-using namespace llvm;
-
-IA64InstrInfo::IA64InstrInfo()
- : TargetInstrInfoImpl(IA64Insts, sizeof(IA64Insts)/sizeof(IA64Insts[0])),
- RI(*this) {
-}
-
-
-bool IA64InstrInfo::isMoveInstr(const MachineInstr& MI,
- unsigned& sourceReg,
- unsigned& destReg) const {
- unsigned oc = MI.getOpcode();
- if (oc == IA64::MOV || oc == IA64::FMOV) {
- // TODO: this doesn't detect predicate moves
- assert(MI.getNumOperands() >= 2 &&
- /* MI.getOperand(0).isRegister() &&
- MI.getOperand(1).isRegister() && */
- "invalid register-register move instruction");
- if( MI.getOperand(0).isRegister() &&
- MI.getOperand(1).isRegister() ) {
- // if both operands of the MOV/FMOV are registers, then
- // yes, this is a move instruction
- sourceReg = MI.getOperand(1).getReg();
- destReg = MI.getOperand(0).getReg();
- return true;
- }
- }
- return false; // we don't consider e.g. %regN = MOV <FrameIndex #x> a
- // move instruction
-}
-
-unsigned
-IA64InstrInfo::InsertBranch(MachineBasicBlock &MBB,MachineBasicBlock *TBB,
- MachineBasicBlock *FBB,
- const std::vector<MachineOperand> &Cond)const {
- // Can only insert uncond branches so far.
- assert(Cond.empty() && !FBB && TBB && "Can only handle uncond branches!");
- BuildMI(&MBB, get(IA64::BRL_NOTCALL)).addMBB(TBB);
- return 1;
-}
-
-void IA64InstrInfo::copyRegToReg(MachineBasicBlock &MBB,
- MachineBasicBlock::iterator MI,
- unsigned DestReg, unsigned SrcReg,
- const TargetRegisterClass *DestRC,
- const TargetRegisterClass *SrcRC) const {
- if (DestRC != SrcRC) {
- cerr << "Not yet supported!";
- abort();
- }
-
- if(DestRC == IA64::PRRegisterClass ) // if a bool, we use pseudocode
- // (SrcReg) DestReg = cmp.eq.unc(r0, r0)
- BuildMI(MBB, MI, get(IA64::PCMPEQUNC), DestReg)
- .addReg(IA64::r0).addReg(IA64::r0).addReg(SrcReg);
- else // otherwise, MOV works (for both gen. regs and FP regs)
- BuildMI(MBB, MI, get(IA64::MOV), DestReg).addReg(SrcReg);
-}
-
-void IA64InstrInfo::storeRegToStackSlot(MachineBasicBlock &MBB,
- MachineBasicBlock::iterator MI,
- unsigned SrcReg, bool isKill,
- int FrameIdx,
- const TargetRegisterClass *RC) const{
-
- if (RC == IA64::FPRegisterClass) {
- BuildMI(MBB, MI, get(IA64::STF_SPILL)).addFrameIndex(FrameIdx)
- .addReg(SrcReg, false, false, isKill);
- } else if (RC == IA64::GRRegisterClass) {
- BuildMI(MBB, MI, get(IA64::ST8)).addFrameIndex(FrameIdx)
- .addReg(SrcReg, false, false, isKill);
- } else if (RC == IA64::PRRegisterClass) {
- /* we use IA64::r2 as a temporary register for doing this hackery. */
- // first we load 0:
- BuildMI(MBB, MI, get(IA64::MOV), IA64::r2).addReg(IA64::r0);
- // then conditionally add 1:
- BuildMI(MBB, MI, get(IA64::CADDIMM22), IA64::r2).addReg(IA64::r2)
- .addImm(1).addReg(SrcReg, false, false, isKill);
- // and then store it to the stack
- BuildMI(MBB, MI, get(IA64::ST8)).addFrameIndex(FrameIdx).addReg(IA64::r2);
- } else assert(0 &&
- "sorry, I don't know how to store this sort of reg in the stack\n");
-}
-
-void IA64InstrInfo::storeRegToAddr(MachineFunction &MF, unsigned SrcReg,
- bool isKill,
- SmallVectorImpl<MachineOperand> &Addr,
- const TargetRegisterClass *RC,
- SmallVectorImpl<MachineInstr*> &NewMIs) const {
- unsigned Opc = 0;
- if (RC == IA64::FPRegisterClass) {
- Opc = IA64::STF8;
- } else if (RC == IA64::GRRegisterClass) {
- Opc = IA64::ST8;
- } else if (RC == IA64::PRRegisterClass) {
- Opc = IA64::ST1;
- } else {
- assert(0 &&
- "sorry, I don't know how to store this sort of reg\n");
- }
-
- MachineInstrBuilder MIB = BuildMI(get(Opc));
- for (unsigned i = 0, e = Addr.size(); i != e; ++i) {
- MachineOperand &MO = Addr[i];
- if (MO.isRegister())
- MIB.addReg(MO.getReg());
- else if (MO.isImmediate())
- MIB.addImm(MO.getImm());
- else
- MIB.addFrameIndex(MO.getIndex());
- }
- MIB.addReg(SrcReg, false, false, isKill);
- NewMIs.push_back(MIB);
- return;
-
-}
-
-void IA64InstrInfo::loadRegFromStackSlot(MachineBasicBlock &MBB,
- MachineBasicBlock::iterator MI,
- unsigned DestReg, int FrameIdx,
- const TargetRegisterClass *RC)const{
-
- if (RC == IA64::FPRegisterClass) {
- BuildMI(MBB, MI, get(IA64::LDF_FILL), DestReg).addFrameIndex(FrameIdx);
- } else if (RC == IA64::GRRegisterClass) {
- BuildMI(MBB, MI, get(IA64::LD8), DestReg).addFrameIndex(FrameIdx);
- } else if (RC == IA64::PRRegisterClass) {
- // first we load a byte from the stack into r2, our 'predicate hackery'
- // scratch reg
- BuildMI(MBB, MI, get(IA64::LD8), IA64::r2).addFrameIndex(FrameIdx);
- // then we compare it to zero. If it _is_ zero, compare-not-equal to
- // r0 gives us 0, which is what we want, so that's nice.
- BuildMI(MBB, MI, get(IA64::CMPNE), DestReg).addReg(IA64::r2).addReg(IA64::r0);
- } else assert(0 &&
- "sorry, I don't know how to load this sort of reg from the stack\n");
-}
-
-void IA64InstrInfo::loadRegFromAddr(MachineFunction &MF, unsigned DestReg,
- SmallVectorImpl<MachineOperand> &Addr,
- const TargetRegisterClass *RC,
- SmallVectorImpl<MachineInstr*> &NewMIs) const {
- unsigned Opc = 0;
- if (RC == IA64::FPRegisterClass) {
- Opc = IA64::LDF8;
- } else if (RC == IA64::GRRegisterClass) {
- Opc = IA64::LD8;
- } else if (RC == IA64::PRRegisterClass) {
- Opc = IA64::LD1;
- } else {
- assert(0 &&
- "sorry, I don't know how to store this sort of reg\n");
- }
-
- MachineInstrBuilder MIB = BuildMI(get(Opc), DestReg);
- for (unsigned i = 0, e = Addr.size(); i != e; ++i) {
- MachineOperand &MO = Addr[i];
- if (MO.isRegister())
- MIB.addReg(MO.getReg());
- else if (MO.isImmediate())
- MIB.addImm(MO.getImm());
- else
- MIB.addFrameIndex(MO.getIndex());
- }
- NewMIs.push_back(MIB);
- return;
-}
diff --git a/release_23/lib/Target/IA64/IA64InstrInfo.h b/release_23/lib/Target/IA64/IA64InstrInfo.h
deleted file mode 100644
index e5da6f1e25a4..000000000000
--- a/release_23/lib/Target/IA64/IA64InstrInfo.h
+++ /dev/null
@@ -1,72 +0,0 @@
-//===- IA64InstrInfo.h - IA64 Instruction Information ----------*- C++ -*- ===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains the IA64 implementation of the TargetInstrInfo class.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef IA64INSTRUCTIONINFO_H
-#define IA64INSTRUCTIONINFO_H
-
-#include "llvm/Target/TargetInstrInfo.h"
-#include "IA64RegisterInfo.h"
-
-namespace llvm {
-
-class IA64InstrInfo : public TargetInstrInfoImpl {
- const IA64RegisterInfo RI;
-public:
- IA64InstrInfo();
-
- /// getRegisterInfo - TargetInstrInfo is a superset of MRegister info. As
- /// such, whenever a client has an instance of instruction info, it should
- /// always be able to get register info as well (through this method).
- ///
- virtual const TargetRegisterInfo &getRegisterInfo() const { return RI; }
-
- //
- // Return true if the instruction is a register to register move and
- // leave the source and dest operands in the passed parameters.
- //
- virtual bool isMoveInstr(const MachineInstr& MI,
- unsigned& sourceReg,
- unsigned& destReg) const;
- virtual unsigned InsertBranch(MachineBasicBlock &MBB, MachineBasicBlock *TBB,
- MachineBasicBlock *FBB,
- const std::vector<MachineOperand> &Cond) const;
- virtual void copyRegToReg(MachineBasicBlock &MBB,
- MachineBasicBlock::iterator MI,
- unsigned DestReg, unsigned SrcReg,
- const TargetRegisterClass *DestRC,
- const TargetRegisterClass *SrcRC) const;
- virtual void storeRegToStackSlot(MachineBasicBlock &MBB,
- MachineBasicBlock::iterator MI,
- unsigned SrcReg, bool isKill, int FrameIndex,
- const TargetRegisterClass *RC) const;
-
- virtual void storeRegToAddr(MachineFunction &MF, unsigned SrcReg, bool isKill,
- SmallVectorImpl<MachineOperand> &Addr,
- const TargetRegisterClass *RC,
- SmallVectorImpl<MachineInstr*> &NewMIs) const;
-
- virtual void loadRegFromStackSlot(MachineBasicBlock &MBB,
- MachineBasicBlock::iterator MI,
- unsigned DestReg, int FrameIndex,
- const TargetRegisterClass *RC) const;
-
- virtual void loadRegFromAddr(MachineFunction &MF, unsigned DestReg,
- SmallVectorImpl<MachineOperand> &Addr,
- const TargetRegisterClass *RC,
- SmallVectorImpl<MachineInstr*> &NewMIs) const;
-};
-
-} // End llvm namespace
-
-#endif
-
diff --git a/release_23/lib/Target/IA64/IA64InstrInfo.td b/release_23/lib/Target/IA64/IA64InstrInfo.td
deleted file mode 100644
index c905d3004e67..000000000000
--- a/release_23/lib/Target/IA64/IA64InstrInfo.td
+++ /dev/null
@@ -1,751 +0,0 @@
-//===- IA64InstrInfo.td - Describe the IA64 Instruction Set -----*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file describes the IA64 instruction set, defining the instructions, and
-// properties of the instructions which are needed for code generation, machine
-// code emission, and analysis.
-//
-//===----------------------------------------------------------------------===//
-
-include "IA64InstrFormats.td"
-
-//===----------------------------------------------------------------------===//
-// IA-64 specific DAG Nodes.
-//
-
-def IA64getfd : SDNode<"IA64ISD::GETFD", SDTFPToIntOp, []>;
-
-def retflag : SDNode<"IA64ISD::RET_FLAG", SDTNone,
- [SDNPHasChain, SDNPOptInFlag]>;
-
-//===---------
-// Instruction types
-
-class isA { bit A=1; } // I or M unit
-class isM { bit M=1; } // M unit
-class isI { bit I=1; } // I unit
-class isB { bit B=1; } // B unit
-class isF { bit F=1; } // F unit
-class isLX { bit LX=1; } // I/B
-
-//===---------
-
-def u2imm : Operand<i8>;
-def u6imm : Operand<i8>;
-def s8imm : Operand<i8> {
- let PrintMethod = "printS8ImmOperand";
-}
-def s14imm : Operand<i64> {
- let PrintMethod = "printS14ImmOperand";
-}
-def s22imm : Operand<i64> {
- let PrintMethod = "printS22ImmOperand";
-}
-def u64imm : Operand<i64> {
- let PrintMethod = "printU64ImmOperand";
-}
-def s64imm : Operand<i64> {
- let PrintMethod = "printS64ImmOperand";
-}
-
-let PrintMethod = "printGlobalOperand" in
- def globaladdress : Operand<i64>;
-
-// the asmprinter needs to know about calls
-let PrintMethod = "printCallOperand" in
- def calltarget : Operand<i64>;
-
-/* new daggy action!!! */
-
-def is32ones : PatLeaf<(i64 imm), [{
- // is32ones predicate - True if the immediate is 0x00000000FFFFFFFF
- // Used to create ZXT4s appropriately
- uint64_t v = (uint64_t)N->getValue();
- return (v == 0x00000000FFFFFFFFLL);
-}]>;
-
-// isMIXable predicates - True if the immediate is
-// 0xFF00FF00FF00FF00, 0x00FF00FF00FF00FF
-// etc, through 0x00000000FFFFFFFF
-// Used to test for the suitability of mix*
-def isMIX1Lable: PatLeaf<(i64 imm), [{
- return((uint64_t)N->getValue()==0xFF00FF00FF00FF00LL);
-}]>;
-def isMIX1Rable: PatLeaf<(i64 imm), [{
- return((uint64_t)N->getValue()==0x00FF00FF00FF00FFLL);
-}]>;
-def isMIX2Lable: PatLeaf<(i64 imm), [{
- return((uint64_t)N->getValue()==0xFFFF0000FFFF0000LL);
-}]>;
-def isMIX2Rable: PatLeaf<(i64 imm), [{
- return((uint64_t)N->getValue()==0x0000FFFF0000FFFFLL);
-}]>;
-def isMIX4Lable: PatLeaf<(i64 imm), [{
- return((uint64_t)N->getValue()==0xFFFFFFFF00000000LL);
-}]>;
-def isMIX4Rable: PatLeaf<(i64 imm), [{
- return((uint64_t)N->getValue()==0x00000000FFFFFFFFLL);
-}]>;
-
-def isSHLADDimm: PatLeaf<(i64 imm), [{
- // isSHLADDimm predicate - True if the immediate is exactly 1, 2, 3 or 4
- // - 0 is *not* okay.
- // Used to create shladd instructions appropriately
- int64_t v = (int64_t)N->getValue();
- return (v >= 1 && v <= 4);
-}]>;
-
-def immSExt14 : PatLeaf<(i64 imm), [{
- // immSExt14 predicate - True if the immediate fits in a 14-bit sign extended
- // field. Used by instructions like 'adds'.
- int64_t v = (int64_t)N->getValue();
- return (v <= 8191 && v >= -8192);
-}]>;
-
-// imm64 predicate - True if the immediate fits in a 64-bit
-// field - i.e., true. used to keep movl happy
-def imm64 : PatLeaf<(i64 imm)>;
-
-def ADD : AForm_DAG<0x03, 0x0b, (outs GR:$dst), (ins GR:$src1, GR:$src2),
- "add $dst = $src1, $src2",
- [(set GR:$dst, (add GR:$src1, GR:$src2))]>, isA;
-
-def ADD1 : AForm_DAG<0x03, 0x0b, (outs GR:$dst), (ins GR:$src1, GR:$src2),
- "add $dst = $src1, $src2, 1",
- [(set GR:$dst, (add (add GR:$src1, GR:$src2), 1))]>, isA;
-
-def ADDS : AForm_DAG<0x03, 0x0b, (outs GR:$dst), (ins GR:$src1, s14imm:$imm),
- "adds $dst = $imm, $src1",
- [(set GR:$dst, (add GR:$src1, immSExt14:$imm))]>, isA;
-
-def MOVL : AForm_DAG<0x03, 0x0b, (outs GR:$dst), (ins s64imm:$imm),
- "movl $dst = $imm",
- [(set GR:$dst, imm64:$imm)]>, isLX;
-
-def ADDL_GA : AForm_DAG<0x03, 0x0b, (outs GR:$dst), (ins GR:$src1, globaladdress:$imm),
- "addl $dst = $imm, $src1",
- []>, isA;
-
-// hmm
-def ADDL_EA : AForm_DAG<0x03, 0x0b, (outs GR:$dst), (ins GR:$src1, calltarget:$imm),
- "addl $dst = $imm, $src1",
- []>, isA;
-
-def SUB : AForm_DAG<0x03, 0x0b, (outs GR:$dst), (ins GR:$src1, GR:$src2),
- "sub $dst = $src1, $src2",
- [(set GR:$dst, (sub GR:$src1, GR:$src2))]>, isA;
-
-def SUB1 : AForm_DAG<0x03, 0x0b, (outs GR:$dst), (ins GR:$src1, GR:$src2),
- "sub $dst = $src1, $src2, 1",
- [(set GR:$dst, (add (sub GR: $src1, GR:$src2), -1))]>, isA;
-
-let isTwoAddress = 1 in {
-def TPCADDIMM22 : AForm<0x03, 0x0b,
- (outs GR:$dst), (ins GR:$src1, s22imm:$imm, PR:$qp),
- "($qp) add $dst = $imm, $dst">, isA;
-def TPCADDS : AForm_DAG<0x03, 0x0b,
- (outs GR:$dst), (ins GR:$src1, s14imm:$imm, PR:$qp),
- "($qp) adds $dst = $imm, $dst",
- []>, isA;
-def TPCMPIMM8NE : AForm<0x03, 0x0b,
- (outs PR:$dst), (ins PR:$src1, s22imm:$imm, GR:$src2, PR:$qp),
- "($qp) cmp.ne $dst , p0 = $imm, $src2">, isA;
-}
-
-// zero extend a bool (predicate reg) into an integer reg
-def ZXTb : Pat<(zext PR:$src),
- (TPCADDIMM22 (ADDS r0, 0), 1, PR:$src)>;
-def AXTb : Pat<(anyext PR:$src),
- (TPCADDIMM22 (ADDS r0, 0), 1, PR:$src)>;
-
-// normal sign/zero-extends
-def SXT1 : AForm_DAG<0x03, 0x0b, (outs GR:$dst), (ins GR:$src), "sxt1 $dst = $src",
- [(set GR:$dst, (sext_inreg GR:$src, i8))]>, isI;
-def ZXT1 : AForm_DAG<0x03, 0x0b, (outs GR:$dst), (ins GR:$src), "zxt1 $dst = $src",
- [(set GR:$dst, (and GR:$src, 255))]>, isI;
-def SXT2 : AForm_DAG<0x03, 0x0b, (outs GR:$dst), (ins GR:$src), "sxt2 $dst = $src",
- [(set GR:$dst, (sext_inreg GR:$src, i16))]>, isI;
-def ZXT2 : AForm_DAG<0x03, 0x0b, (outs GR:$dst), (ins GR:$src), "zxt2 $dst = $src",
- [(set GR:$dst, (and GR:$src, 65535))]>, isI;
-def SXT4 : AForm_DAG<0x03, 0x0b, (outs GR:$dst), (ins GR:$src), "sxt4 $dst = $src",
- [(set GR:$dst, (sext_inreg GR:$src, i32))]>, isI;
-def ZXT4 : AForm_DAG<0x03, 0x0b, (outs GR:$dst), (ins GR:$src), "zxt4 $dst = $src",
- [(set GR:$dst, (and GR:$src, is32ones))]>, isI;
-
-// fixme: shrs vs shru?
-def MIX1L : AForm_DAG<0x03, 0x0b, (outs GR:$dst), (ins GR:$src1, GR:$src2),
- "mix1.l $dst = $src1, $src2",
- [(set GR:$dst, (or (and GR:$src1, isMIX1Lable),
- (and (srl GR:$src2, (i64 8)), isMIX1Lable)))]>, isI;
-
-def MIX2L : AForm_DAG<0x03, 0x0b, (outs GR:$dst), (ins GR:$src1, GR:$src2),
- "mix2.l $dst = $src1, $src2",
- [(set GR:$dst, (or (and GR:$src1, isMIX2Lable),
- (and (srl GR:$src2, (i64 16)), isMIX2Lable)))]>, isI;
-
-def MIX4L : AForm_DAG<0x03, 0x0b, (outs GR:$dst), (ins GR:$src1, GR:$src2),
- "mix4.l $dst = $src1, $src2",
- [(set GR:$dst, (or (and GR:$src1, isMIX4Lable),
- (and (srl GR:$src2, (i64 32)), isMIX4Lable)))]>, isI;
-
-def MIX1R : AForm_DAG<0x03, 0x0b, (outs GR:$dst), (ins GR:$src1, GR:$src2),
- "mix1.r $dst = $src1, $src2",
- [(set GR:$dst, (or (and (shl GR:$src1, (i64 8)), isMIX1Rable),
- (and GR:$src2, isMIX1Rable)))]>, isI;
-
-def MIX2R : AForm_DAG<0x03, 0x0b, (outs GR:$dst), (ins GR:$src1, GR:$src2),
- "mix2.r $dst = $src1, $src2",
- [(set GR:$dst, (or (and (shl GR:$src1, (i64 16)), isMIX2Rable),
- (and GR:$src2, isMIX2Rable)))]>, isI;
-
-def MIX4R : AForm_DAG<0x03, 0x0b, (outs GR:$dst), (ins GR:$src1, GR:$src2),
- "mix4.r $dst = $src1, $src2",
- [(set GR:$dst, (or (and (shl GR:$src1, (i64 32)), isMIX4Rable),
- (and GR:$src2, isMIX4Rable)))]>, isI;
-
-def GETFSIGD : AForm_DAG<0x03, 0x0b, (outs GR:$dst), (ins FP:$src),
- "getf.sig $dst = $src",
- []>, isM;
-
-def SETFSIGD : AForm_DAG<0x03, 0x0b, (outs FP:$dst), (ins GR:$src),
- "setf.sig $dst = $src",
- []>, isM;
-
-def XMALD : AForm_DAG<0x03, 0x0b, (outs FP:$dst), (ins FP:$src1, FP:$src2, FP:$src3),
- "xma.l $dst = $src1, $src2, $src3",
- []>, isF;
-def XMAHD : AForm_DAG<0x03, 0x0b, (outs FP:$dst), (ins FP:$src1, FP:$src2, FP:$src3),
- "xma.h $dst = $src1, $src2, $src3",
- []>, isF;
-def XMAHUD : AForm_DAG<0x03, 0x0b, (outs FP:$dst), (ins FP:$src1, FP:$src2, FP:$src3),
- "xma.hu $dst = $src1, $src2, $src3",
- []>, isF;
-
-// pseudocode for integer multiplication
-def : Pat<(mul GR:$src1, GR:$src2),
- (GETFSIGD (XMALD (SETFSIGD GR:$src1), (SETFSIGD GR:$src2), F0))>;
-def : Pat<(mulhs GR:$src1, GR:$src2),
- (GETFSIGD (XMAHD (SETFSIGD GR:$src1), (SETFSIGD GR:$src2), F0))>;
-def : Pat<(mulhu GR:$src1, GR:$src2),
- (GETFSIGD (XMAHUD (SETFSIGD GR:$src1), (SETFSIGD GR:$src2), F0))>;
-
-// TODO: addp4 (addp4 dst = src, r0 is a 32-bit add)
-// has imm form, too
-
-// def ADDS : AForm<0x03, 0x0b, (outs GR:$dst), (ins GR:$src1, s14imm:$imm),
-// "adds $dst = $imm, $src1">;
-
-def AND : AForm_DAG<0x03, 0x0b, (outs GR:$dst), (ins GR:$src1, GR:$src2),
- "and $dst = $src1, $src2",
- [(set GR:$dst, (and GR:$src1, GR:$src2))]>, isA;
-def ANDCM : AForm_DAG<0x03, 0x0b, (outs GR:$dst), (ins GR:$src1, GR:$src2),
- "andcm $dst = $src1, $src2",
- [(set GR:$dst, (and GR:$src1, (not GR:$src2)))]>, isA;
-// TODO: and/andcm/or/xor/add/sub/shift immediate forms
-def OR : AForm_DAG<0x03, 0x0b, (outs GR:$dst), (ins GR:$src1, GR:$src2),
- "or $dst = $src1, $src2",
- [(set GR:$dst, (or GR:$src1, GR:$src2))]>, isA;
-
-def pOR : AForm<0x03, 0x0b, (outs GR:$dst), (ins GR:$src1, GR:$src2, PR:$qp),
- "($qp) or $dst = $src1, $src2">, isA;
-
-// the following are all a bit unfortunate: we throw away the complement
-// of the compare!
-def CMPEQ : AForm_DAG<0x03, 0x0b, (outs PR:$dst), (ins GR:$src1, GR:$src2),
- "cmp.eq $dst, p0 = $src1, $src2",
- [(set PR:$dst, (seteq GR:$src1, GR:$src2))]>, isA;
-def CMPGT : AForm_DAG<0x03, 0x0b, (outs PR:$dst), (ins GR:$src1, GR:$src2),
- "cmp.gt $dst, p0 = $src1, $src2",
- [(set PR:$dst, (setgt GR:$src1, GR:$src2))]>, isA;
-def CMPGE : AForm_DAG<0x03, 0x0b, (outs PR:$dst), (ins GR:$src1, GR:$src2),
- "cmp.ge $dst, p0 = $src1, $src2",
- [(set PR:$dst, (setge GR:$src1, GR:$src2))]>, isA;
-def CMPLT : AForm_DAG<0x03, 0x0b, (outs PR:$dst), (ins GR:$src1, GR:$src2),
- "cmp.lt $dst, p0 = $src1, $src2",
- [(set PR:$dst, (setlt GR:$src1, GR:$src2))]>, isA;
-def CMPLE : AForm_DAG<0x03, 0x0b, (outs PR:$dst), (ins GR:$src1, GR:$src2),
- "cmp.le $dst, p0 = $src1, $src2",
- [(set PR:$dst, (setle GR:$src1, GR:$src2))]>, isA;
-def CMPNE : AForm_DAG<0x03, 0x0b, (outs PR:$dst), (ins GR:$src1, GR:$src2),
- "cmp.ne $dst, p0 = $src1, $src2",
- [(set PR:$dst, (setne GR:$src1, GR:$src2))]>, isA;
-def CMPLTU: AForm_DAG<0x03, 0x0b, (outs PR:$dst), (ins GR:$src1, GR:$src2),
- "cmp.ltu $dst, p0 = $src1, $src2",
- [(set PR:$dst, (setult GR:$src1, GR:$src2))]>, isA;
-def CMPGTU: AForm_DAG<0x03, 0x0b, (outs PR:$dst), (ins GR:$src1, GR:$src2),
- "cmp.gtu $dst, p0 = $src1, $src2",
- [(set PR:$dst, (setugt GR:$src1, GR:$src2))]>, isA;
-def CMPLEU: AForm_DAG<0x03, 0x0b, (outs PR:$dst), (ins GR:$src1, GR:$src2),
- "cmp.leu $dst, p0 = $src1, $src2",
- [(set PR:$dst, (setule GR:$src1, GR:$src2))]>, isA;
-def CMPGEU: AForm_DAG<0x03, 0x0b, (outs PR:$dst), (ins GR:$src1, GR:$src2),
- "cmp.geu $dst, p0 = $src1, $src2",
- [(set PR:$dst, (setuge GR:$src1, GR:$src2))]>, isA;
-
-// and we do the whole thing again for FP compares!
-def FCMPEQ : AForm_DAG<0x03, 0x0b, (outs PR:$dst), (ins FP:$src1, FP:$src2),
- "fcmp.eq $dst, p0 = $src1, $src2",
- [(set PR:$dst, (seteq FP:$src1, FP:$src2))]>, isF;
-def FCMPGT : AForm_DAG<0x03, 0x0b, (outs PR:$dst), (ins FP:$src1, FP:$src2),
- "fcmp.gt $dst, p0 = $src1, $src2",
- [(set PR:$dst, (setgt FP:$src1, FP:$src2))]>, isF;
-def FCMPGE : AForm_DAG<0x03, 0x0b, (outs PR:$dst), (ins FP:$src1, FP:$src2),
- "fcmp.ge $dst, p0 = $src1, $src2",
- [(set PR:$dst, (setge FP:$src1, FP:$src2))]>, isF;
-def FCMPLT : AForm_DAG<0x03, 0x0b, (outs PR:$dst), (ins FP:$src1, FP:$src2),
- "fcmp.lt $dst, p0 = $src1, $src2",
- [(set PR:$dst, (setlt FP:$src1, FP:$src2))]>, isF;
-def FCMPLE : AForm_DAG<0x03, 0x0b, (outs PR:$dst), (ins FP:$src1, FP:$src2),
- "fcmp.le $dst, p0 = $src1, $src2",
- [(set PR:$dst, (setle FP:$src1, FP:$src2))]>, isF;
-def FCMPNE : AForm_DAG<0x03, 0x0b, (outs PR:$dst), (ins FP:$src1, FP:$src2),
- "fcmp.neq $dst, p0 = $src1, $src2",
- [(set PR:$dst, (setne FP:$src1, FP:$src2))]>, isF;
-def FCMPLTU: AForm_DAG<0x03, 0x0b, (outs PR:$dst), (ins FP:$src1, FP:$src2),
- "fcmp.lt $dst, p0 = $src1, $src2",
- [(set PR:$dst, (setult FP:$src1, FP:$src2))]>, isF;
-def FCMPGTU: AForm_DAG<0x03, 0x0b, (outs PR:$dst), (ins FP:$src1, FP:$src2),
- "fcmp.gt $dst, p0 = $src1, $src2",
- [(set PR:$dst, (setugt FP:$src1, FP:$src2))]>, isF;
-def FCMPLEU: AForm_DAG<0x03, 0x0b, (outs PR:$dst), (ins FP:$src1, FP:$src2),
- "fcmp.le $dst, p0 = $src1, $src2",
- [(set PR:$dst, (setule FP:$src1, FP:$src2))]>, isF;
-def FCMPGEU: AForm_DAG<0x03, 0x0b, (outs PR:$dst), (ins FP:$src1, FP:$src2),
- "fcmp.ge $dst, p0 = $src1, $src2",
- [(set PR:$dst, (setuge FP:$src1, FP:$src2))]>, isF;
-
-def PCMPEQUNCR0R0 : AForm<0x03, 0x0b, (outs PR:$dst), (ins PR:$qp),
- "($qp) cmp.eq.unc $dst, p0 = r0, r0">, isA;
-
-def : Pat<(trunc GR:$src), // truncate i64 to i1
- (CMPNE GR:$src, r0)>; // $src!=0? If so, PR:$dst=true
-
-let isTwoAddress=1 in {
- def TPCMPEQR0R0 : AForm<0x03, 0x0b, (outs PR:$dst), (ins PR:$bogus, PR:$qp),
- "($qp) cmp.eq $dst, p0 = r0, r0">, isA;
- def TPCMPNER0R0 : AForm<0x03, 0x0b, (outs PR:$dst), (ins PR:$bogus, PR:$qp),
- "($qp) cmp.ne $dst, p0 = r0, r0">, isA;
-}
-
-/* our pseudocode for OR on predicates is:
-pC = pA OR pB
--------------
-(pA) cmp.eq.unc pC,p0 = r0,r0 // pC = pA
- ;;
-(pB) cmp.eq pC,p0 = r0,r0 // if (pB) pC = 1 */
-
-def bOR : Pat<(or PR:$src1, PR:$src2),
- (TPCMPEQR0R0 (PCMPEQUNCR0R0 PR:$src1), PR:$src2)>;
-
-/* our pseudocode for AND on predicates is:
- *
-(pA) cmp.eq.unc pC,p0 = r0,r0 // pC = pA
- cmp.eq pTemp,p0 = r0,r0 // pTemp = NOT pB
- ;;
-(pB) cmp.ne pTemp,p0 = r0,r0
- ;;
-(pTemp)cmp.ne pC,p0 = r0,r0 // if (NOT pB) pC = 0 */
-
-def bAND : Pat<(and PR:$src1, PR:$src2),
- ( TPCMPNER0R0 (PCMPEQUNCR0R0 PR:$src1),
- (TPCMPNER0R0 (CMPEQ r0, r0), PR:$src2) )>;
-
-/* one possible routine for XOR on predicates is:
-
- // Compute px = py ^ pz
- // using sum of products: px = (py & !pz) | (pz & !py)
- // Uses 5 instructions in 3 cycles.
- // cycle 1
-(pz) cmp.eq.unc px = r0, r0 // px = pz
-(py) cmp.eq.unc pt = r0, r0 // pt = py
- ;;
- // cycle 2
-(pt) cmp.ne.and px = r0, r0 // px = px & !pt (px = pz & !pt)
-(pz) cmp.ne.and pt = r0, r0 // pt = pt & !pz
- ;;
- } { .mmi
- // cycle 3
-(pt) cmp.eq.or px = r0, r0 // px = px | pt
-
-*** Another, which we use here, requires one scratch GR. it is:
-
- mov rt = 0 // initialize rt off critical path
- ;;
-
- // cycle 1
-(pz) cmp.eq.unc px = r0, r0 // px = pz
-(pz) mov rt = 1 // rt = pz
- ;;
- // cycle 2
-(py) cmp.ne px = 1, rt // if (py) px = !pz
-
-.. these routines kindly provided by Jim Hull
-*/
-
-def bXOR : Pat<(xor PR:$src1, PR:$src2),
- (TPCMPIMM8NE (PCMPEQUNCR0R0 PR:$src2), 1,
- (TPCADDS (ADDS r0, 0), 1, PR:$src2),
- PR:$src1)>;
-
-def XOR : AForm_DAG<0x03, 0x0b, (outs GR:$dst), (ins GR:$src1, GR:$src2),
- "xor $dst = $src1, $src2",
- [(set GR:$dst, (xor GR:$src1, GR:$src2))]>, isA;
-
-def SHLADD: AForm_DAG<0x03, 0x0b, (outs GR:$dst), (ins GR:$src1,s64imm:$imm,GR:$src2),
- "shladd $dst = $src1, $imm, $src2",
- [(set GR:$dst, (add GR:$src2, (shl GR:$src1, isSHLADDimm:$imm)))]>, isA;
-
-def SHL : AForm_DAG<0x03, 0x0b, (outs GR:$dst), (ins GR:$src1, GR:$src2),
- "shl $dst = $src1, $src2",
- [(set GR:$dst, (shl GR:$src1, GR:$src2))]>, isI;
-
-def SHRU : AForm_DAG<0x03, 0x0b, (outs GR:$dst), (ins GR:$src1, GR:$src2),
- "shr.u $dst = $src1, $src2",
- [(set GR:$dst, (srl GR:$src1, GR:$src2))]>, isI;
-
-def SHRS : AForm_DAG<0x03, 0x0b, (outs GR:$dst), (ins GR:$src1, GR:$src2),
- "shr $dst = $src1, $src2",
- [(set GR:$dst, (sra GR:$src1, GR:$src2))]>, isI;
-
-def MOV : AForm<0x03, 0x0b, (outs GR:$dst), (ins GR:$src), "mov $dst = $src">, isA;
-def FMOV : AForm<0x03, 0x0b, (outs FP:$dst), (ins FP:$src),
- "mov $dst = $src">, isF; // XXX: there _is_ no fmov
-def PMOV : AForm<0x03, 0x0b, (outs GR:$dst), (ins GR:$src, PR:$qp),
- "($qp) mov $dst = $src">, isA;
-
-def SPILL_ALL_PREDICATES_TO_GR : AForm<0x03, 0x0b, (outs GR:$dst), (ins),
- "mov $dst = pr">, isI;
-def FILL_ALL_PREDICATES_FROM_GR : AForm<0x03, 0x0b, (outs), (ins GR:$src),
- "mov pr = $src">, isI;
-
-let isTwoAddress = 1 in {
- def CMOV : AForm<0x03, 0x0b, (outs GR:$dst), (ins GR:$src2, GR:$src, PR:$qp),
- "($qp) mov $dst = $src">, isA;
-}
-
-def PFMOV : AForm<0x03, 0x0b, (outs FP:$dst), (ins FP:$src, PR:$qp),
- "($qp) mov $dst = $src">, isF;
-
-let isTwoAddress = 1 in {
- def CFMOV : AForm<0x03, 0x0b, (outs FP:$dst), (ins FP:$src2, FP:$src, PR:$qp),
- "($qp) mov $dst = $src">, isF;
-}
-
-def SELECTINT : Pat<(select PR:$which, GR:$src1, GR:$src2),
- (CMOV (MOV GR:$src2), GR:$src1, PR:$which)>; // note order!
-def SELECTFP : Pat<(select PR:$which, FP:$src1, FP:$src2),
- (CFMOV (FMOV FP:$src2), FP:$src1, PR:$which)>; // note order!
-// TODO: can do this faster, w/o using any integer regs (see pattern isel)
-def SELECTBOOL : Pat<(select PR:$which, PR:$src1, PR:$src2), // note order!
- (CMPNE (CMOV
- (MOV (TPCADDIMM22 (ADDS r0, 0), 1, PR:$src2)),
- (TPCADDIMM22 (ADDS r0, 0), 1, PR:$src1), PR:$which), r0)>;
-
-// load constants of various sizes // FIXME: prettyprint -ve constants
-def : Pat<(i64 immSExt14:$imm), (ADDS r0, immSExt14:$imm)>;
-def : Pat<(i1 -1), (CMPEQ r0, r0)>; // TODO: this should just be a ref to p0
-def : Pat<(i1 0), (CMPNE r0, r0)>; // TODO: any instruction actually *using*
- // this predicate should be killed!
-
-// TODO: support postincrement (reg, imm9) loads+stores - this needs more
-// tablegen support
-
-def IUSE : PseudoInstIA64<(outs), (ins variable_ops), "// IUSE">;
-def ADJUSTCALLSTACKUP : PseudoInstIA64<(outs), (ins variable_ops),
- "// ADJUSTCALLSTACKUP">;
-def ADJUSTCALLSTACKDOWN : PseudoInstIA64<(outs), (ins variable_ops),
- "// ADJUSTCALLSTACKDOWN">;
-def PSEUDO_ALLOC : PseudoInstIA64<(outs), (ins GR:$foo), "// PSEUDO_ALLOC">;
-
-def ALLOC : AForm<0x03, 0x0b,
- (outs GR:$dst), (ins i8imm:$inputs, i8imm:$locals, i8imm:$outputs, i8imm:$rotating),
- "alloc $dst = ar.pfs,$inputs,$locals,$outputs,$rotating">, isM;
-
-let isTwoAddress = 1 in {
- def TCMPNE : AForm<0x03, 0x0b,
- (outs PR:$dst), (ins PR:$src2, GR:$src3, GR:$src4),
- "cmp.ne $dst, p0 = $src3, $src4">, isA;
-
- def TPCMPEQOR : AForm<0x03, 0x0b,
- (outs PR:$dst), (ins PR:$src2, GR:$src3, GR:$src4, PR:$qp),
- "($qp) cmp.eq.or $dst, p0 = $src3, $src4">, isA;
-
- def TPCMPNE : AForm<0x03, 0x0b,
- (outs PR:$dst), (ins PR:$src2, GR:$src3, GR:$src4, PR:$qp),
- "($qp) cmp.ne $dst, p0 = $src3, $src4">, isA;
-
- def TPCMPEQ : AForm<0x03, 0x0b,
- (outs PR:$dst), (ins PR:$src2, GR:$src3, GR:$src4, PR:$qp),
- "($qp) cmp.eq $dst, p0 = $src3, $src4">, isA;
-}
-
-def MOVSIMM14 : AForm<0x03, 0x0b, (outs GR:$dst), (ins s14imm:$imm),
- "mov $dst = $imm">, isA;
-def MOVSIMM22 : AForm<0x03, 0x0b, (outs GR:$dst), (ins s22imm:$imm),
- "mov $dst = $imm">, isA;
-def MOVLIMM64 : AForm<0x03, 0x0b, (outs GR:$dst), (ins s64imm:$imm),
- "movl $dst = $imm">, isLX;
-
-def SHLI : AForm<0x03, 0x0b, (outs GR:$dst), (ins GR:$src1, u6imm:$imm),
- "shl $dst = $src1, $imm">, isI;
-def SHRUI : AForm<0x03, 0x0b, (outs GR:$dst), (ins GR:$src1, u6imm:$imm),
- "shr.u $dst = $src1, $imm">, isI;
-def SHRSI : AForm<0x03, 0x0b, (outs GR:$dst), (ins GR:$src1, u6imm:$imm),
- "shr $dst = $src1, $imm">, isI;
-
-def EXTRU : AForm<0x03, 0x0b,
- (outs GR:$dst), (ins GR:$src1, u6imm:$imm1, u6imm:$imm2),
- "extr.u $dst = $src1, $imm1, $imm2">, isI;
-
-def DEPZ : AForm<0x03, 0x0b,
- (outs GR:$dst), (ins GR:$src1, u6imm:$imm1, u6imm:$imm2),
- "dep.z $dst = $src1, $imm1, $imm2">, isI;
-
-def PCMPEQOR : AForm<0x03, 0x0b, (outs PR:$dst), (ins GR:$src1, GR:$src2, PR:$qp),
- "($qp) cmp.eq.or $dst, p0 = $src1, $src2">, isA;
-def PCMPEQUNC : AForm<0x03, 0x0b, (outs PR:$dst), (ins GR:$src1, GR:$src2, PR:$qp),
- "($qp) cmp.eq.unc $dst, p0 = $src1, $src2">, isA;
-def PCMPNE : AForm<0x03, 0x0b, (outs PR:$dst), (ins GR:$src1, GR:$src2, PR:$qp),
- "($qp) cmp.ne $dst, p0 = $src1, $src2">, isA;
-
-// two destinations!
-def BCMPEQ : AForm<0x03, 0x0b, (outs PR:$dst1, PR:$dst2), (ins GR:$src1, GR:$src2),
- "cmp.eq $dst1, dst2 = $src1, $src2">, isA;
-
-def ADDIMM14 : AForm<0x03, 0x0b, (outs GR:$dst), (ins GR:$src1, s14imm:$imm),
- "adds $dst = $imm, $src1">, isA;
-
-def ADDIMM22 : AForm<0x03, 0x0b, (outs GR:$dst), (ins GR:$src1, s22imm:$imm),
- "add $dst = $imm, $src1">, isA;
-def CADDIMM22 : AForm<0x03, 0x0b, (outs GR:$dst), (ins GR:$src1, s22imm:$imm, PR:$qp),
- "($qp) add $dst = $imm, $src1">, isA;
-
-def SUBIMM8 : AForm<0x03, 0x0b, (outs GR:$dst), (ins s8imm:$imm, GR:$src2),
- "sub $dst = $imm, $src2">, isA;
-
-let mayStore = 1 in {
- def ST1 : AForm<0x03, 0x0b, (outs), (ins GR:$dstPtr, GR:$value),
- "st1 [$dstPtr] = $value">, isM;
- def ST2 : AForm<0x03, 0x0b, (outs), (ins GR:$dstPtr, GR:$value),
- "st2 [$dstPtr] = $value">, isM;
- def ST4 : AForm<0x03, 0x0b, (outs), (ins GR:$dstPtr, GR:$value),
- "st4 [$dstPtr] = $value">, isM;
- def ST8 : AForm<0x03, 0x0b, (outs), (ins GR:$dstPtr, GR:$value),
- "st8 [$dstPtr] = $value">, isM;
- def STF4 : AForm<0x03, 0x0b, (outs), (ins GR:$dstPtr, FP:$value),
- "stfs [$dstPtr] = $value">, isM;
- def STF8 : AForm<0x03, 0x0b, (outs), (ins GR:$dstPtr, FP:$value),
- "stfd [$dstPtr] = $value">, isM;
- def STF_SPILL : AForm<0x03, 0x0b, (outs), (ins GR:$dstPtr, FP:$value),
- "stf.spill [$dstPtr] = $value">, isM;
-}
-
-let isSimpleLoad = 1 in {
- def LD1 : AForm<0x03, 0x0b, (outs GR:$dst), (ins GR:$srcPtr),
- "ld1 $dst = [$srcPtr]">, isM;
- def LD2 : AForm<0x03, 0x0b, (outs GR:$dst), (ins GR:$srcPtr),
- "ld2 $dst = [$srcPtr]">, isM;
- def LD4 : AForm<0x03, 0x0b, (outs GR:$dst), (ins GR:$srcPtr),
- "ld4 $dst = [$srcPtr]">, isM;
- def LD8 : AForm<0x03, 0x0b, (outs GR:$dst), (ins GR:$srcPtr),
- "ld8 $dst = [$srcPtr]">, isM;
- def LDF4 : AForm<0x03, 0x0b, (outs FP:$dst), (ins GR:$srcPtr),
- "ldfs $dst = [$srcPtr]">, isM;
- def LDF8 : AForm<0x03, 0x0b, (outs FP:$dst), (ins GR:$srcPtr),
- "ldfd $dst = [$srcPtr]">, isM;
- def LDF_FILL : AForm<0x03, 0x0b, (outs FP:$dst), (ins GR:$srcPtr),
- "ldf.fill $dst = [$srcPtr]">, isM;
-}
-
-def POPCNT : AForm_DAG<0x03, 0x0b, (outs GR:$dst), (ins GR:$src),
- "popcnt $dst = $src",
- [(set GR:$dst, (ctpop GR:$src))]>, isI;
-
-// some FP stuff: // TODO: single-precision stuff?
-def FADD : AForm_DAG<0x03, 0x0b, (outs FP:$dst), (ins FP:$src1, FP:$src2),
- "fadd $dst = $src1, $src2",
- [(set FP:$dst, (fadd FP:$src1, FP:$src2))]>, isF;
-def FADDS: AForm<0x03, 0x0b, (outs FP:$dst), (ins FP:$src1, FP:$src2),
- "fadd.s $dst = $src1, $src2">, isF;
-def FSUB : AForm_DAG<0x03, 0x0b, (outs FP:$dst), (ins FP:$src1, FP:$src2),
- "fsub $dst = $src1, $src2",
- [(set FP:$dst, (fsub FP:$src1, FP:$src2))]>, isF;
-def FMPY : AForm_DAG<0x03, 0x0b, (outs FP:$dst), (ins FP:$src1, FP:$src2),
- "fmpy $dst = $src1, $src2",
- [(set FP:$dst, (fmul FP:$src1, FP:$src2))]>, isF;
-def FMA : AForm_DAG<0x03, 0x0b, (outs FP:$dst), (ins FP:$src1, FP:$src2, FP:$src3),
- "fma $dst = $src1, $src2, $src3",
- [(set FP:$dst, (fadd (fmul FP:$src1, FP:$src2), FP:$src3))]>, isF;
-def FMS : AForm_DAG<0x03, 0x0b, (outs FP:$dst), (ins FP:$src1, FP:$src2, FP:$src3),
- "fms $dst = $src1, $src2, $src3",
- [(set FP:$dst, (fsub (fmul FP:$src1, FP:$src2), FP:$src3))]>, isF;
-def FNMA : AForm_DAG<0x03, 0x0b, (outs FP:$dst), (ins FP:$src1, FP:$src2, FP:$src3),
- "fnma $dst = $src1, $src2, $src3",
- [(set FP:$dst, (fneg (fadd (fmul FP:$src1, FP:$src2), FP:$src3)))]>, isF;
-def FABS : AForm_DAG<0x03, 0x0b, (outs FP:$dst), (ins FP:$src),
- "fabs $dst = $src",
- [(set FP:$dst, (fabs FP:$src))]>, isF;
-def FNEG : AForm_DAG<0x03, 0x0b, (outs FP:$dst), (ins FP:$src),
- "fneg $dst = $src",
- [(set FP:$dst, (fneg FP:$src))]>, isF;
-def FNEGABS : AForm_DAG<0x03, 0x0b, (outs FP:$dst), (ins FP:$src),
- "fnegabs $dst = $src",
- [(set FP:$dst, (fneg (fabs FP:$src)))]>, isF;
-
-let isTwoAddress=1 in {
-def TCFMAS1 : AForm<0x03, 0x0b,
- (outs FP:$dst), (ins FP:$bogussrc, FP:$src1, FP:$src2, FP:$src3, PR:$qp),
- "($qp) fma.s1 $dst = $src1, $src2, $src3">, isF;
-def TCFMADS0 : AForm<0x03, 0x0b,
- (outs FP:$dst), (ins FP:$bogussrc, FP:$src1, FP:$src2, FP:$src3, PR:$qp),
- "($qp) fma.d.s0 $dst = $src1, $src2, $src3">, isF;
-}
-
-def CFMAS1 : AForm<0x03, 0x0b,
- (outs FP:$dst), (ins FP:$src1, FP:$src2, FP:$src3, PR:$qp),
- "($qp) fma.s1 $dst = $src1, $src2, $src3">, isF;
-def CFNMAS1 : AForm<0x03, 0x0b,
- (outs FP:$dst), (ins FP:$src1, FP:$src2, FP:$src3, PR:$qp),
- "($qp) fnma.s1 $dst = $src1, $src2, $src3">, isF;
-
-def CFMADS1 : AForm<0x03, 0x0b,
- (outs FP:$dst), (ins FP:$src1, FP:$src2, FP:$src3, PR:$qp),
- "($qp) fma.d.s1 $dst = $src1, $src2, $src3">, isF;
-def CFMADS0 : AForm<0x03, 0x0b,
- (outs FP:$dst), (ins FP:$src1, FP:$src2, FP:$src3, PR:$qp),
- "($qp) fma.d.s0 $dst = $src1, $src2, $src3">, isF;
-def CFNMADS1 : AForm<0x03, 0x0b,
- (outs FP:$dst), (ins FP:$src1, FP:$src2, FP:$src3, PR:$qp),
- "($qp) fnma.d.s1 $dst = $src1, $src2, $src3">, isF;
-
-def FRCPAS0 : AForm<0x03, 0x0b, (outs FP:$dstFR, PR:$dstPR), (ins FP:$src1, FP:$src2),
- "frcpa.s0 $dstFR, $dstPR = $src1, $src2">, isF;
-def FRCPAS1 : AForm<0x03, 0x0b, (outs FP:$dstFR, PR:$dstPR), (ins FP:$src1, FP:$src2),
- "frcpa.s1 $dstFR, $dstPR = $src1, $src2">, isF;
-
-def XMAL : AForm<0x03, 0x0b, (outs FP:$dst), (ins FP:$src1, FP:$src2, FP:$src3),
- "xma.l $dst = $src1, $src2, $src3">, isF;
-
-def FCVTXF : AForm<0x03, 0x0b, (outs FP:$dst), (ins FP:$src),
- "fcvt.xf $dst = $src">, isF;
-def FCVTXUF : AForm<0x03, 0x0b, (outs FP:$dst), (ins FP:$src),
- "fcvt.xuf $dst = $src">, isF;
-def FCVTXUFS1 : AForm<0x03, 0x0b, (outs FP:$dst), (ins FP:$src),
- "fcvt.xuf.s1 $dst = $src">, isF;
-def FCVTFX : AForm<0x03, 0x0b, (outs FP:$dst), (ins FP:$src),
- "fcvt.fx $dst = $src">, isF;
-def FCVTFXU : AForm<0x03, 0x0b, (outs FP:$dst), (ins FP:$src),
- "fcvt.fxu $dst = $src">, isF;
-
-def FCVTFXTRUNC : AForm<0x03, 0x0b, (outs FP:$dst), (ins FP:$src),
- "fcvt.fx.trunc $dst = $src">, isF;
-def FCVTFXUTRUNC : AForm<0x03, 0x0b, (outs FP:$dst), (ins FP:$src),
- "fcvt.fxu.trunc $dst = $src">, isF;
-
-def FCVTFXTRUNCS1 : AForm<0x03, 0x0b, (outs FP:$dst), (ins FP:$src),
- "fcvt.fx.trunc.s1 $dst = $src">, isF;
-def FCVTFXUTRUNCS1 : AForm<0x03, 0x0b, (outs FP:$dst), (ins FP:$src),
- "fcvt.fxu.trunc.s1 $dst = $src">, isF;
-
-def FNORMD : AForm<0x03, 0x0b, (outs FP:$dst), (ins FP:$src),
- "fnorm.d $dst = $src">, isF;
-
-def GETFD : AForm<0x03, 0x0b, (outs GR:$dst), (ins FP:$src),
- "getf.d $dst = $src">, isM;
-def SETFD : AForm<0x03, 0x0b, (outs FP:$dst), (ins GR:$src),
- "setf.d $dst = $src">, isM;
-
-def GETFSIG : AForm<0x03, 0x0b, (outs GR:$dst), (ins FP:$src),
- "getf.sig $dst = $src">, isM;
-def SETFSIG : AForm<0x03, 0x0b, (outs FP:$dst), (ins GR:$src),
- "setf.sig $dst = $src">, isM;
-
-// these four FP<->int conversion patterns need checking/cleaning
-def SINT_TO_FP : Pat<(sint_to_fp GR:$src),
- (FNORMD (FCVTXF (SETFSIG GR:$src)))>;
-def UINT_TO_FP : Pat<(uint_to_fp GR:$src),
- (FNORMD (FCVTXUF (SETFSIG GR:$src)))>;
-def FP_TO_SINT : Pat<(i64 (fp_to_sint FP:$src)),
- (GETFSIG (FCVTFXTRUNC FP:$src))>;
-def FP_TO_UINT : Pat<(i64 (fp_to_uint FP:$src)),
- (GETFSIG (FCVTFXUTRUNC FP:$src))>;
-
-def fpimm0 : PatLeaf<(fpimm), [{
- return N->isExactlyValue(+0.0);
-}]>;
-def fpimm1 : PatLeaf<(fpimm), [{
- return N->isExactlyValue(+1.0);
-}]>;
-def fpimmn0 : PatLeaf<(fpimm), [{
- return N->isExactlyValue(-0.0);
-}]>;
-def fpimmn1 : PatLeaf<(fpimm), [{
- return N->isExactlyValue(-1.0);
-}]>;
-
-def : Pat<(f64 fpimm0), (FMOV F0)>;
-def : Pat<(f64 fpimm1), (FMOV F1)>;
-def : Pat<(f64 fpimmn0), (FNEG F0)>;
-def : Pat<(f64 fpimmn1), (FNEG F1)>;
-
-let isTerminator = 1, isBranch = 1 in {
- def BRL_NOTCALL : RawForm<0x03, 0xb0, (outs), (ins i64imm:$dst),
- "(p0) brl.cond.sptk $dst">, isB;
- def BRLCOND_NOTCALL : RawForm<0x03, 0xb0, (outs), (ins PR:$qp, i64imm:$dst),
- "($qp) brl.cond.sptk $dst">, isB;
- def BRCOND_NOTCALL : RawForm<0x03, 0xb0, (outs), (ins PR:$qp, GR:$dst),
- "($qp) br.cond.sptk $dst">, isB;
-}
-
-let isCall = 1, /* isTerminator = 1, isBranch = 1, */
- Uses = [out0,out1,out2,out3,out4,out5,out6,out7],
-// all calls clobber non-callee-saved registers, and for now, they are these:
- Defs = [r2,r3,r8,r9,r10,r11,r14,r15,r16,r17,r18,r19,r20,r21,r22,r23,r24,
- r25,r26,r27,r28,r29,r30,r31,
- p6,p7,p8,p9,p10,p11,p12,p13,p14,p15,
- F6,F7,F8,F9,F10,F11,F12,F13,F14,F15,
- F32,F33,F34,F35,F36,F37,F38,F39,F40,F41,F42,F43,F44,F45,F46,F47,F48,F49,
- F50,F51,F52,F53,F54,F55,F56,
- F57,F58,F59,F60,F61,F62,F63,F64,F65,F66,F67,F68,F69,F70,F71,F72,F73,F74,
- F75,F76,F77,F78,F79,F80,F81,
- F82,F83,F84,F85,F86,F87,F88,F89,F90,F91,F92,F93,F94,F95,F96,F97,F98,F99,
- F100,F101,F102,F103,F104,F105,
- F106,F107,F108,F109,F110,F111,F112,F113,F114,F115,F116,F117,F118,F119,
- F120,F121,F122,F123,F124,F125,F126,F127,
- out0,out1,out2,out3,out4,out5,out6,out7] in {
-// old pattern call
- def BRCALL: RawForm<0x03, 0xb0, (outs), (ins calltarget:$dst),
- "br.call.sptk rp = $dst">, isB; // FIXME: teach llvm about branch regs?
-// new daggy stuff!
-
-// calls a globaladdress
- def BRCALL_IPREL_GA : RawForm<0x03, 0xb0, (outs), (ins calltarget:$dst),
- "br.call.sptk rp = $dst">, isB; // FIXME: teach llvm about branch regs?
-// calls an externalsymbol
- def BRCALL_IPREL_ES : RawForm<0x03, 0xb0, (outs), (ins calltarget:$dst),
- "br.call.sptk rp = $dst">, isB; // FIXME: teach llvm about branch regs?
-// calls through a function descriptor
- def BRCALL_INDIRECT : RawForm<0x03, 0xb0, (outs), (ins GR:$branchreg),
- "br.call.sptk rp = $branchreg">, isB; // FIXME: teach llvm about branch regs?
- def BRLCOND_CALL : RawForm<0x03, 0xb0, (outs), (ins PR:$qp, i64imm:$dst),
- "($qp) brl.cond.call.sptk $dst">, isB;
- def BRCOND_CALL : RawForm<0x03, 0xb0, (outs), (ins PR:$qp, GR:$dst),
- "($qp) br.cond.call.sptk $dst">, isB;
-}
-
-// Return branch:
-let isTerminator = 1, isReturn = 1 in
- def RET : AForm_DAG<0x03, 0x0b, (outs), (ins),
- "br.ret.sptk.many rp",
- [(retflag)]>, isB; // return
-def : Pat<(ret), (RET)>;
-
-// the evil stop bit of despair
-def STOP : PseudoInstIA64<(outs), (ins variable_ops), ";;">;
-
diff --git a/release_23/lib/Target/IA64/IA64MachineFunctionInfo.h b/release_23/lib/Target/IA64/IA64MachineFunctionInfo.h
deleted file mode 100644
index fb930564a9d1..000000000000
--- a/release_23/lib/Target/IA64/IA64MachineFunctionInfo.h
+++ /dev/null
@@ -1,34 +0,0 @@
-//===-- IA64MachineFunctionInfo.h - IA64-specific information ---*- C++ -*-===//
-//===-- for MachineFunction ---*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-//===----------------------------------------------------------------------===//
-//
-// This file declares IA64-specific per-machine-function information.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef IA64MACHINEFUNCTIONINFO_H
-#define IA64MACHINEFUNCTIONINFO_H
-
-#include "llvm/CodeGen/MachineFunction.h"
-//#include "IA64JITInfo.h"
-
-namespace llvm {
-
-class IA64FunctionInfo : public MachineFunctionInfo {
-
-public:
- unsigned outRegsUsed; // how many 'out' registers are used
- // by this machinefunction? (used to compute the appropriate
- // entry in the 'alloc' instruction at the top of the
- // machinefunction)
- IA64FunctionInfo(MachineFunction& MF) { outRegsUsed=0; };
-
-};
-
-} // End llvm namespace
-
-#endif
-
diff --git a/release_23/lib/Target/IA64/IA64RegisterInfo.cpp b/release_23/lib/Target/IA64/IA64RegisterInfo.cpp
deleted file mode 100644
index 8da2ed8519ad..000000000000
--- a/release_23/lib/Target/IA64/IA64RegisterInfo.cpp
+++ /dev/null
@@ -1,328 +0,0 @@
-//===- IA64RegisterInfo.cpp - IA64 Register Information ---------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains the IA64 implementation of the TargetRegisterInfo class.
-// This file is responsible for the frame pointer elimination optimization
-// on IA64.
-//
-//===----------------------------------------------------------------------===//
-
-#include "IA64.h"
-#include "IA64RegisterInfo.h"
-#include "IA64InstrBuilder.h"
-#include "IA64MachineFunctionInfo.h"
-#include "llvm/Constants.h"
-#include "llvm/Type.h"
-#include "llvm/CodeGen/ValueTypes.h"
-#include "llvm/CodeGen/MachineInstrBuilder.h"
-#include "llvm/CodeGen/MachineFunction.h"
-#include "llvm/CodeGen/MachineFrameInfo.h"
-#include "llvm/CodeGen/MachineLocation.h"
-#include "llvm/CodeGen/MachineRegisterInfo.h"
-#include "llvm/Target/TargetFrameInfo.h"
-#include "llvm/Target/TargetMachine.h"
-#include "llvm/Target/TargetOptions.h"
-#include "llvm/Target/TargetInstrInfo.h"
-#include "llvm/ADT/BitVector.h"
-#include "llvm/ADT/STLExtras.h"
-using namespace llvm;
-
-IA64RegisterInfo::IA64RegisterInfo(const TargetInstrInfo &tii)
- : IA64GenRegisterInfo(IA64::ADJUSTCALLSTACKDOWN, IA64::ADJUSTCALLSTACKUP),
- TII(tii) {}
-
-const unsigned* IA64RegisterInfo::getCalleeSavedRegs(const MachineFunction *MF)
- const {
- static const unsigned CalleeSavedRegs[] = {
- IA64::r5, 0
- };
- return CalleeSavedRegs;
-}
-
-const TargetRegisterClass* const*
-IA64RegisterInfo::getCalleeSavedRegClasses(const MachineFunction *MF) const {
- static const TargetRegisterClass * const CalleeSavedRegClasses[] = {
- &IA64::GRRegClass, 0
- };
- return CalleeSavedRegClasses;
-}
-
-BitVector IA64RegisterInfo::getReservedRegs(const MachineFunction &MF) const {
- BitVector Reserved(getNumRegs());
- Reserved.set(IA64::r0);
- Reserved.set(IA64::r1);
- Reserved.set(IA64::r2);
- Reserved.set(IA64::r5);
- Reserved.set(IA64::r12);
- Reserved.set(IA64::r13);
- Reserved.set(IA64::r22);
- Reserved.set(IA64::rp);
- return Reserved;
-}
-
-//===----------------------------------------------------------------------===//
-// Stack Frame Processing methods
-//===----------------------------------------------------------------------===//
-
-// hasFP - Return true if the specified function should have a dedicated frame
-// pointer register. This is true if the function has variable sized allocas or
-// if frame pointer elimination is disabled.
-//
-bool IA64RegisterInfo::hasFP(const MachineFunction &MF) const {
- return NoFramePointerElim || MF.getFrameInfo()->hasVarSizedObjects();
-}
-
-void IA64RegisterInfo::
-eliminateCallFramePseudoInstr(MachineFunction &MF, MachineBasicBlock &MBB,
- MachineBasicBlock::iterator I) const {
- if (hasFP(MF)) {
- // If we have a frame pointer, turn the adjcallstackup instruction into a
- // 'sub SP, <amt>' and the adjcallstackdown instruction into 'add SP,
- // <amt>'
- MachineInstr *Old = I;
- unsigned Amount = Old->getOperand(0).getImm();
- if (Amount != 0) {
- // We need to keep the stack aligned properly. To do this, we round the
- // amount of space needed for the outgoing arguments up to the next
- // alignment boundary.
- unsigned Align = MF.getTarget().getFrameInfo()->getStackAlignment();
- Amount = (Amount+Align-1)/Align*Align;
-
- MachineInstr *New;
- if (Old->getOpcode() == IA64::ADJUSTCALLSTACKDOWN) {
- New=BuildMI(TII.get(IA64::ADDIMM22), IA64::r12).addReg(IA64::r12)
- .addImm(-Amount);
- } else {
- assert(Old->getOpcode() == IA64::ADJUSTCALLSTACKUP);
- New=BuildMI(TII.get(IA64::ADDIMM22), IA64::r12).addReg(IA64::r12)
- .addImm(Amount);
- }
-
- // Replace the pseudo instruction with a new instruction...
- MBB.insert(I, New);
- }
- }
-
- MBB.erase(I);
-}
-
-void IA64RegisterInfo::eliminateFrameIndex(MachineBasicBlock::iterator II,
- int SPAdj, RegScavenger *RS)const{
- assert(SPAdj == 0 && "Unexpected");
-
- unsigned i = 0;
- MachineInstr &MI = *II;
- MachineBasicBlock &MBB = *MI.getParent();
- MachineFunction &MF = *MBB.getParent();
-
- bool FP = hasFP(MF);
-
- while (!MI.getOperand(i).isFrameIndex()) {
- ++i;
- assert(i < MI.getNumOperands() && "Instr doesn't have FrameIndex operand!");
- }
-
- int FrameIndex = MI.getOperand(i).getIndex();
-
- // choose a base register: ( hasFP? framepointer : stack pointer )
- unsigned BaseRegister = FP ? IA64::r5 : IA64::r12;
- // Add the base register
- MI.getOperand(i).ChangeToRegister(BaseRegister, false);
-
- // Now add the frame object offset to the offset from r1.
- int Offset = MF.getFrameInfo()->getObjectOffset(FrameIndex);
-
- // If we're not using a Frame Pointer that has been set to the value of the
- // SP before having the stack size subtracted from it, then add the stack size
- // to Offset to get the correct offset.
- Offset += MF.getFrameInfo()->getStackSize();
-
- // XXX: we use 'r22' as another hack+slash temporary register here :(
- if (Offset <= 8191 && Offset >= -8192) { // smallish offset
- // Fix up the old:
- MI.getOperand(i).ChangeToRegister(IA64::r22, false);
- //insert the new
- MachineInstr* nMI=BuildMI(TII.get(IA64::ADDIMM22), IA64::r22)
- .addReg(BaseRegister).addImm(Offset);
- MBB.insert(II, nMI);
- } else { // it's big
- //fix up the old:
- MI.getOperand(i).ChangeToRegister(IA64::r22, false);
- MachineInstr* nMI;
- nMI=BuildMI(TII.get(IA64::MOVLIMM64), IA64::r22).addImm(Offset);
- MBB.insert(II, nMI);
- nMI=BuildMI(TII.get(IA64::ADD), IA64::r22).addReg(BaseRegister)
- .addReg(IA64::r22);
- MBB.insert(II, nMI);
- }
-
-}
-
-void IA64RegisterInfo::emitPrologue(MachineFunction &MF) const {
- MachineBasicBlock &MBB = MF.front(); // Prolog goes in entry BB
- MachineBasicBlock::iterator MBBI = MBB.begin();
- MachineFrameInfo *MFI = MF.getFrameInfo();
- MachineInstr *MI;
- bool FP = hasFP(MF);
-
- // first, we handle the 'alloc' instruction, that should be right up the
- // top of any function
- static const unsigned RegsInOrder[96] = { // there are 96 GPRs the
- // RSE worries about
- IA64::r32, IA64::r33, IA64::r34, IA64::r35,
- IA64::r36, IA64::r37, IA64::r38, IA64::r39, IA64::r40, IA64::r41,
- IA64::r42, IA64::r43, IA64::r44, IA64::r45, IA64::r46, IA64::r47,
- IA64::r48, IA64::r49, IA64::r50, IA64::r51, IA64::r52, IA64::r53,
- IA64::r54, IA64::r55, IA64::r56, IA64::r57, IA64::r58, IA64::r59,
- IA64::r60, IA64::r61, IA64::r62, IA64::r63, IA64::r64, IA64::r65,
- IA64::r66, IA64::r67, IA64::r68, IA64::r69, IA64::r70, IA64::r71,
- IA64::r72, IA64::r73, IA64::r74, IA64::r75, IA64::r76, IA64::r77,
- IA64::r78, IA64::r79, IA64::r80, IA64::r81, IA64::r82, IA64::r83,
- IA64::r84, IA64::r85, IA64::r86, IA64::r87, IA64::r88, IA64::r89,
- IA64::r90, IA64::r91, IA64::r92, IA64::r93, IA64::r94, IA64::r95,
- IA64::r96, IA64::r97, IA64::r98, IA64::r99, IA64::r100, IA64::r101,
- IA64::r102, IA64::r103, IA64::r104, IA64::r105, IA64::r106, IA64::r107,
- IA64::r108, IA64::r109, IA64::r110, IA64::r111, IA64::r112, IA64::r113,
- IA64::r114, IA64::r115, IA64::r116, IA64::r117, IA64::r118, IA64::r119,
- IA64::r120, IA64::r121, IA64::r122, IA64::r123, IA64::r124, IA64::r125,
- IA64::r126, IA64::r127 };
-
- unsigned numStackedGPRsUsed=0;
- for (int i=0; i != 96; i++) {
- if (MF.getRegInfo().isPhysRegUsed(RegsInOrder[i]))
- numStackedGPRsUsed=i+1; // (i+1 and not ++ - consider fn(fp, fp, int)
- }
-
- unsigned numOutRegsUsed=MF.getInfo<IA64FunctionInfo>()->outRegsUsed;
-
- // XXX FIXME : this code should be a bit more reliable (in case there _isn't_
- // a pseudo_alloc in the MBB)
- unsigned dstRegOfPseudoAlloc;
- for(MBBI = MBB.begin(); /*MBBI->getOpcode() != IA64::PSEUDO_ALLOC*/; ++MBBI) {
- assert(MBBI != MBB.end());
- if(MBBI->getOpcode() == IA64::PSEUDO_ALLOC) {
- dstRegOfPseudoAlloc=MBBI->getOperand(0).getReg();
- break;
- }
- }
-
- MI=BuildMI(TII.get(IA64::ALLOC)).addReg(dstRegOfPseudoAlloc).addImm(0). \
- addImm(numStackedGPRsUsed).addImm(numOutRegsUsed).addImm(0);
- MBB.insert(MBBI, MI);
-
- // Get the number of bytes to allocate from the FrameInfo
- unsigned NumBytes = MFI->getStackSize();
-
- if(FP)
- NumBytes += 8; // reserve space for the old FP
-
- // Do we need to allocate space on the stack?
- if (NumBytes == 0)
- return;
-
- // Add 16 bytes at the bottom of the stack (scratch area)
- // and round the size to a multiple of the alignment.
- unsigned Align = MF.getTarget().getFrameInfo()->getStackAlignment();
- unsigned Size = 16 + (FP ? 8 : 0);
- NumBytes = (NumBytes+Size+Align-1)/Align*Align;
-
- // Update frame info to pretend that this is part of the stack...
- MFI->setStackSize(NumBytes);
-
- // adjust stack pointer: r12 -= numbytes
- if (NumBytes <= 8191) {
- MI=BuildMI(TII.get(IA64::ADDIMM22),IA64::r12).addReg(IA64::r12).
- addImm(-NumBytes);
- MBB.insert(MBBI, MI);
- } else { // we use r22 as a scratch register here
- MI=BuildMI(TII.get(IA64::MOVLIMM64), IA64::r22).addImm(-NumBytes);
- // FIXME: MOVLSI32 expects a _u_32imm
- MBB.insert(MBBI, MI); // first load the decrement into r22
- MI=BuildMI(TII.get(IA64::ADD), IA64::r12).addReg(IA64::r12).addReg(IA64::r22);
- MBB.insert(MBBI, MI); // then add (subtract) it to r12 (stack ptr)
- }
-
- // now if we need to, save the old FP and set the new
- if (FP) {
- MI = BuildMI(TII.get(IA64::ST8)).addReg(IA64::r12).addReg(IA64::r5);
- MBB.insert(MBBI, MI);
- // this must be the last instr in the prolog ? (XXX: why??)
- MI = BuildMI(TII.get(IA64::MOV), IA64::r5).addReg(IA64::r12);
- MBB.insert(MBBI, MI);
- }
-
-}
-
-void IA64RegisterInfo::emitEpilogue(MachineFunction &MF,
- MachineBasicBlock &MBB) const {
- const MachineFrameInfo *MFI = MF.getFrameInfo();
- MachineBasicBlock::iterator MBBI = prior(MBB.end());
- MachineInstr *MI;
- assert(MBBI->getOpcode() == IA64::RET &&
- "Can only insert epilog into returning blocks");
-
- bool FP = hasFP(MF);
-
- // Get the number of bytes allocated from the FrameInfo...
- unsigned NumBytes = MFI->getStackSize();
-
- //now if we need to, restore the old FP
- if (FP)
- {
- //copy the FP into the SP (discards allocas)
- MI=BuildMI(TII.get(IA64::MOV), IA64::r12).addReg(IA64::r5);
- MBB.insert(MBBI, MI);
- //restore the FP
- MI=BuildMI(TII.get(IA64::LD8), IA64::r5).addReg(IA64::r5);
- MBB.insert(MBBI, MI);
- }
-
- if (NumBytes != 0)
- {
- if (NumBytes <= 8191) {
- MI=BuildMI(TII.get(IA64::ADDIMM22),IA64::r12).addReg(IA64::r12).
- addImm(NumBytes);
- MBB.insert(MBBI, MI);
- } else {
- MI=BuildMI(TII.get(IA64::MOVLIMM64), IA64::r22).addImm(NumBytes);
- MBB.insert(MBBI, MI);
- MI=BuildMI(TII.get(IA64::ADD), IA64::r12).addReg(IA64::r12).
- addReg(IA64::r22);
- MBB.insert(MBBI, MI);
- }
- }
-
-}
-
-unsigned IA64RegisterInfo::getRARegister() const {
- assert(0 && "What is the return address register");
- return 0;
-}
-
-unsigned IA64RegisterInfo::getFrameRegister(MachineFunction &MF) const {
- return hasFP(MF) ? IA64::r5 : IA64::r12;
-}
-
-unsigned IA64RegisterInfo::getEHExceptionRegister() const {
- assert(0 && "What is the exception register");
- return 0;
-}
-
-unsigned IA64RegisterInfo::getEHHandlerRegister() const {
- assert(0 && "What is the exception handler register");
- return 0;
-}
-
-int IA64RegisterInfo::getDwarfRegNum(unsigned RegNum, bool isEH) const {
- assert(0 && "What is the dwarf register number");
- return -1;
-}
-
-#include "IA64GenRegisterInfo.inc"
-
diff --git a/release_23/lib/Target/IA64/IA64RegisterInfo.h b/release_23/lib/Target/IA64/IA64RegisterInfo.h
deleted file mode 100644
index 0c5083e75c25..000000000000
--- a/release_23/lib/Target/IA64/IA64RegisterInfo.h
+++ /dev/null
@@ -1,63 +0,0 @@
-//===- IA64RegisterInfo.h - IA64 Register Information Impl ------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains the IA64 implementation of the TargetRegisterInfo class.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef IA64REGISTERINFO_H
-#define IA64REGISTERINFO_H
-
-#include "llvm/Target/TargetRegisterInfo.h"
-#include "IA64GenRegisterInfo.h.inc"
-
-namespace llvm {
-
-class TargetInstrInfo;
-
-struct IA64RegisterInfo : public IA64GenRegisterInfo {
- const TargetInstrInfo &TII;
-
- IA64RegisterInfo(const TargetInstrInfo &tii);
-
- /// Code Generation virtual methods...
- const unsigned *getCalleeSavedRegs(const MachineFunction *MF = 0) const;
-
- const TargetRegisterClass* const* getCalleeSavedRegClasses(
- const MachineFunction *MF = 0) const;
-
- BitVector getReservedRegs(const MachineFunction &MF) const;
-
- bool hasFP(const MachineFunction &MF) const;
-
- void eliminateCallFramePseudoInstr(MachineFunction &MF,
- MachineBasicBlock &MBB,
- MachineBasicBlock::iterator MI) const;
-
- void eliminateFrameIndex(MachineBasicBlock::iterator MI,
- int SPAdj, RegScavenger *RS = NULL) const;
-
- void emitPrologue(MachineFunction &MF) const;
- void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const;
-
- // Debug information queries.
- unsigned getRARegister() const;
- unsigned getFrameRegister(MachineFunction &MF) const;
-
- // Exception handling queries.
- unsigned getEHExceptionRegister() const;
- unsigned getEHHandlerRegister() const;
-
- int getDwarfRegNum(unsigned RegNum, bool isEH) const;
-};
-
-} // End llvm namespace
-
-#endif
-
diff --git a/release_23/lib/Target/IA64/IA64RegisterInfo.td b/release_23/lib/Target/IA64/IA64RegisterInfo.td
deleted file mode 100644
index dd72dc3008a3..000000000000
--- a/release_23/lib/Target/IA64/IA64RegisterInfo.td
+++ /dev/null
@@ -1,509 +0,0 @@
-//===- IA64RegisterInfo.td - Describe the IA64 Register File ----*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file describes the IA64 register file, defining the registers
-// themselves, aliases between the registers, and the register classes built
-// out of the registers.
-//
-//===----------------------------------------------------------------------===//
-
-//===----------------------------------------------------------------------===//
-// Register definitions...
-//
-
-class IA64Register<string n> : Register<n> {
- let Namespace = "IA64";
-}
-
-// GR - One of 128 32-bit general registers
-class GR<bits<7> num, string n> : IA64Register<n> {
- field bits<7> Num = num;
-}
-
-// FP - One of 128 82-bit floating-point registers
-class FP<bits<7> num, string n> : IA64Register<n> {
- field bits<7> Num = num;
-}
-
-// PR - One of 64 1-bit predicate registers
-class PR<bits<6> num, string n> : IA64Register<n> {
- field bits<6> Num = num;
-}
-
-/* general registers */
-def r0 : GR< 0, "r0">, DwarfRegNum<[0]>;
-def r1 : GR< 1, "r1">, DwarfRegNum<[1]>;
-def r2 : GR< 2, "r2">, DwarfRegNum<[2]>;
-def r3 : GR< 3, "r3">, DwarfRegNum<[3]>;
-def r4 : GR< 4, "r4">, DwarfRegNum<[4]>;
-def r5 : GR< 5, "r5">, DwarfRegNum<[5]>;
-def r6 : GR< 6, "r6">, DwarfRegNum<[6]>;
-def r7 : GR< 7, "r7">, DwarfRegNum<[7]>;
-def r8 : GR< 8, "r8">, DwarfRegNum<[8]>;
-def r9 : GR< 9, "r9">, DwarfRegNum<[9]>;
-def r10 : GR< 10, "r10">, DwarfRegNum<[10]>;
-def r11 : GR< 11, "r11">, DwarfRegNum<[11]>;
-def r12 : GR< 12, "r12">, DwarfRegNum<[12]>;
-def r13 : GR< 13, "r13">, DwarfRegNum<[13]>;
-def r14 : GR< 14, "r14">, DwarfRegNum<[14]>;
-def r15 : GR< 15, "r15">, DwarfRegNum<[15]>;
-def r16 : GR< 16, "r16">, DwarfRegNum<[16]>;
-def r17 : GR< 17, "r17">, DwarfRegNum<[17]>;
-def r18 : GR< 18, "r18">, DwarfRegNum<[18]>;
-def r19 : GR< 19, "r19">, DwarfRegNum<[19]>;
-def r20 : GR< 20, "r20">, DwarfRegNum<[20]>;
-def r21 : GR< 21, "r21">, DwarfRegNum<[21]>;
-def r22 : GR< 22, "r22">, DwarfRegNum<[22]>;
-def r23 : GR< 23, "r23">, DwarfRegNum<[23]>;
-def r24 : GR< 24, "r24">, DwarfRegNum<[24]>;
-def r25 : GR< 25, "r25">, DwarfRegNum<[25]>;
-def r26 : GR< 26, "r26">, DwarfRegNum<[26]>;
-def r27 : GR< 27, "r27">, DwarfRegNum<[27]>;
-def r28 : GR< 28, "r28">, DwarfRegNum<[28]>;
-def r29 : GR< 29, "r29">, DwarfRegNum<[29]>;
-def r30 : GR< 30, "r30">, DwarfRegNum<[30]>;
-def r31 : GR< 31, "r31">, DwarfRegNum<[31]>;
-def r32 : GR< 32, "r32">, DwarfRegNum<[32]>;
-def r33 : GR< 33, "r33">, DwarfRegNum<[33]>;
-def r34 : GR< 34, "r34">, DwarfRegNum<[34]>;
-def r35 : GR< 35, "r35">, DwarfRegNum<[35]>;
-def r36 : GR< 36, "r36">, DwarfRegNum<[36]>;
-def r37 : GR< 37, "r37">, DwarfRegNum<[37]>;
-def r38 : GR< 38, "r38">, DwarfRegNum<[38]>;
-def r39 : GR< 39, "r39">, DwarfRegNum<[39]>;
-def r40 : GR< 40, "r40">, DwarfRegNum<[40]>;
-def r41 : GR< 41, "r41">, DwarfRegNum<[41]>;
-def r42 : GR< 42, "r42">, DwarfRegNum<[42]>;
-def r43 : GR< 43, "r43">, DwarfRegNum<[43]>;
-def r44 : GR< 44, "r44">, DwarfRegNum<[44]>;
-def r45 : GR< 45, "r45">, DwarfRegNum<[45]>;
-def r46 : GR< 46, "r46">, DwarfRegNum<[46]>;
-def r47 : GR< 47, "r47">, DwarfRegNum<[47]>;
-def r48 : GR< 48, "r48">, DwarfRegNum<[48]>;
-def r49 : GR< 49, "r49">, DwarfRegNum<[49]>;
-def r50 : GR< 50, "r50">, DwarfRegNum<[50]>;
-def r51 : GR< 51, "r51">, DwarfRegNum<[51]>;
-def r52 : GR< 52, "r52">, DwarfRegNum<[52]>;
-def r53 : GR< 53, "r53">, DwarfRegNum<[53]>;
-def r54 : GR< 54, "r54">, DwarfRegNum<[54]>;
-def r55 : GR< 55, "r55">, DwarfRegNum<[55]>;
-def r56 : GR< 56, "r56">, DwarfRegNum<[56]>;
-def r57 : GR< 57, "r57">, DwarfRegNum<[57]>;
-def r58 : GR< 58, "r58">, DwarfRegNum<[58]>;
-def r59 : GR< 59, "r59">, DwarfRegNum<[59]>;
-def r60 : GR< 60, "r60">, DwarfRegNum<[60]>;
-def r61 : GR< 61, "r61">, DwarfRegNum<[61]>;
-def r62 : GR< 62, "r62">, DwarfRegNum<[62]>;
-def r63 : GR< 63, "r63">, DwarfRegNum<[63]>;
-def r64 : GR< 64, "r64">, DwarfRegNum<[64]>;
-def r65 : GR< 65, "r65">, DwarfRegNum<[65]>;
-def r66 : GR< 66, "r66">, DwarfRegNum<[66]>;
-def r67 : GR< 67, "r67">, DwarfRegNum<[67]>;
-def r68 : GR< 68, "r68">, DwarfRegNum<[68]>;
-def r69 : GR< 69, "r69">, DwarfRegNum<[69]>;
-def r70 : GR< 70, "r70">, DwarfRegNum<[70]>;
-def r71 : GR< 71, "r71">, DwarfRegNum<[71]>;
-def r72 : GR< 72, "r72">, DwarfRegNum<[72]>;
-def r73 : GR< 73, "r73">, DwarfRegNum<[73]>;
-def r74 : GR< 74, "r74">, DwarfRegNum<[74]>;
-def r75 : GR< 75, "r75">, DwarfRegNum<[75]>;
-def r76 : GR< 76, "r76">, DwarfRegNum<[76]>;
-def r77 : GR< 77, "r77">, DwarfRegNum<[77]>;
-def r78 : GR< 78, "r78">, DwarfRegNum<[78]>;
-def r79 : GR< 79, "r79">, DwarfRegNum<[79]>;
-def r80 : GR< 80, "r80">, DwarfRegNum<[80]>;
-def r81 : GR< 81, "r81">, DwarfRegNum<[81]>;
-def r82 : GR< 82, "r82">, DwarfRegNum<[82]>;
-def r83 : GR< 83, "r83">, DwarfRegNum<[83]>;
-def r84 : GR< 84, "r84">, DwarfRegNum<[84]>;
-def r85 : GR< 85, "r85">, DwarfRegNum<[85]>;
-def r86 : GR< 86, "r86">, DwarfRegNum<[86]>;
-def r87 : GR< 87, "r87">, DwarfRegNum<[87]>;
-def r88 : GR< 88, "r88">, DwarfRegNum<[88]>;
-def r89 : GR< 89, "r89">, DwarfRegNum<[89]>;
-def r90 : GR< 90, "r90">, DwarfRegNum<[90]>;
-def r91 : GR< 91, "r91">, DwarfRegNum<[91]>;
-def r92 : GR< 92, "r92">, DwarfRegNum<[92]>;
-def r93 : GR< 93, "r93">, DwarfRegNum<[93]>;
-def r94 : GR< 94, "r94">, DwarfRegNum<[94]>;
-def r95 : GR< 95, "r95">, DwarfRegNum<[95]>;
-def r96 : GR< 96, "r96">, DwarfRegNum<[96]>;
-def r97 : GR< 97, "r97">, DwarfRegNum<[97]>;
-def r98 : GR< 98, "r98">, DwarfRegNum<[98]>;
-def r99 : GR< 99, "r99">, DwarfRegNum<[99]>;
-def r100 : GR< 100, "r100">, DwarfRegNum<[100]>;
-def r101 : GR< 101, "r101">, DwarfRegNum<[101]>;
-def r102 : GR< 102, "r102">, DwarfRegNum<[102]>;
-def r103 : GR< 103, "r103">, DwarfRegNum<[103]>;
-def r104 : GR< 104, "r104">, DwarfRegNum<[104]>;
-def r105 : GR< 105, "r105">, DwarfRegNum<[105]>;
-def r106 : GR< 106, "r106">, DwarfRegNum<[106]>;
-def r107 : GR< 107, "r107">, DwarfRegNum<[107]>;
-def r108 : GR< 108, "r108">, DwarfRegNum<[108]>;
-def r109 : GR< 109, "r109">, DwarfRegNum<[109]>;
-def r110 : GR< 110, "r110">, DwarfRegNum<[110]>;
-def r111 : GR< 111, "r111">, DwarfRegNum<[111]>;
-def r112 : GR< 112, "r112">, DwarfRegNum<[112]>;
-def r113 : GR< 113, "r113">, DwarfRegNum<[113]>;
-def r114 : GR< 114, "r114">, DwarfRegNum<[114]>;
-def r115 : GR< 115, "r115">, DwarfRegNum<[115]>;
-def r116 : GR< 116, "r116">, DwarfRegNum<[116]>;
-def r117 : GR< 117, "r117">, DwarfRegNum<[117]>;
-def r118 : GR< 118, "r118">, DwarfRegNum<[118]>;
-def r119 : GR< 119, "r119">, DwarfRegNum<[119]>;
-def r120 : GR< 120, "r120">, DwarfRegNum<[120]>;
-def r121 : GR< 121, "r121">, DwarfRegNum<[121]>;
-def r122 : GR< 122, "r122">, DwarfRegNum<[122]>;
-def r123 : GR< 123, "r123">, DwarfRegNum<[123]>;
-def r124 : GR< 124, "r124">, DwarfRegNum<[124]>;
-def r125 : GR< 125, "r125">, DwarfRegNum<[125]>;
-def r126 : GR< 126, "r126">, DwarfRegNum<[126]>;
-def r127 : GR< 127, "r127">, DwarfRegNum<[127]>;
-
-/* floating-point registers */
-def F0 : FP< 0, "f0">, DwarfRegNum<[128]>;
-def F1 : FP< 1, "f1">, DwarfRegNum<[129]>;
-def F2 : FP< 2, "f2">, DwarfRegNum<[130]>;
-def F3 : FP< 3, "f3">, DwarfRegNum<[131]>;
-def F4 : FP< 4, "f4">, DwarfRegNum<[132]>;
-def F5 : FP< 5, "f5">, DwarfRegNum<[133]>;
-def F6 : FP< 6, "f6">, DwarfRegNum<[134]>;
-def F7 : FP< 7, "f7">, DwarfRegNum<[135]>;
-def F8 : FP< 8, "f8">, DwarfRegNum<[136]>;
-def F9 : FP< 9, "f9">, DwarfRegNum<[137]>;
-def F10 : FP< 10, "f10">, DwarfRegNum<[138]>;
-def F11 : FP< 11, "f11">, DwarfRegNum<[139]>;
-def F12 : FP< 12, "f12">, DwarfRegNum<[140]>;
-def F13 : FP< 13, "f13">, DwarfRegNum<[141]>;
-def F14 : FP< 14, "f14">, DwarfRegNum<[142]>;
-def F15 : FP< 15, "f15">, DwarfRegNum<[143]>;
-def F16 : FP< 16, "f16">, DwarfRegNum<[144]>;
-def F17 : FP< 17, "f17">, DwarfRegNum<[145]>;
-def F18 : FP< 18, "f18">, DwarfRegNum<[146]>;
-def F19 : FP< 19, "f19">, DwarfRegNum<[147]>;
-def F20 : FP< 20, "f20">, DwarfRegNum<[148]>;
-def F21 : FP< 21, "f21">, DwarfRegNum<[149]>;
-def F22 : FP< 22, "f22">, DwarfRegNum<[150]>;
-def F23 : FP< 23, "f23">, DwarfRegNum<[151]>;
-def F24 : FP< 24, "f24">, DwarfRegNum<[152]>;
-def F25 : FP< 25, "f25">, DwarfRegNum<[153]>;
-def F26 : FP< 26, "f26">, DwarfRegNum<[154]>;
-def F27 : FP< 27, "f27">, DwarfRegNum<[155]>;
-def F28 : FP< 28, "f28">, DwarfRegNum<[156]>;
-def F29 : FP< 29, "f29">, DwarfRegNum<[157]>;
-def F30 : FP< 30, "f30">, DwarfRegNum<[158]>;
-def F31 : FP< 31, "f31">, DwarfRegNum<[159]>;
-def F32 : FP< 32, "f32">, DwarfRegNum<[160]>;
-def F33 : FP< 33, "f33">, DwarfRegNum<[161]>;
-def F34 : FP< 34, "f34">, DwarfRegNum<[162]>;
-def F35 : FP< 35, "f35">, DwarfRegNum<[163]>;
-def F36 : FP< 36, "f36">, DwarfRegNum<[164]>;
-def F37 : FP< 37, "f37">, DwarfRegNum<[165]>;
-def F38 : FP< 38, "f38">, DwarfRegNum<[166]>;
-def F39 : FP< 39, "f39">, DwarfRegNum<[167]>;
-def F40 : FP< 40, "f40">, DwarfRegNum<[168]>;
-def F41 : FP< 41, "f41">, DwarfRegNum<[169]>;
-def F42 : FP< 42, "f42">, DwarfRegNum<[170]>;
-def F43 : FP< 43, "f43">, DwarfRegNum<[171]>;
-def F44 : FP< 44, "f44">, DwarfRegNum<[172]>;
-def F45 : FP< 45, "f45">, DwarfRegNum<[173]>;
-def F46 : FP< 46, "f46">, DwarfRegNum<[174]>;
-def F47 : FP< 47, "f47">, DwarfRegNum<[175]>;
-def F48 : FP< 48, "f48">, DwarfRegNum<[176]>;
-def F49 : FP< 49, "f49">, DwarfRegNum<[177]>;
-def F50 : FP< 50, "f50">, DwarfRegNum<[178]>;
-def F51 : FP< 51, "f51">, DwarfRegNum<[179]>;
-def F52 : FP< 52, "f52">, DwarfRegNum<[180]>;
-def F53 : FP< 53, "f53">, DwarfRegNum<[181]>;
-def F54 : FP< 54, "f54">, DwarfRegNum<[182]>;
-def F55 : FP< 55, "f55">, DwarfRegNum<[183]>;
-def F56 : FP< 56, "f56">, DwarfRegNum<[184]>;
-def F57 : FP< 57, "f57">, DwarfRegNum<[185]>;
-def F58 : FP< 58, "f58">, DwarfRegNum<[186]>;
-def F59 : FP< 59, "f59">, DwarfRegNum<[187]>;
-def F60 : FP< 60, "f60">, DwarfRegNum<[188]>;
-def F61 : FP< 61, "f61">, DwarfRegNum<[189]>;
-def F62 : FP< 62, "f62">, DwarfRegNum<[190]>;
-def F63 : FP< 63, "f63">, DwarfRegNum<[191]>;
-def F64 : FP< 64, "f64">, DwarfRegNum<[192]>;
-def F65 : FP< 65, "f65">, DwarfRegNum<[193]>;
-def F66 : FP< 66, "f66">, DwarfRegNum<[194]>;
-def F67 : FP< 67, "f67">, DwarfRegNum<[195]>;
-def F68 : FP< 68, "f68">, DwarfRegNum<[196]>;
-def F69 : FP< 69, "f69">, DwarfRegNum<[197]>;
-def F70 : FP< 70, "f70">, DwarfRegNum<[198]>;
-def F71 : FP< 71, "f71">, DwarfRegNum<[199]>;
-def F72 : FP< 72, "f72">, DwarfRegNum<[200]>;
-def F73 : FP< 73, "f73">, DwarfRegNum<[201]>;
-def F74 : FP< 74, "f74">, DwarfRegNum<[202]>;
-def F75 : FP< 75, "f75">, DwarfRegNum<[203]>;
-def F76 : FP< 76, "f76">, DwarfRegNum<[204]>;
-def F77 : FP< 77, "f77">, DwarfRegNum<[205]>;
-def F78 : FP< 78, "f78">, DwarfRegNum<[206]>;
-def F79 : FP< 79, "f79">, DwarfRegNum<[207]>;
-def F80 : FP< 80, "f80">, DwarfRegNum<[208]>;
-def F81 : FP< 81, "f81">, DwarfRegNum<[209]>;
-def F82 : FP< 82, "f82">, DwarfRegNum<[210]>;
-def F83 : FP< 83, "f83">, DwarfRegNum<[211]>;
-def F84 : FP< 84, "f84">, DwarfRegNum<[212]>;
-def F85 : FP< 85, "f85">, DwarfRegNum<[213]>;
-def F86 : FP< 86, "f86">, DwarfRegNum<[214]>;
-def F87 : FP< 87, "f87">, DwarfRegNum<[215]>;
-def F88 : FP< 88, "f88">, DwarfRegNum<[216]>;
-def F89 : FP< 89, "f89">, DwarfRegNum<[217]>;
-def F90 : FP< 90, "f90">, DwarfRegNum<[218]>;
-def F91 : FP< 91, "f91">, DwarfRegNum<[219]>;
-def F92 : FP< 92, "f92">, DwarfRegNum<[220]>;
-def F93 : FP< 93, "f93">, DwarfRegNum<[221]>;
-def F94 : FP< 94, "f94">, DwarfRegNum<[222]>;
-def F95 : FP< 95, "f95">, DwarfRegNum<[223]>;
-def F96 : FP< 96, "f96">, DwarfRegNum<[224]>;
-def F97 : FP< 97, "f97">, DwarfRegNum<[225]>;
-def F98 : FP< 98, "f98">, DwarfRegNum<[226]>;
-def F99 : FP< 99, "f99">, DwarfRegNum<[227]>;
-def F100 : FP< 100, "f100">, DwarfRegNum<[228]>;
-def F101 : FP< 101, "f101">, DwarfRegNum<[229]>;
-def F102 : FP< 102, "f102">, DwarfRegNum<[230]>;
-def F103 : FP< 103, "f103">, DwarfRegNum<[231]>;
-def F104 : FP< 104, "f104">, DwarfRegNum<[232]>;
-def F105 : FP< 105, "f105">, DwarfRegNum<[233]>;
-def F106 : FP< 106, "f106">, DwarfRegNum<[234]>;
-def F107 : FP< 107, "f107">, DwarfRegNum<[235]>;
-def F108 : FP< 108, "f108">, DwarfRegNum<[236]>;
-def F109 : FP< 109, "f109">, DwarfRegNum<[237]>;
-def F110 : FP< 110, "f110">, DwarfRegNum<[238]>;
-def F111 : FP< 111, "f111">, DwarfRegNum<[239]>;
-def F112 : FP< 112, "f112">, DwarfRegNum<[240]>;
-def F113 : FP< 113, "f113">, DwarfRegNum<[241]>;
-def F114 : FP< 114, "f114">, DwarfRegNum<[242]>;
-def F115 : FP< 115, "f115">, DwarfRegNum<[243]>;
-def F116 : FP< 116, "f116">, DwarfRegNum<[244]>;
-def F117 : FP< 117, "f117">, DwarfRegNum<[245]>;
-def F118 : FP< 118, "f118">, DwarfRegNum<[246]>;
-def F119 : FP< 119, "f119">, DwarfRegNum<[247]>;
-def F120 : FP< 120, "f120">, DwarfRegNum<[248]>;
-def F121 : FP< 121, "f121">, DwarfRegNum<[249]>;
-def F122 : FP< 122, "f122">, DwarfRegNum<[250]>;
-def F123 : FP< 123, "f123">, DwarfRegNum<[251]>;
-def F124 : FP< 124, "f124">, DwarfRegNum<[252]>;
-def F125 : FP< 125, "f125">, DwarfRegNum<[253]>;
-def F126 : FP< 126, "f126">, DwarfRegNum<[254]>;
-def F127 : FP< 127, "f127">, DwarfRegNum<[255]>;
-
-/* predicate registers */
-def p0 : PR< 0, "p0">, DwarfRegNum<[256]>;
-def p1 : PR< 1, "p1">, DwarfRegNum<[257]>;
-def p2 : PR< 2, "p2">, DwarfRegNum<[258]>;
-def p3 : PR< 3, "p3">, DwarfRegNum<[259]>;
-def p4 : PR< 4, "p4">, DwarfRegNum<[260]>;
-def p5 : PR< 5, "p5">, DwarfRegNum<[261]>;
-def p6 : PR< 6, "p6">, DwarfRegNum<[262]>;
-def p7 : PR< 7, "p7">, DwarfRegNum<[263]>;
-def p8 : PR< 8, "p8">, DwarfRegNum<[264]>;
-def p9 : PR< 9, "p9">, DwarfRegNum<[265]>;
-def p10 : PR< 10, "p10">, DwarfRegNum<[266]>;
-def p11 : PR< 11, "p11">, DwarfRegNum<[267]>;
-def p12 : PR< 12, "p12">, DwarfRegNum<[268]>;
-def p13 : PR< 13, "p13">, DwarfRegNum<[269]>;
-def p14 : PR< 14, "p14">, DwarfRegNum<[270]>;
-def p15 : PR< 15, "p15">, DwarfRegNum<[271]>;
-def p16 : PR< 16, "p16">, DwarfRegNum<[272]>;
-def p17 : PR< 17, "p17">, DwarfRegNum<[273]>;
-def p18 : PR< 18, "p18">, DwarfRegNum<[274]>;
-def p19 : PR< 19, "p19">, DwarfRegNum<[275]>;
-def p20 : PR< 20, "p20">, DwarfRegNum<[276]>;
-def p21 : PR< 21, "p21">, DwarfRegNum<[277]>;
-def p22 : PR< 22, "p22">, DwarfRegNum<[278]>;
-def p23 : PR< 23, "p23">, DwarfRegNum<[279]>;
-def p24 : PR< 24, "p24">, DwarfRegNum<[280]>;
-def p25 : PR< 25, "p25">, DwarfRegNum<[281]>;
-def p26 : PR< 26, "p26">, DwarfRegNum<[282]>;
-def p27 : PR< 27, "p27">, DwarfRegNum<[283]>;
-def p28 : PR< 28, "p28">, DwarfRegNum<[284]>;
-def p29 : PR< 29, "p29">, DwarfRegNum<[285]>;
-def p30 : PR< 30, "p30">, DwarfRegNum<[286]>;
-def p31 : PR< 31, "p31">, DwarfRegNum<[287]>;
-def p32 : PR< 32, "p32">, DwarfRegNum<[288]>;
-def p33 : PR< 33, "p33">, DwarfRegNum<[289]>;
-def p34 : PR< 34, "p34">, DwarfRegNum<[290]>;
-def p35 : PR< 35, "p35">, DwarfRegNum<[291]>;
-def p36 : PR< 36, "p36">, DwarfRegNum<[292]>;
-def p37 : PR< 37, "p37">, DwarfRegNum<[293]>;
-def p38 : PR< 38, "p38">, DwarfRegNum<[294]>;
-def p39 : PR< 39, "p39">, DwarfRegNum<[295]>;
-def p40 : PR< 40, "p40">, DwarfRegNum<[296]>;
-def p41 : PR< 41, "p41">, DwarfRegNum<[297]>;
-def p42 : PR< 42, "p42">, DwarfRegNum<[298]>;
-def p43 : PR< 43, "p43">, DwarfRegNum<[299]>;
-def p44 : PR< 44, "p44">, DwarfRegNum<[300]>;
-def p45 : PR< 45, "p45">, DwarfRegNum<[301]>;
-def p46 : PR< 46, "p46">, DwarfRegNum<[302]>;
-def p47 : PR< 47, "p47">, DwarfRegNum<[303]>;
-def p48 : PR< 48, "p48">, DwarfRegNum<[304]>;
-def p49 : PR< 49, "p49">, DwarfRegNum<[305]>;
-def p50 : PR< 50, "p50">, DwarfRegNum<[306]>;
-def p51 : PR< 51, "p51">, DwarfRegNum<[307]>;
-def p52 : PR< 52, "p52">, DwarfRegNum<[308]>;
-def p53 : PR< 53, "p53">, DwarfRegNum<[309]>;
-def p54 : PR< 54, "p54">, DwarfRegNum<[310]>;
-def p55 : PR< 55, "p55">, DwarfRegNum<[311]>;
-def p56 : PR< 56, "p56">, DwarfRegNum<[312]>;
-def p57 : PR< 57, "p57">, DwarfRegNum<[313]>;
-def p58 : PR< 58, "p58">, DwarfRegNum<[314]>;
-def p59 : PR< 59, "p59">, DwarfRegNum<[315]>;
-def p60 : PR< 60, "p60">, DwarfRegNum<[316]>;
-def p61 : PR< 61, "p61">, DwarfRegNum<[317]>;
-def p62 : PR< 62, "p62">, DwarfRegNum<[318]>;
-def p63 : PR< 63, "p63">, DwarfRegNum<[319]>;
-
-// XXX : this is temporary, we'll eventually have the output registers
-// in the general purpose register class too?
-def out0 : GR<0, "out0">, DwarfRegNum<[120]>;
-def out1 : GR<1, "out1">, DwarfRegNum<[121]>;
-def out2 : GR<2, "out2">, DwarfRegNum<[122]>;
-def out3 : GR<3, "out3">, DwarfRegNum<[123]>;
-def out4 : GR<4, "out4">, DwarfRegNum<[124]>;
-def out5 : GR<5, "out5">, DwarfRegNum<[125]>;
-def out6 : GR<6, "out6">, DwarfRegNum<[126]>;
-def out7 : GR<7, "out7">, DwarfRegNum<[127]>;
-
-// application (special) registers:
-
-// "previous function state" application register
-def AR_PFS : GR<0, "ar.pfs">, DwarfRegNum<[331]>;
-
-// "return pointer" (this is really branch register b0)
-def rp : GR<0, "rp">, DwarfRegNum<[-1]>;
-
-// branch reg 6
-def B6 : GR<0, "b6">, DwarfRegNum<[326]>;
-
-//===----------------------------------------------------------------------===//
-// Register Class Definitions... now that we have all of the pieces, define the
-// top-level register classes. The order specified in the register list is
-// implicitly defined to be the register allocation order.
-//
-
-// these are the scratch (+stacked) general registers
-// FIXME/XXX we also reserve a frame pointer (r5)
-// FIXME/XXX we also reserve r2 for spilling/filling predicates
-// in IA64RegisterInfo.cpp
-// FIXME/XXX we also reserve r22 for calculating addresses
-// in IA64RegisterInfo.cpp
-
-def GR : RegisterClass<"IA64", [i64], 64,
- [
-
-//FIXME!: for both readability and performance, we don't want the out
-// registers to be the first ones allocated
-
- out7, out6, out5, out4, out3, out2, out1, out0,
- r3, r8, r9, r10, r11, r14, r15,
- r16, r17, r18, r19, r20, r21, r23,
- r24, r25, r26, r27, r28, r29, r30, r31,
- r32, r33, r34, r35, r36, r37, r38, r39,
- r40, r41, r42, r43, r44, r45, r46, r47,
- r48, r49, r50, r51, r52, r53, r54, r55,
- r56, r57, r58, r59, r60, r61, r62, r63,
- r64, r65, r66, r67, r68, r69, r70, r71,
- r72, r73, r74, r75, r76, r77, r78, r79,
- r80, r81, r82, r83, r84, r85, r86, r87,
- r88, r89, r90, r91, r92, r93, r94, r95,
- r96, r97, r98, r99, r100, r101, r102, r103,
- r104, r105, r106, r107, r108, r109, r110, r111,
- r112, r113, r114, r115, r116, r117, r118, r119,
- // last 17 are special (look down)
- r120, r121, r122, r123, r124, r125, r126, r127,
- r0, r1, r2, r5, r12, r13, r22, rp, AR_PFS]>
- {
- let MethodProtos = [{
- iterator allocation_order_begin(const MachineFunction &MF) const;
- iterator allocation_order_end(const MachineFunction &MF) const;
- }];
- let MethodBodies = [{
- GRClass::iterator
- GRClass::allocation_order_begin(const MachineFunction &MF) const {
- // hide the 8 out? registers appropriately:
- return begin()+(8-(MF.getInfo<IA64FunctionInfo>()->outRegsUsed));
- }
-
- GRClass::iterator
- GRClass::allocation_order_end(const MachineFunction &MF) const {
- // the 9 special registers r0,r1,r2,r5,r12,r13 etc
- int numReservedRegs=9;
-
- // we also can't allocate registers for use as locals if they're already
- // required as 'out' registers
- numReservedRegs+=MF.getInfo<IA64FunctionInfo>()->outRegsUsed;
- return end()-numReservedRegs; // hide registers appropriately
- }
- }];
-}
-
-
-// these are the scratch (+stacked) FP registers
-
-def FP : RegisterClass<"IA64", [f64], 64,
- [F6, F7,
- F8, F9, F10, F11, F12, F13, F14, F15,
- F32, F33, F34, F35, F36, F37, F38, F39,
- F40, F41, F42, F43, F44, F45, F46, F47,
- F48, F49, F50, F51, F52, F53, F54, F55,
- F56, F57, F58, F59, F60, F61, F62, F63,
- F64, F65, F66, F67, F68, F69, F70, F71,
- F72, F73, F74, F75, F76, F77, F78, F79,
- F80, F81, F82, F83, F84, F85, F86, F87,
- F88, F89, F90, F91, F92, F93, F94, F95,
- F96, F97, F98, F99, F100, F101, F102, F103,
- F104, F105, F106, F107, F108, F109, F110, F111,
- F112, F113, F114, F115, F116, F117, F118, F119,
- F120, F121, F122, F123, F124, F125, F126, F127,
- F0, F1]> // these last two are hidden
- {
-// the 128s here are to make stf.spill/ldf.fill happy,
-// when storing full (82-bit) FP regs to stack slots
-// we need to 16-byte align
- let Size=128;
- let Alignment=128;
-
- let MethodProtos = [{
- iterator allocation_order_begin(const MachineFunction &MF) const;
- iterator allocation_order_end(const MachineFunction &MF) const;
- }];
- let MethodBodies = [{
- FPClass::iterator
- FPClass::allocation_order_begin(const MachineFunction &MF) const {
- return begin(); // we don't hide any FP regs from the start
- }
-
- FPClass::iterator
- FPClass::allocation_order_end(const MachineFunction &MF) const {
- return end()-2; // we hide regs F0, F1 from the end
- }
- }];
-}
-
-// these are the predicate registers, p0 (1/TRUE) is not here
-def PR : RegisterClass<"IA64", [i1], 64,
-
-// for now, let's be wimps and only have the scratch predicate regs
- [p6, p7, p8, p9, p10, p11, p12, p13, p14, p15]> {
- let Size = 64;
- }
-
-/*
- [p1, p2, p3, p4, p5, p6, p7,
- p8, p9, p10, p11, p12, p13, p14, p15,
- p16, p17, p18, p19, p20, p21, p22, p23,
- p24, p25, p26, p27, p28, p29, p30, p31,
- p32, p33, p34, p35, p36, p37, p38, p39,
- p40, p41, p42, p43, p44, p45, p46, p47,
- p48, p49, p50, p51, p52, p53, p54, p55,
- p56, p57, p58, p59, p60, p61, p62, p63]>;
- */
diff --git a/release_23/lib/Target/IA64/IA64TargetAsmInfo.cpp b/release_23/lib/Target/IA64/IA64TargetAsmInfo.cpp
deleted file mode 100644
index 36012e61c02a..000000000000
--- a/release_23/lib/Target/IA64/IA64TargetAsmInfo.cpp
+++ /dev/null
@@ -1,34 +0,0 @@
-//===-- IA64TargetAsmInfo.cpp - IA64 asm properties -------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains the declarations of the IA64TargetAsmInfo properties.
-//
-//===----------------------------------------------------------------------===//
-
-#include "IA64TargetAsmInfo.h"
-
-using namespace llvm;
-
-IA64TargetAsmInfo::IA64TargetAsmInfo(const IA64TargetMachine &TM) {
- CommentString = "//";
- Data8bitsDirective = "\tdata1\t"; // FIXME: check that we are
- Data16bitsDirective = "\tdata2.ua\t"; // disabling auto-alignment
- Data32bitsDirective = "\tdata4.ua\t"; // properly
- Data64bitsDirective = "\tdata8.ua\t";
- ZeroDirective = "\t.skip\t";
- AsciiDirective = "\tstring\t";
-
- GlobalVarAddrPrefix="";
- GlobalVarAddrSuffix="";
- FunctionAddrPrefix="@fptr(";
- FunctionAddrSuffix=")";
-
- // FIXME: would be nice to have rodata (no 'w') when appropriate?
- ConstantPoolSection = "\n\t.section .data, \"aw\", \"progbits\"\n";
-}
diff --git a/release_23/lib/Target/IA64/IA64TargetAsmInfo.h b/release_23/lib/Target/IA64/IA64TargetAsmInfo.h
deleted file mode 100644
index dc5747f70c62..000000000000
--- a/release_23/lib/Target/IA64/IA64TargetAsmInfo.h
+++ /dev/null
@@ -1,31 +0,0 @@
-//=====-- IA64TargetAsmInfo.h - IA64 asm properties -----------*- C++ -*--====//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains the declaration of the IA64TargetAsmInfo class.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef IA64TARGETASMINFO_H
-#define IA64TARGETASMINFO_H
-
-#include "llvm/Target/TargetAsmInfo.h"
-
-namespace llvm {
-
- // Forward declaration.
- class IA64TargetMachine;
-
- struct IA64TargetAsmInfo : public TargetAsmInfo {
- explicit IA64TargetAsmInfo(const IA64TargetMachine &TM);
- };
-
-
-} // namespace llvm
-
-#endif
diff --git a/release_23/lib/Target/IA64/IA64TargetMachine.cpp b/release_23/lib/Target/IA64/IA64TargetMachine.cpp
deleted file mode 100644
index d472b5cc5c7f..000000000000
--- a/release_23/lib/Target/IA64/IA64TargetMachine.cpp
+++ /dev/null
@@ -1,91 +0,0 @@
-//===-- IA64TargetMachine.cpp - Define TargetMachine for IA64 -------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the IA64 specific subclass of TargetMachine.
-//
-//===----------------------------------------------------------------------===//
-
-#include "IA64TargetAsmInfo.h"
-#include "IA64TargetMachine.h"
-#include "IA64.h"
-#include "llvm/Module.h"
-#include "llvm/PassManager.h"
-#include "llvm/Target/TargetMachineRegistry.h"
-using namespace llvm;
-
-/// IA64TargetMachineModule - Note that this is used on hosts that cannot link
-/// in a library unless there are references into the library. In particular,
-/// it seems that it is not possible to get things to work on Win32 without
-/// this. Though it is unused, do not remove it.
-extern "C" int IA64TargetMachineModule;
-int IA64TargetMachineModule = 0;
-
-namespace {
- RegisterTarget<IA64TargetMachine> X("ia64", " IA-64 (Itanium)");
-}
-
-const TargetAsmInfo *IA64TargetMachine::createTargetAsmInfo() const {
- return new IA64TargetAsmInfo(*this);
-}
-
-unsigned IA64TargetMachine::getModuleMatchQuality(const Module &M) {
- // we match [iI][aA]*64
- bool seenIA64=false;
- std::string TT = M.getTargetTriple();
-
- if (TT.size() >= 4) {
- if( (TT[0]=='i' || TT[0]=='I') &&
- (TT[1]=='a' || TT[1]=='A') ) {
- for(unsigned int i=2; i<(TT.size()-1); i++)
- if(TT[i]=='6' && TT[i+1]=='4')
- seenIA64=true;
- }
-
- if (seenIA64)
- return 20; // strong match
- }
- // If the target triple is something non-ia64, we don't match.
- if (!TT.empty()) return 0;
-
-#if defined(__ia64__) || defined(__IA64__)
- return 5;
-#else
- return 0;
-#endif
-}
-
-/// IA64TargetMachine ctor - Create an LP64 architecture model
-///
-IA64TargetMachine::IA64TargetMachine(const Module &M, const std::string &FS)
- : DataLayout("e-f80:128:128"),
- FrameInfo(TargetFrameInfo::StackGrowsDown, 16, 0),
- TLInfo(*this) { // FIXME? check this stuff
-}
-
-
-//===----------------------------------------------------------------------===//
-// Pass Pipeline Configuration
-//===----------------------------------------------------------------------===//
-
-bool IA64TargetMachine::addInstSelector(PassManagerBase &PM, bool Fast) {
- PM.add(createIA64DAGToDAGInstructionSelector(*this));
- return false;
-}
-
-bool IA64TargetMachine::addPreEmitPass(PassManagerBase &PM, bool Fast) {
- // Make sure everything is bundled happily
- PM.add(createIA64BundlingPass(*this));
- return true;
-}
-bool IA64TargetMachine::addAssemblyEmitter(PassManagerBase &PM, bool Fast,
- std::ostream &Out) {
- PM.add(createIA64CodePrinterPass(Out, *this));
- return false;
-}
-
diff --git a/release_23/lib/Target/IA64/IA64TargetMachine.h b/release_23/lib/Target/IA64/IA64TargetMachine.h
deleted file mode 100644
index 9e553a1338ec..000000000000
--- a/release_23/lib/Target/IA64/IA64TargetMachine.h
+++ /dev/null
@@ -1,60 +0,0 @@
-//===-- IA64TargetMachine.h - Define TargetMachine for IA64 ---*- C++ -*---===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file declares the IA64 specific subclass of TargetMachine.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_TARGET_IA64TARGETMACHINE_H
-#define LLVM_TARGET_IA64TARGETMACHINE_H
-
-#include "llvm/Target/TargetMachine.h"
-#include "llvm/Target/TargetData.h"
-#include "llvm/Target/TargetFrameInfo.h"
-#include "IA64InstrInfo.h"
-#include "IA64ISelLowering.h"
-
-namespace llvm {
-
-class IA64TargetMachine : public LLVMTargetMachine {
- const TargetData DataLayout; // Calculates type size & alignment
- IA64InstrInfo InstrInfo;
- TargetFrameInfo FrameInfo;
- //IA64JITInfo JITInfo;
- IA64TargetLowering TLInfo;
-
-protected:
- virtual const TargetAsmInfo *createTargetAsmInfo() const;
-
-public:
- IA64TargetMachine(const Module &M, const std::string &FS);
-
- virtual const IA64InstrInfo *getInstrInfo() const { return &InstrInfo; }
- virtual const TargetFrameInfo *getFrameInfo() const { return &FrameInfo; }
- virtual IA64TargetLowering *getTargetLowering() const {
- return const_cast<IA64TargetLowering*>(&TLInfo);
- }
- virtual const TargetRegisterInfo *getRegisterInfo() const {
- return &InstrInfo.getRegisterInfo();
- }
- virtual const TargetData *getTargetData() const { return &DataLayout; }
-
- static unsigned getModuleMatchQuality(const Module &M);
-
- // Pass Pipeline Configuration
- virtual bool addInstSelector(PassManagerBase &PM, bool Fast);
- virtual bool addPreEmitPass(PassManagerBase &PM, bool Fast);
- virtual bool addAssemblyEmitter(PassManagerBase &PM, bool Fast,
- std::ostream &Out);
-};
-} // End llvm namespace
-
-#endif
-
-
diff --git a/release_23/lib/Target/IA64/Makefile b/release_23/lib/Target/IA64/Makefile
deleted file mode 100644
index b0f41c3b2c0b..000000000000
--- a/release_23/lib/Target/IA64/Makefile
+++ /dev/null
@@ -1,18 +0,0 @@
-##===- lib/Target/IA64/Makefile -----------------------------*- Makefile -*-===##
-# The LLVM Compiler Infrastructure
-#
-# This file is distributed under the University of Illinois Open Source
-# License. See LICENSE.TXT for details.
-#
-##===----------------------------------------------------------------------===##
-LEVEL = ../../..
-LIBRARYNAME = LLVMIA64
-TARGET = IA64
-# Make sure that tblgen is run, first thing.
-BUILT_SOURCES = IA64GenRegisterInfo.h.inc IA64GenRegisterNames.inc \
- IA64GenRegisterInfo.inc IA64GenInstrNames.inc \
- IA64GenInstrInfo.inc IA64GenAsmWriter.inc \
- IA64GenDAGISel.inc
-
-include $(LEVEL)/Makefile.common
-
diff --git a/release_23/lib/Target/IA64/README b/release_23/lib/Target/IA64/README
deleted file mode 100644
index 60761ac11d97..000000000000
--- a/release_23/lib/Target/IA64/README
+++ /dev/null
@@ -1,48 +0,0 @@
-TODO:
- - Un-bitrot ISel
- - Hook up If-Conversion a la ARM target
- - Hook up all branch analysis functions
- - Instruction scheduling
- - Bundling
- - Dynamic Optimization
- - Testing and bugfixing
- - stop passing FP args in both FP *and* integer regs when not required
- - allocate low (nonstacked) registers more aggressively
- - clean up and thoroughly test the isel patterns.
- - fix stacked register allocation order: (for readability) we don't want
- the out? registers being the first ones used
- - fix up floating point
- (nb http://gcc.gnu.org/wiki?pagename=ia64%20floating%20point )
- - bundling!
- (we will avoid the mess that is:
- http://gcc.gnu.org/ml/gcc/2003-12/msg00832.html )
- - instruction scheduling (hmmmm! ;)
- - counted loop support
- - make integer + FP mul/div more clever (we have fixed pseudocode atm)
- - track and use comparison complements
-
-INFO:
- - we are strictly LP64 here, no support for ILP32 on HP-UX. Linux users
- don't need to worry about this.
- - i have instruction scheduling/bundling pseudocode, that really works
- (has been tested, albeit at the perl-script level).
- so, before you go write your own, send me an email!
-
-KNOWN DEFECTS AT THE CURRENT TIME:
- - C++ vtables contain naked function pointers, not function descriptors,
- which is bad. see http://llvm.cs.uiuc.edu/bugs/show_bug.cgi?id=406
- - varargs are broken
- - alloca doesn't work (indeed, stack frame layout is bogus)
- - no support for big-endian environments
- - (not really the backend, but...) the CFE has some issues on IA64.
- these will probably be fixed soon.
-
-ACKNOWLEDGEMENTS:
- - Chris Lattner (x100)
- - Other LLVM developers ("hey, that looks familiar")
-
-CONTACT:
- - You can email me at duraid@octopus.com.au. If you find a small bug,
- just email me. If you find a big bug, please file a bug report
- in bugzilla! http://llvm.cs.uiuc.edu is your one stop shop for all
- things LLVM.
diff --git a/release_23/lib/Target/MSIL/MSILWriter.cpp b/release_23/lib/Target/MSIL/MSILWriter.cpp
deleted file mode 100644
index 187dd4a8af43..000000000000
--- a/release_23/lib/Target/MSIL/MSILWriter.cpp
+++ /dev/null
@@ -1,1665 +0,0 @@
-//===-- MSILWriter.cpp - Library for converting LLVM code to MSIL ---------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This library converts LLVM code to MSIL code.
-//
-//===----------------------------------------------------------------------===//
-
-#include "MSILWriter.h"
-#include "llvm/CallingConv.h"
-#include "llvm/DerivedTypes.h"
-#include "llvm/Intrinsics.h"
-#include "llvm/IntrinsicInst.h"
-#include "llvm/ParameterAttributes.h"
-#include "llvm/TypeSymbolTable.h"
-#include "llvm/Analysis/ConstantsScanner.h"
-#include "llvm/Support/CallSite.h"
-#include "llvm/Support/InstVisitor.h"
-#include "llvm/Support/MathExtras.h"
-#include "llvm/Transforms/Scalar.h"
-#include "llvm/ADT/StringExtras.h"
-#include "llvm/CodeGen/Passes.h"
-
-namespace {
- // TargetMachine for the MSIL
- struct VISIBILITY_HIDDEN MSILTarget : public TargetMachine {
- const TargetData DataLayout; // Calculates type size & alignment
-
- MSILTarget(const Module &M, const std::string &FS)
- : DataLayout(&M) {}
-
- virtual bool WantsWholeFile() const { return true; }
- virtual bool addPassesToEmitWholeFile(PassManager &PM, std::ostream &Out,
- CodeGenFileType FileType, bool Fast);
-
- // This class always works, but shouldn't be the default in most cases.
- static unsigned getModuleMatchQuality(const Module &M) { return 1; }
-
- virtual const TargetData *getTargetData() const { return &DataLayout; }
- };
-}
-
-
-RegisterTarget<MSILTarget> X("msil", " MSIL backend");
-
-bool MSILModule::runOnModule(Module &M) {
- ModulePtr = &M;
- TD = &getAnalysis<TargetData>();
- bool Changed = false;
- // Find named types.
- TypeSymbolTable& Table = M.getTypeSymbolTable();
- std::set<const Type *> Types = getAnalysis<FindUsedTypes>().getTypes();
- for (TypeSymbolTable::iterator I = Table.begin(), E = Table.end(); I!=E; ) {
- if (!isa<StructType>(I->second) && !isa<OpaqueType>(I->second))
- Table.remove(I++);
- else {
- std::set<const Type *>::iterator T = Types.find(I->second);
- if (T==Types.end())
- Table.remove(I++);
- else {
- Types.erase(T);
- ++I;
- }
- }
- }
- // Find unnamed types.
- unsigned RenameCounter = 0;
- for (std::set<const Type *>::const_iterator I = Types.begin(),
- E = Types.end(); I!=E; ++I)
- if (const StructType *STy = dyn_cast<StructType>(*I)) {
- while (ModulePtr->addTypeName("unnamed$"+utostr(RenameCounter), STy))
- ++RenameCounter;
- Changed = true;
- }
- // Pointer for FunctionPass.
- UsedTypes = &getAnalysis<FindUsedTypes>().getTypes();
- return Changed;
-}
-
-char MSILModule::ID = 0;
-char MSILWriter::ID = 0;
-
-bool MSILWriter::runOnFunction(Function &F) {
- if (F.isDeclaration()) return false;
- LInfo = &getAnalysis<LoopInfo>();
- printFunction(F);
- return false;
-}
-
-
-bool MSILWriter::doInitialization(Module &M) {
- ModulePtr = &M;
- Mang = new Mangler(M);
- Out << ".assembly extern mscorlib {}\n";
- Out << ".assembly MSIL {}\n\n";
- Out << "// External\n";
- printExternals();
- Out << "// Declarations\n";
- printDeclarations(M.getTypeSymbolTable());
- Out << "// Definitions\n";
- printGlobalVariables();
- Out << "// Startup code\n";
- printModuleStartup();
- return false;
-}
-
-
-bool MSILWriter::doFinalization(Module &M) {
- delete Mang;
- return false;
-}
-
-
-void MSILWriter::printModuleStartup() {
- Out <<
- ".method static public int32 $MSIL_Startup() {\n"
- "\t.entrypoint\n"
- "\t.locals (native int i)\n"
- "\t.locals (native int argc)\n"
- "\t.locals (native int ptr)\n"
- "\t.locals (void* argv)\n"
- "\t.locals (string[] args)\n"
- "\tcall\tstring[] [mscorlib]System.Environment::GetCommandLineArgs()\n"
- "\tdup\n"
- "\tstloc\targs\n"
- "\tldlen\n"
- "\tconv.i4\n"
- "\tdup\n"
- "\tstloc\targc\n";
- printPtrLoad(TD->getPointerSize());
- Out <<
- "\tmul\n"
- "\tlocalloc\n"
- "\tstloc\targv\n"
- "\tldc.i4.0\n"
- "\tstloc\ti\n"
- "L_01:\n"
- "\tldloc\ti\n"
- "\tldloc\targc\n"
- "\tceq\n"
- "\tbrtrue\tL_02\n"
- "\tldloc\targs\n"
- "\tldloc\ti\n"
- "\tldelem.ref\n"
- "\tcall\tnative int [mscorlib]System.Runtime.InteropServices.Marshal::"
- "StringToHGlobalAnsi(string)\n"
- "\tstloc\tptr\n"
- "\tldloc\targv\n"
- "\tldloc\ti\n";
- printPtrLoad(TD->getPointerSize());
- Out <<
- "\tmul\n"
- "\tadd\n"
- "\tldloc\tptr\n"
- "\tstind.i\n"
- "\tldloc\ti\n"
- "\tldc.i4.1\n"
- "\tadd\n"
- "\tstloc\ti\n"
- "\tbr\tL_01\n"
- "L_02:\n"
- "\tcall void $MSIL_Init()\n";
-
- // Call user 'main' function.
- const Function* F = ModulePtr->getFunction("main");
- if (!F || F->isDeclaration()) {
- Out << "\tldc.i4.0\n\tret\n}\n";
- return;
- }
- bool BadSig = true;;
- std::string Args("");
- Function::const_arg_iterator Arg1,Arg2;
-
- switch (F->arg_size()) {
- case 0:
- BadSig = false;
- break;
- case 1:
- Arg1 = F->arg_begin();
- if (Arg1->getType()->isInteger()) {
- Out << "\tldloc\targc\n";
- Args = getTypeName(Arg1->getType());
- BadSig = false;
- }
- break;
- case 2:
- Arg1 = Arg2 = F->arg_begin(); ++Arg2;
- if (Arg1->getType()->isInteger() &&
- Arg2->getType()->getTypeID() == Type::PointerTyID) {
- Out << "\tldloc\targc\n\tldloc\targv\n";
- Args = getTypeName(Arg1->getType())+","+getTypeName(Arg2->getType());
- BadSig = false;
- }
- break;
- default:
- BadSig = true;
- }
-
- bool RetVoid = (F->getReturnType()->getTypeID() == Type::VoidTyID);
- if (BadSig || (!F->getReturnType()->isInteger() && !RetVoid)) {
- Out << "\tldc.i4.0\n";
- } else {
- Out << "\tcall\t" << getTypeName(F->getReturnType()) <<
- getConvModopt(F->getCallingConv()) << "main(" << Args << ")\n";
- if (RetVoid)
- Out << "\tldc.i4.0\n";
- else
- Out << "\tconv.i4\n";
- }
- Out << "\tret\n}\n";
-}
-
-bool MSILWriter::isZeroValue(const Value* V) {
- if (const Constant *C = dyn_cast<Constant>(V))
- return C->isNullValue();
- return false;
-}
-
-
-std::string MSILWriter::getValueName(const Value* V) {
- // Name into the quotes allow control and space characters.
- return "'"+Mang->getValueName(V)+"'";
-}
-
-
-std::string MSILWriter::getLabelName(const std::string& Name) {
- if (Name.find('.')!=std::string::npos) {
- std::string Tmp(Name);
- // Replace unaccepable characters in the label name.
- for (std::string::iterator I = Tmp.begin(), E = Tmp.end(); I!=E; ++I)
- if (*I=='.') *I = '@';
- return Tmp;
- }
- return Name;
-}
-
-
-std::string MSILWriter::getLabelName(const Value* V) {
- return getLabelName(Mang->getValueName(V));
-}
-
-
-std::string MSILWriter::getConvModopt(unsigned CallingConvID) {
- switch (CallingConvID) {
- case CallingConv::C:
- case CallingConv::Cold:
- case CallingConv::Fast:
- return "modopt([mscorlib]System.Runtime.CompilerServices.CallConvCdecl) ";
- case CallingConv::X86_FastCall:
- return "modopt([mscorlib]System.Runtime.CompilerServices.CallConvFastcall) ";
- case CallingConv::X86_StdCall:
- return "modopt([mscorlib]System.Runtime.CompilerServices.CallConvStdcall) ";
- default:
- cerr << "CallingConvID = " << CallingConvID << '\n';
- assert(0 && "Unsupported calling convention");
- }
- return ""; // Not reached
-}
-
-
-std::string MSILWriter::getArrayTypeName(Type::TypeID TyID, const Type* Ty) {
- std::string Tmp = "";
- const Type* ElemTy = Ty;
- assert(Ty->getTypeID()==TyID && "Invalid type passed");
- // Walk trought array element types.
- for (;;) {
- // Multidimensional array.
- if (ElemTy->getTypeID()==TyID) {
- if (const ArrayType* ATy = dyn_cast<ArrayType>(ElemTy))
- Tmp += utostr(ATy->getNumElements());
- else if (const VectorType* VTy = dyn_cast<VectorType>(ElemTy))
- Tmp += utostr(VTy->getNumElements());
- ElemTy = cast<SequentialType>(ElemTy)->getElementType();
- }
- // Base element type found.
- if (ElemTy->getTypeID()!=TyID) break;
- Tmp += ",";
- }
- return getTypeName(ElemTy, false, true)+"["+Tmp+"]";
-}
-
-
-std::string MSILWriter::getPrimitiveTypeName(const Type* Ty, bool isSigned) {
- unsigned NumBits = 0;
- switch (Ty->getTypeID()) {
- case Type::VoidTyID:
- return "void ";
- case Type::IntegerTyID:
- NumBits = getBitWidth(Ty);
- if(NumBits==1)
- return "bool ";
- if (!isSigned)
- return "unsigned int"+utostr(NumBits)+" ";
- return "int"+utostr(NumBits)+" ";
- case Type::FloatTyID:
- return "float32 ";
- case Type::DoubleTyID:
- return "float64 ";
- default:
- cerr << "Type = " << *Ty << '\n';
- assert(0 && "Invalid primitive type");
- }
- return ""; // Not reached
-}
-
-
-std::string MSILWriter::getTypeName(const Type* Ty, bool isSigned,
- bool isNested) {
- if (Ty->isPrimitiveType() || Ty->isInteger())
- return getPrimitiveTypeName(Ty,isSigned);
- // FIXME: "OpaqueType" support
- switch (Ty->getTypeID()) {
- case Type::PointerTyID:
- return "void* ";
- case Type::StructTyID:
- if (isNested)
- return ModulePtr->getTypeName(Ty);
- return "valuetype '"+ModulePtr->getTypeName(Ty)+"' ";
- case Type::ArrayTyID:
- if (isNested)
- return getArrayTypeName(Ty->getTypeID(),Ty);
- return "valuetype '"+getArrayTypeName(Ty->getTypeID(),Ty)+"' ";
- case Type::VectorTyID:
- if (isNested)
- return getArrayTypeName(Ty->getTypeID(),Ty);
- return "valuetype '"+getArrayTypeName(Ty->getTypeID(),Ty)+"' ";
- default:
- cerr << "Type = " << *Ty << '\n';
- assert(0 && "Invalid type in getTypeName()");
- }
- return ""; // Not reached
-}
-
-
-MSILWriter::ValueType MSILWriter::getValueLocation(const Value* V) {
- // Function argument
- if (isa<Argument>(V))
- return ArgumentVT;
- // Function
- else if (const Function* F = dyn_cast<Function>(V))
- return F->hasInternalLinkage() ? InternalVT : GlobalVT;
- // Variable
- else if (const GlobalVariable* G = dyn_cast<GlobalVariable>(V))
- return G->hasInternalLinkage() ? InternalVT : GlobalVT;
- // Constant
- else if (isa<Constant>(V))
- return isa<ConstantExpr>(V) ? ConstExprVT : ConstVT;
- // Local variable
- return LocalVT;
-}
-
-
-std::string MSILWriter::getTypePostfix(const Type* Ty, bool Expand,
- bool isSigned) {
- unsigned NumBits = 0;
- switch (Ty->getTypeID()) {
- // Integer constant, expanding for stack operations.
- case Type::IntegerTyID:
- NumBits = getBitWidth(Ty);
- // Expand integer value to "int32" or "int64".
- if (Expand) return (NumBits<=32 ? "i4" : "i8");
- if (NumBits==1) return "i1";
- return (isSigned ? "i" : "u")+utostr(NumBits/8);
- // Float constant.
- case Type::FloatTyID:
- return "r4";
- case Type::DoubleTyID:
- return "r8";
- case Type::PointerTyID:
- return "i"+utostr(TD->getABITypeSize(Ty));
- default:
- cerr << "TypeID = " << Ty->getTypeID() << '\n';
- assert(0 && "Invalid type in TypeToPostfix()");
- }
- return ""; // Not reached
-}
-
-
-void MSILWriter::printConvToPtr() {
- switch (ModulePtr->getPointerSize()) {
- case Module::Pointer32:
- printSimpleInstruction("conv.u4");
- break;
- case Module::Pointer64:
- printSimpleInstruction("conv.u8");
- break;
- default:
- assert(0 && "Module use not supporting pointer size");
- }
-}
-
-
-void MSILWriter::printPtrLoad(uint64_t N) {
- switch (ModulePtr->getPointerSize()) {
- case Module::Pointer32:
- printSimpleInstruction("ldc.i4",utostr(N).c_str());
- // FIXME: Need overflow test?
- if (!isUInt32(N)) {
- cerr << "Value = " << utostr(N) << '\n';
- assert(0 && "32-bit pointer overflowed");
- }
- break;
- case Module::Pointer64:
- printSimpleInstruction("ldc.i8",utostr(N).c_str());
- break;
- default:
- assert(0 && "Module use not supporting pointer size");
- }
-}
-
-
-void MSILWriter::printValuePtrLoad(const Value* V) {
- printValueLoad(V);
- printConvToPtr();
-}
-
-
-void MSILWriter::printConstLoad(const Constant* C) {
- if (const ConstantInt* CInt = dyn_cast<ConstantInt>(C)) {
- // Integer constant
- Out << "\tldc." << getTypePostfix(C->getType(),true) << '\t';
- if (CInt->isMinValue(true))
- Out << CInt->getSExtValue();
- else
- Out << CInt->getZExtValue();
- } else if (const ConstantFP* FP = dyn_cast<ConstantFP>(C)) {
- // Float constant
- uint64_t X;
- unsigned Size;
- if (FP->getType()->getTypeID()==Type::FloatTyID) {
- X = (uint32_t)FP->getValueAPF().convertToAPInt().getZExtValue();
- Size = 4;
- } else {
- X = FP->getValueAPF().convertToAPInt().getZExtValue();
- Size = 8;
- }
- Out << "\tldc.r" << Size << "\t( " << utohexstr(X) << ')';
- } else if (isa<UndefValue>(C)) {
- // Undefined constant value = NULL.
- printPtrLoad(0);
- } else {
- cerr << "Constant = " << *C << '\n';
- assert(0 && "Invalid constant value");
- }
- Out << '\n';
-}
-
-
-void MSILWriter::printValueLoad(const Value* V) {
- MSILWriter::ValueType Location = getValueLocation(V);
- switch (Location) {
- // Global variable or function address.
- case GlobalVT:
- case InternalVT:
- if (const Function* F = dyn_cast<Function>(V)) {
- std::string Name = getConvModopt(F->getCallingConv())+getValueName(F);
- printSimpleInstruction("ldftn",
- getCallSignature(F->getFunctionType(),NULL,Name).c_str());
- } else {
- std::string Tmp;
- const Type* ElemTy = cast<PointerType>(V->getType())->getElementType();
- if (Location==GlobalVT && cast<GlobalVariable>(V)->hasDLLImportLinkage()) {
- Tmp = "void* "+getValueName(V);
- printSimpleInstruction("ldsfld",Tmp.c_str());
- } else {
- Tmp = getTypeName(ElemTy)+getValueName(V);
- printSimpleInstruction("ldsflda",Tmp.c_str());
- }
- }
- break;
- // Function argument.
- case ArgumentVT:
- printSimpleInstruction("ldarg",getValueName(V).c_str());
- break;
- // Local function variable.
- case LocalVT:
- printSimpleInstruction("ldloc",getValueName(V).c_str());
- break;
- // Constant value.
- case ConstVT:
- if (isa<ConstantPointerNull>(V))
- printPtrLoad(0);
- else
- printConstLoad(cast<Constant>(V));
- break;
- // Constant expression.
- case ConstExprVT:
- printConstantExpr(cast<ConstantExpr>(V));
- break;
- default:
- cerr << "Value = " << *V << '\n';
- assert(0 && "Invalid value location");
- }
-}
-
-
-void MSILWriter::printValueSave(const Value* V) {
- switch (getValueLocation(V)) {
- case ArgumentVT:
- printSimpleInstruction("starg",getValueName(V).c_str());
- break;
- case LocalVT:
- printSimpleInstruction("stloc",getValueName(V).c_str());
- break;
- default:
- cerr << "Value = " << *V << '\n';
- assert(0 && "Invalid value location");
- }
-}
-
-
-void MSILWriter::printBinaryInstruction(const char* Name, const Value* Left,
- const Value* Right) {
- printValueLoad(Left);
- printValueLoad(Right);
- Out << '\t' << Name << '\n';
-}
-
-
-void MSILWriter::printSimpleInstruction(const char* Inst, const char* Operand) {
- if(Operand)
- Out << '\t' << Inst << '\t' << Operand << '\n';
- else
- Out << '\t' << Inst << '\n';
-}
-
-
-void MSILWriter::printPHICopy(const BasicBlock* Src, const BasicBlock* Dst) {
- for (BasicBlock::const_iterator I = Dst->begin(), E = Dst->end();
- isa<PHINode>(I); ++I) {
- const PHINode* Phi = cast<PHINode>(I);
- const Value* Val = Phi->getIncomingValueForBlock(Src);
- if (isa<UndefValue>(Val)) continue;
- printValueLoad(Val);
- printValueSave(Phi);
- }
-}
-
-
-void MSILWriter::printBranchToBlock(const BasicBlock* CurrBB,
- const BasicBlock* TrueBB,
- const BasicBlock* FalseBB) {
- if (TrueBB==FalseBB) {
- // "TrueBB" and "FalseBB" destination equals
- printPHICopy(CurrBB,TrueBB);
- printSimpleInstruction("pop");
- printSimpleInstruction("br",getLabelName(TrueBB).c_str());
- } else if (FalseBB==NULL) {
- // If "FalseBB" not used the jump have condition
- printPHICopy(CurrBB,TrueBB);
- printSimpleInstruction("brtrue",getLabelName(TrueBB).c_str());
- } else if (TrueBB==NULL) {
- // If "TrueBB" not used the jump is unconditional
- printPHICopy(CurrBB,FalseBB);
- printSimpleInstruction("br",getLabelName(FalseBB).c_str());
- } else {
- // Copy PHI instructions for each block
- std::string TmpLabel;
- // Print PHI instructions for "TrueBB"
- if (isa<PHINode>(TrueBB->begin())) {
- TmpLabel = getLabelName(TrueBB)+"$phi_"+utostr(getUniqID());
- printSimpleInstruction("brtrue",TmpLabel.c_str());
- } else {
- printSimpleInstruction("brtrue",getLabelName(TrueBB).c_str());
- }
- // Print PHI instructions for "FalseBB"
- if (isa<PHINode>(FalseBB->begin())) {
- printPHICopy(CurrBB,FalseBB);
- printSimpleInstruction("br",getLabelName(FalseBB).c_str());
- } else {
- printSimpleInstruction("br",getLabelName(FalseBB).c_str());
- }
- if (isa<PHINode>(TrueBB->begin())) {
- // Handle "TrueBB" PHI Copy
- Out << TmpLabel << ":\n";
- printPHICopy(CurrBB,TrueBB);
- printSimpleInstruction("br",getLabelName(TrueBB).c_str());
- }
- }
-}
-
-
-void MSILWriter::printBranchInstruction(const BranchInst* Inst) {
- if (Inst->isUnconditional()) {
- printBranchToBlock(Inst->getParent(),NULL,Inst->getSuccessor(0));
- } else {
- printValueLoad(Inst->getCondition());
- printBranchToBlock(Inst->getParent(),Inst->getSuccessor(0),
- Inst->getSuccessor(1));
- }
-}
-
-
-void MSILWriter::printSelectInstruction(const Value* Cond, const Value* VTrue,
- const Value* VFalse) {
- std::string TmpLabel = std::string("select$true_")+utostr(getUniqID());
- printValueLoad(VTrue);
- printValueLoad(Cond);
- printSimpleInstruction("brtrue",TmpLabel.c_str());
- printSimpleInstruction("pop");
- printValueLoad(VFalse);
- Out << TmpLabel << ":\n";
-}
-
-
-void MSILWriter::printIndirectLoad(const Value* V) {
- const Type* Ty = V->getType();
- printValueLoad(V);
- if (const PointerType* P = dyn_cast<PointerType>(Ty))
- Ty = P->getElementType();
- std::string Tmp = "ldind."+getTypePostfix(Ty, false);
- printSimpleInstruction(Tmp.c_str());
-}
-
-
-void MSILWriter::printIndirectSave(const Value* Ptr, const Value* Val) {
- printValueLoad(Ptr);
- printValueLoad(Val);
- printIndirectSave(Val->getType());
-}
-
-
-void MSILWriter::printIndirectSave(const Type* Ty) {
- // Instruction need signed postfix for any type.
- std::string postfix = getTypePostfix(Ty, false);
- if (*postfix.begin()=='u') *postfix.begin() = 'i';
- postfix = "stind."+postfix;
- printSimpleInstruction(postfix.c_str());
-}
-
-
-void MSILWriter::printCastInstruction(unsigned int Op, const Value* V,
- const Type* Ty) {
- std::string Tmp("");
- printValueLoad(V);
- switch (Op) {
- // Signed
- case Instruction::SExt:
- case Instruction::SIToFP:
- case Instruction::FPToSI:
- Tmp = "conv."+getTypePostfix(Ty,false,true);
- printSimpleInstruction(Tmp.c_str());
- break;
- // Unsigned
- case Instruction::FPTrunc:
- case Instruction::FPExt:
- case Instruction::UIToFP:
- case Instruction::Trunc:
- case Instruction::ZExt:
- case Instruction::FPToUI:
- case Instruction::PtrToInt:
- case Instruction::IntToPtr:
- Tmp = "conv."+getTypePostfix(Ty,false);
- printSimpleInstruction(Tmp.c_str());
- break;
- // Do nothing
- case Instruction::BitCast:
- // FIXME: meaning that ld*/st* instruction do not change data format.
- break;
- default:
- cerr << "Opcode = " << Op << '\n';
- assert(0 && "Invalid conversion instruction");
- }
-}
-
-
-void MSILWriter::printGepInstruction(const Value* V, gep_type_iterator I,
- gep_type_iterator E) {
- unsigned Size;
- // Load address
- printValuePtrLoad(V);
- // Calculate element offset.
- for (; I!=E; ++I){
- Size = 0;
- const Value* IndexValue = I.getOperand();
- if (const StructType* StrucTy = dyn_cast<StructType>(*I)) {
- uint64_t FieldIndex = cast<ConstantInt>(IndexValue)->getZExtValue();
- // Offset is the sum of all previous structure fields.
- for (uint64_t F = 0; F<FieldIndex; ++F)
- Size += TD->getABITypeSize(StrucTy->getContainedType((unsigned)F));
- printPtrLoad(Size);
- printSimpleInstruction("add");
- continue;
- } else if (const SequentialType* SeqTy = dyn_cast<SequentialType>(*I)) {
- Size = TD->getABITypeSize(SeqTy->getElementType());
- } else {
- Size = TD->getABITypeSize(*I);
- }
- // Add offset of current element to stack top.
- if (!isZeroValue(IndexValue)) {
- // Constant optimization.
- if (const ConstantInt* C = dyn_cast<ConstantInt>(IndexValue)) {
- if (C->getValue().isNegative()) {
- printPtrLoad(C->getValue().abs().getZExtValue()*Size);
- printSimpleInstruction("sub");
- continue;
- } else
- printPtrLoad(C->getZExtValue()*Size);
- } else {
- printPtrLoad(Size);
- printValuePtrLoad(IndexValue);
- printSimpleInstruction("mul");
- }
- printSimpleInstruction("add");
- }
- }
-}
-
-
-std::string MSILWriter::getCallSignature(const FunctionType* Ty,
- const Instruction* Inst,
- std::string Name) {
- std::string Tmp("");
- if (Ty->isVarArg()) Tmp += "vararg ";
- // Name and return type.
- Tmp += getTypeName(Ty->getReturnType())+Name+"(";
- // Function argument type list.
- unsigned NumParams = Ty->getNumParams();
- for (unsigned I = 0; I!=NumParams; ++I) {
- if (I!=0) Tmp += ",";
- Tmp += getTypeName(Ty->getParamType(I));
- }
- // CLR needs to know the exact amount of parameters received by vararg
- // function, because caller cleans the stack.
- if (Ty->isVarArg() && Inst) {
- // Origin to function arguments in "CallInst" or "InvokeInst".
- unsigned Org = isa<InvokeInst>(Inst) ? 3 : 1;
- // Print variable argument types.
- unsigned NumOperands = Inst->getNumOperands()-Org;
- if (NumParams<NumOperands) {
- if (NumParams!=0) Tmp += ", ";
- Tmp += "... , ";
- for (unsigned J = NumParams; J!=NumOperands; ++J) {
- if (J!=NumParams) Tmp += ", ";
- Tmp += getTypeName(Inst->getOperand(J+Org)->getType());
- }
- }
- }
- return Tmp+")";
-}
-
-
-void MSILWriter::printFunctionCall(const Value* FnVal,
- const Instruction* Inst) {
- // Get function calling convention.
- std::string Name = "";
- if (const CallInst* Call = dyn_cast<CallInst>(Inst))
- Name = getConvModopt(Call->getCallingConv());
- else if (const InvokeInst* Invoke = dyn_cast<InvokeInst>(Inst))
- Name = getConvModopt(Invoke->getCallingConv());
- else {
- cerr << "Instruction = " << Inst->getName() << '\n';
- assert(0 && "Need \"Invoke\" or \"Call\" instruction only");
- }
- if (const Function* F = dyn_cast<Function>(FnVal)) {
- // Direct call.
- Name += getValueName(F);
- printSimpleInstruction("call",
- getCallSignature(F->getFunctionType(),Inst,Name).c_str());
- } else {
- // Indirect function call.
- const PointerType* PTy = cast<PointerType>(FnVal->getType());
- const FunctionType* FTy = cast<FunctionType>(PTy->getElementType());
- // Load function address.
- printValueLoad(FnVal);
- printSimpleInstruction("calli",getCallSignature(FTy,Inst,Name).c_str());
- }
-}
-
-
-void MSILWriter::printIntrinsicCall(const IntrinsicInst* Inst) {
- std::string Name;
- switch (Inst->getIntrinsicID()) {
- case Intrinsic::vastart:
- Name = getValueName(Inst->getOperand(1));
- Name.insert(Name.length()-1,"$valist");
- // Obtain the argument handle.
- printSimpleInstruction("ldloca",Name.c_str());
- printSimpleInstruction("arglist");
- printSimpleInstruction("call",
- "instance void [mscorlib]System.ArgIterator::.ctor"
- "(valuetype [mscorlib]System.RuntimeArgumentHandle)");
- // Save as pointer type "void*"
- printValueLoad(Inst->getOperand(1));
- printSimpleInstruction("ldloca",Name.c_str());
- printIndirectSave(PointerType::getUnqual(IntegerType::get(8)));
- break;
- case Intrinsic::vaend:
- // Close argument list handle.
- printIndirectLoad(Inst->getOperand(1));
- printSimpleInstruction("call","instance void [mscorlib]System.ArgIterator::End()");
- break;
- case Intrinsic::vacopy:
- // Copy "ArgIterator" valuetype.
- printIndirectLoad(Inst->getOperand(1));
- printIndirectLoad(Inst->getOperand(2));
- printSimpleInstruction("cpobj","[mscorlib]System.ArgIterator");
- break;
- default:
- cerr << "Intrinsic ID = " << Inst->getIntrinsicID() << '\n';
- assert(0 && "Invalid intrinsic function");
- }
-}
-
-
-void MSILWriter::printCallInstruction(const Instruction* Inst) {
- if (isa<IntrinsicInst>(Inst)) {
- // Handle intrinsic function.
- printIntrinsicCall(cast<IntrinsicInst>(Inst));
- } else {
- // Load arguments to stack and call function.
- for (int I = 1, E = Inst->getNumOperands(); I!=E; ++I)
- printValueLoad(Inst->getOperand(I));
- printFunctionCall(Inst->getOperand(0),Inst);
- }
-}
-
-
-void MSILWriter::printICmpInstruction(unsigned Predicate, const Value* Left,
- const Value* Right) {
- switch (Predicate) {
- case ICmpInst::ICMP_EQ:
- printBinaryInstruction("ceq",Left,Right);
- break;
- case ICmpInst::ICMP_NE:
- // Emulate = not neg (Op1 eq Op2)
- printBinaryInstruction("ceq",Left,Right);
- printSimpleInstruction("neg");
- printSimpleInstruction("not");
- break;
- case ICmpInst::ICMP_ULE:
- case ICmpInst::ICMP_SLE:
- // Emulate = (Op1 eq Op2) or (Op1 lt Op2)
- printBinaryInstruction("ceq",Left,Right);
- if (Predicate==ICmpInst::ICMP_ULE)
- printBinaryInstruction("clt.un",Left,Right);
- else
- printBinaryInstruction("clt",Left,Right);
- printSimpleInstruction("or");
- break;
- case ICmpInst::ICMP_UGE:
- case ICmpInst::ICMP_SGE:
- // Emulate = (Op1 eq Op2) or (Op1 gt Op2)
- printBinaryInstruction("ceq",Left,Right);
- if (Predicate==ICmpInst::ICMP_UGE)
- printBinaryInstruction("cgt.un",Left,Right);
- else
- printBinaryInstruction("cgt",Left,Right);
- printSimpleInstruction("or");
- break;
- case ICmpInst::ICMP_ULT:
- printBinaryInstruction("clt.un",Left,Right);
- break;
- case ICmpInst::ICMP_SLT:
- printBinaryInstruction("clt",Left,Right);
- break;
- case ICmpInst::ICMP_UGT:
- printBinaryInstruction("cgt.un",Left,Right);
- case ICmpInst::ICMP_SGT:
- printBinaryInstruction("cgt",Left,Right);
- break;
- default:
- cerr << "Predicate = " << Predicate << '\n';
- assert(0 && "Invalid icmp predicate");
- }
-}
-
-
-void MSILWriter::printFCmpInstruction(unsigned Predicate, const Value* Left,
- const Value* Right) {
- // FIXME: Correct comparison
- std::string NanFunc = "bool [mscorlib]System.Double::IsNaN(float64)";
- switch (Predicate) {
- case FCmpInst::FCMP_UGT:
- // X > Y || llvm_fcmp_uno(X, Y)
- printBinaryInstruction("cgt",Left,Right);
- printFCmpInstruction(FCmpInst::FCMP_UNO,Left,Right);
- printSimpleInstruction("or");
- break;
- case FCmpInst::FCMP_OGT:
- // X > Y
- printBinaryInstruction("cgt",Left,Right);
- break;
- case FCmpInst::FCMP_UGE:
- // X >= Y || llvm_fcmp_uno(X, Y)
- printBinaryInstruction("ceq",Left,Right);
- printBinaryInstruction("cgt",Left,Right);
- printSimpleInstruction("or");
- printFCmpInstruction(FCmpInst::FCMP_UNO,Left,Right);
- printSimpleInstruction("or");
- break;
- case FCmpInst::FCMP_OGE:
- // X >= Y
- printBinaryInstruction("ceq",Left,Right);
- printBinaryInstruction("cgt",Left,Right);
- printSimpleInstruction("or");
- break;
- case FCmpInst::FCMP_ULT:
- // X < Y || llvm_fcmp_uno(X, Y)
- printBinaryInstruction("clt",Left,Right);
- printFCmpInstruction(FCmpInst::FCMP_UNO,Left,Right);
- printSimpleInstruction("or");
- break;
- case FCmpInst::FCMP_OLT:
- // X < Y
- printBinaryInstruction("clt",Left,Right);
- break;
- case FCmpInst::FCMP_ULE:
- // X <= Y || llvm_fcmp_uno(X, Y)
- printBinaryInstruction("ceq",Left,Right);
- printBinaryInstruction("clt",Left,Right);
- printSimpleInstruction("or");
- printFCmpInstruction(FCmpInst::FCMP_UNO,Left,Right);
- printSimpleInstruction("or");
- break;
- case FCmpInst::FCMP_OLE:
- // X <= Y
- printBinaryInstruction("ceq",Left,Right);
- printBinaryInstruction("clt",Left,Right);
- printSimpleInstruction("or");
- break;
- case FCmpInst::FCMP_UEQ:
- // X == Y || llvm_fcmp_uno(X, Y)
- printBinaryInstruction("ceq",Left,Right);
- printFCmpInstruction(FCmpInst::FCMP_UNO,Left,Right);
- printSimpleInstruction("or");
- break;
- case FCmpInst::FCMP_OEQ:
- // X == Y
- printBinaryInstruction("ceq",Left,Right);
- break;
- case FCmpInst::FCMP_UNE:
- // X != Y
- printBinaryInstruction("ceq",Left,Right);
- printSimpleInstruction("neg");
- printSimpleInstruction("not");
- break;
- case FCmpInst::FCMP_ONE:
- // X != Y && llvm_fcmp_ord(X, Y)
- printBinaryInstruction("ceq",Left,Right);
- printSimpleInstruction("not");
- break;
- case FCmpInst::FCMP_ORD:
- // return X == X && Y == Y
- printBinaryInstruction("ceq",Left,Left);
- printBinaryInstruction("ceq",Right,Right);
- printSimpleInstruction("or");
- break;
- case FCmpInst::FCMP_UNO:
- // X != X || Y != Y
- printBinaryInstruction("ceq",Left,Left);
- printSimpleInstruction("not");
- printBinaryInstruction("ceq",Right,Right);
- printSimpleInstruction("not");
- printSimpleInstruction("or");
- break;
- default:
- assert(0 && "Illegal FCmp predicate");
- }
-}
-
-
-void MSILWriter::printInvokeInstruction(const InvokeInst* Inst) {
- std::string Label = "leave$normal_"+utostr(getUniqID());
- Out << ".try {\n";
- // Load arguments
- for (int I = 3, E = Inst->getNumOperands(); I!=E; ++I)
- printValueLoad(Inst->getOperand(I));
- // Print call instruction
- printFunctionCall(Inst->getOperand(0),Inst);
- // Save function result and leave "try" block
- printValueSave(Inst);
- printSimpleInstruction("leave",Label.c_str());
- Out << "}\n";
- Out << "catch [mscorlib]System.Exception {\n";
- // Redirect to unwind block
- printSimpleInstruction("pop");
- printBranchToBlock(Inst->getParent(),NULL,Inst->getUnwindDest());
- Out << "}\n" << Label << ":\n";
- // Redirect to continue block
- printBranchToBlock(Inst->getParent(),NULL,Inst->getNormalDest());
-}
-
-
-void MSILWriter::printSwitchInstruction(const SwitchInst* Inst) {
- // FIXME: Emulate with IL "switch" instruction
- // Emulate = if () else if () else if () else ...
- for (unsigned int I = 1, E = Inst->getNumCases(); I!=E; ++I) {
- printValueLoad(Inst->getCondition());
- printValueLoad(Inst->getCaseValue(I));
- printSimpleInstruction("ceq");
- // Condition jump to successor block
- printBranchToBlock(Inst->getParent(),Inst->getSuccessor(I),NULL);
- }
- // Jump to default block
- printBranchToBlock(Inst->getParent(),NULL,Inst->getDefaultDest());
-}
-
-
-void MSILWriter::printVAArgInstruction(const VAArgInst* Inst) {
- printIndirectLoad(Inst->getOperand(0));
- printSimpleInstruction("call",
- "instance typedref [mscorlib]System.ArgIterator::GetNextArg()");
- printSimpleInstruction("refanyval","void*");
- std::string Name =
- "ldind."+getTypePostfix(PointerType::getUnqual(IntegerType::get(8)),false);
- printSimpleInstruction(Name.c_str());
-}
-
-
-void MSILWriter::printAllocaInstruction(const AllocaInst* Inst) {
- uint64_t Size = TD->getABITypeSize(Inst->getAllocatedType());
- // Constant optimization.
- if (const ConstantInt* CInt = dyn_cast<ConstantInt>(Inst->getOperand(0))) {
- printPtrLoad(CInt->getZExtValue()*Size);
- } else {
- printPtrLoad(Size);
- printValueLoad(Inst->getOperand(0));
- printSimpleInstruction("mul");
- }
- printSimpleInstruction("localloc");
-}
-
-
-void MSILWriter::printInstruction(const Instruction* Inst) {
- const Value *Left = 0, *Right = 0;
- if (Inst->getNumOperands()>=1) Left = Inst->getOperand(0);
- if (Inst->getNumOperands()>=2) Right = Inst->getOperand(1);
- // Print instruction
- // FIXME: "ShuffleVector","ExtractElement","InsertElement" support.
- switch (Inst->getOpcode()) {
- // Terminator
- case Instruction::Ret:
- if (Inst->getNumOperands()) {
- printValueLoad(Left);
- printSimpleInstruction("ret");
- } else
- printSimpleInstruction("ret");
- break;
- case Instruction::Br:
- printBranchInstruction(cast<BranchInst>(Inst));
- break;
- // Binary
- case Instruction::Add:
- printBinaryInstruction("add",Left,Right);
- break;
- case Instruction::Sub:
- printBinaryInstruction("sub",Left,Right);
- break;
- case Instruction::Mul:
- printBinaryInstruction("mul",Left,Right);
- break;
- case Instruction::UDiv:
- printBinaryInstruction("div.un",Left,Right);
- break;
- case Instruction::SDiv:
- case Instruction::FDiv:
- printBinaryInstruction("div",Left,Right);
- break;
- case Instruction::URem:
- printBinaryInstruction("rem.un",Left,Right);
- break;
- case Instruction::SRem:
- case Instruction::FRem:
- printBinaryInstruction("rem",Left,Right);
- break;
- // Binary Condition
- case Instruction::ICmp:
- printICmpInstruction(cast<ICmpInst>(Inst)->getPredicate(),Left,Right);
- break;
- case Instruction::FCmp:
- printFCmpInstruction(cast<FCmpInst>(Inst)->getPredicate(),Left,Right);
- break;
- // Bitwise Binary
- case Instruction::And:
- printBinaryInstruction("and",Left,Right);
- break;
- case Instruction::Or:
- printBinaryInstruction("or",Left,Right);
- break;
- case Instruction::Xor:
- printBinaryInstruction("xor",Left,Right);
- break;
- case Instruction::Shl:
- printValueLoad(Left);
- printValueLoad(Right);
- printSimpleInstruction("conv.i4");
- printSimpleInstruction("shl");
- break;
- case Instruction::LShr:
- printValueLoad(Left);
- printValueLoad(Right);
- printSimpleInstruction("conv.i4");
- printSimpleInstruction("shr.un");
- break;
- case Instruction::AShr:
- printValueLoad(Left);
- printValueLoad(Right);
- printSimpleInstruction("conv.i4");
- printSimpleInstruction("shr");
- break;
- case Instruction::Select:
- printSelectInstruction(Inst->getOperand(0),Inst->getOperand(1),Inst->getOperand(2));
- break;
- case Instruction::Load:
- printIndirectLoad(Inst->getOperand(0));
- break;
- case Instruction::Store:
- printIndirectSave(Inst->getOperand(1), Inst->getOperand(0));
- break;
- case Instruction::Trunc:
- case Instruction::ZExt:
- case Instruction::SExt:
- case Instruction::FPTrunc:
- case Instruction::FPExt:
- case Instruction::UIToFP:
- case Instruction::SIToFP:
- case Instruction::FPToUI:
- case Instruction::FPToSI:
- case Instruction::PtrToInt:
- case Instruction::IntToPtr:
- case Instruction::BitCast:
- printCastInstruction(Inst->getOpcode(),Left,
- cast<CastInst>(Inst)->getDestTy());
- break;
- case Instruction::GetElementPtr:
- printGepInstruction(Inst->getOperand(0),gep_type_begin(Inst),
- gep_type_end(Inst));
- break;
- case Instruction::Call:
- printCallInstruction(cast<CallInst>(Inst));
- break;
- case Instruction::Invoke:
- printInvokeInstruction(cast<InvokeInst>(Inst));
- break;
- case Instruction::Unwind:
- printSimpleInstruction("newobj",
- "instance void [mscorlib]System.Exception::.ctor()");
- printSimpleInstruction("throw");
- break;
- case Instruction::Switch:
- printSwitchInstruction(cast<SwitchInst>(Inst));
- break;
- case Instruction::Alloca:
- printAllocaInstruction(cast<AllocaInst>(Inst));
- break;
- case Instruction::Malloc:
- assert(0 && "LowerAllocationsPass used");
- break;
- case Instruction::Free:
- assert(0 && "LowerAllocationsPass used");
- break;
- case Instruction::Unreachable:
- printSimpleInstruction("ldstr", "\"Unreachable instruction\"");
- printSimpleInstruction("newobj",
- "instance void [mscorlib]System.Exception::.ctor(string)");
- printSimpleInstruction("throw");
- break;
- case Instruction::VAArg:
- printVAArgInstruction(cast<VAArgInst>(Inst));
- break;
- default:
- cerr << "Instruction = " << Inst->getName() << '\n';
- assert(0 && "Unsupported instruction");
- }
-}
-
-
-void MSILWriter::printLoop(const Loop* L) {
- Out << getLabelName(L->getHeader()->getName()) << ":\n";
- const std::vector<BasicBlock*>& blocks = L->getBlocks();
- for (unsigned I = 0, E = blocks.size(); I!=E; I++) {
- BasicBlock* BB = blocks[I];
- Loop* BBLoop = LInfo->getLoopFor(BB);
- if (BBLoop == L)
- printBasicBlock(BB);
- else if (BB==BBLoop->getHeader() && BBLoop->getParentLoop()==L)
- printLoop(BBLoop);
- }
- printSimpleInstruction("br",getLabelName(L->getHeader()->getName()).c_str());
-}
-
-
-void MSILWriter::printBasicBlock(const BasicBlock* BB) {
- Out << getLabelName(BB) << ":\n";
- for (BasicBlock::const_iterator I = BB->begin(), E = BB->end(); I!=E; ++I) {
- const Instruction* Inst = I;
- // Comment llvm original instruction
- Out << "\n//" << *Inst << "\n";
- // Do not handle PHI instruction in current block
- if (Inst->getOpcode()==Instruction::PHI) continue;
- // Print instruction
- printInstruction(Inst);
- // Save result
- if (Inst->getType()!=Type::VoidTy) {
- // Do not save value after invoke, it done in "try" block
- if (Inst->getOpcode()==Instruction::Invoke) continue;
- printValueSave(Inst);
- }
- }
-}
-
-
-void MSILWriter::printLocalVariables(const Function& F) {
- std::string Name;
- const Type* Ty = NULL;
- std::set<const Value*> Printed;
- const Value* VaList = NULL;
- unsigned StackDepth = 8;
- // Find local variables
- for (const_inst_iterator I = inst_begin(&F), E = inst_end(&F); I!=E; ++I) {
- if (I->getOpcode()==Instruction::Call ||
- I->getOpcode()==Instruction::Invoke) {
- // Test stack depth.
- if (StackDepth<I->getNumOperands())
- StackDepth = I->getNumOperands();
- }
- const AllocaInst* AI = dyn_cast<AllocaInst>(&*I);
- if (AI && !isa<GlobalVariable>(AI)) {
- // Local variable allocation.
- Ty = PointerType::getUnqual(AI->getAllocatedType());
- Name = getValueName(AI);
- Out << "\t.locals (" << getTypeName(Ty) << Name << ")\n";
- } else if (I->getType()!=Type::VoidTy) {
- // Operation result.
- Ty = I->getType();
- Name = getValueName(&*I);
- Out << "\t.locals (" << getTypeName(Ty) << Name << ")\n";
- }
- // Test on 'va_list' variable
- bool isVaList = false;
- if (const VAArgInst* VaInst = dyn_cast<VAArgInst>(&*I)) {
- // "va_list" as "va_arg" instruction operand.
- isVaList = true;
- VaList = VaInst->getOperand(0);
- } else if (const IntrinsicInst* Inst = dyn_cast<IntrinsicInst>(&*I)) {
- // "va_list" as intrinsic function operand.
- switch (Inst->getIntrinsicID()) {
- case Intrinsic::vastart:
- case Intrinsic::vaend:
- case Intrinsic::vacopy:
- isVaList = true;
- VaList = Inst->getOperand(1);
- break;
- default:
- isVaList = false;
- }
- }
- // Print "va_list" variable.
- if (isVaList && Printed.insert(VaList).second) {
- Name = getValueName(VaList);
- Name.insert(Name.length()-1,"$valist");
- Out << "\t.locals (valuetype [mscorlib]System.ArgIterator "
- << Name << ")\n";
- }
- }
- printSimpleInstruction(".maxstack",utostr(StackDepth*2).c_str());
-}
-
-
-void MSILWriter::printFunctionBody(const Function& F) {
- // Print body
- for (Function::const_iterator I = F.begin(), E = F.end(); I!=E; ++I) {
- if (Loop *L = LInfo->getLoopFor(I)) {
- if (L->getHeader()==I && L->getParentLoop()==0)
- printLoop(L);
- } else {
- printBasicBlock(I);
- }
- }
-}
-
-
-void MSILWriter::printConstantExpr(const ConstantExpr* CE) {
- const Value *left = 0, *right = 0;
- if (CE->getNumOperands()>=1) left = CE->getOperand(0);
- if (CE->getNumOperands()>=2) right = CE->getOperand(1);
- // Print instruction
- switch (CE->getOpcode()) {
- case Instruction::Trunc:
- case Instruction::ZExt:
- case Instruction::SExt:
- case Instruction::FPTrunc:
- case Instruction::FPExt:
- case Instruction::UIToFP:
- case Instruction::SIToFP:
- case Instruction::FPToUI:
- case Instruction::FPToSI:
- case Instruction::PtrToInt:
- case Instruction::IntToPtr:
- case Instruction::BitCast:
- printCastInstruction(CE->getOpcode(),left,CE->getType());
- break;
- case Instruction::GetElementPtr:
- printGepInstruction(CE->getOperand(0),gep_type_begin(CE),gep_type_end(CE));
- break;
- case Instruction::ICmp:
- printICmpInstruction(CE->getPredicate(),left,right);
- break;
- case Instruction::FCmp:
- printFCmpInstruction(CE->getPredicate(),left,right);
- break;
- case Instruction::Select:
- printSelectInstruction(CE->getOperand(0),CE->getOperand(1),CE->getOperand(2));
- break;
- case Instruction::Add:
- printBinaryInstruction("add",left,right);
- break;
- case Instruction::Sub:
- printBinaryInstruction("sub",left,right);
- break;
- case Instruction::Mul:
- printBinaryInstruction("mul",left,right);
- break;
- case Instruction::UDiv:
- printBinaryInstruction("div.un",left,right);
- break;
- case Instruction::SDiv:
- case Instruction::FDiv:
- printBinaryInstruction("div",left,right);
- break;
- case Instruction::URem:
- printBinaryInstruction("rem.un",left,right);
- break;
- case Instruction::SRem:
- case Instruction::FRem:
- printBinaryInstruction("rem",left,right);
- break;
- case Instruction::And:
- printBinaryInstruction("and",left,right);
- break;
- case Instruction::Or:
- printBinaryInstruction("or",left,right);
- break;
- case Instruction::Xor:
- printBinaryInstruction("xor",left,right);
- break;
- case Instruction::Shl:
- printBinaryInstruction("shl",left,right);
- break;
- case Instruction::LShr:
- printBinaryInstruction("shr.un",left,right);
- break;
- case Instruction::AShr:
- printBinaryInstruction("shr",left,right);
- break;
- default:
- cerr << "Expression = " << *CE << "\n";
- assert(0 && "Invalid constant expression");
- }
-}
-
-
-void MSILWriter::printStaticInitializerList() {
- // List of global variables with uninitialized fields.
- for (std::map<const GlobalVariable*,std::vector<StaticInitializer> >::iterator
- VarI = StaticInitList.begin(), VarE = StaticInitList.end(); VarI!=VarE;
- ++VarI) {
- const std::vector<StaticInitializer>& InitList = VarI->second;
- if (InitList.empty()) continue;
- // For each uninitialized field.
- for (std::vector<StaticInitializer>::const_iterator I = InitList.begin(),
- E = InitList.end(); I!=E; ++I) {
- if (const ConstantExpr *CE = dyn_cast<ConstantExpr>(I->constant)) {
- Out << "\n// Init " << getValueName(VarI->first) << ", offset " <<
- utostr(I->offset) << ", type "<< *I->constant->getType() << "\n\n";
- // Load variable address
- printValueLoad(VarI->first);
- // Add offset
- if (I->offset!=0) {
- printPtrLoad(I->offset);
- printSimpleInstruction("add");
- }
- // Load value
- printConstantExpr(CE);
- // Save result at offset
- std::string postfix = getTypePostfix(CE->getType(),true);
- if (*postfix.begin()=='u') *postfix.begin() = 'i';
- postfix = "stind."+postfix;
- printSimpleInstruction(postfix.c_str());
- } else {
- cerr << "Constant = " << *I->constant << '\n';
- assert(0 && "Invalid static initializer");
- }
- }
- }
-}
-
-
-void MSILWriter::printFunction(const Function& F) {
- bool isSigned = F.paramHasAttr(0, ParamAttr::SExt);
- Out << "\n.method static ";
- Out << (F.hasInternalLinkage() ? "private " : "public ");
- if (F.isVarArg()) Out << "vararg ";
- Out << getTypeName(F.getReturnType(),isSigned) <<
- getConvModopt(F.getCallingConv()) << getValueName(&F) << '\n';
- // Arguments
- Out << "\t(";
- unsigned ArgIdx = 1;
- for (Function::const_arg_iterator I = F.arg_begin(), E = F.arg_end(); I!=E;
- ++I, ++ArgIdx) {
- isSigned = F.paramHasAttr(ArgIdx, ParamAttr::SExt);
- if (I!=F.arg_begin()) Out << ", ";
- Out << getTypeName(I->getType(),isSigned) << getValueName(I);
- }
- Out << ") cil managed\n";
- // Body
- Out << "{\n";
- printLocalVariables(F);
- printFunctionBody(F);
- Out << "}\n";
-}
-
-
-void MSILWriter::printDeclarations(const TypeSymbolTable& ST) {
- std::string Name;
- std::set<const Type*> Printed;
- for (std::set<const Type*>::const_iterator
- UI = UsedTypes->begin(), UE = UsedTypes->end(); UI!=UE; ++UI) {
- const Type* Ty = *UI;
- if (isa<ArrayType>(Ty) || isa<VectorType>(Ty) || isa<StructType>(Ty))
- Name = getTypeName(Ty, false, true);
- // Type with no need to declare.
- else continue;
- // Print not duplicated type
- if (Printed.insert(Ty).second) {
- Out << ".class value explicit ansi sealed '" << Name << "'";
- Out << " { .pack " << 1 << " .size " << TD->getABITypeSize(Ty)<< " }\n\n";
- }
- }
-}
-
-
-unsigned int MSILWriter::getBitWidth(const Type* Ty) {
- unsigned int N = Ty->getPrimitiveSizeInBits();
- assert(N!=0 && "Invalid type in getBitWidth()");
- switch (N) {
- case 1:
- case 8:
- case 16:
- case 32:
- case 64:
- return N;
- default:
- cerr << "Bits = " << N << '\n';
- assert(0 && "Unsupported integer width");
- }
- return 0; // Not reached
-}
-
-
-void MSILWriter::printStaticConstant(const Constant* C, uint64_t& Offset) {
- uint64_t TySize = 0;
- const Type* Ty = C->getType();
- // Print zero initialized constant.
- if (isa<ConstantAggregateZero>(C) || C->isNullValue()) {
- TySize = TD->getABITypeSize(C->getType());
- Offset += TySize;
- Out << "int8 (0) [" << TySize << "]";
- return;
- }
- // Print constant initializer
- switch (Ty->getTypeID()) {
- case Type::IntegerTyID: {
- TySize = TD->getABITypeSize(Ty);
- const ConstantInt* Int = cast<ConstantInt>(C);
- Out << getPrimitiveTypeName(Ty,true) << "(" << Int->getSExtValue() << ")";
- break;
- }
- case Type::FloatTyID:
- case Type::DoubleTyID: {
- TySize = TD->getABITypeSize(Ty);
- const ConstantFP* FP = cast<ConstantFP>(C);
- if (Ty->getTypeID() == Type::FloatTyID)
- Out << "int32 (" <<
- (uint32_t)FP->getValueAPF().convertToAPInt().getZExtValue() << ')';
- else
- Out << "int64 (" <<
- FP->getValueAPF().convertToAPInt().getZExtValue() << ')';
- break;
- }
- case Type::ArrayTyID:
- case Type::VectorTyID:
- case Type::StructTyID:
- for (unsigned I = 0, E = C->getNumOperands(); I<E; I++) {
- if (I!=0) Out << ",\n";
- printStaticConstant(C->getOperand(I),Offset);
- }
- break;
- case Type::PointerTyID:
- TySize = TD->getABITypeSize(C->getType());
- // Initialize with global variable address
- if (const GlobalVariable *G = dyn_cast<GlobalVariable>(C)) {
- std::string name = getValueName(G);
- Out << "&(" << name.insert(name.length()-1,"$data") << ")";
- } else {
- // Dynamic initialization
- if (!isa<ConstantPointerNull>(C) && !C->isNullValue())
- InitListPtr->push_back(StaticInitializer(C,Offset));
- // Null pointer initialization
- if (TySize==4) Out << "int32 (0)";
- else if (TySize==8) Out << "int64 (0)";
- else assert(0 && "Invalid pointer size");
- }
- break;
- default:
- cerr << "TypeID = " << Ty->getTypeID() << '\n';
- assert(0 && "Invalid type in printStaticConstant()");
- }
- // Increase offset.
- Offset += TySize;
-}
-
-
-void MSILWriter::printStaticInitializer(const Constant* C,
- const std::string& Name) {
- switch (C->getType()->getTypeID()) {
- case Type::IntegerTyID:
- case Type::FloatTyID:
- case Type::DoubleTyID:
- Out << getPrimitiveTypeName(C->getType(), false);
- break;
- case Type::ArrayTyID:
- case Type::VectorTyID:
- case Type::StructTyID:
- case Type::PointerTyID:
- Out << getTypeName(C->getType());
- break;
- default:
- cerr << "Type = " << *C << "\n";
- assert(0 && "Invalid constant type");
- }
- // Print initializer
- std::string label = Name;
- label.insert(label.length()-1,"$data");
- Out << Name << " at " << label << '\n';
- Out << ".data " << label << " = {\n";
- uint64_t offset = 0;
- printStaticConstant(C,offset);
- Out << "\n}\n\n";
-}
-
-
-void MSILWriter::printVariableDefinition(const GlobalVariable* G) {
- const Constant* C = G->getInitializer();
- if (C->isNullValue() || isa<ConstantAggregateZero>(C) || isa<UndefValue>(C))
- InitListPtr = 0;
- else
- InitListPtr = &StaticInitList[G];
- printStaticInitializer(C,getValueName(G));
-}
-
-
-void MSILWriter::printGlobalVariables() {
- if (ModulePtr->global_empty()) return;
- Module::global_iterator I,E;
- for (I = ModulePtr->global_begin(), E = ModulePtr->global_end(); I!=E; ++I) {
- // Variable definition
- Out << ".field static " << (I->isDeclaration() ? "public " :
- "private ");
- if (I->isDeclaration()) {
- Out << getTypeName(I->getType()) << getValueName(&*I) << "\n\n";
- } else
- printVariableDefinition(&*I);
- }
-}
-
-
-const char* MSILWriter::getLibraryName(const Function* F) {
- return getLibraryForSymbol(F->getName().c_str(), true, F->getCallingConv());
-}
-
-
-const char* MSILWriter::getLibraryName(const GlobalVariable* GV) {
- return getLibraryForSymbol(Mang->getValueName(GV).c_str(), false, 0);
-}
-
-
-const char* MSILWriter::getLibraryForSymbol(const char* Name, bool isFunction,
- unsigned CallingConv) {
- // TODO: Read *.def file with function and libraries definitions.
- return "MSVCRT.DLL";
-}
-
-
-void MSILWriter::printExternals() {
- Module::const_iterator I,E;
- // Functions.
- for (I=ModulePtr->begin(),E=ModulePtr->end(); I!=E; ++I) {
- // Skip intrisics
- if (I->isIntrinsic()) continue;
- if (I->isDeclaration()) {
- const Function* F = I;
- std::string Name = getConvModopt(F->getCallingConv())+getValueName(F);
- std::string Sig =
- getCallSignature(cast<FunctionType>(F->getFunctionType()), NULL, Name);
- Out << ".method static hidebysig pinvokeimpl(\""
- << getLibraryName(F) << "\")\n\t" << Sig << " preservesig {}\n\n";
- }
- }
- // External variables and static initialization.
- Out <<
- ".method public hidebysig static pinvokeimpl(\"KERNEL32.DLL\" ansi winapi)"
- " native int LoadLibrary(string) preservesig {}\n"
- ".method public hidebysig static pinvokeimpl(\"KERNEL32.DLL\" ansi winapi)"
- " native int GetProcAddress(native int, string) preservesig {}\n";
- Out <<
- ".method private static void* $MSIL_Import(string lib,string sym)\n"
- " managed cil\n{\n"
- "\tldarg\tlib\n"
- "\tcall\tnative int LoadLibrary(string)\n"
- "\tldarg\tsym\n"
- "\tcall\tnative int GetProcAddress(native int,string)\n"
- "\tdup\n"
- "\tbrtrue\tL_01\n"
- "\tldstr\t\"Can no import variable\"\n"
- "\tnewobj\tinstance void [mscorlib]System.Exception::.ctor(string)\n"
- "\tthrow\n"
- "L_01:\n"
- "\tret\n"
- "}\n\n"
- ".method static private void $MSIL_Init() managed cil\n{\n";
- printStaticInitializerList();
- // Foreach global variable.
- for (Module::global_iterator I = ModulePtr->global_begin(),
- E = ModulePtr->global_end(); I!=E; ++I) {
- if (!I->isDeclaration() || !I->hasDLLImportLinkage()) continue;
- // Use "LoadLibrary"/"GetProcAddress" to recive variable address.
- std::string Label = "not_null$_"+utostr(getUniqID());
- std::string Tmp = getTypeName(I->getType())+getValueName(&*I);
- printSimpleInstruction("ldsflda",Tmp.c_str());
- Out << "\tldstr\t\"" << getLibraryName(&*I) << "\"\n";
- Out << "\tldstr\t\"" << Mang->getValueName(&*I) << "\"\n";
- printSimpleInstruction("call","void* $MSIL_Import(string,string)");
- printIndirectSave(I->getType());
- }
- printSimpleInstruction("ret");
- Out << "}\n\n";
-}
-
-
-//===----------------------------------------------------------------------===//
-// External Interface declaration
-//===----------------------------------------------------------------------===//
-
-bool MSILTarget::addPassesToEmitWholeFile(PassManager &PM, std::ostream &o,
- CodeGenFileType FileType, bool Fast)
-{
- if (FileType != TargetMachine::AssemblyFile) return true;
- MSILWriter* Writer = new MSILWriter(o);
- PM.add(createGCLoweringPass());
- PM.add(createLowerAllocationsPass(true));
- // FIXME: Handle switch trougth native IL instruction "switch"
- PM.add(createLowerSwitchPass());
- PM.add(createCFGSimplificationPass());
- PM.add(new MSILModule(Writer->UsedTypes,Writer->TD));
- PM.add(Writer);
- PM.add(createCollectorMetadataDeleter());
- return false;
-}
diff --git a/release_23/lib/Target/MSIL/MSILWriter.h b/release_23/lib/Target/MSIL/MSILWriter.h
deleted file mode 100644
index 3ab6cd5ea516..000000000000
--- a/release_23/lib/Target/MSIL/MSILWriter.h
+++ /dev/null
@@ -1,255 +0,0 @@
-//===-- MSILWriter.h - TargetMachine for the MSIL ---------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file declares the MSILWriter that is used by the MSIL.
-//
-//===----------------------------------------------------------------------===//
-#ifndef MSILWRITER_H
-#define MSILWRITER_H
-
-#include "llvm/Constants.h"
-#include "llvm/Module.h"
-#include "llvm/Instructions.h"
-#include "llvm/IntrinsicInst.h"
-#include "llvm/Pass.h"
-#include "llvm/PassManager.h"
-#include "llvm/Analysis/FindUsedTypes.h"
-#include "llvm/Analysis/LoopInfo.h"
-#include "llvm/Support/GetElementPtrTypeIterator.h"
-#include "llvm/Target/TargetData.h"
-#include "llvm/Target/TargetMachine.h"
-#include "llvm/Target/TargetMachineRegistry.h"
-#include "llvm/Support/Mangler.h"
-#include <algorithm>
-#include <ios>
-using namespace llvm;
-
-namespace {
-
- class MSILModule : public ModulePass {
- Module *ModulePtr;
- const std::set<const Type *>*& UsedTypes;
- const TargetData*& TD;
-
- public:
- static char ID;
- MSILModule(const std::set<const Type *>*& _UsedTypes,
- const TargetData*& _TD)
- : ModulePass((intptr_t)&ID), UsedTypes(_UsedTypes), TD(_TD) {}
-
- void getAnalysisUsage(AnalysisUsage &AU) const {
- AU.addRequired<FindUsedTypes>();
- AU.addRequired<TargetData>();
- }
-
- virtual const char *getPassName() const {
- return "MSIL backend definitions";
- }
-
- virtual bool runOnModule(Module &M);
-
- };
-
- class MSILWriter : public FunctionPass {
- struct StaticInitializer {
- const Constant* constant;
- uint64_t offset;
-
- StaticInitializer()
- : constant(0), offset(0) {}
-
- StaticInitializer(const Constant* _constant, uint64_t _offset)
- : constant(_constant), offset(_offset) {}
- };
-
- uint64_t UniqID;
-
- uint64_t getUniqID() {
- return ++UniqID;
- }
-
- public:
- std::ostream &Out;
- Module* ModulePtr;
- const TargetData* TD;
- Mangler* Mang;
- LoopInfo *LInfo;
- std::vector<StaticInitializer>* InitListPtr;
- std::map<const GlobalVariable*,std::vector<StaticInitializer> >
- StaticInitList;
- const std::set<const Type *>* UsedTypes;
- static char ID;
- MSILWriter(std::ostream &o) : FunctionPass((intptr_t)&ID), Out(o) {
- UniqID = 0;
- }
-
- enum ValueType {
- UndefVT,
- GlobalVT,
- InternalVT,
- ArgumentVT,
- LocalVT,
- ConstVT,
- ConstExprVT
- };
-
- bool isVariable(ValueType V) {
- return V==GlobalVT || V==InternalVT || V==ArgumentVT || V==LocalVT;
- }
-
- bool isConstValue(ValueType V) {
- return V==ConstVT || V==ConstExprVT;
- }
-
- virtual const char *getPassName() const { return "MSIL backend"; }
-
- void getAnalysisUsage(AnalysisUsage &AU) const {
- AU.addRequired<LoopInfo>();
- AU.setPreservesAll();
- }
-
- bool runOnFunction(Function &F);
-
- virtual bool doInitialization(Module &M);
-
- virtual bool doFinalization(Module &M);
-
- void printModuleStartup();
-
- bool isZeroValue(const Value* V);
-
- std::string getValueName(const Value* V);
-
- std::string getLabelName(const Value* V);
-
- std::string getLabelName(const std::string& Name);
-
- std::string getConvModopt(unsigned CallingConvID);
-
- std::string getArrayTypeName(Type::TypeID TyID, const Type* Ty);
-
- std::string getPrimitiveTypeName(const Type* Ty, bool isSigned);
-
- std::string getFunctionTypeName(const Type* Ty);
-
- std::string getPointerTypeName(const Type* Ty);
-
- std::string getTypeName(const Type* Ty, bool isSigned = false,
- bool isNested = false);
-
- ValueType getValueLocation(const Value* V);
-
- std::string getTypePostfix(const Type* Ty, bool Expand,
- bool isSigned = false);
-
- void printConvToPtr();
-
- void printPtrLoad(uint64_t N);
-
- void printValuePtrLoad(const Value* V);
-
- void printConstLoad(const Constant* C);
-
- void printValueLoad(const Value* V);
-
- void printValueSave(const Value* V);
-
- void printBinaryInstruction(const char* Name, const Value* Left,
- const Value* Right);
-
- void printSimpleInstruction(const char* Inst, const char* Operand = NULL);
-
- void printPHICopy(const BasicBlock* Src, const BasicBlock* Dst);
-
- void printBranchToBlock(const BasicBlock* CurrBB,
- const BasicBlock* TrueBB,
- const BasicBlock* FalseBB);
-
- void printBranchInstruction(const BranchInst* Inst);
-
- void printSelectInstruction(const Value* Cond, const Value* VTrue,
- const Value* VFalse);
-
- void printIndirectLoad(const Value* V);
-
- void printIndirectSave(const Value* Ptr, const Value* Val);
-
- void printIndirectSave(const Type* Ty);
-
- void printCastInstruction(unsigned int Op, const Value* V,
- const Type* Ty);
-
- void printGepInstruction(const Value* V, gep_type_iterator I,
- gep_type_iterator E);
-
- std::string getCallSignature(const FunctionType* Ty,
- const Instruction* Inst,
- std::string Name);
-
- void printFunctionCall(const Value* FnVal, const Instruction* Inst);
-
- void printIntrinsicCall(const IntrinsicInst* Inst);
-
- void printCallInstruction(const Instruction* Inst);
-
- void printICmpInstruction(unsigned Predicate, const Value* Left,
- const Value* Right);
-
- void printFCmpInstruction(unsigned Predicate, const Value* Left,
- const Value* Right);
-
- void printInvokeInstruction(const InvokeInst* Inst);
-
- void printSwitchInstruction(const SwitchInst* Inst);
-
- void printVAArgInstruction(const VAArgInst* Inst);
-
- void printAllocaInstruction(const AllocaInst* Inst);
-
- void printInstruction(const Instruction* Inst);
-
- void printLoop(const Loop* L);
-
- void printBasicBlock(const BasicBlock* BB);
-
- void printLocalVariables(const Function& F);
-
- void printFunctionBody(const Function& F);
-
- void printConstantExpr(const ConstantExpr* CE);
-
- void printStaticInitializerList();
-
- void printFunction(const Function& F);
-
- void printDeclarations(const TypeSymbolTable& ST);
-
- unsigned int getBitWidth(const Type* Ty);
-
- void printStaticConstant(const Constant* C, uint64_t& Offset);
-
- void printStaticInitializer(const Constant* C, const std::string& Name);
-
- void printVariableDefinition(const GlobalVariable* G);
-
- void printGlobalVariables();
-
- const char* getLibraryName(const Function* F);
-
- const char* getLibraryName(const GlobalVariable* GV);
-
- const char* getLibraryForSymbol(const char* Name, bool isFunction,
- unsigned CallingConv);
-
- void printExternals();
- };
-}
-
-#endif
-
diff --git a/release_23/lib/Target/MSIL/Makefile b/release_23/lib/Target/MSIL/Makefile
deleted file mode 100644
index 94265edf98c5..000000000000
--- a/release_23/lib/Target/MSIL/Makefile
+++ /dev/null
@@ -1,14 +0,0 @@
-##===- lib/Target/MSIL/Makefile ----------------------------*- Makefile -*-===##
-#
-# The LLVM Compiler Infrastructure
-#
-# This file is distributed under the University of Illinois Open Source
-# License. See LICENSE.TXT for details.
-#
-##===----------------------------------------------------------------------===##
-
-LEVEL = ../../..
-LIBRARYNAME = LLVMMSIL
-include $(LEVEL)/Makefile.common
-
-CompileCommonOpts := $(CompileCommonOpts) -Wno-format
diff --git a/release_23/lib/Target/MSIL/README.TXT b/release_23/lib/Target/MSIL/README.TXT
deleted file mode 100644
index 2b9a569cfddc..000000000000
--- a/release_23/lib/Target/MSIL/README.TXT
+++ /dev/null
@@ -1,26 +0,0 @@
-//===---------------------------------------------------------------------===//
-
-Vector instructions support.
-
-ShuffleVector
-ExtractElement
-InsertElement
-
-//===---------------------------------------------------------------------===//
-
-Add "OpaqueType" type.
-
-//===---------------------------------------------------------------------===//
-
-"switch" instruction emulation with CLI "switch" instruction.
-
-//===---------------------------------------------------------------------===//
-
-Write linker for external function, because function export need to know
-dynamic library where function located.
-
-.method static hidebysig pinvokeimpl("msvcrt.dll" cdecl)
- void free(void*) preservesig {}
-
-
-
diff --git a/release_23/lib/Target/Makefile b/release_23/lib/Target/Makefile
deleted file mode 100644
index b1aa377b99da..000000000000
--- a/release_23/lib/Target/Makefile
+++ /dev/null
@@ -1,20 +0,0 @@
-#===- lib/Target/Makefile ----------------------------------*- Makefile -*-===##
-#
-# The LLVM Compiler Infrastructure
-#
-# This file is distributed under the University of Illinois Open Source
-# License. See LICENSE.TXT for details.
-#
-##===----------------------------------------------------------------------===##
-
-LEVEL = ../..
-LIBRARYNAME = LLVMTarget
-BUILD_ARCHIVE = 1
-
-# We include this early so we can access the value of TARGETS_TO_BUILD as the
-# value for PARALLEL_DIRS which must be set before Makefile.rules is included
-include $(LEVEL)/Makefile.config
-
-PARALLEL_DIRS := $(TARGETS_TO_BUILD)
-
-include $(LLVM_SRC_ROOT)/Makefile.rules
diff --git a/release_23/lib/Target/Mips/Makefile b/release_23/lib/Target/Mips/Makefile
deleted file mode 100644
index 510b7df7b683..000000000000
--- a/release_23/lib/Target/Mips/Makefile
+++ /dev/null
@@ -1,21 +0,0 @@
-##===- lib/Target/Mips/Makefile ----------------------------*- Makefile -*-===##
-#
-# The LLVM Compiler Infrastructure
-#
-# This file is distributed under the University of Illinois Open Source
-# License. See LICENSE.TXT for details.
-#
-##===----------------------------------------------------------------------===##
-LEVEL = ../../..
-LIBRARYNAME = LLVMMips
-TARGET = Mips
-
-# Make sure that tblgen is run, first thing.
-BUILT_SOURCES = MipsGenRegisterInfo.h.inc MipsGenRegisterNames.inc \
- MipsGenRegisterInfo.inc MipsGenInstrNames.inc \
- MipsGenInstrInfo.inc MipsGenAsmWriter.inc \
- MipsGenDAGISel.inc MipsGenCallingConv.inc \
- MipsGenSubtarget.inc
-
-include $(LEVEL)/Makefile.common
-
diff --git a/release_23/lib/Target/Mips/Mips.h b/release_23/lib/Target/Mips/Mips.h
deleted file mode 100644
index 0387c6af6f87..000000000000
--- a/release_23/lib/Target/Mips/Mips.h
+++ /dev/null
@@ -1,38 +0,0 @@
-//===-- Mips.h - Top-level interface for Mips representation ----*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains the entry points for global functions defined in
-// the LLVM Mips back-end.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef TARGET_MIPS_H
-#define TARGET_MIPS_H
-
-#include <iosfwd>
-
-namespace llvm {
- class MipsTargetMachine;
- class FunctionPass;
- class MachineCodeEmitter;
-
- FunctionPass *createMipsISelDag(MipsTargetMachine &TM);
- FunctionPass *createMipsDelaySlotFillerPass(MipsTargetMachine &TM);
- FunctionPass *createMipsCodePrinterPass(std::ostream &OS,
- MipsTargetMachine &TM);
-} // end namespace llvm;
-
-// Defines symbolic names for Mips registers. This defines a mapping from
-// register name to register number.
-#include "MipsGenRegisterNames.inc"
-
-// Defines symbolic names for the Mips instructions.
-#include "MipsGenInstrNames.inc"
-
-#endif
diff --git a/release_23/lib/Target/Mips/Mips.td b/release_23/lib/Target/Mips/Mips.td
deleted file mode 100644
index 50a5f65e76b1..000000000000
--- a/release_23/lib/Target/Mips/Mips.td
+++ /dev/null
@@ -1,51 +0,0 @@
-//===- Mips.td - Describe the Mips Target Machine ---------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-// This is the top level entry point for the Mips target.
-//===----------------------------------------------------------------------===//
-
-//===----------------------------------------------------------------------===//
-// Target-independent interfaces
-//===----------------------------------------------------------------------===//
-
-include "../Target.td"
-
-//===----------------------------------------------------------------------===//
-// Descriptions
-//===----------------------------------------------------------------------===//
-
-include "MipsRegisterInfo.td"
-include "MipsSchedule.td"
-include "MipsInstrInfo.td"
-include "MipsCallingConv.td"
-
-def MipsInstrInfo : InstrInfo {
- let TSFlagsFields = [];
- let TSFlagsShifts = [];
-}
-
-//===----------------------------------------------------------------------===//
-// CPU Directives //
-//===----------------------------------------------------------------------===//
-
-// Not currently supported, but work as SubtargetFeature placeholder.
-def FeatureMipsIII : SubtargetFeature<"mips3", "IsMipsIII", "true",
- "MipsIII ISA Support">;
-
-//===----------------------------------------------------------------------===//
-// Mips processors supported.
-//===----------------------------------------------------------------------===//
-
-def : Processor<"mips1", MipsGenericItineraries, []>;
-def : Processor<"r2000", MipsGenericItineraries, []>;
-def : Processor<"r3000", MipsGenericItineraries, []>;
-
-def Mips : Target {
- let InstructionSet = MipsInstrInfo;
-}
-
diff --git a/release_23/lib/Target/Mips/MipsAsmPrinter.cpp b/release_23/lib/Target/Mips/MipsAsmPrinter.cpp
deleted file mode 100644
index 6c0c908ae7b0..000000000000
--- a/release_23/lib/Target/Mips/MipsAsmPrinter.cpp
+++ /dev/null
@@ -1,549 +0,0 @@
-//===-- MipsAsmPrinter.cpp - Mips LLVM assembly writer --------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains a printer that converts from our internal representation
-// of machine-dependent LLVM code to GAS-format MIPS assembly language.
-//
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "mips-asm-printer"
-
-#include "Mips.h"
-#include "MipsInstrInfo.h"
-#include "MipsTargetMachine.h"
-#include "MipsMachineFunction.h"
-#include "llvm/Constants.h"
-#include "llvm/DerivedTypes.h"
-#include "llvm/Module.h"
-#include "llvm/CodeGen/AsmPrinter.h"
-#include "llvm/CodeGen/MachineFunctionPass.h"
-#include "llvm/CodeGen/MachineConstantPool.h"
-#include "llvm/CodeGen/MachineFrameInfo.h"
-#include "llvm/CodeGen/MachineInstr.h"
-#include "llvm/Target/TargetAsmInfo.h"
-#include "llvm/Target/TargetData.h"
-#include "llvm/Target/TargetMachine.h"
-#include "llvm/Target/TargetOptions.h"
-#include "llvm/Support/Mangler.h"
-#include "llvm/ADT/Statistic.h"
-#include "llvm/ADT/SetVector.h"
-#include "llvm/ADT/StringExtras.h"
-#include "llvm/Support/Debug.h"
-#include "llvm/Support/CommandLine.h"
-#include "llvm/Support/MathExtras.h"
-#include <cctype>
-
-using namespace llvm;
-
-STATISTIC(EmittedInsts, "Number of machine instrs printed");
-
-namespace {
- struct VISIBILITY_HIDDEN MipsAsmPrinter : public AsmPrinter {
- MipsAsmPrinter(std::ostream &O, MipsTargetMachine &TM,
- const TargetAsmInfo *T):
- AsmPrinter(O, TM, T) {}
-
- virtual const char *getPassName() const {
- return "Mips Assembly Printer";
- }
-
- enum SetDirectiveFlags {
- REORDER, // enables instruction reordering.
- NOREORDER, // disables instruction reordering.
- MACRO, // enables GAS macros.
- NOMACRO // disables GAS macros.
- };
-
- void printOperand(const MachineInstr *MI, int opNum);
- void printMemOperand(const MachineInstr *MI, int opNum,
- const char *Modifier = 0);
-
- unsigned int getSavedRegsBitmask(bool isFloat, MachineFunction &MF);
- void printHex32(unsigned int Value);
-
- void emitFunctionStart(MachineFunction &MF);
- void emitFunctionEnd(MachineFunction &MF);
- void emitFrameDirective(MachineFunction &MF);
- void emitMaskDirective(MachineFunction &MF);
- void emitFMaskDirective(MachineFunction &MF);
- void emitSetDirective(SetDirectiveFlags Flag);
-
- bool printInstruction(const MachineInstr *MI); // autogenerated.
- bool runOnMachineFunction(MachineFunction &F);
- bool doInitialization(Module &M);
- bool doFinalization(Module &M);
- };
-} // end of anonymous namespace
-
-#include "MipsGenAsmWriter.inc"
-
-/// createMipsCodePrinterPass - Returns a pass that prints the MIPS
-/// assembly code for a MachineFunction to the given output stream,
-/// using the given target machine description. This should work
-/// regardless of whether the function is in SSA form.
-FunctionPass *llvm::createMipsCodePrinterPass(std::ostream &o,
- MipsTargetMachine &tm)
-{
- return new MipsAsmPrinter(o, tm, tm.getTargetAsmInfo());
-}
-
-//===----------------------------------------------------------------------===//
-//
-// Mips Asm Directives
-//
-// -- Frame directive "frame Stackpointer, Stacksize, RARegister"
-// Describe the stack frame.
-//
-// -- Mask directives "(f)mask bitmask, offset"
-// Tells the assembler which registers are saved and where.
-// bitmask - contain a little endian bitset indicating which registers are
-// saved on function prologue (e.g. with a 0x80000000 mask, the
-// assembler knows the register 31 (RA) is saved at prologue.
-// offset - the position before stack pointer subtraction indicating where
-// the first saved register on prologue is located. (e.g. with a
-//
-// Consider the following function prologue:
-//
-// .frame $fp,48,$ra
-// .mask 0xc0000000,-8
-// addiu $sp, $sp, -48
-// sw $ra, 40($sp)
-// sw $fp, 36($sp)
-//
-// With a 0xc0000000 mask, the assembler knows the register 31 (RA) and
-// 30 (FP) are saved at prologue. As the save order on prologue is from
-// left to right, RA is saved first. A -8 offset means that after the
-// stack pointer subtration, the first register in the mask (RA) will be
-// saved at address 48-8=40.
-//
-//===----------------------------------------------------------------------===//
-
-/// Mask directive for GPR
-void MipsAsmPrinter::
-emitMaskDirective(MachineFunction &MF)
-{
- MipsFunctionInfo *MipsFI = MF.getInfo<MipsFunctionInfo>();
-
- int StackSize = MF.getFrameInfo()->getStackSize();
- int Offset = (!MipsFI->getTopSavedRegOffset()) ? 0 :
- (-(StackSize-MipsFI->getTopSavedRegOffset()));
-
- #ifndef NDEBUG
- DOUT << "--> emitMaskDirective" << "\n";
- DOUT << "StackSize : " << StackSize << "\n";
- DOUT << "getTopSavedReg : " << MipsFI->getTopSavedRegOffset() << "\n";
- DOUT << "Offset : " << Offset << "\n\n";
- #endif
-
- unsigned int Bitmask = getSavedRegsBitmask(false, MF);
- O << "\t.mask \t";
- printHex32(Bitmask);
- O << "," << Offset << "\n";
-}
-
-/// TODO: Mask Directive for Float Point
-void MipsAsmPrinter::
-emitFMaskDirective(MachineFunction &MF)
-{
- unsigned int Bitmask = getSavedRegsBitmask(true, MF);
-
- O << "\t.fmask\t";
- printHex32(Bitmask);
- O << ",0" << "\n";
-}
-
-/// Frame Directive
-void MipsAsmPrinter::
-emitFrameDirective(MachineFunction &MF)
-{
- const TargetRegisterInfo &RI = *TM.getRegisterInfo();
-
- unsigned stackReg = RI.getFrameRegister(MF);
- unsigned returnReg = RI.getRARegister();
- unsigned stackSize = MF.getFrameInfo()->getStackSize();
-
-
- O << "\t.frame\t" << "$" << LowercaseString(RI.get(stackReg).AsmName)
- << "," << stackSize << ","
- << "$" << LowercaseString(RI.get(returnReg).AsmName)
- << "\n";
-}
-
-/// Emit Set directives.
-void MipsAsmPrinter::
-emitSetDirective(SetDirectiveFlags Flag)
-{
- O << "\t.set\t";
- switch(Flag) {
- case REORDER: O << "reorder" << "\n"; break;
- case NOREORDER: O << "noreorder" << "\n"; break;
- case MACRO: O << "macro" << "\n"; break;
- case NOMACRO: O << "nomacro" << "\n"; break;
- default: break;
- }
-}
-
-// Create a bitmask with all callee saved registers for CPU
-// or Float Point registers. For CPU registers consider RA,
-// GP and FP for saving if necessary.
-unsigned int MipsAsmPrinter::
-getSavedRegsBitmask(bool isFloat, MachineFunction &MF)
-{
- const TargetRegisterInfo &RI = *TM.getRegisterInfo();
-
- // Float Point Registers, TODO
- if (isFloat)
- return 0;
-
- // CPU Registers
- unsigned int Bitmask = 0;
-
- MachineFrameInfo *MFI = MF.getFrameInfo();
- const std::vector<CalleeSavedInfo> &CSI = MFI->getCalleeSavedInfo();
- for (unsigned i = 0, e = CSI.size(); i != e; ++i)
- Bitmask |= (1 << MipsRegisterInfo::getRegisterNumbering(CSI[i].getReg()));
-
- if (RI.hasFP(MF))
- Bitmask |= (1 << MipsRegisterInfo::
- getRegisterNumbering(RI.getFrameRegister(MF)));
-
- if (MF.getFrameInfo()->hasCalls())
- Bitmask |= (1 << MipsRegisterInfo::
- getRegisterNumbering(RI.getRARegister()));
-
- return Bitmask;
-}
-
-// Print a 32 bit hex number with all numbers.
-void MipsAsmPrinter::
-printHex32(unsigned int Value)
-{
- O << "0x" << std::hex;
- for (int i = 7; i >= 0; i--)
- O << std::hex << ( (Value & (0xF << (i*4))) >> (i*4) );
- O << std::dec;
-}
-
-/// Emit the directives used by GAS on the start of functions
-void MipsAsmPrinter::
-emitFunctionStart(MachineFunction &MF)
-{
- // Print out the label for the function.
- const Function *F = MF.getFunction();
- SwitchToTextSection(getSectionForFunction(*F).c_str(), F);
-
- // 2 bits aligned
- EmitAlignment(2, F);
-
- O << "\t.globl\t" << CurrentFnName << "\n";
- O << "\t.ent\t" << CurrentFnName << "\n";
- O << "\t.type\t" << CurrentFnName << ", @function\n";
- O << CurrentFnName << ":\n";
-
- emitFrameDirective(MF);
- emitMaskDirective(MF);
- emitFMaskDirective(MF);
-
- if (TM.getRelocationModel() == Reloc::Static) {
- emitSetDirective(NOREORDER);
- emitSetDirective(NOMACRO);
- }
-
- O << "\n";
-}
-
-/// Emit the directives used by GAS on the end of functions
-void MipsAsmPrinter::
-emitFunctionEnd(MachineFunction &MF)
-{
- if (TM.getRelocationModel() == Reloc::Static) {
- emitSetDirective(MACRO);
- emitSetDirective(REORDER);
- }
-
- O << "\t.end\t" << CurrentFnName << "\n";
-}
-
-/// runOnMachineFunction - This uses the printMachineInstruction()
-/// method to print assembly for each instruction.
-bool MipsAsmPrinter::
-runOnMachineFunction(MachineFunction &MF)
-{
- SetupMachineFunction(MF);
-
- // Print out constants referenced by the function
- EmitConstantPool(MF.getConstantPool());
-
- // Print out jump tables referenced by the function
- EmitJumpTableInfo(MF.getJumpTableInfo(), MF);
-
- O << "\n\n";
-
- // What's my mangled name?
- CurrentFnName = Mang->getValueName(MF.getFunction());
-
- // Emit the function start directives
- emitFunctionStart(MF);
-
- // Print out code for the function.
- for (MachineFunction::const_iterator I = MF.begin(), E = MF.end();
- I != E; ++I) {
-
- // Print a label for the basic block.
- if (I != MF.begin()) {
- printBasicBlockLabel(I, true, true);
- O << '\n';
- }
-
- for (MachineBasicBlock::const_iterator II = I->begin(), E = I->end();
- II != E; ++II) {
- // Print the assembly for the instruction.
- printInstruction(II);
- ++EmittedInsts;
- }
-
- // Each Basic Block is separated by a newline
- O << '\n';
- }
-
- // Emit function end directives
- emitFunctionEnd(MF);
-
- // We didn't modify anything.
- return false;
-}
-
-void MipsAsmPrinter::
-printOperand(const MachineInstr *MI, int opNum)
-{
- const MachineOperand &MO = MI->getOperand(opNum);
- const TargetRegisterInfo &RI = *TM.getRegisterInfo();
- bool closeP = false;
- bool isPIC = (TM.getRelocationModel() == Reloc::PIC_);
- bool isCodeLarge = (TM.getCodeModel() == CodeModel::Large);
-
- // %hi and %lo used on mips gas to load global addresses on
- // static code. %got is used to load global addresses when
- // using PIC_. %call16 is used to load direct call targets
- // on PIC_ and small code size. %call_lo and %call_hi load
- // direct call targets on PIC_ and large code size.
- if (MI->getOpcode() == Mips::LUi && !MO.isRegister()
- && !MO.isImmediate()) {
- if ((isPIC) && (isCodeLarge))
- O << "%call_hi(";
- else
- O << "%hi(";
- closeP = true;
- } else if ((MI->getOpcode() == Mips::ADDiu) && !MO.isRegister()
- && !MO.isImmediate()) {
- O << "%lo(";
- closeP = true;
- } else if ((isPIC) && (MI->getOpcode() == Mips::LW)
- && (!MO.isRegister()) && (!MO.isImmediate())) {
- const MachineOperand &firstMO = MI->getOperand(opNum-1);
- const MachineOperand &lastMO = MI->getOperand(opNum+1);
- if ((firstMO.isRegister()) && (lastMO.isRegister())) {
- if ((firstMO.getReg() == Mips::T9) && (lastMO.getReg() == Mips::GP)
- && (!isCodeLarge))
- O << "%call16(";
- else if ((firstMO.getReg() != Mips::T9) && (lastMO.getReg() == Mips::GP))
- O << "%got(";
- else if ((firstMO.getReg() == Mips::T9) && (lastMO.getReg() != Mips::GP)
- && (isCodeLarge))
- O << "%call_lo(";
- closeP = true;
- }
- }
-
- switch (MO.getType())
- {
- case MachineOperand::MO_Register:
- if (TargetRegisterInfo::isPhysicalRegister(MO.getReg()))
- O << "$" << LowercaseString (RI.get(MO.getReg()).AsmName);
- else
- O << "$" << MO.getReg();
- break;
-
- case MachineOperand::MO_Immediate:
- if ((MI->getOpcode() == Mips::SLTiu) || (MI->getOpcode() == Mips::ORi) ||
- (MI->getOpcode() == Mips::LUi) || (MI->getOpcode() == Mips::ANDi))
- O << (unsigned short int)MO.getImm();
- else
- O << (short int)MO.getImm();
- break;
-
- case MachineOperand::MO_MachineBasicBlock:
- printBasicBlockLabel(MO.getMBB());
- return;
-
- case MachineOperand::MO_GlobalAddress:
- O << Mang->getValueName(MO.getGlobal());
- break;
-
- case MachineOperand::MO_ExternalSymbol:
- O << MO.getSymbolName();
- break;
-
- case MachineOperand::MO_JumpTableIndex:
- O << TAI->getPrivateGlobalPrefix() << "JTI" << getFunctionNumber()
- << '_' << MO.getIndex();
- break;
-
- // FIXME: Verify correct
- case MachineOperand::MO_ConstantPoolIndex:
- O << TAI->getPrivateGlobalPrefix() << "CPI"
- << getFunctionNumber() << "_" << MO.getIndex();
- break;
-
- default:
- O << "<unknown operand type>"; abort (); break;
- }
-
- if (closeP) O << ")";
-}
-
-void MipsAsmPrinter::
-printMemOperand(const MachineInstr *MI, int opNum, const char *Modifier)
-{
- // when using stack locations for not load/store instructions
- // print the same way as all normal 3 operand instructions.
- if (Modifier && !strcmp(Modifier, "stackloc")) {
- printOperand(MI, opNum+1);
- O << ", ";
- printOperand(MI, opNum);
- return;
- }
-
- // Load/Store memory operands -- imm($reg)
- // If PIC target the target is loaded as the
- // pattern lw $25,%call16($28)
- printOperand(MI, opNum);
- O << "(";
- printOperand(MI, opNum+1);
- O << ")";
-}
-
-bool MipsAsmPrinter::
-doInitialization(Module &M)
-{
- Mang = new Mangler(M);
- return false; // success
-}
-
-bool MipsAsmPrinter::
-doFinalization(Module &M)
-{
- const TargetData *TD = TM.getTargetData();
-
- // Print out module-level global variables here.
- for (Module::const_global_iterator I = M.global_begin(),
- E = M.global_end(); I != E; ++I)
-
- // External global require no code
- if (I->hasInitializer()) {
-
- // Check to see if this is a special global
- // used by LLVM, if so, emit it.
- if (EmitSpecialLLVMGlobal(I))
- continue;
-
- O << "\n\n";
- std::string name = Mang->getValueName(I);
- Constant *C = I->getInitializer();
- unsigned Size = TD->getABITypeSize(C->getType());
- unsigned Align = TD->getPreferredAlignmentLog(I);
-
- // Is this correct ?
- if (C->isNullValue() && (I->hasLinkOnceLinkage() ||
- I->hasInternalLinkage() || I->hasWeakLinkage()))
- {
- if (Size == 0) Size = 1; // .comm Foo, 0 is undefined, avoid it.
-
- if (!NoZerosInBSS && TAI->getBSSSection())
- SwitchToDataSection(TAI->getBSSSection(), I);
- else
- SwitchToDataSection(TAI->getDataSection(), I);
-
- if (I->hasInternalLinkage()) {
- if (TAI->getLCOMMDirective())
- O << TAI->getLCOMMDirective() << name << "," << Size;
- else
- O << "\t.local\t" << name << "\n";
- } else {
- O << TAI->getCOMMDirective() << name << "," << Size;
- // The .comm alignment in bytes.
- if (TAI->getCOMMDirectiveTakesAlignment())
- O << "," << (1 << Align);
- }
-
- } else {
-
- switch (I->getLinkage())
- {
- case GlobalValue::LinkOnceLinkage:
- case GlobalValue::WeakLinkage:
- // FIXME: Verify correct for weak.
- // Nonnull linkonce -> weak
- O << "\t.weak " << name << "\n";
- SwitchToDataSection("", I);
- O << "\t.section\t\".llvm.linkonce.d." << name
- << "\",\"aw\",@progbits\n";
- break;
- case GlobalValue::AppendingLinkage:
- // FIXME: appending linkage variables
- // should go into a section of their name or
- // something. For now, just emit them as external.
- case GlobalValue::ExternalLinkage:
- // If external or appending, declare as a global symbol
- O << TAI->getGlobalDirective() << name << "\n";
- // Fall Through
- case GlobalValue::InternalLinkage:
- // FIXME: special handling for ".ctors" & ".dtors" sections
- if (I->hasSection() && (I->getSection() == ".ctors" ||
- I->getSection() == ".dtors")) {
- std::string SectionName = ".section " + I->getSection();
- SectionName += ",\"aw\",%progbits";
- SwitchToDataSection(SectionName.c_str());
- } else {
- if (C->isNullValue() && !NoZerosInBSS && TAI->getBSSSection())
- SwitchToDataSection(TAI->getBSSSection(), I);
- else if (!I->isConstant())
- SwitchToDataSection(TAI->getDataSection(), I);
- else {
- // Read-only data.
- if (TAI->getReadOnlySection())
- SwitchToDataSection(TAI->getReadOnlySection(), I);
- else
- SwitchToDataSection(TAI->getDataSection(), I);
- }
- }
- break;
- case GlobalValue::GhostLinkage:
- cerr << "Should not have any unmaterialized functions!\n";
- abort();
- case GlobalValue::DLLImportLinkage:
- cerr << "DLLImport linkage is not supported by this target!\n";
- abort();
- case GlobalValue::DLLExportLinkage:
- cerr << "DLLExport linkage is not supported by this target!\n";
- abort();
- default:
- assert(0 && "Unknown linkage type!");
- }
-
- O << "\t.align " << Align << "\n";
- O << "\t.type " << name << ",@object\n";
- O << "\t.size " << name << "," << Size << "\n";
- O << name << ":\n";
- EmitGlobalConstant(C);
- }
- }
-
- return AsmPrinter::doFinalization(M);
-}
diff --git a/release_23/lib/Target/Mips/MipsCallingConv.td b/release_23/lib/Target/Mips/MipsCallingConv.td
deleted file mode 100644
index 85f019dcc61d..000000000000
--- a/release_23/lib/Target/Mips/MipsCallingConv.td
+++ /dev/null
@@ -1,39 +0,0 @@
-//===- MipsCallingConv.td - Calling Conventions for Mips --------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-// This describes the calling conventions for Mips architecture.
-//===----------------------------------------------------------------------===//
-
-/// CCIfSubtarget - Match if the current subtarget has a feature F.
-class CCIfSubtarget<string F, CCAction A>:
- CCIf<!strconcat("State.getTarget().getSubtarget<MipsSubtarget>().", F), A>;
-
-//===----------------------------------------------------------------------===//
-// Mips Return Value Calling Convention
-//===----------------------------------------------------------------------===//
-def RetCC_Mips : CallingConv<[
- // i32 are returned in registers V0, V1
- CCIfType<[i32], CCAssignToReg<[V0, V1]>>
-]>;
-
-
-//===----------------------------------------------------------------------===//
-// Mips Argument Calling Conventions
-//===----------------------------------------------------------------------===//
-def CC_Mips : CallingConv<[
- // Promote i8/i16 arguments to i32.
- CCIfType<[i8, i16], CCPromoteToType<i32>>,
-
- // The first 4 integer arguments are passed in integer registers.
- CCIfType<[i32], CCAssignToReg<[A0, A1, A2, A3]>>,
-
- // Integer values get stored in stack slots that are 4 bytes in
- // size and 4-byte aligned.
- CCIfType<[i32], CCAssignToStack<4, 4>>
-]>;
-
diff --git a/release_23/lib/Target/Mips/MipsDelaySlotFiller.cpp b/release_23/lib/Target/Mips/MipsDelaySlotFiller.cpp
deleted file mode 100644
index 881cd1292901..000000000000
--- a/release_23/lib/Target/Mips/MipsDelaySlotFiller.cpp
+++ /dev/null
@@ -1,77 +0,0 @@
-//===-- DelaySlotFiller.cpp - Mips delay slot filler ---------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// Simple pass to fills delay slots with NOPs.
-//
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "delay-slot-filler"
-
-#include "Mips.h"
-#include "MipsTargetMachine.h"
-#include "llvm/CodeGen/MachineFunctionPass.h"
-#include "llvm/CodeGen/MachineInstrBuilder.h"
-#include "llvm/Target/TargetInstrInfo.h"
-#include "llvm/ADT/Statistic.h"
-
-using namespace llvm;
-
-STATISTIC(FilledSlots, "Number of delay slots filled");
-
-namespace {
- struct Filler : public MachineFunctionPass {
-
- TargetMachine &TM;
- const TargetInstrInfo *TII;
-
- static char ID;
- Filler(TargetMachine &tm)
- : MachineFunctionPass((intptr_t)&ID), TM(tm), TII(tm.getInstrInfo()) { }
-
- virtual const char *getPassName() const {
- return "Mips Delay Slot Filler";
- }
-
- bool runOnMachineBasicBlock(MachineBasicBlock &MBB);
- bool runOnMachineFunction(MachineFunction &F) {
- bool Changed = false;
- for (MachineFunction::iterator FI = F.begin(), FE = F.end();
- FI != FE; ++FI)
- Changed |= runOnMachineBasicBlock(*FI);
- return Changed;
- }
-
- };
- char Filler::ID = 0;
-} // end of anonymous namespace
-
-/// runOnMachineBasicBlock - Fill in delay slots for the given basic block.
-/// Currently, we fill delay slots with NOPs. We assume there is only one
-/// delay slot per delayed instruction.
-bool Filler::
-runOnMachineBasicBlock(MachineBasicBlock &MBB)
-{
- bool Changed = false;
- for (MachineBasicBlock::iterator I = MBB.begin(); I != MBB.end(); ++I)
- if (I->getDesc().hasDelaySlot()) {
- MachineBasicBlock::iterator J = I;
- ++J;
- BuildMI(MBB, J, TII->get(Mips::NOP));
- ++FilledSlots;
- Changed = true;
- }
- return Changed;
-}
-
-/// createMipsDelaySlotFillerPass - Returns a pass that fills in delay
-/// slots in Mips MachineFunctions
-FunctionPass *llvm::createMipsDelaySlotFillerPass(MipsTargetMachine &tm) {
- return new Filler(tm);
-}
-
diff --git a/release_23/lib/Target/Mips/MipsISelDAGToDAG.cpp b/release_23/lib/Target/Mips/MipsISelDAGToDAG.cpp
deleted file mode 100644
index b2ad66670bb1..000000000000
--- a/release_23/lib/Target/Mips/MipsISelDAGToDAG.cpp
+++ /dev/null
@@ -1,347 +0,0 @@
-//===-- MipsISelDAGToDAG.cpp - A dag to dag inst selector for Mips --------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines an instruction selector for the MIPS target.
-//
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "mips-isel"
-#include "Mips.h"
-#include "MipsISelLowering.h"
-#include "MipsMachineFunction.h"
-#include "MipsRegisterInfo.h"
-#include "MipsSubtarget.h"
-#include "MipsTargetMachine.h"
-#include "llvm/GlobalValue.h"
-#include "llvm/Instructions.h"
-#include "llvm/Intrinsics.h"
-#include "llvm/Support/CFG.h"
-#include "llvm/Type.h"
-#include "llvm/CodeGen/MachineConstantPool.h"
-#include "llvm/CodeGen/MachineFunction.h"
-#include "llvm/CodeGen/MachineFrameInfo.h"
-#include "llvm/CodeGen/MachineInstrBuilder.h"
-#include "llvm/CodeGen/MachineRegisterInfo.h"
-#include "llvm/CodeGen/SelectionDAGISel.h"
-#include "llvm/Target/TargetMachine.h"
-#include "llvm/Support/Compiler.h"
-#include "llvm/Support/Debug.h"
-#include <queue>
-#include <set>
-
-using namespace llvm;
-
-//===----------------------------------------------------------------------===//
-// Instruction Selector Implementation
-//===----------------------------------------------------------------------===//
-
-//===----------------------------------------------------------------------===//
-// MipsDAGToDAGISel - MIPS specific code to select MIPS machine
-// instructions for SelectionDAG operations.
-//===----------------------------------------------------------------------===//
-namespace {
-
-class VISIBILITY_HIDDEN MipsDAGToDAGISel : public SelectionDAGISel {
-
- /// TM - Keep a reference to MipsTargetMachine.
- MipsTargetMachine &TM;
-
- /// MipsLowering - This object fully describes how to lower LLVM code to an
- /// Mips-specific SelectionDAG.
- MipsTargetLowering MipsLowering;
-
- /// Subtarget - Keep a pointer to the MipsSubtarget around so that we can
- /// make the right decision when generating code for different targets.
- //TODO: add initialization on constructor
- //const MipsSubtarget *Subtarget;
-
-public:
- MipsDAGToDAGISel(MipsTargetMachine &tm) :
- SelectionDAGISel(MipsLowering),
- TM(tm), MipsLowering(*TM.getTargetLowering()) {}
-
- virtual void InstructionSelectBasicBlock(SelectionDAG &SD);
-
- // Pass Name
- virtual const char *getPassName() const {
- return "MIPS DAG->DAG Pattern Instruction Selection";
- }
-
-
-private:
- // Include the pieces autogenerated from the target description.
- #include "MipsGenDAGISel.inc"
-
- SDOperand getGlobalBaseReg();
- SDNode *Select(SDOperand N);
-
- // Complex Pattern.
- bool SelectAddr(SDOperand Op, SDOperand N,
- SDOperand &Base, SDOperand &Offset);
-
-
- // getI32Imm - Return a target constant with the specified
- // value, of type i32.
- inline SDOperand getI32Imm(unsigned Imm) {
- return CurDAG->getTargetConstant(Imm, MVT::i32);
- }
-
-
- #ifndef NDEBUG
- unsigned Indent;
- #endif
-};
-
-}
-
-/// InstructionSelectBasicBlock - This callback is invoked by
-/// SelectionDAGISel when it has created a SelectionDAG for us to codegen.
-void MipsDAGToDAGISel::
-InstructionSelectBasicBlock(SelectionDAG &SD)
-{
- DEBUG(BB->dump());
- // Codegen the basic block.
- #ifndef NDEBUG
- DOUT << "===== Instruction selection begins:\n";
- Indent = 0;
- #endif
-
- // Select target instructions for the DAG.
- SD.setRoot(SelectRoot(SD.getRoot()));
-
- #ifndef NDEBUG
- DOUT << "===== Instruction selection ends:\n";
- #endif
-
- SD.RemoveDeadNodes();
-
- // Emit machine code to BB.
- ScheduleAndEmitDAG(SD);
-}
-
-/// getGlobalBaseReg - Output the instructions required to put the
-/// GOT address into a register.
-SDOperand MipsDAGToDAGISel::getGlobalBaseReg() {
- MachineFunction* MF = BB->getParent();
- unsigned GP = 0;
- for(MachineRegisterInfo::livein_iterator ii = MF->getRegInfo().livein_begin(),
- ee = MF->getRegInfo().livein_end(); ii != ee; ++ii)
- if (ii->first == Mips::GP) {
- GP = ii->second;
- break;
- }
- assert(GP && "GOT PTR not in liveins");
- return CurDAG->getCopyFromReg(CurDAG->getEntryNode(),
- GP, MVT::i32);
-}
-
-/// ComplexPattern used on MipsInstrInfo
-/// Used on Mips Load/Store instructions
-bool MipsDAGToDAGISel::
-SelectAddr(SDOperand Op, SDOperand Addr, SDOperand &Offset, SDOperand &Base)
-{
- // if Address is FI, get the TargetFrameIndex.
- if (FrameIndexSDNode *FIN = dyn_cast<FrameIndexSDNode>(Addr)) {
- Base = CurDAG->getTargetFrameIndex(FIN->getIndex(), MVT::i32);
- Offset = CurDAG->getTargetConstant(0, MVT::i32);
- return true;
- }
-
- // on PIC code Load GA
- if (TM.getRelocationModel() == Reloc::PIC_) {
- if ((Addr.getOpcode() == ISD::TargetGlobalAddress) ||
- (Addr.getOpcode() == ISD::TargetJumpTable)){
- Base = CurDAG->getRegister(Mips::GP, MVT::i32);
- Offset = Addr;
- return true;
- }
- } else {
- if ((Addr.getOpcode() == ISD::TargetExternalSymbol ||
- Addr.getOpcode() == ISD::TargetGlobalAddress))
- return false;
- }
-
- // Operand is a result from an ADD.
- if (Addr.getOpcode() == ISD::ADD) {
- if (ConstantSDNode *CN = dyn_cast<ConstantSDNode>(Addr.getOperand(1))) {
- if (Predicate_immSExt16(CN)) {
-
- // If the first operand is a FI, get the TargetFI Node
- if (FrameIndexSDNode *FIN = dyn_cast<FrameIndexSDNode>
- (Addr.getOperand(0))) {
- Base = CurDAG->getTargetFrameIndex(FIN->getIndex(), MVT::i32);
- } else {
- Base = Addr.getOperand(0);
- }
-
- Offset = CurDAG->getTargetConstant(CN->getValue(), MVT::i32);
- return true;
- }
- }
- }
-
- Base = Addr;
- Offset = CurDAG->getTargetConstant(0, MVT::i32);
- return true;
-}
-
-/// Select instructions not customized! Used for
-/// expanded, promoted and normal instructions
-SDNode* MipsDAGToDAGISel::
-Select(SDOperand N)
-{
- SDNode *Node = N.Val;
- unsigned Opcode = Node->getOpcode();
-
- // Dump information about the Node being selected
- #ifndef NDEBUG
- DOUT << std::string(Indent, ' ') << "Selecting: ";
- DEBUG(Node->dump(CurDAG));
- DOUT << "\n";
- Indent += 2;
- #endif
-
- // If we have a custom node, we already have selected!
- if (Opcode >= ISD::BUILTIN_OP_END && Opcode < MipsISD::FIRST_NUMBER) {
- #ifndef NDEBUG
- DOUT << std::string(Indent-2, ' ') << "== ";
- DEBUG(Node->dump(CurDAG));
- DOUT << "\n";
- Indent -= 2;
- #endif
- return NULL;
- }
-
- ///
- // Instruction Selection not handled by the auto-generated
- // tablegen selection should be handled here.
- ///
- switch(Opcode) {
-
- default: break;
-
- /// Special Mul operations
- case ISD::MULHS:
- case ISD::MULHU: {
- SDOperand MulOp1 = Node->getOperand(0);
- SDOperand MulOp2 = Node->getOperand(1);
- AddToISelQueue(MulOp1);
- AddToISelQueue(MulOp2);
-
- unsigned MulOp = (Opcode == ISD::MULHU ? Mips::MULTu : Mips::MULT);
- SDNode *MulNode = CurDAG->getTargetNode(MulOp, MVT::Flag, MulOp1, MulOp2);
-
- SDOperand MFInFlag = SDOperand(MulNode, 0);
- return CurDAG->getTargetNode(Mips::MFHI, MVT::i32, MFInFlag);
- }
-
- /// Div operations
- case ISD::SDIV:
- case ISD::UDIV: {
- SDOperand DivOp1 = Node->getOperand(0);
- SDOperand DivOp2 = Node->getOperand(1);
- AddToISelQueue(DivOp1);
- AddToISelQueue(DivOp2);
-
- unsigned DivOp = (Opcode == ISD::SDIV ? Mips::DIV : Mips::DIVu);
- SDNode *DivNode = CurDAG->getTargetNode(DivOp, MVT::Flag, DivOp1, DivOp2);
-
- SDOperand MFInFlag = SDOperand(DivNode, 0);
- return CurDAG->getTargetNode(Mips::MFLO, MVT::i32, MFInFlag);
- }
-
- /// Rem operations
- case ISD::SREM:
- case ISD::UREM: {
- SDOperand RemOp1 = Node->getOperand(0);
- SDOperand RemOp2 = Node->getOperand(1);
- AddToISelQueue(RemOp1);
- AddToISelQueue(RemOp2);
-
- unsigned RemOp = (Opcode == ISD::SREM ? Mips::DIV : Mips::DIVu);
- SDNode *RemNode = CurDAG->getTargetNode(RemOp, MVT::Flag, RemOp1, RemOp2);
-
- SDOperand MFInFlag = SDOperand(RemNode, 0);
- return CurDAG->getTargetNode(Mips::MFHI, MVT::i32, MFInFlag);
- }
-
- // Get target GOT address.
- case ISD::GLOBAL_OFFSET_TABLE: {
- SDOperand Result = getGlobalBaseReg();
- ReplaceUses(N, Result);
- return NULL;
- }
-
- /// Handle direct and indirect calls when using PIC. On PIC, when
- /// GOT is smaller than about 64k (small code) the GA target is
- /// loaded with only one instruction. Otherwise GA's target must
- /// be loaded with 3 instructions.
- case MipsISD::JmpLink: {
- if (TM.getRelocationModel() == Reloc::PIC_) {
- //bool isCodeLarge = (TM.getCodeModel() == CodeModel::Large);
- SDOperand Chain = Node->getOperand(0);
- SDOperand Callee = Node->getOperand(1);
- AddToISelQueue(Chain);
- SDOperand T9Reg = CurDAG->getRegister(Mips::T9, MVT::i32);
- SDOperand InFlag(0, 0);
-
- if ( (isa<GlobalAddressSDNode>(Callee)) ||
- (isa<ExternalSymbolSDNode>(Callee)) )
- {
- /// Direct call for global addresses and external symbols
- SDOperand GPReg = CurDAG->getRegister(Mips::GP, MVT::i32);
-
- // Use load to get GOT target
- SDOperand Ops[] = { Callee, GPReg, Chain };
- SDOperand Load = SDOperand(CurDAG->getTargetNode(Mips::LW, MVT::i32,
- MVT::Other, Ops, 3), 0);
- Chain = Load.getValue(1);
- AddToISelQueue(Chain);
-
- // Call target must be on T9
- Chain = CurDAG->getCopyToReg(Chain, T9Reg, Load, InFlag);
- } else
- /// Indirect call
- Chain = CurDAG->getCopyToReg(Chain, T9Reg, Callee, InFlag);
-
- AddToISelQueue(Chain);
-
- // Emit Jump and Link Register
- SDNode *ResNode = CurDAG->getTargetNode(Mips::JALR, MVT::Other,
- MVT::Flag, T9Reg, Chain);
- Chain = SDOperand(ResNode, 0);
- InFlag = SDOperand(ResNode, 1);
- ReplaceUses(SDOperand(Node, 0), Chain);
- ReplaceUses(SDOperand(Node, 1), InFlag);
- return ResNode;
- }
- }
- }
-
- // Select the default instruction
- SDNode *ResNode = SelectCode(N);
-
- #ifndef NDEBUG
- DOUT << std::string(Indent-2, ' ') << "=> ";
- if (ResNode == NULL || ResNode == N.Val)
- DEBUG(N.Val->dump(CurDAG));
- else
- DEBUG(ResNode->dump(CurDAG));
- DOUT << "\n";
- Indent -= 2;
- #endif
-
- return ResNode;
-}
-
-/// createMipsISelDag - This pass converts a legalized DAG into a
-/// MIPS-specific DAG, ready for instruction scheduling.
-FunctionPass *llvm::createMipsISelDag(MipsTargetMachine &TM) {
- return new MipsDAGToDAGISel(TM);
-}
diff --git a/release_23/lib/Target/Mips/MipsISelLowering.cpp b/release_23/lib/Target/Mips/MipsISelLowering.cpp
deleted file mode 100644
index 5ea9cdd9c254..000000000000
--- a/release_23/lib/Target/Mips/MipsISelLowering.cpp
+++ /dev/null
@@ -1,694 +0,0 @@
-//===-- MipsISelLowering.cpp - Mips DAG Lowering Implementation -----------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines the interfaces that Mips uses to lower LLVM code into a
-// selection DAG.
-//
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "mips-lower"
-
-#include "MipsISelLowering.h"
-#include "MipsMachineFunction.h"
-#include "MipsTargetMachine.h"
-#include "llvm/DerivedTypes.h"
-#include "llvm/Function.h"
-#include "llvm/Intrinsics.h"
-#include "llvm/CallingConv.h"
-#include "llvm/CodeGen/CallingConvLower.h"
-#include "llvm/CodeGen/MachineFrameInfo.h"
-#include "llvm/CodeGen/MachineFunction.h"
-#include "llvm/CodeGen/MachineInstrBuilder.h"
-#include "llvm/CodeGen/MachineRegisterInfo.h"
-#include "llvm/CodeGen/SelectionDAGISel.h"
-#include "llvm/CodeGen/ValueTypes.h"
-#include "llvm/Support/Debug.h"
-#include <queue>
-#include <set>
-
-using namespace llvm;
-
-const char *MipsTargetLowering::
-getTargetNodeName(unsigned Opcode) const
-{
- switch (Opcode)
- {
- case MipsISD::JmpLink : return "MipsISD::JmpLink";
- case MipsISD::Hi : return "MipsISD::Hi";
- case MipsISD::Lo : return "MipsISD::Lo";
- case MipsISD::Ret : return "MipsISD::Ret";
- default : return NULL;
- }
-}
-
-MipsTargetLowering::
-MipsTargetLowering(MipsTargetMachine &TM): TargetLowering(TM)
-{
- // Mips does not have i1 type, so use i32 for
- // setcc operations results (slt, sgt, ...).
- setSetCCResultContents(ZeroOrOneSetCCResult);
-
- // JumpTable targets must use GOT when using PIC_
- setUsesGlobalOffsetTable(true);
-
- // Set up the register classes
- addRegisterClass(MVT::i32, Mips::CPURegsRegisterClass);
-
- // Custom
- setOperationAction(ISD::GlobalAddress, MVT::i32, Custom);
- setOperationAction(ISD::GlobalTLSAddress, MVT::i32, Custom);
- setOperationAction(ISD::RET, MVT::Other, Custom);
- setOperationAction(ISD::JumpTable, MVT::i32, Custom);
-
- // Load extented operations for i1 types must be promoted
- setLoadXAction(ISD::EXTLOAD, MVT::i1, Promote);
- setLoadXAction(ISD::ZEXTLOAD, MVT::i1, Promote);
- setLoadXAction(ISD::SEXTLOAD, MVT::i1, Promote);
-
- // Mips does not have these NodeTypes below.
- setOperationAction(ISD::BR_JT, MVT::Other, Expand);
- setOperationAction(ISD::BR_CC, MVT::Other, Expand);
- setOperationAction(ISD::SELECT_CC, MVT::Other, Expand);
- setOperationAction(ISD::SELECT_CC, MVT::i32, Expand);
- setOperationAction(ISD::SELECT, MVT::i32, Expand);
- setOperationAction(ISD::SIGN_EXTEND_INREG, MVT::i1, Expand);
-
- // Mips not supported intrinsics.
- setOperationAction(ISD::MEMBARRIER, MVT::Other, Expand);
-
- setOperationAction(ISD::CTPOP, MVT::i32, Expand);
- setOperationAction(ISD::CTTZ , MVT::i32, Expand);
- setOperationAction(ISD::CTLZ , MVT::i32, Expand);
- setOperationAction(ISD::ROTL , MVT::i32, Expand);
- setOperationAction(ISD::ROTR , MVT::i32, Expand);
- setOperationAction(ISD::BSWAP, MVT::i32, Expand);
-
- setOperationAction(ISD::SHL_PARTS, MVT::i32, Expand);
- setOperationAction(ISD::SRA_PARTS, MVT::i32, Expand);
- setOperationAction(ISD::SRL_PARTS, MVT::i32, Expand);
-
- // We don't have line number support yet.
- setOperationAction(ISD::LOCATION, MVT::Other, Expand);
- setOperationAction(ISD::DEBUG_LOC, MVT::Other, Expand);
- setOperationAction(ISD::LABEL, MVT::Other, Expand);
-
- // Use the default for now
- setOperationAction(ISD::STACKSAVE, MVT::Other, Expand);
- setOperationAction(ISD::STACKRESTORE, MVT::Other, Expand);
-
- setStackPointerRegisterToSaveRestore(Mips::SP);
- computeRegisterProperties();
-}
-
-
-MVT::ValueType
-MipsTargetLowering::getSetCCResultType(const SDOperand &) const {
- return MVT::i32;
-}
-
-
-SDOperand MipsTargetLowering::
-LowerOperation(SDOperand Op, SelectionDAG &DAG)
-{
- switch (Op.getOpcode())
- {
- case ISD::CALL: return LowerCALL(Op, DAG);
- case ISD::FORMAL_ARGUMENTS: return LowerFORMAL_ARGUMENTS(Op, DAG);
- case ISD::RET: return LowerRET(Op, DAG);
- case ISD::GlobalAddress: return LowerGlobalAddress(Op, DAG);
- case ISD::GlobalTLSAddress: return LowerGlobalTLSAddress(Op, DAG);
- case ISD::JumpTable: return LowerJumpTable(Op, DAG);
- }
- return SDOperand();
-}
-
-//===----------------------------------------------------------------------===//
-// Lower helper functions
-//===----------------------------------------------------------------------===//
-
-// AddLiveIn - This helper function adds the specified physical register to the
-// MachineFunction as a live in value. It also creates a corresponding
-// virtual register for it.
-static unsigned
-AddLiveIn(MachineFunction &MF, unsigned PReg, TargetRegisterClass *RC)
-{
- assert(RC->contains(PReg) && "Not the correct regclass!");
- unsigned VReg = MF.getRegInfo().createVirtualRegister(RC);
- MF.getRegInfo().addLiveIn(PReg, VReg);
- return VReg;
-}
-
-//===----------------------------------------------------------------------===//
-// Misc Lower Operation implementation
-//===----------------------------------------------------------------------===//
-SDOperand MipsTargetLowering::
-LowerGlobalAddress(SDOperand Op, SelectionDAG &DAG)
-{
- SDOperand ResNode;
- GlobalValue *GV = cast<GlobalAddressSDNode>(Op)->getGlobal();
- SDOperand GA = DAG.getTargetGlobalAddress(GV, MVT::i32);
- bool isPIC = (getTargetMachine().getRelocationModel() == Reloc::PIC_);
-
- SDOperand HiPart;
- if (!isPIC) {
- const MVT::ValueType *VTs = DAG.getNodeValueTypes(MVT::i32);
- SDOperand Ops[] = { GA };
- HiPart = DAG.getNode(MipsISD::Hi, VTs, 1, Ops, 1);
- } else // Emit Load from Global Pointer
- HiPart = DAG.getLoad(MVT::i32, DAG.getEntryNode(), GA, NULL, 0);
-
- // On functions and global targets not internal linked only
- // a load from got/GP is necessary for PIC to work.
- if ((isPIC) && ((!GV->hasInternalLinkage()) || (isa<Function>(GV))))
- return HiPart;
-
- SDOperand Lo = DAG.getNode(MipsISD::Lo, MVT::i32, GA);
- ResNode = DAG.getNode(ISD::ADD, MVT::i32, HiPart, Lo);
-
- return ResNode;
-}
-
-SDOperand MipsTargetLowering::
-LowerGlobalTLSAddress(SDOperand Op, SelectionDAG &DAG)
-{
- assert(0 && "TLS not implemented for MIPS.");
- return SDOperand(); // Not reached
-}
-
-SDOperand MipsTargetLowering::
-LowerJumpTable(SDOperand Op, SelectionDAG &DAG)
-{
- SDOperand ResNode;
- SDOperand HiPart;
-
- MVT::ValueType PtrVT = Op.getValueType();
- JumpTableSDNode *JT = cast<JumpTableSDNode>(Op);
- SDOperand JTI = DAG.getTargetJumpTable(JT->getIndex(), PtrVT);
-
- if (getTargetMachine().getRelocationModel() != Reloc::PIC_) {
- const MVT::ValueType *VTs = DAG.getNodeValueTypes(MVT::i32);
- SDOperand Ops[] = { JTI };
- HiPart = DAG.getNode(MipsISD::Hi, VTs, 1, Ops, 1);
- } else // Emit Load from Global Pointer
- HiPart = DAG.getLoad(MVT::i32, DAG.getEntryNode(), JTI, NULL, 0);
-
- SDOperand Lo = DAG.getNode(MipsISD::Lo, MVT::i32, JTI);
- ResNode = DAG.getNode(ISD::ADD, MVT::i32, HiPart, Lo);
-
- return ResNode;
-}
-
-//===----------------------------------------------------------------------===//
-// Calling Convention Implementation
-//
-// The lower operations present on calling convention works on this order:
-// LowerCALL (virt regs --> phys regs, virt regs --> stack)
-// LowerFORMAL_ARGUMENTS (phys --> virt regs, stack --> virt regs)
-// LowerRET (virt regs --> phys regs)
-// LowerCALL (phys regs --> virt regs)
-//
-//===----------------------------------------------------------------------===//
-
-#include "MipsGenCallingConv.inc"
-
-//===----------------------------------------------------------------------===//
-// CALL Calling Convention Implementation
-//===----------------------------------------------------------------------===//
-
-/// Mips custom CALL implementation
-SDOperand MipsTargetLowering::
-LowerCALL(SDOperand Op, SelectionDAG &DAG)
-{
- unsigned CallingConv = cast<ConstantSDNode>(Op.getOperand(1))->getValue();
-
- // By now, only CallingConv::C implemented
- switch (CallingConv) {
- default:
- assert(0 && "Unsupported calling convention");
- case CallingConv::Fast:
- case CallingConv::C:
- return LowerCCCCallTo(Op, DAG, CallingConv);
- }
-}
-
-/// LowerCCCCallTo - functions arguments are copied from virtual
-/// regs to (physical regs)/(stack frame), CALLSEQ_START and
-/// CALLSEQ_END are emitted.
-/// TODO: isVarArg, isTailCall, sret.
-SDOperand MipsTargetLowering::
-LowerCCCCallTo(SDOperand Op, SelectionDAG &DAG, unsigned CC)
-{
- MachineFunction &MF = DAG.getMachineFunction();
-
- SDOperand Chain = Op.getOperand(0);
- SDOperand Callee = Op.getOperand(4);
- bool isVarArg = cast<ConstantSDNode>(Op.getOperand(2))->getValue() != 0;
-
- MachineFrameInfo *MFI = MF.getFrameInfo();
-
- // Analyze operands of the call, assigning locations to each operand.
- SmallVector<CCValAssign, 16> ArgLocs;
- CCState CCInfo(CC, isVarArg, getTargetMachine(), ArgLocs);
-
- // To meet ABI, Mips must always allocate 16 bytes on
- // the stack (even if less than 4 are used as arguments)
- int VTsize = MVT::getSizeInBits(MVT::i32)/8;
- MFI->CreateFixedObject(VTsize, (VTsize*3));
-
- CCInfo.AnalyzeCallOperands(Op.Val, CC_Mips);
-
- // Get a count of how many bytes are to be pushed on the stack.
- unsigned NumBytes = CCInfo.getNextStackOffset();
- Chain = DAG.getCALLSEQ_START(Chain,DAG.getConstant(NumBytes,
- getPointerTy()));
-
- SmallVector<std::pair<unsigned, SDOperand>, 8> RegsToPass;
- SmallVector<SDOperand, 8> MemOpChains;
-
- int LastStackLoc = 0;
-
- // Walk the register/memloc assignments, inserting copies/loads.
- for (unsigned i = 0, e = ArgLocs.size(); i != e; ++i) {
- CCValAssign &VA = ArgLocs[i];
-
- // Arguments start after the 5 first operands of ISD::CALL
- SDOperand Arg = Op.getOperand(5+2*VA.getValNo());
-
- // Promote the value if needed.
- switch (VA.getLocInfo()) {
- default: assert(0 && "Unknown loc info!");
- case CCValAssign::Full: break;
- case CCValAssign::SExt:
- Arg = DAG.getNode(ISD::SIGN_EXTEND, VA.getLocVT(), Arg);
- break;
- case CCValAssign::ZExt:
- Arg = DAG.getNode(ISD::ZERO_EXTEND, VA.getLocVT(), Arg);
- break;
- case CCValAssign::AExt:
- Arg = DAG.getNode(ISD::ANY_EXTEND, VA.getLocVT(), Arg);
- break;
- }
-
- // Arguments that can be passed on register must be kept at
- // RegsToPass vector
- if (VA.isRegLoc()) {
- RegsToPass.push_back(std::make_pair(VA.getLocReg(), Arg));
- continue;
- }
-
- assert(VA.isMemLoc());
-
- // Create the frame index object for this incoming parameter
- // This guarantees that when allocating Local Area the firsts
- // 16 bytes which are alwayes reserved won't be overwritten.
- LastStackLoc = (16 + VA.getLocMemOffset());
- int FI = MFI->CreateFixedObject(MVT::getSizeInBits(VA.getValVT())/8,
- LastStackLoc);
-
- SDOperand PtrOff = DAG.getFrameIndex(FI,getPointerTy());
-
- // emit ISD::STORE whichs stores the
- // parameter value to a stack Location
- MemOpChains.push_back(DAG.getStore(Chain, Arg, PtrOff, NULL, 0));
- }
-
- // Transform all store nodes into one single node because
- // all store nodes are independent of each other.
- if (!MemOpChains.empty())
- Chain = DAG.getNode(ISD::TokenFactor, MVT::Other,
- &MemOpChains[0], MemOpChains.size());
-
- // Build a sequence of copy-to-reg nodes chained together with token
- // chain and flag operands which copy the outgoing args into registers.
- // The InFlag in necessary since all emited instructions must be
- // stuck together.
- SDOperand InFlag;
- for (unsigned i = 0, e = RegsToPass.size(); i != e; ++i) {
- Chain = DAG.getCopyToReg(Chain, RegsToPass[i].first,
- RegsToPass[i].second, InFlag);
- InFlag = Chain.getValue(1);
- }
-
- // If the callee is a GlobalAddress/ExternalSymbol node (quite common, every
- // direct call is) turn it into a TargetGlobalAddress/TargetExternalSymbol
- // node so that legalize doesn't hack it.
- if (GlobalAddressSDNode *G = dyn_cast<GlobalAddressSDNode>(Callee))
- Callee = DAG.getTargetGlobalAddress(G->getGlobal(), getPointerTy());
- else if (ExternalSymbolSDNode *S = dyn_cast<ExternalSymbolSDNode>(Callee))
- Callee = DAG.getTargetExternalSymbol(S->getSymbol(), getPointerTy());
-
-
- // MipsJmpLink = #chain, #target_address, #opt_in_flags...
- // = Chain, Callee, Reg#1, Reg#2, ...
- //
- // Returns a chain & a flag for retval copy to use.
- SDVTList NodeTys = DAG.getVTList(MVT::Other, MVT::Flag);
- SmallVector<SDOperand, 8> Ops;
- Ops.push_back(Chain);
- Ops.push_back(Callee);
-
- // Add argument registers to the end of the list so that they are
- // known live into the call.
- for (unsigned i = 0, e = RegsToPass.size(); i != e; ++i)
- Ops.push_back(DAG.getRegister(RegsToPass[i].first,
- RegsToPass[i].second.getValueType()));
-
- if (InFlag.Val)
- Ops.push_back(InFlag);
-
- Chain = DAG.getNode(MipsISD::JmpLink, NodeTys, &Ops[0], Ops.size());
- InFlag = Chain.getValue(1);
-
- // Create a stack location to hold GP when PIC is used. This stack
- // location is used on function prologue to save GP and also after all
- // emited CALL's to restore GP.
- if (getTargetMachine().getRelocationModel() == Reloc::PIC_) {
- // Function can have an arbitrary number of calls, so
- // hold the LastStackLoc with the biggest offset.
- int FI;
- MipsFunctionInfo *MipsFI = MF.getInfo<MipsFunctionInfo>();
- if (LastStackLoc >= MipsFI->getGPStackOffset()) {
- LastStackLoc = (!LastStackLoc) ? (16) : (LastStackLoc+4);
- // Create the frame index only once. SPOffset here can be anything
- // (this will be fixed on processFunctionBeforeFrameFinalized)
- if (MipsFI->getGPStackOffset() == -1) {
- FI = MFI->CreateFixedObject(4, 0);
- MipsFI->setGPFI(FI);
- }
- MipsFI->setGPStackOffset(LastStackLoc);
- }
-
- // Reload GP value.
- FI = MipsFI->getGPFI();
- SDOperand FIN = DAG.getFrameIndex(FI,getPointerTy());
- SDOperand GPLoad = DAG.getLoad(MVT::i32, Chain, FIN, NULL, 0);
- Chain = GPLoad.getValue(1);
- Chain = DAG.getCopyToReg(Chain, DAG.getRegister(Mips::GP, MVT::i32),
- GPLoad, SDOperand(0,0));
- }
-
- // Create the CALLSEQ_END node.
- Chain = DAG.getCALLSEQ_END(Chain,
- DAG.getConstant(NumBytes, getPointerTy()),
- DAG.getConstant(0, getPointerTy()),
- InFlag);
- InFlag = Chain.getValue(1);
-
- // Handle result values, copying them out of physregs into vregs that we
- // return.
- return SDOperand(LowerCallResult(Chain, InFlag, Op.Val, CC, DAG), Op.ResNo);
-}
-
-/// LowerCallResult - Lower the result values of an ISD::CALL into the
-/// appropriate copies out of appropriate physical registers. This assumes that
-/// Chain/InFlag are the input chain/flag to use, and that TheCall is the call
-/// being lowered. Returns a SDNode with the same number of values as the
-/// ISD::CALL.
-SDNode *MipsTargetLowering::
-LowerCallResult(SDOperand Chain, SDOperand InFlag, SDNode *TheCall,
- unsigned CallingConv, SelectionDAG &DAG) {
-
- bool isVarArg = cast<ConstantSDNode>(TheCall->getOperand(2))->getValue() != 0;
-
- // Assign locations to each value returned by this call.
- SmallVector<CCValAssign, 16> RVLocs;
- CCState CCInfo(CallingConv, isVarArg, getTargetMachine(), RVLocs);
-
- CCInfo.AnalyzeCallResult(TheCall, RetCC_Mips);
- SmallVector<SDOperand, 8> ResultVals;
-
- // Copy all of the result registers out of their specified physreg.
- for (unsigned i = 0; i != RVLocs.size(); ++i) {
- Chain = DAG.getCopyFromReg(Chain, RVLocs[i].getLocReg(),
- RVLocs[i].getValVT(), InFlag).getValue(1);
- InFlag = Chain.getValue(2);
- ResultVals.push_back(Chain.getValue(0));
- }
-
- ResultVals.push_back(Chain);
-
- // Merge everything together with a MERGE_VALUES node.
- return DAG.getNode(ISD::MERGE_VALUES, TheCall->getVTList(),
- &ResultVals[0], ResultVals.size()).Val;
-}
-
-//===----------------------------------------------------------------------===//
-// FORMAL_ARGUMENTS Calling Convention Implementation
-//===----------------------------------------------------------------------===//
-
-/// Mips custom FORMAL_ARGUMENTS implementation
-SDOperand MipsTargetLowering::
-LowerFORMAL_ARGUMENTS(SDOperand Op, SelectionDAG &DAG)
-{
- unsigned CC = cast<ConstantSDNode>(Op.getOperand(1))->getValue();
- switch(CC)
- {
- default:
- assert(0 && "Unsupported calling convention");
- case CallingConv::C:
- return LowerCCCArguments(Op, DAG);
- }
-}
-
-/// LowerCCCArguments - transform physical registers into
-/// virtual registers and generate load operations for
-/// arguments places on the stack.
-/// TODO: isVarArg, sret
-SDOperand MipsTargetLowering::
-LowerCCCArguments(SDOperand Op, SelectionDAG &DAG)
-{
- SDOperand Root = Op.getOperand(0);
- MachineFunction &MF = DAG.getMachineFunction();
- MachineFrameInfo *MFI = MF.getFrameInfo();
- MipsFunctionInfo *MipsFI = MF.getInfo<MipsFunctionInfo>();
-
- bool isVarArg = cast<ConstantSDNode>(Op.getOperand(2))->getValue() != 0;
- unsigned CC = DAG.getMachineFunction().getFunction()->getCallingConv();
-
- unsigned StackReg = MF.getTarget().getRegisterInfo()->getFrameRegister(MF);
-
- // GP holds the GOT address on PIC calls.
- if (getTargetMachine().getRelocationModel() == Reloc::PIC_)
- AddLiveIn(MF, Mips::GP, Mips::CPURegsRegisterClass);
-
- // Assign locations to all of the incoming arguments.
- SmallVector<CCValAssign, 16> ArgLocs;
- CCState CCInfo(CC, isVarArg, getTargetMachine(), ArgLocs);
-
- CCInfo.AnalyzeFormalArguments(Op.Val, CC_Mips);
- SmallVector<SDOperand, 8> ArgValues;
- SDOperand StackPtr;
-
- for (unsigned i = 0, e = ArgLocs.size(); i != e; ++i) {
-
- CCValAssign &VA = ArgLocs[i];
-
- // Arguments stored on registers
- if (VA.isRegLoc()) {
- MVT::ValueType RegVT = VA.getLocVT();
- TargetRegisterClass *RC;
-
- if (RegVT == MVT::i32)
- RC = Mips::CPURegsRegisterClass;
- else
- assert(0 && "support only Mips::CPURegsRegisterClass");
-
- // Transform the arguments stored on
- // physical registers into virtual ones
- unsigned Reg = AddLiveIn(DAG.getMachineFunction(), VA.getLocReg(), RC);
- SDOperand ArgValue = DAG.getCopyFromReg(Root, Reg, RegVT);
-
- // If this is an 8 or 16-bit value, it is really passed promoted
- // to 32 bits. Insert an assert[sz]ext to capture this, then
- // truncate to the right size.
- if (VA.getLocInfo() == CCValAssign::SExt)
- ArgValue = DAG.getNode(ISD::AssertSext, RegVT, ArgValue,
- DAG.getValueType(VA.getValVT()));
- else if (VA.getLocInfo() == CCValAssign::ZExt)
- ArgValue = DAG.getNode(ISD::AssertZext, RegVT, ArgValue,
- DAG.getValueType(VA.getValVT()));
-
- if (VA.getLocInfo() != CCValAssign::Full)
- ArgValue = DAG.getNode(ISD::TRUNCATE, VA.getValVT(), ArgValue);
-
- ArgValues.push_back(ArgValue);
-
- // To meet ABI, when VARARGS are passed on registers, the registers
- // must have their values written to the caller stack frame.
- if (isVarArg) {
-
- if (StackPtr.Val == 0)
- StackPtr = DAG.getRegister(StackReg, getPointerTy());
-
- // The stack pointer offset is relative to the caller stack frame.
- // Since the real stack size is unknown here, a negative SPOffset
- // is used so there's a way to adjust these offsets when the stack
- // size get known (on EliminateFrameIndex). A dummy SPOffset is
- // used instead of a direct negative address (which is recorded to
- // be used on emitPrologue) to avoid mis-calc of the first stack
- // offset on PEI::calculateFrameObjectOffsets.
- // Arguments are always 32-bit.
- int FI = MFI->CreateFixedObject(4, 0);
- MipsFI->recordStoreVarArgsFI(FI, -(4+(i*4)));
- SDOperand PtrOff = DAG.getFrameIndex(FI, getPointerTy());
-
- // emit ISD::STORE whichs stores the
- // parameter value to a stack Location
- ArgValues.push_back(DAG.getStore(Root, ArgValue, PtrOff, NULL, 0));
- }
-
- } else {
- // sanity check
- assert(VA.isMemLoc());
-
- // The stack pointer offset is relative to the caller stack frame.
- // Since the real stack size is unknown here, a negative SPOffset
- // is used so there's a way to adjust these offsets when the stack
- // size get known (on EliminateFrameIndex). A dummy SPOffset is
- // used instead of a direct negative address (which is recorded to
- // be used on emitPrologue) to avoid mis-calc of the first stack
- // offset on PEI::calculateFrameObjectOffsets.
- // Arguments are always 32-bit.
- int FI = MFI->CreateFixedObject(4, 0);
- MipsFI->recordLoadArgsFI(FI, -(4+(16+VA.getLocMemOffset())));
-
- // Create load nodes to retrieve arguments from the stack
- SDOperand FIN = DAG.getFrameIndex(FI, getPointerTy());
- ArgValues.push_back(DAG.getLoad(VA.getValVT(), Root, FIN, NULL, 0));
- }
- }
- ArgValues.push_back(Root);
-
- // Return the new list of results.
- return DAG.getNode(ISD::MERGE_VALUES, Op.Val->getVTList(),
- &ArgValues[0], ArgValues.size()).getValue(Op.ResNo);
-}
-
-//===----------------------------------------------------------------------===//
-// Return Value Calling Convention Implementation
-//===----------------------------------------------------------------------===//
-
-SDOperand MipsTargetLowering::
-LowerRET(SDOperand Op, SelectionDAG &DAG)
-{
- // CCValAssign - represent the assignment of
- // the return value to a location
- SmallVector<CCValAssign, 16> RVLocs;
- unsigned CC = DAG.getMachineFunction().getFunction()->getCallingConv();
- bool isVarArg = DAG.getMachineFunction().getFunction()->isVarArg();
-
- // CCState - Info about the registers and stack slot.
- CCState CCInfo(CC, isVarArg, getTargetMachine(), RVLocs);
-
- // Analize return values of ISD::RET
- CCInfo.AnalyzeReturn(Op.Val, RetCC_Mips);
-
- // If this is the first return lowered for this function, add
- // the regs to the liveout set for the function.
- if (DAG.getMachineFunction().getRegInfo().liveout_empty()) {
- for (unsigned i = 0; i != RVLocs.size(); ++i)
- if (RVLocs[i].isRegLoc())
- DAG.getMachineFunction().getRegInfo().addLiveOut(RVLocs[i].getLocReg());
- }
-
- // The chain is always operand #0
- SDOperand Chain = Op.getOperand(0);
- SDOperand Flag;
-
- // Copy the result values into the output registers.
- for (unsigned i = 0; i != RVLocs.size(); ++i) {
- CCValAssign &VA = RVLocs[i];
- assert(VA.isRegLoc() && "Can only return in registers!");
-
- // ISD::RET => ret chain, (regnum1,val1), ...
- // So i*2+1 index only the regnums
- Chain = DAG.getCopyToReg(Chain, VA.getLocReg(), Op.getOperand(i*2+1), Flag);
-
- // guarantee that all emitted copies are
- // stuck together, avoiding something bad
- Flag = Chain.getValue(1);
- }
-
- // Return on Mips is always a "jr $ra"
- if (Flag.Val)
- return DAG.getNode(MipsISD::Ret, MVT::Other,
- Chain, DAG.getRegister(Mips::RA, MVT::i32), Flag);
- else // Return Void
- return DAG.getNode(MipsISD::Ret, MVT::Other,
- Chain, DAG.getRegister(Mips::RA, MVT::i32));
-}
-
-//===----------------------------------------------------------------------===//
-// Mips Inline Assembly Support
-//===----------------------------------------------------------------------===//
-
-/// getConstraintType - Given a constraint letter, return the type of
-/// constraint it is for this target.
-MipsTargetLowering::ConstraintType MipsTargetLowering::
-getConstraintType(const std::string &Constraint) const
-{
- if (Constraint.size() == 1) {
- // Mips specific constrainy
- // GCC config/mips/constraints.md
- //
- // 'd' : An address register. Equivalent to r
- // unless generating MIPS16 code.
- // 'y' : Equivalent to r; retained for
- // backwards compatibility.
- //
- switch (Constraint[0]) {
- default : break;
- case 'd':
- case 'y':
- return C_RegisterClass;
- break;
- }
- }
- return TargetLowering::getConstraintType(Constraint);
-}
-
-std::pair<unsigned, const TargetRegisterClass*> MipsTargetLowering::
-getRegForInlineAsmConstraint(const std::string &Constraint,
- MVT::ValueType VT) const
-{
- if (Constraint.size() == 1) {
- switch (Constraint[0]) {
- case 'r':
- return std::make_pair(0U, Mips::CPURegsRegisterClass);
- break;
- }
- }
- return TargetLowering::getRegForInlineAsmConstraint(Constraint, VT);
-}
-
-std::vector<unsigned> MipsTargetLowering::
-getRegClassForInlineAsmConstraint(const std::string &Constraint,
- MVT::ValueType VT) const
-{
- if (Constraint.size() != 1)
- return std::vector<unsigned>();
-
- switch (Constraint[0]) {
- default : break;
- case 'r':
- // GCC Mips Constraint Letters
- case 'd':
- case 'y':
- return make_vector<unsigned>(Mips::V0, Mips::V1, Mips::A0,
- Mips::A1, Mips::A2, Mips::A3,
- Mips::T0, Mips::T1, Mips::T2,
- Mips::T3, Mips::T4, Mips::T5,
- Mips::T6, Mips::T7, Mips::S0,
- Mips::S1, Mips::S2, Mips::S3,
- Mips::S4, Mips::S5, Mips::S6,
- Mips::S7, Mips::T8, Mips::T9, 0);
- break;
- }
- return std::vector<unsigned>();
-}
diff --git a/release_23/lib/Target/Mips/MipsISelLowering.h b/release_23/lib/Target/Mips/MipsISelLowering.h
deleted file mode 100644
index e2b4b3f4a89c..000000000000
--- a/release_23/lib/Target/Mips/MipsISelLowering.h
+++ /dev/null
@@ -1,97 +0,0 @@
-//===-- MipsISelLowering.h - Mips DAG Lowering Interface --------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines the interfaces that Mips uses to lower LLVM code into a
-// selection DAG.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef MipsISELLOWERING_H
-#define MipsISELLOWERING_H
-
-#include "llvm/CodeGen/SelectionDAG.h"
-#include "llvm/Target/TargetLowering.h"
-#include "Mips.h"
-#include "MipsSubtarget.h"
-
-namespace llvm {
- namespace MipsISD {
- enum NodeType {
- // Start the numbering from where ISD NodeType finishes.
- FIRST_NUMBER = ISD::BUILTIN_OP_END+Mips::INSTRUCTION_LIST_END,
-
- // Jump and link (call)
- JmpLink,
-
- // Get the Higher 16 bits from a 32-bit immediate
- // No relation with Mips Hi register
- Hi,
-
- // Get the Lower 16 bits from a 32-bit immediate
- // No relation with Mips Lo register
- Lo,
-
- // Return
- Ret
- };
- }
-
- //===--------------------------------------------------------------------===//
- // TargetLowering Implementation
- //===--------------------------------------------------------------------===//
- class MipsTargetLowering : public TargetLowering
- {
- // FrameIndex for return slot.
- int ReturnAddrIndex;
-
- // const MipsSubtarget &MipsSubTarget;
- public:
-
- explicit MipsTargetLowering(MipsTargetMachine &TM);
-
- /// LowerOperation - Provide custom lowering hooks for some operations.
- virtual SDOperand LowerOperation(SDOperand Op, SelectionDAG &DAG);
-
- /// getTargetNodeName - This method returns the name of a target specific
- // DAG node.
- virtual const char *getTargetNodeName(unsigned Opcode) const;
-
- /// getSetCCResultType - get the ISD::SETCC result ValueType
- MVT::ValueType getSetCCResultType(const SDOperand &) const;
-
- private:
- // Lower Operand helpers
- SDOperand LowerCCCArguments(SDOperand Op, SelectionDAG &DAG);
- SDOperand LowerCCCCallTo(SDOperand Op, SelectionDAG &DAG, unsigned CC);
- SDNode *LowerCallResult(SDOperand Chain, SDOperand InFlag, SDNode*TheCall,
- unsigned CallingConv, SelectionDAG &DAG);
- SDOperand getReturnAddressFrameIndex(SelectionDAG &DAG);
-
- // Lower Operand specifics
- SDOperand LowerRET(SDOperand Op, SelectionDAG &DAG);
- SDOperand LowerCALL(SDOperand Op, SelectionDAG &DAG);
- SDOperand LowerFORMAL_ARGUMENTS(SDOperand Op, SelectionDAG &DAG);
- SDOperand LowerGlobalAddress(SDOperand Op, SelectionDAG &DAG);
- SDOperand LowerGlobalTLSAddress(SDOperand Op, SelectionDAG &DAG);
- SDOperand LowerJumpTable(SDOperand Op, SelectionDAG &DAG);
-
- // Inline asm support
- ConstraintType getConstraintType(const std::string &Constraint) const;
-
- std::pair<unsigned, const TargetRegisterClass*>
- getRegForInlineAsmConstraint(const std::string &Constraint,
- MVT::ValueType VT) const;
-
- std::vector<unsigned>
- getRegClassForInlineAsmConstraint(const std::string &Constraint,
- MVT::ValueType VT) const;
- };
-}
-
-#endif // MipsISELLOWERING_H
diff --git a/release_23/lib/Target/Mips/MipsInstrFormats.td b/release_23/lib/Target/Mips/MipsInstrFormats.td
deleted file mode 100644
index caeabd5b5e7e..000000000000
--- a/release_23/lib/Target/Mips/MipsInstrFormats.td
+++ /dev/null
@@ -1,104 +0,0 @@
-//===- MipsRegisterInfo.td - Mips Register defs -----------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-//===----------------------------------------------------------------------===//
-// Describe MIPS instructions format
-//
-// All the possible Mips fields are:
-//
-// opcode - operation code.
-// rs - src reg.
-// rt - dst reg (on a 2 regs instr) or src reg (on a 3 reg instr).
-// rd - dst reg, only used on 3 regs instr.
-// shamt - only used on shift instructions, contains the shift amount.
-// funct - combined with opcode field give us an operation code.
-//
-//===----------------------------------------------------------------------===//
-
-// Generic Mips Format
-class MipsInst<dag outs, dag ins, string asmstr, list<dag> pattern,
- InstrItinClass itin>: Instruction
-{
- field bits<32> Inst;
-
- let Namespace = "Mips";
-
- bits<6> opcode;
-
- // Top 5 bits are the 'opcode' field
- let Inst{31-26} = opcode;
-
- dag OutOperandList = outs;
- dag InOperandList = ins;
-
- let AsmString = asmstr;
- let Pattern = pattern;
- let Itinerary = itin;
-}
-
-// Mips Pseudo Instructions Format
-class PseudoInstMips<dag outs, dag ins, string asmstr, list<dag> pattern>:
- MipsInst<outs, ins, asmstr, pattern, IIPseudo>;
-
-//===----------------------------------------------------------------------===//
-// Format R instruction class in Mips : <|opcode|rs|rt|rd|shamt|funct|>
-//===----------------------------------------------------------------------===//
-
-class FR<bits<6> op, bits<6> _funct, dag outs, dag ins, string asmstr,
- list<dag> pattern, InstrItinClass itin>:
- MipsInst<outs, ins, asmstr, pattern, itin>
-{
- bits<5> rd;
- bits<5> rs;
- bits<5> rt;
- bits<5> shamt;
- bits<6> funct;
-
- let opcode = op;
- let funct = _funct;
-
- let Inst{25-21} = rs;
- let Inst{20-16} = rt;
- let Inst{15-11} = rd;
- let Inst{10-6} = shamt;
- let Inst{5-0} = funct;
-}
-
-//===----------------------------------------------------------------------===//
-// Format I instruction class in Mips : <|opcode|rs|rt|immediate|>
-//===----------------------------------------------------------------------===//
-
-class FI<bits<6> op, dag outs, dag ins, string asmstr, list<dag> pattern,
- InstrItinClass itin>: MipsInst<outs, ins, asmstr, pattern, itin>
-{
- bits<5> rt;
- bits<5> rs;
- bits<16> imm16;
-
- let opcode = op;
-
- let Inst{25-21} = rs;
- let Inst{20-16} = rt;
- let Inst{15-0} = imm16;
-}
-
-//===----------------------------------------------------------------------===//
-// Format J instruction class in Mips : <|opcode|address|>
-//===----------------------------------------------------------------------===//
-
-class FJ<bits<6> op, dag outs, dag ins, string asmstr, list<dag> pattern,
- InstrItinClass itin>: MipsInst<outs, ins, asmstr, pattern, itin>
-{
- bits<26> addr;
-
- let opcode = op;
-
- let Inst{25-0} = addr;
-}
-
diff --git a/release_23/lib/Target/Mips/MipsInstrInfo.cpp b/release_23/lib/Target/Mips/MipsInstrInfo.cpp
deleted file mode 100644
index fa5d8b3bd77a..000000000000
--- a/release_23/lib/Target/Mips/MipsInstrInfo.cpp
+++ /dev/null
@@ -1,456 +0,0 @@
-//===- MipsInstrInfo.cpp - Mips Instruction Information ---------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains the Mips implementation of the TargetInstrInfo class.
-//
-//===----------------------------------------------------------------------===//
-
-#include "Mips.h"
-#include "MipsInstrInfo.h"
-#include "llvm/ADT/STLExtras.h"
-#include "llvm/CodeGen/MachineInstrBuilder.h"
-#include "MipsGenInstrInfo.inc"
-
-using namespace llvm;
-
-// TODO: Add the subtarget support on this constructor
-MipsInstrInfo::MipsInstrInfo(MipsTargetMachine &tm)
- : TargetInstrInfoImpl(MipsInsts, array_lengthof(MipsInsts)),
- TM(tm), RI(*this) {}
-
-static bool isZeroImm(const MachineOperand &op) {
- return op.isImmediate() && op.getImm() == 0;
-}
-
-/// Return true if the instruction is a register to register move and
-/// leave the source and dest operands in the passed parameters.
-bool MipsInstrInfo::
-isMoveInstr(const MachineInstr &MI, unsigned &SrcReg, unsigned &DstReg) const
-{
- // addu $dst, $src, $zero || addu $dst, $zero, $src
- // or $dst, $src, $zero || or $dst, $zero, $src
- if ((MI.getOpcode() == Mips::ADDu) || (MI.getOpcode() == Mips::OR))
- {
- if (MI.getOperand(1).getReg() == Mips::ZERO) {
- DstReg = MI.getOperand(0).getReg();
- SrcReg = MI.getOperand(2).getReg();
- return true;
- } else if (MI.getOperand(2).getReg() == Mips::ZERO) {
- DstReg = MI.getOperand(0).getReg();
- SrcReg = MI.getOperand(1).getReg();
- return true;
- }
- }
-
- // addiu $dst, $src, 0
- if (MI.getOpcode() == Mips::ADDiu)
- {
- if ((MI.getOperand(1).isRegister()) && (isZeroImm(MI.getOperand(2)))) {
- DstReg = MI.getOperand(0).getReg();
- SrcReg = MI.getOperand(1).getReg();
- return true;
- }
- }
- return false;
-}
-
-/// isLoadFromStackSlot - If the specified machine instruction is a direct
-/// load from a stack slot, return the virtual or physical register number of
-/// the destination along with the FrameIndex of the loaded stack slot. If
-/// not, return 0. This predicate must return 0 if the instruction has
-/// any side effects other than loading from the stack slot.
-unsigned MipsInstrInfo::
-isLoadFromStackSlot(MachineInstr *MI, int &FrameIndex) const
-{
- if (MI->getOpcode() == Mips::LW)
- {
- if ((MI->getOperand(2).isFrameIndex()) && // is a stack slot
- (MI->getOperand(1).isImmediate()) && // the imm is zero
- (isZeroImm(MI->getOperand(1))))
- {
- FrameIndex = MI->getOperand(2).getIndex();
- return MI->getOperand(0).getReg();
- }
- }
-
- return 0;
-}
-
-/// isStoreToStackSlot - If the specified machine instruction is a direct
-/// store to a stack slot, return the virtual or physical register number of
-/// the source reg along with the FrameIndex of the loaded stack slot. If
-/// not, return 0. This predicate must return 0 if the instruction has
-/// any side effects other than storing to the stack slot.
-unsigned MipsInstrInfo::
-isStoreToStackSlot(MachineInstr *MI, int &FrameIndex) const
-{
- if (MI->getOpcode() == Mips::SW) {
- if ((MI->getOperand(0).isFrameIndex()) && // is a stack slot
- (MI->getOperand(1).isImmediate()) && // the imm is zero
- (isZeroImm(MI->getOperand(1))))
- {
- FrameIndex = MI->getOperand(0).getIndex();
- return MI->getOperand(2).getReg();
- }
- }
- return 0;
-}
-
-/// insertNoop - If data hazard condition is found insert the target nop
-/// instruction.
-void MipsInstrInfo::
-insertNoop(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI) const
-{
- BuildMI(MBB, MI, get(Mips::NOP));
-}
-
-//===----------------------------------------------------------------------===//
-// Branch Analysis
-//===----------------------------------------------------------------------===//
-
-/// GetCondFromBranchOpc - Return the Mips CC that matches
-/// the correspondent Branch instruction opcode.
-static Mips::CondCode GetCondFromBranchOpc(unsigned BrOpc)
-{
- switch (BrOpc) {
- default: return Mips::COND_INVALID;
- case Mips::BEQ : return Mips::COND_E;
- case Mips::BNE : return Mips::COND_NE;
- case Mips::BGTZ : return Mips::COND_GZ;
- case Mips::BGEZ : return Mips::COND_GEZ;
- case Mips::BLTZ : return Mips::COND_LZ;
- case Mips::BLEZ : return Mips::COND_LEZ;
- }
-}
-
-/// GetCondBranchFromCond - Return the Branch instruction
-/// opcode that matches the cc.
-unsigned Mips::GetCondBranchFromCond(Mips::CondCode CC)
-{
- switch (CC) {
- default: assert(0 && "Illegal condition code!");
- case Mips::COND_E : return Mips::BEQ;
- case Mips::COND_NE : return Mips::BNE;
- case Mips::COND_GZ : return Mips::BGTZ;
- case Mips::COND_GEZ : return Mips::BGEZ;
- case Mips::COND_LZ : return Mips::BLTZ;
- case Mips::COND_LEZ : return Mips::BLEZ;
- }
-}
-
-/// GetOppositeBranchCondition - Return the inverse of the specified
-/// condition, e.g. turning COND_E to COND_NE.
-Mips::CondCode Mips::GetOppositeBranchCondition(Mips::CondCode CC)
-{
- switch (CC) {
- default: assert(0 && "Illegal condition code!");
- case Mips::COND_E : return Mips::COND_NE;
- case Mips::COND_NE : return Mips::COND_E;
- case Mips::COND_GZ : return Mips::COND_LEZ;
- case Mips::COND_GEZ : return Mips::COND_LZ;
- case Mips::COND_LZ : return Mips::COND_GEZ;
- case Mips::COND_LEZ : return Mips::COND_GZ;
- }
-}
-
-bool MipsInstrInfo::AnalyzeBranch(MachineBasicBlock &MBB,
- MachineBasicBlock *&TBB,
- MachineBasicBlock *&FBB,
- std::vector<MachineOperand> &Cond) const
-{
- // If the block has no terminators, it just falls into the block after it.
- MachineBasicBlock::iterator I = MBB.end();
- if (I == MBB.begin() || !isUnpredicatedTerminator(--I))
- return false;
-
- // Get the last instruction in the block.
- MachineInstr *LastInst = I;
-
- // If there is only one terminator instruction, process it.
- unsigned LastOpc = LastInst->getOpcode();
- if (I == MBB.begin() || !isUnpredicatedTerminator(--I)) {
- if (!LastInst->getDesc().isBranch())
- return true;
-
- // Unconditional branch
- if (LastOpc == Mips::J) {
- TBB = LastInst->getOperand(0).getMBB();
- return false;
- }
-
- Mips::CondCode BranchCode = GetCondFromBranchOpc(LastInst->getOpcode());
- if (BranchCode == Mips::COND_INVALID)
- return true; // Can't handle indirect branch.
-
- // Conditional branch
- // Block ends with fall-through condbranch.
- if (LastOpc != Mips::COND_INVALID) {
- int LastNumOp = LastInst->getNumOperands();
-
- TBB = LastInst->getOperand(LastNumOp-1).getMBB();
- Cond.push_back(MachineOperand::CreateImm(BranchCode));
-
- for (int i=0; i<LastNumOp-1; i++) {
- Cond.push_back(LastInst->getOperand(i));
- }
-
- return false;
- }
- }
-
- // Get the instruction before it if it is a terminator.
- MachineInstr *SecondLastInst = I;
-
- // If there are three terminators, we don't know what sort of block this is.
- if (SecondLastInst && I != MBB.begin() && isUnpredicatedTerminator(--I))
- return true;
-
- // If the block ends with Mips::J and a Mips::BNE/Mips::BEQ, handle it.
- unsigned SecondLastOpc = SecondLastInst->getOpcode();
- Mips::CondCode BranchCode = GetCondFromBranchOpc(SecondLastOpc);
-
- if (SecondLastOpc != Mips::COND_INVALID && LastOpc == Mips::J) {
- int SecondNumOp = SecondLastInst->getNumOperands();
-
- TBB = SecondLastInst->getOperand(SecondNumOp-1).getMBB();
- Cond.push_back(MachineOperand::CreateImm(BranchCode));
-
- for (int i=0; i<SecondNumOp-1; i++) {
- Cond.push_back(SecondLastInst->getOperand(i));
- }
-
- FBB = LastInst->getOperand(0).getMBB();
- return false;
- }
-
- // If the block ends with two unconditional branches, handle it. The last
- // one is not executed, so remove it.
- if ((SecondLastOpc == Mips::J) && (LastOpc == Mips::J)) {
- TBB = SecondLastInst->getOperand(0).getMBB();
- I = LastInst;
- I->eraseFromParent();
- return false;
- }
-
- // Otherwise, can't handle this.
- return true;
-}
-
-unsigned MipsInstrInfo::
-InsertBranch(MachineBasicBlock &MBB, MachineBasicBlock *TBB,
- MachineBasicBlock *FBB, const std::vector<MachineOperand> &Cond)
- const
-{
- // Shouldn't be a fall through.
- assert(TBB && "InsertBranch must not be told to insert a fallthrough");
- assert((Cond.size() == 3 || Cond.size() == 2 || Cond.size() == 0) &&
- "Mips branch conditions can have two|three components!");
-
- if (FBB == 0) { // One way branch.
- if (Cond.empty()) {
- // Unconditional branch?
- BuildMI(&MBB, get(Mips::J)).addMBB(TBB);
- } else {
- // Conditional branch.
- unsigned Opc = GetCondBranchFromCond((Mips::CondCode)Cond[0].getImm());
- const TargetInstrDesc &TID = get(Opc);
-
- if (TID.getNumOperands() == 3)
- BuildMI(&MBB, TID).addReg(Cond[1].getReg())
- .addReg(Cond[2].getReg())
- .addMBB(TBB);
- else
- BuildMI(&MBB, TID).addReg(Cond[1].getReg())
- .addMBB(TBB);
-
- }
- return 1;
- }
-
- // Two-way Conditional branch.
- unsigned Opc = GetCondBranchFromCond((Mips::CondCode)Cond[0].getImm());
- const TargetInstrDesc &TID = get(Opc);
-
- if (TID.getNumOperands() == 3)
- BuildMI(&MBB, TID).addReg(Cond[1].getReg()).addReg(Cond[2].getReg())
- .addMBB(TBB);
- else
- BuildMI(&MBB, TID).addReg(Cond[1].getReg()).addMBB(TBB);
-
- BuildMI(&MBB, get(Mips::J)).addMBB(FBB);
- return 2;
-}
-
-void MipsInstrInfo::
-copyRegToReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator I,
- unsigned DestReg, unsigned SrcReg,
- const TargetRegisterClass *DestRC,
- const TargetRegisterClass *SrcRC) const {
- if (DestRC != SrcRC) {
- cerr << "Not yet supported!";
- abort();
- }
-
- if (DestRC == Mips::CPURegsRegisterClass)
- BuildMI(MBB, I, get(Mips::ADDu), DestReg).addReg(Mips::ZERO)
- .addReg(SrcReg);
- else
- assert (0 && "Can't copy this register");
-}
-
-void MipsInstrInfo::
-storeRegToStackSlot(MachineBasicBlock &MBB, MachineBasicBlock::iterator I,
- unsigned SrcReg, bool isKill, int FI,
- const TargetRegisterClass *RC) const
-{
- if (RC == Mips::CPURegsRegisterClass)
- BuildMI(MBB, I, get(Mips::SW)).addReg(SrcReg, false, false, isKill)
- .addImm(0).addFrameIndex(FI);
- else
- assert(0 && "Can't store this register to stack slot");
-}
-
-void MipsInstrInfo::storeRegToAddr(MachineFunction &MF, unsigned SrcReg,
- bool isKill,
- SmallVectorImpl<MachineOperand> &Addr,
- const TargetRegisterClass *RC,
- SmallVectorImpl<MachineInstr*> &NewMIs) const {
- if (RC != Mips::CPURegsRegisterClass)
- assert(0 && "Can't store this register");
- MachineInstrBuilder MIB = BuildMI(get(Mips::SW))
- .addReg(SrcReg, false, false, isKill);
- for (unsigned i = 0, e = Addr.size(); i != e; ++i) {
- MachineOperand &MO = Addr[i];
- if (MO.isRegister())
- MIB.addReg(MO.getReg());
- else if (MO.isImmediate())
- MIB.addImm(MO.getImm());
- else
- MIB.addFrameIndex(MO.getIndex());
- }
- NewMIs.push_back(MIB);
- return;
-}
-
-void MipsInstrInfo::
-loadRegFromStackSlot(MachineBasicBlock &MBB, MachineBasicBlock::iterator I,
- unsigned DestReg, int FI,
- const TargetRegisterClass *RC) const
-{
- if (RC == Mips::CPURegsRegisterClass)
- BuildMI(MBB, I, get(Mips::LW), DestReg).addImm(0).addFrameIndex(FI);
- else
- assert(0 && "Can't load this register from stack slot");
-}
-
-void MipsInstrInfo::loadRegFromAddr(MachineFunction &MF, unsigned DestReg,
- SmallVectorImpl<MachineOperand> &Addr,
- const TargetRegisterClass *RC,
- SmallVectorImpl<MachineInstr*> &NewMIs) const {
- if (RC != Mips::CPURegsRegisterClass)
- assert(0 && "Can't load this register");
- MachineInstrBuilder MIB = BuildMI(get(Mips::LW), DestReg);
- for (unsigned i = 0, e = Addr.size(); i != e; ++i) {
- MachineOperand &MO = Addr[i];
- if (MO.isRegister())
- MIB.addReg(MO.getReg());
- else if (MO.isImmediate())
- MIB.addImm(MO.getImm());
- else
- MIB.addFrameIndex(MO.getIndex());
- }
- NewMIs.push_back(MIB);
- return;
-}
-
-MachineInstr *MipsInstrInfo::
-foldMemoryOperand(MachineFunction &MF,
- MachineInstr* MI,
- SmallVectorImpl<unsigned> &Ops, int FI) const
-{
- if (Ops.size() != 1) return NULL;
-
- MachineInstr *NewMI = NULL;
-
- switch (MI->getOpcode())
- {
- case Mips::ADDu:
- if ((MI->getOperand(0).isRegister()) &&
- (MI->getOperand(1).isRegister()) &&
- (MI->getOperand(1).getReg() == Mips::ZERO) &&
- (MI->getOperand(2).isRegister()))
- {
- if (Ops[0] == 0) // COPY -> STORE
- NewMI = BuildMI(get(Mips::SW)).addFrameIndex(FI)
- .addImm(0).addReg(MI->getOperand(2).getReg());
- else // COPY -> LOAD
- NewMI = BuildMI(get(Mips::LW), MI->getOperand(0)
- .getReg()).addImm(0).addFrameIndex(FI);
- }
- break;
- }
-
- if (NewMI)
- NewMI->copyKillDeadInfo(MI);
- return NewMI;
-}
-
-unsigned MipsInstrInfo::
-RemoveBranch(MachineBasicBlock &MBB) const
-{
- MachineBasicBlock::iterator I = MBB.end();
- if (I == MBB.begin()) return 0;
- --I;
- if (I->getOpcode() != Mips::J &&
- GetCondFromBranchOpc(I->getOpcode()) == Mips::COND_INVALID)
- return 0;
-
- // Remove the branch.
- I->eraseFromParent();
-
- I = MBB.end();
-
- if (I == MBB.begin()) return 1;
- --I;
- if (GetCondFromBranchOpc(I->getOpcode()) == Mips::COND_INVALID)
- return 1;
-
- // Remove the branch.
- I->eraseFromParent();
- return 2;
-}
-
-/// BlockHasNoFallThrough - Analyse if MachineBasicBlock does not
-/// fall-through into its successor block.
-bool MipsInstrInfo::
-BlockHasNoFallThrough(MachineBasicBlock &MBB) const
-{
- if (MBB.empty()) return false;
-
- switch (MBB.back().getOpcode()) {
- case Mips::RET: // Return.
- case Mips::JR: // Indirect branch.
- case Mips::J: // Uncond branch.
- return true;
- default: return false;
- }
-}
-
-/// ReverseBranchCondition - Return the inverse opcode of the
-/// specified Branch instruction.
-bool MipsInstrInfo::
-ReverseBranchCondition(std::vector<MachineOperand> &Cond) const
-{
- assert( (Cond.size() == 3 || Cond.size() == 2) &&
- "Invalid Mips branch condition!");
- Cond[0].setImm(GetOppositeBranchCondition((Mips::CondCode)Cond[0].getImm()));
- return false;
-}
-
-
diff --git a/release_23/lib/Target/Mips/MipsInstrInfo.h b/release_23/lib/Target/Mips/MipsInstrInfo.h
deleted file mode 100644
index 9842414dbab8..000000000000
--- a/release_23/lib/Target/Mips/MipsInstrInfo.h
+++ /dev/null
@@ -1,131 +0,0 @@
-//===- MipsInstrInfo.h - Mips Instruction Information -----------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains the Mips implementation of the TargetInstrInfo class.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef MIPSINSTRUCTIONINFO_H
-#define MIPSINSTRUCTIONINFO_H
-
-#include "Mips.h"
-#include "llvm/Target/TargetInstrInfo.h"
-#include "MipsRegisterInfo.h"
-
-namespace llvm {
-
-namespace Mips {
-
- // Mips Condition Codes
- enum CondCode {
- COND_E,
- COND_GZ,
- COND_GEZ,
- COND_LZ,
- COND_LEZ,
- COND_NE,
- COND_INVALID
- };
-
- // Turn condition code into conditional branch opcode.
- unsigned GetCondBranchFromCond(CondCode CC);
-
- /// GetOppositeBranchCondition - Return the inverse of the specified cond,
- /// e.g. turning COND_E to COND_NE.
- CondCode GetOppositeBranchCondition(Mips::CondCode CC);
-
-}
-
-class MipsInstrInfo : public TargetInstrInfoImpl {
- MipsTargetMachine &TM;
- const MipsRegisterInfo RI;
-public:
- explicit MipsInstrInfo(MipsTargetMachine &TM);
-
- /// getRegisterInfo - TargetInstrInfo is a superset of MRegister info. As
- /// such, whenever a client has an instance of instruction info, it should
- /// always be able to get register info as well (through this method).
- ///
- virtual const TargetRegisterInfo &getRegisterInfo() const { return RI; }
-
- /// Return true if the instruction is a register to register move and
- /// leave the source and dest operands in the passed parameters.
- ///
- virtual bool isMoveInstr(const MachineInstr &MI,
- unsigned &SrcReg, unsigned &DstReg) const;
-
- /// isLoadFromStackSlot - If the specified machine instruction is a direct
- /// load from a stack slot, return the virtual or physical register number of
- /// the destination along with the FrameIndex of the loaded stack slot. If
- /// not, return 0. This predicate must return 0 if the instruction has
- /// any side effects other than loading from the stack slot.
- virtual unsigned isLoadFromStackSlot(MachineInstr *MI, int &FrameIndex) const;
-
- /// isStoreToStackSlot - If the specified machine instruction is a direct
- /// store to a stack slot, return the virtual or physical register number of
- /// the source reg along with the FrameIndex of the loaded stack slot. If
- /// not, return 0. This predicate must return 0 if the instruction has
- /// any side effects other than storing to the stack slot.
- virtual unsigned isStoreToStackSlot(MachineInstr *MI, int &FrameIndex) const;
-
- /// Branch Analysis
- virtual bool AnalyzeBranch(MachineBasicBlock &MBB, MachineBasicBlock *&TBB,
- MachineBasicBlock *&FBB,
- std::vector<MachineOperand> &Cond) const;
- virtual unsigned RemoveBranch(MachineBasicBlock &MBB) const;
- virtual unsigned InsertBranch(MachineBasicBlock &MBB, MachineBasicBlock *TBB,
- MachineBasicBlock *FBB,
- const std::vector<MachineOperand> &Cond) const;
- virtual void copyRegToReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator I,
- unsigned DestReg, unsigned SrcReg,
- const TargetRegisterClass *DestRC,
- const TargetRegisterClass *SrcRC) const;
- virtual void storeRegToStackSlot(MachineBasicBlock &MBB,
- MachineBasicBlock::iterator MBBI,
- unsigned SrcReg, bool isKill, int FrameIndex,
- const TargetRegisterClass *RC) const;
-
- virtual void storeRegToAddr(MachineFunction &MF, unsigned SrcReg, bool isKill,
- SmallVectorImpl<MachineOperand> &Addr,
- const TargetRegisterClass *RC,
- SmallVectorImpl<MachineInstr*> &NewMIs) const;
-
- virtual void loadRegFromStackSlot(MachineBasicBlock &MBB,
- MachineBasicBlock::iterator MBBI,
- unsigned DestReg, int FrameIndex,
- const TargetRegisterClass *RC) const;
-
- virtual void loadRegFromAddr(MachineFunction &MF, unsigned DestReg,
- SmallVectorImpl<MachineOperand> &Addr,
- const TargetRegisterClass *RC,
- SmallVectorImpl<MachineInstr*> &NewMIs) const;
-
- virtual MachineInstr* foldMemoryOperand(MachineFunction &MF,
- MachineInstr* MI,
- SmallVectorImpl<unsigned> &Ops,
- int FrameIndex) const;
-
- virtual MachineInstr* foldMemoryOperand(MachineFunction &MF,
- MachineInstr* MI,
- SmallVectorImpl<unsigned> &Ops,
- MachineInstr* LoadMI) const {
- return 0;
- }
-
- virtual bool BlockHasNoFallThrough(MachineBasicBlock &MBB) const;
- virtual bool ReverseBranchCondition(std::vector<MachineOperand> &Cond) const;
-
- /// Insert nop instruction when hazard condition is found
- virtual void insertNoop(MachineBasicBlock &MBB,
- MachineBasicBlock::iterator MI) const;
-};
-
-}
-
-#endif
diff --git a/release_23/lib/Target/Mips/MipsInstrInfo.td b/release_23/lib/Target/Mips/MipsInstrInfo.td
deleted file mode 100644
index 7dcd55ce6c65..000000000000
--- a/release_23/lib/Target/Mips/MipsInstrInfo.td
+++ /dev/null
@@ -1,612 +0,0 @@
-//===- MipsInstrInfo.td - Mips Register defs --------------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-//===----------------------------------------------------------------------===//
-// Instruction format superclass
-//===----------------------------------------------------------------------===//
-
-include "MipsInstrFormats.td"
-
-//===----------------------------------------------------------------------===//
-// Mips profiles and nodes
-//===----------------------------------------------------------------------===//
-
-// Call
-def SDT_MipsJmpLink : SDTypeProfile<0, 1, [SDTCisVT<0, iPTR>]>;
-def MipsJmpLink : SDNode<"MipsISD::JmpLink",SDT_MipsJmpLink, [SDNPHasChain,
- SDNPOutFlag]>;
-
-// Hi and Lo nodes are used to handle global addresses. Used on
-// MipsISelLowering to lower stuff like GlobalAddress, ExternalSymbol
-// static model. (nothing to do with Mips Registers Hi and Lo)
-def MipsHi : SDNode<"MipsISD::Hi", SDTIntUnaryOp, [SDNPOutFlag]>;
-def MipsLo : SDNode<"MipsISD::Lo", SDTIntUnaryOp>;
-
-// Return
-def SDT_MipsRet : SDTypeProfile<0, 1, [SDTCisInt<0>]>;
-def MipsRet : SDNode<"MipsISD::Ret", SDT_MipsRet, [SDNPHasChain,
- SDNPOptInFlag]>;
-
-// These are target-independent nodes, but have target-specific formats.
-def SDT_MipsCallSeqStart : SDCallSeqStart<[SDTCisVT<0, i32>]>;
-def SDT_MipsCallSeqEnd : SDCallSeqEnd<[SDTCisVT<0, i32>,
- SDTCisVT<1, i32>]>;
-
-def callseq_start : SDNode<"ISD::CALLSEQ_START", SDT_MipsCallSeqStart,
- [SDNPHasChain, SDNPOutFlag]>;
-def callseq_end : SDNode<"ISD::CALLSEQ_END", SDT_MipsCallSeqEnd,
- [SDNPHasChain, SDNPOptInFlag, SDNPOutFlag]>;
-
-//===----------------------------------------------------------------------===//
-// Mips Instruction Predicate Definitions.
-//===----------------------------------------------------------------------===//
-def IsStatic : Predicate<"TM.getRelocationModel() == Reloc::Static">;
-
-//===----------------------------------------------------------------------===//
-// Mips Operand, Complex Patterns and Transformations Definitions.
-//===----------------------------------------------------------------------===//
-
-// Instruction operand types
-def brtarget : Operand<OtherVT>;
-def calltarget : Operand<i32>;
-def uimm16 : Operand<i32>;
-def simm16 : Operand<i32>;
-def shamt : Operand<i32>;
-def addrlabel : Operand<i32>;
-
-// Address operand
-def mem : Operand<i32> {
- let PrintMethod = "printMemOperand";
- let MIOperandInfo = (ops simm16, CPURegs);
-}
-
-// Transformation Function - get the lower 16 bits.
-def LO16 : SDNodeXForm<imm, [{
- return getI32Imm((unsigned)N->getValue() & 0xFFFF);
-}]>;
-
-// Transformation Function - get the higher 16 bits.
-def HI16 : SDNodeXForm<imm, [{
- return getI32Imm((unsigned)N->getValue() >> 16);
-}]>;
-
-// Node immediate fits as 16-bit sign extended on target immediate.
-// e.g. addi, andi
-def immSExt16 : PatLeaf<(imm), [{
- if (N->getValueType(0) == MVT::i32)
- return (int32_t)N->getValue() == (short)N->getValue();
- else
- return (int64_t)N->getValue() == (short)N->getValue();
-}]>;
-
-// Node immediate fits as 16-bit zero extended on target immediate.
-// The LO16 param means that only the lower 16 bits of the node
-// immediate are caught.
-// e.g. addiu, sltiu
-def immZExt16 : PatLeaf<(imm), [{
- if (N->getValueType(0) == MVT::i32)
- return (uint32_t)N->getValue() == (unsigned short)N->getValue();
- else
- return (uint64_t)N->getValue() == (unsigned short)N->getValue();
-}], LO16>;
-
-// Node immediate fits as 32-bit zero extended on target immediate.
-//def immZExt32 : PatLeaf<(imm), [{
-// return (uint64_t)N->getValue() == (uint32_t)N->getValue();
-//}], LO16>;
-
-// shamt field must fit in 5 bits.
-def immZExt5 : PatLeaf<(imm), [{
- return N->getValue() == ((N->getValue()) & 0x1f) ;
-}]>;
-
-// Mips Address Mode! SDNode frameindex could possibily be a match
-// since load and store instructions from stack used it.
-def addr : ComplexPattern<i32, 2, "SelectAddr", [frameindex], []>;
-
-//===----------------------------------------------------------------------===//
-// Instructions specific format
-//===----------------------------------------------------------------------===//
-
-// Arithmetic 3 register operands
-let isCommutable = 1 in
-class ArithR<bits<6> op, bits<6> func, string instr_asm, SDNode OpNode,
- InstrItinClass itin>:
- FR< op,
- func,
- (outs CPURegs:$dst),
- (ins CPURegs:$b, CPURegs:$c),
- !strconcat(instr_asm, " $dst, $b, $c"),
- [(set CPURegs:$dst, (OpNode CPURegs:$b, CPURegs:$c))], itin>;
-
-let isCommutable = 1 in
-class ArithOverflowR<bits<6> op, bits<6> func, string instr_asm>:
- FR< op,
- func,
- (outs CPURegs:$dst),
- (ins CPURegs:$b, CPURegs:$c),
- !strconcat(instr_asm, " $dst, $b, $c"),
- [], IIAlu>;
-
-// Arithmetic 2 register operands
-let isCommutable = 1 in
-class ArithI<bits<6> op, string instr_asm, SDNode OpNode,
- Operand Od, PatLeaf imm_type> :
- FI< op,
- (outs CPURegs:$dst),
- (ins CPURegs:$b, Od:$c),
- !strconcat(instr_asm, " $dst, $b, $c"),
- [(set CPURegs:$dst, (OpNode CPURegs:$b, imm_type:$c))], IIAlu>;
-
-// Arithmetic Multiply ADD/SUB
-let rd=0 in
-class MArithR<bits<6> func, string instr_asm> :
- FR< 0x1c,
- func,
- (outs CPURegs:$rs),
- (ins CPURegs:$rt),
- !strconcat(instr_asm, " $rs, $rt"),
- [], IIImul>;
-
-// Logical
-class LogicR<bits<6> func, string instr_asm, SDNode OpNode>:
- FR< 0x00,
- func,
- (outs CPURegs:$dst),
- (ins CPURegs:$b, CPURegs:$c),
- !strconcat(instr_asm, " $dst, $b, $c"),
- [(set CPURegs:$dst, (OpNode CPURegs:$b, CPURegs:$c))], IIAlu>;
-
-class LogicI<bits<6> op, string instr_asm, SDNode OpNode>:
- FI< op,
- (outs CPURegs:$dst),
- (ins CPURegs:$b, uimm16:$c),
- !strconcat(instr_asm, " $dst, $b, $c"),
- [(set CPURegs:$dst, (OpNode CPURegs:$b, immSExt16:$c))], IIAlu>;
-
-class LogicNOR<bits<6> op, bits<6> func, string instr_asm>:
- FR< op,
- func,
- (outs CPURegs:$dst),
- (ins CPURegs:$b, CPURegs:$c),
- !strconcat(instr_asm, " $dst, $b, $c"),
- [(set CPURegs:$dst, (not (or CPURegs:$b, CPURegs:$c)))], IIAlu>;
-
-// Shifts
-let rt = 0 in
-class LogicR_shift_imm<bits<6> func, string instr_asm, SDNode OpNode>:
- FR< 0x00,
- func,
- (outs CPURegs:$dst),
- (ins CPURegs:$b, shamt:$c),
- !strconcat(instr_asm, " $dst, $b, $c"),
- [(set CPURegs:$dst, (OpNode CPURegs:$b, immZExt5:$c))], IIAlu>;
-
-class LogicR_shift_reg<bits<6> func, string instr_asm, SDNode OpNode>:
- FR< 0x00,
- func,
- (outs CPURegs:$dst),
- (ins CPURegs:$b, CPURegs:$c),
- !strconcat(instr_asm, " $dst, $b, $c"),
- [(set CPURegs:$dst, (OpNode CPURegs:$b, CPURegs:$c))], IIAlu>;
-
-// Load Upper Imediate
-class LoadUpper<bits<6> op, string instr_asm>:
- FI< op,
- (outs CPURegs:$dst),
- (ins uimm16:$imm),
- !strconcat(instr_asm, " $dst, $imm"),
- [], IIAlu>;
-
-// Memory Load/Store
-let isSimpleLoad = 1, hasDelaySlot = 1 in
-class LoadM<bits<6> op, string instr_asm, PatFrag OpNode>:
- FI< op,
- (outs CPURegs:$dst),
- (ins mem:$addr),
- !strconcat(instr_asm, " $dst, $addr"),
- [(set CPURegs:$dst, (OpNode addr:$addr))], IILoad>;
-
-class StoreM<bits<6> op, string instr_asm, PatFrag OpNode>:
- FI< op,
- (outs),
- (ins CPURegs:$dst, mem:$addr),
- !strconcat(instr_asm, " $dst, $addr"),
- [(OpNode CPURegs:$dst, addr:$addr)], IIStore>;
-
-// Conditional Branch
-let isBranch = 1, isTerminator=1, hasDelaySlot = 1 in {
-class CBranch<bits<6> op, string instr_asm, PatFrag cond_op>:
- FI< op,
- (outs),
- (ins CPURegs:$a, CPURegs:$b, brtarget:$offset),
- !strconcat(instr_asm, " $a, $b, $offset"),
- [(brcond (cond_op CPURegs:$a, CPURegs:$b), bb:$offset)],
- IIBranch>;
-
-
-class CBranchZero<bits<6> op, string instr_asm, PatFrag cond_op>:
- FI< op,
- (outs),
- (ins CPURegs:$src, brtarget:$offset),
- !strconcat(instr_asm, " $src, $offset"),
- [(brcond (cond_op CPURegs:$src, 0), bb:$offset)],
- IIBranch>;
-}
-
-// SetCC
-class SetCC_R<bits<6> op, bits<6> func, string instr_asm,
- PatFrag cond_op>:
- FR< op,
- func,
- (outs CPURegs:$dst),
- (ins CPURegs:$b, CPURegs:$c),
- !strconcat(instr_asm, " $dst, $b, $c"),
- [(set CPURegs:$dst, (cond_op CPURegs:$b, CPURegs:$c))],
- IIAlu>;
-
-class SetCC_I<bits<6> op, string instr_asm, PatFrag cond_op,
- Operand Od, PatLeaf imm_type>:
- FI< op,
- (outs CPURegs:$dst),
- (ins CPURegs:$b, Od:$c),
- !strconcat(instr_asm, " $dst, $b, $c"),
- [(set CPURegs:$dst, (cond_op CPURegs:$b, imm_type:$c))],
- IIAlu>;
-
-// Unconditional branch
-let isBranch=1, isTerminator=1, isBarrier=1, hasDelaySlot = 1 in
-class JumpFJ<bits<6> op, string instr_asm>:
- FJ< op,
- (outs),
- (ins brtarget:$target),
- !strconcat(instr_asm, " $target"),
- [(br bb:$target)], IIBranch>;
-
-let isBranch=1, isTerminator=1, isBarrier=1, rd=0, hasDelaySlot = 1 in
-class JumpFR<bits<6> op, bits<6> func, string instr_asm>:
- FR< op,
- func,
- (outs),
- (ins CPURegs:$target),
- !strconcat(instr_asm, " $target"),
- [(brind CPURegs:$target)], IIBranch>;
-
-// Jump and Link (Call)
-let isCall=1, hasDelaySlot=1,
- // All calls clobber the non-callee saved registers...
- Defs = [AT, V0, V1, A0, A1, A2, A3, T0, T1, T2,
- T3, T4, T5, T6, T7, T8, T9, K0, K1], Uses = [GP] in {
- class JumpLink<bits<6> op, string instr_asm>:
- FJ< op,
- (outs),
- (ins calltarget:$target),
- !strconcat(instr_asm, " $target"),
- [(MipsJmpLink imm:$target)], IIBranch>;
-
- let rd=31 in
- class JumpLinkReg<bits<6> op, bits<6> func, string instr_asm>:
- FR< op,
- func,
- (outs),
- (ins CPURegs:$rs),
- !strconcat(instr_asm, " $rs"),
- [(MipsJmpLink CPURegs:$rs)], IIBranch>;
-
- class BranchLink<string instr_asm>:
- FI< 0x1,
- (outs),
- (ins CPURegs:$rs, brtarget:$target),
- !strconcat(instr_asm, " $rs, $target"),
- [], IIBranch>;
-}
-
-// Mul, Div
-class MulDiv<bits<6> func, string instr_asm, InstrItinClass itin>:
- FR< 0x00,
- func,
- (outs),
- (ins CPURegs:$a, CPURegs:$b),
- !strconcat(instr_asm, " $a, $b"),
- [], itin>;
-
-// Move from Hi/Lo
-class MoveFromTo<bits<6> func, string instr_asm>:
- FR< 0x00,
- func,
- (outs CPURegs:$dst),
- (ins),
- !strconcat(instr_asm, " $dst"),
- [], IIHiLo>;
-
-// Count Leading Ones/Zeros in Word
-class CountLeading<bits<6> func, string instr_asm>:
- FR< 0x1c,
- func,
- (outs CPURegs:$dst),
- (ins CPURegs:$src),
- !strconcat(instr_asm, " $dst, $src"),
- [], IIAlu>;
-
-class EffectiveAddress<string instr_asm> :
- FI<0x09,
- (outs CPURegs:$dst),
- (ins mem:$addr),
- instr_asm,
- [(set CPURegs:$dst, addr:$addr)], IIAlu>;
-
-//===----------------------------------------------------------------------===//
-// Pseudo instructions
-//===----------------------------------------------------------------------===//
-
-// As stack alignment is always done with addiu, we need a 16-bit immediate
-let Defs = [SP], Uses = [SP] in {
-def ADJCALLSTACKDOWN : PseudoInstMips<(outs), (ins uimm16:$amt),
- "!ADJCALLSTACKDOWN $amt",
- [(callseq_start imm:$amt)]>;
-def ADJCALLSTACKUP : PseudoInstMips<(outs), (ins uimm16:$amt1, uimm16:$amt2),
- "!ADJCALLSTACKUP $amt1",
- [(callseq_end imm:$amt1, imm:$amt2)]>;
-}
-
-// When handling PIC code the assembler needs .cpload and .cprestore
-// directives. If the real instructions corresponding these directives
-// are used, we have the same behavior, but get also a bunch of warnings
-// from the assembler.
-def CPLOAD: PseudoInstMips<(outs), (ins CPURegs:$reg),
- ".set noreorder\n\t.cpload $reg\n\t.set reorder\n", []>;
-def CPRESTORE: PseudoInstMips<(outs), (ins uimm16:$loc),
- ".cprestore $loc\n", []>;
-
-//===----------------------------------------------------------------------===//
-// Instruction definition
-//===----------------------------------------------------------------------===//
-
-//===----------------------------------------------------------------------===//
-// MipsI Instructions
-//===----------------------------------------------------------------------===//
-
-// Arithmetic
-
-// ADDiu just accept 16-bit immediates but we handle this on Pat's.
-// immZExt32 is used here so it can match GlobalAddress immediates.
-def ADDiu : ArithI<0x09, "addiu", add, uimm16, immZExt16>;
-def ADDi : ArithI<0x08, "addi", add, simm16, immSExt16>;
-def MUL : ArithR<0x1c, 0x02, "mul", mul, IIImul>;
-def ADDu : ArithR<0x00, 0x21, "addu", add, IIAlu>;
-def SUBu : ArithR<0x00, 0x23, "subu", sub, IIAlu>;
-def ADD : ArithOverflowR<0x00, 0x20, "add">;
-def SUB : ArithOverflowR<0x00, 0x22, "sub">;
-
-// Logical
-def AND : LogicR<0x24, "and", and>;
-def OR : LogicR<0x25, "or", or>;
-def XOR : LogicR<0x26, "xor", xor>;
-def ANDi : LogicI<0x0c, "andi", and>;
-def ORi : LogicI<0x0d, "ori", or>;
-def XORi : LogicI<0x0e, "xori", xor>;
-def NOR : LogicNOR<0x00, 0x27, "nor">;
-
-// Shifts
-def SLL : LogicR_shift_imm<0x00, "sll", shl>;
-def SRL : LogicR_shift_imm<0x02, "srl", srl>;
-def SRA : LogicR_shift_imm<0x03, "sra", sra>;
-def SLLV : LogicR_shift_reg<0x04, "sllv", shl>;
-def SRLV : LogicR_shift_reg<0x06, "srlv", srl>;
-def SRAV : LogicR_shift_reg<0x07, "srav", sra>;
-
-// Load Upper Immediate
-def LUi : LoadUpper<0x0f, "lui">;
-
-// Load/Store
-def LB : LoadM<0x20, "lb", sextloadi8>;
-def LBu : LoadM<0x24, "lbu", zextloadi8>;
-def LH : LoadM<0x21, "lh", sextloadi16>;
-def LHu : LoadM<0x25, "lhu", zextloadi16>;
-def LW : LoadM<0x23, "lw", load>;
-def SB : StoreM<0x28, "sb", truncstorei8>;
-def SH : StoreM<0x29, "sh", truncstorei16>;
-def SW : StoreM<0x2b, "sw", store>;
-
-// Conditional Branch
-def BEQ : CBranch<0x04, "beq", seteq>;
-def BNE : CBranch<0x05, "bne", setne>;
-
-let rt=1 in
-def BGEZ : CBranchZero<0x01, "bgez", setge>;
-
-let rt=0 in {
-def BGTZ : CBranchZero<0x07, "bgtz", setgt>;
-def BLEZ : CBranchZero<0x07, "blez", setle>;
-def BLTZ : CBranchZero<0x01, "bltz", setlt>;
-}
-
-// Set Condition Code
-def SLT : SetCC_R<0x00, 0x2a, "slt", setlt>;
-def SLTu : SetCC_R<0x00, 0x2b, "sltu", setult>;
-def SLTi : SetCC_I<0x0a, "slti", setlt, simm16, immSExt16>;
-def SLTiu : SetCC_I<0x0b, "sltiu", setult, uimm16, immZExt16>;
-
-// Unconditional jump
-def J : JumpFJ<0x02, "j">;
-def JR : JumpFR<0x00, 0x08, "jr">;
-
-// Jump and Link (Call)
-def JAL : JumpLink<0x03, "jal">;
-def JALR : JumpLinkReg<0x00, 0x09, "jalr">;
-def BGEZAL : BranchLink<"bgezal">;
-def BLTZAL : BranchLink<"bltzal">;
-
-// MulDiv and Move From Hi/Lo operations, have
-// their correpondent SDNodes created on ISelDAG.
-// Special Mul, Div operations
-def MULT : MulDiv<0x18, "mult", IIImul>;
-def MULTu : MulDiv<0x19, "multu", IIImul>;
-def DIV : MulDiv<0x1a, "div", IIIdiv>;
-def DIVu : MulDiv<0x1b, "divu", IIIdiv>;
-
-// Move From Hi/Lo
-def MFHI : MoveFromTo<0x10, "mfhi">;
-def MFLO : MoveFromTo<0x12, "mflo">;
-def MTHI : MoveFromTo<0x11, "mthi">;
-def MTLO : MoveFromTo<0x13, "mtlo">;
-
-// Count Leading
-// CLO/CLZ are part of the newer MIPS32(tm) instruction
-// set and not older Mips I keep this for future use
-// though.
-//def CLO : CountLeading<0x21, "clo">;
-//def CLZ : CountLeading<0x20, "clz">;
-
-// MADD*/MSUB* are not part of MipsI either.
-//def MADD : MArithR<0x00, "madd">;
-//def MADDU : MArithR<0x01, "maddu">;
-//def MSUB : MArithR<0x04, "msub">;
-//def MSUBU : MArithR<0x05, "msubu">;
-
-// No operation
-let addr=0 in
-def NOP : FJ<0, (outs), (ins), "nop", [], IIAlu>;
-
-// Ret instruction - as mips does not have "ret" a
-// jr $ra must be generated.
-let isReturn=1, isTerminator=1, hasDelaySlot=1,
- isBarrier=1, hasCtrlDep=1, rs=0, rt=0, shamt=0 in
-{
- def RET : FR <0x00, 0x02, (outs), (ins CPURegs:$target),
- "jr $target", [(MipsRet CPURegs:$target)], IIBranch>;
-}
-
-// FrameIndexes are legalized when they are operands from load/store
-// instructions. The same not happens for stack address copies, so an
-// add op with mem ComplexPattern is used and the stack address copy
-// can be matched. It's similar to Sparc LEA_ADDRi
-def LEA_ADDiu : EffectiveAddress<"addiu $dst, ${addr:stackloc}">;
-
-//===----------------------------------------------------------------------===//
-// Arbitrary patterns that map to one or more instructions
-//===----------------------------------------------------------------------===//
-
-// Small immediates
-def : Pat<(i32 immSExt16:$in),
- (ADDiu ZERO, imm:$in)>;
-def : Pat<(i32 immZExt16:$in),
- (ORi ZERO, imm:$in)>;
-
-// Arbitrary immediates
-def : Pat<(i32 imm:$imm),
- (ORi (LUi (HI16 imm:$imm)), (LO16 imm:$imm))>;
-
-// Call
-def : Pat<(MipsJmpLink (i32 tglobaladdr:$dst)),
- (JAL tglobaladdr:$dst)>;
-def : Pat<(MipsJmpLink (i32 texternalsym:$dst)),
- (JAL texternalsym:$dst)>;
-def : Pat<(MipsJmpLink CPURegs:$dst),
- (JALR CPURegs:$dst)>;
-
-// GlobalAddress, Constant Pool, ExternalSymbol, and JumpTable
-def : Pat<(MipsHi tglobaladdr:$in), (LUi tglobaladdr:$in)>;
-def : Pat<(MipsLo tglobaladdr:$in), (ADDiu ZERO, tglobaladdr:$in)>;
-def : Pat<(add CPURegs:$hi, (MipsLo tglobaladdr:$lo)),
- (ADDiu CPURegs:$hi, tglobaladdr:$lo)>;
-def : Pat<(MipsHi tjumptable:$in), (LUi tjumptable:$in)>;
-def : Pat<(MipsLo tjumptable:$in), (ADDiu ZERO, tjumptable:$in)>;
-def : Pat<(add CPURegs:$hi, (MipsLo tjumptable:$lo)),
- (ADDiu CPURegs:$hi, tjumptable:$lo)>;
-
-// Mips does not have not, so we increase the operation
-def : Pat<(not CPURegs:$in),
- (NOR CPURegs:$in, ZERO)>;
-
-// extended load and stores
-def : Pat<(i32 (extloadi1 addr:$src)), (LBu addr:$src)>;
-def : Pat<(i32 (extloadi8 addr:$src)), (LBu addr:$src)>;
-def : Pat<(i32 (extloadi16 addr:$src)), (LHu addr:$src)>;
-
-// some peepholes
-def : Pat<(store (i32 0), addr:$dst), (SW ZERO, addr:$dst)>;
-
-///
-/// brcond patterns
-///
-
-// direct match equal/notequal zero branches
-def : Pat<(brcond (setne CPURegs:$lhs, 0), bb:$dst),
- (BNE CPURegs:$lhs, ZERO, bb:$dst)>;
-def : Pat<(brcond (seteq CPURegs:$lhs, 0), bb:$dst),
- (BEQ CPURegs:$lhs, ZERO, bb:$dst)>;
-
-def : Pat<(brcond (setge CPURegs:$lhs, CPURegs:$rhs), bb:$dst),
- (BGEZ (SUB CPURegs:$lhs, CPURegs:$rhs), bb:$dst)>;
-def : Pat<(brcond (setuge CPURegs:$lhs, CPURegs:$rhs), bb:$dst),
- (BGEZ (SUBu CPURegs:$lhs, CPURegs:$rhs), bb:$dst)>;
-
-def : Pat<(brcond (setgt CPURegs:$lhs, CPURegs:$rhs), bb:$dst),
- (BGTZ (SUB CPURegs:$lhs, CPURegs:$rhs), bb:$dst)>;
-def : Pat<(brcond (setugt CPURegs:$lhs, CPURegs:$rhs), bb:$dst),
- (BGTZ (SUBu CPURegs:$lhs, CPURegs:$rhs), bb:$dst)>;
-
-def : Pat<(brcond (setle CPURegs:$lhs, CPURegs:$rhs), bb:$dst),
- (BLEZ (SUB CPURegs:$lhs, CPURegs:$rhs), bb:$dst)>;
-def : Pat<(brcond (setule CPURegs:$lhs, CPURegs:$rhs), bb:$dst),
- (BLEZ (SUBu CPURegs:$lhs, CPURegs:$rhs), bb:$dst)>;
-
-def : Pat<(brcond (setlt CPURegs:$lhs, immSExt16:$rhs), bb:$dst),
- (BNE (SLTi CPURegs:$lhs, immSExt16:$rhs), ZERO, bb:$dst)>;
-def : Pat<(brcond (setult CPURegs:$lhs, immZExt16:$rhs), bb:$dst),
- (BNE (SLTiu CPURegs:$lhs, immZExt16:$rhs), ZERO, bb:$dst)>;
-def : Pat<(brcond (setlt CPURegs:$lhs, CPURegs:$rhs), bb:$dst),
- (BNE (SLT CPURegs:$lhs, CPURegs:$rhs), ZERO, bb:$dst)>;
-def : Pat<(brcond (setult CPURegs:$lhs, CPURegs:$rhs), bb:$dst),
- (BNE (SLTu CPURegs:$lhs, CPURegs:$rhs), ZERO, bb:$dst)>;
-
-def : Pat<(brcond (setlt CPURegs:$lhs, CPURegs:$rhs), bb:$dst),
- (BLTZ (SUB CPURegs:$lhs, CPURegs:$rhs), bb:$dst)>;
-def : Pat<(brcond (setult CPURegs:$lhs, CPURegs:$rhs), bb:$dst),
- (BLTZ (SUBu CPURegs:$lhs, CPURegs:$rhs), bb:$dst)>;
-
-// generic brcond pattern
-def : Pat<(brcond CPURegs:$cond, bb:$dst),
- (BNE CPURegs:$cond, ZERO, bb:$dst)>;
-
-///
-/// setcc patterns, only matched when there
-/// is no brcond following a setcc operation
-///
-
-// setcc 2 register operands
-def : Pat<(setle CPURegs:$lhs, CPURegs:$rhs),
- (XORi (SLT CPURegs:$rhs, CPURegs:$lhs), 1)>;
-def : Pat<(setule CPURegs:$lhs, CPURegs:$rhs),
- (XORi (SLTu CPURegs:$rhs, CPURegs:$lhs), 1)>;
-
-def : Pat<(setgt CPURegs:$lhs, CPURegs:$rhs),
- (SLT CPURegs:$rhs, CPURegs:$lhs)>;
-def : Pat<(setugt CPURegs:$lhs, CPURegs:$rhs),
- (SLTu CPURegs:$rhs, CPURegs:$lhs)>;
-
-def : Pat<(setge CPURegs:$lhs, CPURegs:$rhs),
- (XORi (SLT CPURegs:$lhs, CPURegs:$rhs), 1)>;
-def : Pat<(setuge CPURegs:$lhs, CPURegs:$rhs),
- (XORi (SLTu CPURegs:$lhs, CPURegs:$rhs), 1)>;
-
-def : Pat<(setne CPURegs:$lhs, CPURegs:$rhs),
- (OR (SLT CPURegs:$lhs, CPURegs:$rhs),
- (SLT CPURegs:$rhs, CPURegs:$lhs))>;
-
-def : Pat<(seteq CPURegs:$lhs, CPURegs:$rhs),
- (XORi (OR (SLT CPURegs:$lhs, CPURegs:$rhs),
- (SLT CPURegs:$rhs, CPURegs:$lhs)), 1)>;
-
-// setcc reg/imm operands
-def : Pat<(setge CPURegs:$lhs, immSExt16:$rhs),
- (XORi (SLTi CPURegs:$lhs, immSExt16:$rhs), 1)>;
-def : Pat<(setuge CPURegs:$lhs, immZExt16:$rhs),
- (XORi (SLTiu CPURegs:$lhs, immZExt16:$rhs), 1)>;
diff --git a/release_23/lib/Target/Mips/MipsMachineFunction.h b/release_23/lib/Target/Mips/MipsMachineFunction.h
deleted file mode 100644
index e0ecdd91b94d..000000000000
--- a/release_23/lib/Target/Mips/MipsMachineFunction.h
+++ /dev/null
@@ -1,116 +0,0 @@
-//===-- MipsMachineFunctionInfo.h - Private data used for Mips ----*- C++ -*-=//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file declares the Mips specific subclass of MachineFunctionInfo.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef MIPS_MACHINE_FUNCTION_INFO_H
-#define MIPS_MACHINE_FUNCTION_INFO_H
-
-#include "llvm/ADT/VectorExtras.h"
-#include "llvm/CodeGen/MachineFunction.h"
-#include "llvm/CodeGen/MachineFrameInfo.h"
-
-namespace llvm {
-
-/// MipsFunctionInfo - This class is derived from MachineFunction private
-/// Mips target-specific information for each MachineFunction.
-class MipsFunctionInfo : public MachineFunctionInfo {
-
-private:
- /// Holds for each function where on the stack
- /// the Frame Pointer must be saved
- int FPStackOffset;
-
- /// Holds for each function where on the stack
- /// the Return Address must be saved
- int RAStackOffset;
-
- /// MipsFIHolder - Holds a FrameIndex and it's Stack Pointer Offset
- struct MipsFIHolder {
-
- int FI;
- int SPOffset;
-
- MipsFIHolder(int FrameIndex, int StackPointerOffset)
- : FI(FrameIndex), SPOffset(StackPointerOffset) {}
- };
-
- /// When PIC is used the GP must be saved on the stack
- /// on the function prologue and must be reloaded from this
- /// stack location after every call. A reference to its stack
- /// location and frame index must be kept to be used on
- /// emitPrologue and processFunctionBeforeFrameFinalized.
- MipsFIHolder GPHolder;
-
- // On LowerFORMAL_ARGUMENTS the stack size is unknown,
- // so the Stack Pointer Offset calculation of "not in
- // register arguments" must be postponed to emitPrologue.
- SmallVector<MipsFIHolder, 16> FnLoadArgs;
- bool HasLoadArgs;
-
- // When VarArgs, we must write registers back to caller
- // stack, preserving on register arguments. Since the
- // stack size is unknown on LowerFORMAL_ARGUMENTS,
- // the Stack Pointer Offset calculation must be
- // postponed to emitPrologue.
- SmallVector<MipsFIHolder, 4> FnStoreVarArgs;
- bool HasStoreVarArgs;
-
-public:
- MipsFunctionInfo(MachineFunction& MF)
- : FPStackOffset(0), RAStackOffset(0), GPHolder(-1,-1),
- HasLoadArgs(false), HasStoreVarArgs(false)
- {}
-
- int getFPStackOffset() const { return FPStackOffset; }
- void setFPStackOffset(int Off) { FPStackOffset = Off; }
-
- int getRAStackOffset() const { return RAStackOffset; }
- void setRAStackOffset(int Off) { RAStackOffset = Off; }
-
- int getGPStackOffset() const { return GPHolder.SPOffset; }
- int getGPFI() const { return GPHolder.FI; }
- void setGPStackOffset(int Off) { GPHolder.SPOffset = Off; }
- void setGPFI(int FI) { GPHolder.FI = FI; }
-
- int getTopSavedRegOffset() const {
- return (RAStackOffset > FPStackOffset) ?
- (RAStackOffset) : (FPStackOffset);
- }
-
- bool hasLoadArgs() const { return HasLoadArgs; }
- bool hasStoreVarArgs() const { return HasStoreVarArgs; }
-
- void recordLoadArgsFI(int FI, int SPOffset) {
- if (!HasLoadArgs) HasLoadArgs=true;
- FnLoadArgs.push_back(MipsFIHolder(FI, SPOffset));
- }
- void recordStoreVarArgsFI(int FI, int SPOffset) {
- if (!HasStoreVarArgs) HasStoreVarArgs=true;
- FnStoreVarArgs.push_back(MipsFIHolder(FI, SPOffset));
- }
-
- void adjustLoadArgsFI(MachineFrameInfo *MFI) const {
- if (!hasLoadArgs()) return;
- for (unsigned i = 0, e = FnLoadArgs.size(); i != e; ++i)
- MFI->setObjectOffset( FnLoadArgs[i].FI, FnLoadArgs[i].SPOffset );
- }
- void adjustStoreVarArgsFI(MachineFrameInfo *MFI) const {
- if (!hasStoreVarArgs()) return;
- for (unsigned i = 0, e = FnStoreVarArgs.size(); i != e; ++i)
- MFI->setObjectOffset( FnStoreVarArgs[i].FI, FnStoreVarArgs[i].SPOffset );
- }
-
-};
-
-} // end of namespace llvm
-
-#endif // MIPS_MACHINE_FUNCTION_INFO_H
diff --git a/release_23/lib/Target/Mips/MipsRegisterInfo.cpp b/release_23/lib/Target/Mips/MipsRegisterInfo.cpp
deleted file mode 100644
index 8d53eada528c..000000000000
--- a/release_23/lib/Target/Mips/MipsRegisterInfo.cpp
+++ /dev/null
@@ -1,426 +0,0 @@
-//===- MipsRegisterInfo.cpp - MIPS Register Information -== -----*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains the MIPS implementation of the TargetRegisterInfo class.
-//
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "mips-reg-info"
-
-#include "Mips.h"
-#include "MipsRegisterInfo.h"
-#include "MipsMachineFunction.h"
-#include "llvm/Constants.h"
-#include "llvm/Type.h"
-#include "llvm/Function.h"
-#include "llvm/CodeGen/ValueTypes.h"
-#include "llvm/CodeGen/MachineInstrBuilder.h"
-#include "llvm/CodeGen/MachineFunction.h"
-#include "llvm/CodeGen/MachineFrameInfo.h"
-#include "llvm/CodeGen/MachineLocation.h"
-#include "llvm/Target/TargetFrameInfo.h"
-#include "llvm/Target/TargetMachine.h"
-#include "llvm/Target/TargetOptions.h"
-#include "llvm/Target/TargetInstrInfo.h"
-#include "llvm/Support/CommandLine.h"
-#include "llvm/Support/Debug.h"
-#include "llvm/ADT/BitVector.h"
-#include "llvm/ADT/STLExtras.h"
-//#include "MipsSubtarget.h"
-
-using namespace llvm;
-
-// TODO: add subtarget support
-MipsRegisterInfo::MipsRegisterInfo(const TargetInstrInfo &tii)
- : MipsGenRegisterInfo(Mips::ADJCALLSTACKDOWN, Mips::ADJCALLSTACKUP),
- TII(tii) {}
-
-/// getRegisterNumbering - Given the enum value for some register, e.g.
-/// Mips::RA, return the number that it corresponds to (e.g. 31).
-unsigned MipsRegisterInfo::
-getRegisterNumbering(unsigned RegEnum)
-{
- switch (RegEnum) {
- case Mips::ZERO : return 0;
- case Mips::AT : return 1;
- case Mips::V0 : return 2;
- case Mips::V1 : return 3;
- case Mips::A0 : return 4;
- case Mips::A1 : return 5;
- case Mips::A2 : return 6;
- case Mips::A3 : return 7;
- case Mips::T0 : return 8;
- case Mips::T1 : return 9;
- case Mips::T2 : return 10;
- case Mips::T3 : return 11;
- case Mips::T4 : return 12;
- case Mips::T5 : return 13;
- case Mips::T6 : return 14;
- case Mips::T7 : return 15;
- case Mips::T8 : return 16;
- case Mips::T9 : return 17;
- case Mips::S0 : return 18;
- case Mips::S1 : return 19;
- case Mips::S2 : return 20;
- case Mips::S3 : return 21;
- case Mips::S4 : return 22;
- case Mips::S5 : return 23;
- case Mips::S6 : return 24;
- case Mips::S7 : return 25;
- case Mips::K0 : return 26;
- case Mips::K1 : return 27;
- case Mips::GP : return 28;
- case Mips::SP : return 29;
- case Mips::FP : return 30;
- case Mips::RA : return 31;
- default: assert(0 && "Unknown register number!");
- }
- return 0; // Not reached
-}
-
-//===----------------------------------------------------------------------===//
-//
-// Callee Saved Registers methods
-//
-//===----------------------------------------------------------------------===//
-
-/// Mips Callee Saved Registers
-const unsigned* MipsRegisterInfo::
-getCalleeSavedRegs(const MachineFunction *MF) const
-{
- // Mips calle-save register range is $16-$26(s0-s7)
- static const unsigned CalleeSavedRegs[] = {
- Mips::S0, Mips::S1, Mips::S2, Mips::S3,
- Mips::S4, Mips::S5, Mips::S6, Mips::S7, 0
- };
- return CalleeSavedRegs;
-}
-
-/// Mips Callee Saved Register Classes
-const TargetRegisterClass* const*
-MipsRegisterInfo::getCalleeSavedRegClasses(const MachineFunction *MF) const
-{
- static const TargetRegisterClass * const CalleeSavedRegClasses[] = {
- &Mips::CPURegsRegClass, &Mips::CPURegsRegClass,
- &Mips::CPURegsRegClass, &Mips::CPURegsRegClass,
- &Mips::CPURegsRegClass, &Mips::CPURegsRegClass,
- &Mips::CPURegsRegClass, &Mips::CPURegsRegClass, 0
- };
- return CalleeSavedRegClasses;
-}
-
-BitVector MipsRegisterInfo::
-getReservedRegs(const MachineFunction &MF) const
-{
- BitVector Reserved(getNumRegs());
- Reserved.set(Mips::ZERO);
- Reserved.set(Mips::AT);
- Reserved.set(Mips::K0);
- Reserved.set(Mips::K1);
- Reserved.set(Mips::GP);
- Reserved.set(Mips::SP);
- Reserved.set(Mips::FP);
- Reserved.set(Mips::RA);
- return Reserved;
-}
-
-//===----------------------------------------------------------------------===//
-//
-// Stack Frame Processing methods
-// +----------------------------+
-//
-// The stack is allocated decrementing the stack pointer on
-// the first instruction of a function prologue. Once decremented,
-// all stack referencesare are done thought a positive offset
-// from the stack/frame pointer, so the stack is considering
-// to grow up! Otherwise terrible hacks would have to be made
-// to get this stack ABI compliant :)
-//
-// The stack frame required by the ABI:
-// Offset
-//
-// 0 ----------
-// 4 Args to pass
-// . saved $GP (used in PIC - not supported yet)
-// . Local Area
-// . saved "Callee Saved" Registers
-// . saved FP
-// . saved RA
-// StackSize -----------
-//
-// Offset - offset from sp after stack allocation on function prologue
-//
-// The sp is the stack pointer subtracted/added from the stack size
-// at the Prologue/Epilogue
-//
-// References to the previous stack (to obtain arguments) are done
-// with offsets that exceeds the stack size: (stacksize+(4*(num_arg-1))
-//
-// Examples:
-// - reference to the actual stack frame
-// for any local area var there is smt like : FI >= 0, StackOffset: 4
-// sw REGX, 4(SP)
-//
-// - reference to previous stack frame
-// suppose there's a load to the 5th arguments : FI < 0, StackOffset: 16.
-// The emitted instruction will be something like:
-// lw REGX, 16+StackSize(SP)
-//
-// Since the total stack size is unknown on LowerFORMAL_ARGUMENTS, all
-// stack references (ObjectOffset) created to reference the function
-// arguments, are negative numbers. This way, on eliminateFrameIndex it's
-// possible to detect those references and the offsets are adjusted to
-// their real location.
-//
-//
-//
-//===----------------------------------------------------------------------===//
-
-// hasFP - Return true if the specified function should have a dedicated frame
-// pointer register. This is true if the function has variable sized allocas or
-// if frame pointer elimination is disabled.
-bool MipsRegisterInfo::
-hasFP(const MachineFunction &MF) const {
- return (NoFramePointerElim || MF.getFrameInfo()->hasVarSizedObjects());
-}
-
-// This function eliminate ADJCALLSTACKDOWN,
-// ADJCALLSTACKUP pseudo instructions
-void MipsRegisterInfo::
-eliminateCallFramePseudoInstr(MachineFunction &MF, MachineBasicBlock &MBB,
- MachineBasicBlock::iterator I) const {
- // Simply discard ADJCALLSTACKDOWN, ADJCALLSTACKUP instructions.
- MBB.erase(I);
-}
-
-// FrameIndex represent objects inside a abstract stack.
-// We must replace FrameIndex with an stack/frame pointer
-// direct reference.
-void MipsRegisterInfo::
-eliminateFrameIndex(MachineBasicBlock::iterator II, int SPAdj,
- RegScavenger *RS) const
-{
- MachineInstr &MI = *II;
- MachineFunction &MF = *MI.getParent()->getParent();
-
- unsigned i = 0;
- while (!MI.getOperand(i).isFrameIndex()) {
- ++i;
- assert(i < MI.getNumOperands() &&
- "Instr doesn't have FrameIndex operand!");
- }
-
- int FrameIndex = MI.getOperand(i).getIndex();
- int stackSize = MF.getFrameInfo()->getStackSize();
- int spOffset = MF.getFrameInfo()->getObjectOffset(FrameIndex);
-
- #ifndef NDEBUG
- DOUT << "\nFunction : " << MF.getFunction()->getName() << "\n";
- DOUT << "<--------->\n";
- MI.print(DOUT);
- DOUT << "FrameIndex : " << FrameIndex << "\n";
- DOUT << "spOffset : " << spOffset << "\n";
- DOUT << "stackSize : " << stackSize << "\n";
- #endif
-
- // as explained on LowerFORMAL_ARGUMENTS, detect negative offsets
- // and adjust SPOffsets considering the final stack size.
- int Offset = ((spOffset < 0) ? (stackSize + (-(spOffset+4))) : (spOffset));
- Offset += MI.getOperand(i-1).getImm();
-
- #ifndef NDEBUG
- DOUT << "Offset : " << Offset << "\n";
- DOUT << "<--------->\n";
- #endif
-
- MI.getOperand(i-1).ChangeToImmediate(Offset);
- MI.getOperand(i).ChangeToRegister(getFrameRegister(MF), false);
-}
-
-void MipsRegisterInfo::
-emitPrologue(MachineFunction &MF) const
-{
- MachineBasicBlock &MBB = MF.front();
- MachineFrameInfo *MFI = MF.getFrameInfo();
- MipsFunctionInfo *MipsFI = MF.getInfo<MipsFunctionInfo>();
- MachineBasicBlock::iterator MBBI = MBB.begin();
- bool isPIC = (MF.getTarget().getRelocationModel() == Reloc::PIC_);
-
- // Replace the dummy '0' SPOffset by the negative
- // offsets, as explained on LowerFORMAL_ARGUMENTS
- MipsFI->adjustLoadArgsFI(MFI);
- MipsFI->adjustStoreVarArgsFI(MFI);
-
- // Get the number of bytes to allocate from the FrameInfo.
- int NumBytes = (int) MFI->getStackSize();
-
- #ifndef NDEBUG
- DOUT << "\n<--- EMIT PROLOGUE --->\n";
- DOUT << "Actual Stack size :" << NumBytes << "\n";
- #endif
-
- // No need to allocate space on the stack.
- if (NumBytes == 0) return;
-
- int FPOffset, RAOffset;
-
- // Allocate space for saved RA and FP when needed
- if ((hasFP(MF)) && (MFI->hasCalls())) {
- FPOffset = NumBytes;
- RAOffset = (NumBytes+4);
- NumBytes += 8;
- } else if ((!hasFP(MF)) && (MFI->hasCalls())) {
- FPOffset = 0;
- RAOffset = NumBytes;
- NumBytes += 4;
- } else if ((hasFP(MF)) && (!MFI->hasCalls())) {
- FPOffset = NumBytes;
- RAOffset = 0;
- NumBytes += 4;
- } else {
- // No calls and no fp.
- RAOffset = FPOffset = 0;
- }
-
- MFI->setObjectOffset(MFI->CreateStackObject(4,4), FPOffset);
- MFI->setObjectOffset(MFI->CreateStackObject(4,4), RAOffset);
- MipsFI->setFPStackOffset(FPOffset);
- MipsFI->setRAStackOffset(RAOffset);
-
- // Align stack.
- unsigned Align = MF.getTarget().getFrameInfo()->getStackAlignment();
- NumBytes = ((NumBytes+Align-1)/Align*Align);
-
- #ifndef NDEBUG
- DOUT << "FPOffset :" << FPOffset << "\n";
- DOUT << "RAOffset :" << RAOffset << "\n";
- DOUT << "New stack size :" << NumBytes << "\n\n";
- #endif
-
- // Update frame info
- MFI->setStackSize(NumBytes);
-
- // PIC speficic function prologue
- if (isPIC)
- BuildMI(MBB, MBBI, TII.get(Mips::CPLOAD)).addReg(Mips::T9);
-
- // Adjust stack : addi sp, sp, (-imm)
- BuildMI(MBB, MBBI, TII.get(Mips::ADDiu), Mips::SP)
- .addReg(Mips::SP).addImm(-NumBytes);
-
- // Save the return address only if the function isnt a leaf one.
- // sw $ra, stack_loc($sp)
- if (MFI->hasCalls()) {
- BuildMI(MBB, MBBI, TII.get(Mips::SW))
- .addReg(Mips::RA).addImm(RAOffset).addReg(Mips::SP);
- }
-
- // if framepointer enabled, save it and set it
- // to point to the stack pointer
- if (hasFP(MF)) {
- // sw $fp,stack_loc($sp)
- BuildMI(MBB, MBBI, TII.get(Mips::SW))
- .addReg(Mips::FP).addImm(FPOffset).addReg(Mips::SP);
-
- // move $fp, $sp
- BuildMI(MBB, MBBI, TII.get(Mips::ADDu), Mips::FP)
- .addReg(Mips::SP).addReg(Mips::ZERO);
- }
-
- // PIC speficic function prologue
- if ((isPIC) && (MFI->hasCalls()))
- BuildMI(MBB, MBBI, TII.get(Mips::CPRESTORE))
- .addImm(MipsFI->getGPStackOffset());
-}
-
-void MipsRegisterInfo::
-emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const
-{
- MachineBasicBlock::iterator MBBI = prior(MBB.end());
- MachineFrameInfo *MFI = MF.getFrameInfo();
- MipsFunctionInfo *MipsFI = MF.getInfo<MipsFunctionInfo>();
-
- // Get the number of bytes from FrameInfo
- int NumBytes = (int) MFI->getStackSize();
-
- // Get the FI's where RA and FP are saved.
- int FPOffset = MipsFI->getFPStackOffset();
- int RAOffset = MipsFI->getRAStackOffset();
-
- // if framepointer enabled, restore it and restore the
- // stack pointer
- if (hasFP(MF)) {
- // move $sp, $fp
- BuildMI(MBB, MBBI, TII.get(Mips::ADDu), Mips::SP)
- .addReg(Mips::FP).addReg(Mips::ZERO);
-
- // lw $fp,stack_loc($sp)
- BuildMI(MBB, MBBI, TII.get(Mips::LW))
- .addReg(Mips::FP).addImm(FPOffset).addReg(Mips::SP);
- }
-
- // Restore the return address only if the function isnt a leaf one.
- // lw $ra, stack_loc($sp)
- if (MFI->hasCalls()) {
- BuildMI(MBB, MBBI, TII.get(Mips::LW))
- .addReg(Mips::RA).addImm(RAOffset).addReg(Mips::SP);
- }
-
- // adjust stack : insert addi sp, sp, (imm)
- if (NumBytes) {
- BuildMI(MBB, MBBI, TII.get(Mips::ADDiu), Mips::SP)
- .addReg(Mips::SP).addImm(NumBytes);
- }
-}
-
-void MipsRegisterInfo::
-processFunctionBeforeFrameFinalized(MachineFunction &MF) const {
- // Set the SPOffset on the FI where GP must be saved/loaded.
- MachineFrameInfo *MFI = MF.getFrameInfo();
- if (MFI->hasCalls()) {
- MipsFunctionInfo *MipsFI = MF.getInfo<MipsFunctionInfo>();
- #ifndef NDEBUG
- DOUT << "processFunctionBeforeFrameFinalized\n";
- DOUT << "GPOffset :" << MipsFI->getGPStackOffset() << "\n";
- DOUT << "FI :" << MipsFI->getGPFI() << "\n";
- #endif
- MFI->setObjectOffset(MipsFI->getGPFI(), MipsFI->getGPStackOffset());
- }
-}
-
-unsigned MipsRegisterInfo::
-getRARegister() const {
- return Mips::RA;
-}
-
-unsigned MipsRegisterInfo::
-getFrameRegister(MachineFunction &MF) const {
- return hasFP(MF) ? Mips::FP : Mips::SP;
-}
-
-unsigned MipsRegisterInfo::
-getEHExceptionRegister() const {
- assert(0 && "What is the exception register");
- return 0;
-}
-
-unsigned MipsRegisterInfo::
-getEHHandlerRegister() const {
- assert(0 && "What is the exception handler register");
- return 0;
-}
-
-int MipsRegisterInfo::
-getDwarfRegNum(unsigned RegNum, bool isEH) const {
- assert(0 && "What is the dwarf register number");
- return -1;
-}
-
-#include "MipsGenRegisterInfo.inc"
-
diff --git a/release_23/lib/Target/Mips/MipsRegisterInfo.h b/release_23/lib/Target/Mips/MipsRegisterInfo.h
deleted file mode 100644
index 823461610d7d..000000000000
--- a/release_23/lib/Target/Mips/MipsRegisterInfo.h
+++ /dev/null
@@ -1,70 +0,0 @@
-//===- MipsRegisterInfo.h - Mips Register Information Impl ------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains the Mips implementation of the TargetRegisterInfo class.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef MIPSREGISTERINFO_H
-#define MIPSREGISTERINFO_H
-
-#include "llvm/Target/TargetRegisterInfo.h"
-#include "MipsGenRegisterInfo.h.inc"
-
-namespace llvm {
-
-class TargetInstrInfo;
-class Type;
-
-struct MipsRegisterInfo : public MipsGenRegisterInfo {
- const TargetInstrInfo &TII;
-
- MipsRegisterInfo(const TargetInstrInfo &tii);
-
- /// getRegisterNumbering - Given the enum value for some register, e.g.
- /// Mips::RA, return the number that it corresponds to (e.g. 31).
- static unsigned getRegisterNumbering(unsigned RegEnum);
-
- /// Code Generation virtual methods...
- const unsigned *getCalleeSavedRegs(const MachineFunction* MF = 0) const;
-
- const TargetRegisterClass* const*
- getCalleeSavedRegClasses(const MachineFunction* MF = 0) const;
-
- BitVector getReservedRegs(const MachineFunction &MF) const;
-
- bool hasFP(const MachineFunction &MF) const;
-
- void eliminateCallFramePseudoInstr(MachineFunction &MF,
- MachineBasicBlock &MBB,
- MachineBasicBlock::iterator I) const;
-
- /// Stack Frame Processing Methods
- void eliminateFrameIndex(MachineBasicBlock::iterator II,
- int SPAdj, RegScavenger *RS = NULL) const;
-
- void processFunctionBeforeFrameFinalized(MachineFunction &MF) const;
-
- void emitPrologue(MachineFunction &MF) const;
- void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const;
-
- /// Debug information queries.
- unsigned getRARegister() const;
- unsigned getFrameRegister(MachineFunction &MF) const;
-
- /// Exception handling queries.
- unsigned getEHExceptionRegister() const;
- unsigned getEHHandlerRegister() const;
-
- int getDwarfRegNum(unsigned RegNum, bool isEH) const;
-};
-
-} // end namespace llvm
-
-#endif
diff --git a/release_23/lib/Target/Mips/MipsRegisterInfo.td b/release_23/lib/Target/Mips/MipsRegisterInfo.td
deleted file mode 100644
index 982f788b9655..000000000000
--- a/release_23/lib/Target/Mips/MipsRegisterInfo.td
+++ /dev/null
@@ -1,80 +0,0 @@
-//===- MipsRegisterInfo.td - Mips Register defs -----------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-//===----------------------------------------------------------------------===//
-// Declarations that describe the MIPS register file
-//===----------------------------------------------------------------------===//
-
-// We have banks of 32 registers each.
-class MipsReg<string n> : Register<n> {
- field bits<5> Num;
- let Namespace = "Mips";
-}
-
-// Mips CPU Registers
-class MipsGPRReg<bits<5> num, string n> : MipsReg<n> {
- let Num = num;
-}
-
-// CPU GPR Registers
-def ZERO : MipsGPRReg< 0, "ZERO">, DwarfRegNum<[0]>;
-def AT : MipsGPRReg< 1, "AT">, DwarfRegNum<[1]>;
-def V0 : MipsGPRReg< 2, "2">, DwarfRegNum<[2]>;
-def V1 : MipsGPRReg< 3, "3">, DwarfRegNum<[3]>;
-def A0 : MipsGPRReg< 4, "4">, DwarfRegNum<[5]>;
-def A1 : MipsGPRReg< 5, "5">, DwarfRegNum<[5]>;
-def A2 : MipsGPRReg< 6, "6">, DwarfRegNum<[6]>;
-def A3 : MipsGPRReg< 7, "7">, DwarfRegNum<[7]>;
-def T0 : MipsGPRReg< 8, "8">, DwarfRegNum<[8]>;
-def T1 : MipsGPRReg< 9, "9">, DwarfRegNum<[9]>;
-def T2 : MipsGPRReg< 10, "10">, DwarfRegNum<[10]>;
-def T3 : MipsGPRReg< 11, "11">, DwarfRegNum<[11]>;
-def T4 : MipsGPRReg< 12, "12">, DwarfRegNum<[12]>;
-def T5 : MipsGPRReg< 13, "13">, DwarfRegNum<[13]>;
-def T6 : MipsGPRReg< 14, "14">, DwarfRegNum<[14]>;
-def T7 : MipsGPRReg< 15, "15">, DwarfRegNum<[15]>;
-def S0 : MipsGPRReg< 16, "16">, DwarfRegNum<[16]>;
-def S1 : MipsGPRReg< 17, "17">, DwarfRegNum<[17]>;
-def S2 : MipsGPRReg< 18, "18">, DwarfRegNum<[18]>;
-def S3 : MipsGPRReg< 19, "19">, DwarfRegNum<[19]>;
-def S4 : MipsGPRReg< 20, "20">, DwarfRegNum<[20]>;
-def S5 : MipsGPRReg< 21, "21">, DwarfRegNum<[21]>;
-def S6 : MipsGPRReg< 22, "22">, DwarfRegNum<[22]>;
-def S7 : MipsGPRReg< 23, "23">, DwarfRegNum<[23]>;
-def T8 : MipsGPRReg< 24, "24">, DwarfRegNum<[24]>;
-def T9 : MipsGPRReg< 25, "25">, DwarfRegNum<[25]>;
-def K0 : MipsGPRReg< 26, "26">, DwarfRegNum<[26]>;
-def K1 : MipsGPRReg< 27, "27">, DwarfRegNum<[27]>;
-def GP : MipsGPRReg< 28, "GP">, DwarfRegNum<[28]>;
-def SP : MipsGPRReg< 29, "SP">, DwarfRegNum<[29]>;
-def FP : MipsGPRReg< 30, "FP">, DwarfRegNum<[30]>;
-def RA : MipsGPRReg< 31, "RA">, DwarfRegNum<[31]>;
-
-// CPU Registers Class
-def CPURegs : RegisterClass<"Mips", [i32], 32,
- // Return Values and Arguments
- [V0, V1, A0, A1, A2, A3,
- // Not preserved across procedure calls
- T0, T1, T2, T3, T4, T5, T6, T7, T8, T9,
- // Callee save
- S0, S1, S2, S3, S4, S5, S6, S7,
- // Reserved
- ZERO, AT, K0, K1, GP, SP, FP, RA]>
-{
- let MethodProtos = [{
- iterator allocation_order_end(const MachineFunction &MF) const;
- }];
- let MethodBodies = [{
- CPURegsClass::iterator
- CPURegsClass::allocation_order_end(const MachineFunction &MF) const {
- // The last 8 registers on the list above are reserved
- return end()-8;
- }
- }];
-}
diff --git a/release_23/lib/Target/Mips/MipsSchedule.td b/release_23/lib/Target/Mips/MipsSchedule.td
deleted file mode 100644
index 0c3ca57361cd..000000000000
--- a/release_23/lib/Target/Mips/MipsSchedule.td
+++ /dev/null
@@ -1,63 +0,0 @@
-//===- MipsSchedule.td - Mips Scheduling Definitions ------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-//===----------------------------------------------------------------------===//
-// Functional units across Mips chips sets. Based on GCC/Mips backend files.
-//===----------------------------------------------------------------------===//
-def ALU : FuncUnit;
-def IMULDIV : FuncUnit;
-
-//===----------------------------------------------------------------------===//
-// Instruction Itinerary classes used for Mips
-//===----------------------------------------------------------------------===//
-def IIAlu : InstrItinClass;
-def IILoad : InstrItinClass;
-def IIStore : InstrItinClass;
-def IIXfer : InstrItinClass;
-def IIBranch : InstrItinClass;
-def IIHiLo : InstrItinClass;
-def IIImul : InstrItinClass;
-def IIIdiv : InstrItinClass;
-def IIFcvt : InstrItinClass;
-def IIFmove : InstrItinClass;
-def IIFcmp : InstrItinClass;
-def IIFadd : InstrItinClass;
-def IIFmulSingle : InstrItinClass;
-def IIFmulDouble : InstrItinClass;
-def IIFdivSingle : InstrItinClass;
-def IIFdivDouble : InstrItinClass;
-def IIFsqrtSingle : InstrItinClass;
-def IIFsqrtDouble : InstrItinClass;
-def IIFrecipFsqrtStep : InstrItinClass;
-def IIPseudo : InstrItinClass;
-
-//===----------------------------------------------------------------------===//
-// Mips Generic instruction itineraries.
-//===----------------------------------------------------------------------===//
-def MipsGenericItineraries : ProcessorItineraries<[
- InstrItinData<IIAlu , [InstrStage<1, [ALU]>]>,
- InstrItinData<IILoad , [InstrStage<3, [ALU]>]>,
- InstrItinData<IIStore , [InstrStage<1, [ALU]>]>,
- InstrItinData<IIXfer , [InstrStage<2, [ALU]>]>,
- InstrItinData<IIBranch , [InstrStage<1, [ALU]>]>,
- InstrItinData<IIHiLo , [InstrStage<1, [IMULDIV]>]>,
- InstrItinData<IIImul , [InstrStage<17, [IMULDIV]>]>,
- InstrItinData<IIIdiv , [InstrStage<38, [IMULDIV]>]>,
- InstrItinData<IIFcvt , [InstrStage<1, [ALU]>]>,
- InstrItinData<IIFmove , [InstrStage<2, [ALU]>]>,
- InstrItinData<IIFcmp , [InstrStage<3, [ALU]>]>,
- InstrItinData<IIFadd , [InstrStage<4, [ALU]>]>,
- InstrItinData<IIFmulSingle , [InstrStage<7, [ALU]>]>,
- InstrItinData<IIFmulDouble , [InstrStage<8, [ALU]>]>,
- InstrItinData<IIFdivSingle , [InstrStage<23, [ALU]>]>,
- InstrItinData<IIFdivDouble , [InstrStage<36, [ALU]>]>,
- InstrItinData<IIFsqrtSingle , [InstrStage<54, [ALU]>]>,
- InstrItinData<IIFsqrtDouble , [InstrStage<12, [ALU]>]>,
- InstrItinData<IIFrecipFsqrtStep , [InstrStage<5, [ALU]>]>
-]>;
diff --git a/release_23/lib/Target/Mips/MipsSubtarget.cpp b/release_23/lib/Target/Mips/MipsSubtarget.cpp
deleted file mode 100644
index e78b5cb300f7..000000000000
--- a/release_23/lib/Target/Mips/MipsSubtarget.cpp
+++ /dev/null
@@ -1,27 +0,0 @@
-//===- MipsSubtarget.cpp - Mips Subtarget Information -----------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the Mips specific subclass of TargetSubtarget.
-//
-//===----------------------------------------------------------------------===//
-
-#include "MipsSubtarget.h"
-#include "Mips.h"
-#include "MipsGenSubtarget.inc"
-using namespace llvm;
-
-MipsSubtarget::MipsSubtarget(const TargetMachine &TM, const Module &M,
- const std::string &FS) :
- IsMipsIII(false)
-{
- std::string CPU = "mips1";
-
- // Parse features string.
- ParseSubtargetFeatures(FS, CPU);
-}
diff --git a/release_23/lib/Target/Mips/MipsSubtarget.h b/release_23/lib/Target/Mips/MipsSubtarget.h
deleted file mode 100644
index 0f3641f4047d..000000000000
--- a/release_23/lib/Target/Mips/MipsSubtarget.h
+++ /dev/null
@@ -1,49 +0,0 @@
-//=====-- MipsSubtarget.h - Define Subtarget for the Mips -----*- C++ -*--====//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file declares the Mips specific subclass of TargetSubtarget.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef MIPSSUBTARGET_H
-#define MIPSSUBTARGET_H
-
-#include "llvm/Target/TargetSubtarget.h"
-#include "llvm/Target/TargetMachine.h"
-
-#include <string>
-
-namespace llvm {
-class Module;
-
-class MipsSubtarget : public TargetSubtarget {
-
-protected:
-
- bool IsMipsIII;
- InstrItineraryData InstrItins;
-
-public:
- /// This constructor initializes the data members to match that
- /// of the specified module.
- ///
- MipsSubtarget(const TargetMachine &TM, const Module &M,
- const std::string &FS);
-
- /// ParseSubtargetFeatures - Parses features string setting specified
- /// subtarget options. Definition of function is auto generated by tblgen.
- void ParseSubtargetFeatures(const std::string &FS, const std::string &CPU);
-
- /// isMipsIII - Return true if the selected CPU supports MipsIII ISA
- /// support.
- bool isMipsIII() const { return IsMipsIII; }
-};
-} // End llvm namespace
-
-#endif
diff --git a/release_23/lib/Target/Mips/MipsTargetAsmInfo.cpp b/release_23/lib/Target/Mips/MipsTargetAsmInfo.cpp
deleted file mode 100644
index d69e78fe351d..000000000000
--- a/release_23/lib/Target/Mips/MipsTargetAsmInfo.cpp
+++ /dev/null
@@ -1,37 +0,0 @@
-//===-- MipsTargetAsmInfo.cpp - Mips asm properties -------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains the declarations of the MipsTargetAsmInfo properties.
-//
-//===----------------------------------------------------------------------===//
-
-#include "MipsTargetAsmInfo.h"
-#include "MipsTargetMachine.h"
-
-using namespace llvm;
-
-MipsTargetAsmInfo::MipsTargetAsmInfo(const MipsTargetMachine &TM) {
- AlignmentIsInBytes = false;
- Data16bitsDirective = "\t.half\t";
- Data32bitsDirective = "\t.word\t";
- PrivateGlobalPrefix = "$";
- JumpTableDataSection = "\t.rdata";
- CommentString = "#";
- ReadOnlySection = "\t.rdata";
- ZeroDirective = "\t.space\t";
- BSSSection = "\t.section\t.bss";
- LCOMMDirective = "\t.lcomm\t";
-
- if (TM.getRelocationModel() == Reloc::Static)
- JumpTableDirective = "\t.word\t";
- else
- JumpTableDirective = "\t.gpword\t";
-
- COMMDirectiveTakesAlignment = true;
-}
diff --git a/release_23/lib/Target/Mips/MipsTargetAsmInfo.h b/release_23/lib/Target/Mips/MipsTargetAsmInfo.h
deleted file mode 100644
index bb9402615d2a..000000000000
--- a/release_23/lib/Target/Mips/MipsTargetAsmInfo.h
+++ /dev/null
@@ -1,30 +0,0 @@
-//=====-- MipsTargetAsmInfo.h - Mips asm properties -----------*- C++ -*--====//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains the declaration of the MipsTargetAsmInfo class.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef MIPSTARGETASMINFO_H
-#define MIPSTARGETASMINFO_H
-
-#include "llvm/Target/TargetAsmInfo.h"
-
-namespace llvm {
-
- // Forward declaration.
- class MipsTargetMachine;
-
- struct MipsTargetAsmInfo : public TargetAsmInfo {
- explicit MipsTargetAsmInfo(const MipsTargetMachine &TM);
- };
-
-} // namespace llvm
-
-#endif
diff --git a/release_23/lib/Target/Mips/MipsTargetMachine.cpp b/release_23/lib/Target/Mips/MipsTargetMachine.cpp
deleted file mode 100644
index 09e058f34f31..000000000000
--- a/release_23/lib/Target/Mips/MipsTargetMachine.cpp
+++ /dev/null
@@ -1,93 +0,0 @@
-//===-- MipsTargetMachine.cpp - Define TargetMachine for Mips -------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// Implements the info about Mips target spec.
-//
-//===----------------------------------------------------------------------===//
-
-#include "Mips.h"
-#include "MipsTargetAsmInfo.h"
-#include "MipsTargetMachine.h"
-#include "llvm/Module.h"
-#include "llvm/PassManager.h"
-#include "llvm/Target/TargetMachineRegistry.h"
-using namespace llvm;
-
-namespace {
- // Register the target.
- RegisterTarget<MipsTargetMachine> X("mips", " Mips");
-}
-
-const TargetAsmInfo *MipsTargetMachine::
-createTargetAsmInfo() const
-{
- return new MipsTargetAsmInfo(*this);
-}
-
-// DataLayout --> Big-endian, 32-bit pointer/ABI/alignment
-// The stack is always 8 byte aligned
-// On function prologue, the stack is created by decrementing
-// its pointer. Once decremented, all references are done with positive
-// offset from the stack/frame pointer, so StackGrowsUp is used.
-// When using CodeModel::Large the behaviour
-//
-//
-MipsTargetMachine::
-MipsTargetMachine(const Module &M, const std::string &FS):
- Subtarget(*this, M, FS), DataLayout("E-p:32:32:32"),
- InstrInfo(*this), FrameInfo(TargetFrameInfo::StackGrowsUp, 8, 0),
- TLInfo(*this)
-{
- if (getRelocationModel() != Reloc::Static)
- setRelocationModel(Reloc::PIC_);
- if (getCodeModel() == CodeModel::Default)
- setCodeModel(CodeModel::Small);
-}
-
-// return 0 and must specify -march to gen MIPS code.
-unsigned MipsTargetMachine::
-getModuleMatchQuality(const Module &M)
-{
- // We strongly match "mips-*".
- std::string TT = M.getTargetTriple();
- if (TT.size() >= 5 && std::string(TT.begin(), TT.begin()+5) == "mips-")
- return 20;
-
- return 0;
-}
-
-// Install an instruction selector pass using
-// the ISelDag to gen Mips code.
-bool MipsTargetMachine::
-addInstSelector(PassManagerBase &PM, bool Fast)
-{
- PM.add(createMipsISelDag(*this));
- return false;
-}
-
-// Implemented by targets that want to run passes immediately before
-// machine code is emitted. return true if -print-machineinstrs should
-// print out the code after the passes.
-bool MipsTargetMachine::
-addPreEmitPass(PassManagerBase &PM, bool Fast)
-{
- PM.add(createMipsDelaySlotFillerPass(*this));
- return true;
-}
-
-// Implements the AssemblyEmitter for the target. Must return
-// true if AssemblyEmitter is supported
-bool MipsTargetMachine::
-addAssemblyEmitter(PassManagerBase &PM, bool Fast,
- std::ostream &Out)
-{
- // Output assembly language.
- PM.add(createMipsCodePrinterPass(Out, *this));
- return false;
-}
diff --git a/release_23/lib/Target/Mips/MipsTargetMachine.h b/release_23/lib/Target/Mips/MipsTargetMachine.h
deleted file mode 100644
index 2b877f2beefd..000000000000
--- a/release_23/lib/Target/Mips/MipsTargetMachine.h
+++ /dev/null
@@ -1,65 +0,0 @@
-//===-- MipsTargetMachine.h - Define TargetMachine for Mips -00--*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file declares the Mips specific subclass of TargetMachine.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef MIPSTARGETMACHINE_H
-#define MIPSTARGETMACHINE_H
-
-#include "MipsSubtarget.h"
-#include "MipsInstrInfo.h"
-#include "MipsISelLowering.h"
-#include "llvm/Target/TargetMachine.h"
-#include "llvm/Target/TargetData.h"
-#include "llvm/Target/TargetFrameInfo.h"
-
-namespace llvm {
- class MipsTargetMachine : public LLVMTargetMachine {
- MipsSubtarget Subtarget;
- const TargetData DataLayout; // Calculates type size & alignment
- MipsInstrInfo InstrInfo;
- TargetFrameInfo FrameInfo;
- MipsTargetLowering TLInfo;
-
- protected:
- virtual const TargetAsmInfo *createTargetAsmInfo() const;
-
- public:
- MipsTargetMachine(const Module &M, const std::string &FS);
-
- virtual const MipsInstrInfo *getInstrInfo() const
- { return &InstrInfo; }
- virtual const TargetFrameInfo *getFrameInfo() const
- { return &FrameInfo; }
- virtual const TargetSubtarget *getSubtargetImpl() const
- { return &Subtarget; }
- virtual const TargetData *getTargetData() const
- { return &DataLayout;}
-
- virtual const TargetRegisterInfo *getRegisterInfo() const {
- return &InstrInfo.getRegisterInfo();
- }
-
- virtual MipsTargetLowering *getTargetLowering() const {
- return const_cast<MipsTargetLowering*>(&TLInfo);
- }
-
- static unsigned getModuleMatchQuality(const Module &M);
-
- // Pass Pipeline Configuration
- virtual bool addInstSelector(PassManagerBase &PM, bool Fast);
- virtual bool addPreEmitPass(PassManagerBase &PM, bool Fast);
- virtual bool addAssemblyEmitter(PassManagerBase &PM, bool Fast,
- std::ostream &Out);
- };
-} // End llvm namespace
-
-#endif
diff --git a/release_23/lib/Target/PowerPC/Makefile b/release_23/lib/Target/PowerPC/Makefile
deleted file mode 100644
index 6cf3fa32d210..000000000000
--- a/release_23/lib/Target/PowerPC/Makefile
+++ /dev/null
@@ -1,20 +0,0 @@
-##===- lib/Target/PowerPC/Makefile -------------------------*- Makefile -*-===##
-#
-# The LLVM Compiler Infrastructure
-#
-# This file is distributed under the University of Illinois Open Source
-# License. See LICENSE.TXT for details.
-#
-##===----------------------------------------------------------------------===##
-LEVEL = ../../..
-LIBRARYNAME = LLVMPowerPC
-TARGET = PPC
-
-# Make sure that tblgen is run, first thing.
-BUILT_SOURCES = PPCGenInstrNames.inc PPCGenRegisterNames.inc \
- PPCGenAsmWriter.inc PPCGenCodeEmitter.inc \
- PPCGenRegisterInfo.h.inc PPCGenRegisterInfo.inc \
- PPCGenInstrInfo.inc PPCGenDAGISel.inc \
- PPCGenSubtarget.inc PPCGenCallingConv.inc
-
-include $(LEVEL)/Makefile.common
diff --git a/release_23/lib/Target/PowerPC/PPC.h b/release_23/lib/Target/PowerPC/PPC.h
deleted file mode 100644
index b9f64839cefb..000000000000
--- a/release_23/lib/Target/PowerPC/PPC.h
+++ /dev/null
@@ -1,46 +0,0 @@
-//===-- PPC.h - Top-level interface for PowerPC Target ----------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains the entry points for global functions defined in the LLVM
-// PowerPC back-end.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_TARGET_POWERPC_H
-#define LLVM_TARGET_POWERPC_H
-
-#include <iosfwd>
-
-
-// GCC #defines PPC on Linux but we use it as our namespace name
-#undef PPC
-
-namespace llvm {
- class PPCTargetMachine;
- class FunctionPass;
- class MachineCodeEmitter;
-
-FunctionPass *createPPCBranchSelectionPass();
-FunctionPass *createPPCISelDag(PPCTargetMachine &TM);
-FunctionPass *createPPCAsmPrinterPass(std::ostream &OS,
- PPCTargetMachine &TM);
-FunctionPass *createPPCCodeEmitterPass(PPCTargetMachine &TM,
- MachineCodeEmitter &MCE);
-} // end namespace llvm;
-
-// Defines symbolic names for PowerPC registers. This defines a mapping from
-// register name to register number.
-//
-#include "PPCGenRegisterNames.inc"
-
-// Defines symbolic names for the PowerPC instructions.
-//
-#include "PPCGenInstrNames.inc"
-
-#endif
diff --git a/release_23/lib/Target/PowerPC/PPC.td b/release_23/lib/Target/PowerPC/PPC.td
deleted file mode 100644
index cc0c8c8fa63a..000000000000
--- a/release_23/lib/Target/PowerPC/PPC.td
+++ /dev/null
@@ -1,114 +0,0 @@
-//===- PPC.td - Describe the PowerPC Target Machine --------*- tablegen -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This is the top level entry point for the PowerPC target.
-//
-//===----------------------------------------------------------------------===//
-
-// Get the target-independent interfaces which we are implementing.
-//
-include "../Target.td"
-
-//===----------------------------------------------------------------------===//
-// PowerPC Subtarget features.
-//
-
-//===----------------------------------------------------------------------===//
-// CPU Directives //
-//===----------------------------------------------------------------------===//
-
-def Directive601 : SubtargetFeature<"", "DarwinDirective", "PPC::DIR_601", "">;
-def Directive602 : SubtargetFeature<"", "DarwinDirective", "PPC::DIR_602", "">;
-def Directive603 : SubtargetFeature<"", "DarwinDirective", "PPC::DIR_603", "">;
-def Directive604 : SubtargetFeature<"", "DarwinDirective", "PPC::DIR_603", "">;
-def Directive620 : SubtargetFeature<"", "DarwinDirective", "PPC::DIR_603", "">;
-def Directive7400: SubtargetFeature<"", "DarwinDirective", "PPC::DIR_7400", "">;
-def Directive750 : SubtargetFeature<"", "DarwinDirective", "PPC::DIR_750", "">;
-def Directive970 : SubtargetFeature<"", "DarwinDirective", "PPC::DIR_970", "">;
-def Directive32 : SubtargetFeature<"", "DarwinDirective", "PPC::DIR_32", "">;
-def Directive64 : SubtargetFeature<"", "DarwinDirective", "PPC::DIR_64", "">;
-
-def Feature64Bit : SubtargetFeature<"64bit","Has64BitSupport", "true",
- "Enable 64-bit instructions">;
-def Feature64BitRegs : SubtargetFeature<"64bitregs","Use64BitRegs", "true",
- "Enable 64-bit registers usage for ppc32 [beta]">;
-def FeatureAltivec : SubtargetFeature<"altivec","HasAltivec", "true",
- "Enable Altivec instructions">;
-def FeatureGPUL : SubtargetFeature<"gpul","IsGigaProcessor", "true",
- "Enable GPUL instructions">;
-def FeatureFSqrt : SubtargetFeature<"fsqrt","HasFSQRT", "true",
- "Enable the fsqrt instruction">;
-def FeatureSTFIWX : SubtargetFeature<"stfiwx","HasSTFIWX", "true",
- "Enable the stfiwx instruction">;
-
-//===----------------------------------------------------------------------===//
-// Register File Description
-//===----------------------------------------------------------------------===//
-
-include "PPCRegisterInfo.td"
-include "PPCSchedule.td"
-include "PPCInstrInfo.td"
-
-//===----------------------------------------------------------------------===//
-// PowerPC processors supported.
-//
-
-def : Processor<"generic", G3Itineraries, [Directive32]>;
-def : Processor<"601", G3Itineraries, [Directive601]>;
-def : Processor<"602", G3Itineraries, [Directive602]>;
-def : Processor<"603", G3Itineraries, [Directive603]>;
-def : Processor<"603e", G3Itineraries, [Directive603]>;
-def : Processor<"603ev", G3Itineraries, [Directive603]>;
-def : Processor<"604", G3Itineraries, [Directive604]>;
-def : Processor<"604e", G3Itineraries, [Directive604]>;
-def : Processor<"620", G3Itineraries, [Directive620]>;
-def : Processor<"g3", G3Itineraries, [Directive7400]>;
-def : Processor<"7400", G4Itineraries, [Directive7400, FeatureAltivec]>;
-def : Processor<"g4", G4Itineraries, [Directive7400, FeatureAltivec]>;
-def : Processor<"7450", G4PlusItineraries, [Directive7400, FeatureAltivec]>;
-def : Processor<"g4+", G4PlusItineraries, [Directive750, FeatureAltivec]>;
-def : Processor<"750", G4Itineraries, [Directive750, FeatureAltivec]>;
-def : Processor<"970", G5Itineraries,
- [Directive970, FeatureAltivec,
- FeatureGPUL, FeatureFSqrt, FeatureSTFIWX,
- Feature64Bit /*, Feature64BitRegs */]>;
-def : Processor<"g5", G5Itineraries,
- [Directive970, FeatureAltivec,
- FeatureGPUL, FeatureFSqrt, FeatureSTFIWX,
- Feature64Bit /*, Feature64BitRegs */]>;
-def : Processor<"ppc", G3Itineraries, [Directive32]>;
-def : Processor<"ppc64", G5Itineraries,
- [Directive64, FeatureAltivec,
- FeatureGPUL, FeatureFSqrt, FeatureSTFIWX,
- Feature64Bit /*, Feature64BitRegs */]>;
-
-
-//===----------------------------------------------------------------------===//
-// Calling Conventions
-//===----------------------------------------------------------------------===//
-
-include "PPCCallingConv.td"
-
-def PPCInstrInfo : InstrInfo {
- // Define how we want to layout our TargetSpecific information field... This
- // should be kept up-to-date with the fields in the PPCInstrInfo.h file.
- let TSFlagsFields = ["PPC970_First",
- "PPC970_Single",
- "PPC970_Cracked",
- "PPC970_Unit"];
- let TSFlagsShifts = [0, 1, 2, 3];
-
- let isLittleEndianEncoding = 1;
-}
-
-
-def PPC : Target {
- // Information about the instructions.
- let InstructionSet = PPCInstrInfo;
-}
diff --git a/release_23/lib/Target/PowerPC/PPCAsmPrinter.cpp b/release_23/lib/Target/PowerPC/PPCAsmPrinter.cpp
deleted file mode 100644
index 4cc9d2a9bd58..000000000000
--- a/release_23/lib/Target/PowerPC/PPCAsmPrinter.cpp
+++ /dev/null
@@ -1,1143 +0,0 @@
-//===-- PPCAsmPrinter.cpp - Print machine instrs to PowerPC assembly --------=//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains a printer that converts from our internal representation
-// of machine-dependent LLVM code to PowerPC assembly language. This printer is
-// the output mechanism used by `llc'.
-//
-// Documentation at http://developer.apple.com/documentation/DeveloperTools/
-// Reference/Assembler/ASMIntroduction/chapter_1_section_1.html
-//
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "asmprinter"
-#include "PPC.h"
-#include "PPCPredicates.h"
-#include "PPCTargetMachine.h"
-#include "PPCSubtarget.h"
-#include "llvm/Constants.h"
-#include "llvm/DerivedTypes.h"
-#include "llvm/Module.h"
-#include "llvm/Assembly/Writer.h"
-#include "llvm/CodeGen/AsmPrinter.h"
-#include "llvm/CodeGen/DwarfWriter.h"
-#include "llvm/CodeGen/MachineModuleInfo.h"
-#include "llvm/CodeGen/MachineFunctionPass.h"
-#include "llvm/CodeGen/MachineInstr.h"
-#include "llvm/CodeGen/MachineInstrBuilder.h"
-#include "llvm/Support/Mangler.h"
-#include "llvm/Support/MathExtras.h"
-#include "llvm/Support/CommandLine.h"
-#include "llvm/Support/Debug.h"
-#include "llvm/Support/Compiler.h"
-#include "llvm/Target/TargetAsmInfo.h"
-#include "llvm/Target/TargetRegisterInfo.h"
-#include "llvm/Target/TargetInstrInfo.h"
-#include "llvm/Target/TargetOptions.h"
-#include "llvm/ADT/Statistic.h"
-#include "llvm/ADT/StringExtras.h"
-#include <set>
-using namespace llvm;
-
-STATISTIC(EmittedInsts, "Number of machine instrs printed");
-
-namespace {
- struct VISIBILITY_HIDDEN PPCAsmPrinter : public AsmPrinter {
- std::set<std::string> FnStubs, GVStubs;
- const PPCSubtarget &Subtarget;
-
- PPCAsmPrinter(std::ostream &O, TargetMachine &TM, const TargetAsmInfo *T)
- : AsmPrinter(O, TM, T), Subtarget(TM.getSubtarget<PPCSubtarget>()) {
- }
-
- virtual const char *getPassName() const {
- return "PowerPC Assembly Printer";
- }
-
- PPCTargetMachine &getTM() {
- return static_cast<PPCTargetMachine&>(TM);
- }
-
- unsigned enumRegToMachineReg(unsigned enumReg) {
- switch (enumReg) {
- default: assert(0 && "Unhandled register!"); break;
- case PPC::CR0: return 0;
- case PPC::CR1: return 1;
- case PPC::CR2: return 2;
- case PPC::CR3: return 3;
- case PPC::CR4: return 4;
- case PPC::CR5: return 5;
- case PPC::CR6: return 6;
- case PPC::CR7: return 7;
- }
- abort();
- }
-
- /// printInstruction - This method is automatically generated by tablegen
- /// from the instruction set description. This method returns true if the
- /// machine instruction was sufficiently described to print it, otherwise it
- /// returns false.
- bool printInstruction(const MachineInstr *MI);
-
- void printMachineInstruction(const MachineInstr *MI);
- void printOp(const MachineOperand &MO);
-
- /// stripRegisterPrefix - This method strips the character prefix from a
- /// register name so that only the number is left. Used by for linux asm.
- const char *stripRegisterPrefix(const char *RegName) {
- switch (RegName[0]) {
- case 'r':
- case 'f':
- case 'v': return RegName + 1;
- case 'c': if (RegName[1] == 'r') return RegName + 2;
- }
-
- return RegName;
- }
-
- /// printRegister - Print register according to target requirements.
- ///
- void printRegister(const MachineOperand &MO, bool R0AsZero) {
- unsigned RegNo = MO.getReg();
- assert(TargetRegisterInfo::isPhysicalRegister(RegNo) && "Not physreg??");
-
- // If we should use 0 for R0.
- if (R0AsZero && RegNo == PPC::R0) {
- O << "0";
- return;
- }
-
- const char *RegName = TM.getRegisterInfo()->get(RegNo).AsmName;
- // Linux assembler (Others?) does not take register mnemonics.
- // FIXME - What about special registers used in mfspr/mtspr?
- if (!Subtarget.isDarwin()) RegName = stripRegisterPrefix(RegName);
- O << RegName;
- }
-
- void printOperand(const MachineInstr *MI, unsigned OpNo) {
- const MachineOperand &MO = MI->getOperand(OpNo);
- if (MO.isRegister()) {
- printRegister(MO, false);
- } else if (MO.isImmediate()) {
- O << MO.getImm();
- } else {
- printOp(MO);
- }
- }
-
- bool PrintAsmOperand(const MachineInstr *MI, unsigned OpNo,
- unsigned AsmVariant, const char *ExtraCode);
- bool PrintAsmMemoryOperand(const MachineInstr *MI, unsigned OpNo,
- unsigned AsmVariant, const char *ExtraCode);
-
-
- void printS5ImmOperand(const MachineInstr *MI, unsigned OpNo) {
- char value = MI->getOperand(OpNo).getImm();
- value = (value << (32-5)) >> (32-5);
- O << (int)value;
- }
- void printU5ImmOperand(const MachineInstr *MI, unsigned OpNo) {
- unsigned char value = MI->getOperand(OpNo).getImm();
- assert(value <= 31 && "Invalid u5imm argument!");
- O << (unsigned int)value;
- }
- void printU6ImmOperand(const MachineInstr *MI, unsigned OpNo) {
- unsigned char value = MI->getOperand(OpNo).getImm();
- assert(value <= 63 && "Invalid u6imm argument!");
- O << (unsigned int)value;
- }
- void printS16ImmOperand(const MachineInstr *MI, unsigned OpNo) {
- O << (short)MI->getOperand(OpNo).getImm();
- }
- void printU16ImmOperand(const MachineInstr *MI, unsigned OpNo) {
- O << (unsigned short)MI->getOperand(OpNo).getImm();
- }
- void printS16X4ImmOperand(const MachineInstr *MI, unsigned OpNo) {
- if (MI->getOperand(OpNo).isImmediate()) {
- O << (short)(MI->getOperand(OpNo).getImm()*4);
- } else {
- O << "lo16(";
- printOp(MI->getOperand(OpNo));
- if (TM.getRelocationModel() == Reloc::PIC_)
- O << "-\"L" << getFunctionNumber() << "$pb\")";
- else
- O << ')';
- }
- }
- void printBranchOperand(const MachineInstr *MI, unsigned OpNo) {
- // Branches can take an immediate operand. This is used by the branch
- // selection pass to print $+8, an eight byte displacement from the PC.
- if (MI->getOperand(OpNo).isImmediate()) {
- O << "$+" << MI->getOperand(OpNo).getImm()*4;
- } else {
- printOp(MI->getOperand(OpNo));
- }
- }
- void printCallOperand(const MachineInstr *MI, unsigned OpNo) {
- const MachineOperand &MO = MI->getOperand(OpNo);
- if (TM.getRelocationModel() != Reloc::Static) {
- if (MO.getType() == MachineOperand::MO_GlobalAddress) {
- GlobalValue *GV = MO.getGlobal();
- if (((GV->isDeclaration() || GV->hasWeakLinkage() ||
- GV->hasLinkOnceLinkage()))) {
- // Dynamically-resolved functions need a stub for the function.
- std::string Name = Mang->getValueName(GV);
- FnStubs.insert(Name);
- O << "L" << Name << "$stub";
- if (GV->hasExternalWeakLinkage())
- ExtWeakSymbols.insert(GV);
- return;
- }
- }
- if (MO.getType() == MachineOperand::MO_ExternalSymbol) {
- std::string Name(TAI->getGlobalPrefix()); Name += MO.getSymbolName();
- FnStubs.insert(Name);
- O << "L" << Name << "$stub";
- return;
- }
- }
-
- printOp(MI->getOperand(OpNo));
- }
- void printAbsAddrOperand(const MachineInstr *MI, unsigned OpNo) {
- O << (int)MI->getOperand(OpNo).getImm()*4;
- }
- void printPICLabel(const MachineInstr *MI, unsigned OpNo) {
- O << "\"L" << getFunctionNumber() << "$pb\"\n";
- O << "\"L" << getFunctionNumber() << "$pb\":";
- }
- void printSymbolHi(const MachineInstr *MI, unsigned OpNo) {
- if (MI->getOperand(OpNo).isImmediate()) {
- printS16ImmOperand(MI, OpNo);
- } else {
- if (Subtarget.isDarwin()) O << "ha16(";
- printOp(MI->getOperand(OpNo));
- if (TM.getRelocationModel() == Reloc::PIC_)
- O << "-\"L" << getFunctionNumber() << "$pb\"";
- if (Subtarget.isDarwin())
- O << ')';
- else
- O << "@ha";
- }
- }
- void printSymbolLo(const MachineInstr *MI, unsigned OpNo) {
- if (MI->getOperand(OpNo).isImmediate()) {
- printS16ImmOperand(MI, OpNo);
- } else {
- if (Subtarget.isDarwin()) O << "lo16(";
- printOp(MI->getOperand(OpNo));
- if (TM.getRelocationModel() == Reloc::PIC_)
- O << "-\"L" << getFunctionNumber() << "$pb\"";
- if (Subtarget.isDarwin())
- O << ')';
- else
- O << "@l";
- }
- }
- void printcrbitm(const MachineInstr *MI, unsigned OpNo) {
- unsigned CCReg = MI->getOperand(OpNo).getReg();
- unsigned RegNo = enumRegToMachineReg(CCReg);
- O << (0x80 >> RegNo);
- }
- // The new addressing mode printers.
- void printMemRegImm(const MachineInstr *MI, unsigned OpNo) {
- printSymbolLo(MI, OpNo);
- O << '(';
- if (MI->getOperand(OpNo+1).isRegister() &&
- MI->getOperand(OpNo+1).getReg() == PPC::R0)
- O << "0";
- else
- printOperand(MI, OpNo+1);
- O << ')';
- }
- void printMemRegImmShifted(const MachineInstr *MI, unsigned OpNo) {
- if (MI->getOperand(OpNo).isImmediate())
- printS16X4ImmOperand(MI, OpNo);
- else
- printSymbolLo(MI, OpNo);
- O << '(';
- if (MI->getOperand(OpNo+1).isRegister() &&
- MI->getOperand(OpNo+1).getReg() == PPC::R0)
- O << "0";
- else
- printOperand(MI, OpNo+1);
- O << ')';
- }
-
- void printMemRegReg(const MachineInstr *MI, unsigned OpNo) {
- // When used as the base register, r0 reads constant zero rather than
- // the value contained in the register. For this reason, the darwin
- // assembler requires that we print r0 as 0 (no r) when used as the base.
- const MachineOperand &MO = MI->getOperand(OpNo);
- printRegister(MO, true);
- O << ", ";
- printOperand(MI, OpNo+1);
- }
-
- void printPredicateOperand(const MachineInstr *MI, unsigned OpNo,
- const char *Modifier);
-
- virtual bool runOnMachineFunction(MachineFunction &F) = 0;
- virtual bool doFinalization(Module &M) = 0;
-
- virtual void EmitExternalGlobal(const GlobalVariable *GV);
- };
-
- /// LinuxAsmPrinter - PowerPC assembly printer, customized for Linux
- struct VISIBILITY_HIDDEN LinuxAsmPrinter : public PPCAsmPrinter {
-
- DwarfWriter DW;
-
- LinuxAsmPrinter(std::ostream &O, PPCTargetMachine &TM,
- const TargetAsmInfo *T)
- : PPCAsmPrinter(O, TM, T), DW(O, this, T) {
- }
-
- virtual const char *getPassName() const {
- return "Linux PPC Assembly Printer";
- }
-
- bool runOnMachineFunction(MachineFunction &F);
- bool doInitialization(Module &M);
- bool doFinalization(Module &M);
-
- void getAnalysisUsage(AnalysisUsage &AU) const {
- AU.setPreservesAll();
- AU.addRequired<MachineModuleInfo>();
- PPCAsmPrinter::getAnalysisUsage(AU);
- }
-
- /// getSectionForFunction - Return the section that we should emit the
- /// specified function body into.
- virtual std::string getSectionForFunction(const Function &F) const;
- };
-
- /// DarwinAsmPrinter - PowerPC assembly printer, customized for Darwin/Mac OS
- /// X
- struct VISIBILITY_HIDDEN DarwinAsmPrinter : public PPCAsmPrinter {
-
- DwarfWriter DW;
- MachineModuleInfo *MMI;
-
- DarwinAsmPrinter(std::ostream &O, PPCTargetMachine &TM,
- const TargetAsmInfo *T)
- : PPCAsmPrinter(O, TM, T), DW(O, this, T), MMI(0) {
- }
-
- virtual const char *getPassName() const {
- return "Darwin PPC Assembly Printer";
- }
-
- bool runOnMachineFunction(MachineFunction &F);
- bool doInitialization(Module &M);
- bool doFinalization(Module &M);
-
- void getAnalysisUsage(AnalysisUsage &AU) const {
- AU.setPreservesAll();
- AU.addRequired<MachineModuleInfo>();
- PPCAsmPrinter::getAnalysisUsage(AU);
- }
-
- /// getSectionForFunction - Return the section that we should emit the
- /// specified function body into.
- virtual std::string getSectionForFunction(const Function &F) const;
- };
-} // end of anonymous namespace
-
-// Include the auto-generated portion of the assembly writer
-#include "PPCGenAsmWriter.inc"
-
-void PPCAsmPrinter::printOp(const MachineOperand &MO) {
- switch (MO.getType()) {
- case MachineOperand::MO_Immediate:
- cerr << "printOp() does not handle immediate values\n";
- abort();
- return;
-
- case MachineOperand::MO_MachineBasicBlock:
- printBasicBlockLabel(MO.getMBB());
- return;
- case MachineOperand::MO_JumpTableIndex:
- O << TAI->getPrivateGlobalPrefix() << "JTI" << getFunctionNumber()
- << '_' << MO.getIndex();
- // FIXME: PIC relocation model
- return;
- case MachineOperand::MO_ConstantPoolIndex:
- O << TAI->getPrivateGlobalPrefix() << "CPI" << getFunctionNumber()
- << '_' << MO.getIndex();
- return;
- case MachineOperand::MO_ExternalSymbol:
- // Computing the address of an external symbol, not calling it.
- if (TM.getRelocationModel() != Reloc::Static) {
- std::string Name(TAI->getGlobalPrefix()); Name += MO.getSymbolName();
- GVStubs.insert(Name);
- O << "L" << Name << "$non_lazy_ptr";
- return;
- }
- O << TAI->getGlobalPrefix() << MO.getSymbolName();
- return;
- case MachineOperand::MO_GlobalAddress: {
- // Computing the address of a global symbol, not calling it.
- GlobalValue *GV = MO.getGlobal();
- std::string Name = Mang->getValueName(GV);
-
- // External or weakly linked global variables need non-lazily-resolved stubs
- if (TM.getRelocationModel() != Reloc::Static) {
- if (((GV->isDeclaration() || GV->hasWeakLinkage() ||
- GV->hasLinkOnceLinkage()))) {
- GVStubs.insert(Name);
- O << "L" << Name << "$non_lazy_ptr";
- return;
- }
- }
- O << Name;
-
- if (MO.getOffset() > 0)
- O << "+" << MO.getOffset();
- else if (MO.getOffset() < 0)
- O << MO.getOffset();
-
- if (GV->hasExternalWeakLinkage())
- ExtWeakSymbols.insert(GV);
- return;
- }
-
- default:
- O << "<unknown operand type: " << MO.getType() << ">";
- return;
- }
-}
-
-/// EmitExternalGlobal - In this case we need to use the indirect symbol.
-///
-void PPCAsmPrinter::EmitExternalGlobal(const GlobalVariable *GV) {
- std::string Name = getGlobalLinkName(GV);
- if (TM.getRelocationModel() != Reloc::Static) {
- GVStubs.insert(Name);
- O << "L" << Name << "$non_lazy_ptr";
- return;
- }
- O << Name;
-}
-
-/// PrintAsmOperand - Print out an operand for an inline asm expression.
-///
-bool PPCAsmPrinter::PrintAsmOperand(const MachineInstr *MI, unsigned OpNo,
- unsigned AsmVariant,
- const char *ExtraCode) {
- // Does this asm operand have a single letter operand modifier?
- if (ExtraCode && ExtraCode[0]) {
- if (ExtraCode[1] != 0) return true; // Unknown modifier.
-
- switch (ExtraCode[0]) {
- default: return true; // Unknown modifier.
- case 'c': // Don't print "$" before a global var name or constant.
- // PPC never has a prefix.
- printOperand(MI, OpNo);
- return false;
- case 'L': // Write second word of DImode reference.
- // Verify that this operand has two consecutive registers.
- if (!MI->getOperand(OpNo).isRegister() ||
- OpNo+1 == MI->getNumOperands() ||
- !MI->getOperand(OpNo+1).isRegister())
- return true;
- ++OpNo; // Return the high-part.
- break;
- case 'I':
- // Write 'i' if an integer constant, otherwise nothing. Used to print
- // addi vs add, etc.
- if (MI->getOperand(OpNo).isImmediate())
- O << "i";
- return false;
- }
- }
-
- printOperand(MI, OpNo);
- return false;
-}
-
-bool PPCAsmPrinter::PrintAsmMemoryOperand(const MachineInstr *MI, unsigned OpNo,
- unsigned AsmVariant,
- const char *ExtraCode) {
- if (ExtraCode && ExtraCode[0])
- return true; // Unknown modifier.
- if (MI->getOperand(OpNo).isRegister())
- printMemRegReg(MI, OpNo);
- else
- printMemRegImm(MI, OpNo);
- return false;
-}
-
-void PPCAsmPrinter::printPredicateOperand(const MachineInstr *MI, unsigned OpNo,
- const char *Modifier) {
- assert(Modifier && "Must specify 'cc' or 'reg' as predicate op modifier!");
- unsigned Code = MI->getOperand(OpNo).getImm();
- if (!strcmp(Modifier, "cc")) {
- switch ((PPC::Predicate)Code) {
- case PPC::PRED_ALWAYS: return; // Don't print anything for always.
- case PPC::PRED_LT: O << "lt"; return;
- case PPC::PRED_LE: O << "le"; return;
- case PPC::PRED_EQ: O << "eq"; return;
- case PPC::PRED_GE: O << "ge"; return;
- case PPC::PRED_GT: O << "gt"; return;
- case PPC::PRED_NE: O << "ne"; return;
- case PPC::PRED_UN: O << "un"; return;
- case PPC::PRED_NU: O << "nu"; return;
- }
-
- } else {
- assert(!strcmp(Modifier, "reg") &&
- "Need to specify 'cc' or 'reg' as predicate op modifier!");
- // Don't print the register for 'always'.
- if (Code == PPC::PRED_ALWAYS) return;
- printOperand(MI, OpNo+1);
- }
-}
-
-
-/// printMachineInstruction -- Print out a single PowerPC MI in Darwin syntax to
-/// the current output stream.
-///
-void PPCAsmPrinter::printMachineInstruction(const MachineInstr *MI) {
- ++EmittedInsts;
-
- // Check for slwi/srwi mnemonics.
- if (MI->getOpcode() == PPC::RLWINM) {
- bool FoundMnemonic = false;
- unsigned char SH = MI->getOperand(2).getImm();
- unsigned char MB = MI->getOperand(3).getImm();
- unsigned char ME = MI->getOperand(4).getImm();
- if (SH <= 31 && MB == 0 && ME == (31-SH)) {
- O << "\tslwi "; FoundMnemonic = true;
- }
- if (SH <= 31 && MB == (32-SH) && ME == 31) {
- O << "\tsrwi "; FoundMnemonic = true;
- SH = 32-SH;
- }
- if (FoundMnemonic) {
- printOperand(MI, 0);
- O << ", ";
- printOperand(MI, 1);
- O << ", " << (unsigned int)SH << "\n";
- return;
- }
- } else if (MI->getOpcode() == PPC::OR || MI->getOpcode() == PPC::OR8) {
- if (MI->getOperand(1).getReg() == MI->getOperand(2).getReg()) {
- O << "\tmr ";
- printOperand(MI, 0);
- O << ", ";
- printOperand(MI, 1);
- O << "\n";
- return;
- }
- } else if (MI->getOpcode() == PPC::RLDICR) {
- unsigned char SH = MI->getOperand(2).getImm();
- unsigned char ME = MI->getOperand(3).getImm();
- // rldicr RA, RS, SH, 63-SH == sldi RA, RS, SH
- if (63-SH == ME) {
- O << "\tsldi ";
- printOperand(MI, 0);
- O << ", ";
- printOperand(MI, 1);
- O << ", " << (unsigned int)SH << "\n";
- return;
- }
- }
-
- if (printInstruction(MI))
- return; // Printer was automatically generated
-
- assert(0 && "Unhandled instruction in asm writer!");
- abort();
- return;
-}
-
-/// runOnMachineFunction - This uses the printMachineInstruction()
-/// method to print assembly for each instruction.
-///
-bool LinuxAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
- DW.SetModuleInfo(&getAnalysis<MachineModuleInfo>());
-
- SetupMachineFunction(MF);
- O << "\n\n";
-
- // Print out constants referenced by the function
- EmitConstantPool(MF.getConstantPool());
-
- // Print out labels for the function.
- const Function *F = MF.getFunction();
- SwitchToTextSection(getSectionForFunction(*F).c_str(), F);
-
- switch (F->getLinkage()) {
- default: assert(0 && "Unknown linkage type!");
- case Function::InternalLinkage: // Symbols default to internal.
- break;
- case Function::ExternalLinkage:
- O << "\t.global\t" << CurrentFnName << '\n'
- << "\t.type\t" << CurrentFnName << ", @function\n";
- break;
- case Function::WeakLinkage:
- case Function::LinkOnceLinkage:
- O << "\t.global\t" << CurrentFnName << '\n';
- O << "\t.weak\t" << CurrentFnName << '\n';
- break;
- }
-
- if (F->hasHiddenVisibility())
- if (const char *Directive = TAI->getHiddenDirective())
- O << Directive << CurrentFnName << "\n";
-
- EmitAlignment(2, F);
- O << CurrentFnName << ":\n";
-
- // Emit pre-function debug information.
- DW.BeginFunction(&MF);
-
- // Print out code for the function.
- for (MachineFunction::const_iterator I = MF.begin(), E = MF.end();
- I != E; ++I) {
- // Print a label for the basic block.
- if (I != MF.begin()) {
- printBasicBlockLabel(I, true, true);
- O << '\n';
- }
- for (MachineBasicBlock::const_iterator II = I->begin(), E = I->end();
- II != E; ++II) {
- // Print the assembly for the instruction.
- printMachineInstruction(II);
- }
- }
-
- O << "\t.size\t" << CurrentFnName << ",.-" << CurrentFnName << "\n";
-
- // Print out jump tables referenced by the function.
- EmitJumpTableInfo(MF.getJumpTableInfo(), MF);
-
- // Emit post-function debug information.
- DW.EndFunction();
-
- // We didn't modify anything.
- return false;
-}
-
-bool LinuxAsmPrinter::doInitialization(Module &M) {
- bool Result = AsmPrinter::doInitialization(M);
-
- // GNU as handles section names wrapped in quotes
- Mang->setUseQuotes(true);
-
- SwitchToTextSection(TAI->getTextSection());
-
- // Emit initial debug information.
- DW.BeginModule(&M);
- return Result;
-}
-
-/// PrintUnmangledNameSafely - Print out the printable characters in the name.
-/// Don't print things like \n or \0.
-static void PrintUnmangledNameSafely(const Value *V, std::ostream &OS) {
- for (const char *Name = V->getNameStart(), *E = Name+V->getNameLen();
- Name != E; ++Name)
- if (isprint(*Name))
- OS << *Name;
-}
-
-bool LinuxAsmPrinter::doFinalization(Module &M) {
- const TargetData *TD = TM.getTargetData();
-
- // Print out module-level global variables here.
- for (Module::const_global_iterator I = M.global_begin(), E = M.global_end();
- I != E; ++I) {
- if (!I->hasInitializer()) continue; // External global require no code
-
- // Check to see if this is a special global used by LLVM, if so, emit it.
- if (EmitSpecialLLVMGlobal(I))
- continue;
-
- std::string name = Mang->getValueName(I);
-
- if (I->hasHiddenVisibility())
- if (const char *Directive = TAI->getHiddenDirective())
- O << Directive << name << "\n";
-
- Constant *C = I->getInitializer();
- unsigned Size = TD->getABITypeSize(C->getType());
- unsigned Align = TD->getPreferredAlignmentLog(I);
-
- if (C->isNullValue() && /* FIXME: Verify correct */
- !I->hasSection() &&
- (I->hasInternalLinkage() || I->hasWeakLinkage() ||
- I->hasLinkOnceLinkage() || I->hasExternalLinkage())) {
- if (Size == 0) Size = 1; // .comm Foo, 0 is undefined, avoid it.
- if (I->hasExternalLinkage()) {
- O << "\t.global " << name << '\n';
- O << "\t.type " << name << ", @object\n";
- if (TAI->getBSSSection())
- SwitchToDataSection(TAI->getBSSSection(), I);
- O << name << ":\n";
- O << "\t.zero " << Size << "\n";
- } else if (I->hasInternalLinkage()) {
- SwitchToDataSection("\t.data", I);
- O << TAI->getLCOMMDirective() << name << "," << Size;
- } else {
- SwitchToDataSection("\t.data", I);
- O << ".comm " << name << "," << Size;
- }
- O << "\t\t" << TAI->getCommentString() << " '";
- PrintUnmangledNameSafely(I, O);
- O << "'\n";
- } else {
- switch (I->getLinkage()) {
- case GlobalValue::LinkOnceLinkage:
- case GlobalValue::WeakLinkage:
- O << "\t.global " << name << '\n'
- << "\t.type " << name << ", @object\n"
- << "\t.weak " << name << '\n';
- SwitchToDataSection("\t.data", I);
- break;
- case GlobalValue::AppendingLinkage:
- // FIXME: appending linkage variables should go into a section of
- // their name or something. For now, just emit them as external.
- case GlobalValue::ExternalLinkage:
- // If external or appending, declare as a global symbol
- O << "\t.global " << name << "\n"
- << "\t.type " << name << ", @object\n";
- // FALL THROUGH
- case GlobalValue::InternalLinkage:
- if (I->isConstant()) {
- const ConstantArray *CVA = dyn_cast<ConstantArray>(C);
- if (TAI->getCStringSection() && CVA && CVA->isCString()) {
- SwitchToDataSection(TAI->getCStringSection(), I);
- break;
- }
- }
-
- // FIXME: special handling for ".ctors" & ".dtors" sections
- if (I->hasSection() &&
- (I->getSection() == ".ctors" ||
- I->getSection() == ".dtors")) {
- std::string SectionName = ".section " + I->getSection()
- + ",\"aw\",@progbits";
- SwitchToDataSection(SectionName.c_str());
- } else {
- if (I->isConstant() && TAI->getReadOnlySection())
- SwitchToDataSection(TAI->getReadOnlySection(), I);
- else
- SwitchToDataSection(TAI->getDataSection(), I);
- }
- break;
- default:
- cerr << "Unknown linkage type!";
- abort();
- }
-
- EmitAlignment(Align, I);
- O << name << ":\t\t\t\t" << TAI->getCommentString() << " '";
- PrintUnmangledNameSafely(I, O);
- O << "'\n";
-
- // If the initializer is a extern weak symbol, remember to emit the weak
- // reference!
- if (const GlobalValue *GV = dyn_cast<GlobalValue>(C))
- if (GV->hasExternalWeakLinkage())
- ExtWeakSymbols.insert(GV);
-
- EmitGlobalConstant(C);
- O << '\n';
- }
- }
-
- // TODO
-
- // Emit initial debug information.
- DW.EndModule();
-
- return AsmPrinter::doFinalization(M);
-}
-
-std::string LinuxAsmPrinter::getSectionForFunction(const Function &F) const {
- switch (F.getLinkage()) {
- default: assert(0 && "Unknown linkage type!");
- case Function::ExternalLinkage:
- case Function::InternalLinkage: return TAI->getTextSection();
- case Function::WeakLinkage:
- case Function::LinkOnceLinkage:
- return ".text";
- }
-}
-
-std::string DarwinAsmPrinter::getSectionForFunction(const Function &F) const {
- switch (F.getLinkage()) {
- default: assert(0 && "Unknown linkage type!");
- case Function::ExternalLinkage:
- case Function::InternalLinkage: return TAI->getTextSection();
- case Function::WeakLinkage:
- case Function::LinkOnceLinkage:
- return "\t.section __TEXT,__textcoal_nt,coalesced,pure_instructions";
- }
-}
-
-/// runOnMachineFunction - This uses the printMachineInstruction()
-/// method to print assembly for each instruction.
-///
-bool DarwinAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
- // We need this for Personality functions.
- MMI = &getAnalysis<MachineModuleInfo>();
- DW.SetModuleInfo(MMI);
-
- SetupMachineFunction(MF);
- O << "\n\n";
-
- // Print out constants referenced by the function
- EmitConstantPool(MF.getConstantPool());
-
- // Print out labels for the function.
- const Function *F = MF.getFunction();
- SwitchToTextSection(getSectionForFunction(*F).c_str(), F);
-
- switch (F->getLinkage()) {
- default: assert(0 && "Unknown linkage type!");
- case Function::InternalLinkage: // Symbols default to internal.
- break;
- case Function::ExternalLinkage:
- O << "\t.globl\t" << CurrentFnName << "\n";
- break;
- case Function::WeakLinkage:
- case Function::LinkOnceLinkage:
- O << "\t.globl\t" << CurrentFnName << "\n";
- O << "\t.weak_definition\t" << CurrentFnName << "\n";
- break;
- }
-
- if (F->hasHiddenVisibility())
- if (const char *Directive = TAI->getHiddenDirective())
- O << Directive << CurrentFnName << "\n";
-
- EmitAlignment(OptimizeForSize ? 2 : 4, F);
- O << CurrentFnName << ":\n";
-
- // Emit pre-function debug information.
- DW.BeginFunction(&MF);
-
- // If the function is empty, then we need to emit *something*. Otherwise, the
- // function's label might be associated with something that it wasn't meant to
- // be associated with. We emit a noop in this situation.
- MachineFunction::iterator I = MF.begin();
-
- if (++I == MF.end() && MF.front().empty())
- O << "\tnop\n";
-
- // Print out code for the function.
- for (MachineFunction::const_iterator I = MF.begin(), E = MF.end();
- I != E; ++I) {
- // Print a label for the basic block.
- if (I != MF.begin()) {
- printBasicBlockLabel(I, true, true);
- O << '\n';
- }
- for (MachineBasicBlock::const_iterator II = I->begin(), IE = I->end();
- II != IE; ++II) {
- // Print the assembly for the instruction.
- printMachineInstruction(II);
- }
- }
-
- // Print out jump tables referenced by the function.
- EmitJumpTableInfo(MF.getJumpTableInfo(), MF);
-
- // Emit post-function debug information.
- DW.EndFunction();
-
- // We didn't modify anything.
- return false;
-}
-
-
-bool DarwinAsmPrinter::doInitialization(Module &M) {
- static const char *const CPUDirectives[] = {
- "",
- "ppc",
- "ppc601",
- "ppc602",
- "ppc603",
- "ppc7400",
- "ppc750",
- "ppc970",
- "ppc64"
- };
-
- unsigned Directive = Subtarget.getDarwinDirective();
- if (Subtarget.isGigaProcessor() && Directive < PPC::DIR_970)
- Directive = PPC::DIR_970;
- if (Subtarget.hasAltivec() && Directive < PPC::DIR_7400)
- Directive = PPC::DIR_7400;
- if (Subtarget.isPPC64() && Directive < PPC::DIR_970)
- Directive = PPC::DIR_64;
- assert(Directive <= PPC::DIR_64 && "Directive out of range.");
- O << "\t.machine " << CPUDirectives[Directive] << "\n";
-
- bool Result = AsmPrinter::doInitialization(M);
-
- // Darwin wants symbols to be quoted if they have complex names.
- Mang->setUseQuotes(true);
-
- // Prime text sections so they are adjacent. This reduces the likelihood a
- // large data or debug section causes a branch to exceed 16M limit.
- SwitchToTextSection("\t.section __TEXT,__textcoal_nt,coalesced,"
- "pure_instructions");
- if (TM.getRelocationModel() == Reloc::PIC_) {
- SwitchToTextSection("\t.section __TEXT,__picsymbolstub1,symbol_stubs,"
- "pure_instructions,32");
- } else if (TM.getRelocationModel() == Reloc::DynamicNoPIC) {
- SwitchToTextSection("\t.section __TEXT,__symbol_stub1,symbol_stubs,"
- "pure_instructions,16");
- }
- SwitchToTextSection(TAI->getTextSection());
-
- // Emit initial debug information.
- DW.BeginModule(&M);
- return Result;
-}
-
-bool DarwinAsmPrinter::doFinalization(Module &M) {
- const TargetData *TD = TM.getTargetData();
-
- // Print out module-level global variables here.
- for (Module::const_global_iterator I = M.global_begin(), E = M.global_end();
- I != E; ++I) {
- if (!I->hasInitializer()) continue; // External global require no code
-
- // Check to see if this is a special global used by LLVM, if so, emit it.
- if (EmitSpecialLLVMGlobal(I)) {
- if (TM.getRelocationModel() == Reloc::Static) {
- if (I->getName() == "llvm.global_ctors")
- O << ".reference .constructors_used\n";
- else if (I->getName() == "llvm.global_dtors")
- O << ".reference .destructors_used\n";
- }
- continue;
- }
-
- std::string name = Mang->getValueName(I);
-
- if (I->hasHiddenVisibility())
- if (const char *Directive = TAI->getHiddenDirective())
- O << Directive << name << "\n";
-
- Constant *C = I->getInitializer();
- const Type *Type = C->getType();
- unsigned Size = TD->getABITypeSize(Type);
- unsigned Align = TD->getPreferredAlignmentLog(I);
-
- if (C->isNullValue() && /* FIXME: Verify correct */
- !I->hasSection() &&
- (I->hasInternalLinkage() || I->hasWeakLinkage() ||
- I->hasLinkOnceLinkage() || I->hasExternalLinkage())) {
- if (Size == 0) Size = 1; // .comm Foo, 0 is undefined, avoid it.
- if (I->hasExternalLinkage()) {
- O << "\t.globl " << name << '\n';
- O << "\t.zerofill __DATA, __common, " << name << ", "
- << Size << ", " << Align;
- } else if (I->hasInternalLinkage()) {
- SwitchToDataSection("\t.data", I);
- O << TAI->getLCOMMDirective() << name << "," << Size << "," << Align;
- } else {
- SwitchToDataSection("\t.data", I);
- O << ".comm " << name << "," << Size;
- // Darwin 9 and above support aligned common data.
- if (Subtarget.isDarwin9())
- O << "," << Align;
- }
- O << "\t\t" << TAI->getCommentString() << " '";
- PrintUnmangledNameSafely(I, O);
- O << "'\n";
- } else {
- switch (I->getLinkage()) {
- case GlobalValue::LinkOnceLinkage:
- case GlobalValue::WeakLinkage:
- O << "\t.globl " << name << '\n'
- << "\t.weak_definition " << name << '\n';
- SwitchToDataSection("\t.section __DATA,__datacoal_nt,coalesced", I);
- break;
- case GlobalValue::AppendingLinkage:
- // FIXME: appending linkage variables should go into a section of
- // their name or something. For now, just emit them as external.
- case GlobalValue::ExternalLinkage:
- // If external or appending, declare as a global symbol
- O << "\t.globl " << name << "\n";
- // FALL THROUGH
- case GlobalValue::InternalLinkage:
- if (I->isConstant()) {
- const ConstantArray *CVA = dyn_cast<ConstantArray>(C);
- if (TAI->getCStringSection() && CVA && CVA->isCString()) {
- SwitchToDataSection(TAI->getCStringSection(), I);
- break;
- }
- }
- if (I->hasSection()) {
- // Honor all section names on Darwin; ObjC uses this
- std::string SectionName = ".section " + I->getSection();
- SwitchToDataSection(SectionName.c_str());
- } else if (!I->isConstant())
- SwitchToDataSection(TAI->getDataSection(), I);
- else {
- // Read-only data.
- bool HasReloc = C->ContainsRelocations();
- if (HasReloc &&
- TM.getRelocationModel() != Reloc::Static)
- SwitchToDataSection("\t.const_data\n");
- else if (!HasReloc && Size == 4 &&
- TAI->getFourByteConstantSection())
- SwitchToDataSection(TAI->getFourByteConstantSection(), I);
- else if (!HasReloc && Size == 8 &&
- TAI->getEightByteConstantSection())
- SwitchToDataSection(TAI->getEightByteConstantSection(), I);
- else if (!HasReloc && Size == 16 &&
- TAI->getSixteenByteConstantSection())
- SwitchToDataSection(TAI->getSixteenByteConstantSection(), I);
- else if (TAI->getReadOnlySection())
- SwitchToDataSection(TAI->getReadOnlySection(), I);
- else
- SwitchToDataSection(TAI->getDataSection(), I);
- }
- break;
- default:
- cerr << "Unknown linkage type!";
- abort();
- }
-
- EmitAlignment(Align, I);
- O << name << ":\t\t\t\t" << TAI->getCommentString() << " '";
- PrintUnmangledNameSafely(I, O);
- O << "'\n";
-
- // If the initializer is a extern weak symbol, remember to emit the weak
- // reference!
- if (const GlobalValue *GV = dyn_cast<GlobalValue>(C))
- if (GV->hasExternalWeakLinkage())
- ExtWeakSymbols.insert(GV);
-
- EmitGlobalConstant(C);
- O << '\n';
- }
- }
-
- bool isPPC64 = TD->getPointerSizeInBits() == 64;
-
- // Output stubs for dynamically-linked functions
- if (TM.getRelocationModel() == Reloc::PIC_) {
- for (std::set<std::string>::iterator i = FnStubs.begin(), e = FnStubs.end();
- i != e; ++i) {
- SwitchToTextSection("\t.section __TEXT,__picsymbolstub1,symbol_stubs,"
- "pure_instructions,32");
- EmitAlignment(4);
- O << "L" << *i << "$stub:\n";
- O << "\t.indirect_symbol " << *i << "\n";
- O << "\tmflr r0\n";
- O << "\tbcl 20,31,L0$" << *i << "\n";
- O << "L0$" << *i << ":\n";
- O << "\tmflr r11\n";
- O << "\taddis r11,r11,ha16(L" << *i << "$lazy_ptr-L0$" << *i << ")\n";
- O << "\tmtlr r0\n";
- if (isPPC64)
- O << "\tldu r12,lo16(L" << *i << "$lazy_ptr-L0$" << *i << ")(r11)\n";
- else
- O << "\tlwzu r12,lo16(L" << *i << "$lazy_ptr-L0$" << *i << ")(r11)\n";
- O << "\tmtctr r12\n";
- O << "\tbctr\n";
- SwitchToDataSection(".lazy_symbol_pointer");
- O << "L" << *i << "$lazy_ptr:\n";
- O << "\t.indirect_symbol " << *i << "\n";
- if (isPPC64)
- O << "\t.quad dyld_stub_binding_helper\n";
- else
- O << "\t.long dyld_stub_binding_helper\n";
- }
- } else {
- for (std::set<std::string>::iterator i = FnStubs.begin(), e = FnStubs.end();
- i != e; ++i) {
- SwitchToTextSection("\t.section __TEXT,__symbol_stub1,symbol_stubs,"
- "pure_instructions,16");
- EmitAlignment(4);
- O << "L" << *i << "$stub:\n";
- O << "\t.indirect_symbol " << *i << "\n";
- O << "\tlis r11,ha16(L" << *i << "$lazy_ptr)\n";
- if (isPPC64)
- O << "\tldu r12,lo16(L" << *i << "$lazy_ptr)(r11)\n";
- else
- O << "\tlwzu r12,lo16(L" << *i << "$lazy_ptr)(r11)\n";
- O << "\tmtctr r12\n";
- O << "\tbctr\n";
- SwitchToDataSection(".lazy_symbol_pointer");
- O << "L" << *i << "$lazy_ptr:\n";
- O << "\t.indirect_symbol " << *i << "\n";
- if (isPPC64)
- O << "\t.quad dyld_stub_binding_helper\n";
- else
- O << "\t.long dyld_stub_binding_helper\n";
- }
- }
-
- O << "\n";
-
- if (TAI->doesSupportExceptionHandling() && MMI) {
- // Add the (possibly multiple) personalities to the set of global values.
- // Only referenced functions get into the Personalities list.
- const std::vector<Function *>& Personalities = MMI->getPersonalities();
-
- for (std::vector<Function *>::const_iterator I = Personalities.begin(),
- E = Personalities.end(); I != E; ++I)
- if (*I) GVStubs.insert("_" + (*I)->getName());
- }
-
- // Output stubs for external and common global variables.
- if (!GVStubs.empty()) {
- SwitchToDataSection(".non_lazy_symbol_pointer");
- for (std::set<std::string>::iterator I = GVStubs.begin(),
- E = GVStubs.end(); I != E; ++I) {
- O << "L" << *I << "$non_lazy_ptr:\n";
- O << "\t.indirect_symbol " << *I << "\n";
- if (isPPC64)
- O << "\t.quad\t0\n";
- else
- O << "\t.long\t0\n";
-
- }
- }
-
- // Emit initial debug information.
- DW.EndModule();
-
- // Funny Darwin hack: This flag tells the linker that no global symbols
- // contain code that falls through to other global symbols (e.g. the obvious
- // implementation of multiple entry points). If this doesn't occur, the
- // linker can safely perform dead code stripping. Since LLVM never generates
- // code that does this, it is always safe to set.
- O << "\t.subsections_via_symbols\n";
-
- return AsmPrinter::doFinalization(M);
-}
-
-
-
-/// createPPCAsmPrinterPass - Returns a pass that prints the PPC assembly code
-/// for a MachineFunction to the given output stream, in a format that the
-/// Darwin assembler can deal with.
-///
-FunctionPass *llvm::createPPCAsmPrinterPass(std::ostream &o,
- PPCTargetMachine &tm) {
- const PPCSubtarget *Subtarget = &tm.getSubtarget<PPCSubtarget>();
-
- if (Subtarget->isDarwin()) {
- return new DarwinAsmPrinter(o, tm, tm.getTargetAsmInfo());
- } else {
- return new LinuxAsmPrinter(o, tm, tm.getTargetAsmInfo());
- }
-}
-
diff --git a/release_23/lib/Target/PowerPC/PPCBranchSelector.cpp b/release_23/lib/Target/PowerPC/PPCBranchSelector.cpp
deleted file mode 100644
index ab988ba823ee..000000000000
--- a/release_23/lib/Target/PowerPC/PPCBranchSelector.cpp
+++ /dev/null
@@ -1,173 +0,0 @@
-//===-- PPCBranchSelector.cpp - Emit long conditional branches-----*- C++ -*-=//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains a pass that scans a machine function to determine which
-// conditional branches need more than 16 bits of displacement to reach their
-// target basic block. It does this in two passes; a calculation of basic block
-// positions pass, and a branch psuedo op to machine branch opcode pass. This
-// pass should be run last, just before the assembly printer.
-//
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "ppc-branch-select"
-#include "PPC.h"
-#include "PPCInstrBuilder.h"
-#include "PPCInstrInfo.h"
-#include "PPCPredicates.h"
-#include "llvm/CodeGen/MachineFunctionPass.h"
-#include "llvm/Target/TargetMachine.h"
-#include "llvm/ADT/Statistic.h"
-#include "llvm/Support/Compiler.h"
-#include "llvm/Support/MathExtras.h"
-using namespace llvm;
-
-STATISTIC(NumExpanded, "Number of branches expanded to long format");
-
-namespace {
- struct VISIBILITY_HIDDEN PPCBSel : public MachineFunctionPass {
- static char ID;
- PPCBSel() : MachineFunctionPass((intptr_t)&ID) {}
-
- /// BlockSizes - The sizes of the basic blocks in the function.
- std::vector<unsigned> BlockSizes;
-
- virtual bool runOnMachineFunction(MachineFunction &Fn);
-
- virtual const char *getPassName() const {
- return "PowerPC Branch Selector";
- }
- };
- char PPCBSel::ID = 0;
-}
-
-/// createPPCBranchSelectionPass - returns an instance of the Branch Selection
-/// Pass
-///
-FunctionPass *llvm::createPPCBranchSelectionPass() {
- return new PPCBSel();
-}
-
-bool PPCBSel::runOnMachineFunction(MachineFunction &Fn) {
- const TargetInstrInfo *TII = Fn.getTarget().getInstrInfo();
- // Give the blocks of the function a dense, in-order, numbering.
- Fn.RenumberBlocks();
- BlockSizes.resize(Fn.getNumBlockIDs());
-
- // Measure each MBB and compute a size for the entire function.
- unsigned FuncSize = 0;
- for (MachineFunction::iterator MFI = Fn.begin(), E = Fn.end(); MFI != E;
- ++MFI) {
- MachineBasicBlock *MBB = MFI;
-
- unsigned BlockSize = 0;
- for (MachineBasicBlock::iterator MBBI = MBB->begin(), EE = MBB->end();
- MBBI != EE; ++MBBI)
- BlockSize += TII->GetInstSizeInBytes(MBBI);
-
- BlockSizes[MBB->getNumber()] = BlockSize;
- FuncSize += BlockSize;
- }
-
- // If the entire function is smaller than the displacement of a branch field,
- // we know we don't need to shrink any branches in this function. This is a
- // common case.
- if (FuncSize < (1 << 15)) {
- BlockSizes.clear();
- return false;
- }
-
- // For each conditional branch, if the offset to its destination is larger
- // than the offset field allows, transform it into a long branch sequence
- // like this:
- // short branch:
- // bCC MBB
- // long branch:
- // b!CC $PC+8
- // b MBB
- //
- bool MadeChange = true;
- bool EverMadeChange = false;
- while (MadeChange) {
- // Iteratively expand branches until we reach a fixed point.
- MadeChange = false;
-
- for (MachineFunction::iterator MFI = Fn.begin(), E = Fn.end(); MFI != E;
- ++MFI) {
- MachineBasicBlock &MBB = *MFI;
- unsigned MBBStartOffset = 0;
- for (MachineBasicBlock::iterator I = MBB.begin(), E = MBB.end();
- I != E; ++I) {
- if (I->getOpcode() != PPC::BCC || I->getOperand(2).isImmediate()) {
- MBBStartOffset += TII->GetInstSizeInBytes(I);
- continue;
- }
-
- // Determine the offset from the current branch to the destination
- // block.
- MachineBasicBlock *Dest = I->getOperand(2).getMBB();
-
- int BranchSize;
- if (Dest->getNumber() <= MBB.getNumber()) {
- // If this is a backwards branch, the delta is the offset from the
- // start of this block to this branch, plus the sizes of all blocks
- // from this block to the dest.
- BranchSize = MBBStartOffset;
-
- for (unsigned i = Dest->getNumber(), e = MBB.getNumber(); i != e; ++i)
- BranchSize += BlockSizes[i];
- } else {
- // Otherwise, add the size of the blocks between this block and the
- // dest to the number of bytes left in this block.
- BranchSize = -MBBStartOffset;
-
- for (unsigned i = MBB.getNumber(), e = Dest->getNumber(); i != e; ++i)
- BranchSize += BlockSizes[i];
- }
-
- // If this branch is in range, ignore it.
- if (isInt16(BranchSize)) {
- MBBStartOffset += 4;
- continue;
- }
-
- // Otherwise, we have to expand it to a long branch.
- // The BCC operands are:
- // 0. PPC branch predicate
- // 1. CR register
- // 2. Target MBB
- PPC::Predicate Pred = (PPC::Predicate)I->getOperand(0).getImm();
- unsigned CRReg = I->getOperand(1).getReg();
-
- MachineInstr *OldBranch = I;
-
- // Jump over the uncond branch inst (i.e. $PC+8) on opposite condition.
- BuildMI(MBB, I, TII->get(PPC::BCC))
- .addImm(PPC::InvertPredicate(Pred)).addReg(CRReg).addImm(2);
-
- // Uncond branch to the real destination.
- I = BuildMI(MBB, I, TII->get(PPC::B)).addMBB(Dest);
-
- // Remove the old branch from the function.
- OldBranch->eraseFromParent();
-
- // Remember that this instruction is 8-bytes, increase the size of the
- // block by 4, remember to iterate.
- BlockSizes[MBB.getNumber()] += 4;
- MBBStartOffset += 8;
- ++NumExpanded;
- MadeChange = true;
- }
- }
- EverMadeChange |= MadeChange;
- }
-
- BlockSizes.clear();
- return true;
-}
-
diff --git a/release_23/lib/Target/PowerPC/PPCCallingConv.td b/release_23/lib/Target/PowerPC/PPCCallingConv.td
deleted file mode 100644
index 9f916f38d5e4..000000000000
--- a/release_23/lib/Target/PowerPC/PPCCallingConv.td
+++ /dev/null
@@ -1,66 +0,0 @@
-//===- PPCCallingConv.td - Calling Conventions for PowerPC ------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This describes the calling conventions for the PowerPC 32- and 64-bit
-// architectures.
-//
-//===----------------------------------------------------------------------===//
-
-/// CCIfSubtarget - Match if the current subtarget has a feature F.
-class CCIfSubtarget<string F, CCAction A>
- : CCIf<!strconcat("State.getTarget().getSubtarget<PPCSubtarget>().", F), A>;
-
-//===----------------------------------------------------------------------===//
-// Return Value Calling Convention
-//===----------------------------------------------------------------------===//
-
-// Return-value convention for PowerPC
-def RetCC_PPC : CallingConv<[
- CCIfType<[i32], CCAssignToReg<[R3, R4, R5, R6, R7, R8, R9, R10]>>,
- CCIfType<[i64], CCAssignToReg<[X3, X4, X5, X6]>>,
-
- CCIfType<[f32], CCAssignToReg<[F1]>>,
- CCIfType<[f64], CCAssignToReg<[F1, F2]>>,
-
- // Vector types are always returned in V2.
- CCIfType<[v16i8, v8i16, v4i32, v4f32], CCAssignToReg<[V2]>>
-]>;
-
-
-//===----------------------------------------------------------------------===//
-// PowerPC Argument Calling Conventions
-//===----------------------------------------------------------------------===//
-/*
-def CC_PPC : CallingConv<[
- // The first 8 integer arguments are passed in integer registers.
- CCIfType<[i32], CCAssignToReg<[R3, R4, R5, R6, R7, R8, R9, R10]>>,
- CCIfType<[i64], CCAssignToReg<[X3, X4, X5, X6, X7, X8, X9, X10]>>,
-
- // Common sub-targets passes FP values in F1 - F13
- CCIfType<[f32, f64], CCIfSubtarget<"isMachoABI()",
- CCAssignToReg<[F1, F2, F3, F4, F5, F6, F7, F8,F9,F10,F11,F12,F13]>>>,
- // ELF32 sub-target pass FP values in F1 - F8.
- CCIfType<[f32, f64], CCAssignToReg<[F1, F2, F3, F4, F5, F6, F7, F8]>>,
-
- // The first 12 Vector arguments are passed in altivec registers.
- CCIfType<[v16i8, v8i16, v4i32, v4f32],
- CCAssignToReg<[V2, V3, V4, V5, V6, V7, V8, V9, V10,V11,V12,V13]>>
-
-/*
- // Integer/FP values get stored in stack slots that are 8 bytes in size and
- // 8-byte aligned if there are no more registers to hold them.
- CCIfType<[i32, i64, f32, f64], CCAssignToStack<8, 8>>,
-
- // Vectors get 16-byte stack slots that are 16-byte aligned.
- CCIfType<[v16i8, v8i16, v4i32, v2i64, v4f32, v2f64],
- CCAssignToStack<16, 16>>*/
-]>;
-
-*/
-
diff --git a/release_23/lib/Target/PowerPC/PPCCodeEmitter.cpp b/release_23/lib/Target/PowerPC/PPCCodeEmitter.cpp
deleted file mode 100644
index c0621a074f34..000000000000
--- a/release_23/lib/Target/PowerPC/PPCCodeEmitter.cpp
+++ /dev/null
@@ -1,245 +0,0 @@
-//===-- PPCCodeEmitter.cpp - JIT Code Emitter for PowerPC32 -------*- C++ -*-=//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines the PowerPC 32-bit CodeEmitter and associated machinery to
-// JIT-compile bitcode to native PowerPC.
-//
-//===----------------------------------------------------------------------===//
-
-#include "PPCTargetMachine.h"
-#include "PPCRelocations.h"
-#include "PPC.h"
-#include "llvm/Module.h"
-#include "llvm/PassManager.h"
-#include "llvm/CodeGen/MachineCodeEmitter.h"
-#include "llvm/CodeGen/MachineFunctionPass.h"
-#include "llvm/CodeGen/MachineInstrBuilder.h"
-#include "llvm/CodeGen/MachineModuleInfo.h"
-#include "llvm/CodeGen/Passes.h"
-#include "llvm/Support/Debug.h"
-#include "llvm/Support/Compiler.h"
-#include "llvm/Target/TargetOptions.h"
-using namespace llvm;
-
-namespace {
- class VISIBILITY_HIDDEN PPCCodeEmitter : public MachineFunctionPass {
- TargetMachine &TM;
- MachineCodeEmitter &MCE;
-
- /// MovePCtoLROffset - When/if we see a MovePCtoLR instruction, we record
- /// its address in the function into this pointer.
- void *MovePCtoLROffset;
-
- /// getMachineOpValue - evaluates the MachineOperand of a given MachineInstr
- ///
- int getMachineOpValue(MachineInstr &MI, MachineOperand &MO);
-
- void getAnalysisUsage(AnalysisUsage &AU) const {
- AU.addRequired<MachineModuleInfo>();
- MachineFunctionPass::getAnalysisUsage(AU);
- }
-
- public:
- static char ID;
- PPCCodeEmitter(TargetMachine &T, MachineCodeEmitter &M)
- : MachineFunctionPass((intptr_t)&ID), TM(T), MCE(M) {}
-
- const char *getPassName() const { return "PowerPC Machine Code Emitter"; }
-
- /// runOnMachineFunction - emits the given MachineFunction to memory
- ///
- bool runOnMachineFunction(MachineFunction &MF);
-
- /// emitBasicBlock - emits the given MachineBasicBlock to memory
- ///
- void emitBasicBlock(MachineBasicBlock &MBB);
-
- /// getValueBit - return the particular bit of Val
- ///
- unsigned getValueBit(int64_t Val, unsigned bit) { return (Val >> bit) & 1; }
-
- /// getBinaryCodeForInstr - This function, generated by the
- /// CodeEmitterGenerator using TableGen, produces the binary encoding for
- /// machine instructions.
- ///
- unsigned getBinaryCodeForInstr(MachineInstr &MI);
- };
- char PPCCodeEmitter::ID = 0;
-}
-
-/// createPPCCodeEmitterPass - Return a pass that emits the collected PPC code
-/// to the specified MCE object.
-FunctionPass *llvm::createPPCCodeEmitterPass(PPCTargetMachine &TM,
- MachineCodeEmitter &MCE) {
- return new PPCCodeEmitter(TM, MCE);
-}
-
-#ifdef __APPLE__
-extern "C" void sys_icache_invalidate(const void *Addr, size_t len);
-#endif
-
-bool PPCCodeEmitter::runOnMachineFunction(MachineFunction &MF) {
- assert((MF.getTarget().getRelocationModel() != Reloc::Default ||
- MF.getTarget().getRelocationModel() != Reloc::Static) &&
- "JIT relocation model must be set to static or default!");
-
- MCE.setModuleInfo(&getAnalysis<MachineModuleInfo>());
- do {
- MovePCtoLROffset = 0;
- MCE.startFunction(MF);
- for (MachineFunction::iterator BB = MF.begin(), E = MF.end(); BB != E; ++BB)
- emitBasicBlock(*BB);
- } while (MCE.finishFunction(MF));
-
- return false;
-}
-
-void PPCCodeEmitter::emitBasicBlock(MachineBasicBlock &MBB) {
- MCE.StartMachineBasicBlock(&MBB);
-
- for (MachineBasicBlock::iterator I = MBB.begin(), E = MBB.end(); I != E; ++I){
- MachineInstr &MI = *I;
- switch (MI.getOpcode()) {
- default:
- MCE.emitWordBE(getBinaryCodeForInstr(*I));
- break;
- case TargetInstrInfo::LABEL:
- MCE.emitLabel(MI.getOperand(0).getImm());
- break;
- case TargetInstrInfo::IMPLICIT_DEF:
- break; // pseudo opcode, no side effects
- case PPC::MovePCtoLR:
- case PPC::MovePCtoLR8:
- assert(TM.getRelocationModel() == Reloc::PIC_);
- MovePCtoLROffset = (void*)MCE.getCurrentPCValue();
- MCE.emitWordBE(0x48000005); // bl 1
- break;
- }
- }
-}
-
-int PPCCodeEmitter::getMachineOpValue(MachineInstr &MI, MachineOperand &MO) {
-
- intptr_t rv = 0; // Return value; defaults to 0 for unhandled cases
- // or things that get fixed up later by the JIT.
- if (MO.isRegister()) {
- rv = PPCRegisterInfo::getRegisterNumbering(MO.getReg());
-
- // Special encoding for MTCRF and MFOCRF, which uses a bit mask for the
- // register, not the register number directly.
- if ((MI.getOpcode() == PPC::MTCRF || MI.getOpcode() == PPC::MFOCRF) &&
- (MO.getReg() >= PPC::CR0 && MO.getReg() <= PPC::CR7)) {
- rv = 0x80 >> rv;
- }
- } else if (MO.isImmediate()) {
- rv = MO.getImm();
- } else if (MO.isGlobalAddress() || MO.isExternalSymbol() ||
- MO.isConstantPoolIndex() || MO.isJumpTableIndex()) {
- unsigned Reloc = 0;
- if (MI.getOpcode() == PPC::BL_Macho || MI.getOpcode() == PPC::BL8_Macho ||
- MI.getOpcode() == PPC::BL_ELF || MI.getOpcode() == PPC::BL8_ELF ||
- MI.getOpcode() == PPC::TAILB || MI.getOpcode() == PPC::TAILB8)
- Reloc = PPC::reloc_pcrel_bx;
- else {
- if (TM.getRelocationModel() == Reloc::PIC_) {
- assert(MovePCtoLROffset && "MovePCtoLR not seen yet?");
- }
- switch (MI.getOpcode()) {
- default: MI.dump(); assert(0 && "Unknown instruction for relocation!");
- case PPC::LIS:
- case PPC::LIS8:
- case PPC::ADDIS:
- case PPC::ADDIS8:
- Reloc = PPC::reloc_absolute_high; // Pointer to symbol
- break;
- case PPC::LI:
- case PPC::LI8:
- case PPC::LA:
- // Loads.
- case PPC::LBZ:
- case PPC::LBZ8:
- case PPC::LHA:
- case PPC::LHA8:
- case PPC::LHZ:
- case PPC::LHZ8:
- case PPC::LWZ:
- case PPC::LWZ8:
- case PPC::LFS:
- case PPC::LFD:
-
- // Stores.
- case PPC::STB:
- case PPC::STB8:
- case PPC::STH:
- case PPC::STH8:
- case PPC::STW:
- case PPC::STW8:
- case PPC::STFS:
- case PPC::STFD:
- Reloc = PPC::reloc_absolute_low;
- break;
-
- case PPC::LWA:
- case PPC::LD:
- case PPC::STD:
- case PPC::STD_32:
- Reloc = PPC::reloc_absolute_low_ix;
- break;
- }
- }
-
- MachineRelocation R;
- if (MO.isGlobalAddress()) {
- R = MachineRelocation::getGV(MCE.getCurrentPCOffset(), Reloc,
- MO.getGlobal(), 0,
- isa<Function>(MO.getGlobal()));
- } else if (MO.isExternalSymbol()) {
- R = MachineRelocation::getExtSym(MCE.getCurrentPCOffset(),
- Reloc, MO.getSymbolName(), 0);
- } else if (MO.isConstantPoolIndex()) {
- R = MachineRelocation::getConstPool(MCE.getCurrentPCOffset(),
- Reloc, MO.getIndex(), 0);
- } else {
- assert(MO.isJumpTableIndex());
- R = MachineRelocation::getJumpTable(MCE.getCurrentPCOffset(),
- Reloc, MO.getIndex(), 0);
- }
-
- // If in PIC mode, we need to encode the negated address of the
- // 'movepctolr' into the unrelocated field. After relocation, we'll have
- // &gv-&movepctolr-4 in the imm field. Once &movepctolr is added to the imm
- // field, we get &gv. This doesn't happen for branch relocations, which are
- // always implicitly pc relative.
- if (TM.getRelocationModel() == Reloc::PIC_ && Reloc != PPC::reloc_pcrel_bx){
- assert(MovePCtoLROffset && "MovePCtoLR not seen yet?");
- R.setConstantVal(-(intptr_t)MovePCtoLROffset - 4);
- }
- MCE.addRelocation(R);
-
- } else if (MO.isMachineBasicBlock()) {
- unsigned Reloc = 0;
- unsigned Opcode = MI.getOpcode();
- if (Opcode == PPC::B || Opcode == PPC::BL_Macho ||
- Opcode == PPC::BLA_Macho || Opcode == PPC::BL_ELF ||
- Opcode == PPC::BLA_ELF)
- Reloc = PPC::reloc_pcrel_bx;
- else // BCC instruction
- Reloc = PPC::reloc_pcrel_bcx;
- MCE.addRelocation(MachineRelocation::getBB(MCE.getCurrentPCOffset(),
- Reloc, MO.getMBB()));
- } else {
- cerr << "ERROR: Unknown type of MachineOperand: " << MO << "\n";
- abort();
- }
-
- return rv;
-}
-
-#include "PPCGenCodeEmitter.inc"
-
diff --git a/release_23/lib/Target/PowerPC/PPCFrameInfo.h b/release_23/lib/Target/PowerPC/PPCFrameInfo.h
deleted file mode 100644
index 1b5893da0ce2..000000000000
--- a/release_23/lib/Target/PowerPC/PPCFrameInfo.h
+++ /dev/null
@@ -1,93 +0,0 @@
-//===-- PPCFrameInfo.h - Define TargetFrameInfo for PowerPC -----*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef POWERPC_FRAMEINFO_H
-#define POWERPC_FRAMEINFO_H
-
-#include "PPC.h"
-#include "llvm/Target/TargetFrameInfo.h"
-#include "llvm/Target/TargetMachine.h"
-
-namespace llvm {
-
-class PPCFrameInfo: public TargetFrameInfo {
- const TargetMachine &TM;
-
-public:
- PPCFrameInfo(const TargetMachine &tm, bool LP64)
- : TargetFrameInfo(TargetFrameInfo::StackGrowsDown, 16, 0), TM(tm) {
- }
-
- /// getReturnSaveOffset - Return the previous frame offset to save the
- /// return address.
- static unsigned getReturnSaveOffset(bool LP64, bool isMacho) {
- if (isMacho)
- return LP64 ? 16 : 8;
- // For ELF 32 ABI:
- return 4;
- }
-
- /// getFramePointerSaveOffset - Return the previous frame offset to save the
- /// frame pointer.
- static unsigned getFramePointerSaveOffset(bool LP64, bool isMacho) {
- // For MachO ABI:
- // Use the TOC save slot in the PowerPC linkage area for saving the frame
- // pointer (if needed.) LLVM does not generate code that uses the TOC (R2
- // is treated as a caller saved register.)
- if (isMacho)
- return LP64 ? 40 : 20;
-
- // For ELF 32 ABI:
- // Save it right before the link register
- return -4U;
- }
-
- /// getLinkageSize - Return the size of the PowerPC ABI linkage area.
- ///
- static unsigned getLinkageSize(bool LP64, bool isMacho) {
- if (isMacho)
- return 6 * (LP64 ? 8 : 4);
-
- // For ELF 32 ABI:
- return 8;
- }
-
- /// getMinCallArgumentsSize - Return the size of the minium PowerPC ABI
- /// argument area.
- static unsigned getMinCallArgumentsSize(bool LP64, bool isMacho) {
- // For Macho ABI:
- // The prolog code of the callee may store up to 8 GPR argument registers to
- // the stack, allowing va_start to index over them in memory if its varargs.
- // Because we cannot tell if this is needed on the caller side, we have to
- // conservatively assume that it is needed. As such, make sure we have at
- // least enough stack space for the caller to store the 8 GPRs.
- if (isMacho)
- return 8 * (LP64 ? 8 : 4);
-
- // For ELF 32 ABI:
- // There is no default stack allocated for the 8 first GPR arguments.
- return 0;
- }
-
- /// getMinCallFrameSize - Return the minimum size a call frame can be using
- /// the PowerPC ABI.
- static unsigned getMinCallFrameSize(bool LP64, bool isMacho) {
- // The call frame needs to be at least big enough for linkage and 8 args.
- return getLinkageSize(LP64, isMacho) +
- getMinCallArgumentsSize(LP64, isMacho);
- }
-
-};
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/lib/Target/PowerPC/PPCHazardRecognizers.cpp b/release_23/lib/Target/PowerPC/PPCHazardRecognizers.cpp
deleted file mode 100644
index 58df0d6db26e..000000000000
--- a/release_23/lib/Target/PowerPC/PPCHazardRecognizers.cpp
+++ /dev/null
@@ -1,305 +0,0 @@
-//===-- PPCHazardRecognizers.cpp - PowerPC Hazard Recognizer Impls --------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements hazard recognizers for scheduling on PowerPC processors.
-//
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "pre-RA-sched"
-#include "PPCHazardRecognizers.h"
-#include "PPC.h"
-#include "PPCInstrInfo.h"
-#include "llvm/Support/Debug.h"
-using namespace llvm;
-
-//===----------------------------------------------------------------------===//
-// PowerPC 970 Hazard Recognizer
-//
-// This models the dispatch group formation of the PPC970 processor. Dispatch
-// groups are bundles of up to five instructions that can contain various mixes
-// of instructions. The PPC970 can dispatch a peak of 4 non-branch and one
-// branch instruction per-cycle.
-//
-// There are a number of restrictions to dispatch group formation: some
-// instructions can only be issued in the first slot of a dispatch group, & some
-// instructions fill an entire dispatch group. Additionally, only branches can
-// issue in the 5th (last) slot.
-//
-// Finally, there are a number of "structural" hazards on the PPC970. These
-// conditions cause large performance penalties due to misprediction, recovery,
-// and replay logic that has to happen. These cases include setting a CTR and
-// branching through it in the same dispatch group, and storing to an address,
-// then loading from the same address within a dispatch group. To avoid these
-// conditions, we insert no-op instructions when appropriate.
-//
-// FIXME: This is missing some significant cases:
-// 1. Modeling of microcoded instructions.
-// 2. Handling of serialized operations.
-// 3. Handling of the esoteric cases in "Resource-based Instruction Grouping".
-//
-
-PPCHazardRecognizer970::PPCHazardRecognizer970(const TargetInstrInfo &tii)
- : TII(tii) {
- EndDispatchGroup();
-}
-
-void PPCHazardRecognizer970::EndDispatchGroup() {
- DOUT << "=== Start of dispatch group\n";
- NumIssued = 0;
-
- // Structural hazard info.
- HasCTRSet = false;
- NumStores = 0;
-}
-
-
-PPCII::PPC970_Unit
-PPCHazardRecognizer970::GetInstrType(unsigned Opcode,
- bool &isFirst, bool &isSingle,
- bool &isCracked,
- bool &isLoad, bool &isStore) {
- if (Opcode < ISD::BUILTIN_OP_END) {
- isFirst = isSingle = isCracked = isLoad = isStore = false;
- return PPCII::PPC970_Pseudo;
- }
- Opcode -= ISD::BUILTIN_OP_END;
-
- const TargetInstrDesc &TID = TII.get(Opcode);
-
- isLoad = TID.isSimpleLoad();
- isStore = TID.mayStore();
-
- unsigned TSFlags = TID.TSFlags;
-
- isFirst = TSFlags & PPCII::PPC970_First;
- isSingle = TSFlags & PPCII::PPC970_Single;
- isCracked = TSFlags & PPCII::PPC970_Cracked;
- return (PPCII::PPC970_Unit)(TSFlags & PPCII::PPC970_Mask);
-}
-
-/// isLoadOfStoredAddress - If we have a load from the previously stored pointer
-/// as indicated by StorePtr1/StorePtr2/StoreSize, return true.
-bool PPCHazardRecognizer970::
-isLoadOfStoredAddress(unsigned LoadSize, SDOperand Ptr1, SDOperand Ptr2) const {
- for (unsigned i = 0, e = NumStores; i != e; ++i) {
- // Handle exact and commuted addresses.
- if (Ptr1 == StorePtr1[i] && Ptr2 == StorePtr2[i])
- return true;
- if (Ptr2 == StorePtr1[i] && Ptr1 == StorePtr2[i])
- return true;
-
- // Okay, we don't have an exact match, if this is an indexed offset, see if
- // we have overlap (which happens during fp->int conversion for example).
- if (StorePtr2[i] == Ptr2) {
- if (ConstantSDNode *StoreOffset = dyn_cast<ConstantSDNode>(StorePtr1[i]))
- if (ConstantSDNode *LoadOffset = dyn_cast<ConstantSDNode>(Ptr1)) {
- // Okay the base pointers match, so we have [c1+r] vs [c2+r]. Check
- // to see if the load and store actually overlap.
- int StoreOffs = StoreOffset->getValue();
- int LoadOffs = LoadOffset->getValue();
- if (StoreOffs < LoadOffs) {
- if (int(StoreOffs+StoreSize[i]) > LoadOffs) return true;
- } else {
- if (int(LoadOffs+LoadSize) > StoreOffs) return true;
- }
- }
- }
- }
- return false;
-}
-
-/// getHazardType - We return hazard for any non-branch instruction that would
-/// terminate terminate the dispatch group. We turn NoopHazard for any
-/// instructions that wouldn't terminate the dispatch group that would cause a
-/// pipeline flush.
-HazardRecognizer::HazardType PPCHazardRecognizer970::
-getHazardType(SDNode *Node) {
- bool isFirst, isSingle, isCracked, isLoad, isStore;
- PPCII::PPC970_Unit InstrType =
- GetInstrType(Node->getOpcode(), isFirst, isSingle, isCracked,
- isLoad, isStore);
- if (InstrType == PPCII::PPC970_Pseudo) return NoHazard;
- unsigned Opcode = Node->getOpcode()-ISD::BUILTIN_OP_END;
-
- // We can only issue a PPC970_First/PPC970_Single instruction (such as
- // crand/mtspr/etc) if this is the first cycle of the dispatch group.
- if (NumIssued != 0 && (isFirst || isSingle))
- return Hazard;
-
- // If this instruction is cracked into two ops by the decoder, we know that
- // it is not a branch and that it cannot issue if 3 other instructions are
- // already in the dispatch group.
- if (isCracked && NumIssued > 2)
- return Hazard;
-
- switch (InstrType) {
- default: assert(0 && "Unknown instruction type!");
- case PPCII::PPC970_FXU:
- case PPCII::PPC970_LSU:
- case PPCII::PPC970_FPU:
- case PPCII::PPC970_VALU:
- case PPCII::PPC970_VPERM:
- // We can only issue a branch as the last instruction in a group.
- if (NumIssued == 4) return Hazard;
- break;
- case PPCII::PPC970_CRU:
- // We can only issue a CR instruction in the first two slots.
- if (NumIssued >= 2) return Hazard;
- break;
- case PPCII::PPC970_BRU:
- break;
- }
-
- // Do not allow MTCTR and BCTRL to be in the same dispatch group.
- if (HasCTRSet && (Opcode == PPC::BCTRL_Macho || Opcode == PPC::BCTRL_ELF))
- return NoopHazard;
-
- // If this is a load following a store, make sure it's not to the same or
- // overlapping address.
- if (isLoad && NumStores) {
- unsigned LoadSize;
- switch (Opcode) {
- default: assert(0 && "Unknown load!");
- case PPC::LBZ: case PPC::LBZU:
- case PPC::LBZX:
- case PPC::LBZ8: case PPC::LBZU8:
- case PPC::LBZX8:
- case PPC::LVEBX:
- LoadSize = 1;
- break;
- case PPC::LHA: case PPC::LHAU:
- case PPC::LHAX:
- case PPC::LHZ: case PPC::LHZU:
- case PPC::LHZX:
- case PPC::LVEHX:
- case PPC::LHBRX:
- case PPC::LHA8: case PPC::LHAU8:
- case PPC::LHAX8:
- case PPC::LHZ8: case PPC::LHZU8:
- case PPC::LHZX8:
- LoadSize = 2;
- break;
- case PPC::LFS: case PPC::LFSU:
- case PPC::LFSX:
- case PPC::LWZ: case PPC::LWZU:
- case PPC::LWZX:
- case PPC::LWA:
- case PPC::LWAX:
- case PPC::LVEWX:
- case PPC::LWBRX:
- case PPC::LWZ8:
- case PPC::LWZX8:
- LoadSize = 4;
- break;
- case PPC::LFD: case PPC::LFDU:
- case PPC::LFDX:
- case PPC::LD: case PPC::LDU:
- case PPC::LDX:
- LoadSize = 8;
- break;
- case PPC::LVX:
- case PPC::LVXL:
- LoadSize = 16;
- break;
- }
-
- if (isLoadOfStoredAddress(LoadSize,
- Node->getOperand(0), Node->getOperand(1)))
- return NoopHazard;
- }
-
- return NoHazard;
-}
-
-void PPCHazardRecognizer970::EmitInstruction(SDNode *Node) {
- bool isFirst, isSingle, isCracked, isLoad, isStore;
- PPCII::PPC970_Unit InstrType =
- GetInstrType(Node->getOpcode(), isFirst, isSingle, isCracked,
- isLoad, isStore);
- if (InstrType == PPCII::PPC970_Pseudo) return;
- unsigned Opcode = Node->getOpcode()-ISD::BUILTIN_OP_END;
-
- // Update structural hazard information.
- if (Opcode == PPC::MTCTR) HasCTRSet = true;
-
- // Track the address stored to.
- if (isStore) {
- unsigned ThisStoreSize;
- switch (Opcode) {
- default: assert(0 && "Unknown store instruction!");
- case PPC::STB: case PPC::STB8:
- case PPC::STBU: case PPC::STBU8:
- case PPC::STBX: case PPC::STBX8:
- case PPC::STVEBX:
- ThisStoreSize = 1;
- break;
- case PPC::STH: case PPC::STH8:
- case PPC::STHU: case PPC::STHU8:
- case PPC::STHX: case PPC::STHX8:
- case PPC::STVEHX:
- case PPC::STHBRX:
- ThisStoreSize = 2;
- break;
- case PPC::STFS:
- case PPC::STFSU:
- case PPC::STFSX:
- case PPC::STWX: case PPC::STWX8:
- case PPC::STWUX:
- case PPC::STW: case PPC::STW8:
- case PPC::STWU: case PPC::STWU8:
- case PPC::STVEWX:
- case PPC::STFIWX:
- case PPC::STWBRX:
- ThisStoreSize = 4;
- break;
- case PPC::STD_32:
- case PPC::STDX_32:
- case PPC::STD:
- case PPC::STDU:
- case PPC::STFD:
- case PPC::STFDX:
- case PPC::STDX:
- case PPC::STDUX:
- ThisStoreSize = 8;
- break;
- case PPC::STVX:
- case PPC::STVXL:
- ThisStoreSize = 16;
- break;
- }
-
- StoreSize[NumStores] = ThisStoreSize;
- StorePtr1[NumStores] = Node->getOperand(1);
- StorePtr2[NumStores] = Node->getOperand(2);
- ++NumStores;
- }
-
- if (InstrType == PPCII::PPC970_BRU || isSingle)
- NumIssued = 4; // Terminate a d-group.
- ++NumIssued;
-
- // If this instruction is cracked into two ops by the decoder, remember that
- // we issued two pieces.
- if (isCracked)
- ++NumIssued;
-
- if (NumIssued == 5)
- EndDispatchGroup();
-}
-
-void PPCHazardRecognizer970::AdvanceCycle() {
- assert(NumIssued < 5 && "Illegal dispatch group!");
- ++NumIssued;
- if (NumIssued == 5)
- EndDispatchGroup();
-}
-
-void PPCHazardRecognizer970::EmitNoop() {
- AdvanceCycle();
-}
diff --git a/release_23/lib/Target/PowerPC/PPCHazardRecognizers.h b/release_23/lib/Target/PowerPC/PPCHazardRecognizers.h
deleted file mode 100644
index 8ec25aed61bd..000000000000
--- a/release_23/lib/Target/PowerPC/PPCHazardRecognizers.h
+++ /dev/null
@@ -1,73 +0,0 @@
-//===-- PPCHazardRecognizers.h - PowerPC Hazard Recognizers -----*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines hazard recognizers for scheduling on PowerPC processors.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef PPCHAZRECS_H
-#define PPCHAZRECS_H
-
-#include "llvm/CodeGen/ScheduleDAG.h"
-#include "PPCInstrInfo.h"
-
-namespace llvm {
-
-/// PPCHazardRecognizer970 - This class defines a finite state automata that
-/// models the dispatch logic on the PowerPC 970 (aka G5) processor. This
-/// promotes good dispatch group formation and implements noop insertion to
-/// avoid structural hazards that cause significant performance penalties (e.g.
-/// setting the CTR register then branching through it within a dispatch group),
-/// or storing then loading from the same address within a dispatch group.
-class PPCHazardRecognizer970 : public HazardRecognizer {
- const TargetInstrInfo &TII;
-
- unsigned NumIssued; // Number of insts issued, including advanced cycles.
-
- // Various things that can cause a structural hazard.
-
- // HasCTRSet - If the CTR register is set in this group, disallow BCTRL.
- bool HasCTRSet;
-
- // StoredPtr - Keep track of the address of any store. If we see a load from
- // the same address (or one that aliases it), disallow the store. We can have
- // up to four stores in one dispatch group, hence we track up to 4.
- //
- // This is null if we haven't seen a store yet. We keep track of both
- // operands of the store here, since we support [r+r] and [r+i] addressing.
- SDOperand StorePtr1[4], StorePtr2[4];
- unsigned StoreSize[4];
- unsigned NumStores;
-
-public:
- PPCHazardRecognizer970(const TargetInstrInfo &TII);
- virtual HazardType getHazardType(SDNode *Node);
- virtual void EmitInstruction(SDNode *Node);
- virtual void AdvanceCycle();
- virtual void EmitNoop();
-
-private:
- /// EndDispatchGroup - Called when we are finishing a new dispatch group.
- ///
- void EndDispatchGroup();
-
- /// GetInstrType - Classify the specified powerpc opcode according to its
- /// pipeline.
- PPCII::PPC970_Unit GetInstrType(unsigned Opcode,
- bool &isFirst, bool &isSingle,bool &isCracked,
- bool &isLoad, bool &isStore);
-
- bool isLoadOfStoredAddress(unsigned LoadSize,
- SDOperand Ptr1, SDOperand Ptr2) const;
-};
-
-} // end namespace llvm
-
-#endif
-
diff --git a/release_23/lib/Target/PowerPC/PPCISelDAGToDAG.cpp b/release_23/lib/Target/PowerPC/PPCISelDAGToDAG.cpp
deleted file mode 100644
index d73d8aa37050..000000000000
--- a/release_23/lib/Target/PowerPC/PPCISelDAGToDAG.cpp
+++ /dev/null
@@ -1,1142 +0,0 @@
-//===-- PPCISelDAGToDAG.cpp - PPC --pattern matching inst selector --------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines a pattern matching instruction selector for PowerPC,
-// converting from a legalized dag to a PPC dag.
-//
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "ppc-codegen"
-#include "PPC.h"
-#include "PPCPredicates.h"
-#include "PPCTargetMachine.h"
-#include "PPCISelLowering.h"
-#include "PPCHazardRecognizers.h"
-#include "llvm/CodeGen/MachineInstrBuilder.h"
-#include "llvm/CodeGen/MachineFunction.h"
-#include "llvm/CodeGen/MachineRegisterInfo.h"
-#include "llvm/CodeGen/SelectionDAG.h"
-#include "llvm/CodeGen/SelectionDAGISel.h"
-#include "llvm/Target/TargetOptions.h"
-#include "llvm/Constants.h"
-#include "llvm/GlobalValue.h"
-#include "llvm/Intrinsics.h"
-#include "llvm/Support/Debug.h"
-#include "llvm/Support/MathExtras.h"
-#include "llvm/Support/Compiler.h"
-#include <queue>
-#include <set>
-using namespace llvm;
-
-namespace {
- //===--------------------------------------------------------------------===//
- /// PPCDAGToDAGISel - PPC specific code to select PPC machine
- /// instructions for SelectionDAG operations.
- ///
- class VISIBILITY_HIDDEN PPCDAGToDAGISel : public SelectionDAGISel {
- PPCTargetMachine &TM;
- PPCTargetLowering PPCLowering;
- const PPCSubtarget &PPCSubTarget;
- unsigned GlobalBaseReg;
- public:
- PPCDAGToDAGISel(PPCTargetMachine &tm)
- : SelectionDAGISel(PPCLowering), TM(tm),
- PPCLowering(*TM.getTargetLowering()),
- PPCSubTarget(*TM.getSubtargetImpl()) {}
-
- virtual bool runOnFunction(Function &Fn) {
- // Make sure we re-emit a set of the global base reg if necessary
- GlobalBaseReg = 0;
- SelectionDAGISel::runOnFunction(Fn);
-
- InsertVRSaveCode(Fn);
- return true;
- }
-
- /// getI32Imm - Return a target constant with the specified value, of type
- /// i32.
- inline SDOperand getI32Imm(unsigned Imm) {
- return CurDAG->getTargetConstant(Imm, MVT::i32);
- }
-
- /// getI64Imm - Return a target constant with the specified value, of type
- /// i64.
- inline SDOperand getI64Imm(uint64_t Imm) {
- return CurDAG->getTargetConstant(Imm, MVT::i64);
- }
-
- /// getSmallIPtrImm - Return a target constant of pointer type.
- inline SDOperand getSmallIPtrImm(unsigned Imm) {
- return CurDAG->getTargetConstant(Imm, PPCLowering.getPointerTy());
- }
-
- /// isRunOfOnes - Returns true iff Val consists of one contiguous run of 1s
- /// with any number of 0s on either side. The 1s are allowed to wrap from
- /// LSB to MSB, so 0x000FFF0, 0x0000FFFF, and 0xFF0000FF are all runs.
- /// 0x0F0F0000 is not, since all 1s are not contiguous.
- static bool isRunOfOnes(unsigned Val, unsigned &MB, unsigned &ME);
-
-
- /// isRotateAndMask - Returns true if Mask and Shift can be folded into a
- /// rotate and mask opcode and mask operation.
- static bool isRotateAndMask(SDNode *N, unsigned Mask, bool IsShiftMask,
- unsigned &SH, unsigned &MB, unsigned &ME);
-
- /// getGlobalBaseReg - insert code into the entry mbb to materialize the PIC
- /// base register. Return the virtual register that holds this value.
- SDNode *getGlobalBaseReg();
-
- // Select - Convert the specified operand from a target-independent to a
- // target-specific node if it hasn't already been changed.
- SDNode *Select(SDOperand Op);
-
- SDNode *SelectBitfieldInsert(SDNode *N);
-
- /// SelectCC - Select a comparison of the specified values with the
- /// specified condition code, returning the CR# of the expression.
- SDOperand SelectCC(SDOperand LHS, SDOperand RHS, ISD::CondCode CC);
-
- /// SelectAddrImm - Returns true if the address N can be represented by
- /// a base register plus a signed 16-bit displacement [r+imm].
- bool SelectAddrImm(SDOperand Op, SDOperand N, SDOperand &Disp,
- SDOperand &Base) {
- return PPCLowering.SelectAddressRegImm(N, Disp, Base, *CurDAG);
- }
-
- /// SelectAddrImmOffs - Return true if the operand is valid for a preinc
- /// immediate field. Because preinc imms have already been validated, just
- /// accept it.
- bool SelectAddrImmOffs(SDOperand Op, SDOperand N, SDOperand &Out) const {
- Out = N;
- return true;
- }
-
- /// SelectAddrIdx - Given the specified addressed, check to see if it can be
- /// represented as an indexed [r+r] operation. Returns false if it can
- /// be represented by [r+imm], which are preferred.
- bool SelectAddrIdx(SDOperand Op, SDOperand N, SDOperand &Base,
- SDOperand &Index) {
- return PPCLowering.SelectAddressRegReg(N, Base, Index, *CurDAG);
- }
-
- /// SelectAddrIdxOnly - Given the specified addressed, force it to be
- /// represented as an indexed [r+r] operation.
- bool SelectAddrIdxOnly(SDOperand Op, SDOperand N, SDOperand &Base,
- SDOperand &Index) {
- return PPCLowering.SelectAddressRegRegOnly(N, Base, Index, *CurDAG);
- }
-
- /// SelectAddrImmShift - Returns true if the address N can be represented by
- /// a base register plus a signed 14-bit displacement [r+imm*4]. Suitable
- /// for use by STD and friends.
- bool SelectAddrImmShift(SDOperand Op, SDOperand N, SDOperand &Disp,
- SDOperand &Base) {
- return PPCLowering.SelectAddressRegImmShift(N, Disp, Base, *CurDAG);
- }
-
- /// SelectInlineAsmMemoryOperand - Implement addressing mode selection for
- /// inline asm expressions.
- virtual bool SelectInlineAsmMemoryOperand(const SDOperand &Op,
- char ConstraintCode,
- std::vector<SDOperand> &OutOps,
- SelectionDAG &DAG) {
- SDOperand Op0, Op1;
- switch (ConstraintCode) {
- default: return true;
- case 'm': // memory
- if (!SelectAddrIdx(Op, Op, Op0, Op1))
- SelectAddrImm(Op, Op, Op0, Op1);
- break;
- case 'o': // offsetable
- if (!SelectAddrImm(Op, Op, Op0, Op1)) {
- Op0 = Op;
- AddToISelQueue(Op0); // r+0.
- Op1 = getSmallIPtrImm(0);
- }
- break;
- case 'v': // not offsetable
- SelectAddrIdxOnly(Op, Op, Op0, Op1);
- break;
- }
-
- OutOps.push_back(Op0);
- OutOps.push_back(Op1);
- return false;
- }
-
- SDOperand BuildSDIVSequence(SDNode *N);
- SDOperand BuildUDIVSequence(SDNode *N);
-
- /// InstructionSelectBasicBlock - This callback is invoked by
- /// SelectionDAGISel when it has created a SelectionDAG for us to codegen.
- virtual void InstructionSelectBasicBlock(SelectionDAG &DAG);
-
- void InsertVRSaveCode(Function &Fn);
-
- virtual const char *getPassName() const {
- return "PowerPC DAG->DAG Pattern Instruction Selection";
- }
-
- /// CreateTargetHazardRecognizer - Return the hazard recognizer to use for
- /// this target when scheduling the DAG.
- virtual HazardRecognizer *CreateTargetHazardRecognizer() {
- // Should use subtarget info to pick the right hazard recognizer. For
- // now, always return a PPC970 recognizer.
- const TargetInstrInfo *II = PPCLowering.getTargetMachine().getInstrInfo();
- assert(II && "No InstrInfo?");
- return new PPCHazardRecognizer970(*II);
- }
-
-// Include the pieces autogenerated from the target description.
-#include "PPCGenDAGISel.inc"
-
-private:
- SDNode *SelectSETCC(SDOperand Op);
- };
-}
-
-/// InstructionSelectBasicBlock - This callback is invoked by
-/// SelectionDAGISel when it has created a SelectionDAG for us to codegen.
-void PPCDAGToDAGISel::InstructionSelectBasicBlock(SelectionDAG &DAG) {
- DEBUG(BB->dump());
-
- // Select target instructions for the DAG.
- DAG.setRoot(SelectRoot(DAG.getRoot()));
- DAG.RemoveDeadNodes();
-
- // Emit machine code to BB.
- ScheduleAndEmitDAG(DAG);
-}
-
-/// InsertVRSaveCode - Once the entire function has been instruction selected,
-/// all virtual registers are created and all machine instructions are built,
-/// check to see if we need to save/restore VRSAVE. If so, do it.
-void PPCDAGToDAGISel::InsertVRSaveCode(Function &F) {
- // Check to see if this function uses vector registers, which means we have to
- // save and restore the VRSAVE register and update it with the regs we use.
- //
- // In this case, there will be virtual registers of vector type type created
- // by the scheduler. Detect them now.
- MachineFunction &Fn = MachineFunction::get(&F);
- bool HasVectorVReg = false;
- for (unsigned i = TargetRegisterInfo::FirstVirtualRegister,
- e = RegInfo->getLastVirtReg()+1; i != e; ++i)
- if (RegInfo->getRegClass(i) == &PPC::VRRCRegClass) {
- HasVectorVReg = true;
- break;
- }
- if (!HasVectorVReg) return; // nothing to do.
-
- // If we have a vector register, we want to emit code into the entry and exit
- // blocks to save and restore the VRSAVE register. We do this here (instead
- // of marking all vector instructions as clobbering VRSAVE) for two reasons:
- //
- // 1. This (trivially) reduces the load on the register allocator, by not
- // having to represent the live range of the VRSAVE register.
- // 2. This (more significantly) allows us to create a temporary virtual
- // register to hold the saved VRSAVE value, allowing this temporary to be
- // register allocated, instead of forcing it to be spilled to the stack.
-
- // Create two vregs - one to hold the VRSAVE register that is live-in to the
- // function and one for the value after having bits or'd into it.
- unsigned InVRSAVE = RegInfo->createVirtualRegister(&PPC::GPRCRegClass);
- unsigned UpdatedVRSAVE = RegInfo->createVirtualRegister(&PPC::GPRCRegClass);
-
- const TargetInstrInfo &TII = *TM.getInstrInfo();
- MachineBasicBlock &EntryBB = *Fn.begin();
- // Emit the following code into the entry block:
- // InVRSAVE = MFVRSAVE
- // UpdatedVRSAVE = UPDATE_VRSAVE InVRSAVE
- // MTVRSAVE UpdatedVRSAVE
- MachineBasicBlock::iterator IP = EntryBB.begin(); // Insert Point
- BuildMI(EntryBB, IP, TII.get(PPC::MFVRSAVE), InVRSAVE);
- BuildMI(EntryBB, IP, TII.get(PPC::UPDATE_VRSAVE),
- UpdatedVRSAVE).addReg(InVRSAVE);
- BuildMI(EntryBB, IP, TII.get(PPC::MTVRSAVE)).addReg(UpdatedVRSAVE);
-
- // Find all return blocks, outputting a restore in each epilog.
- for (MachineFunction::iterator BB = Fn.begin(), E = Fn.end(); BB != E; ++BB) {
- if (!BB->empty() && BB->back().getDesc().isReturn()) {
- IP = BB->end(); --IP;
-
- // Skip over all terminator instructions, which are part of the return
- // sequence.
- MachineBasicBlock::iterator I2 = IP;
- while (I2 != BB->begin() && (--I2)->getDesc().isTerminator())
- IP = I2;
-
- // Emit: MTVRSAVE InVRSave
- BuildMI(*BB, IP, TII.get(PPC::MTVRSAVE)).addReg(InVRSAVE);
- }
- }
-}
-
-
-/// getGlobalBaseReg - Output the instructions required to put the
-/// base address to use for accessing globals into a register.
-///
-SDNode *PPCDAGToDAGISel::getGlobalBaseReg() {
- if (!GlobalBaseReg) {
- const TargetInstrInfo &TII = *TM.getInstrInfo();
- // Insert the set of GlobalBaseReg into the first MBB of the function
- MachineBasicBlock &FirstMBB = BB->getParent()->front();
- MachineBasicBlock::iterator MBBI = FirstMBB.begin();
-
- if (PPCLowering.getPointerTy() == MVT::i32) {
- GlobalBaseReg = RegInfo->createVirtualRegister(PPC::GPRCRegisterClass);
- BuildMI(FirstMBB, MBBI, TII.get(PPC::MovePCtoLR), PPC::LR);
- BuildMI(FirstMBB, MBBI, TII.get(PPC::MFLR), GlobalBaseReg);
- } else {
- GlobalBaseReg = RegInfo->createVirtualRegister(PPC::G8RCRegisterClass);
- BuildMI(FirstMBB, MBBI, TII.get(PPC::MovePCtoLR8), PPC::LR8);
- BuildMI(FirstMBB, MBBI, TII.get(PPC::MFLR8), GlobalBaseReg);
- }
- }
- return CurDAG->getRegister(GlobalBaseReg, PPCLowering.getPointerTy()).Val;
-}
-
-/// isIntS16Immediate - This method tests to see if the node is either a 32-bit
-/// or 64-bit immediate, and if the value can be accurately represented as a
-/// sign extension from a 16-bit value. If so, this returns true and the
-/// immediate.
-static bool isIntS16Immediate(SDNode *N, short &Imm) {
- if (N->getOpcode() != ISD::Constant)
- return false;
-
- Imm = (short)cast<ConstantSDNode>(N)->getValue();
- if (N->getValueType(0) == MVT::i32)
- return Imm == (int32_t)cast<ConstantSDNode>(N)->getValue();
- else
- return Imm == (int64_t)cast<ConstantSDNode>(N)->getValue();
-}
-
-static bool isIntS16Immediate(SDOperand Op, short &Imm) {
- return isIntS16Immediate(Op.Val, Imm);
-}
-
-
-/// isInt32Immediate - This method tests to see if the node is a 32-bit constant
-/// operand. If so Imm will receive the 32-bit value.
-static bool isInt32Immediate(SDNode *N, unsigned &Imm) {
- if (N->getOpcode() == ISD::Constant && N->getValueType(0) == MVT::i32) {
- Imm = cast<ConstantSDNode>(N)->getValue();
- return true;
- }
- return false;
-}
-
-/// isInt64Immediate - This method tests to see if the node is a 64-bit constant
-/// operand. If so Imm will receive the 64-bit value.
-static bool isInt64Immediate(SDNode *N, uint64_t &Imm) {
- if (N->getOpcode() == ISD::Constant && N->getValueType(0) == MVT::i64) {
- Imm = cast<ConstantSDNode>(N)->getValue();
- return true;
- }
- return false;
-}
-
-// isInt32Immediate - This method tests to see if a constant operand.
-// If so Imm will receive the 32 bit value.
-static bool isInt32Immediate(SDOperand N, unsigned &Imm) {
- return isInt32Immediate(N.Val, Imm);
-}
-
-
-// isOpcWithIntImmediate - This method tests to see if the node is a specific
-// opcode and that it has a immediate integer right operand.
-// If so Imm will receive the 32 bit value.
-static bool isOpcWithIntImmediate(SDNode *N, unsigned Opc, unsigned& Imm) {
- return N->getOpcode() == Opc && isInt32Immediate(N->getOperand(1).Val, Imm);
-}
-
-bool PPCDAGToDAGISel::isRunOfOnes(unsigned Val, unsigned &MB, unsigned &ME) {
- if (isShiftedMask_32(Val)) {
- // look for the first non-zero bit
- MB = CountLeadingZeros_32(Val);
- // look for the first zero bit after the run of ones
- ME = CountLeadingZeros_32((Val - 1) ^ Val);
- return true;
- } else {
- Val = ~Val; // invert mask
- if (isShiftedMask_32(Val)) {
- // effectively look for the first zero bit
- ME = CountLeadingZeros_32(Val) - 1;
- // effectively look for the first one bit after the run of zeros
- MB = CountLeadingZeros_32((Val - 1) ^ Val) + 1;
- return true;
- }
- }
- // no run present
- return false;
-}
-
-bool PPCDAGToDAGISel::isRotateAndMask(SDNode *N, unsigned Mask,
- bool IsShiftMask, unsigned &SH,
- unsigned &MB, unsigned &ME) {
- // Don't even go down this path for i64, since different logic will be
- // necessary for rldicl/rldicr/rldimi.
- if (N->getValueType(0) != MVT::i32)
- return false;
-
- unsigned Shift = 32;
- unsigned Indeterminant = ~0; // bit mask marking indeterminant results
- unsigned Opcode = N->getOpcode();
- if (N->getNumOperands() != 2 ||
- !isInt32Immediate(N->getOperand(1).Val, Shift) || (Shift > 31))
- return false;
-
- if (Opcode == ISD::SHL) {
- // apply shift left to mask if it comes first
- if (IsShiftMask) Mask = Mask << Shift;
- // determine which bits are made indeterminant by shift
- Indeterminant = ~(0xFFFFFFFFu << Shift);
- } else if (Opcode == ISD::SRL) {
- // apply shift right to mask if it comes first
- if (IsShiftMask) Mask = Mask >> Shift;
- // determine which bits are made indeterminant by shift
- Indeterminant = ~(0xFFFFFFFFu >> Shift);
- // adjust for the left rotate
- Shift = 32 - Shift;
- } else if (Opcode == ISD::ROTL) {
- Indeterminant = 0;
- } else {
- return false;
- }
-
- // if the mask doesn't intersect any Indeterminant bits
- if (Mask && !(Mask & Indeterminant)) {
- SH = Shift & 31;
- // make sure the mask is still a mask (wrap arounds may not be)
- return isRunOfOnes(Mask, MB, ME);
- }
- return false;
-}
-
-/// SelectBitfieldInsert - turn an or of two masked values into
-/// the rotate left word immediate then mask insert (rlwimi) instruction.
-SDNode *PPCDAGToDAGISel::SelectBitfieldInsert(SDNode *N) {
- SDOperand Op0 = N->getOperand(0);
- SDOperand Op1 = N->getOperand(1);
-
- APInt LKZ, LKO, RKZ, RKO;
- CurDAG->ComputeMaskedBits(Op0, APInt::getAllOnesValue(32), LKZ, LKO);
- CurDAG->ComputeMaskedBits(Op1, APInt::getAllOnesValue(32), RKZ, RKO);
-
- unsigned TargetMask = LKZ.getZExtValue();
- unsigned InsertMask = RKZ.getZExtValue();
-
- if ((TargetMask | InsertMask) == 0xFFFFFFFF) {
- unsigned Op0Opc = Op0.getOpcode();
- unsigned Op1Opc = Op1.getOpcode();
- unsigned Value, SH = 0;
- TargetMask = ~TargetMask;
- InsertMask = ~InsertMask;
-
- // If the LHS has a foldable shift and the RHS does not, then swap it to the
- // RHS so that we can fold the shift into the insert.
- if (Op0Opc == ISD::AND && Op1Opc == ISD::AND) {
- if (Op0.getOperand(0).getOpcode() == ISD::SHL ||
- Op0.getOperand(0).getOpcode() == ISD::SRL) {
- if (Op1.getOperand(0).getOpcode() != ISD::SHL &&
- Op1.getOperand(0).getOpcode() != ISD::SRL) {
- std::swap(Op0, Op1);
- std::swap(Op0Opc, Op1Opc);
- std::swap(TargetMask, InsertMask);
- }
- }
- } else if (Op0Opc == ISD::SHL || Op0Opc == ISD::SRL) {
- if (Op1Opc == ISD::AND && Op1.getOperand(0).getOpcode() != ISD::SHL &&
- Op1.getOperand(0).getOpcode() != ISD::SRL) {
- std::swap(Op0, Op1);
- std::swap(Op0Opc, Op1Opc);
- std::swap(TargetMask, InsertMask);
- }
- }
-
- unsigned MB, ME;
- if (InsertMask && isRunOfOnes(InsertMask, MB, ME)) {
- SDOperand Tmp1, Tmp2, Tmp3;
- bool DisjointMask = (TargetMask ^ InsertMask) == 0xFFFFFFFF;
-
- if ((Op1Opc == ISD::SHL || Op1Opc == ISD::SRL) &&
- isInt32Immediate(Op1.getOperand(1), Value)) {
- Op1 = Op1.getOperand(0);
- SH = (Op1Opc == ISD::SHL) ? Value : 32 - Value;
- }
- if (Op1Opc == ISD::AND) {
- unsigned SHOpc = Op1.getOperand(0).getOpcode();
- if ((SHOpc == ISD::SHL || SHOpc == ISD::SRL) &&
- isInt32Immediate(Op1.getOperand(0).getOperand(1), Value)) {
- Op1 = Op1.getOperand(0).getOperand(0);
- SH = (SHOpc == ISD::SHL) ? Value : 32 - Value;
- } else {
- Op1 = Op1.getOperand(0);
- }
- }
-
- Tmp3 = (Op0Opc == ISD::AND && DisjointMask) ? Op0.getOperand(0) : Op0;
- AddToISelQueue(Tmp3);
- AddToISelQueue(Op1);
- SH &= 31;
- SDOperand Ops[] = { Tmp3, Op1, getI32Imm(SH), getI32Imm(MB),
- getI32Imm(ME) };
- return CurDAG->getTargetNode(PPC::RLWIMI, MVT::i32, Ops, 5);
- }
- }
- return 0;
-}
-
-/// SelectCC - Select a comparison of the specified values with the specified
-/// condition code, returning the CR# of the expression.
-SDOperand PPCDAGToDAGISel::SelectCC(SDOperand LHS, SDOperand RHS,
- ISD::CondCode CC) {
- // Always select the LHS.
- AddToISelQueue(LHS);
- unsigned Opc;
-
- if (LHS.getValueType() == MVT::i32) {
- unsigned Imm;
- if (CC == ISD::SETEQ || CC == ISD::SETNE) {
- if (isInt32Immediate(RHS, Imm)) {
- // SETEQ/SETNE comparison with 16-bit immediate, fold it.
- if (isUInt16(Imm))
- return SDOperand(CurDAG->getTargetNode(PPC::CMPLWI, MVT::i32, LHS,
- getI32Imm(Imm & 0xFFFF)), 0);
- // If this is a 16-bit signed immediate, fold it.
- if (isInt16((int)Imm))
- return SDOperand(CurDAG->getTargetNode(PPC::CMPWI, MVT::i32, LHS,
- getI32Imm(Imm & 0xFFFF)), 0);
-
- // For non-equality comparisons, the default code would materialize the
- // constant, then compare against it, like this:
- // lis r2, 4660
- // ori r2, r2, 22136
- // cmpw cr0, r3, r2
- // Since we are just comparing for equality, we can emit this instead:
- // xoris r0,r3,0x1234
- // cmplwi cr0,r0,0x5678
- // beq cr0,L6
- SDOperand Xor(CurDAG->getTargetNode(PPC::XORIS, MVT::i32, LHS,
- getI32Imm(Imm >> 16)), 0);
- return SDOperand(CurDAG->getTargetNode(PPC::CMPLWI, MVT::i32, Xor,
- getI32Imm(Imm & 0xFFFF)), 0);
- }
- Opc = PPC::CMPLW;
- } else if (ISD::isUnsignedIntSetCC(CC)) {
- if (isInt32Immediate(RHS, Imm) && isUInt16(Imm))
- return SDOperand(CurDAG->getTargetNode(PPC::CMPLWI, MVT::i32, LHS,
- getI32Imm(Imm & 0xFFFF)), 0);
- Opc = PPC::CMPLW;
- } else {
- short SImm;
- if (isIntS16Immediate(RHS, SImm))
- return SDOperand(CurDAG->getTargetNode(PPC::CMPWI, MVT::i32, LHS,
- getI32Imm((int)SImm & 0xFFFF)),
- 0);
- Opc = PPC::CMPW;
- }
- } else if (LHS.getValueType() == MVT::i64) {
- uint64_t Imm;
- if (CC == ISD::SETEQ || CC == ISD::SETNE) {
- if (isInt64Immediate(RHS.Val, Imm)) {
- // SETEQ/SETNE comparison with 16-bit immediate, fold it.
- if (isUInt16(Imm))
- return SDOperand(CurDAG->getTargetNode(PPC::CMPLDI, MVT::i64, LHS,
- getI32Imm(Imm & 0xFFFF)), 0);
- // If this is a 16-bit signed immediate, fold it.
- if (isInt16(Imm))
- return SDOperand(CurDAG->getTargetNode(PPC::CMPDI, MVT::i64, LHS,
- getI32Imm(Imm & 0xFFFF)), 0);
-
- // For non-equality comparisons, the default code would materialize the
- // constant, then compare against it, like this:
- // lis r2, 4660
- // ori r2, r2, 22136
- // cmpd cr0, r3, r2
- // Since we are just comparing for equality, we can emit this instead:
- // xoris r0,r3,0x1234
- // cmpldi cr0,r0,0x5678
- // beq cr0,L6
- if (isUInt32(Imm)) {
- SDOperand Xor(CurDAG->getTargetNode(PPC::XORIS8, MVT::i64, LHS,
- getI64Imm(Imm >> 16)), 0);
- return SDOperand(CurDAG->getTargetNode(PPC::CMPLDI, MVT::i64, Xor,
- getI64Imm(Imm & 0xFFFF)), 0);
- }
- }
- Opc = PPC::CMPLD;
- } else if (ISD::isUnsignedIntSetCC(CC)) {
- if (isInt64Immediate(RHS.Val, Imm) && isUInt16(Imm))
- return SDOperand(CurDAG->getTargetNode(PPC::CMPLDI, MVT::i64, LHS,
- getI64Imm(Imm & 0xFFFF)), 0);
- Opc = PPC::CMPLD;
- } else {
- short SImm;
- if (isIntS16Immediate(RHS, SImm))
- return SDOperand(CurDAG->getTargetNode(PPC::CMPDI, MVT::i64, LHS,
- getI64Imm(SImm & 0xFFFF)),
- 0);
- Opc = PPC::CMPD;
- }
- } else if (LHS.getValueType() == MVT::f32) {
- Opc = PPC::FCMPUS;
- } else {
- assert(LHS.getValueType() == MVT::f64 && "Unknown vt!");
- Opc = PPC::FCMPUD;
- }
- AddToISelQueue(RHS);
- return SDOperand(CurDAG->getTargetNode(Opc, MVT::i32, LHS, RHS), 0);
-}
-
-static PPC::Predicate getPredicateForSetCC(ISD::CondCode CC) {
- switch (CC) {
- default: assert(0 && "Unknown condition!"); abort();
- case ISD::SETOEQ: // FIXME: This is incorrect see PR642.
- case ISD::SETUEQ:
- case ISD::SETEQ: return PPC::PRED_EQ;
- case ISD::SETONE: // FIXME: This is incorrect see PR642.
- case ISD::SETUNE:
- case ISD::SETNE: return PPC::PRED_NE;
- case ISD::SETOLT: // FIXME: This is incorrect see PR642.
- case ISD::SETULT:
- case ISD::SETLT: return PPC::PRED_LT;
- case ISD::SETOLE: // FIXME: This is incorrect see PR642.
- case ISD::SETULE:
- case ISD::SETLE: return PPC::PRED_LE;
- case ISD::SETOGT: // FIXME: This is incorrect see PR642.
- case ISD::SETUGT:
- case ISD::SETGT: return PPC::PRED_GT;
- case ISD::SETOGE: // FIXME: This is incorrect see PR642.
- case ISD::SETUGE:
- case ISD::SETGE: return PPC::PRED_GE;
-
- case ISD::SETO: return PPC::PRED_NU;
- case ISD::SETUO: return PPC::PRED_UN;
- }
-}
-
-/// getCRIdxForSetCC - Return the index of the condition register field
-/// associated with the SetCC condition, and whether or not the field is
-/// treated as inverted. That is, lt = 0; ge = 0 inverted.
-///
-/// If this returns with Other != -1, then the returned comparison is an or of
-/// two simpler comparisons. In this case, Invert is guaranteed to be false.
-static unsigned getCRIdxForSetCC(ISD::CondCode CC, bool &Invert, int &Other) {
- Invert = false;
- Other = -1;
- switch (CC) {
- default: assert(0 && "Unknown condition!"); abort();
- case ISD::SETOLT:
- case ISD::SETLT: return 0; // Bit #0 = SETOLT
- case ISD::SETOGT:
- case ISD::SETGT: return 1; // Bit #1 = SETOGT
- case ISD::SETOEQ:
- case ISD::SETEQ: return 2; // Bit #2 = SETOEQ
- case ISD::SETUO: return 3; // Bit #3 = SETUO
- case ISD::SETUGE:
- case ISD::SETGE: Invert = true; return 0; // !Bit #0 = SETUGE
- case ISD::SETULE:
- case ISD::SETLE: Invert = true; return 1; // !Bit #1 = SETULE
- case ISD::SETUNE:
- case ISD::SETNE: Invert = true; return 2; // !Bit #2 = SETUNE
- case ISD::SETO: Invert = true; return 3; // !Bit #3 = SETO
- case ISD::SETULT: Other = 0; return 3; // SETOLT | SETUO
- case ISD::SETUGT: Other = 1; return 3; // SETOGT | SETUO
- case ISD::SETUEQ: Other = 2; return 3; // SETOEQ | SETUO
- case ISD::SETOGE: Other = 1; return 2; // SETOGT | SETOEQ
- case ISD::SETOLE: Other = 0; return 2; // SETOLT | SETOEQ
- case ISD::SETONE: Other = 0; return 1; // SETOLT | SETOGT
- }
- return 0;
-}
-
-SDNode *PPCDAGToDAGISel::SelectSETCC(SDOperand Op) {
- SDNode *N = Op.Val;
- unsigned Imm;
- ISD::CondCode CC = cast<CondCodeSDNode>(N->getOperand(2))->get();
- if (isInt32Immediate(N->getOperand(1), Imm)) {
- // We can codegen setcc op, imm very efficiently compared to a brcond.
- // Check for those cases here.
- // setcc op, 0
- if (Imm == 0) {
- SDOperand Op = N->getOperand(0);
- AddToISelQueue(Op);
- switch (CC) {
- default: break;
- case ISD::SETEQ: {
- Op = SDOperand(CurDAG->getTargetNode(PPC::CNTLZW, MVT::i32, Op), 0);
- SDOperand Ops[] = { Op, getI32Imm(27), getI32Imm(5), getI32Imm(31) };
- return CurDAG->SelectNodeTo(N, PPC::RLWINM, MVT::i32, Ops, 4);
- }
- case ISD::SETNE: {
- SDOperand AD =
- SDOperand(CurDAG->getTargetNode(PPC::ADDIC, MVT::i32, MVT::Flag,
- Op, getI32Imm(~0U)), 0);
- return CurDAG->SelectNodeTo(N, PPC::SUBFE, MVT::i32, AD, Op,
- AD.getValue(1));
- }
- case ISD::SETLT: {
- SDOperand Ops[] = { Op, getI32Imm(1), getI32Imm(31), getI32Imm(31) };
- return CurDAG->SelectNodeTo(N, PPC::RLWINM, MVT::i32, Ops, 4);
- }
- case ISD::SETGT: {
- SDOperand T =
- SDOperand(CurDAG->getTargetNode(PPC::NEG, MVT::i32, Op), 0);
- T = SDOperand(CurDAG->getTargetNode(PPC::ANDC, MVT::i32, T, Op), 0);
- SDOperand Ops[] = { T, getI32Imm(1), getI32Imm(31), getI32Imm(31) };
- return CurDAG->SelectNodeTo(N, PPC::RLWINM, MVT::i32, Ops, 4);
- }
- }
- } else if (Imm == ~0U) { // setcc op, -1
- SDOperand Op = N->getOperand(0);
- AddToISelQueue(Op);
- switch (CC) {
- default: break;
- case ISD::SETEQ:
- Op = SDOperand(CurDAG->getTargetNode(PPC::ADDIC, MVT::i32, MVT::Flag,
- Op, getI32Imm(1)), 0);
- return CurDAG->SelectNodeTo(N, PPC::ADDZE, MVT::i32,
- SDOperand(CurDAG->getTargetNode(PPC::LI, MVT::i32,
- getI32Imm(0)), 0),
- Op.getValue(1));
- case ISD::SETNE: {
- Op = SDOperand(CurDAG->getTargetNode(PPC::NOR, MVT::i32, Op, Op), 0);
- SDNode *AD = CurDAG->getTargetNode(PPC::ADDIC, MVT::i32, MVT::Flag,
- Op, getI32Imm(~0U));
- return CurDAG->SelectNodeTo(N, PPC::SUBFE, MVT::i32, SDOperand(AD, 0),
- Op, SDOperand(AD, 1));
- }
- case ISD::SETLT: {
- SDOperand AD = SDOperand(CurDAG->getTargetNode(PPC::ADDI, MVT::i32, Op,
- getI32Imm(1)), 0);
- SDOperand AN = SDOperand(CurDAG->getTargetNode(PPC::AND, MVT::i32, AD,
- Op), 0);
- SDOperand Ops[] = { AN, getI32Imm(1), getI32Imm(31), getI32Imm(31) };
- return CurDAG->SelectNodeTo(N, PPC::RLWINM, MVT::i32, Ops, 4);
- }
- case ISD::SETGT: {
- SDOperand Ops[] = { Op, getI32Imm(1), getI32Imm(31), getI32Imm(31) };
- Op = SDOperand(CurDAG->getTargetNode(PPC::RLWINM, MVT::i32, Ops, 4), 0);
- return CurDAG->SelectNodeTo(N, PPC::XORI, MVT::i32, Op,
- getI32Imm(1));
- }
- }
- }
- }
-
- bool Inv;
- int OtherCondIdx;
- unsigned Idx = getCRIdxForSetCC(CC, Inv, OtherCondIdx);
- SDOperand CCReg = SelectCC(N->getOperand(0), N->getOperand(1), CC);
- SDOperand IntCR;
-
- // Force the ccreg into CR7.
- SDOperand CR7Reg = CurDAG->getRegister(PPC::CR7, MVT::i32);
-
- SDOperand InFlag(0, 0); // Null incoming flag value.
- CCReg = CurDAG->getCopyToReg(CurDAG->getEntryNode(), CR7Reg, CCReg,
- InFlag).getValue(1);
-
- if (PPCSubTarget.isGigaProcessor() && OtherCondIdx == -1)
- IntCR = SDOperand(CurDAG->getTargetNode(PPC::MFOCRF, MVT::i32, CR7Reg,
- CCReg), 0);
- else
- IntCR = SDOperand(CurDAG->getTargetNode(PPC::MFCR, MVT::i32, CCReg), 0);
-
- SDOperand Ops[] = { IntCR, getI32Imm((32-(3-Idx)) & 31),
- getI32Imm(31), getI32Imm(31) };
- if (OtherCondIdx == -1 && !Inv)
- return CurDAG->SelectNodeTo(N, PPC::RLWINM, MVT::i32, Ops, 4);
-
- // Get the specified bit.
- SDOperand Tmp =
- SDOperand(CurDAG->getTargetNode(PPC::RLWINM, MVT::i32, Ops, 4), 0);
- if (Inv) {
- assert(OtherCondIdx == -1 && "Can't have split plus negation");
- return CurDAG->SelectNodeTo(N, PPC::XORI, MVT::i32, Tmp, getI32Imm(1));
- }
-
- // Otherwise, we have to turn an operation like SETONE -> SETOLT | SETOGT.
- // We already got the bit for the first part of the comparison (e.g. SETULE).
-
- // Get the other bit of the comparison.
- Ops[1] = getI32Imm((32-(3-OtherCondIdx)) & 31);
- SDOperand OtherCond =
- SDOperand(CurDAG->getTargetNode(PPC::RLWINM, MVT::i32, Ops, 4), 0);
-
- return CurDAG->SelectNodeTo(N, PPC::OR, MVT::i32, Tmp, OtherCond);
-}
-
-
-// Select - Convert the specified operand from a target-independent to a
-// target-specific node if it hasn't already been changed.
-SDNode *PPCDAGToDAGISel::Select(SDOperand Op) {
- SDNode *N = Op.Val;
- if (N->getOpcode() >= ISD::BUILTIN_OP_END &&
- N->getOpcode() < PPCISD::FIRST_NUMBER)
- return NULL; // Already selected.
-
- switch (N->getOpcode()) {
- default: break;
-
- case ISD::Constant: {
- if (N->getValueType(0) == MVT::i64) {
- // Get 64 bit value.
- int64_t Imm = cast<ConstantSDNode>(N)->getValue();
- // Assume no remaining bits.
- unsigned Remainder = 0;
- // Assume no shift required.
- unsigned Shift = 0;
-
- // If it can't be represented as a 32 bit value.
- if (!isInt32(Imm)) {
- Shift = CountTrailingZeros_64(Imm);
- int64_t ImmSh = static_cast<uint64_t>(Imm) >> Shift;
-
- // If the shifted value fits 32 bits.
- if (isInt32(ImmSh)) {
- // Go with the shifted value.
- Imm = ImmSh;
- } else {
- // Still stuck with a 64 bit value.
- Remainder = Imm;
- Shift = 32;
- Imm >>= 32;
- }
- }
-
- // Intermediate operand.
- SDNode *Result;
-
- // Handle first 32 bits.
- unsigned Lo = Imm & 0xFFFF;
- unsigned Hi = (Imm >> 16) & 0xFFFF;
-
- // Simple value.
- if (isInt16(Imm)) {
- // Just the Lo bits.
- Result = CurDAG->getTargetNode(PPC::LI8, MVT::i64, getI32Imm(Lo));
- } else if (Lo) {
- // Handle the Hi bits.
- unsigned OpC = Hi ? PPC::LIS8 : PPC::LI8;
- Result = CurDAG->getTargetNode(OpC, MVT::i64, getI32Imm(Hi));
- // And Lo bits.
- Result = CurDAG->getTargetNode(PPC::ORI8, MVT::i64,
- SDOperand(Result, 0), getI32Imm(Lo));
- } else {
- // Just the Hi bits.
- Result = CurDAG->getTargetNode(PPC::LIS8, MVT::i64, getI32Imm(Hi));
- }
-
- // If no shift, we're done.
- if (!Shift) return Result;
-
- // Shift for next step if the upper 32-bits were not zero.
- if (Imm) {
- Result = CurDAG->getTargetNode(PPC::RLDICR, MVT::i64,
- SDOperand(Result, 0),
- getI32Imm(Shift), getI32Imm(63 - Shift));
- }
-
- // Add in the last bits as required.
- if ((Hi = (Remainder >> 16) & 0xFFFF)) {
- Result = CurDAG->getTargetNode(PPC::ORIS8, MVT::i64,
- SDOperand(Result, 0), getI32Imm(Hi));
- }
- if ((Lo = Remainder & 0xFFFF)) {
- Result = CurDAG->getTargetNode(PPC::ORI8, MVT::i64,
- SDOperand(Result, 0), getI32Imm(Lo));
- }
-
- return Result;
- }
- break;
- }
-
- case ISD::SETCC:
- return SelectSETCC(Op);
- case PPCISD::GlobalBaseReg:
- return getGlobalBaseReg();
-
- case ISD::FrameIndex: {
- int FI = cast<FrameIndexSDNode>(N)->getIndex();
- SDOperand TFI = CurDAG->getTargetFrameIndex(FI, Op.getValueType());
- unsigned Opc = Op.getValueType() == MVT::i32 ? PPC::ADDI : PPC::ADDI8;
- if (N->hasOneUse())
- return CurDAG->SelectNodeTo(N, Opc, Op.getValueType(), TFI,
- getSmallIPtrImm(0));
- return CurDAG->getTargetNode(Opc, Op.getValueType(), TFI,
- getSmallIPtrImm(0));
- }
-
- case PPCISD::MFCR: {
- SDOperand InFlag = N->getOperand(1);
- AddToISelQueue(InFlag);
- // Use MFOCRF if supported.
- if (PPCSubTarget.isGigaProcessor())
- return CurDAG->getTargetNode(PPC::MFOCRF, MVT::i32,
- N->getOperand(0), InFlag);
- else
- return CurDAG->getTargetNode(PPC::MFCR, MVT::i32, InFlag);
- }
-
- case ISD::SDIV: {
- // FIXME: since this depends on the setting of the carry flag from the srawi
- // we should really be making notes about that for the scheduler.
- // FIXME: It sure would be nice if we could cheaply recognize the
- // srl/add/sra pattern the dag combiner will generate for this as
- // sra/addze rather than having to handle sdiv ourselves. oh well.
- unsigned Imm;
- if (isInt32Immediate(N->getOperand(1), Imm)) {
- SDOperand N0 = N->getOperand(0);
- AddToISelQueue(N0);
- if ((signed)Imm > 0 && isPowerOf2_32(Imm)) {
- SDNode *Op =
- CurDAG->getTargetNode(PPC::SRAWI, MVT::i32, MVT::Flag,
- N0, getI32Imm(Log2_32(Imm)));
- return CurDAG->SelectNodeTo(N, PPC::ADDZE, MVT::i32,
- SDOperand(Op, 0), SDOperand(Op, 1));
- } else if ((signed)Imm < 0 && isPowerOf2_32(-Imm)) {
- SDNode *Op =
- CurDAG->getTargetNode(PPC::SRAWI, MVT::i32, MVT::Flag,
- N0, getI32Imm(Log2_32(-Imm)));
- SDOperand PT =
- SDOperand(CurDAG->getTargetNode(PPC::ADDZE, MVT::i32,
- SDOperand(Op, 0), SDOperand(Op, 1)),
- 0);
- return CurDAG->SelectNodeTo(N, PPC::NEG, MVT::i32, PT);
- }
- }
-
- // Other cases are autogenerated.
- break;
- }
-
- case ISD::LOAD: {
- // Handle preincrement loads.
- LoadSDNode *LD = cast<LoadSDNode>(Op);
- MVT::ValueType LoadedVT = LD->getMemoryVT();
-
- // Normal loads are handled by code generated from the .td file.
- if (LD->getAddressingMode() != ISD::PRE_INC)
- break;
-
- SDOperand Offset = LD->getOffset();
- if (isa<ConstantSDNode>(Offset) ||
- Offset.getOpcode() == ISD::TargetGlobalAddress) {
-
- unsigned Opcode;
- bool isSExt = LD->getExtensionType() == ISD::SEXTLOAD;
- if (LD->getValueType(0) != MVT::i64) {
- // Handle PPC32 integer and normal FP loads.
- assert((!isSExt || LoadedVT == MVT::i16) && "Invalid sext update load");
- switch (LoadedVT) {
- default: assert(0 && "Invalid PPC load type!");
- case MVT::f64: Opcode = PPC::LFDU; break;
- case MVT::f32: Opcode = PPC::LFSU; break;
- case MVT::i32: Opcode = PPC::LWZU; break;
- case MVT::i16: Opcode = isSExt ? PPC::LHAU : PPC::LHZU; break;
- case MVT::i1:
- case MVT::i8: Opcode = PPC::LBZU; break;
- }
- } else {
- assert(LD->getValueType(0) == MVT::i64 && "Unknown load result type!");
- assert((!isSExt || LoadedVT == MVT::i16) && "Invalid sext update load");
- switch (LoadedVT) {
- default: assert(0 && "Invalid PPC load type!");
- case MVT::i64: Opcode = PPC::LDU; break;
- case MVT::i32: Opcode = PPC::LWZU8; break;
- case MVT::i16: Opcode = isSExt ? PPC::LHAU8 : PPC::LHZU8; break;
- case MVT::i1:
- case MVT::i8: Opcode = PPC::LBZU8; break;
- }
- }
-
- SDOperand Chain = LD->getChain();
- SDOperand Base = LD->getBasePtr();
- AddToISelQueue(Chain);
- AddToISelQueue(Base);
- AddToISelQueue(Offset);
- SDOperand Ops[] = { Offset, Base, Chain };
- // FIXME: PPC64
- return CurDAG->getTargetNode(Opcode, MVT::i32, MVT::i32,
- MVT::Other, Ops, 3);
- } else {
- assert(0 && "R+R preindex loads not supported yet!");
- }
- }
-
- case ISD::AND: {
- unsigned Imm, Imm2, SH, MB, ME;
-
- // If this is an and of a value rotated between 0 and 31 bits and then and'd
- // with a mask, emit rlwinm
- if (isInt32Immediate(N->getOperand(1), Imm) &&
- isRotateAndMask(N->getOperand(0).Val, Imm, false, SH, MB, ME)) {
- SDOperand Val = N->getOperand(0).getOperand(0);
- AddToISelQueue(Val);
- SDOperand Ops[] = { Val, getI32Imm(SH), getI32Imm(MB), getI32Imm(ME) };
- return CurDAG->SelectNodeTo(N, PPC::RLWINM, MVT::i32, Ops, 4);
- }
- // If this is just a masked value where the input is not handled above, and
- // is not a rotate-left (handled by a pattern in the .td file), emit rlwinm
- if (isInt32Immediate(N->getOperand(1), Imm) &&
- isRunOfOnes(Imm, MB, ME) &&
- N->getOperand(0).getOpcode() != ISD::ROTL) {
- SDOperand Val = N->getOperand(0);
- AddToISelQueue(Val);
- SDOperand Ops[] = { Val, getI32Imm(0), getI32Imm(MB), getI32Imm(ME) };
- return CurDAG->SelectNodeTo(N, PPC::RLWINM, MVT::i32, Ops, 4);
- }
- // AND X, 0 -> 0, not "rlwinm 32".
- if (isInt32Immediate(N->getOperand(1), Imm) && (Imm == 0)) {
- AddToISelQueue(N->getOperand(1));
- ReplaceUses(SDOperand(N, 0), N->getOperand(1));
- return NULL;
- }
- // ISD::OR doesn't get all the bitfield insertion fun.
- // (and (or x, c1), c2) where isRunOfOnes(~(c1^c2)) is a bitfield insert
- if (isInt32Immediate(N->getOperand(1), Imm) &&
- N->getOperand(0).getOpcode() == ISD::OR &&
- isInt32Immediate(N->getOperand(0).getOperand(1), Imm2)) {
- unsigned MB, ME;
- Imm = ~(Imm^Imm2);
- if (isRunOfOnes(Imm, MB, ME)) {
- AddToISelQueue(N->getOperand(0).getOperand(0));
- AddToISelQueue(N->getOperand(0).getOperand(1));
- SDOperand Ops[] = { N->getOperand(0).getOperand(0),
- N->getOperand(0).getOperand(1),
- getI32Imm(0), getI32Imm(MB),getI32Imm(ME) };
- return CurDAG->getTargetNode(PPC::RLWIMI, MVT::i32, Ops, 5);
- }
- }
-
- // Other cases are autogenerated.
- break;
- }
- case ISD::OR:
- if (N->getValueType(0) == MVT::i32)
- if (SDNode *I = SelectBitfieldInsert(N))
- return I;
-
- // Other cases are autogenerated.
- break;
- case ISD::SHL: {
- unsigned Imm, SH, MB, ME;
- if (isOpcWithIntImmediate(N->getOperand(0).Val, ISD::AND, Imm) &&
- isRotateAndMask(N, Imm, true, SH, MB, ME)) {
- AddToISelQueue(N->getOperand(0).getOperand(0));
- SDOperand Ops[] = { N->getOperand(0).getOperand(0),
- getI32Imm(SH), getI32Imm(MB), getI32Imm(ME) };
- return CurDAG->SelectNodeTo(N, PPC::RLWINM, MVT::i32, Ops, 4);
- }
-
- // Other cases are autogenerated.
- break;
- }
- case ISD::SRL: {
- unsigned Imm, SH, MB, ME;
- if (isOpcWithIntImmediate(N->getOperand(0).Val, ISD::AND, Imm) &&
- isRotateAndMask(N, Imm, true, SH, MB, ME)) {
- AddToISelQueue(N->getOperand(0).getOperand(0));
- SDOperand Ops[] = { N->getOperand(0).getOperand(0),
- getI32Imm(SH), getI32Imm(MB), getI32Imm(ME) };
- return CurDAG->SelectNodeTo(N, PPC::RLWINM, MVT::i32, Ops, 4);
- }
-
- // Other cases are autogenerated.
- break;
- }
- case ISD::SELECT_CC: {
- ISD::CondCode CC = cast<CondCodeSDNode>(N->getOperand(4))->get();
-
- // Handle the setcc cases here. select_cc lhs, 0, 1, 0, cc
- if (ConstantSDNode *N1C = dyn_cast<ConstantSDNode>(N->getOperand(1)))
- if (ConstantSDNode *N2C = dyn_cast<ConstantSDNode>(N->getOperand(2)))
- if (ConstantSDNode *N3C = dyn_cast<ConstantSDNode>(N->getOperand(3)))
- if (N1C->isNullValue() && N3C->isNullValue() &&
- N2C->getValue() == 1ULL && CC == ISD::SETNE &&
- // FIXME: Implement this optzn for PPC64.
- N->getValueType(0) == MVT::i32) {
- AddToISelQueue(N->getOperand(0));
- SDNode *Tmp =
- CurDAG->getTargetNode(PPC::ADDIC, MVT::i32, MVT::Flag,
- N->getOperand(0), getI32Imm(~0U));
- return CurDAG->SelectNodeTo(N, PPC::SUBFE, MVT::i32,
- SDOperand(Tmp, 0), N->getOperand(0),
- SDOperand(Tmp, 1));
- }
-
- SDOperand CCReg = SelectCC(N->getOperand(0), N->getOperand(1), CC);
- unsigned BROpc = getPredicateForSetCC(CC);
-
- unsigned SelectCCOp;
- if (N->getValueType(0) == MVT::i32)
- SelectCCOp = PPC::SELECT_CC_I4;
- else if (N->getValueType(0) == MVT::i64)
- SelectCCOp = PPC::SELECT_CC_I8;
- else if (N->getValueType(0) == MVT::f32)
- SelectCCOp = PPC::SELECT_CC_F4;
- else if (N->getValueType(0) == MVT::f64)
- SelectCCOp = PPC::SELECT_CC_F8;
- else
- SelectCCOp = PPC::SELECT_CC_VRRC;
-
- AddToISelQueue(N->getOperand(2));
- AddToISelQueue(N->getOperand(3));
- SDOperand Ops[] = { CCReg, N->getOperand(2), N->getOperand(3),
- getI32Imm(BROpc) };
- return CurDAG->SelectNodeTo(N, SelectCCOp, N->getValueType(0), Ops, 4);
- }
- case PPCISD::COND_BRANCH: {
- AddToISelQueue(N->getOperand(0)); // Op #0 is the Chain.
- // Op #1 is the PPC::PRED_* number.
- // Op #2 is the CR#
- // Op #3 is the Dest MBB
- AddToISelQueue(N->getOperand(4)); // Op #4 is the Flag.
- // Prevent PPC::PRED_* from being selected into LI.
- SDOperand Pred =
- getI32Imm(cast<ConstantSDNode>(N->getOperand(1))->getValue());
- SDOperand Ops[] = { Pred, N->getOperand(2), N->getOperand(3),
- N->getOperand(0), N->getOperand(4) };
- return CurDAG->SelectNodeTo(N, PPC::BCC, MVT::Other, Ops, 5);
- }
- case ISD::BR_CC: {
- AddToISelQueue(N->getOperand(0));
- ISD::CondCode CC = cast<CondCodeSDNode>(N->getOperand(1))->get();
- SDOperand CondCode = SelectCC(N->getOperand(2), N->getOperand(3), CC);
- SDOperand Ops[] = { getI32Imm(getPredicateForSetCC(CC)), CondCode,
- N->getOperand(4), N->getOperand(0) };
- return CurDAG->SelectNodeTo(N, PPC::BCC, MVT::Other, Ops, 4);
- }
- case ISD::BRIND: {
- // FIXME: Should custom lower this.
- SDOperand Chain = N->getOperand(0);
- SDOperand Target = N->getOperand(1);
- AddToISelQueue(Chain);
- AddToISelQueue(Target);
- unsigned Opc = Target.getValueType() == MVT::i32 ? PPC::MTCTR : PPC::MTCTR8;
- Chain = SDOperand(CurDAG->getTargetNode(Opc, MVT::Other, Target,
- Chain), 0);
- return CurDAG->SelectNodeTo(N, PPC::BCTR, MVT::Other, Chain);
- }
- }
-
- return SelectCode(Op);
-}
-
-
-
-/// createPPCISelDag - This pass converts a legalized DAG into a
-/// PowerPC-specific DAG, ready for instruction scheduling.
-///
-FunctionPass *llvm::createPPCISelDag(PPCTargetMachine &TM) {
- return new PPCDAGToDAGISel(TM);
-}
-
diff --git a/release_23/lib/Target/PowerPC/PPCISelLowering.cpp b/release_23/lib/Target/PowerPC/PPCISelLowering.cpp
deleted file mode 100644
index 37b8e7bb114e..000000000000
--- a/release_23/lib/Target/PowerPC/PPCISelLowering.cpp
+++ /dev/null
@@ -1,4540 +0,0 @@
-//===-- PPCISelLowering.cpp - PPC DAG Lowering Implementation -------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the PPCISelLowering class.
-//
-//===----------------------------------------------------------------------===//
-
-#include "PPCISelLowering.h"
-#include "PPCMachineFunctionInfo.h"
-#include "PPCPredicates.h"
-#include "PPCTargetMachine.h"
-#include "PPCPerfectShuffle.h"
-#include "llvm/ADT/STLExtras.h"
-#include "llvm/ADT/VectorExtras.h"
-#include "llvm/Analysis/ScalarEvolutionExpressions.h"
-#include "llvm/CodeGen/CallingConvLower.h"
-#include "llvm/CodeGen/MachineFrameInfo.h"
-#include "llvm/CodeGen/MachineFunction.h"
-#include "llvm/CodeGen/MachineInstrBuilder.h"
-#include "llvm/CodeGen/MachineRegisterInfo.h"
-#include "llvm/CodeGen/PseudoSourceValue.h"
-#include "llvm/CodeGen/SelectionDAG.h"
-#include "llvm/CallingConv.h"
-#include "llvm/Constants.h"
-#include "llvm/Function.h"
-#include "llvm/Intrinsics.h"
-#include "llvm/ParameterAttributes.h"
-#include "llvm/Support/MathExtras.h"
-#include "llvm/Target/TargetOptions.h"
-#include "llvm/Support/CommandLine.h"
-using namespace llvm;
-
-static cl::opt<bool> EnablePPCPreinc("enable-ppc-preinc",
-cl::desc("enable preincrement load/store generation on PPC (experimental)"),
- cl::Hidden);
-
-PPCTargetLowering::PPCTargetLowering(PPCTargetMachine &TM)
- : TargetLowering(TM), PPCSubTarget(*TM.getSubtargetImpl()),
- PPCAtomicLabelIndex(0) {
-
- setPow2DivIsCheap();
-
- // Use _setjmp/_longjmp instead of setjmp/longjmp.
- setUseUnderscoreSetJmp(true);
- setUseUnderscoreLongJmp(true);
-
- // Set up the register classes.
- addRegisterClass(MVT::i32, PPC::GPRCRegisterClass);
- addRegisterClass(MVT::f32, PPC::F4RCRegisterClass);
- addRegisterClass(MVT::f64, PPC::F8RCRegisterClass);
-
- // PowerPC has an i16 but no i8 (or i1) SEXTLOAD
- setLoadXAction(ISD::SEXTLOAD, MVT::i1, Promote);
- setLoadXAction(ISD::SEXTLOAD, MVT::i8, Expand);
-
- setTruncStoreAction(MVT::f64, MVT::f32, Expand);
-
- // PowerPC has pre-inc load and store's.
- setIndexedLoadAction(ISD::PRE_INC, MVT::i1, Legal);
- setIndexedLoadAction(ISD::PRE_INC, MVT::i8, Legal);
- setIndexedLoadAction(ISD::PRE_INC, MVT::i16, Legal);
- setIndexedLoadAction(ISD::PRE_INC, MVT::i32, Legal);
- setIndexedLoadAction(ISD::PRE_INC, MVT::i64, Legal);
- setIndexedStoreAction(ISD::PRE_INC, MVT::i1, Legal);
- setIndexedStoreAction(ISD::PRE_INC, MVT::i8, Legal);
- setIndexedStoreAction(ISD::PRE_INC, MVT::i16, Legal);
- setIndexedStoreAction(ISD::PRE_INC, MVT::i32, Legal);
- setIndexedStoreAction(ISD::PRE_INC, MVT::i64, Legal);
-
- // Shortening conversions involving ppcf128 get expanded (2 regs -> 1 reg)
- setConvertAction(MVT::ppcf128, MVT::f64, Expand);
- setConvertAction(MVT::ppcf128, MVT::f32, Expand);
- // This is used in the ppcf128->int sequence. Note it has different semantics
- // from FP_ROUND: that rounds to nearest, this rounds to zero.
- setOperationAction(ISD::FP_ROUND_INREG, MVT::ppcf128, Custom);
-
- // PowerPC has no intrinsics for these particular operations
- setOperationAction(ISD::MEMBARRIER, MVT::Other, Expand);
-
- // PowerPC has no SREM/UREM instructions
- setOperationAction(ISD::SREM, MVT::i32, Expand);
- setOperationAction(ISD::UREM, MVT::i32, Expand);
- setOperationAction(ISD::SREM, MVT::i64, Expand);
- setOperationAction(ISD::UREM, MVT::i64, Expand);
-
- // Don't use SMUL_LOHI/UMUL_LOHI or SDIVREM/UDIVREM to lower SREM/UREM.
- setOperationAction(ISD::UMUL_LOHI, MVT::i32, Expand);
- setOperationAction(ISD::SMUL_LOHI, MVT::i32, Expand);
- setOperationAction(ISD::UMUL_LOHI, MVT::i64, Expand);
- setOperationAction(ISD::SMUL_LOHI, MVT::i64, Expand);
- setOperationAction(ISD::UDIVREM, MVT::i32, Expand);
- setOperationAction(ISD::SDIVREM, MVT::i32, Expand);
- setOperationAction(ISD::UDIVREM, MVT::i64, Expand);
- setOperationAction(ISD::SDIVREM, MVT::i64, Expand);
-
- // We don't support sin/cos/sqrt/fmod/pow
- setOperationAction(ISD::FSIN , MVT::f64, Expand);
- setOperationAction(ISD::FCOS , MVT::f64, Expand);
- setOperationAction(ISD::FREM , MVT::f64, Expand);
- setOperationAction(ISD::FPOW , MVT::f64, Expand);
- setOperationAction(ISD::FSIN , MVT::f32, Expand);
- setOperationAction(ISD::FCOS , MVT::f32, Expand);
- setOperationAction(ISD::FREM , MVT::f32, Expand);
- setOperationAction(ISD::FPOW , MVT::f32, Expand);
-
- setOperationAction(ISD::FLT_ROUNDS_, MVT::i32, Custom);
-
- // If we're enabling GP optimizations, use hardware square root
- if (!TM.getSubtarget<PPCSubtarget>().hasFSQRT()) {
- setOperationAction(ISD::FSQRT, MVT::f64, Expand);
- setOperationAction(ISD::FSQRT, MVT::f32, Expand);
- }
-
- setOperationAction(ISD::FCOPYSIGN, MVT::f64, Expand);
- setOperationAction(ISD::FCOPYSIGN, MVT::f32, Expand);
-
- // PowerPC does not have BSWAP, CTPOP or CTTZ
- setOperationAction(ISD::BSWAP, MVT::i32 , Expand);
- setOperationAction(ISD::CTPOP, MVT::i32 , Expand);
- setOperationAction(ISD::CTTZ , MVT::i32 , Expand);
- setOperationAction(ISD::BSWAP, MVT::i64 , Expand);
- setOperationAction(ISD::CTPOP, MVT::i64 , Expand);
- setOperationAction(ISD::CTTZ , MVT::i64 , Expand);
-
- // PowerPC does not have ROTR
- setOperationAction(ISD::ROTR, MVT::i32 , Expand);
-
- // PowerPC does not have Select
- setOperationAction(ISD::SELECT, MVT::i32, Expand);
- setOperationAction(ISD::SELECT, MVT::i64, Expand);
- setOperationAction(ISD::SELECT, MVT::f32, Expand);
- setOperationAction(ISD::SELECT, MVT::f64, Expand);
-
- // PowerPC wants to turn select_cc of FP into fsel when possible.
- setOperationAction(ISD::SELECT_CC, MVT::f32, Custom);
- setOperationAction(ISD::SELECT_CC, MVT::f64, Custom);
-
- // PowerPC wants to optimize integer setcc a bit
- setOperationAction(ISD::SETCC, MVT::i32, Custom);
-
- // PowerPC does not have BRCOND which requires SetCC
- setOperationAction(ISD::BRCOND, MVT::Other, Expand);
-
- setOperationAction(ISD::BR_JT, MVT::Other, Expand);
-
- // PowerPC turns FP_TO_SINT into FCTIWZ and some load/stores.
- setOperationAction(ISD::FP_TO_SINT, MVT::i32, Custom);
-
- // PowerPC does not have [U|S]INT_TO_FP
- setOperationAction(ISD::SINT_TO_FP, MVT::i32, Expand);
- setOperationAction(ISD::UINT_TO_FP, MVT::i32, Expand);
-
- setOperationAction(ISD::BIT_CONVERT, MVT::f32, Expand);
- setOperationAction(ISD::BIT_CONVERT, MVT::i32, Expand);
- setOperationAction(ISD::BIT_CONVERT, MVT::i64, Expand);
- setOperationAction(ISD::BIT_CONVERT, MVT::f64, Expand);
-
- // We cannot sextinreg(i1). Expand to shifts.
- setOperationAction(ISD::SIGN_EXTEND_INREG, MVT::i1, Expand);
-
- // Support label based line numbers.
- setOperationAction(ISD::LOCATION, MVT::Other, Expand);
- setOperationAction(ISD::DEBUG_LOC, MVT::Other, Expand);
-
- setOperationAction(ISD::EXCEPTIONADDR, MVT::i64, Expand);
- setOperationAction(ISD::EHSELECTION, MVT::i64, Expand);
- setOperationAction(ISD::EXCEPTIONADDR, MVT::i32, Expand);
- setOperationAction(ISD::EHSELECTION, MVT::i32, Expand);
-
-
- // We want to legalize GlobalAddress and ConstantPool nodes into the
- // appropriate instructions to materialize the address.
- setOperationAction(ISD::GlobalAddress, MVT::i32, Custom);
- setOperationAction(ISD::GlobalTLSAddress, MVT::i32, Custom);
- setOperationAction(ISD::ConstantPool, MVT::i32, Custom);
- setOperationAction(ISD::JumpTable, MVT::i32, Custom);
- setOperationAction(ISD::GlobalAddress, MVT::i64, Custom);
- setOperationAction(ISD::GlobalTLSAddress, MVT::i64, Custom);
- setOperationAction(ISD::ConstantPool, MVT::i64, Custom);
- setOperationAction(ISD::JumpTable, MVT::i64, Custom);
-
- // RET must be custom lowered, to meet ABI requirements
- setOperationAction(ISD::RET , MVT::Other, Custom);
-
- // VASTART needs to be custom lowered to use the VarArgsFrameIndex
- setOperationAction(ISD::VASTART , MVT::Other, Custom);
-
- // VAARG is custom lowered with ELF 32 ABI
- if (TM.getSubtarget<PPCSubtarget>().isELF32_ABI())
- setOperationAction(ISD::VAARG, MVT::Other, Custom);
- else
- setOperationAction(ISD::VAARG, MVT::Other, Expand);
-
- // Use the default implementation.
- setOperationAction(ISD::VACOPY , MVT::Other, Expand);
- setOperationAction(ISD::VAEND , MVT::Other, Expand);
- setOperationAction(ISD::STACKSAVE , MVT::Other, Expand);
- setOperationAction(ISD::STACKRESTORE , MVT::Other, Custom);
- setOperationAction(ISD::DYNAMIC_STACKALLOC, MVT::i32 , Custom);
- setOperationAction(ISD::DYNAMIC_STACKALLOC, MVT::i64 , Custom);
-
- setOperationAction(ISD::ATOMIC_LAS , MVT::i32 , Custom);
- setOperationAction(ISD::ATOMIC_LCS , MVT::i32 , Custom);
- setOperationAction(ISD::ATOMIC_SWAP , MVT::i32 , Custom);
- if (TM.getSubtarget<PPCSubtarget>().has64BitSupport()) {
- setOperationAction(ISD::ATOMIC_LAS , MVT::i64 , Custom);
- setOperationAction(ISD::ATOMIC_LCS , MVT::i64 , Custom);
- setOperationAction(ISD::ATOMIC_SWAP , MVT::i64 , Custom);
- }
-
- // We want to custom lower some of our intrinsics.
- setOperationAction(ISD::INTRINSIC_WO_CHAIN, MVT::Other, Custom);
-
- if (TM.getSubtarget<PPCSubtarget>().has64BitSupport()) {
- // They also have instructions for converting between i64 and fp.
- setOperationAction(ISD::FP_TO_SINT, MVT::i64, Custom);
- setOperationAction(ISD::FP_TO_UINT, MVT::i64, Expand);
- setOperationAction(ISD::SINT_TO_FP, MVT::i64, Custom);
- setOperationAction(ISD::UINT_TO_FP, MVT::i64, Expand);
- setOperationAction(ISD::FP_TO_UINT, MVT::i32, Expand);
-
- // FIXME: disable this lowered code. This generates 64-bit register values,
- // and we don't model the fact that the top part is clobbered by calls. We
- // need to flag these together so that the value isn't live across a call.
- //setOperationAction(ISD::SINT_TO_FP, MVT::i32, Custom);
-
- // To take advantage of the above i64 FP_TO_SINT, promote i32 FP_TO_UINT
- setOperationAction(ISD::FP_TO_UINT, MVT::i32, Promote);
- } else {
- // PowerPC does not have FP_TO_UINT on 32-bit implementations.
- setOperationAction(ISD::FP_TO_UINT, MVT::i32, Expand);
- }
-
- if (TM.getSubtarget<PPCSubtarget>().use64BitRegs()) {
- // 64-bit PowerPC implementations can support i64 types directly
- addRegisterClass(MVT::i64, PPC::G8RCRegisterClass);
- // BUILD_PAIR can't be handled natively, and should be expanded to shl/or
- setOperationAction(ISD::BUILD_PAIR, MVT::i64, Expand);
- // 64-bit PowerPC wants to expand i128 shifts itself.
- setOperationAction(ISD::SHL_PARTS, MVT::i64, Custom);
- setOperationAction(ISD::SRA_PARTS, MVT::i64, Custom);
- setOperationAction(ISD::SRL_PARTS, MVT::i64, Custom);
- } else {
- // 32-bit PowerPC wants to expand i64 shifts itself.
- setOperationAction(ISD::SHL_PARTS, MVT::i32, Custom);
- setOperationAction(ISD::SRA_PARTS, MVT::i32, Custom);
- setOperationAction(ISD::SRL_PARTS, MVT::i32, Custom);
- }
-
- if (TM.getSubtarget<PPCSubtarget>().hasAltivec()) {
- // First set operation action for all vector types to expand. Then we
- // will selectively turn on ones that can be effectively codegen'd.
- for (unsigned VT = (unsigned)MVT::FIRST_VECTOR_VALUETYPE;
- VT <= (unsigned)MVT::LAST_VECTOR_VALUETYPE; ++VT) {
- // add/sub are legal for all supported vector VT's.
- setOperationAction(ISD::ADD , (MVT::ValueType)VT, Legal);
- setOperationAction(ISD::SUB , (MVT::ValueType)VT, Legal);
-
- // We promote all shuffles to v16i8.
- setOperationAction(ISD::VECTOR_SHUFFLE, (MVT::ValueType)VT, Promote);
- AddPromotedToType (ISD::VECTOR_SHUFFLE, (MVT::ValueType)VT, MVT::v16i8);
-
- // We promote all non-typed operations to v4i32.
- setOperationAction(ISD::AND , (MVT::ValueType)VT, Promote);
- AddPromotedToType (ISD::AND , (MVT::ValueType)VT, MVT::v4i32);
- setOperationAction(ISD::OR , (MVT::ValueType)VT, Promote);
- AddPromotedToType (ISD::OR , (MVT::ValueType)VT, MVT::v4i32);
- setOperationAction(ISD::XOR , (MVT::ValueType)VT, Promote);
- AddPromotedToType (ISD::XOR , (MVT::ValueType)VT, MVT::v4i32);
- setOperationAction(ISD::LOAD , (MVT::ValueType)VT, Promote);
- AddPromotedToType (ISD::LOAD , (MVT::ValueType)VT, MVT::v4i32);
- setOperationAction(ISD::SELECT, (MVT::ValueType)VT, Promote);
- AddPromotedToType (ISD::SELECT, (MVT::ValueType)VT, MVT::v4i32);
- setOperationAction(ISD::STORE, (MVT::ValueType)VT, Promote);
- AddPromotedToType (ISD::STORE, (MVT::ValueType)VT, MVT::v4i32);
-
- // No other operations are legal.
- setOperationAction(ISD::MUL , (MVT::ValueType)VT, Expand);
- setOperationAction(ISD::SDIV, (MVT::ValueType)VT, Expand);
- setOperationAction(ISD::SREM, (MVT::ValueType)VT, Expand);
- setOperationAction(ISD::UDIV, (MVT::ValueType)VT, Expand);
- setOperationAction(ISD::UREM, (MVT::ValueType)VT, Expand);
- setOperationAction(ISD::FDIV, (MVT::ValueType)VT, Expand);
- setOperationAction(ISD::FNEG, (MVT::ValueType)VT, Expand);
- setOperationAction(ISD::EXTRACT_VECTOR_ELT, (MVT::ValueType)VT, Expand);
- setOperationAction(ISD::INSERT_VECTOR_ELT, (MVT::ValueType)VT, Expand);
- setOperationAction(ISD::BUILD_VECTOR, (MVT::ValueType)VT, Expand);
- setOperationAction(ISD::UMUL_LOHI, (MVT::ValueType)VT, Expand);
- setOperationAction(ISD::SMUL_LOHI, (MVT::ValueType)VT, Expand);
- setOperationAction(ISD::UDIVREM, (MVT::ValueType)VT, Expand);
- setOperationAction(ISD::SDIVREM, (MVT::ValueType)VT, Expand);
- setOperationAction(ISD::SCALAR_TO_VECTOR, (MVT::ValueType)VT, Expand);
- setOperationAction(ISD::FPOW, (MVT::ValueType)VT, Expand);
- setOperationAction(ISD::CTPOP, (MVT::ValueType)VT, Expand);
- setOperationAction(ISD::CTLZ, (MVT::ValueType)VT, Expand);
- setOperationAction(ISD::CTTZ, (MVT::ValueType)VT, Expand);
- }
-
- // We can custom expand all VECTOR_SHUFFLEs to VPERM, others we can handle
- // with merges, splats, etc.
- setOperationAction(ISD::VECTOR_SHUFFLE, MVT::v16i8, Custom);
-
- setOperationAction(ISD::AND , MVT::v4i32, Legal);
- setOperationAction(ISD::OR , MVT::v4i32, Legal);
- setOperationAction(ISD::XOR , MVT::v4i32, Legal);
- setOperationAction(ISD::LOAD , MVT::v4i32, Legal);
- setOperationAction(ISD::SELECT, MVT::v4i32, Expand);
- setOperationAction(ISD::STORE , MVT::v4i32, Legal);
-
- addRegisterClass(MVT::v4f32, PPC::VRRCRegisterClass);
- addRegisterClass(MVT::v4i32, PPC::VRRCRegisterClass);
- addRegisterClass(MVT::v8i16, PPC::VRRCRegisterClass);
- addRegisterClass(MVT::v16i8, PPC::VRRCRegisterClass);
-
- setOperationAction(ISD::MUL, MVT::v4f32, Legal);
- setOperationAction(ISD::MUL, MVT::v4i32, Custom);
- setOperationAction(ISD::MUL, MVT::v8i16, Custom);
- setOperationAction(ISD::MUL, MVT::v16i8, Custom);
-
- setOperationAction(ISD::SCALAR_TO_VECTOR, MVT::v4f32, Custom);
- setOperationAction(ISD::SCALAR_TO_VECTOR, MVT::v4i32, Custom);
-
- setOperationAction(ISD::BUILD_VECTOR, MVT::v16i8, Custom);
- setOperationAction(ISD::BUILD_VECTOR, MVT::v8i16, Custom);
- setOperationAction(ISD::BUILD_VECTOR, MVT::v4i32, Custom);
- setOperationAction(ISD::BUILD_VECTOR, MVT::v4f32, Custom);
- }
-
- setShiftAmountType(MVT::i32);
- setSetCCResultContents(ZeroOrOneSetCCResult);
-
- if (TM.getSubtarget<PPCSubtarget>().isPPC64()) {
- setStackPointerRegisterToSaveRestore(PPC::X1);
- setExceptionPointerRegister(PPC::X3);
- setExceptionSelectorRegister(PPC::X4);
- } else {
- setStackPointerRegisterToSaveRestore(PPC::R1);
- setExceptionPointerRegister(PPC::R3);
- setExceptionSelectorRegister(PPC::R4);
- }
-
- // We have target-specific dag combine patterns for the following nodes:
- setTargetDAGCombine(ISD::SINT_TO_FP);
- setTargetDAGCombine(ISD::STORE);
- setTargetDAGCombine(ISD::BR_CC);
- setTargetDAGCombine(ISD::BSWAP);
-
- // Darwin long double math library functions have $LDBL128 appended.
- if (TM.getSubtarget<PPCSubtarget>().isDarwin()) {
- setLibcallName(RTLIB::COS_PPCF128, "cosl$LDBL128");
- setLibcallName(RTLIB::POW_PPCF128, "powl$LDBL128");
- setLibcallName(RTLIB::REM_PPCF128, "fmodl$LDBL128");
- setLibcallName(RTLIB::SIN_PPCF128, "sinl$LDBL128");
- setLibcallName(RTLIB::SQRT_PPCF128, "sqrtl$LDBL128");
- }
-
- computeRegisterProperties();
-}
-
-/// getByValTypeAlignment - Return the desired alignment for ByVal aggregate
-/// function arguments in the caller parameter area.
-unsigned PPCTargetLowering::getByValTypeAlignment(const Type *Ty) const {
- TargetMachine &TM = getTargetMachine();
- // Darwin passes everything on 4 byte boundary.
- if (TM.getSubtarget<PPCSubtarget>().isDarwin())
- return 4;
- // FIXME Elf TBD
- return 4;
-}
-
-const char *PPCTargetLowering::getTargetNodeName(unsigned Opcode) const {
- switch (Opcode) {
- default: return 0;
- case PPCISD::FSEL: return "PPCISD::FSEL";
- case PPCISD::FCFID: return "PPCISD::FCFID";
- case PPCISD::FCTIDZ: return "PPCISD::FCTIDZ";
- case PPCISD::FCTIWZ: return "PPCISD::FCTIWZ";
- case PPCISD::STFIWX: return "PPCISD::STFIWX";
- case PPCISD::VMADDFP: return "PPCISD::VMADDFP";
- case PPCISD::VNMSUBFP: return "PPCISD::VNMSUBFP";
- case PPCISD::VPERM: return "PPCISD::VPERM";
- case PPCISD::Hi: return "PPCISD::Hi";
- case PPCISD::Lo: return "PPCISD::Lo";
- case PPCISD::DYNALLOC: return "PPCISD::DYNALLOC";
- case PPCISD::GlobalBaseReg: return "PPCISD::GlobalBaseReg";
- case PPCISD::SRL: return "PPCISD::SRL";
- case PPCISD::SRA: return "PPCISD::SRA";
- case PPCISD::SHL: return "PPCISD::SHL";
- case PPCISD::EXTSW_32: return "PPCISD::EXTSW_32";
- case PPCISD::STD_32: return "PPCISD::STD_32";
- case PPCISD::CALL_ELF: return "PPCISD::CALL_ELF";
- case PPCISD::CALL_Macho: return "PPCISD::CALL_Macho";
- case PPCISD::MTCTR: return "PPCISD::MTCTR";
- case PPCISD::BCTRL_Macho: return "PPCISD::BCTRL_Macho";
- case PPCISD::BCTRL_ELF: return "PPCISD::BCTRL_ELF";
- case PPCISD::RET_FLAG: return "PPCISD::RET_FLAG";
- case PPCISD::MFCR: return "PPCISD::MFCR";
- case PPCISD::VCMP: return "PPCISD::VCMP";
- case PPCISD::VCMPo: return "PPCISD::VCMPo";
- case PPCISD::LBRX: return "PPCISD::LBRX";
- case PPCISD::STBRX: return "PPCISD::STBRX";
- case PPCISD::LARX: return "PPCISD::LARX";
- case PPCISD::STCX: return "PPCISD::STCX";
- case PPCISD::CMP_UNRESERVE: return "PPCISD::CMP_UNRESERVE";
- case PPCISD::COND_BRANCH: return "PPCISD::COND_BRANCH";
- case PPCISD::MFFS: return "PPCISD::MFFS";
- case PPCISD::MTFSB0: return "PPCISD::MTFSB0";
- case PPCISD::MTFSB1: return "PPCISD::MTFSB1";
- case PPCISD::FADDRTZ: return "PPCISD::FADDRTZ";
- case PPCISD::MTFSF: return "PPCISD::MTFSF";
- case PPCISD::TAILCALL: return "PPCISD::TAILCALL";
- case PPCISD::TC_RETURN: return "PPCISD::TC_RETURN";
- }
-}
-
-
-MVT::ValueType
-PPCTargetLowering::getSetCCResultType(const SDOperand &) const {
- return MVT::i32;
-}
-
-
-//===----------------------------------------------------------------------===//
-// Node matching predicates, for use by the tblgen matching code.
-//===----------------------------------------------------------------------===//
-
-/// isFloatingPointZero - Return true if this is 0.0 or -0.0.
-static bool isFloatingPointZero(SDOperand Op) {
- if (ConstantFPSDNode *CFP = dyn_cast<ConstantFPSDNode>(Op))
- return CFP->getValueAPF().isZero();
- else if (ISD::isEXTLoad(Op.Val) || ISD::isNON_EXTLoad(Op.Val)) {
- // Maybe this has already been legalized into the constant pool?
- if (ConstantPoolSDNode *CP = dyn_cast<ConstantPoolSDNode>(Op.getOperand(1)))
- if (ConstantFP *CFP = dyn_cast<ConstantFP>(CP->getConstVal()))
- return CFP->getValueAPF().isZero();
- }
- return false;
-}
-
-/// isConstantOrUndef - Op is either an undef node or a ConstantSDNode. Return
-/// true if Op is undef or if it matches the specified value.
-static bool isConstantOrUndef(SDOperand Op, unsigned Val) {
- return Op.getOpcode() == ISD::UNDEF ||
- cast<ConstantSDNode>(Op)->getValue() == Val;
-}
-
-/// isVPKUHUMShuffleMask - Return true if this is the shuffle mask for a
-/// VPKUHUM instruction.
-bool PPC::isVPKUHUMShuffleMask(SDNode *N, bool isUnary) {
- if (!isUnary) {
- for (unsigned i = 0; i != 16; ++i)
- if (!isConstantOrUndef(N->getOperand(i), i*2+1))
- return false;
- } else {
- for (unsigned i = 0; i != 8; ++i)
- if (!isConstantOrUndef(N->getOperand(i), i*2+1) ||
- !isConstantOrUndef(N->getOperand(i+8), i*2+1))
- return false;
- }
- return true;
-}
-
-/// isVPKUWUMShuffleMask - Return true if this is the shuffle mask for a
-/// VPKUWUM instruction.
-bool PPC::isVPKUWUMShuffleMask(SDNode *N, bool isUnary) {
- if (!isUnary) {
- for (unsigned i = 0; i != 16; i += 2)
- if (!isConstantOrUndef(N->getOperand(i ), i*2+2) ||
- !isConstantOrUndef(N->getOperand(i+1), i*2+3))
- return false;
- } else {
- for (unsigned i = 0; i != 8; i += 2)
- if (!isConstantOrUndef(N->getOperand(i ), i*2+2) ||
- !isConstantOrUndef(N->getOperand(i+1), i*2+3) ||
- !isConstantOrUndef(N->getOperand(i+8), i*2+2) ||
- !isConstantOrUndef(N->getOperand(i+9), i*2+3))
- return false;
- }
- return true;
-}
-
-/// isVMerge - Common function, used to match vmrg* shuffles.
-///
-static bool isVMerge(SDNode *N, unsigned UnitSize,
- unsigned LHSStart, unsigned RHSStart) {
- assert(N->getOpcode() == ISD::BUILD_VECTOR &&
- N->getNumOperands() == 16 && "PPC only supports shuffles by bytes!");
- assert((UnitSize == 1 || UnitSize == 2 || UnitSize == 4) &&
- "Unsupported merge size!");
-
- for (unsigned i = 0; i != 8/UnitSize; ++i) // Step over units
- for (unsigned j = 0; j != UnitSize; ++j) { // Step over bytes within unit
- if (!isConstantOrUndef(N->getOperand(i*UnitSize*2+j),
- LHSStart+j+i*UnitSize) ||
- !isConstantOrUndef(N->getOperand(i*UnitSize*2+UnitSize+j),
- RHSStart+j+i*UnitSize))
- return false;
- }
- return true;
-}
-
-/// isVMRGLShuffleMask - Return true if this is a shuffle mask suitable for
-/// a VRGL* instruction with the specified unit size (1,2 or 4 bytes).
-bool PPC::isVMRGLShuffleMask(SDNode *N, unsigned UnitSize, bool isUnary) {
- if (!isUnary)
- return isVMerge(N, UnitSize, 8, 24);
- return isVMerge(N, UnitSize, 8, 8);
-}
-
-/// isVMRGHShuffleMask - Return true if this is a shuffle mask suitable for
-/// a VRGH* instruction with the specified unit size (1,2 or 4 bytes).
-bool PPC::isVMRGHShuffleMask(SDNode *N, unsigned UnitSize, bool isUnary) {
- if (!isUnary)
- return isVMerge(N, UnitSize, 0, 16);
- return isVMerge(N, UnitSize, 0, 0);
-}
-
-
-/// isVSLDOIShuffleMask - If this is a vsldoi shuffle mask, return the shift
-/// amount, otherwise return -1.
-int PPC::isVSLDOIShuffleMask(SDNode *N, bool isUnary) {
- assert(N->getOpcode() == ISD::BUILD_VECTOR &&
- N->getNumOperands() == 16 && "PPC only supports shuffles by bytes!");
- // Find the first non-undef value in the shuffle mask.
- unsigned i;
- for (i = 0; i != 16 && N->getOperand(i).getOpcode() == ISD::UNDEF; ++i)
- /*search*/;
-
- if (i == 16) return -1; // all undef.
-
- // Otherwise, check to see if the rest of the elements are consequtively
- // numbered from this value.
- unsigned ShiftAmt = cast<ConstantSDNode>(N->getOperand(i))->getValue();
- if (ShiftAmt < i) return -1;
- ShiftAmt -= i;
-
- if (!isUnary) {
- // Check the rest of the elements to see if they are consequtive.
- for (++i; i != 16; ++i)
- if (!isConstantOrUndef(N->getOperand(i), ShiftAmt+i))
- return -1;
- } else {
- // Check the rest of the elements to see if they are consequtive.
- for (++i; i != 16; ++i)
- if (!isConstantOrUndef(N->getOperand(i), (ShiftAmt+i) & 15))
- return -1;
- }
-
- return ShiftAmt;
-}
-
-/// isSplatShuffleMask - Return true if the specified VECTOR_SHUFFLE operand
-/// specifies a splat of a single element that is suitable for input to
-/// VSPLTB/VSPLTH/VSPLTW.
-bool PPC::isSplatShuffleMask(SDNode *N, unsigned EltSize) {
- assert(N->getOpcode() == ISD::BUILD_VECTOR &&
- N->getNumOperands() == 16 &&
- (EltSize == 1 || EltSize == 2 || EltSize == 4));
-
- // This is a splat operation if each element of the permute is the same, and
- // if the value doesn't reference the second vector.
- unsigned ElementBase = 0;
- SDOperand Elt = N->getOperand(0);
- if (ConstantSDNode *EltV = dyn_cast<ConstantSDNode>(Elt))
- ElementBase = EltV->getValue();
- else
- return false; // FIXME: Handle UNDEF elements too!
-
- if (cast<ConstantSDNode>(Elt)->getValue() >= 16)
- return false;
-
- // Check that they are consequtive.
- for (unsigned i = 1; i != EltSize; ++i) {
- if (!isa<ConstantSDNode>(N->getOperand(i)) ||
- cast<ConstantSDNode>(N->getOperand(i))->getValue() != i+ElementBase)
- return false;
- }
-
- assert(isa<ConstantSDNode>(Elt) && "Invalid VECTOR_SHUFFLE mask!");
- for (unsigned i = EltSize, e = 16; i != e; i += EltSize) {
- if (N->getOperand(i).getOpcode() == ISD::UNDEF) continue;
- assert(isa<ConstantSDNode>(N->getOperand(i)) &&
- "Invalid VECTOR_SHUFFLE mask!");
- for (unsigned j = 0; j != EltSize; ++j)
- if (N->getOperand(i+j) != N->getOperand(j))
- return false;
- }
-
- return true;
-}
-
-/// isAllNegativeZeroVector - Returns true if all elements of build_vector
-/// are -0.0.
-bool PPC::isAllNegativeZeroVector(SDNode *N) {
- assert(N->getOpcode() == ISD::BUILD_VECTOR);
- if (PPC::isSplatShuffleMask(N, N->getNumOperands()))
- if (ConstantFPSDNode *CFP = dyn_cast<ConstantFPSDNode>(N))
- return CFP->getValueAPF().isNegZero();
- return false;
-}
-
-/// getVSPLTImmediate - Return the appropriate VSPLT* immediate to splat the
-/// specified isSplatShuffleMask VECTOR_SHUFFLE mask.
-unsigned PPC::getVSPLTImmediate(SDNode *N, unsigned EltSize) {
- assert(isSplatShuffleMask(N, EltSize));
- return cast<ConstantSDNode>(N->getOperand(0))->getValue() / EltSize;
-}
-
-/// get_VSPLTI_elt - If this is a build_vector of constants which can be formed
-/// by using a vspltis[bhw] instruction of the specified element size, return
-/// the constant being splatted. The ByteSize field indicates the number of
-/// bytes of each element [124] -> [bhw].
-SDOperand PPC::get_VSPLTI_elt(SDNode *N, unsigned ByteSize, SelectionDAG &DAG) {
- SDOperand OpVal(0, 0);
-
- // If ByteSize of the splat is bigger than the element size of the
- // build_vector, then we have a case where we are checking for a splat where
- // multiple elements of the buildvector are folded together into a single
- // logical element of the splat (e.g. "vsplish 1" to splat {0,1}*8).
- unsigned EltSize = 16/N->getNumOperands();
- if (EltSize < ByteSize) {
- unsigned Multiple = ByteSize/EltSize; // Number of BV entries per spltval.
- SDOperand UniquedVals[4];
- assert(Multiple > 1 && Multiple <= 4 && "How can this happen?");
-
- // See if all of the elements in the buildvector agree across.
- for (unsigned i = 0, e = N->getNumOperands(); i != e; ++i) {
- if (N->getOperand(i).getOpcode() == ISD::UNDEF) continue;
- // If the element isn't a constant, bail fully out.
- if (!isa<ConstantSDNode>(N->getOperand(i))) return SDOperand();
-
-
- if (UniquedVals[i&(Multiple-1)].Val == 0)
- UniquedVals[i&(Multiple-1)] = N->getOperand(i);
- else if (UniquedVals[i&(Multiple-1)] != N->getOperand(i))
- return SDOperand(); // no match.
- }
-
- // Okay, if we reached this point, UniquedVals[0..Multiple-1] contains
- // either constant or undef values that are identical for each chunk. See
- // if these chunks can form into a larger vspltis*.
-
- // Check to see if all of the leading entries are either 0 or -1. If
- // neither, then this won't fit into the immediate field.
- bool LeadingZero = true;
- bool LeadingOnes = true;
- for (unsigned i = 0; i != Multiple-1; ++i) {
- if (UniquedVals[i].Val == 0) continue; // Must have been undefs.
-
- LeadingZero &= cast<ConstantSDNode>(UniquedVals[i])->isNullValue();
- LeadingOnes &= cast<ConstantSDNode>(UniquedVals[i])->isAllOnesValue();
- }
- // Finally, check the least significant entry.
- if (LeadingZero) {
- if (UniquedVals[Multiple-1].Val == 0)
- return DAG.getTargetConstant(0, MVT::i32); // 0,0,0,undef
- int Val = cast<ConstantSDNode>(UniquedVals[Multiple-1])->getValue();
- if (Val < 16)
- return DAG.getTargetConstant(Val, MVT::i32); // 0,0,0,4 -> vspltisw(4)
- }
- if (LeadingOnes) {
- if (UniquedVals[Multiple-1].Val == 0)
- return DAG.getTargetConstant(~0U, MVT::i32); // -1,-1,-1,undef
- int Val =cast<ConstantSDNode>(UniquedVals[Multiple-1])->getSignExtended();
- if (Val >= -16) // -1,-1,-1,-2 -> vspltisw(-2)
- return DAG.getTargetConstant(Val, MVT::i32);
- }
-
- return SDOperand();
- }
-
- // Check to see if this buildvec has a single non-undef value in its elements.
- for (unsigned i = 0, e = N->getNumOperands(); i != e; ++i) {
- if (N->getOperand(i).getOpcode() == ISD::UNDEF) continue;
- if (OpVal.Val == 0)
- OpVal = N->getOperand(i);
- else if (OpVal != N->getOperand(i))
- return SDOperand();
- }
-
- if (OpVal.Val == 0) return SDOperand(); // All UNDEF: use implicit def.
-
- unsigned ValSizeInBytes = 0;
- uint64_t Value = 0;
- if (ConstantSDNode *CN = dyn_cast<ConstantSDNode>(OpVal)) {
- Value = CN->getValue();
- ValSizeInBytes = MVT::getSizeInBits(CN->getValueType(0))/8;
- } else if (ConstantFPSDNode *CN = dyn_cast<ConstantFPSDNode>(OpVal)) {
- assert(CN->getValueType(0) == MVT::f32 && "Only one legal FP vector type!");
- Value = FloatToBits(CN->getValueAPF().convertToFloat());
- ValSizeInBytes = 4;
- }
-
- // If the splat value is larger than the element value, then we can never do
- // this splat. The only case that we could fit the replicated bits into our
- // immediate field for would be zero, and we prefer to use vxor for it.
- if (ValSizeInBytes < ByteSize) return SDOperand();
-
- // If the element value is larger than the splat value, cut it in half and
- // check to see if the two halves are equal. Continue doing this until we
- // get to ByteSize. This allows us to handle 0x01010101 as 0x01.
- while (ValSizeInBytes > ByteSize) {
- ValSizeInBytes >>= 1;
-
- // If the top half equals the bottom half, we're still ok.
- if (((Value >> (ValSizeInBytes*8)) & ((1 << (8*ValSizeInBytes))-1)) !=
- (Value & ((1 << (8*ValSizeInBytes))-1)))
- return SDOperand();
- }
-
- // Properly sign extend the value.
- int ShAmt = (4-ByteSize)*8;
- int MaskVal = ((int)Value << ShAmt) >> ShAmt;
-
- // If this is zero, don't match, zero matches ISD::isBuildVectorAllZeros.
- if (MaskVal == 0) return SDOperand();
-
- // Finally, if this value fits in a 5 bit sext field, return it
- if (((MaskVal << (32-5)) >> (32-5)) == MaskVal)
- return DAG.getTargetConstant(MaskVal, MVT::i32);
- return SDOperand();
-}
-
-//===----------------------------------------------------------------------===//
-// Addressing Mode Selection
-//===----------------------------------------------------------------------===//
-
-/// isIntS16Immediate - This method tests to see if the node is either a 32-bit
-/// or 64-bit immediate, and if the value can be accurately represented as a
-/// sign extension from a 16-bit value. If so, this returns true and the
-/// immediate.
-static bool isIntS16Immediate(SDNode *N, short &Imm) {
- if (N->getOpcode() != ISD::Constant)
- return false;
-
- Imm = (short)cast<ConstantSDNode>(N)->getValue();
- if (N->getValueType(0) == MVT::i32)
- return Imm == (int32_t)cast<ConstantSDNode>(N)->getValue();
- else
- return Imm == (int64_t)cast<ConstantSDNode>(N)->getValue();
-}
-static bool isIntS16Immediate(SDOperand Op, short &Imm) {
- return isIntS16Immediate(Op.Val, Imm);
-}
-
-
-/// SelectAddressRegReg - Given the specified addressed, check to see if it
-/// can be represented as an indexed [r+r] operation. Returns false if it
-/// can be more efficiently represented with [r+imm].
-bool PPCTargetLowering::SelectAddressRegReg(SDOperand N, SDOperand &Base,
- SDOperand &Index,
- SelectionDAG &DAG) {
- short imm = 0;
- if (N.getOpcode() == ISD::ADD) {
- if (isIntS16Immediate(N.getOperand(1), imm))
- return false; // r+i
- if (N.getOperand(1).getOpcode() == PPCISD::Lo)
- return false; // r+i
-
- Base = N.getOperand(0);
- Index = N.getOperand(1);
- return true;
- } else if (N.getOpcode() == ISD::OR) {
- if (isIntS16Immediate(N.getOperand(1), imm))
- return false; // r+i can fold it if we can.
-
- // If this is an or of disjoint bitfields, we can codegen this as an add
- // (for better address arithmetic) if the LHS and RHS of the OR are provably
- // disjoint.
- APInt LHSKnownZero, LHSKnownOne;
- APInt RHSKnownZero, RHSKnownOne;
- DAG.ComputeMaskedBits(N.getOperand(0),
- APInt::getAllOnesValue(N.getOperand(0)
- .getValueSizeInBits()),
- LHSKnownZero, LHSKnownOne);
-
- if (LHSKnownZero.getBoolValue()) {
- DAG.ComputeMaskedBits(N.getOperand(1),
- APInt::getAllOnesValue(N.getOperand(1)
- .getValueSizeInBits()),
- RHSKnownZero, RHSKnownOne);
- // If all of the bits are known zero on the LHS or RHS, the add won't
- // carry.
- if (~(LHSKnownZero | RHSKnownZero) == 0) {
- Base = N.getOperand(0);
- Index = N.getOperand(1);
- return true;
- }
- }
- }
-
- return false;
-}
-
-/// Returns true if the address N can be represented by a base register plus
-/// a signed 16-bit displacement [r+imm], and if it is not better
-/// represented as reg+reg.
-bool PPCTargetLowering::SelectAddressRegImm(SDOperand N, SDOperand &Disp,
- SDOperand &Base, SelectionDAG &DAG){
- // If this can be more profitably realized as r+r, fail.
- if (SelectAddressRegReg(N, Disp, Base, DAG))
- return false;
-
- if (N.getOpcode() == ISD::ADD) {
- short imm = 0;
- if (isIntS16Immediate(N.getOperand(1), imm)) {
- Disp = DAG.getTargetConstant((int)imm & 0xFFFF, MVT::i32);
- if (FrameIndexSDNode *FI = dyn_cast<FrameIndexSDNode>(N.getOperand(0))) {
- Base = DAG.getTargetFrameIndex(FI->getIndex(), N.getValueType());
- } else {
- Base = N.getOperand(0);
- }
- return true; // [r+i]
- } else if (N.getOperand(1).getOpcode() == PPCISD::Lo) {
- // Match LOAD (ADD (X, Lo(G))).
- assert(!cast<ConstantSDNode>(N.getOperand(1).getOperand(1))->getValue()
- && "Cannot handle constant offsets yet!");
- Disp = N.getOperand(1).getOperand(0); // The global address.
- assert(Disp.getOpcode() == ISD::TargetGlobalAddress ||
- Disp.getOpcode() == ISD::TargetConstantPool ||
- Disp.getOpcode() == ISD::TargetJumpTable);
- Base = N.getOperand(0);
- return true; // [&g+r]
- }
- } else if (N.getOpcode() == ISD::OR) {
- short imm = 0;
- if (isIntS16Immediate(N.getOperand(1), imm)) {
- // If this is an or of disjoint bitfields, we can codegen this as an add
- // (for better address arithmetic) if the LHS and RHS of the OR are
- // provably disjoint.
- APInt LHSKnownZero, LHSKnownOne;
- DAG.ComputeMaskedBits(N.getOperand(0),
- APInt::getAllOnesValue(N.getOperand(0)
- .getValueSizeInBits()),
- LHSKnownZero, LHSKnownOne);
-
- if ((LHSKnownZero.getZExtValue()|~(uint64_t)imm) == ~0ULL) {
- // If all of the bits are known zero on the LHS or RHS, the add won't
- // carry.
- Base = N.getOperand(0);
- Disp = DAG.getTargetConstant((int)imm & 0xFFFF, MVT::i32);
- return true;
- }
- }
- } else if (ConstantSDNode *CN = dyn_cast<ConstantSDNode>(N)) {
- // Loading from a constant address.
-
- // If this address fits entirely in a 16-bit sext immediate field, codegen
- // this as "d, 0"
- short Imm;
- if (isIntS16Immediate(CN, Imm)) {
- Disp = DAG.getTargetConstant(Imm, CN->getValueType(0));
- Base = DAG.getRegister(PPC::R0, CN->getValueType(0));
- return true;
- }
-
- // Handle 32-bit sext immediates with LIS + addr mode.
- if (CN->getValueType(0) == MVT::i32 ||
- (int64_t)CN->getValue() == (int)CN->getValue()) {
- int Addr = (int)CN->getValue();
-
- // Otherwise, break this down into an LIS + disp.
- Disp = DAG.getTargetConstant((short)Addr, MVT::i32);
-
- Base = DAG.getTargetConstant((Addr - (signed short)Addr) >> 16, MVT::i32);
- unsigned Opc = CN->getValueType(0) == MVT::i32 ? PPC::LIS : PPC::LIS8;
- Base = SDOperand(DAG.getTargetNode(Opc, CN->getValueType(0), Base), 0);
- return true;
- }
- }
-
- Disp = DAG.getTargetConstant(0, getPointerTy());
- if (FrameIndexSDNode *FI = dyn_cast<FrameIndexSDNode>(N))
- Base = DAG.getTargetFrameIndex(FI->getIndex(), N.getValueType());
- else
- Base = N;
- return true; // [r+0]
-}
-
-/// SelectAddressRegRegOnly - Given the specified addressed, force it to be
-/// represented as an indexed [r+r] operation.
-bool PPCTargetLowering::SelectAddressRegRegOnly(SDOperand N, SDOperand &Base,
- SDOperand &Index,
- SelectionDAG &DAG) {
- // Check to see if we can easily represent this as an [r+r] address. This
- // will fail if it thinks that the address is more profitably represented as
- // reg+imm, e.g. where imm = 0.
- if (SelectAddressRegReg(N, Base, Index, DAG))
- return true;
-
- // If the operand is an addition, always emit this as [r+r], since this is
- // better (for code size, and execution, as the memop does the add for free)
- // than emitting an explicit add.
- if (N.getOpcode() == ISD::ADD) {
- Base = N.getOperand(0);
- Index = N.getOperand(1);
- return true;
- }
-
- // Otherwise, do it the hard way, using R0 as the base register.
- Base = DAG.getRegister(PPC::R0, N.getValueType());
- Index = N;
- return true;
-}
-
-/// SelectAddressRegImmShift - Returns true if the address N can be
-/// represented by a base register plus a signed 14-bit displacement
-/// [r+imm*4]. Suitable for use by STD and friends.
-bool PPCTargetLowering::SelectAddressRegImmShift(SDOperand N, SDOperand &Disp,
- SDOperand &Base,
- SelectionDAG &DAG) {
- // If this can be more profitably realized as r+r, fail.
- if (SelectAddressRegReg(N, Disp, Base, DAG))
- return false;
-
- if (N.getOpcode() == ISD::ADD) {
- short imm = 0;
- if (isIntS16Immediate(N.getOperand(1), imm) && (imm & 3) == 0) {
- Disp = DAG.getTargetConstant(((int)imm & 0xFFFF) >> 2, MVT::i32);
- if (FrameIndexSDNode *FI = dyn_cast<FrameIndexSDNode>(N.getOperand(0))) {
- Base = DAG.getTargetFrameIndex(FI->getIndex(), N.getValueType());
- } else {
- Base = N.getOperand(0);
- }
- return true; // [r+i]
- } else if (N.getOperand(1).getOpcode() == PPCISD::Lo) {
- // Match LOAD (ADD (X, Lo(G))).
- assert(!cast<ConstantSDNode>(N.getOperand(1).getOperand(1))->getValue()
- && "Cannot handle constant offsets yet!");
- Disp = N.getOperand(1).getOperand(0); // The global address.
- assert(Disp.getOpcode() == ISD::TargetGlobalAddress ||
- Disp.getOpcode() == ISD::TargetConstantPool ||
- Disp.getOpcode() == ISD::TargetJumpTable);
- Base = N.getOperand(0);
- return true; // [&g+r]
- }
- } else if (N.getOpcode() == ISD::OR) {
- short imm = 0;
- if (isIntS16Immediate(N.getOperand(1), imm) && (imm & 3) == 0) {
- // If this is an or of disjoint bitfields, we can codegen this as an add
- // (for better address arithmetic) if the LHS and RHS of the OR are
- // provably disjoint.
- APInt LHSKnownZero, LHSKnownOne;
- DAG.ComputeMaskedBits(N.getOperand(0),
- APInt::getAllOnesValue(N.getOperand(0)
- .getValueSizeInBits()),
- LHSKnownZero, LHSKnownOne);
- if ((LHSKnownZero.getZExtValue()|~(uint64_t)imm) == ~0ULL) {
- // If all of the bits are known zero on the LHS or RHS, the add won't
- // carry.
- Base = N.getOperand(0);
- Disp = DAG.getTargetConstant(((int)imm & 0xFFFF) >> 2, MVT::i32);
- return true;
- }
- }
- } else if (ConstantSDNode *CN = dyn_cast<ConstantSDNode>(N)) {
- // Loading from a constant address. Verify low two bits are clear.
- if ((CN->getValue() & 3) == 0) {
- // If this address fits entirely in a 14-bit sext immediate field, codegen
- // this as "d, 0"
- short Imm;
- if (isIntS16Immediate(CN, Imm)) {
- Disp = DAG.getTargetConstant((unsigned short)Imm >> 2, getPointerTy());
- Base = DAG.getRegister(PPC::R0, CN->getValueType(0));
- return true;
- }
-
- // Fold the low-part of 32-bit absolute addresses into addr mode.
- if (CN->getValueType(0) == MVT::i32 ||
- (int64_t)CN->getValue() == (int)CN->getValue()) {
- int Addr = (int)CN->getValue();
-
- // Otherwise, break this down into an LIS + disp.
- Disp = DAG.getTargetConstant((short)Addr >> 2, MVT::i32);
-
- Base = DAG.getTargetConstant((Addr-(signed short)Addr) >> 16, MVT::i32);
- unsigned Opc = CN->getValueType(0) == MVT::i32 ? PPC::LIS : PPC::LIS8;
- Base = SDOperand(DAG.getTargetNode(Opc, CN->getValueType(0), Base), 0);
- return true;
- }
- }
- }
-
- Disp = DAG.getTargetConstant(0, getPointerTy());
- if (FrameIndexSDNode *FI = dyn_cast<FrameIndexSDNode>(N))
- Base = DAG.getTargetFrameIndex(FI->getIndex(), N.getValueType());
- else
- Base = N;
- return true; // [r+0]
-}
-
-
-/// getPreIndexedAddressParts - returns true by value, base pointer and
-/// offset pointer and addressing mode by reference if the node's address
-/// can be legally represented as pre-indexed load / store address.
-bool PPCTargetLowering::getPreIndexedAddressParts(SDNode *N, SDOperand &Base,
- SDOperand &Offset,
- ISD::MemIndexedMode &AM,
- SelectionDAG &DAG) {
- // Disabled by default for now.
- if (!EnablePPCPreinc) return false;
-
- SDOperand Ptr;
- MVT::ValueType VT;
- if (LoadSDNode *LD = dyn_cast<LoadSDNode>(N)) {
- Ptr = LD->getBasePtr();
- VT = LD->getMemoryVT();
-
- } else if (StoreSDNode *ST = dyn_cast<StoreSDNode>(N)) {
- ST = ST;
- Ptr = ST->getBasePtr();
- VT = ST->getMemoryVT();
- } else
- return false;
-
- // PowerPC doesn't have preinc load/store instructions for vectors.
- if (MVT::isVector(VT))
- return false;
-
- // TODO: Check reg+reg first.
-
- // LDU/STU use reg+imm*4, others use reg+imm.
- if (VT != MVT::i64) {
- // reg + imm
- if (!SelectAddressRegImm(Ptr, Offset, Base, DAG))
- return false;
- } else {
- // reg + imm * 4.
- if (!SelectAddressRegImmShift(Ptr, Offset, Base, DAG))
- return false;
- }
-
- if (LoadSDNode *LD = dyn_cast<LoadSDNode>(N)) {
- // PPC64 doesn't have lwau, but it does have lwaux. Reject preinc load of
- // sext i32 to i64 when addr mode is r+i.
- if (LD->getValueType(0) == MVT::i64 && LD->getMemoryVT() == MVT::i32 &&
- LD->getExtensionType() == ISD::SEXTLOAD &&
- isa<ConstantSDNode>(Offset))
- return false;
- }
-
- AM = ISD::PRE_INC;
- return true;
-}
-
-//===----------------------------------------------------------------------===//
-// LowerOperation implementation
-//===----------------------------------------------------------------------===//
-
-SDOperand PPCTargetLowering::LowerConstantPool(SDOperand Op,
- SelectionDAG &DAG) {
- MVT::ValueType PtrVT = Op.getValueType();
- ConstantPoolSDNode *CP = cast<ConstantPoolSDNode>(Op);
- Constant *C = CP->getConstVal();
- SDOperand CPI = DAG.getTargetConstantPool(C, PtrVT, CP->getAlignment());
- SDOperand Zero = DAG.getConstant(0, PtrVT);
-
- const TargetMachine &TM = DAG.getTarget();
-
- SDOperand Hi = DAG.getNode(PPCISD::Hi, PtrVT, CPI, Zero);
- SDOperand Lo = DAG.getNode(PPCISD::Lo, PtrVT, CPI, Zero);
-
- // If this is a non-darwin platform, we don't support non-static relo models
- // yet.
- if (TM.getRelocationModel() == Reloc::Static ||
- !TM.getSubtarget<PPCSubtarget>().isDarwin()) {
- // Generate non-pic code that has direct accesses to the constant pool.
- // The address of the global is just (hi(&g)+lo(&g)).
- return DAG.getNode(ISD::ADD, PtrVT, Hi, Lo);
- }
-
- if (TM.getRelocationModel() == Reloc::PIC_) {
- // With PIC, the first instruction is actually "GR+hi(&G)".
- Hi = DAG.getNode(ISD::ADD, PtrVT,
- DAG.getNode(PPCISD::GlobalBaseReg, PtrVT), Hi);
- }
-
- Lo = DAG.getNode(ISD::ADD, PtrVT, Hi, Lo);
- return Lo;
-}
-
-SDOperand PPCTargetLowering::LowerJumpTable(SDOperand Op, SelectionDAG &DAG) {
- MVT::ValueType PtrVT = Op.getValueType();
- JumpTableSDNode *JT = cast<JumpTableSDNode>(Op);
- SDOperand JTI = DAG.getTargetJumpTable(JT->getIndex(), PtrVT);
- SDOperand Zero = DAG.getConstant(0, PtrVT);
-
- const TargetMachine &TM = DAG.getTarget();
-
- SDOperand Hi = DAG.getNode(PPCISD::Hi, PtrVT, JTI, Zero);
- SDOperand Lo = DAG.getNode(PPCISD::Lo, PtrVT, JTI, Zero);
-
- // If this is a non-darwin platform, we don't support non-static relo models
- // yet.
- if (TM.getRelocationModel() == Reloc::Static ||
- !TM.getSubtarget<PPCSubtarget>().isDarwin()) {
- // Generate non-pic code that has direct accesses to the constant pool.
- // The address of the global is just (hi(&g)+lo(&g)).
- return DAG.getNode(ISD::ADD, PtrVT, Hi, Lo);
- }
-
- if (TM.getRelocationModel() == Reloc::PIC_) {
- // With PIC, the first instruction is actually "GR+hi(&G)".
- Hi = DAG.getNode(ISD::ADD, PtrVT,
- DAG.getNode(PPCISD::GlobalBaseReg, PtrVT), Hi);
- }
-
- Lo = DAG.getNode(ISD::ADD, PtrVT, Hi, Lo);
- return Lo;
-}
-
-SDOperand PPCTargetLowering::LowerGlobalTLSAddress(SDOperand Op,
- SelectionDAG &DAG) {
- assert(0 && "TLS not implemented for PPC.");
- return SDOperand(); // Not reached
-}
-
-SDOperand PPCTargetLowering::LowerGlobalAddress(SDOperand Op,
- SelectionDAG &DAG) {
- MVT::ValueType PtrVT = Op.getValueType();
- GlobalAddressSDNode *GSDN = cast<GlobalAddressSDNode>(Op);
- GlobalValue *GV = GSDN->getGlobal();
- SDOperand GA = DAG.getTargetGlobalAddress(GV, PtrVT, GSDN->getOffset());
- // If it's a debug information descriptor, don't mess with it.
- if (DAG.isVerifiedDebugInfoDesc(Op))
- return GA;
- SDOperand Zero = DAG.getConstant(0, PtrVT);
-
- const TargetMachine &TM = DAG.getTarget();
-
- SDOperand Hi = DAG.getNode(PPCISD::Hi, PtrVT, GA, Zero);
- SDOperand Lo = DAG.getNode(PPCISD::Lo, PtrVT, GA, Zero);
-
- // If this is a non-darwin platform, we don't support non-static relo models
- // yet.
- if (TM.getRelocationModel() == Reloc::Static ||
- !TM.getSubtarget<PPCSubtarget>().isDarwin()) {
- // Generate non-pic code that has direct accesses to globals.
- // The address of the global is just (hi(&g)+lo(&g)).
- return DAG.getNode(ISD::ADD, PtrVT, Hi, Lo);
- }
-
- if (TM.getRelocationModel() == Reloc::PIC_) {
- // With PIC, the first instruction is actually "GR+hi(&G)".
- Hi = DAG.getNode(ISD::ADD, PtrVT,
- DAG.getNode(PPCISD::GlobalBaseReg, PtrVT), Hi);
- }
-
- Lo = DAG.getNode(ISD::ADD, PtrVT, Hi, Lo);
-
- if (!TM.getSubtarget<PPCSubtarget>().hasLazyResolverStub(GV))
- return Lo;
-
- // If the global is weak or external, we have to go through the lazy
- // resolution stub.
- return DAG.getLoad(PtrVT, DAG.getEntryNode(), Lo, NULL, 0);
-}
-
-SDOperand PPCTargetLowering::LowerSETCC(SDOperand Op, SelectionDAG &DAG) {
- ISD::CondCode CC = cast<CondCodeSDNode>(Op.getOperand(2))->get();
-
- // If we're comparing for equality to zero, expose the fact that this is
- // implented as a ctlz/srl pair on ppc, so that the dag combiner can
- // fold the new nodes.
- if (ConstantSDNode *C = dyn_cast<ConstantSDNode>(Op.getOperand(1))) {
- if (C->isNullValue() && CC == ISD::SETEQ) {
- MVT::ValueType VT = Op.getOperand(0).getValueType();
- SDOperand Zext = Op.getOperand(0);
- if (VT < MVT::i32) {
- VT = MVT::i32;
- Zext = DAG.getNode(ISD::ZERO_EXTEND, VT, Op.getOperand(0));
- }
- unsigned Log2b = Log2_32(MVT::getSizeInBits(VT));
- SDOperand Clz = DAG.getNode(ISD::CTLZ, VT, Zext);
- SDOperand Scc = DAG.getNode(ISD::SRL, VT, Clz,
- DAG.getConstant(Log2b, MVT::i32));
- return DAG.getNode(ISD::TRUNCATE, MVT::i32, Scc);
- }
- // Leave comparisons against 0 and -1 alone for now, since they're usually
- // optimized. FIXME: revisit this when we can custom lower all setcc
- // optimizations.
- if (C->isAllOnesValue() || C->isNullValue())
- return SDOperand();
- }
-
- // If we have an integer seteq/setne, turn it into a compare against zero
- // by xor'ing the rhs with the lhs, which is faster than setting a
- // condition register, reading it back out, and masking the correct bit. The
- // normal approach here uses sub to do this instead of xor. Using xor exposes
- // the result to other bit-twiddling opportunities.
- MVT::ValueType LHSVT = Op.getOperand(0).getValueType();
- if (MVT::isInteger(LHSVT) && (CC == ISD::SETEQ || CC == ISD::SETNE)) {
- MVT::ValueType VT = Op.getValueType();
- SDOperand Sub = DAG.getNode(ISD::XOR, LHSVT, Op.getOperand(0),
- Op.getOperand(1));
- return DAG.getSetCC(VT, Sub, DAG.getConstant(0, LHSVT), CC);
- }
- return SDOperand();
-}
-
-SDOperand PPCTargetLowering::LowerVAARG(SDOperand Op, SelectionDAG &DAG,
- int VarArgsFrameIndex,
- int VarArgsStackOffset,
- unsigned VarArgsNumGPR,
- unsigned VarArgsNumFPR,
- const PPCSubtarget &Subtarget) {
-
- assert(0 && "VAARG in ELF32 ABI not implemented yet!");
- return SDOperand(); // Not reached
-}
-
-SDOperand PPCTargetLowering::LowerVASTART(SDOperand Op, SelectionDAG &DAG,
- int VarArgsFrameIndex,
- int VarArgsStackOffset,
- unsigned VarArgsNumGPR,
- unsigned VarArgsNumFPR,
- const PPCSubtarget &Subtarget) {
-
- if (Subtarget.isMachoABI()) {
- // vastart just stores the address of the VarArgsFrameIndex slot into the
- // memory location argument.
- MVT::ValueType PtrVT = DAG.getTargetLoweringInfo().getPointerTy();
- SDOperand FR = DAG.getFrameIndex(VarArgsFrameIndex, PtrVT);
- const Value *SV = cast<SrcValueSDNode>(Op.getOperand(2))->getValue();
- return DAG.getStore(Op.getOperand(0), FR, Op.getOperand(1), SV, 0);
- }
-
- // For ELF 32 ABI we follow the layout of the va_list struct.
- // We suppose the given va_list is already allocated.
- //
- // typedef struct {
- // char gpr; /* index into the array of 8 GPRs
- // * stored in the register save area
- // * gpr=0 corresponds to r3,
- // * gpr=1 to r4, etc.
- // */
- // char fpr; /* index into the array of 8 FPRs
- // * stored in the register save area
- // * fpr=0 corresponds to f1,
- // * fpr=1 to f2, etc.
- // */
- // char *overflow_arg_area;
- // /* location on stack that holds
- // * the next overflow argument
- // */
- // char *reg_save_area;
- // /* where r3:r10 and f1:f8 (if saved)
- // * are stored
- // */
- // } va_list[1];
-
-
- SDOperand ArgGPR = DAG.getConstant(VarArgsNumGPR, MVT::i8);
- SDOperand ArgFPR = DAG.getConstant(VarArgsNumFPR, MVT::i8);
-
-
- MVT::ValueType PtrVT = DAG.getTargetLoweringInfo().getPointerTy();
-
- SDOperand StackOffsetFI = DAG.getFrameIndex(VarArgsStackOffset, PtrVT);
- SDOperand FR = DAG.getFrameIndex(VarArgsFrameIndex, PtrVT);
-
- uint64_t FrameOffset = MVT::getSizeInBits(PtrVT)/8;
- SDOperand ConstFrameOffset = DAG.getConstant(FrameOffset, PtrVT);
-
- uint64_t StackOffset = MVT::getSizeInBits(PtrVT)/8 - 1;
- SDOperand ConstStackOffset = DAG.getConstant(StackOffset, PtrVT);
-
- uint64_t FPROffset = 1;
- SDOperand ConstFPROffset = DAG.getConstant(FPROffset, PtrVT);
-
- const Value *SV = cast<SrcValueSDNode>(Op.getOperand(2))->getValue();
-
- // Store first byte : number of int regs
- SDOperand firstStore = DAG.getStore(Op.getOperand(0), ArgGPR,
- Op.getOperand(1), SV, 0);
- uint64_t nextOffset = FPROffset;
- SDOperand nextPtr = DAG.getNode(ISD::ADD, PtrVT, Op.getOperand(1),
- ConstFPROffset);
-
- // Store second byte : number of float regs
- SDOperand secondStore =
- DAG.getStore(firstStore, ArgFPR, nextPtr, SV, nextOffset);
- nextOffset += StackOffset;
- nextPtr = DAG.getNode(ISD::ADD, PtrVT, nextPtr, ConstStackOffset);
-
- // Store second word : arguments given on stack
- SDOperand thirdStore =
- DAG.getStore(secondStore, StackOffsetFI, nextPtr, SV, nextOffset);
- nextOffset += FrameOffset;
- nextPtr = DAG.getNode(ISD::ADD, PtrVT, nextPtr, ConstFrameOffset);
-
- // Store third word : arguments given in registers
- return DAG.getStore(thirdStore, FR, nextPtr, SV, nextOffset);
-
-}
-
-#include "PPCGenCallingConv.inc"
-
-/// GetFPR - Get the set of FP registers that should be allocated for arguments,
-/// depending on which subtarget is selected.
-static const unsigned *GetFPR(const PPCSubtarget &Subtarget) {
- if (Subtarget.isMachoABI()) {
- static const unsigned FPR[] = {
- PPC::F1, PPC::F2, PPC::F3, PPC::F4, PPC::F5, PPC::F6, PPC::F7,
- PPC::F8, PPC::F9, PPC::F10, PPC::F11, PPC::F12, PPC::F13
- };
- return FPR;
- }
-
-
- static const unsigned FPR[] = {
- PPC::F1, PPC::F2, PPC::F3, PPC::F4, PPC::F5, PPC::F6, PPC::F7,
- PPC::F8
- };
- return FPR;
-}
-
-/// CalculateStackSlotSize - Calculates the size reserved for this argument on
-/// the stack.
-static unsigned CalculateStackSlotSize(SDOperand Arg, SDOperand Flag,
- bool isVarArg, unsigned PtrByteSize) {
- MVT::ValueType ArgVT = Arg.getValueType();
- ISD::ArgFlagsTy Flags = cast<ARG_FLAGSSDNode>(Flag)->getArgFlags();
- unsigned ArgSize =MVT::getSizeInBits(ArgVT)/8;
- if (Flags.isByVal())
- ArgSize = Flags.getByValSize();
- ArgSize = ((ArgSize + PtrByteSize - 1)/PtrByteSize) * PtrByteSize;
-
- return ArgSize;
-}
-
-SDOperand
-PPCTargetLowering::LowerFORMAL_ARGUMENTS(SDOperand Op,
- SelectionDAG &DAG,
- int &VarArgsFrameIndex,
- int &VarArgsStackOffset,
- unsigned &VarArgsNumGPR,
- unsigned &VarArgsNumFPR,
- const PPCSubtarget &Subtarget) {
- // TODO: add description of PPC stack frame format, or at least some docs.
- //
- MachineFunction &MF = DAG.getMachineFunction();
- MachineFrameInfo *MFI = MF.getFrameInfo();
- MachineRegisterInfo &RegInfo = MF.getRegInfo();
- SmallVector<SDOperand, 8> ArgValues;
- SDOperand Root = Op.getOperand(0);
- bool isVarArg = cast<ConstantSDNode>(Op.getOperand(2))->getValue() != 0;
-
- MVT::ValueType PtrVT = DAG.getTargetLoweringInfo().getPointerTy();
- bool isPPC64 = PtrVT == MVT::i64;
- bool isMachoABI = Subtarget.isMachoABI();
- bool isELF32_ABI = Subtarget.isELF32_ABI();
- // Potential tail calls could cause overwriting of argument stack slots.
- unsigned CC = MF.getFunction()->getCallingConv();
- bool isImmutable = !(PerformTailCallOpt && (CC==CallingConv::Fast));
- unsigned PtrByteSize = isPPC64 ? 8 : 4;
-
- unsigned ArgOffset = PPCFrameInfo::getLinkageSize(isPPC64, isMachoABI);
- // Area that is at least reserved in caller of this function.
- unsigned MinReservedArea = ArgOffset;
-
- static const unsigned GPR_32[] = { // 32-bit registers.
- PPC::R3, PPC::R4, PPC::R5, PPC::R6,
- PPC::R7, PPC::R8, PPC::R9, PPC::R10,
- };
- static const unsigned GPR_64[] = { // 64-bit registers.
- PPC::X3, PPC::X4, PPC::X5, PPC::X6,
- PPC::X7, PPC::X8, PPC::X9, PPC::X10,
- };
-
- static const unsigned *FPR = GetFPR(Subtarget);
-
- static const unsigned VR[] = {
- PPC::V2, PPC::V3, PPC::V4, PPC::V5, PPC::V6, PPC::V7, PPC::V8,
- PPC::V9, PPC::V10, PPC::V11, PPC::V12, PPC::V13
- };
-
- const unsigned Num_GPR_Regs = array_lengthof(GPR_32);
- const unsigned Num_FPR_Regs = isMachoABI ? 13 : 8;
- const unsigned Num_VR_Regs = array_lengthof( VR);
-
- unsigned GPR_idx = 0, FPR_idx = 0, VR_idx = 0;
-
- const unsigned *GPR = isPPC64 ? GPR_64 : GPR_32;
-
- // In 32-bit non-varargs functions, the stack space for vectors is after the
- // stack space for non-vectors. We do not use this space unless we have
- // too many vectors to fit in registers, something that only occurs in
- // constructed examples:), but we have to walk the arglist to figure
- // that out...for the pathological case, compute VecArgOffset as the
- // start of the vector parameter area. Computing VecArgOffset is the
- // entire point of the following loop.
- // Altivec is not mentioned in the ppc32 Elf Supplement, so I'm not trying
- // to handle Elf here.
- unsigned VecArgOffset = ArgOffset;
- if (!isVarArg && !isPPC64) {
- for (unsigned ArgNo = 0, e = Op.Val->getNumValues()-1; ArgNo != e;
- ++ArgNo) {
- MVT::ValueType ObjectVT = Op.getValue(ArgNo).getValueType();
- unsigned ObjSize = MVT::getSizeInBits(ObjectVT)/8;
- ISD::ArgFlagsTy Flags =
- cast<ARG_FLAGSSDNode>(Op.getOperand(ArgNo+3))->getArgFlags();
-
- if (Flags.isByVal()) {
- // ObjSize is the true size, ArgSize rounded up to multiple of regs.
- ObjSize = Flags.getByValSize();
- unsigned ArgSize =
- ((ObjSize + PtrByteSize - 1)/PtrByteSize) * PtrByteSize;
- VecArgOffset += ArgSize;
- continue;
- }
-
- switch(ObjectVT) {
- default: assert(0 && "Unhandled argument type!");
- case MVT::i32:
- case MVT::f32:
- VecArgOffset += isPPC64 ? 8 : 4;
- break;
- case MVT::i64: // PPC64
- case MVT::f64:
- VecArgOffset += 8;
- break;
- case MVT::v4f32:
- case MVT::v4i32:
- case MVT::v8i16:
- case MVT::v16i8:
- // Nothing to do, we're only looking at Nonvector args here.
- break;
- }
- }
- }
- // We've found where the vector parameter area in memory is. Skip the
- // first 12 parameters; these don't use that memory.
- VecArgOffset = ((VecArgOffset+15)/16)*16;
- VecArgOffset += 12*16;
-
- // Add DAG nodes to load the arguments or copy them out of registers. On
- // entry to a function on PPC, the arguments start after the linkage area,
- // although the first ones are often in registers.
- //
- // In the ELF 32 ABI, GPRs and stack are double word align: an argument
- // represented with two words (long long or double) must be copied to an
- // even GPR_idx value or to an even ArgOffset value.
-
- SmallVector<SDOperand, 8> MemOps;
- unsigned nAltivecParamsAtEnd = 0;
- for (unsigned ArgNo = 0, e = Op.Val->getNumValues()-1; ArgNo != e; ++ArgNo) {
- SDOperand ArgVal;
- bool needsLoad = false;
- MVT::ValueType ObjectVT = Op.getValue(ArgNo).getValueType();
- unsigned ObjSize = MVT::getSizeInBits(ObjectVT)/8;
- unsigned ArgSize = ObjSize;
- ISD::ArgFlagsTy Flags =
- cast<ARG_FLAGSSDNode>(Op.getOperand(ArgNo+3))->getArgFlags();
- // See if next argument requires stack alignment in ELF
- bool Align = Flags.isSplit();
-
- unsigned CurArgOffset = ArgOffset;
-
- // Varargs or 64 bit Altivec parameters are padded to a 16 byte boundary.
- if (ObjectVT==MVT::v4f32 || ObjectVT==MVT::v4i32 ||
- ObjectVT==MVT::v8i16 || ObjectVT==MVT::v16i8) {
- if (isVarArg || isPPC64) {
- MinReservedArea = ((MinReservedArea+15)/16)*16;
- MinReservedArea += CalculateStackSlotSize(Op.getValue(ArgNo),
- Op.getOperand(ArgNo+3),
- isVarArg,
- PtrByteSize);
- } else nAltivecParamsAtEnd++;
- } else
- // Calculate min reserved area.
- MinReservedArea += CalculateStackSlotSize(Op.getValue(ArgNo),
- Op.getOperand(ArgNo+3),
- isVarArg,
- PtrByteSize);
-
- // FIXME alignment for ELF may not be right
- // FIXME the codegen can be much improved in some cases.
- // We do not have to keep everything in memory.
- if (Flags.isByVal()) {
- // ObjSize is the true size, ArgSize rounded up to multiple of registers.
- ObjSize = Flags.getByValSize();
- ArgSize = ((ObjSize + PtrByteSize - 1)/PtrByteSize) * PtrByteSize;
- // Double word align in ELF
- if (Align && isELF32_ABI) GPR_idx += (GPR_idx % 2);
- // Objects of size 1 and 2 are right justified, everything else is
- // left justified. This means the memory address is adjusted forwards.
- if (ObjSize==1 || ObjSize==2) {
- CurArgOffset = CurArgOffset + (4 - ObjSize);
- }
- // The value of the object is its address.
- int FI = MFI->CreateFixedObject(ObjSize, CurArgOffset);
- SDOperand FIN = DAG.getFrameIndex(FI, PtrVT);
- ArgValues.push_back(FIN);
- if (ObjSize==1 || ObjSize==2) {
- if (GPR_idx != Num_GPR_Regs) {
- unsigned VReg = RegInfo.createVirtualRegister(&PPC::GPRCRegClass);
- RegInfo.addLiveIn(GPR[GPR_idx], VReg);
- SDOperand Val = DAG.getCopyFromReg(Root, VReg, PtrVT);
- SDOperand Store = DAG.getTruncStore(Val.getValue(1), Val, FIN,
- NULL, 0, ObjSize==1 ? MVT::i8 : MVT::i16 );
- MemOps.push_back(Store);
- ++GPR_idx;
- if (isMachoABI) ArgOffset += PtrByteSize;
- } else {
- ArgOffset += PtrByteSize;
- }
- continue;
- }
- for (unsigned j = 0; j < ArgSize; j += PtrByteSize) {
- // Store whatever pieces of the object are in registers
- // to memory. ArgVal will be address of the beginning of
- // the object.
- if (GPR_idx != Num_GPR_Regs) {
- unsigned VReg = RegInfo.createVirtualRegister(&PPC::GPRCRegClass);
- RegInfo.addLiveIn(GPR[GPR_idx], VReg);
- int FI = MFI->CreateFixedObject(PtrByteSize, ArgOffset);
- SDOperand FIN = DAG.getFrameIndex(FI, PtrVT);
- SDOperand Val = DAG.getCopyFromReg(Root, VReg, PtrVT);
- SDOperand Store = DAG.getStore(Val.getValue(1), Val, FIN, NULL, 0);
- MemOps.push_back(Store);
- ++GPR_idx;
- if (isMachoABI) ArgOffset += PtrByteSize;
- } else {
- ArgOffset += ArgSize - (ArgOffset-CurArgOffset);
- break;
- }
- }
- continue;
- }
-
- switch (ObjectVT) {
- default: assert(0 && "Unhandled argument type!");
- case MVT::i32:
- if (!isPPC64) {
- // Double word align in ELF
- if (Align && isELF32_ABI) GPR_idx += (GPR_idx % 2);
-
- if (GPR_idx != Num_GPR_Regs) {
- unsigned VReg = RegInfo.createVirtualRegister(&PPC::GPRCRegClass);
- RegInfo.addLiveIn(GPR[GPR_idx], VReg);
- ArgVal = DAG.getCopyFromReg(Root, VReg, MVT::i32);
- ++GPR_idx;
- } else {
- needsLoad = true;
- ArgSize = PtrByteSize;
- }
- // Stack align in ELF
- if (needsLoad && Align && isELF32_ABI)
- ArgOffset += ((ArgOffset/4) % 2) * PtrByteSize;
- // All int arguments reserve stack space in Macho ABI.
- if (isMachoABI || needsLoad) ArgOffset += PtrByteSize;
- break;
- }
- // FALLTHROUGH
- case MVT::i64: // PPC64
- if (GPR_idx != Num_GPR_Regs) {
- unsigned VReg = RegInfo.createVirtualRegister(&PPC::G8RCRegClass);
- RegInfo.addLiveIn(GPR[GPR_idx], VReg);
- ArgVal = DAG.getCopyFromReg(Root, VReg, MVT::i64);
-
- if (ObjectVT == MVT::i32) {
- // PPC64 passes i8, i16, and i32 values in i64 registers. Promote
- // value to MVT::i64 and then truncate to the correct register size.
- if (Flags.isSExt())
- ArgVal = DAG.getNode(ISD::AssertSext, MVT::i64, ArgVal,
- DAG.getValueType(ObjectVT));
- else if (Flags.isZExt())
- ArgVal = DAG.getNode(ISD::AssertZext, MVT::i64, ArgVal,
- DAG.getValueType(ObjectVT));
-
- ArgVal = DAG.getNode(ISD::TRUNCATE, MVT::i32, ArgVal);
- }
-
- ++GPR_idx;
- } else {
- needsLoad = true;
- }
- // All int arguments reserve stack space in Macho ABI.
- if (isMachoABI || needsLoad) ArgOffset += 8;
- break;
-
- case MVT::f32:
- case MVT::f64:
- // Every 4 bytes of argument space consumes one of the GPRs available for
- // argument passing.
- if (GPR_idx != Num_GPR_Regs && isMachoABI) {
- ++GPR_idx;
- if (ObjSize == 8 && GPR_idx != Num_GPR_Regs && !isPPC64)
- ++GPR_idx;
- }
- if (FPR_idx != Num_FPR_Regs) {
- unsigned VReg;
- if (ObjectVT == MVT::f32)
- VReg = RegInfo.createVirtualRegister(&PPC::F4RCRegClass);
- else
- VReg = RegInfo.createVirtualRegister(&PPC::F8RCRegClass);
- RegInfo.addLiveIn(FPR[FPR_idx], VReg);
- ArgVal = DAG.getCopyFromReg(Root, VReg, ObjectVT);
- ++FPR_idx;
- } else {
- needsLoad = true;
- }
-
- // Stack align in ELF
- if (needsLoad && Align && isELF32_ABI)
- ArgOffset += ((ArgOffset/4) % 2) * PtrByteSize;
- // All FP arguments reserve stack space in Macho ABI.
- if (isMachoABI || needsLoad) ArgOffset += isPPC64 ? 8 : ObjSize;
- break;
- case MVT::v4f32:
- case MVT::v4i32:
- case MVT::v8i16:
- case MVT::v16i8:
- // Note that vector arguments in registers don't reserve stack space,
- // except in varargs functions.
- if (VR_idx != Num_VR_Regs) {
- unsigned VReg = RegInfo.createVirtualRegister(&PPC::VRRCRegClass);
- RegInfo.addLiveIn(VR[VR_idx], VReg);
- ArgVal = DAG.getCopyFromReg(Root, VReg, ObjectVT);
- if (isVarArg) {
- while ((ArgOffset % 16) != 0) {
- ArgOffset += PtrByteSize;
- if (GPR_idx != Num_GPR_Regs)
- GPR_idx++;
- }
- ArgOffset += 16;
- GPR_idx = std::min(GPR_idx+4, Num_GPR_Regs);
- }
- ++VR_idx;
- } else {
- if (!isVarArg && !isPPC64) {
- // Vectors go after all the nonvectors.
- CurArgOffset = VecArgOffset;
- VecArgOffset += 16;
- } else {
- // Vectors are aligned.
- ArgOffset = ((ArgOffset+15)/16)*16;
- CurArgOffset = ArgOffset;
- ArgOffset += 16;
- }
- needsLoad = true;
- }
- break;
- }
-
- // We need to load the argument to a virtual register if we determined above
- // that we ran out of physical registers of the appropriate type.
- if (needsLoad) {
- int FI = MFI->CreateFixedObject(ObjSize,
- CurArgOffset + (ArgSize - ObjSize),
- isImmutable);
- SDOperand FIN = DAG.getFrameIndex(FI, PtrVT);
- ArgVal = DAG.getLoad(ObjectVT, Root, FIN, NULL, 0);
- }
-
- ArgValues.push_back(ArgVal);
- }
-
- // Set the size that is at least reserved in caller of this function. Tail
- // call optimized function's reserved stack space needs to be aligned so that
- // taking the difference between two stack areas will result in an aligned
- // stack.
- PPCFunctionInfo *FI = MF.getInfo<PPCFunctionInfo>();
- // Add the Altivec parameters at the end, if needed.
- if (nAltivecParamsAtEnd) {
- MinReservedArea = ((MinReservedArea+15)/16)*16;
- MinReservedArea += 16*nAltivecParamsAtEnd;
- }
- MinReservedArea =
- std::max(MinReservedArea,
- PPCFrameInfo::getMinCallFrameSize(isPPC64, isMachoABI));
- unsigned TargetAlign = DAG.getMachineFunction().getTarget().getFrameInfo()->
- getStackAlignment();
- unsigned AlignMask = TargetAlign-1;
- MinReservedArea = (MinReservedArea + AlignMask) & ~AlignMask;
- FI->setMinReservedArea(MinReservedArea);
-
- // If the function takes variable number of arguments, make a frame index for
- // the start of the first vararg value... for expansion of llvm.va_start.
- if (isVarArg) {
-
- int depth;
- if (isELF32_ABI) {
- VarArgsNumGPR = GPR_idx;
- VarArgsNumFPR = FPR_idx;
-
- // Make room for Num_GPR_Regs, Num_FPR_Regs and for a possible frame
- // pointer.
- depth = -(Num_GPR_Regs * MVT::getSizeInBits(PtrVT)/8 +
- Num_FPR_Regs * MVT::getSizeInBits(MVT::f64)/8 +
- MVT::getSizeInBits(PtrVT)/8);
-
- VarArgsStackOffset = MFI->CreateFixedObject(MVT::getSizeInBits(PtrVT)/8,
- ArgOffset);
-
- }
- else
- depth = ArgOffset;
-
- VarArgsFrameIndex = MFI->CreateFixedObject(MVT::getSizeInBits(PtrVT)/8,
- depth);
- SDOperand FIN = DAG.getFrameIndex(VarArgsFrameIndex, PtrVT);
-
- // In ELF 32 ABI, the fixed integer arguments of a variadic function are
- // stored to the VarArgsFrameIndex on the stack.
- if (isELF32_ABI) {
- for (GPR_idx = 0; GPR_idx != VarArgsNumGPR; ++GPR_idx) {
- SDOperand Val = DAG.getRegister(GPR[GPR_idx], PtrVT);
- SDOperand Store = DAG.getStore(Root, Val, FIN, NULL, 0);
- MemOps.push_back(Store);
- // Increment the address by four for the next argument to store
- SDOperand PtrOff = DAG.getConstant(MVT::getSizeInBits(PtrVT)/8, PtrVT);
- FIN = DAG.getNode(ISD::ADD, PtrOff.getValueType(), FIN, PtrOff);
- }
- }
-
- // If this function is vararg, store any remaining integer argument regs
- // to their spots on the stack so that they may be loaded by deferencing the
- // result of va_next.
- for (; GPR_idx != Num_GPR_Regs; ++GPR_idx) {
- unsigned VReg;
- if (isPPC64)
- VReg = RegInfo.createVirtualRegister(&PPC::G8RCRegClass);
- else
- VReg = RegInfo.createVirtualRegister(&PPC::GPRCRegClass);
-
- RegInfo.addLiveIn(GPR[GPR_idx], VReg);
- SDOperand Val = DAG.getCopyFromReg(Root, VReg, PtrVT);
- SDOperand Store = DAG.getStore(Val.getValue(1), Val, FIN, NULL, 0);
- MemOps.push_back(Store);
- // Increment the address by four for the next argument to store
- SDOperand PtrOff = DAG.getConstant(MVT::getSizeInBits(PtrVT)/8, PtrVT);
- FIN = DAG.getNode(ISD::ADD, PtrOff.getValueType(), FIN, PtrOff);
- }
-
- // In ELF 32 ABI, the double arguments are stored to the VarArgsFrameIndex
- // on the stack.
- if (isELF32_ABI) {
- for (FPR_idx = 0; FPR_idx != VarArgsNumFPR; ++FPR_idx) {
- SDOperand Val = DAG.getRegister(FPR[FPR_idx], MVT::f64);
- SDOperand Store = DAG.getStore(Root, Val, FIN, NULL, 0);
- MemOps.push_back(Store);
- // Increment the address by eight for the next argument to store
- SDOperand PtrOff = DAG.getConstant(MVT::getSizeInBits(MVT::f64)/8,
- PtrVT);
- FIN = DAG.getNode(ISD::ADD, PtrOff.getValueType(), FIN, PtrOff);
- }
-
- for (; FPR_idx != Num_FPR_Regs; ++FPR_idx) {
- unsigned VReg;
- VReg = RegInfo.createVirtualRegister(&PPC::F8RCRegClass);
-
- RegInfo.addLiveIn(FPR[FPR_idx], VReg);
- SDOperand Val = DAG.getCopyFromReg(Root, VReg, MVT::f64);
- SDOperand Store = DAG.getStore(Val.getValue(1), Val, FIN, NULL, 0);
- MemOps.push_back(Store);
- // Increment the address by eight for the next argument to store
- SDOperand PtrOff = DAG.getConstant(MVT::getSizeInBits(MVT::f64)/8,
- PtrVT);
- FIN = DAG.getNode(ISD::ADD, PtrOff.getValueType(), FIN, PtrOff);
- }
- }
- }
-
- if (!MemOps.empty())
- Root = DAG.getNode(ISD::TokenFactor, MVT::Other,&MemOps[0],MemOps.size());
-
- ArgValues.push_back(Root);
-
- // Return the new list of results.
- std::vector<MVT::ValueType> RetVT(Op.Val->value_begin(),
- Op.Val->value_end());
- return DAG.getNode(ISD::MERGE_VALUES, RetVT, &ArgValues[0], ArgValues.size());
-}
-
-/// CalculateParameterAndLinkageAreaSize - Get the size of the paramter plus
-/// linkage area.
-static unsigned
-CalculateParameterAndLinkageAreaSize(SelectionDAG &DAG,
- bool isPPC64,
- bool isMachoABI,
- bool isVarArg,
- unsigned CC,
- SDOperand Call,
- unsigned &nAltivecParamsAtEnd) {
- // Count how many bytes are to be pushed on the stack, including the linkage
- // area, and parameter passing area. We start with 24/48 bytes, which is
- // prereserved space for [SP][CR][LR][3 x unused].
- unsigned NumBytes = PPCFrameInfo::getLinkageSize(isPPC64, isMachoABI);
- unsigned NumOps = (Call.getNumOperands() - 5) / 2;
- unsigned PtrByteSize = isPPC64 ? 8 : 4;
-
- // Add up all the space actually used.
- // In 32-bit non-varargs calls, Altivec parameters all go at the end; usually
- // they all go in registers, but we must reserve stack space for them for
- // possible use by the caller. In varargs or 64-bit calls, parameters are
- // assigned stack space in order, with padding so Altivec parameters are
- // 16-byte aligned.
- nAltivecParamsAtEnd = 0;
- for (unsigned i = 0; i != NumOps; ++i) {
- SDOperand Arg = Call.getOperand(5+2*i);
- SDOperand Flag = Call.getOperand(5+2*i+1);
- MVT::ValueType ArgVT = Arg.getValueType();
- // Varargs Altivec parameters are padded to a 16 byte boundary.
- if (ArgVT==MVT::v4f32 || ArgVT==MVT::v4i32 ||
- ArgVT==MVT::v8i16 || ArgVT==MVT::v16i8) {
- if (!isVarArg && !isPPC64) {
- // Non-varargs Altivec parameters go after all the non-Altivec
- // parameters; handle those later so we know how much padding we need.
- nAltivecParamsAtEnd++;
- continue;
- }
- // Varargs and 64-bit Altivec parameters are padded to 16 byte boundary.
- NumBytes = ((NumBytes+15)/16)*16;
- }
- NumBytes += CalculateStackSlotSize(Arg, Flag, isVarArg, PtrByteSize);
- }
-
- // Allow for Altivec parameters at the end, if needed.
- if (nAltivecParamsAtEnd) {
- NumBytes = ((NumBytes+15)/16)*16;
- NumBytes += 16*nAltivecParamsAtEnd;
- }
-
- // The prolog code of the callee may store up to 8 GPR argument registers to
- // the stack, allowing va_start to index over them in memory if its varargs.
- // Because we cannot tell if this is needed on the caller side, we have to
- // conservatively assume that it is needed. As such, make sure we have at
- // least enough stack space for the caller to store the 8 GPRs.
- NumBytes = std::max(NumBytes,
- PPCFrameInfo::getMinCallFrameSize(isPPC64, isMachoABI));
-
- // Tail call needs the stack to be aligned.
- if (CC==CallingConv::Fast && PerformTailCallOpt) {
- unsigned TargetAlign = DAG.getMachineFunction().getTarget().getFrameInfo()->
- getStackAlignment();
- unsigned AlignMask = TargetAlign-1;
- NumBytes = (NumBytes + AlignMask) & ~AlignMask;
- }
-
- return NumBytes;
-}
-
-/// CalculateTailCallSPDiff - Get the amount the stack pointer has to be
-/// adjusted to accomodate the arguments for the tailcall.
-static int CalculateTailCallSPDiff(SelectionDAG& DAG, bool IsTailCall,
- unsigned ParamSize) {
-
- if (!IsTailCall) return 0;
-
- PPCFunctionInfo *FI = DAG.getMachineFunction().getInfo<PPCFunctionInfo>();
- unsigned CallerMinReservedArea = FI->getMinReservedArea();
- int SPDiff = (int)CallerMinReservedArea - (int)ParamSize;
- // Remember only if the new adjustement is bigger.
- if (SPDiff < FI->getTailCallSPDelta())
- FI->setTailCallSPDelta(SPDiff);
-
- return SPDiff;
-}
-
-/// IsEligibleForTailCallElimination - Check to see whether the next instruction
-/// following the call is a return. A function is eligible if caller/callee
-/// calling conventions match, currently only fastcc supports tail calls, and
-/// the function CALL is immediatly followed by a RET.
-bool
-PPCTargetLowering::IsEligibleForTailCallOptimization(SDOperand Call,
- SDOperand Ret,
- SelectionDAG& DAG) const {
- // Variable argument functions are not supported.
- if (!PerformTailCallOpt ||
- cast<ConstantSDNode>(Call.getOperand(2))->getValue() != 0) return false;
-
- if (CheckTailCallReturnConstraints(Call, Ret)) {
- MachineFunction &MF = DAG.getMachineFunction();
- unsigned CallerCC = MF.getFunction()->getCallingConv();
- unsigned CalleeCC = cast<ConstantSDNode>(Call.getOperand(1))->getValue();
- if (CalleeCC == CallingConv::Fast && CallerCC == CalleeCC) {
- // Functions containing by val parameters are not supported.
- for (unsigned i = 0; i != ((Call.getNumOperands()-5)/2); i++) {
- ISD::ArgFlagsTy Flags = cast<ARG_FLAGSSDNode>(Call.getOperand(5+2*i+1))
- ->getArgFlags();
- if (Flags.isByVal()) return false;
- }
-
- SDOperand Callee = Call.getOperand(4);
- // Non PIC/GOT tail calls are supported.
- if (getTargetMachine().getRelocationModel() != Reloc::PIC_)
- return true;
-
- // At the moment we can only do local tail calls (in same module, hidden
- // or protected) if we are generating PIC.
- if (GlobalAddressSDNode *G = dyn_cast<GlobalAddressSDNode>(Callee))
- return G->getGlobal()->hasHiddenVisibility()
- || G->getGlobal()->hasProtectedVisibility();
- }
- }
-
- return false;
-}
-
-/// isCallCompatibleAddress - Return the immediate to use if the specified
-/// 32-bit value is representable in the immediate field of a BxA instruction.
-static SDNode *isBLACompatibleAddress(SDOperand Op, SelectionDAG &DAG) {
- ConstantSDNode *C = dyn_cast<ConstantSDNode>(Op);
- if (!C) return 0;
-
- int Addr = C->getValue();
- if ((Addr & 3) != 0 || // Low 2 bits are implicitly zero.
- (Addr << 6 >> 6) != Addr)
- return 0; // Top 6 bits have to be sext of immediate.
-
- return DAG.getConstant((int)C->getValue() >> 2,
- DAG.getTargetLoweringInfo().getPointerTy()).Val;
-}
-
-struct TailCallArgumentInfo {
- SDOperand Arg;
- SDOperand FrameIdxOp;
- int FrameIdx;
-
- TailCallArgumentInfo() : FrameIdx(0) {}
-};
-
-/// StoreTailCallArgumentsToStackSlot - Stores arguments to their stack slot.
-static void
-StoreTailCallArgumentsToStackSlot(SelectionDAG &DAG,
- SDOperand Chain,
- const SmallVector<TailCallArgumentInfo, 8> &TailCallArgs,
- SmallVector<SDOperand, 8> &MemOpChains) {
- for (unsigned i = 0, e = TailCallArgs.size(); i != e; ++i) {
- SDOperand Arg = TailCallArgs[i].Arg;
- SDOperand FIN = TailCallArgs[i].FrameIdxOp;
- int FI = TailCallArgs[i].FrameIdx;
- // Store relative to framepointer.
- MemOpChains.push_back(DAG.getStore(Chain, Arg, FIN,
- PseudoSourceValue::getFixedStack(),
- FI));
- }
-}
-
-/// EmitTailCallStoreFPAndRetAddr - Move the frame pointer and return address to
-/// the appropriate stack slot for the tail call optimized function call.
-static SDOperand EmitTailCallStoreFPAndRetAddr(SelectionDAG &DAG,
- MachineFunction &MF,
- SDOperand Chain,
- SDOperand OldRetAddr,
- SDOperand OldFP,
- int SPDiff,
- bool isPPC64,
- bool isMachoABI) {
- if (SPDiff) {
- // Calculate the new stack slot for the return address.
- int SlotSize = isPPC64 ? 8 : 4;
- int NewRetAddrLoc = SPDiff + PPCFrameInfo::getReturnSaveOffset(isPPC64,
- isMachoABI);
- int NewRetAddr = MF.getFrameInfo()->CreateFixedObject(SlotSize,
- NewRetAddrLoc);
- int NewFPLoc = SPDiff + PPCFrameInfo::getFramePointerSaveOffset(isPPC64,
- isMachoABI);
- int NewFPIdx = MF.getFrameInfo()->CreateFixedObject(SlotSize, NewFPLoc);
-
- MVT::ValueType VT = isPPC64 ? MVT::i64 : MVT::i32;
- SDOperand NewRetAddrFrIdx = DAG.getFrameIndex(NewRetAddr, VT);
- Chain = DAG.getStore(Chain, OldRetAddr, NewRetAddrFrIdx,
- PseudoSourceValue::getFixedStack(), NewRetAddr);
- SDOperand NewFramePtrIdx = DAG.getFrameIndex(NewFPIdx, VT);
- Chain = DAG.getStore(Chain, OldFP, NewFramePtrIdx,
- PseudoSourceValue::getFixedStack(), NewFPIdx);
- }
- return Chain;
-}
-
-/// CalculateTailCallArgDest - Remember Argument for later processing. Calculate
-/// the position of the argument.
-static void
-CalculateTailCallArgDest(SelectionDAG &DAG, MachineFunction &MF, bool isPPC64,
- SDOperand Arg, int SPDiff, unsigned ArgOffset,
- SmallVector<TailCallArgumentInfo, 8>& TailCallArguments) {
- int Offset = ArgOffset + SPDiff;
- uint32_t OpSize = (MVT::getSizeInBits(Arg.getValueType())+7)/8;
- int FI = MF.getFrameInfo()->CreateFixedObject(OpSize, Offset);
- MVT::ValueType VT = isPPC64 ? MVT::i64 : MVT::i32;
- SDOperand FIN = DAG.getFrameIndex(FI, VT);
- TailCallArgumentInfo Info;
- Info.Arg = Arg;
- Info.FrameIdxOp = FIN;
- Info.FrameIdx = FI;
- TailCallArguments.push_back(Info);
-}
-
-/// EmitTCFPAndRetAddrLoad - Emit load from frame pointer and return address
-/// stack slot. Returns the chain as result and the loaded frame pointers in
-/// LROpOut/FPOpout. Used when tail calling.
-SDOperand PPCTargetLowering::EmitTailCallLoadFPAndRetAddr(SelectionDAG & DAG,
- int SPDiff,
- SDOperand Chain,
- SDOperand &LROpOut,
- SDOperand &FPOpOut) {
- if (SPDiff) {
- // Load the LR and FP stack slot for later adjusting.
- MVT::ValueType VT = PPCSubTarget.isPPC64() ? MVT::i64 : MVT::i32;
- LROpOut = getReturnAddrFrameIndex(DAG);
- LROpOut = DAG.getLoad(VT, Chain, LROpOut, NULL, 0);
- Chain = SDOperand(LROpOut.Val, 1);
- FPOpOut = getFramePointerFrameIndex(DAG);
- FPOpOut = DAG.getLoad(VT, Chain, FPOpOut, NULL, 0);
- Chain = SDOperand(FPOpOut.Val, 1);
- }
- return Chain;
-}
-
-/// CreateCopyOfByValArgument - Make a copy of an aggregate at address specified
-/// by "Src" to address "Dst" of size "Size". Alignment information is
-/// specified by the specific parameter attribute. The copy will be passed as
-/// a byval function parameter.
-/// Sometimes what we are copying is the end of a larger object, the part that
-/// does not fit in registers.
-static SDOperand
-CreateCopyOfByValArgument(SDOperand Src, SDOperand Dst, SDOperand Chain,
- ISD::ArgFlagsTy Flags, SelectionDAG &DAG,
- unsigned Size) {
- SDOperand SizeNode = DAG.getConstant(Size, MVT::i32);
- return DAG.getMemcpy(Chain, Dst, Src, SizeNode, Flags.getByValAlign(), false,
- NULL, 0, NULL, 0);
-}
-
-/// LowerMemOpCallTo - Store the argument to the stack or remember it in case of
-/// tail calls.
-static void
-LowerMemOpCallTo(SelectionDAG &DAG, MachineFunction &MF, SDOperand Chain,
- SDOperand Arg, SDOperand PtrOff, int SPDiff,
- unsigned ArgOffset, bool isPPC64, bool isTailCall,
- bool isVector, SmallVector<SDOperand, 8> &MemOpChains,
- SmallVector<TailCallArgumentInfo, 8>& TailCallArguments) {
- MVT::ValueType PtrVT = DAG.getTargetLoweringInfo().getPointerTy();
- if (!isTailCall) {
- if (isVector) {
- SDOperand StackPtr;
- if (isPPC64)
- StackPtr = DAG.getRegister(PPC::X1, MVT::i64);
- else
- StackPtr = DAG.getRegister(PPC::R1, MVT::i32);
- PtrOff = DAG.getNode(ISD::ADD, PtrVT, StackPtr,
- DAG.getConstant(ArgOffset, PtrVT));
- }
- MemOpChains.push_back(DAG.getStore(Chain, Arg, PtrOff, NULL, 0));
- // Calculate and remember argument location.
- } else CalculateTailCallArgDest(DAG, MF, isPPC64, Arg, SPDiff, ArgOffset,
- TailCallArguments);
-}
-
-SDOperand PPCTargetLowering::LowerCALL(SDOperand Op, SelectionDAG &DAG,
- const PPCSubtarget &Subtarget,
- TargetMachine &TM) {
- SDOperand Chain = Op.getOperand(0);
- bool isVarArg = cast<ConstantSDNode>(Op.getOperand(2))->getValue() != 0;
- unsigned CC = cast<ConstantSDNode>(Op.getOperand(1))->getValue();
- bool isTailCall = cast<ConstantSDNode>(Op.getOperand(3))->getValue() != 0 &&
- CC == CallingConv::Fast && PerformTailCallOpt;
- SDOperand Callee = Op.getOperand(4);
- unsigned NumOps = (Op.getNumOperands() - 5) / 2;
-
- bool isMachoABI = Subtarget.isMachoABI();
- bool isELF32_ABI = Subtarget.isELF32_ABI();
-
- MVT::ValueType PtrVT = DAG.getTargetLoweringInfo().getPointerTy();
- bool isPPC64 = PtrVT == MVT::i64;
- unsigned PtrByteSize = isPPC64 ? 8 : 4;
-
- MachineFunction &MF = DAG.getMachineFunction();
-
- // args_to_use will accumulate outgoing args for the PPCISD::CALL case in
- // SelectExpr to use to put the arguments in the appropriate registers.
- std::vector<SDOperand> args_to_use;
-
- // Mark this function as potentially containing a function that contains a
- // tail call. As a consequence the frame pointer will be used for dynamicalloc
- // and restoring the callers stack pointer in this functions epilog. This is
- // done because by tail calling the called function might overwrite the value
- // in this function's (MF) stack pointer stack slot 0(SP).
- if (PerformTailCallOpt && CC==CallingConv::Fast)
- MF.getInfo<PPCFunctionInfo>()->setHasFastCall();
-
- unsigned nAltivecParamsAtEnd = 0;
-
- // Count how many bytes are to be pushed on the stack, including the linkage
- // area, and parameter passing area. We start with 24/48 bytes, which is
- // prereserved space for [SP][CR][LR][3 x unused].
- unsigned NumBytes =
- CalculateParameterAndLinkageAreaSize(DAG, isPPC64, isMachoABI, isVarArg, CC,
- Op, nAltivecParamsAtEnd);
-
- // Calculate by how many bytes the stack has to be adjusted in case of tail
- // call optimization.
- int SPDiff = CalculateTailCallSPDiff(DAG, isTailCall, NumBytes);
-
- // Adjust the stack pointer for the new arguments...
- // These operations are automatically eliminated by the prolog/epilog pass
- Chain = DAG.getCALLSEQ_START(Chain,
- DAG.getConstant(NumBytes, PtrVT));
- SDOperand CallSeqStart = Chain;
-
- // Load the return address and frame pointer so it can be move somewhere else
- // later.
- SDOperand LROp, FPOp;
- Chain = EmitTailCallLoadFPAndRetAddr(DAG, SPDiff, Chain, LROp, FPOp);
-
- // Set up a copy of the stack pointer for use loading and storing any
- // arguments that may not fit in the registers available for argument
- // passing.
- SDOperand StackPtr;
- if (isPPC64)
- StackPtr = DAG.getRegister(PPC::X1, MVT::i64);
- else
- StackPtr = DAG.getRegister(PPC::R1, MVT::i32);
-
- // Figure out which arguments are going to go in registers, and which in
- // memory. Also, if this is a vararg function, floating point operations
- // must be stored to our stack, and loaded into integer regs as well, if
- // any integer regs are available for argument passing.
- unsigned ArgOffset = PPCFrameInfo::getLinkageSize(isPPC64, isMachoABI);
- unsigned GPR_idx = 0, FPR_idx = 0, VR_idx = 0;
-
- static const unsigned GPR_32[] = { // 32-bit registers.
- PPC::R3, PPC::R4, PPC::R5, PPC::R6,
- PPC::R7, PPC::R8, PPC::R9, PPC::R10,
- };
- static const unsigned GPR_64[] = { // 64-bit registers.
- PPC::X3, PPC::X4, PPC::X5, PPC::X6,
- PPC::X7, PPC::X8, PPC::X9, PPC::X10,
- };
- static const unsigned *FPR = GetFPR(Subtarget);
-
- static const unsigned VR[] = {
- PPC::V2, PPC::V3, PPC::V4, PPC::V5, PPC::V6, PPC::V7, PPC::V8,
- PPC::V9, PPC::V10, PPC::V11, PPC::V12, PPC::V13
- };
- const unsigned NumGPRs = array_lengthof(GPR_32);
- const unsigned NumFPRs = isMachoABI ? 13 : 8;
- const unsigned NumVRs = array_lengthof( VR);
-
- const unsigned *GPR = isPPC64 ? GPR_64 : GPR_32;
-
- std::vector<std::pair<unsigned, SDOperand> > RegsToPass;
- SmallVector<TailCallArgumentInfo, 8> TailCallArguments;
-
- SmallVector<SDOperand, 8> MemOpChains;
- for (unsigned i = 0; i != NumOps; ++i) {
- bool inMem = false;
- SDOperand Arg = Op.getOperand(5+2*i);
- ISD::ArgFlagsTy Flags =
- cast<ARG_FLAGSSDNode>(Op.getOperand(5+2*i+1))->getArgFlags();
- // See if next argument requires stack alignment in ELF
- bool Align = Flags.isSplit();
-
- // PtrOff will be used to store the current argument to the stack if a
- // register cannot be found for it.
- SDOperand PtrOff;
-
- // Stack align in ELF 32
- if (isELF32_ABI && Align)
- PtrOff = DAG.getConstant(ArgOffset + ((ArgOffset/4) % 2) * PtrByteSize,
- StackPtr.getValueType());
- else
- PtrOff = DAG.getConstant(ArgOffset, StackPtr.getValueType());
-
- PtrOff = DAG.getNode(ISD::ADD, PtrVT, StackPtr, PtrOff);
-
- // On PPC64, promote integers to 64-bit values.
- if (isPPC64 && Arg.getValueType() == MVT::i32) {
- // FIXME: Should this use ANY_EXTEND if neither sext nor zext?
- unsigned ExtOp = Flags.isSExt() ? ISD::SIGN_EXTEND : ISD::ZERO_EXTEND;
- Arg = DAG.getNode(ExtOp, MVT::i64, Arg);
- }
-
- // FIXME Elf untested, what are alignment rules?
- // FIXME memcpy is used way more than necessary. Correctness first.
- if (Flags.isByVal()) {
- unsigned Size = Flags.getByValSize();
- if (isELF32_ABI && Align) GPR_idx += (GPR_idx % 2);
- if (Size==1 || Size==2) {
- // Very small objects are passed right-justified.
- // Everything else is passed left-justified.
- MVT::ValueType VT = (Size==1) ? MVT::i8 : MVT::i16;
- if (GPR_idx != NumGPRs) {
- SDOperand Load = DAG.getExtLoad(ISD::EXTLOAD, PtrVT, Chain, Arg,
- NULL, 0, VT);
- MemOpChains.push_back(Load.getValue(1));
- RegsToPass.push_back(std::make_pair(GPR[GPR_idx++], Load));
- if (isMachoABI)
- ArgOffset += PtrByteSize;
- } else {
- SDOperand Const = DAG.getConstant(4 - Size, PtrOff.getValueType());
- SDOperand AddPtr = DAG.getNode(ISD::ADD, PtrVT, PtrOff, Const);
- SDOperand MemcpyCall = CreateCopyOfByValArgument(Arg, AddPtr,
- CallSeqStart.Val->getOperand(0),
- Flags, DAG, Size);
- // This must go outside the CALLSEQ_START..END.
- SDOperand NewCallSeqStart = DAG.getCALLSEQ_START(MemcpyCall,
- CallSeqStart.Val->getOperand(1));
- DAG.ReplaceAllUsesWith(CallSeqStart.Val, NewCallSeqStart.Val);
- Chain = CallSeqStart = NewCallSeqStart;
- ArgOffset += PtrByteSize;
- }
- continue;
- }
- // Copy entire object into memory. There are cases where gcc-generated
- // code assumes it is there, even if it could be put entirely into
- // registers. (This is not what the doc says.)
- SDOperand MemcpyCall = CreateCopyOfByValArgument(Arg, PtrOff,
- CallSeqStart.Val->getOperand(0),
- Flags, DAG, Size);
- // This must go outside the CALLSEQ_START..END.
- SDOperand NewCallSeqStart = DAG.getCALLSEQ_START(MemcpyCall,
- CallSeqStart.Val->getOperand(1));
- DAG.ReplaceAllUsesWith(CallSeqStart.Val, NewCallSeqStart.Val);
- Chain = CallSeqStart = NewCallSeqStart;
- // And copy the pieces of it that fit into registers.
- for (unsigned j=0; j<Size; j+=PtrByteSize) {
- SDOperand Const = DAG.getConstant(j, PtrOff.getValueType());
- SDOperand AddArg = DAG.getNode(ISD::ADD, PtrVT, Arg, Const);
- if (GPR_idx != NumGPRs) {
- SDOperand Load = DAG.getLoad(PtrVT, Chain, AddArg, NULL, 0);
- MemOpChains.push_back(Load.getValue(1));
- RegsToPass.push_back(std::make_pair(GPR[GPR_idx++], Load));
- if (isMachoABI)
- ArgOffset += PtrByteSize;
- } else {
- ArgOffset += ((Size - j + PtrByteSize-1)/PtrByteSize)*PtrByteSize;
- break;
- }
- }
- continue;
- }
-
- switch (Arg.getValueType()) {
- default: assert(0 && "Unexpected ValueType for argument!");
- case MVT::i32:
- case MVT::i64:
- // Double word align in ELF
- if (isELF32_ABI && Align) GPR_idx += (GPR_idx % 2);
- if (GPR_idx != NumGPRs) {
- RegsToPass.push_back(std::make_pair(GPR[GPR_idx++], Arg));
- } else {
- LowerMemOpCallTo(DAG, MF, Chain, Arg, PtrOff, SPDiff, ArgOffset,
- isPPC64, isTailCall, false, MemOpChains,
- TailCallArguments);
- inMem = true;
- }
- if (inMem || isMachoABI) {
- // Stack align in ELF
- if (isELF32_ABI && Align)
- ArgOffset += ((ArgOffset/4) % 2) * PtrByteSize;
-
- ArgOffset += PtrByteSize;
- }
- break;
- case MVT::f32:
- case MVT::f64:
- if (FPR_idx != NumFPRs) {
- RegsToPass.push_back(std::make_pair(FPR[FPR_idx++], Arg));
-
- if (isVarArg) {
- SDOperand Store = DAG.getStore(Chain, Arg, PtrOff, NULL, 0);
- MemOpChains.push_back(Store);
-
- // Float varargs are always shadowed in available integer registers
- if (GPR_idx != NumGPRs) {
- SDOperand Load = DAG.getLoad(PtrVT, Store, PtrOff, NULL, 0);
- MemOpChains.push_back(Load.getValue(1));
- if (isMachoABI) RegsToPass.push_back(std::make_pair(GPR[GPR_idx++],
- Load));
- }
- if (GPR_idx != NumGPRs && Arg.getValueType() == MVT::f64 && !isPPC64){
- SDOperand ConstFour = DAG.getConstant(4, PtrOff.getValueType());
- PtrOff = DAG.getNode(ISD::ADD, PtrVT, PtrOff, ConstFour);
- SDOperand Load = DAG.getLoad(PtrVT, Store, PtrOff, NULL, 0);
- MemOpChains.push_back(Load.getValue(1));
- if (isMachoABI) RegsToPass.push_back(std::make_pair(GPR[GPR_idx++],
- Load));
- }
- } else {
- // If we have any FPRs remaining, we may also have GPRs remaining.
- // Args passed in FPRs consume either 1 (f32) or 2 (f64) available
- // GPRs.
- if (isMachoABI) {
- if (GPR_idx != NumGPRs)
- ++GPR_idx;
- if (GPR_idx != NumGPRs && Arg.getValueType() == MVT::f64 &&
- !isPPC64) // PPC64 has 64-bit GPR's obviously :)
- ++GPR_idx;
- }
- }
- } else {
- LowerMemOpCallTo(DAG, MF, Chain, Arg, PtrOff, SPDiff, ArgOffset,
- isPPC64, isTailCall, false, MemOpChains,
- TailCallArguments);
- inMem = true;
- }
- if (inMem || isMachoABI) {
- // Stack align in ELF
- if (isELF32_ABI && Align)
- ArgOffset += ((ArgOffset/4) % 2) * PtrByteSize;
- if (isPPC64)
- ArgOffset += 8;
- else
- ArgOffset += Arg.getValueType() == MVT::f32 ? 4 : 8;
- }
- break;
- case MVT::v4f32:
- case MVT::v4i32:
- case MVT::v8i16:
- case MVT::v16i8:
- if (isVarArg) {
- // These go aligned on the stack, or in the corresponding R registers
- // when within range. The Darwin PPC ABI doc claims they also go in
- // V registers; in fact gcc does this only for arguments that are
- // prototyped, not for those that match the ... We do it for all
- // arguments, seems to work.
- while (ArgOffset % 16 !=0) {
- ArgOffset += PtrByteSize;
- if (GPR_idx != NumGPRs)
- GPR_idx++;
- }
- // We could elide this store in the case where the object fits
- // entirely in R registers. Maybe later.
- PtrOff = DAG.getNode(ISD::ADD, PtrVT, StackPtr,
- DAG.getConstant(ArgOffset, PtrVT));
- SDOperand Store = DAG.getStore(Chain, Arg, PtrOff, NULL, 0);
- MemOpChains.push_back(Store);
- if (VR_idx != NumVRs) {
- SDOperand Load = DAG.getLoad(MVT::v4f32, Store, PtrOff, NULL, 0);
- MemOpChains.push_back(Load.getValue(1));
- RegsToPass.push_back(std::make_pair(VR[VR_idx++], Load));
- }
- ArgOffset += 16;
- for (unsigned i=0; i<16; i+=PtrByteSize) {
- if (GPR_idx == NumGPRs)
- break;
- SDOperand Ix = DAG.getNode(ISD::ADD, PtrVT, PtrOff,
- DAG.getConstant(i, PtrVT));
- SDOperand Load = DAG.getLoad(PtrVT, Store, Ix, NULL, 0);
- MemOpChains.push_back(Load.getValue(1));
- RegsToPass.push_back(std::make_pair(GPR[GPR_idx++], Load));
- }
- break;
- }
-
- // Non-varargs Altivec params generally go in registers, but have
- // stack space allocated at the end.
- if (VR_idx != NumVRs) {
- // Doesn't have GPR space allocated.
- RegsToPass.push_back(std::make_pair(VR[VR_idx++], Arg));
- } else if (nAltivecParamsAtEnd==0) {
- // We are emitting Altivec params in order.
- LowerMemOpCallTo(DAG, MF, Chain, Arg, PtrOff, SPDiff, ArgOffset,
- isPPC64, isTailCall, true, MemOpChains,
- TailCallArguments);
- ArgOffset += 16;
- }
- break;
- }
- }
- // If all Altivec parameters fit in registers, as they usually do,
- // they get stack space following the non-Altivec parameters. We
- // don't track this here because nobody below needs it.
- // If there are more Altivec parameters than fit in registers emit
- // the stores here.
- if (!isVarArg && nAltivecParamsAtEnd > NumVRs) {
- unsigned j = 0;
- // Offset is aligned; skip 1st 12 params which go in V registers.
- ArgOffset = ((ArgOffset+15)/16)*16;
- ArgOffset += 12*16;
- for (unsigned i = 0; i != NumOps; ++i) {
- SDOperand Arg = Op.getOperand(5+2*i);
- MVT::ValueType ArgType = Arg.getValueType();
- if (ArgType==MVT::v4f32 || ArgType==MVT::v4i32 ||
- ArgType==MVT::v8i16 || ArgType==MVT::v16i8) {
- if (++j > NumVRs) {
- SDOperand PtrOff;
- // We are emitting Altivec params in order.
- LowerMemOpCallTo(DAG, MF, Chain, Arg, PtrOff, SPDiff, ArgOffset,
- isPPC64, isTailCall, true, MemOpChains,
- TailCallArguments);
- ArgOffset += 16;
- }
- }
- }
- }
-
- if (!MemOpChains.empty())
- Chain = DAG.getNode(ISD::TokenFactor, MVT::Other,
- &MemOpChains[0], MemOpChains.size());
-
- // Build a sequence of copy-to-reg nodes chained together with token chain
- // and flag operands which copy the outgoing args into the appropriate regs.
- SDOperand InFlag;
- for (unsigned i = 0, e = RegsToPass.size(); i != e; ++i) {
- Chain = DAG.getCopyToReg(Chain, RegsToPass[i].first, RegsToPass[i].second,
- InFlag);
- InFlag = Chain.getValue(1);
- }
-
- // With the ELF 32 ABI, set CR6 to true if this is a vararg call.
- if (isVarArg && isELF32_ABI) {
- SDOperand SetCR(DAG.getTargetNode(PPC::CRSET, MVT::i32), 0);
- Chain = DAG.getCopyToReg(Chain, PPC::CR1EQ, SetCR, InFlag);
- InFlag = Chain.getValue(1);
- }
-
- // Emit a sequence of copyto/copyfrom virtual registers for arguments that
- // might overwrite each other in case of tail call optimization.
- if (isTailCall) {
- SmallVector<SDOperand, 8> MemOpChains2;
- // Do not flag preceeding copytoreg stuff together with the following stuff.
- InFlag = SDOperand();
- StoreTailCallArgumentsToStackSlot(DAG, Chain, TailCallArguments,
- MemOpChains2);
- if (!MemOpChains2.empty())
- Chain = DAG.getNode(ISD::TokenFactor, MVT::Other,
- &MemOpChains2[0], MemOpChains2.size());
-
- // Store the return address to the appropriate stack slot.
- Chain = EmitTailCallStoreFPAndRetAddr(DAG, MF, Chain, LROp, FPOp, SPDiff,
- isPPC64, isMachoABI);
- }
-
- // Emit callseq_end just before tailcall node.
- if (isTailCall) {
- SmallVector<SDOperand, 8> CallSeqOps;
- SDVTList CallSeqNodeTys = DAG.getVTList(MVT::Other, MVT::Flag);
- CallSeqOps.push_back(Chain);
- CallSeqOps.push_back(DAG.getIntPtrConstant(NumBytes));
- CallSeqOps.push_back(DAG.getIntPtrConstant(0));
- if (InFlag.Val)
- CallSeqOps.push_back(InFlag);
- Chain = DAG.getNode(ISD::CALLSEQ_END, CallSeqNodeTys, &CallSeqOps[0],
- CallSeqOps.size());
- InFlag = Chain.getValue(1);
- }
-
- std::vector<MVT::ValueType> NodeTys;
- NodeTys.push_back(MVT::Other); // Returns a chain
- NodeTys.push_back(MVT::Flag); // Returns a flag for retval copy to use.
-
- SmallVector<SDOperand, 8> Ops;
- unsigned CallOpc = isMachoABI? PPCISD::CALL_Macho : PPCISD::CALL_ELF;
-
- // If the callee is a GlobalAddress/ExternalSymbol node (quite common, every
- // direct call is) turn it into a TargetGlobalAddress/TargetExternalSymbol
- // node so that legalize doesn't hack it.
- if (GlobalAddressSDNode *G = dyn_cast<GlobalAddressSDNode>(Callee))
- Callee = DAG.getTargetGlobalAddress(G->getGlobal(), Callee.getValueType());
- else if (ExternalSymbolSDNode *S = dyn_cast<ExternalSymbolSDNode>(Callee))
- Callee = DAG.getTargetExternalSymbol(S->getSymbol(), Callee.getValueType());
- else if (SDNode *Dest = isBLACompatibleAddress(Callee, DAG))
- // If this is an absolute destination address, use the munged value.
- Callee = SDOperand(Dest, 0);
- else {
- // Otherwise, this is an indirect call. We have to use a MTCTR/BCTRL pair
- // to do the call, we can't use PPCISD::CALL.
- SDOperand MTCTROps[] = {Chain, Callee, InFlag};
- Chain = DAG.getNode(PPCISD::MTCTR, NodeTys, MTCTROps, 2+(InFlag.Val!=0));
- InFlag = Chain.getValue(1);
-
- // Copy the callee address into R12/X12 on darwin.
- if (isMachoABI) {
- unsigned Reg = Callee.getValueType() == MVT::i32 ? PPC::R12 : PPC::X12;
- Chain = DAG.getCopyToReg(Chain, Reg, Callee, InFlag);
- InFlag = Chain.getValue(1);
- }
-
- NodeTys.clear();
- NodeTys.push_back(MVT::Other);
- NodeTys.push_back(MVT::Flag);
- Ops.push_back(Chain);
- CallOpc = isMachoABI ? PPCISD::BCTRL_Macho : PPCISD::BCTRL_ELF;
- Callee.Val = 0;
- // Add CTR register as callee so a bctr can be emitted later.
- if (isTailCall)
- Ops.push_back(DAG.getRegister(PPC::CTR, getPointerTy()));
- }
-
- // If this is a direct call, pass the chain and the callee.
- if (Callee.Val) {
- Ops.push_back(Chain);
- Ops.push_back(Callee);
- }
- // If this is a tail call add stack pointer delta.
- if (isTailCall)
- Ops.push_back(DAG.getConstant(SPDiff, MVT::i32));
-
- // Add argument registers to the end of the list so that they are known live
- // into the call.
- for (unsigned i = 0, e = RegsToPass.size(); i != e; ++i)
- Ops.push_back(DAG.getRegister(RegsToPass[i].first,
- RegsToPass[i].second.getValueType()));
-
- // When performing tail call optimization the callee pops its arguments off
- // the stack. Account for this here so these bytes can be pushed back on in
- // PPCRegisterInfo::eliminateCallFramePseudoInstr.
- int BytesCalleePops =
- (CC==CallingConv::Fast && PerformTailCallOpt) ? NumBytes : 0;
-
- if (InFlag.Val)
- Ops.push_back(InFlag);
-
- // Emit tail call.
- if (isTailCall) {
- assert(InFlag.Val &&
- "Flag must be set. Depend on flag being set in LowerRET");
- Chain = DAG.getNode(PPCISD::TAILCALL,
- Op.Val->getVTList(), &Ops[0], Ops.size());
- return SDOperand(Chain.Val, Op.ResNo);
- }
-
- Chain = DAG.getNode(CallOpc, NodeTys, &Ops[0], Ops.size());
- InFlag = Chain.getValue(1);
-
- Chain = DAG.getCALLSEQ_END(Chain,
- DAG.getConstant(NumBytes, PtrVT),
- DAG.getConstant(BytesCalleePops, PtrVT),
- InFlag);
- if (Op.Val->getValueType(0) != MVT::Other)
- InFlag = Chain.getValue(1);
-
- SmallVector<SDOperand, 16> ResultVals;
- SmallVector<CCValAssign, 16> RVLocs;
- unsigned CallerCC = DAG.getMachineFunction().getFunction()->getCallingConv();
- CCState CCInfo(CallerCC, isVarArg, TM, RVLocs);
- CCInfo.AnalyzeCallResult(Op.Val, RetCC_PPC);
-
- // Copy all of the result registers out of their specified physreg.
- for (unsigned i = 0, e = RVLocs.size(); i != e; ++i) {
- CCValAssign &VA = RVLocs[i];
- MVT::ValueType VT = VA.getValVT();
- assert(VA.isRegLoc() && "Can only return in registers!");
- Chain = DAG.getCopyFromReg(Chain, VA.getLocReg(), VT, InFlag).getValue(1);
- ResultVals.push_back(Chain.getValue(0));
- InFlag = Chain.getValue(2);
- }
-
- // If the function returns void, just return the chain.
- if (RVLocs.empty())
- return Chain;
-
- // Otherwise, merge everything together with a MERGE_VALUES node.
- ResultVals.push_back(Chain);
- SDOperand Res = DAG.getNode(ISD::MERGE_VALUES, Op.Val->getVTList(),
- &ResultVals[0], ResultVals.size());
- return Res.getValue(Op.ResNo);
-}
-
-SDOperand PPCTargetLowering::LowerRET(SDOperand Op, SelectionDAG &DAG,
- TargetMachine &TM) {
- SmallVector<CCValAssign, 16> RVLocs;
- unsigned CC = DAG.getMachineFunction().getFunction()->getCallingConv();
- bool isVarArg = DAG.getMachineFunction().getFunction()->isVarArg();
- CCState CCInfo(CC, isVarArg, TM, RVLocs);
- CCInfo.AnalyzeReturn(Op.Val, RetCC_PPC);
-
- // If this is the first return lowered for this function, add the regs to the
- // liveout set for the function.
- if (DAG.getMachineFunction().getRegInfo().liveout_empty()) {
- for (unsigned i = 0; i != RVLocs.size(); ++i)
- DAG.getMachineFunction().getRegInfo().addLiveOut(RVLocs[i].getLocReg());
- }
-
- SDOperand Chain = Op.getOperand(0);
-
- Chain = GetPossiblePreceedingTailCall(Chain, PPCISD::TAILCALL);
- if (Chain.getOpcode() == PPCISD::TAILCALL) {
- SDOperand TailCall = Chain;
- SDOperand TargetAddress = TailCall.getOperand(1);
- SDOperand StackAdjustment = TailCall.getOperand(2);
-
- assert(((TargetAddress.getOpcode() == ISD::Register &&
- cast<RegisterSDNode>(TargetAddress)->getReg() == PPC::CTR) ||
- TargetAddress.getOpcode() == ISD::TargetExternalSymbol ||
- TargetAddress.getOpcode() == ISD::TargetGlobalAddress ||
- isa<ConstantSDNode>(TargetAddress)) &&
- "Expecting an global address, external symbol, absolute value or register");
-
- assert(StackAdjustment.getOpcode() == ISD::Constant &&
- "Expecting a const value");
-
- SmallVector<SDOperand,8> Operands;
- Operands.push_back(Chain.getOperand(0));
- Operands.push_back(TargetAddress);
- Operands.push_back(StackAdjustment);
- // Copy registers used by the call. Last operand is a flag so it is not
- // copied.
- for (unsigned i=3; i < TailCall.getNumOperands()-1; i++) {
- Operands.push_back(Chain.getOperand(i));
- }
- return DAG.getNode(PPCISD::TC_RETURN, MVT::Other, &Operands[0],
- Operands.size());
- }
-
- SDOperand Flag;
-
- // Copy the result values into the output registers.
- for (unsigned i = 0; i != RVLocs.size(); ++i) {
- CCValAssign &VA = RVLocs[i];
- assert(VA.isRegLoc() && "Can only return in registers!");
- Chain = DAG.getCopyToReg(Chain, VA.getLocReg(), Op.getOperand(i*2+1), Flag);
- Flag = Chain.getValue(1);
- }
-
- if (Flag.Val)
- return DAG.getNode(PPCISD::RET_FLAG, MVT::Other, Chain, Flag);
- else
- return DAG.getNode(PPCISD::RET_FLAG, MVT::Other, Chain);
-}
-
-SDOperand PPCTargetLowering::LowerSTACKRESTORE(SDOperand Op, SelectionDAG &DAG,
- const PPCSubtarget &Subtarget) {
- // When we pop the dynamic allocation we need to restore the SP link.
-
- // Get the corect type for pointers.
- MVT::ValueType PtrVT = DAG.getTargetLoweringInfo().getPointerTy();
-
- // Construct the stack pointer operand.
- bool IsPPC64 = Subtarget.isPPC64();
- unsigned SP = IsPPC64 ? PPC::X1 : PPC::R1;
- SDOperand StackPtr = DAG.getRegister(SP, PtrVT);
-
- // Get the operands for the STACKRESTORE.
- SDOperand Chain = Op.getOperand(0);
- SDOperand SaveSP = Op.getOperand(1);
-
- // Load the old link SP.
- SDOperand LoadLinkSP = DAG.getLoad(PtrVT, Chain, StackPtr, NULL, 0);
-
- // Restore the stack pointer.
- Chain = DAG.getCopyToReg(LoadLinkSP.getValue(1), SP, SaveSP);
-
- // Store the old link SP.
- return DAG.getStore(Chain, LoadLinkSP, StackPtr, NULL, 0);
-}
-
-
-
-SDOperand
-PPCTargetLowering::getReturnAddrFrameIndex(SelectionDAG & DAG) const {
- MachineFunction &MF = DAG.getMachineFunction();
- bool IsPPC64 = PPCSubTarget.isPPC64();
- bool isMachoABI = PPCSubTarget.isMachoABI();
- MVT::ValueType PtrVT = DAG.getTargetLoweringInfo().getPointerTy();
-
- // Get current frame pointer save index. The users of this index will be
- // primarily DYNALLOC instructions.
- PPCFunctionInfo *FI = MF.getInfo<PPCFunctionInfo>();
- int RASI = FI->getReturnAddrSaveIndex();
-
- // If the frame pointer save index hasn't been defined yet.
- if (!RASI) {
- // Find out what the fix offset of the frame pointer save area.
- int LROffset = PPCFrameInfo::getReturnSaveOffset(IsPPC64, isMachoABI);
- // Allocate the frame index for frame pointer save area.
- RASI = MF.getFrameInfo()->CreateFixedObject(IsPPC64? 8 : 4, LROffset);
- // Save the result.
- FI->setReturnAddrSaveIndex(RASI);
- }
- return DAG.getFrameIndex(RASI, PtrVT);
-}
-
-SDOperand
-PPCTargetLowering::getFramePointerFrameIndex(SelectionDAG & DAG) const {
- MachineFunction &MF = DAG.getMachineFunction();
- bool IsPPC64 = PPCSubTarget.isPPC64();
- bool isMachoABI = PPCSubTarget.isMachoABI();
- MVT::ValueType PtrVT = DAG.getTargetLoweringInfo().getPointerTy();
-
- // Get current frame pointer save index. The users of this index will be
- // primarily DYNALLOC instructions.
- PPCFunctionInfo *FI = MF.getInfo<PPCFunctionInfo>();
- int FPSI = FI->getFramePointerSaveIndex();
-
- // If the frame pointer save index hasn't been defined yet.
- if (!FPSI) {
- // Find out what the fix offset of the frame pointer save area.
- int FPOffset = PPCFrameInfo::getFramePointerSaveOffset(IsPPC64, isMachoABI);
-
- // Allocate the frame index for frame pointer save area.
- FPSI = MF.getFrameInfo()->CreateFixedObject(IsPPC64? 8 : 4, FPOffset);
- // Save the result.
- FI->setFramePointerSaveIndex(FPSI);
- }
- return DAG.getFrameIndex(FPSI, PtrVT);
-}
-
-SDOperand PPCTargetLowering::LowerDYNAMIC_STACKALLOC(SDOperand Op,
- SelectionDAG &DAG,
- const PPCSubtarget &Subtarget) {
- // Get the inputs.
- SDOperand Chain = Op.getOperand(0);
- SDOperand Size = Op.getOperand(1);
-
- // Get the corect type for pointers.
- MVT::ValueType PtrVT = DAG.getTargetLoweringInfo().getPointerTy();
- // Negate the size.
- SDOperand NegSize = DAG.getNode(ISD::SUB, PtrVT,
- DAG.getConstant(0, PtrVT), Size);
- // Construct a node for the frame pointer save index.
- SDOperand FPSIdx = getFramePointerFrameIndex(DAG);
- // Build a DYNALLOC node.
- SDOperand Ops[3] = { Chain, NegSize, FPSIdx };
- SDVTList VTs = DAG.getVTList(PtrVT, MVT::Other);
- return DAG.getNode(PPCISD::DYNALLOC, VTs, Ops, 3);
-}
-
-SDOperand PPCTargetLowering::LowerAtomicLAS(SDOperand Op, SelectionDAG &DAG) {
- MVT::ValueType VT = Op.Val->getValueType(0);
- SDOperand Chain = Op.getOperand(0);
- SDOperand Ptr = Op.getOperand(1);
- SDOperand Incr = Op.getOperand(2);
-
- // Issue a "load and reserve".
- std::vector<MVT::ValueType> VTs;
- VTs.push_back(VT);
- VTs.push_back(MVT::Other);
-
- SDOperand Label = DAG.getConstant(PPCAtomicLabelIndex++, MVT::i32);
- SDOperand Ops[] = {
- Chain, // Chain
- Ptr, // Ptr
- Label, // Label
- };
- SDOperand Load = DAG.getNode(PPCISD::LARX, VTs, Ops, 3);
- Chain = Load.getValue(1);
-
- // Compute new value.
- SDOperand NewVal = DAG.getNode(ISD::ADD, VT, Load, Incr);
-
- // Issue a "store and check".
- SDOperand Ops2[] = {
- Chain, // Chain
- NewVal, // Value
- Ptr, // Ptr
- Label, // Label
- };
- SDOperand Store = DAG.getNode(PPCISD::STCX, MVT::Other, Ops2, 4);
- SDOperand OutOps[] = { Load, Store };
- return DAG.getNode(ISD::MERGE_VALUES, DAG.getVTList(VT, MVT::Other),
- OutOps, 2);
-}
-
-SDOperand PPCTargetLowering::LowerAtomicLCS(SDOperand Op, SelectionDAG &DAG) {
- MVT::ValueType VT = Op.Val->getValueType(0);
- SDOperand Chain = Op.getOperand(0);
- SDOperand Ptr = Op.getOperand(1);
- SDOperand NewVal = Op.getOperand(2);
- SDOperand OldVal = Op.getOperand(3);
-
- // Issue a "load and reserve".
- std::vector<MVT::ValueType> VTs;
- VTs.push_back(VT);
- VTs.push_back(MVT::Other);
-
- SDOperand Label = DAG.getConstant(PPCAtomicLabelIndex++, MVT::i32);
- SDOperand Ops[] = {
- Chain, // Chain
- Ptr, // Ptr
- Label, // Label
- };
- SDOperand Load = DAG.getNode(PPCISD::LARX, VTs, Ops, 3);
- Chain = Load.getValue(1);
-
- // Compare and unreserve if not equal.
- SDOperand Ops2[] = {
- Chain, // Chain
- OldVal, // Old value
- Load, // Value in memory
- Label, // Label
- };
- Chain = DAG.getNode(PPCISD::CMP_UNRESERVE, MVT::Other, Ops2, 4);
-
- // Issue a "store and check".
- SDOperand Ops3[] = {
- Chain, // Chain
- NewVal, // Value
- Ptr, // Ptr
- Label, // Label
- };
- SDOperand Store = DAG.getNode(PPCISD::STCX, MVT::Other, Ops3, 4);
- SDOperand OutOps[] = { Load, Store };
- return DAG.getNode(ISD::MERGE_VALUES, DAG.getVTList(VT, MVT::Other),
- OutOps, 2);
-}
-
-SDOperand PPCTargetLowering::LowerAtomicSWAP(SDOperand Op, SelectionDAG &DAG) {
- MVT::ValueType VT = Op.Val->getValueType(0);
- SDOperand Chain = Op.getOperand(0);
- SDOperand Ptr = Op.getOperand(1);
- SDOperand NewVal = Op.getOperand(2);
-
- // Issue a "load and reserve".
- std::vector<MVT::ValueType> VTs;
- VTs.push_back(VT);
- VTs.push_back(MVT::Other);
-
- SDOperand Label = DAG.getConstant(PPCAtomicLabelIndex++, MVT::i32);
- SDOperand Ops[] = {
- Chain, // Chain
- Ptr, // Ptr
- Label, // Label
- };
- SDOperand Load = DAG.getNode(PPCISD::LARX, VTs, Ops, 3);
- Chain = Load.getValue(1);
-
- // Issue a "store and check".
- SDOperand Ops2[] = {
- Chain, // Chain
- NewVal, // Value
- Ptr, // Ptr
- Label, // Label
- };
- SDOperand Store = DAG.getNode(PPCISD::STCX, MVT::Other, Ops2, 4);
- SDOperand OutOps[] = { Load, Store };
- return DAG.getNode(ISD::MERGE_VALUES, DAG.getVTList(VT, MVT::Other),
- OutOps, 2);
-}
-
-/// LowerSELECT_CC - Lower floating point select_cc's into fsel instruction when
-/// possible.
-SDOperand PPCTargetLowering::LowerSELECT_CC(SDOperand Op, SelectionDAG &DAG) {
- // Not FP? Not a fsel.
- if (!MVT::isFloatingPoint(Op.getOperand(0).getValueType()) ||
- !MVT::isFloatingPoint(Op.getOperand(2).getValueType()))
- return SDOperand();
-
- ISD::CondCode CC = cast<CondCodeSDNode>(Op.getOperand(4))->get();
-
- // Cannot handle SETEQ/SETNE.
- if (CC == ISD::SETEQ || CC == ISD::SETNE) return SDOperand();
-
- MVT::ValueType ResVT = Op.getValueType();
- MVT::ValueType CmpVT = Op.getOperand(0).getValueType();
- SDOperand LHS = Op.getOperand(0), RHS = Op.getOperand(1);
- SDOperand TV = Op.getOperand(2), FV = Op.getOperand(3);
-
- // If the RHS of the comparison is a 0.0, we don't need to do the
- // subtraction at all.
- if (isFloatingPointZero(RHS))
- switch (CC) {
- default: break; // SETUO etc aren't handled by fsel.
- case ISD::SETULT:
- case ISD::SETOLT:
- case ISD::SETLT:
- std::swap(TV, FV); // fsel is natively setge, swap operands for setlt
- case ISD::SETUGE:
- case ISD::SETOGE:
- case ISD::SETGE:
- if (LHS.getValueType() == MVT::f32) // Comparison is always 64-bits
- LHS = DAG.getNode(ISD::FP_EXTEND, MVT::f64, LHS);
- return DAG.getNode(PPCISD::FSEL, ResVT, LHS, TV, FV);
- case ISD::SETUGT:
- case ISD::SETOGT:
- case ISD::SETGT:
- std::swap(TV, FV); // fsel is natively setge, swap operands for setlt
- case ISD::SETULE:
- case ISD::SETOLE:
- case ISD::SETLE:
- if (LHS.getValueType() == MVT::f32) // Comparison is always 64-bits
- LHS = DAG.getNode(ISD::FP_EXTEND, MVT::f64, LHS);
- return DAG.getNode(PPCISD::FSEL, ResVT,
- DAG.getNode(ISD::FNEG, MVT::f64, LHS), TV, FV);
- }
-
- SDOperand Cmp;
- switch (CC) {
- default: break; // SETUO etc aren't handled by fsel.
- case ISD::SETULT:
- case ISD::SETOLT:
- case ISD::SETLT:
- Cmp = DAG.getNode(ISD::FSUB, CmpVT, LHS, RHS);
- if (Cmp.getValueType() == MVT::f32) // Comparison is always 64-bits
- Cmp = DAG.getNode(ISD::FP_EXTEND, MVT::f64, Cmp);
- return DAG.getNode(PPCISD::FSEL, ResVT, Cmp, FV, TV);
- case ISD::SETUGE:
- case ISD::SETOGE:
- case ISD::SETGE:
- Cmp = DAG.getNode(ISD::FSUB, CmpVT, LHS, RHS);
- if (Cmp.getValueType() == MVT::f32) // Comparison is always 64-bits
- Cmp = DAG.getNode(ISD::FP_EXTEND, MVT::f64, Cmp);
- return DAG.getNode(PPCISD::FSEL, ResVT, Cmp, TV, FV);
- case ISD::SETUGT:
- case ISD::SETOGT:
- case ISD::SETGT:
- Cmp = DAG.getNode(ISD::FSUB, CmpVT, RHS, LHS);
- if (Cmp.getValueType() == MVT::f32) // Comparison is always 64-bits
- Cmp = DAG.getNode(ISD::FP_EXTEND, MVT::f64, Cmp);
- return DAG.getNode(PPCISD::FSEL, ResVT, Cmp, FV, TV);
- case ISD::SETULE:
- case ISD::SETOLE:
- case ISD::SETLE:
- Cmp = DAG.getNode(ISD::FSUB, CmpVT, RHS, LHS);
- if (Cmp.getValueType() == MVT::f32) // Comparison is always 64-bits
- Cmp = DAG.getNode(ISD::FP_EXTEND, MVT::f64, Cmp);
- return DAG.getNode(PPCISD::FSEL, ResVT, Cmp, TV, FV);
- }
- return SDOperand();
-}
-
-// FIXME: Split this code up when LegalizeDAGTypes lands.
-SDOperand PPCTargetLowering::LowerFP_TO_SINT(SDOperand Op, SelectionDAG &DAG) {
- assert(MVT::isFloatingPoint(Op.getOperand(0).getValueType()));
- SDOperand Src = Op.getOperand(0);
- if (Src.getValueType() == MVT::f32)
- Src = DAG.getNode(ISD::FP_EXTEND, MVT::f64, Src);
-
- SDOperand Tmp;
- switch (Op.getValueType()) {
- default: assert(0 && "Unhandled FP_TO_SINT type in custom expander!");
- case MVT::i32:
- Tmp = DAG.getNode(PPCISD::FCTIWZ, MVT::f64, Src);
- break;
- case MVT::i64:
- Tmp = DAG.getNode(PPCISD::FCTIDZ, MVT::f64, Src);
- break;
- }
-
- // Convert the FP value to an int value through memory.
- SDOperand FIPtr = DAG.CreateStackTemporary(MVT::f64);
-
- // Emit a store to the stack slot.
- SDOperand Chain = DAG.getStore(DAG.getEntryNode(), Tmp, FIPtr, NULL, 0);
-
- // Result is a load from the stack slot. If loading 4 bytes, make sure to
- // add in a bias.
- if (Op.getValueType() == MVT::i32)
- FIPtr = DAG.getNode(ISD::ADD, FIPtr.getValueType(), FIPtr,
- DAG.getConstant(4, FIPtr.getValueType()));
- return DAG.getLoad(Op.getValueType(), Chain, FIPtr, NULL, 0);
-}
-
-SDOperand PPCTargetLowering::LowerFP_ROUND_INREG(SDOperand Op,
- SelectionDAG &DAG) {
- assert(Op.getValueType() == MVT::ppcf128);
- SDNode *Node = Op.Val;
- assert(Node->getOperand(0).getValueType() == MVT::ppcf128);
- assert(Node->getOperand(0).Val->getOpcode() == ISD::BUILD_PAIR);
- SDOperand Lo = Node->getOperand(0).Val->getOperand(0);
- SDOperand Hi = Node->getOperand(0).Val->getOperand(1);
-
- // This sequence changes FPSCR to do round-to-zero, adds the two halves
- // of the long double, and puts FPSCR back the way it was. We do not
- // actually model FPSCR.
- std::vector<MVT::ValueType> NodeTys;
- SDOperand Ops[4], Result, MFFSreg, InFlag, FPreg;
-
- NodeTys.push_back(MVT::f64); // Return register
- NodeTys.push_back(MVT::Flag); // Returns a flag for later insns
- Result = DAG.getNode(PPCISD::MFFS, NodeTys, &InFlag, 0);
- MFFSreg = Result.getValue(0);
- InFlag = Result.getValue(1);
-
- NodeTys.clear();
- NodeTys.push_back(MVT::Flag); // Returns a flag
- Ops[0] = DAG.getConstant(31, MVT::i32);
- Ops[1] = InFlag;
- Result = DAG.getNode(PPCISD::MTFSB1, NodeTys, Ops, 2);
- InFlag = Result.getValue(0);
-
- NodeTys.clear();
- NodeTys.push_back(MVT::Flag); // Returns a flag
- Ops[0] = DAG.getConstant(30, MVT::i32);
- Ops[1] = InFlag;
- Result = DAG.getNode(PPCISD::MTFSB0, NodeTys, Ops, 2);
- InFlag = Result.getValue(0);
-
- NodeTys.clear();
- NodeTys.push_back(MVT::f64); // result of add
- NodeTys.push_back(MVT::Flag); // Returns a flag
- Ops[0] = Lo;
- Ops[1] = Hi;
- Ops[2] = InFlag;
- Result = DAG.getNode(PPCISD::FADDRTZ, NodeTys, Ops, 3);
- FPreg = Result.getValue(0);
- InFlag = Result.getValue(1);
-
- NodeTys.clear();
- NodeTys.push_back(MVT::f64);
- Ops[0] = DAG.getConstant(1, MVT::i32);
- Ops[1] = MFFSreg;
- Ops[2] = FPreg;
- Ops[3] = InFlag;
- Result = DAG.getNode(PPCISD::MTFSF, NodeTys, Ops, 4);
- FPreg = Result.getValue(0);
-
- // We know the low half is about to be thrown away, so just use something
- // convenient.
- return DAG.getNode(ISD::BUILD_PAIR, Lo.getValueType(), FPreg, FPreg);
-}
-
-SDOperand PPCTargetLowering::LowerSINT_TO_FP(SDOperand Op, SelectionDAG &DAG) {
- // Don't handle ppc_fp128 here; let it be lowered to a libcall.
- if (Op.getValueType() != MVT::f32 && Op.getValueType() != MVT::f64)
- return SDOperand();
-
- if (Op.getOperand(0).getValueType() == MVT::i64) {
- SDOperand Bits = DAG.getNode(ISD::BIT_CONVERT, MVT::f64, Op.getOperand(0));
- SDOperand FP = DAG.getNode(PPCISD::FCFID, MVT::f64, Bits);
- if (Op.getValueType() == MVT::f32)
- FP = DAG.getNode(ISD::FP_ROUND, MVT::f32, FP, DAG.getIntPtrConstant(0));
- return FP;
- }
-
- assert(Op.getOperand(0).getValueType() == MVT::i32 &&
- "Unhandled SINT_TO_FP type in custom expander!");
- // Since we only generate this in 64-bit mode, we can take advantage of
- // 64-bit registers. In particular, sign extend the input value into the
- // 64-bit register with extsw, store the WHOLE 64-bit value into the stack
- // then lfd it and fcfid it.
- MachineFrameInfo *FrameInfo = DAG.getMachineFunction().getFrameInfo();
- int FrameIdx = FrameInfo->CreateStackObject(8, 8);
- MVT::ValueType PtrVT = DAG.getTargetLoweringInfo().getPointerTy();
- SDOperand FIdx = DAG.getFrameIndex(FrameIdx, PtrVT);
-
- SDOperand Ext64 = DAG.getNode(PPCISD::EXTSW_32, MVT::i32,
- Op.getOperand(0));
-
- // STD the extended value into the stack slot.
- MachineMemOperand MO(PseudoSourceValue::getFixedStack(),
- MachineMemOperand::MOStore, FrameIdx, 8, 8);
- SDOperand Store = DAG.getNode(PPCISD::STD_32, MVT::Other,
- DAG.getEntryNode(), Ext64, FIdx,
- DAG.getMemOperand(MO));
- // Load the value as a double.
- SDOperand Ld = DAG.getLoad(MVT::f64, Store, FIdx, NULL, 0);
-
- // FCFID it and return it.
- SDOperand FP = DAG.getNode(PPCISD::FCFID, MVT::f64, Ld);
- if (Op.getValueType() == MVT::f32)
- FP = DAG.getNode(ISD::FP_ROUND, MVT::f32, FP, DAG.getIntPtrConstant(0));
- return FP;
-}
-
-SDOperand PPCTargetLowering::LowerFLT_ROUNDS_(SDOperand Op, SelectionDAG &DAG) {
- /*
- The rounding mode is in bits 30:31 of FPSR, and has the following
- settings:
- 00 Round to nearest
- 01 Round to 0
- 10 Round to +inf
- 11 Round to -inf
-
- FLT_ROUNDS, on the other hand, expects the following:
- -1 Undefined
- 0 Round to 0
- 1 Round to nearest
- 2 Round to +inf
- 3 Round to -inf
-
- To perform the conversion, we do:
- ((FPSCR & 0x3) ^ ((~FPSCR & 0x3) >> 1))
- */
-
- MachineFunction &MF = DAG.getMachineFunction();
- MVT::ValueType VT = Op.getValueType();
- MVT::ValueType PtrVT = DAG.getTargetLoweringInfo().getPointerTy();
- std::vector<MVT::ValueType> NodeTys;
- SDOperand MFFSreg, InFlag;
-
- // Save FP Control Word to register
- NodeTys.push_back(MVT::f64); // return register
- NodeTys.push_back(MVT::Flag); // unused in this context
- SDOperand Chain = DAG.getNode(PPCISD::MFFS, NodeTys, &InFlag, 0);
-
- // Save FP register to stack slot
- int SSFI = MF.getFrameInfo()->CreateStackObject(8, 8);
- SDOperand StackSlot = DAG.getFrameIndex(SSFI, PtrVT);
- SDOperand Store = DAG.getStore(DAG.getEntryNode(), Chain,
- StackSlot, NULL, 0);
-
- // Load FP Control Word from low 32 bits of stack slot.
- SDOperand Four = DAG.getConstant(4, PtrVT);
- SDOperand Addr = DAG.getNode(ISD::ADD, PtrVT, StackSlot, Four);
- SDOperand CWD = DAG.getLoad(MVT::i32, Store, Addr, NULL, 0);
-
- // Transform as necessary
- SDOperand CWD1 =
- DAG.getNode(ISD::AND, MVT::i32,
- CWD, DAG.getConstant(3, MVT::i32));
- SDOperand CWD2 =
- DAG.getNode(ISD::SRL, MVT::i32,
- DAG.getNode(ISD::AND, MVT::i32,
- DAG.getNode(ISD::XOR, MVT::i32,
- CWD, DAG.getConstant(3, MVT::i32)),
- DAG.getConstant(3, MVT::i32)),
- DAG.getConstant(1, MVT::i8));
-
- SDOperand RetVal =
- DAG.getNode(ISD::XOR, MVT::i32, CWD1, CWD2);
-
- return DAG.getNode((MVT::getSizeInBits(VT) < 16 ?
- ISD::TRUNCATE : ISD::ZERO_EXTEND), VT, RetVal);
-}
-
-SDOperand PPCTargetLowering::LowerSHL_PARTS(SDOperand Op, SelectionDAG &DAG) {
- MVT::ValueType VT = Op.getValueType();
- unsigned BitWidth = MVT::getSizeInBits(VT);
- assert(Op.getNumOperands() == 3 &&
- VT == Op.getOperand(1).getValueType() &&
- "Unexpected SHL!");
-
- // Expand into a bunch of logical ops. Note that these ops
- // depend on the PPC behavior for oversized shift amounts.
- SDOperand Lo = Op.getOperand(0);
- SDOperand Hi = Op.getOperand(1);
- SDOperand Amt = Op.getOperand(2);
- MVT::ValueType AmtVT = Amt.getValueType();
-
- SDOperand Tmp1 = DAG.getNode(ISD::SUB, AmtVT,
- DAG.getConstant(BitWidth, AmtVT), Amt);
- SDOperand Tmp2 = DAG.getNode(PPCISD::SHL, VT, Hi, Amt);
- SDOperand Tmp3 = DAG.getNode(PPCISD::SRL, VT, Lo, Tmp1);
- SDOperand Tmp4 = DAG.getNode(ISD::OR , VT, Tmp2, Tmp3);
- SDOperand Tmp5 = DAG.getNode(ISD::ADD, AmtVT, Amt,
- DAG.getConstant(-BitWidth, AmtVT));
- SDOperand Tmp6 = DAG.getNode(PPCISD::SHL, VT, Lo, Tmp5);
- SDOperand OutHi = DAG.getNode(ISD::OR, VT, Tmp4, Tmp6);
- SDOperand OutLo = DAG.getNode(PPCISD::SHL, VT, Lo, Amt);
- SDOperand OutOps[] = { OutLo, OutHi };
- return DAG.getNode(ISD::MERGE_VALUES, DAG.getVTList(VT, VT),
- OutOps, 2);
-}
-
-SDOperand PPCTargetLowering::LowerSRL_PARTS(SDOperand Op, SelectionDAG &DAG) {
- MVT::ValueType VT = Op.getValueType();
- unsigned BitWidth = MVT::getSizeInBits(VT);
- assert(Op.getNumOperands() == 3 &&
- VT == Op.getOperand(1).getValueType() &&
- "Unexpected SRL!");
-
- // Expand into a bunch of logical ops. Note that these ops
- // depend on the PPC behavior for oversized shift amounts.
- SDOperand Lo = Op.getOperand(0);
- SDOperand Hi = Op.getOperand(1);
- SDOperand Amt = Op.getOperand(2);
- MVT::ValueType AmtVT = Amt.getValueType();
-
- SDOperand Tmp1 = DAG.getNode(ISD::SUB, AmtVT,
- DAG.getConstant(BitWidth, AmtVT), Amt);
- SDOperand Tmp2 = DAG.getNode(PPCISD::SRL, VT, Lo, Amt);
- SDOperand Tmp3 = DAG.getNode(PPCISD::SHL, VT, Hi, Tmp1);
- SDOperand Tmp4 = DAG.getNode(ISD::OR , VT, Tmp2, Tmp3);
- SDOperand Tmp5 = DAG.getNode(ISD::ADD, AmtVT, Amt,
- DAG.getConstant(-BitWidth, AmtVT));
- SDOperand Tmp6 = DAG.getNode(PPCISD::SRL, VT, Hi, Tmp5);
- SDOperand OutLo = DAG.getNode(ISD::OR, VT, Tmp4, Tmp6);
- SDOperand OutHi = DAG.getNode(PPCISD::SRL, VT, Hi, Amt);
- SDOperand OutOps[] = { OutLo, OutHi };
- return DAG.getNode(ISD::MERGE_VALUES, DAG.getVTList(VT, VT),
- OutOps, 2);
-}
-
-SDOperand PPCTargetLowering::LowerSRA_PARTS(SDOperand Op, SelectionDAG &DAG) {
- MVT::ValueType VT = Op.getValueType();
- unsigned BitWidth = MVT::getSizeInBits(VT);
- assert(Op.getNumOperands() == 3 &&
- VT == Op.getOperand(1).getValueType() &&
- "Unexpected SRA!");
-
- // Expand into a bunch of logical ops, followed by a select_cc.
- SDOperand Lo = Op.getOperand(0);
- SDOperand Hi = Op.getOperand(1);
- SDOperand Amt = Op.getOperand(2);
- MVT::ValueType AmtVT = Amt.getValueType();
-
- SDOperand Tmp1 = DAG.getNode(ISD::SUB, AmtVT,
- DAG.getConstant(BitWidth, AmtVT), Amt);
- SDOperand Tmp2 = DAG.getNode(PPCISD::SRL, VT, Lo, Amt);
- SDOperand Tmp3 = DAG.getNode(PPCISD::SHL, VT, Hi, Tmp1);
- SDOperand Tmp4 = DAG.getNode(ISD::OR , VT, Tmp2, Tmp3);
- SDOperand Tmp5 = DAG.getNode(ISD::ADD, AmtVT, Amt,
- DAG.getConstant(-BitWidth, AmtVT));
- SDOperand Tmp6 = DAG.getNode(PPCISD::SRA, VT, Hi, Tmp5);
- SDOperand OutHi = DAG.getNode(PPCISD::SRA, VT, Hi, Amt);
- SDOperand OutLo = DAG.getSelectCC(Tmp5, DAG.getConstant(0, AmtVT),
- Tmp4, Tmp6, ISD::SETLE);
- SDOperand OutOps[] = { OutLo, OutHi };
- return DAG.getNode(ISD::MERGE_VALUES, DAG.getVTList(VT, VT),
- OutOps, 2);
-}
-
-//===----------------------------------------------------------------------===//
-// Vector related lowering.
-//
-
-// If this is a vector of constants or undefs, get the bits. A bit in
-// UndefBits is set if the corresponding element of the vector is an
-// ISD::UNDEF value. For undefs, the corresponding VectorBits values are
-// zero. Return true if this is not an array of constants, false if it is.
-//
-static bool GetConstantBuildVectorBits(SDNode *BV, uint64_t VectorBits[2],
- uint64_t UndefBits[2]) {
- // Start with zero'd results.
- VectorBits[0] = VectorBits[1] = UndefBits[0] = UndefBits[1] = 0;
-
- unsigned EltBitSize = MVT::getSizeInBits(BV->getOperand(0).getValueType());
- for (unsigned i = 0, e = BV->getNumOperands(); i != e; ++i) {
- SDOperand OpVal = BV->getOperand(i);
-
- unsigned PartNo = i >= e/2; // In the upper 128 bits?
- unsigned SlotNo = e/2 - (i & (e/2-1))-1; // Which subpiece of the uint64_t.
-
- uint64_t EltBits = 0;
- if (OpVal.getOpcode() == ISD::UNDEF) {
- uint64_t EltUndefBits = ~0U >> (32-EltBitSize);
- UndefBits[PartNo] |= EltUndefBits << (SlotNo*EltBitSize);
- continue;
- } else if (ConstantSDNode *CN = dyn_cast<ConstantSDNode>(OpVal)) {
- EltBits = CN->getValue() & (~0U >> (32-EltBitSize));
- } else if (ConstantFPSDNode *CN = dyn_cast<ConstantFPSDNode>(OpVal)) {
- assert(CN->getValueType(0) == MVT::f32 &&
- "Only one legal FP vector type!");
- EltBits = FloatToBits(CN->getValueAPF().convertToFloat());
- } else {
- // Nonconstant element.
- return true;
- }
-
- VectorBits[PartNo] |= EltBits << (SlotNo*EltBitSize);
- }
-
- //printf("%llx %llx %llx %llx\n",
- // VectorBits[0], VectorBits[1], UndefBits[0], UndefBits[1]);
- return false;
-}
-
-// If this is a splat (repetition) of a value across the whole vector, return
-// the smallest size that splats it. For example, "0x01010101010101..." is a
-// splat of 0x01, 0x0101, and 0x01010101. We return SplatBits = 0x01 and
-// SplatSize = 1 byte.
-static bool isConstantSplat(const uint64_t Bits128[2],
- const uint64_t Undef128[2],
- unsigned &SplatBits, unsigned &SplatUndef,
- unsigned &SplatSize) {
-
- // Don't let undefs prevent splats from matching. See if the top 64-bits are
- // the same as the lower 64-bits, ignoring undefs.
- if ((Bits128[0] & ~Undef128[1]) != (Bits128[1] & ~Undef128[0]))
- return false; // Can't be a splat if two pieces don't match.
-
- uint64_t Bits64 = Bits128[0] | Bits128[1];
- uint64_t Undef64 = Undef128[0] & Undef128[1];
-
- // Check that the top 32-bits are the same as the lower 32-bits, ignoring
- // undefs.
- if ((Bits64 & (~Undef64 >> 32)) != ((Bits64 >> 32) & ~Undef64))
- return false; // Can't be a splat if two pieces don't match.
-
- uint32_t Bits32 = uint32_t(Bits64) | uint32_t(Bits64 >> 32);
- uint32_t Undef32 = uint32_t(Undef64) & uint32_t(Undef64 >> 32);
-
- // If the top 16-bits are different than the lower 16-bits, ignoring
- // undefs, we have an i32 splat.
- if ((Bits32 & (~Undef32 >> 16)) != ((Bits32 >> 16) & ~Undef32)) {
- SplatBits = Bits32;
- SplatUndef = Undef32;
- SplatSize = 4;
- return true;
- }
-
- uint16_t Bits16 = uint16_t(Bits32) | uint16_t(Bits32 >> 16);
- uint16_t Undef16 = uint16_t(Undef32) & uint16_t(Undef32 >> 16);
-
- // If the top 8-bits are different than the lower 8-bits, ignoring
- // undefs, we have an i16 splat.
- if ((Bits16 & (uint16_t(~Undef16) >> 8)) != ((Bits16 >> 8) & ~Undef16)) {
- SplatBits = Bits16;
- SplatUndef = Undef16;
- SplatSize = 2;
- return true;
- }
-
- // Otherwise, we have an 8-bit splat.
- SplatBits = uint8_t(Bits16) | uint8_t(Bits16 >> 8);
- SplatUndef = uint8_t(Undef16) & uint8_t(Undef16 >> 8);
- SplatSize = 1;
- return true;
-}
-
-/// BuildSplatI - Build a canonical splati of Val with an element size of
-/// SplatSize. Cast the result to VT.
-static SDOperand BuildSplatI(int Val, unsigned SplatSize, MVT::ValueType VT,
- SelectionDAG &DAG) {
- assert(Val >= -16 && Val <= 15 && "vsplti is out of range!");
-
- static const MVT::ValueType VTys[] = { // canonical VT to use for each size.
- MVT::v16i8, MVT::v8i16, MVT::Other, MVT::v4i32
- };
-
- MVT::ValueType ReqVT = VT != MVT::Other ? VT : VTys[SplatSize-1];
-
- // Force vspltis[hw] -1 to vspltisb -1 to canonicalize.
- if (Val == -1)
- SplatSize = 1;
-
- MVT::ValueType CanonicalVT = VTys[SplatSize-1];
-
- // Build a canonical splat for this value.
- SDOperand Elt = DAG.getConstant(Val, MVT::getVectorElementType(CanonicalVT));
- SmallVector<SDOperand, 8> Ops;
- Ops.assign(MVT::getVectorNumElements(CanonicalVT), Elt);
- SDOperand Res = DAG.getNode(ISD::BUILD_VECTOR, CanonicalVT,
- &Ops[0], Ops.size());
- return DAG.getNode(ISD::BIT_CONVERT, ReqVT, Res);
-}
-
-/// BuildIntrinsicOp - Return a binary operator intrinsic node with the
-/// specified intrinsic ID.
-static SDOperand BuildIntrinsicOp(unsigned IID, SDOperand LHS, SDOperand RHS,
- SelectionDAG &DAG,
- MVT::ValueType DestVT = MVT::Other) {
- if (DestVT == MVT::Other) DestVT = LHS.getValueType();
- return DAG.getNode(ISD::INTRINSIC_WO_CHAIN, DestVT,
- DAG.getConstant(IID, MVT::i32), LHS, RHS);
-}
-
-/// BuildIntrinsicOp - Return a ternary operator intrinsic node with the
-/// specified intrinsic ID.
-static SDOperand BuildIntrinsicOp(unsigned IID, SDOperand Op0, SDOperand Op1,
- SDOperand Op2, SelectionDAG &DAG,
- MVT::ValueType DestVT = MVT::Other) {
- if (DestVT == MVT::Other) DestVT = Op0.getValueType();
- return DAG.getNode(ISD::INTRINSIC_WO_CHAIN, DestVT,
- DAG.getConstant(IID, MVT::i32), Op0, Op1, Op2);
-}
-
-
-/// BuildVSLDOI - Return a VECTOR_SHUFFLE that is a vsldoi of the specified
-/// amount. The result has the specified value type.
-static SDOperand BuildVSLDOI(SDOperand LHS, SDOperand RHS, unsigned Amt,
- MVT::ValueType VT, SelectionDAG &DAG) {
- // Force LHS/RHS to be the right type.
- LHS = DAG.getNode(ISD::BIT_CONVERT, MVT::v16i8, LHS);
- RHS = DAG.getNode(ISD::BIT_CONVERT, MVT::v16i8, RHS);
-
- SDOperand Ops[16];
- for (unsigned i = 0; i != 16; ++i)
- Ops[i] = DAG.getConstant(i+Amt, MVT::i32);
- SDOperand T = DAG.getNode(ISD::VECTOR_SHUFFLE, MVT::v16i8, LHS, RHS,
- DAG.getNode(ISD::BUILD_VECTOR, MVT::v16i8, Ops,16));
- return DAG.getNode(ISD::BIT_CONVERT, VT, T);
-}
-
-// If this is a case we can't handle, return null and let the default
-// expansion code take care of it. If we CAN select this case, and if it
-// selects to a single instruction, return Op. Otherwise, if we can codegen
-// this case more efficiently than a constant pool load, lower it to the
-// sequence of ops that should be used.
-SDOperand PPCTargetLowering::LowerBUILD_VECTOR(SDOperand Op,
- SelectionDAG &DAG) {
- // If this is a vector of constants or undefs, get the bits. A bit in
- // UndefBits is set if the corresponding element of the vector is an
- // ISD::UNDEF value. For undefs, the corresponding VectorBits values are
- // zero.
- uint64_t VectorBits[2];
- uint64_t UndefBits[2];
- if (GetConstantBuildVectorBits(Op.Val, VectorBits, UndefBits))
- return SDOperand(); // Not a constant vector.
-
- // If this is a splat (repetition) of a value across the whole vector, return
- // the smallest size that splats it. For example, "0x01010101010101..." is a
- // splat of 0x01, 0x0101, and 0x01010101. We return SplatBits = 0x01 and
- // SplatSize = 1 byte.
- unsigned SplatBits, SplatUndef, SplatSize;
- if (isConstantSplat(VectorBits, UndefBits, SplatBits, SplatUndef, SplatSize)){
- bool HasAnyUndefs = (UndefBits[0] | UndefBits[1]) != 0;
-
- // First, handle single instruction cases.
-
- // All zeros?
- if (SplatBits == 0) {
- // Canonicalize all zero vectors to be v4i32.
- if (Op.getValueType() != MVT::v4i32 || HasAnyUndefs) {
- SDOperand Z = DAG.getConstant(0, MVT::i32);
- Z = DAG.getNode(ISD::BUILD_VECTOR, MVT::v4i32, Z, Z, Z, Z);
- Op = DAG.getNode(ISD::BIT_CONVERT, Op.getValueType(), Z);
- }
- return Op;
- }
-
- // If the sign extended value is in the range [-16,15], use VSPLTI[bhw].
- int32_t SextVal= int32_t(SplatBits << (32-8*SplatSize)) >> (32-8*SplatSize);
- if (SextVal >= -16 && SextVal <= 15)
- return BuildSplatI(SextVal, SplatSize, Op.getValueType(), DAG);
-
-
- // Two instruction sequences.
-
- // If this value is in the range [-32,30] and is even, use:
- // tmp = VSPLTI[bhw], result = add tmp, tmp
- if (SextVal >= -32 && SextVal <= 30 && (SextVal & 1) == 0) {
- Op = BuildSplatI(SextVal >> 1, SplatSize, Op.getValueType(), DAG);
- return DAG.getNode(ISD::ADD, Op.getValueType(), Op, Op);
- }
-
- // If this is 0x8000_0000 x 4, turn into vspltisw + vslw. If it is
- // 0x7FFF_FFFF x 4, turn it into not(0x8000_0000). This is important
- // for fneg/fabs.
- if (SplatSize == 4 && SplatBits == (0x7FFFFFFF&~SplatUndef)) {
- // Make -1 and vspltisw -1:
- SDOperand OnesV = BuildSplatI(-1, 4, MVT::v4i32, DAG);
-
- // Make the VSLW intrinsic, computing 0x8000_0000.
- SDOperand Res = BuildIntrinsicOp(Intrinsic::ppc_altivec_vslw, OnesV,
- OnesV, DAG);
-
- // xor by OnesV to invert it.
- Res = DAG.getNode(ISD::XOR, MVT::v4i32, Res, OnesV);
- return DAG.getNode(ISD::BIT_CONVERT, Op.getValueType(), Res);
- }
-
- // Check to see if this is a wide variety of vsplti*, binop self cases.
- unsigned SplatBitSize = SplatSize*8;
- static const signed char SplatCsts[] = {
- -1, 1, -2, 2, -3, 3, -4, 4, -5, 5, -6, 6, -7, 7,
- -8, 8, -9, 9, -10, 10, -11, 11, -12, 12, -13, 13, 14, -14, 15, -15, -16
- };
-
- for (unsigned idx = 0; idx < array_lengthof(SplatCsts); ++idx) {
- // Indirect through the SplatCsts array so that we favor 'vsplti -1' for
- // cases which are ambiguous (e.g. formation of 0x8000_0000). 'vsplti -1'
- int i = SplatCsts[idx];
-
- // Figure out what shift amount will be used by altivec if shifted by i in
- // this splat size.
- unsigned TypeShiftAmt = i & (SplatBitSize-1);
-
- // vsplti + shl self.
- if (SextVal == (i << (int)TypeShiftAmt)) {
- SDOperand Res = BuildSplatI(i, SplatSize, MVT::Other, DAG);
- static const unsigned IIDs[] = { // Intrinsic to use for each size.
- Intrinsic::ppc_altivec_vslb, Intrinsic::ppc_altivec_vslh, 0,
- Intrinsic::ppc_altivec_vslw
- };
- Res = BuildIntrinsicOp(IIDs[SplatSize-1], Res, Res, DAG);
- return DAG.getNode(ISD::BIT_CONVERT, Op.getValueType(), Res);
- }
-
- // vsplti + srl self.
- if (SextVal == (int)((unsigned)i >> TypeShiftAmt)) {
- SDOperand Res = BuildSplatI(i, SplatSize, MVT::Other, DAG);
- static const unsigned IIDs[] = { // Intrinsic to use for each size.
- Intrinsic::ppc_altivec_vsrb, Intrinsic::ppc_altivec_vsrh, 0,
- Intrinsic::ppc_altivec_vsrw
- };
- Res = BuildIntrinsicOp(IIDs[SplatSize-1], Res, Res, DAG);
- return DAG.getNode(ISD::BIT_CONVERT, Op.getValueType(), Res);
- }
-
- // vsplti + sra self.
- if (SextVal == (int)((unsigned)i >> TypeShiftAmt)) {
- SDOperand Res = BuildSplatI(i, SplatSize, MVT::Other, DAG);
- static const unsigned IIDs[] = { // Intrinsic to use for each size.
- Intrinsic::ppc_altivec_vsrab, Intrinsic::ppc_altivec_vsrah, 0,
- Intrinsic::ppc_altivec_vsraw
- };
- Res = BuildIntrinsicOp(IIDs[SplatSize-1], Res, Res, DAG);
- return DAG.getNode(ISD::BIT_CONVERT, Op.getValueType(), Res);
- }
-
- // vsplti + rol self.
- if (SextVal == (int)(((unsigned)i << TypeShiftAmt) |
- ((unsigned)i >> (SplatBitSize-TypeShiftAmt)))) {
- SDOperand Res = BuildSplatI(i, SplatSize, MVT::Other, DAG);
- static const unsigned IIDs[] = { // Intrinsic to use for each size.
- Intrinsic::ppc_altivec_vrlb, Intrinsic::ppc_altivec_vrlh, 0,
- Intrinsic::ppc_altivec_vrlw
- };
- Res = BuildIntrinsicOp(IIDs[SplatSize-1], Res, Res, DAG);
- return DAG.getNode(ISD::BIT_CONVERT, Op.getValueType(), Res);
- }
-
- // t = vsplti c, result = vsldoi t, t, 1
- if (SextVal == ((i << 8) | (i >> (TypeShiftAmt-8)))) {
- SDOperand T = BuildSplatI(i, SplatSize, MVT::v16i8, DAG);
- return BuildVSLDOI(T, T, 1, Op.getValueType(), DAG);
- }
- // t = vsplti c, result = vsldoi t, t, 2
- if (SextVal == ((i << 16) | (i >> (TypeShiftAmt-16)))) {
- SDOperand T = BuildSplatI(i, SplatSize, MVT::v16i8, DAG);
- return BuildVSLDOI(T, T, 2, Op.getValueType(), DAG);
- }
- // t = vsplti c, result = vsldoi t, t, 3
- if (SextVal == ((i << 24) | (i >> (TypeShiftAmt-24)))) {
- SDOperand T = BuildSplatI(i, SplatSize, MVT::v16i8, DAG);
- return BuildVSLDOI(T, T, 3, Op.getValueType(), DAG);
- }
- }
-
- // Three instruction sequences.
-
- // Odd, in range [17,31]: (vsplti C)-(vsplti -16).
- if (SextVal >= 0 && SextVal <= 31) {
- SDOperand LHS = BuildSplatI(SextVal-16, SplatSize, MVT::Other, DAG);
- SDOperand RHS = BuildSplatI(-16, SplatSize, MVT::Other, DAG);
- LHS = DAG.getNode(ISD::SUB, LHS.getValueType(), LHS, RHS);
- return DAG.getNode(ISD::BIT_CONVERT, Op.getValueType(), LHS);
- }
- // Odd, in range [-31,-17]: (vsplti C)+(vsplti -16).
- if (SextVal >= -31 && SextVal <= 0) {
- SDOperand LHS = BuildSplatI(SextVal+16, SplatSize, MVT::Other, DAG);
- SDOperand RHS = BuildSplatI(-16, SplatSize, MVT::Other, DAG);
- LHS = DAG.getNode(ISD::ADD, LHS.getValueType(), LHS, RHS);
- return DAG.getNode(ISD::BIT_CONVERT, Op.getValueType(), LHS);
- }
- }
-
- return SDOperand();
-}
-
-/// GeneratePerfectShuffle - Given an entry in the perfect-shuffle table, emit
-/// the specified operations to build the shuffle.
-static SDOperand GeneratePerfectShuffle(unsigned PFEntry, SDOperand LHS,
- SDOperand RHS, SelectionDAG &DAG) {
- unsigned OpNum = (PFEntry >> 26) & 0x0F;
- unsigned LHSID = (PFEntry >> 13) & ((1 << 13)-1);
- unsigned RHSID = (PFEntry >> 0) & ((1 << 13)-1);
-
- enum {
- OP_COPY = 0, // Copy, used for things like <u,u,u,3> to say it is <0,1,2,3>
- OP_VMRGHW,
- OP_VMRGLW,
- OP_VSPLTISW0,
- OP_VSPLTISW1,
- OP_VSPLTISW2,
- OP_VSPLTISW3,
- OP_VSLDOI4,
- OP_VSLDOI8,
- OP_VSLDOI12
- };
-
- if (OpNum == OP_COPY) {
- if (LHSID == (1*9+2)*9+3) return LHS;
- assert(LHSID == ((4*9+5)*9+6)*9+7 && "Illegal OP_COPY!");
- return RHS;
- }
-
- SDOperand OpLHS, OpRHS;
- OpLHS = GeneratePerfectShuffle(PerfectShuffleTable[LHSID], LHS, RHS, DAG);
- OpRHS = GeneratePerfectShuffle(PerfectShuffleTable[RHSID], LHS, RHS, DAG);
-
- unsigned ShufIdxs[16];
- switch (OpNum) {
- default: assert(0 && "Unknown i32 permute!");
- case OP_VMRGHW:
- ShufIdxs[ 0] = 0; ShufIdxs[ 1] = 1; ShufIdxs[ 2] = 2; ShufIdxs[ 3] = 3;
- ShufIdxs[ 4] = 16; ShufIdxs[ 5] = 17; ShufIdxs[ 6] = 18; ShufIdxs[ 7] = 19;
- ShufIdxs[ 8] = 4; ShufIdxs[ 9] = 5; ShufIdxs[10] = 6; ShufIdxs[11] = 7;
- ShufIdxs[12] = 20; ShufIdxs[13] = 21; ShufIdxs[14] = 22; ShufIdxs[15] = 23;
- break;
- case OP_VMRGLW:
- ShufIdxs[ 0] = 8; ShufIdxs[ 1] = 9; ShufIdxs[ 2] = 10; ShufIdxs[ 3] = 11;
- ShufIdxs[ 4] = 24; ShufIdxs[ 5] = 25; ShufIdxs[ 6] = 26; ShufIdxs[ 7] = 27;
- ShufIdxs[ 8] = 12; ShufIdxs[ 9] = 13; ShufIdxs[10] = 14; ShufIdxs[11] = 15;
- ShufIdxs[12] = 28; ShufIdxs[13] = 29; ShufIdxs[14] = 30; ShufIdxs[15] = 31;
- break;
- case OP_VSPLTISW0:
- for (unsigned i = 0; i != 16; ++i)
- ShufIdxs[i] = (i&3)+0;
- break;
- case OP_VSPLTISW1:
- for (unsigned i = 0; i != 16; ++i)
- ShufIdxs[i] = (i&3)+4;
- break;
- case OP_VSPLTISW2:
- for (unsigned i = 0; i != 16; ++i)
- ShufIdxs[i] = (i&3)+8;
- break;
- case OP_VSPLTISW3:
- for (unsigned i = 0; i != 16; ++i)
- ShufIdxs[i] = (i&3)+12;
- break;
- case OP_VSLDOI4:
- return BuildVSLDOI(OpLHS, OpRHS, 4, OpLHS.getValueType(), DAG);
- case OP_VSLDOI8:
- return BuildVSLDOI(OpLHS, OpRHS, 8, OpLHS.getValueType(), DAG);
- case OP_VSLDOI12:
- return BuildVSLDOI(OpLHS, OpRHS, 12, OpLHS.getValueType(), DAG);
- }
- SDOperand Ops[16];
- for (unsigned i = 0; i != 16; ++i)
- Ops[i] = DAG.getConstant(ShufIdxs[i], MVT::i32);
-
- return DAG.getNode(ISD::VECTOR_SHUFFLE, OpLHS.getValueType(), OpLHS, OpRHS,
- DAG.getNode(ISD::BUILD_VECTOR, MVT::v16i8, Ops, 16));
-}
-
-/// LowerVECTOR_SHUFFLE - Return the code we lower for VECTOR_SHUFFLE. If this
-/// is a shuffle we can handle in a single instruction, return it. Otherwise,
-/// return the code it can be lowered into. Worst case, it can always be
-/// lowered into a vperm.
-SDOperand PPCTargetLowering::LowerVECTOR_SHUFFLE(SDOperand Op,
- SelectionDAG &DAG) {
- SDOperand V1 = Op.getOperand(0);
- SDOperand V2 = Op.getOperand(1);
- SDOperand PermMask = Op.getOperand(2);
-
- // Cases that are handled by instructions that take permute immediates
- // (such as vsplt*) should be left as VECTOR_SHUFFLE nodes so they can be
- // selected by the instruction selector.
- if (V2.getOpcode() == ISD::UNDEF) {
- if (PPC::isSplatShuffleMask(PermMask.Val, 1) ||
- PPC::isSplatShuffleMask(PermMask.Val, 2) ||
- PPC::isSplatShuffleMask(PermMask.Val, 4) ||
- PPC::isVPKUWUMShuffleMask(PermMask.Val, true) ||
- PPC::isVPKUHUMShuffleMask(PermMask.Val, true) ||
- PPC::isVSLDOIShuffleMask(PermMask.Val, true) != -1 ||
- PPC::isVMRGLShuffleMask(PermMask.Val, 1, true) ||
- PPC::isVMRGLShuffleMask(PermMask.Val, 2, true) ||
- PPC::isVMRGLShuffleMask(PermMask.Val, 4, true) ||
- PPC::isVMRGHShuffleMask(PermMask.Val, 1, true) ||
- PPC::isVMRGHShuffleMask(PermMask.Val, 2, true) ||
- PPC::isVMRGHShuffleMask(PermMask.Val, 4, true)) {
- return Op;
- }
- }
-
- // Altivec has a variety of "shuffle immediates" that take two vector inputs
- // and produce a fixed permutation. If any of these match, do not lower to
- // VPERM.
- if (PPC::isVPKUWUMShuffleMask(PermMask.Val, false) ||
- PPC::isVPKUHUMShuffleMask(PermMask.Val, false) ||
- PPC::isVSLDOIShuffleMask(PermMask.Val, false) != -1 ||
- PPC::isVMRGLShuffleMask(PermMask.Val, 1, false) ||
- PPC::isVMRGLShuffleMask(PermMask.Val, 2, false) ||
- PPC::isVMRGLShuffleMask(PermMask.Val, 4, false) ||
- PPC::isVMRGHShuffleMask(PermMask.Val, 1, false) ||
- PPC::isVMRGHShuffleMask(PermMask.Val, 2, false) ||
- PPC::isVMRGHShuffleMask(PermMask.Val, 4, false))
- return Op;
-
- // Check to see if this is a shuffle of 4-byte values. If so, we can use our
- // perfect shuffle table to emit an optimal matching sequence.
- unsigned PFIndexes[4];
- bool isFourElementShuffle = true;
- for (unsigned i = 0; i != 4 && isFourElementShuffle; ++i) { // Element number
- unsigned EltNo = 8; // Start out undef.
- for (unsigned j = 0; j != 4; ++j) { // Intra-element byte.
- if (PermMask.getOperand(i*4+j).getOpcode() == ISD::UNDEF)
- continue; // Undef, ignore it.
-
- unsigned ByteSource =
- cast<ConstantSDNode>(PermMask.getOperand(i*4+j))->getValue();
- if ((ByteSource & 3) != j) {
- isFourElementShuffle = false;
- break;
- }
-
- if (EltNo == 8) {
- EltNo = ByteSource/4;
- } else if (EltNo != ByteSource/4) {
- isFourElementShuffle = false;
- break;
- }
- }
- PFIndexes[i] = EltNo;
- }
-
- // If this shuffle can be expressed as a shuffle of 4-byte elements, use the
- // perfect shuffle vector to determine if it is cost effective to do this as
- // discrete instructions, or whether we should use a vperm.
- if (isFourElementShuffle) {
- // Compute the index in the perfect shuffle table.
- unsigned PFTableIndex =
- PFIndexes[0]*9*9*9+PFIndexes[1]*9*9+PFIndexes[2]*9+PFIndexes[3];
-
- unsigned PFEntry = PerfectShuffleTable[PFTableIndex];
- unsigned Cost = (PFEntry >> 30);
-
- // Determining when to avoid vperm is tricky. Many things affect the cost
- // of vperm, particularly how many times the perm mask needs to be computed.
- // For example, if the perm mask can be hoisted out of a loop or is already
- // used (perhaps because there are multiple permutes with the same shuffle
- // mask?) the vperm has a cost of 1. OTOH, hoisting the permute mask out of
- // the loop requires an extra register.
- //
- // As a compromise, we only emit discrete instructions if the shuffle can be
- // generated in 3 or fewer operations. When we have loop information
- // available, if this block is within a loop, we should avoid using vperm
- // for 3-operation perms and use a constant pool load instead.
- if (Cost < 3)
- return GeneratePerfectShuffle(PFEntry, V1, V2, DAG);
- }
-
- // Lower this to a VPERM(V1, V2, V3) expression, where V3 is a constant
- // vector that will get spilled to the constant pool.
- if (V2.getOpcode() == ISD::UNDEF) V2 = V1;
-
- // The SHUFFLE_VECTOR mask is almost exactly what we want for vperm, except
- // that it is in input element units, not in bytes. Convert now.
- MVT::ValueType EltVT = MVT::getVectorElementType(V1.getValueType());
- unsigned BytesPerElement = MVT::getSizeInBits(EltVT)/8;
-
- SmallVector<SDOperand, 16> ResultMask;
- for (unsigned i = 0, e = PermMask.getNumOperands(); i != e; ++i) {
- unsigned SrcElt;
- if (PermMask.getOperand(i).getOpcode() == ISD::UNDEF)
- SrcElt = 0;
- else
- SrcElt = cast<ConstantSDNode>(PermMask.getOperand(i))->getValue();
-
- for (unsigned j = 0; j != BytesPerElement; ++j)
- ResultMask.push_back(DAG.getConstant(SrcElt*BytesPerElement+j,
- MVT::i8));
- }
-
- SDOperand VPermMask = DAG.getNode(ISD::BUILD_VECTOR, MVT::v16i8,
- &ResultMask[0], ResultMask.size());
- return DAG.getNode(PPCISD::VPERM, V1.getValueType(), V1, V2, VPermMask);
-}
-
-/// getAltivecCompareInfo - Given an intrinsic, return false if it is not an
-/// altivec comparison. If it is, return true and fill in Opc/isDot with
-/// information about the intrinsic.
-static bool getAltivecCompareInfo(SDOperand Intrin, int &CompareOpc,
- bool &isDot) {
- unsigned IntrinsicID = cast<ConstantSDNode>(Intrin.getOperand(0))->getValue();
- CompareOpc = -1;
- isDot = false;
- switch (IntrinsicID) {
- default: return false;
- // Comparison predicates.
- case Intrinsic::ppc_altivec_vcmpbfp_p: CompareOpc = 966; isDot = 1; break;
- case Intrinsic::ppc_altivec_vcmpeqfp_p: CompareOpc = 198; isDot = 1; break;
- case Intrinsic::ppc_altivec_vcmpequb_p: CompareOpc = 6; isDot = 1; break;
- case Intrinsic::ppc_altivec_vcmpequh_p: CompareOpc = 70; isDot = 1; break;
- case Intrinsic::ppc_altivec_vcmpequw_p: CompareOpc = 134; isDot = 1; break;
- case Intrinsic::ppc_altivec_vcmpgefp_p: CompareOpc = 454; isDot = 1; break;
- case Intrinsic::ppc_altivec_vcmpgtfp_p: CompareOpc = 710; isDot = 1; break;
- case Intrinsic::ppc_altivec_vcmpgtsb_p: CompareOpc = 774; isDot = 1; break;
- case Intrinsic::ppc_altivec_vcmpgtsh_p: CompareOpc = 838; isDot = 1; break;
- case Intrinsic::ppc_altivec_vcmpgtsw_p: CompareOpc = 902; isDot = 1; break;
- case Intrinsic::ppc_altivec_vcmpgtub_p: CompareOpc = 518; isDot = 1; break;
- case Intrinsic::ppc_altivec_vcmpgtuh_p: CompareOpc = 582; isDot = 1; break;
- case Intrinsic::ppc_altivec_vcmpgtuw_p: CompareOpc = 646; isDot = 1; break;
-
- // Normal Comparisons.
- case Intrinsic::ppc_altivec_vcmpbfp: CompareOpc = 966; isDot = 0; break;
- case Intrinsic::ppc_altivec_vcmpeqfp: CompareOpc = 198; isDot = 0; break;
- case Intrinsic::ppc_altivec_vcmpequb: CompareOpc = 6; isDot = 0; break;
- case Intrinsic::ppc_altivec_vcmpequh: CompareOpc = 70; isDot = 0; break;
- case Intrinsic::ppc_altivec_vcmpequw: CompareOpc = 134; isDot = 0; break;
- case Intrinsic::ppc_altivec_vcmpgefp: CompareOpc = 454; isDot = 0; break;
- case Intrinsic::ppc_altivec_vcmpgtfp: CompareOpc = 710; isDot = 0; break;
- case Intrinsic::ppc_altivec_vcmpgtsb: CompareOpc = 774; isDot = 0; break;
- case Intrinsic::ppc_altivec_vcmpgtsh: CompareOpc = 838; isDot = 0; break;
- case Intrinsic::ppc_altivec_vcmpgtsw: CompareOpc = 902; isDot = 0; break;
- case Intrinsic::ppc_altivec_vcmpgtub: CompareOpc = 518; isDot = 0; break;
- case Intrinsic::ppc_altivec_vcmpgtuh: CompareOpc = 582; isDot = 0; break;
- case Intrinsic::ppc_altivec_vcmpgtuw: CompareOpc = 646; isDot = 0; break;
- }
- return true;
-}
-
-/// LowerINTRINSIC_WO_CHAIN - If this is an intrinsic that we want to custom
-/// lower, do it, otherwise return null.
-SDOperand PPCTargetLowering::LowerINTRINSIC_WO_CHAIN(SDOperand Op,
- SelectionDAG &DAG) {
- // If this is a lowered altivec predicate compare, CompareOpc is set to the
- // opcode number of the comparison.
- int CompareOpc;
- bool isDot;
- if (!getAltivecCompareInfo(Op, CompareOpc, isDot))
- return SDOperand(); // Don't custom lower most intrinsics.
-
- // If this is a non-dot comparison, make the VCMP node and we are done.
- if (!isDot) {
- SDOperand Tmp = DAG.getNode(PPCISD::VCMP, Op.getOperand(2).getValueType(),
- Op.getOperand(1), Op.getOperand(2),
- DAG.getConstant(CompareOpc, MVT::i32));
- return DAG.getNode(ISD::BIT_CONVERT, Op.getValueType(), Tmp);
- }
-
- // Create the PPCISD altivec 'dot' comparison node.
- SDOperand Ops[] = {
- Op.getOperand(2), // LHS
- Op.getOperand(3), // RHS
- DAG.getConstant(CompareOpc, MVT::i32)
- };
- std::vector<MVT::ValueType> VTs;
- VTs.push_back(Op.getOperand(2).getValueType());
- VTs.push_back(MVT::Flag);
- SDOperand CompNode = DAG.getNode(PPCISD::VCMPo, VTs, Ops, 3);
-
- // Now that we have the comparison, emit a copy from the CR to a GPR.
- // This is flagged to the above dot comparison.
- SDOperand Flags = DAG.getNode(PPCISD::MFCR, MVT::i32,
- DAG.getRegister(PPC::CR6, MVT::i32),
- CompNode.getValue(1));
-
- // Unpack the result based on how the target uses it.
- unsigned BitNo; // Bit # of CR6.
- bool InvertBit; // Invert result?
- switch (cast<ConstantSDNode>(Op.getOperand(1))->getValue()) {
- default: // Can't happen, don't crash on invalid number though.
- case 0: // Return the value of the EQ bit of CR6.
- BitNo = 0; InvertBit = false;
- break;
- case 1: // Return the inverted value of the EQ bit of CR6.
- BitNo = 0; InvertBit = true;
- break;
- case 2: // Return the value of the LT bit of CR6.
- BitNo = 2; InvertBit = false;
- break;
- case 3: // Return the inverted value of the LT bit of CR6.
- BitNo = 2; InvertBit = true;
- break;
- }
-
- // Shift the bit into the low position.
- Flags = DAG.getNode(ISD::SRL, MVT::i32, Flags,
- DAG.getConstant(8-(3-BitNo), MVT::i32));
- // Isolate the bit.
- Flags = DAG.getNode(ISD::AND, MVT::i32, Flags,
- DAG.getConstant(1, MVT::i32));
-
- // If we are supposed to, toggle the bit.
- if (InvertBit)
- Flags = DAG.getNode(ISD::XOR, MVT::i32, Flags,
- DAG.getConstant(1, MVT::i32));
- return Flags;
-}
-
-SDOperand PPCTargetLowering::LowerSCALAR_TO_VECTOR(SDOperand Op,
- SelectionDAG &DAG) {
- // Create a stack slot that is 16-byte aligned.
- MachineFrameInfo *FrameInfo = DAG.getMachineFunction().getFrameInfo();
- int FrameIdx = FrameInfo->CreateStackObject(16, 16);
- MVT::ValueType PtrVT = DAG.getTargetLoweringInfo().getPointerTy();
- SDOperand FIdx = DAG.getFrameIndex(FrameIdx, PtrVT);
-
- // Store the input value into Value#0 of the stack slot.
- SDOperand Store = DAG.getStore(DAG.getEntryNode(),
- Op.getOperand(0), FIdx, NULL, 0);
- // Load it out.
- return DAG.getLoad(Op.getValueType(), Store, FIdx, NULL, 0);
-}
-
-SDOperand PPCTargetLowering::LowerMUL(SDOperand Op, SelectionDAG &DAG) {
- if (Op.getValueType() == MVT::v4i32) {
- SDOperand LHS = Op.getOperand(0), RHS = Op.getOperand(1);
-
- SDOperand Zero = BuildSplatI( 0, 1, MVT::v4i32, DAG);
- SDOperand Neg16 = BuildSplatI(-16, 4, MVT::v4i32, DAG); // +16 as shift amt.
-
- SDOperand RHSSwap = // = vrlw RHS, 16
- BuildIntrinsicOp(Intrinsic::ppc_altivec_vrlw, RHS, Neg16, DAG);
-
- // Shrinkify inputs to v8i16.
- LHS = DAG.getNode(ISD::BIT_CONVERT, MVT::v8i16, LHS);
- RHS = DAG.getNode(ISD::BIT_CONVERT, MVT::v8i16, RHS);
- RHSSwap = DAG.getNode(ISD::BIT_CONVERT, MVT::v8i16, RHSSwap);
-
- // Low parts multiplied together, generating 32-bit results (we ignore the
- // top parts).
- SDOperand LoProd = BuildIntrinsicOp(Intrinsic::ppc_altivec_vmulouh,
- LHS, RHS, DAG, MVT::v4i32);
-
- SDOperand HiProd = BuildIntrinsicOp(Intrinsic::ppc_altivec_vmsumuhm,
- LHS, RHSSwap, Zero, DAG, MVT::v4i32);
- // Shift the high parts up 16 bits.
- HiProd = BuildIntrinsicOp(Intrinsic::ppc_altivec_vslw, HiProd, Neg16, DAG);
- return DAG.getNode(ISD::ADD, MVT::v4i32, LoProd, HiProd);
- } else if (Op.getValueType() == MVT::v8i16) {
- SDOperand LHS = Op.getOperand(0), RHS = Op.getOperand(1);
-
- SDOperand Zero = BuildSplatI(0, 1, MVT::v8i16, DAG);
-
- return BuildIntrinsicOp(Intrinsic::ppc_altivec_vmladduhm,
- LHS, RHS, Zero, DAG);
- } else if (Op.getValueType() == MVT::v16i8) {
- SDOperand LHS = Op.getOperand(0), RHS = Op.getOperand(1);
-
- // Multiply the even 8-bit parts, producing 16-bit sums.
- SDOperand EvenParts = BuildIntrinsicOp(Intrinsic::ppc_altivec_vmuleub,
- LHS, RHS, DAG, MVT::v8i16);
- EvenParts = DAG.getNode(ISD::BIT_CONVERT, MVT::v16i8, EvenParts);
-
- // Multiply the odd 8-bit parts, producing 16-bit sums.
- SDOperand OddParts = BuildIntrinsicOp(Intrinsic::ppc_altivec_vmuloub,
- LHS, RHS, DAG, MVT::v8i16);
- OddParts = DAG.getNode(ISD::BIT_CONVERT, MVT::v16i8, OddParts);
-
- // Merge the results together.
- SDOperand Ops[16];
- for (unsigned i = 0; i != 8; ++i) {
- Ops[i*2 ] = DAG.getConstant(2*i+1, MVT::i8);
- Ops[i*2+1] = DAG.getConstant(2*i+1+16, MVT::i8);
- }
- return DAG.getNode(ISD::VECTOR_SHUFFLE, MVT::v16i8, EvenParts, OddParts,
- DAG.getNode(ISD::BUILD_VECTOR, MVT::v16i8, Ops, 16));
- } else {
- assert(0 && "Unknown mul to lower!");
- abort();
- }
-}
-
-/// LowerOperation - Provide custom lowering hooks for some operations.
-///
-SDOperand PPCTargetLowering::LowerOperation(SDOperand Op, SelectionDAG &DAG) {
- switch (Op.getOpcode()) {
- default: assert(0 && "Wasn't expecting to be able to lower this!");
- case ISD::ConstantPool: return LowerConstantPool(Op, DAG);
- case ISD::GlobalAddress: return LowerGlobalAddress(Op, DAG);
- case ISD::GlobalTLSAddress: return LowerGlobalTLSAddress(Op, DAG);
- case ISD::JumpTable: return LowerJumpTable(Op, DAG);
- case ISD::SETCC: return LowerSETCC(Op, DAG);
- case ISD::VASTART:
- return LowerVASTART(Op, DAG, VarArgsFrameIndex, VarArgsStackOffset,
- VarArgsNumGPR, VarArgsNumFPR, PPCSubTarget);
-
- case ISD::VAARG:
- return LowerVAARG(Op, DAG, VarArgsFrameIndex, VarArgsStackOffset,
- VarArgsNumGPR, VarArgsNumFPR, PPCSubTarget);
-
- case ISD::FORMAL_ARGUMENTS:
- return LowerFORMAL_ARGUMENTS(Op, DAG, VarArgsFrameIndex,
- VarArgsStackOffset, VarArgsNumGPR,
- VarArgsNumFPR, PPCSubTarget);
-
- case ISD::CALL: return LowerCALL(Op, DAG, PPCSubTarget,
- getTargetMachine());
- case ISD::RET: return LowerRET(Op, DAG, getTargetMachine());
- case ISD::STACKRESTORE: return LowerSTACKRESTORE(Op, DAG, PPCSubTarget);
- case ISD::DYNAMIC_STACKALLOC:
- return LowerDYNAMIC_STACKALLOC(Op, DAG, PPCSubTarget);
-
- case ISD::ATOMIC_LAS: return LowerAtomicLAS(Op, DAG);
- case ISD::ATOMIC_LCS: return LowerAtomicLCS(Op, DAG);
- case ISD::ATOMIC_SWAP: return LowerAtomicSWAP(Op, DAG);
-
- case ISD::SELECT_CC: return LowerSELECT_CC(Op, DAG);
- case ISD::FP_TO_SINT: return LowerFP_TO_SINT(Op, DAG);
- case ISD::SINT_TO_FP: return LowerSINT_TO_FP(Op, DAG);
- case ISD::FP_ROUND_INREG: return LowerFP_ROUND_INREG(Op, DAG);
- case ISD::FLT_ROUNDS_: return LowerFLT_ROUNDS_(Op, DAG);
-
- // Lower 64-bit shifts.
- case ISD::SHL_PARTS: return LowerSHL_PARTS(Op, DAG);
- case ISD::SRL_PARTS: return LowerSRL_PARTS(Op, DAG);
- case ISD::SRA_PARTS: return LowerSRA_PARTS(Op, DAG);
-
- // Vector-related lowering.
- case ISD::BUILD_VECTOR: return LowerBUILD_VECTOR(Op, DAG);
- case ISD::VECTOR_SHUFFLE: return LowerVECTOR_SHUFFLE(Op, DAG);
- case ISD::INTRINSIC_WO_CHAIN: return LowerINTRINSIC_WO_CHAIN(Op, DAG);
- case ISD::SCALAR_TO_VECTOR: return LowerSCALAR_TO_VECTOR(Op, DAG);
- case ISD::MUL: return LowerMUL(Op, DAG);
-
- // Frame & Return address.
- case ISD::RETURNADDR: return LowerRETURNADDR(Op, DAG);
- case ISD::FRAMEADDR: return LowerFRAMEADDR(Op, DAG);
- }
- return SDOperand();
-}
-
-SDNode *PPCTargetLowering::ExpandOperationResult(SDNode *N, SelectionDAG &DAG) {
- switch (N->getOpcode()) {
- default: assert(0 && "Wasn't expecting to be able to lower this!");
- case ISD::FP_TO_SINT: return LowerFP_TO_SINT(SDOperand(N, 0), DAG).Val;
- }
-}
-
-
-//===----------------------------------------------------------------------===//
-// Other Lowering Code
-//===----------------------------------------------------------------------===//
-
-MachineBasicBlock *
-PPCTargetLowering::EmitInstrWithCustomInserter(MachineInstr *MI,
- MachineBasicBlock *BB) {
- const TargetInstrInfo *TII = getTargetMachine().getInstrInfo();
- assert((MI->getOpcode() == PPC::SELECT_CC_I4 ||
- MI->getOpcode() == PPC::SELECT_CC_I8 ||
- MI->getOpcode() == PPC::SELECT_CC_F4 ||
- MI->getOpcode() == PPC::SELECT_CC_F8 ||
- MI->getOpcode() == PPC::SELECT_CC_VRRC) &&
- "Unexpected instr type to insert");
-
- // To "insert" a SELECT_CC instruction, we actually have to insert the diamond
- // control-flow pattern. The incoming instruction knows the destination vreg
- // to set, the condition code register to branch on, the true/false values to
- // select between, and a branch opcode to use.
- const BasicBlock *LLVM_BB = BB->getBasicBlock();
- ilist<MachineBasicBlock>::iterator It = BB;
- ++It;
-
- // thisMBB:
- // ...
- // TrueVal = ...
- // cmpTY ccX, r1, r2
- // bCC copy1MBB
- // fallthrough --> copy0MBB
- MachineBasicBlock *thisMBB = BB;
- MachineBasicBlock *copy0MBB = new MachineBasicBlock(LLVM_BB);
- MachineBasicBlock *sinkMBB = new MachineBasicBlock(LLVM_BB);
- unsigned SelectPred = MI->getOperand(4).getImm();
- BuildMI(BB, TII->get(PPC::BCC))
- .addImm(SelectPred).addReg(MI->getOperand(1).getReg()).addMBB(sinkMBB);
- MachineFunction *F = BB->getParent();
- F->getBasicBlockList().insert(It, copy0MBB);
- F->getBasicBlockList().insert(It, sinkMBB);
- // Update machine-CFG edges by first adding all successors of the current
- // block to the new block which will contain the Phi node for the select.
- for(MachineBasicBlock::succ_iterator i = BB->succ_begin(),
- e = BB->succ_end(); i != e; ++i)
- sinkMBB->addSuccessor(*i);
- // Next, remove all successors of the current block, and add the true
- // and fallthrough blocks as its successors.
- while(!BB->succ_empty())
- BB->removeSuccessor(BB->succ_begin());
- BB->addSuccessor(copy0MBB);
- BB->addSuccessor(sinkMBB);
-
- // copy0MBB:
- // %FalseValue = ...
- // # fallthrough to sinkMBB
- BB = copy0MBB;
-
- // Update machine-CFG edges
- BB->addSuccessor(sinkMBB);
-
- // sinkMBB:
- // %Result = phi [ %FalseValue, copy0MBB ], [ %TrueValue, thisMBB ]
- // ...
- BB = sinkMBB;
- BuildMI(BB, TII->get(PPC::PHI), MI->getOperand(0).getReg())
- .addReg(MI->getOperand(3).getReg()).addMBB(copy0MBB)
- .addReg(MI->getOperand(2).getReg()).addMBB(thisMBB);
-
- delete MI; // The pseudo instruction is gone now.
- return BB;
-}
-
-//===----------------------------------------------------------------------===//
-// Target Optimization Hooks
-//===----------------------------------------------------------------------===//
-
-SDOperand PPCTargetLowering::PerformDAGCombine(SDNode *N,
- DAGCombinerInfo &DCI) const {
- TargetMachine &TM = getTargetMachine();
- SelectionDAG &DAG = DCI.DAG;
- switch (N->getOpcode()) {
- default: break;
- case PPCISD::SHL:
- if (ConstantSDNode *C = dyn_cast<ConstantSDNode>(N->getOperand(0))) {
- if (C->getValue() == 0) // 0 << V -> 0.
- return N->getOperand(0);
- }
- break;
- case PPCISD::SRL:
- if (ConstantSDNode *C = dyn_cast<ConstantSDNode>(N->getOperand(0))) {
- if (C->getValue() == 0) // 0 >>u V -> 0.
- return N->getOperand(0);
- }
- break;
- case PPCISD::SRA:
- if (ConstantSDNode *C = dyn_cast<ConstantSDNode>(N->getOperand(0))) {
- if (C->getValue() == 0 || // 0 >>s V -> 0.
- C->isAllOnesValue()) // -1 >>s V -> -1.
- return N->getOperand(0);
- }
- break;
-
- case ISD::SINT_TO_FP:
- if (TM.getSubtarget<PPCSubtarget>().has64BitSupport()) {
- if (N->getOperand(0).getOpcode() == ISD::FP_TO_SINT) {
- // Turn (sint_to_fp (fp_to_sint X)) -> fctidz/fcfid without load/stores.
- // We allow the src/dst to be either f32/f64, but the intermediate
- // type must be i64.
- if (N->getOperand(0).getValueType() == MVT::i64 &&
- N->getOperand(0).getOperand(0).getValueType() != MVT::ppcf128) {
- SDOperand Val = N->getOperand(0).getOperand(0);
- if (Val.getValueType() == MVT::f32) {
- Val = DAG.getNode(ISD::FP_EXTEND, MVT::f64, Val);
- DCI.AddToWorklist(Val.Val);
- }
-
- Val = DAG.getNode(PPCISD::FCTIDZ, MVT::f64, Val);
- DCI.AddToWorklist(Val.Val);
- Val = DAG.getNode(PPCISD::FCFID, MVT::f64, Val);
- DCI.AddToWorklist(Val.Val);
- if (N->getValueType(0) == MVT::f32) {
- Val = DAG.getNode(ISD::FP_ROUND, MVT::f32, Val,
- DAG.getIntPtrConstant(0));
- DCI.AddToWorklist(Val.Val);
- }
- return Val;
- } else if (N->getOperand(0).getValueType() == MVT::i32) {
- // If the intermediate type is i32, we can avoid the load/store here
- // too.
- }
- }
- }
- break;
- case ISD::STORE:
- // Turn STORE (FP_TO_SINT F) -> STFIWX(FCTIWZ(F)).
- if (TM.getSubtarget<PPCSubtarget>().hasSTFIWX() &&
- !cast<StoreSDNode>(N)->isTruncatingStore() &&
- N->getOperand(1).getOpcode() == ISD::FP_TO_SINT &&
- N->getOperand(1).getValueType() == MVT::i32 &&
- N->getOperand(1).getOperand(0).getValueType() != MVT::ppcf128) {
- SDOperand Val = N->getOperand(1).getOperand(0);
- if (Val.getValueType() == MVT::f32) {
- Val = DAG.getNode(ISD::FP_EXTEND, MVT::f64, Val);
- DCI.AddToWorklist(Val.Val);
- }
- Val = DAG.getNode(PPCISD::FCTIWZ, MVT::f64, Val);
- DCI.AddToWorklist(Val.Val);
-
- Val = DAG.getNode(PPCISD::STFIWX, MVT::Other, N->getOperand(0), Val,
- N->getOperand(2), N->getOperand(3));
- DCI.AddToWorklist(Val.Val);
- return Val;
- }
-
- // Turn STORE (BSWAP) -> sthbrx/stwbrx.
- if (N->getOperand(1).getOpcode() == ISD::BSWAP &&
- N->getOperand(1).Val->hasOneUse() &&
- (N->getOperand(1).getValueType() == MVT::i32 ||
- N->getOperand(1).getValueType() == MVT::i16)) {
- SDOperand BSwapOp = N->getOperand(1).getOperand(0);
- // Do an any-extend to 32-bits if this is a half-word input.
- if (BSwapOp.getValueType() == MVT::i16)
- BSwapOp = DAG.getNode(ISD::ANY_EXTEND, MVT::i32, BSwapOp);
-
- return DAG.getNode(PPCISD::STBRX, MVT::Other, N->getOperand(0), BSwapOp,
- N->getOperand(2), N->getOperand(3),
- DAG.getValueType(N->getOperand(1).getValueType()));
- }
- break;
- case ISD::BSWAP:
- // Turn BSWAP (LOAD) -> lhbrx/lwbrx.
- if (ISD::isNON_EXTLoad(N->getOperand(0).Val) &&
- N->getOperand(0).hasOneUse() &&
- (N->getValueType(0) == MVT::i32 || N->getValueType(0) == MVT::i16)) {
- SDOperand Load = N->getOperand(0);
- LoadSDNode *LD = cast<LoadSDNode>(Load);
- // Create the byte-swapping load.
- std::vector<MVT::ValueType> VTs;
- VTs.push_back(MVT::i32);
- VTs.push_back(MVT::Other);
- SDOperand MO = DAG.getMemOperand(LD->getMemOperand());
- SDOperand Ops[] = {
- LD->getChain(), // Chain
- LD->getBasePtr(), // Ptr
- MO, // MemOperand
- DAG.getValueType(N->getValueType(0)) // VT
- };
- SDOperand BSLoad = DAG.getNode(PPCISD::LBRX, VTs, Ops, 4);
-
- // If this is an i16 load, insert the truncate.
- SDOperand ResVal = BSLoad;
- if (N->getValueType(0) == MVT::i16)
- ResVal = DAG.getNode(ISD::TRUNCATE, MVT::i16, BSLoad);
-
- // First, combine the bswap away. This makes the value produced by the
- // load dead.
- DCI.CombineTo(N, ResVal);
-
- // Next, combine the load away, we give it a bogus result value but a real
- // chain result. The result value is dead because the bswap is dead.
- DCI.CombineTo(Load.Val, ResVal, BSLoad.getValue(1));
-
- // Return N so it doesn't get rechecked!
- return SDOperand(N, 0);
- }
-
- break;
- case PPCISD::VCMP: {
- // If a VCMPo node already exists with exactly the same operands as this
- // node, use its result instead of this node (VCMPo computes both a CR6 and
- // a normal output).
- //
- if (!N->getOperand(0).hasOneUse() &&
- !N->getOperand(1).hasOneUse() &&
- !N->getOperand(2).hasOneUse()) {
-
- // Scan all of the users of the LHS, looking for VCMPo's that match.
- SDNode *VCMPoNode = 0;
-
- SDNode *LHSN = N->getOperand(0).Val;
- for (SDNode::use_iterator UI = LHSN->use_begin(), E = LHSN->use_end();
- UI != E; ++UI)
- if ((*UI).getUser()->getOpcode() == PPCISD::VCMPo &&
- (*UI).getUser()->getOperand(1) == N->getOperand(1) &&
- (*UI).getUser()->getOperand(2) == N->getOperand(2) &&
- (*UI).getUser()->getOperand(0) == N->getOperand(0)) {
- VCMPoNode = UI->getUser();
- break;
- }
-
- // If there is no VCMPo node, or if the flag value has a single use, don't
- // transform this.
- if (!VCMPoNode || VCMPoNode->hasNUsesOfValue(0, 1))
- break;
-
- // Look at the (necessarily single) use of the flag value. If it has a
- // chain, this transformation is more complex. Note that multiple things
- // could use the value result, which we should ignore.
- SDNode *FlagUser = 0;
- for (SDNode::use_iterator UI = VCMPoNode->use_begin();
- FlagUser == 0; ++UI) {
- assert(UI != VCMPoNode->use_end() && "Didn't find user!");
- SDNode *User = UI->getUser();
- for (unsigned i = 0, e = User->getNumOperands(); i != e; ++i) {
- if (User->getOperand(i) == SDOperand(VCMPoNode, 1)) {
- FlagUser = User;
- break;
- }
- }
- }
-
- // If the user is a MFCR instruction, we know this is safe. Otherwise we
- // give up for right now.
- if (FlagUser->getOpcode() == PPCISD::MFCR)
- return SDOperand(VCMPoNode, 0);
- }
- break;
- }
- case ISD::BR_CC: {
- // If this is a branch on an altivec predicate comparison, lower this so
- // that we don't have to do a MFCR: instead, branch directly on CR6. This
- // lowering is done pre-legalize, because the legalizer lowers the predicate
- // compare down to code that is difficult to reassemble.
- ISD::CondCode CC = cast<CondCodeSDNode>(N->getOperand(1))->get();
- SDOperand LHS = N->getOperand(2), RHS = N->getOperand(3);
- int CompareOpc;
- bool isDot;
-
- if (LHS.getOpcode() == ISD::INTRINSIC_WO_CHAIN &&
- isa<ConstantSDNode>(RHS) && (CC == ISD::SETEQ || CC == ISD::SETNE) &&
- getAltivecCompareInfo(LHS, CompareOpc, isDot)) {
- assert(isDot && "Can't compare against a vector result!");
-
- // If this is a comparison against something other than 0/1, then we know
- // that the condition is never/always true.
- unsigned Val = cast<ConstantSDNode>(RHS)->getValue();
- if (Val != 0 && Val != 1) {
- if (CC == ISD::SETEQ) // Cond never true, remove branch.
- return N->getOperand(0);
- // Always !=, turn it into an unconditional branch.
- return DAG.getNode(ISD::BR, MVT::Other,
- N->getOperand(0), N->getOperand(4));
- }
-
- bool BranchOnWhenPredTrue = (CC == ISD::SETEQ) ^ (Val == 0);
-
- // Create the PPCISD altivec 'dot' comparison node.
- std::vector<MVT::ValueType> VTs;
- SDOperand Ops[] = {
- LHS.getOperand(2), // LHS of compare
- LHS.getOperand(3), // RHS of compare
- DAG.getConstant(CompareOpc, MVT::i32)
- };
- VTs.push_back(LHS.getOperand(2).getValueType());
- VTs.push_back(MVT::Flag);
- SDOperand CompNode = DAG.getNode(PPCISD::VCMPo, VTs, Ops, 3);
-
- // Unpack the result based on how the target uses it.
- PPC::Predicate CompOpc;
- switch (cast<ConstantSDNode>(LHS.getOperand(1))->getValue()) {
- default: // Can't happen, don't crash on invalid number though.
- case 0: // Branch on the value of the EQ bit of CR6.
- CompOpc = BranchOnWhenPredTrue ? PPC::PRED_EQ : PPC::PRED_NE;
- break;
- case 1: // Branch on the inverted value of the EQ bit of CR6.
- CompOpc = BranchOnWhenPredTrue ? PPC::PRED_NE : PPC::PRED_EQ;
- break;
- case 2: // Branch on the value of the LT bit of CR6.
- CompOpc = BranchOnWhenPredTrue ? PPC::PRED_LT : PPC::PRED_GE;
- break;
- case 3: // Branch on the inverted value of the LT bit of CR6.
- CompOpc = BranchOnWhenPredTrue ? PPC::PRED_GE : PPC::PRED_LT;
- break;
- }
-
- return DAG.getNode(PPCISD::COND_BRANCH, MVT::Other, N->getOperand(0),
- DAG.getConstant(CompOpc, MVT::i32),
- DAG.getRegister(PPC::CR6, MVT::i32),
- N->getOperand(4), CompNode.getValue(1));
- }
- break;
- }
- }
-
- return SDOperand();
-}
-
-//===----------------------------------------------------------------------===//
-// Inline Assembly Support
-//===----------------------------------------------------------------------===//
-
-void PPCTargetLowering::computeMaskedBitsForTargetNode(const SDOperand Op,
- const APInt &Mask,
- APInt &KnownZero,
- APInt &KnownOne,
- const SelectionDAG &DAG,
- unsigned Depth) const {
- KnownZero = KnownOne = APInt(Mask.getBitWidth(), 0);
- switch (Op.getOpcode()) {
- default: break;
- case PPCISD::LBRX: {
- // lhbrx is known to have the top bits cleared out.
- if (cast<VTSDNode>(Op.getOperand(3))->getVT() == MVT::i16)
- KnownZero = 0xFFFF0000;
- break;
- }
- case ISD::INTRINSIC_WO_CHAIN: {
- switch (cast<ConstantSDNode>(Op.getOperand(0))->getValue()) {
- default: break;
- case Intrinsic::ppc_altivec_vcmpbfp_p:
- case Intrinsic::ppc_altivec_vcmpeqfp_p:
- case Intrinsic::ppc_altivec_vcmpequb_p:
- case Intrinsic::ppc_altivec_vcmpequh_p:
- case Intrinsic::ppc_altivec_vcmpequw_p:
- case Intrinsic::ppc_altivec_vcmpgefp_p:
- case Intrinsic::ppc_altivec_vcmpgtfp_p:
- case Intrinsic::ppc_altivec_vcmpgtsb_p:
- case Intrinsic::ppc_altivec_vcmpgtsh_p:
- case Intrinsic::ppc_altivec_vcmpgtsw_p:
- case Intrinsic::ppc_altivec_vcmpgtub_p:
- case Intrinsic::ppc_altivec_vcmpgtuh_p:
- case Intrinsic::ppc_altivec_vcmpgtuw_p:
- KnownZero = ~1U; // All bits but the low one are known to be zero.
- break;
- }
- }
- }
-}
-
-
-/// getConstraintType - Given a constraint, return the type of
-/// constraint it is for this target.
-PPCTargetLowering::ConstraintType
-PPCTargetLowering::getConstraintType(const std::string &Constraint) const {
- if (Constraint.size() == 1) {
- switch (Constraint[0]) {
- default: break;
- case 'b':
- case 'r':
- case 'f':
- case 'v':
- case 'y':
- return C_RegisterClass;
- }
- }
- return TargetLowering::getConstraintType(Constraint);
-}
-
-std::pair<unsigned, const TargetRegisterClass*>
-PPCTargetLowering::getRegForInlineAsmConstraint(const std::string &Constraint,
- MVT::ValueType VT) const {
- if (Constraint.size() == 1) {
- // GCC RS6000 Constraint Letters
- switch (Constraint[0]) {
- case 'b': // R1-R31
- case 'r': // R0-R31
- if (VT == MVT::i64 && PPCSubTarget.isPPC64())
- return std::make_pair(0U, PPC::G8RCRegisterClass);
- return std::make_pair(0U, PPC::GPRCRegisterClass);
- case 'f':
- if (VT == MVT::f32)
- return std::make_pair(0U, PPC::F4RCRegisterClass);
- else if (VT == MVT::f64)
- return std::make_pair(0U, PPC::F8RCRegisterClass);
- break;
- case 'v':
- return std::make_pair(0U, PPC::VRRCRegisterClass);
- case 'y': // crrc
- return std::make_pair(0U, PPC::CRRCRegisterClass);
- }
- }
-
- return TargetLowering::getRegForInlineAsmConstraint(Constraint, VT);
-}
-
-
-/// LowerAsmOperandForConstraint - Lower the specified operand into the Ops
-/// vector. If it is invalid, don't add anything to Ops.
-void PPCTargetLowering::LowerAsmOperandForConstraint(SDOperand Op, char Letter,
- std::vector<SDOperand>&Ops,
- SelectionDAG &DAG) const {
- SDOperand Result(0,0);
- switch (Letter) {
- default: break;
- case 'I':
- case 'J':
- case 'K':
- case 'L':
- case 'M':
- case 'N':
- case 'O':
- case 'P': {
- ConstantSDNode *CST = dyn_cast<ConstantSDNode>(Op);
- if (!CST) return; // Must be an immediate to match.
- unsigned Value = CST->getValue();
- switch (Letter) {
- default: assert(0 && "Unknown constraint letter!");
- case 'I': // "I" is a signed 16-bit constant.
- if ((short)Value == (int)Value)
- Result = DAG.getTargetConstant(Value, Op.getValueType());
- break;
- case 'J': // "J" is a constant with only the high-order 16 bits nonzero.
- case 'L': // "L" is a signed 16-bit constant shifted left 16 bits.
- if ((short)Value == 0)
- Result = DAG.getTargetConstant(Value, Op.getValueType());
- break;
- case 'K': // "K" is a constant with only the low-order 16 bits nonzero.
- if ((Value >> 16) == 0)
- Result = DAG.getTargetConstant(Value, Op.getValueType());
- break;
- case 'M': // "M" is a constant that is greater than 31.
- if (Value > 31)
- Result = DAG.getTargetConstant(Value, Op.getValueType());
- break;
- case 'N': // "N" is a positive constant that is an exact power of two.
- if ((int)Value > 0 && isPowerOf2_32(Value))
- Result = DAG.getTargetConstant(Value, Op.getValueType());
- break;
- case 'O': // "O" is the constant zero.
- if (Value == 0)
- Result = DAG.getTargetConstant(Value, Op.getValueType());
- break;
- case 'P': // "P" is a constant whose negation is a signed 16-bit constant.
- if ((short)-Value == (int)-Value)
- Result = DAG.getTargetConstant(Value, Op.getValueType());
- break;
- }
- break;
- }
- }
-
- if (Result.Val) {
- Ops.push_back(Result);
- return;
- }
-
- // Handle standard constraint letters.
- TargetLowering::LowerAsmOperandForConstraint(Op, Letter, Ops, DAG);
-}
-
-// isLegalAddressingMode - Return true if the addressing mode represented
-// by AM is legal for this target, for a load/store of the specified type.
-bool PPCTargetLowering::isLegalAddressingMode(const AddrMode &AM,
- const Type *Ty) const {
- // FIXME: PPC does not allow r+i addressing modes for vectors!
-
- // PPC allows a sign-extended 16-bit immediate field.
- if (AM.BaseOffs <= -(1LL << 16) || AM.BaseOffs >= (1LL << 16)-1)
- return false;
-
- // No global is ever allowed as a base.
- if (AM.BaseGV)
- return false;
-
- // PPC only support r+r,
- switch (AM.Scale) {
- case 0: // "r+i" or just "i", depending on HasBaseReg.
- break;
- case 1:
- if (AM.HasBaseReg && AM.BaseOffs) // "r+r+i" is not allowed.
- return false;
- // Otherwise we have r+r or r+i.
- break;
- case 2:
- if (AM.HasBaseReg || AM.BaseOffs) // 2*r+r or 2*r+i is not allowed.
- return false;
- // Allow 2*r as r+r.
- break;
- default:
- // No other scales are supported.
- return false;
- }
-
- return true;
-}
-
-/// isLegalAddressImmediate - Return true if the integer value can be used
-/// as the offset of the target addressing mode for load / store of the
-/// given type.
-bool PPCTargetLowering::isLegalAddressImmediate(int64_t V,const Type *Ty) const{
- // PPC allows a sign-extended 16-bit immediate field.
- return (V > -(1 << 16) && V < (1 << 16)-1);
-}
-
-bool PPCTargetLowering::isLegalAddressImmediate(llvm::GlobalValue* GV) const {
- return false;
-}
-
-SDOperand PPCTargetLowering::LowerRETURNADDR(SDOperand Op, SelectionDAG &DAG) {
- // Depths > 0 not supported yet!
- if (cast<ConstantSDNode>(Op.getOperand(0))->getValue() > 0)
- return SDOperand();
-
- MachineFunction &MF = DAG.getMachineFunction();
- PPCFunctionInfo *FuncInfo = MF.getInfo<PPCFunctionInfo>();
-
- // Just load the return address off the stack.
- SDOperand RetAddrFI = getReturnAddrFrameIndex(DAG);
-
- // Make sure the function really does not optimize away the store of the RA
- // to the stack.
- FuncInfo->setLRStoreRequired();
- return DAG.getLoad(getPointerTy(), DAG.getEntryNode(), RetAddrFI, NULL, 0);
-}
-
-SDOperand PPCTargetLowering::LowerFRAMEADDR(SDOperand Op, SelectionDAG &DAG) {
- // Depths > 0 not supported yet!
- if (cast<ConstantSDNode>(Op.getOperand(0))->getValue() > 0)
- return SDOperand();
-
- MVT::ValueType PtrVT = DAG.getTargetLoweringInfo().getPointerTy();
- bool isPPC64 = PtrVT == MVT::i64;
-
- MachineFunction &MF = DAG.getMachineFunction();
- MachineFrameInfo *MFI = MF.getFrameInfo();
- bool is31 = (NoFramePointerElim || MFI->hasVarSizedObjects())
- && MFI->getStackSize();
-
- if (isPPC64)
- return DAG.getCopyFromReg(DAG.getEntryNode(), is31 ? PPC::X31 : PPC::X1,
- MVT::i64);
- else
- return DAG.getCopyFromReg(DAG.getEntryNode(), is31 ? PPC::R31 : PPC::R1,
- MVT::i32);
-}
diff --git a/release_23/lib/Target/PowerPC/PPCISelLowering.h b/release_23/lib/Target/PowerPC/PPCISelLowering.h
deleted file mode 100644
index d28799ad582e..000000000000
--- a/release_23/lib/Target/PowerPC/PPCISelLowering.h
+++ /dev/null
@@ -1,387 +0,0 @@
-//===-- PPCISelLowering.h - PPC32 DAG Lowering Interface --------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines the interfaces that PPC uses to lower LLVM code into a
-// selection DAG.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_TARGET_POWERPC_PPC32ISELLOWERING_H
-#define LLVM_TARGET_POWERPC_PPC32ISELLOWERING_H
-
-#include "llvm/Target/TargetLowering.h"
-#include "llvm/CodeGen/SelectionDAG.h"
-#include "PPC.h"
-#include "PPCSubtarget.h"
-
-namespace llvm {
- namespace PPCISD {
- enum NodeType {
- // Start the numbering where the builtin ops and target ops leave off.
- FIRST_NUMBER = ISD::BUILTIN_OP_END+PPC::INSTRUCTION_LIST_END,
-
- /// FSEL - Traditional three-operand fsel node.
- ///
- FSEL,
-
- /// FCFID - The FCFID instruction, taking an f64 operand and producing
- /// and f64 value containing the FP representation of the integer that
- /// was temporarily in the f64 operand.
- FCFID,
-
- /// FCTI[D,W]Z - The FCTIDZ and FCTIWZ instructions, taking an f32 or f64
- /// operand, producing an f64 value containing the integer representation
- /// of that FP value.
- FCTIDZ, FCTIWZ,
-
- /// STFIWX - The STFIWX instruction. The first operand is an input token
- /// chain, then an f64 value to store, then an address to store it to,
- /// then a SRCVALUE for the address.
- STFIWX,
-
- // VMADDFP, VNMSUBFP - The VMADDFP and VNMSUBFP instructions, taking
- // three v4f32 operands and producing a v4f32 result.
- VMADDFP, VNMSUBFP,
-
- /// VPERM - The PPC VPERM Instruction.
- ///
- VPERM,
-
- /// Hi/Lo - These represent the high and low 16-bit parts of a global
- /// address respectively. These nodes have two operands, the first of
- /// which must be a TargetGlobalAddress, and the second of which must be a
- /// Constant. Selected naively, these turn into 'lis G+C' and 'li G+C',
- /// though these are usually folded into other nodes.
- Hi, Lo,
-
- /// OPRC, CHAIN = DYNALLOC(CHAIN, NEGSIZE, FRAME_INDEX)
- /// This instruction is lowered in PPCRegisterInfo::eliminateFrameIndex to
- /// compute an allocation on the stack.
- DYNALLOC,
-
- /// GlobalBaseReg - On Darwin, this node represents the result of the mflr
- /// at function entry, used for PIC code.
- GlobalBaseReg,
-
- /// These nodes represent the 32-bit PPC shifts that operate on 6-bit
- /// shift amounts. These nodes are generated by the multi-precision shift
- /// code.
- SRL, SRA, SHL,
-
- /// EXTSW_32 - This is the EXTSW instruction for use with "32-bit"
- /// registers.
- EXTSW_32,
-
- /// STD_32 - This is the STD instruction for use with "32-bit" registers.
- STD_32,
-
- /// CALL - A direct function call.
- CALL_Macho, CALL_ELF,
-
- /// CHAIN,FLAG = MTCTR(VAL, CHAIN[, INFLAG]) - Directly corresponds to a
- /// MTCTR instruction.
- MTCTR,
-
- /// CHAIN,FLAG = BCTRL(CHAIN, INFLAG) - Directly corresponds to a
- /// BCTRL instruction.
- BCTRL_Macho, BCTRL_ELF,
-
- /// Return with a flag operand, matched by 'blr'
- RET_FLAG,
-
- /// R32 = MFCR(CRREG, INFLAG) - Represents the MFCR/MFOCRF instructions.
- /// This copies the bits corresponding to the specified CRREG into the
- /// resultant GPR. Bits corresponding to other CR regs are undefined.
- MFCR,
-
- /// RESVEC = VCMP(LHS, RHS, OPC) - Represents one of the altivec VCMP*
- /// instructions. For lack of better number, we use the opcode number
- /// encoding for the OPC field to identify the compare. For example, 838
- /// is VCMPGTSH.
- VCMP,
-
- /// RESVEC, OUTFLAG = VCMPo(LHS, RHS, OPC) - Represents one of the
- /// altivec VCMP*o instructions. For lack of better number, we use the
- /// opcode number encoding for the OPC field to identify the compare. For
- /// example, 838 is VCMPGTSH.
- VCMPo,
-
- /// CHAIN = COND_BRANCH CHAIN, CRRC, OPC, DESTBB [, INFLAG] - This
- /// corresponds to the COND_BRANCH pseudo instruction. CRRC is the
- /// condition register to branch on, OPC is the branch opcode to use (e.g.
- /// PPC::BLE), DESTBB is the destination block to branch to, and INFLAG is
- /// an optional input flag argument.
- COND_BRANCH,
-
- /// CHAIN = STBRX CHAIN, GPRC, Ptr, SRCVALUE, Type - This is a
- /// byte-swapping store instruction. It byte-swaps the low "Type" bits of
- /// the GPRC input, then stores it through Ptr. Type can be either i16 or
- /// i32.
- STBRX,
-
- /// GPRC, CHAIN = LBRX CHAIN, Ptr, SRCVALUE, Type - This is a
- /// byte-swapping load instruction. It loads "Type" bits, byte swaps it,
- /// then puts it in the bottom bits of the GPRC. TYPE can be either i16
- /// or i32.
- LBRX,
-
- // The following 5 instructions are used only as part of the
- // long double-to-int conversion sequence.
-
- /// OUTFLAG = MFFS F8RC - This moves the FPSCR (not modelled) into the
- /// register.
- MFFS,
-
- /// OUTFLAG = MTFSB0 INFLAG - This clears a bit in the FPSCR.
- MTFSB0,
-
- /// OUTFLAG = MTFSB1 INFLAG - This sets a bit in the FPSCR.
- MTFSB1,
-
- /// F8RC, OUTFLAG = FADDRTZ F8RC, F8RC, INFLAG - This is an FADD done with
- /// rounding towards zero. It has flags added so it won't move past the
- /// FPSCR-setting instructions.
- FADDRTZ,
-
- /// MTFSF = F8RC, INFLAG - This moves the register into the FPSCR.
- MTFSF,
-
- /// LARX = This corresponds to PPC l{w|d}arx instrcution: load and
- /// reserve indexed. This is used to implement atomic operations.
- LARX,
-
- /// STCX = This corresponds to PPC stcx. instrcution: store conditional
- /// indexed. This is used to implement atomic operations.
- STCX,
-
- /// CMP_UNRESERVE = Test for equality and "unreserve" if not true. This
- /// is used to implement atomic operations.
- CMP_UNRESERVE,
-
- /// TAILCALL - Indicates a tail call should be taken.
- TAILCALL,
- /// TC_RETURN - A tail call return.
- /// operand #0 chain
- /// operand #1 callee (register or absolute)
- /// operand #2 stack adjustment
- /// operand #3 optional in flag
- TC_RETURN
- };
- }
-
- /// Define some predicates that are used for node matching.
- namespace PPC {
- /// isVPKUHUMShuffleMask - Return true if this is the shuffle mask for a
- /// VPKUHUM instruction.
- bool isVPKUHUMShuffleMask(SDNode *N, bool isUnary);
-
- /// isVPKUWUMShuffleMask - Return true if this is the shuffle mask for a
- /// VPKUWUM instruction.
- bool isVPKUWUMShuffleMask(SDNode *N, bool isUnary);
-
- /// isVMRGLShuffleMask - Return true if this is a shuffle mask suitable for
- /// a VRGL* instruction with the specified unit size (1,2 or 4 bytes).
- bool isVMRGLShuffleMask(SDNode *N, unsigned UnitSize, bool isUnary);
-
- /// isVMRGHShuffleMask - Return true if this is a shuffle mask suitable for
- /// a VRGH* instruction with the specified unit size (1,2 or 4 bytes).
- bool isVMRGHShuffleMask(SDNode *N, unsigned UnitSize, bool isUnary);
-
- /// isVSLDOIShuffleMask - If this is a vsldoi shuffle mask, return the shift
- /// amount, otherwise return -1.
- int isVSLDOIShuffleMask(SDNode *N, bool isUnary);
-
- /// isSplatShuffleMask - Return true if the specified VECTOR_SHUFFLE operand
- /// specifies a splat of a single element that is suitable for input to
- /// VSPLTB/VSPLTH/VSPLTW.
- bool isSplatShuffleMask(SDNode *N, unsigned EltSize);
-
- /// isAllNegativeZeroVector - Returns true if all elements of build_vector
- /// are -0.0.
- bool isAllNegativeZeroVector(SDNode *N);
-
- /// getVSPLTImmediate - Return the appropriate VSPLT* immediate to splat the
- /// specified isSplatShuffleMask VECTOR_SHUFFLE mask.
- unsigned getVSPLTImmediate(SDNode *N, unsigned EltSize);
-
- /// get_VSPLTI_elt - If this is a build_vector of constants which can be
- /// formed by using a vspltis[bhw] instruction of the specified element
- /// size, return the constant being splatted. The ByteSize field indicates
- /// the number of bytes of each element [124] -> [bhw].
- SDOperand get_VSPLTI_elt(SDNode *N, unsigned ByteSize, SelectionDAG &DAG);
- }
-
- class PPCTargetLowering : public TargetLowering {
- int VarArgsFrameIndex; // FrameIndex for start of varargs area.
- int VarArgsStackOffset; // StackOffset for start of stack
- // arguments.
- unsigned VarArgsNumGPR; // Index of the first unused integer
- // register for parameter passing.
- unsigned VarArgsNumFPR; // Index of the first unused double
- // register for parameter passing.
- int ReturnAddrIndex; // FrameIndex for return slot.
- const PPCSubtarget &PPCSubTarget;
- public:
- explicit PPCTargetLowering(PPCTargetMachine &TM);
-
- /// getTargetNodeName() - This method returns the name of a target specific
- /// DAG node.
- virtual const char *getTargetNodeName(unsigned Opcode) const;
-
- /// getSetCCResultType - Return the ISD::SETCC ValueType
- virtual MVT::ValueType getSetCCResultType(const SDOperand &) const;
-
- /// getPreIndexedAddressParts - returns true by value, base pointer and
- /// offset pointer and addressing mode by reference if the node's address
- /// can be legally represented as pre-indexed load / store address.
- virtual bool getPreIndexedAddressParts(SDNode *N, SDOperand &Base,
- SDOperand &Offset,
- ISD::MemIndexedMode &AM,
- SelectionDAG &DAG);
-
- /// SelectAddressRegReg - Given the specified addressed, check to see if it
- /// can be represented as an indexed [r+r] operation. Returns false if it
- /// can be more efficiently represented with [r+imm].
- bool SelectAddressRegReg(SDOperand N, SDOperand &Base, SDOperand &Index,
- SelectionDAG &DAG);
-
- /// SelectAddressRegImm - Returns true if the address N can be represented
- /// by a base register plus a signed 16-bit displacement [r+imm], and if it
- /// is not better represented as reg+reg.
- bool SelectAddressRegImm(SDOperand N, SDOperand &Disp, SDOperand &Base,
- SelectionDAG &DAG);
-
- /// SelectAddressRegRegOnly - Given the specified addressed, force it to be
- /// represented as an indexed [r+r] operation.
- bool SelectAddressRegRegOnly(SDOperand N, SDOperand &Base, SDOperand &Index,
- SelectionDAG &DAG);
-
- /// SelectAddressRegImmShift - Returns true if the address N can be
- /// represented by a base register plus a signed 14-bit displacement
- /// [r+imm*4]. Suitable for use by STD and friends.
- bool SelectAddressRegImmShift(SDOperand N, SDOperand &Disp, SDOperand &Base,
- SelectionDAG &DAG);
-
-
- /// LowerOperation - Provide custom lowering hooks for some operations.
- ///
- virtual SDOperand LowerOperation(SDOperand Op, SelectionDAG &DAG);
-
- virtual SDNode *ExpandOperationResult(SDNode *N, SelectionDAG &DAG);
-
- virtual SDOperand PerformDAGCombine(SDNode *N, DAGCombinerInfo &DCI) const;
-
- virtual void computeMaskedBitsForTargetNode(const SDOperand Op,
- const APInt &Mask,
- APInt &KnownZero,
- APInt &KnownOne,
- const SelectionDAG &DAG,
- unsigned Depth = 0) const;
-
- virtual MachineBasicBlock *EmitInstrWithCustomInserter(MachineInstr *MI,
- MachineBasicBlock *MBB);
-
- ConstraintType getConstraintType(const std::string &Constraint) const;
- std::pair<unsigned, const TargetRegisterClass*>
- getRegForInlineAsmConstraint(const std::string &Constraint,
- MVT::ValueType VT) const;
-
- /// getByValTypeAlignment - Return the desired alignment for ByVal aggregate
- /// function arguments in the caller parameter area. This is the actual
- /// alignment, not its logarithm.
- unsigned getByValTypeAlignment(const Type *Ty) const;
-
- /// LowerAsmOperandForConstraint - Lower the specified operand into the Ops
- /// vector. If it is invalid, don't add anything to Ops.
- virtual void LowerAsmOperandForConstraint(SDOperand Op,
- char ConstraintLetter,
- std::vector<SDOperand> &Ops,
- SelectionDAG &DAG) const;
-
- /// isLegalAddressingMode - Return true if the addressing mode represented
- /// by AM is legal for this target, for a load/store of the specified type.
- virtual bool isLegalAddressingMode(const AddrMode &AM, const Type *Ty)const;
-
- /// isLegalAddressImmediate - Return true if the integer value can be used
- /// as the offset of the target addressing mode for load / store of the
- /// given type.
- virtual bool isLegalAddressImmediate(int64_t V, const Type *Ty) const;
-
- /// isLegalAddressImmediate - Return true if the GlobalValue can be used as
- /// the offset of the target addressing mode.
- virtual bool isLegalAddressImmediate(GlobalValue *GV) const;
-
- /// IsEligibleForTailCallOptimization - Check whether the call is eligible
- /// for tail call optimization. Target which want to do tail call
- /// optimization should implement this function.
- virtual bool IsEligibleForTailCallOptimization(SDOperand Call,
- SDOperand Ret,
- SelectionDAG &DAG) const;
-
- private:
- /// PPCAtomicLabelIndex - Keep track the number of PPC atomic labels.
- ///
- unsigned PPCAtomicLabelIndex;
-
- SDOperand getFramePointerFrameIndex(SelectionDAG & DAG) const;
- SDOperand getReturnAddrFrameIndex(SelectionDAG & DAG) const;
-
- SDOperand EmitTailCallLoadFPAndRetAddr(SelectionDAG & DAG,
- int SPDiff,
- SDOperand Chain,
- SDOperand &LROpOut,
- SDOperand &FPOpOut);
-
- SDOperand LowerRETURNADDR(SDOperand Op, SelectionDAG &DAG);
- SDOperand LowerFRAMEADDR(SDOperand Op, SelectionDAG &DAG);
- SDOperand LowerConstantPool(SDOperand Op, SelectionDAG &DAG);
- SDOperand LowerGlobalAddress(SDOperand Op, SelectionDAG &DAG);
- SDOperand LowerGlobalTLSAddress(SDOperand Op, SelectionDAG &DAG);
- SDOperand LowerJumpTable(SDOperand Op, SelectionDAG &DAG);
- SDOperand LowerSETCC(SDOperand Op, SelectionDAG &DAG);
- SDOperand LowerVASTART(SDOperand Op, SelectionDAG &DAG,
- int VarArgsFrameIndex, int VarArgsStackOffset,
- unsigned VarArgsNumGPR, unsigned VarArgsNumFPR,
- const PPCSubtarget &Subtarget);
- SDOperand LowerVAARG(SDOperand Op, SelectionDAG &DAG, int VarArgsFrameIndex,
- int VarArgsStackOffset, unsigned VarArgsNumGPR,
- unsigned VarArgsNumFPR, const PPCSubtarget &Subtarget);
- SDOperand LowerFORMAL_ARGUMENTS(SDOperand Op, SelectionDAG &DAG,
- int &VarArgsFrameIndex,
- int &VarArgsStackOffset,
- unsigned &VarArgsNumGPR,
- unsigned &VarArgsNumFPR,
- const PPCSubtarget &Subtarget);
- SDOperand LowerCALL(SDOperand Op, SelectionDAG &DAG,
- const PPCSubtarget &Subtarget, TargetMachine &TM);
- SDOperand LowerRET(SDOperand Op, SelectionDAG &DAG, TargetMachine &TM);
- SDOperand LowerSTACKRESTORE(SDOperand Op, SelectionDAG &DAG,
- const PPCSubtarget &Subtarget);
- SDOperand LowerDYNAMIC_STACKALLOC(SDOperand Op, SelectionDAG &DAG,
- const PPCSubtarget &Subtarget);
- SDOperand LowerSELECT_CC(SDOperand Op, SelectionDAG &DAG);
- SDOperand LowerAtomicLAS(SDOperand Op, SelectionDAG &DAG);
- SDOperand LowerAtomicLCS(SDOperand Op, SelectionDAG &DAG);
- SDOperand LowerAtomicSWAP(SDOperand Op, SelectionDAG &DAG);
- SDOperand LowerFP_TO_SINT(SDOperand Op, SelectionDAG &DAG);
- SDOperand LowerSINT_TO_FP(SDOperand Op, SelectionDAG &DAG);
- SDOperand LowerFP_ROUND_INREG(SDOperand Op, SelectionDAG &DAG);
- SDOperand LowerFLT_ROUNDS_(SDOperand Op, SelectionDAG &DAG);
- SDOperand LowerSHL_PARTS(SDOperand Op, SelectionDAG &DAG);
- SDOperand LowerSRL_PARTS(SDOperand Op, SelectionDAG &DAG);
- SDOperand LowerSRA_PARTS(SDOperand Op, SelectionDAG &DAG);
- SDOperand LowerBUILD_VECTOR(SDOperand Op, SelectionDAG &DAG);
- SDOperand LowerVECTOR_SHUFFLE(SDOperand Op, SelectionDAG &DAG);
- SDOperand LowerINTRINSIC_WO_CHAIN(SDOperand Op, SelectionDAG &DAG);
- SDOperand LowerSCALAR_TO_VECTOR(SDOperand Op, SelectionDAG &DAG);
- SDOperand LowerMUL(SDOperand Op, SelectionDAG &DAG);
- };
-}
-
-#endif // LLVM_TARGET_POWERPC_PPC32ISELLOWERING_H
diff --git a/release_23/lib/Target/PowerPC/PPCInstr64Bit.td b/release_23/lib/Target/PowerPC/PPCInstr64Bit.td
deleted file mode 100644
index 1c47bfbc29e7..000000000000
--- a/release_23/lib/Target/PowerPC/PPCInstr64Bit.td
+++ /dev/null
@@ -1,673 +0,0 @@
-//===- PPCInstr64Bit.td - The PowerPC 64-bit Support -------*- tablegen -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file describes the PowerPC 64-bit instructions. These patterns are used
-// both when in ppc64 mode and when in "use 64-bit extensions in 32-bit" mode.
-//
-//===----------------------------------------------------------------------===//
-
-//===----------------------------------------------------------------------===//
-// 64-bit operands.
-//
-def s16imm64 : Operand<i64> {
- let PrintMethod = "printS16ImmOperand";
-}
-def u16imm64 : Operand<i64> {
- let PrintMethod = "printU16ImmOperand";
-}
-def symbolHi64 : Operand<i64> {
- let PrintMethod = "printSymbolHi";
-}
-def symbolLo64 : Operand<i64> {
- let PrintMethod = "printSymbolLo";
-}
-
-//===----------------------------------------------------------------------===//
-// 64-bit transformation functions.
-//
-
-def SHL64 : SDNodeXForm<imm, [{
- // Transformation function: 63 - imm
- return getI32Imm(63 - N->getValue());
-}]>;
-
-def SRL64 : SDNodeXForm<imm, [{
- // Transformation function: 64 - imm
- return N->getValue() ? getI32Imm(64 - N->getValue()) : getI32Imm(0);
-}]>;
-
-def HI32_48 : SDNodeXForm<imm, [{
- // Transformation function: shift the immediate value down into the low bits.
- return getI32Imm((unsigned short)(N->getValue() >> 32));
-}]>;
-
-def HI48_64 : SDNodeXForm<imm, [{
- // Transformation function: shift the immediate value down into the low bits.
- return getI32Imm((unsigned short)(N->getValue() >> 48));
-}]>;
-
-
-//===----------------------------------------------------------------------===//
-// Calls.
-//
-
-let Defs = [LR8] in
- def MovePCtoLR8 : Pseudo<(outs), (ins piclabel:$label), "bl $label", []>,
- PPC970_Unit_BRU;
-
-// Macho ABI Calls.
-let isCall = 1, PPC970_Unit = 7,
- // All calls clobber the PPC64 non-callee saved registers.
- Defs = [X0,X2,X3,X4,X5,X6,X7,X8,X9,X10,X11,X12,
- F0,F1,F2,F3,F4,F5,F6,F7,F8,F9,F10,F11,F12,F13,
- V0,V1,V2,V3,V4,V5,V6,V7,V8,V9,V10,V11,V12,V13,V14,V15,V16,V17,V18,V19,
- LR8,CTR8,
- CR0,CR1,CR5,CR6,CR7] in {
- // Convenient aliases for call instructions
- def BL8_Macho : IForm<18, 0, 1,
- (outs), (ins calltarget:$func, variable_ops),
- "bl $func", BrB, []>; // See Pat patterns below.
- def BLA8_Macho : IForm<18, 1, 1,
- (outs), (ins aaddr:$func, variable_ops),
- "bla $func", BrB, [(PPCcall_Macho (i64 imm:$func))]>;
- def BCTRL8_Macho : XLForm_2_ext<19, 528, 20, 0, 1,
- (outs), (ins variable_ops),
- "bctrl", BrB,
- [(PPCbctrl_Macho)]>, Requires<[In64BitMode]>;
-}
-
-// ELF 64 ABI Calls = Macho ABI Calls
-// Used to define BL8_ELF and BLA8_ELF
-let isCall = 1, PPC970_Unit = 7,
- // All calls clobber the PPC64 non-callee saved registers.
- Defs = [X0,X2,X3,X4,X5,X6,X7,X8,X9,X10,X11,X12,
- F0,F1,F2,F3,F4,F5,F6,F7,F8,F9,F10,F11,F12,F13,
- V0,V1,V2,V3,V4,V5,V6,V7,V8,V9,V10,V11,V12,V13,V14,V15,V16,V17,V18,V19,
- LR8,CTR8,
- CR0,CR1,CR5,CR6,CR7] in {
- // Convenient aliases for call instructions
- def BL8_ELF : IForm<18, 0, 1,
- (outs), (ins calltarget:$func, variable_ops),
- "bl $func", BrB, []>; // See Pat patterns below.
- def BLA8_ELF : IForm<18, 1, 1,
- (outs), (ins aaddr:$func, variable_ops),
- "bla $func", BrB, [(PPCcall_ELF (i64 imm:$func))]>;
- def BCTRL8_ELF : XLForm_2_ext<19, 528, 20, 0, 1,
- (outs), (ins variable_ops),
- "bctrl", BrB,
- [(PPCbctrl_ELF)]>, Requires<[In64BitMode]>;
-}
-
-
-// Calls
-def : Pat<(PPCcall_Macho (i64 tglobaladdr:$dst)),
- (BL8_Macho tglobaladdr:$dst)>;
-def : Pat<(PPCcall_Macho (i64 texternalsym:$dst)),
- (BL8_Macho texternalsym:$dst)>;
-
-def : Pat<(PPCcall_ELF (i64 tglobaladdr:$dst)),
- (BL8_ELF tglobaladdr:$dst)>;
-def : Pat<(PPCcall_ELF (i64 texternalsym:$dst)),
- (BL8_ELF texternalsym:$dst)>;
-
-// Atomic operations.
-def LDARX : Pseudo<(outs G8RC:$rD), (ins memrr:$ptr, i32imm:$label),
- "\nLa${label}_entry:\n\tldarx $rD, $ptr",
- [(set G8RC:$rD, (PPClarx xoaddr:$ptr, imm:$label))]>;
-
-let Defs = [CR0] in {
-def STDCX : Pseudo<(outs), (ins G8RC:$rS, memrr:$dst, i32imm:$label),
- "stdcx. $rS, $dst\n\tbne- La${label}_entry\nLa${label}_exit:",
- [(PPCstcx G8RC:$rS, xoaddr:$dst, imm:$label)]>;
-
-def CMP_UNRESd : Pseudo<(outs), (ins G8RC:$rA, G8RC:$rB, i32imm:$label),
- "cmpd $rA, $rB\n\tbne- La${label}_exit",
- [(PPCcmp_unres G8RC:$rA, G8RC:$rB, imm:$label)]>;
-def CMP_UNRESdi : Pseudo<(outs), (ins G8RC:$rA, s16imm64:$imm, i32imm:$label),
- "cmpdi $rA, $imm\n\tbne- La${label}_exit",
- [(PPCcmp_unres G8RC:$rA, immSExt16:$imm, imm:$label)]>;
-}
-
-let isCall = 1, isTerminator = 1, isReturn = 1, isBarrier = 1 in
-def TCRETURNdi8 :Pseudo< (outs),
- (ins calltarget:$dst, i32imm:$offset, variable_ops),
- "#TC_RETURNd8 $dst $offset",
- []>;
-
-let isCall = 1, isTerminator = 1, isReturn = 1, isBarrier = 1 in
-def TCRETURNai8 :Pseudo<(outs), (ins aaddr:$func, i32imm:$offset, variable_ops),
- "#TC_RETURNa8 $func $offset",
- [(PPCtc_return (i64 imm:$func), imm:$offset)]>;
-
-let isCall = 1, isTerminator = 1, isReturn = 1, isBarrier = 1 in
-def TCRETURNri8 : Pseudo<(outs), (ins CTRRC8:$dst, i32imm:$offset, variable_ops),
- "#TC_RETURNr8 $dst $offset",
- []>;
-
-
-let isTerminator = 1, isBarrier = 1, PPC970_Unit = 7, isBranch = 1,
- isIndirectBranch = 1, isCall = 1, isReturn = 1 in
-def TAILBCTR8 : XLForm_2_ext<19, 528, 20, 0, 0, (outs), (ins), "bctr", BrB, []>,
- Requires<[In64BitMode]>;
-
-
-
-let isBranch = 1, isTerminator = 1, hasCtrlDep = 1, PPC970_Unit = 7,
- isBarrier = 1, isCall = 1, isReturn = 1 in
-def TAILB8 : IForm<18, 0, 0, (outs), (ins calltarget:$dst),
- "b $dst", BrB,
- []>;
-
-
-let isBranch = 1, isTerminator = 1, hasCtrlDep = 1, PPC970_Unit = 7,
- isBarrier = 1, isCall = 1, isReturn = 1 in
-def TAILBA8 : IForm<18, 0, 0, (outs), (ins aaddr:$dst),
- "ba $dst", BrB,
- []>;
-
-def : Pat<(PPCtc_return (i64 tglobaladdr:$dst), imm:$imm),
- (TCRETURNdi8 tglobaladdr:$dst, imm:$imm)>;
-
-def : Pat<(PPCtc_return (i64 texternalsym:$dst), imm:$imm),
- (TCRETURNdi8 texternalsym:$dst, imm:$imm)>;
-
-def : Pat<(PPCtc_return CTRRC8:$dst, imm:$imm),
- (TCRETURNri8 CTRRC8:$dst, imm:$imm)>;
-
-
-//===----------------------------------------------------------------------===//
-// 64-bit SPR manipulation instrs.
-
-def MFCTR8 : XFXForm_1_ext<31, 339, 9, (outs G8RC:$rT), (ins),
- "mfctr $rT", SprMFSPR>,
- PPC970_DGroup_First, PPC970_Unit_FXU;
-let Pattern = [(PPCmtctr G8RC:$rS)] in {
-def MTCTR8 : XFXForm_7_ext<31, 467, 9, (outs), (ins G8RC:$rS),
- "mtctr $rS", SprMTSPR>,
- PPC970_DGroup_First, PPC970_Unit_FXU;
-}
-
-let Defs = [X1], Uses = [X1] in
-def DYNALLOC8 : Pseudo<(outs G8RC:$result), (ins G8RC:$negsize, memri:$fpsi),
- "${:comment} DYNALLOC8 $result, $negsize, $fpsi",
- [(set G8RC:$result,
- (PPCdynalloc G8RC:$negsize, iaddr:$fpsi))]>;
-
-def MTLR8 : XFXForm_7_ext<31, 467, 8, (outs), (ins G8RC:$rS),
- "mtlr $rS", SprMTSPR>,
- PPC970_DGroup_First, PPC970_Unit_FXU;
-def MFLR8 : XFXForm_1_ext<31, 339, 8, (outs G8RC:$rT), (ins),
- "mflr $rT", SprMFSPR>,
- PPC970_DGroup_First, PPC970_Unit_FXU;
-
-
-//===----------------------------------------------------------------------===//
-// Fixed point instructions.
-//
-
-let PPC970_Unit = 1 in { // FXU Operations.
-
-// Copies, extends, truncates.
-def OR4To8 : XForm_6<31, 444, (outs G8RC:$rA), (ins GPRC:$rS, GPRC:$rB),
- "or $rA, $rS, $rB", IntGeneral,
- []>;
-def OR8To4 : XForm_6<31, 444, (outs GPRC:$rA), (ins G8RC:$rS, G8RC:$rB),
- "or $rA, $rS, $rB", IntGeneral,
- []>;
-
-def LI8 : DForm_2_r0<14, (outs G8RC:$rD), (ins symbolLo64:$imm),
- "li $rD, $imm", IntGeneral,
- [(set G8RC:$rD, immSExt16:$imm)]>;
-def LIS8 : DForm_2_r0<15, (outs G8RC:$rD), (ins symbolHi64:$imm),
- "lis $rD, $imm", IntGeneral,
- [(set G8RC:$rD, imm16ShiftedSExt:$imm)]>;
-
-// Logical ops.
-def NAND8: XForm_6<31, 476, (outs G8RC:$rA), (ins G8RC:$rS, G8RC:$rB),
- "nand $rA, $rS, $rB", IntGeneral,
- [(set G8RC:$rA, (not (and G8RC:$rS, G8RC:$rB)))]>;
-def AND8 : XForm_6<31, 28, (outs G8RC:$rA), (ins G8RC:$rS, G8RC:$rB),
- "and $rA, $rS, $rB", IntGeneral,
- [(set G8RC:$rA, (and G8RC:$rS, G8RC:$rB))]>;
-def ANDC8: XForm_6<31, 60, (outs G8RC:$rA), (ins G8RC:$rS, G8RC:$rB),
- "andc $rA, $rS, $rB", IntGeneral,
- [(set G8RC:$rA, (and G8RC:$rS, (not G8RC:$rB)))]>;
-def OR8 : XForm_6<31, 444, (outs G8RC:$rA), (ins G8RC:$rS, G8RC:$rB),
- "or $rA, $rS, $rB", IntGeneral,
- [(set G8RC:$rA, (or G8RC:$rS, G8RC:$rB))]>;
-def NOR8 : XForm_6<31, 124, (outs G8RC:$rA), (ins G8RC:$rS, G8RC:$rB),
- "nor $rA, $rS, $rB", IntGeneral,
- [(set G8RC:$rA, (not (or G8RC:$rS, G8RC:$rB)))]>;
-def ORC8 : XForm_6<31, 412, (outs G8RC:$rA), (ins G8RC:$rS, G8RC:$rB),
- "orc $rA, $rS, $rB", IntGeneral,
- [(set G8RC:$rA, (or G8RC:$rS, (not G8RC:$rB)))]>;
-def EQV8 : XForm_6<31, 284, (outs G8RC:$rA), (ins G8RC:$rS, G8RC:$rB),
- "eqv $rA, $rS, $rB", IntGeneral,
- [(set G8RC:$rA, (not (xor G8RC:$rS, G8RC:$rB)))]>;
-def XOR8 : XForm_6<31, 316, (outs G8RC:$rA), (ins G8RC:$rS, G8RC:$rB),
- "xor $rA, $rS, $rB", IntGeneral,
- [(set G8RC:$rA, (xor G8RC:$rS, G8RC:$rB))]>;
-
-// Logical ops with immediate.
-def ANDIo8 : DForm_4<28, (outs G8RC:$dst), (ins G8RC:$src1, u16imm:$src2),
- "andi. $dst, $src1, $src2", IntGeneral,
- [(set G8RC:$dst, (and G8RC:$src1, immZExt16:$src2))]>,
- isDOT;
-def ANDISo8 : DForm_4<29, (outs G8RC:$dst), (ins G8RC:$src1, u16imm:$src2),
- "andis. $dst, $src1, $src2", IntGeneral,
- [(set G8RC:$dst, (and G8RC:$src1,imm16ShiftedZExt:$src2))]>,
- isDOT;
-def ORI8 : DForm_4<24, (outs G8RC:$dst), (ins G8RC:$src1, u16imm:$src2),
- "ori $dst, $src1, $src2", IntGeneral,
- [(set G8RC:$dst, (or G8RC:$src1, immZExt16:$src2))]>;
-def ORIS8 : DForm_4<25, (outs G8RC:$dst), (ins G8RC:$src1, u16imm:$src2),
- "oris $dst, $src1, $src2", IntGeneral,
- [(set G8RC:$dst, (or G8RC:$src1, imm16ShiftedZExt:$src2))]>;
-def XORI8 : DForm_4<26, (outs G8RC:$dst), (ins G8RC:$src1, u16imm:$src2),
- "xori $dst, $src1, $src2", IntGeneral,
- [(set G8RC:$dst, (xor G8RC:$src1, immZExt16:$src2))]>;
-def XORIS8 : DForm_4<27, (outs G8RC:$dst), (ins G8RC:$src1, u16imm:$src2),
- "xoris $dst, $src1, $src2", IntGeneral,
- [(set G8RC:$dst, (xor G8RC:$src1, imm16ShiftedZExt:$src2))]>;
-
-def ADD8 : XOForm_1<31, 266, 0, (outs G8RC:$rT), (ins G8RC:$rA, G8RC:$rB),
- "add $rT, $rA, $rB", IntGeneral,
- [(set G8RC:$rT, (add G8RC:$rA, G8RC:$rB))]>;
-
-def ADDC8 : XOForm_1<31, 10, 0, (outs G8RC:$rT), (ins G8RC:$rA, G8RC:$rB),
- "addc $rT, $rA, $rB", IntGeneral,
- [(set G8RC:$rT, (addc G8RC:$rA, G8RC:$rB))]>,
- PPC970_DGroup_Cracked;
-def ADDE8 : XOForm_1<31, 138, 0, (outs G8RC:$rT), (ins G8RC:$rA, G8RC:$rB),
- "adde $rT, $rA, $rB", IntGeneral,
- [(set G8RC:$rT, (adde G8RC:$rA, G8RC:$rB))]>;
-
-def ADDI8 : DForm_2<14, (outs G8RC:$rD), (ins G8RC:$rA, s16imm64:$imm),
- "addi $rD, $rA, $imm", IntGeneral,
- [(set G8RC:$rD, (add G8RC:$rA, immSExt16:$imm))]>;
-def ADDIS8 : DForm_2<15, (outs G8RC:$rD), (ins G8RC:$rA, symbolHi64:$imm),
- "addis $rD, $rA, $imm", IntGeneral,
- [(set G8RC:$rD, (add G8RC:$rA, imm16ShiftedSExt:$imm))]>;
-
-def SUBFIC8: DForm_2< 8, (outs G8RC:$rD), (ins G8RC:$rA, s16imm64:$imm),
- "subfic $rD, $rA, $imm", IntGeneral,
- [(set G8RC:$rD, (subc immSExt16:$imm, G8RC:$rA))]>;
-def SUBF8 : XOForm_1<31, 40, 0, (outs G8RC:$rT), (ins G8RC:$rA, G8RC:$rB),
- "subf $rT, $rA, $rB", IntGeneral,
- [(set G8RC:$rT, (sub G8RC:$rB, G8RC:$rA))]>;
-
-def SUBFC8 : XOForm_1<31, 8, 0, (outs G8RC:$rT), (ins G8RC:$rA, G8RC:$rB),
- "subfc $rT, $rA, $rB", IntGeneral,
- [(set G8RC:$rT, (subc G8RC:$rB, G8RC:$rA))]>,
- PPC970_DGroup_Cracked;
-
-def SUBFE8 : XOForm_1<31, 136, 0, (outs G8RC:$rT), (ins G8RC:$rA, G8RC:$rB),
- "subfe $rT, $rA, $rB", IntGeneral,
- [(set G8RC:$rT, (sube G8RC:$rB, G8RC:$rA))]>;
-def ADDME8 : XOForm_3<31, 234, 0, (outs G8RC:$rT), (ins G8RC:$rA),
- "addme $rT, $rA", IntGeneral,
- [(set G8RC:$rT, (adde G8RC:$rA, immAllOnes))]>;
-def ADDZE8 : XOForm_3<31, 202, 0, (outs G8RC:$rT), (ins G8RC:$rA),
- "addze $rT, $rA", IntGeneral,
- [(set G8RC:$rT, (adde G8RC:$rA, 0))]>;
-def NEG8 : XOForm_3<31, 104, 0, (outs G8RC:$rT), (ins G8RC:$rA),
- "neg $rT, $rA", IntGeneral,
- [(set G8RC:$rT, (ineg G8RC:$rA))]>;
-def SUBFME8 : XOForm_3<31, 232, 0, (outs G8RC:$rT), (ins G8RC:$rA),
- "subfme $rT, $rA", IntGeneral,
- [(set G8RC:$rT, (sube immAllOnes, G8RC:$rA))]>;
-def SUBFZE8 : XOForm_3<31, 200, 0, (outs G8RC:$rT), (ins G8RC:$rA),
- "subfze $rT, $rA", IntGeneral,
- [(set G8RC:$rT, (sube 0, G8RC:$rA))]>;
-
-
-
-def MULHD : XOForm_1<31, 73, 0, (outs G8RC:$rT), (ins G8RC:$rA, G8RC:$rB),
- "mulhd $rT, $rA, $rB", IntMulHW,
- [(set G8RC:$rT, (mulhs G8RC:$rA, G8RC:$rB))]>;
-def MULHDU : XOForm_1<31, 9, 0, (outs G8RC:$rT), (ins G8RC:$rA, G8RC:$rB),
- "mulhdu $rT, $rA, $rB", IntMulHWU,
- [(set G8RC:$rT, (mulhu G8RC:$rA, G8RC:$rB))]>;
-
-def CMPD : XForm_16_ext<31, 0, (outs CRRC:$crD), (ins G8RC:$rA, G8RC:$rB),
- "cmpd $crD, $rA, $rB", IntCompare>, isPPC64;
-def CMPLD : XForm_16_ext<31, 32, (outs CRRC:$crD), (ins G8RC:$rA, G8RC:$rB),
- "cmpld $crD, $rA, $rB", IntCompare>, isPPC64;
-def CMPDI : DForm_5_ext<11, (outs CRRC:$crD), (ins G8RC:$rA, s16imm:$imm),
- "cmpdi $crD, $rA, $imm", IntCompare>, isPPC64;
-def CMPLDI : DForm_6_ext<10, (outs CRRC:$dst), (ins G8RC:$src1, u16imm:$src2),
- "cmpldi $dst, $src1, $src2", IntCompare>, isPPC64;
-
-def SLD : XForm_6<31, 27, (outs G8RC:$rA), (ins G8RC:$rS, GPRC:$rB),
- "sld $rA, $rS, $rB", IntRotateD,
- [(set G8RC:$rA, (PPCshl G8RC:$rS, GPRC:$rB))]>, isPPC64;
-def SRD : XForm_6<31, 539, (outs G8RC:$rA), (ins G8RC:$rS, GPRC:$rB),
- "srd $rA, $rS, $rB", IntRotateD,
- [(set G8RC:$rA, (PPCsrl G8RC:$rS, GPRC:$rB))]>, isPPC64;
-def SRAD : XForm_6<31, 794, (outs G8RC:$rA), (ins G8RC:$rS, GPRC:$rB),
- "srad $rA, $rS, $rB", IntRotateD,
- [(set G8RC:$rA, (PPCsra G8RC:$rS, GPRC:$rB))]>, isPPC64;
-
-def EXTSB8 : XForm_11<31, 954, (outs G8RC:$rA), (ins G8RC:$rS),
- "extsb $rA, $rS", IntGeneral,
- [(set G8RC:$rA, (sext_inreg G8RC:$rS, i8))]>;
-def EXTSH8 : XForm_11<31, 922, (outs G8RC:$rA), (ins G8RC:$rS),
- "extsh $rA, $rS", IntGeneral,
- [(set G8RC:$rA, (sext_inreg G8RC:$rS, i16))]>;
-
-def EXTSW : XForm_11<31, 986, (outs G8RC:$rA), (ins G8RC:$rS),
- "extsw $rA, $rS", IntGeneral,
- [(set G8RC:$rA, (sext_inreg G8RC:$rS, i32))]>, isPPC64;
-/// EXTSW_32 - Just like EXTSW, but works on '32-bit' registers.
-def EXTSW_32 : XForm_11<31, 986, (outs GPRC:$rA), (ins GPRC:$rS),
- "extsw $rA, $rS", IntGeneral,
- [(set GPRC:$rA, (PPCextsw_32 GPRC:$rS))]>, isPPC64;
-def EXTSW_32_64 : XForm_11<31, 986, (outs G8RC:$rA), (ins GPRC:$rS),
- "extsw $rA, $rS", IntGeneral,
- [(set G8RC:$rA, (sext GPRC:$rS))]>, isPPC64;
-
-def SRADI : XSForm_1<31, 413, (outs G8RC:$rA), (ins G8RC:$rS, u6imm:$SH),
- "sradi $rA, $rS, $SH", IntRotateD,
- [(set G8RC:$rA, (sra G8RC:$rS, (i32 imm:$SH)))]>, isPPC64;
-def CNTLZD : XForm_11<31, 58, (outs G8RC:$rA), (ins G8RC:$rS),
- "cntlzd $rA, $rS", IntGeneral,
- [(set G8RC:$rA, (ctlz G8RC:$rS))]>;
-
-def DIVD : XOForm_1<31, 489, 0, (outs G8RC:$rT), (ins G8RC:$rA, G8RC:$rB),
- "divd $rT, $rA, $rB", IntDivD,
- [(set G8RC:$rT, (sdiv G8RC:$rA, G8RC:$rB))]>, isPPC64,
- PPC970_DGroup_First, PPC970_DGroup_Cracked;
-def DIVDU : XOForm_1<31, 457, 0, (outs G8RC:$rT), (ins G8RC:$rA, G8RC:$rB),
- "divdu $rT, $rA, $rB", IntDivD,
- [(set G8RC:$rT, (udiv G8RC:$rA, G8RC:$rB))]>, isPPC64,
- PPC970_DGroup_First, PPC970_DGroup_Cracked;
-def MULLD : XOForm_1<31, 233, 0, (outs G8RC:$rT), (ins G8RC:$rA, G8RC:$rB),
- "mulld $rT, $rA, $rB", IntMulHD,
- [(set G8RC:$rT, (mul G8RC:$rA, G8RC:$rB))]>, isPPC64;
-
-
-let isCommutable = 1 in {
-def RLDIMI : MDForm_1<30, 3,
- (outs G8RC:$rA), (ins G8RC:$rSi, G8RC:$rS, u6imm:$SH, u6imm:$MB),
- "rldimi $rA, $rS, $SH, $MB", IntRotateD,
- []>, isPPC64, RegConstraint<"$rSi = $rA">,
- NoEncode<"$rSi">;
-}
-
-// Rotate instructions.
-def RLDCL : MDForm_1<30, 0,
- (outs G8RC:$rA), (ins G8RC:$rS, GPRC:$rB, u6imm:$MB),
- "rldcl $rA, $rS, $rB, $MB", IntRotateD,
- []>, isPPC64;
-def RLDICL : MDForm_1<30, 0,
- (outs G8RC:$rA), (ins G8RC:$rS, u6imm:$SH, u6imm:$MB),
- "rldicl $rA, $rS, $SH, $MB", IntRotateD,
- []>, isPPC64;
-def RLDICR : MDForm_1<30, 1,
- (outs G8RC:$rA), (ins G8RC:$rS, u6imm:$SH, u6imm:$ME),
- "rldicr $rA, $rS, $SH, $ME", IntRotateD,
- []>, isPPC64;
-} // End FXU Operations.
-
-
-//===----------------------------------------------------------------------===//
-// Load/Store instructions.
-//
-
-
-// Sign extending loads.
-let isSimpleLoad = 1, PPC970_Unit = 2 in {
-def LHA8: DForm_1<42, (outs G8RC:$rD), (ins memri:$src),
- "lha $rD, $src", LdStLHA,
- [(set G8RC:$rD, (sextloadi16 iaddr:$src))]>,
- PPC970_DGroup_Cracked;
-def LWA : DSForm_1<58, 2, (outs G8RC:$rD), (ins memrix:$src),
- "lwa $rD, $src", LdStLWA,
- [(set G8RC:$rD, (sextloadi32 ixaddr:$src))]>, isPPC64,
- PPC970_DGroup_Cracked;
-def LHAX8: XForm_1<31, 343, (outs G8RC:$rD), (ins memrr:$src),
- "lhax $rD, $src", LdStLHA,
- [(set G8RC:$rD, (sextloadi16 xaddr:$src))]>,
- PPC970_DGroup_Cracked;
-def LWAX : XForm_1<31, 341, (outs G8RC:$rD), (ins memrr:$src),
- "lwax $rD, $src", LdStLHA,
- [(set G8RC:$rD, (sextloadi32 xaddr:$src))]>, isPPC64,
- PPC970_DGroup_Cracked;
-
-// Update forms.
-def LHAU8 : DForm_1<43, (outs G8RC:$rD, ptr_rc:$ea_result), (ins symbolLo:$disp,
- ptr_rc:$rA),
- "lhau $rD, $disp($rA)", LdStGeneral,
- []>, RegConstraint<"$rA = $ea_result">,
- NoEncode<"$ea_result">;
-// NO LWAU!
-
-}
-
-// Zero extending loads.
-let isSimpleLoad = 1, PPC970_Unit = 2 in {
-def LBZ8 : DForm_1<34, (outs G8RC:$rD), (ins memri:$src),
- "lbz $rD, $src", LdStGeneral,
- [(set G8RC:$rD, (zextloadi8 iaddr:$src))]>;
-def LHZ8 : DForm_1<40, (outs G8RC:$rD), (ins memri:$src),
- "lhz $rD, $src", LdStGeneral,
- [(set G8RC:$rD, (zextloadi16 iaddr:$src))]>;
-def LWZ8 : DForm_1<32, (outs G8RC:$rD), (ins memri:$src),
- "lwz $rD, $src", LdStGeneral,
- [(set G8RC:$rD, (zextloadi32 iaddr:$src))]>, isPPC64;
-
-def LBZX8 : XForm_1<31, 87, (outs G8RC:$rD), (ins memrr:$src),
- "lbzx $rD, $src", LdStGeneral,
- [(set G8RC:$rD, (zextloadi8 xaddr:$src))]>;
-def LHZX8 : XForm_1<31, 279, (outs G8RC:$rD), (ins memrr:$src),
- "lhzx $rD, $src", LdStGeneral,
- [(set G8RC:$rD, (zextloadi16 xaddr:$src))]>;
-def LWZX8 : XForm_1<31, 23, (outs G8RC:$rD), (ins memrr:$src),
- "lwzx $rD, $src", LdStGeneral,
- [(set G8RC:$rD, (zextloadi32 xaddr:$src))]>;
-
-
-// Update forms.
-def LBZU8 : DForm_1<35, (outs G8RC:$rD, ptr_rc:$ea_result), (ins memri:$addr),
- "lbzu $rD, $addr", LdStGeneral,
- []>, RegConstraint<"$addr.reg = $ea_result">,
- NoEncode<"$ea_result">;
-def LHZU8 : DForm_1<41, (outs G8RC:$rD, ptr_rc:$ea_result), (ins memri:$addr),
- "lhzu $rD, $addr", LdStGeneral,
- []>, RegConstraint<"$addr.reg = $ea_result">,
- NoEncode<"$ea_result">;
-def LWZU8 : DForm_1<33, (outs G8RC:$rD, ptr_rc:$ea_result), (ins memri:$addr),
- "lwzu $rD, $addr", LdStGeneral,
- []>, RegConstraint<"$addr.reg = $ea_result">,
- NoEncode<"$ea_result">;
-}
-
-
-// Full 8-byte loads.
-let isSimpleLoad = 1, PPC970_Unit = 2 in {
-def LD : DSForm_1<58, 0, (outs G8RC:$rD), (ins memrix:$src),
- "ld $rD, $src", LdStLD,
- [(set G8RC:$rD, (load ixaddr:$src))]>, isPPC64;
-def LDX : XForm_1<31, 21, (outs G8RC:$rD), (ins memrr:$src),
- "ldx $rD, $src", LdStLD,
- [(set G8RC:$rD, (load xaddr:$src))]>, isPPC64;
-
-def LDU : DSForm_1<58, 1, (outs G8RC:$rD, ptr_rc:$ea_result), (ins memrix:$addr),
- "ldu $rD, $addr", LdStLD,
- []>, RegConstraint<"$addr.reg = $ea_result">, isPPC64,
- NoEncode<"$ea_result">;
-
-}
-
-let PPC970_Unit = 2 in {
-// Truncating stores.
-def STB8 : DForm_1<38, (outs), (ins G8RC:$rS, memri:$src),
- "stb $rS, $src", LdStGeneral,
- [(truncstorei8 G8RC:$rS, iaddr:$src)]>;
-def STH8 : DForm_1<44, (outs), (ins G8RC:$rS, memri:$src),
- "sth $rS, $src", LdStGeneral,
- [(truncstorei16 G8RC:$rS, iaddr:$src)]>;
-def STW8 : DForm_1<36, (outs), (ins G8RC:$rS, memri:$src),
- "stw $rS, $src", LdStGeneral,
- [(truncstorei32 G8RC:$rS, iaddr:$src)]>;
-def STBX8 : XForm_8<31, 215, (outs), (ins G8RC:$rS, memrr:$dst),
- "stbx $rS, $dst", LdStGeneral,
- [(truncstorei8 G8RC:$rS, xaddr:$dst)]>,
- PPC970_DGroup_Cracked;
-def STHX8 : XForm_8<31, 407, (outs), (ins G8RC:$rS, memrr:$dst),
- "sthx $rS, $dst", LdStGeneral,
- [(truncstorei16 G8RC:$rS, xaddr:$dst)]>,
- PPC970_DGroup_Cracked;
-def STWX8 : XForm_8<31, 151, (outs), (ins G8RC:$rS, memrr:$dst),
- "stwx $rS, $dst", LdStGeneral,
- [(truncstorei32 G8RC:$rS, xaddr:$dst)]>,
- PPC970_DGroup_Cracked;
-// Normal 8-byte stores.
-def STD : DSForm_1<62, 0, (outs), (ins G8RC:$rS, memrix:$dst),
- "std $rS, $dst", LdStSTD,
- [(store G8RC:$rS, ixaddr:$dst)]>, isPPC64;
-def STDX : XForm_8<31, 149, (outs), (ins G8RC:$rS, memrr:$dst),
- "stdx $rS, $dst", LdStSTD,
- [(store G8RC:$rS, xaddr:$dst)]>, isPPC64,
- PPC970_DGroup_Cracked;
-}
-
-let PPC970_Unit = 2 in {
-
-def STBU8 : DForm_1<38, (outs ptr_rc:$ea_res), (ins G8RC:$rS,
- symbolLo:$ptroff, ptr_rc:$ptrreg),
- "stbu $rS, $ptroff($ptrreg)", LdStGeneral,
- [(set ptr_rc:$ea_res,
- (pre_truncsti8 G8RC:$rS, ptr_rc:$ptrreg,
- iaddroff:$ptroff))]>,
- RegConstraint<"$ptrreg = $ea_res">, NoEncode<"$ea_res">;
-def STHU8 : DForm_1<45, (outs ptr_rc:$ea_res), (ins G8RC:$rS,
- symbolLo:$ptroff, ptr_rc:$ptrreg),
- "sthu $rS, $ptroff($ptrreg)", LdStGeneral,
- [(set ptr_rc:$ea_res,
- (pre_truncsti16 G8RC:$rS, ptr_rc:$ptrreg,
- iaddroff:$ptroff))]>,
- RegConstraint<"$ptrreg = $ea_res">, NoEncode<"$ea_res">;
-def STWU8 : DForm_1<37, (outs ptr_rc:$ea_res), (ins G8RC:$rS,
- symbolLo:$ptroff, ptr_rc:$ptrreg),
- "stwu $rS, $ptroff($ptrreg)", LdStGeneral,
- [(set ptr_rc:$ea_res, (pre_store G8RC:$rS, ptr_rc:$ptrreg,
- iaddroff:$ptroff))]>,
- RegConstraint<"$ptrreg = $ea_res">, NoEncode<"$ea_res">;
-
-
-def STDU : DSForm_1<62, 1, (outs ptr_rc:$ea_res), (ins G8RC:$rS,
- s16immX4:$ptroff, ptr_rc:$ptrreg),
- "stdu $rS, $ptroff($ptrreg)", LdStSTD,
- [(set ptr_rc:$ea_res, (pre_store G8RC:$rS, ptr_rc:$ptrreg,
- iaddroff:$ptroff))]>,
- RegConstraint<"$ptrreg = $ea_res">, NoEncode<"$ea_res">,
- isPPC64;
-
-let mayStore = 1 in
-def STDUX : XForm_8<31, 181, (outs), (ins G8RC:$rS, memrr:$dst),
- "stdux $rS, $dst", LdStSTD,
- []>, isPPC64;
-
-// STD_32/STDX_32 - Just like STD/STDX, but uses a '32-bit' input register.
-def STD_32 : DSForm_1<62, 0, (outs), (ins GPRC:$rT, memrix:$dst),
- "std $rT, $dst", LdStSTD,
- [(PPCstd_32 GPRC:$rT, ixaddr:$dst)]>, isPPC64;
-def STDX_32 : XForm_8<31, 149, (outs), (ins GPRC:$rT, memrr:$dst),
- "stdx $rT, $dst", LdStSTD,
- [(PPCstd_32 GPRC:$rT, xaddr:$dst)]>, isPPC64,
- PPC970_DGroup_Cracked;
-}
-
-
-
-//===----------------------------------------------------------------------===//
-// Floating point instructions.
-//
-
-
-let PPC970_Unit = 3 in { // FPU Operations.
-def FCFID : XForm_26<63, 846, (outs F8RC:$frD), (ins F8RC:$frB),
- "fcfid $frD, $frB", FPGeneral,
- [(set F8RC:$frD, (PPCfcfid F8RC:$frB))]>, isPPC64;
-def FCTIDZ : XForm_26<63, 815, (outs F8RC:$frD), (ins F8RC:$frB),
- "fctidz $frD, $frB", FPGeneral,
- [(set F8RC:$frD, (PPCfctidz F8RC:$frB))]>, isPPC64;
-}
-
-
-//===----------------------------------------------------------------------===//
-// Instruction Patterns
-//
-
-// Extensions and truncates to/from 32-bit regs.
-def : Pat<(i64 (zext GPRC:$in)),
- (RLDICL (OR4To8 GPRC:$in, GPRC:$in), 0, 32)>;
-def : Pat<(i64 (anyext GPRC:$in)),
- (OR4To8 GPRC:$in, GPRC:$in)>;
-def : Pat<(i32 (trunc G8RC:$in)),
- (OR8To4 G8RC:$in, G8RC:$in)>;
-
-// Extending loads with i64 targets.
-def : Pat<(zextloadi1 iaddr:$src),
- (LBZ8 iaddr:$src)>;
-def : Pat<(zextloadi1 xaddr:$src),
- (LBZX8 xaddr:$src)>;
-def : Pat<(extloadi1 iaddr:$src),
- (LBZ8 iaddr:$src)>;
-def : Pat<(extloadi1 xaddr:$src),
- (LBZX8 xaddr:$src)>;
-def : Pat<(extloadi8 iaddr:$src),
- (LBZ8 iaddr:$src)>;
-def : Pat<(extloadi8 xaddr:$src),
- (LBZX8 xaddr:$src)>;
-def : Pat<(extloadi16 iaddr:$src),
- (LHZ8 iaddr:$src)>;
-def : Pat<(extloadi16 xaddr:$src),
- (LHZX8 xaddr:$src)>;
-def : Pat<(extloadi32 iaddr:$src),
- (LWZ8 iaddr:$src)>;
-def : Pat<(extloadi32 xaddr:$src),
- (LWZX8 xaddr:$src)>;
-
-// Standard shifts. These are represented separately from the real shifts above
-// so that we can distinguish between shifts that allow 6-bit and 7-bit shift
-// amounts.
-def : Pat<(sra G8RC:$rS, GPRC:$rB),
- (SRAD G8RC:$rS, GPRC:$rB)>;
-def : Pat<(srl G8RC:$rS, GPRC:$rB),
- (SRD G8RC:$rS, GPRC:$rB)>;
-def : Pat<(shl G8RC:$rS, GPRC:$rB),
- (SLD G8RC:$rS, GPRC:$rB)>;
-
-// SHL/SRL
-def : Pat<(shl G8RC:$in, (i32 imm:$imm)),
- (RLDICR G8RC:$in, imm:$imm, (SHL64 imm:$imm))>;
-def : Pat<(srl G8RC:$in, (i32 imm:$imm)),
- (RLDICL G8RC:$in, (SRL64 imm:$imm), imm:$imm)>;
-
-// ROTL
-def : Pat<(rotl G8RC:$in, GPRC:$sh),
- (RLDCL G8RC:$in, GPRC:$sh, 0)>;
-def : Pat<(rotl G8RC:$in, (i32 imm:$imm)),
- (RLDICL G8RC:$in, imm:$imm, 0)>;
-
-// Hi and Lo for Darwin Global Addresses.
-def : Pat<(PPChi tglobaladdr:$in, 0), (LIS8 tglobaladdr:$in)>;
-def : Pat<(PPClo tglobaladdr:$in, 0), (LI8 tglobaladdr:$in)>;
-def : Pat<(PPChi tconstpool:$in , 0), (LIS8 tconstpool:$in)>;
-def : Pat<(PPClo tconstpool:$in , 0), (LI8 tconstpool:$in)>;
-def : Pat<(PPChi tjumptable:$in , 0), (LIS8 tjumptable:$in)>;
-def : Pat<(PPClo tjumptable:$in , 0), (LI8 tjumptable:$in)>;
-def : Pat<(add G8RC:$in, (PPChi tglobaladdr:$g, 0)),
- (ADDIS8 G8RC:$in, tglobaladdr:$g)>;
-def : Pat<(add G8RC:$in, (PPChi tconstpool:$g, 0)),
- (ADDIS8 G8RC:$in, tconstpool:$g)>;
-def : Pat<(add G8RC:$in, (PPChi tjumptable:$g, 0)),
- (ADDIS8 G8RC:$in, tjumptable:$g)>;
diff --git a/release_23/lib/Target/PowerPC/PPCInstrAltivec.td b/release_23/lib/Target/PowerPC/PPCInstrAltivec.td
deleted file mode 100644
index feb538a6fa30..000000000000
--- a/release_23/lib/Target/PowerPC/PPCInstrAltivec.td
+++ /dev/null
@@ -1,653 +0,0 @@
-//===- PPCInstrAltivec.td - The PowerPC Altivec Extension --*- tablegen -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file describes the Altivec extension to the PowerPC instruction set.
-//
-//===----------------------------------------------------------------------===//
-
-//===----------------------------------------------------------------------===//
-// Altivec transformation functions and pattern fragments.
-//
-
-/// VPKUHUM_shuffle_mask/VPKUWUM_shuffle_mask - Return true if this is a valid
-/// shuffle mask for the VPKUHUM or VPKUWUM instructions.
-def VPKUHUM_shuffle_mask : PatLeaf<(build_vector), [{
- return PPC::isVPKUHUMShuffleMask(N, false);
-}]>;
-def VPKUWUM_shuffle_mask : PatLeaf<(build_vector), [{
- return PPC::isVPKUWUMShuffleMask(N, false);
-}]>;
-
-def VPKUHUM_unary_shuffle_mask : PatLeaf<(build_vector), [{
- return PPC::isVPKUHUMShuffleMask(N, true);
-}]>;
-def VPKUWUM_unary_shuffle_mask : PatLeaf<(build_vector), [{
- return PPC::isVPKUWUMShuffleMask(N, true);
-}]>;
-
-
-def VMRGLB_shuffle_mask : PatLeaf<(build_vector), [{
- return PPC::isVMRGLShuffleMask(N, 1, false);
-}]>;
-def VMRGLH_shuffle_mask : PatLeaf<(build_vector), [{
- return PPC::isVMRGLShuffleMask(N, 2, false);
-}]>;
-def VMRGLW_shuffle_mask : PatLeaf<(build_vector), [{
- return PPC::isVMRGLShuffleMask(N, 4, false);
-}]>;
-def VMRGHB_shuffle_mask : PatLeaf<(build_vector), [{
- return PPC::isVMRGHShuffleMask(N, 1, false);
-}]>;
-def VMRGHH_shuffle_mask : PatLeaf<(build_vector), [{
- return PPC::isVMRGHShuffleMask(N, 2, false);
-}]>;
-def VMRGHW_shuffle_mask : PatLeaf<(build_vector), [{
- return PPC::isVMRGHShuffleMask(N, 4, false);
-}]>;
-
-def VMRGLB_unary_shuffle_mask : PatLeaf<(build_vector), [{
- return PPC::isVMRGLShuffleMask(N, 1, true);
-}]>;
-def VMRGLH_unary_shuffle_mask : PatLeaf<(build_vector), [{
- return PPC::isVMRGLShuffleMask(N, 2, true);
-}]>;
-def VMRGLW_unary_shuffle_mask : PatLeaf<(build_vector), [{
- return PPC::isVMRGLShuffleMask(N, 4, true);
-}]>;
-def VMRGHB_unary_shuffle_mask : PatLeaf<(build_vector), [{
- return PPC::isVMRGHShuffleMask(N, 1, true);
-}]>;
-def VMRGHH_unary_shuffle_mask : PatLeaf<(build_vector), [{
- return PPC::isVMRGHShuffleMask(N, 2, true);
-}]>;
-def VMRGHW_unary_shuffle_mask : PatLeaf<(build_vector), [{
- return PPC::isVMRGHShuffleMask(N, 4, true);
-}]>;
-
-def VSLDOI_get_imm : SDNodeXForm<build_vector, [{
- return getI32Imm(PPC::isVSLDOIShuffleMask(N, false));
-}]>;
-def VSLDOI_shuffle_mask : PatLeaf<(build_vector), [{
- return PPC::isVSLDOIShuffleMask(N, false) != -1;
-}], VSLDOI_get_imm>;
-
-/// VSLDOI_unary* - These are used to match vsldoi(X,X), which is turned into
-/// vector_shuffle(X,undef,mask) by the dag combiner.
-def VSLDOI_unary_get_imm : SDNodeXForm<build_vector, [{
- return getI32Imm(PPC::isVSLDOIShuffleMask(N, true));
-}]>;
-def VSLDOI_unary_shuffle_mask : PatLeaf<(build_vector), [{
- return PPC::isVSLDOIShuffleMask(N, true) != -1;
-}], VSLDOI_unary_get_imm>;
-
-
-// VSPLT*_get_imm xform function: convert vector_shuffle mask to VSPLT* imm.
-def VSPLTB_get_imm : SDNodeXForm<build_vector, [{
- return getI32Imm(PPC::getVSPLTImmediate(N, 1));
-}]>;
-def VSPLTB_shuffle_mask : PatLeaf<(build_vector), [{
- return PPC::isSplatShuffleMask(N, 1);
-}], VSPLTB_get_imm>;
-def VSPLTH_get_imm : SDNodeXForm<build_vector, [{
- return getI32Imm(PPC::getVSPLTImmediate(N, 2));
-}]>;
-def VSPLTH_shuffle_mask : PatLeaf<(build_vector), [{
- return PPC::isSplatShuffleMask(N, 2);
-}], VSPLTH_get_imm>;
-def VSPLTW_get_imm : SDNodeXForm<build_vector, [{
- return getI32Imm(PPC::getVSPLTImmediate(N, 4));
-}]>;
-def VSPLTW_shuffle_mask : PatLeaf<(build_vector), [{
- return PPC::isSplatShuffleMask(N, 4);
-}], VSPLTW_get_imm>;
-
-
-// VSPLTISB_get_imm xform function: convert build_vector to VSPLTISB imm.
-def VSPLTISB_get_imm : SDNodeXForm<build_vector, [{
- return PPC::get_VSPLTI_elt(N, 1, *CurDAG);
-}]>;
-def vecspltisb : PatLeaf<(build_vector), [{
- return PPC::get_VSPLTI_elt(N, 1, *CurDAG).Val != 0;
-}], VSPLTISB_get_imm>;
-
-// VSPLTISH_get_imm xform function: convert build_vector to VSPLTISH imm.
-def VSPLTISH_get_imm : SDNodeXForm<build_vector, [{
- return PPC::get_VSPLTI_elt(N, 2, *CurDAG);
-}]>;
-def vecspltish : PatLeaf<(build_vector), [{
- return PPC::get_VSPLTI_elt(N, 2, *CurDAG).Val != 0;
-}], VSPLTISH_get_imm>;
-
-// VSPLTISW_get_imm xform function: convert build_vector to VSPLTISW imm.
-def VSPLTISW_get_imm : SDNodeXForm<build_vector, [{
- return PPC::get_VSPLTI_elt(N, 4, *CurDAG);
-}]>;
-def vecspltisw : PatLeaf<(build_vector), [{
- return PPC::get_VSPLTI_elt(N, 4, *CurDAG).Val != 0;
-}], VSPLTISW_get_imm>;
-
-def V_immneg0 : PatLeaf<(build_vector), [{
- return PPC::isAllNegativeZeroVector(N);
-}]>;
-
-//===----------------------------------------------------------------------===//
-// Helpers for defining instructions that directly correspond to intrinsics.
-
-// VA1a_Int - A VAForm_1a intrinsic definition.
-class VA1a_Int<bits<6> xo, string opc, Intrinsic IntID>
- : VAForm_1a<xo, (outs VRRC:$vD), (ins VRRC:$vA, VRRC:$vB, VRRC:$vC),
- !strconcat(opc, " $vD, $vA, $vB, $vC"), VecFP,
- [(set VRRC:$vD, (IntID VRRC:$vA, VRRC:$vB, VRRC:$vC))]>;
-
-// VX1_Int - A VXForm_1 intrinsic definition.
-class VX1_Int<bits<11> xo, string opc, Intrinsic IntID>
- : VXForm_1<xo, (outs VRRC:$vD), (ins VRRC:$vA, VRRC:$vB),
- !strconcat(opc, " $vD, $vA, $vB"), VecFP,
- [(set VRRC:$vD, (IntID VRRC:$vA, VRRC:$vB))]>;
-
-// VX2_Int - A VXForm_2 intrinsic definition.
-class VX2_Int<bits<11> xo, string opc, Intrinsic IntID>
- : VXForm_2<xo, (outs VRRC:$vD), (ins VRRC:$vB),
- !strconcat(opc, " $vD, $vB"), VecFP,
- [(set VRRC:$vD, (IntID VRRC:$vB))]>;
-
-//===----------------------------------------------------------------------===//
-// Instruction Definitions.
-
-def DSS : DSS_Form<822, (outs),
- (ins u5imm:$ZERO0, u5imm:$STRM,u5imm:$ZERO1,u5imm:$ZERO2),
- "dss $STRM", LdStGeneral /*FIXME*/, []>;
-def DSSALL : DSS_Form<822, (outs),
- (ins u5imm:$ONE, u5imm:$ZERO0,u5imm:$ZERO1,u5imm:$ZERO2),
- "dssall", LdStGeneral /*FIXME*/, []>;
-def DST : DSS_Form<342, (outs),
- (ins u5imm:$ZERO, u5imm:$STRM, GPRC:$rA, GPRC:$rB),
- "dst $rA, $rB, $STRM", LdStGeneral /*FIXME*/, []>;
-def DSTT : DSS_Form<342, (outs),
- (ins u5imm:$ONE, u5imm:$STRM, GPRC:$rA, GPRC:$rB),
- "dstt $rA, $rB, $STRM", LdStGeneral /*FIXME*/, []>;
-def DSTST : DSS_Form<374, (outs),
- (ins u5imm:$ZERO, u5imm:$STRM, GPRC:$rA, GPRC:$rB),
- "dstst $rA, $rB, $STRM", LdStGeneral /*FIXME*/, []>;
-def DSTSTT : DSS_Form<374, (outs),
- (ins u5imm:$ONE, u5imm:$STRM, GPRC:$rA, GPRC:$rB),
- "dststt $rA, $rB, $STRM", LdStGeneral /*FIXME*/, []>;
-
-def DST64 : DSS_Form<342, (outs),
- (ins u5imm:$ZERO, u5imm:$STRM, G8RC:$rA, GPRC:$rB),
- "dst $rA, $rB, $STRM", LdStGeneral /*FIXME*/, []>;
-def DSTT64 : DSS_Form<342, (outs),
- (ins u5imm:$ONE, u5imm:$STRM, G8RC:$rA, GPRC:$rB),
- "dstt $rA, $rB, $STRM", LdStGeneral /*FIXME*/, []>;
-def DSTST64 : DSS_Form<374, (outs),
- (ins u5imm:$ZERO, u5imm:$STRM, G8RC:$rA, GPRC:$rB),
- "dstst $rA, $rB, $STRM", LdStGeneral /*FIXME*/, []>;
-def DSTSTT64 : DSS_Form<374, (outs),
- (ins u5imm:$ONE, u5imm:$STRM, G8RC:$rA, GPRC:$rB),
- "dststt $rA, $rB, $STRM", LdStGeneral /*FIXME*/, []>;
-
-def MFVSCR : VXForm_4<1540, (outs VRRC:$vD), (ins),
- "mfvscr $vD", LdStGeneral,
- [(set VRRC:$vD, (int_ppc_altivec_mfvscr))]>;
-def MTVSCR : VXForm_5<1604, (outs), (ins VRRC:$vB),
- "mtvscr $vB", LdStGeneral,
- [(int_ppc_altivec_mtvscr VRRC:$vB)]>;
-
-let isSimpleLoad = 1, PPC970_Unit = 2 in { // Loads.
-def LVEBX: XForm_1<31, 7, (outs VRRC:$vD), (ins memrr:$src),
- "lvebx $vD, $src", LdStGeneral,
- [(set VRRC:$vD, (int_ppc_altivec_lvebx xoaddr:$src))]>;
-def LVEHX: XForm_1<31, 39, (outs VRRC:$vD), (ins memrr:$src),
- "lvehx $vD, $src", LdStGeneral,
- [(set VRRC:$vD, (int_ppc_altivec_lvehx xoaddr:$src))]>;
-def LVEWX: XForm_1<31, 71, (outs VRRC:$vD), (ins memrr:$src),
- "lvewx $vD, $src", LdStGeneral,
- [(set VRRC:$vD, (int_ppc_altivec_lvewx xoaddr:$src))]>;
-def LVX : XForm_1<31, 103, (outs VRRC:$vD), (ins memrr:$src),
- "lvx $vD, $src", LdStGeneral,
- [(set VRRC:$vD, (int_ppc_altivec_lvx xoaddr:$src))]>;
-def LVXL : XForm_1<31, 359, (outs VRRC:$vD), (ins memrr:$src),
- "lvxl $vD, $src", LdStGeneral,
- [(set VRRC:$vD, (int_ppc_altivec_lvxl xoaddr:$src))]>;
-}
-
-def LVSL : XForm_1<31, 6, (outs VRRC:$vD), (ins memrr:$src),
- "lvsl $vD, $src", LdStGeneral,
- [(set VRRC:$vD, (int_ppc_altivec_lvsl xoaddr:$src))]>,
- PPC970_Unit_LSU;
-def LVSR : XForm_1<31, 38, (outs VRRC:$vD), (ins memrr:$src),
- "lvsr $vD, $src", LdStGeneral,
- [(set VRRC:$vD, (int_ppc_altivec_lvsr xoaddr:$src))]>,
- PPC970_Unit_LSU;
-
-let PPC970_Unit = 2 in { // Stores.
-def STVEBX: XForm_8<31, 135, (outs), (ins VRRC:$rS, memrr:$dst),
- "stvebx $rS, $dst", LdStGeneral,
- [(int_ppc_altivec_stvebx VRRC:$rS, xoaddr:$dst)]>;
-def STVEHX: XForm_8<31, 167, (outs), (ins VRRC:$rS, memrr:$dst),
- "stvehx $rS, $dst", LdStGeneral,
- [(int_ppc_altivec_stvehx VRRC:$rS, xoaddr:$dst)]>;
-def STVEWX: XForm_8<31, 199, (outs), (ins VRRC:$rS, memrr:$dst),
- "stvewx $rS, $dst", LdStGeneral,
- [(int_ppc_altivec_stvewx VRRC:$rS, xoaddr:$dst)]>;
-def STVX : XForm_8<31, 231, (outs), (ins VRRC:$rS, memrr:$dst),
- "stvx $rS, $dst", LdStGeneral,
- [(int_ppc_altivec_stvx VRRC:$rS, xoaddr:$dst)]>;
-def STVXL : XForm_8<31, 487, (outs), (ins VRRC:$rS, memrr:$dst),
- "stvxl $rS, $dst", LdStGeneral,
- [(int_ppc_altivec_stvxl VRRC:$rS, xoaddr:$dst)]>;
-}
-
-let PPC970_Unit = 5 in { // VALU Operations.
-// VA-Form instructions. 3-input AltiVec ops.
-def VMADDFP : VAForm_1<46, (outs VRRC:$vD), (ins VRRC:$vA, VRRC:$vC, VRRC:$vB),
- "vmaddfp $vD, $vA, $vC, $vB", VecFP,
- [(set VRRC:$vD, (fadd (fmul VRRC:$vA, VRRC:$vC),
- VRRC:$vB))]>,
- Requires<[FPContractions]>;
-def VNMSUBFP: VAForm_1<47, (outs VRRC:$vD), (ins VRRC:$vA, VRRC:$vC, VRRC:$vB),
- "vnmsubfp $vD, $vA, $vC, $vB", VecFP,
- [(set VRRC:$vD, (fsub V_immneg0,
- (fsub (fmul VRRC:$vA, VRRC:$vC),
- VRRC:$vB)))]>,
- Requires<[FPContractions]>;
-
-def VMHADDSHS : VA1a_Int<32, "vmhaddshs", int_ppc_altivec_vmhaddshs>;
-def VMHRADDSHS : VA1a_Int<33, "vmhraddshs", int_ppc_altivec_vmhraddshs>;
-def VMLADDUHM : VA1a_Int<34, "vmladduhm", int_ppc_altivec_vmladduhm>;
-def VPERM : VA1a_Int<43, "vperm", int_ppc_altivec_vperm>;
-def VSEL : VA1a_Int<42, "vsel", int_ppc_altivec_vsel>;
-
-// Shuffles.
-def VSLDOI : VAForm_2<44, (outs VRRC:$vD), (ins VRRC:$vA, VRRC:$vB, u5imm:$SH),
- "vsldoi $vD, $vA, $vB, $SH", VecFP,
- [(set VRRC:$vD,
- (vector_shuffle (v16i8 VRRC:$vA), VRRC:$vB,
- VSLDOI_shuffle_mask:$SH))]>;
-
-// VX-Form instructions. AltiVec arithmetic ops.
-def VADDFP : VXForm_1<10, (outs VRRC:$vD), (ins VRRC:$vA, VRRC:$vB),
- "vaddfp $vD, $vA, $vB", VecFP,
- [(set VRRC:$vD, (fadd VRRC:$vA, VRRC:$vB))]>;
-
-def VADDUBM : VXForm_1<0, (outs VRRC:$vD), (ins VRRC:$vA, VRRC:$vB),
- "vaddubm $vD, $vA, $vB", VecGeneral,
- [(set VRRC:$vD, (add (v16i8 VRRC:$vA), VRRC:$vB))]>;
-def VADDUHM : VXForm_1<64, (outs VRRC:$vD), (ins VRRC:$vA, VRRC:$vB),
- "vadduhm $vD, $vA, $vB", VecGeneral,
- [(set VRRC:$vD, (add (v8i16 VRRC:$vA), VRRC:$vB))]>;
-def VADDUWM : VXForm_1<128, (outs VRRC:$vD), (ins VRRC:$vA, VRRC:$vB),
- "vadduwm $vD, $vA, $vB", VecGeneral,
- [(set VRRC:$vD, (add (v4i32 VRRC:$vA), VRRC:$vB))]>;
-
-def VADDCUW : VX1_Int<384, "vaddcuw", int_ppc_altivec_vaddcuw>;
-def VADDSBS : VX1_Int<768, "vaddsbs", int_ppc_altivec_vaddsbs>;
-def VADDSHS : VX1_Int<832, "vaddshs", int_ppc_altivec_vaddshs>;
-def VADDSWS : VX1_Int<896, "vaddsws", int_ppc_altivec_vaddsws>;
-def VADDUBS : VX1_Int<512, "vaddubs", int_ppc_altivec_vaddubs>;
-def VADDUHS : VX1_Int<576, "vadduhs", int_ppc_altivec_vadduhs>;
-def VADDUWS : VX1_Int<640, "vadduws", int_ppc_altivec_vadduws>;
-
-
-def VAND : VXForm_1<1028, (outs VRRC:$vD), (ins VRRC:$vA, VRRC:$vB),
- "vand $vD, $vA, $vB", VecFP,
- [(set VRRC:$vD, (and (v4i32 VRRC:$vA), VRRC:$vB))]>;
-def VANDC : VXForm_1<1092, (outs VRRC:$vD), (ins VRRC:$vA, VRRC:$vB),
- "vandc $vD, $vA, $vB", VecFP,
- [(set VRRC:$vD, (and (v4i32 VRRC:$vA), (vnot VRRC:$vB)))]>;
-
-def VCFSX : VXForm_1<842, (outs VRRC:$vD), (ins u5imm:$UIMM, VRRC:$vB),
- "vcfsx $vD, $vB, $UIMM", VecFP,
- [(set VRRC:$vD,
- (int_ppc_altivec_vcfsx VRRC:$vB, imm:$UIMM))]>;
-def VCFUX : VXForm_1<778, (outs VRRC:$vD), (ins u5imm:$UIMM, VRRC:$vB),
- "vcfux $vD, $vB, $UIMM", VecFP,
- [(set VRRC:$vD,
- (int_ppc_altivec_vcfux VRRC:$vB, imm:$UIMM))]>;
-def VCTSXS : VXForm_1<970, (outs VRRC:$vD), (ins u5imm:$UIMM, VRRC:$vB),
- "vctsxs $vD, $vB, $UIMM", VecFP,
- [(set VRRC:$vD,
- (int_ppc_altivec_vctsxs VRRC:$vB, imm:$UIMM))]>;
-def VCTUXS : VXForm_1<906, (outs VRRC:$vD), (ins u5imm:$UIMM, VRRC:$vB),
- "vctuxs $vD, $vB, $UIMM", VecFP,
- [(set VRRC:$vD,
- (int_ppc_altivec_vctuxs VRRC:$vB, imm:$UIMM))]>;
-def VEXPTEFP : VX2_Int<394, "vexptefp", int_ppc_altivec_vexptefp>;
-def VLOGEFP : VX2_Int<458, "vlogefp", int_ppc_altivec_vlogefp>;
-
-def VAVGSB : VX1_Int<1282, "vavgsb", int_ppc_altivec_vavgsb>;
-def VAVGSH : VX1_Int<1346, "vavgsh", int_ppc_altivec_vavgsh>;
-def VAVGSW : VX1_Int<1410, "vavgsw", int_ppc_altivec_vavgsw>;
-def VAVGUB : VX1_Int<1026, "vavgub", int_ppc_altivec_vavgub>;
-def VAVGUH : VX1_Int<1090, "vavguh", int_ppc_altivec_vavguh>;
-def VAVGUW : VX1_Int<1154, "vavguw", int_ppc_altivec_vavguw>;
-
-def VMAXFP : VX1_Int<1034, "vmaxfp", int_ppc_altivec_vmaxfp>;
-def VMAXSB : VX1_Int< 258, "vmaxsb", int_ppc_altivec_vmaxsb>;
-def VMAXSH : VX1_Int< 322, "vmaxsh", int_ppc_altivec_vmaxsh>;
-def VMAXSW : VX1_Int< 386, "vmaxsw", int_ppc_altivec_vmaxsw>;
-def VMAXUB : VX1_Int< 2, "vmaxub", int_ppc_altivec_vmaxub>;
-def VMAXUH : VX1_Int< 66, "vmaxuh", int_ppc_altivec_vmaxuh>;
-def VMAXUW : VX1_Int< 130, "vmaxuw", int_ppc_altivec_vmaxuw>;
-def VMINFP : VX1_Int<1098, "vminfp", int_ppc_altivec_vminfp>;
-def VMINSB : VX1_Int< 770, "vminsb", int_ppc_altivec_vminsb>;
-def VMINSH : VX1_Int< 834, "vminsh", int_ppc_altivec_vminsh>;
-def VMINSW : VX1_Int< 898, "vminsw", int_ppc_altivec_vminsw>;
-def VMINUB : VX1_Int< 514, "vminub", int_ppc_altivec_vminub>;
-def VMINUH : VX1_Int< 578, "vminuh", int_ppc_altivec_vminuh>;
-def VMINUW : VX1_Int< 642, "vminuw", int_ppc_altivec_vminuw>;
-
-def VMRGHB : VXForm_1< 12, (outs VRRC:$vD), (ins VRRC:$vA, VRRC:$vB),
- "vmrghb $vD, $vA, $vB", VecFP,
- [(set VRRC:$vD, (vector_shuffle (v16i8 VRRC:$vA),
- VRRC:$vB, VMRGHB_shuffle_mask))]>;
-def VMRGHH : VXForm_1< 76, (outs VRRC:$vD), (ins VRRC:$vA, VRRC:$vB),
- "vmrghh $vD, $vA, $vB", VecFP,
- [(set VRRC:$vD, (vector_shuffle (v16i8 VRRC:$vA),
- VRRC:$vB, VMRGHH_shuffle_mask))]>;
-def VMRGHW : VXForm_1<140, (outs VRRC:$vD), (ins VRRC:$vA, VRRC:$vB),
- "vmrghw $vD, $vA, $vB", VecFP,
- [(set VRRC:$vD, (vector_shuffle (v16i8 VRRC:$vA),
- VRRC:$vB, VMRGHW_shuffle_mask))]>;
-def VMRGLB : VXForm_1<268, (outs VRRC:$vD), (ins VRRC:$vA, VRRC:$vB),
- "vmrglb $vD, $vA, $vB", VecFP,
- [(set VRRC:$vD, (vector_shuffle (v16i8 VRRC:$vA),
- VRRC:$vB, VMRGLB_shuffle_mask))]>;
-def VMRGLH : VXForm_1<332, (outs VRRC:$vD), (ins VRRC:$vA, VRRC:$vB),
- "vmrglh $vD, $vA, $vB", VecFP,
- [(set VRRC:$vD, (vector_shuffle (v16i8 VRRC:$vA),
- VRRC:$vB, VMRGLH_shuffle_mask))]>;
-def VMRGLW : VXForm_1<396, (outs VRRC:$vD), (ins VRRC:$vA, VRRC:$vB),
- "vmrglw $vD, $vA, $vB", VecFP,
- [(set VRRC:$vD, (vector_shuffle (v16i8 VRRC:$vA),
- VRRC:$vB, VMRGLW_shuffle_mask))]>;
-
-def VMSUMMBM : VA1a_Int<37, "vmsummbm", int_ppc_altivec_vmsummbm>;
-def VMSUMSHM : VA1a_Int<40, "vmsumshm", int_ppc_altivec_vmsumshm>;
-def VMSUMSHS : VA1a_Int<41, "vmsumshs", int_ppc_altivec_vmsumshs>;
-def VMSUMUBM : VA1a_Int<36, "vmsumubm", int_ppc_altivec_vmsumubm>;
-def VMSUMUHM : VA1a_Int<38, "vmsumuhm", int_ppc_altivec_vmsumuhm>;
-def VMSUMUHS : VA1a_Int<39, "vmsumuhs", int_ppc_altivec_vmsumuhs>;
-
-def VMULESB : VX1_Int<776, "vmulesb", int_ppc_altivec_vmulesb>;
-def VMULESH : VX1_Int<840, "vmulesh", int_ppc_altivec_vmulesh>;
-def VMULEUB : VX1_Int<520, "vmuleub", int_ppc_altivec_vmuleub>;
-def VMULEUH : VX1_Int<584, "vmuleuh", int_ppc_altivec_vmuleuh>;
-def VMULOSB : VX1_Int<264, "vmulosb", int_ppc_altivec_vmulosb>;
-def VMULOSH : VX1_Int<328, "vmulosh", int_ppc_altivec_vmulosh>;
-def VMULOUB : VX1_Int< 8, "vmuloub", int_ppc_altivec_vmuloub>;
-def VMULOUH : VX1_Int< 72, "vmulouh", int_ppc_altivec_vmulouh>;
-
-def VREFP : VX2_Int<266, "vrefp", int_ppc_altivec_vrefp>;
-def VRFIM : VX2_Int<714, "vrfim", int_ppc_altivec_vrfim>;
-def VRFIN : VX2_Int<522, "vrfin", int_ppc_altivec_vrfin>;
-def VRFIP : VX2_Int<650, "vrfip", int_ppc_altivec_vrfip>;
-def VRFIZ : VX2_Int<586, "vrfiz", int_ppc_altivec_vrfiz>;
-def VRSQRTEFP : VX2_Int<330, "vrsqrtefp", int_ppc_altivec_vrsqrtefp>;
-
-def VSUBCUW : VX1_Int<74, "vsubcuw", int_ppc_altivec_vsubcuw>;
-
-def VSUBFP : VXForm_1<74, (outs VRRC:$vD), (ins VRRC:$vA, VRRC:$vB),
- "vsubfp $vD, $vA, $vB", VecGeneral,
- [(set VRRC:$vD, (fsub VRRC:$vA, VRRC:$vB))]>;
-def VSUBUBM : VXForm_1<1024, (outs VRRC:$vD), (ins VRRC:$vA, VRRC:$vB),
- "vsububm $vD, $vA, $vB", VecGeneral,
- [(set VRRC:$vD, (sub (v16i8 VRRC:$vA), VRRC:$vB))]>;
-def VSUBUHM : VXForm_1<1088, (outs VRRC:$vD), (ins VRRC:$vA, VRRC:$vB),
- "vsubuhm $vD, $vA, $vB", VecGeneral,
- [(set VRRC:$vD, (sub (v8i16 VRRC:$vA), VRRC:$vB))]>;
-def VSUBUWM : VXForm_1<1152, (outs VRRC:$vD), (ins VRRC:$vA, VRRC:$vB),
- "vsubuwm $vD, $vA, $vB", VecGeneral,
- [(set VRRC:$vD, (sub (v4i32 VRRC:$vA), VRRC:$vB))]>;
-
-def VSUBSBS : VX1_Int<1792, "vsubsbs" , int_ppc_altivec_vsubsbs>;
-def VSUBSHS : VX1_Int<1856, "vsubshs" , int_ppc_altivec_vsubshs>;
-def VSUBSWS : VX1_Int<1920, "vsubsws" , int_ppc_altivec_vsubsws>;
-def VSUBUBS : VX1_Int<1536, "vsububs" , int_ppc_altivec_vsububs>;
-def VSUBUHS : VX1_Int<1600, "vsubuhs" , int_ppc_altivec_vsubuhs>;
-def VSUBUWS : VX1_Int<1664, "vsubuws" , int_ppc_altivec_vsubuws>;
-def VSUMSWS : VX1_Int<1928, "vsumsws" , int_ppc_altivec_vsumsws>;
-def VSUM2SWS: VX1_Int<1672, "vsum2sws", int_ppc_altivec_vsum2sws>;
-def VSUM4SBS: VX1_Int<1672, "vsum4sbs", int_ppc_altivec_vsum4sbs>;
-def VSUM4SHS: VX1_Int<1608, "vsum4shs", int_ppc_altivec_vsum4shs>;
-def VSUM4UBS: VX1_Int<1544, "vsum4ubs", int_ppc_altivec_vsum4ubs>;
-
-def VNOR : VXForm_1<1284, (outs VRRC:$vD), (ins VRRC:$vA, VRRC:$vB),
- "vnor $vD, $vA, $vB", VecFP,
- [(set VRRC:$vD, (vnot (or (v4i32 VRRC:$vA), VRRC:$vB)))]>;
-def VOR : VXForm_1<1156, (outs VRRC:$vD), (ins VRRC:$vA, VRRC:$vB),
- "vor $vD, $vA, $vB", VecFP,
- [(set VRRC:$vD, (or (v4i32 VRRC:$vA), VRRC:$vB))]>;
-def VXOR : VXForm_1<1220, (outs VRRC:$vD), (ins VRRC:$vA, VRRC:$vB),
- "vxor $vD, $vA, $vB", VecFP,
- [(set VRRC:$vD, (xor (v4i32 VRRC:$vA), VRRC:$vB))]>;
-
-def VRLB : VX1_Int< 4, "vrlb", int_ppc_altivec_vrlb>;
-def VRLH : VX1_Int< 68, "vrlh", int_ppc_altivec_vrlh>;
-def VRLW : VX1_Int< 132, "vrlw", int_ppc_altivec_vrlw>;
-
-def VSL : VX1_Int< 452, "vsl" , int_ppc_altivec_vsl >;
-def VSLO : VX1_Int<1036, "vslo", int_ppc_altivec_vslo>;
-def VSLB : VX1_Int< 260, "vslb", int_ppc_altivec_vslb>;
-def VSLH : VX1_Int< 324, "vslh", int_ppc_altivec_vslh>;
-def VSLW : VX1_Int< 388, "vslw", int_ppc_altivec_vslw>;
-
-def VSPLTB : VXForm_1<524, (outs VRRC:$vD), (ins u5imm:$UIMM, VRRC:$vB),
- "vspltb $vD, $vB, $UIMM", VecPerm,
- [(set VRRC:$vD, (vector_shuffle (v16i8 VRRC:$vB), (undef),
- VSPLTB_shuffle_mask:$UIMM))]>;
-def VSPLTH : VXForm_1<588, (outs VRRC:$vD), (ins u5imm:$UIMM, VRRC:$vB),
- "vsplth $vD, $vB, $UIMM", VecPerm,
- [(set VRRC:$vD, (vector_shuffle (v16i8 VRRC:$vB), (undef),
- VSPLTH_shuffle_mask:$UIMM))]>;
-def VSPLTW : VXForm_1<652, (outs VRRC:$vD), (ins u5imm:$UIMM, VRRC:$vB),
- "vspltw $vD, $vB, $UIMM", VecPerm,
- [(set VRRC:$vD, (vector_shuffle (v16i8 VRRC:$vB), (undef),
- VSPLTW_shuffle_mask:$UIMM))]>;
-
-def VSR : VX1_Int< 708, "vsr" , int_ppc_altivec_vsr>;
-def VSRO : VX1_Int<1100, "vsro" , int_ppc_altivec_vsro>;
-def VSRAB : VX1_Int< 772, "vsrab", int_ppc_altivec_vsrab>;
-def VSRAH : VX1_Int< 836, "vsrah", int_ppc_altivec_vsrah>;
-def VSRAW : VX1_Int< 900, "vsraw", int_ppc_altivec_vsraw>;
-def VSRB : VX1_Int< 516, "vsrb" , int_ppc_altivec_vsrb>;
-def VSRH : VX1_Int< 580, "vsrh" , int_ppc_altivec_vsrh>;
-def VSRW : VX1_Int< 644, "vsrw" , int_ppc_altivec_vsrw>;
-
-
-def VSPLTISB : VXForm_3<780, (outs VRRC:$vD), (ins s5imm:$SIMM),
- "vspltisb $vD, $SIMM", VecPerm,
- [(set VRRC:$vD, (v16i8 vecspltisb:$SIMM))]>;
-def VSPLTISH : VXForm_3<844, (outs VRRC:$vD), (ins s5imm:$SIMM),
- "vspltish $vD, $SIMM", VecPerm,
- [(set VRRC:$vD, (v8i16 vecspltish:$SIMM))]>;
-def VSPLTISW : VXForm_3<908, (outs VRRC:$vD), (ins s5imm:$SIMM),
- "vspltisw $vD, $SIMM", VecPerm,
- [(set VRRC:$vD, (v4i32 vecspltisw:$SIMM))]>;
-
-// Vector Pack.
-def VPKPX : VX1_Int<782, "vpkpx", int_ppc_altivec_vpkpx>;
-def VPKSHSS : VX1_Int<398, "vpkshss", int_ppc_altivec_vpkshss>;
-def VPKSHUS : VX1_Int<270, "vpkshus", int_ppc_altivec_vpkshus>;
-def VPKSWSS : VX1_Int<462, "vpkswss", int_ppc_altivec_vpkswss>;
-def VPKSWUS : VX1_Int<334, "vpkswus", int_ppc_altivec_vpkswus>;
-def VPKUHUM : VXForm_1<14, (outs VRRC:$vD), (ins VRRC:$vA, VRRC:$vB),
- "vpkuhum $vD, $vA, $vB", VecFP,
- [(set VRRC:$vD, (vector_shuffle (v16i8 VRRC:$vA),
- VRRC:$vB, VPKUHUM_shuffle_mask))]>;
-def VPKUHUS : VX1_Int<142, "vpkuhus", int_ppc_altivec_vpkuhus>;
-def VPKUWUM : VXForm_1<78, (outs VRRC:$vD), (ins VRRC:$vA, VRRC:$vB),
- "vpkuwum $vD, $vA, $vB", VecFP,
- [(set VRRC:$vD, (vector_shuffle (v16i8 VRRC:$vA),
- VRRC:$vB, VPKUWUM_shuffle_mask))]>;
-def VPKUWUS : VX1_Int<206, "vpkuwus", int_ppc_altivec_vpkuwus>;
-
-// Vector Unpack.
-def VUPKHPX : VX2_Int<846, "vupkhpx", int_ppc_altivec_vupkhpx>;
-def VUPKHSB : VX2_Int<526, "vupkhsb", int_ppc_altivec_vupkhsb>;
-def VUPKHSH : VX2_Int<590, "vupkhsh", int_ppc_altivec_vupkhsh>;
-def VUPKLPX : VX2_Int<974, "vupklpx", int_ppc_altivec_vupklpx>;
-def VUPKLSB : VX2_Int<654, "vupklsb", int_ppc_altivec_vupklsb>;
-def VUPKLSH : VX2_Int<718, "vupklsh", int_ppc_altivec_vupklsh>;
-
-
-// Altivec Comparisons.
-
-class VCMP<bits<10> xo, string asmstr, ValueType Ty>
- : VXRForm_1<xo, (outs VRRC:$vD), (ins VRRC:$vA, VRRC:$vB),asmstr,VecFPCompare,
- [(set VRRC:$vD, (Ty (PPCvcmp VRRC:$vA, VRRC:$vB, xo)))]>;
-class VCMPo<bits<10> xo, string asmstr, ValueType Ty>
- : VXRForm_1<xo, (outs VRRC:$vD), (ins VRRC:$vA, VRRC:$vB),asmstr,VecFPCompare,
- [(set VRRC:$vD, (Ty (PPCvcmp_o VRRC:$vA, VRRC:$vB, xo)))]> {
- let Defs = [CR6];
- let RC = 1;
-}
-
-// f32 element comparisons.0
-def VCMPBFP : VCMP <966, "vcmpbfp $vD, $vA, $vB" , v4f32>;
-def VCMPBFPo : VCMPo<966, "vcmpbfp. $vD, $vA, $vB" , v4f32>;
-def VCMPEQFP : VCMP <198, "vcmpeqfp $vD, $vA, $vB" , v4f32>;
-def VCMPEQFPo : VCMPo<198, "vcmpeqfp. $vD, $vA, $vB", v4f32>;
-def VCMPGEFP : VCMP <454, "vcmpgefp $vD, $vA, $vB" , v4f32>;
-def VCMPGEFPo : VCMPo<454, "vcmpgefp. $vD, $vA, $vB", v4f32>;
-def VCMPGTFP : VCMP <710, "vcmpgtfp $vD, $vA, $vB" , v4f32>;
-def VCMPGTFPo : VCMPo<710, "vcmpgtfp. $vD, $vA, $vB", v4f32>;
-
-// i8 element comparisons.
-def VCMPEQUB : VCMP < 6, "vcmpequb $vD, $vA, $vB" , v16i8>;
-def VCMPEQUBo : VCMPo< 6, "vcmpequb. $vD, $vA, $vB", v16i8>;
-def VCMPGTSB : VCMP <774, "vcmpgtsb $vD, $vA, $vB" , v16i8>;
-def VCMPGTSBo : VCMPo<774, "vcmpgtsb. $vD, $vA, $vB", v16i8>;
-def VCMPGTUB : VCMP <518, "vcmpgtub $vD, $vA, $vB" , v16i8>;
-def VCMPGTUBo : VCMPo<518, "vcmpgtub. $vD, $vA, $vB", v16i8>;
-
-// i16 element comparisons.
-def VCMPEQUH : VCMP < 70, "vcmpequh $vD, $vA, $vB" , v8i16>;
-def VCMPEQUHo : VCMPo< 70, "vcmpequh. $vD, $vA, $vB", v8i16>;
-def VCMPGTSH : VCMP <838, "vcmpgtsh $vD, $vA, $vB" , v8i16>;
-def VCMPGTSHo : VCMPo<838, "vcmpgtsh. $vD, $vA, $vB", v8i16>;
-def VCMPGTUH : VCMP <582, "vcmpgtuh $vD, $vA, $vB" , v8i16>;
-def VCMPGTUHo : VCMPo<582, "vcmpgtuh. $vD, $vA, $vB", v8i16>;
-
-// i32 element comparisons.
-def VCMPEQUW : VCMP <134, "vcmpequw $vD, $vA, $vB" , v4i32>;
-def VCMPEQUWo : VCMPo<134, "vcmpequw. $vD, $vA, $vB", v4i32>;
-def VCMPGTSW : VCMP <902, "vcmpgtsw $vD, $vA, $vB" , v4i32>;
-def VCMPGTSWo : VCMPo<902, "vcmpgtsw. $vD, $vA, $vB", v4i32>;
-def VCMPGTUW : VCMP <646, "vcmpgtuw $vD, $vA, $vB" , v4i32>;
-def VCMPGTUWo : VCMPo<646, "vcmpgtuw. $vD, $vA, $vB", v4i32>;
-
-def V_SET0 : VXForm_setzero<1220, (outs VRRC:$vD), (ins),
- "vxor $vD, $vD, $vD", VecFP,
- [(set VRRC:$vD, (v4i32 immAllZerosV))]>;
-}
-
-//===----------------------------------------------------------------------===//
-// Additional Altivec Patterns
-//
-
-// DS* intrinsics
-def : Pat<(int_ppc_altivec_dssall), (DSSALL 1, 0, 0, 0)>;
-def : Pat<(int_ppc_altivec_dss imm:$STRM), (DSS 0, imm:$STRM, 0, 0)>;
-
-// * 32-bit
-def : Pat<(int_ppc_altivec_dst GPRC:$rA, GPRC:$rB, imm:$STRM),
- (DST 0, imm:$STRM, GPRC:$rA, GPRC:$rB)>;
-def : Pat<(int_ppc_altivec_dstt GPRC:$rA, GPRC:$rB, imm:$STRM),
- (DSTT 1, imm:$STRM, GPRC:$rA, GPRC:$rB)>;
-def : Pat<(int_ppc_altivec_dstst GPRC:$rA, GPRC:$rB, imm:$STRM),
- (DSTST 0, imm:$STRM, GPRC:$rA, GPRC:$rB)>;
-def : Pat<(int_ppc_altivec_dststt GPRC:$rA, GPRC:$rB, imm:$STRM),
- (DSTSTT 1, imm:$STRM, GPRC:$rA, GPRC:$rB)>;
-
-// * 64-bit
-def : Pat<(int_ppc_altivec_dst G8RC:$rA, GPRC:$rB, imm:$STRM),
- (DST64 0, imm:$STRM, (i64 G8RC:$rA), GPRC:$rB)>;
-def : Pat<(int_ppc_altivec_dstt G8RC:$rA, GPRC:$rB, imm:$STRM),
- (DSTT64 1, imm:$STRM, (i64 G8RC:$rA), GPRC:$rB)>;
-def : Pat<(int_ppc_altivec_dstst G8RC:$rA, GPRC:$rB, imm:$STRM),
- (DSTST64 0, imm:$STRM, (i64 G8RC:$rA), GPRC:$rB)>;
-def : Pat<(int_ppc_altivec_dststt G8RC:$rA, GPRC:$rB, imm:$STRM),
- (DSTSTT64 1, imm:$STRM, (i64 G8RC:$rA), GPRC:$rB)>;
-
-// Loads.
-def : Pat<(v4i32 (load xoaddr:$src)), (LVX xoaddr:$src)>;
-
-// Stores.
-def : Pat<(store (v4i32 VRRC:$rS), xoaddr:$dst),
- (STVX (v4i32 VRRC:$rS), xoaddr:$dst)>;
-
-// Bit conversions.
-def : Pat<(v16i8 (bitconvert (v8i16 VRRC:$src))), (v16i8 VRRC:$src)>;
-def : Pat<(v16i8 (bitconvert (v4i32 VRRC:$src))), (v16i8 VRRC:$src)>;
-def : Pat<(v16i8 (bitconvert (v4f32 VRRC:$src))), (v16i8 VRRC:$src)>;
-
-def : Pat<(v8i16 (bitconvert (v16i8 VRRC:$src))), (v8i16 VRRC:$src)>;
-def : Pat<(v8i16 (bitconvert (v4i32 VRRC:$src))), (v8i16 VRRC:$src)>;
-def : Pat<(v8i16 (bitconvert (v4f32 VRRC:$src))), (v8i16 VRRC:$src)>;
-
-def : Pat<(v4i32 (bitconvert (v16i8 VRRC:$src))), (v4i32 VRRC:$src)>;
-def : Pat<(v4i32 (bitconvert (v8i16 VRRC:$src))), (v4i32 VRRC:$src)>;
-def : Pat<(v4i32 (bitconvert (v4f32 VRRC:$src))), (v4i32 VRRC:$src)>;
-
-def : Pat<(v4f32 (bitconvert (v16i8 VRRC:$src))), (v4f32 VRRC:$src)>;
-def : Pat<(v4f32 (bitconvert (v8i16 VRRC:$src))), (v4f32 VRRC:$src)>;
-def : Pat<(v4f32 (bitconvert (v4i32 VRRC:$src))), (v4f32 VRRC:$src)>;
-
-// Shuffles.
-
-// Match vsldoi(x,x), vpkuwum(x,x), vpkuhum(x,x)
-def:Pat<(vector_shuffle (v16i8 VRRC:$vA), undef, VSLDOI_unary_shuffle_mask:$in),
- (VSLDOI VRRC:$vA, VRRC:$vA, VSLDOI_unary_shuffle_mask:$in)>;
-def:Pat<(vector_shuffle (v16i8 VRRC:$vA), undef,VPKUWUM_unary_shuffle_mask:$in),
- (VPKUWUM VRRC:$vA, VRRC:$vA)>;
-def:Pat<(vector_shuffle (v16i8 VRRC:$vA), undef,VPKUHUM_unary_shuffle_mask:$in),
- (VPKUHUM VRRC:$vA, VRRC:$vA)>;
-
-// Match vmrg*(x,x)
-def:Pat<(vector_shuffle (v16i8 VRRC:$vA), undef, VMRGLB_unary_shuffle_mask:$in),
- (VMRGLB VRRC:$vA, VRRC:$vA)>;
-def:Pat<(vector_shuffle (v16i8 VRRC:$vA), undef, VMRGLH_unary_shuffle_mask:$in),
- (VMRGLH VRRC:$vA, VRRC:$vA)>;
-def:Pat<(vector_shuffle (v16i8 VRRC:$vA), undef, VMRGLW_unary_shuffle_mask:$in),
- (VMRGLW VRRC:$vA, VRRC:$vA)>;
-def:Pat<(vector_shuffle (v16i8 VRRC:$vA), undef, VMRGHB_unary_shuffle_mask:$in),
- (VMRGHB VRRC:$vA, VRRC:$vA)>;
-def:Pat<(vector_shuffle (v16i8 VRRC:$vA), undef, VMRGHH_unary_shuffle_mask:$in),
- (VMRGHH VRRC:$vA, VRRC:$vA)>;
-def:Pat<(vector_shuffle (v16i8 VRRC:$vA), undef, VMRGHW_unary_shuffle_mask:$in),
- (VMRGHW VRRC:$vA, VRRC:$vA)>;
-
-// Logical Operations
-def : Pat<(v4i32 (vnot VRRC:$vA)), (VNOR VRRC:$vA, VRRC:$vA)>;
-def : Pat<(v4i32 (vnot_conv VRRC:$vA)), (VNOR VRRC:$vA, VRRC:$vA)>;
-
-def : Pat<(v4i32 (vnot_conv (or VRRC:$A, VRRC:$B))),
- (VNOR VRRC:$A, VRRC:$B)>;
-def : Pat<(v4i32 (and VRRC:$A, (vnot_conv VRRC:$B))),
- (VANDC VRRC:$A, VRRC:$B)>;
-
-def : Pat<(fmul VRRC:$vA, VRRC:$vB),
- (VMADDFP VRRC:$vA, VRRC:$vB, (v4i32 (V_SET0)))>;
-
-// Fused multiply add and multiply sub for packed float. These are represented
-// separately from the real instructions above, for operations that must have
-// the additional precision, such as Newton-Rhapson (used by divide, sqrt)
-def : Pat<(PPCvmaddfp VRRC:$A, VRRC:$B, VRRC:$C),
- (VMADDFP VRRC:$A, VRRC:$B, VRRC:$C)>;
-def : Pat<(PPCvnmsubfp VRRC:$A, VRRC:$B, VRRC:$C),
- (VNMSUBFP VRRC:$A, VRRC:$B, VRRC:$C)>;
-
-def : Pat<(int_ppc_altivec_vmaddfp VRRC:$A, VRRC:$B, VRRC:$C),
- (VMADDFP VRRC:$A, VRRC:$B, VRRC:$C)>;
-def : Pat<(int_ppc_altivec_vnmsubfp VRRC:$A, VRRC:$B, VRRC:$C),
- (VNMSUBFP VRRC:$A, VRRC:$B, VRRC:$C)>;
-
-def : Pat<(PPCvperm (v16i8 VRRC:$vA), VRRC:$vB, VRRC:$vC),
- (VPERM VRRC:$vA, VRRC:$vB, VRRC:$vC)>;
diff --git a/release_23/lib/Target/PowerPC/PPCInstrBuilder.h b/release_23/lib/Target/PowerPC/PPCInstrBuilder.h
deleted file mode 100644
index edb5103875d4..000000000000
--- a/release_23/lib/Target/PowerPC/PPCInstrBuilder.h
+++ /dev/null
@@ -1,55 +0,0 @@
-//===-- PPCInstrBuilder.h - Aides for building PPC insts --------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file exposes functions that may be used with BuildMI from the
-// MachineInstrBuilder.h file to simplify generating frame and constant pool
-// references.
-//
-// For reference, the order of operands for memory references is:
-// (Operand), Dest Reg, Base Reg, and either Reg Index or Immediate
-// Displacement.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef POWERPC_INSTRBUILDER_H
-#define POWERPC_INSTRBUILDER_H
-
-#include "llvm/CodeGen/MachineInstrBuilder.h"
-
-namespace llvm {
-
-/// addFrameReference - This function is used to add a reference to the base of
-/// an abstract object on the stack frame of the current function. This
-/// reference has base register as the FrameIndex offset until it is resolved.
-/// This allows a constant offset to be specified as well...
-///
-inline const MachineInstrBuilder&
-addFrameReference(const MachineInstrBuilder &MIB, int FI, int Offset = 0,
- bool mem = true) {
- if (mem)
- return MIB.addImm(Offset).addFrameIndex(FI);
- else
- return MIB.addFrameIndex(FI).addImm(Offset);
-}
-
-/// addConstantPoolReference - This function is used to add a reference to the
-/// base of a constant value spilled to the per-function constant pool. The
-/// reference has base register ConstantPoolIndex offset which is retained until
-/// either machine code emission or assembly output. This allows an optional
-/// offset to be added as well.
-///
-inline const MachineInstrBuilder&
-addConstantPoolReference(const MachineInstrBuilder &MIB, unsigned CPI,
- int Offset = 0) {
- return MIB.addImm(Offset).addConstantPoolIndex(CPI);
-}
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/lib/Target/PowerPC/PPCInstrFormats.td b/release_23/lib/Target/PowerPC/PPCInstrFormats.td
deleted file mode 100644
index 0355d950ded7..000000000000
--- a/release_23/lib/Target/PowerPC/PPCInstrFormats.td
+++ /dev/null
@@ -1,853 +0,0 @@
-//===- PowerPCInstrFormats.td - PowerPC Instruction Formats --*- tablegen -*-=//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-//===----------------------------------------------------------------------===//
-//
-// PowerPC instruction formats
-
-class I<bits<6> opcode, dag OOL, dag IOL, string asmstr, InstrItinClass itin>
- : Instruction {
- field bits<32> Inst;
-
- bit PPC64 = 0; // Default value, override with isPPC64
-
- let Namespace = "PPC";
- let Inst{0-5} = opcode;
- let OutOperandList = OOL;
- let InOperandList = IOL;
- let AsmString = asmstr;
- let Itinerary = itin;
-
- /// These fields correspond to the fields in PPCInstrInfo.h. Any changes to
- /// these must be reflected there! See comments there for what these are.
- bits<1> PPC970_First = 0;
- bits<1> PPC970_Single = 0;
- bits<1> PPC970_Cracked = 0;
- bits<3> PPC970_Unit = 0;
-}
-
-class PPC970_DGroup_First { bits<1> PPC970_First = 1; }
-class PPC970_DGroup_Single { bits<1> PPC970_Single = 1; }
-class PPC970_DGroup_Cracked { bits<1> PPC970_Cracked = 1; }
-class PPC970_MicroCode;
-
-class PPC970_Unit_Pseudo { bits<3> PPC970_Unit = 0; }
-class PPC970_Unit_FXU { bits<3> PPC970_Unit = 1; }
-class PPC970_Unit_LSU { bits<3> PPC970_Unit = 2; }
-class PPC970_Unit_FPU { bits<3> PPC970_Unit = 3; }
-class PPC970_Unit_CRU { bits<3> PPC970_Unit = 4; }
-class PPC970_Unit_VALU { bits<3> PPC970_Unit = 5; }
-class PPC970_Unit_VPERM { bits<3> PPC970_Unit = 6; }
-class PPC970_Unit_BRU { bits<3> PPC970_Unit = 7; }
-
-
-// 1.7.1 I-Form
-class IForm<bits<6> opcode, bit aa, bit lk, dag OOL, dag IOL, string asmstr,
- InstrItinClass itin, list<dag> pattern>
- : I<opcode, OOL, IOL, asmstr, itin> {
- let Pattern = pattern;
- bits<24> LI;
-
- let Inst{6-29} = LI;
- let Inst{30} = aa;
- let Inst{31} = lk;
-}
-
-// 1.7.2 B-Form
-class BForm<bits<6> opcode, bit aa, bit lk, dag OOL, dag IOL, string asmstr>
- : I<opcode, OOL, IOL, asmstr, BrB> {
- bits<7> BIBO; // 2 bits of BI and 5 bits of BO.
- bits<3> CR;
- bits<14> BD;
-
- bits<5> BI;
- let BI{0-1} = BIBO{5-6};
- let BI{2-4} = CR{0-2};
-
- let Inst{6-10} = BIBO{4-0};
- let Inst{11-15} = BI;
- let Inst{16-29} = BD;
- let Inst{30} = aa;
- let Inst{31} = lk;
-}
-
-
-// 1.7.4 D-Form
-class DForm_base<bits<6> opcode, dag OOL, dag IOL, string asmstr,
- InstrItinClass itin, list<dag> pattern>
- : I<opcode, OOL, IOL, asmstr, itin> {
- bits<5> A;
- bits<5> B;
- bits<16> C;
-
- let Pattern = pattern;
-
- let Inst{6-10} = A;
- let Inst{11-15} = B;
- let Inst{16-31} = C;
-}
-
-class DForm_1<bits<6> opcode, dag OOL, dag IOL, string asmstr,
- InstrItinClass itin, list<dag> pattern>
- : I<opcode, OOL, IOL, asmstr, itin> {
- bits<5> A;
- bits<16> C;
- bits<5> B;
-
- let Pattern = pattern;
-
- let Inst{6-10} = A;
- let Inst{11-15} = B;
- let Inst{16-31} = C;
-}
-
-class DForm_2<bits<6> opcode, dag OOL, dag IOL, string asmstr,
- InstrItinClass itin, list<dag> pattern>
- : DForm_base<opcode, OOL, IOL, asmstr, itin, pattern>;
-
-class DForm_2_r0<bits<6> opcode, dag OOL, dag IOL, string asmstr,
- InstrItinClass itin, list<dag> pattern>
- : I<opcode, OOL, IOL, asmstr, itin> {
- bits<5> A;
- bits<16> B;
-
- let Pattern = pattern;
-
- let Inst{6-10} = A;
- let Inst{11-15} = 0;
- let Inst{16-31} = B;
-}
-
-class DForm_4<bits<6> opcode, dag OOL, dag IOL, string asmstr,
- InstrItinClass itin, list<dag> pattern>
- : I<opcode, OOL, IOL, asmstr, itin> {
- bits<5> B;
- bits<5> A;
- bits<16> C;
-
- let Pattern = pattern;
-
- let Inst{6-10} = A;
- let Inst{11-15} = B;
- let Inst{16-31} = C;
-}
-
-class DForm_4_zero<bits<6> opcode, dag OOL, dag IOL, string asmstr,
- InstrItinClass itin, list<dag> pattern>
- : DForm_1<opcode, OOL, IOL, asmstr, itin, pattern> {
- let A = 0;
- let B = 0;
- let C = 0;
-}
-
-class DForm_5<bits<6> opcode, dag OOL, dag IOL, string asmstr,
- InstrItinClass itin>
- : I<opcode, OOL, IOL, asmstr, itin> {
- bits<3> BF;
- bits<1> L;
- bits<5> RA;
- bits<16> I;
-
- let Inst{6-8} = BF;
- let Inst{9} = 0;
- let Inst{10} = L;
- let Inst{11-15} = RA;
- let Inst{16-31} = I;
-}
-
-class DForm_5_ext<bits<6> opcode, dag OOL, dag IOL, string asmstr,
- InstrItinClass itin>
- : DForm_5<opcode, OOL, IOL, asmstr, itin> {
- let L = PPC64;
-}
-
-class DForm_6<bits<6> opcode, dag OOL, dag IOL, string asmstr,
- InstrItinClass itin>
- : DForm_5<opcode, OOL, IOL, asmstr, itin>;
-
-class DForm_6_ext<bits<6> opcode, dag OOL, dag IOL, string asmstr,
- InstrItinClass itin>
- : DForm_6<opcode, OOL, IOL, asmstr, itin> {
- let L = PPC64;
-}
-
-
-// 1.7.5 DS-Form
-class DSForm_1<bits<6> opcode, bits<2> xo, dag OOL, dag IOL, string asmstr,
- InstrItinClass itin, list<dag> pattern>
- : I<opcode, OOL, IOL, asmstr, itin> {
- bits<5> RST;
- bits<14> DS;
- bits<5> RA;
-
- let Pattern = pattern;
-
- let Inst{6-10} = RST;
- let Inst{11-15} = RA;
- let Inst{16-29} = DS;
- let Inst{30-31} = xo;
-}
-
-// 1.7.6 X-Form
-class XForm_base_r3xo<bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
- InstrItinClass itin, list<dag> pattern>
- : I<opcode, OOL, IOL, asmstr, itin> {
- bits<5> RST;
- bits<5> A;
- bits<5> B;
-
- let Pattern = pattern;
-
- bit RC = 0; // set by isDOT
-
- let Inst{6-10} = RST;
- let Inst{11-15} = A;
- let Inst{16-20} = B;
- let Inst{21-30} = xo;
- let Inst{31} = RC;
-}
-
-// This is the same as XForm_base_r3xo, but the first two operands are swapped
-// when code is emitted.
-class XForm_base_r3xo_swapped
- <bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
- InstrItinClass itin>
- : I<opcode, OOL, IOL, asmstr, itin> {
- bits<5> A;
- bits<5> RST;
- bits<5> B;
-
- bit RC = 0; // set by isDOT
-
- let Inst{6-10} = RST;
- let Inst{11-15} = A;
- let Inst{16-20} = B;
- let Inst{21-30} = xo;
- let Inst{31} = RC;
-}
-
-
-class XForm_1<bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
- InstrItinClass itin, list<dag> pattern>
- : XForm_base_r3xo<opcode, xo, OOL, IOL, asmstr, itin, pattern>;
-
-class XForm_6<bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
- InstrItinClass itin, list<dag> pattern>
- : XForm_base_r3xo_swapped<opcode, xo, OOL, IOL, asmstr, itin> {
- let Pattern = pattern;
-}
-
-class XForm_8<bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
- InstrItinClass itin, list<dag> pattern>
- : XForm_base_r3xo<opcode, xo, OOL, IOL, asmstr, itin, pattern>;
-
-class XForm_10<bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
- InstrItinClass itin, list<dag> pattern>
- : XForm_base_r3xo_swapped<opcode, xo, OOL, IOL, asmstr, itin> {
- let Pattern = pattern;
-}
-
-class XForm_11<bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
- InstrItinClass itin, list<dag> pattern>
- : XForm_base_r3xo_swapped<opcode, xo, OOL, IOL, asmstr, itin> {
- let B = 0;
- let Pattern = pattern;
-}
-
-class XForm_16<bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
- InstrItinClass itin>
- : I<opcode, OOL, IOL, asmstr, itin> {
- bits<3> BF;
- bits<1> L;
- bits<5> RA;
- bits<5> RB;
-
- let Inst{6-8} = BF;
- let Inst{9} = 0;
- let Inst{10} = L;
- let Inst{11-15} = RA;
- let Inst{16-20} = RB;
- let Inst{21-30} = xo;
- let Inst{31} = 0;
-}
-
-class XForm_16_ext<bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
- InstrItinClass itin>
- : XForm_16<opcode, xo, OOL, IOL, asmstr, itin> {
- let L = PPC64;
-}
-
-class XForm_17<bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
- InstrItinClass itin>
- : I<opcode, OOL, IOL, asmstr, itin> {
- bits<3> BF;
- bits<5> FRA;
- bits<5> FRB;
-
- let Inst{6-8} = BF;
- let Inst{9-10} = 0;
- let Inst{11-15} = FRA;
- let Inst{16-20} = FRB;
- let Inst{21-30} = xo;
- let Inst{31} = 0;
-}
-
-class XForm_25<bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
- InstrItinClass itin, list<dag> pattern>
- : XForm_base_r3xo<opcode, xo, OOL, IOL, asmstr, itin, pattern> {
-}
-
-class XForm_26<bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
- InstrItinClass itin, list<dag> pattern>
- : XForm_base_r3xo<opcode, xo, OOL, IOL, asmstr, itin, pattern> {
- let A = 0;
-}
-
-class XForm_28<bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
- InstrItinClass itin, list<dag> pattern>
- : XForm_base_r3xo<opcode, xo, OOL, IOL, asmstr, itin, pattern> {
-}
-
-// This is used for MFFS, MTFSB0, MTFSB1. 42 is arbitrary; this series of
-// numbers presumably relates to some document, but I haven't found it.
-class XForm_42<bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
- InstrItinClass itin, list<dag> pattern>
- : XForm_base_r3xo<opcode, xo, OOL, IOL, asmstr, itin, pattern> {
- let Pattern = pattern;
-
- bit RC = 0; // set by isDOT
-
- let Inst{6-10} = RST;
- let Inst{11-20} = 0;
- let Inst{21-30} = xo;
- let Inst{31} = RC;
-}
-class XForm_43<bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
- InstrItinClass itin, list<dag> pattern>
- : XForm_base_r3xo<opcode, xo, OOL, IOL, asmstr, itin, pattern> {
- let Pattern = pattern;
- bits<5> FM;
-
- bit RC = 0; // set by isDOT
-
- let Inst{6-10} = FM;
- let Inst{11-20} = 0;
- let Inst{21-30} = xo;
- let Inst{31} = RC;
-}
-
-// DCB_Form - Form X instruction, used for dcb* instructions.
-class DCB_Form<bits<10> xo, bits<5> immfield, dag OOL, dag IOL, string asmstr,
- InstrItinClass itin, list<dag> pattern>
- : I<31, OOL, IOL, asmstr, itin> {
- bits<5> A;
- bits<5> B;
-
- let Pattern = pattern;
-
- let Inst{6-10} = immfield;
- let Inst{11-15} = A;
- let Inst{16-20} = B;
- let Inst{21-30} = xo;
- let Inst{31} = 0;
-}
-
-
-// DSS_Form - Form X instruction, used for altivec dss* instructions.
-class DSS_Form<bits<10> xo, dag OOL, dag IOL, string asmstr,
- InstrItinClass itin, list<dag> pattern>
- : I<31, OOL, IOL, asmstr, itin> {
- bits<1> T;
- bits<2> STRM;
- bits<5> A;
- bits<5> B;
-
- let Pattern = pattern;
-
- let Inst{6} = T;
- let Inst{7-8} = 0;
- let Inst{9-10} = STRM;
- let Inst{11-15} = A;
- let Inst{16-20} = B;
- let Inst{21-30} = xo;
- let Inst{31} = 0;
-}
-
-// 1.7.7 XL-Form
-class XLForm_1<bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
- InstrItinClass itin, list<dag> pattern>
- : I<opcode, OOL, IOL, asmstr, itin> {
- bits<5> CRD;
- bits<5> CRA;
- bits<5> CRB;
-
- let Pattern = pattern;
-
- let Inst{6-10} = CRD;
- let Inst{11-15} = CRA;
- let Inst{16-20} = CRB;
- let Inst{21-30} = xo;
- let Inst{31} = 0;
-}
-
-class XLForm_1_ext<bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
- InstrItinClass itin, list<dag> pattern>
- : I<opcode, OOL, IOL, asmstr, itin> {
- bits<5> CRD;
-
- let Pattern = pattern;
-
- let Inst{6-10} = CRD;
- let Inst{11-15} = CRD;
- let Inst{16-20} = CRD;
- let Inst{21-30} = xo;
- let Inst{31} = 0;
-}
-
-class XLForm_2<bits<6> opcode, bits<10> xo, bit lk, dag OOL, dag IOL, string asmstr,
- InstrItinClass itin, list<dag> pattern>
- : I<opcode, OOL, IOL, asmstr, itin> {
- bits<5> BO;
- bits<5> BI;
- bits<2> BH;
-
- let Pattern = pattern;
-
- let Inst{6-10} = BO;
- let Inst{11-15} = BI;
- let Inst{16-18} = 0;
- let Inst{19-20} = BH;
- let Inst{21-30} = xo;
- let Inst{31} = lk;
-}
-
-class XLForm_2_br<bits<6> opcode, bits<10> xo, bit lk,
- dag OOL, dag IOL, string asmstr, InstrItinClass itin, list<dag> pattern>
- : XLForm_2<opcode, xo, lk, OOL, IOL, asmstr, itin, pattern> {
- bits<7> BIBO; // 2 bits of BI and 5 bits of BO.
- bits<3> CR;
-
- let BO = BIBO{2-6};
- let BI{0-1} = BIBO{0-1};
- let BI{2-4} = CR;
- let BH = 0;
-}
-
-
-class XLForm_2_ext<bits<6> opcode, bits<10> xo, bits<5> bo, bits<5> bi, bit lk,
- dag OOL, dag IOL, string asmstr, InstrItinClass itin, list<dag> pattern>
- : XLForm_2<opcode, xo, lk, OOL, IOL, asmstr, itin, pattern> {
- let BO = bo;
- let BI = bi;
- let BH = 0;
-}
-
-class XLForm_3<bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
- InstrItinClass itin>
- : I<opcode, OOL, IOL, asmstr, itin> {
- bits<3> BF;
- bits<3> BFA;
-
- let Inst{6-8} = BF;
- let Inst{9-10} = 0;
- let Inst{11-13} = BFA;
- let Inst{14-15} = 0;
- let Inst{16-20} = 0;
- let Inst{21-30} = xo;
- let Inst{31} = 0;
-}
-
-// 1.7.8 XFX-Form
-class XFXForm_1<bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
- InstrItinClass itin>
- : I<opcode, OOL, IOL, asmstr, itin> {
- bits<5> RT;
- bits<10> SPR;
-
- let Inst{6-10} = RT;
- let Inst{11} = SPR{4};
- let Inst{12} = SPR{3};
- let Inst{13} = SPR{2};
- let Inst{14} = SPR{1};
- let Inst{15} = SPR{0};
- let Inst{16} = SPR{9};
- let Inst{17} = SPR{8};
- let Inst{18} = SPR{7};
- let Inst{19} = SPR{6};
- let Inst{20} = SPR{5};
- let Inst{21-30} = xo;
- let Inst{31} = 0;
-}
-
-class XFXForm_1_ext<bits<6> opcode, bits<10> xo, bits<10> spr,
- dag OOL, dag IOL, string asmstr, InstrItinClass itin>
- : XFXForm_1<opcode, xo, OOL, IOL, asmstr, itin> {
- let SPR = spr;
-}
-
-class XFXForm_3<bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
- InstrItinClass itin>
- : I<opcode, OOL, IOL, asmstr, itin> {
- bits<5> RT;
-
- let Inst{6-10} = RT;
- let Inst{11-20} = 0;
- let Inst{21-30} = xo;
- let Inst{31} = 0;
-}
-
-class XFXForm_5<bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
- InstrItinClass itin>
- : I<opcode, OOL, IOL, asmstr, itin> {
- bits<8> FXM;
- bits<5> ST;
-
- let Inst{6-10} = ST;
- let Inst{11} = 0;
- let Inst{12-19} = FXM;
- let Inst{20} = 0;
- let Inst{21-30} = xo;
- let Inst{31} = 0;
-}
-
-class XFXForm_5a<bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
- InstrItinClass itin>
- : I<opcode, OOL, IOL, asmstr, itin> {
- bits<5> ST;
- bits<8> FXM;
-
- let Inst{6-10} = ST;
- let Inst{11} = 1;
- let Inst{12-19} = FXM;
- let Inst{20} = 0;
- let Inst{21-30} = xo;
- let Inst{31} = 0;
-}
-
-class XFXForm_7<bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
- InstrItinClass itin>
- : XFXForm_1<opcode, xo, OOL, IOL, asmstr, itin>;
-
-class XFXForm_7_ext<bits<6> opcode, bits<10> xo, bits<10> spr,
- dag OOL, dag IOL, string asmstr, InstrItinClass itin>
- : XFXForm_7<opcode, xo, OOL, IOL, asmstr, itin> {
- let SPR = spr;
-}
-
-// XFL-Form - MTFSF
-// This is probably 1.7.9, but I don't have the reference that uses this
-// numbering scheme...
-class XFLForm<bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
- string cstr, InstrItinClass itin, list<dag>pattern>
- : I<opcode, OOL, IOL, asmstr, itin> {
- bits<8> FM;
- bits<5> RT;
-
- bit RC = 0; // set by isDOT
- let Pattern = pattern;
- let Constraints = cstr;
-
- let Inst{6} = 0;
- let Inst{7-14} = FM;
- let Inst{15} = 0;
- let Inst{16-20} = RT;
- let Inst{21-30} = xo;
- let Inst{31} = RC;
-}
-
-// 1.7.10 XS-Form - SRADI.
-class XSForm_1<bits<6> opcode, bits<9> xo, dag OOL, dag IOL, string asmstr,
- InstrItinClass itin, list<dag> pattern>
- : I<opcode, OOL, IOL, asmstr, itin> {
- bits<5> A;
- bits<5> RS;
- bits<6> SH;
-
- bit RC = 0; // set by isDOT
- let Pattern = pattern;
-
- let Inst{6-10} = RS;
- let Inst{11-15} = A;
- let Inst{16-20} = SH{4,3,2,1,0};
- let Inst{21-29} = xo;
- let Inst{30} = SH{5};
- let Inst{31} = RC;
-}
-
-// 1.7.11 XO-Form
-class XOForm_1<bits<6> opcode, bits<9> xo, bit oe, dag OOL, dag IOL, string asmstr,
- InstrItinClass itin, list<dag> pattern>
- : I<opcode, OOL, IOL, asmstr, itin> {
- bits<5> RT;
- bits<5> RA;
- bits<5> RB;
-
- let Pattern = pattern;
-
- bit RC = 0; // set by isDOT
-
- let Inst{6-10} = RT;
- let Inst{11-15} = RA;
- let Inst{16-20} = RB;
- let Inst{21} = oe;
- let Inst{22-30} = xo;
- let Inst{31} = RC;
-}
-
-class XOForm_3<bits<6> opcode, bits<9> xo, bit oe,
- dag OOL, dag IOL, string asmstr, InstrItinClass itin, list<dag> pattern>
- : XOForm_1<opcode, xo, oe, OOL, IOL, asmstr, itin, pattern> {
- let RB = 0;
-}
-
-// 1.7.12 A-Form
-class AForm_1<bits<6> opcode, bits<5> xo, dag OOL, dag IOL, string asmstr,
- InstrItinClass itin, list<dag> pattern>
- : I<opcode, OOL, IOL, asmstr, itin> {
- bits<5> FRT;
- bits<5> FRA;
- bits<5> FRC;
- bits<5> FRB;
-
- let Pattern = pattern;
-
- bit RC = 0; // set by isDOT
-
- let Inst{6-10} = FRT;
- let Inst{11-15} = FRA;
- let Inst{16-20} = FRB;
- let Inst{21-25} = FRC;
- let Inst{26-30} = xo;
- let Inst{31} = RC;
-}
-
-class AForm_2<bits<6> opcode, bits<5> xo, dag OOL, dag IOL, string asmstr,
- InstrItinClass itin, list<dag> pattern>
- : AForm_1<opcode, xo, OOL, IOL, asmstr, itin, pattern> {
- let FRC = 0;
-}
-
-class AForm_3<bits<6> opcode, bits<5> xo, dag OOL, dag IOL, string asmstr,
- InstrItinClass itin, list<dag> pattern>
- : AForm_1<opcode, xo, OOL, IOL, asmstr, itin, pattern> {
- let FRB = 0;
-}
-
-// 1.7.13 M-Form
-class MForm_1<bits<6> opcode, dag OOL, dag IOL, string asmstr,
- InstrItinClass itin, list<dag> pattern>
- : I<opcode, OOL, IOL, asmstr, itin> {
- bits<5> RA;
- bits<5> RS;
- bits<5> RB;
- bits<5> MB;
- bits<5> ME;
-
- let Pattern = pattern;
-
- bit RC = 0; // set by isDOT
-
- let Inst{6-10} = RS;
- let Inst{11-15} = RA;
- let Inst{16-20} = RB;
- let Inst{21-25} = MB;
- let Inst{26-30} = ME;
- let Inst{31} = RC;
-}
-
-class MForm_2<bits<6> opcode, dag OOL, dag IOL, string asmstr,
- InstrItinClass itin, list<dag> pattern>
- : MForm_1<opcode, OOL, IOL, asmstr, itin, pattern> {
-}
-
-// 1.7.14 MD-Form
-class MDForm_1<bits<6> opcode, bits<3> xo, dag OOL, dag IOL, string asmstr,
- InstrItinClass itin, list<dag> pattern>
- : I<opcode, OOL, IOL, asmstr, itin> {
- bits<5> RA;
- bits<5> RS;
- bits<6> SH;
- bits<6> MBE;
-
- let Pattern = pattern;
-
- bit RC = 0; // set by isDOT
-
- let Inst{6-10} = RS;
- let Inst{11-15} = RA;
- let Inst{16-20} = SH{4,3,2,1,0};
- let Inst{21-26} = MBE{4,3,2,1,0,5};
- let Inst{27-29} = xo;
- let Inst{30} = SH{5};
- let Inst{31} = RC;
-}
-
-
-
-// E-1 VA-Form
-
-// VAForm_1 - DACB ordering.
-class VAForm_1<bits<6> xo, dag OOL, dag IOL, string asmstr,
- InstrItinClass itin, list<dag> pattern>
- : I<4, OOL, IOL, asmstr, itin> {
- bits<5> VD;
- bits<5> VA;
- bits<5> VC;
- bits<5> VB;
-
- let Pattern = pattern;
-
- let Inst{6-10} = VD;
- let Inst{11-15} = VA;
- let Inst{16-20} = VB;
- let Inst{21-25} = VC;
- let Inst{26-31} = xo;
-}
-
-// VAForm_1a - DABC ordering.
-class VAForm_1a<bits<6> xo, dag OOL, dag IOL, string asmstr,
- InstrItinClass itin, list<dag> pattern>
- : I<4, OOL, IOL, asmstr, itin> {
- bits<5> VD;
- bits<5> VA;
- bits<5> VB;
- bits<5> VC;
-
- let Pattern = pattern;
-
- let Inst{6-10} = VD;
- let Inst{11-15} = VA;
- let Inst{16-20} = VB;
- let Inst{21-25} = VC;
- let Inst{26-31} = xo;
-}
-
-class VAForm_2<bits<6> xo, dag OOL, dag IOL, string asmstr,
- InstrItinClass itin, list<dag> pattern>
- : I<4, OOL, IOL, asmstr, itin> {
- bits<5> VD;
- bits<5> VA;
- bits<5> VB;
- bits<4> SH;
-
- let Pattern = pattern;
-
- let Inst{6-10} = VD;
- let Inst{11-15} = VA;
- let Inst{16-20} = VB;
- let Inst{21} = 0;
- let Inst{22-25} = SH;
- let Inst{26-31} = xo;
-}
-
-// E-2 VX-Form
-class VXForm_1<bits<11> xo, dag OOL, dag IOL, string asmstr,
- InstrItinClass itin, list<dag> pattern>
- : I<4, OOL, IOL, asmstr, itin> {
- bits<5> VD;
- bits<5> VA;
- bits<5> VB;
-
- let Pattern = pattern;
-
- let Inst{6-10} = VD;
- let Inst{11-15} = VA;
- let Inst{16-20} = VB;
- let Inst{21-31} = xo;
-}
-
-class VXForm_setzero<bits<11> xo, dag OOL, dag IOL, string asmstr,
- InstrItinClass itin, list<dag> pattern>
- : VXForm_1<xo, OOL, IOL, asmstr, itin, pattern> {
- let VA = VD;
- let VB = VD;
-}
-
-
-class VXForm_2<bits<11> xo, dag OOL, dag IOL, string asmstr,
- InstrItinClass itin, list<dag> pattern>
- : I<4, OOL, IOL, asmstr, itin> {
- bits<5> VD;
- bits<5> VB;
-
- let Pattern = pattern;
-
- let Inst{6-10} = VD;
- let Inst{11-15} = 0;
- let Inst{16-20} = VB;
- let Inst{21-31} = xo;
-}
-
-class VXForm_3<bits<11> xo, dag OOL, dag IOL, string asmstr,
- InstrItinClass itin, list<dag> pattern>
- : I<4, OOL, IOL, asmstr, itin> {
- bits<5> VD;
- bits<5> IMM;
-
- let Pattern = pattern;
-
- let Inst{6-10} = VD;
- let Inst{11-15} = IMM;
- let Inst{16-20} = 0;
- let Inst{21-31} = xo;
-}
-
-/// VXForm_4 - VX instructions with "VD,0,0" register fields, like mfvscr.
-class VXForm_4<bits<11> xo, dag OOL, dag IOL, string asmstr,
- InstrItinClass itin, list<dag> pattern>
- : I<4, OOL, IOL, asmstr, itin> {
- bits<5> VD;
-
- let Pattern = pattern;
-
- let Inst{6-10} = VD;
- let Inst{11-15} = 0;
- let Inst{16-20} = 0;
- let Inst{21-31} = xo;
-}
-
-/// VXForm_5 - VX instructions with "0,0,VB" register fields, like mtvscr.
-class VXForm_5<bits<11> xo, dag OOL, dag IOL, string asmstr,
- InstrItinClass itin, list<dag> pattern>
- : I<4, OOL, IOL, asmstr, itin> {
- bits<5> VB;
-
- let Pattern = pattern;
-
- let Inst{6-10} = 0;
- let Inst{11-15} = 0;
- let Inst{16-20} = VB;
- let Inst{21-31} = xo;
-}
-
-// E-4 VXR-Form
-class VXRForm_1<bits<10> xo, dag OOL, dag IOL, string asmstr,
- InstrItinClass itin, list<dag> pattern>
- : I<4, OOL, IOL, asmstr, itin> {
- bits<5> VD;
- bits<5> VA;
- bits<5> VB;
- bit RC = 0;
-
- let Pattern = pattern;
-
- let Inst{6-10} = VD;
- let Inst{11-15} = VA;
- let Inst{16-20} = VB;
- let Inst{21} = RC;
- let Inst{22-31} = xo;
-}
-
-//===----------------------------------------------------------------------===//
-class Pseudo<dag OOL, dag IOL, string asmstr, list<dag> pattern>
- : I<0, OOL, IOL, asmstr, NoItinerary> {
- let PPC64 = 0;
- let Pattern = pattern;
- let Inst{31-0} = 0;
-}
diff --git a/release_23/lib/Target/PowerPC/PPCInstrInfo.cpp b/release_23/lib/Target/PowerPC/PPCInstrInfo.cpp
deleted file mode 100644
index 27ff76715625..000000000000
--- a/release_23/lib/Target/PowerPC/PPCInstrInfo.cpp
+++ /dev/null
@@ -1,745 +0,0 @@
-//===- PPCInstrInfo.cpp - PowerPC32 Instruction Information -----*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains the PowerPC implementation of the TargetInstrInfo class.
-//
-//===----------------------------------------------------------------------===//
-
-#include "PPCInstrInfo.h"
-#include "PPCInstrBuilder.h"
-#include "PPCMachineFunctionInfo.h"
-#include "PPCPredicates.h"
-#include "PPCGenInstrInfo.inc"
-#include "PPCTargetMachine.h"
-#include "llvm/ADT/STLExtras.h"
-#include "llvm/CodeGen/MachineInstrBuilder.h"
-#include "llvm/Support/CommandLine.h"
-#include "llvm/Target/TargetAsmInfo.h"
-using namespace llvm;
-
-extern cl::opt<bool> EnablePPC32RS; // FIXME (64-bit): See PPCRegisterInfo.cpp.
-extern cl::opt<bool> EnablePPC64RS; // FIXME (64-bit): See PPCRegisterInfo.cpp.
-
-PPCInstrInfo::PPCInstrInfo(PPCTargetMachine &tm)
- : TargetInstrInfoImpl(PPCInsts, array_lengthof(PPCInsts)), TM(tm),
- RI(*TM.getSubtargetImpl(), *this) {}
-
-/// getPointerRegClass - Return the register class to use to hold pointers.
-/// This is used for addressing modes.
-const TargetRegisterClass *PPCInstrInfo::getPointerRegClass() const {
- if (TM.getSubtargetImpl()->isPPC64())
- return &PPC::G8RCRegClass;
- else
- return &PPC::GPRCRegClass;
-}
-
-
-bool PPCInstrInfo::isMoveInstr(const MachineInstr& MI,
- unsigned& sourceReg,
- unsigned& destReg) const {
- unsigned oc = MI.getOpcode();
- if (oc == PPC::OR || oc == PPC::OR8 || oc == PPC::VOR ||
- oc == PPC::OR4To8 || oc == PPC::OR8To4) { // or r1, r2, r2
- assert(MI.getNumOperands() >= 3 &&
- MI.getOperand(0).isRegister() &&
- MI.getOperand(1).isRegister() &&
- MI.getOperand(2).isRegister() &&
- "invalid PPC OR instruction!");
- if (MI.getOperand(1).getReg() == MI.getOperand(2).getReg()) {
- sourceReg = MI.getOperand(1).getReg();
- destReg = MI.getOperand(0).getReg();
- return true;
- }
- } else if (oc == PPC::ADDI) { // addi r1, r2, 0
- assert(MI.getNumOperands() >= 3 &&
- MI.getOperand(0).isRegister() &&
- MI.getOperand(2).isImmediate() &&
- "invalid PPC ADDI instruction!");
- if (MI.getOperand(1).isRegister() && MI.getOperand(2).getImm() == 0) {
- sourceReg = MI.getOperand(1).getReg();
- destReg = MI.getOperand(0).getReg();
- return true;
- }
- } else if (oc == PPC::ORI) { // ori r1, r2, 0
- assert(MI.getNumOperands() >= 3 &&
- MI.getOperand(0).isRegister() &&
- MI.getOperand(1).isRegister() &&
- MI.getOperand(2).isImmediate() &&
- "invalid PPC ORI instruction!");
- if (MI.getOperand(2).getImm() == 0) {
- sourceReg = MI.getOperand(1).getReg();
- destReg = MI.getOperand(0).getReg();
- return true;
- }
- } else if (oc == PPC::FMRS || oc == PPC::FMRD ||
- oc == PPC::FMRSD) { // fmr r1, r2
- assert(MI.getNumOperands() >= 2 &&
- MI.getOperand(0).isRegister() &&
- MI.getOperand(1).isRegister() &&
- "invalid PPC FMR instruction");
- sourceReg = MI.getOperand(1).getReg();
- destReg = MI.getOperand(0).getReg();
- return true;
- } else if (oc == PPC::MCRF) { // mcrf cr1, cr2
- assert(MI.getNumOperands() >= 2 &&
- MI.getOperand(0).isRegister() &&
- MI.getOperand(1).isRegister() &&
- "invalid PPC MCRF instruction");
- sourceReg = MI.getOperand(1).getReg();
- destReg = MI.getOperand(0).getReg();
- return true;
- }
- return false;
-}
-
-unsigned PPCInstrInfo::isLoadFromStackSlot(MachineInstr *MI,
- int &FrameIndex) const {
- switch (MI->getOpcode()) {
- default: break;
- case PPC::LD:
- case PPC::LWZ:
- case PPC::LFS:
- case PPC::LFD:
- if (MI->getOperand(1).isImm() && !MI->getOperand(1).getImm() &&
- MI->getOperand(2).isFI()) {
- FrameIndex = MI->getOperand(2).getIndex();
- return MI->getOperand(0).getReg();
- }
- break;
- }
- return 0;
-}
-
-unsigned PPCInstrInfo::isStoreToStackSlot(MachineInstr *MI,
- int &FrameIndex) const {
- switch (MI->getOpcode()) {
- default: break;
- case PPC::STD:
- case PPC::STW:
- case PPC::STFS:
- case PPC::STFD:
- if (MI->getOperand(1).isImm() && !MI->getOperand(1).getImm() &&
- MI->getOperand(2).isFI()) {
- FrameIndex = MI->getOperand(2).getIndex();
- return MI->getOperand(0).getReg();
- }
- break;
- }
- return 0;
-}
-
-// commuteInstruction - We can commute rlwimi instructions, but only if the
-// rotate amt is zero. We also have to munge the immediates a bit.
-MachineInstr *PPCInstrInfo::commuteInstruction(MachineInstr *MI) const {
- // Normal instructions can be commuted the obvious way.
- if (MI->getOpcode() != PPC::RLWIMI)
- return TargetInstrInfoImpl::commuteInstruction(MI);
-
- // Cannot commute if it has a non-zero rotate count.
- if (MI->getOperand(3).getImm() != 0)
- return 0;
-
- // If we have a zero rotate count, we have:
- // M = mask(MB,ME)
- // Op0 = (Op1 & ~M) | (Op2 & M)
- // Change this to:
- // M = mask((ME+1)&31, (MB-1)&31)
- // Op0 = (Op2 & ~M) | (Op1 & M)
-
- // Swap op1/op2
- unsigned Reg0 = MI->getOperand(0).getReg();
- unsigned Reg1 = MI->getOperand(1).getReg();
- unsigned Reg2 = MI->getOperand(2).getReg();
- bool Reg1IsKill = MI->getOperand(1).isKill();
- bool Reg2IsKill = MI->getOperand(2).isKill();
- // If machine instrs are no longer in two-address forms, update
- // destination register as well.
- if (Reg0 == Reg1) {
- // Must be two address instruction!
- assert(MI->getDesc().getOperandConstraint(0, TOI::TIED_TO) &&
- "Expecting a two-address instruction!");
- MI->getOperand(0).setReg(Reg2);
- Reg2IsKill = false;
- }
- MI->getOperand(2).setReg(Reg1);
- MI->getOperand(1).setReg(Reg2);
- MI->getOperand(2).setIsKill(Reg1IsKill);
- MI->getOperand(1).setIsKill(Reg2IsKill);
-
- // Swap the mask around.
- unsigned MB = MI->getOperand(4).getImm();
- unsigned ME = MI->getOperand(5).getImm();
- MI->getOperand(4).setImm((ME+1) & 31);
- MI->getOperand(5).setImm((MB-1) & 31);
- return MI;
-}
-
-void PPCInstrInfo::insertNoop(MachineBasicBlock &MBB,
- MachineBasicBlock::iterator MI) const {
- BuildMI(MBB, MI, get(PPC::NOP));
-}
-
-
-// Branch analysis.
-bool PPCInstrInfo::AnalyzeBranch(MachineBasicBlock &MBB,MachineBasicBlock *&TBB,
- MachineBasicBlock *&FBB,
- std::vector<MachineOperand> &Cond) const {
- // If the block has no terminators, it just falls into the block after it.
- MachineBasicBlock::iterator I = MBB.end();
- if (I == MBB.begin() || !isUnpredicatedTerminator(--I))
- return false;
-
- // Get the last instruction in the block.
- MachineInstr *LastInst = I;
-
- // If there is only one terminator instruction, process it.
- if (I == MBB.begin() || !isUnpredicatedTerminator(--I)) {
- if (LastInst->getOpcode() == PPC::B) {
- TBB = LastInst->getOperand(0).getMBB();
- return false;
- } else if (LastInst->getOpcode() == PPC::BCC) {
- // Block ends with fall-through condbranch.
- TBB = LastInst->getOperand(2).getMBB();
- Cond.push_back(LastInst->getOperand(0));
- Cond.push_back(LastInst->getOperand(1));
- return false;
- }
- // Otherwise, don't know what this is.
- return true;
- }
-
- // Get the instruction before it if it's a terminator.
- MachineInstr *SecondLastInst = I;
-
- // If there are three terminators, we don't know what sort of block this is.
- if (SecondLastInst && I != MBB.begin() &&
- isUnpredicatedTerminator(--I))
- return true;
-
- // If the block ends with PPC::B and PPC:BCC, handle it.
- if (SecondLastInst->getOpcode() == PPC::BCC &&
- LastInst->getOpcode() == PPC::B) {
- TBB = SecondLastInst->getOperand(2).getMBB();
- Cond.push_back(SecondLastInst->getOperand(0));
- Cond.push_back(SecondLastInst->getOperand(1));
- FBB = LastInst->getOperand(0).getMBB();
- return false;
- }
-
- // If the block ends with two PPC:Bs, handle it. The second one is not
- // executed, so remove it.
- if (SecondLastInst->getOpcode() == PPC::B &&
- LastInst->getOpcode() == PPC::B) {
- TBB = SecondLastInst->getOperand(0).getMBB();
- I = LastInst;
- I->eraseFromParent();
- return false;
- }
-
- // Otherwise, can't handle this.
- return true;
-}
-
-unsigned PPCInstrInfo::RemoveBranch(MachineBasicBlock &MBB) const {
- MachineBasicBlock::iterator I = MBB.end();
- if (I == MBB.begin()) return 0;
- --I;
- if (I->getOpcode() != PPC::B && I->getOpcode() != PPC::BCC)
- return 0;
-
- // Remove the branch.
- I->eraseFromParent();
-
- I = MBB.end();
-
- if (I == MBB.begin()) return 1;
- --I;
- if (I->getOpcode() != PPC::BCC)
- return 1;
-
- // Remove the branch.
- I->eraseFromParent();
- return 2;
-}
-
-unsigned
-PPCInstrInfo::InsertBranch(MachineBasicBlock &MBB, MachineBasicBlock *TBB,
- MachineBasicBlock *FBB,
- const std::vector<MachineOperand> &Cond) const {
- // Shouldn't be a fall through.
- assert(TBB && "InsertBranch must not be told to insert a fallthrough");
- assert((Cond.size() == 2 || Cond.size() == 0) &&
- "PPC branch conditions have two components!");
-
- // One-way branch.
- if (FBB == 0) {
- if (Cond.empty()) // Unconditional branch
- BuildMI(&MBB, get(PPC::B)).addMBB(TBB);
- else // Conditional branch
- BuildMI(&MBB, get(PPC::BCC))
- .addImm(Cond[0].getImm()).addReg(Cond[1].getReg()).addMBB(TBB);
- return 1;
- }
-
- // Two-way Conditional Branch.
- BuildMI(&MBB, get(PPC::BCC))
- .addImm(Cond[0].getImm()).addReg(Cond[1].getReg()).addMBB(TBB);
- BuildMI(&MBB, get(PPC::B)).addMBB(FBB);
- return 2;
-}
-
-void PPCInstrInfo::copyRegToReg(MachineBasicBlock &MBB,
- MachineBasicBlock::iterator MI,
- unsigned DestReg, unsigned SrcReg,
- const TargetRegisterClass *DestRC,
- const TargetRegisterClass *SrcRC) const {
- if (DestRC != SrcRC) {
- cerr << "Not yet supported!";
- abort();
- }
-
- if (DestRC == PPC::GPRCRegisterClass) {
- BuildMI(MBB, MI, get(PPC::OR), DestReg).addReg(SrcReg).addReg(SrcReg);
- } else if (DestRC == PPC::G8RCRegisterClass) {
- BuildMI(MBB, MI, get(PPC::OR8), DestReg).addReg(SrcReg).addReg(SrcReg);
- } else if (DestRC == PPC::F4RCRegisterClass) {
- BuildMI(MBB, MI, get(PPC::FMRS), DestReg).addReg(SrcReg);
- } else if (DestRC == PPC::F8RCRegisterClass) {
- BuildMI(MBB, MI, get(PPC::FMRD), DestReg).addReg(SrcReg);
- } else if (DestRC == PPC::CRRCRegisterClass) {
- BuildMI(MBB, MI, get(PPC::MCRF), DestReg).addReg(SrcReg);
- } else if (DestRC == PPC::VRRCRegisterClass) {
- BuildMI(MBB, MI, get(PPC::VOR), DestReg).addReg(SrcReg).addReg(SrcReg);
- } else if (DestRC == PPC::CRBITRCRegisterClass) {
- BuildMI(MBB, MI, get(PPC::CROR), DestReg).addReg(SrcReg).addReg(SrcReg);
- } else {
- cerr << "Attempt to copy register that is not GPR or FPR";
- abort();
- }
-}
-
-bool
-PPCInstrInfo::StoreRegToStackSlot(unsigned SrcReg, bool isKill,
- int FrameIdx,
- const TargetRegisterClass *RC,
- SmallVectorImpl<MachineInstr*> &NewMIs) const{
- if (RC == PPC::GPRCRegisterClass) {
- if (SrcReg != PPC::LR) {
- NewMIs.push_back(addFrameReference(BuildMI(get(PPC::STW))
- .addReg(SrcReg, false, false, isKill),
- FrameIdx));
- } else {
- // FIXME: this spills LR immediately to memory in one step. To do this,
- // we use R11, which we know cannot be used in the prolog/epilog. This is
- // a hack.
- NewMIs.push_back(BuildMI(get(PPC::MFLR), PPC::R11));
- NewMIs.push_back(addFrameReference(BuildMI(get(PPC::STW))
- .addReg(PPC::R11, false, false, isKill),
- FrameIdx));
- }
- } else if (RC == PPC::G8RCRegisterClass) {
- if (SrcReg != PPC::LR8) {
- NewMIs.push_back(addFrameReference(BuildMI(get(PPC::STD))
- .addReg(SrcReg, false, false, isKill), FrameIdx));
- } else {
- // FIXME: this spills LR immediately to memory in one step. To do this,
- // we use R11, which we know cannot be used in the prolog/epilog. This is
- // a hack.
- NewMIs.push_back(BuildMI(get(PPC::MFLR8), PPC::X11));
- NewMIs.push_back(addFrameReference(BuildMI(get(PPC::STD))
- .addReg(PPC::X11, false, false, isKill), FrameIdx));
- }
- } else if (RC == PPC::F8RCRegisterClass) {
- NewMIs.push_back(addFrameReference(BuildMI(get(PPC::STFD))
- .addReg(SrcReg, false, false, isKill), FrameIdx));
- } else if (RC == PPC::F4RCRegisterClass) {
- NewMIs.push_back(addFrameReference(BuildMI(get(PPC::STFS))
- .addReg(SrcReg, false, false, isKill), FrameIdx));
- } else if (RC == PPC::CRRCRegisterClass) {
- if ((EnablePPC32RS && !TM.getSubtargetImpl()->isPPC64()) ||
- (EnablePPC64RS && TM.getSubtargetImpl()->isPPC64())) {
- // FIXME (64-bit): Enable
- NewMIs.push_back(addFrameReference(BuildMI(get(PPC::SPILL_CR))
- .addReg(SrcReg, false, false, isKill),
- FrameIdx));
- return true;
- } else {
- // FIXME: We use R0 here, because it isn't available for RA. We need to
- // store the CR in the low 4-bits of the saved value. First, issue a MFCR
- // to save all of the CRBits.
- NewMIs.push_back(BuildMI(get(PPC::MFCR), PPC::R0));
-
- // If the saved register wasn't CR0, shift the bits left so that they are
- // in CR0's slot.
- if (SrcReg != PPC::CR0) {
- unsigned ShiftBits = PPCRegisterInfo::getRegisterNumbering(SrcReg)*4;
- // rlwinm r0, r0, ShiftBits, 0, 31.
- NewMIs.push_back(BuildMI(get(PPC::RLWINM), PPC::R0)
- .addReg(PPC::R0).addImm(ShiftBits).addImm(0).addImm(31));
- }
-
- NewMIs.push_back(addFrameReference(BuildMI(get(PPC::STW))
- .addReg(PPC::R0, false, false, isKill),
- FrameIdx));
- }
- } else if (RC == PPC::CRBITRCRegisterClass) {
- // FIXME: We use CRi here because there is no mtcrf on a bit. Since the
- // backend currently only uses CR1EQ as an individual bit, this should
- // not cause any bug. If we need other uses of CR bits, the following
- // code may be invalid.
- unsigned Reg = 0;
- if (SrcReg >= PPC::CR0LT || SrcReg <= PPC::CR0UN)
- Reg = PPC::CR0;
- else if (SrcReg >= PPC::CR1LT || SrcReg <= PPC::CR1UN)
- Reg = PPC::CR1;
- else if (SrcReg >= PPC::CR2LT || SrcReg <= PPC::CR2UN)
- Reg = PPC::CR2;
- else if (SrcReg >= PPC::CR3LT || SrcReg <= PPC::CR3UN)
- Reg = PPC::CR3;
- else if (SrcReg >= PPC::CR4LT || SrcReg <= PPC::CR4UN)
- Reg = PPC::CR4;
- else if (SrcReg >= PPC::CR5LT || SrcReg <= PPC::CR5UN)
- Reg = PPC::CR5;
- else if (SrcReg >= PPC::CR6LT || SrcReg <= PPC::CR6UN)
- Reg = PPC::CR6;
- else if (SrcReg >= PPC::CR7LT || SrcReg <= PPC::CR7UN)
- Reg = PPC::CR7;
-
- return StoreRegToStackSlot(Reg, isKill, FrameIdx,
- PPC::CRRCRegisterClass, NewMIs);
-
- } else if (RC == PPC::VRRCRegisterClass) {
- // We don't have indexed addressing for vector loads. Emit:
- // R0 = ADDI FI#
- // STVX VAL, 0, R0
- //
- // FIXME: We use R0 here, because it isn't available for RA.
- NewMIs.push_back(addFrameReference(BuildMI(get(PPC::ADDI), PPC::R0),
- FrameIdx, 0, 0));
- NewMIs.push_back(BuildMI(get(PPC::STVX))
- .addReg(SrcReg, false, false, isKill).addReg(PPC::R0).addReg(PPC::R0));
- } else {
- assert(0 && "Unknown regclass!");
- abort();
- }
-
- return false;
-}
-
-void
-PPCInstrInfo::storeRegToStackSlot(MachineBasicBlock &MBB,
- MachineBasicBlock::iterator MI,
- unsigned SrcReg, bool isKill, int FrameIdx,
- const TargetRegisterClass *RC) const {
- SmallVector<MachineInstr*, 4> NewMIs;
-
- if (StoreRegToStackSlot(SrcReg, isKill, FrameIdx, RC, NewMIs)) {
- PPCFunctionInfo *FuncInfo = MBB.getParent()->getInfo<PPCFunctionInfo>();
- FuncInfo->setSpillsCR();
- }
-
- for (unsigned i = 0, e = NewMIs.size(); i != e; ++i)
- MBB.insert(MI, NewMIs[i]);
-}
-
-void PPCInstrInfo::storeRegToAddr(MachineFunction &MF, unsigned SrcReg,
- bool isKill,
- SmallVectorImpl<MachineOperand> &Addr,
- const TargetRegisterClass *RC,
- SmallVectorImpl<MachineInstr*> &NewMIs) const{
- if (Addr[0].isFrameIndex()) {
- if (StoreRegToStackSlot(SrcReg, isKill, Addr[0].getIndex(), RC, NewMIs)) {
- PPCFunctionInfo *FuncInfo = MF.getInfo<PPCFunctionInfo>();
- FuncInfo->setSpillsCR();
- }
-
- return;
- }
-
- unsigned Opc = 0;
- if (RC == PPC::GPRCRegisterClass) {
- Opc = PPC::STW;
- } else if (RC == PPC::G8RCRegisterClass) {
- Opc = PPC::STD;
- } else if (RC == PPC::F8RCRegisterClass) {
- Opc = PPC::STFD;
- } else if (RC == PPC::F4RCRegisterClass) {
- Opc = PPC::STFS;
- } else if (RC == PPC::VRRCRegisterClass) {
- Opc = PPC::STVX;
- } else {
- assert(0 && "Unknown regclass!");
- abort();
- }
- MachineInstrBuilder MIB = BuildMI(get(Opc))
- .addReg(SrcReg, false, false, isKill);
- for (unsigned i = 0, e = Addr.size(); i != e; ++i) {
- MachineOperand &MO = Addr[i];
- if (MO.isRegister())
- MIB.addReg(MO.getReg());
- else if (MO.isImmediate())
- MIB.addImm(MO.getImm());
- else
- MIB.addFrameIndex(MO.getIndex());
- }
- NewMIs.push_back(MIB);
- return;
-}
-
-void
-PPCInstrInfo::LoadRegFromStackSlot(unsigned DestReg, int FrameIdx,
- const TargetRegisterClass *RC,
- SmallVectorImpl<MachineInstr*> &NewMIs)const{
- if (RC == PPC::GPRCRegisterClass) {
- if (DestReg != PPC::LR) {
- NewMIs.push_back(addFrameReference(BuildMI(get(PPC::LWZ), DestReg),
- FrameIdx));
- } else {
- NewMIs.push_back(addFrameReference(BuildMI(get(PPC::LWZ), PPC::R11),
- FrameIdx));
- NewMIs.push_back(BuildMI(get(PPC::MTLR)).addReg(PPC::R11));
- }
- } else if (RC == PPC::G8RCRegisterClass) {
- if (DestReg != PPC::LR8) {
- NewMIs.push_back(addFrameReference(BuildMI(get(PPC::LD), DestReg),
- FrameIdx));
- } else {
- NewMIs.push_back(addFrameReference(BuildMI(get(PPC::LD), PPC::R11),
- FrameIdx));
- NewMIs.push_back(BuildMI(get(PPC::MTLR8)).addReg(PPC::R11));
- }
- } else if (RC == PPC::F8RCRegisterClass) {
- NewMIs.push_back(addFrameReference(BuildMI(get(PPC::LFD), DestReg),
- FrameIdx));
- } else if (RC == PPC::F4RCRegisterClass) {
- NewMIs.push_back(addFrameReference(BuildMI(get(PPC::LFS), DestReg),
- FrameIdx));
- } else if (RC == PPC::CRRCRegisterClass) {
- // FIXME: We use R0 here, because it isn't available for RA.
- NewMIs.push_back(addFrameReference(BuildMI(get(PPC::LWZ), PPC::R0),
- FrameIdx));
-
- // If the reloaded register isn't CR0, shift the bits right so that they are
- // in the right CR's slot.
- if (DestReg != PPC::CR0) {
- unsigned ShiftBits = PPCRegisterInfo::getRegisterNumbering(DestReg)*4;
- // rlwinm r11, r11, 32-ShiftBits, 0, 31.
- NewMIs.push_back(BuildMI(get(PPC::RLWINM), PPC::R0)
- .addReg(PPC::R0).addImm(32-ShiftBits).addImm(0).addImm(31));
- }
-
- NewMIs.push_back(BuildMI(get(PPC::MTCRF), DestReg).addReg(PPC::R0));
- } else if (RC == PPC::CRBITRCRegisterClass) {
-
- unsigned Reg = 0;
- if (DestReg >= PPC::CR0LT || DestReg <= PPC::CR0UN)
- Reg = PPC::CR0;
- else if (DestReg >= PPC::CR1LT || DestReg <= PPC::CR1UN)
- Reg = PPC::CR1;
- else if (DestReg >= PPC::CR2LT || DestReg <= PPC::CR2UN)
- Reg = PPC::CR2;
- else if (DestReg >= PPC::CR3LT || DestReg <= PPC::CR3UN)
- Reg = PPC::CR3;
- else if (DestReg >= PPC::CR4LT || DestReg <= PPC::CR4UN)
- Reg = PPC::CR4;
- else if (DestReg >= PPC::CR5LT || DestReg <= PPC::CR5UN)
- Reg = PPC::CR5;
- else if (DestReg >= PPC::CR6LT || DestReg <= PPC::CR6UN)
- Reg = PPC::CR6;
- else if (DestReg >= PPC::CR7LT || DestReg <= PPC::CR7UN)
- Reg = PPC::CR7;
-
- return LoadRegFromStackSlot(Reg, FrameIdx,
- PPC::CRRCRegisterClass, NewMIs);
-
- } else if (RC == PPC::VRRCRegisterClass) {
- // We don't have indexed addressing for vector loads. Emit:
- // R0 = ADDI FI#
- // Dest = LVX 0, R0
- //
- // FIXME: We use R0 here, because it isn't available for RA.
- NewMIs.push_back(addFrameReference(BuildMI(get(PPC::ADDI), PPC::R0),
- FrameIdx, 0, 0));
- NewMIs.push_back(BuildMI(get(PPC::LVX),DestReg).addReg(PPC::R0)
- .addReg(PPC::R0));
- } else {
- assert(0 && "Unknown regclass!");
- abort();
- }
-}
-
-void
-PPCInstrInfo::loadRegFromStackSlot(MachineBasicBlock &MBB,
- MachineBasicBlock::iterator MI,
- unsigned DestReg, int FrameIdx,
- const TargetRegisterClass *RC) const {
- SmallVector<MachineInstr*, 4> NewMIs;
- LoadRegFromStackSlot(DestReg, FrameIdx, RC, NewMIs);
- for (unsigned i = 0, e = NewMIs.size(); i != e; ++i)
- MBB.insert(MI, NewMIs[i]);
-}
-
-void PPCInstrInfo::loadRegFromAddr(MachineFunction &MF, unsigned DestReg,
- SmallVectorImpl<MachineOperand> &Addr,
- const TargetRegisterClass *RC,
- SmallVectorImpl<MachineInstr*> &NewMIs)const{
- if (Addr[0].isFrameIndex()) {
- LoadRegFromStackSlot(DestReg, Addr[0].getIndex(), RC, NewMIs);
- return;
- }
-
- unsigned Opc = 0;
- if (RC == PPC::GPRCRegisterClass) {
- assert(DestReg != PPC::LR && "Can't handle this yet!");
- Opc = PPC::LWZ;
- } else if (RC == PPC::G8RCRegisterClass) {
- assert(DestReg != PPC::LR8 && "Can't handle this yet!");
- Opc = PPC::LD;
- } else if (RC == PPC::F8RCRegisterClass) {
- Opc = PPC::LFD;
- } else if (RC == PPC::F4RCRegisterClass) {
- Opc = PPC::LFS;
- } else if (RC == PPC::VRRCRegisterClass) {
- Opc = PPC::LVX;
- } else {
- assert(0 && "Unknown regclass!");
- abort();
- }
- MachineInstrBuilder MIB = BuildMI(get(Opc), DestReg);
- for (unsigned i = 0, e = Addr.size(); i != e; ++i) {
- MachineOperand &MO = Addr[i];
- if (MO.isRegister())
- MIB.addReg(MO.getReg());
- else if (MO.isImmediate())
- MIB.addImm(MO.getImm());
- else
- MIB.addFrameIndex(MO.getIndex());
- }
- NewMIs.push_back(MIB);
- return;
-}
-
-/// foldMemoryOperand - PowerPC (like most RISC's) can only fold spills into
-/// copy instructions, turning them into load/store instructions.
-MachineInstr *PPCInstrInfo::foldMemoryOperand(MachineFunction &MF,
- MachineInstr *MI,
- SmallVectorImpl<unsigned> &Ops,
- int FrameIndex) const {
- if (Ops.size() != 1) return NULL;
-
- // Make sure this is a reg-reg copy. Note that we can't handle MCRF, because
- // it takes more than one instruction to store it.
- unsigned Opc = MI->getOpcode();
- unsigned OpNum = Ops[0];
-
- MachineInstr *NewMI = NULL;
- if ((Opc == PPC::OR &&
- MI->getOperand(1).getReg() == MI->getOperand(2).getReg())) {
- if (OpNum == 0) { // move -> store
- unsigned InReg = MI->getOperand(1).getReg();
- NewMI = addFrameReference(BuildMI(get(PPC::STW)).addReg(InReg),
- FrameIndex);
- } else { // move -> load
- unsigned OutReg = MI->getOperand(0).getReg();
- NewMI = addFrameReference(BuildMI(get(PPC::LWZ), OutReg),
- FrameIndex);
- }
- } else if ((Opc == PPC::OR8 &&
- MI->getOperand(1).getReg() == MI->getOperand(2).getReg())) {
- if (OpNum == 0) { // move -> store
- unsigned InReg = MI->getOperand(1).getReg();
- NewMI = addFrameReference(BuildMI(get(PPC::STD)).addReg(InReg),
- FrameIndex);
- } else { // move -> load
- unsigned OutReg = MI->getOperand(0).getReg();
- NewMI = addFrameReference(BuildMI(get(PPC::LD), OutReg), FrameIndex);
- }
- } else if (Opc == PPC::FMRD) {
- if (OpNum == 0) { // move -> store
- unsigned InReg = MI->getOperand(1).getReg();
- NewMI = addFrameReference(BuildMI(get(PPC::STFD)).addReg(InReg),
- FrameIndex);
- } else { // move -> load
- unsigned OutReg = MI->getOperand(0).getReg();
- NewMI = addFrameReference(BuildMI(get(PPC::LFD), OutReg), FrameIndex);
- }
- } else if (Opc == PPC::FMRS) {
- if (OpNum == 0) { // move -> store
- unsigned InReg = MI->getOperand(1).getReg();
- NewMI = addFrameReference(BuildMI(get(PPC::STFS)).addReg(InReg),
- FrameIndex);
- } else { // move -> load
- unsigned OutReg = MI->getOperand(0).getReg();
- NewMI = addFrameReference(BuildMI(get(PPC::LFS), OutReg), FrameIndex);
- }
- }
-
- if (NewMI)
- NewMI->copyKillDeadInfo(MI);
- return NewMI;
-}
-
-bool PPCInstrInfo::canFoldMemoryOperand(MachineInstr *MI,
- SmallVectorImpl<unsigned> &Ops) const {
- if (Ops.size() != 1) return false;
-
- // Make sure this is a reg-reg copy. Note that we can't handle MCRF, because
- // it takes more than one instruction to store it.
- unsigned Opc = MI->getOpcode();
-
- if ((Opc == PPC::OR &&
- MI->getOperand(1).getReg() == MI->getOperand(2).getReg()))
- return true;
- else if ((Opc == PPC::OR8 &&
- MI->getOperand(1).getReg() == MI->getOperand(2).getReg()))
- return true;
- else if (Opc == PPC::FMRD || Opc == PPC::FMRS)
- return true;
-
- return false;
-}
-
-
-bool PPCInstrInfo::BlockHasNoFallThrough(MachineBasicBlock &MBB) const {
- if (MBB.empty()) return false;
-
- switch (MBB.back().getOpcode()) {
- case PPC::BLR: // Return.
- case PPC::B: // Uncond branch.
- case PPC::BCTR: // Indirect branch.
- return true;
- default: return false;
- }
-}
-
-bool PPCInstrInfo::
-ReverseBranchCondition(std::vector<MachineOperand> &Cond) const {
- assert(Cond.size() == 2 && "Invalid PPC branch opcode!");
- // Leave the CR# the same, but invert the condition.
- Cond[0].setImm(PPC::InvertPredicate((PPC::Predicate)Cond[0].getImm()));
- return false;
-}
-
-/// GetInstSize - Return the number of bytes of code the specified
-/// instruction may be. This returns the maximum number of bytes.
-///
-unsigned PPCInstrInfo::GetInstSizeInBytes(const MachineInstr *MI) const {
- switch (MI->getOpcode()) {
- case PPC::INLINEASM: { // Inline Asm: Variable size.
- const MachineFunction *MF = MI->getParent()->getParent();
- const char *AsmStr = MI->getOperand(0).getSymbolName();
- return MF->getTarget().getTargetAsmInfo()->getInlineAsmLength(AsmStr);
- }
- case PPC::LABEL: {
- return 0;
- }
- default:
- return 4; // PowerPC instructions are all 4 bytes
- }
-}
diff --git a/release_23/lib/Target/PowerPC/PPCInstrInfo.h b/release_23/lib/Target/PowerPC/PPCInstrInfo.h
deleted file mode 100644
index 5bd4c4d9476d..000000000000
--- a/release_23/lib/Target/PowerPC/PPCInstrInfo.h
+++ /dev/null
@@ -1,167 +0,0 @@
-//===- PPCInstrInfo.h - PowerPC Instruction Information ---------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains the PowerPC implementation of the TargetInstrInfo class.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef POWERPC32_INSTRUCTIONINFO_H
-#define POWERPC32_INSTRUCTIONINFO_H
-
-#include "PPC.h"
-#include "llvm/Target/TargetInstrInfo.h"
-#include "PPCRegisterInfo.h"
-
-namespace llvm {
-
-/// PPCII - This namespace holds all of the PowerPC target-specific
-/// per-instruction flags. These must match the corresponding definitions in
-/// PPC.td and PPCInstrFormats.td.
-namespace PPCII {
-enum {
- // PPC970 Instruction Flags. These flags describe the characteristics of the
- // PowerPC 970 (aka G5) dispatch groups and how they are formed out of
- // raw machine instructions.
-
- /// PPC970_First - This instruction starts a new dispatch group, so it will
- /// always be the first one in the group.
- PPC970_First = 0x1,
-
- /// PPC970_Single - This instruction starts a new dispatch group and
- /// terminates it, so it will be the sole instruction in the group.
- PPC970_Single = 0x2,
-
- /// PPC970_Cracked - This instruction is cracked into two pieces, requiring
- /// two dispatch pipes to be available to issue.
- PPC970_Cracked = 0x4,
-
- /// PPC970_Mask/Shift - This is a bitmask that selects the pipeline type that
- /// an instruction is issued to.
- PPC970_Shift = 3,
- PPC970_Mask = 0x07 << PPC970_Shift
-};
-enum PPC970_Unit {
- /// These are the various PPC970 execution unit pipelines. Each instruction
- /// is one of these.
- PPC970_Pseudo = 0 << PPC970_Shift, // Pseudo instruction
- PPC970_FXU = 1 << PPC970_Shift, // Fixed Point (aka Integer/ALU) Unit
- PPC970_LSU = 2 << PPC970_Shift, // Load Store Unit
- PPC970_FPU = 3 << PPC970_Shift, // Floating Point Unit
- PPC970_CRU = 4 << PPC970_Shift, // Control Register Unit
- PPC970_VALU = 5 << PPC970_Shift, // Vector ALU
- PPC970_VPERM = 6 << PPC970_Shift, // Vector Permute Unit
- PPC970_BRU = 7 << PPC970_Shift // Branch Unit
-};
-}
-
-
-class PPCInstrInfo : public TargetInstrInfoImpl {
- PPCTargetMachine &TM;
- const PPCRegisterInfo RI;
-
- bool StoreRegToStackSlot(unsigned SrcReg, bool isKill, int FrameIdx,
- const TargetRegisterClass *RC,
- SmallVectorImpl<MachineInstr*> &NewMIs) const;
- void LoadRegFromStackSlot(unsigned DestReg, int FrameIdx,
- const TargetRegisterClass *RC,
- SmallVectorImpl<MachineInstr*> &NewMIs) const;
-public:
- explicit PPCInstrInfo(PPCTargetMachine &TM);
-
- /// getRegisterInfo - TargetInstrInfo is a superset of MRegister info. As
- /// such, whenever a client has an instance of instruction info, it should
- /// always be able to get register info as well (through this method).
- ///
- virtual const TargetRegisterInfo &getRegisterInfo() const { return RI; }
-
- /// getPointerRegClass - Return the register class to use to hold pointers.
- /// This is used for addressing modes.
- virtual const TargetRegisterClass *getPointerRegClass() const;
-
- // Return true if the instruction is a register to register move and
- // leave the source and dest operands in the passed parameters.
- //
- virtual bool isMoveInstr(const MachineInstr& MI,
- unsigned& sourceReg,
- unsigned& destReg) const;
-
- unsigned isLoadFromStackSlot(MachineInstr *MI, int &FrameIndex) const;
- unsigned isStoreToStackSlot(MachineInstr *MI, int &FrameIndex) const;
-
- // commuteInstruction - We can commute rlwimi instructions, but only if the
- // rotate amt is zero. We also have to munge the immediates a bit.
- virtual MachineInstr *commuteInstruction(MachineInstr *MI) const;
-
- virtual void insertNoop(MachineBasicBlock &MBB,
- MachineBasicBlock::iterator MI) const;
-
-
- // Branch analysis.
- virtual bool AnalyzeBranch(MachineBasicBlock &MBB, MachineBasicBlock *&TBB,
- MachineBasicBlock *&FBB,
- std::vector<MachineOperand> &Cond) const;
- virtual unsigned RemoveBranch(MachineBasicBlock &MBB) const;
- virtual unsigned InsertBranch(MachineBasicBlock &MBB, MachineBasicBlock *TBB,
- MachineBasicBlock *FBB,
- const std::vector<MachineOperand> &Cond) const;
- virtual void copyRegToReg(MachineBasicBlock &MBB,
- MachineBasicBlock::iterator MI,
- unsigned DestReg, unsigned SrcReg,
- const TargetRegisterClass *DestRC,
- const TargetRegisterClass *SrcRC) const;
-
- virtual void storeRegToStackSlot(MachineBasicBlock &MBB,
- MachineBasicBlock::iterator MBBI,
- unsigned SrcReg, bool isKill, int FrameIndex,
- const TargetRegisterClass *RC) const;
-
- virtual void storeRegToAddr(MachineFunction &MF, unsigned SrcReg, bool isKill,
- SmallVectorImpl<MachineOperand> &Addr,
- const TargetRegisterClass *RC,
- SmallVectorImpl<MachineInstr*> &NewMIs) const;
-
- virtual void loadRegFromStackSlot(MachineBasicBlock &MBB,
- MachineBasicBlock::iterator MBBI,
- unsigned DestReg, int FrameIndex,
- const TargetRegisterClass *RC) const;
-
- virtual void loadRegFromAddr(MachineFunction &MF, unsigned DestReg,
- SmallVectorImpl<MachineOperand> &Addr,
- const TargetRegisterClass *RC,
- SmallVectorImpl<MachineInstr*> &NewMIs) const;
-
- /// foldMemoryOperand - PowerPC (like most RISC's) can only fold spills into
- /// copy instructions, turning them into load/store instructions.
- virtual MachineInstr* foldMemoryOperand(MachineFunction &MF,
- MachineInstr* MI,
- SmallVectorImpl<unsigned> &Ops,
- int FrameIndex) const;
-
- virtual MachineInstr* foldMemoryOperand(MachineFunction &MF,
- MachineInstr* MI,
- SmallVectorImpl<unsigned> &Ops,
- MachineInstr* LoadMI) const {
- return 0;
- }
-
- virtual bool canFoldMemoryOperand(MachineInstr *MI,
- SmallVectorImpl<unsigned> &Ops) const;
-
- virtual bool BlockHasNoFallThrough(MachineBasicBlock &MBB) const;
- virtual bool ReverseBranchCondition(std::vector<MachineOperand> &Cond) const;
-
- /// GetInstSize - Return the number of bytes of code the specified
- /// instruction may be. This returns the maximum number of bytes.
- ///
- virtual unsigned GetInstSizeInBytes(const MachineInstr *MI) const;
-};
-
-}
-
-#endif
diff --git a/release_23/lib/Target/PowerPC/PPCInstrInfo.td b/release_23/lib/Target/PowerPC/PPCInstrInfo.td
deleted file mode 100644
index 04968edf34de..000000000000
--- a/release_23/lib/Target/PowerPC/PPCInstrInfo.td
+++ /dev/null
@@ -1,1335 +0,0 @@
-//===- PPCInstrInfo.td - The PowerPC Instruction Set -------*- tablegen -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file describes the subset of the 32-bit PowerPC instruction set, as used
-// by the PowerPC instruction selector.
-//
-//===----------------------------------------------------------------------===//
-
-include "PPCInstrFormats.td"
-
-//===----------------------------------------------------------------------===//
-// PowerPC specific type constraints.
-//
-def SDT_PPCstfiwx : SDTypeProfile<0, 2, [ // stfiwx
- SDTCisVT<0, f64>, SDTCisPtrTy<1>
-]>;
-def SDT_PPCCallSeqStart : SDCallSeqStart<[ SDTCisVT<0, i32> ]>;
-def SDT_PPCCallSeqEnd : SDCallSeqEnd<[ SDTCisVT<0, i32>,
- SDTCisVT<1, i32> ]>;
-def SDT_PPCvperm : SDTypeProfile<1, 3, [
- SDTCisVT<3, v16i8>, SDTCisSameAs<0, 1>, SDTCisSameAs<0, 2>
-]>;
-
-def SDT_PPCvcmp : SDTypeProfile<1, 3, [
- SDTCisSameAs<0, 1>, SDTCisSameAs<1, 2>, SDTCisVT<3, i32>
-]>;
-
-def SDT_PPCcondbr : SDTypeProfile<0, 3, [
- SDTCisVT<0, i32>, SDTCisVT<2, OtherVT>
-]>;
-
-def SDT_PPClbrx : SDTypeProfile<1, 3, [
- SDTCisVT<0, i32>, SDTCisPtrTy<1>, SDTCisVT<2, OtherVT>, SDTCisVT<3, OtherVT>
-]>;
-def SDT_PPCstbrx : SDTypeProfile<0, 4, [
- SDTCisVT<0, i32>, SDTCisPtrTy<1>, SDTCisVT<2, OtherVT>, SDTCisVT<3, OtherVT>
-]>;
-
-
-def SDT_PPClarx : SDTypeProfile<1, 2, [
- SDTCisInt<0>, SDTCisPtrTy<1>, SDTCisVT<2, i32>
-]>;
-def SDT_PPCstcx : SDTypeProfile<0, 3, [
- SDTCisInt<0>, SDTCisPtrTy<1>, SDTCisVT<2, i32>
-]>;
-def SDT_PPCcmp_unres : SDTypeProfile<0, 3, [
- SDTCisSameAs<0, 1>, SDTCisInt<1>, SDTCisVT<2, i32>
-]>;
-
-def SDT_PPCTC_ret : SDTypeProfile<0, 2, [
- SDTCisPtrTy<0>, SDTCisVT<1, i32>
-]>;
-
-//===----------------------------------------------------------------------===//
-// PowerPC specific DAG Nodes.
-//
-
-def PPCfcfid : SDNode<"PPCISD::FCFID" , SDTFPUnaryOp, []>;
-def PPCfctidz : SDNode<"PPCISD::FCTIDZ", SDTFPUnaryOp, []>;
-def PPCfctiwz : SDNode<"PPCISD::FCTIWZ", SDTFPUnaryOp, []>;
-def PPCstfiwx : SDNode<"PPCISD::STFIWX", SDT_PPCstfiwx,
- [SDNPHasChain, SDNPMayStore]>;
-
-// This sequence is used for long double->int conversions. It changes the
-// bits in the FPSCR which is not modelled.
-def PPCmffs : SDNode<"PPCISD::MFFS", SDTypeProfile<1, 0, [SDTCisVT<0, f64>]>,
- [SDNPOutFlag]>;
-def PPCmtfsb0 : SDNode<"PPCISD::MTFSB0", SDTypeProfile<0, 1, [SDTCisInt<0>]>,
- [SDNPInFlag, SDNPOutFlag]>;
-def PPCmtfsb1 : SDNode<"PPCISD::MTFSB1", SDTypeProfile<0, 1, [SDTCisInt<0>]>,
- [SDNPInFlag, SDNPOutFlag]>;
-def PPCfaddrtz: SDNode<"PPCISD::FADDRTZ", SDTFPBinOp,
- [SDNPInFlag, SDNPOutFlag]>;
-def PPCmtfsf : SDNode<"PPCISD::MTFSF", SDTypeProfile<1, 3,
- [SDTCisVT<0, f64>, SDTCisInt<1>, SDTCisVT<2, f64>,
- SDTCisVT<3, f64>]>,
- [SDNPInFlag]>;
-
-def PPCfsel : SDNode<"PPCISD::FSEL",
- // Type constraint for fsel.
- SDTypeProfile<1, 3, [SDTCisSameAs<0, 2>, SDTCisSameAs<0, 3>,
- SDTCisFP<0>, SDTCisVT<1, f64>]>, []>;
-
-def PPChi : SDNode<"PPCISD::Hi", SDTIntBinOp, []>;
-def PPClo : SDNode<"PPCISD::Lo", SDTIntBinOp, []>;
-def PPCvmaddfp : SDNode<"PPCISD::VMADDFP", SDTFPTernaryOp, []>;
-def PPCvnmsubfp : SDNode<"PPCISD::VNMSUBFP", SDTFPTernaryOp, []>;
-
-def PPCvperm : SDNode<"PPCISD::VPERM", SDT_PPCvperm, []>;
-
-// These nodes represent the 32-bit PPC shifts that operate on 6-bit shift
-// amounts. These nodes are generated by the multi-precision shift code.
-def PPCsrl : SDNode<"PPCISD::SRL" , SDTIntShiftOp>;
-def PPCsra : SDNode<"PPCISD::SRA" , SDTIntShiftOp>;
-def PPCshl : SDNode<"PPCISD::SHL" , SDTIntShiftOp>;
-
-def PPCextsw_32 : SDNode<"PPCISD::EXTSW_32" , SDTIntUnaryOp>;
-def PPCstd_32 : SDNode<"PPCISD::STD_32" , SDTStore,
- [SDNPHasChain, SDNPMayStore]>;
-
-// These are target-independent nodes, but have target-specific formats.
-def callseq_start : SDNode<"ISD::CALLSEQ_START", SDT_PPCCallSeqStart,
- [SDNPHasChain, SDNPOutFlag]>;
-def callseq_end : SDNode<"ISD::CALLSEQ_END", SDT_PPCCallSeqEnd,
- [SDNPHasChain, SDNPOptInFlag, SDNPOutFlag]>;
-
-def SDT_PPCCall : SDTypeProfile<0, -1, [SDTCisInt<0>]>;
-def PPCcall_Macho : SDNode<"PPCISD::CALL_Macho", SDT_PPCCall,
- [SDNPHasChain, SDNPOptInFlag, SDNPOutFlag]>;
-def PPCcall_ELF : SDNode<"PPCISD::CALL_ELF", SDT_PPCCall,
- [SDNPHasChain, SDNPOptInFlag, SDNPOutFlag]>;
-def PPCmtctr : SDNode<"PPCISD::MTCTR", SDT_PPCCall,
- [SDNPHasChain, SDNPOptInFlag, SDNPOutFlag]>;
-def PPCbctrl_Macho : SDNode<"PPCISD::BCTRL_Macho", SDTNone,
- [SDNPHasChain, SDNPOptInFlag, SDNPOutFlag]>;
-
-def PPCbctrl_ELF : SDNode<"PPCISD::BCTRL_ELF", SDTNone,
- [SDNPHasChain, SDNPOptInFlag, SDNPOutFlag]>;
-
-def retflag : SDNode<"PPCISD::RET_FLAG", SDTNone,
- [SDNPHasChain, SDNPOptInFlag]>;
-
-def PPCtc_return : SDNode<"PPCISD::TC_RETURN", SDT_PPCTC_ret,
- [SDNPHasChain, SDNPOptInFlag]>;
-
-def PPCtailcall : SDNode<"PPCISD::TAILCALL", SDT_PPCCall,
- [SDNPHasChain, SDNPOutFlag, SDNPOptInFlag]>;
-
-def PPCvcmp : SDNode<"PPCISD::VCMP" , SDT_PPCvcmp, []>;
-def PPCvcmp_o : SDNode<"PPCISD::VCMPo", SDT_PPCvcmp, [SDNPOutFlag]>;
-
-def PPCcondbranch : SDNode<"PPCISD::COND_BRANCH", SDT_PPCcondbr,
- [SDNPHasChain, SDNPOptInFlag]>;
-
-def PPClbrx : SDNode<"PPCISD::LBRX", SDT_PPClbrx,
- [SDNPHasChain, SDNPMayLoad]>;
-def PPCstbrx : SDNode<"PPCISD::STBRX", SDT_PPCstbrx,
- [SDNPHasChain, SDNPMayStore]>;
-
-def PPClarx : SDNode<"PPCISD::LARX", SDT_PPClarx,
- [SDNPHasChain, SDNPMayLoad]>;
-def PPCstcx : SDNode<"PPCISD::STCX", SDT_PPCstcx,
- [SDNPHasChain, SDNPMayStore]>;
-def PPCcmp_unres : SDNode<"PPCISD::CMP_UNRESERVE", SDT_PPCcmp_unres,
- [SDNPHasChain]>;
-
-// Instructions to support dynamic alloca.
-def SDTDynOp : SDTypeProfile<1, 2, []>;
-def PPCdynalloc : SDNode<"PPCISD::DYNALLOC", SDTDynOp, [SDNPHasChain]>;
-
-//===----------------------------------------------------------------------===//
-// PowerPC specific transformation functions and pattern fragments.
-//
-
-def SHL32 : SDNodeXForm<imm, [{
- // Transformation function: 31 - imm
- return getI32Imm(31 - N->getValue());
-}]>;
-
-def SRL32 : SDNodeXForm<imm, [{
- // Transformation function: 32 - imm
- return N->getValue() ? getI32Imm(32 - N->getValue()) : getI32Imm(0);
-}]>;
-
-def LO16 : SDNodeXForm<imm, [{
- // Transformation function: get the low 16 bits.
- return getI32Imm((unsigned short)N->getValue());
-}]>;
-
-def HI16 : SDNodeXForm<imm, [{
- // Transformation function: shift the immediate value down into the low bits.
- return getI32Imm((unsigned)N->getValue() >> 16);
-}]>;
-
-def HA16 : SDNodeXForm<imm, [{
- // Transformation function: shift the immediate value down into the low bits.
- signed int Val = N->getValue();
- return getI32Imm((Val - (signed short)Val) >> 16);
-}]>;
-def MB : SDNodeXForm<imm, [{
- // Transformation function: get the start bit of a mask
- unsigned mb, me;
- (void)isRunOfOnes((unsigned)N->getValue(), mb, me);
- return getI32Imm(mb);
-}]>;
-
-def ME : SDNodeXForm<imm, [{
- // Transformation function: get the end bit of a mask
- unsigned mb, me;
- (void)isRunOfOnes((unsigned)N->getValue(), mb, me);
- return getI32Imm(me);
-}]>;
-def maskimm32 : PatLeaf<(imm), [{
- // maskImm predicate - True if immediate is a run of ones.
- unsigned mb, me;
- if (N->getValueType(0) == MVT::i32)
- return isRunOfOnes((unsigned)N->getValue(), mb, me);
- else
- return false;
-}]>;
-
-def immSExt16 : PatLeaf<(imm), [{
- // immSExt16 predicate - True if the immediate fits in a 16-bit sign extended
- // field. Used by instructions like 'addi'.
- if (N->getValueType(0) == MVT::i32)
- return (int32_t)N->getValue() == (short)N->getValue();
- else
- return (int64_t)N->getValue() == (short)N->getValue();
-}]>;
-def immZExt16 : PatLeaf<(imm), [{
- // immZExt16 predicate - True if the immediate fits in a 16-bit zero extended
- // field. Used by instructions like 'ori'.
- return (uint64_t)N->getValue() == (unsigned short)N->getValue();
-}], LO16>;
-
-// imm16Shifted* - These match immediates where the low 16-bits are zero. There
-// are two forms: imm16ShiftedSExt and imm16ShiftedZExt. These two forms are
-// identical in 32-bit mode, but in 64-bit mode, they return true if the
-// immediate fits into a sign/zero extended 32-bit immediate (with the low bits
-// clear).
-def imm16ShiftedZExt : PatLeaf<(imm), [{
- // imm16ShiftedZExt predicate - True if only bits in the top 16-bits of the
- // immediate are set. Used by instructions like 'xoris'.
- return (N->getValue() & ~uint64_t(0xFFFF0000)) == 0;
-}], HI16>;
-
-def imm16ShiftedSExt : PatLeaf<(imm), [{
- // imm16ShiftedSExt predicate - True if only bits in the top 16-bits of the
- // immediate are set. Used by instructions like 'addis'. Identical to
- // imm16ShiftedZExt in 32-bit mode.
- if (N->getValue() & 0xFFFF) return false;
- if (N->getValueType(0) == MVT::i32)
- return true;
- // For 64-bit, make sure it is sext right.
- return N->getValue() == (uint64_t)(int)N->getValue();
-}], HI16>;
-
-
-//===----------------------------------------------------------------------===//
-// PowerPC Flag Definitions.
-
-class isPPC64 { bit PPC64 = 1; }
-class isDOT {
- list<Register> Defs = [CR0];
- bit RC = 1;
-}
-
-class RegConstraint<string C> {
- string Constraints = C;
-}
-class NoEncode<string E> {
- string DisableEncoding = E;
-}
-
-
-//===----------------------------------------------------------------------===//
-// PowerPC Operand Definitions.
-
-def s5imm : Operand<i32> {
- let PrintMethod = "printS5ImmOperand";
-}
-def u5imm : Operand<i32> {
- let PrintMethod = "printU5ImmOperand";
-}
-def u6imm : Operand<i32> {
- let PrintMethod = "printU6ImmOperand";
-}
-def s16imm : Operand<i32> {
- let PrintMethod = "printS16ImmOperand";
-}
-def u16imm : Operand<i32> {
- let PrintMethod = "printU16ImmOperand";
-}
-def s16immX4 : Operand<i32> { // Multiply imm by 4 before printing.
- let PrintMethod = "printS16X4ImmOperand";
-}
-def target : Operand<OtherVT> {
- let PrintMethod = "printBranchOperand";
-}
-def calltarget : Operand<iPTR> {
- let PrintMethod = "printCallOperand";
-}
-def aaddr : Operand<iPTR> {
- let PrintMethod = "printAbsAddrOperand";
-}
-def piclabel: Operand<iPTR> {
- let PrintMethod = "printPICLabel";
-}
-def symbolHi: Operand<i32> {
- let PrintMethod = "printSymbolHi";
-}
-def symbolLo: Operand<i32> {
- let PrintMethod = "printSymbolLo";
-}
-def crbitm: Operand<i8> {
- let PrintMethod = "printcrbitm";
-}
-// Address operands
-def memri : Operand<iPTR> {
- let PrintMethod = "printMemRegImm";
- let MIOperandInfo = (ops i32imm:$imm, ptr_rc:$reg);
-}
-def memrr : Operand<iPTR> {
- let PrintMethod = "printMemRegReg";
- let MIOperandInfo = (ops ptr_rc, ptr_rc);
-}
-def memrix : Operand<iPTR> { // memri where the imm is shifted 2 bits.
- let PrintMethod = "printMemRegImmShifted";
- let MIOperandInfo = (ops i32imm:$imm, ptr_rc:$reg);
-}
-
-// PowerPC Predicate operand. 20 = (0<<5)|20 = always, CR0 is a dummy reg
-// that doesn't matter.
-def pred : PredicateOperand<OtherVT, (ops imm, CRRC),
- (ops (i32 20), (i32 zero_reg))> {
- let PrintMethod = "printPredicateOperand";
-}
-
-// Define PowerPC specific addressing mode.
-def iaddr : ComplexPattern<iPTR, 2, "SelectAddrImm", [], []>;
-def xaddr : ComplexPattern<iPTR, 2, "SelectAddrIdx", [], []>;
-def xoaddr : ComplexPattern<iPTR, 2, "SelectAddrIdxOnly",[], []>;
-def ixaddr : ComplexPattern<iPTR, 2, "SelectAddrImmShift", [], []>; // "std"
-
-/// This is just the offset part of iaddr, used for preinc.
-def iaddroff : ComplexPattern<iPTR, 1, "SelectAddrImmOffs", [], []>;
-
-//===----------------------------------------------------------------------===//
-// PowerPC Instruction Predicate Definitions.
-def FPContractions : Predicate<"!NoExcessFPPrecision">;
-def In32BitMode : Predicate<"!PPCSubTarget.isPPC64()">;
-def In64BitMode : Predicate<"PPCSubTarget.isPPC64()">;
-
-
-//===----------------------------------------------------------------------===//
-// PowerPC Instruction Definitions.
-
-// Pseudo-instructions:
-
-let hasCtrlDep = 1 in {
-let Defs = [R1], Uses = [R1] in {
-def ADJCALLSTACKDOWN : Pseudo<(outs), (ins u16imm:$amt),
- "${:comment} ADJCALLSTACKDOWN",
- [(callseq_start imm:$amt)]>;
-def ADJCALLSTACKUP : Pseudo<(outs), (ins u16imm:$amt1, u16imm:$amt2),
- "${:comment} ADJCALLSTACKUP",
- [(callseq_end imm:$amt1, imm:$amt2)]>;
-}
-
-def UPDATE_VRSAVE : Pseudo<(outs GPRC:$rD), (ins GPRC:$rS),
- "UPDATE_VRSAVE $rD, $rS", []>;
-}
-
-let Defs = [R1], Uses = [R1] in
-def DYNALLOC : Pseudo<(outs GPRC:$result), (ins GPRC:$negsize, memri:$fpsi),
- "${:comment} DYNALLOC $result, $negsize, $fpsi",
- [(set GPRC:$result,
- (PPCdynalloc GPRC:$negsize, iaddr:$fpsi))]>;
-
-// SELECT_CC_* - Used to implement the SELECT_CC DAG operation. Expanded by the
-// scheduler into a branch sequence.
-let usesCustomDAGSchedInserter = 1, // Expanded by the scheduler.
- PPC970_Single = 1 in {
- def SELECT_CC_I4 : Pseudo<(outs GPRC:$dst), (ins CRRC:$cond, GPRC:$T, GPRC:$F,
- i32imm:$BROPC), "${:comment} SELECT_CC PSEUDO!",
- []>;
- def SELECT_CC_I8 : Pseudo<(outs G8RC:$dst), (ins CRRC:$cond, G8RC:$T, G8RC:$F,
- i32imm:$BROPC), "${:comment} SELECT_CC PSEUDO!",
- []>;
- def SELECT_CC_F4 : Pseudo<(outs F4RC:$dst), (ins CRRC:$cond, F4RC:$T, F4RC:$F,
- i32imm:$BROPC), "${:comment} SELECT_CC PSEUDO!",
- []>;
- def SELECT_CC_F8 : Pseudo<(outs F8RC:$dst), (ins CRRC:$cond, F8RC:$T, F8RC:$F,
- i32imm:$BROPC), "${:comment} SELECT_CC PSEUDO!",
- []>;
- def SELECT_CC_VRRC: Pseudo<(outs VRRC:$dst), (ins CRRC:$cond, VRRC:$T, VRRC:$F,
- i32imm:$BROPC), "${:comment} SELECT_CC PSEUDO!",
- []>;
-}
-
-// SPILL_CR - Indicate that we're dumping the CR register, so we'll need to
-// scavenge a register for it.
-def SPILL_CR : Pseudo<(outs), (ins GPRC:$cond, memri:$F),
- "${:comment} SPILL_CR $cond $F", []>;
-
-let isTerminator = 1, isBarrier = 1, PPC970_Unit = 7 in {
- let isReturn = 1 in
- def BLR : XLForm_2_br<19, 16, 0, (outs), (ins pred:$p),
- "b${p:cc}lr ${p:reg}", BrB,
- [(retflag)]>;
- let isBranch = 1, isIndirectBranch = 1 in
- def BCTR : XLForm_2_ext<19, 528, 20, 0, 0, (outs), (ins), "bctr", BrB, []>;
-}
-
-let Defs = [LR] in
- def MovePCtoLR : Pseudo<(outs), (ins piclabel:$label), "bl $label", []>,
- PPC970_Unit_BRU;
-
-let isBranch = 1, isTerminator = 1, hasCtrlDep = 1, PPC970_Unit = 7 in {
- let isBarrier = 1 in {
- def B : IForm<18, 0, 0, (outs), (ins target:$dst),
- "b $dst", BrB,
- [(br bb:$dst)]>;
- }
-
- // BCC represents an arbitrary conditional branch on a predicate.
- // FIXME: should be able to write a pattern for PPCcondbranch, but can't use
- // a two-value operand where a dag node expects two operands. :(
- def BCC : BForm<16, 0, 0, (outs), (ins pred:$cond, target:$dst),
- "b${cond:cc} ${cond:reg}, $dst"
- /*[(PPCcondbranch CRRC:$crS, imm:$opc, bb:$dst)]*/>;
-}
-
-// Macho ABI Calls.
-let isCall = 1, PPC970_Unit = 7,
- // All calls clobber the non-callee saved registers...
- Defs = [R0,R2,R3,R4,R5,R6,R7,R8,R9,R10,R11,R12,
- F0,F1,F2,F3,F4,F5,F6,F7,F8,F9,F10,F11,F12,F13,
- V0,V1,V2,V3,V4,V5,V6,V7,V8,V9,V10,V11,V12,V13,V14,V15,V16,V17,V18,V19,
- LR,CTR,
- CR0,CR1,CR5,CR6,CR7,
- CR0LT,CR0GT,CR0EQ,CR0UN,CR1LT,CR1GT,CR1EQ,CR1UN,CR5LT,CR5GT,CR5EQ,
- CR5UN,CR6LT,CR6GT,CR6EQ,CR6UN,CR7LT,CR7GT,CR7EQ,CR7UN] in {
- // Convenient aliases for call instructions
- def BL_Macho : IForm<18, 0, 1,
- (outs), (ins calltarget:$func, variable_ops),
- "bl $func", BrB, []>; // See Pat patterns below.
- def BLA_Macho : IForm<18, 1, 1,
- (outs), (ins aaddr:$func, variable_ops),
- "bla $func", BrB, [(PPCcall_Macho (i32 imm:$func))]>;
- def BCTRL_Macho : XLForm_2_ext<19, 528, 20, 0, 1,
- (outs), (ins variable_ops),
- "bctrl", BrB,
- [(PPCbctrl_Macho)]>, Requires<[In32BitMode]>;
-}
-
-// ELF ABI Calls.
-let isCall = 1, PPC970_Unit = 7,
- // All calls clobber the non-callee saved registers...
- Defs = [R0,R2,R3,R4,R5,R6,R7,R8,R9,R10,R11,R12,
- F0,F1,F2,F3,F4,F5,F6,F7,F8,
- V0,V1,V2,V3,V4,V5,V6,V7,V8,V9,V10,V11,V12,V13,V14,V15,V16,V17,V18,V19,
- LR,CTR,
- CR0,CR1,CR5,CR6,CR7,
- CR0LT,CR0GT,CR0EQ,CR0UN,CR1LT,CR1GT,CR1EQ,CR1UN,CR5LT,CR5GT,CR5EQ,
- CR5UN,CR6LT,CR6GT,CR6EQ,CR6UN,CR7LT,CR7GT,CR7EQ,CR7UN] in {
- // Convenient aliases for call instructions
- def BL_ELF : IForm<18, 0, 1,
- (outs), (ins calltarget:$func, variable_ops),
- "bl $func", BrB, []>; // See Pat patterns below.
- def BLA_ELF : IForm<18, 1, 1,
- (outs), (ins aaddr:$func, variable_ops),
- "bla $func", BrB,
- [(PPCcall_ELF (i32 imm:$func))]>;
- def BCTRL_ELF : XLForm_2_ext<19, 528, 20, 0, 1,
- (outs), (ins variable_ops),
- "bctrl", BrB,
- [(PPCbctrl_ELF)]>, Requires<[In32BitMode]>;
-}
-
-
-let isCall = 1, isTerminator = 1, isReturn = 1, isBarrier = 1 in
-def TCRETURNdi :Pseudo< (outs),
- (ins calltarget:$dst, i32imm:$offset, variable_ops),
- "#TC_RETURNd $dst $offset",
- []>;
-
-
-let isCall = 1, isTerminator = 1, isReturn = 1, isBarrier = 1 in
-def TCRETURNai :Pseudo<(outs), (ins aaddr:$func, i32imm:$offset, variable_ops),
- "#TC_RETURNa $func $offset",
- [(PPCtc_return (i32 imm:$func), imm:$offset)]>;
-
-let isCall = 1, isTerminator = 1, isReturn = 1, isBarrier = 1 in
-def TCRETURNri : Pseudo<(outs), (ins CTRRC:$dst, i32imm:$offset, variable_ops),
- "#TC_RETURNr $dst $offset",
- []>;
-
-
-let isTerminator = 1, isBarrier = 1, PPC970_Unit = 7, isBranch = 1,
- isIndirectBranch = 1, isCall = 1, isReturn = 1 in
-def TAILBCTR : XLForm_2_ext<19, 528, 20, 0, 0, (outs), (ins), "bctr", BrB, []>,
- Requires<[In32BitMode]>;
-
-
-
-let isBranch = 1, isTerminator = 1, hasCtrlDep = 1, PPC970_Unit = 7,
- isBarrier = 1, isCall = 1, isReturn = 1 in
-def TAILB : IForm<18, 0, 0, (outs), (ins calltarget:$dst),
- "b $dst", BrB,
- []>;
-
-
-let isBranch = 1, isTerminator = 1, hasCtrlDep = 1, PPC970_Unit = 7,
- isBarrier = 1, isCall = 1, isReturn = 1 in
-def TAILBA : IForm<18, 0, 0, (outs), (ins aaddr:$dst),
- "ba $dst", BrB,
- []>;
-
-
-// DCB* instructions.
-def DCBA : DCB_Form<758, 0, (outs), (ins memrr:$dst),
- "dcba $dst", LdStDCBF, [(int_ppc_dcba xoaddr:$dst)]>,
- PPC970_DGroup_Single;
-def DCBF : DCB_Form<86, 0, (outs), (ins memrr:$dst),
- "dcbf $dst", LdStDCBF, [(int_ppc_dcbf xoaddr:$dst)]>,
- PPC970_DGroup_Single;
-def DCBI : DCB_Form<470, 0, (outs), (ins memrr:$dst),
- "dcbi $dst", LdStDCBF, [(int_ppc_dcbi xoaddr:$dst)]>,
- PPC970_DGroup_Single;
-def DCBST : DCB_Form<54, 0, (outs), (ins memrr:$dst),
- "dcbst $dst", LdStDCBF, [(int_ppc_dcbst xoaddr:$dst)]>,
- PPC970_DGroup_Single;
-def DCBT : DCB_Form<278, 0, (outs), (ins memrr:$dst),
- "dcbt $dst", LdStDCBF, [(int_ppc_dcbt xoaddr:$dst)]>,
- PPC970_DGroup_Single;
-def DCBTST : DCB_Form<246, 0, (outs), (ins memrr:$dst),
- "dcbtst $dst", LdStDCBF, [(int_ppc_dcbtst xoaddr:$dst)]>,
- PPC970_DGroup_Single;
-def DCBZ : DCB_Form<1014, 0, (outs), (ins memrr:$dst),
- "dcbz $dst", LdStDCBF, [(int_ppc_dcbz xoaddr:$dst)]>,
- PPC970_DGroup_Single;
-def DCBZL : DCB_Form<1014, 1, (outs), (ins memrr:$dst),
- "dcbzl $dst", LdStDCBF, [(int_ppc_dcbzl xoaddr:$dst)]>,
- PPC970_DGroup_Single;
-
-// Atomic operations.
-def LWARX : Pseudo<(outs GPRC:$rD), (ins memrr:$ptr, i32imm:$label),
- "\nLa${label}_entry:\n\tlwarx $rD, $ptr",
- [(set GPRC:$rD, (PPClarx xoaddr:$ptr, imm:$label))]>;
-
-let Defs = [CR0] in {
-def STWCX : Pseudo<(outs), (ins GPRC:$rS, memrr:$dst, i32imm:$label),
- "stwcx. $rS, $dst\n\tbne- La${label}_entry\nLa${label}_exit:",
- [(PPCstcx GPRC:$rS, xoaddr:$dst, imm:$label)]>;
-
-def CMP_UNRESw : Pseudo<(outs), (ins GPRC:$rA, GPRC:$rB, i32imm:$label),
- "cmpw $rA, $rB\n\tbne- La${label}_exit",
- [(PPCcmp_unres GPRC:$rA, GPRC:$rB, imm:$label)]>;
-def CMP_UNRESwi : Pseudo<(outs), (ins GPRC:$rA, s16imm:$imm, i32imm:$label),
- "cmpwi $rA, $imm\n\tbne- La${label}_exit",
- [(PPCcmp_unres GPRC:$rA, immSExt16:$imm, imm:$label)]>;
-}
-
-//===----------------------------------------------------------------------===//
-// PPC32 Load Instructions.
-//
-
-// Unindexed (r+i) Loads.
-let isSimpleLoad = 1, PPC970_Unit = 2 in {
-def LBZ : DForm_1<34, (outs GPRC:$rD), (ins memri:$src),
- "lbz $rD, $src", LdStGeneral,
- [(set GPRC:$rD, (zextloadi8 iaddr:$src))]>;
-def LHA : DForm_1<42, (outs GPRC:$rD), (ins memri:$src),
- "lha $rD, $src", LdStLHA,
- [(set GPRC:$rD, (sextloadi16 iaddr:$src))]>,
- PPC970_DGroup_Cracked;
-def LHZ : DForm_1<40, (outs GPRC:$rD), (ins memri:$src),
- "lhz $rD, $src", LdStGeneral,
- [(set GPRC:$rD, (zextloadi16 iaddr:$src))]>;
-def LWZ : DForm_1<32, (outs GPRC:$rD), (ins memri:$src),
- "lwz $rD, $src", LdStGeneral,
- [(set GPRC:$rD, (load iaddr:$src))]>;
-
-def LFS : DForm_1<48, (outs F4RC:$rD), (ins memri:$src),
- "lfs $rD, $src", LdStLFDU,
- [(set F4RC:$rD, (load iaddr:$src))]>;
-def LFD : DForm_1<50, (outs F8RC:$rD), (ins memri:$src),
- "lfd $rD, $src", LdStLFD,
- [(set F8RC:$rD, (load iaddr:$src))]>;
-
-
-// Unindexed (r+i) Loads with Update (preinc).
-def LBZU : DForm_1<35, (outs GPRC:$rD, ptr_rc:$ea_result), (ins memri:$addr),
- "lbzu $rD, $addr", LdStGeneral,
- []>, RegConstraint<"$addr.reg = $ea_result">,
- NoEncode<"$ea_result">;
-
-def LHAU : DForm_1<43, (outs GPRC:$rD, ptr_rc:$ea_result), (ins memri:$addr),
- "lhau $rD, $addr", LdStGeneral,
- []>, RegConstraint<"$addr.reg = $ea_result">,
- NoEncode<"$ea_result">;
-
-def LHZU : DForm_1<41, (outs GPRC:$rD, ptr_rc:$ea_result), (ins memri:$addr),
- "lhzu $rD, $addr", LdStGeneral,
- []>, RegConstraint<"$addr.reg = $ea_result">,
- NoEncode<"$ea_result">;
-
-def LWZU : DForm_1<33, (outs GPRC:$rD, ptr_rc:$ea_result), (ins memri:$addr),
- "lwzu $rD, $addr", LdStGeneral,
- []>, RegConstraint<"$addr.reg = $ea_result">,
- NoEncode<"$ea_result">;
-
-def LFSU : DForm_1<49, (outs F4RC:$rD, ptr_rc:$ea_result), (ins memri:$addr),
- "lfs $rD, $addr", LdStLFDU,
- []>, RegConstraint<"$addr.reg = $ea_result">,
- NoEncode<"$ea_result">;
-
-def LFDU : DForm_1<51, (outs F8RC:$rD, ptr_rc:$ea_result), (ins memri:$addr),
- "lfd $rD, $addr", LdStLFD,
- []>, RegConstraint<"$addr.reg = $ea_result">,
- NoEncode<"$ea_result">;
-}
-
-// Indexed (r+r) Loads.
-//
-let isSimpleLoad = 1, PPC970_Unit = 2 in {
-def LBZX : XForm_1<31, 87, (outs GPRC:$rD), (ins memrr:$src),
- "lbzx $rD, $src", LdStGeneral,
- [(set GPRC:$rD, (zextloadi8 xaddr:$src))]>;
-def LHAX : XForm_1<31, 343, (outs GPRC:$rD), (ins memrr:$src),
- "lhax $rD, $src", LdStLHA,
- [(set GPRC:$rD, (sextloadi16 xaddr:$src))]>,
- PPC970_DGroup_Cracked;
-def LHZX : XForm_1<31, 279, (outs GPRC:$rD), (ins memrr:$src),
- "lhzx $rD, $src", LdStGeneral,
- [(set GPRC:$rD, (zextloadi16 xaddr:$src))]>;
-def LWZX : XForm_1<31, 23, (outs GPRC:$rD), (ins memrr:$src),
- "lwzx $rD, $src", LdStGeneral,
- [(set GPRC:$rD, (load xaddr:$src))]>;
-
-
-def LHBRX : XForm_1<31, 790, (outs GPRC:$rD), (ins memrr:$src),
- "lhbrx $rD, $src", LdStGeneral,
- [(set GPRC:$rD, (PPClbrx xoaddr:$src, srcvalue:$sv, i16))]>;
-def LWBRX : XForm_1<31, 534, (outs GPRC:$rD), (ins memrr:$src),
- "lwbrx $rD, $src", LdStGeneral,
- [(set GPRC:$rD, (PPClbrx xoaddr:$src, srcvalue:$sv, i32))]>;
-
-def LFSX : XForm_25<31, 535, (outs F4RC:$frD), (ins memrr:$src),
- "lfsx $frD, $src", LdStLFDU,
- [(set F4RC:$frD, (load xaddr:$src))]>;
-def LFDX : XForm_25<31, 599, (outs F8RC:$frD), (ins memrr:$src),
- "lfdx $frD, $src", LdStLFDU,
- [(set F8RC:$frD, (load xaddr:$src))]>;
-}
-
-//===----------------------------------------------------------------------===//
-// PPC32 Store Instructions.
-//
-
-// Unindexed (r+i) Stores.
-let PPC970_Unit = 2 in {
-def STB : DForm_1<38, (outs), (ins GPRC:$rS, memri:$src),
- "stb $rS, $src", LdStGeneral,
- [(truncstorei8 GPRC:$rS, iaddr:$src)]>;
-def STH : DForm_1<44, (outs), (ins GPRC:$rS, memri:$src),
- "sth $rS, $src", LdStGeneral,
- [(truncstorei16 GPRC:$rS, iaddr:$src)]>;
-def STW : DForm_1<36, (outs), (ins GPRC:$rS, memri:$src),
- "stw $rS, $src", LdStGeneral,
- [(store GPRC:$rS, iaddr:$src)]>;
-def STFS : DForm_1<52, (outs), (ins F4RC:$rS, memri:$dst),
- "stfs $rS, $dst", LdStUX,
- [(store F4RC:$rS, iaddr:$dst)]>;
-def STFD : DForm_1<54, (outs), (ins F8RC:$rS, memri:$dst),
- "stfd $rS, $dst", LdStUX,
- [(store F8RC:$rS, iaddr:$dst)]>;
-}
-
-// Unindexed (r+i) Stores with Update (preinc).
-let PPC970_Unit = 2 in {
-def STBU : DForm_1<39, (outs ptr_rc:$ea_res), (ins GPRC:$rS,
- symbolLo:$ptroff, ptr_rc:$ptrreg),
- "stbu $rS, $ptroff($ptrreg)", LdStGeneral,
- [(set ptr_rc:$ea_res,
- (pre_truncsti8 GPRC:$rS, ptr_rc:$ptrreg,
- iaddroff:$ptroff))]>,
- RegConstraint<"$ptrreg = $ea_res">, NoEncode<"$ea_res">;
-def STHU : DForm_1<45, (outs ptr_rc:$ea_res), (ins GPRC:$rS,
- symbolLo:$ptroff, ptr_rc:$ptrreg),
- "sthu $rS, $ptroff($ptrreg)", LdStGeneral,
- [(set ptr_rc:$ea_res,
- (pre_truncsti16 GPRC:$rS, ptr_rc:$ptrreg,
- iaddroff:$ptroff))]>,
- RegConstraint<"$ptrreg = $ea_res">, NoEncode<"$ea_res">;
-def STWU : DForm_1<37, (outs ptr_rc:$ea_res), (ins GPRC:$rS,
- symbolLo:$ptroff, ptr_rc:$ptrreg),
- "stwu $rS, $ptroff($ptrreg)", LdStGeneral,
- [(set ptr_rc:$ea_res, (pre_store GPRC:$rS, ptr_rc:$ptrreg,
- iaddroff:$ptroff))]>,
- RegConstraint<"$ptrreg = $ea_res">, NoEncode<"$ea_res">;
-def STFSU : DForm_1<37, (outs ptr_rc:$ea_res), (ins F4RC:$rS,
- symbolLo:$ptroff, ptr_rc:$ptrreg),
- "stfsu $rS, $ptroff($ptrreg)", LdStGeneral,
- [(set ptr_rc:$ea_res, (pre_store F4RC:$rS, ptr_rc:$ptrreg,
- iaddroff:$ptroff))]>,
- RegConstraint<"$ptrreg = $ea_res">, NoEncode<"$ea_res">;
-def STFDU : DForm_1<37, (outs ptr_rc:$ea_res), (ins F8RC:$rS,
- symbolLo:$ptroff, ptr_rc:$ptrreg),
- "stfdu $rS, $ptroff($ptrreg)", LdStGeneral,
- [(set ptr_rc:$ea_res, (pre_store F8RC:$rS, ptr_rc:$ptrreg,
- iaddroff:$ptroff))]>,
- RegConstraint<"$ptrreg = $ea_res">, NoEncode<"$ea_res">;
-}
-
-
-// Indexed (r+r) Stores.
-//
-let PPC970_Unit = 2 in {
-def STBX : XForm_8<31, 215, (outs), (ins GPRC:$rS, memrr:$dst),
- "stbx $rS, $dst", LdStGeneral,
- [(truncstorei8 GPRC:$rS, xaddr:$dst)]>,
- PPC970_DGroup_Cracked;
-def STHX : XForm_8<31, 407, (outs), (ins GPRC:$rS, memrr:$dst),
- "sthx $rS, $dst", LdStGeneral,
- [(truncstorei16 GPRC:$rS, xaddr:$dst)]>,
- PPC970_DGroup_Cracked;
-def STWX : XForm_8<31, 151, (outs), (ins GPRC:$rS, memrr:$dst),
- "stwx $rS, $dst", LdStGeneral,
- [(store GPRC:$rS, xaddr:$dst)]>,
- PPC970_DGroup_Cracked;
-
-let mayStore = 1 in {
-def STWUX : XForm_8<31, 183, (outs), (ins GPRC:$rS, GPRC:$rA, GPRC:$rB),
- "stwux $rS, $rA, $rB", LdStGeneral,
- []>;
-}
-def STHBRX: XForm_8<31, 918, (outs), (ins GPRC:$rS, memrr:$dst),
- "sthbrx $rS, $dst", LdStGeneral,
- [(PPCstbrx GPRC:$rS, xoaddr:$dst, srcvalue:$dummy, i16)]>,
- PPC970_DGroup_Cracked;
-def STWBRX: XForm_8<31, 662, (outs), (ins GPRC:$rS, memrr:$dst),
- "stwbrx $rS, $dst", LdStGeneral,
- [(PPCstbrx GPRC:$rS, xoaddr:$dst, srcvalue:$dummy, i32)]>,
- PPC970_DGroup_Cracked;
-
-def STFIWX: XForm_28<31, 983, (outs), (ins F8RC:$frS, memrr:$dst),
- "stfiwx $frS, $dst", LdStUX,
- [(PPCstfiwx F8RC:$frS, xoaddr:$dst)]>;
-
-def STFSX : XForm_28<31, 663, (outs), (ins F4RC:$frS, memrr:$dst),
- "stfsx $frS, $dst", LdStUX,
- [(store F4RC:$frS, xaddr:$dst)]>;
-def STFDX : XForm_28<31, 727, (outs), (ins F8RC:$frS, memrr:$dst),
- "stfdx $frS, $dst", LdStUX,
- [(store F8RC:$frS, xaddr:$dst)]>;
-}
-
-
-//===----------------------------------------------------------------------===//
-// PPC32 Arithmetic Instructions.
-//
-
-let PPC970_Unit = 1 in { // FXU Operations.
-def ADDI : DForm_2<14, (outs GPRC:$rD), (ins GPRC:$rA, s16imm:$imm),
- "addi $rD, $rA, $imm", IntGeneral,
- [(set GPRC:$rD, (add GPRC:$rA, immSExt16:$imm))]>;
-def ADDIC : DForm_2<12, (outs GPRC:$rD), (ins GPRC:$rA, s16imm:$imm),
- "addic $rD, $rA, $imm", IntGeneral,
- [(set GPRC:$rD, (addc GPRC:$rA, immSExt16:$imm))]>,
- PPC970_DGroup_Cracked;
-def ADDICo : DForm_2<13, (outs GPRC:$rD), (ins GPRC:$rA, s16imm:$imm),
- "addic. $rD, $rA, $imm", IntGeneral,
- []>;
-def ADDIS : DForm_2<15, (outs GPRC:$rD), (ins GPRC:$rA, symbolHi:$imm),
- "addis $rD, $rA, $imm", IntGeneral,
- [(set GPRC:$rD, (add GPRC:$rA, imm16ShiftedSExt:$imm))]>;
-def LA : DForm_2<14, (outs GPRC:$rD), (ins GPRC:$rA, symbolLo:$sym),
- "la $rD, $sym($rA)", IntGeneral,
- [(set GPRC:$rD, (add GPRC:$rA,
- (PPClo tglobaladdr:$sym, 0)))]>;
-def MULLI : DForm_2< 7, (outs GPRC:$rD), (ins GPRC:$rA, s16imm:$imm),
- "mulli $rD, $rA, $imm", IntMulLI,
- [(set GPRC:$rD, (mul GPRC:$rA, immSExt16:$imm))]>;
-def SUBFIC : DForm_2< 8, (outs GPRC:$rD), (ins GPRC:$rA, s16imm:$imm),
- "subfic $rD, $rA, $imm", IntGeneral,
- [(set GPRC:$rD, (subc immSExt16:$imm, GPRC:$rA))]>;
-
-let isReMaterializable = 1 in {
- def LI : DForm_2_r0<14, (outs GPRC:$rD), (ins symbolLo:$imm),
- "li $rD, $imm", IntGeneral,
- [(set GPRC:$rD, immSExt16:$imm)]>;
- def LIS : DForm_2_r0<15, (outs GPRC:$rD), (ins symbolHi:$imm),
- "lis $rD, $imm", IntGeneral,
- [(set GPRC:$rD, imm16ShiftedSExt:$imm)]>;
-}
-}
-
-let PPC970_Unit = 1 in { // FXU Operations.
-def ANDIo : DForm_4<28, (outs GPRC:$dst), (ins GPRC:$src1, u16imm:$src2),
- "andi. $dst, $src1, $src2", IntGeneral,
- [(set GPRC:$dst, (and GPRC:$src1, immZExt16:$src2))]>,
- isDOT;
-def ANDISo : DForm_4<29, (outs GPRC:$dst), (ins GPRC:$src1, u16imm:$src2),
- "andis. $dst, $src1, $src2", IntGeneral,
- [(set GPRC:$dst, (and GPRC:$src1,imm16ShiftedZExt:$src2))]>,
- isDOT;
-def ORI : DForm_4<24, (outs GPRC:$dst), (ins GPRC:$src1, u16imm:$src2),
- "ori $dst, $src1, $src2", IntGeneral,
- [(set GPRC:$dst, (or GPRC:$src1, immZExt16:$src2))]>;
-def ORIS : DForm_4<25, (outs GPRC:$dst), (ins GPRC:$src1, u16imm:$src2),
- "oris $dst, $src1, $src2", IntGeneral,
- [(set GPRC:$dst, (or GPRC:$src1, imm16ShiftedZExt:$src2))]>;
-def XORI : DForm_4<26, (outs GPRC:$dst), (ins GPRC:$src1, u16imm:$src2),
- "xori $dst, $src1, $src2", IntGeneral,
- [(set GPRC:$dst, (xor GPRC:$src1, immZExt16:$src2))]>;
-def XORIS : DForm_4<27, (outs GPRC:$dst), (ins GPRC:$src1, u16imm:$src2),
- "xoris $dst, $src1, $src2", IntGeneral,
- [(set GPRC:$dst, (xor GPRC:$src1,imm16ShiftedZExt:$src2))]>;
-def NOP : DForm_4_zero<24, (outs), (ins), "nop", IntGeneral,
- []>;
-def CMPWI : DForm_5_ext<11, (outs CRRC:$crD), (ins GPRC:$rA, s16imm:$imm),
- "cmpwi $crD, $rA, $imm", IntCompare>;
-def CMPLWI : DForm_6_ext<10, (outs CRRC:$dst), (ins GPRC:$src1, u16imm:$src2),
- "cmplwi $dst, $src1, $src2", IntCompare>;
-}
-
-
-let PPC970_Unit = 1 in { // FXU Operations.
-def NAND : XForm_6<31, 476, (outs GPRC:$rA), (ins GPRC:$rS, GPRC:$rB),
- "nand $rA, $rS, $rB", IntGeneral,
- [(set GPRC:$rA, (not (and GPRC:$rS, GPRC:$rB)))]>;
-def AND : XForm_6<31, 28, (outs GPRC:$rA), (ins GPRC:$rS, GPRC:$rB),
- "and $rA, $rS, $rB", IntGeneral,
- [(set GPRC:$rA, (and GPRC:$rS, GPRC:$rB))]>;
-def ANDC : XForm_6<31, 60, (outs GPRC:$rA), (ins GPRC:$rS, GPRC:$rB),
- "andc $rA, $rS, $rB", IntGeneral,
- [(set GPRC:$rA, (and GPRC:$rS, (not GPRC:$rB)))]>;
-def OR : XForm_6<31, 444, (outs GPRC:$rA), (ins GPRC:$rS, GPRC:$rB),
- "or $rA, $rS, $rB", IntGeneral,
- [(set GPRC:$rA, (or GPRC:$rS, GPRC:$rB))]>;
-def NOR : XForm_6<31, 124, (outs GPRC:$rA), (ins GPRC:$rS, GPRC:$rB),
- "nor $rA, $rS, $rB", IntGeneral,
- [(set GPRC:$rA, (not (or GPRC:$rS, GPRC:$rB)))]>;
-def ORC : XForm_6<31, 412, (outs GPRC:$rA), (ins GPRC:$rS, GPRC:$rB),
- "orc $rA, $rS, $rB", IntGeneral,
- [(set GPRC:$rA, (or GPRC:$rS, (not GPRC:$rB)))]>;
-def EQV : XForm_6<31, 284, (outs GPRC:$rA), (ins GPRC:$rS, GPRC:$rB),
- "eqv $rA, $rS, $rB", IntGeneral,
- [(set GPRC:$rA, (not (xor GPRC:$rS, GPRC:$rB)))]>;
-def XOR : XForm_6<31, 316, (outs GPRC:$rA), (ins GPRC:$rS, GPRC:$rB),
- "xor $rA, $rS, $rB", IntGeneral,
- [(set GPRC:$rA, (xor GPRC:$rS, GPRC:$rB))]>;
-def SLW : XForm_6<31, 24, (outs GPRC:$rA), (ins GPRC:$rS, GPRC:$rB),
- "slw $rA, $rS, $rB", IntGeneral,
- [(set GPRC:$rA, (PPCshl GPRC:$rS, GPRC:$rB))]>;
-def SRW : XForm_6<31, 536, (outs GPRC:$rA), (ins GPRC:$rS, GPRC:$rB),
- "srw $rA, $rS, $rB", IntGeneral,
- [(set GPRC:$rA, (PPCsrl GPRC:$rS, GPRC:$rB))]>;
-def SRAW : XForm_6<31, 792, (outs GPRC:$rA), (ins GPRC:$rS, GPRC:$rB),
- "sraw $rA, $rS, $rB", IntShift,
- [(set GPRC:$rA, (PPCsra GPRC:$rS, GPRC:$rB))]>;
-}
-
-let PPC970_Unit = 1 in { // FXU Operations.
-def SRAWI : XForm_10<31, 824, (outs GPRC:$rA), (ins GPRC:$rS, u5imm:$SH),
- "srawi $rA, $rS, $SH", IntShift,
- [(set GPRC:$rA, (sra GPRC:$rS, (i32 imm:$SH)))]>;
-def CNTLZW : XForm_11<31, 26, (outs GPRC:$rA), (ins GPRC:$rS),
- "cntlzw $rA, $rS", IntGeneral,
- [(set GPRC:$rA, (ctlz GPRC:$rS))]>;
-def EXTSB : XForm_11<31, 954, (outs GPRC:$rA), (ins GPRC:$rS),
- "extsb $rA, $rS", IntGeneral,
- [(set GPRC:$rA, (sext_inreg GPRC:$rS, i8))]>;
-def EXTSH : XForm_11<31, 922, (outs GPRC:$rA), (ins GPRC:$rS),
- "extsh $rA, $rS", IntGeneral,
- [(set GPRC:$rA, (sext_inreg GPRC:$rS, i16))]>;
-
-def CMPW : XForm_16_ext<31, 0, (outs CRRC:$crD), (ins GPRC:$rA, GPRC:$rB),
- "cmpw $crD, $rA, $rB", IntCompare>;
-def CMPLW : XForm_16_ext<31, 32, (outs CRRC:$crD), (ins GPRC:$rA, GPRC:$rB),
- "cmplw $crD, $rA, $rB", IntCompare>;
-}
-let PPC970_Unit = 3 in { // FPU Operations.
-//def FCMPO : XForm_17<63, 32, (outs CRRC:$crD), (ins FPRC:$fA, FPRC:$fB),
-// "fcmpo $crD, $fA, $fB", FPCompare>;
-def FCMPUS : XForm_17<63, 0, (outs CRRC:$crD), (ins F4RC:$fA, F4RC:$fB),
- "fcmpu $crD, $fA, $fB", FPCompare>;
-def FCMPUD : XForm_17<63, 0, (outs CRRC:$crD), (ins F8RC:$fA, F8RC:$fB),
- "fcmpu $crD, $fA, $fB", FPCompare>;
-
-def FCTIWZ : XForm_26<63, 15, (outs F8RC:$frD), (ins F8RC:$frB),
- "fctiwz $frD, $frB", FPGeneral,
- [(set F8RC:$frD, (PPCfctiwz F8RC:$frB))]>;
-def FRSP : XForm_26<63, 12, (outs F4RC:$frD), (ins F8RC:$frB),
- "frsp $frD, $frB", FPGeneral,
- [(set F4RC:$frD, (fround F8RC:$frB))]>;
-def FSQRT : XForm_26<63, 22, (outs F8RC:$frD), (ins F8RC:$frB),
- "fsqrt $frD, $frB", FPSqrt,
- [(set F8RC:$frD, (fsqrt F8RC:$frB))]>;
-def FSQRTS : XForm_26<59, 22, (outs F4RC:$frD), (ins F4RC:$frB),
- "fsqrts $frD, $frB", FPSqrt,
- [(set F4RC:$frD, (fsqrt F4RC:$frB))]>;
-}
-
-/// FMR is split into 3 versions, one for 4/8 byte FP, and one for extending.
-///
-/// Note that these are defined as pseudo-ops on the PPC970 because they are
-/// often coalesced away and we don't want the dispatch group builder to think
-/// that they will fill slots (which could cause the load of a LSU reject to
-/// sneak into a d-group with a store).
-def FMRS : XForm_26<63, 72, (outs F4RC:$frD), (ins F4RC:$frB),
- "fmr $frD, $frB", FPGeneral,
- []>, // (set F4RC:$frD, F4RC:$frB)
- PPC970_Unit_Pseudo;
-def FMRD : XForm_26<63, 72, (outs F8RC:$frD), (ins F8RC:$frB),
- "fmr $frD, $frB", FPGeneral,
- []>, // (set F8RC:$frD, F8RC:$frB)
- PPC970_Unit_Pseudo;
-def FMRSD : XForm_26<63, 72, (outs F8RC:$frD), (ins F4RC:$frB),
- "fmr $frD, $frB", FPGeneral,
- [(set F8RC:$frD, (fextend F4RC:$frB))]>,
- PPC970_Unit_Pseudo;
-
-let PPC970_Unit = 3 in { // FPU Operations.
-// These are artificially split into two different forms, for 4/8 byte FP.
-def FABSS : XForm_26<63, 264, (outs F4RC:$frD), (ins F4RC:$frB),
- "fabs $frD, $frB", FPGeneral,
- [(set F4RC:$frD, (fabs F4RC:$frB))]>;
-def FABSD : XForm_26<63, 264, (outs F8RC:$frD), (ins F8RC:$frB),
- "fabs $frD, $frB", FPGeneral,
- [(set F8RC:$frD, (fabs F8RC:$frB))]>;
-def FNABSS : XForm_26<63, 136, (outs F4RC:$frD), (ins F4RC:$frB),
- "fnabs $frD, $frB", FPGeneral,
- [(set F4RC:$frD, (fneg (fabs F4RC:$frB)))]>;
-def FNABSD : XForm_26<63, 136, (outs F8RC:$frD), (ins F8RC:$frB),
- "fnabs $frD, $frB", FPGeneral,
- [(set F8RC:$frD, (fneg (fabs F8RC:$frB)))]>;
-def FNEGS : XForm_26<63, 40, (outs F4RC:$frD), (ins F4RC:$frB),
- "fneg $frD, $frB", FPGeneral,
- [(set F4RC:$frD, (fneg F4RC:$frB))]>;
-def FNEGD : XForm_26<63, 40, (outs F8RC:$frD), (ins F8RC:$frB),
- "fneg $frD, $frB", FPGeneral,
- [(set F8RC:$frD, (fneg F8RC:$frB))]>;
-}
-
-
-// XL-Form instructions. condition register logical ops.
-//
-def MCRF : XLForm_3<19, 0, (outs CRRC:$BF), (ins CRRC:$BFA),
- "mcrf $BF, $BFA", BrMCR>,
- PPC970_DGroup_First, PPC970_Unit_CRU;
-
-def CREQV : XLForm_1<19, 289, (outs CRBITRC:$CRD),
- (ins CRBITRC:$CRA, CRBITRC:$CRB),
- "creqv $CRD, $CRA, $CRB", BrCR,
- []>;
-
-def CROR : XLForm_1<19, 449, (outs CRBITRC:$CRD),
- (ins CRBITRC:$CRA, CRBITRC:$CRB),
- "cror $CRD, $CRA, $CRB", BrCR,
- []>;
-
-def CRSET : XLForm_1_ext<19, 289, (outs CRBITRC:$dst), (ins),
- "creqv $dst, $dst, $dst", BrCR,
- []>;
-
-// XFX-Form instructions. Instructions that deal with SPRs.
-//
-def MFCTR : XFXForm_1_ext<31, 339, 9, (outs GPRC:$rT), (ins),
- "mfctr $rT", SprMFSPR>,
- PPC970_DGroup_First, PPC970_Unit_FXU;
-let Pattern = [(PPCmtctr GPRC:$rS)] in {
-def MTCTR : XFXForm_7_ext<31, 467, 9, (outs), (ins GPRC:$rS),
- "mtctr $rS", SprMTSPR>,
- PPC970_DGroup_First, PPC970_Unit_FXU;
-}
-
-def MTLR : XFXForm_7_ext<31, 467, 8, (outs), (ins GPRC:$rS),
- "mtlr $rS", SprMTSPR>,
- PPC970_DGroup_First, PPC970_Unit_FXU;
-def MFLR : XFXForm_1_ext<31, 339, 8, (outs GPRC:$rT), (ins),
- "mflr $rT", SprMFSPR>,
- PPC970_DGroup_First, PPC970_Unit_FXU;
-
-// Move to/from VRSAVE: despite being a SPR, the VRSAVE register is renamed like
-// a GPR on the PPC970. As such, copies in and out have the same performance
-// characteristics as an OR instruction.
-def MTVRSAVE : XFXForm_7_ext<31, 467, 256, (outs), (ins GPRC:$rS),
- "mtspr 256, $rS", IntGeneral>,
- PPC970_DGroup_Single, PPC970_Unit_FXU;
-def MFVRSAVE : XFXForm_1_ext<31, 339, 256, (outs GPRC:$rT), (ins),
- "mfspr $rT, 256", IntGeneral>,
- PPC970_DGroup_First, PPC970_Unit_FXU;
-
-def MTCRF : XFXForm_5<31, 144, (outs), (ins crbitm:$FXM, GPRC:$rS),
- "mtcrf $FXM, $rS", BrMCRX>,
- PPC970_MicroCode, PPC970_Unit_CRU;
-def MFCR : XFXForm_3<31, 19, (outs GPRC:$rT), (ins), "mfcr $rT", SprMFCR>,
- PPC970_MicroCode, PPC970_Unit_CRU;
-def MFOCRF: XFXForm_5a<31, 19, (outs GPRC:$rT), (ins crbitm:$FXM),
- "mfcr $rT, $FXM", SprMFCR>,
- PPC970_DGroup_First, PPC970_Unit_CRU;
-
-// Instructions to manipulate FPSCR. Only long double handling uses these.
-// FPSCR is not modelled; we use the SDNode Flag to keep things in order.
-
-def MFFS : XForm_42<63, 583, (outs F8RC:$rT), (ins),
- "mffs $rT", IntMFFS,
- [(set F8RC:$rT, (PPCmffs))]>,
- PPC970_DGroup_Single, PPC970_Unit_FPU;
-def MTFSB0 : XForm_43<63, 70, (outs), (ins u5imm:$FM),
- "mtfsb0 $FM", IntMTFSB0,
- [(PPCmtfsb0 (i32 imm:$FM))]>,
- PPC970_DGroup_Single, PPC970_Unit_FPU;
-def MTFSB1 : XForm_43<63, 38, (outs), (ins u5imm:$FM),
- "mtfsb1 $FM", IntMTFSB0,
- [(PPCmtfsb1 (i32 imm:$FM))]>,
- PPC970_DGroup_Single, PPC970_Unit_FPU;
-def FADDrtz: AForm_2<63, 21,
- (outs F8RC:$FRT), (ins F8RC:$FRA, F8RC:$FRB),
- "fadd $FRT, $FRA, $FRB", FPGeneral,
- [(set F8RC:$FRT, (PPCfaddrtz F8RC:$FRA, F8RC:$FRB))]>,
- PPC970_DGroup_Single, PPC970_Unit_FPU;
-// MTFSF does not actually produce an FP result. We pretend it copies
-// input reg B to the output. If we didn't do this it would look like the
-// instruction had no outputs (because we aren't modelling the FPSCR) and
-// it would be deleted.
-def MTFSF : XFLForm<63, 711, (outs F8RC:$FRA),
- (ins i32imm:$FM, F8RC:$rT, F8RC:$FRB),
- "mtfsf $FM, $rT", "$FRB = $FRA", IntMTFSB0,
- [(set F8RC:$FRA, (PPCmtfsf (i32 imm:$FM),
- F8RC:$rT, F8RC:$FRB))]>,
- PPC970_DGroup_Single, PPC970_Unit_FPU;
-
-let PPC970_Unit = 1 in { // FXU Operations.
-
-// XO-Form instructions. Arithmetic instructions that can set overflow bit
-//
-def ADD4 : XOForm_1<31, 266, 0, (outs GPRC:$rT), (ins GPRC:$rA, GPRC:$rB),
- "add $rT, $rA, $rB", IntGeneral,
- [(set GPRC:$rT, (add GPRC:$rA, GPRC:$rB))]>;
-def ADDC : XOForm_1<31, 10, 0, (outs GPRC:$rT), (ins GPRC:$rA, GPRC:$rB),
- "addc $rT, $rA, $rB", IntGeneral,
- [(set GPRC:$rT, (addc GPRC:$rA, GPRC:$rB))]>,
- PPC970_DGroup_Cracked;
-def ADDE : XOForm_1<31, 138, 0, (outs GPRC:$rT), (ins GPRC:$rA, GPRC:$rB),
- "adde $rT, $rA, $rB", IntGeneral,
- [(set GPRC:$rT, (adde GPRC:$rA, GPRC:$rB))]>;
-def DIVW : XOForm_1<31, 491, 0, (outs GPRC:$rT), (ins GPRC:$rA, GPRC:$rB),
- "divw $rT, $rA, $rB", IntDivW,
- [(set GPRC:$rT, (sdiv GPRC:$rA, GPRC:$rB))]>,
- PPC970_DGroup_First, PPC970_DGroup_Cracked;
-def DIVWU : XOForm_1<31, 459, 0, (outs GPRC:$rT), (ins GPRC:$rA, GPRC:$rB),
- "divwu $rT, $rA, $rB", IntDivW,
- [(set GPRC:$rT, (udiv GPRC:$rA, GPRC:$rB))]>,
- PPC970_DGroup_First, PPC970_DGroup_Cracked;
-def MULHW : XOForm_1<31, 75, 0, (outs GPRC:$rT), (ins GPRC:$rA, GPRC:$rB),
- "mulhw $rT, $rA, $rB", IntMulHW,
- [(set GPRC:$rT, (mulhs GPRC:$rA, GPRC:$rB))]>;
-def MULHWU : XOForm_1<31, 11, 0, (outs GPRC:$rT), (ins GPRC:$rA, GPRC:$rB),
- "mulhwu $rT, $rA, $rB", IntMulHWU,
- [(set GPRC:$rT, (mulhu GPRC:$rA, GPRC:$rB))]>;
-def MULLW : XOForm_1<31, 235, 0, (outs GPRC:$rT), (ins GPRC:$rA, GPRC:$rB),
- "mullw $rT, $rA, $rB", IntMulHW,
- [(set GPRC:$rT, (mul GPRC:$rA, GPRC:$rB))]>;
-def SUBF : XOForm_1<31, 40, 0, (outs GPRC:$rT), (ins GPRC:$rA, GPRC:$rB),
- "subf $rT, $rA, $rB", IntGeneral,
- [(set GPRC:$rT, (sub GPRC:$rB, GPRC:$rA))]>;
-def SUBFC : XOForm_1<31, 8, 0, (outs GPRC:$rT), (ins GPRC:$rA, GPRC:$rB),
- "subfc $rT, $rA, $rB", IntGeneral,
- [(set GPRC:$rT, (subc GPRC:$rB, GPRC:$rA))]>,
- PPC970_DGroup_Cracked;
-def SUBFE : XOForm_1<31, 136, 0, (outs GPRC:$rT), (ins GPRC:$rA, GPRC:$rB),
- "subfe $rT, $rA, $rB", IntGeneral,
- [(set GPRC:$rT, (sube GPRC:$rB, GPRC:$rA))]>;
-def ADDME : XOForm_3<31, 234, 0, (outs GPRC:$rT), (ins GPRC:$rA),
- "addme $rT, $rA", IntGeneral,
- [(set GPRC:$rT, (adde GPRC:$rA, immAllOnes))]>;
-def ADDZE : XOForm_3<31, 202, 0, (outs GPRC:$rT), (ins GPRC:$rA),
- "addze $rT, $rA", IntGeneral,
- [(set GPRC:$rT, (adde GPRC:$rA, 0))]>;
-def NEG : XOForm_3<31, 104, 0, (outs GPRC:$rT), (ins GPRC:$rA),
- "neg $rT, $rA", IntGeneral,
- [(set GPRC:$rT, (ineg GPRC:$rA))]>;
-def SUBFME : XOForm_3<31, 232, 0, (outs GPRC:$rT), (ins GPRC:$rA),
- "subfme $rT, $rA", IntGeneral,
- [(set GPRC:$rT, (sube immAllOnes, GPRC:$rA))]>;
-def SUBFZE : XOForm_3<31, 200, 0, (outs GPRC:$rT), (ins GPRC:$rA),
- "subfze $rT, $rA", IntGeneral,
- [(set GPRC:$rT, (sube 0, GPRC:$rA))]>;
-}
-
-// A-Form instructions. Most of the instructions executed in the FPU are of
-// this type.
-//
-let PPC970_Unit = 3 in { // FPU Operations.
-def FMADD : AForm_1<63, 29,
- (outs F8RC:$FRT), (ins F8RC:$FRA, F8RC:$FRC, F8RC:$FRB),
- "fmadd $FRT, $FRA, $FRC, $FRB", FPFused,
- [(set F8RC:$FRT, (fadd (fmul F8RC:$FRA, F8RC:$FRC),
- F8RC:$FRB))]>,
- Requires<[FPContractions]>;
-def FMADDS : AForm_1<59, 29,
- (outs F4RC:$FRT), (ins F4RC:$FRA, F4RC:$FRC, F4RC:$FRB),
- "fmadds $FRT, $FRA, $FRC, $FRB", FPGeneral,
- [(set F4RC:$FRT, (fadd (fmul F4RC:$FRA, F4RC:$FRC),
- F4RC:$FRB))]>,
- Requires<[FPContractions]>;
-def FMSUB : AForm_1<63, 28,
- (outs F8RC:$FRT), (ins F8RC:$FRA, F8RC:$FRC, F8RC:$FRB),
- "fmsub $FRT, $FRA, $FRC, $FRB", FPFused,
- [(set F8RC:$FRT, (fsub (fmul F8RC:$FRA, F8RC:$FRC),
- F8RC:$FRB))]>,
- Requires<[FPContractions]>;
-def FMSUBS : AForm_1<59, 28,
- (outs F4RC:$FRT), (ins F4RC:$FRA, F4RC:$FRC, F4RC:$FRB),
- "fmsubs $FRT, $FRA, $FRC, $FRB", FPGeneral,
- [(set F4RC:$FRT, (fsub (fmul F4RC:$FRA, F4RC:$FRC),
- F4RC:$FRB))]>,
- Requires<[FPContractions]>;
-def FNMADD : AForm_1<63, 31,
- (outs F8RC:$FRT), (ins F8RC:$FRA, F8RC:$FRC, F8RC:$FRB),
- "fnmadd $FRT, $FRA, $FRC, $FRB", FPFused,
- [(set F8RC:$FRT, (fneg (fadd (fmul F8RC:$FRA, F8RC:$FRC),
- F8RC:$FRB)))]>,
- Requires<[FPContractions]>;
-def FNMADDS : AForm_1<59, 31,
- (outs F4RC:$FRT), (ins F4RC:$FRA, F4RC:$FRC, F4RC:$FRB),
- "fnmadds $FRT, $FRA, $FRC, $FRB", FPGeneral,
- [(set F4RC:$FRT, (fneg (fadd (fmul F4RC:$FRA, F4RC:$FRC),
- F4RC:$FRB)))]>,
- Requires<[FPContractions]>;
-def FNMSUB : AForm_1<63, 30,
- (outs F8RC:$FRT), (ins F8RC:$FRA, F8RC:$FRC, F8RC:$FRB),
- "fnmsub $FRT, $FRA, $FRC, $FRB", FPFused,
- [(set F8RC:$FRT, (fneg (fsub (fmul F8RC:$FRA, F8RC:$FRC),
- F8RC:$FRB)))]>,
- Requires<[FPContractions]>;
-def FNMSUBS : AForm_1<59, 30,
- (outs F4RC:$FRT), (ins F4RC:$FRA, F4RC:$FRC, F4RC:$FRB),
- "fnmsubs $FRT, $FRA, $FRC, $FRB", FPGeneral,
- [(set F4RC:$FRT, (fneg (fsub (fmul F4RC:$FRA, F4RC:$FRC),
- F4RC:$FRB)))]>,
- Requires<[FPContractions]>;
-// FSEL is artificially split into 4 and 8-byte forms for the result. To avoid
-// having 4 of these, force the comparison to always be an 8-byte double (code
-// should use an FMRSD if the input comparison value really wants to be a float)
-// and 4/8 byte forms for the result and operand type..
-def FSELD : AForm_1<63, 23,
- (outs F8RC:$FRT), (ins F8RC:$FRA, F8RC:$FRC, F8RC:$FRB),
- "fsel $FRT, $FRA, $FRC, $FRB", FPGeneral,
- [(set F8RC:$FRT, (PPCfsel F8RC:$FRA,F8RC:$FRC,F8RC:$FRB))]>;
-def FSELS : AForm_1<63, 23,
- (outs F4RC:$FRT), (ins F8RC:$FRA, F4RC:$FRC, F4RC:$FRB),
- "fsel $FRT, $FRA, $FRC, $FRB", FPGeneral,
- [(set F4RC:$FRT, (PPCfsel F8RC:$FRA,F4RC:$FRC,F4RC:$FRB))]>;
-def FADD : AForm_2<63, 21,
- (outs F8RC:$FRT), (ins F8RC:$FRA, F8RC:$FRB),
- "fadd $FRT, $FRA, $FRB", FPGeneral,
- [(set F8RC:$FRT, (fadd F8RC:$FRA, F8RC:$FRB))]>;
-def FADDS : AForm_2<59, 21,
- (outs F4RC:$FRT), (ins F4RC:$FRA, F4RC:$FRB),
- "fadds $FRT, $FRA, $FRB", FPGeneral,
- [(set F4RC:$FRT, (fadd F4RC:$FRA, F4RC:$FRB))]>;
-def FDIV : AForm_2<63, 18,
- (outs F8RC:$FRT), (ins F8RC:$FRA, F8RC:$FRB),
- "fdiv $FRT, $FRA, $FRB", FPDivD,
- [(set F8RC:$FRT, (fdiv F8RC:$FRA, F8RC:$FRB))]>;
-def FDIVS : AForm_2<59, 18,
- (outs F4RC:$FRT), (ins F4RC:$FRA, F4RC:$FRB),
- "fdivs $FRT, $FRA, $FRB", FPDivS,
- [(set F4RC:$FRT, (fdiv F4RC:$FRA, F4RC:$FRB))]>;
-def FMUL : AForm_3<63, 25,
- (outs F8RC:$FRT), (ins F8RC:$FRA, F8RC:$FRB),
- "fmul $FRT, $FRA, $FRB", FPFused,
- [(set F8RC:$FRT, (fmul F8RC:$FRA, F8RC:$FRB))]>;
-def FMULS : AForm_3<59, 25,
- (outs F4RC:$FRT), (ins F4RC:$FRA, F4RC:$FRB),
- "fmuls $FRT, $FRA, $FRB", FPGeneral,
- [(set F4RC:$FRT, (fmul F4RC:$FRA, F4RC:$FRB))]>;
-def FSUB : AForm_2<63, 20,
- (outs F8RC:$FRT), (ins F8RC:$FRA, F8RC:$FRB),
- "fsub $FRT, $FRA, $FRB", FPGeneral,
- [(set F8RC:$FRT, (fsub F8RC:$FRA, F8RC:$FRB))]>;
-def FSUBS : AForm_2<59, 20,
- (outs F4RC:$FRT), (ins F4RC:$FRA, F4RC:$FRB),
- "fsubs $FRT, $FRA, $FRB", FPGeneral,
- [(set F4RC:$FRT, (fsub F4RC:$FRA, F4RC:$FRB))]>;
-}
-
-let PPC970_Unit = 1 in { // FXU Operations.
-// M-Form instructions. rotate and mask instructions.
-//
-let isCommutable = 1 in {
-// RLWIMI can be commuted if the rotate amount is zero.
-def RLWIMI : MForm_2<20,
- (outs GPRC:$rA), (ins GPRC:$rSi, GPRC:$rS, u5imm:$SH, u5imm:$MB,
- u5imm:$ME), "rlwimi $rA, $rS, $SH, $MB, $ME", IntRotate,
- []>, PPC970_DGroup_Cracked, RegConstraint<"$rSi = $rA">,
- NoEncode<"$rSi">;
-}
-def RLWINM : MForm_2<21,
- (outs GPRC:$rA), (ins GPRC:$rS, u5imm:$SH, u5imm:$MB, u5imm:$ME),
- "rlwinm $rA, $rS, $SH, $MB, $ME", IntGeneral,
- []>;
-def RLWINMo : MForm_2<21,
- (outs GPRC:$rA), (ins GPRC:$rS, u5imm:$SH, u5imm:$MB, u5imm:$ME),
- "rlwinm. $rA, $rS, $SH, $MB, $ME", IntGeneral,
- []>, isDOT, PPC970_DGroup_Cracked;
-def RLWNM : MForm_2<23,
- (outs GPRC:$rA), (ins GPRC:$rS, GPRC:$rB, u5imm:$MB, u5imm:$ME),
- "rlwnm $rA, $rS, $rB, $MB, $ME", IntGeneral,
- []>;
-}
-
-
-//===----------------------------------------------------------------------===//
-// DWARF Pseudo Instructions
-//
-
-def DWARF_LOC : Pseudo<(outs), (ins i32imm:$line, i32imm:$col, i32imm:$file),
- "${:comment} .loc $file, $line, $col",
- [(dwarf_loc (i32 imm:$line), (i32 imm:$col),
- (i32 imm:$file))]>;
-
-//===----------------------------------------------------------------------===//
-// PowerPC Instruction Patterns
-//
-
-// Arbitrary immediate support. Implement in terms of LIS/ORI.
-def : Pat<(i32 imm:$imm),
- (ORI (LIS (HI16 imm:$imm)), (LO16 imm:$imm))>;
-
-// Implement the 'not' operation with the NOR instruction.
-def NOT : Pat<(not GPRC:$in),
- (NOR GPRC:$in, GPRC:$in)>;
-
-// ADD an arbitrary immediate.
-def : Pat<(add GPRC:$in, imm:$imm),
- (ADDIS (ADDI GPRC:$in, (LO16 imm:$imm)), (HA16 imm:$imm))>;
-// OR an arbitrary immediate.
-def : Pat<(or GPRC:$in, imm:$imm),
- (ORIS (ORI GPRC:$in, (LO16 imm:$imm)), (HI16 imm:$imm))>;
-// XOR an arbitrary immediate.
-def : Pat<(xor GPRC:$in, imm:$imm),
- (XORIS (XORI GPRC:$in, (LO16 imm:$imm)), (HI16 imm:$imm))>;
-// SUBFIC
-def : Pat<(sub immSExt16:$imm, GPRC:$in),
- (SUBFIC GPRC:$in, imm:$imm)>;
-
-// SHL/SRL
-def : Pat<(shl GPRC:$in, (i32 imm:$imm)),
- (RLWINM GPRC:$in, imm:$imm, 0, (SHL32 imm:$imm))>;
-def : Pat<(srl GPRC:$in, (i32 imm:$imm)),
- (RLWINM GPRC:$in, (SRL32 imm:$imm), imm:$imm, 31)>;
-
-// ROTL
-def : Pat<(rotl GPRC:$in, GPRC:$sh),
- (RLWNM GPRC:$in, GPRC:$sh, 0, 31)>;
-def : Pat<(rotl GPRC:$in, (i32 imm:$imm)),
- (RLWINM GPRC:$in, imm:$imm, 0, 31)>;
-
-// RLWNM
-def : Pat<(and (rotl GPRC:$in, GPRC:$sh), maskimm32:$imm),
- (RLWNM GPRC:$in, GPRC:$sh, (MB maskimm32:$imm), (ME maskimm32:$imm))>;
-
-// Calls
-def : Pat<(PPCcall_Macho (i32 tglobaladdr:$dst)),
- (BL_Macho tglobaladdr:$dst)>;
-def : Pat<(PPCcall_Macho (i32 texternalsym:$dst)),
- (BL_Macho texternalsym:$dst)>;
-def : Pat<(PPCcall_ELF (i32 tglobaladdr:$dst)),
- (BL_ELF tglobaladdr:$dst)>;
-def : Pat<(PPCcall_ELF (i32 texternalsym:$dst)),
- (BL_ELF texternalsym:$dst)>;
-
-
-def : Pat<(PPCtc_return (i32 tglobaladdr:$dst), imm:$imm),
- (TCRETURNdi tglobaladdr:$dst, imm:$imm)>;
-
-def : Pat<(PPCtc_return (i32 texternalsym:$dst), imm:$imm),
- (TCRETURNdi texternalsym:$dst, imm:$imm)>;
-
-def : Pat<(PPCtc_return CTRRC:$dst, imm:$imm),
- (TCRETURNri CTRRC:$dst, imm:$imm)>;
-
-
-
-// Hi and Lo for Darwin Global Addresses.
-def : Pat<(PPChi tglobaladdr:$in, 0), (LIS tglobaladdr:$in)>;
-def : Pat<(PPClo tglobaladdr:$in, 0), (LI tglobaladdr:$in)>;
-def : Pat<(PPChi tconstpool:$in, 0), (LIS tconstpool:$in)>;
-def : Pat<(PPClo tconstpool:$in, 0), (LI tconstpool:$in)>;
-def : Pat<(PPChi tjumptable:$in, 0), (LIS tjumptable:$in)>;
-def : Pat<(PPClo tjumptable:$in, 0), (LI tjumptable:$in)>;
-def : Pat<(add GPRC:$in, (PPChi tglobaladdr:$g, 0)),
- (ADDIS GPRC:$in, tglobaladdr:$g)>;
-def : Pat<(add GPRC:$in, (PPChi tconstpool:$g, 0)),
- (ADDIS GPRC:$in, tconstpool:$g)>;
-def : Pat<(add GPRC:$in, (PPChi tjumptable:$g, 0)),
- (ADDIS GPRC:$in, tjumptable:$g)>;
-
-// Fused negative multiply subtract, alternate pattern
-def : Pat<(fsub F8RC:$B, (fmul F8RC:$A, F8RC:$C)),
- (FNMSUB F8RC:$A, F8RC:$C, F8RC:$B)>,
- Requires<[FPContractions]>;
-def : Pat<(fsub F4RC:$B, (fmul F4RC:$A, F4RC:$C)),
- (FNMSUBS F4RC:$A, F4RC:$C, F4RC:$B)>,
- Requires<[FPContractions]>;
-
-// Standard shifts. These are represented separately from the real shifts above
-// so that we can distinguish between shifts that allow 5-bit and 6-bit shift
-// amounts.
-def : Pat<(sra GPRC:$rS, GPRC:$rB),
- (SRAW GPRC:$rS, GPRC:$rB)>;
-def : Pat<(srl GPRC:$rS, GPRC:$rB),
- (SRW GPRC:$rS, GPRC:$rB)>;
-def : Pat<(shl GPRC:$rS, GPRC:$rB),
- (SLW GPRC:$rS, GPRC:$rB)>;
-
-def : Pat<(zextloadi1 iaddr:$src),
- (LBZ iaddr:$src)>;
-def : Pat<(zextloadi1 xaddr:$src),
- (LBZX xaddr:$src)>;
-def : Pat<(extloadi1 iaddr:$src),
- (LBZ iaddr:$src)>;
-def : Pat<(extloadi1 xaddr:$src),
- (LBZX xaddr:$src)>;
-def : Pat<(extloadi8 iaddr:$src),
- (LBZ iaddr:$src)>;
-def : Pat<(extloadi8 xaddr:$src),
- (LBZX xaddr:$src)>;
-def : Pat<(extloadi16 iaddr:$src),
- (LHZ iaddr:$src)>;
-def : Pat<(extloadi16 xaddr:$src),
- (LHZX xaddr:$src)>;
-def : Pat<(extloadf32 iaddr:$src),
- (FMRSD (LFS iaddr:$src))>;
-def : Pat<(extloadf32 xaddr:$src),
- (FMRSD (LFSX xaddr:$src))>;
-
-// Atomic operations
-def : Pat<(PPCcmp_unres immSExt16:$imm, GPRC:$rA, imm:$label),
- (CMP_UNRESwi GPRC:$rA, immSExt16:$imm, imm:$label)>;
-
-include "PPCInstrAltivec.td"
-include "PPCInstr64Bit.td"
diff --git a/release_23/lib/Target/PowerPC/PPCJITInfo.cpp b/release_23/lib/Target/PowerPC/PPCJITInfo.cpp
deleted file mode 100644
index 461cfec34acb..000000000000
--- a/release_23/lib/Target/PowerPC/PPCJITInfo.cpp
+++ /dev/null
@@ -1,448 +0,0 @@
-//===-- PPCJITInfo.cpp - Implement the JIT interfaces for the PowerPC -----===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the JIT interfaces for the 32-bit PowerPC target.
-//
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "jit"
-#include "PPCJITInfo.h"
-#include "PPCRelocations.h"
-#include "PPCTargetMachine.h"
-#include "llvm/Function.h"
-#include "llvm/CodeGen/MachineCodeEmitter.h"
-#include "llvm/Config/alloca.h"
-#include "llvm/Support/Debug.h"
-#include <set>
-using namespace llvm;
-
-static TargetJITInfo::JITCompilerFn JITCompilerFunction;
-
-#define BUILD_ADDIS(RD,RS,IMM16) \
- ((15 << 26) | ((RD) << 21) | ((RS) << 16) | ((IMM16) & 65535))
-#define BUILD_ORI(RD,RS,UIMM16) \
- ((24 << 26) | ((RS) << 21) | ((RD) << 16) | ((UIMM16) & 65535))
-#define BUILD_ORIS(RD,RS,UIMM16) \
- ((25 << 26) | ((RS) << 21) | ((RD) << 16) | ((UIMM16) & 65535))
-#define BUILD_RLDICR(RD,RS,SH,ME) \
- ((30 << 26) | ((RS) << 21) | ((RD) << 16) | (((SH) & 31) << 11) | \
- (((ME) & 63) << 6) | (1 << 2) | ((((SH) >> 5) & 1) << 1))
-#define BUILD_MTSPR(RS,SPR) \
- ((31 << 26) | ((RS) << 21) | ((SPR) << 16) | (467 << 1))
-#define BUILD_BCCTRx(BO,BI,LINK) \
- ((19 << 26) | ((BO) << 21) | ((BI) << 16) | (528 << 1) | ((LINK) & 1))
-#define BUILD_B(TARGET, LINK) \
- ((18 << 26) | (((TARGET) & 0x00FFFFFF) << 2) | ((LINK) & 1))
-
-// Pseudo-ops
-#define BUILD_LIS(RD,IMM16) BUILD_ADDIS(RD,0,IMM16)
-#define BUILD_SLDI(RD,RS,IMM6) BUILD_RLDICR(RD,RS,IMM6,63-IMM6)
-#define BUILD_MTCTR(RS) BUILD_MTSPR(RS,9)
-#define BUILD_BCTR(LINK) BUILD_BCCTRx(20,0,LINK)
-
-static void EmitBranchToAt(uint64_t At, uint64_t To, bool isCall, bool is64Bit){
- intptr_t Offset = ((intptr_t)To - (intptr_t)At) >> 2;
- unsigned *AtI = (unsigned*)(intptr_t)At;
-
- if (Offset >= -(1 << 23) && Offset < (1 << 23)) { // In range?
- AtI[0] = BUILD_B(Offset, isCall); // b/bl target
- } else if (!is64Bit) {
- AtI[0] = BUILD_LIS(12, To >> 16); // lis r12, hi16(address)
- AtI[1] = BUILD_ORI(12, 12, To); // ori r12, r12, lo16(address)
- AtI[2] = BUILD_MTCTR(12); // mtctr r12
- AtI[3] = BUILD_BCTR(isCall); // bctr/bctrl
- } else {
- AtI[0] = BUILD_LIS(12, To >> 48); // lis r12, hi16(address)
- AtI[1] = BUILD_ORI(12, 12, To >> 32); // ori r12, r12, lo16(address)
- AtI[2] = BUILD_SLDI(12, 12, 32); // sldi r12, r12, 32
- AtI[3] = BUILD_ORIS(12, 12, To >> 16); // oris r12, r12, hi16(address)
- AtI[4] = BUILD_ORI(12, 12, To); // ori r12, r12, lo16(address)
- AtI[5] = BUILD_MTCTR(12); // mtctr r12
- AtI[6] = BUILD_BCTR(isCall); // bctr/bctrl
- }
-}
-
-extern "C" void PPC32CompilationCallback();
-extern "C" void PPC64CompilationCallback();
-
-#if (defined(__POWERPC__) || defined (__ppc__) || defined(_POWER)) && \
- !defined(__ppc64__)
-// CompilationCallback stub - We can't use a C function with inline assembly in
-// it, because we the prolog/epilog inserted by GCC won't work for us. Instead,
-// write our own wrapper, which does things our way, so we have complete control
-// over register saving and restoring.
-asm(
- ".text\n"
- ".align 2\n"
- ".globl _PPC32CompilationCallback\n"
-"_PPC32CompilationCallback:\n"
- // Make space for 8 ints r[3-10] and 13 doubles f[1-13] and the
- // FIXME: need to save v[0-19] for altivec?
- // FIXME: could shrink frame
- // Set up a proper stack frame
- // FIXME Layout
- // PowerPC64 ABI linkage - 24 bytes
- // parameters - 32 bytes
- // 13 double registers - 104 bytes
- // 8 int registers - 32 bytes
- "mflr r0\n"
- "stw r0, 8(r1)\n"
- "stwu r1, -208(r1)\n"
- // Save all int arg registers
- "stw r10, 204(r1)\n" "stw r9, 200(r1)\n"
- "stw r8, 196(r1)\n" "stw r7, 192(r1)\n"
- "stw r6, 188(r1)\n" "stw r5, 184(r1)\n"
- "stw r4, 180(r1)\n" "stw r3, 176(r1)\n"
- // Save all call-clobbered FP regs.
- "stfd f13, 168(r1)\n" "stfd f12, 160(r1)\n"
- "stfd f11, 152(r1)\n" "stfd f10, 144(r1)\n"
- "stfd f9, 136(r1)\n" "stfd f8, 128(r1)\n"
- "stfd f7, 120(r1)\n" "stfd f6, 112(r1)\n"
- "stfd f5, 104(r1)\n" "stfd f4, 96(r1)\n"
- "stfd f3, 88(r1)\n" "stfd f2, 80(r1)\n"
- "stfd f1, 72(r1)\n"
- // Arguments to Compilation Callback:
- // r3 - our lr (address of the call instruction in stub plus 4)
- // r4 - stub's lr (address of instruction that called the stub plus 4)
- // r5 - is64Bit - always 0.
- "mr r3, r0\n"
- "lwz r2, 208(r1)\n" // stub's frame
- "lwz r4, 8(r2)\n" // stub's lr
- "li r5, 0\n" // 0 == 32 bit
- "bl _PPCCompilationCallbackC\n"
- "mtctr r3\n"
- // Restore all int arg registers
- "lwz r10, 204(r1)\n" "lwz r9, 200(r1)\n"
- "lwz r8, 196(r1)\n" "lwz r7, 192(r1)\n"
- "lwz r6, 188(r1)\n" "lwz r5, 184(r1)\n"
- "lwz r4, 180(r1)\n" "lwz r3, 176(r1)\n"
- // Restore all FP arg registers
- "lfd f13, 168(r1)\n" "lfd f12, 160(r1)\n"
- "lfd f11, 152(r1)\n" "lfd f10, 144(r1)\n"
- "lfd f9, 136(r1)\n" "lfd f8, 128(r1)\n"
- "lfd f7, 120(r1)\n" "lfd f6, 112(r1)\n"
- "lfd f5, 104(r1)\n" "lfd f4, 96(r1)\n"
- "lfd f3, 88(r1)\n" "lfd f2, 80(r1)\n"
- "lfd f1, 72(r1)\n"
- // Pop 3 frames off the stack and branch to target
- "lwz r1, 208(r1)\n"
- "lwz r2, 8(r1)\n"
- "mtlr r2\n"
- "bctr\n"
- );
-
-#elif defined(__PPC__) && !defined(__ppc64__)
-// Linux/PPC support
-
-// CompilationCallback stub - We can't use a C function with inline assembly in
-// it, because we the prolog/epilog inserted by GCC won't work for us. Instead,
-// write our own wrapper, which does things our way, so we have complete control
-// over register saving and restoring.
-asm(
- ".text\n"
- ".align 2\n"
- ".globl PPC32CompilationCallback\n"
-"PPC32CompilationCallback:\n"
- // Make space for 8 ints r[3-10] and 8 doubles f[1-8] and the
- // FIXME: need to save v[0-19] for altivec?
- // FIXME: could shrink frame
- // Set up a proper stack frame
- // FIXME Layout
- // 8 double registers - 64 bytes
- // 8 int registers - 32 bytes
- "mflr 0\n"
- "stw 0, 4(1)\n"
- "stwu 1, -104(1)\n"
- // Save all int arg registers
- "stw 10, 100(1)\n" "stw 9, 96(1)\n"
- "stw 8, 92(1)\n" "stw 7, 88(1)\n"
- "stw 6, 84(1)\n" "stw 5, 80(1)\n"
- "stw 4, 76(1)\n" "stw 3, 72(1)\n"
- // Save all call-clobbered FP regs.
- "stfd 8, 64(1)\n"
- "stfd 7, 56(1)\n" "stfd 6, 48(1)\n"
- "stfd 5, 40(1)\n" "stfd 4, 32(1)\n"
- "stfd 3, 24(1)\n" "stfd 2, 16(1)\n"
- "stfd 1, 8(1)\n"
- // Arguments to Compilation Callback:
- // r3 - our lr (address of the call instruction in stub plus 4)
- // r4 - stub's lr (address of instruction that called the stub plus 4)
- // r5 - is64Bit - always 0.
- "mr 3, 0\n"
- "lwz 5, 104(1)\n" // stub's frame
- "lwz 4, 4(5)\n" // stub's lr
- "li 5, 0\n" // 0 == 32 bit
- "bl PPCCompilationCallbackC\n"
- "mtctr 3\n"
- // Restore all int arg registers
- "lwz 10, 100(1)\n" "lwz 9, 96(1)\n"
- "lwz 8, 92(1)\n" "lwz 7, 88(1)\n"
- "lwz 6, 84(1)\n" "lwz 5, 80(1)\n"
- "lwz 4, 76(1)\n" "lwz 3, 72(1)\n"
- // Restore all FP arg registers
- "lfd 8, 64(1)\n"
- "lfd 7, 56(1)\n" "lfd 6, 48(1)\n"
- "lfd 5, 40(1)\n" "lfd 4, 32(1)\n"
- "lfd 3, 24(1)\n" "lfd 2, 16(1)\n"
- "lfd 1, 8(1)\n"
- // Pop 3 frames off the stack and branch to target
- "lwz 1, 104(1)\n"
- "lwz 0, 4(1)\n"
- "mtlr 0\n"
- "bctr\n"
- );
-#else
-void PPC32CompilationCallback() {
- assert(0 && "This is not a power pc, you can't execute this!");
- abort();
-}
-#endif
-
-#if (defined(__POWERPC__) || defined (__ppc__) || defined(_POWER)) && \
- defined(__ppc64__)
-asm(
- ".text\n"
- ".align 2\n"
- ".globl _PPC64CompilationCallback\n"
-"_PPC64CompilationCallback:\n"
- // Make space for 8 ints r[3-10] and 13 doubles f[1-13] and the
- // FIXME: need to save v[0-19] for altivec?
- // Set up a proper stack frame
- // Layout
- // PowerPC64 ABI linkage - 48 bytes
- // parameters - 64 bytes
- // 13 double registers - 104 bytes
- // 8 int registers - 64 bytes
- "mflr r0\n"
- "std r0, 16(r1)\n"
- "stdu r1, -280(r1)\n"
- // Save all int arg registers
- "std r10, 272(r1)\n" "std r9, 264(r1)\n"
- "std r8, 256(r1)\n" "std r7, 248(r1)\n"
- "std r6, 240(r1)\n" "std r5, 232(r1)\n"
- "std r4, 224(r1)\n" "std r3, 216(r1)\n"
- // Save all call-clobbered FP regs.
- "stfd f13, 208(r1)\n" "stfd f12, 200(r1)\n"
- "stfd f11, 192(r1)\n" "stfd f10, 184(r1)\n"
- "stfd f9, 176(r1)\n" "stfd f8, 168(r1)\n"
- "stfd f7, 160(r1)\n" "stfd f6, 152(r1)\n"
- "stfd f5, 144(r1)\n" "stfd f4, 136(r1)\n"
- "stfd f3, 128(r1)\n" "stfd f2, 120(r1)\n"
- "stfd f1, 112(r1)\n"
- // Arguments to Compilation Callback:
- // r3 - our lr (address of the call instruction in stub plus 4)
- // r4 - stub's lr (address of instruction that called the stub plus 4)
- // r5 - is64Bit - always 1.
- "mr r3, r0\n"
- "ld r2, 280(r1)\n" // stub's frame
- "ld r4, 16(r2)\n" // stub's lr
- "li r5, 1\n" // 1 == 64 bit
- "bl _PPCCompilationCallbackC\n"
- "mtctr r3\n"
- // Restore all int arg registers
- "ld r10, 272(r1)\n" "ld r9, 264(r1)\n"
- "ld r8, 256(r1)\n" "ld r7, 248(r1)\n"
- "ld r6, 240(r1)\n" "ld r5, 232(r1)\n"
- "ld r4, 224(r1)\n" "ld r3, 216(r1)\n"
- // Restore all FP arg registers
- "lfd f13, 208(r1)\n" "lfd f12, 200(r1)\n"
- "lfd f11, 192(r1)\n" "lfd f10, 184(r1)\n"
- "lfd f9, 176(r1)\n" "lfd f8, 168(r1)\n"
- "lfd f7, 160(r1)\n" "lfd f6, 152(r1)\n"
- "lfd f5, 144(r1)\n" "lfd f4, 136(r1)\n"
- "lfd f3, 128(r1)\n" "lfd f2, 120(r1)\n"
- "lfd f1, 112(r1)\n"
- // Pop 3 frames off the stack and branch to target
- "ld r1, 280(r1)\n"
- "ld r2, 16(r1)\n"
- "mtlr r2\n"
- "bctr\n"
- );
-#else
-void PPC64CompilationCallback() {
- assert(0 && "This is not a power pc, you can't execute this!");
- abort();
-}
-#endif
-
-extern "C" void *PPCCompilationCallbackC(unsigned *StubCallAddrPlus4,
- unsigned *OrigCallAddrPlus4,
- bool is64Bit) {
- // Adjust the pointer to the address of the call instruction in the stub
- // emitted by emitFunctionStub, rather than the instruction after it.
- unsigned *StubCallAddr = StubCallAddrPlus4 - 1;
- unsigned *OrigCallAddr = OrigCallAddrPlus4 - 1;
-
- void *Target = JITCompilerFunction(StubCallAddr);
-
- // Check to see if *OrigCallAddr is a 'bl' instruction, and if we can rewrite
- // it to branch directly to the destination. If so, rewrite it so it does not
- // need to go through the stub anymore.
- unsigned OrigCallInst = *OrigCallAddr;
- if ((OrigCallInst >> 26) == 18) { // Direct call.
- intptr_t Offset = ((intptr_t)Target - (intptr_t)OrigCallAddr) >> 2;
-
- if (Offset >= -(1 << 23) && Offset < (1 << 23)) { // In range?
- // Clear the original target out.
- OrigCallInst &= (63 << 26) | 3;
- // Fill in the new target.
- OrigCallInst |= (Offset & ((1 << 24)-1)) << 2;
- // Replace the call.
- *OrigCallAddr = OrigCallInst;
- }
- }
-
- // Assert that we are coming from a stub that was created with our
- // emitFunctionStub.
- if ((*StubCallAddr >> 26) == 18)
- StubCallAddr -= 3;
- else {
- assert((*StubCallAddr >> 26) == 19 && "Call in stub is not indirect!");
- StubCallAddr -= is64Bit ? 9 : 6;
- }
-
- // Rewrite the stub with an unconditional branch to the target, for any users
- // who took the address of the stub.
- EmitBranchToAt((intptr_t)StubCallAddr, (intptr_t)Target, false, is64Bit);
-
- // Put the address of the target function to call and the address to return to
- // after calling the target function in a place that is easy to get on the
- // stack after we restore all regs.
- return Target;
-}
-
-
-
-TargetJITInfo::LazyResolverFn
-PPCJITInfo::getLazyResolverFunction(JITCompilerFn Fn) {
- JITCompilerFunction = Fn;
- return is64Bit ? PPC64CompilationCallback : PPC32CompilationCallback;
-}
-
-#if (defined(__POWERPC__) || defined (__ppc__) || defined(_POWER)) && \
-defined(__APPLE__)
-extern "C" void sys_icache_invalidate(const void *Addr, size_t len);
-#endif
-
-/// SyncICache - On PPC, the JIT emitted code must be explicitly refetched to
-/// ensure correct execution.
-static void SyncICache(const void *Addr, size_t len) {
-#if (defined(__POWERPC__) || defined (__ppc__) || defined(_POWER)) && \
-defined(__APPLE__)
- sys_icache_invalidate(Addr, len);
-#endif
-}
-
-void *PPCJITInfo::emitFunctionStub(const Function* F, void *Fn,
- MachineCodeEmitter &MCE) {
- // If this is just a call to an external function, emit a branch instead of a
- // call. The code is the same except for one bit of the last instruction.
- if (Fn != (void*)(intptr_t)PPC32CompilationCallback &&
- Fn != (void*)(intptr_t)PPC64CompilationCallback) {
- MCE.startFunctionStub(F, 7*4);
- intptr_t Addr = (intptr_t)MCE.getCurrentPCValue();
- MCE.emitWordBE(0);
- MCE.emitWordBE(0);
- MCE.emitWordBE(0);
- MCE.emitWordBE(0);
- MCE.emitWordBE(0);
- MCE.emitWordBE(0);
- MCE.emitWordBE(0);
- EmitBranchToAt(Addr, (intptr_t)Fn, false, is64Bit);
- SyncICache((void*)Addr, 7*4);
- return MCE.finishFunctionStub(F);
- }
-
- MCE.startFunctionStub(F, 10*4);
- intptr_t Addr = (intptr_t)MCE.getCurrentPCValue();
- if (is64Bit) {
- MCE.emitWordBE(0xf821ffb1); // stdu r1,-80(r1)
- MCE.emitWordBE(0x7d6802a6); // mflr r11
- MCE.emitWordBE(0xf9610060); // std r11, 96(r1)
- } else if (TM.getSubtargetImpl()->isMachoABI()){
- MCE.emitWordBE(0x9421ffe0); // stwu r1,-32(r1)
- MCE.emitWordBE(0x7d6802a6); // mflr r11
- MCE.emitWordBE(0x91610028); // stw r11, 40(r1)
- } else {
- MCE.emitWordBE(0x9421ffe0); // stwu r1,-32(r1)
- MCE.emitWordBE(0x7d6802a6); // mflr r11
- MCE.emitWordBE(0x91610024); // stw r11, 36(r1)
- }
- intptr_t BranchAddr = (intptr_t)MCE.getCurrentPCValue();
- MCE.emitWordBE(0);
- MCE.emitWordBE(0);
- MCE.emitWordBE(0);
- MCE.emitWordBE(0);
- MCE.emitWordBE(0);
- MCE.emitWordBE(0);
- MCE.emitWordBE(0);
- EmitBranchToAt(BranchAddr, (intptr_t)Fn, true, is64Bit);
- SyncICache((void*)Addr, 10*4);
- return MCE.finishFunctionStub(F);
-}
-
-
-void PPCJITInfo::relocate(void *Function, MachineRelocation *MR,
- unsigned NumRelocs, unsigned char* GOTBase) {
- for (unsigned i = 0; i != NumRelocs; ++i, ++MR) {
- unsigned *RelocPos = (unsigned*)Function + MR->getMachineCodeOffset()/4;
- intptr_t ResultPtr = (intptr_t)MR->getResultPointer();
- switch ((PPC::RelocationType)MR->getRelocationType()) {
- default: assert(0 && "Unknown relocation type!");
- case PPC::reloc_pcrel_bx:
- // PC-relative relocation for b and bl instructions.
- ResultPtr = (ResultPtr-(intptr_t)RelocPos) >> 2;
- assert(ResultPtr >= -(1 << 23) && ResultPtr < (1 << 23) &&
- "Relocation out of range!");
- *RelocPos |= (ResultPtr & ((1 << 24)-1)) << 2;
- break;
- case PPC::reloc_pcrel_bcx:
- // PC-relative relocation for BLT,BLE,BEQ,BGE,BGT,BNE, or other
- // bcx instructions.
- ResultPtr = (ResultPtr-(intptr_t)RelocPos) >> 2;
- assert(ResultPtr >= -(1 << 13) && ResultPtr < (1 << 13) &&
- "Relocation out of range!");
- *RelocPos |= (ResultPtr & ((1 << 14)-1)) << 2;
- break;
- case PPC::reloc_absolute_high: // high bits of ref -> low 16 of instr
- case PPC::reloc_absolute_low: { // low bits of ref -> low 16 of instr
- ResultPtr += MR->getConstantVal();
-
- // If this is a high-part access, get the high-part.
- if (MR->getRelocationType() == PPC::reloc_absolute_high) {
- // If the low part will have a carry (really a borrow) from the low
- // 16-bits into the high 16, add a bit to borrow from.
- if (((int)ResultPtr << 16) < 0)
- ResultPtr += 1 << 16;
- ResultPtr >>= 16;
- }
-
- // Do the addition then mask, so the addition does not overflow the 16-bit
- // immediate section of the instruction.
- unsigned LowBits = (*RelocPos + ResultPtr) & 65535;
- unsigned HighBits = *RelocPos & ~65535;
- *RelocPos = LowBits | HighBits; // Slam into low 16-bits
- break;
- }
- case PPC::reloc_absolute_low_ix: { // low bits of ref -> low 14 of instr
- ResultPtr += MR->getConstantVal();
- // Do the addition then mask, so the addition does not overflow the 16-bit
- // immediate section of the instruction.
- unsigned LowBits = (*RelocPos + ResultPtr) & 0xFFFC;
- unsigned HighBits = *RelocPos & 0xFFFF0003;
- *RelocPos = LowBits | HighBits; // Slam into low 14-bits.
- break;
- }
- }
- }
-}
-
-void PPCJITInfo::replaceMachineCodeForFunction(void *Old, void *New) {
- EmitBranchToAt((intptr_t)Old, (intptr_t)New, false, is64Bit);
-}
diff --git a/release_23/lib/Target/PowerPC/PPCJITInfo.h b/release_23/lib/Target/PowerPC/PPCJITInfo.h
deleted file mode 100644
index c93a84aca05f..000000000000
--- a/release_23/lib/Target/PowerPC/PPCJITInfo.h
+++ /dev/null
@@ -1,47 +0,0 @@
-//===- PPCJITInfo.h - PowerPC impl. of the JIT interface --------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains the PowerPC implementation of the TargetJITInfo class.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef POWERPC_JITINFO_H
-#define POWERPC_JITINFO_H
-
-#include "llvm/Target/TargetJITInfo.h"
-
-namespace llvm {
- class PPCTargetMachine;
-
- class PPCJITInfo : public TargetJITInfo {
- protected:
- PPCTargetMachine &TM;
- bool is64Bit;
- public:
- PPCJITInfo(PPCTargetMachine &tm, bool tmIs64Bit) : TM(tm) {
- useGOT = 0;
- is64Bit = tmIs64Bit;
- }
-
- virtual void *emitFunctionStub(const Function* F, void *Fn,
- MachineCodeEmitter &MCE);
- virtual LazyResolverFn getLazyResolverFunction(JITCompilerFn);
- virtual void relocate(void *Function, MachineRelocation *MR,
- unsigned NumRelocs, unsigned char* GOTBase);
-
- /// replaceMachineCodeForFunction - Make it so that calling the function
- /// whose machine code is at OLD turns into a call to NEW, perhaps by
- /// overwriting OLD with a branch to NEW. This is used for self-modifying
- /// code.
- ///
- virtual void replaceMachineCodeForFunction(void *Old, void *New);
- };
-}
-
-#endif
diff --git a/release_23/lib/Target/PowerPC/PPCMachOWriterInfo.cpp b/release_23/lib/Target/PowerPC/PPCMachOWriterInfo.cpp
deleted file mode 100644
index b5b71e5a8039..000000000000
--- a/release_23/lib/Target/PowerPC/PPCMachOWriterInfo.cpp
+++ /dev/null
@@ -1,150 +0,0 @@
-//===-- PPCMachOWriterInfo.cpp - Mach-O Writer Info for the PowerPC -------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements Mach-O writer information for the PowerPC backend.
-//
-//===----------------------------------------------------------------------===//
-
-#include "PPCMachOWriterInfo.h"
-#include "PPCRelocations.h"
-#include "PPCTargetMachine.h"
-#include "llvm/CodeGen/MachORelocation.h"
-#include "llvm/Support/OutputBuffer.h"
-using namespace llvm;
-
-PPCMachOWriterInfo::PPCMachOWriterInfo(const PPCTargetMachine &TM)
- : TargetMachOWriterInfo(TM.getTargetData()->getPointerSizeInBits() == 64 ?
- HDR_CPU_TYPE_POWERPC64 :
- HDR_CPU_TYPE_POWERPC,
- HDR_CPU_SUBTYPE_POWERPC_ALL) {}
-PPCMachOWriterInfo::~PPCMachOWriterInfo() {}
-
-/// GetTargetRelocation - For the MachineRelocation MR, convert it to one or
-/// more PowerPC MachORelocation(s), add the new relocations to the
-/// MachOSection, and rewrite the instruction at the section offset if required
-/// by that relocation type.
-unsigned PPCMachOWriterInfo::GetTargetRelocation(MachineRelocation &MR,
- unsigned FromIdx,
- unsigned ToAddr,
- unsigned ToIdx,
- OutputBuffer &RelocOut,
- OutputBuffer &SecOut,
- bool Scattered,
- bool isExtern) const {
- unsigned NumRelocs = 0;
- uint64_t Addr = 0;
-
- // Get the address of whatever it is we're relocating, if possible.
- if (!isExtern)
- Addr = (uintptr_t)MR.getResultPointer() + ToAddr;
-
- switch ((PPC::RelocationType)MR.getRelocationType()) {
- default: assert(0 && "Unknown PPC relocation type!");
- case PPC::reloc_absolute_low_ix:
- assert(0 && "Unhandled PPC relocation type!");
- break;
- case PPC::reloc_vanilla:
- {
- // FIXME: need to handle 64 bit vanilla relocs
- MachORelocation VANILLA(MR.getMachineCodeOffset(), ToIdx,
- false, 2, isExtern,
- PPC_RELOC_VANILLA,
- Scattered, (intptr_t)MR.getResultPointer());
- ++NumRelocs;
-
- if (Scattered) {
- RelocOut.outword(VANILLA.getPackedFields());
- RelocOut.outword(VANILLA.getAddress());
- } else {
- RelocOut.outword(VANILLA.getAddress());
- RelocOut.outword(VANILLA.getPackedFields());
- }
-
- intptr_t SymbolOffset;
-
- if (Scattered)
- SymbolOffset = Addr + MR.getConstantVal();
- else
- SymbolOffset = Addr;
-
- printf("vanilla fixup: sec_%x[%x] = %x\n", FromIdx,
- unsigned(MR.getMachineCodeOffset()),
- unsigned(SymbolOffset));
- SecOut.fixword(SymbolOffset, MR.getMachineCodeOffset());
- }
- break;
- case PPC::reloc_pcrel_bx:
- {
- // FIXME: Presumably someday we will need to branch to other, non-extern
- // functions too. Need to figure out some way to distinguish between
- // target is BB and target is function.
- if (isExtern) {
- MachORelocation BR24(MR.getMachineCodeOffset(), ToIdx, true, 2,
- isExtern, PPC_RELOC_BR24, Scattered,
- (intptr_t)MR.getMachineCodeOffset());
- RelocOut.outword(BR24.getAddress());
- RelocOut.outword(BR24.getPackedFields());
- ++NumRelocs;
- }
-
- Addr -= MR.getMachineCodeOffset();
- Addr >>= 2;
- Addr &= 0xFFFFFF;
- Addr <<= 2;
- Addr |= (SecOut[MR.getMachineCodeOffset()] << 24);
- Addr |= (SecOut[MR.getMachineCodeOffset()+3] & 0x3);
- SecOut.fixword(Addr, MR.getMachineCodeOffset());
- break;
- }
- case PPC::reloc_pcrel_bcx:
- {
- Addr -= MR.getMachineCodeOffset();
- Addr &= 0xFFFC;
-
- SecOut.fixhalf(Addr, MR.getMachineCodeOffset() + 2);
- break;
- }
- case PPC::reloc_absolute_high:
- {
- MachORelocation HA16(MR.getMachineCodeOffset(), ToIdx, false, 2,
- isExtern, PPC_RELOC_HA16);
- MachORelocation PAIR(Addr & 0xFFFF, 0xFFFFFF, false, 2, isExtern,
- PPC_RELOC_PAIR);
- NumRelocs = 2;
-
- RelocOut.outword(HA16.getRawAddress());
- RelocOut.outword(HA16.getPackedFields());
- RelocOut.outword(PAIR.getRawAddress());
- RelocOut.outword(PAIR.getPackedFields());
-
- Addr += 0x8000;
-
- SecOut.fixhalf(Addr >> 16, MR.getMachineCodeOffset() + 2);
- break;
- }
- case PPC::reloc_absolute_low:
- {
- MachORelocation LO16(MR.getMachineCodeOffset(), ToIdx, false, 2,
- isExtern, PPC_RELOC_LO16);
- MachORelocation PAIR(Addr >> 16, 0xFFFFFF, false, 2, isExtern,
- PPC_RELOC_PAIR);
- NumRelocs = 2;
-
- RelocOut.outword(LO16.getRawAddress());
- RelocOut.outword(LO16.getPackedFields());
- RelocOut.outword(PAIR.getRawAddress());
- RelocOut.outword(PAIR.getPackedFields());
-
- SecOut.fixhalf(Addr, MR.getMachineCodeOffset() + 2);
- break;
- }
- }
-
- return NumRelocs;
-}
diff --git a/release_23/lib/Target/PowerPC/PPCMachOWriterInfo.h b/release_23/lib/Target/PowerPC/PPCMachOWriterInfo.h
deleted file mode 100644
index d46334df2602..000000000000
--- a/release_23/lib/Target/PowerPC/PPCMachOWriterInfo.h
+++ /dev/null
@@ -1,55 +0,0 @@
-//===-- PPCMachOWriterInfo.h - Mach-O Writer Info for PowerPC ---*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements Mach-O writer information for the PowerPC backend.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef PPC_MACHO_WRITER_INFO_H
-#define PPC_MACHO_WRITER_INFO_H
-
-#include "llvm/Target/TargetMachOWriterInfo.h"
-
-namespace llvm {
-
- // Forward declarations
- class MachineRelocation;
- class OutputBuffer;
- class PPCTargetMachine;
-
- class PPCMachOWriterInfo : public TargetMachOWriterInfo {
- public:
- PPCMachOWriterInfo(const PPCTargetMachine &TM);
- virtual ~PPCMachOWriterInfo();
-
- virtual unsigned GetTargetRelocation(MachineRelocation &MR,
- unsigned FromIdx,
- unsigned ToAddr,
- unsigned ToIdx,
- OutputBuffer &RelocOut,
- OutputBuffer &SecOut,
- bool Scattered, bool Extern) const;
-
- // Constants for the relocation r_type field.
- // See <mach-o/ppc/reloc.h>
- enum {
- PPC_RELOC_VANILLA, // generic relocation
- PPC_RELOC_PAIR, // the second relocation entry of a pair
- PPC_RELOC_BR14, // 14 bit branch displacement to word address
- PPC_RELOC_BR24, // 24 bit branch displacement to word address
- PPC_RELOC_HI16, // a PAIR follows with the low 16 bits
- PPC_RELOC_LO16, // a PAIR follows with the high 16 bits
- PPC_RELOC_HA16, // a PAIR follows, which is sign extended to 32b
- PPC_RELOC_LO14 // LO16 with low 2 bits implicitly zero
- };
- };
-
-} // end llvm namespace
-
-#endif // PPC_MACHO_WRITER_INFO_H
diff --git a/release_23/lib/Target/PowerPC/PPCMachineFunctionInfo.h b/release_23/lib/Target/PowerPC/PPCMachineFunctionInfo.h
deleted file mode 100644
index 230ea0b0e046..000000000000
--- a/release_23/lib/Target/PowerPC/PPCMachineFunctionInfo.h
+++ /dev/null
@@ -1,102 +0,0 @@
-//===-- PPCMachineFunctionInfo.h - Private data used for PowerPC --*- C++ -*-=//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file declares the PowerPC specific subclass of MachineFunctionInfo.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef PPC_MACHINE_FUNCTION_INFO_H
-#define PPC_MACHINE_FUNCTION_INFO_H
-
-#include "llvm/CodeGen/MachineFunction.h"
-
-namespace llvm {
-
-/// PPCFunctionInfo - This class is derived from MachineFunction private
-/// PowerPC target-specific information for each MachineFunction.
-class PPCFunctionInfo : public MachineFunctionInfo {
-private:
- /// FramePointerSaveIndex - Frame index of where the old frame pointer is
- /// stored. Also used as an anchor for instructions that need to be altered
- /// when using frame pointers (dyna_add, dyna_sub.)
- int FramePointerSaveIndex;
-
- /// ReturnAddrSaveIndex - Frame index of where the return address is stored.
- ///
- int ReturnAddrSaveIndex;
-
- /// UsesLR - Indicates whether LR is used in the current function. This is
- /// only valid after the initial scan of the function by PEI.
- bool UsesLR;
-
- /// SpillsCR - Indicates whether CR is spilled in the current function.
- bool SpillsCR;
-
- /// LRStoreRequired - The bool indicates whether there is some explicit use of
- /// the LR/LR8 stack slot that is not obvious from scanning the code. This
- /// requires that the code generator produce a store of LR to the stack on
- /// entry, even though LR may otherwise apparently not be used.
- bool LRStoreRequired;
-
- /// MinReservedArea - This is the frame size that is at least reserved in a
- /// potential caller (parameter+linkage area).
- unsigned MinReservedArea;
-
- /// TailCallSPDelta - Stack pointer delta used when tail calling. Maximum
- /// amount the stack pointer is adjusted to make the frame bigger for tail
- /// calls. Used for creating an area before the register spill area.
- int TailCallSPDelta;
-
- /// HasFastCall - Does this function contain a fast call. Used to determine
- /// how the caller's stack pointer should be calculated (epilog/dynamicalloc).
- bool HasFastCall;
-
-public:
- PPCFunctionInfo(MachineFunction &MF)
- : FramePointerSaveIndex(0),
- ReturnAddrSaveIndex(0),
- SpillsCR(false),
- LRStoreRequired(false),
- MinReservedArea(0),
- TailCallSPDelta(0),
- HasFastCall(false) {}
-
- int getFramePointerSaveIndex() const { return FramePointerSaveIndex; }
- void setFramePointerSaveIndex(int Idx) { FramePointerSaveIndex = Idx; }
-
- int getReturnAddrSaveIndex() const { return ReturnAddrSaveIndex; }
- void setReturnAddrSaveIndex(int idx) { ReturnAddrSaveIndex = idx; }
-
- unsigned getMinReservedArea() const { return MinReservedArea; }
- void setMinReservedArea(unsigned size) { MinReservedArea = size; }
-
- int getTailCallSPDelta() const { return TailCallSPDelta; }
- void setTailCallSPDelta(int size) { TailCallSPDelta = size; }
-
- /// UsesLR - This is set when the prolog/epilog inserter does its initial scan
- /// of the function, it is true if the LR/LR8 register is ever explicitly
- /// accessed/clobbered in the machine function (e.g. by calls and movpctolr,
- /// which is used in PIC generation).
- void setUsesLR(bool U) { UsesLR = U; }
- bool usesLR() const { return UsesLR; }
-
- void setSpillsCR() { SpillsCR = true; }
- bool isCRSpilled() const { return SpillsCR; }
-
- void setLRStoreRequired() { LRStoreRequired = true; }
- bool isLRStoreRequired() const { return LRStoreRequired; }
-
- void setHasFastCall() { HasFastCall = true; }
- bool hasFastCall() const { return HasFastCall;}
-};
-
-} // end of namespace llvm
-
-
-#endif
diff --git a/release_23/lib/Target/PowerPC/PPCPerfectShuffle.h b/release_23/lib/Target/PowerPC/PPCPerfectShuffle.h
deleted file mode 100644
index 3164e33faae9..000000000000
--- a/release_23/lib/Target/PowerPC/PPCPerfectShuffle.h
+++ /dev/null
@@ -1,6586 +0,0 @@
-//===-- PPCPerfectShuffle.h - Altivec Perfect Shuffle Table ---------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file, which was autogenerated by llvm-PerfectShuffle, contains data
-// for the optimal way to build a perfect shuffle without using vperm.
-//
-//===----------------------------------------------------------------------===//
-
-// 31 entries have cost 0
-// 292 entries have cost 1
-// 1384 entries have cost 2
-// 3061 entries have cost 3
-// 1733 entries have cost 4
-// 60 entries have cost 5
-
-// This table is 6561*4 = 26244 bytes in size.
-static const unsigned PerfectShuffleTable[6561+1] = {
- 202162278U, // <0,0,0,0>: Cost 1 vspltisw0 LHS
- 1140850790U, // <0,0,0,1>: Cost 2 vmrghw <0,0,0,0>, LHS
- 2617247181U, // <0,0,0,2>: Cost 3 vsldoi4 <0,0,0,0>, <2,0,3,0>
- 2635163787U, // <0,0,0,3>: Cost 3 vsldoi4 <3,0,0,0>, <3,0,0,0>
- 1543507254U, // <0,0,0,4>: Cost 2 vsldoi4 <0,0,0,0>, RHS
- 2281701705U, // <0,0,0,5>: Cost 3 vmrglw <0,0,0,0>, <0,4,0,5>
- 2617250133U, // <0,0,0,6>: Cost 3 vsldoi4 <0,0,0,0>, <6,0,7,0>
- 2659054575U, // <0,0,0,7>: Cost 3 vsldoi4 <7,0,0,0>, <7,0,0,0>
- 202162278U, // <0,0,0,u>: Cost 1 vspltisw0 LHS
- 1141686282U, // <0,0,1,0>: Cost 2 vmrghw LHS, <0,0,1,1>
- 67944550U, // <0,0,1,1>: Cost 1 vmrghw LHS, LHS
- 1685241958U, // <0,0,1,2>: Cost 2 vsldoi12 <1,2,3,0>, LHS
- 2215870716U, // <0,0,1,3>: Cost 3 vmrghw LHS, <0,3,1,0>
- 1141727570U, // <0,0,1,4>: Cost 2 vmrghw LHS, <0,4,1,5>
- 2215428562U, // <0,0,1,5>: Cost 3 vmrghw LHS, <0,5,6,7>
- 2215428589U, // <0,0,1,6>: Cost 3 vmrghw LHS, <0,6,0,7>
- 2659062768U, // <0,0,1,7>: Cost 3 vsldoi4 <7,0,0,1>, <7,0,0,1>
- 67945117U, // <0,0,1,u>: Cost 1 vmrghw LHS, LHS
- 2684356045U, // <0,0,2,0>: Cost 3 vsldoi8 <0,0,0,0>, <2,0,3,0>
- 2216009830U, // <0,0,2,1>: Cost 3 vmrghw <0,2,1,2>, LHS
- 2216009901U, // <0,0,2,2>: Cost 3 vmrghw <0,2,1,2>, <0,2,1,2>
- 2698290853U, // <0,0,2,3>: Cost 3 vsldoi8 <2,3,0,0>, <2,3,0,0>
- 3289751890U, // <0,0,2,4>: Cost 4 vmrghw <0,2,1,2>, <0,4,1,5>
- 3758098275U, // <0,0,2,5>: Cost 4 vsldoi8 <0,0,0,0>, <2,5,3,1>
- 2684356538U, // <0,0,2,6>: Cost 3 vsldoi8 <0,0,0,0>, <2,6,3,7>
- 3758098410U, // <0,0,2,7>: Cost 4 vsldoi8 <0,0,0,0>, <2,7,0,1>
- 2216010397U, // <0,0,2,u>: Cost 3 vmrghw <0,2,1,2>, LHS
- 2702272651U, // <0,0,3,0>: Cost 3 vsldoi8 <3,0,0,0>, <3,0,0,0>
- 2216656998U, // <0,0,3,1>: Cost 3 vmrghw <0,3,1,0>, LHS
- 3844669704U, // <0,0,3,2>: Cost 4 vsldoi12 <3,2,3,0>, <0,3,2,3>
- 2216657148U, // <0,0,3,3>: Cost 3 vmrghw <0,3,1,0>, <0,3,1,0>
- 2684357122U, // <0,0,3,4>: Cost 3 vsldoi8 <0,0,0,0>, <3,4,5,6>
- 3732820066U, // <0,0,3,5>: Cost 4 vsldoi4 <7,0,0,3>, <5,6,7,0>
- 3778005624U, // <0,0,3,6>: Cost 4 vsldoi8 <3,3,0,0>, <3,6,0,7>
- 3374713464U, // <0,0,3,7>: Cost 4 vmrglw <3,2,0,3>, <3,6,0,7>
- 2216657565U, // <0,0,3,u>: Cost 3 vmrghw <0,3,1,0>, LHS
- 2217361408U, // <0,0,4,0>: Cost 3 vmrghw <0,4,1,5>, <0,0,0,0>
- 1143619686U, // <0,0,4,1>: Cost 2 vmrghw <0,4,1,5>, LHS
- 3291103405U, // <0,0,4,2>: Cost 4 vmrghw <0,4,1,5>, <0,2,1,2>
- 3827269988U, // <0,0,4,3>: Cost 4 vsldoi12 <0,3,1,0>, <0,4,3,5>
- 1143619922U, // <0,0,4,4>: Cost 2 vmrghw <0,4,1,5>, <0,4,1,5>
- 1610616118U, // <0,0,4,5>: Cost 2 vsldoi8 <0,0,0,0>, RHS
- 3758099833U, // <0,0,4,6>: Cost 4 vsldoi8 <0,0,0,0>, <4,6,5,2>
- 3854107016U, // <0,0,4,7>: Cost 4 vsldoi12 <4,7,5,0>, <0,4,7,5>
- 1143620253U, // <0,0,4,u>: Cost 2 vmrghw <0,4,1,5>, LHS
- 2284396544U, // <0,0,5,0>: Cost 3 vmrglw <0,4,0,5>, <0,0,0,0>
- 2218025062U, // <0,0,5,1>: Cost 3 vmrghw <0,5,1,5>, LHS
- 3758100203U, // <0,0,5,2>: Cost 4 vsldoi8 <0,0,0,0>, <5,2,1,3>
- 3395966100U, // <0,0,5,3>: Cost 4 vmrglw <6,7,0,5>, <7,2,0,3>
- 3804549052U, // <0,0,5,4>: Cost 4 vsldoi8 <7,7,0,0>, <5,4,6,5>
- 2302314964U, // <0,0,5,5>: Cost 3 vmrglw <3,4,0,5>, <3,4,0,5>
- 2785821138U, // <0,0,5,6>: Cost 3 vsldoi12 <5,6,7,0>, <0,5,6,7>
- 3395966428U, // <0,0,5,7>: Cost 4 vmrglw <6,7,0,5>, <7,6,0,7>
- 2787148260U, // <0,0,5,u>: Cost 3 vsldoi12 <5,u,7,0>, <0,5,u,7>
- 2684358997U, // <0,0,6,0>: Cost 3 vsldoi8 <0,0,0,0>, <6,0,7,0>
- 2218631270U, // <0,0,6,1>: Cost 3 vmrghw <0,6,0,7>, LHS
- 2684359162U, // <0,0,6,2>: Cost 3 vsldoi8 <0,0,0,0>, <6,2,7,3>
- 3758101042U, // <0,0,6,3>: Cost 4 vsldoi8 <0,0,0,0>, <6,3,4,5>
- 3732843830U, // <0,0,6,4>: Cost 4 vsldoi4 <7,0,0,6>, RHS
- 3758101227U, // <0,0,6,5>: Cost 4 vsldoi8 <0,0,0,0>, <6,5,7,1>
- 2684359480U, // <0,0,6,6>: Cost 3 vsldoi8 <0,0,0,0>, <6,6,6,6>
- 2724836173U, // <0,0,6,7>: Cost 3 vsldoi8 <6,7,0,0>, <6,7,0,0>
- 2725499806U, // <0,0,6,u>: Cost 3 vsldoi8 <6,u,0,0>, <6,u,0,0>
- 2726163439U, // <0,0,7,0>: Cost 3 vsldoi8 <7,0,0,0>, <7,0,0,0>
- 2219311206U, // <0,0,7,1>: Cost 3 vmrghw <0,7,1,0>, LHS
- 3868557900U, // <0,0,7,2>: Cost 4 vsldoi12 <7,2,3,0>, <0,7,2,3>
- 3377400112U, // <0,0,7,3>: Cost 4 vmrglw <3,6,0,7>, <3,2,0,3>
- 2684360038U, // <0,0,7,4>: Cost 3 vsldoi8 <0,0,0,0>, <7,4,5,6>
- 3732852834U, // <0,0,7,5>: Cost 4 vsldoi4 <7,0,0,7>, <5,6,7,0>
- 3871507060U, // <0,0,7,6>: Cost 4 vsldoi12 <7,6,7,0>, <0,7,6,7>
- 2303658616U, // <0,0,7,7>: Cost 3 vmrglw <3,6,0,7>, <3,6,0,7>
- 2726163439U, // <0,0,7,u>: Cost 3 vsldoi8 <7,0,0,0>, <7,0,0,0>
- 202162278U, // <0,0,u,0>: Cost 1 vspltisw0 LHS
- 72589414U, // <0,0,u,1>: Cost 1 vmrghw LHS, LHS
- 1685242525U, // <0,0,u,2>: Cost 2 vsldoi12 <1,2,3,0>, LHS
- 2220073212U, // <0,0,u,3>: Cost 3 vmrghw LHS, <0,3,1,0>
- 1146331474U, // <0,0,u,4>: Cost 2 vmrghw LHS, <0,4,1,5>
- 1610619034U, // <0,0,u,5>: Cost 2 vsldoi8 <0,0,0,0>, RHS
- 2785821138U, // <0,0,u,6>: Cost 3 vsldoi12 <5,6,7,0>, <0,5,6,7>
- 2659120119U, // <0,0,u,7>: Cost 3 vsldoi4 <7,0,0,u>, <7,0,0,u>
- 72589981U, // <0,0,u,u>: Cost 1 vmrghw LHS, LHS
- 2698297344U, // <0,1,0,0>: Cost 3 vsldoi8 <2,3,0,1>, <0,0,0,0>
- 1624555622U, // <0,1,0,1>: Cost 2 vsldoi8 <2,3,0,1>, LHS
- 2758984428U, // <0,1,0,2>: Cost 3 vsldoi12 <1,2,3,0>, <1,0,2,1>
- 2635237524U, // <0,1,0,3>: Cost 3 vsldoi4 <3,0,1,0>, <3,0,1,0>
- 2693652818U, // <0,1,0,4>: Cost 3 vsldoi8 <1,5,0,1>, <0,4,1,5>
- 2281701714U, // <0,1,0,5>: Cost 3 vmrglw <0,0,0,0>, <0,4,1,5>
- 2698297846U, // <0,1,0,6>: Cost 3 vsldoi8 <2,3,0,1>, <0,6,1,7>
- 2659128312U, // <0,1,0,7>: Cost 3 vsldoi4 <7,0,1,0>, <7,0,1,0>
- 1624556189U, // <0,1,0,u>: Cost 2 vsldoi8 <2,3,0,1>, LHS
- 1543585802U, // <0,1,1,0>: Cost 2 vsldoi4 <0,0,1,1>, <0,0,1,1>
- 1141728052U, // <0,1,1,1>: Cost 2 vmrghw LHS, <1,1,1,1>
- 1141728150U, // <0,1,1,2>: Cost 2 vmrghw LHS, <1,2,3,0>
- 2295644334U, // <0,1,1,3>: Cost 3 vmrglw <2,3,0,1>, <0,2,1,3>
- 1543589174U, // <0,1,1,4>: Cost 2 vsldoi4 <0,0,1,1>, RHS
- 2290999634U, // <0,1,1,5>: Cost 3 vmrglw <1,5,0,1>, <0,4,1,5>
- 2617332135U, // <0,1,1,6>: Cost 3 vsldoi4 <0,0,1,1>, <6,1,7,1>
- 2617332720U, // <0,1,1,7>: Cost 3 vsldoi4 <0,0,1,1>, <7,0,0,1>
- 1142171004U, // <0,1,1,u>: Cost 2 vmrghw LHS, <1,u,3,0>
- 1561509990U, // <0,1,2,0>: Cost 2 vsldoi4 <3,0,1,2>, LHS
- 2623308516U, // <0,1,2,1>: Cost 3 vsldoi4 <1,0,1,2>, <1,0,1,2>
- 2698298984U, // <0,1,2,2>: Cost 3 vsldoi8 <2,3,0,1>, <2,2,2,2>
- 835584U, // <0,1,2,3>: Cost 0 copy LHS
- 1561513270U, // <0,1,2,4>: Cost 2 vsldoi4 <3,0,1,2>, RHS
- 2647199304U, // <0,1,2,5>: Cost 3 vsldoi4 <5,0,1,2>, <5,0,1,2>
- 2698299322U, // <0,1,2,6>: Cost 3 vsldoi8 <2,3,0,1>, <2,6,3,7>
- 1585402874U, // <0,1,2,7>: Cost 2 vsldoi4 <7,0,1,2>, <7,0,1,2>
- 835584U, // <0,1,2,u>: Cost 0 copy LHS
- 2698299540U, // <0,1,3,0>: Cost 3 vsldoi8 <2,3,0,1>, <3,0,1,0>
- 3290399540U, // <0,1,3,1>: Cost 4 vmrghw <0,3,1,0>, <1,1,1,1>
- 2698299720U, // <0,1,3,2>: Cost 3 vsldoi8 <2,3,0,1>, <3,2,3,0>
- 2698299804U, // <0,1,3,3>: Cost 3 vsldoi8 <2,3,0,1>, <3,3,3,3>
- 2698299906U, // <0,1,3,4>: Cost 3 vsldoi8 <2,3,0,1>, <3,4,5,6>
- 3832726521U, // <0,1,3,5>: Cost 4 vsldoi12 <1,2,3,0>, <1,3,5,0>
- 2724842160U, // <0,1,3,6>: Cost 3 vsldoi8 <6,7,0,1>, <3,6,7,0>
- 2706926275U, // <0,1,3,7>: Cost 3 vsldoi8 <3,7,0,1>, <3,7,0,1>
- 2698300190U, // <0,1,3,u>: Cost 3 vsldoi8 <2,3,0,1>, <3,u,1,2>
- 2635268198U, // <0,1,4,0>: Cost 3 vsldoi4 <3,0,1,4>, LHS
- 2217362228U, // <0,1,4,1>: Cost 3 vmrghw <0,4,1,5>, <1,1,1,1>
- 2217362326U, // <0,1,4,2>: Cost 3 vmrghw <0,4,1,5>, <1,2,3,0>
- 2635270296U, // <0,1,4,3>: Cost 3 vsldoi4 <3,0,1,4>, <3,0,1,4>
- 2635271478U, // <0,1,4,4>: Cost 3 vsldoi4 <3,0,1,4>, RHS
- 1624558902U, // <0,1,4,5>: Cost 2 vsldoi8 <2,3,0,1>, RHS
- 2659160910U, // <0,1,4,6>: Cost 3 vsldoi4 <7,0,1,4>, <6,7,0,1>
- 2659161084U, // <0,1,4,7>: Cost 3 vsldoi4 <7,0,1,4>, <7,0,1,4>
- 1624559145U, // <0,1,4,u>: Cost 2 vsldoi8 <2,3,0,1>, RHS
- 3832726639U, // <0,1,5,0>: Cost 4 vsldoi12 <1,2,3,0>, <1,5,0,1>
- 2714889871U, // <0,1,5,1>: Cost 3 vsldoi8 <5,1,0,1>, <5,1,0,1>
- 2302314646U, // <0,1,5,2>: Cost 3 vmrglw <3,4,0,5>, <3,0,1,2>
- 3834717321U, // <0,1,5,3>: Cost 4 vsldoi12 <1,5,3,0>, <1,5,3,0>
- 3832726679U, // <0,1,5,4>: Cost 4 vsldoi12 <1,2,3,0>, <1,5,4,5>
- 2717544403U, // <0,1,5,5>: Cost 3 vsldoi8 <5,5,0,1>, <5,5,0,1>
- 2718208036U, // <0,1,5,6>: Cost 3 vsldoi8 <5,6,0,1>, <5,6,0,1>
- 3792613493U, // <0,1,5,7>: Cost 4 vsldoi8 <5,7,0,1>, <5,7,0,1>
- 2719535302U, // <0,1,5,u>: Cost 3 vsldoi8 <5,u,0,1>, <5,u,0,1>
- 2659172454U, // <0,1,6,0>: Cost 3 vsldoi4 <7,0,1,6>, LHS
- 3832726735U, // <0,1,6,1>: Cost 4 vsldoi12 <1,2,3,0>, <1,6,1,7>
- 2724844026U, // <0,1,6,2>: Cost 3 vsldoi8 <6,7,0,1>, <6,2,7,3>
- 3775361608U, // <0,1,6,3>: Cost 4 vsldoi8 <2,u,0,1>, <6,3,7,0>
- 2659175734U, // <0,1,6,4>: Cost 3 vsldoi4 <7,0,1,6>, RHS
- 3832726771U, // <0,1,6,5>: Cost 4 vsldoi12 <1,2,3,0>, <1,6,5,7>
- 2724844344U, // <0,1,6,6>: Cost 3 vsldoi8 <6,7,0,1>, <6,6,6,6>
- 1651102542U, // <0,1,6,7>: Cost 2 vsldoi8 <6,7,0,1>, <6,7,0,1>
- 1651766175U, // <0,1,6,u>: Cost 2 vsldoi8 <6,u,0,1>, <6,u,0,1>
- 2724844536U, // <0,1,7,0>: Cost 3 vsldoi8 <6,7,0,1>, <7,0,1,0>
- 3377397770U, // <0,1,7,1>: Cost 4 vmrglw <3,6,0,7>, <0,0,1,1>
- 2698302636U, // <0,1,7,2>: Cost 3 vsldoi8 <2,3,0,1>, <7,2,3,0>
- 2728162531U, // <0,1,7,3>: Cost 3 vsldoi8 <7,3,0,1>, <7,3,0,1>
- 2724844902U, // <0,1,7,4>: Cost 3 vsldoi8 <6,7,0,1>, <7,4,5,6>
- 3377398098U, // <0,1,7,5>: Cost 4 vmrglw <3,6,0,7>, <0,4,1,5>
- 2724845076U, // <0,1,7,6>: Cost 3 vsldoi8 <6,7,0,1>, <7,6,7,0>
- 2724845164U, // <0,1,7,7>: Cost 3 vsldoi8 <6,7,0,1>, <7,7,7,7>
- 2724845186U, // <0,1,7,u>: Cost 3 vsldoi8 <6,7,0,1>, <7,u,1,2>
- 1561559142U, // <0,1,u,0>: Cost 2 vsldoi4 <3,0,1,u>, LHS
- 1146331956U, // <0,1,u,1>: Cost 2 vmrghw LHS, <1,1,1,1>
- 1146332054U, // <0,1,u,2>: Cost 2 vmrghw LHS, <1,2,3,0>
- 835584U, // <0,1,u,3>: Cost 0 copy LHS
- 1561562422U, // <0,1,u,4>: Cost 2 vsldoi4 <3,0,1,u>, RHS
- 1624561818U, // <0,1,u,5>: Cost 2 vsldoi8 <2,3,0,1>, RHS
- 2220074191U, // <0,1,u,6>: Cost 3 vmrghw LHS, <1,6,1,7>
- 1585452032U, // <0,1,u,7>: Cost 2 vsldoi4 <7,0,1,u>, <7,0,1,u>
- 835584U, // <0,1,u,u>: Cost 0 copy LHS
- 2214593997U, // <0,2,0,0>: Cost 3 vmrghw <0,0,0,0>, <2,0,3,0>
- 2214675999U, // <0,2,0,1>: Cost 3 vmrghw <0,0,1,1>, <2,1,3,1>
- 2214594152U, // <0,2,0,2>: Cost 3 vmrghw <0,0,0,0>, <2,2,2,2>
- 1207959654U, // <0,2,0,3>: Cost 2 vmrglw <0,0,0,0>, LHS
- 3709054262U, // <0,2,0,4>: Cost 4 vsldoi4 <3,0,2,0>, RHS
- 3375350836U, // <0,2,0,5>: Cost 4 vmrglw <3,3,0,0>, <1,4,2,5>
- 2214594490U, // <0,2,0,6>: Cost 3 vmrghw <0,0,0,0>, <2,6,3,7>
- 3288336362U, // <0,2,0,7>: Cost 4 vmrghw <0,0,0,0>, <2,7,0,1>
- 1207959659U, // <0,2,0,u>: Cost 2 vmrglw <0,0,0,0>, LHS
- 2215871994U, // <0,2,1,0>: Cost 3 vmrghw LHS, <2,0,u,0>
- 2215470623U, // <0,2,1,1>: Cost 3 vmrghw LHS, <2,1,3,1>
- 1141728872U, // <0,2,1,2>: Cost 2 vmrghw LHS, <2,2,2,2>
- 1141728934U, // <0,2,1,3>: Cost 2 vmrghw LHS, <2,3,0,1>
- 2215872323U, // <0,2,1,4>: Cost 3 vmrghw LHS, <2,4,u,5>
- 2215872405U, // <0,2,1,5>: Cost 3 vmrghw LHS, <2,5,u,6>
- 1141729210U, // <0,2,1,6>: Cost 2 vmrghw LHS, <2,6,3,7>
- 2215430122U, // <0,2,1,7>: Cost 3 vmrghw LHS, <2,7,0,1>
- 1141729368U, // <0,2,1,u>: Cost 2 vmrghw LHS, <2,u,3,3>
- 3289736698U, // <0,2,2,0>: Cost 4 vmrghw <0,2,1,0>, <2,0,u,0>
- 3289744927U, // <0,2,2,1>: Cost 4 vmrghw <0,2,1,1>, <2,1,3,1>
- 2216011368U, // <0,2,2,2>: Cost 3 vmrghw <0,2,1,2>, <2,2,2,2>
- 2216019622U, // <0,2,2,3>: Cost 3 vmrghw <0,2,1,3>, <2,3,0,1>
- 3289769795U, // <0,2,2,4>: Cost 4 vmrghw <0,2,1,4>, <2,4,u,5>
- 3289778069U, // <0,2,2,5>: Cost 4 vmrghw <0,2,1,5>, <2,5,u,6>
- 2216044474U, // <0,2,2,6>: Cost 3 vmrghw <0,2,1,6>, <2,6,3,7>
- 3732960259U, // <0,2,2,7>: Cost 4 vsldoi4 <7,0,2,2>, <7,0,2,2>
- 2216061016U, // <0,2,2,u>: Cost 3 vmrghw <0,2,1,u>, <2,u,3,3>
- 2758985382U, // <0,2,3,0>: Cost 3 vsldoi12 <1,2,3,0>, <2,3,0,1>
- 2758985392U, // <0,2,3,1>: Cost 3 vsldoi12 <1,2,3,0>, <2,3,1,2>
- 3290400360U, // <0,2,3,2>: Cost 4 vmrghw <0,3,1,0>, <2,2,2,2>
- 2758985408U, // <0,2,3,3>: Cost 3 vsldoi12 <1,2,3,0>, <2,3,3,0>
- 2758985422U, // <0,2,3,4>: Cost 3 vsldoi12 <1,2,3,0>, <2,3,4,5>
- 2785822424U, // <0,2,3,5>: Cost 3 vsldoi12 <5,6,7,0>, <2,3,5,6>
- 3290400698U, // <0,2,3,6>: Cost 4 vmrghw <0,3,1,0>, <2,6,3,7>
- 2765915876U, // <0,2,3,7>: Cost 3 vsldoi12 <2,3,7,0>, <2,3,7,0>
- 2758985453U, // <0,2,3,u>: Cost 3 vsldoi12 <1,2,3,0>, <2,3,u,0>
- 3291104762U, // <0,2,4,0>: Cost 4 vmrghw <0,4,1,5>, <2,0,u,0>
- 2217362979U, // <0,2,4,1>: Cost 3 vmrghw <0,4,1,5>, <2,1,3,5>
- 2217363048U, // <0,2,4,2>: Cost 3 vmrghw <0,4,1,5>, <2,2,2,2>
- 2217363110U, // <0,2,4,3>: Cost 3 vmrghw <0,4,1,5>, <2,3,0,1>
- 3291105087U, // <0,2,4,4>: Cost 4 vmrghw <0,4,1,5>, <2,4,u,1>
- 3291105173U, // <0,2,4,5>: Cost 4 vmrghw <0,4,1,5>, <2,5,u,6>
- 2217363386U, // <0,2,4,6>: Cost 3 vmrghw <0,4,1,5>, <2,6,3,7>
- 3788639688U, // <0,2,4,7>: Cost 4 vsldoi8 <5,1,0,2>, <4,7,5,0>
- 2217363515U, // <0,2,4,u>: Cost 3 vmrghw <0,4,1,5>, <2,u,0,1>
- 3376054371U, // <0,2,5,0>: Cost 4 vmrglw <3,4,0,5>, <0,1,2,0>
- 3788639888U, // <0,2,5,1>: Cost 4 vsldoi8 <5,1,0,2>, <5,1,0,2>
- 3376055912U, // <0,2,5,2>: Cost 4 vmrglw <3,4,0,5>, <2,2,2,2>
- 2302312550U, // <0,2,5,3>: Cost 3 vmrglw <3,4,0,5>, LHS
- 3376054375U, // <0,2,5,4>: Cost 4 vmrglw <3,4,0,5>, <0,1,2,4>
- 3374728244U, // <0,2,5,5>: Cost 4 vmrglw <3,2,0,5>, <1,4,2,5>
- 3805229154U, // <0,2,5,6>: Cost 4 vsldoi8 <7,u,0,2>, <5,6,7,0>
- 3376055512U, // <0,2,5,7>: Cost 4 vmrglw <3,4,0,5>, <1,6,2,7>
- 2302312555U, // <0,2,5,u>: Cost 3 vmrglw <3,4,0,5>, LHS
- 3709100134U, // <0,2,6,0>: Cost 4 vsldoi4 <3,0,2,6>, LHS
- 3709100950U, // <0,2,6,1>: Cost 4 vsldoi4 <3,0,2,6>, <1,2,3,0>
- 3709102010U, // <0,2,6,2>: Cost 4 vsldoi4 <3,0,2,6>, <2,6,3,7>
- 2758985658U, // <0,2,6,3>: Cost 3 vsldoi12 <1,2,3,0>, <2,6,3,7>
- 3709103414U, // <0,2,6,4>: Cost 4 vsldoi4 <3,0,2,6>, RHS
- 3732992098U, // <0,2,6,5>: Cost 4 vsldoi4 <7,0,2,6>, <5,6,7,0>
- 3292374970U, // <0,2,6,6>: Cost 4 vmrghw <0,6,0,7>, <2,6,3,7>
- 3798594383U, // <0,2,6,7>: Cost 4 vsldoi8 <6,7,0,2>, <6,7,0,2>
- 2758985703U, // <0,2,6,u>: Cost 3 vsldoi12 <1,2,3,0>, <2,6,u,7>
- 3788641274U, // <0,2,7,0>: Cost 4 vsldoi8 <5,1,0,2>, <7,0,1,2>
- 3377398508U, // <0,2,7,1>: Cost 4 vmrglw <3,6,0,7>, <1,0,2,1>
- 3377398590U, // <0,2,7,2>: Cost 4 vmrglw <3,6,0,7>, <1,1,2,2>
- 2303656038U, // <0,2,7,3>: Cost 3 vmrglw <3,6,0,7>, LHS
- 3709111606U, // <0,2,7,4>: Cost 4 vsldoi4 <3,0,2,7>, RHS
- 3377398836U, // <0,2,7,5>: Cost 4 vmrglw <3,6,0,7>, <1,4,2,5>
- 3803903447U, // <0,2,7,6>: Cost 4 vsldoi8 <7,6,0,2>, <7,6,0,2>
- 3293054954U, // <0,2,7,7>: Cost 4 vmrghw <0,7,1,0>, <2,7,0,1>
- 2303656043U, // <0,2,7,u>: Cost 3 vmrglw <3,6,0,7>, LHS
- 2220074490U, // <0,2,u,0>: Cost 3 vmrghw LHS, <2,0,u,0>
- 2220074527U, // <0,2,u,1>: Cost 3 vmrghw LHS, <2,1,3,1>
- 1146332776U, // <0,2,u,2>: Cost 2 vmrghw LHS, <2,2,2,2>
- 1146332838U, // <0,2,u,3>: Cost 2 vmrghw LHS, <2,3,0,1>
- 2220074819U, // <0,2,u,4>: Cost 3 vmrghw LHS, <2,4,u,5>
- 2220074901U, // <0,2,u,5>: Cost 3 vmrghw LHS, <2,5,u,6>
- 1146333114U, // <0,2,u,6>: Cost 2 vmrghw LHS, <2,6,3,7>
- 2220074986U, // <0,2,u,7>: Cost 3 vmrghw LHS, <2,7,0,1>
- 1146333243U, // <0,2,u,u>: Cost 2 vmrghw LHS, <2,u,0,1>
- 2629410816U, // <0,3,0,0>: Cost 3 vsldoi4 <2,0,3,0>, <0,0,0,0>
- 2753530006U, // <0,3,0,1>: Cost 3 vsldoi12 <0,3,1,0>, <3,0,1,2>
- 2629412301U, // <0,3,0,2>: Cost 3 vsldoi4 <2,0,3,0>, <2,0,3,0>
- 2214594972U, // <0,3,0,3>: Cost 3 vmrghw <0,0,0,0>, <3,3,3,3>
- 2758985908U, // <0,3,0,4>: Cost 3 vsldoi12 <1,2,3,0>, <3,0,4,5>
- 3733016674U, // <0,3,0,5>: Cost 4 vsldoi4 <7,0,3,0>, <5,6,7,0>
- 3777364488U, // <0,3,0,6>: Cost 4 vsldoi8 <3,2,0,3>, <0,6,3,7>
- 2281703354U, // <0,3,0,7>: Cost 3 vmrglw <0,0,0,0>, <2,6,3,7>
- 2758985941U, // <0,3,0,u>: Cost 3 vsldoi12 <1,2,3,0>, <3,0,u,2>
- 1141729430U, // <0,3,1,0>: Cost 2 vmrghw LHS, <3,0,1,2>
- 2215471334U, // <0,3,1,1>: Cost 3 vmrghw LHS, <3,1,1,1>
- 2215471425U, // <0,3,1,2>: Cost 3 vmrghw LHS, <3,2,2,2>
- 1141729692U, // <0,3,1,3>: Cost 2 vmrghw LHS, <3,3,3,3>
- 1141729794U, // <0,3,1,4>: Cost 2 vmrghw LHS, <3,4,5,6>
- 2215430738U, // <0,3,1,5>: Cost 3 vmrghw LHS, <3,5,5,5>
- 2215430776U, // <0,3,1,6>: Cost 3 vmrghw LHS, <3,6,0,7>
- 2295646138U, // <0,3,1,7>: Cost 3 vmrglw <2,3,0,1>, <2,6,3,7>
- 1141730078U, // <0,3,1,u>: Cost 2 vmrghw LHS, <3,u,1,2>
- 2758986032U, // <0,3,2,0>: Cost 3 vsldoi12 <1,2,3,0>, <3,2,0,3>
- 3709141910U, // <0,3,2,1>: Cost 4 vsldoi4 <3,0,3,2>, <1,2,3,0>
- 3289753921U, // <0,3,2,2>: Cost 4 vmrghw <0,2,1,2>, <3,2,2,2>
- 2770929992U, // <0,3,2,3>: Cost 3 vsldoi12 <3,2,3,0>, <3,2,3,0>
- 3289754114U, // <0,3,2,4>: Cost 4 vmrghw <0,2,1,2>, <3,4,5,6>
- 3362095460U, // <0,3,2,5>: Cost 5 vmrglw <1,1,0,2>, <0,4,3,5>
- 3832727910U, // <0,3,2,6>: Cost 4 vsldoi12 <1,2,3,0>, <3,2,6,3>
- 3365414842U, // <0,3,2,7>: Cost 4 vmrglw <1,6,0,2>, <2,6,3,7>
- 2771298677U, // <0,3,2,u>: Cost 3 vsldoi12 <3,2,u,0>, <3,2,u,0>
- 2216659094U, // <0,3,3,0>: Cost 3 vmrghw <0,3,1,0>, <3,0,1,2>
- 3290409190U, // <0,3,3,1>: Cost 4 vmrghw <0,3,1,1>, <3,1,1,1>
- 2703624496U, // <0,3,3,2>: Cost 3 vsldoi8 <3,2,0,3>, <3,2,0,3>
- 2216683932U, // <0,3,3,3>: Cost 3 vmrghw <0,3,1,3>, <3,3,3,3>
- 2216692226U, // <0,3,3,4>: Cost 3 vmrghw <0,3,1,4>, <3,4,5,6>
- 3733041250U, // <0,3,3,5>: Cost 4 vsldoi4 <7,0,3,3>, <5,6,7,0>
- 3832727988U, // <0,3,3,6>: Cost 4 vsldoi12 <1,2,3,0>, <3,3,6,0>
- 3374712762U, // <0,3,3,7>: Cost 4 vmrglw <3,2,0,3>, <2,6,3,7>
- 2216725278U, // <0,3,3,u>: Cost 3 vmrghw <0,3,1,u>, <3,u,1,2>
- 2217363606U, // <0,3,4,0>: Cost 3 vmrghw <0,4,1,5>, <3,0,1,2>
- 3291105510U, // <0,3,4,1>: Cost 4 vmrghw <0,4,1,5>, <3,1,1,1>
- 3291105601U, // <0,3,4,2>: Cost 4 vmrghw <0,4,1,5>, <3,2,2,2>
- 2217363868U, // <0,3,4,3>: Cost 3 vmrghw <0,4,1,5>, <3,3,3,3>
- 2217363970U, // <0,3,4,4>: Cost 3 vmrghw <0,4,1,5>, <3,4,5,6>
- 2758986242U, // <0,3,4,5>: Cost 3 vsldoi12 <1,2,3,0>, <3,4,5,6>
- 3727077685U, // <0,3,4,6>: Cost 4 vsldoi4 <6,0,3,4>, <6,0,3,4>
- 3364767674U, // <0,3,4,7>: Cost 4 vmrglw <1,5,0,4>, <2,6,3,7>
- 2217364254U, // <0,3,4,u>: Cost 3 vmrghw <0,4,1,5>, <3,u,1,2>
- 3832728102U, // <0,3,5,0>: Cost 4 vsldoi12 <1,2,3,0>, <3,5,0,6>
- 3405916003U, // <0,3,5,1>: Cost 4 vmrglw <u,4,0,5>, <2,5,3,1>
- 3376055840U, // <0,3,5,2>: Cost 4 vmrglw <3,4,0,5>, <2,1,3,2>
- 3376055679U, // <0,3,5,3>: Cost 4 vmrglw <3,4,0,5>, <1,u,3,3>
- 3376055194U, // <0,3,5,4>: Cost 4 vmrglw <3,4,0,5>, <1,2,3,4>
- 3859565138U, // <0,3,5,5>: Cost 4 vsldoi12 <5,6,7,0>, <3,5,5,5>
- 2727514210U, // <0,3,5,6>: Cost 3 vsldoi8 <7,2,0,3>, <5,6,7,0>
- 3376056250U, // <0,3,5,7>: Cost 4 vmrglw <3,4,0,5>, <2,6,3,7>
- 2727514210U, // <0,3,5,u>: Cost 3 vsldoi8 <7,2,0,3>, <5,6,7,0>
- 2758986360U, // <0,3,6,0>: Cost 3 vsldoi12 <1,2,3,0>, <3,6,0,7>
- 3709174678U, // <0,3,6,1>: Cost 4 vsldoi4 <3,0,3,6>, <1,2,3,0>
- 3795284411U, // <0,3,6,2>: Cost 4 vsldoi8 <6,2,0,3>, <6,2,0,3>
- 3709175980U, // <0,3,6,3>: Cost 4 vsldoi4 <3,0,3,6>, <3,0,3,6>
- 3833096860U, // <0,3,6,4>: Cost 4 vsldoi12 <1,2,u,0>, <3,6,4,7>
- 3376728235U, // <0,3,6,5>: Cost 5 vmrglw <3,5,0,6>, <3,0,3,5>
- 3859565229U, // <0,3,6,6>: Cost 4 vsldoi12 <5,6,7,0>, <3,6,6,6>
- 2773879472U, // <0,3,6,7>: Cost 3 vsldoi12 <3,6,7,0>, <3,6,7,0>
- 2758986360U, // <0,3,6,u>: Cost 3 vsldoi12 <1,2,3,0>, <3,6,0,7>
- 2303656854U, // <0,3,7,0>: Cost 3 vmrglw <3,6,0,7>, <1,2,3,0>
- 3807229018U, // <0,3,7,1>: Cost 4 vsldoi8 <u,2,0,3>, <7,1,2,u>
- 2727515284U, // <0,3,7,2>: Cost 3 vsldoi8 <7,2,0,3>, <7,2,0,3>
- 3377399410U, // <0,3,7,3>: Cost 4 vmrglw <3,6,0,7>, <2,2,3,3>
- 3377398682U, // <0,3,7,4>: Cost 4 vmrglw <3,6,0,7>, <1,2,3,4>
- 3801257409U, // <0,3,7,5>: Cost 4 vsldoi8 <7,2,0,3>, <7,5,6,7>
- 3377399980U, // <0,3,7,6>: Cost 4 vmrglw <3,6,0,7>, <3,0,3,6>
- 3375409082U, // <0,3,7,7>: Cost 4 vmrglw <3,3,0,7>, <2,6,3,7>
- 2731497082U, // <0,3,7,u>: Cost 3 vsldoi8 <7,u,0,3>, <7,u,0,3>
- 1146333334U, // <0,3,u,0>: Cost 2 vmrghw LHS, <3,0,1,2>
- 2220075238U, // <0,3,u,1>: Cost 3 vmrghw LHS, <3,1,1,1>
- 2220075329U, // <0,3,u,2>: Cost 3 vmrghw LHS, <3,2,2,2>
- 1146333596U, // <0,3,u,3>: Cost 2 vmrghw LHS, <3,3,3,3>
- 1146333698U, // <0,3,u,4>: Cost 2 vmrghw LHS, <3,4,5,6>
- 2758986566U, // <0,3,u,5>: Cost 3 vsldoi12 <1,2,3,0>, <3,u,5,6>
- 2803739472U, // <0,3,u,6>: Cost 3 vsldoi12 <u,6,7,0>, <3,u,6,7>
- 2295703482U, // <0,3,u,7>: Cost 3 vmrglw <2,3,0,u>, <2,6,3,7>
- 1146333982U, // <0,3,u,u>: Cost 2 vmrghw LHS, <3,u,1,2>
- 2214595473U, // <0,4,0,0>: Cost 3 vmrghw <0,0,0,0>, <4,0,5,0>
- 2693677158U, // <0,4,0,1>: Cost 3 vsldoi8 <1,5,0,4>, LHS
- 3839437689U, // <0,4,0,2>: Cost 4 vsldoi12 <2,3,4,0>, <4,0,2,3>
- 3709200559U, // <0,4,0,3>: Cost 4 vsldoi4 <3,0,4,0>, <3,0,4,0>
- 2693677394U, // <0,4,0,4>: Cost 3 vsldoi8 <1,5,0,4>, <0,4,1,5>
- 1140854070U, // <0,4,0,5>: Cost 2 vmrghw <0,0,0,0>, RHS
- 3767419409U, // <0,4,0,6>: Cost 4 vsldoi8 <1,5,0,4>, <0,6,4,7>
- 3854109604U, // <0,4,0,7>: Cost 4 vsldoi12 <4,7,5,0>, <4,0,7,1>
- 1140854313U, // <0,4,0,u>: Cost 2 vmrghw <0,0,0,0>, RHS
- 1141689234U, // <0,4,1,0>: Cost 2 vmrghw LHS, <4,0,5,1>
- 2215431114U, // <0,4,1,1>: Cost 3 vmrghw LHS, <4,1,2,3>
- 2215431221U, // <0,4,1,2>: Cost 3 vmrghw LHS, <4,2,5,2>
- 2635466928U, // <0,4,1,3>: Cost 3 vsldoi4 <3,0,4,1>, <3,0,4,1>
- 1141689552U, // <0,4,1,4>: Cost 2 vmrghw LHS, <4,4,4,4>
- 67947830U, // <0,4,1,5>: Cost 1 vmrghw LHS, RHS
- 2215431545U, // <0,4,1,6>: Cost 3 vmrghw LHS, <4,6,5,2>
- 2659357716U, // <0,4,1,7>: Cost 3 vsldoi4 <7,0,4,1>, <7,0,4,1>
- 67948073U, // <0,4,1,u>: Cost 1 vmrghw LHS, RHS
- 3767420369U, // <0,4,2,0>: Cost 4 vsldoi8 <1,5,0,4>, <2,0,3,4>
- 3767420451U, // <0,4,2,1>: Cost 4 vsldoi8 <1,5,0,4>, <2,1,3,5>
- 3767420520U, // <0,4,2,2>: Cost 4 vsldoi8 <1,5,0,4>, <2,2,2,2>
- 2698323625U, // <0,4,2,3>: Cost 3 vsldoi8 <2,3,0,4>, <2,3,0,4>
- 3709218102U, // <0,4,2,4>: Cost 4 vsldoi4 <3,0,4,2>, RHS
- 2216013110U, // <0,4,2,5>: Cost 3 vmrghw <0,2,1,2>, RHS
- 3767420858U, // <0,4,2,6>: Cost 4 vsldoi8 <1,5,0,4>, <2,6,3,7>
- 3774719981U, // <0,4,2,7>: Cost 4 vsldoi8 <2,7,0,4>, <2,7,0,4>
- 2216013353U, // <0,4,2,u>: Cost 3 vmrghw <0,2,1,2>, RHS
- 3767421078U, // <0,4,3,0>: Cost 4 vsldoi8 <1,5,0,4>, <3,0,1,2>
- 3776710880U, // <0,4,3,1>: Cost 4 vsldoi8 <3,1,0,4>, <3,1,0,4>
- 3833097325U, // <0,4,3,2>: Cost 5 vsldoi12 <1,2,u,0>, <4,3,2,4>
- 3767421340U, // <0,4,3,3>: Cost 4 vsldoi8 <1,5,0,4>, <3,3,3,3>
- 3767421442U, // <0,4,3,4>: Cost 4 vsldoi8 <1,5,0,4>, <3,4,5,6>
- 2216660278U, // <0,4,3,5>: Cost 3 vmrghw <0,3,1,0>, RHS
- 3833097361U, // <0,4,3,6>: Cost 5 vsldoi12 <1,2,u,0>, <4,3,6,4>
- 3780692678U, // <0,4,3,7>: Cost 4 vsldoi8 <3,7,0,4>, <3,7,0,4>
- 2216660521U, // <0,4,3,u>: Cost 3 vmrghw <0,3,1,0>, RHS
- 2617573416U, // <0,4,4,0>: Cost 3 vsldoi4 <0,0,4,4>, <0,0,4,4>
- 2217364450U, // <0,4,4,1>: Cost 3 vmrghw <0,4,1,5>, <4,1,5,0>
- 3691316771U, // <0,4,4,2>: Cost 4 vsldoi4 <0,0,4,4>, <2,1,3,5>
- 3709233331U, // <0,4,4,3>: Cost 4 vsldoi4 <3,0,4,4>, <3,0,4,4>
- 2785823952U, // <0,4,4,4>: Cost 3 vsldoi12 <5,6,7,0>, <4,4,4,4>
- 1143622966U, // <0,4,4,5>: Cost 2 vmrghw <0,4,1,5>, RHS
- 3691319723U, // <0,4,4,6>: Cost 4 vsldoi4 <0,0,4,4>, <6,1,7,5>
- 3854109932U, // <0,4,4,7>: Cost 4 vsldoi12 <4,7,5,0>, <4,4,7,5>
- 1143623209U, // <0,4,4,u>: Cost 2 vmrghw <0,4,1,5>, RHS
- 2635497574U, // <0,4,5,0>: Cost 3 vsldoi4 <3,0,4,5>, LHS
- 2635498390U, // <0,4,5,1>: Cost 3 vsldoi4 <3,0,4,5>, <1,2,3,0>
- 3709240936U, // <0,4,5,2>: Cost 4 vsldoi4 <3,0,4,5>, <2,2,2,2>
- 2635499700U, // <0,4,5,3>: Cost 3 vsldoi4 <3,0,4,5>, <3,0,4,5>
- 2635500854U, // <0,4,5,4>: Cost 3 vsldoi4 <3,0,4,5>, RHS
- 2785824044U, // <0,4,5,5>: Cost 3 vsldoi12 <5,6,7,0>, <4,5,5,6>
- 1685245238U, // <0,4,5,6>: Cost 2 vsldoi12 <1,2,3,0>, RHS
- 2659390488U, // <0,4,5,7>: Cost 3 vsldoi4 <7,0,4,5>, <7,0,4,5>
- 1685245256U, // <0,4,5,u>: Cost 2 vsldoi12 <1,2,3,0>, RHS
- 3839438161U, // <0,4,6,0>: Cost 4 vsldoi12 <2,3,4,0>, <4,6,0,7>
- 3798610347U, // <0,4,6,1>: Cost 4 vsldoi8 <6,7,0,4>, <6,1,7,5>
- 3798610426U, // <0,4,6,2>: Cost 4 vsldoi8 <6,7,0,4>, <6,2,7,3>
- 3795956237U, // <0,4,6,3>: Cost 4 vsldoi8 <6,3,0,4>, <6,3,0,4>
- 3733138742U, // <0,4,6,4>: Cost 4 vsldoi4 <7,0,4,6>, RHS
- 2218634550U, // <0,4,6,5>: Cost 3 vmrghw <0,6,0,7>, RHS
- 3798610744U, // <0,4,6,6>: Cost 4 vsldoi8 <6,7,0,4>, <6,6,6,6>
- 2724868945U, // <0,4,6,7>: Cost 3 vsldoi8 <6,7,0,4>, <6,7,0,4>
- 2725532578U, // <0,4,6,u>: Cost 3 vsldoi8 <6,u,0,4>, <6,u,0,4>
- 3383371465U, // <0,4,7,0>: Cost 4 vmrglw <4,6,0,7>, <2,3,4,0>
- 3800601668U, // <0,4,7,1>: Cost 4 vsldoi8 <7,1,0,4>, <7,1,0,4>
- 3775386826U, // <0,4,7,2>: Cost 5 vsldoi8 <2,u,0,4>, <7,2,6,3>
- 3801928934U, // <0,4,7,3>: Cost 4 vsldoi8 <7,3,0,4>, <7,3,0,4>
- 3721202998U, // <0,4,7,4>: Cost 4 vsldoi4 <5,0,4,7>, RHS
- 2780368328U, // <0,4,7,5>: Cost 3 vsldoi12 <4,7,5,0>, <4,7,5,0>
- 3383372686U, // <0,4,7,6>: Cost 5 vmrglw <4,6,0,7>, <4,0,4,6>
- 3854110170U, // <0,4,7,7>: Cost 4 vsldoi12 <4,7,5,0>, <4,7,7,0>
- 2780368328U, // <0,4,7,u>: Cost 3 vsldoi12 <4,7,5,0>, <4,7,5,0>
- 1146334098U, // <0,4,u,0>: Cost 2 vmrghw LHS, <4,0,5,1>
- 2220076002U, // <0,4,u,1>: Cost 3 vmrghw LHS, <4,1,5,0>
- 2220076085U, // <0,4,u,2>: Cost 3 vmrghw LHS, <4,2,5,2>
- 2635524279U, // <0,4,u,3>: Cost 3 vsldoi4 <3,0,4,u>, <3,0,4,u>
- 1146334416U, // <0,4,u,4>: Cost 2 vmrghw LHS, <4,4,4,4>
- 72592694U, // <0,4,u,5>: Cost 1 vmrghw LHS, RHS
- 1685245481U, // <0,4,u,6>: Cost 2 vsldoi12 <1,2,3,0>, RHS
- 2659415067U, // <0,4,u,7>: Cost 3 vsldoi4 <7,0,4,u>, <7,0,4,u>
- 72592937U, // <0,4,u,u>: Cost 1 vmrghw LHS, RHS
- 2281704337U, // <0,5,0,0>: Cost 3 vmrglw <0,0,0,0>, <4,0,5,0>
- 2704965734U, // <0,5,0,1>: Cost 3 vsldoi8 <3,4,0,5>, LHS
- 3778707666U, // <0,5,0,2>: Cost 4 vsldoi8 <3,4,0,5>, <0,2,5,3>
- 3778707708U, // <0,5,0,3>: Cost 4 vsldoi8 <3,4,0,5>, <0,3,1,0>
- 2687050057U, // <0,5,0,4>: Cost 3 vsldoi8 <0,4,0,5>, <0,4,0,5>
- 2214596612U, // <0,5,0,5>: Cost 3 vmrghw <0,0,0,0>, <5,5,5,5>
- 2785824372U, // <0,5,0,6>: Cost 3 vsldoi12 <5,6,7,0>, <5,0,6,1>
- 3854110332U, // <0,5,0,7>: Cost 4 vsldoi12 <4,7,5,0>, <5,0,7,0>
- 2704966301U, // <0,5,0,u>: Cost 3 vsldoi8 <3,4,0,5>, LHS
- 1567768678U, // <0,5,1,0>: Cost 2 vsldoi4 <4,0,5,1>, LHS
- 2312236570U, // <0,5,1,1>: Cost 3 vmrglw <5,1,0,1>, <4,u,5,1>
- 2215431915U, // <0,5,1,2>: Cost 3 vmrghw LHS, <5,2,1,3>
- 2641512598U, // <0,5,1,3>: Cost 3 vsldoi4 <4,0,5,1>, <3,0,1,2>
- 1567771538U, // <0,5,1,4>: Cost 2 vsldoi4 <4,0,5,1>, <4,0,5,1>
- 1141690372U, // <0,5,1,5>: Cost 2 vmrghw LHS, <5,5,5,5>
- 1141690466U, // <0,5,1,6>: Cost 2 vmrghw LHS, <5,6,7,0>
- 2641515514U, // <0,5,1,7>: Cost 3 vsldoi4 <4,0,5,1>, <7,0,1,2>
- 1141690615U, // <0,5,1,u>: Cost 2 vmrghw LHS, <5,u,5,5>
- 3772736973U, // <0,5,2,0>: Cost 4 vsldoi8 <2,4,0,5>, <2,0,3,0>
- 3778709024U, // <0,5,2,1>: Cost 4 vsldoi8 <3,4,0,5>, <2,1,3,2>
- 3778709096U, // <0,5,2,2>: Cost 4 vsldoi8 <3,4,0,5>, <2,2,2,2>
- 3778709158U, // <0,5,2,3>: Cost 4 vsldoi8 <3,4,0,5>, <2,3,0,1>
- 3772737275U, // <0,5,2,4>: Cost 4 vsldoi8 <2,4,0,5>, <2,4,0,5>
- 3859566351U, // <0,5,2,5>: Cost 4 vsldoi12 <5,6,7,0>, <5,2,5,3>
- 3778709434U, // <0,5,2,6>: Cost 4 vsldoi8 <3,4,0,5>, <2,6,3,7>
- 3805251562U, // <0,5,2,7>: Cost 4 vsldoi8 <7,u,0,5>, <2,7,0,1>
- 3775391807U, // <0,5,2,u>: Cost 4 vsldoi8 <2,u,0,5>, <2,u,0,5>
- 2704967830U, // <0,5,3,0>: Cost 3 vsldoi8 <3,4,0,5>, <3,0,1,2>
- 3776719073U, // <0,5,3,1>: Cost 4 vsldoi8 <3,1,0,5>, <3,1,0,5>
- 3777382706U, // <0,5,3,2>: Cost 4 vsldoi8 <3,2,0,5>, <3,2,0,5>
- 3778709887U, // <0,5,3,3>: Cost 4 vsldoi8 <3,4,0,5>, <3,3,0,1>
- 2704968148U, // <0,5,3,4>: Cost 3 vsldoi8 <3,4,0,5>, <3,4,0,5>
- 3857428317U, // <0,5,3,5>: Cost 4 vsldoi12 <5,3,5,0>, <5,3,5,0>
- 3364096514U, // <0,5,3,6>: Cost 4 vmrglw <1,4,0,3>, <3,4,5,6>
- 3780700871U, // <0,5,3,7>: Cost 4 vsldoi8 <3,7,0,5>, <3,7,0,5>
- 2707622680U, // <0,5,3,u>: Cost 3 vsldoi8 <3,u,0,5>, <3,u,0,5>
- 2728856466U, // <0,5,4,0>: Cost 3 vsldoi8 <7,4,0,5>, <4,0,5,1>
- 3697361674U, // <0,5,4,1>: Cost 4 vsldoi4 <1,0,5,4>, <1,0,5,4>
- 3697362601U, // <0,5,4,2>: Cost 4 vsldoi4 <1,0,5,4>, <2,3,0,4>
- 3364766635U, // <0,5,4,3>: Cost 4 vmrglw <1,5,0,4>, <1,2,5,3>
- 2217365428U, // <0,5,4,4>: Cost 3 vmrghw <0,4,1,5>, <5,4,5,6>
- 2704969014U, // <0,5,4,5>: Cost 3 vsldoi8 <3,4,0,5>, RHS
- 2785824700U, // <0,5,4,6>: Cost 3 vsldoi12 <5,6,7,0>, <5,4,6,5>
- 3364766963U, // <0,5,4,7>: Cost 4 vmrglw <1,5,0,4>, <1,6,5,7>
- 2704969257U, // <0,5,4,u>: Cost 3 vsldoi8 <3,4,0,5>, RHS
- 3846148050U, // <0,5,5,0>: Cost 4 vsldoi12 <3,4,5,0>, <5,5,0,0>
- 2326203282U, // <0,5,5,1>: Cost 3 vmrglw <7,4,0,5>, <4,0,5,1>
- 3291746027U, // <0,5,5,2>: Cost 4 vmrghw <0,5,1,2>, <5,2,1,3>
- 3376054482U, // <0,5,5,3>: Cost 4 vmrglw <3,4,0,5>, <0,2,5,3>
- 3790655366U, // <0,5,5,4>: Cost 4 vsldoi8 <5,4,0,5>, <5,4,0,5>
- 2785824772U, // <0,5,5,5>: Cost 3 vsldoi12 <5,6,7,0>, <5,5,5,5>
- 2724876386U, // <0,5,5,6>: Cost 3 vsldoi8 <6,7,0,5>, <5,6,7,0>
- 3858903057U, // <0,5,5,7>: Cost 4 vsldoi12 <5,5,7,0>, <5,5,7,0>
- 2736820484U, // <0,5,5,u>: Cost 3 vsldoi8 <u,7,0,5>, <5,u,7,0>
- 2659467366U, // <0,5,6,0>: Cost 3 vsldoi4 <7,0,5,6>, LHS
- 3859566643U, // <0,5,6,1>: Cost 4 vsldoi12 <5,6,7,0>, <5,6,1,7>
- 3798618618U, // <0,5,6,2>: Cost 4 vsldoi8 <6,7,0,5>, <6,2,7,3>
- 3852857410U, // <0,5,6,3>: Cost 4 vsldoi12 <4,5,6,0>, <5,6,3,4>
- 2659470646U, // <0,5,6,4>: Cost 3 vsldoi4 <7,0,5,6>, RHS
- 2659471458U, // <0,5,6,5>: Cost 3 vsldoi4 <7,0,5,6>, <5,6,7,0>
- 3832729696U, // <0,5,6,6>: Cost 4 vsldoi12 <1,2,3,0>, <5,6,6,7>
- 1712083042U, // <0,5,6,7>: Cost 2 vsldoi12 <5,6,7,0>, <5,6,7,0>
- 1712156779U, // <0,5,6,u>: Cost 2 vsldoi12 <5,6,u,0>, <5,6,u,0>
- 2731512826U, // <0,5,7,0>: Cost 3 vsldoi8 <7,u,0,5>, <7,0,1,2>
- 3859566717U, // <0,5,7,1>: Cost 4 vsldoi12 <5,6,7,0>, <5,7,1,0>
- 3798619284U, // <0,5,7,2>: Cost 4 vsldoi8 <6,7,0,5>, <7,2,0,3>
- 3778712803U, // <0,5,7,3>: Cost 4 vsldoi8 <3,4,0,5>, <7,3,0,1>
- 2728858936U, // <0,5,7,4>: Cost 3 vsldoi8 <7,4,0,5>, <7,4,0,5>
- 3859566753U, // <0,5,7,5>: Cost 4 vsldoi12 <5,6,7,0>, <5,7,5,0>
- 3377398135U, // <0,5,7,6>: Cost 4 vmrglw <3,6,0,7>, <0,4,5,6>
- 3798619686U, // <0,5,7,7>: Cost 4 vsldoi8 <6,7,0,5>, <7,7,0,0>
- 2731513468U, // <0,5,7,u>: Cost 3 vsldoi8 <7,u,0,5>, <7,u,0,5>
- 1567826022U, // <0,5,u,0>: Cost 2 vsldoi4 <4,0,5,u>, LHS
- 2704971566U, // <0,5,u,1>: Cost 3 vsldoi8 <3,4,0,5>, LHS
- 2220076779U, // <0,5,u,2>: Cost 3 vmrghw LHS, <5,2,1,3>
- 2641569942U, // <0,5,u,3>: Cost 3 vsldoi4 <4,0,5,u>, <3,0,1,2>
- 1567828889U, // <0,5,u,4>: Cost 2 vsldoi4 <4,0,5,u>, <4,0,5,u>
- 1146335236U, // <0,5,u,5>: Cost 2 vmrghw LHS, <5,5,5,5>
- 1146335330U, // <0,5,u,6>: Cost 2 vmrghw LHS, <5,6,7,0>
- 1713410308U, // <0,5,u,7>: Cost 2 vsldoi12 <5,u,7,0>, <5,u,7,0>
- 1713484045U, // <0,5,u,u>: Cost 2 vsldoi12 <5,u,u,0>, <5,u,u,0>
- 2214596949U, // <0,6,0,0>: Cost 3 vmrghw <0,0,0,0>, <6,0,7,0>
- 2214678951U, // <0,6,0,1>: Cost 3 vmrghw <0,0,1,1>, <6,1,7,1>
- 2214597114U, // <0,6,0,2>: Cost 3 vmrghw <0,0,0,0>, <6,2,7,3>
- 3852857653U, // <0,6,0,3>: Cost 4 vsldoi12 <4,5,6,0>, <6,0,3,4>
- 3832729919U, // <0,6,0,4>: Cost 4 vsldoi12 <1,2,3,0>, <6,0,4,5>
- 3721293427U, // <0,6,0,5>: Cost 4 vsldoi4 <5,0,6,0>, <5,0,6,0>
- 2214597432U, // <0,6,0,6>: Cost 3 vmrghw <0,0,0,0>, <6,6,6,6>
- 1207962934U, // <0,6,0,7>: Cost 2 vmrglw <0,0,0,0>, RHS
- 1207962935U, // <0,6,0,u>: Cost 2 vmrglw <0,0,0,0>, RHS
- 2215432481U, // <0,6,1,0>: Cost 3 vmrghw LHS, <6,0,1,2>
- 2215432615U, // <0,6,1,1>: Cost 3 vmrghw LHS, <6,1,7,1>
- 1141690874U, // <0,6,1,2>: Cost 2 vmrghw LHS, <6,2,7,3>
- 2215432754U, // <0,6,1,3>: Cost 3 vmrghw LHS, <6,3,4,5>
- 2215432817U, // <0,6,1,4>: Cost 3 vmrghw LHS, <6,4,2,5>
- 2215432939U, // <0,6,1,5>: Cost 3 vmrghw LHS, <6,5,7,1>
- 1141691192U, // <0,6,1,6>: Cost 2 vmrghw LHS, <6,6,6,6>
- 1221905718U, // <0,6,1,7>: Cost 2 vmrglw <2,3,0,1>, RHS
- 1221905719U, // <0,6,1,u>: Cost 2 vmrglw <2,3,0,1>, RHS
- 3852857787U, // <0,6,2,0>: Cost 4 vsldoi12 <4,5,6,0>, <6,2,0,3>
- 3289764265U, // <0,6,2,1>: Cost 4 vmrghw <0,2,1,3>, <6,1,7,3>
- 3289690618U, // <0,6,2,2>: Cost 4 vmrghw <0,2,0,3>, <6,2,7,3>
- 3862589907U, // <0,6,2,3>: Cost 4 vsldoi12 <6,2,3,0>, <6,2,3,0>
- 3733253430U, // <0,6,2,4>: Cost 4 vsldoi4 <7,0,6,2>, RHS
- 3733254242U, // <0,6,2,5>: Cost 4 vsldoi4 <7,0,6,2>, <5,6,7,0>
- 3777390522U, // <0,6,2,6>: Cost 4 vsldoi8 <3,2,0,6>, <2,6,3,7>
- 2785825274U, // <0,6,2,7>: Cost 3 vsldoi12 <5,6,7,0>, <6,2,7,3>
- 2785825283U, // <0,6,2,u>: Cost 3 vsldoi12 <5,6,7,0>, <6,2,u,3>
- 3777390742U, // <0,6,3,0>: Cost 4 vsldoi8 <3,2,0,6>, <3,0,1,2>
- 3863106066U, // <0,6,3,1>: Cost 4 vsldoi12 <6,3,1,0>, <6,3,1,0>
- 3777390899U, // <0,6,3,2>: Cost 4 vsldoi8 <3,2,0,6>, <3,2,0,6>
- 3290436146U, // <0,6,3,3>: Cost 4 vmrghw <0,3,1,4>, <6,3,4,5>
- 3779381762U, // <0,6,3,4>: Cost 4 vsldoi8 <3,5,0,6>, <3,4,5,6>
- 3779381798U, // <0,6,3,5>: Cost 4 vsldoi8 <3,5,0,6>, <3,5,0,6>
- 3733262920U, // <0,6,3,6>: Cost 4 vsldoi4 <7,0,6,3>, <6,3,7,0>
- 2300972342U, // <0,6,3,7>: Cost 3 vmrglw <3,2,0,3>, RHS
- 2300972343U, // <0,6,3,u>: Cost 3 vmrglw <3,2,0,3>, RHS
- 3802606482U, // <0,6,4,0>: Cost 4 vsldoi8 <7,4,0,6>, <4,0,5,1>
- 2217365931U, // <0,6,4,1>: Cost 3 vmrghw <0,4,1,5>, <6,1,7,5>
- 2217366010U, // <0,6,4,2>: Cost 3 vmrghw <0,4,1,5>, <6,2,7,3>
- 3291107890U, // <0,6,4,3>: Cost 4 vmrghw <0,4,1,5>, <6,3,4,5>
- 3291099805U, // <0,6,4,4>: Cost 4 vmrghw <0,4,1,4>, <6,4,7,4>
- 3777391926U, // <0,6,4,5>: Cost 4 vsldoi8 <3,2,0,6>, RHS
- 2217366328U, // <0,6,4,6>: Cost 3 vmrghw <0,4,1,5>, <6,6,6,6>
- 2291027254U, // <0,6,4,7>: Cost 3 vmrglw <1,5,0,4>, RHS
- 2291027255U, // <0,6,4,u>: Cost 3 vmrglw <1,5,0,4>, RHS
- 3852858033U, // <0,6,5,0>: Cost 4 vsldoi12 <4,5,6,0>, <6,5,0,6>
- 3395964532U, // <0,6,5,1>: Cost 4 vmrglw <6,7,0,5>, <5,0,6,1>
- 3864507069U, // <0,6,5,2>: Cost 4 vsldoi12 <6,5,2,0>, <6,5,2,0>
- 3376056678U, // <0,6,5,3>: Cost 5 vmrglw <3,4,0,5>, <3,2,6,3>
- 3721334070U, // <0,6,5,4>: Cost 4 vsldoi4 <5,0,6,5>, RHS
- 3395964860U, // <0,6,5,5>: Cost 4 vmrglw <6,7,0,5>, <5,4,6,5>
- 3864802017U, // <0,6,5,6>: Cost 4 vsldoi12 <6,5,6,0>, <6,5,6,0>
- 2302315830U, // <0,6,5,7>: Cost 3 vmrglw <3,4,0,5>, RHS
- 2302315831U, // <0,6,5,u>: Cost 3 vmrglw <3,4,0,5>, RHS
- 3852858108U, // <0,6,6,0>: Cost 4 vsldoi12 <4,5,6,0>, <6,6,0,0>
- 3398624745U, // <0,6,6,1>: Cost 4 vmrglw <7,2,0,6>, <2,0,6,1>
- 2218668538U, // <0,6,6,2>: Cost 3 vmrghw <0,6,1,2>, <6,2,7,3>
- 3292418610U, // <0,6,6,3>: Cost 4 vmrghw <0,6,1,3>, <6,3,4,5>
- 3733286198U, // <0,6,6,4>: Cost 4 vsldoi4 <7,0,6,6>, RHS
- 3797299889U, // <0,6,6,5>: Cost 4 vsldoi8 <6,5,0,6>, <6,5,0,6>
- 2785825592U, // <0,6,6,6>: Cost 3 vsldoi12 <5,6,7,0>, <6,6,6,6>
- 2785825602U, // <0,6,6,7>: Cost 3 vsldoi12 <5,6,7,0>, <6,6,7,7>
- 2785825611U, // <0,6,6,u>: Cost 3 vsldoi12 <5,6,7,0>, <6,6,u,7>
- 2785825614U, // <0,6,7,0>: Cost 3 vsldoi12 <5,6,7,0>, <6,7,0,1>
- 2758988632U, // <0,6,7,1>: Cost 3 vsldoi12 <1,2,3,0>, <6,7,1,2>
- 3377400084U, // <0,6,7,2>: Cost 4 vmrglw <3,6,0,7>, <3,1,6,2>
- 2792166248U, // <0,6,7,3>: Cost 3 vsldoi12 <6,7,3,0>, <6,7,3,0>
- 2785825654U, // <0,6,7,4>: Cost 3 vsldoi12 <5,6,7,0>, <6,7,4,5>
- 2785825664U, // <0,6,7,5>: Cost 3 vsldoi12 <5,6,7,0>, <6,7,5,6>
- 3859567493U, // <0,6,7,6>: Cost 4 vsldoi12 <5,6,7,0>, <6,7,6,2>
- 2303659318U, // <0,6,7,7>: Cost 3 vmrglw <3,6,0,7>, RHS
- 2303659319U, // <0,6,7,u>: Cost 3 vmrglw <3,6,0,7>, RHS
- 2785825695U, // <0,6,u,0>: Cost 3 vsldoi12 <5,6,7,0>, <6,u,0,1>
- 2220077479U, // <0,6,u,1>: Cost 3 vmrghw LHS, <6,1,7,1>
- 1146335738U, // <0,6,u,2>: Cost 2 vmrghw LHS, <6,2,7,3>
- 2792829881U, // <0,6,u,3>: Cost 3 vsldoi12 <6,u,3,0>, <6,u,3,0>
- 2785825735U, // <0,6,u,4>: Cost 3 vsldoi12 <5,6,7,0>, <6,u,4,5>
- 2785825664U, // <0,6,u,5>: Cost 3 vsldoi12 <5,6,7,0>, <6,7,5,6>
- 1146336056U, // <0,6,u,6>: Cost 2 vmrghw LHS, <6,6,6,6>
- 1221963062U, // <0,6,u,7>: Cost 2 vmrglw <2,3,0,u>, RHS
- 1221963063U, // <0,6,u,u>: Cost 2 vmrglw <2,3,0,u>, RHS
- 2653593600U, // <0,7,0,0>: Cost 3 vsldoi4 <6,0,7,0>, <0,0,0,0>
- 2706309222U, // <0,7,0,1>: Cost 3 vsldoi8 <3,6,0,7>, LHS
- 3709421498U, // <0,7,0,2>: Cost 4 vsldoi4 <3,0,7,0>, <2,6,3,7>
- 2281705978U, // <0,7,0,3>: Cost 3 vmrglw <0,0,0,0>, <6,2,7,3>
- 2785825816U, // <0,7,0,4>: Cost 3 vsldoi12 <5,6,7,0>, <7,0,4,5>
- 2785825826U, // <0,7,0,5>: Cost 3 vsldoi12 <5,6,7,0>, <7,0,5,6>
- 2653598037U, // <0,7,0,6>: Cost 3 vsldoi4 <6,0,7,0>, <6,0,7,0>
- 2214598252U, // <0,7,0,7>: Cost 3 vmrghw <0,0,0,0>, <7,7,7,7>
- 2706309789U, // <0,7,0,u>: Cost 3 vsldoi8 <3,6,0,7>, LHS
- 1141691386U, // <0,7,1,0>: Cost 2 vmrghw LHS, <7,0,1,2>
- 2215433290U, // <0,7,1,1>: Cost 3 vmrghw LHS, <7,1,1,1>
- 2706310038U, // <0,7,1,2>: Cost 3 vsldoi8 <3,6,0,7>, <1,2,3,0>
- 2322190842U, // <0,7,1,3>: Cost 3 vmrglw <6,7,0,1>, <6,2,7,3>
- 1141691750U, // <0,7,1,4>: Cost 2 vmrghw LHS, <7,4,5,6>
- 2215433654U, // <0,7,1,5>: Cost 3 vmrghw LHS, <7,5,5,5>
- 2653606230U, // <0,7,1,6>: Cost 3 vsldoi4 <6,0,7,1>, <6,0,7,1>
- 1141692012U, // <0,7,1,7>: Cost 2 vmrghw LHS, <7,7,7,7>
- 1141692034U, // <0,7,1,u>: Cost 2 vmrghw LHS, <7,u,1,2>
- 2785825940U, // <0,7,2,0>: Cost 3 vsldoi12 <5,6,7,0>, <7,2,0,3>
- 3768108576U, // <0,7,2,1>: Cost 5 vsldoi8 <1,6,0,7>, <2,1,3,2>
- 3780052584U, // <0,7,2,2>: Cost 4 vsldoi8 <3,6,0,7>, <2,2,2,2>
- 2794820780U, // <0,7,2,3>: Cost 3 vsldoi12 <7,2,3,0>, <7,2,3,0>
- 3859641528U, // <0,7,2,4>: Cost 4 vsldoi12 <5,6,u,0>, <7,2,4,3>
- 3733327970U, // <0,7,2,5>: Cost 4 vsldoi4 <7,0,7,2>, <5,6,7,0>
- 3778062266U, // <0,7,2,6>: Cost 4 vsldoi8 <3,3,0,7>, <2,6,3,7>
- 3733328944U, // <0,7,2,7>: Cost 4 vsldoi4 <7,0,7,2>, <7,0,7,2>
- 2795189465U, // <0,7,2,u>: Cost 3 vsldoi12 <7,2,u,0>, <7,2,u,0>
- 2324861026U, // <0,7,3,0>: Cost 3 vmrglw <7,2,0,3>, <5,6,7,0>
- 3780053233U, // <0,7,3,1>: Cost 4 vsldoi8 <3,6,0,7>, <3,1,2,3>
- 3780053296U, // <0,7,3,2>: Cost 4 vsldoi8 <3,6,0,7>, <3,2,0,3>
- 3778062725U, // <0,7,3,3>: Cost 4 vsldoi8 <3,3,0,7>, <3,3,0,7>
- 3780053506U, // <0,7,3,4>: Cost 4 vsldoi8 <3,6,0,7>, <3,4,5,6>
- 3803941469U, // <0,7,3,5>: Cost 4 vsldoi8 <7,6,0,7>, <3,5,6,7>
- 2706311800U, // <0,7,3,6>: Cost 3 vsldoi8 <3,6,0,7>, <3,6,0,7>
- 3398603586U, // <0,7,3,7>: Cost 4 vmrglw <7,2,0,3>, <6,6,7,7>
- 2707639066U, // <0,7,3,u>: Cost 3 vsldoi8 <3,u,0,7>, <3,u,0,7>
- 2217366522U, // <0,7,4,0>: Cost 3 vmrghw <0,4,1,5>, <7,0,1,2>
- 3727369110U, // <0,7,4,1>: Cost 4 vsldoi4 <6,0,7,4>, <1,2,3,0>
- 3291108500U, // <0,7,4,2>: Cost 4 vmrghw <0,4,1,5>, <7,2,0,3>
- 3727370872U, // <0,7,4,3>: Cost 4 vsldoi4 <6,0,7,4>, <3,6,0,7>
- 2217366886U, // <0,7,4,4>: Cost 3 vmrghw <0,4,1,5>, <7,4,5,6>
- 2706312502U, // <0,7,4,5>: Cost 3 vsldoi8 <3,6,0,7>, RHS
- 3786026321U, // <0,7,4,6>: Cost 4 vsldoi8 <4,6,0,7>, <4,6,0,7>
- 2217367148U, // <0,7,4,7>: Cost 3 vmrghw <0,4,1,5>, <7,7,7,7>
- 2706312745U, // <0,7,4,u>: Cost 3 vsldoi8 <3,6,0,7>, RHS
- 2322223202U, // <0,7,5,0>: Cost 3 vmrglw <6,7,0,5>, <5,6,7,0>
- 3399946987U, // <0,7,5,1>: Cost 4 vmrglw <7,4,0,5>, <6,5,7,1>
- 3291780244U, // <0,7,5,2>: Cost 4 vmrghw <0,5,1,6>, <7,2,0,3>
- 3727378582U, // <0,7,5,3>: Cost 4 vsldoi4 <6,0,7,5>, <3,0,1,2>
- 3727379766U, // <0,7,5,4>: Cost 4 vsldoi4 <6,0,7,5>, RHS
- 3859568054U, // <0,7,5,5>: Cost 4 vsldoi12 <5,6,7,0>, <7,5,5,5>
- 2785826241U, // <0,7,5,6>: Cost 3 vsldoi12 <5,6,7,0>, <7,5,6,7>
- 3395965762U, // <0,7,5,7>: Cost 4 vmrglw <6,7,0,5>, <6,6,7,7>
- 2787153363U, // <0,7,5,u>: Cost 3 vsldoi12 <5,u,7,0>, <7,5,u,7>
- 2785826268U, // <0,7,6,0>: Cost 3 vsldoi12 <5,6,7,0>, <7,6,0,7>
- 3780055420U, // <0,7,6,1>: Cost 5 vsldoi8 <3,6,0,7>, <6,1,2,3>
- 3859568110U, // <0,7,6,2>: Cost 4 vsldoi12 <5,6,7,0>, <7,6,2,7>
- 3874534903U, // <0,7,6,3>: Cost 4 vsldoi12 <u,2,3,0>, <7,6,3,7>
- 3859641856U, // <0,7,6,4>: Cost 4 vsldoi12 <5,6,u,0>, <7,6,4,7>
- 3733360738U, // <0,7,6,5>: Cost 4 vsldoi4 <7,0,7,6>, <5,6,7,0>
- 3859568145U, // <0,7,6,6>: Cost 4 vsldoi12 <5,6,7,0>, <7,6,6,6>
- 2797770260U, // <0,7,6,7>: Cost 3 vsldoi12 <7,6,7,0>, <7,6,7,0>
- 2797843997U, // <0,7,6,u>: Cost 3 vsldoi12 <7,6,u,0>, <7,6,u,0>
- 2785826342U, // <0,7,7,0>: Cost 3 vsldoi12 <5,6,7,0>, <7,7,0,0>
- 3727393686U, // <0,7,7,1>: Cost 4 vsldoi4 <6,0,7,7>, <1,2,3,0>
- 3868563003U, // <0,7,7,2>: Cost 4 vsldoi12 <7,2,3,0>, <7,7,2,3>
- 3377397988U, // <0,7,7,3>: Cost 4 vmrglw <3,6,0,7>, <0,2,7,3>
- 2219349350U, // <0,7,7,4>: Cost 3 vmrghw <0,7,1,4>, <7,4,5,6>
- 3859568217U, // <0,7,7,5>: Cost 4 vsldoi12 <5,6,7,0>, <7,7,5,6>
- 2730202588U, // <0,7,7,6>: Cost 3 vsldoi8 <7,6,0,7>, <7,6,0,7>
- 2785826412U, // <0,7,7,7>: Cost 3 vsldoi12 <5,6,7,0>, <7,7,7,7>
- 2731529854U, // <0,7,7,u>: Cost 3 vsldoi8 <7,u,0,7>, <7,u,0,7>
- 1146336250U, // <0,7,u,0>: Cost 2 vmrghw LHS, <7,0,1,2>
- 2706315054U, // <0,7,u,1>: Cost 3 vsldoi8 <3,6,0,7>, LHS
- 2653660845U, // <0,7,u,2>: Cost 3 vsldoi4 <6,0,7,u>, <2,3,0,u>
- 2322248186U, // <0,7,u,3>: Cost 3 vmrglw <6,7,0,u>, <6,2,7,3>
- 1146336614U, // <0,7,u,4>: Cost 2 vmrghw LHS, <7,4,5,6>
- 2706315418U, // <0,7,u,5>: Cost 3 vsldoi8 <3,6,0,7>, RHS
- 2653663581U, // <0,7,u,6>: Cost 3 vsldoi4 <6,0,7,u>, <6,0,7,u>
- 1146336876U, // <0,7,u,7>: Cost 2 vmrghw LHS, <7,7,7,7>
- 1146336898U, // <0,7,u,u>: Cost 2 vmrghw LHS, <7,u,1,2>
- 202162278U, // <0,u,0,0>: Cost 1 vspltisw0 LHS
- 1624612966U, // <0,u,0,1>: Cost 2 vsldoi8 <2,3,0,u>, LHS
- 2629780986U, // <0,u,0,2>: Cost 3 vsldoi4 <2,0,u,0>, <2,0,u,0>
- 1207959708U, // <0,u,0,3>: Cost 2 vmrglw <0,0,0,0>, LHS
- 1544097078U, // <0,u,0,4>: Cost 2 vsldoi4 <0,0,u,0>, RHS
- 1140856986U, // <0,u,0,5>: Cost 2 vmrghw <0,0,0,0>, RHS
- 2698355253U, // <0,u,0,6>: Cost 3 vsldoi8 <2,3,0,u>, <0,6,u,7>
- 1207962952U, // <0,u,0,7>: Cost 2 vmrglw <0,0,0,0>, RHS
- 202162278U, // <0,u,0,u>: Cost 1 vspltisw0 LHS
- 1142134483U, // <0,u,1,0>: Cost 2 vmrghw LHS, <u,0,1,2>
- 67950382U, // <0,u,1,1>: Cost 1 vmrghw LHS, LHS
- 1142175624U, // <0,u,1,2>: Cost 2 vmrghw LHS, <u,2,3,3>
- 1142175676U, // <0,u,1,3>: Cost 2 vmrghw LHS, <u,3,0,1>
- 1142134847U, // <0,u,1,4>: Cost 2 vmrghw LHS, <u,4,5,6>
- 67950746U, // <0,u,1,5>: Cost 1 vmrghw LHS, RHS
- 1142175952U, // <0,u,1,6>: Cost 2 vmrghw LHS, <u,6,3,7>
- 1221905736U, // <0,u,1,7>: Cost 2 vmrglw <2,3,0,1>, RHS
- 67950949U, // <0,u,1,u>: Cost 1 vmrghw LHS, LHS
- 1562026086U, // <0,u,2,0>: Cost 2 vsldoi4 <3,0,u,2>, LHS
- 2216015662U, // <0,u,2,1>: Cost 3 vmrghw <0,2,1,2>, LHS
- 2698356328U, // <0,u,2,2>: Cost 3 vsldoi8 <2,3,0,u>, <2,2,2,2>
- 835584U, // <0,u,2,3>: Cost 0 copy LHS
- 1562029366U, // <0,u,2,4>: Cost 2 vsldoi4 <3,0,u,2>, RHS
- 2216016026U, // <0,u,2,5>: Cost 3 vmrghw <0,2,1,2>, RHS
- 2698356666U, // <0,u,2,6>: Cost 3 vsldoi8 <2,3,0,u>, <2,6,3,7>
- 1585919033U, // <0,u,2,7>: Cost 2 vsldoi4 <7,0,u,2>, <7,0,u,2>
- 835584U, // <0,u,2,u>: Cost 0 copy LHS
- 2758989756U, // <0,u,3,0>: Cost 3 vsldoi12 <1,2,3,0>, <u,3,0,1>
- 2216662830U, // <0,u,3,1>: Cost 3 vmrghw <0,3,1,0>, LHS
- 2703665461U, // <0,u,3,2>: Cost 3 vsldoi8 <3,2,0,u>, <3,2,0,u>
- 2758989782U, // <0,u,3,3>: Cost 3 vsldoi12 <1,2,3,0>, <u,3,3,0>
- 2758989796U, // <0,u,3,4>: Cost 3 vsldoi12 <1,2,3,0>, <u,3,4,5>
- 2216663194U, // <0,u,3,5>: Cost 3 vmrghw <0,3,1,0>, RHS
- 2706319993U, // <0,u,3,6>: Cost 3 vsldoi8 <3,6,0,u>, <3,6,0,u>
- 2300972360U, // <0,u,3,7>: Cost 3 vmrglw <3,2,0,3>, RHS
- 2216663397U, // <0,u,3,u>: Cost 3 vmrghw <0,3,1,0>, LHS
- 2217367251U, // <0,u,4,0>: Cost 3 vmrghw <0,4,1,5>, <u,0,1,2>
- 1143625518U, // <0,u,4,1>: Cost 2 vmrghw <0,4,1,5>, LHS
- 2217367432U, // <0,u,4,2>: Cost 3 vmrghw <0,4,1,5>, <u,2,3,3>
- 2217367484U, // <0,u,4,3>: Cost 3 vmrghw <0,4,1,5>, <u,3,0,1>
- 1143619922U, // <0,u,4,4>: Cost 2 vmrghw <0,4,1,5>, <0,4,1,5>
- 1143625882U, // <0,u,4,5>: Cost 2 vmrghw <0,4,1,5>, RHS
- 2217367760U, // <0,u,4,6>: Cost 3 vmrghw <0,4,1,5>, <u,6,3,7>
- 2291027272U, // <0,u,4,7>: Cost 3 vmrglw <1,5,0,4>, RHS
- 1143626085U, // <0,u,4,u>: Cost 2 vmrghw <0,4,1,5>, LHS
- 2635792486U, // <0,u,5,0>: Cost 3 vsldoi4 <3,0,u,5>, LHS
- 2635793302U, // <0,u,5,1>: Cost 3 vsldoi4 <3,0,u,5>, <1,2,3,0>
- 2302314646U, // <0,u,5,2>: Cost 3 vmrglw <3,4,0,5>, <3,0,1,2>
- 2635794648U, // <0,u,5,3>: Cost 3 vsldoi4 <3,0,u,5>, <3,0,u,5>
- 2635795766U, // <0,u,5,4>: Cost 3 vsldoi4 <3,0,u,5>, RHS
- 2717601754U, // <0,u,5,5>: Cost 3 vsldoi8 <5,5,0,u>, <5,5,0,u>
- 1685248154U, // <0,u,5,6>: Cost 2 vsldoi12 <1,2,3,0>, RHS
- 2302315848U, // <0,u,5,7>: Cost 3 vmrglw <3,4,0,5>, RHS
- 1685248172U, // <0,u,5,u>: Cost 2 vsldoi12 <1,2,3,0>, RHS
- 2759358645U, // <0,u,6,0>: Cost 3 vsldoi12 <1,2,u,0>, <u,6,0,7>
- 2218637102U, // <0,u,6,1>: Cost 3 vmrghw <0,6,0,7>, LHS
- 2724901370U, // <0,u,6,2>: Cost 3 vsldoi8 <6,7,0,u>, <6,2,7,3>
- 2758990032U, // <0,u,6,3>: Cost 3 vsldoi12 <1,2,3,0>, <u,6,3,7>
- 2659691830U, // <0,u,6,4>: Cost 3 vsldoi4 <7,0,u,6>, RHS
- 2659471458U, // <0,u,6,5>: Cost 3 vsldoi4 <7,0,5,6>, <5,6,7,0>
- 2724901688U, // <0,u,6,6>: Cost 3 vsldoi8 <6,7,0,u>, <6,6,6,6>
- 1651159893U, // <0,u,6,7>: Cost 2 vsldoi8 <6,7,0,u>, <6,7,0,u>
- 1651823526U, // <0,u,6,u>: Cost 2 vsldoi8 <6,u,0,u>, <6,u,0,u>
- 2785827072U, // <0,u,7,0>: Cost 3 vsldoi12 <5,6,7,0>, <u,7,0,1>
- 2803964168U, // <0,u,7,1>: Cost 3 vsldoi12 <u,7,1,0>, <u,7,1,0>
- 2727556249U, // <0,u,7,2>: Cost 3 vsldoi8 <7,2,0,u>, <7,2,0,u>
- 2303656092U, // <0,u,7,3>: Cost 3 vmrglw <3,6,0,7>, LHS
- 2785827112U, // <0,u,7,4>: Cost 3 vsldoi12 <5,6,7,0>, <u,7,4,5>
- 2785827122U, // <0,u,7,5>: Cost 3 vsldoi12 <5,6,7,0>, <u,7,5,6>
- 2730210781U, // <0,u,7,6>: Cost 3 vsldoi8 <7,6,0,u>, <7,6,0,u>
- 2303659336U, // <0,u,7,7>: Cost 3 vmrglw <3,6,0,7>, RHS
- 2303656097U, // <0,u,7,u>: Cost 3 vmrglw <3,6,0,7>, LHS
- 202162278U, // <0,u,u,0>: Cost 1 vspltisw0 LHS
- 72595246U, // <0,u,u,1>: Cost 1 vmrghw LHS, LHS
- 1146337160U, // <0,u,u,2>: Cost 2 vmrghw LHS, <u,2,3,3>
- 835584U, // <0,u,u,3>: Cost 0 copy LHS
- 1146337343U, // <0,u,u,4>: Cost 2 vmrghw LHS, <u,4,5,6>
- 72595610U, // <0,u,u,5>: Cost 1 vmrghw LHS, RHS
- 1146337488U, // <0,u,u,6>: Cost 2 vmrghw LHS, <u,6,3,7>
- 1221963080U, // <0,u,u,7>: Cost 2 vmrglw <2,3,0,u>, RHS
- 835584U, // <0,u,u,u>: Cost 0 copy LHS
- 2756853760U, // <1,0,0,0>: Cost 3 vsldoi12 <0,u,1,1>, <0,0,0,0>
- 1677803530U, // <1,0,0,1>: Cost 2 vsldoi12 <0,0,1,1>, <0,0,1,1>
- 3759497387U, // <1,0,0,2>: Cost 4 vsldoi8 <0,2,1,0>, <0,2,1,0>
- 2686419196U, // <1,0,0,3>: Cost 3 vsldoi8 <0,3,1,0>, <0,3,1,0>
- 2751766565U, // <1,0,0,4>: Cost 3 vsldoi12 <0,0,4,1>, <0,0,4,1>
- 2687746462U, // <1,0,0,5>: Cost 3 vsldoi8 <0,5,1,0>, <0,5,1,0>
- 3776086518U, // <1,0,0,6>: Cost 4 vsldoi8 <3,0,1,0>, <0,6,1,7>
- 2689073728U, // <1,0,0,7>: Cost 3 vsldoi8 <0,7,1,0>, <0,7,1,0>
- 1678319689U, // <1,0,0,u>: Cost 2 vsldoi12 <0,0,u,1>, <0,0,u,1>
- 2287091712U, // <1,0,1,0>: Cost 3 vmrglw <0,u,1,1>, <0,0,0,0>
- 1147568230U, // <1,0,1,1>: Cost 2 vmrghw <1,1,1,1>, LHS
- 1683112038U, // <1,0,1,2>: Cost 2 vsldoi12 <0,u,1,1>, LHS
- 3294970108U, // <1,0,1,3>: Cost 4 vmrghw <1,1,0,0>, <0,3,1,0>
- 2623892790U, // <1,0,1,4>: Cost 3 vsldoi4 <1,1,0,1>, RHS
- 2647781007U, // <1,0,1,5>: Cost 3 vsldoi4 <5,1,0,1>, <5,1,0,1>
- 2791948430U, // <1,0,1,6>: Cost 3 vsldoi12 <6,7,0,1>, <0,1,6,7>
- 3721524218U, // <1,0,1,7>: Cost 4 vsldoi4 <5,1,0,1>, <7,0,1,2>
- 1683112092U, // <1,0,1,u>: Cost 2 vsldoi12 <0,u,1,1>, LHS
- 2222112768U, // <1,0,2,0>: Cost 3 vmrghw <1,2,3,0>, <0,0,0,0>
- 1148371046U, // <1,0,2,1>: Cost 2 vmrghw <1,2,3,0>, LHS
- 3356862524U, // <1,0,2,2>: Cost 4 vmrglw <0,2,1,2>, <2,u,0,2>
- 2702345894U, // <1,0,2,3>: Cost 3 vsldoi8 <3,0,1,0>, <2,3,0,1>
- 2222113106U, // <1,0,2,4>: Cost 3 vmrghw <1,2,3,0>, <0,4,1,5>
- 2299709908U, // <1,0,2,5>: Cost 3 vmrglw <3,0,1,2>, <3,4,0,5>
- 3760162746U, // <1,0,2,6>: Cost 4 vsldoi8 <0,3,1,0>, <2,6,3,7>
- 3369470584U, // <1,0,2,7>: Cost 4 vmrglw <2,3,1,2>, <3,6,0,7>
- 1148371613U, // <1,0,2,u>: Cost 2 vmrghw <1,2,3,0>, LHS
- 2686421142U, // <1,0,3,0>: Cost 3 vsldoi8 <0,3,1,0>, <3,0,1,2>
- 2283128486U, // <1,0,3,1>: Cost 3 vmrglw <0,2,1,3>, <2,3,0,1>
- 3296305326U, // <1,0,3,2>: Cost 4 vmrghw <1,3,0,1>, <0,2,1,3>
- 3760163199U, // <1,0,3,3>: Cost 4 vsldoi8 <0,3,1,0>, <3,3,0,1>
- 3760163330U, // <1,0,3,4>: Cost 4 vsldoi8 <0,3,1,0>, <3,4,5,6>
- 3779406377U, // <1,0,3,5>: Cost 4 vsldoi8 <3,5,1,0>, <3,5,1,0>
- 3865690416U, // <1,0,3,6>: Cost 4 vsldoi12 <6,7,0,1>, <0,3,6,7>
- 3366824568U, // <1,0,3,7>: Cost 5 vmrglw <1,u,1,3>, <3,6,0,7>
- 2707655452U, // <1,0,3,u>: Cost 3 vsldoi8 <3,u,1,0>, <3,u,1,0>
- 2734861202U, // <1,0,4,0>: Cost 3 vsldoi8 <u,4,1,0>, <4,0,5,1>
- 2756854098U, // <1,0,4,1>: Cost 3 vsldoi12 <0,u,1,1>, <0,4,1,5>
- 3830595931U, // <1,0,4,2>: Cost 5 vsldoi12 <0,u,1,1>, <0,4,2,5>
- 3296968960U, // <1,0,4,3>: Cost 4 vmrghw <1,4,0,1>, <0,3,1,4>
- 3830595949U, // <1,0,4,4>: Cost 4 vsldoi12 <0,u,1,1>, <0,4,4,5>
- 2686422326U, // <1,0,4,5>: Cost 3 vsldoi8 <0,3,1,0>, RHS
- 3297378806U, // <1,0,4,6>: Cost 5 vmrghw <1,4,5,6>, <0,6,1,7>
- 3810594248U, // <1,0,4,7>: Cost 4 vsldoi8 <u,7,1,0>, <4,7,5,0>
- 2686422569U, // <1,0,4,u>: Cost 3 vsldoi8 <0,3,1,0>, RHS
- 2284470272U, // <1,0,5,0>: Cost 3 vmrglw <0,4,1,5>, <0,0,0,0>
- 2284471974U, // <1,0,5,1>: Cost 3 vmrglw <0,4,1,5>, <2,3,0,1>
- 3809267435U, // <1,0,5,2>: Cost 4 vsldoi8 <u,5,1,0>, <5,2,1,3>
- 3297968384U, // <1,0,5,3>: Cost 4 vmrghw <1,5,4,6>, <0,3,1,4>
- 2284471977U, // <1,0,5,4>: Cost 3 vmrglw <0,4,1,5>, <2,3,0,4>
- 3721555603U, // <1,0,5,5>: Cost 4 vsldoi4 <5,1,0,5>, <5,1,0,5>
- 3792679010U, // <1,0,5,6>: Cost 4 vsldoi8 <5,7,1,0>, <5,6,7,0>
- 3792679037U, // <1,0,5,7>: Cost 4 vsldoi8 <5,7,1,0>, <5,7,1,0>
- 2284471981U, // <1,0,5,u>: Cost 3 vmrglw <0,4,1,5>, <2,3,0,u>
- 3356893184U, // <1,0,6,0>: Cost 4 vmrglw <0,2,1,6>, <0,0,0,0>
- 2224676966U, // <1,0,6,1>: Cost 3 vmrghw <1,6,1,7>, LHS
- 3298295985U, // <1,0,6,2>: Cost 4 vmrghw <1,6,0,1>, <0,2,1,6>
- 3298345212U, // <1,0,6,3>: Cost 4 vmrghw <1,6,0,7>, <0,3,1,0>
- 2224972114U, // <1,0,6,4>: Cost 3 vmrghw <1,6,5,7>, <0,4,1,5>
- 3808604907U, // <1,0,6,5>: Cost 4 vsldoi8 <u,4,1,0>, <6,5,7,1>
- 3799978808U, // <1,0,6,6>: Cost 4 vsldoi8 <7,0,1,0>, <6,6,6,6>
- 2726237006U, // <1,0,6,7>: Cost 3 vsldoi8 <7,0,1,0>, <6,7,0,1>
- 2224677522U, // <1,0,6,u>: Cost 3 vmrghw <1,6,1,7>, <0,u,1,1>
- 2726237176U, // <1,0,7,0>: Cost 3 vsldoi8 <7,0,1,0>, <7,0,1,0>
- 2285815462U, // <1,0,7,1>: Cost 3 vmrglw <0,6,1,7>, <2,3,0,1>
- 3805951193U, // <1,0,7,2>: Cost 4 vsldoi8 <u,0,1,0>, <7,2,u,0>
- 3807941859U, // <1,0,7,3>: Cost 4 vsldoi8 <u,3,1,0>, <7,3,0,1>
- 3799979366U, // <1,0,7,4>: Cost 4 vsldoi8 <7,0,1,0>, <7,4,5,6>
- 3803297165U, // <1,0,7,5>: Cost 4 vsldoi8 <7,5,1,0>, <7,5,1,0>
- 3799979540U, // <1,0,7,6>: Cost 4 vsldoi8 <7,0,1,0>, <7,6,7,0>
- 3799979628U, // <1,0,7,7>: Cost 4 vsldoi8 <7,0,1,0>, <7,7,7,7>
- 2731546240U, // <1,0,7,u>: Cost 3 vsldoi8 <7,u,1,0>, <7,u,1,0>
- 2284494848U, // <1,0,u,0>: Cost 3 vmrglw <0,4,1,u>, <0,0,0,0>
- 1683112594U, // <1,0,u,1>: Cost 2 vsldoi12 <0,u,1,1>, <0,u,1,1>
- 1683112605U, // <1,0,u,2>: Cost 2 vsldoi12 <0,u,1,1>, LHS
- 2734200772U, // <1,0,u,3>: Cost 3 vsldoi8 <u,3,1,0>, <u,3,1,0>
- 2757075629U, // <1,0,u,4>: Cost 3 vsldoi12 <0,u,4,1>, <0,u,4,1>
- 2686425242U, // <1,0,u,5>: Cost 3 vsldoi8 <0,3,1,0>, RHS
- 2791948430U, // <1,0,u,6>: Cost 3 vsldoi12 <6,7,0,1>, <0,1,6,7>
- 2736855304U, // <1,0,u,7>: Cost 3 vsldoi8 <u,7,1,0>, <u,7,1,0>
- 1683112659U, // <1,0,u,u>: Cost 2 vsldoi12 <0,u,1,1>, LHS
- 1610694666U, // <1,1,0,0>: Cost 2 vsldoi8 <0,0,1,1>, <0,0,1,1>
- 1616003174U, // <1,1,0,1>: Cost 2 vsldoi8 <0,u,1,1>, LHS
- 2283767958U, // <1,1,0,2>: Cost 3 vmrglw <0,3,1,0>, <3,0,1,2>
- 3357507596U, // <1,1,0,3>: Cost 4 vmrglw <0,3,1,0>, <0,0,1,3>
- 2689745234U, // <1,1,0,4>: Cost 3 vsldoi8 <0,u,1,1>, <0,4,1,5>
- 3357507922U, // <1,1,0,5>: Cost 4 vmrglw <0,3,1,0>, <0,4,1,5>
- 3294397647U, // <1,1,0,6>: Cost 4 vmrghw <1,0,1,2>, <1,6,1,7>
- 3373433334U, // <1,1,0,7>: Cost 4 vmrglw <3,0,1,0>, <0,6,1,7>
- 1616003730U, // <1,1,0,u>: Cost 2 vsldoi8 <0,u,1,1>, <0,u,1,1>
- 1550221414U, // <1,1,1,0>: Cost 2 vsldoi4 <1,1,1,1>, LHS
- 269271142U, // <1,1,1,1>: Cost 1 vspltisw1 LHS
- 2287093910U, // <1,1,1,2>: Cost 3 vmrglw <0,u,1,1>, <3,0,1,2>
- 2287092615U, // <1,1,1,3>: Cost 3 vmrglw <0,u,1,1>, <1,2,1,3>
- 1550224694U, // <1,1,1,4>: Cost 2 vsldoi4 <1,1,1,1>, RHS
- 2287092050U, // <1,1,1,5>: Cost 3 vmrglw <0,u,1,1>, <0,4,1,5>
- 2689746127U, // <1,1,1,6>: Cost 3 vsldoi8 <0,u,1,1>, <1,6,1,7>
- 2659800138U, // <1,1,1,7>: Cost 3 vsldoi4 <7,1,1,1>, <7,1,1,1>
- 269271142U, // <1,1,1,u>: Cost 1 vspltisw1 LHS
- 2222113516U, // <1,1,2,0>: Cost 3 vmrghw <1,2,3,0>, <1,0,2,1>
- 2756854663U, // <1,1,2,1>: Cost 3 vsldoi12 <0,u,1,1>, <1,2,1,3>
- 1148371862U, // <1,1,2,2>: Cost 2 vmrghw <1,2,3,0>, <1,2,3,0>
- 2689746598U, // <1,1,2,3>: Cost 3 vsldoi8 <0,u,1,1>, <2,3,0,1>
- 2618002742U, // <1,1,2,4>: Cost 3 vsldoi4 <0,1,1,2>, RHS
- 2299707730U, // <1,1,2,5>: Cost 3 vmrglw <3,0,1,2>, <0,4,1,5>
- 2689746874U, // <1,1,2,6>: Cost 3 vsldoi8 <0,u,1,1>, <2,6,3,7>
- 3361506511U, // <1,1,2,7>: Cost 4 vmrglw <1,0,1,2>, <1,6,1,7>
- 1148371862U, // <1,1,2,u>: Cost 2 vmrghw <1,2,3,0>, <1,2,3,0>
- 2689747094U, // <1,1,3,0>: Cost 3 vsldoi8 <0,u,1,1>, <3,0,1,2>
- 2691074278U, // <1,1,3,1>: Cost 3 vsldoi8 <1,1,1,1>, <3,1,1,1>
- 3356870806U, // <1,1,3,2>: Cost 4 vmrglw <0,2,1,3>, <3,0,1,2>
- 2283126958U, // <1,1,3,3>: Cost 3 vmrglw <0,2,1,3>, <0,2,1,3>
- 2689747458U, // <1,1,3,4>: Cost 3 vsldoi8 <0,u,1,1>, <3,4,5,6>
- 3356868946U, // <1,1,3,5>: Cost 4 vmrglw <0,2,1,3>, <0,4,1,5>
- 3811265144U, // <1,1,3,6>: Cost 4 vsldoi8 <u,u,1,1>, <3,6,0,7>
- 3362841807U, // <1,1,3,7>: Cost 4 vmrglw <1,2,1,3>, <1,6,1,7>
- 2689747742U, // <1,1,3,u>: Cost 3 vsldoi8 <0,u,1,1>, <3,u,1,2>
- 2623987814U, // <1,1,4,0>: Cost 3 vsldoi4 <1,1,1,4>, LHS
- 2758181931U, // <1,1,4,1>: Cost 3 vsldoi12 <1,1,1,1>, <1,4,1,5>
- 2223408022U, // <1,1,4,2>: Cost 3 vmrghw <1,4,2,5>, <1,2,3,0>
- 3697731734U, // <1,1,4,3>: Cost 4 vsldoi4 <1,1,1,4>, <3,0,1,2>
- 2283798784U, // <1,1,4,4>: Cost 3 vmrglw <0,3,1,4>, <0,3,1,4>
- 1616006454U, // <1,1,4,5>: Cost 2 vsldoi8 <0,u,1,1>, RHS
- 3297379535U, // <1,1,4,6>: Cost 4 vmrghw <1,4,5,6>, <1,6,1,7>
- 3373466102U, // <1,1,4,7>: Cost 4 vmrglw <3,0,1,4>, <0,6,1,7>
- 1616006697U, // <1,1,4,u>: Cost 2 vsldoi8 <0,u,1,1>, RHS
- 2760762479U, // <1,1,5,0>: Cost 3 vsldoi12 <1,5,0,1>, <1,5,0,1>
- 2284470282U, // <1,1,5,1>: Cost 3 vmrglw <0,4,1,5>, <0,0,1,1>
- 2284472470U, // <1,1,5,2>: Cost 3 vmrglw <0,4,1,5>, <3,0,1,2>
- 3358212270U, // <1,1,5,3>: Cost 4 vmrglw <0,4,1,5>, <0,2,1,3>
- 2284470285U, // <1,1,5,4>: Cost 3 vmrglw <0,4,1,5>, <0,0,1,4>
- 1210728786U, // <1,1,5,5>: Cost 2 vmrglw <0,4,1,5>, <0,4,1,5>
- 2737524834U, // <1,1,5,6>: Cost 3 vsldoi8 <u,u,1,1>, <5,6,7,0>
- 3360867535U, // <1,1,5,7>: Cost 4 vmrglw <0,u,1,5>, <1,6,1,7>
- 1210728786U, // <1,1,5,u>: Cost 2 vmrglw <0,4,1,5>, <0,4,1,5>
- 3697746022U, // <1,1,6,0>: Cost 4 vsldoi4 <1,1,1,6>, LHS
- 2756854991U, // <1,1,6,1>: Cost 3 vsldoi12 <0,u,1,1>, <1,6,1,7>
- 2737525242U, // <1,1,6,2>: Cost 3 vsldoi8 <u,u,1,1>, <6,2,7,3>
- 3839149281U, // <1,1,6,3>: Cost 4 vsldoi12 <2,3,0,1>, <1,6,3,7>
- 3697749302U, // <1,1,6,4>: Cost 4 vsldoi4 <1,1,1,6>, RHS
- 3356893522U, // <1,1,6,5>: Cost 4 vmrglw <0,2,1,6>, <0,4,1,5>
- 2283151537U, // <1,1,6,6>: Cost 3 vmrglw <0,2,1,6>, <0,2,1,6>
- 2791949566U, // <1,1,6,7>: Cost 3 vsldoi12 <6,7,0,1>, <1,6,7,0>
- 2792613127U, // <1,1,6,u>: Cost 3 vsldoi12 <6,u,0,1>, <1,6,u,0>
- 2737525754U, // <1,1,7,0>: Cost 3 vsldoi8 <u,u,1,1>, <7,0,1,2>
- 2291786386U, // <1,1,7,1>: Cost 3 vmrglw <1,6,1,7>, <0,u,1,1>
- 3365528292U, // <1,1,7,2>: Cost 4 vmrglw <1,6,1,7>, <1,0,1,2>
- 3365528455U, // <1,1,7,3>: Cost 4 vmrglw <1,6,1,7>, <1,2,1,3>
- 2737526118U, // <1,1,7,4>: Cost 3 vsldoi8 <u,u,1,1>, <7,4,5,6>
- 3365527890U, // <1,1,7,5>: Cost 4 vmrglw <1,6,1,7>, <0,4,1,5>
- 3365528377U, // <1,1,7,6>: Cost 4 vmrglw <1,6,1,7>, <1,1,1,6>
- 2291786959U, // <1,1,7,7>: Cost 3 vmrglw <1,6,1,7>, <1,6,1,7>
- 2737526402U, // <1,1,7,u>: Cost 3 vsldoi8 <u,u,1,1>, <7,u,1,2>
- 1550221414U, // <1,1,u,0>: Cost 2 vsldoi4 <1,1,1,1>, LHS
- 269271142U, // <1,1,u,1>: Cost 1 vspltisw1 LHS
- 1148371862U, // <1,1,u,2>: Cost 2 vmrghw <1,2,3,0>, <1,2,3,0>
- 2689750972U, // <1,1,u,3>: Cost 3 vsldoi8 <0,u,1,1>, <u,3,0,1>
- 1550224694U, // <1,1,u,4>: Cost 2 vsldoi4 <1,1,1,1>, RHS
- 1616009370U, // <1,1,u,5>: Cost 2 vsldoi8 <0,u,1,1>, RHS
- 2689751248U, // <1,1,u,6>: Cost 3 vsldoi8 <0,u,1,1>, <u,6,3,7>
- 2736863497U, // <1,1,u,7>: Cost 3 vsldoi8 <u,7,1,1>, <u,7,1,1>
- 269271142U, // <1,1,u,u>: Cost 1 vspltisw1 LHS
- 2702360576U, // <1,2,0,0>: Cost 3 vsldoi8 <3,0,1,2>, <0,0,0,0>
- 1628618854U, // <1,2,0,1>: Cost 2 vsldoi8 <3,0,1,2>, LHS
- 2685771949U, // <1,2,0,2>: Cost 3 vsldoi8 <0,2,1,2>, <0,2,1,2>
- 2283765862U, // <1,2,0,3>: Cost 3 vmrglw <0,3,1,0>, LHS
- 2702360914U, // <1,2,0,4>: Cost 3 vsldoi8 <3,0,1,2>, <0,4,1,5>
- 3788046813U, // <1,2,0,5>: Cost 4 vsldoi8 <5,0,1,2>, <0,5,u,0>
- 2688426481U, // <1,2,0,6>: Cost 3 vsldoi8 <0,6,1,2>, <0,6,1,2>
- 2726249024U, // <1,2,0,7>: Cost 3 vsldoi8 <7,0,1,2>, <0,7,1,0>
- 1628619421U, // <1,2,0,u>: Cost 2 vsldoi8 <3,0,1,2>, LHS
- 2690417380U, // <1,2,1,0>: Cost 3 vsldoi8 <1,0,1,2>, <1,0,1,2>
- 2702361396U, // <1,2,1,1>: Cost 3 vsldoi8 <3,0,1,2>, <1,1,1,1>
- 2287093352U, // <1,2,1,2>: Cost 3 vmrglw <0,u,1,1>, <2,2,2,2>
- 1213349990U, // <1,2,1,3>: Cost 2 vmrglw <0,u,1,1>, LHS
- 3764159522U, // <1,2,1,4>: Cost 4 vsldoi8 <1,0,1,2>, <1,4,0,5>
- 3295053672U, // <1,2,1,5>: Cost 4 vmrghw <1,1,1,1>, <2,5,3,6>
- 2221311930U, // <1,2,1,6>: Cost 3 vmrghw <1,1,1,1>, <2,6,3,7>
- 3799991593U, // <1,2,1,7>: Cost 4 vsldoi8 <7,0,1,2>, <1,7,2,7>
- 1213349995U, // <1,2,1,u>: Cost 2 vmrglw <0,u,1,1>, LHS
- 2624045158U, // <1,2,2,0>: Cost 3 vsldoi4 <1,1,2,2>, LHS
- 2702362144U, // <1,2,2,1>: Cost 3 vsldoi8 <3,0,1,2>, <2,1,3,2>
- 2283120232U, // <1,2,2,2>: Cost 3 vmrglw <0,2,1,2>, <2,2,2,2>
- 1225965670U, // <1,2,2,3>: Cost 2 vmrglw <3,0,1,2>, LHS
- 2624048438U, // <1,2,2,4>: Cost 3 vsldoi4 <1,1,2,2>, RHS
- 3356860763U, // <1,2,2,5>: Cost 4 vmrglw <0,2,1,2>, <0,4,2,5>
- 2222114746U, // <1,2,2,6>: Cost 3 vmrghw <1,2,3,0>, <2,6,3,7>
- 2299708632U, // <1,2,2,7>: Cost 3 vmrglw <3,0,1,2>, <1,6,2,7>
- 1225965675U, // <1,2,2,u>: Cost 2 vmrglw <3,0,1,2>, LHS
- 470597734U, // <1,2,3,0>: Cost 1 vsldoi4 LHS, LHS
- 1544340276U, // <1,2,3,1>: Cost 2 vsldoi4 LHS, <1,1,1,1>
- 1544341096U, // <1,2,3,2>: Cost 2 vsldoi4 LHS, <2,2,2,2>
- 1544341916U, // <1,2,3,3>: Cost 2 vsldoi4 LHS, <3,3,3,3>
- 470601014U, // <1,2,3,4>: Cost 1 vsldoi4 LHS, RHS
- 1592119300U, // <1,2,3,5>: Cost 2 vsldoi4 LHS, <5,5,5,5>
- 1592119802U, // <1,2,3,6>: Cost 2 vsldoi4 LHS, <6,2,7,3>
- 1592120314U, // <1,2,3,7>: Cost 2 vsldoi4 LHS, <7,0,1,2>
- 470603566U, // <1,2,3,u>: Cost 1 vsldoi4 LHS, LHS
- 2708335471U, // <1,2,4,0>: Cost 3 vsldoi8 <4,0,1,2>, <4,0,1,2>
- 3838043908U, // <1,2,4,1>: Cost 4 vsldoi12 <2,1,3,1>, <2,4,1,5>
- 3357541992U, // <1,2,4,2>: Cost 4 vmrglw <0,3,1,4>, <2,2,2,2>
- 2283798630U, // <1,2,4,3>: Cost 3 vmrglw <0,3,1,4>, LHS
- 2726251728U, // <1,2,4,4>: Cost 3 vsldoi8 <7,0,1,2>, <4,4,4,4>
- 1628622134U, // <1,2,4,5>: Cost 2 vsldoi8 <3,0,1,2>, RHS
- 3297077178U, // <1,2,4,6>: Cost 4 vmrghw <1,4,1,5>, <2,6,3,7>
- 2726251976U, // <1,2,4,7>: Cost 3 vsldoi8 <7,0,1,2>, <4,7,5,0>
- 1628622377U, // <1,2,4,u>: Cost 2 vsldoi8 <3,0,1,2>, RHS
- 2714308168U, // <1,2,5,0>: Cost 3 vsldoi8 <5,0,1,2>, <5,0,1,2>
- 3297633827U, // <1,2,5,1>: Cost 4 vmrghw <1,5,0,1>, <2,1,3,5>
- 2284471912U, // <1,2,5,2>: Cost 3 vmrglw <0,4,1,5>, <2,2,2,2>
- 1210728550U, // <1,2,5,3>: Cost 2 vmrglw <0,4,1,5>, LHS
- 3776106420U, // <1,2,5,4>: Cost 4 vsldoi8 <3,0,1,2>, <5,4,5,6>
- 2726252548U, // <1,2,5,5>: Cost 3 vsldoi8 <7,0,1,2>, <5,5,5,5>
- 2726252642U, // <1,2,5,6>: Cost 3 vsldoi8 <7,0,1,2>, <5,6,7,0>
- 3799994538U, // <1,2,5,7>: Cost 4 vsldoi8 <7,0,1,2>, <5,7,6,0>
- 1210728555U, // <1,2,5,u>: Cost 2 vmrglw <0,4,1,5>, LHS
- 2720280865U, // <1,2,6,0>: Cost 3 vsldoi8 <6,0,1,2>, <6,0,1,2>
- 2702365096U, // <1,2,6,1>: Cost 3 vsldoi8 <3,0,1,2>, <6,1,7,2>
- 2726253050U, // <1,2,6,2>: Cost 3 vsldoi8 <7,0,1,2>, <6,2,7,3>
- 2283151462U, // <1,2,6,3>: Cost 3 vmrglw <0,2,1,6>, LHS
- 3697823030U, // <1,2,6,4>: Cost 4 vsldoi4 <1,1,2,6>, RHS
- 3298715497U, // <1,2,6,5>: Cost 4 vmrghw <1,6,5,7>, <2,5,3,7>
- 2726253368U, // <1,2,6,6>: Cost 3 vsldoi8 <7,0,1,2>, <6,6,6,6>
- 2724926296U, // <1,2,6,7>: Cost 3 vsldoi8 <6,7,1,2>, <6,7,1,2>
- 2283151467U, // <1,2,6,u>: Cost 3 vmrglw <0,2,1,6>, LHS
- 1652511738U, // <1,2,7,0>: Cost 2 vsldoi8 <7,0,1,2>, <7,0,1,2>
- 3371500916U, // <1,2,7,1>: Cost 4 vmrglw <2,6,1,7>, <1,u,2,1>
- 3365529192U, // <1,2,7,2>: Cost 4 vmrglw <1,6,1,7>, <2,2,2,2>
- 2291785830U, // <1,2,7,3>: Cost 3 vmrglw <1,6,1,7>, LHS
- 2726253926U, // <1,2,7,4>: Cost 3 vsldoi8 <7,0,1,2>, <7,4,5,6>
- 3788051845U, // <1,2,7,5>: Cost 4 vsldoi8 <5,0,1,2>, <7,5,0,1>
- 3794023894U, // <1,2,7,6>: Cost 4 vsldoi8 <6,0,1,2>, <7,6,0,1>
- 2726254119U, // <1,2,7,7>: Cost 3 vsldoi8 <7,0,1,2>, <7,7,0,1>
- 1657820802U, // <1,2,7,u>: Cost 2 vsldoi8 <7,u,1,2>, <7,u,1,2>
- 470638699U, // <1,2,u,0>: Cost 1 vsldoi4 LHS, LHS
- 1544381236U, // <1,2,u,1>: Cost 2 vsldoi4 LHS, <1,1,1,1>
- 1544382056U, // <1,2,u,2>: Cost 2 vsldoi4 LHS, <2,2,2,2>
- 1544382614U, // <1,2,u,3>: Cost 2 vsldoi4 LHS, <3,0,1,2>
- 470641974U, // <1,2,u,4>: Cost 1 vsldoi4 LHS, RHS
- 1628625050U, // <1,2,u,5>: Cost 2 vsldoi8 <3,0,1,2>, RHS
- 1592160762U, // <1,2,u,6>: Cost 2 vsldoi4 LHS, <6,2,7,3>
- 1592161274U, // <1,2,u,7>: Cost 2 vsldoi4 LHS, <7,0,1,2>
- 470644526U, // <1,2,u,u>: Cost 1 vsldoi4 LHS, LHS
- 2769389708U, // <1,3,0,0>: Cost 3 vsldoi12 <3,0,0,1>, <3,0,0,1>
- 2685780070U, // <1,3,0,1>: Cost 3 vsldoi8 <0,2,1,3>, LHS
- 2685780142U, // <1,3,0,2>: Cost 3 vsldoi8 <0,2,1,3>, <0,2,1,3>
- 2686443775U, // <1,3,0,3>: Cost 3 vsldoi8 <0,3,1,3>, <0,3,1,3>
- 2769684656U, // <1,3,0,4>: Cost 3 vsldoi12 <3,0,4,1>, <3,0,4,1>
- 3357507940U, // <1,3,0,5>: Cost 4 vmrglw <0,3,1,0>, <0,4,3,5>
- 3759522294U, // <1,3,0,6>: Cost 4 vsldoi8 <0,2,1,3>, <0,6,1,7>
- 3357509562U, // <1,3,0,7>: Cost 4 vmrglw <0,3,1,0>, <2,6,3,7>
- 2685780637U, // <1,3,0,u>: Cost 3 vsldoi8 <0,2,1,3>, LHS
- 2287092630U, // <1,3,1,0>: Cost 3 vmrglw <0,u,1,1>, <1,2,3,0>
- 2221312230U, // <1,3,1,1>: Cost 3 vmrghw <1,1,1,1>, <3,1,1,1>
- 2691752839U, // <1,3,1,2>: Cost 3 vsldoi8 <1,2,1,3>, <1,2,1,3>
- 2287093362U, // <1,3,1,3>: Cost 3 vmrglw <0,u,1,1>, <2,2,3,3>
- 2287092634U, // <1,3,1,4>: Cost 3 vmrglw <0,u,1,1>, <1,2,3,4>
- 3360835107U, // <1,3,1,5>: Cost 4 vmrglw <0,u,1,1>, <2,1,3,5>
- 3759523041U, // <1,3,1,6>: Cost 4 vsldoi8 <0,2,1,3>, <1,6,3,7>
- 2287093690U, // <1,3,1,7>: Cost 3 vmrglw <0,u,1,1>, <2,6,3,7>
- 2287092638U, // <1,3,1,u>: Cost 3 vmrglw <0,u,1,1>, <1,2,3,u>
- 2222114966U, // <1,3,2,0>: Cost 3 vmrghw <1,2,3,0>, <3,0,1,2>
- 2222115057U, // <1,3,2,1>: Cost 3 vmrghw <1,2,3,0>, <3,1,2,3>
- 2630092320U, // <1,3,2,2>: Cost 3 vsldoi4 <2,1,3,2>, <2,1,3,2>
- 2685781670U, // <1,3,2,3>: Cost 3 vsldoi8 <0,2,1,3>, <2,3,0,1>
- 2222115330U, // <1,3,2,4>: Cost 3 vmrghw <1,2,3,0>, <3,4,5,6>
- 3373449572U, // <1,3,2,5>: Cost 4 vmrglw <3,0,1,2>, <0,4,3,5>
- 2222115448U, // <1,3,2,6>: Cost 3 vmrghw <1,2,3,0>, <3,6,0,7>
- 2299709370U, // <1,3,2,7>: Cost 3 vmrglw <3,0,1,2>, <2,6,3,7>
- 2222115614U, // <1,3,2,u>: Cost 3 vmrghw <1,2,3,0>, <3,u,1,2>
- 2771380607U, // <1,3,3,0>: Cost 3 vsldoi12 <3,3,0,1>, <3,3,0,1>
- 3356874468U, // <1,3,3,1>: Cost 4 vmrglw <0,2,1,3>, <u,0,3,1>
- 3759524168U, // <1,3,3,2>: Cost 4 vsldoi8 <0,2,1,3>, <3,2,3,0>
- 2283792796U, // <1,3,3,3>: Cost 3 vmrglw <0,3,1,3>, <3,3,3,3>
- 3356869530U, // <1,3,3,4>: Cost 4 vmrglw <0,2,1,3>, <1,2,3,4>
- 3721760428U, // <1,3,3,5>: Cost 4 vsldoi4 <5,1,3,3>, <5,1,3,3>
- 3296496248U, // <1,3,3,6>: Cost 4 vmrghw <1,3,2,6>, <3,6,0,7>
- 3356870586U, // <1,3,3,7>: Cost 4 vmrglw <0,2,1,3>, <2,6,3,7>
- 2771970503U, // <1,3,3,u>: Cost 3 vsldoi12 <3,3,u,1>, <3,3,u,1>
- 2772044240U, // <1,3,4,0>: Cost 3 vsldoi12 <3,4,0,1>, <3,4,0,1>
- 3362186135U, // <1,3,4,1>: Cost 4 vmrglw <1,1,1,4>, <1,2,3,1>
- 3297151280U, // <1,3,4,2>: Cost 4 vmrghw <1,4,2,5>, <3,2,0,3>
- 3357542002U, // <1,3,4,3>: Cost 4 vmrglw <0,3,1,4>, <2,2,3,3>
- 3357540626U, // <1,3,4,4>: Cost 4 vmrglw <0,3,1,4>, <0,3,3,4>
- 2685783350U, // <1,3,4,5>: Cost 3 vsldoi8 <0,2,1,3>, RHS
- 3357546622U, // <1,3,4,6>: Cost 4 vmrglw <0,3,1,4>, <u,5,3,6>
- 3357542330U, // <1,3,4,7>: Cost 4 vmrglw <0,3,1,4>, <2,6,3,7>
- 2685783593U, // <1,3,4,u>: Cost 3 vsldoi8 <0,2,1,3>, RHS
- 2284471190U, // <1,3,5,0>: Cost 3 vmrglw <0,4,1,5>, <1,2,3,0>
- 3358213015U, // <1,3,5,1>: Cost 4 vmrglw <0,4,1,5>, <1,2,3,1>
- 2630116899U, // <1,3,5,2>: Cost 3 vsldoi4 <2,1,3,5>, <2,1,3,5>
- 2284471922U, // <1,3,5,3>: Cost 3 vmrglw <0,4,1,5>, <2,2,3,3>
- 2284471194U, // <1,3,5,4>: Cost 3 vmrglw <0,4,1,5>, <1,2,3,4>
- 2284471843U, // <1,3,5,5>: Cost 3 vmrglw <0,4,1,5>, <2,1,3,5>
- 3358218366U, // <1,3,5,6>: Cost 4 vmrglw <0,4,1,5>, <u,5,3,6>
- 2284472250U, // <1,3,5,7>: Cost 3 vmrglw <0,4,1,5>, <2,6,3,7>
- 2284471198U, // <1,3,5,u>: Cost 3 vmrglw <0,4,1,5>, <1,2,3,u>
- 2224752790U, // <1,3,6,0>: Cost 3 vmrghw <1,6,2,7>, <3,0,1,2>
- 3832736385U, // <1,3,6,1>: Cost 4 vsldoi12 <1,2,3,1>, <3,6,1,7>
- 3703866916U, // <1,3,6,2>: Cost 4 vsldoi4 <2,1,3,6>, <2,1,3,6>
- 3356894834U, // <1,3,6,3>: Cost 4 vmrglw <0,2,1,6>, <2,2,3,3>
- 3356894106U, // <1,3,6,4>: Cost 4 vmrglw <0,2,1,6>, <1,2,3,4>
- 3356894755U, // <1,3,6,5>: Cost 5 vmrglw <0,2,1,6>, <2,1,3,5>
- 3356899130U, // <1,3,6,6>: Cost 4 vmrglw <0,2,1,6>, <u,1,3,6>
- 2283153338U, // <1,3,6,7>: Cost 3 vmrglw <0,2,1,6>, <2,6,3,7>
- 2283153338U, // <1,3,6,u>: Cost 3 vmrglw <0,2,1,6>, <2,6,3,7>
- 2774035139U, // <1,3,7,0>: Cost 3 vsldoi12 <3,7,0,1>, <3,7,0,1>
- 3703874767U, // <1,3,7,1>: Cost 4 vsldoi4 <2,1,3,7>, <1,6,1,7>
- 3703875109U, // <1,3,7,2>: Cost 4 vsldoi4 <2,1,3,7>, <2,1,3,7>
- 3365529202U, // <1,3,7,3>: Cost 4 vmrglw <1,6,1,7>, <2,2,3,3>
- 3365528474U, // <1,3,7,4>: Cost 4 vmrglw <1,6,1,7>, <1,2,3,4>
- 3789387159U, // <1,3,7,5>: Cost 4 vsldoi8 <5,2,1,3>, <7,5,2,1>
- 3865692927U, // <1,3,7,6>: Cost 4 vsldoi12 <6,7,0,1>, <3,7,6,7>
- 3363538874U, // <1,3,7,7>: Cost 4 vmrglw <1,3,1,7>, <2,6,3,7>
- 2774625035U, // <1,3,7,u>: Cost 3 vsldoi12 <3,7,u,1>, <3,7,u,1>
- 2284495766U, // <1,3,u,0>: Cost 3 vmrglw <0,4,1,u>, <1,2,3,0>
- 2685785902U, // <1,3,u,1>: Cost 3 vsldoi8 <0,2,1,3>, LHS
- 2630141478U, // <1,3,u,2>: Cost 3 vsldoi4 <2,1,3,u>, <2,1,3,u>
- 2283169880U, // <1,3,u,3>: Cost 3 vmrglw <0,2,1,u>, <2,u,3,3>
- 2284495770U, // <1,3,u,4>: Cost 3 vmrglw <0,4,1,u>, <1,2,3,4>
- 2685786266U, // <1,3,u,5>: Cost 3 vsldoi8 <0,2,1,3>, RHS
- 2222115448U, // <1,3,u,6>: Cost 3 vmrghw <1,2,3,0>, <3,6,0,7>
- 2284496826U, // <1,3,u,7>: Cost 3 vmrglw <0,4,1,u>, <2,6,3,7>
- 2685786469U, // <1,3,u,u>: Cost 3 vsldoi8 <0,2,1,3>, LHS
- 2684461069U, // <1,4,0,0>: Cost 3 vsldoi8 <0,0,1,4>, <0,0,1,4>
- 2686451814U, // <1,4,0,1>: Cost 3 vsldoi8 <0,3,1,4>, LHS
- 3759530159U, // <1,4,0,2>: Cost 4 vsldoi8 <0,2,1,4>, <0,2,1,4>
- 2686451968U, // <1,4,0,3>: Cost 3 vsldoi8 <0,3,1,4>, <0,3,1,4>
- 2684461394U, // <1,4,0,4>: Cost 3 vsldoi8 <0,0,1,4>, <0,4,1,5>
- 1701989266U, // <1,4,0,5>: Cost 2 vsldoi12 <4,0,5,1>, <4,0,5,1>
- 3776119286U, // <1,4,0,6>: Cost 4 vsldoi8 <3,0,1,4>, <0,6,1,7>
- 2689106500U, // <1,4,0,7>: Cost 3 vsldoi8 <0,7,1,4>, <0,7,1,4>
- 1702210477U, // <1,4,0,u>: Cost 2 vsldoi12 <4,0,u,1>, <4,0,u,1>
- 2221312914U, // <1,4,1,0>: Cost 3 vmrghw <1,1,1,1>, <4,0,5,1>
- 2691097399U, // <1,4,1,1>: Cost 3 vsldoi8 <1,1,1,4>, <1,1,1,4>
- 3760194454U, // <1,4,1,2>: Cost 4 vsldoi8 <0,3,1,4>, <1,2,3,0>
- 3766166489U, // <1,4,1,3>: Cost 4 vsldoi8 <1,3,1,4>, <1,3,1,4>
- 2334870736U, // <1,4,1,4>: Cost 3 vmrglw <u,u,1,1>, <4,4,4,4>
- 1147571510U, // <1,4,1,5>: Cost 2 vmrghw <1,1,1,1>, RHS
- 3760194794U, // <1,4,1,6>: Cost 4 vsldoi8 <0,3,1,4>, <1,6,4,7>
- 3867315188U, // <1,4,1,7>: Cost 4 vsldoi12 <7,0,4,1>, <4,1,7,0>
- 1147571753U, // <1,4,1,u>: Cost 2 vmrghw <1,1,1,1>, RHS
- 2222115730U, // <1,4,2,0>: Cost 3 vmrghw <1,2,3,0>, <4,0,5,1>
- 2222115812U, // <1,4,2,1>: Cost 3 vmrghw <1,2,3,0>, <4,1,5,2>
- 3760195176U, // <1,4,2,2>: Cost 4 vsldoi8 <0,3,1,4>, <2,2,2,2>
- 2702378662U, // <1,4,2,3>: Cost 3 vsldoi8 <3,0,1,4>, <2,3,0,1>
- 2323598544U, // <1,4,2,4>: Cost 3 vmrglw <7,0,1,2>, <4,4,4,4>
- 1148374326U, // <1,4,2,5>: Cost 2 vmrghw <1,2,3,0>, RHS
- 3760195514U, // <1,4,2,6>: Cost 4 vsldoi8 <0,3,1,4>, <2,6,3,7>
- 3373451932U, // <1,4,2,7>: Cost 4 vmrglw <3,0,1,2>, <3,6,4,7>
- 1148374569U, // <1,4,2,u>: Cost 2 vmrghw <1,2,3,0>, RHS
- 2702379160U, // <1,4,3,0>: Cost 3 vsldoi8 <3,0,1,4>, <3,0,1,4>
- 3760195840U, // <1,4,3,1>: Cost 4 vsldoi8 <0,3,1,4>, <3,1,4,0>
- 3776121160U, // <1,4,3,2>: Cost 4 vsldoi8 <3,0,1,4>, <3,2,3,0>
- 3760195996U, // <1,4,3,3>: Cost 4 vsldoi8 <0,3,1,4>, <3,3,3,3>
- 2686454274U, // <1,4,3,4>: Cost 3 vsldoi8 <0,3,1,4>, <3,4,5,6>
- 3356870350U, // <1,4,3,5>: Cost 4 vmrglw <0,2,1,3>, <2,3,4,5>
- 3800009392U, // <1,4,3,6>: Cost 4 vsldoi8 <7,0,1,4>, <3,6,7,0>
- 3366824604U, // <1,4,3,7>: Cost 5 vmrglw <1,u,1,3>, <3,6,4,7>
- 2707688224U, // <1,4,3,u>: Cost 3 vsldoi8 <3,u,1,4>, <3,u,1,4>
- 2775731368U, // <1,4,4,0>: Cost 3 vsldoi12 <4,0,5,1>, <4,4,0,0>
- 3830820018U, // <1,4,4,1>: Cost 4 vsldoi12 <0,u,4,1>, <4,4,1,1>
- 3691980454U, // <1,4,4,2>: Cost 4 vsldoi4 <0,1,4,4>, <2,3,0,1>
- 3357541282U, // <1,4,4,3>: Cost 4 vmrglw <0,3,1,4>, <1,2,4,3>
- 2781039824U, // <1,4,4,4>: Cost 3 vsldoi12 <4,u,5,1>, <4,4,4,4>
- 2686455094U, // <1,4,4,5>: Cost 3 vsldoi8 <0,3,1,4>, RHS
- 3357541528U, // <1,4,4,6>: Cost 4 vmrglw <0,3,1,4>, <1,5,4,6>
- 3810627020U, // <1,4,4,7>: Cost 4 vsldoi8 <u,7,1,4>, <4,7,5,4>
- 2686455337U, // <1,4,4,u>: Cost 3 vsldoi8 <0,3,1,4>, RHS
- 2624217190U, // <1,4,5,0>: Cost 3 vsldoi4 <1,1,4,5>, LHS
- 2284470309U, // <1,4,5,1>: Cost 3 vmrglw <0,4,1,5>, <0,0,4,1>
- 2618246822U, // <1,4,5,2>: Cost 3 vsldoi4 <0,1,4,5>, <2,3,0,1>
- 3358212297U, // <1,4,5,3>: Cost 4 vmrglw <0,4,1,5>, <0,2,4,3>
- 2284470312U, // <1,4,5,4>: Cost 3 vmrglw <0,4,1,5>, <0,0,4,4>
- 2284470637U, // <1,4,5,5>: Cost 3 vmrglw <0,4,1,5>, <0,4,4,5>
- 1683115318U, // <1,4,5,6>: Cost 2 vsldoi12 <0,u,1,1>, RHS
- 3721851898U, // <1,4,5,7>: Cost 4 vsldoi4 <5,1,4,5>, <7,0,1,2>
- 1683115336U, // <1,4,5,u>: Cost 2 vsldoi12 <0,u,1,1>, RHS
- 3794039075U, // <1,4,6,0>: Cost 4 vsldoi8 <6,0,1,4>, <6,0,1,4>
- 3830820186U, // <1,4,6,1>: Cost 4 vsldoi12 <0,u,4,1>, <4,6,1,7>
- 3800011258U, // <1,4,6,2>: Cost 4 vsldoi8 <7,0,1,4>, <6,2,7,3>
- 3807973938U, // <1,4,6,3>: Cost 4 vsldoi8 <u,3,1,4>, <6,3,4,5>
- 3298716880U, // <1,4,6,4>: Cost 4 vmrghw <1,6,5,7>, <4,4,4,4>
- 2224680246U, // <1,4,6,5>: Cost 3 vmrghw <1,6,1,7>, RHS
- 3800011576U, // <1,4,6,6>: Cost 4 vsldoi8 <7,0,1,4>, <6,6,6,6>
- 2726269774U, // <1,4,6,7>: Cost 3 vsldoi8 <7,0,1,4>, <6,7,0,1>
- 2224680489U, // <1,4,6,u>: Cost 3 vmrghw <1,6,1,7>, RHS
- 2726269948U, // <1,4,7,0>: Cost 3 vsldoi8 <7,0,1,4>, <7,0,1,4>
- 3383444141U, // <1,4,7,1>: Cost 4 vmrglw <4,6,1,7>, <0,u,4,1>
- 3805983961U, // <1,4,7,2>: Cost 4 vsldoi8 <u,0,1,4>, <7,2,u,0>
- 3807974667U, // <1,4,7,3>: Cost 4 vsldoi8 <u,3,1,4>, <7,3,4,5>
- 2736887142U, // <1,4,7,4>: Cost 3 vsldoi8 <u,7,1,4>, <7,4,5,6>
- 3365528403U, // <1,4,7,5>: Cost 4 vmrglw <1,6,1,7>, <1,1,4,5>
- 3800012308U, // <1,4,7,6>: Cost 4 vsldoi8 <7,0,1,4>, <7,6,7,0>
- 3800012396U, // <1,4,7,7>: Cost 4 vsldoi8 <7,0,1,4>, <7,7,7,7>
- 2731579012U, // <1,4,7,u>: Cost 3 vsldoi8 <7,u,1,4>, <7,u,1,4>
- 2624241766U, // <1,4,u,0>: Cost 3 vsldoi4 <1,1,4,u>, LHS
- 2686457646U, // <1,4,u,1>: Cost 3 vsldoi8 <0,3,1,4>, LHS
- 2618271398U, // <1,4,u,2>: Cost 3 vsldoi4 <0,1,4,u>, <2,3,0,1>
- 2734233544U, // <1,4,u,3>: Cost 3 vsldoi8 <u,3,1,4>, <u,3,1,4>
- 2689775679U, // <1,4,u,4>: Cost 3 vsldoi8 <0,u,1,4>, <u,4,5,6>
- 1152355638U, // <1,4,u,5>: Cost 2 vmrghw <1,u,3,0>, RHS
- 1683115561U, // <1,4,u,6>: Cost 2 vsldoi12 <0,u,1,1>, RHS
- 2736888076U, // <1,4,u,7>: Cost 3 vsldoi8 <u,7,1,4>, <u,7,1,4>
- 1683115579U, // <1,4,u,u>: Cost 2 vsldoi12 <0,u,1,1>, RHS
- 2687123456U, // <1,5,0,0>: Cost 3 vsldoi8 <0,4,1,5>, <0,0,0,0>
- 1613381734U, // <1,5,0,1>: Cost 2 vsldoi8 <0,4,1,5>, LHS
- 3759538352U, // <1,5,0,2>: Cost 4 vsldoi8 <0,2,1,5>, <0,2,1,5>
- 3760865532U, // <1,5,0,3>: Cost 4 vsldoi8 <0,4,1,5>, <0,3,1,0>
- 1613381970U, // <1,5,0,4>: Cost 2 vsldoi8 <0,4,1,5>, <0,4,1,5>
- 2687787427U, // <1,5,0,5>: Cost 3 vsldoi8 <0,5,1,5>, <0,5,1,5>
- 2781777524U, // <1,5,0,6>: Cost 3 vsldoi12 <5,0,6,1>, <5,0,6,1>
- 3733828717U, // <1,5,0,7>: Cost 4 vsldoi4 <7,1,5,0>, <7,1,5,0>
- 1613382301U, // <1,5,0,u>: Cost 2 vsldoi8 <0,4,1,5>, LHS
- 2781040271U, // <1,5,1,0>: Cost 3 vsldoi12 <4,u,5,1>, <5,1,0,1>
- 2687124276U, // <1,5,1,1>: Cost 3 vsldoi8 <0,4,1,5>, <1,1,1,1>
- 2687124374U, // <1,5,1,2>: Cost 3 vsldoi8 <0,4,1,5>, <1,2,3,0>
- 3760866297U, // <1,5,1,3>: Cost 4 vsldoi8 <0,4,1,5>, <1,3,5,0>
- 2693096491U, // <1,5,1,4>: Cost 3 vsldoi8 <1,4,1,5>, <1,4,1,5>
- 2687124591U, // <1,5,1,5>: Cost 3 vsldoi8 <0,4,1,5>, <1,5,0,1>
- 2687124723U, // <1,5,1,6>: Cost 3 vsldoi8 <0,4,1,5>, <1,6,5,7>
- 3360834803U, // <1,5,1,7>: Cost 4 vmrglw <0,u,1,1>, <1,6,5,7>
- 2687124860U, // <1,5,1,u>: Cost 3 vsldoi8 <0,4,1,5>, <1,u,3,0>
- 2323598792U, // <1,5,2,0>: Cost 3 vmrglw <7,0,1,2>, <4,7,5,0>
- 2687125027U, // <1,5,2,1>: Cost 3 vsldoi8 <0,4,1,5>, <2,1,3,5>
- 2687125096U, // <1,5,2,2>: Cost 3 vsldoi8 <0,4,1,5>, <2,2,2,2>
- 2687125158U, // <1,5,2,3>: Cost 3 vsldoi8 <0,4,1,5>, <2,3,0,1>
- 2642185188U, // <1,5,2,4>: Cost 3 vsldoi4 <4,1,5,2>, <4,1,5,2>
- 2323598554U, // <1,5,2,5>: Cost 3 vmrglw <7,0,1,2>, <4,4,5,5>
- 2687125434U, // <1,5,2,6>: Cost 3 vsldoi8 <0,4,1,5>, <2,6,3,7>
- 3373450483U, // <1,5,2,7>: Cost 4 vmrglw <3,0,1,2>, <1,6,5,7>
- 2687125563U, // <1,5,2,u>: Cost 3 vsldoi8 <0,4,1,5>, <2,u,0,1>
- 2687125654U, // <1,5,3,0>: Cost 3 vsldoi8 <0,4,1,5>, <3,0,1,2>
- 2312990234U, // <1,5,3,1>: Cost 3 vmrglw <5,2,1,3>, <4,u,5,1>
- 3760867649U, // <1,5,3,2>: Cost 4 vsldoi8 <0,4,1,5>, <3,2,2,2>
- 2687125916U, // <1,5,3,3>: Cost 3 vsldoi8 <0,4,1,5>, <3,3,3,3>
- 2687126018U, // <1,5,3,4>: Cost 3 vsldoi8 <0,4,1,5>, <3,4,5,6>
- 3386731738U, // <1,5,3,5>: Cost 4 vmrglw <5,2,1,3>, <4,4,5,5>
- 3356871170U, // <1,5,3,6>: Cost 4 vmrglw <0,2,1,3>, <3,4,5,6>
- 3808643779U, // <1,5,3,7>: Cost 4 vsldoi8 <u,4,1,5>, <3,7,0,1>
- 2687126302U, // <1,5,3,u>: Cost 3 vsldoi8 <0,4,1,5>, <3,u,1,2>
- 2642198630U, // <1,5,4,0>: Cost 3 vsldoi4 <4,1,5,4>, LHS
- 2687126498U, // <1,5,4,1>: Cost 3 vsldoi8 <0,4,1,5>, <4,1,5,0>
- 3715941923U, // <1,5,4,2>: Cost 4 vsldoi4 <4,1,5,4>, <2,1,3,5>
- 3709970701U, // <1,5,4,3>: Cost 4 vsldoi4 <3,1,5,4>, <3,1,5,4>
- 2687126736U, // <1,5,4,4>: Cost 3 vsldoi8 <0,4,1,5>, <4,4,4,4>
- 1613385014U, // <1,5,4,5>: Cost 2 vsldoi8 <0,4,1,5>, RHS
- 2283801090U, // <1,5,4,6>: Cost 3 vmrglw <0,3,1,4>, <3,4,5,6>
- 3733861489U, // <1,5,4,7>: Cost 4 vsldoi4 <7,1,5,4>, <7,1,5,4>
- 1613385257U, // <1,5,4,u>: Cost 2 vsldoi8 <0,4,1,5>, RHS
- 2624290918U, // <1,5,5,0>: Cost 3 vsldoi4 <1,1,5,5>, LHS
- 2624291676U, // <1,5,5,1>: Cost 3 vsldoi4 <1,1,5,5>, <1,1,5,5>
- 3698034211U, // <1,5,5,2>: Cost 4 vsldoi4 <1,1,5,5>, <2,1,3,5>
- 2284471211U, // <1,5,5,3>: Cost 3 vmrglw <0,4,1,5>, <1,2,5,3>
- 2624294198U, // <1,5,5,4>: Cost 3 vsldoi4 <1,1,5,5>, RHS
- 2284471132U, // <1,5,5,5>: Cost 3 vmrglw <0,4,1,5>, <1,1,5,5>
- 2284472834U, // <1,5,5,6>: Cost 3 vmrglw <0,4,1,5>, <3,4,5,6>
- 2284471539U, // <1,5,5,7>: Cost 3 vmrglw <0,4,1,5>, <1,6,5,7>
- 2284471216U, // <1,5,5,u>: Cost 3 vmrglw <0,4,1,5>, <1,2,5,u>
- 2785316900U, // <1,5,6,0>: Cost 3 vsldoi12 <5,6,0,1>, <5,6,0,1>
- 2781040691U, // <1,5,6,1>: Cost 3 vsldoi12 <4,u,5,1>, <5,6,1,7>
- 2734903802U, // <1,5,6,2>: Cost 3 vsldoi8 <u,4,1,5>, <6,2,7,3>
- 3848736834U, // <1,5,6,3>: Cost 4 vsldoi12 <3,u,4,1>, <5,6,3,4>
- 3298717620U, // <1,5,6,4>: Cost 4 vmrghw <1,6,5,7>, <5,4,5,6>
- 3298717700U, // <1,5,6,5>: Cost 4 vmrghw <1,6,5,7>, <5,5,5,5>
- 2734904120U, // <1,5,6,6>: Cost 3 vsldoi8 <u,4,1,5>, <6,6,6,6>
- 2781040738U, // <1,5,6,7>: Cost 3 vsldoi12 <4,u,5,1>, <5,6,7,0>
- 2781040747U, // <1,5,6,u>: Cost 3 vsldoi12 <4,u,5,1>, <5,6,u,0>
- 2734904314U, // <1,5,7,0>: Cost 3 vsldoi8 <u,4,1,5>, <7,0,1,2>
- 2315677210U, // <1,5,7,1>: Cost 3 vmrglw <5,6,1,7>, <4,u,5,1>
- 3808646292U, // <1,5,7,2>: Cost 4 vsldoi8 <u,4,1,5>, <7,2,0,3>
- 3808646371U, // <1,5,7,3>: Cost 4 vsldoi8 <u,4,1,5>, <7,3,0,1>
- 2734904678U, // <1,5,7,4>: Cost 3 vsldoi8 <u,4,1,5>, <7,4,5,6>
- 3389418714U, // <1,5,7,5>: Cost 4 vmrglw <5,6,1,7>, <4,4,5,5>
- 3365528656U, // <1,5,7,6>: Cost 4 vmrglw <1,6,1,7>, <1,4,5,6>
- 2734904940U, // <1,5,7,7>: Cost 3 vsldoi8 <u,4,1,5>, <7,7,7,7>
- 2734904962U, // <1,5,7,u>: Cost 3 vsldoi8 <u,4,1,5>, <7,u,1,2>
- 2687129299U, // <1,5,u,0>: Cost 3 vsldoi8 <0,4,1,5>, <u,0,1,2>
- 1613387566U, // <1,5,u,1>: Cost 2 vsldoi8 <0,4,1,5>, LHS
- 2687129480U, // <1,5,u,2>: Cost 3 vsldoi8 <0,4,1,5>, <u,2,3,3>
- 2687129532U, // <1,5,u,3>: Cost 3 vsldoi8 <0,4,1,5>, <u,3,0,1>
- 1661163546U, // <1,5,u,4>: Cost 2 vsldoi8 <u,4,1,5>, <u,4,1,5>
- 1613387930U, // <1,5,u,5>: Cost 2 vsldoi8 <0,4,1,5>, RHS
- 2687129808U, // <1,5,u,6>: Cost 3 vsldoi8 <0,4,1,5>, <u,6,3,7>
- 2781040900U, // <1,5,u,7>: Cost 3 vsldoi12 <4,u,5,1>, <5,u,7,0>
- 1613388133U, // <1,5,u,u>: Cost 2 vsldoi8 <0,4,1,5>, LHS
- 3759546368U, // <1,6,0,0>: Cost 4 vsldoi8 <0,2,1,6>, <0,0,0,0>
- 2685804646U, // <1,6,0,1>: Cost 3 vsldoi8 <0,2,1,6>, LHS
- 2685804721U, // <1,6,0,2>: Cost 3 vsldoi8 <0,2,1,6>, <0,2,1,6>
- 3861270834U, // <1,6,0,3>: Cost 4 vsldoi12 <6,0,3,1>, <6,0,3,1>
- 3759546706U, // <1,6,0,4>: Cost 4 vsldoi8 <0,2,1,6>, <0,4,1,5>
- 2687795620U, // <1,6,0,5>: Cost 3 vsldoi8 <0,5,1,6>, <0,5,1,6>
- 2688459253U, // <1,6,0,6>: Cost 3 vsldoi8 <0,6,1,6>, <0,6,1,6>
- 2283769142U, // <1,6,0,7>: Cost 3 vmrglw <0,3,1,0>, RHS
- 2685805213U, // <1,6,0,u>: Cost 3 vsldoi8 <0,2,1,6>, LHS
- 3698073702U, // <1,6,1,0>: Cost 4 vsldoi4 <1,1,6,1>, LHS
- 3759547188U, // <1,6,1,1>: Cost 4 vsldoi8 <0,2,1,6>, <1,1,1,1>
- 2221314554U, // <1,6,1,2>: Cost 3 vmrghw <1,1,1,1>, <6,2,7,3>
- 3759547401U, // <1,6,1,3>: Cost 4 vsldoi8 <0,2,1,6>, <1,3,6,7>
- 3698076982U, // <1,6,1,4>: Cost 4 vsldoi4 <1,1,6,1>, RHS
- 3767510141U, // <1,6,1,5>: Cost 4 vsldoi8 <1,5,1,6>, <1,5,1,6>
- 2334872376U, // <1,6,1,6>: Cost 3 vmrglw <u,u,1,1>, <6,6,6,6>
- 1213353270U, // <1,6,1,7>: Cost 2 vmrglw <0,u,1,1>, RHS
- 1213353271U, // <1,6,1,u>: Cost 2 vmrglw <0,u,1,1>, RHS
- 3704053862U, // <1,6,2,0>: Cost 4 vsldoi4 <2,1,6,2>, LHS
- 3759547961U, // <1,6,2,1>: Cost 4 vsldoi8 <0,2,1,6>, <2,1,6,0>
- 2222117370U, // <1,6,2,2>: Cost 3 vmrghw <1,2,3,0>, <6,2,7,3>
- 3759548070U, // <1,6,2,3>: Cost 4 vsldoi8 <0,2,1,6>, <2,3,0,1>
- 3704057142U, // <1,6,2,4>: Cost 4 vsldoi4 <2,1,6,2>, RHS
- 3373451057U, // <1,6,2,5>: Cost 4 vmrglw <3,0,1,2>, <2,4,6,5>
- 2685806522U, // <1,6,2,6>: Cost 3 vsldoi8 <0,2,1,6>, <2,6,3,7>
- 1225968950U, // <1,6,2,7>: Cost 2 vmrglw <3,0,1,2>, RHS
- 1225968951U, // <1,6,2,u>: Cost 2 vmrglw <3,0,1,2>, RHS
- 3759548566U, // <1,6,3,0>: Cost 4 vsldoi8 <0,2,1,6>, <3,0,1,2>
- 3842912793U, // <1,6,3,1>: Cost 4 vsldoi12 <2,u,6,1>, <6,3,1,7>
- 3759548774U, // <1,6,3,2>: Cost 4 vsldoi8 <0,2,1,6>, <3,2,6,3>
- 3759548828U, // <1,6,3,3>: Cost 4 vsldoi8 <0,2,1,6>, <3,3,3,3>
- 3759548930U, // <1,6,3,4>: Cost 4 vsldoi8 <0,2,1,6>, <3,4,5,6>
- 3809315421U, // <1,6,3,5>: Cost 4 vsldoi8 <u,5,1,6>, <3,5,6,7>
- 3386733368U, // <1,6,3,6>: Cost 4 vmrglw <5,2,1,3>, <6,6,6,6>
- 2283130166U, // <1,6,3,7>: Cost 3 vmrglw <0,2,1,3>, RHS
- 2283130167U, // <1,6,3,u>: Cost 3 vmrglw <0,2,1,3>, RHS
- 3704070246U, // <1,6,4,0>: Cost 4 vsldoi4 <2,1,6,4>, LHS
- 3862229608U, // <1,6,4,1>: Cost 4 vsldoi12 <6,1,7,1>, <6,4,1,5>
- 3704071741U, // <1,6,4,2>: Cost 4 vsldoi4 <2,1,6,4>, <2,1,6,4>
- 3721988610U, // <1,6,4,3>: Cost 4 vsldoi4 <5,1,6,4>, <3,4,5,6>
- 3704073526U, // <1,6,4,4>: Cost 4 vsldoi4 <2,1,6,4>, RHS
- 2685807926U, // <1,6,4,5>: Cost 3 vsldoi8 <0,2,1,6>, RHS
- 3865621141U, // <1,6,4,6>: Cost 4 vsldoi12 <6,6,u,1>, <6,4,6,5>
- 2283801910U, // <1,6,4,7>: Cost 3 vmrglw <0,3,1,4>, RHS
- 2685808169U, // <1,6,4,u>: Cost 3 vsldoi8 <0,2,1,6>, RHS
- 3710050406U, // <1,6,5,0>: Cost 4 vsldoi4 <3,1,6,5>, LHS
- 3710051571U, // <1,6,5,1>: Cost 4 vsldoi4 <3,1,6,5>, <1,6,5,7>
- 3405989597U, // <1,6,5,2>: Cost 4 vmrglw <u,4,1,5>, <2,3,6,2>
- 3358214502U, // <1,6,5,3>: Cost 4 vmrglw <0,4,1,5>, <3,2,6,3>
- 3710053686U, // <1,6,5,4>: Cost 4 vsldoi4 <3,1,6,5>, RHS
- 3721998025U, // <1,6,5,5>: Cost 4 vsldoi4 <5,1,6,5>, <5,1,6,5>
- 2332250936U, // <1,6,5,6>: Cost 3 vmrglw <u,4,1,5>, <6,6,6,6>
- 1210731830U, // <1,6,5,7>: Cost 2 vmrglw <0,4,1,5>, RHS
- 1210731831U, // <1,6,5,u>: Cost 2 vmrglw <0,4,1,5>, RHS
- 2791289597U, // <1,6,6,0>: Cost 3 vsldoi12 <6,6,0,1>, <6,6,0,1>
- 3698115430U, // <1,6,6,1>: Cost 4 vsldoi4 <1,1,6,6>, <1,1,6,6>
- 3698116538U, // <1,6,6,2>: Cost 4 vsldoi4 <1,1,6,6>, <2,6,3,7>
- 3356894132U, // <1,6,6,3>: Cost 4 vmrglw <0,2,1,6>, <1,2,6,3>
- 3698117942U, // <1,6,6,4>: Cost 4 vsldoi4 <1,1,6,6>, RHS
- 3722006218U, // <1,6,6,5>: Cost 4 vsldoi4 <5,1,6,6>, <5,1,6,6>
- 2781041464U, // <1,6,6,6>: Cost 3 vsldoi12 <4,u,5,1>, <6,6,6,6>
- 2283154742U, // <1,6,6,7>: Cost 3 vmrglw <0,2,1,6>, RHS
- 2283154743U, // <1,6,6,u>: Cost 3 vmrglw <0,2,1,6>, RHS
- 1718211406U, // <1,6,7,0>: Cost 2 vsldoi12 <6,7,0,1>, <6,7,0,1>
- 2792026967U, // <1,6,7,1>: Cost 3 vsldoi12 <6,7,1,1>, <6,7,1,1>
- 2765411170U, // <1,6,7,2>: Cost 3 vsldoi12 <2,3,0,1>, <6,7,2,3>
- 3854783336U, // <1,6,7,3>: Cost 4 vsldoi12 <4,u,5,1>, <6,7,3,0>
- 2781041526U, // <1,6,7,4>: Cost 3 vsldoi12 <4,u,5,1>, <6,7,4,5>
- 3365528664U, // <1,6,7,5>: Cost 4 vmrglw <1,6,1,7>, <1,4,6,5>
- 2791953290U, // <1,6,7,6>: Cost 3 vsldoi12 <6,7,0,1>, <6,7,6,7>
- 2291789110U, // <1,6,7,7>: Cost 3 vmrglw <1,6,1,7>, RHS
- 1718801302U, // <1,6,7,u>: Cost 2 vsldoi12 <6,7,u,1>, <6,7,u,1>
- 1718875039U, // <1,6,u,0>: Cost 2 vsldoi12 <6,u,0,1>, <6,u,0,1>
- 2685810478U, // <1,6,u,1>: Cost 3 vsldoi8 <0,2,1,6>, LHS
- 2792764337U, // <1,6,u,2>: Cost 3 vsldoi12 <6,u,2,1>, <6,u,2,1>
- 3759552444U, // <1,6,u,3>: Cost 4 vsldoi8 <0,2,1,6>, <u,3,0,1>
- 2781041607U, // <1,6,u,4>: Cost 3 vsldoi12 <4,u,5,1>, <6,u,4,5>
- 2685810842U, // <1,6,u,5>: Cost 3 vsldoi8 <0,2,1,6>, RHS
- 2689792208U, // <1,6,u,6>: Cost 3 vsldoi8 <0,u,1,6>, <u,6,3,7>
- 1210756406U, // <1,6,u,7>: Cost 2 vmrglw <0,4,1,u>, RHS
- 1210756407U, // <1,6,u,u>: Cost 2 vmrglw <0,4,1,u>, RHS
- 2793280496U, // <1,7,0,0>: Cost 3 vsldoi12 <7,0,0,1>, <7,0,0,1>
- 2694439014U, // <1,7,0,1>: Cost 3 vsldoi8 <1,6,1,7>, LHS
- 3393343912U, // <1,7,0,2>: Cost 4 vmrglw <6,3,1,0>, <6,1,7,2>
- 3397325306U, // <1,7,0,3>: Cost 4 vmrglw <7,0,1,0>, <6,2,7,3>
- 2793575444U, // <1,7,0,4>: Cost 3 vsldoi12 <7,0,4,1>, <7,0,4,1>
- 3722030797U, // <1,7,0,5>: Cost 4 vsldoi4 <5,1,7,0>, <5,1,7,0>
- 2688467446U, // <1,7,0,6>: Cost 3 vsldoi8 <0,6,1,7>, <0,6,1,7>
- 2689131079U, // <1,7,0,7>: Cost 3 vsldoi8 <0,7,1,7>, <0,7,1,7>
- 2694439570U, // <1,7,0,u>: Cost 3 vsldoi8 <1,6,1,7>, <0,u,1,1>
- 2654265354U, // <1,7,1,0>: Cost 3 vsldoi4 <6,1,7,1>, <0,0,1,1>
- 2794017866U, // <1,7,1,1>: Cost 3 vsldoi12 <7,1,1,1>, <7,1,1,1>
- 3768181639U, // <1,7,1,2>: Cost 4 vsldoi8 <1,6,1,7>, <1,2,1,3>
- 2334872058U, // <1,7,1,3>: Cost 3 vmrglw <u,u,1,1>, <6,2,7,3>
- 2654268726U, // <1,7,1,4>: Cost 3 vsldoi4 <6,1,7,1>, RHS
- 3792069797U, // <1,7,1,5>: Cost 4 vsldoi8 <5,6,1,7>, <1,5,6,1>
- 2694440143U, // <1,7,1,6>: Cost 3 vsldoi8 <1,6,1,7>, <1,6,1,7>
- 2334872386U, // <1,7,1,7>: Cost 3 vmrglw <u,u,1,1>, <6,6,7,7>
- 2695767409U, // <1,7,1,u>: Cost 3 vsldoi8 <1,u,1,7>, <1,u,1,7>
- 2654273638U, // <1,7,2,0>: Cost 3 vsldoi4 <6,1,7,2>, LHS
- 2222117973U, // <1,7,2,1>: Cost 3 vmrghw <1,2,3,0>, <7,1,2,3>
- 2299711912U, // <1,7,2,2>: Cost 3 vmrglw <3,0,1,2>, <6,1,7,2>
- 2654275734U, // <1,7,2,3>: Cost 3 vsldoi4 <6,1,7,2>, <3,0,1,2>
- 2654276918U, // <1,7,2,4>: Cost 3 vsldoi4 <6,1,7,2>, RHS
- 3385397675U, // <1,7,2,5>: Cost 4 vmrglw <5,0,1,2>, <6,1,7,5>
- 2654278056U, // <1,7,2,6>: Cost 3 vsldoi4 <6,1,7,2>, <6,1,7,2>
- 2323599627U, // <1,7,2,7>: Cost 3 vmrglw <7,0,1,2>, <5,u,7,7>
- 2654279470U, // <1,7,2,u>: Cost 3 vsldoi4 <6,1,7,2>, LHS
- 2795271395U, // <1,7,3,0>: Cost 3 vsldoi12 <7,3,0,1>, <7,3,0,1>
- 3768183059U, // <1,7,3,1>: Cost 4 vsldoi8 <1,6,1,7>, <3,1,6,1>
- 3728025254U, // <1,7,3,2>: Cost 4 vsldoi4 <6,1,7,3>, <2,3,0,1>
- 3768183196U, // <1,7,3,3>: Cost 4 vsldoi8 <1,6,1,7>, <3,3,3,3>
- 3768183298U, // <1,7,3,4>: Cost 4 vsldoi8 <1,6,1,7>, <3,4,5,6>
- 3792071255U, // <1,7,3,5>: Cost 4 vsldoi8 <5,6,1,7>, <3,5,6,1>
- 3780127361U, // <1,7,3,6>: Cost 4 vsldoi8 <3,6,1,7>, <3,6,1,7>
- 3847779617U, // <1,7,3,7>: Cost 4 vsldoi12 <3,7,0,1>, <7,3,7,0>
- 2795861291U, // <1,7,3,u>: Cost 3 vsldoi12 <7,3,u,1>, <7,3,u,1>
- 2795935028U, // <1,7,4,0>: Cost 3 vsldoi12 <7,4,0,1>, <7,4,0,1>
- 3728032975U, // <1,7,4,1>: Cost 4 vsldoi4 <6,1,7,4>, <1,6,1,7>
- 3839153480U, // <1,7,4,2>: Cost 4 vsldoi12 <2,3,0,1>, <7,4,2,3>
- 3397358074U, // <1,7,4,3>: Cost 4 vmrglw <7,0,1,4>, <6,2,7,3>
- 3854783835U, // <1,7,4,4>: Cost 4 vsldoi12 <4,u,5,1>, <7,4,4,4>
- 2694442294U, // <1,7,4,5>: Cost 3 vsldoi8 <1,6,1,7>, RHS
- 3786100058U, // <1,7,4,6>: Cost 4 vsldoi8 <4,6,1,7>, <4,6,1,7>
- 3722065254U, // <1,7,4,7>: Cost 4 vsldoi4 <5,1,7,4>, <7,4,5,6>
- 2694442537U, // <1,7,4,u>: Cost 3 vsldoi8 <1,6,1,7>, RHS
- 2654298214U, // <1,7,5,0>: Cost 3 vsldoi4 <6,1,7,5>, LHS
- 3854783893U, // <1,7,5,1>: Cost 4 vsldoi12 <4,u,5,1>, <7,5,1,u>
- 3710126010U, // <1,7,5,2>: Cost 4 vsldoi4 <3,1,7,5>, <2,6,3,7>
- 2332250618U, // <1,7,5,3>: Cost 3 vmrglw <u,4,1,5>, <6,2,7,3>
- 2654301494U, // <1,7,5,4>: Cost 3 vsldoi4 <6,1,7,5>, RHS
- 2284474795U, // <1,7,5,5>: Cost 3 vmrglw <0,4,1,5>, <6,1,7,5>
- 2718330931U, // <1,7,5,6>: Cost 3 vsldoi8 <5,6,1,7>, <5,6,1,7>
- 2332250946U, // <1,7,5,7>: Cost 3 vmrglw <u,4,1,5>, <6,6,7,7>
- 2719658197U, // <1,7,5,u>: Cost 3 vsldoi8 <5,u,1,7>, <5,u,1,7>
- 2332921954U, // <1,7,6,0>: Cost 3 vmrglw <u,5,1,6>, <5,6,7,0>
- 3768185254U, // <1,7,6,1>: Cost 4 vsldoi8 <1,6,1,7>, <6,1,7,0>
- 3710134202U, // <1,7,6,2>: Cost 4 vsldoi4 <3,1,7,6>, <2,6,3,7>
- 3710134561U, // <1,7,6,3>: Cost 4 vsldoi4 <3,1,7,6>, <3,1,7,6>
- 3710135606U, // <1,7,6,4>: Cost 4 vsldoi4 <3,1,7,6>, RHS
- 3864884745U, // <1,7,6,5>: Cost 4 vsldoi12 <6,5,7,1>, <7,6,5,7>
- 3854784017U, // <1,7,6,6>: Cost 4 vsldoi12 <4,u,5,1>, <7,6,6,6>
- 2791953940U, // <1,7,6,7>: Cost 3 vsldoi12 <6,7,0,1>, <7,6,7,0>
- 2792617501U, // <1,7,6,u>: Cost 3 vsldoi12 <6,u,0,1>, <7,6,u,0>
- 2797925927U, // <1,7,7,0>: Cost 3 vsldoi12 <7,7,0,1>, <7,7,0,1>
- 3365528426U, // <1,7,7,1>: Cost 4 vmrglw <1,6,1,7>, <1,1,7,1>
- 3728058022U, // <1,7,7,2>: Cost 4 vsldoi4 <6,1,7,7>, <2,3,0,1>
- 3365528509U, // <1,7,7,3>: Cost 4 vmrglw <1,6,1,7>, <1,2,7,3>
- 3854784079U, // <1,7,7,4>: Cost 4 vsldoi12 <4,u,5,1>, <7,7,4,5>
- 3722088148U, // <1,7,7,5>: Cost 4 vsldoi4 <5,1,7,7>, <5,1,7,7>
- 3728060845U, // <1,7,7,6>: Cost 4 vsldoi4 <6,1,7,7>, <6,1,7,7>
- 2781042284U, // <1,7,7,7>: Cost 3 vsldoi12 <4,u,5,1>, <7,7,7,7>
- 2798515823U, // <1,7,7,u>: Cost 3 vsldoi12 <7,7,u,1>, <7,7,u,1>
- 2654322705U, // <1,7,u,0>: Cost 3 vsldoi4 <6,1,7,u>, <0,0,1,u>
- 2694444846U, // <1,7,u,1>: Cost 3 vsldoi8 <1,6,1,7>, LHS
- 2299711912U, // <1,7,u,2>: Cost 3 vmrglw <3,0,1,2>, <6,1,7,2>
- 2323649018U, // <1,7,u,3>: Cost 3 vmrglw <7,0,1,u>, <6,2,7,3>
- 2654326070U, // <1,7,u,4>: Cost 3 vsldoi4 <6,1,7,u>, RHS
- 2694445210U, // <1,7,u,5>: Cost 3 vsldoi8 <1,6,1,7>, RHS
- 2654327214U, // <1,7,u,6>: Cost 3 vsldoi4 <6,1,7,u>, <6,1,7,u>
- 2323649346U, // <1,7,u,7>: Cost 3 vmrglw <7,0,1,u>, <6,6,7,7>
- 2694445413U, // <1,7,u,u>: Cost 3 vsldoi8 <1,6,1,7>, LHS
- 1610752017U, // <1,u,0,0>: Cost 2 vsldoi8 <0,0,1,u>, <0,0,1,u>
- 1613406310U, // <1,u,0,1>: Cost 2 vsldoi8 <0,4,1,u>, LHS
- 2685821107U, // <1,u,0,2>: Cost 3 vsldoi8 <0,2,1,u>, <0,2,1,u>
- 2283765916U, // <1,u,0,3>: Cost 3 vmrglw <0,3,1,0>, LHS
- 1613406549U, // <1,u,0,4>: Cost 2 vsldoi8 <0,4,1,u>, <0,4,1,u>
- 1725880054U, // <1,u,0,5>: Cost 2 vsldoi12 <u,0,5,1>, <u,0,5,1>
- 2688475639U, // <1,u,0,6>: Cost 3 vsldoi8 <0,6,1,u>, <0,6,1,u>
- 2283769160U, // <1,u,0,7>: Cost 3 vmrglw <0,3,1,0>, RHS
- 1613406877U, // <1,u,0,u>: Cost 2 vsldoi8 <0,4,1,u>, LHS
- 1550221414U, // <1,u,1,0>: Cost 2 vsldoi4 <1,1,1,1>, LHS
- 269271142U, // <1,u,1,1>: Cost 1 vspltisw1 LHS
- 1683117870U, // <1,u,1,2>: Cost 2 vsldoi12 <0,u,1,1>, LHS
- 1213350044U, // <1,u,1,3>: Cost 2 vmrglw <0,u,1,1>, LHS
- 1550224694U, // <1,u,1,4>: Cost 2 vsldoi4 <1,1,1,1>, RHS
- 1147574426U, // <1,u,1,5>: Cost 2 vmrghw <1,1,1,1>, RHS
- 2687149326U, // <1,u,1,6>: Cost 3 vsldoi8 <0,4,1,u>, <1,6,u,7>
- 1213353288U, // <1,u,1,7>: Cost 2 vmrglw <0,u,1,1>, RHS
- 269271142U, // <1,u,1,u>: Cost 1 vspltisw1 LHS
- 2222118611U, // <1,u,2,0>: Cost 3 vmrghw <1,2,3,0>, <u,0,1,2>
- 1148376878U, // <1,u,2,1>: Cost 2 vmrghw <1,2,3,0>, LHS
- 1148371862U, // <1,u,2,2>: Cost 2 vmrghw <1,2,3,0>, <1,2,3,0>
- 1225965724U, // <1,u,2,3>: Cost 2 vmrglw <3,0,1,2>, LHS
- 2222118975U, // <1,u,2,4>: Cost 3 vmrghw <1,2,3,0>, <u,4,5,6>
- 1148377242U, // <1,u,2,5>: Cost 2 vmrghw <1,2,3,0>, RHS
- 2687150010U, // <1,u,2,6>: Cost 3 vsldoi8 <0,4,1,u>, <2,6,3,7>
- 1225968968U, // <1,u,2,7>: Cost 2 vmrglw <3,0,1,2>, RHS
- 1148377445U, // <1,u,2,u>: Cost 2 vmrghw <1,2,3,0>, LHS
- 471040156U, // <1,u,3,0>: Cost 1 vsldoi4 LHS, LHS
- 1544782644U, // <1,u,3,1>: Cost 2 vsldoi4 LHS, <1,1,1,1>
- 1544783464U, // <1,u,3,2>: Cost 2 vsldoi4 LHS, <2,2,2,2>
- 1544784022U, // <1,u,3,3>: Cost 2 vsldoi4 LHS, <3,0,1,2>
- 471043382U, // <1,u,3,4>: Cost 1 vsldoi4 LHS, RHS
- 1592561668U, // <1,u,3,5>: Cost 2 vsldoi4 LHS, <5,5,5,5>
- 1592562170U, // <1,u,3,6>: Cost 2 vsldoi4 LHS, <6,2,7,3>
- 1592562682U, // <1,u,3,7>: Cost 2 vsldoi4 LHS, <7,0,1,2>
- 471045934U, // <1,u,3,u>: Cost 1 vsldoi4 LHS, LHS
- 2708384629U, // <1,u,4,0>: Cost 3 vsldoi8 <4,0,1,u>, <4,0,1,u>
- 2687151101U, // <1,u,4,1>: Cost 3 vsldoi8 <0,4,1,u>, <4,1,u,0>
- 2223408022U, // <1,u,4,2>: Cost 3 vmrghw <1,4,2,5>, <1,2,3,0>
- 2283798684U, // <1,u,4,3>: Cost 3 vmrglw <0,3,1,4>, LHS
- 2642422785U, // <1,u,4,4>: Cost 3 vsldoi4 <4,1,u,4>, <4,1,u,4>
- 1613409590U, // <1,u,4,5>: Cost 2 vsldoi8 <0,4,1,u>, RHS
- 2283801090U, // <1,u,4,6>: Cost 3 vmrglw <0,3,1,4>, <3,4,5,6>
- 2283801928U, // <1,u,4,7>: Cost 3 vmrglw <0,3,1,4>, RHS
- 1613409833U, // <1,u,4,u>: Cost 2 vsldoi8 <0,4,1,u>, RHS
- 2284471235U, // <1,u,5,0>: Cost 3 vmrglw <0,4,1,5>, <1,2,u,0>
- 2284472046U, // <1,u,5,1>: Cost 3 vmrglw <0,4,1,5>, <2,3,u,1>
- 2284472533U, // <1,u,5,2>: Cost 3 vmrglw <0,4,1,5>, <3,0,u,2>
- 1210728604U, // <1,u,5,3>: Cost 2 vmrglw <0,4,1,5>, LHS
- 2284471239U, // <1,u,5,4>: Cost 3 vmrglw <0,4,1,5>, <1,2,u,4>
- 1210728786U, // <1,u,5,5>: Cost 2 vmrglw <0,4,1,5>, <0,4,1,5>
- 1683118234U, // <1,u,5,6>: Cost 2 vsldoi12 <0,u,1,1>, RHS
- 1210731848U, // <1,u,5,7>: Cost 2 vmrglw <0,4,1,5>, RHS
- 1210728609U, // <1,u,5,u>: Cost 2 vmrglw <0,4,1,5>, LHS
- 2720330023U, // <1,u,6,0>: Cost 3 vsldoi8 <6,0,1,u>, <6,0,1,u>
- 2757376190U, // <1,u,6,1>: Cost 3 vsldoi12 <0,u,u,1>, <u,6,1,7>
- 2726302202U, // <1,u,6,2>: Cost 3 vsldoi8 <7,0,1,u>, <6,2,7,3>
- 2283151516U, // <1,u,6,3>: Cost 3 vmrglw <0,2,1,6>, LHS
- 2224972114U, // <1,u,6,4>: Cost 3 vmrghw <1,6,5,7>, <0,4,1,5>
- 2224683162U, // <1,u,6,5>: Cost 3 vmrghw <1,6,1,7>, RHS
- 2726302520U, // <1,u,6,6>: Cost 3 vsldoi8 <7,0,1,u>, <6,6,6,6>
- 2283154760U, // <1,u,6,7>: Cost 3 vmrglw <0,2,1,6>, RHS
- 2283151521U, // <1,u,6,u>: Cost 3 vmrglw <0,2,1,6>, LHS
- 1652560896U, // <1,u,7,0>: Cost 2 vsldoi8 <7,0,1,u>, <7,0,1,u>
- 2333590225U, // <1,u,7,1>: Cost 3 vmrglw <u,6,1,7>, <0,u,u,1>
- 2765412628U, // <1,u,7,2>: Cost 3 vsldoi12 <2,3,0,1>, <u,7,2,3>
- 2291785884U, // <1,u,7,3>: Cost 3 vmrglw <1,6,1,7>, LHS
- 2781042984U, // <1,u,7,4>: Cost 3 vsldoi12 <4,u,5,1>, <u,7,4,5>
- 3365527953U, // <1,u,7,5>: Cost 4 vmrglw <1,6,1,7>, <0,4,u,5>
- 2791954748U, // <1,u,7,6>: Cost 3 vsldoi12 <6,7,0,1>, <u,7,6,7>
- 2291789128U, // <1,u,7,7>: Cost 3 vmrglw <1,6,1,7>, RHS
- 1657869960U, // <1,u,7,u>: Cost 2 vsldoi8 <7,u,1,u>, <7,u,1,u>
- 471081121U, // <1,u,u,0>: Cost 1 vsldoi4 LHS, LHS
- 269271142U, // <1,u,u,1>: Cost 1 vspltisw1 LHS
- 1544824424U, // <1,u,u,2>: Cost 2 vsldoi4 LHS, <2,2,2,2>
- 1544824982U, // <1,u,u,3>: Cost 2 vsldoi4 LHS, <3,0,1,2>
- 471084342U, // <1,u,u,4>: Cost 1 vsldoi4 LHS, RHS
- 1613412506U, // <1,u,u,5>: Cost 2 vsldoi8 <0,4,1,u>, RHS
- 1683118477U, // <1,u,u,6>: Cost 2 vsldoi12 <0,u,1,1>, RHS
- 1210756424U, // <1,u,u,7>: Cost 2 vmrglw <0,4,1,u>, RHS
- 471086894U, // <1,u,u,u>: Cost 1 vsldoi4 LHS, LHS
- 2226757632U, // <2,0,0,0>: Cost 3 vmrghw <2,0,3,0>, <0,0,0,0>
- 2226757734U, // <2,0,0,1>: Cost 3 vmrghw <2,0,3,0>, LHS
- 3826622483U, // <2,0,0,2>: Cost 4 vsldoi12 <0,2,1,2>, <0,0,2,1>
- 3843211292U, // <2,0,0,3>: Cost 4 vsldoi12 <3,0,1,2>, <0,0,3,1>
- 3300499794U, // <2,0,0,4>: Cost 4 vmrghw <2,0,3,0>, <0,4,1,5>
- 3356256724U, // <2,0,0,5>: Cost 4 vmrglw <0,1,2,0>, <3,4,0,5>
- 3825664056U, // <2,0,0,6>: Cost 4 vsldoi12 <0,0,6,2>, <0,0,6,2>
- 3762889289U, // <2,0,0,7>: Cost 4 vsldoi8 <0,7,2,0>, <0,7,2,0>
- 2226758301U, // <2,0,0,u>: Cost 3 vmrghw <2,0,3,0>, LHS
- 2227429386U, // <2,0,1,0>: Cost 3 vmrghw <2,1,3,1>, <0,0,1,1>
- 2227429478U, // <2,0,1,1>: Cost 3 vmrghw <2,1,3,1>, LHS
- 1691156582U, // <2,0,1,2>: Cost 2 vsldoi12 <2,2,2,2>, LHS
- 2666358997U, // <2,0,1,3>: Cost 3 vsldoi4 <u,2,0,1>, <3,0,u,2>
- 2227462482U, // <2,0,1,4>: Cost 3 vmrghw <2,1,3,5>, <0,4,1,5>
- 3722186464U, // <2,0,1,5>: Cost 4 vsldoi4 <5,2,0,1>, <5,2,0,1>
- 3867099278U, // <2,0,1,6>: Cost 4 vsldoi12 <7,0,1,2>, <0,1,6,7>
- 3366881912U, // <2,0,1,7>: Cost 4 vmrglw <1,u,2,1>, <3,6,0,7>
- 1691156636U, // <2,0,1,u>: Cost 2 vsldoi12 <2,2,2,2>, LHS
- 2228027392U, // <2,0,2,0>: Cost 3 vmrghw <2,2,2,2>, <0,0,0,0>
- 1154285670U, // <2,0,2,1>: Cost 2 vmrghw <2,2,2,2>, LHS
- 2228027565U, // <2,0,2,2>: Cost 3 vmrghw <2,2,2,2>, <0,2,1,2>
- 3301769468U, // <2,0,2,3>: Cost 4 vmrghw <2,2,2,2>, <0,3,1,0>
- 2228027730U, // <2,0,2,4>: Cost 3 vmrghw <2,2,2,2>, <0,4,1,5>
- 3301769635U, // <2,0,2,5>: Cost 4 vmrghw <2,2,2,2>, <0,5,1,5>
- 3780806586U, // <2,0,2,6>: Cost 4 vsldoi8 <3,7,2,0>, <2,6,3,7>
- 3368880760U, // <2,0,2,7>: Cost 4 vmrglw <2,2,2,2>, <3,6,0,7>
- 1154286237U, // <2,0,2,u>: Cost 2 vmrghw <2,2,2,2>, LHS
- 1213440000U, // <2,0,3,0>: Cost 2 vmrglw LHS, <0,0,0,0>
- 1213441702U, // <2,0,3,1>: Cost 2 vmrglw LHS, <2,3,0,1>
- 2228535470U, // <2,0,3,2>: Cost 3 vmrghw <2,3,0,1>, <0,2,1,3>
- 2636515632U, // <2,0,3,3>: Cost 3 vsldoi4 <3,2,0,3>, <3,2,0,3>
- 2287182962U, // <2,0,3,4>: Cost 3 vmrglw LHS, <1,5,0,4>
- 2660405346U, // <2,0,3,5>: Cost 3 vsldoi4 <7,2,0,3>, <5,6,7,0>
- 2228535798U, // <2,0,3,6>: Cost 3 vmrghw <2,3,0,1>, <0,6,1,7>
- 2660406420U, // <2,0,3,7>: Cost 3 vsldoi4 <7,2,0,3>, <7,2,0,3>
- 1213441709U, // <2,0,3,u>: Cost 2 vmrglw LHS, <2,3,0,u>
- 3368894464U, // <2,0,4,0>: Cost 4 vmrglw <2,2,2,4>, <0,0,0,0>
- 2764898642U, // <2,0,4,1>: Cost 3 vsldoi12 <2,2,2,2>, <0,4,1,5>
- 3826622811U, // <2,0,4,2>: Cost 4 vsldoi12 <0,2,1,2>, <0,4,2,5>
- 3843211620U, // <2,0,4,3>: Cost 4 vsldoi12 <3,0,1,2>, <0,4,3,5>
- 3838640493U, // <2,0,4,4>: Cost 4 vsldoi12 <2,2,2,2>, <0,4,4,5>
- 2732944694U, // <2,0,4,5>: Cost 3 vsldoi8 <u,1,2,0>, RHS
- 3797396857U, // <2,0,4,6>: Cost 4 vsldoi8 <6,5,2,0>, <4,6,5,2>
- 3867099528U, // <2,0,4,7>: Cost 4 vsldoi12 <7,0,1,2>, <0,4,7,5>
- 2764898705U, // <2,0,4,u>: Cost 3 vsldoi12 <2,2,2,2>, <0,4,u,5>
- 3364257792U, // <2,0,5,0>: Cost 4 vmrglw <1,4,2,5>, <0,0,0,0>
- 2230124646U, // <2,0,5,1>: Cost 3 vmrghw <2,5,3,6>, LHS
- 3304235184U, // <2,0,5,2>: Cost 4 vmrghw <2,5,u,6>, <0,2,1,5>
- 3364260144U, // <2,0,5,3>: Cost 4 vmrglw <1,4,2,5>, <3,2,0,3>
- 3303817554U, // <2,0,5,4>: Cost 4 vmrghw <2,5,3,0>, <0,4,1,5>
- 3364260146U, // <2,0,5,5>: Cost 4 vmrglw <1,4,2,5>, <3,2,0,5>
- 3867099602U, // <2,0,5,6>: Cost 4 vsldoi12 <7,0,1,2>, <0,5,6,7>
- 3364260472U, // <2,0,5,7>: Cost 4 vmrglw <1,4,2,5>, <3,6,0,7>
- 2230125213U, // <2,0,5,u>: Cost 3 vmrghw <2,5,3,6>, LHS
- 2230796288U, // <2,0,6,0>: Cost 3 vmrghw <2,6,3,7>, <0,0,0,0>
- 1157054566U, // <2,0,6,1>: Cost 2 vmrghw <2,6,3,7>, LHS
- 2230796465U, // <2,0,6,2>: Cost 3 vmrghw <2,6,3,7>, <0,2,1,6>
- 3304538364U, // <2,0,6,3>: Cost 4 vmrghw <2,6,3,7>, <0,3,1,0>
- 2230796626U, // <2,0,6,4>: Cost 3 vmrghw <2,6,3,7>, <0,4,1,5>
- 3797398205U, // <2,0,6,5>: Cost 4 vsldoi8 <6,5,2,0>, <6,5,2,0>
- 3304538614U, // <2,0,6,6>: Cost 4 vmrghw <2,6,3,7>, <0,6,1,7>
- 3798725471U, // <2,0,6,7>: Cost 4 vsldoi8 <6,7,2,0>, <6,7,2,0>
- 1157055133U, // <2,0,6,u>: Cost 2 vmrghw <2,6,3,7>, LHS
- 3371573248U, // <2,0,7,0>: Cost 4 vmrglw <2,6,2,7>, <0,0,0,0>
- 2231189606U, // <2,0,7,1>: Cost 3 vmrghw <2,7,0,1>, LHS
- 3801380003U, // <2,0,7,2>: Cost 4 vsldoi8 <7,2,2,0>, <7,2,2,0>
- 3802043636U, // <2,0,7,3>: Cost 4 vsldoi8 <7,3,2,0>, <7,3,2,0>
- 3806688614U, // <2,0,7,4>: Cost 4 vsldoi8 <u,1,2,0>, <7,4,5,6>
- 3356317308U, // <2,0,7,5>: Cost 4 vmrglw <0,1,2,7>, <7,u,0,5>
- 3804034535U, // <2,0,7,6>: Cost 4 vsldoi8 <7,6,2,0>, <7,6,2,0>
- 3806688876U, // <2,0,7,7>: Cost 4 vsldoi8 <u,1,2,0>, <7,7,7,7>
- 2231190173U, // <2,0,7,u>: Cost 3 vmrghw <2,7,0,1>, LHS
- 1208836096U, // <2,0,u,0>: Cost 2 vmrglw LHS, <0,0,0,0>
- 1208837798U, // <2,0,u,1>: Cost 2 vmrglw LHS, <2,3,0,1>
- 1691157149U, // <2,0,u,2>: Cost 2 vsldoi12 <2,2,2,2>, LHS
- 2636556597U, // <2,0,u,3>: Cost 3 vsldoi4 <3,2,0,u>, <3,2,0,u>
- 2282579625U, // <2,0,u,4>: Cost 3 vmrglw LHS, <2,3,0,4>
- 2660446306U, // <2,0,u,5>: Cost 3 vsldoi4 <7,2,0,u>, <5,6,7,0>
- 2228535798U, // <2,0,u,6>: Cost 3 vmrghw <2,3,0,1>, <0,6,1,7>
- 2660447385U, // <2,0,u,7>: Cost 3 vsldoi4 <7,2,0,u>, <7,2,0,u>
- 1208837805U, // <2,0,u,u>: Cost 2 vmrglw LHS, <2,3,0,u>
- 3692388523U, // <2,1,0,0>: Cost 4 vsldoi4 <0,2,1,0>, <0,2,1,0>
- 2757526244U, // <2,1,0,1>: Cost 3 vsldoi12 <1,0,1,2>, <1,0,1,2>
- 2330290974U, // <2,1,0,2>: Cost 3 vmrglw <u,1,2,0>, <3,u,1,2>
- 3843212020U, // <2,1,0,3>: Cost 4 vsldoi12 <3,0,1,2>, <1,0,3,0>
- 3692391734U, // <2,1,0,4>: Cost 4 vsldoi4 <0,2,1,0>, RHS
- 3300533362U, // <2,1,0,5>: Cost 4 vmrghw <2,0,3,4>, <1,5,0,4>
- 3794084337U, // <2,1,0,6>: Cost 4 vsldoi8 <6,0,2,1>, <0,6,1,2>
- 3374170614U, // <2,1,0,7>: Cost 5 vmrglw <3,1,2,0>, <0,6,1,7>
- 2758042403U, // <2,1,0,u>: Cost 3 vsldoi12 <1,0,u,2>, <1,0,u,2>
- 2690482924U, // <2,1,1,0>: Cost 3 vsldoi8 <1,0,2,1>, <1,0,2,1>
- 2764899124U, // <2,1,1,1>: Cost 3 vsldoi12 <2,2,2,2>, <1,1,1,1>
- 2695791510U, // <2,1,1,2>: Cost 3 vsldoi8 <1,u,2,1>, <1,2,3,0>
- 3362235271U, // <2,1,1,3>: Cost 4 vmrglw <1,1,2,1>, <1,2,1,3>
- 3692399926U, // <2,1,1,4>: Cost 4 vsldoi4 <0,2,1,1>, RHS
- 3832226649U, // <2,1,1,5>: Cost 4 vsldoi12 <1,1,5,2>, <1,1,5,2>
- 3301205235U, // <2,1,1,6>: Cost 4 vmrghw <2,1,3,5>, <1,6,5,7>
- 3768870179U, // <2,1,1,7>: Cost 4 vsldoi8 <1,7,2,1>, <1,7,2,1>
- 2695791988U, // <2,1,1,u>: Cost 3 vsldoi8 <1,u,2,1>, <1,u,2,1>
- 2618663085U, // <2,1,2,0>: Cost 3 vsldoi4 <0,2,1,2>, <0,2,1,2>
- 2228028212U, // <2,1,2,1>: Cost 3 vmrghw <2,2,2,2>, <1,1,1,1>
- 2618664552U, // <2,1,2,2>: Cost 3 vsldoi4 <0,2,1,2>, <2,2,2,2>
- 2759000984U, // <2,1,2,3>: Cost 3 vsldoi12 <1,2,3,2>, <1,2,3,2>
- 2618666294U, // <2,1,2,4>: Cost 3 vsldoi4 <0,2,1,2>, RHS
- 2295136594U, // <2,1,2,5>: Cost 3 vmrglw <2,2,2,2>, <0,4,1,5>
- 3769534376U, // <2,1,2,6>: Cost 4 vsldoi8 <1,u,2,1>, <2,6,1,7>
- 2793358266U, // <2,1,2,7>: Cost 3 vsldoi12 <7,0,1,2>, <1,2,7,0>
- 2618668846U, // <2,1,2,u>: Cost 3 vsldoi4 <0,2,1,2>, LHS
- 2282536969U, // <2,1,3,0>: Cost 3 vmrglw LHS, <0,0,1,0>
- 1208795146U, // <2,1,3,1>: Cost 2 vmrglw LHS, <0,0,1,1>
- 1213442198U, // <2,1,3,2>: Cost 2 vmrglw LHS, <3,0,1,2>
- 2287181998U, // <2,1,3,3>: Cost 3 vmrglw LHS, <0,2,1,3>
- 2618674486U, // <2,1,3,4>: Cost 3 vsldoi4 <0,2,1,3>, RHS
- 1208795474U, // <2,1,3,5>: Cost 2 vmrglw LHS, <0,4,1,5>
- 2287182001U, // <2,1,3,6>: Cost 3 vmrglw LHS, <0,2,1,6>
- 2287183055U, // <2,1,3,7>: Cost 3 vmrglw LHS, <1,6,1,7>
- 1208795153U, // <2,1,3,u>: Cost 2 vmrglw LHS, <0,0,1,u>
- 3692421295U, // <2,1,4,0>: Cost 4 vsldoi4 <0,2,1,4>, <0,2,1,4>
- 3838641195U, // <2,1,4,1>: Cost 4 vsldoi12 <2,2,2,2>, <1,4,1,5>
- 2330323742U, // <2,1,4,2>: Cost 3 vmrglw <u,1,2,4>, <3,u,1,2>
- 3692423318U, // <2,1,4,3>: Cost 5 vsldoi4 <0,2,1,4>, <3,0,1,2>
- 3692424502U, // <2,1,4,4>: Cost 4 vsldoi4 <0,2,1,4>, RHS
- 2695793974U, // <2,1,4,5>: Cost 3 vsldoi8 <1,u,2,1>, RHS
- 3799395705U, // <2,1,4,6>: Cost 4 vsldoi8 <6,u,2,1>, <4,6,5,2>
- 3368895695U, // <2,1,4,7>: Cost 5 vmrglw <2,2,2,4>, <1,6,1,7>
- 2695794217U, // <2,1,4,u>: Cost 3 vsldoi8 <1,u,2,1>, RHS
- 3692429488U, // <2,1,5,0>: Cost 4 vsldoi4 <0,2,1,5>, <0,2,1,5>
- 3364257802U, // <2,1,5,1>: Cost 4 vmrglw <1,4,2,5>, <0,0,1,1>
- 3692431253U, // <2,1,5,2>: Cost 4 vsldoi4 <0,2,1,5>, <2,5,u,6>
- 3692431874U, // <2,1,5,3>: Cost 4 vsldoi4 <0,2,1,5>, <3,4,5,6>
- 3692432694U, // <2,1,5,4>: Cost 4 vsldoi4 <0,2,1,5>, RHS
- 3364258130U, // <2,1,5,5>: Cost 4 vmrglw <1,4,2,5>, <0,4,1,5>
- 3303875827U, // <2,1,5,6>: Cost 4 vmrghw <2,5,3,7>, <1,6,5,7>
- 3867100333U, // <2,1,5,7>: Cost 4 vsldoi12 <7,0,1,2>, <1,5,7,0>
- 3692435246U, // <2,1,5,u>: Cost 4 vsldoi4 <0,2,1,5>, LHS
- 2618695857U, // <2,1,6,0>: Cost 3 vsldoi4 <0,2,1,6>, <0,2,1,6>
- 2230797108U, // <2,1,6,1>: Cost 3 vmrghw <2,6,3,7>, <1,1,1,1>
- 2618697658U, // <2,1,6,2>: Cost 3 vsldoi4 <0,2,1,6>, <2,6,3,7>
- 3692439702U, // <2,1,6,3>: Cost 4 vsldoi4 <0,2,1,6>, <3,0,1,2>
- 2618699062U, // <2,1,6,4>: Cost 3 vsldoi4 <0,2,1,6>, RHS
- 3364929874U, // <2,1,6,5>: Cost 4 vmrglw <1,5,2,6>, <0,4,1,5>
- 3692442424U, // <2,1,6,6>: Cost 4 vsldoi4 <0,2,1,6>, <6,6,6,6>
- 3798733664U, // <2,1,6,7>: Cost 4 vsldoi8 <6,7,2,1>, <6,7,2,1>
- 2618701614U, // <2,1,6,u>: Cost 3 vsldoi4 <0,2,1,6>, LHS
- 3799397370U, // <2,1,7,0>: Cost 4 vsldoi8 <6,u,2,1>, <7,0,1,2>
- 3371573258U, // <2,1,7,1>: Cost 4 vmrglw <2,6,2,7>, <0,0,1,1>
- 2330351234U, // <2,1,7,2>: Cost 3 vmrglw <u,1,2,7>, <7,u,1,2>
- 3799397658U, // <2,1,7,3>: Cost 4 vsldoi8 <6,u,2,1>, <7,3,6,2>
- 3799397734U, // <2,1,7,4>: Cost 4 vsldoi8 <6,u,2,1>, <7,4,5,6>
- 3371573586U, // <2,1,7,5>: Cost 4 vmrglw <2,6,2,7>, <0,4,1,5>
- 3799397870U, // <2,1,7,6>: Cost 4 vsldoi8 <6,u,2,1>, <7,6,2,7>
- 3799397956U, // <2,1,7,7>: Cost 4 vsldoi8 <6,u,2,1>, <7,7,3,3>
- 2330351234U, // <2,1,7,u>: Cost 3 vmrglw <u,1,2,7>, <7,u,1,2>
- 2282577929U, // <2,1,u,0>: Cost 3 vmrglw LHS, <0,0,1,0>
- 1208836106U, // <2,1,u,1>: Cost 2 vmrglw LHS, <0,0,1,1>
- 1208838294U, // <2,1,u,2>: Cost 2 vmrglw LHS, <3,0,1,2>
- 2282578094U, // <2,1,u,3>: Cost 3 vmrglw LHS, <0,2,1,3>
- 2282577933U, // <2,1,u,4>: Cost 3 vmrglw LHS, <0,0,1,4>
- 1208836434U, // <2,1,u,5>: Cost 2 vmrglw LHS, <0,4,1,5>
- 2282578097U, // <2,1,u,6>: Cost 3 vmrglw LHS, <0,2,1,6>
- 2287224015U, // <2,1,u,7>: Cost 3 vmrglw LHS, <1,6,1,7>
- 1208836113U, // <2,1,u,u>: Cost 2 vmrglw LHS, <0,0,1,u>
- 2226759117U, // <2,2,0,0>: Cost 3 vmrghw <2,0,3,0>, <2,0,3,0>
- 1624047718U, // <2,2,0,1>: Cost 2 vsldoi8 <2,2,2,2>, LHS
- 2697789613U, // <2,2,0,2>: Cost 3 vsldoi8 <2,2,2,2>, <0,2,1,2>
- 2226767526U, // <2,2,0,3>: Cost 3 vmrghw <2,0,3,1>, <2,3,0,1>
- 2697789778U, // <2,2,0,4>: Cost 3 vsldoi8 <2,2,2,2>, <0,4,1,5>
- 3300657000U, // <2,2,0,5>: Cost 4 vmrghw <2,0,5,1>, <2,5,3,6>
- 2226988986U, // <2,2,0,6>: Cost 3 vmrghw <2,0,6,1>, <2,6,3,7>
- 3734271139U, // <2,2,0,7>: Cost 4 vsldoi4 <7,2,2,0>, <7,2,2,0>
- 1624048285U, // <2,2,0,u>: Cost 2 vsldoi8 <2,2,2,2>, LHS
- 3831268868U, // <2,2,1,0>: Cost 4 vsldoi12 <1,0,1,2>, <2,1,0,1>
- 2293138804U, // <2,2,1,1>: Cost 3 vmrglw <1,u,2,1>, <1,u,2,1>
- 2697790358U, // <2,2,1,2>: Cost 3 vsldoi8 <2,2,2,2>, <1,2,3,0>
- 2293137510U, // <2,2,1,3>: Cost 3 vmrglw <1,u,2,1>, LHS
- 3771532331U, // <2,2,1,4>: Cost 4 vsldoi8 <2,2,2,2>, <1,4,1,5>
- 3767551106U, // <2,2,1,5>: Cost 4 vsldoi8 <1,5,2,2>, <1,5,2,2>
- 3301173178U, // <2,2,1,6>: Cost 4 vmrghw <2,1,3,1>, <2,6,3,7>
- 3372853169U, // <2,2,1,7>: Cost 4 vmrglw <2,u,2,1>, <2,6,2,7>
- 2293137515U, // <2,2,1,u>: Cost 3 vmrglw <1,u,2,1>, LHS
- 1556938854U, // <2,2,2,0>: Cost 2 vsldoi4 <2,2,2,2>, LHS
- 2295137733U, // <2,2,2,1>: Cost 3 vmrglw <2,2,2,2>, <2,0,2,1>
- 336380006U, // <2,2,2,2>: Cost 1 vspltisw2 LHS
- 1221394534U, // <2,2,2,3>: Cost 2 vmrglw <2,2,2,2>, LHS
- 1556942134U, // <2,2,2,4>: Cost 2 vsldoi4 <2,2,2,2>, RHS
- 2295138061U, // <2,2,2,5>: Cost 3 vmrglw <2,2,2,2>, <2,4,2,5>
- 2228029370U, // <2,2,2,6>: Cost 3 vmrghw <2,2,2,2>, <2,6,3,7>
- 2660545701U, // <2,2,2,7>: Cost 3 vsldoi4 <7,2,2,2>, <7,2,2,2>
- 336380006U, // <2,2,2,u>: Cost 1 vspltisw2 LHS
- 2697791638U, // <2,2,3,0>: Cost 3 vsldoi8 <2,2,2,2>, <3,0,1,2>
- 2765489840U, // <2,2,3,1>: Cost 3 vsldoi12 <2,3,1,2>, <2,3,1,2>
- 1213441640U, // <2,2,3,2>: Cost 2 vmrglw LHS, <2,2,2,2>
- 135053414U, // <2,2,3,3>: Cost 1 vmrglw LHS, LHS
- 2697792002U, // <2,2,3,4>: Cost 3 vsldoi8 <2,2,2,2>, <3,4,5,6>
- 2330313780U, // <2,2,3,5>: Cost 3 vmrglw LHS, <1,4,2,5>
- 2287183549U, // <2,2,3,6>: Cost 3 vmrglw LHS, <2,3,2,6>
- 2660553894U, // <2,2,3,7>: Cost 3 vsldoi4 <7,2,2,3>, <7,2,2,3>
- 135053419U, // <2,2,3,u>: Cost 1 vmrglw LHS, LHS
- 2630697062U, // <2,2,4,0>: Cost 3 vsldoi4 <2,2,2,4>, LHS
- 3771534282U, // <2,2,4,1>: Cost 4 vsldoi8 <2,2,2,2>, <4,1,2,3>
- 2764900109U, // <2,2,4,2>: Cost 3 vsldoi12 <2,2,2,2>, <2,4,2,5>
- 2295152742U, // <2,2,4,3>: Cost 3 vmrglw <2,2,2,4>, LHS
- 2295154282U, // <2,2,4,4>: Cost 3 vmrglw <2,2,2,4>, <2,2,2,4>
- 1624050998U, // <2,2,4,5>: Cost 2 vsldoi8 <2,2,2,2>, RHS
- 2229675962U, // <2,2,4,6>: Cost 3 vmrghw <2,4,6,5>, <2,6,3,7>
- 3368896433U, // <2,2,4,7>: Cost 4 vmrglw <2,2,2,4>, <2,6,2,7>
- 1624051241U, // <2,2,4,u>: Cost 2 vsldoi8 <2,2,2,2>, RHS
- 3771534920U, // <2,2,5,0>: Cost 4 vsldoi8 <2,2,2,2>, <5,0,1,2>
- 3364258540U, // <2,2,5,1>: Cost 4 vmrglw <1,4,2,5>, <1,0,2,1>
- 2296489576U, // <2,2,5,2>: Cost 3 vmrglw <2,4,2,5>, <2,2,2,2>
- 2290516070U, // <2,2,5,3>: Cost 3 vmrglw <1,4,2,5>, LHS
- 3771535284U, // <2,2,5,4>: Cost 4 vsldoi8 <2,2,2,2>, <5,4,5,6>
- 2290517044U, // <2,2,5,5>: Cost 3 vmrglw <1,4,2,5>, <1,4,2,5>
- 2697793634U, // <2,2,5,6>: Cost 3 vsldoi8 <2,2,2,2>, <5,6,7,0>
- 3370231729U, // <2,2,5,7>: Cost 4 vmrglw <2,4,2,5>, <2,6,2,7>
- 2290516075U, // <2,2,5,u>: Cost 3 vmrglw <1,4,2,5>, LHS
- 2230797801U, // <2,2,6,0>: Cost 3 vmrghw <2,6,3,7>, <2,0,6,1>
- 3304539679U, // <2,2,6,1>: Cost 4 vmrghw <2,6,3,7>, <2,1,3,1>
- 2764900273U, // <2,2,6,2>: Cost 3 vsldoi12 <2,2,2,2>, <2,6,2,7>
- 2764900282U, // <2,2,6,3>: Cost 3 vsldoi12 <2,2,2,2>, <2,6,3,7>
- 2230798129U, // <2,2,6,4>: Cost 3 vmrghw <2,6,3,7>, <2,4,6,5>
- 3304540008U, // <2,2,6,5>: Cost 4 vmrghw <2,6,3,7>, <2,5,3,6>
- 1157056442U, // <2,2,6,6>: Cost 2 vmrghw <2,6,3,7>, <2,6,3,7>
- 2725000033U, // <2,2,6,7>: Cost 3 vsldoi8 <6,7,2,2>, <6,7,2,2>
- 1157056442U, // <2,2,6,u>: Cost 2 vmrghw <2,6,3,7>, <2,6,3,7>
- 2793359338U, // <2,2,7,0>: Cost 3 vsldoi12 <7,0,1,2>, <2,7,0,1>
- 3371574725U, // <2,2,7,1>: Cost 4 vmrglw <2,6,2,7>, <2,0,2,1>
- 2297833064U, // <2,2,7,2>: Cost 3 vmrglw <2,6,2,7>, <2,2,2,2>
- 2297831526U, // <2,2,7,3>: Cost 3 vmrglw <2,6,2,7>, LHS
- 2697794918U, // <2,2,7,4>: Cost 3 vsldoi8 <2,2,2,2>, <7,4,5,6>
- 3371575053U, // <2,2,7,5>: Cost 4 vmrglw <2,6,2,7>, <2,4,2,5>
- 3304933297U, // <2,2,7,6>: Cost 4 vmrghw <2,7,0,1>, <2,6,2,7>
- 2297833393U, // <2,2,7,7>: Cost 3 vmrglw <2,6,2,7>, <2,6,2,7>
- 2297831531U, // <2,2,7,u>: Cost 3 vmrglw <2,6,2,7>, LHS
- 1556938854U, // <2,2,u,0>: Cost 2 vsldoi4 <2,2,2,2>, LHS
- 1624053550U, // <2,2,u,1>: Cost 2 vsldoi8 <2,2,2,2>, LHS
- 336380006U, // <2,2,u,2>: Cost 1 vspltisw2 LHS
- 135094374U, // <2,2,u,3>: Cost 1 vmrglw LHS, LHS
- 1556942134U, // <2,2,u,4>: Cost 2 vsldoi4 <2,2,2,2>, RHS
- 1624053914U, // <2,2,u,5>: Cost 2 vsldoi8 <2,2,2,2>, RHS
- 1157056442U, // <2,2,u,6>: Cost 2 vmrghw <2,6,3,7>, <2,6,3,7>
- 2660594859U, // <2,2,u,7>: Cost 3 vsldoi4 <7,2,2,u>, <7,2,2,u>
- 135094379U, // <2,2,u,u>: Cost 1 vmrglw LHS, LHS
- 1611448320U, // <2,3,0,0>: Cost 2 vsldoi8 LHS, <0,0,0,0>
- 537706598U, // <2,3,0,1>: Cost 1 vsldoi8 LHS, LHS
- 2689835181U, // <2,3,0,2>: Cost 3 vsldoi8 LHS, <0,2,1,2>
- 2689835260U, // <2,3,0,3>: Cost 3 vsldoi8 LHS, <0,3,1,0>
- 1611448658U, // <2,3,0,4>: Cost 2 vsldoi8 LHS, <0,4,1,5>
- 2732966354U, // <2,3,0,5>: Cost 3 vsldoi8 LHS, <0,5,6,7>
- 2732966390U, // <2,3,0,6>: Cost 3 vsldoi8 LHS, <0,6,1,7>
- 2660603052U, // <2,3,0,7>: Cost 3 vsldoi4 <7,2,3,0>, <7,2,3,0>
- 537707165U, // <2,3,0,u>: Cost 1 vsldoi8 LHS, LHS
- 2689835748U, // <2,3,1,0>: Cost 3 vsldoi8 LHS, <1,0,1,2>
- 1611449140U, // <2,3,1,1>: Cost 2 vsldoi8 LHS, <1,1,1,1>
- 1611449238U, // <2,3,1,2>: Cost 2 vsldoi8 LHS, <1,2,3,0>
- 3763577805U, // <2,3,1,3>: Cost 4 vsldoi8 LHS, <1,3,0,1>
- 2689836112U, // <2,3,1,4>: Cost 3 vsldoi8 LHS, <1,4,5,6>
- 2689836143U, // <2,3,1,5>: Cost 3 vsldoi8 LHS, <1,5,0,1>
- 2689836239U, // <2,3,1,6>: Cost 3 vsldoi8 LHS, <1,6,1,7>
- 3366881210U, // <2,3,1,7>: Cost 4 vmrglw <1,u,2,1>, <2,6,3,7>
- 1616094588U, // <2,3,1,u>: Cost 2 vsldoi8 LHS, <1,u,3,0>
- 2689836493U, // <2,3,2,0>: Cost 3 vsldoi8 LHS, <2,0,3,0>
- 2685191711U, // <2,3,2,1>: Cost 3 vsldoi8 LHS, <2,1,3,1>
- 1611449960U, // <2,3,2,2>: Cost 2 vsldoi8 LHS, <2,2,2,2>
- 1611450022U, // <2,3,2,3>: Cost 2 vsldoi8 LHS, <2,3,0,1>
- 2689836822U, // <2,3,2,4>: Cost 3 vsldoi8 LHS, <2,4,3,5>
- 2689836904U, // <2,3,2,5>: Cost 3 vsldoi8 LHS, <2,5,3,6>
- 1611450298U, // <2,3,2,6>: Cost 2 vsldoi8 LHS, <2,6,3,7>
- 2295138234U, // <2,3,2,7>: Cost 3 vmrglw <2,2,2,2>, <2,6,3,7>
- 1611450456U, // <2,3,2,u>: Cost 2 vsldoi8 LHS, <2,u,3,3>
- 1213440918U, // <2,3,3,0>: Cost 2 vmrglw LHS, <1,2,3,0>
- 2282538527U, // <2,3,3,1>: Cost 3 vmrglw LHS, <2,1,3,1>
- 1557022322U, // <2,3,3,2>: Cost 2 vsldoi4 <2,2,3,3>, <2,2,3,3>
- 1208796786U, // <2,3,3,3>: Cost 2 vmrglw LHS, <2,2,3,3>
- 1213440922U, // <2,3,3,4>: Cost 2 vmrglw LHS, <1,2,3,4>
- 2282538531U, // <2,3,3,5>: Cost 3 vmrglw LHS, <2,1,3,5>
- 2287188094U, // <2,3,3,6>: Cost 3 vmrglw LHS, <u,5,3,6>
- 1213441978U, // <2,3,3,7>: Cost 2 vmrglw LHS, <2,6,3,7>
- 1208796791U, // <2,3,3,u>: Cost 2 vmrglw LHS, <2,2,3,u>
- 1551056998U, // <2,3,4,0>: Cost 2 vsldoi4 <1,2,3,4>, LHS
- 1551057818U, // <2,3,4,1>: Cost 2 vsldoi4 <1,2,3,4>, <1,2,3,4>
- 2624800360U, // <2,3,4,2>: Cost 3 vsldoi4 <1,2,3,4>, <2,2,2,2>
- 2624800918U, // <2,3,4,3>: Cost 3 vsldoi4 <1,2,3,4>, <3,0,1,2>
- 1551060278U, // <2,3,4,4>: Cost 2 vsldoi4 <1,2,3,4>, RHS
- 537709878U, // <2,3,4,5>: Cost 1 vsldoi8 LHS, RHS
- 2732969337U, // <2,3,4,6>: Cost 3 vsldoi8 LHS, <4,6,5,2>
- 2660635824U, // <2,3,4,7>: Cost 3 vsldoi4 <7,2,3,4>, <7,2,3,4>
- 537710121U, // <2,3,4,u>: Cost 1 vsldoi8 LHS, RHS
- 2689838664U, // <2,3,5,0>: Cost 3 vsldoi8 LHS, <5,0,1,2>
- 2732969615U, // <2,3,5,1>: Cost 3 vsldoi8 LHS, <5,1,0,1>
- 2732969707U, // <2,3,5,2>: Cost 3 vsldoi8 LHS, <5,2,1,3>
- 3763580721U, // <2,3,5,3>: Cost 4 vsldoi8 LHS, <5,3,0,1>
- 2689839028U, // <2,3,5,4>: Cost 3 vsldoi8 LHS, <5,4,5,6>
- 1659228164U, // <2,3,5,5>: Cost 2 vsldoi8 LHS, <5,5,5,5>
- 1659228258U, // <2,3,5,6>: Cost 2 vsldoi8 LHS, <5,6,7,0>
- 3364259770U, // <2,3,5,7>: Cost 4 vmrglw <1,4,2,5>, <2,6,3,7>
- 1659228420U, // <2,3,5,u>: Cost 2 vsldoi8 LHS, <5,u,7,0>
- 2230798486U, // <2,3,6,0>: Cost 3 vmrghw <2,6,3,7>, <3,0,1,2>
- 2732970407U, // <2,3,6,1>: Cost 3 vsldoi8 LHS, <6,1,7,1>
- 1659228666U, // <2,3,6,2>: Cost 2 vsldoi8 LHS, <6,2,7,3>
- 2230798748U, // <2,3,6,3>: Cost 3 vmrghw <2,6,3,7>, <3,3,3,3>
- 2230798850U, // <2,3,6,4>: Cost 3 vmrghw <2,6,3,7>, <3,4,5,6>
- 2732970731U, // <2,3,6,5>: Cost 3 vsldoi8 LHS, <6,5,7,1>
- 1659228984U, // <2,3,6,6>: Cost 2 vsldoi8 LHS, <6,6,6,6>
- 1659229006U, // <2,3,6,7>: Cost 2 vsldoi8 LHS, <6,7,0,1>
- 1659229087U, // <2,3,6,u>: Cost 2 vsldoi8 LHS, <6,u,0,1>
- 1659229178U, // <2,3,7,0>: Cost 2 vsldoi8 LHS, <7,0,1,2>
- 2726999125U, // <2,3,7,1>: Cost 3 vsldoi8 <7,1,2,3>, <7,1,2,3>
- 2727662758U, // <2,3,7,2>: Cost 3 vsldoi8 <7,2,2,3>, <7,2,2,3>
- 2732971235U, // <2,3,7,3>: Cost 3 vsldoi8 LHS, <7,3,0,1>
- 1659229542U, // <2,3,7,4>: Cost 2 vsldoi8 LHS, <7,4,5,6>
- 2732971446U, // <2,3,7,5>: Cost 3 vsldoi8 LHS, <7,5,5,5>
- 2732971484U, // <2,3,7,6>: Cost 3 vsldoi8 LHS, <7,6,0,7>
- 1659229804U, // <2,3,7,7>: Cost 2 vsldoi8 LHS, <7,7,7,7>
- 1659229826U, // <2,3,7,u>: Cost 2 vsldoi8 LHS, <7,u,1,2>
- 1208837014U, // <2,3,u,0>: Cost 2 vmrglw LHS, <1,2,3,0>
- 537712430U, // <2,3,u,1>: Cost 1 vsldoi8 LHS, LHS
- 1616099205U, // <2,3,u,2>: Cost 2 vsldoi8 LHS, <u,2,3,0>
- 1208837746U, // <2,3,u,3>: Cost 2 vmrglw LHS, <2,2,3,3>
- 1208837018U, // <2,3,u,4>: Cost 2 vmrglw LHS, <1,2,3,4>
- 537712794U, // <2,3,u,5>: Cost 1 vsldoi8 LHS, RHS
- 1616099536U, // <2,3,u,6>: Cost 2 vsldoi8 LHS, <u,6,3,7>
- 1208838074U, // <2,3,u,7>: Cost 2 vmrglw LHS, <2,6,3,7>
- 537712997U, // <2,3,u,u>: Cost 1 vsldoi8 LHS, LHS
- 3771547648U, // <2,4,0,0>: Cost 4 vsldoi8 <2,2,2,4>, <0,0,0,0>
- 2697805926U, // <2,4,0,1>: Cost 3 vsldoi8 <2,2,2,4>, LHS
- 3770884269U, // <2,4,0,2>: Cost 4 vsldoi8 <2,1,2,4>, <0,2,1,2>
- 3806716164U, // <2,4,0,3>: Cost 4 vsldoi8 <u,1,2,4>, <0,3,1,u>
- 3771547986U, // <2,4,0,4>: Cost 4 vsldoi8 <2,2,2,4>, <0,4,1,5>
- 2226761014U, // <2,4,0,5>: Cost 3 vmrghw <2,0,3,0>, RHS
- 3853462427U, // <2,4,0,6>: Cost 4 vsldoi12 <4,6,5,2>, <4,0,6,1>
- 3867102116U, // <2,4,0,7>: Cost 4 vsldoi12 <7,0,1,2>, <4,0,7,1>
- 2226761257U, // <2,4,0,u>: Cost 3 vmrghw <2,0,3,0>, RHS
- 3849186231U, // <2,4,1,0>: Cost 4 vsldoi12 <4,0,1,2>, <4,1,0,2>
- 3301207010U, // <2,4,1,1>: Cost 4 vmrghw <2,1,3,5>, <4,1,5,0>
- 3766240150U, // <2,4,1,2>: Cost 4 vsldoi8 <1,3,2,4>, <1,2,3,0>
- 3766240226U, // <2,4,1,3>: Cost 4 vsldoi8 <1,3,2,4>, <1,3,2,4>
- 3301207248U, // <2,4,1,4>: Cost 4 vmrghw <2,1,3,5>, <4,4,4,4>
- 2227432758U, // <2,4,1,5>: Cost 3 vmrghw <2,1,3,1>, RHS
- 3758941400U, // <2,4,1,6>: Cost 4 vsldoi8 <0,1,2,4>, <1,6,2,7>
- 3768894758U, // <2,4,1,7>: Cost 4 vsldoi8 <1,7,2,4>, <1,7,2,4>
- 2227433001U, // <2,4,1,u>: Cost 3 vmrghw <2,1,3,1>, RHS
- 2228030354U, // <2,4,2,0>: Cost 3 vmrghw <2,2,2,2>, <4,0,5,1>
- 3770885657U, // <2,4,2,1>: Cost 4 vsldoi8 <2,1,2,4>, <2,1,2,4>
- 2697807466U, // <2,4,2,2>: Cost 3 vsldoi8 <2,2,2,4>, <2,2,2,4>
- 3368880468U, // <2,4,2,3>: Cost 4 vmrglw <2,2,2,2>, <3,2,4,3>
- 2228030672U, // <2,4,2,4>: Cost 3 vmrghw <2,2,2,2>, <4,4,4,4>
- 1154288950U, // <2,4,2,5>: Cost 2 vmrghw <2,2,2,2>, RHS
- 3771549617U, // <2,4,2,6>: Cost 4 vsldoi8 <2,2,2,4>, <2,6,2,7>
- 3368880796U, // <2,4,2,7>: Cost 4 vmrglw <2,2,2,2>, <3,6,4,7>
- 1154289193U, // <2,4,2,u>: Cost 2 vmrghw <2,2,2,2>, RHS
- 2636808294U, // <2,4,3,0>: Cost 3 vsldoi4 <3,2,4,3>, LHS
- 2287181861U, // <2,4,3,1>: Cost 3 vmrglw LHS, <0,0,4,1>
- 2228866102U, // <2,4,3,2>: Cost 3 vmrghw <2,3,4,5>, <4,2,5,3>
- 2636810580U, // <2,4,3,3>: Cost 3 vsldoi4 <3,2,4,3>, <3,2,4,3>
- 1256574160U, // <2,4,3,4>: Cost 2 vmrglw LHS, <4,4,4,4>
- 1213441742U, // <2,4,3,5>: Cost 2 vmrglw LHS, <2,3,4,5>
- 2228866430U, // <2,4,3,6>: Cost 3 vmrghw <2,3,4,5>, <4,6,5,7>
- 2660701368U, // <2,4,3,7>: Cost 3 vsldoi4 <7,2,4,3>, <7,2,4,3>
- 1213441745U, // <2,4,3,u>: Cost 2 vmrglw LHS, <2,3,4,u>
- 3704586342U, // <2,4,4,0>: Cost 4 vsldoi4 <2,2,4,4>, LHS
- 3782831051U, // <2,4,4,1>: Cost 4 vsldoi8 <4,1,2,4>, <4,1,2,4>
- 3704587900U, // <2,4,4,2>: Cost 4 vsldoi4 <2,2,4,4>, <2,2,4,4>
- 3368896123U, // <2,4,4,3>: Cost 4 vmrglw <2,2,2,4>, <2,2,4,3>
- 2793360592U, // <2,4,4,4>: Cost 3 vsldoi12 <7,0,1,2>, <4,4,4,4>
- 2697809206U, // <2,4,4,5>: Cost 3 vsldoi8 <2,2,2,4>, RHS
- 3303198078U, // <2,4,4,6>: Cost 4 vmrghw <2,4,3,5>, <4,6,5,7>
- 3867102444U, // <2,4,4,7>: Cost 4 vsldoi12 <7,0,1,2>, <4,4,7,5>
- 2697809449U, // <2,4,4,u>: Cost 3 vsldoi8 <2,2,2,4>, RHS
- 2630852710U, // <2,4,5,0>: Cost 3 vsldoi4 <2,2,4,5>, LHS
- 2624881572U, // <2,4,5,1>: Cost 3 vsldoi4 <1,2,4,5>, <1,2,4,5>
- 2630854269U, // <2,4,5,2>: Cost 3 vsldoi4 <2,2,4,5>, <2,2,4,5>
- 2666686677U, // <2,4,5,3>: Cost 3 vsldoi4 <u,2,4,5>, <3,0,u,2>
- 2630855990U, // <2,4,5,4>: Cost 3 vsldoi4 <2,2,4,5>, RHS
- 2230127926U, // <2,4,5,5>: Cost 3 vmrghw <2,5,3,6>, RHS
- 1691159862U, // <2,4,5,6>: Cost 2 vsldoi12 <2,2,2,2>, RHS
- 3867102520U, // <2,4,5,7>: Cost 4 vsldoi12 <7,0,1,2>, <4,5,7,0>
- 1691159880U, // <2,4,5,u>: Cost 2 vsldoi12 <2,2,2,2>, RHS
- 2230799250U, // <2,4,6,0>: Cost 3 vmrghw <2,6,3,7>, <4,0,5,1>
- 3304541130U, // <2,4,6,1>: Cost 4 vmrghw <2,6,3,7>, <4,1,2,3>
- 2230799417U, // <2,4,6,2>: Cost 3 vmrghw <2,6,3,7>, <4,2,5,6>
- 3304541323U, // <2,4,6,3>: Cost 4 vmrghw <2,6,3,7>, <4,3,5,7>
- 2230799568U, // <2,4,6,4>: Cost 3 vmrghw <2,6,3,7>, <4,4,4,4>
- 1157057846U, // <2,4,6,5>: Cost 2 vmrghw <2,6,3,7>, RHS
- 3304541566U, // <2,4,6,6>: Cost 4 vmrghw <2,6,3,7>, <4,6,5,7>
- 3798758243U, // <2,4,6,7>: Cost 4 vsldoi8 <6,7,2,4>, <6,7,2,4>
- 1157058089U, // <2,4,6,u>: Cost 2 vmrghw <2,6,3,7>, RHS
- 3806721018U, // <2,4,7,0>: Cost 4 vsldoi8 <u,1,2,4>, <7,0,1,2>
- 3853831590U, // <2,4,7,1>: Cost 4 vsldoi12 <4,7,1,2>, <4,7,1,2>
- 3801412775U, // <2,4,7,2>: Cost 4 vsldoi8 <7,2,2,4>, <7,2,2,4>
- 3802076408U, // <2,4,7,3>: Cost 4 vsldoi8 <7,3,2,4>, <7,3,2,4>
- 3401436368U, // <2,4,7,4>: Cost 4 vmrglw <7,6,2,7>, <4,4,4,4>
- 2793360840U, // <2,4,7,5>: Cost 3 vsldoi12 <7,0,1,2>, <4,7,5,0>
- 3804067307U, // <2,4,7,6>: Cost 4 vsldoi8 <7,6,2,4>, <7,6,2,4>
- 3867102682U, // <2,4,7,7>: Cost 4 vsldoi12 <7,0,1,2>, <4,7,7,0>
- 2793360867U, // <2,4,7,u>: Cost 3 vsldoi12 <7,0,1,2>, <4,7,u,0>
- 2630877286U, // <2,4,u,0>: Cost 3 vsldoi4 <2,2,4,u>, LHS
- 2282580144U, // <2,4,u,1>: Cost 3 vmrglw LHS, <3,0,4,1>
- 2630878848U, // <2,4,u,2>: Cost 3 vsldoi4 <2,2,4,u>, <2,2,4,u>
- 2636851545U, // <2,4,u,3>: Cost 3 vsldoi4 <3,2,4,u>, <3,2,4,u>
- 1256615120U, // <2,4,u,4>: Cost 2 vmrglw LHS, <4,4,4,4>
- 1208837838U, // <2,4,u,5>: Cost 2 vmrglw LHS, <2,3,4,5>
- 1691160105U, // <2,4,u,6>: Cost 2 vsldoi12 <2,2,2,2>, RHS
- 2660742333U, // <2,4,u,7>: Cost 3 vsldoi4 <7,2,4,u>, <7,2,4,u>
- 1208837841U, // <2,4,u,u>: Cost 2 vmrglw LHS, <2,3,4,u>
- 3766910976U, // <2,5,0,0>: Cost 4 vsldoi8 <1,4,2,5>, <0,0,0,0>
- 2693169254U, // <2,5,0,1>: Cost 3 vsldoi8 <1,4,2,5>, LHS
- 3760939181U, // <2,5,0,2>: Cost 4 vsldoi8 <0,4,2,5>, <0,2,1,2>
- 3843214936U, // <2,5,0,3>: Cost 4 vsldoi12 <3,0,1,2>, <5,0,3,0>
- 3760939355U, // <2,5,0,4>: Cost 4 vsldoi8 <0,4,2,5>, <0,4,2,5>
- 3867102827U, // <2,5,0,5>: Cost 4 vsldoi12 <7,0,1,2>, <5,0,5,1>
- 3867102836U, // <2,5,0,6>: Cost 4 vsldoi12 <7,0,1,2>, <5,0,6,1>
- 3867102844U, // <2,5,0,7>: Cost 4 vsldoi12 <7,0,1,2>, <5,0,7,0>
- 2693169821U, // <2,5,0,u>: Cost 3 vsldoi8 <1,4,2,5>, LHS
- 3766911724U, // <2,5,1,0>: Cost 4 vsldoi8 <1,4,2,5>, <1,0,2,1>
- 3766911796U, // <2,5,1,1>: Cost 4 vsldoi8 <1,4,2,5>, <1,1,1,1>
- 2693170070U, // <2,5,1,2>: Cost 3 vsldoi8 <1,4,2,5>, <1,2,3,0>
- 3384798262U, // <2,5,1,3>: Cost 4 vmrglw <4,u,2,1>, <4,2,5,3>
- 2693170228U, // <2,5,1,4>: Cost 3 vsldoi8 <1,4,2,5>, <1,4,2,5>
- 3301208068U, // <2,5,1,5>: Cost 4 vmrghw <2,1,3,5>, <5,5,5,5>
- 3366879607U, // <2,5,1,6>: Cost 4 vmrglw <1,u,2,1>, <0,4,5,6>
- 3867102925U, // <2,5,1,7>: Cost 4 vsldoi12 <7,0,1,2>, <5,1,7,0>
- 2695824760U, // <2,5,1,u>: Cost 3 vsldoi8 <1,u,2,5>, <1,u,2,5>
- 2642845798U, // <2,5,2,0>: Cost 3 vsldoi4 <4,2,5,2>, LHS
- 2295139218U, // <2,5,2,1>: Cost 3 vmrglw <2,2,2,2>, <4,0,5,1>
- 2699142760U, // <2,5,2,2>: Cost 3 vsldoi8 <2,4,2,5>, <2,2,2,2>
- 3766912678U, // <2,5,2,3>: Cost 4 vsldoi8 <1,4,2,5>, <2,3,0,1>
- 2699142925U, // <2,5,2,4>: Cost 3 vsldoi8 <2,4,2,5>, <2,4,2,5>
- 2228031492U, // <2,5,2,5>: Cost 3 vmrghw <2,2,2,2>, <5,5,5,5>
- 2295138818U, // <2,5,2,6>: Cost 3 vmrglw <2,2,2,2>, <3,4,5,6>
- 3368879347U, // <2,5,2,7>: Cost 4 vmrglw <2,2,2,2>, <1,6,5,7>
- 2295138820U, // <2,5,2,u>: Cost 3 vmrglw <2,2,2,2>, <3,4,5,u>
- 2287184866U, // <2,5,3,0>: Cost 3 vmrglw LHS, <4,1,5,0>
- 1256573842U, // <2,5,3,1>: Cost 2 vmrglw LHS, <4,0,5,1>
- 2642855630U, // <2,5,3,2>: Cost 3 vsldoi4 <4,2,5,3>, <2,3,4,5>
- 2287182763U, // <2,5,3,3>: Cost 3 vmrglw LHS, <1,2,5,3>
- 2287184870U, // <2,5,3,4>: Cost 3 vmrglw LHS, <4,1,5,4>
- 1256574170U, // <2,5,3,5>: Cost 2 vmrglw LHS, <4,4,5,5>
- 1213442562U, // <2,5,3,6>: Cost 2 vmrglw LHS, <3,4,5,6>
- 2287183091U, // <2,5,3,7>: Cost 3 vmrglw LHS, <1,6,5,7>
- 1213442564U, // <2,5,3,u>: Cost 2 vmrglw LHS, <3,4,5,u>
- 3716604006U, // <2,5,4,0>: Cost 4 vsldoi4 <4,2,5,4>, LHS
- 3716604822U, // <2,5,4,1>: Cost 4 vsldoi4 <4,2,5,4>, <1,2,3,0>
- 3766914099U, // <2,5,4,2>: Cost 4 vsldoi8 <1,4,2,5>, <4,2,5,0>
- 3368895403U, // <2,5,4,3>: Cost 5 vmrglw <2,2,2,4>, <1,2,5,3>
- 3716607031U, // <2,5,4,4>: Cost 4 vsldoi4 <4,2,5,4>, <4,2,5,4>
- 2693172534U, // <2,5,4,5>: Cost 3 vsldoi8 <1,4,2,5>, RHS
- 3363588610U, // <2,5,4,6>: Cost 4 vmrglw <1,3,2,4>, <3,4,5,6>
- 3368895731U, // <2,5,4,7>: Cost 5 vmrglw <2,2,2,4>, <1,6,5,7>
- 2693172777U, // <2,5,4,u>: Cost 3 vsldoi8 <1,4,2,5>, RHS
- 3704668262U, // <2,5,5,0>: Cost 4 vsldoi4 <2,2,5,5>, LHS
- 3704669078U, // <2,5,5,1>: Cost 4 vsldoi4 <2,2,5,5>, <1,2,3,0>
- 3704669830U, // <2,5,5,2>: Cost 4 vsldoi4 <2,2,5,5>, <2,2,5,5>
- 3364259460U, // <2,5,5,3>: Cost 4 vmrglw <1,4,2,5>, <2,2,5,3>
- 3704671542U, // <2,5,5,4>: Cost 4 vsldoi4 <2,2,5,5>, RHS
- 2793361412U, // <2,5,5,5>: Cost 3 vsldoi12 <7,0,1,2>, <5,5,5,5>
- 3364258167U, // <2,5,5,6>: Cost 4 vmrglw <1,4,2,5>, <0,4,5,6>
- 3867103249U, // <2,5,5,7>: Cost 4 vsldoi12 <7,0,1,2>, <5,5,7,0>
- 2793361412U, // <2,5,5,u>: Cost 3 vsldoi12 <7,0,1,2>, <5,5,5,5>
- 2642878566U, // <2,5,6,0>: Cost 3 vsldoi4 <4,2,5,6>, LHS
- 3386166810U, // <2,5,6,1>: Cost 4 vmrglw <5,1,2,6>, <4,u,5,1>
- 2723033594U, // <2,5,6,2>: Cost 3 vsldoi8 <6,4,2,5>, <6,2,7,3>
- 3848523842U, // <2,5,6,3>: Cost 4 vsldoi12 <3,u,1,2>, <5,6,3,4>
- 2723033713U, // <2,5,6,4>: Cost 3 vsldoi8 <6,4,2,5>, <6,4,2,5>
- 2230800388U, // <2,5,6,5>: Cost 3 vmrghw <2,6,3,7>, <5,5,5,5>
- 2230800482U, // <2,5,6,6>: Cost 3 vmrghw <2,6,3,7>, <5,6,7,0>
- 2785841252U, // <2,5,6,7>: Cost 3 vsldoi12 <5,6,7,2>, <5,6,7,2>
- 2785914989U, // <2,5,6,u>: Cost 3 vsldoi12 <5,6,u,2>, <5,6,u,2>
- 3796775930U, // <2,5,7,0>: Cost 4 vsldoi8 <6,4,2,5>, <7,0,1,2>
- 3800757335U, // <2,5,7,1>: Cost 4 vsldoi8 <7,1,2,5>, <7,1,2,5>
- 3853463689U, // <2,5,7,2>: Cost 4 vsldoi12 <4,6,5,2>, <5,7,2,3>
- 3796776218U, // <2,5,7,3>: Cost 4 vsldoi8 <6,4,2,5>, <7,3,6,2>
- 3796776294U, // <2,5,7,4>: Cost 4 vsldoi8 <6,4,2,5>, <7,4,5,6>
- 3803411867U, // <2,5,7,5>: Cost 4 vsldoi8 <7,5,2,5>, <7,5,2,5>
- 3371575081U, // <2,5,7,6>: Cost 4 vmrglw <2,6,2,7>, <2,4,5,6>
- 3796776516U, // <2,5,7,7>: Cost 4 vsldoi8 <6,4,2,5>, <7,7,3,3>
- 3371575083U, // <2,5,7,u>: Cost 4 vmrglw <2,6,2,7>, <2,4,5,u>
- 2287225826U, // <2,5,u,0>: Cost 3 vmrglw LHS, <4,1,5,0>
- 1256614802U, // <2,5,u,1>: Cost 2 vmrglw LHS, <4,0,5,1>
- 2642896590U, // <2,5,u,2>: Cost 3 vsldoi4 <4,2,5,u>, <2,3,4,5>
- 2287223723U, // <2,5,u,3>: Cost 3 vmrglw LHS, <1,2,5,3>
- 2287225830U, // <2,5,u,4>: Cost 3 vmrglw LHS, <4,1,5,4>
- 1256615130U, // <2,5,u,5>: Cost 2 vmrglw LHS, <4,4,5,5>
- 1208838658U, // <2,5,u,6>: Cost 2 vmrglw LHS, <3,4,5,6>
- 2287224051U, // <2,5,u,7>: Cost 3 vmrglw LHS, <1,6,5,7>
- 1208838660U, // <2,5,u,u>: Cost 2 vmrglw LHS, <3,4,5,u>
- 3772227584U, // <2,6,0,0>: Cost 4 vsldoi8 <2,3,2,6>, <0,0,0,0>
- 2698485862U, // <2,6,0,1>: Cost 3 vsldoi8 <2,3,2,6>, LHS
- 3759620282U, // <2,6,0,2>: Cost 4 vsldoi8 <0,2,2,6>, <0,2,2,6>
- 3710675299U, // <2,6,0,3>: Cost 4 vsldoi4 <3,2,6,0>, <3,2,6,0>
- 3767583058U, // <2,6,0,4>: Cost 4 vsldoi8 <1,5,2,6>, <0,4,1,5>
- 3378153265U, // <2,6,0,5>: Cost 5 vmrglw <3,7,2,0>, <2,4,6,5>
- 3865186637U, // <2,6,0,6>: Cost 4 vsldoi12 <6,6,2,2>, <6,0,6,1>
- 2330291510U, // <2,6,0,7>: Cost 3 vmrglw <u,1,2,0>, RHS
- 2698486429U, // <2,6,0,u>: Cost 3 vsldoi8 <2,3,2,6>, LHS
- 3734569062U, // <2,6,1,0>: Cost 4 vsldoi4 <7,2,6,1>, LHS
- 3764929346U, // <2,6,1,1>: Cost 4 vsldoi8 <1,1,2,6>, <1,1,2,6>
- 3772228502U, // <2,6,1,2>: Cost 4 vsldoi8 <2,3,2,6>, <1,2,3,0>
- 3734571158U, // <2,6,1,3>: Cost 4 vsldoi4 <7,2,6,1>, <3,0,1,2>
- 3734572342U, // <2,6,1,4>: Cost 4 vsldoi4 <7,2,6,1>, RHS
- 3767583878U, // <2,6,1,5>: Cost 4 vsldoi8 <1,5,2,6>, <1,5,2,6>
- 3768247511U, // <2,6,1,6>: Cost 4 vsldoi8 <1,6,2,6>, <1,6,2,6>
- 2293140790U, // <2,6,1,7>: Cost 3 vmrglw <1,u,2,1>, RHS
- 2293140791U, // <2,6,1,u>: Cost 3 vmrglw <1,u,2,1>, RHS
- 3704717414U, // <2,6,2,0>: Cost 4 vsldoi4 <2,2,6,2>, LHS
- 3395424589U, // <2,6,2,1>: Cost 4 vmrglw <6,6,2,2>, <6,0,6,1>
- 2228031993U, // <2,6,2,2>: Cost 3 vmrghw <2,2,2,2>, <6,2,7,2>
- 2698487485U, // <2,6,2,3>: Cost 3 vsldoi8 <2,3,2,6>, <2,3,2,6>
- 3704720694U, // <2,6,2,4>: Cost 4 vsldoi4 <2,2,6,2>, RHS
- 3773556575U, // <2,6,2,5>: Cost 4 vsldoi8 <2,5,2,6>, <2,5,2,6>
- 2698487738U, // <2,6,2,6>: Cost 3 vsldoi8 <2,3,2,6>, <2,6,3,7>
- 1221397814U, // <2,6,2,7>: Cost 2 vmrglw <2,2,2,2>, RHS
- 1221397815U, // <2,6,2,u>: Cost 2 vmrglw <2,2,2,2>, RHS
- 2636955750U, // <2,6,3,0>: Cost 3 vsldoi4 <3,2,6,3>, LHS
- 2330314217U, // <2,6,3,1>: Cost 3 vmrglw LHS, <2,0,6,1>
- 2636957626U, // <2,6,3,2>: Cost 3 vsldoi4 <3,2,6,3>, <2,6,3,7>
- 2287184230U, // <2,6,3,3>: Cost 3 vmrglw LHS, <3,2,6,3>
- 2636959030U, // <2,6,3,4>: Cost 3 vsldoi4 <3,2,6,3>, RHS
- 2648903448U, // <2,6,3,5>: Cost 3 vsldoi4 <5,2,6,3>, <5,2,6,3>
- 1256575800U, // <2,6,3,6>: Cost 2 vmrglw LHS, <6,6,6,6>
- 135056694U, // <2,6,3,7>: Cost 1 vmrglw LHS, RHS
- 135056695U, // <2,6,3,u>: Cost 1 vmrglw LHS, RHS
- 3710705766U, // <2,6,4,0>: Cost 4 vsldoi4 <3,2,6,4>, LHS
- 3698762677U, // <2,6,4,1>: Cost 5 vsldoi4 <1,2,6,4>, <1,2,6,4>
- 3710707389U, // <2,6,4,2>: Cost 4 vsldoi4 <3,2,6,4>, <2,3,2,6>
- 3710708071U, // <2,6,4,3>: Cost 4 vsldoi4 <3,2,6,4>, <3,2,6,4>
- 3710709046U, // <2,6,4,4>: Cost 4 vsldoi4 <3,2,6,4>, RHS
- 2698489142U, // <2,6,4,5>: Cost 3 vsldoi8 <2,3,2,6>, RHS
- 3796782457U, // <2,6,4,6>: Cost 4 vsldoi8 <6,4,2,6>, <4,6,5,2>
- 2295156022U, // <2,6,4,7>: Cost 3 vmrglw <2,2,2,4>, RHS
- 2295156023U, // <2,6,4,u>: Cost 3 vmrglw <2,2,2,4>, RHS
- 3303870753U, // <2,6,5,0>: Cost 4 vmrghw <2,5,3,6>, <6,0,1,2>
- 3788820134U, // <2,6,5,1>: Cost 4 vsldoi8 <5,1,2,6>, <5,1,2,6>
- 3779530520U, // <2,6,5,2>: Cost 4 vsldoi8 <3,5,2,6>, <5,2,6,3>
- 3303871026U, // <2,6,5,3>: Cost 4 vmrghw <2,5,3,6>, <6,3,4,5>
- 3303871117U, // <2,6,5,4>: Cost 4 vmrghw <2,5,3,6>, <6,4,5,6>
- 3791474666U, // <2,6,5,5>: Cost 4 vsldoi8 <5,5,2,6>, <5,5,2,6>
- 3792138299U, // <2,6,5,6>: Cost 4 vsldoi8 <5,6,2,6>, <5,6,2,6>
- 2290519350U, // <2,6,5,7>: Cost 3 vmrglw <1,4,2,5>, RHS
- 2290519351U, // <2,6,5,u>: Cost 3 vmrglw <1,4,2,5>, RHS
- 2631008358U, // <2,6,6,0>: Cost 3 vsldoi4 <2,2,6,6>, LHS
- 3372893673U, // <2,6,6,1>: Cost 4 vmrglw <2,u,2,6>, <2,0,6,1>
- 2791445264U, // <2,6,6,2>: Cost 3 vsldoi12 <6,6,2,2>, <6,6,2,2>
- 2230800968U, // <2,6,6,3>: Cost 3 vmrghw <2,6,3,7>, <6,3,7,0>
- 2631011638U, // <2,6,6,4>: Cost 3 vsldoi4 <2,2,6,6>, RHS
- 3372894001U, // <2,6,6,5>: Cost 4 vmrglw <2,u,2,6>, <2,4,6,5>
- 2793362232U, // <2,6,6,6>: Cost 3 vsldoi12 <7,0,1,2>, <6,6,6,6>
- 2295835958U, // <2,6,6,7>: Cost 3 vmrglw <2,3,2,6>, RHS
- 2295835959U, // <2,6,6,u>: Cost 3 vmrglw <2,3,2,6>, RHS
- 2793362254U, // <2,6,7,0>: Cost 3 vsldoi12 <7,0,1,2>, <6,7,0,1>
- 2792035160U, // <2,6,7,1>: Cost 3 vsldoi12 <6,7,1,2>, <6,7,1,2>
- 2792108897U, // <2,6,7,2>: Cost 3 vsldoi12 <6,7,2,2>, <6,7,2,2>
- 2769474408U, // <2,6,7,3>: Cost 3 vsldoi12 <3,0,1,2>, <6,7,3,0>
- 2793362294U, // <2,6,7,4>: Cost 3 vsldoi12 <7,0,1,2>, <6,7,4,5>
- 3371575089U, // <2,6,7,5>: Cost 4 vmrglw <2,6,2,7>, <2,4,6,5>
- 2792403845U, // <2,6,7,6>: Cost 3 vsldoi12 <6,7,6,2>, <6,7,6,2>
- 2297834806U, // <2,6,7,7>: Cost 3 vmrglw <2,6,2,7>, RHS
- 2297834807U, // <2,6,7,u>: Cost 3 vmrglw <2,6,2,7>, RHS
- 2636996710U, // <2,6,u,0>: Cost 3 vsldoi4 <3,2,6,u>, LHS
- 2698491694U, // <2,6,u,1>: Cost 3 vsldoi8 <2,3,2,6>, LHS
- 2636998631U, // <2,6,u,2>: Cost 3 vsldoi4 <3,2,6,u>, <2,6,u,7>
- 2282580326U, // <2,6,u,3>: Cost 3 vmrglw LHS, <3,2,6,3>
- 2636999990U, // <2,6,u,4>: Cost 3 vsldoi4 <3,2,6,u>, RHS
- 2698492058U, // <2,6,u,5>: Cost 3 vsldoi8 <2,3,2,6>, RHS
- 1256616760U, // <2,6,u,6>: Cost 2 vmrglw LHS, <6,6,6,6>
- 135097654U, // <2,6,u,7>: Cost 1 vmrglw LHS, RHS
- 135097655U, // <2,6,u,u>: Cost 1 vmrglw LHS, RHS
- 2666864742U, // <2,7,0,0>: Cost 3 vsldoi4 <u,2,7,0>, LHS
- 1719620602U, // <2,7,0,1>: Cost 2 vsldoi12 <7,0,1,2>, <7,0,1,2>
- 3768254637U, // <2,7,0,2>: Cost 4 vsldoi8 <1,6,2,7>, <0,2,1,2>
- 3393417722U, // <2,7,0,3>: Cost 4 vmrglw <6,3,2,0>, <6,2,7,3>
- 2666868022U, // <2,7,0,4>: Cost 3 vsldoi4 <u,2,7,0>, RHS
- 3867104290U, // <2,7,0,5>: Cost 4 vsldoi12 <7,0,1,2>, <7,0,5,6>
- 3728667127U, // <2,7,0,6>: Cost 4 vsldoi4 <6,2,7,0>, <6,2,7,0>
- 2666869817U, // <2,7,0,7>: Cost 3 vsldoi4 <u,2,7,0>, <7,0,u,2>
- 1720136761U, // <2,7,0,u>: Cost 2 vsldoi12 <7,0,u,2>, <7,0,u,2>
- 3728670822U, // <2,7,1,0>: Cost 4 vsldoi4 <6,2,7,1>, LHS
- 3774227252U, // <2,7,1,1>: Cost 4 vsldoi8 <2,6,2,7>, <1,1,1,1>
- 3774227350U, // <2,7,1,2>: Cost 4 vsldoi8 <2,6,2,7>, <1,2,3,0>
- 2323001850U, // <2,7,1,3>: Cost 3 vmrglw <6,u,2,1>, <6,2,7,3>
- 3728674102U, // <2,7,1,4>: Cost 4 vsldoi4 <6,2,7,1>, RHS
- 3774227567U, // <2,7,1,5>: Cost 5 vsldoi8 <2,6,2,7>, <1,5,0,1>
- 2694513880U, // <2,7,1,6>: Cost 3 vsldoi8 <1,6,2,7>, <1,6,2,7>
- 3396744002U, // <2,7,1,7>: Cost 4 vmrglw <6,u,2,1>, <6,6,7,7>
- 2323001850U, // <2,7,1,u>: Cost 3 vmrglw <6,u,2,1>, <6,2,7,3>
- 2654937190U, // <2,7,2,0>: Cost 3 vsldoi4 <6,2,7,2>, LHS
- 3728679732U, // <2,7,2,1>: Cost 4 vsldoi4 <6,2,7,2>, <1,1,1,1>
- 2700486248U, // <2,7,2,2>: Cost 3 vsldoi8 <2,6,2,7>, <2,2,2,2>
- 2321682938U, // <2,7,2,3>: Cost 3 vmrglw <6,6,2,2>, <6,2,7,3>
- 2654940470U, // <2,7,2,4>: Cost 3 vsldoi4 <6,2,7,2>, RHS
- 3859584196U, // <2,7,2,5>: Cost 4 vsldoi12 <5,6,7,2>, <7,2,5,6>
- 2700486577U, // <2,7,2,6>: Cost 3 vsldoi8 <2,6,2,7>, <2,6,2,7>
- 2228033132U, // <2,7,2,7>: Cost 3 vmrghw <2,2,2,2>, <7,7,7,7>
- 2701813843U, // <2,7,2,u>: Cost 3 vsldoi8 <2,u,2,7>, <2,u,2,7>
- 1581203558U, // <2,7,3,0>: Cost 2 vsldoi4 <6,2,7,3>, LHS
- 2654946100U, // <2,7,3,1>: Cost 3 vsldoi4 <6,2,7,3>, <1,1,1,1>
- 2637031354U, // <2,7,3,2>: Cost 3 vsldoi4 <3,2,7,3>, <2,6,3,7>
- 1256575482U, // <2,7,3,3>: Cost 2 vmrglw LHS, <6,2,7,3>
- 1581206838U, // <2,7,3,4>: Cost 2 vsldoi4 <6,2,7,3>, RHS
- 2654949380U, // <2,7,3,5>: Cost 3 vsldoi4 <6,2,7,3>, <5,5,5,5>
- 1581208058U, // <2,7,3,6>: Cost 2 vsldoi4 <6,2,7,3>, <6,2,7,3>
- 1256575810U, // <2,7,3,7>: Cost 2 vmrglw LHS, <6,6,7,7>
- 1581209390U, // <2,7,3,u>: Cost 2 vsldoi4 <6,2,7,3>, LHS
- 3728695398U, // <2,7,4,0>: Cost 4 vsldoi4 <6,2,7,4>, LHS
- 3869758782U, // <2,7,4,1>: Cost 4 vsldoi12 <7,4,1,2>, <7,4,1,2>
- 3728696936U, // <2,7,4,2>: Cost 4 vsldoi4 <6,2,7,4>, <2,2,2,2>
- 3393450490U, // <2,7,4,3>: Cost 4 vmrglw <6,3,2,4>, <6,2,7,3>
- 3728698678U, // <2,7,4,4>: Cost 4 vsldoi4 <6,2,7,4>, RHS
- 2700487990U, // <2,7,4,5>: Cost 3 vsldoi8 <2,6,2,7>, RHS
- 3728699899U, // <2,7,4,6>: Cost 4 vsldoi4 <6,2,7,4>, <6,2,7,4>
- 3867104626U, // <2,7,4,7>: Cost 4 vsldoi12 <7,0,1,2>, <7,4,7,0>
- 2700488233U, // <2,7,4,u>: Cost 3 vsldoi8 <2,6,2,7>, RHS
- 3855160709U, // <2,7,5,0>: Cost 4 vsldoi12 <5,0,1,2>, <7,5,0,1>
- 3728704406U, // <2,7,5,1>: Cost 4 vsldoi4 <6,2,7,5>, <1,2,3,0>
- 3370233956U, // <2,7,5,2>: Cost 4 vmrglw <2,4,2,5>, <5,6,7,2>
- 2320380410U, // <2,7,5,3>: Cost 3 vmrglw <6,4,2,5>, <6,2,7,3>
- 3728706870U, // <2,7,5,4>: Cost 4 vsldoi4 <6,2,7,5>, RHS
- 3867104694U, // <2,7,5,5>: Cost 4 vsldoi12 <7,0,1,2>, <7,5,5,5>
- 3792146492U, // <2,7,5,6>: Cost 4 vsldoi8 <5,6,2,7>, <5,6,2,7>
- 3394122562U, // <2,7,5,7>: Cost 4 vmrglw <6,4,2,5>, <6,6,7,7>
- 2320380410U, // <2,7,5,u>: Cost 3 vmrglw <6,4,2,5>, <6,2,7,3>
- 2230801402U, // <2,7,6,0>: Cost 3 vmrghw <2,6,3,7>, <7,0,1,2>
- 3768258984U, // <2,7,6,1>: Cost 4 vsldoi8 <1,6,2,7>, <6,1,7,2>
- 2730349050U, // <2,7,6,2>: Cost 3 vsldoi8 <7,6,2,7>, <6,2,7,3>
- 3372894575U, // <2,7,6,3>: Cost 4 vmrglw <2,u,2,6>, <3,2,7,3>
- 2230801766U, // <2,7,6,4>: Cost 3 vmrghw <2,6,3,7>, <7,4,5,6>
- 3304543670U, // <2,7,6,5>: Cost 4 vmrghw <2,6,3,7>, <7,5,5,5>
- 3728716285U, // <2,7,6,6>: Cost 4 vsldoi4 <6,2,7,6>, <6,2,7,6>
- 2230802028U, // <2,7,6,7>: Cost 3 vmrghw <2,6,3,7>, <7,7,7,7>
- 2730349050U, // <2,7,6,u>: Cost 3 vsldoi8 <7,6,2,7>, <6,2,7,3>
- 2793362983U, // <2,7,7,0>: Cost 3 vsldoi12 <7,0,1,2>, <7,7,0,1>
- 3728721112U, // <2,7,7,1>: Cost 4 vsldoi4 <6,2,7,7>, <1,6,2,7>
- 3371574933U, // <2,7,7,2>: Cost 4 vmrglw <2,6,2,7>, <2,2,7,2>
- 2327695866U, // <2,7,7,3>: Cost 3 vmrglw <7,6,2,7>, <6,2,7,3>
- 3728723254U, // <2,7,7,4>: Cost 4 vsldoi4 <6,2,7,7>, RHS
- 3371574855U, // <2,7,7,5>: Cost 5 vmrglw <2,6,2,7>, <2,1,7,5>
- 2730350062U, // <2,7,7,6>: Cost 3 vsldoi8 <7,6,2,7>, <7,6,2,7>
- 2793363052U, // <2,7,7,7>: Cost 3 vsldoi12 <7,0,1,2>, <7,7,7,7>
- 2798671471U, // <2,7,7,u>: Cost 3 vsldoi12 <7,u,1,2>, <7,7,u,1>
- 1581244518U, // <2,7,u,0>: Cost 2 vsldoi4 <6,2,7,u>, LHS
- 1724929666U, // <2,7,u,1>: Cost 2 vsldoi12 <7,u,1,2>, <7,u,1,2>
- 2637072314U, // <2,7,u,2>: Cost 3 vsldoi4 <3,2,7,u>, <2,6,3,7>
- 1256616442U, // <2,7,u,3>: Cost 2 vmrglw LHS, <6,2,7,3>
- 1581247798U, // <2,7,u,4>: Cost 2 vsldoi4 <6,2,7,u>, RHS
- 2700490906U, // <2,7,u,5>: Cost 3 vsldoi8 <2,6,2,7>, RHS
- 1581249023U, // <2,7,u,6>: Cost 2 vsldoi4 <6,2,7,u>, <6,2,7,u>
- 1256616770U, // <2,7,u,7>: Cost 2 vmrglw LHS, <6,6,7,7>
- 1581250350U, // <2,7,u,u>: Cost 2 vsldoi4 <6,2,7,u>, LHS
- 1611489280U, // <2,u,0,0>: Cost 2 vsldoi8 LHS, <0,0,0,0>
- 537747563U, // <2,u,0,1>: Cost 1 vsldoi8 LHS, LHS
- 2685231277U, // <2,u,0,2>: Cost 3 vsldoi8 LHS, <0,2,1,2>
- 2685231356U, // <2,u,0,3>: Cost 3 vsldoi8 LHS, <0,3,1,0>
- 1611489618U, // <2,u,0,4>: Cost 2 vsldoi8 LHS, <0,4,1,5>
- 2226763930U, // <2,u,0,5>: Cost 3 vmrghw <2,0,3,0>, RHS
- 2733007350U, // <2,u,0,6>: Cost 3 vsldoi8 LHS, <0,6,1,7>
- 2660971737U, // <2,u,0,7>: Cost 3 vsldoi4 <7,2,u,0>, <7,2,u,0>
- 537748125U, // <2,u,0,u>: Cost 1 vsldoi8 LHS, LHS
- 2689876708U, // <2,u,1,0>: Cost 3 vsldoi8 LHS, <1,0,1,2>
- 1611490100U, // <2,u,1,1>: Cost 2 vsldoi8 LHS, <1,1,1,1>
- 1611490198U, // <2,u,1,2>: Cost 2 vsldoi8 LHS, <1,2,3,0>
- 2293137564U, // <2,u,1,3>: Cost 3 vmrglw <1,u,2,1>, LHS
- 2689877072U, // <2,u,1,4>: Cost 3 vsldoi8 LHS, <1,4,5,6>
- 2689877103U, // <2,u,1,5>: Cost 3 vsldoi8 LHS, <1,5,0,1>
- 2689877199U, // <2,u,1,6>: Cost 3 vsldoi8 LHS, <1,6,1,7>
- 2293140808U, // <2,u,1,7>: Cost 3 vmrglw <1,u,2,1>, RHS
- 1616135548U, // <2,u,1,u>: Cost 2 vsldoi8 LHS, <1,u,3,0>
- 1556938854U, // <2,u,2,0>: Cost 2 vsldoi4 <2,2,2,2>, LHS
- 1154291502U, // <2,u,2,1>: Cost 2 vmrghw <2,2,2,2>, LHS
- 336380006U, // <2,u,2,2>: Cost 1 vspltisw2 LHS
- 1611490982U, // <2,u,2,3>: Cost 2 vsldoi8 LHS, <2,3,0,1>
- 1556942134U, // <2,u,2,4>: Cost 2 vsldoi4 <2,2,2,2>, RHS
- 1154291866U, // <2,u,2,5>: Cost 2 vmrghw <2,2,2,2>, RHS
- 1611491258U, // <2,u,2,6>: Cost 2 vsldoi8 LHS, <2,6,3,7>
- 1221397832U, // <2,u,2,7>: Cost 2 vmrglw <2,2,2,2>, RHS
- 336380006U, // <2,u,2,u>: Cost 1 vspltisw2 LHS
- 1611491478U, // <2,u,3,0>: Cost 2 vsldoi8 LHS, <3,0,1,2>
- 1213440073U, // <2,u,3,1>: Cost 2 vmrglw LHS, <0,0,u,1>
- 1213442261U, // <2,u,3,2>: Cost 2 vmrglw LHS, <3,0,u,2>
- 135053468U, // <2,u,3,3>: Cost 1 vmrglw LHS, LHS
- 1611491842U, // <2,u,3,4>: Cost 2 vsldoi8 LHS, <3,4,5,6>
- 1213440401U, // <2,u,3,5>: Cost 2 vmrglw LHS, <0,4,u,5>
- 1213442589U, // <2,u,3,6>: Cost 2 vmrglw LHS, <3,4,u,6>
- 135056712U, // <2,u,3,7>: Cost 1 vmrglw LHS, RHS
- 135053473U, // <2,u,3,u>: Cost 1 vmrglw LHS, LHS
- 1551425638U, // <2,u,4,0>: Cost 2 vsldoi4 <1,2,u,4>, LHS
- 1551426503U, // <2,u,4,1>: Cost 2 vsldoi4 <1,2,u,4>, <1,2,u,4>
- 2625169000U, // <2,u,4,2>: Cost 3 vsldoi4 <1,2,u,4>, <2,2,2,2>
- 2625169558U, // <2,u,4,3>: Cost 3 vsldoi4 <1,2,u,4>, <3,0,1,2>
- 1551428918U, // <2,u,4,4>: Cost 2 vsldoi4 <1,2,u,4>, RHS
- 537750838U, // <2,u,4,5>: Cost 1 vsldoi8 LHS, RHS
- 2733010297U, // <2,u,4,6>: Cost 3 vsldoi8 LHS, <4,6,5,2>
- 2295156040U, // <2,u,4,7>: Cost 3 vmrglw <2,2,2,4>, RHS
- 537751081U, // <2,u,4,u>: Cost 1 vsldoi8 LHS, RHS
- 2689879624U, // <2,u,5,0>: Cost 3 vsldoi8 LHS, <5,0,1,2>
- 2230130478U, // <2,u,5,1>: Cost 3 vmrghw <2,5,3,6>, LHS
- 2631149217U, // <2,u,5,2>: Cost 3 vsldoi4 <2,2,u,5>, <2,2,u,5>
- 2290516124U, // <2,u,5,3>: Cost 3 vmrglw <1,4,2,5>, LHS
- 2689879988U, // <2,u,5,4>: Cost 3 vsldoi8 LHS, <5,4,5,6>
- 1659269124U, // <2,u,5,5>: Cost 2 vsldoi8 LHS, <5,5,5,5>
- 1691162778U, // <2,u,5,6>: Cost 2 vsldoi12 <2,2,2,2>, RHS
- 2290519368U, // <2,u,5,7>: Cost 3 vmrglw <1,4,2,5>, RHS
- 1691162796U, // <2,u,5,u>: Cost 2 vsldoi12 <2,2,2,2>, RHS
- 2230802131U, // <2,u,6,0>: Cost 3 vmrghw <2,6,3,7>, <u,0,1,2>
- 1157060398U, // <2,u,6,1>: Cost 2 vmrghw <2,6,3,7>, LHS
- 1659269626U, // <2,u,6,2>: Cost 2 vsldoi8 LHS, <6,2,7,3>
- 2764904656U, // <2,u,6,3>: Cost 3 vsldoi12 <2,2,2,2>, <u,6,3,7>
- 2230802495U, // <2,u,6,4>: Cost 3 vmrghw <2,6,3,7>, <u,4,5,6>
- 1157060762U, // <2,u,6,5>: Cost 2 vmrghw <2,6,3,7>, RHS
- 1659269944U, // <2,u,6,6>: Cost 2 vsldoi8 LHS, <6,6,6,6>
- 1659269966U, // <2,u,6,7>: Cost 2 vsldoi8 LHS, <6,7,0,1>
- 1157060965U, // <2,u,6,u>: Cost 2 vmrghw <2,6,3,7>, LHS
- 1659270138U, // <2,u,7,0>: Cost 2 vsldoi8 LHS, <7,0,1,2>
- 2727040090U, // <2,u,7,1>: Cost 3 vsldoi8 <7,1,2,u>, <7,1,2,u>
- 2727703723U, // <2,u,7,2>: Cost 3 vsldoi8 <7,2,2,u>, <7,2,2,u>
- 2297831580U, // <2,u,7,3>: Cost 3 vmrglw <2,6,2,7>, LHS
- 1659270502U, // <2,u,7,4>: Cost 2 vsldoi8 LHS, <7,4,5,6>
- 2733012406U, // <2,u,7,5>: Cost 3 vsldoi8 LHS, <7,5,5,5>
- 2730358255U, // <2,u,7,6>: Cost 3 vsldoi8 <7,6,2,u>, <7,6,2,u>
- 1659270764U, // <2,u,7,7>: Cost 2 vsldoi8 LHS, <7,7,7,7>
- 1659270786U, // <2,u,7,u>: Cost 2 vsldoi8 LHS, <7,u,1,2>
- 1213481923U, // <2,u,u,0>: Cost 2 vmrglw LHS, <1,2,u,0>
- 537753390U, // <2,u,u,1>: Cost 1 vsldoi8 LHS, LHS
- 336380006U, // <2,u,u,2>: Cost 1 vspltisw2 LHS
- 135094428U, // <2,u,u,3>: Cost 1 vmrglw LHS, LHS
- 1213481927U, // <2,u,u,4>: Cost 2 vmrglw LHS, <1,2,u,4>
- 537753754U, // <2,u,u,5>: Cost 1 vsldoi8 LHS, RHS
- 1208838685U, // <2,u,u,6>: Cost 2 vmrglw LHS, <3,4,u,6>
- 135097672U, // <2,u,u,7>: Cost 1 vmrglw LHS, RHS
- 135094433U, // <2,u,u,u>: Cost 1 vmrglw LHS, LHS
- 1678557184U, // <3,0,0,0>: Cost 2 vsldoi12 LHS, <0,0,0,0>
- 1678557194U, // <3,0,0,1>: Cost 2 vsldoi12 LHS, <0,0,1,1>
- 2631181989U, // <3,0,0,2>: Cost 3 vsldoi4 <2,3,0,0>, <2,3,0,0>
- 2289223984U, // <3,0,0,3>: Cost 3 vmrglw <1,2,3,0>, <3,2,0,3>
- 2756943909U, // <3,0,0,4>: Cost 3 vsldoi12 LHS, <0,0,4,1>
- 3362965729U, // <3,0,0,5>: Cost 4 vmrglw <1,2,3,0>, <3,1,0,5>
- 3362966054U, // <3,0,0,6>: Cost 4 vmrglw <1,2,3,0>, <3,5,0,6>
- 2289224312U, // <3,0,0,7>: Cost 3 vmrglw <1,2,3,0>, <3,6,0,7>
- 1683202121U, // <3,0,0,u>: Cost 2 vsldoi12 LHS, <0,0,u,1>
- 1557446758U, // <3,0,1,0>: Cost 2 vsldoi4 <2,3,0,1>, LHS
- 2752741467U, // <3,0,1,1>: Cost 3 vsldoi12 LHS, <0,1,1,1>
- 604815462U, // <3,0,1,2>: Cost 1 vsldoi12 LHS, LHS
- 2631190676U, // <3,0,1,3>: Cost 3 vsldoi4 <2,3,0,1>, <3,0,1,0>
- 1557450038U, // <3,0,1,4>: Cost 2 vsldoi4 <2,3,0,1>, RHS
- 2667024388U, // <3,0,1,5>: Cost 3 vsldoi4 <u,3,0,1>, <5,5,5,5>
- 2800074894U, // <3,0,1,6>: Cost 3 vsldoi12 LHS, <0,1,6,7>
- 2661053667U, // <3,0,1,7>: Cost 3 vsldoi4 <7,3,0,1>, <7,3,0,1>
- 604815516U, // <3,0,1,u>: Cost 1 vsldoi12 LHS, LHS
- 2696521165U, // <3,0,2,0>: Cost 3 vsldoi8 <2,0,3,0>, <2,0,3,0>
- 2752741549U, // <3,0,2,1>: Cost 3 vsldoi12 LHS, <0,2,1,2>
- 2691876456U, // <3,0,2,2>: Cost 3 vsldoi8 <1,2,3,0>, <2,2,2,2>
- 2691876518U, // <3,0,2,3>: Cost 3 vsldoi8 <1,2,3,0>, <2,3,0,1>
- 3830685895U, // <3,0,2,4>: Cost 4 vsldoi12 LHS, <0,2,4,1>
- 3765618536U, // <3,0,2,5>: Cost 4 vsldoi8 <1,2,3,0>, <2,5,3,6>
- 2691876794U, // <3,0,2,6>: Cost 3 vsldoi8 <1,2,3,0>, <2,6,3,7>
- 2701166596U, // <3,0,2,7>: Cost 3 vsldoi8 <2,7,3,0>, <2,7,3,0>
- 2756944108U, // <3,0,2,u>: Cost 3 vsldoi12 LHS, <0,2,u,2>
- 2691877014U, // <3,0,3,0>: Cost 3 vsldoi8 <1,2,3,0>, <3,0,1,2>
- 1161003110U, // <3,0,3,1>: Cost 2 vmrghw <3,3,3,3>, LHS
- 2691877168U, // <3,0,3,2>: Cost 3 vsldoi8 <1,2,3,0>, <3,2,0,3>
- 2691877246U, // <3,0,3,3>: Cost 3 vsldoi8 <1,2,3,0>, <3,3,0,0>
- 2691877378U, // <3,0,3,4>: Cost 3 vsldoi8 <1,2,3,0>, <3,4,5,6>
- 3765619238U, // <3,0,3,5>: Cost 4 vsldoi8 <1,2,3,0>, <3,5,0,6>
- 2691877496U, // <3,0,3,6>: Cost 3 vsldoi8 <1,2,3,0>, <3,6,0,7>
- 3368962680U, // <3,0,3,7>: Cost 4 vmrglw <2,2,3,3>, <3,6,0,7>
- 1161003677U, // <3,0,3,u>: Cost 2 vmrghw <3,3,3,3>, LHS
- 2289254400U, // <3,0,4,0>: Cost 3 vmrglw <1,2,3,4>, <0,0,0,0>
- 1678557522U, // <3,0,4,1>: Cost 2 vsldoi12 LHS, <0,4,1,5>
- 2631214761U, // <3,0,4,2>: Cost 3 vsldoi4 <2,3,0,4>, <2,3,0,4>
- 2235580672U, // <3,0,4,3>: Cost 3 vmrghw <3,4,5,6>, <0,3,1,4>
- 2756944237U, // <3,0,4,4>: Cost 3 vsldoi12 LHS, <0,4,4,5>
- 1618136374U, // <3,0,4,5>: Cost 2 vsldoi8 <1,2,3,0>, RHS
- 3309322742U, // <3,0,4,6>: Cost 4 vmrghw <3,4,5,6>, <0,6,1,7>
- 3362998904U, // <3,0,4,7>: Cost 4 vmrglw <1,2,3,4>, <3,6,0,7>
- 1683202449U, // <3,0,4,u>: Cost 2 vsldoi12 LHS, <0,4,u,5>
- 3765620296U, // <3,0,5,0>: Cost 4 vsldoi8 <1,2,3,0>, <5,0,1,2>
- 2752299427U, // <3,0,5,1>: Cost 3 vsldoi12 LHS, <0,5,1,5>
- 3789508346U, // <3,0,5,2>: Cost 4 vsldoi8 <5,2,3,0>, <5,2,3,0>
- 3403486842U, // <3,0,5,3>: Cost 4 vmrglw <u,0,3,5>, <7,u,0,3>
- 3765620660U, // <3,0,5,4>: Cost 4 vsldoi8 <1,2,3,0>, <5,4,5,6>
- 2733682692U, // <3,0,5,5>: Cost 3 vsldoi8 <u,2,3,0>, <5,5,5,5>
- 2800075218U, // <3,0,5,6>: Cost 3 vsldoi12 LHS, <0,5,6,7>
- 3873817044U, // <3,0,5,7>: Cost 4 vsldoi12 LHS, <0,5,7,0>
- 2800075234U, // <3,0,5,u>: Cost 3 vsldoi12 LHS, <0,5,u,5>
- 2752299501U, // <3,0,6,0>: Cost 3 vsldoi12 LHS, <0,6,0,7>
- 2236547174U, // <3,0,6,1>: Cost 3 vmrghw <3,6,0,7>, LHS
- 2733683194U, // <3,0,6,2>: Cost 3 vsldoi8 <u,2,3,0>, <6,2,7,3>
- 3844473352U, // <3,0,6,3>: Cost 4 vsldoi12 <3,2,0,3>, <0,6,3,7>
- 3310289234U, // <3,0,6,4>: Cost 4 vmrghw <3,6,0,7>, <0,4,1,5>
- 3873817114U, // <3,0,6,5>: Cost 4 vsldoi12 LHS, <0,6,5,7>
- 2733683512U, // <3,0,6,6>: Cost 3 vsldoi8 <u,2,3,0>, <6,6,6,6>
- 2725057384U, // <3,0,6,7>: Cost 3 vsldoi8 <6,7,3,0>, <6,7,3,0>
- 2236547741U, // <3,0,6,u>: Cost 3 vmrghw <3,6,0,7>, LHS
- 2297905152U, // <3,0,7,0>: Cost 3 vmrglw <2,6,3,7>, <0,0,0,0>
- 2297906854U, // <3,0,7,1>: Cost 3 vmrglw <2,6,3,7>, <2,3,0,1>
- 2727711916U, // <3,0,7,2>: Cost 3 vsldoi8 <7,2,3,0>, <7,2,3,0>
- 3371649328U, // <3,0,7,3>: Cost 4 vmrglw <2,6,3,7>, <3,2,0,3>
- 2733684070U, // <3,0,7,4>: Cost 3 vsldoi8 <u,2,3,0>, <7,4,5,6>
- 3734843490U, // <3,0,7,5>: Cost 4 vsldoi4 <7,3,0,7>, <5,6,7,0>
- 3798799895U, // <3,0,7,6>: Cost 4 vsldoi8 <6,7,3,0>, <7,6,7,3>
- 2733684332U, // <3,0,7,7>: Cost 3 vsldoi8 <u,2,3,0>, <7,7,7,7>
- 2297906861U, // <3,0,7,u>: Cost 3 vmrglw <2,6,3,7>, <2,3,0,u>
- 1557504102U, // <3,0,u,0>: Cost 2 vsldoi4 <2,3,0,u>, LHS
- 1678557842U, // <3,0,u,1>: Cost 2 vsldoi12 LHS, <0,u,1,1>
- 604816029U, // <3,0,u,2>: Cost 1 vsldoi12 LHS, LHS
- 2691880892U, // <3,0,u,3>: Cost 3 vsldoi8 <1,2,3,0>, <u,3,0,1>
- 1557507382U, // <3,0,u,4>: Cost 2 vsldoi4 <2,3,0,u>, RHS
- 1618139290U, // <3,0,u,5>: Cost 2 vsldoi8 <1,2,3,0>, RHS
- 2691881168U, // <3,0,u,6>: Cost 3 vsldoi8 <1,2,3,0>, <u,6,3,7>
- 2661111018U, // <3,0,u,7>: Cost 3 vsldoi4 <7,3,0,u>, <7,3,0,u>
- 604816083U, // <3,0,u,u>: Cost 1 vsldoi12 LHS, LHS
- 2619310332U, // <3,1,0,0>: Cost 3 vsldoi4 <0,3,1,0>, <0,3,1,0>
- 2756944612U, // <3,1,0,1>: Cost 3 vsldoi12 LHS, <1,0,1,2>
- 2289221724U, // <3,1,0,2>: Cost 3 vmrglw <1,2,3,0>, <0,1,1,2>
- 2619312278U, // <3,1,0,3>: Cost 3 vsldoi4 <0,3,1,0>, <3,0,1,2>
- 2619313462U, // <3,1,0,4>: Cost 3 vsldoi4 <0,3,1,0>, RHS
- 2289221970U, // <3,1,0,5>: Cost 3 vmrglw <1,2,3,0>, <0,4,1,5>
- 2232599768U, // <3,1,0,6>: Cost 3 vmrghw <3,0,1,2>, <1,6,2,7>
- 3362964687U, // <3,1,0,7>: Cost 4 vmrglw <1,2,3,0>, <1,6,1,7>
- 2619316014U, // <3,1,0,u>: Cost 3 vsldoi4 <0,3,1,0>, LHS
- 2756944683U, // <3,1,1,0>: Cost 3 vsldoi12 LHS, <1,1,0,1>
- 1678558004U, // <3,1,1,1>: Cost 2 vsldoi12 LHS, <1,1,1,1>
- 2691883927U, // <3,1,1,2>: Cost 3 vsldoi8 <1,2,3,1>, <1,2,3,1>
- 3826631496U, // <3,1,1,3>: Cost 4 vsldoi12 <0,2,1,3>, <1,1,3,3>
- 2756944723U, // <3,1,1,4>: Cost 3 vsldoi12 LHS, <1,1,4,5>
- 2756944732U, // <3,1,1,5>: Cost 3 vsldoi12 LHS, <1,1,5,5>
- 3830686561U, // <3,1,1,6>: Cost 4 vsldoi12 LHS, <1,1,6,1>
- 3734869228U, // <3,1,1,7>: Cost 4 vsldoi4 <7,3,1,1>, <7,3,1,1>
- 1678558004U, // <3,1,1,u>: Cost 2 vsldoi12 LHS, <1,1,1,1>
- 2696529358U, // <3,1,2,0>: Cost 3 vsldoi8 <2,0,3,1>, <2,0,3,1>
- 2756944775U, // <3,1,2,1>: Cost 3 vsldoi12 LHS, <1,2,1,3>
- 2294548630U, // <3,1,2,2>: Cost 3 vmrglw <2,1,3,2>, <3,0,1,2>
- 1678558102U, // <3,1,2,3>: Cost 2 vsldoi12 LHS, <1,2,3,0>
- 2631273782U, // <3,1,2,4>: Cost 3 vsldoi4 <2,3,1,2>, RHS
- 2756944811U, // <3,1,2,5>: Cost 3 vsldoi12 LHS, <1,2,5,3>
- 3830686644U, // <3,1,2,6>: Cost 4 vsldoi12 LHS, <1,2,6,3>
- 2800075706U, // <3,1,2,7>: Cost 3 vsldoi12 LHS, <1,2,7,0>
- 1679000515U, // <3,1,2,u>: Cost 2 vsldoi12 LHS, <1,2,u,0>
- 2619334911U, // <3,1,3,0>: Cost 3 vsldoi4 <0,3,1,3>, <0,3,1,3>
- 2295218186U, // <3,1,3,1>: Cost 3 vmrglw <2,2,3,3>, <0,0,1,1>
- 2293229718U, // <3,1,3,2>: Cost 3 vmrglw <1,u,3,3>, <3,0,1,2>
- 2619337116U, // <3,1,3,3>: Cost 3 vsldoi4 <0,3,1,3>, <3,3,3,3>
- 2619338038U, // <3,1,3,4>: Cost 3 vsldoi4 <0,3,1,3>, RHS
- 2295218514U, // <3,1,3,5>: Cost 3 vmrglw <2,2,3,3>, <0,4,1,5>
- 3830686729U, // <3,1,3,6>: Cost 4 vsldoi12 LHS, <1,3,6,7>
- 3368961231U, // <3,1,3,7>: Cost 4 vmrglw <2,2,3,3>, <1,6,1,7>
- 2619340590U, // <3,1,3,u>: Cost 3 vsldoi4 <0,3,1,3>, LHS
- 2619343104U, // <3,1,4,0>: Cost 3 vsldoi4 <0,3,1,4>, <0,3,1,4>
- 2289254410U, // <3,1,4,1>: Cost 3 vmrglw <1,2,3,4>, <0,0,1,1>
- 2289256598U, // <3,1,4,2>: Cost 3 vmrglw <1,2,3,4>, <3,0,1,2>
- 2619345410U, // <3,1,4,3>: Cost 3 vsldoi4 <0,3,1,4>, <3,4,5,6>
- 2619346230U, // <3,1,4,4>: Cost 3 vsldoi4 <0,3,1,4>, RHS
- 2756944976U, // <3,1,4,5>: Cost 3 vsldoi12 LHS, <1,4,5,6>
- 3362996401U, // <3,1,4,6>: Cost 4 vmrglw <1,2,3,4>, <0,2,1,6>
- 3362997455U, // <3,1,4,7>: Cost 4 vmrglw <1,2,3,4>, <1,6,1,7>
- 2619348782U, // <3,1,4,u>: Cost 3 vsldoi4 <0,3,1,4>, LHS
- 2756945007U, // <3,1,5,0>: Cost 3 vsldoi12 LHS, <1,5,0,1>
- 3830686840U, // <3,1,5,1>: Cost 4 vsldoi12 LHS, <1,5,1,1>
- 3358361750U, // <3,1,5,2>: Cost 4 vmrglw <0,4,3,5>, <3,0,1,2>
- 3830686857U, // <3,1,5,3>: Cost 4 vsldoi12 LHS, <1,5,3,0>
- 2756945047U, // <3,1,5,4>: Cost 3 vsldoi12 LHS, <1,5,4,5>
- 2294571346U, // <3,1,5,5>: Cost 3 vmrglw <2,1,3,5>, <0,4,1,5>
- 3806105698U, // <3,1,5,6>: Cost 4 vsldoi8 <u,0,3,1>, <5,6,7,0>
- 3873817774U, // <3,1,5,7>: Cost 4 vsldoi12 LHS, <1,5,7,1>
- 2756945079U, // <3,1,5,u>: Cost 3 vsldoi12 LHS, <1,5,u,1>
- 3830686912U, // <3,1,6,0>: Cost 4 vsldoi12 LHS, <1,6,0,1>
- 2756945103U, // <3,1,6,1>: Cost 3 vsldoi12 LHS, <1,6,1,7>
- 2236547990U, // <3,1,6,2>: Cost 3 vmrghw <3,6,0,7>, <1,2,3,0>
- 3826631905U, // <3,1,6,3>: Cost 4 vsldoi12 <0,2,1,3>, <1,6,3,7>
- 3830686952U, // <3,1,6,4>: Cost 4 vsldoi12 LHS, <1,6,4,5>
- 2756945139U, // <3,1,6,5>: Cost 3 vsldoi12 LHS, <1,6,5,7>
- 3830686972U, // <3,1,6,6>: Cost 4 vsldoi12 LHS, <1,6,6,7>
- 2800076030U, // <3,1,6,7>: Cost 3 vsldoi12 LHS, <1,6,7,0>
- 2756945166U, // <3,1,6,u>: Cost 3 vsldoi12 LHS, <1,6,u,7>
- 3699081318U, // <3,1,7,0>: Cost 4 vsldoi4 <1,3,1,7>, LHS
- 2297905162U, // <3,1,7,1>: Cost 3 vmrglw <2,6,3,7>, <0,0,1,1>
- 2297907350U, // <3,1,7,2>: Cost 3 vmrglw <2,6,3,7>, <3,0,1,2>
- 3365675182U, // <3,1,7,3>: Cost 4 vmrglw <1,6,3,7>, <0,2,1,3>
- 3699084598U, // <3,1,7,4>: Cost 4 vsldoi4 <1,3,1,7>, RHS
- 2297905490U, // <3,1,7,5>: Cost 3 vmrglw <2,6,3,7>, <0,4,1,5>
- 2297905329U, // <3,1,7,6>: Cost 3 vmrglw <2,6,3,7>, <0,2,1,6>
- 3368330447U, // <3,1,7,7>: Cost 4 vmrglw <2,1,3,7>, <1,6,1,7>
- 2297905169U, // <3,1,7,u>: Cost 3 vmrglw <2,6,3,7>, <0,0,1,u>
- 2619375876U, // <3,1,u,0>: Cost 3 vsldoi4 <0,3,1,u>, <0,3,1,u>
- 1678558004U, // <3,1,u,1>: Cost 2 vsldoi12 LHS, <1,1,1,1>
- 2289289366U, // <3,1,u,2>: Cost 3 vmrglw <1,2,3,u>, <3,0,1,2>
- 1679000956U, // <3,1,u,3>: Cost 2 vsldoi12 LHS, <1,u,3,0>
- 2619378998U, // <3,1,u,4>: Cost 3 vsldoi4 <0,3,1,u>, RHS
- 2756945297U, // <3,1,u,5>: Cost 3 vsldoi12 LHS, <1,u,5,3>
- 2297905329U, // <3,1,u,6>: Cost 3 vmrglw <2,6,3,7>, <0,2,1,6>
- 2800076192U, // <3,1,u,7>: Cost 3 vsldoi12 LHS, <1,u,7,0>
- 1683203497U, // <3,1,u,u>: Cost 2 vsldoi12 LHS, <1,u,u,0>
- 3362964203U, // <3,2,0,0>: Cost 4 vmrglw <1,2,3,0>, <1,0,2,0>
- 2289222380U, // <3,2,0,1>: Cost 3 vmrglw <1,2,3,0>, <1,0,2,1>
- 2289222462U, // <3,2,0,2>: Cost 3 vmrglw <1,2,3,0>, <1,1,2,2>
- 1215479910U, // <3,2,0,3>: Cost 2 vmrglw <1,2,3,0>, LHS
- 3362964207U, // <3,2,0,4>: Cost 4 vmrglw <1,2,3,0>, <1,0,2,4>
- 2289222708U, // <3,2,0,5>: Cost 3 vmrglw <1,2,3,0>, <1,4,2,5>
- 2232600506U, // <3,2,0,6>: Cost 3 vmrghw <3,0,1,2>, <2,6,3,7>
- 3396142296U, // <3,2,0,7>: Cost 4 vmrglw <6,7,3,0>, <1,6,2,7>
- 1215479915U, // <3,2,0,u>: Cost 2 vmrglw <1,2,3,0>, LHS
- 3699105894U, // <3,2,1,0>: Cost 4 vsldoi4 <1,3,2,1>, LHS
- 3765633844U, // <3,2,1,1>: Cost 4 vsldoi8 <1,2,3,2>, <1,1,1,1>
- 2691892120U, // <3,2,1,2>: Cost 3 vsldoi8 <1,2,3,2>, <1,2,3,2>
- 2752300575U, // <3,2,1,3>: Cost 3 vsldoi12 LHS, <2,1,3,1>
- 3699109174U, // <3,2,1,4>: Cost 4 vsldoi4 <1,3,2,1>, RHS
- 3830687280U, // <3,2,1,5>: Cost 5 vsldoi12 LHS, <2,1,5,0>
- 3830687289U, // <3,2,1,6>: Cost 4 vsldoi12 LHS, <2,1,6,0>
- 3874260548U, // <3,2,1,7>: Cost 4 vsldoi12 LHS, <2,1,7,2>
- 2752742988U, // <3,2,1,u>: Cost 3 vsldoi12 LHS, <2,1,u,1>
- 2631344230U, // <3,2,2,0>: Cost 3 vsldoi4 <2,3,2,2>, LHS
- 2697201184U, // <3,2,2,1>: Cost 3 vsldoi8 <2,1,3,2>, <2,1,3,2>
- 1678558824U, // <3,2,2,2>: Cost 2 vsldoi12 LHS, <2,2,2,2>
- 1678558834U, // <3,2,2,3>: Cost 2 vsldoi12 LHS, <2,2,3,3>
- 2631347510U, // <3,2,2,4>: Cost 3 vsldoi4 <2,3,2,2>, RHS
- 3368953613U, // <3,2,2,5>: Cost 4 vmrglw <2,2,3,2>, <2,4,2,5>
- 2234304442U, // <3,2,2,6>: Cost 3 vmrghw <3,2,6,3>, <2,6,3,7>
- 3368953777U, // <3,2,2,7>: Cost 4 vmrglw <2,2,3,2>, <2,6,2,7>
- 1679001247U, // <3,2,2,u>: Cost 2 vsldoi12 LHS, <2,2,u,3>
- 1678558886U, // <3,2,3,0>: Cost 2 vsldoi12 LHS, <2,3,0,1>
- 2752300719U, // <3,2,3,1>: Cost 3 vsldoi12 LHS, <2,3,1,1>
- 2752300729U, // <3,2,3,2>: Cost 3 vsldoi12 LHS, <2,3,2,2>
- 1221476454U, // <3,2,3,3>: Cost 2 vmrglw <2,2,3,3>, LHS
- 1678558926U, // <3,2,3,4>: Cost 2 vsldoi12 LHS, <2,3,4,5>
- 2800076503U, // <3,2,3,5>: Cost 3 vsldoi12 LHS, <2,3,5,5>
- 2234746810U, // <3,2,3,6>: Cost 3 vmrghw <3,3,3,3>, <2,6,3,7>
- 2800076516U, // <3,2,3,7>: Cost 3 vsldoi12 LHS, <2,3,7,0>
- 1678558958U, // <3,2,3,u>: Cost 2 vsldoi12 LHS, <2,3,u,1>
- 3699130470U, // <3,2,4,0>: Cost 4 vsldoi4 <1,3,2,4>, LHS
- 3362996972U, // <3,2,4,1>: Cost 4 vmrglw <1,2,3,4>, <1,0,2,1>
- 2289256040U, // <3,2,4,2>: Cost 3 vmrglw <1,2,3,4>, <2,2,2,2>
- 1215512678U, // <3,2,4,3>: Cost 2 vmrglw <1,2,3,4>, LHS
- 3362998676U, // <3,2,4,4>: Cost 4 vmrglw <1,2,3,4>, <3,3,2,4>
- 2691894582U, // <3,2,4,5>: Cost 3 vsldoi8 <1,2,3,2>, RHS
- 2235582394U, // <3,2,4,6>: Cost 3 vmrghw <3,4,5,6>, <2,6,3,7>
- 3734967544U, // <3,2,4,7>: Cost 4 vsldoi4 <7,3,2,4>, <7,3,2,4>
- 1215512683U, // <3,2,4,u>: Cost 2 vmrglw <1,2,3,4>, LHS
- 3705110630U, // <3,2,5,0>: Cost 4 vsldoi4 <2,3,2,5>, LHS
- 3368313985U, // <3,2,5,1>: Cost 4 vmrglw <2,1,3,5>, <1,5,2,1>
- 3368314472U, // <3,2,5,2>: Cost 4 vmrglw <2,1,3,5>, <2,2,2,2>
- 2756945768U, // <3,2,5,3>: Cost 3 vsldoi12 LHS, <2,5,3,6>
- 3705113910U, // <3,2,5,4>: Cost 4 vsldoi4 <2,3,2,5>, RHS
- 3310061416U, // <3,2,5,5>: Cost 4 vmrghw <3,5,6,6>, <2,5,3,6>
- 3310135226U, // <3,2,5,6>: Cost 4 vmrghw <3,5,7,6>, <2,6,3,7>
- 3370305457U, // <3,2,5,7>: Cost 5 vmrglw <2,4,3,5>, <2,6,2,7>
- 2752743317U, // <3,2,5,u>: Cost 3 vsldoi12 LHS, <2,5,u,6>
- 2631376998U, // <3,2,6,0>: Cost 3 vsldoi4 <2,3,2,6>, LHS
- 3705119540U, // <3,2,6,1>: Cost 4 vsldoi4 <2,3,2,6>, <1,1,1,1>
- 2631378621U, // <3,2,6,2>: Cost 3 vsldoi4 <2,3,2,6>, <2,3,2,6>
- 1678559162U, // <3,2,6,3>: Cost 2 vsldoi12 LHS, <2,6,3,7>
- 2631380278U, // <3,2,6,4>: Cost 3 vsldoi4 <2,3,2,6>, RHS
- 3370976956U, // <3,2,6,5>: Cost 4 vmrglw <2,5,3,6>, <2,3,2,5>
- 2237065146U, // <3,2,6,6>: Cost 3 vmrghw <3,6,7,7>, <2,6,3,7>
- 3798815594U, // <3,2,6,7>: Cost 4 vsldoi8 <6,7,3,2>, <6,7,3,2>
- 1679001575U, // <3,2,6,u>: Cost 2 vsldoi12 LHS, <2,6,u,7>
- 2800076778U, // <3,2,7,0>: Cost 3 vsldoi12 LHS, <2,7,0,1>
- 3371647724U, // <3,2,7,1>: Cost 4 vmrglw <2,6,3,7>, <1,0,2,1>
- 2297906792U, // <3,2,7,2>: Cost 3 vmrglw <2,6,3,7>, <2,2,2,2>
- 1224163430U, // <3,2,7,3>: Cost 2 vmrglw <2,6,3,7>, LHS
- 3705130294U, // <3,2,7,4>: Cost 4 vsldoi4 <2,3,2,7>, RHS
- 3371648052U, // <3,2,7,5>: Cost 4 vmrglw <2,6,3,7>, <1,4,2,5>
- 2297906877U, // <3,2,7,6>: Cost 3 vmrglw <2,6,3,7>, <2,3,2,6>
- 3371648702U, // <3,2,7,7>: Cost 4 vmrglw <2,6,3,7>, <2,3,2,7>
- 1224163435U, // <3,2,7,u>: Cost 2 vmrglw <2,6,3,7>, LHS
- 1679001659U, // <3,2,u,0>: Cost 2 vsldoi12 LHS, <2,u,0,1>
- 2752743492U, // <3,2,u,1>: Cost 3 vsldoi12 LHS, <2,u,1,1>
- 1678558824U, // <3,2,u,2>: Cost 2 vsldoi12 LHS, <2,2,2,2>
- 1678559320U, // <3,2,u,3>: Cost 2 vsldoi12 LHS, <2,u,3,3>
- 1679001699U, // <3,2,u,4>: Cost 2 vsldoi12 LHS, <2,u,4,5>
- 2691897498U, // <3,2,u,5>: Cost 3 vsldoi8 <1,2,3,2>, RHS
- 2237908922U, // <3,2,u,6>: Cost 3 vmrghw <3,u,1,2>, <2,6,3,7>
- 2800519289U, // <3,2,u,7>: Cost 3 vsldoi12 LHS, <2,u,7,0>
- 1679001731U, // <3,2,u,u>: Cost 2 vsldoi12 LHS, <2,u,u,1>
- 1215480726U, // <3,3,0,0>: Cost 2 vmrglw <1,2,3,0>, <1,2,3,0>
- 1678559382U, // <3,3,0,1>: Cost 2 vsldoi12 LHS, <3,0,1,2>
- 2631403200U, // <3,3,0,2>: Cost 3 vsldoi4 <2,3,3,0>, <2,3,3,0>
- 2289223282U, // <3,3,0,3>: Cost 3 vmrglw <1,2,3,0>, <2,2,3,3>
- 2752301232U, // <3,3,0,4>: Cost 3 vsldoi12 LHS, <3,0,4,1>
- 3362965027U, // <3,3,0,5>: Cost 4 vmrglw <1,2,3,0>, <2,1,3,5>
- 3362965352U, // <3,3,0,6>: Cost 4 vmrglw <1,2,3,0>, <2,5,3,6>
- 2289223610U, // <3,3,0,7>: Cost 3 vmrglw <1,2,3,0>, <2,6,3,7>
- 1678559445U, // <3,3,0,u>: Cost 2 vsldoi12 LHS, <3,0,u,2>
- 3830687964U, // <3,3,1,0>: Cost 4 vsldoi12 LHS, <3,1,0,0>
- 2752301286U, // <3,3,1,1>: Cost 3 vsldoi12 LHS, <3,1,1,1>
- 2752301297U, // <3,3,1,2>: Cost 3 vsldoi12 LHS, <3,1,2,3>
- 2305157532U, // <3,3,1,3>: Cost 3 vmrglw <3,u,3,1>, <3,3,3,3>
- 3830688000U, // <3,3,1,4>: Cost 4 vsldoi12 LHS, <3,1,4,0>
- 3830688009U, // <3,3,1,5>: Cost 4 vsldoi12 LHS, <3,1,5,0>
- 3830688019U, // <3,3,1,6>: Cost 4 vsldoi12 LHS, <3,1,6,1>
- 3362973626U, // <3,3,1,7>: Cost 4 vmrglw <1,2,3,1>, <2,6,3,7>
- 2752743719U, // <3,3,1,u>: Cost 3 vsldoi12 LHS, <3,1,u,3>
- 2631417958U, // <3,3,2,0>: Cost 3 vsldoi4 <2,3,3,2>, LHS
- 3826043193U, // <3,3,2,1>: Cost 4 vsldoi12 LHS, <3,2,1,3>
- 1624131186U, // <3,3,2,2>: Cost 2 vsldoi8 <2,2,3,3>, <2,2,3,3>
- 2752301384U, // <3,3,2,3>: Cost 3 vsldoi12 LHS, <3,2,3,0>
- 2631421238U, // <3,3,2,4>: Cost 3 vsldoi4 <2,3,3,2>, RHS
- 3826485602U, // <3,3,2,5>: Cost 4 vsldoi12 LHS, <3,2,5,u>
- 2752301414U, // <3,3,2,6>: Cost 3 vsldoi12 LHS, <3,2,6,3>
- 2771249519U, // <3,3,2,7>: Cost 3 vsldoi12 <3,2,7,3>, <3,2,7,3>
- 1628112984U, // <3,3,2,u>: Cost 2 vsldoi8 <2,u,3,3>, <2,u,3,3>
- 1563656294U, // <3,3,3,0>: Cost 2 vsldoi4 <3,3,3,3>, LHS
- 2301855911U, // <3,3,3,1>: Cost 3 vmrglw <3,3,3,3>, <3,0,3,1>
- 2697873730U, // <3,3,3,2>: Cost 3 vsldoi8 <2,2,3,3>, <3,2,2,3>
- 403488870U, // <3,3,3,3>: Cost 1 vspltisw3 LHS
- 1563659574U, // <3,3,3,4>: Cost 2 vsldoi4 <3,3,3,3>, RHS
- 2301856239U, // <3,3,3,5>: Cost 3 vmrglw <3,3,3,3>, <3,4,3,5>
- 2697874067U, // <3,3,3,6>: Cost 3 vsldoi8 <2,2,3,3>, <3,6,3,7>
- 2295220154U, // <3,3,3,7>: Cost 3 vmrglw <2,2,3,3>, <2,6,3,7>
- 403488870U, // <3,3,3,u>: Cost 1 vspltisw3 LHS
- 2289255318U, // <3,3,4,0>: Cost 3 vmrglw <1,2,3,4>, <1,2,3,0>
- 2631435162U, // <3,3,4,1>: Cost 3 vsldoi4 <2,3,3,4>, <1,2,3,4>
- 2631435972U, // <3,3,4,2>: Cost 3 vsldoi4 <2,3,3,4>, <2,3,3,4>
- 2289256050U, // <3,3,4,3>: Cost 3 vmrglw <1,2,3,4>, <2,2,3,3>
- 1215513498U, // <3,3,4,4>: Cost 2 vmrglw <1,2,3,4>, <1,2,3,4>
- 1679002114U, // <3,3,4,5>: Cost 2 vsldoi12 LHS, <3,4,5,6>
- 3362998120U, // <3,3,4,6>: Cost 4 vmrglw <1,2,3,4>, <2,5,3,6>
- 2289256378U, // <3,3,4,7>: Cost 3 vmrglw <1,2,3,4>, <2,6,3,7>
- 1679002141U, // <3,3,4,u>: Cost 2 vsldoi12 LHS, <3,4,u,6>
- 3831130657U, // <3,3,5,0>: Cost 4 vsldoi12 LHS, <3,5,0,1>
- 3376277671U, // <3,3,5,1>: Cost 4 vmrglw <3,4,3,5>, <3,0,3,1>
- 3771617012U, // <3,3,5,2>: Cost 4 vsldoi8 <2,2,3,3>, <5,2,2,3>
- 2302536092U, // <3,3,5,3>: Cost 3 vmrglw <3,4,3,5>, <3,3,3,3>
- 3831130697U, // <3,3,5,4>: Cost 4 vsldoi12 LHS, <3,5,4,5>
- 2294572579U, // <3,3,5,5>: Cost 3 vmrglw <2,1,3,5>, <2,1,3,5>
- 2800519773U, // <3,3,5,6>: Cost 3 vsldoi12 LHS, <3,5,6,7>
- 3368314810U, // <3,3,5,7>: Cost 4 vmrglw <2,1,3,5>, <2,6,3,7>
- 2800519791U, // <3,3,5,u>: Cost 3 vsldoi12 LHS, <3,5,u,7>
- 2800077432U, // <3,3,6,0>: Cost 3 vsldoi12 LHS, <3,6,0,7>
- 3310291185U, // <3,3,6,1>: Cost 4 vmrghw <3,6,0,7>, <3,1,2,3>
- 2789165706U, // <3,3,6,2>: Cost 3 vsldoi12 <6,2,7,3>, <3,6,2,7>
- 2764982931U, // <3,3,6,3>: Cost 3 vsldoi12 <2,2,3,3>, <3,6,3,7>
- 2800077468U, // <3,3,6,4>: Cost 3 vsldoi12 LHS, <3,6,4,7>
- 3873819301U, // <3,3,6,5>: Cost 4 vsldoi12 LHS, <3,6,5,7>
- 2297235304U, // <3,3,6,6>: Cost 3 vmrglw <2,5,3,6>, <2,5,3,6>
- 2725081963U, // <3,3,6,7>: Cost 3 vsldoi8 <6,7,3,3>, <6,7,3,3>
- 2725745596U, // <3,3,6,u>: Cost 3 vsldoi8 <6,u,3,3>, <6,u,3,3>
- 2631458918U, // <3,3,7,0>: Cost 3 vsldoi4 <2,3,3,7>, LHS
- 3705201460U, // <3,3,7,1>: Cost 4 vsldoi4 <2,3,3,7>, <1,1,1,1>
- 2631460551U, // <3,3,7,2>: Cost 3 vsldoi4 <2,3,3,7>, <2,3,3,7>
- 2297906802U, // <3,3,7,3>: Cost 3 vmrglw <2,6,3,7>, <2,2,3,3>
- 2631462198U, // <3,3,7,4>: Cost 3 vsldoi4 <2,3,3,7>, RHS
- 3371648547U, // <3,3,7,5>: Cost 4 vmrglw <2,6,3,7>, <2,1,3,5>
- 3371648548U, // <3,3,7,6>: Cost 4 vmrglw <2,6,3,7>, <2,1,3,6>
- 1224165306U, // <3,3,7,7>: Cost 2 vmrglw <2,6,3,7>, <2,6,3,7>
- 1224165306U, // <3,3,7,u>: Cost 2 vmrglw <2,6,3,7>, <2,6,3,7>
- 1215480726U, // <3,3,u,0>: Cost 2 vmrglw <1,2,3,0>, <1,2,3,0>
- 1679002398U, // <3,3,u,1>: Cost 2 vsldoi12 LHS, <3,u,1,2>
- 1659967368U, // <3,3,u,2>: Cost 2 vsldoi8 <u,2,3,3>, <u,2,3,3>
- 403488870U, // <3,3,u,3>: Cost 1 vspltisw3 LHS
- 1563659574U, // <3,3,u,4>: Cost 2 vsldoi4 <3,3,3,3>, RHS
- 1679002438U, // <3,3,u,5>: Cost 2 vsldoi12 LHS, <3,u,5,6>
- 2756946764U, // <3,3,u,6>: Cost 3 vsldoi12 LHS, <3,u,6,3>
- 1224165306U, // <3,3,u,7>: Cost 2 vmrglw <2,6,3,7>, <2,6,3,7>
- 403488870U, // <3,3,u,u>: Cost 1 vspltisw3 LHS
- 2691907584U, // <3,4,0,0>: Cost 3 vsldoi8 <1,2,3,4>, <0,0,0,0>
- 1618165862U, // <3,4,0,1>: Cost 2 vsldoi8 <1,2,3,4>, LHS
- 2631476937U, // <3,4,0,2>: Cost 3 vsldoi4 <2,3,4,0>, <2,3,4,0>
- 2232601732U, // <3,4,0,3>: Cost 3 vmrghw <3,0,1,2>, <4,3,5,0>
- 2691907922U, // <3,4,0,4>: Cost 3 vsldoi8 <1,2,3,4>, <0,4,1,5>
- 1158860086U, // <3,4,0,5>: Cost 2 vmrghw <3,0,1,2>, RHS
- 3306343806U, // <3,4,0,6>: Cost 4 vmrghw <3,0,1,2>, <4,6,5,7>
- 3366947484U, // <3,4,0,7>: Cost 4 vmrglw <1,u,3,0>, <3,6,4,7>
- 1618166429U, // <3,4,0,u>: Cost 2 vsldoi8 <1,2,3,4>, LHS
- 2631483494U, // <3,4,1,0>: Cost 3 vsldoi4 <2,3,4,1>, LHS
- 2691908404U, // <3,4,1,1>: Cost 3 vsldoi8 <1,2,3,4>, <1,1,1,1>
- 1618166682U, // <3,4,1,2>: Cost 2 vsldoi8 <1,2,3,4>, <1,2,3,4>
- 3765650393U, // <3,4,1,3>: Cost 4 vsldoi8 <1,2,3,4>, <1,3,1,4>
- 2631486774U, // <3,4,1,4>: Cost 3 vsldoi4 <2,3,4,1>, RHS
- 2756946914U, // <3,4,1,5>: Cost 3 vsldoi12 LHS, <4,1,5,0>
- 3765650639U, // <3,4,1,6>: Cost 4 vsldoi8 <1,2,3,4>, <1,6,1,7>
- 3735090439U, // <3,4,1,7>: Cost 4 vsldoi4 <7,3,4,1>, <7,3,4,1>
- 1622148480U, // <3,4,1,u>: Cost 2 vsldoi8 <1,u,3,4>, <1,u,3,4>
- 3765650893U, // <3,4,2,0>: Cost 4 vsldoi8 <1,2,3,4>, <2,0,3,0>
- 3831131154U, // <3,4,2,1>: Cost 4 vsldoi12 LHS, <4,2,1,3>
- 2691909224U, // <3,4,2,2>: Cost 3 vsldoi8 <1,2,3,4>, <2,2,2,2>
- 2691909286U, // <3,4,2,3>: Cost 3 vsldoi8 <1,2,3,4>, <2,3,0,1>
- 2699208469U, // <3,4,2,4>: Cost 3 vsldoi8 <2,4,3,4>, <2,4,3,4>
- 2233863478U, // <3,4,2,5>: Cost 3 vmrghw <3,2,0,3>, RHS
- 2691909562U, // <3,4,2,6>: Cost 3 vsldoi8 <1,2,3,4>, <2,6,3,7>
- 2701199368U, // <3,4,2,7>: Cost 3 vsldoi8 <2,7,3,4>, <2,7,3,4>
- 2691909691U, // <3,4,2,u>: Cost 3 vsldoi8 <1,2,3,4>, <2,u,0,1>
- 2691909782U, // <3,4,3,0>: Cost 3 vsldoi8 <1,2,3,4>, <3,0,1,2>
- 3765651686U, // <3,4,3,1>: Cost 4 vsldoi8 <1,2,3,4>, <3,1,1,1>
- 2691909972U, // <3,4,3,2>: Cost 3 vsldoi8 <1,2,3,4>, <3,2,4,3>
- 2691910044U, // <3,4,3,3>: Cost 3 vsldoi8 <1,2,3,4>, <3,3,3,3>
- 2691910096U, // <3,4,3,4>: Cost 3 vsldoi8 <1,2,3,4>, <3,4,0,1>
- 1161006390U, // <3,4,3,5>: Cost 2 vmrghw <3,3,3,3>, RHS
- 2691910300U, // <3,4,3,6>: Cost 3 vsldoi8 <1,2,3,4>, <3,6,4,7>
- 3368962716U, // <3,4,3,7>: Cost 4 vmrglw <2,2,3,3>, <3,6,4,7>
- 1161006633U, // <3,4,3,u>: Cost 2 vmrghw <3,3,3,3>, RHS
- 2631508070U, // <3,4,4,0>: Cost 3 vsldoi4 <2,3,4,4>, LHS
- 2631508890U, // <3,4,4,1>: Cost 3 vsldoi4 <2,3,4,4>, <1,2,3,4>
- 2631509709U, // <3,4,4,2>: Cost 3 vsldoi4 <2,3,4,4>, <2,3,4,4>
- 2289256788U, // <3,4,4,3>: Cost 3 vmrglw <1,2,3,4>, <3,2,4,3>
- 1726336208U, // <3,4,4,4>: Cost 2 vsldoi12 LHS, <4,4,4,4>
- 1618169142U, // <3,4,4,5>: Cost 2 vsldoi8 <1,2,3,4>, RHS
- 3362998858U, // <3,4,4,6>: Cost 4 vmrglw <1,2,3,4>, <3,5,4,6>
- 2289257116U, // <3,4,4,7>: Cost 3 vmrglw <1,2,3,4>, <3,6,4,7>
- 1618169385U, // <3,4,4,u>: Cost 2 vsldoi8 <1,2,3,4>, RHS
- 1557774438U, // <3,4,5,0>: Cost 2 vsldoi4 <2,3,4,5>, LHS
- 2631516980U, // <3,4,5,1>: Cost 3 vsldoi4 <2,3,4,5>, <1,1,1,1>
- 1557776078U, // <3,4,5,2>: Cost 2 vsldoi4 <2,3,4,5>, <2,3,4,5>
- 2631518358U, // <3,4,5,3>: Cost 3 vsldoi4 <2,3,4,5>, <3,0,1,2>
- 1557777718U, // <3,4,5,4>: Cost 2 vsldoi4 <2,3,4,5>, RHS
- 2296563406U, // <3,4,5,5>: Cost 3 vmrglw <2,4,3,5>, <2,3,4,5>
- 604818742U, // <3,4,5,6>: Cost 1 vsldoi12 LHS, RHS
- 2661381387U, // <3,4,5,7>: Cost 3 vsldoi4 <7,3,4,5>, <7,3,4,5>
- 604818760U, // <3,4,5,u>: Cost 1 vsldoi12 LHS, RHS
- 3705266278U, // <3,4,6,0>: Cost 4 vsldoi4 <2,3,4,6>, LHS
- 3831131482U, // <3,4,6,1>: Cost 4 vsldoi12 LHS, <4,6,1,7>
- 2733715962U, // <3,4,6,2>: Cost 3 vsldoi8 <u,2,3,4>, <6,2,7,3>
- 3844771180U, // <3,4,6,3>: Cost 4 vsldoi12 <3,2,4,3>, <4,6,3,7>
- 2800078197U, // <3,4,6,4>: Cost 3 vsldoi12 LHS, <4,6,4,7>
- 2236550454U, // <3,4,6,5>: Cost 3 vmrghw <3,6,0,7>, RHS
- 2733716280U, // <3,4,6,6>: Cost 3 vsldoi8 <u,2,3,4>, <6,6,6,6>
- 2725090156U, // <3,4,6,7>: Cost 3 vsldoi8 <6,7,3,4>, <6,7,3,4>
- 2236550697U, // <3,4,6,u>: Cost 3 vmrghw <3,6,0,7>, RHS
- 2733716474U, // <3,4,7,0>: Cost 3 vsldoi8 <u,2,3,4>, <7,0,1,2>
- 3371647013U, // <3,4,7,1>: Cost 4 vmrglw <2,6,3,7>, <0,0,4,1>
- 2727744688U, // <3,4,7,2>: Cost 3 vsldoi8 <7,2,3,4>, <7,2,3,4>
- 3371649364U, // <3,4,7,3>: Cost 4 vmrglw <2,6,3,7>, <3,2,4,3>
- 2733716838U, // <3,4,7,4>: Cost 3 vsldoi8 <u,2,3,4>, <7,4,5,6>
- 2297906894U, // <3,4,7,5>: Cost 3 vmrglw <2,6,3,7>, <2,3,4,5>
- 3371647180U, // <3,4,7,6>: Cost 4 vmrglw <2,6,3,7>, <0,2,4,6>
- 2733717100U, // <3,4,7,7>: Cost 3 vsldoi8 <u,2,3,4>, <7,7,7,7>
- 2297906897U, // <3,4,7,u>: Cost 3 vmrglw <2,6,3,7>, <2,3,4,u>
- 1557799014U, // <3,4,u,0>: Cost 2 vsldoi4 <2,3,4,u>, LHS
- 1618171694U, // <3,4,u,1>: Cost 2 vsldoi8 <1,2,3,4>, LHS
- 1557800657U, // <3,4,u,2>: Cost 2 vsldoi4 <2,3,4,u>, <2,3,4,u>
- 2691913660U, // <3,4,u,3>: Cost 3 vsldoi8 <1,2,3,4>, <u,3,0,1>
- 1557802294U, // <3,4,u,4>: Cost 2 vsldoi4 <2,3,4,u>, RHS
- 1618172058U, // <3,4,u,5>: Cost 2 vsldoi8 <1,2,3,4>, RHS
- 604818985U, // <3,4,u,6>: Cost 1 vsldoi12 LHS, RHS
- 2661405966U, // <3,4,u,7>: Cost 3 vsldoi4 <7,3,4,u>, <7,3,4,u>
- 604819003U, // <3,4,u,u>: Cost 1 vsldoi12 LHS, RHS
- 2643492966U, // <3,5,0,0>: Cost 3 vsldoi4 <4,3,5,0>, LHS
- 2756947528U, // <3,5,0,1>: Cost 3 vsldoi12 LHS, <5,0,1,2>
- 2331029019U, // <3,5,0,2>: Cost 3 vmrglw <u,2,3,0>, <4,u,5,2>
- 2643495062U, // <3,5,0,3>: Cost 3 vsldoi4 <4,3,5,0>, <3,0,1,2>
- 2756947554U, // <3,5,0,4>: Cost 3 vsldoi12 LHS, <5,0,4,1>
- 2800078443U, // <3,5,0,5>: Cost 3 vsldoi12 LHS, <5,0,5,1>
- 2289224194U, // <3,5,0,6>: Cost 3 vmrglw <1,2,3,0>, <3,4,5,6>
- 3362964723U, // <3,5,0,7>: Cost 4 vmrglw <1,2,3,0>, <1,6,5,7>
- 2756947590U, // <3,5,0,u>: Cost 3 vsldoi12 LHS, <5,0,u,1>
- 2800078479U, // <3,5,1,0>: Cost 3 vsldoi12 LHS, <5,1,0,1>
- 2333027218U, // <3,5,1,1>: Cost 3 vmrglw <u,5,3,1>, <4,0,5,1>
- 2691916699U, // <3,5,1,2>: Cost 3 vsldoi8 <1,2,3,5>, <1,2,3,5>
- 3832901294U, // <3,5,1,3>: Cost 4 vsldoi12 <1,2,5,3>, <5,1,3,5>
- 2800078519U, // <3,5,1,4>: Cost 3 vsldoi12 LHS, <5,1,4,5>
- 3830689467U, // <3,5,1,5>: Cost 4 vsldoi12 LHS, <5,1,5,0>
- 3830689481U, // <3,5,1,6>: Cost 4 vsldoi12 LHS, <5,1,6,5>
- 3873820365U, // <3,5,1,7>: Cost 4 vsldoi12 LHS, <5,1,7,0>
- 2800078551U, // <3,5,1,u>: Cost 3 vsldoi12 LHS, <5,1,u,1>
- 3770967487U, // <3,5,2,0>: Cost 4 vsldoi8 <2,1,3,5>, <2,0,1,4>
- 2697225763U, // <3,5,2,1>: Cost 3 vsldoi8 <2,1,3,5>, <2,1,3,5>
- 3830689523U, // <3,5,2,2>: Cost 4 vsldoi12 LHS, <5,2,2,2>
- 2699216590U, // <3,5,2,3>: Cost 3 vsldoi8 <2,4,3,5>, <2,3,4,5>
- 2699216662U, // <3,5,2,4>: Cost 3 vsldoi8 <2,4,3,5>, <2,4,3,5>
- 2783047439U, // <3,5,2,5>: Cost 3 vsldoi12 <5,2,5,3>, <5,2,5,3>
- 2783121176U, // <3,5,2,6>: Cost 3 vsldoi12 <5,2,6,3>, <5,2,6,3>
- 3856936737U, // <3,5,2,7>: Cost 4 vsldoi12 <5,2,7,3>, <5,2,7,3>
- 2701871194U, // <3,5,2,u>: Cost 3 vsldoi8 <2,u,3,5>, <2,u,3,5>
- 2643517542U, // <3,5,3,0>: Cost 3 vsldoi4 <4,3,5,3>, LHS
- 2331052946U, // <3,5,3,1>: Cost 3 vmrglw <u,2,3,3>, <4,0,5,1>
- 3699345010U, // <3,5,3,2>: Cost 4 vsldoi4 <1,3,5,3>, <2,2,3,3>
- 2705189276U, // <3,5,3,3>: Cost 3 vsldoi8 <3,4,3,5>, <3,3,3,3>
- 2705189359U, // <3,5,3,4>: Cost 3 vsldoi8 <3,4,3,5>, <3,4,3,5>
- 2331053274U, // <3,5,3,5>: Cost 3 vmrglw <u,2,3,3>, <4,4,5,5>
- 2295220738U, // <3,5,3,6>: Cost 3 vmrglw <2,2,3,3>, <3,4,5,6>
- 3368961267U, // <3,5,3,7>: Cost 4 vmrglw <2,2,3,3>, <1,6,5,7>
- 2295220740U, // <3,5,3,u>: Cost 3 vmrglw <2,2,3,3>, <3,4,5,u>
- 2643525734U, // <3,5,4,0>: Cost 3 vsldoi4 <4,3,5,4>, LHS
- 2331061138U, // <3,5,4,1>: Cost 3 vmrglw <u,2,3,4>, <4,0,5,1>
- 2235584280U, // <3,5,4,2>: Cost 3 vmrghw <3,4,5,6>, <5,2,6,3>
- 2643528194U, // <3,5,4,3>: Cost 3 vsldoi4 <4,3,5,4>, <3,4,5,6>
- 2735713498U, // <3,5,4,4>: Cost 3 vsldoi8 <u,5,3,5>, <4,4,5,5>
- 2756947892U, // <3,5,4,5>: Cost 3 vsldoi12 LHS, <5,4,5,6>
- 2289256962U, // <3,5,4,6>: Cost 3 vmrglw <1,2,3,4>, <3,4,5,6>
- 3362997491U, // <3,5,4,7>: Cost 4 vmrglw <1,2,3,4>, <1,6,5,7>
- 2756947919U, // <3,5,4,u>: Cost 3 vsldoi12 LHS, <5,4,u,6>
- 2800078803U, // <3,5,5,0>: Cost 3 vsldoi12 LHS, <5,5,0,1>
- 2800078812U, // <3,5,5,1>: Cost 3 vsldoi12 LHS, <5,5,1,1>
- 2631591639U, // <3,5,5,2>: Cost 3 vsldoi4 <2,3,5,5>, <2,3,5,5>
- 3832901616U, // <3,5,5,3>: Cost 4 vsldoi12 <1,2,5,3>, <5,5,3,3>
- 2800078843U, // <3,5,5,4>: Cost 3 vsldoi12 LHS, <5,5,4,5>
- 1726337028U, // <3,5,5,5>: Cost 2 vsldoi12 LHS, <5,5,5,5>
- 2800078862U, // <3,5,5,6>: Cost 3 vsldoi12 LHS, <5,5,6,6>
- 3368314099U, // <3,5,5,7>: Cost 4 vmrglw <2,1,3,5>, <1,6,5,7>
- 1726337028U, // <3,5,5,u>: Cost 2 vsldoi12 LHS, <5,5,5,5>
- 2800078884U, // <3,5,6,0>: Cost 3 vsldoi12 LHS, <5,6,0,1>
- 2800078899U, // <3,5,6,1>: Cost 3 vsldoi12 LHS, <5,6,1,7>
- 2631599832U, // <3,5,6,2>: Cost 3 vsldoi4 <2,3,5,6>, <2,3,5,6>
- 2800078914U, // <3,5,6,3>: Cost 3 vsldoi12 LHS, <5,6,3,4>
- 2800078924U, // <3,5,6,4>: Cost 3 vsldoi12 LHS, <5,6,4,5>
- 2800078935U, // <3,5,6,5>: Cost 3 vsldoi12 LHS, <5,6,5,7>
- 2297235970U, // <3,5,6,6>: Cost 3 vmrglw <2,5,3,6>, <3,4,5,6>
- 1726337122U, // <3,5,6,7>: Cost 2 vsldoi12 LHS, <5,6,7,0>
- 1726337131U, // <3,5,6,u>: Cost 2 vsldoi12 LHS, <5,6,u,0>
- 3699376230U, // <3,5,7,0>: Cost 4 vsldoi4 <1,3,5,7>, LHS
- 2333739922U, // <3,5,7,1>: Cost 3 vmrglw <u,6,3,7>, <4,0,5,1>
- 3699378106U, // <3,5,7,2>: Cost 4 vsldoi4 <1,3,5,7>, <2,6,3,7>
- 3371647915U, // <3,5,7,3>: Cost 4 vmrglw <2,6,3,7>, <1,2,5,3>
- 3699379510U, // <3,5,7,4>: Cost 4 vsldoi4 <1,3,5,7>, RHS
- 2333740250U, // <3,5,7,5>: Cost 3 vmrglw <u,6,3,7>, <4,4,5,5>
- 2297907714U, // <3,5,7,6>: Cost 3 vmrglw <2,6,3,7>, <3,4,5,6>
- 3370984691U, // <3,5,7,7>: Cost 4 vmrglw <2,5,3,7>, <1,6,5,7>
- 2297907716U, // <3,5,7,u>: Cost 3 vmrglw <2,6,3,7>, <3,4,5,u>
- 2800079046U, // <3,5,u,0>: Cost 3 vsldoi12 LHS, <5,u,0,1>
- 2756948176U, // <3,5,u,1>: Cost 3 vsldoi12 LHS, <5,u,1,2>
- 2331029019U, // <3,5,u,2>: Cost 3 vmrglw <u,2,3,0>, <4,u,5,2>
- 2800079076U, // <3,5,u,3>: Cost 3 vsldoi12 LHS, <5,u,3,4>
- 2800079085U, // <3,5,u,4>: Cost 3 vsldoi12 LHS, <5,u,4,4>
- 1726337028U, // <3,5,u,5>: Cost 2 vsldoi12 LHS, <5,5,5,5>
- 2289289730U, // <3,5,u,6>: Cost 3 vmrglw <1,2,3,u>, <3,4,5,6>
- 1726337284U, // <3,5,u,7>: Cost 2 vsldoi12 LHS, <5,u,7,0>
- 1726337293U, // <3,5,u,u>: Cost 2 vsldoi12 LHS, <5,u,u,0>
- 3773628416U, // <3,6,0,0>: Cost 4 vsldoi8 <2,5,3,6>, <0,0,0,0>
- 2699886694U, // <3,6,0,1>: Cost 3 vsldoi8 <2,5,3,6>, LHS
- 2789167401U, // <3,6,0,2>: Cost 3 vsldoi12 <6,2,7,3>, <6,0,2,1>
- 3362965862U, // <3,6,0,3>: Cost 4 vmrglw <1,2,3,0>, <3,2,6,3>
- 3773628754U, // <3,6,0,4>: Cost 4 vsldoi8 <2,5,3,6>, <0,4,1,5>
- 3723284326U, // <3,6,0,5>: Cost 4 vsldoi4 <5,3,6,0>, <5,3,6,0>
- 2800079181U, // <3,6,0,6>: Cost 3 vsldoi12 LHS, <6,0,6,1>
- 1215483190U, // <3,6,0,7>: Cost 2 vmrglw <1,2,3,0>, RHS
- 1215483191U, // <3,6,0,u>: Cost 2 vmrglw <1,2,3,0>, RHS
- 3873821032U, // <3,6,1,0>: Cost 4 vsldoi12 LHS, <6,1,0,1>
- 3773629236U, // <3,6,1,1>: Cost 4 vsldoi8 <2,5,3,6>, <1,1,1,1>
- 2691924892U, // <3,6,1,2>: Cost 3 vsldoi8 <1,2,3,6>, <1,2,3,6>
- 3830690184U, // <3,6,1,3>: Cost 5 vsldoi12 LHS, <6,1,3,6>
- 3873821072U, // <3,6,1,4>: Cost 4 vsldoi12 LHS, <6,1,4,5>
- 3873821082U, // <3,6,1,5>: Cost 4 vsldoi12 LHS, <6,1,5,6>
- 3403453240U, // <3,6,1,6>: Cost 4 vmrglw <u,0,3,1>, <6,6,6,6>
- 2289233206U, // <3,6,1,7>: Cost 3 vmrglw <1,2,3,1>, RHS
- 2289233207U, // <3,6,1,u>: Cost 3 vmrglw <1,2,3,1>, RHS
- 2661498982U, // <3,6,2,0>: Cost 3 vsldoi4 <7,3,6,2>, LHS
- 3770975780U, // <3,6,2,1>: Cost 4 vsldoi8 <2,1,3,6>, <2,1,3,6>
- 2631640797U, // <3,6,2,2>: Cost 3 vsldoi4 <2,3,6,2>, <2,3,6,2>
- 3771639485U, // <3,6,2,3>: Cost 4 vsldoi8 <2,2,3,6>, <2,3,2,6>
- 2661502262U, // <3,6,2,4>: Cost 3 vsldoi4 <7,3,6,2>, RHS
- 2699888488U, // <3,6,2,5>: Cost 3 vsldoi8 <2,5,3,6>, <2,5,3,6>
- 2661503482U, // <3,6,2,6>: Cost 3 vsldoi4 <7,3,6,2>, <6,2,7,3>
- 1715425786U, // <3,6,2,7>: Cost 2 vsldoi12 <6,2,7,3>, <6,2,7,3>
- 1715499523U, // <3,6,2,u>: Cost 2 vsldoi12 <6,2,u,3>, <6,2,u,3>
- 3773630614U, // <3,6,3,0>: Cost 4 vsldoi8 <2,5,3,6>, <3,0,1,2>
- 3372942825U, // <3,6,3,1>: Cost 4 vmrglw <2,u,3,3>, <2,0,6,1>
- 2234749434U, // <3,6,3,2>: Cost 3 vmrghw <3,3,3,3>, <6,2,7,3>
- 3368962406U, // <3,6,3,3>: Cost 4 vmrglw <2,2,3,3>, <3,2,6,3>
- 2699889154U, // <3,6,3,4>: Cost 3 vsldoi8 <2,5,3,6>, <3,4,5,6>
- 3773631068U, // <3,6,3,5>: Cost 4 vsldoi8 <2,5,3,6>, <3,5,6,6>
- 2331054904U, // <3,6,3,6>: Cost 3 vmrglw <u,2,3,3>, <6,6,6,6>
- 1221479734U, // <3,6,3,7>: Cost 2 vmrglw <2,2,3,3>, RHS
- 1221479735U, // <3,6,3,u>: Cost 2 vmrglw <2,2,3,3>, RHS
- 2235584801U, // <3,6,4,0>: Cost 3 vmrghw <3,4,5,6>, <6,0,1,2>
- 3717342106U, // <3,6,4,1>: Cost 4 vsldoi4 <4,3,6,4>, <1,2,3,4>
- 2789167729U, // <3,6,4,2>: Cost 3 vsldoi12 <6,2,7,3>, <6,4,2,5>
- 2235585074U, // <3,6,4,3>: Cost 3 vmrghw <3,4,5,6>, <6,3,4,5>
- 2235585165U, // <3,6,4,4>: Cost 3 vmrghw <3,4,5,6>, <6,4,5,6>
- 2699889974U, // <3,6,4,5>: Cost 3 vsldoi8 <2,5,3,6>, RHS
- 2800079509U, // <3,6,4,6>: Cost 3 vsldoi12 LHS, <6,4,6,5>
- 1215515958U, // <3,6,4,7>: Cost 2 vmrglw <1,2,3,4>, RHS
- 1215515959U, // <3,6,4,u>: Cost 2 vmrglw <1,2,3,4>, RHS
- 3873821356U, // <3,6,5,0>: Cost 4 vsldoi12 LHS, <6,5,0,1>
- 3372959209U, // <3,6,5,1>: Cost 5 vmrglw <2,u,3,5>, <2,0,6,1>
- 3862909629U, // <3,6,5,2>: Cost 4 vsldoi12 <6,2,7,3>, <6,5,2,0>
- 3773632358U, // <3,6,5,3>: Cost 4 vsldoi8 <2,5,3,6>, <5,3,6,0>
- 3873821396U, // <3,6,5,4>: Cost 4 vsldoi12 LHS, <6,5,4,5>
- 3873821405U, // <3,6,5,5>: Cost 4 vsldoi12 LHS, <6,5,5,5>
- 3862909672U, // <3,6,5,6>: Cost 4 vsldoi12 <6,2,7,3>, <6,5,6,7>
- 2294574390U, // <3,6,5,7>: Cost 3 vmrglw <2,1,3,5>, RHS
- 2294574391U, // <3,6,5,u>: Cost 3 vmrglw <2,1,3,5>, RHS
- 2800079613U, // <3,6,6,0>: Cost 3 vsldoi12 LHS, <6,6,0,1>
- 3873821446U, // <3,6,6,1>: Cost 4 vsldoi12 LHS, <6,6,1,1>
- 2789167888U, // <3,6,6,2>: Cost 3 vsldoi12 <6,2,7,3>, <6,6,2,2>
- 3844920090U, // <3,6,6,3>: Cost 4 vsldoi12 <3,2,6,3>, <6,6,3,3>
- 2800079653U, // <3,6,6,4>: Cost 3 vsldoi12 LHS, <6,6,4,5>
- 3723333484U, // <3,6,6,5>: Cost 4 vsldoi4 <5,3,6,6>, <5,3,6,6>
- 1726337848U, // <3,6,6,6>: Cost 2 vsldoi12 LHS, <6,6,6,6>
- 1726337858U, // <3,6,6,7>: Cost 2 vsldoi12 LHS, <6,6,7,7>
- 1726337867U, // <3,6,6,u>: Cost 2 vsldoi12 LHS, <6,6,u,7>
- 1726337870U, // <3,6,7,0>: Cost 2 vsldoi12 LHS, <6,7,0,1>
- 2297906665U, // <3,6,7,1>: Cost 3 vmrglw <2,6,3,7>, <2,0,6,1>
- 2792117090U, // <3,6,7,2>: Cost 3 vsldoi12 <6,7,2,3>, <6,7,2,3>
- 2297907558U, // <3,6,7,3>: Cost 3 vmrglw <2,6,3,7>, <3,2,6,3>
- 1726337910U, // <3,6,7,4>: Cost 2 vsldoi12 LHS, <6,7,4,5>
- 2297906993U, // <3,6,7,5>: Cost 3 vmrglw <2,6,3,7>, <2,4,6,5>
- 2297906832U, // <3,6,7,6>: Cost 3 vmrglw <2,6,3,7>, <2,2,6,6>
- 1224166710U, // <3,6,7,7>: Cost 2 vmrglw <2,6,3,7>, RHS
- 1224166711U, // <3,6,7,u>: Cost 2 vmrglw <2,6,3,7>, RHS
- 1726337951U, // <3,6,u,0>: Cost 2 vsldoi12 LHS, <6,u,0,1>
- 2699892526U, // <3,6,u,1>: Cost 3 vsldoi8 <2,5,3,6>, LHS
- 2789168049U, // <3,6,u,2>: Cost 3 vsldoi12 <6,2,7,3>, <6,u,2,1>
- 2792854460U, // <3,6,u,3>: Cost 3 vsldoi12 <6,u,3,3>, <6,u,3,3>
- 1726337991U, // <3,6,u,4>: Cost 2 vsldoi12 LHS, <6,u,4,5>
- 2699892890U, // <3,6,u,5>: Cost 3 vsldoi8 <2,5,3,6>, RHS
- 1726337848U, // <3,6,u,6>: Cost 2 vsldoi12 LHS, <6,6,6,6>
- 1215548726U, // <3,6,u,7>: Cost 2 vmrglw <1,2,3,u>, RHS
- 1215548727U, // <3,6,u,u>: Cost 2 vmrglw <1,2,3,u>, RHS
- 2700558336U, // <3,7,0,0>: Cost 3 vsldoi8 <2,6,3,7>, <0,0,0,0>
- 1626816614U, // <3,7,0,1>: Cost 2 vsldoi8 <2,6,3,7>, LHS
- 2700558513U, // <3,7,0,2>: Cost 3 vsldoi8 <2,6,3,7>, <0,2,1,6>
- 2331030010U, // <3,7,0,3>: Cost 3 vmrglw <u,2,3,0>, <6,2,7,3>
- 2700558674U, // <3,7,0,4>: Cost 3 vsldoi8 <2,6,3,7>, <0,4,1,5>
- 2800079906U, // <3,7,0,5>: Cost 3 vsldoi12 LHS, <7,0,5,6>
- 2655588936U, // <3,7,0,6>: Cost 3 vsldoi4 <6,3,7,0>, <6,3,7,0>
- 2800079919U, // <3,7,0,7>: Cost 3 vsldoi12 LHS, <7,0,7,1>
- 1626817181U, // <3,7,0,u>: Cost 2 vsldoi8 <2,6,3,7>, LHS
- 3774300899U, // <3,7,1,0>: Cost 4 vsldoi8 <2,6,3,7>, <1,0,1,1>
- 2700559156U, // <3,7,1,1>: Cost 3 vsldoi8 <2,6,3,7>, <1,1,1,1>
- 2700559254U, // <3,7,1,2>: Cost 3 vsldoi8 <2,6,3,7>, <1,2,3,0>
- 3774301148U, // <3,7,1,3>: Cost 4 vsldoi8 <2,6,3,7>, <1,3,1,7>
- 3774301227U, // <3,7,1,4>: Cost 4 vsldoi8 <2,6,3,7>, <1,4,1,5>
- 3774301295U, // <3,7,1,5>: Cost 4 vsldoi8 <2,6,3,7>, <1,5,0,1>
- 3768329441U, // <3,7,1,6>: Cost 4 vsldoi8 <1,6,3,7>, <1,6,3,7>
- 3403453250U, // <3,7,1,7>: Cost 4 vmrglw <u,0,3,1>, <6,6,7,7>
- 2700559740U, // <3,7,1,u>: Cost 3 vsldoi8 <2,6,3,7>, <1,u,3,0>
- 2700559849U, // <3,7,2,0>: Cost 3 vsldoi8 <2,6,3,7>, <2,0,6,1>
- 3770983973U, // <3,7,2,1>: Cost 4 vsldoi8 <2,1,3,7>, <2,1,3,7>
- 2700559976U, // <3,7,2,2>: Cost 3 vsldoi8 <2,6,3,7>, <2,2,2,2>
- 2698569415U, // <3,7,2,3>: Cost 3 vsldoi8 <2,3,3,7>, <2,3,3,7>
- 2700560177U, // <3,7,2,4>: Cost 3 vsldoi8 <2,6,3,7>, <2,4,6,5>
- 3773638505U, // <3,7,2,5>: Cost 4 vsldoi8 <2,5,3,7>, <2,5,3,7>
- 1626818490U, // <3,7,2,6>: Cost 2 vsldoi8 <2,6,3,7>, <2,6,3,7>
- 2795140307U, // <3,7,2,7>: Cost 3 vsldoi12 <7,2,7,3>, <7,2,7,3>
- 1628145756U, // <3,7,2,u>: Cost 2 vsldoi8 <2,u,3,7>, <2,u,3,7>
- 2700560534U, // <3,7,3,0>: Cost 3 vsldoi8 <2,6,3,7>, <3,0,1,2>
- 3774302438U, // <3,7,3,1>: Cost 4 vsldoi8 <2,6,3,7>, <3,1,1,1>
- 2700560742U, // <3,7,3,2>: Cost 3 vsldoi8 <2,6,3,7>, <3,2,6,3>
- 2700560796U, // <3,7,3,3>: Cost 3 vsldoi8 <2,6,3,7>, <3,3,3,3>
- 2700560898U, // <3,7,3,4>: Cost 3 vsldoi8 <2,6,3,7>, <3,4,5,6>
- 3774302821U, // <3,7,3,5>: Cost 4 vsldoi8 <2,6,3,7>, <3,5,7,6>
- 2700561079U, // <3,7,3,6>: Cost 3 vsldoi8 <2,6,3,7>, <3,6,7,7>
- 2700561091U, // <3,7,3,7>: Cost 3 vsldoi8 <2,6,3,7>, <3,7,0,1>
- 2700561182U, // <3,7,3,u>: Cost 3 vsldoi8 <2,6,3,7>, <3,u,1,2>
- 2655617126U, // <3,7,4,0>: Cost 3 vsldoi4 <6,3,7,4>, LHS
- 3774303178U, // <3,7,4,1>: Cost 4 vsldoi8 <2,6,3,7>, <4,1,2,3>
- 2655619002U, // <3,7,4,2>: Cost 3 vsldoi4 <6,3,7,4>, <2,6,3,7>
- 2331062778U, // <3,7,4,3>: Cost 3 vmrglw <u,2,3,4>, <6,2,7,3>
- 2655620406U, // <3,7,4,4>: Cost 3 vsldoi4 <6,3,7,4>, RHS
- 1626819894U, // <3,7,4,5>: Cost 2 vsldoi8 <2,6,3,7>, RHS
- 2655621708U, // <3,7,4,6>: Cost 3 vsldoi4 <6,3,7,4>, <6,3,7,4>
- 2800080247U, // <3,7,4,7>: Cost 3 vsldoi12 LHS, <7,4,7,5>
- 1626820137U, // <3,7,4,u>: Cost 2 vsldoi8 <2,6,3,7>, RHS
- 3774303816U, // <3,7,5,0>: Cost 4 vsldoi8 <2,6,3,7>, <5,0,1,2>
- 3873822093U, // <3,7,5,1>: Cost 4 vsldoi12 LHS, <7,5,1,0>
- 3774303998U, // <3,7,5,2>: Cost 4 vsldoi8 <2,6,3,7>, <5,2,3,4>
- 3862910368U, // <3,7,5,3>: Cost 4 vsldoi12 <6,2,7,3>, <7,5,3,1>
- 3774304180U, // <3,7,5,4>: Cost 4 vsldoi8 <2,6,3,7>, <5,4,5,6>
- 2800080310U, // <3,7,5,5>: Cost 3 vsldoi12 LHS, <7,5,5,5>
- 2800080321U, // <3,7,5,6>: Cost 3 vsldoi12 LHS, <7,5,6,7>
- 3873822147U, // <3,7,5,7>: Cost 4 vsldoi12 LHS, <7,5,7,0>
- 2800080339U, // <3,7,5,u>: Cost 3 vsldoi12 LHS, <7,5,u,7>
- 2800080348U, // <3,7,6,0>: Cost 3 vsldoi12 LHS, <7,6,0,7>
- 3873822181U, // <3,7,6,1>: Cost 4 vsldoi12 LHS, <7,6,1,7>
- 2789168622U, // <3,7,6,2>: Cost 3 vsldoi12 <6,2,7,3>, <7,6,2,7>
- 2700563016U, // <3,7,6,3>: Cost 3 vsldoi8 <2,6,3,7>, <6,3,7,0>
- 2800080384U, // <3,7,6,4>: Cost 3 vsldoi12 LHS, <7,6,4,7>
- 3862910472U, // <3,7,6,5>: Cost 4 vsldoi12 <6,2,7,3>, <7,6,5,6>
- 2700563256U, // <3,7,6,6>: Cost 3 vsldoi8 <2,6,3,7>, <6,6,6,6>
- 2800080404U, // <3,7,6,7>: Cost 3 vsldoi12 LHS, <7,6,7,0>
- 2793149988U, // <3,7,6,u>: Cost 3 vsldoi12 <6,u,7,3>, <7,6,u,7>
- 2637725798U, // <3,7,7,0>: Cost 3 vsldoi4 <3,3,7,7>, LHS
- 3371649227U, // <3,7,7,1>: Cost 4 vmrglw <2,6,3,7>, <3,0,7,1>
- 2637727674U, // <3,7,7,2>: Cost 3 vsldoi4 <3,3,7,7>, <2,6,3,7>
- 2297907567U, // <3,7,7,3>: Cost 3 vmrglw <2,6,3,7>, <3,2,7,3>
- 2637729078U, // <3,7,7,4>: Cost 3 vsldoi4 <3,3,7,7>, RHS
- 3371649312U, // <3,7,7,5>: Cost 4 vmrglw <2,6,3,7>, <3,1,7,5>
- 2655646287U, // <3,7,7,6>: Cost 3 vsldoi4 <6,3,7,7>, <6,3,7,7>
- 1726338668U, // <3,7,7,7>: Cost 2 vsldoi12 LHS, <7,7,7,7>
- 1726338668U, // <3,7,7,u>: Cost 2 vsldoi12 LHS, <7,7,7,7>
- 2700564179U, // <3,7,u,0>: Cost 3 vsldoi8 <2,6,3,7>, <u,0,1,2>
- 1626822446U, // <3,7,u,1>: Cost 2 vsldoi8 <2,6,3,7>, LHS
- 2700564357U, // <3,7,u,2>: Cost 3 vsldoi8 <2,6,3,7>, <u,2,3,0>
- 2700564412U, // <3,7,u,3>: Cost 3 vsldoi8 <2,6,3,7>, <u,3,0,1>
- 2700564543U, // <3,7,u,4>: Cost 3 vsldoi8 <2,6,3,7>, <u,4,5,6>
- 1626822810U, // <3,7,u,5>: Cost 2 vsldoi8 <2,6,3,7>, RHS
- 1662654672U, // <3,7,u,6>: Cost 2 vsldoi8 <u,6,3,7>, <u,6,3,7>
- 1726338668U, // <3,7,u,7>: Cost 2 vsldoi12 LHS, <7,7,7,7>
- 1626823013U, // <3,7,u,u>: Cost 2 vsldoi8 <2,6,3,7>, LHS
- 1678557184U, // <3,u,0,0>: Cost 2 vsldoi12 LHS, <0,0,0,0>
- 1679005395U, // <3,u,0,1>: Cost 2 vsldoi12 LHS, <u,0,1,2>
- 2289221787U, // <3,u,0,2>: Cost 3 vmrglw <1,2,3,0>, <0,1,u,2>
- 1215479964U, // <3,u,0,3>: Cost 2 vmrglw <1,2,3,0>, LHS
- 2752747245U, // <3,u,0,4>: Cost 3 vsldoi12 LHS, <u,0,4,1>
- 1158863002U, // <3,u,0,5>: Cost 2 vmrghw <3,0,1,2>, RHS
- 2289224221U, // <3,u,0,6>: Cost 3 vmrglw <1,2,3,0>, <3,4,u,6>
- 1215483208U, // <3,u,0,7>: Cost 2 vmrglw <1,2,3,0>, RHS
- 1679005458U, // <3,u,0,u>: Cost 2 vsldoi12 LHS, <u,0,u,2>
- 1558036582U, // <3,u,1,0>: Cost 2 vsldoi4 <2,3,u,1>, LHS
- 1678558004U, // <3,u,1,1>: Cost 2 vsldoi12 LHS, <1,1,1,1>
- 604821294U, // <3,u,1,2>: Cost 1 vsldoi12 LHS, LHS
- 2752747317U, // <3,u,1,3>: Cost 3 vsldoi12 LHS, <u,1,3,1>
- 1558039862U, // <3,u,1,4>: Cost 2 vsldoi4 <2,3,u,1>, RHS
- 2756949830U, // <3,u,1,5>: Cost 3 vsldoi12 LHS, <u,1,5,0>
- 2800080726U, // <3,u,1,6>: Cost 3 vsldoi12 LHS, <u,1,6,7>
- 2289233224U, // <3,u,1,7>: Cost 3 vmrglw <1,2,3,1>, RHS
- 604821348U, // <3,u,1,u>: Cost 1 vsldoi12 LHS, LHS
- 2696586709U, // <3,u,2,0>: Cost 3 vsldoi8 <2,0,3,u>, <2,0,3,u>
- 2757392246U, // <3,u,2,1>: Cost 3 vsldoi12 LHS, <u,2,1,3>
- 1624172151U, // <3,u,2,2>: Cost 2 vsldoi8 <2,2,3,u>, <2,2,3,u>
- 1679005576U, // <3,u,2,3>: Cost 2 vsldoi12 LHS, <u,2,3,3>
- 2631789878U, // <3,u,2,4>: Cost 3 vsldoi4 <2,3,u,2>, RHS
- 2699904874U, // <3,u,2,5>: Cost 3 vsldoi8 <2,5,3,u>, <2,5,3,u>
- 1626826683U, // <3,u,2,6>: Cost 2 vsldoi8 <2,6,3,u>, <2,6,3,u>
- 1726338988U, // <3,u,2,7>: Cost 2 vsldoi12 LHS, <u,2,7,3>
- 1683208117U, // <3,u,2,u>: Cost 2 vsldoi12 LHS, <u,2,u,3>
- 1679005628U, // <3,u,3,0>: Cost 2 vsldoi12 LHS, <u,3,0,1>
- 1161008942U, // <3,u,3,1>: Cost 2 vmrghw <3,3,3,3>, LHS
- 2752747471U, // <3,u,3,2>: Cost 3 vsldoi12 LHS, <u,3,2,2>
- 403488870U, // <3,u,3,3>: Cost 1 vspltisw3 LHS
- 1679005668U, // <3,u,3,4>: Cost 2 vsldoi12 LHS, <u,3,4,5>
- 1161009306U, // <3,u,3,5>: Cost 2 vmrghw <3,3,3,3>, RHS
- 2691943104U, // <3,u,3,6>: Cost 3 vsldoi8 <1,2,3,u>, <3,6,u,7>
- 1221479752U, // <3,u,3,7>: Cost 2 vmrglw <2,2,3,3>, RHS
- 403488870U, // <3,u,3,u>: Cost 1 vspltisw3 LHS
- 2289255363U, // <3,u,4,0>: Cost 3 vmrglw <1,2,3,4>, <1,2,u,0>
- 1161844526U, // <3,u,4,1>: Cost 2 vmrghw <3,4,5,6>, LHS
- 2289256661U, // <3,u,4,2>: Cost 3 vmrglw <1,2,3,4>, <3,0,u,2>
- 1215512732U, // <3,u,4,3>: Cost 2 vmrglw <1,2,3,4>, LHS
- 1215513498U, // <3,u,4,4>: Cost 2 vmrglw <1,2,3,4>, <1,2,3,4>
- 1679005759U, // <3,u,4,5>: Cost 2 vsldoi12 LHS, <u,4,5,6>
- 2289256989U, // <3,u,4,6>: Cost 3 vmrglw <1,2,3,4>, <3,4,u,6>
- 1215515976U, // <3,u,4,7>: Cost 2 vmrglw <1,2,3,4>, RHS
- 1679005786U, // <3,u,4,u>: Cost 2 vsldoi12 LHS, <u,4,u,6>
- 1558069350U, // <3,u,5,0>: Cost 2 vsldoi4 <2,3,u,5>, LHS
- 2631811892U, // <3,u,5,1>: Cost 3 vsldoi4 <2,3,u,5>, <1,1,1,1>
- 1558071026U, // <3,u,5,2>: Cost 2 vsldoi4 <2,3,u,5>, <2,3,u,5>
- 2752747646U, // <3,u,5,3>: Cost 3 vsldoi12 LHS, <u,5,3,6>
- 1558072630U, // <3,u,5,4>: Cost 2 vsldoi4 <2,3,u,5>, RHS
- 1726337028U, // <3,u,5,5>: Cost 2 vsldoi12 LHS, <5,5,5,5>
- 604821658U, // <3,u,5,6>: Cost 1 vsldoi12 LHS, RHS
- 2294574408U, // <3,u,5,7>: Cost 3 vmrglw <2,1,3,5>, RHS
- 604821676U, // <3,u,5,u>: Cost 1 vsldoi12 LHS, RHS
- 2631819366U, // <3,u,6,0>: Cost 3 vsldoi4 <2,3,u,6>, LHS
- 2757392574U, // <3,u,6,1>: Cost 3 vsldoi12 LHS, <u,6,1,7>
- 2631821043U, // <3,u,6,2>: Cost 3 vsldoi4 <2,3,u,6>, <2,3,u,6>
- 1679005904U, // <3,u,6,3>: Cost 2 vsldoi12 LHS, <u,6,3,7>
- 2631822646U, // <3,u,6,4>: Cost 3 vsldoi4 <2,3,u,6>, RHS
- 2236553370U, // <3,u,6,5>: Cost 3 vmrghw <3,6,0,7>, RHS
- 1726337848U, // <3,u,6,6>: Cost 2 vsldoi12 LHS, <6,6,6,6>
- 1726339309U, // <3,u,6,7>: Cost 2 vsldoi12 LHS, <u,6,7,0>
- 1683208445U, // <3,u,6,u>: Cost 2 vsldoi12 LHS, <u,6,u,7>
- 1726339328U, // <3,u,7,0>: Cost 2 vsldoi12 LHS, <u,7,0,1>
- 2297905225U, // <3,u,7,1>: Cost 3 vmrglw <2,6,3,7>, <0,0,u,1>
- 2631829236U, // <3,u,7,2>: Cost 3 vsldoi4 <2,3,u,7>, <2,3,u,7>
- 1224163484U, // <3,u,7,3>: Cost 2 vmrglw <2,6,3,7>, LHS
- 1726339368U, // <3,u,7,4>: Cost 2 vsldoi12 LHS, <u,7,4,5>
- 2297905553U, // <3,u,7,5>: Cost 3 vmrglw <2,6,3,7>, <0,4,u,5>
- 2297905392U, // <3,u,7,6>: Cost 3 vmrglw <2,6,3,7>, <0,2,u,6>
- 1224166728U, // <3,u,7,7>: Cost 2 vmrglw <2,6,3,7>, RHS
- 1224163489U, // <3,u,7,u>: Cost 2 vmrglw <2,6,3,7>, LHS
- 1683208529U, // <3,u,u,0>: Cost 2 vsldoi12 LHS, <u,u,0,1>
- 1679006043U, // <3,u,u,1>: Cost 2 vsldoi12 LHS, <u,u,1,2>
- 604821861U, // <3,u,u,2>: Cost 1 vsldoi12 LHS, LHS
- 403488870U, // <3,u,u,3>: Cost 1 vspltisw3 LHS
- 1683208569U, // <3,u,u,4>: Cost 2 vsldoi12 LHS, <u,u,4,5>
- 1679006083U, // <3,u,u,5>: Cost 2 vsldoi12 LHS, <u,u,5,6>
- 604821901U, // <3,u,u,6>: Cost 1 vsldoi12 LHS, RHS
- 1215548744U, // <3,u,u,7>: Cost 2 vmrglw <1,2,3,u>, RHS
- 604821915U, // <3,u,u,u>: Cost 1 vsldoi12 LHS, LHS
- 2759016448U, // <4,0,0,0>: Cost 3 vsldoi12 <1,2,3,4>, <0,0,0,0>
- 1165115494U, // <4,0,0,1>: Cost 2 vmrghw <4,0,5,1>, LHS
- 3717531337U, // <4,0,0,2>: Cost 4 vsldoi4 <4,4,0,0>, <2,3,4,0>
- 3369675785U, // <4,0,0,3>: Cost 4 vmrglw <2,3,4,0>, <4,2,0,3>
- 2751791144U, // <4,0,0,4>: Cost 3 vsldoi12 <0,0,4,4>, <0,0,4,4>
- 2238857630U, // <4,0,0,5>: Cost 3 vmrghw <4,0,5,1>, <0,5,1,0>
- 3312591341U, // <4,0,0,6>: Cost 4 vmrghw <4,0,5,0>, <0,6,0,7>
- 3369676113U, // <4,0,0,7>: Cost 4 vmrglw <2,3,4,0>, <4,6,0,7>
- 1165116061U, // <4,0,0,u>: Cost 2 vmrghw <4,0,5,1>, LHS
- 2637824102U, // <4,0,1,0>: Cost 3 vsldoi4 <3,4,0,1>, LHS
- 2637824922U, // <4,0,1,1>: Cost 3 vsldoi4 <3,4,0,1>, <1,2,3,4>
- 1685274726U, // <4,0,1,2>: Cost 2 vsldoi12 <1,2,3,4>, LHS
- 2637826512U, // <4,0,1,3>: Cost 3 vsldoi4 <3,4,0,1>, <3,4,0,1>
- 2637827382U, // <4,0,1,4>: Cost 3 vsldoi4 <3,4,0,1>, RHS
- 2661716070U, // <4,0,1,5>: Cost 3 vsldoi4 <7,4,0,1>, <5,6,7,4>
- 3729486427U, // <4,0,1,6>: Cost 4 vsldoi4 <6,4,0,1>, <6,4,0,1>
- 2661717300U, // <4,0,1,7>: Cost 3 vsldoi4 <7,4,0,1>, <7,4,0,1>
- 1685274780U, // <4,0,1,u>: Cost 2 vsldoi12 <1,2,3,4>, LHS
- 3711574118U, // <4,0,2,0>: Cost 4 vsldoi4 <3,4,0,2>, LHS
- 2240200806U, // <4,0,2,1>: Cost 3 vmrghw <4,2,5,3>, LHS
- 3771663992U, // <4,0,2,2>: Cost 4 vsldoi8 <2,2,4,0>, <2,2,4,0>
- 2698585801U, // <4,0,2,3>: Cost 3 vsldoi8 <2,3,4,0>, <2,3,4,0>
- 3373672105U, // <4,0,2,4>: Cost 4 vmrglw <3,0,4,2>, <2,3,0,4>
- 3810813795U, // <4,0,2,5>: Cost 4 vsldoi8 <u,7,4,0>, <2,5,3,1>
- 3772327866U, // <4,0,2,6>: Cost 4 vsldoi8 <2,3,4,0>, <2,6,3,7>
- 3386280568U, // <4,0,2,7>: Cost 5 vmrglw <5,1,4,2>, <3,6,0,7>
- 2701903966U, // <4,0,2,u>: Cost 3 vsldoi8 <2,u,4,0>, <2,u,4,0>
- 3699638374U, // <4,0,3,0>: Cost 4 vsldoi4 <1,4,0,3>, LHS
- 2753560832U, // <4,0,3,1>: Cost 3 vsldoi12 <0,3,1,4>, <0,3,1,4>
- 3772328276U, // <4,0,3,2>: Cost 4 vsldoi8 <2,3,4,0>, <3,2,4,3>
- 3827302674U, // <4,0,3,3>: Cost 4 vsldoi12 <0,3,1,4>, <0,3,3,4>
- 3699641654U, // <4,0,3,4>: Cost 4 vsldoi4 <1,4,0,3>, RHS
- 3779627588U, // <4,0,3,5>: Cost 4 vsldoi8 <3,5,4,0>, <3,5,4,0>
- 3772328604U, // <4,0,3,6>: Cost 4 vsldoi8 <2,3,4,0>, <3,6,4,7>
- 3780954854U, // <4,0,3,7>: Cost 4 vsldoi8 <3,7,4,0>, <3,7,4,0>
- 2753560832U, // <4,0,3,u>: Cost 3 vsldoi12 <0,3,1,4>, <0,3,1,4>
- 2725129106U, // <4,0,4,0>: Cost 3 vsldoi8 <6,7,4,0>, <4,0,5,1>
- 1167720550U, // <4,0,4,1>: Cost 2 vmrghw <4,4,4,4>, LHS
- 3839172953U, // <4,0,4,2>: Cost 4 vsldoi12 <2,3,0,4>, <0,4,2,3>
- 3772329051U, // <4,0,4,3>: Cost 4 vsldoi8 <2,3,4,0>, <4,3,0,4>
- 2241462610U, // <4,0,4,4>: Cost 3 vmrghw <4,4,4,4>, <0,4,1,5>
- 2698587446U, // <4,0,4,5>: Cost 3 vsldoi8 <2,3,4,0>, RHS
- 3772329297U, // <4,0,4,6>: Cost 4 vsldoi8 <2,3,4,0>, <4,6,0,7>
- 3735483703U, // <4,0,4,7>: Cost 4 vsldoi4 <7,4,0,4>, <7,4,0,4>
- 1167721117U, // <4,0,4,u>: Cost 2 vmrghw <4,4,4,4>, LHS
- 1168556032U, // <4,0,5,0>: Cost 2 vmrghw RHS, <0,0,0,0>
- 94814310U, // <4,0,5,1>: Cost 1 vmrghw RHS, LHS
- 2242298029U, // <4,0,5,2>: Cost 3 vmrghw RHS, <0,2,1,2>
- 2637859284U, // <4,0,5,3>: Cost 3 vsldoi4 <3,4,0,5>, <3,4,0,5>
- 1168556370U, // <4,0,5,4>: Cost 2 vmrghw RHS, <0,4,1,5>
- 2242306530U, // <4,0,5,5>: Cost 3 vmrghw RHS, <0,5,u,5>
- 2242298358U, // <4,0,5,6>: Cost 3 vmrghw RHS, <0,6,1,7>
- 2661750072U, // <4,0,5,7>: Cost 3 vsldoi4 <7,4,0,5>, <7,4,0,5>
- 94814877U, // <4,0,5,u>: Cost 1 vmrghw RHS, LHS
- 3316580362U, // <4,0,6,0>: Cost 4 vmrghw <4,6,5,1>, <0,0,1,1>
- 2242846822U, // <4,0,6,1>: Cost 3 vmrghw <4,6,5,2>, LHS
- 3798872570U, // <4,0,6,2>: Cost 4 vsldoi8 <6,7,4,0>, <6,2,7,3>
- 3796218413U, // <4,0,6,3>: Cost 4 vsldoi8 <6,3,4,0>, <6,3,4,0>
- 3834528273U, // <4,0,6,4>: Cost 4 vsldoi12 <1,5,0,4>, <0,6,4,7>
- 3798872811U, // <4,0,6,5>: Cost 4 vsldoi8 <6,7,4,0>, <6,5,7,1>
- 3316621876U, // <4,0,6,6>: Cost 4 vmrghw <4,6,5,6>, <0,6,u,6>
- 2725131121U, // <4,0,6,7>: Cost 3 vsldoi8 <6,7,4,0>, <6,7,4,0>
- 2242847389U, // <4,0,6,u>: Cost 3 vmrghw <4,6,5,2>, LHS
- 3377692672U, // <4,0,7,0>: Cost 4 vmrglw <3,6,4,7>, <0,0,0,0>
- 2243493990U, // <4,0,7,1>: Cost 3 vmrghw <4,7,5,0>, LHS
- 3775648970U, // <4,0,7,2>: Cost 5 vsldoi8 <2,u,4,0>, <7,2,6,3>
- 3802191110U, // <4,0,7,3>: Cost 4 vsldoi8 <7,3,4,0>, <7,3,4,0>
- 3317236050U, // <4,0,7,4>: Cost 4 vmrghw <4,7,5,0>, <0,4,1,5>
- 3803518376U, // <4,0,7,5>: Cost 4 vsldoi8 <7,5,4,0>, <7,5,4,0>
- 3317236214U, // <4,0,7,6>: Cost 5 vmrghw <4,7,5,0>, <0,6,1,7>
- 3798873708U, // <4,0,7,7>: Cost 4 vsldoi8 <6,7,4,0>, <7,7,7,7>
- 2243494557U, // <4,0,7,u>: Cost 3 vmrghw <4,7,5,0>, LHS
- 1170546688U, // <4,0,u,0>: Cost 2 vmrghw RHS, <0,0,0,0>
- 96804966U, // <4,0,u,1>: Cost 1 vmrghw RHS, LHS
- 1685275293U, // <4,0,u,2>: Cost 2 vsldoi12 <1,2,3,4>, LHS
- 2637883863U, // <4,0,u,3>: Cost 3 vsldoi4 <3,4,0,u>, <3,4,0,u>
- 1170547026U, // <4,0,u,4>: Cost 2 vmrghw RHS, <0,4,1,5>
- 2698590362U, // <4,0,u,5>: Cost 3 vsldoi8 <2,3,4,0>, RHS
- 2244289014U, // <4,0,u,6>: Cost 3 vmrghw RHS, <0,6,1,7>
- 2661774651U, // <4,0,u,7>: Cost 3 vsldoi4 <7,4,0,u>, <7,4,0,u>
- 96805533U, // <4,0,u,u>: Cost 1 vmrghw RHS, LHS
- 2667749478U, // <4,1,0,0>: Cost 3 vsldoi4 <u,4,1,0>, LHS
- 2689966182U, // <4,1,0,1>: Cost 3 vsldoi8 <0,u,4,1>, LHS
- 2238571418U, // <4,1,0,2>: Cost 3 vmrghw <4,0,1,2>, <1,2,3,4>
- 3711633880U, // <4,1,0,3>: Cost 4 vsldoi4 <3,4,1,0>, <3,4,1,0>
- 2689966418U, // <4,1,0,4>: Cost 3 vsldoi8 <0,u,4,1>, <0,4,1,5>
- 3361046866U, // <4,1,0,5>: Cost 4 vmrglw <0,u,4,0>, <0,4,1,5>
- 3741495802U, // <4,1,0,6>: Cost 4 vsldoi4 <u,4,1,0>, <6,2,7,3>
- 3741496314U, // <4,1,0,7>: Cost 4 vsldoi4 <u,4,1,0>, <7,0,1,2>
- 2689966765U, // <4,1,0,u>: Cost 3 vsldoi8 <0,u,4,1>, <0,u,4,1>
- 3764372222U, // <4,1,1,0>: Cost 4 vsldoi8 <1,0,4,1>, <1,0,4,1>
- 2758206263U, // <4,1,1,1>: Cost 3 vsldoi12 <1,1,1,4>, <1,1,1,4>
- 2698593178U, // <4,1,1,2>: Cost 3 vsldoi8 <2,3,4,1>, <1,2,3,4>
- 3361057810U, // <4,1,1,3>: Cost 4 vmrglw <0,u,4,1>, <4,2,1,3>
- 3827303250U, // <4,1,1,4>: Cost 4 vsldoi12 <0,3,1,4>, <1,1,4,4>
- 2287313234U, // <4,1,1,5>: Cost 3 vmrglw <0,u,4,1>, <0,4,1,5>
- 3763709171U, // <4,1,1,6>: Cost 4 vsldoi8 <0,u,4,1>, <1,6,5,7>
- 3361058138U, // <4,1,1,7>: Cost 4 vmrglw <0,u,4,1>, <4,6,1,7>
- 2239759744U, // <4,1,1,u>: Cost 3 vmrghw <4,1,u,3>, <1,u,3,4>
- 2637906022U, // <4,1,2,0>: Cost 3 vsldoi4 <3,4,1,2>, LHS
- 2637906842U, // <4,1,2,1>: Cost 3 vsldoi4 <3,4,1,2>, <1,2,3,4>
- 3763709544U, // <4,1,2,2>: Cost 4 vsldoi8 <0,u,4,1>, <2,2,2,2>
- 1685275546U, // <4,1,2,3>: Cost 2 vsldoi12 <1,2,3,4>, <1,2,3,4>
- 2637909302U, // <4,1,2,4>: Cost 3 vsldoi4 <3,4,1,2>, RHS
- 3361063250U, // <4,1,2,5>: Cost 4 vmrglw <0,u,4,2>, <0,4,1,5>
- 3763709882U, // <4,1,2,6>: Cost 4 vsldoi8 <0,u,4,1>, <2,6,3,7>
- 3735541054U, // <4,1,2,7>: Cost 4 vsldoi4 <7,4,1,2>, <7,4,1,2>
- 1685644231U, // <4,1,2,u>: Cost 2 vsldoi12 <1,2,u,4>, <1,2,u,4>
- 2702575792U, // <4,1,3,0>: Cost 3 vsldoi8 <3,0,4,1>, <3,0,4,1>
- 3832759257U, // <4,1,3,1>: Cost 4 vsldoi12 <1,2,3,4>, <1,3,1,4>
- 3833349090U, // <4,1,3,2>: Cost 4 vsldoi12 <1,3,2,4>, <1,3,2,4>
- 3763710364U, // <4,1,3,3>: Cost 4 vsldoi8 <0,u,4,1>, <3,3,3,3>
- 2707884546U, // <4,1,3,4>: Cost 3 vsldoi8 <3,u,4,1>, <3,4,5,6>
- 3361071442U, // <4,1,3,5>: Cost 4 vmrglw <0,u,4,3>, <0,4,1,5>
- 3772336796U, // <4,1,3,6>: Cost 4 vsldoi8 <2,3,4,1>, <3,6,4,7>
- 3775654595U, // <4,1,3,7>: Cost 5 vsldoi8 <2,u,4,1>, <3,7,0,1>
- 2707884856U, // <4,1,3,u>: Cost 3 vsldoi8 <3,u,4,1>, <3,u,4,1>
- 2667782246U, // <4,1,4,0>: Cost 3 vsldoi4 <u,4,1,4>, LHS
- 2241463092U, // <4,1,4,1>: Cost 3 vmrghw <4,4,4,4>, <1,1,1,1>
- 2241553306U, // <4,1,4,2>: Cost 3 vmrghw <4,4,5,6>, <1,2,3,4>
- 3827303484U, // <4,1,4,3>: Cost 4 vsldoi12 <0,3,1,4>, <1,4,3,4>
- 2667785424U, // <4,1,4,4>: Cost 3 vsldoi4 <u,4,1,4>, <4,4,4,4>
- 2689969462U, // <4,1,4,5>: Cost 3 vsldoi8 <0,u,4,1>, RHS
- 3763711322U, // <4,1,4,6>: Cost 4 vsldoi8 <0,u,4,1>, <4,6,1,7>
- 3867116636U, // <4,1,4,7>: Cost 4 vsldoi12 <7,0,1,4>, <1,4,7,0>
- 2689969705U, // <4,1,4,u>: Cost 3 vsldoi8 <0,u,4,1>, RHS
- 1546273106U, // <4,1,5,0>: Cost 2 vsldoi4 <0,4,1,5>, <0,4,1,5>
- 1168556852U, // <4,1,5,1>: Cost 2 vmrghw RHS, <1,1,1,1>
- 1168556950U, // <4,1,5,2>: Cost 2 vmrghw RHS, <1,2,3,0>
- 2620016790U, // <4,1,5,3>: Cost 3 vsldoi4 <0,4,1,5>, <3,0,1,2>
- 1546276150U, // <4,1,5,4>: Cost 2 vsldoi4 <0,4,1,5>, RHS
- 2620018692U, // <4,1,5,5>: Cost 3 vsldoi4 <0,4,1,5>, <5,5,5,5>
- 2242299087U, // <4,1,5,6>: Cost 3 vmrghw RHS, <1,6,1,7>
- 2667795450U, // <4,1,5,7>: Cost 3 vsldoi4 <u,4,1,5>, <7,0,1,2>
- 1546278702U, // <4,1,5,u>: Cost 2 vsldoi4 <0,4,1,5>, LHS
- 3781628193U, // <4,1,6,0>: Cost 4 vsldoi8 <3,u,4,1>, <6,0,1,2>
- 3832759503U, // <4,1,6,1>: Cost 4 vsldoi12 <1,2,3,4>, <1,6,1,7>
- 3316261786U, // <4,1,6,2>: Cost 4 vmrghw <4,6,0,7>, <1,2,3,4>
- 3781628466U, // <4,1,6,3>: Cost 4 vsldoi8 <3,u,4,1>, <6,3,4,5>
- 3827303658U, // <4,1,6,4>: Cost 4 vsldoi12 <0,3,1,4>, <1,6,4,7>
- 3361096018U, // <4,1,6,5>: Cost 4 vmrglw <0,u,4,6>, <0,4,1,5>
- 3788264248U, // <4,1,6,6>: Cost 4 vsldoi8 <5,0,4,1>, <6,6,6,6>
- 3788264270U, // <4,1,6,7>: Cost 4 vsldoi8 <5,0,4,1>, <6,7,0,1>
- 3832759566U, // <4,1,6,u>: Cost 4 vsldoi12 <1,2,3,4>, <1,6,u,7>
- 2726466580U, // <4,1,7,0>: Cost 3 vsldoi8 <7,0,4,1>, <7,0,4,1>
- 3377692682U, // <4,1,7,1>: Cost 4 vmrglw <3,6,4,7>, <0,0,1,1>
- 3377694870U, // <4,1,7,2>: Cost 4 vmrglw <3,6,4,7>, <3,0,1,2>
- 3802199303U, // <4,1,7,3>: Cost 4 vsldoi8 <7,3,4,1>, <7,3,4,1>
- 2731775334U, // <4,1,7,4>: Cost 3 vsldoi8 <7,u,4,1>, <7,4,5,6>
- 3377693010U, // <4,1,7,5>: Cost 4 vmrglw <3,6,4,7>, <0,4,1,5>
- 3365749804U, // <4,1,7,6>: Cost 5 vmrglw <1,6,4,7>, <1,4,1,6>
- 3788265068U, // <4,1,7,7>: Cost 4 vsldoi8 <5,0,4,1>, <7,7,7,7>
- 2731775644U, // <4,1,7,u>: Cost 3 vsldoi8 <7,u,4,1>, <7,u,4,1>
- 1546297685U, // <4,1,u,0>: Cost 2 vsldoi4 <0,4,1,u>, <0,4,1,u>
- 1170547508U, // <4,1,u,1>: Cost 2 vmrghw RHS, <1,1,1,1>
- 1170547606U, // <4,1,u,2>: Cost 2 vmrghw RHS, <1,2,3,0>
- 1689257344U, // <4,1,u,3>: Cost 2 vsldoi12 <1,u,3,4>, <1,u,3,4>
- 1546300726U, // <4,1,u,4>: Cost 2 vsldoi4 <0,4,1,u>, RHS
- 2284716370U, // <4,1,u,5>: Cost 3 vmrglw <0,4,4,u>, <0,4,1,5>
- 2244289743U, // <4,1,u,6>: Cost 3 vmrghw RHS, <1,6,1,7>
- 2667820026U, // <4,1,u,7>: Cost 3 vsldoi4 <u,4,1,u>, <7,0,1,2>
- 1546303278U, // <4,1,u,u>: Cost 2 vsldoi4 <0,4,1,u>, LHS
- 3729621094U, // <4,2,0,0>: Cost 4 vsldoi4 <6,4,2,0>, LHS
- 3763716198U, // <4,2,0,1>: Cost 4 vsldoi8 <0,u,4,2>, LHS
- 2238858856U, // <4,2,0,2>: Cost 3 vmrghw <4,0,5,1>, <2,2,2,2>
- 2295930982U, // <4,2,0,3>: Cost 3 vmrglw <2,3,4,0>, LHS
- 3763716434U, // <4,2,0,4>: Cost 4 vsldoi8 <0,u,4,2>, <0,4,1,5>
- 2238859107U, // <4,2,0,5>: Cost 3 vmrghw <4,0,5,1>, <2,5,3,1>
- 2238859194U, // <4,2,0,6>: Cost 3 vmrghw <4,0,5,1>, <2,6,3,7>
- 3312601066U, // <4,2,0,7>: Cost 4 vmrghw <4,0,5,1>, <2,7,0,1>
- 2295930987U, // <4,2,0,u>: Cost 3 vmrglw <2,3,4,0>, LHS
- 3699769446U, // <4,2,1,0>: Cost 4 vsldoi4 <1,4,2,1>, LHS
- 3313255971U, // <4,2,1,1>: Cost 4 vmrghw <4,1,5,0>, <2,1,3,5>
- 3361056360U, // <4,2,1,2>: Cost 4 vmrglw <0,u,4,1>, <2,2,2,2>
- 2287312998U, // <4,2,1,3>: Cost 3 vmrglw <0,u,4,1>, LHS
- 3788932148U, // <4,2,1,4>: Cost 4 vsldoi8 <5,1,4,2>, <1,4,2,5>
- 3313256290U, // <4,2,1,5>: Cost 4 vmrghw <4,1,5,0>, <2,5,3,0>
- 3838289469U, // <4,2,1,6>: Cost 4 vsldoi12 <2,1,6,4>, <2,1,6,4>
- 3369682865U, // <4,2,1,7>: Cost 5 vmrglw <2,3,4,1>, <2,6,2,7>
- 2287313003U, // <4,2,1,u>: Cost 3 vmrglw <0,u,4,1>, LHS
- 3838658133U, // <4,2,2,0>: Cost 4 vsldoi12 <2,2,2,4>, <2,2,0,1>
- 3711722394U, // <4,2,2,1>: Cost 4 vsldoi4 <3,4,2,2>, <1,2,3,4>
- 2759018088U, // <4,2,2,2>: Cost 3 vsldoi12 <1,2,3,4>, <2,2,2,2>
- 2759018098U, // <4,2,2,3>: Cost 3 vsldoi12 <1,2,3,4>, <2,2,3,3>
- 3838658168U, // <4,2,2,4>: Cost 4 vsldoi12 <2,2,2,4>, <2,2,4,0>
- 3369027341U, // <4,2,2,5>: Cost 4 vmrglw <2,2,4,2>, <2,4,2,5>
- 2240227258U, // <4,2,2,6>: Cost 3 vmrghw <4,2,5,6>, <2,6,3,7>
- 3735614791U, // <4,2,2,7>: Cost 4 vsldoi4 <7,4,2,2>, <7,4,2,2>
- 2759018143U, // <4,2,2,u>: Cost 3 vsldoi12 <1,2,3,4>, <2,2,u,3>
- 2759018150U, // <4,2,3,0>: Cost 3 vsldoi12 <1,2,3,4>, <2,3,0,1>
- 3831948975U, // <4,2,3,1>: Cost 4 vsldoi12 <1,1,1,4>, <2,3,1,1>
- 3832759993U, // <4,2,3,2>: Cost 4 vsldoi12 <1,2,3,4>, <2,3,2,2>
- 2759018180U, // <4,2,3,3>: Cost 3 vsldoi12 <1,2,3,4>, <2,3,3,4>
- 2759018185U, // <4,2,3,4>: Cost 3 vsldoi12 <1,2,3,4>, <2,3,4,0>
- 3839542998U, // <4,2,3,5>: Cost 4 vsldoi12 <2,3,5,4>, <2,3,5,4>
- 3314640826U, // <4,2,3,6>: Cost 4 vmrghw <4,3,5,7>, <2,6,3,7>
- 2765948648U, // <4,2,3,7>: Cost 3 vsldoi12 <2,3,7,4>, <2,3,7,4>
- 2759018222U, // <4,2,3,u>: Cost 3 vsldoi12 <1,2,3,4>, <2,3,u,1>
- 3838658295U, // <4,2,4,0>: Cost 4 vsldoi12 <2,2,2,4>, <2,4,0,1>
- 3315205667U, // <4,2,4,1>: Cost 4 vmrghw <4,4,4,4>, <2,1,3,5>
- 2241463912U, // <4,2,4,2>: Cost 3 vmrghw <4,4,4,4>, <2,2,2,2>
- 1234829414U, // <4,2,4,3>: Cost 2 vmrglw <4,4,4,4>, LHS
- 2241464085U, // <4,2,4,4>: Cost 3 vmrghw <4,4,4,4>, <2,4,3,4>
- 2241546087U, // <4,2,4,5>: Cost 3 vmrghw <4,4,5,5>, <2,5,3,5>
- 2241464250U, // <4,2,4,6>: Cost 3 vmrghw <4,4,4,4>, <2,6,3,7>
- 3741602873U, // <4,2,4,7>: Cost 4 vsldoi4 <u,4,2,4>, <7,0,u,2>
- 1234829419U, // <4,2,4,u>: Cost 2 vmrglw <4,4,4,4>, LHS
- 2626060390U, // <4,2,5,0>: Cost 3 vsldoi4 <1,4,2,5>, LHS
- 2626061364U, // <4,2,5,1>: Cost 3 vsldoi4 <1,4,2,5>, <1,4,2,5>
- 1168557672U, // <4,2,5,2>: Cost 2 vmrghw RHS, <2,2,2,2>
- 1222230118U, // <4,2,5,3>: Cost 2 vmrglw <2,3,4,5>, LHS
- 2626063670U, // <4,2,5,4>: Cost 3 vsldoi4 <1,4,2,5>, RHS
- 2242299752U, // <4,2,5,5>: Cost 3 vmrghw RHS, <2,5,3,6>
- 1168558010U, // <4,2,5,6>: Cost 2 vmrghw RHS, <2,6,3,7>
- 2242299882U, // <4,2,5,7>: Cost 3 vmrghw RHS, <2,7,0,1>
- 1222230123U, // <4,2,5,u>: Cost 2 vmrglw <2,3,4,5>, LHS
- 3711754342U, // <4,2,6,0>: Cost 4 vsldoi4 <3,4,2,6>, LHS
- 3711755162U, // <4,2,6,1>: Cost 4 vsldoi4 <3,4,2,6>, <1,2,3,4>
- 3838658481U, // <4,2,6,2>: Cost 4 vsldoi12 <2,2,2,4>, <2,6,2,7>
- 2759018426U, // <4,2,6,3>: Cost 3 vsldoi12 <1,2,3,4>, <2,6,3,7>
- 3838658499U, // <4,2,6,4>: Cost 4 vsldoi12 <2,2,2,4>, <2,6,4,7>
- 3735646310U, // <4,2,6,5>: Cost 4 vsldoi4 <7,4,2,6>, <5,6,7,4>
- 3316590522U, // <4,2,6,6>: Cost 4 vmrghw <4,6,5,2>, <2,6,3,7>
- 3798889331U, // <4,2,6,7>: Cost 4 vsldoi8 <6,7,4,2>, <6,7,4,2>
- 2759018471U, // <4,2,6,u>: Cost 3 vsldoi12 <1,2,3,4>, <2,6,u,7>
- 3874564074U, // <4,2,7,0>: Cost 4 vsldoi12 <u,2,3,4>, <2,7,0,1>
- 3800880230U, // <4,2,7,1>: Cost 4 vsldoi8 <7,1,4,2>, <7,1,4,2>
- 3371722344U, // <4,2,7,2>: Cost 4 vmrglw <2,6,4,7>, <2,2,2,2>
- 2303950950U, // <4,2,7,3>: Cost 3 vmrglw <3,6,4,7>, LHS
- 3371722346U, // <4,2,7,4>: Cost 4 vmrglw <2,6,4,7>, <2,2,2,4>
- 3371722509U, // <4,2,7,5>: Cost 5 vmrglw <2,6,4,7>, <2,4,2,5>
- 3317237690U, // <4,2,7,6>: Cost 4 vmrghw <4,7,5,0>, <2,6,3,7>
- 3317237738U, // <4,2,7,7>: Cost 4 vmrghw <4,7,5,0>, <2,7,0,1>
- 2303950955U, // <4,2,7,u>: Cost 3 vmrglw <3,6,4,7>, LHS
- 2759018555U, // <4,2,u,0>: Cost 3 vsldoi12 <1,2,3,4>, <2,u,0,1>
- 2626085943U, // <4,2,u,1>: Cost 3 vsldoi4 <1,4,2,u>, <1,4,2,u>
- 1170548328U, // <4,2,u,2>: Cost 2 vmrghw RHS, <2,2,2,2>
- 1222254694U, // <4,2,u,3>: Cost 2 vmrglw <2,3,4,u>, LHS
- 2759018595U, // <4,2,u,4>: Cost 3 vsldoi12 <1,2,3,4>, <2,u,4,5>
- 2244290408U, // <4,2,u,5>: Cost 3 vmrghw RHS, <2,5,3,6>
- 1170548666U, // <4,2,u,6>: Cost 2 vmrghw RHS, <2,6,3,7>
- 2769266813U, // <4,2,u,7>: Cost 3 vsldoi12 <2,u,7,4>, <2,u,7,4>
- 1222254699U, // <4,2,u,u>: Cost 2 vmrglw <2,3,4,u>, LHS
- 2238859414U, // <4,3,0,0>: Cost 3 vmrghw <4,0,5,1>, <3,0,1,2>
- 2759018646U, // <4,3,0,1>: Cost 3 vsldoi12 <1,2,3,4>, <3,0,1,2>
- 3312314708U, // <4,3,0,2>: Cost 4 vmrghw <4,0,1,2>, <3,2,4,3>
- 2238859676U, // <4,3,0,3>: Cost 3 vmrghw <4,0,5,1>, <3,3,3,3>
- 2295931802U, // <4,3,0,4>: Cost 3 vmrglw <2,3,4,0>, <1,2,3,4>
- 3735670886U, // <4,3,0,5>: Cost 4 vsldoi4 <7,4,3,0>, <5,6,7,4>
- 3312315036U, // <4,3,0,6>: Cost 4 vmrghw <4,0,1,2>, <3,6,4,7>
- 3369674682U, // <4,3,0,7>: Cost 4 vmrglw <2,3,4,0>, <2,6,3,7>
- 2759018709U, // <4,3,0,u>: Cost 3 vsldoi12 <1,2,3,4>, <3,0,u,2>
- 3361055638U, // <4,3,1,0>: Cost 4 vmrglw <0,u,4,1>, <1,2,3,0>
- 3831949542U, // <4,3,1,1>: Cost 4 vsldoi12 <1,1,1,4>, <3,1,1,1>
- 2703917978U, // <4,3,1,2>: Cost 3 vsldoi8 <3,2,4,3>, <1,2,3,4>
- 3361056370U, // <4,3,1,3>: Cost 4 vmrglw <0,u,4,1>, <2,2,3,3>
- 2295939994U, // <4,3,1,4>: Cost 3 vmrglw <2,3,4,1>, <1,2,3,4>
- 3361056291U, // <4,3,1,5>: Cost 4 vmrglw <0,u,4,1>, <2,1,3,5>
- 3378972520U, // <4,3,1,6>: Cost 4 vmrglw <3,u,4,1>, <2,5,3,6>
- 3361056698U, // <4,3,1,7>: Cost 4 vmrglw <0,u,4,1>, <2,6,3,7>
- 2703917978U, // <4,3,1,u>: Cost 3 vsldoi8 <3,2,4,3>, <1,2,3,4>
- 3832760624U, // <4,3,2,0>: Cost 4 vsldoi12 <1,2,3,4>, <3,2,0,3>
- 3711796122U, // <4,3,2,1>: Cost 4 vsldoi4 <3,4,3,2>, <1,2,3,4>
- 3832760641U, // <4,3,2,2>: Cost 4 vsldoi12 <1,2,3,4>, <3,2,2,2>
- 2770962764U, // <4,3,2,3>: Cost 3 vsldoi12 <3,2,3,4>, <3,2,3,4>
- 2759018836U, // <4,3,2,4>: Cost 3 vsldoi12 <1,2,3,4>, <3,2,4,3>
- 3827304802U, // <4,3,2,5>: Cost 5 vsldoi12 <0,3,1,4>, <3,2,5,u>
- 3832760678U, // <4,3,2,6>: Cost 4 vsldoi12 <1,2,3,4>, <3,2,6,3>
- 3859597679U, // <4,3,2,7>: Cost 4 vsldoi12 <5,6,7,4>, <3,2,7,3>
- 2771331449U, // <4,3,2,u>: Cost 3 vsldoi12 <3,2,u,4>, <3,2,u,4>
- 2240841878U, // <4,3,3,0>: Cost 3 vmrghw <4,3,5,0>, <3,0,1,2>
- 3776997635U, // <4,3,3,1>: Cost 4 vsldoi8 <3,1,4,3>, <3,1,4,3>
- 2703919444U, // <4,3,3,2>: Cost 3 vsldoi8 <3,2,4,3>, <3,2,4,3>
- 2759018908U, // <4,3,3,3>: Cost 3 vsldoi12 <1,2,3,4>, <3,3,3,3>
- 2759018918U, // <4,3,3,4>: Cost 3 vsldoi12 <1,2,3,4>, <3,3,4,4>
- 3386951446U, // <4,3,3,5>: Cost 4 vmrglw <5,2,4,3>, <2,4,3,5>
- 3777661596U, // <4,3,3,6>: Cost 4 vsldoi8 <3,2,4,3>, <3,6,4,7>
- 3375007674U, // <4,3,3,7>: Cost 4 vmrglw <3,2,4,3>, <2,6,3,7>
- 2707901242U, // <4,3,3,u>: Cost 3 vsldoi8 <3,u,4,3>, <3,u,4,3>
- 2759018960U, // <4,3,4,0>: Cost 3 vsldoi12 <1,2,3,4>, <3,4,0,1>
- 2759018970U, // <4,3,4,1>: Cost 3 vsldoi12 <1,2,3,4>, <3,4,1,2>
- 2632099605U, // <4,3,4,2>: Cost 3 vsldoi4 <2,4,3,4>, <2,4,3,4>
- 2241464732U, // <4,3,4,3>: Cost 3 vmrghw <4,4,4,4>, <3,3,3,3>
- 2759019000U, // <4,3,4,4>: Cost 3 vsldoi12 <1,2,3,4>, <3,4,4,5>
- 2753563138U, // <4,3,4,5>: Cost 3 vsldoi12 <0,3,1,4>, <3,4,5,6>
- 3777662316U, // <4,3,4,6>: Cost 4 vsldoi8 <3,2,4,3>, <4,6,3,7>
- 2308573114U, // <4,3,4,7>: Cost 3 vmrglw <4,4,4,4>, <2,6,3,7>
- 2759019032U, // <4,3,4,u>: Cost 3 vsldoi12 <1,2,3,4>, <3,4,u,1>
- 1168558230U, // <4,3,5,0>: Cost 2 vmrghw RHS, <3,0,1,2>
- 2242300134U, // <4,3,5,1>: Cost 3 vmrghw RHS, <3,1,1,1>
- 2632107798U, // <4,3,5,2>: Cost 3 vsldoi4 <2,4,3,5>, <2,4,3,5>
- 1168558492U, // <4,3,5,3>: Cost 2 vmrghw RHS, <3,3,3,3>
- 1168558594U, // <4,3,5,4>: Cost 2 vmrghw RHS, <3,4,5,6>
- 2295973654U, // <4,3,5,5>: Cost 3 vmrglw <2,3,4,5>, <2,4,3,5>
- 2242300536U, // <4,3,5,6>: Cost 3 vmrghw RHS, <3,6,0,7>
- 2295973818U, // <4,3,5,7>: Cost 3 vmrglw <2,3,4,5>, <2,6,3,7>
- 1168558878U, // <4,3,5,u>: Cost 2 vmrghw RHS, <3,u,1,2>
- 3832760952U, // <4,3,6,0>: Cost 4 vsldoi12 <1,2,3,4>, <3,6,0,7>
- 3711828890U, // <4,3,6,1>: Cost 4 vsldoi4 <3,4,3,6>, <1,2,3,4>
- 3316484436U, // <4,3,6,2>: Cost 4 vmrghw <4,6,3,7>, <3,2,4,3>
- 3711830512U, // <4,3,6,3>: Cost 4 vsldoi4 <3,4,3,6>, <3,4,3,6>
- 2759019164U, // <4,3,6,4>: Cost 3 vsldoi12 <1,2,3,4>, <3,6,4,7>
- 3361097251U, // <4,3,6,5>: Cost 5 vmrglw <0,u,4,6>, <2,1,3,5>
- 3316624045U, // <4,3,6,6>: Cost 4 vmrghw <4,6,5,6>, <3,6,6,6>
- 2773912244U, // <4,3,6,7>: Cost 3 vsldoi12 <3,6,7,4>, <3,6,7,4>
- 2759019164U, // <4,3,6,u>: Cost 3 vsldoi12 <1,2,3,4>, <3,6,4,7>
- 3377693590U, // <4,3,7,0>: Cost 4 vmrglw <3,6,4,7>, <1,2,3,0>
- 3365751680U, // <4,3,7,1>: Cost 5 vmrglw <1,6,4,7>, <4,0,3,1>
- 2727810232U, // <4,3,7,2>: Cost 3 vsldoi8 <7,2,4,3>, <7,2,4,3>
- 3377694322U, // <4,3,7,3>: Cost 4 vmrglw <3,6,4,7>, <2,2,3,3>
- 2303951770U, // <4,3,7,4>: Cost 3 vmrglw <3,6,4,7>, <1,2,3,4>
- 3741700198U, // <4,3,7,5>: Cost 4 vsldoi4 <u,4,3,7>, <5,6,7,4>
- 3377695216U, // <4,3,7,6>: Cost 4 vmrglw <3,6,4,7>, <3,4,3,6>
- 3375703994U, // <4,3,7,7>: Cost 4 vmrglw <3,3,4,7>, <2,6,3,7>
- 2731792030U, // <4,3,7,u>: Cost 3 vsldoi8 <7,u,4,3>, <7,u,4,3>
- 1170548886U, // <4,3,u,0>: Cost 2 vmrghw RHS, <3,0,1,2>
- 2759019294U, // <4,3,u,1>: Cost 3 vsldoi12 <1,2,3,4>, <3,u,1,2>
- 2632132377U, // <4,3,u,2>: Cost 3 vsldoi4 <2,4,3,u>, <2,4,3,u>
- 1170549148U, // <4,3,u,3>: Cost 2 vmrghw RHS, <3,3,3,3>
- 1170549250U, // <4,3,u,4>: Cost 2 vmrghw RHS, <3,4,5,6>
- 2759019334U, // <4,3,u,5>: Cost 3 vsldoi12 <1,2,3,4>, <3,u,5,6>
- 2244291192U, // <4,3,u,6>: Cost 3 vmrghw RHS, <3,6,0,7>
- 2295998394U, // <4,3,u,7>: Cost 3 vmrglw <2,3,4,u>, <2,6,3,7>
- 1170549534U, // <4,3,u,u>: Cost 2 vmrghw RHS, <3,u,1,2>
- 1165118354U, // <4,4,0,0>: Cost 2 vmrghw <4,0,5,1>, <4,0,5,1>
- 1637482598U, // <4,4,0,1>: Cost 2 vsldoi8 <4,4,4,4>, LHS
- 3711854285U, // <4,4,0,2>: Cost 4 vsldoi4 <3,4,4,0>, <2,3,4,4>
- 3827305344U, // <4,4,0,3>: Cost 4 vsldoi12 <0,3,1,4>, <4,0,3,1>
- 2711224658U, // <4,4,0,4>: Cost 3 vsldoi8 <4,4,4,4>, <0,4,1,5>
- 1165118774U, // <4,4,0,5>: Cost 2 vmrghw <4,0,5,1>, RHS
- 3312602489U, // <4,4,0,6>: Cost 4 vmrghw <4,0,5,1>, <4,6,5,2>
- 3369675420U, // <4,4,0,7>: Cost 4 vmrglw <2,3,4,0>, <3,6,4,7>
- 1165119017U, // <4,4,0,u>: Cost 2 vmrghw <4,0,5,1>, RHS
- 3369682633U, // <4,4,1,0>: Cost 4 vmrglw <2,3,4,1>, <2,3,4,0>
- 2287313581U, // <4,4,1,1>: Cost 3 vmrglw <0,u,4,1>, <0,u,4,1>
- 2759019466U, // <4,4,1,2>: Cost 3 vsldoi12 <1,2,3,4>, <4,1,2,3>
- 3369683284U, // <4,4,1,3>: Cost 4 vmrglw <2,3,4,1>, <3,2,4,3>
- 2311204048U, // <4,4,1,4>: Cost 3 vmrglw <4,u,4,1>, <4,4,4,4>
- 2239319350U, // <4,4,1,5>: Cost 3 vmrghw <4,1,2,3>, RHS
- 3784967411U, // <4,4,1,6>: Cost 4 vsldoi8 <4,4,4,4>, <1,6,5,7>
- 3369683612U, // <4,4,1,7>: Cost 4 vmrglw <2,3,4,1>, <3,6,4,7>
- 2763000832U, // <4,4,1,u>: Cost 3 vsldoi12 <1,u,3,4>, <4,1,u,3>
- 3711869030U, // <4,4,2,0>: Cost 4 vsldoi4 <3,4,4,2>, LHS
- 3711869850U, // <4,4,2,1>: Cost 4 vsldoi4 <3,4,4,2>, <1,2,3,4>
- 2240203830U, // <4,4,2,2>: Cost 3 vmrghw <4,2,5,3>, <4,2,5,3>
- 2698618573U, // <4,4,2,3>: Cost 3 vsldoi8 <2,3,4,4>, <2,3,4,4>
- 2711226133U, // <4,4,2,4>: Cost 3 vsldoi8 <4,4,4,4>, <2,4,3,4>
- 2240204086U, // <4,4,2,5>: Cost 3 vmrghw <4,2,5,3>, RHS
- 2711226298U, // <4,4,2,6>: Cost 3 vsldoi8 <4,4,4,4>, <2,6,3,7>
- 3832761416U, // <4,4,2,7>: Cost 4 vsldoi12 <1,2,3,4>, <4,2,7,3>
- 2701936738U, // <4,4,2,u>: Cost 3 vsldoi8 <2,u,4,4>, <2,u,4,4>
- 2711226518U, // <4,4,3,0>: Cost 3 vsldoi8 <4,4,4,4>, <3,0,1,2>
- 3777005828U, // <4,4,3,1>: Cost 4 vsldoi8 <3,1,4,4>, <3,1,4,4>
- 3832761453U, // <4,4,3,2>: Cost 4 vsldoi12 <1,2,3,4>, <4,3,2,4>
- 2301266260U, // <4,4,3,3>: Cost 3 vmrglw <3,2,4,3>, <3,2,4,3>
- 2705254903U, // <4,4,3,4>: Cost 3 vsldoi8 <3,4,4,4>, <3,4,4,4>
- 2240843062U, // <4,4,3,5>: Cost 3 vmrghw <4,3,5,0>, RHS
- 3832761489U, // <4,4,3,6>: Cost 4 vsldoi12 <1,2,3,4>, <4,3,6,4>
- 3375008412U, // <4,4,3,7>: Cost 4 vmrglw <3,2,4,3>, <3,6,4,7>
- 2301266260U, // <4,4,3,u>: Cost 3 vmrglw <3,2,4,3>, <3,2,4,3>
- 1570373734U, // <4,4,4,0>: Cost 2 vsldoi4 <4,4,4,4>, LHS
- 2308574089U, // <4,4,4,1>: Cost 3 vmrglw <4,4,4,4>, <4,0,4,1>
- 2644117096U, // <4,4,4,2>: Cost 3 vsldoi4 <4,4,4,4>, <2,2,2,2>
- 2638146039U, // <4,4,4,3>: Cost 3 vsldoi4 <3,4,4,4>, <3,4,4,4>
- 229035318U, // <4,4,4,4>: Cost 1 vspltisw0 RHS
- 1167723830U, // <4,4,4,5>: Cost 2 vmrghw <4,4,4,4>, RHS
- 2644120058U, // <4,4,4,6>: Cost 3 vsldoi4 <4,4,4,4>, <6,2,7,3>
- 2662036827U, // <4,4,4,7>: Cost 3 vsldoi4 <7,4,4,4>, <7,4,4,4>
- 229035318U, // <4,4,4,u>: Cost 1 vspltisw0 RHS
- 1168558994U, // <4,4,5,0>: Cost 2 vmrghw RHS, <4,0,5,1>
- 2638152602U, // <4,4,5,1>: Cost 3 vsldoi4 <3,4,4,5>, <1,2,3,4>
- 2242300981U, // <4,4,5,2>: Cost 3 vmrghw RHS, <4,2,5,2>
- 2638154232U, // <4,4,5,3>: Cost 3 vsldoi4 <3,4,4,5>, <3,4,4,5>
- 1168559322U, // <4,4,5,4>: Cost 2 vmrghw RHS, <4,4,5,5>
- 94817590U, // <4,4,5,5>: Cost 1 vmrghw RHS, RHS
- 1685278006U, // <4,4,5,6>: Cost 2 vsldoi12 <1,2,3,4>, RHS
- 2242309576U, // <4,4,5,7>: Cost 3 vmrghw RHS, <4,7,5,0>
- 94817833U, // <4,4,5,u>: Cost 1 vmrghw RHS, RHS
- 3316591506U, // <4,4,6,0>: Cost 4 vmrghw <4,6,5,2>, <4,0,5,1>
- 3758428587U, // <4,4,6,1>: Cost 4 vsldoi8 <0,0,4,4>, <6,1,7,5>
- 2711228922U, // <4,4,6,2>: Cost 3 vsldoi8 <4,4,4,4>, <6,2,7,3>
- 3796251185U, // <4,4,6,3>: Cost 4 vsldoi8 <6,3,4,4>, <6,3,4,4>
- 2711229085U, // <4,4,6,4>: Cost 3 vsldoi8 <4,4,4,4>, <6,4,7,4>
- 2242850102U, // <4,4,6,5>: Cost 3 vmrghw <4,6,5,2>, RHS
- 2242850169U, // <4,4,6,6>: Cost 3 vmrghw <4,6,5,2>, <4,6,5,2>
- 2725163893U, // <4,4,6,7>: Cost 3 vsldoi8 <6,7,4,4>, <6,7,4,4>
- 2242850345U, // <4,4,6,u>: Cost 3 vmrghw <4,6,5,2>, RHS
- 2711229434U, // <4,4,7,0>: Cost 3 vsldoi8 <4,4,4,4>, <7,0,1,2>
- 3377694410U, // <4,4,7,1>: Cost 4 vmrglw <3,6,4,7>, <2,3,4,1>
- 3868593584U, // <4,4,7,2>: Cost 4 vsldoi12 <7,2,3,4>, <4,7,2,3>
- 3377695060U, // <4,4,7,3>: Cost 4 vmrglw <3,6,4,7>, <3,2,4,3>
- 2729145691U, // <4,4,7,4>: Cost 3 vsldoi8 <7,4,4,4>, <7,4,4,4>
- 2243497270U, // <4,4,7,5>: Cost 3 vmrghw <4,7,5,0>, RHS
- 3871542744U, // <4,4,7,6>: Cost 4 vsldoi12 <7,6,7,4>, <4,7,6,7>
- 2303953564U, // <4,4,7,7>: Cost 3 vmrglw <3,6,4,7>, <3,6,4,7>
- 2243497513U, // <4,4,7,u>: Cost 3 vmrghw <4,7,5,0>, RHS
- 1170549650U, // <4,4,u,0>: Cost 2 vmrghw RHS, <4,0,5,1>
- 1637488430U, // <4,4,u,1>: Cost 2 vsldoi8 <4,4,4,4>, LHS
- 2244291637U, // <4,4,u,2>: Cost 3 vmrghw RHS, <4,2,5,2>
- 2638178811U, // <4,4,u,3>: Cost 3 vsldoi4 <3,4,4,u>, <3,4,4,u>
- 229035318U, // <4,4,u,4>: Cost 1 vspltisw0 RHS
- 96808246U, // <4,4,u,5>: Cost 1 vmrghw RHS, RHS
- 1685278249U, // <4,4,u,6>: Cost 2 vsldoi12 <1,2,3,4>, RHS
- 2244292040U, // <4,4,u,7>: Cost 3 vmrghw RHS, <4,7,5,0>
- 96808489U, // <4,4,u,u>: Cost 1 vmrghw RHS, RHS
- 2698625024U, // <4,5,0,0>: Cost 3 vsldoi8 <2,3,4,5>, <0,0,0,0>
- 1624883302U, // <4,5,0,1>: Cost 2 vsldoi8 <2,3,4,5>, LHS
- 2638186190U, // <4,5,0,2>: Cost 3 vsldoi4 <3,4,5,0>, <2,3,4,5>
- 2638187004U, // <4,5,0,3>: Cost 3 vsldoi4 <3,4,5,0>, <3,4,5,0>
- 2687345005U, // <4,5,0,4>: Cost 3 vsldoi8 <0,4,4,5>, <0,4,4,5>
- 2238861316U, // <4,5,0,5>: Cost 3 vmrghw <4,0,5,1>, <5,5,5,5>
- 2662077302U, // <4,5,0,6>: Cost 3 vsldoi4 <7,4,5,0>, <6,7,4,5>
- 2662077792U, // <4,5,0,7>: Cost 3 vsldoi4 <7,4,5,0>, <7,4,5,0>
- 1624883869U, // <4,5,0,u>: Cost 2 vsldoi8 <2,3,4,5>, LHS
- 3361057762U, // <4,5,1,0>: Cost 4 vmrglw <0,u,4,1>, <4,1,5,0>
- 2691326803U, // <4,5,1,1>: Cost 3 vsldoi8 <1,1,4,5>, <1,1,4,5>
- 2698625942U, // <4,5,1,2>: Cost 3 vsldoi8 <2,3,4,5>, <1,2,3,0>
- 3361055659U, // <4,5,1,3>: Cost 4 vmrglw <0,u,4,1>, <1,2,5,3>
- 3761087567U, // <4,5,1,4>: Cost 4 vsldoi8 <0,4,4,5>, <1,4,5,5>
- 2693981335U, // <4,5,1,5>: Cost 3 vsldoi8 <1,5,4,5>, <1,5,4,5>
- 2305231362U, // <4,5,1,6>: Cost 3 vmrglw <3,u,4,1>, <3,4,5,6>
- 3361055987U, // <4,5,1,7>: Cost 4 vmrglw <0,u,4,1>, <1,6,5,7>
- 2695972234U, // <4,5,1,u>: Cost 3 vsldoi8 <1,u,4,5>, <1,u,4,5>
- 2638200934U, // <4,5,2,0>: Cost 3 vsldoi4 <3,4,5,2>, LHS
- 3761088035U, // <4,5,2,1>: Cost 4 vsldoi8 <0,4,4,5>, <2,1,3,5>
- 2697963133U, // <4,5,2,2>: Cost 3 vsldoi8 <2,2,4,5>, <2,2,4,5>
- 1624884942U, // <4,5,2,3>: Cost 2 vsldoi8 <2,3,4,5>, <2,3,4,5>
- 2698626838U, // <4,5,2,4>: Cost 3 vsldoi8 <2,3,4,5>, <2,4,3,5>
- 3772368744U, // <4,5,2,5>: Cost 4 vsldoi8 <2,3,4,5>, <2,5,3,6>
- 2698627002U, // <4,5,2,6>: Cost 3 vsldoi8 <2,3,4,5>, <2,6,3,7>
- 3775023122U, // <4,5,2,7>: Cost 4 vsldoi8 <2,7,4,5>, <2,7,4,5>
- 1628203107U, // <4,5,2,u>: Cost 2 vsldoi8 <2,u,4,5>, <2,u,4,5>
- 2698627222U, // <4,5,3,0>: Cost 3 vsldoi8 <2,3,4,5>, <3,0,1,2>
- 3765070057U, // <4,5,3,1>: Cost 4 vsldoi8 <1,1,4,5>, <3,1,1,4>
- 2698627404U, // <4,5,3,2>: Cost 3 vsldoi8 <2,3,4,5>, <3,2,3,4>
- 2698627484U, // <4,5,3,3>: Cost 3 vsldoi8 <2,3,4,5>, <3,3,3,3>
- 2698627580U, // <4,5,3,4>: Cost 3 vsldoi8 <2,3,4,5>, <3,4,5,0>
- 3779668553U, // <4,5,3,5>: Cost 4 vsldoi8 <3,5,4,5>, <3,5,4,5>
- 2725169844U, // <4,5,3,6>: Cost 3 vsldoi8 <6,7,4,5>, <3,6,7,4>
- 2707253995U, // <4,5,3,7>: Cost 3 vsldoi8 <3,7,4,5>, <3,7,4,5>
- 2698627870U, // <4,5,3,u>: Cost 3 vsldoi8 <2,3,4,5>, <3,u,1,2>
- 2638217318U, // <4,5,4,0>: Cost 3 vsldoi4 <3,4,5,4>, LHS
- 2308574098U, // <4,5,4,1>: Cost 3 vmrglw <4,4,4,4>, <4,0,5,1>
- 2698628150U, // <4,5,4,2>: Cost 3 vsldoi8 <2,3,4,5>, <4,2,5,3>
- 2638219776U, // <4,5,4,3>: Cost 3 vsldoi4 <3,4,5,4>, <3,4,5,4>
- 2698628314U, // <4,5,4,4>: Cost 3 vsldoi8 <2,3,4,5>, <4,4,5,5>
- 1624886582U, // <4,5,4,5>: Cost 2 vsldoi8 <2,3,4,5>, RHS
- 2698628478U, // <4,5,4,6>: Cost 3 vsldoi8 <2,3,4,5>, <4,6,5,7>
- 2662110564U, // <4,5,4,7>: Cost 3 vsldoi4 <7,4,5,4>, <7,4,5,4>
- 1624886825U, // <4,5,4,u>: Cost 2 vsldoi8 <2,3,4,5>, RHS
- 1570455654U, // <4,5,5,0>: Cost 2 vsldoi4 <4,4,5,5>, LHS
- 2312564250U, // <4,5,5,1>: Cost 3 vmrglw <5,1,4,5>, <4,u,5,1>
- 2644199118U, // <4,5,5,2>: Cost 3 vsldoi4 <4,4,5,5>, <2,3,4,5>
- 2295974966U, // <4,5,5,3>: Cost 3 vmrglw <2,3,4,5>, <4,2,5,3>
- 1570458842U, // <4,5,5,4>: Cost 2 vsldoi4 <4,4,5,5>, <4,4,5,5>
- 1168568324U, // <4,5,5,5>: Cost 2 vmrghw RHS, <5,5,5,5>
- 1168568418U, // <4,5,5,6>: Cost 2 vmrghw RHS, <5,6,7,0>
- 2295975294U, // <4,5,5,7>: Cost 3 vmrglw <2,3,4,5>, <4,6,5,7>
- 1168716036U, // <4,5,5,u>: Cost 2 vmrghw RHS, <5,u,7,0>
- 1564491878U, // <4,5,6,0>: Cost 2 vsldoi4 <3,4,5,6>, LHS
- 2626290768U, // <4,5,6,1>: Cost 3 vsldoi4 <1,4,5,6>, <1,4,5,6>
- 2632263465U, // <4,5,6,2>: Cost 3 vsldoi4 <2,4,5,6>, <2,4,5,6>
- 1564494338U, // <4,5,6,3>: Cost 2 vsldoi4 <3,4,5,6>, <3,4,5,6>
- 1564495158U, // <4,5,6,4>: Cost 2 vsldoi4 <3,4,5,6>, RHS
- 2638237464U, // <4,5,6,5>: Cost 3 vsldoi4 <3,4,5,6>, <5,2,6,3>
- 2656154253U, // <4,5,6,6>: Cost 3 vsldoi4 <6,4,5,6>, <6,4,5,6>
- 27705344U, // <4,5,6,7>: Cost 0 copy RHS
- 27705344U, // <4,5,6,u>: Cost 0 copy RHS
- 2725172218U, // <4,5,7,0>: Cost 3 vsldoi8 <6,7,4,5>, <7,0,1,2>
- 3859599489U, // <4,5,7,1>: Cost 4 vsldoi12 <5,6,7,4>, <5,7,1,4>
- 2698630320U, // <4,5,7,2>: Cost 3 vsldoi8 <2,3,4,5>, <7,2,3,4>
- 2728490251U, // <4,5,7,3>: Cost 3 vsldoi8 <7,3,4,5>, <7,3,4,5>
- 2725172576U, // <4,5,7,4>: Cost 3 vsldoi8 <6,7,4,5>, <7,4,5,0>
- 3317239812U, // <4,5,7,5>: Cost 4 vmrghw <4,7,5,0>, <5,5,5,5>
- 2725172760U, // <4,5,7,6>: Cost 3 vsldoi8 <6,7,4,5>, <7,6,7,4>
- 2725172844U, // <4,5,7,7>: Cost 3 vsldoi8 <6,7,4,5>, <7,7,7,7>
- 2725172866U, // <4,5,7,u>: Cost 3 vsldoi8 <6,7,4,5>, <7,u,1,2>
- 1564508262U, // <4,5,u,0>: Cost 2 vsldoi4 <3,4,5,u>, LHS
- 1624889134U, // <4,5,u,1>: Cost 2 vsldoi8 <2,3,4,5>, LHS
- 2698631045U, // <4,5,u,2>: Cost 3 vsldoi8 <2,3,4,5>, <u,2,3,0>
- 1564510724U, // <4,5,u,3>: Cost 2 vsldoi4 <3,4,5,u>, <3,4,5,u>
- 1564511542U, // <4,5,u,4>: Cost 2 vsldoi4 <3,4,5,u>, RHS
- 1624889498U, // <4,5,u,5>: Cost 2 vsldoi8 <2,3,4,5>, RHS
- 1170550882U, // <4,5,u,6>: Cost 2 vmrghw RHS, <5,6,7,0>
- 27705344U, // <4,5,u,7>: Cost 0 copy RHS
- 27705344U, // <4,5,u,u>: Cost 0 copy RHS
- 3312595285U, // <4,6,0,0>: Cost 4 vmrghw <4,0,5,0>, <6,0,7,0>
- 3763748966U, // <4,6,0,1>: Cost 4 vsldoi8 <0,u,4,6>, LHS
- 2238861818U, // <4,6,0,2>: Cost 3 vmrghw <4,0,5,1>, <6,2,7,3>
- 3767730432U, // <4,6,0,3>: Cost 4 vsldoi8 <1,5,4,6>, <0,3,1,4>
- 3763749202U, // <4,6,0,4>: Cost 4 vsldoi8 <0,u,4,6>, <0,4,1,5>
- 2238862059U, // <4,6,0,5>: Cost 3 vmrghw <4,0,5,1>, <6,5,7,1>
- 2238862136U, // <4,6,0,6>: Cost 3 vmrghw <4,0,5,1>, <6,6,6,6>
- 2295934262U, // <4,6,0,7>: Cost 3 vmrglw <2,3,4,0>, RHS
- 2295934263U, // <4,6,0,u>: Cost 3 vmrglw <2,3,4,0>, RHS
- 3378973999U, // <4,6,1,0>: Cost 4 vmrglw <3,u,4,1>, <4,5,6,0>
- 3378974648U, // <4,6,1,1>: Cost 4 vmrglw <3,u,4,1>, <5,4,6,1>
- 3779675034U, // <4,6,1,2>: Cost 4 vsldoi8 <3,5,4,6>, <1,2,3,4>
- 3378974002U, // <4,6,1,3>: Cost 4 vmrglw <3,u,4,1>, <4,5,6,3>
- 3378974003U, // <4,6,1,4>: Cost 4 vmrglw <3,u,4,1>, <4,5,6,4>
- 3767731352U, // <4,6,1,5>: Cost 4 vsldoi8 <1,5,4,6>, <1,5,4,6>
- 3378974734U, // <4,6,1,6>: Cost 4 vmrglw <3,u,4,1>, <5,5,6,6>
- 2287316278U, // <4,6,1,7>: Cost 3 vmrglw <0,u,4,1>, RHS
- 2287316279U, // <4,6,1,u>: Cost 3 vmrglw <0,u,4,1>, RHS
- 3735904358U, // <4,6,2,0>: Cost 4 vsldoi4 <7,4,6,2>, LHS
- 3763750435U, // <4,6,2,1>: Cost 5 vsldoi8 <0,u,4,6>, <2,1,3,5>
- 3313938937U, // <4,6,2,2>: Cost 4 vmrghw <4,2,5,2>, <6,2,7,2>
- 3772376782U, // <4,6,2,3>: Cost 4 vsldoi8 <2,3,4,6>, <2,3,4,5>
- 3852890591U, // <4,6,2,4>: Cost 4 vsldoi12 <4,5,6,4>, <6,2,4,3>
- 3735908454U, // <4,6,2,5>: Cost 4 vsldoi4 <7,4,6,2>, <5,6,7,4>
- 3801573306U, // <4,6,2,6>: Cost 4 vsldoi8 <7,2,4,6>, <2,6,3,7>
- 2785858042U, // <4,6,2,7>: Cost 3 vsldoi12 <5,6,7,4>, <6,2,7,3>
- 2785858051U, // <4,6,2,u>: Cost 3 vsldoi12 <5,6,7,4>, <6,2,u,3>
- 3863065101U, // <4,6,3,0>: Cost 4 vsldoi12 <6,3,0,4>, <6,3,0,4>
- 3314586024U, // <4,6,3,1>: Cost 4 vmrghw <4,3,5,0>, <6,1,7,2>
- 3863212575U, // <4,6,3,2>: Cost 4 vsldoi12 <6,3,2,4>, <6,3,2,4>
- 3863286312U, // <4,6,3,3>: Cost 4 vsldoi12 <6,3,3,4>, <6,3,3,4>
- 3767732738U, // <4,6,3,4>: Cost 4 vsldoi8 <1,5,4,6>, <3,4,5,6>
- 3779676746U, // <4,6,3,5>: Cost 4 vsldoi8 <3,5,4,6>, <3,5,4,6>
- 3398898488U, // <4,6,3,6>: Cost 4 vmrglw <7,2,4,3>, <6,6,6,6>
- 2301267254U, // <4,6,3,7>: Cost 3 vmrglw <3,2,4,3>, RHS
- 2301267255U, // <4,6,3,u>: Cost 3 vmrglw <3,2,4,3>, RHS
- 3852890715U, // <4,6,4,0>: Cost 4 vsldoi12 <4,5,6,4>, <6,4,0,1>
- 3315208615U, // <4,6,4,1>: Cost 4 vmrghw <4,4,4,4>, <6,1,7,1>
- 2241466874U, // <4,6,4,2>: Cost 3 vmrghw <4,4,4,4>, <6,2,7,3>
- 3852890745U, // <4,6,4,3>: Cost 4 vsldoi12 <4,5,6,4>, <6,4,3,4>
- 2241467037U, // <4,6,4,4>: Cost 3 vmrghw <4,4,4,4>, <6,4,7,4>
- 2241549039U, // <4,6,4,5>: Cost 3 vmrghw <4,4,5,5>, <6,5,7,5>
- 2241467192U, // <4,6,4,6>: Cost 3 vmrghw <4,4,4,4>, <6,6,6,6>
- 1234832694U, // <4,6,4,7>: Cost 2 vmrglw <4,4,4,4>, RHS
- 1234832695U, // <4,6,4,u>: Cost 2 vmrglw <4,4,4,4>, RHS
- 2242302241U, // <4,6,5,0>: Cost 3 vmrghw RHS, <6,0,1,2>
- 2242310567U, // <4,6,5,1>: Cost 3 vmrghw RHS, <6,1,7,1>
- 1168568826U, // <4,6,5,2>: Cost 2 vmrghw RHS, <6,2,7,3>
- 2242302514U, // <4,6,5,3>: Cost 3 vmrghw RHS, <6,3,4,5>
- 2242302605U, // <4,6,5,4>: Cost 3 vmrghw RHS, <6,4,5,6>
- 2242310891U, // <4,6,5,5>: Cost 3 vmrghw RHS, <6,5,7,1>
- 1168569144U, // <4,6,5,6>: Cost 2 vmrghw RHS, <6,6,6,6>
- 1222233398U, // <4,6,5,7>: Cost 2 vmrglw <2,3,4,5>, RHS
- 1222233399U, // <4,6,5,u>: Cost 2 vmrglw <2,3,4,5>, RHS
- 3316576545U, // <4,6,6,0>: Cost 4 vmrghw <4,6,5,0>, <6,0,1,2>
- 3316584871U, // <4,6,6,1>: Cost 4 vmrghw <4,6,5,1>, <6,1,7,1>
- 2242851322U, // <4,6,6,2>: Cost 3 vmrghw <4,6,5,2>, <6,2,7,3>
- 3316601394U, // <4,6,6,3>: Cost 4 vmrghw <4,6,5,3>, <6,3,4,5>
- 3852890916U, // <4,6,6,4>: Cost 4 vsldoi12 <4,5,6,4>, <6,6,4,4>
- 3316617963U, // <4,6,6,5>: Cost 4 vmrghw <4,6,5,5>, <6,5,7,1>
- 2242884408U, // <4,6,6,6>: Cost 3 vmrghw <4,6,5,6>, <6,6,6,6>
- 2785858370U, // <4,6,6,7>: Cost 3 vsldoi12 <5,6,7,4>, <6,6,7,7>
- 2785858379U, // <4,6,6,u>: Cost 3 vsldoi12 <5,6,7,4>, <6,6,u,7>
- 2785858382U, // <4,6,7,0>: Cost 3 vsldoi12 <5,6,7,4>, <6,7,0,1>
- 3859600215U, // <4,6,7,1>: Cost 4 vsldoi12 <5,6,7,4>, <6,7,1,1>
- 3317240314U, // <4,6,7,2>: Cost 4 vmrghw <4,7,5,0>, <6,2,7,3>
- 2792199020U, // <4,6,7,3>: Cost 3 vsldoi12 <6,7,3,4>, <6,7,3,4>
- 2785858422U, // <4,6,7,4>: Cost 3 vsldoi12 <5,6,7,4>, <6,7,4,5>
- 3856651132U, // <4,6,7,5>: Cost 4 vsldoi12 <5,2,3,4>, <6,7,5,2>
- 3317240632U, // <4,6,7,6>: Cost 4 vmrghw <4,7,5,0>, <6,6,6,6>
- 2303954230U, // <4,6,7,7>: Cost 3 vmrglw <3,6,4,7>, RHS
- 2303954231U, // <4,6,7,u>: Cost 3 vmrglw <3,6,4,7>, RHS
- 2244292897U, // <4,6,u,0>: Cost 3 vmrghw RHS, <6,0,1,2>
- 2244293031U, // <4,6,u,1>: Cost 3 vmrghw RHS, <6,1,7,1>
- 1170551290U, // <4,6,u,2>: Cost 2 vmrghw RHS, <6,2,7,3>
- 2244293170U, // <4,6,u,3>: Cost 3 vmrghw RHS, <6,3,4,5>
- 2244293261U, // <4,6,u,4>: Cost 3 vmrghw RHS, <6,4,5,6>
- 2244293355U, // <4,6,u,5>: Cost 3 vmrghw RHS, <6,5,7,1>
- 1170551608U, // <4,6,u,6>: Cost 2 vmrghw RHS, <6,6,6,6>
- 1222257974U, // <4,6,u,7>: Cost 2 vmrglw <2,3,4,u>, RHS
- 1222257975U, // <4,6,u,u>: Cost 2 vmrglw <2,3,4,u>, RHS
- 2238862330U, // <4,7,0,0>: Cost 3 vmrghw <4,0,5,1>, <7,0,1,2>
- 2706604134U, // <4,7,0,1>: Cost 3 vsldoi8 <3,6,4,7>, LHS
- 3312604308U, // <4,7,0,2>: Cost 4 vmrghw <4,0,5,1>, <7,2,0,3>
- 3768402176U, // <4,7,0,3>: Cost 4 vsldoi8 <1,6,4,7>, <0,3,1,4>
- 2238862648U, // <4,7,0,4>: Cost 3 vmrghw <4,0,5,1>, <7,4,0,5>
- 3859600418U, // <4,7,0,5>: Cost 4 vsldoi12 <5,6,7,4>, <7,0,5,6>
- 3729994393U, // <4,7,0,6>: Cost 4 vsldoi4 <6,4,7,0>, <6,4,7,0>
- 2238862956U, // <4,7,0,7>: Cost 3 vmrghw <4,0,5,1>, <7,7,7,7>
- 2706604701U, // <4,7,0,u>: Cost 3 vsldoi8 <3,6,4,7>, LHS
- 3385610338U, // <4,7,1,0>: Cost 4 vmrglw <5,0,4,1>, <5,6,7,0>
- 3780346676U, // <4,7,1,1>: Cost 4 vsldoi8 <3,6,4,7>, <1,1,1,1>
- 2706604954U, // <4,7,1,2>: Cost 3 vsldoi8 <3,6,4,7>, <1,2,3,4>
- 3385610746U, // <4,7,1,3>: Cost 4 vmrglw <5,0,4,1>, <6,2,7,3>
- 3385610342U, // <4,7,1,4>: Cost 4 vmrglw <5,0,4,1>, <5,6,7,4>
- 3385610667U, // <4,7,1,5>: Cost 4 vmrglw <5,0,4,1>, <6,1,7,5>
- 3768403178U, // <4,7,1,6>: Cost 4 vsldoi8 <1,6,4,7>, <1,6,4,7>
- 3385611074U, // <4,7,1,7>: Cost 4 vmrglw <5,0,4,1>, <6,6,7,7>
- 2706604954U, // <4,7,1,u>: Cost 3 vsldoi8 <3,6,4,7>, <1,2,3,4>
- 3859600532U, // <4,7,2,0>: Cost 4 vsldoi12 <5,6,7,4>, <7,2,0,3>
- 3712091034U, // <4,7,2,1>: Cost 5 vsldoi4 <3,4,7,2>, <1,2,3,4>
- 3774375528U, // <4,7,2,2>: Cost 4 vsldoi8 <2,6,4,7>, <2,2,2,2>
- 2794853552U, // <4,7,2,3>: Cost 3 vsldoi12 <7,2,3,4>, <7,2,3,4>
- 2785858744U, // <4,7,2,4>: Cost 3 vsldoi12 <5,6,7,4>, <7,2,4,3>
- 3735982182U, // <4,7,2,5>: Cost 4 vsldoi4 <7,4,7,2>, <5,6,7,4>
- 3774375875U, // <4,7,2,6>: Cost 4 vsldoi8 <2,6,4,7>, <2,6,4,7>
- 3735983476U, // <4,7,2,7>: Cost 4 vsldoi4 <7,4,7,2>, <7,4,7,2>
- 2795222237U, // <4,7,2,u>: Cost 3 vsldoi12 <7,2,u,4>, <7,2,u,4>
- 3780348054U, // <4,7,3,0>: Cost 4 vsldoi8 <3,6,4,7>, <3,0,1,2>
- 3730015130U, // <4,7,3,1>: Cost 4 vsldoi4 <6,4,7,3>, <1,2,3,4>
- 3780348244U, // <4,7,3,2>: Cost 4 vsldoi8 <3,6,4,7>, <3,2,4,3>
- 3778357673U, // <4,7,3,3>: Cost 4 vsldoi8 <3,3,4,7>, <3,3,4,7>
- 2325155942U, // <4,7,3,4>: Cost 3 vmrglw <7,2,4,3>, <5,6,7,4>
- 3779684939U, // <4,7,3,5>: Cost 5 vsldoi8 <3,5,4,7>, <3,5,4,7>
- 2706606748U, // <4,7,3,6>: Cost 3 vsldoi8 <3,6,4,7>, <3,6,4,7>
- 3398898498U, // <4,7,3,7>: Cost 4 vmrglw <7,2,4,3>, <6,6,7,7>
- 2707934014U, // <4,7,3,u>: Cost 3 vsldoi8 <3,u,4,7>, <3,u,4,7>
- 2785858868U, // <4,7,4,0>: Cost 3 vsldoi12 <5,6,7,4>, <7,4,0,1>
- 3780348874U, // <4,7,4,1>: Cost 4 vsldoi8 <3,6,4,7>, <4,1,2,3>
- 3780349000U, // <4,7,4,2>: Cost 4 vsldoi8 <3,6,4,7>, <4,2,7,3>
- 2308575738U, // <4,7,4,3>: Cost 3 vmrglw <4,4,4,4>, <6,2,7,3>
- 2656283856U, // <4,7,4,4>: Cost 3 vsldoi4 <6,4,7,4>, <4,4,4,4>
- 2706607414U, // <4,7,4,5>: Cost 3 vsldoi8 <3,6,4,7>, RHS
- 2656285341U, // <4,7,4,6>: Cost 3 vsldoi4 <6,4,7,4>, <6,4,7,4>
- 2241468012U, // <4,7,4,7>: Cost 3 vmrghw <4,4,4,4>, <7,7,7,7>
- 2706607657U, // <4,7,4,u>: Cost 3 vsldoi8 <3,6,4,7>, RHS
- 1168569338U, // <4,7,5,0>: Cost 2 vmrghw RHS, <7,0,1,2>
- 2242311242U, // <4,7,5,1>: Cost 3 vmrghw RHS, <7,1,1,1>
- 2242303178U, // <4,7,5,2>: Cost 3 vmrghw RHS, <7,2,6,3>
- 2242311395U, // <4,7,5,3>: Cost 3 vmrghw RHS, <7,3,0,1>
- 1168569702U, // <4,7,5,4>: Cost 2 vmrghw RHS, <7,4,5,6>
- 2242311606U, // <4,7,5,5>: Cost 3 vmrghw RHS, <7,5,5,5>
- 2242311662U, // <4,7,5,6>: Cost 3 vmrghw RHS, <7,6,2,7>
- 1168569964U, // <4,7,5,7>: Cost 2 vmrghw RHS, <7,7,7,7>
- 1168569986U, // <4,7,5,u>: Cost 2 vmrghw RHS, <7,u,1,2>
- 3316593658U, // <4,7,6,0>: Cost 4 vmrghw <4,6,5,2>, <7,0,1,2>
- 3316593738U, // <4,7,6,1>: Cost 5 vmrghw <4,6,5,2>, <7,1,1,1>
- 3316634800U, // <4,7,6,2>: Cost 4 vmrghw <4,6,5,7>, <7,2,3,4>
- 3386978810U, // <4,7,6,3>: Cost 4 vmrglw <5,2,4,6>, <6,2,7,3>
- 2785859072U, // <4,7,6,4>: Cost 3 vsldoi12 <5,6,7,4>, <7,6,4,7>
- 3736014950U, // <4,7,6,5>: Cost 4 vsldoi4 <7,4,7,6>, <5,6,7,4>
- 3316594158U, // <4,7,6,6>: Cost 4 vmrghw <4,6,5,2>, <7,6,2,7>
- 2797803032U, // <4,7,6,7>: Cost 3 vsldoi12 <7,6,7,4>, <7,6,7,4>
- 2797876769U, // <4,7,6,u>: Cost 3 vsldoi12 <7,6,u,4>, <7,6,u,4>
- 2243499002U, // <4,7,7,0>: Cost 3 vmrghw <4,7,5,0>, <7,0,1,2>
- 3718103962U, // <4,7,7,1>: Cost 4 vsldoi4 <4,4,7,7>, <1,2,3,4>
- 3317257418U, // <4,7,7,2>: Cost 4 vmrghw <4,7,5,2>, <7,2,6,3>
- 3377695816U, // <4,7,7,3>: Cost 4 vmrglw <3,6,4,7>, <4,2,7,3>
- 2243532134U, // <4,7,7,4>: Cost 3 vmrghw <4,7,5,4>, <7,4,5,6>
- 3317282230U, // <4,7,7,5>: Cost 4 vmrghw <4,7,5,5>, <7,5,5,5>
- 2730497536U, // <4,7,7,6>: Cost 3 vsldoi8 <7,6,4,7>, <7,6,4,7>
- 2243556972U, // <4,7,7,7>: Cost 3 vmrghw <4,7,5,7>, <7,7,7,7>
- 2243565186U, // <4,7,7,u>: Cost 3 vmrghw <4,7,5,u>, <7,u,1,2>
- 1170551802U, // <4,7,u,0>: Cost 2 vmrghw RHS, <7,0,1,2>
- 2706609966U, // <4,7,u,1>: Cost 3 vsldoi8 <3,6,4,7>, LHS
- 2244293797U, // <4,7,u,2>: Cost 3 vmrghw RHS, <7,2,2,2>
- 2244293859U, // <4,7,u,3>: Cost 3 vmrghw RHS, <7,3,0,1>
- 1170552166U, // <4,7,u,4>: Cost 2 vmrghw RHS, <7,4,5,6>
- 2706610330U, // <4,7,u,5>: Cost 3 vsldoi8 <3,6,4,7>, RHS
- 2244294126U, // <4,7,u,6>: Cost 3 vmrghw RHS, <7,6,2,7>
- 1170552428U, // <4,7,u,7>: Cost 2 vmrghw RHS, <7,7,7,7>
- 1170552450U, // <4,7,u,u>: Cost 2 vmrghw RHS, <7,u,1,2>
- 1165118354U, // <4,u,0,0>: Cost 2 vmrghw <4,0,5,1>, <4,0,5,1>
- 1624907878U, // <4,u,0,1>: Cost 2 vsldoi8 <2,3,4,u>, LHS
- 2638407377U, // <4,u,0,2>: Cost 3 vsldoi4 <3,4,u,0>, <2,3,4,u>
- 2295931036U, // <4,u,0,3>: Cost 3 vmrglw <2,3,4,0>, LHS
- 2687369584U, // <4,u,0,4>: Cost 3 vsldoi8 <0,4,4,u>, <0,4,4,u>
- 1165121690U, // <4,u,0,5>: Cost 2 vmrghw <4,0,5,1>, RHS
- 2662298489U, // <4,u,0,6>: Cost 3 vsldoi4 <7,4,u,0>, <6,7,4,u>
- 2295934280U, // <4,u,0,7>: Cost 3 vmrglw <2,3,4,0>, RHS
- 1624908445U, // <4,u,0,u>: Cost 2 vsldoi8 <2,3,4,u>, LHS
- 2638413926U, // <4,u,1,0>: Cost 3 vsldoi4 <3,4,u,1>, LHS
- 2691351382U, // <4,u,1,1>: Cost 3 vsldoi8 <1,1,4,u>, <1,1,4,u>
- 1685280558U, // <4,u,1,2>: Cost 2 vsldoi12 <1,2,3,4>, LHS
- 2287313052U, // <4,u,1,3>: Cost 3 vmrglw <0,u,4,1>, LHS
- 2299257799U, // <4,u,1,4>: Cost 3 vmrglw <2,u,4,1>, <1,2,u,4>
- 2694005914U, // <4,u,1,5>: Cost 3 vsldoi8 <1,5,4,u>, <1,5,4,u>
- 2305231362U, // <4,u,1,6>: Cost 3 vmrglw <3,u,4,1>, <3,4,5,6>
- 2287316296U, // <4,u,1,7>: Cost 3 vmrglw <0,u,4,1>, RHS
- 1685280612U, // <4,u,1,u>: Cost 2 vsldoi12 <1,2,3,4>, LHS
- 2638422118U, // <4,u,2,0>: Cost 3 vsldoi4 <3,4,u,2>, LHS
- 2240206638U, // <4,u,2,1>: Cost 3 vmrghw <4,2,5,3>, LHS
- 2697987712U, // <4,u,2,2>: Cost 3 vsldoi8 <2,2,4,u>, <2,2,4,u>
- 1624909521U, // <4,u,2,3>: Cost 2 vsldoi8 <2,3,4,u>, <2,3,4,u>
- 2759391121U, // <4,u,2,4>: Cost 3 vsldoi12 <1,2,u,4>, <u,2,4,3>
- 2240207002U, // <4,u,2,5>: Cost 3 vmrghw <4,2,5,3>, RHS
- 2698651578U, // <4,u,2,6>: Cost 3 vsldoi8 <2,3,4,u>, <2,6,3,7>
- 2785859500U, // <4,u,2,7>: Cost 3 vsldoi12 <5,6,7,4>, <u,2,7,3>
- 1628227686U, // <4,u,2,u>: Cost 2 vsldoi8 <2,u,4,u>, <2,u,4,u>
- 2759022524U, // <4,u,3,0>: Cost 3 vsldoi12 <1,2,3,4>, <u,3,0,1>
- 2801342408U, // <4,u,3,1>: Cost 3 vsldoi12 <u,3,1,4>, <u,3,1,4>
- 2703960409U, // <4,u,3,2>: Cost 3 vsldoi8 <3,2,4,u>, <3,2,4,u>
- 2759022554U, // <4,u,3,3>: Cost 3 vsldoi12 <1,2,3,4>, <u,3,3,4>
- 2759022564U, // <4,u,3,4>: Cost 3 vsldoi12 <1,2,3,4>, <u,3,4,5>
- 2240845978U, // <4,u,3,5>: Cost 3 vmrghw <4,3,5,0>, RHS
- 2706614941U, // <4,u,3,6>: Cost 3 vsldoi8 <3,6,4,u>, <3,6,4,u>
- 2301267272U, // <4,u,3,7>: Cost 3 vmrglw <3,2,4,3>, RHS
- 2759022596U, // <4,u,3,u>: Cost 3 vsldoi12 <1,2,3,4>, <u,3,u,1>
- 1570668646U, // <4,u,4,0>: Cost 2 vsldoi4 <4,4,u,4>, LHS
- 1167726382U, // <4,u,4,1>: Cost 2 vmrghw <4,4,4,4>, LHS
- 2698652753U, // <4,u,4,2>: Cost 3 vsldoi8 <2,3,4,u>, <4,2,u,3>
- 1234829468U, // <4,u,4,3>: Cost 2 vmrglw <4,4,4,4>, LHS
- 229035318U, // <4,u,4,4>: Cost 1 vspltisw0 RHS
- 1624911158U, // <4,u,4,5>: Cost 2 vsldoi8 <2,3,4,u>, RHS
- 2698653081U, // <4,u,4,6>: Cost 3 vsldoi8 <2,3,4,u>, <4,6,u,7>
- 1234832712U, // <4,u,4,7>: Cost 2 vmrglw <4,4,4,4>, RHS
- 229035318U, // <4,u,4,u>: Cost 1 vspltisw0 RHS
- 1168561875U, // <4,u,5,0>: Cost 2 vmrghw RHS, <u,0,1,2>
- 94820142U, // <4,u,5,1>: Cost 1 vmrghw RHS, LHS
- 1168562053U, // <4,u,5,2>: Cost 2 vmrghw RHS, <u,2,3,0>
- 1222230172U, // <4,u,5,3>: Cost 2 vmrglw <2,3,4,5>, LHS
- 1168562239U, // <4,u,5,4>: Cost 2 vmrghw RHS, <u,4,5,6>
- 94820506U, // <4,u,5,5>: Cost 1 vmrghw RHS, RHS
- 1685280922U, // <4,u,5,6>: Cost 2 vsldoi12 <1,2,3,4>, RHS
- 1222233416U, // <4,u,5,7>: Cost 2 vmrglw <2,3,4,5>, RHS
- 94820709U, // <4,u,5,u>: Cost 1 vmrghw RHS, LHS
- 1564713062U, // <4,u,6,0>: Cost 2 vsldoi4 <3,4,u,6>, LHS
- 2626511979U, // <4,u,6,1>: Cost 3 vsldoi4 <1,4,u,6>, <1,4,u,6>
- 2632484676U, // <4,u,6,2>: Cost 3 vsldoi4 <2,4,u,6>, <2,4,u,6>
- 1564715549U, // <4,u,6,3>: Cost 2 vsldoi4 <3,4,u,6>, <3,4,u,6>
- 1564716342U, // <4,u,6,4>: Cost 2 vsldoi4 <3,4,u,6>, RHS
- 2242853018U, // <4,u,6,5>: Cost 3 vmrghw <4,6,5,2>, RHS
- 2656375464U, // <4,u,6,6>: Cost 3 vsldoi4 <6,4,u,6>, <6,4,u,6>
- 27705344U, // <4,u,6,7>: Cost 0 copy RHS
- 27705344U, // <4,u,6,u>: Cost 0 copy RHS
- 2785859840U, // <4,u,7,0>: Cost 3 vsldoi12 <5,6,7,4>, <u,7,0,1>
- 2243499822U, // <4,u,7,1>: Cost 3 vmrghw <4,7,5,0>, LHS
- 2727851197U, // <4,u,7,2>: Cost 3 vsldoi8 <7,2,4,u>, <7,2,4,u>
- 2303951004U, // <4,u,7,3>: Cost 3 vmrglw <3,6,4,7>, LHS
- 2785859880U, // <4,u,7,4>: Cost 3 vsldoi12 <5,6,7,4>, <u,7,4,5>
- 2243500186U, // <4,u,7,5>: Cost 3 vmrghw <4,7,5,0>, RHS
- 2730505729U, // <4,u,7,6>: Cost 3 vsldoi8 <7,6,4,u>, <7,6,4,u>
- 2303954248U, // <4,u,7,7>: Cost 3 vmrglw <3,6,4,7>, RHS
- 2303951009U, // <4,u,7,u>: Cost 3 vmrglw <3,6,4,7>, LHS
- 1564729446U, // <4,u,u,0>: Cost 2 vsldoi4 <3,4,u,u>, LHS
- 96810798U, // <4,u,u,1>: Cost 1 vmrghw RHS, LHS
- 1685281125U, // <4,u,u,2>: Cost 2 vsldoi12 <1,2,3,4>, LHS
- 1222254748U, // <4,u,u,3>: Cost 2 vmrglw <2,3,4,u>, LHS
- 229035318U, // <4,u,u,4>: Cost 1 vspltisw0 RHS
- 96811162U, // <4,u,u,5>: Cost 1 vmrghw RHS, RHS
- 1685281165U, // <4,u,u,6>: Cost 2 vsldoi12 <1,2,3,4>, RHS
- 27705344U, // <4,u,u,7>: Cost 0 copy RHS
- 27705344U, // <4,u,u,u>: Cost 0 copy RHS
- 2754232320U, // <5,0,0,0>: Cost 3 vsldoi12 <0,4,1,5>, <0,0,0,0>
- 2754232330U, // <5,0,0,1>: Cost 3 vsldoi12 <0,4,1,5>, <0,0,1,1>
- 3718194894U, // <5,0,0,2>: Cost 4 vsldoi4 <4,5,0,0>, <2,3,4,5>
- 3376385762U, // <5,0,0,3>: Cost 4 vmrglw <3,4,5,0>, <5,2,0,3>
- 2754232357U, // <5,0,0,4>: Cost 3 vsldoi12 <0,4,1,5>, <0,0,4,1>
- 3845816370U, // <5,0,0,5>: Cost 4 vsldoi12 <3,4,0,5>, <0,0,5,5>
- 3782353389U, // <5,0,0,6>: Cost 4 vsldoi8 <4,0,5,0>, <0,6,0,7>
- 3376386090U, // <5,0,0,7>: Cost 4 vmrglw <3,4,5,0>, <5,6,0,7>
- 2757402697U, // <5,0,0,u>: Cost 3 vsldoi12 <0,u,u,5>, <0,0,u,1>
- 2626543718U, // <5,0,1,0>: Cost 3 vsldoi4 <1,5,0,1>, LHS
- 2626544751U, // <5,0,1,1>: Cost 3 vsldoi4 <1,5,0,1>, <1,5,0,1>
- 1680490598U, // <5,0,1,2>: Cost 2 vsldoi12 <0,4,1,5>, LHS
- 3766428665U, // <5,0,1,3>: Cost 4 vsldoi8 <1,3,5,0>, <1,3,5,0>
- 2626546998U, // <5,0,1,4>: Cost 3 vsldoi4 <1,5,0,1>, RHS
- 2650435539U, // <5,0,1,5>: Cost 3 vsldoi4 <5,5,0,1>, <5,5,0,1>
- 3783017715U, // <5,0,1,6>: Cost 4 vsldoi8 <4,1,5,0>, <1,6,5,7>
- 3385019000U, // <5,0,1,7>: Cost 4 vmrglw <4,u,5,1>, <3,6,0,7>
- 1680490652U, // <5,0,1,u>: Cost 2 vsldoi12 <0,4,1,5>, LHS
- 3376398336U, // <5,0,2,0>: Cost 4 vmrglw <3,4,5,2>, <0,0,0,0>
- 2245877862U, // <5,0,2,1>: Cost 3 vmrghw <5,2,1,3>, LHS
- 3773064808U, // <5,0,2,2>: Cost 4 vsldoi8 <2,4,5,0>, <2,2,2,2>
- 2705295054U, // <5,0,2,3>: Cost 3 vsldoi8 <3,4,5,0>, <2,3,4,5>
- 3827974343U, // <5,0,2,4>: Cost 4 vsldoi12 <0,4,1,5>, <0,2,4,1>
- 3845816530U, // <5,0,2,5>: Cost 4 vsldoi12 <3,4,0,5>, <0,2,5,3>
- 3779037114U, // <5,0,2,6>: Cost 4 vsldoi8 <3,4,5,0>, <2,6,3,7>
- 3810887658U, // <5,0,2,7>: Cost 4 vsldoi8 <u,7,5,0>, <2,7,0,1>
- 2245878429U, // <5,0,2,u>: Cost 3 vmrghw <5,2,1,3>, LHS
- 2710603926U, // <5,0,3,0>: Cost 3 vsldoi8 <4,3,5,0>, <3,0,1,2>
- 3827974396U, // <5,0,3,1>: Cost 4 vsldoi12 <0,4,1,5>, <0,3,1,0>
- 3779037516U, // <5,0,3,2>: Cost 4 vsldoi8 <3,4,5,0>, <3,2,3,4>
- 3779037596U, // <5,0,3,3>: Cost 4 vsldoi8 <3,4,5,0>, <3,3,3,3>
- 2705295868U, // <5,0,3,4>: Cost 3 vsldoi8 <3,4,5,0>, <3,4,5,0>
- 3379726804U, // <5,0,3,5>: Cost 4 vmrglw <4,0,5,3>, <3,4,0,5>
- 3802925748U, // <5,0,3,6>: Cost 4 vsldoi8 <7,4,5,0>, <3,6,7,4>
- 3363138168U, // <5,0,3,7>: Cost 5 vmrglw <1,2,5,3>, <3,6,0,7>
- 2707950400U, // <5,0,3,u>: Cost 3 vsldoi8 <3,u,5,0>, <3,u,5,0>
- 2626568294U, // <5,0,4,0>: Cost 3 vsldoi4 <1,5,0,4>, LHS
- 1680490834U, // <5,0,4,1>: Cost 2 vsldoi12 <0,4,1,5>, <0,4,1,5>
- 3828048219U, // <5,0,4,2>: Cost 4 vsldoi12 <0,4,2,5>, <0,4,2,5>
- 2710604932U, // <5,0,4,3>: Cost 3 vsldoi8 <4,3,5,0>, <4,3,5,0>
- 2754232685U, // <5,0,4,4>: Cost 3 vsldoi12 <0,4,1,5>, <0,4,4,5>
- 2705296694U, // <5,0,4,5>: Cost 3 vsldoi8 <3,4,5,0>, RHS
- 3779038590U, // <5,0,4,6>: Cost 4 vsldoi8 <3,4,5,0>, <4,6,5,7>
- 2713259464U, // <5,0,4,7>: Cost 3 vsldoi8 <4,7,5,0>, <4,7,5,0>
- 1680490834U, // <5,0,4,u>: Cost 2 vsldoi12 <0,4,1,5>, <0,4,1,5>
- 2311307264U, // <5,0,5,0>: Cost 3 vmrglw <4,u,5,5>, <0,0,0,0>
- 1174437990U, // <5,0,5,1>: Cost 2 vmrghw <5,5,5,5>, LHS
- 3779038946U, // <5,0,5,2>: Cost 4 vsldoi8 <3,4,5,0>, <5,2,0,3>
- 3845816752U, // <5,0,5,3>: Cost 4 vsldoi12 <3,4,0,5>, <0,5,3,0>
- 2248180050U, // <5,0,5,4>: Cost 3 vmrghw <5,5,5,5>, <0,4,1,5>
- 2248180194U, // <5,0,5,5>: Cost 3 vmrghw <5,5,5,5>, <0,5,u,5>
- 3779039274U, // <5,0,5,6>: Cost 4 vsldoi8 <3,4,5,0>, <5,6,0,7>
- 3385051768U, // <5,0,5,7>: Cost 4 vmrglw <4,u,5,5>, <3,6,0,7>
- 1174438557U, // <5,0,5,u>: Cost 2 vmrghw <5,5,5,5>, LHS
- 2302689280U, // <5,0,6,0>: Cost 3 vmrglw <3,4,5,6>, <0,0,0,0>
- 1175208038U, // <5,0,6,1>: Cost 2 vmrghw <5,6,7,0>, LHS
- 3787002362U, // <5,0,6,2>: Cost 4 vsldoi8 <4,7,5,0>, <6,2,7,3>
- 3376432160U, // <5,0,6,3>: Cost 4 vmrglw <3,4,5,6>, <1,4,0,3>
- 2248950098U, // <5,0,6,4>: Cost 3 vmrghw <5,6,7,0>, <0,4,1,5>
- 2248950180U, // <5,0,6,5>: Cost 3 vmrghw <5,6,7,0>, <0,5,1,6>
- 3376433702U, // <5,0,6,6>: Cost 4 vmrglw <3,4,5,6>, <3,5,0,6>
- 2729186166U, // <5,0,6,7>: Cost 3 vsldoi8 <7,4,5,0>, <6,7,4,5>
- 1175208605U, // <5,0,6,u>: Cost 2 vmrghw <5,6,7,0>, LHS
- 2713261050U, // <5,0,7,0>: Cost 3 vsldoi8 <4,7,5,0>, <7,0,1,2>
- 3365823599U, // <5,0,7,1>: Cost 4 vmrglw <1,6,5,7>, <1,5,0,1>
- 3808900317U, // <5,0,7,2>: Cost 4 vsldoi8 <u,4,5,0>, <7,2,u,4>
- 3784348899U, // <5,0,7,3>: Cost 4 vsldoi8 <4,3,5,0>, <7,3,0,1>
- 2729186656U, // <5,0,7,4>: Cost 3 vsldoi8 <7,4,5,0>, <7,4,5,0>
- 3787003268U, // <5,0,7,5>: Cost 4 vsldoi8 <4,7,5,0>, <7,5,0,0>
- 3802928664U, // <5,0,7,6>: Cost 4 vsldoi8 <7,4,5,0>, <7,6,7,4>
- 3787003431U, // <5,0,7,7>: Cost 4 vsldoi8 <4,7,5,0>, <7,7,0,1>
- 2731841188U, // <5,0,7,u>: Cost 3 vsldoi8 <7,u,5,0>, <7,u,5,0>
- 2626601062U, // <5,0,u,0>: Cost 3 vsldoi4 <1,5,0,u>, LHS
- 1683145366U, // <5,0,u,1>: Cost 2 vsldoi12 <0,u,1,5>, <0,u,1,5>
- 1680491165U, // <5,0,u,2>: Cost 2 vsldoi12 <0,4,1,5>, LHS
- 2705295054U, // <5,0,u,3>: Cost 3 vsldoi8 <3,4,5,0>, <2,3,4,5>
- 2754233005U, // <5,0,u,4>: Cost 3 vsldoi12 <0,4,1,5>, <0,u,4,1>
- 2705299610U, // <5,0,u,5>: Cost 3 vsldoi8 <3,4,5,0>, RHS
- 3779041488U, // <5,0,u,6>: Cost 4 vsldoi8 <3,4,5,0>, <u,6,3,7>
- 2737150252U, // <5,0,u,7>: Cost 3 vsldoi8 <u,7,5,0>, <u,7,5,0>
- 1680491219U, // <5,0,u,u>: Cost 2 vsldoi12 <0,4,1,5>, LHS
- 2713927680U, // <5,1,0,0>: Cost 3 vsldoi8 <4,u,5,1>, <0,0,0,0>
- 1640185958U, // <5,1,0,1>: Cost 2 vsldoi8 <4,u,5,1>, LHS
- 2310607866U, // <5,1,0,2>: Cost 3 vmrglw <4,7,5,0>, <7,0,1,2>
- 3787669756U, // <5,1,0,3>: Cost 4 vsldoi8 <4,u,5,1>, <0,3,1,0>
- 2713928018U, // <5,1,0,4>: Cost 3 vsldoi8 <4,u,5,1>, <0,4,1,5>
- 2306621778U, // <5,1,0,5>: Cost 3 vmrglw <4,1,5,0>, <0,4,1,5>
- 3787670006U, // <5,1,0,6>: Cost 4 vsldoi8 <4,u,5,1>, <0,6,1,7>
- 3736188301U, // <5,1,0,7>: Cost 4 vsldoi4 <7,5,1,0>, <7,5,1,0>
- 1640186525U, // <5,1,0,u>: Cost 2 vsldoi8 <4,u,5,1>, LHS
- 2650505318U, // <5,1,1,0>: Cost 3 vsldoi4 <5,5,1,1>, LHS
- 2754233140U, // <5,1,1,1>: Cost 3 vsldoi12 <0,4,1,5>, <1,1,1,1>
- 2311276694U, // <5,1,1,2>: Cost 3 vmrglw <4,u,5,1>, <3,0,1,2>
- 2311278315U, // <5,1,1,3>: Cost 3 vmrglw <4,u,5,1>, <5,2,1,3>
- 2758435667U, // <5,1,1,4>: Cost 3 vsldoi12 <1,1,4,5>, <1,1,4,5>
- 2754233180U, // <5,1,1,5>: Cost 3 vsldoi12 <0,4,1,5>, <1,1,5,5>
- 3385016497U, // <5,1,1,6>: Cost 4 vmrglw <4,u,5,1>, <0,2,1,6>
- 2311278643U, // <5,1,1,7>: Cost 3 vmrglw <4,u,5,1>, <5,6,1,7>
- 2758730615U, // <5,1,1,u>: Cost 3 vsldoi12 <1,1,u,5>, <1,1,u,5>
- 3700367462U, // <5,1,2,0>: Cost 4 vsldoi4 <1,5,1,2>, LHS
- 3830629255U, // <5,1,2,1>: Cost 4 vsldoi12 <0,u,1,5>, <1,2,1,3>
- 2713929320U, // <5,1,2,2>: Cost 3 vsldoi8 <4,u,5,1>, <2,2,2,2>
- 2754233238U, // <5,1,2,3>: Cost 3 vsldoi12 <0,4,1,5>, <1,2,3,0>
- 2759099300U, // <5,1,2,4>: Cost 3 vsldoi12 <1,2,4,5>, <1,2,4,5>
- 2754233259U, // <5,1,2,5>: Cost 3 vsldoi12 <0,4,1,5>, <1,2,5,3>
- 2713929658U, // <5,1,2,6>: Cost 3 vsldoi8 <4,u,5,1>, <2,6,3,7>
- 3872359354U, // <5,1,2,7>: Cost 4 vsldoi12 <7,u,0,5>, <1,2,7,0>
- 2754233283U, // <5,1,2,u>: Cost 3 vsldoi12 <0,4,1,5>, <1,2,u,0>
- 2713929878U, // <5,1,3,0>: Cost 3 vsldoi8 <4,u,5,1>, <3,0,1,2>
- 3363135498U, // <5,1,3,1>: Cost 4 vmrglw <1,2,5,3>, <0,0,1,1>
- 3363137686U, // <5,1,3,2>: Cost 4 vmrglw <1,2,5,3>, <3,0,1,2>
- 2713930140U, // <5,1,3,3>: Cost 3 vsldoi8 <4,u,5,1>, <3,3,3,3>
- 2713930242U, // <5,1,3,4>: Cost 3 vsldoi8 <4,u,5,1>, <3,4,5,6>
- 2289394002U, // <5,1,3,5>: Cost 3 vmrglw <1,2,5,3>, <0,4,1,5>
- 3787672184U, // <5,1,3,6>: Cost 4 vsldoi8 <4,u,5,1>, <3,6,0,7>
- 3787672259U, // <5,1,3,7>: Cost 4 vsldoi8 <4,u,5,1>, <3,7,0,1>
- 2713930526U, // <5,1,3,u>: Cost 3 vsldoi8 <4,u,5,1>, <3,u,1,2>
- 1634880402U, // <5,1,4,0>: Cost 2 vsldoi8 <4,0,5,1>, <4,0,5,1>
- 2760205355U, // <5,1,4,1>: Cost 3 vsldoi12 <1,4,1,5>, <1,4,1,5>
- 2760279092U, // <5,1,4,2>: Cost 3 vsldoi12 <1,4,2,5>, <1,4,2,5>
- 3787672708U, // <5,1,4,3>: Cost 4 vsldoi8 <4,u,5,1>, <4,3,5,0>
- 2713930960U, // <5,1,4,4>: Cost 3 vsldoi8 <4,u,5,1>, <4,4,4,4>
- 1640189238U, // <5,1,4,5>: Cost 2 vsldoi8 <4,u,5,1>, RHS
- 3786345848U, // <5,1,4,6>: Cost 4 vsldoi8 <4,6,5,1>, <4,6,5,1>
- 3787009481U, // <5,1,4,7>: Cost 4 vsldoi8 <4,7,5,1>, <4,7,5,1>
- 1640189466U, // <5,1,4,u>: Cost 2 vsldoi8 <4,u,5,1>, <4,u,5,1>
- 2754233455U, // <5,1,5,0>: Cost 3 vsldoi12 <0,4,1,5>, <1,5,0,1>
- 2713931407U, // <5,1,5,1>: Cost 3 vsldoi8 <4,u,5,1>, <5,1,0,1>
- 2713931499U, // <5,1,5,2>: Cost 3 vsldoi8 <4,u,5,1>, <5,2,1,3>
- 3827975305U, // <5,1,5,3>: Cost 4 vsldoi12 <0,4,1,5>, <1,5,3,0>
- 2754233495U, // <5,1,5,4>: Cost 3 vsldoi12 <0,4,1,5>, <1,5,4,5>
- 2288746834U, // <5,1,5,5>: Cost 3 vmrglw <1,1,5,5>, <0,4,1,5>
- 2713931827U, // <5,1,5,6>: Cost 3 vsldoi8 <4,u,5,1>, <5,6,1,7>
- 3787673725U, // <5,1,5,7>: Cost 4 vsldoi8 <4,u,5,1>, <5,7,1,0>
- 2754233527U, // <5,1,5,u>: Cost 3 vsldoi12 <0,4,1,5>, <1,5,u,1>
- 2668462182U, // <5,1,6,0>: Cost 3 vsldoi4 <u,5,1,6>, LHS
- 2290746002U, // <5,1,6,1>: Cost 3 vmrglw <1,4,5,6>, <0,u,1,1>
- 2302691478U, // <5,1,6,2>: Cost 3 vmrglw <3,4,5,6>, <3,0,1,2>
- 3364488071U, // <5,1,6,3>: Cost 4 vmrglw <1,4,5,6>, <1,2,1,3>
- 2302689536U, // <5,1,6,4>: Cost 3 vmrglw <3,4,5,6>, <0,3,1,4>
- 2754233587U, // <5,1,6,5>: Cost 3 vsldoi12 <0,4,1,5>, <1,6,5,7>
- 2713932600U, // <5,1,6,6>: Cost 3 vsldoi8 <4,u,5,1>, <6,6,6,6>
- 2713932622U, // <5,1,6,7>: Cost 3 vsldoi8 <4,u,5,1>, <6,7,0,1>
- 2302689297U, // <5,1,6,u>: Cost 3 vmrglw <3,4,5,6>, <0,0,1,u>
- 2713932794U, // <5,1,7,0>: Cost 3 vsldoi8 <4,u,5,1>, <7,0,1,2>
- 3365822474U, // <5,1,7,1>: Cost 4 vmrglw <1,6,5,7>, <0,0,1,1>
- 3365824662U, // <5,1,7,2>: Cost 4 vmrglw <1,6,5,7>, <3,0,1,2>
- 3787674851U, // <5,1,7,3>: Cost 4 vsldoi8 <4,u,5,1>, <7,3,0,1>
- 2713933158U, // <5,1,7,4>: Cost 3 vsldoi8 <4,u,5,1>, <7,4,5,6>
- 2292080978U, // <5,1,7,5>: Cost 3 vmrglw <1,6,5,7>, <0,4,1,5>
- 3365823613U, // <5,1,7,6>: Cost 4 vmrglw <1,6,5,7>, <1,5,1,6>
- 2713933420U, // <5,1,7,7>: Cost 3 vsldoi8 <4,u,5,1>, <7,7,7,7>
- 2713933442U, // <5,1,7,u>: Cost 3 vsldoi8 <4,u,5,1>, <7,u,1,2>
- 1658771190U, // <5,1,u,0>: Cost 2 vsldoi8 <u,0,5,1>, <u,0,5,1>
- 1640191790U, // <5,1,u,1>: Cost 2 vsldoi8 <4,u,5,1>, LHS
- 2762933624U, // <5,1,u,2>: Cost 3 vsldoi12 <1,u,2,5>, <1,u,2,5>
- 2754233724U, // <5,1,u,3>: Cost 3 vsldoi12 <0,4,1,5>, <1,u,3,0>
- 2763081098U, // <5,1,u,4>: Cost 3 vsldoi12 <1,u,4,5>, <1,u,4,5>
- 1640192154U, // <5,1,u,5>: Cost 2 vsldoi8 <4,u,5,1>, RHS
- 2713934032U, // <5,1,u,6>: Cost 3 vsldoi8 <4,u,5,1>, <u,6,3,7>
- 2713934080U, // <5,1,u,7>: Cost 3 vsldoi8 <4,u,5,1>, <u,7,0,1>
- 1640192357U, // <5,1,u,u>: Cost 2 vsldoi8 <4,u,5,1>, LHS
- 3779051520U, // <5,2,0,0>: Cost 4 vsldoi8 <3,4,5,2>, <0,0,0,0>
- 2705309798U, // <5,2,0,1>: Cost 3 vsldoi8 <3,4,5,2>, LHS
- 3838813637U, // <5,2,0,2>: Cost 4 vsldoi12 <2,2,4,5>, <2,0,2,1>
- 2302640230U, // <5,2,0,3>: Cost 3 vmrglw <3,4,5,0>, LHS
- 3765117266U, // <5,2,0,4>: Cost 4 vsldoi8 <1,1,5,2>, <0,4,1,5>
- 3381027892U, // <5,2,0,5>: Cost 4 vmrglw <4,2,5,0>, <1,4,2,5>
- 3842794985U, // <5,2,0,6>: Cost 4 vsldoi12 <2,u,4,5>, <2,0,6,1>
- 3408232554U, // <5,2,0,7>: Cost 4 vmrglw <u,7,5,0>, <0,1,2,7>
- 2302640235U, // <5,2,0,u>: Cost 3 vmrglw <3,4,5,0>, LHS
- 3700432998U, // <5,2,1,0>: Cost 4 vsldoi4 <1,5,2,1>, LHS
- 3765117785U, // <5,2,1,1>: Cost 4 vsldoi8 <1,1,5,2>, <1,1,5,2>
- 2311276136U, // <5,2,1,2>: Cost 3 vmrglw <4,u,5,1>, <2,2,2,2>
- 1237532774U, // <5,2,1,3>: Cost 2 vmrglw <4,u,5,1>, LHS
- 3700436278U, // <5,2,1,4>: Cost 4 vsldoi4 <1,5,2,1>, RHS
- 3381036084U, // <5,2,1,5>: Cost 4 vmrglw <4,2,5,1>, <1,4,2,5>
- 3385018045U, // <5,2,1,6>: Cost 4 vmrglw <4,u,5,1>, <2,3,2,6>
- 3385017560U, // <5,2,1,7>: Cost 4 vmrglw <4,u,5,1>, <1,6,2,7>
- 1237532779U, // <5,2,1,u>: Cost 2 vmrglw <4,u,5,1>, LHS
- 3700441190U, // <5,2,2,0>: Cost 4 vsldoi4 <1,5,2,2>, LHS
- 3700442242U, // <5,2,2,1>: Cost 4 vsldoi4 <1,5,2,2>, <1,5,2,2>
- 2754233960U, // <5,2,2,2>: Cost 3 vsldoi12 <0,4,1,5>, <2,2,2,2>
- 2754233970U, // <5,2,2,3>: Cost 3 vsldoi12 <0,4,1,5>, <2,2,3,3>
- 2765071997U, // <5,2,2,4>: Cost 3 vsldoi12 <2,2,4,5>, <2,2,4,5>
- 3834021508U, // <5,2,2,5>: Cost 4 vsldoi12 <1,4,2,5>, <2,2,5,3>
- 3842795152U, // <5,2,2,6>: Cost 4 vsldoi12 <2,u,4,5>, <2,2,6,6>
- 3376402492U, // <5,2,2,7>: Cost 4 vmrglw <3,4,5,2>, <5,6,2,7>
- 2754234015U, // <5,2,2,u>: Cost 3 vsldoi12 <0,4,1,5>, <2,2,u,3>
- 2754234022U, // <5,2,3,0>: Cost 3 vsldoi12 <0,4,1,5>, <2,3,0,1>
- 3827975855U, // <5,2,3,1>: Cost 4 vsldoi12 <0,4,1,5>, <2,3,1,1>
- 2644625102U, // <5,2,3,2>: Cost 3 vsldoi4 <4,5,2,3>, <2,3,4,5>
- 2289393766U, // <5,2,3,3>: Cost 3 vmrglw <1,2,5,3>, LHS
- 1691993806U, // <5,2,3,4>: Cost 2 vsldoi12 <2,3,4,5>, <2,3,4,5>
- 2785052375U, // <5,2,3,5>: Cost 3 vsldoi12 <5,5,5,5>, <2,3,5,5>
- 3854812897U, // <5,2,3,6>: Cost 4 vsldoi12 <4,u,5,5>, <2,3,6,6>
- 3802942187U, // <5,2,3,7>: Cost 4 vsldoi8 <7,4,5,2>, <3,7,4,5>
- 1692288754U, // <5,2,3,u>: Cost 2 vsldoi12 <2,3,u,5>, <2,3,u,5>
- 3839846139U, // <5,2,4,0>: Cost 4 vsldoi12 <2,4,0,5>, <2,4,0,5>
- 2709294052U, // <5,2,4,1>: Cost 3 vsldoi8 <4,1,5,2>, <4,1,5,2>
- 2766251789U, // <5,2,4,2>: Cost 3 vsldoi12 <2,4,2,5>, <2,4,2,5>
- 2765735702U, // <5,2,4,3>: Cost 3 vsldoi12 <2,3,4,5>, <2,4,3,5>
- 3840141087U, // <5,2,4,4>: Cost 4 vsldoi12 <2,4,4,5>, <2,4,4,5>
- 2705313078U, // <5,2,4,5>: Cost 3 vsldoi8 <3,4,5,2>, RHS
- 2712612217U, // <5,2,4,6>: Cost 3 vsldoi8 <4,6,5,2>, <4,6,5,2>
- 3787017674U, // <5,2,4,7>: Cost 4 vsldoi8 <4,7,5,2>, <4,7,5,2>
- 2765735747U, // <5,2,4,u>: Cost 3 vsldoi12 <2,3,4,5>, <2,4,u,5>
- 3834021704U, // <5,2,5,0>: Cost 4 vsldoi12 <1,4,2,5>, <2,5,0,1>
- 3834021714U, // <5,2,5,1>: Cost 4 vsldoi12 <1,4,2,5>, <2,5,1,2>
- 2311308904U, // <5,2,5,2>: Cost 3 vmrglw <4,u,5,5>, <2,2,2,2>
- 1237565542U, // <5,2,5,3>: Cost 2 vmrglw <4,u,5,5>, LHS
- 3834021744U, // <5,2,5,4>: Cost 4 vsldoi12 <1,4,2,5>, <2,5,4,5>
- 3369124916U, // <5,2,5,5>: Cost 4 vmrglw <2,2,5,5>, <1,4,2,5>
- 2248181690U, // <5,2,5,6>: Cost 3 vmrghw <5,5,5,5>, <2,6,3,7>
- 3786354825U, // <5,2,5,7>: Cost 4 vsldoi8 <4,6,5,2>, <5,7,2,3>
- 1237565547U, // <5,2,5,u>: Cost 2 vmrglw <4,u,5,5>, LHS
- 3700473958U, // <5,2,6,0>: Cost 4 vsldoi4 <1,5,2,6>, LHS
- 3700475014U, // <5,2,6,1>: Cost 4 vsldoi4 <1,5,2,6>, <1,5,2,6>
- 2296718952U, // <5,2,6,2>: Cost 3 vmrglw <2,4,5,6>, <2,2,2,2>
- 1228947558U, // <5,2,6,3>: Cost 2 vmrglw <3,4,5,6>, LHS
- 3700477238U, // <5,2,6,4>: Cost 4 vsldoi4 <1,5,2,6>, RHS
- 3834021836U, // <5,2,6,5>: Cost 4 vsldoi12 <1,4,2,5>, <2,6,5,7>
- 2248951738U, // <5,2,6,6>: Cost 3 vmrghw <5,6,7,0>, <2,6,3,7>
- 3370461105U, // <5,2,6,7>: Cost 4 vmrglw <2,4,5,6>, <2,6,2,7>
- 1228947563U, // <5,2,6,u>: Cost 2 vmrglw <3,4,5,6>, LHS
- 3786355706U, // <5,2,7,0>: Cost 4 vsldoi8 <4,6,5,2>, <7,0,1,2>
- 3783038037U, // <5,2,7,1>: Cost 4 vsldoi8 <4,1,5,2>, <7,1,2,3>
- 3365824104U, // <5,2,7,2>: Cost 4 vmrglw <1,6,5,7>, <2,2,2,2>
- 2292080742U, // <5,2,7,3>: Cost 3 vmrglw <1,6,5,7>, LHS
- 3842131986U, // <5,2,7,4>: Cost 4 vsldoi12 <2,7,4,5>, <2,7,4,5>
- 3371795508U, // <5,2,7,5>: Cost 4 vmrglw <2,6,5,7>, <1,4,2,5>
- 3786356206U, // <5,2,7,6>: Cost 4 vsldoi8 <4,6,5,2>, <7,6,2,7>
- 3786356332U, // <5,2,7,7>: Cost 4 vsldoi8 <4,6,5,2>, <7,7,7,7>
- 2292080747U, // <5,2,7,u>: Cost 3 vmrglw <1,6,5,7>, LHS
- 2754234427U, // <5,2,u,0>: Cost 3 vsldoi12 <0,4,1,5>, <2,u,0,1>
- 2705315630U, // <5,2,u,1>: Cost 3 vsldoi8 <3,4,5,2>, LHS
- 2296735336U, // <5,2,u,2>: Cost 3 vmrglw <2,4,5,u>, <2,2,2,2>
- 1228963942U, // <5,2,u,3>: Cost 2 vmrglw <3,4,5,u>, LHS
- 1695311971U, // <5,2,u,4>: Cost 2 vsldoi12 <2,u,4,5>, <2,u,4,5>
- 2705315994U, // <5,2,u,5>: Cost 3 vsldoi8 <3,4,5,2>, RHS
- 2769201269U, // <5,2,u,6>: Cost 3 vsldoi12 <2,u,6,5>, <2,u,6,5>
- 3370477489U, // <5,2,u,7>: Cost 4 vmrglw <2,4,5,u>, <2,6,2,7>
- 1695606919U, // <5,2,u,u>: Cost 2 vsldoi12 <2,u,u,5>, <2,u,u,5>
- 3827976331U, // <5,3,0,0>: Cost 4 vsldoi12 <0,4,1,5>, <3,0,0,0>
- 2754234518U, // <5,3,0,1>: Cost 3 vsldoi12 <0,4,1,5>, <3,0,1,2>
- 3706472290U, // <5,3,0,2>: Cost 4 vsldoi4 <2,5,3,0>, <2,5,3,0>
- 3700500630U, // <5,3,0,3>: Cost 4 vsldoi4 <1,5,3,0>, <3,0,1,2>
- 2754234544U, // <5,3,0,4>: Cost 3 vsldoi12 <0,4,1,5>, <3,0,4,1>
- 3376383766U, // <5,3,0,5>: Cost 4 vmrglw <3,4,5,0>, <2,4,3,5>
- 3769770513U, // <5,3,0,6>: Cost 5 vsldoi8 <1,u,5,3>, <0,6,4,7>
- 3376383930U, // <5,3,0,7>: Cost 4 vmrglw <3,4,5,0>, <2,6,3,7>
- 2754234581U, // <5,3,0,u>: Cost 3 vsldoi12 <0,4,1,5>, <3,0,u,2>
- 2311275414U, // <5,3,1,0>: Cost 3 vmrglw <4,u,5,1>, <1,2,3,0>
- 2305967971U, // <5,3,1,1>: Cost 3 vmrglw <4,0,5,1>, <2,5,3,1>
- 2692047787U, // <5,3,1,2>: Cost 3 vsldoi8 <1,2,5,3>, <1,2,5,3>
- 2311276146U, // <5,3,1,3>: Cost 3 vmrglw <4,u,5,1>, <2,2,3,3>
- 2311275418U, // <5,3,1,4>: Cost 3 vmrglw <4,u,5,1>, <1,2,3,4>
- 3765789807U, // <5,3,1,5>: Cost 4 vsldoi8 <1,2,5,3>, <1,5,0,1>
- 3765789939U, // <5,3,1,6>: Cost 4 vsldoi8 <1,2,5,3>, <1,6,5,7>
- 2311276474U, // <5,3,1,7>: Cost 3 vmrglw <4,u,5,1>, <2,6,3,7>
- 2696029585U, // <5,3,1,u>: Cost 3 vsldoi8 <1,u,5,3>, <1,u,5,3>
- 2311288709U, // <5,3,2,0>: Cost 3 vmrglw <4,u,5,2>, <u,2,3,0>
- 3765790243U, // <5,3,2,1>: Cost 4 vsldoi8 <1,2,5,3>, <2,1,3,5>
- 3827976513U, // <5,3,2,2>: Cost 4 vsldoi12 <0,4,1,5>, <3,2,2,2>
- 2765736268U, // <5,3,2,3>: Cost 3 vsldoi12 <2,3,4,5>, <3,2,3,4>
- 2246248962U, // <5,3,2,4>: Cost 3 vmrghw <5,2,6,3>, <3,4,5,6>
- 3765790563U, // <5,3,2,5>: Cost 4 vsldoi8 <1,2,5,3>, <2,5,3,1>
- 3827976550U, // <5,3,2,6>: Cost 4 vsldoi12 <0,4,1,5>, <3,2,6,3>
- 3842795887U, // <5,3,2,7>: Cost 4 vsldoi12 <2,u,4,5>, <3,2,7,3>
- 2769054073U, // <5,3,2,u>: Cost 3 vsldoi12 <2,u,4,5>, <3,2,u,4>
- 3827976575U, // <5,3,3,0>: Cost 4 vsldoi12 <0,4,1,5>, <3,3,0,1>
- 3765790963U, // <5,3,3,1>: Cost 4 vsldoi8 <1,2,5,3>, <3,1,2,5>
- 3839478162U, // <5,3,3,2>: Cost 4 vsldoi12 <2,3,4,5>, <3,3,2,2>
- 2754234780U, // <5,3,3,3>: Cost 3 vsldoi12 <0,4,1,5>, <3,3,3,3>
- 2771708327U, // <5,3,3,4>: Cost 3 vsldoi12 <3,3,4,5>, <3,3,4,5>
- 3363137059U, // <5,3,3,5>: Cost 4 vmrglw <1,2,5,3>, <2,1,3,5>
- 3375081320U, // <5,3,3,6>: Cost 4 vmrglw <3,2,5,3>, <2,5,3,6>
- 3363137466U, // <5,3,3,7>: Cost 4 vmrglw <1,2,5,3>, <2,6,3,7>
- 2772003275U, // <5,3,3,u>: Cost 3 vsldoi12 <3,3,u,5>, <3,3,u,5>
- 2772077012U, // <5,3,4,0>: Cost 3 vsldoi12 <3,4,0,5>, <3,4,0,5>
- 3765791714U, // <5,3,4,1>: Cost 4 vsldoi8 <1,2,5,3>, <4,1,5,0>
- 2709965878U, // <5,3,4,2>: Cost 3 vsldoi8 <4,2,5,3>, <4,2,5,3>
- 2772298223U, // <5,3,4,3>: Cost 3 vsldoi12 <3,4,3,5>, <3,4,3,5>
- 2772371960U, // <5,3,4,4>: Cost 3 vsldoi12 <3,4,4,5>, <3,4,4,5>
- 2754234882U, // <5,3,4,5>: Cost 3 vsldoi12 <0,4,1,5>, <3,4,5,6>
- 3839478282U, // <5,3,4,6>: Cost 4 vsldoi12 <2,3,4,5>, <3,4,6,5>
- 3376416698U, // <5,3,4,7>: Cost 4 vmrglw <3,4,5,4>, <2,6,3,7>
- 2754234909U, // <5,3,4,u>: Cost 3 vsldoi12 <0,4,1,5>, <3,4,u,6>
- 2311308182U, // <5,3,5,0>: Cost 3 vmrglw <4,u,5,5>, <1,2,3,0>
- 3765792421U, // <5,3,5,1>: Cost 4 vsldoi8 <1,2,5,3>, <5,1,2,5>
- 2715938575U, // <5,3,5,2>: Cost 3 vsldoi8 <5,2,5,3>, <5,2,5,3>
- 2311308914U, // <5,3,5,3>: Cost 3 vmrglw <4,u,5,5>, <2,2,3,3>
- 2311308186U, // <5,3,5,4>: Cost 3 vmrglw <4,u,5,5>, <1,2,3,4>
- 2248182354U, // <5,3,5,5>: Cost 3 vmrghw <5,5,5,5>, <3,5,5,5>
- 3765792837U, // <5,3,5,6>: Cost 4 vsldoi8 <1,2,5,3>, <5,6,3,7>
- 2311309242U, // <5,3,5,7>: Cost 3 vmrglw <4,u,5,5>, <2,6,3,7>
- 2311308190U, // <5,3,5,u>: Cost 3 vmrglw <4,u,5,5>, <1,2,3,u>
- 2632777830U, // <5,3,6,0>: Cost 3 vsldoi4 <2,5,3,6>, LHS
- 3706520372U, // <5,3,6,1>: Cost 4 vsldoi4 <2,5,3,6>, <1,1,1,1>
- 2632779624U, // <5,3,6,2>: Cost 3 vsldoi4 <2,5,3,6>, <2,5,3,6>
- 2632780290U, // <5,3,6,3>: Cost 3 vsldoi4 <2,5,3,6>, <3,4,5,6>
- 2632781110U, // <5,3,6,4>: Cost 3 vsldoi4 <2,5,3,6>, RHS
- 2248952413U, // <5,3,6,5>: Cost 3 vmrghw <5,6,7,0>, <3,5,6,7>
- 2302691176U, // <5,3,6,6>: Cost 3 vmrglw <3,4,5,6>, <2,5,3,6>
- 2302691258U, // <5,3,6,7>: Cost 3 vmrglw <3,4,5,6>, <2,6,3,7>
- 2632783662U, // <5,3,6,u>: Cost 3 vsldoi4 <2,5,3,6>, LHS
- 3365823382U, // <5,3,7,0>: Cost 4 vmrglw <1,6,5,7>, <1,2,3,0>
- 3706529011U, // <5,3,7,1>: Cost 4 vsldoi4 <2,5,3,7>, <1,6,5,7>
- 3706529641U, // <5,3,7,2>: Cost 4 vsldoi4 <2,5,3,7>, <2,5,3,7>
- 3365824114U, // <5,3,7,3>: Cost 4 vmrglw <1,6,5,7>, <2,2,3,3>
- 2774362859U, // <5,3,7,4>: Cost 3 vsldoi12 <3,7,4,5>, <3,7,4,5>
- 3365824035U, // <5,3,7,5>: Cost 4 vmrglw <1,6,5,7>, <2,1,3,5>
- 3383740183U, // <5,3,7,6>: Cost 4 vmrglw <4,6,5,7>, <2,4,3,6>
- 3363833786U, // <5,3,7,7>: Cost 4 vmrglw <1,3,5,7>, <2,6,3,7>
- 2774657807U, // <5,3,7,u>: Cost 3 vsldoi12 <3,7,u,5>, <3,7,u,5>
- 2632794214U, // <5,3,u,0>: Cost 3 vsldoi4 <2,5,3,u>, LHS
- 2754235166U, // <5,3,u,1>: Cost 3 vsldoi12 <0,4,1,5>, <3,u,1,2>
- 2632796010U, // <5,3,u,2>: Cost 3 vsldoi4 <2,5,3,u>, <2,5,3,u>
- 2632796676U, // <5,3,u,3>: Cost 3 vsldoi4 <2,5,3,u>, <3,4,5,u>
- 2632797494U, // <5,3,u,4>: Cost 3 vsldoi4 <2,5,3,u>, RHS
- 2754235206U, // <5,3,u,5>: Cost 3 vsldoi12 <0,4,1,5>, <3,u,5,6>
- 2302691176U, // <5,3,u,6>: Cost 3 vmrglw <3,4,5,6>, <2,5,3,6>
- 2302707642U, // <5,3,u,7>: Cost 3 vmrglw <3,4,5,u>, <2,6,3,7>
- 2754235229U, // <5,3,u,u>: Cost 3 vsldoi12 <0,4,1,5>, <3,u,u,2>
- 3765133325U, // <5,4,0,0>: Cost 4 vsldoi8 <1,1,5,4>, <0,0,1,4>
- 2705326182U, // <5,4,0,1>: Cost 3 vsldoi8 <3,4,5,4>, LHS
- 3718489806U, // <5,4,0,2>: Cost 4 vsldoi4 <4,5,4,0>, <2,3,4,5>
- 3718490624U, // <5,4,0,3>: Cost 4 vsldoi4 <4,5,4,0>, <3,4,5,4>
- 2709307730U, // <5,4,0,4>: Cost 3 vsldoi8 <4,1,5,4>, <0,4,1,5>
- 2302641870U, // <5,4,0,5>: Cost 3 vmrglw <3,4,5,0>, <2,3,4,5>
- 3376383695U, // <5,4,0,6>: Cost 5 vmrglw <3,4,5,0>, <2,3,4,6>
- 3384351018U, // <5,4,0,7>: Cost 4 vmrglw <4,7,5,0>, <u,7,4,7>
- 2705326749U, // <5,4,0,u>: Cost 3 vsldoi8 <3,4,5,4>, LHS
- 2305971057U, // <5,4,1,0>: Cost 3 vmrglw <4,0,5,1>, <6,7,4,0>
- 3765134171U, // <5,4,1,1>: Cost 4 vsldoi8 <1,1,5,4>, <1,1,5,4>
- 3766461338U, // <5,4,1,2>: Cost 4 vsldoi8 <1,3,5,4>, <1,2,3,4>
- 3766461437U, // <5,4,1,3>: Cost 4 vsldoi8 <1,3,5,4>, <1,3,5,4>
- 2311277776U, // <5,4,1,4>: Cost 3 vmrglw <4,u,5,1>, <4,4,4,4>
- 2754235362U, // <5,4,1,5>: Cost 3 vsldoi12 <0,4,1,5>, <4,1,5,0>
- 3783050483U, // <5,4,1,6>: Cost 4 vsldoi8 <4,1,5,4>, <1,6,5,7>
- 3385019036U, // <5,4,1,7>: Cost 4 vmrglw <4,u,5,1>, <3,6,4,7>
- 2311276241U, // <5,4,1,u>: Cost 3 vmrglw <4,u,5,1>, <2,3,4,u>
- 3718504550U, // <5,4,2,0>: Cost 4 vsldoi4 <4,5,4,2>, LHS
- 3783050787U, // <5,4,2,1>: Cost 4 vsldoi8 <4,1,5,4>, <2,1,3,5>
- 3773097576U, // <5,4,2,2>: Cost 4 vsldoi8 <2,4,5,4>, <2,2,2,2>
- 2705327822U, // <5,4,2,3>: Cost 3 vsldoi8 <3,4,5,4>, <2,3,4,5>
- 3773097767U, // <5,4,2,4>: Cost 4 vsldoi8 <2,4,5,4>, <2,4,5,4>
- 2765737014U, // <5,4,2,5>: Cost 3 vsldoi12 <2,3,4,5>, <4,2,5,3>
- 3779069882U, // <5,4,2,6>: Cost 4 vsldoi8 <3,4,5,4>, <2,6,3,7>
- 3376401052U, // <5,4,2,7>: Cost 5 vmrglw <3,4,5,2>, <3,6,4,7>
- 2245881370U, // <5,4,2,u>: Cost 3 vmrghw <5,2,1,3>, <4,u,5,1>
- 3779070102U, // <5,4,3,0>: Cost 4 vsldoi8 <3,4,5,4>, <3,0,1,2>
- 3363135525U, // <5,4,3,1>: Cost 4 vmrglw <1,2,5,3>, <0,0,4,1>
- 3779070284U, // <5,4,3,2>: Cost 4 vsldoi8 <3,4,5,4>, <3,2,3,4>
- 3779070364U, // <5,4,3,3>: Cost 4 vsldoi8 <3,4,5,4>, <3,3,3,3>
- 2705328640U, // <5,4,3,4>: Cost 3 vsldoi8 <3,4,5,4>, <3,4,5,4>
- 2307311310U, // <5,4,3,5>: Cost 3 vmrglw <4,2,5,3>, <2,3,4,5>
- 3866021012U, // <5,4,3,6>: Cost 4 vsldoi12 <6,7,4,5>, <4,3,6,7>
- 3363138204U, // <5,4,3,7>: Cost 5 vmrglw <1,2,5,3>, <3,6,4,7>
- 2707983172U, // <5,4,3,u>: Cost 3 vsldoi8 <3,u,5,4>, <3,u,5,4>
- 2708646805U, // <5,4,4,0>: Cost 3 vsldoi8 <4,0,5,4>, <4,0,5,4>
- 2709310438U, // <5,4,4,1>: Cost 3 vsldoi8 <4,1,5,4>, <4,1,5,4>
- 3779071030U, // <5,4,4,2>: Cost 4 vsldoi8 <3,4,5,4>, <4,2,5,3>
- 2710637704U, // <5,4,4,3>: Cost 3 vsldoi8 <4,3,5,4>, <4,3,5,4>
- 2754235600U, // <5,4,4,4>: Cost 3 vsldoi12 <0,4,1,5>, <4,4,4,4>
- 1704676570U, // <5,4,4,5>: Cost 2 vsldoi12 <4,4,5,5>, <4,4,5,5>
- 3779071358U, // <5,4,4,6>: Cost 4 vsldoi8 <3,4,5,4>, <4,6,5,7>
- 2713292236U, // <5,4,4,7>: Cost 3 vsldoi8 <4,7,5,4>, <4,7,5,4>
- 1704897781U, // <5,4,4,u>: Cost 2 vsldoi12 <4,4,u,5>, <4,4,u,5>
- 2626871398U, // <5,4,5,0>: Cost 3 vsldoi4 <1,5,4,5>, LHS
- 2626872471U, // <5,4,5,1>: Cost 3 vsldoi4 <1,5,4,5>, <1,5,4,5>
- 2765737230U, // <5,4,5,2>: Cost 3 vsldoi12 <2,3,4,5>, <4,5,2,3>
- 3700615318U, // <5,4,5,3>: Cost 4 vsldoi4 <1,5,4,5>, <3,0,1,2>
- 2626874678U, // <5,4,5,4>: Cost 3 vsldoi4 <1,5,4,5>, RHS
- 1174441270U, // <5,4,5,5>: Cost 2 vmrghw <5,5,5,5>, RHS
- 1680493878U, // <5,4,5,6>: Cost 2 vsldoi12 <0,4,1,5>, RHS
- 3385051804U, // <5,4,5,7>: Cost 4 vmrglw <4,u,5,5>, <3,6,4,7>
- 1680493896U, // <5,4,5,u>: Cost 2 vsldoi12 <0,4,1,5>, RHS
- 2248952722U, // <5,4,6,0>: Cost 3 vmrghw <5,6,7,0>, <4,0,5,1>
- 2302692152U, // <5,4,6,1>: Cost 3 vmrglw <3,4,5,6>, <3,u,4,1>
- 3382406107U, // <5,4,6,2>: Cost 4 vmrglw <4,4,5,6>, <4,1,4,2>
- 3700623874U, // <5,4,6,3>: Cost 4 vsldoi4 <1,5,4,6>, <3,4,5,6>
- 2248953040U, // <5,4,6,4>: Cost 3 vmrghw <5,6,7,0>, <4,4,4,4>
- 1175211318U, // <5,4,6,5>: Cost 2 vmrghw <5,6,7,0>, RHS
- 3376432280U, // <5,4,6,6>: Cost 4 vmrglw <3,4,5,6>, <1,5,4,6>
- 2729218934U, // <5,4,6,7>: Cost 3 vsldoi8 <7,4,5,4>, <6,7,4,5>
- 1175211561U, // <5,4,6,u>: Cost 2 vmrghw <5,6,7,0>, RHS
- 3787035642U, // <5,4,7,0>: Cost 4 vsldoi8 <4,7,5,4>, <7,0,1,2>
- 3365822501U, // <5,4,7,1>: Cost 4 vmrglw <1,6,5,7>, <0,0,4,1>
- 3808933085U, // <5,4,7,2>: Cost 4 vsldoi8 <u,4,5,4>, <7,2,u,4>
- 3784381707U, // <5,4,7,3>: Cost 4 vsldoi8 <4,3,5,4>, <7,3,4,5>
- 2713294182U, // <5,4,7,4>: Cost 3 vsldoi8 <4,7,5,4>, <7,4,5,6>
- 2309998286U, // <5,4,7,5>: Cost 3 vmrglw <4,6,5,7>, <2,3,4,5>
- 3383740111U, // <5,4,7,6>: Cost 4 vmrglw <4,6,5,7>, <2,3,4,6>
- 3787036239U, // <5,4,7,7>: Cost 4 vsldoi8 <4,7,5,4>, <7,7,4,5>
- 2731873960U, // <5,4,7,u>: Cost 3 vsldoi8 <7,u,5,4>, <7,u,5,4>
- 2626895974U, // <5,4,u,0>: Cost 3 vsldoi4 <1,5,4,u>, LHS
- 2626897050U, // <5,4,u,1>: Cost 3 vsldoi4 <1,5,4,u>, <1,5,4,u>
- 2644813518U, // <5,4,u,2>: Cost 3 vsldoi4 <4,5,4,u>, <2,3,4,5>
- 2705327822U, // <5,4,u,3>: Cost 3 vsldoi8 <3,4,5,4>, <2,3,4,5>
- 2626899254U, // <5,4,u,4>: Cost 3 vsldoi4 <1,5,4,u>, RHS
- 1707331102U, // <5,4,u,5>: Cost 2 vsldoi12 <4,u,5,5>, <4,u,5,5>
- 1680494121U, // <5,4,u,6>: Cost 2 vsldoi12 <0,4,1,5>, RHS
- 2737183024U, // <5,4,u,7>: Cost 3 vsldoi8 <u,7,5,4>, <u,7,5,4>
- 1680494139U, // <5,4,u,u>: Cost 2 vsldoi12 <0,4,1,5>, RHS
- 2302642684U, // <5,5,0,0>: Cost 3 vmrglw <3,4,5,0>, <3,4,5,0>
- 1640218726U, // <5,5,0,1>: Cost 2 vsldoi8 <4,u,5,5>, LHS
- 3376384510U, // <5,5,0,2>: Cost 4 vmrglw <3,4,5,0>, <3,4,5,2>
- 3376385078U, // <5,5,0,3>: Cost 4 vmrglw <3,4,5,0>, <4,2,5,3>
- 2754236002U, // <5,5,0,4>: Cost 3 vsldoi12 <0,4,1,5>, <5,0,4,1>
- 2717942242U, // <5,5,0,5>: Cost 3 vsldoi8 <5,5,5,5>, <0,5,u,5>
- 2244907106U, // <5,5,0,6>: Cost 3 vmrghw <5,0,6,1>, <5,6,7,0>
- 3376385406U, // <5,5,0,7>: Cost 4 vmrglw <3,4,5,0>, <4,6,5,7>
- 1640219293U, // <5,5,0,u>: Cost 2 vsldoi8 <4,u,5,5>, LHS
- 2305969365U, // <5,5,1,0>: Cost 3 vmrglw <4,0,5,1>, <4,4,5,0>
- 1237536282U, // <5,5,1,1>: Cost 2 vmrglw <4,u,5,1>, <4,u,5,1>
- 2713961366U, // <5,5,1,2>: Cost 3 vsldoi8 <4,u,5,5>, <1,2,3,0>
- 3766469630U, // <5,5,1,3>: Cost 4 vsldoi8 <1,3,5,5>, <1,3,5,5>
- 2782326455U, // <5,5,1,4>: Cost 3 vsldoi12 <5,1,4,5>, <5,1,4,5>
- 2311277786U, // <5,5,1,5>: Cost 3 vmrglw <4,u,5,1>, <4,4,5,5>
- 2311277058U, // <5,5,1,6>: Cost 3 vmrglw <4,u,5,1>, <3,4,5,6>
- 3385017587U, // <5,5,1,7>: Cost 4 vmrglw <4,u,5,1>, <1,6,5,7>
- 1237536282U, // <5,5,1,u>: Cost 2 vmrglw <4,u,5,1>, <4,u,5,1>
- 3376400892U, // <5,5,2,0>: Cost 4 vmrglw <3,4,5,2>, <3,4,5,0>
- 3827977963U, // <5,5,2,1>: Cost 4 vsldoi12 <0,4,1,5>, <5,2,1,3>
- 2302659070U, // <5,5,2,2>: Cost 3 vmrglw <3,4,5,2>, <3,4,5,2>
- 2765737726U, // <5,5,2,3>: Cost 3 vsldoi12 <2,3,4,5>, <5,2,3,4>
- 3839479558U, // <5,5,2,4>: Cost 4 vsldoi12 <2,3,4,5>, <5,2,4,3>
- 2781073167U, // <5,5,2,5>: Cost 3 vsldoi12 <4,u,5,5>, <5,2,5,3>
- 2713962426U, // <5,5,2,6>: Cost 3 vsldoi8 <4,u,5,5>, <2,6,3,7>
- 3376401790U, // <5,5,2,7>: Cost 4 vmrglw <3,4,5,2>, <4,6,5,7>
- 2769055531U, // <5,5,2,u>: Cost 3 vsldoi12 <2,u,4,5>, <5,2,u,4>
- 2713962646U, // <5,5,3,0>: Cost 3 vsldoi8 <4,u,5,5>, <3,0,1,2>
- 3765143786U, // <5,5,3,1>: Cost 4 vsldoi8 <1,1,5,5>, <3,1,1,5>
- 3839479621U, // <5,5,3,2>: Cost 4 vsldoi12 <2,3,4,5>, <5,3,2,3>
- 2289394603U, // <5,5,3,3>: Cost 3 vmrglw <1,2,5,3>, <1,2,5,3>
- 2713963010U, // <5,5,3,4>: Cost 3 vsldoi8 <4,u,5,5>, <3,4,5,6>
- 2313285150U, // <5,5,3,5>: Cost 3 vmrglw <5,2,5,3>, <4,u,5,5>
- 3363138050U, // <5,5,3,6>: Cost 4 vmrglw <1,2,5,3>, <3,4,5,6>
- 3363136755U, // <5,5,3,7>: Cost 4 vmrglw <1,2,5,3>, <1,6,5,7>
- 2713963294U, // <5,5,3,u>: Cost 3 vsldoi8 <4,u,5,5>, <3,u,1,2>
- 2713963410U, // <5,5,4,0>: Cost 3 vsldoi8 <4,u,5,5>, <4,0,5,1>
- 3827978127U, // <5,5,4,1>: Cost 4 vsldoi12 <0,4,1,5>, <5,4,1,5>
- 3839479704U, // <5,5,4,2>: Cost 4 vsldoi12 <2,3,4,5>, <5,4,2,5>
- 3376417846U, // <5,5,4,3>: Cost 4 vmrglw <3,4,5,4>, <4,2,5,3>
- 1637567706U, // <5,5,4,4>: Cost 2 vsldoi8 <4,4,5,5>, <4,4,5,5>
- 1640222006U, // <5,5,4,5>: Cost 2 vsldoi8 <4,u,5,5>, RHS
- 2310640998U, // <5,5,4,6>: Cost 3 vmrglw <4,7,5,4>, <7,4,5,6>
- 3376418174U, // <5,5,4,7>: Cost 4 vmrglw <3,4,5,4>, <4,6,5,7>
- 1640222238U, // <5,5,4,u>: Cost 2 vsldoi8 <4,u,5,5>, <4,u,5,5>
- 1577091174U, // <5,5,5,0>: Cost 2 vsldoi4 <5,5,5,5>, LHS
- 2311310226U, // <5,5,5,1>: Cost 3 vmrglw <4,u,5,5>, <4,0,5,1>
- 2713964303U, // <5,5,5,2>: Cost 3 vsldoi8 <4,u,5,5>, <5,2,5,3>
- 2311311119U, // <5,5,5,3>: Cost 3 vmrglw <4,u,5,5>, <5,2,5,3>
- 1577094454U, // <5,5,5,4>: Cost 2 vsldoi4 <5,5,5,5>, RHS
- 296144182U, // <5,5,5,5>: Cost 1 vspltisw1 RHS
- 2311309826U, // <5,5,5,6>: Cost 3 vmrglw <4,u,5,5>, <3,4,5,6>
- 2311311447U, // <5,5,5,7>: Cost 3 vmrglw <4,u,5,5>, <5,6,5,7>
- 296144182U, // <5,5,5,u>: Cost 1 vspltisw1 RHS
- 2248953460U, // <5,5,6,0>: Cost 3 vmrghw <5,6,7,0>, <5,0,6,1>
- 2326580114U, // <5,5,6,1>: Cost 3 vmrglw <7,4,5,6>, <4,0,5,1>
- 2713965050U, // <5,5,6,2>: Cost 3 vsldoi8 <4,u,5,5>, <6,2,7,3>
- 3700697602U, // <5,5,6,3>: Cost 4 vsldoi4 <1,5,5,6>, <3,4,5,6>
- 2785644620U, // <5,5,6,4>: Cost 3 vsldoi12 <5,6,4,5>, <5,6,4,5>
- 2781073495U, // <5,5,6,5>: Cost 3 vsldoi12 <4,u,5,5>, <5,6,5,7>
- 1228950018U, // <5,5,6,6>: Cost 2 vmrglw <3,4,5,6>, <3,4,5,6>
- 2713965390U, // <5,5,6,7>: Cost 3 vsldoi8 <4,u,5,5>, <6,7,0,1>
- 1228950018U, // <5,5,6,u>: Cost 2 vmrglw <3,4,5,6>, <3,4,5,6>
- 2713965562U, // <5,5,7,0>: Cost 3 vsldoi8 <4,u,5,5>, <7,0,1,2>
- 3383741330U, // <5,5,7,1>: Cost 4 vmrglw <4,6,5,7>, <4,0,5,1>
- 3718620878U, // <5,5,7,2>: Cost 4 vsldoi4 <4,5,5,7>, <2,3,4,5>
- 3365823403U, // <5,5,7,3>: Cost 4 vmrglw <1,6,5,7>, <1,2,5,3>
- 2713965926U, // <5,5,7,4>: Cost 3 vsldoi8 <4,u,5,5>, <7,4,5,6>
- 2717947318U, // <5,5,7,5>: Cost 3 vsldoi8 <5,5,5,5>, <7,5,5,5>
- 3365825026U, // <5,5,7,6>: Cost 4 vmrglw <1,6,5,7>, <3,4,5,6>
- 2292081907U, // <5,5,7,7>: Cost 3 vmrglw <1,6,5,7>, <1,6,5,7>
- 2713966210U, // <5,5,7,u>: Cost 3 vsldoi8 <4,u,5,5>, <7,u,1,2>
- 1577091174U, // <5,5,u,0>: Cost 2 vsldoi4 <5,5,5,5>, LHS
- 1640224558U, // <5,5,u,1>: Cost 2 vsldoi8 <4,u,5,5>, LHS
- 2713966469U, // <5,5,u,2>: Cost 3 vsldoi8 <4,u,5,5>, <u,2,3,0>
- 2713966524U, // <5,5,u,3>: Cost 3 vsldoi8 <4,u,5,5>, <u,3,0,1>
- 1577094454U, // <5,5,u,4>: Cost 2 vsldoi4 <5,5,5,5>, RHS
- 296144182U, // <5,5,u,5>: Cost 1 vspltisw1 RHS
- 1228950018U, // <5,5,u,6>: Cost 2 vmrglw <3,4,5,6>, <3,4,5,6>
- 2713966848U, // <5,5,u,7>: Cost 3 vsldoi8 <4,u,5,5>, <u,7,0,1>
- 296144182U, // <5,5,u,u>: Cost 1 vspltisw1 RHS
- 2705342464U, // <5,6,0,0>: Cost 3 vsldoi8 <3,4,5,6>, <0,0,0,0>
- 1631600742U, // <5,6,0,1>: Cost 2 vsldoi8 <3,4,5,6>, LHS
- 3773112493U, // <5,6,0,2>: Cost 4 vsldoi8 <2,4,5,6>, <0,2,1,2>
- 2705342720U, // <5,6,0,3>: Cost 3 vsldoi8 <3,4,5,6>, <0,3,1,4>
- 2705342802U, // <5,6,0,4>: Cost 3 vsldoi8 <3,4,5,6>, <0,4,1,5>
- 3779084708U, // <5,6,0,5>: Cost 4 vsldoi8 <3,4,5,6>, <0,5,1,6>
- 3779084790U, // <5,6,0,6>: Cost 4 vsldoi8 <3,4,5,6>, <0,6,1,7>
- 2302643510U, // <5,6,0,7>: Cost 3 vmrglw <3,4,5,0>, RHS
- 1631601309U, // <5,6,0,u>: Cost 2 vsldoi8 <3,4,5,6>, LHS
- 3767141092U, // <5,6,1,0>: Cost 4 vsldoi8 <1,4,5,6>, <1,0,1,2>
- 2705343284U, // <5,6,1,1>: Cost 3 vsldoi8 <3,4,5,6>, <1,1,1,1>
- 2705343382U, // <5,6,1,2>: Cost 3 vsldoi8 <3,4,5,6>, <1,2,3,0>
- 3779085282U, // <5,6,1,3>: Cost 4 vsldoi8 <3,4,5,6>, <1,3,2,4>
- 2693399632U, // <5,6,1,4>: Cost 3 vsldoi8 <1,4,5,6>, <1,4,5,6>
- 3767805089U, // <5,6,1,5>: Cost 4 vsldoi8 <1,5,5,6>, <1,5,5,6>
- 2311279416U, // <5,6,1,6>: Cost 3 vmrglw <4,u,5,1>, <6,6,6,6>
- 1237536054U, // <5,6,1,7>: Cost 2 vmrglw <4,u,5,1>, RHS
- 1237536055U, // <5,6,1,u>: Cost 2 vmrglw <4,u,5,1>, RHS
- 3773113789U, // <5,6,2,0>: Cost 4 vsldoi8 <2,4,5,6>, <2,0,1,2>
- 3779085855U, // <5,6,2,1>: Cost 4 vsldoi8 <3,4,5,6>, <2,1,3,1>
- 2699372136U, // <5,6,2,2>: Cost 3 vsldoi8 <2,4,5,6>, <2,2,2,2>
- 2705344166U, // <5,6,2,3>: Cost 3 vsldoi8 <3,4,5,6>, <2,3,0,1>
- 2699372329U, // <5,6,2,4>: Cost 3 vsldoi8 <2,4,5,6>, <2,4,5,6>
- 2705344360U, // <5,6,2,5>: Cost 3 vsldoi8 <3,4,5,6>, <2,5,3,6>
- 2705344442U, // <5,6,2,6>: Cost 3 vsldoi8 <3,4,5,6>, <2,6,3,7>
- 2302659894U, // <5,6,2,7>: Cost 3 vmrglw <3,4,5,2>, RHS
- 2702026861U, // <5,6,2,u>: Cost 3 vsldoi8 <2,u,5,6>, <2,u,5,6>
- 2705344662U, // <5,6,3,0>: Cost 3 vsldoi8 <3,4,5,6>, <3,0,1,2>
- 3767142661U, // <5,6,3,1>: Cost 4 vsldoi8 <1,4,5,6>, <3,1,4,5>
- 3773114689U, // <5,6,3,2>: Cost 4 vsldoi8 <2,4,5,6>, <3,2,2,2>
- 2705344924U, // <5,6,3,3>: Cost 3 vsldoi8 <3,4,5,6>, <3,3,3,3>
- 1631603202U, // <5,6,3,4>: Cost 2 vsldoi8 <3,4,5,6>, <3,4,5,6>
- 3842945597U, // <5,6,3,5>: Cost 4 vsldoi12 <2,u,6,5>, <6,3,5,7>
- 3779086962U, // <5,6,3,6>: Cost 4 vsldoi8 <3,4,5,6>, <3,6,0,1>
- 2289397046U, // <5,6,3,7>: Cost 3 vmrglw <1,2,5,3>, RHS
- 1634257734U, // <5,6,3,u>: Cost 2 vsldoi8 <3,u,5,6>, <3,u,5,6>
- 2644926566U, // <5,6,4,0>: Cost 3 vsldoi4 <4,5,6,4>, LHS
- 3779087306U, // <5,6,4,1>: Cost 4 vsldoi8 <3,4,5,6>, <4,1,2,3>
- 2790142577U, // <5,6,4,2>: Cost 3 vsldoi12 <6,4,2,5>, <6,4,2,5>
- 2644929026U, // <5,6,4,3>: Cost 3 vsldoi4 <4,5,6,4>, <3,4,5,6>
- 2711317723U, // <5,6,4,4>: Cost 3 vsldoi8 <4,4,5,6>, <4,4,5,6>
- 1631604022U, // <5,6,4,5>: Cost 2 vsldoi8 <3,4,5,6>, RHS
- 2712644989U, // <5,6,4,6>: Cost 3 vsldoi8 <4,6,5,6>, <4,6,5,6>
- 2302676278U, // <5,6,4,7>: Cost 3 vmrglw <3,4,5,4>, RHS
- 1631604265U, // <5,6,4,u>: Cost 2 vsldoi8 <3,4,5,6>, RHS
- 3842945708U, // <5,6,5,0>: Cost 4 vsldoi12 <2,u,6,5>, <6,5,0,1>
- 3767144133U, // <5,6,5,1>: Cost 4 vsldoi8 <1,4,5,6>, <5,1,6,1>
- 2705346328U, // <5,6,5,2>: Cost 3 vsldoi8 <3,4,5,6>, <5,2,6,3>
- 3779088207U, // <5,6,5,3>: Cost 4 vsldoi8 <3,4,5,6>, <5,3,3,4>
- 2717290420U, // <5,6,5,4>: Cost 3 vsldoi8 <5,4,5,6>, <5,4,5,6>
- 2705346574U, // <5,6,5,5>: Cost 3 vsldoi8 <3,4,5,6>, <5,5,6,6>
- 2705346596U, // <5,6,5,6>: Cost 3 vsldoi8 <3,4,5,6>, <5,6,0,1>
- 1237568822U, // <5,6,5,7>: Cost 2 vmrglw <4,u,5,5>, RHS
- 1237568823U, // <5,6,5,u>: Cost 2 vmrglw <4,u,5,5>, RHS
- 2650914918U, // <5,6,6,0>: Cost 3 vsldoi4 <5,5,6,6>, LHS
- 3364490949U, // <5,6,6,1>: Cost 4 vmrglw <1,4,5,6>, <5,1,6,1>
- 2248954362U, // <5,6,6,2>: Cost 3 vmrghw <5,6,7,0>, <6,2,7,3>
- 2302693144U, // <5,6,6,3>: Cost 3 vmrglw <3,4,5,6>, <5,2,6,3>
- 2650918198U, // <5,6,6,4>: Cost 3 vsldoi4 <5,5,6,6>, RHS
- 2650918926U, // <5,6,6,5>: Cost 3 vsldoi4 <5,5,6,6>, <5,5,6,6>
- 2302693390U, // <5,6,6,6>: Cost 3 vmrglw <3,4,5,6>, <5,5,6,6>
- 1228950838U, // <5,6,6,7>: Cost 2 vmrglw <3,4,5,6>, RHS
- 1228950839U, // <5,6,6,u>: Cost 2 vmrglw <3,4,5,6>, RHS
- 497467494U, // <5,6,7,0>: Cost 1 vsldoi4 RHS, LHS
- 1571210036U, // <5,6,7,1>: Cost 2 vsldoi4 RHS, <1,1,1,1>
- 1571210856U, // <5,6,7,2>: Cost 2 vsldoi4 RHS, <2,2,2,2>
- 1571211414U, // <5,6,7,3>: Cost 2 vsldoi4 RHS, <3,0,1,2>
- 497470774U, // <5,6,7,4>: Cost 1 vsldoi4 RHS, RHS
- 1571213316U, // <5,6,7,5>: Cost 2 vsldoi4 RHS, <5,5,5,5>
- 1571213818U, // <5,6,7,6>: Cost 2 vsldoi4 RHS, <6,2,7,3>
- 1571214956U, // <5,6,7,7>: Cost 2 vsldoi4 RHS, <7,7,7,7>
- 497473326U, // <5,6,7,u>: Cost 1 vsldoi4 RHS, LHS
- 497475686U, // <5,6,u,0>: Cost 1 vsldoi4 RHS, LHS
- 1631606574U, // <5,6,u,1>: Cost 2 vsldoi8 <3,4,5,6>, LHS
- 1571219048U, // <5,6,u,2>: Cost 2 vsldoi4 RHS, <2,2,2,2>
- 1571219606U, // <5,6,u,3>: Cost 2 vsldoi4 RHS, <3,0,1,2>
- 497478967U, // <5,6,u,4>: Cost 1 vsldoi4 RHS, RHS
- 1631606938U, // <5,6,u,5>: Cost 2 vsldoi8 <3,4,5,6>, RHS
- 1571222010U, // <5,6,u,6>: Cost 2 vsldoi4 RHS, <6,2,7,3>
- 1228967222U, // <5,6,u,7>: Cost 2 vmrglw <3,4,5,u>, RHS
- 497481518U, // <5,6,u,u>: Cost 1 vsldoi4 RHS, LHS
- 3768475648U, // <5,7,0,0>: Cost 4 vsldoi8 <1,6,5,7>, <0,0,0,0>
- 2694733926U, // <5,7,0,1>: Cost 3 vsldoi8 <1,6,5,7>, LHS
- 3718711395U, // <5,7,0,2>: Cost 4 vsldoi4 <4,5,7,0>, <2,u,4,5>
- 3384349178U, // <5,7,0,3>: Cost 4 vmrglw <4,7,5,0>, <6,2,7,3>
- 2694734162U, // <5,7,0,4>: Cost 3 vsldoi8 <1,6,5,7>, <0,4,1,5>
- 3384347884U, // <5,7,0,5>: Cost 4 vmrglw <4,7,5,0>, <4,4,7,5>
- 3730658026U, // <5,7,0,6>: Cost 4 vsldoi4 <6,5,7,0>, <6,5,7,0>
- 3718714362U, // <5,7,0,7>: Cost 4 vsldoi4 <4,5,7,0>, <7,0,1,2>
- 2694734493U, // <5,7,0,u>: Cost 3 vsldoi8 <1,6,5,7>, LHS
- 2311278690U, // <5,7,1,0>: Cost 3 vmrglw <4,u,5,1>, <5,6,7,0>
- 2305970923U, // <5,7,1,1>: Cost 3 vmrglw <4,0,5,1>, <6,5,7,1>
- 3768476566U, // <5,7,1,2>: Cost 4 vsldoi8 <1,6,5,7>, <1,2,3,0>
- 2311279098U, // <5,7,1,3>: Cost 3 vmrglw <4,u,5,1>, <6,2,7,3>
- 2311278694U, // <5,7,1,4>: Cost 3 vmrglw <4,u,5,1>, <5,6,7,4>
- 3768476783U, // <5,7,1,5>: Cost 4 vsldoi8 <1,6,5,7>, <1,5,0,1>
- 2694735091U, // <5,7,1,6>: Cost 3 vsldoi8 <1,6,5,7>, <1,6,5,7>
- 2311279426U, // <5,7,1,7>: Cost 3 vmrglw <4,u,5,1>, <6,6,7,7>
- 2696062357U, // <5,7,1,u>: Cost 3 vsldoi8 <1,u,5,7>, <1,u,5,7>
- 3383701602U, // <5,7,2,0>: Cost 4 vmrglw <4,6,5,2>, <5,6,7,0>
- 3768477219U, // <5,7,2,1>: Cost 4 vsldoi8 <1,6,5,7>, <2,1,3,5>
- 3768477288U, // <5,7,2,2>: Cost 4 vsldoi8 <1,6,5,7>, <2,2,2,2>
- 2309960186U, // <5,7,2,3>: Cost 3 vmrglw <4,6,5,2>, <6,2,7,3>
- 3383701606U, // <5,7,2,4>: Cost 4 vmrglw <4,6,5,2>, <5,6,7,4>
- 3768477545U, // <5,7,2,5>: Cost 4 vsldoi8 <1,6,5,7>, <2,5,3,7>
- 3766486970U, // <5,7,2,6>: Cost 4 vsldoi8 <1,3,5,7>, <2,6,3,7>
- 3383702338U, // <5,7,2,7>: Cost 4 vmrglw <4,6,5,2>, <6,6,7,7>
- 2309960186U, // <5,7,2,u>: Cost 3 vmrglw <4,6,5,2>, <6,2,7,3>
- 3768477846U, // <5,7,3,0>: Cost 4 vsldoi8 <1,6,5,7>, <3,0,1,2>
- 3768477975U, // <5,7,3,1>: Cost 4 vsldoi8 <1,6,5,7>, <3,1,6,5>
- 3786393932U, // <5,7,3,2>: Cost 4 vsldoi8 <4,6,5,7>, <3,2,3,4>
- 3768478108U, // <5,7,3,3>: Cost 4 vsldoi8 <1,6,5,7>, <3,3,3,3>
- 2795599115U, // <5,7,3,4>: Cost 3 vsldoi12 <7,3,4,5>, <7,3,4,5>
- 3385037470U, // <5,7,3,5>: Cost 4 vmrglw <4,u,5,3>, <6,4,7,5>
- 3780422309U, // <5,7,3,6>: Cost 4 vsldoi8 <3,6,5,7>, <3,6,5,7>
- 3848107301U, // <5,7,3,7>: Cost 4 vsldoi12 <3,7,4,5>, <7,3,7,4>
- 2795894063U, // <5,7,3,u>: Cost 3 vsldoi12 <7,3,u,5>, <7,3,u,5>
- 2795967800U, // <5,7,4,0>: Cost 3 vsldoi12 <7,4,0,5>, <7,4,0,5>
- 3768478690U, // <5,7,4,1>: Cost 4 vsldoi8 <1,6,5,7>, <4,1,5,0>
- 3718744163U, // <5,7,4,2>: Cost 4 vsldoi4 <4,5,7,4>, <2,u,4,5>
- 3784404107U, // <5,7,4,3>: Cost 4 vsldoi8 <4,3,5,7>, <4,3,5,7>
- 2796262748U, // <5,7,4,4>: Cost 3 vsldoi12 <7,4,4,5>, <7,4,4,5>
- 2694737206U, // <5,7,4,5>: Cost 3 vsldoi8 <1,6,5,7>, RHS
- 2712653182U, // <5,7,4,6>: Cost 3 vsldoi8 <4,6,5,7>, <4,6,5,7>
- 2713316815U, // <5,7,4,7>: Cost 3 vsldoi8 <4,7,5,7>, <4,7,5,7>
- 2694737449U, // <5,7,4,u>: Cost 3 vsldoi8 <1,6,5,7>, RHS
- 2311311458U, // <5,7,5,0>: Cost 3 vmrglw <4,u,5,5>, <5,6,7,0>
- 3768479433U, // <5,7,5,1>: Cost 4 vsldoi8 <1,6,5,7>, <5,1,6,5>
- 3768479521U, // <5,7,5,2>: Cost 4 vsldoi8 <1,6,5,7>, <5,2,7,3>
- 2311311866U, // <5,7,5,3>: Cost 3 vmrglw <4,u,5,5>, <6,2,7,3>
- 2311311462U, // <5,7,5,4>: Cost 3 vmrglw <4,u,5,5>, <5,6,7,4>
- 2248185270U, // <5,7,5,5>: Cost 3 vmrghw <5,5,5,5>, <7,5,5,5>
- 2718625879U, // <5,7,5,6>: Cost 3 vsldoi8 <5,6,5,7>, <5,6,5,7>
- 2311312194U, // <5,7,5,7>: Cost 3 vmrglw <4,u,5,5>, <6,6,7,7>
- 2311311466U, // <5,7,5,u>: Cost 3 vmrglw <4,u,5,5>, <5,6,7,u>
- 2248954874U, // <5,7,6,0>: Cost 3 vmrghw <5,6,7,0>, <7,0,1,2>
- 3322696778U, // <5,7,6,1>: Cost 4 vmrghw <5,6,7,0>, <7,1,1,1>
- 2248955028U, // <5,7,6,2>: Cost 3 vmrghw <5,6,7,0>, <7,2,0,3>
- 2656963074U, // <5,7,6,3>: Cost 3 vsldoi4 <6,5,7,6>, <3,4,5,6>
- 2248955238U, // <5,7,6,4>: Cost 3 vmrghw <5,6,7,0>, <7,4,5,6>
- 2248955329U, // <5,7,6,5>: Cost 3 vmrghw <5,6,7,0>, <7,5,6,7>
- 2656965360U, // <5,7,6,6>: Cost 3 vsldoi4 <6,5,7,6>, <6,5,7,6>
- 2248955500U, // <5,7,6,7>: Cost 3 vmrghw <5,6,7,0>, <7,7,7,7>
- 2248955522U, // <5,7,6,u>: Cost 3 vmrghw <5,6,7,0>, <7,u,1,2>
- 3718766694U, // <5,7,7,0>: Cost 4 vsldoi4 <4,5,7,7>, LHS
- 3724739827U, // <5,7,7,1>: Cost 4 vsldoi4 <5,5,7,7>, <1,6,5,7>
- 3718768739U, // <5,7,7,2>: Cost 4 vsldoi4 <4,5,7,7>, <2,u,4,5>
- 3365826337U, // <5,7,7,3>: Cost 4 vmrglw <1,6,5,7>, <5,2,7,3>
- 2798253647U, // <5,7,7,4>: Cost 3 vsldoi12 <7,7,4,5>, <7,7,4,5>
- 3365826258U, // <5,7,7,5>: Cost 4 vmrglw <1,6,5,7>, <5,1,7,5>
- 3730715377U, // <5,7,7,6>: Cost 4 vsldoi4 <6,5,7,7>, <6,5,7,7>
- 2310665836U, // <5,7,7,7>: Cost 3 vmrglw <4,7,5,7>, <7,7,7,7>
- 2798548595U, // <5,7,7,u>: Cost 3 vsldoi12 <7,7,u,5>, <7,7,u,5>
- 2311336034U, // <5,7,u,0>: Cost 3 vmrglw <4,u,5,u>, <5,6,7,0>
- 2694739758U, // <5,7,u,1>: Cost 3 vsldoi8 <1,6,5,7>, LHS
- 2248955028U, // <5,7,u,2>: Cost 3 vmrghw <5,6,7,0>, <7,2,0,3>
- 2311336442U, // <5,7,u,3>: Cost 3 vmrglw <4,u,5,u>, <6,2,7,3>
- 2311336038U, // <5,7,u,4>: Cost 3 vmrglw <4,u,5,u>, <5,6,7,4>
- 2694740122U, // <5,7,u,5>: Cost 3 vsldoi8 <1,6,5,7>, RHS
- 2656981746U, // <5,7,u,6>: Cost 3 vsldoi4 <6,5,7,u>, <6,5,7,u>
- 2311336770U, // <5,7,u,7>: Cost 3 vmrglw <4,u,5,u>, <6,6,7,7>
- 2694740325U, // <5,7,u,u>: Cost 3 vsldoi8 <1,6,5,7>, LHS
- 2705358848U, // <5,u,0,0>: Cost 3 vsldoi8 <3,4,5,u>, <0,0,0,0>
- 1631617126U, // <5,u,0,1>: Cost 2 vsldoi8 <3,4,5,u>, LHS
- 2310607866U, // <5,u,0,2>: Cost 3 vmrglw <4,7,5,0>, <7,0,1,2>
- 2302640284U, // <5,u,0,3>: Cost 3 vmrglw <3,4,5,0>, LHS
- 2754238189U, // <5,u,0,4>: Cost 3 vsldoi12 <0,4,1,5>, <u,0,4,1>
- 2305296114U, // <5,u,0,5>: Cost 3 vmrglw <3,u,5,0>, <2,3,u,5>
- 2244907106U, // <5,u,0,6>: Cost 3 vmrghw <5,0,6,1>, <5,6,7,0>
- 2302643528U, // <5,u,0,7>: Cost 3 vmrglw <3,4,5,0>, RHS
- 1631617693U, // <5,u,0,u>: Cost 2 vsldoi8 <3,4,5,u>, LHS
- 2627133542U, // <5,u,1,0>: Cost 3 vsldoi4 <1,5,u,1>, LHS
- 1237536282U, // <5,u,1,1>: Cost 2 vmrglw <4,u,5,1>, <4,u,5,1>
- 1680496430U, // <5,u,1,2>: Cost 2 vsldoi12 <0,4,1,5>, LHS
- 1237532828U, // <5,u,1,3>: Cost 2 vmrglw <4,u,5,1>, LHS
- 2693416018U, // <5,u,1,4>: Cost 3 vsldoi8 <1,4,5,u>, <1,4,5,u>
- 2756892486U, // <5,u,1,5>: Cost 3 vsldoi12 <0,u,1,5>, <u,1,5,0>
- 2694743284U, // <5,u,1,6>: Cost 3 vsldoi8 <1,6,5,u>, <1,6,5,u>
- 1237536072U, // <5,u,1,7>: Cost 2 vmrglw <4,u,5,1>, RHS
- 1680496484U, // <5,u,1,u>: Cost 2 vsldoi12 <0,4,1,5>, LHS
- 2311288709U, // <5,u,2,0>: Cost 3 vmrglw <4,u,5,2>, <u,2,3,0>
- 2245883694U, // <5,u,2,1>: Cost 3 vmrghw <5,2,1,3>, LHS
- 2699388520U, // <5,u,2,2>: Cost 3 vsldoi8 <2,4,5,u>, <2,2,2,2>
- 2754238344U, // <5,u,2,3>: Cost 3 vsldoi12 <0,4,1,5>, <u,2,3,3>
- 2699388715U, // <5,u,2,4>: Cost 3 vsldoi8 <2,4,5,u>, <2,4,5,u>
- 2757408666U, // <5,u,2,5>: Cost 3 vsldoi12 <0,u,u,5>, <u,2,5,3>
- 2705360826U, // <5,u,2,6>: Cost 3 vsldoi8 <3,4,5,u>, <2,6,3,7>
- 2302659912U, // <5,u,2,7>: Cost 3 vmrglw <3,4,5,2>, RHS
- 2754238389U, // <5,u,2,u>: Cost 3 vsldoi12 <0,4,1,5>, <u,2,u,3>
- 2754238396U, // <5,u,3,0>: Cost 3 vsldoi12 <0,4,1,5>, <u,3,0,1>
- 3827980229U, // <5,u,3,1>: Cost 4 vsldoi12 <0,4,1,5>, <u,3,1,1>
- 2644625102U, // <5,u,3,2>: Cost 3 vsldoi4 <4,5,2,3>, <2,3,4,5>
- 2289393820U, // <5,u,3,3>: Cost 3 vmrglw <1,2,5,3>, LHS
- 1631619588U, // <5,u,3,4>: Cost 2 vsldoi8 <3,4,5,u>, <3,4,5,u>
- 2785056749U, // <5,u,3,5>: Cost 3 vsldoi12 <5,5,5,5>, <u,3,5,5>
- 3363138077U, // <5,u,3,6>: Cost 4 vmrglw <1,2,5,3>, <3,4,u,6>
- 2289397064U, // <5,u,3,7>: Cost 3 vmrglw <1,2,5,3>, RHS
- 1634274120U, // <5,u,3,u>: Cost 2 vsldoi8 <3,u,5,u>, <3,u,5,u>
- 1634937753U, // <5,u,4,0>: Cost 2 vsldoi8 <4,0,5,u>, <4,0,5,u>
- 1728272410U, // <5,u,4,1>: Cost 2 vsldoi12 <u,4,1,5>, <u,4,1,5>
- 2710006843U, // <5,u,4,2>: Cost 3 vsldoi8 <4,2,5,u>, <4,2,5,u>
- 2765740076U, // <5,u,4,3>: Cost 3 vsldoi12 <2,3,4,5>, <u,4,3,5>
- 1637592285U, // <5,u,4,4>: Cost 2 vsldoi8 <4,4,5,u>, <4,4,5,u>
- 1631620406U, // <5,u,4,5>: Cost 2 vsldoi8 <3,4,5,u>, RHS
- 2712661375U, // <5,u,4,6>: Cost 3 vsldoi8 <4,6,5,u>, <4,6,5,u>
- 2302676296U, // <5,u,4,7>: Cost 3 vmrglw <3,4,5,4>, RHS
- 1631620649U, // <5,u,4,u>: Cost 2 vsldoi8 <3,4,5,u>, RHS
- 1577091174U, // <5,u,5,0>: Cost 2 vsldoi4 <5,5,5,5>, LHS
- 1174443822U, // <5,u,5,1>: Cost 2 vmrghw <5,5,5,5>, LHS
- 2766035058U, // <5,u,5,2>: Cost 3 vsldoi12 <2,3,u,5>, <u,5,2,3>
- 1237565596U, // <5,u,5,3>: Cost 2 vmrglw <4,u,5,5>, LHS
- 1577094454U, // <5,u,5,4>: Cost 2 vsldoi4 <5,5,5,5>, RHS
- 296144182U, // <5,u,5,5>: Cost 1 vspltisw1 RHS
- 1680496794U, // <5,u,5,6>: Cost 2 vsldoi12 <0,4,1,5>, RHS
- 1237568840U, // <5,u,5,7>: Cost 2 vmrglw <4,u,5,5>, RHS
- 296144182U, // <5,u,5,u>: Cost 1 vspltisw1 RHS
- 2633146470U, // <5,u,6,0>: Cost 3 vsldoi4 <2,5,u,6>, LHS
- 1175213870U, // <5,u,6,1>: Cost 2 vmrghw <5,6,7,0>, LHS
- 2633148309U, // <5,u,6,2>: Cost 3 vsldoi4 <2,5,u,6>, <2,5,u,6>
- 1228947612U, // <5,u,6,3>: Cost 2 vmrglw <3,4,5,6>, LHS
- 2633149750U, // <5,u,6,4>: Cost 3 vsldoi4 <2,5,u,6>, RHS
- 1175214234U, // <5,u,6,5>: Cost 2 vmrghw <5,6,7,0>, RHS
- 1228950018U, // <5,u,6,6>: Cost 2 vmrglw <3,4,5,6>, <3,4,5,6>
- 1228950856U, // <5,u,6,7>: Cost 2 vmrglw <3,4,5,6>, RHS
- 1228947617U, // <5,u,6,u>: Cost 2 vmrglw <3,4,5,6>, LHS
- 497614950U, // <5,u,7,0>: Cost 1 vsldoi4 RHS, LHS
- 1571357492U, // <5,u,7,1>: Cost 2 vsldoi4 RHS, <1,1,1,1>
- 1571358312U, // <5,u,7,2>: Cost 2 vsldoi4 RHS, <2,2,2,2>
- 1571358870U, // <5,u,7,3>: Cost 2 vsldoi4 RHS, <3,0,1,2>
- 497618248U, // <5,u,7,4>: Cost 1 vsldoi4 RHS, RHS
- 1571360772U, // <5,u,7,5>: Cost 2 vsldoi4 RHS, <5,5,5,5>
- 1571361274U, // <5,u,7,6>: Cost 2 vsldoi4 RHS, <6,2,7,3>
- 1571361786U, // <5,u,7,7>: Cost 2 vsldoi4 RHS, <7,0,1,2>
- 497620782U, // <5,u,7,u>: Cost 1 vsldoi4 RHS, LHS
- 497623142U, // <5,u,u,0>: Cost 1 vsldoi4 RHS, LHS
- 1631622958U, // <5,u,u,1>: Cost 2 vsldoi8 <3,4,5,u>, LHS
- 1680496997U, // <5,u,u,2>: Cost 2 vsldoi12 <0,4,1,5>, LHS
- 1228963996U, // <5,u,u,3>: Cost 2 vmrglw <3,4,5,u>, LHS
- 497626441U, // <5,u,u,4>: Cost 1 vsldoi4 RHS, RHS
- 296144182U, // <5,u,u,5>: Cost 1 vspltisw1 RHS
- 1680497037U, // <5,u,u,6>: Cost 2 vsldoi12 <0,4,1,5>, RHS
- 1228967240U, // <5,u,u,7>: Cost 2 vmrglw <3,4,5,u>, RHS
- 497628974U, // <5,u,u,u>: Cost 1 vsldoi4 RHS, LHS
- 2772451328U, // <6,0,0,0>: Cost 3 vsldoi12 <3,4,5,6>, <0,0,0,0>
- 2772451338U, // <6,0,0,1>: Cost 3 vsldoi12 <3,4,5,6>, <0,0,1,1>
- 3771146417U, // <6,0,0,2>: Cost 4 vsldoi8 <2,1,6,0>, <0,2,1,6>
- 3383095739U, // <6,0,0,3>: Cost 4 vmrglw <4,5,6,0>, <6,2,0,3>
- 3846193189U, // <6,0,0,4>: Cost 4 vsldoi12 <3,4,5,6>, <0,0,4,1>
- 3724832803U, // <6,0,0,5>: Cost 4 vsldoi4 <5,6,0,0>, <5,6,0,0>
- 3383095985U, // <6,0,0,6>: Cost 4 vmrglw <4,5,6,0>, <6,5,0,6>
- 3383096067U, // <6,0,0,7>: Cost 4 vmrglw <4,5,6,0>, <6,6,0,7>
- 2772451401U, // <6,0,0,u>: Cost 3 vsldoi12 <3,4,5,6>, <0,0,u,1>
- 2651095142U, // <6,0,1,0>: Cost 3 vsldoi4 <5,6,0,1>, LHS
- 2251612262U, // <6,0,1,1>: Cost 3 vmrghw <6,1,7,1>, LHS
- 1698709606U, // <6,0,1,2>: Cost 2 vsldoi12 <3,4,5,6>, LHS
- 2651097602U, // <6,0,1,3>: Cost 3 vsldoi4 <5,6,0,1>, <3,4,5,6>
- 2651098422U, // <6,0,1,4>: Cost 3 vsldoi4 <5,6,0,1>, RHS
- 2651099172U, // <6,0,1,5>: Cost 3 vsldoi4 <5,6,0,1>, <5,6,0,1>
- 2657071869U, // <6,0,1,6>: Cost 3 vsldoi4 <6,6,0,1>, <6,6,0,1>
- 3724841978U, // <6,0,1,7>: Cost 4 vsldoi4 <5,6,0,1>, <7,0,1,2>
- 1698709660U, // <6,0,1,u>: Cost 2 vsldoi12 <3,4,5,6>, LHS
- 2252292096U, // <6,0,2,0>: Cost 3 vmrghw <6,2,7,3>, <0,0,0,0>
- 1178550374U, // <6,0,2,1>: Cost 2 vmrghw <6,2,7,3>, LHS
- 3826655418U, // <6,0,2,2>: Cost 4 vsldoi12 <0,2,1,6>, <0,2,2,6>
- 3777783485U, // <6,0,2,3>: Cost 4 vsldoi8 <3,2,6,0>, <2,3,2,6>
- 2252292434U, // <6,0,2,4>: Cost 3 vmrghw <6,2,7,3>, <0,4,1,5>
- 3785746280U, // <6,0,2,5>: Cost 4 vsldoi8 <4,5,6,0>, <2,5,3,6>
- 2252292593U, // <6,0,2,6>: Cost 3 vmrghw <6,2,7,3>, <0,6,1,2>
- 3736794583U, // <6,0,2,7>: Cost 4 vsldoi4 <7,6,0,2>, <7,6,0,2>
- 1178550941U, // <6,0,2,u>: Cost 2 vmrghw <6,2,7,3>, LHS
- 3375153152U, // <6,0,3,0>: Cost 4 vmrglw <3,2,6,3>, <0,0,0,0>
- 2772451584U, // <6,0,3,1>: Cost 3 vsldoi12 <3,4,5,6>, <0,3,1,4>
- 3777784163U, // <6,0,3,2>: Cost 4 vsldoi8 <3,2,6,0>, <3,2,6,0>
- 3846193426U, // <6,0,3,3>: Cost 4 vsldoi12 <3,4,5,6>, <0,3,3,4>
- 2712005122U, // <6,0,3,4>: Cost 3 vsldoi8 <4,5,6,0>, <3,4,5,6>
- 3724857382U, // <6,0,3,5>: Cost 4 vsldoi4 <5,6,0,3>, <5,6,0,3>
- 3802335864U, // <6,0,3,6>: Cost 4 vsldoi8 <7,3,6,0>, <3,6,0,7>
- 3801672410U, // <6,0,3,7>: Cost 4 vsldoi8 <7,2,6,0>, <3,7,2,6>
- 2772451647U, // <6,0,3,u>: Cost 3 vsldoi12 <3,4,5,6>, <0,3,u,4>
- 3383123968U, // <6,0,4,0>: Cost 4 vmrglw <4,5,6,4>, <0,0,0,0>
- 2772451666U, // <6,0,4,1>: Cost 3 vsldoi12 <3,4,5,6>, <0,4,1,5>
- 3773803577U, // <6,0,4,2>: Cost 4 vsldoi8 <2,5,6,0>, <4,2,5,6>
- 3724864002U, // <6,0,4,3>: Cost 4 vsldoi4 <5,6,0,4>, <3,4,5,6>
- 3846193517U, // <6,0,4,4>: Cost 4 vsldoi12 <3,4,5,6>, <0,4,4,5>
- 2712005935U, // <6,0,4,5>: Cost 3 vsldoi8 <4,5,6,0>, <4,5,6,0>
- 3327009265U, // <6,0,4,6>: Cost 4 vmrghw <6,4,2,5>, <0,6,1,2>
- 3383126648U, // <6,0,4,7>: Cost 5 vmrglw <4,5,6,4>, <3,6,0,7>
- 2772451729U, // <6,0,4,u>: Cost 3 vsldoi12 <3,4,5,6>, <0,4,u,5>
- 3373178880U, // <6,0,5,0>: Cost 4 vmrglw <2,u,6,5>, <0,0,0,0>
- 2254266470U, // <6,0,5,1>: Cost 3 vmrghw <6,5,7,1>, LHS
- 3785748248U, // <6,0,5,2>: Cost 4 vsldoi8 <4,5,6,0>, <5,2,6,3>
- 3790393190U, // <6,0,5,3>: Cost 4 vsldoi8 <5,3,6,0>, <5,3,6,0>
- 3328000338U, // <6,0,5,4>: Cost 4 vmrghw <6,5,7,0>, <0,4,1,5>
- 3785748494U, // <6,0,5,5>: Cost 4 vsldoi8 <4,5,6,0>, <5,5,6,6>
- 3785748516U, // <6,0,5,6>: Cost 4 vsldoi8 <4,5,6,0>, <5,6,0,1>
- 3379153528U, // <6,0,5,7>: Cost 4 vmrglw <3,u,6,5>, <3,6,0,7>
- 2254267037U, // <6,0,5,u>: Cost 3 vmrghw <6,5,7,1>, LHS
- 2254897152U, // <6,0,6,0>: Cost 3 vmrghw <6,6,6,6>, <0,0,0,0>
- 1181155430U, // <6,0,6,1>: Cost 2 vmrghw <6,6,6,6>, LHS
- 3785748923U, // <6,0,6,2>: Cost 4 vsldoi8 <4,5,6,0>, <6,2,0,3>
- 3785749042U, // <6,0,6,3>: Cost 4 vsldoi8 <4,5,6,0>, <6,3,4,5>
- 2254897490U, // <6,0,6,4>: Cost 3 vmrghw <6,6,6,6>, <0,4,1,5>
- 3785749169U, // <6,0,6,5>: Cost 4 vsldoi8 <4,5,6,0>, <6,5,0,6>
- 2724614962U, // <6,0,6,6>: Cost 3 vsldoi8 <6,6,6,0>, <6,6,6,0>
- 3787739982U, // <6,0,6,7>: Cost 4 vsldoi8 <4,u,6,0>, <6,7,0,1>
- 1181155997U, // <6,0,6,u>: Cost 2 vmrghw <6,6,6,6>, LHS
- 1235664896U, // <6,0,7,0>: Cost 2 vmrglw RHS, <0,0,0,0>
- 1235666598U, // <6,0,7,1>: Cost 2 vmrglw RHS, <2,3,0,1>
- 3712943720U, // <6,0,7,2>: Cost 4 vsldoi4 <3,6,0,7>, <2,2,2,2>
- 2639202936U, // <6,0,7,3>: Cost 3 vsldoi4 <3,6,0,7>, <3,6,0,7>
- 2639203638U, // <6,0,7,4>: Cost 3 vsldoi4 <3,6,0,7>, RHS
- 2309409236U, // <6,0,7,5>: Cost 3 vmrglw RHS, <3,4,0,5>
- 3712946517U, // <6,0,7,6>: Cost 4 vsldoi4 <3,6,0,7>, <6,0,7,0>
- 2309409400U, // <6,0,7,7>: Cost 3 vmrglw RHS, <3,6,0,7>
- 1235666605U, // <6,0,7,u>: Cost 2 vmrglw RHS, <2,3,0,u>
- 1235673088U, // <6,0,u,0>: Cost 2 vmrglw RHS, <0,0,0,0>
- 1235674790U, // <6,0,u,1>: Cost 2 vmrglw RHS, <2,3,0,1>
- 1698710173U, // <6,0,u,2>: Cost 2 vsldoi12 <3,4,5,6>, LHS
- 2639211129U, // <6,0,u,3>: Cost 3 vsldoi4 <3,6,0,u>, <3,6,0,u>
- 2639211830U, // <6,0,u,4>: Cost 3 vsldoi4 <3,6,0,u>, RHS
- 2712008858U, // <6,0,u,5>: Cost 3 vsldoi8 <4,5,6,0>, RHS
- 2657129220U, // <6,0,u,6>: Cost 3 vsldoi4 <6,6,0,u>, <6,6,0,u>
- 2309417592U, // <6,0,u,7>: Cost 3 vmrglw RHS, <3,6,0,7>
- 1698710227U, // <6,0,u,u>: Cost 2 vsldoi12 <3,4,5,6>, LHS
- 3775799296U, // <6,1,0,0>: Cost 4 vsldoi8 <2,u,6,1>, <0,0,0,0>
- 2702057574U, // <6,1,0,1>: Cost 3 vsldoi8 <2,u,6,1>, LHS
- 3373143763U, // <6,1,0,2>: Cost 4 vmrglw <2,u,6,0>, <u,0,1,2>
- 3695045122U, // <6,1,0,3>: Cost 4 vsldoi4 <0,6,1,0>, <3,4,5,6>
- 3775799634U, // <6,1,0,4>: Cost 4 vsldoi8 <2,u,6,1>, <0,4,1,5>
- 3383091538U, // <6,1,0,5>: Cost 4 vmrglw <4,5,6,0>, <0,4,1,5>
- 3368493233U, // <6,1,0,6>: Cost 4 vmrglw <2,1,6,0>, <0,2,1,6>
- 3362522319U, // <6,1,0,7>: Cost 5 vmrglw <1,1,6,0>, <1,6,1,7>
- 2702058141U, // <6,1,0,u>: Cost 3 vsldoi8 <2,u,6,1>, LHS
- 3834250027U, // <6,1,1,0>: Cost 4 vsldoi12 <1,4,5,6>, <1,1,0,1>
- 2772452148U, // <6,1,1,1>: Cost 3 vsldoi12 <3,4,5,6>, <1,1,1,1>
- 3832038210U, // <6,1,1,2>: Cost 4 vsldoi12 <1,1,2,6>, <1,1,2,6>
- 3373150660U, // <6,1,1,3>: Cost 4 vmrglw <2,u,6,1>, <6,2,1,3>
- 3834250067U, // <6,1,1,4>: Cost 4 vsldoi12 <1,4,5,6>, <1,1,4,5>
- 3373146450U, // <6,1,1,5>: Cost 4 vmrglw <2,u,6,1>, <0,4,1,5>
- 3826656102U, // <6,1,1,6>: Cost 4 vsldoi12 <0,2,1,6>, <1,1,6,6>
- 3362530511U, // <6,1,1,7>: Cost 4 vmrglw <1,1,6,1>, <1,6,1,7>
- 2772452148U, // <6,1,1,u>: Cost 3 vsldoi12 <3,4,5,6>, <1,1,1,1>
- 2669092966U, // <6,1,2,0>: Cost 3 vsldoi4 <u,6,1,2>, LHS
- 2252292916U, // <6,1,2,1>: Cost 3 vmrghw <6,2,7,3>, <1,1,1,1>
- 2252293014U, // <6,1,2,2>: Cost 3 vmrghw <6,2,7,3>, <1,2,3,0>
- 2772452246U, // <6,1,2,3>: Cost 3 vsldoi12 <3,4,5,6>, <1,2,3,0>
- 2669096246U, // <6,1,2,4>: Cost 3 vsldoi4 <u,6,1,2>, RHS
- 3846194091U, // <6,1,2,5>: Cost 4 vsldoi12 <3,4,5,6>, <1,2,5,3>
- 2702059450U, // <6,1,2,6>: Cost 3 vsldoi8 <2,u,6,1>, <2,6,3,7>
- 3870081978U, // <6,1,2,7>: Cost 4 vsldoi12 <7,4,5,6>, <1,2,7,0>
- 2702059633U, // <6,1,2,u>: Cost 3 vsldoi8 <2,u,6,1>, <2,u,6,1>
- 3775801494U, // <6,1,3,0>: Cost 4 vsldoi8 <2,u,6,1>, <3,0,1,2>
- 3777128723U, // <6,1,3,1>: Cost 4 vsldoi8 <3,1,6,1>, <3,1,6,1>
- 3775801702U, // <6,1,3,2>: Cost 4 vsldoi8 <2,u,6,1>, <3,2,6,3>
- 3775801756U, // <6,1,3,3>: Cost 4 vsldoi8 <2,u,6,1>, <3,3,3,3>
- 3775801858U, // <6,1,3,4>: Cost 4 vsldoi8 <2,u,6,1>, <3,4,5,6>
- 3375153490U, // <6,1,3,5>: Cost 4 vmrglw <3,2,6,3>, <0,4,1,5>
- 3826656265U, // <6,1,3,6>: Cost 4 vsldoi12 <0,2,1,6>, <1,3,6,7>
- 3775802051U, // <6,1,3,7>: Cost 4 vsldoi8 <2,u,6,1>, <3,7,0,1>
- 3775802142U, // <6,1,3,u>: Cost 4 vsldoi8 <2,u,6,1>, <3,u,1,2>
- 3846194206U, // <6,1,4,0>: Cost 4 vsldoi12 <3,4,5,6>, <1,4,0,1>
- 3846194219U, // <6,1,4,1>: Cost 4 vsldoi12 <3,4,5,6>, <1,4,1,5>
- 3846194228U, // <6,1,4,2>: Cost 4 vsldoi12 <3,4,5,6>, <1,4,2,5>
- 3846194236U, // <6,1,4,3>: Cost 4 vsldoi12 <3,4,5,6>, <1,4,3,4>
- 3846194246U, // <6,1,4,4>: Cost 4 vsldoi12 <3,4,5,6>, <1,4,4,5>
- 2760508496U, // <6,1,4,5>: Cost 3 vsldoi12 <1,4,5,6>, <1,4,5,6>
- 3368526001U, // <6,1,4,6>: Cost 4 vmrglw <2,1,6,4>, <0,2,1,6>
- 3870082144U, // <6,1,4,7>: Cost 4 vsldoi12 <7,4,5,6>, <1,4,7,4>
- 2760729707U, // <6,1,4,u>: Cost 3 vsldoi12 <1,4,u,6>, <1,4,u,6>
- 2714668660U, // <6,1,5,0>: Cost 3 vsldoi8 <5,0,6,1>, <5,0,6,1>
- 3834619005U, // <6,1,5,1>: Cost 4 vsldoi12 <1,5,1,6>, <1,5,1,6>
- 3834692742U, // <6,1,5,2>: Cost 4 vsldoi12 <1,5,2,6>, <1,5,2,6>
- 3846194317U, // <6,1,5,3>: Cost 4 vsldoi12 <3,4,5,6>, <1,5,3,4>
- 3834840216U, // <6,1,5,4>: Cost 4 vsldoi12 <1,5,4,6>, <1,5,4,6>
- 3834913953U, // <6,1,5,5>: Cost 4 vsldoi12 <1,5,5,6>, <1,5,5,6>
- 2719977570U, // <6,1,5,6>: Cost 3 vsldoi8 <5,u,6,1>, <5,6,7,0>
- 3367208143U, // <6,1,5,7>: Cost 4 vmrglw <1,u,6,5>, <1,6,1,7>
- 2719977724U, // <6,1,5,u>: Cost 3 vsldoi8 <5,u,6,1>, <5,u,6,1>
- 2669125734U, // <6,1,6,0>: Cost 3 vsldoi4 <u,6,1,6>, LHS
- 2254897972U, // <6,1,6,1>: Cost 3 vmrghw <6,6,6,6>, <1,1,1,1>
- 2254898070U, // <6,1,6,2>: Cost 3 vmrghw <6,6,6,6>, <1,2,3,0>
- 3775803929U, // <6,1,6,3>: Cost 4 vsldoi8 <2,u,6,1>, <6,3,1,7>
- 2669129014U, // <6,1,6,4>: Cost 3 vsldoi4 <u,6,1,6>, RHS
- 2322006354U, // <6,1,6,5>: Cost 3 vmrglw <6,6,6,6>, <0,4,1,5>
- 2725950264U, // <6,1,6,6>: Cost 3 vsldoi8 <6,u,6,1>, <6,6,6,6>
- 3793720142U, // <6,1,6,7>: Cost 4 vsldoi8 <5,u,6,1>, <6,7,0,1>
- 2254898556U, // <6,1,6,u>: Cost 3 vmrghw <6,6,6,6>, <1,u,3,0>
- 2627330150U, // <6,1,7,0>: Cost 3 vsldoi4 <1,6,1,7>, LHS
- 1235664906U, // <6,1,7,1>: Cost 2 vmrglw RHS, <0,0,1,1>
- 1235667094U, // <6,1,7,2>: Cost 2 vmrglw RHS, <3,0,1,2>
- 2309406894U, // <6,1,7,3>: Cost 3 vmrglw RHS, <0,2,1,3>
- 2627333430U, // <6,1,7,4>: Cost 3 vsldoi4 <1,6,1,7>, RHS
- 1235665234U, // <6,1,7,5>: Cost 2 vmrglw RHS, <0,4,1,5>
- 2309406897U, // <6,1,7,6>: Cost 3 vmrglw RHS, <0,2,1,6>
- 2309407222U, // <6,1,7,7>: Cost 3 vmrglw RHS, <0,6,1,7>
- 1235664913U, // <6,1,7,u>: Cost 2 vmrglw RHS, <0,0,1,u>
- 2627338342U, // <6,1,u,0>: Cost 3 vsldoi4 <1,6,1,u>, LHS
- 1235673098U, // <6,1,u,1>: Cost 2 vmrglw RHS, <0,0,1,1>
- 1235675286U, // <6,1,u,2>: Cost 2 vmrglw RHS, <3,0,1,2>
- 2772452732U, // <6,1,u,3>: Cost 3 vsldoi12 <3,4,5,6>, <1,u,3,0>
- 2627341622U, // <6,1,u,4>: Cost 3 vsldoi4 <1,6,1,u>, RHS
- 1235673426U, // <6,1,u,5>: Cost 2 vmrglw RHS, <0,4,1,5>
- 2309415089U, // <6,1,u,6>: Cost 3 vmrglw RHS, <0,2,1,6>
- 2309415414U, // <6,1,u,7>: Cost 3 vmrglw RHS, <0,6,1,7>
- 1235673105U, // <6,1,u,u>: Cost 2 vmrglw RHS, <0,0,1,u>
- 3324683725U, // <6,2,0,0>: Cost 4 vmrghw <6,0,7,0>, <2,0,3,0>
- 2725290086U, // <6,2,0,1>: Cost 3 vsldoi8 <6,7,6,2>, LHS
- 3771162801U, // <6,2,0,2>: Cost 4 vsldoi8 <2,1,6,2>, <0,2,1,6>
- 2309349478U, // <6,2,0,3>: Cost 3 vmrglw <4,5,6,0>, LHS
- 3730951478U, // <6,2,0,4>: Cost 4 vsldoi4 <6,6,2,0>, RHS
- 3840738784U, // <6,2,0,5>: Cost 4 vsldoi12 <2,5,3,6>, <2,0,5,1>
- 3842655721U, // <6,2,0,6>: Cost 4 vsldoi12 <2,u,2,6>, <2,0,6,1>
- 3736925671U, // <6,2,0,7>: Cost 4 vsldoi4 <7,6,2,0>, <7,6,2,0>
- 2309349483U, // <6,2,0,u>: Cost 3 vmrglw <4,5,6,0>, LHS
- 3367840468U, // <6,2,1,0>: Cost 4 vmrglw <2,0,6,1>, <3,7,2,0>
- 3325355551U, // <6,2,1,1>: Cost 4 vmrghw <6,1,7,1>, <2,1,3,1>
- 3373147752U, // <6,2,1,2>: Cost 4 vmrglw <2,u,6,1>, <2,2,2,2>
- 2299404390U, // <6,2,1,3>: Cost 3 vmrglw <2,u,6,1>, LHS
- 3701099830U, // <6,2,1,4>: Cost 5 vsldoi4 <1,6,2,1>, RHS
- 3767846054U, // <6,2,1,5>: Cost 4 vsldoi8 <1,5,6,2>, <1,5,6,2>
- 3826656825U, // <6,2,1,6>: Cost 4 vsldoi12 <0,2,1,6>, <2,1,6,0>
- 3373147838U, // <6,2,1,7>: Cost 5 vmrglw <2,u,6,1>, <2,3,2,7>
- 2299404395U, // <6,2,1,u>: Cost 3 vmrglw <2,u,6,1>, LHS
- 2657222758U, // <6,2,2,0>: Cost 3 vsldoi4 <6,6,2,2>, LHS
- 3771164219U, // <6,2,2,1>: Cost 4 vsldoi8 <2,1,6,2>, <2,1,6,2>
- 2766481000U, // <6,2,2,2>: Cost 3 vsldoi12 <2,4,5,6>, <2,2,2,2>
- 2772452978U, // <6,2,2,3>: Cost 3 vsldoi12 <3,4,5,6>, <2,2,3,3>
- 2657226038U, // <6,2,2,4>: Cost 3 vsldoi4 <6,6,2,2>, RHS
- 3790407528U, // <6,2,2,5>: Cost 4 vsldoi8 <5,3,6,2>, <2,5,3,6>
- 2252294074U, // <6,2,2,6>: Cost 3 vmrghw <6,2,7,3>, <2,6,3,7>
- 2252294148U, // <6,2,2,7>: Cost 3 vmrghw <6,2,7,3>, <2,7,3,0>
- 2772453023U, // <6,2,2,u>: Cost 3 vsldoi12 <3,4,5,6>, <2,2,u,3>
- 2772453030U, // <6,2,3,0>: Cost 3 vsldoi12 <3,4,5,6>, <2,3,0,1>
- 3834250930U, // <6,2,3,1>: Cost 4 vsldoi12 <1,4,5,6>, <2,3,1,4>
- 2765596349U, // <6,2,3,2>: Cost 3 vsldoi12 <2,3,2,6>, <2,3,2,6>
- 2301411430U, // <6,2,3,3>: Cost 3 vmrglw <3,2,6,3>, LHS
- 2772453070U, // <6,2,3,4>: Cost 3 vsldoi12 <3,4,5,6>, <2,3,4,5>
- 2765817560U, // <6,2,3,5>: Cost 3 vsldoi12 <2,3,5,6>, <2,3,5,6>
- 2252933050U, // <6,2,3,6>: Cost 3 vmrghw <6,3,7,0>, <2,6,3,7>
- 2796340968U, // <6,2,3,7>: Cost 3 vsldoi12 <7,4,5,6>, <2,3,7,4>
- 2766038771U, // <6,2,3,u>: Cost 3 vsldoi12 <2,3,u,6>, <2,3,u,6>
- 3725008998U, // <6,2,4,0>: Cost 4 vsldoi4 <5,6,2,4>, LHS
- 3368530217U, // <6,2,4,1>: Cost 5 vmrglw <2,1,6,4>, <6,0,2,1>
- 3840222989U, // <6,2,4,2>: Cost 4 vsldoi12 <2,4,5,6>, <2,4,2,5>
- 2309382246U, // <6,2,4,3>: Cost 3 vmrglw <4,5,6,4>, LHS
- 3725012278U, // <6,2,4,4>: Cost 4 vsldoi4 <5,6,2,4>, RHS
- 2766481193U, // <6,2,4,5>: Cost 3 vsldoi12 <2,4,5,6>, <2,4,5,6>
- 3842656049U, // <6,2,4,6>: Cost 4 vsldoi12 <2,u,2,6>, <2,4,6,5>
- 3327010820U, // <6,2,4,7>: Cost 4 vmrghw <6,4,2,5>, <2,7,3,0>
- 2766702404U, // <6,2,4,u>: Cost 3 vsldoi12 <2,4,u,6>, <2,4,u,6>
- 3713073254U, // <6,2,5,0>: Cost 4 vsldoi4 <3,6,2,5>, LHS
- 3789082310U, // <6,2,5,1>: Cost 4 vsldoi8 <5,1,6,2>, <5,1,6,2>
- 3840665439U, // <6,2,5,2>: Cost 4 vsldoi12 <2,5,2,6>, <2,5,2,6>
- 2766997352U, // <6,2,5,3>: Cost 3 vsldoi12 <2,5,3,6>, <2,5,3,6>
- 3713076534U, // <6,2,5,4>: Cost 4 vsldoi4 <3,6,2,5>, RHS
- 3791736842U, // <6,2,5,5>: Cost 4 vsldoi8 <5,5,6,2>, <5,5,6,2>
- 3373180605U, // <6,2,5,6>: Cost 4 vmrglw <2,u,6,5>, <2,3,2,6>
- 3793064108U, // <6,2,5,7>: Cost 4 vsldoi8 <5,7,6,2>, <5,7,6,2>
- 2767366037U, // <6,2,5,u>: Cost 3 vsldoi12 <2,5,u,6>, <2,5,u,6>
- 3701137510U, // <6,2,6,0>: Cost 4 vsldoi4 <1,6,2,6>, LHS
- 3701138647U, // <6,2,6,1>: Cost 4 vsldoi4 <1,6,2,6>, <1,6,2,6>
- 2254898792U, // <6,2,6,2>: Cost 3 vmrghw <6,6,6,6>, <2,2,2,2>
- 1248264294U, // <6,2,6,3>: Cost 2 vmrglw <6,6,6,6>, LHS
- 3701140790U, // <6,2,6,4>: Cost 4 vsldoi4 <1,6,2,6>, RHS
- 3725029435U, // <6,2,6,5>: Cost 4 vsldoi4 <5,6,2,6>, <5,6,2,6>
- 2254899130U, // <6,2,6,6>: Cost 3 vmrghw <6,6,6,6>, <2,6,3,7>
- 2725294981U, // <6,2,6,7>: Cost 3 vsldoi8 <6,7,6,2>, <6,7,6,2>
- 1248264299U, // <6,2,6,u>: Cost 2 vmrglw <6,6,6,6>, LHS
- 2633375846U, // <6,2,7,0>: Cost 3 vsldoi4 <2,6,2,7>, LHS
- 2309407468U, // <6,2,7,1>: Cost 3 vmrglw RHS, <1,0,2,1>
- 1235666536U, // <6,2,7,2>: Cost 2 vmrglw RHS, <2,2,2,2>
- 161923174U, // <6,2,7,3>: Cost 1 vmrglw RHS, LHS
- 2633379126U, // <6,2,7,4>: Cost 3 vsldoi4 <2,6,2,7>, RHS
- 2309407796U, // <6,2,7,5>: Cost 3 vmrglw RHS, <1,4,2,5>
- 2309408445U, // <6,2,7,6>: Cost 3 vmrglw RHS, <2,3,2,6>
- 2309407960U, // <6,2,7,7>: Cost 3 vmrglw RHS, <1,6,2,7>
- 161923179U, // <6,2,7,u>: Cost 1 vmrglw RHS, LHS
- 2633384038U, // <6,2,u,0>: Cost 3 vsldoi4 <2,6,2,u>, LHS
- 2309415660U, // <6,2,u,1>: Cost 3 vmrglw RHS, <1,0,2,1>
- 1235674728U, // <6,2,u,2>: Cost 2 vmrglw RHS, <2,2,2,2>
- 161931366U, // <6,2,u,3>: Cost 1 vmrglw RHS, LHS
- 2633387318U, // <6,2,u,4>: Cost 3 vsldoi4 <2,6,2,u>, RHS
- 2769135725U, // <6,2,u,5>: Cost 3 vsldoi12 <2,u,5,6>, <2,u,5,6>
- 2309416637U, // <6,2,u,6>: Cost 3 vmrglw RHS, <2,3,2,6>
- 2309416152U, // <6,2,u,7>: Cost 3 vmrglw RHS, <1,6,2,7>
- 161931371U, // <6,2,u,u>: Cost 1 vmrglw RHS, LHS
- 3777806336U, // <6,3,0,0>: Cost 4 vsldoi8 <3,2,6,3>, <0,0,0,0>
- 2704064614U, // <6,3,0,1>: Cost 3 vsldoi8 <3,2,6,3>, LHS
- 3765862577U, // <6,3,0,2>: Cost 4 vsldoi8 <1,2,6,3>, <0,2,1,6>
- 3843393708U, // <6,3,0,3>: Cost 4 vsldoi12 <3,0,3,6>, <3,0,3,6>
- 2250516994U, // <6,3,0,4>: Cost 3 vmrghw <6,0,1,2>, <3,4,5,6>
- 3725054014U, // <6,3,0,5>: Cost 4 vsldoi4 <5,6,3,0>, <5,6,3,0>
- 3383093096U, // <6,3,0,6>: Cost 4 vmrglw <4,5,6,0>, <2,5,3,6>
- 3368495034U, // <6,3,0,7>: Cost 4 vmrglw <2,1,6,0>, <2,6,3,7>
- 2704065181U, // <6,3,0,u>: Cost 3 vsldoi8 <3,2,6,3>, LHS
- 2251622550U, // <6,3,1,0>: Cost 3 vmrghw <6,1,7,2>, <3,0,1,2>
- 3777807156U, // <6,3,1,1>: Cost 4 vsldoi8 <3,2,6,3>, <1,1,1,1>
- 3765863348U, // <6,3,1,2>: Cost 4 vsldoi8 <1,2,6,3>, <1,2,6,3>
- 3373147762U, // <6,3,1,3>: Cost 4 vmrglw <2,u,6,1>, <2,2,3,3>
- 3834251525U, // <6,3,1,4>: Cost 4 vsldoi12 <1,4,5,6>, <3,1,4,5>
- 3373147683U, // <6,3,1,5>: Cost 5 vmrglw <2,u,6,1>, <2,1,3,5>
- 3391727545U, // <6,3,1,6>: Cost 4 vmrglw <6,0,6,1>, <2,6,3,6>
- 2299406266U, // <6,3,1,7>: Cost 3 vmrglw <2,u,6,1>, <2,6,3,7>
- 2251622550U, // <6,3,1,u>: Cost 3 vmrghw <6,1,7,2>, <3,0,1,2>
- 2252294294U, // <6,3,2,0>: Cost 3 vmrghw <6,2,7,3>, <3,0,1,2>
- 3326036198U, // <6,3,2,1>: Cost 4 vmrghw <6,2,7,3>, <3,1,1,1>
- 3771836045U, // <6,3,2,2>: Cost 4 vsldoi8 <2,2,6,3>, <2,2,6,3>
- 2252294556U, // <6,3,2,3>: Cost 3 vmrghw <6,2,7,3>, <3,3,3,3>
- 2252294658U, // <6,3,2,4>: Cost 3 vmrghw <6,2,7,3>, <3,4,5,6>
- 3840739677U, // <6,3,2,5>: Cost 4 vsldoi12 <2,5,3,6>, <3,2,5,3>
- 2704066490U, // <6,3,2,6>: Cost 3 vsldoi8 <3,2,6,3>, <2,6,3,7>
- 3368511418U, // <6,3,2,7>: Cost 4 vmrglw <2,1,6,2>, <2,6,3,7>
- 2252294942U, // <6,3,2,u>: Cost 3 vmrghw <6,2,7,3>, <3,u,1,2>
- 3707158630U, // <6,3,3,0>: Cost 4 vsldoi4 <2,6,3,3>, LHS
- 3765864692U, // <6,3,3,1>: Cost 5 vsldoi8 <1,2,6,3>, <3,1,2,6>
- 2704066918U, // <6,3,3,2>: Cost 3 vsldoi8 <3,2,6,3>, <3,2,6,3>
- 2772453788U, // <6,3,3,3>: Cost 3 vsldoi12 <3,4,5,6>, <3,3,3,3>
- 2772453799U, // <6,3,3,4>: Cost 3 vsldoi12 <3,4,5,6>, <3,3,4,5>
- 3789752888U, // <6,3,3,5>: Cost 4 vsldoi8 <5,2,6,3>, <3,5,2,6>
- 3840739770U, // <6,3,3,6>: Cost 4 vsldoi12 <2,5,3,6>, <3,3,6,6>
- 2301413306U, // <6,3,3,7>: Cost 3 vmrglw <3,2,6,3>, <2,6,3,7>
- 2775108043U, // <6,3,3,u>: Cost 3 vsldoi12 <3,u,5,6>, <3,3,u,5>
- 2651340902U, // <6,3,4,0>: Cost 3 vsldoi4 <5,6,3,4>, LHS
- 3846195674U, // <6,3,4,1>: Cost 4 vsldoi12 <3,4,5,6>, <3,4,1,2>
- 3845974503U, // <6,3,4,2>: Cost 4 vsldoi12 <3,4,2,6>, <3,4,2,6>
- 2651343362U, // <6,3,4,3>: Cost 3 vsldoi4 <5,6,3,4>, <3,4,5,6>
- 2651344182U, // <6,3,4,4>: Cost 3 vsldoi4 <5,6,3,4>, RHS
- 1698712066U, // <6,3,4,5>: Cost 2 vsldoi12 <3,4,5,6>, <3,4,5,6>
- 3383125864U, // <6,3,4,6>: Cost 4 vmrglw <4,5,6,4>, <2,5,3,6>
- 3368527802U, // <6,3,4,7>: Cost 4 vmrglw <2,1,6,4>, <2,6,3,7>
- 1698933277U, // <6,3,4,u>: Cost 2 vsldoi12 <3,4,u,6>, <3,4,u,6>
- 3373179798U, // <6,3,5,0>: Cost 4 vmrglw <2,u,6,5>, <1,2,3,0>
- 3707176179U, // <6,3,5,1>: Cost 5 vsldoi4 <2,6,3,5>, <1,6,5,7>
- 2716012312U, // <6,3,5,2>: Cost 3 vsldoi8 <5,2,6,3>, <5,2,6,3>
- 3373180530U, // <6,3,5,3>: Cost 4 vmrglw <2,u,6,5>, <2,2,3,3>
- 2254309890U, // <6,3,5,4>: Cost 3 vmrghw <6,5,7,6>, <3,4,5,6>
- 3785773070U, // <6,3,5,5>: Cost 4 vsldoi8 <4,5,6,3>, <5,5,6,6>
- 3840739932U, // <6,3,5,6>: Cost 4 vsldoi12 <2,5,3,6>, <3,5,6,6>
- 2299439034U, // <6,3,5,7>: Cost 3 vmrglw <2,u,6,5>, <2,6,3,7>
- 2719994110U, // <6,3,5,u>: Cost 3 vsldoi8 <5,u,6,3>, <5,u,6,3>
- 2254899350U, // <6,3,6,0>: Cost 3 vmrghw <6,6,6,6>, <3,0,1,2>
- 3328641254U, // <6,3,6,1>: Cost 4 vmrghw <6,6,6,6>, <3,1,1,1>
- 2633443257U, // <6,3,6,2>: Cost 3 vsldoi4 <2,6,3,6>, <2,6,3,6>
- 2254899612U, // <6,3,6,3>: Cost 3 vmrghw <6,6,6,6>, <3,3,3,3>
- 2254899714U, // <6,3,6,4>: Cost 3 vmrghw <6,6,6,6>, <3,4,5,6>
- 3785773772U, // <6,3,6,5>: Cost 4 vsldoi8 <4,5,6,3>, <6,5,3,6>
- 2725966648U, // <6,3,6,6>: Cost 3 vsldoi8 <6,u,6,3>, <6,6,6,6>
- 2322007994U, // <6,3,6,7>: Cost 3 vmrglw <6,6,6,6>, <2,6,3,7>
- 2254899998U, // <6,3,6,u>: Cost 3 vmrghw <6,6,6,6>, <3,u,1,2>
- 1559707750U, // <6,3,7,0>: Cost 2 vsldoi4 <2,6,3,7>, LHS
- 2633450292U, // <6,3,7,1>: Cost 3 vsldoi4 <2,6,3,7>, <1,1,1,1>
- 1559709626U, // <6,3,7,2>: Cost 2 vsldoi4 <2,6,3,7>, <2,6,3,7>
- 1235666546U, // <6,3,7,3>: Cost 2 vmrglw RHS, <2,2,3,3>
- 1559711030U, // <6,3,7,4>: Cost 2 vsldoi4 <2,6,3,7>, RHS
- 2309408291U, // <6,3,7,5>: Cost 3 vmrglw RHS, <2,1,3,5>
- 2633454152U, // <6,3,7,6>: Cost 3 vsldoi4 <2,6,3,7>, <6,3,7,0>
- 1235666874U, // <6,3,7,7>: Cost 2 vmrglw RHS, <2,6,3,7>
- 1559713582U, // <6,3,7,u>: Cost 2 vsldoi4 <2,6,3,7>, LHS
- 1559715942U, // <6,3,u,0>: Cost 2 vsldoi4 <2,6,3,u>, LHS
- 2633458484U, // <6,3,u,1>: Cost 3 vsldoi4 <2,6,3,u>, <1,1,1,1>
- 1559717819U, // <6,3,u,2>: Cost 2 vsldoi4 <2,6,3,u>, <2,6,3,u>
- 1235674738U, // <6,3,u,3>: Cost 2 vmrglw RHS, <2,2,3,3>
- 1559719222U, // <6,3,u,4>: Cost 2 vsldoi4 <2,6,3,u>, RHS
- 1701366598U, // <6,3,u,5>: Cost 2 vsldoi12 <3,u,5,6>, <3,u,5,6>
- 2633462353U, // <6,3,u,6>: Cost 3 vsldoi4 <2,6,3,u>, <6,3,u,0>
- 1235675066U, // <6,3,u,7>: Cost 2 vmrglw RHS, <2,6,3,7>
- 1559721774U, // <6,3,u,u>: Cost 2 vsldoi4 <2,6,3,u>, LHS
- 3785777152U, // <6,4,0,0>: Cost 4 vsldoi8 <4,5,6,4>, <0,0,0,0>
- 2712035430U, // <6,4,0,1>: Cost 3 vsldoi8 <4,5,6,4>, LHS
- 3771179185U, // <6,4,0,2>: Cost 4 vsldoi8 <2,1,6,4>, <0,2,1,6>
- 3846196096U, // <6,4,0,3>: Cost 4 vsldoi12 <3,4,5,6>, <4,0,3,1>
- 3785777490U, // <6,4,0,4>: Cost 4 vsldoi8 <4,5,6,4>, <0,4,1,5>
- 2250517814U, // <6,4,0,5>: Cost 3 vmrghw <6,0,1,2>, RHS
- 3324259703U, // <6,4,0,6>: Cost 4 vmrghw <6,0,1,2>, <4,6,5,0>
- 3383092458U, // <6,4,0,7>: Cost 5 vmrglw <4,5,6,0>, <1,6,4,7>
- 2712035997U, // <6,4,0,u>: Cost 3 vsldoi8 <4,5,6,4>, LHS
- 3325356946U, // <6,4,1,0>: Cost 4 vmrghw <6,1,7,1>, <4,0,5,1>
- 3785777972U, // <6,4,1,1>: Cost 4 vsldoi8 <4,5,6,4>, <1,1,1,1>
- 3846196170U, // <6,4,1,2>: Cost 4 vsldoi12 <3,4,5,6>, <4,1,2,3>
- 3325365380U, // <6,4,1,3>: Cost 4 vmrghw <6,1,7,2>, <4,3,5,0>
- 3852168155U, // <6,4,1,4>: Cost 4 vsldoi12 <4,4,5,6>, <4,1,4,2>
- 2251615542U, // <6,4,1,5>: Cost 3 vmrghw <6,1,7,1>, RHS
- 3325357432U, // <6,4,1,6>: Cost 4 vmrghw <6,1,7,1>, <4,6,5,1>
- 3870084088U, // <6,4,1,7>: Cost 4 vsldoi12 <7,4,5,6>, <4,1,7,4>
- 2251615785U, // <6,4,1,u>: Cost 3 vmrghw <6,1,7,1>, RHS
- 2252295058U, // <6,4,2,0>: Cost 3 vmrghw <6,2,7,3>, <4,0,5,1>
- 3771180605U, // <6,4,2,1>: Cost 4 vsldoi8 <2,1,6,4>, <2,1,6,4>
- 3785778792U, // <6,4,2,2>: Cost 4 vsldoi8 <4,5,6,4>, <2,2,2,2>
- 3777816253U, // <6,4,2,3>: Cost 4 vsldoi8 <3,2,6,4>, <2,3,2,6>
- 2252295376U, // <6,4,2,4>: Cost 3 vmrghw <6,2,7,3>, <4,4,4,4>
- 1178553654U, // <6,4,2,5>: Cost 2 vmrghw <6,2,7,3>, RHS
- 2252295545U, // <6,4,2,6>: Cost 3 vmrghw <6,2,7,3>, <4,6,5,2>
- 3326037448U, // <6,4,2,7>: Cost 4 vmrghw <6,2,7,3>, <4,7,5,0>
- 1178553897U, // <6,4,2,u>: Cost 2 vmrghw <6,2,7,3>, RHS
- 3785779350U, // <6,4,3,0>: Cost 4 vsldoi8 <4,5,6,4>, <3,0,1,2>
- 3383118648U, // <6,4,3,1>: Cost 4 vmrglw <4,5,6,3>, <3,u,4,1>
- 3777816935U, // <6,4,3,2>: Cost 4 vsldoi8 <3,2,6,4>, <3,2,6,4>
- 3785779612U, // <6,4,3,3>: Cost 4 vsldoi8 <4,5,6,4>, <3,3,3,3>
- 2712037890U, // <6,4,3,4>: Cost 3 vsldoi8 <4,5,6,4>, <3,4,5,6>
- 2252754230U, // <6,4,3,5>: Cost 3 vmrghw <6,3,4,5>, RHS
- 3784452764U, // <6,4,3,6>: Cost 4 vsldoi8 <4,3,6,4>, <3,6,4,7>
- 3801705178U, // <6,4,3,7>: Cost 4 vsldoi8 <7,2,6,4>, <3,7,2,6>
- 2252754473U, // <6,4,3,u>: Cost 3 vmrghw <6,3,4,5>, RHS
- 3787770770U, // <6,4,4,0>: Cost 4 vsldoi8 <4,u,6,4>, <4,0,5,1>
- 3383126840U, // <6,4,4,1>: Cost 4 vmrglw <4,5,6,4>, <3,u,4,1>
- 3327380534U, // <6,4,4,2>: Cost 4 vmrghw <6,4,7,5>, <4,2,5,3>
- 3784453265U, // <6,4,4,3>: Cost 4 vsldoi8 <4,3,6,4>, <4,3,6,4>
- 2253630672U, // <6,4,4,4>: Cost 3 vmrghw <6,4,7,4>, <4,4,4,4>
- 2778426587U, // <6,4,4,5>: Cost 3 vsldoi12 <4,4,5,6>, <4,4,5,6>
- 3383128789U, // <6,4,4,6>: Cost 4 vmrglw <4,5,6,4>, <6,5,4,6>
- 3381799580U, // <6,4,4,7>: Cost 4 vmrglw <4,3,6,4>, <3,6,4,7>
- 2778647798U, // <6,4,4,u>: Cost 3 vsldoi12 <4,4,u,6>, <4,4,u,6>
- 2651422822U, // <6,4,5,0>: Cost 3 vsldoi4 <5,6,4,5>, LHS
- 3701277928U, // <6,4,5,1>: Cost 4 vsldoi4 <1,6,4,5>, <1,6,4,5>
- 3701278650U, // <6,4,5,2>: Cost 4 vsldoi4 <1,6,4,5>, <2,6,3,7>
- 2651425282U, // <6,4,5,3>: Cost 3 vsldoi4 <5,6,4,5>, <3,4,5,6>
- 2651426102U, // <6,4,5,4>: Cost 3 vsldoi4 <5,6,4,5>, RHS
- 2651426892U, // <6,4,5,5>: Cost 3 vsldoi4 <5,6,4,5>, <5,6,4,5>
- 1698712886U, // <6,4,5,6>: Cost 2 vsldoi12 <3,4,5,6>, RHS
- 3725169658U, // <6,4,5,7>: Cost 4 vsldoi4 <5,6,4,5>, <7,0,1,2>
- 1698712904U, // <6,4,5,u>: Cost 2 vsldoi12 <3,4,5,6>, RHS
- 2254900114U, // <6,4,6,0>: Cost 3 vmrghw <6,6,6,6>, <4,0,5,1>
- 3389115192U, // <6,4,6,1>: Cost 4 vmrglw <5,5,6,6>, <3,u,4,1>
- 3785781727U, // <6,4,6,2>: Cost 4 vsldoi8 <4,5,6,4>, <6,2,4,3>
- 3785781810U, // <6,4,6,3>: Cost 4 vsldoi8 <4,5,6,4>, <6,3,4,5>
- 2254900432U, // <6,4,6,4>: Cost 3 vmrghw <6,6,6,6>, <4,4,4,4>
- 1181158710U, // <6,4,6,5>: Cost 2 vmrghw <6,6,6,6>, RHS
- 2254900605U, // <6,4,6,6>: Cost 3 vmrghw <6,6,6,6>, <4,6,5,6>
- 3787772750U, // <6,4,6,7>: Cost 4 vsldoi8 <4,u,6,4>, <6,7,0,1>
- 1181158953U, // <6,4,6,u>: Cost 2 vmrghw <6,6,6,6>, RHS
- 2639495270U, // <6,4,7,0>: Cost 3 vsldoi4 <3,6,4,7>, LHS
- 2639496090U, // <6,4,7,1>: Cost 3 vsldoi4 <3,6,4,7>, <1,2,3,4>
- 3707267011U, // <6,4,7,2>: Cost 4 vsldoi4 <2,6,4,7>, <2,6,4,7>
- 2639497884U, // <6,4,7,3>: Cost 3 vsldoi4 <3,6,4,7>, <3,6,4,7>
- 1237658832U, // <6,4,7,4>: Cost 2 vmrglw RHS, <4,4,4,4>
- 1235666638U, // <6,4,7,5>: Cost 2 vmrglw RHS, <2,3,4,5>
- 3713241753U, // <6,4,7,6>: Cost 4 vsldoi4 <3,6,4,7>, <6,4,7,0>
- 2309409436U, // <6,4,7,7>: Cost 3 vmrglw RHS, <3,6,4,7>
- 1235666641U, // <6,4,7,u>: Cost 2 vmrglw RHS, <2,3,4,u>
- 2639503462U, // <6,4,u,0>: Cost 3 vsldoi4 <3,6,4,u>, LHS
- 2639504282U, // <6,4,u,1>: Cost 3 vsldoi4 <3,6,4,u>, <1,2,3,4>
- 3701303226U, // <6,4,u,2>: Cost 4 vsldoi4 <1,6,4,u>, <2,6,3,7>
- 2639506077U, // <6,4,u,3>: Cost 3 vsldoi4 <3,6,4,u>, <3,6,4,u>
- 1235676368U, // <6,4,u,4>: Cost 2 vmrglw RHS, <4,4,4,4>
- 1235674830U, // <6,4,u,5>: Cost 2 vmrglw RHS, <2,3,4,5>
- 1698713129U, // <6,4,u,6>: Cost 2 vsldoi12 <3,4,5,6>, RHS
- 2309417628U, // <6,4,u,7>: Cost 3 vmrglw RHS, <3,6,4,7>
- 1698713147U, // <6,4,u,u>: Cost 2 vsldoi12 <3,4,5,6>, RHS
- 3775832064U, // <6,5,0,0>: Cost 4 vsldoi8 <2,u,6,5>, <0,0,0,0>
- 2702090342U, // <6,5,0,1>: Cost 3 vsldoi8 <2,u,6,5>, LHS
- 3775832241U, // <6,5,0,2>: Cost 4 vsldoi8 <2,u,6,5>, <0,2,1,6>
- 3719227906U, // <6,5,0,3>: Cost 4 vsldoi4 <4,6,5,0>, <3,4,5,6>
- 3775832402U, // <6,5,0,4>: Cost 4 vsldoi8 <2,u,6,5>, <0,4,1,5>
- 3385085146U, // <6,5,0,5>: Cost 4 vmrglw <4,u,6,0>, <4,4,5,5>
- 2309351938U, // <6,5,0,6>: Cost 3 vmrglw <4,5,6,0>, <3,4,5,6>
- 3376459134U, // <6,5,0,7>: Cost 5 vmrglw <3,4,6,0>, <4,6,5,7>
- 2702090909U, // <6,5,0,u>: Cost 3 vsldoi8 <2,u,6,5>, LHS
- 3719233546U, // <6,5,1,0>: Cost 4 vsldoi4 <4,6,5,1>, <0,0,1,1>
- 3775832884U, // <6,5,1,1>: Cost 4 vsldoi8 <2,u,6,5>, <1,1,1,1>
- 3775832982U, // <6,5,1,2>: Cost 4 vsldoi8 <2,u,6,5>, <1,2,3,0>
- 3846196909U, // <6,5,1,3>: Cost 4 vsldoi12 <3,4,5,6>, <5,1,3,4>
- 3719236984U, // <6,5,1,4>: Cost 4 vsldoi4 <4,6,5,1>, <4,6,5,1>
- 3856150209U, // <6,5,1,5>: Cost 4 vsldoi12 <5,1,5,6>, <5,1,5,6>
- 3834252997U, // <6,5,1,6>: Cost 4 vsldoi12 <1,4,5,6>, <5,1,6,1>
- 3870084817U, // <6,5,1,7>: Cost 4 vsldoi12 <7,4,5,6>, <5,1,7,4>
- 3769861532U, // <6,5,1,u>: Cost 4 vsldoi8 <1,u,6,5>, <1,u,6,5>
- 2645500006U, // <6,5,2,0>: Cost 3 vsldoi4 <4,6,5,2>, LHS
- 3719242548U, // <6,5,2,1>: Cost 4 vsldoi4 <4,6,5,2>, <1,1,1,1>
- 3775833704U, // <6,5,2,2>: Cost 4 vsldoi8 <2,u,6,5>, <2,2,2,2>
- 3775833766U, // <6,5,2,3>: Cost 4 vsldoi8 <2,u,6,5>, <2,3,0,1>
- 2645503353U, // <6,5,2,4>: Cost 3 vsldoi4 <4,6,5,2>, <4,6,5,2>
- 2252296196U, // <6,5,2,5>: Cost 3 vmrghw <6,2,7,3>, <5,5,5,5>
- 2702092218U, // <6,5,2,6>: Cost 3 vsldoi8 <2,u,6,5>, <2,6,3,7>
- 3719246842U, // <6,5,2,7>: Cost 4 vsldoi4 <4,6,5,2>, <7,0,1,2>
- 2702092405U, // <6,5,2,u>: Cost 3 vsldoi8 <2,u,6,5>, <2,u,6,5>
- 3775834262U, // <6,5,3,0>: Cost 4 vsldoi8 <2,u,6,5>, <3,0,1,2>
- 3777161495U, // <6,5,3,1>: Cost 4 vsldoi8 <3,1,6,5>, <3,1,6,5>
- 3775834470U, // <6,5,3,2>: Cost 4 vsldoi8 <2,u,6,5>, <3,2,6,3>
- 3775834524U, // <6,5,3,3>: Cost 4 vsldoi8 <2,u,6,5>, <3,3,3,3>
- 3775834626U, // <6,5,3,4>: Cost 4 vsldoi8 <2,u,6,5>, <3,4,5,6>
- 3385109722U, // <6,5,3,5>: Cost 4 vmrglw <4,u,6,3>, <4,4,5,5>
- 2309376514U, // <6,5,3,6>: Cost 3 vmrglw <4,5,6,3>, <3,4,5,6>
- 3775834819U, // <6,5,3,7>: Cost 4 vsldoi8 <2,u,6,5>, <3,7,0,1>
- 2309376514U, // <6,5,3,u>: Cost 3 vmrglw <4,5,6,3>, <3,4,5,6>
- 3719258214U, // <6,5,4,0>: Cost 4 vsldoi4 <4,6,5,4>, LHS
- 3385117586U, // <6,5,4,1>: Cost 4 vmrglw <4,u,6,4>, <4,0,5,1>
- 3327242008U, // <6,5,4,2>: Cost 4 vmrghw <6,4,5,6>, <5,2,6,3>
- 3719260674U, // <6,5,4,3>: Cost 4 vsldoi4 <4,6,5,4>, <3,4,5,6>
- 3719261563U, // <6,5,4,4>: Cost 4 vsldoi4 <4,6,5,4>, <4,6,5,4>
- 2702093622U, // <6,5,4,5>: Cost 3 vsldoi8 <2,u,6,5>, RHS
- 2309384706U, // <6,5,4,6>: Cost 3 vmrglw <4,5,6,4>, <3,4,5,6>
- 3870085060U, // <6,5,4,7>: Cost 4 vsldoi12 <7,4,5,6>, <5,4,7,4>
- 2702093865U, // <6,5,4,u>: Cost 3 vsldoi8 <2,u,6,5>, RHS
- 3719266406U, // <6,5,5,0>: Cost 4 vsldoi4 <4,6,5,5>, LHS
- 3789106889U, // <6,5,5,1>: Cost 4 vsldoi8 <5,1,6,5>, <5,1,6,5>
- 3785789208U, // <6,5,5,2>: Cost 4 vsldoi8 <4,5,6,5>, <5,2,6,3>
- 3373183950U, // <6,5,5,3>: Cost 4 vmrglw <2,u,6,5>, <6,u,5,3>
- 2717355964U, // <6,5,5,4>: Cost 3 vsldoi8 <5,4,6,5>, <5,4,6,5>
- 2791772164U, // <6,5,5,5>: Cost 3 vsldoi12 <6,6,6,6>, <5,5,5,5>
- 2772455438U, // <6,5,5,6>: Cost 3 vsldoi12 <3,4,5,6>, <5,5,6,6>
- 3373183549U, // <6,5,5,7>: Cost 4 vmrglw <2,u,6,5>, <6,3,5,7>
- 2720010496U, // <6,5,5,u>: Cost 3 vsldoi8 <5,u,6,5>, <5,u,6,5>
- 2772455460U, // <6,5,6,0>: Cost 3 vsldoi12 <3,4,5,6>, <5,6,0,1>
- 2322008978U, // <6,5,6,1>: Cost 3 vmrglw <6,6,6,6>, <4,0,5,1>
- 3840225335U, // <6,5,6,2>: Cost 4 vsldoi12 <2,4,5,6>, <5,6,2,2>
- 2772455490U, // <6,5,6,3>: Cost 3 vsldoi12 <3,4,5,6>, <5,6,3,4>
- 2772455500U, // <6,5,6,4>: Cost 3 vsldoi12 <3,4,5,6>, <5,6,4,5>
- 2254901252U, // <6,5,6,5>: Cost 3 vmrghw <6,6,6,6>, <5,5,5,5>
- 2772455520U, // <6,5,6,6>: Cost 3 vsldoi12 <3,4,5,6>, <5,6,6,7>
- 2785874024U, // <6,5,6,7>: Cost 3 vsldoi12 <5,6,7,6>, <5,6,7,6>
- 2772455532U, // <6,5,6,u>: Cost 3 vsldoi12 <3,4,5,6>, <5,6,u,1>
- 2627625062U, // <6,5,7,0>: Cost 3 vsldoi4 <1,6,5,7>, LHS
- 1235667858U, // <6,5,7,1>: Cost 2 vmrglw RHS, <4,0,5,1>
- 2309409278U, // <6,5,7,2>: Cost 3 vmrglw RHS, <3,4,5,2>
- 2309407659U, // <6,5,7,3>: Cost 3 vmrglw RHS, <1,2,5,3>
- 2627628342U, // <6,5,7,4>: Cost 3 vsldoi4 <1,6,5,7>, RHS
- 1235668186U, // <6,5,7,5>: Cost 2 vmrglw RHS, <4,4,5,5>
- 1235667458U, // <6,5,7,6>: Cost 2 vmrglw RHS, <3,4,5,6>
- 2309407987U, // <6,5,7,7>: Cost 3 vmrglw RHS, <1,6,5,7>
- 1235667460U, // <6,5,7,u>: Cost 2 vmrglw RHS, <3,4,5,u>
- 2627633254U, // <6,5,u,0>: Cost 3 vsldoi4 <1,6,5,u>, LHS
- 1235676050U, // <6,5,u,1>: Cost 2 vmrglw RHS, <4,0,5,1>
- 2309417470U, // <6,5,u,2>: Cost 3 vmrglw RHS, <3,4,5,2>
- 2309415851U, // <6,5,u,3>: Cost 3 vmrglw RHS, <1,2,5,3>
- 2627636534U, // <6,5,u,4>: Cost 3 vsldoi4 <1,6,5,u>, RHS
- 1235676378U, // <6,5,u,5>: Cost 2 vmrglw RHS, <4,4,5,5>
- 1235675650U, // <6,5,u,6>: Cost 2 vmrglw RHS, <3,4,5,6>
- 2309416179U, // <6,5,u,7>: Cost 3 vmrglw RHS, <1,6,5,7>
- 1235675652U, // <6,5,u,u>: Cost 2 vmrglw RHS, <3,4,5,u>
- 2309352751U, // <6,6,0,0>: Cost 3 vmrglw <4,5,6,0>, <4,5,6,0>
- 1650917478U, // <6,6,0,1>: Cost 2 vsldoi8 <6,6,6,6>, LHS
- 2250584570U, // <6,6,0,2>: Cost 3 vmrghw <6,0,2,1>, <6,2,7,3>
- 3846197554U, // <6,6,0,3>: Cost 4 vsldoi12 <3,4,5,6>, <6,0,3,1>
- 2724659538U, // <6,6,0,4>: Cost 3 vsldoi8 <6,6,6,6>, <0,4,1,5>
- 3725275225U, // <6,6,0,5>: Cost 4 vsldoi4 <5,6,6,0>, <5,6,6,0>
- 2791772493U, // <6,6,0,6>: Cost 3 vsldoi12 <6,6,6,6>, <6,0,6,1>
- 2309352758U, // <6,6,0,7>: Cost 3 vmrglw <4,5,6,0>, RHS
- 1650918045U, // <6,6,0,u>: Cost 2 vsldoi8 <6,6,6,6>, LHS
- 3325358368U, // <6,6,1,0>: Cost 4 vmrghw <6,1,7,1>, <6,0,1,1>
- 2299406449U, // <6,6,1,1>: Cost 3 vmrglw <2,u,6,1>, <2,u,6,1>
- 2724660118U, // <6,6,1,2>: Cost 3 vsldoi8 <6,6,6,6>, <1,2,3,0>
- 3373148518U, // <6,6,1,3>: Cost 4 vmrglw <2,u,6,1>, <3,2,6,3>
- 3834253712U, // <6,6,1,4>: Cost 4 vsldoi12 <1,4,5,6>, <6,1,4,5>
- 3373147953U, // <6,6,1,5>: Cost 4 vmrglw <2,u,6,1>, <2,4,6,5>
- 2323297080U, // <6,6,1,6>: Cost 3 vmrglw <6,u,6,1>, <6,6,6,6>
- 2299407670U, // <6,6,1,7>: Cost 3 vmrglw <2,u,6,1>, RHS
- 2299407671U, // <6,6,1,u>: Cost 3 vmrglw <2,u,6,1>, RHS
- 2252296489U, // <6,6,2,0>: Cost 3 vmrghw <6,2,7,3>, <6,0,2,1>
- 3326038394U, // <6,6,2,1>: Cost 4 vmrghw <6,2,7,3>, <6,1,2,1>
- 1178554874U, // <6,6,2,2>: Cost 2 vmrghw <6,2,7,3>, <6,2,7,3>
- 2724660902U, // <6,6,2,3>: Cost 3 vsldoi8 <6,6,6,6>, <2,3,0,1>
- 2252296817U, // <6,6,2,4>: Cost 3 vmrghw <6,2,7,3>, <6,4,2,5>
- 3840741864U, // <6,6,2,5>: Cost 4 vsldoi12 <2,5,3,6>, <6,2,5,3>
- 2252296976U, // <6,6,2,6>: Cost 3 vmrghw <6,2,7,3>, <6,6,2,2>
- 2785874426U, // <6,6,2,7>: Cost 3 vsldoi12 <5,6,7,6>, <6,2,7,3>
- 1178554874U, // <6,6,2,u>: Cost 2 vmrghw <6,2,7,3>, <6,2,7,3>
- 2724661398U, // <6,6,3,0>: Cost 3 vsldoi8 <6,6,6,6>, <3,0,1,2>
- 3375154665U, // <6,6,3,1>: Cost 4 vmrglw <3,2,6,3>, <2,0,6,1>
- 3375154909U, // <6,6,3,2>: Cost 4 vmrglw <3,2,6,3>, <2,3,6,2>
- 2301413734U, // <6,6,3,3>: Cost 3 vmrglw <3,2,6,3>, <3,2,6,3>
- 2772455986U, // <6,6,3,4>: Cost 3 vsldoi12 <3,4,5,6>, <6,3,4,5>
- 3375154993U, // <6,6,3,5>: Cost 4 vmrglw <3,2,6,3>, <2,4,6,5>
- 2323313464U, // <6,6,3,6>: Cost 3 vmrglw <6,u,6,3>, <6,6,6,6>
- 2301414710U, // <6,6,3,7>: Cost 3 vmrglw <3,2,6,3>, RHS
- 2301414711U, // <6,6,3,u>: Cost 3 vmrglw <3,2,6,3>, RHS
- 2724662162U, // <6,6,4,0>: Cost 3 vsldoi8 <6,6,6,6>, <4,0,5,1>
- 3326939559U, // <6,6,4,1>: Cost 4 vmrghw <6,4,1,5>, <6,1,7,1>
- 2253271546U, // <6,6,4,2>: Cost 3 vmrghw <6,4,2,5>, <6,2,7,3>
- 3383127346U, // <6,6,4,3>: Cost 4 vmrglw <4,5,6,4>, <4,5,6,3>
- 2309385523U, // <6,6,4,4>: Cost 3 vmrglw <4,5,6,4>, <4,5,6,4>
- 1650920758U, // <6,6,4,5>: Cost 2 vsldoi8 <6,6,6,6>, RHS
- 2724662653U, // <6,6,4,6>: Cost 3 vsldoi8 <6,6,6,6>, <4,6,5,6>
- 2309385526U, // <6,6,4,7>: Cost 3 vmrglw <4,5,6,4>, RHS
- 1650921001U, // <6,6,4,u>: Cost 2 vsldoi8 <6,6,6,6>, RHS
- 3725312102U, // <6,6,5,0>: Cost 4 vsldoi4 <5,6,6,5>, LHS
- 3373180393U, // <6,6,5,1>: Cost 4 vmrglw <2,u,6,5>, <2,0,6,1>
- 3791769368U, // <6,6,5,2>: Cost 4 vsldoi8 <5,5,6,6>, <5,2,6,3>
- 3373181286U, // <6,6,5,3>: Cost 4 vmrglw <2,u,6,5>, <3,2,6,3>
- 3725315382U, // <6,6,5,4>: Cost 4 vsldoi4 <5,6,6,5>, RHS
- 2299439221U, // <6,6,5,5>: Cost 3 vmrglw <2,u,6,5>, <2,u,6,5>
- 2724663394U, // <6,6,5,6>: Cost 3 vsldoi8 <6,6,6,6>, <5,6,7,0>
- 2299440438U, // <6,6,5,7>: Cost 3 vmrglw <2,u,6,5>, RHS
- 2299440439U, // <6,6,5,u>: Cost 3 vmrglw <2,u,6,5>, RHS
- 1583808614U, // <6,6,6,0>: Cost 2 vsldoi4 <6,6,6,6>, LHS
- 2322010445U, // <6,6,6,1>: Cost 3 vmrglw <6,6,6,6>, <6,0,6,1>
- 2254574074U, // <6,6,6,2>: Cost 3 vmrghw <6,6,2,2>, <6,2,7,3>
- 2322010609U, // <6,6,6,3>: Cost 3 vmrglw <6,6,6,6>, <6,2,6,3>
- 1583811894U, // <6,6,6,4>: Cost 2 vsldoi4 <6,6,6,6>, RHS
- 2322010773U, // <6,6,6,5>: Cost 3 vmrglw <6,6,6,6>, <6,4,6,5>
- 363253046U, // <6,6,6,6>: Cost 1 vspltisw2 RHS
- 1248267574U, // <6,6,6,7>: Cost 2 vmrglw <6,6,6,6>, RHS
- 363253046U, // <6,6,6,u>: Cost 1 vspltisw2 RHS
- 2309410095U, // <6,6,7,0>: Cost 3 vmrglw RHS, <4,5,6,0>
- 2309408233U, // <6,6,7,1>: Cost 3 vmrglw RHS, <2,0,6,1>
- 2311402373U, // <6,6,7,2>: Cost 3 vmrglw RHS, <6,7,6,2>
- 2309409126U, // <6,6,7,3>: Cost 3 vmrglw RHS, <3,2,6,3>
- 2309410099U, // <6,6,7,4>: Cost 3 vmrglw RHS, <4,5,6,4>
- 2309408561U, // <6,6,7,5>: Cost 3 vmrglw RHS, <2,4,6,5>
- 1237660472U, // <6,6,7,6>: Cost 2 vmrglw RHS, <6,6,6,6>
- 161926454U, // <6,6,7,7>: Cost 1 vmrglw RHS, RHS
- 161926455U, // <6,6,7,u>: Cost 1 vmrglw RHS, RHS
- 1583808614U, // <6,6,u,0>: Cost 2 vsldoi4 <6,6,6,6>, LHS
- 1650923310U, // <6,6,u,1>: Cost 2 vsldoi8 <6,6,6,6>, LHS
- 1178554874U, // <6,6,u,2>: Cost 2 vmrghw <6,2,7,3>, <6,2,7,3>
- 2309417318U, // <6,6,u,3>: Cost 3 vmrglw RHS, <3,2,6,3>
- 1583811894U, // <6,6,u,4>: Cost 2 vsldoi4 <6,6,6,6>, RHS
- 1650923674U, // <6,6,u,5>: Cost 2 vsldoi8 <6,6,6,6>, RHS
- 363253046U, // <6,6,u,6>: Cost 1 vspltisw2 RHS
- 161934646U, // <6,6,u,7>: Cost 1 vmrglw RHS, RHS
- 161934647U, // <6,6,u,u>: Cost 1 vmrglw RHS, RHS
- 1638318080U, // <6,7,0,0>: Cost 2 vsldoi8 RHS, <0,0,0,0>
- 564576358U, // <6,7,0,1>: Cost 1 vsldoi8 RHS, LHS
- 2712060077U, // <6,7,0,2>: Cost 3 vsldoi8 RHS, <0,2,1,2>
- 2712060156U, // <6,7,0,3>: Cost 3 vsldoi8 RHS, <0,3,1,0>
- 1638318418U, // <6,7,0,4>: Cost 2 vsldoi8 RHS, <0,4,1,5>
- 1577865314U, // <6,7,0,5>: Cost 2 vsldoi4 <5,6,7,0>, <5,6,7,0>
- 2712060406U, // <6,7,0,6>: Cost 3 vsldoi8 RHS, <0,6,1,7>
- 2651608058U, // <6,7,0,7>: Cost 3 vsldoi4 <5,6,7,0>, <7,0,1,2>
- 564576925U, // <6,7,0,u>: Cost 1 vsldoi8 RHS, LHS
- 2712060643U, // <6,7,1,0>: Cost 3 vsldoi8 RHS, <1,0,1,1>
- 1638318900U, // <6,7,1,1>: Cost 2 vsldoi8 RHS, <1,1,1,1>
- 1638318998U, // <6,7,1,2>: Cost 2 vsldoi8 RHS, <1,2,3,0>
- 3766559753U, // <6,7,1,3>: Cost 4 vsldoi8 <1,3,6,7>, <1,3,6,7>
- 2712060971U, // <6,7,1,4>: Cost 3 vsldoi8 RHS, <1,4,1,5>
- 2712061039U, // <6,7,1,5>: Cost 3 vsldoi8 RHS, <1,5,0,1>
- 2712061135U, // <6,7,1,6>: Cost 3 vsldoi8 RHS, <1,6,1,7>
- 3373148612U, // <6,7,1,7>: Cost 4 vmrglw <2,u,6,1>, <3,3,7,7>
- 1638319484U, // <6,7,1,u>: Cost 2 vsldoi8 RHS, <1,u,3,0>
- 2712061373U, // <6,7,2,0>: Cost 3 vsldoi8 RHS, <2,0,1,2>
- 2712061471U, // <6,7,2,1>: Cost 3 vsldoi8 RHS, <2,1,3,1>
- 1638319720U, // <6,7,2,2>: Cost 2 vsldoi8 RHS, <2,2,2,2>
- 1638319782U, // <6,7,2,3>: Cost 2 vsldoi8 RHS, <2,3,0,1>
- 2712061709U, // <6,7,2,4>: Cost 3 vsldoi8 RHS, <2,4,2,5>
- 2712061800U, // <6,7,2,5>: Cost 3 vsldoi8 RHS, <2,5,3,6>
- 1638320058U, // <6,7,2,6>: Cost 2 vsldoi8 RHS, <2,6,3,7>
- 2252297836U, // <6,7,2,7>: Cost 3 vmrghw <6,2,7,3>, <7,7,7,7>
- 1638320187U, // <6,7,2,u>: Cost 2 vsldoi8 RHS, <2,u,0,1>
- 1638320278U, // <6,7,3,0>: Cost 2 vsldoi8 RHS, <3,0,1,2>
- 2712062182U, // <6,7,3,1>: Cost 3 vsldoi8 RHS, <3,1,1,1>
- 2712062256U, // <6,7,3,2>: Cost 3 vsldoi8 RHS, <3,2,0,3>
- 1638320540U, // <6,7,3,3>: Cost 2 vsldoi8 RHS, <3,3,3,3>
- 1638320642U, // <6,7,3,4>: Cost 2 vsldoi8 RHS, <3,4,5,6>
- 2712062546U, // <6,7,3,5>: Cost 3 vsldoi8 RHS, <3,5,5,5>
- 2712062584U, // <6,7,3,6>: Cost 3 vsldoi8 RHS, <3,6,0,7>
- 2712062659U, // <6,7,3,7>: Cost 3 vsldoi8 RHS, <3,7,0,1>
- 1638320926U, // <6,7,3,u>: Cost 2 vsldoi8 RHS, <3,u,1,2>
- 1638321042U, // <6,7,4,0>: Cost 2 vsldoi8 RHS, <4,0,5,1>
- 2712062922U, // <6,7,4,1>: Cost 3 vsldoi8 RHS, <4,1,2,3>
- 2712063029U, // <6,7,4,2>: Cost 3 vsldoi8 RHS, <4,2,5,2>
- 2712063108U, // <6,7,4,3>: Cost 3 vsldoi8 RHS, <4,3,5,0>
- 1638321360U, // <6,7,4,4>: Cost 2 vsldoi8 RHS, <4,4,4,4>
- 564579638U, // <6,7,4,5>: Cost 1 vsldoi8 RHS, RHS
- 2712063357U, // <6,7,4,6>: Cost 3 vsldoi8 RHS, <4,6,5,6>
- 2712063439U, // <6,7,4,7>: Cost 3 vsldoi8 RHS, <4,7,5,7>
- 564579881U, // <6,7,4,u>: Cost 1 vsldoi8 RHS, RHS
- 2712063560U, // <6,7,5,0>: Cost 3 vsldoi8 RHS, <5,0,1,2>
- 2714054287U, // <6,7,5,1>: Cost 3 vsldoi8 RHS, <5,1,0,1>
- 2712063742U, // <6,7,5,2>: Cost 3 vsldoi8 RHS, <5,2,3,4>
- 3373181295U, // <6,7,5,3>: Cost 4 vmrglw <2,u,6,5>, <3,2,7,3>
- 2712063924U, // <6,7,5,4>: Cost 3 vsldoi8 RHS, <5,4,5,6>
- 1638322180U, // <6,7,5,5>: Cost 2 vsldoi8 RHS, <5,5,5,5>
- 1638322274U, // <6,7,5,6>: Cost 2 vsldoi8 RHS, <5,6,7,0>
- 3373181380U, // <6,7,5,7>: Cost 4 vmrglw <2,u,6,5>, <3,3,7,7>
- 1640313092U, // <6,7,5,u>: Cost 2 vsldoi8 RHS, <5,u,7,0>
- 2712064289U, // <6,7,6,0>: Cost 3 vsldoi8 RHS, <6,0,1,2>
- 2712064423U, // <6,7,6,1>: Cost 3 vsldoi8 RHS, <6,1,7,1>
- 1638322682U, // <6,7,6,2>: Cost 2 vsldoi8 RHS, <6,2,7,3>
- 2712064562U, // <6,7,6,3>: Cost 3 vsldoi8 RHS, <6,3,4,5>
- 2712064653U, // <6,7,6,4>: Cost 3 vsldoi8 RHS, <6,4,5,6>
- 2712064747U, // <6,7,6,5>: Cost 3 vsldoi8 RHS, <6,5,7,1>
- 1638323000U, // <6,7,6,6>: Cost 2 vsldoi8 RHS, <6,6,6,6>
- 1638323022U, // <6,7,6,7>: Cost 2 vsldoi8 RHS, <6,7,0,1>
- 1638323168U, // <6,7,6,u>: Cost 2 vsldoi8 RHS, <6,u,7,3>
- 1237659746U, // <6,7,7,0>: Cost 2 vmrglw RHS, <5,6,7,0>
- 2309411158U, // <6,7,7,1>: Cost 3 vmrglw RHS, <6,0,7,1>
- 2639718330U, // <6,7,7,2>: Cost 3 vsldoi4 <3,6,7,7>, <2,6,3,7>
- 1235669498U, // <6,7,7,3>: Cost 2 vmrglw RHS, <6,2,7,3>
- 1237659750U, // <6,7,7,4>: Cost 2 vmrglw RHS, <5,6,7,4>
- 2309411243U, // <6,7,7,5>: Cost 3 vmrglw RHS, <6,1,7,5>
- 1583895362U, // <6,7,7,6>: Cost 2 vsldoi4 <6,6,7,7>, <6,6,7,7>
- 1235669826U, // <6,7,7,7>: Cost 2 vmrglw RHS, <6,6,7,7>
- 1235669503U, // <6,7,7,u>: Cost 2 vmrglw RHS, <6,2,7,u>
- 1638323923U, // <6,7,u,0>: Cost 2 vsldoi8 RHS, <u,0,1,2>
- 564582190U, // <6,7,u,1>: Cost 1 vsldoi8 RHS, LHS
- 1638324101U, // <6,7,u,2>: Cost 2 vsldoi8 RHS, <u,2,3,0>
- 1638324156U, // <6,7,u,3>: Cost 2 vsldoi8 RHS, <u,3,0,1>
- 1638324287U, // <6,7,u,4>: Cost 2 vsldoi8 RHS, <u,4,5,6>
- 564582554U, // <6,7,u,5>: Cost 1 vsldoi8 RHS, RHS
- 1638324432U, // <6,7,u,6>: Cost 2 vsldoi8 RHS, <u,6,3,7>
- 1235678018U, // <6,7,u,7>: Cost 2 vmrglw RHS, <6,6,7,7>
- 564582757U, // <6,7,u,u>: Cost 1 vsldoi8 RHS, LHS
- 1638326272U, // <6,u,0,0>: Cost 2 vsldoi8 RHS, <0,0,0,0>
- 564584550U, // <6,u,0,1>: Cost 1 vsldoi8 RHS, LHS
- 2712068269U, // <6,u,0,2>: Cost 3 vsldoi8 RHS, <0,2,1,2>
- 2309349532U, // <6,u,0,3>: Cost 3 vmrglw <4,5,6,0>, LHS
- 1638326610U, // <6,u,0,4>: Cost 2 vsldoi8 RHS, <0,4,1,5>
- 1577939051U, // <6,u,0,5>: Cost 2 vsldoi4 <5,6,u,0>, <5,6,u,0>
- 2712068598U, // <6,u,0,6>: Cost 3 vsldoi8 RHS, <0,6,1,7>
- 2309352776U, // <6,u,0,7>: Cost 3 vmrglw <4,5,6,0>, RHS
- 564585117U, // <6,u,0,u>: Cost 1 vsldoi8 RHS, LHS
- 2712068835U, // <6,u,1,0>: Cost 3 vsldoi8 RHS, <1,0,1,1>
- 1638327092U, // <6,u,1,1>: Cost 2 vsldoi8 RHS, <1,1,1,1>
- 1698715438U, // <6,u,1,2>: Cost 2 vsldoi12 <3,4,5,6>, LHS
- 2299404444U, // <6,u,1,3>: Cost 3 vmrglw <2,u,6,1>, LHS
- 2712069163U, // <6,u,1,4>: Cost 3 vsldoi8 RHS, <1,4,1,5>
- 2712069231U, // <6,u,1,5>: Cost 3 vsldoi8 RHS, <1,5,0,1>
- 2712069327U, // <6,u,1,6>: Cost 3 vsldoi8 RHS, <1,6,1,7>
- 2299407688U, // <6,u,1,7>: Cost 3 vmrglw <2,u,6,1>, RHS
- 1698715492U, // <6,u,1,u>: Cost 2 vsldoi12 <3,4,5,6>, LHS
- 2712069565U, // <6,u,2,0>: Cost 3 vsldoi8 RHS, <2,0,1,2>
- 1178556206U, // <6,u,2,1>: Cost 2 vmrghw <6,2,7,3>, LHS
- 1638327912U, // <6,u,2,2>: Cost 2 vsldoi8 RHS, <2,2,2,2>
- 1638327974U, // <6,u,2,3>: Cost 2 vsldoi8 RHS, <2,3,0,1>
- 2712069901U, // <6,u,2,4>: Cost 3 vsldoi8 RHS, <2,4,2,5>
- 1178556570U, // <6,u,2,5>: Cost 2 vmrghw <6,2,7,3>, RHS
- 1638328250U, // <6,u,2,6>: Cost 2 vsldoi8 RHS, <2,6,3,7>
- 2252298496U, // <6,u,2,7>: Cost 3 vmrghw <6,2,7,3>, <u,7,0,1>
- 1638328379U, // <6,u,2,u>: Cost 2 vsldoi8 RHS, <2,u,0,1>
- 1638328470U, // <6,u,3,0>: Cost 2 vsldoi8 RHS, <3,0,1,2>
- 2712070374U, // <6,u,3,1>: Cost 3 vsldoi8 RHS, <3,1,1,1>
- 2704107883U, // <6,u,3,2>: Cost 3 vsldoi8 <3,2,6,u>, <3,2,6,u>
- 1638328732U, // <6,u,3,3>: Cost 2 vsldoi8 RHS, <3,3,3,3>
- 1638328834U, // <6,u,3,4>: Cost 2 vsldoi8 RHS, <3,4,5,6>
- 2712070738U, // <6,u,3,5>: Cost 3 vsldoi8 RHS, <3,5,5,5>
- 2712070776U, // <6,u,3,6>: Cost 3 vsldoi8 RHS, <3,6,0,7>
- 2301414728U, // <6,u,3,7>: Cost 3 vmrglw <3,2,6,3>, RHS
- 1638329118U, // <6,u,3,u>: Cost 2 vsldoi8 RHS, <3,u,1,2>
- 1638329234U, // <6,u,4,0>: Cost 2 vsldoi8 RHS, <4,0,5,1>
- 2712071114U, // <6,u,4,1>: Cost 3 vsldoi8 RHS, <4,1,2,3>
- 2712071221U, // <6,u,4,2>: Cost 3 vsldoi8 RHS, <4,2,5,2>
- 2309382300U, // <6,u,4,3>: Cost 3 vmrglw <4,5,6,4>, LHS
- 1638329552U, // <6,u,4,4>: Cost 2 vsldoi8 RHS, <4,4,4,4>
- 564587831U, // <6,u,4,5>: Cost 1 vsldoi8 RHS, RHS
- 2712071545U, // <6,u,4,6>: Cost 3 vsldoi8 RHS, <4,6,5,2>
- 2309385544U, // <6,u,4,7>: Cost 3 vmrglw <4,5,6,4>, RHS
- 564588073U, // <6,u,4,u>: Cost 1 vsldoi8 RHS, RHS
- 2712071752U, // <6,u,5,0>: Cost 3 vsldoi8 RHS, <5,0,1,2>
- 2714062479U, // <6,u,5,1>: Cost 3 vsldoi8 RHS, <5,1,0,1>
- 2712071934U, // <6,u,5,2>: Cost 3 vsldoi8 RHS, <5,2,3,4>
- 2299437212U, // <6,u,5,3>: Cost 3 vmrglw <2,u,6,5>, LHS
- 2712072116U, // <6,u,5,4>: Cost 3 vsldoi8 RHS, <5,4,5,6>
- 1638330372U, // <6,u,5,5>: Cost 2 vsldoi8 RHS, <5,5,5,5>
- 1698715802U, // <6,u,5,6>: Cost 2 vsldoi12 <3,4,5,6>, RHS
- 2299440456U, // <6,u,5,7>: Cost 3 vmrglw <2,u,6,5>, RHS
- 1698715820U, // <6,u,5,u>: Cost 2 vsldoi12 <3,4,5,6>, RHS
- 1583808614U, // <6,u,6,0>: Cost 2 vsldoi4 <6,6,6,6>, LHS
- 1181161262U, // <6,u,6,1>: Cost 2 vmrghw <6,6,6,6>, LHS
- 1638330874U, // <6,u,6,2>: Cost 2 vsldoi8 RHS, <6,2,7,3>
- 1248264348U, // <6,u,6,3>: Cost 2 vmrglw <6,6,6,6>, LHS
- 1583811894U, // <6,u,6,4>: Cost 2 vsldoi4 <6,6,6,6>, RHS
- 1181161626U, // <6,u,6,5>: Cost 2 vmrghw <6,6,6,6>, RHS
- 363253046U, // <6,u,6,6>: Cost 1 vspltisw2 RHS
- 1638331214U, // <6,u,6,7>: Cost 2 vsldoi8 RHS, <6,7,0,1>
- 363253046U, // <6,u,6,u>: Cost 1 vspltisw2 RHS
- 1560076390U, // <6,u,7,0>: Cost 2 vsldoi4 <2,6,u,7>, LHS
- 1235664969U, // <6,u,7,1>: Cost 2 vmrglw RHS, <0,0,u,1>
- 1560078311U, // <6,u,7,2>: Cost 2 vsldoi4 <2,6,u,7>, <2,6,u,7>
- 161923228U, // <6,u,7,3>: Cost 1 vmrglw RHS, LHS
- 1560079670U, // <6,u,7,4>: Cost 2 vsldoi4 <2,6,u,7>, RHS
- 1235665297U, // <6,u,7,5>: Cost 2 vmrglw RHS, <0,4,u,5>
- 1235667485U, // <6,u,7,6>: Cost 2 vmrglw RHS, <3,4,u,6>
- 161926472U, // <6,u,7,7>: Cost 1 vmrglw RHS, RHS
- 161923233U, // <6,u,7,u>: Cost 1 vmrglw RHS, LHS
- 1560084582U, // <6,u,u,0>: Cost 2 vsldoi4 <2,6,u,u>, LHS
- 564590382U, // <6,u,u,1>: Cost 1 vsldoi8 RHS, LHS
- 1560086504U, // <6,u,u,2>: Cost 2 vsldoi4 <2,6,u,u>, <2,6,u,u>
- 161931420U, // <6,u,u,3>: Cost 1 vmrglw RHS, LHS
- 1560087862U, // <6,u,u,4>: Cost 2 vsldoi4 <2,6,u,u>, RHS
- 564590746U, // <6,u,u,5>: Cost 1 vsldoi8 RHS, RHS
- 363253046U, // <6,u,u,6>: Cost 1 vspltisw2 RHS
- 161934664U, // <6,u,u,7>: Cost 1 vmrglw RHS, RHS
- 161931425U, // <6,u,u,u>: Cost 1 vmrglw RHS, LHS
- 1705426944U, // <7,0,0,0>: Cost 2 vsldoi12 RHS, <0,0,0,0>
- 1705426954U, // <7,0,0,1>: Cost 2 vsldoi12 RHS, <0,0,1,1>
- 3713550266U, // <7,0,0,2>: Cost 4 vsldoi4 <3,7,0,0>, <2,6,3,7>
- 2316063892U, // <7,0,0,3>: Cost 3 vmrglw <5,6,7,0>, <7,2,0,3>
- 2779168805U, // <7,0,0,4>: Cost 3 vsldoi12 RHS, <0,0,4,1>
- 2663698530U, // <7,0,0,5>: Cost 3 vsldoi4 <7,7,0,0>, <5,6,7,0>
- 2657727309U, // <7,0,0,6>: Cost 3 vsldoi4 <6,7,0,0>, <6,7,0,0>
- 2316064220U, // <7,0,0,7>: Cost 3 vmrglw <5,6,7,0>, <7,6,0,7>
- 1705427017U, // <7,0,0,u>: Cost 2 vsldoi12 RHS, <0,0,u,1>
- 1583988838U, // <7,0,1,0>: Cost 2 vsldoi4 <6,7,0,1>, LHS
- 2779168859U, // <7,0,1,1>: Cost 3 vsldoi12 RHS, <0,1,1,1>
- 631685222U, // <7,0,1,2>: Cost 1 vsldoi12 RHS, LHS
- 2639817411U, // <7,0,1,3>: Cost 3 vsldoi4 <3,7,0,1>, <3,7,0,1>
- 1583992118U, // <7,0,1,4>: Cost 2 vsldoi4 <6,7,0,1>, RHS
- 2657734660U, // <7,0,1,5>: Cost 3 vsldoi4 <6,7,0,1>, <5,5,5,5>
- 1583993678U, // <7,0,1,6>: Cost 2 vsldoi4 <6,7,0,1>, <6,7,0,1>
- 2657735672U, // <7,0,1,7>: Cost 3 vsldoi4 <6,7,0,1>, <7,0,1,0>
- 631685276U, // <7,0,1,u>: Cost 1 vsldoi12 RHS, LHS
- 2779168933U, // <7,0,2,0>: Cost 3 vsldoi12 RHS, <0,2,0,3>
- 2767667377U, // <7,0,2,1>: Cost 3 vsldoi12 <2,6,3,7>, <0,2,1,6>
- 2718713448U, // <7,0,2,2>: Cost 3 vsldoi8 <5,6,7,0>, <2,2,2,2>
- 2718713510U, // <7,0,2,3>: Cost 3 vsldoi8 <5,6,7,0>, <2,3,0,1>
- 3841409228U, // <7,0,2,4>: Cost 4 vsldoi12 <2,6,3,7>, <0,2,4,6>
- 3852910802U, // <7,0,2,5>: Cost 4 vsldoi12 RHS, <0,2,5,3>
- 2718713786U, // <7,0,2,6>: Cost 3 vsldoi8 <5,6,7,0>, <2,6,3,7>
- 3847160036U, // <7,0,2,7>: Cost 4 vsldoi12 <3,6,0,7>, <0,2,7,3>
- 2767667440U, // <7,0,2,u>: Cost 3 vsldoi12 <2,6,3,7>, <0,2,u,6>
- 2718714006U, // <7,0,3,0>: Cost 3 vsldoi8 <5,6,7,0>, <3,0,1,2>
- 2779169020U, // <7,0,3,1>: Cost 3 vsldoi12 RHS, <0,3,1,0>
- 3852910853U, // <7,0,3,2>: Cost 4 vsldoi12 RHS, <0,3,2,0>
- 2718714268U, // <7,0,3,3>: Cost 3 vsldoi8 <5,6,7,0>, <3,3,3,3>
- 2718714370U, // <7,0,3,4>: Cost 3 vsldoi8 <5,6,7,0>, <3,4,5,6>
- 2718714461U, // <7,0,3,5>: Cost 3 vsldoi8 <5,6,7,0>, <3,5,6,7>
- 2706770608U, // <7,0,3,6>: Cost 3 vsldoi8 <3,6,7,0>, <3,6,7,0>
- 3847160114U, // <7,0,3,7>: Cost 4 vsldoi12 <3,6,0,7>, <0,3,7,0>
- 2779169083U, // <7,0,3,u>: Cost 3 vsldoi12 RHS, <0,3,u,0>
- 2718714770U, // <7,0,4,0>: Cost 3 vsldoi8 <5,6,7,0>, <4,0,5,1>
- 1705427282U, // <7,0,4,1>: Cost 2 vsldoi12 RHS, <0,4,1,5>
- 3713583034U, // <7,0,4,2>: Cost 4 vsldoi4 <3,7,0,4>, <2,6,3,7>
- 3713583814U, // <7,0,4,3>: Cost 4 vsldoi4 <3,7,0,4>, <3,7,0,4>
- 2779169133U, // <7,0,4,4>: Cost 3 vsldoi12 RHS, <0,4,4,5>
- 1644973366U, // <7,0,4,5>: Cost 2 vsldoi8 <5,6,7,0>, RHS
- 2657760081U, // <7,0,4,6>: Cost 3 vsldoi4 <6,7,0,4>, <6,7,0,4>
- 2259468868U, // <7,0,4,7>: Cost 3 vmrghw <7,4,5,6>, <0,7,1,4>
- 1705427345U, // <7,0,4,u>: Cost 2 vsldoi12 RHS, <0,4,u,5>
- 2718715508U, // <7,0,5,0>: Cost 3 vsldoi8 <5,6,7,0>, <5,0,6,1>
- 2260123750U, // <7,0,5,1>: Cost 3 vmrghw <7,5,5,5>, LHS
- 3792457451U, // <7,0,5,2>: Cost 4 vsldoi8 <5,6,7,0>, <5,2,1,3>
- 3852911024U, // <7,0,5,3>: Cost 4 vsldoi12 RHS, <0,5,3,0>
- 2718715836U, // <7,0,5,4>: Cost 3 vsldoi8 <5,6,7,0>, <5,4,6,5>
- 2718715908U, // <7,0,5,5>: Cost 3 vsldoi8 <5,6,7,0>, <5,5,5,5>
- 1644974178U, // <7,0,5,6>: Cost 2 vsldoi8 <5,6,7,0>, <5,6,7,0>
- 3792457853U, // <7,0,5,7>: Cost 4 vsldoi8 <5,6,7,0>, <5,7,1,0>
- 1646301444U, // <7,0,5,u>: Cost 2 vsldoi8 <5,u,7,0>, <5,u,7,0>
- 2720706901U, // <7,0,6,0>: Cost 3 vsldoi8 <6,0,7,0>, <6,0,7,0>
- 2779169270U, // <7,0,6,1>: Cost 3 vsldoi12 RHS, <0,6,1,7>
- 2718716410U, // <7,0,6,2>: Cost 3 vsldoi8 <5,6,7,0>, <6,2,7,3>
- 2722697800U, // <7,0,6,3>: Cost 3 vsldoi8 <6,3,7,0>, <6,3,7,0>
- 3852911121U, // <7,0,6,4>: Cost 4 vsldoi12 RHS, <0,6,4,7>
- 3852911130U, // <7,0,6,5>: Cost 4 vsldoi12 RHS, <0,6,5,7>
- 2718716728U, // <7,0,6,6>: Cost 3 vsldoi8 <5,6,7,0>, <6,6,6,6>
- 2718716750U, // <7,0,6,7>: Cost 3 vsldoi8 <5,6,7,0>, <6,7,0,1>
- 2779169333U, // <7,0,6,u>: Cost 3 vsldoi12 RHS, <0,6,u,7>
- 2718716922U, // <7,0,7,0>: Cost 3 vsldoi8 <5,6,7,0>, <7,0,1,2>
- 1187872870U, // <7,0,7,1>: Cost 2 vmrghw <7,7,7,7>, LHS
- 2718717076U, // <7,0,7,2>: Cost 3 vsldoi8 <5,6,7,0>, <7,2,0,3>
- 3847160408U, // <7,0,7,3>: Cost 4 vsldoi12 <3,6,0,7>, <0,7,3,6>
- 2718717286U, // <7,0,7,4>: Cost 3 vsldoi8 <5,6,7,0>, <7,4,5,6>
- 2718717377U, // <7,0,7,5>: Cost 3 vsldoi8 <5,6,7,0>, <7,5,6,7>
- 2718717404U, // <7,0,7,6>: Cost 3 vsldoi8 <5,6,7,0>, <7,6,0,7>
- 2718717478U, // <7,0,7,7>: Cost 3 vsldoi8 <5,6,7,0>, <7,7,0,0>
- 1187873437U, // <7,0,7,u>: Cost 2 vmrghw <7,7,7,7>, LHS
- 1584046182U, // <7,0,u,0>: Cost 2 vsldoi4 <6,7,0,u>, LHS
- 1705427602U, // <7,0,u,1>: Cost 2 vsldoi12 RHS, <0,u,1,1>
- 631685789U, // <7,0,u,2>: Cost 1 vsldoi12 RHS, LHS
- 2639874762U, // <7,0,u,3>: Cost 3 vsldoi4 <3,7,0,u>, <3,7,0,u>
- 1584049462U, // <7,0,u,4>: Cost 2 vsldoi4 <6,7,0,u>, RHS
- 1644976282U, // <7,0,u,5>: Cost 2 vsldoi8 <5,6,7,0>, RHS
- 1584051029U, // <7,0,u,6>: Cost 2 vsldoi4 <6,7,0,u>, <6,7,0,u>
- 2718718208U, // <7,0,u,7>: Cost 3 vsldoi8 <5,6,7,0>, <u,7,0,1>
- 631685843U, // <7,0,u,u>: Cost 1 vsldoi12 RHS, LHS
- 2721374218U, // <7,1,0,0>: Cost 3 vsldoi8 <6,1,7,1>, <0,0,1,1>
- 2779169507U, // <7,1,0,1>: Cost 3 vsldoi12 RHS, <1,0,1,1>
- 2779169516U, // <7,1,0,2>: Cost 3 vsldoi12 RHS, <1,0,2,1>
- 3852911348U, // <7,1,0,3>: Cost 4 vsldoi12 RHS, <1,0,3,0>
- 2669743414U, // <7,1,0,4>: Cost 3 vsldoi4 <u,7,1,0>, RHS
- 2316058962U, // <7,1,0,5>: Cost 3 vmrglw <5,6,7,0>, <0,4,1,5>
- 2316059044U, // <7,1,0,6>: Cost 3 vmrglw <5,6,7,0>, <0,5,1,6>
- 2669745146U, // <7,1,0,7>: Cost 3 vsldoi4 <u,7,1,0>, <7,0,1,2>
- 2779169570U, // <7,1,0,u>: Cost 3 vsldoi12 RHS, <1,0,u,1>
- 2779169579U, // <7,1,1,0>: Cost 3 vsldoi12 RHS, <1,1,0,1>
- 1705427764U, // <7,1,1,1>: Cost 2 vsldoi12 RHS, <1,1,1,1>
- 2779169598U, // <7,1,1,2>: Cost 3 vsldoi12 RHS, <1,1,2,2>
- 3713632972U, // <7,1,1,3>: Cost 4 vsldoi4 <3,7,1,1>, <3,7,1,1>
- 2779169619U, // <7,1,1,4>: Cost 3 vsldoi12 RHS, <1,1,4,5>
- 2779169628U, // <7,1,1,5>: Cost 3 vsldoi12 RHS, <1,1,5,5>
- 2657809239U, // <7,1,1,6>: Cost 3 vsldoi4 <6,7,1,1>, <6,7,1,1>
- 3835290474U, // <7,1,1,7>: Cost 4 vsldoi12 <1,6,1,7>, <1,1,7,1>
- 1705427764U, // <7,1,1,u>: Cost 2 vsldoi12 RHS, <1,1,1,1>
- 2779169660U, // <7,1,2,0>: Cost 3 vsldoi12 RHS, <1,2,0,1>
- 2779169671U, // <7,1,2,1>: Cost 3 vsldoi12 RHS, <1,2,1,3>
- 2779169680U, // <7,1,2,2>: Cost 3 vsldoi12 RHS, <1,2,2,3>
- 1705427862U, // <7,1,2,3>: Cost 2 vsldoi12 RHS, <1,2,3,0>
- 2779169700U, // <7,1,2,4>: Cost 3 vsldoi12 RHS, <1,2,4,5>
- 2779169707U, // <7,1,2,5>: Cost 3 vsldoi12 RHS, <1,2,5,3>
- 2657817432U, // <7,1,2,6>: Cost 3 vsldoi4 <6,7,1,2>, <6,7,1,2>
- 2803057594U, // <7,1,2,7>: Cost 3 vsldoi12 RHS, <1,2,7,0>
- 1705427907U, // <7,1,2,u>: Cost 2 vsldoi12 RHS, <1,2,u,0>
- 3776538827U, // <7,1,3,0>: Cost 4 vsldoi8 <3,0,7,1>, <3,0,7,1>
- 2319400970U, // <7,1,3,1>: Cost 3 vmrglw <6,2,7,3>, <0,0,1,1>
- 2316085398U, // <7,1,3,2>: Cost 3 vmrglw <5,6,7,3>, <3,0,1,2>
- 3852911591U, // <7,1,3,3>: Cost 4 vsldoi12 RHS, <1,3,3,0>
- 3852911600U, // <7,1,3,4>: Cost 4 vsldoi12 RHS, <1,3,4,0>
- 2319401298U, // <7,1,3,5>: Cost 3 vmrglw <6,2,7,3>, <0,4,1,5>
- 3833668617U, // <7,1,3,6>: Cost 4 vsldoi12 <1,3,6,7>, <1,3,6,7>
- 3367265487U, // <7,1,3,7>: Cost 4 vmrglw <1,u,7,3>, <1,6,1,7>
- 2319400977U, // <7,1,3,u>: Cost 3 vmrglw <6,2,7,3>, <0,0,1,u>
- 2724031378U, // <7,1,4,0>: Cost 3 vsldoi8 <6,5,7,1>, <4,0,5,1>
- 2779169835U, // <7,1,4,1>: Cost 3 vsldoi12 RHS, <1,4,1,5>
- 2779169844U, // <7,1,4,2>: Cost 3 vsldoi12 RHS, <1,4,2,5>
- 3852911672U, // <7,1,4,3>: Cost 4 vsldoi12 RHS, <1,4,3,0>
- 2669776182U, // <7,1,4,4>: Cost 3 vsldoi4 <u,7,1,4>, RHS
- 2779169872U, // <7,1,4,5>: Cost 3 vsldoi12 RHS, <1,4,5,6>
- 3835290712U, // <7,1,4,6>: Cost 4 vsldoi12 <1,6,1,7>, <1,4,6,5>
- 2669778278U, // <7,1,4,7>: Cost 3 vsldoi4 <u,7,1,4>, <7,4,5,6>
- 2779169898U, // <7,1,4,u>: Cost 3 vsldoi12 RHS, <1,4,u,5>
- 2779169903U, // <7,1,5,0>: Cost 3 vsldoi12 RHS, <1,5,0,1>
- 3835585661U, // <7,1,5,1>: Cost 4 vsldoi12 <1,6,5,7>, <1,5,1,6>
- 3841410182U, // <7,1,5,2>: Cost 4 vsldoi12 <2,6,3,7>, <1,5,2,6>
- 3852911753U, // <7,1,5,3>: Cost 4 vsldoi12 RHS, <1,5,3,0>
- 2779169943U, // <7,1,5,4>: Cost 3 vsldoi12 RHS, <1,5,4,5>
- 2318754130U, // <7,1,5,5>: Cost 3 vmrglw <6,1,7,5>, <0,4,1,5>
- 2718724195U, // <7,1,5,6>: Cost 3 vsldoi8 <5,6,7,1>, <5,6,7,1>
- 3859178670U, // <7,1,5,7>: Cost 4 vsldoi12 <5,6,1,7>, <1,5,7,1>
- 2779169975U, // <7,1,5,u>: Cost 3 vsldoi12 RHS, <1,5,u,1>
- 2720715094U, // <7,1,6,0>: Cost 3 vsldoi8 <6,0,7,1>, <6,0,7,1>
- 2761549007U, // <7,1,6,1>: Cost 3 vsldoi12 <1,6,1,7>, <1,6,1,7>
- 2779170008U, // <7,1,6,2>: Cost 3 vsldoi12 RHS, <1,6,2,7>
- 3835438305U, // <7,1,6,3>: Cost 4 vsldoi12 <1,6,3,7>, <1,6,3,7>
- 3835512042U, // <7,1,6,4>: Cost 4 vsldoi12 <1,6,4,7>, <1,6,4,7>
- 2761843955U, // <7,1,6,5>: Cost 3 vsldoi12 <1,6,5,7>, <1,6,5,7>
- 3835659516U, // <7,1,6,6>: Cost 4 vsldoi12 <1,6,6,7>, <1,6,6,7>
- 2803057918U, // <7,1,6,7>: Cost 3 vsldoi12 RHS, <1,6,7,0>
- 2762065166U, // <7,1,6,u>: Cost 3 vsldoi12 <1,6,u,7>, <1,6,u,7>
- 2669797478U, // <7,1,7,0>: Cost 3 vsldoi4 <u,7,1,7>, LHS
- 2322087946U, // <7,1,7,1>: Cost 3 vmrglw <6,6,7,7>, <0,0,1,1>
- 2317448186U, // <7,1,7,2>: Cost 3 vmrglw <5,u,7,7>, <7,0,1,2>
- 3395829934U, // <7,1,7,3>: Cost 4 vmrglw <6,6,7,7>, <0,2,1,3>
- 2669800758U, // <7,1,7,4>: Cost 3 vsldoi4 <u,7,1,7>, RHS
- 2322088274U, // <7,1,7,5>: Cost 3 vmrglw <6,6,7,7>, <0,4,1,5>
- 3375923377U, // <7,1,7,6>: Cost 4 vmrglw <3,3,7,7>, <0,2,1,6>
- 2731996780U, // <7,1,7,7>: Cost 3 vsldoi8 <7,u,7,1>, <7,7,7,7>
- 2322087953U, // <7,1,7,u>: Cost 3 vmrglw <6,6,7,7>, <0,0,1,u>
- 2779170146U, // <7,1,u,0>: Cost 3 vsldoi12 RHS, <1,u,0,1>
- 1705427764U, // <7,1,u,1>: Cost 2 vsldoi12 RHS, <1,1,1,1>
- 2779170164U, // <7,1,u,2>: Cost 3 vsldoi12 RHS, <1,u,2,1>
- 1705428348U, // <7,1,u,3>: Cost 2 vsldoi12 RHS, <1,u,3,0>
- 2779170186U, // <7,1,u,4>: Cost 3 vsldoi12 RHS, <1,u,4,5>
- 2763171221U, // <7,1,u,5>: Cost 3 vsldoi12 <1,u,5,7>, <1,u,5,7>
- 2657866590U, // <7,1,u,6>: Cost 3 vsldoi4 <6,7,1,u>, <6,7,1,u>
- 2803058080U, // <7,1,u,7>: Cost 3 vsldoi12 RHS, <1,u,7,0>
- 1705428393U, // <7,1,u,u>: Cost 2 vsldoi12 RHS, <1,u,u,0>
- 3713695846U, // <7,2,0,0>: Cost 4 vsldoi4 <3,7,2,0>, LHS
- 2779170237U, // <7,2,0,1>: Cost 3 vsldoi12 RHS, <2,0,1,2>
- 2779170245U, // <7,2,0,2>: Cost 3 vsldoi12 RHS, <2,0,2,1>
- 1242316902U, // <7,2,0,3>: Cost 2 vmrglw <5,6,7,0>, LHS
- 3713699126U, // <7,2,0,4>: Cost 4 vsldoi4 <3,7,2,0>, RHS
- 3852912096U, // <7,2,0,5>: Cost 4 vsldoi12 RHS, <2,0,5,1>
- 2767668713U, // <7,2,0,6>: Cost 3 vsldoi12 <2,6,3,7>, <2,0,6,1>
- 2256488426U, // <7,2,0,7>: Cost 3 vmrghw <7,0,1,2>, <2,7,0,1>
- 1242316907U, // <7,2,0,u>: Cost 2 vmrglw <5,6,7,0>, LHS
- 3852912132U, // <7,2,1,0>: Cost 4 vsldoi12 RHS, <2,1,0,1>
- 3852912141U, // <7,2,1,1>: Cost 4 vsldoi12 RHS, <2,1,1,1>
- 3852912149U, // <7,2,1,2>: Cost 4 vsldoi12 RHS, <2,1,2,0>
- 2779170335U, // <7,2,1,3>: Cost 3 vsldoi12 RHS, <2,1,3,1>
- 3852912172U, // <7,2,1,4>: Cost 4 vsldoi12 RHS, <2,1,4,5>
- 3840747062U, // <7,2,1,5>: Cost 5 vsldoi12 <2,5,3,7>, <2,1,5,6>
- 3841410617U, // <7,2,1,6>: Cost 4 vsldoi12 <2,6,3,7>, <2,1,6,0>
- 3795125538U, // <7,2,1,7>: Cost 4 vsldoi8 <6,1,7,2>, <1,7,2,0>
- 2779170380U, // <7,2,1,u>: Cost 3 vsldoi12 RHS, <2,1,u,1>
- 2779170389U, // <7,2,2,0>: Cost 3 vsldoi12 RHS, <2,2,0,1>
- 3852912222U, // <7,2,2,1>: Cost 4 vsldoi12 RHS, <2,2,1,1>
- 1705428584U, // <7,2,2,2>: Cost 2 vsldoi12 RHS, <2,2,2,2>
- 1705428594U, // <7,2,2,3>: Cost 2 vsldoi12 RHS, <2,2,3,3>
- 2779170429U, // <7,2,2,4>: Cost 3 vsldoi12 RHS, <2,2,4,5>
- 3852912259U, // <7,2,2,5>: Cost 4 vsldoi12 RHS, <2,2,5,2>
- 2767668880U, // <7,2,2,6>: Cost 3 vsldoi12 <2,6,3,7>, <2,2,6,6>
- 3841336981U, // <7,2,2,7>: Cost 4 vsldoi12 <2,6,2,7>, <2,2,7,2>
- 1705428639U, // <7,2,2,u>: Cost 2 vsldoi12 RHS, <2,2,u,3>
- 1705428646U, // <7,2,3,0>: Cost 2 vsldoi12 RHS, <2,3,0,1>
- 2779170479U, // <7,2,3,1>: Cost 3 vsldoi12 RHS, <2,3,1,1>
- 2767668925U, // <7,2,3,2>: Cost 3 vsldoi12 <2,6,3,7>, <2,3,2,6>
- 1245659238U, // <7,2,3,3>: Cost 2 vmrglw <6,2,7,3>, LHS
- 1705428686U, // <7,2,3,4>: Cost 2 vsldoi12 RHS, <2,3,4,5>
- 2779170519U, // <7,2,3,5>: Cost 3 vsldoi12 RHS, <2,3,5,5>
- 2657899362U, // <7,2,3,6>: Cost 3 vsldoi4 <6,7,2,3>, <6,7,2,3>
- 2319406574U, // <7,2,3,7>: Cost 3 vmrglw <6,2,7,3>, <7,6,2,7>
- 1705428718U, // <7,2,3,u>: Cost 2 vsldoi12 RHS, <2,3,u,1>
- 3713728614U, // <7,2,4,0>: Cost 4 vsldoi4 <3,7,2,4>, LHS
- 3852912388U, // <7,2,4,1>: Cost 4 vsldoi12 RHS, <2,4,1,5>
- 2779170573U, // <7,2,4,2>: Cost 3 vsldoi12 RHS, <2,4,2,5>
- 1242349670U, // <7,2,4,3>: Cost 2 vmrglw <5,6,7,4>, LHS
- 3713731894U, // <7,2,4,4>: Cost 4 vsldoi4 <3,7,2,4>, RHS
- 2779170601U, // <7,2,4,5>: Cost 3 vsldoi12 RHS, <2,4,5,6>
- 2767669041U, // <7,2,4,6>: Cost 3 vsldoi12 <2,6,3,7>, <2,4,6,5>
- 3389834456U, // <7,2,4,7>: Cost 4 vmrglw <5,6,7,4>, <1,6,2,7>
- 1242349675U, // <7,2,4,u>: Cost 2 vmrglw <5,6,7,4>, LHS
- 3852912456U, // <7,2,5,0>: Cost 4 vsldoi12 RHS, <2,5,0,1>
- 3852912466U, // <7,2,5,1>: Cost 4 vsldoi12 RHS, <2,5,1,2>
- 3852912475U, // <7,2,5,2>: Cost 4 vsldoi12 RHS, <2,5,2,2>
- 2779170664U, // <7,2,5,3>: Cost 3 vsldoi12 RHS, <2,5,3,6>
- 3852912496U, // <7,2,5,4>: Cost 4 vsldoi12 RHS, <2,5,4,5>
- 3792474116U, // <7,2,5,5>: Cost 4 vsldoi8 <5,6,7,2>, <5,5,5,5>
- 2718732388U, // <7,2,5,6>: Cost 3 vsldoi8 <5,6,7,2>, <5,6,7,2>
- 3841337228U, // <7,2,5,7>: Cost 5 vsldoi12 <2,6,2,7>, <2,5,7,6>
- 2779170709U, // <7,2,5,u>: Cost 3 vsldoi12 RHS, <2,5,u,6>
- 2640003174U, // <7,2,6,0>: Cost 3 vsldoi4 <3,7,2,6>, LHS
- 2721386920U, // <7,2,6,1>: Cost 3 vsldoi8 <6,1,7,2>, <6,1,7,2>
- 2767595441U, // <7,2,6,2>: Cost 3 vsldoi12 <2,6,2,7>, <2,6,2,7>
- 1693927354U, // <7,2,6,3>: Cost 2 vsldoi12 <2,6,3,7>, <2,6,3,7>
- 2640006454U, // <7,2,6,4>: Cost 3 vsldoi4 <3,7,2,6>, RHS
- 3841558476U, // <7,2,6,5>: Cost 4 vsldoi12 <2,6,5,7>, <2,6,5,7>
- 2657923941U, // <7,2,6,6>: Cost 3 vsldoi4 <6,7,2,6>, <6,7,2,6>
- 3841337310U, // <7,2,6,7>: Cost 4 vsldoi12 <2,6,2,7>, <2,6,7,7>
- 1694296039U, // <7,2,6,u>: Cost 2 vsldoi12 <2,6,u,7>, <2,6,u,7>
- 2803058666U, // <7,2,7,0>: Cost 3 vsldoi12 RHS, <2,7,0,1>
- 3852912632U, // <7,2,7,1>: Cost 4 vsldoi12 RHS, <2,7,1,6>
- 2322089576U, // <7,2,7,2>: Cost 3 vmrglw <6,6,7,7>, <2,2,2,2>
- 1248346214U, // <7,2,7,3>: Cost 2 vmrglw <6,6,7,7>, LHS
- 3841337362U, // <7,2,7,4>: Cost 4 vsldoi12 <2,6,2,7>, <2,7,4,5>
- 3395830836U, // <7,2,7,5>: Cost 4 vmrglw <6,6,7,7>, <1,4,2,5>
- 2261616570U, // <7,2,7,6>: Cost 3 vmrghw <7,7,7,7>, <2,6,3,7>
- 3371943857U, // <7,2,7,7>: Cost 4 vmrglw <2,6,7,7>, <2,6,2,7>
- 1248346219U, // <7,2,7,u>: Cost 2 vmrglw <6,6,7,7>, LHS
- 1705429051U, // <7,2,u,0>: Cost 2 vsldoi12 RHS, <2,u,0,1>
- 2779170884U, // <7,2,u,1>: Cost 3 vsldoi12 RHS, <2,u,1,1>
- 1705428584U, // <7,2,u,2>: Cost 2 vsldoi12 RHS, <2,2,2,2>
- 1695254620U, // <7,2,u,3>: Cost 2 vsldoi12 <2,u,3,7>, <2,u,3,7>
- 1705429091U, // <7,2,u,4>: Cost 2 vsldoi12 RHS, <2,u,4,5>
- 2779170924U, // <7,2,u,5>: Cost 3 vsldoi12 RHS, <2,u,5,5>
- 2767669361U, // <7,2,u,6>: Cost 3 vsldoi12 <2,6,3,7>, <2,u,6,1>
- 2803058809U, // <7,2,u,7>: Cost 3 vsldoi12 RHS, <2,u,7,0>
- 1695623305U, // <7,2,u,u>: Cost 2 vsldoi12 <2,u,u,7>, <2,u,u,7>
- 2779170955U, // <7,3,0,0>: Cost 3 vsldoi12 RHS, <3,0,0,0>
- 1705429142U, // <7,3,0,1>: Cost 2 vsldoi12 RHS, <3,0,1,2>
- 2634057732U, // <7,3,0,2>: Cost 3 vsldoi4 <2,7,3,0>, <2,7,3,0>
- 2779170983U, // <7,3,0,3>: Cost 3 vsldoi12 RHS, <3,0,3,1>
- 2779170992U, // <7,3,0,4>: Cost 3 vsldoi12 RHS, <3,0,4,1>
- 3852912829U, // <7,3,0,5>: Cost 4 vsldoi12 RHS, <3,0,5,5>
- 2657948520U, // <7,3,0,6>: Cost 3 vsldoi4 <6,7,3,0>, <6,7,3,0>
- 2316060602U, // <7,3,0,7>: Cost 3 vmrglw <5,6,7,0>, <2,6,3,7>
- 1705429205U, // <7,3,0,u>: Cost 2 vsldoi12 RHS, <3,0,u,2>
- 3852912860U, // <7,3,1,0>: Cost 4 vsldoi12 RHS, <3,1,0,0>
- 2779171046U, // <7,3,1,1>: Cost 3 vsldoi12 RHS, <3,1,1,1>
- 2779171057U, // <7,3,1,2>: Cost 3 vsldoi12 RHS, <3,1,2,3>
- 3852912887U, // <7,3,1,3>: Cost 4 vsldoi12 RHS, <3,1,3,0>
- 3852912896U, // <7,3,1,4>: Cost 4 vsldoi12 RHS, <3,1,4,0>
- 3852912905U, // <7,3,1,5>: Cost 4 vsldoi12 RHS, <3,1,5,0>
- 3835291923U, // <7,3,1,6>: Cost 4 vsldoi12 <1,6,1,7>, <3,1,6,1>
- 3841411356U, // <7,3,1,7>: Cost 4 vsldoi12 <2,6,3,7>, <3,1,7,1>
- 2779171111U, // <7,3,1,u>: Cost 3 vsldoi12 RHS, <3,1,u,3>
- 2779171120U, // <7,3,2,0>: Cost 3 vsldoi12 RHS, <3,2,0,3>
- 3852912952U, // <7,3,2,1>: Cost 4 vsldoi12 RHS, <3,2,1,2>
- 2779171137U, // <7,3,2,2>: Cost 3 vsldoi12 RHS, <3,2,2,2>
- 2779171144U, // <7,3,2,3>: Cost 3 vsldoi12 RHS, <3,2,3,0>
- 2779171156U, // <7,3,2,4>: Cost 3 vsldoi12 RHS, <3,2,4,3>
- 3852912989U, // <7,3,2,5>: Cost 4 vsldoi12 RHS, <3,2,5,3>
- 2767669606U, // <7,3,2,6>: Cost 3 vsldoi12 <2,6,3,7>, <3,2,6,3>
- 2767669615U, // <7,3,2,7>: Cost 3 vsldoi12 <2,6,3,7>, <3,2,7,3>
- 2779171189U, // <7,3,2,u>: Cost 3 vsldoi12 RHS, <3,2,u,0>
- 2779171198U, // <7,3,3,0>: Cost 3 vsldoi12 RHS, <3,3,0,0>
- 3852913032U, // <7,3,3,1>: Cost 4 vsldoi12 RHS, <3,3,1,1>
- 2704140655U, // <7,3,3,2>: Cost 3 vsldoi8 <3,2,7,3>, <3,2,7,3>
- 1705429404U, // <7,3,3,3>: Cost 2 vsldoi12 RHS, <3,3,3,3>
- 2779171238U, // <7,3,3,4>: Cost 3 vsldoi12 RHS, <3,3,4,4>
- 3852913070U, // <7,3,3,5>: Cost 4 vsldoi12 RHS, <3,3,5,3>
- 2657973099U, // <7,3,3,6>: Cost 3 vsldoi4 <6,7,3,3>, <6,7,3,3>
- 2767669700U, // <7,3,3,7>: Cost 3 vsldoi12 <2,6,3,7>, <3,3,7,7>
- 1705429404U, // <7,3,3,u>: Cost 2 vsldoi12 RHS, <3,3,3,3>
- 2779171280U, // <7,3,4,0>: Cost 3 vsldoi12 RHS, <3,4,0,1>
- 2779171290U, // <7,3,4,1>: Cost 3 vsldoi12 RHS, <3,4,1,2>
- 2634090504U, // <7,3,4,2>: Cost 3 vsldoi4 <2,7,3,4>, <2,7,3,4>
- 2779171311U, // <7,3,4,3>: Cost 3 vsldoi12 RHS, <3,4,3,5>
- 2779171319U, // <7,3,4,4>: Cost 3 vsldoi12 RHS, <3,4,4,4>
- 1705429506U, // <7,3,4,5>: Cost 2 vsldoi12 RHS, <3,4,5,6>
- 2722057593U, // <7,3,4,6>: Cost 3 vsldoi8 <6,2,7,3>, <4,6,5,2>
- 2316093370U, // <7,3,4,7>: Cost 3 vmrglw <5,6,7,4>, <2,6,3,7>
- 1705429533U, // <7,3,4,u>: Cost 2 vsldoi12 RHS, <3,4,u,6>
- 3852913185U, // <7,3,5,0>: Cost 4 vsldoi12 RHS, <3,5,0,1>
- 3795799695U, // <7,3,5,1>: Cost 4 vsldoi8 <6,2,7,3>, <5,1,0,1>
- 3852913203U, // <7,3,5,2>: Cost 4 vsldoi12 RHS, <3,5,2,1>
- 3852913214U, // <7,3,5,3>: Cost 4 vsldoi12 RHS, <3,5,3,3>
- 3852913225U, // <7,3,5,4>: Cost 4 vsldoi12 RHS, <3,5,4,5>
- 2779171410U, // <7,3,5,5>: Cost 3 vsldoi12 RHS, <3,5,5,5>
- 2718740581U, // <7,3,5,6>: Cost 3 vsldoi8 <5,6,7,3>, <5,6,7,3>
- 3841411685U, // <7,3,5,7>: Cost 4 vsldoi12 <2,6,3,7>, <3,5,7,6>
- 2720067847U, // <7,3,5,u>: Cost 3 vsldoi8 <5,u,7,3>, <5,u,7,3>
- 2773420664U, // <7,3,6,0>: Cost 3 vsldoi12 <3,6,0,7>, <3,6,0,7>
- 3847236225U, // <7,3,6,1>: Cost 4 vsldoi12 <3,6,1,7>, <3,6,1,7>
- 1648316922U, // <7,3,6,2>: Cost 2 vsldoi8 <6,2,7,3>, <6,2,7,3>
- 2773641875U, // <7,3,6,3>: Cost 3 vsldoi12 <3,6,3,7>, <3,6,3,7>
- 2773715612U, // <7,3,6,4>: Cost 3 vsldoi12 <3,6,4,7>, <3,6,4,7>
- 3847531173U, // <7,3,6,5>: Cost 4 vsldoi12 <3,6,5,7>, <3,6,5,7>
- 2722059024U, // <7,3,6,6>: Cost 3 vsldoi8 <6,2,7,3>, <6,6,2,2>
- 2767669943U, // <7,3,6,7>: Cost 3 vsldoi12 <2,6,3,7>, <3,6,7,7>
- 1652298720U, // <7,3,6,u>: Cost 2 vsldoi8 <6,u,7,3>, <6,u,7,3>
- 2767669955U, // <7,3,7,0>: Cost 3 vsldoi12 <2,6,3,7>, <3,7,0,1>
- 3841411788U, // <7,3,7,1>: Cost 4 vsldoi12 <2,6,3,7>, <3,7,1,1>
- 2767669978U, // <7,3,7,2>: Cost 3 vsldoi12 <2,6,3,7>, <3,7,2,6>
- 2722059546U, // <7,3,7,3>: Cost 3 vsldoi8 <6,2,7,3>, <7,3,6,2>
- 2767669995U, // <7,3,7,4>: Cost 3 vsldoi12 <2,6,3,7>, <3,7,4,5>
- 3852913396U, // <7,3,7,5>: Cost 4 vsldoi12 RHS, <3,7,5,5>
- 2722059758U, // <7,3,7,6>: Cost 3 vsldoi8 <6,2,7,3>, <7,6,2,7>
- 2302183354U, // <7,3,7,7>: Cost 3 vmrglw <3,3,7,7>, <2,6,3,7>
- 2767670027U, // <7,3,7,u>: Cost 3 vsldoi12 <2,6,3,7>, <3,7,u,1>
- 2774747930U, // <7,3,u,0>: Cost 3 vsldoi12 <3,u,0,7>, <3,u,0,7>
- 1705429790U, // <7,3,u,1>: Cost 2 vsldoi12 RHS, <3,u,1,2>
- 1660262316U, // <7,3,u,2>: Cost 2 vsldoi8 <u,2,7,3>, <u,2,7,3>
- 1705429404U, // <7,3,u,3>: Cost 2 vsldoi12 RHS, <3,3,3,3>
- 2775042878U, // <7,3,u,4>: Cost 3 vsldoi12 <3,u,4,7>, <3,u,4,7>
- 1705429830U, // <7,3,u,5>: Cost 2 vsldoi12 RHS, <3,u,5,6>
- 2779171660U, // <7,3,u,6>: Cost 3 vsldoi12 RHS, <3,u,6,3>
- 2767670101U, // <7,3,u,7>: Cost 3 vsldoi12 <2,6,3,7>, <3,u,7,3>
- 1705429853U, // <7,3,u,u>: Cost 2 vsldoi12 RHS, <3,u,u,2>
- 2718744576U, // <7,4,0,0>: Cost 3 vsldoi8 <5,6,7,4>, <0,0,0,0>
- 1645002854U, // <7,4,0,1>: Cost 2 vsldoi8 <5,6,7,4>, LHS
- 3852913527U, // <7,4,0,2>: Cost 4 vsldoi12 RHS, <4,0,2,1>
- 3852913536U, // <7,4,0,3>: Cost 4 vsldoi12 RHS, <4,0,3,1>
- 2316061904U, // <7,4,0,4>: Cost 3 vmrglw <5,6,7,0>, <4,4,4,4>
- 1705429906U, // <7,4,0,5>: Cost 2 vsldoi12 RHS, <4,0,5,1>
- 2658022257U, // <7,4,0,6>: Cost 3 vsldoi4 <6,7,4,0>, <6,7,4,0>
- 2256489928U, // <7,4,0,7>: Cost 3 vmrghw <7,0,1,2>, <4,7,5,0>
- 1707420589U, // <7,4,0,u>: Cost 2 vsldoi12 RHS, <4,0,u,1>
- 3852913590U, // <7,4,1,0>: Cost 4 vsldoi12 RHS, <4,1,0,1>
- 2718745396U, // <7,4,1,1>: Cost 3 vsldoi8 <5,6,7,4>, <1,1,1,1>
- 2779171786U, // <7,4,1,2>: Cost 3 vsldoi12 RHS, <4,1,2,3>
- 3852913616U, // <7,4,1,3>: Cost 4 vsldoi12 RHS, <4,1,3,0>
- 3852913627U, // <7,4,1,4>: Cost 4 vsldoi12 RHS, <4,1,4,2>
- 2779171810U, // <7,4,1,5>: Cost 3 vsldoi12 RHS, <4,1,5,0>
- 3792487631U, // <7,4,1,6>: Cost 4 vsldoi8 <5,6,7,4>, <1,6,1,7>
- 3394456220U, // <7,4,1,7>: Cost 4 vmrglw <6,4,7,1>, <3,6,4,7>
- 2779171837U, // <7,4,1,u>: Cost 3 vsldoi12 RHS, <4,1,u,0>
- 3852913673U, // <7,4,2,0>: Cost 4 vsldoi12 RHS, <4,2,0,3>
- 3852913682U, // <7,4,2,1>: Cost 4 vsldoi12 RHS, <4,2,1,3>
- 2718746216U, // <7,4,2,2>: Cost 3 vsldoi8 <5,6,7,4>, <2,2,2,2>
- 2718746278U, // <7,4,2,3>: Cost 3 vsldoi8 <5,6,7,4>, <2,3,0,1>
- 2779171885U, // <7,4,2,4>: Cost 3 vsldoi12 RHS, <4,2,4,3>
- 2779171893U, // <7,4,2,5>: Cost 3 vsldoi12 RHS, <4,2,5,2>
- 2718746554U, // <7,4,2,6>: Cost 3 vsldoi8 <5,6,7,4>, <2,6,3,7>
- 3847457864U, // <7,4,2,7>: Cost 4 vsldoi12 <3,6,4,7>, <4,2,7,3>
- 2779171921U, // <7,4,2,u>: Cost 3 vsldoi12 RHS, <4,2,u,3>
- 2718746774U, // <7,4,3,0>: Cost 3 vsldoi8 <5,6,7,4>, <3,0,1,2>
- 3852913762U, // <7,4,3,1>: Cost 4 vsldoi12 RHS, <4,3,1,2>
- 3852913772U, // <7,4,3,2>: Cost 4 vsldoi12 RHS, <4,3,2,3>
- 2718747036U, // <7,4,3,3>: Cost 3 vsldoi8 <5,6,7,4>, <3,3,3,3>
- 2718747138U, // <7,4,3,4>: Cost 3 vsldoi8 <5,6,7,4>, <3,4,5,6>
- 2779171972U, // <7,4,3,5>: Cost 3 vsldoi12 RHS, <4,3,5,0>
- 2706803380U, // <7,4,3,6>: Cost 3 vsldoi8 <3,6,7,4>, <3,6,7,4>
- 3847457946U, // <7,4,3,7>: Cost 4 vsldoi12 <3,6,4,7>, <4,3,7,4>
- 2781162655U, // <7,4,3,u>: Cost 3 vsldoi12 RHS, <4,3,u,0>
- 2718747538U, // <7,4,4,0>: Cost 3 vsldoi8 <5,6,7,4>, <4,0,5,1>
- 3852913842U, // <7,4,4,1>: Cost 4 vsldoi12 RHS, <4,4,1,1>
- 3852913852U, // <7,4,4,2>: Cost 4 vsldoi12 RHS, <4,4,2,2>
- 2316096696U, // <7,4,4,3>: Cost 3 vmrglw <5,6,7,4>, <7,2,4,3>
- 1705430224U, // <7,4,4,4>: Cost 2 vsldoi12 RHS, <4,4,4,4>
- 1705430234U, // <7,4,4,5>: Cost 2 vsldoi12 RHS, <4,4,5,5>
- 2658055029U, // <7,4,4,6>: Cost 3 vsldoi4 <6,7,4,4>, <6,7,4,4>
- 2316097024U, // <7,4,4,7>: Cost 3 vmrglw <5,6,7,4>, <7,6,4,7>
- 1707420917U, // <7,4,4,u>: Cost 2 vsldoi12 RHS, <4,4,u,5>
- 1584316518U, // <7,4,5,0>: Cost 2 vsldoi4 <6,7,4,5>, LHS
- 2658059060U, // <7,4,5,1>: Cost 3 vsldoi4 <6,7,4,5>, <1,1,1,1>
- 2640144314U, // <7,4,5,2>: Cost 3 vsldoi4 <3,7,4,5>, <2,6,3,7>
- 2640145131U, // <7,4,5,3>: Cost 3 vsldoi4 <3,7,4,5>, <3,7,4,5>
- 1584319798U, // <7,4,5,4>: Cost 2 vsldoi4 <6,7,4,5>, RHS
- 2779172134U, // <7,4,5,5>: Cost 3 vsldoi12 RHS, <4,5,5,0>
- 631688502U, // <7,4,5,6>: Cost 1 vsldoi12 RHS, RHS
- 2658063354U, // <7,4,5,7>: Cost 3 vsldoi4 <6,7,4,5>, <7,0,1,2>
- 631688520U, // <7,4,5,u>: Cost 1 vsldoi12 RHS, RHS
- 3852914001U, // <7,4,6,0>: Cost 4 vsldoi12 RHS, <4,6,0,7>
- 3852914010U, // <7,4,6,1>: Cost 4 vsldoi12 RHS, <4,6,1,7>
- 2718749178U, // <7,4,6,2>: Cost 3 vsldoi8 <5,6,7,4>, <6,2,7,3>
- 2722730572U, // <7,4,6,3>: Cost 3 vsldoi8 <6,3,7,4>, <6,3,7,4>
- 2723394205U, // <7,4,6,4>: Cost 3 vsldoi8 <6,4,7,4>, <6,4,7,4>
- 2779172221U, // <7,4,6,5>: Cost 3 vsldoi12 RHS, <4,6,5,6>
- 2718749496U, // <7,4,6,6>: Cost 3 vsldoi8 <5,6,7,4>, <6,6,6,6>
- 2718749518U, // <7,4,6,7>: Cost 3 vsldoi8 <5,6,7,4>, <6,7,0,1>
- 2779172249U, // <7,4,6,u>: Cost 3 vsldoi12 RHS, <4,6,u,7>
- 2718749690U, // <7,4,7,0>: Cost 3 vsldoi8 <5,6,7,4>, <7,0,1,2>
- 3847458214U, // <7,4,7,1>: Cost 4 vsldoi12 <3,6,4,7>, <4,7,1,2>
- 2718749880U, // <7,4,7,2>: Cost 3 vsldoi8 <5,6,7,4>, <7,2,4,3>
- 3847458236U, // <7,4,7,3>: Cost 4 vsldoi12 <3,6,4,7>, <4,7,3,6>
- 2718750004U, // <7,4,7,4>: Cost 3 vsldoi8 <5,6,7,4>, <7,4,0,1>
- 1187876150U, // <7,4,7,5>: Cost 2 vmrghw <7,7,7,7>, RHS
- 2718750208U, // <7,4,7,6>: Cost 3 vsldoi8 <5,6,7,4>, <7,6,4,7>
- 2718750286U, // <7,4,7,7>: Cost 3 vsldoi8 <5,6,7,4>, <7,7,4,4>
- 1187876393U, // <7,4,7,u>: Cost 2 vmrghw <7,7,7,7>, RHS
- 1584341094U, // <7,4,u,0>: Cost 2 vsldoi4 <6,7,4,u>, LHS
- 1645008686U, // <7,4,u,1>: Cost 2 vsldoi8 <5,6,7,4>, LHS
- 2640168890U, // <7,4,u,2>: Cost 3 vsldoi4 <3,7,4,u>, <2,6,3,7>
- 2640169710U, // <7,4,u,3>: Cost 3 vsldoi4 <3,7,4,u>, <3,7,4,u>
- 1584344374U, // <7,4,u,4>: Cost 2 vsldoi4 <6,7,4,u>, RHS
- 1705430554U, // <7,4,u,5>: Cost 2 vsldoi12 RHS, <4,u,5,1>
- 631688745U, // <7,4,u,6>: Cost 1 vsldoi12 RHS, RHS
- 2718750976U, // <7,4,u,7>: Cost 3 vsldoi8 <5,6,7,4>, <u,7,0,1>
- 631688763U, // <7,4,u,u>: Cost 1 vsldoi12 RHS, RHS
- 2646147174U, // <7,5,0,0>: Cost 3 vsldoi4 <4,7,5,0>, LHS
- 2779172424U, // <7,5,0,1>: Cost 3 vsldoi12 RHS, <5,0,1,2>
- 3852914258U, // <7,5,0,2>: Cost 4 vsldoi12 RHS, <5,0,2,3>
- 3852914268U, // <7,5,0,3>: Cost 4 vsldoi12 RHS, <5,0,3,4>
- 2779172450U, // <7,5,0,4>: Cost 3 vsldoi12 RHS, <5,0,4,1>
- 2316061914U, // <7,5,0,5>: Cost 3 vmrglw <5,6,7,0>, <4,4,5,5>
- 2316061186U, // <7,5,0,6>: Cost 3 vmrglw <5,6,7,0>, <3,4,5,6>
- 2646152186U, // <7,5,0,7>: Cost 3 vsldoi4 <4,7,5,0>, <7,0,1,2>
- 2779172486U, // <7,5,0,u>: Cost 3 vsldoi12 RHS, <5,0,u,1>
- 2781163151U, // <7,5,1,0>: Cost 3 vsldoi12 RHS, <5,1,0,1>
- 2321378194U, // <7,5,1,1>: Cost 3 vmrglw <6,5,7,1>, <4,0,5,1>
- 3852914339U, // <7,5,1,2>: Cost 4 vsldoi12 RHS, <5,1,2,3>
- 3852914350U, // <7,5,1,3>: Cost 4 vsldoi12 RHS, <5,1,3,5>
- 2781163191U, // <7,5,1,4>: Cost 3 vsldoi12 RHS, <5,1,4,5>
- 3852914363U, // <7,5,1,5>: Cost 4 vsldoi12 RHS, <5,1,5,0>
- 3835588297U, // <7,5,1,6>: Cost 4 vsldoi12 <1,6,5,7>, <5,1,6,5>
- 3835588306U, // <7,5,1,7>: Cost 4 vsldoi12 <1,6,5,7>, <5,1,7,5>
- 2781163223U, // <7,5,1,u>: Cost 3 vsldoi12 RHS, <5,1,u,1>
- 3852914400U, // <7,5,2,0>: Cost 4 vsldoi12 RHS, <5,2,0,1>
- 2781163243U, // <7,5,2,1>: Cost 3 vsldoi12 RHS, <5,2,1,3>
- 3852914419U, // <7,5,2,2>: Cost 4 vsldoi12 RHS, <5,2,2,2>
- 2779172606U, // <7,5,2,3>: Cost 3 vsldoi12 RHS, <5,2,3,4>
- 3780552497U, // <7,5,2,4>: Cost 4 vsldoi8 <3,6,7,5>, <2,4,6,5>
- 2781163279U, // <7,5,2,5>: Cost 3 vsldoi12 RHS, <5,2,5,3>
- 2779172632U, // <7,5,2,6>: Cost 3 vsldoi12 RHS, <5,2,6,3>
- 3835588385U, // <7,5,2,7>: Cost 4 vsldoi12 <1,6,5,7>, <5,2,7,3>
- 2779172650U, // <7,5,2,u>: Cost 3 vsldoi12 RHS, <5,2,u,3>
- 3852914481U, // <7,5,3,0>: Cost 4 vsldoi12 RHS, <5,3,0,1>
- 2319403922U, // <7,5,3,1>: Cost 3 vmrglw <6,2,7,3>, <4,0,5,1>
- 2319404409U, // <7,5,3,2>: Cost 3 vmrglw <6,2,7,3>, <4,6,5,2>
- 3852914510U, // <7,5,3,3>: Cost 4 vsldoi12 RHS, <5,3,3,3>
- 3779226131U, // <7,5,3,4>: Cost 4 vsldoi8 <3,4,7,5>, <3,4,7,5>
- 2319404250U, // <7,5,3,5>: Cost 3 vmrglw <6,2,7,3>, <4,4,5,5>
- 2319403522U, // <7,5,3,6>: Cost 3 vmrglw <6,2,7,3>, <3,4,5,6>
- 3852914547U, // <7,5,3,7>: Cost 4 vsldoi12 RHS, <5,3,7,4>
- 2319403524U, // <7,5,3,u>: Cost 3 vmrglw <6,2,7,3>, <3,4,5,u>
- 2646179942U, // <7,5,4,0>: Cost 3 vsldoi4 <4,7,5,4>, LHS
- 2316094354U, // <7,5,4,1>: Cost 3 vmrglw <5,6,7,4>, <4,0,5,1>
- 3852914582U, // <7,5,4,2>: Cost 4 vsldoi12 RHS, <5,4,2,3>
- 3852914592U, // <7,5,4,3>: Cost 4 vsldoi12 RHS, <5,4,3,4>
- 2646183372U, // <7,5,4,4>: Cost 3 vsldoi4 <4,7,5,4>, <4,7,5,4>
- 2779172788U, // <7,5,4,5>: Cost 3 vsldoi12 RHS, <5,4,5,6>
- 2316093954U, // <7,5,4,6>: Cost 3 vmrglw <5,6,7,4>, <3,4,5,6>
- 2646185318U, // <7,5,4,7>: Cost 3 vsldoi4 <4,7,5,4>, <7,4,5,6>
- 2779172815U, // <7,5,4,u>: Cost 3 vsldoi12 RHS, <5,4,u,6>
- 2781163475U, // <7,5,5,0>: Cost 3 vsldoi12 RHS, <5,5,0,1>
- 2781163484U, // <7,5,5,1>: Cost 3 vsldoi12 RHS, <5,5,1,1>
- 3852914662U, // <7,5,5,2>: Cost 4 vsldoi12 RHS, <5,5,2,2>
- 3852914672U, // <7,5,5,3>: Cost 4 vsldoi12 RHS, <5,5,3,3>
- 2781163515U, // <7,5,5,4>: Cost 3 vsldoi12 RHS, <5,5,4,5>
- 1705431044U, // <7,5,5,5>: Cost 2 vsldoi12 RHS, <5,5,5,5>
- 2779172878U, // <7,5,5,6>: Cost 3 vsldoi12 RHS, <5,5,6,6>
- 3835588632U, // <7,5,5,7>: Cost 4 vsldoi12 <1,6,5,7>, <5,5,7,7>
- 1705431044U, // <7,5,5,u>: Cost 2 vsldoi12 RHS, <5,5,5,5>
- 2779172900U, // <7,5,6,0>: Cost 3 vsldoi12 RHS, <5,6,0,1>
- 2781163571U, // <7,5,6,1>: Cost 3 vsldoi12 RHS, <5,6,1,7>
- 3852914743U, // <7,5,6,2>: Cost 4 vsldoi12 RHS, <5,6,2,2>
- 2779172930U, // <7,5,6,3>: Cost 3 vsldoi12 RHS, <5,6,3,4>
- 2779172940U, // <7,5,6,4>: Cost 3 vsldoi12 RHS, <5,6,4,5>
- 2781163607U, // <7,5,6,5>: Cost 3 vsldoi12 RHS, <5,6,5,7>
- 2779172960U, // <7,5,6,6>: Cost 3 vsldoi12 RHS, <5,6,6,7>
- 1705431138U, // <7,5,6,7>: Cost 2 vsldoi12 RHS, <5,6,7,0>
- 1705578603U, // <7,5,6,u>: Cost 2 vsldoi12 RHS, <5,6,u,0>
- 2646204518U, // <7,5,7,0>: Cost 3 vsldoi4 <4,7,5,7>, LHS
- 2322090898U, // <7,5,7,1>: Cost 3 vmrglw <6,6,7,7>, <4,0,5,1>
- 3719947880U, // <7,5,7,2>: Cost 4 vsldoi4 <4,7,5,7>, <2,2,2,2>
- 3719948438U, // <7,5,7,3>: Cost 4 vsldoi4 <4,7,5,7>, <3,0,1,2>
- 2646207951U, // <7,5,7,4>: Cost 3 vsldoi4 <4,7,5,7>, <4,7,5,7>
- 2322091226U, // <7,5,7,5>: Cost 3 vmrglw <6,6,7,7>, <4,4,5,5>
- 2322090498U, // <7,5,7,6>: Cost 3 vmrglw <6,6,7,7>, <3,4,5,6>
- 2646210156U, // <7,5,7,7>: Cost 3 vsldoi4 <4,7,5,7>, <7,7,7,7>
- 2646210350U, // <7,5,7,u>: Cost 3 vsldoi4 <4,7,5,7>, LHS
- 2779173062U, // <7,5,u,0>: Cost 3 vsldoi12 RHS, <5,u,0,1>
- 2779173072U, // <7,5,u,1>: Cost 3 vsldoi12 RHS, <5,u,1,2>
- 2319404409U, // <7,5,u,2>: Cost 3 vmrglw <6,2,7,3>, <4,6,5,2>
- 2779173092U, // <7,5,u,3>: Cost 3 vsldoi12 RHS, <5,u,3,4>
- 2779173101U, // <7,5,u,4>: Cost 3 vsldoi12 RHS, <5,u,4,4>
- 1705431044U, // <7,5,u,5>: Cost 2 vsldoi12 RHS, <5,5,5,5>
- 2779173118U, // <7,5,u,6>: Cost 3 vsldoi12 RHS, <5,u,6,3>
- 1705578756U, // <7,5,u,7>: Cost 2 vsldoi12 RHS, <5,u,7,0>
- 1707421965U, // <7,5,u,u>: Cost 2 vsldoi12 RHS, <5,u,u,0>
- 3852914966U, // <7,6,0,0>: Cost 4 vsldoi12 RHS, <6,0,0,0>
- 2779173153U, // <7,6,0,1>: Cost 3 vsldoi12 RHS, <6,0,1,2>
- 2256491002U, // <7,6,0,2>: Cost 3 vmrghw <7,0,1,2>, <6,2,7,3>
- 3852914994U, // <7,6,0,3>: Cost 4 vsldoi12 RHS, <6,0,3,1>
- 3852915003U, // <7,6,0,4>: Cost 4 vsldoi12 RHS, <6,0,4,1>
- 2316062652U, // <7,6,0,5>: Cost 3 vmrglw <5,6,7,0>, <5,4,6,5>
- 2316063544U, // <7,6,0,6>: Cost 3 vmrglw <5,6,7,0>, <6,6,6,6>
- 1242320182U, // <7,6,0,7>: Cost 2 vmrglw <5,6,7,0>, RHS
- 1242320183U, // <7,6,0,u>: Cost 2 vmrglw <5,6,7,0>, RHS
- 3852915048U, // <7,6,1,0>: Cost 4 vsldoi12 RHS, <6,1,0,1>
- 3377866217U, // <7,6,1,1>: Cost 4 vmrglw <3,6,7,1>, <2,0,6,1>
- 3852915068U, // <7,6,1,2>: Cost 4 vsldoi12 RHS, <6,1,2,3>
- 3833672072U, // <7,6,1,3>: Cost 5 vsldoi12 <1,3,6,7>, <6,1,3,6>
- 3852915088U, // <7,6,1,4>: Cost 4 vsldoi12 RHS, <6,1,4,5>
- 3395122056U, // <7,6,1,5>: Cost 4 vmrglw <6,5,7,1>, <6,7,6,5>
- 3389813560U, // <7,6,1,6>: Cost 4 vmrglw <5,6,7,1>, <6,6,6,6>
- 2779173287U, // <7,6,1,7>: Cost 3 vsldoi12 RHS, <6,1,7,1>
- 2779320752U, // <7,6,1,u>: Cost 3 vsldoi12 RHS, <6,1,u,1>
- 2658181222U, // <7,6,2,0>: Cost 3 vsldoi4 <6,7,6,2>, LHS
- 3852915140U, // <7,6,2,1>: Cost 4 vsldoi12 RHS, <6,2,1,3>
- 2257973754U, // <7,6,2,2>: Cost 3 vmrghw <7,2,3,3>, <6,2,7,3>
- 3841413589U, // <7,6,2,3>: Cost 4 vsldoi12 <2,6,3,7>, <6,2,3,2>
- 2658184502U, // <7,6,2,4>: Cost 3 vsldoi4 <6,7,6,2>, RHS
- 3852915176U, // <7,6,2,5>: Cost 4 vsldoi12 RHS, <6,2,5,3>
- 2658186117U, // <7,6,2,6>: Cost 3 vsldoi4 <6,7,6,2>, <6,7,6,2>
- 1705431546U, // <7,6,2,7>: Cost 2 vsldoi12 RHS, <6,2,7,3>
- 1705579011U, // <7,6,2,u>: Cost 2 vsldoi12 RHS, <6,2,u,3>
- 3714015334U, // <7,6,3,0>: Cost 4 vsldoi4 <3,7,6,3>, LHS
- 3777243425U, // <7,6,3,1>: Cost 4 vsldoi8 <3,1,7,6>, <3,1,7,6>
- 2319405957U, // <7,6,3,2>: Cost 3 vmrglw <6,2,7,3>, <6,7,6,2>
- 3375229286U, // <7,6,3,3>: Cost 4 vmrglw <3,2,7,3>, <3,2,6,3>
- 2779173426U, // <7,6,3,4>: Cost 3 vsldoi12 RHS, <6,3,4,5>
- 3375228721U, // <7,6,3,5>: Cost 4 vmrglw <3,2,7,3>, <2,4,6,5>
- 2319405880U, // <7,6,3,6>: Cost 3 vmrglw <6,2,7,3>, <6,6,6,6>
- 1245662518U, // <7,6,3,7>: Cost 2 vmrglw <6,2,7,3>, RHS
- 1245662519U, // <7,6,3,u>: Cost 2 vmrglw <6,2,7,3>, RHS
- 3852915291U, // <7,6,4,0>: Cost 4 vsldoi12 RHS, <6,4,0,1>
- 3389834729U, // <7,6,4,1>: Cost 4 vmrglw <5,6,7,4>, <2,0,6,1>
- 2259472890U, // <7,6,4,2>: Cost 3 vmrghw <7,4,5,6>, <6,2,7,3>
- 3852915321U, // <7,6,4,3>: Cost 4 vsldoi12 RHS, <6,4,3,4>
- 3852915330U, // <7,6,4,4>: Cost 4 vsldoi12 RHS, <6,4,4,4>
- 2779173517U, // <7,6,4,5>: Cost 3 vsldoi12 RHS, <6,4,5,6>
- 2316096312U, // <7,6,4,6>: Cost 3 vmrglw <5,6,7,4>, <6,6,6,6>
- 1242352950U, // <7,6,4,7>: Cost 2 vmrglw <5,6,7,4>, RHS
- 1242352951U, // <7,6,4,u>: Cost 2 vmrglw <5,6,7,4>, RHS
- 3852915372U, // <7,6,5,0>: Cost 4 vsldoi12 RHS, <6,5,0,1>
- 3835294392U, // <7,6,5,1>: Cost 5 vsldoi12 <1,6,1,7>, <6,5,1,4>
- 3852915395U, // <7,6,5,2>: Cost 4 vsldoi12 RHS, <6,5,2,6>
- 3852915404U, // <7,6,5,3>: Cost 4 vsldoi12 RHS, <6,5,3,6>
- 3852915412U, // <7,6,5,4>: Cost 4 vsldoi12 RHS, <6,5,4,5>
- 3377899313U, // <7,6,5,5>: Cost 4 vmrglw <3,6,7,5>, <2,4,6,5>
- 2718765160U, // <7,6,5,6>: Cost 3 vsldoi8 <5,6,7,6>, <5,6,7,6>
- 2779173611U, // <7,6,5,7>: Cost 3 vsldoi12 RHS, <6,5,7,1>
- 2779321076U, // <7,6,5,u>: Cost 3 vsldoi12 RHS, <6,5,u,1>
- 2658213990U, // <7,6,6,0>: Cost 3 vsldoi4 <6,7,6,6>, LHS
- 3852915462U, // <7,6,6,1>: Cost 4 vsldoi12 RHS, <6,6,1,1>
- 2718765562U, // <7,6,6,2>: Cost 3 vsldoi8 <5,6,7,6>, <6,2,7,3>
- 3714042622U, // <7,6,6,3>: Cost 4 vsldoi4 <3,7,6,6>, <3,7,6,6>
- 2658217270U, // <7,6,6,4>: Cost 3 vsldoi4 <6,7,6,6>, RHS
- 2724074224U, // <7,6,6,5>: Cost 3 vsldoi8 <6,5,7,6>, <6,5,7,6>
- 1705431864U, // <7,6,6,6>: Cost 2 vsldoi12 RHS, <6,6,6,6>
- 1705431874U, // <7,6,6,7>: Cost 2 vsldoi12 RHS, <6,6,7,7>
- 1705579339U, // <7,6,6,u>: Cost 2 vsldoi12 RHS, <6,6,u,7>
- 1705431886U, // <7,6,7,0>: Cost 2 vsldoi12 RHS, <6,7,0,1>
- 2779173719U, // <7,6,7,1>: Cost 3 vsldoi12 RHS, <6,7,1,1>
- 2779173729U, // <7,6,7,2>: Cost 3 vsldoi12 RHS, <6,7,2,2>
- 2779173736U, // <7,6,7,3>: Cost 3 vsldoi12 RHS, <6,7,3,0>
- 1705431926U, // <7,6,7,4>: Cost 2 vsldoi12 RHS, <6,7,4,5>
- 2779173759U, // <7,6,7,5>: Cost 3 vsldoi12 RHS, <6,7,5,5>
- 2779173765U, // <7,6,7,6>: Cost 3 vsldoi12 RHS, <6,7,6,2>
- 1248349494U, // <7,6,7,7>: Cost 2 vmrglw <6,6,7,7>, RHS
- 1705431958U, // <7,6,7,u>: Cost 2 vsldoi12 RHS, <6,7,u,1>
- 1705579423U, // <7,6,u,0>: Cost 2 vsldoi12 RHS, <6,u,0,1>
- 2779173801U, // <7,6,u,1>: Cost 3 vsldoi12 RHS, <6,u,1,2>
- 2779321266U, // <7,6,u,2>: Cost 3 vsldoi12 RHS, <6,u,2,2>
- 2779321273U, // <7,6,u,3>: Cost 3 vsldoi12 RHS, <6,u,3,0>
- 1705579463U, // <7,6,u,4>: Cost 2 vsldoi12 RHS, <6,u,4,5>
- 2779173841U, // <7,6,u,5>: Cost 3 vsldoi12 RHS, <6,u,5,6>
- 1705431864U, // <7,6,u,6>: Cost 2 vsldoi12 RHS, <6,6,6,6>
- 1705432032U, // <7,6,u,7>: Cost 2 vsldoi12 RHS, <6,u,7,3>
- 1705579495U, // <7,6,u,u>: Cost 2 vsldoi12 RHS, <6,u,u,1>
- 1242320994U, // <7,7,0,0>: Cost 2 vmrglw <5,6,7,0>, <5,6,7,0>
- 1705432058U, // <7,7,0,1>: Cost 2 vsldoi12 RHS, <7,0,1,2>
- 3841414146U, // <7,7,0,2>: Cost 4 vsldoi12 <2,6,3,7>, <7,0,2,1>
- 2316063226U, // <7,7,0,3>: Cost 3 vmrglw <5,6,7,0>, <6,2,7,3>
- 2779173908U, // <7,7,0,4>: Cost 3 vsldoi12 RHS, <7,0,4,1>
- 2658242658U, // <7,7,0,5>: Cost 3 vsldoi4 <6,7,7,0>, <5,6,7,0>
- 2658243468U, // <7,7,0,6>: Cost 3 vsldoi4 <6,7,7,0>, <6,7,7,0>
- 2316063554U, // <7,7,0,7>: Cost 3 vmrglw <5,6,7,0>, <6,6,7,7>
- 1705432121U, // <7,7,0,u>: Cost 2 vsldoi12 RHS, <7,0,u,2>
- 3852915777U, // <7,7,1,0>: Cost 4 vsldoi12 RHS, <7,1,0,1>
- 2779173962U, // <7,7,1,1>: Cost 3 vsldoi12 RHS, <7,1,1,1>
- 2779173973U, // <7,7,1,2>: Cost 3 vsldoi12 RHS, <7,1,2,3>
- 3389813242U, // <7,7,1,3>: Cost 4 vmrglw <5,6,7,1>, <6,2,7,3>
- 3852915813U, // <7,7,1,4>: Cost 4 vsldoi12 RHS, <7,1,4,1>
- 3852915821U, // <7,7,1,5>: Cost 4 vsldoi12 RHS, <7,1,5,0>
- 3835294839U, // <7,7,1,6>: Cost 4 vsldoi12 <1,6,1,7>, <7,1,6,1>
- 2329343596U, // <7,7,1,7>: Cost 3 vmrglw <7,u,7,1>, <7,7,7,7>
- 2779174027U, // <7,7,1,u>: Cost 3 vsldoi12 RHS, <7,1,u,3>
- 2803061908U, // <7,7,2,0>: Cost 3 vsldoi12 RHS, <7,2,0,3>
- 3852915869U, // <7,7,2,1>: Cost 4 vsldoi12 RHS, <7,2,1,3>
- 2779174053U, // <7,7,2,2>: Cost 3 vsldoi12 RHS, <7,2,2,2>
- 2779174060U, // <7,7,2,3>: Cost 3 vsldoi12 RHS, <7,2,3,0>
- 2803061944U, // <7,7,2,4>: Cost 3 vsldoi12 RHS, <7,2,4,3>
- 3852915905U, // <7,7,2,5>: Cost 4 vsldoi12 RHS, <7,2,5,3>
- 2767672522U, // <7,7,2,6>: Cost 3 vsldoi12 <2,6,3,7>, <7,2,6,3>
- 2791855315U, // <7,7,2,7>: Cost 3 vsldoi12 <6,6,7,7>, <7,2,7,3>
- 2768999644U, // <7,7,2,u>: Cost 3 vsldoi12 <2,u,3,7>, <7,2,u,3>
- 2779174115U, // <7,7,3,0>: Cost 3 vsldoi12 RHS, <7,3,0,1>
- 3852915948U, // <7,7,3,1>: Cost 4 vsldoi12 RHS, <7,3,1,1>
- 3841414394U, // <7,7,3,2>: Cost 4 vsldoi12 <2,6,3,7>, <7,3,2,6>
- 1245663738U, // <7,7,3,3>: Cost 2 vmrglw <6,2,7,3>, <6,2,7,3>
- 2779174155U, // <7,7,3,4>: Cost 3 vsldoi12 RHS, <7,3,4,5>
- 3852915988U, // <7,7,3,5>: Cost 4 vsldoi12 RHS, <7,3,5,5>
- 2706827959U, // <7,7,3,6>: Cost 3 vsldoi8 <3,6,7,7>, <3,6,7,7>
- 2319405890U, // <7,7,3,7>: Cost 3 vmrglw <6,2,7,3>, <6,6,7,7>
- 1245663738U, // <7,7,3,u>: Cost 2 vmrglw <6,2,7,3>, <6,2,7,3>
- 2779174200U, // <7,7,4,0>: Cost 3 vsldoi12 RHS, <7,4,0,5>
- 3852916030U, // <7,7,4,1>: Cost 4 vsldoi12 RHS, <7,4,1,2>
- 3714099130U, // <7,7,4,2>: Cost 4 vsldoi4 <3,7,7,4>, <2,6,3,7>
- 2316095994U, // <7,7,4,3>: Cost 3 vmrglw <5,6,7,4>, <6,2,7,3>
- 1242353766U, // <7,7,4,4>: Cost 2 vmrglw <5,6,7,4>, <5,6,7,4>
- 1705432422U, // <7,7,4,5>: Cost 2 vsldoi12 RHS, <7,4,5,6>
- 2658276240U, // <7,7,4,6>: Cost 3 vsldoi4 <6,7,7,4>, <6,7,7,4>
- 2316096322U, // <7,7,4,7>: Cost 3 vmrglw <5,6,7,4>, <6,6,7,7>
- 1705432449U, // <7,7,4,u>: Cost 2 vsldoi12 RHS, <7,4,u,6>
- 3852916101U, // <7,7,5,0>: Cost 4 vsldoi12 RHS, <7,5,0,1>
- 3854906765U, // <7,7,5,1>: Cost 4 vsldoi12 RHS, <7,5,1,0>
- 3852916121U, // <7,7,5,2>: Cost 4 vsldoi12 RHS, <7,5,2,3>
- 3389846010U, // <7,7,5,3>: Cost 4 vmrglw <5,6,7,5>, <6,2,7,3>
- 3852916141U, // <7,7,5,4>: Cost 4 vsldoi12 RHS, <7,5,4,5>
- 2779174326U, // <7,7,5,5>: Cost 3 vsldoi12 RHS, <7,5,5,5>
- 2779174337U, // <7,7,5,6>: Cost 3 vsldoi12 RHS, <7,5,6,7>
- 2329376364U, // <7,7,5,7>: Cost 3 vmrglw <7,u,7,5>, <7,7,7,7>
- 2779321811U, // <7,7,5,u>: Cost 3 vsldoi12 RHS, <7,5,u,7>
- 2658287718U, // <7,7,6,0>: Cost 3 vsldoi4 <6,7,7,6>, LHS
- 3852916197U, // <7,7,6,1>: Cost 4 vsldoi12 RHS, <7,6,1,7>
- 2779174382U, // <7,7,6,2>: Cost 3 vsldoi12 RHS, <7,6,2,7>
- 2316112378U, // <7,7,6,3>: Cost 3 vmrglw <5,6,7,6>, <6,2,7,3>
- 2658290998U, // <7,7,6,4>: Cost 3 vsldoi4 <6,7,7,6>, RHS
- 3852916233U, // <7,7,6,5>: Cost 4 vsldoi12 RHS, <7,6,5,7>
- 1651004226U, // <7,7,6,6>: Cost 2 vsldoi8 <6,6,7,7>, <6,6,7,7>
- 2779174420U, // <7,7,6,7>: Cost 3 vsldoi12 RHS, <7,6,7,0>
- 1652331492U, // <7,7,6,u>: Cost 2 vsldoi8 <6,u,7,7>, <6,u,7,7>
- 1590526054U, // <7,7,7,0>: Cost 2 vsldoi4 <7,7,7,7>, LHS
- 2328728623U, // <7,7,7,1>: Cost 3 vmrglw <7,7,7,7>, <7,0,7,1>
- 2724746451U, // <7,7,7,2>: Cost 3 vsldoi8 <6,6,7,7>, <7,2,7,3>
- 2322092538U, // <7,7,7,3>: Cost 3 vmrglw <6,6,7,7>, <6,2,7,3>
- 1590529334U, // <7,7,7,4>: Cost 2 vsldoi4 <7,7,7,7>, RHS
- 2328728951U, // <7,7,7,5>: Cost 3 vmrglw <7,7,7,7>, <7,4,7,5>
- 2724746770U, // <7,7,7,6>: Cost 3 vsldoi8 <6,6,7,7>, <7,6,6,7>
- 430361910U, // <7,7,7,7>: Cost 1 vspltisw3 RHS
- 430361910U, // <7,7,7,u>: Cost 1 vspltisw3 RHS
- 1242320994U, // <7,7,u,0>: Cost 2 vmrglw <5,6,7,0>, <5,6,7,0>
- 1705580162U, // <7,7,u,1>: Cost 2 vsldoi12 RHS, <7,u,1,2>
- 2779321996U, // <7,7,u,2>: Cost 3 vsldoi12 RHS, <7,u,2,3>
- 1245663738U, // <7,7,u,3>: Cost 2 vmrglw <6,2,7,3>, <6,2,7,3>
- 1242353766U, // <7,7,u,4>: Cost 2 vmrglw <5,6,7,4>, <5,6,7,4>
- 1705580202U, // <7,7,u,5>: Cost 2 vsldoi12 RHS, <7,u,5,6>
- 1662949620U, // <7,7,u,6>: Cost 2 vsldoi8 <u,6,7,7>, <u,6,7,7>
- 430361910U, // <7,7,u,7>: Cost 1 vspltisw3 RHS
- 430361910U, // <7,7,u,u>: Cost 1 vspltisw3 RHS
- 1705426944U, // <7,u,0,0>: Cost 2 vsldoi12 RHS, <0,0,0,0>
- 1705432787U, // <7,u,0,1>: Cost 2 vsldoi12 RHS, <u,0,1,2>
- 2316060885U, // <7,u,0,2>: Cost 3 vmrglw <5,6,7,0>, <3,0,u,2>
- 1242316956U, // <7,u,0,3>: Cost 2 vmrglw <5,6,7,0>, LHS
- 2779174637U, // <7,u,0,4>: Cost 3 vsldoi12 RHS, <u,0,4,1>
- 1182750874U, // <7,u,0,5>: Cost 2 vmrghw <7,0,1,2>, RHS
- 2316061213U, // <7,u,0,6>: Cost 3 vmrglw <5,6,7,0>, <3,4,u,6>
- 1242320200U, // <7,u,0,7>: Cost 2 vmrglw <5,6,7,0>, RHS
- 1705432850U, // <7,u,0,u>: Cost 2 vsldoi12 RHS, <u,0,u,2>
- 1584578662U, // <7,u,1,0>: Cost 2 vsldoi4 <6,7,u,1>, LHS
- 1705427764U, // <7,u,1,1>: Cost 2 vsldoi12 RHS, <1,1,1,1>
- 631691054U, // <7,u,1,2>: Cost 1 vsldoi12 RHS, LHS
- 2640407307U, // <7,u,1,3>: Cost 3 vsldoi4 <3,7,u,1>, <3,7,u,1>
- 1584581942U, // <7,u,1,4>: Cost 2 vsldoi4 <6,7,u,1>, RHS
- 2779174726U, // <7,u,1,5>: Cost 3 vsldoi12 RHS, <u,1,5,0>
- 1584583574U, // <7,u,1,6>: Cost 2 vsldoi4 <6,7,u,1>, <6,7,u,1>
- 2779322201U, // <7,u,1,7>: Cost 3 vsldoi12 RHS, <u,1,7,1>
- 631691108U, // <7,u,1,u>: Cost 1 vsldoi12 RHS, LHS
- 2779174763U, // <7,u,2,0>: Cost 3 vsldoi12 RHS, <u,2,0,1>
- 2779174774U, // <7,u,2,1>: Cost 3 vsldoi12 RHS, <u,2,1,3>
- 1705428584U, // <7,u,2,2>: Cost 2 vsldoi12 RHS, <2,2,2,2>
- 1705432965U, // <7,u,2,3>: Cost 2 vsldoi12 RHS, <u,2,3,0>
- 2779174801U, // <7,u,2,4>: Cost 3 vsldoi12 RHS, <u,2,4,3>
- 2779174810U, // <7,u,2,5>: Cost 3 vsldoi12 RHS, <u,2,5,3>
- 2767673251U, // <7,u,2,6>: Cost 3 vsldoi12 <2,6,3,7>, <u,2,6,3>
- 1705580460U, // <7,u,2,7>: Cost 2 vsldoi12 RHS, <u,2,7,3>
- 1705433010U, // <7,u,2,u>: Cost 2 vsldoi12 RHS, <u,2,u,0>
- 1705433020U, // <7,u,3,0>: Cost 2 vsldoi12 RHS, <u,3,0,1>
- 2779174853U, // <7,u,3,1>: Cost 3 vsldoi12 RHS, <u,3,1,1>
- 2767673299U, // <7,u,3,2>: Cost 3 vsldoi12 <2,6,3,7>, <u,3,2,6>
- 1245659292U, // <7,u,3,3>: Cost 2 vmrglw <6,2,7,3>, LHS
- 1705433060U, // <7,u,3,4>: Cost 2 vsldoi12 RHS, <u,3,4,5>
- 2779174893U, // <7,u,3,5>: Cost 3 vsldoi12 RHS, <u,3,5,5>
- 2706836152U, // <7,u,3,6>: Cost 3 vsldoi8 <3,6,7,u>, <3,6,7,u>
- 1245662536U, // <7,u,3,7>: Cost 2 vmrglw <6,2,7,3>, RHS
- 1705433092U, // <7,u,3,u>: Cost 2 vsldoi12 RHS, <u,3,u,1>
- 2779174925U, // <7,u,4,0>: Cost 3 vsldoi12 RHS, <u,4,0,1>
- 1185732398U, // <7,u,4,1>: Cost 2 vmrghw <7,4,5,6>, LHS
- 2316093653U, // <7,u,4,2>: Cost 3 vmrglw <5,6,7,4>, <3,0,u,2>
- 1242349724U, // <7,u,4,3>: Cost 2 vmrglw <5,6,7,4>, LHS
- 1705430224U, // <7,u,4,4>: Cost 2 vsldoi12 RHS, <4,4,4,4>
- 1705433151U, // <7,u,4,5>: Cost 2 vsldoi12 RHS, <u,4,5,6>
- 2316093981U, // <7,u,4,6>: Cost 3 vmrglw <5,6,7,4>, <3,4,u,6>
- 1242352968U, // <7,u,4,7>: Cost 2 vmrglw <5,6,7,4>, RHS
- 1705433178U, // <7,u,4,u>: Cost 2 vsldoi12 RHS, <u,4,u,6>
- 1584611430U, // <7,u,5,0>: Cost 2 vsldoi4 <6,7,u,5>, LHS
- 2781165670U, // <7,u,5,1>: Cost 3 vsldoi12 RHS, <u,5,1,0>
- 2640439226U, // <7,u,5,2>: Cost 3 vsldoi4 <3,7,u,5>, <2,6,3,7>
- 2640440079U, // <7,u,5,3>: Cost 3 vsldoi4 <3,7,u,5>, <3,7,u,5>
- 1584614710U, // <7,u,5,4>: Cost 2 vsldoi4 <6,7,u,5>, RHS
- 1705431044U, // <7,u,5,5>: Cost 2 vsldoi12 RHS, <5,5,5,5>
- 631691418U, // <7,u,5,6>: Cost 1 vsldoi12 RHS, RHS
- 2779322525U, // <7,u,5,7>: Cost 3 vsldoi12 RHS, <u,5,7,1>
- 631691436U, // <7,u,5,u>: Cost 1 vsldoi12 RHS, RHS
- 2779175087U, // <7,u,6,0>: Cost 3 vsldoi12 RHS, <u,6,0,1>
- 2779175102U, // <7,u,6,1>: Cost 3 vsldoi12 RHS, <u,6,1,7>
- 1648357887U, // <7,u,6,2>: Cost 2 vsldoi8 <6,2,7,u>, <6,2,7,u>
- 1705433296U, // <7,u,6,3>: Cost 2 vsldoi12 RHS, <u,6,3,7>
- 2779175127U, // <7,u,6,4>: Cost 3 vsldoi12 RHS, <u,6,4,5>
- 2779175138U, // <7,u,6,5>: Cost 3 vsldoi12 RHS, <u,6,5,7>
- 1651012419U, // <7,u,6,6>: Cost 2 vsldoi8 <6,6,7,u>, <6,6,7,u>
- 1705580788U, // <7,u,6,7>: Cost 2 vsldoi12 RHS, <u,6,7,7>
- 1705433341U, // <7,u,6,u>: Cost 2 vsldoi12 RHS, <u,6,u,7>
- 1705580800U, // <7,u,7,0>: Cost 2 vsldoi12 RHS, <u,7,0,1>
- 1187878702U, // <7,u,7,1>: Cost 2 vmrghw <7,7,7,7>, LHS
- 2768042263U, // <7,u,7,2>: Cost 3 vsldoi12 <2,6,u,7>, <u,7,2,6>
- 1248346268U, // <7,u,7,3>: Cost 2 vmrglw <6,6,7,7>, LHS
- 1705580840U, // <7,u,7,4>: Cost 2 vsldoi12 RHS, <u,7,4,5>
- 1187879066U, // <7,u,7,5>: Cost 2 vmrghw <7,7,7,7>, RHS
- 2779322679U, // <7,u,7,6>: Cost 3 vsldoi12 RHS, <u,7,6,2>
- 430361910U, // <7,u,7,7>: Cost 1 vspltisw3 RHS
- 430361910U, // <7,u,7,u>: Cost 1 vspltisw3 RHS
- 1705433425U, // <7,u,u,0>: Cost 2 vsldoi12 RHS, <u,u,0,1>
- 1705433435U, // <7,u,u,1>: Cost 2 vsldoi12 RHS, <u,u,1,2>
- 631691621U, // <7,u,u,2>: Cost 1 vsldoi12 RHS, LHS
- 1705433451U, // <7,u,u,3>: Cost 2 vsldoi12 RHS, <u,u,3,0>
- 1705433465U, // <7,u,u,4>: Cost 2 vsldoi12 RHS, <u,u,4,5>
- 1705433475U, // <7,u,u,5>: Cost 2 vsldoi12 RHS, <u,u,5,6>
- 631691661U, // <7,u,u,6>: Cost 1 vsldoi12 RHS, RHS
- 430361910U, // <7,u,u,7>: Cost 1 vspltisw3 RHS
- 631691675U, // <7,u,u,u>: Cost 1 vsldoi12 RHS, LHS
- 202162278U, // <u,0,0,0>: Cost 1 vspltisw0 LHS
- 1678598154U, // <u,0,0,1>: Cost 2 vsldoi12 LHS, <0,0,1,1>
- 2634500154U, // <u,0,0,2>: Cost 3 vsldoi4 <2,u,0,0>, <2,u,0,0>
- 2289596269U, // <u,0,0,3>: Cost 3 vmrglw <1,2,u,0>, <u,2,0,3>
- 1548815670U, // <u,0,0,4>: Cost 2 vsldoi4 <0,u,0,0>, RHS
- 2663698530U, // <u,0,0,5>: Cost 3 vsldoi4 <7,7,0,0>, <5,6,7,0>
- 2658390942U, // <u,0,0,6>: Cost 3 vsldoi4 <6,u,0,0>, <6,u,0,0>
- 2289596597U, // <u,0,0,7>: Cost 3 vmrglw <1,2,u,0>, <u,6,0,7>
- 202162278U, // <u,0,0,u>: Cost 1 vspltisw0 LHS
- 1560764518U, // <u,0,1,0>: Cost 2 vsldoi4 <2,u,0,1>, LHS
- 115720294U, // <u,0,1,1>: Cost 1 vmrghw LHS, LHS
- 604856427U, // <u,0,1,2>: Cost 1 vsldoi12 LHS, LHS
- 2634508438U, // <u,0,1,3>: Cost 3 vsldoi4 <2,u,0,1>, <3,0,1,2>
- 1560767798U, // <u,0,1,4>: Cost 2 vsldoi4 <2,u,0,1>, RHS
- 2652426438U, // <u,0,1,5>: Cost 3 vsldoi4 <5,u,0,1>, <5,u,0,1>
- 1584657311U, // <u,0,1,6>: Cost 2 vsldoi4 <6,u,0,1>, <6,u,0,1>
- 2658399226U, // <u,0,1,7>: Cost 3 vsldoi4 <6,u,0,1>, <7,0,1,2>
- 604856476U, // <u,0,1,u>: Cost 1 vsldoi12 LHS, LHS
- 2696889850U, // <u,0,2,0>: Cost 3 vsldoi8 <2,0,u,0>, <2,0,u,0>
- 1190174822U, // <u,0,2,1>: Cost 2 vmrghw <u,2,3,0>, LHS
- 2692245096U, // <u,0,2,2>: Cost 3 vsldoi8 <1,2,u,0>, <2,2,2,2>
- 2692245158U, // <u,0,2,3>: Cost 3 vsldoi8 <1,2,u,0>, <2,3,0,1>
- 2263916882U, // <u,0,2,4>: Cost 3 vmrghw <u,2,3,0>, <0,4,1,5>
- 2299709908U, // <u,0,2,5>: Cost 3 vmrglw <3,0,1,2>, <3,4,0,5>
- 2692245434U, // <u,0,2,6>: Cost 3 vsldoi8 <1,2,u,0>, <2,6,3,7>
- 2701535281U, // <u,0,2,7>: Cost 3 vsldoi8 <2,7,u,0>, <2,7,u,0>
- 1190175389U, // <u,0,2,u>: Cost 2 vmrghw <u,2,3,0>, LHS
- 1209237504U, // <u,0,3,0>: Cost 2 vmrglw LHS, <0,0,0,0>
- 1209239206U, // <u,0,3,1>: Cost 2 vmrglw LHS, <2,3,0,1>
- 2704189813U, // <u,0,3,2>: Cost 3 vsldoi8 <3,2,u,0>, <3,2,u,0>
- 2692245916U, // <u,0,3,3>: Cost 3 vsldoi8 <1,2,u,0>, <3,3,3,3>
- 2282981033U, // <u,0,3,4>: Cost 3 vmrglw LHS, <2,3,0,4>
- 2664386658U, // <u,0,3,5>: Cost 3 vsldoi4 <7,u,0,3>, <5,6,7,0>
- 2691877496U, // <u,0,3,6>: Cost 3 vsldoi8 <1,2,3,0>, <3,6,0,7>
- 2664388218U, // <u,0,3,7>: Cost 3 vsldoi4 <7,u,0,3>, <7,u,0,3>
- 1209239213U, // <u,0,3,u>: Cost 2 vmrglw LHS, <2,3,0,u>
- 2289623040U, // <u,0,4,0>: Cost 3 vmrglw <1,2,u,4>, <0,0,0,0>
- 1678598482U, // <u,0,4,1>: Cost 2 vsldoi12 LHS, <0,4,1,5>
- 2634532926U, // <u,0,4,2>: Cost 3 vsldoi4 <2,u,0,4>, <2,u,0,4>
- 2235580672U, // <u,0,4,3>: Cost 3 vmrghw <3,4,5,6>, <0,3,1,4>
- 1143619922U, // <u,0,4,4>: Cost 2 vmrghw <0,4,1,5>, <0,4,1,5>
- 1618505014U, // <u,0,4,5>: Cost 2 vsldoi8 <1,2,u,0>, RHS
- 2658423714U, // <u,0,4,6>: Cost 3 vsldoi4 <6,u,0,4>, <6,u,0,4>
- 2713259464U, // <u,0,4,7>: Cost 3 vsldoi8 <4,7,5,0>, <4,7,5,0>
- 1683243409U, // <u,0,4,u>: Cost 2 vsldoi12 LHS, <0,4,u,5>
- 1192443904U, // <u,0,5,0>: Cost 2 vmrghw RHS, <0,0,0,0>
- 118702182U, // <u,0,5,1>: Cost 1 vmrghw RHS, LHS
- 2266185901U, // <u,0,5,2>: Cost 3 vmrghw RHS, <0,2,1,2>
- 2640513816U, // <u,0,5,3>: Cost 3 vsldoi4 <3,u,0,5>, <3,u,0,5>
- 1192444242U, // <u,0,5,4>: Cost 2 vmrghw RHS, <0,4,1,5>
- 2718789636U, // <u,0,5,5>: Cost 3 vsldoi8 <5,6,u,0>, <5,5,5,5>
- 1645047915U, // <u,0,5,6>: Cost 2 vsldoi8 <5,6,u,0>, <5,6,u,0>
- 2664404604U, // <u,0,5,7>: Cost 3 vsldoi4 <7,u,0,5>, <7,u,0,5>
- 118702749U, // <u,0,5,u>: Cost 1 vmrghw RHS, LHS
- 2302910464U, // <u,0,6,0>: Cost 3 vmrglw <3,4,u,6>, <0,0,0,0>
- 1192886374U, // <u,0,6,1>: Cost 2 vmrghw <u,6,3,7>, LHS
- 2718790138U, // <u,0,6,2>: Cost 3 vsldoi8 <5,6,u,0>, <6,2,7,3>
- 2722771537U, // <u,0,6,3>: Cost 3 vsldoi8 <6,3,u,0>, <6,3,u,0>
- 2266628434U, // <u,0,6,4>: Cost 3 vmrghw <u,6,3,7>, <0,4,1,5>
- 2248950180U, // <u,0,6,5>: Cost 3 vmrghw <5,6,7,0>, <0,5,1,6>
- 2718790456U, // <u,0,6,6>: Cost 3 vsldoi8 <5,6,u,0>, <6,6,6,6>
- 2718790478U, // <u,0,6,7>: Cost 3 vsldoi8 <5,6,u,0>, <6,7,0,1>
- 1192886941U, // <u,0,6,u>: Cost 2 vmrghw <u,6,3,7>, LHS
- 1235812352U, // <u,0,7,0>: Cost 2 vmrglw RHS, <0,0,0,0>
- 1235814054U, // <u,0,7,1>: Cost 2 vmrglw RHS, <2,3,0,1>
- 2728080601U, // <u,0,7,2>: Cost 3 vsldoi8 <7,2,u,0>, <7,2,u,0>
- 2640530202U, // <u,0,7,3>: Cost 3 vsldoi4 <3,u,0,7>, <3,u,0,7>
- 2640530742U, // <u,0,7,4>: Cost 3 vsldoi4 <3,u,0,7>, RHS
- 2309556692U, // <u,0,7,5>: Cost 3 vmrglw RHS, <3,4,0,5>
- 2730735133U, // <u,0,7,6>: Cost 3 vsldoi8 <7,6,u,0>, <7,6,u,0>
- 2309556856U, // <u,0,7,7>: Cost 3 vmrglw RHS, <3,6,0,7>
- 1235814061U, // <u,0,7,u>: Cost 2 vmrglw RHS, <2,3,0,u>
- 202162278U, // <u,0,u,0>: Cost 1 vspltisw0 LHS
- 120365158U, // <u,0,u,1>: Cost 1 vmrghw LHS, LHS
- 604856989U, // <u,0,u,2>: Cost 1 vsldoi12 LHS, LHS
- 2692249532U, // <u,0,u,3>: Cost 3 vsldoi8 <1,2,u,0>, <u,3,0,1>
- 1560825142U, // <u,0,u,4>: Cost 2 vsldoi4 <2,u,0,u>, RHS
- 1618507930U, // <u,0,u,5>: Cost 2 vsldoi8 <1,2,u,0>, RHS
- 1584714662U, // <u,0,u,6>: Cost 2 vsldoi4 <6,u,0,u>, <6,u,0,u>
- 2309565048U, // <u,0,u,7>: Cost 3 vmrglw RHS, <3,6,0,7>
- 604857043U, // <u,0,u,u>: Cost 1 vsldoi12 LHS, LHS
- 1611210825U, // <u,1,0,0>: Cost 2 vsldoi8 <0,0,u,1>, <0,0,u,1>
- 1616519270U, // <u,1,0,1>: Cost 2 vsldoi8 <0,u,u,1>, LHS
- 2287605459U, // <u,1,0,2>: Cost 3 vmrglw <0,u,u,0>, <u,0,1,2>
- 2640546588U, // <u,1,0,3>: Cost 3 vsldoi4 <3,u,1,0>, <3,u,1,0>
- 2622631222U, // <u,1,0,4>: Cost 3 vsldoi4 <0,u,1,0>, RHS
- 2289590610U, // <u,1,0,5>: Cost 3 vmrglw <1,2,u,0>, <0,4,1,5>
- 2664436630U, // <u,1,0,6>: Cost 3 vsldoi4 <7,u,1,0>, <6,7,u,1>
- 2664437376U, // <u,1,0,7>: Cost 3 vsldoi4 <7,u,1,0>, <7,u,1,0>
- 1616519889U, // <u,1,0,u>: Cost 2 vsldoi8 <0,u,u,1>, <0,u,u,1>
- 1548894866U, // <u,1,1,0>: Cost 2 vsldoi4 <0,u,1,1>, <0,u,1,1>
- 269271142U, // <u,1,1,1>: Cost 1 vspltisw1 LHS
- 1189462934U, // <u,1,1,2>: Cost 2 vmrghw LHS, <1,2,3,0>
- 2622638230U, // <u,1,1,3>: Cost 3 vsldoi4 <0,u,1,1>, <3,0,1,2>
- 1548897590U, // <u,1,1,4>: Cost 2 vsldoi4 <0,u,1,1>, RHS
- 2756985692U, // <u,1,1,5>: Cost 3 vsldoi12 LHS, <1,1,5,5>
- 2658472872U, // <u,1,1,6>: Cost 3 vsldoi4 <6,u,1,1>, <6,u,1,1>
- 2287614142U, // <u,1,1,7>: Cost 3 vmrglw <0,u,u,1>, <u,6,1,7>
- 269271142U, // <u,1,1,u>: Cost 1 vspltisw1 LHS
- 1566818406U, // <u,1,2,0>: Cost 2 vsldoi4 <3,u,1,2>, LHS
- 2756985735U, // <u,1,2,1>: Cost 3 vsldoi12 LHS, <1,2,1,3>
- 1148371862U, // <u,1,2,2>: Cost 2 vmrghw <1,2,3,0>, <1,2,3,0>
- 835584U, // <u,1,2,3>: Cost 0 copy LHS
- 1566821686U, // <u,1,2,4>: Cost 2 vsldoi4 <3,u,1,2>, RHS
- 2756985771U, // <u,1,2,5>: Cost 3 vsldoi12 LHS, <1,2,5,3>
- 2690262970U, // <u,1,2,6>: Cost 3 vsldoi8 <0,u,u,1>, <2,6,3,7>
- 1590711938U, // <u,1,2,7>: Cost 2 vsldoi4 <7,u,1,2>, <7,u,1,2>
- 835584U, // <u,1,2,u>: Cost 0 copy LHS
- 2282979337U, // <u,1,3,0>: Cost 3 vmrglw LHS, <0,0,1,0>
- 1209237514U, // <u,1,3,1>: Cost 2 vmrglw LHS, <0,0,1,1>
- 1209239702U, // <u,1,3,2>: Cost 2 vmrglw LHS, <3,0,1,2>
- 2282979502U, // <u,1,3,3>: Cost 3 vmrglw LHS, <0,2,1,3>
- 2282979341U, // <u,1,3,4>: Cost 3 vmrglw LHS, <0,0,1,4>
- 1209237842U, // <u,1,3,5>: Cost 2 vmrglw LHS, <0,4,1,5>
- 2282979505U, // <u,1,3,6>: Cost 3 vmrglw LHS, <0,2,1,6>
- 2287625423U, // <u,1,3,7>: Cost 3 vmrglw LHS, <1,6,1,7>
- 1209237521U, // <u,1,3,u>: Cost 2 vmrglw LHS, <0,0,1,u>
- 1635101613U, // <u,1,4,0>: Cost 2 vsldoi8 <4,0,u,1>, <4,0,u,1>
- 2289623050U, // <u,1,4,1>: Cost 3 vmrglw <1,2,u,4>, <0,0,1,1>
- 2289625238U, // <u,1,4,2>: Cost 3 vmrglw <1,2,u,4>, <3,0,1,2>
- 2640579360U, // <u,1,4,3>: Cost 3 vsldoi4 <3,u,1,4>, <3,u,1,4>
- 2622663990U, // <u,1,4,4>: Cost 3 vsldoi4 <0,u,1,4>, RHS
- 1616522550U, // <u,1,4,5>: Cost 2 vsldoi8 <0,u,u,1>, RHS
- 2664469398U, // <u,1,4,6>: Cost 3 vsldoi4 <7,u,1,4>, <6,7,u,1>
- 2664470148U, // <u,1,4,7>: Cost 3 vsldoi4 <7,u,1,4>, <7,u,1,4>
- 1616522793U, // <u,1,4,u>: Cost 2 vsldoi8 <0,u,u,1>, RHS
- 1548927638U, // <u,1,5,0>: Cost 2 vsldoi4 <0,u,1,5>, <0,u,1,5>
- 1192444724U, // <u,1,5,1>: Cost 2 vmrghw RHS, <1,1,1,1>
- 1192444822U, // <u,1,5,2>: Cost 2 vmrghw RHS, <1,2,3,0>
- 2622670998U, // <u,1,5,3>: Cost 3 vsldoi4 <0,u,1,5>, <3,0,1,2>
- 1548930358U, // <u,1,5,4>: Cost 2 vsldoi4 <0,u,1,5>, RHS
- 1210728786U, // <u,1,5,5>: Cost 2 vmrglw <0,4,1,5>, <0,4,1,5>
- 2714153058U, // <u,1,5,6>: Cost 3 vsldoi8 <4,u,u,1>, <5,6,7,0>
- 2670449658U, // <u,1,5,7>: Cost 3 vsldoi4 <u,u,1,5>, <7,0,1,2>
- 1548932910U, // <u,1,5,u>: Cost 2 vsldoi4 <0,u,1,5>, LHS
- 2622677655U, // <u,1,6,0>: Cost 3 vsldoi4 <0,u,1,6>, <0,u,1,6>
- 2756986063U, // <u,1,6,1>: Cost 3 vsldoi12 LHS, <1,6,1,7>
- 2302912662U, // <u,1,6,2>: Cost 3 vmrglw <3,4,u,6>, <3,0,1,2>
- 3696421014U, // <u,1,6,3>: Cost 4 vsldoi4 <0,u,1,6>, <3,0,1,2>
- 2622680374U, // <u,1,6,4>: Cost 3 vsldoi4 <0,u,1,6>, RHS
- 2756986099U, // <u,1,6,5>: Cost 3 vsldoi12 LHS, <1,6,5,7>
- 2714153784U, // <u,1,6,6>: Cost 3 vsldoi8 <4,u,u,1>, <6,6,6,6>
- 1651692438U, // <u,1,6,7>: Cost 2 vsldoi8 <6,7,u,1>, <6,7,u,1>
- 1652356071U, // <u,1,6,u>: Cost 2 vsldoi8 <6,u,u,1>, <6,u,u,1>
- 2628657254U, // <u,1,7,0>: Cost 3 vsldoi4 <1,u,1,7>, LHS
- 1235812362U, // <u,1,7,1>: Cost 2 vmrglw RHS, <0,0,1,1>
- 1235814550U, // <u,1,7,2>: Cost 2 vmrglw RHS, <3,0,1,2>
- 2309554350U, // <u,1,7,3>: Cost 3 vmrglw RHS, <0,2,1,3>
- 2628660534U, // <u,1,7,4>: Cost 3 vsldoi4 <1,u,1,7>, RHS
- 1235812690U, // <u,1,7,5>: Cost 2 vmrglw RHS, <0,4,1,5>
- 2309554353U, // <u,1,7,6>: Cost 3 vmrglw RHS, <0,2,1,6>
- 2309554678U, // <u,1,7,7>: Cost 3 vmrglw RHS, <0,6,1,7>
- 1235812369U, // <u,1,7,u>: Cost 2 vmrglw RHS, <0,0,1,u>
- 1548952217U, // <u,1,u,0>: Cost 2 vsldoi4 <0,u,1,u>, <0,u,1,u>
- 269271142U, // <u,1,u,1>: Cost 1 vspltisw1 LHS
- 1209280662U, // <u,1,u,2>: Cost 2 vmrglw LHS, <3,0,1,2>
- 835584U, // <u,1,u,3>: Cost 0 copy LHS
- 1548954934U, // <u,1,u,4>: Cost 2 vsldoi4 <0,u,1,u>, RHS
- 1209278802U, // <u,1,u,5>: Cost 2 vmrglw LHS, <0,4,1,5>
- 2283020465U, // <u,1,u,6>: Cost 3 vmrglw LHS, <0,2,1,6>
- 1590761096U, // <u,1,u,7>: Cost 2 vsldoi4 <7,u,1,u>, <7,u,1,u>
- 835584U, // <u,1,u,u>: Cost 0 copy LHS
- 2702876672U, // <u,2,0,0>: Cost 3 vsldoi8 <3,0,u,2>, <0,0,0,0>
- 1629134950U, // <u,2,0,1>: Cost 2 vsldoi8 <3,0,u,2>, LHS
- 2289591912U, // <u,2,0,2>: Cost 3 vmrglw <1,2,u,0>, <2,2,2,2>
- 1215848550U, // <u,2,0,3>: Cost 2 vmrglw <1,2,u,0>, LHS
- 2702877010U, // <u,2,0,4>: Cost 3 vsldoi8 <3,0,u,2>, <0,4,1,5>
- 2289222708U, // <u,2,0,5>: Cost 3 vmrglw <1,2,3,0>, <1,4,2,5>
- 2779178473U, // <u,2,0,6>: Cost 3 vsldoi12 RHS, <2,0,6,1>
- 2726249024U, // <u,2,0,7>: Cost 3 vsldoi8 <7,0,1,2>, <0,7,1,0>
- 1215848555U, // <u,2,0,u>: Cost 2 vmrglw <1,2,u,0>, LHS
- 2690933539U, // <u,2,1,0>: Cost 3 vsldoi8 <1,0,u,2>, <1,0,u,2>
- 2628683124U, // <u,2,1,1>: Cost 3 vsldoi4 <1,u,2,1>, <1,u,2,1>
- 1189463656U, // <u,2,1,2>: Cost 2 vmrghw LHS, <2,2,2,2>
- 1213866086U, // <u,2,1,3>: Cost 2 vmrglw <0,u,u,1>, LHS
- 2628685110U, // <u,2,1,4>: Cost 3 vsldoi4 <1,u,2,1>, RHS
- 2263205736U, // <u,2,1,5>: Cost 3 vmrghw LHS, <2,5,3,6>
- 1189463994U, // <u,2,1,6>: Cost 2 vmrghw LHS, <2,6,3,7>
- 2263205866U, // <u,2,1,7>: Cost 3 vmrghw LHS, <2,7,0,1>
- 1213866091U, // <u,2,1,u>: Cost 2 vmrglw <0,u,u,1>, LHS
- 1556938854U, // <u,2,2,0>: Cost 2 vsldoi4 <2,2,2,2>, LHS
- 2697569869U, // <u,2,2,1>: Cost 3 vsldoi8 <2,1,u,2>, <2,1,u,2>
- 336380006U, // <u,2,2,2>: Cost 1 vspltisw2 LHS
- 1678599794U, // <u,2,2,3>: Cost 2 vsldoi12 LHS, <2,2,3,3>
- 1556942134U, // <u,2,2,4>: Cost 2 vsldoi4 <2,2,2,2>, RHS
- 2295138061U, // <u,2,2,5>: Cost 3 vmrglw <2,2,2,2>, <2,4,2,5>
- 2702878650U, // <u,2,2,6>: Cost 3 vsldoi8 <3,0,u,2>, <2,6,3,7>
- 2300229831U, // <u,2,2,7>: Cost 3 vmrglw <3,0,u,2>, <u,6,2,7>
- 336380006U, // <u,2,2,u>: Cost 1 vspltisw2 LHS
- 475243165U, // <u,2,3,0>: Cost 1 vsldoi4 LHS, LHS
- 1548985140U, // <u,2,3,1>: Cost 2 vsldoi4 LHS, <1,1,1,1>
- 1209239144U, // <u,2,3,2>: Cost 2 vmrglw LHS, <2,2,2,2>
- 135495782U, // <u,2,3,3>: Cost 1 vmrglw LHS, LHS
- 475245878U, // <u,2,3,4>: Cost 1 vsldoi4 LHS, RHS
- 1596764164U, // <u,2,3,5>: Cost 2 vsldoi4 LHS, <5,5,5,5>
- 1596764666U, // <u,2,3,6>: Cost 2 vsldoi4 LHS, <6,2,7,3>
- 1596765178U, // <u,2,3,7>: Cost 2 vsldoi4 LHS, <7,0,1,2>
- 135495787U, // <u,2,3,u>: Cost 1 vmrglw LHS, LHS
- 2708851630U, // <u,2,4,0>: Cost 3 vsldoi8 <4,0,u,2>, <4,0,u,2>
- 2217362979U, // <u,2,4,1>: Cost 3 vmrghw <0,4,1,5>, <2,1,3,5>
- 2289624680U, // <u,2,4,2>: Cost 3 vmrglw <1,2,u,4>, <2,2,2,2>
- 1215881318U, // <u,2,4,3>: Cost 2 vmrglw <1,2,u,4>, LHS
- 2726767824U, // <u,2,4,4>: Cost 3 vsldoi8 <7,0,u,2>, <4,4,4,4>
- 1629138230U, // <u,2,4,5>: Cost 2 vsldoi8 <3,0,u,2>, RHS
- 2779178801U, // <u,2,4,6>: Cost 3 vsldoi12 RHS, <2,4,6,5>
- 2726251976U, // <u,2,4,7>: Cost 3 vsldoi8 <7,0,1,2>, <4,7,5,0>
- 1215881323U, // <u,2,4,u>: Cost 2 vmrglw <1,2,u,4>, LHS
- 2628714598U, // <u,2,5,0>: Cost 3 vsldoi4 <1,u,2,5>, LHS
- 2628715896U, // <u,2,5,1>: Cost 3 vsldoi4 <1,u,2,5>, <1,u,2,5>
- 1192445544U, // <u,2,5,2>: Cost 2 vmrghw RHS, <2,2,2,2>
- 1213898854U, // <u,2,5,3>: Cost 2 vmrglw <0,u,u,5>, LHS
- 2628717878U, // <u,2,5,4>: Cost 3 vsldoi4 <1,u,2,5>, RHS
- 2726768644U, // <u,2,5,5>: Cost 3 vsldoi8 <7,0,u,2>, <5,5,5,5>
- 1192445882U, // <u,2,5,6>: Cost 2 vmrghw RHS, <2,6,3,7>
- 2266187754U, // <u,2,5,7>: Cost 3 vmrghw RHS, <2,7,0,1>
- 1213898859U, // <u,2,5,u>: Cost 2 vmrglw <0,u,u,5>, LHS
- 2634694758U, // <u,2,6,0>: Cost 3 vsldoi4 <2,u,2,6>, LHS
- 2721460657U, // <u,2,6,1>: Cost 3 vsldoi8 <6,1,u,2>, <6,1,u,2>
- 2296940136U, // <u,2,6,2>: Cost 3 vmrglw <2,4,u,6>, <2,2,2,2>
- 1678600122U, // <u,2,6,3>: Cost 2 vsldoi12 LHS, <2,6,3,7>
- 2634698038U, // <u,2,6,4>: Cost 3 vsldoi4 <2,u,2,6>, RHS
- 3370682125U, // <u,2,6,5>: Cost 4 vmrglw <2,4,u,6>, <2,4,2,5>
- 1157056442U, // <u,2,6,6>: Cost 2 vmrghw <2,6,3,7>, <2,6,3,7>
- 2725442455U, // <u,2,6,7>: Cost 3 vsldoi8 <6,7,u,2>, <6,7,u,2>
- 1678600167U, // <u,2,6,u>: Cost 2 vsldoi12 LHS, <2,6,u,7>
- 1653027897U, // <u,2,7,0>: Cost 2 vsldoi8 <7,0,u,2>, <7,0,u,2>
- 2309554924U, // <u,2,7,1>: Cost 3 vmrglw RHS, <1,0,2,1>
- 1235813992U, // <u,2,7,2>: Cost 2 vmrglw RHS, <2,2,2,2>
- 162070630U, // <u,2,7,3>: Cost 1 vmrglw RHS, LHS
- 2634706230U, // <u,2,7,4>: Cost 3 vsldoi4 <2,u,2,7>, RHS
- 2309555252U, // <u,2,7,5>: Cost 3 vmrglw RHS, <1,4,2,5>
- 2309555901U, // <u,2,7,6>: Cost 3 vmrglw RHS, <2,3,2,6>
- 2309555416U, // <u,2,7,7>: Cost 3 vmrglw RHS, <1,6,2,7>
- 162070635U, // <u,2,7,u>: Cost 1 vmrglw RHS, LHS
- 475284130U, // <u,2,u,0>: Cost 1 vsldoi4 LHS, LHS
- 1549026100U, // <u,2,u,1>: Cost 2 vsldoi4 LHS, <1,1,1,1>
- 336380006U, // <u,2,u,2>: Cost 1 vspltisw2 LHS
- 135536742U, // <u,2,u,3>: Cost 1 vmrglw LHS, LHS
- 475286838U, // <u,2,u,4>: Cost 1 vsldoi4 LHS, RHS
- 1629141146U, // <u,2,u,5>: Cost 2 vsldoi8 <3,0,u,2>, RHS
- 1194108858U, // <u,2,u,6>: Cost 2 vmrghw LHS, <2,6,3,7>
- 1596806138U, // <u,2,u,7>: Cost 2 vsldoi4 LHS, <7,0,1,2>
- 135536747U, // <u,2,u,u>: Cost 1 vmrglw LHS, LHS
- 1611890688U, // <u,3,0,0>: Cost 2 vsldoi8 LHS, <0,0,0,0>
- 538149020U, // <u,3,0,1>: Cost 1 vsldoi8 LHS, LHS
- 2685632685U, // <u,3,0,2>: Cost 3 vsldoi8 LHS, <0,2,1,2>
- 2685632764U, // <u,3,0,3>: Cost 3 vsldoi8 LHS, <0,3,1,0>
- 1611891026U, // <u,3,0,4>: Cost 2 vsldoi8 LHS, <0,4,1,5>
- 2733408722U, // <u,3,0,5>: Cost 3 vsldoi8 LHS, <0,5,6,7>
- 2658612153U, // <u,3,0,6>: Cost 3 vsldoi4 <6,u,3,0>, <6,u,3,0>
- 2289592250U, // <u,3,0,7>: Cost 3 vmrglw <1,2,u,0>, <2,6,3,7>
- 538149533U, // <u,3,0,u>: Cost 1 vsldoi8 LHS, LHS
- 1189464214U, // <u,3,1,0>: Cost 2 vmrghw LHS, <3,0,1,2>
- 1611891508U, // <u,3,1,1>: Cost 2 vsldoi8 LHS, <1,1,1,1>
- 1611891606U, // <u,3,1,2>: Cost 2 vsldoi8 LHS, <1,2,3,0>
- 1189464476U, // <u,3,1,3>: Cost 2 vmrghw LHS, <3,3,3,3>
- 1189464578U, // <u,3,1,4>: Cost 2 vmrghw LHS, <3,4,5,6>
- 2690278511U, // <u,3,1,5>: Cost 3 vsldoi8 LHS, <1,5,0,1>
- 2690278607U, // <u,3,1,6>: Cost 3 vsldoi8 LHS, <1,6,1,7>
- 2287609786U, // <u,3,1,7>: Cost 3 vmrglw <0,u,u,1>, <2,6,3,7>
- 1611892092U, // <u,3,1,u>: Cost 2 vsldoi8 LHS, <1,u,3,0>
- 2685634042U, // <u,3,2,0>: Cost 3 vsldoi8 LHS, <2,0,u,0>
- 2685634079U, // <u,3,2,1>: Cost 3 vsldoi8 LHS, <2,1,3,1>
- 1611892328U, // <u,3,2,2>: Cost 2 vsldoi8 LHS, <2,2,2,2>
- 1611892390U, // <u,3,2,3>: Cost 2 vsldoi8 LHS, <2,3,0,1>
- 2685634371U, // <u,3,2,4>: Cost 3 vsldoi8 LHS, <2,4,u,5>
- 2685634453U, // <u,3,2,5>: Cost 3 vsldoi8 LHS, <2,5,u,6>
- 1611892666U, // <u,3,2,6>: Cost 2 vsldoi8 LHS, <2,6,3,7>
- 2300225466U, // <u,3,2,7>: Cost 3 vmrglw <3,0,u,2>, <2,6,3,7>
- 1611892795U, // <u,3,2,u>: Cost 2 vsldoi8 LHS, <2,u,0,1>
- 1209238422U, // <u,3,3,0>: Cost 2 vmrglw LHS, <1,2,3,0>
- 2282980247U, // <u,3,3,1>: Cost 3 vmrglw LHS, <1,2,3,1>
- 1561004120U, // <u,3,3,2>: Cost 2 vsldoi4 <2,u,3,3>, <2,u,3,3>
- 403488870U, // <u,3,3,3>: Cost 1 vspltisw3 LHS
- 1209238426U, // <u,3,3,4>: Cost 2 vmrglw LHS, <1,2,3,4>
- 2282980899U, // <u,3,3,5>: Cost 3 vmrglw LHS, <2,1,3,5>
- 2282985598U, // <u,3,3,6>: Cost 3 vmrglw LHS, <u,5,3,6>
- 1209239482U, // <u,3,3,7>: Cost 2 vmrglw LHS, <2,6,3,7>
- 403488870U, // <u,3,3,u>: Cost 1 vspltisw3 LHS
- 1555038310U, // <u,3,4,0>: Cost 2 vsldoi4 <1,u,3,4>, LHS
- 1555039616U, // <u,3,4,1>: Cost 2 vsldoi4 <1,u,3,4>, <1,u,3,4>
- 2628781672U, // <u,3,4,2>: Cost 3 vsldoi4 <1,u,3,4>, <2,2,2,2>
- 2289624690U, // <u,3,4,3>: Cost 3 vmrglw <1,2,u,4>, <2,2,3,3>
- 1555041590U, // <u,3,4,4>: Cost 2 vsldoi4 <1,u,3,4>, RHS
- 538152246U, // <u,3,4,5>: Cost 1 vsldoi8 LHS, RHS
- 2658644925U, // <u,3,4,6>: Cost 3 vsldoi4 <6,u,3,4>, <6,u,3,4>
- 2289625018U, // <u,3,4,7>: Cost 3 vmrglw <1,2,u,4>, <2,6,3,7>
- 538152489U, // <u,3,4,u>: Cost 1 vsldoi8 LHS, RHS
- 1192446102U, // <u,3,5,0>: Cost 2 vmrghw RHS, <3,0,1,2>
- 2733411983U, // <u,3,5,1>: Cost 3 vsldoi8 LHS, <5,1,0,1>
- 2634762330U, // <u,3,5,2>: Cost 3 vsldoi4 <2,u,3,5>, <2,u,3,5>
- 1192446364U, // <u,3,5,3>: Cost 2 vmrghw RHS, <3,3,3,3>
- 1192446466U, // <u,3,5,4>: Cost 2 vmrghw RHS, <3,4,5,6>
- 1659670532U, // <u,3,5,5>: Cost 2 vsldoi8 LHS, <5,5,5,5>
- 1659670626U, // <u,3,5,6>: Cost 2 vsldoi8 LHS, <5,6,7,0>
- 2287642554U, // <u,3,5,7>: Cost 3 vmrglw <0,u,u,5>, <2,6,3,7>
- 1659670788U, // <u,3,5,u>: Cost 2 vsldoi8 LHS, <5,u,7,0>
- 2634768486U, // <u,3,6,0>: Cost 3 vsldoi4 <2,u,3,6>, LHS
- 2733412775U, // <u,3,6,1>: Cost 3 vsldoi8 LHS, <6,1,7,1>
- 1648390659U, // <u,3,6,2>: Cost 2 vsldoi8 <6,2,u,3>, <6,2,u,3>
- 2634770973U, // <u,3,6,3>: Cost 3 vsldoi4 <2,u,3,6>, <3,4,u,6>
- 2634771766U, // <u,3,6,4>: Cost 3 vsldoi4 <2,u,3,6>, RHS
- 2733413099U, // <u,3,6,5>: Cost 3 vsldoi8 LHS, <6,5,7,1>
- 1659671352U, // <u,3,6,6>: Cost 2 vsldoi8 LHS, <6,6,6,6>
- 1659671374U, // <u,3,6,7>: Cost 2 vsldoi8 LHS, <6,7,0,1>
- 1652372457U, // <u,3,6,u>: Cost 2 vsldoi8 <6,u,u,3>, <6,u,u,3>
- 1561034854U, // <u,3,7,0>: Cost 2 vsldoi4 <2,u,3,7>, LHS
- 2634777396U, // <u,3,7,1>: Cost 3 vsldoi4 <2,u,3,7>, <1,1,1,1>
- 1561036892U, // <u,3,7,2>: Cost 2 vsldoi4 <2,u,3,7>, <2,u,3,7>
- 1235814002U, // <u,3,7,3>: Cost 2 vmrglw RHS, <2,2,3,3>
- 1561038134U, // <u,3,7,4>: Cost 2 vsldoi4 <2,u,3,7>, RHS
- 2309555747U, // <u,3,7,5>: Cost 3 vmrglw RHS, <2,1,3,5>
- 2309556072U, // <u,3,7,6>: Cost 3 vmrglw RHS, <2,5,3,6>
- 1235814330U, // <u,3,7,7>: Cost 2 vmrglw RHS, <2,6,3,7>
- 1561040686U, // <u,3,7,u>: Cost 2 vsldoi4 <2,u,3,7>, LHS
- 1611896531U, // <u,3,u,0>: Cost 2 vsldoi8 LHS, <u,0,1,2>
- 538154798U, // <u,3,u,1>: Cost 1 vsldoi8 LHS, LHS
- 1611896712U, // <u,3,u,2>: Cost 2 vsldoi8 LHS, <u,2,3,3>
- 403488870U, // <u,3,u,3>: Cost 1 vspltisw3 LHS
- 1611896895U, // <u,3,u,4>: Cost 2 vsldoi8 LHS, <u,4,5,6>
- 538155162U, // <u,3,u,5>: Cost 1 vsldoi8 LHS, RHS
- 1611897040U, // <u,3,u,6>: Cost 2 vsldoi8 LHS, <u,6,3,7>
- 1209280442U, // <u,3,u,7>: Cost 2 vmrglw LHS, <2,6,3,7>
- 538155365U, // <u,3,u,u>: Cost 1 vsldoi8 LHS, LHS
- 1165118354U, // <u,4,0,0>: Cost 2 vmrghw <4,0,5,1>, <4,0,5,1>
- 1618534502U, // <u,4,0,1>: Cost 2 vsldoi8 <1,2,u,4>, LHS
- 2634795102U, // <u,4,0,2>: Cost 3 vsldoi4 <2,u,4,0>, <2,u,4,0>
- 2686451968U, // <u,4,0,3>: Cost 3 vsldoi8 <0,3,1,4>, <0,3,1,4>
- 2692276562U, // <u,4,0,4>: Cost 3 vsldoi8 <1,2,u,4>, <0,4,1,5>
- 1705438098U, // <u,4,0,5>: Cost 2 vsldoi12 RHS, <4,0,5,1>
- 2658685890U, // <u,4,0,6>: Cost 3 vsldoi4 <6,u,4,0>, <6,u,4,0>
- 2256489928U, // <u,4,0,7>: Cost 3 vmrghw <7,0,1,2>, <4,7,5,0>
- 1618535069U, // <u,4,0,u>: Cost 2 vsldoi8 <1,2,u,4>, LHS
- 1189464978U, // <u,4,1,0>: Cost 2 vmrghw LHS, <4,0,5,1>
- 2692277044U, // <u,4,1,1>: Cost 3 vsldoi8 <1,2,u,4>, <1,1,1,1>
- 1618535367U, // <u,4,1,2>: Cost 2 vsldoi8 <1,2,u,4>, <1,2,u,4>
- 2640775992U, // <u,4,1,3>: Cost 3 vsldoi4 <3,u,4,1>, <3,u,4,1>
- 1189465296U, // <u,4,1,4>: Cost 2 vmrghw LHS, <4,4,4,4>
- 115723574U, // <u,4,1,5>: Cost 1 vmrghw LHS, RHS
- 2263207289U, // <u,4,1,6>: Cost 3 vmrghw LHS, <4,6,5,2>
- 2664666780U, // <u,4,1,7>: Cost 3 vsldoi4 <7,u,4,1>, <7,u,4,1>
- 115723817U, // <u,4,1,u>: Cost 1 vmrghw LHS, RHS
- 2263919506U, // <u,4,2,0>: Cost 3 vmrghw <u,2,3,0>, <4,0,5,1>
- 2222115812U, // <u,4,2,1>: Cost 3 vmrghw <1,2,3,0>, <4,1,5,2>
- 2692277864U, // <u,4,2,2>: Cost 3 vsldoi8 <1,2,u,4>, <2,2,2,2>
- 2692277926U, // <u,4,2,3>: Cost 3 vsldoi8 <1,2,u,4>, <2,3,0,1>
- 2324114640U, // <u,4,2,4>: Cost 3 vmrglw <7,0,u,2>, <4,4,4,4>
- 1190178102U, // <u,4,2,5>: Cost 2 vmrghw <u,2,3,0>, RHS
- 2692278202U, // <u,4,2,6>: Cost 3 vsldoi8 <1,2,u,4>, <2,6,3,7>
- 2701568053U, // <u,4,2,7>: Cost 3 vsldoi8 <2,7,u,4>, <2,7,u,4>
- 1190178345U, // <u,4,2,u>: Cost 2 vmrghw <u,2,3,0>, RHS
- 2692278422U, // <u,4,3,0>: Cost 3 vsldoi8 <1,2,u,4>, <3,0,1,2>
- 2282981552U, // <u,4,3,1>: Cost 3 vmrglw LHS, <3,0,4,1>
- 2704222585U, // <u,4,3,2>: Cost 3 vsldoi8 <3,2,u,4>, <3,2,u,4>
- 2692278684U, // <u,4,3,3>: Cost 3 vsldoi8 <1,2,u,4>, <3,3,3,3>
- 1257016528U, // <u,4,3,4>: Cost 2 vmrglw LHS, <4,4,4,4>
- 1209239246U, // <u,4,3,5>: Cost 2 vmrglw LHS, <2,3,4,5>
- 2691910300U, // <u,4,3,6>: Cost 3 vsldoi8 <1,2,3,4>, <3,6,4,7>
- 2664683166U, // <u,4,3,7>: Cost 3 vsldoi4 <7,u,4,3>, <7,u,4,3>
- 1209239249U, // <u,4,3,u>: Cost 2 vmrglw LHS, <2,3,4,u>
- 1573027942U, // <u,4,4,0>: Cost 2 vsldoi4 <4,u,4,4>, LHS
- 2634826695U, // <u,4,4,1>: Cost 3 vsldoi4 <2,u,4,4>, <1,2,u,4>
- 2634827874U, // <u,4,4,2>: Cost 3 vsldoi4 <2,u,4,4>, <2,u,4,4>
- 2289629073U, // <u,4,4,3>: Cost 3 vmrglw <1,2,u,4>, <u,2,4,3>
- 229035318U, // <u,4,4,4>: Cost 1 vspltisw0 RHS
- 1618537782U, // <u,4,4,5>: Cost 2 vsldoi8 <1,2,u,4>, RHS
- 2658718662U, // <u,4,4,6>: Cost 3 vsldoi4 <6,u,4,4>, <6,u,4,4>
- 2289629401U, // <u,4,4,7>: Cost 3 vmrglw <1,2,u,4>, <u,6,4,7>
- 229035318U, // <u,4,4,u>: Cost 1 vspltisw0 RHS
- 1561092198U, // <u,4,5,0>: Cost 2 vsldoi4 <2,u,4,5>, LHS
- 2628863370U, // <u,4,5,1>: Cost 3 vsldoi4 <1,u,4,5>, <1,u,4,5>
- 1561094243U, // <u,4,5,2>: Cost 2 vsldoi4 <2,u,4,5>, <2,u,4,5>
- 2634836118U, // <u,4,5,3>: Cost 3 vsldoi4 <2,u,4,5>, <3,0,1,2>
- 1561095478U, // <u,4,5,4>: Cost 2 vsldoi4 <2,u,4,5>, RHS
- 118705462U, // <u,4,5,5>: Cost 1 vmrghw RHS, RHS
- 604859702U, // <u,4,5,6>: Cost 1 vsldoi12 LHS, RHS
- 2658726906U, // <u,4,5,7>: Cost 3 vsldoi4 <6,u,4,5>, <7,0,1,2>
- 604859720U, // <u,4,5,u>: Cost 1 vsldoi12 LHS, RHS
- 2266631058U, // <u,4,6,0>: Cost 3 vmrghw <u,6,3,7>, <4,0,5,1>
- 2302692152U, // <u,4,6,1>: Cost 3 vmrglw <3,4,5,6>, <3,u,4,1>
- 2718822906U, // <u,4,6,2>: Cost 3 vsldoi8 <5,6,u,4>, <6,2,7,3>
- 2722804309U, // <u,4,6,3>: Cost 3 vsldoi8 <6,3,u,4>, <6,3,u,4>
- 2723467942U, // <u,4,6,4>: Cost 3 vsldoi8 <6,4,u,4>, <6,4,u,4>
- 1192889654U, // <u,4,6,5>: Cost 2 vmrghw <u,6,3,7>, RHS
- 2718823224U, // <u,4,6,6>: Cost 3 vsldoi8 <5,6,u,4>, <6,6,6,6>
- 2718823246U, // <u,4,6,7>: Cost 3 vsldoi8 <5,6,u,4>, <6,7,0,1>
- 1192889897U, // <u,4,6,u>: Cost 2 vmrghw <u,6,3,7>, RHS
- 2640822374U, // <u,4,7,0>: Cost 3 vsldoi4 <3,u,4,7>, LHS
- 2640823194U, // <u,4,7,1>: Cost 3 vsldoi4 <3,u,4,7>, <1,2,3,4>
- 2728113373U, // <u,4,7,2>: Cost 3 vsldoi8 <7,2,u,4>, <7,2,u,4>
- 2640825150U, // <u,4,7,3>: Cost 3 vsldoi4 <3,u,4,7>, <3,u,4,7>
- 1235815632U, // <u,4,7,4>: Cost 2 vmrglw RHS, <4,4,4,4>
- 1235814094U, // <u,4,7,5>: Cost 2 vmrglw RHS, <2,3,4,5>
- 2730767905U, // <u,4,7,6>: Cost 3 vsldoi8 <7,6,u,4>, <7,6,u,4>
- 2309556892U, // <u,4,7,7>: Cost 3 vmrglw RHS, <3,6,4,7>
- 1235814097U, // <u,4,7,u>: Cost 2 vmrglw RHS, <2,3,4,u>
- 1561116774U, // <u,4,u,0>: Cost 2 vsldoi4 <2,u,4,u>, LHS
- 1618540334U, // <u,4,u,1>: Cost 2 vsldoi8 <1,2,u,4>, LHS
- 1561118822U, // <u,4,u,2>: Cost 2 vsldoi4 <2,u,4,u>, <2,u,4,u>
- 2692282300U, // <u,4,u,3>: Cost 3 vsldoi8 <1,2,u,4>, <u,3,0,1>
- 229035318U, // <u,4,u,4>: Cost 1 vspltisw0 RHS
- 120368438U, // <u,4,u,5>: Cost 1 vmrghw LHS, RHS
- 604859945U, // <u,4,u,6>: Cost 1 vsldoi12 LHS, RHS
- 2309565084U, // <u,4,u,7>: Cost 3 vmrglw RHS, <3,6,4,7>
- 604859963U, // <u,4,u,u>: Cost 1 vsldoi12 LHS, RHS
- 2690293760U, // <u,5,0,0>: Cost 3 vsldoi8 <0,u,u,5>, <0,0,0,0>
- 1616552038U, // <u,5,0,1>: Cost 2 vsldoi8 <0,u,u,5>, LHS
- 2640840434U, // <u,5,0,2>: Cost 3 vsldoi4 <3,u,5,0>, <2,3,u,5>
- 2640841536U, // <u,5,0,3>: Cost 3 vsldoi4 <3,u,5,0>, <3,u,5,0>
- 1613381970U, // <u,5,0,4>: Cost 2 vsldoi8 <0,4,1,5>, <0,4,1,5>
- 2316135642U, // <u,5,0,5>: Cost 3 vmrglw <5,6,u,0>, <4,4,5,5>
- 2289592834U, // <u,5,0,6>: Cost 3 vmrglw <1,2,u,0>, <3,4,5,6>
- 2664732324U, // <u,5,0,7>: Cost 3 vsldoi4 <7,u,5,0>, <7,u,5,0>
- 1616552661U, // <u,5,0,u>: Cost 2 vsldoi8 <0,u,u,5>, <0,u,u,5>
- 1573077094U, // <u,5,1,0>: Cost 2 vsldoi4 <4,u,5,1>, LHS
- 1237536282U, // <u,5,1,1>: Cost 2 vmrglw <4,u,5,1>, <4,u,5,1>
- 2690294678U, // <u,5,1,2>: Cost 3 vsldoi8 <0,u,u,5>, <1,2,3,0>
- 2646821014U, // <u,5,1,3>: Cost 3 vsldoi4 <4,u,5,1>, <3,0,1,2>
- 1573080602U, // <u,5,1,4>: Cost 2 vsldoi4 <4,u,5,1>, <4,u,5,1>
- 1189466116U, // <u,5,1,5>: Cost 2 vmrghw LHS, <5,5,5,5>
- 1189466210U, // <u,5,1,6>: Cost 2 vmrghw LHS, <5,6,7,0>
- 2646823930U, // <u,5,1,7>: Cost 3 vsldoi4 <4,u,5,1>, <7,0,1,2>
- 1573082926U, // <u,5,1,u>: Cost 2 vsldoi4 <4,u,5,1>, LHS
- 2640855142U, // <u,5,2,0>: Cost 3 vsldoi4 <3,u,5,2>, LHS
- 2697594448U, // <u,5,2,1>: Cost 3 vsldoi8 <2,1,u,5>, <2,1,u,5>
- 2690295400U, // <u,5,2,2>: Cost 3 vsldoi8 <0,u,u,5>, <2,2,2,2>
- 1625179890U, // <u,5,2,3>: Cost 2 vsldoi8 <2,3,u,5>, <2,3,u,5>
- 2699585347U, // <u,5,2,4>: Cost 3 vsldoi8 <2,4,u,5>, <2,4,u,5>
- 2781171471U, // <u,5,2,5>: Cost 3 vsldoi12 RHS, <5,2,5,3>
- 2690295738U, // <u,5,2,6>: Cost 3 vsldoi8 <0,u,u,5>, <2,6,3,7>
- 3775318070U, // <u,5,2,7>: Cost 4 vsldoi8 <2,7,u,5>, <2,7,u,5>
- 1628498055U, // <u,5,2,u>: Cost 2 vsldoi8 <2,u,u,5>, <2,u,u,5>
- 2287627234U, // <u,5,3,0>: Cost 3 vmrglw LHS, <4,1,5,0>
- 1257016210U, // <u,5,3,1>: Cost 2 vmrglw LHS, <4,0,5,1>
- 2646836942U, // <u,5,3,2>: Cost 3 vsldoi4 <4,u,5,3>, <2,3,4,5>
- 2287625131U, // <u,5,3,3>: Cost 3 vmrglw LHS, <1,2,5,3>
- 2287627238U, // <u,5,3,4>: Cost 3 vmrglw LHS, <4,1,5,4>
- 1257016538U, // <u,5,3,5>: Cost 2 vmrglw LHS, <4,4,5,5>
- 1209240066U, // <u,5,3,6>: Cost 2 vmrglw LHS, <3,4,5,6>
- 2287625459U, // <u,5,3,7>: Cost 3 vmrglw LHS, <1,6,5,7>
- 1209240068U, // <u,5,3,u>: Cost 2 vmrglw LHS, <3,4,5,u>
- 2640871526U, // <u,5,4,0>: Cost 3 vsldoi4 <3,u,5,4>, LHS
- 2316168082U, // <u,5,4,1>: Cost 3 vmrglw <5,6,u,4>, <4,0,5,1>
- 2640873202U, // <u,5,4,2>: Cost 3 vsldoi4 <3,u,5,4>, <2,3,u,5>
- 2640874308U, // <u,5,4,3>: Cost 3 vsldoi4 <3,u,5,4>, <3,u,5,4>
- 1637788917U, // <u,5,4,4>: Cost 2 vsldoi8 <4,4,u,5>, <4,4,u,5>
- 1616555318U, // <u,5,4,5>: Cost 2 vsldoi8 <0,u,u,5>, RHS
- 2287638591U, // <u,5,4,6>: Cost 3 vmrglw <0,u,u,4>, <u,4,5,6>
- 2664765096U, // <u,5,4,7>: Cost 3 vsldoi4 <7,u,5,4>, <7,u,5,4>
- 1616555561U, // <u,5,4,u>: Cost 2 vsldoi8 <0,u,u,5>, RHS
- 1573109862U, // <u,5,5,0>: Cost 2 vsldoi4 <4,u,5,5>, LHS
- 2646852404U, // <u,5,5,1>: Cost 3 vsldoi4 <4,u,5,5>, <1,1,1,1>
- 2646853224U, // <u,5,5,2>: Cost 3 vsldoi4 <4,u,5,5>, <2,2,2,2>
- 2287646618U, // <u,5,5,3>: Cost 3 vmrglw <0,u,u,5>, <u,2,5,3>
- 1573113374U, // <u,5,5,4>: Cost 2 vsldoi4 <4,u,5,5>, <4,u,5,5>
- 296144182U, // <u,5,5,5>: Cost 1 vspltisw1 RHS
- 1192448098U, // <u,5,5,6>: Cost 2 vmrghw RHS, <5,6,7,0>
- 2287646946U, // <u,5,5,7>: Cost 3 vmrglw <0,u,u,5>, <u,6,5,7>
- 296144182U, // <u,5,5,u>: Cost 1 vspltisw1 RHS
- 1567146086U, // <u,5,6,0>: Cost 2 vsldoi4 <3,u,5,6>, LHS
- 2628945300U, // <u,5,6,1>: Cost 3 vsldoi4 <1,u,5,6>, <1,u,5,6>
- 2634917997U, // <u,5,6,2>: Cost 3 vsldoi4 <2,u,5,6>, <2,u,5,6>
- 1567148870U, // <u,5,6,3>: Cost 2 vsldoi4 <3,u,5,6>, <3,u,5,6>
- 1567149366U, // <u,5,6,4>: Cost 2 vsldoi4 <3,u,5,6>, RHS
- 2781171799U, // <u,5,6,5>: Cost 3 vsldoi12 RHS, <5,6,5,7>
- 1228950018U, // <u,5,6,6>: Cost 2 vmrglw <3,4,5,6>, <3,4,5,6>
- 27705344U, // <u,5,6,7>: Cost 0 copy RHS
- 27705344U, // <u,5,6,u>: Cost 0 copy RHS
- 2628952166U, // <u,5,7,0>: Cost 3 vsldoi4 <1,u,5,7>, LHS
- 1235815314U, // <u,5,7,1>: Cost 2 vmrglw RHS, <4,0,5,1>
- 2309556734U, // <u,5,7,2>: Cost 3 vmrglw RHS, <3,4,5,2>
- 2309555115U, // <u,5,7,3>: Cost 3 vmrglw RHS, <1,2,5,3>
- 2628955446U, // <u,5,7,4>: Cost 3 vsldoi4 <1,u,5,7>, RHS
- 1235815642U, // <u,5,7,5>: Cost 2 vmrglw RHS, <4,4,5,5>
- 1235814914U, // <u,5,7,6>: Cost 2 vmrglw RHS, <3,4,5,6>
- 2309555443U, // <u,5,7,7>: Cost 3 vmrglw RHS, <1,6,5,7>
- 1235814916U, // <u,5,7,u>: Cost 2 vmrglw RHS, <3,4,5,u>
- 1567162470U, // <u,5,u,0>: Cost 2 vsldoi4 <3,u,5,u>, LHS
- 1616557870U, // <u,5,u,1>: Cost 2 vsldoi8 <0,u,u,5>, LHS
- 2690299781U, // <u,5,u,2>: Cost 3 vsldoi8 <0,u,u,5>, <u,2,3,0>
- 1567165256U, // <u,5,u,3>: Cost 2 vsldoi4 <3,u,5,u>, <3,u,5,u>
- 1567165750U, // <u,5,u,4>: Cost 2 vsldoi4 <3,u,5,u>, RHS
- 296144182U, // <u,5,u,5>: Cost 1 vspltisw1 RHS
- 1209281026U, // <u,5,u,6>: Cost 2 vmrglw LHS, <3,4,5,6>
- 27705344U, // <u,5,u,7>: Cost 0 copy RHS
- 27705344U, // <u,5,u,u>: Cost 0 copy RHS
- 2705563648U, // <u,6,0,0>: Cost 3 vsldoi8 <3,4,u,6>, <0,0,0,0>
- 1631821926U, // <u,6,0,1>: Cost 2 vsldoi8 <3,4,u,6>, LHS
- 2262462970U, // <u,6,0,2>: Cost 3 vmrghw <u,0,1,2>, <6,2,7,3>
- 2646886941U, // <u,6,0,3>: Cost 3 vsldoi4 <4,u,6,0>, <3,4,u,6>
- 2705563986U, // <u,6,0,4>: Cost 3 vsldoi8 <3,4,u,6>, <0,4,1,5>
- 2316062652U, // <u,6,0,5>: Cost 3 vmrglw <5,6,7,0>, <5,4,6,5>
- 2316137272U, // <u,6,0,6>: Cost 3 vmrglw <5,6,u,0>, <6,6,6,6>
- 1215851830U, // <u,6,0,7>: Cost 2 vmrglw <1,2,u,0>, RHS
- 1215851831U, // <u,6,0,u>: Cost 2 vmrglw <1,2,u,0>, RHS
- 2634948710U, // <u,6,1,0>: Cost 3 vsldoi4 <2,u,6,1>, LHS
- 2705564468U, // <u,6,1,1>: Cost 3 vsldoi8 <3,4,u,6>, <1,1,1,1>
- 1189466618U, // <u,6,1,2>: Cost 2 vmrghw LHS, <6,2,7,3>
- 2263208498U, // <u,6,1,3>: Cost 3 vmrghw LHS, <6,3,4,5>
- 2693620843U, // <u,6,1,4>: Cost 3 vsldoi8 <1,4,u,6>, <1,4,u,6>
- 2652868860U, // <u,6,1,5>: Cost 3 vsldoi4 <5,u,6,1>, <5,u,6,1>
- 1189466936U, // <u,6,1,6>: Cost 2 vmrghw LHS, <6,6,6,6>
- 1213869366U, // <u,6,1,7>: Cost 2 vmrglw <0,u,u,1>, RHS
- 1213869367U, // <u,6,1,u>: Cost 2 vmrglw <0,u,u,1>, RHS
- 2658844774U, // <u,6,2,0>: Cost 3 vsldoi4 <6,u,6,2>, LHS
- 3771344465U, // <u,6,2,1>: Cost 4 vsldoi8 <2,1,u,6>, <2,1,u,6>
- 1178554874U, // <u,6,2,2>: Cost 2 vmrghw <6,2,7,3>, <6,2,7,3>
- 2698929907U, // <u,6,2,3>: Cost 3 vsldoi8 <2,3,u,6>, <2,3,u,6>
- 2699593540U, // <u,6,2,4>: Cost 3 vsldoi8 <2,4,u,6>, <2,4,u,6>
- 2700257173U, // <u,6,2,5>: Cost 3 vsldoi8 <2,5,u,6>, <2,5,u,6>
- 2705565626U, // <u,6,2,6>: Cost 3 vsldoi8 <3,4,u,6>, <2,6,3,7>
- 1226485046U, // <u,6,2,7>: Cost 2 vmrglw <3,0,u,2>, RHS
- 1226485047U, // <u,6,2,u>: Cost 2 vmrglw <3,0,u,2>, RHS
- 2705565846U, // <u,6,3,0>: Cost 3 vsldoi8 <3,4,u,6>, <3,0,1,2>
- 2330756585U, // <u,6,3,1>: Cost 3 vmrglw LHS, <2,0,6,1>
- 2330756829U, // <u,6,3,2>: Cost 3 vmrglw LHS, <2,3,6,2>
- 2282981734U, // <u,6,3,3>: Cost 3 vmrglw LHS, <3,2,6,3>
- 1631824413U, // <u,6,3,4>: Cost 2 vsldoi8 <3,4,u,6>, <3,4,u,6>
- 2652885246U, // <u,6,3,5>: Cost 3 vsldoi4 <5,u,6,3>, <5,u,6,3>
- 1257018168U, // <u,6,3,6>: Cost 2 vmrglw LHS, <6,6,6,6>
- 135499062U, // <u,6,3,7>: Cost 1 vmrglw LHS, RHS
- 135499063U, // <u,6,3,u>: Cost 1 vmrglw LHS, RHS
- 2646917222U, // <u,6,4,0>: Cost 3 vsldoi4 <4,u,6,4>, LHS
- 2217365931U, // <u,6,4,1>: Cost 3 vmrghw <0,4,1,5>, <6,1,7,5>
- 2790167156U, // <u,6,4,2>: Cost 3 vsldoi12 <6,4,2,u>, <6,4,2,u>
- 2646919709U, // <u,6,4,3>: Cost 3 vsldoi4 <4,u,6,4>, <3,4,u,6>
- 2711538934U, // <u,6,4,4>: Cost 3 vsldoi8 <4,4,u,6>, <4,4,u,6>
- 1631825206U, // <u,6,4,5>: Cost 2 vsldoi8 <3,4,u,6>, RHS
- 2316170040U, // <u,6,4,6>: Cost 3 vmrglw <5,6,u,4>, <6,6,6,6>
- 1215884598U, // <u,6,4,7>: Cost 2 vmrglw <1,2,u,4>, RHS
- 1215884599U, // <u,6,4,u>: Cost 2 vmrglw <1,2,u,4>, RHS
- 2634981478U, // <u,6,5,0>: Cost 3 vsldoi4 <2,u,6,5>, LHS
- 2266190247U, // <u,6,5,1>: Cost 3 vmrghw RHS, <6,1,7,1>
- 1192448506U, // <u,6,5,2>: Cost 2 vmrghw RHS, <6,2,7,3>
- 2266190386U, // <u,6,5,3>: Cost 3 vmrghw RHS, <6,3,4,5>
- 2634984758U, // <u,6,5,4>: Cost 3 vsldoi4 <2,u,6,5>, RHS
- 2652901632U, // <u,6,5,5>: Cost 3 vsldoi4 <5,u,6,5>, <5,u,6,5>
- 1192448824U, // <u,6,5,6>: Cost 2 vmrghw RHS, <6,6,6,6>
- 1213902134U, // <u,6,5,7>: Cost 2 vmrglw <0,u,u,5>, RHS
- 1213902135U, // <u,6,5,u>: Cost 2 vmrglw <0,u,u,5>, RHS
- 1583808614U, // <u,6,6,0>: Cost 2 vsldoi4 <6,6,6,6>, LHS
- 2322010445U, // <u,6,6,1>: Cost 3 vmrglw <6,6,6,6>, <6,0,6,1>
- 2718839290U, // <u,6,6,2>: Cost 3 vsldoi8 <5,6,u,6>, <6,2,7,3>
- 2670823965U, // <u,6,6,3>: Cost 3 vsldoi4 <u,u,6,6>, <3,4,u,6>
- 1583811894U, // <u,6,6,4>: Cost 2 vsldoi4 <6,6,6,6>, RHS
- 2724147961U, // <u,6,6,5>: Cost 3 vsldoi8 <6,5,u,6>, <6,5,u,6>
- 363253046U, // <u,6,6,6>: Cost 1 vspltisw2 RHS
- 1229172022U, // <u,6,6,7>: Cost 2 vmrglw <3,4,u,6>, RHS
- 363253046U, // <u,6,6,u>: Cost 1 vspltisw2 RHS
- 499458150U, // <u,6,7,0>: Cost 1 vsldoi4 RHS, LHS
- 1573200692U, // <u,6,7,1>: Cost 2 vsldoi4 RHS, <1,1,1,1>
- 1573201512U, // <u,6,7,2>: Cost 2 vsldoi4 RHS, <2,2,2,2>
- 1573202070U, // <u,6,7,3>: Cost 2 vsldoi4 RHS, <3,0,1,2>
- 499461673U, // <u,6,7,4>: Cost 1 vsldoi4 RHS, RHS
- 1573203972U, // <u,6,7,5>: Cost 2 vsldoi4 RHS, <5,5,5,5>
- 1235817272U, // <u,6,7,6>: Cost 2 vmrglw RHS, <6,6,6,6>
- 162073910U, // <u,6,7,7>: Cost 1 vmrglw RHS, RHS
- 162073911U, // <u,6,7,u>: Cost 1 vmrglw RHS, RHS
- 499466342U, // <u,6,u,0>: Cost 1 vsldoi4 RHS, LHS
- 1631827758U, // <u,6,u,1>: Cost 2 vsldoi8 <3,4,u,6>, LHS
- 1573209704U, // <u,6,u,2>: Cost 2 vsldoi4 RHS, <2,2,2,2>
- 1573210262U, // <u,6,u,3>: Cost 2 vsldoi4 RHS, <3,0,1,2>
- 499469866U, // <u,6,u,4>: Cost 1 vsldoi4 RHS, RHS
- 1631828122U, // <u,6,u,5>: Cost 2 vsldoi8 <3,4,u,6>, RHS
- 363253046U, // <u,6,u,6>: Cost 1 vspltisw2 RHS
- 135540022U, // <u,6,u,7>: Cost 1 vmrglw LHS, RHS
- 135540023U, // <u,6,u,u>: Cost 1 vmrglw LHS, RHS
- 1638465536U, // <u,7,0,0>: Cost 2 vsldoi8 RHS, <0,0,0,0>
- 564723814U, // <u,7,0,1>: Cost 1 vsldoi8 RHS, LHS
- 2712207533U, // <u,7,0,2>: Cost 3 vsldoi8 RHS, <0,2,1,2>
- 2712207612U, // <u,7,0,3>: Cost 3 vsldoi8 RHS, <0,3,1,0>
- 1638465874U, // <u,7,0,4>: Cost 2 vsldoi8 RHS, <0,4,1,5>
- 1579192580U, // <u,7,0,5>: Cost 2 vsldoi4 <5,u,7,0>, <5,u,7,0>
- 2712207862U, // <u,7,0,6>: Cost 3 vsldoi8 RHS, <0,6,1,7>
- 2316137282U, // <u,7,0,7>: Cost 3 vmrglw <5,6,u,0>, <6,6,7,7>
- 564724381U, // <u,7,0,u>: Cost 1 vsldoi8 RHS, LHS
- 1189467130U, // <u,7,1,0>: Cost 2 vmrghw LHS, <7,0,1,2>
- 1638466356U, // <u,7,1,1>: Cost 2 vsldoi8 RHS, <1,1,1,1>
- 1638466454U, // <u,7,1,2>: Cost 2 vsldoi8 RHS, <1,2,3,0>
- 2311500282U, // <u,7,1,3>: Cost 3 vmrglw <4,u,u,1>, <6,2,7,3>
- 1189467494U, // <u,7,1,4>: Cost 2 vmrghw LHS, <7,4,5,6>
- 2712208495U, // <u,7,1,5>: Cost 3 vsldoi8 RHS, <1,5,0,1>
- 2694956302U, // <u,7,1,6>: Cost 3 vsldoi8 <1,6,u,7>, <1,6,u,7>
- 1189467756U, // <u,7,1,7>: Cost 2 vmrghw LHS, <7,7,7,7>
- 1638466940U, // <u,7,1,u>: Cost 2 vsldoi8 RHS, <1,u,3,0>
- 2712208829U, // <u,7,2,0>: Cost 3 vsldoi8 RHS, <2,0,1,2>
- 2712208927U, // <u,7,2,1>: Cost 3 vsldoi8 RHS, <2,1,3,1>
- 1638467176U, // <u,7,2,2>: Cost 2 vsldoi8 RHS, <2,2,2,2>
- 1638467238U, // <u,7,2,3>: Cost 2 vsldoi8 RHS, <2,3,0,1>
- 2712209165U, // <u,7,2,4>: Cost 3 vsldoi8 RHS, <2,4,2,5>
- 2712209256U, // <u,7,2,5>: Cost 3 vsldoi8 RHS, <2,5,3,6>
- 1627187175U, // <u,7,2,6>: Cost 2 vsldoi8 <2,6,u,7>, <2,6,u,7>
- 2324116290U, // <u,7,2,7>: Cost 3 vmrglw <7,0,u,2>, <6,6,7,7>
- 1628514441U, // <u,7,2,u>: Cost 2 vsldoi8 <2,u,u,7>, <2,u,u,7>
- 1638467734U, // <u,7,3,0>: Cost 2 vsldoi8 RHS, <3,0,1,2>
- 2712209638U, // <u,7,3,1>: Cost 3 vsldoi8 RHS, <3,1,1,1>
- 2700929387U, // <u,7,3,2>: Cost 3 vsldoi8 <2,6,u,7>, <3,2,6,u>
- 1638467996U, // <u,7,3,3>: Cost 2 vsldoi8 RHS, <3,3,3,3>
- 1638468098U, // <u,7,3,4>: Cost 2 vsldoi8 RHS, <3,4,5,6>
- 2712210002U, // <u,7,3,5>: Cost 3 vsldoi8 RHS, <3,5,5,5>
- 1585189856U, // <u,7,3,6>: Cost 2 vsldoi4 <6,u,7,3>, <6,u,7,3>
- 1257018178U, // <u,7,3,7>: Cost 2 vmrglw LHS, <6,6,7,7>
- 1638468382U, // <u,7,3,u>: Cost 2 vsldoi8 RHS, <3,u,1,2>
- 1638468498U, // <u,7,4,0>: Cost 2 vsldoi8 RHS, <4,0,5,1>
- 2712210378U, // <u,7,4,1>: Cost 3 vsldoi8 RHS, <4,1,2,3>
- 2712210485U, // <u,7,4,2>: Cost 3 vsldoi8 RHS, <4,2,5,2>
- 2712210564U, // <u,7,4,3>: Cost 3 vsldoi8 RHS, <4,3,5,0>
- 1638468816U, // <u,7,4,4>: Cost 2 vsldoi8 RHS, <4,4,4,4>
- 564727112U, // <u,7,4,5>: Cost 1 vsldoi8 RHS, RHS
- 2712210809U, // <u,7,4,6>: Cost 3 vsldoi8 RHS, <4,6,5,2>
- 2712210888U, // <u,7,4,7>: Cost 3 vsldoi8 RHS, <4,7,5,0>
- 564727337U, // <u,7,4,u>: Cost 1 vsldoi8 RHS, RHS
- 1192449018U, // <u,7,5,0>: Cost 2 vmrghw RHS, <7,0,1,2>
- 2714201743U, // <u,7,5,1>: Cost 3 vsldoi8 RHS, <5,1,0,1>
- 2712211198U, // <u,7,5,2>: Cost 3 vsldoi8 RHS, <5,2,3,4>
- 2311533050U, // <u,7,5,3>: Cost 3 vmrglw <4,u,u,5>, <6,2,7,3>
- 1192449382U, // <u,7,5,4>: Cost 2 vmrghw RHS, <7,4,5,6>
- 1638469636U, // <u,7,5,5>: Cost 2 vsldoi8 RHS, <5,5,5,5>
- 1638469730U, // <u,7,5,6>: Cost 2 vsldoi8 RHS, <5,6,7,0>
- 1192449644U, // <u,7,5,7>: Cost 2 vmrghw RHS, <7,7,7,7>
- 1638469892U, // <u,7,5,u>: Cost 2 vsldoi8 RHS, <5,u,7,0>
- 2712211745U, // <u,7,6,0>: Cost 3 vsldoi8 RHS, <6,0,1,2>
- 2712211879U, // <u,7,6,1>: Cost 3 vsldoi8 RHS, <6,1,7,1>
- 1638470138U, // <u,7,6,2>: Cost 2 vsldoi8 RHS, <6,2,7,3>
- 2712212018U, // <u,7,6,3>: Cost 3 vsldoi8 RHS, <6,3,4,5>
- 2712212109U, // <u,7,6,4>: Cost 3 vsldoi8 RHS, <6,4,5,6>
- 2712212203U, // <u,7,6,5>: Cost 3 vsldoi8 RHS, <6,5,7,1>
- 1638470456U, // <u,7,6,6>: Cost 2 vsldoi8 RHS, <6,6,6,6>
- 1638470478U, // <u,7,6,7>: Cost 2 vsldoi8 RHS, <6,7,0,1>
- 1638470559U, // <u,7,6,u>: Cost 2 vsldoi8 RHS, <6,u,0,1>
- 1235816546U, // <u,7,7,0>: Cost 2 vmrglw RHS, <5,6,7,0>
- 2309558371U, // <u,7,7,1>: Cost 3 vmrglw RHS, <5,6,7,1>
- 2641045434U, // <u,7,7,2>: Cost 3 vsldoi4 <3,u,7,7>, <2,6,3,7>
- 1235816954U, // <u,7,7,3>: Cost 2 vmrglw RHS, <6,2,7,3>
- 1235816550U, // <u,7,7,4>: Cost 2 vmrglw RHS, <5,6,7,4>
- 2309558375U, // <u,7,7,5>: Cost 3 vmrglw RHS, <5,6,7,5>
- 1585222628U, // <u,7,7,6>: Cost 2 vsldoi4 <6,u,7,7>, <6,u,7,7>
- 430361910U, // <u,7,7,7>: Cost 1 vspltisw3 RHS
- 430361910U, // <u,7,7,u>: Cost 1 vspltisw3 RHS
- 1638471379U, // <u,7,u,0>: Cost 2 vsldoi8 RHS, <u,0,1,2>
- 564729646U, // <u,7,u,1>: Cost 1 vsldoi8 RHS, LHS
- 1638471557U, // <u,7,u,2>: Cost 2 vsldoi8 RHS, <u,2,3,0>
- 1638471612U, // <u,7,u,3>: Cost 2 vsldoi8 RHS, <u,3,0,1>
- 1638471743U, // <u,7,u,4>: Cost 2 vsldoi8 RHS, <u,4,5,6>
- 564730010U, // <u,7,u,5>: Cost 1 vsldoi8 RHS, RHS
- 1638471888U, // <u,7,u,6>: Cost 2 vsldoi8 RHS, <u,6,3,7>
- 430361910U, // <u,7,u,7>: Cost 1 vspltisw3 RHS
- 564730213U, // <u,7,u,u>: Cost 1 vsldoi8 RHS, LHS
- 202162278U, // <u,u,0,0>: Cost 1 vspltisw0 LHS
- 538189985U, // <u,u,0,1>: Cost 1 vsldoi8 LHS, LHS
- 2685673645U, // <u,u,0,2>: Cost 3 vsldoi8 LHS, <0,2,1,2>
- 1215848604U, // <u,u,0,3>: Cost 2 vmrglw <1,2,u,0>, LHS
- 1611931986U, // <u,u,0,4>: Cost 2 vsldoi8 LHS, <0,4,1,5>
- 1579266317U, // <u,u,0,5>: Cost 2 vsldoi4 <5,u,u,0>, <5,u,u,0>
- 2289592861U, // <u,u,0,6>: Cost 3 vmrglw <1,2,u,0>, <3,4,u,6>
- 1215851848U, // <u,u,0,7>: Cost 2 vmrglw <1,2,u,0>, RHS
- 538190493U, // <u,u,0,u>: Cost 1 vsldoi8 LHS, LHS
- 1549411025U, // <u,u,1,0>: Cost 2 vsldoi4 <0,u,u,1>, <0,u,u,1>
- 115726126U, // <u,u,1,1>: Cost 1 vmrghw LHS, LHS
- 604862254U, // <u,u,1,2>: Cost 1 vsldoi12 LHS, LHS
- 1213866140U, // <u,u,1,3>: Cost 2 vmrglw <0,u,u,1>, LHS
- 1549413686U, // <u,u,1,4>: Cost 2 vsldoi4 <0,u,u,1>, RHS
- 115726490U, // <u,u,1,5>: Cost 1 vmrghw LHS, RHS
- 1585247207U, // <u,u,1,6>: Cost 2 vsldoi4 <6,u,u,1>, <6,u,u,1>
- 1213869384U, // <u,u,1,7>: Cost 2 vmrglw <0,u,u,1>, RHS
- 604862308U, // <u,u,1,u>: Cost 1 vsldoi12 LHS, LHS
- 1567334502U, // <u,u,2,0>: Cost 2 vsldoi4 <3,u,u,2>, LHS
- 1190180654U, // <u,u,2,1>: Cost 2 vmrghw <u,2,3,0>, LHS
- 336380006U, // <u,u,2,2>: Cost 1 vspltisw2 LHS
- 835584U, // <u,u,2,3>: Cost 0 copy LHS
- 1567337782U, // <u,u,2,4>: Cost 2 vsldoi4 <3,u,u,2>, RHS
- 1190181018U, // <u,u,2,5>: Cost 2 vmrghw <u,2,3,0>, RHS
- 1611933626U, // <u,u,2,6>: Cost 2 vsldoi8 LHS, <2,6,3,7>
- 1226485064U, // <u,u,2,7>: Cost 2 vmrglw <3,0,u,2>, RHS
- 835584U, // <u,u,2,u>: Cost 0 copy LHS
- 475685587U, // <u,u,3,0>: Cost 1 vsldoi4 LHS, LHS
- 1209239278U, // <u,u,3,1>: Cost 2 vmrglw LHS, <2,3,u,1>
- 1209239765U, // <u,u,3,2>: Cost 2 vmrglw LHS, <3,0,u,2>
- 135495836U, // <u,u,3,3>: Cost 1 vmrglw LHS, LHS
- 475688246U, // <u,u,3,4>: Cost 1 vsldoi4 LHS, RHS
- 1209239282U, // <u,u,3,5>: Cost 2 vmrglw LHS, <2,3,u,5>
- 1209240093U, // <u,u,3,6>: Cost 2 vmrglw LHS, <3,4,u,6>
- 135499080U, // <u,u,3,7>: Cost 1 vmrglw LHS, RHS
- 135495841U, // <u,u,3,u>: Cost 1 vmrglw LHS, LHS
- 1555406950U, // <u,u,4,0>: Cost 2 vsldoi4 <1,u,u,4>, LHS
- 1555408301U, // <u,u,4,1>: Cost 2 vsldoi4 <1,u,u,4>, <1,u,u,4>
- 2289625301U, // <u,u,4,2>: Cost 3 vmrglw <1,2,u,4>, <3,0,u,2>
- 1215881372U, // <u,u,4,3>: Cost 2 vmrglw <1,2,u,4>, LHS
- 229035318U, // <u,u,4,4>: Cost 1 vspltisw0 RHS
- 538193206U, // <u,u,4,5>: Cost 1 vsldoi8 LHS, RHS
- 2289625629U, // <u,u,4,6>: Cost 3 vmrglw <1,2,u,4>, <3,4,u,6>
- 1215884616U, // <u,u,4,7>: Cost 2 vmrglw <1,2,u,4>, RHS
- 538193449U, // <u,u,4,u>: Cost 1 vsldoi8 LHS, RHS
- 1549443797U, // <u,u,5,0>: Cost 2 vsldoi4 <0,u,u,5>, <0,u,u,5>
- 118708014U, // <u,u,5,1>: Cost 1 vmrghw RHS, LHS
- 1561389191U, // <u,u,5,2>: Cost 2 vsldoi4 <2,u,u,5>, <2,u,u,5>
- 1213898908U, // <u,u,5,3>: Cost 2 vmrglw <0,u,u,5>, LHS
- 1549446454U, // <u,u,5,4>: Cost 2 vsldoi4 <0,u,u,5>, RHS
- 118708378U, // <u,u,5,5>: Cost 1 vmrghw RHS, RHS
- 604862618U, // <u,u,5,6>: Cost 1 vsldoi12 LHS, RHS
- 1213902152U, // <u,u,5,7>: Cost 2 vmrglw <0,u,u,5>, RHS
- 604862636U, // <u,u,5,u>: Cost 1 vsldoi12 LHS, RHS
- 1567367270U, // <u,u,6,0>: Cost 2 vsldoi4 <3,u,u,6>, LHS
- 1192892206U, // <u,u,6,1>: Cost 2 vmrghw <u,6,3,7>, LHS
- 1638478330U, // <u,u,6,2>: Cost 2 vsldoi8 RHS, <6,2,7,3>
- 1679046864U, // <u,u,6,3>: Cost 2 vsldoi12 LHS, <u,6,3,7>
- 1567370550U, // <u,u,6,4>: Cost 2 vsldoi4 <3,u,u,6>, RHS
- 1192892570U, // <u,u,6,5>: Cost 2 vmrghw <u,6,3,7>, RHS
- 363253046U, // <u,u,6,6>: Cost 1 vspltisw2 RHS
- 27705344U, // <u,u,6,7>: Cost 0 copy RHS
- 27705344U, // <u,u,6,u>: Cost 0 copy RHS
- 499605606U, // <u,u,7,0>: Cost 1 vsldoi4 RHS, LHS
- 1235812425U, // <u,u,7,1>: Cost 2 vmrglw RHS, <0,0,u,1>
- 1561405577U, // <u,u,7,2>: Cost 2 vsldoi4 <2,u,u,7>, <2,u,u,7>
- 162070684U, // <u,u,7,3>: Cost 1 vmrglw RHS, LHS
- 499609147U, // <u,u,7,4>: Cost 1 vsldoi4 RHS, RHS
- 1235812753U, // <u,u,7,5>: Cost 2 vmrglw RHS, <0,4,u,5>
- 1235814941U, // <u,u,7,6>: Cost 2 vmrglw RHS, <3,4,u,6>
- 162073928U, // <u,u,7,7>: Cost 1 vmrglw RHS, RHS
- 162070689U, // <u,u,7,u>: Cost 1 vmrglw RHS, LHS
- 475726552U, // <u,u,u,0>: Cost 1 vsldoi4 LHS, LHS
- 538195758U, // <u,u,u,1>: Cost 1 vsldoi8 LHS, LHS
- 604862821U, // <u,u,u,2>: Cost 1 vsldoi12 LHS, LHS
- 835584U, // <u,u,u,3>: Cost 0 copy LHS
- 475729206U, // <u,u,u,4>: Cost 1 vsldoi4 LHS, RHS
- 538196122U, // <u,u,u,5>: Cost 1 vsldoi8 LHS, RHS
- 604862861U, // <u,u,u,6>: Cost 1 vsldoi12 LHS, RHS
- 27705344U, // <u,u,u,7>: Cost 0 copy RHS
- 835584U, // <u,u,u,u>: Cost 0 copy LHS
- 0
-};
diff --git a/release_23/lib/Target/PowerPC/PPCPredicates.cpp b/release_23/lib/Target/PowerPC/PPCPredicates.cpp
deleted file mode 100644
index 08a281259e1f..000000000000
--- a/release_23/lib/Target/PowerPC/PPCPredicates.cpp
+++ /dev/null
@@ -1,30 +0,0 @@
-//===-- PPCPredicates.cpp - PPC Branch Predicate Information --------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the PowerPC branch predicates.
-//
-//===----------------------------------------------------------------------===//
-
-#include "PPCPredicates.h"
-#include <cassert>
-using namespace llvm;
-
-PPC::Predicate PPC::InvertPredicate(PPC::Predicate Opcode) {
- switch (Opcode) {
- default: assert(0 && "Unknown PPC branch opcode!");
- case PPC::PRED_EQ: return PPC::PRED_NE;
- case PPC::PRED_NE: return PPC::PRED_EQ;
- case PPC::PRED_LT: return PPC::PRED_GE;
- case PPC::PRED_GE: return PPC::PRED_LT;
- case PPC::PRED_GT: return PPC::PRED_LE;
- case PPC::PRED_LE: return PPC::PRED_GT;
- case PPC::PRED_NU: return PPC::PRED_UN;
- case PPC::PRED_UN: return PPC::PRED_NU;
- }
-}
diff --git a/release_23/lib/Target/PowerPC/PPCPredicates.h b/release_23/lib/Target/PowerPC/PPCPredicates.h
deleted file mode 100644
index b2c831579f79..000000000000
--- a/release_23/lib/Target/PowerPC/PPCPredicates.h
+++ /dev/null
@@ -1,39 +0,0 @@
-//===-- PPCPredicates.h - PPC Branch Predicate Information ------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file describes the PowerPC branch predicates.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_TARGET_POWERPC_PPCPREDICATES_H
-#define LLVM_TARGET_POWERPC_PPCPREDICATES_H
-
-#include "PPC.h"
-
-namespace llvm {
-namespace PPC {
- /// Predicate - These are "(BI << 5) | BO" for various predicates.
- enum Predicate {
- PRED_ALWAYS = (0 << 5) | 20,
- PRED_LT = (0 << 5) | 12,
- PRED_LE = (1 << 5) | 4,
- PRED_EQ = (2 << 5) | 12,
- PRED_GE = (0 << 5) | 4,
- PRED_GT = (1 << 5) | 12,
- PRED_NE = (2 << 5) | 4,
- PRED_UN = (3 << 5) | 12,
- PRED_NU = (3 << 5) | 4
- };
-
- /// Invert the specified predicate. != -> ==, < -> >=.
- Predicate InvertPredicate(Predicate Opcode);
-}
-}
-
-#endif
diff --git a/release_23/lib/Target/PowerPC/PPCRegisterInfo.cpp b/release_23/lib/Target/PowerPC/PPCRegisterInfo.cpp
deleted file mode 100644
index d8ea207ecab8..000000000000
--- a/release_23/lib/Target/PowerPC/PPCRegisterInfo.cpp
+++ /dev/null
@@ -1,1430 +0,0 @@
-//===- PPCRegisterInfo.cpp - PowerPC Register Information -------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains the PowerPC implementation of the TargetRegisterInfo
-// class.
-//
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "reginfo"
-#include "PPC.h"
-#include "PPCInstrBuilder.h"
-#include "PPCMachineFunctionInfo.h"
-#include "PPCRegisterInfo.h"
-#include "PPCFrameInfo.h"
-#include "PPCSubtarget.h"
-#include "llvm/CallingConv.h"
-#include "llvm/Constants.h"
-#include "llvm/Function.h"
-#include "llvm/Type.h"
-#include "llvm/CodeGen/ValueTypes.h"
-#include "llvm/CodeGen/MachineInstrBuilder.h"
-#include "llvm/CodeGen/MachineModuleInfo.h"
-#include "llvm/CodeGen/MachineFunction.h"
-#include "llvm/CodeGen/MachineFrameInfo.h"
-#include "llvm/CodeGen/MachineLocation.h"
-#include "llvm/CodeGen/MachineRegisterInfo.h"
-#include "llvm/CodeGen/RegisterScavenging.h"
-#include "llvm/CodeGen/SelectionDAGNodes.h"
-#include "llvm/Target/TargetFrameInfo.h"
-#include "llvm/Target/TargetInstrInfo.h"
-#include "llvm/Target/TargetMachine.h"
-#include "llvm/Target/TargetOptions.h"
-#include "llvm/Support/CommandLine.h"
-#include "llvm/Support/Debug.h"
-#include "llvm/Support/MathExtras.h"
-#include "llvm/ADT/BitVector.h"
-#include "llvm/ADT/STLExtras.h"
-#include <cstdlib>
-using namespace llvm;
-
-// FIXME This disables some code that aligns the stack to a boundary
-// bigger than the default (16 bytes on Darwin) when there is a stack local
-// of greater alignment. This does not currently work, because the delta
-// between old and new stack pointers is added to offsets that reference
-// incoming parameters after the prolog is generated, and the code that
-// does that doesn't handle a variable delta. You don't want to do that
-// anyway; a better approach is to reserve another register that retains
-// to the incoming stack pointer, and reference parameters relative to that.
-#define ALIGN_STACK 0
-
-// FIXME (64-bit): Eventually enable by default.
-cl::opt<bool> EnablePPC32RS("enable-ppc32-regscavenger",
- cl::init(false),
- cl::desc("Enable PPC32 register scavenger"),
- cl::Hidden);
-cl::opt<bool> EnablePPC64RS("enable-ppc64-regscavenger",
- cl::init(false),
- cl::desc("Enable PPC64 register scavenger"),
- cl::Hidden);
-#define EnableRegisterScavenging \
- ((EnablePPC32RS && !Subtarget.isPPC64()) || \
- (EnablePPC64RS && Subtarget.isPPC64()))
-
-// FIXME (64-bit): Should be inlined.
-bool
-PPCRegisterInfo::requiresRegisterScavenging(const MachineFunction &) const {
- return EnableRegisterScavenging;
-}
-
-/// getRegisterNumbering - Given the enum value for some register, e.g.
-/// PPC::F14, return the number that it corresponds to (e.g. 14).
-unsigned PPCRegisterInfo::getRegisterNumbering(unsigned RegEnum) {
- using namespace PPC;
- switch (RegEnum) {
- case 0: return 0;
- case R0 : case X0 : case F0 : case V0 : case CR0: case CR0LT: return 0;
- case R1 : case X1 : case F1 : case V1 : case CR1: case CR0GT: return 1;
- case R2 : case X2 : case F2 : case V2 : case CR2: case CR0EQ: return 2;
- case R3 : case X3 : case F3 : case V3 : case CR3: case CR0UN: return 3;
- case R4 : case X4 : case F4 : case V4 : case CR4: case CR1LT: return 4;
- case R5 : case X5 : case F5 : case V5 : case CR5: case CR1GT: return 5;
- case R6 : case X6 : case F6 : case V6 : case CR6: case CR1EQ: return 6;
- case R7 : case X7 : case F7 : case V7 : case CR7: case CR1UN: return 7;
- case R8 : case X8 : case F8 : case V8 : case CR2LT: return 8;
- case R9 : case X9 : case F9 : case V9 : case CR2GT: return 9;
- case R10: case X10: case F10: case V10: case CR2EQ: return 10;
- case R11: case X11: case F11: case V11: case CR2UN: return 11;
- case R12: case X12: case F12: case V12: case CR3LT: return 12;
- case R13: case X13: case F13: case V13: case CR3GT: return 13;
- case R14: case X14: case F14: case V14: case CR3EQ: return 14;
- case R15: case X15: case F15: case V15: case CR3UN: return 15;
- case R16: case X16: case F16: case V16: case CR4LT: return 16;
- case R17: case X17: case F17: case V17: case CR4GT: return 17;
- case R18: case X18: case F18: case V18: case CR4EQ: return 18;
- case R19: case X19: case F19: case V19: case CR4UN: return 19;
- case R20: case X20: case F20: case V20: case CR5LT: return 20;
- case R21: case X21: case F21: case V21: case CR5GT: return 21;
- case R22: case X22: case F22: case V22: case CR5EQ: return 22;
- case R23: case X23: case F23: case V23: case CR5UN: return 23;
- case R24: case X24: case F24: case V24: case CR6LT: return 24;
- case R25: case X25: case F25: case V25: case CR6GT: return 25;
- case R26: case X26: case F26: case V26: case CR6EQ: return 26;
- case R27: case X27: case F27: case V27: case CR6UN: return 27;
- case R28: case X28: case F28: case V28: case CR7LT: return 28;
- case R29: case X29: case F29: case V29: case CR7GT: return 29;
- case R30: case X30: case F30: case V30: case CR7EQ: return 30;
- case R31: case X31: case F31: case V31: case CR7UN: return 31;
- default:
- cerr << "Unhandled reg in PPCRegisterInfo::getRegisterNumbering!\n";
- abort();
- }
-}
-
-PPCRegisterInfo::PPCRegisterInfo(const PPCSubtarget &ST,
- const TargetInstrInfo &tii)
- : PPCGenRegisterInfo(PPC::ADJCALLSTACKDOWN, PPC::ADJCALLSTACKUP),
- Subtarget(ST), TII(tii) {
- ImmToIdxMap[PPC::LD] = PPC::LDX; ImmToIdxMap[PPC::STD] = PPC::STDX;
- ImmToIdxMap[PPC::LBZ] = PPC::LBZX; ImmToIdxMap[PPC::STB] = PPC::STBX;
- ImmToIdxMap[PPC::LHZ] = PPC::LHZX; ImmToIdxMap[PPC::LHA] = PPC::LHAX;
- ImmToIdxMap[PPC::LWZ] = PPC::LWZX; ImmToIdxMap[PPC::LWA] = PPC::LWAX;
- ImmToIdxMap[PPC::LFS] = PPC::LFSX; ImmToIdxMap[PPC::LFD] = PPC::LFDX;
- ImmToIdxMap[PPC::STH] = PPC::STHX; ImmToIdxMap[PPC::STW] = PPC::STWX;
- ImmToIdxMap[PPC::STFS] = PPC::STFSX; ImmToIdxMap[PPC::STFD] = PPC::STFDX;
- ImmToIdxMap[PPC::ADDI] = PPC::ADD4;
-
- // 64-bit
- ImmToIdxMap[PPC::LHA8] = PPC::LHAX8; ImmToIdxMap[PPC::LBZ8] = PPC::LBZX8;
- ImmToIdxMap[PPC::LHZ8] = PPC::LHZX8; ImmToIdxMap[PPC::LWZ8] = PPC::LWZX8;
- ImmToIdxMap[PPC::STB8] = PPC::STBX8; ImmToIdxMap[PPC::STH8] = PPC::STHX8;
- ImmToIdxMap[PPC::STW8] = PPC::STWX8; ImmToIdxMap[PPC::STDU] = PPC::STDUX;
- ImmToIdxMap[PPC::ADDI8] = PPC::ADD8; ImmToIdxMap[PPC::STD_32] = PPC::STDX_32;
-}
-
-const unsigned*
-PPCRegisterInfo::getCalleeSavedRegs(const MachineFunction *MF) const {
- // 32-bit Darwin calling convention.
- static const unsigned Macho32_CalleeSavedRegs[] = {
- PPC::R13, PPC::R14, PPC::R15,
- PPC::R16, PPC::R17, PPC::R18, PPC::R19,
- PPC::R20, PPC::R21, PPC::R22, PPC::R23,
- PPC::R24, PPC::R25, PPC::R26, PPC::R27,
- PPC::R28, PPC::R29, PPC::R30, PPC::R31,
-
- PPC::F14, PPC::F15, PPC::F16, PPC::F17,
- PPC::F18, PPC::F19, PPC::F20, PPC::F21,
- PPC::F22, PPC::F23, PPC::F24, PPC::F25,
- PPC::F26, PPC::F27, PPC::F28, PPC::F29,
- PPC::F30, PPC::F31,
-
- PPC::CR2, PPC::CR3, PPC::CR4,
- PPC::V20, PPC::V21, PPC::V22, PPC::V23,
- PPC::V24, PPC::V25, PPC::V26, PPC::V27,
- PPC::V28, PPC::V29, PPC::V30, PPC::V31,
-
- PPC::CR2LT, PPC::CR2GT, PPC::CR2EQ, PPC::CR2UN,
- PPC::CR3LT, PPC::CR3GT, PPC::CR3EQ, PPC::CR3UN,
- PPC::CR4LT, PPC::CR4GT, PPC::CR4EQ, PPC::CR4UN,
-
- PPC::LR, 0
- };
-
- static const unsigned ELF32_CalleeSavedRegs[] = {
- PPC::R13, PPC::R14, PPC::R15,
- PPC::R16, PPC::R17, PPC::R18, PPC::R19,
- PPC::R20, PPC::R21, PPC::R22, PPC::R23,
- PPC::R24, PPC::R25, PPC::R26, PPC::R27,
- PPC::R28, PPC::R29, PPC::R30, PPC::R31,
-
- PPC::F9,
- PPC::F10, PPC::F11, PPC::F12, PPC::F13,
- PPC::F14, PPC::F15, PPC::F16, PPC::F17,
- PPC::F18, PPC::F19, PPC::F20, PPC::F21,
- PPC::F22, PPC::F23, PPC::F24, PPC::F25,
- PPC::F26, PPC::F27, PPC::F28, PPC::F29,
- PPC::F30, PPC::F31,
-
- PPC::CR2, PPC::CR3, PPC::CR4,
- PPC::V20, PPC::V21, PPC::V22, PPC::V23,
- PPC::V24, PPC::V25, PPC::V26, PPC::V27,
- PPC::V28, PPC::V29, PPC::V30, PPC::V31,
-
- PPC::CR2LT, PPC::CR2GT, PPC::CR2EQ, PPC::CR2UN,
- PPC::CR3LT, PPC::CR3GT, PPC::CR3EQ, PPC::CR3UN,
- PPC::CR4LT, PPC::CR4GT, PPC::CR4EQ, PPC::CR4UN,
-
- PPC::LR, 0
- };
- // 64-bit Darwin calling convention.
- static const unsigned Macho64_CalleeSavedRegs[] = {
- PPC::X14, PPC::X15,
- PPC::X16, PPC::X17, PPC::X18, PPC::X19,
- PPC::X20, PPC::X21, PPC::X22, PPC::X23,
- PPC::X24, PPC::X25, PPC::X26, PPC::X27,
- PPC::X28, PPC::X29, PPC::X30, PPC::X31,
-
- PPC::F14, PPC::F15, PPC::F16, PPC::F17,
- PPC::F18, PPC::F19, PPC::F20, PPC::F21,
- PPC::F22, PPC::F23, PPC::F24, PPC::F25,
- PPC::F26, PPC::F27, PPC::F28, PPC::F29,
- PPC::F30, PPC::F31,
-
- PPC::CR2, PPC::CR3, PPC::CR4,
- PPC::V20, PPC::V21, PPC::V22, PPC::V23,
- PPC::V24, PPC::V25, PPC::V26, PPC::V27,
- PPC::V28, PPC::V29, PPC::V30, PPC::V31,
-
- PPC::CR2LT, PPC::CR2GT, PPC::CR2EQ, PPC::CR2UN,
- PPC::CR3LT, PPC::CR3GT, PPC::CR3EQ, PPC::CR3UN,
- PPC::CR4LT, PPC::CR4GT, PPC::CR4EQ, PPC::CR4UN,
-
- PPC::LR8, 0
- };
-
- if (Subtarget.isMachoABI())
- return Subtarget.isPPC64() ? Macho64_CalleeSavedRegs :
- Macho32_CalleeSavedRegs;
-
- // ELF 32.
- return ELF32_CalleeSavedRegs;
-}
-
-const TargetRegisterClass* const*
-PPCRegisterInfo::getCalleeSavedRegClasses(const MachineFunction *MF) const {
- // 32-bit Macho calling convention.
- static const TargetRegisterClass * const Macho32_CalleeSavedRegClasses[] = {
- &PPC::GPRCRegClass,&PPC::GPRCRegClass,&PPC::GPRCRegClass,
- &PPC::GPRCRegClass,&PPC::GPRCRegClass,&PPC::GPRCRegClass,&PPC::GPRCRegClass,
- &PPC::GPRCRegClass,&PPC::GPRCRegClass,&PPC::GPRCRegClass,&PPC::GPRCRegClass,
- &PPC::GPRCRegClass,&PPC::GPRCRegClass,&PPC::GPRCRegClass,&PPC::GPRCRegClass,
- &PPC::GPRCRegClass,&PPC::GPRCRegClass,&PPC::GPRCRegClass,&PPC::GPRCRegClass,
-
- &PPC::F8RCRegClass,&PPC::F8RCRegClass,&PPC::F8RCRegClass,&PPC::F8RCRegClass,
- &PPC::F8RCRegClass,&PPC::F8RCRegClass,&PPC::F8RCRegClass,&PPC::F8RCRegClass,
- &PPC::F8RCRegClass,&PPC::F8RCRegClass,&PPC::F8RCRegClass,&PPC::F8RCRegClass,
- &PPC::F8RCRegClass,&PPC::F8RCRegClass,&PPC::F8RCRegClass,&PPC::F8RCRegClass,
- &PPC::F8RCRegClass,&PPC::F8RCRegClass,
-
- &PPC::CRRCRegClass,&PPC::CRRCRegClass,&PPC::CRRCRegClass,
-
- &PPC::VRRCRegClass,&PPC::VRRCRegClass,&PPC::VRRCRegClass,&PPC::VRRCRegClass,
- &PPC::VRRCRegClass,&PPC::VRRCRegClass,&PPC::VRRCRegClass,&PPC::VRRCRegClass,
- &PPC::VRRCRegClass,&PPC::VRRCRegClass,&PPC::VRRCRegClass,&PPC::VRRCRegClass,
-
- &PPC::CRBITRCRegClass,&PPC::CRBITRCRegClass,&PPC::CRBITRCRegClass,
- &PPC::CRBITRCRegClass,
- &PPC::CRBITRCRegClass,&PPC::CRBITRCRegClass,&PPC::CRBITRCRegClass,
- &PPC::CRBITRCRegClass,
- &PPC::CRBITRCRegClass,&PPC::CRBITRCRegClass,&PPC::CRBITRCRegClass,
- &PPC::CRBITRCRegClass,
-
- &PPC::GPRCRegClass, 0
- };
-
- static const TargetRegisterClass * const ELF32_CalleeSavedRegClasses[] = {
- &PPC::GPRCRegClass,&PPC::GPRCRegClass,&PPC::GPRCRegClass,
- &PPC::GPRCRegClass,&PPC::GPRCRegClass,&PPC::GPRCRegClass,&PPC::GPRCRegClass,
- &PPC::GPRCRegClass,&PPC::GPRCRegClass,&PPC::GPRCRegClass,&PPC::GPRCRegClass,
- &PPC::GPRCRegClass,&PPC::GPRCRegClass,&PPC::GPRCRegClass,&PPC::GPRCRegClass,
- &PPC::GPRCRegClass,&PPC::GPRCRegClass,&PPC::GPRCRegClass,&PPC::GPRCRegClass,
-
- &PPC::F8RCRegClass,
- &PPC::F8RCRegClass,&PPC::F8RCRegClass,&PPC::F8RCRegClass,&PPC::F8RCRegClass,
- &PPC::F8RCRegClass,&PPC::F8RCRegClass,&PPC::F8RCRegClass,&PPC::F8RCRegClass,
- &PPC::F8RCRegClass,&PPC::F8RCRegClass,&PPC::F8RCRegClass,&PPC::F8RCRegClass,
- &PPC::F8RCRegClass,&PPC::F8RCRegClass,&PPC::F8RCRegClass,&PPC::F8RCRegClass,
- &PPC::F8RCRegClass,&PPC::F8RCRegClass,&PPC::F8RCRegClass,&PPC::F8RCRegClass,
- &PPC::F8RCRegClass,&PPC::F8RCRegClass,
-
- &PPC::CRRCRegClass,&PPC::CRRCRegClass,&PPC::CRRCRegClass,
-
- &PPC::VRRCRegClass,&PPC::VRRCRegClass,&PPC::VRRCRegClass,&PPC::VRRCRegClass,
- &PPC::VRRCRegClass,&PPC::VRRCRegClass,&PPC::VRRCRegClass,&PPC::VRRCRegClass,
- &PPC::VRRCRegClass,&PPC::VRRCRegClass,&PPC::VRRCRegClass,&PPC::VRRCRegClass,
-
- &PPC::CRBITRCRegClass,&PPC::CRBITRCRegClass,&PPC::CRBITRCRegClass,
- &PPC::CRBITRCRegClass,
- &PPC::CRBITRCRegClass,&PPC::CRBITRCRegClass,&PPC::CRBITRCRegClass,
- &PPC::CRBITRCRegClass,
- &PPC::CRBITRCRegClass,&PPC::CRBITRCRegClass,&PPC::CRBITRCRegClass,
- &PPC::CRBITRCRegClass,
-
- &PPC::GPRCRegClass, 0
- };
-
- // 64-bit Macho calling convention.
- static const TargetRegisterClass * const Macho64_CalleeSavedRegClasses[] = {
- &PPC::G8RCRegClass,&PPC::G8RCRegClass,
- &PPC::G8RCRegClass,&PPC::G8RCRegClass,&PPC::G8RCRegClass,&PPC::G8RCRegClass,
- &PPC::G8RCRegClass,&PPC::G8RCRegClass,&PPC::G8RCRegClass,&PPC::G8RCRegClass,
- &PPC::G8RCRegClass,&PPC::G8RCRegClass,&PPC::G8RCRegClass,&PPC::G8RCRegClass,
- &PPC::G8RCRegClass,&PPC::G8RCRegClass,&PPC::G8RCRegClass,&PPC::G8RCRegClass,
-
- &PPC::F8RCRegClass,&PPC::F8RCRegClass,&PPC::F8RCRegClass,&PPC::F8RCRegClass,
- &PPC::F8RCRegClass,&PPC::F8RCRegClass,&PPC::F8RCRegClass,&PPC::F8RCRegClass,
- &PPC::F8RCRegClass,&PPC::F8RCRegClass,&PPC::F8RCRegClass,&PPC::F8RCRegClass,
- &PPC::F8RCRegClass,&PPC::F8RCRegClass,&PPC::F8RCRegClass,&PPC::F8RCRegClass,
- &PPC::F8RCRegClass,&PPC::F8RCRegClass,
-
- &PPC::CRRCRegClass,&PPC::CRRCRegClass,&PPC::CRRCRegClass,
-
- &PPC::VRRCRegClass,&PPC::VRRCRegClass,&PPC::VRRCRegClass,&PPC::VRRCRegClass,
- &PPC::VRRCRegClass,&PPC::VRRCRegClass,&PPC::VRRCRegClass,&PPC::VRRCRegClass,
- &PPC::VRRCRegClass,&PPC::VRRCRegClass,&PPC::VRRCRegClass,&PPC::VRRCRegClass,
-
- &PPC::CRBITRCRegClass,&PPC::CRBITRCRegClass,&PPC::CRBITRCRegClass,
- &PPC::CRBITRCRegClass,
- &PPC::CRBITRCRegClass,&PPC::CRBITRCRegClass,&PPC::CRBITRCRegClass,
- &PPC::CRBITRCRegClass,
- &PPC::CRBITRCRegClass,&PPC::CRBITRCRegClass,&PPC::CRBITRCRegClass,
- &PPC::CRBITRCRegClass,
-
- &PPC::G8RCRegClass, 0
- };
-
- if (Subtarget.isMachoABI())
- return Subtarget.isPPC64() ? Macho64_CalleeSavedRegClasses :
- Macho32_CalleeSavedRegClasses;
-
- // ELF 32.
- return ELF32_CalleeSavedRegClasses;
-}
-
-// needsFP - Return true if the specified function should have a dedicated frame
-// pointer register. This is true if the function has variable sized allocas or
-// if frame pointer elimination is disabled.
-//
-static bool needsFP(const MachineFunction &MF) {
- const MachineFrameInfo *MFI = MF.getFrameInfo();
- return NoFramePointerElim || MFI->hasVarSizedObjects() ||
- (PerformTailCallOpt && MF.getInfo<PPCFunctionInfo>()->hasFastCall());
-}
-
-static bool spillsCR(const MachineFunction &MF) {
- const PPCFunctionInfo *FuncInfo = MF.getInfo<PPCFunctionInfo>();
- return FuncInfo->isCRSpilled();
-}
-
-BitVector PPCRegisterInfo::getReservedRegs(const MachineFunction &MF) const {
- BitVector Reserved(getNumRegs());
- Reserved.set(PPC::R0);
- Reserved.set(PPC::R1);
- Reserved.set(PPC::LR);
- Reserved.set(PPC::LR8);
-
- // In Linux, r2 is reserved for the OS.
- if (!Subtarget.isDarwin())
- Reserved.set(PPC::R2);
-
- // On PPC64, r13 is the thread pointer. Never allocate this register. Note
- // that this is over conservative, as it also prevents allocation of R31 when
- // the FP is not needed.
- if (Subtarget.isPPC64()) {
- Reserved.set(PPC::R13);
- Reserved.set(PPC::R31);
-
- if (!EnableRegisterScavenging)
- Reserved.set(PPC::R0); // FIXME (64-bit): Remove
-
- Reserved.set(PPC::X0);
- Reserved.set(PPC::X1);
- Reserved.set(PPC::X13);
- Reserved.set(PPC::X31);
- }
-
- if (needsFP(MF))
- Reserved.set(PPC::R31);
-
- return Reserved;
-}
-
-//===----------------------------------------------------------------------===//
-// Stack Frame Processing methods
-//===----------------------------------------------------------------------===//
-
-// hasFP - Return true if the specified function actually has a dedicated frame
-// pointer register. This is true if the function needs a frame pointer and has
-// a non-zero stack size.
-bool PPCRegisterInfo::hasFP(const MachineFunction &MF) const {
- const MachineFrameInfo *MFI = MF.getFrameInfo();
- return MFI->getStackSize() && needsFP(MF);
-}
-
-/// MustSaveLR - Return true if this function requires that we save the LR
-/// register onto the stack in the prolog and restore it in the epilog of the
-/// function.
-static bool MustSaveLR(const MachineFunction &MF) {
- const PPCFunctionInfo *MFI = MF.getInfo<PPCFunctionInfo>();
-
- // We need an save/restore of LR if there is any use/def of LR explicitly, or
- // if there is some use of the LR stack slot (e.g. for builtin_return_address.
- return MFI->usesLR() || MFI->isLRStoreRequired() ||
- // FIXME: Anything that has a call should clobber the LR register,
- // isn't this redundant??
- MF.getFrameInfo()->hasCalls();
-}
-
-
-
-void PPCRegisterInfo::
-eliminateCallFramePseudoInstr(MachineFunction &MF, MachineBasicBlock &MBB,
- MachineBasicBlock::iterator I) const {
- if (PerformTailCallOpt && I->getOpcode() == PPC::ADJCALLSTACKUP) {
- // Add (actually substract) back the amount the callee popped on return.
- if (int CalleeAmt = I->getOperand(1).getImm()) {
- MachineInstr * New = NULL;
- bool is64Bit = Subtarget.isPPC64();
- CalleeAmt *= -1;
- unsigned StackReg = is64Bit ? PPC::X1 : PPC::R1;
- unsigned TmpReg = is64Bit ? PPC::X0 : PPC::R0;
- unsigned ADDIInstr = is64Bit ? PPC::ADDI8 : PPC::ADDI;
- unsigned ADDInstr = is64Bit ? PPC::ADD8 : PPC::ADD4;
- unsigned LISInstr = is64Bit ? PPC::LIS8 : PPC::LIS;
- unsigned ORIInstr = is64Bit ? PPC::ORI8 : PPC::ORI;
-
- if (isInt16(CalleeAmt)) {
- New = BuildMI(TII.get(ADDIInstr), StackReg).addReg(StackReg).
- addImm(CalleeAmt);
- MBB.insert(I, New);
- } else {
- MachineBasicBlock::iterator MBBI = I;
- BuildMI(MBB, MBBI, TII.get(LISInstr), TmpReg)
- .addImm(CalleeAmt >> 16);
- BuildMI(MBB, MBBI, TII.get(ORIInstr), TmpReg)
- .addReg(TmpReg, false, false, true)
- .addImm(CalleeAmt & 0xFFFF);
- BuildMI(MBB, MBBI, TII.get(ADDInstr))
- .addReg(StackReg)
- .addReg(StackReg)
- .addReg(TmpReg);
- }
- }
- }
- // Simply discard ADJCALLSTACKDOWN, ADJCALLSTACKUP instructions.
- MBB.erase(I);
-}
-
-/// findScratchRegister - Find a 'free' PPC register. Try for a call-clobbered
-/// register first and then a spilled callee-saved register if that fails.
-static
-unsigned findScratchRegister(MachineBasicBlock::iterator II, RegScavenger *RS,
- const TargetRegisterClass *RC, int SPAdj) {
- assert(RS && "Register scavenging must be on");
- unsigned Reg = RS->FindUnusedReg(RC, true);
- // FIXME: move ARM callee-saved reg scan to target independent code, then
- // search for already spilled CS register here.
- if (Reg == 0)
- Reg = RS->scavengeRegister(RC, II, SPAdj);
- return Reg;
-}
-
-/// lowerDynamicAlloc - Generate the code for allocating an object in the
-/// current frame. The sequence of code with be in the general form
-///
-/// addi R0, SP, #frameSize ; get the address of the previous frame
-/// stwxu R0, SP, Rnegsize ; add and update the SP with the negated size
-/// addi Rnew, SP, #maxCalFrameSize ; get the top of the allocation
-///
-void PPCRegisterInfo::lowerDynamicAlloc(MachineBasicBlock::iterator II,
- int SPAdj, RegScavenger *RS) const {
- // Get the instruction.
- MachineInstr &MI = *II;
- // Get the instruction's basic block.
- MachineBasicBlock &MBB = *MI.getParent();
- // Get the basic block's function.
- MachineFunction &MF = *MBB.getParent();
- // Get the frame info.
- MachineFrameInfo *MFI = MF.getFrameInfo();
- // Determine whether 64-bit pointers are used.
- bool LP64 = Subtarget.isPPC64();
-
- // Get the maximum call stack size.
- unsigned maxCallFrameSize = MFI->getMaxCallFrameSize();
- // Get the total frame size.
- unsigned FrameSize = MFI->getStackSize();
-
- // Get stack alignments.
- unsigned TargetAlign = MF.getTarget().getFrameInfo()->getStackAlignment();
- unsigned MaxAlign = MFI->getMaxAlignment();
- assert(MaxAlign <= TargetAlign &&
- "Dynamic alloca with large aligns not supported");
-
- // Determine the previous frame's address. If FrameSize can't be
- // represented as 16 bits or we need special alignment, then we load the
- // previous frame's address from 0(SP). Why not do an addis of the hi?
- // Because R0 is our only safe tmp register and addi/addis treat R0 as zero.
- // Constructing the constant and adding would take 3 instructions.
- // Fortunately, a frame greater than 32K is rare.
- const TargetRegisterClass *G8RC = &PPC::G8RCRegClass;
- const TargetRegisterClass *GPRC = &PPC::GPRCRegClass;
- const TargetRegisterClass *RC = LP64 ? G8RC : GPRC;
-
- // FIXME (64-bit): Use "findScratchRegister"
- unsigned Reg;
- if (EnableRegisterScavenging)
- Reg = findScratchRegister(II, RS, RC, SPAdj);
- else
- Reg = PPC::R0;
-
- if (MaxAlign < TargetAlign && isInt16(FrameSize)) {
- BuildMI(MBB, II, TII.get(PPC::ADDI), Reg)
- .addReg(PPC::R31)
- .addImm(FrameSize);
- } else if (LP64) {
- if (EnableRegisterScavenging) // FIXME (64-bit): Use "true" part.
- BuildMI(MBB, II, TII.get(PPC::LD), Reg)
- .addImm(0)
- .addReg(PPC::X1);
- else
- BuildMI(MBB, II, TII.get(PPC::LD), PPC::X0)
- .addImm(0)
- .addReg(PPC::X1);
- } else {
- BuildMI(MBB, II, TII.get(PPC::LWZ), Reg)
- .addImm(0)
- .addReg(PPC::R1);
- }
-
- // Grow the stack and update the stack pointer link, then determine the
- // address of new allocated space.
- if (LP64) {
- if (EnableRegisterScavenging) // FIXME (64-bit): Use "true" part.
- BuildMI(MBB, II, TII.get(PPC::STDUX))
- .addReg(Reg, false, false, true)
- .addReg(PPC::X1)
- .addReg(MI.getOperand(1).getReg());
- else
- BuildMI(MBB, II, TII.get(PPC::STDUX))
- .addReg(PPC::X0, false, false, true)
- .addReg(PPC::X1)
- .addReg(MI.getOperand(1).getReg());
-
- if (!MI.getOperand(1).isKill())
- BuildMI(MBB, II, TII.get(PPC::ADDI8), MI.getOperand(0).getReg())
- .addReg(PPC::X1)
- .addImm(maxCallFrameSize);
- else
- // Implicitly kill the register.
- BuildMI(MBB, II, TII.get(PPC::ADDI8), MI.getOperand(0).getReg())
- .addReg(PPC::X1)
- .addImm(maxCallFrameSize)
- .addReg(MI.getOperand(1).getReg(), false, true, true);
- } else {
- BuildMI(MBB, II, TII.get(PPC::STWUX))
- .addReg(Reg, false, false, true)
- .addReg(PPC::R1)
- .addReg(MI.getOperand(1).getReg());
-
- if (!MI.getOperand(1).isKill())
- BuildMI(MBB, II, TII.get(PPC::ADDI), MI.getOperand(0).getReg())
- .addReg(PPC::R1)
- .addImm(maxCallFrameSize);
- else
- // Implicitly kill the register.
- BuildMI(MBB, II, TII.get(PPC::ADDI), MI.getOperand(0).getReg())
- .addReg(PPC::R1)
- .addImm(maxCallFrameSize)
- .addReg(MI.getOperand(1).getReg(), false, true, true);
- }
-
- // Discard the DYNALLOC instruction.
- MBB.erase(II);
-}
-
-/// lowerCRSpilling - Generate the code for spilling a CR register. Instead of
-/// reserving a whole register (R0), we scrounge for one here. This generates
-/// code like this:
-///
-/// mfcr rA ; Move the conditional register into GPR rA.
-/// rlwinm rA, rA, SB, 0, 31 ; Shift the bits left so they are in CR0's slot.
-/// stw rA, FI ; Store rA to the frame.
-///
-void PPCRegisterInfo::lowerCRSpilling(MachineBasicBlock::iterator II,
- unsigned FrameIndex, int SPAdj,
- RegScavenger *RS) const {
- // Get the instruction.
- MachineInstr &MI = *II; // ; SPILL_CR <SrcReg>, <offset>, <FI>
- // Get the instruction's basic block.
- MachineBasicBlock &MBB = *MI.getParent();
-
- const TargetRegisterClass *G8RC = &PPC::G8RCRegClass;
- const TargetRegisterClass *GPRC = &PPC::GPRCRegClass;
- const TargetRegisterClass *RC = Subtarget.isPPC64() ? G8RC : GPRC;
- unsigned Reg = findScratchRegister(II, RS, RC, SPAdj);
-
- // We need to store the CR in the low 4-bits of the saved value. First, issue
- // an MFCR to save all of the CRBits. Add an implicit kill of the CR.
- if (!MI.getOperand(0).isKill())
- BuildMI(MBB, II, TII.get(PPC::MFCR), Reg);
- else
- // Implicitly kill the CR register.
- BuildMI(MBB, II, TII.get(PPC::MFCR), Reg)
- .addReg(MI.getOperand(0).getReg(), false, true, true);
-
- // If the saved register wasn't CR0, shift the bits left so that they are in
- // CR0's slot.
- unsigned SrcReg = MI.getOperand(0).getReg();
- if (SrcReg != PPC::CR0)
- // rlwinm rA, rA, ShiftBits, 0, 31.
- BuildMI(MBB, II, TII.get(PPC::RLWINM), Reg)
- .addReg(Reg, false, false, true)
- .addImm(PPCRegisterInfo::getRegisterNumbering(SrcReg) * 4)
- .addImm(0)
- .addImm(31);
-
- addFrameReference(BuildMI(MBB, II, TII.get(PPC::STW))
- .addReg(Reg, false, false, MI.getOperand(1).getImm()),
- FrameIndex);
-
- // Discard the pseudo instruction.
- MBB.erase(II);
-}
-
-void PPCRegisterInfo::eliminateFrameIndex(MachineBasicBlock::iterator II,
- int SPAdj, RegScavenger *RS) const {
- assert(SPAdj == 0 && "Unexpected");
-
- // Get the instruction.
- MachineInstr &MI = *II;
- // Get the instruction's basic block.
- MachineBasicBlock &MBB = *MI.getParent();
- // Get the basic block's function.
- MachineFunction &MF = *MBB.getParent();
- // Get the frame info.
- MachineFrameInfo *MFI = MF.getFrameInfo();
-
- // Find out which operand is the frame index.
- unsigned FIOperandNo = 0;
- while (!MI.getOperand(FIOperandNo).isFrameIndex()) {
- ++FIOperandNo;
- assert(FIOperandNo != MI.getNumOperands() &&
- "Instr doesn't have FrameIndex operand!");
- }
- // Take into account whether it's an add or mem instruction
- unsigned OffsetOperandNo = (FIOperandNo == 2) ? 1 : 2;
- if (MI.getOpcode() == TargetInstrInfo::INLINEASM)
- OffsetOperandNo = FIOperandNo-1;
-
- // Get the frame index.
- int FrameIndex = MI.getOperand(FIOperandNo).getIndex();
-
- // Get the frame pointer save index. Users of this index are primarily
- // DYNALLOC instructions.
- PPCFunctionInfo *FI = MF.getInfo<PPCFunctionInfo>();
- int FPSI = FI->getFramePointerSaveIndex();
- // Get the instruction opcode.
- unsigned OpC = MI.getOpcode();
-
- // Special case for dynamic alloca.
- if (FPSI && FrameIndex == FPSI &&
- (OpC == PPC::DYNALLOC || OpC == PPC::DYNALLOC8)) {
- lowerDynamicAlloc(II, SPAdj, RS);
- return;
- }
-
- // Special case for pseudo-op SPILL_CR.
- if (EnableRegisterScavenging) // FIXME (64-bit): Enable by default.
- if (OpC == PPC::SPILL_CR) {
- lowerCRSpilling(II, FrameIndex, SPAdj, RS);
- return;
- }
-
- // Replace the FrameIndex with base register with GPR1 (SP) or GPR31 (FP).
- MI.getOperand(FIOperandNo).ChangeToRegister(hasFP(MF) ? PPC::R31 : PPC::R1,
- false);
-
- // Figure out if the offset in the instruction is shifted right two bits. This
- // is true for instructions like "STD", which the machine implicitly adds two
- // low zeros to.
- bool isIXAddr = false;
- switch (OpC) {
- case PPC::LWA:
- case PPC::LD:
- case PPC::STD:
- case PPC::STD_32:
- isIXAddr = true;
- break;
- }
-
- // Now add the frame object offset to the offset from r1.
- int Offset = MFI->getObjectOffset(FrameIndex);
- if (!isIXAddr)
- Offset += MI.getOperand(OffsetOperandNo).getImm();
- else
- Offset += MI.getOperand(OffsetOperandNo).getImm() << 2;
-
- // If we're not using a Frame Pointer that has been set to the value of the
- // SP before having the stack size subtracted from it, then add the stack size
- // to Offset to get the correct offset.
- Offset += MFI->getStackSize();
-
- // If we can, encode the offset directly into the instruction. If this is a
- // normal PPC "ri" instruction, any 16-bit value can be safely encoded. If
- // this is a PPC64 "ix" instruction, only a 16-bit value with the low two bits
- // clear can be encoded. This is extremely uncommon, because normally you
- // only "std" to a stack slot that is at least 4-byte aligned, but it can
- // happen in invalid code.
- if (isInt16(Offset) && (!isIXAddr || (Offset & 3) == 0)) {
- if (isIXAddr)
- Offset >>= 2; // The actual encoded value has the low two bits zero.
- MI.getOperand(OffsetOperandNo).ChangeToImmediate(Offset);
- return;
- }
-
- // The offset doesn't fit into a single register, scavenge one to build the
- // offset in.
- // FIXME: figure out what SPAdj is doing here.
-
- // FIXME (64-bit): Use "findScratchRegister".
- unsigned SReg;
- if (EnableRegisterScavenging)
- SReg = findScratchRegister(II, RS, &PPC::GPRCRegClass, SPAdj);
- else
- SReg = PPC::R0;
-
- // Insert a set of rA with the full offset value before the ld, st, or add
- BuildMI(MBB, II, TII.get(PPC::LIS), SReg)
- .addImm(Offset >> 16);
- BuildMI(MBB, II, TII.get(PPC::ORI), SReg)
- .addReg(SReg, false, false, true)
- .addImm(Offset);
-
- // Convert into indexed form of the instruction:
- //
- // sth 0:rA, 1:imm 2:(rB) ==> sthx 0:rA, 2:rB, 1:r0
- // addi 0:rA 1:rB, 2, imm ==> add 0:rA, 1:rB, 2:r0
- unsigned OperandBase;
-
- if (OpC != TargetInstrInfo::INLINEASM) {
- assert(ImmToIdxMap.count(OpC) &&
- "No indexed form of load or store available!");
- unsigned NewOpcode = ImmToIdxMap.find(OpC)->second;
- MI.setDesc(TII.get(NewOpcode));
- OperandBase = 1;
- } else {
- OperandBase = OffsetOperandNo;
- }
-
- unsigned StackReg = MI.getOperand(FIOperandNo).getReg();
- MI.getOperand(OperandBase).ChangeToRegister(StackReg, false);
- MI.getOperand(OperandBase + 1).ChangeToRegister(SReg, false);
-}
-
-/// VRRegNo - Map from a numbered VR register to its enum value.
-///
-static const unsigned short VRRegNo[] = {
- PPC::V0 , PPC::V1 , PPC::V2 , PPC::V3 , PPC::V4 , PPC::V5 , PPC::V6 , PPC::V7 ,
- PPC::V8 , PPC::V9 , PPC::V10, PPC::V11, PPC::V12, PPC::V13, PPC::V14, PPC::V15,
- PPC::V16, PPC::V17, PPC::V18, PPC::V19, PPC::V20, PPC::V21, PPC::V22, PPC::V23,
- PPC::V24, PPC::V25, PPC::V26, PPC::V27, PPC::V28, PPC::V29, PPC::V30, PPC::V31
-};
-
-/// RemoveVRSaveCode - We have found that this function does not need any code
-/// to manipulate the VRSAVE register, even though it uses vector registers.
-/// This can happen when the only registers used are known to be live in or out
-/// of the function. Remove all of the VRSAVE related code from the function.
-static void RemoveVRSaveCode(MachineInstr *MI) {
- MachineBasicBlock *Entry = MI->getParent();
- MachineFunction *MF = Entry->getParent();
-
- // We know that the MTVRSAVE instruction immediately follows MI. Remove it.
- MachineBasicBlock::iterator MBBI = MI;
- ++MBBI;
- assert(MBBI != Entry->end() && MBBI->getOpcode() == PPC::MTVRSAVE);
- MBBI->eraseFromParent();
-
- bool RemovedAllMTVRSAVEs = true;
- // See if we can find and remove the MTVRSAVE instruction from all of the
- // epilog blocks.
- for (MachineFunction::iterator I = MF->begin(), E = MF->end(); I != E; ++I) {
- // If last instruction is a return instruction, add an epilogue
- if (!I->empty() && I->back().getDesc().isReturn()) {
- bool FoundIt = false;
- for (MBBI = I->end(); MBBI != I->begin(); ) {
- --MBBI;
- if (MBBI->getOpcode() == PPC::MTVRSAVE) {
- MBBI->eraseFromParent(); // remove it.
- FoundIt = true;
- break;
- }
- }
- RemovedAllMTVRSAVEs &= FoundIt;
- }
- }
-
- // If we found and removed all MTVRSAVE instructions, remove the read of
- // VRSAVE as well.
- if (RemovedAllMTVRSAVEs) {
- MBBI = MI;
- assert(MBBI != Entry->begin() && "UPDATE_VRSAVE is first instr in block?");
- --MBBI;
- assert(MBBI->getOpcode() == PPC::MFVRSAVE && "VRSAVE instrs wandered?");
- MBBI->eraseFromParent();
- }
-
- // Finally, nuke the UPDATE_VRSAVE.
- MI->eraseFromParent();
-}
-
-// HandleVRSaveUpdate - MI is the UPDATE_VRSAVE instruction introduced by the
-// instruction selector. Based on the vector registers that have been used,
-// transform this into the appropriate ORI instruction.
-static void HandleVRSaveUpdate(MachineInstr *MI, const TargetInstrInfo &TII) {
- MachineFunction *MF = MI->getParent()->getParent();
-
- unsigned UsedRegMask = 0;
- for (unsigned i = 0; i != 32; ++i)
- if (MF->getRegInfo().isPhysRegUsed(VRRegNo[i]))
- UsedRegMask |= 1 << (31-i);
-
- // Live in and live out values already must be in the mask, so don't bother
- // marking them.
- for (MachineRegisterInfo::livein_iterator
- I = MF->getRegInfo().livein_begin(),
- E = MF->getRegInfo().livein_end(); I != E; ++I) {
- unsigned RegNo = PPCRegisterInfo::getRegisterNumbering(I->first);
- if (VRRegNo[RegNo] == I->first) // If this really is a vector reg.
- UsedRegMask &= ~(1 << (31-RegNo)); // Doesn't need to be marked.
- }
- for (MachineRegisterInfo::liveout_iterator
- I = MF->getRegInfo().liveout_begin(),
- E = MF->getRegInfo().liveout_end(); I != E; ++I) {
- unsigned RegNo = PPCRegisterInfo::getRegisterNumbering(*I);
- if (VRRegNo[RegNo] == *I) // If this really is a vector reg.
- UsedRegMask &= ~(1 << (31-RegNo)); // Doesn't need to be marked.
- }
-
- // If no registers are used, turn this into a copy.
- if (UsedRegMask == 0) {
- // Remove all VRSAVE code.
- RemoveVRSaveCode(MI);
- return;
- }
-
- unsigned SrcReg = MI->getOperand(1).getReg();
- unsigned DstReg = MI->getOperand(0).getReg();
-
- if ((UsedRegMask & 0xFFFF) == UsedRegMask) {
- if (DstReg != SrcReg)
- BuildMI(*MI->getParent(), MI, TII.get(PPC::ORI), DstReg)
- .addReg(SrcReg)
- .addImm(UsedRegMask);
- else
- BuildMI(*MI->getParent(), MI, TII.get(PPC::ORI), DstReg)
- .addReg(SrcReg, false, false, true)
- .addImm(UsedRegMask);
- } else if ((UsedRegMask & 0xFFFF0000) == UsedRegMask) {
- if (DstReg != SrcReg)
- BuildMI(*MI->getParent(), MI, TII.get(PPC::ORIS), DstReg)
- .addReg(SrcReg)
- .addImm(UsedRegMask >> 16);
- else
- BuildMI(*MI->getParent(), MI, TII.get(PPC::ORIS), DstReg)
- .addReg(SrcReg, false, false, true)
- .addImm(UsedRegMask >> 16);
- } else {
- if (DstReg != SrcReg)
- BuildMI(*MI->getParent(), MI, TII.get(PPC::ORIS), DstReg)
- .addReg(SrcReg)
- .addImm(UsedRegMask >> 16);
- else
- BuildMI(*MI->getParent(), MI, TII.get(PPC::ORIS), DstReg)
- .addReg(SrcReg, false, false, true)
- .addImm(UsedRegMask >> 16);
-
- BuildMI(*MI->getParent(), MI, TII.get(PPC::ORI), DstReg)
- .addReg(DstReg, false, false, true)
- .addImm(UsedRegMask & 0xFFFF);
- }
-
- // Remove the old UPDATE_VRSAVE instruction.
- MI->eraseFromParent();
-}
-
-/// determineFrameLayout - Determine the size of the frame and maximum call
-/// frame size.
-void PPCRegisterInfo::determineFrameLayout(MachineFunction &MF) const {
- MachineFrameInfo *MFI = MF.getFrameInfo();
-
- // Get the number of bytes to allocate from the FrameInfo
- unsigned FrameSize = MFI->getStackSize();
-
- // Get the alignments provided by the target, and the maximum alignment
- // (if any) of the fixed frame objects.
- unsigned MaxAlign = MFI->getMaxAlignment();
- unsigned TargetAlign = MF.getTarget().getFrameInfo()->getStackAlignment();
- unsigned AlignMask = TargetAlign - 1; //
-
- // If we are a leaf function, and use up to 224 bytes of stack space,
- // don't have a frame pointer, calls, or dynamic alloca then we do not need
- // to adjust the stack pointer (we fit in the Red Zone).
- if (FrameSize <= 224 && // Fits in red zone.
- !MFI->hasVarSizedObjects() && // No dynamic alloca.
- !MFI->hasCalls() && // No calls.
- (!ALIGN_STACK || MaxAlign <= TargetAlign)) { // No special alignment.
- // No need for frame
- MFI->setStackSize(0);
- return;
- }
-
- // Get the maximum call frame size of all the calls.
- unsigned maxCallFrameSize = MFI->getMaxCallFrameSize();
-
- // Maximum call frame needs to be at least big enough for linkage and 8 args.
- unsigned minCallFrameSize =
- PPCFrameInfo::getMinCallFrameSize(Subtarget.isPPC64(),
- Subtarget.isMachoABI());
- maxCallFrameSize = std::max(maxCallFrameSize, minCallFrameSize);
-
- // If we have dynamic alloca then maxCallFrameSize needs to be aligned so
- // that allocations will be aligned.
- if (MFI->hasVarSizedObjects())
- maxCallFrameSize = (maxCallFrameSize + AlignMask) & ~AlignMask;
-
- // Update maximum call frame size.
- MFI->setMaxCallFrameSize(maxCallFrameSize);
-
- // Include call frame size in total.
- FrameSize += maxCallFrameSize;
-
- // Make sure the frame is aligned.
- FrameSize = (FrameSize + AlignMask) & ~AlignMask;
-
- // Update frame info.
- MFI->setStackSize(FrameSize);
-}
-
-void
-PPCRegisterInfo::processFunctionBeforeCalleeSavedScan(MachineFunction &MF,
- RegScavenger *RS) const {
- // Save and clear the LR state.
- PPCFunctionInfo *FI = MF.getInfo<PPCFunctionInfo>();
- unsigned LR = getRARegister();
- FI->setUsesLR(MF.getRegInfo().isPhysRegUsed(LR));
- MF.getRegInfo().setPhysRegUnused(LR);
-
- // Save R31 if necessary
- int FPSI = FI->getFramePointerSaveIndex();
- bool IsPPC64 = Subtarget.isPPC64();
- bool IsELF32_ABI = Subtarget.isELF32_ABI();
- bool IsMachoABI = Subtarget.isMachoABI();
- MachineFrameInfo *MFI = MF.getFrameInfo();
-
- // If the frame pointer save index hasn't been defined yet.
- if (!FPSI && (NoFramePointerElim || MFI->hasVarSizedObjects()) &&
- IsELF32_ABI) {
- // Find out what the fix offset of the frame pointer save area.
- int FPOffset = PPCFrameInfo::getFramePointerSaveOffset(IsPPC64,
- IsMachoABI);
- // Allocate the frame index for frame pointer save area.
- FPSI = MF.getFrameInfo()->CreateFixedObject(IsPPC64? 8 : 4, FPOffset);
- // Save the result.
- FI->setFramePointerSaveIndex(FPSI);
- }
-
- // Reserve stack space to move the linkage area to in case of a tail call.
- int TCSPDelta = 0;
- if (PerformTailCallOpt && (TCSPDelta=FI->getTailCallSPDelta()) < 0) {
- int AddFPOffsetAmount = IsELF32_ABI ? -4 : 0;
- MF.getFrameInfo()->CreateFixedObject( -1 * TCSPDelta,
- AddFPOffsetAmount + TCSPDelta);
- }
- // Reserve a slot closest to SP or frame pointer if we have a dynalloc or
- // a large stack, which will require scavenging a register to materialize a
- // large offset.
- // FIXME: this doesn't actually check stack size, so is a bit pessimistic
- // FIXME: doesn't detect whether or not we need to spill vXX, which requires
- // r0 for now.
-
- if (EnableRegisterScavenging) // FIXME (64-bit): Enable.
- if (needsFP(MF) || spillsCR(MF)) {
- const TargetRegisterClass *GPRC = &PPC::GPRCRegClass;
- const TargetRegisterClass *G8RC = &PPC::G8RCRegClass;
- const TargetRegisterClass *RC = IsPPC64 ? G8RC : GPRC;
- RS->setScavengingFrameIndex(MFI->CreateStackObject(RC->getSize(),
- RC->getAlignment()));
- }
-}
-
-void
-PPCRegisterInfo::emitPrologue(MachineFunction &MF) const {
- MachineBasicBlock &MBB = MF.front(); // Prolog goes in entry BB
- MachineBasicBlock::iterator MBBI = MBB.begin();
- MachineFrameInfo *MFI = MF.getFrameInfo();
- MachineModuleInfo *MMI = MFI->getMachineModuleInfo();
- bool needsFrameMoves = (MMI && MMI->hasDebugInfo()) ||
- !MF.getFunction()->doesNotThrow() ||
- UnwindTablesMandatory;
-
- // Prepare for frame info.
- unsigned FrameLabelId = 0;
-
- // Scan the prolog, looking for an UPDATE_VRSAVE instruction. If we find it,
- // process it.
- for (unsigned i = 0; MBBI != MBB.end(); ++i, ++MBBI) {
- if (MBBI->getOpcode() == PPC::UPDATE_VRSAVE) {
- HandleVRSaveUpdate(MBBI, TII);
- break;
- }
- }
-
- // Move MBBI back to the beginning of the function.
- MBBI = MBB.begin();
-
- // Work out frame sizes.
- determineFrameLayout(MF);
- unsigned FrameSize = MFI->getStackSize();
-
- int NegFrameSize = -FrameSize;
-
- // Get processor type.
- bool IsPPC64 = Subtarget.isPPC64();
- // Get operating system
- bool IsMachoABI = Subtarget.isMachoABI();
- // Check if the link register (LR) has been used.
- bool UsesLR = MustSaveLR(MF);
- // Do we have a frame pointer for this function?
- bool HasFP = hasFP(MF) && FrameSize;
-
- int LROffset = PPCFrameInfo::getReturnSaveOffset(IsPPC64, IsMachoABI);
- int FPOffset = PPCFrameInfo::getFramePointerSaveOffset(IsPPC64, IsMachoABI);
-
- if (IsPPC64) {
- if (UsesLR)
- BuildMI(MBB, MBBI, TII.get(PPC::MFLR8), PPC::X0);
-
- if (HasFP)
- BuildMI(MBB, MBBI, TII.get(PPC::STD))
- .addReg(PPC::X31)
- .addImm(FPOffset/4)
- .addReg(PPC::X1);
-
- if (UsesLR)
- BuildMI(MBB, MBBI, TII.get(PPC::STD))
- .addReg(PPC::X0)
- .addImm(LROffset / 4)
- .addReg(PPC::X1);
- } else {
- if (UsesLR)
- BuildMI(MBB, MBBI, TII.get(PPC::MFLR), PPC::R0);
-
- if (HasFP)
- BuildMI(MBB, MBBI, TII.get(PPC::STW))
- .addReg(PPC::R31)
- .addImm(FPOffset)
- .addReg(PPC::R1);
-
- if (UsesLR)
- BuildMI(MBB, MBBI, TII.get(PPC::STW))
- .addReg(PPC::R0)
- .addImm(LROffset)
- .addReg(PPC::R1);
- }
-
- // Skip if a leaf routine.
- if (!FrameSize) return;
-
- // Get stack alignments.
- unsigned TargetAlign = MF.getTarget().getFrameInfo()->getStackAlignment();
- unsigned MaxAlign = MFI->getMaxAlignment();
-
- if (needsFrameMoves) {
- // Mark effective beginning of when frame pointer becomes valid.
- FrameLabelId = MMI->NextLabelID();
- BuildMI(MBB, MBBI, TII.get(PPC::LABEL)).addImm(FrameLabelId).addImm(0);
- }
-
- // Adjust stack pointer: r1 += NegFrameSize.
- // If there is a preferred stack alignment, align R1 now
- if (!IsPPC64) {
- // PPC32.
- if (ALIGN_STACK && MaxAlign > TargetAlign) {
- assert(isPowerOf2_32(MaxAlign)&&isInt16(MaxAlign)&&"Invalid alignment!");
- assert(isInt16(NegFrameSize) && "Unhandled stack size and alignment!");
-
- BuildMI(MBB, MBBI, TII.get(PPC::RLWINM), PPC::R0)
- .addReg(PPC::R1)
- .addImm(0)
- .addImm(32 - Log2_32(MaxAlign))
- .addImm(31);
- BuildMI(MBB, MBBI, TII.get(PPC::SUBFIC) ,PPC::R0)
- .addReg(PPC::R0, false, false, true)
- .addImm(NegFrameSize);
- BuildMI(MBB, MBBI, TII.get(PPC::STWUX))
- .addReg(PPC::R1)
- .addReg(PPC::R1)
- .addReg(PPC::R0);
- } else if (isInt16(NegFrameSize)) {
- BuildMI(MBB, MBBI, TII.get(PPC::STWU), PPC::R1)
- .addReg(PPC::R1)
- .addImm(NegFrameSize)
- .addReg(PPC::R1);
- } else {
- BuildMI(MBB, MBBI, TII.get(PPC::LIS), PPC::R0)
- .addImm(NegFrameSize >> 16);
- BuildMI(MBB, MBBI, TII.get(PPC::ORI), PPC::R0)
- .addReg(PPC::R0, false, false, true)
- .addImm(NegFrameSize & 0xFFFF);
- BuildMI(MBB, MBBI, TII.get(PPC::STWUX))
- .addReg(PPC::R1)
- .addReg(PPC::R1)
- .addReg(PPC::R0);
- }
- } else { // PPC64.
- if (ALIGN_STACK && MaxAlign > TargetAlign) {
- assert(isPowerOf2_32(MaxAlign)&&isInt16(MaxAlign)&&"Invalid alignment!");
- assert(isInt16(NegFrameSize) && "Unhandled stack size and alignment!");
-
- BuildMI(MBB, MBBI, TII.get(PPC::RLDICL), PPC::X0)
- .addReg(PPC::X1)
- .addImm(0)
- .addImm(64 - Log2_32(MaxAlign));
- BuildMI(MBB, MBBI, TII.get(PPC::SUBFIC8), PPC::X0)
- .addReg(PPC::X0)
- .addImm(NegFrameSize);
- BuildMI(MBB, MBBI, TII.get(PPC::STDUX))
- .addReg(PPC::X1)
- .addReg(PPC::X1)
- .addReg(PPC::X0);
- } else if (isInt16(NegFrameSize)) {
- BuildMI(MBB, MBBI, TII.get(PPC::STDU), PPC::X1)
- .addReg(PPC::X1)
- .addImm(NegFrameSize / 4)
- .addReg(PPC::X1);
- } else {
- BuildMI(MBB, MBBI, TII.get(PPC::LIS8), PPC::X0)
- .addImm(NegFrameSize >> 16);
- BuildMI(MBB, MBBI, TII.get(PPC::ORI8), PPC::X0)
- .addReg(PPC::X0, false, false, true)
- .addImm(NegFrameSize & 0xFFFF);
- BuildMI(MBB, MBBI, TII.get(PPC::STDUX))
- .addReg(PPC::X1)
- .addReg(PPC::X1)
- .addReg(PPC::X0);
- }
- }
-
- if (needsFrameMoves) {
- std::vector<MachineMove> &Moves = MMI->getFrameMoves();
-
- if (NegFrameSize) {
- // Show update of SP.
- MachineLocation SPDst(MachineLocation::VirtualFP);
- MachineLocation SPSrc(MachineLocation::VirtualFP, NegFrameSize);
- Moves.push_back(MachineMove(FrameLabelId, SPDst, SPSrc));
- } else {
- MachineLocation SP(IsPPC64 ? PPC::X31 : PPC::R31);
- Moves.push_back(MachineMove(FrameLabelId, SP, SP));
- }
-
- if (HasFP) {
- MachineLocation FPDst(MachineLocation::VirtualFP, FPOffset);
- MachineLocation FPSrc(IsPPC64 ? PPC::X31 : PPC::R31);
- Moves.push_back(MachineMove(FrameLabelId, FPDst, FPSrc));
- }
-
- // Add callee saved registers to move list.
- const std::vector<CalleeSavedInfo> &CSI = MFI->getCalleeSavedInfo();
- for (unsigned I = 0, E = CSI.size(); I != E; ++I) {
- int Offset = MFI->getObjectOffset(CSI[I].getFrameIdx());
- unsigned Reg = CSI[I].getReg();
- if (Reg == PPC::LR || Reg == PPC::LR8) continue;
- MachineLocation CSDst(MachineLocation::VirtualFP, Offset);
- MachineLocation CSSrc(Reg);
- Moves.push_back(MachineMove(FrameLabelId, CSDst, CSSrc));
- }
-
- MachineLocation LRDst(MachineLocation::VirtualFP, LROffset);
- MachineLocation LRSrc(IsPPC64 ? PPC::LR8 : PPC::LR);
- Moves.push_back(MachineMove(FrameLabelId, LRDst, LRSrc));
-
- // Mark effective beginning of when frame pointer is ready.
- unsigned ReadyLabelId = MMI->NextLabelID();
- BuildMI(MBB, MBBI, TII.get(PPC::LABEL)).addImm(ReadyLabelId).addImm(0);
-
- MachineLocation FPDst(HasFP ? (IsPPC64 ? PPC::X31 : PPC::R31) :
- (IsPPC64 ? PPC::X1 : PPC::R1));
- MachineLocation FPSrc(MachineLocation::VirtualFP);
- Moves.push_back(MachineMove(ReadyLabelId, FPDst, FPSrc));
- }
-
- // If there is a frame pointer, copy R1 into R31
- if (HasFP) {
- if (!IsPPC64) {
- BuildMI(MBB, MBBI, TII.get(PPC::OR), PPC::R31)
- .addReg(PPC::R1)
- .addReg(PPC::R1);
- } else {
- BuildMI(MBB, MBBI, TII.get(PPC::OR8), PPC::X31)
- .addReg(PPC::X1)
- .addReg(PPC::X1);
- }
- }
-}
-
-void PPCRegisterInfo::emitEpilogue(MachineFunction &MF,
- MachineBasicBlock &MBB) const {
- MachineBasicBlock::iterator MBBI = prior(MBB.end());
- unsigned RetOpcode = MBBI->getOpcode();
-
- assert( (RetOpcode == PPC::BLR ||
- RetOpcode == PPC::TCRETURNri ||
- RetOpcode == PPC::TCRETURNdi ||
- RetOpcode == PPC::TCRETURNai ||
- RetOpcode == PPC::TCRETURNri8 ||
- RetOpcode == PPC::TCRETURNdi8 ||
- RetOpcode == PPC::TCRETURNai8) &&
- "Can only insert epilog into returning blocks");
-
- // Get alignment info so we know how to restore r1
- const MachineFrameInfo *MFI = MF.getFrameInfo();
- unsigned TargetAlign = MF.getTarget().getFrameInfo()->getStackAlignment();
- unsigned MaxAlign = MFI->getMaxAlignment();
-
- // Get the number of bytes allocated from the FrameInfo.
- int FrameSize = MFI->getStackSize();
-
- // Get processor type.
- bool IsPPC64 = Subtarget.isPPC64();
- // Get operating system
- bool IsMachoABI = Subtarget.isMachoABI();
- // Check if the link register (LR) has been used.
- bool UsesLR = MustSaveLR(MF);
- // Do we have a frame pointer for this function?
- bool HasFP = hasFP(MF) && FrameSize;
-
- int LROffset = PPCFrameInfo::getReturnSaveOffset(IsPPC64, IsMachoABI);
- int FPOffset = PPCFrameInfo::getFramePointerSaveOffset(IsPPC64, IsMachoABI);
-
- bool UsesTCRet = RetOpcode == PPC::TCRETURNri ||
- RetOpcode == PPC::TCRETURNdi ||
- RetOpcode == PPC::TCRETURNai ||
- RetOpcode == PPC::TCRETURNri8 ||
- RetOpcode == PPC::TCRETURNdi8 ||
- RetOpcode == PPC::TCRETURNai8;
-
- PPCFunctionInfo *FI = MF.getInfo<PPCFunctionInfo>();
-
- if (UsesTCRet) {
- int MaxTCRetDelta = FI->getTailCallSPDelta();
- MachineOperand &StackAdjust = MBBI->getOperand(1);
- assert( StackAdjust.isImmediate() && "Expecting immediate value.");
- // Adjust stack pointer.
- int StackAdj = StackAdjust.getImm();
- int Delta = StackAdj - MaxTCRetDelta;
- assert((Delta >= 0) && "Delta must be positive");
- if (MaxTCRetDelta>0)
- FrameSize += (StackAdj +Delta);
- else
- FrameSize += StackAdj;
- }
-
- if (FrameSize) {
- // The loaded (or persistent) stack pointer value is offset by the 'stwu'
- // on entry to the function. Add this offset back now.
- if (!IsPPC64) {
- // If this function contained a fastcc call and PerformTailCallOpt is
- // enabled (=> hasFastCall()==true) the fastcc call might contain a tail
- // call which invalidates the stack pointer value in SP(0). So we use the
- // value of R31 in this case.
- if (FI->hasFastCall() && isInt16(FrameSize)) {
- assert(hasFP(MF) && "Expecting a valid the frame pointer.");
- BuildMI(MBB, MBBI, TII.get(PPC::ADDI), PPC::R1)
- .addReg(PPC::R31).addImm(FrameSize);
- } else if(FI->hasFastCall()) {
- BuildMI(MBB, MBBI, TII.get(PPC::LIS), PPC::R0)
- .addImm(FrameSize >> 16);
- BuildMI(MBB, MBBI, TII.get(PPC::ORI), PPC::R0)
- .addReg(PPC::R0, false, false, true)
- .addImm(FrameSize & 0xFFFF);
- BuildMI(MBB, MBBI, TII.get(PPC::ADD4))
- .addReg(PPC::R1)
- .addReg(PPC::R31)
- .addReg(PPC::R0);
- } else if (isInt16(FrameSize) &&
- (!ALIGN_STACK || TargetAlign >= MaxAlign) &&
- !MFI->hasVarSizedObjects()) {
- BuildMI(MBB, MBBI, TII.get(PPC::ADDI), PPC::R1)
- .addReg(PPC::R1).addImm(FrameSize);
- } else {
- BuildMI(MBB, MBBI, TII.get(PPC::LWZ),PPC::R1).addImm(0).addReg(PPC::R1);
- }
- } else {
- if (FI->hasFastCall() && isInt16(FrameSize)) {
- assert(hasFP(MF) && "Expecting a valid the frame pointer.");
- BuildMI(MBB, MBBI, TII.get(PPC::ADDI8), PPC::X1)
- .addReg(PPC::X31).addImm(FrameSize);
- } else if(FI->hasFastCall()) {
- BuildMI(MBB, MBBI, TII.get(PPC::LIS8), PPC::X0)
- .addImm(FrameSize >> 16);
- BuildMI(MBB, MBBI, TII.get(PPC::ORI8), PPC::X0)
- .addReg(PPC::X0, false, false, true)
- .addImm(FrameSize & 0xFFFF);
- BuildMI(MBB, MBBI, TII.get(PPC::ADD8))
- .addReg(PPC::X1)
- .addReg(PPC::X31)
- .addReg(PPC::X0);
- } else if (isInt16(FrameSize) && TargetAlign >= MaxAlign &&
- !MFI->hasVarSizedObjects()) {
- BuildMI(MBB, MBBI, TII.get(PPC::ADDI8), PPC::X1)
- .addReg(PPC::X1).addImm(FrameSize);
- } else {
- BuildMI(MBB, MBBI, TII.get(PPC::LD), PPC::X1).addImm(0).addReg(PPC::X1);
- }
- }
- }
-
- if (IsPPC64) {
- if (UsesLR)
- BuildMI(MBB, MBBI, TII.get(PPC::LD), PPC::X0)
- .addImm(LROffset/4).addReg(PPC::X1);
-
- if (HasFP)
- BuildMI(MBB, MBBI, TII.get(PPC::LD), PPC::X31)
- .addImm(FPOffset/4).addReg(PPC::X1);
-
- if (UsesLR)
- BuildMI(MBB, MBBI, TII.get(PPC::MTLR8)).addReg(PPC::X0);
- } else {
- if (UsesLR)
- BuildMI(MBB, MBBI, TII.get(PPC::LWZ), PPC::R0)
- .addImm(LROffset).addReg(PPC::R1);
-
- if (HasFP)
- BuildMI(MBB, MBBI, TII.get(PPC::LWZ), PPC::R31)
- .addImm(FPOffset).addReg(PPC::R1);
-
- if (UsesLR)
- BuildMI(MBB, MBBI, TII.get(PPC::MTLR)).addReg(PPC::R0);
- }
-
- // Callee pop calling convention. Pop parameter/linkage area. Used for tail
- // call optimization
- if (PerformTailCallOpt && RetOpcode == PPC::BLR &&
- MF.getFunction()->getCallingConv() == CallingConv::Fast) {
- PPCFunctionInfo *FI = MF.getInfo<PPCFunctionInfo>();
- unsigned CallerAllocatedAmt = FI->getMinReservedArea();
- unsigned StackReg = IsPPC64 ? PPC::X1 : PPC::R1;
- unsigned FPReg = IsPPC64 ? PPC::X31 : PPC::R31;
- unsigned TmpReg = IsPPC64 ? PPC::X0 : PPC::R0;
- unsigned ADDIInstr = IsPPC64 ? PPC::ADDI8 : PPC::ADDI;
- unsigned ADDInstr = IsPPC64 ? PPC::ADD8 : PPC::ADD4;
- unsigned LISInstr = IsPPC64 ? PPC::LIS8 : PPC::LIS;
- unsigned ORIInstr = IsPPC64 ? PPC::ORI8 : PPC::ORI;
-
- if (CallerAllocatedAmt && isInt16(CallerAllocatedAmt)) {
- BuildMI(MBB, MBBI, TII.get(ADDIInstr), StackReg)
- .addReg(StackReg).addImm(CallerAllocatedAmt);
- } else {
- BuildMI(MBB, MBBI, TII.get(LISInstr), TmpReg)
- .addImm(CallerAllocatedAmt >> 16);
- BuildMI(MBB, MBBI, TII.get(ORIInstr), TmpReg)
- .addReg(TmpReg, false, false, true)
- .addImm(CallerAllocatedAmt & 0xFFFF);
- BuildMI(MBB, MBBI, TII.get(ADDInstr))
- .addReg(StackReg)
- .addReg(FPReg)
- .addReg(TmpReg);
- }
- } else if (RetOpcode == PPC::TCRETURNdi) {
- MBBI = prior(MBB.end());
- MachineOperand &JumpTarget = MBBI->getOperand(0);
- BuildMI(MBB, MBBI, TII.get(PPC::TAILB)).
- addGlobalAddress(JumpTarget.getGlobal(), JumpTarget.getOffset());
- } else if (RetOpcode == PPC::TCRETURNri) {
- MBBI = prior(MBB.end());
- MachineOperand &JumpTarget = MBBI->getOperand(0);
- assert(JumpTarget.isReg() && "Expecting register operand.");
- BuildMI(MBB, MBBI, TII.get(PPC::TAILBCTR));
- } else if (RetOpcode == PPC::TCRETURNai) {
- MBBI = prior(MBB.end());
- MachineOperand &JumpTarget = MBBI->getOperand(0);
- BuildMI(MBB, MBBI, TII.get(PPC::TAILBA)).addImm(JumpTarget.getImm());
- } else if (RetOpcode == PPC::TCRETURNdi8) {
- MBBI = prior(MBB.end());
- MachineOperand &JumpTarget = MBBI->getOperand(0);
- BuildMI(MBB, MBBI, TII.get(PPC::TAILB8)).
- addGlobalAddress(JumpTarget.getGlobal(), JumpTarget.getOffset());
- } else if (RetOpcode == PPC::TCRETURNri8) {
- MBBI = prior(MBB.end());
- MachineOperand &JumpTarget = MBBI->getOperand(0);
- assert(JumpTarget.isReg() && "Expecting register operand.");
- BuildMI(MBB, MBBI, TII.get(PPC::TAILBCTR8));
- } else if (RetOpcode == PPC::TCRETURNai8) {
- MBBI = prior(MBB.end());
- MachineOperand &JumpTarget = MBBI->getOperand(0);
- BuildMI(MBB, MBBI, TII.get(PPC::TAILBA8)).addImm(JumpTarget.getImm());
- }
-}
-
-unsigned PPCRegisterInfo::getRARegister() const {
- return !Subtarget.isPPC64() ? PPC::LR : PPC::LR8;
-}
-
-unsigned PPCRegisterInfo::getFrameRegister(MachineFunction &MF) const {
- if (!Subtarget.isPPC64())
- return hasFP(MF) ? PPC::R31 : PPC::R1;
- else
- return hasFP(MF) ? PPC::X31 : PPC::X1;
-}
-
-void PPCRegisterInfo::getInitialFrameState(std::vector<MachineMove> &Moves)
- const {
- // Initial state of the frame pointer is R1.
- MachineLocation Dst(MachineLocation::VirtualFP);
- MachineLocation Src(PPC::R1, 0);
- Moves.push_back(MachineMove(0, Dst, Src));
-}
-
-unsigned PPCRegisterInfo::getEHExceptionRegister() const {
- return !Subtarget.isPPC64() ? PPC::R3 : PPC::X3;
-}
-
-unsigned PPCRegisterInfo::getEHHandlerRegister() const {
- return !Subtarget.isPPC64() ? PPC::R4 : PPC::X4;
-}
-
-int PPCRegisterInfo::getDwarfRegNum(unsigned RegNum, bool isEH) const {
- // FIXME: Most probably dwarf numbers differs for Linux and Darwin
- return PPCGenRegisterInfo::getDwarfRegNumFull(RegNum, 0);
-}
-
-#include "PPCGenRegisterInfo.inc"
-
diff --git a/release_23/lib/Target/PowerPC/PPCRegisterInfo.h b/release_23/lib/Target/PowerPC/PPCRegisterInfo.h
deleted file mode 100644
index c56fed6c496d..000000000000
--- a/release_23/lib/Target/PowerPC/PPCRegisterInfo.h
+++ /dev/null
@@ -1,91 +0,0 @@
-//===- PPCRegisterInfo.h - PowerPC Register Information Impl -----*- C++ -*-==//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains the PowerPC implementation of the TargetRegisterInfo
-// class.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef POWERPC32_REGISTERINFO_H
-#define POWERPC32_REGISTERINFO_H
-
-#include "PPC.h"
-#include "PPCGenRegisterInfo.h.inc"
-#include <map>
-
-namespace llvm {
-class PPCSubtarget;
-class TargetInstrInfo;
-class Type;
-
-class PPCRegisterInfo : public PPCGenRegisterInfo {
- std::map<unsigned, unsigned> ImmToIdxMap;
- const PPCSubtarget &Subtarget;
- const TargetInstrInfo &TII;
-public:
- PPCRegisterInfo(const PPCSubtarget &SubTarget, const TargetInstrInfo &tii);
-
- /// getRegisterNumbering - Given the enum value for some register, e.g.
- /// PPC::F14, return the number that it corresponds to (e.g. 14).
- static unsigned getRegisterNumbering(unsigned RegEnum);
-
- /// Code Generation virtual methods...
- const unsigned *getCalleeSavedRegs(const MachineFunction* MF = 0) const;
-
- const TargetRegisterClass* const*
- getCalleeSavedRegClasses(const MachineFunction *MF = 0) const;
-
- BitVector getReservedRegs(const MachineFunction &MF) const;
-
- /// targetHandlesStackFrameRounding - Returns true if the target is
- /// responsible for rounding up the stack frame (probably at emitPrologue
- /// time).
- bool targetHandlesStackFrameRounding() const { return true; }
-
- /// requiresRegisterScavenging - We require a register scavenger.
- /// FIXME (64-bit): Should be inlined.
- bool requiresRegisterScavenging(const MachineFunction &MF) const;
-
- bool hasFP(const MachineFunction &MF) const;
-
- void eliminateCallFramePseudoInstr(MachineFunction &MF,
- MachineBasicBlock &MBB,
- MachineBasicBlock::iterator I) const;
-
- void lowerDynamicAlloc(MachineBasicBlock::iterator II,
- int SPAdj, RegScavenger *RS) const;
- void lowerCRSpilling(MachineBasicBlock::iterator II, unsigned FrameIndex,
- int SPAdj, RegScavenger *RS) const;
- void eliminateFrameIndex(MachineBasicBlock::iterator II,
- int SPAdj, RegScavenger *RS = NULL) const;
-
- /// determineFrameLayout - Determine the size of the frame and maximum call
- /// frame size.
- void determineFrameLayout(MachineFunction &MF) const;
-
- void processFunctionBeforeCalleeSavedScan(MachineFunction &MF,
- RegScavenger *RS = NULL) const;
- void emitPrologue(MachineFunction &MF) const;
- void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const;
-
- // Debug information queries.
- unsigned getRARegister() const;
- unsigned getFrameRegister(MachineFunction &MF) const;
- void getInitialFrameState(std::vector<MachineMove> &Moves) const;
-
- // Exception handling queries.
- unsigned getEHExceptionRegister() const;
- unsigned getEHHandlerRegister() const;
-
- int getDwarfRegNum(unsigned RegNum, bool isEH) const;
-};
-
-} // end namespace llvm
-
-#endif
diff --git a/release_23/lib/Target/PowerPC/PPCRegisterInfo.td b/release_23/lib/Target/PowerPC/PPCRegisterInfo.td
deleted file mode 100644
index 86a8c5cef852..000000000000
--- a/release_23/lib/Target/PowerPC/PPCRegisterInfo.td
+++ /dev/null
@@ -1,351 +0,0 @@
-//===- PPCRegisterInfo.td - The PowerPC Register File ------*- tablegen -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-//
-//===----------------------------------------------------------------------===//
-
-class PPCReg<string n> : Register<n> {
- let Namespace = "PPC";
-}
-
-// We identify all our registers with a 5-bit ID, for consistency's sake.
-
-// GPR - One of the 32 32-bit general-purpose registers
-class GPR<bits<5> num, string n> : PPCReg<n> {
- field bits<5> Num = num;
-}
-
-// GP8 - One of the 32 64-bit general-purpose registers
-class GP8<GPR SubReg, string n> : PPCReg<SubReg.AsmName> {
- field bits<5> Num = SubReg.Num;
- let SubRegs = [SubReg];
- let Name = n;
-}
-
-// SPR - One of the 32-bit special-purpose registers
-class SPR<bits<10> num, string n> : PPCReg<n> {
- field bits<10> Num = num;
-}
-
-// FPR - One of the 32 64-bit floating-point registers
-class FPR<bits<5> num, string n> : PPCReg<n> {
- field bits<5> Num = num;
-}
-
-// VR - One of the 32 128-bit vector registers
-class VR<bits<5> num, string n> : PPCReg<n> {
- field bits<5> Num = num;
-}
-
-// CR - One of the 8 4-bit condition registers
-class CR<bits<3> num, string n> : PPCReg<n> {
- field bits<3> Num = num;
-}
-
-// CRBIT - One of the 32 1-bit condition register fields
-class CRBIT<bits<5> num, string n> : PPCReg<n> {
- field bits<5> Num = num;
-}
-
-
-// General-purpose registers
-def R0 : GPR< 0, "r0">, DwarfRegNum<[0]>;
-def R1 : GPR< 1, "r1">, DwarfRegNum<[1]>;
-def R2 : GPR< 2, "r2">, DwarfRegNum<[2]>;
-def R3 : GPR< 3, "r3">, DwarfRegNum<[3]>;
-def R4 : GPR< 4, "r4">, DwarfRegNum<[4]>;
-def R5 : GPR< 5, "r5">, DwarfRegNum<[5]>;
-def R6 : GPR< 6, "r6">, DwarfRegNum<[6]>;
-def R7 : GPR< 7, "r7">, DwarfRegNum<[7]>;
-def R8 : GPR< 8, "r8">, DwarfRegNum<[8]>;
-def R9 : GPR< 9, "r9">, DwarfRegNum<[9]>;
-def R10 : GPR<10, "r10">, DwarfRegNum<[10]>;
-def R11 : GPR<11, "r11">, DwarfRegNum<[11]>;
-def R12 : GPR<12, "r12">, DwarfRegNum<[12]>;
-def R13 : GPR<13, "r13">, DwarfRegNum<[13]>;
-def R14 : GPR<14, "r14">, DwarfRegNum<[14]>;
-def R15 : GPR<15, "r15">, DwarfRegNum<[15]>;
-def R16 : GPR<16, "r16">, DwarfRegNum<[16]>;
-def R17 : GPR<17, "r17">, DwarfRegNum<[17]>;
-def R18 : GPR<18, "r18">, DwarfRegNum<[18]>;
-def R19 : GPR<19, "r19">, DwarfRegNum<[19]>;
-def R20 : GPR<20, "r20">, DwarfRegNum<[20]>;
-def R21 : GPR<21, "r21">, DwarfRegNum<[21]>;
-def R22 : GPR<22, "r22">, DwarfRegNum<[22]>;
-def R23 : GPR<23, "r23">, DwarfRegNum<[23]>;
-def R24 : GPR<24, "r24">, DwarfRegNum<[24]>;
-def R25 : GPR<25, "r25">, DwarfRegNum<[25]>;
-def R26 : GPR<26, "r26">, DwarfRegNum<[26]>;
-def R27 : GPR<27, "r27">, DwarfRegNum<[27]>;
-def R28 : GPR<28, "r28">, DwarfRegNum<[28]>;
-def R29 : GPR<29, "r29">, DwarfRegNum<[29]>;
-def R30 : GPR<30, "r30">, DwarfRegNum<[30]>;
-def R31 : GPR<31, "r31">, DwarfRegNum<[31]>;
-
-// 64-bit General-purpose registers
-def X0 : GP8< R0, "x0">, DwarfRegNum<[0]>;
-def X1 : GP8< R1, "x1">, DwarfRegNum<[1]>;
-def X2 : GP8< R2, "x2">, DwarfRegNum<[2]>;
-def X3 : GP8< R3, "x3">, DwarfRegNum<[3]>;
-def X4 : GP8< R4, "x4">, DwarfRegNum<[4]>;
-def X5 : GP8< R5, "x5">, DwarfRegNum<[5]>;
-def X6 : GP8< R6, "x6">, DwarfRegNum<[6]>;
-def X7 : GP8< R7, "x7">, DwarfRegNum<[7]>;
-def X8 : GP8< R8, "x8">, DwarfRegNum<[8]>;
-def X9 : GP8< R9, "x9">, DwarfRegNum<[9]>;
-def X10 : GP8<R10, "x10">, DwarfRegNum<[10]>;
-def X11 : GP8<R11, "x11">, DwarfRegNum<[11]>;
-def X12 : GP8<R12, "x12">, DwarfRegNum<[12]>;
-def X13 : GP8<R13, "x13">, DwarfRegNum<[13]>;
-def X14 : GP8<R14, "x14">, DwarfRegNum<[14]>;
-def X15 : GP8<R15, "x15">, DwarfRegNum<[15]>;
-def X16 : GP8<R16, "x16">, DwarfRegNum<[16]>;
-def X17 : GP8<R17, "x17">, DwarfRegNum<[17]>;
-def X18 : GP8<R18, "x18">, DwarfRegNum<[18]>;
-def X19 : GP8<R19, "x19">, DwarfRegNum<[19]>;
-def X20 : GP8<R20, "x20">, DwarfRegNum<[20]>;
-def X21 : GP8<R21, "x21">, DwarfRegNum<[21]>;
-def X22 : GP8<R22, "x22">, DwarfRegNum<[22]>;
-def X23 : GP8<R23, "x23">, DwarfRegNum<[23]>;
-def X24 : GP8<R24, "x24">, DwarfRegNum<[24]>;
-def X25 : GP8<R25, "x25">, DwarfRegNum<[25]>;
-def X26 : GP8<R26, "x26">, DwarfRegNum<[26]>;
-def X27 : GP8<R27, "x27">, DwarfRegNum<[27]>;
-def X28 : GP8<R28, "x28">, DwarfRegNum<[28]>;
-def X29 : GP8<R29, "x29">, DwarfRegNum<[29]>;
-def X30 : GP8<R30, "x30">, DwarfRegNum<[30]>;
-def X31 : GP8<R31, "x31">, DwarfRegNum<[31]>;
-
-// Floating-point registers
-def F0 : FPR< 0, "f0">, DwarfRegNum<[32]>;
-def F1 : FPR< 1, "f1">, DwarfRegNum<[33]>;
-def F2 : FPR< 2, "f2">, DwarfRegNum<[34]>;
-def F3 : FPR< 3, "f3">, DwarfRegNum<[35]>;
-def F4 : FPR< 4, "f4">, DwarfRegNum<[36]>;
-def F5 : FPR< 5, "f5">, DwarfRegNum<[37]>;
-def F6 : FPR< 6, "f6">, DwarfRegNum<[38]>;
-def F7 : FPR< 7, "f7">, DwarfRegNum<[39]>;
-def F8 : FPR< 8, "f8">, DwarfRegNum<[40]>;
-def F9 : FPR< 9, "f9">, DwarfRegNum<[41]>;
-def F10 : FPR<10, "f10">, DwarfRegNum<[42]>;
-def F11 : FPR<11, "f11">, DwarfRegNum<[43]>;
-def F12 : FPR<12, "f12">, DwarfRegNum<[44]>;
-def F13 : FPR<13, "f13">, DwarfRegNum<[45]>;
-def F14 : FPR<14, "f14">, DwarfRegNum<[46]>;
-def F15 : FPR<15, "f15">, DwarfRegNum<[47]>;
-def F16 : FPR<16, "f16">, DwarfRegNum<[48]>;
-def F17 : FPR<17, "f17">, DwarfRegNum<[49]>;
-def F18 : FPR<18, "f18">, DwarfRegNum<[50]>;
-def F19 : FPR<19, "f19">, DwarfRegNum<[51]>;
-def F20 : FPR<20, "f20">, DwarfRegNum<[52]>;
-def F21 : FPR<21, "f21">, DwarfRegNum<[53]>;
-def F22 : FPR<22, "f22">, DwarfRegNum<[54]>;
-def F23 : FPR<23, "f23">, DwarfRegNum<[55]>;
-def F24 : FPR<24, "f24">, DwarfRegNum<[56]>;
-def F25 : FPR<25, "f25">, DwarfRegNum<[57]>;
-def F26 : FPR<26, "f26">, DwarfRegNum<[58]>;
-def F27 : FPR<27, "f27">, DwarfRegNum<[59]>;
-def F28 : FPR<28, "f28">, DwarfRegNum<[60]>;
-def F29 : FPR<29, "f29">, DwarfRegNum<[61]>;
-def F30 : FPR<30, "f30">, DwarfRegNum<[62]>;
-def F31 : FPR<31, "f31">, DwarfRegNum<[63]>;
-
-// Vector registers
-def V0 : VR< 0, "v0">, DwarfRegNum<[77]>;
-def V1 : VR< 1, "v1">, DwarfRegNum<[78]>;
-def V2 : VR< 2, "v2">, DwarfRegNum<[79]>;
-def V3 : VR< 3, "v3">, DwarfRegNum<[80]>;
-def V4 : VR< 4, "v4">, DwarfRegNum<[81]>;
-def V5 : VR< 5, "v5">, DwarfRegNum<[82]>;
-def V6 : VR< 6, "v6">, DwarfRegNum<[83]>;
-def V7 : VR< 7, "v7">, DwarfRegNum<[84]>;
-def V8 : VR< 8, "v8">, DwarfRegNum<[85]>;
-def V9 : VR< 9, "v9">, DwarfRegNum<[86]>;
-def V10 : VR<10, "v10">, DwarfRegNum<[87]>;
-def V11 : VR<11, "v11">, DwarfRegNum<[88]>;
-def V12 : VR<12, "v12">, DwarfRegNum<[89]>;
-def V13 : VR<13, "v13">, DwarfRegNum<[90]>;
-def V14 : VR<14, "v14">, DwarfRegNum<[91]>;
-def V15 : VR<15, "v15">, DwarfRegNum<[92]>;
-def V16 : VR<16, "v16">, DwarfRegNum<[93]>;
-def V17 : VR<17, "v17">, DwarfRegNum<[94]>;
-def V18 : VR<18, "v18">, DwarfRegNum<[95]>;
-def V19 : VR<19, "v19">, DwarfRegNum<[96]>;
-def V20 : VR<20, "v20">, DwarfRegNum<[97]>;
-def V21 : VR<21, "v21">, DwarfRegNum<[98]>;
-def V22 : VR<22, "v22">, DwarfRegNum<[99]>;
-def V23 : VR<23, "v23">, DwarfRegNum<[100]>;
-def V24 : VR<24, "v24">, DwarfRegNum<[101]>;
-def V25 : VR<25, "v25">, DwarfRegNum<[102]>;
-def V26 : VR<26, "v26">, DwarfRegNum<[103]>;
-def V27 : VR<27, "v27">, DwarfRegNum<[104]>;
-def V28 : VR<28, "v28">, DwarfRegNum<[105]>;
-def V29 : VR<29, "v29">, DwarfRegNum<[106]>;
-def V30 : VR<30, "v30">, DwarfRegNum<[107]>;
-def V31 : VR<31, "v31">, DwarfRegNum<[108]>;
-
-// Condition registers
-def CR0 : CR<0, "cr0">, DwarfRegNum<[68]>;
-def CR1 : CR<1, "cr1">, DwarfRegNum<[69]>;
-def CR2 : CR<2, "cr2">, DwarfRegNum<[70]>;
-def CR3 : CR<3, "cr3">, DwarfRegNum<[71]>;
-def CR4 : CR<4, "cr4">, DwarfRegNum<[72]>;
-def CR5 : CR<5, "cr5">, DwarfRegNum<[73]>;
-def CR6 : CR<6, "cr6">, DwarfRegNum<[74]>;
-def CR7 : CR<7, "cr7">, DwarfRegNum<[75]>;
-
-// Condition register bits
-def CR0LT : CRBIT< 0, "0">, DwarfRegNum<[0]>;
-def CR0GT : CRBIT< 1, "1">, DwarfRegNum<[0]>;
-def CR0EQ : CRBIT< 2, "2">, DwarfRegNum<[0]>;
-def CR0UN : CRBIT< 3, "3">, DwarfRegNum<[0]>;
-def CR1LT : CRBIT< 4, "4">, DwarfRegNum<[0]>;
-def CR1GT : CRBIT< 5, "5">, DwarfRegNum<[0]>;
-def CR1EQ : CRBIT< 6, "6">, DwarfRegNum<[0]>;
-def CR1UN : CRBIT< 7, "7">, DwarfRegNum<[0]>;
-def CR2LT : CRBIT< 8, "8">, DwarfRegNum<[0]>;
-def CR2GT : CRBIT< 9, "9">, DwarfRegNum<[0]>;
-def CR2EQ : CRBIT<10, "10">, DwarfRegNum<[0]>;
-def CR2UN : CRBIT<11, "11">, DwarfRegNum<[0]>;
-def CR3LT : CRBIT<12, "12">, DwarfRegNum<[0]>;
-def CR3GT : CRBIT<13, "13">, DwarfRegNum<[0]>;
-def CR3EQ : CRBIT<14, "14">, DwarfRegNum<[0]>;
-def CR3UN : CRBIT<15, "15">, DwarfRegNum<[0]>;
-def CR4LT : CRBIT<16, "16">, DwarfRegNum<[0]>;
-def CR4GT : CRBIT<17, "17">, DwarfRegNum<[0]>;
-def CR4EQ : CRBIT<18, "18">, DwarfRegNum<[0]>;
-def CR4UN : CRBIT<19, "19">, DwarfRegNum<[0]>;
-def CR5LT : CRBIT<20, "20">, DwarfRegNum<[0]>;
-def CR5GT : CRBIT<21, "21">, DwarfRegNum<[0]>;
-def CR5EQ : CRBIT<22, "22">, DwarfRegNum<[0]>;
-def CR5UN : CRBIT<23, "23">, DwarfRegNum<[0]>;
-def CR6LT : CRBIT<24, "24">, DwarfRegNum<[0]>;
-def CR6GT : CRBIT<25, "25">, DwarfRegNum<[0]>;
-def CR6EQ : CRBIT<26, "26">, DwarfRegNum<[0]>;
-def CR6UN : CRBIT<27, "27">, DwarfRegNum<[0]>;
-def CR7LT : CRBIT<28, "28">, DwarfRegNum<[0]>;
-def CR7GT : CRBIT<29, "29">, DwarfRegNum<[0]>;
-def CR7EQ : CRBIT<30, "30">, DwarfRegNum<[0]>;
-def CR7UN : CRBIT<31, "31">, DwarfRegNum<[0]>;
-
-def : SubRegSet<1, [CR0, CR1, CR2, CR3, CR4, CR5, CR6, CR7],
- [CR0LT, CR1LT, CR2LT, CR3LT, CR4LT, CR5LT, CR6LT, CR7LT]>;
-def : SubRegSet<2, [CR0, CR1, CR2, CR3, CR4, CR5, CR6, CR7],
- [CR0GT, CR1GT, CR2GT, CR3GT, CR4GT, CR5GT, CR6GT, CR7GT]>;
-def : SubRegSet<3, [CR0, CR1, CR2, CR3, CR4, CR5, CR6, CR7],
- [CR0EQ, CR1EQ, CR2EQ, CR3EQ, CR4EQ, CR5EQ, CR6EQ, CR7EQ]>;
-def : SubRegSet<4, [CR0, CR1, CR2, CR3, CR4, CR5, CR6, CR7],
- [CR0UN, CR1UN, CR2UN, CR3UN, CR4UN, CR5UN, CR6UN, CR7UN]>;
-
-// Link register
-def LR : SPR<8, "lr">, DwarfRegNum<[65]>;
-//let Aliases = [LR] in
-def LR8 : SPR<8, "lr">, DwarfRegNum<[65]>;
-
-// Count register
-def CTR : SPR<9, "ctr">, DwarfRegNum<[66]>;
-def CTR8 : SPR<9, "ctr">, DwarfRegNum<[66]>;
-
-// VRsave register
-def VRSAVE: SPR<256, "VRsave">, DwarfRegNum<[107]>;
-
-/// Register classes
-// Allocate volatiles first
-// then nonvolatiles in reverse order since stmw/lmw save from rN to r31
-def GPRC : RegisterClass<"PPC", [i32], 32,
- [R2, R3, R4, R5, R6, R7, R8, R9, R10, R11, R12,
- R30, R29, R28, R27, R26, R25, R24, R23, R22, R21, R20, R19, R18, R17,
- R16, R15, R14, R13, R31, R0, R1, LR]>
-{
- let MethodProtos = [{
- iterator allocation_order_begin(const MachineFunction &MF) const;
- iterator allocation_order_end(const MachineFunction &MF) const;
- }];
- let MethodBodies = [{
- GPRCClass::iterator
- GPRCClass::allocation_order_begin(const MachineFunction &MF) const {
- // In Linux, r2 is reserved for the OS.
- if (!MF.getTarget().getSubtarget<PPCSubtarget>().isDarwin())
- return begin()+1;
-
- return begin();
- }
- GPRCClass::iterator
- GPRCClass::allocation_order_end(const MachineFunction &MF) const {
- // On PPC64, r13 is the thread pointer. Never allocate this register.
- // Note that this is overconservative, as it also prevents allocation of
- // R31 when the FP is not needed.
- if (MF.getTarget().getSubtarget<PPCSubtarget>().isPPC64())
- return end()-5; // don't allocate R13, R31, R0, R1, LR
-
- if (needsFP(MF))
- return end()-4; // don't allocate R31, R0, R1, LR
- else
- return end()-3; // don't allocate R0, R1, LR
- }
- }];
-}
-def G8RC : RegisterClass<"PPC", [i64], 64,
- [X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12,
- X30, X29, X28, X27, X26, X25, X24, X23, X22, X21, X20, X19, X18, X17,
- X16, X15, X14, X31, X13, X0, X1, LR8]>
-{
- let MethodProtos = [{
- iterator allocation_order_begin(const MachineFunction &MF) const;
- iterator allocation_order_end(const MachineFunction &MF) const;
- }];
- let MethodBodies = [{
- G8RCClass::iterator
- G8RCClass::allocation_order_begin(const MachineFunction &MF) const {
- return begin();
- }
- G8RCClass::iterator
- G8RCClass::allocation_order_end(const MachineFunction &MF) const {
- if (needsFP(MF))
- return end()-5;
- else
- return end()-4;
- }
- }];
-}
-
-
-
-def F8RC : RegisterClass<"PPC", [f64], 64, [F0, F1, F2, F3, F4, F5, F6, F7,
- F8, F9, F10, F11, F12, F13, F14, F15, F16, F17, F18, F19, F20, F21,
- F22, F23, F24, F25, F26, F27, F28, F29, F30, F31]>;
-def F4RC : RegisterClass<"PPC", [f32], 32, [F0, F1, F2, F3, F4, F5, F6, F7,
- F8, F9, F10, F11, F12, F13, F14, F15, F16, F17, F18, F19, F20, F21,
- F22, F23, F24, F25, F26, F27, F28, F29, F30, F31]>;
-
-def VRRC : RegisterClass<"PPC", [v16i8,v8i16,v4i32,v4f32], 128,
- [V2, V3, V4, V5, V0, V1,
- V6, V7, V8, V9, V10, V11, V12, V13, V14, V15, V16, V17, V18, V19, V20, V21,
- V22, V23, V24, V25, V26, V27, V28, V29, V30, V31]>;
-
-def CRRC : RegisterClass<"PPC", [i32], 32, [CR0, CR1, CR5, CR6, CR7, CR2,
- CR3, CR4]>;
-
-def CRBITRC : RegisterClass<"PPC", [i32], 32,
- [CR0LT, CR0GT, CR0EQ, CR0UN,
- CR1LT, CR1GT, CR1EQ, CR1UN,
- CR2LT, CR2GT, CR2EQ, CR2UN,
- CR3LT, CR3GT, CR3EQ, CR3UN,
- CR4LT, CR4GT, CR4EQ, CR4UN,
- CR5LT, CR5GT, CR5EQ, CR5UN,
- CR6LT, CR6GT, CR6EQ, CR6UN,
- CR7LT, CR7GT, CR7EQ, CR7UN
- ]>
-{
- let CopyCost = -1;
-}
-
-
-def CTRRC : RegisterClass<"PPC", [i32], 32, [CTR]>;
-def CTRRC8 : RegisterClass<"PPC", [i64], 64, [CTR8]>;
diff --git a/release_23/lib/Target/PowerPC/PPCRelocations.h b/release_23/lib/Target/PowerPC/PPCRelocations.h
deleted file mode 100644
index a33e7e03370c..000000000000
--- a/release_23/lib/Target/PowerPC/PPCRelocations.h
+++ /dev/null
@@ -1,56 +0,0 @@
-//===- PPCRelocations.h - PPC32 Code Relocations ----------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines the PowerPC 32-bit target-specific relocation types.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef PPC32RELOCATIONS_H
-#define PPC32RELOCATIONS_H
-
-#include "llvm/CodeGen/MachineRelocation.h"
-
-// Hack to rid us of a PPC pre-processor symbol which is erroneously
-// defined in a PowerPC header file (bug in Linux/PPC)
-#ifdef PPC
-#undef PPC
-#endif
-
-namespace llvm {
- namespace PPC {
- enum RelocationType {
- // reloc_vanilla - A standard relocation, where the address of the
- // relocated object completely overwrites the address of the relocation.
- reloc_vanilla,
-
- // reloc_pcrel_bx - PC relative relocation, for the b or bl instructions.
- reloc_pcrel_bx,
-
- // reloc_pcrel_bcx - PC relative relocation, for BLT,BLE,BEQ,BGE,BGT,BNE,
- // and other bcx instructions.
- reloc_pcrel_bcx,
-
- // reloc_absolute_high - Absolute relocation, for the loadhi instruction
- // (which is really addis). Add the high 16-bits of the specified global
- // address into the low 16-bits of the instruction.
- reloc_absolute_high,
-
- // reloc_absolute_low - Absolute relocation, for the la instruction (which
- // is really an addi). Add the low 16-bits of the specified global
- // address into the low 16-bits of the instruction.
- reloc_absolute_low,
-
- // reloc_absolute_low_ix - Absolute relocation for the 64-bit load/store
- // instruction which have two implicit zero bits.
- reloc_absolute_low_ix
- };
- }
-}
-
-#endif
diff --git a/release_23/lib/Target/PowerPC/PPCSchedule.td b/release_23/lib/Target/PowerPC/PPCSchedule.td
deleted file mode 100644
index d589414c0154..000000000000
--- a/release_23/lib/Target/PowerPC/PPCSchedule.td
+++ /dev/null
@@ -1,508 +0,0 @@
-//===- PPCSchedule.td - PowerPC Scheduling Definitions -----*- tablegen -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-//===----------------------------------------------------------------------===//
-// Functional units across PowerPC chips sets
-//
-def BPU : FuncUnit; // Branch unit
-def SLU : FuncUnit; // Store/load unit
-def SRU : FuncUnit; // special register unit
-def IU1 : FuncUnit; // integer unit 1 (simple)
-def IU2 : FuncUnit; // integer unit 2 (complex)
-def IU3 : FuncUnit; // integer unit 3 (7450 simple)
-def IU4 : FuncUnit; // integer unit 4 (7450 simple)
-def FPU1 : FuncUnit; // floating point unit 1
-def FPU2 : FuncUnit; // floating point unit 2
-def VPU : FuncUnit; // vector permutation unit
-def VIU1 : FuncUnit; // vector integer unit 1 (simple)
-def VIU2 : FuncUnit; // vector integer unit 2 (complex)
-def VFPU : FuncUnit; // vector floating point unit
-
-
-//===----------------------------------------------------------------------===//
-// Instruction Itinerary classes used for PowerPC
-//
-def IntGeneral : InstrItinClass;
-def IntCompare : InstrItinClass;
-def IntDivD : InstrItinClass;
-def IntDivW : InstrItinClass;
-def IntMFFS : InstrItinClass;
-def IntMFVSCR : InstrItinClass;
-def IntMTFSB0 : InstrItinClass;
-def IntMTSRD : InstrItinClass;
-def IntMulHD : InstrItinClass;
-def IntMulHW : InstrItinClass;
-def IntMulHWU : InstrItinClass;
-def IntMulLI : InstrItinClass;
-def IntRFID : InstrItinClass;
-def IntRotateD : InstrItinClass;
-def IntRotate : InstrItinClass;
-def IntShift : InstrItinClass;
-def IntTrapD : InstrItinClass;
-def IntTrapW : InstrItinClass;
-def BrB : InstrItinClass;
-def BrCR : InstrItinClass;
-def BrMCR : InstrItinClass;
-def BrMCRX : InstrItinClass;
-def LdStDCBA : InstrItinClass;
-def LdStDCBF : InstrItinClass;
-def LdStDCBI : InstrItinClass;
-def LdStGeneral : InstrItinClass;
-def LdStDSS : InstrItinClass;
-def LdStICBI : InstrItinClass;
-def LdStUX : InstrItinClass;
-def LdStLD : InstrItinClass;
-def LdStLDARX : InstrItinClass;
-def LdStLFD : InstrItinClass;
-def LdStLFDU : InstrItinClass;
-def LdStLHA : InstrItinClass;
-def LdStLMW : InstrItinClass;
-def LdStLVecX : InstrItinClass;
-def LdStLWA : InstrItinClass;
-def LdStLWARX : InstrItinClass;
-def LdStSLBIA : InstrItinClass;
-def LdStSLBIE : InstrItinClass;
-def LdStSTD : InstrItinClass;
-def LdStSTDCX : InstrItinClass;
-def LdStSTVEBX : InstrItinClass;
-def LdStSTWCX : InstrItinClass;
-def LdStSync : InstrItinClass;
-def SprISYNC : InstrItinClass;
-def SprMFSR : InstrItinClass;
-def SprMTMSR : InstrItinClass;
-def SprMTSR : InstrItinClass;
-def SprTLBSYNC : InstrItinClass;
-def SprMFCR : InstrItinClass;
-def SprMFMSR : InstrItinClass;
-def SprMFSPR : InstrItinClass;
-def SprMFTB : InstrItinClass;
-def SprMTSPR : InstrItinClass;
-def SprMTSRIN : InstrItinClass;
-def SprRFI : InstrItinClass;
-def SprSC : InstrItinClass;
-def FPGeneral : InstrItinClass;
-def FPCompare : InstrItinClass;
-def FPDivD : InstrItinClass;
-def FPDivS : InstrItinClass;
-def FPFused : InstrItinClass;
-def FPRes : InstrItinClass;
-def FPSqrt : InstrItinClass;
-def VecGeneral : InstrItinClass;
-def VecFP : InstrItinClass;
-def VecFPCompare : InstrItinClass;
-def VecComplex : InstrItinClass;
-def VecPerm : InstrItinClass;
-def VecFPRound : InstrItinClass;
-def VecVSL : InstrItinClass;
-def VecVSR : InstrItinClass;
-
-//===----------------------------------------------------------------------===//
-// Processor instruction itineraries.
-
-include "PPCScheduleG3.td"
-include "PPCScheduleG4.td"
-include "PPCScheduleG4Plus.td"
-include "PPCScheduleG5.td"
-
-//===----------------------------------------------------------------------===//
-// Instruction to itinerary class map - When add new opcodes to the supported
-// set, refer to the following table to determine which itinerary class the
-// opcode belongs.
-//
-// opcode itinerary class
-// ====== ===============
-// add IntGeneral
-// addc IntGeneral
-// adde IntGeneral
-// addi IntGeneral
-// addic IntGeneral
-// addic. IntGeneral
-// addis IntGeneral
-// addme IntGeneral
-// addze IntGeneral
-// and IntGeneral
-// andc IntGeneral
-// andi. IntGeneral
-// andis. IntGeneral
-// b BrB
-// bc BrB
-// bcctr BrB
-// bclr BrB
-// cmp IntCompare
-// cmpi IntCompare
-// cmpl IntCompare
-// cmpli IntCompare
-// cntlzd IntRotateD
-// cntlzw IntGeneral
-// crand BrCR
-// crandc BrCR
-// creqv BrCR
-// crnand BrCR
-// crnor BrCR
-// cror BrCR
-// crorc BrCR
-// crxor BrCR
-// dcba LdStDCBA
-// dcbf LdStDCBF
-// dcbi LdStDCBI
-// dcbst LdStDCBF
-// dcbt LdStGeneral
-// dcbtst LdStGeneral
-// dcbz LdStDCBF
-// divd IntDivD
-// divdu IntDivD
-// divw IntDivW
-// divwu IntDivW
-// dss LdStDSS
-// dst LdStDSS
-// dstst LdStDSS
-// eciwx LdStGeneral
-// ecowx LdStGeneral
-// eieio LdStGeneral
-// eqv IntGeneral
-// extsb IntGeneral
-// extsh IntGeneral
-// extsw IntRotateD
-// fabs FPGeneral
-// fadd FPGeneral
-// fadds FPGeneral
-// fcfid FPGeneral
-// fcmpo FPCompare
-// fcmpu FPCompare
-// fctid FPGeneral
-// fctidz FPGeneral
-// fctiw FPGeneral
-// fctiwz FPGeneral
-// fdiv FPDivD
-// fdivs FPDivS
-// fmadd FPFused
-// fmadds FPGeneral
-// fmr FPGeneral
-// fmsub FPFused
-// fmsubs FPGeneral
-// fmul FPFused
-// fmuls FPGeneral
-// fnabs FPGeneral
-// fneg FPGeneral
-// fnmadd FPFused
-// fnmadds FPGeneral
-// fnmsub FPFused
-// fnmsubs FPGeneral
-// fres FPRes
-// frsp FPGeneral
-// frsqrte FPGeneral
-// fsel FPGeneral
-// fsqrt FPSqrt
-// fsqrts FPSqrt
-// fsub FPGeneral
-// fsubs FPGeneral
-// icbi LdStICBI
-// isync SprISYNC
-// lbz LdStGeneral
-// lbzu LdStGeneral
-// lbzux LdStUX
-// lbzx LdStGeneral
-// ld LdStLD
-// ldarx LdStLDARX
-// ldu LdStLD
-// ldux LdStLD
-// ldx LdStLD
-// lfd LdStLFD
-// lfdu LdStLFDU
-// lfdux LdStLFDU
-// lfdx LdStLFDU
-// lfs LdStLFDU
-// lfsu LdStLFDU
-// lfsux LdStLFDU
-// lfsx LdStLFDU
-// lha LdStLHA
-// lhau LdStLHA
-// lhaux LdStLHA
-// lhax LdStLHA
-// lhbrx LdStGeneral
-// lhz LdStGeneral
-// lhzu LdStGeneral
-// lhzux LdStUX
-// lhzx LdStGeneral
-// lmw LdStLMW
-// lswi LdStLMW
-// lswx LdStLMW
-// lvebx LdStLVecX
-// lvehx LdStLVecX
-// lvewx LdStLVecX
-// lvsl LdStLVecX
-// lvsr LdStLVecX
-// lvx LdStLVecX
-// lvxl LdStLVecX
-// lwa LdStLWA
-// lwarx LdStLWARX
-// lwaux LdStLHA
-// lwax LdStLHA
-// lwbrx LdStGeneral
-// lwz LdStGeneral
-// lwzu LdStGeneral
-// lwzux LdStUX
-// lwzx LdStGeneral
-// mcrf BrMCR
-// mcrfs FPGeneral
-// mcrxr BrMCRX
-// mfcr SprMFCR
-// mffs IntMFFS
-// mfmsr SprMFMSR
-// mfspr SprMFSPR
-// mfsr SprMFSR
-// mfsrin SprMFSR
-// mftb SprMFTB
-// mfvscr IntMFVSCR
-// mtcrf BrMCRX
-// mtfsb0 IntMTFSB0
-// mtfsb1 IntMTFSB0
-// mtfsf IntMTFSB0
-// mtfsfi IntMTFSB0
-// mtmsr SprMTMSR
-// mtmsrd LdStLD
-// mtspr SprMTSPR
-// mtsr SprMTSR
-// mtsrd IntMTSRD
-// mtsrdin IntMTSRD
-// mtsrin SprMTSRIN
-// mtvscr IntMFVSCR
-// mulhd IntMulHD
-// mulhdu IntMulHD
-// mulhw IntMulHW
-// mulhwu IntMulHWU
-// mulld IntMulHD
-// mulli IntMulLI
-// mullw IntMulHW
-// nand IntGeneral
-// neg IntGeneral
-// nor IntGeneral
-// or IntGeneral
-// orc IntGeneral
-// ori IntGeneral
-// oris IntGeneral
-// rfi SprRFI
-// rfid IntRFID
-// rldcl IntRotateD
-// rldcr IntRotateD
-// rldic IntRotateD
-// rldicl IntRotateD
-// rldicr IntRotateD
-// rldimi IntRotateD
-// rlwimi IntRotate
-// rlwinm IntGeneral
-// rlwnm IntGeneral
-// sc SprSC
-// slbia LdStSLBIA
-// slbie LdStSLBIE
-// sld IntRotateD
-// slw IntGeneral
-// srad IntRotateD
-// sradi IntRotateD
-// sraw IntShift
-// srawi IntShift
-// srd IntRotateD
-// srw IntGeneral
-// stb LdStGeneral
-// stbu LdStGeneral
-// stbux LdStGeneral
-// stbx LdStGeneral
-// std LdStSTD
-// stdcx. LdStSTDCX
-// stdu LdStSTD
-// stdux LdStSTD
-// stdx LdStSTD
-// stfd LdStUX
-// stfdu LdStUX
-// stfdux LdStUX
-// stfdx LdStUX
-// stfiwx LdStUX
-// stfs LdStUX
-// stfsu LdStUX
-// stfsux LdStUX
-// stfsx LdStUX
-// sth LdStGeneral
-// sthbrx LdStGeneral
-// sthu LdStGeneral
-// sthux LdStGeneral
-// sthx LdStGeneral
-// stmw LdStLMW
-// stswi LdStLMW
-// stswx LdStLMW
-// stvebx LdStSTVEBX
-// stvehx LdStSTVEBX
-// stvewx LdStSTVEBX
-// stvx LdStSTVEBX
-// stvxl LdStSTVEBX
-// stw LdStGeneral
-// stwbrx LdStGeneral
-// stwcx. LdStSTWCX
-// stwu LdStGeneral
-// stwux LdStGeneral
-// stwx LdStGeneral
-// subf IntGeneral
-// subfc IntGeneral
-// subfe IntGeneral
-// subfic IntGeneral
-// subfme IntGeneral
-// subfze IntGeneral
-// sync LdStSync
-// td IntTrapD
-// tdi IntTrapD
-// tlbia LdStSLBIA
-// tlbie LdStDCBF
-// tlbsync SprTLBSYNC
-// tw IntTrapW
-// twi IntTrapW
-// vaddcuw VecGeneral
-// vaddfp VecFP
-// vaddsbs VecGeneral
-// vaddshs VecGeneral
-// vaddsws VecGeneral
-// vaddubm VecGeneral
-// vaddubs VecGeneral
-// vadduhm VecGeneral
-// vadduhs VecGeneral
-// vadduwm VecGeneral
-// vadduws VecGeneral
-// vand VecGeneral
-// vandc VecGeneral
-// vavgsb VecGeneral
-// vavgsh VecGeneral
-// vavgsw VecGeneral
-// vavgub VecGeneral
-// vavguh VecGeneral
-// vavguw VecGeneral
-// vcfsx VecFP
-// vcfux VecFP
-// vcmpbfp VecFPCompare
-// vcmpeqfp VecFPCompare
-// vcmpequb VecGeneral
-// vcmpequh VecGeneral
-// vcmpequw VecGeneral
-// vcmpgefp VecFPCompare
-// vcmpgtfp VecFPCompare
-// vcmpgtsb VecGeneral
-// vcmpgtsh VecGeneral
-// vcmpgtsw VecGeneral
-// vcmpgtub VecGeneral
-// vcmpgtuh VecGeneral
-// vcmpgtuw VecGeneral
-// vctsxs VecFP
-// vctuxs VecFP
-// vexptefp VecFP
-// vlogefp VecFP
-// vmaddfp VecFP
-// vmaxfp VecFPCompare
-// vmaxsb VecGeneral
-// vmaxsh VecGeneral
-// vmaxsw VecGeneral
-// vmaxub VecGeneral
-// vmaxuh VecGeneral
-// vmaxuw VecGeneral
-// vmhaddshs VecComplex
-// vmhraddshs VecComplex
-// vminfp VecFPCompare
-// vminsb VecGeneral
-// vminsh VecGeneral
-// vminsw VecGeneral
-// vminub VecGeneral
-// vminuh VecGeneral
-// vminuw VecGeneral
-// vmladduhm VecComplex
-// vmrghb VecPerm
-// vmrghh VecPerm
-// vmrghw VecPerm
-// vmrglb VecPerm
-// vmrglh VecPerm
-// vmrglw VecPerm
-// vmsubfp VecFP
-// vmsummbm VecComplex
-// vmsumshm VecComplex
-// vmsumshs VecComplex
-// vmsumubm VecComplex
-// vmsumuhm VecComplex
-// vmsumuhs VecComplex
-// vmulesb VecComplex
-// vmulesh VecComplex
-// vmuleub VecComplex
-// vmuleuh VecComplex
-// vmulosb VecComplex
-// vmulosh VecComplex
-// vmuloub VecComplex
-// vmulouh VecComplex
-// vnor VecGeneral
-// vor VecGeneral
-// vperm VecPerm
-// vpkpx VecPerm
-// vpkshss VecPerm
-// vpkshus VecPerm
-// vpkswss VecPerm
-// vpkswus VecPerm
-// vpkuhum VecPerm
-// vpkuhus VecPerm
-// vpkuwum VecPerm
-// vpkuwus VecPerm
-// vrefp VecFPRound
-// vrfim VecFPRound
-// vrfin VecFPRound
-// vrfip VecFPRound
-// vrfiz VecFPRound
-// vrlb VecGeneral
-// vrlh VecGeneral
-// vrlw VecGeneral
-// vrsqrtefp VecFP
-// vsel VecGeneral
-// vsl VecVSL
-// vslb VecGeneral
-// vsldoi VecPerm
-// vslh VecGeneral
-// vslo VecPerm
-// vslw VecGeneral
-// vspltb VecPerm
-// vsplth VecPerm
-// vspltisb VecPerm
-// vspltish VecPerm
-// vspltisw VecPerm
-// vspltw VecPerm
-// vsr VecVSR
-// vsrab VecGeneral
-// vsrah VecGeneral
-// vsraw VecGeneral
-// vsrb VecGeneral
-// vsrh VecGeneral
-// vsro VecPerm
-// vsrw VecGeneral
-// vsubcuw VecGeneral
-// vsubfp VecFP
-// vsubsbs VecGeneral
-// vsubshs VecGeneral
-// vsubsws VecGeneral
-// vsububm VecGeneral
-// vsububs VecGeneral
-// vsubuhm VecGeneral
-// vsubuhs VecGeneral
-// vsubuwm VecGeneral
-// vsubuws VecGeneral
-// vsum2sws VecComplex
-// vsum4sbs VecComplex
-// vsum4shs VecComplex
-// vsum4ubs VecComplex
-// vsumsws VecComplex
-// vupkhpx VecPerm
-// vupkhsb VecPerm
-// vupkhsh VecPerm
-// vupklpx VecPerm
-// vupklsb VecPerm
-// vupklsh VecPerm
-// vxor VecGeneral
-// xor IntGeneral
-// xori IntGeneral
-// xoris IntGeneral
-//
diff --git a/release_23/lib/Target/PowerPC/PPCScheduleG3.td b/release_23/lib/Target/PowerPC/PPCScheduleG3.td
deleted file mode 100644
index f72194d6de0e..000000000000
--- a/release_23/lib/Target/PowerPC/PPCScheduleG3.td
+++ /dev/null
@@ -1,63 +0,0 @@
-//===- PPCScheduleG3.td - PPC G3 Scheduling Definitions ----*- tablegen -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines the itinerary class data for the G3 (750) processor.
-//
-//===----------------------------------------------------------------------===//
-
-
-def G3Itineraries : ProcessorItineraries<[
- InstrItinData<IntGeneral , [InstrStage<1, [IU1, IU2]>]>,
- InstrItinData<IntCompare , [InstrStage<1, [IU1, IU2]>]>,
- InstrItinData<IntDivW , [InstrStage<19, [IU1]>]>,
- InstrItinData<IntMFFS , [InstrStage<1, [FPU1]>]>,
- InstrItinData<IntMTFSB0 , [InstrStage<3, [FPU1]>]>,
- InstrItinData<IntMulHW , [InstrStage<5, [IU1]>]>,
- InstrItinData<IntMulHWU , [InstrStage<6, [IU1]>]>,
- InstrItinData<IntMulLI , [InstrStage<3, [IU1]>]>,
- InstrItinData<IntRotate , [InstrStage<1, [IU1, IU2]>]>,
- InstrItinData<IntShift , [InstrStage<1, [IU1, IU2]>]>,
- InstrItinData<IntTrapW , [InstrStage<2, [IU1, IU2]>]>,
- InstrItinData<BrB , [InstrStage<1, [BPU]>]>,
- InstrItinData<BrCR , [InstrStage<1, [SRU]>]>,
- InstrItinData<BrMCR , [InstrStage<1, [SRU]>]>,
- InstrItinData<BrMCRX , [InstrStage<1, [SRU]>]>,
- InstrItinData<LdStDCBA , [InstrStage<2, [SLU]>]>,
- InstrItinData<LdStDCBF , [InstrStage<3, [SLU]>]>,
- InstrItinData<LdStDCBI , [InstrStage<3, [SLU]>]>,
- InstrItinData<LdStGeneral , [InstrStage<2, [SLU]>]>,
- InstrItinData<LdStICBI , [InstrStage<3, [SLU]>]>,
- InstrItinData<LdStUX , [InstrStage<2, [SLU]>]>,
- InstrItinData<LdStLFD , [InstrStage<2, [SLU]>]>,
- InstrItinData<LdStLFDU , [InstrStage<2, [SLU]>]>,
- InstrItinData<LdStLHA , [InstrStage<2, [SLU]>]>,
- InstrItinData<LdStLMW , [InstrStage<34, [SLU]>]>,
- InstrItinData<LdStLWARX , [InstrStage<3, [SLU]>]>,
- InstrItinData<LdStSTWCX , [InstrStage<8, [SLU]>]>,
- InstrItinData<LdStSync , [InstrStage<3, [SLU]>]>,
- InstrItinData<SprISYNC , [InstrStage<2, [SRU]>]>,
- InstrItinData<SprMFSR , [InstrStage<3, [SRU]>]>,
- InstrItinData<SprMTMSR , [InstrStage<1, [SRU]>]>,
- InstrItinData<SprMTSR , [InstrStage<2, [SRU]>]>,
- InstrItinData<SprTLBSYNC , [InstrStage<3, [SRU]>]>,
- InstrItinData<SprMFCR , [InstrStage<1, [SRU]>]>,
- InstrItinData<SprMFMSR , [InstrStage<1, [SRU]>]>,
- InstrItinData<SprMFSPR , [InstrStage<3, [SRU]>]>,
- InstrItinData<SprMFTB , [InstrStage<3, [SRU]>]>,
- InstrItinData<SprMTSPR , [InstrStage<2, [SRU]>]>,
- InstrItinData<SprMTSRIN , [InstrStage<2, [SRU]>]>,
- InstrItinData<SprRFI , [InstrStage<2, [SRU]>]>,
- InstrItinData<SprSC , [InstrStage<2, [SRU]>]>,
- InstrItinData<FPGeneral , [InstrStage<1, [FPU1]>]>,
- InstrItinData<FPCompare , [InstrStage<1, [FPU1]>]>,
- InstrItinData<FPDivD , [InstrStage<31, [FPU1]>]>,
- InstrItinData<FPDivS , [InstrStage<17, [FPU1]>]>,
- InstrItinData<FPFused , [InstrStage<2, [FPU1]>]>,
- InstrItinData<FPRes , [InstrStage<10, [FPU1]>]>
-]>;
diff --git a/release_23/lib/Target/PowerPC/PPCScheduleG4.td b/release_23/lib/Target/PowerPC/PPCScheduleG4.td
deleted file mode 100644
index 92ed20f17ce5..000000000000
--- a/release_23/lib/Target/PowerPC/PPCScheduleG4.td
+++ /dev/null
@@ -1,73 +0,0 @@
-//===- PPCScheduleG4.td - PPC G4 Scheduling Definitions ----*- tablegen -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines the itinerary class data for the G4 (7400) processor.
-//
-//===----------------------------------------------------------------------===//
-
-def G4Itineraries : ProcessorItineraries<[
- InstrItinData<IntGeneral , [InstrStage<1, [IU1, IU2]>]>,
- InstrItinData<IntCompare , [InstrStage<1, [IU1, IU2]>]>,
- InstrItinData<IntDivW , [InstrStage<19, [IU1]>]>,
- InstrItinData<IntMFFS , [InstrStage<3, [FPU1]>]>,
- InstrItinData<IntMFVSCR , [InstrStage<1, [VIU1]>]>,
- InstrItinData<IntMTFSB0 , [InstrStage<3, [FPU1]>]>,
- InstrItinData<IntMulHW , [InstrStage<5, [IU1]>]>,
- InstrItinData<IntMulHWU , [InstrStage<6, [IU1]>]>,
- InstrItinData<IntMulLI , [InstrStage<3, [IU1]>]>,
- InstrItinData<IntRotate , [InstrStage<1, [IU1, IU2]>]>,
- InstrItinData<IntShift , [InstrStage<1, [IU1, IU2]>]>,
- InstrItinData<IntTrapW , [InstrStage<2, [IU1, IU2]>]>,
- InstrItinData<BrB , [InstrStage<1, [BPU]>]>,
- InstrItinData<BrCR , [InstrStage<1, [SRU]>]>,
- InstrItinData<BrMCR , [InstrStage<1, [SRU]>]>,
- InstrItinData<BrMCRX , [InstrStage<1, [SRU]>]>,
- InstrItinData<LdStDCBF , [InstrStage<2, [SLU]>]>,
- InstrItinData<LdStDCBI , [InstrStage<2, [SLU]>]>,
- InstrItinData<LdStGeneral , [InstrStage<2, [SLU]>]>,
- InstrItinData<LdStDSS , [InstrStage<2, [SLU]>]>,
- InstrItinData<LdStICBI , [InstrStage<2, [SLU]>]>,
- InstrItinData<LdStUX , [InstrStage<2, [SLU]>]>,
- InstrItinData<LdStLFD , [InstrStage<2, [SLU]>]>,
- InstrItinData<LdStLFDU , [InstrStage<2, [SLU]>]>,
- InstrItinData<LdStLHA , [InstrStage<2, [SLU]>]>,
- InstrItinData<LdStLMW , [InstrStage<34, [SLU]>]>,
- InstrItinData<LdStLVecX , [InstrStage<2, [SLU]>]>,
- InstrItinData<LdStLWARX , [InstrStage<3, [SLU]>]>,
- InstrItinData<LdStSTVEBX , [InstrStage<2, [SLU]>]>,
- InstrItinData<LdStSTWCX , [InstrStage<5, [SLU]>]>,
- InstrItinData<LdStSync , [InstrStage<8, [SLU]>]>,
- InstrItinData<SprISYNC , [InstrStage<2, [SRU]>]>,
- InstrItinData<SprMFSR , [InstrStage<3, [SRU]>]>,
- InstrItinData<SprMTMSR , [InstrStage<1, [SRU]>]>,
- InstrItinData<SprMTSR , [InstrStage<2, [SRU]>]>,
- InstrItinData<SprTLBSYNC , [InstrStage<8, [SRU]>]>,
- InstrItinData<SprMFCR , [InstrStage<1, [SRU]>]>,
- InstrItinData<SprMFMSR , [InstrStage<1, [SRU]>]>,
- InstrItinData<SprMFSPR , [InstrStage<3, [SRU]>]>,
- InstrItinData<SprMFTB , [InstrStage<1, [SRU]>]>,
- InstrItinData<SprMTSPR , [InstrStage<2, [SRU]>]>,
- InstrItinData<SprMTSRIN , [InstrStage<2, [SRU]>]>,
- InstrItinData<SprRFI , [InstrStage<2, [SRU]>]>,
- InstrItinData<SprSC , [InstrStage<2, [SRU]>]>,
- InstrItinData<FPGeneral , [InstrStage<1, [FPU1]>]>,
- InstrItinData<FPCompare , [InstrStage<1, [FPU1]>]>,
- InstrItinData<FPDivD , [InstrStage<31, [FPU1]>]>,
- InstrItinData<FPDivS , [InstrStage<17, [FPU1]>]>,
- InstrItinData<FPFused , [InstrStage<1, [FPU1]>]>,
- InstrItinData<FPRes , [InstrStage<10, [FPU1]>]>,
- InstrItinData<VecGeneral , [InstrStage<1, [VIU1]>]>,
- InstrItinData<VecFP , [InstrStage<4, [VFPU]>]>,
- InstrItinData<VecFPCompare, [InstrStage<1, [VIU1]>]>,
- InstrItinData<VecComplex , [InstrStage<3, [VIU2]>]>,
- InstrItinData<VecPerm , [InstrStage<1, [VPU]>]>,
- InstrItinData<VecFPRound , [InstrStage<4, [VFPU]>]>,
- InstrItinData<VecVSL , [InstrStage<1, [VIU1]>]>,
- InstrItinData<VecVSR , [InstrStage<1, [VIU1]>]>
-]>;
diff --git a/release_23/lib/Target/PowerPC/PPCScheduleG4Plus.td b/release_23/lib/Target/PowerPC/PPCScheduleG4Plus.td
deleted file mode 100644
index 7474ba494d10..000000000000
--- a/release_23/lib/Target/PowerPC/PPCScheduleG4Plus.td
+++ /dev/null
@@ -1,76 +0,0 @@
-//===- PPCScheduleG4Plus.td - PPC G4+ Scheduling Defs. -----*- tablegen -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines the itinerary class data for the G4+ (7450) processor.
-//
-//===----------------------------------------------------------------------===//
-
-def G4PlusItineraries : ProcessorItineraries<[
- InstrItinData<IntGeneral , [InstrStage<1, [IU1, IU2, IU3, IU4]>]>,
- InstrItinData<IntCompare , [InstrStage<1, [IU1, IU2, IU3, IU4]>]>,
- InstrItinData<IntDivW , [InstrStage<23, [IU2]>]>,
- InstrItinData<IntMFFS , [InstrStage<5, [FPU1]>]>,
- InstrItinData<IntMFVSCR , [InstrStage<2, [VFPU]>]>,
- InstrItinData<IntMTFSB0 , [InstrStage<5, [FPU1]>]>,
- InstrItinData<IntMulHW , [InstrStage<4, [IU2]>]>,
- InstrItinData<IntMulHWU , [InstrStage<4, [IU2]>]>,
- InstrItinData<IntMulLI , [InstrStage<3, [IU2]>]>,
- InstrItinData<IntRotate , [InstrStage<1, [IU1, IU2, IU3, IU4]>]>,
- InstrItinData<IntShift , [InstrStage<2, [IU1, IU2, IU3, IU4]>]>,
- InstrItinData<IntTrapW , [InstrStage<2, [IU1, IU2, IU3, IU4]>]>,
- InstrItinData<BrB , [InstrStage<1, [BPU]>]>,
- InstrItinData<BrCR , [InstrStage<2, [IU2]>]>,
- InstrItinData<BrMCR , [InstrStage<2, [IU2]>]>,
- InstrItinData<BrMCRX , [InstrStage<2, [IU2]>]>,
- InstrItinData<LdStDCBF , [InstrStage<3, [SLU]>]>,
- InstrItinData<LdStDCBI , [InstrStage<3, [SLU]>]>,
- InstrItinData<LdStGeneral , [InstrStage<3, [SLU]>]>,
- InstrItinData<LdStDSS , [InstrStage<3, [SLU]>]>,
- InstrItinData<LdStICBI , [InstrStage<3, [IU2]>]>,
- InstrItinData<LdStUX , [InstrStage<3, [SLU]>]>,
- InstrItinData<LdStLFD , [InstrStage<4, [SLU]>]>,
- InstrItinData<LdStLFDU , [InstrStage<4, [SLU]>]>,
- InstrItinData<LdStLHA , [InstrStage<3, [SLU]>]>,
- InstrItinData<LdStLMW , [InstrStage<37, [SLU]>]>,
- InstrItinData<LdStLVecX , [InstrStage<3, [SLU]>]>,
- InstrItinData<LdStLWA , [InstrStage<3, [SLU]>]>,
- InstrItinData<LdStLWARX , [InstrStage<3, [SLU]>]>,
- InstrItinData<LdStSTD , [InstrStage<3, [SLU]>]>,
- InstrItinData<LdStSTDCX , [InstrStage<3, [SLU]>]>,
- InstrItinData<LdStSTVEBX , [InstrStage<3, [SLU]>]>,
- InstrItinData<LdStSTWCX , [InstrStage<3, [SLU]>]>,
- InstrItinData<LdStSync , [InstrStage<35, [SLU]>]>,
- InstrItinData<SprISYNC , [InstrStage<0, [IU1, IU2, IU3, IU4]>]>,
- InstrItinData<SprMFSR , [InstrStage<4, [IU2]>]>,
- InstrItinData<SprMTMSR , [InstrStage<2, [IU2]>]>,
- InstrItinData<SprMTSR , [InstrStage<2, [IU2]>]>,
- InstrItinData<SprTLBSYNC , [InstrStage<3, [SLU]>]>,
- InstrItinData<SprMFCR , [InstrStage<2, [IU2]>]>,
- InstrItinData<SprMFMSR , [InstrStage<3, [IU2]>]>,
- InstrItinData<SprMFSPR , [InstrStage<4, [IU2]>]>,
- InstrItinData<SprMFTB , [InstrStage<5, [IU2]>]>,
- InstrItinData<SprMTSPR , [InstrStage<2, [IU2]>]>,
- InstrItinData<SprMTSRIN , [InstrStage<2, [IU2]>]>,
- InstrItinData<SprRFI , [InstrStage<1, [IU1, IU2, IU3, IU4]>]>,
- InstrItinData<SprSC , [InstrStage<0, [IU1, IU2, IU3, IU4]>]>,
- InstrItinData<FPGeneral , [InstrStage<5, [FPU1]>]>,
- InstrItinData<FPCompare , [InstrStage<5, [FPU1]>]>,
- InstrItinData<FPDivD , [InstrStage<35, [FPU1]>]>,
- InstrItinData<FPDivS , [InstrStage<21, [FPU1]>]>,
- InstrItinData<FPFused , [InstrStage<5, [FPU1]>]>,
- InstrItinData<FPRes , [InstrStage<14, [FPU1]>]>,
- InstrItinData<VecGeneral , [InstrStage<1, [VIU1]>]>,
- InstrItinData<VecFP , [InstrStage<4, [VFPU]>]>,
- InstrItinData<VecFPCompare, [InstrStage<2, [VFPU]>]>,
- InstrItinData<VecComplex , [InstrStage<4, [VIU2]>]>,
- InstrItinData<VecPerm , [InstrStage<2, [VPU]>]>,
- InstrItinData<VecFPRound , [InstrStage<4, [VIU1]>]>,
- InstrItinData<VecVSL , [InstrStage<2, [VPU]>]>,
- InstrItinData<VecVSR , [InstrStage<2, [VPU]>]>
-]>;
diff --git a/release_23/lib/Target/PowerPC/PPCScheduleG5.td b/release_23/lib/Target/PowerPC/PPCScheduleG5.td
deleted file mode 100644
index d28214715a76..000000000000
--- a/release_23/lib/Target/PowerPC/PPCScheduleG5.td
+++ /dev/null
@@ -1,83 +0,0 @@
-//===- PPCScheduleG5.td - PPC G5 Scheduling Definitions ----*- tablegen -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines the itinerary class data for the G5 (970) processor.
-//
-//===----------------------------------------------------------------------===//
-
-def G5Itineraries : ProcessorItineraries<[
- InstrItinData<IntGeneral , [InstrStage<2, [IU1, IU2]>]>,
- InstrItinData<IntCompare , [InstrStage<3, [IU1, IU2]>]>,
- InstrItinData<IntDivD , [InstrStage<68, [IU1]>]>,
- InstrItinData<IntDivW , [InstrStage<36, [IU1]>]>,
- InstrItinData<IntMFFS , [InstrStage<6, [IU2]>]>,
- InstrItinData<IntMFVSCR , [InstrStage<1, [VFPU]>]>,
- InstrItinData<IntMTFSB0 , [InstrStage<6, [FPU1, FPU2]>]>,
- InstrItinData<IntMulHD , [InstrStage<7, [IU1, IU2]>]>,
- InstrItinData<IntMulHW , [InstrStage<5, [IU1, IU2]>]>,
- InstrItinData<IntMulHWU , [InstrStage<5, [IU1, IU2]>]>,
- InstrItinData<IntMulLI , [InstrStage<4, [IU1, IU2]>]>,
- InstrItinData<IntRFID , [InstrStage<1, [IU2]>]>,
- InstrItinData<IntRotateD , [InstrStage<2, [IU1, IU2]>]>,
- InstrItinData<IntRotate , [InstrStage<4, [IU1, IU2]>]>,
- InstrItinData<IntShift , [InstrStage<2, [IU1, IU2]>]>,
- InstrItinData<IntTrapD , [InstrStage<1, [IU1, IU2]>]>,
- InstrItinData<IntTrapW , [InstrStage<1, [IU1, IU2]>]>,
- InstrItinData<BrB , [InstrStage<1, [BPU]>]>,
- InstrItinData<BrCR , [InstrStage<4, [BPU]>]>,
- InstrItinData<BrMCR , [InstrStage<2, [BPU]>]>,
- InstrItinData<BrMCRX , [InstrStage<3, [BPU]>]>,
- InstrItinData<LdStDCBF , [InstrStage<3, [SLU]>]>,
- InstrItinData<LdStGeneral , [InstrStage<3, [SLU]>]>,
- InstrItinData<LdStDSS , [InstrStage<10, [SLU]>]>,
- InstrItinData<LdStICBI , [InstrStage<40, [SLU]>]>,
- InstrItinData<LdStUX , [InstrStage<4, [SLU]>]>,
- InstrItinData<LdStLD , [InstrStage<3, [SLU]>]>,
- InstrItinData<LdStLDARX , [InstrStage<11, [SLU]>]>,
- InstrItinData<LdStLFD , [InstrStage<3, [SLU]>]>,
- InstrItinData<LdStLFDU , [InstrStage<5, [SLU]>]>,
- InstrItinData<LdStLHA , [InstrStage<5, [SLU]>]>,
- InstrItinData<LdStLMW , [InstrStage<64, [SLU]>]>,
- InstrItinData<LdStLVecX , [InstrStage<3, [SLU]>]>,
- InstrItinData<LdStLWA , [InstrStage<5, [SLU]>]>,
- InstrItinData<LdStLWARX , [InstrStage<11, [SLU]>]>,
- InstrItinData<LdStSLBIA , [InstrStage<40, [SLU]>]>, // needs work
- InstrItinData<LdStSLBIE , [InstrStage<2, [SLU]>]>,
- InstrItinData<LdStSTD , [InstrStage<3, [SLU]>]>,
- InstrItinData<LdStSTDCX , [InstrStage<11, [SLU]>]>,
- InstrItinData<LdStSTVEBX , [InstrStage<5, [SLU]>]>,
- InstrItinData<LdStSTWCX , [InstrStage<11, [SLU]>]>,
- InstrItinData<LdStSync , [InstrStage<35, [SLU]>]>,
- InstrItinData<SprISYNC , [InstrStage<40, [SLU]>]>, // needs work
- InstrItinData<SprMFSR , [InstrStage<3, [SLU]>]>,
- InstrItinData<SprMTMSR , [InstrStage<3, [SLU]>]>,
- InstrItinData<SprMTSR , [InstrStage<3, [SLU]>]>,
- InstrItinData<SprTLBSYNC , [InstrStage<3, [SLU]>]>,
- InstrItinData<SprMFCR , [InstrStage<2, [IU2]>]>,
- InstrItinData<SprMFMSR , [InstrStage<3, [IU2]>]>,
- InstrItinData<SprMFSPR , [InstrStage<3, [IU2]>]>,
- InstrItinData<SprMFTB , [InstrStage<10, [IU2]>]>,
- InstrItinData<SprMTSPR , [InstrStage<8, [IU2]>]>,
- InstrItinData<SprSC , [InstrStage<1, [IU2]>]>,
- InstrItinData<FPGeneral , [InstrStage<6, [FPU1, FPU2]>]>,
- InstrItinData<FPCompare , [InstrStage<8, [FPU1, FPU2]>]>,
- InstrItinData<FPDivD , [InstrStage<33, [FPU1, FPU2]>]>,
- InstrItinData<FPDivS , [InstrStage<33, [FPU1, FPU2]>]>,
- InstrItinData<FPFused , [InstrStage<6, [FPU1, FPU2]>]>,
- InstrItinData<FPRes , [InstrStage<6, [FPU1, FPU2]>]>,
- InstrItinData<FPSqrt , [InstrStage<40, [FPU1, FPU2]>]>,
- InstrItinData<VecGeneral , [InstrStage<2, [VIU1]>]>,
- InstrItinData<VecFP , [InstrStage<8, [VFPU]>]>,
- InstrItinData<VecFPCompare, [InstrStage<2, [VFPU]>]>,
- InstrItinData<VecComplex , [InstrStage<5, [VIU2]>]>,
- InstrItinData<VecPerm , [InstrStage<3, [VPU]>]>,
- InstrItinData<VecFPRound , [InstrStage<8, [VFPU]>]>,
- InstrItinData<VecVSL , [InstrStage<2, [VIU1]>]>,
- InstrItinData<VecVSR , [InstrStage<3, [VPU]>]>
-]>;
diff --git a/release_23/lib/Target/PowerPC/PPCSubtarget.cpp b/release_23/lib/Target/PowerPC/PPCSubtarget.cpp
deleted file mode 100644
index 6cf6ca6524b7..000000000000
--- a/release_23/lib/Target/PowerPC/PPCSubtarget.cpp
+++ /dev/null
@@ -1,147 +0,0 @@
-//===- PowerPCSubtarget.cpp - PPC Subtarget Information -------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the PPC specific subclass of TargetSubtarget.
-//
-//===----------------------------------------------------------------------===//
-
-#include "PPCSubtarget.h"
-#include "PPC.h"
-#include "llvm/Module.h"
-#include "llvm/Target/TargetMachine.h"
-#include "PPCGenSubtarget.inc"
-using namespace llvm;
-
-#if defined(__APPLE__)
-#include <mach/mach.h>
-#include <mach/mach_host.h>
-#include <mach/host_info.h>
-#include <mach/machine.h>
-
-/// GetCurrentPowerPCFeatures - Returns the current CPUs features.
-static const char *GetCurrentPowerPCCPU() {
- host_basic_info_data_t hostInfo;
- mach_msg_type_number_t infoCount;
-
- infoCount = HOST_BASIC_INFO_COUNT;
- host_info(mach_host_self(), HOST_BASIC_INFO, (host_info_t)&hostInfo,
- &infoCount);
-
- if (hostInfo.cpu_type != CPU_TYPE_POWERPC) return "generic";
-
- switch(hostInfo.cpu_subtype) {
- case CPU_SUBTYPE_POWERPC_601: return "601";
- case CPU_SUBTYPE_POWERPC_602: return "602";
- case CPU_SUBTYPE_POWERPC_603: return "603";
- case CPU_SUBTYPE_POWERPC_603e: return "603e";
- case CPU_SUBTYPE_POWERPC_603ev: return "603ev";
- case CPU_SUBTYPE_POWERPC_604: return "604";
- case CPU_SUBTYPE_POWERPC_604e: return "604e";
- case CPU_SUBTYPE_POWERPC_620: return "620";
- case CPU_SUBTYPE_POWERPC_750: return "750";
- case CPU_SUBTYPE_POWERPC_7400: return "7400";
- case CPU_SUBTYPE_POWERPC_7450: return "7450";
- case CPU_SUBTYPE_POWERPC_970: return "970";
- default: ;
- }
-
- return "generic";
-}
-#endif
-
-
-PPCSubtarget::PPCSubtarget(const TargetMachine &tm, const Module &M,
- const std::string &FS, bool is64Bit)
- : TM(tm)
- , StackAlignment(16)
- , DarwinDirective(PPC::DIR_NONE)
- , IsGigaProcessor(false)
- , Has64BitSupport(false)
- , Use64BitRegs(false)
- , IsPPC64(is64Bit)
- , HasAltivec(false)
- , HasFSQRT(false)
- , HasSTFIWX(false)
- , HasLazyResolverStubs(false)
- , DarwinVers(0) {
-
- // Determine default and user specified characteristics
- std::string CPU = "generic";
-#if defined(__APPLE__)
- CPU = GetCurrentPowerPCCPU();
-#endif
-
- // Parse features string.
- ParseSubtargetFeatures(FS, CPU);
-
- // If we are generating code for ppc64, verify that options make sense.
- if (is64Bit) {
- Has64BitSupport = true;
- // Silently force 64-bit register use on ppc64.
- Use64BitRegs = true;
- }
-
- // If the user requested use of 64-bit regs, but the cpu selected doesn't
- // support it, ignore.
- if (use64BitRegs() && !has64BitSupport())
- Use64BitRegs = false;
-
- // Set the boolean corresponding to the current target triple, or the default
- // if one cannot be determined, to true.
- const std::string &TT = M.getTargetTriple();
- if (TT.length() > 7) {
- // Determine which version of darwin this is.
- size_t DarwinPos = TT.find("-darwin");
- if (DarwinPos != std::string::npos) {
- if (isdigit(TT[DarwinPos+7]))
- DarwinVers = atoi(&TT[DarwinPos+7]);
- else
- DarwinVers = 8; // Minimum supported darwin is Tiger.
- }
- } else if (TT.empty()) {
- // Try to autosense the subtarget from the host compiler.
-#if defined(__APPLE__)
-#if __APPLE_CC__ > 5400
- DarwinVers = 9; // GCC 5400+ is Leopard.
-#else
- DarwinVers = 8; // Minimum supported darwin is Tiger.
-#endif
-#endif
- }
-
- // Set up darwin-specific properties.
- if (isDarwin()) {
- HasLazyResolverStubs = true;
- AsmFlavor = NewMnemonic;
- } else {
- AsmFlavor = OldMnemonic;
- }
-}
-
-/// SetJITMode - This is called to inform the subtarget info that we are
-/// producing code for the JIT.
-void PPCSubtarget::SetJITMode() {
- // JIT mode doesn't want lazy resolver stubs, it knows exactly where
- // everything is. This matters for PPC64, which codegens in PIC mode without
- // stubs.
- HasLazyResolverStubs = false;
-}
-
-
-/// hasLazyResolverStub - Return true if accesses to the specified global have
-/// to go through a dyld lazy resolution stub. This means that an extra load
-/// is required to get the address of the global.
-bool PPCSubtarget::hasLazyResolverStub(const GlobalValue *GV) const {
- // We never hae stubs if HasLazyResolverStubs=false or if in static mode.
- if (!HasLazyResolverStubs || TM.getRelocationModel() == Reloc::Static)
- return false;
-
- return GV->hasWeakLinkage() || GV->hasLinkOnceLinkage() ||
- (GV->isDeclaration() && !GV->hasNotBeenReadFromBitcode());
-}
diff --git a/release_23/lib/Target/PowerPC/PPCSubtarget.h b/release_23/lib/Target/PowerPC/PPCSubtarget.h
deleted file mode 100644
index be4c21cd448c..000000000000
--- a/release_23/lib/Target/PowerPC/PPCSubtarget.h
+++ /dev/null
@@ -1,153 +0,0 @@
-//=====-- PPCSubtarget.h - Define Subtarget for the PPC -------*- C++ -*--====//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file declares the PowerPC specific subclass of TargetSubtarget.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef POWERPCSUBTARGET_H
-#define POWERPCSUBTARGET_H
-
-#include "llvm/Target/TargetInstrItineraries.h"
-#include "llvm/Target/TargetSubtarget.h"
-
-#include <string>
-
-// GCC #defines PPC on Linux but we use it as our namespace name
-#undef PPC
-
-namespace llvm {
-
-namespace PPC {
- // -m directive values.
- enum {
- DIR_NONE,
- DIR_32,
- DIR_601,
- DIR_602,
- DIR_603,
- DIR_7400,
- DIR_750,
- DIR_970,
- DIR_64
- };
-}
-
-class Module;
-class GlobalValue;
-class TargetMachine;
-
-class PPCSubtarget : public TargetSubtarget {
-public:
- enum AsmWriterFlavorTy {
- OldMnemonic, NewMnemonic, Unset
- };
-protected:
- const TargetMachine &TM;
-
- /// stackAlignment - The minimum alignment known to hold of the stack frame on
- /// entry to the function and which must be maintained by every function.
- unsigned StackAlignment;
-
- /// Selected instruction itineraries (one entry per itinerary class.)
- InstrItineraryData InstrItins;
-
- /// Which cpu directive was used.
- unsigned DarwinDirective;
-
- /// AsmFlavor - Which PPC asm dialect to use.
- AsmWriterFlavorTy AsmFlavor;
-
- /// Used by the ISel to turn in optimizations for POWER4-derived architectures
- bool IsGigaProcessor;
- bool Has64BitSupport;
- bool Use64BitRegs;
- bool IsPPC64;
- bool HasAltivec;
- bool HasFSQRT;
- bool HasSTFIWX;
- bool HasLazyResolverStubs;
-
- /// DarwinVers - Nonzero if this is a darwin platform. Otherwise, the numeric
- /// version of the platform, e.g. 8 = 10.4 (Tiger), 9 = 10.5 (Leopard), etc.
- unsigned char DarwinVers; // Is any darwin-ppc platform.
-public:
- /// This constructor initializes the data members to match that
- /// of the specified module.
- ///
- PPCSubtarget(const TargetMachine &TM, const Module &M,
- const std::string &FS, bool is64Bit);
-
- /// ParseSubtargetFeatures - Parses features string setting specified
- /// subtarget options. Definition of function is auto generated by tblgen.
- void ParseSubtargetFeatures(const std::string &FS, const std::string &CPU);
-
- /// SetJITMode - This is called to inform the subtarget info that we are
- /// producing code for the JIT.
- void SetJITMode();
-
- /// getStackAlignment - Returns the minimum alignment known to hold of the
- /// stack frame on entry to the function and which must be maintained by every
- /// function for this subtarget.
- unsigned getStackAlignment() const { return StackAlignment; }
-
- /// getDarwinDirective - Returns the -m directive specified for the cpu.
- ///
- unsigned getDarwinDirective() const { return DarwinDirective; }
-
- /// getInstrItins - Return the instruction itineraies based on subtarget
- /// selection.
- const InstrItineraryData &getInstrItineraryData() const { return InstrItins; }
-
- /// getTargetDataString - Return the pointer size and type alignment
- /// properties of this subtarget.
- const char *getTargetDataString() const {
- return isPPC64() ? "E-p:64:64-f64:32:64-i64:32:64-f128:64:128"
- : "E-p:32:32-f64:32:64-i64:32:64-f128:64:128";
- }
-
- /// isPPC64 - Return true if we are generating code for 64-bit pointer mode.
- ///
- bool isPPC64() const { return IsPPC64; }
-
- /// has64BitSupport - Return true if the selected CPU supports 64-bit
- /// instructions, regardless of whether we are in 32-bit or 64-bit mode.
- bool has64BitSupport() const { return Has64BitSupport; }
-
- /// use64BitRegs - Return true if in 64-bit mode or if we should use 64-bit
- /// registers in 32-bit mode when possible. This can only true if
- /// has64BitSupport() returns true.
- bool use64BitRegs() const { return Use64BitRegs; }
-
- /// hasLazyResolverStub - Return true if accesses to the specified global have
- /// to go through a dyld lazy resolution stub. This means that an extra load
- /// is required to get the address of the global.
- bool hasLazyResolverStub(const GlobalValue *GV) const;
-
- // Specific obvious features.
- bool hasFSQRT() const { return HasFSQRT; }
- bool hasSTFIWX() const { return HasSTFIWX; }
- bool hasAltivec() const { return HasAltivec; }
- bool isGigaProcessor() const { return IsGigaProcessor; }
-
- /// isDarwin - True if this is any darwin platform.
- bool isDarwin() const { return DarwinVers != 0; }
- /// isDarwin - True if this is darwin9 (leopard, 10.5) or above.
- bool isDarwin9() const { return DarwinVers >= 9; }
-
- bool isMachoABI() const { return isDarwin() || IsPPC64; }
- bool isELF32_ABI() const { return !isDarwin() && !IsPPC64; }
-
- unsigned getAsmFlavor() const {
- return AsmFlavor != Unset ? unsigned(AsmFlavor) : 0;
- }
-};
-} // End llvm namespace
-
-#endif
diff --git a/release_23/lib/Target/PowerPC/PPCTargetAsmInfo.cpp b/release_23/lib/Target/PowerPC/PPCTargetAsmInfo.cpp
deleted file mode 100644
index 85ead11f890f..000000000000
--- a/release_23/lib/Target/PowerPC/PPCTargetAsmInfo.cpp
+++ /dev/null
@@ -1,161 +0,0 @@
-//===-- PPCTargetAsmInfo.cpp - PPC asm properties ---------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains the declarations of the DarwinTargetAsmInfo properties.
-//
-//===----------------------------------------------------------------------===//
-
-#include "PPCTargetAsmInfo.h"
-#include "PPCTargetMachine.h"
-#include "llvm/Function.h"
-#include "llvm/Support/Dwarf.h"
-
-using namespace llvm;
-using namespace llvm::dwarf;
-
-PPCTargetAsmInfo::PPCTargetAsmInfo(const PPCTargetMachine &TM) {
- bool isPPC64 = TM.getSubtargetImpl()->isPPC64();
-
- ZeroDirective = "\t.space\t";
- SetDirective = "\t.set";
- Data64bitsDirective = isPPC64 ? "\t.quad\t" : 0;
- AlignmentIsInBytes = false;
- LCOMMDirective = "\t.lcomm\t";
- InlineAsmStart = "# InlineAsm Start";
- InlineAsmEnd = "# InlineAsm End";
- AssemblerDialect = TM.getSubtargetImpl()->getAsmFlavor();
-}
-
-DarwinTargetAsmInfo::DarwinTargetAsmInfo(const PPCTargetMachine &TM)
-: PPCTargetAsmInfo(TM)
-{
- PCSymbol = ".";
- CommentString = ";";
- GlobalPrefix = "_";
- PrivateGlobalPrefix = "L";
- ConstantPoolSection = "\t.const\t";
- JumpTableDataSection = ".const";
- CStringSection = "\t.cstring";
- FourByteConstantSection = "\t.literal4\n";
- EightByteConstantSection = "\t.literal8\n";
- ReadOnlySection = "\t.const\n";
- if (TM.getRelocationModel() == Reloc::Static) {
- StaticCtorsSection = ".constructor";
- StaticDtorsSection = ".destructor";
- } else {
- StaticCtorsSection = ".mod_init_func";
- StaticDtorsSection = ".mod_term_func";
- }
- SwitchToSectionDirective = "\t.section ";
- UsedDirective = "\t.no_dead_strip\t";
- WeakDefDirective = "\t.weak_definition ";
- WeakRefDirective = "\t.weak_reference ";
- HiddenDirective = "\t.private_extern ";
- SupportsExceptionHandling = true;
- NeedsIndirectEncoding = true;
- NeedsSet = true;
- BSSSection = 0;
-
- DwarfEHFrameSection =
- ".section __TEXT,__eh_frame,coalesced,no_toc+strip_static_syms+live_support";
- DwarfExceptionSection = ".section __DATA,__gcc_except_tab";
- GlobalEHDirective = "\t.globl\t";
- SupportsWeakOmittedEHFrame = false;
-
- DwarfAbbrevSection = ".section __DWARF,__debug_abbrev,regular,debug";
- DwarfInfoSection = ".section __DWARF,__debug_info,regular,debug";
- DwarfLineSection = ".section __DWARF,__debug_line,regular,debug";
- DwarfFrameSection = ".section __DWARF,__debug_frame,regular,debug";
- DwarfPubNamesSection = ".section __DWARF,__debug_pubnames,regular,debug";
- DwarfPubTypesSection = ".section __DWARF,__debug_pubtypes,regular,debug";
- DwarfStrSection = ".section __DWARF,__debug_str,regular,debug";
- DwarfLocSection = ".section __DWARF,__debug_loc,regular,debug";
- DwarfARangesSection = ".section __DWARF,__debug_aranges,regular,debug";
- DwarfRangesSection = ".section __DWARF,__debug_ranges,regular,debug";
- DwarfMacInfoSection = ".section __DWARF,__debug_macinfo,regular,debug";
-
- // In non-PIC modes, emit a special label before jump tables so that the
- // linker can perform more accurate dead code stripping.
- if (TM.getRelocationModel() != Reloc::PIC_) {
- // Emit a local label that is preserved until the linker runs.
- JumpTableSpecialLabelPrefix = "l";
- }
-}
-
-/// PreferredEHDataFormat - This hook allows the target to select data
-/// format used for encoding pointers in exception handling data. Reason is
-/// 0 for data, 1 for code labels, 2 for function pointers. Global is true
-/// if the symbol can be relocated.
-unsigned DarwinTargetAsmInfo::PreferredEHDataFormat(DwarfEncoding::Target Reason,
- bool Global) const {
- if (Reason == DwarfEncoding::Functions && Global)
- return (DW_EH_PE_pcrel | DW_EH_PE_indirect | DW_EH_PE_sdata4);
- else if (Reason == DwarfEncoding::CodeLabels || !Global)
- return DW_EH_PE_pcrel;
- else
- return DW_EH_PE_absptr;
-}
-
-
-LinuxTargetAsmInfo::LinuxTargetAsmInfo(const PPCTargetMachine &TM)
-: PPCTargetAsmInfo(TM)
-{
- CommentString = "#";
- GlobalPrefix = "";
- PrivateGlobalPrefix = "";
- ConstantPoolSection = "\t.section .rodata.cst4\t";
- JumpTableDataSection = ".section .rodata.cst4";
- CStringSection = "\t.section\t.rodata";
- StaticCtorsSection = ".section\t.ctors,\"aw\",@progbits";
- StaticDtorsSection = ".section\t.dtors,\"aw\",@progbits";
- UsedDirective = "\t# .no_dead_strip\t";
- WeakRefDirective = "\t.weak\t";
- BSSSection = "\t.section\t\".sbss\",\"aw\",@nobits";
-
- // Debug Information
- AbsoluteDebugSectionOffsets = true;
- SupportsDebugInformation = true;
- DwarfAbbrevSection = "\t.section\t.debug_abbrev,\"\",@progbits";
- DwarfInfoSection = "\t.section\t.debug_info,\"\",@progbits";
- DwarfLineSection = "\t.section\t.debug_line,\"\",@progbits";
- DwarfFrameSection = "\t.section\t.debug_frame,\"\",@progbits";
- DwarfPubNamesSection ="\t.section\t.debug_pubnames,\"\",@progbits";
- DwarfPubTypesSection ="\t.section\t.debug_pubtypes,\"\",@progbits";
- DwarfStrSection = "\t.section\t.debug_str,\"\",@progbits";
- DwarfLocSection = "\t.section\t.debug_loc,\"\",@progbits";
- DwarfARangesSection = "\t.section\t.debug_aranges,\"\",@progbits";
- DwarfRangesSection = "\t.section\t.debug_ranges,\"\",@progbits";
- DwarfMacInfoSection = "\t.section\t.debug_macinfo,\"\",@progbits";
-
- ReadOnlySection = "\t.section\t.rodata";
- FourByteConstantSection = "\t.section\t.rodata.cst4,\"aM\",@progbits,4";
- EightByteConstantSection = "\t.section\t.rodata.cst8,\"aM\",@progbits,8";
- SixteenByteConstantSection = "\t.section\t.rodata.cst16,\"aM\",@progbits,16";
- PCSymbol = ".";
-
- // Set up DWARF directives
- HasLEB128 = true; // Target asm supports leb128 directives (little-endian)
-
- // Exceptions handling
- if (!TM.getSubtargetImpl()->isPPC64())
- SupportsExceptionHandling = true;
- AbsoluteEHSectionOffsets = false;
- DwarfEHFrameSection = "\t.section\t.eh_frame,\"aw\",@progbits";
- DwarfExceptionSection = "\t.section\t.gcc_except_table,\"a\",@progbits";
-}
-
-/// PreferredEHDataFormat - This hook allows the target to select data
-/// format used for encoding pointers in exception handling data. Reason is
-/// 0 for data, 1 for code labels, 2 for function pointers. Global is true
-/// if the symbol can be relocated.
-unsigned LinuxTargetAsmInfo::PreferredEHDataFormat(DwarfEncoding::Target Reason,
- bool Global) const {
- // We really need to write something here.
- return TargetAsmInfo::PreferredEHDataFormat(Reason, Global);
-}
diff --git a/release_23/lib/Target/PowerPC/PPCTargetAsmInfo.h b/release_23/lib/Target/PowerPC/PPCTargetAsmInfo.h
deleted file mode 100644
index 4884628b2e77..000000000000
--- a/release_23/lib/Target/PowerPC/PPCTargetAsmInfo.h
+++ /dev/null
@@ -1,42 +0,0 @@
-//=====-- PPCTargetAsmInfo.h - PPC asm properties -------------*- C++ -*--====//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains the declaration of the DarwinTargetAsmInfo class.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef PPCTARGETASMINFO_H
-#define PPCTARGETASMINFO_H
-
-#include "llvm/Target/TargetAsmInfo.h"
-
-namespace llvm {
-
- // Forward declaration.
- class PPCTargetMachine;
-
- struct PPCTargetAsmInfo : public TargetAsmInfo {
- explicit PPCTargetAsmInfo(const PPCTargetMachine &TM);
- };
-
- struct DarwinTargetAsmInfo : public PPCTargetAsmInfo {
- explicit DarwinTargetAsmInfo(const PPCTargetMachine &TM);
- virtual unsigned PreferredEHDataFormat(DwarfEncoding::Target Reason,
- bool Global) const;
- };
-
- struct LinuxTargetAsmInfo : public PPCTargetAsmInfo {
- explicit LinuxTargetAsmInfo(const PPCTargetMachine &TM);
- virtual unsigned PreferredEHDataFormat(DwarfEncoding::Target Reason,
- bool Global) const;
- };
-
-} // namespace llvm
-
-#endif
diff --git a/release_23/lib/Target/PowerPC/PPCTargetMachine.cpp b/release_23/lib/Target/PowerPC/PPCTargetMachine.cpp
deleted file mode 100644
index a77cc15d8f87..000000000000
--- a/release_23/lib/Target/PowerPC/PPCTargetMachine.cpp
+++ /dev/null
@@ -1,171 +0,0 @@
-//===-- PPCTargetMachine.cpp - Define TargetMachine for PowerPC -----------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// Top-level implementation for the PowerPC target.
-//
-//===----------------------------------------------------------------------===//
-
-#include "PPC.h"
-#include "PPCTargetAsmInfo.h"
-#include "PPCTargetMachine.h"
-#include "llvm/Module.h"
-#include "llvm/PassManager.h"
-#include "llvm/Target/TargetMachineRegistry.h"
-using namespace llvm;
-
-namespace {
- // Register the targets
- RegisterTarget<PPC32TargetMachine>
- X("ppc32", " PowerPC 32");
- RegisterTarget<PPC64TargetMachine>
- Y("ppc64", " PowerPC 64");
-}
-
-const TargetAsmInfo *PPCTargetMachine::createTargetAsmInfo() const {
- if (Subtarget.isDarwin())
- return new DarwinTargetAsmInfo(*this);
- else
- return new LinuxTargetAsmInfo(*this);
-}
-
-unsigned PPC32TargetMachine::getJITMatchQuality() {
-#if defined(__POWERPC__) || defined (__ppc__) || defined(_POWER) || defined(__PPC__)
- if (sizeof(void*) == 4)
- return 10;
-#endif
- return 0;
-}
-unsigned PPC64TargetMachine::getJITMatchQuality() {
-#if defined(__POWERPC__) || defined (__ppc__) || defined(_POWER) || defined(__PPC__)
- if (sizeof(void*) == 8)
- return 10;
-#endif
- return 0;
-}
-
-unsigned PPC32TargetMachine::getModuleMatchQuality(const Module &M) {
- // We strongly match "powerpc-*".
- std::string TT = M.getTargetTriple();
- if (TT.size() >= 8 && std::string(TT.begin(), TT.begin()+8) == "powerpc-")
- return 20;
-
- // If the target triple is something non-powerpc, we don't match.
- if (!TT.empty()) return 0;
-
- if (M.getEndianness() == Module::BigEndian &&
- M.getPointerSize() == Module::Pointer32)
- return 10; // Weak match
- else if (M.getEndianness() != Module::AnyEndianness ||
- M.getPointerSize() != Module::AnyPointerSize)
- return 0; // Match for some other target
-
- return getJITMatchQuality()/2;
-}
-
-unsigned PPC64TargetMachine::getModuleMatchQuality(const Module &M) {
- // We strongly match "powerpc64-*".
- std::string TT = M.getTargetTriple();
- if (TT.size() >= 10 && std::string(TT.begin(), TT.begin()+10) == "powerpc64-")
- return 20;
-
- if (M.getEndianness() == Module::BigEndian &&
- M.getPointerSize() == Module::Pointer64)
- return 10; // Weak match
- else if (M.getEndianness() != Module::AnyEndianness ||
- M.getPointerSize() != Module::AnyPointerSize)
- return 0; // Match for some other target
-
- return getJITMatchQuality()/2;
-}
-
-
-PPCTargetMachine::PPCTargetMachine(const Module &M, const std::string &FS,
- bool is64Bit)
- : Subtarget(*this, M, FS, is64Bit),
- DataLayout(Subtarget.getTargetDataString()), InstrInfo(*this),
- FrameInfo(*this, is64Bit), JITInfo(*this, is64Bit), TLInfo(*this),
- InstrItins(Subtarget.getInstrItineraryData()), MachOWriterInfo(*this) {
-
- if (getRelocationModel() == Reloc::Default) {
- if (Subtarget.isDarwin())
- setRelocationModel(Reloc::DynamicNoPIC);
- else
- setRelocationModel(Reloc::Static);
- }
-}
-
-/// Override this for PowerPC. Tail merging happily breaks up instruction issue
-/// groups, which typically degrades performance.
-bool PPCTargetMachine::getEnableTailMergeDefault() const { return false; }
-
-PPC32TargetMachine::PPC32TargetMachine(const Module &M, const std::string &FS)
- : PPCTargetMachine(M, FS, false) {
-}
-
-
-PPC64TargetMachine::PPC64TargetMachine(const Module &M, const std::string &FS)
- : PPCTargetMachine(M, FS, true) {
-}
-
-
-//===----------------------------------------------------------------------===//
-// Pass Pipeline Configuration
-//===----------------------------------------------------------------------===//
-
-bool PPCTargetMachine::addInstSelector(PassManagerBase &PM, bool Fast) {
- // Install an instruction selector.
- PM.add(createPPCISelDag(*this));
- return false;
-}
-
-bool PPCTargetMachine::addPreEmitPass(PassManagerBase &PM, bool Fast) {
-
- // Must run branch selection immediately preceding the asm printer.
- PM.add(createPPCBranchSelectionPass());
- return false;
-}
-
-bool PPCTargetMachine::addAssemblyEmitter(PassManagerBase &PM, bool Fast,
- std::ostream &Out) {
- PM.add(createPPCAsmPrinterPass(Out, *this));
- return false;
-}
-
-bool PPCTargetMachine::addCodeEmitter(PassManagerBase &PM, bool Fast,
- bool DumpAsm, MachineCodeEmitter &MCE) {
- // The JIT should use the static relocation model in ppc32 mode, PIC in ppc64.
- // FIXME: This should be moved to TargetJITInfo!!
- if (Subtarget.isPPC64()) {
- // We use PIC codegen in ppc64 mode, because otherwise we'd have to use many
- // instructions to materialize arbitrary global variable + function +
- // constant pool addresses.
- setRelocationModel(Reloc::PIC_);
- } else {
- setRelocationModel(Reloc::Static);
- }
-
- // Inform the subtarget that we are in JIT mode. FIXME: does this break macho
- // writing?
- Subtarget.SetJITMode();
-
- // Machine code emitter pass for PowerPC.
- PM.add(createPPCCodeEmitterPass(*this, MCE));
- if (DumpAsm)
- PM.add(createPPCAsmPrinterPass(*cerr.stream(), *this));
- return false;
-}
-
-bool PPCTargetMachine::addSimpleCodeEmitter(PassManagerBase &PM, bool Fast,
- bool DumpAsm, MachineCodeEmitter &MCE) {
- // Machine code emitter pass for PowerPC.
- PM.add(createPPCCodeEmitterPass(*this, MCE));
- if (DumpAsm)
- PM.add(createPPCAsmPrinterPass(*cerr.stream(), *this));
- return false;
-}
diff --git a/release_23/lib/Target/PowerPC/PPCTargetMachine.h b/release_23/lib/Target/PowerPC/PPCTargetMachine.h
deleted file mode 100644
index ed8780968fe0..000000000000
--- a/release_23/lib/Target/PowerPC/PPCTargetMachine.h
+++ /dev/null
@@ -1,101 +0,0 @@
-//===-- PPCTargetMachine.h - Define TargetMachine for PowerPC -----*- C++ -*-=//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file declares the PowerPC specific subclass of TargetMachine.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef PPC_TARGETMACHINE_H
-#define PPC_TARGETMACHINE_H
-
-#include "PPCFrameInfo.h"
-#include "PPCSubtarget.h"
-#include "PPCJITInfo.h"
-#include "PPCInstrInfo.h"
-#include "PPCISelLowering.h"
-#include "PPCMachOWriterInfo.h"
-#include "llvm/Target/TargetMachine.h"
-#include "llvm/Target/TargetData.h"
-
-namespace llvm {
-class PassManager;
-class GlobalValue;
-
-/// PPCTargetMachine - Common code between 32-bit and 64-bit PowerPC targets.
-///
-class PPCTargetMachine : public LLVMTargetMachine {
- PPCSubtarget Subtarget;
- const TargetData DataLayout; // Calculates type size & alignment
- PPCInstrInfo InstrInfo;
- PPCFrameInfo FrameInfo;
- PPCJITInfo JITInfo;
- PPCTargetLowering TLInfo;
- InstrItineraryData InstrItins;
- PPCMachOWriterInfo MachOWriterInfo;
-
-protected:
- virtual const TargetAsmInfo *createTargetAsmInfo() const;
-
-public:
- PPCTargetMachine(const Module &M, const std::string &FS, bool is64Bit);
-
- virtual const PPCInstrInfo *getInstrInfo() const { return &InstrInfo; }
- virtual const TargetFrameInfo *getFrameInfo() const { return &FrameInfo; }
- virtual TargetJITInfo *getJITInfo() { return &JITInfo; }
- virtual PPCTargetLowering *getTargetLowering() const {
- return const_cast<PPCTargetLowering*>(&TLInfo);
- }
- virtual const TargetRegisterInfo *getRegisterInfo() const {
- return &InstrInfo.getRegisterInfo();
- }
-
- virtual const TargetData *getTargetData() const { return &DataLayout; }
- virtual const PPCSubtarget *getSubtargetImpl() const { return &Subtarget; }
- virtual const InstrItineraryData getInstrItineraryData() const {
- return InstrItins;
- }
- virtual const PPCMachOWriterInfo *getMachOWriterInfo() const {
- return &MachOWriterInfo;
- }
-
- // Pass Pipeline Configuration
- virtual bool addInstSelector(PassManagerBase &PM, bool Fast);
- virtual bool addPreEmitPass(PassManagerBase &PM, bool Fast);
- virtual bool addAssemblyEmitter(PassManagerBase &PM, bool Fast,
- std::ostream &Out);
- virtual bool addCodeEmitter(PassManagerBase &PM, bool Fast,
- bool DumpAsm, MachineCodeEmitter &MCE);
- virtual bool addSimpleCodeEmitter(PassManagerBase &PM, bool Fast,
- bool DumpAsm, MachineCodeEmitter &MCE);
- virtual bool getEnableTailMergeDefault() const;
-};
-
-/// PPC32TargetMachine - PowerPC 32-bit target machine.
-///
-class PPC32TargetMachine : public PPCTargetMachine {
-public:
- PPC32TargetMachine(const Module &M, const std::string &FS);
-
- static unsigned getJITMatchQuality();
- static unsigned getModuleMatchQuality(const Module &M);
-};
-
-/// PPC64TargetMachine - PowerPC 64-bit target machine.
-///
-class PPC64TargetMachine : public PPCTargetMachine {
-public:
- PPC64TargetMachine(const Module &M, const std::string &FS);
-
- static unsigned getJITMatchQuality();
- static unsigned getModuleMatchQuality(const Module &M);
-};
-
-} // end namespace llvm
-
-#endif
diff --git a/release_23/lib/Target/PowerPC/README.txt b/release_23/lib/Target/PowerPC/README.txt
deleted file mode 100644
index 55baf8d270ad..000000000000
--- a/release_23/lib/Target/PowerPC/README.txt
+++ /dev/null
@@ -1,755 +0,0 @@
-//===- README.txt - Notes for improving PowerPC-specific code gen ---------===//
-
-TODO:
-* gpr0 allocation
-* implement do-loop -> bdnz transform
-* Implement __builtin_trap (ISD::TRAP) as 'tw 31, 0, 0' aka 'trap'.
-* lmw/stmw pass a la arm load store optimizer for prolog/epilog
-
-===-------------------------------------------------------------------------===
-
-Support 'update' load/store instructions. These are cracked on the G5, but are
-still a codesize win.
-
-With preinc enabled, this:
-
-long *%test4(long *%X, long *%dest) {
- %Y = getelementptr long* %X, int 4
- %A = load long* %Y
- store long %A, long* %dest
- ret long* %Y
-}
-
-compiles to:
-
-_test4:
- mr r2, r3
- lwzu r5, 32(r2)
- lwz r3, 36(r3)
- stw r5, 0(r4)
- stw r3, 4(r4)
- mr r3, r2
- blr
-
-with -sched=list-burr, I get:
-
-_test4:
- lwz r2, 36(r3)
- lwzu r5, 32(r3)
- stw r2, 4(r4)
- stw r5, 0(r4)
- blr
-
-===-------------------------------------------------------------------------===
-
-We compile the hottest inner loop of viterbi to:
-
- li r6, 0
- b LBB1_84 ;bb432.i
-LBB1_83: ;bb420.i
- lbzx r8, r5, r7
- addi r6, r7, 1
- stbx r8, r4, r7
-LBB1_84: ;bb432.i
- mr r7, r6
- cmplwi cr0, r7, 143
- bne cr0, LBB1_83 ;bb420.i
-
-The CBE manages to produce:
-
- li r0, 143
- mtctr r0
-loop:
- lbzx r2, r2, r11
- stbx r0, r2, r9
- addi r2, r2, 1
- bdz later
- b loop
-
-This could be much better (bdnz instead of bdz) but it still beats us. If we
-produced this with bdnz, the loop would be a single dispatch group.
-
-===-------------------------------------------------------------------------===
-
-Compile:
-
-void foo(int *P) {
- if (P) *P = 0;
-}
-
-into:
-
-_foo:
- cmpwi cr0,r3,0
- beqlr cr0
- li r0,0
- stw r0,0(r3)
- blr
-
-This is effectively a simple form of predication.
-
-===-------------------------------------------------------------------------===
-
-Lump the constant pool for each function into ONE pic object, and reference
-pieces of it as offsets from the start. For functions like this (contrived
-to have lots of constants obviously):
-
-double X(double Y) { return (Y*1.23 + 4.512)*2.34 + 14.38; }
-
-We generate:
-
-_X:
- lis r2, ha16(.CPI_X_0)
- lfd f0, lo16(.CPI_X_0)(r2)
- lis r2, ha16(.CPI_X_1)
- lfd f2, lo16(.CPI_X_1)(r2)
- fmadd f0, f1, f0, f2
- lis r2, ha16(.CPI_X_2)
- lfd f1, lo16(.CPI_X_2)(r2)
- lis r2, ha16(.CPI_X_3)
- lfd f2, lo16(.CPI_X_3)(r2)
- fmadd f1, f0, f1, f2
- blr
-
-It would be better to materialize .CPI_X into a register, then use immediates
-off of the register to avoid the lis's. This is even more important in PIC
-mode.
-
-Note that this (and the static variable version) is discussed here for GCC:
-http://gcc.gnu.org/ml/gcc-patches/2006-02/msg00133.html
-
-Here's another example (the sgn function):
-double testf(double a) {
- return a == 0.0 ? 0.0 : (a > 0.0 ? 1.0 : -1.0);
-}
-
-it produces a BB like this:
-LBB1_1: ; cond_true
- lis r2, ha16(LCPI1_0)
- lfs f0, lo16(LCPI1_0)(r2)
- lis r2, ha16(LCPI1_1)
- lis r3, ha16(LCPI1_2)
- lfs f2, lo16(LCPI1_2)(r3)
- lfs f3, lo16(LCPI1_1)(r2)
- fsub f0, f0, f1
- fsel f1, f0, f2, f3
- blr
-
-===-------------------------------------------------------------------------===
-
-PIC Code Gen IPO optimization:
-
-Squish small scalar globals together into a single global struct, allowing the
-address of the struct to be CSE'd, avoiding PIC accesses (also reduces the size
-of the GOT on targets with one).
-
-Note that this is discussed here for GCC:
-http://gcc.gnu.org/ml/gcc-patches/2006-02/msg00133.html
-
-===-------------------------------------------------------------------------===
-
-Implement Newton-Rhapson method for improving estimate instructions to the
-correct accuracy, and implementing divide as multiply by reciprocal when it has
-more than one use. Itanium will want this too.
-
-===-------------------------------------------------------------------------===
-
-Compile offsets from allocas:
-
-int *%test() {
- %X = alloca { int, int }
- %Y = getelementptr {int,int}* %X, int 0, uint 1
- ret int* %Y
-}
-
-into a single add, not two:
-
-_test:
- addi r2, r1, -8
- addi r3, r2, 4
- blr
-
---> important for C++.
-
-===-------------------------------------------------------------------------===
-
-No loads or stores of the constants should be needed:
-
-struct foo { double X, Y; };
-void xxx(struct foo F);
-void bar() { struct foo R = { 1.0, 2.0 }; xxx(R); }
-
-===-------------------------------------------------------------------------===
-
-Darwin Stub LICM optimization:
-
-Loops like this:
-
- for (...) bar();
-
-Have to go through an indirect stub if bar is external or linkonce. It would
-be better to compile it as:
-
- fp = &bar;
- for (...) fp();
-
-which only computes the address of bar once (instead of each time through the
-stub). This is Darwin specific and would have to be done in the code generator.
-Probably not a win on x86.
-
-===-------------------------------------------------------------------------===
-
-Simple IPO for argument passing, change:
- void foo(int X, double Y, int Z) -> void foo(int X, int Z, double Y)
-
-the Darwin ABI specifies that any integer arguments in the first 32 bytes worth
-of arguments get assigned to r3 through r10. That is, if you have a function
-foo(int, double, int) you get r3, f1, r6, since the 64 bit double ate up the
-argument bytes for r4 and r5. The trick then would be to shuffle the argument
-order for functions we can internalize so that the maximum number of
-integers/pointers get passed in regs before you see any of the fp arguments.
-
-Instead of implementing this, it would actually probably be easier to just
-implement a PPC fastcc, where we could do whatever we wanted to the CC,
-including having this work sanely.
-
-===-------------------------------------------------------------------------===
-
-Fix Darwin FP-In-Integer Registers ABI
-
-Darwin passes doubles in structures in integer registers, which is very very
-bad. Add something like a BIT_CONVERT to LLVM, then do an i-p transformation
-that percolates these things out of functions.
-
-Check out how horrible this is:
-http://gcc.gnu.org/ml/gcc/2005-10/msg01036.html
-
-This is an extension of "interprocedural CC unmunging" that can't be done with
-just fastcc.
-
-===-------------------------------------------------------------------------===
-
-Compile this:
-
-int foo(int a) {
- int b = (a < 8);
- if (b) {
- return b * 3; // ignore the fact that this is always 3.
- } else {
- return 2;
- }
-}
-
-into something not this:
-
-_foo:
-1) cmpwi cr7, r3, 8
- mfcr r2, 1
- rlwinm r2, r2, 29, 31, 31
-1) cmpwi cr0, r3, 7
- bgt cr0, LBB1_2 ; UnifiedReturnBlock
-LBB1_1: ; then
- rlwinm r2, r2, 0, 31, 31
- mulli r3, r2, 3
- blr
-LBB1_2: ; UnifiedReturnBlock
- li r3, 2
- blr
-
-In particular, the two compares (marked 1) could be shared by reversing one.
-This could be done in the dag combiner, by swapping a BR_CC when a SETCC of the
-same operands (but backwards) exists. In this case, this wouldn't save us
-anything though, because the compares still wouldn't be shared.
-
-===-------------------------------------------------------------------------===
-
-We should custom expand setcc instead of pretending that we have it. That
-would allow us to expose the access of the crbit after the mfcr, allowing
-that access to be trivially folded into other ops. A simple example:
-
-int foo(int a, int b) { return (a < b) << 4; }
-
-compiles into:
-
-_foo:
- cmpw cr7, r3, r4
- mfcr r2, 1
- rlwinm r2, r2, 29, 31, 31
- slwi r3, r2, 4
- blr
-
-===-------------------------------------------------------------------------===
-
-Fold add and sub with constant into non-extern, non-weak addresses so this:
-
-static int a;
-void bar(int b) { a = b; }
-void foo(unsigned char *c) {
- *c = a;
-}
-
-So that
-
-_foo:
- lis r2, ha16(_a)
- la r2, lo16(_a)(r2)
- lbz r2, 3(r2)
- stb r2, 0(r3)
- blr
-
-Becomes
-
-_foo:
- lis r2, ha16(_a+3)
- lbz r2, lo16(_a+3)(r2)
- stb r2, 0(r3)
- blr
-
-===-------------------------------------------------------------------------===
-
-We generate really bad code for this:
-
-int f(signed char *a, _Bool b, _Bool c) {
- signed char t = 0;
- if (b) t = *a;
- if (c) *a = t;
-}
-
-===-------------------------------------------------------------------------===
-
-This:
-int test(unsigned *P) { return *P >> 24; }
-
-Should compile to:
-
-_test:
- lbz r3,0(r3)
- blr
-
-not:
-
-_test:
- lwz r2, 0(r3)
- srwi r3, r2, 24
- blr
-
-===-------------------------------------------------------------------------===
-
-On the G5, logical CR operations are more expensive in their three
-address form: ops that read/write the same register are half as expensive as
-those that read from two registers that are different from their destination.
-
-We should model this with two separate instructions. The isel should generate
-the "two address" form of the instructions. When the register allocator
-detects that it needs to insert a copy due to the two-addresness of the CR
-logical op, it will invoke PPCInstrInfo::convertToThreeAddress. At this point
-we can convert to the "three address" instruction, to save code space.
-
-This only matters when we start generating cr logical ops.
-
-===-------------------------------------------------------------------------===
-
-We should compile these two functions to the same thing:
-
-#include <stdlib.h>
-void f(int a, int b, int *P) {
- *P = (a-b)>=0?(a-b):(b-a);
-}
-void g(int a, int b, int *P) {
- *P = abs(a-b);
-}
-
-Further, they should compile to something better than:
-
-_g:
- subf r2, r4, r3
- subfic r3, r2, 0
- cmpwi cr0, r2, -1
- bgt cr0, LBB2_2 ; entry
-LBB2_1: ; entry
- mr r2, r3
-LBB2_2: ; entry
- stw r2, 0(r5)
- blr
-
-GCC produces:
-
-_g:
- subf r4,r4,r3
- srawi r2,r4,31
- xor r0,r2,r4
- subf r0,r2,r0
- stw r0,0(r5)
- blr
-
-... which is much nicer.
-
-This theoretically may help improve twolf slightly (used in dimbox.c:142?).
-
-===-------------------------------------------------------------------------===
-
-int foo(int N, int ***W, int **TK, int X) {
- int t, i;
-
- for (t = 0; t < N; ++t)
- for (i = 0; i < 4; ++i)
- W[t / X][i][t % X] = TK[i][t];
-
- return 5;
-}
-
-We generate relatively atrocious code for this loop compared to gcc.
-
-We could also strength reduce the rem and the div:
-http://www.lcs.mit.edu/pubs/pdf/MIT-LCS-TM-600.pdf
-
-===-------------------------------------------------------------------------===
-
-float foo(float X) { return (int)(X); }
-
-Currently produces:
-
-_foo:
- fctiwz f0, f1
- stfd f0, -8(r1)
- lwz r2, -4(r1)
- extsw r2, r2
- std r2, -16(r1)
- lfd f0, -16(r1)
- fcfid f0, f0
- frsp f1, f0
- blr
-
-We could use a target dag combine to turn the lwz/extsw into an lwa when the
-lwz has a single use. Since LWA is cracked anyway, this would be a codesize
-win only.
-
-===-------------------------------------------------------------------------===
-
-We generate ugly code for this:
-
-void func(unsigned int *ret, float dx, float dy, float dz, float dw) {
- unsigned code = 0;
- if(dx < -dw) code |= 1;
- if(dx > dw) code |= 2;
- if(dy < -dw) code |= 4;
- if(dy > dw) code |= 8;
- if(dz < -dw) code |= 16;
- if(dz > dw) code |= 32;
- *ret = code;
-}
-
-===-------------------------------------------------------------------------===
-
-Complete the signed i32 to FP conversion code using 64-bit registers
-transformation, good for PI. See PPCISelLowering.cpp, this comment:
-
- // FIXME: disable this lowered code. This generates 64-bit register values,
- // and we don't model the fact that the top part is clobbered by calls. We
- // need to flag these together so that the value isn't live across a call.
- //setOperationAction(ISD::SINT_TO_FP, MVT::i32, Custom);
-
-Also, if the registers are spilled to the stack, we have to ensure that all
-64-bits of them are save/restored, otherwise we will miscompile the code. It
-sounds like we need to get the 64-bit register classes going.
-
-===-------------------------------------------------------------------------===
-
-%struct.B = type { i8, [3 x i8] }
-
-define void @bar(%struct.B* %b) {
-entry:
- %tmp = bitcast %struct.B* %b to i32* ; <uint*> [#uses=1]
- %tmp = load i32* %tmp ; <uint> [#uses=1]
- %tmp3 = bitcast %struct.B* %b to i32* ; <uint*> [#uses=1]
- %tmp4 = load i32* %tmp3 ; <uint> [#uses=1]
- %tmp8 = bitcast %struct.B* %b to i32* ; <uint*> [#uses=2]
- %tmp9 = load i32* %tmp8 ; <uint> [#uses=1]
- %tmp4.mask17 = shl i32 %tmp4, i8 1 ; <uint> [#uses=1]
- %tmp1415 = and i32 %tmp4.mask17, 2147483648 ; <uint> [#uses=1]
- %tmp.masked = and i32 %tmp, 2147483648 ; <uint> [#uses=1]
- %tmp11 = or i32 %tmp1415, %tmp.masked ; <uint> [#uses=1]
- %tmp12 = and i32 %tmp9, 2147483647 ; <uint> [#uses=1]
- %tmp13 = or i32 %tmp12, %tmp11 ; <uint> [#uses=1]
- store i32 %tmp13, i32* %tmp8
- ret void
-}
-
-We emit:
-
-_foo:
- lwz r2, 0(r3)
- slwi r4, r2, 1
- or r4, r4, r2
- rlwimi r2, r4, 0, 0, 0
- stw r2, 0(r3)
- blr
-
-We could collapse a bunch of those ORs and ANDs and generate the following
-equivalent code:
-
-_foo:
- lwz r2, 0(r3)
- rlwinm r4, r2, 1, 0, 0
- or r2, r2, r4
- stw r2, 0(r3)
- blr
-
-===-------------------------------------------------------------------------===
-
-We compile:
-
-unsigned test6(unsigned x) {
- return ((x & 0x00FF0000) >> 16) | ((x & 0x000000FF) << 16);
-}
-
-into:
-
-_test6:
- lis r2, 255
- rlwinm r3, r3, 16, 0, 31
- ori r2, r2, 255
- and r3, r3, r2
- blr
-
-GCC gets it down to:
-
-_test6:
- rlwinm r0,r3,16,8,15
- rlwinm r3,r3,16,24,31
- or r3,r3,r0
- blr
-
-
-===-------------------------------------------------------------------------===
-
-Consider a function like this:
-
-float foo(float X) { return X + 1234.4123f; }
-
-The FP constant ends up in the constant pool, so we need to get the LR register.
- This ends up producing code like this:
-
-_foo:
-.LBB_foo_0: ; entry
- mflr r11
-*** stw r11, 8(r1)
- bl "L00000$pb"
-"L00000$pb":
- mflr r2
- addis r2, r2, ha16(.CPI_foo_0-"L00000$pb")
- lfs f0, lo16(.CPI_foo_0-"L00000$pb")(r2)
- fadds f1, f1, f0
-*** lwz r11, 8(r1)
- mtlr r11
- blr
-
-This is functional, but there is no reason to spill the LR register all the way
-to the stack (the two marked instrs): spilling it to a GPR is quite enough.
-
-Implementing this will require some codegen improvements. Nate writes:
-
-"So basically what we need to support the "no stack frame save and restore" is a
-generalization of the LR optimization to "callee-save regs".
-
-Currently, we have LR marked as a callee-save reg. The register allocator sees
-that it's callee save, and spills it directly to the stack.
-
-Ideally, something like this would happen:
-
-LR would be in a separate register class from the GPRs. The class of LR would be
-marked "unspillable". When the register allocator came across an unspillable
-reg, it would ask "what is the best class to copy this into that I *can* spill"
-If it gets a class back, which it will in this case (the gprs), it grabs a free
-register of that class. If it is then later necessary to spill that reg, so be
-it.
-
-===-------------------------------------------------------------------------===
-
-We compile this:
-int test(_Bool X) {
- return X ? 524288 : 0;
-}
-
-to:
-_test:
- cmplwi cr0, r3, 0
- lis r2, 8
- li r3, 0
- beq cr0, LBB1_2 ;entry
-LBB1_1: ;entry
- mr r3, r2
-LBB1_2: ;entry
- blr
-
-instead of:
-_test:
- addic r2,r3,-1
- subfe r0,r2,r3
- slwi r3,r0,19
- blr
-
-This sort of thing occurs a lot due to globalopt.
-
-===-------------------------------------------------------------------------===
-
-We currently compile 32-bit bswap:
-
-declare i32 @llvm.bswap.i32(i32 %A)
-define i32 @test(i32 %A) {
- %B = call i32 @llvm.bswap.i32(i32 %A)
- ret i32 %B
-}
-
-to:
-
-_test:
- rlwinm r2, r3, 24, 16, 23
- slwi r4, r3, 24
- rlwimi r2, r3, 8, 24, 31
- rlwimi r4, r3, 8, 8, 15
- rlwimi r4, r2, 0, 16, 31
- mr r3, r4
- blr
-
-it would be more efficient to produce:
-
-_foo: mr r0,r3
- rlwinm r3,r3,8,0xffffffff
- rlwimi r3,r0,24,0,7
- rlwimi r3,r0,24,16,23
- blr
-
-===-------------------------------------------------------------------------===
-
-test/CodeGen/PowerPC/2007-03-24-cntlzd.ll compiles to:
-
-__ZNK4llvm5APInt17countLeadingZerosEv:
- ld r2, 0(r3)
- cntlzd r2, r2
- or r2, r2, r2 <<-- silly.
- addi r3, r2, -64
- blr
-
-The dead or is a 'truncate' from 64- to 32-bits.
-
-===-------------------------------------------------------------------------===
-
-We generate horrible ppc code for this:
-
-#define N 2000000
-double a[N],c[N];
-void simpleloop() {
- int j;
- for (j=0; j<N; j++)
- c[j] = a[j];
-}
-
-LBB1_1: ;bb
- lfdx f0, r3, r4
- addi r5, r5, 1 ;; Extra IV for the exit value compare.
- stfdx f0, r2, r4
- addi r4, r4, 8
-
- xoris r6, r5, 30 ;; This is due to a large immediate.
- cmplwi cr0, r6, 33920
- bne cr0, LBB1_1
-
-//===---------------------------------------------------------------------===//
-
-This:
- #include <algorithm>
- inline std::pair<unsigned, bool> full_add(unsigned a, unsigned b)
- { return std::make_pair(a + b, a + b < a); }
- bool no_overflow(unsigned a, unsigned b)
- { return !full_add(a, b).second; }
-
-Should compile to:
-
-__Z11no_overflowjj:
- add r4,r3,r4
- subfc r3,r3,r4
- li r3,0
- adde r3,r3,r3
- blr
-
-(or better) not:
-
-__Z11no_overflowjj:
- add r2, r4, r3
- cmplw cr7, r2, r3
- mfcr r2
- rlwinm r2, r2, 29, 31, 31
- xori r3, r2, 1
- blr
-
-//===---------------------------------------------------------------------===//
-
-We compile some FP comparisons into an mfcr with two rlwinms and an or. For
-example:
-#include <math.h>
-int test(double x, double y) { return islessequal(x, y);}
-int test2(double x, double y) { return islessgreater(x, y);}
-int test3(double x, double y) { return !islessequal(x, y);}
-
-Compiles into (all three are similar, but the bits differ):
-
-_test:
- fcmpu cr7, f1, f2
- mfcr r2
- rlwinm r3, r2, 29, 31, 31
- rlwinm r2, r2, 31, 31, 31
- or r3, r2, r3
- blr
-
-GCC compiles this into:
-
- _test:
- fcmpu cr7,f1,f2
- cror 30,28,30
- mfcr r3
- rlwinm r3,r3,31,1
- blr
-
-which is more efficient and can use mfocr. See PR642 for some more context.
-
-//===---------------------------------------------------------------------===//
-
-void foo(float *data, float d) {
- long i;
- for (i = 0; i < 8000; i++)
- data[i] = d;
-}
-void foo2(float *data, float d) {
- long i;
- data--;
- for (i = 0; i < 8000; i++) {
- data[1] = d;
- data++;
- }
-}
-
-These compile to:
-
-_foo:
- li r2, 0
-LBB1_1: ; bb
- addi r4, r2, 4
- stfsx f1, r3, r2
- cmplwi cr0, r4, 32000
- mr r2, r4
- bne cr0, LBB1_1 ; bb
- blr
-_foo2:
- li r2, 0
-LBB2_1: ; bb
- addi r4, r2, 4
- stfsx f1, r3, r2
- cmplwi cr0, r4, 32000
- mr r2, r4
- bne cr0, LBB2_1 ; bb
- blr
-
-The 'mr' could be eliminated to folding the add into the cmp better.
-
-//===---------------------------------------------------------------------===//
diff --git a/release_23/lib/Target/PowerPC/README_ALTIVEC.txt b/release_23/lib/Target/PowerPC/README_ALTIVEC.txt
deleted file mode 100644
index 1e4c6fb98440..000000000000
--- a/release_23/lib/Target/PowerPC/README_ALTIVEC.txt
+++ /dev/null
@@ -1,211 +0,0 @@
-//===- README_ALTIVEC.txt - Notes for improving Altivec code gen ----------===//
-
-Implement PPCInstrInfo::isLoadFromStackSlot/isStoreToStackSlot for vector
-registers, to generate better spill code.
-
-//===----------------------------------------------------------------------===//
-
-The first should be a single lvx from the constant pool, the second should be
-a xor/stvx:
-
-void foo(void) {
- int x[8] __attribute__((aligned(128))) = { 1, 1, 1, 17, 1, 1, 1, 1 };
- bar (x);
-}
-
-#include <string.h>
-void foo(void) {
- int x[8] __attribute__((aligned(128)));
- memset (x, 0, sizeof (x));
- bar (x);
-}
-
-//===----------------------------------------------------------------------===//
-
-Altivec: Codegen'ing MUL with vector FMADD should add -0.0, not 0.0:
-http://gcc.gnu.org/bugzilla/show_bug.cgi?id=8763
-
-When -ffast-math is on, we can use 0.0.
-
-//===----------------------------------------------------------------------===//
-
- Consider this:
- v4f32 Vector;
- v4f32 Vector2 = { Vector.X, Vector.X, Vector.X, Vector.X };
-
-Since we know that "Vector" is 16-byte aligned and we know the element offset
-of ".X", we should change the load into a lve*x instruction, instead of doing
-a load/store/lve*x sequence.
-
-//===----------------------------------------------------------------------===//
-
-For functions that use altivec AND have calls, we are VRSAVE'ing all call
-clobbered regs.
-
-//===----------------------------------------------------------------------===//
-
-Implement passing vectors by value into calls and receiving them as arguments.
-
-//===----------------------------------------------------------------------===//
-
-GCC apparently tries to codegen { C1, C2, Variable, C3 } as a constant pool load
-of C1/C2/C3, then a load and vperm of Variable.
-
-//===----------------------------------------------------------------------===//
-
-We need a way to teach tblgen that some operands of an intrinsic are required to
-be constants. The verifier should enforce this constraint.
-
-//===----------------------------------------------------------------------===//
-
-We currently codegen SCALAR_TO_VECTOR as a store of the scalar to a 16-byte
-aligned stack slot, followed by a load/vperm. We should probably just store it
-to a scalar stack slot, then use lvsl/vperm to load it. If the value is already
-in memory this is a big win.
-
-//===----------------------------------------------------------------------===//
-
-extract_vector_elt of an arbitrary constant vector can be done with the
-following instructions:
-
-vTemp = vec_splat(v0,2); // 2 is the element the src is in.
-vec_ste(&destloc,0,vTemp);
-
-We can do an arbitrary non-constant value by using lvsr/perm/ste.
-
-//===----------------------------------------------------------------------===//
-
-If we want to tie instruction selection into the scheduler, we can do some
-constant formation with different instructions. For example, we can generate
-"vsplti -1" with "vcmpequw R,R" and 1,1,1,1 with "vsubcuw R,R", and 0,0,0,0 with
-"vsplti 0" or "vxor", each of which use different execution units, thus could
-help scheduling.
-
-This is probably only reasonable for a post-pass scheduler.
-
-//===----------------------------------------------------------------------===//
-
-For this function:
-
-void test(vector float *A, vector float *B) {
- vector float C = (vector float)vec_cmpeq(*A, *B);
- if (!vec_any_eq(*A, *B))
- *B = (vector float){0,0,0,0};
- *A = C;
-}
-
-we get the following basic block:
-
- ...
- lvx v2, 0, r4
- lvx v3, 0, r3
- vcmpeqfp v4, v3, v2
- vcmpeqfp. v2, v3, v2
- bne cr6, LBB1_2 ; cond_next
-
-The vcmpeqfp/vcmpeqfp. instructions currently cannot be merged when the
-vcmpeqfp. result is used by a branch. This can be improved.
-
-//===----------------------------------------------------------------------===//
-
-The code generated for this is truly aweful:
-
-vector float test(float a, float b) {
- return (vector float){ 0.0, a, 0.0, 0.0};
-}
-
-LCPI1_0: ; float
- .space 4
- .text
- .globl _test
- .align 4
-_test:
- mfspr r2, 256
- oris r3, r2, 4096
- mtspr 256, r3
- lis r3, ha16(LCPI1_0)
- addi r4, r1, -32
- stfs f1, -16(r1)
- addi r5, r1, -16
- lfs f0, lo16(LCPI1_0)(r3)
- stfs f0, -32(r1)
- lvx v2, 0, r4
- lvx v3, 0, r5
- vmrghw v3, v3, v2
- vspltw v2, v2, 0
- vmrghw v2, v2, v3
- mtspr 256, r2
- blr
-
-//===----------------------------------------------------------------------===//
-
-int foo(vector float *x, vector float *y) {
- if (vec_all_eq(*x,*y)) return 3245;
- else return 12;
-}
-
-A predicate compare being used in a select_cc should have the same peephole
-applied to it as a predicate compare used by a br_cc. There should be no
-mfcr here:
-
-_foo:
- mfspr r2, 256
- oris r5, r2, 12288
- mtspr 256, r5
- li r5, 12
- li r6, 3245
- lvx v2, 0, r4
- lvx v3, 0, r3
- vcmpeqfp. v2, v3, v2
- mfcr r3, 2
- rlwinm r3, r3, 25, 31, 31
- cmpwi cr0, r3, 0
- bne cr0, LBB1_2 ; entry
-LBB1_1: ; entry
- mr r6, r5
-LBB1_2: ; entry
- mr r3, r6
- mtspr 256, r2
- blr
-
-//===----------------------------------------------------------------------===//
-
-CodeGen/PowerPC/vec_constants.ll has an and operation that should be
-codegen'd to andc. The issue is that the 'all ones' build vector is
-SelectNodeTo'd a VSPLTISB instruction node before the and/xor is selected
-which prevents the vnot pattern from matching.
-
-
-//===----------------------------------------------------------------------===//
-
-An alternative to the store/store/load approach for illegal insert element
-lowering would be:
-
-1. store element to any ol' slot
-2. lvx the slot
-3. lvsl 0; splat index; vcmpeq to generate a select mask
-4. lvsl slot + x; vperm to rotate result into correct slot
-5. vsel result together.
-
-//===----------------------------------------------------------------------===//
-
-Should codegen branches on vec_any/vec_all to avoid mfcr. Two examples:
-
-#include <altivec.h>
- int f(vector float a, vector float b)
- {
- int aa = 0;
- if (vec_all_ge(a, b))
- aa |= 0x1;
- if (vec_any_ge(a,b))
- aa |= 0x2;
- return aa;
-}
-
-vector float f(vector float a, vector float b) {
- if (vec_any_eq(a, b))
- return a;
- else
- return b;
-}
-
diff --git a/release_23/lib/Target/README.txt b/release_23/lib/Target/README.txt
deleted file mode 100644
index 2c120896996d..000000000000
--- a/release_23/lib/Target/README.txt
+++ /dev/null
@@ -1,808 +0,0 @@
-Target Independent Opportunities:
-
-//===---------------------------------------------------------------------===//
-
-We should make the various target's "IMPLICIT_DEF" instructions be a single
-target-independent opcode like TargetInstrInfo::INLINEASM. This would allow
-us to eliminate the TargetInstrDesc::isImplicitDef() method, and would allow
-us to avoid having to define this for every target for every register class.
-
-//===---------------------------------------------------------------------===//
-
-With the recent changes to make the implicit def/use set explicit in
-machineinstrs, we should change the target descriptions for 'call' instructions
-so that the .td files don't list all the call-clobbered registers as implicit
-defs. Instead, these should be added by the code generator (e.g. on the dag).
-
-This has a number of uses:
-
-1. PPC32/64 and X86 32/64 can avoid having multiple copies of call instructions
- for their different impdef sets.
-2. Targets with multiple calling convs (e.g. x86) which have different clobber
- sets don't need copies of call instructions.
-3. 'Interprocedural register allocation' can be done to reduce the clobber sets
- of calls.
-
-//===---------------------------------------------------------------------===//
-
-Make the PPC branch selector target independant
-
-//===---------------------------------------------------------------------===//
-
-Get the C front-end to expand hypot(x,y) -> llvm.sqrt(x*x+y*y) when errno and
-precision don't matter (ffastmath). Misc/mandel will like this. :)
-
-//===---------------------------------------------------------------------===//
-
-Solve this DAG isel folding deficiency:
-
-int X, Y;
-
-void fn1(void)
-{
- X = X | (Y << 3);
-}
-
-compiles to
-
-fn1:
- movl Y, %eax
- shll $3, %eax
- orl X, %eax
- movl %eax, X
- ret
-
-The problem is the store's chain operand is not the load X but rather
-a TokenFactor of the load X and load Y, which prevents the folding.
-
-There are two ways to fix this:
-
-1. The dag combiner can start using alias analysis to realize that y/x
- don't alias, making the store to X not dependent on the load from Y.
-2. The generated isel could be made smarter in the case it can't
- disambiguate the pointers.
-
-Number 1 is the preferred solution.
-
-This has been "fixed" by a TableGen hack. But that is a short term workaround
-which will be removed once the proper fix is made.
-
-//===---------------------------------------------------------------------===//
-
-On targets with expensive 64-bit multiply, we could LSR this:
-
-for (i = ...; ++i) {
- x = 1ULL << i;
-
-into:
- long long tmp = 1;
- for (i = ...; ++i, tmp+=tmp)
- x = tmp;
-
-This would be a win on ppc32, but not x86 or ppc64.
-
-//===---------------------------------------------------------------------===//
-
-Shrink: (setlt (loadi32 P), 0) -> (setlt (loadi8 Phi), 0)
-
-//===---------------------------------------------------------------------===//
-
-Reassociate should turn: X*X*X*X -> t=(X*X) (t*t) to eliminate a multiply.
-
-//===---------------------------------------------------------------------===//
-
-Interesting? testcase for add/shift/mul reassoc:
-
-int bar(int x, int y) {
- return x*x*x+y+x*x*x*x*x*y*y*y*y;
-}
-int foo(int z, int n) {
- return bar(z, n) + bar(2*z, 2*n);
-}
-
-Reassociate should handle the example in GCC PR16157.
-
-//===---------------------------------------------------------------------===//
-
-These two functions should generate the same code on big-endian systems:
-
-int g(int *j,int *l) { return memcmp(j,l,4); }
-int h(int *j, int *l) { return *j - *l; }
-
-this could be done in SelectionDAGISel.cpp, along with other special cases,
-for 1,2,4,8 bytes.
-
-//===---------------------------------------------------------------------===//
-
-It would be nice to revert this patch:
-http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20060213/031986.html
-
-And teach the dag combiner enough to simplify the code expanded before
-legalize. It seems plausible that this knowledge would let it simplify other
-stuff too.
-
-//===---------------------------------------------------------------------===//
-
-For vector types, TargetData.cpp::getTypeInfo() returns alignment that is equal
-to the type size. It works but can be overly conservative as the alignment of
-specific vector types are target dependent.
-
-//===---------------------------------------------------------------------===//
-
-We should add 'unaligned load/store' nodes, and produce them from code like
-this:
-
-v4sf example(float *P) {
- return (v4sf){P[0], P[1], P[2], P[3] };
-}
-
-//===---------------------------------------------------------------------===//
-
-Add support for conditional increments, and other related patterns. Instead
-of:
-
- movl 136(%esp), %eax
- cmpl $0, %eax
- je LBB16_2 #cond_next
-LBB16_1: #cond_true
- incl _foo
-LBB16_2: #cond_next
-
-emit:
- movl _foo, %eax
- cmpl $1, %edi
- sbbl $-1, %eax
- movl %eax, _foo
-
-//===---------------------------------------------------------------------===//
-
-Combine: a = sin(x), b = cos(x) into a,b = sincos(x).
-
-Expand these to calls of sin/cos and stores:
- double sincos(double x, double *sin, double *cos);
- float sincosf(float x, float *sin, float *cos);
- long double sincosl(long double x, long double *sin, long double *cos);
-
-Doing so could allow SROA of the destination pointers. See also:
-http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17687
-
-//===---------------------------------------------------------------------===//
-
-Scalar Repl cannot currently promote this testcase to 'ret long cst':
-
- %struct.X = type { i32, i32 }
- %struct.Y = type { %struct.X }
-
-define i64 @bar() {
- %retval = alloca %struct.Y, align 8
- %tmp12 = getelementptr %struct.Y* %retval, i32 0, i32 0, i32 0
- store i32 0, i32* %tmp12
- %tmp15 = getelementptr %struct.Y* %retval, i32 0, i32 0, i32 1
- store i32 1, i32* %tmp15
- %retval.upgrd.1 = bitcast %struct.Y* %retval to i64*
- %retval.upgrd.2 = load i64* %retval.upgrd.1
- ret i64 %retval.upgrd.2
-}
-
-it should be extended to do so.
-
-//===---------------------------------------------------------------------===//
-
--scalarrepl should promote this to be a vector scalar.
-
- %struct..0anon = type { <4 x float> }
-
-define void @test1(<4 x float> %V, float* %P) {
- %u = alloca %struct..0anon, align 16
- %tmp = getelementptr %struct..0anon* %u, i32 0, i32 0
- store <4 x float> %V, <4 x float>* %tmp
- %tmp1 = bitcast %struct..0anon* %u to [4 x float]*
- %tmp.upgrd.1 = getelementptr [4 x float]* %tmp1, i32 0, i32 1
- %tmp.upgrd.2 = load float* %tmp.upgrd.1
- %tmp3 = mul float %tmp.upgrd.2, 2.000000e+00
- store float %tmp3, float* %P
- ret void
-}
-
-//===---------------------------------------------------------------------===//
-
-Turn this into a single byte store with no load (the other 3 bytes are
-unmodified):
-
-void %test(uint* %P) {
- %tmp = load uint* %P
- %tmp14 = or uint %tmp, 3305111552
- %tmp15 = and uint %tmp14, 3321888767
- store uint %tmp15, uint* %P
- ret void
-}
-
-//===---------------------------------------------------------------------===//
-
-dag/inst combine "clz(x)>>5 -> x==0" for 32-bit x.
-
-Compile:
-
-int bar(int x)
-{
- int t = __builtin_clz(x);
- return -(t>>5);
-}
-
-to:
-
-_bar: addic r3,r3,-1
- subfe r3,r3,r3
- blr
-
-//===---------------------------------------------------------------------===//
-
-Legalize should lower ctlz like this:
- ctlz(x) = popcnt((x-1) & ~x)
-
-on targets that have popcnt but not ctlz. itanium, what else?
-
-//===---------------------------------------------------------------------===//
-
-quantum_sigma_x in 462.libquantum contains the following loop:
-
- for(i=0; i<reg->size; i++)
- {
- /* Flip the target bit of each basis state */
- reg->node[i].state ^= ((MAX_UNSIGNED) 1 << target);
- }
-
-Where MAX_UNSIGNED/state is a 64-bit int. On a 32-bit platform it would be just
-so cool to turn it into something like:
-
- long long Res = ((MAX_UNSIGNED) 1 << target);
- if (target < 32) {
- for(i=0; i<reg->size; i++)
- reg->node[i].state ^= Res & 0xFFFFFFFFULL;
- } else {
- for(i=0; i<reg->size; i++)
- reg->node[i].state ^= Res & 0xFFFFFFFF00000000ULL
- }
-
-... which would only do one 32-bit XOR per loop iteration instead of two.
-
-It would also be nice to recognize the reg->size doesn't alias reg->node[i], but
-alas...
-
-//===---------------------------------------------------------------------===//
-
-This isn't recognized as bswap by instcombine:
-
-unsigned int swap_32(unsigned int v) {
- v = ((v & 0x00ff00ffU) << 8) | ((v & 0xff00ff00U) >> 8);
- v = ((v & 0x0000ffffU) << 16) | ((v & 0xffff0000U) >> 16);
- return v;
-}
-
-Nor is this (yes, it really is bswap):
-
-unsigned long reverse(unsigned v) {
- unsigned t;
- t = v ^ ((v << 16) | (v >> 16));
- t &= ~0xff0000;
- v = (v << 24) | (v >> 8);
- return v ^ (t >> 8);
-}
-
-//===---------------------------------------------------------------------===//
-
-These should turn into single 16-bit (unaligned?) loads on little/big endian
-processors.
-
-unsigned short read_16_le(const unsigned char *adr) {
- return adr[0] | (adr[1] << 8);
-}
-unsigned short read_16_be(const unsigned char *adr) {
- return (adr[0] << 8) | adr[1];
-}
-
-//===---------------------------------------------------------------------===//
-
--instcombine should handle this transform:
- icmp pred (sdiv X / C1 ), C2
-when X, C1, and C2 are unsigned. Similarly for udiv and signed operands.
-
-Currently InstCombine avoids this transform but will do it when the signs of
-the operands and the sign of the divide match. See the FIXME in
-InstructionCombining.cpp in the visitSetCondInst method after the switch case
-for Instruction::UDiv (around line 4447) for more details.
-
-The SingleSource/Benchmarks/Shootout-C++/hash and hash2 tests have examples of
-this construct.
-
-//===---------------------------------------------------------------------===//
-
-Instcombine misses several of these cases (see the testcase in the patch):
-http://gcc.gnu.org/ml/gcc-patches/2006-10/msg01519.html
-
-//===---------------------------------------------------------------------===//
-
-viterbi speeds up *significantly* if the various "history" related copy loops
-are turned into memcpy calls at the source level. We need a "loops to memcpy"
-pass.
-
-//===---------------------------------------------------------------------===//
-
-Consider:
-
-typedef unsigned U32;
-typedef unsigned long long U64;
-int test (U32 *inst, U64 *regs) {
- U64 effective_addr2;
- U32 temp = *inst;
- int r1 = (temp >> 20) & 0xf;
- int b2 = (temp >> 16) & 0xf;
- effective_addr2 = temp & 0xfff;
- if (b2) effective_addr2 += regs[b2];
- b2 = (temp >> 12) & 0xf;
- if (b2) effective_addr2 += regs[b2];
- effective_addr2 &= regs[4];
- if ((effective_addr2 & 3) == 0)
- return 1;
- return 0;
-}
-
-Note that only the low 2 bits of effective_addr2 are used. On 32-bit systems,
-we don't eliminate the computation of the top half of effective_addr2 because
-we don't have whole-function selection dags. On x86, this means we use one
-extra register for the function when effective_addr2 is declared as U64 than
-when it is declared U32.
-
-//===---------------------------------------------------------------------===//
-
-Promote for i32 bswap can use i64 bswap + shr. Useful on targets with 64-bit
-regs and bswap, like itanium.
-
-//===---------------------------------------------------------------------===//
-
-LSR should know what GPR types a target has. This code:
-
-volatile short X, Y; // globals
-
-void foo(int N) {
- int i;
- for (i = 0; i < N; i++) { X = i; Y = i*4; }
-}
-
-produces two identical IV's (after promotion) on PPC/ARM:
-
-LBB1_1: @bb.preheader
- mov r3, #0
- mov r2, r3
- mov r1, r3
-LBB1_2: @bb
- ldr r12, LCPI1_0
- ldr r12, [r12]
- strh r2, [r12]
- ldr r12, LCPI1_1
- ldr r12, [r12]
- strh r3, [r12]
- add r1, r1, #1 <- [0,+,1]
- add r3, r3, #4
- add r2, r2, #1 <- [0,+,1]
- cmp r1, r0
- bne LBB1_2 @bb
-
-
-//===---------------------------------------------------------------------===//
-
-Tail call elim should be more aggressive, checking to see if the call is
-followed by an uncond branch to an exit block.
-
-; This testcase is due to tail-duplication not wanting to copy the return
-; instruction into the terminating blocks because there was other code
-; optimized out of the function after the taildup happened.
-; RUN: llvm-as < %s | opt -tailcallelim | llvm-dis | not grep call
-
-define i32 @t4(i32 %a) {
-entry:
- %tmp.1 = and i32 %a, 1 ; <i32> [#uses=1]
- %tmp.2 = icmp ne i32 %tmp.1, 0 ; <i1> [#uses=1]
- br i1 %tmp.2, label %then.0, label %else.0
-
-then.0: ; preds = %entry
- %tmp.5 = add i32 %a, -1 ; <i32> [#uses=1]
- %tmp.3 = call i32 @t4( i32 %tmp.5 ) ; <i32> [#uses=1]
- br label %return
-
-else.0: ; preds = %entry
- %tmp.7 = icmp ne i32 %a, 0 ; <i1> [#uses=1]
- br i1 %tmp.7, label %then.1, label %return
-
-then.1: ; preds = %else.0
- %tmp.11 = add i32 %a, -2 ; <i32> [#uses=1]
- %tmp.9 = call i32 @t4( i32 %tmp.11 ) ; <i32> [#uses=1]
- br label %return
-
-return: ; preds = %then.1, %else.0, %then.0
- %result.0 = phi i32 [ 0, %else.0 ], [ %tmp.3, %then.0 ],
- [ %tmp.9, %then.1 ]
- ret i32 %result.0
-}
-
-//===---------------------------------------------------------------------===//
-
-Tail recursion elimination is not transforming this function, because it is
-returning n, which fails the isDynamicConstant check in the accumulator
-recursion checks.
-
-long long fib(const long long n) {
- switch(n) {
- case 0:
- case 1:
- return n;
- default:
- return fib(n-1) + fib(n-2);
- }
-}
-
-//===---------------------------------------------------------------------===//
-
-Argument promotion should promote arguments for recursive functions, like
-this:
-
-; RUN: llvm-as < %s | opt -argpromotion | llvm-dis | grep x.val
-
-define internal i32 @foo(i32* %x) {
-entry:
- %tmp = load i32* %x ; <i32> [#uses=0]
- %tmp.foo = call i32 @foo( i32* %x ) ; <i32> [#uses=1]
- ret i32 %tmp.foo
-}
-
-define i32 @bar(i32* %x) {
-entry:
- %tmp3 = call i32 @foo( i32* %x ) ; <i32> [#uses=1]
- ret i32 %tmp3
-}
-
-//===---------------------------------------------------------------------===//
-
-"basicaa" should know how to look through "or" instructions that act like add
-instructions. For example in this code, the x*4+1 is turned into x*4 | 1, and
-basicaa can't analyze the array subscript, leading to duplicated loads in the
-generated code:
-
-void test(int X, int Y, int a[]) {
-int i;
- for (i=2; i<1000; i+=4) {
- a[i+0] = a[i-1+0]*a[i-2+0];
- a[i+1] = a[i-1+1]*a[i-2+1];
- a[i+2] = a[i-1+2]*a[i-2+2];
- a[i+3] = a[i-1+3]*a[i-2+3];
- }
-}
-
-//===---------------------------------------------------------------------===//
-
-We should investigate an instruction sinking pass. Consider this silly
-example in pic mode:
-
-#include <assert.h>
-void foo(int x) {
- assert(x);
- //...
-}
-
-we compile this to:
-_foo:
- subl $28, %esp
- call "L1$pb"
-"L1$pb":
- popl %eax
- cmpl $0, 32(%esp)
- je LBB1_2 # cond_true
-LBB1_1: # return
- # ...
- addl $28, %esp
- ret
-LBB1_2: # cond_true
-...
-
-The PIC base computation (call+popl) is only used on one path through the
-code, but is currently always computed in the entry block. It would be
-better to sink the picbase computation down into the block for the
-assertion, as it is the only one that uses it. This happens for a lot of
-code with early outs.
-
-Another example is loads of arguments, which are usually emitted into the
-entry block on targets like x86. If not used in all paths through a
-function, they should be sunk into the ones that do.
-
-In this case, whole-function-isel would also handle this.
-
-//===---------------------------------------------------------------------===//
-
-Investigate lowering of sparse switch statements into perfect hash tables:
-http://burtleburtle.net/bob/hash/perfect.html
-
-//===---------------------------------------------------------------------===//
-
-We should turn things like "load+fabs+store" and "load+fneg+store" into the
-corresponding integer operations. On a yonah, this loop:
-
-double a[256];
-void foo() {
- int i, b;
- for (b = 0; b < 10000000; b++)
- for (i = 0; i < 256; i++)
- a[i] = -a[i];
-}
-
-is twice as slow as this loop:
-
-long long a[256];
-void foo() {
- int i, b;
- for (b = 0; b < 10000000; b++)
- for (i = 0; i < 256; i++)
- a[i] ^= (1ULL << 63);
-}
-
-and I suspect other processors are similar. On X86 in particular this is a
-big win because doing this with integers allows the use of read/modify/write
-instructions.
-
-//===---------------------------------------------------------------------===//
-
-DAG Combiner should try to combine small loads into larger loads when
-profitable. For example, we compile this C++ example:
-
-struct THotKey { short Key; bool Control; bool Shift; bool Alt; };
-extern THotKey m_HotKey;
-THotKey GetHotKey () { return m_HotKey; }
-
-into (-O3 -fno-exceptions -static -fomit-frame-pointer):
-
-__Z9GetHotKeyv:
- pushl %esi
- movl 8(%esp), %eax
- movb _m_HotKey+3, %cl
- movb _m_HotKey+4, %dl
- movb _m_HotKey+2, %ch
- movw _m_HotKey, %si
- movw %si, (%eax)
- movb %ch, 2(%eax)
- movb %cl, 3(%eax)
- movb %dl, 4(%eax)
- popl %esi
- ret $4
-
-GCC produces:
-
-__Z9GetHotKeyv:
- movl _m_HotKey, %edx
- movl 4(%esp), %eax
- movl %edx, (%eax)
- movzwl _m_HotKey+4, %edx
- movw %dx, 4(%eax)
- ret $4
-
-The LLVM IR contains the needed alignment info, so we should be able to
-merge the loads and stores into 4-byte loads:
-
- %struct.THotKey = type { i16, i8, i8, i8 }
-define void @_Z9GetHotKeyv(%struct.THotKey* sret %agg.result) nounwind {
-...
- %tmp2 = load i16* getelementptr (@m_HotKey, i32 0, i32 0), align 8
- %tmp5 = load i8* getelementptr (@m_HotKey, i32 0, i32 1), align 2
- %tmp8 = load i8* getelementptr (@m_HotKey, i32 0, i32 2), align 1
- %tmp11 = load i8* getelementptr (@m_HotKey, i32 0, i32 3), align 2
-
-Alternatively, we should use a small amount of base-offset alias analysis
-to make it so the scheduler doesn't need to hold all the loads in regs at
-once.
-
-//===---------------------------------------------------------------------===//
-
-We should extend parameter attributes to capture more information about
-pointer parameters for alias analysis. Some ideas:
-
-1. Add a "nocapture" attribute, which indicates that the callee does not store
- the address of the parameter into a global or any other memory location
- visible to the callee. This can be used to make basicaa and other analyses
- more powerful. It is true for things like memcpy, strcat, and many other
- things, including structs passed by value, most C++ references, etc.
-2. Generalize readonly to be set on parameters. This is important mod/ref
- info for the function, which is important for basicaa and others. It can
- also be used by the inliner to avoid inserting a memcpy for byval
- arguments when the function is inlined.
-
-These functions can be inferred by various analysis passes such as the
-globalsmodrefaa pass. Note that getting #2 right is actually really tricky.
-Consider this code:
-
-struct S; S G;
-void caller(S byvalarg) { G.field = 1; ... }
-void callee() { caller(G); }
-
-The fact that the caller does not modify byval arg is not enough, we need
-to know that it doesn't modify G either. This is very tricky.
-
-//===---------------------------------------------------------------------===//
-
-We should add an FRINT node to the DAG to model targets that have legal
-implementations of ceil/floor/rint.
-
-//===---------------------------------------------------------------------===//
-
-This GCC bug: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34043
-contains a testcase that compiles down to:
-
- %struct.XMM128 = type { <4 x float> }
-..
- %src = alloca %struct.XMM128
-..
- %tmp6263 = bitcast %struct.XMM128* %src to <2 x i64>*
- %tmp65 = getelementptr %struct.XMM128* %src, i32 0, i32 0
- store <2 x i64> %tmp5899, <2 x i64>* %tmp6263, align 16
- %tmp66 = load <4 x float>* %tmp65, align 16
- %tmp71 = add <4 x float> %tmp66, %tmp66
-
-If the mid-level optimizer turned the bitcast of pointer + store of tmp5899
-into a bitcast of the vector value and a store to the pointer, then the
-store->load could be easily removed.
-
-//===---------------------------------------------------------------------===//
-
-Consider:
-
-int test() {
- long long input[8] = {1,1,1,1,1,1,1,1};
- foo(input);
-}
-
-We currently compile this into a memcpy from a global array since the
-initializer is fairly large and not memset'able. This is good, but the memcpy
-gets lowered to load/stores in the code generator. This is also ok, except
-that the codegen lowering for memcpy doesn't handle the case when the source
-is a constant global. This gives us atrocious code like this:
-
- call "L1$pb"
-"L1$pb":
- popl %eax
- movl _C.0.1444-"L1$pb"+32(%eax), %ecx
- movl %ecx, 40(%esp)
- movl _C.0.1444-"L1$pb"+20(%eax), %ecx
- movl %ecx, 28(%esp)
- movl _C.0.1444-"L1$pb"+36(%eax), %ecx
- movl %ecx, 44(%esp)
- movl _C.0.1444-"L1$pb"+44(%eax), %ecx
- movl %ecx, 52(%esp)
- movl _C.0.1444-"L1$pb"+40(%eax), %ecx
- movl %ecx, 48(%esp)
- movl _C.0.1444-"L1$pb"+12(%eax), %ecx
- movl %ecx, 20(%esp)
- movl _C.0.1444-"L1$pb"+4(%eax), %ecx
-...
-
-instead of:
- movl $1, 16(%esp)
- movl $0, 20(%esp)
- movl $1, 24(%esp)
- movl $0, 28(%esp)
- movl $1, 32(%esp)
- movl $0, 36(%esp)
- ...
-
-//===---------------------------------------------------------------------===//
-
-http://llvm.org/PR717:
-
-The following code should compile into "ret int undef". Instead, LLVM
-produces "ret int 0":
-
-int f() {
- int x = 4;
- int y;
- if (x == 3) y = 0;
- return y;
-}
-
-//===---------------------------------------------------------------------===//
-
-The loop unroller should partially unroll loops (instead of peeling them)
-when code growth isn't too bad and when an unroll count allows simplification
-of some code within the loop. One trivial example is:
-
-#include <stdio.h>
-int main() {
- int nRet = 17;
- int nLoop;
- for ( nLoop = 0; nLoop < 1000; nLoop++ ) {
- if ( nLoop & 1 )
- nRet += 2;
- else
- nRet -= 1;
- }
- return nRet;
-}
-
-Unrolling by 2 would eliminate the '&1' in both copies, leading to a net
-reduction in code size. The resultant code would then also be suitable for
-exit value computation.
-
-//===---------------------------------------------------------------------===//
-
-We miss a bunch of rotate opportunities on various targets, including ppc, x86,
-etc. On X86, we miss a bunch of 'rotate by variable' cases because the rotate
-matching code in dag combine doesn't look through truncates aggressively
-enough. Here are some testcases reduces from GCC PR17886:
-
-unsigned long long f(unsigned long long x, int y) {
- return (x << y) | (x >> 64-y);
-}
-unsigned f2(unsigned x, int y){
- return (x << y) | (x >> 32-y);
-}
-unsigned long long f3(unsigned long long x){
- int y = 9;
- return (x << y) | (x >> 64-y);
-}
-unsigned f4(unsigned x){
- int y = 10;
- return (x << y) | (x >> 32-y);
-}
-unsigned long long f5(unsigned long long x, unsigned long long y) {
- return (x << 8) | ((y >> 48) & 0xffull);
-}
-unsigned long long f6(unsigned long long x, unsigned long long y, int z) {
- switch(z) {
- case 1:
- return (x << 8) | ((y >> 48) & 0xffull);
- case 2:
- return (x << 16) | ((y >> 40) & 0xffffull);
- case 3:
- return (x << 24) | ((y >> 32) & 0xffffffull);
- case 4:
- return (x << 32) | ((y >> 24) & 0xffffffffull);
- default:
- return (x << 40) | ((y >> 16) & 0xffffffffffull);
- }
-}
-
-On X86-64, we only handle f3/f4 right. On x86-32, several of these
-generate truly horrible code, instead of using shld and friends. On
-ARM, we end up with calls to L___lshrdi3/L___ashldi3 in f, which is
-badness. PPC64 misses f, f5 and f6. CellSPU aborts in isel.
-
-//===---------------------------------------------------------------------===//
-
-We do a number of simplifications in simplify libcalls to strength reduce
-standard library functions, but we don't currently merge them together. For
-example, it is useful to merge memcpy(a,b,strlen(b)) -> strcpy. This can only
-be done safely if "b" isn't modified between the strlen and memcpy of course.
-
-//===---------------------------------------------------------------------===//
-
-define i32 @test2(float %X, float %Y) {
-entry:
- %tmp3 = fcmp uno float %X, %Y ; <i1> [#uses=1]
- %tmp34 = zext i1 %tmp3 to i8 ; <i8> [#uses=1]
- %tmp = xor i8 %tmp34, 1 ; <i8> [#uses=1]
- %toBoolnot5 = zext i8 %tmp to i32 ; <i32> [#uses=1]
- ret i32 %toBoolnot5
-}
-
-could be optimized further. Instcombine should use its bitwise analysis to
-collapse the zext/xor/zext structure to an xor/zext and then remove the
-xor by reversing the fcmp.
-
-Desired output:
-
-define i32 @test2(float %X, float %Y) {
-entry:
- %tmp3 = fcmp ord float %X, %Y ; <i1> [#uses=1]
- %tmp34 = zext i1 %tmp3 to i32 ; <i32> [#uses=1]
- ret i32 %tmp34
-}
-
-To fix this, we need to make CanEvaluateInDifferentType smarter.
-
-//===---------------------------------------------------------------------===//
-
diff --git a/release_23/lib/Target/Sparc/DelaySlotFiller.cpp b/release_23/lib/Target/Sparc/DelaySlotFiller.cpp
deleted file mode 100644
index 818573253f04..000000000000
--- a/release_23/lib/Target/Sparc/DelaySlotFiller.cpp
+++ /dev/null
@@ -1,76 +0,0 @@
-//===-- DelaySlotFiller.cpp - SPARC delay slot filler ---------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This is a simple local pass that fills delay slots with NOPs.
-//
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "delayslotfiller"
-#include "Sparc.h"
-#include "llvm/CodeGen/MachineFunctionPass.h"
-#include "llvm/CodeGen/MachineInstrBuilder.h"
-#include "llvm/Target/TargetMachine.h"
-#include "llvm/Target/TargetInstrInfo.h"
-#include "llvm/ADT/Statistic.h"
-using namespace llvm;
-
-STATISTIC(FilledSlots, "Number of delay slots filled");
-
-namespace {
- struct Filler : public MachineFunctionPass {
- /// Target machine description which we query for reg. names, data
- /// layout, etc.
- ///
- TargetMachine &TM;
- const TargetInstrInfo *TII;
-
- static char ID;
- Filler(TargetMachine &tm)
- : MachineFunctionPass((intptr_t)&ID), TM(tm), TII(tm.getInstrInfo()) { }
-
- virtual const char *getPassName() const {
- return "SPARC Delay Slot Filler";
- }
-
- bool runOnMachineBasicBlock(MachineBasicBlock &MBB);
- bool runOnMachineFunction(MachineFunction &F) {
- bool Changed = false;
- for (MachineFunction::iterator FI = F.begin(), FE = F.end();
- FI != FE; ++FI)
- Changed |= runOnMachineBasicBlock(*FI);
- return Changed;
- }
-
- };
- char Filler::ID = 0;
-} // end of anonymous namespace
-
-/// createSparcDelaySlotFillerPass - Returns a pass that fills in delay
-/// slots in Sparc MachineFunctions
-///
-FunctionPass *llvm::createSparcDelaySlotFillerPass(TargetMachine &tm) {
- return new Filler(tm);
-}
-
-/// runOnMachineBasicBlock - Fill in delay slots for the given basic block.
-/// Currently, we fill delay slots with NOPs. We assume there is only one
-/// delay slot per delayed instruction.
-///
-bool Filler::runOnMachineBasicBlock(MachineBasicBlock &MBB) {
- bool Changed = false;
- for (MachineBasicBlock::iterator I = MBB.begin(); I != MBB.end(); ++I)
- if (I->getDesc().hasDelaySlot()) {
- MachineBasicBlock::iterator J = I;
- ++J;
- BuildMI(MBB, J, TII->get(SP::NOP));
- ++FilledSlots;
- Changed = true;
- }
- return Changed;
-}
diff --git a/release_23/lib/Target/Sparc/FPMover.cpp b/release_23/lib/Target/Sparc/FPMover.cpp
deleted file mode 100644
index 016215b9717d..000000000000
--- a/release_23/lib/Target/Sparc/FPMover.cpp
+++ /dev/null
@@ -1,138 +0,0 @@
-//===-- FPMover.cpp - Sparc double-precision floating point move fixer ----===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// Expand FpMOVD/FpABSD/FpNEGD instructions into their single-precision pieces.
-//
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "fpmover"
-#include "Sparc.h"
-#include "SparcSubtarget.h"
-#include "llvm/CodeGen/MachineFunctionPass.h"
-#include "llvm/CodeGen/MachineInstrBuilder.h"
-#include "llvm/Target/TargetMachine.h"
-#include "llvm/Target/TargetInstrInfo.h"
-#include "llvm/ADT/Statistic.h"
-#include "llvm/Support/Debug.h"
-using namespace llvm;
-
-STATISTIC(NumFpDs , "Number of instructions translated");
-STATISTIC(NoopFpDs, "Number of noop instructions removed");
-
-namespace {
- struct FPMover : public MachineFunctionPass {
- /// Target machine description which we query for reg. names, data
- /// layout, etc.
- ///
- TargetMachine &TM;
-
- static char ID;
- FPMover(TargetMachine &tm)
- : MachineFunctionPass((intptr_t)&ID), TM(tm) { }
-
- virtual const char *getPassName() const {
- return "Sparc Double-FP Move Fixer";
- }
-
- bool runOnMachineBasicBlock(MachineBasicBlock &MBB);
- bool runOnMachineFunction(MachineFunction &F);
- };
- char FPMover::ID = 0;
-} // end of anonymous namespace
-
-/// createSparcFPMoverPass - Returns a pass that turns FpMOVD
-/// instructions into FMOVS instructions
-///
-FunctionPass *llvm::createSparcFPMoverPass(TargetMachine &tm) {
- return new FPMover(tm);
-}
-
-/// getDoubleRegPair - Given a DFP register, return the even and odd FP
-/// registers that correspond to it.
-static void getDoubleRegPair(unsigned DoubleReg, unsigned &EvenReg,
- unsigned &OddReg) {
- static const unsigned EvenHalvesOfPairs[] = {
- SP::F0, SP::F2, SP::F4, SP::F6, SP::F8, SP::F10, SP::F12, SP::F14,
- SP::F16, SP::F18, SP::F20, SP::F22, SP::F24, SP::F26, SP::F28, SP::F30
- };
- static const unsigned OddHalvesOfPairs[] = {
- SP::F1, SP::F3, SP::F5, SP::F7, SP::F9, SP::F11, SP::F13, SP::F15,
- SP::F17, SP::F19, SP::F21, SP::F23, SP::F25, SP::F27, SP::F29, SP::F31
- };
- static const unsigned DoubleRegsInOrder[] = {
- SP::D0, SP::D1, SP::D2, SP::D3, SP::D4, SP::D5, SP::D6, SP::D7, SP::D8,
- SP::D9, SP::D10, SP::D11, SP::D12, SP::D13, SP::D14, SP::D15
- };
- for (unsigned i = 0; i < sizeof(DoubleRegsInOrder)/sizeof(unsigned); ++i)
- if (DoubleRegsInOrder[i] == DoubleReg) {
- EvenReg = EvenHalvesOfPairs[i];
- OddReg = OddHalvesOfPairs[i];
- return;
- }
- assert(0 && "Can't find reg");
-}
-
-/// runOnMachineBasicBlock - Fixup FpMOVD instructions in this MBB.
-///
-bool FPMover::runOnMachineBasicBlock(MachineBasicBlock &MBB) {
- bool Changed = false;
- for (MachineBasicBlock::iterator I = MBB.begin(); I != MBB.end(); ) {
- MachineInstr *MI = I++;
- if (MI->getOpcode() == SP::FpMOVD || MI->getOpcode() == SP::FpABSD ||
- MI->getOpcode() == SP::FpNEGD) {
- Changed = true;
- unsigned DestDReg = MI->getOperand(0).getReg();
- unsigned SrcDReg = MI->getOperand(1).getReg();
- if (DestDReg == SrcDReg && MI->getOpcode() == SP::FpMOVD) {
- MBB.erase(MI); // Eliminate the noop copy.
- ++NoopFpDs;
- continue;
- }
-
- unsigned EvenSrcReg = 0, OddSrcReg = 0, EvenDestReg = 0, OddDestReg = 0;
- getDoubleRegPair(DestDReg, EvenDestReg, OddDestReg);
- getDoubleRegPair(SrcDReg, EvenSrcReg, OddSrcReg);
-
- const TargetInstrInfo *TII = TM.getInstrInfo();
- if (MI->getOpcode() == SP::FpMOVD)
- MI->setDesc(TII->get(SP::FMOVS));
- else if (MI->getOpcode() == SP::FpNEGD)
- MI->setDesc(TII->get(SP::FNEGS));
- else if (MI->getOpcode() == SP::FpABSD)
- MI->setDesc(TII->get(SP::FABSS));
- else
- assert(0 && "Unknown opcode!");
-
- MI->getOperand(0).setReg(EvenDestReg);
- MI->getOperand(1).setReg(EvenSrcReg);
- DOUT << "FPMover: the modified instr is: " << *MI;
- // Insert copy for the other half of the double.
- if (DestDReg != SrcDReg) {
- MI = BuildMI(MBB, I, TM.getInstrInfo()->get(SP::FMOVS), OddDestReg)
- .addReg(OddSrcReg);
- DOUT << "FPMover: the inserted instr is: " << *MI;
- }
- ++NumFpDs;
- }
- }
- return Changed;
-}
-
-bool FPMover::runOnMachineFunction(MachineFunction &F) {
- // If the target has V9 instructions, the fp-mover pseudos will never be
- // emitted. Avoid a scan of the instructions to improve compile time.
- if (TM.getSubtarget<SparcSubtarget>().isV9())
- return false;
-
- bool Changed = false;
- for (MachineFunction::iterator FI = F.begin(), FE = F.end();
- FI != FE; ++FI)
- Changed |= runOnMachineBasicBlock(*FI);
- return Changed;
-}
diff --git a/release_23/lib/Target/Sparc/Makefile b/release_23/lib/Target/Sparc/Makefile
deleted file mode 100644
index 69a4cf2e8a99..000000000000
--- a/release_23/lib/Target/Sparc/Makefile
+++ /dev/null
@@ -1,20 +0,0 @@
-##===- lib/Target/Sparc/Makefile ---------------------------*- Makefile -*-===##
-#
-# The LLVM Compiler Infrastructure
-#
-# This file is distributed under the University of Illinois Open Source
-# License. See LICENSE.TXT for details.
-#
-##===----------------------------------------------------------------------===##
-LEVEL = ../../..
-LIBRARYNAME = LLVMSparc
-TARGET = Sparc
-
-# Make sure that tblgen is run, first thing.
-BUILT_SOURCES = SparcGenRegisterInfo.h.inc SparcGenRegisterNames.inc \
- SparcGenRegisterInfo.inc SparcGenInstrNames.inc \
- SparcGenInstrInfo.inc SparcGenAsmWriter.inc \
- SparcGenDAGISel.inc SparcGenSubtarget.inc SparcGenCallingConv.inc
-
-include $(LEVEL)/Makefile.common
-
diff --git a/release_23/lib/Target/Sparc/README.txt b/release_23/lib/Target/Sparc/README.txt
deleted file mode 100644
index cc24abf7286f..000000000000
--- a/release_23/lib/Target/Sparc/README.txt
+++ /dev/null
@@ -1,58 +0,0 @@
-
-To-do
------
-
-* Keep the address of the constant pool in a register instead of forming its
- address all of the time.
-* We can fold small constant offsets into the %hi/%lo references to constant
- pool addresses as well.
-* When in V9 mode, register allocate %icc[0-3].
-* Add support for isel'ing UMUL_LOHI instead of marking it as Expand.
-* Emit the 'Branch on Integer Register with Prediction' instructions. It's
- not clear how to write a pattern for this though:
-
-float %t1(int %a, int* %p) {
- %C = seteq int %a, 0
- br bool %C, label %T, label %F
-T:
- store int 123, int* %p
- br label %F
-F:
- ret float undef
-}
-
-codegens to this:
-
-t1:
- save -96, %o6, %o6
-1) subcc %i0, 0, %l0
-1) bne .LBBt1_2 ! F
- nop
-.LBBt1_1: ! T
- or %g0, 123, %l0
- st %l0, [%i1]
-.LBBt1_2: ! F
- restore %g0, %g0, %g0
- retl
- nop
-
-1) should be replaced with a brz in V9 mode.
-
-* Same as above, but emit conditional move on register zero (p192) in V9
- mode. Testcase:
-
-int %t1(int %a, int %b) {
- %C = seteq int %a, 0
- %D = select bool %C, int %a, int %b
- ret int %D
-}
-
-* Emit MULX/[SU]DIVX instructions in V9 mode instead of fiddling
- with the Y register, if they are faster.
-
-* Codegen bswap(load)/store(bswap) -> load/store ASI
-
-* Implement frame pointer elimination, e.g. eliminate save/restore for
- leaf fns.
-* Fill delay slots
-
diff --git a/release_23/lib/Target/Sparc/Sparc.h b/release_23/lib/Target/Sparc/Sparc.h
deleted file mode 100644
index 2788bf6cd85f..000000000000
--- a/release_23/lib/Target/Sparc/Sparc.h
+++ /dev/null
@@ -1,116 +0,0 @@
-//===-- Sparc.h - Top-level interface for Sparc representation --*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains the entry points for global functions defined in the LLVM
-// Sparc back-end.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef TARGET_SPARC_H
-#define TARGET_SPARC_H
-
-#include <iosfwd>
-#include <cassert>
-
-namespace llvm {
- class FunctionPass;
- class TargetMachine;
-
- FunctionPass *createSparcISelDag(TargetMachine &TM);
- FunctionPass *createSparcCodePrinterPass(std::ostream &OS, TargetMachine &TM);
- FunctionPass *createSparcDelaySlotFillerPass(TargetMachine &TM);
- FunctionPass *createSparcFPMoverPass(TargetMachine &TM);
-} // end namespace llvm;
-
-// Defines symbolic names for Sparc registers. This defines a mapping from
-// register name to register number.
-//
-#include "SparcGenRegisterNames.inc"
-
-// Defines symbolic names for the Sparc instructions.
-//
-#include "SparcGenInstrNames.inc"
-
-
-namespace llvm {
- // Enums corresponding to Sparc condition codes, both icc's and fcc's. These
- // values must be kept in sync with the ones in the .td file.
- namespace SPCC {
- enum CondCodes {
- //ICC_A = 8 , // Always
- //ICC_N = 0 , // Never
- ICC_NE = 9 , // Not Equal
- ICC_E = 1 , // Equal
- ICC_G = 10 , // Greater
- ICC_LE = 2 , // Less or Equal
- ICC_GE = 11 , // Greater or Equal
- ICC_L = 3 , // Less
- ICC_GU = 12 , // Greater Unsigned
- ICC_LEU = 4 , // Less or Equal Unsigned
- ICC_CC = 13 , // Carry Clear/Great or Equal Unsigned
- ICC_CS = 5 , // Carry Set/Less Unsigned
- ICC_POS = 14 , // Positive
- ICC_NEG = 6 , // Negative
- ICC_VC = 15 , // Overflow Clear
- ICC_VS = 7 , // Overflow Set
-
- //FCC_A = 8+16, // Always
- //FCC_N = 0+16, // Never
- FCC_U = 7+16, // Unordered
- FCC_G = 6+16, // Greater
- FCC_UG = 5+16, // Unordered or Greater
- FCC_L = 4+16, // Less
- FCC_UL = 3+16, // Unordered or Less
- FCC_LG = 2+16, // Less or Greater
- FCC_NE = 1+16, // Not Equal
- FCC_E = 9+16, // Equal
- FCC_UE = 10+16, // Unordered or Equal
- FCC_GE = 11+16, // Greater or Equal
- FCC_UGE = 12+16, // Unordered or Greater or Equal
- FCC_LE = 13+16, // Less or Equal
- FCC_ULE = 14+16, // Unordered or Less or Equal
- FCC_O = 15+16 // Ordered
- };
- }
-
- inline static const char *SPARCCondCodeToString(SPCC::CondCodes CC) {
- switch (CC) {
- default: assert(0 && "Unknown condition code");
- case SPCC::ICC_NE: return "ne";
- case SPCC::ICC_E: return "e";
- case SPCC::ICC_G: return "g";
- case SPCC::ICC_LE: return "le";
- case SPCC::ICC_GE: return "ge";
- case SPCC::ICC_L: return "l";
- case SPCC::ICC_GU: return "gu";
- case SPCC::ICC_LEU: return "leu";
- case SPCC::ICC_CC: return "cc";
- case SPCC::ICC_CS: return "cs";
- case SPCC::ICC_POS: return "pos";
- case SPCC::ICC_NEG: return "neg";
- case SPCC::ICC_VC: return "vc";
- case SPCC::ICC_VS: return "vs";
- case SPCC::FCC_U: return "u";
- case SPCC::FCC_G: return "g";
- case SPCC::FCC_UG: return "ug";
- case SPCC::FCC_L: return "l";
- case SPCC::FCC_UL: return "ul";
- case SPCC::FCC_LG: return "lg";
- case SPCC::FCC_NE: return "ne";
- case SPCC::FCC_E: return "e";
- case SPCC::FCC_UE: return "ue";
- case SPCC::FCC_GE: return "ge";
- case SPCC::FCC_UGE: return "uge";
- case SPCC::FCC_LE: return "le";
- case SPCC::FCC_ULE: return "ule";
- case SPCC::FCC_O: return "o";
- }
- }
-} // end namespace llvm
-#endif
diff --git a/release_23/lib/Target/Sparc/Sparc.td b/release_23/lib/Target/Sparc/Sparc.td
deleted file mode 100644
index b90fcdedaebe..000000000000
--- a/release_23/lib/Target/Sparc/Sparc.td
+++ /dev/null
@@ -1,76 +0,0 @@
-//===- Sparc.td - Describe the Sparc Target Machine -------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-//
-//===----------------------------------------------------------------------===//
-
-//===----------------------------------------------------------------------===//
-// Target-independent interfaces which we are implementing
-//===----------------------------------------------------------------------===//
-
-include "../Target.td"
-
-//===----------------------------------------------------------------------===//
-// SPARC Subtarget features.
-//
-
-def FeatureV9
- : SubtargetFeature<"v9", "IsV9", "true",
- "Enable SPARC-V9 instructions">;
-def FeatureV8Deprecated
- : SubtargetFeature<"deprecated-v8", "V8DeprecatedInsts", "true",
- "Enable deprecated V8 instructions in V9 mode">;
-def FeatureVIS
- : SubtargetFeature<"vis", "IsVIS", "true",
- "Enable UltraSPARC Visual Instruction Set extensions">;
-
-//===----------------------------------------------------------------------===//
-// Register File, Calling Conv, Instruction Descriptions
-//===----------------------------------------------------------------------===//
-
-include "SparcRegisterInfo.td"
-include "SparcCallingConv.td"
-include "SparcInstrInfo.td"
-
-def SparcInstrInfo : InstrInfo {
- // Define how we want to layout our target-specific information field.
- let TSFlagsFields = [];
- let TSFlagsShifts = [];
-}
-
-//===----------------------------------------------------------------------===//
-// SPARC processors supported.
-//===----------------------------------------------------------------------===//
-
-class Proc<string Name, list<SubtargetFeature> Features>
- : Processor<Name, NoItineraries, Features>;
-
-def : Proc<"generic", []>;
-def : Proc<"v8", []>;
-def : Proc<"supersparc", []>;
-def : Proc<"sparclite", []>;
-def : Proc<"f934", []>;
-def : Proc<"hypersparc", []>;
-def : Proc<"sparclite86x", []>;
-def : Proc<"sparclet", []>;
-def : Proc<"tsc701", []>;
-def : Proc<"v9", [FeatureV9]>;
-def : Proc<"ultrasparc", [FeatureV9, FeatureV8Deprecated]>;
-def : Proc<"ultrasparc3", [FeatureV9, FeatureV8Deprecated]>;
-def : Proc<"ultrasparc3-vis", [FeatureV9, FeatureV8Deprecated, FeatureVIS]>;
-
-
-//===----------------------------------------------------------------------===//
-// Declare the target which we are implementing
-//===----------------------------------------------------------------------===//
-
-def Sparc : Target {
- // Pull in Instruction Info:
- let InstructionSet = SparcInstrInfo;
-}
diff --git a/release_23/lib/Target/Sparc/SparcAsmPrinter.cpp b/release_23/lib/Target/Sparc/SparcAsmPrinter.cpp
deleted file mode 100644
index 01bd0929bdf9..000000000000
--- a/release_23/lib/Target/Sparc/SparcAsmPrinter.cpp
+++ /dev/null
@@ -1,290 +0,0 @@
-//===-- SparcAsmPrinter.cpp - Sparc LLVM assembly writer ------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains a printer that converts from our internal representation
-// of machine-dependent LLVM code to GAS-format SPARC assembly language.
-//
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "asm-printer"
-#include "Sparc.h"
-#include "SparcInstrInfo.h"
-#include "llvm/Constants.h"
-#include "llvm/DerivedTypes.h"
-#include "llvm/Module.h"
-#include "llvm/CodeGen/AsmPrinter.h"
-#include "llvm/CodeGen/MachineFunctionPass.h"
-#include "llvm/CodeGen/MachineConstantPool.h"
-#include "llvm/CodeGen/MachineInstr.h"
-#include "llvm/Target/TargetAsmInfo.h"
-#include "llvm/Target/TargetData.h"
-#include "llvm/Target/TargetMachine.h"
-#include "llvm/Support/Mangler.h"
-#include "llvm/ADT/Statistic.h"
-#include "llvm/ADT/StringExtras.h"
-#include "llvm/Support/CommandLine.h"
-#include "llvm/Support/MathExtras.h"
-#include <cctype>
-#include <cstring>
-using namespace llvm;
-
-STATISTIC(EmittedInsts, "Number of machine instrs printed");
-
-namespace {
- struct VISIBILITY_HIDDEN SparcAsmPrinter : public AsmPrinter {
- SparcAsmPrinter(std::ostream &O, TargetMachine &TM, const TargetAsmInfo *T)
- : AsmPrinter(O, TM, T) {
- }
-
- /// We name each basic block in a Function with a unique number, so
- /// that we can consistently refer to them later. This is cleared
- /// at the beginning of each call to runOnMachineFunction().
- ///
- typedef std::map<const Value *, unsigned> ValueMapTy;
- ValueMapTy NumberForBB;
-
- virtual const char *getPassName() const {
- return "Sparc Assembly Printer";
- }
-
- void printOperand(const MachineInstr *MI, int opNum);
- void printMemOperand(const MachineInstr *MI, int opNum,
- const char *Modifier = 0);
- void printCCOperand(const MachineInstr *MI, int opNum);
-
- bool printInstruction(const MachineInstr *MI); // autogenerated.
- bool runOnMachineFunction(MachineFunction &F);
- bool doInitialization(Module &M);
- bool doFinalization(Module &M);
- };
-} // end of anonymous namespace
-
-#include "SparcGenAsmWriter.inc"
-
-/// createSparcCodePrinterPass - Returns a pass that prints the SPARC
-/// assembly code for a MachineFunction to the given output stream,
-/// using the given target machine description. This should work
-/// regardless of whether the function is in SSA form.
-///
-FunctionPass *llvm::createSparcCodePrinterPass(std::ostream &o,
- TargetMachine &tm) {
- return new SparcAsmPrinter(o, tm, tm.getTargetAsmInfo());
-}
-
-/// runOnMachineFunction - This uses the printInstruction()
-/// method to print assembly for each instruction.
-///
-bool SparcAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
- SetupMachineFunction(MF);
-
- // Print out constants referenced by the function
- EmitConstantPool(MF.getConstantPool());
-
- // BBNumber is used here so that a given Printer will never give two
- // BBs the same name. (If you have a better way, please let me know!)
- static unsigned BBNumber = 0;
-
- O << "\n\n";
- // What's my mangled name?
- CurrentFnName = Mang->getValueName(MF.getFunction());
-
- // Print out the label for the function.
- const Function *F = MF.getFunction();
- SwitchToTextSection(getSectionForFunction(*F).c_str(), F);
- EmitAlignment(4, F);
- O << "\t.globl\t" << CurrentFnName << "\n";
- O << "\t.type\t" << CurrentFnName << ", #function\n";
- O << CurrentFnName << ":\n";
-
- // Number each basic block so that we can consistently refer to them
- // in PC-relative references.
- // FIXME: Why not use the MBB numbers?
- NumberForBB.clear();
- for (MachineFunction::const_iterator I = MF.begin(), E = MF.end();
- I != E; ++I) {
- NumberForBB[I->getBasicBlock()] = BBNumber++;
- }
-
- // Print out code for the function.
- for (MachineFunction::const_iterator I = MF.begin(), E = MF.end();
- I != E; ++I) {
- // Print a label for the basic block.
- if (I != MF.begin()) {
- printBasicBlockLabel(I, true, true);
- O << '\n';
- }
- for (MachineBasicBlock::const_iterator II = I->begin(), E = I->end();
- II != E; ++II) {
- // Print the assembly for the instruction.
- printInstruction(II);
- ++EmittedInsts;
- }
- }
-
- // We didn't modify anything.
- return false;
-}
-
-void SparcAsmPrinter::printOperand(const MachineInstr *MI, int opNum) {
- const MachineOperand &MO = MI->getOperand (opNum);
- const TargetRegisterInfo &RI = *TM.getRegisterInfo();
- bool CloseParen = false;
- if (MI->getOpcode() == SP::SETHIi && !MO.isRegister() && !MO.isImmediate()) {
- O << "%hi(";
- CloseParen = true;
- } else if ((MI->getOpcode() == SP::ORri || MI->getOpcode() == SP::ADDri)
- && !MO.isRegister() && !MO.isImmediate()) {
- O << "%lo(";
- CloseParen = true;
- }
- switch (MO.getType()) {
- case MachineOperand::MO_Register:
- if (TargetRegisterInfo::isPhysicalRegister(MO.getReg()))
- O << "%" << LowercaseString (RI.get(MO.getReg()).AsmName);
- else
- O << "%reg" << MO.getReg();
- break;
-
- case MachineOperand::MO_Immediate:
- O << (int)MO.getImm();
- break;
- case MachineOperand::MO_MachineBasicBlock:
- printBasicBlockLabel(MO.getMBB());
- return;
- case MachineOperand::MO_GlobalAddress:
- O << Mang->getValueName(MO.getGlobal());
- break;
- case MachineOperand::MO_ExternalSymbol:
- O << MO.getSymbolName();
- break;
- case MachineOperand::MO_ConstantPoolIndex:
- O << TAI->getPrivateGlobalPrefix() << "CPI" << getFunctionNumber() << "_"
- << MO.getIndex();
- break;
- default:
- O << "<unknown operand type>"; abort (); break;
- }
- if (CloseParen) O << ")";
-}
-
-void SparcAsmPrinter::printMemOperand(const MachineInstr *MI, int opNum,
- const char *Modifier) {
- printOperand(MI, opNum);
-
- // If this is an ADD operand, emit it like normal operands.
- if (Modifier && !strcmp(Modifier, "arith")) {
- O << ", ";
- printOperand(MI, opNum+1);
- return;
- }
-
- if (MI->getOperand(opNum+1).isRegister() &&
- MI->getOperand(opNum+1).getReg() == SP::G0)
- return; // don't print "+%g0"
- if (MI->getOperand(opNum+1).isImmediate() &&
- MI->getOperand(opNum+1).getImm() == 0)
- return; // don't print "+0"
-
- O << "+";
- if (MI->getOperand(opNum+1).isGlobalAddress() ||
- MI->getOperand(opNum+1).isConstantPoolIndex()) {
- O << "%lo(";
- printOperand(MI, opNum+1);
- O << ")";
- } else {
- printOperand(MI, opNum+1);
- }
-}
-
-void SparcAsmPrinter::printCCOperand(const MachineInstr *MI, int opNum) {
- int CC = (int)MI->getOperand(opNum).getImm();
- O << SPARCCondCodeToString((SPCC::CondCodes)CC);
-}
-
-
-
-bool SparcAsmPrinter::doInitialization(Module &M) {
- Mang = new Mangler(M);
- return false; // success
-}
-
-bool SparcAsmPrinter::doFinalization(Module &M) {
- const TargetData *TD = TM.getTargetData();
-
- // Print out module-level global variables here.
- for (Module::const_global_iterator I = M.global_begin(), E = M.global_end();
- I != E; ++I)
- if (I->hasInitializer()) { // External global require no code
- // Check to see if this is a special global used by LLVM, if so, emit it.
- if (EmitSpecialLLVMGlobal(I))
- continue;
-
- O << "\n\n";
- std::string name = Mang->getValueName(I);
- Constant *C = I->getInitializer();
- unsigned Size = TD->getABITypeSize(C->getType());
- unsigned Align = TD->getPreferredAlignment(I);
-
- if (C->isNullValue() &&
- (I->hasLinkOnceLinkage() || I->hasInternalLinkage() ||
- I->hasWeakLinkage() /* FIXME: Verify correct */)) {
- SwitchToDataSection(".data", I);
- if (I->hasInternalLinkage())
- O << "\t.local " << name << "\n";
-
- O << "\t.comm " << name << "," << TD->getABITypeSize(C->getType())
- << "," << Align;
- O << "\n";
- } else {
- switch (I->getLinkage()) {
- case GlobalValue::LinkOnceLinkage:
- case GlobalValue::WeakLinkage: // FIXME: Verify correct for weak.
- // Nonnull linkonce -> weak
- O << "\t.weak " << name << "\n";
- SwitchToDataSection("", I);
- O << "\t.section\t\".llvm.linkonce.d." << name
- << "\",\"aw\",@progbits\n";
- break;
-
- case GlobalValue::AppendingLinkage:
- // FIXME: appending linkage variables should go into a section of
- // their name or something. For now, just emit them as external.
- case GlobalValue::ExternalLinkage:
- // If external or appending, declare as a global symbol
- O << "\t.globl " << name << "\n";
- // FALL THROUGH
- case GlobalValue::InternalLinkage:
- if (C->isNullValue())
- SwitchToDataSection(".bss", I);
- else
- SwitchToDataSection(".data", I);
- break;
- case GlobalValue::GhostLinkage:
- cerr << "Should not have any unmaterialized functions!\n";
- abort();
- case GlobalValue::DLLImportLinkage:
- cerr << "DLLImport linkage is not supported by this target!\n";
- abort();
- case GlobalValue::DLLExportLinkage:
- cerr << "DLLExport linkage is not supported by this target!\n";
- abort();
- default:
- assert(0 && "Unknown linkage type!");
- }
-
- O << "\t.align " << Align << "\n";
- O << "\t.type " << name << ",#object\n";
- O << "\t.size " << name << "," << Size << "\n";
- O << name << ":\n";
- EmitGlobalConstant(C);
- }
- }
-
- return AsmPrinter::doFinalization(M);
-}
diff --git a/release_23/lib/Target/Sparc/SparcCallingConv.td b/release_23/lib/Target/Sparc/SparcCallingConv.td
deleted file mode 100644
index dc0bf8e31226..000000000000
--- a/release_23/lib/Target/Sparc/SparcCallingConv.td
+++ /dev/null
@@ -1,32 +0,0 @@
-//===- SparcCallingConv.td - Calling Conventions Sparc -----*- tablegen -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This describes the calling conventions for the Sparc architectures.
-//
-//===----------------------------------------------------------------------===//
-
-//===----------------------------------------------------------------------===//
-// Return Value Calling Conventions
-//===----------------------------------------------------------------------===//
-
-// Sparc 32-bit C return-value convention.
-def RetCC_Sparc32 : CallingConv<[
- CCIfType<[i32], CCAssignToReg<[I0, I1]>>,
- CCIfType<[f32], CCAssignToReg<[F0]>>,
- CCIfType<[f64], CCAssignToReg<[D0]>>
-]>;
-
-// Sparc 32-bit C Calling convention.
-def CC_Sparc32 : CallingConv<[
- // All arguments get passed in integer registers if there is space.
- CCIfType<[i32, f32, f64], CCAssignToReg<[I0, I1, I2, I3, I4, I5]>>,
-
- // Alternatively, they are assigned to the stack in 4-byte aligned units.
- CCAssignToStack<4, 4>
-]>;
diff --git a/release_23/lib/Target/Sparc/SparcISelDAGToDAG.cpp b/release_23/lib/Target/Sparc/SparcISelDAGToDAG.cpp
deleted file mode 100644
index 3ef27dd642bf..000000000000
--- a/release_23/lib/Target/Sparc/SparcISelDAGToDAG.cpp
+++ /dev/null
@@ -1,198 +0,0 @@
-//===-- SparcISelDAGToDAG.cpp - A dag to dag inst selector for Sparc ------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines an instruction selector for the SPARC target.
-//
-//===----------------------------------------------------------------------===//
-
-#include "SparcISelLowering.h"
-#include "SparcTargetMachine.h"
-#include "llvm/Intrinsics.h"
-#include "llvm/CodeGen/SelectionDAGISel.h"
-#include "llvm/Support/Compiler.h"
-#include "llvm/Support/Debug.h"
-using namespace llvm;
-
-//===----------------------------------------------------------------------===//
-// Instruction Selector Implementation
-//===----------------------------------------------------------------------===//
-
-//===--------------------------------------------------------------------===//
-/// SparcDAGToDAGISel - SPARC specific code to select SPARC machine
-/// instructions for SelectionDAG operations.
-///
-namespace {
-class SparcDAGToDAGISel : public SelectionDAGISel {
- SparcTargetLowering Lowering;
-
- /// Subtarget - Keep a pointer to the Sparc Subtarget around so that we can
- /// make the right decision when generating code for different targets.
- const SparcSubtarget &Subtarget;
-public:
- SparcDAGToDAGISel(TargetMachine &TM)
- : SelectionDAGISel(Lowering), Lowering(TM),
- Subtarget(TM.getSubtarget<SparcSubtarget>()) {
- }
-
- SDNode *Select(SDOperand Op);
-
- // Complex Pattern Selectors.
- bool SelectADDRrr(SDOperand Op, SDOperand N, SDOperand &R1, SDOperand &R2);
- bool SelectADDRri(SDOperand Op, SDOperand N, SDOperand &Base,
- SDOperand &Offset);
-
- /// InstructionSelectBasicBlock - This callback is invoked by
- /// SelectionDAGISel when it has created a SelectionDAG for us to codegen.
- virtual void InstructionSelectBasicBlock(SelectionDAG &DAG);
-
- virtual const char *getPassName() const {
- return "SPARC DAG->DAG Pattern Instruction Selection";
- }
-
- // Include the pieces autogenerated from the target description.
-#include "SparcGenDAGISel.inc"
-};
-} // end anonymous namespace
-
-/// InstructionSelectBasicBlock - This callback is invoked by
-/// SelectionDAGISel when it has created a SelectionDAG for us to codegen.
-void SparcDAGToDAGISel::InstructionSelectBasicBlock(SelectionDAG &DAG) {
- DEBUG(BB->dump());
-
- // Select target instructions for the DAG.
- DAG.setRoot(SelectRoot(DAG.getRoot()));
- DAG.RemoveDeadNodes();
-
- // Emit machine code to BB.
- ScheduleAndEmitDAG(DAG);
-}
-
-bool SparcDAGToDAGISel::SelectADDRri(SDOperand Op, SDOperand Addr,
- SDOperand &Base, SDOperand &Offset) {
- if (FrameIndexSDNode *FIN = dyn_cast<FrameIndexSDNode>(Addr)) {
- Base = CurDAG->getTargetFrameIndex(FIN->getIndex(), MVT::i32);
- Offset = CurDAG->getTargetConstant(0, MVT::i32);
- return true;
- }
- if (Addr.getOpcode() == ISD::TargetExternalSymbol ||
- Addr.getOpcode() == ISD::TargetGlobalAddress)
- return false; // direct calls.
-
- if (Addr.getOpcode() == ISD::ADD) {
- if (ConstantSDNode *CN = dyn_cast<ConstantSDNode>(Addr.getOperand(1))) {
- if (Predicate_simm13(CN)) {
- if (FrameIndexSDNode *FIN =
- dyn_cast<FrameIndexSDNode>(Addr.getOperand(0))) {
- // Constant offset from frame ref.
- Base = CurDAG->getTargetFrameIndex(FIN->getIndex(), MVT::i32);
- } else {
- Base = Addr.getOperand(0);
- }
- Offset = CurDAG->getTargetConstant(CN->getValue(), MVT::i32);
- return true;
- }
- }
- if (Addr.getOperand(0).getOpcode() == SPISD::Lo) {
- Base = Addr.getOperand(1);
- Offset = Addr.getOperand(0).getOperand(0);
- return true;
- }
- if (Addr.getOperand(1).getOpcode() == SPISD::Lo) {
- Base = Addr.getOperand(0);
- Offset = Addr.getOperand(1).getOperand(0);
- return true;
- }
- }
- Base = Addr;
- Offset = CurDAG->getTargetConstant(0, MVT::i32);
- return true;
-}
-
-bool SparcDAGToDAGISel::SelectADDRrr(SDOperand Op, SDOperand Addr,
- SDOperand &R1, SDOperand &R2) {
- if (Addr.getOpcode() == ISD::FrameIndex) return false;
- if (Addr.getOpcode() == ISD::TargetExternalSymbol ||
- Addr.getOpcode() == ISD::TargetGlobalAddress)
- return false; // direct calls.
-
- if (Addr.getOpcode() == ISD::ADD) {
- if (isa<ConstantSDNode>(Addr.getOperand(1)) &&
- Predicate_simm13(Addr.getOperand(1).Val))
- return false; // Let the reg+imm pattern catch this!
- if (Addr.getOperand(0).getOpcode() == SPISD::Lo ||
- Addr.getOperand(1).getOpcode() == SPISD::Lo)
- return false; // Let the reg+imm pattern catch this!
- R1 = Addr.getOperand(0);
- R2 = Addr.getOperand(1);
- return true;
- }
-
- R1 = Addr;
- R2 = CurDAG->getRegister(SP::G0, MVT::i32);
- return true;
-}
-
-SDNode *SparcDAGToDAGISel::Select(SDOperand Op) {
- SDNode *N = Op.Val;
- if (N->getOpcode() >= ISD::BUILTIN_OP_END &&
- N->getOpcode() < SPISD::FIRST_NUMBER)
- return NULL; // Already selected.
-
- switch (N->getOpcode()) {
- default: break;
- case ISD::SDIV:
- case ISD::UDIV: {
- // FIXME: should use a custom expander to expose the SRA to the dag.
- SDOperand DivLHS = N->getOperand(0);
- SDOperand DivRHS = N->getOperand(1);
- AddToISelQueue(DivLHS);
- AddToISelQueue(DivRHS);
-
- // Set the Y register to the high-part.
- SDOperand TopPart;
- if (N->getOpcode() == ISD::SDIV) {
- TopPart = SDOperand(CurDAG->getTargetNode(SP::SRAri, MVT::i32, DivLHS,
- CurDAG->getTargetConstant(31, MVT::i32)), 0);
- } else {
- TopPart = CurDAG->getRegister(SP::G0, MVT::i32);
- }
- TopPart = SDOperand(CurDAG->getTargetNode(SP::WRYrr, MVT::Flag, TopPart,
- CurDAG->getRegister(SP::G0, MVT::i32)), 0);
-
- // FIXME: Handle div by immediate.
- unsigned Opcode = N->getOpcode() == ISD::SDIV ? SP::SDIVrr : SP::UDIVrr;
- return CurDAG->SelectNodeTo(N, Opcode, MVT::i32, DivLHS, DivRHS,
- TopPart);
- }
- case ISD::MULHU:
- case ISD::MULHS: {
- // FIXME: Handle mul by immediate.
- SDOperand MulLHS = N->getOperand(0);
- SDOperand MulRHS = N->getOperand(1);
- AddToISelQueue(MulLHS);
- AddToISelQueue(MulRHS);
- unsigned Opcode = N->getOpcode() == ISD::MULHU ? SP::UMULrr : SP::SMULrr;
- SDNode *Mul = CurDAG->getTargetNode(Opcode, MVT::i32, MVT::Flag,
- MulLHS, MulRHS);
- // The high part is in the Y register.
- return CurDAG->SelectNodeTo(N, SP::RDY, MVT::i32, SDOperand(Mul, 1));
- return NULL;
- }
- }
-
- return SelectCode(Op);
-}
-
-
-/// createSparcISelDag - This pass converts a legalized DAG into a
-/// SPARC-specific DAG, ready for instruction scheduling.
-///
-FunctionPass *llvm::createSparcISelDag(TargetMachine &TM) {
- return new SparcDAGToDAGISel(TM);
-}
diff --git a/release_23/lib/Target/Sparc/SparcISelLowering.cpp b/release_23/lib/Target/Sparc/SparcISelLowering.cpp
deleted file mode 100644
index 3d5ad0b74021..000000000000
--- a/release_23/lib/Target/Sparc/SparcISelLowering.cpp
+++ /dev/null
@@ -1,954 +0,0 @@
-//===-- SparcISelLowering.cpp - Sparc DAG Lowering Implementation ---------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the interfaces that Sparc uses to lower LLVM code into a
-// selection DAG.
-//
-//===----------------------------------------------------------------------===//
-
-#include "SparcISelLowering.h"
-#include "SparcTargetMachine.h"
-#include "llvm/Function.h"
-#include "llvm/CodeGen/CallingConvLower.h"
-#include "llvm/CodeGen/MachineFrameInfo.h"
-#include "llvm/CodeGen/MachineFunction.h"
-#include "llvm/CodeGen/MachineInstrBuilder.h"
-#include "llvm/CodeGen/MachineRegisterInfo.h"
-#include "llvm/CodeGen/SelectionDAG.h"
-using namespace llvm;
-
-
-//===----------------------------------------------------------------------===//
-// Calling Convention Implementation
-//===----------------------------------------------------------------------===//
-
-#include "SparcGenCallingConv.inc"
-
-static SDOperand LowerRET(SDOperand Op, SelectionDAG &DAG) {
- // CCValAssign - represent the assignment of the return value to locations.
- SmallVector<CCValAssign, 16> RVLocs;
- unsigned CC = DAG.getMachineFunction().getFunction()->getCallingConv();
- bool isVarArg = DAG.getMachineFunction().getFunction()->isVarArg();
-
- // CCState - Info about the registers and stack slot.
- CCState CCInfo(CC, isVarArg, DAG.getTarget(), RVLocs);
-
- // Analize return values of ISD::RET
- CCInfo.AnalyzeReturn(Op.Val, RetCC_Sparc32);
-
- // If this is the first return lowered for this function, add the regs to the
- // liveout set for the function.
- if (DAG.getMachineFunction().getRegInfo().liveout_empty()) {
- for (unsigned i = 0; i != RVLocs.size(); ++i)
- if (RVLocs[i].isRegLoc())
- DAG.getMachineFunction().getRegInfo().addLiveOut(RVLocs[i].getLocReg());
- }
-
- SDOperand Chain = Op.getOperand(0);
- SDOperand Flag;
-
- // Copy the result values into the output registers.
- for (unsigned i = 0; i != RVLocs.size(); ++i) {
- CCValAssign &VA = RVLocs[i];
- assert(VA.isRegLoc() && "Can only return in registers!");
-
- // ISD::RET => ret chain, (regnum1,val1), ...
- // So i*2+1 index only the regnums.
- Chain = DAG.getCopyToReg(Chain, VA.getLocReg(), Op.getOperand(i*2+1), Flag);
-
- // Guarantee that all emitted copies are stuck together with flags.
- Flag = Chain.getValue(1);
- }
-
- if (Flag.Val)
- return DAG.getNode(SPISD::RET_FLAG, MVT::Other, Chain, Flag);
- return DAG.getNode(SPISD::RET_FLAG, MVT::Other, Chain);
-}
-
-/// LowerArguments - V8 uses a very simple ABI, where all values are passed in
-/// either one or two GPRs, including FP values. TODO: we should pass FP values
-/// in FP registers for fastcc functions.
-std::vector<SDOperand>
-SparcTargetLowering::LowerArguments(Function &F, SelectionDAG &DAG) {
- MachineFunction &MF = DAG.getMachineFunction();
- MachineRegisterInfo &RegInfo = MF.getRegInfo();
- std::vector<SDOperand> ArgValues;
-
- static const unsigned ArgRegs[] = {
- SP::I0, SP::I1, SP::I2, SP::I3, SP::I4, SP::I5
- };
-
- const unsigned *CurArgReg = ArgRegs, *ArgRegEnd = ArgRegs+6;
- unsigned ArgOffset = 68;
-
- SDOperand Root = DAG.getRoot();
- std::vector<SDOperand> OutChains;
-
- for (Function::arg_iterator I = F.arg_begin(), E = F.arg_end(); I != E; ++I) {
- MVT::ValueType ObjectVT = getValueType(I->getType());
-
- switch (ObjectVT) {
- default: assert(0 && "Unhandled argument type!");
- case MVT::i1:
- case MVT::i8:
- case MVT::i16:
- case MVT::i32:
- if (I->use_empty()) { // Argument is dead.
- if (CurArgReg < ArgRegEnd) ++CurArgReg;
- ArgValues.push_back(DAG.getNode(ISD::UNDEF, ObjectVT));
- } else if (CurArgReg < ArgRegEnd) { // Lives in an incoming GPR
- unsigned VReg = RegInfo.createVirtualRegister(&SP::IntRegsRegClass);
- MF.getRegInfo().addLiveIn(*CurArgReg++, VReg);
- SDOperand Arg = DAG.getCopyFromReg(Root, VReg, MVT::i32);
- if (ObjectVT != MVT::i32) {
- unsigned AssertOp = ISD::AssertSext;
- Arg = DAG.getNode(AssertOp, MVT::i32, Arg,
- DAG.getValueType(ObjectVT));
- Arg = DAG.getNode(ISD::TRUNCATE, ObjectVT, Arg);
- }
- ArgValues.push_back(Arg);
- } else {
- int FrameIdx = MF.getFrameInfo()->CreateFixedObject(4, ArgOffset);
- SDOperand FIPtr = DAG.getFrameIndex(FrameIdx, MVT::i32);
- SDOperand Load;
- if (ObjectVT == MVT::i32) {
- Load = DAG.getLoad(MVT::i32, Root, FIPtr, NULL, 0);
- } else {
- ISD::LoadExtType LoadOp = ISD::SEXTLOAD;
-
- // Sparc is big endian, so add an offset based on the ObjectVT.
- unsigned Offset = 4-std::max(1U, MVT::getSizeInBits(ObjectVT)/8);
- FIPtr = DAG.getNode(ISD::ADD, MVT::i32, FIPtr,
- DAG.getConstant(Offset, MVT::i32));
- Load = DAG.getExtLoad(LoadOp, MVT::i32, Root, FIPtr,
- NULL, 0, ObjectVT);
- Load = DAG.getNode(ISD::TRUNCATE, ObjectVT, Load);
- }
- ArgValues.push_back(Load);
- }
-
- ArgOffset += 4;
- break;
- case MVT::f32:
- if (I->use_empty()) { // Argument is dead.
- if (CurArgReg < ArgRegEnd) ++CurArgReg;
- ArgValues.push_back(DAG.getNode(ISD::UNDEF, ObjectVT));
- } else if (CurArgReg < ArgRegEnd) { // Lives in an incoming GPR
- // FP value is passed in an integer register.
- unsigned VReg = RegInfo.createVirtualRegister(&SP::IntRegsRegClass);
- MF.getRegInfo().addLiveIn(*CurArgReg++, VReg);
- SDOperand Arg = DAG.getCopyFromReg(Root, VReg, MVT::i32);
-
- Arg = DAG.getNode(ISD::BIT_CONVERT, MVT::f32, Arg);
- ArgValues.push_back(Arg);
- } else {
- int FrameIdx = MF.getFrameInfo()->CreateFixedObject(4, ArgOffset);
- SDOperand FIPtr = DAG.getFrameIndex(FrameIdx, MVT::i32);
- SDOperand Load = DAG.getLoad(MVT::f32, Root, FIPtr, NULL, 0);
- ArgValues.push_back(Load);
- }
- ArgOffset += 4;
- break;
-
- case MVT::i64:
- case MVT::f64:
- if (I->use_empty()) { // Argument is dead.
- if (CurArgReg < ArgRegEnd) ++CurArgReg;
- if (CurArgReg < ArgRegEnd) ++CurArgReg;
- ArgValues.push_back(DAG.getNode(ISD::UNDEF, ObjectVT));
- } else {
- SDOperand HiVal;
- if (CurArgReg < ArgRegEnd) { // Lives in an incoming GPR
- unsigned VRegHi = RegInfo.createVirtualRegister(&SP::IntRegsRegClass);
- MF.getRegInfo().addLiveIn(*CurArgReg++, VRegHi);
- HiVal = DAG.getCopyFromReg(Root, VRegHi, MVT::i32);
- } else {
- int FrameIdx = MF.getFrameInfo()->CreateFixedObject(4, ArgOffset);
- SDOperand FIPtr = DAG.getFrameIndex(FrameIdx, MVT::i32);
- HiVal = DAG.getLoad(MVT::i32, Root, FIPtr, NULL, 0);
- }
-
- SDOperand LoVal;
- if (CurArgReg < ArgRegEnd) { // Lives in an incoming GPR
- unsigned VRegLo = RegInfo.createVirtualRegister(&SP::IntRegsRegClass);
- MF.getRegInfo().addLiveIn(*CurArgReg++, VRegLo);
- LoVal = DAG.getCopyFromReg(Root, VRegLo, MVT::i32);
- } else {
- int FrameIdx = MF.getFrameInfo()->CreateFixedObject(4, ArgOffset+4);
- SDOperand FIPtr = DAG.getFrameIndex(FrameIdx, MVT::i32);
- LoVal = DAG.getLoad(MVT::i32, Root, FIPtr, NULL, 0);
- }
-
- // Compose the two halves together into an i64 unit.
- SDOperand WholeValue =
- DAG.getNode(ISD::BUILD_PAIR, MVT::i64, LoVal, HiVal);
-
- // If we want a double, do a bit convert.
- if (ObjectVT == MVT::f64)
- WholeValue = DAG.getNode(ISD::BIT_CONVERT, MVT::f64, WholeValue);
-
- ArgValues.push_back(WholeValue);
- }
- ArgOffset += 8;
- break;
- }
- }
-
- // Store remaining ArgRegs to the stack if this is a varargs function.
- if (F.isVarArg()) {
- // Remember the vararg offset for the va_start implementation.
- VarArgsFrameOffset = ArgOffset;
-
- for (; CurArgReg != ArgRegEnd; ++CurArgReg) {
- unsigned VReg = RegInfo.createVirtualRegister(&SP::IntRegsRegClass);
- MF.getRegInfo().addLiveIn(*CurArgReg, VReg);
- SDOperand Arg = DAG.getCopyFromReg(DAG.getRoot(), VReg, MVT::i32);
-
- int FrameIdx = MF.getFrameInfo()->CreateFixedObject(4, ArgOffset);
- SDOperand FIPtr = DAG.getFrameIndex(FrameIdx, MVT::i32);
-
- OutChains.push_back(DAG.getStore(DAG.getRoot(), Arg, FIPtr, NULL, 0));
- ArgOffset += 4;
- }
- }
-
- if (!OutChains.empty())
- DAG.setRoot(DAG.getNode(ISD::TokenFactor, MVT::Other,
- &OutChains[0], OutChains.size()));
-
- return ArgValues;
-}
-
-static SDOperand LowerCALL(SDOperand Op, SelectionDAG &DAG) {
- unsigned CallingConv = cast<ConstantSDNode>(Op.getOperand(1))->getValue();
- SDOperand Chain = Op.getOperand(0);
- SDOperand Callee = Op.getOperand(4);
- bool isVarArg = cast<ConstantSDNode>(Op.getOperand(2))->getValue() != 0;
-
-#if 0
- // Analyze operands of the call, assigning locations to each operand.
- SmallVector<CCValAssign, 16> ArgLocs;
- CCState CCInfo(CallingConv, isVarArg, DAG.getTarget(), ArgLocs);
- CCInfo.AnalyzeCallOperands(Op.Val, CC_Sparc32);
-
- // Get the size of the outgoing arguments stack space requirement.
- unsigned ArgsSize = CCInfo.getNextStackOffset();
- // FIXME: We can't use this until f64 is known to take two GPRs.
-#else
- (void)CC_Sparc32;
-
- // Count the size of the outgoing arguments.
- unsigned ArgsSize = 0;
- for (unsigned i = 5, e = Op.getNumOperands(); i != e; i += 2) {
- switch (Op.getOperand(i).getValueType()) {
- default: assert(0 && "Unknown value type!");
- case MVT::i1:
- case MVT::i8:
- case MVT::i16:
- case MVT::i32:
- case MVT::f32:
- ArgsSize += 4;
- break;
- case MVT::i64:
- case MVT::f64:
- ArgsSize += 8;
- break;
- }
- }
- if (ArgsSize > 4*6)
- ArgsSize -= 4*6; // Space for first 6 arguments is prereserved.
- else
- ArgsSize = 0;
-#endif
-
- // Keep stack frames 8-byte aligned.
- ArgsSize = (ArgsSize+7) & ~7;
-
- Chain = DAG.getCALLSEQ_START(Chain, DAG.getIntPtrConstant(ArgsSize));
-
- SmallVector<std::pair<unsigned, SDOperand>, 8> RegsToPass;
- SmallVector<SDOperand, 8> MemOpChains;
-
-#if 0
- // Walk the register/memloc assignments, inserting copies/loads.
- for (unsigned i = 0, e = ArgLocs.size(); i != e; ++i) {
- CCValAssign &VA = ArgLocs[i];
-
- // Arguments start after the 5 first operands of ISD::CALL
- SDOperand Arg = Op.getOperand(5+2*VA.getValNo());
-
- // Promote the value if needed.
- switch (VA.getLocInfo()) {
- default: assert(0 && "Unknown loc info!");
- case CCValAssign::Full: break;
- case CCValAssign::SExt:
- Arg = DAG.getNode(ISD::SIGN_EXTEND, VA.getLocVT(), Arg);
- break;
- case CCValAssign::ZExt:
- Arg = DAG.getNode(ISD::ZERO_EXTEND, VA.getLocVT(), Arg);
- break;
- case CCValAssign::AExt:
- Arg = DAG.getNode(ISD::ANY_EXTEND, VA.getLocVT(), Arg);
- break;
- }
-
- // Arguments that can be passed on register must be kept at
- // RegsToPass vector
- if (VA.isRegLoc()) {
- RegsToPass.push_back(std::make_pair(VA.getLocReg(), Arg));
- continue;
- }
-
- assert(VA.isMemLoc());
-
- // Create a store off the stack pointer for this argument.
- SDOperand StackPtr = DAG.getRegister(SP::O6, MVT::i32);
- // FIXME: VERIFY THAT 68 IS RIGHT.
- SDOperand PtrOff = DAG.getIntPtrConstant(VA.getLocMemOffset()+68);
- PtrOff = DAG.getNode(ISD::ADD, MVT::i32, StackPtr, PtrOff);
- MemOpChains.push_back(DAG.getStore(Chain, Arg, PtrOff, NULL, 0));
- }
-
-#else
- static const unsigned ArgRegs[] = {
- SP::I0, SP::I1, SP::I2, SP::I3, SP::I4, SP::I5
- };
- unsigned ArgOffset = 68;
-
- for (unsigned i = 5, e = Op.getNumOperands(); i != e; i += 2) {
- SDOperand Val = Op.getOperand(i);
- MVT::ValueType ObjectVT = Val.getValueType();
- SDOperand ValToStore(0, 0);
- unsigned ObjSize;
- switch (ObjectVT) {
- default: assert(0 && "Unhandled argument type!");
- case MVT::i32:
- ObjSize = 4;
-
- if (RegsToPass.size() >= 6) {
- ValToStore = Val;
- } else {
- RegsToPass.push_back(std::make_pair(ArgRegs[RegsToPass.size()], Val));
- }
- break;
- case MVT::f32:
- ObjSize = 4;
- if (RegsToPass.size() >= 6) {
- ValToStore = Val;
- } else {
- // Convert this to a FP value in an int reg.
- Val = DAG.getNode(ISD::BIT_CONVERT, MVT::i32, Val);
- RegsToPass.push_back(std::make_pair(ArgRegs[RegsToPass.size()], Val));
- }
- break;
- case MVT::f64:
- ObjSize = 8;
- // Otherwise, convert this to a FP value in int regs.
- Val = DAG.getNode(ISD::BIT_CONVERT, MVT::i64, Val);
- // FALL THROUGH
- case MVT::i64:
- ObjSize = 8;
- if (RegsToPass.size() >= 6) {
- ValToStore = Val; // Whole thing is passed in memory.
- break;
- }
-
- // Split the value into top and bottom part. Top part goes in a reg.
- SDOperand Hi = DAG.getNode(ISD::EXTRACT_ELEMENT, MVT::i32, Val,
- DAG.getConstant(1, MVT::i32));
- SDOperand Lo = DAG.getNode(ISD::EXTRACT_ELEMENT, MVT::i32, Val,
- DAG.getConstant(0, MVT::i32));
- RegsToPass.push_back(std::make_pair(ArgRegs[RegsToPass.size()], Hi));
-
- if (RegsToPass.size() >= 6) {
- ValToStore = Lo;
- ArgOffset += 4;
- ObjSize = 4;
- } else {
- RegsToPass.push_back(std::make_pair(ArgRegs[RegsToPass.size()], Lo));
- }
- break;
- }
-
- if (ValToStore.Val) {
- SDOperand StackPtr = DAG.getRegister(SP::O6, MVT::i32);
- SDOperand PtrOff = DAG.getConstant(ArgOffset, MVT::i32);
- PtrOff = DAG.getNode(ISD::ADD, MVT::i32, StackPtr, PtrOff);
- MemOpChains.push_back(DAG.getStore(Chain, ValToStore, PtrOff, NULL, 0));
- }
- ArgOffset += ObjSize;
- }
-#endif
-
- // Emit all stores, make sure the occur before any copies into physregs.
- if (!MemOpChains.empty())
- Chain = DAG.getNode(ISD::TokenFactor, MVT::Other,
- &MemOpChains[0], MemOpChains.size());
-
- // Build a sequence of copy-to-reg nodes chained together with token
- // chain and flag operands which copy the outgoing args into registers.
- // The InFlag in necessary since all emited instructions must be
- // stuck together.
- SDOperand InFlag;
- for (unsigned i = 0, e = RegsToPass.size(); i != e; ++i) {
- unsigned Reg = RegsToPass[i].first;
- // Remap I0->I7 -> O0->O7.
- if (Reg >= SP::I0 && Reg <= SP::I7)
- Reg = Reg-SP::I0+SP::O0;
-
- Chain = DAG.getCopyToReg(Chain, Reg, RegsToPass[i].second, InFlag);
- InFlag = Chain.getValue(1);
- }
-
- // If the callee is a GlobalAddress node (quite common, every direct call is)
- // turn it into a TargetGlobalAddress node so that legalize doesn't hack it.
- // Likewise ExternalSymbol -> TargetExternalSymbol.
- if (GlobalAddressSDNode *G = dyn_cast<GlobalAddressSDNode>(Callee))
- Callee = DAG.getTargetGlobalAddress(G->getGlobal(), MVT::i32);
- else if (ExternalSymbolSDNode *E = dyn_cast<ExternalSymbolSDNode>(Callee))
- Callee = DAG.getTargetExternalSymbol(E->getSymbol(), MVT::i32);
-
- std::vector<MVT::ValueType> NodeTys;
- NodeTys.push_back(MVT::Other); // Returns a chain
- NodeTys.push_back(MVT::Flag); // Returns a flag for retval copy to use.
- SDOperand Ops[] = { Chain, Callee, InFlag };
- Chain = DAG.getNode(SPISD::CALL, NodeTys, Ops, InFlag.Val ? 3 : 2);
- InFlag = Chain.getValue(1);
-
- Chain = DAG.getCALLSEQ_END(Chain,
- DAG.getConstant(ArgsSize, MVT::i32),
- DAG.getConstant(0, MVT::i32), InFlag);
- InFlag = Chain.getValue(1);
-
- // Assign locations to each value returned by this call.
- SmallVector<CCValAssign, 16> RVLocs;
- CCState RVInfo(CallingConv, isVarArg, DAG.getTarget(), RVLocs);
-
- RVInfo.AnalyzeCallResult(Op.Val, RetCC_Sparc32);
- SmallVector<SDOperand, 8> ResultVals;
-
- // Copy all of the result registers out of their specified physreg.
- for (unsigned i = 0; i != RVLocs.size(); ++i) {
- unsigned Reg = RVLocs[i].getLocReg();
-
- // Remap I0->I7 -> O0->O7.
- if (Reg >= SP::I0 && Reg <= SP::I7)
- Reg = Reg-SP::I0+SP::O0;
-
- Chain = DAG.getCopyFromReg(Chain, Reg,
- RVLocs[i].getValVT(), InFlag).getValue(1);
- InFlag = Chain.getValue(2);
- ResultVals.push_back(Chain.getValue(0));
- }
-
- ResultVals.push_back(Chain);
-
- // Merge everything together with a MERGE_VALUES node.
- return DAG.getNode(ISD::MERGE_VALUES, Op.Val->getVTList(),
- &ResultVals[0], ResultVals.size());
-}
-
-
-
-//===----------------------------------------------------------------------===//
-// TargetLowering Implementation
-//===----------------------------------------------------------------------===//
-
-/// IntCondCCodeToICC - Convert a DAG integer condition code to a SPARC ICC
-/// condition.
-static SPCC::CondCodes IntCondCCodeToICC(ISD::CondCode CC) {
- switch (CC) {
- default: assert(0 && "Unknown integer condition code!");
- case ISD::SETEQ: return SPCC::ICC_E;
- case ISD::SETNE: return SPCC::ICC_NE;
- case ISD::SETLT: return SPCC::ICC_L;
- case ISD::SETGT: return SPCC::ICC_G;
- case ISD::SETLE: return SPCC::ICC_LE;
- case ISD::SETGE: return SPCC::ICC_GE;
- case ISD::SETULT: return SPCC::ICC_CS;
- case ISD::SETULE: return SPCC::ICC_LEU;
- case ISD::SETUGT: return SPCC::ICC_GU;
- case ISD::SETUGE: return SPCC::ICC_CC;
- }
-}
-
-/// FPCondCCodeToFCC - Convert a DAG floatingp oint condition code to a SPARC
-/// FCC condition.
-static SPCC::CondCodes FPCondCCodeToFCC(ISD::CondCode CC) {
- switch (CC) {
- default: assert(0 && "Unknown fp condition code!");
- case ISD::SETEQ:
- case ISD::SETOEQ: return SPCC::FCC_E;
- case ISD::SETNE:
- case ISD::SETUNE: return SPCC::FCC_NE;
- case ISD::SETLT:
- case ISD::SETOLT: return SPCC::FCC_L;
- case ISD::SETGT:
- case ISD::SETOGT: return SPCC::FCC_G;
- case ISD::SETLE:
- case ISD::SETOLE: return SPCC::FCC_LE;
- case ISD::SETGE:
- case ISD::SETOGE: return SPCC::FCC_GE;
- case ISD::SETULT: return SPCC::FCC_UL;
- case ISD::SETULE: return SPCC::FCC_ULE;
- case ISD::SETUGT: return SPCC::FCC_UG;
- case ISD::SETUGE: return SPCC::FCC_UGE;
- case ISD::SETUO: return SPCC::FCC_U;
- case ISD::SETO: return SPCC::FCC_O;
- case ISD::SETONE: return SPCC::FCC_LG;
- case ISD::SETUEQ: return SPCC::FCC_UE;
- }
-}
-
-
-SparcTargetLowering::SparcTargetLowering(TargetMachine &TM)
- : TargetLowering(TM) {
-
- // Set up the register classes.
- addRegisterClass(MVT::i32, SP::IntRegsRegisterClass);
- addRegisterClass(MVT::f32, SP::FPRegsRegisterClass);
- addRegisterClass(MVT::f64, SP::DFPRegsRegisterClass);
-
- // Turn FP extload into load/fextend
- setLoadXAction(ISD::EXTLOAD, MVT::f32, Expand);
- // Sparc doesn't have i1 sign extending load
- setLoadXAction(ISD::SEXTLOAD, MVT::i1, Promote);
- // Turn FP truncstore into trunc + store.
- setTruncStoreAction(MVT::f64, MVT::f32, Expand);
-
- // Custom legalize GlobalAddress nodes into LO/HI parts.
- setOperationAction(ISD::GlobalAddress, MVT::i32, Custom);
- setOperationAction(ISD::GlobalTLSAddress, MVT::i32, Custom);
- setOperationAction(ISD::ConstantPool , MVT::i32, Custom);
-
- // Sparc doesn't have sext_inreg, replace them with shl/sra
- setOperationAction(ISD::SIGN_EXTEND_INREG, MVT::i16, Expand);
- setOperationAction(ISD::SIGN_EXTEND_INREG, MVT::i8 , Expand);
- setOperationAction(ISD::SIGN_EXTEND_INREG, MVT::i1 , Expand);
-
- // Sparc has no REM or DIVREM operations.
- setOperationAction(ISD::UREM, MVT::i32, Expand);
- setOperationAction(ISD::SREM, MVT::i32, Expand);
- setOperationAction(ISD::SDIVREM, MVT::i32, Expand);
- setOperationAction(ISD::UDIVREM, MVT::i32, Expand);
-
- // Custom expand fp<->sint
- setOperationAction(ISD::FP_TO_SINT, MVT::i32, Custom);
- setOperationAction(ISD::SINT_TO_FP, MVT::i32, Custom);
-
- // Expand fp<->uint
- setOperationAction(ISD::FP_TO_UINT, MVT::i32, Expand);
- setOperationAction(ISD::UINT_TO_FP, MVT::i32, Expand);
-
- setOperationAction(ISD::BIT_CONVERT, MVT::f32, Expand);
- setOperationAction(ISD::BIT_CONVERT, MVT::i32, Expand);
-
- // Sparc has no select or setcc: expand to SELECT_CC.
- setOperationAction(ISD::SELECT, MVT::i32, Expand);
- setOperationAction(ISD::SELECT, MVT::f32, Expand);
- setOperationAction(ISD::SELECT, MVT::f64, Expand);
- setOperationAction(ISD::SETCC, MVT::i32, Expand);
- setOperationAction(ISD::SETCC, MVT::f32, Expand);
- setOperationAction(ISD::SETCC, MVT::f64, Expand);
-
- // Sparc doesn't have BRCOND either, it has BR_CC.
- setOperationAction(ISD::BRCOND, MVT::Other, Expand);
- setOperationAction(ISD::BRIND, MVT::Other, Expand);
- setOperationAction(ISD::BR_JT, MVT::Other, Expand);
- setOperationAction(ISD::BR_CC, MVT::i32, Custom);
- setOperationAction(ISD::BR_CC, MVT::f32, Custom);
- setOperationAction(ISD::BR_CC, MVT::f64, Custom);
-
- setOperationAction(ISD::SELECT_CC, MVT::i32, Custom);
- setOperationAction(ISD::SELECT_CC, MVT::f32, Custom);
- setOperationAction(ISD::SELECT_CC, MVT::f64, Custom);
-
- // SPARC has no intrinsics for these particular operations.
- setOperationAction(ISD::MEMBARRIER, MVT::Other, Expand);
-
- setOperationAction(ISD::FSIN , MVT::f64, Expand);
- setOperationAction(ISD::FCOS , MVT::f64, Expand);
- setOperationAction(ISD::FREM , MVT::f64, Expand);
- setOperationAction(ISD::FSIN , MVT::f32, Expand);
- setOperationAction(ISD::FCOS , MVT::f32, Expand);
- setOperationAction(ISD::FREM , MVT::f32, Expand);
- setOperationAction(ISD::CTPOP, MVT::i32, Expand);
- setOperationAction(ISD::CTTZ , MVT::i32, Expand);
- setOperationAction(ISD::CTLZ , MVT::i32, Expand);
- setOperationAction(ISD::ROTL , MVT::i32, Expand);
- setOperationAction(ISD::ROTR , MVT::i32, Expand);
- setOperationAction(ISD::BSWAP, MVT::i32, Expand);
- setOperationAction(ISD::FCOPYSIGN, MVT::f64, Expand);
- setOperationAction(ISD::FCOPYSIGN, MVT::f32, Expand);
- setOperationAction(ISD::FPOW , MVT::f64, Expand);
- setOperationAction(ISD::FPOW , MVT::f32, Expand);
-
- setOperationAction(ISD::SHL_PARTS, MVT::i32, Expand);
- setOperationAction(ISD::SRA_PARTS, MVT::i32, Expand);
- setOperationAction(ISD::SRL_PARTS, MVT::i32, Expand);
-
- // FIXME: Sparc provides these multiplies, but we don't have them yet.
- setOperationAction(ISD::UMUL_LOHI, MVT::i32, Expand);
-
- // We don't have line number support yet.
- setOperationAction(ISD::LOCATION, MVT::Other, Expand);
- setOperationAction(ISD::DEBUG_LOC, MVT::Other, Expand);
- setOperationAction(ISD::LABEL, MVT::Other, Expand);
-
- // RET must be custom lowered, to meet ABI requirements
- setOperationAction(ISD::RET , MVT::Other, Custom);
-
- // VASTART needs to be custom lowered to use the VarArgsFrameIndex.
- setOperationAction(ISD::VASTART , MVT::Other, Custom);
- // VAARG needs to be lowered to not do unaligned accesses for doubles.
- setOperationAction(ISD::VAARG , MVT::Other, Custom);
-
- // Use the default implementation.
- setOperationAction(ISD::VACOPY , MVT::Other, Expand);
- setOperationAction(ISD::VAEND , MVT::Other, Expand);
- setOperationAction(ISD::STACKSAVE , MVT::Other, Expand);
- setOperationAction(ISD::STACKRESTORE , MVT::Other, Expand);
- setOperationAction(ISD::DYNAMIC_STACKALLOC, MVT::i32 , Custom);
-
- // No debug info support yet.
- setOperationAction(ISD::LOCATION, MVT::Other, Expand);
- setOperationAction(ISD::LABEL, MVT::Other, Expand);
- setOperationAction(ISD::DECLARE, MVT::Other, Expand);
-
- setStackPointerRegisterToSaveRestore(SP::O6);
-
- if (TM.getSubtarget<SparcSubtarget>().isV9())
- setOperationAction(ISD::CTPOP, MVT::i32, Legal);
-
- computeRegisterProperties();
-}
-
-const char *SparcTargetLowering::getTargetNodeName(unsigned Opcode) const {
- switch (Opcode) {
- default: return 0;
- case SPISD::CMPICC: return "SPISD::CMPICC";
- case SPISD::CMPFCC: return "SPISD::CMPFCC";
- case SPISD::BRICC: return "SPISD::BRICC";
- case SPISD::BRFCC: return "SPISD::BRFCC";
- case SPISD::SELECT_ICC: return "SPISD::SELECT_ICC";
- case SPISD::SELECT_FCC: return "SPISD::SELECT_FCC";
- case SPISD::Hi: return "SPISD::Hi";
- case SPISD::Lo: return "SPISD::Lo";
- case SPISD::FTOI: return "SPISD::FTOI";
- case SPISD::ITOF: return "SPISD::ITOF";
- case SPISD::CALL: return "SPISD::CALL";
- case SPISD::RET_FLAG: return "SPISD::RET_FLAG";
- }
-}
-
-/// isMaskedValueZeroForTargetNode - Return true if 'Op & Mask' is known to
-/// be zero. Op is expected to be a target specific node. Used by DAG
-/// combiner.
-void SparcTargetLowering::computeMaskedBitsForTargetNode(const SDOperand Op,
- const APInt &Mask,
- APInt &KnownZero,
- APInt &KnownOne,
- const SelectionDAG &DAG,
- unsigned Depth) const {
- APInt KnownZero2, KnownOne2;
- KnownZero = KnownOne = APInt(Mask.getBitWidth(), 0); // Don't know anything.
-
- switch (Op.getOpcode()) {
- default: break;
- case SPISD::SELECT_ICC:
- case SPISD::SELECT_FCC:
- DAG.ComputeMaskedBits(Op.getOperand(1), Mask, KnownZero, KnownOne,
- Depth+1);
- DAG.ComputeMaskedBits(Op.getOperand(0), Mask, KnownZero2, KnownOne2,
- Depth+1);
- assert((KnownZero & KnownOne) == 0 && "Bits known to be one AND zero?");
- assert((KnownZero2 & KnownOne2) == 0 && "Bits known to be one AND zero?");
-
- // Only known if known in both the LHS and RHS.
- KnownOne &= KnownOne2;
- KnownZero &= KnownZero2;
- break;
- }
-}
-
-// Look at LHS/RHS/CC and see if they are a lowered setcc instruction. If so
-// set LHS/RHS and SPCC to the LHS/RHS of the setcc and SPCC to the condition.
-static void LookThroughSetCC(SDOperand &LHS, SDOperand &RHS,
- ISD::CondCode CC, unsigned &SPCC) {
- if (isa<ConstantSDNode>(RHS) && cast<ConstantSDNode>(RHS)->getValue() == 0 &&
- CC == ISD::SETNE &&
- ((LHS.getOpcode() == SPISD::SELECT_ICC &&
- LHS.getOperand(3).getOpcode() == SPISD::CMPICC) ||
- (LHS.getOpcode() == SPISD::SELECT_FCC &&
- LHS.getOperand(3).getOpcode() == SPISD::CMPFCC)) &&
- isa<ConstantSDNode>(LHS.getOperand(0)) &&
- isa<ConstantSDNode>(LHS.getOperand(1)) &&
- cast<ConstantSDNode>(LHS.getOperand(0))->getValue() == 1 &&
- cast<ConstantSDNode>(LHS.getOperand(1))->getValue() == 0) {
- SDOperand CMPCC = LHS.getOperand(3);
- SPCC = cast<ConstantSDNode>(LHS.getOperand(2))->getValue();
- LHS = CMPCC.getOperand(0);
- RHS = CMPCC.getOperand(1);
- }
-}
-
-static SDOperand LowerGLOBALADDRESS(SDOperand Op, SelectionDAG &DAG) {
- GlobalValue *GV = cast<GlobalAddressSDNode>(Op)->getGlobal();
- SDOperand GA = DAG.getTargetGlobalAddress(GV, MVT::i32);
- SDOperand Hi = DAG.getNode(SPISD::Hi, MVT::i32, GA);
- SDOperand Lo = DAG.getNode(SPISD::Lo, MVT::i32, GA);
- return DAG.getNode(ISD::ADD, MVT::i32, Lo, Hi);
-}
-
-static SDOperand LowerCONSTANTPOOL(SDOperand Op, SelectionDAG &DAG) {
- ConstantPoolSDNode *N = cast<ConstantPoolSDNode>(Op);
- Constant *C = N->getConstVal();
- SDOperand CP = DAG.getTargetConstantPool(C, MVT::i32, N->getAlignment());
- SDOperand Hi = DAG.getNode(SPISD::Hi, MVT::i32, CP);
- SDOperand Lo = DAG.getNode(SPISD::Lo, MVT::i32, CP);
- return DAG.getNode(ISD::ADD, MVT::i32, Lo, Hi);
-}
-
-static SDOperand LowerFP_TO_SINT(SDOperand Op, SelectionDAG &DAG) {
- // Convert the fp value to integer in an FP register.
- assert(Op.getValueType() == MVT::i32);
- Op = DAG.getNode(SPISD::FTOI, MVT::f32, Op.getOperand(0));
- return DAG.getNode(ISD::BIT_CONVERT, MVT::i32, Op);
-}
-
-static SDOperand LowerSINT_TO_FP(SDOperand Op, SelectionDAG &DAG) {
- assert(Op.getOperand(0).getValueType() == MVT::i32);
- SDOperand Tmp = DAG.getNode(ISD::BIT_CONVERT, MVT::f32, Op.getOperand(0));
- // Convert the int value to FP in an FP register.
- return DAG.getNode(SPISD::ITOF, Op.getValueType(), Tmp);
-}
-
-static SDOperand LowerBR_CC(SDOperand Op, SelectionDAG &DAG) {
- SDOperand Chain = Op.getOperand(0);
- ISD::CondCode CC = cast<CondCodeSDNode>(Op.getOperand(1))->get();
- SDOperand LHS = Op.getOperand(2);
- SDOperand RHS = Op.getOperand(3);
- SDOperand Dest = Op.getOperand(4);
- unsigned Opc, SPCC = ~0U;
-
- // If this is a br_cc of a "setcc", and if the setcc got lowered into
- // an CMP[IF]CC/SELECT_[IF]CC pair, find the original compared values.
- LookThroughSetCC(LHS, RHS, CC, SPCC);
-
- // Get the condition flag.
- SDOperand CompareFlag;
- if (LHS.getValueType() == MVT::i32) {
- std::vector<MVT::ValueType> VTs;
- VTs.push_back(MVT::i32);
- VTs.push_back(MVT::Flag);
- SDOperand Ops[2] = { LHS, RHS };
- CompareFlag = DAG.getNode(SPISD::CMPICC, VTs, Ops, 2).getValue(1);
- if (SPCC == ~0U) SPCC = IntCondCCodeToICC(CC);
- Opc = SPISD::BRICC;
- } else {
- CompareFlag = DAG.getNode(SPISD::CMPFCC, MVT::Flag, LHS, RHS);
- if (SPCC == ~0U) SPCC = FPCondCCodeToFCC(CC);
- Opc = SPISD::BRFCC;
- }
- return DAG.getNode(Opc, MVT::Other, Chain, Dest,
- DAG.getConstant(SPCC, MVT::i32), CompareFlag);
-}
-
-static SDOperand LowerSELECT_CC(SDOperand Op, SelectionDAG &DAG) {
- SDOperand LHS = Op.getOperand(0);
- SDOperand RHS = Op.getOperand(1);
- ISD::CondCode CC = cast<CondCodeSDNode>(Op.getOperand(4))->get();
- SDOperand TrueVal = Op.getOperand(2);
- SDOperand FalseVal = Op.getOperand(3);
- unsigned Opc, SPCC = ~0U;
-
- // If this is a select_cc of a "setcc", and if the setcc got lowered into
- // an CMP[IF]CC/SELECT_[IF]CC pair, find the original compared values.
- LookThroughSetCC(LHS, RHS, CC, SPCC);
-
- SDOperand CompareFlag;
- if (LHS.getValueType() == MVT::i32) {
- std::vector<MVT::ValueType> VTs;
- VTs.push_back(LHS.getValueType()); // subcc returns a value
- VTs.push_back(MVT::Flag);
- SDOperand Ops[2] = { LHS, RHS };
- CompareFlag = DAG.getNode(SPISD::CMPICC, VTs, Ops, 2).getValue(1);
- Opc = SPISD::SELECT_ICC;
- if (SPCC == ~0U) SPCC = IntCondCCodeToICC(CC);
- } else {
- CompareFlag = DAG.getNode(SPISD::CMPFCC, MVT::Flag, LHS, RHS);
- Opc = SPISD::SELECT_FCC;
- if (SPCC == ~0U) SPCC = FPCondCCodeToFCC(CC);
- }
- return DAG.getNode(Opc, TrueVal.getValueType(), TrueVal, FalseVal,
- DAG.getConstant(SPCC, MVT::i32), CompareFlag);
-}
-
-static SDOperand LowerVASTART(SDOperand Op, SelectionDAG &DAG,
- SparcTargetLowering &TLI) {
- // vastart just stores the address of the VarArgsFrameIndex slot into the
- // memory location argument.
- SDOperand Offset = DAG.getNode(ISD::ADD, MVT::i32,
- DAG.getRegister(SP::I6, MVT::i32),
- DAG.getConstant(TLI.getVarArgsFrameOffset(),
- MVT::i32));
- const Value *SV = cast<SrcValueSDNode>(Op.getOperand(2))->getValue();
- return DAG.getStore(Op.getOperand(0), Offset, Op.getOperand(1), SV, 0);
-}
-
-static SDOperand LowerVAARG(SDOperand Op, SelectionDAG &DAG) {
- SDNode *Node = Op.Val;
- MVT::ValueType VT = Node->getValueType(0);
- SDOperand InChain = Node->getOperand(0);
- SDOperand VAListPtr = Node->getOperand(1);
- const Value *SV = cast<SrcValueSDNode>(Node->getOperand(2))->getValue();
- SDOperand VAList = DAG.getLoad(MVT::i32, InChain, VAListPtr, SV, 0);
- // Increment the pointer, VAList, to the next vaarg
- SDOperand NextPtr = DAG.getNode(ISD::ADD, MVT::i32, VAList,
- DAG.getConstant(MVT::getSizeInBits(VT)/8,
- MVT::i32));
- // Store the incremented VAList to the legalized pointer
- InChain = DAG.getStore(VAList.getValue(1), NextPtr,
- VAListPtr, SV, 0);
- // Load the actual argument out of the pointer VAList, unless this is an
- // f64 load.
- if (VT != MVT::f64)
- return DAG.getLoad(VT, InChain, VAList, NULL, 0);
-
- // Otherwise, load it as i64, then do a bitconvert.
- SDOperand V = DAG.getLoad(MVT::i64, InChain, VAList, NULL, 0);
-
- // Bit-Convert the value to f64.
- SDOperand Ops[2] = {
- DAG.getNode(ISD::BIT_CONVERT, MVT::f64, V),
- V.getValue(1)
- };
- return DAG.getNode(ISD::MERGE_VALUES, DAG.getVTList(MVT::f64, MVT::Other),
- Ops, 2);
-}
-
-static SDOperand LowerDYNAMIC_STACKALLOC(SDOperand Op, SelectionDAG &DAG) {
- SDOperand Chain = Op.getOperand(0); // Legalize the chain.
- SDOperand Size = Op.getOperand(1); // Legalize the size.
-
- unsigned SPReg = SP::O6;
- SDOperand SP = DAG.getCopyFromReg(Chain, SPReg, MVT::i32);
- SDOperand NewSP = DAG.getNode(ISD::SUB, MVT::i32, SP, Size); // Value
- Chain = DAG.getCopyToReg(SP.getValue(1), SPReg, NewSP); // Output chain
-
- // The resultant pointer is actually 16 words from the bottom of the stack,
- // to provide a register spill area.
- SDOperand NewVal = DAG.getNode(ISD::ADD, MVT::i32, NewSP,
- DAG.getConstant(96, MVT::i32));
- std::vector<MVT::ValueType> Tys;
- Tys.push_back(MVT::i32);
- Tys.push_back(MVT::Other);
- SDOperand Ops[2] = { NewVal, Chain };
- return DAG.getNode(ISD::MERGE_VALUES, Tys, Ops, 2);
-}
-
-
-SDOperand SparcTargetLowering::
-LowerOperation(SDOperand Op, SelectionDAG &DAG) {
- switch (Op.getOpcode()) {
- default: assert(0 && "Should not custom lower this!");
- // Frame & Return address. Currently unimplemented
- case ISD::RETURNADDR: return SDOperand();
- case ISD::FRAMEADDR: return SDOperand();
- case ISD::GlobalTLSAddress:
- assert(0 && "TLS not implemented for Sparc.");
- case ISD::GlobalAddress: return LowerGLOBALADDRESS(Op, DAG);
- case ISD::ConstantPool: return LowerCONSTANTPOOL(Op, DAG);
- case ISD::FP_TO_SINT: return LowerFP_TO_SINT(Op, DAG);
- case ISD::SINT_TO_FP: return LowerSINT_TO_FP(Op, DAG);
- case ISD::BR_CC: return LowerBR_CC(Op, DAG);
- case ISD::SELECT_CC: return LowerSELECT_CC(Op, DAG);
- case ISD::VASTART: return LowerVASTART(Op, DAG, *this);
- case ISD::VAARG: return LowerVAARG(Op, DAG);
- case ISD::DYNAMIC_STACKALLOC: return LowerDYNAMIC_STACKALLOC(Op, DAG);
- case ISD::CALL: return LowerCALL(Op, DAG);
- case ISD::RET: return LowerRET(Op, DAG);
- }
-}
-
-MachineBasicBlock *
-SparcTargetLowering::EmitInstrWithCustomInserter(MachineInstr *MI,
- MachineBasicBlock *BB) {
- const TargetInstrInfo &TII = *getTargetMachine().getInstrInfo();
- unsigned BROpcode;
- unsigned CC;
- // Figure out the conditional branch opcode to use for this select_cc.
- switch (MI->getOpcode()) {
- default: assert(0 && "Unknown SELECT_CC!");
- case SP::SELECT_CC_Int_ICC:
- case SP::SELECT_CC_FP_ICC:
- case SP::SELECT_CC_DFP_ICC:
- BROpcode = SP::BCOND;
- break;
- case SP::SELECT_CC_Int_FCC:
- case SP::SELECT_CC_FP_FCC:
- case SP::SELECT_CC_DFP_FCC:
- BROpcode = SP::FBCOND;
- break;
- }
-
- CC = (SPCC::CondCodes)MI->getOperand(3).getImm();
-
- // To "insert" a SELECT_CC instruction, we actually have to insert the diamond
- // control-flow pattern. The incoming instruction knows the destination vreg
- // to set, the condition code register to branch on, the true/false values to
- // select between, and a branch opcode to use.
- const BasicBlock *LLVM_BB = BB->getBasicBlock();
- ilist<MachineBasicBlock>::iterator It = BB;
- ++It;
-
- // thisMBB:
- // ...
- // TrueVal = ...
- // [f]bCC copy1MBB
- // fallthrough --> copy0MBB
- MachineBasicBlock *thisMBB = BB;
- MachineBasicBlock *copy0MBB = new MachineBasicBlock(LLVM_BB);
- MachineBasicBlock *sinkMBB = new MachineBasicBlock(LLVM_BB);
- BuildMI(BB, TII.get(BROpcode)).addMBB(sinkMBB).addImm(CC);
- MachineFunction *F = BB->getParent();
- F->getBasicBlockList().insert(It, copy0MBB);
- F->getBasicBlockList().insert(It, sinkMBB);
- // Update machine-CFG edges by first adding all successors of the current
- // block to the new block which will contain the Phi node for the select.
- for(MachineBasicBlock::succ_iterator i = BB->succ_begin(),
- e = BB->succ_end(); i != e; ++i)
- sinkMBB->addSuccessor(*i);
- // Next, remove all successors of the current block, and add the true
- // and fallthrough blocks as its successors.
- while(!BB->succ_empty())
- BB->removeSuccessor(BB->succ_begin());
- BB->addSuccessor(copy0MBB);
- BB->addSuccessor(sinkMBB);
-
- // copy0MBB:
- // %FalseValue = ...
- // # fallthrough to sinkMBB
- BB = copy0MBB;
-
- // Update machine-CFG edges
- BB->addSuccessor(sinkMBB);
-
- // sinkMBB:
- // %Result = phi [ %FalseValue, copy0MBB ], [ %TrueValue, thisMBB ]
- // ...
- BB = sinkMBB;
- BuildMI(BB, TII.get(SP::PHI), MI->getOperand(0).getReg())
- .addReg(MI->getOperand(2).getReg()).addMBB(copy0MBB)
- .addReg(MI->getOperand(1).getReg()).addMBB(thisMBB);
-
- delete MI; // The pseudo instruction is gone now.
- return BB;
-}
-
diff --git a/release_23/lib/Target/Sparc/SparcISelLowering.h b/release_23/lib/Target/Sparc/SparcISelLowering.h
deleted file mode 100644
index 023ea93d8c52..000000000000
--- a/release_23/lib/Target/Sparc/SparcISelLowering.h
+++ /dev/null
@@ -1,69 +0,0 @@
-//===-- SparcISelLowering.h - Sparc DAG Lowering Interface ------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines the interfaces that Sparc uses to lower LLVM code into a
-// selection DAG.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef SPARC_ISELLOWERING_H
-#define SPARC_ISELLOWERING_H
-
-#include "llvm/Target/TargetLowering.h"
-#include "Sparc.h"
-
-namespace llvm {
- namespace SPISD {
- enum {
- FIRST_NUMBER = ISD::BUILTIN_OP_END+SP::INSTRUCTION_LIST_END,
- CMPICC, // Compare two GPR operands, set icc.
- CMPFCC, // Compare two FP operands, set fcc.
- BRICC, // Branch to dest on icc condition
- BRFCC, // Branch to dest on fcc condition
- SELECT_ICC, // Select between two values using the current ICC flags.
- SELECT_FCC, // Select between two values using the current FCC flags.
-
- Hi, Lo, // Hi/Lo operations, typically on a global address.
-
- FTOI, // FP to Int within a FP register.
- ITOF, // Int to FP within a FP register.
-
- CALL, // A call instruction.
- RET_FLAG // Return with a flag operand.
- };
- }
-
- class SparcTargetLowering : public TargetLowering {
- int VarArgsFrameOffset; // Frame offset to start of varargs area.
- public:
- SparcTargetLowering(TargetMachine &TM);
- virtual SDOperand LowerOperation(SDOperand Op, SelectionDAG &DAG);
-
- int getVarArgsFrameOffset() const { return VarArgsFrameOffset; }
-
- /// computeMaskedBitsForTargetNode - Determine which of the bits specified
- /// in Mask are known to be either zero or one and return them in the
- /// KnownZero/KnownOne bitsets.
- virtual void computeMaskedBitsForTargetNode(const SDOperand Op,
- const APInt &Mask,
- APInt &KnownZero,
- APInt &KnownOne,
- const SelectionDAG &DAG,
- unsigned Depth = 0) const;
-
- virtual std::vector<SDOperand>
- LowerArguments(Function &F, SelectionDAG &DAG);
- virtual MachineBasicBlock *EmitInstrWithCustomInserter(MachineInstr *MI,
- MachineBasicBlock *MBB);
-
- virtual const char *getTargetNodeName(unsigned Opcode) const;
- };
-} // end namespace llvm
-
-#endif // SPARC_ISELLOWERING_H
diff --git a/release_23/lib/Target/Sparc/SparcInstrFormats.td b/release_23/lib/Target/Sparc/SparcInstrFormats.td
deleted file mode 100644
index 6535259e16ff..000000000000
--- a/release_23/lib/Target/Sparc/SparcInstrFormats.td
+++ /dev/null
@@ -1,114 +0,0 @@
-//===- SparcInstrFormats.td - Sparc Instruction Formats ----*- tablegen -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-class InstSP<dag outs, dag ins, string asmstr, list<dag> pattern> : Instruction {
- field bits<32> Inst;
-
- let Namespace = "SP";
-
- bits<2> op;
- let Inst{31-30} = op; // Top two bits are the 'op' field
-
- dag OutOperandList = outs;
- dag InOperandList = ins;
- let AsmString = asmstr;
- let Pattern = pattern;
-}
-
-//===----------------------------------------------------------------------===//
-// Format #2 instruction classes in the Sparc
-//===----------------------------------------------------------------------===//
-
-// Format 2 instructions
-class F2<dag outs, dag ins, string asmstr, list<dag> pattern>
- : InstSP<outs, ins, asmstr, pattern> {
- bits<3> op2;
- bits<22> imm22;
- let op = 0; // op = 0
- let Inst{24-22} = op2;
- let Inst{21-0} = imm22;
-}
-
-// Specific F2 classes: SparcV8 manual, page 44
-//
-class F2_1<bits<3> op2Val, dag outs, dag ins, string asmstr, list<dag> pattern>
- : F2<outs, ins, asmstr, pattern> {
- bits<5> rd;
-
- let op2 = op2Val;
-
- let Inst{29-25} = rd;
-}
-
-class F2_2<bits<4> condVal, bits<3> op2Val, dag outs, dag ins, string asmstr,
- list<dag> pattern> : F2<outs, ins, asmstr, pattern> {
- bits<4> cond;
- bit annul = 0; // currently unused
-
- let cond = condVal;
- let op2 = op2Val;
-
- let Inst{29} = annul;
- let Inst{28-25} = cond;
-}
-
-//===----------------------------------------------------------------------===//
-// Format #3 instruction classes in the Sparc
-//===----------------------------------------------------------------------===//
-
-class F3<dag outs, dag ins, string asmstr, list<dag> pattern>
- : InstSP<outs, ins, asmstr, pattern> {
- bits<5> rd;
- bits<6> op3;
- bits<5> rs1;
- let op{1} = 1; // Op = 2 or 3
- let Inst{29-25} = rd;
- let Inst{24-19} = op3;
- let Inst{18-14} = rs1;
-}
-
-// Specific F3 classes: SparcV8 manual, page 44
-//
-class F3_1<bits<2> opVal, bits<6> op3val, dag outs, dag ins,
- string asmstr, list<dag> pattern> : F3<outs, ins, asmstr, pattern> {
- bits<8> asi = 0; // asi not currently used
- bits<5> rs2;
-
- let op = opVal;
- let op3 = op3val;
-
- let Inst{13} = 0; // i field = 0
- let Inst{12-5} = asi; // address space identifier
- let Inst{4-0} = rs2;
-}
-
-class F3_2<bits<2> opVal, bits<6> op3val, dag outs, dag ins,
- string asmstr, list<dag> pattern> : F3<outs, ins, asmstr, pattern> {
- bits<13> simm13;
-
- let op = opVal;
- let op3 = op3val;
-
- let Inst{13} = 1; // i field = 1
- let Inst{12-0} = simm13;
-}
-
-// floating-point
-class F3_3<bits<2> opVal, bits<6> op3val, bits<9> opfval, dag outs, dag ins,
- string asmstr, list<dag> pattern> : F3<outs, ins, asmstr, pattern> {
- bits<5> rs2;
-
- let op = opVal;
- let op3 = op3val;
-
- let Inst{13-5} = opfval; // fp opcode
- let Inst{4-0} = rs2;
-}
-
-
diff --git a/release_23/lib/Target/Sparc/SparcInstrInfo.cpp b/release_23/lib/Target/Sparc/SparcInstrInfo.cpp
deleted file mode 100644
index 79fc91291906..000000000000
--- a/release_23/lib/Target/Sparc/SparcInstrInfo.cpp
+++ /dev/null
@@ -1,262 +0,0 @@
-//===- SparcInstrInfo.cpp - Sparc Instruction Information -------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains the Sparc implementation of the TargetInstrInfo class.
-//
-//===----------------------------------------------------------------------===//
-
-#include "SparcInstrInfo.h"
-#include "SparcSubtarget.h"
-#include "Sparc.h"
-#include "llvm/ADT/STLExtras.h"
-#include "llvm/CodeGen/MachineInstrBuilder.h"
-#include "SparcGenInstrInfo.inc"
-using namespace llvm;
-
-SparcInstrInfo::SparcInstrInfo(SparcSubtarget &ST)
- : TargetInstrInfoImpl(SparcInsts, array_lengthof(SparcInsts)),
- RI(ST, *this), Subtarget(ST) {
-}
-
-static bool isZeroImm(const MachineOperand &op) {
- return op.isImmediate() && op.getImm() == 0;
-}
-
-/// Return true if the instruction is a register to register move and
-/// leave the source and dest operands in the passed parameters.
-///
-bool SparcInstrInfo::isMoveInstr(const MachineInstr &MI,
- unsigned &SrcReg, unsigned &DstReg) const {
- // We look for 3 kinds of patterns here:
- // or with G0 or 0
- // add with G0 or 0
- // fmovs or FpMOVD (pseudo double move).
- if (MI.getOpcode() == SP::ORrr || MI.getOpcode() == SP::ADDrr) {
- if (MI.getOperand(1).getReg() == SP::G0) {
- DstReg = MI.getOperand(0).getReg();
- SrcReg = MI.getOperand(2).getReg();
- return true;
- } else if (MI.getOperand(2).getReg() == SP::G0) {
- DstReg = MI.getOperand(0).getReg();
- SrcReg = MI.getOperand(1).getReg();
- return true;
- }
- } else if ((MI.getOpcode() == SP::ORri || MI.getOpcode() == SP::ADDri) &&
- isZeroImm(MI.getOperand(2)) && MI.getOperand(1).isRegister()) {
- DstReg = MI.getOperand(0).getReg();
- SrcReg = MI.getOperand(1).getReg();
- return true;
- } else if (MI.getOpcode() == SP::FMOVS || MI.getOpcode() == SP::FpMOVD ||
- MI.getOpcode() == SP::FMOVD) {
- SrcReg = MI.getOperand(1).getReg();
- DstReg = MI.getOperand(0).getReg();
- return true;
- }
- return false;
-}
-
-/// isLoadFromStackSlot - If the specified machine instruction is a direct
-/// load from a stack slot, return the virtual or physical register number of
-/// the destination along with the FrameIndex of the loaded stack slot. If
-/// not, return 0. This predicate must return 0 if the instruction has
-/// any side effects other than loading from the stack slot.
-unsigned SparcInstrInfo::isLoadFromStackSlot(MachineInstr *MI,
- int &FrameIndex) const {
- if (MI->getOpcode() == SP::LDri ||
- MI->getOpcode() == SP::LDFri ||
- MI->getOpcode() == SP::LDDFri) {
- if (MI->getOperand(1).isFrameIndex() && MI->getOperand(2).isImmediate() &&
- MI->getOperand(2).getImm() == 0) {
- FrameIndex = MI->getOperand(1).getIndex();
- return MI->getOperand(0).getReg();
- }
- }
- return 0;
-}
-
-/// isStoreToStackSlot - If the specified machine instruction is a direct
-/// store to a stack slot, return the virtual or physical register number of
-/// the source reg along with the FrameIndex of the loaded stack slot. If
-/// not, return 0. This predicate must return 0 if the instruction has
-/// any side effects other than storing to the stack slot.
-unsigned SparcInstrInfo::isStoreToStackSlot(MachineInstr *MI,
- int &FrameIndex) const {
- if (MI->getOpcode() == SP::STri ||
- MI->getOpcode() == SP::STFri ||
- MI->getOpcode() == SP::STDFri) {
- if (MI->getOperand(0).isFrameIndex() && MI->getOperand(1).isImmediate() &&
- MI->getOperand(1).getImm() == 0) {
- FrameIndex = MI->getOperand(0).getIndex();
- return MI->getOperand(2).getReg();
- }
- }
- return 0;
-}
-
-unsigned
-SparcInstrInfo::InsertBranch(MachineBasicBlock &MBB,MachineBasicBlock *TBB,
- MachineBasicBlock *FBB,
- const std::vector<MachineOperand> &Cond)const{
- // Can only insert uncond branches so far.
- assert(Cond.empty() && !FBB && TBB && "Can only handle uncond branches!");
- BuildMI(&MBB, get(SP::BA)).addMBB(TBB);
- return 1;
-}
-
-void SparcInstrInfo::copyRegToReg(MachineBasicBlock &MBB,
- MachineBasicBlock::iterator I,
- unsigned DestReg, unsigned SrcReg,
- const TargetRegisterClass *DestRC,
- const TargetRegisterClass *SrcRC) const {
- if (DestRC != SrcRC) {
- cerr << "Not yet supported!";
- abort();
- }
-
- if (DestRC == SP::IntRegsRegisterClass)
- BuildMI(MBB, I, get(SP::ORrr), DestReg).addReg(SP::G0).addReg(SrcReg);
- else if (DestRC == SP::FPRegsRegisterClass)
- BuildMI(MBB, I, get(SP::FMOVS), DestReg).addReg(SrcReg);
- else if (DestRC == SP::DFPRegsRegisterClass)
- BuildMI(MBB, I, get(Subtarget.isV9() ? SP::FMOVD : SP::FpMOVD),DestReg)
- .addReg(SrcReg);
- else
- assert (0 && "Can't copy this register");
-}
-
-void SparcInstrInfo::
-storeRegToStackSlot(MachineBasicBlock &MBB, MachineBasicBlock::iterator I,
- unsigned SrcReg, bool isKill, int FI,
- const TargetRegisterClass *RC) const {
- // On the order of operands here: think "[FrameIdx + 0] = SrcReg".
- if (RC == SP::IntRegsRegisterClass)
- BuildMI(MBB, I, get(SP::STri)).addFrameIndex(FI).addImm(0)
- .addReg(SrcReg, false, false, isKill);
- else if (RC == SP::FPRegsRegisterClass)
- BuildMI(MBB, I, get(SP::STFri)).addFrameIndex(FI).addImm(0)
- .addReg(SrcReg, false, false, isKill);
- else if (RC == SP::DFPRegsRegisterClass)
- BuildMI(MBB, I, get(SP::STDFri)).addFrameIndex(FI).addImm(0)
- .addReg(SrcReg, false, false, isKill);
- else
- assert(0 && "Can't store this register to stack slot");
-}
-
-void SparcInstrInfo::storeRegToAddr(MachineFunction &MF, unsigned SrcReg,
- bool isKill,
- SmallVectorImpl<MachineOperand> &Addr,
- const TargetRegisterClass *RC,
- SmallVectorImpl<MachineInstr*> &NewMIs) const {
- unsigned Opc = 0;
- if (RC == SP::IntRegsRegisterClass)
- Opc = SP::STri;
- else if (RC == SP::FPRegsRegisterClass)
- Opc = SP::STFri;
- else if (RC == SP::DFPRegsRegisterClass)
- Opc = SP::STDFri;
- else
- assert(0 && "Can't load this register");
- MachineInstrBuilder MIB = BuildMI(get(Opc));
- for (unsigned i = 0, e = Addr.size(); i != e; ++i) {
- MachineOperand &MO = Addr[i];
- if (MO.isRegister())
- MIB.addReg(MO.getReg());
- else if (MO.isImmediate())
- MIB.addImm(MO.getImm());
- else {
- assert(MO.isFI());
- MIB.addFrameIndex(MO.getIndex());
- }
- }
- MIB.addReg(SrcReg, false, false, isKill);
- NewMIs.push_back(MIB);
- return;
-}
-
-void SparcInstrInfo::
-loadRegFromStackSlot(MachineBasicBlock &MBB, MachineBasicBlock::iterator I,
- unsigned DestReg, int FI,
- const TargetRegisterClass *RC) const {
- if (RC == SP::IntRegsRegisterClass)
- BuildMI(MBB, I, get(SP::LDri), DestReg).addFrameIndex(FI).addImm(0);
- else if (RC == SP::FPRegsRegisterClass)
- BuildMI(MBB, I, get(SP::LDFri), DestReg).addFrameIndex(FI).addImm(0);
- else if (RC == SP::DFPRegsRegisterClass)
- BuildMI(MBB, I, get(SP::LDDFri), DestReg).addFrameIndex(FI).addImm(0);
- else
- assert(0 && "Can't load this register from stack slot");
-}
-
-void SparcInstrInfo::loadRegFromAddr(MachineFunction &MF, unsigned DestReg,
- SmallVectorImpl<MachineOperand> &Addr,
- const TargetRegisterClass *RC,
- SmallVectorImpl<MachineInstr*> &NewMIs) const {
- unsigned Opc = 0;
- if (RC == SP::IntRegsRegisterClass)
- Opc = SP::LDri;
- else if (RC == SP::FPRegsRegisterClass)
- Opc = SP::LDFri;
- else if (RC == SP::DFPRegsRegisterClass)
- Opc = SP::LDDFri;
- else
- assert(0 && "Can't load this register");
- MachineInstrBuilder MIB = BuildMI(get(Opc), DestReg);
- for (unsigned i = 0, e = Addr.size(); i != e; ++i) {
- MachineOperand &MO = Addr[i];
- if (MO.isReg())
- MIB.addReg(MO.getReg());
- else if (MO.isImm())
- MIB.addImm(MO.getImm());
- else {
- assert(MO.isFI());
- MIB.addFrameIndex(MO.getIndex());
- }
- }
- NewMIs.push_back(MIB);
- return;
-}
-
-MachineInstr *SparcInstrInfo::foldMemoryOperand(MachineFunction &MF,
- MachineInstr* MI,
- SmallVectorImpl<unsigned> &Ops,
- int FI) const {
- if (Ops.size() != 1) return NULL;
-
- unsigned OpNum = Ops[0];
- bool isFloat = false;
- MachineInstr *NewMI = NULL;
- switch (MI->getOpcode()) {
- case SP::ORrr:
- if (MI->getOperand(1).isRegister() && MI->getOperand(1).getReg() == SP::G0&&
- MI->getOperand(0).isRegister() && MI->getOperand(2).isRegister()) {
- if (OpNum == 0) // COPY -> STORE
- NewMI = BuildMI(get(SP::STri)).addFrameIndex(FI).addImm(0)
- .addReg(MI->getOperand(2).getReg());
- else // COPY -> LOAD
- NewMI = BuildMI(get(SP::LDri), MI->getOperand(0).getReg())
- .addFrameIndex(FI).addImm(0);
- }
- break;
- case SP::FMOVS:
- isFloat = true;
- // FALLTHROUGH
- case SP::FMOVD:
- if (OpNum == 0) // COPY -> STORE
- NewMI = BuildMI(get(isFloat ? SP::STFri : SP::STDFri))
- .addFrameIndex(FI).addImm(0).addReg(MI->getOperand(1).getReg());
- else // COPY -> LOAD
- NewMI = BuildMI(get(isFloat ? SP::LDFri : SP::LDDFri),
- MI->getOperand(0).getReg()).addFrameIndex(FI).addImm(0);
- break;
- }
-
- if (NewMI)
- NewMI->copyKillDeadInfo(MI);
- return NewMI;
-}
diff --git a/release_23/lib/Target/Sparc/SparcInstrInfo.h b/release_23/lib/Target/Sparc/SparcInstrInfo.h
deleted file mode 100644
index e9ce790a2a00..000000000000
--- a/release_23/lib/Target/Sparc/SparcInstrInfo.h
+++ /dev/null
@@ -1,112 +0,0 @@
-//===- SparcInstrInfo.h - Sparc Instruction Information ---------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains the Sparc implementation of the TargetInstrInfo class.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef SPARCINSTRUCTIONINFO_H
-#define SPARCINSTRUCTIONINFO_H
-
-#include "llvm/Target/TargetInstrInfo.h"
-#include "SparcRegisterInfo.h"
-
-namespace llvm {
-
-/// SPII - This namespace holds all of the target specific flags that
-/// instruction info tracks.
-///
-namespace SPII {
- enum {
- Pseudo = (1<<0),
- Load = (1<<1),
- Store = (1<<2),
- DelaySlot = (1<<3)
- };
-}
-
-class SparcInstrInfo : public TargetInstrInfoImpl {
- const SparcRegisterInfo RI;
- const SparcSubtarget& Subtarget;
-public:
- explicit SparcInstrInfo(SparcSubtarget &ST);
-
- /// getRegisterInfo - TargetInstrInfo is a superset of MRegister info. As
- /// such, whenever a client has an instance of instruction info, it should
- /// always be able to get register info as well (through this method).
- ///
- virtual const TargetRegisterInfo &getRegisterInfo() const { return RI; }
-
- /// Return true if the instruction is a register to register move and
- /// leave the source and dest operands in the passed parameters.
- ///
- virtual bool isMoveInstr(const MachineInstr &MI,
- unsigned &SrcReg, unsigned &DstReg) const;
-
- /// isLoadFromStackSlot - If the specified machine instruction is a direct
- /// load from a stack slot, return the virtual or physical register number of
- /// the destination along with the FrameIndex of the loaded stack slot. If
- /// not, return 0. This predicate must return 0 if the instruction has
- /// any side effects other than loading from the stack slot.
- virtual unsigned isLoadFromStackSlot(MachineInstr *MI, int &FrameIndex) const;
-
- /// isStoreToStackSlot - If the specified machine instruction is a direct
- /// store to a stack slot, return the virtual or physical register number of
- /// the source reg along with the FrameIndex of the loaded stack slot. If
- /// not, return 0. This predicate must return 0 if the instruction has
- /// any side effects other than storing to the stack slot.
- virtual unsigned isStoreToStackSlot(MachineInstr *MI, int &FrameIndex) const;
-
-
- virtual unsigned InsertBranch(MachineBasicBlock &MBB, MachineBasicBlock *TBB,
- MachineBasicBlock *FBB,
- const std::vector<MachineOperand> &Cond) const;
-
- virtual void copyRegToReg(MachineBasicBlock &MBB,
- MachineBasicBlock::iterator I,
- unsigned DestReg, unsigned SrcReg,
- const TargetRegisterClass *DestRC,
- const TargetRegisterClass *SrcRC) const;
-
- virtual void storeRegToStackSlot(MachineBasicBlock &MBB,
- MachineBasicBlock::iterator MBBI,
- unsigned SrcReg, bool isKill, int FrameIndex,
- const TargetRegisterClass *RC) const;
-
- virtual void storeRegToAddr(MachineFunction &MF, unsigned SrcReg, bool isKill,
- SmallVectorImpl<MachineOperand> &Addr,
- const TargetRegisterClass *RC,
- SmallVectorImpl<MachineInstr*> &NewMIs) const;
-
- virtual void loadRegFromStackSlot(MachineBasicBlock &MBB,
- MachineBasicBlock::iterator MBBI,
- unsigned DestReg, int FrameIndex,
- const TargetRegisterClass *RC) const;
-
- virtual void loadRegFromAddr(MachineFunction &MF, unsigned DestReg,
- SmallVectorImpl<MachineOperand> &Addr,
- const TargetRegisterClass *RC,
- SmallVectorImpl<MachineInstr*> &NewMIs) const;
-
- virtual MachineInstr* foldMemoryOperand(MachineFunction &MF,
- MachineInstr* MI,
- SmallVectorImpl<unsigned> &Ops,
- int FrameIndex) const;
-
- virtual MachineInstr* foldMemoryOperand(MachineFunction &MF,
- MachineInstr* MI,
- SmallVectorImpl<unsigned> &Ops,
- MachineInstr* LoadMI) const {
- return 0;
- }
-};
-
-}
-
-#endif
diff --git a/release_23/lib/Target/Sparc/SparcInstrInfo.td b/release_23/lib/Target/Sparc/SparcInstrInfo.td
deleted file mode 100644
index 3ceaf5561bda..000000000000
--- a/release_23/lib/Target/Sparc/SparcInstrInfo.td
+++ /dev/null
@@ -1,765 +0,0 @@
-//===- SparcInstrInfo.td - Target Description for Sparc Target ------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file describes the Sparc instructions in TableGen format.
-//
-//===----------------------------------------------------------------------===//
-
-//===----------------------------------------------------------------------===//
-// Instruction format superclass
-//===----------------------------------------------------------------------===//
-
-include "SparcInstrFormats.td"
-
-//===----------------------------------------------------------------------===//
-// Feature predicates.
-//===----------------------------------------------------------------------===//
-
-// HasV9 - This predicate is true when the target processor supports V9
-// instructions. Note that the machine may be running in 32-bit mode.
-def HasV9 : Predicate<"Subtarget.isV9()">;
-
-// HasNoV9 - This predicate is true when the target doesn't have V9
-// instructions. Use of this is just a hack for the isel not having proper
-// costs for V8 instructions that are more expensive than their V9 ones.
-def HasNoV9 : Predicate<"!Subtarget.isV9()">;
-
-// HasVIS - This is true when the target processor has VIS extensions.
-def HasVIS : Predicate<"Subtarget.isVIS()">;
-
-// UseDeprecatedInsts - This predicate is true when the target processor is a
-// V8, or when it is V9 but the V8 deprecated instructions are efficient enough
-// to use when appropriate. In either of these cases, the instruction selector
-// will pick deprecated instructions.
-def UseDeprecatedInsts : Predicate<"Subtarget.useDeprecatedV8Instructions()">;
-
-//===----------------------------------------------------------------------===//
-// Instruction Pattern Stuff
-//===----------------------------------------------------------------------===//
-
-def simm11 : PatLeaf<(imm), [{
- // simm11 predicate - True if the imm fits in a 11-bit sign extended field.
- return (((int)N->getValue() << (32-11)) >> (32-11)) == (int)N->getValue();
-}]>;
-
-def simm13 : PatLeaf<(imm), [{
- // simm13 predicate - True if the imm fits in a 13-bit sign extended field.
- return (((int)N->getValue() << (32-13)) >> (32-13)) == (int)N->getValue();
-}]>;
-
-def LO10 : SDNodeXForm<imm, [{
- return CurDAG->getTargetConstant((unsigned)N->getValue() & 1023, MVT::i32);
-}]>;
-
-def HI22 : SDNodeXForm<imm, [{
- // Transformation function: shift the immediate value down into the low bits.
- return CurDAG->getTargetConstant((unsigned)N->getValue() >> 10, MVT::i32);
-}]>;
-
-def SETHIimm : PatLeaf<(imm), [{
- return (((unsigned)N->getValue() >> 10) << 10) == (unsigned)N->getValue();
-}], HI22>;
-
-// Addressing modes.
-def ADDRrr : ComplexPattern<i32, 2, "SelectADDRrr", [], []>;
-def ADDRri : ComplexPattern<i32, 2, "SelectADDRri", [frameindex], []>;
-
-// Address operands
-def MEMrr : Operand<i32> {
- let PrintMethod = "printMemOperand";
- let MIOperandInfo = (ops IntRegs, IntRegs);
-}
-def MEMri : Operand<i32> {
- let PrintMethod = "printMemOperand";
- let MIOperandInfo = (ops IntRegs, i32imm);
-}
-
-// Branch targets have OtherVT type.
-def brtarget : Operand<OtherVT>;
-def calltarget : Operand<i32>;
-
-// Operand for printing out a condition code.
-let PrintMethod = "printCCOperand" in
- def CCOp : Operand<i32>;
-
-def SDTSPcmpfcc :
-SDTypeProfile<0, 2, [SDTCisFP<0>, SDTCisSameAs<0, 1>]>;
-def SDTSPbrcc :
-SDTypeProfile<0, 2, [SDTCisVT<0, OtherVT>, SDTCisVT<1, i32>]>;
-def SDTSPselectcc :
-SDTypeProfile<1, 3, [SDTCisSameAs<0, 1>, SDTCisSameAs<1, 2>, SDTCisVT<3, i32>]>;
-def SDTSPFTOI :
-SDTypeProfile<1, 1, [SDTCisVT<0, f32>, SDTCisFP<1>]>;
-def SDTSPITOF :
-SDTypeProfile<1, 1, [SDTCisFP<0>, SDTCisVT<1, f32>]>;
-
-def SPcmpicc : SDNode<"SPISD::CMPICC", SDTIntBinOp, [SDNPOutFlag]>;
-def SPcmpfcc : SDNode<"SPISD::CMPFCC", SDTSPcmpfcc, [SDNPOutFlag]>;
-def SPbricc : SDNode<"SPISD::BRICC", SDTSPbrcc, [SDNPHasChain, SDNPInFlag]>;
-def SPbrfcc : SDNode<"SPISD::BRFCC", SDTSPbrcc, [SDNPHasChain, SDNPInFlag]>;
-
-def SPhi : SDNode<"SPISD::Hi", SDTIntUnaryOp>;
-def SPlo : SDNode<"SPISD::Lo", SDTIntUnaryOp>;
-
-def SPftoi : SDNode<"SPISD::FTOI", SDTSPFTOI>;
-def SPitof : SDNode<"SPISD::ITOF", SDTSPITOF>;
-
-def SPselecticc : SDNode<"SPISD::SELECT_ICC", SDTSPselectcc, [SDNPInFlag]>;
-def SPselectfcc : SDNode<"SPISD::SELECT_FCC", SDTSPselectcc, [SDNPInFlag]>;
-
-// These are target-independent nodes, but have target-specific formats.
-def SDT_SPCallSeqStart : SDCallSeqStart<[ SDTCisVT<0, i32> ]>;
-def SDT_SPCallSeqEnd : SDCallSeqEnd<[ SDTCisVT<0, i32>,
- SDTCisVT<1, i32> ]>;
-
-def callseq_start : SDNode<"ISD::CALLSEQ_START", SDT_SPCallSeqStart,
- [SDNPHasChain, SDNPOutFlag]>;
-def callseq_end : SDNode<"ISD::CALLSEQ_END", SDT_SPCallSeqEnd,
- [SDNPHasChain, SDNPOptInFlag, SDNPOutFlag]>;
-
-def SDT_SPCall : SDTypeProfile<0, 1, [SDTCisVT<0, i32>]>;
-def call : SDNode<"SPISD::CALL", SDT_SPCall,
- [SDNPHasChain, SDNPOptInFlag, SDNPOutFlag]>;
-
-def retflag : SDNode<"SPISD::RET_FLAG", SDTNone,
- [SDNPHasChain, SDNPOptInFlag]>;
-
-//===----------------------------------------------------------------------===//
-// SPARC Flag Conditions
-//===----------------------------------------------------------------------===//
-
-// Note that these values must be kept in sync with the CCOp::CondCode enum
-// values.
-class ICC_VAL<int N> : PatLeaf<(i32 N)>;
-def ICC_NE : ICC_VAL< 9>; // Not Equal
-def ICC_E : ICC_VAL< 1>; // Equal
-def ICC_G : ICC_VAL<10>; // Greater
-def ICC_LE : ICC_VAL< 2>; // Less or Equal
-def ICC_GE : ICC_VAL<11>; // Greater or Equal
-def ICC_L : ICC_VAL< 3>; // Less
-def ICC_GU : ICC_VAL<12>; // Greater Unsigned
-def ICC_LEU : ICC_VAL< 4>; // Less or Equal Unsigned
-def ICC_CC : ICC_VAL<13>; // Carry Clear/Great or Equal Unsigned
-def ICC_CS : ICC_VAL< 5>; // Carry Set/Less Unsigned
-def ICC_POS : ICC_VAL<14>; // Positive
-def ICC_NEG : ICC_VAL< 6>; // Negative
-def ICC_VC : ICC_VAL<15>; // Overflow Clear
-def ICC_VS : ICC_VAL< 7>; // Overflow Set
-
-class FCC_VAL<int N> : PatLeaf<(i32 N)>;
-def FCC_U : FCC_VAL<23>; // Unordered
-def FCC_G : FCC_VAL<22>; // Greater
-def FCC_UG : FCC_VAL<21>; // Unordered or Greater
-def FCC_L : FCC_VAL<20>; // Less
-def FCC_UL : FCC_VAL<19>; // Unordered or Less
-def FCC_LG : FCC_VAL<18>; // Less or Greater
-def FCC_NE : FCC_VAL<17>; // Not Equal
-def FCC_E : FCC_VAL<25>; // Equal
-def FCC_UE : FCC_VAL<24>; // Unordered or Equal
-def FCC_GE : FCC_VAL<25>; // Greater or Equal
-def FCC_UGE : FCC_VAL<26>; // Unordered or Greater or Equal
-def FCC_LE : FCC_VAL<27>; // Less or Equal
-def FCC_ULE : FCC_VAL<28>; // Unordered or Less or Equal
-def FCC_O : FCC_VAL<29>; // Ordered
-
-//===----------------------------------------------------------------------===//
-// Instruction Class Templates
-//===----------------------------------------------------------------------===//
-
-/// F3_12 multiclass - Define a normal F3_1/F3_2 pattern in one shot.
-multiclass F3_12<string OpcStr, bits<6> Op3Val, SDNode OpNode> {
- def rr : F3_1<2, Op3Val,
- (outs IntRegs:$dst), (ins IntRegs:$b, IntRegs:$c),
- !strconcat(OpcStr, " $b, $c, $dst"),
- [(set IntRegs:$dst, (OpNode IntRegs:$b, IntRegs:$c))]>;
- def ri : F3_2<2, Op3Val,
- (outs IntRegs:$dst), (ins IntRegs:$b, i32imm:$c),
- !strconcat(OpcStr, " $b, $c, $dst"),
- [(set IntRegs:$dst, (OpNode IntRegs:$b, simm13:$c))]>;
-}
-
-/// F3_12np multiclass - Define a normal F3_1/F3_2 pattern in one shot, with no
-/// pattern.
-multiclass F3_12np<string OpcStr, bits<6> Op3Val> {
- def rr : F3_1<2, Op3Val,
- (outs IntRegs:$dst), (ins IntRegs:$b, IntRegs:$c),
- !strconcat(OpcStr, " $b, $c, $dst"), []>;
- def ri : F3_2<2, Op3Val,
- (outs IntRegs:$dst), (ins IntRegs:$b, i32imm:$c),
- !strconcat(OpcStr, " $b, $c, $dst"), []>;
-}
-
-//===----------------------------------------------------------------------===//
-// Instructions
-//===----------------------------------------------------------------------===//
-
-// Pseudo instructions.
-class Pseudo<dag outs, dag ins, string asmstr, list<dag> pattern>
- : InstSP<outs, ins, asmstr, pattern>;
-
-let Defs = [O6], Uses = [O6] in {
-def ADJCALLSTACKDOWN : Pseudo<(outs), (ins i32imm:$amt),
- "!ADJCALLSTACKDOWN $amt",
- [(callseq_start imm:$amt)]>;
-def ADJCALLSTACKUP : Pseudo<(outs), (ins i32imm:$amt1, i32imm:$amt2),
- "!ADJCALLSTACKUP $amt1",
- [(callseq_end imm:$amt1, imm:$amt2)]>;
-}
-
-// FpMOVD/FpNEGD/FpABSD - These are lowered to single-precision ops by the
-// fpmover pass.
-let Predicates = [HasNoV9] in { // Only emit these in V8 mode.
- def FpMOVD : Pseudo<(outs DFPRegs:$dst), (ins DFPRegs:$src),
- "!FpMOVD $src, $dst", []>;
- def FpNEGD : Pseudo<(outs DFPRegs:$dst), (ins DFPRegs:$src),
- "!FpNEGD $src, $dst",
- [(set DFPRegs:$dst, (fneg DFPRegs:$src))]>;
- def FpABSD : Pseudo<(outs DFPRegs:$dst), (ins DFPRegs:$src),
- "!FpABSD $src, $dst",
- [(set DFPRegs:$dst, (fabs DFPRegs:$src))]>;
-}
-
-// SELECT_CC_* - Used to implement the SELECT_CC DAG operation. Expanded by the
-// scheduler into a branch sequence. This has to handle all permutations of
-// selection between i32/f32/f64 on ICC and FCC.
-let usesCustomDAGSchedInserter = 1 in { // Expanded by the scheduler.
- def SELECT_CC_Int_ICC
- : Pseudo<(outs IntRegs:$dst), (ins IntRegs:$T, IntRegs:$F, i32imm:$Cond),
- "; SELECT_CC_Int_ICC PSEUDO!",
- [(set IntRegs:$dst, (SPselecticc IntRegs:$T, IntRegs:$F,
- imm:$Cond))]>;
- def SELECT_CC_Int_FCC
- : Pseudo<(outs IntRegs:$dst), (ins IntRegs:$T, IntRegs:$F, i32imm:$Cond),
- "; SELECT_CC_Int_FCC PSEUDO!",
- [(set IntRegs:$dst, (SPselectfcc IntRegs:$T, IntRegs:$F,
- imm:$Cond))]>;
- def SELECT_CC_FP_ICC
- : Pseudo<(outs FPRegs:$dst), (ins FPRegs:$T, FPRegs:$F, i32imm:$Cond),
- "; SELECT_CC_FP_ICC PSEUDO!",
- [(set FPRegs:$dst, (SPselecticc FPRegs:$T, FPRegs:$F,
- imm:$Cond))]>;
- def SELECT_CC_FP_FCC
- : Pseudo<(outs FPRegs:$dst), (ins FPRegs:$T, FPRegs:$F, i32imm:$Cond),
- "; SELECT_CC_FP_FCC PSEUDO!",
- [(set FPRegs:$dst, (SPselectfcc FPRegs:$T, FPRegs:$F,
- imm:$Cond))]>;
- def SELECT_CC_DFP_ICC
- : Pseudo<(outs DFPRegs:$dst), (ins DFPRegs:$T, DFPRegs:$F, i32imm:$Cond),
- "; SELECT_CC_DFP_ICC PSEUDO!",
- [(set DFPRegs:$dst, (SPselecticc DFPRegs:$T, DFPRegs:$F,
- imm:$Cond))]>;
- def SELECT_CC_DFP_FCC
- : Pseudo<(outs DFPRegs:$dst), (ins DFPRegs:$T, DFPRegs:$F, i32imm:$Cond),
- "; SELECT_CC_DFP_FCC PSEUDO!",
- [(set DFPRegs:$dst, (SPselectfcc DFPRegs:$T, DFPRegs:$F,
- imm:$Cond))]>;
-}
-
-
-// Section A.3 - Synthetic Instructions, p. 85
-// special cases of JMPL:
-let isReturn = 1, isTerminator = 1, hasDelaySlot = 1 in {
- let rd = O7.Num, rs1 = G0.Num, simm13 = 8 in
- def RETL: F3_2<2, 0b111000, (outs), (ins), "retl", [(retflag)]>;
-}
-
-// Section B.1 - Load Integer Instructions, p. 90
-def LDSBrr : F3_1<3, 0b001001,
- (outs IntRegs:$dst), (ins MEMrr:$addr),
- "ldsb [$addr], $dst",
- [(set IntRegs:$dst, (sextloadi8 ADDRrr:$addr))]>;
-def LDSBri : F3_2<3, 0b001001,
- (outs IntRegs:$dst), (ins MEMri:$addr),
- "ldsb [$addr], $dst",
- [(set IntRegs:$dst, (sextloadi8 ADDRri:$addr))]>;
-def LDSHrr : F3_1<3, 0b001010,
- (outs IntRegs:$dst), (ins MEMrr:$addr),
- "ldsh [$addr], $dst",
- [(set IntRegs:$dst, (sextloadi16 ADDRrr:$addr))]>;
-def LDSHri : F3_2<3, 0b001010,
- (outs IntRegs:$dst), (ins MEMri:$addr),
- "ldsh [$addr], $dst",
- [(set IntRegs:$dst, (sextloadi16 ADDRri:$addr))]>;
-def LDUBrr : F3_1<3, 0b000001,
- (outs IntRegs:$dst), (ins MEMrr:$addr),
- "ldub [$addr], $dst",
- [(set IntRegs:$dst, (zextloadi8 ADDRrr:$addr))]>;
-def LDUBri : F3_2<3, 0b000001,
- (outs IntRegs:$dst), (ins MEMri:$addr),
- "ldub [$addr], $dst",
- [(set IntRegs:$dst, (zextloadi8 ADDRri:$addr))]>;
-def LDUHrr : F3_1<3, 0b000010,
- (outs IntRegs:$dst), (ins MEMrr:$addr),
- "lduh [$addr], $dst",
- [(set IntRegs:$dst, (zextloadi16 ADDRrr:$addr))]>;
-def LDUHri : F3_2<3, 0b000010,
- (outs IntRegs:$dst), (ins MEMri:$addr),
- "lduh [$addr], $dst",
- [(set IntRegs:$dst, (zextloadi16 ADDRri:$addr))]>;
-def LDrr : F3_1<3, 0b000000,
- (outs IntRegs:$dst), (ins MEMrr:$addr),
- "ld [$addr], $dst",
- [(set IntRegs:$dst, (load ADDRrr:$addr))]>;
-def LDri : F3_2<3, 0b000000,
- (outs IntRegs:$dst), (ins MEMri:$addr),
- "ld [$addr], $dst",
- [(set IntRegs:$dst, (load ADDRri:$addr))]>;
-
-// Section B.2 - Load Floating-point Instructions, p. 92
-def LDFrr : F3_1<3, 0b100000,
- (outs FPRegs:$dst), (ins MEMrr:$addr),
- "ld [$addr], $dst",
- [(set FPRegs:$dst, (load ADDRrr:$addr))]>;
-def LDFri : F3_2<3, 0b100000,
- (outs FPRegs:$dst), (ins MEMri:$addr),
- "ld [$addr], $dst",
- [(set FPRegs:$dst, (load ADDRri:$addr))]>;
-def LDDFrr : F3_1<3, 0b100011,
- (outs DFPRegs:$dst), (ins MEMrr:$addr),
- "ldd [$addr], $dst",
- [(set DFPRegs:$dst, (load ADDRrr:$addr))]>;
-def LDDFri : F3_2<3, 0b100011,
- (outs DFPRegs:$dst), (ins MEMri:$addr),
- "ldd [$addr], $dst",
- [(set DFPRegs:$dst, (load ADDRri:$addr))]>;
-
-// Section B.4 - Store Integer Instructions, p. 95
-def STBrr : F3_1<3, 0b000101,
- (outs), (ins MEMrr:$addr, IntRegs:$src),
- "stb $src, [$addr]",
- [(truncstorei8 IntRegs:$src, ADDRrr:$addr)]>;
-def STBri : F3_2<3, 0b000101,
- (outs), (ins MEMri:$addr, IntRegs:$src),
- "stb $src, [$addr]",
- [(truncstorei8 IntRegs:$src, ADDRri:$addr)]>;
-def STHrr : F3_1<3, 0b000110,
- (outs), (ins MEMrr:$addr, IntRegs:$src),
- "sth $src, [$addr]",
- [(truncstorei16 IntRegs:$src, ADDRrr:$addr)]>;
-def STHri : F3_2<3, 0b000110,
- (outs), (ins MEMri:$addr, IntRegs:$src),
- "sth $src, [$addr]",
- [(truncstorei16 IntRegs:$src, ADDRri:$addr)]>;
-def STrr : F3_1<3, 0b000100,
- (outs), (ins MEMrr:$addr, IntRegs:$src),
- "st $src, [$addr]",
- [(store IntRegs:$src, ADDRrr:$addr)]>;
-def STri : F3_2<3, 0b000100,
- (outs), (ins MEMri:$addr, IntRegs:$src),
- "st $src, [$addr]",
- [(store IntRegs:$src, ADDRri:$addr)]>;
-
-// Section B.5 - Store Floating-point Instructions, p. 97
-def STFrr : F3_1<3, 0b100100,
- (outs), (ins MEMrr:$addr, FPRegs:$src),
- "st $src, [$addr]",
- [(store FPRegs:$src, ADDRrr:$addr)]>;
-def STFri : F3_2<3, 0b100100,
- (outs), (ins MEMri:$addr, FPRegs:$src),
- "st $src, [$addr]",
- [(store FPRegs:$src, ADDRri:$addr)]>;
-def STDFrr : F3_1<3, 0b100111,
- (outs), (ins MEMrr:$addr, DFPRegs:$src),
- "std $src, [$addr]",
- [(store DFPRegs:$src, ADDRrr:$addr)]>;
-def STDFri : F3_2<3, 0b100111,
- (outs), (ins MEMri:$addr, DFPRegs:$src),
- "std $src, [$addr]",
- [(store DFPRegs:$src, ADDRri:$addr)]>;
-
-// Section B.9 - SETHI Instruction, p. 104
-def SETHIi: F2_1<0b100,
- (outs IntRegs:$dst), (ins i32imm:$src),
- "sethi $src, $dst",
- [(set IntRegs:$dst, SETHIimm:$src)]>;
-
-// Section B.10 - NOP Instruction, p. 105
-// (It's a special case of SETHI)
-let rd = 0, imm22 = 0 in
- def NOP : F2_1<0b100, (outs), (ins), "nop", []>;
-
-// Section B.11 - Logical Instructions, p. 106
-defm AND : F3_12<"and", 0b000001, and>;
-
-def ANDNrr : F3_1<2, 0b000101,
- (outs IntRegs:$dst), (ins IntRegs:$b, IntRegs:$c),
- "andn $b, $c, $dst",
- [(set IntRegs:$dst, (and IntRegs:$b, (not IntRegs:$c)))]>;
-def ANDNri : F3_2<2, 0b000101,
- (outs IntRegs:$dst), (ins IntRegs:$b, i32imm:$c),
- "andn $b, $c, $dst", []>;
-
-defm OR : F3_12<"or", 0b000010, or>;
-
-def ORNrr : F3_1<2, 0b000110,
- (outs IntRegs:$dst), (ins IntRegs:$b, IntRegs:$c),
- "orn $b, $c, $dst",
- [(set IntRegs:$dst, (or IntRegs:$b, (not IntRegs:$c)))]>;
-def ORNri : F3_2<2, 0b000110,
- (outs IntRegs:$dst), (ins IntRegs:$b, i32imm:$c),
- "orn $b, $c, $dst", []>;
-defm XOR : F3_12<"xor", 0b000011, xor>;
-
-def XNORrr : F3_1<2, 0b000111,
- (outs IntRegs:$dst), (ins IntRegs:$b, IntRegs:$c),
- "xnor $b, $c, $dst",
- [(set IntRegs:$dst, (not (xor IntRegs:$b, IntRegs:$c)))]>;
-def XNORri : F3_2<2, 0b000111,
- (outs IntRegs:$dst), (ins IntRegs:$b, i32imm:$c),
- "xnor $b, $c, $dst", []>;
-
-// Section B.12 - Shift Instructions, p. 107
-defm SLL : F3_12<"sll", 0b100101, shl>;
-defm SRL : F3_12<"srl", 0b100110, srl>;
-defm SRA : F3_12<"sra", 0b100111, sra>;
-
-// Section B.13 - Add Instructions, p. 108
-defm ADD : F3_12<"add", 0b000000, add>;
-
-// "LEA" forms of add (patterns to make tblgen happy)
-def LEA_ADDri : F3_2<2, 0b000000,
- (outs IntRegs:$dst), (ins MEMri:$addr),
- "add ${addr:arith}, $dst",
- [(set IntRegs:$dst, ADDRri:$addr)]>;
-
-defm ADDCC : F3_12<"addcc", 0b010000, addc>;
-defm ADDX : F3_12<"addx", 0b001000, adde>;
-
-// Section B.15 - Subtract Instructions, p. 110
-defm SUB : F3_12 <"sub" , 0b000100, sub>;
-defm SUBX : F3_12 <"subx" , 0b001100, sube>;
-defm SUBCC : F3_12 <"subcc", 0b010100, SPcmpicc>;
-
-def SUBXCCrr: F3_1<2, 0b011100,
- (outs IntRegs:$dst), (ins IntRegs:$b, IntRegs:$c),
- "subxcc $b, $c, $dst", []>;
-
-// Section B.18 - Multiply Instructions, p. 113
-defm UMUL : F3_12np<"umul", 0b001010>;
-defm SMUL : F3_12 <"smul", 0b001011, mul>;
-
-
-// Section B.19 - Divide Instructions, p. 115
-defm UDIV : F3_12np<"udiv", 0b001110>;
-defm SDIV : F3_12np<"sdiv", 0b001111>;
-
-// Section B.20 - SAVE and RESTORE, p. 117
-defm SAVE : F3_12np<"save" , 0b111100>;
-defm RESTORE : F3_12np<"restore", 0b111101>;
-
-// Section B.21 - Branch on Integer Condition Codes Instructions, p. 119
-
-// conditional branch class:
-class BranchSP<bits<4> cc, dag ins, string asmstr, list<dag> pattern>
- : F2_2<cc, 0b010, (outs), ins, asmstr, pattern> {
- let isBranch = 1;
- let isTerminator = 1;
- let hasDelaySlot = 1;
-}
-
-let isBarrier = 1 in
- def BA : BranchSP<0b1000, (ins brtarget:$dst),
- "ba $dst",
- [(br bb:$dst)]>;
-
-// FIXME: the encoding for the JIT should look at the condition field.
-def BCOND : BranchSP<0, (ins brtarget:$dst, CCOp:$cc),
- "b$cc $dst",
- [(SPbricc bb:$dst, imm:$cc)]>;
-
-
-// Section B.22 - Branch on Floating-point Condition Codes Instructions, p. 121
-
-// floating-point conditional branch class:
-class FPBranchSP<bits<4> cc, dag ins, string asmstr, list<dag> pattern>
- : F2_2<cc, 0b110, (outs), ins, asmstr, pattern> {
- let isBranch = 1;
- let isTerminator = 1;
- let hasDelaySlot = 1;
-}
-
-// FIXME: the encoding for the JIT should look at the condition field.
-def FBCOND : FPBranchSP<0, (ins brtarget:$dst, CCOp:$cc),
- "fb$cc $dst",
- [(SPbrfcc bb:$dst, imm:$cc)]>;
-
-
-// Section B.24 - Call and Link Instruction, p. 125
-// This is the only Format 1 instruction
-let Uses = [O0, O1, O2, O3, O4, O5],
- hasDelaySlot = 1, isCall = 1,
- Defs = [O0, O1, O2, O3, O4, O5, O7, G1, G2, G3, G4, G5, G6, G7,
- D0, D1, D2, D3, D4, D5, D6, D7, D8, D9, D10, D11, D12, D13, D14, D15] in {
- def CALL : InstSP<(outs), (ins calltarget:$dst),
- "call $dst", []> {
- bits<30> disp;
- let op = 1;
- let Inst{29-0} = disp;
- }
-
- // indirect calls
- def JMPLrr : F3_1<2, 0b111000,
- (outs), (ins MEMrr:$ptr),
- "call $ptr",
- [(call ADDRrr:$ptr)]>;
- def JMPLri : F3_2<2, 0b111000,
- (outs), (ins MEMri:$ptr),
- "call $ptr",
- [(call ADDRri:$ptr)]>;
-}
-
-// Section B.28 - Read State Register Instructions
-def RDY : F3_1<2, 0b101000,
- (outs IntRegs:$dst), (ins),
- "rd %y, $dst", []>;
-
-// Section B.29 - Write State Register Instructions
-def WRYrr : F3_1<2, 0b110000,
- (outs), (ins IntRegs:$b, IntRegs:$c),
- "wr $b, $c, %y", []>;
-def WRYri : F3_2<2, 0b110000,
- (outs), (ins IntRegs:$b, i32imm:$c),
- "wr $b, $c, %y", []>;
-
-// Convert Integer to Floating-point Instructions, p. 141
-def FITOS : F3_3<2, 0b110100, 0b011000100,
- (outs FPRegs:$dst), (ins FPRegs:$src),
- "fitos $src, $dst",
- [(set FPRegs:$dst, (SPitof FPRegs:$src))]>;
-def FITOD : F3_3<2, 0b110100, 0b011001000,
- (outs DFPRegs:$dst), (ins FPRegs:$src),
- "fitod $src, $dst",
- [(set DFPRegs:$dst, (SPitof FPRegs:$src))]>;
-
-// Convert Floating-point to Integer Instructions, p. 142
-def FSTOI : F3_3<2, 0b110100, 0b011010001,
- (outs FPRegs:$dst), (ins FPRegs:$src),
- "fstoi $src, $dst",
- [(set FPRegs:$dst, (SPftoi FPRegs:$src))]>;
-def FDTOI : F3_3<2, 0b110100, 0b011010010,
- (outs FPRegs:$dst), (ins DFPRegs:$src),
- "fdtoi $src, $dst",
- [(set FPRegs:$dst, (SPftoi DFPRegs:$src))]>;
-
-// Convert between Floating-point Formats Instructions, p. 143
-def FSTOD : F3_3<2, 0b110100, 0b011001001,
- (outs DFPRegs:$dst), (ins FPRegs:$src),
- "fstod $src, $dst",
- [(set DFPRegs:$dst, (fextend FPRegs:$src))]>;
-def FDTOS : F3_3<2, 0b110100, 0b011000110,
- (outs FPRegs:$dst), (ins DFPRegs:$src),
- "fdtos $src, $dst",
- [(set FPRegs:$dst, (fround DFPRegs:$src))]>;
-
-// Floating-point Move Instructions, p. 144
-def FMOVS : F3_3<2, 0b110100, 0b000000001,
- (outs FPRegs:$dst), (ins FPRegs:$src),
- "fmovs $src, $dst", []>;
-def FNEGS : F3_3<2, 0b110100, 0b000000101,
- (outs FPRegs:$dst), (ins FPRegs:$src),
- "fnegs $src, $dst",
- [(set FPRegs:$dst, (fneg FPRegs:$src))]>;
-def FABSS : F3_3<2, 0b110100, 0b000001001,
- (outs FPRegs:$dst), (ins FPRegs:$src),
- "fabss $src, $dst",
- [(set FPRegs:$dst, (fabs FPRegs:$src))]>;
-
-
-// Floating-point Square Root Instructions, p.145
-def FSQRTS : F3_3<2, 0b110100, 0b000101001,
- (outs FPRegs:$dst), (ins FPRegs:$src),
- "fsqrts $src, $dst",
- [(set FPRegs:$dst, (fsqrt FPRegs:$src))]>;
-def FSQRTD : F3_3<2, 0b110100, 0b000101010,
- (outs DFPRegs:$dst), (ins DFPRegs:$src),
- "fsqrtd $src, $dst",
- [(set DFPRegs:$dst, (fsqrt DFPRegs:$src))]>;
-
-
-
-// Floating-point Add and Subtract Instructions, p. 146
-def FADDS : F3_3<2, 0b110100, 0b001000001,
- (outs FPRegs:$dst), (ins FPRegs:$src1, FPRegs:$src2),
- "fadds $src1, $src2, $dst",
- [(set FPRegs:$dst, (fadd FPRegs:$src1, FPRegs:$src2))]>;
-def FADDD : F3_3<2, 0b110100, 0b001000010,
- (outs DFPRegs:$dst), (ins DFPRegs:$src1, DFPRegs:$src2),
- "faddd $src1, $src2, $dst",
- [(set DFPRegs:$dst, (fadd DFPRegs:$src1, DFPRegs:$src2))]>;
-def FSUBS : F3_3<2, 0b110100, 0b001000101,
- (outs FPRegs:$dst), (ins FPRegs:$src1, FPRegs:$src2),
- "fsubs $src1, $src2, $dst",
- [(set FPRegs:$dst, (fsub FPRegs:$src1, FPRegs:$src2))]>;
-def FSUBD : F3_3<2, 0b110100, 0b001000110,
- (outs DFPRegs:$dst), (ins DFPRegs:$src1, DFPRegs:$src2),
- "fsubd $src1, $src2, $dst",
- [(set DFPRegs:$dst, (fsub DFPRegs:$src1, DFPRegs:$src2))]>;
-
-// Floating-point Multiply and Divide Instructions, p. 147
-def FMULS : F3_3<2, 0b110100, 0b001001001,
- (outs FPRegs:$dst), (ins FPRegs:$src1, FPRegs:$src2),
- "fmuls $src1, $src2, $dst",
- [(set FPRegs:$dst, (fmul FPRegs:$src1, FPRegs:$src2))]>;
-def FMULD : F3_3<2, 0b110100, 0b001001010,
- (outs DFPRegs:$dst), (ins DFPRegs:$src1, DFPRegs:$src2),
- "fmuld $src1, $src2, $dst",
- [(set DFPRegs:$dst, (fmul DFPRegs:$src1, DFPRegs:$src2))]>;
-def FSMULD : F3_3<2, 0b110100, 0b001101001,
- (outs DFPRegs:$dst), (ins FPRegs:$src1, FPRegs:$src2),
- "fsmuld $src1, $src2, $dst",
- [(set DFPRegs:$dst, (fmul (fextend FPRegs:$src1),
- (fextend FPRegs:$src2)))]>;
-def FDIVS : F3_3<2, 0b110100, 0b001001101,
- (outs FPRegs:$dst), (ins FPRegs:$src1, FPRegs:$src2),
- "fdivs $src1, $src2, $dst",
- [(set FPRegs:$dst, (fdiv FPRegs:$src1, FPRegs:$src2))]>;
-def FDIVD : F3_3<2, 0b110100, 0b001001110,
- (outs DFPRegs:$dst), (ins DFPRegs:$src1, DFPRegs:$src2),
- "fdivd $src1, $src2, $dst",
- [(set DFPRegs:$dst, (fdiv DFPRegs:$src1, DFPRegs:$src2))]>;
-
-// Floating-point Compare Instructions, p. 148
-// Note: the 2nd template arg is different for these guys.
-// Note 2: the result of a FCMP is not available until the 2nd cycle
-// after the instr is retired, but there is no interlock. This behavior
-// is modelled with a forced noop after the instruction.
-def FCMPS : F3_3<2, 0b110101, 0b001010001,
- (outs), (ins FPRegs:$src1, FPRegs:$src2),
- "fcmps $src1, $src2\n\tnop",
- [(SPcmpfcc FPRegs:$src1, FPRegs:$src2)]>;
-def FCMPD : F3_3<2, 0b110101, 0b001010010,
- (outs), (ins DFPRegs:$src1, DFPRegs:$src2),
- "fcmpd $src1, $src2\n\tnop",
- [(SPcmpfcc DFPRegs:$src1, DFPRegs:$src2)]>;
-
-
-//===----------------------------------------------------------------------===//
-// V9 Instructions
-//===----------------------------------------------------------------------===//
-
-// V9 Conditional Moves.
-let Predicates = [HasV9], isTwoAddress = 1 in {
- // Move Integer Register on Condition (MOVcc) p. 194 of the V9 manual.
- // FIXME: Add instruction encodings for the JIT some day.
- def MOVICCrr
- : Pseudo<(outs IntRegs:$dst), (ins IntRegs:$T, IntRegs:$F, CCOp:$cc),
- "mov$cc %icc, $F, $dst",
- [(set IntRegs:$dst,
- (SPselecticc IntRegs:$F, IntRegs:$T, imm:$cc))]>;
- def MOVICCri
- : Pseudo<(outs IntRegs:$dst), (ins IntRegs:$T, i32imm:$F, CCOp:$cc),
- "mov$cc %icc, $F, $dst",
- [(set IntRegs:$dst,
- (SPselecticc simm11:$F, IntRegs:$T, imm:$cc))]>;
-
- def MOVFCCrr
- : Pseudo<(outs IntRegs:$dst), (ins IntRegs:$T, IntRegs:$F, CCOp:$cc),
- "mov$cc %fcc0, $F, $dst",
- [(set IntRegs:$dst,
- (SPselectfcc IntRegs:$F, IntRegs:$T, imm:$cc))]>;
- def MOVFCCri
- : Pseudo<(outs IntRegs:$dst), (ins IntRegs:$T, i32imm:$F, CCOp:$cc),
- "mov$cc %fcc0, $F, $dst",
- [(set IntRegs:$dst,
- (SPselectfcc simm11:$F, IntRegs:$T, imm:$cc))]>;
-
- def FMOVS_ICC
- : Pseudo<(outs FPRegs:$dst), (ins FPRegs:$T, FPRegs:$F, CCOp:$cc),
- "fmovs$cc %icc, $F, $dst",
- [(set FPRegs:$dst,
- (SPselecticc FPRegs:$F, FPRegs:$T, imm:$cc))]>;
- def FMOVD_ICC
- : Pseudo<(outs DFPRegs:$dst), (ins DFPRegs:$T, DFPRegs:$F, CCOp:$cc),
- "fmovd$cc %icc, $F, $dst",
- [(set DFPRegs:$dst,
- (SPselecticc DFPRegs:$F, DFPRegs:$T, imm:$cc))]>;
- def FMOVS_FCC
- : Pseudo<(outs FPRegs:$dst), (ins FPRegs:$T, FPRegs:$F, CCOp:$cc),
- "fmovs$cc %fcc0, $F, $dst",
- [(set FPRegs:$dst,
- (SPselectfcc FPRegs:$F, FPRegs:$T, imm:$cc))]>;
- def FMOVD_FCC
- : Pseudo<(outs DFPRegs:$dst), (ins DFPRegs:$T, DFPRegs:$F, CCOp:$cc),
- "fmovd$cc %fcc0, $F, $dst",
- [(set DFPRegs:$dst,
- (SPselectfcc DFPRegs:$F, DFPRegs:$T, imm:$cc))]>;
-
-}
-
-// Floating-Point Move Instructions, p. 164 of the V9 manual.
-let Predicates = [HasV9] in {
- def FMOVD : F3_3<2, 0b110100, 0b000000010,
- (outs DFPRegs:$dst), (ins DFPRegs:$src),
- "fmovd $src, $dst", []>;
- def FNEGD : F3_3<2, 0b110100, 0b000000110,
- (outs DFPRegs:$dst), (ins DFPRegs:$src),
- "fnegd $src, $dst",
- [(set DFPRegs:$dst, (fneg DFPRegs:$src))]>;
- def FABSD : F3_3<2, 0b110100, 0b000001010,
- (outs DFPRegs:$dst), (ins DFPRegs:$src),
- "fabsd $src, $dst",
- [(set DFPRegs:$dst, (fabs DFPRegs:$src))]>;
-}
-
-// POPCrr - This does a ctpop of a 64-bit register. As such, we have to clear
-// the top 32-bits before using it. To do this clearing, we use a SLLri X,0.
-def POPCrr : F3_1<2, 0b101110,
- (outs IntRegs:$dst), (ins IntRegs:$src),
- "popc $src, $dst", []>, Requires<[HasV9]>;
-def : Pat<(ctpop IntRegs:$src),
- (POPCrr (SLLri IntRegs:$src, 0))>;
-
-//===----------------------------------------------------------------------===//
-// Non-Instruction Patterns
-//===----------------------------------------------------------------------===//
-
-// Small immediates.
-def : Pat<(i32 simm13:$val),
- (ORri G0, imm:$val)>;
-// Arbitrary immediates.
-def : Pat<(i32 imm:$val),
- (ORri (SETHIi (HI22 imm:$val)), (LO10 imm:$val))>;
-
-// subc
-def : Pat<(subc IntRegs:$b, IntRegs:$c),
- (SUBCCrr IntRegs:$b, IntRegs:$c)>;
-def : Pat<(subc IntRegs:$b, simm13:$val),
- (SUBCCri IntRegs:$b, imm:$val)>;
-
-// Global addresses, constant pool entries
-def : Pat<(SPhi tglobaladdr:$in), (SETHIi tglobaladdr:$in)>;
-def : Pat<(SPlo tglobaladdr:$in), (ORri G0, tglobaladdr:$in)>;
-def : Pat<(SPhi tconstpool:$in), (SETHIi tconstpool:$in)>;
-def : Pat<(SPlo tconstpool:$in), (ORri G0, tconstpool:$in)>;
-
-// Add reg, lo. This is used when taking the addr of a global/constpool entry.
-def : Pat<(add IntRegs:$r, (SPlo tglobaladdr:$in)),
- (ADDri IntRegs:$r, tglobaladdr:$in)>;
-def : Pat<(add IntRegs:$r, (SPlo tconstpool:$in)),
- (ADDri IntRegs:$r, tconstpool:$in)>;
-
-// Calls:
-def : Pat<(call tglobaladdr:$dst),
- (CALL tglobaladdr:$dst)>;
-def : Pat<(call texternalsym:$dst),
- (CALL texternalsym:$dst)>;
-
-def : Pat<(ret), (RETL)>;
-
-// Map integer extload's to zextloads.
-def : Pat<(i32 (extloadi1 ADDRrr:$src)), (LDUBrr ADDRrr:$src)>;
-def : Pat<(i32 (extloadi1 ADDRri:$src)), (LDUBri ADDRri:$src)>;
-def : Pat<(i32 (extloadi8 ADDRrr:$src)), (LDUBrr ADDRrr:$src)>;
-def : Pat<(i32 (extloadi8 ADDRri:$src)), (LDUBri ADDRri:$src)>;
-def : Pat<(i32 (extloadi16 ADDRrr:$src)), (LDUHrr ADDRrr:$src)>;
-def : Pat<(i32 (extloadi16 ADDRri:$src)), (LDUHri ADDRri:$src)>;
-
-// zextload bool -> zextload byte
-def : Pat<(i32 (zextloadi1 ADDRrr:$src)), (LDUBrr ADDRrr:$src)>;
-def : Pat<(i32 (zextloadi1 ADDRri:$src)), (LDUBri ADDRri:$src)>;
diff --git a/release_23/lib/Target/Sparc/SparcRegisterInfo.cpp b/release_23/lib/Target/Sparc/SparcRegisterInfo.cpp
deleted file mode 100644
index 4241f734e75c..000000000000
--- a/release_23/lib/Target/Sparc/SparcRegisterInfo.cpp
+++ /dev/null
@@ -1,190 +0,0 @@
-//===- SparcRegisterInfo.cpp - SPARC Register Information -------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains the SPARC implementation of the TargetRegisterInfo class.
-//
-//===----------------------------------------------------------------------===//
-
-#include "Sparc.h"
-#include "SparcRegisterInfo.h"
-#include "SparcSubtarget.h"
-#include "llvm/CodeGen/MachineInstrBuilder.h"
-#include "llvm/CodeGen/MachineFunction.h"
-#include "llvm/CodeGen/MachineFrameInfo.h"
-#include "llvm/CodeGen/MachineLocation.h"
-#include "llvm/Target/TargetInstrInfo.h"
-#include "llvm/Type.h"
-#include "llvm/ADT/BitVector.h"
-#include "llvm/ADT/STLExtras.h"
-using namespace llvm;
-
-SparcRegisterInfo::SparcRegisterInfo(SparcSubtarget &st,
- const TargetInstrInfo &tii)
- : SparcGenRegisterInfo(SP::ADJCALLSTACKDOWN, SP::ADJCALLSTACKUP),
- Subtarget(st), TII(tii) {
-}
-
-const unsigned* SparcRegisterInfo::getCalleeSavedRegs(const MachineFunction *MF)
- const {
- static const unsigned CalleeSavedRegs[] = { 0 };
- return CalleeSavedRegs;
-}
-
-BitVector SparcRegisterInfo::getReservedRegs(const MachineFunction &MF) const {
- BitVector Reserved(getNumRegs());
- Reserved.set(SP::G2);
- Reserved.set(SP::G3);
- Reserved.set(SP::G4);
- Reserved.set(SP::O6);
- Reserved.set(SP::I6);
- Reserved.set(SP::I7);
- Reserved.set(SP::G0);
- Reserved.set(SP::G5);
- Reserved.set(SP::G6);
- Reserved.set(SP::G7);
- return Reserved;
-}
-
-
-const TargetRegisterClass* const*
-SparcRegisterInfo::getCalleeSavedRegClasses(const MachineFunction *MF) const {
- static const TargetRegisterClass * const CalleeSavedRegClasses[] = { 0 };
- return CalleeSavedRegClasses;
-}
-
-bool SparcRegisterInfo::hasFP(const MachineFunction &MF) const {
- return false;
-}
-
-void SparcRegisterInfo::
-eliminateCallFramePseudoInstr(MachineFunction &MF, MachineBasicBlock &MBB,
- MachineBasicBlock::iterator I) const {
- MachineInstr &MI = *I;
- int Size = MI.getOperand(0).getImm();
- if (MI.getOpcode() == SP::ADJCALLSTACKDOWN)
- Size = -Size;
- if (Size)
- BuildMI(MBB, I, TII.get(SP::ADDri), SP::O6).addReg(SP::O6).addImm(Size);
- MBB.erase(I);
-}
-
-void SparcRegisterInfo::eliminateFrameIndex(MachineBasicBlock::iterator II,
- int SPAdj, RegScavenger *RS) const {
- assert(SPAdj == 0 && "Unexpected");
-
- unsigned i = 0;
- MachineInstr &MI = *II;
- while (!MI.getOperand(i).isFrameIndex()) {
- ++i;
- assert(i < MI.getNumOperands() && "Instr doesn't have FrameIndex operand!");
- }
-
- int FrameIndex = MI.getOperand(i).getIndex();
-
- // Addressable stack objects are accessed using neg. offsets from %fp
- MachineFunction &MF = *MI.getParent()->getParent();
- int Offset = MF.getFrameInfo()->getObjectOffset(FrameIndex) +
- MI.getOperand(i+1).getImm();
-
- // Replace frame index with a frame pointer reference.
- if (Offset >= -4096 && Offset <= 4095) {
- // If the offset is small enough to fit in the immediate field, directly
- // encode it.
- MI.getOperand(i).ChangeToRegister(SP::I6, false);
- MI.getOperand(i+1).ChangeToImmediate(Offset);
- } else {
- // Otherwise, emit a G1 = SETHI %hi(offset). FIXME: it would be better to
- // scavenge a register here instead of reserving G1 all of the time.
- unsigned OffHi = (unsigned)Offset >> 10U;
- BuildMI(*MI.getParent(), II, TII.get(SP::SETHIi), SP::G1).addImm(OffHi);
- // Emit G1 = G1 + I6
- BuildMI(*MI.getParent(), II, TII.get(SP::ADDrr), SP::G1).addReg(SP::G1)
- .addReg(SP::I6);
- // Insert: G1+%lo(offset) into the user.
- MI.getOperand(i).ChangeToRegister(SP::G1, false);
- MI.getOperand(i+1).ChangeToImmediate(Offset & ((1 << 10)-1));
- }
-}
-
-void SparcRegisterInfo::
-processFunctionBeforeFrameFinalized(MachineFunction &MF) const {}
-
-void SparcRegisterInfo::emitPrologue(MachineFunction &MF) const {
- MachineBasicBlock &MBB = MF.front();
- MachineFrameInfo *MFI = MF.getFrameInfo();
-
- // Get the number of bytes to allocate from the FrameInfo
- int NumBytes = (int) MFI->getStackSize();
-
- // Emit the correct save instruction based on the number of bytes in
- // the frame. Minimum stack frame size according to V8 ABI is:
- // 16 words for register window spill
- // 1 word for address of returned aggregate-value
- // + 6 words for passing parameters on the stack
- // ----------
- // 23 words * 4 bytes per word = 92 bytes
- NumBytes += 92;
- // Round up to next doubleword boundary -- a double-word boundary
- // is required by the ABI.
- NumBytes = (NumBytes + 7) & ~7;
- NumBytes = -NumBytes;
-
- if (NumBytes >= -4096) {
- BuildMI(MBB, MBB.begin(), TII.get(SP::SAVEri),
- SP::O6).addImm(NumBytes).addReg(SP::O6);
- } else {
- MachineBasicBlock::iterator InsertPt = MBB.begin();
- // Emit this the hard way. This clobbers G1 which we always know is
- // available here.
- unsigned OffHi = (unsigned)NumBytes >> 10U;
- BuildMI(MBB, InsertPt, TII.get(SP::SETHIi), SP::G1).addImm(OffHi);
- // Emit G1 = G1 + I6
- BuildMI(MBB, InsertPt, TII.get(SP::ORri), SP::G1)
- .addReg(SP::G1).addImm(NumBytes & ((1 << 10)-1));
- BuildMI(MBB, InsertPt, TII.get(SP::SAVErr), SP::O6)
- .addReg(SP::O6).addReg(SP::G1);
- }
-}
-
-void SparcRegisterInfo::emitEpilogue(MachineFunction &MF,
- MachineBasicBlock &MBB) const {
- MachineBasicBlock::iterator MBBI = prior(MBB.end());
- assert(MBBI->getOpcode() == SP::RETL &&
- "Can only put epilog before 'retl' instruction!");
- BuildMI(MBB, MBBI, TII.get(SP::RESTORErr), SP::G0).addReg(SP::G0)
- .addReg(SP::G0);
-}
-
-unsigned SparcRegisterInfo::getRARegister() const {
- assert(0 && "What is the return address register");
- return 0;
-}
-
-unsigned SparcRegisterInfo::getFrameRegister(MachineFunction &MF) const {
- assert(0 && "What is the frame register");
- return SP::G1;
-}
-
-unsigned SparcRegisterInfo::getEHExceptionRegister() const {
- assert(0 && "What is the exception register");
- return 0;
-}
-
-unsigned SparcRegisterInfo::getEHHandlerRegister() const {
- assert(0 && "What is the exception handler register");
- return 0;
-}
-
-int SparcRegisterInfo::getDwarfRegNum(unsigned RegNum, bool isEH) const {
- assert(0 && "What is the dwarf register number");
- return -1;
-}
-
-#include "SparcGenRegisterInfo.inc"
-
diff --git a/release_23/lib/Target/Sparc/SparcRegisterInfo.h b/release_23/lib/Target/Sparc/SparcRegisterInfo.h
deleted file mode 100644
index fc863f3b28f0..000000000000
--- a/release_23/lib/Target/Sparc/SparcRegisterInfo.h
+++ /dev/null
@@ -1,67 +0,0 @@
-//===- SparcRegisterInfo.h - Sparc Register Information Impl ----*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains the Sparc implementation of the TargetRegisterInfo class.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef SPARCREGISTERINFO_H
-#define SPARCREGISTERINFO_H
-
-#include "llvm/Target/TargetRegisterInfo.h"
-#include "SparcGenRegisterInfo.h.inc"
-
-namespace llvm {
-
-class SparcSubtarget;
-class TargetInstrInfo;
-class Type;
-
-struct SparcRegisterInfo : public SparcGenRegisterInfo {
- SparcSubtarget &Subtarget;
- const TargetInstrInfo &TII;
-
- SparcRegisterInfo(SparcSubtarget &st, const TargetInstrInfo &tii);
-
- /// Code Generation virtual methods...
- const unsigned *getCalleeSavedRegs(const MachineFunction *MF = 0) const;
-
- const TargetRegisterClass* const* getCalleeSavedRegClasses(
- const MachineFunction *MF = 0) const;
-
- BitVector getReservedRegs(const MachineFunction &MF) const;
-
- bool hasFP(const MachineFunction &MF) const;
-
- void eliminateCallFramePseudoInstr(MachineFunction &MF,
- MachineBasicBlock &MBB,
- MachineBasicBlock::iterator I) const;
-
- void eliminateFrameIndex(MachineBasicBlock::iterator II,
- int SPAdj, RegScavenger *RS = NULL) const;
-
- void processFunctionBeforeFrameFinalized(MachineFunction &MF) const;
-
- void emitPrologue(MachineFunction &MF) const;
- void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const;
-
- // Debug information queries.
- unsigned getRARegister() const;
- unsigned getFrameRegister(MachineFunction &MF) const;
-
- // Exception handling queries.
- unsigned getEHExceptionRegister() const;
- unsigned getEHHandlerRegister() const;
-
- int getDwarfRegNum(unsigned RegNum, bool isEH) const;
-};
-
-} // end namespace llvm
-
-#endif
diff --git a/release_23/lib/Target/Sparc/SparcRegisterInfo.td b/release_23/lib/Target/Sparc/SparcRegisterInfo.td
deleted file mode 100644
index e3a50ca42bbb..000000000000
--- a/release_23/lib/Target/Sparc/SparcRegisterInfo.td
+++ /dev/null
@@ -1,158 +0,0 @@
-//===- SparcRegisterInfo.td - Sparc Register defs ----------*- tablegen -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-//===----------------------------------------------------------------------===//
-// Declarations that describe the Sparc register file
-//===----------------------------------------------------------------------===//
-
-class SparcReg<string n> : Register<n> {
- field bits<5> Num;
- let Namespace = "SP";
-}
-
-// Registers are identified with 5-bit ID numbers.
-// Ri - 32-bit integer registers
-class Ri<bits<5> num, string n> : SparcReg<n> {
- let Num = num;
-}
-// Rf - 32-bit floating-point registers
-class Rf<bits<5> num, string n> : SparcReg<n> {
- let Num = num;
-}
-// Rd - Slots in the FP register file for 64-bit floating-point values.
-class Rd<bits<5> num, string n, list<Register> subregs> : SparcReg<n> {
- let Num = num;
- let SubRegs = subregs;
-}
-
-// Integer registers
-def G0 : Ri< 0, "G0">, DwarfRegNum<[0]>;
-def G1 : Ri< 1, "G1">, DwarfRegNum<[1]>;
-def G2 : Ri< 2, "G2">, DwarfRegNum<[2]>;
-def G3 : Ri< 3, "G3">, DwarfRegNum<[3]>;
-def G4 : Ri< 4, "G4">, DwarfRegNum<[4]>;
-def G5 : Ri< 5, "G5">, DwarfRegNum<[5]>;
-def G6 : Ri< 6, "G6">, DwarfRegNum<[6]>;
-def G7 : Ri< 7, "G7">, DwarfRegNum<[7]>;
-def O0 : Ri< 8, "O0">, DwarfRegNum<[8]>;
-def O1 : Ri< 9, "O1">, DwarfRegNum<[9]>;
-def O2 : Ri<10, "O2">, DwarfRegNum<[10]>;
-def O3 : Ri<11, "O3">, DwarfRegNum<[11]>;
-def O4 : Ri<12, "O4">, DwarfRegNum<[12]>;
-def O5 : Ri<13, "O5">, DwarfRegNum<[13]>;
-def O6 : Ri<14, "O6">, DwarfRegNum<[14]>;
-def O7 : Ri<15, "O7">, DwarfRegNum<[15]>;
-def L0 : Ri<16, "L0">, DwarfRegNum<[16]>;
-def L1 : Ri<17, "L1">, DwarfRegNum<[17]>;
-def L2 : Ri<18, "L2">, DwarfRegNum<[18]>;
-def L3 : Ri<19, "L3">, DwarfRegNum<[19]>;
-def L4 : Ri<20, "L4">, DwarfRegNum<[20]>;
-def L5 : Ri<21, "L5">, DwarfRegNum<[21]>;
-def L6 : Ri<22, "L6">, DwarfRegNum<[22]>;
-def L7 : Ri<23, "L7">, DwarfRegNum<[23]>;
-def I0 : Ri<24, "I0">, DwarfRegNum<[24]>;
-def I1 : Ri<25, "I1">, DwarfRegNum<[25]>;
-def I2 : Ri<26, "I2">, DwarfRegNum<[26]>;
-def I3 : Ri<27, "I3">, DwarfRegNum<[27]>;
-def I4 : Ri<28, "I4">, DwarfRegNum<[28]>;
-def I5 : Ri<29, "I5">, DwarfRegNum<[29]>;
-def I6 : Ri<30, "I6">, DwarfRegNum<[30]>;
-def I7 : Ri<31, "I7">, DwarfRegNum<[31]>;
-
-// Floating-point registers
-def F0 : Rf< 0, "F0">, DwarfRegNum<[32]>;
-def F1 : Rf< 1, "F1">, DwarfRegNum<[33]>;
-def F2 : Rf< 2, "F2">, DwarfRegNum<[34]>;
-def F3 : Rf< 3, "F3">, DwarfRegNum<[35]>;
-def F4 : Rf< 4, "F4">, DwarfRegNum<[36]>;
-def F5 : Rf< 5, "F5">, DwarfRegNum<[37]>;
-def F6 : Rf< 6, "F6">, DwarfRegNum<[38]>;
-def F7 : Rf< 7, "F7">, DwarfRegNum<[39]>;
-def F8 : Rf< 8, "F8">, DwarfRegNum<[40]>;
-def F9 : Rf< 9, "F9">, DwarfRegNum<[41]>;
-def F10 : Rf<10, "F10">, DwarfRegNum<[42]>;
-def F11 : Rf<11, "F11">, DwarfRegNum<[43]>;
-def F12 : Rf<12, "F12">, DwarfRegNum<[44]>;
-def F13 : Rf<13, "F13">, DwarfRegNum<[45]>;
-def F14 : Rf<14, "F14">, DwarfRegNum<[46]>;
-def F15 : Rf<15, "F15">, DwarfRegNum<[47]>;
-def F16 : Rf<16, "F16">, DwarfRegNum<[48]>;
-def F17 : Rf<17, "F17">, DwarfRegNum<[49]>;
-def F18 : Rf<18, "F18">, DwarfRegNum<[50]>;
-def F19 : Rf<19, "F19">, DwarfRegNum<[51]>;
-def F20 : Rf<20, "F20">, DwarfRegNum<[52]>;
-def F21 : Rf<21, "F21">, DwarfRegNum<[53]>;
-def F22 : Rf<22, "F22">, DwarfRegNum<[54]>;
-def F23 : Rf<23, "F23">, DwarfRegNum<[55]>;
-def F24 : Rf<24, "F24">, DwarfRegNum<[56]>;
-def F25 : Rf<25, "F25">, DwarfRegNum<[57]>;
-def F26 : Rf<26, "F26">, DwarfRegNum<[58]>;
-def F27 : Rf<27, "F27">, DwarfRegNum<[59]>;
-def F28 : Rf<28, "F28">, DwarfRegNum<[60]>;
-def F29 : Rf<29, "F29">, DwarfRegNum<[61]>;
-def F30 : Rf<30, "F30">, DwarfRegNum<[62]>;
-def F31 : Rf<31, "F31">, DwarfRegNum<[63]>;
-
-// Aliases of the F* registers used to hold 64-bit fp values (doubles)
-def D0 : Rd< 0, "F0", [F0, F1]>, DwarfRegNum<[32]>;
-def D1 : Rd< 2, "F2", [F2, F3]>, DwarfRegNum<[34]>;
-def D2 : Rd< 4, "F4", [F4, F5]>, DwarfRegNum<[36]>;
-def D3 : Rd< 6, "F6", [F6, F7]>, DwarfRegNum<[38]>;
-def D4 : Rd< 8, "F8", [F8, F9]>, DwarfRegNum<[40]>;
-def D5 : Rd<10, "F10", [F10, F11]>, DwarfRegNum<[42]>;
-def D6 : Rd<12, "F12", [F12, F13]>, DwarfRegNum<[44]>;
-def D7 : Rd<14, "F14", [F14, F15]>, DwarfRegNum<[46]>;
-def D8 : Rd<16, "F16", [F16, F17]>, DwarfRegNum<[48]>;
-def D9 : Rd<18, "F18", [F18, F19]>, DwarfRegNum<[50]>;
-def D10 : Rd<20, "F20", [F20, F21]>, DwarfRegNum<[52]>;
-def D11 : Rd<22, "F22", [F22, F23]>, DwarfRegNum<[54]>;
-def D12 : Rd<24, "F24", [F24, F25]>, DwarfRegNum<[56]>;
-def D13 : Rd<26, "F26", [F26, F27]>, DwarfRegNum<[58]>;
-def D14 : Rd<28, "F28", [F28, F29]>, DwarfRegNum<[60]>;
-def D15 : Rd<30, "F30", [F30, F31]>, DwarfRegNum<[62]>;
-
-// Register classes.
-//
-// FIXME: the register order should be defined in terms of the preferred
-// allocation order...
-//
-def IntRegs : RegisterClass<"SP", [i32], 32, [L0, L1, L2, L3, L4, L5, L6, L7,
- I0, I1, I2, I3, I4, I5,
- O0, O1, O2, O3, O4, O5, O7,
-
- // FIXME: G1 reserved for now for large imm generation by frame code.
- G1,
- // Non-allocatable regs:
- G2, G3, G4, // FIXME: OK for use only in
- // applications, not libraries.
- O6, // stack ptr
- I6, // frame ptr
- I7, // return address
- G0, // constant zero
- G5, G6, G7 // reserved for kernel
- ]> {
- let MethodProtos = [{
- iterator allocation_order_end(const MachineFunction &MF) const;
- }];
- let MethodBodies = [{
- IntRegsClass::iterator
- IntRegsClass::allocation_order_end(const MachineFunction &MF) const {
- // FIXME: These special regs should be taken out of the regclass!
- return end()-10 // Don't allocate special registers
- -1; // FIXME: G1 reserved for large imm generation by frame code.
- }
- }];
-}
-
-def FPRegs : RegisterClass<"SP", [f32], 32, [F0, F1, F2, F3, F4, F5, F6, F7, F8,
- F9, F10, F11, F12, F13, F14, F15, F16, F17, F18, F19, F20, F21, F22,
- F23, F24, F25, F26, F27, F28, F29, F30, F31]>;
-
-def DFPRegs : RegisterClass<"SP", [f64], 64, [D0, D1, D2, D3, D4, D5, D6, D7,
- D8, D9, D10, D11, D12, D13, D14, D15]>;
diff --git a/release_23/lib/Target/Sparc/SparcSubtarget.cpp b/release_23/lib/Target/Sparc/SparcSubtarget.cpp
deleted file mode 100644
index aaddbff073ad..000000000000
--- a/release_23/lib/Target/Sparc/SparcSubtarget.cpp
+++ /dev/null
@@ -1,43 +0,0 @@
-//===- SparcSubtarget.cpp - SPARC Subtarget Information -------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the SPARC specific subclass of TargetSubtarget.
-//
-//===----------------------------------------------------------------------===//
-
-#include "SparcSubtarget.h"
-#include "SparcGenSubtarget.inc"
-using namespace llvm;
-
-// FIXME: temporary.
-#include "llvm/Support/CommandLine.h"
-namespace {
- cl::opt<bool> EnableV9("enable-sparc-v9-insts", cl::Hidden,
- cl::desc("Enable V9 instructions in the V8 target"));
-}
-
-SparcSubtarget::SparcSubtarget(const Module &M, const std::string &FS) {
- // Set the default features.
- IsV9 = false;
- V8DeprecatedInsts = false;
- IsVIS = false;
-
- // Determine default and user specified characteristics
- std::string CPU = "generic";
-
- // FIXME: autodetect host here!
- CPU = "v9"; // What is a good way to detect V9?
-
- // Parse features string.
- ParseSubtargetFeatures(FS, CPU);
-
- // Unless explicitly enabled, disable the V9 instructions.
- if (!EnableV9)
- IsV9 = false;
-}
diff --git a/release_23/lib/Target/Sparc/SparcSubtarget.h b/release_23/lib/Target/Sparc/SparcSubtarget.h
deleted file mode 100644
index dcb8c89fd127..000000000000
--- a/release_23/lib/Target/Sparc/SparcSubtarget.h
+++ /dev/null
@@ -1,42 +0,0 @@
-//=====-- SparcSubtarget.h - Define Subtarget for the SPARC ----*- C++ -*-====//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file declares the SPARC specific subclass of TargetSubtarget.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef SPARC_SUBTARGET_H
-#define SPARC_SUBTARGET_H
-
-#include "llvm/Target/TargetSubtarget.h"
-#include <string>
-
-namespace llvm {
- class Module;
-
-class SparcSubtarget : public TargetSubtarget {
- bool IsV9;
- bool V8DeprecatedInsts;
- bool IsVIS;
-public:
- SparcSubtarget(const Module &M, const std::string &FS);
-
- bool isV9() const { return IsV9; }
- bool isVIS() const { return IsVIS; }
- bool useDeprecatedV8Instructions() const { return V8DeprecatedInsts; }
-
- /// ParseSubtargetFeatures - Parses features string setting specified
- /// subtarget options. Definition of function is auto generated by tblgen.
- void ParseSubtargetFeatures(const std::string &FS, const std::string &CPU);
-
-};
-
-} // end namespace llvm
-
-#endif
diff --git a/release_23/lib/Target/Sparc/SparcTargetAsmInfo.cpp b/release_23/lib/Target/Sparc/SparcTargetAsmInfo.cpp
deleted file mode 100644
index a2be52f189b6..000000000000
--- a/release_23/lib/Target/Sparc/SparcTargetAsmInfo.cpp
+++ /dev/null
@@ -1,25 +0,0 @@
-//===-- SparcTargetAsmInfo.cpp - Sparc asm properties -----------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains the declarations of the SparcTargetAsmInfo properties.
-//
-//===----------------------------------------------------------------------===//
-
-#include "SparcTargetAsmInfo.h"
-
-using namespace llvm;
-
-SparcTargetAsmInfo::SparcTargetAsmInfo(const SparcTargetMachine &TM) {
- Data16bitsDirective = "\t.half\t";
- Data32bitsDirective = "\t.word\t";
- Data64bitsDirective = 0; // .xword is only supported by V9.
- ZeroDirective = "\t.skip\t";
- CommentString = "!";
- ConstantPoolSection = "\t.section \".rodata\",#alloc\n";
-}
diff --git a/release_23/lib/Target/Sparc/SparcTargetAsmInfo.h b/release_23/lib/Target/Sparc/SparcTargetAsmInfo.h
deleted file mode 100644
index 854390ce64a0..000000000000
--- a/release_23/lib/Target/Sparc/SparcTargetAsmInfo.h
+++ /dev/null
@@ -1,31 +0,0 @@
-//=====-- SparcTargetAsmInfo.h - Sparc asm properties ---------*- C++ -*--====//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains the declaration of the SparcTargetAsmInfo class.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef SPARCTARGETASMINFO_H
-#define SPARCTARGETASMINFO_H
-
-#include "llvm/Target/TargetAsmInfo.h"
-
-namespace llvm {
-
- // Forward declaration.
- class SparcTargetMachine;
-
- struct SparcTargetAsmInfo : public TargetAsmInfo {
- explicit SparcTargetAsmInfo(const SparcTargetMachine &TM);
- };
-
-
-} // namespace llvm
-
-#endif
diff --git a/release_23/lib/Target/Sparc/SparcTargetMachine.cpp b/release_23/lib/Target/Sparc/SparcTargetMachine.cpp
deleted file mode 100644
index 38f6d6a9014d..000000000000
--- a/release_23/lib/Target/Sparc/SparcTargetMachine.cpp
+++ /dev/null
@@ -1,83 +0,0 @@
-//===-- SparcTargetMachine.cpp - Define TargetMachine for Sparc -----------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-//
-//===----------------------------------------------------------------------===//
-
-#include "SparcTargetAsmInfo.h"
-#include "SparcTargetMachine.h"
-#include "Sparc.h"
-#include "llvm/Module.h"
-#include "llvm/PassManager.h"
-#include "llvm/Target/TargetMachineRegistry.h"
-using namespace llvm;
-
-namespace {
- // Register the target.
- RegisterTarget<SparcTargetMachine> X("sparc", " SPARC");
-}
-
-const TargetAsmInfo *SparcTargetMachine::createTargetAsmInfo() const {
- return new SparcTargetAsmInfo(*this);
-}
-
-/// SparcTargetMachine ctor - Create an ILP32 architecture model
-///
-SparcTargetMachine::SparcTargetMachine(const Module &M, const std::string &FS)
- : DataLayout("E-p:32:32-f128:128:128"),
- Subtarget(M, FS), InstrInfo(Subtarget),
- FrameInfo(TargetFrameInfo::StackGrowsDown, 8, 0) {
-}
-
-unsigned SparcTargetMachine::getModuleMatchQuality(const Module &M) {
- std::string TT = M.getTargetTriple();
- if (TT.size() >= 6 && std::string(TT.begin(), TT.begin()+6) == "sparc-")
- return 20;
-
- // If the target triple is something non-sparc, we don't match.
- if (!TT.empty()) return 0;
-
- if (M.getEndianness() == Module::BigEndian &&
- M.getPointerSize() == Module::Pointer32)
-#ifdef __sparc__
- return 20; // BE/32 ==> Prefer sparc on sparc
-#else
- return 5; // BE/32 ==> Prefer ppc elsewhere
-#endif
- else if (M.getEndianness() != Module::AnyEndianness ||
- M.getPointerSize() != Module::AnyPointerSize)
- return 0; // Match for some other target
-
-#if defined(__sparc__)
- return 10;
-#else
- return 0;
-#endif
-}
-
-bool SparcTargetMachine::addInstSelector(PassManagerBase &PM, bool Fast) {
- PM.add(createSparcISelDag(*this));
- return false;
-}
-
-/// addPreEmitPass - This pass may be implemented by targets that want to run
-/// passes immediately before machine code is emitted. This should return
-/// true if -print-machineinstrs should print out the code after the passes.
-bool SparcTargetMachine::addPreEmitPass(PassManagerBase &PM, bool Fast) {
- PM.add(createSparcFPMoverPass(*this));
- PM.add(createSparcDelaySlotFillerPass(*this));
- return true;
-}
-
-bool SparcTargetMachine::addAssemblyEmitter(PassManagerBase &PM, bool Fast,
- std::ostream &Out) {
- // Output assembly language.
- PM.add(createSparcCodePrinterPass(Out, *this));
- return false;
-}
diff --git a/release_23/lib/Target/Sparc/SparcTargetMachine.h b/release_23/lib/Target/Sparc/SparcTargetMachine.h
deleted file mode 100644
index 6ccb0d6c3b35..000000000000
--- a/release_23/lib/Target/Sparc/SparcTargetMachine.h
+++ /dev/null
@@ -1,57 +0,0 @@
-//===-- SparcTargetMachine.h - Define TargetMachine for Sparc ---*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file declares the Sparc specific subclass of TargetMachine.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef SPARCTARGETMACHINE_H
-#define SPARCTARGETMACHINE_H
-
-#include "llvm/Target/TargetMachine.h"
-#include "llvm/Target/TargetData.h"
-#include "llvm/Target/TargetFrameInfo.h"
-#include "SparcInstrInfo.h"
-#include "SparcSubtarget.h"
-
-namespace llvm {
-
-class Module;
-
-class SparcTargetMachine : public LLVMTargetMachine {
- const TargetData DataLayout; // Calculates type size & alignment
- SparcSubtarget Subtarget;
- SparcInstrInfo InstrInfo;
- TargetFrameInfo FrameInfo;
-
-protected:
- virtual const TargetAsmInfo *createTargetAsmInfo() const;
-
-public:
- SparcTargetMachine(const Module &M, const std::string &FS);
-
- virtual const SparcInstrInfo *getInstrInfo() const { return &InstrInfo; }
- virtual const TargetFrameInfo *getFrameInfo() const { return &FrameInfo; }
- virtual const TargetSubtarget *getSubtargetImpl() const{ return &Subtarget; }
- virtual const TargetRegisterInfo *getRegisterInfo() const {
- return &InstrInfo.getRegisterInfo();
- }
- virtual const TargetData *getTargetData() const { return &DataLayout; }
- static unsigned getModuleMatchQuality(const Module &M);
-
- // Pass Pipeline Configuration
- virtual bool addInstSelector(PassManagerBase &PM, bool Fast);
- virtual bool addPreEmitPass(PassManagerBase &PM, bool Fast);
- virtual bool addAssemblyEmitter(PassManagerBase &PM, bool Fast,
- std::ostream &Out);
-};
-
-} // end namespace llvm
-
-#endif
diff --git a/release_23/lib/Target/SubtargetFeature.cpp b/release_23/lib/Target/SubtargetFeature.cpp
deleted file mode 100644
index 66ffb57e785d..000000000000
--- a/release_23/lib/Target/SubtargetFeature.cpp
+++ /dev/null
@@ -1,357 +0,0 @@
-//===- SubtargetFeature.cpp - CPU characteristics Implementation ----------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the SubtargetFeature interface.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Target/SubtargetFeature.h"
-#include "llvm/ADT/StringExtras.h"
-#include "llvm/Support/Streams.h"
-#include <algorithm>
-#include <ostream>
-#include <cassert>
-#include <cctype>
-using namespace llvm;
-
-//===----------------------------------------------------------------------===//
-// Static Helper Functions
-//===----------------------------------------------------------------------===//
-
-/// hasFlag - Determine if a feature has a flag; '+' or '-'
-///
-static inline bool hasFlag(const std::string &Feature) {
- assert(!Feature.empty() && "Empty string");
- // Get first character
- char Ch = Feature[0];
- // Check if first character is '+' or '-' flag
- return Ch == '+' || Ch =='-';
-}
-
-/// StripFlag - Return string stripped of flag.
-///
-static inline std::string StripFlag(const std::string &Feature) {
- return hasFlag(Feature) ? Feature.substr(1) : Feature;
-}
-
-/// isEnabled - Return true if enable flag; '+'.
-///
-static inline bool isEnabled(const std::string &Feature) {
- assert(!Feature.empty() && "Empty string");
- // Get first character
- char Ch = Feature[0];
- // Check if first character is '+' for enabled
- return Ch == '+';
-}
-
-/// PrependFlag - Return a string with a prepended flag; '+' or '-'.
-///
-static inline std::string PrependFlag(const std::string &Feature,
- bool IsEnabled) {
- assert(!Feature.empty() && "Empty string");
- if (hasFlag(Feature)) return Feature;
- return std::string(IsEnabled ? "+" : "-") + Feature;
-}
-
-/// Split - Splits a string of comma separated items in to a vector of strings.
-///
-static void Split(std::vector<std::string> &V, const std::string &S) {
- // Start at beginning of string.
- size_t Pos = 0;
- while (true) {
- // Find the next comma
- size_t Comma = S.find(',', Pos);
- // If no comma found then the the rest of the string is used
- if (Comma == std::string::npos) {
- // Add string to vector
- V.push_back(S.substr(Pos));
- break;
- }
- // Otherwise add substring to vector
- V.push_back(S.substr(Pos, Comma - Pos));
- // Advance to next item
- Pos = Comma + 1;
- }
-}
-
-/// Join a vector of strings to a string with a comma separating each element.
-///
-static std::string Join(const std::vector<std::string> &V) {
- // Start with empty string.
- std::string Result;
- // If the vector is not empty
- if (!V.empty()) {
- // Start with the CPU feature
- Result = V[0];
- // For each successive feature
- for (size_t i = 1; i < V.size(); i++) {
- // Add a comma
- Result += ",";
- // Add the feature
- Result += V[i];
- }
- }
- // Return the features string
- return Result;
-}
-
-/// Adding features.
-void SubtargetFeatures::AddFeature(const std::string &String,
- bool IsEnabled) {
- // Don't add empty features
- if (!String.empty()) {
- // Convert to lowercase, prepend flag and add to vector
- Features.push_back(PrependFlag(LowercaseString(String), IsEnabled));
- }
-}
-
-/// Find KV in array using binary search.
-template<typename T> const T *Find(const std::string &S, const T *A, size_t L) {
- // Make the lower bound element we're looking for
- T KV;
- KV.Key = S.c_str();
- // Determine the end of the array
- const T *Hi = A + L;
- // Binary search the array
- const T *F = std::lower_bound(A, Hi, KV);
- // If not found then return NULL
- if (F == Hi || std::string(F->Key) != S) return NULL;
- // Return the found array item
- return F;
-}
-
-/// getLongestEntryLength - Return the length of the longest entry in the table.
-///
-static size_t getLongestEntryLength(const SubtargetFeatureKV *Table,
- size_t Size) {
- size_t MaxLen = 0;
- for (size_t i = 0; i < Size; i++)
- MaxLen = std::max(MaxLen, std::strlen(Table[i].Key));
- return MaxLen;
-}
-
-/// Display help for feature choices.
-///
-static void Help(const SubtargetFeatureKV *CPUTable, size_t CPUTableSize,
- const SubtargetFeatureKV *FeatTable, size_t FeatTableSize) {
- // Determine the length of the longest CPU and Feature entries.
- unsigned MaxCPULen = getLongestEntryLength(CPUTable, CPUTableSize);
- unsigned MaxFeatLen = getLongestEntryLength(FeatTable, FeatTableSize);
-
- // Print the CPU table.
- cerr << "Available CPUs for this target:\n\n";
- for (size_t i = 0; i != CPUTableSize; i++)
- cerr << " " << CPUTable[i].Key
- << std::string(MaxCPULen - std::strlen(CPUTable[i].Key), ' ')
- << " - " << CPUTable[i].Desc << ".\n";
- cerr << "\n";
-
- // Print the Feature table.
- cerr << "Available features for this target:\n\n";
- for (size_t i = 0; i != FeatTableSize; i++)
- cerr << " " << FeatTable[i].Key
- << std::string(MaxFeatLen - std::strlen(FeatTable[i].Key), ' ')
- << " - " << FeatTable[i].Desc << ".\n";
- cerr << "\n";
-
- cerr << "Use +feature to enable a feature, or -feature to disable it.\n"
- << "For example, llc -mcpu=mycpu -mattr=+feature1,-feature2\n";
- exit(1);
-}
-
-//===----------------------------------------------------------------------===//
-// SubtargetFeatures Implementation
-//===----------------------------------------------------------------------===//
-
-SubtargetFeatures::SubtargetFeatures(const std::string &Initial) {
- // Break up string into separate features
- Split(Features, Initial);
-}
-
-
-std::string SubtargetFeatures::getString() const {
- return Join(Features);
-}
-void SubtargetFeatures::setString(const std::string &Initial) {
- // Throw out old features
- Features.clear();
- // Break up string into separate features
- Split(Features, LowercaseString(Initial));
-}
-
-
-/// setCPU - Set the CPU string. Replaces previous setting. Setting to ""
-/// clears CPU.
-void SubtargetFeatures::setCPU(const std::string &String) {
- Features[0] = LowercaseString(String);
-}
-
-
-/// setCPUIfNone - Setting CPU string only if no string is set.
-///
-void SubtargetFeatures::setCPUIfNone(const std::string &String) {
- if (Features[0].empty()) setCPU(String);
-}
-
-/// SetImpliedBits - For each feature that is (transitively) implied by this
-/// feature, set it.
-///
-static
-void SetImpliedBits(uint32_t &Bits, const SubtargetFeatureKV *FeatureEntry,
- const SubtargetFeatureKV *FeatureTable,
- size_t FeatureTableSize) {
- for (size_t i = 0; i < FeatureTableSize; ++i) {
- const SubtargetFeatureKV &FE = FeatureTable[i];
-
- if (FeatureEntry->Value == FE.Value) continue;
-
- if (FeatureEntry->Implies & FE.Value) {
- Bits |= FE.Value;
- SetImpliedBits(Bits, &FE, FeatureTable, FeatureTableSize);
- }
- }
-}
-
-/// ClearImpliedBits - For each feature that (transitively) implies this
-/// feature, clear it.
-///
-static
-void ClearImpliedBits(uint32_t &Bits, const SubtargetFeatureKV *FeatureEntry,
- const SubtargetFeatureKV *FeatureTable,
- size_t FeatureTableSize) {
- for (size_t i = 0; i < FeatureTableSize; ++i) {
- const SubtargetFeatureKV &FE = FeatureTable[i];
-
- if (FeatureEntry->Value == FE.Value) continue;
-
- if (FE.Implies & FeatureEntry->Value) {
- Bits &= ~FE.Value;
- ClearImpliedBits(Bits, &FE, FeatureTable, FeatureTableSize);
- }
- }
-}
-
-/// getBits - Get feature bits.
-///
-uint32_t SubtargetFeatures::getBits(const SubtargetFeatureKV *CPUTable,
- size_t CPUTableSize,
- const SubtargetFeatureKV *FeatureTable,
- size_t FeatureTableSize) {
- assert(CPUTable && "missing CPU table");
- assert(FeatureTable && "missing features table");
-#ifndef NDEBUG
- for (size_t i = 1; i < CPUTableSize; i++) {
- assert(strcmp(CPUTable[i - 1].Key, CPUTable[i].Key) < 0 &&
- "CPU table is not sorted");
- }
- for (size_t i = 1; i < FeatureTableSize; i++) {
- assert(strcmp(FeatureTable[i - 1].Key, FeatureTable[i].Key) < 0 &&
- "CPU features table is not sorted");
- }
-#endif
- uint32_t Bits = 0; // Resulting bits
-
- // Check if help is needed
- if (Features[0] == "help")
- Help(CPUTable, CPUTableSize, FeatureTable, FeatureTableSize);
-
- // Find CPU entry
- const SubtargetFeatureKV *CPUEntry =
- Find(Features[0], CPUTable, CPUTableSize);
- // If there is a match
- if (CPUEntry) {
- // Set base feature bits
- Bits = CPUEntry->Value;
-
- // Set the feature implied by this CPU feature, if any.
- for (size_t i = 0; i < FeatureTableSize; ++i) {
- const SubtargetFeatureKV &FE = FeatureTable[i];
- if (CPUEntry->Value & FE.Value)
- SetImpliedBits(Bits, &FE, FeatureTable, FeatureTableSize);
- }
- } else {
- cerr << "'" << Features[0]
- << "' is not a recognized processor for this target"
- << " (ignoring processor)"
- << "\n";
- }
- // Iterate through each feature
- for (size_t i = 1; i < Features.size(); i++) {
- const std::string &Feature = Features[i];
-
- // Check for help
- if (Feature == "+help")
- Help(CPUTable, CPUTableSize, FeatureTable, FeatureTableSize);
-
- // Find feature in table.
- const SubtargetFeatureKV *FeatureEntry =
- Find(StripFlag(Feature), FeatureTable, FeatureTableSize);
- // If there is a match
- if (FeatureEntry) {
- // Enable/disable feature in bits
- if (isEnabled(Feature)) {
- Bits |= FeatureEntry->Value;
-
- // For each feature that this implies, set it.
- SetImpliedBits(Bits, FeatureEntry, FeatureTable, FeatureTableSize);
- } else {
- Bits &= ~FeatureEntry->Value;
-
- // For each feature that implies this, clear it.
- ClearImpliedBits(Bits, FeatureEntry, FeatureTable, FeatureTableSize);
- }
- } else {
- cerr << "'" << Feature
- << "' is not a recognized feature for this target"
- << " (ignoring feature)"
- << "\n";
- }
- }
-
- return Bits;
-}
-
-/// Get info pointer
-void *SubtargetFeatures::getInfo(const SubtargetInfoKV *Table,
- size_t TableSize) {
- assert(Table && "missing table");
-#ifndef NDEBUG
- for (size_t i = 1; i < TableSize; i++) {
- assert(strcmp(Table[i - 1].Key, Table[i].Key) < 0 && "Table is not sorted");
- }
-#endif
-
- // Find entry
- const SubtargetInfoKV *Entry = Find(Features[0], Table, TableSize);
-
- if (Entry) {
- return Entry->Value;
- } else {
- cerr << "'" << Features[0]
- << "' is not a recognized processor for this target"
- << " (ignoring processor)"
- << "\n";
- return NULL;
- }
-}
-
-/// print - Print feature string.
-///
-void SubtargetFeatures::print(std::ostream &OS) const {
- for (size_t i = 0; i < Features.size(); i++) {
- OS << Features[i] << " ";
- }
- OS << "\n";
-}
-
-/// dump - Dump feature info.
-///
-void SubtargetFeatures::dump() const {
- print(*cerr.stream());
-}
diff --git a/release_23/lib/Target/Target.cpp b/release_23/lib/Target/Target.cpp
deleted file mode 100644
index 35cf64896388..000000000000
--- a/release_23/lib/Target/Target.cpp
+++ /dev/null
@@ -1,94 +0,0 @@
-//===-- Target.cpp --------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the C bindings for libLLVMTarget.a, which implements
-// target information.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm-c/Target.h"
-#include "llvm/PassManager.h"
-#include "llvm/Target/TargetData.h"
-#include <cstring>
-
-using namespace llvm;
-
-LLVMTargetDataRef LLVMCreateTargetData(const char *StringRep) {
- return wrap(new TargetData(StringRep));
-}
-
-void LLVMAddTargetData(LLVMTargetDataRef TD, LLVMPassManagerRef PM) {
- unwrap(PM)->add(new TargetData(*unwrap(TD)));
-}
-
-char *LLVMCopyStringRepOfTargetData(LLVMTargetDataRef TD) {
- std::string StringRep = unwrap(TD)->getStringRepresentation();
- return strdup(StringRep.c_str());
-}
-
-LLVMByteOrdering LLVMByteOrder(LLVMTargetDataRef TD) {
- return unwrap(TD)->isLittleEndian();
-}
-
-unsigned LLVMPointerSize(LLVMTargetDataRef TD) {
- return unwrap(TD)->getPointerSize();
-}
-
-LLVMTypeRef LLVMIntPtrType(LLVMTargetDataRef TD) {
- return wrap(unwrap(TD)->getIntPtrType());
-}
-
-unsigned long long LLVMSizeOfTypeInBits(LLVMTargetDataRef TD, LLVMTypeRef Ty) {
- return unwrap(TD)->getTypeSizeInBits(unwrap(Ty));
-}
-
-unsigned long long LLVMStoreSizeOfType(LLVMTargetDataRef TD, LLVMTypeRef Ty) {
- return unwrap(TD)->getTypeStoreSize(unwrap(Ty));
-}
-
-unsigned long long LLVMABISizeOfType(LLVMTargetDataRef TD, LLVMTypeRef Ty) {
- return unwrap(TD)->getABITypeSize(unwrap(Ty));
-}
-
-unsigned LLVMABIAlignmentOfType(LLVMTargetDataRef TD, LLVMTypeRef Ty) {
- return unwrap(TD)->getABITypeAlignment(unwrap(Ty));
-}
-
-unsigned LLVMCallFrameAlignmentOfType(LLVMTargetDataRef TD, LLVMTypeRef Ty) {
- return unwrap(TD)->getCallFrameTypeAlignment(unwrap(Ty));
-}
-
-unsigned LLVMPreferredAlignmentOfType(LLVMTargetDataRef TD, LLVMTypeRef Ty) {
- return unwrap(TD)->getPrefTypeAlignment(unwrap(Ty));
-}
-
-unsigned LLVMPreferredAlignmentOfGlobal(LLVMTargetDataRef TD,
- LLVMValueRef GlobalVar) {
- return unwrap(TD)->getPreferredAlignment(unwrap<GlobalVariable>(GlobalVar));
-}
-
-unsigned LLVMElementAtOffset(LLVMTargetDataRef TD, LLVMTypeRef StructTy,
- unsigned long long Offset) {
- const StructType *STy = unwrap<StructType>(StructTy);
- return unwrap(TD)->getStructLayout(STy)->getElementContainingOffset(Offset);
-}
-
-unsigned long long LLVMOffsetOfElement(LLVMTargetDataRef TD, LLVMTypeRef StructTy,
- unsigned Element) {
- const StructType *STy = unwrap<StructType>(StructTy);
- return unwrap(TD)->getStructLayout(STy)->getElementOffset(Element);
-}
-
-void LLVMInvalidateStructLayout(LLVMTargetDataRef TD, LLVMTypeRef StructTy) {
- unwrap(TD)->InvalidateStructLayoutInfo(unwrap<StructType>(StructTy));
-}
-
-void LLVMDisposeTargetData(LLVMTargetDataRef TD) {
- delete unwrap(TD);
-}
diff --git a/release_23/lib/Target/Target.td b/release_23/lib/Target/Target.td
deleted file mode 100644
index 6e2ba91b95ff..000000000000
--- a/release_23/lib/Target/Target.td
+++ /dev/null
@@ -1,481 +0,0 @@
-//===- Target.td - Target Independent TableGen interface ---*- tablegen -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines the target-independent interfaces which should be
-// implemented by each target which is using a TableGen based code generator.
-//
-//===----------------------------------------------------------------------===//
-
-// Include all information about LLVM intrinsics.
-include "llvm/Intrinsics.td"
-
-//===----------------------------------------------------------------------===//
-// Register file description - These classes are used to fill in the target
-// description classes.
-
-class RegisterClass; // Forward def
-
-// Register - You should define one instance of this class for each register
-// in the target machine. String n will become the "name" of the register.
-class Register<string n> {
- string Namespace = "";
- string AsmName = n;
- string Name = n;
-
- // SpillSize - If this value is set to a non-zero value, it is the size in
- // bits of the spill slot required to hold this register. If this value is
- // set to zero, the information is inferred from any register classes the
- // register belongs to.
- int SpillSize = 0;
-
- // SpillAlignment - This value is used to specify the alignment required for
- // spilling the register. Like SpillSize, this should only be explicitly
- // specified if the register is not in a register class.
- int SpillAlignment = 0;
-
- // Aliases - A list of registers that this register overlaps with. A read or
- // modification of this register can potentially read or modify the aliased
- // registers.
- list<Register> Aliases = [];
-
- // SubRegs - A list of registers that are parts of this register. Note these
- // are "immediate" sub-registers and the registers within the list do not
- // themselves overlap. e.g. For X86, EAX's SubRegs list contains only [AX],
- // not [AX, AH, AL].
- list<Register> SubRegs = [];
-
- // DwarfNumbers - Numbers used internally by gcc/gdb to identify the register.
- // These values can be determined by locating the <target>.h file in the
- // directory llvmgcc/gcc/config/<target>/ and looking for REGISTER_NAMES. The
- // order of these names correspond to the enumeration used by gcc. A value of
- // -1 indicates that the gcc number is undefined and -2 that register number
- // is invalid for this mode/flavour.
- list<int> DwarfNumbers = [];
-}
-
-// RegisterWithSubRegs - This can be used to define instances of Register which
-// need to specify sub-registers.
-// List "subregs" specifies which registers are sub-registers to this one. This
-// is used to populate the SubRegs and AliasSet fields of TargetRegisterDesc.
-// This allows the code generator to be careful not to put two values with
-// overlapping live ranges into registers which alias.
-class RegisterWithSubRegs<string n, list<Register> subregs> : Register<n> {
- let SubRegs = subregs;
-}
-
-// SubRegSet - This can be used to define a specific mapping of registers to
-// indices, for use as named subregs of a particular physical register. Each
-// register in 'subregs' becomes an addressable subregister at index 'n' of the
-// corresponding register in 'regs'.
-class SubRegSet<int n, list<Register> regs, list<Register> subregs> {
- int index = n;
-
- list<Register> From = regs;
- list<Register> To = subregs;
-}
-
-// RegisterClass - Now that all of the registers are defined, and aliases
-// between registers are defined, specify which registers belong to which
-// register classes. This also defines the default allocation order of
-// registers by register allocators.
-//
-class RegisterClass<string namespace, list<ValueType> regTypes, int alignment,
- list<Register> regList> {
- string Namespace = namespace;
-
- // RegType - Specify the list ValueType of the registers in this register
- // class. Note that all registers in a register class must have the same
- // ValueTypes. This is a list because some targets permit storing different
- // types in same register, for example vector values with 128-bit total size,
- // but different count/size of items, like SSE on x86.
- //
- list<ValueType> RegTypes = regTypes;
-
- // Size - Specify the spill size in bits of the registers. A default value of
- // zero lets tablgen pick an appropriate size.
- int Size = 0;
-
- // Alignment - Specify the alignment required of the registers when they are
- // stored or loaded to memory.
- //
- int Alignment = alignment;
-
- // CopyCost - This value is used to specify the cost of copying a value
- // between two registers in this register class. The default value is one
- // meaning it takes a single instruction to perform the copying. A negative
- // value means copying is extremely expensive or impossible.
- int CopyCost = 1;
-
- // MemberList - Specify which registers are in this class. If the
- // allocation_order_* method are not specified, this also defines the order of
- // allocation used by the register allocator.
- //
- list<Register> MemberList = regList;
-
- // SubClassList - Specify which register classes correspond to subregisters
- // of this class. The order should be by subregister set index.
- list<RegisterClass> SubRegClassList = [];
-
- // MethodProtos/MethodBodies - These members can be used to insert arbitrary
- // code into a generated register class. The normal usage of this is to
- // overload virtual methods.
- code MethodProtos = [{}];
- code MethodBodies = [{}];
-}
-
-
-//===----------------------------------------------------------------------===//
-// DwarfRegNum - This class provides a mapping of the llvm register enumeration
-// to the register numbering used by gcc and gdb. These values are used by a
-// debug information writer (ex. DwarfWriter) to describe where values may be
-// located during execution.
-class DwarfRegNum<list<int> Numbers> {
- // DwarfNumbers - Numbers used internally by gcc/gdb to identify the register.
- // These values can be determined by locating the <target>.h file in the
- // directory llvmgcc/gcc/config/<target>/ and looking for REGISTER_NAMES. The
- // order of these names correspond to the enumeration used by gcc. A value of
- // -1 indicates that the gcc number is undefined and -2 that register number is
- // invalid for this mode/flavour.
- list<int> DwarfNumbers = Numbers;
-}
-
-//===----------------------------------------------------------------------===//
-// Pull in the common support for scheduling
-//
-include "TargetSchedule.td"
-
-class Predicate; // Forward def
-
-//===----------------------------------------------------------------------===//
-// Instruction set description - These classes correspond to the C++ classes in
-// the Target/TargetInstrInfo.h file.
-//
-class Instruction {
- string Namespace = "";
-
- dag OutOperandList; // An dag containing the MI def operand list.
- dag InOperandList; // An dag containing the MI use operand list.
- string AsmString = ""; // The .s format to print the instruction with.
-
- // Pattern - Set to the DAG pattern for this instruction, if we know of one,
- // otherwise, uninitialized.
- list<dag> Pattern;
-
- // The follow state will eventually be inferred automatically from the
- // instruction pattern.
-
- list<Register> Uses = []; // Default to using no non-operand registers
- list<Register> Defs = []; // Default to modifying no non-operand registers
-
- // Predicates - List of predicates which will be turned into isel matching
- // code.
- list<Predicate> Predicates = [];
-
- // Code size.
- int CodeSize = 0;
-
- // Added complexity passed onto matching pattern.
- int AddedComplexity = 0;
-
- // These bits capture information about the high-level semantics of the
- // instruction.
- bit isReturn = 0; // Is this instruction a return instruction?
- bit isBranch = 0; // Is this instruction a branch instruction?
- bit isIndirectBranch = 0; // Is this instruction an indirect branch?
- bit isBarrier = 0; // Can control flow fall through this instruction?
- bit isCall = 0; // Is this instruction a call instruction?
- bit isSimpleLoad = 0; // Is this just a load instruction?
- bit mayLoad = 0; // Is it possible for this inst to read memory?
- bit mayStore = 0; // Is it possible for this inst to write memory?
- bit isTwoAddress = 0; // Is this a two address instruction?
- bit isConvertibleToThreeAddress = 0; // Can this 2-addr instruction promote?
- bit isCommutable = 0; // Is this 3 operand instruction commutable?
- bit isTerminator = 0; // Is this part of the terminator for a basic block?
- bit isReMaterializable = 0; // Is this instruction re-materializable?
- bit isPredicable = 0; // Is this instruction predicable?
- bit hasDelaySlot = 0; // Does this instruction have an delay slot?
- bit usesCustomDAGSchedInserter = 0; // Pseudo instr needing special help.
- bit hasCtrlDep = 0; // Does this instruction r/w ctrl-flow chains?
- bit isNotDuplicable = 0; // Is it unsafe to duplicate this instruction?
-
- // Side effect flags - When set, the flags have these meanings:
- //
- // hasSideEffects - The instruction has side effects that are not
- // captured by any operands of the instruction or other flags.
- // mayHaveSideEffects - Some instances of the instruction can have side
- // effects. The virtual method "isReallySideEffectFree" is called to
- // determine this. Load instructions are an example of where this is
- // useful. In general, loads always have side effects. However, loads from
- // constant pools don't. Individual back ends make this determination.
- // neverHasSideEffects - Set on an instruction with no pattern if it has no
- // side effects.
- bit hasSideEffects = 0;
- bit mayHaveSideEffects = 0;
- bit neverHasSideEffects = 0;
-
- InstrItinClass Itinerary = NoItinerary;// Execution steps used for scheduling.
-
- string Constraints = ""; // OperandConstraint, e.g. $src = $dst.
-
- /// DisableEncoding - List of operand names (e.g. "$op1,$op2") that should not
- /// be encoded into the output machineinstr.
- string DisableEncoding = "";
-}
-
-/// Predicates - These are extra conditionals which are turned into instruction
-/// selector matching code. Currently each predicate is just a string.
-class Predicate<string cond> {
- string CondString = cond;
-}
-
-/// NoHonorSignDependentRounding - This predicate is true if support for
-/// sign-dependent-rounding is not enabled.
-def NoHonorSignDependentRounding
- : Predicate<"!HonorSignDependentRoundingFPMath()">;
-
-class Requires<list<Predicate> preds> {
- list<Predicate> Predicates = preds;
-}
-
-/// ops definition - This is just a simple marker used to identify the operands
-/// list for an instruction. outs and ins are identical both syntatically and
-/// semantically, they are used to define def operands and use operands to
-/// improve readibility. This should be used like this:
-/// (outs R32:$dst), (ins R32:$src1, R32:$src2) or something similar.
-def ops;
-def outs;
-def ins;
-
-/// variable_ops definition - Mark this instruction as taking a variable number
-/// of operands.
-def variable_ops;
-
-/// ptr_rc definition - Mark this operand as being a pointer value whose
-/// register class is resolved dynamically via a callback to TargetInstrInfo.
-/// FIXME: We should probably change this to a class which contain a list of
-/// flags. But currently we have but one flag.
-def ptr_rc;
-
-/// unknown definition - Mark this operand as being of unknown type, causing
-/// it to be resolved by inference in the context it is used.
-def unknown;
-
-/// Operand Types - These provide the built-in operand types that may be used
-/// by a target. Targets can optionally provide their own operand types as
-/// needed, though this should not be needed for RISC targets.
-class Operand<ValueType ty> {
- ValueType Type = ty;
- string PrintMethod = "printOperand";
- dag MIOperandInfo = (ops);
-}
-
-def i1imm : Operand<i1>;
-def i8imm : Operand<i8>;
-def i16imm : Operand<i16>;
-def i32imm : Operand<i32>;
-def i64imm : Operand<i64>;
-
-def f32imm : Operand<f32>;
-def f64imm : Operand<f64>;
-
-/// zero_reg definition - Special node to stand for the zero register.
-///
-def zero_reg;
-
-/// PredicateOperand - This can be used to define a predicate operand for an
-/// instruction. OpTypes specifies the MIOperandInfo for the operand, and
-/// AlwaysVal specifies the value of this predicate when set to "always
-/// execute".
-class PredicateOperand<ValueType ty, dag OpTypes, dag AlwaysVal>
- : Operand<ty> {
- let MIOperandInfo = OpTypes;
- dag DefaultOps = AlwaysVal;
-}
-
-/// OptionalDefOperand - This is used to define a optional definition operand
-/// for an instruction. DefaultOps is the register the operand represents if none
-/// is supplied, e.g. zero_reg.
-class OptionalDefOperand<ValueType ty, dag OpTypes, dag defaultops>
- : Operand<ty> {
- let MIOperandInfo = OpTypes;
- dag DefaultOps = defaultops;
-}
-
-
-// InstrInfo - This class should only be instantiated once to provide parameters
-// which are global to the the target machine.
-//
-class InstrInfo {
- // If the target wants to associate some target-specific information with each
- // instruction, it should provide these two lists to indicate how to assemble
- // the target specific information into the 32 bits available.
- //
- list<string> TSFlagsFields = [];
- list<int> TSFlagsShifts = [];
-
- // Target can specify its instructions in either big or little-endian formats.
- // For instance, while both Sparc and PowerPC are big-endian platforms, the
- // Sparc manual specifies its instructions in the format [31..0] (big), while
- // PowerPC specifies them using the format [0..31] (little).
- bit isLittleEndianEncoding = 0;
-}
-
-// Standard Instructions.
-def PHI : Instruction {
- let OutOperandList = (ops);
- let InOperandList = (ops variable_ops);
- let AsmString = "PHINODE";
- let Namespace = "TargetInstrInfo";
-}
-def INLINEASM : Instruction {
- let OutOperandList = (ops);
- let InOperandList = (ops variable_ops);
- let AsmString = "";
- let Namespace = "TargetInstrInfo";
-}
-def LABEL : Instruction {
- let OutOperandList = (ops);
- let InOperandList = (ops i32imm:$id, i32imm:$flavor);
- let AsmString = "";
- let Namespace = "TargetInstrInfo";
- let hasCtrlDep = 1;
-}
-def DECLARE : Instruction {
- let OutOperandList = (ops);
- let InOperandList = (ops variable_ops);
- let AsmString = "";
- let Namespace = "TargetInstrInfo";
- let hasCtrlDep = 1;
-}
-def EXTRACT_SUBREG : Instruction {
- let OutOperandList = (ops unknown:$dst);
- let InOperandList = (ops unknown:$supersrc, i32imm:$subidx);
- let AsmString = "";
- let Namespace = "TargetInstrInfo";
- let neverHasSideEffects = 1;
-}
-def INSERT_SUBREG : Instruction {
- let OutOperandList = (ops unknown:$dst);
- let InOperandList = (ops unknown:$supersrc, unknown:$subsrc, i32imm:$subidx);
- let AsmString = "";
- let Namespace = "TargetInstrInfo";
- let neverHasSideEffects = 1;
- let Constraints = "$supersrc = $dst";
-}
-def IMPLICIT_DEF : Instruction {
- let OutOperandList = (ops unknown:$dst);
- let InOperandList = (ops);
- let AsmString = "";
- let Namespace = "TargetInstrInfo";
- let neverHasSideEffects = 1;
-}
-def SUBREG_TO_REG : Instruction {
- let OutOperandList = (ops unknown:$dst);
- let InOperandList = (ops unknown:$implsrc, unknown:$subsrc, i32imm:$subidx);
- let AsmString = "";
- let Namespace = "TargetInstrInfo";
- let neverHasSideEffects = 1;
-}
-
-//===----------------------------------------------------------------------===//
-// AsmWriter - This class can be implemented by targets that need to customize
-// the format of the .s file writer.
-//
-// Subtargets can have multiple different asmwriters (e.g. AT&T vs Intel syntax
-// on X86 for example).
-//
-class AsmWriter {
- // AsmWriterClassName - This specifies the suffix to use for the asmwriter
- // class. Generated AsmWriter classes are always prefixed with the target
- // name.
- string AsmWriterClassName = "AsmPrinter";
-
- // InstFormatName - AsmWriters can specify the name of the format string to
- // print instructions with.
- string InstFormatName = "AsmString";
-
- // Variant - AsmWriters can be of multiple different variants. Variants are
- // used to support targets that need to emit assembly code in ways that are
- // mostly the same for different targets, but have minor differences in
- // syntax. If the asmstring contains {|} characters in them, this integer
- // will specify which alternative to use. For example "{x|y|z}" with Variant
- // == 1, will expand to "y".
- int Variant = 0;
-}
-def DefaultAsmWriter : AsmWriter;
-
-
-//===----------------------------------------------------------------------===//
-// Target - This class contains the "global" target information
-//
-class Target {
- // InstructionSet - Instruction set description for this target.
- InstrInfo InstructionSet;
-
- // AssemblyWriters - The AsmWriter instances available for this target.
- list<AsmWriter> AssemblyWriters = [DefaultAsmWriter];
-}
-
-//===----------------------------------------------------------------------===//
-// SubtargetFeature - A characteristic of the chip set.
-//
-class SubtargetFeature<string n, string a, string v, string d,
- list<SubtargetFeature> i = []> {
- // Name - Feature name. Used by command line (-mattr=) to determine the
- // appropriate target chip.
- //
- string Name = n;
-
- // Attribute - Attribute to be set by feature.
- //
- string Attribute = a;
-
- // Value - Value the attribute to be set to by feature.
- //
- string Value = v;
-
- // Desc - Feature description. Used by command line (-mattr=) to display help
- // information.
- //
- string Desc = d;
-
- // Implies - Features that this feature implies are present. If one of those
- // features isn't set, then this one shouldn't be set either.
- //
- list<SubtargetFeature> Implies = i;
-}
-
-//===----------------------------------------------------------------------===//
-// Processor chip sets - These values represent each of the chip sets supported
-// by the scheduler. Each Processor definition requires corresponding
-// instruction itineraries.
-//
-class Processor<string n, ProcessorItineraries pi, list<SubtargetFeature> f> {
- // Name - Chip set name. Used by command line (-mcpu=) to determine the
- // appropriate target chip.
- //
- string Name = n;
-
- // ProcItin - The scheduling information for the target processor.
- //
- ProcessorItineraries ProcItin = pi;
-
- // Features - list of
- list<SubtargetFeature> Features = f;
-}
-
-//===----------------------------------------------------------------------===//
-// Pull in the common support for calling conventions.
-//
-include "TargetCallingConv.td"
-
-//===----------------------------------------------------------------------===//
-// Pull in the common support for DAG isel generation.
-//
-include "TargetSelectionDAG.td"
diff --git a/release_23/lib/Target/TargetAsmInfo.cpp b/release_23/lib/Target/TargetAsmInfo.cpp
deleted file mode 100644
index 5fa5abec8e9f..000000000000
--- a/release_23/lib/Target/TargetAsmInfo.cpp
+++ /dev/null
@@ -1,143 +0,0 @@
-//===-- TargetAsmInfo.cpp - Asm Info ---------------------------------------==//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines target asm properties related what form asm statements
-// should take.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Target/TargetAsmInfo.h"
-#include "llvm/Support/Dwarf.h"
-#include <cctype>
-#include <cstring>
-
-using namespace llvm;
-
-TargetAsmInfo::TargetAsmInfo() :
- TextSection("\t.text"),
- DataSection("\t.data"),
- BSSSection("\t.bss"),
- TLSDataSection("\t.section .tdata,\"awT\",@progbits"),
- TLSBSSSection("\t.section .tbss,\"awT\",@nobits"),
- ZeroFillDirective(0),
- NonexecutableStackDirective(0),
- NeedsSet(false),
- MaxInstLength(4),
- PCSymbol("$"),
- SeparatorChar(';'),
- CommentString("#"),
- GlobalPrefix(""),
- PrivateGlobalPrefix("."),
- JumpTableSpecialLabelPrefix(0),
- GlobalVarAddrPrefix(""),
- GlobalVarAddrSuffix(""),
- FunctionAddrPrefix(""),
- FunctionAddrSuffix(""),
- PersonalityPrefix(""),
- PersonalitySuffix(""),
- NeedsIndirectEncoding(false),
- InlineAsmStart("#APP"),
- InlineAsmEnd("#NO_APP"),
- AssemblerDialect(0),
- ZeroDirective("\t.zero\t"),
- ZeroDirectiveSuffix(0),
- AsciiDirective("\t.ascii\t"),
- AscizDirective("\t.asciz\t"),
- Data8bitsDirective("\t.byte\t"),
- Data16bitsDirective("\t.short\t"),
- Data32bitsDirective("\t.long\t"),
- Data64bitsDirective("\t.quad\t"),
- AlignDirective("\t.align\t"),
- AlignmentIsInBytes(true),
- TextAlignFillValue(0),
- SwitchToSectionDirective("\t.section\t"),
- TextSectionStartSuffix(""),
- DataSectionStartSuffix(""),
- SectionEndDirectiveSuffix(0),
- ConstantPoolSection("\t.section .rodata"),
- JumpTableDataSection("\t.section .rodata"),
- JumpTableDirective(0),
- CStringSection(0),
- StaticCtorsSection("\t.section .ctors,\"aw\",@progbits"),
- StaticDtorsSection("\t.section .dtors,\"aw\",@progbits"),
- FourByteConstantSection(0),
- EightByteConstantSection(0),
- SixteenByteConstantSection(0),
- ReadOnlySection(0),
- GlobalDirective("\t.globl\t"),
- SetDirective(0),
- LCOMMDirective(0),
- COMMDirective("\t.comm\t"),
- COMMDirectiveTakesAlignment(true),
- HasDotTypeDotSizeDirective(true),
- UsedDirective(0),
- WeakRefDirective(0),
- WeakDefDirective(0),
- HiddenDirective("\t.hidden\t"),
- ProtectedDirective("\t.protected\t"),
- AbsoluteDebugSectionOffsets(false),
- AbsoluteEHSectionOffsets(false),
- HasLEB128(false),
- HasDotLocAndDotFile(false),
- SupportsDebugInformation(false),
- SupportsExceptionHandling(false),
- DwarfRequiresFrameSection(true),
- GlobalEHDirective(0),
- SupportsWeakOmittedEHFrame(true),
- DwarfSectionOffsetDirective(0),
- DwarfAbbrevSection(".debug_abbrev"),
- DwarfInfoSection(".debug_info"),
- DwarfLineSection(".debug_line"),
- DwarfFrameSection(".debug_frame"),
- DwarfPubNamesSection(".debug_pubnames"),
- DwarfPubTypesSection(".debug_pubtypes"),
- DwarfStrSection(".debug_str"),
- DwarfLocSection(".debug_loc"),
- DwarfARangesSection(".debug_aranges"),
- DwarfRangesSection(".debug_ranges"),
- DwarfMacInfoSection(".debug_macinfo"),
- DwarfEHFrameSection(".eh_frame"),
- DwarfExceptionSection(".gcc_except_table"),
- AsmTransCBE(0) {
-}
-
-TargetAsmInfo::~TargetAsmInfo() {
-}
-
-/// Measure the specified inline asm to determine an approximation of its
-/// length.
-/// Comments (which run till the next SeparatorChar or newline) do not
-/// count as an instruction.
-/// Any other non-whitespace text is considered an instruction, with
-/// multiple instructions separated by SeparatorChar or newlines.
-/// Variable-length instructions are not handled here; this function
-/// may be overloaded in the target code to do that.
-unsigned TargetAsmInfo::getInlineAsmLength(const char *Str) const {
- // Count the number of instructions in the asm.
- bool atInsnStart = true;
- unsigned Length = 0;
- for (; *Str; ++Str) {
- if (*Str == '\n' || *Str == SeparatorChar)
- atInsnStart = true;
- if (atInsnStart && !isspace(*Str)) {
- Length += MaxInstLength;
- atInsnStart = false;
- }
- if (atInsnStart && strncmp(Str, CommentString, strlen(CommentString))==0)
- atInsnStart = false;
- }
-
- return Length;
-}
-
-unsigned TargetAsmInfo::PreferredEHDataFormat(DwarfEncoding::Target Reason,
- bool Global) const {
- return dwarf::DW_EH_PE_absptr;
-}
-
diff --git a/release_23/lib/Target/TargetCallingConv.td b/release_23/lib/Target/TargetCallingConv.td
deleted file mode 100644
index 908e16ed5e78..000000000000
--- a/release_23/lib/Target/TargetCallingConv.td
+++ /dev/null
@@ -1,103 +0,0 @@
-//===- TargetCallingConv.td - Target Calling Conventions ---*- tablegen -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines the target-independent interfaces with which targets
-// describe their calling conventions.
-//
-//===----------------------------------------------------------------------===//
-
-class CCAction;
-class CallingConv;
-
-/// CCPredicateAction - Instances of this class check some predicate, then
-/// delegate to another action if the predicate is true.
-class CCPredicateAction<CCAction A> : CCAction {
- CCAction SubAction = A;
-}
-
-/// CCIfType - If the current argument is one of the specified types, apply
-/// Action A.
-class CCIfType<list<ValueType> vts, CCAction A> : CCPredicateAction<A> {
- list<ValueType> VTs = vts;
-}
-
-/// CCIf - If the predicate matches, apply A.
-class CCIf<string predicate, CCAction A> : CCPredicateAction<A> {
- string Predicate = predicate;
-}
-
-/// CCIfByVal - If the current argument has ByVal parameter attribute, apply
-/// Action A.
-class CCIfByVal<CCAction A> : CCIf<"ArgFlags.isByVal()", A> {
-}
-
-/// CCIfCC - Match of the current calling convention is 'CC'.
-class CCIfCC<string CC, CCAction A>
- : CCIf<!strconcat("State.getCallingConv() == ", CC), A> {}
-
-/// CCIfInReg - If this argument is marked with the 'inreg' attribute, apply
-/// the specified action.
-class CCIfInReg<CCAction A> : CCIf<"ArgFlags.isInReg()", A> {}
-
-/// CCIfNest - If this argument is marked with the 'nest' attribute, apply
-/// the specified action.
-class CCIfNest<CCAction A> : CCIf<"ArgFlags.isNest()", A> {}
-
-/// CCIfNotVarArg - If the current function is not vararg - apply the action
-class CCIfNotVarArg<CCAction A> : CCIf<"!State.isVarArg()", A> {}
-
-/// CCAssignToReg - This action matches if there is a register in the specified
-/// list that is still available. If so, it assigns the value to the first
-/// available register and succeeds.
-class CCAssignToReg<list<Register> regList> : CCAction {
- list<Register> RegList = regList;
-}
-
-/// CCAssignToRegWithShadow - Same as CCAssignToReg, but with list of registers
-/// which became shadowed, when some register is used.
-class CCAssignToRegWithShadow<list<Register> regList,
- list<Register> shadowList> : CCAction {
- list<Register> RegList = regList;
- list<Register> ShadowRegList = shadowList;
-}
-
-/// CCAssignToStack - This action always matches: it assigns the value to a
-/// stack slot of the specified size and alignment on the stack. If size is
-/// zero then the ABI size is used; if align is zero then the ABI alignment
-/// is used - these may depend on the target or subtarget.
-class CCAssignToStack<int size, int align> : CCAction {
- int Size = size;
- int Align = align;
-}
-
-/// CCPassByVal - This action always matches: it assigns the value to a stack
-/// slot to implement ByVal aggregate parameter passing. Size and alignment
-/// specify the minimum size and alignment for the stack slot.
-class CCPassByVal<int size, int align> : CCAction {
- int Size = size;
- int Align = align;
-}
-
-/// CCPromoteToType - If applied, this promotes the specified current value to
-/// the specified type.
-class CCPromoteToType<ValueType destTy> : CCAction {
- ValueType DestTy = destTy;
-}
-
-/// CCDelegateTo - This action invokes the specified sub-calling-convention. It
-/// is successful if the specified CC matches.
-class CCDelegateTo<CallingConv cc> : CCAction {
- CallingConv CC = cc;
-}
-
-/// CallingConv - An instance of this is used to define each calling convention
-/// that the target supports.
-class CallingConv<list<CCAction> actions> {
- list<CCAction> Actions = actions;
-}
diff --git a/release_23/lib/Target/TargetData.cpp b/release_23/lib/Target/TargetData.cpp
deleted file mode 100644
index 215a4f6d3889..000000000000
--- a/release_23/lib/Target/TargetData.cpp
+++ /dev/null
@@ -1,606 +0,0 @@
-//===-- TargetData.cpp - Data size & alignment routines --------------------==//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines target properties related to datatype size/offset/alignment
-// information.
-//
-// This structure should be created once, filled in if the defaults are not
-// correct and then passed around by const&. None of the members functions
-// require modification to the object.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Target/TargetData.h"
-#include "llvm/Module.h"
-#include "llvm/DerivedTypes.h"
-#include "llvm/Constants.h"
-#include "llvm/Support/GetElementPtrTypeIterator.h"
-#include "llvm/Support/MathExtras.h"
-#include "llvm/Support/ManagedStatic.h"
-#include "llvm/ADT/DenseMap.h"
-#include "llvm/ADT/StringExtras.h"
-#include <algorithm>
-#include <cstdlib>
-using namespace llvm;
-
-// Handle the Pass registration stuff necessary to use TargetData's.
-namespace {
- // Register the default SparcV9 implementation...
- RegisterPass<TargetData> X("targetdata", "Target Data Layout", false,
- true);
-}
-char TargetData::ID = 0;
-
-//===----------------------------------------------------------------------===//
-// Support for StructLayout
-//===----------------------------------------------------------------------===//
-
-StructLayout::StructLayout(const StructType *ST, const TargetData &TD) {
- StructAlignment = 0;
- StructSize = 0;
- NumElements = ST->getNumElements();
-
- // Loop over each of the elements, placing them in memory...
- for (unsigned i = 0, e = NumElements; i != e; ++i) {
- const Type *Ty = ST->getElementType(i);
- unsigned TyAlign = ST->isPacked() ?
- 1 : TD.getABITypeAlignment(Ty);
- uint64_t TySize = ST->isPacked() ?
- TD.getTypeStoreSize(Ty) : TD.getABITypeSize(Ty);
-
- // Add padding if necessary to align the data element properly...
- StructSize = (StructSize + TyAlign - 1)/TyAlign * TyAlign;
-
- // Keep track of maximum alignment constraint
- StructAlignment = std::max(TyAlign, StructAlignment);
-
- MemberOffsets[i] = StructSize;
- StructSize += TySize; // Consume space for this data item
- }
-
- // Empty structures have alignment of 1 byte.
- if (StructAlignment == 0) StructAlignment = 1;
-
- // Add padding to the end of the struct so that it could be put in an array
- // and all array elements would be aligned correctly.
- if (StructSize % StructAlignment != 0)
- StructSize = (StructSize/StructAlignment + 1) * StructAlignment;
-}
-
-
-/// getElementContainingOffset - Given a valid offset into the structure,
-/// return the structure index that contains it.
-unsigned StructLayout::getElementContainingOffset(uint64_t Offset) const {
- const uint64_t *SI =
- std::upper_bound(&MemberOffsets[0], &MemberOffsets[NumElements], Offset);
- assert(SI != &MemberOffsets[0] && "Offset not in structure type!");
- --SI;
- assert(*SI <= Offset && "upper_bound didn't work");
- assert((SI == &MemberOffsets[0] || *(SI-1) <= Offset) &&
- (SI+1 == &MemberOffsets[NumElements] || *(SI+1) > Offset) &&
- "Upper bound didn't work!");
-
- // Multiple fields can have the same offset if any of them are zero sized.
- // For example, in { i32, [0 x i32], i32 }, searching for offset 4 will stop
- // at the i32 element, because it is the last element at that offset. This is
- // the right one to return, because anything after it will have a higher
- // offset, implying that this element is non-empty.
- return SI-&MemberOffsets[0];
-}
-
-//===----------------------------------------------------------------------===//
-// TargetAlignElem, TargetAlign support
-//===----------------------------------------------------------------------===//
-
-TargetAlignElem
-TargetAlignElem::get(AlignTypeEnum align_type, unsigned char abi_align,
- unsigned char pref_align, uint32_t bit_width) {
- assert(abi_align <= pref_align && "Preferred alignment worse than ABI!");
- TargetAlignElem retval;
- retval.AlignType = align_type;
- retval.ABIAlign = abi_align;
- retval.PrefAlign = pref_align;
- retval.TypeBitWidth = bit_width;
- return retval;
-}
-
-bool
-TargetAlignElem::operator==(const TargetAlignElem &rhs) const {
- return (AlignType == rhs.AlignType
- && ABIAlign == rhs.ABIAlign
- && PrefAlign == rhs.PrefAlign
- && TypeBitWidth == rhs.TypeBitWidth);
-}
-
-std::ostream &
-TargetAlignElem::dump(std::ostream &os) const {
- return os << AlignType
- << TypeBitWidth
- << ":" << (int) (ABIAlign * 8)
- << ":" << (int) (PrefAlign * 8);
-}
-
-const TargetAlignElem TargetData::InvalidAlignmentElem =
- TargetAlignElem::get((AlignTypeEnum) -1, 0, 0, 0);
-
-//===----------------------------------------------------------------------===//
-// TargetData Class Implementation
-//===----------------------------------------------------------------------===//
-
-/*!
- A TargetDescription string consists of a sequence of hyphen-delimited
- specifiers for target endianness, pointer size and alignments, and various
- primitive type sizes and alignments. A typical string looks something like:
- <br><br>
- "E-p:32:32:32-i1:8:8-i8:8:8-i32:32:32-i64:32:64-f32:32:32-f64:32:64"
- <br><br>
- (note: this string is not fully specified and is only an example.)
- \p
- Alignments come in two flavors: ABI and preferred. ABI alignment (abi_align,
- below) dictates how a type will be aligned within an aggregate and when used
- as an argument. Preferred alignment (pref_align, below) determines a type's
- alignment when emitted as a global.
- \p
- Specifier string details:
- <br><br>
- <i>[E|e]</i>: Endianness. "E" specifies a big-endian target data model, "e"
- specifies a little-endian target data model.
- <br><br>
- <i>p:@verbatim<size>:<abi_align>:<pref_align>@endverbatim</i>: Pointer size,
- ABI and preferred alignment.
- <br><br>
- <i>@verbatim<type><size>:<abi_align>:<pref_align>@endverbatim</i>: Numeric type
- alignment. Type is
- one of <i>i|f|v|a</i>, corresponding to integer, floating point, vector (aka
- packed) or aggregate. Size indicates the size, e.g., 32 or 64 bits.
- \p
- The default string, fully specified is:
- <br><br>
- "E-p:64:64:64-a0:0:0-f32:32:32-f64:0:64"
- "-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:0:64"
- "-v64:64:64-v128:128:128"
- <br><br>
- Note that in the case of aggregates, 0 is the default ABI and preferred
- alignment. This is a special case, where the aggregate's computed worst-case
- alignment will be used.
- */
-void TargetData::init(const std::string &TargetDescription) {
- std::string temp = TargetDescription;
-
- LittleEndian = false;
- PointerMemSize = 8;
- PointerABIAlign = 8;
- PointerPrefAlign = PointerABIAlign;
-
- // Default alignments
- setAlignment(INTEGER_ALIGN, 1, 1, 1); // Bool
- setAlignment(INTEGER_ALIGN, 1, 1, 8); // Byte
- setAlignment(INTEGER_ALIGN, 2, 2, 16); // short
- setAlignment(INTEGER_ALIGN, 4, 4, 32); // int
- setAlignment(INTEGER_ALIGN, 4, 8, 64); // long
- setAlignment(FLOAT_ALIGN, 4, 4, 32); // float
- setAlignment(FLOAT_ALIGN, 8, 8, 64); // double
- setAlignment(VECTOR_ALIGN, 8, 8, 64); // v2i32
- setAlignment(VECTOR_ALIGN, 16, 16, 128); // v16i8, v8i16, v4i32, ...
- setAlignment(AGGREGATE_ALIGN, 0, 8, 0); // struct, union, class, ...
-
- while (!temp.empty()) {
- std::string token = getToken(temp, "-");
- std::string arg0 = getToken(token, ":");
- const char *p = arg0.c_str();
- switch(*p) {
- case 'E':
- LittleEndian = false;
- break;
- case 'e':
- LittleEndian = true;
- break;
- case 'p':
- PointerMemSize = atoi(getToken(token,":").c_str()) / 8;
- PointerABIAlign = atoi(getToken(token,":").c_str()) / 8;
- PointerPrefAlign = atoi(getToken(token,":").c_str()) / 8;
- if (PointerPrefAlign == 0)
- PointerPrefAlign = PointerABIAlign;
- break;
- case 'i':
- case 'v':
- case 'f':
- case 'a':
- case 's': {
- AlignTypeEnum align_type = STACK_ALIGN; // Dummy init, silence warning
- switch(*p) {
- case 'i': align_type = INTEGER_ALIGN; break;
- case 'v': align_type = VECTOR_ALIGN; break;
- case 'f': align_type = FLOAT_ALIGN; break;
- case 'a': align_type = AGGREGATE_ALIGN; break;
- case 's': align_type = STACK_ALIGN; break;
- }
- uint32_t size = (uint32_t) atoi(++p);
- unsigned char abi_align = atoi(getToken(token, ":").c_str()) / 8;
- unsigned char pref_align = atoi(getToken(token, ":").c_str()) / 8;
- if (pref_align == 0)
- pref_align = abi_align;
- setAlignment(align_type, abi_align, pref_align, size);
- break;
- }
- default:
- break;
- }
- }
-}
-
-TargetData::TargetData(const Module *M)
- : ImmutablePass((intptr_t)&ID) {
- init(M->getDataLayout());
-}
-
-void
-TargetData::setAlignment(AlignTypeEnum align_type, unsigned char abi_align,
- unsigned char pref_align, uint32_t bit_width) {
- assert(abi_align <= pref_align && "Preferred alignment worse than ABI!");
- for (unsigned i = 0, e = Alignments.size(); i != e; ++i) {
- if (Alignments[i].AlignType == align_type &&
- Alignments[i].TypeBitWidth == bit_width) {
- // Update the abi, preferred alignments.
- Alignments[i].ABIAlign = abi_align;
- Alignments[i].PrefAlign = pref_align;
- return;
- }
- }
-
- Alignments.push_back(TargetAlignElem::get(align_type, abi_align,
- pref_align, bit_width));
-}
-
-/// getAlignmentInfo - Return the alignment (either ABI if ABIInfo = true or
-/// preferred if ABIInfo = false) the target wants for the specified datatype.
-unsigned TargetData::getAlignmentInfo(AlignTypeEnum AlignType,
- uint32_t BitWidth, bool ABIInfo,
- const Type *Ty) const {
- // Check to see if we have an exact match and remember the best match we see.
- int BestMatchIdx = -1;
- int LargestInt = -1;
- for (unsigned i = 0, e = Alignments.size(); i != e; ++i) {
- if (Alignments[i].AlignType == AlignType &&
- Alignments[i].TypeBitWidth == BitWidth)
- return ABIInfo ? Alignments[i].ABIAlign : Alignments[i].PrefAlign;
-
- // The best match so far depends on what we're looking for.
- if (AlignType == VECTOR_ALIGN && Alignments[i].AlignType == VECTOR_ALIGN) {
- // If this is a specification for a smaller vector type, we will fall back
- // to it. This happens because <128 x double> can be implemented in terms
- // of 64 <2 x double>.
- if (Alignments[i].TypeBitWidth < BitWidth) {
- // Verify that we pick the biggest of the fallbacks.
- if (BestMatchIdx == -1 ||
- Alignments[BestMatchIdx].TypeBitWidth < Alignments[i].TypeBitWidth)
- BestMatchIdx = i;
- }
- } else if (AlignType == INTEGER_ALIGN &&
- Alignments[i].AlignType == INTEGER_ALIGN) {
- // The "best match" for integers is the smallest size that is larger than
- // the BitWidth requested.
- if (Alignments[i].TypeBitWidth > BitWidth && (BestMatchIdx == -1 ||
- Alignments[i].TypeBitWidth < Alignments[BestMatchIdx].TypeBitWidth))
- BestMatchIdx = i;
- // However, if there isn't one that's larger, then we must use the
- // largest one we have (see below)
- if (LargestInt == -1 ||
- Alignments[i].TypeBitWidth > Alignments[LargestInt].TypeBitWidth)
- LargestInt = i;
- }
- }
-
- // Okay, we didn't find an exact solution. Fall back here depending on what
- // is being looked for.
- if (BestMatchIdx == -1) {
- // If we didn't find an integer alignment, fall back on most conservative.
- if (AlignType == INTEGER_ALIGN) {
- BestMatchIdx = LargestInt;
- } else {
- assert(AlignType == VECTOR_ALIGN && "Unknown alignment type!");
-
- // If we didn't find a vector size that is smaller or equal to this type,
- // then we will end up scalarizing this to its element type. Just return
- // the alignment of the element.
- return getAlignment(cast<VectorType>(Ty)->getElementType(), ABIInfo);
- }
- }
-
- // Since we got a "best match" index, just return it.
- return ABIInfo ? Alignments[BestMatchIdx].ABIAlign
- : Alignments[BestMatchIdx].PrefAlign;
-}
-
-/// LayoutInfo - The lazy cache of structure layout information maintained by
-/// TargetData. Note that the struct types must have been free'd before
-/// llvm_shutdown is called (and thus this is deallocated) because all the
-/// targets with cached elements should have been destroyed.
-///
-typedef std::pair<const TargetData*,const StructType*> LayoutKey;
-
-struct DenseMapLayoutKeyInfo {
- static inline LayoutKey getEmptyKey() { return LayoutKey(0, 0); }
- static inline LayoutKey getTombstoneKey() {
- return LayoutKey((TargetData*)(intptr_t)-1, 0);
- }
- static unsigned getHashValue(const LayoutKey &Val) {
- return DenseMapInfo<void*>::getHashValue(Val.first) ^
- DenseMapInfo<void*>::getHashValue(Val.second);
- }
- static bool isEqual(const LayoutKey &LHS, const LayoutKey &RHS) {
- return LHS == RHS;
- }
-
- static bool isPod() { return true; }
-};
-
-typedef DenseMap<LayoutKey, StructLayout*, DenseMapLayoutKeyInfo> LayoutInfoTy;
-static ManagedStatic<LayoutInfoTy> LayoutInfo;
-
-
-TargetData::~TargetData() {
- if (LayoutInfo.isConstructed()) {
- // Remove any layouts for this TD.
- LayoutInfoTy &TheMap = *LayoutInfo;
- for (LayoutInfoTy::iterator I = TheMap.begin(), E = TheMap.end();
- I != E; ) {
- if (I->first.first == this) {
- I->second->~StructLayout();
- free(I->second);
- TheMap.erase(I++);
- } else {
- ++I;
- }
- }
- }
-}
-
-const StructLayout *TargetData::getStructLayout(const StructType *Ty) const {
- LayoutInfoTy &TheMap = *LayoutInfo;
-
- StructLayout *&SL = TheMap[LayoutKey(this, Ty)];
- if (SL) return SL;
-
- // Otherwise, create the struct layout. Because it is variable length, we
- // malloc it, then use placement new.
- int NumElts = Ty->getNumElements();
- StructLayout *L =
- (StructLayout *)malloc(sizeof(StructLayout)+(NumElts-1)*sizeof(uint64_t));
-
- // Set SL before calling StructLayout's ctor. The ctor could cause other
- // entries to be added to TheMap, invalidating our reference.
- SL = L;
-
- new (L) StructLayout(Ty, *this);
- return L;
-}
-
-/// InvalidateStructLayoutInfo - TargetData speculatively caches StructLayout
-/// objects. If a TargetData object is alive when types are being refined and
-/// removed, this method must be called whenever a StructType is removed to
-/// avoid a dangling pointer in this cache.
-void TargetData::InvalidateStructLayoutInfo(const StructType *Ty) const {
- if (!LayoutInfo.isConstructed()) return; // No cache.
-
- LayoutInfoTy::iterator I = LayoutInfo->find(LayoutKey(this, Ty));
- if (I != LayoutInfo->end()) {
- I->second->~StructLayout();
- free(I->second);
- LayoutInfo->erase(I);
- }
-}
-
-
-std::string TargetData::getStringRepresentation() const {
- std::string repr;
- repr.append(LittleEndian ? "e" : "E");
- repr.append("-p:").append(itostr((int64_t) (PointerMemSize * 8))).
- append(":").append(itostr((int64_t) (PointerABIAlign * 8))).
- append(":").append(itostr((int64_t) (PointerPrefAlign * 8)));
- for (align_const_iterator I = Alignments.begin();
- I != Alignments.end();
- ++I) {
- repr.append("-").append(1, (char) I->AlignType).
- append(utostr((int64_t) I->TypeBitWidth)).
- append(":").append(utostr((uint64_t) (I->ABIAlign * 8))).
- append(":").append(utostr((uint64_t) (I->PrefAlign * 8)));
- }
- return repr;
-}
-
-
-uint64_t TargetData::getTypeSizeInBits(const Type *Ty) const {
- assert(Ty->isSized() && "Cannot getTypeInfo() on a type that is unsized!");
- switch (Ty->getTypeID()) {
- case Type::LabelTyID:
- case Type::PointerTyID:
- return getPointerSizeInBits();
- case Type::ArrayTyID: {
- const ArrayType *ATy = cast<ArrayType>(Ty);
- return getABITypeSizeInBits(ATy->getElementType())*ATy->getNumElements();
- }
- case Type::StructTyID: {
- // Get the layout annotation... which is lazily created on demand.
- const StructLayout *Layout = getStructLayout(cast<StructType>(Ty));
- return Layout->getSizeInBits();
- }
- case Type::IntegerTyID:
- return cast<IntegerType>(Ty)->getBitWidth();
- case Type::VoidTyID:
- return 8;
- case Type::FloatTyID:
- return 32;
- case Type::DoubleTyID:
- return 64;
- case Type::PPC_FP128TyID:
- case Type::FP128TyID:
- return 128;
- // In memory objects this is always aligned to a higher boundary, but
- // only 80 bits contain information.
- case Type::X86_FP80TyID:
- return 80;
- case Type::VectorTyID: {
- const VectorType *PTy = cast<VectorType>(Ty);
- return PTy->getBitWidth();
- }
- default:
- assert(0 && "TargetData::getTypeSizeInBits(): Unsupported type");
- break;
- }
- return 0;
-}
-
-/*!
- \param abi_or_pref Flag that determines which alignment is returned. true
- returns the ABI alignment, false returns the preferred alignment.
- \param Ty The underlying type for which alignment is determined.
-
- Get the ABI (\a abi_or_pref == true) or preferred alignment (\a abi_or_pref
- == false) for the requested type \a Ty.
- */
-unsigned char TargetData::getAlignment(const Type *Ty, bool abi_or_pref) const {
- int AlignType = -1;
-
- assert(Ty->isSized() && "Cannot getTypeInfo() on a type that is unsized!");
- switch (Ty->getTypeID()) {
- /* Early escape for the non-numeric types */
- case Type::LabelTyID:
- case Type::PointerTyID:
- return (abi_or_pref
- ? getPointerABIAlignment()
- : getPointerPrefAlignment());
- case Type::ArrayTyID:
- return getAlignment(cast<ArrayType>(Ty)->getElementType(), abi_or_pref);
-
- case Type::StructTyID: {
- // Packed structure types always have an ABI alignment of one.
- if (cast<StructType>(Ty)->isPacked() && abi_or_pref)
- return 1;
-
- // Get the layout annotation... which is lazily created on demand.
- const StructLayout *Layout = getStructLayout(cast<StructType>(Ty));
- unsigned Align = getAlignmentInfo(AGGREGATE_ALIGN, 0, abi_or_pref, Ty);
- return std::max(Align, (unsigned)Layout->getAlignment());
- }
- case Type::IntegerTyID:
- case Type::VoidTyID:
- AlignType = INTEGER_ALIGN;
- break;
- case Type::FloatTyID:
- case Type::DoubleTyID:
- // PPC_FP128TyID and FP128TyID have different data contents, but the
- // same size and alignment, so they look the same here.
- case Type::PPC_FP128TyID:
- case Type::FP128TyID:
- case Type::X86_FP80TyID:
- AlignType = FLOAT_ALIGN;
- break;
- case Type::VectorTyID:
- AlignType = VECTOR_ALIGN;
- break;
- default:
- assert(0 && "Bad type for getAlignment!!!");
- break;
- }
-
- return getAlignmentInfo((AlignTypeEnum)AlignType, getTypeSizeInBits(Ty),
- abi_or_pref, Ty);
-}
-
-unsigned char TargetData::getABITypeAlignment(const Type *Ty) const {
- return getAlignment(Ty, true);
-}
-
-unsigned char TargetData::getCallFrameTypeAlignment(const Type *Ty) const {
- for (unsigned i = 0, e = Alignments.size(); i != e; ++i)
- if (Alignments[i].AlignType == STACK_ALIGN)
- return Alignments[i].ABIAlign;
-
- return getABITypeAlignment(Ty);
-}
-
-unsigned char TargetData::getPrefTypeAlignment(const Type *Ty) const {
- return getAlignment(Ty, false);
-}
-
-unsigned char TargetData::getPreferredTypeAlignmentShift(const Type *Ty) const {
- unsigned Align = (unsigned) getPrefTypeAlignment(Ty);
- assert(!(Align & (Align-1)) && "Alignment is not a power of two!");
- return Log2_32(Align);
-}
-
-/// getIntPtrType - Return an unsigned integer type that is the same size or
-/// greater to the host pointer size.
-const Type *TargetData::getIntPtrType() const {
- return IntegerType::get(getPointerSizeInBits());
-}
-
-
-uint64_t TargetData::getIndexedOffset(const Type *ptrTy, Value* const* Indices,
- unsigned NumIndices) const {
- const Type *Ty = ptrTy;
- assert(isa<PointerType>(Ty) && "Illegal argument for getIndexedOffset()");
- uint64_t Result = 0;
-
- generic_gep_type_iterator<Value* const*>
- TI = gep_type_begin(ptrTy, Indices, Indices+NumIndices);
- for (unsigned CurIDX = 0; CurIDX != NumIndices; ++CurIDX, ++TI) {
- if (const StructType *STy = dyn_cast<StructType>(*TI)) {
- assert(Indices[CurIDX]->getType() == Type::Int32Ty &&
- "Illegal struct idx");
- unsigned FieldNo = cast<ConstantInt>(Indices[CurIDX])->getZExtValue();
-
- // Get structure layout information...
- const StructLayout *Layout = getStructLayout(STy);
-
- // Add in the offset, as calculated by the structure layout info...
- Result += Layout->getElementOffset(FieldNo);
-
- // Update Ty to refer to current element
- Ty = STy->getElementType(FieldNo);
- } else {
- // Update Ty to refer to current element
- Ty = cast<SequentialType>(Ty)->getElementType();
-
- // Get the array index and the size of each array element.
- int64_t arrayIdx = cast<ConstantInt>(Indices[CurIDX])->getSExtValue();
- Result += arrayIdx * (int64_t)getABITypeSize(Ty);
- }
- }
-
- return Result;
-}
-
-/// getPreferredAlignment - Return the preferred alignment of the specified
-/// global. This includes an explicitly requested alignment (if the global
-/// has one).
-unsigned TargetData::getPreferredAlignment(const GlobalVariable *GV) const {
- const Type *ElemType = GV->getType()->getElementType();
- unsigned Alignment = getPrefTypeAlignment(ElemType);
- if (GV->getAlignment() > Alignment)
- Alignment = GV->getAlignment();
-
- if (GV->hasInitializer()) {
- if (Alignment < 16) {
- // If the global is not external, see if it is large. If so, give it a
- // larger alignment.
- if (getTypeSizeInBits(ElemType) > 128)
- Alignment = 16; // 16-byte alignment.
- }
- }
- return Alignment;
-}
-
-/// getPreferredAlignmentLog - Return the preferred alignment of the
-/// specified global, returned in log form. This includes an explicitly
-/// requested alignment (if the global has one).
-unsigned TargetData::getPreferredAlignmentLog(const GlobalVariable *GV) const {
- return Log2_32(getPreferredAlignment(GV));
-}
diff --git a/release_23/lib/Target/TargetFrameInfo.cpp b/release_23/lib/Target/TargetFrameInfo.cpp
deleted file mode 100644
index 873d60a1b5ff..000000000000
--- a/release_23/lib/Target/TargetFrameInfo.cpp
+++ /dev/null
@@ -1,19 +0,0 @@
-//===-- TargetFrameInfo.cpp - Implement machine frame interface -*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// Implements the layout of a stack frame on the target machine.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Target/TargetFrameInfo.h"
-#include <cstdlib>
-using namespace llvm;
-
-TargetFrameInfo::~TargetFrameInfo() {
-}
diff --git a/release_23/lib/Target/TargetInstrInfo.cpp b/release_23/lib/Target/TargetInstrInfo.cpp
deleted file mode 100644
index 10a5cdb6247a..000000000000
--- a/release_23/lib/Target/TargetInstrInfo.cpp
+++ /dev/null
@@ -1,50 +0,0 @@
-//===-- TargetInstrInfo.cpp - Target Instruction Information --------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the TargetInstrInfo class.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Target/TargetInstrInfo.h"
-#include "llvm/Constant.h"
-#include "llvm/DerivedTypes.h"
-using namespace llvm;
-
-/// findTiedToSrcOperand - Returns the operand that is tied to the specified
-/// dest operand. Returns -1 if there isn't one.
-int TargetInstrDesc::findTiedToSrcOperand(unsigned OpNum) const {
- for (unsigned i = 0, e = getNumOperands(); i != e; ++i) {
- if (i == OpNum)
- continue;
- if (getOperandConstraint(i, TOI::TIED_TO) == (int)OpNum)
- return i;
- }
- return -1;
-}
-
-
-TargetInstrInfo::TargetInstrInfo(const TargetInstrDesc* Desc,
- unsigned numOpcodes)
- : Descriptors(Desc), NumOpcodes(numOpcodes) {
-}
-
-TargetInstrInfo::~TargetInstrInfo() {
-}
-
-bool TargetInstrInfo::isUnpredicatedTerminator(const MachineInstr *MI) const {
- const TargetInstrDesc &TID = MI->getDesc();
- if (!TID.isTerminator()) return false;
-
- // Conditional branch is a special case.
- if (TID.isBranch() && !TID.isBarrier())
- return true;
- if (!TID.isPredicable())
- return true;
- return !isPredicated(MI);
-}
diff --git a/release_23/lib/Target/TargetMachOWriterInfo.cpp b/release_23/lib/Target/TargetMachOWriterInfo.cpp
deleted file mode 100644
index d608119817d6..000000000000
--- a/release_23/lib/Target/TargetMachOWriterInfo.cpp
+++ /dev/null
@@ -1,25 +0,0 @@
-//===-- llvm/Target/TargetMachOWriterInfo.h - MachO Writer Info -*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines the TargetMachOWriterInfo class.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Target/TargetMachOWriterInfo.h"
-#include "llvm/CodeGen/MachineRelocation.h"
-using namespace llvm;
-
-TargetMachOWriterInfo::~TargetMachOWriterInfo() {}
-
-MachineRelocation
-TargetMachOWriterInfo::GetJTRelocation(unsigned Offset,
- MachineBasicBlock *MBB) const {
- // FIXME: do something about PIC
- return MachineRelocation::getBB(Offset, MachineRelocation::VANILLA, MBB);
-}
diff --git a/release_23/lib/Target/TargetMachine.cpp b/release_23/lib/Target/TargetMachine.cpp
deleted file mode 100644
index 1065b095bc8c..000000000000
--- a/release_23/lib/Target/TargetMachine.cpp
+++ /dev/null
@@ -1,197 +0,0 @@
-//===-- TargetMachine.cpp - General Target Information ---------------------==//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file describes the general parts of a Target machine.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Target/TargetAsmInfo.h"
-#include "llvm/Target/TargetMachine.h"
-#include "llvm/Target/TargetOptions.h"
-#include "llvm/Support/CommandLine.h"
-using namespace llvm;
-
-//---------------------------------------------------------------------------
-// Command-line options that tend to be useful on more than one back-end.
-//
-
-namespace llvm {
- bool PrintMachineCode;
- bool NoFramePointerElim;
- bool NoExcessFPPrecision;
- bool UnsafeFPMath;
- bool FiniteOnlyFPMathOption;
- bool HonorSignDependentRoundingFPMathOption;
- bool UseSoftFloat;
- bool NoZerosInBSS;
- bool ExceptionHandling;
- bool UnwindTablesMandatory;
- Reloc::Model RelocationModel;
- CodeModel::Model CMModel;
- bool PerformTailCallOpt;
- bool OptimizeForSize;
- bool RealignStack;
- unsigned StackAlignment;
-}
-namespace {
- static cl::opt<bool, true> PrintCode("print-machineinstrs",
- cl::desc("Print generated machine code"),
- cl::location(PrintMachineCode), cl::init(false));
-
- static cl::opt<bool, true>
- DisableFPElim("disable-fp-elim",
- cl::desc("Disable frame pointer elimination optimization"),
- cl::location(NoFramePointerElim),
- cl::init(false));
- static cl::opt<bool, true>
- DisableExcessPrecision("disable-excess-fp-precision",
- cl::desc("Disable optimizations that may increase FP precision"),
- cl::location(NoExcessFPPrecision),
- cl::init(false));
- static cl::opt<bool, true>
- EnableUnsafeFPMath("enable-unsafe-fp-math",
- cl::desc("Enable optimizations that may decrease FP precision"),
- cl::location(UnsafeFPMath),
- cl::init(false));
- static cl::opt<bool, true>
- EnableFiniteOnlyFPMath("enable-finite-only-fp-math",
- cl::desc("Enable optimizations that assumes non- NaNs / +-Infs"),
- cl::location(FiniteOnlyFPMathOption),
- cl::init(false));
- static cl::opt<bool, true>
- EnableHonorSignDependentRoundingFPMath(cl::Hidden,
- "enable-sign-dependent-rounding-fp-math",
- cl::desc("Force codegen to assume rounding mode can change dynamically"),
- cl::location(HonorSignDependentRoundingFPMathOption),
- cl::init(false));
-
- static cl::opt<bool, true>
- GenerateSoftFloatCalls("soft-float",
- cl::desc("Generate software floating point library calls"),
- cl::location(UseSoftFloat),
- cl::init(false));
- static cl::opt<bool, true>
- DontPlaceZerosInBSS("nozero-initialized-in-bss",
- cl::desc("Don't place zero-initialized symbols into bss section"),
- cl::location(NoZerosInBSS),
- cl::init(false));
- static cl::opt<bool, true>
- EnableExceptionHandling("enable-eh",
- cl::desc("Emit DWARF exception handling (default if target supports)"),
- cl::location(ExceptionHandling),
- cl::init(false));
- static cl::opt<bool, true>
- EnableUnwindTables("unwind-tables",
- cl::desc("Generate unwinding tables for all functions"),
- cl::location(UnwindTablesMandatory),
- cl::init(false));
-
- static cl::opt<llvm::Reloc::Model, true>
- DefRelocationModel(
- "relocation-model",
- cl::desc("Choose relocation model"),
- cl::location(RelocationModel),
- cl::init(Reloc::Default),
- cl::values(
- clEnumValN(Reloc::Default, "default",
- " Target default relocation model"),
- clEnumValN(Reloc::Static, "static",
- " Non-relocatable code"),
- clEnumValN(Reloc::PIC_, "pic",
- " Fully relocatable, position independent code"),
- clEnumValN(Reloc::DynamicNoPIC, "dynamic-no-pic",
- " Relocatable external references, non-relocatable code"),
- clEnumValEnd));
- static cl::opt<llvm::CodeModel::Model, true>
- DefCodeModel(
- "code-model",
- cl::desc("Choose code model"),
- cl::location(CMModel),
- cl::init(CodeModel::Default),
- cl::values(
- clEnumValN(CodeModel::Default, "default",
- " Target default code model"),
- clEnumValN(CodeModel::Small, "small",
- " Small code model"),
- clEnumValN(CodeModel::Kernel, "kernel",
- " Kernel code model"),
- clEnumValN(CodeModel::Medium, "medium",
- " Medium code model"),
- clEnumValN(CodeModel::Large, "large",
- " Large code model"),
- clEnumValEnd));
-
- static cl::opt<bool, true>
- EnablePerformTailCallOpt("tailcallopt",
- cl::desc("Turn on tail call optimization."),
- cl::location(PerformTailCallOpt),
- cl::init(false));
- static cl::opt<bool, true>
- EnableOptimizeForSize("optimize-size",
- cl::desc("Optimize for size."),
- cl::location(OptimizeForSize),
- cl::init(false));
-
- static cl::opt<bool, true>
- EnableRealignStack("realign-stack",
- cl::desc("Realign stack if needed"),
- cl::location(RealignStack),
- cl::init(true));
-
- static cl::opt<unsigned, true>
- OverrideStackAlignment("stack-alignment",
- cl::desc("Override default stack alignment"),
- cl::location(StackAlignment),
- cl::init(0));
-}
-
-//---------------------------------------------------------------------------
-// TargetMachine Class
-//
-
-TargetMachine::~TargetMachine() {
- delete AsmInfo;
-}
-
-/// getRelocationModel - Returns the code generation relocation model. The
-/// choices are static, PIC, and dynamic-no-pic, and target default.
-Reloc::Model TargetMachine::getRelocationModel() {
- return RelocationModel;
-}
-
-/// setRelocationModel - Sets the code generation relocation model.
-void TargetMachine::setRelocationModel(Reloc::Model Model) {
- RelocationModel = Model;
-}
-
-/// getCodeModel - Returns the code model. The choices are small, kernel,
-/// medium, large, and target default.
-CodeModel::Model TargetMachine::getCodeModel() {
- return CMModel;
-}
-
-/// setCodeModel - Sets the code model.
-void TargetMachine::setCodeModel(CodeModel::Model Model) {
- CMModel = Model;
-}
-
-namespace llvm {
- /// FiniteOnlyFPMath - This returns true when the -enable-finite-only-fp-math
- /// option is specified on the command line. If this returns false (default),
- /// the code generator is not allowed to assume that FP arithmetic arguments
- /// and results are never NaNs or +-Infs.
- bool FiniteOnlyFPMath() { return UnsafeFPMath || FiniteOnlyFPMathOption; }
-
- /// HonorSignDependentRoundingFPMath - Return true if the codegen must assume
- /// that the rounding mode of the FPU can change from its default.
- bool HonorSignDependentRoundingFPMath() {
- return !UnsafeFPMath && HonorSignDependentRoundingFPMathOption;
- }
-}
-
diff --git a/release_23/lib/Target/TargetMachineRegistry.cpp b/release_23/lib/Target/TargetMachineRegistry.cpp
deleted file mode 100644
index 62c76bbc5bf1..000000000000
--- a/release_23/lib/Target/TargetMachineRegistry.cpp
+++ /dev/null
@@ -1,85 +0,0 @@
-//===-- TargetMachineRegistry.cpp - Target Auto Registration Impl ---------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file exposes the RegisterTarget class, which TargetMachine
-// implementations should use to register themselves with the system. This file
-// also exposes the TargetMachineRegistry class, which allows tools to inspect
-// all of registered targets.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Target/TargetMachineRegistry.h"
-#include <algorithm>
-using namespace llvm;
-
-template<> Registry<TargetMachine>::node *Registry<TargetMachine>::Head = 0;
-template<> Registry<TargetMachine>::node *Registry<TargetMachine>::Tail = 0;
-template<> Registry<TargetMachine>::listener *Registry<TargetMachine>::
-ListenerHead = 0;
-template<> Registry<TargetMachine>::listener *Registry<TargetMachine>::
-ListenerTail = 0;
-
-/// getClosestStaticTargetForModule - Given an LLVM module, pick the best target
-/// that is compatible with the module. If no close target can be found, this
-/// returns null and sets the Error string to a reason.
-const TargetMachineRegistry::entry *
-TargetMachineRegistry::getClosestStaticTargetForModule(const Module &M,
- std::string &Error) {
- std::vector<std::pair<unsigned, const entry *> > UsableTargets;
- for (Registry<TargetMachine>::iterator I = begin(), E = end(); I != E; ++I)
- if (unsigned Qual = I->ModuleMatchQualityFn(M))
- UsableTargets.push_back(std::make_pair(Qual, &*I));
-
- if (UsableTargets.empty()) {
- Error = "No available targets are compatible with this module";
- return 0;
- } else if (UsableTargets.size() == 1)
- return UsableTargets.back().second;
-
- // Otherwise, take the best target, but make sure we don't have to equally
- // good best targets.
- std::sort(UsableTargets.begin(), UsableTargets.end());
- if (UsableTargets.back().first ==UsableTargets[UsableTargets.size()-2].first){
- Error = "Cannot choose between targets \"" +
- std::string(UsableTargets.back().second->Name) + "\" and \"" +
- std::string(UsableTargets[UsableTargets.size()-2].second->Name) + "\"";
- return 0;
- }
- return UsableTargets.back().second;
-}
-
-/// getClosestTargetForJIT - Pick the best target that is compatible with
-/// the current host. If no close target can be found, this returns null
-/// and sets the Error string to a reason.
-const TargetMachineRegistry::entry *
-TargetMachineRegistry::getClosestTargetForJIT(std::string &Error) {
- std::vector<std::pair<unsigned, const entry *> > UsableTargets;
- for (Registry<TargetMachine>::iterator I = begin(), E = end(); I != E; ++I)
- if (unsigned Qual = I->JITMatchQualityFn())
- UsableTargets.push_back(std::make_pair(Qual, &*I));
-
- if (UsableTargets.empty()) {
- Error = "No JIT is available for this host";
- return 0;
- } else if (UsableTargets.size() == 1)
- return UsableTargets.back().second;
-
- // Otherwise, take the best target. If there is a tie, just pick one.
- unsigned MaxQual = UsableTargets.front().first;
- const entry *MaxQualTarget = UsableTargets.front().second;
-
- for (unsigned i = 1, e = UsableTargets.size(); i != e; ++i)
- if (UsableTargets[i].first > MaxQual) {
- MaxQual = UsableTargets[i].first;
- MaxQualTarget = UsableTargets[i].second;
- }
-
- return MaxQualTarget;
-}
-
diff --git a/release_23/lib/Target/TargetRegisterInfo.cpp b/release_23/lib/Target/TargetRegisterInfo.cpp
deleted file mode 100644
index 9c8de12108ce..000000000000
--- a/release_23/lib/Target/TargetRegisterInfo.cpp
+++ /dev/null
@@ -1,114 +0,0 @@
-//===- TargetRegisterInfo.cpp - Target Register Information Implementation ===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the TargetRegisterInfo interface.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Target/TargetMachine.h"
-#include "llvm/Target/TargetRegisterInfo.h"
-#include "llvm/Target/TargetFrameInfo.h"
-#include "llvm/CodeGen/MachineFunction.h"
-#include "llvm/CodeGen/MachineFrameInfo.h"
-#include "llvm/ADT/BitVector.h"
-
-using namespace llvm;
-
-TargetRegisterInfo::TargetRegisterInfo(const TargetRegisterDesc *D, unsigned NR,
- regclass_iterator RCB, regclass_iterator RCE,
- int CFSO, int CFDO)
- : Desc(D), NumRegs(NR), RegClassBegin(RCB), RegClassEnd(RCE) {
- assert(NumRegs < FirstVirtualRegister &&
- "Target has too many physical registers!");
-
- CallFrameSetupOpcode = CFSO;
- CallFrameDestroyOpcode = CFDO;
-}
-
-TargetRegisterInfo::~TargetRegisterInfo() {}
-
-namespace {
- // Sort according to super- / sub- class relations.
- // i.e. super- register class < sub- register class.
- struct RCCompare {
- bool operator()(const TargetRegisterClass* const &LHS,
- const TargetRegisterClass* const &RHS) {
- return RHS->hasSuperClass(LHS);
- }
- };
-}
-
-/// getPhysicalRegisterRegClass - Returns the Register Class of a physical
-/// register of the given type. If type is MVT::Other, then just return any
-/// register class the register belongs to.
-const TargetRegisterClass *
-TargetRegisterInfo::getPhysicalRegisterRegClass(unsigned reg,
- MVT::ValueType VT) const {
- assert(isPhysicalRegister(reg) && "reg must be a physical register");
-
- // Pick the register class of the right type that contains this physreg.
- SmallVector<const TargetRegisterClass*, 4> RCs;
- for (regclass_iterator I = regclass_begin(), E = regclass_end(); I != E; ++I){
- if ((VT == MVT::Other || (*I)->hasType(VT)) && (*I)->contains(reg))
- RCs.push_back(*I);
- }
-
- if (RCs.size() == 1)
- return RCs[0];
-
- if (RCs.size()) {
- // Multiple compatible register classes. Get the super- class.
- std::stable_sort(RCs.begin(), RCs.end(), RCCompare());
- return RCs[0];
- }
-
- assert(false && "Couldn't find the register class");
- return 0;
-}
-
-/// getAllocatableSetForRC - Toggle the bits that represent allocatable
-/// registers for the specific register class.
-static void getAllocatableSetForRC(MachineFunction &MF,
- const TargetRegisterClass *RC, BitVector &R){
- for (TargetRegisterClass::iterator I = RC->allocation_order_begin(MF),
- E = RC->allocation_order_end(MF); I != E; ++I)
- R.set(*I);
-}
-
-BitVector TargetRegisterInfo::getAllocatableSet(MachineFunction &MF,
- const TargetRegisterClass *RC) const {
- BitVector Allocatable(NumRegs);
- if (RC) {
- getAllocatableSetForRC(MF, RC, Allocatable);
- return Allocatable;
- }
-
- for (TargetRegisterInfo::regclass_iterator I = regclass_begin(),
- E = regclass_end(); I != E; ++I)
- getAllocatableSetForRC(MF, *I, Allocatable);
- return Allocatable;
-}
-
-/// getFrameIndexOffset - Returns the displacement from the frame register to
-/// the stack frame of the specified index. This is the default implementation
-/// which is likely incorrect for the target.
-int TargetRegisterInfo::getFrameIndexOffset(MachineFunction &MF, int FI) const {
- const TargetFrameInfo &TFI = *MF.getTarget().getFrameInfo();
- MachineFrameInfo *MFI = MF.getFrameInfo();
- return MFI->getObjectOffset(FI) + MFI->getStackSize() -
- TFI.getOffsetOfLocalArea() + MFI->getOffsetAdjustment();
-}
-
-/// getInitialFrameState - Returns a list of machine moves that are assumed
-/// on entry to a function.
-void
-TargetRegisterInfo::getInitialFrameState(std::vector<MachineMove> &Moves) const {
- // Default is to do nothing.
-}
-
diff --git a/release_23/lib/Target/TargetSchedule.td b/release_23/lib/Target/TargetSchedule.td
deleted file mode 100644
index 38461c5a380e..000000000000
--- a/release_23/lib/Target/TargetSchedule.td
+++ /dev/null
@@ -1,72 +0,0 @@
-//===- TargetSchedule.td - Target Independent Scheduling ---*- tablegen -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines the target-independent scheduling interfaces which should
-// be implemented by each target which is using TableGen based scheduling.
-//
-//===----------------------------------------------------------------------===//
-
-//===----------------------------------------------------------------------===//
-// Processor functional unit - These values represent the function units
-// available across all chip sets for the target. Eg., IntUnit, FPUnit, ...
-// These may be independent values for each chip set or may be shared across
-// all chip sets of the target. Each functional unit is treated as a resource
-// during scheduling and has an affect instruction order based on availability
-// during a time interval.
-//
-class FuncUnit;
-
-//===----------------------------------------------------------------------===//
-// Instruction stage - These values represent a step in the execution of an
-// instruction. The latency represents the number of discrete time slots used
-// need to complete the stage. Units represent the choice of functional units
-// that can be used to complete the stage. Eg. IntUnit1, IntUnit2.
-//
-class InstrStage<int cycles, list<FuncUnit> units> {
- int Cycles = cycles; // length of stage in machine cycles
- list<FuncUnit> Units = units; // choice of functional units
-}
-
-//===----------------------------------------------------------------------===//
-// Instruction itinerary - An itinerary represents a sequential series of steps
-// required to complete an instruction. Itineraries are represented as lists of
-// instruction stages.
-//
-
-//===----------------------------------------------------------------------===//
-// Instruction itinerary classes - These values represent 'named' instruction
-// itinerary. Using named itineraries simplifies managing groups of
-// instructions across chip sets. An instruction uses the same itinerary class
-// across all chip sets. Thus a new chip set can be added without modifying
-// instruction information.
-//
-class InstrItinClass;
-def NoItinerary : InstrItinClass;
-
-//===----------------------------------------------------------------------===//
-// Instruction itinerary data - These values provide a runtime map of an
-// instruction itinerary class (name) to it's itinerary data.
-//
-class InstrItinData<InstrItinClass Class, list<InstrStage> stages> {
- InstrItinClass TheClass = Class;
- list<InstrStage> Stages = stages;
-}
-
-//===----------------------------------------------------------------------===//
-// Processor itineraries - These values represent the set of all itinerary
-// classes for a given chip set.
-//
-class ProcessorItineraries<list<InstrItinData> iid> {
- list<InstrItinData> IID = iid;
-}
-
-// NoItineraries - A marker that can be used by processors without schedule
-// info.
-def NoItineraries : ProcessorItineraries<[]>;
-
diff --git a/release_23/lib/Target/TargetSelectionDAG.td b/release_23/lib/Target/TargetSelectionDAG.td
deleted file mode 100644
index 209cda0cebb5..000000000000
--- a/release_23/lib/Target/TargetSelectionDAG.td
+++ /dev/null
@@ -1,936 +0,0 @@
-//===- TargetSelectionDAG.td - Common code for DAG isels ---*- tablegen -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines the target-independent interfaces used by SelectionDAG
-// instruction selection generators.
-//
-//===----------------------------------------------------------------------===//
-
-//===----------------------------------------------------------------------===//
-// Selection DAG Type Constraint definitions.
-//
-// Note that the semantics of these constraints are hard coded into tblgen. To
-// modify or add constraints, you have to hack tblgen.
-//
-
-class SDTypeConstraint<int opnum> {
- int OperandNum = opnum;
-}
-
-// SDTCisVT - The specified operand has exactly this VT.
-class SDTCisVT<int OpNum, ValueType vt> : SDTypeConstraint<OpNum> {
- ValueType VT = vt;
-}
-
-class SDTCisPtrTy<int OpNum> : SDTypeConstraint<OpNum>;
-
-// SDTCisInt - The specified operand is has integer type.
-class SDTCisInt<int OpNum> : SDTypeConstraint<OpNum>;
-
-// SDTCisFP - The specified operand is has floating point type.
-class SDTCisFP<int OpNum> : SDTypeConstraint<OpNum>;
-
-// SDTCisSameAs - The two specified operands have identical types.
-class SDTCisSameAs<int OpNum, int OtherOp> : SDTypeConstraint<OpNum> {
- int OtherOperandNum = OtherOp;
-}
-
-// SDTCisVTSmallerThanOp - The specified operand is a VT SDNode, and its type is
-// smaller than the 'Other' operand.
-class SDTCisVTSmallerThanOp<int OpNum, int OtherOp> : SDTypeConstraint<OpNum> {
- int OtherOperandNum = OtherOp;
-}
-
-class SDTCisOpSmallerThanOp<int SmallOp, int BigOp> : SDTypeConstraint<SmallOp>{
- int BigOperandNum = BigOp;
-}
-
-/// SDTCisIntVectorOfSameSize - This indicates that ThisOp and OtherOp are
-/// vector types, and that ThisOp is the result of
-/// MVT::getIntVectorWithNumElements with the number of elements that ThisOp
-/// has.
-class SDTCisIntVectorOfSameSize<int ThisOp, int OtherOp>
- : SDTypeConstraint<ThisOp> {
- int OtherOpNum = OtherOp;
-}
-
-/// SDTCisEltOfVec - This indicates that ThisOp is a scalar type of the same
-/// type as the element type of OtherOp, which is a vector type.
-class SDTCisEltOfVec<int ThisOp, int OtherOp>
- : SDTypeConstraint<ThisOp> {
- int OtherOpNum = OtherOp;
-}
-
-//===----------------------------------------------------------------------===//
-// Selection DAG Type Profile definitions.
-//
-// These use the constraints defined above to describe the type requirements of
-// the various nodes. These are not hard coded into tblgen, allowing targets to
-// add their own if needed.
-//
-
-// SDTypeProfile - This profile describes the type requirements of a Selection
-// DAG node.
-class SDTypeProfile<int numresults, int numoperands,
- list<SDTypeConstraint> constraints> {
- int NumResults = numresults;
- int NumOperands = numoperands;
- list<SDTypeConstraint> Constraints = constraints;
-}
-
-// Builtin profiles.
-def SDTIntLeaf: SDTypeProfile<1, 0, [SDTCisInt<0>]>; // for 'imm'.
-def SDTFPLeaf : SDTypeProfile<1, 0, [SDTCisFP<0>]>; // for 'fpimm'.
-def SDTPtrLeaf: SDTypeProfile<1, 0, [SDTCisPtrTy<0>]>; // for '&g'.
-def SDTOther : SDTypeProfile<1, 0, [SDTCisVT<0, OtherVT>]>; // for 'vt'.
-def SDTUNDEF : SDTypeProfile<1, 0, []>; // for 'undef'.
-def SDTUnaryOp : SDTypeProfile<1, 1, []>; // bitconvert
-
-def SDTIntBinOp : SDTypeProfile<1, 2, [ // add, and, or, xor, udiv, etc.
- SDTCisSameAs<0, 1>, SDTCisSameAs<0, 2>, SDTCisInt<0>
-]>;
-def SDTIntShiftOp : SDTypeProfile<1, 2, [ // shl, sra, srl
- SDTCisSameAs<0, 1>, SDTCisInt<0>, SDTCisInt<2>
-]>;
-def SDTFPBinOp : SDTypeProfile<1, 2, [ // fadd, fmul, etc.
- SDTCisSameAs<0, 1>, SDTCisSameAs<0, 2>, SDTCisFP<0>
-]>;
-def SDTFPSignOp : SDTypeProfile<1, 2, [ // fcopysign.
- SDTCisSameAs<0, 1>, SDTCisFP<0>, SDTCisFP<2>
-]>;
-def SDTFPTernaryOp : SDTypeProfile<1, 3, [ // fmadd, fnmsub, etc.
- SDTCisSameAs<0, 1>, SDTCisSameAs<0, 2>, SDTCisSameAs<0, 3>, SDTCisFP<0>
-]>;
-def SDTIntUnaryOp : SDTypeProfile<1, 1, [ // ctlz
- SDTCisSameAs<0, 1>, SDTCisInt<0>
-]>;
-def SDTIntExtendOp : SDTypeProfile<1, 1, [ // sext, zext, anyext
- SDTCisInt<0>, SDTCisInt<1>, SDTCisOpSmallerThanOp<1, 0>
-]>;
-def SDTIntTruncOp : SDTypeProfile<1, 1, [ // trunc
- SDTCisInt<0>, SDTCisInt<1>, SDTCisOpSmallerThanOp<0, 1>
-]>;
-def SDTFPUnaryOp : SDTypeProfile<1, 1, [ // fneg, fsqrt, etc
- SDTCisSameAs<0, 1>, SDTCisFP<0>
-]>;
-def SDTFPRoundOp : SDTypeProfile<1, 1, [ // fround
- SDTCisFP<0>, SDTCisFP<1>, SDTCisOpSmallerThanOp<0, 1>
-]>;
-def SDTFPExtendOp : SDTypeProfile<1, 1, [ // fextend
- SDTCisFP<0>, SDTCisFP<1>, SDTCisOpSmallerThanOp<1, 0>
-]>;
-def SDTIntToFPOp : SDTypeProfile<1, 1, [ // [su]int_to_fp
- SDTCisFP<0>, SDTCisInt<1>
-]>;
-def SDTFPToIntOp : SDTypeProfile<1, 1, [ // fp_to_[su]int
- SDTCisInt<0>, SDTCisFP<1>
-]>;
-def SDTExtInreg : SDTypeProfile<1, 2, [ // sext_inreg
- SDTCisSameAs<0, 1>, SDTCisInt<0>, SDTCisVT<2, OtherVT>,
- SDTCisVTSmallerThanOp<2, 1>
-]>;
-
-def SDTSetCC : SDTypeProfile<1, 3, [ // setcc
- SDTCisInt<0>, SDTCisSameAs<1, 2>, SDTCisVT<3, OtherVT>
-]>;
-
-def SDTSelect : SDTypeProfile<1, 3, [ // select
- SDTCisInt<1>, SDTCisSameAs<0, 2>, SDTCisSameAs<2, 3>
-]>;
-
-def SDTSelectCC : SDTypeProfile<1, 5, [ // select_cc
- SDTCisSameAs<1, 2>, SDTCisSameAs<3, 4>, SDTCisSameAs<0, 3>,
- SDTCisVT<5, OtherVT>
-]>;
-
-def SDTBr : SDTypeProfile<0, 1, [ // br
- SDTCisVT<0, OtherVT>
-]>;
-
-def SDTBrcond : SDTypeProfile<0, 2, [ // brcond
- SDTCisInt<0>, SDTCisVT<1, OtherVT>
-]>;
-
-def SDTBrind : SDTypeProfile<0, 1, [ // brind
- SDTCisPtrTy<0>
-]>;
-
-def SDTNone : SDTypeProfile<0, 0, []>; // ret, trap
-
-def SDTLoad : SDTypeProfile<1, 1, [ // load
- SDTCisPtrTy<1>
-]>;
-
-def SDTStore : SDTypeProfile<0, 2, [ // store
- SDTCisPtrTy<1>
-]>;
-
-def SDTIStore : SDTypeProfile<1, 3, [ // indexed store
- SDTCisSameAs<0, 2>, SDTCisPtrTy<0>, SDTCisPtrTy<3>
-]>;
-
-def SDTVecShuffle : SDTypeProfile<1, 3, [
- SDTCisSameAs<0, 1>, SDTCisSameAs<1, 2>, SDTCisIntVectorOfSameSize<3, 0>
-]>;
-def SDTVecExtract : SDTypeProfile<1, 2, [ // vector extract
- SDTCisEltOfVec<0, 1>, SDTCisPtrTy<2>
-]>;
-def SDTVecInsert : SDTypeProfile<1, 3, [ // vector insert
- SDTCisEltOfVec<2, 1>, SDTCisSameAs<0, 1>, SDTCisPtrTy<3>
-]>;
-
-def STDPrefetch : SDTypeProfile<0, 3, [ // prefetch
- SDTCisPtrTy<0>, SDTCisSameAs<1, 2>, SDTCisInt<1>
-]>;
-
-def STDMemBarrier : SDTypeProfile<0, 5, [ // memory barier
- SDTCisSameAs<0,1>, SDTCisSameAs<0,2>, SDTCisSameAs<0,3>, SDTCisSameAs<0,4>,
- SDTCisInt<0>
-]>;
-def STDAtomic3 : SDTypeProfile<1, 3, [
- SDTCisSameAs<0,2>, SDTCisSameAs<0,3>, SDTCisInt<0>, SDTCisPtrTy<1>
-]>;
-def STDAtomic2 : SDTypeProfile<1, 2, [
- SDTCisSameAs<0,2>, SDTCisInt<0>, SDTCisPtrTy<1>
-]>;
-
-class SDCallSeqStart<list<SDTypeConstraint> constraints> :
- SDTypeProfile<0, 1, constraints>;
-class SDCallSeqEnd<list<SDTypeConstraint> constraints> :
- SDTypeProfile<0, 2, constraints>;
-
-//===----------------------------------------------------------------------===//
-// Selection DAG Node Properties.
-//
-// Note: These are hard coded into tblgen.
-//
-class SDNodeProperty;
-def SDNPCommutative : SDNodeProperty; // X op Y == Y op X
-def SDNPAssociative : SDNodeProperty; // (X op Y) op Z == X op (Y op Z)
-def SDNPHasChain : SDNodeProperty; // R/W chain operand and result
-def SDNPOutFlag : SDNodeProperty; // Write a flag result
-def SDNPInFlag : SDNodeProperty; // Read a flag operand
-def SDNPOptInFlag : SDNodeProperty; // Optionally read a flag operand
-def SDNPMayStore : SDNodeProperty; // May write to memory, sets 'mayStore'.
-def SDNPMayLoad : SDNodeProperty; // May read memory, sets 'mayLoad'.
-def SDNPSideEffect : SDNodeProperty; // Sets 'HasUnmodelledSideEffects'.
-
-//===----------------------------------------------------------------------===//
-// Selection DAG Node definitions.
-//
-class SDNode<string opcode, SDTypeProfile typeprof,
- list<SDNodeProperty> props = [], string sdclass = "SDNode"> {
- string Opcode = opcode;
- string SDClass = sdclass;
- list<SDNodeProperty> Properties = props;
- SDTypeProfile TypeProfile = typeprof;
-}
-
-def set;
-def implicit;
-def parallel;
-def node;
-def srcvalue;
-
-def imm : SDNode<"ISD::Constant" , SDTIntLeaf , [], "ConstantSDNode">;
-def fpimm : SDNode<"ISD::ConstantFP", SDTFPLeaf , [], "ConstantFPSDNode">;
-def vt : SDNode<"ISD::VALUETYPE" , SDTOther , [], "VTSDNode">;
-def bb : SDNode<"ISD::BasicBlock", SDTOther , [], "BasicBlockSDNode">;
-def cond : SDNode<"ISD::CONDCODE" , SDTOther , [], "CondCodeSDNode">;
-def undef : SDNode<"ISD::UNDEF" , SDTUNDEF , []>;
-def globaladdr : SDNode<"ISD::GlobalAddress", SDTPtrLeaf, [],
- "GlobalAddressSDNode">;
-def tglobaladdr : SDNode<"ISD::TargetGlobalAddress", SDTPtrLeaf, [],
- "GlobalAddressSDNode">;
-def globaltlsaddr : SDNode<"ISD::GlobalTLSAddress", SDTPtrLeaf, [],
- "GlobalAddressSDNode">;
-def tglobaltlsaddr : SDNode<"ISD::TargetGlobalTLSAddress", SDTPtrLeaf, [],
- "GlobalAddressSDNode">;
-def constpool : SDNode<"ISD::ConstantPool", SDTPtrLeaf, [],
- "ConstantPoolSDNode">;
-def tconstpool : SDNode<"ISD::TargetConstantPool", SDTPtrLeaf, [],
- "ConstantPoolSDNode">;
-def jumptable : SDNode<"ISD::JumpTable", SDTPtrLeaf, [],
- "JumpTableSDNode">;
-def tjumptable : SDNode<"ISD::TargetJumpTable", SDTPtrLeaf, [],
- "JumpTableSDNode">;
-def frameindex : SDNode<"ISD::FrameIndex", SDTPtrLeaf, [],
- "FrameIndexSDNode">;
-def tframeindex : SDNode<"ISD::TargetFrameIndex", SDTPtrLeaf, [],
- "FrameIndexSDNode">;
-def externalsym : SDNode<"ISD::ExternalSymbol", SDTPtrLeaf, [],
- "ExternalSymbolSDNode">;
-def texternalsym: SDNode<"ISD::TargetExternalSymbol", SDTPtrLeaf, [],
- "ExternalSymbolSDNode">;
-
-def add : SDNode<"ISD::ADD" , SDTIntBinOp ,
- [SDNPCommutative, SDNPAssociative]>;
-def sub : SDNode<"ISD::SUB" , SDTIntBinOp>;
-def mul : SDNode<"ISD::MUL" , SDTIntBinOp,
- [SDNPCommutative, SDNPAssociative]>;
-def mulhs : SDNode<"ISD::MULHS" , SDTIntBinOp, [SDNPCommutative]>;
-def mulhu : SDNode<"ISD::MULHU" , SDTIntBinOp, [SDNPCommutative]>;
-def sdiv : SDNode<"ISD::SDIV" , SDTIntBinOp>;
-def udiv : SDNode<"ISD::UDIV" , SDTIntBinOp>;
-def srem : SDNode<"ISD::SREM" , SDTIntBinOp>;
-def urem : SDNode<"ISD::UREM" , SDTIntBinOp>;
-def srl : SDNode<"ISD::SRL" , SDTIntShiftOp>;
-def sra : SDNode<"ISD::SRA" , SDTIntShiftOp>;
-def shl : SDNode<"ISD::SHL" , SDTIntShiftOp>;
-def rotl : SDNode<"ISD::ROTL" , SDTIntShiftOp>;
-def rotr : SDNode<"ISD::ROTR" , SDTIntShiftOp>;
-def and : SDNode<"ISD::AND" , SDTIntBinOp,
- [SDNPCommutative, SDNPAssociative]>;
-def or : SDNode<"ISD::OR" , SDTIntBinOp,
- [SDNPCommutative, SDNPAssociative]>;
-def xor : SDNode<"ISD::XOR" , SDTIntBinOp,
- [SDNPCommutative, SDNPAssociative]>;
-def addc : SDNode<"ISD::ADDC" , SDTIntBinOp,
- [SDNPCommutative, SDNPOutFlag]>;
-def adde : SDNode<"ISD::ADDE" , SDTIntBinOp,
- [SDNPCommutative, SDNPOutFlag, SDNPInFlag]>;
-def subc : SDNode<"ISD::SUBC" , SDTIntBinOp,
- [SDNPOutFlag]>;
-def sube : SDNode<"ISD::SUBE" , SDTIntBinOp,
- [SDNPOutFlag, SDNPInFlag]>;
-
-def sext_inreg : SDNode<"ISD::SIGN_EXTEND_INREG", SDTExtInreg>;
-def bswap : SDNode<"ISD::BSWAP" , SDTIntUnaryOp>;
-def ctlz : SDNode<"ISD::CTLZ" , SDTIntUnaryOp>;
-def cttz : SDNode<"ISD::CTTZ" , SDTIntUnaryOp>;
-def ctpop : SDNode<"ISD::CTPOP" , SDTIntUnaryOp>;
-def sext : SDNode<"ISD::SIGN_EXTEND", SDTIntExtendOp>;
-def zext : SDNode<"ISD::ZERO_EXTEND", SDTIntExtendOp>;
-def anyext : SDNode<"ISD::ANY_EXTEND" , SDTIntExtendOp>;
-def trunc : SDNode<"ISD::TRUNCATE" , SDTIntTruncOp>;
-def bitconvert : SDNode<"ISD::BIT_CONVERT", SDTUnaryOp>;
-def extractelt : SDNode<"ISD::EXTRACT_VECTOR_ELT", SDTVecExtract>;
-def insertelt : SDNode<"ISD::INSERT_VECTOR_ELT", SDTVecInsert>;
-
-
-def fadd : SDNode<"ISD::FADD" , SDTFPBinOp, [SDNPCommutative]>;
-def fsub : SDNode<"ISD::FSUB" , SDTFPBinOp>;
-def fmul : SDNode<"ISD::FMUL" , SDTFPBinOp, [SDNPCommutative]>;
-def fdiv : SDNode<"ISD::FDIV" , SDTFPBinOp>;
-def frem : SDNode<"ISD::FREM" , SDTFPBinOp>;
-def fabs : SDNode<"ISD::FABS" , SDTFPUnaryOp>;
-def fneg : SDNode<"ISD::FNEG" , SDTFPUnaryOp>;
-def fsqrt : SDNode<"ISD::FSQRT" , SDTFPUnaryOp>;
-def fsin : SDNode<"ISD::FSIN" , SDTFPUnaryOp>;
-def fcos : SDNode<"ISD::FCOS" , SDTFPUnaryOp>;
-
-def fround : SDNode<"ISD::FP_ROUND" , SDTFPRoundOp>;
-def fextend : SDNode<"ISD::FP_EXTEND" , SDTFPExtendOp>;
-def fcopysign : SDNode<"ISD::FCOPYSIGN" , SDTFPSignOp>;
-
-def sint_to_fp : SDNode<"ISD::SINT_TO_FP" , SDTIntToFPOp>;
-def uint_to_fp : SDNode<"ISD::UINT_TO_FP" , SDTIntToFPOp>;
-def fp_to_sint : SDNode<"ISD::FP_TO_SINT" , SDTFPToIntOp>;
-def fp_to_uint : SDNode<"ISD::FP_TO_UINT" , SDTFPToIntOp>;
-
-def setcc : SDNode<"ISD::SETCC" , SDTSetCC>;
-def select : SDNode<"ISD::SELECT" , SDTSelect>;
-def selectcc : SDNode<"ISD::SELECT_CC" , SDTSelectCC>;
-
-def brcond : SDNode<"ISD::BRCOND" , SDTBrcond, [SDNPHasChain]>;
-def brind : SDNode<"ISD::BRIND" , SDTBrind, [SDNPHasChain]>;
-def br : SDNode<"ISD::BR" , SDTBr, [SDNPHasChain]>;
-def ret : SDNode<"ISD::RET" , SDTNone, [SDNPHasChain]>;
-def trap : SDNode<"ISD::TRAP" , SDTNone,
- [SDNPHasChain, SDNPSideEffect]>;
-
-def prefetch : SDNode<"ISD::PREFETCH" , STDPrefetch,
- [SDNPHasChain, SDNPMayLoad, SDNPMayStore]>;
-
-def membarrier : SDNode<"ISD::MEMBARRIER" , STDMemBarrier,
- [SDNPHasChain, SDNPSideEffect]>;
-
-// Do not use atomic_* directly, use atomic_*_size (see below)
-def atomic_lcs : SDNode<"ISD::ATOMIC_LCS" , STDAtomic3,
- [SDNPHasChain, SDNPMayStore, SDNPMayLoad]>;
-def atomic_las : SDNode<"ISD::ATOMIC_LAS" , STDAtomic2,
- [SDNPHasChain, SDNPMayStore, SDNPMayLoad]>;
-def atomic_swap : SDNode<"ISD::ATOMIC_SWAP", STDAtomic2,
- [SDNPHasChain, SDNPMayStore, SDNPMayLoad]>;
-def atomic_lss : SDNode<"ISD::ATOMIC_LSS" , STDAtomic2,
- [SDNPHasChain, SDNPMayStore, SDNPMayLoad]>;
-def atomic_load_and : SDNode<"ISD::ATOMIC_LOAD_AND" , STDAtomic2,
- [SDNPHasChain, SDNPMayStore, SDNPMayLoad]>;
-def atomic_load_or : SDNode<"ISD::ATOMIC_LOAD_OR" , STDAtomic2,
- [SDNPHasChain, SDNPMayStore, SDNPMayLoad]>;
-def atomic_load_xor : SDNode<"ISD::ATOMIC_LOAD_XOR" , STDAtomic2,
- [SDNPHasChain, SDNPMayStore, SDNPMayLoad]>;
-def atomic_load_min : SDNode<"ISD::ATOMIC_LOAD_MIN", STDAtomic2,
- [SDNPHasChain, SDNPMayStore, SDNPMayLoad]>;
-def atomic_load_max : SDNode<"ISD::ATOMIC_LOAD_MAX", STDAtomic2,
- [SDNPHasChain, SDNPMayStore, SDNPMayLoad]>;
-def atomic_load_umin : SDNode<"ISD::ATOMIC_LOAD_UMIN", STDAtomic2,
- [SDNPHasChain, SDNPMayStore, SDNPMayLoad]>;
-def atomic_load_umax : SDNode<"ISD::ATOMIC_LOAD_UMAX", STDAtomic2,
- [SDNPHasChain, SDNPMayStore, SDNPMayLoad]>;
-
-// Do not use ld, st directly. Use load, extload, sextload, zextload, store,
-// and truncst (see below).
-def ld : SDNode<"ISD::LOAD" , SDTLoad,
- [SDNPHasChain, SDNPMayLoad]>;
-def st : SDNode<"ISD::STORE" , SDTStore,
- [SDNPHasChain, SDNPMayStore]>;
-def ist : SDNode<"ISD::STORE" , SDTIStore,
- [SDNPHasChain, SDNPMayStore]>;
-
-def vector_shuffle : SDNode<"ISD::VECTOR_SHUFFLE", SDTVecShuffle, []>;
-def build_vector : SDNode<"ISD::BUILD_VECTOR", SDTypeProfile<1, 0, []>, []>;
-def scalar_to_vector : SDNode<"ISD::SCALAR_TO_VECTOR", SDTypeProfile<1, 1, []>,
- []>;
-def vector_extract : SDNode<"ISD::EXTRACT_VECTOR_ELT",
- SDTypeProfile<1, 2, [SDTCisPtrTy<2>]>, []>;
-def vector_insert : SDNode<"ISD::INSERT_VECTOR_ELT",
- SDTypeProfile<1, 3, [SDTCisSameAs<0, 1>, SDTCisPtrTy<3>]>, []>;
-
-def extract_subreg : SDNode<"ISD::EXTRACT_SUBREG",
- SDTypeProfile<1, 2, []>>;
-def insert_subreg : SDNode<"ISD::INSERT_SUBREG",
- SDTypeProfile<1, 3, []>>;
-
-// Nodes for intrinsics, you should use the intrinsic itself and let tblgen use
-// these internally. Don't reference these directly.
-def intrinsic_void : SDNode<"ISD::INTRINSIC_VOID",
- SDTypeProfile<0, -1, [SDTCisPtrTy<0>]>,
- [SDNPHasChain]>;
-def intrinsic_w_chain : SDNode<"ISD::INTRINSIC_W_CHAIN",
- SDTypeProfile<1, -1, [SDTCisPtrTy<1>]>,
- [SDNPHasChain]>;
-def intrinsic_wo_chain : SDNode<"ISD::INTRINSIC_WO_CHAIN",
- SDTypeProfile<1, -1, [SDTCisPtrTy<1>]>, []>;
-
-
-//===----------------------------------------------------------------------===//
-// Selection DAG Condition Codes
-
-class CondCode; // ISD::CondCode enums
-def SETOEQ : CondCode; def SETOGT : CondCode;
-def SETOGE : CondCode; def SETOLT : CondCode; def SETOLE : CondCode;
-def SETONE : CondCode; def SETO : CondCode; def SETUO : CondCode;
-def SETUEQ : CondCode; def SETUGT : CondCode; def SETUGE : CondCode;
-def SETULT : CondCode; def SETULE : CondCode; def SETUNE : CondCode;
-
-def SETEQ : CondCode; def SETGT : CondCode; def SETGE : CondCode;
-def SETLT : CondCode; def SETLE : CondCode; def SETNE : CondCode;
-
-
-//===----------------------------------------------------------------------===//
-// Selection DAG Node Transformation Functions.
-//
-// This mechanism allows targets to manipulate nodes in the output DAG once a
-// match has been formed. This is typically used to manipulate immediate
-// values.
-//
-class SDNodeXForm<SDNode opc, code xformFunction> {
- SDNode Opcode = opc;
- code XFormFunction = xformFunction;
-}
-
-def NOOP_SDNodeXForm : SDNodeXForm<imm, [{}]>;
-
-
-//===----------------------------------------------------------------------===//
-// Selection DAG Pattern Fragments.
-//
-// Pattern fragments are reusable chunks of dags that match specific things.
-// They can take arguments and have C++ predicates that control whether they
-// match. They are intended to make the patterns for common instructions more
-// compact and readable.
-//
-
-/// PatFrag - Represents a pattern fragment. This can match something on the
-/// DAG, frame a single node to multiply nested other fragments.
-///
-class PatFrag<dag ops, dag frag, code pred = [{}],
- SDNodeXForm xform = NOOP_SDNodeXForm> {
- dag Operands = ops;
- dag Fragment = frag;
- code Predicate = pred;
- SDNodeXForm OperandTransform = xform;
-}
-
-// PatLeaf's are pattern fragments that have no operands. This is just a helper
-// to define immediates and other common things concisely.
-class PatLeaf<dag frag, code pred = [{}], SDNodeXForm xform = NOOP_SDNodeXForm>
- : PatFrag<(ops), frag, pred, xform>;
-
-// Leaf fragments.
-
-def vtInt : PatLeaf<(vt), [{ return MVT::isInteger(N->getVT()); }]>;
-def vtFP : PatLeaf<(vt), [{ return MVT::isFloatingPoint(N->getVT()); }]>;
-
-def immAllOnes : PatLeaf<(imm), [{ return N->isAllOnesValue(); }]>;
-def immAllOnesV: PatLeaf<(build_vector), [{
- return ISD::isBuildVectorAllOnes(N);
-}]>;
-def immAllOnesV_bc: PatLeaf<(bitconvert), [{
- return ISD::isBuildVectorAllOnes(N);
-}]>;
-def immAllZerosV: PatLeaf<(build_vector), [{
- return ISD::isBuildVectorAllZeros(N);
-}]>;
-def immAllZerosV_bc: PatLeaf<(bitconvert), [{
- return ISD::isBuildVectorAllZeros(N);
-}]>;
-
-
-
-// Other helper fragments.
-def not : PatFrag<(ops node:$in), (xor node:$in, immAllOnes)>;
-def vnot : PatFrag<(ops node:$in), (xor node:$in, immAllOnesV)>;
-def vnot_conv : PatFrag<(ops node:$in), (xor node:$in, immAllOnesV_bc)>;
-def ineg : PatFrag<(ops node:$in), (sub 0, node:$in)>;
-
-// load fragments.
-def load : PatFrag<(ops node:$ptr), (ld node:$ptr), [{
- if (LoadSDNode *LD = dyn_cast<LoadSDNode>(N))
- return LD->getExtensionType() == ISD::NON_EXTLOAD &&
- LD->getAddressingMode() == ISD::UNINDEXED;
- return false;
-}]>;
-
-// extending load fragments.
-def extloadi1 : PatFrag<(ops node:$ptr), (ld node:$ptr), [{
- if (LoadSDNode *LD = dyn_cast<LoadSDNode>(N))
- return LD->getExtensionType() == ISD::EXTLOAD &&
- LD->getAddressingMode() == ISD::UNINDEXED &&
- LD->getMemoryVT() == MVT::i1;
- return false;
-}]>;
-def extloadi8 : PatFrag<(ops node:$ptr), (ld node:$ptr), [{
- if (LoadSDNode *LD = dyn_cast<LoadSDNode>(N))
- return LD->getExtensionType() == ISD::EXTLOAD &&
- LD->getAddressingMode() == ISD::UNINDEXED &&
- LD->getMemoryVT() == MVT::i8;
- return false;
-}]>;
-def extloadi16 : PatFrag<(ops node:$ptr), (ld node:$ptr), [{
- if (LoadSDNode *LD = dyn_cast<LoadSDNode>(N))
- return LD->getExtensionType() == ISD::EXTLOAD &&
- LD->getAddressingMode() == ISD::UNINDEXED &&
- LD->getMemoryVT() == MVT::i16;
- return false;
-}]>;
-def extloadi32 : PatFrag<(ops node:$ptr), (ld node:$ptr), [{
- if (LoadSDNode *LD = dyn_cast<LoadSDNode>(N))
- return LD->getExtensionType() == ISD::EXTLOAD &&
- LD->getAddressingMode() == ISD::UNINDEXED &&
- LD->getMemoryVT() == MVT::i32;
- return false;
-}]>;
-def extloadf32 : PatFrag<(ops node:$ptr), (ld node:$ptr), [{
- if (LoadSDNode *LD = dyn_cast<LoadSDNode>(N))
- return LD->getExtensionType() == ISD::EXTLOAD &&
- LD->getAddressingMode() == ISD::UNINDEXED &&
- LD->getMemoryVT() == MVT::f32;
- return false;
-}]>;
-def extloadf64 : PatFrag<(ops node:$ptr), (ld node:$ptr), [{
- if (LoadSDNode *LD = dyn_cast<LoadSDNode>(N))
- return LD->getExtensionType() == ISD::EXTLOAD &&
- LD->getAddressingMode() == ISD::UNINDEXED &&
- LD->getMemoryVT() == MVT::f64;
- return false;
-}]>;
-
-def sextloadi1 : PatFrag<(ops node:$ptr), (ld node:$ptr), [{
- if (LoadSDNode *LD = dyn_cast<LoadSDNode>(N))
- return LD->getExtensionType() == ISD::SEXTLOAD &&
- LD->getAddressingMode() == ISD::UNINDEXED &&
- LD->getMemoryVT() == MVT::i1;
- return false;
-}]>;
-def sextloadi8 : PatFrag<(ops node:$ptr), (ld node:$ptr), [{
- if (LoadSDNode *LD = dyn_cast<LoadSDNode>(N))
- return LD->getExtensionType() == ISD::SEXTLOAD &&
- LD->getAddressingMode() == ISD::UNINDEXED &&
- LD->getMemoryVT() == MVT::i8;
- return false;
-}]>;
-def sextloadi16 : PatFrag<(ops node:$ptr), (ld node:$ptr), [{
- if (LoadSDNode *LD = dyn_cast<LoadSDNode>(N))
- return LD->getExtensionType() == ISD::SEXTLOAD &&
- LD->getAddressingMode() == ISD::UNINDEXED &&
- LD->getMemoryVT() == MVT::i16;
- return false;
-}]>;
-def sextloadi32 : PatFrag<(ops node:$ptr), (ld node:$ptr), [{
- if (LoadSDNode *LD = dyn_cast<LoadSDNode>(N))
- return LD->getExtensionType() == ISD::SEXTLOAD &&
- LD->getAddressingMode() == ISD::UNINDEXED &&
- LD->getMemoryVT() == MVT::i32;
- return false;
-}]>;
-
-def zextloadi1 : PatFrag<(ops node:$ptr), (ld node:$ptr), [{
- if (LoadSDNode *LD = dyn_cast<LoadSDNode>(N))
- return LD->getExtensionType() == ISD::ZEXTLOAD &&
- LD->getAddressingMode() == ISD::UNINDEXED &&
- LD->getMemoryVT() == MVT::i1;
- return false;
-}]>;
-def zextloadi8 : PatFrag<(ops node:$ptr), (ld node:$ptr), [{
- if (LoadSDNode *LD = dyn_cast<LoadSDNode>(N))
- return LD->getExtensionType() == ISD::ZEXTLOAD &&
- LD->getAddressingMode() == ISD::UNINDEXED &&
- LD->getMemoryVT() == MVT::i8;
- return false;
-}]>;
-def zextloadi16 : PatFrag<(ops node:$ptr), (ld node:$ptr), [{
- if (LoadSDNode *LD = dyn_cast<LoadSDNode>(N))
- return LD->getExtensionType() == ISD::ZEXTLOAD &&
- LD->getAddressingMode() == ISD::UNINDEXED &&
- LD->getMemoryVT() == MVT::i16;
- return false;
-}]>;
-def zextloadi32 : PatFrag<(ops node:$ptr), (ld node:$ptr), [{
- if (LoadSDNode *LD = dyn_cast<LoadSDNode>(N))
- return LD->getExtensionType() == ISD::ZEXTLOAD &&
- LD->getAddressingMode() == ISD::UNINDEXED &&
- LD->getMemoryVT() == MVT::i32;
- return false;
-}]>;
-
-// store fragments.
-def store : PatFrag<(ops node:$val, node:$ptr),
- (st node:$val, node:$ptr), [{
- if (StoreSDNode *ST = dyn_cast<StoreSDNode>(N))
- return !ST->isTruncatingStore() &&
- ST->getAddressingMode() == ISD::UNINDEXED;
- return false;
-}]>;
-
-// truncstore fragments.
-def truncstorei8 : PatFrag<(ops node:$val, node:$ptr),
- (st node:$val, node:$ptr), [{
- if (StoreSDNode *ST = dyn_cast<StoreSDNode>(N))
- return ST->isTruncatingStore() && ST->getMemoryVT() == MVT::i8 &&
- ST->getAddressingMode() == ISD::UNINDEXED;
- return false;
-}]>;
-def truncstorei16 : PatFrag<(ops node:$val, node:$ptr),
- (st node:$val, node:$ptr), [{
- if (StoreSDNode *ST = dyn_cast<StoreSDNode>(N))
- return ST->isTruncatingStore() && ST->getMemoryVT() == MVT::i16 &&
- ST->getAddressingMode() == ISD::UNINDEXED;
- return false;
-}]>;
-def truncstorei32 : PatFrag<(ops node:$val, node:$ptr),
- (st node:$val, node:$ptr), [{
- if (StoreSDNode *ST = dyn_cast<StoreSDNode>(N))
- return ST->isTruncatingStore() && ST->getMemoryVT() == MVT::i32 &&
- ST->getAddressingMode() == ISD::UNINDEXED;
- return false;
-}]>;
-def truncstoref32 : PatFrag<(ops node:$val, node:$ptr),
- (st node:$val, node:$ptr), [{
- if (StoreSDNode *ST = dyn_cast<StoreSDNode>(N))
- return ST->isTruncatingStore() && ST->getMemoryVT() == MVT::f32 &&
- ST->getAddressingMode() == ISD::UNINDEXED;
- return false;
-}]>;
-def truncstoref64 : PatFrag<(ops node:$val, node:$ptr),
- (st node:$val, node:$ptr), [{
- if (StoreSDNode *ST = dyn_cast<StoreSDNode>(N))
- return ST->isTruncatingStore() && ST->getMemoryVT() == MVT::f64 &&
- ST->getAddressingMode() == ISD::UNINDEXED;
- return false;
-}]>;
-
-// indexed store fragments.
-def pre_store : PatFrag<(ops node:$val, node:$base, node:$offset),
- (ist node:$val, node:$base, node:$offset), [{
- if (StoreSDNode *ST = dyn_cast<StoreSDNode>(N)) {
- ISD::MemIndexedMode AM = ST->getAddressingMode();
- return (AM == ISD::PRE_INC || AM == ISD::PRE_DEC) &&
- !ST->isTruncatingStore();
- }
- return false;
-}]>;
-
-def pre_truncsti1 : PatFrag<(ops node:$val, node:$base, node:$offset),
- (ist node:$val, node:$base, node:$offset), [{
- if (StoreSDNode *ST = dyn_cast<StoreSDNode>(N)) {
- ISD::MemIndexedMode AM = ST->getAddressingMode();
- return (AM == ISD::PRE_INC || AM == ISD::PRE_DEC) &&
- ST->isTruncatingStore() && ST->getMemoryVT() == MVT::i1;
- }
- return false;
-}]>;
-def pre_truncsti8 : PatFrag<(ops node:$val, node:$base, node:$offset),
- (ist node:$val, node:$base, node:$offset), [{
- if (StoreSDNode *ST = dyn_cast<StoreSDNode>(N)) {
- ISD::MemIndexedMode AM = ST->getAddressingMode();
- return (AM == ISD::PRE_INC || AM == ISD::PRE_DEC) &&
- ST->isTruncatingStore() && ST->getMemoryVT() == MVT::i8;
- }
- return false;
-}]>;
-def pre_truncsti16 : PatFrag<(ops node:$val, node:$base, node:$offset),
- (ist node:$val, node:$base, node:$offset), [{
- if (StoreSDNode *ST = dyn_cast<StoreSDNode>(N)) {
- ISD::MemIndexedMode AM = ST->getAddressingMode();
- return (AM == ISD::PRE_INC || AM == ISD::PRE_DEC) &&
- ST->isTruncatingStore() && ST->getMemoryVT() == MVT::i16;
- }
- return false;
-}]>;
-def pre_truncsti32 : PatFrag<(ops node:$val, node:$base, node:$offset),
- (ist node:$val, node:$base, node:$offset), [{
- if (StoreSDNode *ST = dyn_cast<StoreSDNode>(N)) {
- ISD::MemIndexedMode AM = ST->getAddressingMode();
- return (AM == ISD::PRE_INC || AM == ISD::PRE_DEC) &&
- ST->isTruncatingStore() && ST->getMemoryVT() == MVT::i32;
- }
- return false;
-}]>;
-def pre_truncstf32 : PatFrag<(ops node:$val, node:$base, node:$offset),
- (ist node:$val, node:$base, node:$offset), [{
- if (StoreSDNode *ST = dyn_cast<StoreSDNode>(N)) {
- ISD::MemIndexedMode AM = ST->getAddressingMode();
- return (AM == ISD::PRE_INC || AM == ISD::PRE_DEC) &&
- ST->isTruncatingStore() && ST->getMemoryVT() == MVT::f32;
- }
- return false;
-}]>;
-
-def post_store : PatFrag<(ops node:$val, node:$ptr, node:$offset),
- (ist node:$val, node:$ptr, node:$offset), [{
- if (StoreSDNode *ST = dyn_cast<StoreSDNode>(N)) {
- ISD::MemIndexedMode AM = ST->getAddressingMode();
- return !ST->isTruncatingStore() &&
- (AM == ISD::POST_INC || AM == ISD::POST_DEC);
- }
- return false;
-}]>;
-
-def post_truncsti1 : PatFrag<(ops node:$val, node:$base, node:$offset),
- (ist node:$val, node:$base, node:$offset), [{
- if (StoreSDNode *ST = dyn_cast<StoreSDNode>(N)) {
- ISD::MemIndexedMode AM = ST->getAddressingMode();
- return (AM == ISD::POST_INC || AM == ISD::POST_DEC) &&
- ST->isTruncatingStore() && ST->getMemoryVT() == MVT::i1;
- }
- return false;
-}]>;
-def post_truncsti8 : PatFrag<(ops node:$val, node:$base, node:$offset),
- (ist node:$val, node:$base, node:$offset), [{
- if (StoreSDNode *ST = dyn_cast<StoreSDNode>(N)) {
- ISD::MemIndexedMode AM = ST->getAddressingMode();
- return (AM == ISD::POST_INC || AM == ISD::POST_DEC) &&
- ST->isTruncatingStore() && ST->getMemoryVT() == MVT::i8;
- }
- return false;
-}]>;
-def post_truncsti16 : PatFrag<(ops node:$val, node:$base, node:$offset),
- (ist node:$val, node:$base, node:$offset), [{
- if (StoreSDNode *ST = dyn_cast<StoreSDNode>(N)) {
- ISD::MemIndexedMode AM = ST->getAddressingMode();
- return (AM == ISD::POST_INC || AM == ISD::POST_DEC) &&
- ST->isTruncatingStore() && ST->getMemoryVT() == MVT::i16;
- }
- return false;
-}]>;
-def post_truncsti32 : PatFrag<(ops node:$val, node:$base, node:$offset),
- (ist node:$val, node:$base, node:$offset), [{
- if (StoreSDNode *ST = dyn_cast<StoreSDNode>(N)) {
- ISD::MemIndexedMode AM = ST->getAddressingMode();
- return (AM == ISD::POST_INC || AM == ISD::POST_DEC) &&
- ST->isTruncatingStore() && ST->getMemoryVT() == MVT::i32;
- }
- return false;
-}]>;
-def post_truncstf32 : PatFrag<(ops node:$val, node:$base, node:$offset),
- (ist node:$val, node:$base, node:$offset), [{
- if (StoreSDNode *ST = dyn_cast<StoreSDNode>(N)) {
- ISD::MemIndexedMode AM = ST->getAddressingMode();
- return (AM == ISD::POST_INC || AM == ISD::POST_DEC) &&
- ST->isTruncatingStore() && ST->getMemoryVT() == MVT::f32;
- }
- return false;
-}]>;
-
-//Atomic patterns
-def atomic_lcs_8 : PatFrag<(ops node:$ptr, node:$cmp, node:$swp),
- (atomic_lcs node:$ptr, node:$cmp, node:$swp), [{
- if (AtomicSDNode* V = dyn_cast<AtomicSDNode>(N))
- return V->getVT() == MVT::i8;
- return false;
-}]>;
-def atomic_lcs_16 : PatFrag<(ops node:$ptr, node:$cmp, node:$swp),
- (atomic_lcs node:$ptr, node:$cmp, node:$swp), [{
- if (AtomicSDNode* V = dyn_cast<AtomicSDNode>(N))
- return V->getVT() == MVT::i16;
- return false;
-}]>;
-def atomic_lcs_32 : PatFrag<(ops node:$ptr, node:$cmp, node:$swp),
- (atomic_lcs node:$ptr, node:$cmp, node:$swp), [{
- if (AtomicSDNode* V = dyn_cast<AtomicSDNode>(N))
- return V->getVT() == MVT::i32;
- return false;
-}]>;
-def atomic_lcs_64 : PatFrag<(ops node:$ptr, node:$cmp, node:$swp),
- (atomic_lcs node:$ptr, node:$cmp, node:$swp), [{
- if (AtomicSDNode* V = dyn_cast<AtomicSDNode>(N))
- return V->getVT() == MVT::i64;
- return false;
-}]>;
-
-def atomic_las_8 : PatFrag<(ops node:$ptr, node:$inc),
- (atomic_las node:$ptr, node:$inc), [{
- if (AtomicSDNode* V = dyn_cast<AtomicSDNode>(N))
- return V->getVT() == MVT::i8;
- return false;
-}]>;
-def atomic_las_16 : PatFrag<(ops node:$ptr, node:$inc),
- (atomic_las node:$ptr, node:$inc), [{
- if (AtomicSDNode* V = dyn_cast<AtomicSDNode>(N))
- return V->getVT() == MVT::i16;
- return false;
-}]>;
-def atomic_las_32 : PatFrag<(ops node:$ptr, node:$inc),
- (atomic_las node:$ptr, node:$inc), [{
- if (AtomicSDNode* V = dyn_cast<AtomicSDNode>(N))
- return V->getVT() == MVT::i32;
- return false;
-}]>;
-def atomic_las_64 : PatFrag<(ops node:$ptr, node:$inc),
- (atomic_las node:$ptr, node:$inc), [{
- if (AtomicSDNode* V = dyn_cast<AtomicSDNode>(N))
- return V->getVT() == MVT::i64;
- return false;
-}]>;
-
-def atomic_swap_8 : PatFrag<(ops node:$ptr, node:$inc),
- (atomic_swap node:$ptr, node:$inc), [{
- if (AtomicSDNode* V = dyn_cast<AtomicSDNode>(N))
- return V->getVT() == MVT::i8;
- return false;
-}]>;
-def atomic_swap_16 : PatFrag<(ops node:$ptr, node:$inc),
- (atomic_swap node:$ptr, node:$inc), [{
- if (AtomicSDNode* V = dyn_cast<AtomicSDNode>(N))
- return V->getVT() == MVT::i16;
- return false;
-}]>;
-def atomic_swap_32 : PatFrag<(ops node:$ptr, node:$inc),
- (atomic_swap node:$ptr, node:$inc), [{
- if (AtomicSDNode* V = dyn_cast<AtomicSDNode>(N))
- return V->getVT() == MVT::i32;
- return false;
-}]>;
-def atomic_swap_64 : PatFrag<(ops node:$ptr, node:$inc),
- (atomic_swap node:$ptr, node:$inc), [{
- if (AtomicSDNode* V = dyn_cast<AtomicSDNode>(N))
- return V->getVT() == MVT::i64;
- return false;
-}]>;
-
-
-
-// setcc convenience fragments.
-def setoeq : PatFrag<(ops node:$lhs, node:$rhs),
- (setcc node:$lhs, node:$rhs, SETOEQ)>;
-def setogt : PatFrag<(ops node:$lhs, node:$rhs),
- (setcc node:$lhs, node:$rhs, SETOGT)>;
-def setoge : PatFrag<(ops node:$lhs, node:$rhs),
- (setcc node:$lhs, node:$rhs, SETOGE)>;
-def setolt : PatFrag<(ops node:$lhs, node:$rhs),
- (setcc node:$lhs, node:$rhs, SETOLT)>;
-def setole : PatFrag<(ops node:$lhs, node:$rhs),
- (setcc node:$lhs, node:$rhs, SETOLE)>;
-def setone : PatFrag<(ops node:$lhs, node:$rhs),
- (setcc node:$lhs, node:$rhs, SETONE)>;
-def seto : PatFrag<(ops node:$lhs, node:$rhs),
- (setcc node:$lhs, node:$rhs, SETO)>;
-def setuo : PatFrag<(ops node:$lhs, node:$rhs),
- (setcc node:$lhs, node:$rhs, SETUO)>;
-def setueq : PatFrag<(ops node:$lhs, node:$rhs),
- (setcc node:$lhs, node:$rhs, SETUEQ)>;
-def setugt : PatFrag<(ops node:$lhs, node:$rhs),
- (setcc node:$lhs, node:$rhs, SETUGT)>;
-def setuge : PatFrag<(ops node:$lhs, node:$rhs),
- (setcc node:$lhs, node:$rhs, SETUGE)>;
-def setult : PatFrag<(ops node:$lhs, node:$rhs),
- (setcc node:$lhs, node:$rhs, SETULT)>;
-def setule : PatFrag<(ops node:$lhs, node:$rhs),
- (setcc node:$lhs, node:$rhs, SETULE)>;
-def setune : PatFrag<(ops node:$lhs, node:$rhs),
- (setcc node:$lhs, node:$rhs, SETUNE)>;
-def seteq : PatFrag<(ops node:$lhs, node:$rhs),
- (setcc node:$lhs, node:$rhs, SETEQ)>;
-def setgt : PatFrag<(ops node:$lhs, node:$rhs),
- (setcc node:$lhs, node:$rhs, SETGT)>;
-def setge : PatFrag<(ops node:$lhs, node:$rhs),
- (setcc node:$lhs, node:$rhs, SETGE)>;
-def setlt : PatFrag<(ops node:$lhs, node:$rhs),
- (setcc node:$lhs, node:$rhs, SETLT)>;
-def setle : PatFrag<(ops node:$lhs, node:$rhs),
- (setcc node:$lhs, node:$rhs, SETLE)>;
-def setne : PatFrag<(ops node:$lhs, node:$rhs),
- (setcc node:$lhs, node:$rhs, SETNE)>;
-
-//===----------------------------------------------------------------------===//
-// Selection DAG Pattern Support.
-//
-// Patterns are what are actually matched against the target-flavored
-// instruction selection DAG. Instructions defined by the target implicitly
-// define patterns in most cases, but patterns can also be explicitly added when
-// an operation is defined by a sequence of instructions (e.g. loading a large
-// immediate value on RISC targets that do not support immediates as large as
-// their GPRs).
-//
-
-class Pattern<dag patternToMatch, list<dag> resultInstrs> {
- dag PatternToMatch = patternToMatch;
- list<dag> ResultInstrs = resultInstrs;
- list<Predicate> Predicates = []; // See class Instruction in Target.td.
- int AddedComplexity = 0; // See class Instruction in Target.td.
-}
-
-// Pat - A simple (but common) form of a pattern, which produces a simple result
-// not needing a full list.
-class Pat<dag pattern, dag result> : Pattern<pattern, [result]>;
-
-//===----------------------------------------------------------------------===//
-// Complex pattern definitions.
-//
-
-class CPAttribute;
-// Pass the parent Operand as root to CP function rather
-// than the root of the sub-DAG
-def CPAttrParentAsRoot : CPAttribute;
-
-// Complex patterns, e.g. X86 addressing mode, requires pattern matching code
-// in C++. NumOperands is the number of operands returned by the select function;
-// SelectFunc is the name of the function used to pattern match the max. pattern;
-// RootNodes are the list of possible root nodes of the sub-dags to match.
-// e.g. X86 addressing mode - def addr : ComplexPattern<4, "SelectAddr", [add]>;
-//
-class ComplexPattern<ValueType ty, int numops, string fn,
- list<SDNode> roots = [], list<SDNodeProperty> props = [],
- list<CPAttribute> attrs = []> {
- ValueType Ty = ty;
- int NumOperands = numops;
- string SelectFunc = fn;
- list<SDNode> RootNodes = roots;
- list<SDNodeProperty> Properties = props;
- list<CPAttribute> Attributes = attrs;
-}
-
-//===----------------------------------------------------------------------===//
-// Dwarf support.
-//
-def SDT_dwarf_loc : SDTypeProfile<0, 3,
- [SDTCisInt<0>, SDTCisInt<1>, SDTCisInt<2>]>;
-def dwarf_loc : SDNode<"ISD::DEBUG_LOC", SDT_dwarf_loc,[SDNPHasChain]>;
diff --git a/release_23/lib/Target/TargetSubtarget.cpp b/release_23/lib/Target/TargetSubtarget.cpp
deleted file mode 100644
index 95c92cabaf70..000000000000
--- a/release_23/lib/Target/TargetSubtarget.cpp
+++ /dev/null
@@ -1,22 +0,0 @@
-//===-- TargetSubtarget.cpp - General Target Information -------------------==//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file describes the general parts of a Subtarget.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Target/TargetSubtarget.h"
-using namespace llvm;
-
-//---------------------------------------------------------------------------
-// TargetSubtarget Class
-//
-TargetSubtarget::TargetSubtarget() {}
-
-TargetSubtarget::~TargetSubtarget() {}
diff --git a/release_23/lib/Target/X86/Makefile b/release_23/lib/Target/X86/Makefile
deleted file mode 100644
index 382b6420db14..000000000000
--- a/release_23/lib/Target/X86/Makefile
+++ /dev/null
@@ -1,20 +0,0 @@
-##===- lib/Target/X86/Makefile -----------------------------*- Makefile -*-===##
-#
-# The LLVM Compiler Infrastructure
-#
-# This file is distributed under the University of Illinois Open Source
-# License. See LICENSE.TXT for details.
-#
-##===----------------------------------------------------------------------===##
-LEVEL = ../../..
-LIBRARYNAME = LLVMX86
-TARGET = X86
-
-# Make sure that tblgen is run, first thing.
-BUILT_SOURCES = X86GenRegisterInfo.h.inc X86GenRegisterNames.inc \
- X86GenRegisterInfo.inc X86GenInstrNames.inc \
- X86GenInstrInfo.inc X86GenAsmWriter.inc \
- X86GenAsmWriter1.inc X86GenDAGISel.inc \
- X86GenCallingConv.inc X86GenSubtarget.inc
-
-include $(LEVEL)/Makefile.common
diff --git a/release_23/lib/Target/X86/README-FPStack.txt b/release_23/lib/Target/X86/README-FPStack.txt
deleted file mode 100644
index be28e8b394a4..000000000000
--- a/release_23/lib/Target/X86/README-FPStack.txt
+++ /dev/null
@@ -1,85 +0,0 @@
-//===---------------------------------------------------------------------===//
-// Random ideas for the X86 backend: FP stack related stuff
-//===---------------------------------------------------------------------===//
-
-//===---------------------------------------------------------------------===//
-
-Some targets (e.g. athlons) prefer freep to fstp ST(0):
-http://gcc.gnu.org/ml/gcc-patches/2004-04/msg00659.html
-
-//===---------------------------------------------------------------------===//
-
-This should use fiadd on chips where it is profitable:
-double foo(double P, int *I) { return P+*I; }
-
-We have fiadd patterns now but the followings have the same cost and
-complexity. We need a way to specify the later is more profitable.
-
-def FpADD32m : FpI<(ops RFP:$dst, RFP:$src1, f32mem:$src2), OneArgFPRW,
- [(set RFP:$dst, (fadd RFP:$src1,
- (extloadf64f32 addr:$src2)))]>;
- // ST(0) = ST(0) + [mem32]
-
-def FpIADD32m : FpI<(ops RFP:$dst, RFP:$src1, i32mem:$src2), OneArgFPRW,
- [(set RFP:$dst, (fadd RFP:$src1,
- (X86fild addr:$src2, i32)))]>;
- // ST(0) = ST(0) + [mem32int]
-
-//===---------------------------------------------------------------------===//
-
-The FP stackifier needs to be global. Also, it should handle simple permutates
-to reduce number of shuffle instructions, e.g. turning:
-
-fld P -> fld Q
-fld Q fld P
-fxch
-
-or:
-
-fxch -> fucomi
-fucomi jl X
-jg X
-
-Ideas:
-http://gcc.gnu.org/ml/gcc-patches/2004-11/msg02410.html
-
-
-//===---------------------------------------------------------------------===//
-
-Add a target specific hook to DAG combiner to handle SINT_TO_FP and
-FP_TO_SINT when the source operand is already in memory.
-
-//===---------------------------------------------------------------------===//
-
-Open code rint,floor,ceil,trunc:
-http://gcc.gnu.org/ml/gcc-patches/2004-08/msg02006.html
-http://gcc.gnu.org/ml/gcc-patches/2004-08/msg02011.html
-
-Opencode the sincos[f] libcall.
-
-//===---------------------------------------------------------------------===//
-
-None of the FPStack instructions are handled in
-X86RegisterInfo::foldMemoryOperand, which prevents the spiller from
-folding spill code into the instructions.
-
-//===---------------------------------------------------------------------===//
-
-Currently the x86 codegen isn't very good at mixing SSE and FPStack
-code:
-
-unsigned int foo(double x) { return x; }
-
-foo:
- subl $20, %esp
- movsd 24(%esp), %xmm0
- movsd %xmm0, 8(%esp)
- fldl 8(%esp)
- fisttpll (%esp)
- movl (%esp), %eax
- addl $20, %esp
- ret
-
-This just requires being smarter when custom expanding fptoui.
-
-//===---------------------------------------------------------------------===//
diff --git a/release_23/lib/Target/X86/README-MMX.txt b/release_23/lib/Target/X86/README-MMX.txt
deleted file mode 100644
index 7ad623e40d51..000000000000
--- a/release_23/lib/Target/X86/README-MMX.txt
+++ /dev/null
@@ -1,43 +0,0 @@
-//===---------------------------------------------------------------------===//
-// Random ideas for the X86 backend: MMX-specific stuff.
-//===---------------------------------------------------------------------===//
-
-//===---------------------------------------------------------------------===//
-
-This:
-
-#include <mmintrin.h>
-
-__v2si qux(int A) {
- return (__v2si){ 0, A };
-}
-
-is compiled into:
-
-_qux:
- subl $28, %esp
- movl 32(%esp), %eax
- movd %eax, %mm0
- movq %mm0, (%esp)
- movl (%esp), %eax
- movl %eax, 20(%esp)
- movq %mm0, 8(%esp)
- movl 12(%esp), %eax
- movl %eax, 16(%esp)
- movq 16(%esp), %mm0
- addl $28, %esp
- ret
-
-Yuck!
-
-GCC gives us:
-
-_qux:
- subl $12, %esp
- movl 16(%esp), %eax
- movl 20(%esp), %edx
- movl $0, (%eax)
- movl %edx, 4(%eax)
- addl $12, %esp
- ret $4
-
diff --git a/release_23/lib/Target/X86/README-SSE.txt b/release_23/lib/Target/X86/README-SSE.txt
deleted file mode 100644
index 5cccfa8daa4b..000000000000
--- a/release_23/lib/Target/X86/README-SSE.txt
+++ /dev/null
@@ -1,837 +0,0 @@
-//===---------------------------------------------------------------------===//
-// Random ideas for the X86 backend: SSE-specific stuff.
-//===---------------------------------------------------------------------===//
-
-- Consider eliminating the unaligned SSE load intrinsics, replacing them with
- unaligned LLVM load instructions.
-
-//===---------------------------------------------------------------------===//
-
-Expand libm rounding functions inline: Significant speedups possible.
-http://gcc.gnu.org/ml/gcc-patches/2006-10/msg00909.html
-
-//===---------------------------------------------------------------------===//
-
-When compiled with unsafemath enabled, "main" should enable SSE DAZ mode and
-other fast SSE modes.
-
-//===---------------------------------------------------------------------===//
-
-Think about doing i64 math in SSE regs.
-
-//===---------------------------------------------------------------------===//
-
-This testcase should have no SSE instructions in it, and only one load from
-a constant pool:
-
-double %test3(bool %B) {
- %C = select bool %B, double 123.412, double 523.01123123
- ret double %C
-}
-
-Currently, the select is being lowered, which prevents the dag combiner from
-turning 'select (load CPI1), (load CPI2)' -> 'load (select CPI1, CPI2)'
-
-The pattern isel got this one right.
-
-//===---------------------------------------------------------------------===//
-
-SSE doesn't have [mem] op= reg instructions. If we have an SSE instruction
-like this:
-
- X += y
-
-and the register allocator decides to spill X, it is cheaper to emit this as:
-
-Y += [xslot]
-store Y -> [xslot]
-
-than as:
-
-tmp = [xslot]
-tmp += y
-store tmp -> [xslot]
-
-..and this uses one fewer register (so this should be done at load folding
-time, not at spiller time). *Note* however that this can only be done
-if Y is dead. Here's a testcase:
-
-@.str_3 = external global [15 x i8]
-declare void @printf(i32, ...)
-define void @main() {
-build_tree.exit:
- br label %no_exit.i7
-
-no_exit.i7: ; preds = %no_exit.i7, %build_tree.exit
- %tmp.0.1.0.i9 = phi double [ 0.000000e+00, %build_tree.exit ],
- [ %tmp.34.i18, %no_exit.i7 ]
- %tmp.0.0.0.i10 = phi double [ 0.000000e+00, %build_tree.exit ],
- [ %tmp.28.i16, %no_exit.i7 ]
- %tmp.28.i16 = add double %tmp.0.0.0.i10, 0.000000e+00
- %tmp.34.i18 = add double %tmp.0.1.0.i9, 0.000000e+00
- br i1 false, label %Compute_Tree.exit23, label %no_exit.i7
-
-Compute_Tree.exit23: ; preds = %no_exit.i7
- tail call void (i32, ...)* @printf( i32 0 )
- store double %tmp.34.i18, double* null
- ret void
-}
-
-We currently emit:
-
-.BBmain_1:
- xorpd %XMM1, %XMM1
- addsd %XMM0, %XMM1
-*** movsd %XMM2, QWORD PTR [%ESP + 8]
-*** addsd %XMM2, %XMM1
-*** movsd QWORD PTR [%ESP + 8], %XMM2
- jmp .BBmain_1 # no_exit.i7
-
-This is a bugpoint reduced testcase, which is why the testcase doesn't make
-much sense (e.g. its an infinite loop). :)
-
-//===---------------------------------------------------------------------===//
-
-SSE should implement 'select_cc' using 'emulated conditional moves' that use
-pcmp/pand/pandn/por to do a selection instead of a conditional branch:
-
-double %X(double %Y, double %Z, double %A, double %B) {
- %C = setlt double %A, %B
- %z = add double %Z, 0.0 ;; select operand is not a load
- %D = select bool %C, double %Y, double %z
- ret double %D
-}
-
-We currently emit:
-
-_X:
- subl $12, %esp
- xorpd %xmm0, %xmm0
- addsd 24(%esp), %xmm0
- movsd 32(%esp), %xmm1
- movsd 16(%esp), %xmm2
- ucomisd 40(%esp), %xmm1
- jb LBB_X_2
-LBB_X_1:
- movsd %xmm0, %xmm2
-LBB_X_2:
- movsd %xmm2, (%esp)
- fldl (%esp)
- addl $12, %esp
- ret
-
-//===---------------------------------------------------------------------===//
-
-It's not clear whether we should use pxor or xorps / xorpd to clear XMM
-registers. The choice may depend on subtarget information. We should do some
-more experiments on different x86 machines.
-
-//===---------------------------------------------------------------------===//
-
-Lower memcpy / memset to a series of SSE 128 bit move instructions when it's
-feasible.
-
-//===---------------------------------------------------------------------===//
-
-Codegen:
- if (copysign(1.0, x) == copysign(1.0, y))
-into:
- if (x^y & mask)
-when using SSE.
-
-//===---------------------------------------------------------------------===//
-
-Use movhps to update upper 64-bits of a v4sf value. Also movlps on lower half
-of a v4sf value.
-
-//===---------------------------------------------------------------------===//
-
-Better codegen for vector_shuffles like this { x, 0, 0, 0 } or { x, 0, x, 0}.
-Perhaps use pxor / xorp* to clear a XMM register first?
-
-//===---------------------------------------------------------------------===//
-
-How to decide when to use the "floating point version" of logical ops? Here are
-some code fragments:
-
- movaps LCPI5_5, %xmm2
- divps %xmm1, %xmm2
- mulps %xmm2, %xmm3
- mulps 8656(%ecx), %xmm3
- addps 8672(%ecx), %xmm3
- andps LCPI5_6, %xmm2
- andps LCPI5_1, %xmm3
- por %xmm2, %xmm3
- movdqa %xmm3, (%edi)
-
- movaps LCPI5_5, %xmm1
- divps %xmm0, %xmm1
- mulps %xmm1, %xmm3
- mulps 8656(%ecx), %xmm3
- addps 8672(%ecx), %xmm3
- andps LCPI5_6, %xmm1
- andps LCPI5_1, %xmm3
- orps %xmm1, %xmm3
- movaps %xmm3, 112(%esp)
- movaps %xmm3, (%ebx)
-
-Due to some minor source change, the later case ended up using orps and movaps
-instead of por and movdqa. Does it matter?
-
-//===---------------------------------------------------------------------===//
-
-X86RegisterInfo::copyRegToReg() returns X86::MOVAPSrr for VR128. Is it possible
-to choose between movaps, movapd, and movdqa based on types of source and
-destination?
-
-How about andps, andpd, and pand? Do we really care about the type of the packed
-elements? If not, why not always use the "ps" variants which are likely to be
-shorter.
-
-//===---------------------------------------------------------------------===//
-
-External test Nurbs exposed some problems. Look for
-__ZN15Nurbs_SSE_Cubic17TessellateSurfaceE, bb cond_next140. This is what icc
-emits:
-
- movaps (%edx), %xmm2 #59.21
- movaps (%edx), %xmm5 #60.21
- movaps (%edx), %xmm4 #61.21
- movaps (%edx), %xmm3 #62.21
- movl 40(%ecx), %ebp #69.49
- shufps $0, %xmm2, %xmm5 #60.21
- movl 100(%esp), %ebx #69.20
- movl (%ebx), %edi #69.20
- imull %ebp, %edi #69.49
- addl (%eax), %edi #70.33
- shufps $85, %xmm2, %xmm4 #61.21
- shufps $170, %xmm2, %xmm3 #62.21
- shufps $255, %xmm2, %xmm2 #63.21
- lea (%ebp,%ebp,2), %ebx #69.49
- negl %ebx #69.49
- lea -3(%edi,%ebx), %ebx #70.33
- shll $4, %ebx #68.37
- addl 32(%ecx), %ebx #68.37
- testb $15, %bl #91.13
- jne L_B1.24 # Prob 5% #91.13
-
-This is the llvm code after instruction scheduling:
-
-cond_next140 (0xa910740, LLVM BB @0xa90beb0):
- %reg1078 = MOV32ri -3
- %reg1079 = ADD32rm %reg1078, %reg1068, 1, %NOREG, 0
- %reg1037 = MOV32rm %reg1024, 1, %NOREG, 40
- %reg1080 = IMUL32rr %reg1079, %reg1037
- %reg1081 = MOV32rm %reg1058, 1, %NOREG, 0
- %reg1038 = LEA32r %reg1081, 1, %reg1080, -3
- %reg1036 = MOV32rm %reg1024, 1, %NOREG, 32
- %reg1082 = SHL32ri %reg1038, 4
- %reg1039 = ADD32rr %reg1036, %reg1082
- %reg1083 = MOVAPSrm %reg1059, 1, %NOREG, 0
- %reg1034 = SHUFPSrr %reg1083, %reg1083, 170
- %reg1032 = SHUFPSrr %reg1083, %reg1083, 0
- %reg1035 = SHUFPSrr %reg1083, %reg1083, 255
- %reg1033 = SHUFPSrr %reg1083, %reg1083, 85
- %reg1040 = MOV32rr %reg1039
- %reg1084 = AND32ri8 %reg1039, 15
- CMP32ri8 %reg1084, 0
- JE mbb<cond_next204,0xa914d30>
-
-Still ok. After register allocation:
-
-cond_next140 (0xa910740, LLVM BB @0xa90beb0):
- %EAX = MOV32ri -3
- %EDX = MOV32rm <fi#3>, 1, %NOREG, 0
- ADD32rm %EAX<def&use>, %EDX, 1, %NOREG, 0
- %EDX = MOV32rm <fi#7>, 1, %NOREG, 0
- %EDX = MOV32rm %EDX, 1, %NOREG, 40
- IMUL32rr %EAX<def&use>, %EDX
- %ESI = MOV32rm <fi#5>, 1, %NOREG, 0
- %ESI = MOV32rm %ESI, 1, %NOREG, 0
- MOV32mr <fi#4>, 1, %NOREG, 0, %ESI
- %EAX = LEA32r %ESI, 1, %EAX, -3
- %ESI = MOV32rm <fi#7>, 1, %NOREG, 0
- %ESI = MOV32rm %ESI, 1, %NOREG, 32
- %EDI = MOV32rr %EAX
- SHL32ri %EDI<def&use>, 4
- ADD32rr %EDI<def&use>, %ESI
- %XMM0 = MOVAPSrm %ECX, 1, %NOREG, 0
- %XMM1 = MOVAPSrr %XMM0
- SHUFPSrr %XMM1<def&use>, %XMM1, 170
- %XMM2 = MOVAPSrr %XMM0
- SHUFPSrr %XMM2<def&use>, %XMM2, 0
- %XMM3 = MOVAPSrr %XMM0
- SHUFPSrr %XMM3<def&use>, %XMM3, 255
- SHUFPSrr %XMM0<def&use>, %XMM0, 85
- %EBX = MOV32rr %EDI
- AND32ri8 %EBX<def&use>, 15
- CMP32ri8 %EBX, 0
- JE mbb<cond_next204,0xa914d30>
-
-This looks really bad. The problem is shufps is a destructive opcode. Since it
-appears as operand two in more than one shufps ops. It resulted in a number of
-copies. Note icc also suffers from the same problem. Either the instruction
-selector should select pshufd or The register allocator can made the two-address
-to three-address transformation.
-
-It also exposes some other problems. See MOV32ri -3 and the spills.
-
-//===---------------------------------------------------------------------===//
-
-http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25500
-
-LLVM is producing bad code.
-
-LBB_main_4: # cond_true44
- addps %xmm1, %xmm2
- subps %xmm3, %xmm2
- movaps (%ecx), %xmm4
- movaps %xmm2, %xmm1
- addps %xmm4, %xmm1
- addl $16, %ecx
- incl %edx
- cmpl $262144, %edx
- movaps %xmm3, %xmm2
- movaps %xmm4, %xmm3
- jne LBB_main_4 # cond_true44
-
-There are two problems. 1) No need to two loop induction variables. We can
-compare against 262144 * 16. 2) Known register coalescer issue. We should
-be able eliminate one of the movaps:
-
- addps %xmm2, %xmm1 <=== Commute!
- subps %xmm3, %xmm1
- movaps (%ecx), %xmm4
- movaps %xmm1, %xmm1 <=== Eliminate!
- addps %xmm4, %xmm1
- addl $16, %ecx
- incl %edx
- cmpl $262144, %edx
- movaps %xmm3, %xmm2
- movaps %xmm4, %xmm3
- jne LBB_main_4 # cond_true44
-
-//===---------------------------------------------------------------------===//
-
-Consider:
-
-__m128 test(float a) {
- return _mm_set_ps(0.0, 0.0, 0.0, a*a);
-}
-
-This compiles into:
-
-movss 4(%esp), %xmm1
-mulss %xmm1, %xmm1
-xorps %xmm0, %xmm0
-movss %xmm1, %xmm0
-ret
-
-Because mulss doesn't modify the top 3 elements, the top elements of
-xmm1 are already zero'd. We could compile this to:
-
-movss 4(%esp), %xmm0
-mulss %xmm0, %xmm0
-ret
-
-//===---------------------------------------------------------------------===//
-
-Here's a sick and twisted idea. Consider code like this:
-
-__m128 test(__m128 a) {
- float b = *(float*)&A;
- ...
- return _mm_set_ps(0.0, 0.0, 0.0, b);
-}
-
-This might compile to this code:
-
-movaps c(%esp), %xmm1
-xorps %xmm0, %xmm0
-movss %xmm1, %xmm0
-ret
-
-Now consider if the ... code caused xmm1 to get spilled. This might produce
-this code:
-
-movaps c(%esp), %xmm1
-movaps %xmm1, c2(%esp)
-...
-
-xorps %xmm0, %xmm0
-movaps c2(%esp), %xmm1
-movss %xmm1, %xmm0
-ret
-
-However, since the reload is only used by these instructions, we could
-"fold" it into the uses, producing something like this:
-
-movaps c(%esp), %xmm1
-movaps %xmm1, c2(%esp)
-...
-
-movss c2(%esp), %xmm0
-ret
-
-... saving two instructions.
-
-The basic idea is that a reload from a spill slot, can, if only one 4-byte
-chunk is used, bring in 3 zeros the the one element instead of 4 elements.
-This can be used to simplify a variety of shuffle operations, where the
-elements are fixed zeros.
-
-//===---------------------------------------------------------------------===//
-
-For this:
-
-#include <emmintrin.h>
-void test(__m128d *r, __m128d *A, double B) {
- *r = _mm_loadl_pd(*A, &B);
-}
-
-We generates:
-
- subl $12, %esp
- movsd 24(%esp), %xmm0
- movsd %xmm0, (%esp)
- movl 20(%esp), %eax
- movapd (%eax), %xmm0
- movlpd (%esp), %xmm0
- movl 16(%esp), %eax
- movapd %xmm0, (%eax)
- addl $12, %esp
- ret
-
-icc generates:
-
- movl 4(%esp), %edx #3.6
- movl 8(%esp), %eax #3.6
- movapd (%eax), %xmm0 #4.22
- movlpd 12(%esp), %xmm0 #4.8
- movapd %xmm0, (%edx) #4.3
- ret #5.1
-
-So icc is smart enough to know that B is in memory so it doesn't load it and
-store it back to stack.
-
-This should be fixed by eliminating the llvm.x86.sse2.loadl.pd intrinsic,
-lowering it to a load+insertelement instead. Already match the load+shuffle
-as movlpd, so this should be easy. We already get optimal code for:
-
-define void @test2(<2 x double>* %r, <2 x double>* %A, double %B) {
-entry:
- %tmp2 = load <2 x double>* %A, align 16
- %tmp8 = insertelement <2 x double> %tmp2, double %B, i32 0
- store <2 x double> %tmp8, <2 x double>* %r, align 16
- ret void
-}
-
-//===---------------------------------------------------------------------===//
-
-Consider (PR2108):
-
-#include <xmmintrin.h>
-__m128i doload64(unsigned long long x) { return _mm_loadl_epi64(&x);}
-__m128i doload64_2(unsigned long long *x) { return _mm_loadl_epi64(x);}
-
-These are very similar routines, but we generate significantly worse code for
-the first one on x86-32:
-
-_doload64:
- subl $12, %esp
- movl 20(%esp), %eax
- movl %eax, 4(%esp)
- movl 16(%esp), %eax
- movl %eax, (%esp)
- movsd (%esp), %xmm0
- addl $12, %esp
- ret
-_doload64_2:
- movl 4(%esp), %eax
- movsd (%eax), %xmm0
- ret
-
-The problem is that the argument lowering logic splits the i64 argument into
-2x i32 loads early, the f64 insert doesn't match. Here's a reduced testcase:
-
-define fastcc double @doload64(i64 %x) nounwind {
-entry:
- %tmp717 = bitcast i64 %x to double ; <double> [#uses=1]
- ret double %tmp717
-}
-
-compiles to:
-
-_doload64:
- subl $12, %esp
- movl 20(%esp), %eax
- movl %eax, 4(%esp)
- movl 16(%esp), %eax
- movl %eax, (%esp)
- movsd (%esp), %xmm0
- addl $12, %esp
- ret
-
-instead of movsd from the stack. This is actually not too bad to implement. The
-best way to do this is to implement a dag combine that turns
-bitconvert(build_pair(load a, load b)) into one load of the right type. The
-only trick to this is writing the predicate that determines that a/b are at the
-right offset from each other. For the enterprising hacker, InferAlignment is a
-helpful place to start poking if interested.
-
-
-//===---------------------------------------------------------------------===//
-
-__m128d test1( __m128d A, __m128d B) {
- return _mm_shuffle_pd(A, B, 0x3);
-}
-
-compiles to
-
-shufpd $3, %xmm1, %xmm0
-
-Perhaps it's better to use unpckhpd instead?
-
-unpckhpd %xmm1, %xmm0
-
-Don't know if unpckhpd is faster. But it is shorter.
-
-//===---------------------------------------------------------------------===//
-
-This code generates ugly code, probably due to costs being off or something:
-
-define void @test(float* %P, <4 x float>* %P2 ) {
- %xFloat0.688 = load float* %P
- %tmp = load <4 x float>* %P2
- %inFloat3.713 = insertelement <4 x float> %tmp, float 0.0, i32 3
- store <4 x float> %inFloat3.713, <4 x float>* %P2
- ret void
-}
-
-Generates:
-
-_test:
- movl 8(%esp), %eax
- movaps (%eax), %xmm0
- pxor %xmm1, %xmm1
- movaps %xmm0, %xmm2
- shufps $50, %xmm1, %xmm2
- shufps $132, %xmm2, %xmm0
- movaps %xmm0, (%eax)
- ret
-
-Would it be better to generate:
-
-_test:
- movl 8(%esp), %ecx
- movaps (%ecx), %xmm0
- xor %eax, %eax
- pinsrw $6, %eax, %xmm0
- pinsrw $7, %eax, %xmm0
- movaps %xmm0, (%ecx)
- ret
-
-?
-
-//===---------------------------------------------------------------------===//
-
-Some useful information in the Apple Altivec / SSE Migration Guide:
-
-http://developer.apple.com/documentation/Performance/Conceptual/
-Accelerate_sse_migration/index.html
-
-e.g. SSE select using and, andnot, or. Various SSE compare translations.
-
-//===---------------------------------------------------------------------===//
-
-Add hooks to commute some CMPP operations.
-
-//===---------------------------------------------------------------------===//
-
-Apply the same transformation that merged four float into a single 128-bit load
-to loads from constant pool.
-
-//===---------------------------------------------------------------------===//
-
-Floating point max / min are commutable when -enable-unsafe-fp-path is
-specified. We should turn int_x86_sse_max_ss and X86ISD::FMIN etc. into other
-nodes which are selected to max / min instructions that are marked commutable.
-
-//===---------------------------------------------------------------------===//
-
-We should compile this:
-#include <xmmintrin.h>
-typedef union {
- int i[4];
- float f[4];
- __m128 v;
-} vector4_t;
-void swizzle (const void *a, vector4_t * b, vector4_t * c) {
- b->v = _mm_loadl_pi (b->v, (__m64 *) a);
- c->v = _mm_loadl_pi (c->v, ((__m64 *) a) + 1);
-}
-
-to:
-
-_swizzle:
- movl 4(%esp), %eax
- movl 8(%esp), %edx
- movl 12(%esp), %ecx
- movlps (%eax), %xmm0
- movlps %xmm0, (%edx)
- movlps 8(%eax), %xmm0
- movlps %xmm0, (%ecx)
- ret
-
-not:
-
-swizzle:
- movl 8(%esp), %eax
- movaps (%eax), %xmm0
- movl 4(%esp), %ecx
- movlps (%ecx), %xmm0
- movaps %xmm0, (%eax)
- movl 12(%esp), %eax
- movaps (%eax), %xmm0
- movlps 8(%ecx), %xmm0
- movaps %xmm0, (%eax)
- ret
-
-//===---------------------------------------------------------------------===//
-
-These functions should produce the same code:
-
-#include <emmintrin.h>
-
-typedef long long __m128i __attribute__ ((__vector_size__ (16)));
-
-int foo(__m128i* val) {
- return __builtin_ia32_vec_ext_v4si(*val, 1);
-}
-int bar(__m128i* val) {
- union vs {
- __m128i *_v;
- int* _s;
- } v = {val};
- return v._s[1];
-}
-
-We currently produce (with -m64):
-
-_foo:
- pshufd $1, (%rdi), %xmm0
- movd %xmm0, %eax
- ret
-_bar:
- movl 4(%rdi), %eax
- ret
-
-//===---------------------------------------------------------------------===//
-
-We should materialize vector constants like "all ones" and "signbit" with
-code like:
-
- cmpeqps xmm1, xmm1 ; xmm1 = all-ones
-
-and:
- cmpeqps xmm1, xmm1 ; xmm1 = all-ones
- psrlq xmm1, 31 ; xmm1 = all 100000000000...
-
-instead of using a load from the constant pool. The later is important for
-ABS/NEG/copysign etc.
-
-//===---------------------------------------------------------------------===//
-
-These functions:
-
-#include <xmmintrin.h>
-__m128i a;
-void x(unsigned short n) {
- a = _mm_slli_epi32 (a, n);
-}
-void y(unsigned n) {
- a = _mm_slli_epi32 (a, n);
-}
-
-compile to ( -O3 -static -fomit-frame-pointer):
-_x:
- movzwl 4(%esp), %eax
- movd %eax, %xmm0
- movaps _a, %xmm1
- pslld %xmm0, %xmm1
- movaps %xmm1, _a
- ret
-_y:
- movd 4(%esp), %xmm0
- movaps _a, %xmm1
- pslld %xmm0, %xmm1
- movaps %xmm1, _a
- ret
-
-"y" looks good, but "x" does silly movzwl stuff around into a GPR. It seems
-like movd would be sufficient in both cases as the value is already zero
-extended in the 32-bit stack slot IIRC. For signed short, it should also be
-save, as a really-signed value would be undefined for pslld.
-
-
-//===---------------------------------------------------------------------===//
-
-#include <math.h>
-int t1(double d) { return signbit(d); }
-
-This currently compiles to:
- subl $12, %esp
- movsd 16(%esp), %xmm0
- movsd %xmm0, (%esp)
- movl 4(%esp), %eax
- shrl $31, %eax
- addl $12, %esp
- ret
-
-We should use movmskp{s|d} instead.
-
-//===---------------------------------------------------------------------===//
-
-CodeGen/X86/vec_align.ll tests whether we can turn 4 scalar loads into a single
-(aligned) vector load. This functionality has a couple of problems.
-
-1. The code to infer alignment from loads of globals is in the X86 backend,
- not the dag combiner. This is because dagcombine2 needs to be able to see
- through the X86ISD::Wrapper node, which DAGCombine can't really do.
-2. The code for turning 4 x load into a single vector load is target
- independent and should be moved to the dag combiner.
-3. The code for turning 4 x load into a vector load can only handle a direct
- load from a global or a direct load from the stack. It should be generalized
- to handle any load from P, P+4, P+8, P+12, where P can be anything.
-4. The alignment inference code cannot handle loads from globals in non-static
- mode because it doesn't look through the extra dyld stub load. If you try
- vec_align.ll without -relocation-model=static, you'll see what I mean.
-
-//===---------------------------------------------------------------------===//
-
-We should lower store(fneg(load p), q) into an integer load+xor+store, which
-eliminates a constant pool load. For example, consider:
-
-define i64 @ccosf(float %z.0, float %z.1) nounwind readonly {
-entry:
- %tmp6 = sub float -0.000000e+00, %z.1 ; <float> [#uses=1]
- %tmp20 = tail call i64 @ccoshf( float %tmp6, float %z.0 ) nounwind readonly
- ret i64 %tmp20
-}
-
-This currently compiles to:
-
-LCPI1_0: # <4 x float>
- .long 2147483648 # float -0
- .long 2147483648 # float -0
- .long 2147483648 # float -0
- .long 2147483648 # float -0
-_ccosf:
- subl $12, %esp
- movss 16(%esp), %xmm0
- movss %xmm0, 4(%esp)
- movss 20(%esp), %xmm0
- xorps LCPI1_0, %xmm0
- movss %xmm0, (%esp)
- call L_ccoshf$stub
- addl $12, %esp
- ret
-
-Note the load into xmm0, then xor (to negate), then store. In PIC mode,
-this code computes the pic base and does two loads to do the constant pool
-load, so the improvement is much bigger.
-
-The tricky part about this xform is that the argument load/store isn't exposed
-until post-legalize, and at that point, the fneg has been custom expanded into
-an X86 fxor. This means that we need to handle this case in the x86 backend
-instead of in target independent code.
-
-//===---------------------------------------------------------------------===//
-
-Non-SSE4 insert into 16 x i8 is atrociously bad.
-
-//===---------------------------------------------------------------------===//
-
-<2 x i64> extract is substantially worse than <2 x f64>, even if the destination
-is memory.
-
-//===---------------------------------------------------------------------===//
-
-SSE4 extract-to-mem ops aren't being pattern matched because of the AssertZext
-sitting between the truncate and the extract.
-
-//===---------------------------------------------------------------------===//
-
-INSERTPS can match any insert (extract, imm1), imm2 for 4 x float, and insert
-any number of 0.0 simultaneously. Currently we only use it for simple
-insertions.
-
-See comments in LowerINSERT_VECTOR_ELT_SSE4.
-
-//===---------------------------------------------------------------------===//
-
-On a random note, SSE2 should declare insert/extract of 2 x f64 as legal, not
-Custom. All combinations of insert/extract reg-reg, reg-mem, and mem-reg are
-legal, it'll just take a few extra patterns written in the .td file.
-
-Note: this is not a code quality issue; the custom lowered code happens to be
-right, but we shouldn't have to custom lower anything. This is probably related
-to <2 x i64> ops being so bad.
-
-//===---------------------------------------------------------------------===//
-
-'select' on vectors and scalars could be a whole lot better. We currently
-lower them to conditional branches. On x86-64 for example, we compile this:
-
-double test(double a, double b, double c, double d) { return a<b ? c : d; }
-
-to:
-
-_test:
- ucomisd %xmm0, %xmm1
- ja LBB1_2 # entry
-LBB1_1: # entry
- movapd %xmm3, %xmm2
-LBB1_2: # entry
- movapd %xmm2, %xmm0
- ret
-
-instead of:
-
-_test:
- cmpltsd %xmm1, %xmm0
- andpd %xmm0, %xmm2
- andnpd %xmm3, %xmm0
- orpd %xmm2, %xmm0
- ret
-
-For unpredictable branches, the later is much more efficient. This should
-just be a matter of having scalar sse map to SELECT_CC and custom expanding
-or iseling it.
-
-//===---------------------------------------------------------------------===//
-
-Take the following code:
-
-#include <xmmintrin.h>
-__m128i doload64(short x) {return _mm_set_epi16(x,x,x,x,x,x,x,x);}
-
-LLVM currently generates the following on x86:
-doload64:
- movzwl 4(%esp), %eax
- movd %eax, %xmm0
- punpcklwd %xmm0, %xmm0
- pshufd $0, %xmm0, %xmm0
- ret
-
-gcc's generated code:
-doload64:
- movd 4(%esp), %xmm0
- punpcklwd %xmm0, %xmm0
- pshufd $0, %xmm0, %xmm0
- ret
-
-LLVM should be able to generate the same thing as gcc. This looks like it is
-just a matter of matching (scalar_to_vector (load x)) to movd.
-
-//===---------------------------------------------------------------------===//
diff --git a/release_23/lib/Target/X86/README-X86-64.txt b/release_23/lib/Target/X86/README-X86-64.txt
deleted file mode 100644
index 594a66f832b6..000000000000
--- a/release_23/lib/Target/X86/README-X86-64.txt
+++ /dev/null
@@ -1,259 +0,0 @@
-//===- README_X86_64.txt - Notes for X86-64 code gen ----------------------===//
-
-Implement different PIC models? Right now we only support Mac OS X with small
-PIC code model.
-
-//===---------------------------------------------------------------------===//
-
-Make use of "Red Zone".
-
-//===---------------------------------------------------------------------===//
-
-Implement __int128 and long double support.
-
-//===---------------------------------------------------------------------===//
-
-For this:
-
-extern void xx(void);
-void bar(void) {
- xx();
-}
-
-gcc compiles to:
-
-.globl _bar
-_bar:
- jmp _xx
-
-We need to do the tailcall optimization as well.
-
-//===---------------------------------------------------------------------===//
-
-AMD64 Optimization Manual 8.2 has some nice information about optimizing integer
-multiplication by a constant. How much of it applies to Intel's X86-64
-implementation? There are definite trade-offs to consider: latency vs. register
-pressure vs. code size.
-
-//===---------------------------------------------------------------------===//
-
-Are we better off using branches instead of cmove to implement FP to
-unsigned i64?
-
-_conv:
- ucomiss LC0(%rip), %xmm0
- cvttss2siq %xmm0, %rdx
- jb L3
- subss LC0(%rip), %xmm0
- movabsq $-9223372036854775808, %rax
- cvttss2siq %xmm0, %rdx
- xorq %rax, %rdx
-L3:
- movq %rdx, %rax
- ret
-
-instead of
-
-_conv:
- movss LCPI1_0(%rip), %xmm1
- cvttss2siq %xmm0, %rcx
- movaps %xmm0, %xmm2
- subss %xmm1, %xmm2
- cvttss2siq %xmm2, %rax
- movabsq $-9223372036854775808, %rdx
- xorq %rdx, %rax
- ucomiss %xmm1, %xmm0
- cmovb %rcx, %rax
- ret
-
-Seems like the jb branch has high likelyhood of being taken. It would have
-saved a few instructions.
-
-//===---------------------------------------------------------------------===//
-
-Poor codegen:
-
-int X[2];
-int b;
-void test(void) {
- memset(X, b, 2*sizeof(X[0]));
-}
-
-llc:
- movq _b@GOTPCREL(%rip), %rax
- movzbq (%rax), %rax
- movq %rax, %rcx
- shlq $8, %rcx
- orq %rax, %rcx
- movq %rcx, %rax
- shlq $16, %rax
- orq %rcx, %rax
- movq %rax, %rcx
- shlq $32, %rcx
- movq _X@GOTPCREL(%rip), %rdx
- orq %rax, %rcx
- movq %rcx, (%rdx)
- ret
-
-gcc:
- movq _b@GOTPCREL(%rip), %rax
- movabsq $72340172838076673, %rdx
- movzbq (%rax), %rax
- imulq %rdx, %rax
- movq _X@GOTPCREL(%rip), %rdx
- movq %rax, (%rdx)
- ret
-
-//===---------------------------------------------------------------------===//
-
-Vararg function prologue can be further optimized. Currently all XMM registers
-are stored into register save area. Most of them can be eliminated since the
-upper bound of the number of XMM registers used are passed in %al. gcc produces
-something like the following:
-
- movzbl %al, %edx
- leaq 0(,%rdx,4), %rax
- leaq 4+L2(%rip), %rdx
- leaq 239(%rsp), %rax
- jmp *%rdx
- movaps %xmm7, -15(%rax)
- movaps %xmm6, -31(%rax)
- movaps %xmm5, -47(%rax)
- movaps %xmm4, -63(%rax)
- movaps %xmm3, -79(%rax)
- movaps %xmm2, -95(%rax)
- movaps %xmm1, -111(%rax)
- movaps %xmm0, -127(%rax)
-L2:
-
-It jumps over the movaps that do not need to be stored. Hard to see this being
-significant as it added 5 instruciton (including a indirect branch) to avoid
-executing 0 to 8 stores in the function prologue.
-
-Perhaps we can optimize for the common case where no XMM registers are used for
-parameter passing. i.e. is %al == 0 jump over all stores. Or in the case of a
-leaf function where we can determine that no XMM input parameter is need, avoid
-emitting the stores at all.
-
-//===---------------------------------------------------------------------===//
-
-AMD64 has a complex calling convention for aggregate passing by value:
-
-1. If the size of an object is larger than two eightbytes, or in C++, is a non-
- POD structure or union type, or contains unaligned fields, it has class
- MEMORY.
-2. Both eightbytes get initialized to class NO_CLASS.
-3. Each field of an object is classified recursively so that always two fields
- are considered. The resulting class is calculated according to the classes
- of the fields in the eightbyte:
- (a) If both classes are equal, this is the resulting class.
- (b) If one of the classes is NO_CLASS, the resulting class is the other
- class.
- (c) If one of the classes is MEMORY, the result is the MEMORY class.
- (d) If one of the classes is INTEGER, the result is the INTEGER.
- (e) If one of the classes is X87, X87UP, COMPLEX_X87 class, MEMORY is used as
- class.
- (f) Otherwise class SSE is used.
-4. Then a post merger cleanup is done:
- (a) If one of the classes is MEMORY, the whole argument is passed in memory.
- (b) If SSEUP is not preceeded by SSE, it is converted to SSE.
-
-Currently llvm frontend does not handle this correctly.
-
-Problem 1:
- typedef struct { int i; double d; } QuadWordS;
-It is currently passed in two i64 integer registers. However, gcc compiled
-callee expects the second element 'd' to be passed in XMM0.
-
-Problem 2:
- typedef struct { int32_t i; float j; double d; } QuadWordS;
-The size of the first two fields == i64 so they will be combined and passed in
-a integer register RDI. The third field is still passed in XMM0.
-
-Problem 3:
- typedef struct { int64_t i; int8_t j; int64_t d; } S;
- void test(S s)
-The size of this aggregate is greater than two i64 so it should be passed in
-memory. Currently llvm breaks this down and passed it in three integer
-registers.
-
-Problem 4:
-Taking problem 3 one step ahead where a function expects a aggregate value
-in memory followed by more parameter(s) passed in register(s).
- void test(S s, int b)
-
-LLVM IR does not allow parameter passing by aggregates, therefore it must break
-the aggregates value (in problem 3 and 4) into a number of scalar values:
- void %test(long %s.i, byte %s.j, long %s.d);
-
-However, if the backend were to lower this code literally it would pass the 3
-values in integer registers. To force it be passed in memory, the frontend
-should change the function signiture to:
- void %test(long %undef1, long %undef2, long %undef3, long %undef4,
- long %undef5, long %undef6,
- long %s.i, byte %s.j, long %s.d);
-And the callee would look something like this:
- call void %test( undef, undef, undef, undef, undef, undef,
- %tmp.s.i, %tmp.s.j, %tmp.s.d );
-The first 6 undef parameters would exhaust the 6 integer registers used for
-parameter passing. The following three integer values would then be forced into
-memory.
-
-For problem 4, the parameter 'd' would be moved to the front of the parameter
-list so it will be passed in register:
- void %test(int %d,
- long %undef1, long %undef2, long %undef3, long %undef4,
- long %undef5, long %undef6,
- long %s.i, byte %s.j, long %s.d);
-
-//===---------------------------------------------------------------------===//
-
-Right now the asm printer assumes GlobalAddress are accessed via RIP relative
-addressing. Therefore, it is not possible to generate this:
- movabsq $__ZTV10polynomialIdE+16, %rax
-
-That is ok for now since we currently only support small model. So the above
-is selected as
- leaq __ZTV10polynomialIdE+16(%rip), %rax
-
-This is probably slightly slower but is much shorter than movabsq. However, if
-we were to support medium or larger code models, we need to use the movabs
-instruction. We should probably introduce something like AbsoluteAddress to
-distinguish it from GlobalAddress so the asm printer and JIT code emitter can
-do the right thing.
-
-//===---------------------------------------------------------------------===//
-
-It's not possible to reference AH, BH, CH, and DH registers in an instruction
-requiring REX prefix. However, divb and mulb both produce results in AH. If isel
-emits a CopyFromReg which gets turned into a movb and that can be allocated a
-r8b - r15b.
-
-To get around this, isel emits a CopyFromReg from AX and then right shift it
-down by 8 and truncate it. It's not pretty but it works. We need some register
-allocation magic to make the hack go away (e.g. putting additional constraints
-on the result of the movb).
-
-//===---------------------------------------------------------------------===//
-
-The x86-64 ABI for hidden-argument struct returns requires that the
-incoming value of %rdi be copied into %rax by the callee upon return.
-
-The idea is that it saves callers from having to remember this value,
-which would often require a callee-saved register. Callees usually
-need to keep this value live for most of their body anyway, so it
-doesn't add a significant burden on them.
-
-We currently implement this in codegen, however this is suboptimal
-because it means that it would be quite awkward to implement the
-optimization for callers.
-
-A better implementation would be to relax the LLVM IR rules for sret
-arguments to allow a function with an sret argument to have a non-void
-return type, and to have the front-end to set up the sret argument value
-as the return value of the function. The front-end could more easily
-emit uses of the returned struct value to be in terms of the function's
-lowered return value, and it would free non-C frontends from a
-complication only required by a C-based ABI.
-
-//===---------------------------------------------------------------------===//
diff --git a/release_23/lib/Target/X86/README.txt b/release_23/lib/Target/X86/README.txt
deleted file mode 100644
index 6f6abd478dbf..000000000000
--- a/release_23/lib/Target/X86/README.txt
+++ /dev/null
@@ -1,1711 +0,0 @@
-//===---------------------------------------------------------------------===//
-// Random ideas for the X86 backend.
-//===---------------------------------------------------------------------===//
-
-
-//===---------------------------------------------------------------------===//
-
-CodeGen/X86/lea-3.ll:test3 should be a single LEA, not a shift/move. The X86
-backend knows how to three-addressify this shift, but it appears the register
-allocator isn't even asking it to do so in this case. We should investigate
-why this isn't happening, it could have significant impact on other important
-cases for X86 as well.
-
-//===---------------------------------------------------------------------===//
-
-This should be one DIV/IDIV instruction, not a libcall:
-
-unsigned test(unsigned long long X, unsigned Y) {
- return X/Y;
-}
-
-This can be done trivially with a custom legalizer. What about overflow
-though? http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14224
-
-//===---------------------------------------------------------------------===//
-
-Improvements to the multiply -> shift/add algorithm:
-http://gcc.gnu.org/ml/gcc-patches/2004-08/msg01590.html
-
-//===---------------------------------------------------------------------===//
-
-Improve code like this (occurs fairly frequently, e.g. in LLVM):
-long long foo(int x) { return 1LL << x; }
-
-http://gcc.gnu.org/ml/gcc-patches/2004-09/msg01109.html
-http://gcc.gnu.org/ml/gcc-patches/2004-09/msg01128.html
-http://gcc.gnu.org/ml/gcc-patches/2004-09/msg01136.html
-
-Another useful one would be ~0ULL >> X and ~0ULL << X.
-
-One better solution for 1LL << x is:
- xorl %eax, %eax
- xorl %edx, %edx
- testb $32, %cl
- sete %al
- setne %dl
- sall %cl, %eax
- sall %cl, %edx
-
-But that requires good 8-bit subreg support.
-
-Also, this might be better. It's an extra shift, but it's one instruction
-shorter, and doesn't stress 8-bit subreg support.
-(From http://gcc.gnu.org/ml/gcc-patches/2004-09/msg01148.html,
-but without the unnecessary and.)
- movl %ecx, %eax
- shrl $5, %eax
- movl %eax, %edx
- xorl $1, %edx
- sall %cl, %eax
- sall %cl. %edx
-
-64-bit shifts (in general) expand to really bad code. Instead of using
-cmovs, we should expand to a conditional branch like GCC produces.
-
-//===---------------------------------------------------------------------===//
-
-Compile this:
-_Bool f(_Bool a) { return a!=1; }
-
-into:
- movzbl %dil, %eax
- xorl $1, %eax
- ret
-
-(Although note that this isn't a legal way to express the code that llvm-gcc
-currently generates for that function.)
-
-//===---------------------------------------------------------------------===//
-
-Some isel ideas:
-
-1. Dynamic programming based approach when compile time if not an
- issue.
-2. Code duplication (addressing mode) during isel.
-3. Other ideas from "Register-Sensitive Selection, Duplication, and
- Sequencing of Instructions".
-4. Scheduling for reduced register pressure. E.g. "Minimum Register
- Instruction Sequence Problem: Revisiting Optimal Code Generation for DAGs"
- and other related papers.
- http://citeseer.ist.psu.edu/govindarajan01minimum.html
-
-//===---------------------------------------------------------------------===//
-
-Should we promote i16 to i32 to avoid partial register update stalls?
-
-//===---------------------------------------------------------------------===//
-
-Leave any_extend as pseudo instruction and hint to register
-allocator. Delay codegen until post register allocation.
-Note. any_extend is now turned into an INSERT_SUBREG. We still need to teach
-the coalescer how to deal with it though.
-
-//===---------------------------------------------------------------------===//
-
-It appears icc use push for parameter passing. Need to investigate.
-
-//===---------------------------------------------------------------------===//
-
-Only use inc/neg/not instructions on processors where they are faster than
-add/sub/xor. They are slower on the P4 due to only updating some processor
-flags.
-
-//===---------------------------------------------------------------------===//
-
-The instruction selector sometimes misses folding a load into a compare. The
-pattern is written as (cmp reg, (load p)). Because the compare isn't
-commutative, it is not matched with the load on both sides. The dag combiner
-should be made smart enough to cannonicalize the load into the RHS of a compare
-when it can invert the result of the compare for free.
-
-//===---------------------------------------------------------------------===//
-
-How about intrinsics? An example is:
- *res = _mm_mulhi_epu16(*A, _mm_mul_epu32(*B, *C));
-
-compiles to
- pmuludq (%eax), %xmm0
- movl 8(%esp), %eax
- movdqa (%eax), %xmm1
- pmulhuw %xmm0, %xmm1
-
-The transformation probably requires a X86 specific pass or a DAG combiner
-target specific hook.
-
-//===---------------------------------------------------------------------===//
-
-In many cases, LLVM generates code like this:
-
-_test:
- movl 8(%esp), %eax
- cmpl %eax, 4(%esp)
- setl %al
- movzbl %al, %eax
- ret
-
-on some processors (which ones?), it is more efficient to do this:
-
-_test:
- movl 8(%esp), %ebx
- xor %eax, %eax
- cmpl %ebx, 4(%esp)
- setl %al
- ret
-
-Doing this correctly is tricky though, as the xor clobbers the flags.
-
-//===---------------------------------------------------------------------===//
-
-We should generate bts/btr/etc instructions on targets where they are cheap or
-when codesize is important. e.g., for:
-
-void setbit(int *target, int bit) {
- *target |= (1 << bit);
-}
-void clearbit(int *target, int bit) {
- *target &= ~(1 << bit);
-}
-
-//===---------------------------------------------------------------------===//
-
-Instead of the following for memset char*, 1, 10:
-
- movl $16843009, 4(%edx)
- movl $16843009, (%edx)
- movw $257, 8(%edx)
-
-It might be better to generate
-
- movl $16843009, %eax
- movl %eax, 4(%edx)
- movl %eax, (%edx)
- movw al, 8(%edx)
-
-when we can spare a register. It reduces code size.
-
-//===---------------------------------------------------------------------===//
-
-Evaluate what the best way to codegen sdiv X, (2^C) is. For X/8, we currently
-get this:
-
-define i32 @test1(i32 %X) {
- %Y = sdiv i32 %X, 8
- ret i32 %Y
-}
-
-_test1:
- movl 4(%esp), %eax
- movl %eax, %ecx
- sarl $31, %ecx
- shrl $29, %ecx
- addl %ecx, %eax
- sarl $3, %eax
- ret
-
-GCC knows several different ways to codegen it, one of which is this:
-
-_test1:
- movl 4(%esp), %eax
- cmpl $-1, %eax
- leal 7(%eax), %ecx
- cmovle %ecx, %eax
- sarl $3, %eax
- ret
-
-which is probably slower, but it's interesting at least :)
-
-//===---------------------------------------------------------------------===//
-
-We are currently lowering large (1MB+) memmove/memcpy to rep/stosl and rep/movsl
-We should leave these as libcalls for everything over a much lower threshold,
-since libc is hand tuned for medium and large mem ops (avoiding RFO for large
-stores, TLB preheating, etc)
-
-//===---------------------------------------------------------------------===//
-
-Optimize this into something reasonable:
- x * copysign(1.0, y) * copysign(1.0, z)
-
-//===---------------------------------------------------------------------===//
-
-Optimize copysign(x, *y) to use an integer load from y.
-
-//===---------------------------------------------------------------------===//
-
-%X = weak global int 0
-
-void %foo(int %N) {
- %N = cast int %N to uint
- %tmp.24 = setgt int %N, 0
- br bool %tmp.24, label %no_exit, label %return
-
-no_exit:
- %indvar = phi uint [ 0, %entry ], [ %indvar.next, %no_exit ]
- %i.0.0 = cast uint %indvar to int
- volatile store int %i.0.0, int* %X
- %indvar.next = add uint %indvar, 1
- %exitcond = seteq uint %indvar.next, %N
- br bool %exitcond, label %return, label %no_exit
-
-return:
- ret void
-}
-
-compiles into:
-
- .text
- .align 4
- .globl _foo
-_foo:
- movl 4(%esp), %eax
- cmpl $1, %eax
- jl LBB_foo_4 # return
-LBB_foo_1: # no_exit.preheader
- xorl %ecx, %ecx
-LBB_foo_2: # no_exit
- movl L_X$non_lazy_ptr, %edx
- movl %ecx, (%edx)
- incl %ecx
- cmpl %eax, %ecx
- jne LBB_foo_2 # no_exit
-LBB_foo_3: # return.loopexit
-LBB_foo_4: # return
- ret
-
-We should hoist "movl L_X$non_lazy_ptr, %edx" out of the loop after
-remateralization is implemented. This can be accomplished with 1) a target
-dependent LICM pass or 2) makeing SelectDAG represent the whole function.
-
-//===---------------------------------------------------------------------===//
-
-The following tests perform worse with LSR:
-
-lambda, siod, optimizer-eval, ackermann, hash2, nestedloop, strcat, and Treesor.
-
-//===---------------------------------------------------------------------===//
-
-We are generating far worse code than gcc:
-
-volatile short X, Y;
-
-void foo(int N) {
- int i;
- for (i = 0; i < N; i++) { X = i; Y = i*4; }
-}
-
-LBB1_1: # entry.bb_crit_edge
- xorl %ecx, %ecx
- xorw %dx, %dx
-LBB1_2: # bb
- movl L_X$non_lazy_ptr, %esi
- movw %cx, (%esi)
- movl L_Y$non_lazy_ptr, %esi
- movw %dx, (%esi)
- addw $4, %dx
- incl %ecx
- cmpl %eax, %ecx
- jne LBB1_2 # bb
-
-vs.
-
- xorl %edx, %edx
- movl L_X$non_lazy_ptr-"L00000000001$pb"(%ebx), %esi
- movl L_Y$non_lazy_ptr-"L00000000001$pb"(%ebx), %ecx
-L4:
- movw %dx, (%esi)
- leal 0(,%edx,4), %eax
- movw %ax, (%ecx)
- addl $1, %edx
- cmpl %edx, %edi
- jne L4
-
-This is due to the lack of post regalloc LICM.
-
-//===---------------------------------------------------------------------===//
-
-Teach the coalescer to coalesce vregs of different register classes. e.g. FR32 /
-FR64 to VR128.
-
-//===---------------------------------------------------------------------===//
-
-Adding to the list of cmp / test poor codegen issues:
-
-int test(__m128 *A, __m128 *B) {
- if (_mm_comige_ss(*A, *B))
- return 3;
- else
- return 4;
-}
-
-_test:
- movl 8(%esp), %eax
- movaps (%eax), %xmm0
- movl 4(%esp), %eax
- movaps (%eax), %xmm1
- comiss %xmm0, %xmm1
- setae %al
- movzbl %al, %ecx
- movl $3, %eax
- movl $4, %edx
- cmpl $0, %ecx
- cmove %edx, %eax
- ret
-
-Note the setae, movzbl, cmpl, cmove can be replaced with a single cmovae. There
-are a number of issues. 1) We are introducing a setcc between the result of the
-intrisic call and select. 2) The intrinsic is expected to produce a i32 value
-so a any extend (which becomes a zero extend) is added.
-
-We probably need some kind of target DAG combine hook to fix this.
-
-//===---------------------------------------------------------------------===//
-
-We generate significantly worse code for this than GCC:
-http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21150
-http://gcc.gnu.org/bugzilla/attachment.cgi?id=8701
-
-There is also one case we do worse on PPC.
-
-//===---------------------------------------------------------------------===//
-
-If shorter, we should use things like:
-movzwl %ax, %eax
-instead of:
-andl $65535, %EAX
-
-The former can also be used when the two-addressy nature of the 'and' would
-require a copy to be inserted (in X86InstrInfo::convertToThreeAddress).
-
-//===---------------------------------------------------------------------===//
-
-Another instruction selector deficiency:
-
-void %bar() {
- %tmp = load int (int)** %foo
- %tmp = tail call int %tmp( int 3 )
- ret void
-}
-
-_bar:
- subl $12, %esp
- movl L_foo$non_lazy_ptr, %eax
- movl (%eax), %eax
- call *%eax
- addl $12, %esp
- ret
-
-The current isel scheme will not allow the load to be folded in the call since
-the load's chain result is read by the callseq_start.
-
-//===---------------------------------------------------------------------===//
-
-For this:
-
-int test(int a)
-{
- return a * 3;
-}
-
-We currently emits
- imull $3, 4(%esp), %eax
-
-Perhaps this is what we really should generate is? Is imull three or four
-cycles? Note: ICC generates this:
- movl 4(%esp), %eax
- leal (%eax,%eax,2), %eax
-
-The current instruction priority is based on pattern complexity. The former is
-more "complex" because it folds a load so the latter will not be emitted.
-
-Perhaps we should use AddedComplexity to give LEA32r a higher priority? We
-should always try to match LEA first since the LEA matching code does some
-estimate to determine whether the match is profitable.
-
-However, if we care more about code size, then imull is better. It's two bytes
-shorter than movl + leal.
-
-//===---------------------------------------------------------------------===//
-
-__builtin_ffs codegen is messy.
-
-int ffs_(unsigned X) { return __builtin_ffs(X); }
-
-llvm produces:
-ffs_:
- movl 4(%esp), %ecx
- bsfl %ecx, %eax
- movl $32, %edx
- cmove %edx, %eax
- incl %eax
- xorl %edx, %edx
- testl %ecx, %ecx
- cmove %edx, %eax
- ret
-
-vs gcc:
-
-_ffs_:
- movl $-1, %edx
- bsfl 4(%esp), %eax
- cmove %edx, %eax
- addl $1, %eax
- ret
-
-Another example of __builtin_ffs (use predsimplify to eliminate a select):
-
-int foo (unsigned long j) {
- if (j)
- return __builtin_ffs (j) - 1;
- else
- return 0;
-}
-
-//===---------------------------------------------------------------------===//
-
-It appears gcc place string data with linkonce linkage in
-.section __TEXT,__const_coal,coalesced instead of
-.section __DATA,__const_coal,coalesced.
-Take a look at darwin.h, there are other Darwin assembler directives that we
-do not make use of.
-
-//===---------------------------------------------------------------------===//
-
-define i32 @foo(i32* %a, i32 %t) {
-entry:
- br label %cond_true
-
-cond_true: ; preds = %cond_true, %entry
- %x.0.0 = phi i32 [ 0, %entry ], [ %tmp9, %cond_true ] ; <i32> [#uses=3]
- %t_addr.0.0 = phi i32 [ %t, %entry ], [ %tmp7, %cond_true ] ; <i32> [#uses=1]
- %tmp2 = getelementptr i32* %a, i32 %x.0.0 ; <i32*> [#uses=1]
- %tmp3 = load i32* %tmp2 ; <i32> [#uses=1]
- %tmp5 = add i32 %t_addr.0.0, %x.0.0 ; <i32> [#uses=1]
- %tmp7 = add i32 %tmp5, %tmp3 ; <i32> [#uses=2]
- %tmp9 = add i32 %x.0.0, 1 ; <i32> [#uses=2]
- %tmp = icmp sgt i32 %tmp9, 39 ; <i1> [#uses=1]
- br i1 %tmp, label %bb12, label %cond_true
-
-bb12: ; preds = %cond_true
- ret i32 %tmp7
-}
-is pessimized by -loop-reduce and -indvars
-
-//===---------------------------------------------------------------------===//
-
-u32 to float conversion improvement:
-
-float uint32_2_float( unsigned u ) {
- float fl = (int) (u & 0xffff);
- float fh = (int) (u >> 16);
- fh *= 0x1.0p16f;
- return fh + fl;
-}
-
-00000000 subl $0x04,%esp
-00000003 movl 0x08(%esp,1),%eax
-00000007 movl %eax,%ecx
-00000009 shrl $0x10,%ecx
-0000000c cvtsi2ss %ecx,%xmm0
-00000010 andl $0x0000ffff,%eax
-00000015 cvtsi2ss %eax,%xmm1
-00000019 mulss 0x00000078,%xmm0
-00000021 addss %xmm1,%xmm0
-00000025 movss %xmm0,(%esp,1)
-0000002a flds (%esp,1)
-0000002d addl $0x04,%esp
-00000030 ret
-
-//===---------------------------------------------------------------------===//
-
-When using fastcc abi, align stack slot of argument of type double on 8 byte
-boundary to improve performance.
-
-//===---------------------------------------------------------------------===//
-
-Codegen:
-
-int f(int a, int b) {
- if (a == 4 || a == 6)
- b++;
- return b;
-}
-
-
-as:
-
-or eax, 2
-cmp eax, 6
-jz label
-
-//===---------------------------------------------------------------------===//
-
-GCC's ix86_expand_int_movcc function (in i386.c) has a ton of interesting
-simplifications for integer "x cmp y ? a : b". For example, instead of:
-
-int G;
-void f(int X, int Y) {
- G = X < 0 ? 14 : 13;
-}
-
-compiling to:
-
-_f:
- movl $14, %eax
- movl $13, %ecx
- movl 4(%esp), %edx
- testl %edx, %edx
- cmovl %eax, %ecx
- movl %ecx, _G
- ret
-
-it could be:
-_f:
- movl 4(%esp), %eax
- sarl $31, %eax
- notl %eax
- addl $14, %eax
- movl %eax, _G
- ret
-
-etc.
-
-Another is:
-int usesbb(unsigned int a, unsigned int b) {
- return (a < b ? -1 : 0);
-}
-to:
-_usesbb:
- movl 8(%esp), %eax
- cmpl %eax, 4(%esp)
- sbbl %eax, %eax
- ret
-
-instead of:
-_usesbb:
- xorl %eax, %eax
- movl 8(%esp), %ecx
- cmpl %ecx, 4(%esp)
- movl $4294967295, %ecx
- cmovb %ecx, %eax
- ret
-
-//===---------------------------------------------------------------------===//
-
-Currently we don't have elimination of redundant stack manipulations. Consider
-the code:
-
-int %main() {
-entry:
- call fastcc void %test1( )
- call fastcc void %test2( sbyte* cast (void ()* %test1 to sbyte*) )
- ret int 0
-}
-
-declare fastcc void %test1()
-
-declare fastcc void %test2(sbyte*)
-
-
-This currently compiles to:
-
- subl $16, %esp
- call _test5
- addl $12, %esp
- subl $16, %esp
- movl $_test5, (%esp)
- call _test6
- addl $12, %esp
-
-The add\sub pair is really unneeded here.
-
-//===---------------------------------------------------------------------===//
-
-Consider the expansion of:
-
-define i32 @test3(i32 %X) {
- %tmp1 = urem i32 %X, 255
- ret i32 %tmp1
-}
-
-Currently it compiles to:
-
-...
- movl $2155905153, %ecx
- movl 8(%esp), %esi
- movl %esi, %eax
- mull %ecx
-...
-
-This could be "reassociated" into:
-
- movl $2155905153, %eax
- movl 8(%esp), %ecx
- mull %ecx
-
-to avoid the copy. In fact, the existing two-address stuff would do this
-except that mul isn't a commutative 2-addr instruction. I guess this has
-to be done at isel time based on the #uses to mul?
-
-//===---------------------------------------------------------------------===//
-
-Make sure the instruction which starts a loop does not cross a cacheline
-boundary. This requires knowning the exact length of each machine instruction.
-That is somewhat complicated, but doable. Example 256.bzip2:
-
-In the new trace, the hot loop has an instruction which crosses a cacheline
-boundary. In addition to potential cache misses, this can't help decoding as I
-imagine there has to be some kind of complicated decoder reset and realignment
-to grab the bytes from the next cacheline.
-
-532 532 0x3cfc movb (1809(%esp, %esi), %bl <<<--- spans 2 64 byte lines
-942 942 0x3d03 movl %dh, (1809(%esp, %esi)
-937 937 0x3d0a incl %esi
-3 3 0x3d0b cmpb %bl, %dl
-27 27 0x3d0d jnz 0x000062db <main+11707>
-
-//===---------------------------------------------------------------------===//
-
-In c99 mode, the preprocessor doesn't like assembly comments like #TRUNCATE.
-
-//===---------------------------------------------------------------------===//
-
-This could be a single 16-bit load.
-
-int f(char *p) {
- if ((p[0] == 1) & (p[1] == 2)) return 1;
- return 0;
-}
-
-//===---------------------------------------------------------------------===//
-
-We should inline lrintf and probably other libc functions.
-
-//===---------------------------------------------------------------------===//
-
-Start using the flags more. For example, compile:
-
-int add_zf(int *x, int y, int a, int b) {
- if ((*x += y) == 0)
- return a;
- else
- return b;
-}
-
-to:
- addl %esi, (%rdi)
- movl %edx, %eax
- cmovne %ecx, %eax
- ret
-instead of:
-
-_add_zf:
- addl (%rdi), %esi
- movl %esi, (%rdi)
- testl %esi, %esi
- cmove %edx, %ecx
- movl %ecx, %eax
- ret
-
-and:
-
-int add_zf(int *x, int y, int a, int b) {
- if ((*x + y) < 0)
- return a;
- else
- return b;
-}
-
-to:
-
-add_zf:
- addl (%rdi), %esi
- movl %edx, %eax
- cmovns %ecx, %eax
- ret
-
-instead of:
-
-_add_zf:
- addl (%rdi), %esi
- testl %esi, %esi
- cmovs %edx, %ecx
- movl %ecx, %eax
- ret
-
-//===---------------------------------------------------------------------===//
-
-These two functions have identical effects:
-
-unsigned int f(unsigned int i, unsigned int n) {++i; if (i == n) ++i; return i;}
-unsigned int f2(unsigned int i, unsigned int n) {++i; i += i == n; return i;}
-
-We currently compile them to:
-
-_f:
- movl 4(%esp), %eax
- movl %eax, %ecx
- incl %ecx
- movl 8(%esp), %edx
- cmpl %edx, %ecx
- jne LBB1_2 #UnifiedReturnBlock
-LBB1_1: #cond_true
- addl $2, %eax
- ret
-LBB1_2: #UnifiedReturnBlock
- movl %ecx, %eax
- ret
-_f2:
- movl 4(%esp), %eax
- movl %eax, %ecx
- incl %ecx
- cmpl 8(%esp), %ecx
- sete %cl
- movzbl %cl, %ecx
- leal 1(%ecx,%eax), %eax
- ret
-
-both of which are inferior to GCC's:
-
-_f:
- movl 4(%esp), %edx
- leal 1(%edx), %eax
- addl $2, %edx
- cmpl 8(%esp), %eax
- cmove %edx, %eax
- ret
-_f2:
- movl 4(%esp), %eax
- addl $1, %eax
- xorl %edx, %edx
- cmpl 8(%esp), %eax
- sete %dl
- addl %edx, %eax
- ret
-
-//===---------------------------------------------------------------------===//
-
-This code:
-
-void test(int X) {
- if (X) abort();
-}
-
-is currently compiled to:
-
-_test:
- subl $12, %esp
- cmpl $0, 16(%esp)
- jne LBB1_1
- addl $12, %esp
- ret
-LBB1_1:
- call L_abort$stub
-
-It would be better to produce:
-
-_test:
- subl $12, %esp
- cmpl $0, 16(%esp)
- jne L_abort$stub
- addl $12, %esp
- ret
-
-This can be applied to any no-return function call that takes no arguments etc.
-Alternatively, the stack save/restore logic could be shrink-wrapped, producing
-something like this:
-
-_test:
- cmpl $0, 4(%esp)
- jne LBB1_1
- ret
-LBB1_1:
- subl $12, %esp
- call L_abort$stub
-
-Both are useful in different situations. Finally, it could be shrink-wrapped
-and tail called, like this:
-
-_test:
- cmpl $0, 4(%esp)
- jne LBB1_1
- ret
-LBB1_1:
- pop %eax # realign stack.
- call L_abort$stub
-
-Though this probably isn't worth it.
-
-//===---------------------------------------------------------------------===//
-
-We need to teach the codegen to convert two-address INC instructions to LEA
-when the flags are dead (likewise dec). For example, on X86-64, compile:
-
-int foo(int A, int B) {
- return A+1;
-}
-
-to:
-
-_foo:
- leal 1(%edi), %eax
- ret
-
-instead of:
-
-_foo:
- incl %edi
- movl %edi, %eax
- ret
-
-Another example is:
-
-;; X's live range extends beyond the shift, so the register allocator
-;; cannot coalesce it with Y. Because of this, a copy needs to be
-;; emitted before the shift to save the register value before it is
-;; clobbered. However, this copy is not needed if the register
-;; allocator turns the shift into an LEA. This also occurs for ADD.
-
-; Check that the shift gets turned into an LEA.
-; RUN: llvm-as < %s | llc -march=x86 -x86-asm-syntax=intel | \
-; RUN: not grep {mov E.X, E.X}
-
-@G = external global i32 ; <i32*> [#uses=3]
-
-define i32 @test1(i32 %X, i32 %Y) {
- %Z = add i32 %X, %Y ; <i32> [#uses=1]
- volatile store i32 %Y, i32* @G
- volatile store i32 %Z, i32* @G
- ret i32 %X
-}
-
-define i32 @test2(i32 %X) {
- %Z = add i32 %X, 1 ; <i32> [#uses=1]
- volatile store i32 %Z, i32* @G
- ret i32 %X
-}
-
-//===---------------------------------------------------------------------===//
-
-Sometimes it is better to codegen subtractions from a constant (e.g. 7-x) with
-a neg instead of a sub instruction. Consider:
-
-int test(char X) { return 7-X; }
-
-we currently produce:
-_test:
- movl $7, %eax
- movsbl 4(%esp), %ecx
- subl %ecx, %eax
- ret
-
-We would use one fewer register if codegen'd as:
-
- movsbl 4(%esp), %eax
- neg %eax
- add $7, %eax
- ret
-
-Note that this isn't beneficial if the load can be folded into the sub. In
-this case, we want a sub:
-
-int test(int X) { return 7-X; }
-_test:
- movl $7, %eax
- subl 4(%esp), %eax
- ret
-
-//===---------------------------------------------------------------------===//
-
-Leaf functions that require one 4-byte spill slot have a prolog like this:
-
-_foo:
- pushl %esi
- subl $4, %esp
-...
-and an epilog like this:
- addl $4, %esp
- popl %esi
- ret
-
-It would be smaller, and potentially faster, to push eax on entry and to
-pop into a dummy register instead of using addl/subl of esp. Just don't pop
-into any return registers :)
-
-//===---------------------------------------------------------------------===//
-
-The X86 backend should fold (branch (or (setcc, setcc))) into multiple
-branches. We generate really poor code for:
-
-double testf(double a) {
- return a == 0.0 ? 0.0 : (a > 0.0 ? 1.0 : -1.0);
-}
-
-For example, the entry BB is:
-
-_testf:
- subl $20, %esp
- pxor %xmm0, %xmm0
- movsd 24(%esp), %xmm1
- ucomisd %xmm0, %xmm1
- setnp %al
- sete %cl
- testb %cl, %al
- jne LBB1_5 # UnifiedReturnBlock
-LBB1_1: # cond_true
-
-
-it would be better to replace the last four instructions with:
-
- jp LBB1_1
- je LBB1_5
-LBB1_1:
-
-We also codegen the inner ?: into a diamond:
-
- cvtss2sd LCPI1_0(%rip), %xmm2
- cvtss2sd LCPI1_1(%rip), %xmm3
- ucomisd %xmm1, %xmm0
- ja LBB1_3 # cond_true
-LBB1_2: # cond_true
- movapd %xmm3, %xmm2
-LBB1_3: # cond_true
- movapd %xmm2, %xmm0
- ret
-
-We should sink the load into xmm3 into the LBB1_2 block. This should
-be pretty easy, and will nuke all the copies.
-
-//===---------------------------------------------------------------------===//
-
-This:
- #include <algorithm>
- inline std::pair<unsigned, bool> full_add(unsigned a, unsigned b)
- { return std::make_pair(a + b, a + b < a); }
- bool no_overflow(unsigned a, unsigned b)
- { return !full_add(a, b).second; }
-
-Should compile to:
-
-
- _Z11no_overflowjj:
- addl %edi, %esi
- setae %al
- ret
-
-FIXME: That code looks wrong; bool return is normally defined as zext.
-
-on x86-64, not:
-
-__Z11no_overflowjj:
- addl %edi, %esi
- cmpl %edi, %esi
- setae %al
- movzbl %al, %eax
- ret
-
-
-//===---------------------------------------------------------------------===//
-
-Re-materialize MOV32r0 etc. with xor instead of changing them to moves if the
-condition register is dead. xor reg reg is shorter than mov reg, #0.
-
-//===---------------------------------------------------------------------===//
-
-We aren't matching RMW instructions aggressively
-enough. Here's a reduced testcase (more in PR1160):
-
-define void @test(i32* %huge_ptr, i32* %target_ptr) {
- %A = load i32* %huge_ptr ; <i32> [#uses=1]
- %B = load i32* %target_ptr ; <i32> [#uses=1]
- %C = or i32 %A, %B ; <i32> [#uses=1]
- store i32 %C, i32* %target_ptr
- ret void
-}
-
-$ llvm-as < t.ll | llc -march=x86-64
-
-_test:
- movl (%rdi), %eax
- orl (%rsi), %eax
- movl %eax, (%rsi)
- ret
-
-That should be something like:
-
-_test:
- movl (%rdi), %eax
- orl %eax, (%rsi)
- ret
-
-//===---------------------------------------------------------------------===//
-
-The following code:
-
-bb114.preheader: ; preds = %cond_next94
- %tmp231232 = sext i16 %tmp62 to i32 ; <i32> [#uses=1]
- %tmp233 = sub i32 32, %tmp231232 ; <i32> [#uses=1]
- %tmp245246 = sext i16 %tmp65 to i32 ; <i32> [#uses=1]
- %tmp252253 = sext i16 %tmp68 to i32 ; <i32> [#uses=1]
- %tmp254 = sub i32 32, %tmp252253 ; <i32> [#uses=1]
- %tmp553554 = bitcast i16* %tmp37 to i8* ; <i8*> [#uses=2]
- %tmp583584 = sext i16 %tmp98 to i32 ; <i32> [#uses=1]
- %tmp585 = sub i32 32, %tmp583584 ; <i32> [#uses=1]
- %tmp614615 = sext i16 %tmp101 to i32 ; <i32> [#uses=1]
- %tmp621622 = sext i16 %tmp104 to i32 ; <i32> [#uses=1]
- %tmp623 = sub i32 32, %tmp621622 ; <i32> [#uses=1]
- br label %bb114
-
-produces:
-
-LBB3_5: # bb114.preheader
- movswl -68(%ebp), %eax
- movl $32, %ecx
- movl %ecx, -80(%ebp)
- subl %eax, -80(%ebp)
- movswl -52(%ebp), %eax
- movl %ecx, -84(%ebp)
- subl %eax, -84(%ebp)
- movswl -70(%ebp), %eax
- movl %ecx, -88(%ebp)
- subl %eax, -88(%ebp)
- movswl -50(%ebp), %eax
- subl %eax, %ecx
- movl %ecx, -76(%ebp)
- movswl -42(%ebp), %eax
- movl %eax, -92(%ebp)
- movswl -66(%ebp), %eax
- movl %eax, -96(%ebp)
- movw $0, -98(%ebp)
-
-This appears to be bad because the RA is not folding the store to the stack
-slot into the movl. The above instructions could be:
- movl $32, -80(%ebp)
-...
- movl $32, -84(%ebp)
-...
-This seems like a cross between remat and spill folding.
-
-This has redundant subtractions of %eax from a stack slot. However, %ecx doesn't
-change, so we could simply subtract %eax from %ecx first and then use %ecx (or
-vice-versa).
-
-//===---------------------------------------------------------------------===//
-
-This code:
-
- %tmp659 = icmp slt i16 %tmp654, 0 ; <i1> [#uses=1]
- br i1 %tmp659, label %cond_true662, label %cond_next715
-
-produces this:
-
- testw %cx, %cx
- movswl %cx, %esi
- jns LBB4_109 # cond_next715
-
-Shark tells us that using %cx in the testw instruction is sub-optimal. It
-suggests using the 32-bit register (which is what ICC uses).
-
-//===---------------------------------------------------------------------===//
-
-We compile this:
-
-void compare (long long foo) {
- if (foo < 4294967297LL)
- abort();
-}
-
-to:
-
-compare:
- subl $4, %esp
- cmpl $0, 8(%esp)
- setne %al
- movzbw %al, %ax
- cmpl $1, 12(%esp)
- setg %cl
- movzbw %cl, %cx
- cmove %ax, %cx
- testb $1, %cl
- jne .LBB1_2 # UnifiedReturnBlock
-.LBB1_1: # ifthen
- call abort
-.LBB1_2: # UnifiedReturnBlock
- addl $4, %esp
- ret
-
-(also really horrible code on ppc). This is due to the expand code for 64-bit
-compares. GCC produces multiple branches, which is much nicer:
-
-compare:
- subl $12, %esp
- movl 20(%esp), %edx
- movl 16(%esp), %eax
- decl %edx
- jle .L7
-.L5:
- addl $12, %esp
- ret
- .p2align 4,,7
-.L7:
- jl .L4
- cmpl $0, %eax
- .p2align 4,,8
- ja .L5
-.L4:
- .p2align 4,,9
- call abort
-
-//===---------------------------------------------------------------------===//
-
-Tail call optimization improvements: Tail call optimization currently
-pushes all arguments on the top of the stack (their normal place for
-non-tail call optimized calls) that source from the callers arguments
-or that source from a virtual register (also possibly sourcing from
-callers arguments).
-This is done to prevent overwriting of parameters (see example
-below) that might be used later.
-
-example:
-
-int callee(int32, int64);
-int caller(int32 arg1, int32 arg2) {
- int64 local = arg2 * 2;
- return callee(arg2, (int64)local);
-}
-
-[arg1] [!arg2 no longer valid since we moved local onto it]
-[arg2] -> [(int64)
-[RETADDR] local ]
-
-Moving arg1 onto the stack slot of callee function would overwrite
-arg2 of the caller.
-
-Possible optimizations:
-
-
- - Analyse the actual parameters of the callee to see which would
- overwrite a caller parameter which is used by the callee and only
- push them onto the top of the stack.
-
- int callee (int32 arg1, int32 arg2);
- int caller (int32 arg1, int32 arg2) {
- return callee(arg1,arg2);
- }
-
- Here we don't need to write any variables to the top of the stack
- since they don't overwrite each other.
-
- int callee (int32 arg1, int32 arg2);
- int caller (int32 arg1, int32 arg2) {
- return callee(arg2,arg1);
- }
-
- Here we need to push the arguments because they overwrite each
- other.
-
-//===---------------------------------------------------------------------===//
-
-main ()
-{
- int i = 0;
- unsigned long int z = 0;
-
- do {
- z -= 0x00004000;
- i++;
- if (i > 0x00040000)
- abort ();
- } while (z > 0);
- exit (0);
-}
-
-gcc compiles this to:
-
-_main:
- subl $28, %esp
- xorl %eax, %eax
- jmp L2
-L3:
- cmpl $262144, %eax
- je L10
-L2:
- addl $1, %eax
- cmpl $262145, %eax
- jne L3
- call L_abort$stub
-L10:
- movl $0, (%esp)
- call L_exit$stub
-
-llvm:
-
-_main:
- subl $12, %esp
- movl $1, %eax
- movl $16384, %ecx
-LBB1_1: # bb
- cmpl $262145, %eax
- jge LBB1_4 # cond_true
-LBB1_2: # cond_next
- incl %eax
- addl $4294950912, %ecx
- cmpl $16384, %ecx
- jne LBB1_1 # bb
-LBB1_3: # bb11
- xorl %eax, %eax
- addl $12, %esp
- ret
-LBB1_4: # cond_true
- call L_abort$stub
-
-1. LSR should rewrite the first cmp with induction variable %ecx.
-2. DAG combiner should fold
- leal 1(%eax), %edx
- cmpl $262145, %edx
- =>
- cmpl $262144, %eax
-
-//===---------------------------------------------------------------------===//
-
-define i64 @test(double %X) {
- %Y = fptosi double %X to i64
- ret i64 %Y
-}
-
-compiles to:
-
-_test:
- subl $20, %esp
- movsd 24(%esp), %xmm0
- movsd %xmm0, 8(%esp)
- fldl 8(%esp)
- fisttpll (%esp)
- movl 4(%esp), %edx
- movl (%esp), %eax
- addl $20, %esp
- #FP_REG_KILL
- ret
-
-This should just fldl directly from the input stack slot.
-
-//===---------------------------------------------------------------------===//
-
-This code:
-int foo (int x) { return (x & 65535) | 255; }
-
-Should compile into:
-
-_foo:
- movzwl 4(%esp), %eax
- orl $255, %eax
- ret
-
-instead of:
-_foo:
- movl $255, %eax
- orl 4(%esp), %eax
- andl $65535, %eax
- ret
-
-//===---------------------------------------------------------------------===//
-
-We're codegen'ing multiply of long longs inefficiently:
-
-unsigned long long LLM(unsigned long long arg1, unsigned long long arg2) {
- return arg1 * arg2;
-}
-
-We compile to (fomit-frame-pointer):
-
-_LLM:
- pushl %esi
- movl 8(%esp), %ecx
- movl 16(%esp), %esi
- movl %esi, %eax
- mull %ecx
- imull 12(%esp), %esi
- addl %edx, %esi
- imull 20(%esp), %ecx
- movl %esi, %edx
- addl %ecx, %edx
- popl %esi
- ret
-
-This looks like a scheduling deficiency and lack of remat of the load from
-the argument area. ICC apparently produces:
-
- movl 8(%esp), %ecx
- imull 12(%esp), %ecx
- movl 16(%esp), %eax
- imull 4(%esp), %eax
- addl %eax, %ecx
- movl 4(%esp), %eax
- mull 12(%esp)
- addl %ecx, %edx
- ret
-
-Note that it remat'd loads from 4(esp) and 12(esp). See this GCC PR:
-http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17236
-
-//===---------------------------------------------------------------------===//
-
-We can fold a store into "zeroing a reg". Instead of:
-
-xorl %eax, %eax
-movl %eax, 124(%esp)
-
-we should get:
-
-movl $0, 124(%esp)
-
-if the flags of the xor are dead.
-
-Likewise, we isel "x<<1" into "add reg,reg". If reg is spilled, this should
-be folded into: shl [mem], 1
-
-//===---------------------------------------------------------------------===//
-
-This testcase misses a read/modify/write opportunity (from PR1425):
-
-void vertical_decompose97iH1(int *b0, int *b1, int *b2, int width){
- int i;
- for(i=0; i<width; i++)
- b1[i] += (1*(b0[i] + b2[i])+0)>>0;
-}
-
-We compile it down to:
-
-LBB1_2: # bb
- movl (%esi,%edi,4), %ebx
- addl (%ecx,%edi,4), %ebx
- addl (%edx,%edi,4), %ebx
- movl %ebx, (%ecx,%edi,4)
- incl %edi
- cmpl %eax, %edi
- jne LBB1_2 # bb
-
-the inner loop should add to the memory location (%ecx,%edi,4), saving
-a mov. Something like:
-
- movl (%esi,%edi,4), %ebx
- addl (%edx,%edi,4), %ebx
- addl %ebx, (%ecx,%edi,4)
-
-Here is another interesting example:
-
-void vertical_compose97iH1(int *b0, int *b1, int *b2, int width){
- int i;
- for(i=0; i<width; i++)
- b1[i] -= (1*(b0[i] + b2[i])+0)>>0;
-}
-
-We miss the r/m/w opportunity here by using 2 subs instead of an add+sub[mem]:
-
-LBB9_2: # bb
- movl (%ecx,%edi,4), %ebx
- subl (%esi,%edi,4), %ebx
- subl (%edx,%edi,4), %ebx
- movl %ebx, (%ecx,%edi,4)
- incl %edi
- cmpl %eax, %edi
- jne LBB9_2 # bb
-
-Additionally, LSR should rewrite the exit condition of these loops to use
-a stride-4 IV, would would allow all the scales in the loop to go away.
-This would result in smaller code and more efficient microops.
-
-//===---------------------------------------------------------------------===//
-
-In SSE mode, we turn abs and neg into a load from the constant pool plus a xor
-or and instruction, for example:
-
- xorpd LCPI1_0, %xmm2
-
-However, if xmm2 gets spilled, we end up with really ugly code like this:
-
- movsd (%esp), %xmm0
- xorpd LCPI1_0, %xmm0
- movsd %xmm0, (%esp)
-
-Since we 'know' that this is a 'neg', we can actually "fold" the spill into
-the neg/abs instruction, turning it into an *integer* operation, like this:
-
- xorl 2147483648, [mem+4] ## 2147483648 = (1 << 31)
-
-you could also use xorb, but xorl is less likely to lead to a partial register
-stall. Here is a contrived testcase:
-
-double a, b, c;
-void test(double *P) {
- double X = *P;
- a = X;
- bar();
- X = -X;
- b = X;
- bar();
- c = X;
-}
-
-//===---------------------------------------------------------------------===//
-
-handling llvm.memory.barrier on pre SSE2 cpus
-
-should generate:
-lock ; mov %esp, %esp
-
-//===---------------------------------------------------------------------===//
-
-The generated code on x86 for checking for signed overflow on a multiply the
-obvious way is much longer than it needs to be.
-
-int x(int a, int b) {
- long long prod = (long long)a*b;
- return prod > 0x7FFFFFFF || prod < (-0x7FFFFFFF-1);
-}
-
-See PR2053 for more details.
-
-//===---------------------------------------------------------------------===//
-
-We should investigate using cdq/ctld (effect: edx = sar eax, 31)
-more aggressively; it should cost the same as a move+shift on any modern
-processor, but it's a lot shorter. Downside is that it puts more
-pressure on register allocation because it has fixed operands.
-
-Example:
-int abs(int x) {return x < 0 ? -x : x;}
-
-gcc compiles this to the following when using march/mtune=pentium2/3/4/m/etc.:
-abs:
- movl 4(%esp), %eax
- cltd
- xorl %edx, %eax
- subl %edx, %eax
- ret
-
-//===---------------------------------------------------------------------===//
-
-Consider:
-int test(unsigned long a, unsigned long b) { return -(a < b); }
-
-We currently compile this to:
-
-define i32 @test(i32 %a, i32 %b) nounwind {
- %tmp3 = icmp ult i32 %a, %b ; <i1> [#uses=1]
- %tmp34 = zext i1 %tmp3 to i32 ; <i32> [#uses=1]
- %tmp5 = sub i32 0, %tmp34 ; <i32> [#uses=1]
- ret i32 %tmp5
-}
-
-and
-
-_test:
- movl 8(%esp), %eax
- cmpl %eax, 4(%esp)
- setb %al
- movzbl %al, %eax
- negl %eax
- ret
-
-Several deficiencies here. First, we should instcombine zext+neg into sext:
-
-define i32 @test2(i32 %a, i32 %b) nounwind {
- %tmp3 = icmp ult i32 %a, %b ; <i1> [#uses=1]
- %tmp34 = sext i1 %tmp3 to i32 ; <i32> [#uses=1]
- ret i32 %tmp34
-}
-
-However, before we can do that, we have to fix the bad codegen that we get for
-sext from bool:
-
-_test2:
- movl 8(%esp), %eax
- cmpl %eax, 4(%esp)
- setb %al
- movzbl %al, %eax
- shll $31, %eax
- sarl $31, %eax
- ret
-
-This code should be at least as good as the code above. Once this is fixed, we
-can optimize this specific case even more to:
-
- movl 8(%esp), %eax
- xorl %ecx, %ecx
- cmpl %eax, 4(%esp)
- sbbl %ecx, %ecx
-
-//===---------------------------------------------------------------------===//
-
-Take the following code (from
-http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16541):
-
-extern unsigned char first_one[65536];
-int FirstOnet(unsigned long long arg1)
-{
- if (arg1 >> 48)
- return (first_one[arg1 >> 48]);
- return 0;
-}
-
-
-The following code is currently generated:
-FirstOnet:
- movl 8(%esp), %eax
- cmpl $65536, %eax
- movl 4(%esp), %ecx
- jb .LBB1_2 # UnifiedReturnBlock
-.LBB1_1: # ifthen
- shrl $16, %eax
- movzbl first_one(%eax), %eax
- ret
-.LBB1_2: # UnifiedReturnBlock
- xorl %eax, %eax
- ret
-
-There are a few possible improvements here:
-1. We should be able to eliminate the dead load into %ecx
-2. We could change the "movl 8(%esp), %eax" into
- "movzwl 10(%esp), %eax"; this lets us change the cmpl
- into a testl, which is shorter, and eliminate the shift.
-
-We could also in theory eliminate the branch by using a conditional
-for the address of the load, but that seems unlikely to be worthwhile
-in general.
-
-//===---------------------------------------------------------------------===//
-
-We compile this function:
-
-define i32 @foo(i32 %a, i32 %b, i32 %c, i8 zeroext %d) nounwind {
-entry:
- %tmp2 = icmp eq i8 %d, 0 ; <i1> [#uses=1]
- br i1 %tmp2, label %bb7, label %bb
-
-bb: ; preds = %entry
- %tmp6 = add i32 %b, %a ; <i32> [#uses=1]
- ret i32 %tmp6
-
-bb7: ; preds = %entry
- %tmp10 = sub i32 %a, %c ; <i32> [#uses=1]
- ret i32 %tmp10
-}
-
-to:
-
-_foo:
- cmpb $0, 16(%esp)
- movl 12(%esp), %ecx
- movl 8(%esp), %eax
- movl 4(%esp), %edx
- je LBB1_2 # bb7
-LBB1_1: # bb
- addl %edx, %eax
- ret
-LBB1_2: # bb7
- movl %edx, %eax
- subl %ecx, %eax
- ret
-
-The coalescer could coalesce "edx" with "eax" to avoid the movl in LBB1_2
-if it commuted the addl in LBB1_1.
-
-//===---------------------------------------------------------------------===//
-
-See rdar://4653682.
-
-From flops:
-
-LBB1_15: # bb310
- cvtss2sd LCPI1_0, %xmm1
- addsd %xmm1, %xmm0
- movsd 176(%esp), %xmm2
- mulsd %xmm0, %xmm2
- movapd %xmm2, %xmm3
- mulsd %xmm3, %xmm3
- movapd %xmm3, %xmm4
- mulsd LCPI1_23, %xmm4
- addsd LCPI1_24, %xmm4
- mulsd %xmm3, %xmm4
- addsd LCPI1_25, %xmm4
- mulsd %xmm3, %xmm4
- addsd LCPI1_26, %xmm4
- mulsd %xmm3, %xmm4
- addsd LCPI1_27, %xmm4
- mulsd %xmm3, %xmm4
- addsd LCPI1_28, %xmm4
- mulsd %xmm3, %xmm4
- addsd %xmm1, %xmm4
- mulsd %xmm2, %xmm4
- movsd 152(%esp), %xmm1
- addsd %xmm4, %xmm1
- movsd %xmm1, 152(%esp)
- incl %eax
- cmpl %eax, %esi
- jge LBB1_15 # bb310
-LBB1_16: # bb358.loopexit
- movsd 152(%esp), %xmm0
- addsd %xmm0, %xmm0
- addsd LCPI1_22, %xmm0
- movsd %xmm0, 152(%esp)
-
-Rather than spilling the result of the last addsd in the loop, we should have
-insert a copy to split the interval (one for the duration of the loop, one
-extending to the fall through). The register pressure in the loop isn't high
-enough to warrant the spill.
-
-Also check why xmm7 is not used at all in the function.
-
-//===---------------------------------------------------------------------===//
-
-Legalize loses track of the fact that bools are always zero extended when in
-memory. This causes us to compile abort_gzip (from 164.gzip) from:
-
-target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
-target triple = "i386-apple-darwin8"
-@in_exit.4870.b = internal global i1 false ; <i1*> [#uses=2]
-define fastcc void @abort_gzip() noreturn nounwind {
-entry:
- %tmp.b.i = load i1* @in_exit.4870.b ; <i1> [#uses=1]
- br i1 %tmp.b.i, label %bb.i, label %bb4.i
-bb.i: ; preds = %entry
- tail call void @exit( i32 1 ) noreturn nounwind
- unreachable
-bb4.i: ; preds = %entry
- store i1 true, i1* @in_exit.4870.b
- tail call void @exit( i32 1 ) noreturn nounwind
- unreachable
-}
-declare void @exit(i32) noreturn nounwind
-
-into:
-
-_abort_gzip:
- subl $12, %esp
- movb _in_exit.4870.b, %al
- notb %al
- testb $1, %al
- jne LBB1_2 ## bb4.i
-LBB1_1: ## bb.i
- ...
-
-//===---------------------------------------------------------------------===//
-
-We compile:
-
-int test(int x, int y) {
- return x-y-1;
-}
-
-into (-m64):
-
-_test:
- decl %edi
- movl %edi, %eax
- subl %esi, %eax
- ret
-
-it would be better to codegen as: x+~y (notl+addl)
-
-//===---------------------------------------------------------------------===//
diff --git a/release_23/lib/Target/X86/X86.h b/release_23/lib/Target/X86/X86.h
deleted file mode 100644
index 2dd067afd332..000000000000
--- a/release_23/lib/Target/X86/X86.h
+++ /dev/null
@@ -1,70 +0,0 @@
-//===-- X86.h - Top-level interface for X86 representation ------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains the entry points for global functions defined in the x86
-// target library, as used by the LLVM JIT.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef TARGET_X86_H
-#define TARGET_X86_H
-
-#include <iosfwd>
-
-namespace llvm {
-
-class X86TargetMachine;
-class FunctionPass;
-class MachineCodeEmitter;
-
-/// createX86ISelDag - This pass converts a legalized DAG into a
-/// X86-specific DAG, ready for instruction scheduling.
-///
-FunctionPass *createX86ISelDag(X86TargetMachine &TM, bool Fast);
-
-/// createX86FloatingPointStackifierPass - This function returns a pass which
-/// converts floating point register references and pseudo instructions into
-/// floating point stack references and physical instructions.
-///
-FunctionPass *createX86FloatingPointStackifierPass();
-
-/// createX86CodePrinterPass - Returns a pass that prints the X86
-/// assembly code for a MachineFunction to the given output stream,
-/// using the given target machine description.
-///
-FunctionPass *createX86CodePrinterPass(std::ostream &o, X86TargetMachine &tm);
-
-/// createX86CodeEmitterPass - Return a pass that emits the collected X86 code
-/// to the specified MCE object.
-FunctionPass *createX86CodeEmitterPass(X86TargetMachine &TM,
- MachineCodeEmitter &MCE);
-
-/// createX86EmitCodeToMemory - Returns a pass that converts a register
-/// allocated function into raw machine code in a dynamically
-/// allocated chunk of memory.
-///
-FunctionPass *createEmitX86CodeToMemory();
-
-/// createX86MaxStackAlignmentCalculatorPass - This function returns a pass which
-/// calculates maximal stack alignment required for function
-///
-FunctionPass *createX86MaxStackAlignmentCalculatorPass();
-
-} // End llvm namespace
-
-// Defines symbolic names for X86 registers. This defines a mapping from
-// register name to register number.
-//
-#include "X86GenRegisterNames.inc"
-
-// Defines symbolic names for the X86 instructions.
-//
-#include "X86GenInstrNames.inc"
-
-#endif
diff --git a/release_23/lib/Target/X86/X86.td b/release_23/lib/Target/X86/X86.td
deleted file mode 100644
index 39ba093be743..000000000000
--- a/release_23/lib/Target/X86/X86.td
+++ /dev/null
@@ -1,159 +0,0 @@
-//===- X86.td - Target definition file for the Intel X86 ---*- tablegen -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This is a target description file for the Intel i386 architecture, refered to
-// here as the "X86" architecture.
-//
-//===----------------------------------------------------------------------===//
-
-// Get the target-independent interfaces which we are implementing...
-//
-include "../Target.td"
-
-//===----------------------------------------------------------------------===//
-// X86 Subtarget features.
-//===----------------------------------------------------------------------===//
-
-def FeatureMMX : SubtargetFeature<"mmx","X86SSELevel", "MMX",
- "Enable MMX instructions">;
-def FeatureSSE1 : SubtargetFeature<"sse", "X86SSELevel", "SSE1",
- "Enable SSE instructions",
- [FeatureMMX]>;
-def FeatureSSE2 : SubtargetFeature<"sse2", "X86SSELevel", "SSE2",
- "Enable SSE2 instructions",
- [FeatureSSE1]>;
-def FeatureSSE3 : SubtargetFeature<"sse3", "X86SSELevel", "SSE3",
- "Enable SSE3 instructions",
- [FeatureSSE2]>;
-def FeatureSSSE3 : SubtargetFeature<"ssse3", "X86SSELevel", "SSSE3",
- "Enable SSSE3 instructions",
- [FeatureSSE3]>;
-def FeatureSSE41 : SubtargetFeature<"sse41", "X86SSELevel", "SSE41",
- "Enable SSE 4.1 instructions",
- [FeatureSSSE3]>;
-def FeatureSSE42 : SubtargetFeature<"sse42", "X86SSELevel", "SSE42",
- "Enable SSE 4.2 instructions",
- [FeatureSSE41]>;
-def Feature3DNow : SubtargetFeature<"3dnow", "X863DNowLevel", "ThreeDNow",
- "Enable 3DNow! instructions">;
-def Feature3DNowA : SubtargetFeature<"3dnowa", "X863DNowLevel", "ThreeDNowA",
- "Enable 3DNow! Athlon instructions",
- [Feature3DNow]>;
-def Feature64Bit : SubtargetFeature<"64bit", "HasX86_64", "true",
- "Support 64-bit instructions",
- [FeatureSSE2]>;
-
-//===----------------------------------------------------------------------===//
-// X86 processors supported.
-//===----------------------------------------------------------------------===//
-
-class Proc<string Name, list<SubtargetFeature> Features>
- : Processor<Name, NoItineraries, Features>;
-
-def : Proc<"generic", []>;
-def : Proc<"i386", []>;
-def : Proc<"i486", []>;
-def : Proc<"pentium", []>;
-def : Proc<"pentium-mmx", [FeatureMMX]>;
-def : Proc<"i686", []>;
-def : Proc<"pentiumpro", []>;
-def : Proc<"pentium2", [FeatureMMX]>;
-def : Proc<"pentium3", [FeatureSSE1]>;
-def : Proc<"pentium-m", [FeatureSSE2]>;
-def : Proc<"pentium4", [FeatureSSE2]>;
-def : Proc<"x86-64", [Feature64Bit]>;
-def : Proc<"yonah", [FeatureSSE3]>;
-def : Proc<"prescott", [FeatureSSE3]>;
-def : Proc<"nocona", [FeatureSSE3, Feature64Bit]>;
-def : Proc<"core2", [FeatureSSSE3, Feature64Bit]>;
-def : Proc<"penryn", [FeatureSSE41, Feature64Bit]>;
-
-def : Proc<"k6", [FeatureMMX]>;
-def : Proc<"k6-2", [FeatureMMX, Feature3DNow]>;
-def : Proc<"k6-3", [FeatureMMX, Feature3DNow]>;
-def : Proc<"athlon", [FeatureMMX, Feature3DNowA]>;
-def : Proc<"athlon-tbird", [FeatureMMX, Feature3DNowA]>;
-def : Proc<"athlon-4", [FeatureSSE1, Feature3DNowA]>;
-def : Proc<"athlon-xp", [FeatureSSE1, Feature3DNowA]>;
-def : Proc<"athlon-mp", [FeatureSSE1, Feature3DNowA]>;
-def : Proc<"k8", [Feature3DNowA, Feature64Bit]>;
-def : Proc<"opteron", [Feature3DNowA, Feature64Bit]>;
-def : Proc<"athlon64", [Feature3DNowA, Feature64Bit]>;
-def : Proc<"athlon-fx", [Feature3DNowA, Feature64Bit]>;
-
-def : Proc<"winchip-c6", [FeatureMMX]>;
-def : Proc<"winchip2", [FeatureMMX, Feature3DNow]>;
-def : Proc<"c3", [FeatureMMX, Feature3DNow]>;
-def : Proc<"c3-2", [FeatureSSE1]>;
-
-//===----------------------------------------------------------------------===//
-// Register File Description
-//===----------------------------------------------------------------------===//
-
-include "X86RegisterInfo.td"
-
-//===----------------------------------------------------------------------===//
-// Instruction Descriptions
-//===----------------------------------------------------------------------===//
-
-include "X86InstrInfo.td"
-
-def X86InstrInfo : InstrInfo {
-
- // Define how we want to layout our TargetSpecific information field... This
- // should be kept up-to-date with the fields in the X86InstrInfo.h file.
- let TSFlagsFields = ["FormBits",
- "hasOpSizePrefix",
- "hasAdSizePrefix",
- "Prefix",
- "hasREX_WPrefix",
- "ImmTypeBits",
- "FPFormBits",
- "hasLockPrefix",
- "Opcode"];
- let TSFlagsShifts = [0,
- 6,
- 7,
- 8,
- 12,
- 13,
- 16,
- 19,
- 24];
-}
-
-//===----------------------------------------------------------------------===//
-// Calling Conventions
-//===----------------------------------------------------------------------===//
-
-include "X86CallingConv.td"
-
-
-//===----------------------------------------------------------------------===//
-// Assembly Printers
-//===----------------------------------------------------------------------===//
-
-// The X86 target supports two different syntaxes for emitting machine code.
-// This is controlled by the -x86-asm-syntax={att|intel}
-def ATTAsmWriter : AsmWriter {
- string AsmWriterClassName = "ATTAsmPrinter";
- int Variant = 0;
-}
-def IntelAsmWriter : AsmWriter {
- string AsmWriterClassName = "IntelAsmPrinter";
- int Variant = 1;
-}
-
-
-def X86 : Target {
- // Information about the instructions...
- let InstructionSet = X86InstrInfo;
-
- let AssemblyWriters = [ATTAsmWriter, IntelAsmWriter];
-}
diff --git a/release_23/lib/Target/X86/X86ATTAsmPrinter.cpp b/release_23/lib/Target/X86/X86ATTAsmPrinter.cpp
deleted file mode 100644
index 6909da1b2457..000000000000
--- a/release_23/lib/Target/X86/X86ATTAsmPrinter.cpp
+++ /dev/null
@@ -1,648 +0,0 @@
-//===-- X86ATTAsmPrinter.cpp - Convert X86 LLVM code to AT&T assembly -----===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains a printer that converts from our internal representation
-// of machine-dependent LLVM code to AT&T format assembly
-// language. This printer is the output mechanism used by `llc'.
-//
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "asm-printer"
-#include "X86ATTAsmPrinter.h"
-#include "X86.h"
-#include "X86COFF.h"
-#include "X86MachineFunctionInfo.h"
-#include "X86TargetMachine.h"
-#include "X86TargetAsmInfo.h"
-#include "llvm/ADT/StringExtras.h"
-#include "llvm/CallingConv.h"
-#include "llvm/CodeGen/MachineJumpTableInfo.h"
-#include "llvm/Module.h"
-#include "llvm/Support/Mangler.h"
-#include "llvm/Target/TargetAsmInfo.h"
-#include "llvm/Target/TargetOptions.h"
-#include "llvm/ADT/Statistic.h"
-using namespace llvm;
-
-STATISTIC(EmittedInsts, "Number of machine instrs printed");
-
-static std::string getPICLabelString(unsigned FnNum,
- const TargetAsmInfo *TAI,
- const X86Subtarget* Subtarget) {
- std::string label;
- if (Subtarget->isTargetDarwin())
- label = "\"L" + utostr_32(FnNum) + "$pb\"";
- else if (Subtarget->isTargetELF())
- label = ".Lllvm$" + utostr_32(FnNum) + "." + "$piclabel";
- else
- assert(0 && "Don't know how to print PIC label!\n");
-
- return label;
-}
-
-/// getSectionForFunction - Return the section that we should emit the
-/// specified function body into.
-std::string X86ATTAsmPrinter::getSectionForFunction(const Function &F) const {
- switch (F.getLinkage()) {
- default: assert(0 && "Unknown linkage type!");
- case Function::InternalLinkage:
- case Function::DLLExportLinkage:
- case Function::ExternalLinkage:
- return TAI->getTextSection();
- case Function::WeakLinkage:
- case Function::LinkOnceLinkage:
- if (Subtarget->isTargetDarwin()) {
- return ".section __TEXT,__textcoal_nt,coalesced,pure_instructions";
- } else if (Subtarget->isTargetCygMing()) {
- return "\t.section\t.text$linkonce." + CurrentFnName + ",\"ax\"";
- } else {
- return "\t.section\t.llvm.linkonce.t." + CurrentFnName +
- ",\"ax\",@progbits";
- }
- }
-}
-
-/// runOnMachineFunction - This uses the printMachineInstruction()
-/// method to print assembly for each instruction.
-///
-bool X86ATTAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
- if (TAI->doesSupportDebugInformation()) {
- // Let PassManager know we need debug information and relay
- // the MachineModuleInfo address on to DwarfWriter.
- MMI = &getAnalysis<MachineModuleInfo>();
- DW.SetModuleInfo(MMI);
- }
-
- SetupMachineFunction(MF);
- O << "\n\n";
-
- // Print out constants referenced by the function
- EmitConstantPool(MF.getConstantPool());
-
- // Print out labels for the function.
- const Function *F = MF.getFunction();
- unsigned CC = F->getCallingConv();
-
- // Populate function information map. Actually, We don't want to populate
- // non-stdcall or non-fastcall functions' information right now.
- if (CC == CallingConv::X86_StdCall || CC == CallingConv::X86_FastCall)
- FunctionInfoMap[F] = *MF.getInfo<X86MachineFunctionInfo>();
-
- X86SharedAsmPrinter::decorateName(CurrentFnName, F);
-
- SwitchToTextSection(getSectionForFunction(*F).c_str(), F);
-
- unsigned FnAlign = OptimizeForSize ? 1 : 4;
- switch (F->getLinkage()) {
- default: assert(0 && "Unknown linkage type!");
- case Function::InternalLinkage: // Symbols default to internal.
- EmitAlignment(FnAlign, F);
- break;
- case Function::DLLExportLinkage:
- DLLExportedFns.insert(Mang->makeNameProper(F->getName(), ""));
- //FALLS THROUGH
- case Function::ExternalLinkage:
- EmitAlignment(FnAlign, F);
- O << "\t.globl\t" << CurrentFnName << "\n";
- break;
- case Function::LinkOnceLinkage:
- case Function::WeakLinkage:
- EmitAlignment(FnAlign, F);
- if (Subtarget->isTargetDarwin()) {
- O << "\t.globl\t" << CurrentFnName << "\n";
- O << TAI->getWeakDefDirective() << CurrentFnName << "\n";
- } else if (Subtarget->isTargetCygMing()) {
- O << "\t.globl\t" << CurrentFnName << "\n";
- O << "\t.linkonce discard\n";
- } else {
- O << "\t.weak\t" << CurrentFnName << "\n";
- }
- break;
- }
- if (F->hasHiddenVisibility()) {
- if (const char *Directive = TAI->getHiddenDirective())
- O << Directive << CurrentFnName << "\n";
- } else if (F->hasProtectedVisibility()) {
- if (const char *Directive = TAI->getProtectedDirective())
- O << Directive << CurrentFnName << "\n";
- }
-
- if (Subtarget->isTargetELF())
- O << "\t.type\t" << CurrentFnName << ",@function\n";
- else if (Subtarget->isTargetCygMing()) {
- O << "\t.def\t " << CurrentFnName
- << ";\t.scl\t" <<
- (F->getLinkage() == Function::InternalLinkage ? COFF::C_STAT : COFF::C_EXT)
- << ";\t.type\t" << (COFF::DT_FCN << COFF::N_BTSHFT)
- << ";\t.endef\n";
- }
-
- O << CurrentFnName << ":\n";
- // Add some workaround for linkonce linkage on Cygwin\MinGW
- if (Subtarget->isTargetCygMing() &&
- (F->getLinkage() == Function::LinkOnceLinkage ||
- F->getLinkage() == Function::WeakLinkage))
- O << "Lllvm$workaround$fake$stub$" << CurrentFnName << ":\n";
-
- if (TAI->doesSupportDebugInformation() ||
- TAI->doesSupportExceptionHandling()) {
- // Emit pre-function debug and/or EH information.
- DW.BeginFunction(&MF);
- }
-
- // Print out code for the function.
- bool hasAnyRealCode = false;
- for (MachineFunction::const_iterator I = MF.begin(), E = MF.end();
- I != E; ++I) {
- // Print a label for the basic block.
- if (!I->pred_empty()) {
- printBasicBlockLabel(I, true, true);
- O << '\n';
- }
- for (MachineBasicBlock::const_iterator II = I->begin(), IE = I->end();
- II != IE; ++II) {
- // Print the assembly for the instruction.
- if (II->getOpcode() != X86::LABEL)
- hasAnyRealCode = true;
- printMachineInstruction(II);
- }
- }
-
- if (Subtarget->isTargetDarwin() && !hasAnyRealCode) {
- // If the function is empty, then we need to emit *something*. Otherwise,
- // the function's label might be associated with something that it wasn't
- // meant to be associated with. We emit a noop in this situation.
- // We are assuming inline asms are code.
- O << "\tnop\n";
- }
-
- if (TAI->hasDotTypeDotSizeDirective())
- O << "\t.size\t" << CurrentFnName << ", .-" << CurrentFnName << "\n";
-
- if (TAI->doesSupportDebugInformation()) {
- // Emit post-function debug information.
- DW.EndFunction();
- }
-
- // Print out jump tables referenced by the function.
- EmitJumpTableInfo(MF.getJumpTableInfo(), MF);
-
- // We didn't modify anything.
- return false;
-}
-
-static inline bool printGOT(TargetMachine &TM, const X86Subtarget* ST) {
- return ST->isPICStyleGOT() && TM.getRelocationModel() == Reloc::PIC_;
-}
-
-static inline bool printStub(TargetMachine &TM, const X86Subtarget* ST) {
- return ST->isPICStyleStub() && TM.getRelocationModel() != Reloc::Static;
-}
-
-void X86ATTAsmPrinter::printOperand(const MachineInstr *MI, unsigned OpNo,
- const char *Modifier, bool NotRIPRel) {
- const MachineOperand &MO = MI->getOperand(OpNo);
- switch (MO.getType()) {
- case MachineOperand::MO_Register: {
- assert(TargetRegisterInfo::isPhysicalRegister(MO.getReg()) &&
- "Virtual registers should not make it this far!");
- O << '%';
- unsigned Reg = MO.getReg();
- if (Modifier && strncmp(Modifier, "subreg", strlen("subreg")) == 0) {
- MVT::ValueType VT = (strcmp(Modifier+6,"64") == 0) ?
- MVT::i64 : ((strcmp(Modifier+6, "32") == 0) ? MVT::i32 :
- ((strcmp(Modifier+6,"16") == 0) ? MVT::i16 : MVT::i8));
- Reg = getX86SubSuperRegister(Reg, VT);
- }
- for (const char *Name = TRI->getAsmName(Reg); *Name; ++Name)
- O << (char)tolower(*Name);
- return;
- }
-
- case MachineOperand::MO_Immediate:
- if (!Modifier ||
- (strcmp(Modifier, "debug") && strcmp(Modifier, "mem")))
- O << '$';
- O << MO.getImm();
- return;
- case MachineOperand::MO_MachineBasicBlock:
- printBasicBlockLabel(MO.getMBB());
- return;
- case MachineOperand::MO_JumpTableIndex: {
- bool isMemOp = Modifier && !strcmp(Modifier, "mem");
- if (!isMemOp) O << '$';
- O << TAI->getPrivateGlobalPrefix() << "JTI" << getFunctionNumber() << "_"
- << MO.getIndex();
-
- if (TM.getRelocationModel() == Reloc::PIC_) {
- if (Subtarget->isPICStyleStub())
- O << "-\"" << TAI->getPrivateGlobalPrefix() << getFunctionNumber()
- << "$pb\"";
- else if (Subtarget->isPICStyleGOT())
- O << "@GOTOFF";
- }
-
- if (isMemOp && Subtarget->isPICStyleRIPRel() && !NotRIPRel)
- O << "(%rip)";
- return;
- }
- case MachineOperand::MO_ConstantPoolIndex: {
- bool isMemOp = Modifier && !strcmp(Modifier, "mem");
- if (!isMemOp) O << '$';
- O << TAI->getPrivateGlobalPrefix() << "CPI" << getFunctionNumber() << "_"
- << MO.getIndex();
-
- if (TM.getRelocationModel() == Reloc::PIC_) {
- if (Subtarget->isPICStyleStub())
- O << "-\"" << TAI->getPrivateGlobalPrefix() << getFunctionNumber()
- << "$pb\"";
- else if (Subtarget->isPICStyleGOT())
- O << "@GOTOFF";
- }
-
- int Offset = MO.getOffset();
- if (Offset > 0)
- O << "+" << Offset;
- else if (Offset < 0)
- O << Offset;
-
- if (isMemOp && Subtarget->isPICStyleRIPRel() && !NotRIPRel)
- O << "(%rip)";
- return;
- }
- case MachineOperand::MO_GlobalAddress: {
- bool isCallOp = Modifier && !strcmp(Modifier, "call");
- bool isMemOp = Modifier && !strcmp(Modifier, "mem");
- bool needCloseParen = false;
-
- const GlobalValue *GV = MO.getGlobal();
- const GlobalVariable *GVar = dyn_cast<GlobalVariable>(GV);
- if (!GVar) {
- // If GV is an alias then use the aliasee for determining
- // thread-localness.
- if (const GlobalAlias *GA = dyn_cast<GlobalAlias>(GV))
- GVar = dyn_cast_or_null<GlobalVariable>(GA->resolveAliasedGlobal());
- }
-
- bool isThreadLocal = GVar && GVar->isThreadLocal();
-
- std::string Name = Mang->getValueName(GV);
- X86SharedAsmPrinter::decorateName(Name, GV);
-
- if (!isMemOp && !isCallOp)
- O << '$';
- else if (Name[0] == '$') {
- // The name begins with a dollar-sign. In order to avoid having it look
- // like an integer immediate to the assembler, enclose it in parens.
- O << '(';
- needCloseParen = true;
- }
-
- if (printStub(TM, Subtarget)) {
- // Link-once, declaration, or Weakly-linked global variables need
- // non-lazily-resolved stubs
- if (GV->isDeclaration() ||
- GV->hasWeakLinkage() ||
- GV->hasLinkOnceLinkage()) {
- // Dynamically-resolved functions need a stub for the function.
- if (isCallOp && isa<Function>(GV)) {
- FnStubs.insert(Name);
- O << TAI->getPrivateGlobalPrefix() << Name << "$stub";
- } else {
- GVStubs.insert(Name);
- O << TAI->getPrivateGlobalPrefix() << Name << "$non_lazy_ptr";
- }
- } else {
- if (GV->hasDLLImportLinkage())
- O << "__imp_";
- O << Name;
- }
-
- if (!isCallOp && TM.getRelocationModel() == Reloc::PIC_)
- O << '-' << getPICLabelString(getFunctionNumber(), TAI, Subtarget);
- } else {
- if (GV->hasDLLImportLinkage()) {
- O << "__imp_";
- }
- O << Name;
-
- if (isCallOp && isa<Function>(GV)) {
- if (printGOT(TM, Subtarget)) {
- // Assemble call via PLT for non-local symbols
- if (!(GV->hasHiddenVisibility() || GV->hasProtectedVisibility()) ||
- GV->isDeclaration())
- O << "@PLT";
- }
- if (Subtarget->isTargetCygMing() && GV->isDeclaration())
- // Save function name for later type emission
- FnStubs.insert(Name);
- }
- }
-
- if (GV->hasExternalWeakLinkage())
- ExtWeakSymbols.insert(GV);
-
- int Offset = MO.getOffset();
- if (Offset > 0)
- O << "+" << Offset;
- else if (Offset < 0)
- O << Offset;
-
- if (isThreadLocal) {
- if (TM.getRelocationModel() == Reloc::PIC_ || Subtarget->is64Bit())
- O << "@TLSGD"; // general dynamic TLS model
- else
- if (GV->isDeclaration())
- O << "@INDNTPOFF"; // initial exec TLS model
- else
- O << "@NTPOFF"; // local exec TLS model
- } else if (isMemOp) {
- if (printGOT(TM, Subtarget)) {
- if (Subtarget->GVRequiresExtraLoad(GV, TM, false))
- O << "@GOT";
- else
- O << "@GOTOFF";
- } else if (Subtarget->isPICStyleRIPRel() && !NotRIPRel &&
- TM.getRelocationModel() != Reloc::Static) {
- if (Subtarget->GVRequiresExtraLoad(GV, TM, false))
- O << "@GOTPCREL";
-
- if (needCloseParen) {
- needCloseParen = false;
- O << ')';
- }
-
- // Use rip when possible to reduce code size, except when
- // index or base register are also part of the address. e.g.
- // foo(%rip)(%rcx,%rax,4) is not legal
- O << "(%rip)";
- }
- }
-
- if (needCloseParen)
- O << ')';
-
- return;
- }
- case MachineOperand::MO_ExternalSymbol: {
- bool isCallOp = Modifier && !strcmp(Modifier, "call");
- bool needCloseParen = false;
- std::string Name(TAI->getGlobalPrefix());
- Name += MO.getSymbolName();
- if (isCallOp && printStub(TM, Subtarget)) {
- FnStubs.insert(Name);
- O << TAI->getPrivateGlobalPrefix() << Name << "$stub";
- return;
- }
- if (!isCallOp)
- O << '$';
- else if (Name[0] == '$') {
- // The name begins with a dollar-sign. In order to avoid having it look
- // like an integer immediate to the assembler, enclose it in parens.
- O << '(';
- needCloseParen = true;
- }
-
- O << Name;
-
- if (printGOT(TM, Subtarget)) {
- std::string GOTName(TAI->getGlobalPrefix());
- GOTName+="_GLOBAL_OFFSET_TABLE_";
- if (Name == GOTName)
- // HACK! Emit extra offset to PC during printing GOT offset to
- // compensate for the size of popl instruction. The resulting code
- // should look like:
- // call .piclabel
- // piclabel:
- // popl %some_register
- // addl $_GLOBAL_ADDRESS_TABLE_ + [.-piclabel], %some_register
- O << " + [.-"
- << getPICLabelString(getFunctionNumber(), TAI, Subtarget) << "]";
-
- if (isCallOp)
- O << "@PLT";
- }
-
- if (needCloseParen)
- O << ')';
-
- if (!isCallOp && Subtarget->isPICStyleRIPRel())
- O << "(%rip)";
-
- return;
- }
- default:
- O << "<unknown operand type>"; return;
- }
-}
-
-void X86ATTAsmPrinter::printSSECC(const MachineInstr *MI, unsigned Op) {
- unsigned char value = MI->getOperand(Op).getImm();
- assert(value <= 7 && "Invalid ssecc argument!");
- switch (value) {
- case 0: O << "eq"; break;
- case 1: O << "lt"; break;
- case 2: O << "le"; break;
- case 3: O << "unord"; break;
- case 4: O << "neq"; break;
- case 5: O << "nlt"; break;
- case 6: O << "nle"; break;
- case 7: O << "ord"; break;
- }
-}
-
-void X86ATTAsmPrinter::printMemReference(const MachineInstr *MI, unsigned Op,
- const char *Modifier){
- assert(isMem(MI, Op) && "Invalid memory reference!");
- MachineOperand BaseReg = MI->getOperand(Op);
- MachineOperand IndexReg = MI->getOperand(Op+2);
- const MachineOperand &DispSpec = MI->getOperand(Op+3);
-
- bool NotRIPRel = IndexReg.getReg() || BaseReg.getReg();
- if (DispSpec.isGlobalAddress() ||
- DispSpec.isConstantPoolIndex() ||
- DispSpec.isJumpTableIndex()) {
- printOperand(MI, Op+3, "mem", NotRIPRel);
- } else {
- int DispVal = DispSpec.getImm();
- if (DispVal || (!IndexReg.getReg() && !BaseReg.getReg()))
- O << DispVal;
- }
-
- if (IndexReg.getReg() || BaseReg.getReg()) {
- unsigned ScaleVal = MI->getOperand(Op+1).getImm();
- unsigned BaseRegOperand = 0, IndexRegOperand = 2;
-
- // There are cases where we can end up with ESP/RSP in the indexreg slot.
- // If this happens, swap the base/index register to support assemblers that
- // don't work when the index is *SP.
- if (IndexReg.getReg() == X86::ESP || IndexReg.getReg() == X86::RSP) {
- assert(ScaleVal == 1 && "Scale not supported for stack pointer!");
- std::swap(BaseReg, IndexReg);
- std::swap(BaseRegOperand, IndexRegOperand);
- }
-
- O << "(";
- if (BaseReg.getReg())
- printOperand(MI, Op+BaseRegOperand, Modifier);
-
- if (IndexReg.getReg()) {
- O << ",";
- printOperand(MI, Op+IndexRegOperand, Modifier);
- if (ScaleVal != 1)
- O << "," << ScaleVal;
- }
- O << ")";
- }
-}
-
-void X86ATTAsmPrinter::printPICJumpTableSetLabel(unsigned uid,
- const MachineBasicBlock *MBB) const {
- if (!TAI->getSetDirective())
- return;
-
- // We don't need .set machinery if we have GOT-style relocations
- if (Subtarget->isPICStyleGOT())
- return;
-
- O << TAI->getSetDirective() << ' ' << TAI->getPrivateGlobalPrefix()
- << getFunctionNumber() << '_' << uid << "_set_" << MBB->getNumber() << ',';
- printBasicBlockLabel(MBB, false, false, false);
- if (Subtarget->isPICStyleRIPRel())
- O << '-' << TAI->getPrivateGlobalPrefix() << "JTI" << getFunctionNumber()
- << '_' << uid << '\n';
- else
- O << '-' << getPICLabelString(getFunctionNumber(), TAI, Subtarget) << '\n';
-}
-
-void X86ATTAsmPrinter::printPICLabel(const MachineInstr *MI, unsigned Op) {
- std::string label = getPICLabelString(getFunctionNumber(), TAI, Subtarget);
- O << label << "\n" << label << ":";
-}
-
-
-void X86ATTAsmPrinter::printPICJumpTableEntry(const MachineJumpTableInfo *MJTI,
- const MachineBasicBlock *MBB,
- unsigned uid) const
-{
- const char *JTEntryDirective = MJTI->getEntrySize() == 4 ?
- TAI->getData32bitsDirective() : TAI->getData64bitsDirective();
-
- O << JTEntryDirective << ' ';
-
- if (TM.getRelocationModel() == Reloc::PIC_) {
- if (Subtarget->isPICStyleRIPRel() || Subtarget->isPICStyleStub()) {
- O << TAI->getPrivateGlobalPrefix() << getFunctionNumber()
- << '_' << uid << "_set_" << MBB->getNumber();
- } else if (Subtarget->isPICStyleGOT()) {
- printBasicBlockLabel(MBB, false, false, false);
- O << "@GOTOFF";
- } else
- assert(0 && "Don't know how to print MBB label for this PIC mode");
- } else
- printBasicBlockLabel(MBB, false, false, false);
-}
-
-bool X86ATTAsmPrinter::printAsmMRegister(const MachineOperand &MO,
- const char Mode) {
- unsigned Reg = MO.getReg();
- switch (Mode) {
- default: return true; // Unknown mode.
- case 'b': // Print QImode register
- Reg = getX86SubSuperRegister(Reg, MVT::i8);
- break;
- case 'h': // Print QImode high register
- Reg = getX86SubSuperRegister(Reg, MVT::i8, true);
- break;
- case 'w': // Print HImode register
- Reg = getX86SubSuperRegister(Reg, MVT::i16);
- break;
- case 'k': // Print SImode register
- Reg = getX86SubSuperRegister(Reg, MVT::i32);
- break;
- case 'q': // Print DImode register
- Reg = getX86SubSuperRegister(Reg, MVT::i64);
- break;
- }
-
- O << '%';
- for (const char *Name = TRI->getAsmName(Reg); *Name; ++Name)
- O << (char)tolower(*Name);
- return false;
-}
-
-/// PrintAsmOperand - Print out an operand for an inline asm expression.
-///
-bool X86ATTAsmPrinter::PrintAsmOperand(const MachineInstr *MI, unsigned OpNo,
- unsigned AsmVariant,
- const char *ExtraCode) {
- // Does this asm operand have a single letter operand modifier?
- if (ExtraCode && ExtraCode[0]) {
- if (ExtraCode[1] != 0) return true; // Unknown modifier.
-
- switch (ExtraCode[0]) {
- default: return true; // Unknown modifier.
- case 'c': // Don't print "$" before a global var name or constant.
- printOperand(MI, OpNo, "mem");
- return false;
- case 'b': // Print QImode register
- case 'h': // Print QImode high register
- case 'w': // Print HImode register
- case 'k': // Print SImode register
- case 'q': // Print DImode register
- if (MI->getOperand(OpNo).isRegister())
- return printAsmMRegister(MI->getOperand(OpNo), ExtraCode[0]);
- printOperand(MI, OpNo);
- return false;
-
- case 'P': // Don't print @PLT, but do print as memory.
- printOperand(MI, OpNo, "mem");
- return false;
- }
- }
-
- printOperand(MI, OpNo);
- return false;
-}
-
-bool X86ATTAsmPrinter::PrintAsmMemoryOperand(const MachineInstr *MI,
- unsigned OpNo,
- unsigned AsmVariant,
- const char *ExtraCode) {
- if (ExtraCode && ExtraCode[0]) {
- if (ExtraCode[1] != 0) return true; // Unknown modifier.
-
- switch (ExtraCode[0]) {
- default: return true; // Unknown modifier.
- case 'b': // Print QImode register
- case 'h': // Print QImode high register
- case 'w': // Print HImode register
- case 'k': // Print SImode register
- case 'q': // Print SImode register
- // These only apply to registers, ignore on mem.
- break;
- }
- }
- printMemReference(MI, OpNo);
- return false;
-}
-
-/// printMachineInstruction -- Print out a single X86 LLVM instruction
-/// MI in AT&T syntax to the current output stream.
-///
-void X86ATTAsmPrinter::printMachineInstruction(const MachineInstr *MI) {
- ++EmittedInsts;
-
- // Call the autogenerated instruction printer routines.
- printInstruction(MI);
-}
-
-// Include the auto-generated portion of the assembly writer.
-#include "X86GenAsmWriter.inc"
-
diff --git a/release_23/lib/Target/X86/X86ATTAsmPrinter.h b/release_23/lib/Target/X86/X86ATTAsmPrinter.h
deleted file mode 100644
index de167e737ba6..000000000000
--- a/release_23/lib/Target/X86/X86ATTAsmPrinter.h
+++ /dev/null
@@ -1,102 +0,0 @@
-//===-- X86ATTAsmPrinter.h - Convert X86 LLVM code to AT&T assembly -------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// AT&T assembly code printer class.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef X86ATTASMPRINTER_H
-#define X86ATTASMPRINTER_H
-
-#include "X86AsmPrinter.h"
-#include "llvm/CodeGen/ValueTypes.h"
-
-namespace llvm {
-
-struct MachineJumpTableInfo;
-
-struct VISIBILITY_HIDDEN X86ATTAsmPrinter : public X86SharedAsmPrinter {
- X86ATTAsmPrinter(std::ostream &O, X86TargetMachine &TM, const TargetAsmInfo *T)
- : X86SharedAsmPrinter(O, TM, T) { }
-
- virtual const char *getPassName() const {
- return "X86 AT&T-Style Assembly Printer";
- }
-
- /// printInstruction - This method is automatically generated by tablegen
- /// from the instruction set description. This method returns true if the
- /// machine instruction was sufficiently described to print it, otherwise it
- /// returns false.
- bool printInstruction(const MachineInstr *MI);
-
- // These methods are used by the tablegen'erated instruction printer.
- void printOperand(const MachineInstr *MI, unsigned OpNo,
- const char *Modifier = 0, bool NotRIPRel = false);
- void printi8mem(const MachineInstr *MI, unsigned OpNo) {
- printMemReference(MI, OpNo);
- }
- void printi16mem(const MachineInstr *MI, unsigned OpNo) {
- printMemReference(MI, OpNo);
- }
- void printi32mem(const MachineInstr *MI, unsigned OpNo) {
- printMemReference(MI, OpNo);
- }
- void printi64mem(const MachineInstr *MI, unsigned OpNo) {
- printMemReference(MI, OpNo);
- }
- void printi128mem(const MachineInstr *MI, unsigned OpNo) {
- printMemReference(MI, OpNo);
- }
- void printf32mem(const MachineInstr *MI, unsigned OpNo) {
- printMemReference(MI, OpNo);
- }
- void printf64mem(const MachineInstr *MI, unsigned OpNo) {
- printMemReference(MI, OpNo);
- }
- void printf80mem(const MachineInstr *MI, unsigned OpNo) {
- printMemReference(MI, OpNo);
- }
- void printf128mem(const MachineInstr *MI, unsigned OpNo) {
- printMemReference(MI, OpNo);
- }
- void printlea64_32mem(const MachineInstr *MI, unsigned OpNo) {
- printMemReference(MI, OpNo, "subreg64");
- }
-
- bool printAsmMRegister(const MachineOperand &MO, const char Mode);
- bool PrintAsmOperand(const MachineInstr *MI, unsigned OpNo,
- unsigned AsmVariant, const char *ExtraCode);
- bool PrintAsmMemoryOperand(const MachineInstr *MI, unsigned OpNo,
- unsigned AsmVariant, const char *ExtraCode);
-
- void printMachineInstruction(const MachineInstr *MI);
- void printSSECC(const MachineInstr *MI, unsigned Op);
- void printMemReference(const MachineInstr *MI, unsigned Op,
- const char *Modifier=NULL);
- void printPICJumpTableSetLabel(unsigned uid,
- const MachineBasicBlock *MBB) const;
- void printPICJumpTableSetLabel(unsigned uid, unsigned uid2,
- const MachineBasicBlock *MBB) const {
- AsmPrinter::printPICJumpTableSetLabel(uid, uid2, MBB);
- }
- void printPICJumpTableEntry(const MachineJumpTableInfo *MJTI,
- const MachineBasicBlock *MBB,
- unsigned uid) const;
-
- void printPICLabel(const MachineInstr *MI, unsigned Op);
- bool runOnMachineFunction(MachineFunction &F);
-
- /// getSectionForFunction - Return the section that we should emit the
- /// specified function body into.
- virtual std::string getSectionForFunction(const Function &F) const;
-};
-
-} // end namespace llvm
-
-#endif
diff --git a/release_23/lib/Target/X86/X86AsmPrinter.cpp b/release_23/lib/Target/X86/X86AsmPrinter.cpp
deleted file mode 100644
index e1bc65fc5d64..000000000000
--- a/release_23/lib/Target/X86/X86AsmPrinter.cpp
+++ /dev/null
@@ -1,447 +0,0 @@
-//===-- X86AsmPrinter.cpp - Convert X86 LLVM IR to X86 assembly -----------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file the shared super class printer that converts from our internal
-// representation of machine-dependent LLVM code to Intel and AT&T format
-// assembly language.
-// This printer is the output mechanism used by `llc'.
-//
-//===----------------------------------------------------------------------===//
-
-#include "X86AsmPrinter.h"
-#include "X86ATTAsmPrinter.h"
-#include "X86COFF.h"
-#include "X86IntelAsmPrinter.h"
-#include "X86MachineFunctionInfo.h"
-#include "X86Subtarget.h"
-#include "llvm/ADT/StringExtras.h"
-#include "llvm/CallingConv.h"
-#include "llvm/Constants.h"
-#include "llvm/Module.h"
-#include "llvm/DerivedTypes.h"
-#include "llvm/ParameterAttributes.h"
-#include "llvm/Type.h"
-#include "llvm/Assembly/Writer.h"
-#include "llvm/Support/Mangler.h"
-#include "llvm/Target/TargetAsmInfo.h"
-#include "llvm/Target/TargetOptions.h"
-using namespace llvm;
-
-static X86MachineFunctionInfo calculateFunctionInfo(const Function *F,
- const TargetData *TD) {
- X86MachineFunctionInfo Info;
- uint64_t Size = 0;
-
- switch (F->getCallingConv()) {
- case CallingConv::X86_StdCall:
- Info.setDecorationStyle(StdCall);
- break;
- case CallingConv::X86_FastCall:
- Info.setDecorationStyle(FastCall);
- break;
- default:
- return Info;
- }
-
- unsigned argNum = 1;
- for (Function::const_arg_iterator AI = F->arg_begin(), AE = F->arg_end();
- AI != AE; ++AI, ++argNum) {
- const Type* Ty = AI->getType();
-
- // 'Dereference' type in case of byval parameter attribute
- if (F->paramHasAttr(argNum, ParamAttr::ByVal))
- Ty = cast<PointerType>(Ty)->getElementType();
-
- // Size should be aligned to DWORD boundary
- Size += ((TD->getABITypeSize(Ty) + 3)/4)*4;
- }
-
- // We're not supporting tooooo huge arguments :)
- Info.setBytesToPopOnReturn((unsigned int)Size);
- return Info;
-}
-
-
-/// decorateName - Query FunctionInfoMap and use this information for various
-/// name decoration.
-void X86SharedAsmPrinter::decorateName(std::string &Name,
- const GlobalValue *GV) {
- const Function *F = dyn_cast<Function>(GV);
- if (!F) return;
-
- // We don't want to decorate non-stdcall or non-fastcall functions right now
- unsigned CC = F->getCallingConv();
- if (CC != CallingConv::X86_StdCall && CC != CallingConv::X86_FastCall)
- return;
-
- // Decorate names only when we're targeting Cygwin/Mingw32 targets
- if (!Subtarget->isTargetCygMing())
- return;
-
- FMFInfoMap::const_iterator info_item = FunctionInfoMap.find(F);
-
- const X86MachineFunctionInfo *Info;
- if (info_item == FunctionInfoMap.end()) {
- // Calculate apropriate function info and populate map
- FunctionInfoMap[F] = calculateFunctionInfo(F, TM.getTargetData());
- Info = &FunctionInfoMap[F];
- } else {
- Info = &info_item->second;
- }
-
- const FunctionType *FT = F->getFunctionType();
- switch (Info->getDecorationStyle()) {
- case None:
- break;
- case StdCall:
- // "Pure" variadic functions do not receive @0 suffix.
- if (!FT->isVarArg() || (FT->getNumParams() == 0) ||
- (FT->getNumParams() == 1 && F->hasStructRetAttr()))
- Name += '@' + utostr_32(Info->getBytesToPopOnReturn());
- break;
- case FastCall:
- // "Pure" variadic functions do not receive @0 suffix.
- if (!FT->isVarArg() || (FT->getNumParams() == 0) ||
- (FT->getNumParams() == 1 && F->hasStructRetAttr()))
- Name += '@' + utostr_32(Info->getBytesToPopOnReturn());
-
- if (Name[0] == '_') {
- Name[0] = '@';
- } else {
- Name = '@' + Name;
- }
- break;
- default:
- assert(0 && "Unsupported DecorationStyle");
- }
-}
-
-/// doInitialization
-bool X86SharedAsmPrinter::doInitialization(Module &M) {
- if (TAI->doesSupportDebugInformation()) {
- // Emit initial debug information.
- DW.BeginModule(&M);
- }
-
- bool Result = AsmPrinter::doInitialization(M);
-
- // Darwin wants symbols to be quoted if they have complex names.
- if (Subtarget->isTargetDarwin())
- Mang->setUseQuotes(true);
-
- return Result;
-}
-
-/// PrintUnmangledNameSafely - Print out the printable characters in the name.
-/// Don't print things like \n or \0.
-static void PrintUnmangledNameSafely(const Value *V, std::ostream &OS) {
- for (const char *Name = V->getNameStart(), *E = Name+V->getNameLen();
- Name != E; ++Name)
- if (isprint(*Name))
- OS << *Name;
-}
-
-bool X86SharedAsmPrinter::doFinalization(Module &M) {
- // Note: this code is not shared by the Intel printer as it is too different
- // from how MASM does things. When making changes here don't forget to look
- // at X86IntelAsmPrinter::doFinalization().
- const TargetData *TD = TM.getTargetData();
-
- // Print out module-level global variables here.
- for (Module::const_global_iterator I = M.global_begin(), E = M.global_end();
- I != E; ++I) {
- if (!I->hasInitializer())
- continue; // External global require no code
-
- // Check to see if this is a special global used by LLVM, if so, emit it.
- if (EmitSpecialLLVMGlobal(I)) {
- if (Subtarget->isTargetDarwin() &&
- TM.getRelocationModel() == Reloc::Static) {
- if (I->getName() == "llvm.global_ctors")
- O << ".reference .constructors_used\n";
- else if (I->getName() == "llvm.global_dtors")
- O << ".reference .destructors_used\n";
- }
- continue;
- }
-
- std::string name = Mang->getValueName(I);
- Constant *C = I->getInitializer();
- const Type *Type = C->getType();
- unsigned Size = TD->getABITypeSize(Type);
- unsigned Align = TD->getPreferredAlignmentLog(I);
-
- if (I->hasHiddenVisibility()) {
- if (const char *Directive = TAI->getHiddenDirective())
- O << Directive << name << "\n";
- } else if (I->hasProtectedVisibility()) {
- if (const char *Directive = TAI->getProtectedDirective())
- O << Directive << name << "\n";
- }
-
- if (Subtarget->isTargetELF())
- O << "\t.type\t" << name << ",@object\n";
-
- if (C->isNullValue() && !I->hasSection()) {
- if (I->hasExternalLinkage()) {
- if (const char *Directive = TAI->getZeroFillDirective()) {
- O << "\t.globl " << name << "\n";
- O << Directive << "__DATA, __common, " << name << ", "
- << Size << ", " << Align << "\n";
- continue;
- }
- }
-
- if (!I->isThreadLocal() &&
- (I->hasInternalLinkage() || I->hasWeakLinkage() ||
- I->hasLinkOnceLinkage())) {
- if (Size == 0) Size = 1; // .comm Foo, 0 is undefined, avoid it.
- if (!NoZerosInBSS && TAI->getBSSSection())
- SwitchToDataSection(TAI->getBSSSection(), I);
- else
- SwitchToDataSection(TAI->getDataSection(), I);
- if (TAI->getLCOMMDirective() != NULL) {
- if (I->hasInternalLinkage()) {
- O << TAI->getLCOMMDirective() << name << "," << Size;
- if (Subtarget->isTargetDarwin())
- O << "," << Align;
- } else {
- O << TAI->getCOMMDirective() << name << "," << Size;
-
- // Leopard and above support aligned common symbols.
- if (Subtarget->getDarwinVers() >= 9)
- O << "," << Align;
- }
- } else {
- if (!Subtarget->isTargetCygMing()) {
- if (I->hasInternalLinkage())
- O << "\t.local\t" << name << "\n";
- }
- O << TAI->getCOMMDirective() << name << "," << Size;
- if (TAI->getCOMMDirectiveTakesAlignment())
- O << "," << (TAI->getAlignmentIsInBytes() ? (1 << Align) : Align);
- }
- O << "\t\t" << TAI->getCommentString() << " ";
- PrintUnmangledNameSafely(I, O);
- O << "\n";
- continue;
- }
- }
-
- switch (I->getLinkage()) {
- case GlobalValue::LinkOnceLinkage:
- case GlobalValue::WeakLinkage:
- if (Subtarget->isTargetDarwin()) {
- O << "\t.globl " << name << "\n"
- << TAI->getWeakDefDirective() << name << "\n";
- SwitchToDataSection("\t.section __DATA,__datacoal_nt,coalesced", I);
- } else if (Subtarget->isTargetCygMing()) {
- std::string SectionName(".section\t.data$linkonce." +
- name +
- ",\"aw\"");
- SwitchToDataSection(SectionName.c_str(), I);
- O << "\t.globl\t" << name << "\n"
- << "\t.linkonce same_size\n";
- } else {
- std::string SectionName("\t.section\t.llvm.linkonce.d." +
- name +
- ",\"aw\",@progbits");
- SwitchToDataSection(SectionName.c_str(), I);
- O << "\t.weak\t" << name << "\n";
- }
- break;
- case GlobalValue::DLLExportLinkage:
- DLLExportedGVs.insert(Mang->makeNameProper(I->getName(),""));
- // FALL THROUGH
- case GlobalValue::AppendingLinkage:
- // FIXME: appending linkage variables should go into a section of
- // their name or something. For now, just emit them as external.
- case GlobalValue::ExternalLinkage:
- // If external or appending, declare as a global symbol
- O << "\t.globl " << name << "\n";
- // FALL THROUGH
- case GlobalValue::InternalLinkage: {
- if (I->isConstant()) {
- const ConstantArray *CVA = dyn_cast<ConstantArray>(C);
- if (TAI->getCStringSection() && CVA && CVA->isCString()) {
- SwitchToDataSection(TAI->getCStringSection(), I);
- break;
- }
- }
- // FIXME: special handling for ".ctors" & ".dtors" sections
- if (I->hasSection() &&
- (I->getSection() == ".ctors" ||
- I->getSection() == ".dtors")) {
- std::string SectionName = ".section " + I->getSection();
-
- if (Subtarget->isTargetCygMing()) {
- SectionName += ",\"aw\"";
- } else {
- assert(!Subtarget->isTargetDarwin());
- SectionName += ",\"aw\",@progbits";
- }
- SwitchToDataSection(SectionName.c_str());
- } else if (I->hasSection() && Subtarget->isTargetDarwin()) {
- // Honor all section names on Darwin; ObjC uses this
- std::string SectionName = ".section " + I->getSection();
- SwitchToDataSection(SectionName.c_str());
- } else {
- if (C->isNullValue() && !NoZerosInBSS && TAI->getBSSSection())
- SwitchToDataSection(I->isThreadLocal() ? TAI->getTLSBSSSection() :
- TAI->getBSSSection(), I);
- else if (!I->isConstant())
- SwitchToDataSection(I->isThreadLocal() ? TAI->getTLSDataSection() :
- TAI->getDataSection(), I);
- else if (I->isThreadLocal())
- SwitchToDataSection(TAI->getTLSDataSection());
- else {
- // Read-only data.
- bool HasReloc = C->ContainsRelocations();
- if (HasReloc &&
- Subtarget->isTargetDarwin() &&
- TM.getRelocationModel() != Reloc::Static)
- SwitchToDataSection("\t.const_data\n");
- else if (!HasReloc && Size == 4 &&
- TAI->getFourByteConstantSection())
- SwitchToDataSection(TAI->getFourByteConstantSection(), I);
- else if (!HasReloc && Size == 8 &&
- TAI->getEightByteConstantSection())
- SwitchToDataSection(TAI->getEightByteConstantSection(), I);
- else if (!HasReloc && Size == 16 &&
- TAI->getSixteenByteConstantSection())
- SwitchToDataSection(TAI->getSixteenByteConstantSection(), I);
- else if (TAI->getReadOnlySection())
- SwitchToDataSection(TAI->getReadOnlySection(), I);
- else
- SwitchToDataSection(TAI->getDataSection(), I);
- }
- }
-
- break;
- }
- default:
- assert(0 && "Unknown linkage type!");
- }
-
- EmitAlignment(Align, I);
- O << name << ":\t\t\t\t" << TAI->getCommentString() << " ";
- PrintUnmangledNameSafely(I, O);
- O << "\n";
- if (TAI->hasDotTypeDotSizeDirective())
- O << "\t.size\t" << name << ", " << Size << "\n";
- // If the initializer is a extern weak symbol, remember to emit the weak
- // reference!
- if (const GlobalValue *GV = dyn_cast<GlobalValue>(C))
- if (GV->hasExternalWeakLinkage())
- ExtWeakSymbols.insert(GV);
-
- EmitGlobalConstant(C);
- }
-
- // Output linker support code for dllexported globals
- if (!DLLExportedGVs.empty()) {
- SwitchToDataSection(".section .drectve");
- }
-
- for (std::set<std::string>::iterator i = DLLExportedGVs.begin(),
- e = DLLExportedGVs.end();
- i != e; ++i) {
- O << "\t.ascii \" -export:" << *i << ",data\"\n";
- }
-
- if (!DLLExportedFns.empty()) {
- SwitchToDataSection(".section .drectve");
- }
-
- for (std::set<std::string>::iterator i = DLLExportedFns.begin(),
- e = DLLExportedFns.end();
- i != e; ++i) {
- O << "\t.ascii \" -export:" << *i << "\"\n";
- }
-
- if (Subtarget->isTargetDarwin()) {
- SwitchToDataSection("");
-
- // Output stubs for dynamically-linked functions
- unsigned j = 1;
- for (std::set<std::string>::iterator i = FnStubs.begin(), e = FnStubs.end();
- i != e; ++i, ++j) {
- SwitchToDataSection("\t.section __IMPORT,__jump_table,symbol_stubs,"
- "self_modifying_code+pure_instructions,5", 0);
- O << "L" << *i << "$stub:\n";
- O << "\t.indirect_symbol " << *i << "\n";
- O << "\thlt ; hlt ; hlt ; hlt ; hlt\n";
- }
-
- O << "\n";
-
- if (TAI->doesSupportExceptionHandling() && MMI && !Subtarget->is64Bit()) {
- // Add the (possibly multiple) personalities to the set of global values.
- // Only referenced functions get into the Personalities list.
- const std::vector<Function *>& Personalities = MMI->getPersonalities();
-
- for (std::vector<Function *>::const_iterator I = Personalities.begin(),
- E = Personalities.end(); I != E; ++I)
- if (*I) GVStubs.insert("_" + (*I)->getName());
- }
-
- // Output stubs for external and common global variables.
- if (!GVStubs.empty())
- SwitchToDataSection(
- "\t.section __IMPORT,__pointers,non_lazy_symbol_pointers");
- for (std::set<std::string>::iterator i = GVStubs.begin(), e = GVStubs.end();
- i != e; ++i) {
- O << "L" << *i << "$non_lazy_ptr:\n";
- O << "\t.indirect_symbol " << *i << "\n";
- O << "\t.long\t0\n";
- }
-
- // Emit final debug information.
- DW.EndModule();
-
- // Funny Darwin hack: This flag tells the linker that no global symbols
- // contain code that falls through to other global symbols (e.g. the obvious
- // implementation of multiple entry points). If this doesn't occur, the
- // linker can safely perform dead code stripping. Since LLVM never
- // generates code that does this, it is always safe to set.
- O << "\t.subsections_via_symbols\n";
- } else if (Subtarget->isTargetCygMing()) {
- // Emit type information for external functions
- for (std::set<std::string>::iterator i = FnStubs.begin(), e = FnStubs.end();
- i != e; ++i) {
- O << "\t.def\t " << *i
- << ";\t.scl\t" << COFF::C_EXT
- << ";\t.type\t" << (COFF::DT_FCN << COFF::N_BTSHFT)
- << ";\t.endef\n";
- }
-
- // Emit final debug information.
- DW.EndModule();
- } else if (Subtarget->isTargetELF()) {
- // Emit final debug information.
- DW.EndModule();
- }
-
- return AsmPrinter::doFinalization(M);
-}
-
-/// createX86CodePrinterPass - Returns a pass that prints the X86 assembly code
-/// for a MachineFunction to the given output stream, using the given target
-/// machine description.
-///
-FunctionPass *llvm::createX86CodePrinterPass(std::ostream &o,
- X86TargetMachine &tm) {
- const X86Subtarget *Subtarget = &tm.getSubtarget<X86Subtarget>();
-
- if (Subtarget->isFlavorIntel()) {
- return new X86IntelAsmPrinter(o, tm, tm.getTargetAsmInfo());
- } else {
- return new X86ATTAsmPrinter(o, tm, tm.getTargetAsmInfo());
- }
-}
diff --git a/release_23/lib/Target/X86/X86AsmPrinter.h b/release_23/lib/Target/X86/X86AsmPrinter.h
deleted file mode 100644
index 6c47e0c27e8f..000000000000
--- a/release_23/lib/Target/X86/X86AsmPrinter.h
+++ /dev/null
@@ -1,98 +0,0 @@
-//===-- X86AsmPrinter.h - Convert X86 LLVM code to Intel assembly ---------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file the shared super class printer that converts from our internal
-// representation of machine-dependent LLVM code to Intel and AT&T format
-// assembly language. This printer is the output mechanism used by `llc'.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef X86ASMPRINTER_H
-#define X86ASMPRINTER_H
-
-#include "X86.h"
-#include "X86MachineFunctionInfo.h"
-#include "X86TargetMachine.h"
-#include "llvm/CodeGen/AsmPrinter.h"
-#include "llvm/CodeGen/DwarfWriter.h"
-#include "llvm/CodeGen/MachineModuleInfo.h"
-#include "llvm/Support/Compiler.h"
-#include <set>
-
-
-namespace llvm {
-
-struct VISIBILITY_HIDDEN X86SharedAsmPrinter : public AsmPrinter {
- DwarfWriter DW;
- MachineModuleInfo *MMI;
-
- X86SharedAsmPrinter(std::ostream &O, X86TargetMachine &TM,
- const TargetAsmInfo *T)
- : AsmPrinter(O, TM, T), DW(O, this, T), MMI(0) {
- Subtarget = &TM.getSubtarget<X86Subtarget>();
- }
-
- // We have to propagate some information about MachineFunction to
- // AsmPrinter. It's ok, when we're printing the function, since we have
- // access to MachineFunction and can get the appropriate MachineFunctionInfo.
- // Unfortunately, this is not possible when we're printing reference to
- // Function (e.g. calling it and so on). Even more, there is no way to get the
- // corresponding MachineFunctions: it can even be not created at all. That's
- // why we should use additional structure, when we're collecting all necessary
- // information.
- //
- // This structure is using e.g. for name decoration for stdcall & fastcall'ed
- // function, since we have to use arguments' size for decoration.
- typedef std::map<const Function*, X86MachineFunctionInfo> FMFInfoMap;
- FMFInfoMap FunctionInfoMap;
-
- void decorateName(std::string& Name, const GlobalValue* GV);
-
- bool doInitialization(Module &M);
- bool doFinalization(Module &M);
-
- void getAnalysisUsage(AnalysisUsage &AU) const {
- AU.setPreservesAll();
- if (Subtarget->isTargetDarwin() ||
- Subtarget->isTargetELF() ||
- Subtarget->isTargetCygMing()) {
- AU.addRequired<MachineModuleInfo>();
- }
- AsmPrinter::getAnalysisUsage(AU);
- }
-
- const X86Subtarget *Subtarget;
-
- // Necessary for Darwin to print out the apprioriate types of linker stubs
- std::set<std::string> FnStubs, GVStubs, LinkOnceStubs;
-
- // Necessary for dllexport support
- std::set<std::string> DLLExportedFns, DLLExportedGVs;
-
- inline static bool isScale(const MachineOperand &MO) {
- return MO.isImmediate() &&
- (MO.getImm() == 1 || MO.getImm() == 2 ||
- MO.getImm() == 4 || MO.getImm() == 8);
- }
-
- inline static bool isMem(const MachineInstr *MI, unsigned Op) {
- if (MI->getOperand(Op).isFrameIndex()) return true;
- return Op+4 <= MI->getNumOperands() &&
- MI->getOperand(Op ).isRegister() && isScale(MI->getOperand(Op+1)) &&
- MI->getOperand(Op+2).isRegister() &&
- (MI->getOperand(Op+3).isImmediate() ||
- MI->getOperand(Op+3).isGlobalAddress() ||
- MI->getOperand(Op+3).isConstantPoolIndex() ||
- MI->getOperand(Op+3).isJumpTableIndex());
- }
-};
-
-} // end namespace llvm
-
-#endif
diff --git a/release_23/lib/Target/X86/X86COFF.h b/release_23/lib/Target/X86/X86COFF.h
deleted file mode 100644
index 0a8e4e6ac6db..000000000000
--- a/release_23/lib/Target/X86/X86COFF.h
+++ /dev/null
@@ -1,95 +0,0 @@
-//===--- X86COFF.h - Some definitions from COFF documentations ------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file just defines some symbols found in COFF documentation. They are
-// used to emit function type information for COFF targets (Cygwin/Mingw32).
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef X86COFF_H
-#define X86COFF_H
-
-namespace COFF
-{
-/// Storage class tells where and what the symbol represents
-enum StorageClass {
- C_EFCN = -1, ///< Physical end of function
- C_NULL = 0, ///< No symbol
- C_AUTO = 1, ///< External definition
- C_EXT = 2, ///< External symbol
- C_STAT = 3, ///< Static
- C_REG = 4, ///< Register variable
- C_EXTDEF = 5, ///< External definition
- C_LABEL = 6, ///< Label
- C_ULABEL = 7, ///< Undefined label
- C_MOS = 8, ///< Member of structure
- C_ARG = 9, ///< Function argument
- C_STRTAG = 10, ///< Structure tag
- C_MOU = 11, ///< Member of union
- C_UNTAG = 12, ///< Union tag
- C_TPDEF = 13, ///< Type definition
- C_USTATIC = 14, ///< Undefined static
- C_ENTAG = 15, ///< Enumeration tag
- C_MOE = 16, ///< Member of enumeration
- C_REGPARM = 17, ///< Register parameter
- C_FIELD = 18, ///< Bit field
-
- C_BLOCK = 100, ///< ".bb" or ".eb" - beginning or end of block
- C_FCN = 101, ///< ".bf" or ".ef" - beginning or end of function
- C_EOS = 102, ///< End of structure
- C_FILE = 103, ///< File name
- C_LINE = 104, ///< Line number, reformatted as symbol
- C_ALIAS = 105, ///< Duplicate tag
- C_HIDDEN = 106 ///< External symbol in dmert public lib
-};
-
-/// The type of the symbol. This is made up of a base type and a derived type.
-/// For example, pointer to int is "pointer to T" and "int"
-enum SymbolType {
- T_NULL = 0, ///< No type info
- T_ARG = 1, ///< Void function argument (only used by compiler)
- T_VOID = 1, ///< The same as above. Just named differently in some specs.
- T_CHAR = 2, ///< Character
- T_SHORT = 3, ///< Short integer
- T_INT = 4, ///< Integer
- T_LONG = 5, ///< Long integer
- T_FLOAT = 6, ///< Floating point
- T_DOUBLE = 7, ///< Double word
- T_STRUCT = 8, ///< Structure
- T_UNION = 9, ///< Union
- T_ENUM = 10, ///< Enumeration
- T_MOE = 11, ///< Member of enumeration
- T_UCHAR = 12, ///< Unsigned character
- T_USHORT = 13, ///< Unsigned short
- T_UINT = 14, ///< Unsigned integer
- T_ULONG = 15 ///< Unsigned long
-};
-
-/// Derived type of symbol
-enum SymbolDerivedType {
- DT_NON = 0, ///< No derived type
- DT_PTR = 1, ///< Pointer to T
- DT_FCN = 2, ///< Function returning T
- DT_ARY = 3 ///< Array of T
-};
-
-/// Masks for extracting parts of type
-enum SymbolTypeMasks {
- N_BTMASK = 017, ///< Mask for base type
- N_TMASK = 060 ///< Mask for derived type
-};
-
-/// Offsets of parts of type
-enum Shifts {
- N_BTSHFT = 4 ///< Type is formed as (base + derived << N_BTSHIFT)
-};
-
-}
-
-#endif // X86COFF_H
diff --git a/release_23/lib/Target/X86/X86CallingConv.td b/release_23/lib/Target/X86/X86CallingConv.td
deleted file mode 100644
index 60ee0a1bd33d..000000000000
--- a/release_23/lib/Target/X86/X86CallingConv.td
+++ /dev/null
@@ -1,340 +0,0 @@
-//===- X86CallingConv.td - Calling Conventions X86 32/64 ---*- tablegen -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This describes the calling conventions for the X86-32 and X86-64
-// architectures.
-//
-//===----------------------------------------------------------------------===//
-
-/// CCIfSubtarget - Match if the current subtarget has a feature F.
-class CCIfSubtarget<string F, CCAction A>
- : CCIf<!strconcat("State.getTarget().getSubtarget<X86Subtarget>().", F), A>;
-
-//===----------------------------------------------------------------------===//
-// Return Value Calling Conventions
-//===----------------------------------------------------------------------===//
-
-// Return-value conventions common to all X86 CC's.
-def RetCC_X86Common : CallingConv<[
- // Scalar values are returned in AX first, then DX.
- CCIfType<[i8] , CCAssignToReg<[AL]>>,
- CCIfType<[i16], CCAssignToReg<[AX, DX]>>,
- CCIfType<[i32], CCAssignToReg<[EAX, EDX]>>,
- CCIfType<[i64], CCAssignToReg<[RAX, RDX]>>,
-
- // Vector types are returned in XMM0 and XMM1, when they fit. If the target
- // doesn't have XMM registers, it won't have vector types.
- CCIfType<[v16i8, v8i16, v4i32, v2i64, v4f32, v2f64],
- CCAssignToReg<[XMM0,XMM1]>>,
-
- // MMX vector types are always returned in MM0. If the target doesn't have
- // MM0, it doesn't support these vector types.
- CCIfType<[v8i8, v4i16, v2i32, v1i64], CCAssignToReg<[MM0]>>,
-
- // Long double types are always returned in ST0 (even with SSE).
- CCIfType<[f80], CCAssignToReg<[ST0, ST1]>>
-]>;
-
-// X86-32 C return-value convention.
-def RetCC_X86_32_C : CallingConv<[
- // The X86-32 calling convention returns FP values in ST0, otherwise it is the
- // same as the common X86 calling conv.
- CCIfType<[f32], CCAssignToReg<[ST0, ST1]>>,
- CCIfType<[f64], CCAssignToReg<[ST0, ST1]>>,
- CCDelegateTo<RetCC_X86Common>
-]>;
-
-// X86-32 FastCC return-value convention.
-def RetCC_X86_32_Fast : CallingConv<[
- // The X86-32 fastcc returns 1, 2, or 3 FP values in XMM0-2 if the target has
- // SSE2, otherwise it is the the C calling conventions.
- // This can happen when a float, 2 x float, or 3 x float vector is split by
- // target lowering, and is returned in 1-3 sse regs.
- CCIfType<[f32], CCIfSubtarget<"hasSSE2()", CCAssignToReg<[XMM0,XMM1,XMM2]>>>,
- CCIfType<[f64], CCIfSubtarget<"hasSSE2()", CCAssignToReg<[XMM0,XMM1,XMM2]>>>,
- CCDelegateTo<RetCC_X86Common>
-]>;
-
-// X86-32 SSEregparm return-value convention.
-def RetCC_X86_32_SSE : CallingConv<[
- // The X86-32 sseregparm calling convention returns FP values in XMM0 if the
- // target has SSE2, otherwise it is the C calling convention.
- CCIfType<[f32], CCIfSubtarget<"hasSSE2()", CCAssignToReg<[XMM0, XMM1]>>>,
- CCIfType<[f64], CCIfSubtarget<"hasSSE2()", CCAssignToReg<[XMM0, XMM1]>>>,
- CCDelegateTo<RetCC_X86Common>
-]>;
-
-// X86-64 C return-value convention.
-def RetCC_X86_64_C : CallingConv<[
- // The X86-64 calling convention always returns FP values in XMM0.
- CCIfType<[f32], CCAssignToReg<[XMM0, XMM1]>>,
- CCIfType<[f64], CCAssignToReg<[XMM0, XMM1]>>,
- CCDelegateTo<RetCC_X86Common>
-]>;
-
-// X86-Win64 C return-value convention.
-def RetCC_X86_Win64_C : CallingConv<[
- // The X86-Win64 calling convention always returns __m64 values in RAX.
- CCIfType<[v8i8, v4i16, v2i32, v1i64], CCAssignToReg<[RAX]>>,
-
- // And FP in XMM0 only.
- CCIfType<[f32], CCAssignToReg<[XMM0]>>,
- CCIfType<[f64], CCAssignToReg<[XMM0]>>,
-
- // Otherwise, everything is the same as 'normal' X86-64 C CC.
- CCDelegateTo<RetCC_X86_64_C>
-]>;
-
-
-// This is the root return-value convention for the X86-32 backend.
-def RetCC_X86_32 : CallingConv<[
- // If FastCC, use RetCC_X86_32_Fast.
- CCIfCC<"CallingConv::Fast", CCDelegateTo<RetCC_X86_32_Fast>>,
- // If SSECC, use RetCC_X86_32_SSE.
- CCIfCC<"CallingConv::X86_SSECall", CCDelegateTo<RetCC_X86_32_SSE>>,
- // Otherwise, use RetCC_X86_32_C.
- CCDelegateTo<RetCC_X86_32_C>
-]>;
-
-// This is the root return-value convention for the X86-64 backend.
-def RetCC_X86_64 : CallingConv<[
- // Mingw64 and native Win64 use Win64 CC
- CCIfSubtarget<"isTargetWin64()", CCDelegateTo<RetCC_X86_Win64_C>>,
-
- // Otherwise, drop to normal X86-64 CC
- CCDelegateTo<RetCC_X86_64_C>
-]>;
-
-// This is the return-value convention used for the entire X86 backend.
-def RetCC_X86 : CallingConv<[
- CCIfSubtarget<"is64Bit()", CCDelegateTo<RetCC_X86_64>>,
- CCDelegateTo<RetCC_X86_32>
-]>;
-
-//===----------------------------------------------------------------------===//
-// X86-64 Argument Calling Conventions
-//===----------------------------------------------------------------------===//
-
-def CC_X86_64_C : CallingConv<[
- // Handles byval parameters.
- CCIfByVal<CCPassByVal<8, 8>>,
-
- // Promote i8/i16 arguments to i32.
- CCIfType<[i8, i16], CCPromoteToType<i32>>,
-
- // The 'nest' parameter, if any, is passed in R10.
- CCIfNest<CCAssignToReg<[R10]>>,
-
- // The first 6 integer arguments are passed in integer registers.
- CCIfType<[i32], CCAssignToReg<[EDI, ESI, EDX, ECX, R8D, R9D]>>,
- CCIfType<[i64], CCAssignToReg<[RDI, RSI, RDX, RCX, R8 , R9 ]>>,
-
- // The first 8 FP/Vector arguments are passed in XMM registers.
- CCIfType<[f32, f64, v16i8, v8i16, v4i32, v2i64, v4f32, v2f64],
- CCAssignToReg<[XMM0, XMM1, XMM2, XMM3, XMM4, XMM5, XMM6, XMM7]>>,
-
- // The first 8 MMX (except for v1i64) vector arguments are passed in XMM
- // registers on Darwin.
- CCIfType<[v8i8, v4i16, v2i32],
- CCIfSubtarget<"isTargetDarwin()",
- CCIfSubtarget<"hasSSE2()",
- CCAssignToReg<[XMM0, XMM1, XMM2, XMM3, XMM4, XMM5, XMM6, XMM7]>>>>,
-
- // The first 8 v1i64 vector arguments are passed in GPRs on Darwin.
- CCIfType<[v1i64],
- CCIfSubtarget<"isTargetDarwin()",
- CCAssignToReg<[RDI, RSI, RDX, RCX, R8]>>>,
-
- // Integer/FP values get stored in stack slots that are 8 bytes in size and
- // 8-byte aligned if there are no more registers to hold them.
- CCIfType<[i32, i64, f32, f64], CCAssignToStack<8, 8>>,
-
- // Long doubles get stack slots whose size and alignment depends on the
- // subtarget.
- CCIfType<[f80], CCAssignToStack<0, 0>>,
-
- // Vectors get 16-byte stack slots that are 16-byte aligned.
- CCIfType<[v16i8, v8i16, v4i32, v2i64, v4f32, v2f64], CCAssignToStack<16, 16>>,
-
- // __m64 vectors get 8-byte stack slots that are 8-byte aligned.
- CCIfType<[v8i8, v4i16, v2i32, v1i64], CCAssignToStack<8, 8>>
-]>;
-
-// Calling convention used on Win64
-def CC_X86_Win64_C : CallingConv<[
- // FIXME: Handle byval stuff.
- // FIXME: Handle varargs.
-
- // Promote i8/i16 arguments to i32.
- CCIfType<[i8, i16], CCPromoteToType<i32>>,
-
- // The 'nest' parameter, if any, is passed in R10.
- CCIfNest<CCAssignToReg<[R10]>>,
-
- // The first 4 integer arguments are passed in integer registers.
- CCIfType<[i32], CCAssignToRegWithShadow<[ECX , EDX , R8D , R9D ],
- [XMM0, XMM1, XMM2, XMM3]>>,
- CCIfType<[i64], CCAssignToRegWithShadow<[RCX , RDX , R8 , R9 ],
- [XMM0, XMM1, XMM2, XMM3]>>,
-
- // The first 4 FP/Vector arguments are passed in XMM registers.
- CCIfType<[f32, f64, v16i8, v8i16, v4i32, v2i64, v4f32, v2f64],
- CCAssignToRegWithShadow<[XMM0, XMM1, XMM2, XMM3],
- [RCX , RDX , R8 , R9 ]>>,
-
- // The first 4 MMX vector arguments are passed in GPRs.
- CCIfType<[v8i8, v4i16, v2i32, v1i64],
- CCAssignToRegWithShadow<[RCX , RDX , R8 , R9 ],
- [XMM0, XMM1, XMM2, XMM3]>>,
-
- // Integer/FP values get stored in stack slots that are 8 bytes in size and
- // 16-byte aligned if there are no more registers to hold them.
- CCIfType<[i32, i64, f32, f64], CCAssignToStack<8, 16>>,
-
- // Long doubles get stack slots whose size and alignment depends on the
- // subtarget.
- CCIfType<[f80], CCAssignToStack<0, 0>>,
-
- // Vectors get 16-byte stack slots that are 16-byte aligned.
- CCIfType<[v16i8, v8i16, v4i32, v2i64, v4f32, v2f64], CCAssignToStack<16, 16>>,
-
- // __m64 vectors get 8-byte stack slots that are 16-byte aligned.
- CCIfType<[v8i8, v4i16, v2i32, v1i64], CCAssignToStack<8, 16>>
-]>;
-
-// Tail call convention (fast): One register is reserved for target address,
-// namely R9
-def CC_X86_64_TailCall : CallingConv<[
- // Handles byval parameters.
- CCIfByVal<CCPassByVal<8, 8>>,
-
- // Promote i8/i16 arguments to i32.
- CCIfType<[i8, i16], CCPromoteToType<i32>>,
-
- // The 'nest' parameter, if any, is passed in R10.
- CCIfNest<CCAssignToReg<[R10]>>,
-
- // The first 6 integer arguments are passed in integer registers.
- CCIfType<[i32], CCAssignToReg<[EDI, ESI, EDX, ECX, R8D]>>,
- CCIfType<[i64], CCAssignToReg<[RDI, RSI, RDX, RCX, R8]>>,
-
- // The first 8 FP/Vector arguments are passed in XMM registers.
- CCIfType<[f32, f64, v16i8, v8i16, v4i32, v2i64, v4f32, v2f64],
- CCAssignToReg<[XMM0, XMM1, XMM2, XMM3, XMM4, XMM5, XMM6, XMM7]>>,
-
- // The first 8 MMX (except for v1i64) vector arguments are passed in XMM
- // registers on Darwin.
- CCIfType<[v8i8, v4i16, v2i32],
- CCIfSubtarget<"isTargetDarwin()",
- CCAssignToReg<[XMM0, XMM1, XMM2, XMM3, XMM4, XMM5, XMM6, XMM7]>>>,
-
- // The first 8 v1i64 vector arguments are passed in GPRs on Darwin.
- CCIfType<[v1i64],
- CCIfSubtarget<"isTargetDarwin()",
- CCAssignToReg<[RDI, RSI, RDX, RCX, R8]>>>,
-
- // Integer/FP values get stored in stack slots that are 8 bytes in size and
- // 8-byte aligned if there are no more registers to hold them.
- CCIfType<[i32, i64, f32, f64], CCAssignToStack<8, 8>>,
-
- // Vectors get 16-byte stack slots that are 16-byte aligned.
- CCIfType<[v16i8, v8i16, v4i32, v2i64, v4f32, v2f64], CCAssignToStack<16, 16>>,
-
- // __m64 vectors get 8-byte stack slots that are 8-byte aligned.
- CCIfType<[v8i8, v4i16, v2i32, v1i64], CCAssignToStack<8, 8>>
-]>;
-
-
-//===----------------------------------------------------------------------===//
-// X86 C Calling Convention
-//===----------------------------------------------------------------------===//
-
-/// CC_X86_32_Common - In all X86-32 calling conventions, extra integers and FP
-/// values are spilled on the stack, and the first 4 vector values go in XMM
-/// regs.
-def CC_X86_32_Common : CallingConv<[
- // Handles byval parameters.
- CCIfByVal<CCPassByVal<4, 4>>,
-
- // The first 3 float or double arguments, if marked 'inreg' and if the call
- // is not a vararg call and if SSE2 is available, are passed in SSE registers.
- CCIfNotVarArg<CCIfInReg<CCIfType<[f32,f64],
- CCIfSubtarget<"hasSSE2()",
- CCAssignToReg<[XMM0,XMM1,XMM2]>>>>>,
-
- // The first 3 __m64 (except for v1i64) vector arguments are passed in mmx
- // registers if the call is not a vararg call.
- CCIfNotVarArg<CCIfType<[v8i8, v4i16, v2i32],
- CCAssignToReg<[MM0, MM1, MM2]>>>,
-
- // Integer/Float values get stored in stack slots that are 4 bytes in
- // size and 4-byte aligned.
- CCIfType<[i32, f32], CCAssignToStack<4, 4>>,
-
- // Doubles get 8-byte slots that are 4-byte aligned.
- CCIfType<[f64], CCAssignToStack<8, 4>>,
-
- // Long doubles get slots whose size depends on the subtarget.
- CCIfType<[f80], CCAssignToStack<0, 4>>,
-
- // The first 4 SSE vector arguments are passed in XMM registers.
- CCIfNotVarArg<CCIfType<[v16i8, v8i16, v4i32, v2i64, v4f32, v2f64],
- CCAssignToReg<[XMM0, XMM1, XMM2, XMM3]>>>,
-
- // Other SSE vectors get 16-byte stack slots that are 16-byte aligned.
- CCIfType<[v16i8, v8i16, v4i32, v2i64, v4f32, v2f64], CCAssignToStack<16, 16>>,
-
- // __m64 vectors get 8-byte stack slots that are 4-byte aligned. They are
- // passed in the parameter area.
- CCIfType<[v8i8, v4i16, v2i32, v1i64], CCAssignToStack<8, 4>>]>;
-
-def CC_X86_32_C : CallingConv<[
- // Promote i8/i16 arguments to i32.
- CCIfType<[i8, i16], CCPromoteToType<i32>>,
-
- // The 'nest' parameter, if any, is passed in ECX.
- CCIfNest<CCAssignToReg<[ECX]>>,
-
- // The first 3 integer arguments, if marked 'inreg' and if the call is not
- // a vararg call, are passed in integer registers.
- CCIfNotVarArg<CCIfInReg<CCIfType<[i32], CCAssignToReg<[EAX, EDX, ECX]>>>>,
-
- // Otherwise, same as everything else.
- CCDelegateTo<CC_X86_32_Common>
-]>;
-
-/// Same as C calling convention except for non-free ECX which is used for storing
-/// a potential pointer to the tail called function.
-def CC_X86_32_TailCall : CallingConv<[
- // Promote i8/i16 arguments to i32.
- CCIfType<[i8, i16], CCPromoteToType<i32>>,
-
- // Nested function trampolines are currently not supported by fastcc.
-
- // The first 3 integer arguments, if marked 'inreg' and if the call is not
- // a vararg call, are passed in integer registers.
- CCIfNotVarArg<CCIfInReg<CCIfType<[i32], CCAssignToReg<[EAX, EDX]>>>>,
-
- // Otherwise, same as everything else.
- CCDelegateTo<CC_X86_32_Common>
-]>;
-
-def CC_X86_32_FastCall : CallingConv<[
- // Promote i8/i16 arguments to i32.
- CCIfType<[i8, i16], CCPromoteToType<i32>>,
-
- // The 'nest' parameter, if any, is passed in EAX.
- CCIfNest<CCAssignToReg<[EAX]>>,
-
- // The first 2 integer arguments are passed in ECX/EDX
- CCIfType<[i32], CCAssignToReg<[ECX, EDX]>>,
-
- // Otherwise, same as everything else.
- CCDelegateTo<CC_X86_32_Common>
-]>;
diff --git a/release_23/lib/Target/X86/X86CodeEmitter.cpp b/release_23/lib/Target/X86/X86CodeEmitter.cpp
deleted file mode 100644
index 70dc926c7985..000000000000
--- a/release_23/lib/Target/X86/X86CodeEmitter.cpp
+++ /dev/null
@@ -1,688 +0,0 @@
-//===-- X86/X86CodeEmitter.cpp - Convert X86 code to machine code ---------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains the pass that transforms the X86 machine instructions into
-// relocatable machine code.
-//
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "x86-emitter"
-#include "X86InstrInfo.h"
-#include "X86JITInfo.h"
-#include "X86Subtarget.h"
-#include "X86TargetMachine.h"
-#include "X86Relocations.h"
-#include "X86.h"
-#include "llvm/PassManager.h"
-#include "llvm/CodeGen/MachineCodeEmitter.h"
-#include "llvm/CodeGen/MachineFunctionPass.h"
-#include "llvm/CodeGen/MachineInstr.h"
-#include "llvm/CodeGen/MachineModuleInfo.h"
-#include "llvm/CodeGen/Passes.h"
-#include "llvm/Function.h"
-#include "llvm/ADT/Statistic.h"
-#include "llvm/Support/Compiler.h"
-#include "llvm/Support/Debug.h"
-#include "llvm/Target/TargetOptions.h"
-using namespace llvm;
-
-STATISTIC(NumEmitted, "Number of machine instructions emitted");
-
-namespace {
- class VISIBILITY_HIDDEN Emitter : public MachineFunctionPass {
- const X86InstrInfo *II;
- const TargetData *TD;
- TargetMachine &TM;
- MachineCodeEmitter &MCE;
- intptr_t PICBaseOffset;
- bool Is64BitMode;
- bool IsPIC;
- public:
- static char ID;
- explicit Emitter(TargetMachine &tm, MachineCodeEmitter &mce)
- : MachineFunctionPass((intptr_t)&ID), II(0), TD(0), TM(tm),
- MCE(mce), PICBaseOffset(0), Is64BitMode(false),
- IsPIC(TM.getRelocationModel() == Reloc::PIC_) {}
- Emitter(TargetMachine &tm, MachineCodeEmitter &mce,
- const X86InstrInfo &ii, const TargetData &td, bool is64)
- : MachineFunctionPass((intptr_t)&ID), II(&ii), TD(&td), TM(tm),
- MCE(mce), PICBaseOffset(0), Is64BitMode(is64),
- IsPIC(TM.getRelocationModel() == Reloc::PIC_) {}
-
- bool runOnMachineFunction(MachineFunction &MF);
-
- virtual const char *getPassName() const {
- return "X86 Machine Code Emitter";
- }
-
- void emitInstruction(const MachineInstr &MI,
- const TargetInstrDesc *Desc);
-
- void getAnalysisUsage(AnalysisUsage &AU) const {
- AU.addRequired<MachineModuleInfo>();
- MachineFunctionPass::getAnalysisUsage(AU);
- }
-
- private:
- void emitPCRelativeBlockAddress(MachineBasicBlock *MBB);
- void emitGlobalAddress(GlobalValue *GV, unsigned Reloc,
- int Disp = 0, intptr_t PCAdj = 0,
- bool NeedStub = false, bool IsLazy = false);
- void emitExternalSymbolAddress(const char *ES, unsigned Reloc);
- void emitConstPoolAddress(unsigned CPI, unsigned Reloc, int Disp = 0,
- intptr_t PCAdj = 0);
- void emitJumpTableAddress(unsigned JTI, unsigned Reloc,
- intptr_t PCAdj = 0);
-
- void emitDisplacementField(const MachineOperand *RelocOp, int DispVal,
- intptr_t PCAdj = 0);
-
- void emitRegModRMByte(unsigned ModRMReg, unsigned RegOpcodeField);
- void emitSIBByte(unsigned SS, unsigned Index, unsigned Base);
- void emitConstant(uint64_t Val, unsigned Size);
-
- void emitMemModRMByte(const MachineInstr &MI,
- unsigned Op, unsigned RegOpcodeField,
- intptr_t PCAdj = 0);
-
- unsigned getX86RegNum(unsigned RegNo) const;
-
- bool gvNeedsLazyPtr(const GlobalValue *GV);
- };
- char Emitter::ID = 0;
-}
-
-/// createX86CodeEmitterPass - Return a pass that emits the collected X86 code
-/// to the specified MCE object.
-FunctionPass *llvm::createX86CodeEmitterPass(X86TargetMachine &TM,
- MachineCodeEmitter &MCE) {
- return new Emitter(TM, MCE);
-}
-
-bool Emitter::runOnMachineFunction(MachineFunction &MF) {
- assert((MF.getTarget().getRelocationModel() != Reloc::Default ||
- MF.getTarget().getRelocationModel() != Reloc::Static) &&
- "JIT relocation model must be set to static or default!");
-
- MCE.setModuleInfo(&getAnalysis<MachineModuleInfo>());
-
- II = ((X86TargetMachine&)TM).getInstrInfo();
- TD = ((X86TargetMachine&)TM).getTargetData();
- Is64BitMode = TM.getSubtarget<X86Subtarget>().is64Bit();
-
- do {
- DOUT << "JITTing function '" << MF.getFunction()->getName() << "'\n";
- MCE.startFunction(MF);
- for (MachineFunction::iterator MBB = MF.begin(), E = MF.end();
- MBB != E; ++MBB) {
- MCE.StartMachineBasicBlock(MBB);
- for (MachineBasicBlock::const_iterator I = MBB->begin(), E = MBB->end();
- I != E; ++I) {
- const TargetInstrDesc &Desc = I->getDesc();
- emitInstruction(*I, &Desc);
- // MOVPC32r is basically a call plus a pop instruction.
- if (Desc.getOpcode() == X86::MOVPC32r)
- emitInstruction(*I, &II->get(X86::POP32r));
- NumEmitted++; // Keep track of the # of mi's emitted
- }
- }
- } while (MCE.finishFunction(MF));
-
- return false;
-}
-
-/// emitPCRelativeBlockAddress - This method keeps track of the information
-/// necessary to resolve the address of this block later and emits a dummy
-/// value.
-///
-void Emitter::emitPCRelativeBlockAddress(MachineBasicBlock *MBB) {
- // Remember where this reference was and where it is to so we can
- // deal with it later.
- MCE.addRelocation(MachineRelocation::getBB(MCE.getCurrentPCOffset(),
- X86::reloc_pcrel_word, MBB));
- MCE.emitWordLE(0);
-}
-
-/// emitGlobalAddress - Emit the specified address to the code stream assuming
-/// this is part of a "take the address of a global" instruction.
-///
-void Emitter::emitGlobalAddress(GlobalValue *GV, unsigned Reloc,
- int Disp /* = 0 */, intptr_t PCAdj /* = 0 */,
- bool NeedStub /* = false */,
- bool isLazy /* = false */) {
- intptr_t RelocCST = 0;
- if (Reloc == X86::reloc_picrel_word)
- RelocCST = PICBaseOffset;
- else if (Reloc == X86::reloc_pcrel_word)
- RelocCST = PCAdj;
- MachineRelocation MR = isLazy
- ? MachineRelocation::getGVLazyPtr(MCE.getCurrentPCOffset(), Reloc,
- GV, RelocCST, NeedStub)
- : MachineRelocation::getGV(MCE.getCurrentPCOffset(), Reloc,
- GV, RelocCST, NeedStub);
- MCE.addRelocation(MR);
- if (Reloc == X86::reloc_absolute_dword)
- MCE.emitWordLE(0);
- MCE.emitWordLE(Disp); // The relocated value will be added to the displacement
-}
-
-/// emitExternalSymbolAddress - Arrange for the address of an external symbol to
-/// be emitted to the current location in the function, and allow it to be PC
-/// relative.
-void Emitter::emitExternalSymbolAddress(const char *ES, unsigned Reloc) {
- intptr_t RelocCST = (Reloc == X86::reloc_picrel_word) ? PICBaseOffset : 0;
- MCE.addRelocation(MachineRelocation::getExtSym(MCE.getCurrentPCOffset(),
- Reloc, ES, RelocCST));
- if (Reloc == X86::reloc_absolute_dword)
- MCE.emitWordLE(0);
- MCE.emitWordLE(0);
-}
-
-/// emitConstPoolAddress - Arrange for the address of an constant pool
-/// to be emitted to the current location in the function, and allow it to be PC
-/// relative.
-void Emitter::emitConstPoolAddress(unsigned CPI, unsigned Reloc,
- int Disp /* = 0 */,
- intptr_t PCAdj /* = 0 */) {
- intptr_t RelocCST = 0;
- if (Reloc == X86::reloc_picrel_word)
- RelocCST = PICBaseOffset;
- else if (Reloc == X86::reloc_pcrel_word)
- RelocCST = PCAdj;
- MCE.addRelocation(MachineRelocation::getConstPool(MCE.getCurrentPCOffset(),
- Reloc, CPI, RelocCST));
- if (Reloc == X86::reloc_absolute_dword)
- MCE.emitWordLE(0);
- MCE.emitWordLE(Disp); // The relocated value will be added to the displacement
-}
-
-/// emitJumpTableAddress - Arrange for the address of a jump table to
-/// be emitted to the current location in the function, and allow it to be PC
-/// relative.
-void Emitter::emitJumpTableAddress(unsigned JTI, unsigned Reloc,
- intptr_t PCAdj /* = 0 */) {
- intptr_t RelocCST = 0;
- if (Reloc == X86::reloc_picrel_word)
- RelocCST = PICBaseOffset;
- else if (Reloc == X86::reloc_pcrel_word)
- RelocCST = PCAdj;
- MCE.addRelocation(MachineRelocation::getJumpTable(MCE.getCurrentPCOffset(),
- Reloc, JTI, RelocCST));
- if (Reloc == X86::reloc_absolute_dword)
- MCE.emitWordLE(0);
- MCE.emitWordLE(0); // The relocated value will be added to the displacement
-}
-
-unsigned Emitter::getX86RegNum(unsigned RegNo) const {
- return ((const X86RegisterInfo&)II->getRegisterInfo()).getX86RegNum(RegNo);
-}
-
-inline static unsigned char ModRMByte(unsigned Mod, unsigned RegOpcode,
- unsigned RM) {
- assert(Mod < 4 && RegOpcode < 8 && RM < 8 && "ModRM Fields out of range!");
- return RM | (RegOpcode << 3) | (Mod << 6);
-}
-
-void Emitter::emitRegModRMByte(unsigned ModRMReg, unsigned RegOpcodeFld){
- MCE.emitByte(ModRMByte(3, RegOpcodeFld, getX86RegNum(ModRMReg)));
-}
-
-void Emitter::emitSIBByte(unsigned SS, unsigned Index, unsigned Base) {
- // SIB byte is in the same format as the ModRMByte...
- MCE.emitByte(ModRMByte(SS, Index, Base));
-}
-
-void Emitter::emitConstant(uint64_t Val, unsigned Size) {
- // Output the constant in little endian byte order...
- for (unsigned i = 0; i != Size; ++i) {
- MCE.emitByte(Val & 255);
- Val >>= 8;
- }
-}
-
-/// isDisp8 - Return true if this signed displacement fits in a 8-bit
-/// sign-extended field.
-static bool isDisp8(int Value) {
- return Value == (signed char)Value;
-}
-
-bool Emitter::gvNeedsLazyPtr(const GlobalValue *GV) {
- return !Is64BitMode &&
- TM.getSubtarget<X86Subtarget>().GVRequiresExtraLoad(GV, TM, false);
-}
-
-void Emitter::emitDisplacementField(const MachineOperand *RelocOp,
- int DispVal, intptr_t PCAdj) {
- // If this is a simple integer displacement that doesn't require a relocation,
- // emit it now.
- if (!RelocOp) {
- emitConstant(DispVal, 4);
- return;
- }
-
- // Otherwise, this is something that requires a relocation. Emit it as such
- // now.
- if (RelocOp->isGlobalAddress()) {
- // In 64-bit static small code model, we could potentially emit absolute.
- // But it's probably not beneficial.
- // 89 05 00 00 00 00 mov %eax,0(%rip) # PC-relative
- // 89 04 25 00 00 00 00 mov %eax,0x0 # Absolute
- unsigned rt = Is64BitMode ? X86::reloc_pcrel_word
- : (IsPIC ? X86::reloc_picrel_word : X86::reloc_absolute_word);
- bool NeedStub = isa<Function>(RelocOp->getGlobal());
- bool isLazy = gvNeedsLazyPtr(RelocOp->getGlobal());
- emitGlobalAddress(RelocOp->getGlobal(), rt, RelocOp->getOffset(),
- PCAdj, NeedStub, isLazy);
- } else if (RelocOp->isConstantPoolIndex()) {
- unsigned rt = Is64BitMode ? X86::reloc_pcrel_word : X86::reloc_picrel_word;
- emitConstPoolAddress(RelocOp->getIndex(), rt,
- RelocOp->getOffset(), PCAdj);
- } else if (RelocOp->isJumpTableIndex()) {
- unsigned rt = Is64BitMode ? X86::reloc_pcrel_word : X86::reloc_picrel_word;
- emitJumpTableAddress(RelocOp->getIndex(), rt, PCAdj);
- } else {
- assert(0 && "Unknown value to relocate!");
- }
-}
-
-void Emitter::emitMemModRMByte(const MachineInstr &MI,
- unsigned Op, unsigned RegOpcodeField,
- intptr_t PCAdj) {
- const MachineOperand &Op3 = MI.getOperand(Op+3);
- int DispVal = 0;
- const MachineOperand *DispForReloc = 0;
-
- // Figure out what sort of displacement we have to handle here.
- if (Op3.isGlobalAddress()) {
- DispForReloc = &Op3;
- } else if (Op3.isConstantPoolIndex()) {
- if (Is64BitMode || IsPIC) {
- DispForReloc = &Op3;
- } else {
- DispVal += MCE.getConstantPoolEntryAddress(Op3.getIndex());
- DispVal += Op3.getOffset();
- }
- } else if (Op3.isJumpTableIndex()) {
- if (Is64BitMode || IsPIC) {
- DispForReloc = &Op3;
- } else {
- DispVal += MCE.getJumpTableEntryAddress(Op3.getIndex());
- }
- } else {
- DispVal = Op3.getImm();
- }
-
- const MachineOperand &Base = MI.getOperand(Op);
- const MachineOperand &Scale = MI.getOperand(Op+1);
- const MachineOperand &IndexReg = MI.getOperand(Op+2);
-
- unsigned BaseReg = Base.getReg();
-
- // Is a SIB byte needed?
- if (IndexReg.getReg() == 0 &&
- (BaseReg == 0 || getX86RegNum(BaseReg) != N86::ESP)) {
- if (BaseReg == 0) { // Just a displacement?
- // Emit special case [disp32] encoding
- MCE.emitByte(ModRMByte(0, RegOpcodeField, 5));
-
- emitDisplacementField(DispForReloc, DispVal, PCAdj);
- } else {
- unsigned BaseRegNo = getX86RegNum(BaseReg);
- if (!DispForReloc && DispVal == 0 && BaseRegNo != N86::EBP) {
- // Emit simple indirect register encoding... [EAX] f.e.
- MCE.emitByte(ModRMByte(0, RegOpcodeField, BaseRegNo));
- } else if (!DispForReloc && isDisp8(DispVal)) {
- // Emit the disp8 encoding... [REG+disp8]
- MCE.emitByte(ModRMByte(1, RegOpcodeField, BaseRegNo));
- emitConstant(DispVal, 1);
- } else {
- // Emit the most general non-SIB encoding: [REG+disp32]
- MCE.emitByte(ModRMByte(2, RegOpcodeField, BaseRegNo));
- emitDisplacementField(DispForReloc, DispVal, PCAdj);
- }
- }
-
- } else { // We need a SIB byte, so start by outputting the ModR/M byte first
- assert(IndexReg.getReg() != X86::ESP &&
- IndexReg.getReg() != X86::RSP && "Cannot use ESP as index reg!");
-
- bool ForceDisp32 = false;
- bool ForceDisp8 = false;
- if (BaseReg == 0) {
- // If there is no base register, we emit the special case SIB byte with
- // MOD=0, BASE=5, to JUST get the index, scale, and displacement.
- MCE.emitByte(ModRMByte(0, RegOpcodeField, 4));
- ForceDisp32 = true;
- } else if (DispForReloc) {
- // Emit the normal disp32 encoding.
- MCE.emitByte(ModRMByte(2, RegOpcodeField, 4));
- ForceDisp32 = true;
- } else if (DispVal == 0 && getX86RegNum(BaseReg) != N86::EBP) {
- // Emit no displacement ModR/M byte
- MCE.emitByte(ModRMByte(0, RegOpcodeField, 4));
- } else if (isDisp8(DispVal)) {
- // Emit the disp8 encoding...
- MCE.emitByte(ModRMByte(1, RegOpcodeField, 4));
- ForceDisp8 = true; // Make sure to force 8 bit disp if Base=EBP
- } else {
- // Emit the normal disp32 encoding...
- MCE.emitByte(ModRMByte(2, RegOpcodeField, 4));
- }
-
- // Calculate what the SS field value should be...
- static const unsigned SSTable[] = { ~0, 0, 1, ~0, 2, ~0, ~0, ~0, 3 };
- unsigned SS = SSTable[Scale.getImm()];
-
- if (BaseReg == 0) {
- // Handle the SIB byte for the case where there is no base. The
- // displacement has already been output.
- assert(IndexReg.getReg() && "Index register must be specified!");
- emitSIBByte(SS, getX86RegNum(IndexReg.getReg()), 5);
- } else {
- unsigned BaseRegNo = getX86RegNum(BaseReg);
- unsigned IndexRegNo;
- if (IndexReg.getReg())
- IndexRegNo = getX86RegNum(IndexReg.getReg());
- else
- IndexRegNo = 4; // For example [ESP+1*<noreg>+4]
- emitSIBByte(SS, IndexRegNo, BaseRegNo);
- }
-
- // Do we need to output a displacement?
- if (ForceDisp8) {
- emitConstant(DispVal, 1);
- } else if (DispVal != 0 || ForceDisp32) {
- emitDisplacementField(DispForReloc, DispVal, PCAdj);
- }
- }
-}
-
-void Emitter::emitInstruction(const MachineInstr &MI,
- const TargetInstrDesc *Desc) {
- DOUT << MI;
-
- unsigned Opcode = Desc->Opcode;
-
- // Emit the lock opcode prefix as needed.
- if (Desc->TSFlags & X86II::LOCK) MCE.emitByte(0xF0);
-
- // Emit the repeat opcode prefix as needed.
- if ((Desc->TSFlags & X86II::Op0Mask) == X86II::REP) MCE.emitByte(0xF3);
-
- // Emit the operand size opcode prefix as needed.
- if (Desc->TSFlags & X86II::OpSize) MCE.emitByte(0x66);
-
- // Emit the address size opcode prefix as needed.
- if (Desc->TSFlags & X86II::AdSize) MCE.emitByte(0x67);
-
- bool Need0FPrefix = false;
- switch (Desc->TSFlags & X86II::Op0Mask) {
- case X86II::TB: // Two-byte opcode prefix
- case X86II::T8: // 0F 38
- case X86II::TA: // 0F 3A
- Need0FPrefix = true;
- break;
- case X86II::REP: break; // already handled.
- case X86II::XS: // F3 0F
- MCE.emitByte(0xF3);
- Need0FPrefix = true;
- break;
- case X86II::XD: // F2 0F
- MCE.emitByte(0xF2);
- Need0FPrefix = true;
- break;
- case X86II::D8: case X86II::D9: case X86II::DA: case X86II::DB:
- case X86II::DC: case X86II::DD: case X86II::DE: case X86II::DF:
- MCE.emitByte(0xD8+
- (((Desc->TSFlags & X86II::Op0Mask)-X86II::D8)
- >> X86II::Op0Shift));
- break; // Two-byte opcode prefix
- default: assert(0 && "Invalid prefix!");
- case 0: break; // No prefix!
- }
-
- if (Is64BitMode) {
- // REX prefix
- unsigned REX = X86InstrInfo::determineREX(MI);
- if (REX)
- MCE.emitByte(0x40 | REX);
- }
-
- // 0x0F escape code must be emitted just before the opcode.
- if (Need0FPrefix)
- MCE.emitByte(0x0F);
-
- switch (Desc->TSFlags & X86II::Op0Mask) {
- case X86II::T8: // 0F 38
- MCE.emitByte(0x38);
- break;
- case X86II::TA: // 0F 3A
- MCE.emitByte(0x3A);
- break;
- }
-
- // If this is a two-address instruction, skip one of the register operands.
- unsigned NumOps = Desc->getNumOperands();
- unsigned CurOp = 0;
- if (NumOps > 1 && Desc->getOperandConstraint(1, TOI::TIED_TO) != -1)
- ++CurOp;
- else if (NumOps > 2 && Desc->getOperandConstraint(NumOps-1, TOI::TIED_TO)== 0)
- // Skip the last source operand that is tied_to the dest reg. e.g. LXADD32
- --NumOps;
-
- unsigned char BaseOpcode = II->getBaseOpcodeFor(Desc);
- switch (Desc->TSFlags & X86II::FormMask) {
- default: assert(0 && "Unknown FormMask value in X86 MachineCodeEmitter!");
- case X86II::Pseudo:
- // Remember the current PC offset, this is the PIC relocation
- // base address.
- switch (Opcode) {
- default:
- assert(0 && "psuedo instructions should be removed before code emission");
- break;
- case TargetInstrInfo::INLINEASM:
- assert(0 && "JIT does not support inline asm!\n");
- break;
- case TargetInstrInfo::LABEL:
- MCE.emitLabel(MI.getOperand(0).getImm());
- break;
- case TargetInstrInfo::IMPLICIT_DEF:
- case TargetInstrInfo::DECLARE:
- case X86::DWARF_LOC:
- case X86::FP_REG_KILL:
- break;
- case X86::MOVPC32r: {
- // This emits the "call" portion of this pseudo instruction.
- MCE.emitByte(BaseOpcode);
- emitConstant(0, X86InstrInfo::sizeOfImm(Desc));
- // Remember PIC base.
- PICBaseOffset = MCE.getCurrentPCOffset();
- X86JITInfo *JTI = dynamic_cast<X86JITInfo*>(TM.getJITInfo());
- JTI->setPICBase(MCE.getCurrentPCValue());
- break;
- }
- }
- CurOp = NumOps;
- break;
- case X86II::RawFrm:
- MCE.emitByte(BaseOpcode);
-
- if (CurOp != NumOps) {
- const MachineOperand &MO = MI.getOperand(CurOp++);
- if (MO.isMachineBasicBlock()) {
- emitPCRelativeBlockAddress(MO.getMBB());
- } else if (MO.isGlobalAddress()) {
- bool NeedStub = (Is64BitMode && TM.getCodeModel() == CodeModel::Large)
- || Opcode == X86::TAILJMPd;
- emitGlobalAddress(MO.getGlobal(), X86::reloc_pcrel_word,
- 0, 0, NeedStub);
- } else if (MO.isExternalSymbol()) {
- emitExternalSymbolAddress(MO.getSymbolName(), X86::reloc_pcrel_word);
- } else if (MO.isImmediate()) {
- emitConstant(MO.getImm(), X86InstrInfo::sizeOfImm(Desc));
- } else {
- assert(0 && "Unknown RawFrm operand!");
- }
- }
- break;
-
- case X86II::AddRegFrm:
- MCE.emitByte(BaseOpcode + getX86RegNum(MI.getOperand(CurOp++).getReg()));
-
- if (CurOp != NumOps) {
- const MachineOperand &MO1 = MI.getOperand(CurOp++);
- unsigned Size = X86InstrInfo::sizeOfImm(Desc);
- if (MO1.isImmediate())
- emitConstant(MO1.getImm(), Size);
- else {
- unsigned rt = Is64BitMode ? X86::reloc_pcrel_word
- : (IsPIC ? X86::reloc_picrel_word : X86::reloc_absolute_word);
- if (Opcode == X86::MOV64ri)
- rt = X86::reloc_absolute_dword; // FIXME: add X86II flag?
- if (MO1.isGlobalAddress()) {
- bool NeedStub = isa<Function>(MO1.getGlobal());
- bool isLazy = gvNeedsLazyPtr(MO1.getGlobal());
- emitGlobalAddress(MO1.getGlobal(), rt, MO1.getOffset(), 0,
- NeedStub, isLazy);
- } else if (MO1.isExternalSymbol())
- emitExternalSymbolAddress(MO1.getSymbolName(), rt);
- else if (MO1.isConstantPoolIndex())
- emitConstPoolAddress(MO1.getIndex(), rt);
- else if (MO1.isJumpTableIndex())
- emitJumpTableAddress(MO1.getIndex(), rt);
- }
- }
- break;
-
- case X86II::MRMDestReg: {
- MCE.emitByte(BaseOpcode);
- emitRegModRMByte(MI.getOperand(CurOp).getReg(),
- getX86RegNum(MI.getOperand(CurOp+1).getReg()));
- CurOp += 2;
- if (CurOp != NumOps)
- emitConstant(MI.getOperand(CurOp++).getImm(), X86InstrInfo::sizeOfImm(Desc));
- break;
- }
- case X86II::MRMDestMem: {
- MCE.emitByte(BaseOpcode);
- emitMemModRMByte(MI, CurOp, getX86RegNum(MI.getOperand(CurOp+4).getReg()));
- CurOp += 5;
- if (CurOp != NumOps)
- emitConstant(MI.getOperand(CurOp++).getImm(), X86InstrInfo::sizeOfImm(Desc));
- break;
- }
-
- case X86II::MRMSrcReg:
- MCE.emitByte(BaseOpcode);
- emitRegModRMByte(MI.getOperand(CurOp+1).getReg(),
- getX86RegNum(MI.getOperand(CurOp).getReg()));
- CurOp += 2;
- if (CurOp != NumOps)
- emitConstant(MI.getOperand(CurOp++).getImm(), X86InstrInfo::sizeOfImm(Desc));
- break;
-
- case X86II::MRMSrcMem: {
- intptr_t PCAdj = (CurOp+5 != NumOps) ? X86InstrInfo::sizeOfImm(Desc) : 0;
-
- MCE.emitByte(BaseOpcode);
- emitMemModRMByte(MI, CurOp+1, getX86RegNum(MI.getOperand(CurOp).getReg()),
- PCAdj);
- CurOp += 5;
- if (CurOp != NumOps)
- emitConstant(MI.getOperand(CurOp++).getImm(), X86InstrInfo::sizeOfImm(Desc));
- break;
- }
-
- case X86II::MRM0r: case X86II::MRM1r:
- case X86II::MRM2r: case X86II::MRM3r:
- case X86II::MRM4r: case X86II::MRM5r:
- case X86II::MRM6r: case X86II::MRM7r:
- MCE.emitByte(BaseOpcode);
- emitRegModRMByte(MI.getOperand(CurOp++).getReg(),
- (Desc->TSFlags & X86II::FormMask)-X86II::MRM0r);
-
- if (CurOp != NumOps) {
- const MachineOperand &MO1 = MI.getOperand(CurOp++);
- unsigned Size = X86InstrInfo::sizeOfImm(Desc);
- if (MO1.isImmediate())
- emitConstant(MO1.getImm(), Size);
- else {
- unsigned rt = Is64BitMode ? X86::reloc_pcrel_word
- : (IsPIC ? X86::reloc_picrel_word : X86::reloc_absolute_word);
- if (Opcode == X86::MOV64ri32)
- rt = X86::reloc_absolute_word; // FIXME: add X86II flag?
- if (MO1.isGlobalAddress()) {
- bool NeedStub = isa<Function>(MO1.getGlobal());
- bool isLazy = gvNeedsLazyPtr(MO1.getGlobal());
- emitGlobalAddress(MO1.getGlobal(), rt, MO1.getOffset(), 0,
- NeedStub, isLazy);
- } else if (MO1.isExternalSymbol())
- emitExternalSymbolAddress(MO1.getSymbolName(), rt);
- else if (MO1.isConstantPoolIndex())
- emitConstPoolAddress(MO1.getIndex(), rt);
- else if (MO1.isJumpTableIndex())
- emitJumpTableAddress(MO1.getIndex(), rt);
- }
- }
- break;
-
- case X86II::MRM0m: case X86II::MRM1m:
- case X86II::MRM2m: case X86II::MRM3m:
- case X86II::MRM4m: case X86II::MRM5m:
- case X86II::MRM6m: case X86II::MRM7m: {
- intptr_t PCAdj = (CurOp+4 != NumOps) ?
- (MI.getOperand(CurOp+4).isImmediate() ? X86InstrInfo::sizeOfImm(Desc) : 4) : 0;
-
- MCE.emitByte(BaseOpcode);
- emitMemModRMByte(MI, CurOp, (Desc->TSFlags & X86II::FormMask)-X86II::MRM0m,
- PCAdj);
- CurOp += 4;
-
- if (CurOp != NumOps) {
- const MachineOperand &MO = MI.getOperand(CurOp++);
- unsigned Size = X86InstrInfo::sizeOfImm(Desc);
- if (MO.isImmediate())
- emitConstant(MO.getImm(), Size);
- else {
- unsigned rt = Is64BitMode ? X86::reloc_pcrel_word
- : (IsPIC ? X86::reloc_picrel_word : X86::reloc_absolute_word);
- if (Opcode == X86::MOV64mi32)
- rt = X86::reloc_absolute_word; // FIXME: add X86II flag?
- if (MO.isGlobalAddress()) {
- bool NeedStub = isa<Function>(MO.getGlobal());
- bool isLazy = gvNeedsLazyPtr(MO.getGlobal());
- emitGlobalAddress(MO.getGlobal(), rt, MO.getOffset(), 0,
- NeedStub, isLazy);
- } else if (MO.isExternalSymbol())
- emitExternalSymbolAddress(MO.getSymbolName(), rt);
- else if (MO.isConstantPoolIndex())
- emitConstPoolAddress(MO.getIndex(), rt);
- else if (MO.isJumpTableIndex())
- emitJumpTableAddress(MO.getIndex(), rt);
- }
- }
- break;
- }
-
- case X86II::MRMInitReg:
- MCE.emitByte(BaseOpcode);
- // Duplicate register, used by things like MOV8r0 (aka xor reg,reg).
- emitRegModRMByte(MI.getOperand(CurOp).getReg(),
- getX86RegNum(MI.getOperand(CurOp).getReg()));
- ++CurOp;
- break;
- }
-
- if (!Desc->isVariadic() && CurOp != NumOps) {
- cerr << "Cannot encode: ";
- MI.dump();
- cerr << '\n';
- abort();
- }
-}
diff --git a/release_23/lib/Target/X86/X86CompilationCallback_Win64.asm b/release_23/lib/Target/X86/X86CompilationCallback_Win64.asm
deleted file mode 100644
index 8002f98765f0..000000000000
--- a/release_23/lib/Target/X86/X86CompilationCallback_Win64.asm
+++ /dev/null
@@ -1,67 +0,0 @@
-;;===-- X86CompilationCallback_Win64.asm - Implement Win64 JIT callback ---===
-;;
-;; The LLVM Compiler Infrastructure
-;;
-;; This file is distributed under the University of Illinois Open Source
-;; License. See LICENSE.TXT for details.
-;;
-;;===----------------------------------------------------------------------===
-;;
-;; This file implements the JIT interfaces for the X86 target.
-;;
-;;===----------------------------------------------------------------------===
-
-extrn X86CompilationCallback2: PROC
-
-.code
-X86CompilationCallback proc
- push rbp
-
- ; Save RSP
- mov rbp, rsp
-
- ; Save all int arg registers
- push rcx
- push rdx
- push r8
- push r9
-
- ; Align stack on 16-byte boundary.
- and rsp, -16
-
- ; Save all XMM arg registers
- sub rsp, 64
- movaps [rsp], xmm0
- movaps [rsp+16], xmm1
- movaps [rsp+32], xmm2
- movaps [rsp+48], xmm3
-
- ; JIT callee
-
- ; Pass prev frame and return address
- mov rcx, rbp
- mov rdx, qword ptr [rbp+8]
- call X86CompilationCallback2
-
- ; Restore all XMM arg registers
- movaps xmm3, [rsp+48]
- movaps xmm2, [rsp+32]
- movaps xmm1, [rsp+16]
- movaps xmm0, [rsp]
-
- ; Restore RSP
- mov rsp, rbp
-
- ; Restore all int arg registers
- sub rsp, 32
- pop r9
- pop r8
- pop rdx
- pop rcx
-
- ; Restore RBP
- pop rbp
- ret
-X86CompilationCallback endp
-
-End
diff --git a/release_23/lib/Target/X86/X86ELFWriterInfo.cpp b/release_23/lib/Target/X86/X86ELFWriterInfo.cpp
deleted file mode 100644
index 4c3cc828f46e..000000000000
--- a/release_23/lib/Target/X86/X86ELFWriterInfo.cpp
+++ /dev/null
@@ -1,18 +0,0 @@
-//===-- X86ELFWriterInfo.cpp - ELF Writer Info for the X86 backend --------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements ELF writer information for the X86 backend.
-//
-//===----------------------------------------------------------------------===//
-
-#include "X86ELFWriterInfo.h"
-using namespace llvm;
-
-X86ELFWriterInfo::X86ELFWriterInfo() : TargetELFWriterInfo(EM_386) {}
-X86ELFWriterInfo::~X86ELFWriterInfo() {}
diff --git a/release_23/lib/Target/X86/X86ELFWriterInfo.h b/release_23/lib/Target/X86/X86ELFWriterInfo.h
deleted file mode 100644
index 06e051a34ac9..000000000000
--- a/release_23/lib/Target/X86/X86ELFWriterInfo.h
+++ /dev/null
@@ -1,29 +0,0 @@
-//===-- X86ELFWriterInfo.h - ELF Writer Info for X86 ------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements ELF writer information for the X86 backend.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef X86_ELF_WRITER_INFO_H
-#define X86_ELF_WRITER_INFO_H
-
-#include "llvm/Target/TargetELFWriterInfo.h"
-
-namespace llvm {
-
- class X86ELFWriterInfo : public TargetELFWriterInfo {
- public:
- X86ELFWriterInfo();
- virtual ~X86ELFWriterInfo();
- };
-
-} // end llvm namespace
-
-#endif // X86_ELF_WRITER_INFO_H
diff --git a/release_23/lib/Target/X86/X86FloatingPoint.cpp b/release_23/lib/Target/X86/X86FloatingPoint.cpp
deleted file mode 100644
index 3cda3006a388..000000000000
--- a/release_23/lib/Target/X86/X86FloatingPoint.cpp
+++ /dev/null
@@ -1,1126 +0,0 @@
-//===-- X86FloatingPoint.cpp - Floating point Reg -> Stack converter ------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines the pass which converts floating point instructions from
-// virtual registers into register stack instructions. This pass uses live
-// variable information to indicate where the FPn registers are used and their
-// lifetimes.
-//
-// This pass is hampered by the lack of decent CFG manipulation routines for
-// machine code. In particular, this wants to be able to split critical edges
-// as necessary, traverse the machine basic block CFG in depth-first order, and
-// allow there to be multiple machine basic blocks for each LLVM basicblock
-// (needed for critical edge splitting).
-//
-// In particular, this pass currently barfs on critical edges. Because of this,
-// it requires the instruction selector to insert FP_REG_KILL instructions on
-// the exits of any basic block that has critical edges going from it, or which
-// branch to a critical basic block.
-//
-// FIXME: this is not implemented yet. The stackifier pass only works on local
-// basic blocks.
-//
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "x86-codegen"
-#include "X86.h"
-#include "X86InstrInfo.h"
-#include "llvm/CodeGen/MachineFunctionPass.h"
-#include "llvm/CodeGen/MachineInstrBuilder.h"
-#include "llvm/CodeGen/MachineRegisterInfo.h"
-#include "llvm/CodeGen/Passes.h"
-#include "llvm/Target/TargetInstrInfo.h"
-#include "llvm/Target/TargetMachine.h"
-#include "llvm/Support/Debug.h"
-#include "llvm/Support/Compiler.h"
-#include "llvm/ADT/DepthFirstIterator.h"
-#include "llvm/ADT/SmallVector.h"
-#include "llvm/ADT/Statistic.h"
-#include "llvm/ADT/STLExtras.h"
-#include <algorithm>
-#include <set>
-using namespace llvm;
-
-STATISTIC(NumFXCH, "Number of fxch instructions inserted");
-STATISTIC(NumFP , "Number of floating point instructions");
-
-namespace {
- struct VISIBILITY_HIDDEN FPS : public MachineFunctionPass {
- static char ID;
- FPS() : MachineFunctionPass((intptr_t)&ID) {}
-
- virtual bool runOnMachineFunction(MachineFunction &MF);
-
- virtual const char *getPassName() const { return "X86 FP Stackifier"; }
-
- private:
- const TargetInstrInfo *TII; // Machine instruction info.
- MachineBasicBlock *MBB; // Current basic block
- unsigned Stack[8]; // FP<n> Registers in each stack slot...
- unsigned RegMap[8]; // Track which stack slot contains each register
- unsigned StackTop; // The current top of the FP stack.
-
- void dumpStack() const {
- cerr << "Stack contents:";
- for (unsigned i = 0; i != StackTop; ++i) {
- cerr << " FP" << Stack[i];
- assert(RegMap[Stack[i]] == i && "Stack[] doesn't match RegMap[]!");
- }
- cerr << "\n";
- }
- private:
- /// isStackEmpty - Return true if the FP stack is empty.
- bool isStackEmpty() const {
- return StackTop == 0;
- }
-
- // getSlot - Return the stack slot number a particular register number is
- // in.
- unsigned getSlot(unsigned RegNo) const {
- assert(RegNo < 8 && "Regno out of range!");
- return RegMap[RegNo];
- }
-
- // getStackEntry - Return the X86::FP<n> register in register ST(i).
- unsigned getStackEntry(unsigned STi) const {
- assert(STi < StackTop && "Access past stack top!");
- return Stack[StackTop-1-STi];
- }
-
- // getSTReg - Return the X86::ST(i) register which contains the specified
- // FP<RegNo> register.
- unsigned getSTReg(unsigned RegNo) const {
- return StackTop - 1 - getSlot(RegNo) + llvm::X86::ST0;
- }
-
- // pushReg - Push the specified FP<n> register onto the stack.
- void pushReg(unsigned Reg) {
- assert(Reg < 8 && "Register number out of range!");
- assert(StackTop < 8 && "Stack overflow!");
- Stack[StackTop] = Reg;
- RegMap[Reg] = StackTop++;
- }
-
- bool isAtTop(unsigned RegNo) const { return getSlot(RegNo) == StackTop-1; }
- void moveToTop(unsigned RegNo, MachineBasicBlock::iterator I) {
- if (isAtTop(RegNo)) return;
-
- unsigned STReg = getSTReg(RegNo);
- unsigned RegOnTop = getStackEntry(0);
-
- // Swap the slots the regs are in.
- std::swap(RegMap[RegNo], RegMap[RegOnTop]);
-
- // Swap stack slot contents.
- assert(RegMap[RegOnTop] < StackTop);
- std::swap(Stack[RegMap[RegOnTop]], Stack[StackTop-1]);
-
- // Emit an fxch to update the runtime processors version of the state.
- BuildMI(*MBB, I, TII->get(X86::XCH_F)).addReg(STReg);
- NumFXCH++;
- }
-
- void duplicateToTop(unsigned RegNo, unsigned AsReg, MachineInstr *I) {
- unsigned STReg = getSTReg(RegNo);
- pushReg(AsReg); // New register on top of stack
-
- BuildMI(*MBB, I, TII->get(X86::LD_Frr)).addReg(STReg);
- }
-
- // popStackAfter - Pop the current value off of the top of the FP stack
- // after the specified instruction.
- void popStackAfter(MachineBasicBlock::iterator &I);
-
- // freeStackSlotAfter - Free the specified register from the register stack,
- // so that it is no longer in a register. If the register is currently at
- // the top of the stack, we just pop the current instruction, otherwise we
- // store the current top-of-stack into the specified slot, then pop the top
- // of stack.
- void freeStackSlotAfter(MachineBasicBlock::iterator &I, unsigned Reg);
-
- bool processBasicBlock(MachineFunction &MF, MachineBasicBlock &MBB);
-
- void handleZeroArgFP(MachineBasicBlock::iterator &I);
- void handleOneArgFP(MachineBasicBlock::iterator &I);
- void handleOneArgFPRW(MachineBasicBlock::iterator &I);
- void handleTwoArgFP(MachineBasicBlock::iterator &I);
- void handleCompareFP(MachineBasicBlock::iterator &I);
- void handleCondMovFP(MachineBasicBlock::iterator &I);
- void handleSpecialFP(MachineBasicBlock::iterator &I);
- };
- char FPS::ID = 0;
-}
-
-FunctionPass *llvm::createX86FloatingPointStackifierPass() { return new FPS(); }
-
-/// getFPReg - Return the X86::FPx register number for the specified operand.
-/// For example, this returns 3 for X86::FP3.
-static unsigned getFPReg(const MachineOperand &MO) {
- assert(MO.isRegister() && "Expected an FP register!");
- unsigned Reg = MO.getReg();
- assert(Reg >= X86::FP0 && Reg <= X86::FP6 && "Expected FP register!");
- return Reg - X86::FP0;
-}
-
-
-/// runOnMachineFunction - Loop over all of the basic blocks, transforming FP
-/// register references into FP stack references.
-///
-bool FPS::runOnMachineFunction(MachineFunction &MF) {
- // We only need to run this pass if there are any FP registers used in this
- // function. If it is all integer, there is nothing for us to do!
- bool FPIsUsed = false;
-
- assert(X86::FP6 == X86::FP0+6 && "Register enums aren't sorted right!");
- for (unsigned i = 0; i <= 6; ++i)
- if (MF.getRegInfo().isPhysRegUsed(X86::FP0+i)) {
- FPIsUsed = true;
- break;
- }
-
- // Early exit.
- if (!FPIsUsed) return false;
-
- TII = MF.getTarget().getInstrInfo();
- StackTop = 0;
-
- // Process the function in depth first order so that we process at least one
- // of the predecessors for every reachable block in the function.
- std::set<MachineBasicBlock*> Processed;
- MachineBasicBlock *Entry = MF.begin();
-
- bool Changed = false;
- for (df_ext_iterator<MachineBasicBlock*, std::set<MachineBasicBlock*> >
- I = df_ext_begin(Entry, Processed), E = df_ext_end(Entry, Processed);
- I != E; ++I)
- Changed |= processBasicBlock(MF, **I);
-
- return Changed;
-}
-
-/// processBasicBlock - Loop over all of the instructions in the basic block,
-/// transforming FP instructions into their stack form.
-///
-bool FPS::processBasicBlock(MachineFunction &MF, MachineBasicBlock &BB) {
- bool Changed = false;
- MBB = &BB;
-
- for (MachineBasicBlock::iterator I = BB.begin(); I != BB.end(); ++I) {
- MachineInstr *MI = I;
- unsigned Flags = MI->getDesc().TSFlags;
-
- unsigned FPInstClass = Flags & X86II::FPTypeMask;
- if (MI->getOpcode() == TargetInstrInfo::INLINEASM)
- FPInstClass = X86II::SpecialFP;
-
- if (FPInstClass == X86II::NotFP)
- continue; // Efficiently ignore non-fp insts!
-
- MachineInstr *PrevMI = 0;
- if (I != BB.begin())
- PrevMI = prior(I);
-
- ++NumFP; // Keep track of # of pseudo instrs
- DOUT << "\nFPInst:\t" << *MI;
-
- // Get dead variables list now because the MI pointer may be deleted as part
- // of processing!
- SmallVector<unsigned, 8> DeadRegs;
- for (unsigned i = 0, e = MI->getNumOperands(); i != e; ++i) {
- const MachineOperand &MO = MI->getOperand(i);
- if (MO.isRegister() && MO.isDead())
- DeadRegs.push_back(MO.getReg());
- }
-
- switch (FPInstClass) {
- case X86II::ZeroArgFP: handleZeroArgFP(I); break;
- case X86II::OneArgFP: handleOneArgFP(I); break; // fstp ST(0)
- case X86II::OneArgFPRW: handleOneArgFPRW(I); break; // ST(0) = fsqrt(ST(0))
- case X86II::TwoArgFP: handleTwoArgFP(I); break;
- case X86II::CompareFP: handleCompareFP(I); break;
- case X86II::CondMovFP: handleCondMovFP(I); break;
- case X86II::SpecialFP: handleSpecialFP(I); break;
- default: assert(0 && "Unknown FP Type!");
- }
-
- // Check to see if any of the values defined by this instruction are dead
- // after definition. If so, pop them.
- for (unsigned i = 0, e = DeadRegs.size(); i != e; ++i) {
- unsigned Reg = DeadRegs[i];
- if (Reg >= X86::FP0 && Reg <= X86::FP6) {
- DOUT << "Register FP#" << Reg-X86::FP0 << " is dead!\n";
- freeStackSlotAfter(I, Reg-X86::FP0);
- }
- }
-
- // Print out all of the instructions expanded to if -debug
- DEBUG(
- MachineBasicBlock::iterator PrevI(PrevMI);
- if (I == PrevI) {
- cerr << "Just deleted pseudo instruction\n";
- } else {
- MachineBasicBlock::iterator Start = I;
- // Rewind to first instruction newly inserted.
- while (Start != BB.begin() && prior(Start) != PrevI) --Start;
- cerr << "Inserted instructions:\n\t";
- Start->print(*cerr.stream(), &MF.getTarget());
- while (++Start != next(I)) {}
- }
- dumpStack();
- );
-
- Changed = true;
- }
-
- assert(isStackEmpty() && "Stack not empty at end of basic block?");
- return Changed;
-}
-
-//===----------------------------------------------------------------------===//
-// Efficient Lookup Table Support
-//===----------------------------------------------------------------------===//
-
-namespace {
- struct TableEntry {
- unsigned from;
- unsigned to;
- bool operator<(const TableEntry &TE) const { return from < TE.from; }
- friend bool operator<(const TableEntry &TE, unsigned V) {
- return TE.from < V;
- }
- friend bool operator<(unsigned V, const TableEntry &TE) {
- return V < TE.from;
- }
- };
-}
-
-static bool TableIsSorted(const TableEntry *Table, unsigned NumEntries) {
- for (unsigned i = 0; i != NumEntries-1; ++i)
- if (!(Table[i] < Table[i+1])) return false;
- return true;
-}
-
-static int Lookup(const TableEntry *Table, unsigned N, unsigned Opcode) {
- const TableEntry *I = std::lower_bound(Table, Table+N, Opcode);
- if (I != Table+N && I->from == Opcode)
- return I->to;
- return -1;
-}
-
-#ifdef NDEBUG
-#define ASSERT_SORTED(TABLE)
-#else
-#define ASSERT_SORTED(TABLE) \
- { static bool TABLE##Checked = false; \
- if (!TABLE##Checked) { \
- assert(TableIsSorted(TABLE, array_lengthof(TABLE)) && \
- "All lookup tables must be sorted for efficient access!"); \
- TABLE##Checked = true; \
- } \
- }
-#endif
-
-//===----------------------------------------------------------------------===//
-// Register File -> Register Stack Mapping Methods
-//===----------------------------------------------------------------------===//
-
-// OpcodeTable - Sorted map of register instructions to their stack version.
-// The first element is an register file pseudo instruction, the second is the
-// concrete X86 instruction which uses the register stack.
-//
-static const TableEntry OpcodeTable[] = {
- { X86::ABS_Fp32 , X86::ABS_F },
- { X86::ABS_Fp64 , X86::ABS_F },
- { X86::ABS_Fp80 , X86::ABS_F },
- { X86::ADD_Fp32m , X86::ADD_F32m },
- { X86::ADD_Fp64m , X86::ADD_F64m },
- { X86::ADD_Fp64m32 , X86::ADD_F32m },
- { X86::ADD_Fp80m32 , X86::ADD_F32m },
- { X86::ADD_Fp80m64 , X86::ADD_F64m },
- { X86::ADD_FpI16m32 , X86::ADD_FI16m },
- { X86::ADD_FpI16m64 , X86::ADD_FI16m },
- { X86::ADD_FpI16m80 , X86::ADD_FI16m },
- { X86::ADD_FpI32m32 , X86::ADD_FI32m },
- { X86::ADD_FpI32m64 , X86::ADD_FI32m },
- { X86::ADD_FpI32m80 , X86::ADD_FI32m },
- { X86::CHS_Fp32 , X86::CHS_F },
- { X86::CHS_Fp64 , X86::CHS_F },
- { X86::CHS_Fp80 , X86::CHS_F },
- { X86::CMOVBE_Fp32 , X86::CMOVBE_F },
- { X86::CMOVBE_Fp64 , X86::CMOVBE_F },
- { X86::CMOVBE_Fp80 , X86::CMOVBE_F },
- { X86::CMOVB_Fp32 , X86::CMOVB_F },
- { X86::CMOVB_Fp64 , X86::CMOVB_F },
- { X86::CMOVB_Fp80 , X86::CMOVB_F },
- { X86::CMOVE_Fp32 , X86::CMOVE_F },
- { X86::CMOVE_Fp64 , X86::CMOVE_F },
- { X86::CMOVE_Fp80 , X86::CMOVE_F },
- { X86::CMOVNBE_Fp32 , X86::CMOVNBE_F },
- { X86::CMOVNBE_Fp64 , X86::CMOVNBE_F },
- { X86::CMOVNBE_Fp80 , X86::CMOVNBE_F },
- { X86::CMOVNB_Fp32 , X86::CMOVNB_F },
- { X86::CMOVNB_Fp64 , X86::CMOVNB_F },
- { X86::CMOVNB_Fp80 , X86::CMOVNB_F },
- { X86::CMOVNE_Fp32 , X86::CMOVNE_F },
- { X86::CMOVNE_Fp64 , X86::CMOVNE_F },
- { X86::CMOVNE_Fp80 , X86::CMOVNE_F },
- { X86::CMOVNP_Fp32 , X86::CMOVNP_F },
- { X86::CMOVNP_Fp64 , X86::CMOVNP_F },
- { X86::CMOVNP_Fp80 , X86::CMOVNP_F },
- { X86::CMOVP_Fp32 , X86::CMOVP_F },
- { X86::CMOVP_Fp64 , X86::CMOVP_F },
- { X86::CMOVP_Fp80 , X86::CMOVP_F },
- { X86::COS_Fp32 , X86::COS_F },
- { X86::COS_Fp64 , X86::COS_F },
- { X86::COS_Fp80 , X86::COS_F },
- { X86::DIVR_Fp32m , X86::DIVR_F32m },
- { X86::DIVR_Fp64m , X86::DIVR_F64m },
- { X86::DIVR_Fp64m32 , X86::DIVR_F32m },
- { X86::DIVR_Fp80m32 , X86::DIVR_F32m },
- { X86::DIVR_Fp80m64 , X86::DIVR_F64m },
- { X86::DIVR_FpI16m32, X86::DIVR_FI16m},
- { X86::DIVR_FpI16m64, X86::DIVR_FI16m},
- { X86::DIVR_FpI16m80, X86::DIVR_FI16m},
- { X86::DIVR_FpI32m32, X86::DIVR_FI32m},
- { X86::DIVR_FpI32m64, X86::DIVR_FI32m},
- { X86::DIVR_FpI32m80, X86::DIVR_FI32m},
- { X86::DIV_Fp32m , X86::DIV_F32m },
- { X86::DIV_Fp64m , X86::DIV_F64m },
- { X86::DIV_Fp64m32 , X86::DIV_F32m },
- { X86::DIV_Fp80m32 , X86::DIV_F32m },
- { X86::DIV_Fp80m64 , X86::DIV_F64m },
- { X86::DIV_FpI16m32 , X86::DIV_FI16m },
- { X86::DIV_FpI16m64 , X86::DIV_FI16m },
- { X86::DIV_FpI16m80 , X86::DIV_FI16m },
- { X86::DIV_FpI32m32 , X86::DIV_FI32m },
- { X86::DIV_FpI32m64 , X86::DIV_FI32m },
- { X86::DIV_FpI32m80 , X86::DIV_FI32m },
- { X86::ILD_Fp16m32 , X86::ILD_F16m },
- { X86::ILD_Fp16m64 , X86::ILD_F16m },
- { X86::ILD_Fp16m80 , X86::ILD_F16m },
- { X86::ILD_Fp32m32 , X86::ILD_F32m },
- { X86::ILD_Fp32m64 , X86::ILD_F32m },
- { X86::ILD_Fp32m80 , X86::ILD_F32m },
- { X86::ILD_Fp64m32 , X86::ILD_F64m },
- { X86::ILD_Fp64m64 , X86::ILD_F64m },
- { X86::ILD_Fp64m80 , X86::ILD_F64m },
- { X86::ISTT_Fp16m32 , X86::ISTT_FP16m},
- { X86::ISTT_Fp16m64 , X86::ISTT_FP16m},
- { X86::ISTT_Fp16m80 , X86::ISTT_FP16m},
- { X86::ISTT_Fp32m32 , X86::ISTT_FP32m},
- { X86::ISTT_Fp32m64 , X86::ISTT_FP32m},
- { X86::ISTT_Fp32m80 , X86::ISTT_FP32m},
- { X86::ISTT_Fp64m32 , X86::ISTT_FP64m},
- { X86::ISTT_Fp64m64 , X86::ISTT_FP64m},
- { X86::ISTT_Fp64m80 , X86::ISTT_FP64m},
- { X86::IST_Fp16m32 , X86::IST_F16m },
- { X86::IST_Fp16m64 , X86::IST_F16m },
- { X86::IST_Fp16m80 , X86::IST_F16m },
- { X86::IST_Fp32m32 , X86::IST_F32m },
- { X86::IST_Fp32m64 , X86::IST_F32m },
- { X86::IST_Fp32m80 , X86::IST_F32m },
- { X86::IST_Fp64m32 , X86::IST_FP64m },
- { X86::IST_Fp64m64 , X86::IST_FP64m },
- { X86::IST_Fp64m80 , X86::IST_FP64m },
- { X86::LD_Fp032 , X86::LD_F0 },
- { X86::LD_Fp064 , X86::LD_F0 },
- { X86::LD_Fp080 , X86::LD_F0 },
- { X86::LD_Fp132 , X86::LD_F1 },
- { X86::LD_Fp164 , X86::LD_F1 },
- { X86::LD_Fp180 , X86::LD_F1 },
- { X86::LD_Fp32m , X86::LD_F32m },
- { X86::LD_Fp32m64 , X86::LD_F32m },
- { X86::LD_Fp32m80 , X86::LD_F32m },
- { X86::LD_Fp64m , X86::LD_F64m },
- { X86::LD_Fp64m80 , X86::LD_F64m },
- { X86::LD_Fp80m , X86::LD_F80m },
- { X86::MUL_Fp32m , X86::MUL_F32m },
- { X86::MUL_Fp64m , X86::MUL_F64m },
- { X86::MUL_Fp64m32 , X86::MUL_F32m },
- { X86::MUL_Fp80m32 , X86::MUL_F32m },
- { X86::MUL_Fp80m64 , X86::MUL_F64m },
- { X86::MUL_FpI16m32 , X86::MUL_FI16m },
- { X86::MUL_FpI16m64 , X86::MUL_FI16m },
- { X86::MUL_FpI16m80 , X86::MUL_FI16m },
- { X86::MUL_FpI32m32 , X86::MUL_FI32m },
- { X86::MUL_FpI32m64 , X86::MUL_FI32m },
- { X86::MUL_FpI32m80 , X86::MUL_FI32m },
- { X86::SIN_Fp32 , X86::SIN_F },
- { X86::SIN_Fp64 , X86::SIN_F },
- { X86::SIN_Fp80 , X86::SIN_F },
- { X86::SQRT_Fp32 , X86::SQRT_F },
- { X86::SQRT_Fp64 , X86::SQRT_F },
- { X86::SQRT_Fp80 , X86::SQRT_F },
- { X86::ST_Fp32m , X86::ST_F32m },
- { X86::ST_Fp64m , X86::ST_F64m },
- { X86::ST_Fp64m32 , X86::ST_F32m },
- { X86::ST_Fp80m32 , X86::ST_F32m },
- { X86::ST_Fp80m64 , X86::ST_F64m },
- { X86::ST_FpP80m , X86::ST_FP80m },
- { X86::SUBR_Fp32m , X86::SUBR_F32m },
- { X86::SUBR_Fp64m , X86::SUBR_F64m },
- { X86::SUBR_Fp64m32 , X86::SUBR_F32m },
- { X86::SUBR_Fp80m32 , X86::SUBR_F32m },
- { X86::SUBR_Fp80m64 , X86::SUBR_F64m },
- { X86::SUBR_FpI16m32, X86::SUBR_FI16m},
- { X86::SUBR_FpI16m64, X86::SUBR_FI16m},
- { X86::SUBR_FpI16m80, X86::SUBR_FI16m},
- { X86::SUBR_FpI32m32, X86::SUBR_FI32m},
- { X86::SUBR_FpI32m64, X86::SUBR_FI32m},
- { X86::SUBR_FpI32m80, X86::SUBR_FI32m},
- { X86::SUB_Fp32m , X86::SUB_F32m },
- { X86::SUB_Fp64m , X86::SUB_F64m },
- { X86::SUB_Fp64m32 , X86::SUB_F32m },
- { X86::SUB_Fp80m32 , X86::SUB_F32m },
- { X86::SUB_Fp80m64 , X86::SUB_F64m },
- { X86::SUB_FpI16m32 , X86::SUB_FI16m },
- { X86::SUB_FpI16m64 , X86::SUB_FI16m },
- { X86::SUB_FpI16m80 , X86::SUB_FI16m },
- { X86::SUB_FpI32m32 , X86::SUB_FI32m },
- { X86::SUB_FpI32m64 , X86::SUB_FI32m },
- { X86::SUB_FpI32m80 , X86::SUB_FI32m },
- { X86::TST_Fp32 , X86::TST_F },
- { X86::TST_Fp64 , X86::TST_F },
- { X86::TST_Fp80 , X86::TST_F },
- { X86::UCOM_FpIr32 , X86::UCOM_FIr },
- { X86::UCOM_FpIr64 , X86::UCOM_FIr },
- { X86::UCOM_FpIr80 , X86::UCOM_FIr },
- { X86::UCOM_Fpr32 , X86::UCOM_Fr },
- { X86::UCOM_Fpr64 , X86::UCOM_Fr },
- { X86::UCOM_Fpr80 , X86::UCOM_Fr },
-};
-
-static unsigned getConcreteOpcode(unsigned Opcode) {
- ASSERT_SORTED(OpcodeTable);
- int Opc = Lookup(OpcodeTable, array_lengthof(OpcodeTable), Opcode);
- assert(Opc != -1 && "FP Stack instruction not in OpcodeTable!");
- return Opc;
-}
-
-//===----------------------------------------------------------------------===//
-// Helper Methods
-//===----------------------------------------------------------------------===//
-
-// PopTable - Sorted map of instructions to their popping version. The first
-// element is an instruction, the second is the version which pops.
-//
-static const TableEntry PopTable[] = {
- { X86::ADD_FrST0 , X86::ADD_FPrST0 },
-
- { X86::DIVR_FrST0, X86::DIVR_FPrST0 },
- { X86::DIV_FrST0 , X86::DIV_FPrST0 },
-
- { X86::IST_F16m , X86::IST_FP16m },
- { X86::IST_F32m , X86::IST_FP32m },
-
- { X86::MUL_FrST0 , X86::MUL_FPrST0 },
-
- { X86::ST_F32m , X86::ST_FP32m },
- { X86::ST_F64m , X86::ST_FP64m },
- { X86::ST_Frr , X86::ST_FPrr },
-
- { X86::SUBR_FrST0, X86::SUBR_FPrST0 },
- { X86::SUB_FrST0 , X86::SUB_FPrST0 },
-
- { X86::UCOM_FIr , X86::UCOM_FIPr },
-
- { X86::UCOM_FPr , X86::UCOM_FPPr },
- { X86::UCOM_Fr , X86::UCOM_FPr },
-};
-
-/// popStackAfter - Pop the current value off of the top of the FP stack after
-/// the specified instruction. This attempts to be sneaky and combine the pop
-/// into the instruction itself if possible. The iterator is left pointing to
-/// the last instruction, be it a new pop instruction inserted, or the old
-/// instruction if it was modified in place.
-///
-void FPS::popStackAfter(MachineBasicBlock::iterator &I) {
- ASSERT_SORTED(PopTable);
- assert(StackTop > 0 && "Cannot pop empty stack!");
- RegMap[Stack[--StackTop]] = ~0; // Update state
-
- // Check to see if there is a popping version of this instruction...
- int Opcode = Lookup(PopTable, array_lengthof(PopTable), I->getOpcode());
- if (Opcode != -1) {
- I->setDesc(TII->get(Opcode));
- if (Opcode == X86::UCOM_FPPr)
- I->RemoveOperand(0);
- } else { // Insert an explicit pop
- I = BuildMI(*MBB, ++I, TII->get(X86::ST_FPrr)).addReg(X86::ST0);
- }
-}
-
-/// freeStackSlotAfter - Free the specified register from the register stack, so
-/// that it is no longer in a register. If the register is currently at the top
-/// of the stack, we just pop the current instruction, otherwise we store the
-/// current top-of-stack into the specified slot, then pop the top of stack.
-void FPS::freeStackSlotAfter(MachineBasicBlock::iterator &I, unsigned FPRegNo) {
- if (getStackEntry(0) == FPRegNo) { // already at the top of stack? easy.
- popStackAfter(I);
- return;
- }
-
- // Otherwise, store the top of stack into the dead slot, killing the operand
- // without having to add in an explicit xchg then pop.
- //
- unsigned STReg = getSTReg(FPRegNo);
- unsigned OldSlot = getSlot(FPRegNo);
- unsigned TopReg = Stack[StackTop-1];
- Stack[OldSlot] = TopReg;
- RegMap[TopReg] = OldSlot;
- RegMap[FPRegNo] = ~0;
- Stack[--StackTop] = ~0;
- I = BuildMI(*MBB, ++I, TII->get(X86::ST_FPrr)).addReg(STReg);
-}
-
-
-//===----------------------------------------------------------------------===//
-// Instruction transformation implementation
-//===----------------------------------------------------------------------===//
-
-/// handleZeroArgFP - ST(0) = fld0 ST(0) = flds <mem>
-///
-void FPS::handleZeroArgFP(MachineBasicBlock::iterator &I) {
- MachineInstr *MI = I;
- unsigned DestReg = getFPReg(MI->getOperand(0));
-
- // Change from the pseudo instruction to the concrete instruction.
- MI->RemoveOperand(0); // Remove the explicit ST(0) operand
- MI->setDesc(TII->get(getConcreteOpcode(MI->getOpcode())));
-
- // Result gets pushed on the stack.
- pushReg(DestReg);
-}
-
-/// handleOneArgFP - fst <mem>, ST(0)
-///
-void FPS::handleOneArgFP(MachineBasicBlock::iterator &I) {
- MachineInstr *MI = I;
- unsigned NumOps = MI->getDesc().getNumOperands();
- assert((NumOps == 5 || NumOps == 1) &&
- "Can only handle fst* & ftst instructions!");
-
- // Is this the last use of the source register?
- unsigned Reg = getFPReg(MI->getOperand(NumOps-1));
- bool KillsSrc = MI->killsRegister(X86::FP0+Reg);
-
- // FISTP64m is strange because there isn't a non-popping versions.
- // If we have one _and_ we don't want to pop the operand, duplicate the value
- // on the stack instead of moving it. This ensure that popping the value is
- // always ok.
- // Ditto FISTTP16m, FISTTP32m, FISTTP64m, ST_FpP80m.
- //
- if (!KillsSrc &&
- (MI->getOpcode() == X86::IST_Fp64m32 ||
- MI->getOpcode() == X86::ISTT_Fp16m32 ||
- MI->getOpcode() == X86::ISTT_Fp32m32 ||
- MI->getOpcode() == X86::ISTT_Fp64m32 ||
- MI->getOpcode() == X86::IST_Fp64m64 ||
- MI->getOpcode() == X86::ISTT_Fp16m64 ||
- MI->getOpcode() == X86::ISTT_Fp32m64 ||
- MI->getOpcode() == X86::ISTT_Fp64m64 ||
- MI->getOpcode() == X86::IST_Fp64m80 ||
- MI->getOpcode() == X86::ISTT_Fp16m80 ||
- MI->getOpcode() == X86::ISTT_Fp32m80 ||
- MI->getOpcode() == X86::ISTT_Fp64m80 ||
- MI->getOpcode() == X86::ST_FpP80m)) {
- duplicateToTop(Reg, 7 /*temp register*/, I);
- } else {
- moveToTop(Reg, I); // Move to the top of the stack...
- }
-
- // Convert from the pseudo instruction to the concrete instruction.
- MI->RemoveOperand(NumOps-1); // Remove explicit ST(0) operand
- MI->setDesc(TII->get(getConcreteOpcode(MI->getOpcode())));
-
- if (MI->getOpcode() == X86::IST_FP64m ||
- MI->getOpcode() == X86::ISTT_FP16m ||
- MI->getOpcode() == X86::ISTT_FP32m ||
- MI->getOpcode() == X86::ISTT_FP64m ||
- MI->getOpcode() == X86::ST_FP80m) {
- assert(StackTop > 0 && "Stack empty??");
- --StackTop;
- } else if (KillsSrc) { // Last use of operand?
- popStackAfter(I);
- }
-}
-
-
-/// handleOneArgFPRW: Handle instructions that read from the top of stack and
-/// replace the value with a newly computed value. These instructions may have
-/// non-fp operands after their FP operands.
-///
-/// Examples:
-/// R1 = fchs R2
-/// R1 = fadd R2, [mem]
-///
-void FPS::handleOneArgFPRW(MachineBasicBlock::iterator &I) {
- MachineInstr *MI = I;
- unsigned NumOps = MI->getDesc().getNumOperands();
- assert(NumOps >= 2 && "FPRW instructions must have 2 ops!!");
-
- // Is this the last use of the source register?
- unsigned Reg = getFPReg(MI->getOperand(1));
- bool KillsSrc = MI->killsRegister(X86::FP0+Reg);
-
- if (KillsSrc) {
- // If this is the last use of the source register, just make sure it's on
- // the top of the stack.
- moveToTop(Reg, I);
- assert(StackTop > 0 && "Stack cannot be empty!");
- --StackTop;
- pushReg(getFPReg(MI->getOperand(0)));
- } else {
- // If this is not the last use of the source register, _copy_ it to the top
- // of the stack.
- duplicateToTop(Reg, getFPReg(MI->getOperand(0)), I);
- }
-
- // Change from the pseudo instruction to the concrete instruction.
- MI->RemoveOperand(1); // Drop the source operand.
- MI->RemoveOperand(0); // Drop the destination operand.
- MI->setDesc(TII->get(getConcreteOpcode(MI->getOpcode())));
-}
-
-
-//===----------------------------------------------------------------------===//
-// Define tables of various ways to map pseudo instructions
-//
-
-// ForwardST0Table - Map: A = B op C into: ST(0) = ST(0) op ST(i)
-static const TableEntry ForwardST0Table[] = {
- { X86::ADD_Fp32 , X86::ADD_FST0r },
- { X86::ADD_Fp64 , X86::ADD_FST0r },
- { X86::ADD_Fp80 , X86::ADD_FST0r },
- { X86::DIV_Fp32 , X86::DIV_FST0r },
- { X86::DIV_Fp64 , X86::DIV_FST0r },
- { X86::DIV_Fp80 , X86::DIV_FST0r },
- { X86::MUL_Fp32 , X86::MUL_FST0r },
- { X86::MUL_Fp64 , X86::MUL_FST0r },
- { X86::MUL_Fp80 , X86::MUL_FST0r },
- { X86::SUB_Fp32 , X86::SUB_FST0r },
- { X86::SUB_Fp64 , X86::SUB_FST0r },
- { X86::SUB_Fp80 , X86::SUB_FST0r },
-};
-
-// ReverseST0Table - Map: A = B op C into: ST(0) = ST(i) op ST(0)
-static const TableEntry ReverseST0Table[] = {
- { X86::ADD_Fp32 , X86::ADD_FST0r }, // commutative
- { X86::ADD_Fp64 , X86::ADD_FST0r }, // commutative
- { X86::ADD_Fp80 , X86::ADD_FST0r }, // commutative
- { X86::DIV_Fp32 , X86::DIVR_FST0r },
- { X86::DIV_Fp64 , X86::DIVR_FST0r },
- { X86::DIV_Fp80 , X86::DIVR_FST0r },
- { X86::MUL_Fp32 , X86::MUL_FST0r }, // commutative
- { X86::MUL_Fp64 , X86::MUL_FST0r }, // commutative
- { X86::MUL_Fp80 , X86::MUL_FST0r }, // commutative
- { X86::SUB_Fp32 , X86::SUBR_FST0r },
- { X86::SUB_Fp64 , X86::SUBR_FST0r },
- { X86::SUB_Fp80 , X86::SUBR_FST0r },
-};
-
-// ForwardSTiTable - Map: A = B op C into: ST(i) = ST(0) op ST(i)
-static const TableEntry ForwardSTiTable[] = {
- { X86::ADD_Fp32 , X86::ADD_FrST0 }, // commutative
- { X86::ADD_Fp64 , X86::ADD_FrST0 }, // commutative
- { X86::ADD_Fp80 , X86::ADD_FrST0 }, // commutative
- { X86::DIV_Fp32 , X86::DIVR_FrST0 },
- { X86::DIV_Fp64 , X86::DIVR_FrST0 },
- { X86::DIV_Fp80 , X86::DIVR_FrST0 },
- { X86::MUL_Fp32 , X86::MUL_FrST0 }, // commutative
- { X86::MUL_Fp64 , X86::MUL_FrST0 }, // commutative
- { X86::MUL_Fp80 , X86::MUL_FrST0 }, // commutative
- { X86::SUB_Fp32 , X86::SUBR_FrST0 },
- { X86::SUB_Fp64 , X86::SUBR_FrST0 },
- { X86::SUB_Fp80 , X86::SUBR_FrST0 },
-};
-
-// ReverseSTiTable - Map: A = B op C into: ST(i) = ST(i) op ST(0)
-static const TableEntry ReverseSTiTable[] = {
- { X86::ADD_Fp32 , X86::ADD_FrST0 },
- { X86::ADD_Fp64 , X86::ADD_FrST0 },
- { X86::ADD_Fp80 , X86::ADD_FrST0 },
- { X86::DIV_Fp32 , X86::DIV_FrST0 },
- { X86::DIV_Fp64 , X86::DIV_FrST0 },
- { X86::DIV_Fp80 , X86::DIV_FrST0 },
- { X86::MUL_Fp32 , X86::MUL_FrST0 },
- { X86::MUL_Fp64 , X86::MUL_FrST0 },
- { X86::MUL_Fp80 , X86::MUL_FrST0 },
- { X86::SUB_Fp32 , X86::SUB_FrST0 },
- { X86::SUB_Fp64 , X86::SUB_FrST0 },
- { X86::SUB_Fp80 , X86::SUB_FrST0 },
-};
-
-
-/// handleTwoArgFP - Handle instructions like FADD and friends which are virtual
-/// instructions which need to be simplified and possibly transformed.
-///
-/// Result: ST(0) = fsub ST(0), ST(i)
-/// ST(i) = fsub ST(0), ST(i)
-/// ST(0) = fsubr ST(0), ST(i)
-/// ST(i) = fsubr ST(0), ST(i)
-///
-void FPS::handleTwoArgFP(MachineBasicBlock::iterator &I) {
- ASSERT_SORTED(ForwardST0Table); ASSERT_SORTED(ReverseST0Table);
- ASSERT_SORTED(ForwardSTiTable); ASSERT_SORTED(ReverseSTiTable);
- MachineInstr *MI = I;
-
- unsigned NumOperands = MI->getDesc().getNumOperands();
- assert(NumOperands == 3 && "Illegal TwoArgFP instruction!");
- unsigned Dest = getFPReg(MI->getOperand(0));
- unsigned Op0 = getFPReg(MI->getOperand(NumOperands-2));
- unsigned Op1 = getFPReg(MI->getOperand(NumOperands-1));
- bool KillsOp0 = MI->killsRegister(X86::FP0+Op0);
- bool KillsOp1 = MI->killsRegister(X86::FP0+Op1);
-
- unsigned TOS = getStackEntry(0);
-
- // One of our operands must be on the top of the stack. If neither is yet, we
- // need to move one.
- if (Op0 != TOS && Op1 != TOS) { // No operand at TOS?
- // We can choose to move either operand to the top of the stack. If one of
- // the operands is killed by this instruction, we want that one so that we
- // can update right on top of the old version.
- if (KillsOp0) {
- moveToTop(Op0, I); // Move dead operand to TOS.
- TOS = Op0;
- } else if (KillsOp1) {
- moveToTop(Op1, I);
- TOS = Op1;
- } else {
- // All of the operands are live after this instruction executes, so we
- // cannot update on top of any operand. Because of this, we must
- // duplicate one of the stack elements to the top. It doesn't matter
- // which one we pick.
- //
- duplicateToTop(Op0, Dest, I);
- Op0 = TOS = Dest;
- KillsOp0 = true;
- }
- } else if (!KillsOp0 && !KillsOp1) {
- // If we DO have one of our operands at the top of the stack, but we don't
- // have a dead operand, we must duplicate one of the operands to a new slot
- // on the stack.
- duplicateToTop(Op0, Dest, I);
- Op0 = TOS = Dest;
- KillsOp0 = true;
- }
-
- // Now we know that one of our operands is on the top of the stack, and at
- // least one of our operands is killed by this instruction.
- assert((TOS == Op0 || TOS == Op1) && (KillsOp0 || KillsOp1) &&
- "Stack conditions not set up right!");
-
- // We decide which form to use based on what is on the top of the stack, and
- // which operand is killed by this instruction.
- const TableEntry *InstTable;
- bool isForward = TOS == Op0;
- bool updateST0 = (TOS == Op0 && !KillsOp1) || (TOS == Op1 && !KillsOp0);
- if (updateST0) {
- if (isForward)
- InstTable = ForwardST0Table;
- else
- InstTable = ReverseST0Table;
- } else {
- if (isForward)
- InstTable = ForwardSTiTable;
- else
- InstTable = ReverseSTiTable;
- }
-
- int Opcode = Lookup(InstTable, array_lengthof(ForwardST0Table),
- MI->getOpcode());
- assert(Opcode != -1 && "Unknown TwoArgFP pseudo instruction!");
-
- // NotTOS - The register which is not on the top of stack...
- unsigned NotTOS = (TOS == Op0) ? Op1 : Op0;
-
- // Replace the old instruction with a new instruction
- MBB->remove(I++);
- I = BuildMI(*MBB, I, TII->get(Opcode)).addReg(getSTReg(NotTOS));
-
- // If both operands are killed, pop one off of the stack in addition to
- // overwriting the other one.
- if (KillsOp0 && KillsOp1 && Op0 != Op1) {
- assert(!updateST0 && "Should have updated other operand!");
- popStackAfter(I); // Pop the top of stack
- }
-
- // Update stack information so that we know the destination register is now on
- // the stack.
- unsigned UpdatedSlot = getSlot(updateST0 ? TOS : NotTOS);
- assert(UpdatedSlot < StackTop && Dest < 7);
- Stack[UpdatedSlot] = Dest;
- RegMap[Dest] = UpdatedSlot;
- delete MI; // Remove the old instruction
-}
-
-/// handleCompareFP - Handle FUCOM and FUCOMI instructions, which have two FP
-/// register arguments and no explicit destinations.
-///
-void FPS::handleCompareFP(MachineBasicBlock::iterator &I) {
- ASSERT_SORTED(ForwardST0Table); ASSERT_SORTED(ReverseST0Table);
- ASSERT_SORTED(ForwardSTiTable); ASSERT_SORTED(ReverseSTiTable);
- MachineInstr *MI = I;
-
- unsigned NumOperands = MI->getDesc().getNumOperands();
- assert(NumOperands == 2 && "Illegal FUCOM* instruction!");
- unsigned Op0 = getFPReg(MI->getOperand(NumOperands-2));
- unsigned Op1 = getFPReg(MI->getOperand(NumOperands-1));
- bool KillsOp0 = MI->killsRegister(X86::FP0+Op0);
- bool KillsOp1 = MI->killsRegister(X86::FP0+Op1);
-
- // Make sure the first operand is on the top of stack, the other one can be
- // anywhere.
- moveToTop(Op0, I);
-
- // Change from the pseudo instruction to the concrete instruction.
- MI->getOperand(0).setReg(getSTReg(Op1));
- MI->RemoveOperand(1);
- MI->setDesc(TII->get(getConcreteOpcode(MI->getOpcode())));
-
- // If any of the operands are killed by this instruction, free them.
- if (KillsOp0) freeStackSlotAfter(I, Op0);
- if (KillsOp1 && Op0 != Op1) freeStackSlotAfter(I, Op1);
-}
-
-/// handleCondMovFP - Handle two address conditional move instructions. These
-/// instructions move a st(i) register to st(0) iff a condition is true. These
-/// instructions require that the first operand is at the top of the stack, but
-/// otherwise don't modify the stack at all.
-void FPS::handleCondMovFP(MachineBasicBlock::iterator &I) {
- MachineInstr *MI = I;
-
- unsigned Op0 = getFPReg(MI->getOperand(0));
- unsigned Op1 = getFPReg(MI->getOperand(2));
- bool KillsOp1 = MI->killsRegister(X86::FP0+Op1);
-
- // The first operand *must* be on the top of the stack.
- moveToTop(Op0, I);
-
- // Change the second operand to the stack register that the operand is in.
- // Change from the pseudo instruction to the concrete instruction.
- MI->RemoveOperand(0);
- MI->RemoveOperand(1);
- MI->getOperand(0).setReg(getSTReg(Op1));
- MI->setDesc(TII->get(getConcreteOpcode(MI->getOpcode())));
-
- // If we kill the second operand, make sure to pop it from the stack.
- if (Op0 != Op1 && KillsOp1) {
- // Get this value off of the register stack.
- freeStackSlotAfter(I, Op1);
- }
-}
-
-
-/// handleSpecialFP - Handle special instructions which behave unlike other
-/// floating point instructions. This is primarily intended for use by pseudo
-/// instructions.
-///
-void FPS::handleSpecialFP(MachineBasicBlock::iterator &I) {
- MachineInstr *MI = I;
- switch (MI->getOpcode()) {
- default: assert(0 && "Unknown SpecialFP instruction!");
- case X86::FpGET_ST0_32:// Appears immediately after a call returning FP type!
- case X86::FpGET_ST0_64:// Appears immediately after a call returning FP type!
- case X86::FpGET_ST0_80:// Appears immediately after a call returning FP type!
- assert(StackTop == 0 && "Stack should be empty after a call!");
- pushReg(getFPReg(MI->getOperand(0)));
- break;
- case X86::FpGET_ST1_32:// Appears immediately after a call returning FP type!
- case X86::FpGET_ST1_64:// Appears immediately after a call returning FP type!
- case X86::FpGET_ST1_80:{// Appears immediately after a call returning FP type!
- // FpGET_ST1 should occur right after a FpGET_ST0 for a call or inline asm.
- // The pattern we expect is:
- // CALL
- // FP1 = FpGET_ST0
- // FP4 = FpGET_ST1
- //
- // At this point, we've pushed FP1 on the top of stack, so it should be
- // present if it isn't dead. If it was dead, we already emitted a pop to
- // remove it from the stack and StackTop = 0.
-
- // Push FP4 as top of stack next.
- pushReg(getFPReg(MI->getOperand(0)));
-
- // If StackTop was 0 before we pushed our operand, then ST(0) must have been
- // dead. In this case, the ST(1) value is the only thing that is live, so
- // it should be on the TOS (after the pop that was emitted) and is. Just
- // continue in this case.
- if (StackTop == 1)
- break;
-
- // Because pushReg just pushed ST(1) as TOS, we now have to swap the two top
- // elements so that our accounting is correct.
- unsigned RegOnTop = getStackEntry(0);
- unsigned RegNo = getStackEntry(1);
-
- // Swap the slots the regs are in.
- std::swap(RegMap[RegNo], RegMap[RegOnTop]);
-
- // Swap stack slot contents.
- assert(RegMap[RegOnTop] < StackTop);
- std::swap(Stack[RegMap[RegOnTop]], Stack[StackTop-1]);
- break;
- }
- case X86::FpSET_ST0_32:
- case X86::FpSET_ST0_64:
- case X86::FpSET_ST0_80:
- assert(StackTop == 1 && "Stack should have one element on it to return!");
- --StackTop; // "Forget" we have something on the top of stack!
- break;
- case X86::MOV_Fp3232:
- case X86::MOV_Fp3264:
- case X86::MOV_Fp6432:
- case X86::MOV_Fp6464:
- case X86::MOV_Fp3280:
- case X86::MOV_Fp6480:
- case X86::MOV_Fp8032:
- case X86::MOV_Fp8064:
- case X86::MOV_Fp8080: {
- unsigned SrcReg = getFPReg(MI->getOperand(1));
- unsigned DestReg = getFPReg(MI->getOperand(0));
-
- if (MI->killsRegister(X86::FP0+SrcReg)) {
- // If the input operand is killed, we can just change the owner of the
- // incoming stack slot into the result.
- unsigned Slot = getSlot(SrcReg);
- assert(Slot < 7 && DestReg < 7 && "FpMOV operands invalid!");
- Stack[Slot] = DestReg;
- RegMap[DestReg] = Slot;
-
- } else {
- // For FMOV we just duplicate the specified value to a new stack slot.
- // This could be made better, but would require substantial changes.
- duplicateToTop(SrcReg, DestReg, I);
- }
- }
- break;
- case TargetInstrInfo::INLINEASM: {
- // The inline asm MachineInstr currently only *uses* FP registers for the
- // 'f' constraint. These should be turned into the current ST(x) register
- // in the machine instr. Also, any kills should be explicitly popped after
- // the inline asm.
- unsigned Kills[7];
- unsigned NumKills = 0;
- for (unsigned i = 0, e = MI->getNumOperands(); i != e; ++i) {
- MachineOperand &Op = MI->getOperand(i);
- if (!Op.isReg() || Op.getReg() < X86::FP0 || Op.getReg() > X86::FP6)
- continue;
- assert(Op.isUse() && "Only handle inline asm uses right now");
-
- unsigned FPReg = getFPReg(Op);
- Op.setReg(getSTReg(FPReg));
-
- // If we kill this operand, make sure to pop it from the stack after the
- // asm. We just remember it for now, and pop them all off at the end in
- // a batch.
- if (Op.isKill())
- Kills[NumKills++] = FPReg;
- }
-
- // If this asm kills any FP registers (is the last use of them) we must
- // explicitly emit pop instructions for them. Do this now after the asm has
- // executed so that the ST(x) numbers are not off (which would happen if we
- // did this inline with operand rewriting).
- //
- // Note: this might be a non-optimal pop sequence. We might be able to do
- // better by trying to pop in stack order or something.
- MachineBasicBlock::iterator InsertPt = MI;
- while (NumKills)
- freeStackSlotAfter(InsertPt, Kills[--NumKills]);
-
- // Don't delete the inline asm!
- return;
- }
-
- case X86::RET:
- case X86::RETI:
- // If RET has an FP register use operand, pass the first one in ST(0) and
- // the second one in ST(1).
- if (isStackEmpty()) return; // Quick check to see if any are possible.
-
- // Find the register operands.
- unsigned FirstFPRegOp = ~0U, SecondFPRegOp = ~0U;
-
- for (unsigned i = 0, e = MI->getNumOperands(); i != e; ++i) {
- MachineOperand &Op = MI->getOperand(i);
- if (!Op.isReg() || Op.getReg() < X86::FP0 || Op.getReg() > X86::FP6)
- continue;
- // FP Register uses must be kills unless there are two uses of the same
- // register, in which case only one will be a kill.
- assert(Op.isUse() &&
- (Op.isKill() || // Marked kill.
- getFPReg(Op) == FirstFPRegOp || // Second instance.
- MI->killsRegister(Op.getReg())) && // Later use is marked kill.
- "Ret only defs operands, and values aren't live beyond it");
-
- if (FirstFPRegOp == ~0U)
- FirstFPRegOp = getFPReg(Op);
- else {
- assert(SecondFPRegOp == ~0U && "More than two fp operands!");
- SecondFPRegOp = getFPReg(Op);
- }
-
- // Remove the operand so that later passes don't see it.
- MI->RemoveOperand(i);
- --i, --e;
- }
-
- // There are only four possibilities here:
- // 1) we are returning a single FP value. In this case, it has to be in
- // ST(0) already, so just declare success by removing the value from the
- // FP Stack.
- if (SecondFPRegOp == ~0U) {
- // Assert that the top of stack contains the right FP register.
- assert(StackTop == 1 && FirstFPRegOp == getStackEntry(0) &&
- "Top of stack not the right register for RET!");
-
- // Ok, everything is good, mark the value as not being on the stack
- // anymore so that our assertion about the stack being empty at end of
- // block doesn't fire.
- StackTop = 0;
- return;
- }
-
- // Otherwise, we are returning two values:
- // 2) If returning the same value for both, we only have one thing in the FP
- // stack. Consider: RET FP1, FP1
- if (StackTop == 1) {
- assert(FirstFPRegOp == SecondFPRegOp && FirstFPRegOp == getStackEntry(0)&&
- "Stack misconfiguration for RET!");
-
- // Duplicate the TOS so that we return it twice. Just pick some other FPx
- // register to hold it.
- unsigned NewReg = (FirstFPRegOp+1)%7;
- duplicateToTop(FirstFPRegOp, NewReg, MI);
- FirstFPRegOp = NewReg;
- }
-
- /// Okay we know we have two different FPx operands now:
- assert(StackTop == 2 && "Must have two values live!");
-
- /// 3) If SecondFPRegOp is currently in ST(0) and FirstFPRegOp is currently
- /// in ST(1). In this case, emit an fxch.
- if (getStackEntry(0) == SecondFPRegOp) {
- assert(getStackEntry(1) == FirstFPRegOp && "Unknown regs live");
- moveToTop(FirstFPRegOp, MI);
- }
-
- /// 4) Finally, FirstFPRegOp must be in ST(0) and SecondFPRegOp must be in
- /// ST(1). Just remove both from our understanding of the stack and return.
- assert(getStackEntry(0) == FirstFPRegOp && "Unknown regs live");
- assert(getStackEntry(1) == SecondFPRegOp && "Unknown regs live");
- StackTop = 0;
- return;
- }
-
- I = MBB->erase(I); // Remove the pseudo instruction
- --I;
-}
diff --git a/release_23/lib/Target/X86/X86ISelDAGToDAG.cpp b/release_23/lib/Target/X86/X86ISelDAGToDAG.cpp
deleted file mode 100644
index c92e76973852..000000000000
--- a/release_23/lib/Target/X86/X86ISelDAGToDAG.cpp
+++ /dev/null
@@ -1,1643 +0,0 @@
-//===- X86ISelDAGToDAG.cpp - A DAG pattern matching inst selector for X86 -===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines a DAG pattern matching instruction selector for X86,
-// converting from a legalized dag to a X86 dag.
-//
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "x86-isel"
-#include "X86.h"
-#include "X86InstrBuilder.h"
-#include "X86ISelLowering.h"
-#include "X86MachineFunctionInfo.h"
-#include "X86RegisterInfo.h"
-#include "X86Subtarget.h"
-#include "X86TargetMachine.h"
-#include "llvm/GlobalValue.h"
-#include "llvm/Instructions.h"
-#include "llvm/Intrinsics.h"
-#include "llvm/Support/CFG.h"
-#include "llvm/Type.h"
-#include "llvm/CodeGen/MachineConstantPool.h"
-#include "llvm/CodeGen/MachineFunction.h"
-#include "llvm/CodeGen/MachineFrameInfo.h"
-#include "llvm/CodeGen/MachineInstrBuilder.h"
-#include "llvm/CodeGen/MachineRegisterInfo.h"
-#include "llvm/CodeGen/SelectionDAGISel.h"
-#include "llvm/Target/TargetMachine.h"
-#include "llvm/Support/CommandLine.h"
-#include "llvm/Support/Compiler.h"
-#include "llvm/Support/Debug.h"
-#include "llvm/Support/MathExtras.h"
-#include "llvm/ADT/SmallPtrSet.h"
-#include "llvm/ADT/Statistic.h"
-#include <queue>
-#include <set>
-using namespace llvm;
-
-STATISTIC(NumFPKill , "Number of FP_REG_KILL instructions added");
-STATISTIC(NumLoadMoved, "Number of loads moved below TokenFactor");
-
-//===----------------------------------------------------------------------===//
-// Pattern Matcher Implementation
-//===----------------------------------------------------------------------===//
-
-namespace {
- /// X86ISelAddressMode - This corresponds to X86AddressMode, but uses
- /// SDOperand's instead of register numbers for the leaves of the matched
- /// tree.
- struct X86ISelAddressMode {
- enum {
- RegBase,
- FrameIndexBase
- } BaseType;
-
- struct { // This is really a union, discriminated by BaseType!
- SDOperand Reg;
- int FrameIndex;
- } Base;
-
- bool isRIPRel; // RIP as base?
- unsigned Scale;
- SDOperand IndexReg;
- unsigned Disp;
- GlobalValue *GV;
- Constant *CP;
- const char *ES;
- int JT;
- unsigned Align; // CP alignment.
-
- X86ISelAddressMode()
- : BaseType(RegBase), isRIPRel(false), Scale(1), IndexReg(), Disp(0),
- GV(0), CP(0), ES(0), JT(-1), Align(0) {
- }
- };
-}
-
-namespace {
- //===--------------------------------------------------------------------===//
- /// ISel - X86 specific code to select X86 machine instructions for
- /// SelectionDAG operations.
- ///
- class VISIBILITY_HIDDEN X86DAGToDAGISel : public SelectionDAGISel {
- /// ContainsFPCode - Every instruction we select that uses or defines a FP
- /// register should set this to true.
- bool ContainsFPCode;
-
- /// FastISel - Enable fast(er) instruction selection.
- ///
- bool FastISel;
-
- /// TM - Keep a reference to X86TargetMachine.
- ///
- X86TargetMachine &TM;
-
- /// X86Lowering - This object fully describes how to lower LLVM code to an
- /// X86-specific SelectionDAG.
- X86TargetLowering X86Lowering;
-
- /// Subtarget - Keep a pointer to the X86Subtarget around so that we can
- /// make the right decision when generating code for different targets.
- const X86Subtarget *Subtarget;
-
- /// GlobalBaseReg - keeps track of the virtual register mapped onto global
- /// base register.
- unsigned GlobalBaseReg;
-
- public:
- X86DAGToDAGISel(X86TargetMachine &tm, bool fast)
- : SelectionDAGISel(X86Lowering),
- ContainsFPCode(false), FastISel(fast), TM(tm),
- X86Lowering(*TM.getTargetLowering()),
- Subtarget(&TM.getSubtarget<X86Subtarget>()) {}
-
- virtual bool runOnFunction(Function &Fn) {
- // Make sure we re-emit a set of the global base reg if necessary
- GlobalBaseReg = 0;
- return SelectionDAGISel::runOnFunction(Fn);
- }
-
- virtual const char *getPassName() const {
- return "X86 DAG->DAG Instruction Selection";
- }
-
- /// InstructionSelectBasicBlock - This callback is invoked by
- /// SelectionDAGISel when it has created a SelectionDAG for us to codegen.
- virtual void InstructionSelectBasicBlock(SelectionDAG &DAG);
-
- virtual void EmitFunctionEntryCode(Function &Fn, MachineFunction &MF);
-
- virtual bool CanBeFoldedBy(SDNode *N, SDNode *U, SDNode *Root) const;
-
-// Include the pieces autogenerated from the target description.
-#include "X86GenDAGISel.inc"
-
- private:
- SDNode *Select(SDOperand N);
-
- bool MatchAddress(SDOperand N, X86ISelAddressMode &AM,
- bool isRoot = true, unsigned Depth = 0);
- bool MatchAddressBase(SDOperand N, X86ISelAddressMode &AM,
- bool isRoot, unsigned Depth);
- bool SelectAddr(SDOperand Op, SDOperand N, SDOperand &Base,
- SDOperand &Scale, SDOperand &Index, SDOperand &Disp);
- bool SelectLEAAddr(SDOperand Op, SDOperand N, SDOperand &Base,
- SDOperand &Scale, SDOperand &Index, SDOperand &Disp);
- bool SelectScalarSSELoad(SDOperand Op, SDOperand Pred,
- SDOperand N, SDOperand &Base, SDOperand &Scale,
- SDOperand &Index, SDOperand &Disp,
- SDOperand &InChain, SDOperand &OutChain);
- bool TryFoldLoad(SDOperand P, SDOperand N,
- SDOperand &Base, SDOperand &Scale,
- SDOperand &Index, SDOperand &Disp);
- void PreprocessForRMW(SelectionDAG &DAG);
- void PreprocessForFPConvert(SelectionDAG &DAG);
-
- /// SelectInlineAsmMemoryOperand - Implement addressing mode selection for
- /// inline asm expressions.
- virtual bool SelectInlineAsmMemoryOperand(const SDOperand &Op,
- char ConstraintCode,
- std::vector<SDOperand> &OutOps,
- SelectionDAG &DAG);
-
- void EmitSpecialCodeForMain(MachineBasicBlock *BB, MachineFrameInfo *MFI);
-
- inline void getAddressOperands(X86ISelAddressMode &AM, SDOperand &Base,
- SDOperand &Scale, SDOperand &Index,
- SDOperand &Disp) {
- Base = (AM.BaseType == X86ISelAddressMode::FrameIndexBase) ?
- CurDAG->getTargetFrameIndex(AM.Base.FrameIndex, TLI.getPointerTy()) :
- AM.Base.Reg;
- Scale = getI8Imm(AM.Scale);
- Index = AM.IndexReg;
- // These are 32-bit even in 64-bit mode since RIP relative offset
- // is 32-bit.
- if (AM.GV)
- Disp = CurDAG->getTargetGlobalAddress(AM.GV, MVT::i32, AM.Disp);
- else if (AM.CP)
- Disp = CurDAG->getTargetConstantPool(AM.CP, MVT::i32, AM.Align, AM.Disp);
- else if (AM.ES)
- Disp = CurDAG->getTargetExternalSymbol(AM.ES, MVT::i32);
- else if (AM.JT != -1)
- Disp = CurDAG->getTargetJumpTable(AM.JT, MVT::i32);
- else
- Disp = getI32Imm(AM.Disp);
- }
-
- /// getI8Imm - Return a target constant with the specified value, of type
- /// i8.
- inline SDOperand getI8Imm(unsigned Imm) {
- return CurDAG->getTargetConstant(Imm, MVT::i8);
- }
-
- /// getI16Imm - Return a target constant with the specified value, of type
- /// i16.
- inline SDOperand getI16Imm(unsigned Imm) {
- return CurDAG->getTargetConstant(Imm, MVT::i16);
- }
-
- /// getI32Imm - Return a target constant with the specified value, of type
- /// i32.
- inline SDOperand getI32Imm(unsigned Imm) {
- return CurDAG->getTargetConstant(Imm, MVT::i32);
- }
-
- /// getGlobalBaseReg - insert code into the entry mbb to materialize the PIC
- /// base register. Return the virtual register that holds this value.
- SDNode *getGlobalBaseReg();
-
- /// getTruncate - return an SDNode that implements a subreg based truncate
- /// of the specified operand to the the specified value type.
- SDNode *getTruncate(SDOperand N0, MVT::ValueType VT);
-
-#ifndef NDEBUG
- unsigned Indent;
-#endif
- };
-}
-
-/// findFlagUse - Return use of MVT::Flag value produced by the specified SDNode.
-///
-static SDNode *findFlagUse(SDNode *N) {
- unsigned FlagResNo = N->getNumValues()-1;
- for (SDNode::use_iterator I = N->use_begin(), E = N->use_end(); I != E; ++I) {
- SDNode *User = I->getUser();
- for (unsigned i = 0, e = User->getNumOperands(); i != e; ++i) {
- SDOperand Op = User->getOperand(i);
- if (Op.Val == N && Op.ResNo == FlagResNo)
- return User;
- }
- }
- return NULL;
-}
-
-/// findNonImmUse - Return true by reference in "found" if "Use" is an
-/// non-immediate use of "Def". This function recursively traversing
-/// up the operand chain ignoring certain nodes.
-static void findNonImmUse(SDNode *Use, SDNode* Def, SDNode *ImmedUse,
- SDNode *Root, SDNode *Skip, bool &found,
- SmallPtrSet<SDNode*, 16> &Visited) {
- if (found ||
- Use->getNodeId() > Def->getNodeId() ||
- !Visited.insert(Use))
- return;
-
- for (unsigned i = 0, e = Use->getNumOperands(); !found && i != e; ++i) {
- SDNode *N = Use->getOperand(i).Val;
- if (N == Skip)
- continue;
- if (N == Def) {
- if (Use == ImmedUse)
- continue; // We are not looking for immediate use.
- if (Use == Root) {
- // Must be a chain reading node where it is possible to reach its own
- // chain operand through a path started from another operand.
- assert(Use->getOpcode() == ISD::STORE ||
- Use->getOpcode() == X86ISD::CMP ||
- Use->getOpcode() == ISD::INTRINSIC_W_CHAIN ||
- Use->getOpcode() == ISD::INTRINSIC_VOID);
- continue;
- }
- found = true;
- break;
- }
-
- // Traverse up the operand chain.
- findNonImmUse(N, Def, ImmedUse, Root, Skip, found, Visited);
- }
-}
-
-/// isNonImmUse - Start searching from Root up the DAG to check is Def can
-/// be reached. Return true if that's the case. However, ignore direct uses
-/// by ImmedUse (which would be U in the example illustrated in
-/// CanBeFoldedBy) and by Root (which can happen in the store case).
-/// FIXME: to be really generic, we should allow direct use by any node
-/// that is being folded. But realisticly since we only fold loads which
-/// have one non-chain use, we only need to watch out for load/op/store
-/// and load/op/cmp case where the root (store / cmp) may reach the load via
-/// its chain operand.
-static inline bool isNonImmUse(SDNode *Root, SDNode *Def, SDNode *ImmedUse,
- SDNode *Skip = NULL) {
- SmallPtrSet<SDNode*, 16> Visited;
- bool found = false;
- findNonImmUse(Root, Def, ImmedUse, Root, Skip, found, Visited);
- return found;
-}
-
-
-bool X86DAGToDAGISel::CanBeFoldedBy(SDNode *N, SDNode *U, SDNode *Root) const {
- if (FastISel) return false;
-
- // If U use can somehow reach N through another path then U can't fold N or
- // it will create a cycle. e.g. In the following diagram, U can reach N
- // through X. If N is folded into into U, then X is both a predecessor and
- // a successor of U.
- //
- // [ N ]
- // ^ ^
- // | |
- // / \---
- // / [X]
- // | ^
- // [U]--------|
-
- if (isNonImmUse(Root, N, U))
- return false;
-
- // If U produces a flag, then it gets (even more) interesting. Since it
- // would have been "glued" together with its flag use, we need to check if
- // it might reach N:
- //
- // [ N ]
- // ^ ^
- // | |
- // [U] \--
- // ^ [TF]
- // | ^
- // | |
- // \ /
- // [FU]
- //
- // If FU (flag use) indirectly reach N (the load), and U fold N (call it
- // NU), then TF is a predecessor of FU and a successor of NU. But since
- // NU and FU are flagged together, this effectively creates a cycle.
- bool HasFlagUse = false;
- MVT::ValueType VT = Root->getValueType(Root->getNumValues()-1);
- while ((VT == MVT::Flag && !Root->use_empty())) {
- SDNode *FU = findFlagUse(Root);
- if (FU == NULL)
- break;
- else {
- Root = FU;
- HasFlagUse = true;
- }
- VT = Root->getValueType(Root->getNumValues()-1);
- }
-
- if (HasFlagUse)
- return !isNonImmUse(Root, N, Root, U);
- return true;
-}
-
-/// MoveBelowTokenFactor - Replace TokenFactor operand with load's chain operand
-/// and move load below the TokenFactor. Replace store's chain operand with
-/// load's chain result.
-static void MoveBelowTokenFactor(SelectionDAG &DAG, SDOperand Load,
- SDOperand Store, SDOperand TF) {
- std::vector<SDOperand> Ops;
- for (unsigned i = 0, e = TF.Val->getNumOperands(); i != e; ++i)
- if (Load.Val == TF.Val->getOperand(i).Val)
- Ops.push_back(Load.Val->getOperand(0));
- else
- Ops.push_back(TF.Val->getOperand(i));
- DAG.UpdateNodeOperands(TF, &Ops[0], Ops.size());
- DAG.UpdateNodeOperands(Load, TF, Load.getOperand(1), Load.getOperand(2));
- DAG.UpdateNodeOperands(Store, Load.getValue(1), Store.getOperand(1),
- Store.getOperand(2), Store.getOperand(3));
-}
-
-/// PreprocessForRMW - Preprocess the DAG to make instruction selection better.
-/// This is only run if not in -fast mode (aka -O0).
-/// This allows the instruction selector to pick more read-modify-write
-/// instructions. This is a common case:
-///
-/// [Load chain]
-/// ^
-/// |
-/// [Load]
-/// ^ ^
-/// | |
-/// / \-
-/// / |
-/// [TokenFactor] [Op]
-/// ^ ^
-/// | |
-/// \ /
-/// \ /
-/// [Store]
-///
-/// The fact the store's chain operand != load's chain will prevent the
-/// (store (op (load))) instruction from being selected. We can transform it to:
-///
-/// [Load chain]
-/// ^
-/// |
-/// [TokenFactor]
-/// ^
-/// |
-/// [Load]
-/// ^ ^
-/// | |
-/// | \-
-/// | |
-/// | [Op]
-/// | ^
-/// | |
-/// \ /
-/// \ /
-/// [Store]
-void X86DAGToDAGISel::PreprocessForRMW(SelectionDAG &DAG) {
- for (SelectionDAG::allnodes_iterator I = DAG.allnodes_begin(),
- E = DAG.allnodes_end(); I != E; ++I) {
- if (!ISD::isNON_TRUNCStore(I))
- continue;
- SDOperand Chain = I->getOperand(0);
- if (Chain.Val->getOpcode() != ISD::TokenFactor)
- continue;
-
- SDOperand N1 = I->getOperand(1);
- SDOperand N2 = I->getOperand(2);
- if (MVT::isFloatingPoint(N1.getValueType()) ||
- MVT::isVector(N1.getValueType()) ||
- !N1.hasOneUse())
- continue;
-
- bool RModW = false;
- SDOperand Load;
- unsigned Opcode = N1.Val->getOpcode();
- switch (Opcode) {
- case ISD::ADD:
- case ISD::MUL:
- case ISD::AND:
- case ISD::OR:
- case ISD::XOR:
- case ISD::ADDC:
- case ISD::ADDE: {
- SDOperand N10 = N1.getOperand(0);
- SDOperand N11 = N1.getOperand(1);
- if (ISD::isNON_EXTLoad(N10.Val))
- RModW = true;
- else if (ISD::isNON_EXTLoad(N11.Val)) {
- RModW = true;
- std::swap(N10, N11);
- }
- RModW = RModW && N10.Val->isOperandOf(Chain.Val) && N10.hasOneUse() &&
- (N10.getOperand(1) == N2) &&
- (N10.Val->getValueType(0) == N1.getValueType());
- if (RModW)
- Load = N10;
- break;
- }
- case ISD::SUB:
- case ISD::SHL:
- case ISD::SRA:
- case ISD::SRL:
- case ISD::ROTL:
- case ISD::ROTR:
- case ISD::SUBC:
- case ISD::SUBE:
- case X86ISD::SHLD:
- case X86ISD::SHRD: {
- SDOperand N10 = N1.getOperand(0);
- if (ISD::isNON_EXTLoad(N10.Val))
- RModW = N10.Val->isOperandOf(Chain.Val) && N10.hasOneUse() &&
- (N10.getOperand(1) == N2) &&
- (N10.Val->getValueType(0) == N1.getValueType());
- if (RModW)
- Load = N10;
- break;
- }
- }
-
- if (RModW) {
- MoveBelowTokenFactor(DAG, Load, SDOperand(I, 0), Chain);
- ++NumLoadMoved;
- }
- }
-}
-
-
-/// PreprocessForFPConvert - Walk over the dag lowering fpround and fpextend
-/// nodes that target the FP stack to be store and load to the stack. This is a
-/// gross hack. We would like to simply mark these as being illegal, but when
-/// we do that, legalize produces these when it expands calls, then expands
-/// these in the same legalize pass. We would like dag combine to be able to
-/// hack on these between the call expansion and the node legalization. As such
-/// this pass basically does "really late" legalization of these inline with the
-/// X86 isel pass.
-void X86DAGToDAGISel::PreprocessForFPConvert(SelectionDAG &DAG) {
- for (SelectionDAG::allnodes_iterator I = DAG.allnodes_begin(),
- E = DAG.allnodes_end(); I != E; ) {
- SDNode *N = I++; // Preincrement iterator to avoid invalidation issues.
- if (N->getOpcode() != ISD::FP_ROUND && N->getOpcode() != ISD::FP_EXTEND)
- continue;
-
- // If the source and destination are SSE registers, then this is a legal
- // conversion that should not be lowered.
- MVT::ValueType SrcVT = N->getOperand(0).getValueType();
- MVT::ValueType DstVT = N->getValueType(0);
- bool SrcIsSSE = X86Lowering.isScalarFPTypeInSSEReg(SrcVT);
- bool DstIsSSE = X86Lowering.isScalarFPTypeInSSEReg(DstVT);
- if (SrcIsSSE && DstIsSSE)
- continue;
-
- if (!SrcIsSSE && !DstIsSSE) {
- // If this is an FPStack extension, it is a noop.
- if (N->getOpcode() == ISD::FP_EXTEND)
- continue;
- // If this is a value-preserving FPStack truncation, it is a noop.
- if (N->getConstantOperandVal(1))
- continue;
- }
-
- // Here we could have an FP stack truncation or an FPStack <-> SSE convert.
- // FPStack has extload and truncstore. SSE can fold direct loads into other
- // operations. Based on this, decide what we want to do.
- MVT::ValueType MemVT;
- if (N->getOpcode() == ISD::FP_ROUND)
- MemVT = DstVT; // FP_ROUND must use DstVT, we can't do a 'trunc load'.
- else
- MemVT = SrcIsSSE ? SrcVT : DstVT;
-
- SDOperand MemTmp = DAG.CreateStackTemporary(MemVT);
-
- // FIXME: optimize the case where the src/dest is a load or store?
- SDOperand Store = DAG.getTruncStore(DAG.getEntryNode(), N->getOperand(0),
- MemTmp, NULL, 0, MemVT);
- SDOperand Result = DAG.getExtLoad(ISD::EXTLOAD, DstVT, Store, MemTmp,
- NULL, 0, MemVT);
-
- // We're about to replace all uses of the FP_ROUND/FP_EXTEND with the
- // extload we created. This will cause general havok on the dag because
- // anything below the conversion could be folded into other existing nodes.
- // To avoid invalidating 'I', back it up to the convert node.
- --I;
- DAG.ReplaceAllUsesOfValueWith(SDOperand(N, 0), Result);
-
- // Now that we did that, the node is dead. Increment the iterator to the
- // next node to process, then delete N.
- ++I;
- DAG.DeleteNode(N);
- }
-}
-
-/// InstructionSelectBasicBlock - This callback is invoked by SelectionDAGISel
-/// when it has created a SelectionDAG for us to codegen.
-void X86DAGToDAGISel::InstructionSelectBasicBlock(SelectionDAG &DAG) {
- DEBUG(BB->dump());
- MachineFunction::iterator FirstMBB = BB;
-
- if (!FastISel)
- PreprocessForRMW(DAG);
-
- // FIXME: This should only happen when not -fast.
- PreprocessForFPConvert(DAG);
-
- // Codegen the basic block.
-#ifndef NDEBUG
- DOUT << "===== Instruction selection begins:\n";
- Indent = 0;
-#endif
- DAG.setRoot(SelectRoot(DAG.getRoot()));
-#ifndef NDEBUG
- DOUT << "===== Instruction selection ends:\n";
-#endif
-
- DAG.RemoveDeadNodes();
-
- // Emit machine code to BB. This can change 'BB' to the last block being
- // inserted into.
- ScheduleAndEmitDAG(DAG);
-
- // If we are emitting FP stack code, scan the basic block to determine if this
- // block defines any FP values. If so, put an FP_REG_KILL instruction before
- // the terminator of the block.
-
- // Note that FP stack instructions are used in all modes for long double,
- // so we always need to do this check.
- // Also note that it's possible for an FP stack register to be live across
- // an instruction that produces multiple basic blocks (SSE CMOV) so we
- // must check all the generated basic blocks.
-
- // Scan all of the machine instructions in these MBBs, checking for FP
- // stores. (RFP32 and RFP64 will not exist in SSE mode, but RFP80 might.)
- MachineFunction::iterator MBBI = FirstMBB;
- MachineFunction::iterator EndMBB = BB; ++EndMBB;
- for (; MBBI != EndMBB; ++MBBI) {
- MachineBasicBlock *MBB = MBBI;
-
- // If this block returns, ignore it. We don't want to insert an FP_REG_KILL
- // before the return.
- if (!MBB->empty()) {
- MachineBasicBlock::iterator EndI = MBB->end();
- --EndI;
- if (EndI->getDesc().isReturn())
- continue;
- }
-
- bool ContainsFPCode = false;
- for (MachineBasicBlock::iterator I = MBB->begin(), E = MBB->end();
- !ContainsFPCode && I != E; ++I) {
- if (I->getNumOperands() != 0 && I->getOperand(0).isRegister()) {
- const TargetRegisterClass *clas;
- for (unsigned op = 0, e = I->getNumOperands(); op != e; ++op) {
- if (I->getOperand(op).isRegister() && I->getOperand(op).isDef() &&
- TargetRegisterInfo::isVirtualRegister(I->getOperand(op).getReg()) &&
- ((clas = RegInfo->getRegClass(I->getOperand(0).getReg())) ==
- X86::RFP32RegisterClass ||
- clas == X86::RFP64RegisterClass ||
- clas == X86::RFP80RegisterClass)) {
- ContainsFPCode = true;
- break;
- }
- }
- }
- }
- // Check PHI nodes in successor blocks. These PHI's will be lowered to have
- // a copy of the input value in this block. In SSE mode, we only care about
- // 80-bit values.
- if (!ContainsFPCode) {
- // Final check, check LLVM BB's that are successors to the LLVM BB
- // corresponding to BB for FP PHI nodes.
- const BasicBlock *LLVMBB = BB->getBasicBlock();
- const PHINode *PN;
- for (succ_const_iterator SI = succ_begin(LLVMBB), E = succ_end(LLVMBB);
- !ContainsFPCode && SI != E; ++SI) {
- for (BasicBlock::const_iterator II = SI->begin();
- (PN = dyn_cast<PHINode>(II)); ++II) {
- if (PN->getType()==Type::X86_FP80Ty ||
- (!Subtarget->hasSSE1() && PN->getType()->isFloatingPoint()) ||
- (!Subtarget->hasSSE2() && PN->getType()==Type::DoubleTy)) {
- ContainsFPCode = true;
- break;
- }
- }
- }
- }
- // Finally, if we found any FP code, emit the FP_REG_KILL instruction.
- if (ContainsFPCode) {
- BuildMI(*MBB, MBBI->getFirstTerminator(),
- TM.getInstrInfo()->get(X86::FP_REG_KILL));
- ++NumFPKill;
- }
- }
-}
-
-/// EmitSpecialCodeForMain - Emit any code that needs to be executed only in
-/// the main function.
-void X86DAGToDAGISel::EmitSpecialCodeForMain(MachineBasicBlock *BB,
- MachineFrameInfo *MFI) {
- const TargetInstrInfo *TII = TM.getInstrInfo();
- if (Subtarget->isTargetCygMing())
- BuildMI(BB, TII->get(X86::CALLpcrel32)).addExternalSymbol("__main");
-}
-
-void X86DAGToDAGISel::EmitFunctionEntryCode(Function &Fn, MachineFunction &MF) {
- // If this is main, emit special code for main.
- MachineBasicBlock *BB = MF.begin();
- if (Fn.hasExternalLinkage() && Fn.getName() == "main")
- EmitSpecialCodeForMain(BB, MF.getFrameInfo());
-}
-
-/// MatchAddress - Add the specified node to the specified addressing mode,
-/// returning true if it cannot be done. This just pattern matches for the
-/// addressing mode.
-bool X86DAGToDAGISel::MatchAddress(SDOperand N, X86ISelAddressMode &AM,
- bool isRoot, unsigned Depth) {
- // Limit recursion.
- if (Depth > 5)
- return MatchAddressBase(N, AM, isRoot, Depth);
-
- // RIP relative addressing: %rip + 32-bit displacement!
- if (AM.isRIPRel) {
- if (!AM.ES && AM.JT != -1 && N.getOpcode() == ISD::Constant) {
- int64_t Val = cast<ConstantSDNode>(N)->getSignExtended();
- if (isInt32(AM.Disp + Val)) {
- AM.Disp += Val;
- return false;
- }
- }
- return true;
- }
-
- int id = N.Val->getNodeId();
- bool AlreadySelected = isSelected(id); // Already selected, not yet replaced.
-
- switch (N.getOpcode()) {
- default: break;
- case ISD::Constant: {
- int64_t Val = cast<ConstantSDNode>(N)->getSignExtended();
- if (isInt32(AM.Disp + Val)) {
- AM.Disp += Val;
- return false;
- }
- break;
- }
-
- case X86ISD::Wrapper: {
- bool is64Bit = Subtarget->is64Bit();
- // Under X86-64 non-small code model, GV (and friends) are 64-bits.
- // Also, base and index reg must be 0 in order to use rip as base.
- if (is64Bit && (TM.getCodeModel() != CodeModel::Small ||
- AM.Base.Reg.Val || AM.IndexReg.Val))
- break;
- if (AM.GV != 0 || AM.CP != 0 || AM.ES != 0 || AM.JT != -1)
- break;
- // If value is available in a register both base and index components have
- // been picked, we can't fit the result available in the register in the
- // addressing mode. Duplicate GlobalAddress or ConstantPool as displacement.
- if (!AlreadySelected || (AM.Base.Reg.Val && AM.IndexReg.Val)) {
- SDOperand N0 = N.getOperand(0);
- if (GlobalAddressSDNode *G = dyn_cast<GlobalAddressSDNode>(N0)) {
- GlobalValue *GV = G->getGlobal();
- AM.GV = GV;
- AM.Disp += G->getOffset();
- AM.isRIPRel = TM.getRelocationModel() != Reloc::Static &&
- Subtarget->isPICStyleRIPRel();
- return false;
- } else if (ConstantPoolSDNode *CP = dyn_cast<ConstantPoolSDNode>(N0)) {
- AM.CP = CP->getConstVal();
- AM.Align = CP->getAlignment();
- AM.Disp += CP->getOffset();
- AM.isRIPRel = TM.getRelocationModel() != Reloc::Static &&
- Subtarget->isPICStyleRIPRel();
- return false;
- } else if (ExternalSymbolSDNode *S =dyn_cast<ExternalSymbolSDNode>(N0)) {
- AM.ES = S->getSymbol();
- AM.isRIPRel = TM.getRelocationModel() != Reloc::Static &&
- Subtarget->isPICStyleRIPRel();
- return false;
- } else if (JumpTableSDNode *J = dyn_cast<JumpTableSDNode>(N0)) {
- AM.JT = J->getIndex();
- AM.isRIPRel = TM.getRelocationModel() != Reloc::Static &&
- Subtarget->isPICStyleRIPRel();
- return false;
- }
- }
- break;
- }
-
- case ISD::FrameIndex:
- if (AM.BaseType == X86ISelAddressMode::RegBase && AM.Base.Reg.Val == 0) {
- AM.BaseType = X86ISelAddressMode::FrameIndexBase;
- AM.Base.FrameIndex = cast<FrameIndexSDNode>(N)->getIndex();
- return false;
- }
- break;
-
- case ISD::SHL:
- if (AlreadySelected || AM.IndexReg.Val != 0 || AM.Scale != 1 || AM.isRIPRel)
- break;
-
- if (ConstantSDNode *CN = dyn_cast<ConstantSDNode>(N.Val->getOperand(1))) {
- unsigned Val = CN->getValue();
- if (Val == 1 || Val == 2 || Val == 3) {
- AM.Scale = 1 << Val;
- SDOperand ShVal = N.Val->getOperand(0);
-
- // Okay, we know that we have a scale by now. However, if the scaled
- // value is an add of something and a constant, we can fold the
- // constant into the disp field here.
- if (ShVal.Val->getOpcode() == ISD::ADD && ShVal.hasOneUse() &&
- isa<ConstantSDNode>(ShVal.Val->getOperand(1))) {
- AM.IndexReg = ShVal.Val->getOperand(0);
- ConstantSDNode *AddVal =
- cast<ConstantSDNode>(ShVal.Val->getOperand(1));
- uint64_t Disp = AM.Disp + (AddVal->getValue() << Val);
- if (isInt32(Disp))
- AM.Disp = Disp;
- else
- AM.IndexReg = ShVal;
- } else {
- AM.IndexReg = ShVal;
- }
- return false;
- }
- break;
- }
-
- case ISD::SMUL_LOHI:
- case ISD::UMUL_LOHI:
- // A mul_lohi where we need the low part can be folded as a plain multiply.
- if (N.ResNo != 0) break;
- // FALL THROUGH
- case ISD::MUL:
- // X*[3,5,9] -> X+X*[2,4,8]
- if (!AlreadySelected &&
- AM.BaseType == X86ISelAddressMode::RegBase &&
- AM.Base.Reg.Val == 0 &&
- AM.IndexReg.Val == 0 &&
- !AM.isRIPRel) {
- if (ConstantSDNode *CN = dyn_cast<ConstantSDNode>(N.Val->getOperand(1)))
- if (CN->getValue() == 3 || CN->getValue() == 5 || CN->getValue() == 9) {
- AM.Scale = unsigned(CN->getValue())-1;
-
- SDOperand MulVal = N.Val->getOperand(0);
- SDOperand Reg;
-
- // Okay, we know that we have a scale by now. However, if the scaled
- // value is an add of something and a constant, we can fold the
- // constant into the disp field here.
- if (MulVal.Val->getOpcode() == ISD::ADD && MulVal.hasOneUse() &&
- isa<ConstantSDNode>(MulVal.Val->getOperand(1))) {
- Reg = MulVal.Val->getOperand(0);
- ConstantSDNode *AddVal =
- cast<ConstantSDNode>(MulVal.Val->getOperand(1));
- uint64_t Disp = AM.Disp + AddVal->getValue() * CN->getValue();
- if (isInt32(Disp))
- AM.Disp = Disp;
- else
- Reg = N.Val->getOperand(0);
- } else {
- Reg = N.Val->getOperand(0);
- }
-
- AM.IndexReg = AM.Base.Reg = Reg;
- return false;
- }
- }
- break;
-
- case ISD::ADD:
- if (!AlreadySelected) {
- X86ISelAddressMode Backup = AM;
- if (!MatchAddress(N.Val->getOperand(0), AM, false, Depth+1) &&
- !MatchAddress(N.Val->getOperand(1), AM, false, Depth+1))
- return false;
- AM = Backup;
- if (!MatchAddress(N.Val->getOperand(1), AM, false, Depth+1) &&
- !MatchAddress(N.Val->getOperand(0), AM, false, Depth+1))
- return false;
- AM = Backup;
- }
- break;
-
- case ISD::OR:
- // Handle "X | C" as "X + C" iff X is known to have C bits clear.
- if (AlreadySelected) break;
-
- if (ConstantSDNode *CN = dyn_cast<ConstantSDNode>(N.getOperand(1))) {
- X86ISelAddressMode Backup = AM;
- // Start with the LHS as an addr mode.
- if (!MatchAddress(N.getOperand(0), AM, false) &&
- // Address could not have picked a GV address for the displacement.
- AM.GV == NULL &&
- // On x86-64, the resultant disp must fit in 32-bits.
- isInt32(AM.Disp + CN->getSignExtended()) &&
- // Check to see if the LHS & C is zero.
- CurDAG->MaskedValueIsZero(N.getOperand(0), CN->getAPIntValue())) {
- AM.Disp += CN->getValue();
- return false;
- }
- AM = Backup;
- }
- break;
-
- case ISD::AND: {
- // Handle "(x << C1) & C2" as "(X & (C2>>C1)) << C1" if safe and if this
- // allows us to fold the shift into this addressing mode.
- if (AlreadySelected) break;
- SDOperand Shift = N.getOperand(0);
- if (Shift.getOpcode() != ISD::SHL) break;
-
- // Scale must not be used already.
- if (AM.IndexReg.Val != 0 || AM.Scale != 1) break;
-
- // Not when RIP is used as the base.
- if (AM.isRIPRel) break;
-
- ConstantSDNode *C2 = dyn_cast<ConstantSDNode>(N.getOperand(1));
- ConstantSDNode *C1 = dyn_cast<ConstantSDNode>(Shift.getOperand(1));
- if (!C1 || !C2) break;
-
- // Not likely to be profitable if either the AND or SHIFT node has more
- // than one use (unless all uses are for address computation). Besides,
- // isel mechanism requires their node ids to be reused.
- if (!N.hasOneUse() || !Shift.hasOneUse())
- break;
-
- // Verify that the shift amount is something we can fold.
- unsigned ShiftCst = C1->getValue();
- if (ShiftCst != 1 && ShiftCst != 2 && ShiftCst != 3)
- break;
-
- // Get the new AND mask, this folds to a constant.
- SDOperand NewANDMask = CurDAG->getNode(ISD::SRL, N.getValueType(),
- SDOperand(C2, 0), SDOperand(C1, 0));
- SDOperand NewAND = CurDAG->getNode(ISD::AND, N.getValueType(),
- Shift.getOperand(0), NewANDMask);
- NewANDMask.Val->setNodeId(Shift.Val->getNodeId());
- NewAND.Val->setNodeId(N.Val->getNodeId());
-
- AM.Scale = 1 << ShiftCst;
- AM.IndexReg = NewAND;
- return false;
- }
- }
-
- return MatchAddressBase(N, AM, isRoot, Depth);
-}
-
-/// MatchAddressBase - Helper for MatchAddress. Add the specified node to the
-/// specified addressing mode without any further recursion.
-bool X86DAGToDAGISel::MatchAddressBase(SDOperand N, X86ISelAddressMode &AM,
- bool isRoot, unsigned Depth) {
- // Is the base register already occupied?
- if (AM.BaseType != X86ISelAddressMode::RegBase || AM.Base.Reg.Val) {
- // If so, check to see if the scale index register is set.
- if (AM.IndexReg.Val == 0 && !AM.isRIPRel) {
- AM.IndexReg = N;
- AM.Scale = 1;
- return false;
- }
-
- // Otherwise, we cannot select it.
- return true;
- }
-
- // Default, generate it as a register.
- AM.BaseType = X86ISelAddressMode::RegBase;
- AM.Base.Reg = N;
- return false;
-}
-
-/// SelectAddr - returns true if it is able pattern match an addressing mode.
-/// It returns the operands which make up the maximal addressing mode it can
-/// match by reference.
-bool X86DAGToDAGISel::SelectAddr(SDOperand Op, SDOperand N, SDOperand &Base,
- SDOperand &Scale, SDOperand &Index,
- SDOperand &Disp) {
- X86ISelAddressMode AM;
- if (MatchAddress(N, AM))
- return false;
-
- MVT::ValueType VT = N.getValueType();
- if (AM.BaseType == X86ISelAddressMode::RegBase) {
- if (!AM.Base.Reg.Val)
- AM.Base.Reg = CurDAG->getRegister(0, VT);
- }
-
- if (!AM.IndexReg.Val)
- AM.IndexReg = CurDAG->getRegister(0, VT);
-
- getAddressOperands(AM, Base, Scale, Index, Disp);
- return true;
-}
-
-/// isZeroNode - Returns true if Elt is a constant zero or a floating point
-/// constant +0.0.
-static inline bool isZeroNode(SDOperand Elt) {
- return ((isa<ConstantSDNode>(Elt) &&
- cast<ConstantSDNode>(Elt)->getValue() == 0) ||
- (isa<ConstantFPSDNode>(Elt) &&
- cast<ConstantFPSDNode>(Elt)->getValueAPF().isPosZero()));
-}
-
-
-/// SelectScalarSSELoad - Match a scalar SSE load. In particular, we want to
-/// match a load whose top elements are either undef or zeros. The load flavor
-/// is derived from the type of N, which is either v4f32 or v2f64.
-bool X86DAGToDAGISel::SelectScalarSSELoad(SDOperand Op, SDOperand Pred,
- SDOperand N, SDOperand &Base,
- SDOperand &Scale, SDOperand &Index,
- SDOperand &Disp, SDOperand &InChain,
- SDOperand &OutChain) {
- if (N.getOpcode() == ISD::SCALAR_TO_VECTOR) {
- InChain = N.getOperand(0).getValue(1);
- if (ISD::isNON_EXTLoad(InChain.Val) &&
- InChain.getValue(0).hasOneUse() &&
- N.hasOneUse() &&
- CanBeFoldedBy(N.Val, Pred.Val, Op.Val)) {
- LoadSDNode *LD = cast<LoadSDNode>(InChain);
- if (!SelectAddr(Op, LD->getBasePtr(), Base, Scale, Index, Disp))
- return false;
- OutChain = LD->getChain();
- return true;
- }
- }
-
- // Also handle the case where we explicitly require zeros in the top
- // elements. This is a vector shuffle from the zero vector.
- if (N.getOpcode() == X86ISD::VZEXT_MOVL && N.Val->hasOneUse() &&
- // Check to see if the top elements are all zeros (or bitcast of zeros).
- N.getOperand(0).getOpcode() == ISD::SCALAR_TO_VECTOR &&
- N.getOperand(0).Val->hasOneUse() &&
- ISD::isNON_EXTLoad(N.getOperand(0).getOperand(0).Val) &&
- N.getOperand(0).getOperand(0).hasOneUse()) {
- // Okay, this is a zero extending load. Fold it.
- LoadSDNode *LD = cast<LoadSDNode>(N.getOperand(0).getOperand(0));
- if (!SelectAddr(Op, LD->getBasePtr(), Base, Scale, Index, Disp))
- return false;
- OutChain = LD->getChain();
- InChain = SDOperand(LD, 1);
- return true;
- }
- return false;
-}
-
-
-/// SelectLEAAddr - it calls SelectAddr and determines if the maximal addressing
-/// mode it matches can be cost effectively emitted as an LEA instruction.
-bool X86DAGToDAGISel::SelectLEAAddr(SDOperand Op, SDOperand N,
- SDOperand &Base, SDOperand &Scale,
- SDOperand &Index, SDOperand &Disp) {
- X86ISelAddressMode AM;
- if (MatchAddress(N, AM))
- return false;
-
- MVT::ValueType VT = N.getValueType();
- unsigned Complexity = 0;
- if (AM.BaseType == X86ISelAddressMode::RegBase)
- if (AM.Base.Reg.Val)
- Complexity = 1;
- else
- AM.Base.Reg = CurDAG->getRegister(0, VT);
- else if (AM.BaseType == X86ISelAddressMode::FrameIndexBase)
- Complexity = 4;
-
- if (AM.IndexReg.Val)
- Complexity++;
- else
- AM.IndexReg = CurDAG->getRegister(0, VT);
-
- // Don't match just leal(,%reg,2). It's cheaper to do addl %reg, %reg, or with
- // a simple shift.
- if (AM.Scale > 1)
- Complexity++;
-
- // FIXME: We are artificially lowering the criteria to turn ADD %reg, $GA
- // to a LEA. This is determined with some expermentation but is by no means
- // optimal (especially for code size consideration). LEA is nice because of
- // its three-address nature. Tweak the cost function again when we can run
- // convertToThreeAddress() at register allocation time.
- if (AM.GV || AM.CP || AM.ES || AM.JT != -1) {
- // For X86-64, we should always use lea to materialize RIP relative
- // addresses.
- if (Subtarget->is64Bit())
- Complexity = 4;
- else
- Complexity += 2;
- }
-
- if (AM.Disp && (AM.Base.Reg.Val || AM.IndexReg.Val))
- Complexity++;
-
- if (Complexity > 2) {
- getAddressOperands(AM, Base, Scale, Index, Disp);
- return true;
- }
- return false;
-}
-
-bool X86DAGToDAGISel::TryFoldLoad(SDOperand P, SDOperand N,
- SDOperand &Base, SDOperand &Scale,
- SDOperand &Index, SDOperand &Disp) {
- if (ISD::isNON_EXTLoad(N.Val) &&
- N.hasOneUse() &&
- CanBeFoldedBy(N.Val, P.Val, P.Val))
- return SelectAddr(P, N.getOperand(1), Base, Scale, Index, Disp);
- return false;
-}
-
-/// getGlobalBaseReg - Output the instructions required to put the
-/// base address to use for accessing globals into a register.
-///
-SDNode *X86DAGToDAGISel::getGlobalBaseReg() {
- assert(!Subtarget->is64Bit() && "X86-64 PIC uses RIP relative addressing");
- if (!GlobalBaseReg) {
- // Insert the set of GlobalBaseReg into the first MBB of the function
- MachineFunction *MF = BB->getParent();
- MachineBasicBlock &FirstMBB = MF->front();
- MachineBasicBlock::iterator MBBI = FirstMBB.begin();
- MachineRegisterInfo &RegInfo = MF->getRegInfo();
- unsigned PC = RegInfo.createVirtualRegister(X86::GR32RegisterClass);
-
- const TargetInstrInfo *TII = TM.getInstrInfo();
- // Operand of MovePCtoStack is completely ignored by asm printer. It's
- // only used in JIT code emission as displacement to pc.
- BuildMI(FirstMBB, MBBI, TII->get(X86::MOVPC32r), PC).addImm(0);
-
- // If we're using vanilla 'GOT' PIC style, we should use relative addressing
- // not to pc, but to _GLOBAL_ADDRESS_TABLE_ external
- if (TM.getRelocationModel() == Reloc::PIC_ &&
- Subtarget->isPICStyleGOT()) {
- GlobalBaseReg = RegInfo.createVirtualRegister(X86::GR32RegisterClass);
- BuildMI(FirstMBB, MBBI, TII->get(X86::ADD32ri), GlobalBaseReg)
- .addReg(PC).addExternalSymbol("_GLOBAL_OFFSET_TABLE_");
- } else {
- GlobalBaseReg = PC;
- }
-
- }
- return CurDAG->getRegister(GlobalBaseReg, TLI.getPointerTy()).Val;
-}
-
-static SDNode *FindCallStartFromCall(SDNode *Node) {
- if (Node->getOpcode() == ISD::CALLSEQ_START) return Node;
- assert(Node->getOperand(0).getValueType() == MVT::Other &&
- "Node doesn't have a token chain argument!");
- return FindCallStartFromCall(Node->getOperand(0).Val);
-}
-
-SDNode *X86DAGToDAGISel::getTruncate(SDOperand N0, MVT::ValueType VT) {
- SDOperand SRIdx;
- switch (VT) {
- case MVT::i8:
- SRIdx = CurDAG->getTargetConstant(1, MVT::i32); // SubRegSet 1
- // Ensure that the source register has an 8-bit subreg on 32-bit targets
- if (!Subtarget->is64Bit()) {
- unsigned Opc;
- MVT::ValueType VT;
- switch (N0.getValueType()) {
- default: assert(0 && "Unknown truncate!");
- case MVT::i16:
- Opc = X86::MOV16to16_;
- VT = MVT::i16;
- break;
- case MVT::i32:
- Opc = X86::MOV32to32_;
- VT = MVT::i32;
- break;
- }
- N0 = SDOperand(CurDAG->getTargetNode(Opc, VT, MVT::Flag, N0), 0);
- return CurDAG->getTargetNode(X86::EXTRACT_SUBREG,
- VT, N0, SRIdx, N0.getValue(1));
- }
- break;
- case MVT::i16:
- SRIdx = CurDAG->getTargetConstant(2, MVT::i32); // SubRegSet 2
- break;
- case MVT::i32:
- SRIdx = CurDAG->getTargetConstant(3, MVT::i32); // SubRegSet 3
- break;
- default: assert(0 && "Unknown truncate!"); break;
- }
- return CurDAG->getTargetNode(X86::EXTRACT_SUBREG, VT, N0, SRIdx);
-}
-
-
-SDNode *X86DAGToDAGISel::Select(SDOperand N) {
- SDNode *Node = N.Val;
- MVT::ValueType NVT = Node->getValueType(0);
- unsigned Opc, MOpc;
- unsigned Opcode = Node->getOpcode();
-
-#ifndef NDEBUG
- DOUT << std::string(Indent, ' ') << "Selecting: ";
- DEBUG(Node->dump(CurDAG));
- DOUT << "\n";
- Indent += 2;
-#endif
-
- if (Opcode >= ISD::BUILTIN_OP_END && Opcode < X86ISD::FIRST_NUMBER) {
-#ifndef NDEBUG
- DOUT << std::string(Indent-2, ' ') << "== ";
- DEBUG(Node->dump(CurDAG));
- DOUT << "\n";
- Indent -= 2;
-#endif
- return NULL; // Already selected.
- }
-
- switch (Opcode) {
- default: break;
- case X86ISD::GlobalBaseReg:
- return getGlobalBaseReg();
-
- // FIXME: This is a workaround for a tblgen problem: rdar://5791600
- case X86ISD::RET_FLAG:
- if (ConstantSDNode *Amt = dyn_cast<ConstantSDNode>(N.getOperand(1))) {
- if (Amt->getSignExtended() != 0) break;
-
- // Match (X86retflag 0).
- SDOperand Chain = N.getOperand(0);
- bool HasInFlag = N.getOperand(N.getNumOperands()-1).getValueType()
- == MVT::Flag;
- SmallVector<SDOperand, 8> Ops0;
- AddToISelQueue(Chain);
- SDOperand InFlag(0, 0);
- if (HasInFlag) {
- InFlag = N.getOperand(N.getNumOperands()-1);
- AddToISelQueue(InFlag);
- }
- for (unsigned i = 2, e = N.getNumOperands()-(HasInFlag?1:0); i != e;
- ++i) {
- AddToISelQueue(N.getOperand(i));
- Ops0.push_back(N.getOperand(i));
- }
- Ops0.push_back(Chain);
- if (HasInFlag)
- Ops0.push_back(InFlag);
- return CurDAG->getTargetNode(X86::RET, MVT::Other,
- &Ops0[0], Ops0.size());
- }
- break;
-
- case ISD::ADD: {
- // Turn ADD X, c to MOV32ri X+c. This cannot be done with tblgen'd
- // code and is matched first so to prevent it from being turned into
- // LEA32r X+c.
- // In 64-bit small code size mode, use LEA to take advantage of
- // RIP-relative addressing.
- if (TM.getCodeModel() != CodeModel::Small)
- break;
- MVT::ValueType PtrVT = TLI.getPointerTy();
- SDOperand N0 = N.getOperand(0);
- SDOperand N1 = N.getOperand(1);
- if (N.Val->getValueType(0) == PtrVT &&
- N0.getOpcode() == X86ISD::Wrapper &&
- N1.getOpcode() == ISD::Constant) {
- unsigned Offset = (unsigned)cast<ConstantSDNode>(N1)->getValue();
- SDOperand C(0, 0);
- // TODO: handle ExternalSymbolSDNode.
- if (GlobalAddressSDNode *G =
- dyn_cast<GlobalAddressSDNode>(N0.getOperand(0))) {
- C = CurDAG->getTargetGlobalAddress(G->getGlobal(), PtrVT,
- G->getOffset() + Offset);
- } else if (ConstantPoolSDNode *CP =
- dyn_cast<ConstantPoolSDNode>(N0.getOperand(0))) {
- C = CurDAG->getTargetConstantPool(CP->getConstVal(), PtrVT,
- CP->getAlignment(),
- CP->getOffset()+Offset);
- }
-
- if (C.Val) {
- if (Subtarget->is64Bit()) {
- SDOperand Ops[] = { CurDAG->getRegister(0, PtrVT), getI8Imm(1),
- CurDAG->getRegister(0, PtrVT), C };
- return CurDAG->SelectNodeTo(N.Val, X86::LEA64r, MVT::i64, Ops, 4);
- } else
- return CurDAG->SelectNodeTo(N.Val, X86::MOV32ri, PtrVT, C);
- }
- }
-
- // Other cases are handled by auto-generated code.
- break;
- }
-
- case ISD::SMUL_LOHI:
- case ISD::UMUL_LOHI: {
- SDOperand N0 = Node->getOperand(0);
- SDOperand N1 = Node->getOperand(1);
-
- bool isSigned = Opcode == ISD::SMUL_LOHI;
- if (!isSigned)
- switch (NVT) {
- default: assert(0 && "Unsupported VT!");
- case MVT::i8: Opc = X86::MUL8r; MOpc = X86::MUL8m; break;
- case MVT::i16: Opc = X86::MUL16r; MOpc = X86::MUL16m; break;
- case MVT::i32: Opc = X86::MUL32r; MOpc = X86::MUL32m; break;
- case MVT::i64: Opc = X86::MUL64r; MOpc = X86::MUL64m; break;
- }
- else
- switch (NVT) {
- default: assert(0 && "Unsupported VT!");
- case MVT::i8: Opc = X86::IMUL8r; MOpc = X86::IMUL8m; break;
- case MVT::i16: Opc = X86::IMUL16r; MOpc = X86::IMUL16m; break;
- case MVT::i32: Opc = X86::IMUL32r; MOpc = X86::IMUL32m; break;
- case MVT::i64: Opc = X86::IMUL64r; MOpc = X86::IMUL64m; break;
- }
-
- unsigned LoReg, HiReg;
- switch (NVT) {
- default: assert(0 && "Unsupported VT!");
- case MVT::i8: LoReg = X86::AL; HiReg = X86::AH; break;
- case MVT::i16: LoReg = X86::AX; HiReg = X86::DX; break;
- case MVT::i32: LoReg = X86::EAX; HiReg = X86::EDX; break;
- case MVT::i64: LoReg = X86::RAX; HiReg = X86::RDX; break;
- }
-
- SDOperand Tmp0, Tmp1, Tmp2, Tmp3;
- bool foldedLoad = TryFoldLoad(N, N1, Tmp0, Tmp1, Tmp2, Tmp3);
- // multiplty is commmutative
- if (!foldedLoad) {
- foldedLoad = TryFoldLoad(N, N0, Tmp0, Tmp1, Tmp2, Tmp3);
- if (foldedLoad)
- std::swap(N0, N1);
- }
-
- AddToISelQueue(N0);
- SDOperand InFlag = CurDAG->getCopyToReg(CurDAG->getEntryNode(), LoReg,
- N0, SDOperand()).getValue(1);
-
- if (foldedLoad) {
- AddToISelQueue(N1.getOperand(0));
- AddToISelQueue(Tmp0);
- AddToISelQueue(Tmp1);
- AddToISelQueue(Tmp2);
- AddToISelQueue(Tmp3);
- SDOperand Ops[] = { Tmp0, Tmp1, Tmp2, Tmp3, N1.getOperand(0), InFlag };
- SDNode *CNode =
- CurDAG->getTargetNode(MOpc, MVT::Other, MVT::Flag, Ops, 6);
- InFlag = SDOperand(CNode, 1);
- // Update the chain.
- ReplaceUses(N1.getValue(1), SDOperand(CNode, 0));
- } else {
- AddToISelQueue(N1);
- InFlag =
- SDOperand(CurDAG->getTargetNode(Opc, MVT::Flag, N1, InFlag), 0);
- }
-
- // Copy the low half of the result, if it is needed.
- if (!N.getValue(0).use_empty()) {
- SDOperand Result = CurDAG->getCopyFromReg(CurDAG->getEntryNode(),
- LoReg, NVT, InFlag);
- InFlag = Result.getValue(2);
- ReplaceUses(N.getValue(0), Result);
-#ifndef NDEBUG
- DOUT << std::string(Indent-2, ' ') << "=> ";
- DEBUG(Result.Val->dump(CurDAG));
- DOUT << "\n";
-#endif
- }
- // Copy the high half of the result, if it is needed.
- if (!N.getValue(1).use_empty()) {
- SDOperand Result;
- if (HiReg == X86::AH && Subtarget->is64Bit()) {
- // Prevent use of AH in a REX instruction by referencing AX instead.
- // Shift it down 8 bits.
- Result = CurDAG->getCopyFromReg(CurDAG->getEntryNode(),
- X86::AX, MVT::i16, InFlag);
- InFlag = Result.getValue(2);
- Result = SDOperand(CurDAG->getTargetNode(X86::SHR16ri, MVT::i16, Result,
- CurDAG->getTargetConstant(8, MVT::i8)), 0);
- // Then truncate it down to i8.
- SDOperand SRIdx = CurDAG->getTargetConstant(1, MVT::i32); // SubRegSet 1
- Result = SDOperand(CurDAG->getTargetNode(X86::EXTRACT_SUBREG,
- MVT::i8, Result, SRIdx), 0);
- } else {
- Result = CurDAG->getCopyFromReg(CurDAG->getEntryNode(),
- HiReg, NVT, InFlag);
- InFlag = Result.getValue(2);
- }
- ReplaceUses(N.getValue(1), Result);
-#ifndef NDEBUG
- DOUT << std::string(Indent-2, ' ') << "=> ";
- DEBUG(Result.Val->dump(CurDAG));
- DOUT << "\n";
-#endif
- }
-
-#ifndef NDEBUG
- Indent -= 2;
-#endif
-
- return NULL;
- }
-
- case ISD::SDIVREM:
- case ISD::UDIVREM: {
- SDOperand N0 = Node->getOperand(0);
- SDOperand N1 = Node->getOperand(1);
-
- bool isSigned = Opcode == ISD::SDIVREM;
- if (!isSigned)
- switch (NVT) {
- default: assert(0 && "Unsupported VT!");
- case MVT::i8: Opc = X86::DIV8r; MOpc = X86::DIV8m; break;
- case MVT::i16: Opc = X86::DIV16r; MOpc = X86::DIV16m; break;
- case MVT::i32: Opc = X86::DIV32r; MOpc = X86::DIV32m; break;
- case MVT::i64: Opc = X86::DIV64r; MOpc = X86::DIV64m; break;
- }
- else
- switch (NVT) {
- default: assert(0 && "Unsupported VT!");
- case MVT::i8: Opc = X86::IDIV8r; MOpc = X86::IDIV8m; break;
- case MVT::i16: Opc = X86::IDIV16r; MOpc = X86::IDIV16m; break;
- case MVT::i32: Opc = X86::IDIV32r; MOpc = X86::IDIV32m; break;
- case MVT::i64: Opc = X86::IDIV64r; MOpc = X86::IDIV64m; break;
- }
-
- unsigned LoReg, HiReg;
- unsigned ClrOpcode, SExtOpcode;
- switch (NVT) {
- default: assert(0 && "Unsupported VT!");
- case MVT::i8:
- LoReg = X86::AL; HiReg = X86::AH;
- ClrOpcode = 0;
- SExtOpcode = X86::CBW;
- break;
- case MVT::i16:
- LoReg = X86::AX; HiReg = X86::DX;
- ClrOpcode = X86::MOV16r0;
- SExtOpcode = X86::CWD;
- break;
- case MVT::i32:
- LoReg = X86::EAX; HiReg = X86::EDX;
- ClrOpcode = X86::MOV32r0;
- SExtOpcode = X86::CDQ;
- break;
- case MVT::i64:
- LoReg = X86::RAX; HiReg = X86::RDX;
- ClrOpcode = X86::MOV64r0;
- SExtOpcode = X86::CQO;
- break;
- }
-
- SDOperand Tmp0, Tmp1, Tmp2, Tmp3;
- bool foldedLoad = TryFoldLoad(N, N1, Tmp0, Tmp1, Tmp2, Tmp3);
-
- SDOperand InFlag;
- if (NVT == MVT::i8 && !isSigned) {
- // Special case for div8, just use a move with zero extension to AX to
- // clear the upper 8 bits (AH).
- SDOperand Tmp0, Tmp1, Tmp2, Tmp3, Move, Chain;
- if (TryFoldLoad(N, N0, Tmp0, Tmp1, Tmp2, Tmp3)) {
- SDOperand Ops[] = { Tmp0, Tmp1, Tmp2, Tmp3, N0.getOperand(0) };
- AddToISelQueue(N0.getOperand(0));
- AddToISelQueue(Tmp0);
- AddToISelQueue(Tmp1);
- AddToISelQueue(Tmp2);
- AddToISelQueue(Tmp3);
- Move =
- SDOperand(CurDAG->getTargetNode(X86::MOVZX16rm8, MVT::i16, MVT::Other,
- Ops, 5), 0);
- Chain = Move.getValue(1);
- ReplaceUses(N0.getValue(1), Chain);
- } else {
- AddToISelQueue(N0);
- Move =
- SDOperand(CurDAG->getTargetNode(X86::MOVZX16rr8, MVT::i16, N0), 0);
- Chain = CurDAG->getEntryNode();
- }
- Chain = CurDAG->getCopyToReg(Chain, X86::AX, Move, SDOperand());
- InFlag = Chain.getValue(1);
- } else {
- AddToISelQueue(N0);
- InFlag =
- CurDAG->getCopyToReg(CurDAG->getEntryNode(),
- LoReg, N0, SDOperand()).getValue(1);
- if (isSigned) {
- // Sign extend the low part into the high part.
- InFlag =
- SDOperand(CurDAG->getTargetNode(SExtOpcode, MVT::Flag, InFlag), 0);
- } else {
- // Zero out the high part, effectively zero extending the input.
- SDOperand ClrNode = SDOperand(CurDAG->getTargetNode(ClrOpcode, NVT), 0);
- InFlag = CurDAG->getCopyToReg(CurDAG->getEntryNode(), HiReg,
- ClrNode, InFlag).getValue(1);
- }
- }
-
- if (foldedLoad) {
- AddToISelQueue(N1.getOperand(0));
- AddToISelQueue(Tmp0);
- AddToISelQueue(Tmp1);
- AddToISelQueue(Tmp2);
- AddToISelQueue(Tmp3);
- SDOperand Ops[] = { Tmp0, Tmp1, Tmp2, Tmp3, N1.getOperand(0), InFlag };
- SDNode *CNode =
- CurDAG->getTargetNode(MOpc, MVT::Other, MVT::Flag, Ops, 6);
- InFlag = SDOperand(CNode, 1);
- // Update the chain.
- ReplaceUses(N1.getValue(1), SDOperand(CNode, 0));
- } else {
- AddToISelQueue(N1);
- InFlag =
- SDOperand(CurDAG->getTargetNode(Opc, MVT::Flag, N1, InFlag), 0);
- }
-
- // Copy the division (low) result, if it is needed.
- if (!N.getValue(0).use_empty()) {
- SDOperand Result = CurDAG->getCopyFromReg(CurDAG->getEntryNode(),
- LoReg, NVT, InFlag);
- InFlag = Result.getValue(2);
- ReplaceUses(N.getValue(0), Result);
-#ifndef NDEBUG
- DOUT << std::string(Indent-2, ' ') << "=> ";
- DEBUG(Result.Val->dump(CurDAG));
- DOUT << "\n";
-#endif
- }
- // Copy the remainder (high) result, if it is needed.
- if (!N.getValue(1).use_empty()) {
- SDOperand Result;
- if (HiReg == X86::AH && Subtarget->is64Bit()) {
- // Prevent use of AH in a REX instruction by referencing AX instead.
- // Shift it down 8 bits.
- Result = CurDAG->getCopyFromReg(CurDAG->getEntryNode(),
- X86::AX, MVT::i16, InFlag);
- InFlag = Result.getValue(2);
- Result = SDOperand(CurDAG->getTargetNode(X86::SHR16ri, MVT::i16, Result,
- CurDAG->getTargetConstant(8, MVT::i8)), 0);
- // Then truncate it down to i8.
- SDOperand SRIdx = CurDAG->getTargetConstant(1, MVT::i32); // SubRegSet 1
- Result = SDOperand(CurDAG->getTargetNode(X86::EXTRACT_SUBREG,
- MVT::i8, Result, SRIdx), 0);
- } else {
- Result = CurDAG->getCopyFromReg(CurDAG->getEntryNode(),
- HiReg, NVT, InFlag);
- InFlag = Result.getValue(2);
- }
- ReplaceUses(N.getValue(1), Result);
-#ifndef NDEBUG
- DOUT << std::string(Indent-2, ' ') << "=> ";
- DEBUG(Result.Val->dump(CurDAG));
- DOUT << "\n";
-#endif
- }
-
-#ifndef NDEBUG
- Indent -= 2;
-#endif
-
- return NULL;
- }
-
- case ISD::ANY_EXTEND: {
- // Check if the type extended to supports subregs.
- if (NVT == MVT::i8)
- break;
-
- SDOperand N0 = Node->getOperand(0);
- // Get the subregsiter index for the type to extend.
- MVT::ValueType N0VT = N0.getValueType();
- unsigned Idx = (N0VT == MVT::i32) ? X86::SUBREG_32BIT :
- (N0VT == MVT::i16) ? X86::SUBREG_16BIT :
- (Subtarget->is64Bit()) ? X86::SUBREG_8BIT : 0;
-
- // If we don't have a subreg Idx, let generated ISel have a try.
- if (Idx == 0)
- break;
-
- // If we have an index, generate an insert_subreg into undef.
- AddToISelQueue(N0);
- SDOperand Undef =
- SDOperand(CurDAG->getTargetNode(X86::IMPLICIT_DEF, NVT), 0);
- SDOperand SRIdx = CurDAG->getTargetConstant(Idx, MVT::i32);
- SDNode *ResNode = CurDAG->getTargetNode(X86::INSERT_SUBREG,
- NVT, Undef, N0, SRIdx);
-
-#ifndef NDEBUG
- DOUT << std::string(Indent-2, ' ') << "=> ";
- DEBUG(ResNode->dump(CurDAG));
- DOUT << "\n";
- Indent -= 2;
-#endif
- return ResNode;
- }
-
- case ISD::SIGN_EXTEND_INREG: {
- SDOperand N0 = Node->getOperand(0);
- AddToISelQueue(N0);
-
- MVT::ValueType SVT = cast<VTSDNode>(Node->getOperand(1))->getVT();
- SDOperand TruncOp = SDOperand(getTruncate(N0, SVT), 0);
- unsigned Opc = 0;
- switch (NVT) {
- case MVT::i16:
- if (SVT == MVT::i8) Opc = X86::MOVSX16rr8;
- else assert(0 && "Unknown sign_extend_inreg!");
- break;
- case MVT::i32:
- switch (SVT) {
- case MVT::i8: Opc = X86::MOVSX32rr8; break;
- case MVT::i16: Opc = X86::MOVSX32rr16; break;
- default: assert(0 && "Unknown sign_extend_inreg!");
- }
- break;
- case MVT::i64:
- switch (SVT) {
- case MVT::i8: Opc = X86::MOVSX64rr8; break;
- case MVT::i16: Opc = X86::MOVSX64rr16; break;
- case MVT::i32: Opc = X86::MOVSX64rr32; break;
- default: assert(0 && "Unknown sign_extend_inreg!");
- }
- break;
- default: assert(0 && "Unknown sign_extend_inreg!");
- }
-
- SDNode *ResNode = CurDAG->getTargetNode(Opc, NVT, TruncOp);
-
-#ifndef NDEBUG
- DOUT << std::string(Indent-2, ' ') << "=> ";
- DEBUG(TruncOp.Val->dump(CurDAG));
- DOUT << "\n";
- DOUT << std::string(Indent-2, ' ') << "=> ";
- DEBUG(ResNode->dump(CurDAG));
- DOUT << "\n";
- Indent -= 2;
-#endif
- return ResNode;
- break;
- }
-
- case ISD::TRUNCATE: {
- SDOperand Input = Node->getOperand(0);
- AddToISelQueue(Node->getOperand(0));
- SDNode *ResNode = getTruncate(Input, NVT);
-
-#ifndef NDEBUG
- DOUT << std::string(Indent-2, ' ') << "=> ";
- DEBUG(ResNode->dump(CurDAG));
- DOUT << "\n";
- Indent -= 2;
-#endif
- return ResNode;
- break;
- }
- }
-
- SDNode *ResNode = SelectCode(N);
-
-#ifndef NDEBUG
- DOUT << std::string(Indent-2, ' ') << "=> ";
- if (ResNode == NULL || ResNode == N.Val)
- DEBUG(N.Val->dump(CurDAG));
- else
- DEBUG(ResNode->dump(CurDAG));
- DOUT << "\n";
- Indent -= 2;
-#endif
-
- return ResNode;
-}
-
-bool X86DAGToDAGISel::
-SelectInlineAsmMemoryOperand(const SDOperand &Op, char ConstraintCode,
- std::vector<SDOperand> &OutOps, SelectionDAG &DAG){
- SDOperand Op0, Op1, Op2, Op3;
- switch (ConstraintCode) {
- case 'o': // offsetable ??
- case 'v': // not offsetable ??
- default: return true;
- case 'm': // memory
- if (!SelectAddr(Op, Op, Op0, Op1, Op2, Op3))
- return true;
- break;
- }
-
- OutOps.push_back(Op0);
- OutOps.push_back(Op1);
- OutOps.push_back(Op2);
- OutOps.push_back(Op3);
- AddToISelQueue(Op0);
- AddToISelQueue(Op1);
- AddToISelQueue(Op2);
- AddToISelQueue(Op3);
- return false;
-}
-
-/// createX86ISelDag - This pass converts a legalized DAG into a
-/// X86-specific DAG, ready for instruction scheduling.
-///
-FunctionPass *llvm::createX86ISelDag(X86TargetMachine &TM, bool Fast) {
- return new X86DAGToDAGISel(TM, Fast);
-}
diff --git a/release_23/lib/Target/X86/X86ISelLowering.cpp b/release_23/lib/Target/X86/X86ISelLowering.cpp
deleted file mode 100644
index 4e3db7e9ea69..000000000000
--- a/release_23/lib/Target/X86/X86ISelLowering.cpp
+++ /dev/null
@@ -1,6873 +0,0 @@
-//===-- X86ISelLowering.cpp - X86 DAG Lowering Implementation -------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines the interfaces that X86 uses to lower LLVM code into a
-// selection DAG.
-//
-//===----------------------------------------------------------------------===//
-
-#include "X86.h"
-#include "X86InstrBuilder.h"
-#include "X86ISelLowering.h"
-#include "X86MachineFunctionInfo.h"
-#include "X86TargetMachine.h"
-#include "llvm/CallingConv.h"
-#include "llvm/Constants.h"
-#include "llvm/DerivedTypes.h"
-#include "llvm/GlobalVariable.h"
-#include "llvm/Function.h"
-#include "llvm/Intrinsics.h"
-#include "llvm/ADT/BitVector.h"
-#include "llvm/ADT/VectorExtras.h"
-#include "llvm/Analysis/ScalarEvolutionExpressions.h"
-#include "llvm/CodeGen/CallingConvLower.h"
-#include "llvm/CodeGen/MachineFrameInfo.h"
-#include "llvm/CodeGen/MachineFunction.h"
-#include "llvm/CodeGen/MachineInstrBuilder.h"
-#include "llvm/CodeGen/MachineModuleInfo.h"
-#include "llvm/CodeGen/MachineRegisterInfo.h"
-#include "llvm/CodeGen/PseudoSourceValue.h"
-#include "llvm/CodeGen/SelectionDAG.h"
-#include "llvm/Support/MathExtras.h"
-#include "llvm/Support/Debug.h"
-#include "llvm/Target/TargetOptions.h"
-#include "llvm/ADT/SmallSet.h"
-#include "llvm/ADT/StringExtras.h"
-using namespace llvm;
-
-// Forward declarations.
-static SDOperand getMOVLMask(unsigned NumElems, SelectionDAG &DAG);
-
-X86TargetLowering::X86TargetLowering(TargetMachine &TM)
- : TargetLowering(TM) {
- Subtarget = &TM.getSubtarget<X86Subtarget>();
- X86ScalarSSEf64 = Subtarget->hasSSE2();
- X86ScalarSSEf32 = Subtarget->hasSSE1();
- X86StackPtr = Subtarget->is64Bit() ? X86::RSP : X86::ESP;
-
- bool Fast = false;
-
- RegInfo = TM.getRegisterInfo();
-
- // Set up the TargetLowering object.
-
- // X86 is weird, it always uses i8 for shift amounts and setcc results.
- setShiftAmountType(MVT::i8);
- setSetCCResultContents(ZeroOrOneSetCCResult);
- setSchedulingPreference(SchedulingForRegPressure);
- setShiftAmountFlavor(Mask); // shl X, 32 == shl X, 0
- setStackPointerRegisterToSaveRestore(X86StackPtr);
-
- if (Subtarget->isTargetDarwin()) {
- // Darwin should use _setjmp/_longjmp instead of setjmp/longjmp.
- setUseUnderscoreSetJmp(false);
- setUseUnderscoreLongJmp(false);
- } else if (Subtarget->isTargetMingw()) {
- // MS runtime is weird: it exports _setjmp, but longjmp!
- setUseUnderscoreSetJmp(true);
- setUseUnderscoreLongJmp(false);
- } else {
- setUseUnderscoreSetJmp(true);
- setUseUnderscoreLongJmp(true);
- }
-
- // Set up the register classes.
- addRegisterClass(MVT::i8, X86::GR8RegisterClass);
- addRegisterClass(MVT::i16, X86::GR16RegisterClass);
- addRegisterClass(MVT::i32, X86::GR32RegisterClass);
- if (Subtarget->is64Bit())
- addRegisterClass(MVT::i64, X86::GR64RegisterClass);
-
- setLoadXAction(ISD::SEXTLOAD, MVT::i1, Promote);
-
- // We don't accept any truncstore of integer registers.
- setTruncStoreAction(MVT::i64, MVT::i32, Expand);
- setTruncStoreAction(MVT::i64, MVT::i16, Expand);
- setTruncStoreAction(MVT::i64, MVT::i8 , Expand);
- setTruncStoreAction(MVT::i32, MVT::i16, Expand);
- setTruncStoreAction(MVT::i32, MVT::i8 , Expand);
- setTruncStoreAction(MVT::i16, MVT::i8, Expand);
-
- // Promote all UINT_TO_FP to larger SINT_TO_FP's, as X86 doesn't have this
- // operation.
- setOperationAction(ISD::UINT_TO_FP , MVT::i1 , Promote);
- setOperationAction(ISD::UINT_TO_FP , MVT::i8 , Promote);
- setOperationAction(ISD::UINT_TO_FP , MVT::i16 , Promote);
-
- if (Subtarget->is64Bit()) {
- setOperationAction(ISD::UINT_TO_FP , MVT::i64 , Expand);
- setOperationAction(ISD::UINT_TO_FP , MVT::i32 , Promote);
- } else {
- if (X86ScalarSSEf64)
- // If SSE i64 SINT_TO_FP is not available, expand i32 UINT_TO_FP.
- setOperationAction(ISD::UINT_TO_FP , MVT::i32 , Expand);
- else
- setOperationAction(ISD::UINT_TO_FP , MVT::i32 , Promote);
- }
-
- // Promote i1/i8 SINT_TO_FP to larger SINT_TO_FP's, as X86 doesn't have
- // this operation.
- setOperationAction(ISD::SINT_TO_FP , MVT::i1 , Promote);
- setOperationAction(ISD::SINT_TO_FP , MVT::i8 , Promote);
- // SSE has no i16 to fp conversion, only i32
- if (X86ScalarSSEf32) {
- setOperationAction(ISD::SINT_TO_FP , MVT::i16 , Promote);
- // f32 and f64 cases are Legal, f80 case is not
- setOperationAction(ISD::SINT_TO_FP , MVT::i32 , Custom);
- } else {
- setOperationAction(ISD::SINT_TO_FP , MVT::i16 , Custom);
- setOperationAction(ISD::SINT_TO_FP , MVT::i32 , Custom);
- }
-
- // In 32-bit mode these are custom lowered. In 64-bit mode F32 and F64
- // are Legal, f80 is custom lowered.
- setOperationAction(ISD::FP_TO_SINT , MVT::i64 , Custom);
- setOperationAction(ISD::SINT_TO_FP , MVT::i64 , Custom);
-
- // Promote i1/i8 FP_TO_SINT to larger FP_TO_SINTS's, as X86 doesn't have
- // this operation.
- setOperationAction(ISD::FP_TO_SINT , MVT::i1 , Promote);
- setOperationAction(ISD::FP_TO_SINT , MVT::i8 , Promote);
-
- if (X86ScalarSSEf32) {
- setOperationAction(ISD::FP_TO_SINT , MVT::i16 , Promote);
- // f32 and f64 cases are Legal, f80 case is not
- setOperationAction(ISD::FP_TO_SINT , MVT::i32 , Custom);
- } else {
- setOperationAction(ISD::FP_TO_SINT , MVT::i16 , Custom);
- setOperationAction(ISD::FP_TO_SINT , MVT::i32 , Custom);
- }
-
- // Handle FP_TO_UINT by promoting the destination to a larger signed
- // conversion.
- setOperationAction(ISD::FP_TO_UINT , MVT::i1 , Promote);
- setOperationAction(ISD::FP_TO_UINT , MVT::i8 , Promote);
- setOperationAction(ISD::FP_TO_UINT , MVT::i16 , Promote);
-
- if (Subtarget->is64Bit()) {
- setOperationAction(ISD::FP_TO_UINT , MVT::i64 , Expand);
- setOperationAction(ISD::FP_TO_UINT , MVT::i32 , Promote);
- } else {
- if (X86ScalarSSEf32 && !Subtarget->hasSSE3())
- // Expand FP_TO_UINT into a select.
- // FIXME: We would like to use a Custom expander here eventually to do
- // the optimal thing for SSE vs. the default expansion in the legalizer.
- setOperationAction(ISD::FP_TO_UINT , MVT::i32 , Expand);
- else
- // With SSE3 we can use fisttpll to convert to a signed i64.
- setOperationAction(ISD::FP_TO_UINT , MVT::i32 , Promote);
- }
-
- // TODO: when we have SSE, these could be more efficient, by using movd/movq.
- if (!X86ScalarSSEf64) {
- setOperationAction(ISD::BIT_CONVERT , MVT::f32 , Expand);
- setOperationAction(ISD::BIT_CONVERT , MVT::i32 , Expand);
- }
-
- // Scalar integer divide and remainder are lowered to use operations that
- // produce two results, to match the available instructions. This exposes
- // the two-result form to trivial CSE, which is able to combine x/y and x%y
- // into a single instruction.
- //
- // Scalar integer multiply-high is also lowered to use two-result
- // operations, to match the available instructions. However, plain multiply
- // (low) operations are left as Legal, as there are single-result
- // instructions for this in x86. Using the two-result multiply instructions
- // when both high and low results are needed must be arranged by dagcombine.
- setOperationAction(ISD::MULHS , MVT::i8 , Expand);
- setOperationAction(ISD::MULHU , MVT::i8 , Expand);
- setOperationAction(ISD::SDIV , MVT::i8 , Expand);
- setOperationAction(ISD::UDIV , MVT::i8 , Expand);
- setOperationAction(ISD::SREM , MVT::i8 , Expand);
- setOperationAction(ISD::UREM , MVT::i8 , Expand);
- setOperationAction(ISD::MULHS , MVT::i16 , Expand);
- setOperationAction(ISD::MULHU , MVT::i16 , Expand);
- setOperationAction(ISD::SDIV , MVT::i16 , Expand);
- setOperationAction(ISD::UDIV , MVT::i16 , Expand);
- setOperationAction(ISD::SREM , MVT::i16 , Expand);
- setOperationAction(ISD::UREM , MVT::i16 , Expand);
- setOperationAction(ISD::MULHS , MVT::i32 , Expand);
- setOperationAction(ISD::MULHU , MVT::i32 , Expand);
- setOperationAction(ISD::SDIV , MVT::i32 , Expand);
- setOperationAction(ISD::UDIV , MVT::i32 , Expand);
- setOperationAction(ISD::SREM , MVT::i32 , Expand);
- setOperationAction(ISD::UREM , MVT::i32 , Expand);
- setOperationAction(ISD::MULHS , MVT::i64 , Expand);
- setOperationAction(ISD::MULHU , MVT::i64 , Expand);
- setOperationAction(ISD::SDIV , MVT::i64 , Expand);
- setOperationAction(ISD::UDIV , MVT::i64 , Expand);
- setOperationAction(ISD::SREM , MVT::i64 , Expand);
- setOperationAction(ISD::UREM , MVT::i64 , Expand);
-
- setOperationAction(ISD::BR_JT , MVT::Other, Expand);
- setOperationAction(ISD::BRCOND , MVT::Other, Custom);
- setOperationAction(ISD::BR_CC , MVT::Other, Expand);
- setOperationAction(ISD::SELECT_CC , MVT::Other, Expand);
- if (Subtarget->is64Bit())
- setOperationAction(ISD::SIGN_EXTEND_INREG, MVT::i32, Legal);
- setOperationAction(ISD::SIGN_EXTEND_INREG, MVT::i16 , Legal);
- setOperationAction(ISD::SIGN_EXTEND_INREG, MVT::i8 , Legal);
- setOperationAction(ISD::SIGN_EXTEND_INREG, MVT::i1 , Expand);
- setOperationAction(ISD::FP_ROUND_INREG , MVT::f32 , Expand);
- setOperationAction(ISD::FREM , MVT::f32 , Expand);
- setOperationAction(ISD::FREM , MVT::f64 , Expand);
- setOperationAction(ISD::FREM , MVT::f80 , Expand);
- setOperationAction(ISD::FLT_ROUNDS_ , MVT::i32 , Custom);
-
- setOperationAction(ISD::CTPOP , MVT::i8 , Expand);
- setOperationAction(ISD::CTTZ , MVT::i8 , Custom);
- setOperationAction(ISD::CTLZ , MVT::i8 , Custom);
- setOperationAction(ISD::CTPOP , MVT::i16 , Expand);
- setOperationAction(ISD::CTTZ , MVT::i16 , Custom);
- setOperationAction(ISD::CTLZ , MVT::i16 , Custom);
- setOperationAction(ISD::CTPOP , MVT::i32 , Expand);
- setOperationAction(ISD::CTTZ , MVT::i32 , Custom);
- setOperationAction(ISD::CTLZ , MVT::i32 , Custom);
- if (Subtarget->is64Bit()) {
- setOperationAction(ISD::CTPOP , MVT::i64 , Expand);
- setOperationAction(ISD::CTTZ , MVT::i64 , Custom);
- setOperationAction(ISD::CTLZ , MVT::i64 , Custom);
- }
-
- setOperationAction(ISD::READCYCLECOUNTER , MVT::i64 , Custom);
- setOperationAction(ISD::BSWAP , MVT::i16 , Expand);
-
- // These should be promoted to a larger select which is supported.
- setOperationAction(ISD::SELECT , MVT::i1 , Promote);
- setOperationAction(ISD::SELECT , MVT::i8 , Promote);
- // X86 wants to expand cmov itself.
- setOperationAction(ISD::SELECT , MVT::i16 , Custom);
- setOperationAction(ISD::SELECT , MVT::i32 , Custom);
- setOperationAction(ISD::SELECT , MVT::f32 , Custom);
- setOperationAction(ISD::SELECT , MVT::f64 , Custom);
- setOperationAction(ISD::SELECT , MVT::f80 , Custom);
- setOperationAction(ISD::SETCC , MVT::i8 , Custom);
- setOperationAction(ISD::SETCC , MVT::i16 , Custom);
- setOperationAction(ISD::SETCC , MVT::i32 , Custom);
- setOperationAction(ISD::SETCC , MVT::f32 , Custom);
- setOperationAction(ISD::SETCC , MVT::f64 , Custom);
- setOperationAction(ISD::SETCC , MVT::f80 , Custom);
- if (Subtarget->is64Bit()) {
- setOperationAction(ISD::SELECT , MVT::i64 , Custom);
- setOperationAction(ISD::SETCC , MVT::i64 , Custom);
- }
- // X86 ret instruction may pop stack.
- setOperationAction(ISD::RET , MVT::Other, Custom);
- if (!Subtarget->is64Bit())
- setOperationAction(ISD::EH_RETURN , MVT::Other, Custom);
-
- // Darwin ABI issue.
- setOperationAction(ISD::ConstantPool , MVT::i32 , Custom);
- setOperationAction(ISD::JumpTable , MVT::i32 , Custom);
- setOperationAction(ISD::GlobalAddress , MVT::i32 , Custom);
- setOperationAction(ISD::GlobalTLSAddress, MVT::i32 , Custom);
- if (Subtarget->is64Bit())
- setOperationAction(ISD::GlobalTLSAddress, MVT::i64, Custom);
- setOperationAction(ISD::ExternalSymbol , MVT::i32 , Custom);
- if (Subtarget->is64Bit()) {
- setOperationAction(ISD::ConstantPool , MVT::i64 , Custom);
- setOperationAction(ISD::JumpTable , MVT::i64 , Custom);
- setOperationAction(ISD::GlobalAddress , MVT::i64 , Custom);
- setOperationAction(ISD::ExternalSymbol, MVT::i64 , Custom);
- }
- // 64-bit addm sub, shl, sra, srl (iff 32-bit x86)
- setOperationAction(ISD::SHL_PARTS , MVT::i32 , Custom);
- setOperationAction(ISD::SRA_PARTS , MVT::i32 , Custom);
- setOperationAction(ISD::SRL_PARTS , MVT::i32 , Custom);
- if (Subtarget->is64Bit()) {
- setOperationAction(ISD::SHL_PARTS , MVT::i64 , Custom);
- setOperationAction(ISD::SRA_PARTS , MVT::i64 , Custom);
- setOperationAction(ISD::SRL_PARTS , MVT::i64 , Custom);
- }
-
- if (Subtarget->hasSSE1())
- setOperationAction(ISD::PREFETCH , MVT::Other, Legal);
-
- if (!Subtarget->hasSSE2())
- setOperationAction(ISD::MEMBARRIER , MVT::Other, Expand);
-
- // Expand certain atomics
- setOperationAction(ISD::ATOMIC_LCS , MVT::i8, Custom);
- setOperationAction(ISD::ATOMIC_LCS , MVT::i16, Custom);
- setOperationAction(ISD::ATOMIC_LCS , MVT::i32, Custom);
- setOperationAction(ISD::ATOMIC_LCS , MVT::i64, Custom);
- setOperationAction(ISD::ATOMIC_LSS , MVT::i32, Expand);
-
- // Use the default ISD::LOCATION, ISD::DECLARE expansion.
- setOperationAction(ISD::LOCATION, MVT::Other, Expand);
- // FIXME - use subtarget debug flags
- if (!Subtarget->isTargetDarwin() &&
- !Subtarget->isTargetELF() &&
- !Subtarget->isTargetCygMing())
- setOperationAction(ISD::LABEL, MVT::Other, Expand);
-
- setOperationAction(ISD::EXCEPTIONADDR, MVT::i64, Expand);
- setOperationAction(ISD::EHSELECTION, MVT::i64, Expand);
- setOperationAction(ISD::EXCEPTIONADDR, MVT::i32, Expand);
- setOperationAction(ISD::EHSELECTION, MVT::i32, Expand);
- if (Subtarget->is64Bit()) {
- // FIXME: Verify
- setExceptionPointerRegister(X86::RAX);
- setExceptionSelectorRegister(X86::RDX);
- } else {
- setExceptionPointerRegister(X86::EAX);
- setExceptionSelectorRegister(X86::EDX);
- }
- setOperationAction(ISD::FRAME_TO_ARGS_OFFSET, MVT::i32, Custom);
-
- setOperationAction(ISD::TRAMPOLINE, MVT::Other, Custom);
-
- setOperationAction(ISD::TRAP, MVT::Other, Legal);
-
- // VASTART needs to be custom lowered to use the VarArgsFrameIndex
- setOperationAction(ISD::VASTART , MVT::Other, Custom);
- setOperationAction(ISD::VAEND , MVT::Other, Expand);
- if (Subtarget->is64Bit()) {
- setOperationAction(ISD::VAARG , MVT::Other, Custom);
- setOperationAction(ISD::VACOPY , MVT::Other, Custom);
- } else {
- setOperationAction(ISD::VAARG , MVT::Other, Expand);
- setOperationAction(ISD::VACOPY , MVT::Other, Expand);
- }
-
- setOperationAction(ISD::STACKSAVE, MVT::Other, Expand);
- setOperationAction(ISD::STACKRESTORE, MVT::Other, Expand);
- if (Subtarget->is64Bit())
- setOperationAction(ISD::DYNAMIC_STACKALLOC, MVT::i64, Expand);
- if (Subtarget->isTargetCygMing())
- setOperationAction(ISD::DYNAMIC_STACKALLOC, MVT::i32, Custom);
- else
- setOperationAction(ISD::DYNAMIC_STACKALLOC, MVT::i32, Expand);
-
- if (X86ScalarSSEf64) {
- // f32 and f64 use SSE.
- // Set up the FP register classes.
- addRegisterClass(MVT::f32, X86::FR32RegisterClass);
- addRegisterClass(MVT::f64, X86::FR64RegisterClass);
-
- // Use ANDPD to simulate FABS.
- setOperationAction(ISD::FABS , MVT::f64, Custom);
- setOperationAction(ISD::FABS , MVT::f32, Custom);
-
- // Use XORP to simulate FNEG.
- setOperationAction(ISD::FNEG , MVT::f64, Custom);
- setOperationAction(ISD::FNEG , MVT::f32, Custom);
-
- // Use ANDPD and ORPD to simulate FCOPYSIGN.
- setOperationAction(ISD::FCOPYSIGN, MVT::f64, Custom);
- setOperationAction(ISD::FCOPYSIGN, MVT::f32, Custom);
-
- // We don't support sin/cos/fmod
- setOperationAction(ISD::FSIN , MVT::f64, Expand);
- setOperationAction(ISD::FCOS , MVT::f64, Expand);
- setOperationAction(ISD::FSIN , MVT::f32, Expand);
- setOperationAction(ISD::FCOS , MVT::f32, Expand);
-
- // Expand FP immediates into loads from the stack, except for the special
- // cases we handle.
- addLegalFPImmediate(APFloat(+0.0)); // xorpd
- addLegalFPImmediate(APFloat(+0.0f)); // xorps
-
- // Floating truncations from f80 and extensions to f80 go through memory.
- // If optimizing, we lie about this though and handle it in
- // InstructionSelectPreprocess so that dagcombine2 can hack on these.
- if (Fast) {
- setConvertAction(MVT::f32, MVT::f80, Expand);
- setConvertAction(MVT::f64, MVT::f80, Expand);
- setConvertAction(MVT::f80, MVT::f32, Expand);
- setConvertAction(MVT::f80, MVT::f64, Expand);
- }
- } else if (X86ScalarSSEf32) {
- // Use SSE for f32, x87 for f64.
- // Set up the FP register classes.
- addRegisterClass(MVT::f32, X86::FR32RegisterClass);
- addRegisterClass(MVT::f64, X86::RFP64RegisterClass);
-
- // Use ANDPS to simulate FABS.
- setOperationAction(ISD::FABS , MVT::f32, Custom);
-
- // Use XORP to simulate FNEG.
- setOperationAction(ISD::FNEG , MVT::f32, Custom);
-
- setOperationAction(ISD::UNDEF, MVT::f64, Expand);
-
- // Use ANDPS and ORPS to simulate FCOPYSIGN.
- setOperationAction(ISD::FCOPYSIGN, MVT::f64, Expand);
- setOperationAction(ISD::FCOPYSIGN, MVT::f32, Custom);
-
- // We don't support sin/cos/fmod
- setOperationAction(ISD::FSIN , MVT::f32, Expand);
- setOperationAction(ISD::FCOS , MVT::f32, Expand);
-
- // Special cases we handle for FP constants.
- addLegalFPImmediate(APFloat(+0.0f)); // xorps
- addLegalFPImmediate(APFloat(+0.0)); // FLD0
- addLegalFPImmediate(APFloat(+1.0)); // FLD1
- addLegalFPImmediate(APFloat(-0.0)); // FLD0/FCHS
- addLegalFPImmediate(APFloat(-1.0)); // FLD1/FCHS
-
- // SSE <-> X87 conversions go through memory. If optimizing, we lie about
- // this though and handle it in InstructionSelectPreprocess so that
- // dagcombine2 can hack on these.
- if (Fast) {
- setConvertAction(MVT::f32, MVT::f64, Expand);
- setConvertAction(MVT::f32, MVT::f80, Expand);
- setConvertAction(MVT::f80, MVT::f32, Expand);
- setConvertAction(MVT::f64, MVT::f32, Expand);
- // And x87->x87 truncations also.
- setConvertAction(MVT::f80, MVT::f64, Expand);
- }
-
- if (!UnsafeFPMath) {
- setOperationAction(ISD::FSIN , MVT::f64 , Expand);
- setOperationAction(ISD::FCOS , MVT::f64 , Expand);
- }
- } else {
- // f32 and f64 in x87.
- // Set up the FP register classes.
- addRegisterClass(MVT::f64, X86::RFP64RegisterClass);
- addRegisterClass(MVT::f32, X86::RFP32RegisterClass);
-
- setOperationAction(ISD::UNDEF, MVT::f64, Expand);
- setOperationAction(ISD::UNDEF, MVT::f32, Expand);
- setOperationAction(ISD::FCOPYSIGN, MVT::f64, Expand);
- setOperationAction(ISD::FCOPYSIGN, MVT::f32, Expand);
-
- // Floating truncations go through memory. If optimizing, we lie about
- // this though and handle it in InstructionSelectPreprocess so that
- // dagcombine2 can hack on these.
- if (Fast) {
- setConvertAction(MVT::f80, MVT::f32, Expand);
- setConvertAction(MVT::f64, MVT::f32, Expand);
- setConvertAction(MVT::f80, MVT::f64, Expand);
- }
-
- if (!UnsafeFPMath) {
- setOperationAction(ISD::FSIN , MVT::f64 , Expand);
- setOperationAction(ISD::FCOS , MVT::f64 , Expand);
- }
- addLegalFPImmediate(APFloat(+0.0)); // FLD0
- addLegalFPImmediate(APFloat(+1.0)); // FLD1
- addLegalFPImmediate(APFloat(-0.0)); // FLD0/FCHS
- addLegalFPImmediate(APFloat(-1.0)); // FLD1/FCHS
- addLegalFPImmediate(APFloat(+0.0f)); // FLD0
- addLegalFPImmediate(APFloat(+1.0f)); // FLD1
- addLegalFPImmediate(APFloat(-0.0f)); // FLD0/FCHS
- addLegalFPImmediate(APFloat(-1.0f)); // FLD1/FCHS
- }
-
- // Long double always uses X87.
- addRegisterClass(MVT::f80, X86::RFP80RegisterClass);
- setOperationAction(ISD::UNDEF, MVT::f80, Expand);
- setOperationAction(ISD::FCOPYSIGN, MVT::f80, Expand);
- {
- APFloat TmpFlt(+0.0);
- TmpFlt.convert(APFloat::x87DoubleExtended, APFloat::rmNearestTiesToEven);
- addLegalFPImmediate(TmpFlt); // FLD0
- TmpFlt.changeSign();
- addLegalFPImmediate(TmpFlt); // FLD0/FCHS
- APFloat TmpFlt2(+1.0);
- TmpFlt2.convert(APFloat::x87DoubleExtended, APFloat::rmNearestTiesToEven);
- addLegalFPImmediate(TmpFlt2); // FLD1
- TmpFlt2.changeSign();
- addLegalFPImmediate(TmpFlt2); // FLD1/FCHS
- }
-
- if (!UnsafeFPMath) {
- setOperationAction(ISD::FSIN , MVT::f80 , Expand);
- setOperationAction(ISD::FCOS , MVT::f80 , Expand);
- }
-
- // Always use a library call for pow.
- setOperationAction(ISD::FPOW , MVT::f32 , Expand);
- setOperationAction(ISD::FPOW , MVT::f64 , Expand);
- setOperationAction(ISD::FPOW , MVT::f80 , Expand);
-
- // First set operation action for all vector types to expand. Then we
- // will selectively turn on ones that can be effectively codegen'd.
- for (unsigned VT = (unsigned)MVT::FIRST_VECTOR_VALUETYPE;
- VT <= (unsigned)MVT::LAST_VECTOR_VALUETYPE; ++VT) {
- setOperationAction(ISD::ADD , (MVT::ValueType)VT, Expand);
- setOperationAction(ISD::SUB , (MVT::ValueType)VT, Expand);
- setOperationAction(ISD::FADD, (MVT::ValueType)VT, Expand);
- setOperationAction(ISD::FNEG, (MVT::ValueType)VT, Expand);
- setOperationAction(ISD::FSUB, (MVT::ValueType)VT, Expand);
- setOperationAction(ISD::MUL , (MVT::ValueType)VT, Expand);
- setOperationAction(ISD::FMUL, (MVT::ValueType)VT, Expand);
- setOperationAction(ISD::SDIV, (MVT::ValueType)VT, Expand);
- setOperationAction(ISD::UDIV, (MVT::ValueType)VT, Expand);
- setOperationAction(ISD::FDIV, (MVT::ValueType)VT, Expand);
- setOperationAction(ISD::SREM, (MVT::ValueType)VT, Expand);
- setOperationAction(ISD::UREM, (MVT::ValueType)VT, Expand);
- setOperationAction(ISD::LOAD, (MVT::ValueType)VT, Expand);
- setOperationAction(ISD::VECTOR_SHUFFLE, (MVT::ValueType)VT, Expand);
- setOperationAction(ISD::EXTRACT_VECTOR_ELT, (MVT::ValueType)VT, Expand);
- setOperationAction(ISD::INSERT_VECTOR_ELT, (MVT::ValueType)VT, Expand);
- setOperationAction(ISD::FABS, (MVT::ValueType)VT, Expand);
- setOperationAction(ISD::FSIN, (MVT::ValueType)VT, Expand);
- setOperationAction(ISD::FCOS, (MVT::ValueType)VT, Expand);
- setOperationAction(ISD::FREM, (MVT::ValueType)VT, Expand);
- setOperationAction(ISD::FPOWI, (MVT::ValueType)VT, Expand);
- setOperationAction(ISD::FSQRT, (MVT::ValueType)VT, Expand);
- setOperationAction(ISD::FCOPYSIGN, (MVT::ValueType)VT, Expand);
- setOperationAction(ISD::SMUL_LOHI, (MVT::ValueType)VT, Expand);
- setOperationAction(ISD::UMUL_LOHI, (MVT::ValueType)VT, Expand);
- setOperationAction(ISD::SDIVREM, (MVT::ValueType)VT, Expand);
- setOperationAction(ISD::UDIVREM, (MVT::ValueType)VT, Expand);
- setOperationAction(ISD::FPOW, (MVT::ValueType)VT, Expand);
- setOperationAction(ISD::CTPOP, (MVT::ValueType)VT, Expand);
- setOperationAction(ISD::CTTZ, (MVT::ValueType)VT, Expand);
- setOperationAction(ISD::CTLZ, (MVT::ValueType)VT, Expand);
- setOperationAction(ISD::SHL, (MVT::ValueType)VT, Expand);
- setOperationAction(ISD::SRA, (MVT::ValueType)VT, Expand);
- setOperationAction(ISD::SRL, (MVT::ValueType)VT, Expand);
- setOperationAction(ISD::ROTL, (MVT::ValueType)VT, Expand);
- setOperationAction(ISD::ROTR, (MVT::ValueType)VT, Expand);
- setOperationAction(ISD::BSWAP, (MVT::ValueType)VT, Expand);
- }
-
- if (Subtarget->hasMMX()) {
- addRegisterClass(MVT::v8i8, X86::VR64RegisterClass);
- addRegisterClass(MVT::v4i16, X86::VR64RegisterClass);
- addRegisterClass(MVT::v2i32, X86::VR64RegisterClass);
- addRegisterClass(MVT::v1i64, X86::VR64RegisterClass);
-
- // FIXME: add MMX packed arithmetics
-
- setOperationAction(ISD::ADD, MVT::v8i8, Legal);
- setOperationAction(ISD::ADD, MVT::v4i16, Legal);
- setOperationAction(ISD::ADD, MVT::v2i32, Legal);
- setOperationAction(ISD::ADD, MVT::v1i64, Legal);
-
- setOperationAction(ISD::SUB, MVT::v8i8, Legal);
- setOperationAction(ISD::SUB, MVT::v4i16, Legal);
- setOperationAction(ISD::SUB, MVT::v2i32, Legal);
- setOperationAction(ISD::SUB, MVT::v1i64, Legal);
-
- setOperationAction(ISD::MULHS, MVT::v4i16, Legal);
- setOperationAction(ISD::MUL, MVT::v4i16, Legal);
-
- setOperationAction(ISD::AND, MVT::v8i8, Promote);
- AddPromotedToType (ISD::AND, MVT::v8i8, MVT::v1i64);
- setOperationAction(ISD::AND, MVT::v4i16, Promote);
- AddPromotedToType (ISD::AND, MVT::v4i16, MVT::v1i64);
- setOperationAction(ISD::AND, MVT::v2i32, Promote);
- AddPromotedToType (ISD::AND, MVT::v2i32, MVT::v1i64);
- setOperationAction(ISD::AND, MVT::v1i64, Legal);
-
- setOperationAction(ISD::OR, MVT::v8i8, Promote);
- AddPromotedToType (ISD::OR, MVT::v8i8, MVT::v1i64);
- setOperationAction(ISD::OR, MVT::v4i16, Promote);
- AddPromotedToType (ISD::OR, MVT::v4i16, MVT::v1i64);
- setOperationAction(ISD::OR, MVT::v2i32, Promote);
- AddPromotedToType (ISD::OR, MVT::v2i32, MVT::v1i64);
- setOperationAction(ISD::OR, MVT::v1i64, Legal);
-
- setOperationAction(ISD::XOR, MVT::v8i8, Promote);
- AddPromotedToType (ISD::XOR, MVT::v8i8, MVT::v1i64);
- setOperationAction(ISD::XOR, MVT::v4i16, Promote);
- AddPromotedToType (ISD::XOR, MVT::v4i16, MVT::v1i64);
- setOperationAction(ISD::XOR, MVT::v2i32, Promote);
- AddPromotedToType (ISD::XOR, MVT::v2i32, MVT::v1i64);
- setOperationAction(ISD::XOR, MVT::v1i64, Legal);
-
- setOperationAction(ISD::LOAD, MVT::v8i8, Promote);
- AddPromotedToType (ISD::LOAD, MVT::v8i8, MVT::v1i64);
- setOperationAction(ISD::LOAD, MVT::v4i16, Promote);
- AddPromotedToType (ISD::LOAD, MVT::v4i16, MVT::v1i64);
- setOperationAction(ISD::LOAD, MVT::v2i32, Promote);
- AddPromotedToType (ISD::LOAD, MVT::v2i32, MVT::v1i64);
- setOperationAction(ISD::LOAD, MVT::v1i64, Legal);
-
- setOperationAction(ISD::BUILD_VECTOR, MVT::v8i8, Custom);
- setOperationAction(ISD::BUILD_VECTOR, MVT::v4i16, Custom);
- setOperationAction(ISD::BUILD_VECTOR, MVT::v2i32, Custom);
- setOperationAction(ISD::BUILD_VECTOR, MVT::v1i64, Custom);
-
- setOperationAction(ISD::VECTOR_SHUFFLE, MVT::v8i8, Custom);
- setOperationAction(ISD::VECTOR_SHUFFLE, MVT::v4i16, Custom);
- setOperationAction(ISD::VECTOR_SHUFFLE, MVT::v2i32, Custom);
- setOperationAction(ISD::VECTOR_SHUFFLE, MVT::v1i64, Custom);
-
- setOperationAction(ISD::SCALAR_TO_VECTOR, MVT::v8i8, Custom);
- setOperationAction(ISD::SCALAR_TO_VECTOR, MVT::v4i16, Custom);
- setOperationAction(ISD::SCALAR_TO_VECTOR, MVT::v1i64, Custom);
- }
-
- if (Subtarget->hasSSE1()) {
- addRegisterClass(MVT::v4f32, X86::VR128RegisterClass);
-
- setOperationAction(ISD::FADD, MVT::v4f32, Legal);
- setOperationAction(ISD::FSUB, MVT::v4f32, Legal);
- setOperationAction(ISD::FMUL, MVT::v4f32, Legal);
- setOperationAction(ISD::FDIV, MVT::v4f32, Legal);
- setOperationAction(ISD::FSQRT, MVT::v4f32, Legal);
- setOperationAction(ISD::FNEG, MVT::v4f32, Custom);
- setOperationAction(ISD::LOAD, MVT::v4f32, Legal);
- setOperationAction(ISD::BUILD_VECTOR, MVT::v4f32, Custom);
- setOperationAction(ISD::VECTOR_SHUFFLE, MVT::v4f32, Custom);
- setOperationAction(ISD::EXTRACT_VECTOR_ELT, MVT::v4f32, Custom);
- setOperationAction(ISD::SELECT, MVT::v4f32, Custom);
- }
-
- if (Subtarget->hasSSE2()) {
- addRegisterClass(MVT::v2f64, X86::VR128RegisterClass);
- addRegisterClass(MVT::v16i8, X86::VR128RegisterClass);
- addRegisterClass(MVT::v8i16, X86::VR128RegisterClass);
- addRegisterClass(MVT::v4i32, X86::VR128RegisterClass);
- addRegisterClass(MVT::v2i64, X86::VR128RegisterClass);
-
- setOperationAction(ISD::ADD, MVT::v16i8, Legal);
- setOperationAction(ISD::ADD, MVT::v8i16, Legal);
- setOperationAction(ISD::ADD, MVT::v4i32, Legal);
- setOperationAction(ISD::ADD, MVT::v2i64, Legal);
- setOperationAction(ISD::SUB, MVT::v16i8, Legal);
- setOperationAction(ISD::SUB, MVT::v8i16, Legal);
- setOperationAction(ISD::SUB, MVT::v4i32, Legal);
- setOperationAction(ISD::SUB, MVT::v2i64, Legal);
- setOperationAction(ISD::MUL, MVT::v8i16, Legal);
- setOperationAction(ISD::FADD, MVT::v2f64, Legal);
- setOperationAction(ISD::FSUB, MVT::v2f64, Legal);
- setOperationAction(ISD::FMUL, MVT::v2f64, Legal);
- setOperationAction(ISD::FDIV, MVT::v2f64, Legal);
- setOperationAction(ISD::FSQRT, MVT::v2f64, Legal);
- setOperationAction(ISD::FNEG, MVT::v2f64, Custom);
-
- setOperationAction(ISD::SCALAR_TO_VECTOR, MVT::v16i8, Custom);
- setOperationAction(ISD::SCALAR_TO_VECTOR, MVT::v8i16, Custom);
- setOperationAction(ISD::INSERT_VECTOR_ELT, MVT::v8i16, Custom);
- setOperationAction(ISD::INSERT_VECTOR_ELT, MVT::v4i32, Custom);
- setOperationAction(ISD::INSERT_VECTOR_ELT, MVT::v4f32, Custom);
-
- // Custom lower build_vector, vector_shuffle, and extract_vector_elt.
- for (unsigned VT = (unsigned)MVT::v16i8; VT != (unsigned)MVT::v2i64; VT++) {
- // Do not attempt to custom lower non-power-of-2 vectors
- if (!isPowerOf2_32(MVT::getVectorNumElements(VT)))
- continue;
- setOperationAction(ISD::BUILD_VECTOR, (MVT::ValueType)VT, Custom);
- setOperationAction(ISD::VECTOR_SHUFFLE, (MVT::ValueType)VT, Custom);
- setOperationAction(ISD::EXTRACT_VECTOR_ELT, (MVT::ValueType)VT, Custom);
- }
- setOperationAction(ISD::BUILD_VECTOR, MVT::v2f64, Custom);
- setOperationAction(ISD::BUILD_VECTOR, MVT::v2i64, Custom);
- setOperationAction(ISD::VECTOR_SHUFFLE, MVT::v2f64, Custom);
- setOperationAction(ISD::VECTOR_SHUFFLE, MVT::v2i64, Custom);
- setOperationAction(ISD::INSERT_VECTOR_ELT, MVT::v2f64, Custom);
- setOperationAction(ISD::EXTRACT_VECTOR_ELT, MVT::v2f64, Custom);
- if (Subtarget->is64Bit()) {
- setOperationAction(ISD::INSERT_VECTOR_ELT, MVT::v2i64, Custom);
- setOperationAction(ISD::EXTRACT_VECTOR_ELT, MVT::v2i64, Custom);
- }
-
- // Promote v16i8, v8i16, v4i32 load, select, and, or, xor to v2i64.
- for (unsigned VT = (unsigned)MVT::v16i8; VT != (unsigned)MVT::v2i64; VT++) {
- setOperationAction(ISD::AND, (MVT::ValueType)VT, Promote);
- AddPromotedToType (ISD::AND, (MVT::ValueType)VT, MVT::v2i64);
- setOperationAction(ISD::OR, (MVT::ValueType)VT, Promote);
- AddPromotedToType (ISD::OR, (MVT::ValueType)VT, MVT::v2i64);
- setOperationAction(ISD::XOR, (MVT::ValueType)VT, Promote);
- AddPromotedToType (ISD::XOR, (MVT::ValueType)VT, MVT::v2i64);
- setOperationAction(ISD::LOAD, (MVT::ValueType)VT, Promote);
- AddPromotedToType (ISD::LOAD, (MVT::ValueType)VT, MVT::v2i64);
- setOperationAction(ISD::SELECT, (MVT::ValueType)VT, Promote);
- AddPromotedToType (ISD::SELECT, (MVT::ValueType)VT, MVT::v2i64);
- }
-
- setTruncStoreAction(MVT::f64, MVT::f32, Expand);
-
- // Custom lower v2i64 and v2f64 selects.
- setOperationAction(ISD::LOAD, MVT::v2f64, Legal);
- setOperationAction(ISD::LOAD, MVT::v2i64, Legal);
- setOperationAction(ISD::SELECT, MVT::v2f64, Custom);
- setOperationAction(ISD::SELECT, MVT::v2i64, Custom);
- }
-
- if (Subtarget->hasSSE41()) {
- // FIXME: Do we need to handle scalar-to-vector here?
- setOperationAction(ISD::MUL, MVT::v4i32, Legal);
-
- // i8 and i16 vectors are custom , because the source register and source
- // source memory operand types are not the same width. f32 vectors are
- // custom since the immediate controlling the insert encodes additional
- // information.
- setOperationAction(ISD::INSERT_VECTOR_ELT, MVT::v16i8, Custom);
- setOperationAction(ISD::INSERT_VECTOR_ELT, MVT::v8i16, Custom);
- setOperationAction(ISD::INSERT_VECTOR_ELT, MVT::v4i32, Legal);
- setOperationAction(ISD::INSERT_VECTOR_ELT, MVT::v4f32, Custom);
-
- setOperationAction(ISD::EXTRACT_VECTOR_ELT, MVT::v16i8, Custom);
- setOperationAction(ISD::EXTRACT_VECTOR_ELT, MVT::v8i16, Custom);
- setOperationAction(ISD::EXTRACT_VECTOR_ELT, MVT::v4i32, Legal);
- setOperationAction(ISD::EXTRACT_VECTOR_ELT, MVT::v4f32, Custom);
-
- if (Subtarget->is64Bit()) {
- setOperationAction(ISD::INSERT_VECTOR_ELT, MVT::v2i64, Legal);
- setOperationAction(ISD::EXTRACT_VECTOR_ELT, MVT::v2i64, Legal);
- }
- }
-
- // We want to custom lower some of our intrinsics.
- setOperationAction(ISD::INTRINSIC_WO_CHAIN, MVT::Other, Custom);
-
- // We have target-specific dag combine patterns for the following nodes:
- setTargetDAGCombine(ISD::VECTOR_SHUFFLE);
- setTargetDAGCombine(ISD::BUILD_VECTOR);
- setTargetDAGCombine(ISD::SELECT);
- setTargetDAGCombine(ISD::STORE);
-
- computeRegisterProperties();
-
- // FIXME: These should be based on subtarget info. Plus, the values should
- // be smaller when we are in optimizing for size mode.
- maxStoresPerMemset = 16; // For %llvm.memset -> sequence of stores
- maxStoresPerMemcpy = 16; // For %llvm.memcpy -> sequence of stores
- maxStoresPerMemmove = 16; // For %llvm.memmove -> sequence of stores
- allowUnalignedMemoryAccesses = true; // x86 supports it!
- setPrefLoopAlignment(16);
-}
-
-
-MVT::ValueType
-X86TargetLowering::getSetCCResultType(const SDOperand &) const {
- return MVT::i8;
-}
-
-
-/// getMaxByValAlign - Helper for getByValTypeAlignment to determine
-/// the desired ByVal argument alignment.
-static void getMaxByValAlign(const Type *Ty, unsigned &MaxAlign) {
- if (MaxAlign == 16)
- return;
- if (const VectorType *VTy = dyn_cast<VectorType>(Ty)) {
- if (VTy->getBitWidth() == 128)
- MaxAlign = 16;
- } else if (const ArrayType *ATy = dyn_cast<ArrayType>(Ty)) {
- unsigned EltAlign = 0;
- getMaxByValAlign(ATy->getElementType(), EltAlign);
- if (EltAlign > MaxAlign)
- MaxAlign = EltAlign;
- } else if (const StructType *STy = dyn_cast<StructType>(Ty)) {
- for (unsigned i = 0, e = STy->getNumElements(); i != e; ++i) {
- unsigned EltAlign = 0;
- getMaxByValAlign(STy->getElementType(i), EltAlign);
- if (EltAlign > MaxAlign)
- MaxAlign = EltAlign;
- if (MaxAlign == 16)
- break;
- }
- }
- return;
-}
-
-/// getByValTypeAlignment - Return the desired alignment for ByVal aggregate
-/// function arguments in the caller parameter area. For X86, aggregates
-/// that contain SSE vectors are placed at 16-byte boundaries while the rest
-/// are at 4-byte boundaries.
-unsigned X86TargetLowering::getByValTypeAlignment(const Type *Ty) const {
- if (Subtarget->is64Bit())
- return getTargetData()->getABITypeAlignment(Ty);
- unsigned Align = 4;
- if (Subtarget->hasSSE1())
- getMaxByValAlign(Ty, Align);
- return Align;
-}
-
-/// getPICJumpTableRelocaBase - Returns relocation base for the given PIC
-/// jumptable.
-SDOperand X86TargetLowering::getPICJumpTableRelocBase(SDOperand Table,
- SelectionDAG &DAG) const {
- if (usesGlobalOffsetTable())
- return DAG.getNode(ISD::GLOBAL_OFFSET_TABLE, getPointerTy());
- if (!Subtarget->isPICStyleRIPRel())
- return DAG.getNode(X86ISD::GlobalBaseReg, getPointerTy());
- return Table;
-}
-
-//===----------------------------------------------------------------------===//
-// Return Value Calling Convention Implementation
-//===----------------------------------------------------------------------===//
-
-#include "X86GenCallingConv.inc"
-
-/// LowerRET - Lower an ISD::RET node.
-SDOperand X86TargetLowering::LowerRET(SDOperand Op, SelectionDAG &DAG) {
- assert((Op.getNumOperands() & 1) == 1 && "ISD::RET should have odd # args");
-
- SmallVector<CCValAssign, 16> RVLocs;
- unsigned CC = DAG.getMachineFunction().getFunction()->getCallingConv();
- bool isVarArg = DAG.getMachineFunction().getFunction()->isVarArg();
- CCState CCInfo(CC, isVarArg, getTargetMachine(), RVLocs);
- CCInfo.AnalyzeReturn(Op.Val, RetCC_X86);
-
- // If this is the first return lowered for this function, add the regs to the
- // liveout set for the function.
- if (DAG.getMachineFunction().getRegInfo().liveout_empty()) {
- for (unsigned i = 0; i != RVLocs.size(); ++i)
- if (RVLocs[i].isRegLoc())
- DAG.getMachineFunction().getRegInfo().addLiveOut(RVLocs[i].getLocReg());
- }
- SDOperand Chain = Op.getOperand(0);
-
- // Handle tail call return.
- Chain = GetPossiblePreceedingTailCall(Chain, X86ISD::TAILCALL);
- if (Chain.getOpcode() == X86ISD::TAILCALL) {
- SDOperand TailCall = Chain;
- SDOperand TargetAddress = TailCall.getOperand(1);
- SDOperand StackAdjustment = TailCall.getOperand(2);
- assert(((TargetAddress.getOpcode() == ISD::Register &&
- (cast<RegisterSDNode>(TargetAddress)->getReg() == X86::ECX ||
- cast<RegisterSDNode>(TargetAddress)->getReg() == X86::R9)) ||
- TargetAddress.getOpcode() == ISD::TargetExternalSymbol ||
- TargetAddress.getOpcode() == ISD::TargetGlobalAddress) &&
- "Expecting an global address, external symbol, or register");
- assert(StackAdjustment.getOpcode() == ISD::Constant &&
- "Expecting a const value");
-
- SmallVector<SDOperand,8> Operands;
- Operands.push_back(Chain.getOperand(0));
- Operands.push_back(TargetAddress);
- Operands.push_back(StackAdjustment);
- // Copy registers used by the call. Last operand is a flag so it is not
- // copied.
- for (unsigned i=3; i < TailCall.getNumOperands()-1; i++) {
- Operands.push_back(Chain.getOperand(i));
- }
- return DAG.getNode(X86ISD::TC_RETURN, MVT::Other, &Operands[0],
- Operands.size());
- }
-
- // Regular return.
- SDOperand Flag;
-
- SmallVector<SDOperand, 6> RetOps;
- RetOps.push_back(Chain); // Operand #0 = Chain (updated below)
- // Operand #1 = Bytes To Pop
- RetOps.push_back(DAG.getConstant(getBytesToPopOnReturn(), MVT::i16));
-
- // Copy the result values into the output registers.
- for (unsigned i = 0; i != RVLocs.size(); ++i) {
- CCValAssign &VA = RVLocs[i];
- assert(VA.isRegLoc() && "Can only return in registers!");
- SDOperand ValToCopy = Op.getOperand(i*2+1);
-
- // Returns in ST0/ST1 are handled specially: these are pushed as operands to
- // the RET instruction and handled by the FP Stackifier.
- if (RVLocs[i].getLocReg() == X86::ST0 ||
- RVLocs[i].getLocReg() == X86::ST1) {
- // If this is a copy from an xmm register to ST(0), use an FPExtend to
- // change the value to the FP stack register class.
- if (isScalarFPTypeInSSEReg(RVLocs[i].getValVT()))
- ValToCopy = DAG.getNode(ISD::FP_EXTEND, MVT::f80, ValToCopy);
- RetOps.push_back(ValToCopy);
- // Don't emit a copytoreg.
- continue;
- }
-
- Chain = DAG.getCopyToReg(Chain, VA.getLocReg(), ValToCopy, Flag);
- Flag = Chain.getValue(1);
- }
-
- // The x86-64 ABI for returning structs by value requires that we copy
- // the sret argument into %rax for the return. We saved the argument into
- // a virtual register in the entry block, so now we copy the value out
- // and into %rax.
- if (Subtarget->is64Bit() &&
- DAG.getMachineFunction().getFunction()->hasStructRetAttr()) {
- MachineFunction &MF = DAG.getMachineFunction();
- X86MachineFunctionInfo *FuncInfo = MF.getInfo<X86MachineFunctionInfo>();
- unsigned Reg = FuncInfo->getSRetReturnReg();
- if (!Reg) {
- Reg = MF.getRegInfo().createVirtualRegister(getRegClassFor(MVT::i64));
- FuncInfo->setSRetReturnReg(Reg);
- }
- SDOperand Val = DAG.getCopyFromReg(Chain, Reg, getPointerTy());
-
- Chain = DAG.getCopyToReg(Chain, X86::RAX, Val, Flag);
- Flag = Chain.getValue(1);
- }
-
- RetOps[0] = Chain; // Update chain.
-
- // Add the flag if we have it.
- if (Flag.Val)
- RetOps.push_back(Flag);
-
- return DAG.getNode(X86ISD::RET_FLAG, MVT::Other, &RetOps[0], RetOps.size());
-}
-
-
-/// LowerCallResult - Lower the result values of an ISD::CALL into the
-/// appropriate copies out of appropriate physical registers. This assumes that
-/// Chain/InFlag are the input chain/flag to use, and that TheCall is the call
-/// being lowered. The returns a SDNode with the same number of values as the
-/// ISD::CALL.
-SDNode *X86TargetLowering::
-LowerCallResult(SDOperand Chain, SDOperand InFlag, SDNode *TheCall,
- unsigned CallingConv, SelectionDAG &DAG) {
-
- // Assign locations to each value returned by this call.
- SmallVector<CCValAssign, 16> RVLocs;
- bool isVarArg = cast<ConstantSDNode>(TheCall->getOperand(2))->getValue() != 0;
- CCState CCInfo(CallingConv, isVarArg, getTargetMachine(), RVLocs);
- CCInfo.AnalyzeCallResult(TheCall, RetCC_X86);
-
- SmallVector<SDOperand, 8> ResultVals;
-
- // Copy all of the result registers out of their specified physreg.
- for (unsigned i = 0; i != RVLocs.size(); ++i) {
- MVT::ValueType CopyVT = RVLocs[i].getValVT();
-
- // If this is a call to a function that returns an fp value on the floating
- // point stack, but where we prefer to use the value in xmm registers, copy
- // it out as F80 and use a truncate to move it from fp stack reg to xmm reg.
- if (RVLocs[i].getLocReg() == X86::ST0 &&
- isScalarFPTypeInSSEReg(RVLocs[i].getValVT())) {
- CopyVT = MVT::f80;
- }
-
- Chain = DAG.getCopyFromReg(Chain, RVLocs[i].getLocReg(),
- CopyVT, InFlag).getValue(1);
- SDOperand Val = Chain.getValue(0);
- InFlag = Chain.getValue(2);
-
- if (CopyVT != RVLocs[i].getValVT()) {
- // Round the F80 the right size, which also moves to the appropriate xmm
- // register.
- Val = DAG.getNode(ISD::FP_ROUND, RVLocs[i].getValVT(), Val,
- // This truncation won't change the value.
- DAG.getIntPtrConstant(1));
- }
-
- ResultVals.push_back(Val);
- }
-
- // Merge everything together with a MERGE_VALUES node.
- ResultVals.push_back(Chain);
- return DAG.getNode(ISD::MERGE_VALUES, TheCall->getVTList(),
- &ResultVals[0], ResultVals.size()).Val;
-}
-
-
-//===----------------------------------------------------------------------===//
-// C & StdCall & Fast Calling Convention implementation
-//===----------------------------------------------------------------------===//
-// StdCall calling convention seems to be standard for many Windows' API
-// routines and around. It differs from C calling convention just a little:
-// callee should clean up the stack, not caller. Symbols should be also
-// decorated in some fancy way :) It doesn't support any vector arguments.
-// For info on fast calling convention see Fast Calling Convention (tail call)
-// implementation LowerX86_32FastCCCallTo.
-
-/// AddLiveIn - This helper function adds the specified physical register to the
-/// MachineFunction as a live in value. It also creates a corresponding virtual
-/// register for it.
-static unsigned AddLiveIn(MachineFunction &MF, unsigned PReg,
- const TargetRegisterClass *RC) {
- assert(RC->contains(PReg) && "Not the correct regclass!");
- unsigned VReg = MF.getRegInfo().createVirtualRegister(RC);
- MF.getRegInfo().addLiveIn(PReg, VReg);
- return VReg;
-}
-
-/// CallIsStructReturn - Determines whether a CALL node uses struct return
-/// semantics.
-static bool CallIsStructReturn(SDOperand Op) {
- unsigned NumOps = (Op.getNumOperands() - 5) / 2;
- if (!NumOps)
- return false;
-
- return cast<ARG_FLAGSSDNode>(Op.getOperand(6))->getArgFlags().isSRet();
-}
-
-/// ArgsAreStructReturn - Determines whether a FORMAL_ARGUMENTS node uses struct
-/// return semantics.
-static bool ArgsAreStructReturn(SDOperand Op) {
- unsigned NumArgs = Op.Val->getNumValues() - 1;
- if (!NumArgs)
- return false;
-
- return cast<ARG_FLAGSSDNode>(Op.getOperand(3))->getArgFlags().isSRet();
-}
-
-/// IsCalleePop - Determines whether a CALL or FORMAL_ARGUMENTS node requires
-/// the callee to pop its own arguments. Callee pop is necessary to support tail
-/// calls.
-bool X86TargetLowering::IsCalleePop(SDOperand Op) {
- bool IsVarArg = cast<ConstantSDNode>(Op.getOperand(2))->getValue() != 0;
- if (IsVarArg)
- return false;
-
- switch (cast<ConstantSDNode>(Op.getOperand(1))->getValue()) {
- default:
- return false;
- case CallingConv::X86_StdCall:
- return !Subtarget->is64Bit();
- case CallingConv::X86_FastCall:
- return !Subtarget->is64Bit();
- case CallingConv::Fast:
- return PerformTailCallOpt;
- }
-}
-
-/// CCAssignFnForNode - Selects the correct CCAssignFn for a CALL or
-/// FORMAL_ARGUMENTS node.
-CCAssignFn *X86TargetLowering::CCAssignFnForNode(SDOperand Op) const {
- unsigned CC = cast<ConstantSDNode>(Op.getOperand(1))->getValue();
-
- if (Subtarget->is64Bit()) {
- if (Subtarget->isTargetWin64())
- return CC_X86_Win64_C;
- else {
- if (CC == CallingConv::Fast && PerformTailCallOpt)
- return CC_X86_64_TailCall;
- else
- return CC_X86_64_C;
- }
- }
-
- if (CC == CallingConv::X86_FastCall)
- return CC_X86_32_FastCall;
- else if (CC == CallingConv::Fast && PerformTailCallOpt)
- return CC_X86_32_TailCall;
- else
- return CC_X86_32_C;
-}
-
-/// NameDecorationForFORMAL_ARGUMENTS - Selects the appropriate decoration to
-/// apply to a MachineFunction containing a given FORMAL_ARGUMENTS node.
-NameDecorationStyle
-X86TargetLowering::NameDecorationForFORMAL_ARGUMENTS(SDOperand Op) {
- unsigned CC = cast<ConstantSDNode>(Op.getOperand(1))->getValue();
- if (CC == CallingConv::X86_FastCall)
- return FastCall;
- else if (CC == CallingConv::X86_StdCall)
- return StdCall;
- return None;
-}
-
-
-/// CallRequiresGOTInRegister - Check whether the call requires the GOT pointer
-/// in a register before calling.
-bool X86TargetLowering::CallRequiresGOTPtrInReg(bool Is64Bit, bool IsTailCall) {
- return !IsTailCall && !Is64Bit &&
- getTargetMachine().getRelocationModel() == Reloc::PIC_ &&
- Subtarget->isPICStyleGOT();
-}
-
-/// CallRequiresFnAddressInReg - Check whether the call requires the function
-/// address to be loaded in a register.
-bool
-X86TargetLowering::CallRequiresFnAddressInReg(bool Is64Bit, bool IsTailCall) {
- return !Is64Bit && IsTailCall &&
- getTargetMachine().getRelocationModel() == Reloc::PIC_ &&
- Subtarget->isPICStyleGOT();
-}
-
-/// CreateCopyOfByValArgument - Make a copy of an aggregate at address specified
-/// by "Src" to address "Dst" with size and alignment information specified by
-/// the specific parameter attribute. The copy will be passed as a byval
-/// function parameter.
-static SDOperand
-CreateCopyOfByValArgument(SDOperand Src, SDOperand Dst, SDOperand Chain,
- ISD::ArgFlagsTy Flags, SelectionDAG &DAG) {
- SDOperand SizeNode = DAG.getConstant(Flags.getByValSize(), MVT::i32);
- return DAG.getMemcpy(Chain, Dst, Src, SizeNode, Flags.getByValAlign(),
- /*AlwaysInline=*/true, NULL, 0, NULL, 0);
-}
-
-SDOperand X86TargetLowering::LowerMemArgument(SDOperand Op, SelectionDAG &DAG,
- const CCValAssign &VA,
- MachineFrameInfo *MFI,
- unsigned CC,
- SDOperand Root, unsigned i) {
- // Create the nodes corresponding to a load from this parameter slot.
- ISD::ArgFlagsTy Flags =
- cast<ARG_FLAGSSDNode>(Op.getOperand(3 + i))->getArgFlags();
- bool AlwaysUseMutable = (CC==CallingConv::Fast) && PerformTailCallOpt;
- bool isImmutable = !AlwaysUseMutable && !Flags.isByVal();
-
- // FIXME: For now, all byval parameter objects are marked mutable. This can be
- // changed with more analysis.
- // In case of tail call optimization mark all arguments mutable. Since they
- // could be overwritten by lowering of arguments in case of a tail call.
- int FI = MFI->CreateFixedObject(MVT::getSizeInBits(VA.getValVT())/8,
- VA.getLocMemOffset(), isImmutable);
- SDOperand FIN = DAG.getFrameIndex(FI, getPointerTy());
- if (Flags.isByVal())
- return FIN;
- return DAG.getLoad(VA.getValVT(), Root, FIN,
- PseudoSourceValue::getFixedStack(), FI);
-}
-
-SDOperand
-X86TargetLowering::LowerFORMAL_ARGUMENTS(SDOperand Op, SelectionDAG &DAG) {
- MachineFunction &MF = DAG.getMachineFunction();
- X86MachineFunctionInfo *FuncInfo = MF.getInfo<X86MachineFunctionInfo>();
-
- const Function* Fn = MF.getFunction();
- if (Fn->hasExternalLinkage() &&
- Subtarget->isTargetCygMing() &&
- Fn->getName() == "main")
- FuncInfo->setForceFramePointer(true);
-
- // Decorate the function name.
- FuncInfo->setDecorationStyle(NameDecorationForFORMAL_ARGUMENTS(Op));
-
- MachineFrameInfo *MFI = MF.getFrameInfo();
- SDOperand Root = Op.getOperand(0);
- bool isVarArg = cast<ConstantSDNode>(Op.getOperand(2))->getValue() != 0;
- unsigned CC = MF.getFunction()->getCallingConv();
- bool Is64Bit = Subtarget->is64Bit();
- bool IsWin64 = Subtarget->isTargetWin64();
-
- assert(!(isVarArg && CC == CallingConv::Fast) &&
- "Var args not supported with calling convention fastcc");
-
- // Assign locations to all of the incoming arguments.
- SmallVector<CCValAssign, 16> ArgLocs;
- CCState CCInfo(CC, isVarArg, getTargetMachine(), ArgLocs);
- CCInfo.AnalyzeFormalArguments(Op.Val, CCAssignFnForNode(Op));
-
- SmallVector<SDOperand, 8> ArgValues;
- unsigned LastVal = ~0U;
- for (unsigned i = 0, e = ArgLocs.size(); i != e; ++i) {
- CCValAssign &VA = ArgLocs[i];
- // TODO: If an arg is passed in two places (e.g. reg and stack), skip later
- // places.
- assert(VA.getValNo() != LastVal &&
- "Don't support value assigned to multiple locs yet");
- LastVal = VA.getValNo();
-
- if (VA.isRegLoc()) {
- MVT::ValueType RegVT = VA.getLocVT();
- TargetRegisterClass *RC;
- if (RegVT == MVT::i32)
- RC = X86::GR32RegisterClass;
- else if (Is64Bit && RegVT == MVT::i64)
- RC = X86::GR64RegisterClass;
- else if (RegVT == MVT::f32)
- RC = X86::FR32RegisterClass;
- else if (RegVT == MVT::f64)
- RC = X86::FR64RegisterClass;
- else if (MVT::isVector(RegVT) && MVT::getSizeInBits(RegVT) == 128)
- RC = X86::VR128RegisterClass;
- else if (MVT::isVector(RegVT)) {
- assert(MVT::getSizeInBits(RegVT) == 64);
- if (!Is64Bit)
- RC = X86::VR64RegisterClass; // MMX values are passed in MMXs.
- else {
- // Darwin calling convention passes MMX values in either GPRs or
- // XMMs in x86-64. Other targets pass them in memory.
- if (RegVT != MVT::v1i64 && Subtarget->hasSSE2()) {
- RC = X86::VR128RegisterClass; // MMX values are passed in XMMs.
- RegVT = MVT::v2i64;
- } else {
- RC = X86::GR64RegisterClass; // v1i64 values are passed in GPRs.
- RegVT = MVT::i64;
- }
- }
- } else {
- assert(0 && "Unknown argument type!");
- }
-
- unsigned Reg = AddLiveIn(DAG.getMachineFunction(), VA.getLocReg(), RC);
- SDOperand ArgValue = DAG.getCopyFromReg(Root, Reg, RegVT);
-
- // If this is an 8 or 16-bit value, it is really passed promoted to 32
- // bits. Insert an assert[sz]ext to capture this, then truncate to the
- // right size.
- if (VA.getLocInfo() == CCValAssign::SExt)
- ArgValue = DAG.getNode(ISD::AssertSext, RegVT, ArgValue,
- DAG.getValueType(VA.getValVT()));
- else if (VA.getLocInfo() == CCValAssign::ZExt)
- ArgValue = DAG.getNode(ISD::AssertZext, RegVT, ArgValue,
- DAG.getValueType(VA.getValVT()));
-
- if (VA.getLocInfo() != CCValAssign::Full)
- ArgValue = DAG.getNode(ISD::TRUNCATE, VA.getValVT(), ArgValue);
-
- // Handle MMX values passed in GPRs.
- if (Is64Bit && RegVT != VA.getLocVT()) {
- if (MVT::getSizeInBits(RegVT) == 64 && RC == X86::GR64RegisterClass)
- ArgValue = DAG.getNode(ISD::BIT_CONVERT, VA.getLocVT(), ArgValue);
- else if (RC == X86::VR128RegisterClass) {
- ArgValue = DAG.getNode(ISD::EXTRACT_VECTOR_ELT, MVT::i64, ArgValue,
- DAG.getConstant(0, MVT::i64));
- ArgValue = DAG.getNode(ISD::BIT_CONVERT, VA.getLocVT(), ArgValue);
- }
- }
-
- ArgValues.push_back(ArgValue);
- } else {
- assert(VA.isMemLoc());
- ArgValues.push_back(LowerMemArgument(Op, DAG, VA, MFI, CC, Root, i));
- }
- }
-
- // The x86-64 ABI for returning structs by value requires that we copy
- // the sret argument into %rax for the return. Save the argument into
- // a virtual register so that we can access it from the return points.
- if (Is64Bit && DAG.getMachineFunction().getFunction()->hasStructRetAttr()) {
- MachineFunction &MF = DAG.getMachineFunction();
- X86MachineFunctionInfo *FuncInfo = MF.getInfo<X86MachineFunctionInfo>();
- unsigned Reg = FuncInfo->getSRetReturnReg();
- if (!Reg) {
- Reg = MF.getRegInfo().createVirtualRegister(getRegClassFor(MVT::i64));
- FuncInfo->setSRetReturnReg(Reg);
- }
- SDOperand Copy = DAG.getCopyToReg(DAG.getEntryNode(), Reg, ArgValues[0]);
- Root = DAG.getNode(ISD::TokenFactor, MVT::Other, Copy, Root);
- }
-
- unsigned StackSize = CCInfo.getNextStackOffset();
- // align stack specially for tail calls
- if (CC == CallingConv::Fast)
- StackSize = GetAlignedArgumentStackSize(StackSize, DAG);
-
- // If the function takes variable number of arguments, make a frame index for
- // the start of the first vararg value... for expansion of llvm.va_start.
- if (isVarArg) {
- if (Is64Bit || CC != CallingConv::X86_FastCall) {
- VarArgsFrameIndex = MFI->CreateFixedObject(1, StackSize);
- }
- if (Is64Bit) {
- unsigned TotalNumIntRegs = 0, TotalNumXMMRegs = 0;
-
- // FIXME: We should really autogenerate these arrays
- static const unsigned GPR64ArgRegsWin64[] = {
- X86::RCX, X86::RDX, X86::R8, X86::R9
- };
- static const unsigned XMMArgRegsWin64[] = {
- X86::XMM0, X86::XMM1, X86::XMM2, X86::XMM3
- };
- static const unsigned GPR64ArgRegs64Bit[] = {
- X86::RDI, X86::RSI, X86::RDX, X86::RCX, X86::R8, X86::R9
- };
- static const unsigned XMMArgRegs64Bit[] = {
- X86::XMM0, X86::XMM1, X86::XMM2, X86::XMM3,
- X86::XMM4, X86::XMM5, X86::XMM6, X86::XMM7
- };
- const unsigned *GPR64ArgRegs, *XMMArgRegs;
-
- if (IsWin64) {
- TotalNumIntRegs = 4; TotalNumXMMRegs = 4;
- GPR64ArgRegs = GPR64ArgRegsWin64;
- XMMArgRegs = XMMArgRegsWin64;
- } else {
- TotalNumIntRegs = 6; TotalNumXMMRegs = 8;
- GPR64ArgRegs = GPR64ArgRegs64Bit;
- XMMArgRegs = XMMArgRegs64Bit;
- }
- unsigned NumIntRegs = CCInfo.getFirstUnallocated(GPR64ArgRegs,
- TotalNumIntRegs);
- unsigned NumXMMRegs = CCInfo.getFirstUnallocated(XMMArgRegs,
- TotalNumXMMRegs);
-
- // For X86-64, if there are vararg parameters that are passed via
- // registers, then we must store them to their spots on the stack so they
- // may be loaded by deferencing the result of va_next.
- VarArgsGPOffset = NumIntRegs * 8;
- VarArgsFPOffset = TotalNumIntRegs * 8 + NumXMMRegs * 16;
- RegSaveFrameIndex = MFI->CreateStackObject(TotalNumIntRegs * 8 +
- TotalNumXMMRegs * 16, 16);
-
- // Store the integer parameter registers.
- SmallVector<SDOperand, 8> MemOps;
- SDOperand RSFIN = DAG.getFrameIndex(RegSaveFrameIndex, getPointerTy());
- SDOperand FIN = DAG.getNode(ISD::ADD, getPointerTy(), RSFIN,
- DAG.getIntPtrConstant(VarArgsGPOffset));
- for (; NumIntRegs != TotalNumIntRegs; ++NumIntRegs) {
- unsigned VReg = AddLiveIn(MF, GPR64ArgRegs[NumIntRegs],
- X86::GR64RegisterClass);
- SDOperand Val = DAG.getCopyFromReg(Root, VReg, MVT::i64);
- SDOperand Store =
- DAG.getStore(Val.getValue(1), Val, FIN,
- PseudoSourceValue::getFixedStack(),
- RegSaveFrameIndex);
- MemOps.push_back(Store);
- FIN = DAG.getNode(ISD::ADD, getPointerTy(), FIN,
- DAG.getIntPtrConstant(8));
- }
-
- // Now store the XMM (fp + vector) parameter registers.
- FIN = DAG.getNode(ISD::ADD, getPointerTy(), RSFIN,
- DAG.getIntPtrConstant(VarArgsFPOffset));
- for (; NumXMMRegs != TotalNumXMMRegs; ++NumXMMRegs) {
- unsigned VReg = AddLiveIn(MF, XMMArgRegs[NumXMMRegs],
- X86::VR128RegisterClass);
- SDOperand Val = DAG.getCopyFromReg(Root, VReg, MVT::v4f32);
- SDOperand Store =
- DAG.getStore(Val.getValue(1), Val, FIN,
- PseudoSourceValue::getFixedStack(),
- RegSaveFrameIndex);
- MemOps.push_back(Store);
- FIN = DAG.getNode(ISD::ADD, getPointerTy(), FIN,
- DAG.getIntPtrConstant(16));
- }
- if (!MemOps.empty())
- Root = DAG.getNode(ISD::TokenFactor, MVT::Other,
- &MemOps[0], MemOps.size());
- }
- }
-
- // Make sure the instruction takes 8n+4 bytes to make sure the start of the
- // arguments and the arguments after the retaddr has been pushed are
- // aligned.
- if (!Is64Bit && CC == CallingConv::X86_FastCall &&
- !Subtarget->isTargetCygMing() && !Subtarget->isTargetWindows() &&
- (StackSize & 7) == 0)
- StackSize += 4;
-
- ArgValues.push_back(Root);
-
- // Some CCs need callee pop.
- if (IsCalleePop(Op)) {
- BytesToPopOnReturn = StackSize; // Callee pops everything.
- BytesCallerReserves = 0;
- } else {
- BytesToPopOnReturn = 0; // Callee pops nothing.
- // If this is an sret function, the return should pop the hidden pointer.
- if (!Is64Bit && ArgsAreStructReturn(Op))
- BytesToPopOnReturn = 4;
- BytesCallerReserves = StackSize;
- }
-
- if (!Is64Bit) {
- RegSaveFrameIndex = 0xAAAAAAA; // RegSaveFrameIndex is X86-64 only.
- if (CC == CallingConv::X86_FastCall)
- VarArgsFrameIndex = 0xAAAAAAA; // fastcc functions can't have varargs.
- }
-
- FuncInfo->setBytesToPopOnReturn(BytesToPopOnReturn);
-
- // Return the new list of results.
- return DAG.getNode(ISD::MERGE_VALUES, Op.Val->getVTList(),
- &ArgValues[0], ArgValues.size()).getValue(Op.ResNo);
-}
-
-SDOperand
-X86TargetLowering::LowerMemOpCallTo(SDOperand Op, SelectionDAG &DAG,
- const SDOperand &StackPtr,
- const CCValAssign &VA,
- SDOperand Chain,
- SDOperand Arg) {
- unsigned LocMemOffset = VA.getLocMemOffset();
- SDOperand PtrOff = DAG.getIntPtrConstant(LocMemOffset);
- PtrOff = DAG.getNode(ISD::ADD, getPointerTy(), StackPtr, PtrOff);
- ISD::ArgFlagsTy Flags =
- cast<ARG_FLAGSSDNode>(Op.getOperand(6+2*VA.getValNo()))->getArgFlags();
- if (Flags.isByVal()) {
- return CreateCopyOfByValArgument(Arg, PtrOff, Chain, Flags, DAG);
- }
- return DAG.getStore(Chain, Arg, PtrOff,
- PseudoSourceValue::getStack(), LocMemOffset);
-}
-
-/// EmitTailCallLoadRetAddr - Emit a load of return adress if tail call
-/// optimization is performed and it is required.
-SDOperand
-X86TargetLowering::EmitTailCallLoadRetAddr(SelectionDAG &DAG,
- SDOperand &OutRetAddr,
- SDOperand Chain,
- bool IsTailCall,
- bool Is64Bit,
- int FPDiff) {
- if (!IsTailCall || FPDiff==0) return Chain;
-
- // Adjust the Return address stack slot.
- MVT::ValueType VT = getPointerTy();
- OutRetAddr = getReturnAddressFrameIndex(DAG);
- // Load the "old" Return address.
- OutRetAddr = DAG.getLoad(VT, Chain,OutRetAddr, NULL, 0);
- return SDOperand(OutRetAddr.Val, 1);
-}
-
-/// EmitTailCallStoreRetAddr - Emit a store of the return adress if tail call
-/// optimization is performed and it is required (FPDiff!=0).
-static SDOperand
-EmitTailCallStoreRetAddr(SelectionDAG & DAG, MachineFunction &MF,
- SDOperand Chain, SDOperand RetAddrFrIdx,
- bool Is64Bit, int FPDiff) {
- // Store the return address to the appropriate stack slot.
- if (!FPDiff) return Chain;
- // Calculate the new stack slot for the return address.
- int SlotSize = Is64Bit ? 8 : 4;
- int NewReturnAddrFI =
- MF.getFrameInfo()->CreateFixedObject(SlotSize, FPDiff-SlotSize);
- MVT::ValueType VT = Is64Bit ? MVT::i64 : MVT::i32;
- SDOperand NewRetAddrFrIdx = DAG.getFrameIndex(NewReturnAddrFI, VT);
- Chain = DAG.getStore(Chain, RetAddrFrIdx, NewRetAddrFrIdx,
- PseudoSourceValue::getFixedStack(), NewReturnAddrFI);
- return Chain;
-}
-
-SDOperand X86TargetLowering::LowerCALL(SDOperand Op, SelectionDAG &DAG) {
- MachineFunction &MF = DAG.getMachineFunction();
- SDOperand Chain = Op.getOperand(0);
- unsigned CC = cast<ConstantSDNode>(Op.getOperand(1))->getValue();
- bool isVarArg = cast<ConstantSDNode>(Op.getOperand(2))->getValue() != 0;
- bool IsTailCall = cast<ConstantSDNode>(Op.getOperand(3))->getValue() != 0
- && CC == CallingConv::Fast && PerformTailCallOpt;
- SDOperand Callee = Op.getOperand(4);
- bool Is64Bit = Subtarget->is64Bit();
- bool IsStructRet = CallIsStructReturn(Op);
-
- assert(!(isVarArg && CC == CallingConv::Fast) &&
- "Var args not supported with calling convention fastcc");
-
- // Analyze operands of the call, assigning locations to each operand.
- SmallVector<CCValAssign, 16> ArgLocs;
- CCState CCInfo(CC, isVarArg, getTargetMachine(), ArgLocs);
- CCInfo.AnalyzeCallOperands(Op.Val, CCAssignFnForNode(Op));
-
- // Get a count of how many bytes are to be pushed on the stack.
- unsigned NumBytes = CCInfo.getNextStackOffset();
- if (CC == CallingConv::Fast)
- NumBytes = GetAlignedArgumentStackSize(NumBytes, DAG);
-
- // Make sure the instruction takes 8n+4 bytes to make sure the start of the
- // arguments and the arguments after the retaddr has been pushed are aligned.
- if (!Is64Bit && CC == CallingConv::X86_FastCall &&
- !Subtarget->isTargetCygMing() && !Subtarget->isTargetWindows() &&
- (NumBytes & 7) == 0)
- NumBytes += 4;
-
- int FPDiff = 0;
- if (IsTailCall) {
- // Lower arguments at fp - stackoffset + fpdiff.
- unsigned NumBytesCallerPushed =
- MF.getInfo<X86MachineFunctionInfo>()->getBytesToPopOnReturn();
- FPDiff = NumBytesCallerPushed - NumBytes;
-
- // Set the delta of movement of the returnaddr stackslot.
- // But only set if delta is greater than previous delta.
- if (FPDiff < (MF.getInfo<X86MachineFunctionInfo>()->getTCReturnAddrDelta()))
- MF.getInfo<X86MachineFunctionInfo>()->setTCReturnAddrDelta(FPDiff);
- }
-
- Chain = DAG.getCALLSEQ_START(Chain, DAG.getIntPtrConstant(NumBytes));
-
- SDOperand RetAddrFrIdx;
- // Load return adress for tail calls.
- Chain = EmitTailCallLoadRetAddr(DAG, RetAddrFrIdx, Chain, IsTailCall, Is64Bit,
- FPDiff);
-
- SmallVector<std::pair<unsigned, SDOperand>, 8> RegsToPass;
- SmallVector<SDOperand, 8> MemOpChains;
- SDOperand StackPtr;
-
- // Walk the register/memloc assignments, inserting copies/loads. In the case
- // of tail call optimization arguments are handle later.
- for (unsigned i = 0, e = ArgLocs.size(); i != e; ++i) {
- CCValAssign &VA = ArgLocs[i];
- SDOperand Arg = Op.getOperand(5+2*VA.getValNo());
- bool isByVal = cast<ARG_FLAGSSDNode>(Op.getOperand(6+2*VA.getValNo()))->
- getArgFlags().isByVal();
-
- // Promote the value if needed.
- switch (VA.getLocInfo()) {
- default: assert(0 && "Unknown loc info!");
- case CCValAssign::Full: break;
- case CCValAssign::SExt:
- Arg = DAG.getNode(ISD::SIGN_EXTEND, VA.getLocVT(), Arg);
- break;
- case CCValAssign::ZExt:
- Arg = DAG.getNode(ISD::ZERO_EXTEND, VA.getLocVT(), Arg);
- break;
- case CCValAssign::AExt:
- Arg = DAG.getNode(ISD::ANY_EXTEND, VA.getLocVT(), Arg);
- break;
- }
-
- if (VA.isRegLoc()) {
- if (Is64Bit) {
- MVT::ValueType RegVT = VA.getLocVT();
- if (MVT::isVector(RegVT) && MVT::getSizeInBits(RegVT) == 64)
- switch (VA.getLocReg()) {
- default:
- break;
- case X86::RDI: case X86::RSI: case X86::RDX: case X86::RCX:
- case X86::R8: {
- // Special case: passing MMX values in GPR registers.
- Arg = DAG.getNode(ISD::BIT_CONVERT, MVT::i64, Arg);
- break;
- }
- case X86::XMM0: case X86::XMM1: case X86::XMM2: case X86::XMM3:
- case X86::XMM4: case X86::XMM5: case X86::XMM6: case X86::XMM7: {
- // Special case: passing MMX values in XMM registers.
- Arg = DAG.getNode(ISD::BIT_CONVERT, MVT::i64, Arg);
- Arg = DAG.getNode(ISD::SCALAR_TO_VECTOR, MVT::v2i64, Arg);
- Arg = DAG.getNode(ISD::VECTOR_SHUFFLE, MVT::v2i64,
- DAG.getNode(ISD::UNDEF, MVT::v2i64), Arg,
- getMOVLMask(2, DAG));
- break;
- }
- }
- }
- RegsToPass.push_back(std::make_pair(VA.getLocReg(), Arg));
- } else {
- if (!IsTailCall || (IsTailCall && isByVal)) {
- assert(VA.isMemLoc());
- if (StackPtr.Val == 0)
- StackPtr = DAG.getCopyFromReg(Chain, X86StackPtr, getPointerTy());
-
- MemOpChains.push_back(LowerMemOpCallTo(Op, DAG, StackPtr, VA, Chain,
- Arg));
- }
- }
- }
-
- if (!MemOpChains.empty())
- Chain = DAG.getNode(ISD::TokenFactor, MVT::Other,
- &MemOpChains[0], MemOpChains.size());
-
- // Build a sequence of copy-to-reg nodes chained together with token chain
- // and flag operands which copy the outgoing args into registers.
- SDOperand InFlag;
- // Tail call byval lowering might overwrite argument registers so in case of
- // tail call optimization the copies to registers are lowered later.
- if (!IsTailCall)
- for (unsigned i = 0, e = RegsToPass.size(); i != e; ++i) {
- Chain = DAG.getCopyToReg(Chain, RegsToPass[i].first, RegsToPass[i].second,
- InFlag);
- InFlag = Chain.getValue(1);
- }
-
- // ELF / PIC requires GOT in the EBX register before function calls via PLT
- // GOT pointer.
- if (CallRequiresGOTPtrInReg(Is64Bit, IsTailCall)) {
- Chain = DAG.getCopyToReg(Chain, X86::EBX,
- DAG.getNode(X86ISD::GlobalBaseReg, getPointerTy()),
- InFlag);
- InFlag = Chain.getValue(1);
- }
- // If we are tail calling and generating PIC/GOT style code load the address
- // of the callee into ecx. The value in ecx is used as target of the tail
- // jump. This is done to circumvent the ebx/callee-saved problem for tail
- // calls on PIC/GOT architectures. Normally we would just put the address of
- // GOT into ebx and then call target@PLT. But for tail callss ebx would be
- // restored (since ebx is callee saved) before jumping to the target@PLT.
- if (CallRequiresFnAddressInReg(Is64Bit, IsTailCall)) {
- // Note: The actual moving to ecx is done further down.
- GlobalAddressSDNode *G = dyn_cast<GlobalAddressSDNode>(Callee);
- if (G && !G->getGlobal()->hasHiddenVisibility() &&
- !G->getGlobal()->hasProtectedVisibility())
- Callee = LowerGlobalAddress(Callee, DAG);
- else if (isa<ExternalSymbolSDNode>(Callee))
- Callee = LowerExternalSymbol(Callee,DAG);
- }
-
- if (Is64Bit && isVarArg) {
- // From AMD64 ABI document:
- // For calls that may call functions that use varargs or stdargs
- // (prototype-less calls or calls to functions containing ellipsis (...) in
- // the declaration) %al is used as hidden argument to specify the number
- // of SSE registers used. The contents of %al do not need to match exactly
- // the number of registers, but must be an ubound on the number of SSE
- // registers used and is in the range 0 - 8 inclusive.
-
- // FIXME: Verify this on Win64
- // Count the number of XMM registers allocated.
- static const unsigned XMMArgRegs[] = {
- X86::XMM0, X86::XMM1, X86::XMM2, X86::XMM3,
- X86::XMM4, X86::XMM5, X86::XMM6, X86::XMM7
- };
- unsigned NumXMMRegs = CCInfo.getFirstUnallocated(XMMArgRegs, 8);
-
- Chain = DAG.getCopyToReg(Chain, X86::AL,
- DAG.getConstant(NumXMMRegs, MVT::i8), InFlag);
- InFlag = Chain.getValue(1);
- }
-
-
- // For tail calls lower the arguments to the 'real' stack slot.
- if (IsTailCall) {
- SmallVector<SDOperand, 8> MemOpChains2;
- SDOperand FIN;
- int FI = 0;
- // Do not flag preceeding copytoreg stuff together with the following stuff.
- InFlag = SDOperand();
- for (unsigned i = 0, e = ArgLocs.size(); i != e; ++i) {
- CCValAssign &VA = ArgLocs[i];
- if (!VA.isRegLoc()) {
- assert(VA.isMemLoc());
- SDOperand Arg = Op.getOperand(5+2*VA.getValNo());
- SDOperand FlagsOp = Op.getOperand(6+2*VA.getValNo());
- ISD::ArgFlagsTy Flags =
- cast<ARG_FLAGSSDNode>(FlagsOp)->getArgFlags();
- // Create frame index.
- int32_t Offset = VA.getLocMemOffset()+FPDiff;
- uint32_t OpSize = (MVT::getSizeInBits(VA.getLocVT())+7)/8;
- FI = MF.getFrameInfo()->CreateFixedObject(OpSize, Offset);
- FIN = DAG.getFrameIndex(FI, getPointerTy());
-
- if (Flags.isByVal()) {
- // Copy relative to framepointer.
- SDOperand Source = DAG.getIntPtrConstant(VA.getLocMemOffset());
- if (StackPtr.Val == 0)
- StackPtr = DAG.getCopyFromReg(Chain, X86StackPtr, getPointerTy());
- Source = DAG.getNode(ISD::ADD, getPointerTy(), StackPtr, Source);
-
- MemOpChains2.push_back(CreateCopyOfByValArgument(Source, FIN, Chain,
- Flags, DAG));
- } else {
- // Store relative to framepointer.
- MemOpChains2.push_back(
- DAG.getStore(Chain, Arg, FIN,
- PseudoSourceValue::getFixedStack(), FI));
- }
- }
- }
-
- if (!MemOpChains2.empty())
- Chain = DAG.getNode(ISD::TokenFactor, MVT::Other,
- &MemOpChains2[0], MemOpChains2.size());
-
- // Copy arguments to their registers.
- for (unsigned i = 0, e = RegsToPass.size(); i != e; ++i) {
- Chain = DAG.getCopyToReg(Chain, RegsToPass[i].first, RegsToPass[i].second,
- InFlag);
- InFlag = Chain.getValue(1);
- }
- InFlag =SDOperand();
-
- // Store the return address to the appropriate stack slot.
- Chain = EmitTailCallStoreRetAddr(DAG, MF, Chain, RetAddrFrIdx, Is64Bit,
- FPDiff);
- }
-
- // If the callee is a GlobalAddress node (quite common, every direct call is)
- // turn it into a TargetGlobalAddress node so that legalize doesn't hack it.
- if (GlobalAddressSDNode *G = dyn_cast<GlobalAddressSDNode>(Callee)) {
- // We should use extra load for direct calls to dllimported functions in
- // non-JIT mode.
- if ((IsTailCall || !Is64Bit ||
- getTargetMachine().getCodeModel() != CodeModel::Large)
- && !Subtarget->GVRequiresExtraLoad(G->getGlobal(),
- getTargetMachine(), true))
- Callee = DAG.getTargetGlobalAddress(G->getGlobal(), getPointerTy());
- } else if (ExternalSymbolSDNode *S = dyn_cast<ExternalSymbolSDNode>(Callee)) {
- if (IsTailCall || !Is64Bit ||
- getTargetMachine().getCodeModel() != CodeModel::Large)
- Callee = DAG.getTargetExternalSymbol(S->getSymbol(), getPointerTy());
- } else if (IsTailCall) {
- unsigned Opc = Is64Bit ? X86::R9 : X86::ECX;
-
- Chain = DAG.getCopyToReg(Chain,
- DAG.getRegister(Opc, getPointerTy()),
- Callee,InFlag);
- Callee = DAG.getRegister(Opc, getPointerTy());
- // Add register as live out.
- DAG.getMachineFunction().getRegInfo().addLiveOut(Opc);
- }
-
- // Returns a chain & a flag for retval copy to use.
- SDVTList NodeTys = DAG.getVTList(MVT::Other, MVT::Flag);
- SmallVector<SDOperand, 8> Ops;
-
- if (IsTailCall) {
- Ops.push_back(Chain);
- Ops.push_back(DAG.getIntPtrConstant(NumBytes));
- Ops.push_back(DAG.getIntPtrConstant(0));
- if (InFlag.Val)
- Ops.push_back(InFlag);
- Chain = DAG.getNode(ISD::CALLSEQ_END, NodeTys, &Ops[0], Ops.size());
- InFlag = Chain.getValue(1);
-
- // Returns a chain & a flag for retval copy to use.
- NodeTys = DAG.getVTList(MVT::Other, MVT::Flag);
- Ops.clear();
- }
-
- Ops.push_back(Chain);
- Ops.push_back(Callee);
-
- if (IsTailCall)
- Ops.push_back(DAG.getConstant(FPDiff, MVT::i32));
-
- // Add argument registers to the end of the list so that they are known live
- // into the call.
- for (unsigned i = 0, e = RegsToPass.size(); i != e; ++i)
- Ops.push_back(DAG.getRegister(RegsToPass[i].first,
- RegsToPass[i].second.getValueType()));
-
- // Add an implicit use GOT pointer in EBX.
- if (!IsTailCall && !Is64Bit &&
- getTargetMachine().getRelocationModel() == Reloc::PIC_ &&
- Subtarget->isPICStyleGOT())
- Ops.push_back(DAG.getRegister(X86::EBX, getPointerTy()));
-
- // Add an implicit use of AL for x86 vararg functions.
- if (Is64Bit && isVarArg)
- Ops.push_back(DAG.getRegister(X86::AL, MVT::i8));
-
- if (InFlag.Val)
- Ops.push_back(InFlag);
-
- if (IsTailCall) {
- assert(InFlag.Val &&
- "Flag must be set. Depend on flag being set in LowerRET");
- Chain = DAG.getNode(X86ISD::TAILCALL,
- Op.Val->getVTList(), &Ops[0], Ops.size());
-
- return SDOperand(Chain.Val, Op.ResNo);
- }
-
- Chain = DAG.getNode(X86ISD::CALL, NodeTys, &Ops[0], Ops.size());
- InFlag = Chain.getValue(1);
-
- // Create the CALLSEQ_END node.
- unsigned NumBytesForCalleeToPush;
- if (IsCalleePop(Op))
- NumBytesForCalleeToPush = NumBytes; // Callee pops everything
- else if (!Is64Bit && IsStructRet)
- // If this is is a call to a struct-return function, the callee
- // pops the hidden struct pointer, so we have to push it back.
- // This is common for Darwin/X86, Linux & Mingw32 targets.
- NumBytesForCalleeToPush = 4;
- else
- NumBytesForCalleeToPush = 0; // Callee pops nothing.
-
- // Returns a flag for retval copy to use.
- Chain = DAG.getCALLSEQ_END(Chain,
- DAG.getIntPtrConstant(NumBytes),
- DAG.getIntPtrConstant(NumBytesForCalleeToPush),
- InFlag);
- InFlag = Chain.getValue(1);
-
- // Handle result values, copying them out of physregs into vregs that we
- // return.
- return SDOperand(LowerCallResult(Chain, InFlag, Op.Val, CC, DAG), Op.ResNo);
-}
-
-
-//===----------------------------------------------------------------------===//
-// Fast Calling Convention (tail call) implementation
-//===----------------------------------------------------------------------===//
-
-// Like std call, callee cleans arguments, convention except that ECX is
-// reserved for storing the tail called function address. Only 2 registers are
-// free for argument passing (inreg). Tail call optimization is performed
-// provided:
-// * tailcallopt is enabled
-// * caller/callee are fastcc
-// On X86_64 architecture with GOT-style position independent code only local
-// (within module) calls are supported at the moment.
-// To keep the stack aligned according to platform abi the function
-// GetAlignedArgumentStackSize ensures that argument delta is always multiples
-// of stack alignment. (Dynamic linkers need this - darwin's dyld for example)
-// If a tail called function callee has more arguments than the caller the
-// caller needs to make sure that there is room to move the RETADDR to. This is
-// achieved by reserving an area the size of the argument delta right after the
-// original REtADDR, but before the saved framepointer or the spilled registers
-// e.g. caller(arg1, arg2) calls callee(arg1, arg2,arg3,arg4)
-// stack layout:
-// arg1
-// arg2
-// RETADDR
-// [ new RETADDR
-// move area ]
-// (possible EBP)
-// ESI
-// EDI
-// local1 ..
-
-/// GetAlignedArgumentStackSize - Make the stack size align e.g 16n + 12 aligned
-/// for a 16 byte align requirement.
-unsigned X86TargetLowering::GetAlignedArgumentStackSize(unsigned StackSize,
- SelectionDAG& DAG) {
- if (PerformTailCallOpt) {
- MachineFunction &MF = DAG.getMachineFunction();
- const TargetMachine &TM = MF.getTarget();
- const TargetFrameInfo &TFI = *TM.getFrameInfo();
- unsigned StackAlignment = TFI.getStackAlignment();
- uint64_t AlignMask = StackAlignment - 1;
- int64_t Offset = StackSize;
- unsigned SlotSize = Subtarget->is64Bit() ? 8 : 4;
- if ( (Offset & AlignMask) <= (StackAlignment - SlotSize) ) {
- // Number smaller than 12 so just add the difference.
- Offset += ((StackAlignment - SlotSize) - (Offset & AlignMask));
- } else {
- // Mask out lower bits, add stackalignment once plus the 12 bytes.
- Offset = ((~AlignMask) & Offset) + StackAlignment +
- (StackAlignment-SlotSize);
- }
- StackSize = Offset;
- }
- return StackSize;
-}
-
-/// IsEligibleForTailCallElimination - Check to see whether the next instruction
-/// following the call is a return. A function is eligible if caller/callee
-/// calling conventions match, currently only fastcc supports tail calls, and
-/// the function CALL is immediatly followed by a RET.
-bool X86TargetLowering::IsEligibleForTailCallOptimization(SDOperand Call,
- SDOperand Ret,
- SelectionDAG& DAG) const {
- if (!PerformTailCallOpt)
- return false;
-
- if (CheckTailCallReturnConstraints(Call, Ret)) {
- MachineFunction &MF = DAG.getMachineFunction();
- unsigned CallerCC = MF.getFunction()->getCallingConv();
- unsigned CalleeCC = cast<ConstantSDNode>(Call.getOperand(1))->getValue();
- if (CalleeCC == CallingConv::Fast && CallerCC == CalleeCC) {
- SDOperand Callee = Call.getOperand(4);
- // On x86/32Bit PIC/GOT tail calls are supported.
- if (getTargetMachine().getRelocationModel() != Reloc::PIC_ ||
- !Subtarget->isPICStyleGOT()|| !Subtarget->is64Bit())
- return true;
-
- // Can only do local tail calls (in same module, hidden or protected) on
- // x86_64 PIC/GOT at the moment.
- if (GlobalAddressSDNode *G = dyn_cast<GlobalAddressSDNode>(Callee))
- return G->getGlobal()->hasHiddenVisibility()
- || G->getGlobal()->hasProtectedVisibility();
- }
- }
-
- return false;
-}
-
-//===----------------------------------------------------------------------===//
-// Other Lowering Hooks
-//===----------------------------------------------------------------------===//
-
-
-SDOperand X86TargetLowering::getReturnAddressFrameIndex(SelectionDAG &DAG) {
- MachineFunction &MF = DAG.getMachineFunction();
- X86MachineFunctionInfo *FuncInfo = MF.getInfo<X86MachineFunctionInfo>();
- int ReturnAddrIndex = FuncInfo->getRAIndex();
-
- if (ReturnAddrIndex == 0) {
- // Set up a frame object for the return address.
- if (Subtarget->is64Bit())
- ReturnAddrIndex = MF.getFrameInfo()->CreateFixedObject(8, -8);
- else
- ReturnAddrIndex = MF.getFrameInfo()->CreateFixedObject(4, -4);
-
- FuncInfo->setRAIndex(ReturnAddrIndex);
- }
-
- return DAG.getFrameIndex(ReturnAddrIndex, getPointerTy());
-}
-
-
-
-/// translateX86CC - do a one to one translation of a ISD::CondCode to the X86
-/// specific condition code. It returns a false if it cannot do a direct
-/// translation. X86CC is the translated CondCode. LHS/RHS are modified as
-/// needed.
-static bool translateX86CC(ISD::CondCode SetCCOpcode, bool isFP,
- unsigned &X86CC, SDOperand &LHS, SDOperand &RHS,
- SelectionDAG &DAG) {
- X86CC = X86::COND_INVALID;
- if (!isFP) {
- if (ConstantSDNode *RHSC = dyn_cast<ConstantSDNode>(RHS)) {
- if (SetCCOpcode == ISD::SETGT && RHSC->isAllOnesValue()) {
- // X > -1 -> X == 0, jump !sign.
- RHS = DAG.getConstant(0, RHS.getValueType());
- X86CC = X86::COND_NS;
- return true;
- } else if (SetCCOpcode == ISD::SETLT && RHSC->isNullValue()) {
- // X < 0 -> X == 0, jump on sign.
- X86CC = X86::COND_S;
- return true;
- } else if (SetCCOpcode == ISD::SETLT && RHSC->getValue() == 1) {
- // X < 1 -> X <= 0
- RHS = DAG.getConstant(0, RHS.getValueType());
- X86CC = X86::COND_LE;
- return true;
- }
- }
-
- switch (SetCCOpcode) {
- default: break;
- case ISD::SETEQ: X86CC = X86::COND_E; break;
- case ISD::SETGT: X86CC = X86::COND_G; break;
- case ISD::SETGE: X86CC = X86::COND_GE; break;
- case ISD::SETLT: X86CC = X86::COND_L; break;
- case ISD::SETLE: X86CC = X86::COND_LE; break;
- case ISD::SETNE: X86CC = X86::COND_NE; break;
- case ISD::SETULT: X86CC = X86::COND_B; break;
- case ISD::SETUGT: X86CC = X86::COND_A; break;
- case ISD::SETULE: X86CC = X86::COND_BE; break;
- case ISD::SETUGE: X86CC = X86::COND_AE; break;
- }
- } else {
- // On a floating point condition, the flags are set as follows:
- // ZF PF CF op
- // 0 | 0 | 0 | X > Y
- // 0 | 0 | 1 | X < Y
- // 1 | 0 | 0 | X == Y
- // 1 | 1 | 1 | unordered
- bool Flip = false;
- switch (SetCCOpcode) {
- default: break;
- case ISD::SETUEQ:
- case ISD::SETEQ: X86CC = X86::COND_E; break;
- case ISD::SETOLT: Flip = true; // Fallthrough
- case ISD::SETOGT:
- case ISD::SETGT: X86CC = X86::COND_A; break;
- case ISD::SETOLE: Flip = true; // Fallthrough
- case ISD::SETOGE:
- case ISD::SETGE: X86CC = X86::COND_AE; break;
- case ISD::SETUGT: Flip = true; // Fallthrough
- case ISD::SETULT:
- case ISD::SETLT: X86CC = X86::COND_B; break;
- case ISD::SETUGE: Flip = true; // Fallthrough
- case ISD::SETULE:
- case ISD::SETLE: X86CC = X86::COND_BE; break;
- case ISD::SETONE:
- case ISD::SETNE: X86CC = X86::COND_NE; break;
- case ISD::SETUO: X86CC = X86::COND_P; break;
- case ISD::SETO: X86CC = X86::COND_NP; break;
- }
- if (Flip)
- std::swap(LHS, RHS);
- }
-
- return X86CC != X86::COND_INVALID;
-}
-
-/// hasFPCMov - is there a floating point cmov for the specific X86 condition
-/// code. Current x86 isa includes the following FP cmov instructions:
-/// fcmovb, fcomvbe, fcomve, fcmovu, fcmovae, fcmova, fcmovne, fcmovnu.
-static bool hasFPCMov(unsigned X86CC) {
- switch (X86CC) {
- default:
- return false;
- case X86::COND_B:
- case X86::COND_BE:
- case X86::COND_E:
- case X86::COND_P:
- case X86::COND_A:
- case X86::COND_AE:
- case X86::COND_NE:
- case X86::COND_NP:
- return true;
- }
-}
-
-/// isUndefOrInRange - Op is either an undef node or a ConstantSDNode. Return
-/// true if Op is undef or if its value falls within the specified range (L, H].
-static bool isUndefOrInRange(SDOperand Op, unsigned Low, unsigned Hi) {
- if (Op.getOpcode() == ISD::UNDEF)
- return true;
-
- unsigned Val = cast<ConstantSDNode>(Op)->getValue();
- return (Val >= Low && Val < Hi);
-}
-
-/// isUndefOrEqual - Op is either an undef node or a ConstantSDNode. Return
-/// true if Op is undef or if its value equal to the specified value.
-static bool isUndefOrEqual(SDOperand Op, unsigned Val) {
- if (Op.getOpcode() == ISD::UNDEF)
- return true;
- return cast<ConstantSDNode>(Op)->getValue() == Val;
-}
-
-/// isPSHUFDMask - Return true if the specified VECTOR_SHUFFLE operand
-/// specifies a shuffle of elements that is suitable for input to PSHUFD.
-bool X86::isPSHUFDMask(SDNode *N) {
- assert(N->getOpcode() == ISD::BUILD_VECTOR);
-
- if (N->getNumOperands() != 2 && N->getNumOperands() != 4)
- return false;
-
- // Check if the value doesn't reference the second vector.
- for (unsigned i = 0, e = N->getNumOperands(); i != e; ++i) {
- SDOperand Arg = N->getOperand(i);
- if (Arg.getOpcode() == ISD::UNDEF) continue;
- assert(isa<ConstantSDNode>(Arg) && "Invalid VECTOR_SHUFFLE mask!");
- if (cast<ConstantSDNode>(Arg)->getValue() >= e)
- return false;
- }
-
- return true;
-}
-
-/// isPSHUFHWMask - Return true if the specified VECTOR_SHUFFLE operand
-/// specifies a shuffle of elements that is suitable for input to PSHUFHW.
-bool X86::isPSHUFHWMask(SDNode *N) {
- assert(N->getOpcode() == ISD::BUILD_VECTOR);
-
- if (N->getNumOperands() != 8)
- return false;
-
- // Lower quadword copied in order.
- for (unsigned i = 0; i != 4; ++i) {
- SDOperand Arg = N->getOperand(i);
- if (Arg.getOpcode() == ISD::UNDEF) continue;
- assert(isa<ConstantSDNode>(Arg) && "Invalid VECTOR_SHUFFLE mask!");
- if (cast<ConstantSDNode>(Arg)->getValue() != i)
- return false;
- }
-
- // Upper quadword shuffled.
- for (unsigned i = 4; i != 8; ++i) {
- SDOperand Arg = N->getOperand(i);
- if (Arg.getOpcode() == ISD::UNDEF) continue;
- assert(isa<ConstantSDNode>(Arg) && "Invalid VECTOR_SHUFFLE mask!");
- unsigned Val = cast<ConstantSDNode>(Arg)->getValue();
- if (Val < 4 || Val > 7)
- return false;
- }
-
- return true;
-}
-
-/// isPSHUFLWMask - Return true if the specified VECTOR_SHUFFLE operand
-/// specifies a shuffle of elements that is suitable for input to PSHUFLW.
-bool X86::isPSHUFLWMask(SDNode *N) {
- assert(N->getOpcode() == ISD::BUILD_VECTOR);
-
- if (N->getNumOperands() != 8)
- return false;
-
- // Upper quadword copied in order.
- for (unsigned i = 4; i != 8; ++i)
- if (!isUndefOrEqual(N->getOperand(i), i))
- return false;
-
- // Lower quadword shuffled.
- for (unsigned i = 0; i != 4; ++i)
- if (!isUndefOrInRange(N->getOperand(i), 0, 4))
- return false;
-
- return true;
-}
-
-/// isSHUFPMask - Return true if the specified VECTOR_SHUFFLE operand
-/// specifies a shuffle of elements that is suitable for input to SHUFP*.
-static bool isSHUFPMask(SDOperandPtr Elems, unsigned NumElems) {
- if (NumElems != 2 && NumElems != 4) return false;
-
- unsigned Half = NumElems / 2;
- for (unsigned i = 0; i < Half; ++i)
- if (!isUndefOrInRange(Elems[i], 0, NumElems))
- return false;
- for (unsigned i = Half; i < NumElems; ++i)
- if (!isUndefOrInRange(Elems[i], NumElems, NumElems*2))
- return false;
-
- return true;
-}
-
-bool X86::isSHUFPMask(SDNode *N) {
- assert(N->getOpcode() == ISD::BUILD_VECTOR);
- return ::isSHUFPMask(N->op_begin(), N->getNumOperands());
-}
-
-/// isCommutedSHUFP - Returns true if the shuffle mask is exactly
-/// the reverse of what x86 shuffles want. x86 shuffles requires the lower
-/// half elements to come from vector 1 (which would equal the dest.) and
-/// the upper half to come from vector 2.
-static bool isCommutedSHUFP(SDOperandPtr Ops, unsigned NumOps) {
- if (NumOps != 2 && NumOps != 4) return false;
-
- unsigned Half = NumOps / 2;
- for (unsigned i = 0; i < Half; ++i)
- if (!isUndefOrInRange(Ops[i], NumOps, NumOps*2))
- return false;
- for (unsigned i = Half; i < NumOps; ++i)
- if (!isUndefOrInRange(Ops[i], 0, NumOps))
- return false;
- return true;
-}
-
-static bool isCommutedSHUFP(SDNode *N) {
- assert(N->getOpcode() == ISD::BUILD_VECTOR);
- return isCommutedSHUFP(N->op_begin(), N->getNumOperands());
-}
-
-/// isMOVHLPSMask - Return true if the specified VECTOR_SHUFFLE operand
-/// specifies a shuffle of elements that is suitable for input to MOVHLPS.
-bool X86::isMOVHLPSMask(SDNode *N) {
- assert(N->getOpcode() == ISD::BUILD_VECTOR);
-
- if (N->getNumOperands() != 4)
- return false;
-
- // Expect bit0 == 6, bit1 == 7, bit2 == 2, bit3 == 3
- return isUndefOrEqual(N->getOperand(0), 6) &&
- isUndefOrEqual(N->getOperand(1), 7) &&
- isUndefOrEqual(N->getOperand(2), 2) &&
- isUndefOrEqual(N->getOperand(3), 3);
-}
-
-/// isMOVHLPS_v_undef_Mask - Special case of isMOVHLPSMask for canonical form
-/// of vector_shuffle v, v, <2, 3, 2, 3>, i.e. vector_shuffle v, undef,
-/// <2, 3, 2, 3>
-bool X86::isMOVHLPS_v_undef_Mask(SDNode *N) {
- assert(N->getOpcode() == ISD::BUILD_VECTOR);
-
- if (N->getNumOperands() != 4)
- return false;
-
- // Expect bit0 == 2, bit1 == 3, bit2 == 2, bit3 == 3
- return isUndefOrEqual(N->getOperand(0), 2) &&
- isUndefOrEqual(N->getOperand(1), 3) &&
- isUndefOrEqual(N->getOperand(2), 2) &&
- isUndefOrEqual(N->getOperand(3), 3);
-}
-
-/// isMOVLPMask - Return true if the specified VECTOR_SHUFFLE operand
-/// specifies a shuffle of elements that is suitable for input to MOVLP{S|D}.
-bool X86::isMOVLPMask(SDNode *N) {
- assert(N->getOpcode() == ISD::BUILD_VECTOR);
-
- unsigned NumElems = N->getNumOperands();
- if (NumElems != 2 && NumElems != 4)
- return false;
-
- for (unsigned i = 0; i < NumElems/2; ++i)
- if (!isUndefOrEqual(N->getOperand(i), i + NumElems))
- return false;
-
- for (unsigned i = NumElems/2; i < NumElems; ++i)
- if (!isUndefOrEqual(N->getOperand(i), i))
- return false;
-
- return true;
-}
-
-/// isMOVHPMask - Return true if the specified VECTOR_SHUFFLE operand
-/// specifies a shuffle of elements that is suitable for input to MOVHP{S|D}
-/// and MOVLHPS.
-bool X86::isMOVHPMask(SDNode *N) {
- assert(N->getOpcode() == ISD::BUILD_VECTOR);
-
- unsigned NumElems = N->getNumOperands();
- if (NumElems != 2 && NumElems != 4)
- return false;
-
- for (unsigned i = 0; i < NumElems/2; ++i)
- if (!isUndefOrEqual(N->getOperand(i), i))
- return false;
-
- for (unsigned i = 0; i < NumElems/2; ++i) {
- SDOperand Arg = N->getOperand(i + NumElems/2);
- if (!isUndefOrEqual(Arg, i + NumElems))
- return false;
- }
-
- return true;
-}
-
-/// isUNPCKLMask - Return true if the specified VECTOR_SHUFFLE operand
-/// specifies a shuffle of elements that is suitable for input to UNPCKL.
-bool static isUNPCKLMask(SDOperandPtr Elts, unsigned NumElts,
- bool V2IsSplat = false) {
- if (NumElts != 2 && NumElts != 4 && NumElts != 8 && NumElts != 16)
- return false;
-
- for (unsigned i = 0, j = 0; i != NumElts; i += 2, ++j) {
- SDOperand BitI = Elts[i];
- SDOperand BitI1 = Elts[i+1];
- if (!isUndefOrEqual(BitI, j))
- return false;
- if (V2IsSplat) {
- if (isUndefOrEqual(BitI1, NumElts))
- return false;
- } else {
- if (!isUndefOrEqual(BitI1, j + NumElts))
- return false;
- }
- }
-
- return true;
-}
-
-bool X86::isUNPCKLMask(SDNode *N, bool V2IsSplat) {
- assert(N->getOpcode() == ISD::BUILD_VECTOR);
- return ::isUNPCKLMask(N->op_begin(), N->getNumOperands(), V2IsSplat);
-}
-
-/// isUNPCKHMask - Return true if the specified VECTOR_SHUFFLE operand
-/// specifies a shuffle of elements that is suitable for input to UNPCKH.
-bool static isUNPCKHMask(SDOperandPtr Elts, unsigned NumElts,
- bool V2IsSplat = false) {
- if (NumElts != 2 && NumElts != 4 && NumElts != 8 && NumElts != 16)
- return false;
-
- for (unsigned i = 0, j = 0; i != NumElts; i += 2, ++j) {
- SDOperand BitI = Elts[i];
- SDOperand BitI1 = Elts[i+1];
- if (!isUndefOrEqual(BitI, j + NumElts/2))
- return false;
- if (V2IsSplat) {
- if (isUndefOrEqual(BitI1, NumElts))
- return false;
- } else {
- if (!isUndefOrEqual(BitI1, j + NumElts/2 + NumElts))
- return false;
- }
- }
-
- return true;
-}
-
-bool X86::isUNPCKHMask(SDNode *N, bool V2IsSplat) {
- assert(N->getOpcode() == ISD::BUILD_VECTOR);
- return ::isUNPCKHMask(N->op_begin(), N->getNumOperands(), V2IsSplat);
-}
-
-/// isUNPCKL_v_undef_Mask - Special case of isUNPCKLMask for canonical form
-/// of vector_shuffle v, v, <0, 4, 1, 5>, i.e. vector_shuffle v, undef,
-/// <0, 0, 1, 1>
-bool X86::isUNPCKL_v_undef_Mask(SDNode *N) {
- assert(N->getOpcode() == ISD::BUILD_VECTOR);
-
- unsigned NumElems = N->getNumOperands();
- if (NumElems != 2 && NumElems != 4 && NumElems != 8 && NumElems != 16)
- return false;
-
- for (unsigned i = 0, j = 0; i != NumElems; i += 2, ++j) {
- SDOperand BitI = N->getOperand(i);
- SDOperand BitI1 = N->getOperand(i+1);
-
- if (!isUndefOrEqual(BitI, j))
- return false;
- if (!isUndefOrEqual(BitI1, j))
- return false;
- }
-
- return true;
-}
-
-/// isUNPCKH_v_undef_Mask - Special case of isUNPCKHMask for canonical form
-/// of vector_shuffle v, v, <2, 6, 3, 7>, i.e. vector_shuffle v, undef,
-/// <2, 2, 3, 3>
-bool X86::isUNPCKH_v_undef_Mask(SDNode *N) {
- assert(N->getOpcode() == ISD::BUILD_VECTOR);
-
- unsigned NumElems = N->getNumOperands();
- if (NumElems != 2 && NumElems != 4 && NumElems != 8 && NumElems != 16)
- return false;
-
- for (unsigned i = 0, j = NumElems / 2; i != NumElems; i += 2, ++j) {
- SDOperand BitI = N->getOperand(i);
- SDOperand BitI1 = N->getOperand(i + 1);
-
- if (!isUndefOrEqual(BitI, j))
- return false;
- if (!isUndefOrEqual(BitI1, j))
- return false;
- }
-
- return true;
-}
-
-/// isMOVLMask - Return true if the specified VECTOR_SHUFFLE operand
-/// specifies a shuffle of elements that is suitable for input to MOVSS,
-/// MOVSD, and MOVD, i.e. setting the lowest element.
-static bool isMOVLMask(SDOperandPtr Elts, unsigned NumElts) {
- if (NumElts != 2 && NumElts != 4)
- return false;
-
- if (!isUndefOrEqual(Elts[0], NumElts))
- return false;
-
- for (unsigned i = 1; i < NumElts; ++i) {
- if (!isUndefOrEqual(Elts[i], i))
- return false;
- }
-
- return true;
-}
-
-bool X86::isMOVLMask(SDNode *N) {
- assert(N->getOpcode() == ISD::BUILD_VECTOR);
- return ::isMOVLMask(N->op_begin(), N->getNumOperands());
-}
-
-/// isCommutedMOVL - Returns true if the shuffle mask is except the reverse
-/// of what x86 movss want. X86 movs requires the lowest element to be lowest
-/// element of vector 2 and the other elements to come from vector 1 in order.
-static bool isCommutedMOVL(SDOperandPtr Ops, unsigned NumOps,
- bool V2IsSplat = false,
- bool V2IsUndef = false) {
- if (NumOps != 2 && NumOps != 4 && NumOps != 8 && NumOps != 16)
- return false;
-
- if (!isUndefOrEqual(Ops[0], 0))
- return false;
-
- for (unsigned i = 1; i < NumOps; ++i) {
- SDOperand Arg = Ops[i];
- if (!(isUndefOrEqual(Arg, i+NumOps) ||
- (V2IsUndef && isUndefOrInRange(Arg, NumOps, NumOps*2)) ||
- (V2IsSplat && isUndefOrEqual(Arg, NumOps))))
- return false;
- }
-
- return true;
-}
-
-static bool isCommutedMOVL(SDNode *N, bool V2IsSplat = false,
- bool V2IsUndef = false) {
- assert(N->getOpcode() == ISD::BUILD_VECTOR);
- return isCommutedMOVL(N->op_begin(), N->getNumOperands(),
- V2IsSplat, V2IsUndef);
-}
-
-/// isMOVSHDUPMask - Return true if the specified VECTOR_SHUFFLE operand
-/// specifies a shuffle of elements that is suitable for input to MOVSHDUP.
-bool X86::isMOVSHDUPMask(SDNode *N) {
- assert(N->getOpcode() == ISD::BUILD_VECTOR);
-
- if (N->getNumOperands() != 4)
- return false;
-
- // Expect 1, 1, 3, 3
- for (unsigned i = 0; i < 2; ++i) {
- SDOperand Arg = N->getOperand(i);
- if (Arg.getOpcode() == ISD::UNDEF) continue;
- assert(isa<ConstantSDNode>(Arg) && "Invalid VECTOR_SHUFFLE mask!");
- unsigned Val = cast<ConstantSDNode>(Arg)->getValue();
- if (Val != 1) return false;
- }
-
- bool HasHi = false;
- for (unsigned i = 2; i < 4; ++i) {
- SDOperand Arg = N->getOperand(i);
- if (Arg.getOpcode() == ISD::UNDEF) continue;
- assert(isa<ConstantSDNode>(Arg) && "Invalid VECTOR_SHUFFLE mask!");
- unsigned Val = cast<ConstantSDNode>(Arg)->getValue();
- if (Val != 3) return false;
- HasHi = true;
- }
-
- // Don't use movshdup if it can be done with a shufps.
- return HasHi;
-}
-
-/// isMOVSLDUPMask - Return true if the specified VECTOR_SHUFFLE operand
-/// specifies a shuffle of elements that is suitable for input to MOVSLDUP.
-bool X86::isMOVSLDUPMask(SDNode *N) {
- assert(N->getOpcode() == ISD::BUILD_VECTOR);
-
- if (N->getNumOperands() != 4)
- return false;
-
- // Expect 0, 0, 2, 2
- for (unsigned i = 0; i < 2; ++i) {
- SDOperand Arg = N->getOperand(i);
- if (Arg.getOpcode() == ISD::UNDEF) continue;
- assert(isa<ConstantSDNode>(Arg) && "Invalid VECTOR_SHUFFLE mask!");
- unsigned Val = cast<ConstantSDNode>(Arg)->getValue();
- if (Val != 0) return false;
- }
-
- bool HasHi = false;
- for (unsigned i = 2; i < 4; ++i) {
- SDOperand Arg = N->getOperand(i);
- if (Arg.getOpcode() == ISD::UNDEF) continue;
- assert(isa<ConstantSDNode>(Arg) && "Invalid VECTOR_SHUFFLE mask!");
- unsigned Val = cast<ConstantSDNode>(Arg)->getValue();
- if (Val != 2) return false;
- HasHi = true;
- }
-
- // Don't use movshdup if it can be done with a shufps.
- return HasHi;
-}
-
-/// isIdentityMask - Return true if the specified VECTOR_SHUFFLE operand
-/// specifies a identity operation on the LHS or RHS.
-static bool isIdentityMask(SDNode *N, bool RHS = false) {
- unsigned NumElems = N->getNumOperands();
- for (unsigned i = 0; i < NumElems; ++i)
- if (!isUndefOrEqual(N->getOperand(i), i + (RHS ? NumElems : 0)))
- return false;
- return true;
-}
-
-/// isSplatMask - Return true if the specified VECTOR_SHUFFLE operand specifies
-/// a splat of a single element.
-static bool isSplatMask(SDNode *N) {
- assert(N->getOpcode() == ISD::BUILD_VECTOR);
-
- // This is a splat operation if each element of the permute is the same, and
- // if the value doesn't reference the second vector.
- unsigned NumElems = N->getNumOperands();
- SDOperand ElementBase;
- unsigned i = 0;
- for (; i != NumElems; ++i) {
- SDOperand Elt = N->getOperand(i);
- if (isa<ConstantSDNode>(Elt)) {
- ElementBase = Elt;
- break;
- }
- }
-
- if (!ElementBase.Val)
- return false;
-
- for (; i != NumElems; ++i) {
- SDOperand Arg = N->getOperand(i);
- if (Arg.getOpcode() == ISD::UNDEF) continue;
- assert(isa<ConstantSDNode>(Arg) && "Invalid VECTOR_SHUFFLE mask!");
- if (Arg != ElementBase) return false;
- }
-
- // Make sure it is a splat of the first vector operand.
- return cast<ConstantSDNode>(ElementBase)->getValue() < NumElems;
-}
-
-/// isSplatMask - Return true if the specified VECTOR_SHUFFLE operand specifies
-/// a splat of a single element and it's a 2 or 4 element mask.
-bool X86::isSplatMask(SDNode *N) {
- assert(N->getOpcode() == ISD::BUILD_VECTOR);
-
- // We can only splat 64-bit, and 32-bit quantities with a single instruction.
- if (N->getNumOperands() != 4 && N->getNumOperands() != 2)
- return false;
- return ::isSplatMask(N);
-}
-
-/// isSplatLoMask - Return true if the specified VECTOR_SHUFFLE operand
-/// specifies a splat of zero element.
-bool X86::isSplatLoMask(SDNode *N) {
- assert(N->getOpcode() == ISD::BUILD_VECTOR);
-
- for (unsigned i = 0, e = N->getNumOperands(); i < e; ++i)
- if (!isUndefOrEqual(N->getOperand(i), 0))
- return false;
- return true;
-}
-
-/// getShuffleSHUFImmediate - Return the appropriate immediate to shuffle
-/// the specified isShuffleMask VECTOR_SHUFFLE mask with PSHUF* and SHUFP*
-/// instructions.
-unsigned X86::getShuffleSHUFImmediate(SDNode *N) {
- unsigned NumOperands = N->getNumOperands();
- unsigned Shift = (NumOperands == 4) ? 2 : 1;
- unsigned Mask = 0;
- for (unsigned i = 0; i < NumOperands; ++i) {
- unsigned Val = 0;
- SDOperand Arg = N->getOperand(NumOperands-i-1);
- if (Arg.getOpcode() != ISD::UNDEF)
- Val = cast<ConstantSDNode>(Arg)->getValue();
- if (Val >= NumOperands) Val -= NumOperands;
- Mask |= Val;
- if (i != NumOperands - 1)
- Mask <<= Shift;
- }
-
- return Mask;
-}
-
-/// getShufflePSHUFHWImmediate - Return the appropriate immediate to shuffle
-/// the specified isShuffleMask VECTOR_SHUFFLE mask with PSHUFHW
-/// instructions.
-unsigned X86::getShufflePSHUFHWImmediate(SDNode *N) {
- unsigned Mask = 0;
- // 8 nodes, but we only care about the last 4.
- for (unsigned i = 7; i >= 4; --i) {
- unsigned Val = 0;
- SDOperand Arg = N->getOperand(i);
- if (Arg.getOpcode() != ISD::UNDEF)
- Val = cast<ConstantSDNode>(Arg)->getValue();
- Mask |= (Val - 4);
- if (i != 4)
- Mask <<= 2;
- }
-
- return Mask;
-}
-
-/// getShufflePSHUFLWImmediate - Return the appropriate immediate to shuffle
-/// the specified isShuffleMask VECTOR_SHUFFLE mask with PSHUFLW
-/// instructions.
-unsigned X86::getShufflePSHUFLWImmediate(SDNode *N) {
- unsigned Mask = 0;
- // 8 nodes, but we only care about the first 4.
- for (int i = 3; i >= 0; --i) {
- unsigned Val = 0;
- SDOperand Arg = N->getOperand(i);
- if (Arg.getOpcode() != ISD::UNDEF)
- Val = cast<ConstantSDNode>(Arg)->getValue();
- Mask |= Val;
- if (i != 0)
- Mask <<= 2;
- }
-
- return Mask;
-}
-
-/// isPSHUFHW_PSHUFLWMask - true if the specified VECTOR_SHUFFLE operand
-/// specifies a 8 element shuffle that can be broken into a pair of
-/// PSHUFHW and PSHUFLW.
-static bool isPSHUFHW_PSHUFLWMask(SDNode *N) {
- assert(N->getOpcode() == ISD::BUILD_VECTOR);
-
- if (N->getNumOperands() != 8)
- return false;
-
- // Lower quadword shuffled.
- for (unsigned i = 0; i != 4; ++i) {
- SDOperand Arg = N->getOperand(i);
- if (Arg.getOpcode() == ISD::UNDEF) continue;
- assert(isa<ConstantSDNode>(Arg) && "Invalid VECTOR_SHUFFLE mask!");
- unsigned Val = cast<ConstantSDNode>(Arg)->getValue();
- if (Val >= 4)
- return false;
- }
-
- // Upper quadword shuffled.
- for (unsigned i = 4; i != 8; ++i) {
- SDOperand Arg = N->getOperand(i);
- if (Arg.getOpcode() == ISD::UNDEF) continue;
- assert(isa<ConstantSDNode>(Arg) && "Invalid VECTOR_SHUFFLE mask!");
- unsigned Val = cast<ConstantSDNode>(Arg)->getValue();
- if (Val < 4 || Val > 7)
- return false;
- }
-
- return true;
-}
-
-/// CommuteVectorShuffle - Swap vector_shuffle operands as well as
-/// values in ther permute mask.
-static SDOperand CommuteVectorShuffle(SDOperand Op, SDOperand &V1,
- SDOperand &V2, SDOperand &Mask,
- SelectionDAG &DAG) {
- MVT::ValueType VT = Op.getValueType();
- MVT::ValueType MaskVT = Mask.getValueType();
- MVT::ValueType EltVT = MVT::getVectorElementType(MaskVT);
- unsigned NumElems = Mask.getNumOperands();
- SmallVector<SDOperand, 8> MaskVec;
-
- for (unsigned i = 0; i != NumElems; ++i) {
- SDOperand Arg = Mask.getOperand(i);
- if (Arg.getOpcode() == ISD::UNDEF) {
- MaskVec.push_back(DAG.getNode(ISD::UNDEF, EltVT));
- continue;
- }
- assert(isa<ConstantSDNode>(Arg) && "Invalid VECTOR_SHUFFLE mask!");
- unsigned Val = cast<ConstantSDNode>(Arg)->getValue();
- if (Val < NumElems)
- MaskVec.push_back(DAG.getConstant(Val + NumElems, EltVT));
- else
- MaskVec.push_back(DAG.getConstant(Val - NumElems, EltVT));
- }
-
- std::swap(V1, V2);
- Mask = DAG.getNode(ISD::BUILD_VECTOR, MaskVT, &MaskVec[0], NumElems);
- return DAG.getNode(ISD::VECTOR_SHUFFLE, VT, V1, V2, Mask);
-}
-
-/// CommuteVectorShuffleMask - Change values in a shuffle permute mask assuming
-/// the two vector operands have swapped position.
-static
-SDOperand CommuteVectorShuffleMask(SDOperand Mask, SelectionDAG &DAG) {
- MVT::ValueType MaskVT = Mask.getValueType();
- MVT::ValueType EltVT = MVT::getVectorElementType(MaskVT);
- unsigned NumElems = Mask.getNumOperands();
- SmallVector<SDOperand, 8> MaskVec;
- for (unsigned i = 0; i != NumElems; ++i) {
- SDOperand Arg = Mask.getOperand(i);
- if (Arg.getOpcode() == ISD::UNDEF) {
- MaskVec.push_back(DAG.getNode(ISD::UNDEF, EltVT));
- continue;
- }
- assert(isa<ConstantSDNode>(Arg) && "Invalid VECTOR_SHUFFLE mask!");
- unsigned Val = cast<ConstantSDNode>(Arg)->getValue();
- if (Val < NumElems)
- MaskVec.push_back(DAG.getConstant(Val + NumElems, EltVT));
- else
- MaskVec.push_back(DAG.getConstant(Val - NumElems, EltVT));
- }
- return DAG.getNode(ISD::BUILD_VECTOR, MaskVT, &MaskVec[0], NumElems);
-}
-
-
-/// ShouldXformToMOVHLPS - Return true if the node should be transformed to
-/// match movhlps. The lower half elements should come from upper half of
-/// V1 (and in order), and the upper half elements should come from the upper
-/// half of V2 (and in order).
-static bool ShouldXformToMOVHLPS(SDNode *Mask) {
- unsigned NumElems = Mask->getNumOperands();
- if (NumElems != 4)
- return false;
- for (unsigned i = 0, e = 2; i != e; ++i)
- if (!isUndefOrEqual(Mask->getOperand(i), i+2))
- return false;
- for (unsigned i = 2; i != 4; ++i)
- if (!isUndefOrEqual(Mask->getOperand(i), i+4))
- return false;
- return true;
-}
-
-/// isScalarLoadToVector - Returns true if the node is a scalar load that
-/// is promoted to a vector. It also returns the LoadSDNode by reference if
-/// required.
-static bool isScalarLoadToVector(SDNode *N, LoadSDNode **LD = NULL) {
- if (N->getOpcode() == ISD::SCALAR_TO_VECTOR) {
- N = N->getOperand(0).Val;
- if (ISD::isNON_EXTLoad(N)) {
- if (LD)
- *LD = cast<LoadSDNode>(N);
- return true;
- }
- }
- return false;
-}
-
-/// ShouldXformToMOVLP{S|D} - Return true if the node should be transformed to
-/// match movlp{s|d}. The lower half elements should come from lower half of
-/// V1 (and in order), and the upper half elements should come from the upper
-/// half of V2 (and in order). And since V1 will become the source of the
-/// MOVLP, it must be either a vector load or a scalar load to vector.
-static bool ShouldXformToMOVLP(SDNode *V1, SDNode *V2, SDNode *Mask) {
- if (!ISD::isNON_EXTLoad(V1) && !isScalarLoadToVector(V1))
- return false;
- // Is V2 is a vector load, don't do this transformation. We will try to use
- // load folding shufps op.
- if (ISD::isNON_EXTLoad(V2))
- return false;
-
- unsigned NumElems = Mask->getNumOperands();
- if (NumElems != 2 && NumElems != 4)
- return false;
- for (unsigned i = 0, e = NumElems/2; i != e; ++i)
- if (!isUndefOrEqual(Mask->getOperand(i), i))
- return false;
- for (unsigned i = NumElems/2; i != NumElems; ++i)
- if (!isUndefOrEqual(Mask->getOperand(i), i+NumElems))
- return false;
- return true;
-}
-
-/// isSplatVector - Returns true if N is a BUILD_VECTOR node whose elements are
-/// all the same.
-static bool isSplatVector(SDNode *N) {
- if (N->getOpcode() != ISD::BUILD_VECTOR)
- return false;
-
- SDOperand SplatValue = N->getOperand(0);
- for (unsigned i = 1, e = N->getNumOperands(); i != e; ++i)
- if (N->getOperand(i) != SplatValue)
- return false;
- return true;
-}
-
-/// isUndefShuffle - Returns true if N is a VECTOR_SHUFFLE that can be resolved
-/// to an undef.
-static bool isUndefShuffle(SDNode *N) {
- if (N->getOpcode() != ISD::VECTOR_SHUFFLE)
- return false;
-
- SDOperand V1 = N->getOperand(0);
- SDOperand V2 = N->getOperand(1);
- SDOperand Mask = N->getOperand(2);
- unsigned NumElems = Mask.getNumOperands();
- for (unsigned i = 0; i != NumElems; ++i) {
- SDOperand Arg = Mask.getOperand(i);
- if (Arg.getOpcode() != ISD::UNDEF) {
- unsigned Val = cast<ConstantSDNode>(Arg)->getValue();
- if (Val < NumElems && V1.getOpcode() != ISD::UNDEF)
- return false;
- else if (Val >= NumElems && V2.getOpcode() != ISD::UNDEF)
- return false;
- }
- }
- return true;
-}
-
-/// isZeroNode - Returns true if Elt is a constant zero or a floating point
-/// constant +0.0.
-static inline bool isZeroNode(SDOperand Elt) {
- return ((isa<ConstantSDNode>(Elt) &&
- cast<ConstantSDNode>(Elt)->getValue() == 0) ||
- (isa<ConstantFPSDNode>(Elt) &&
- cast<ConstantFPSDNode>(Elt)->getValueAPF().isPosZero()));
-}
-
-/// isZeroShuffle - Returns true if N is a VECTOR_SHUFFLE that can be resolved
-/// to an zero vector.
-static bool isZeroShuffle(SDNode *N) {
- if (N->getOpcode() != ISD::VECTOR_SHUFFLE)
- return false;
-
- SDOperand V1 = N->getOperand(0);
- SDOperand V2 = N->getOperand(1);
- SDOperand Mask = N->getOperand(2);
- unsigned NumElems = Mask.getNumOperands();
- for (unsigned i = 0; i != NumElems; ++i) {
- SDOperand Arg = Mask.getOperand(i);
- if (Arg.getOpcode() == ISD::UNDEF)
- continue;
-
- unsigned Idx = cast<ConstantSDNode>(Arg)->getValue();
- if (Idx < NumElems) {
- unsigned Opc = V1.Val->getOpcode();
- if (Opc == ISD::UNDEF || ISD::isBuildVectorAllZeros(V1.Val))
- continue;
- if (Opc != ISD::BUILD_VECTOR ||
- !isZeroNode(V1.Val->getOperand(Idx)))
- return false;
- } else if (Idx >= NumElems) {
- unsigned Opc = V2.Val->getOpcode();
- if (Opc == ISD::UNDEF || ISD::isBuildVectorAllZeros(V2.Val))
- continue;
- if (Opc != ISD::BUILD_VECTOR ||
- !isZeroNode(V2.Val->getOperand(Idx - NumElems)))
- return false;
- }
- }
- return true;
-}
-
-/// getZeroVector - Returns a vector of specified type with all zero elements.
-///
-static SDOperand getZeroVector(MVT::ValueType VT, SelectionDAG &DAG) {
- assert(MVT::isVector(VT) && "Expected a vector type");
-
- // Always build zero vectors as <4 x i32> or <2 x i32> bitcasted to their dest
- // type. This ensures they get CSE'd.
- SDOperand Cst = DAG.getTargetConstant(0, MVT::i32);
- SDOperand Vec;
- if (MVT::getSizeInBits(VT) == 64) // MMX
- Vec = DAG.getNode(ISD::BUILD_VECTOR, MVT::v2i32, Cst, Cst);
- else // SSE
- Vec = DAG.getNode(ISD::BUILD_VECTOR, MVT::v4i32, Cst, Cst, Cst, Cst);
- return DAG.getNode(ISD::BIT_CONVERT, VT, Vec);
-}
-
-/// getOnesVector - Returns a vector of specified type with all bits set.
-///
-static SDOperand getOnesVector(MVT::ValueType VT, SelectionDAG &DAG) {
- assert(MVT::isVector(VT) && "Expected a vector type");
-
- // Always build ones vectors as <4 x i32> or <2 x i32> bitcasted to their dest
- // type. This ensures they get CSE'd.
- SDOperand Cst = DAG.getTargetConstant(~0U, MVT::i32);
- SDOperand Vec;
- if (MVT::getSizeInBits(VT) == 64) // MMX
- Vec = DAG.getNode(ISD::BUILD_VECTOR, MVT::v2i32, Cst, Cst);
- else // SSE
- Vec = DAG.getNode(ISD::BUILD_VECTOR, MVT::v4i32, Cst, Cst, Cst, Cst);
- return DAG.getNode(ISD::BIT_CONVERT, VT, Vec);
-}
-
-
-/// NormalizeMask - V2 is a splat, modify the mask (if needed) so all elements
-/// that point to V2 points to its first element.
-static SDOperand NormalizeMask(SDOperand Mask, SelectionDAG &DAG) {
- assert(Mask.getOpcode() == ISD::BUILD_VECTOR);
-
- bool Changed = false;
- SmallVector<SDOperand, 8> MaskVec;
- unsigned NumElems = Mask.getNumOperands();
- for (unsigned i = 0; i != NumElems; ++i) {
- SDOperand Arg = Mask.getOperand(i);
- if (Arg.getOpcode() != ISD::UNDEF) {
- unsigned Val = cast<ConstantSDNode>(Arg)->getValue();
- if (Val > NumElems) {
- Arg = DAG.getConstant(NumElems, Arg.getValueType());
- Changed = true;
- }
- }
- MaskVec.push_back(Arg);
- }
-
- if (Changed)
- Mask = DAG.getNode(ISD::BUILD_VECTOR, Mask.getValueType(),
- &MaskVec[0], MaskVec.size());
- return Mask;
-}
-
-/// getMOVLMask - Returns a vector_shuffle mask for an movs{s|d}, movd
-/// operation of specified width.
-static SDOperand getMOVLMask(unsigned NumElems, SelectionDAG &DAG) {
- MVT::ValueType MaskVT = MVT::getIntVectorWithNumElements(NumElems);
- MVT::ValueType BaseVT = MVT::getVectorElementType(MaskVT);
-
- SmallVector<SDOperand, 8> MaskVec;
- MaskVec.push_back(DAG.getConstant(NumElems, BaseVT));
- for (unsigned i = 1; i != NumElems; ++i)
- MaskVec.push_back(DAG.getConstant(i, BaseVT));
- return DAG.getNode(ISD::BUILD_VECTOR, MaskVT, &MaskVec[0], MaskVec.size());
-}
-
-/// getUnpacklMask - Returns a vector_shuffle mask for an unpackl operation
-/// of specified width.
-static SDOperand getUnpacklMask(unsigned NumElems, SelectionDAG &DAG) {
- MVT::ValueType MaskVT = MVT::getIntVectorWithNumElements(NumElems);
- MVT::ValueType BaseVT = MVT::getVectorElementType(MaskVT);
- SmallVector<SDOperand, 8> MaskVec;
- for (unsigned i = 0, e = NumElems/2; i != e; ++i) {
- MaskVec.push_back(DAG.getConstant(i, BaseVT));
- MaskVec.push_back(DAG.getConstant(i + NumElems, BaseVT));
- }
- return DAG.getNode(ISD::BUILD_VECTOR, MaskVT, &MaskVec[0], MaskVec.size());
-}
-
-/// getUnpackhMask - Returns a vector_shuffle mask for an unpackh operation
-/// of specified width.
-static SDOperand getUnpackhMask(unsigned NumElems, SelectionDAG &DAG) {
- MVT::ValueType MaskVT = MVT::getIntVectorWithNumElements(NumElems);
- MVT::ValueType BaseVT = MVT::getVectorElementType(MaskVT);
- unsigned Half = NumElems/2;
- SmallVector<SDOperand, 8> MaskVec;
- for (unsigned i = 0; i != Half; ++i) {
- MaskVec.push_back(DAG.getConstant(i + Half, BaseVT));
- MaskVec.push_back(DAG.getConstant(i + NumElems + Half, BaseVT));
- }
- return DAG.getNode(ISD::BUILD_VECTOR, MaskVT, &MaskVec[0], MaskVec.size());
-}
-
-/// getSwapEltZeroMask - Returns a vector_shuffle mask for a shuffle that swaps
-/// element #0 of a vector with the specified index, leaving the rest of the
-/// elements in place.
-static SDOperand getSwapEltZeroMask(unsigned NumElems, unsigned DestElt,
- SelectionDAG &DAG) {
- MVT::ValueType MaskVT = MVT::getIntVectorWithNumElements(NumElems);
- MVT::ValueType BaseVT = MVT::getVectorElementType(MaskVT);
- SmallVector<SDOperand, 8> MaskVec;
- // Element #0 of the result gets the elt we are replacing.
- MaskVec.push_back(DAG.getConstant(DestElt, BaseVT));
- for (unsigned i = 1; i != NumElems; ++i)
- MaskVec.push_back(DAG.getConstant(i == DestElt ? 0 : i, BaseVT));
- return DAG.getNode(ISD::BUILD_VECTOR, MaskVT, &MaskVec[0], MaskVec.size());
-}
-
-/// PromoteSplat - Promote a splat of v4f32, v8i16 or v16i8 to v4i32.
-static SDOperand PromoteSplat(SDOperand Op, SelectionDAG &DAG, bool HasSSE2) {
- MVT::ValueType PVT = HasSSE2 ? MVT::v4i32 : MVT::v4f32;
- MVT::ValueType VT = Op.getValueType();
- if (PVT == VT)
- return Op;
- SDOperand V1 = Op.getOperand(0);
- SDOperand Mask = Op.getOperand(2);
- unsigned NumElems = Mask.getNumOperands();
- // Special handling of v4f32 -> v4i32.
- if (VT != MVT::v4f32) {
- Mask = getUnpacklMask(NumElems, DAG);
- while (NumElems > 4) {
- V1 = DAG.getNode(ISD::VECTOR_SHUFFLE, VT, V1, V1, Mask);
- NumElems >>= 1;
- }
- Mask = getZeroVector(MVT::v4i32, DAG);
- }
-
- V1 = DAG.getNode(ISD::BIT_CONVERT, PVT, V1);
- SDOperand Shuffle = DAG.getNode(ISD::VECTOR_SHUFFLE, PVT, V1,
- DAG.getNode(ISD::UNDEF, PVT), Mask);
- return DAG.getNode(ISD::BIT_CONVERT, VT, Shuffle);
-}
-
-/// getShuffleVectorZeroOrUndef - Return a vector_shuffle of the specified
-/// vector of zero or undef vector. This produces a shuffle where the low
-/// element of V2 is swizzled into the zero/undef vector, landing at element
-/// Idx. This produces a shuffle mask like 4,1,2,3 (idx=0) or 0,1,2,4 (idx=3).
-static SDOperand getShuffleVectorZeroOrUndef(SDOperand V2, unsigned Idx,
- bool isZero, SelectionDAG &DAG) {
- MVT::ValueType VT = V2.getValueType();
- SDOperand V1 = isZero ? getZeroVector(VT, DAG) : DAG.getNode(ISD::UNDEF, VT);
- unsigned NumElems = MVT::getVectorNumElements(V2.getValueType());
- MVT::ValueType MaskVT = MVT::getIntVectorWithNumElements(NumElems);
- MVT::ValueType EVT = MVT::getVectorElementType(MaskVT);
- SmallVector<SDOperand, 16> MaskVec;
- for (unsigned i = 0; i != NumElems; ++i)
- if (i == Idx) // If this is the insertion idx, put the low elt of V2 here.
- MaskVec.push_back(DAG.getConstant(NumElems, EVT));
- else
- MaskVec.push_back(DAG.getConstant(i, EVT));
- SDOperand Mask = DAG.getNode(ISD::BUILD_VECTOR, MaskVT,
- &MaskVec[0], MaskVec.size());
- return DAG.getNode(ISD::VECTOR_SHUFFLE, VT, V1, V2, Mask);
-}
-
-/// LowerBuildVectorv16i8 - Custom lower build_vector of v16i8.
-///
-static SDOperand LowerBuildVectorv16i8(SDOperand Op, unsigned NonZeros,
- unsigned NumNonZero, unsigned NumZero,
- SelectionDAG &DAG, TargetLowering &TLI) {
- if (NumNonZero > 8)
- return SDOperand();
-
- SDOperand V(0, 0);
- bool First = true;
- for (unsigned i = 0; i < 16; ++i) {
- bool ThisIsNonZero = (NonZeros & (1 << i)) != 0;
- if (ThisIsNonZero && First) {
- if (NumZero)
- V = getZeroVector(MVT::v8i16, DAG);
- else
- V = DAG.getNode(ISD::UNDEF, MVT::v8i16);
- First = false;
- }
-
- if ((i & 1) != 0) {
- SDOperand ThisElt(0, 0), LastElt(0, 0);
- bool LastIsNonZero = (NonZeros & (1 << (i-1))) != 0;
- if (LastIsNonZero) {
- LastElt = DAG.getNode(ISD::ZERO_EXTEND, MVT::i16, Op.getOperand(i-1));
- }
- if (ThisIsNonZero) {
- ThisElt = DAG.getNode(ISD::ZERO_EXTEND, MVT::i16, Op.getOperand(i));
- ThisElt = DAG.getNode(ISD::SHL, MVT::i16,
- ThisElt, DAG.getConstant(8, MVT::i8));
- if (LastIsNonZero)
- ThisElt = DAG.getNode(ISD::OR, MVT::i16, ThisElt, LastElt);
- } else
- ThisElt = LastElt;
-
- if (ThisElt.Val)
- V = DAG.getNode(ISD::INSERT_VECTOR_ELT, MVT::v8i16, V, ThisElt,
- DAG.getIntPtrConstant(i/2));
- }
- }
-
- return DAG.getNode(ISD::BIT_CONVERT, MVT::v16i8, V);
-}
-
-/// LowerBuildVectorv8i16 - Custom lower build_vector of v8i16.
-///
-static SDOperand LowerBuildVectorv8i16(SDOperand Op, unsigned NonZeros,
- unsigned NumNonZero, unsigned NumZero,
- SelectionDAG &DAG, TargetLowering &TLI) {
- if (NumNonZero > 4)
- return SDOperand();
-
- SDOperand V(0, 0);
- bool First = true;
- for (unsigned i = 0; i < 8; ++i) {
- bool isNonZero = (NonZeros & (1 << i)) != 0;
- if (isNonZero) {
- if (First) {
- if (NumZero)
- V = getZeroVector(MVT::v8i16, DAG);
- else
- V = DAG.getNode(ISD::UNDEF, MVT::v8i16);
- First = false;
- }
- V = DAG.getNode(ISD::INSERT_VECTOR_ELT, MVT::v8i16, V, Op.getOperand(i),
- DAG.getIntPtrConstant(i));
- }
- }
-
- return V;
-}
-
-SDOperand
-X86TargetLowering::LowerBUILD_VECTOR(SDOperand Op, SelectionDAG &DAG) {
- // All zero's are handled with pxor, all one's are handled with pcmpeqd.
- if (ISD::isBuildVectorAllZeros(Op.Val) || ISD::isBuildVectorAllOnes(Op.Val)) {
- // Canonicalize this to either <4 x i32> or <2 x i32> (SSE vs MMX) to
- // 1) ensure the zero vectors are CSE'd, and 2) ensure that i64 scalars are
- // eliminated on x86-32 hosts.
- if (Op.getValueType() == MVT::v4i32 || Op.getValueType() == MVT::v2i32)
- return Op;
-
- if (ISD::isBuildVectorAllOnes(Op.Val))
- return getOnesVector(Op.getValueType(), DAG);
- return getZeroVector(Op.getValueType(), DAG);
- }
-
- MVT::ValueType VT = Op.getValueType();
- MVT::ValueType EVT = MVT::getVectorElementType(VT);
- unsigned EVTBits = MVT::getSizeInBits(EVT);
-
- unsigned NumElems = Op.getNumOperands();
- unsigned NumZero = 0;
- unsigned NumNonZero = 0;
- unsigned NonZeros = 0;
- bool IsAllConstants = true;
- SmallSet<SDOperand, 8> Values;
- for (unsigned i = 0; i < NumElems; ++i) {
- SDOperand Elt = Op.getOperand(i);
- if (Elt.getOpcode() == ISD::UNDEF)
- continue;
- Values.insert(Elt);
- if (Elt.getOpcode() != ISD::Constant &&
- Elt.getOpcode() != ISD::ConstantFP)
- IsAllConstants = false;
- if (isZeroNode(Elt))
- NumZero++;
- else {
- NonZeros |= (1 << i);
- NumNonZero++;
- }
- }
-
- if (NumNonZero == 0) {
- // All undef vector. Return an UNDEF. All zero vectors were handled above.
- return DAG.getNode(ISD::UNDEF, VT);
- }
-
- // Special case for single non-zero, non-undef, element.
- if (NumNonZero == 1 && NumElems <= 4) {
- unsigned Idx = CountTrailingZeros_32(NonZeros);
- SDOperand Item = Op.getOperand(Idx);
-
- // If this is an insertion of an i64 value on x86-32, and if the top bits of
- // the value are obviously zero, truncate the value to i32 and do the
- // insertion that way. Only do this if the value is non-constant or if the
- // value is a constant being inserted into element 0. It is cheaper to do
- // a constant pool load than it is to do a movd + shuffle.
- if (EVT == MVT::i64 && !Subtarget->is64Bit() &&
- (!IsAllConstants || Idx == 0)) {
- if (DAG.MaskedValueIsZero(Item, APInt::getBitsSet(64, 32, 64))) {
- // Handle MMX and SSE both.
- MVT::ValueType VecVT = VT == MVT::v2i64 ? MVT::v4i32 : MVT::v2i32;
- MVT::ValueType VecElts = VT == MVT::v2i64 ? 4 : 2;
-
- // Truncate the value (which may itself be a constant) to i32, and
- // convert it to a vector with movd (S2V+shuffle to zero extend).
- Item = DAG.getNode(ISD::TRUNCATE, MVT::i32, Item);
- Item = DAG.getNode(ISD::SCALAR_TO_VECTOR, VecVT, Item);
- Item = getShuffleVectorZeroOrUndef(Item, 0, true, DAG);
-
- // Now we have our 32-bit value zero extended in the low element of
- // a vector. If Idx != 0, swizzle it into place.
- if (Idx != 0) {
- SDOperand Ops[] = {
- Item, DAG.getNode(ISD::UNDEF, Item.getValueType()),
- getSwapEltZeroMask(VecElts, Idx, DAG)
- };
- Item = DAG.getNode(ISD::VECTOR_SHUFFLE, VecVT, Ops, 3);
- }
- return DAG.getNode(ISD::BIT_CONVERT, Op.getValueType(), Item);
- }
- }
-
- // If we have a constant or non-constant insertion into the low element of
- // a vector, we can do this with SCALAR_TO_VECTOR + shuffle of zero into
- // the rest of the elements. This will be matched as movd/movq/movss/movsd
- // depending on what the source datatype is. Because we can only get here
- // when NumElems <= 4, this only needs to handle i32/f32/i64/f64.
- if (Idx == 0 &&
- // Don't do this for i64 values on x86-32.
- (EVT != MVT::i64 || Subtarget->is64Bit())) {
- Item = DAG.getNode(ISD::SCALAR_TO_VECTOR, VT, Item);
- // Turn it into a MOVL (i.e. movss, movsd, or movd) to a zero vector.
- return getShuffleVectorZeroOrUndef(Item, 0, NumZero > 0, DAG);
- }
-
- if (IsAllConstants) // Otherwise, it's better to do a constpool load.
- return SDOperand();
-
- // Otherwise, if this is a vector with i32 or f32 elements, and the element
- // is a non-constant being inserted into an element other than the low one,
- // we can't use a constant pool load. Instead, use SCALAR_TO_VECTOR (aka
- // movd/movss) to move this into the low element, then shuffle it into
- // place.
- if (EVTBits == 32) {
- Item = DAG.getNode(ISD::SCALAR_TO_VECTOR, VT, Item);
-
- // Turn it into a shuffle of zero and zero-extended scalar to vector.
- Item = getShuffleVectorZeroOrUndef(Item, 0, NumZero > 0, DAG);
- MVT::ValueType MaskVT = MVT::getIntVectorWithNumElements(NumElems);
- MVT::ValueType MaskEVT = MVT::getVectorElementType(MaskVT);
- SmallVector<SDOperand, 8> MaskVec;
- for (unsigned i = 0; i < NumElems; i++)
- MaskVec.push_back(DAG.getConstant((i == Idx) ? 0 : 1, MaskEVT));
- SDOperand Mask = DAG.getNode(ISD::BUILD_VECTOR, MaskVT,
- &MaskVec[0], MaskVec.size());
- return DAG.getNode(ISD::VECTOR_SHUFFLE, VT, Item,
- DAG.getNode(ISD::UNDEF, VT), Mask);
- }
- }
-
- // Splat is obviously ok. Let legalizer expand it to a shuffle.
- if (Values.size() == 1)
- return SDOperand();
-
- // A vector full of immediates; various special cases are already
- // handled, so this is best done with a single constant-pool load.
- if (IsAllConstants)
- return SDOperand();
-
- // Let legalizer expand 2-wide build_vectors.
- if (EVTBits == 64) {
- if (NumNonZero == 1) {
- // One half is zero or undef.
- unsigned Idx = CountTrailingZeros_32(NonZeros);
- SDOperand V2 = DAG.getNode(ISD::SCALAR_TO_VECTOR, VT,
- Op.getOperand(Idx));
- return getShuffleVectorZeroOrUndef(V2, Idx, true, DAG);
- }
- return SDOperand();
- }
-
- // If element VT is < 32 bits, convert it to inserts into a zero vector.
- if (EVTBits == 8 && NumElems == 16) {
- SDOperand V = LowerBuildVectorv16i8(Op, NonZeros,NumNonZero,NumZero, DAG,
- *this);
- if (V.Val) return V;
- }
-
- if (EVTBits == 16 && NumElems == 8) {
- SDOperand V = LowerBuildVectorv8i16(Op, NonZeros,NumNonZero,NumZero, DAG,
- *this);
- if (V.Val) return V;
- }
-
- // If element VT is == 32 bits, turn it into a number of shuffles.
- SmallVector<SDOperand, 8> V;
- V.resize(NumElems);
- if (NumElems == 4 && NumZero > 0) {
- for (unsigned i = 0; i < 4; ++i) {
- bool isZero = !(NonZeros & (1 << i));
- if (isZero)
- V[i] = getZeroVector(VT, DAG);
- else
- V[i] = DAG.getNode(ISD::SCALAR_TO_VECTOR, VT, Op.getOperand(i));
- }
-
- for (unsigned i = 0; i < 2; ++i) {
- switch ((NonZeros & (0x3 << i*2)) >> (i*2)) {
- default: break;
- case 0:
- V[i] = V[i*2]; // Must be a zero vector.
- break;
- case 1:
- V[i] = DAG.getNode(ISD::VECTOR_SHUFFLE, VT, V[i*2+1], V[i*2],
- getMOVLMask(NumElems, DAG));
- break;
- case 2:
- V[i] = DAG.getNode(ISD::VECTOR_SHUFFLE, VT, V[i*2], V[i*2+1],
- getMOVLMask(NumElems, DAG));
- break;
- case 3:
- V[i] = DAG.getNode(ISD::VECTOR_SHUFFLE, VT, V[i*2], V[i*2+1],
- getUnpacklMask(NumElems, DAG));
- break;
- }
- }
-
- MVT::ValueType MaskVT = MVT::getIntVectorWithNumElements(NumElems);
- MVT::ValueType EVT = MVT::getVectorElementType(MaskVT);
- SmallVector<SDOperand, 8> MaskVec;
- bool Reverse = (NonZeros & 0x3) == 2;
- for (unsigned i = 0; i < 2; ++i)
- if (Reverse)
- MaskVec.push_back(DAG.getConstant(1-i, EVT));
- else
- MaskVec.push_back(DAG.getConstant(i, EVT));
- Reverse = ((NonZeros & (0x3 << 2)) >> 2) == 2;
- for (unsigned i = 0; i < 2; ++i)
- if (Reverse)
- MaskVec.push_back(DAG.getConstant(1-i+NumElems, EVT));
- else
- MaskVec.push_back(DAG.getConstant(i+NumElems, EVT));
- SDOperand ShufMask = DAG.getNode(ISD::BUILD_VECTOR, MaskVT,
- &MaskVec[0], MaskVec.size());
- return DAG.getNode(ISD::VECTOR_SHUFFLE, VT, V[0], V[1], ShufMask);
- }
-
- if (Values.size() > 2) {
- // Expand into a number of unpckl*.
- // e.g. for v4f32
- // Step 1: unpcklps 0, 2 ==> X: <?, ?, 2, 0>
- // : unpcklps 1, 3 ==> Y: <?, ?, 3, 1>
- // Step 2: unpcklps X, Y ==> <3, 2, 1, 0>
- SDOperand UnpckMask = getUnpacklMask(NumElems, DAG);
- for (unsigned i = 0; i < NumElems; ++i)
- V[i] = DAG.getNode(ISD::SCALAR_TO_VECTOR, VT, Op.getOperand(i));
- NumElems >>= 1;
- while (NumElems != 0) {
- for (unsigned i = 0; i < NumElems; ++i)
- V[i] = DAG.getNode(ISD::VECTOR_SHUFFLE, VT, V[i], V[i + NumElems],
- UnpckMask);
- NumElems >>= 1;
- }
- return V[0];
- }
-
- return SDOperand();
-}
-
-static
-SDOperand LowerVECTOR_SHUFFLEv8i16(SDOperand V1, SDOperand V2,
- SDOperand PermMask, SelectionDAG &DAG,
- TargetLowering &TLI) {
- SDOperand NewV;
- MVT::ValueType MaskVT = MVT::getIntVectorWithNumElements(8);
- MVT::ValueType MaskEVT = MVT::getVectorElementType(MaskVT);
- MVT::ValueType PtrVT = TLI.getPointerTy();
- SmallVector<SDOperand, 8> MaskElts(PermMask.Val->op_begin(),
- PermMask.Val->op_end());
-
- // First record which half of which vector the low elements come from.
- SmallVector<unsigned, 4> LowQuad(4);
- for (unsigned i = 0; i < 4; ++i) {
- SDOperand Elt = MaskElts[i];
- if (Elt.getOpcode() == ISD::UNDEF)
- continue;
- unsigned EltIdx = cast<ConstantSDNode>(Elt)->getValue();
- int QuadIdx = EltIdx / 4;
- ++LowQuad[QuadIdx];
- }
- int BestLowQuad = -1;
- unsigned MaxQuad = 1;
- for (unsigned i = 0; i < 4; ++i) {
- if (LowQuad[i] > MaxQuad) {
- BestLowQuad = i;
- MaxQuad = LowQuad[i];
- }
- }
-
- // Record which half of which vector the high elements come from.
- SmallVector<unsigned, 4> HighQuad(4);
- for (unsigned i = 4; i < 8; ++i) {
- SDOperand Elt = MaskElts[i];
- if (Elt.getOpcode() == ISD::UNDEF)
- continue;
- unsigned EltIdx = cast<ConstantSDNode>(Elt)->getValue();
- int QuadIdx = EltIdx / 4;
- ++HighQuad[QuadIdx];
- }
- int BestHighQuad = -1;
- MaxQuad = 1;
- for (unsigned i = 0; i < 4; ++i) {
- if (HighQuad[i] > MaxQuad) {
- BestHighQuad = i;
- MaxQuad = HighQuad[i];
- }
- }
-
- // If it's possible to sort parts of either half with PSHUF{H|L}W, then do it.
- if (BestLowQuad != -1 || BestHighQuad != -1) {
- // First sort the 4 chunks in order using shufpd.
- SmallVector<SDOperand, 8> MaskVec;
- if (BestLowQuad != -1)
- MaskVec.push_back(DAG.getConstant(BestLowQuad, MVT::i32));
- else
- MaskVec.push_back(DAG.getConstant(0, MVT::i32));
- if (BestHighQuad != -1)
- MaskVec.push_back(DAG.getConstant(BestHighQuad, MVT::i32));
- else
- MaskVec.push_back(DAG.getConstant(1, MVT::i32));
- SDOperand Mask= DAG.getNode(ISD::BUILD_VECTOR, MVT::v2i32, &MaskVec[0],2);
- NewV = DAG.getNode(ISD::VECTOR_SHUFFLE, MVT::v2i64,
- DAG.getNode(ISD::BIT_CONVERT, MVT::v2i64, V1),
- DAG.getNode(ISD::BIT_CONVERT, MVT::v2i64, V2), Mask);
- NewV = DAG.getNode(ISD::BIT_CONVERT, MVT::v8i16, NewV);
-
- // Now sort high and low parts separately.
- BitVector InOrder(8);
- if (BestLowQuad != -1) {
- // Sort lower half in order using PSHUFLW.
- MaskVec.clear();
- bool AnyOutOrder = false;
- for (unsigned i = 0; i != 4; ++i) {
- SDOperand Elt = MaskElts[i];
- if (Elt.getOpcode() == ISD::UNDEF) {
- MaskVec.push_back(Elt);
- InOrder.set(i);
- } else {
- unsigned EltIdx = cast<ConstantSDNode>(Elt)->getValue();
- if (EltIdx != i)
- AnyOutOrder = true;
- MaskVec.push_back(DAG.getConstant(EltIdx % 4, MaskEVT));
- // If this element is in the right place after this shuffle, then
- // remember it.
- if ((int)(EltIdx / 4) == BestLowQuad)
- InOrder.set(i);
- }
- }
- if (AnyOutOrder) {
- for (unsigned i = 4; i != 8; ++i)
- MaskVec.push_back(DAG.getConstant(i, MaskEVT));
- SDOperand Mask = DAG.getNode(ISD::BUILD_VECTOR, MaskVT, &MaskVec[0], 8);
- NewV = DAG.getNode(ISD::VECTOR_SHUFFLE, MVT::v8i16, NewV, NewV, Mask);
- }
- }
-
- if (BestHighQuad != -1) {
- // Sort high half in order using PSHUFHW if possible.
- MaskVec.clear();
- for (unsigned i = 0; i != 4; ++i)
- MaskVec.push_back(DAG.getConstant(i, MaskEVT));
- bool AnyOutOrder = false;
- for (unsigned i = 4; i != 8; ++i) {
- SDOperand Elt = MaskElts[i];
- if (Elt.getOpcode() == ISD::UNDEF) {
- MaskVec.push_back(Elt);
- InOrder.set(i);
- } else {
- unsigned EltIdx = cast<ConstantSDNode>(Elt)->getValue();
- if (EltIdx != i)
- AnyOutOrder = true;
- MaskVec.push_back(DAG.getConstant((EltIdx % 4) + 4, MaskEVT));
- // If this element is in the right place after this shuffle, then
- // remember it.
- if ((int)(EltIdx / 4) == BestHighQuad)
- InOrder.set(i);
- }
- }
- if (AnyOutOrder) {
- SDOperand Mask = DAG.getNode(ISD::BUILD_VECTOR, MaskVT, &MaskVec[0], 8);
- NewV = DAG.getNode(ISD::VECTOR_SHUFFLE, MVT::v8i16, NewV, NewV, Mask);
- }
- }
-
- // The other elements are put in the right place using pextrw and pinsrw.
- for (unsigned i = 0; i != 8; ++i) {
- if (InOrder[i])
- continue;
- SDOperand Elt = MaskElts[i];
- unsigned EltIdx = cast<ConstantSDNode>(Elt)->getValue();
- if (EltIdx == i)
- continue;
- SDOperand ExtOp = (EltIdx < 8)
- ? DAG.getNode(ISD::EXTRACT_VECTOR_ELT, MVT::i16, V1,
- DAG.getConstant(EltIdx, PtrVT))
- : DAG.getNode(ISD::EXTRACT_VECTOR_ELT, MVT::i16, V2,
- DAG.getConstant(EltIdx - 8, PtrVT));
- NewV = DAG.getNode(ISD::INSERT_VECTOR_ELT, MVT::v8i16, NewV, ExtOp,
- DAG.getConstant(i, PtrVT));
- }
- return NewV;
- }
-
- // PSHUF{H|L}W are not used. Lower into extracts and inserts but try to use
- ///as few as possible.
- // First, let's find out how many elements are already in the right order.
- unsigned V1InOrder = 0;
- unsigned V1FromV1 = 0;
- unsigned V2InOrder = 0;
- unsigned V2FromV2 = 0;
- SmallVector<SDOperand, 8> V1Elts;
- SmallVector<SDOperand, 8> V2Elts;
- for (unsigned i = 0; i < 8; ++i) {
- SDOperand Elt = MaskElts[i];
- if (Elt.getOpcode() == ISD::UNDEF) {
- V1Elts.push_back(Elt);
- V2Elts.push_back(Elt);
- ++V1InOrder;
- ++V2InOrder;
- continue;
- }
- unsigned EltIdx = cast<ConstantSDNode>(Elt)->getValue();
- if (EltIdx == i) {
- V1Elts.push_back(Elt);
- V2Elts.push_back(DAG.getConstant(i+8, MaskEVT));
- ++V1InOrder;
- } else if (EltIdx == i+8) {
- V1Elts.push_back(Elt);
- V2Elts.push_back(DAG.getConstant(i, MaskEVT));
- ++V2InOrder;
- } else if (EltIdx < 8) {
- V1Elts.push_back(Elt);
- ++V1FromV1;
- } else {
- V2Elts.push_back(DAG.getConstant(EltIdx-8, MaskEVT));
- ++V2FromV2;
- }
- }
-
- if (V2InOrder > V1InOrder) {
- PermMask = CommuteVectorShuffleMask(PermMask, DAG);
- std::swap(V1, V2);
- std::swap(V1Elts, V2Elts);
- std::swap(V1FromV1, V2FromV2);
- }
-
- if ((V1FromV1 + V1InOrder) != 8) {
- // Some elements are from V2.
- if (V1FromV1) {
- // If there are elements that are from V1 but out of place,
- // then first sort them in place
- SmallVector<SDOperand, 8> MaskVec;
- for (unsigned i = 0; i < 8; ++i) {
- SDOperand Elt = V1Elts[i];
- if (Elt.getOpcode() == ISD::UNDEF) {
- MaskVec.push_back(DAG.getNode(ISD::UNDEF, MaskEVT));
- continue;
- }
- unsigned EltIdx = cast<ConstantSDNode>(Elt)->getValue();
- if (EltIdx >= 8)
- MaskVec.push_back(DAG.getNode(ISD::UNDEF, MaskEVT));
- else
- MaskVec.push_back(DAG.getConstant(EltIdx, MaskEVT));
- }
- SDOperand Mask = DAG.getNode(ISD::BUILD_VECTOR, MaskVT, &MaskVec[0], 8);
- V1 = DAG.getNode(ISD::VECTOR_SHUFFLE, MVT::v8i16, V1, V1, Mask);
- }
-
- NewV = V1;
- for (unsigned i = 0; i < 8; ++i) {
- SDOperand Elt = V1Elts[i];
- if (Elt.getOpcode() == ISD::UNDEF)
- continue;
- unsigned EltIdx = cast<ConstantSDNode>(Elt)->getValue();
- if (EltIdx < 8)
- continue;
- SDOperand ExtOp = DAG.getNode(ISD::EXTRACT_VECTOR_ELT, MVT::i16, V2,
- DAG.getConstant(EltIdx - 8, PtrVT));
- NewV = DAG.getNode(ISD::INSERT_VECTOR_ELT, MVT::v8i16, NewV, ExtOp,
- DAG.getConstant(i, PtrVT));
- }
- return NewV;
- } else {
- // All elements are from V1.
- NewV = V1;
- for (unsigned i = 0; i < 8; ++i) {
- SDOperand Elt = V1Elts[i];
- if (Elt.getOpcode() == ISD::UNDEF)
- continue;
- unsigned EltIdx = cast<ConstantSDNode>(Elt)->getValue();
- SDOperand ExtOp = DAG.getNode(ISD::EXTRACT_VECTOR_ELT, MVT::i16, V1,
- DAG.getConstant(EltIdx, PtrVT));
- NewV = DAG.getNode(ISD::INSERT_VECTOR_ELT, MVT::v8i16, NewV, ExtOp,
- DAG.getConstant(i, PtrVT));
- }
- return NewV;
- }
-}
-
-/// RewriteAsNarrowerShuffle - Try rewriting v8i16 and v16i8 shuffles as 4 wide
-/// ones, or rewriting v4i32 / v2f32 as 2 wide ones if possible. This can be
-/// done when every pair / quad of shuffle mask elements point to elements in
-/// the right sequence. e.g.
-/// vector_shuffle <>, <>, < 3, 4, | 10, 11, | 0, 1, | 14, 15>
-static
-SDOperand RewriteAsNarrowerShuffle(SDOperand V1, SDOperand V2,
- MVT::ValueType VT,
- SDOperand PermMask, SelectionDAG &DAG,
- TargetLowering &TLI) {
- unsigned NumElems = PermMask.getNumOperands();
- unsigned NewWidth = (NumElems == 4) ? 2 : 4;
- MVT::ValueType MaskVT = MVT::getIntVectorWithNumElements(NewWidth);
- MVT::ValueType NewVT = MaskVT;
- switch (VT) {
- case MVT::v4f32: NewVT = MVT::v2f64; break;
- case MVT::v4i32: NewVT = MVT::v2i64; break;
- case MVT::v8i16: NewVT = MVT::v4i32; break;
- case MVT::v16i8: NewVT = MVT::v4i32; break;
- default: assert(false && "Unexpected!");
- }
-
- if (NewWidth == 2) {
- if (MVT::isInteger(VT))
- NewVT = MVT::v2i64;
- else
- NewVT = MVT::v2f64;
- }
- unsigned Scale = NumElems / NewWidth;
- SmallVector<SDOperand, 8> MaskVec;
- for (unsigned i = 0; i < NumElems; i += Scale) {
- unsigned StartIdx = ~0U;
- for (unsigned j = 0; j < Scale; ++j) {
- SDOperand Elt = PermMask.getOperand(i+j);
- if (Elt.getOpcode() == ISD::UNDEF)
- continue;
- unsigned EltIdx = cast<ConstantSDNode>(Elt)->getValue();
- if (StartIdx == ~0U)
- StartIdx = EltIdx - (EltIdx % Scale);
- if (EltIdx != StartIdx + j)
- return SDOperand();
- }
- if (StartIdx == ~0U)
- MaskVec.push_back(DAG.getNode(ISD::UNDEF, MVT::i32));
- else
- MaskVec.push_back(DAG.getConstant(StartIdx / Scale, MVT::i32));
- }
-
- V1 = DAG.getNode(ISD::BIT_CONVERT, NewVT, V1);
- V2 = DAG.getNode(ISD::BIT_CONVERT, NewVT, V2);
- return DAG.getNode(ISD::VECTOR_SHUFFLE, NewVT, V1, V2,
- DAG.getNode(ISD::BUILD_VECTOR, MaskVT,
- &MaskVec[0], MaskVec.size()));
-}
-
-/// getVZextMovL - Return a zero-extending vector move low node.
-///
-static SDOperand getVZextMovL(MVT::ValueType VT, MVT::ValueType OpVT,
- SDOperand SrcOp, SelectionDAG &DAG,
- const X86Subtarget *Subtarget) {
- if (VT == MVT::v2f64 || VT == MVT::v4f32) {
- LoadSDNode *LD = NULL;
- if (!isScalarLoadToVector(SrcOp.Val, &LD))
- LD = dyn_cast<LoadSDNode>(SrcOp);
- if (!LD) {
- // movssrr and movsdrr do not clear top bits. Try to use movd, movq
- // instead.
- MVT::ValueType EVT = (OpVT == MVT::v2f64) ? MVT::i64 : MVT::i32;
- if ((EVT != MVT::i64 || Subtarget->is64Bit()) &&
- SrcOp.getOpcode() == ISD::SCALAR_TO_VECTOR &&
- SrcOp.getOperand(0).getOpcode() == ISD::BIT_CONVERT &&
- SrcOp.getOperand(0).getOperand(0).getValueType() == EVT) {
- // PR2108
- OpVT = (OpVT == MVT::v2f64) ? MVT::v2i64 : MVT::v4i32;
- return DAG.getNode(ISD::BIT_CONVERT, VT,
- DAG.getNode(X86ISD::VZEXT_MOVL, OpVT,
- DAG.getNode(ISD::SCALAR_TO_VECTOR, OpVT,
- SrcOp.getOperand(0).getOperand(0))));
- }
- }
- }
-
- return DAG.getNode(ISD::BIT_CONVERT, VT,
- DAG.getNode(X86ISD::VZEXT_MOVL, OpVT,
- DAG.getNode(ISD::BIT_CONVERT, OpVT, SrcOp)));
-}
-
-SDOperand
-X86TargetLowering::LowerVECTOR_SHUFFLE(SDOperand Op, SelectionDAG &DAG) {
- SDOperand V1 = Op.getOperand(0);
- SDOperand V2 = Op.getOperand(1);
- SDOperand PermMask = Op.getOperand(2);
- MVT::ValueType VT = Op.getValueType();
- unsigned NumElems = PermMask.getNumOperands();
- bool isMMX = MVT::getSizeInBits(VT) == 64;
- bool V1IsUndef = V1.getOpcode() == ISD::UNDEF;
- bool V2IsUndef = V2.getOpcode() == ISD::UNDEF;
- bool V1IsSplat = false;
- bool V2IsSplat = false;
-
- if (isUndefShuffle(Op.Val))
- return DAG.getNode(ISD::UNDEF, VT);
-
- if (isZeroShuffle(Op.Val))
- return getZeroVector(VT, DAG);
-
- if (isIdentityMask(PermMask.Val))
- return V1;
- else if (isIdentityMask(PermMask.Val, true))
- return V2;
-
- if (isSplatMask(PermMask.Val)) {
- if (isMMX || NumElems < 4) return Op;
- // Promote it to a v4{if}32 splat.
- return PromoteSplat(Op, DAG, Subtarget->hasSSE2());
- }
-
- // If the shuffle can be profitably rewritten as a narrower shuffle, then
- // do it!
- if (VT == MVT::v8i16 || VT == MVT::v16i8) {
- SDOperand NewOp= RewriteAsNarrowerShuffle(V1, V2, VT, PermMask, DAG, *this);
- if (NewOp.Val)
- return DAG.getNode(ISD::BIT_CONVERT, VT, LowerVECTOR_SHUFFLE(NewOp, DAG));
- } else if ((VT == MVT::v4i32 || (VT == MVT::v4f32 && Subtarget->hasSSE2()))) {
- // FIXME: Figure out a cleaner way to do this.
- // Try to make use of movq to zero out the top part.
- if (ISD::isBuildVectorAllZeros(V2.Val)) {
- SDOperand NewOp = RewriteAsNarrowerShuffle(V1, V2, VT, PermMask,
- DAG, *this);
- if (NewOp.Val) {
- SDOperand NewV1 = NewOp.getOperand(0);
- SDOperand NewV2 = NewOp.getOperand(1);
- SDOperand NewMask = NewOp.getOperand(2);
- if (isCommutedMOVL(NewMask.Val, true, false)) {
- NewOp = CommuteVectorShuffle(NewOp, NewV1, NewV2, NewMask, DAG);
- return getVZextMovL(VT, NewOp.getValueType(), NewV2, DAG, Subtarget);
- }
- }
- } else if (ISD::isBuildVectorAllZeros(V1.Val)) {
- SDOperand NewOp= RewriteAsNarrowerShuffle(V1, V2, VT, PermMask,
- DAG, *this);
- if (NewOp.Val && X86::isMOVLMask(NewOp.getOperand(2).Val))
- return getVZextMovL(VT, NewOp.getValueType(), NewOp.getOperand(1),
- DAG, Subtarget);
- }
- }
-
- if (X86::isMOVLMask(PermMask.Val)) {
- if (V1IsUndef)
- return V2;
- if (ISD::isBuildVectorAllZeros(V1.Val))
- return getVZextMovL(VT, VT, V2, DAG, Subtarget);
- return Op;
- }
-
- if (X86::isMOVSHDUPMask(PermMask.Val) ||
- X86::isMOVSLDUPMask(PermMask.Val) ||
- X86::isMOVHLPSMask(PermMask.Val) ||
- X86::isMOVHPMask(PermMask.Val) ||
- X86::isMOVLPMask(PermMask.Val))
- return Op;
-
- if (ShouldXformToMOVHLPS(PermMask.Val) ||
- ShouldXformToMOVLP(V1.Val, V2.Val, PermMask.Val))
- return CommuteVectorShuffle(Op, V1, V2, PermMask, DAG);
-
- bool Commuted = false;
- // FIXME: This should also accept a bitcast of a splat? Be careful, not
- // 1,1,1,1 -> v8i16 though.
- V1IsSplat = isSplatVector(V1.Val);
- V2IsSplat = isSplatVector(V2.Val);
-
- // Canonicalize the splat or undef, if present, to be on the RHS.
- if ((V1IsSplat || V1IsUndef) && !(V2IsSplat || V2IsUndef)) {
- Op = CommuteVectorShuffle(Op, V1, V2, PermMask, DAG);
- std::swap(V1IsSplat, V2IsSplat);
- std::swap(V1IsUndef, V2IsUndef);
- Commuted = true;
- }
-
- // FIXME: Figure out a cleaner way to do this.
- if (isCommutedMOVL(PermMask.Val, V2IsSplat, V2IsUndef)) {
- if (V2IsUndef) return V1;
- Op = CommuteVectorShuffle(Op, V1, V2, PermMask, DAG);
- if (V2IsSplat) {
- // V2 is a splat, so the mask may be malformed. That is, it may point
- // to any V2 element. The instruction selectior won't like this. Get
- // a corrected mask and commute to form a proper MOVS{S|D}.
- SDOperand NewMask = getMOVLMask(NumElems, DAG);
- if (NewMask.Val != PermMask.Val)
- Op = DAG.getNode(ISD::VECTOR_SHUFFLE, VT, V1, V2, NewMask);
- }
- return Op;
- }
-
- if (X86::isUNPCKL_v_undef_Mask(PermMask.Val) ||
- X86::isUNPCKH_v_undef_Mask(PermMask.Val) ||
- X86::isUNPCKLMask(PermMask.Val) ||
- X86::isUNPCKHMask(PermMask.Val))
- return Op;
-
- if (V2IsSplat) {
- // Normalize mask so all entries that point to V2 points to its first
- // element then try to match unpck{h|l} again. If match, return a
- // new vector_shuffle with the corrected mask.
- SDOperand NewMask = NormalizeMask(PermMask, DAG);
- if (NewMask.Val != PermMask.Val) {
- if (X86::isUNPCKLMask(PermMask.Val, true)) {
- SDOperand NewMask = getUnpacklMask(NumElems, DAG);
- return DAG.getNode(ISD::VECTOR_SHUFFLE, VT, V1, V2, NewMask);
- } else if (X86::isUNPCKHMask(PermMask.Val, true)) {
- SDOperand NewMask = getUnpackhMask(NumElems, DAG);
- return DAG.getNode(ISD::VECTOR_SHUFFLE, VT, V1, V2, NewMask);
- }
- }
- }
-
- // Normalize the node to match x86 shuffle ops if needed
- if (V2.getOpcode() != ISD::UNDEF && isCommutedSHUFP(PermMask.Val))
- Op = CommuteVectorShuffle(Op, V1, V2, PermMask, DAG);
-
- if (Commuted) {
- // Commute is back and try unpck* again.
- Op = CommuteVectorShuffle(Op, V1, V2, PermMask, DAG);
- if (X86::isUNPCKL_v_undef_Mask(PermMask.Val) ||
- X86::isUNPCKH_v_undef_Mask(PermMask.Val) ||
- X86::isUNPCKLMask(PermMask.Val) ||
- X86::isUNPCKHMask(PermMask.Val))
- return Op;
- }
-
- // Try PSHUF* first, then SHUFP*.
- // MMX doesn't have PSHUFD but it does have PSHUFW. While it's theoretically
- // possible to shuffle a v2i32 using PSHUFW, that's not yet implemented.
- if (isMMX && NumElems == 4 && X86::isPSHUFDMask(PermMask.Val)) {
- if (V2.getOpcode() != ISD::UNDEF)
- return DAG.getNode(ISD::VECTOR_SHUFFLE, VT, V1,
- DAG.getNode(ISD::UNDEF, VT), PermMask);
- return Op;
- }
-
- if (!isMMX) {
- if (Subtarget->hasSSE2() &&
- (X86::isPSHUFDMask(PermMask.Val) ||
- X86::isPSHUFHWMask(PermMask.Val) ||
- X86::isPSHUFLWMask(PermMask.Val))) {
- MVT::ValueType RVT = VT;
- if (VT == MVT::v4f32) {
- RVT = MVT::v4i32;
- Op = DAG.getNode(ISD::VECTOR_SHUFFLE, RVT,
- DAG.getNode(ISD::BIT_CONVERT, RVT, V1),
- DAG.getNode(ISD::UNDEF, RVT), PermMask);
- } else if (V2.getOpcode() != ISD::UNDEF)
- Op = DAG.getNode(ISD::VECTOR_SHUFFLE, RVT, V1,
- DAG.getNode(ISD::UNDEF, RVT), PermMask);
- if (RVT != VT)
- Op = DAG.getNode(ISD::BIT_CONVERT, VT, Op);
- return Op;
- }
-
- // Binary or unary shufps.
- if (X86::isSHUFPMask(PermMask.Val) ||
- (V2.getOpcode() == ISD::UNDEF && X86::isPSHUFDMask(PermMask.Val)))
- return Op;
- }
-
- // Handle v8i16 specifically since SSE can do byte extraction and insertion.
- if (VT == MVT::v8i16) {
- SDOperand NewOp = LowerVECTOR_SHUFFLEv8i16(V1, V2, PermMask, DAG, *this);
- if (NewOp.Val)
- return NewOp;
- }
-
- // Handle all 4 wide cases with a number of shuffles.
- if (NumElems == 4 && !isMMX) {
- // Don't do this for MMX.
- MVT::ValueType MaskVT = PermMask.getValueType();
- MVT::ValueType MaskEVT = MVT::getVectorElementType(MaskVT);
- SmallVector<std::pair<int, int>, 8> Locs;
- Locs.reserve(NumElems);
- SmallVector<SDOperand, 8> Mask1(NumElems,
- DAG.getNode(ISD::UNDEF, MaskEVT));
- SmallVector<SDOperand, 8> Mask2(NumElems,
- DAG.getNode(ISD::UNDEF, MaskEVT));
- unsigned NumHi = 0;
- unsigned NumLo = 0;
- // If no more than two elements come from either vector. This can be
- // implemented with two shuffles. First shuffle gather the elements.
- // The second shuffle, which takes the first shuffle as both of its
- // vector operands, put the elements into the right order.
- for (unsigned i = 0; i != NumElems; ++i) {
- SDOperand Elt = PermMask.getOperand(i);
- if (Elt.getOpcode() == ISD::UNDEF) {
- Locs[i] = std::make_pair(-1, -1);
- } else {
- unsigned Val = cast<ConstantSDNode>(Elt)->getValue();
- if (Val < NumElems) {
- Locs[i] = std::make_pair(0, NumLo);
- Mask1[NumLo] = Elt;
- NumLo++;
- } else {
- Locs[i] = std::make_pair(1, NumHi);
- if (2+NumHi < NumElems)
- Mask1[2+NumHi] = Elt;
- NumHi++;
- }
- }
- }
- if (NumLo <= 2 && NumHi <= 2) {
- V1 = DAG.getNode(ISD::VECTOR_SHUFFLE, VT, V1, V2,
- DAG.getNode(ISD::BUILD_VECTOR, MaskVT,
- &Mask1[0], Mask1.size()));
- for (unsigned i = 0; i != NumElems; ++i) {
- if (Locs[i].first == -1)
- continue;
- else {
- unsigned Idx = (i < NumElems/2) ? 0 : NumElems;
- Idx += Locs[i].first * (NumElems/2) + Locs[i].second;
- Mask2[i] = DAG.getConstant(Idx, MaskEVT);
- }
- }
-
- return DAG.getNode(ISD::VECTOR_SHUFFLE, VT, V1, V1,
- DAG.getNode(ISD::BUILD_VECTOR, MaskVT,
- &Mask2[0], Mask2.size()));
- }
-
- // Break it into (shuffle shuffle_hi, shuffle_lo).
- Locs.clear();
- SmallVector<SDOperand,8> LoMask(NumElems, DAG.getNode(ISD::UNDEF, MaskEVT));
- SmallVector<SDOperand,8> HiMask(NumElems, DAG.getNode(ISD::UNDEF, MaskEVT));
- SmallVector<SDOperand,8> *MaskPtr = &LoMask;
- unsigned MaskIdx = 0;
- unsigned LoIdx = 0;
- unsigned HiIdx = NumElems/2;
- for (unsigned i = 0; i != NumElems; ++i) {
- if (i == NumElems/2) {
- MaskPtr = &HiMask;
- MaskIdx = 1;
- LoIdx = 0;
- HiIdx = NumElems/2;
- }
- SDOperand Elt = PermMask.getOperand(i);
- if (Elt.getOpcode() == ISD::UNDEF) {
- Locs[i] = std::make_pair(-1, -1);
- } else if (cast<ConstantSDNode>(Elt)->getValue() < NumElems) {
- Locs[i] = std::make_pair(MaskIdx, LoIdx);
- (*MaskPtr)[LoIdx] = Elt;
- LoIdx++;
- } else {
- Locs[i] = std::make_pair(MaskIdx, HiIdx);
- (*MaskPtr)[HiIdx] = Elt;
- HiIdx++;
- }
- }
-
- SDOperand LoShuffle =
- DAG.getNode(ISD::VECTOR_SHUFFLE, VT, V1, V2,
- DAG.getNode(ISD::BUILD_VECTOR, MaskVT,
- &LoMask[0], LoMask.size()));
- SDOperand HiShuffle =
- DAG.getNode(ISD::VECTOR_SHUFFLE, VT, V1, V2,
- DAG.getNode(ISD::BUILD_VECTOR, MaskVT,
- &HiMask[0], HiMask.size()));
- SmallVector<SDOperand, 8> MaskOps;
- for (unsigned i = 0; i != NumElems; ++i) {
- if (Locs[i].first == -1) {
- MaskOps.push_back(DAG.getNode(ISD::UNDEF, MaskEVT));
- } else {
- unsigned Idx = Locs[i].first * NumElems + Locs[i].second;
- MaskOps.push_back(DAG.getConstant(Idx, MaskEVT));
- }
- }
- return DAG.getNode(ISD::VECTOR_SHUFFLE, VT, LoShuffle, HiShuffle,
- DAG.getNode(ISD::BUILD_VECTOR, MaskVT,
- &MaskOps[0], MaskOps.size()));
- }
-
- return SDOperand();
-}
-
-SDOperand
-X86TargetLowering::LowerEXTRACT_VECTOR_ELT_SSE4(SDOperand Op,
- SelectionDAG &DAG) {
- MVT::ValueType VT = Op.getValueType();
- if (MVT::getSizeInBits(VT) == 8) {
- SDOperand Extract = DAG.getNode(X86ISD::PEXTRB, MVT::i32,
- Op.getOperand(0), Op.getOperand(1));
- SDOperand Assert = DAG.getNode(ISD::AssertZext, MVT::i32, Extract,
- DAG.getValueType(VT));
- return DAG.getNode(ISD::TRUNCATE, VT, Assert);
- } else if (MVT::getSizeInBits(VT) == 16) {
- SDOperand Extract = DAG.getNode(X86ISD::PEXTRW, MVT::i32,
- Op.getOperand(0), Op.getOperand(1));
- SDOperand Assert = DAG.getNode(ISD::AssertZext, MVT::i32, Extract,
- DAG.getValueType(VT));
- return DAG.getNode(ISD::TRUNCATE, VT, Assert);
- } else if (VT == MVT::f32) {
- // EXTRACTPS outputs to a GPR32 register which will require a movd to copy
- // the result back to FR32 register. It's only worth matching if the
- // result has a single use which is a store or a bitcast to i32.
- if (!Op.hasOneUse())
- return SDOperand();
- SDNode *User = Op.Val->use_begin()->getUser();
- if (User->getOpcode() != ISD::STORE &&
- (User->getOpcode() != ISD::BIT_CONVERT ||
- User->getValueType(0) != MVT::i32))
- return SDOperand();
- SDOperand Extract = DAG.getNode(ISD::EXTRACT_VECTOR_ELT, MVT::i32,
- DAG.getNode(ISD::BIT_CONVERT, MVT::v4i32, Op.getOperand(0)),
- Op.getOperand(1));
- return DAG.getNode(ISD::BIT_CONVERT, MVT::f32, Extract);
- }
- return SDOperand();
-}
-
-
-SDOperand
-X86TargetLowering::LowerEXTRACT_VECTOR_ELT(SDOperand Op, SelectionDAG &DAG) {
- if (!isa<ConstantSDNode>(Op.getOperand(1)))
- return SDOperand();
-
- if (Subtarget->hasSSE41()) {
- SDOperand Res = LowerEXTRACT_VECTOR_ELT_SSE4(Op, DAG);
- if (Res.Val)
- return Res;
- }
-
- MVT::ValueType VT = Op.getValueType();
- // TODO: handle v16i8.
- if (MVT::getSizeInBits(VT) == 16) {
- SDOperand Vec = Op.getOperand(0);
- unsigned Idx = cast<ConstantSDNode>(Op.getOperand(1))->getValue();
- if (Idx == 0)
- return DAG.getNode(ISD::TRUNCATE, MVT::i16,
- DAG.getNode(ISD::EXTRACT_VECTOR_ELT, MVT::i32,
- DAG.getNode(ISD::BIT_CONVERT, MVT::v4i32, Vec),
- Op.getOperand(1)));
- // Transform it so it match pextrw which produces a 32-bit result.
- MVT::ValueType EVT = (MVT::ValueType)(VT+1);
- SDOperand Extract = DAG.getNode(X86ISD::PEXTRW, EVT,
- Op.getOperand(0), Op.getOperand(1));
- SDOperand Assert = DAG.getNode(ISD::AssertZext, EVT, Extract,
- DAG.getValueType(VT));
- return DAG.getNode(ISD::TRUNCATE, VT, Assert);
- } else if (MVT::getSizeInBits(VT) == 32) {
- unsigned Idx = cast<ConstantSDNode>(Op.getOperand(1))->getValue();
- if (Idx == 0)
- return Op;
- // SHUFPS the element to the lowest double word, then movss.
- MVT::ValueType MaskVT = MVT::getIntVectorWithNumElements(4);
- SmallVector<SDOperand, 8> IdxVec;
- IdxVec.
- push_back(DAG.getConstant(Idx, MVT::getVectorElementType(MaskVT)));
- IdxVec.
- push_back(DAG.getNode(ISD::UNDEF, MVT::getVectorElementType(MaskVT)));
- IdxVec.
- push_back(DAG.getNode(ISD::UNDEF, MVT::getVectorElementType(MaskVT)));
- IdxVec.
- push_back(DAG.getNode(ISD::UNDEF, MVT::getVectorElementType(MaskVT)));
- SDOperand Mask = DAG.getNode(ISD::BUILD_VECTOR, MaskVT,
- &IdxVec[0], IdxVec.size());
- SDOperand Vec = Op.getOperand(0);
- Vec = DAG.getNode(ISD::VECTOR_SHUFFLE, Vec.getValueType(),
- Vec, DAG.getNode(ISD::UNDEF, Vec.getValueType()), Mask);
- return DAG.getNode(ISD::EXTRACT_VECTOR_ELT, VT, Vec,
- DAG.getIntPtrConstant(0));
- } else if (MVT::getSizeInBits(VT) == 64) {
- // FIXME: .td only matches this for <2 x f64>, not <2 x i64> on 32b
- // FIXME: seems like this should be unnecessary if mov{h,l}pd were taught
- // to match extract_elt for f64.
- unsigned Idx = cast<ConstantSDNode>(Op.getOperand(1))->getValue();
- if (Idx == 0)
- return Op;
-
- // UNPCKHPD the element to the lowest double word, then movsd.
- // Note if the lower 64 bits of the result of the UNPCKHPD is then stored
- // to a f64mem, the whole operation is folded into a single MOVHPDmr.
- MVT::ValueType MaskVT = MVT::getIntVectorWithNumElements(4);
- SmallVector<SDOperand, 8> IdxVec;
- IdxVec.push_back(DAG.getConstant(1, MVT::getVectorElementType(MaskVT)));
- IdxVec.
- push_back(DAG.getNode(ISD::UNDEF, MVT::getVectorElementType(MaskVT)));
- SDOperand Mask = DAG.getNode(ISD::BUILD_VECTOR, MaskVT,
- &IdxVec[0], IdxVec.size());
- SDOperand Vec = Op.getOperand(0);
- Vec = DAG.getNode(ISD::VECTOR_SHUFFLE, Vec.getValueType(),
- Vec, DAG.getNode(ISD::UNDEF, Vec.getValueType()), Mask);
- return DAG.getNode(ISD::EXTRACT_VECTOR_ELT, VT, Vec,
- DAG.getIntPtrConstant(0));
- }
-
- return SDOperand();
-}
-
-SDOperand
-X86TargetLowering::LowerINSERT_VECTOR_ELT_SSE4(SDOperand Op, SelectionDAG &DAG){
- MVT::ValueType VT = Op.getValueType();
- MVT::ValueType EVT = MVT::getVectorElementType(VT);
-
- SDOperand N0 = Op.getOperand(0);
- SDOperand N1 = Op.getOperand(1);
- SDOperand N2 = Op.getOperand(2);
-
- if ((MVT::getSizeInBits(EVT) == 8) || (MVT::getSizeInBits(EVT) == 16)) {
- unsigned Opc = (MVT::getSizeInBits(EVT) == 8) ? X86ISD::PINSRB
- : X86ISD::PINSRW;
- // Transform it so it match pinsr{b,w} which expects a GR32 as its second
- // argument.
- if (N1.getValueType() != MVT::i32)
- N1 = DAG.getNode(ISD::ANY_EXTEND, MVT::i32, N1);
- if (N2.getValueType() != MVT::i32)
- N2 = DAG.getIntPtrConstant(cast<ConstantSDNode>(N2)->getValue());
- return DAG.getNode(Opc, VT, N0, N1, N2);
- } else if (EVT == MVT::f32) {
- // Bits [7:6] of the constant are the source select. This will always be
- // zero here. The DAG Combiner may combine an extract_elt index into these
- // bits. For example (insert (extract, 3), 2) could be matched by putting
- // the '3' into bits [7:6] of X86ISD::INSERTPS.
- // Bits [5:4] of the constant are the destination select. This is the
- // value of the incoming immediate.
- // Bits [3:0] of the constant are the zero mask. The DAG Combiner may
- // combine either bitwise AND or insert of float 0.0 to set these bits.
- N2 = DAG.getIntPtrConstant(cast<ConstantSDNode>(N2)->getValue() << 4);
- return DAG.getNode(X86ISD::INSERTPS, VT, N0, N1, N2);
- }
- return SDOperand();
-}
-
-SDOperand
-X86TargetLowering::LowerINSERT_VECTOR_ELT(SDOperand Op, SelectionDAG &DAG) {
- MVT::ValueType VT = Op.getValueType();
- MVT::ValueType EVT = MVT::getVectorElementType(VT);
-
- if (Subtarget->hasSSE41())
- return LowerINSERT_VECTOR_ELT_SSE4(Op, DAG);
-
- if (EVT == MVT::i8)
- return SDOperand();
-
- SDOperand N0 = Op.getOperand(0);
- SDOperand N1 = Op.getOperand(1);
- SDOperand N2 = Op.getOperand(2);
-
- if (MVT::getSizeInBits(EVT) == 16) {
- // Transform it so it match pinsrw which expects a 16-bit value in a GR32
- // as its second argument.
- if (N1.getValueType() != MVT::i32)
- N1 = DAG.getNode(ISD::ANY_EXTEND, MVT::i32, N1);
- if (N2.getValueType() != MVT::i32)
- N2 = DAG.getIntPtrConstant(cast<ConstantSDNode>(N2)->getValue());
- return DAG.getNode(X86ISD::PINSRW, VT, N0, N1, N2);
- }
- return SDOperand();
-}
-
-SDOperand
-X86TargetLowering::LowerSCALAR_TO_VECTOR(SDOperand Op, SelectionDAG &DAG) {
- SDOperand AnyExt = DAG.getNode(ISD::ANY_EXTEND, MVT::i32, Op.getOperand(0));
- MVT::ValueType VT = MVT::v2i32;
- switch (Op.getValueType()) {
- default: break;
- case MVT::v16i8:
- case MVT::v8i16:
- VT = MVT::v4i32;
- break;
- }
- return DAG.getNode(ISD::BIT_CONVERT, Op.getValueType(),
- DAG.getNode(ISD::SCALAR_TO_VECTOR, VT, AnyExt));
-}
-
-// ConstantPool, JumpTable, GlobalAddress, and ExternalSymbol are lowered as
-// their target countpart wrapped in the X86ISD::Wrapper node. Suppose N is
-// one of the above mentioned nodes. It has to be wrapped because otherwise
-// Select(N) returns N. So the raw TargetGlobalAddress nodes, etc. can only
-// be used to form addressing mode. These wrapped nodes will be selected
-// into MOV32ri.
-SDOperand
-X86TargetLowering::LowerConstantPool(SDOperand Op, SelectionDAG &DAG) {
- ConstantPoolSDNode *CP = cast<ConstantPoolSDNode>(Op);
- SDOperand Result = DAG.getTargetConstantPool(CP->getConstVal(),
- getPointerTy(),
- CP->getAlignment());
- Result = DAG.getNode(X86ISD::Wrapper, getPointerTy(), Result);
- // With PIC, the address is actually $g + Offset.
- if (getTargetMachine().getRelocationModel() == Reloc::PIC_ &&
- !Subtarget->isPICStyleRIPRel()) {
- Result = DAG.getNode(ISD::ADD, getPointerTy(),
- DAG.getNode(X86ISD::GlobalBaseReg, getPointerTy()),
- Result);
- }
-
- return Result;
-}
-
-SDOperand
-X86TargetLowering::LowerGlobalAddress(SDOperand Op, SelectionDAG &DAG) {
- GlobalValue *GV = cast<GlobalAddressSDNode>(Op)->getGlobal();
- SDOperand Result = DAG.getTargetGlobalAddress(GV, getPointerTy());
- // If it's a debug information descriptor, don't mess with it.
- if (DAG.isVerifiedDebugInfoDesc(Op))
- return Result;
- Result = DAG.getNode(X86ISD::Wrapper, getPointerTy(), Result);
- // With PIC, the address is actually $g + Offset.
- if (getTargetMachine().getRelocationModel() == Reloc::PIC_ &&
- !Subtarget->isPICStyleRIPRel()) {
- Result = DAG.getNode(ISD::ADD, getPointerTy(),
- DAG.getNode(X86ISD::GlobalBaseReg, getPointerTy()),
- Result);
- }
-
- // For Darwin & Mingw32, external and weak symbols are indirect, so we want to
- // load the value at address GV, not the value of GV itself. This means that
- // the GlobalAddress must be in the base or index register of the address, not
- // the GV offset field. Platform check is inside GVRequiresExtraLoad() call
- // The same applies for external symbols during PIC codegen
- if (Subtarget->GVRequiresExtraLoad(GV, getTargetMachine(), false))
- Result = DAG.getLoad(getPointerTy(), DAG.getEntryNode(), Result,
- PseudoSourceValue::getGOT(), 0);
-
- return Result;
-}
-
-// Lower ISD::GlobalTLSAddress using the "general dynamic" model, 32 bit
-static SDOperand
-LowerToTLSGeneralDynamicModel32(GlobalAddressSDNode *GA, SelectionDAG &DAG,
- const MVT::ValueType PtrVT) {
- SDOperand InFlag;
- SDOperand Chain = DAG.getCopyToReg(DAG.getEntryNode(), X86::EBX,
- DAG.getNode(X86ISD::GlobalBaseReg,
- PtrVT), InFlag);
- InFlag = Chain.getValue(1);
-
- // emit leal symbol@TLSGD(,%ebx,1), %eax
- SDVTList NodeTys = DAG.getVTList(PtrVT, MVT::Other, MVT::Flag);
- SDOperand TGA = DAG.getTargetGlobalAddress(GA->getGlobal(),
- GA->getValueType(0),
- GA->getOffset());
- SDOperand Ops[] = { Chain, TGA, InFlag };
- SDOperand Result = DAG.getNode(X86ISD::TLSADDR, NodeTys, Ops, 3);
- InFlag = Result.getValue(2);
- Chain = Result.getValue(1);
-
- // call ___tls_get_addr. This function receives its argument in
- // the register EAX.
- Chain = DAG.getCopyToReg(Chain, X86::EAX, Result, InFlag);
- InFlag = Chain.getValue(1);
-
- NodeTys = DAG.getVTList(MVT::Other, MVT::Flag);
- SDOperand Ops1[] = { Chain,
- DAG.getTargetExternalSymbol("___tls_get_addr",
- PtrVT),
- DAG.getRegister(X86::EAX, PtrVT),
- DAG.getRegister(X86::EBX, PtrVT),
- InFlag };
- Chain = DAG.getNode(X86ISD::CALL, NodeTys, Ops1, 5);
- InFlag = Chain.getValue(1);
-
- return DAG.getCopyFromReg(Chain, X86::EAX, PtrVT, InFlag);
-}
-
-// Lower ISD::GlobalTLSAddress using the "general dynamic" model, 64 bit
-static SDOperand
-LowerToTLSGeneralDynamicModel64(GlobalAddressSDNode *GA, SelectionDAG &DAG,
- const MVT::ValueType PtrVT) {
- SDOperand InFlag, Chain;
-
- // emit leaq symbol@TLSGD(%rip), %rdi
- SDVTList NodeTys = DAG.getVTList(PtrVT, MVT::Other, MVT::Flag);
- SDOperand TGA = DAG.getTargetGlobalAddress(GA->getGlobal(),
- GA->getValueType(0),
- GA->getOffset());
- SDOperand Ops[] = { DAG.getEntryNode(), TGA};
- SDOperand Result = DAG.getNode(X86ISD::TLSADDR, NodeTys, Ops, 2);
- Chain = Result.getValue(1);
- InFlag = Result.getValue(2);
-
- // call ___tls_get_addr. This function receives its argument in
- // the register RDI.
- Chain = DAG.getCopyToReg(Chain, X86::RDI, Result, InFlag);
- InFlag = Chain.getValue(1);
-
- NodeTys = DAG.getVTList(MVT::Other, MVT::Flag);
- SDOperand Ops1[] = { Chain,
- DAG.getTargetExternalSymbol("___tls_get_addr",
- PtrVT),
- DAG.getRegister(X86::RDI, PtrVT),
- InFlag };
- Chain = DAG.getNode(X86ISD::CALL, NodeTys, Ops1, 4);
- InFlag = Chain.getValue(1);
-
- return DAG.getCopyFromReg(Chain, X86::RAX, PtrVT, InFlag);
-}
-
-// Lower ISD::GlobalTLSAddress using the "initial exec" (for no-pic) or
-// "local exec" model.
-static SDOperand
-LowerToTLSExecModel(GlobalAddressSDNode *GA, SelectionDAG &DAG,
- const MVT::ValueType PtrVT) {
- // Get the Thread Pointer
- SDOperand ThreadPointer = DAG.getNode(X86ISD::THREAD_POINTER, PtrVT);
- // emit "addl x@ntpoff,%eax" (local exec) or "addl x@indntpoff,%eax" (initial
- // exec)
- SDOperand TGA = DAG.getTargetGlobalAddress(GA->getGlobal(),
- GA->getValueType(0),
- GA->getOffset());
- SDOperand Offset = DAG.getNode(X86ISD::Wrapper, PtrVT, TGA);
-
- if (GA->getGlobal()->isDeclaration()) // initial exec TLS model
- Offset = DAG.getLoad(PtrVT, DAG.getEntryNode(), Offset,
- PseudoSourceValue::getGOT(), 0);
-
- // The address of the thread local variable is the add of the thread
- // pointer with the offset of the variable.
- return DAG.getNode(ISD::ADD, PtrVT, ThreadPointer, Offset);
-}
-
-SDOperand
-X86TargetLowering::LowerGlobalTLSAddress(SDOperand Op, SelectionDAG &DAG) {
- // TODO: implement the "local dynamic" model
- // TODO: implement the "initial exec"model for pic executables
- assert(Subtarget->isTargetELF() &&
- "TLS not implemented for non-ELF targets");
- GlobalAddressSDNode *GA = cast<GlobalAddressSDNode>(Op);
- // If the relocation model is PIC, use the "General Dynamic" TLS Model,
- // otherwise use the "Local Exec"TLS Model
- if (Subtarget->is64Bit()) {
- return LowerToTLSGeneralDynamicModel64(GA, DAG, getPointerTy());
- } else {
- if (getTargetMachine().getRelocationModel() == Reloc::PIC_)
- return LowerToTLSGeneralDynamicModel32(GA, DAG, getPointerTy());
- else
- return LowerToTLSExecModel(GA, DAG, getPointerTy());
- }
-}
-
-SDOperand
-X86TargetLowering::LowerExternalSymbol(SDOperand Op, SelectionDAG &DAG) {
- const char *Sym = cast<ExternalSymbolSDNode>(Op)->getSymbol();
- SDOperand Result = DAG.getTargetExternalSymbol(Sym, getPointerTy());
- Result = DAG.getNode(X86ISD::Wrapper, getPointerTy(), Result);
- // With PIC, the address is actually $g + Offset.
- if (getTargetMachine().getRelocationModel() == Reloc::PIC_ &&
- !Subtarget->isPICStyleRIPRel()) {
- Result = DAG.getNode(ISD::ADD, getPointerTy(),
- DAG.getNode(X86ISD::GlobalBaseReg, getPointerTy()),
- Result);
- }
-
- return Result;
-}
-
-SDOperand X86TargetLowering::LowerJumpTable(SDOperand Op, SelectionDAG &DAG) {
- JumpTableSDNode *JT = cast<JumpTableSDNode>(Op);
- SDOperand Result = DAG.getTargetJumpTable(JT->getIndex(), getPointerTy());
- Result = DAG.getNode(X86ISD::Wrapper, getPointerTy(), Result);
- // With PIC, the address is actually $g + Offset.
- if (getTargetMachine().getRelocationModel() == Reloc::PIC_ &&
- !Subtarget->isPICStyleRIPRel()) {
- Result = DAG.getNode(ISD::ADD, getPointerTy(),
- DAG.getNode(X86ISD::GlobalBaseReg, getPointerTy()),
- Result);
- }
-
- return Result;
-}
-
-/// LowerShift - Lower SRA_PARTS and friends, which return two i32 values and
-/// take a 2 x i32 value to shift plus a shift amount.
-SDOperand X86TargetLowering::LowerShift(SDOperand Op, SelectionDAG &DAG) {
- assert(Op.getNumOperands() == 3 && "Not a double-shift!");
- MVT::ValueType VT = Op.getValueType();
- unsigned VTBits = MVT::getSizeInBits(VT);
- bool isSRA = Op.getOpcode() == ISD::SRA_PARTS;
- SDOperand ShOpLo = Op.getOperand(0);
- SDOperand ShOpHi = Op.getOperand(1);
- SDOperand ShAmt = Op.getOperand(2);
- SDOperand Tmp1 = isSRA ?
- DAG.getNode(ISD::SRA, VT, ShOpHi, DAG.getConstant(VTBits - 1, MVT::i8)) :
- DAG.getConstant(0, VT);
-
- SDOperand Tmp2, Tmp3;
- if (Op.getOpcode() == ISD::SHL_PARTS) {
- Tmp2 = DAG.getNode(X86ISD::SHLD, VT, ShOpHi, ShOpLo, ShAmt);
- Tmp3 = DAG.getNode(ISD::SHL, VT, ShOpLo, ShAmt);
- } else {
- Tmp2 = DAG.getNode(X86ISD::SHRD, VT, ShOpLo, ShOpHi, ShAmt);
- Tmp3 = DAG.getNode(isSRA ? ISD::SRA : ISD::SRL, VT, ShOpHi, ShAmt);
- }
-
- const MVT::ValueType *VTs = DAG.getNodeValueTypes(MVT::Other, MVT::Flag);
- SDOperand AndNode = DAG.getNode(ISD::AND, MVT::i8, ShAmt,
- DAG.getConstant(VTBits, MVT::i8));
- SDOperand Cond = DAG.getNode(X86ISD::CMP, VT,
- AndNode, DAG.getConstant(0, MVT::i8));
-
- SDOperand Hi, Lo;
- SDOperand CC = DAG.getConstant(X86::COND_NE, MVT::i8);
- VTs = DAG.getNodeValueTypes(VT, MVT::Flag);
- SmallVector<SDOperand, 4> Ops;
- if (Op.getOpcode() == ISD::SHL_PARTS) {
- Ops.push_back(Tmp2);
- Ops.push_back(Tmp3);
- Ops.push_back(CC);
- Ops.push_back(Cond);
- Hi = DAG.getNode(X86ISD::CMOV, VT, &Ops[0], Ops.size());
-
- Ops.clear();
- Ops.push_back(Tmp3);
- Ops.push_back(Tmp1);
- Ops.push_back(CC);
- Ops.push_back(Cond);
- Lo = DAG.getNode(X86ISD::CMOV, VT, &Ops[0], Ops.size());
- } else {
- Ops.push_back(Tmp2);
- Ops.push_back(Tmp3);
- Ops.push_back(CC);
- Ops.push_back(Cond);
- Lo = DAG.getNode(X86ISD::CMOV, VT, &Ops[0], Ops.size());
-
- Ops.clear();
- Ops.push_back(Tmp3);
- Ops.push_back(Tmp1);
- Ops.push_back(CC);
- Ops.push_back(Cond);
- Hi = DAG.getNode(X86ISD::CMOV, VT, &Ops[0], Ops.size());
- }
-
- VTs = DAG.getNodeValueTypes(VT, VT);
- Ops.clear();
- Ops.push_back(Lo);
- Ops.push_back(Hi);
- return DAG.getNode(ISD::MERGE_VALUES, VTs, 2, &Ops[0], Ops.size());
-}
-
-SDOperand X86TargetLowering::LowerSINT_TO_FP(SDOperand Op, SelectionDAG &DAG) {
- MVT::ValueType SrcVT = Op.getOperand(0).getValueType();
- assert(SrcVT <= MVT::i64 && SrcVT >= MVT::i16 &&
- "Unknown SINT_TO_FP to lower!");
-
- // These are really Legal; caller falls through into that case.
- if (SrcVT == MVT::i32 && isScalarFPTypeInSSEReg(Op.getValueType()))
- return SDOperand();
- if (SrcVT == MVT::i64 && Op.getValueType() != MVT::f80 &&
- Subtarget->is64Bit())
- return SDOperand();
-
- unsigned Size = MVT::getSizeInBits(SrcVT)/8;
- MachineFunction &MF = DAG.getMachineFunction();
- int SSFI = MF.getFrameInfo()->CreateStackObject(Size, Size);
- SDOperand StackSlot = DAG.getFrameIndex(SSFI, getPointerTy());
- SDOperand Chain = DAG.getStore(DAG.getEntryNode(), Op.getOperand(0),
- StackSlot,
- PseudoSourceValue::getFixedStack(),
- SSFI);
-
- // Build the FILD
- SDVTList Tys;
- bool useSSE = isScalarFPTypeInSSEReg(Op.getValueType());
- if (useSSE)
- Tys = DAG.getVTList(MVT::f64, MVT::Other, MVT::Flag);
- else
- Tys = DAG.getVTList(Op.getValueType(), MVT::Other);
- SmallVector<SDOperand, 8> Ops;
- Ops.push_back(Chain);
- Ops.push_back(StackSlot);
- Ops.push_back(DAG.getValueType(SrcVT));
- SDOperand Result = DAG.getNode(useSSE ? X86ISD::FILD_FLAG : X86ISD::FILD,
- Tys, &Ops[0], Ops.size());
-
- if (useSSE) {
- Chain = Result.getValue(1);
- SDOperand InFlag = Result.getValue(2);
-
- // FIXME: Currently the FST is flagged to the FILD_FLAG. This
- // shouldn't be necessary except that RFP cannot be live across
- // multiple blocks. When stackifier is fixed, they can be uncoupled.
- MachineFunction &MF = DAG.getMachineFunction();
- int SSFI = MF.getFrameInfo()->CreateStackObject(8, 8);
- SDOperand StackSlot = DAG.getFrameIndex(SSFI, getPointerTy());
- Tys = DAG.getVTList(MVT::Other);
- SmallVector<SDOperand, 8> Ops;
- Ops.push_back(Chain);
- Ops.push_back(Result);
- Ops.push_back(StackSlot);
- Ops.push_back(DAG.getValueType(Op.getValueType()));
- Ops.push_back(InFlag);
- Chain = DAG.getNode(X86ISD::FST, Tys, &Ops[0], Ops.size());
- Result = DAG.getLoad(Op.getValueType(), Chain, StackSlot,
- PseudoSourceValue::getFixedStack(), SSFI);
- }
-
- return Result;
-}
-
-std::pair<SDOperand,SDOperand> X86TargetLowering::
-FP_TO_SINTHelper(SDOperand Op, SelectionDAG &DAG) {
- assert(Op.getValueType() <= MVT::i64 && Op.getValueType() >= MVT::i16 &&
- "Unknown FP_TO_SINT to lower!");
-
- // These are really Legal.
- if (Op.getValueType() == MVT::i32 &&
- isScalarFPTypeInSSEReg(Op.getOperand(0).getValueType()))
- return std::make_pair(SDOperand(), SDOperand());
- if (Subtarget->is64Bit() &&
- Op.getValueType() == MVT::i64 &&
- Op.getOperand(0).getValueType() != MVT::f80)
- return std::make_pair(SDOperand(), SDOperand());
-
- // We lower FP->sint64 into FISTP64, followed by a load, all to a temporary
- // stack slot.
- MachineFunction &MF = DAG.getMachineFunction();
- unsigned MemSize = MVT::getSizeInBits(Op.getValueType())/8;
- int SSFI = MF.getFrameInfo()->CreateStackObject(MemSize, MemSize);
- SDOperand StackSlot = DAG.getFrameIndex(SSFI, getPointerTy());
- unsigned Opc;
- switch (Op.getValueType()) {
- default: assert(0 && "Invalid FP_TO_SINT to lower!");
- case MVT::i16: Opc = X86ISD::FP_TO_INT16_IN_MEM; break;
- case MVT::i32: Opc = X86ISD::FP_TO_INT32_IN_MEM; break;
- case MVT::i64: Opc = X86ISD::FP_TO_INT64_IN_MEM; break;
- }
-
- SDOperand Chain = DAG.getEntryNode();
- SDOperand Value = Op.getOperand(0);
- if (isScalarFPTypeInSSEReg(Op.getOperand(0).getValueType())) {
- assert(Op.getValueType() == MVT::i64 && "Invalid FP_TO_SINT to lower!");
- Chain = DAG.getStore(Chain, Value, StackSlot,
- PseudoSourceValue::getFixedStack(), SSFI);
- SDVTList Tys = DAG.getVTList(Op.getOperand(0).getValueType(), MVT::Other);
- SDOperand Ops[] = {
- Chain, StackSlot, DAG.getValueType(Op.getOperand(0).getValueType())
- };
- Value = DAG.getNode(X86ISD::FLD, Tys, Ops, 3);
- Chain = Value.getValue(1);
- SSFI = MF.getFrameInfo()->CreateStackObject(MemSize, MemSize);
- StackSlot = DAG.getFrameIndex(SSFI, getPointerTy());
- }
-
- // Build the FP_TO_INT*_IN_MEM
- SDOperand Ops[] = { Chain, Value, StackSlot };
- SDOperand FIST = DAG.getNode(Opc, MVT::Other, Ops, 3);
-
- return std::make_pair(FIST, StackSlot);
-}
-
-SDOperand X86TargetLowering::LowerFP_TO_SINT(SDOperand Op, SelectionDAG &DAG) {
- std::pair<SDOperand,SDOperand> Vals = FP_TO_SINTHelper(Op, DAG);
- SDOperand FIST = Vals.first, StackSlot = Vals.second;
- if (FIST.Val == 0) return SDOperand();
-
- // Load the result.
- return DAG.getLoad(Op.getValueType(), FIST, StackSlot, NULL, 0);
-}
-
-SDNode *X86TargetLowering::ExpandFP_TO_SINT(SDNode *N, SelectionDAG &DAG) {
- std::pair<SDOperand,SDOperand> Vals = FP_TO_SINTHelper(SDOperand(N, 0), DAG);
- SDOperand FIST = Vals.first, StackSlot = Vals.second;
- if (FIST.Val == 0) return 0;
-
- // Return an i64 load from the stack slot.
- SDOperand Res = DAG.getLoad(MVT::i64, FIST, StackSlot, NULL, 0);
-
- // Use a MERGE_VALUES node to drop the chain result value.
- return DAG.getNode(ISD::MERGE_VALUES, MVT::i64, Res).Val;
-}
-
-SDOperand X86TargetLowering::LowerFABS(SDOperand Op, SelectionDAG &DAG) {
- MVT::ValueType VT = Op.getValueType();
- MVT::ValueType EltVT = VT;
- if (MVT::isVector(VT))
- EltVT = MVT::getVectorElementType(VT);
- std::vector<Constant*> CV;
- if (EltVT == MVT::f64) {
- Constant *C = ConstantFP::get(APFloat(APInt(64, ~(1ULL << 63))));
- CV.push_back(C);
- CV.push_back(C);
- } else {
- Constant *C = ConstantFP::get(APFloat(APInt(32, ~(1U << 31))));
- CV.push_back(C);
- CV.push_back(C);
- CV.push_back(C);
- CV.push_back(C);
- }
- Constant *C = ConstantVector::get(CV);
- SDOperand CPIdx = DAG.getConstantPool(C, getPointerTy(), 4);
- SDOperand Mask = DAG.getLoad(VT, DAG.getEntryNode(), CPIdx,
- PseudoSourceValue::getConstantPool(), 0,
- false, 16);
- return DAG.getNode(X86ISD::FAND, VT, Op.getOperand(0), Mask);
-}
-
-SDOperand X86TargetLowering::LowerFNEG(SDOperand Op, SelectionDAG &DAG) {
- MVT::ValueType VT = Op.getValueType();
- MVT::ValueType EltVT = VT;
- unsigned EltNum = 1;
- if (MVT::isVector(VT)) {
- EltVT = MVT::getVectorElementType(VT);
- EltNum = MVT::getVectorNumElements(VT);
- }
- std::vector<Constant*> CV;
- if (EltVT == MVT::f64) {
- Constant *C = ConstantFP::get(APFloat(APInt(64, 1ULL << 63)));
- CV.push_back(C);
- CV.push_back(C);
- } else {
- Constant *C = ConstantFP::get(APFloat(APInt(32, 1U << 31)));
- CV.push_back(C);
- CV.push_back(C);
- CV.push_back(C);
- CV.push_back(C);
- }
- Constant *C = ConstantVector::get(CV);
- SDOperand CPIdx = DAG.getConstantPool(C, getPointerTy(), 4);
- SDOperand Mask = DAG.getLoad(VT, DAG.getEntryNode(), CPIdx,
- PseudoSourceValue::getConstantPool(), 0,
- false, 16);
- if (MVT::isVector(VT)) {
- return DAG.getNode(ISD::BIT_CONVERT, VT,
- DAG.getNode(ISD::XOR, MVT::v2i64,
- DAG.getNode(ISD::BIT_CONVERT, MVT::v2i64, Op.getOperand(0)),
- DAG.getNode(ISD::BIT_CONVERT, MVT::v2i64, Mask)));
- } else {
- return DAG.getNode(X86ISD::FXOR, VT, Op.getOperand(0), Mask);
- }
-}
-
-SDOperand X86TargetLowering::LowerFCOPYSIGN(SDOperand Op, SelectionDAG &DAG) {
- SDOperand Op0 = Op.getOperand(0);
- SDOperand Op1 = Op.getOperand(1);
- MVT::ValueType VT = Op.getValueType();
- MVT::ValueType SrcVT = Op1.getValueType();
-
- // If second operand is smaller, extend it first.
- if (MVT::getSizeInBits(SrcVT) < MVT::getSizeInBits(VT)) {
- Op1 = DAG.getNode(ISD::FP_EXTEND, VT, Op1);
- SrcVT = VT;
- }
- // And if it is bigger, shrink it first.
- if (MVT::getSizeInBits(SrcVT) > MVT::getSizeInBits(VT)) {
- Op1 = DAG.getNode(ISD::FP_ROUND, VT, Op1, DAG.getIntPtrConstant(1));
- SrcVT = VT;
- }
-
- // At this point the operands and the result should have the same
- // type, and that won't be f80 since that is not custom lowered.
-
- // First get the sign bit of second operand.
- std::vector<Constant*> CV;
- if (SrcVT == MVT::f64) {
- CV.push_back(ConstantFP::get(APFloat(APInt(64, 1ULL << 63))));
- CV.push_back(ConstantFP::get(APFloat(APInt(64, 0))));
- } else {
- CV.push_back(ConstantFP::get(APFloat(APInt(32, 1U << 31))));
- CV.push_back(ConstantFP::get(APFloat(APInt(32, 0))));
- CV.push_back(ConstantFP::get(APFloat(APInt(32, 0))));
- CV.push_back(ConstantFP::get(APFloat(APInt(32, 0))));
- }
- Constant *C = ConstantVector::get(CV);
- SDOperand CPIdx = DAG.getConstantPool(C, getPointerTy(), 4);
- SDOperand Mask1 = DAG.getLoad(SrcVT, DAG.getEntryNode(), CPIdx,
- PseudoSourceValue::getConstantPool(), 0,
- false, 16);
- SDOperand SignBit = DAG.getNode(X86ISD::FAND, SrcVT, Op1, Mask1);
-
- // Shift sign bit right or left if the two operands have different types.
- if (MVT::getSizeInBits(SrcVT) > MVT::getSizeInBits(VT)) {
- // Op0 is MVT::f32, Op1 is MVT::f64.
- SignBit = DAG.getNode(ISD::SCALAR_TO_VECTOR, MVT::v2f64, SignBit);
- SignBit = DAG.getNode(X86ISD::FSRL, MVT::v2f64, SignBit,
- DAG.getConstant(32, MVT::i32));
- SignBit = DAG.getNode(ISD::BIT_CONVERT, MVT::v4f32, SignBit);
- SignBit = DAG.getNode(ISD::EXTRACT_VECTOR_ELT, MVT::f32, SignBit,
- DAG.getIntPtrConstant(0));
- }
-
- // Clear first operand sign bit.
- CV.clear();
- if (VT == MVT::f64) {
- CV.push_back(ConstantFP::get(APFloat(APInt(64, ~(1ULL << 63)))));
- CV.push_back(ConstantFP::get(APFloat(APInt(64, 0))));
- } else {
- CV.push_back(ConstantFP::get(APFloat(APInt(32, ~(1U << 31)))));
- CV.push_back(ConstantFP::get(APFloat(APInt(32, 0))));
- CV.push_back(ConstantFP::get(APFloat(APInt(32, 0))));
- CV.push_back(ConstantFP::get(APFloat(APInt(32, 0))));
- }
- C = ConstantVector::get(CV);
- CPIdx = DAG.getConstantPool(C, getPointerTy(), 4);
- SDOperand Mask2 = DAG.getLoad(VT, DAG.getEntryNode(), CPIdx,
- PseudoSourceValue::getConstantPool(), 0,
- false, 16);
- SDOperand Val = DAG.getNode(X86ISD::FAND, VT, Op0, Mask2);
-
- // Or the value with the sign bit.
- return DAG.getNode(X86ISD::FOR, VT, Val, SignBit);
-}
-
-SDOperand X86TargetLowering::LowerSETCC(SDOperand Op, SelectionDAG &DAG) {
- assert(Op.getValueType() == MVT::i8 && "SetCC type must be 8-bit integer");
- SDOperand Cond;
- SDOperand Op0 = Op.getOperand(0);
- SDOperand Op1 = Op.getOperand(1);
- SDOperand CC = Op.getOperand(2);
- ISD::CondCode SetCCOpcode = cast<CondCodeSDNode>(CC)->get();
- bool isFP = MVT::isFloatingPoint(Op.getOperand(1).getValueType());
- unsigned X86CC;
-
- if (translateX86CC(cast<CondCodeSDNode>(CC)->get(), isFP, X86CC,
- Op0, Op1, DAG)) {
- Cond = DAG.getNode(X86ISD::CMP, MVT::i32, Op0, Op1);
- return DAG.getNode(X86ISD::SETCC, MVT::i8,
- DAG.getConstant(X86CC, MVT::i8), Cond);
- }
-
- assert(isFP && "Illegal integer SetCC!");
-
- Cond = DAG.getNode(X86ISD::CMP, MVT::i32, Op0, Op1);
- switch (SetCCOpcode) {
- default: assert(false && "Illegal floating point SetCC!");
- case ISD::SETOEQ: { // !PF & ZF
- SDOperand Tmp1 = DAG.getNode(X86ISD::SETCC, MVT::i8,
- DAG.getConstant(X86::COND_NP, MVT::i8), Cond);
- SDOperand Tmp2 = DAG.getNode(X86ISD::SETCC, MVT::i8,
- DAG.getConstant(X86::COND_E, MVT::i8), Cond);
- return DAG.getNode(ISD::AND, MVT::i8, Tmp1, Tmp2);
- }
- case ISD::SETUNE: { // PF | !ZF
- SDOperand Tmp1 = DAG.getNode(X86ISD::SETCC, MVT::i8,
- DAG.getConstant(X86::COND_P, MVT::i8), Cond);
- SDOperand Tmp2 = DAG.getNode(X86ISD::SETCC, MVT::i8,
- DAG.getConstant(X86::COND_NE, MVT::i8), Cond);
- return DAG.getNode(ISD::OR, MVT::i8, Tmp1, Tmp2);
- }
- }
-}
-
-
-SDOperand X86TargetLowering::LowerSELECT(SDOperand Op, SelectionDAG &DAG) {
- bool addTest = true;
- SDOperand Cond = Op.getOperand(0);
- SDOperand CC;
-
- if (Cond.getOpcode() == ISD::SETCC)
- Cond = LowerSETCC(Cond, DAG);
-
- // If condition flag is set by a X86ISD::CMP, then use it as the condition
- // setting operand in place of the X86ISD::SETCC.
- if (Cond.getOpcode() == X86ISD::SETCC) {
- CC = Cond.getOperand(0);
-
- SDOperand Cmp = Cond.getOperand(1);
- unsigned Opc = Cmp.getOpcode();
- MVT::ValueType VT = Op.getValueType();
-
- bool IllegalFPCMov = false;
- if (MVT::isFloatingPoint(VT) && !MVT::isVector(VT) &&
- !isScalarFPTypeInSSEReg(VT)) // FPStack?
- IllegalFPCMov = !hasFPCMov(cast<ConstantSDNode>(CC)->getSignExtended());
-
- if ((Opc == X86ISD::CMP ||
- Opc == X86ISD::COMI ||
- Opc == X86ISD::UCOMI) && !IllegalFPCMov) {
- Cond = Cmp;
- addTest = false;
- }
- }
-
- if (addTest) {
- CC = DAG.getConstant(X86::COND_NE, MVT::i8);
- Cond= DAG.getNode(X86ISD::CMP, MVT::i32, Cond, DAG.getConstant(0, MVT::i8));
- }
-
- const MVT::ValueType *VTs = DAG.getNodeValueTypes(Op.getValueType(),
- MVT::Flag);
- SmallVector<SDOperand, 4> Ops;
- // X86ISD::CMOV means set the result (which is operand 1) to the RHS if
- // condition is true.
- Ops.push_back(Op.getOperand(2));
- Ops.push_back(Op.getOperand(1));
- Ops.push_back(CC);
- Ops.push_back(Cond);
- return DAG.getNode(X86ISD::CMOV, VTs, 2, &Ops[0], Ops.size());
-}
-
-SDOperand X86TargetLowering::LowerBRCOND(SDOperand Op, SelectionDAG &DAG) {
- bool addTest = true;
- SDOperand Chain = Op.getOperand(0);
- SDOperand Cond = Op.getOperand(1);
- SDOperand Dest = Op.getOperand(2);
- SDOperand CC;
-
- if (Cond.getOpcode() == ISD::SETCC)
- Cond = LowerSETCC(Cond, DAG);
-
- // If condition flag is set by a X86ISD::CMP, then use it as the condition
- // setting operand in place of the X86ISD::SETCC.
- if (Cond.getOpcode() == X86ISD::SETCC) {
- CC = Cond.getOperand(0);
-
- SDOperand Cmp = Cond.getOperand(1);
- unsigned Opc = Cmp.getOpcode();
- if (Opc == X86ISD::CMP ||
- Opc == X86ISD::COMI ||
- Opc == X86ISD::UCOMI) {
- Cond = Cmp;
- addTest = false;
- }
- }
-
- if (addTest) {
- CC = DAG.getConstant(X86::COND_NE, MVT::i8);
- Cond= DAG.getNode(X86ISD::CMP, MVT::i32, Cond, DAG.getConstant(0, MVT::i8));
- }
- return DAG.getNode(X86ISD::BRCOND, Op.getValueType(),
- Chain, Op.getOperand(2), CC, Cond);
-}
-
-
-// Lower dynamic stack allocation to _alloca call for Cygwin/Mingw targets.
-// Calls to _alloca is needed to probe the stack when allocating more than 4k
-// bytes in one go. Touching the stack at 4K increments is necessary to ensure
-// that the guard pages used by the OS virtual memory manager are allocated in
-// correct sequence.
-SDOperand
-X86TargetLowering::LowerDYNAMIC_STACKALLOC(SDOperand Op,
- SelectionDAG &DAG) {
- assert(Subtarget->isTargetCygMing() &&
- "This should be used only on Cygwin/Mingw targets");
-
- // Get the inputs.
- SDOperand Chain = Op.getOperand(0);
- SDOperand Size = Op.getOperand(1);
- // FIXME: Ensure alignment here
-
- SDOperand Flag;
-
- MVT::ValueType IntPtr = getPointerTy();
- MVT::ValueType SPTy = Subtarget->is64Bit() ? MVT::i64 : MVT::i32;
-
- Chain = DAG.getCopyToReg(Chain, X86::EAX, Size, Flag);
- Flag = Chain.getValue(1);
-
- SDVTList NodeTys = DAG.getVTList(MVT::Other, MVT::Flag);
- SDOperand Ops[] = { Chain,
- DAG.getTargetExternalSymbol("_alloca", IntPtr),
- DAG.getRegister(X86::EAX, IntPtr),
- Flag };
- Chain = DAG.getNode(X86ISD::CALL, NodeTys, Ops, 4);
- Flag = Chain.getValue(1);
-
- Chain = DAG.getCopyFromReg(Chain, X86StackPtr, SPTy).getValue(1);
-
- std::vector<MVT::ValueType> Tys;
- Tys.push_back(SPTy);
- Tys.push_back(MVT::Other);
- SDOperand Ops1[2] = { Chain.getValue(0), Chain };
- return DAG.getNode(ISD::MERGE_VALUES, Tys, Ops1, 2);
-}
-
-SDOperand
-X86TargetLowering::EmitTargetCodeForMemset(SelectionDAG &DAG,
- SDOperand Chain,
- SDOperand Dst, SDOperand Src,
- SDOperand Size, unsigned Align,
- const Value *DstSV, uint64_t DstSVOff) {
- ConstantSDNode *ConstantSize = dyn_cast<ConstantSDNode>(Size);
-
- /// If not DWORD aligned or size is more than the threshold, call the library.
- /// The libc version is likely to be faster for these cases. It can use the
- /// address value and run time information about the CPU.
- if ((Align & 3) == 0 ||
- !ConstantSize ||
- ConstantSize->getValue() > getSubtarget()->getMaxInlineSizeThreshold()) {
- SDOperand InFlag(0, 0);
-
- // Check to see if there is a specialized entry-point for memory zeroing.
- ConstantSDNode *V = dyn_cast<ConstantSDNode>(Src);
- if (const char *bzeroEntry =
- V && V->isNullValue() ? Subtarget->getBZeroEntry() : 0) {
- MVT::ValueType IntPtr = getPointerTy();
- const Type *IntPtrTy = getTargetData()->getIntPtrType();
- TargetLowering::ArgListTy Args;
- TargetLowering::ArgListEntry Entry;
- Entry.Node = Dst;
- Entry.Ty = IntPtrTy;
- Args.push_back(Entry);
- Entry.Node = Size;
- Args.push_back(Entry);
- std::pair<SDOperand,SDOperand> CallResult =
- LowerCallTo(Chain, Type::VoidTy, false, false, false, CallingConv::C,
- false, DAG.getExternalSymbol(bzeroEntry, IntPtr),
- Args, DAG);
- return CallResult.second;
- }
-
- // Otherwise have the target-independent code call memset.
- return SDOperand();
- }
-
- uint64_t SizeVal = ConstantSize->getValue();
- SDOperand InFlag(0, 0);
- MVT::ValueType AVT;
- SDOperand Count;
- ConstantSDNode *ValC = dyn_cast<ConstantSDNode>(Src);
- unsigned BytesLeft = 0;
- bool TwoRepStos = false;
- if (ValC) {
- unsigned ValReg;
- uint64_t Val = ValC->getValue() & 255;
-
- // If the value is a constant, then we can potentially use larger sets.
- switch (Align & 3) {
- case 2: // WORD aligned
- AVT = MVT::i16;
- ValReg = X86::AX;
- Val = (Val << 8) | Val;
- break;
- case 0: // DWORD aligned
- AVT = MVT::i32;
- ValReg = X86::EAX;
- Val = (Val << 8) | Val;
- Val = (Val << 16) | Val;
- if (Subtarget->is64Bit() && ((Align & 0x7) == 0)) { // QWORD aligned
- AVT = MVT::i64;
- ValReg = X86::RAX;
- Val = (Val << 32) | Val;
- }
- break;
- default: // Byte aligned
- AVT = MVT::i8;
- ValReg = X86::AL;
- Count = DAG.getIntPtrConstant(SizeVal);
- break;
- }
-
- if (AVT > MVT::i8) {
- unsigned UBytes = MVT::getSizeInBits(AVT) / 8;
- Count = DAG.getIntPtrConstant(SizeVal / UBytes);
- BytesLeft = SizeVal % UBytes;
- }
-
- Chain = DAG.getCopyToReg(Chain, ValReg, DAG.getConstant(Val, AVT),
- InFlag);
- InFlag = Chain.getValue(1);
- } else {
- AVT = MVT::i8;
- Count = DAG.getIntPtrConstant(SizeVal);
- Chain = DAG.getCopyToReg(Chain, X86::AL, Src, InFlag);
- InFlag = Chain.getValue(1);
- }
-
- Chain = DAG.getCopyToReg(Chain, Subtarget->is64Bit() ? X86::RCX : X86::ECX,
- Count, InFlag);
- InFlag = Chain.getValue(1);
- Chain = DAG.getCopyToReg(Chain, Subtarget->is64Bit() ? X86::RDI : X86::EDI,
- Dst, InFlag);
- InFlag = Chain.getValue(1);
-
- SDVTList Tys = DAG.getVTList(MVT::Other, MVT::Flag);
- SmallVector<SDOperand, 8> Ops;
- Ops.push_back(Chain);
- Ops.push_back(DAG.getValueType(AVT));
- Ops.push_back(InFlag);
- Chain = DAG.getNode(X86ISD::REP_STOS, Tys, &Ops[0], Ops.size());
-
- if (TwoRepStos) {
- InFlag = Chain.getValue(1);
- Count = Size;
- MVT::ValueType CVT = Count.getValueType();
- SDOperand Left = DAG.getNode(ISD::AND, CVT, Count,
- DAG.getConstant((AVT == MVT::i64) ? 7 : 3, CVT));
- Chain = DAG.getCopyToReg(Chain, (CVT == MVT::i64) ? X86::RCX : X86::ECX,
- Left, InFlag);
- InFlag = Chain.getValue(1);
- Tys = DAG.getVTList(MVT::Other, MVT::Flag);
- Ops.clear();
- Ops.push_back(Chain);
- Ops.push_back(DAG.getValueType(MVT::i8));
- Ops.push_back(InFlag);
- Chain = DAG.getNode(X86ISD::REP_STOS, Tys, &Ops[0], Ops.size());
- } else if (BytesLeft) {
- // Handle the last 1 - 7 bytes.
- unsigned Offset = SizeVal - BytesLeft;
- MVT::ValueType AddrVT = Dst.getValueType();
- MVT::ValueType SizeVT = Size.getValueType();
-
- Chain = DAG.getMemset(Chain,
- DAG.getNode(ISD::ADD, AddrVT, Dst,
- DAG.getConstant(Offset, AddrVT)),
- Src,
- DAG.getConstant(BytesLeft, SizeVT),
- Align, DstSV, DstSVOff + Offset);
- }
-
- // TODO: Use a Tokenfactor, as in memcpy, instead of a single chain.
- return Chain;
-}
-
-SDOperand
-X86TargetLowering::EmitTargetCodeForMemcpy(SelectionDAG &DAG,
- SDOperand Chain,
- SDOperand Dst, SDOperand Src,
- SDOperand Size, unsigned Align,
- bool AlwaysInline,
- const Value *DstSV, uint64_t DstSVOff,
- const Value *SrcSV, uint64_t SrcSVOff){
-
- // This requires the copy size to be a constant, preferrably
- // within a subtarget-specific limit.
- ConstantSDNode *ConstantSize = dyn_cast<ConstantSDNode>(Size);
- if (!ConstantSize)
- return SDOperand();
- uint64_t SizeVal = ConstantSize->getValue();
- if (!AlwaysInline && SizeVal > getSubtarget()->getMaxInlineSizeThreshold())
- return SDOperand();
-
- MVT::ValueType AVT;
- unsigned BytesLeft = 0;
- if (Align >= 8 && Subtarget->is64Bit())
- AVT = MVT::i64;
- else if (Align >= 4)
- AVT = MVT::i32;
- else if (Align >= 2)
- AVT = MVT::i16;
- else
- AVT = MVT::i8;
-
- unsigned UBytes = MVT::getSizeInBits(AVT) / 8;
- unsigned CountVal = SizeVal / UBytes;
- SDOperand Count = DAG.getIntPtrConstant(CountVal);
- BytesLeft = SizeVal % UBytes;
-
- SDOperand InFlag(0, 0);
- Chain = DAG.getCopyToReg(Chain, Subtarget->is64Bit() ? X86::RCX : X86::ECX,
- Count, InFlag);
- InFlag = Chain.getValue(1);
- Chain = DAG.getCopyToReg(Chain, Subtarget->is64Bit() ? X86::RDI : X86::EDI,
- Dst, InFlag);
- InFlag = Chain.getValue(1);
- Chain = DAG.getCopyToReg(Chain, Subtarget->is64Bit() ? X86::RSI : X86::ESI,
- Src, InFlag);
- InFlag = Chain.getValue(1);
-
- SDVTList Tys = DAG.getVTList(MVT::Other, MVT::Flag);
- SmallVector<SDOperand, 8> Ops;
- Ops.push_back(Chain);
- Ops.push_back(DAG.getValueType(AVT));
- Ops.push_back(InFlag);
- SDOperand RepMovs = DAG.getNode(X86ISD::REP_MOVS, Tys, &Ops[0], Ops.size());
-
- SmallVector<SDOperand, 4> Results;
- Results.push_back(RepMovs);
- if (BytesLeft) {
- // Handle the last 1 - 7 bytes.
- unsigned Offset = SizeVal - BytesLeft;
- MVT::ValueType DstVT = Dst.getValueType();
- MVT::ValueType SrcVT = Src.getValueType();
- MVT::ValueType SizeVT = Size.getValueType();
- Results.push_back(DAG.getMemcpy(Chain,
- DAG.getNode(ISD::ADD, DstVT, Dst,
- DAG.getConstant(Offset, DstVT)),
- DAG.getNode(ISD::ADD, SrcVT, Src,
- DAG.getConstant(Offset, SrcVT)),
- DAG.getConstant(BytesLeft, SizeVT),
- Align, AlwaysInline,
- DstSV, DstSVOff + Offset,
- SrcSV, SrcSVOff + Offset));
- }
-
- return DAG.getNode(ISD::TokenFactor, MVT::Other, &Results[0], Results.size());
-}
-
-/// Expand the result of: i64,outchain = READCYCLECOUNTER inchain
-SDNode *X86TargetLowering::ExpandREADCYCLECOUNTER(SDNode *N, SelectionDAG &DAG){
- SDVTList Tys = DAG.getVTList(MVT::Other, MVT::Flag);
- SDOperand TheChain = N->getOperand(0);
- SDOperand rd = DAG.getNode(X86ISD::RDTSC_DAG, Tys, &TheChain, 1);
- if (Subtarget->is64Bit()) {
- SDOperand rax = DAG.getCopyFromReg(rd, X86::RAX, MVT::i64, rd.getValue(1));
- SDOperand rdx = DAG.getCopyFromReg(rax.getValue(1), X86::RDX,
- MVT::i64, rax.getValue(2));
- SDOperand Tmp = DAG.getNode(ISD::SHL, MVT::i64, rdx,
- DAG.getConstant(32, MVT::i8));
- SDOperand Ops[] = {
- DAG.getNode(ISD::OR, MVT::i64, rax, Tmp), rdx.getValue(1)
- };
-
- Tys = DAG.getVTList(MVT::i64, MVT::Other);
- return DAG.getNode(ISD::MERGE_VALUES, Tys, Ops, 2).Val;
- }
-
- SDOperand eax = DAG.getCopyFromReg(rd, X86::EAX, MVT::i32, rd.getValue(1));
- SDOperand edx = DAG.getCopyFromReg(eax.getValue(1), X86::EDX,
- MVT::i32, eax.getValue(2));
- // Use a buildpair to merge the two 32-bit values into a 64-bit one.
- SDOperand Ops[] = { eax, edx };
- Ops[0] = DAG.getNode(ISD::BUILD_PAIR, MVT::i64, Ops, 2);
-
- // Use a MERGE_VALUES to return the value and chain.
- Ops[1] = edx.getValue(1);
- Tys = DAG.getVTList(MVT::i64, MVT::Other);
- return DAG.getNode(ISD::MERGE_VALUES, Tys, Ops, 2).Val;
-}
-
-SDOperand X86TargetLowering::LowerVASTART(SDOperand Op, SelectionDAG &DAG) {
- const Value *SV = cast<SrcValueSDNode>(Op.getOperand(2))->getValue();
-
- if (!Subtarget->is64Bit()) {
- // vastart just stores the address of the VarArgsFrameIndex slot into the
- // memory location argument.
- SDOperand FR = DAG.getFrameIndex(VarArgsFrameIndex, getPointerTy());
- return DAG.getStore(Op.getOperand(0), FR,Op.getOperand(1), SV, 0);
- }
-
- // __va_list_tag:
- // gp_offset (0 - 6 * 8)
- // fp_offset (48 - 48 + 8 * 16)
- // overflow_arg_area (point to parameters coming in memory).
- // reg_save_area
- SmallVector<SDOperand, 8> MemOps;
- SDOperand FIN = Op.getOperand(1);
- // Store gp_offset
- SDOperand Store = DAG.getStore(Op.getOperand(0),
- DAG.getConstant(VarArgsGPOffset, MVT::i32),
- FIN, SV, 0);
- MemOps.push_back(Store);
-
- // Store fp_offset
- FIN = DAG.getNode(ISD::ADD, getPointerTy(), FIN, DAG.getIntPtrConstant(4));
- Store = DAG.getStore(Op.getOperand(0),
- DAG.getConstant(VarArgsFPOffset, MVT::i32),
- FIN, SV, 0);
- MemOps.push_back(Store);
-
- // Store ptr to overflow_arg_area
- FIN = DAG.getNode(ISD::ADD, getPointerTy(), FIN, DAG.getIntPtrConstant(4));
- SDOperand OVFIN = DAG.getFrameIndex(VarArgsFrameIndex, getPointerTy());
- Store = DAG.getStore(Op.getOperand(0), OVFIN, FIN, SV, 0);
- MemOps.push_back(Store);
-
- // Store ptr to reg_save_area.
- FIN = DAG.getNode(ISD::ADD, getPointerTy(), FIN, DAG.getIntPtrConstant(8));
- SDOperand RSFIN = DAG.getFrameIndex(RegSaveFrameIndex, getPointerTy());
- Store = DAG.getStore(Op.getOperand(0), RSFIN, FIN, SV, 0);
- MemOps.push_back(Store);
- return DAG.getNode(ISD::TokenFactor, MVT::Other, &MemOps[0], MemOps.size());
-}
-
-SDOperand X86TargetLowering::LowerVAARG(SDOperand Op, SelectionDAG &DAG) {
- // X86-64 va_list is a struct { i32, i32, i8*, i8* }.
- assert(Subtarget->is64Bit() && "This code only handles 64-bit va_arg!");
- SDOperand Chain = Op.getOperand(0);
- SDOperand SrcPtr = Op.getOperand(1);
- SDOperand SrcSV = Op.getOperand(2);
-
- assert(0 && "VAArgInst is not yet implemented for x86-64!");
- abort();
- return SDOperand();
-}
-
-SDOperand X86TargetLowering::LowerVACOPY(SDOperand Op, SelectionDAG &DAG) {
- // X86-64 va_list is a struct { i32, i32, i8*, i8* }.
- assert(Subtarget->is64Bit() && "This code only handles 64-bit va_copy!");
- SDOperand Chain = Op.getOperand(0);
- SDOperand DstPtr = Op.getOperand(1);
- SDOperand SrcPtr = Op.getOperand(2);
- const Value *DstSV = cast<SrcValueSDNode>(Op.getOperand(3))->getValue();
- const Value *SrcSV = cast<SrcValueSDNode>(Op.getOperand(4))->getValue();
-
- return DAG.getMemcpy(Chain, DstPtr, SrcPtr,
- DAG.getIntPtrConstant(24), 8, false,
- DstSV, 0, SrcSV, 0);
-}
-
-SDOperand
-X86TargetLowering::LowerINTRINSIC_WO_CHAIN(SDOperand Op, SelectionDAG &DAG) {
- unsigned IntNo = cast<ConstantSDNode>(Op.getOperand(0))->getValue();
- switch (IntNo) {
- default: return SDOperand(); // Don't custom lower most intrinsics.
- // Comparison intrinsics.
- case Intrinsic::x86_sse_comieq_ss:
- case Intrinsic::x86_sse_comilt_ss:
- case Intrinsic::x86_sse_comile_ss:
- case Intrinsic::x86_sse_comigt_ss:
- case Intrinsic::x86_sse_comige_ss:
- case Intrinsic::x86_sse_comineq_ss:
- case Intrinsic::x86_sse_ucomieq_ss:
- case Intrinsic::x86_sse_ucomilt_ss:
- case Intrinsic::x86_sse_ucomile_ss:
- case Intrinsic::x86_sse_ucomigt_ss:
- case Intrinsic::x86_sse_ucomige_ss:
- case Intrinsic::x86_sse_ucomineq_ss:
- case Intrinsic::x86_sse2_comieq_sd:
- case Intrinsic::x86_sse2_comilt_sd:
- case Intrinsic::x86_sse2_comile_sd:
- case Intrinsic::x86_sse2_comigt_sd:
- case Intrinsic::x86_sse2_comige_sd:
- case Intrinsic::x86_sse2_comineq_sd:
- case Intrinsic::x86_sse2_ucomieq_sd:
- case Intrinsic::x86_sse2_ucomilt_sd:
- case Intrinsic::x86_sse2_ucomile_sd:
- case Intrinsic::x86_sse2_ucomigt_sd:
- case Intrinsic::x86_sse2_ucomige_sd:
- case Intrinsic::x86_sse2_ucomineq_sd: {
- unsigned Opc = 0;
- ISD::CondCode CC = ISD::SETCC_INVALID;
- switch (IntNo) {
- default: break;
- case Intrinsic::x86_sse_comieq_ss:
- case Intrinsic::x86_sse2_comieq_sd:
- Opc = X86ISD::COMI;
- CC = ISD::SETEQ;
- break;
- case Intrinsic::x86_sse_comilt_ss:
- case Intrinsic::x86_sse2_comilt_sd:
- Opc = X86ISD::COMI;
- CC = ISD::SETLT;
- break;
- case Intrinsic::x86_sse_comile_ss:
- case Intrinsic::x86_sse2_comile_sd:
- Opc = X86ISD::COMI;
- CC = ISD::SETLE;
- break;
- case Intrinsic::x86_sse_comigt_ss:
- case Intrinsic::x86_sse2_comigt_sd:
- Opc = X86ISD::COMI;
- CC = ISD::SETGT;
- break;
- case Intrinsic::x86_sse_comige_ss:
- case Intrinsic::x86_sse2_comige_sd:
- Opc = X86ISD::COMI;
- CC = ISD::SETGE;
- break;
- case Intrinsic::x86_sse_comineq_ss:
- case Intrinsic::x86_sse2_comineq_sd:
- Opc = X86ISD::COMI;
- CC = ISD::SETNE;
- break;
- case Intrinsic::x86_sse_ucomieq_ss:
- case Intrinsic::x86_sse2_ucomieq_sd:
- Opc = X86ISD::UCOMI;
- CC = ISD::SETEQ;
- break;
- case Intrinsic::x86_sse_ucomilt_ss:
- case Intrinsic::x86_sse2_ucomilt_sd:
- Opc = X86ISD::UCOMI;
- CC = ISD::SETLT;
- break;
- case Intrinsic::x86_sse_ucomile_ss:
- case Intrinsic::x86_sse2_ucomile_sd:
- Opc = X86ISD::UCOMI;
- CC = ISD::SETLE;
- break;
- case Intrinsic::x86_sse_ucomigt_ss:
- case Intrinsic::x86_sse2_ucomigt_sd:
- Opc = X86ISD::UCOMI;
- CC = ISD::SETGT;
- break;
- case Intrinsic::x86_sse_ucomige_ss:
- case Intrinsic::x86_sse2_ucomige_sd:
- Opc = X86ISD::UCOMI;
- CC = ISD::SETGE;
- break;
- case Intrinsic::x86_sse_ucomineq_ss:
- case Intrinsic::x86_sse2_ucomineq_sd:
- Opc = X86ISD::UCOMI;
- CC = ISD::SETNE;
- break;
- }
-
- unsigned X86CC;
- SDOperand LHS = Op.getOperand(1);
- SDOperand RHS = Op.getOperand(2);
- translateX86CC(CC, true, X86CC, LHS, RHS, DAG);
-
- SDOperand Cond = DAG.getNode(Opc, MVT::i32, LHS, RHS);
- SDOperand SetCC = DAG.getNode(X86ISD::SETCC, MVT::i8,
- DAG.getConstant(X86CC, MVT::i8), Cond);
- return DAG.getNode(ISD::ANY_EXTEND, MVT::i32, SetCC);
- }
-
- // Fix vector shift instructions where the last operand is a non-immediate
- // i32 value.
- case Intrinsic::x86_sse2_pslli_w:
- case Intrinsic::x86_sse2_pslli_d:
- case Intrinsic::x86_sse2_pslli_q:
- case Intrinsic::x86_sse2_psrli_w:
- case Intrinsic::x86_sse2_psrli_d:
- case Intrinsic::x86_sse2_psrli_q:
- case Intrinsic::x86_sse2_psrai_w:
- case Intrinsic::x86_sse2_psrai_d:
- case Intrinsic::x86_mmx_pslli_w:
- case Intrinsic::x86_mmx_pslli_d:
- case Intrinsic::x86_mmx_pslli_q:
- case Intrinsic::x86_mmx_psrli_w:
- case Intrinsic::x86_mmx_psrli_d:
- case Intrinsic::x86_mmx_psrli_q:
- case Intrinsic::x86_mmx_psrai_w:
- case Intrinsic::x86_mmx_psrai_d: {
- SDOperand ShAmt = Op.getOperand(2);
- if (isa<ConstantSDNode>(ShAmt))
- return SDOperand();
-
- unsigned NewIntNo = 0;
- MVT::ValueType ShAmtVT = MVT::v4i32;
- switch (IntNo) {
- case Intrinsic::x86_sse2_pslli_w:
- NewIntNo = Intrinsic::x86_sse2_psll_w;
- break;
- case Intrinsic::x86_sse2_pslli_d:
- NewIntNo = Intrinsic::x86_sse2_psll_d;
- break;
- case Intrinsic::x86_sse2_pslli_q:
- NewIntNo = Intrinsic::x86_sse2_psll_q;
- break;
- case Intrinsic::x86_sse2_psrli_w:
- NewIntNo = Intrinsic::x86_sse2_psrl_w;
- break;
- case Intrinsic::x86_sse2_psrli_d:
- NewIntNo = Intrinsic::x86_sse2_psrl_d;
- break;
- case Intrinsic::x86_sse2_psrli_q:
- NewIntNo = Intrinsic::x86_sse2_psrl_q;
- break;
- case Intrinsic::x86_sse2_psrai_w:
- NewIntNo = Intrinsic::x86_sse2_psra_w;
- break;
- case Intrinsic::x86_sse2_psrai_d:
- NewIntNo = Intrinsic::x86_sse2_psra_d;
- break;
- default: {
- ShAmtVT = MVT::v2i32;
- switch (IntNo) {
- case Intrinsic::x86_mmx_pslli_w:
- NewIntNo = Intrinsic::x86_mmx_psll_w;
- break;
- case Intrinsic::x86_mmx_pslli_d:
- NewIntNo = Intrinsic::x86_mmx_psll_d;
- break;
- case Intrinsic::x86_mmx_pslli_q:
- NewIntNo = Intrinsic::x86_mmx_psll_q;
- break;
- case Intrinsic::x86_mmx_psrli_w:
- NewIntNo = Intrinsic::x86_mmx_psrl_w;
- break;
- case Intrinsic::x86_mmx_psrli_d:
- NewIntNo = Intrinsic::x86_mmx_psrl_d;
- break;
- case Intrinsic::x86_mmx_psrli_q:
- NewIntNo = Intrinsic::x86_mmx_psrl_q;
- break;
- case Intrinsic::x86_mmx_psrai_w:
- NewIntNo = Intrinsic::x86_mmx_psra_w;
- break;
- case Intrinsic::x86_mmx_psrai_d:
- NewIntNo = Intrinsic::x86_mmx_psra_d;
- break;
- default: abort(); // Can't reach here.
- }
- break;
- }
- }
- MVT::ValueType VT = Op.getValueType();
- ShAmt = DAG.getNode(ISD::BIT_CONVERT, VT,
- DAG.getNode(ISD::SCALAR_TO_VECTOR, ShAmtVT, ShAmt));
- return DAG.getNode(ISD::INTRINSIC_WO_CHAIN, VT,
- DAG.getConstant(NewIntNo, MVT::i32),
- Op.getOperand(1), ShAmt);
- }
- }
-}
-
-SDOperand X86TargetLowering::LowerRETURNADDR(SDOperand Op, SelectionDAG &DAG) {
- // Depths > 0 not supported yet!
- if (cast<ConstantSDNode>(Op.getOperand(0))->getValue() > 0)
- return SDOperand();
-
- // Just load the return address
- SDOperand RetAddrFI = getReturnAddressFrameIndex(DAG);
- return DAG.getLoad(getPointerTy(), DAG.getEntryNode(), RetAddrFI, NULL, 0);
-}
-
-SDOperand X86TargetLowering::LowerFRAMEADDR(SDOperand Op, SelectionDAG &DAG) {
- // Depths > 0 not supported yet!
- if (cast<ConstantSDNode>(Op.getOperand(0))->getValue() > 0)
- return SDOperand();
-
- SDOperand RetAddrFI = getReturnAddressFrameIndex(DAG);
- return DAG.getNode(ISD::SUB, getPointerTy(), RetAddrFI,
- DAG.getIntPtrConstant(4));
-}
-
-SDOperand X86TargetLowering::LowerFRAME_TO_ARGS_OFFSET(SDOperand Op,
- SelectionDAG &DAG) {
- // Is not yet supported on x86-64
- if (Subtarget->is64Bit())
- return SDOperand();
-
- return DAG.getIntPtrConstant(8);
-}
-
-SDOperand X86TargetLowering::LowerEH_RETURN(SDOperand Op, SelectionDAG &DAG)
-{
- assert(!Subtarget->is64Bit() &&
- "Lowering of eh_return builtin is not supported yet on x86-64");
-
- MachineFunction &MF = DAG.getMachineFunction();
- SDOperand Chain = Op.getOperand(0);
- SDOperand Offset = Op.getOperand(1);
- SDOperand Handler = Op.getOperand(2);
-
- SDOperand Frame = DAG.getRegister(RegInfo->getFrameRegister(MF),
- getPointerTy());
-
- SDOperand StoreAddr = DAG.getNode(ISD::SUB, getPointerTy(), Frame,
- DAG.getIntPtrConstant(-4UL));
- StoreAddr = DAG.getNode(ISD::ADD, getPointerTy(), StoreAddr, Offset);
- Chain = DAG.getStore(Chain, Handler, StoreAddr, NULL, 0);
- Chain = DAG.getCopyToReg(Chain, X86::ECX, StoreAddr);
- MF.getRegInfo().addLiveOut(X86::ECX);
-
- return DAG.getNode(X86ISD::EH_RETURN, MVT::Other,
- Chain, DAG.getRegister(X86::ECX, getPointerTy()));
-}
-
-SDOperand X86TargetLowering::LowerTRAMPOLINE(SDOperand Op,
- SelectionDAG &DAG) {
- SDOperand Root = Op.getOperand(0);
- SDOperand Trmp = Op.getOperand(1); // trampoline
- SDOperand FPtr = Op.getOperand(2); // nested function
- SDOperand Nest = Op.getOperand(3); // 'nest' parameter value
-
- const Value *TrmpAddr = cast<SrcValueSDNode>(Op.getOperand(4))->getValue();
-
- const X86InstrInfo *TII =
- ((X86TargetMachine&)getTargetMachine()).getInstrInfo();
-
- if (Subtarget->is64Bit()) {
- SDOperand OutChains[6];
-
- // Large code-model.
-
- const unsigned char JMP64r = TII->getBaseOpcodeFor(X86::JMP64r);
- const unsigned char MOV64ri = TII->getBaseOpcodeFor(X86::MOV64ri);
-
- const unsigned char N86R10 =
- ((const X86RegisterInfo*)RegInfo)->getX86RegNum(X86::R10);
- const unsigned char N86R11 =
- ((const X86RegisterInfo*)RegInfo)->getX86RegNum(X86::R11);
-
- const unsigned char REX_WB = 0x40 | 0x08 | 0x01; // REX prefix
-
- // Load the pointer to the nested function into R11.
- unsigned OpCode = ((MOV64ri | N86R11) << 8) | REX_WB; // movabsq r11
- SDOperand Addr = Trmp;
- OutChains[0] = DAG.getStore(Root, DAG.getConstant(OpCode, MVT::i16), Addr,
- TrmpAddr, 0);
-
- Addr = DAG.getNode(ISD::ADD, MVT::i64, Trmp, DAG.getConstant(2, MVT::i64));
- OutChains[1] = DAG.getStore(Root, FPtr, Addr, TrmpAddr, 2, false, 2);
-
- // Load the 'nest' parameter value into R10.
- // R10 is specified in X86CallingConv.td
- OpCode = ((MOV64ri | N86R10) << 8) | REX_WB; // movabsq r10
- Addr = DAG.getNode(ISD::ADD, MVT::i64, Trmp, DAG.getConstant(10, MVT::i64));
- OutChains[2] = DAG.getStore(Root, DAG.getConstant(OpCode, MVT::i16), Addr,
- TrmpAddr, 10);
-
- Addr = DAG.getNode(ISD::ADD, MVT::i64, Trmp, DAG.getConstant(12, MVT::i64));
- OutChains[3] = DAG.getStore(Root, Nest, Addr, TrmpAddr, 12, false, 2);
-
- // Jump to the nested function.
- OpCode = (JMP64r << 8) | REX_WB; // jmpq *...
- Addr = DAG.getNode(ISD::ADD, MVT::i64, Trmp, DAG.getConstant(20, MVT::i64));
- OutChains[4] = DAG.getStore(Root, DAG.getConstant(OpCode, MVT::i16), Addr,
- TrmpAddr, 20);
-
- unsigned char ModRM = N86R11 | (4 << 3) | (3 << 6); // ...r11
- Addr = DAG.getNode(ISD::ADD, MVT::i64, Trmp, DAG.getConstant(22, MVT::i64));
- OutChains[5] = DAG.getStore(Root, DAG.getConstant(ModRM, MVT::i8), Addr,
- TrmpAddr, 22);
-
- SDOperand Ops[] =
- { Trmp, DAG.getNode(ISD::TokenFactor, MVT::Other, OutChains, 6) };
- return DAG.getNode(ISD::MERGE_VALUES, Op.Val->getVTList(), Ops, 2);
- } else {
- const Function *Func =
- cast<Function>(cast<SrcValueSDNode>(Op.getOperand(5))->getValue());
- unsigned CC = Func->getCallingConv();
- unsigned NestReg;
-
- switch (CC) {
- default:
- assert(0 && "Unsupported calling convention");
- case CallingConv::C:
- case CallingConv::X86_StdCall: {
- // Pass 'nest' parameter in ECX.
- // Must be kept in sync with X86CallingConv.td
- NestReg = X86::ECX;
-
- // Check that ECX wasn't needed by an 'inreg' parameter.
- const FunctionType *FTy = Func->getFunctionType();
- const PAListPtr &Attrs = Func->getParamAttrs();
-
- if (!Attrs.isEmpty() && !Func->isVarArg()) {
- unsigned InRegCount = 0;
- unsigned Idx = 1;
-
- for (FunctionType::param_iterator I = FTy->param_begin(),
- E = FTy->param_end(); I != E; ++I, ++Idx)
- if (Attrs.paramHasAttr(Idx, ParamAttr::InReg))
- // FIXME: should only count parameters that are lowered to integers.
- InRegCount += (getTargetData()->getTypeSizeInBits(*I) + 31) / 32;
-
- if (InRegCount > 2) {
- cerr << "Nest register in use - reduce number of inreg parameters!\n";
- abort();
- }
- }
- break;
- }
- case CallingConv::X86_FastCall:
- // Pass 'nest' parameter in EAX.
- // Must be kept in sync with X86CallingConv.td
- NestReg = X86::EAX;
- break;
- }
-
- SDOperand OutChains[4];
- SDOperand Addr, Disp;
-
- Addr = DAG.getNode(ISD::ADD, MVT::i32, Trmp, DAG.getConstant(10, MVT::i32));
- Disp = DAG.getNode(ISD::SUB, MVT::i32, FPtr, Addr);
-
- const unsigned char MOV32ri = TII->getBaseOpcodeFor(X86::MOV32ri);
- const unsigned char N86Reg =
- ((const X86RegisterInfo*)RegInfo)->getX86RegNum(NestReg);
- OutChains[0] = DAG.getStore(Root, DAG.getConstant(MOV32ri|N86Reg, MVT::i8),
- Trmp, TrmpAddr, 0);
-
- Addr = DAG.getNode(ISD::ADD, MVT::i32, Trmp, DAG.getConstant(1, MVT::i32));
- OutChains[1] = DAG.getStore(Root, Nest, Addr, TrmpAddr, 1, false, 1);
-
- const unsigned char JMP = TII->getBaseOpcodeFor(X86::JMP);
- Addr = DAG.getNode(ISD::ADD, MVT::i32, Trmp, DAG.getConstant(5, MVT::i32));
- OutChains[2] = DAG.getStore(Root, DAG.getConstant(JMP, MVT::i8), Addr,
- TrmpAddr, 5, false, 1);
-
- Addr = DAG.getNode(ISD::ADD, MVT::i32, Trmp, DAG.getConstant(6, MVT::i32));
- OutChains[3] = DAG.getStore(Root, Disp, Addr, TrmpAddr, 6, false, 1);
-
- SDOperand Ops[] =
- { Trmp, DAG.getNode(ISD::TokenFactor, MVT::Other, OutChains, 4) };
- return DAG.getNode(ISD::MERGE_VALUES, Op.Val->getVTList(), Ops, 2);
- }
-}
-
-SDOperand X86TargetLowering::LowerFLT_ROUNDS_(SDOperand Op, SelectionDAG &DAG) {
- /*
- The rounding mode is in bits 11:10 of FPSR, and has the following
- settings:
- 00 Round to nearest
- 01 Round to -inf
- 10 Round to +inf
- 11 Round to 0
-
- FLT_ROUNDS, on the other hand, expects the following:
- -1 Undefined
- 0 Round to 0
- 1 Round to nearest
- 2 Round to +inf
- 3 Round to -inf
-
- To perform the conversion, we do:
- (((((FPSR & 0x800) >> 11) | ((FPSR & 0x400) >> 9)) + 1) & 3)
- */
-
- MachineFunction &MF = DAG.getMachineFunction();
- const TargetMachine &TM = MF.getTarget();
- const TargetFrameInfo &TFI = *TM.getFrameInfo();
- unsigned StackAlignment = TFI.getStackAlignment();
- MVT::ValueType VT = Op.getValueType();
-
- // Save FP Control Word to stack slot
- int SSFI = MF.getFrameInfo()->CreateStackObject(2, StackAlignment);
- SDOperand StackSlot = DAG.getFrameIndex(SSFI, getPointerTy());
-
- SDOperand Chain = DAG.getNode(X86ISD::FNSTCW16m, MVT::Other,
- DAG.getEntryNode(), StackSlot);
-
- // Load FP Control Word from stack slot
- SDOperand CWD = DAG.getLoad(MVT::i16, Chain, StackSlot, NULL, 0);
-
- // Transform as necessary
- SDOperand CWD1 =
- DAG.getNode(ISD::SRL, MVT::i16,
- DAG.getNode(ISD::AND, MVT::i16,
- CWD, DAG.getConstant(0x800, MVT::i16)),
- DAG.getConstant(11, MVT::i8));
- SDOperand CWD2 =
- DAG.getNode(ISD::SRL, MVT::i16,
- DAG.getNode(ISD::AND, MVT::i16,
- CWD, DAG.getConstant(0x400, MVT::i16)),
- DAG.getConstant(9, MVT::i8));
-
- SDOperand RetVal =
- DAG.getNode(ISD::AND, MVT::i16,
- DAG.getNode(ISD::ADD, MVT::i16,
- DAG.getNode(ISD::OR, MVT::i16, CWD1, CWD2),
- DAG.getConstant(1, MVT::i16)),
- DAG.getConstant(3, MVT::i16));
-
-
- return DAG.getNode((MVT::getSizeInBits(VT) < 16 ?
- ISD::TRUNCATE : ISD::ZERO_EXTEND), VT, RetVal);
-}
-
-SDOperand X86TargetLowering::LowerCTLZ(SDOperand Op, SelectionDAG &DAG) {
- MVT::ValueType VT = Op.getValueType();
- MVT::ValueType OpVT = VT;
- unsigned NumBits = MVT::getSizeInBits(VT);
-
- Op = Op.getOperand(0);
- if (VT == MVT::i8) {
- // Zero extend to i32 since there is not an i8 bsr.
- OpVT = MVT::i32;
- Op = DAG.getNode(ISD::ZERO_EXTEND, OpVT, Op);
- }
-
- // Issue a bsr (scan bits in reverse) which also sets EFLAGS.
- SDVTList VTs = DAG.getVTList(OpVT, MVT::i32);
- Op = DAG.getNode(X86ISD::BSR, VTs, Op);
-
- // If src is zero (i.e. bsr sets ZF), returns NumBits.
- SmallVector<SDOperand, 4> Ops;
- Ops.push_back(Op);
- Ops.push_back(DAG.getConstant(NumBits+NumBits-1, OpVT));
- Ops.push_back(DAG.getConstant(X86::COND_E, MVT::i8));
- Ops.push_back(Op.getValue(1));
- Op = DAG.getNode(X86ISD::CMOV, OpVT, &Ops[0], 4);
-
- // Finally xor with NumBits-1.
- Op = DAG.getNode(ISD::XOR, OpVT, Op, DAG.getConstant(NumBits-1, OpVT));
-
- if (VT == MVT::i8)
- Op = DAG.getNode(ISD::TRUNCATE, MVT::i8, Op);
- return Op;
-}
-
-SDOperand X86TargetLowering::LowerCTTZ(SDOperand Op, SelectionDAG &DAG) {
- MVT::ValueType VT = Op.getValueType();
- MVT::ValueType OpVT = VT;
- unsigned NumBits = MVT::getSizeInBits(VT);
-
- Op = Op.getOperand(0);
- if (VT == MVT::i8) {
- OpVT = MVT::i32;
- Op = DAG.getNode(ISD::ZERO_EXTEND, OpVT, Op);
- }
-
- // Issue a bsf (scan bits forward) which also sets EFLAGS.
- SDVTList VTs = DAG.getVTList(OpVT, MVT::i32);
- Op = DAG.getNode(X86ISD::BSF, VTs, Op);
-
- // If src is zero (i.e. bsf sets ZF), returns NumBits.
- SmallVector<SDOperand, 4> Ops;
- Ops.push_back(Op);
- Ops.push_back(DAG.getConstant(NumBits, OpVT));
- Ops.push_back(DAG.getConstant(X86::COND_E, MVT::i8));
- Ops.push_back(Op.getValue(1));
- Op = DAG.getNode(X86ISD::CMOV, OpVT, &Ops[0], 4);
-
- if (VT == MVT::i8)
- Op = DAG.getNode(ISD::TRUNCATE, MVT::i8, Op);
- return Op;
-}
-
-SDOperand X86TargetLowering::LowerLCS(SDOperand Op, SelectionDAG &DAG) {
- MVT::ValueType T = cast<AtomicSDNode>(Op.Val)->getVT();
- unsigned Reg = 0;
- unsigned size = 0;
- switch(T) {
- case MVT::i8: Reg = X86::AL; size = 1; break;
- case MVT::i16: Reg = X86::AX; size = 2; break;
- case MVT::i32: Reg = X86::EAX; size = 4; break;
- case MVT::i64:
- if (Subtarget->is64Bit()) {
- Reg = X86::RAX; size = 8;
- } else //Should go away when LowerType stuff lands
- return SDOperand(ExpandATOMIC_LCS(Op.Val, DAG), 0);
- break;
- };
- SDOperand cpIn = DAG.getCopyToReg(Op.getOperand(0), Reg,
- Op.getOperand(3), SDOperand());
- SDOperand Ops[] = { cpIn.getValue(0),
- Op.getOperand(1),
- Op.getOperand(2),
- DAG.getTargetConstant(size, MVT::i8),
- cpIn.getValue(1) };
- SDVTList Tys = DAG.getVTList(MVT::Other, MVT::Flag);
- SDOperand Result = DAG.getNode(X86ISD::LCMPXCHG_DAG, Tys, Ops, 5);
- SDOperand cpOut =
- DAG.getCopyFromReg(Result.getValue(0), Reg, T, Result.getValue(1));
- return cpOut;
-}
-
-SDNode* X86TargetLowering::ExpandATOMIC_LCS(SDNode* Op, SelectionDAG &DAG) {
- MVT::ValueType T = cast<AtomicSDNode>(Op)->getVT();
- assert (T == MVT::i64 && "Only know how to expand i64 CAS");
- SDOperand cpInL, cpInH;
- cpInL = DAG.getNode(ISD::EXTRACT_ELEMENT, MVT::i32, Op->getOperand(3),
- DAG.getConstant(0, MVT::i32));
- cpInH = DAG.getNode(ISD::EXTRACT_ELEMENT, MVT::i32, Op->getOperand(3),
- DAG.getConstant(1, MVT::i32));
- cpInL = DAG.getCopyToReg(Op->getOperand(0), X86::EAX,
- cpInL, SDOperand());
- cpInH = DAG.getCopyToReg(cpInL.getValue(0), X86::EDX,
- cpInH, cpInL.getValue(1));
- SDOperand swapInL, swapInH;
- swapInL = DAG.getNode(ISD::EXTRACT_ELEMENT, MVT::i32, Op->getOperand(2),
- DAG.getConstant(0, MVT::i32));
- swapInH = DAG.getNode(ISD::EXTRACT_ELEMENT, MVT::i32, Op->getOperand(2),
- DAG.getConstant(1, MVT::i32));
- swapInL = DAG.getCopyToReg(cpInH.getValue(0), X86::EBX,
- swapInL, cpInH.getValue(1));
- swapInH = DAG.getCopyToReg(swapInL.getValue(0), X86::ECX,
- swapInH, swapInL.getValue(1));
- SDOperand Ops[] = { swapInH.getValue(0),
- Op->getOperand(1),
- swapInH.getValue(1)};
- SDVTList Tys = DAG.getVTList(MVT::Other, MVT::Flag);
- SDOperand Result = DAG.getNode(X86ISD::LCMPXCHG8_DAG, Tys, Ops, 3);
- SDOperand cpOutL = DAG.getCopyFromReg(Result.getValue(0), X86::EAX, MVT::i32,
- Result.getValue(1));
- SDOperand cpOutH = DAG.getCopyFromReg(cpOutL.getValue(1), X86::EDX, MVT::i32,
- cpOutL.getValue(2));
- SDOperand OpsF[] = { cpOutL.getValue(0), cpOutH.getValue(0)};
- SDOperand ResultVal = DAG.getNode(ISD::BUILD_PAIR, MVT::i64, OpsF, 2);
- Tys = DAG.getVTList(MVT::i64, MVT::Other);
- return DAG.getNode(ISD::MERGE_VALUES, Tys, ResultVal, cpOutH.getValue(1)).Val;
-}
-
-SDNode* X86TargetLowering::ExpandATOMIC_LSS(SDNode* Op, SelectionDAG &DAG) {
- MVT::ValueType T = cast<AtomicSDNode>(Op)->getVT();
- assert (T == MVT::i32 && "Only know how to expand i32 LSS");
- SDOperand negOp = DAG.getNode(ISD::SUB, T,
- DAG.getConstant(0, T), Op->getOperand(2));
- return DAG.getAtomic(ISD::ATOMIC_LAS, Op->getOperand(0),
- Op->getOperand(1), negOp, T).Val;
-}
-
-/// LowerOperation - Provide custom lowering hooks for some operations.
-///
-SDOperand X86TargetLowering::LowerOperation(SDOperand Op, SelectionDAG &DAG) {
- switch (Op.getOpcode()) {
- default: assert(0 && "Should not custom lower this!");
- case ISD::ATOMIC_LCS: return LowerLCS(Op,DAG);
- case ISD::BUILD_VECTOR: return LowerBUILD_VECTOR(Op, DAG);
- case ISD::VECTOR_SHUFFLE: return LowerVECTOR_SHUFFLE(Op, DAG);
- case ISD::EXTRACT_VECTOR_ELT: return LowerEXTRACT_VECTOR_ELT(Op, DAG);
- case ISD::INSERT_VECTOR_ELT: return LowerINSERT_VECTOR_ELT(Op, DAG);
- case ISD::SCALAR_TO_VECTOR: return LowerSCALAR_TO_VECTOR(Op, DAG);
- case ISD::ConstantPool: return LowerConstantPool(Op, DAG);
- case ISD::GlobalAddress: return LowerGlobalAddress(Op, DAG);
- case ISD::GlobalTLSAddress: return LowerGlobalTLSAddress(Op, DAG);
- case ISD::ExternalSymbol: return LowerExternalSymbol(Op, DAG);
- case ISD::SHL_PARTS:
- case ISD::SRA_PARTS:
- case ISD::SRL_PARTS: return LowerShift(Op, DAG);
- case ISD::SINT_TO_FP: return LowerSINT_TO_FP(Op, DAG);
- case ISD::FP_TO_SINT: return LowerFP_TO_SINT(Op, DAG);
- case ISD::FABS: return LowerFABS(Op, DAG);
- case ISD::FNEG: return LowerFNEG(Op, DAG);
- case ISD::FCOPYSIGN: return LowerFCOPYSIGN(Op, DAG);
- case ISD::SETCC: return LowerSETCC(Op, DAG);
- case ISD::SELECT: return LowerSELECT(Op, DAG);
- case ISD::BRCOND: return LowerBRCOND(Op, DAG);
- case ISD::JumpTable: return LowerJumpTable(Op, DAG);
- case ISD::CALL: return LowerCALL(Op, DAG);
- case ISD::RET: return LowerRET(Op, DAG);
- case ISD::FORMAL_ARGUMENTS: return LowerFORMAL_ARGUMENTS(Op, DAG);
- case ISD::VASTART: return LowerVASTART(Op, DAG);
- case ISD::VAARG: return LowerVAARG(Op, DAG);
- case ISD::VACOPY: return LowerVACOPY(Op, DAG);
- case ISD::INTRINSIC_WO_CHAIN: return LowerINTRINSIC_WO_CHAIN(Op, DAG);
- case ISD::RETURNADDR: return LowerRETURNADDR(Op, DAG);
- case ISD::FRAMEADDR: return LowerFRAMEADDR(Op, DAG);
- case ISD::FRAME_TO_ARGS_OFFSET:
- return LowerFRAME_TO_ARGS_OFFSET(Op, DAG);
- case ISD::DYNAMIC_STACKALLOC: return LowerDYNAMIC_STACKALLOC(Op, DAG);
- case ISD::EH_RETURN: return LowerEH_RETURN(Op, DAG);
- case ISD::TRAMPOLINE: return LowerTRAMPOLINE(Op, DAG);
- case ISD::FLT_ROUNDS_: return LowerFLT_ROUNDS_(Op, DAG);
- case ISD::CTLZ: return LowerCTLZ(Op, DAG);
- case ISD::CTTZ: return LowerCTTZ(Op, DAG);
-
- // FIXME: REMOVE THIS WHEN LegalizeDAGTypes lands.
- case ISD::READCYCLECOUNTER:
- return SDOperand(ExpandREADCYCLECOUNTER(Op.Val, DAG), 0);
- }
-}
-
-/// ExpandOperation - Provide custom lowering hooks for expanding operations.
-SDNode *X86TargetLowering::ExpandOperationResult(SDNode *N, SelectionDAG &DAG) {
- switch (N->getOpcode()) {
- default: assert(0 && "Should not custom lower this!");
- case ISD::FP_TO_SINT: return ExpandFP_TO_SINT(N, DAG);
- case ISD::READCYCLECOUNTER: return ExpandREADCYCLECOUNTER(N, DAG);
- case ISD::ATOMIC_LCS: return ExpandATOMIC_LCS(N, DAG);
- case ISD::ATOMIC_LSS: return ExpandATOMIC_LSS(N,DAG);
- }
-}
-
-const char *X86TargetLowering::getTargetNodeName(unsigned Opcode) const {
- switch (Opcode) {
- default: return NULL;
- case X86ISD::BSF: return "X86ISD::BSF";
- case X86ISD::BSR: return "X86ISD::BSR";
- case X86ISD::SHLD: return "X86ISD::SHLD";
- case X86ISD::SHRD: return "X86ISD::SHRD";
- case X86ISD::FAND: return "X86ISD::FAND";
- case X86ISD::FOR: return "X86ISD::FOR";
- case X86ISD::FXOR: return "X86ISD::FXOR";
- case X86ISD::FSRL: return "X86ISD::FSRL";
- case X86ISD::FILD: return "X86ISD::FILD";
- case X86ISD::FILD_FLAG: return "X86ISD::FILD_FLAG";
- case X86ISD::FP_TO_INT16_IN_MEM: return "X86ISD::FP_TO_INT16_IN_MEM";
- case X86ISD::FP_TO_INT32_IN_MEM: return "X86ISD::FP_TO_INT32_IN_MEM";
- case X86ISD::FP_TO_INT64_IN_MEM: return "X86ISD::FP_TO_INT64_IN_MEM";
- case X86ISD::FLD: return "X86ISD::FLD";
- case X86ISD::FST: return "X86ISD::FST";
- case X86ISD::CALL: return "X86ISD::CALL";
- case X86ISD::TAILCALL: return "X86ISD::TAILCALL";
- case X86ISD::RDTSC_DAG: return "X86ISD::RDTSC_DAG";
- case X86ISD::CMP: return "X86ISD::CMP";
- case X86ISD::COMI: return "X86ISD::COMI";
- case X86ISD::UCOMI: return "X86ISD::UCOMI";
- case X86ISD::SETCC: return "X86ISD::SETCC";
- case X86ISD::CMOV: return "X86ISD::CMOV";
- case X86ISD::BRCOND: return "X86ISD::BRCOND";
- case X86ISD::RET_FLAG: return "X86ISD::RET_FLAG";
- case X86ISD::REP_STOS: return "X86ISD::REP_STOS";
- case X86ISD::REP_MOVS: return "X86ISD::REP_MOVS";
- case X86ISD::GlobalBaseReg: return "X86ISD::GlobalBaseReg";
- case X86ISD::Wrapper: return "X86ISD::Wrapper";
- case X86ISD::PEXTRB: return "X86ISD::PEXTRB";
- case X86ISD::PEXTRW: return "X86ISD::PEXTRW";
- case X86ISD::INSERTPS: return "X86ISD::INSERTPS";
- case X86ISD::PINSRB: return "X86ISD::PINSRB";
- case X86ISD::PINSRW: return "X86ISD::PINSRW";
- case X86ISD::FMAX: return "X86ISD::FMAX";
- case X86ISD::FMIN: return "X86ISD::FMIN";
- case X86ISD::FRSQRT: return "X86ISD::FRSQRT";
- case X86ISD::FRCP: return "X86ISD::FRCP";
- case X86ISD::TLSADDR: return "X86ISD::TLSADDR";
- case X86ISD::THREAD_POINTER: return "X86ISD::THREAD_POINTER";
- case X86ISD::EH_RETURN: return "X86ISD::EH_RETURN";
- case X86ISD::TC_RETURN: return "X86ISD::TC_RETURN";
- case X86ISD::FNSTCW16m: return "X86ISD::FNSTCW16m";
- case X86ISD::LCMPXCHG_DAG: return "X86ISD::LCMPXCHG_DAG";
- case X86ISD::LCMPXCHG8_DAG: return "X86ISD::LCMPXCHG8_DAG";
- case X86ISD::VZEXT_MOVL: return "X86ISD::VZEXT_MOVL";
- case X86ISD::VZEXT_LOAD: return "X86ISD::VZEXT_LOAD";
- }
-}
-
-// isLegalAddressingMode - Return true if the addressing mode represented
-// by AM is legal for this target, for a load/store of the specified type.
-bool X86TargetLowering::isLegalAddressingMode(const AddrMode &AM,
- const Type *Ty) const {
- // X86 supports extremely general addressing modes.
-
- // X86 allows a sign-extended 32-bit immediate field as a displacement.
- if (AM.BaseOffs <= -(1LL << 32) || AM.BaseOffs >= (1LL << 32)-1)
- return false;
-
- if (AM.BaseGV) {
- // We can only fold this if we don't need an extra load.
- if (Subtarget->GVRequiresExtraLoad(AM.BaseGV, getTargetMachine(), false))
- return false;
-
- // X86-64 only supports addr of globals in small code model.
- if (Subtarget->is64Bit()) {
- if (getTargetMachine().getCodeModel() != CodeModel::Small)
- return false;
- // If lower 4G is not available, then we must use rip-relative addressing.
- if (AM.BaseOffs || AM.Scale > 1)
- return false;
- }
- }
-
- switch (AM.Scale) {
- case 0:
- case 1:
- case 2:
- case 4:
- case 8:
- // These scales always work.
- break;
- case 3:
- case 5:
- case 9:
- // These scales are formed with basereg+scalereg. Only accept if there is
- // no basereg yet.
- if (AM.HasBaseReg)
- return false;
- break;
- default: // Other stuff never works.
- return false;
- }
-
- return true;
-}
-
-
-bool X86TargetLowering::isTruncateFree(const Type *Ty1, const Type *Ty2) const {
- if (!Ty1->isInteger() || !Ty2->isInteger())
- return false;
- unsigned NumBits1 = Ty1->getPrimitiveSizeInBits();
- unsigned NumBits2 = Ty2->getPrimitiveSizeInBits();
- if (NumBits1 <= NumBits2)
- return false;
- return Subtarget->is64Bit() || NumBits1 < 64;
-}
-
-bool X86TargetLowering::isTruncateFree(MVT::ValueType VT1,
- MVT::ValueType VT2) const {
- if (!MVT::isInteger(VT1) || !MVT::isInteger(VT2))
- return false;
- unsigned NumBits1 = MVT::getSizeInBits(VT1);
- unsigned NumBits2 = MVT::getSizeInBits(VT2);
- if (NumBits1 <= NumBits2)
- return false;
- return Subtarget->is64Bit() || NumBits1 < 64;
-}
-
-/// isShuffleMaskLegal - Targets can use this to indicate that they only
-/// support *some* VECTOR_SHUFFLE operations, those with specific masks.
-/// By default, if a target supports the VECTOR_SHUFFLE node, all mask values
-/// are assumed to be legal.
-bool
-X86TargetLowering::isShuffleMaskLegal(SDOperand Mask, MVT::ValueType VT) const {
- // Only do shuffles on 128-bit vector types for now.
- if (MVT::getSizeInBits(VT) == 64) return false;
- return (Mask.Val->getNumOperands() <= 4 ||
- isIdentityMask(Mask.Val) ||
- isIdentityMask(Mask.Val, true) ||
- isSplatMask(Mask.Val) ||
- isPSHUFHW_PSHUFLWMask(Mask.Val) ||
- X86::isUNPCKLMask(Mask.Val) ||
- X86::isUNPCKHMask(Mask.Val) ||
- X86::isUNPCKL_v_undef_Mask(Mask.Val) ||
- X86::isUNPCKH_v_undef_Mask(Mask.Val));
-}
-
-bool
-X86TargetLowering::isVectorClearMaskLegal(const std::vector<SDOperand> &BVOps,
- MVT::ValueType EVT,
- SelectionDAG &DAG) const {
- unsigned NumElts = BVOps.size();
- // Only do shuffles on 128-bit vector types for now.
- if (MVT::getSizeInBits(EVT) * NumElts == 64) return false;
- if (NumElts == 2) return true;
- if (NumElts == 4) {
- return (isMOVLMask(&BVOps[0], 4) ||
- isCommutedMOVL(&BVOps[0], 4, true) ||
- isSHUFPMask(&BVOps[0], 4) ||
- isCommutedSHUFP(&BVOps[0], 4));
- }
- return false;
-}
-
-//===----------------------------------------------------------------------===//
-// X86 Scheduler Hooks
-//===----------------------------------------------------------------------===//
-
-// private utility function
-MachineBasicBlock *
-X86TargetLowering::EmitAtomicBitwiseWithCustomInserter(MachineInstr *bInstr,
- MachineBasicBlock *MBB,
- unsigned regOpc,
- unsigned immOpc) {
- // For the atomic bitwise operator, we generate
- // thisMBB:
- // newMBB:
- // ld t1 = [bitinstr.addr]
- // op t2 = t1, [bitinstr.val]
- // mov EAX = t1
- // lcs dest = [bitinstr.addr], t2 [EAX is implicit]
- // bz newMBB
- // fallthrough -->nextMBB
- const TargetInstrInfo *TII = getTargetMachine().getInstrInfo();
- const BasicBlock *LLVM_BB = MBB->getBasicBlock();
- ilist<MachineBasicBlock>::iterator MBBIter = MBB;
- ++MBBIter;
-
- /// First build the CFG
- MachineFunction *F = MBB->getParent();
- MachineBasicBlock *thisMBB = MBB;
- MachineBasicBlock *newMBB = new MachineBasicBlock(LLVM_BB);
- MachineBasicBlock *nextMBB = new MachineBasicBlock(LLVM_BB);
- F->getBasicBlockList().insert(MBBIter, newMBB);
- F->getBasicBlockList().insert(MBBIter, nextMBB);
-
- // Move all successors to thisMBB to nextMBB
- nextMBB->transferSuccessors(thisMBB);
-
- // Update thisMBB to fall through to newMBB
- thisMBB->addSuccessor(newMBB);
-
- // newMBB jumps to itself and fall through to nextMBB
- newMBB->addSuccessor(nextMBB);
- newMBB->addSuccessor(newMBB);
-
- // Insert instructions into newMBB based on incoming instruction
- assert(bInstr->getNumOperands() < 8 && "unexpected number of operands");
- MachineOperand& destOper = bInstr->getOperand(0);
- MachineOperand* argOpers[6];
- int numArgs = bInstr->getNumOperands() - 1;
- for (int i=0; i < numArgs; ++i)
- argOpers[i] = &bInstr->getOperand(i+1);
-
- // x86 address has 4 operands: base, index, scale, and displacement
- int lastAddrIndx = 3; // [0,3]
- int valArgIndx = 4;
-
- unsigned t1 = F->getRegInfo().createVirtualRegister(X86::GR32RegisterClass);
- MachineInstrBuilder MIB = BuildMI(newMBB, TII->get(X86::MOV32rm), t1);
- for (int i=0; i <= lastAddrIndx; ++i)
- (*MIB).addOperand(*argOpers[i]);
-
- unsigned t2 = F->getRegInfo().createVirtualRegister(X86::GR32RegisterClass);
- assert( (argOpers[valArgIndx]->isReg() || argOpers[valArgIndx]->isImm())
- && "invalid operand");
- if (argOpers[valArgIndx]->isReg())
- MIB = BuildMI(newMBB, TII->get(regOpc), t2);
- else
- MIB = BuildMI(newMBB, TII->get(immOpc), t2);
- MIB.addReg(t1);
- (*MIB).addOperand(*argOpers[valArgIndx]);
-
- MIB = BuildMI(newMBB, TII->get(X86::MOV32rr), X86::EAX);
- MIB.addReg(t1);
-
- MIB = BuildMI(newMBB, TII->get(X86::LCMPXCHG32));
- for (int i=0; i <= lastAddrIndx; ++i)
- (*MIB).addOperand(*argOpers[i]);
- MIB.addReg(t2);
-
- MIB = BuildMI(newMBB, TII->get(X86::MOV32rr), destOper.getReg());
- MIB.addReg(X86::EAX);
-
- // insert branch
- BuildMI(newMBB, TII->get(X86::JNE)).addMBB(newMBB);
-
- delete bInstr; // The pseudo instruction is gone now.
- return nextMBB;
-}
-
-// private utility function
-MachineBasicBlock *
-X86TargetLowering::EmitAtomicMinMaxWithCustomInserter(MachineInstr *mInstr,
- MachineBasicBlock *MBB,
- unsigned cmovOpc) {
- // For the atomic min/max operator, we generate
- // thisMBB:
- // newMBB:
- // ld t1 = [min/max.addr]
- // mov t2 = [min/max.val]
- // cmp t1, t2
- // cmov[cond] t2 = t1
- // mov EAX = t1
- // lcs dest = [bitinstr.addr], t2 [EAX is implicit]
- // bz newMBB
- // fallthrough -->nextMBB
- //
- const TargetInstrInfo *TII = getTargetMachine().getInstrInfo();
- const BasicBlock *LLVM_BB = MBB->getBasicBlock();
- ilist<MachineBasicBlock>::iterator MBBIter = MBB;
- ++MBBIter;
-
- /// First build the CFG
- MachineFunction *F = MBB->getParent();
- MachineBasicBlock *thisMBB = MBB;
- MachineBasicBlock *newMBB = new MachineBasicBlock(LLVM_BB);
- MachineBasicBlock *nextMBB = new MachineBasicBlock(LLVM_BB);
- F->getBasicBlockList().insert(MBBIter, newMBB);
- F->getBasicBlockList().insert(MBBIter, nextMBB);
-
- // Move all successors to thisMBB to nextMBB
- nextMBB->transferSuccessors(thisMBB);
-
- // Update thisMBB to fall through to newMBB
- thisMBB->addSuccessor(newMBB);
-
- // newMBB jumps to newMBB and fall through to nextMBB
- newMBB->addSuccessor(nextMBB);
- newMBB->addSuccessor(newMBB);
-
- // Insert instructions into newMBB based on incoming instruction
- assert(mInstr->getNumOperands() < 8 && "unexpected number of operands");
- MachineOperand& destOper = mInstr->getOperand(0);
- MachineOperand* argOpers[6];
- int numArgs = mInstr->getNumOperands() - 1;
- for (int i=0; i < numArgs; ++i)
- argOpers[i] = &mInstr->getOperand(i+1);
-
- // x86 address has 4 operands: base, index, scale, and displacement
- int lastAddrIndx = 3; // [0,3]
- int valArgIndx = 4;
-
- unsigned t1 = F->getRegInfo().createVirtualRegister(X86::GR32RegisterClass);
- MachineInstrBuilder MIB = BuildMI(newMBB, TII->get(X86::MOV32rm), t1);
- for (int i=0; i <= lastAddrIndx; ++i)
- (*MIB).addOperand(*argOpers[i]);
-
- // We only support register and immediate values
- assert( (argOpers[valArgIndx]->isReg() || argOpers[valArgIndx]->isImm())
- && "invalid operand");
-
- unsigned t2 = F->getRegInfo().createVirtualRegister(X86::GR32RegisterClass);
- if (argOpers[valArgIndx]->isReg())
- MIB = BuildMI(newMBB, TII->get(X86::MOV32rr), t2);
- else
- MIB = BuildMI(newMBB, TII->get(X86::MOV32rr), t2);
- (*MIB).addOperand(*argOpers[valArgIndx]);
-
- MIB = BuildMI(newMBB, TII->get(X86::MOV32rr), X86::EAX);
- MIB.addReg(t1);
-
- MIB = BuildMI(newMBB, TII->get(X86::CMP32rr));
- MIB.addReg(t1);
- MIB.addReg(t2);
-
- // Generate movc
- unsigned t3 = F->getRegInfo().createVirtualRegister(X86::GR32RegisterClass);
- MIB = BuildMI(newMBB, TII->get(cmovOpc),t3);
- MIB.addReg(t2);
- MIB.addReg(t1);
-
- // Cmp and exchange if none has modified the memory location
- MIB = BuildMI(newMBB, TII->get(X86::LCMPXCHG32));
- for (int i=0; i <= lastAddrIndx; ++i)
- (*MIB).addOperand(*argOpers[i]);
- MIB.addReg(t3);
-
- MIB = BuildMI(newMBB, TII->get(X86::MOV32rr), destOper.getReg());
- MIB.addReg(X86::EAX);
-
- // insert branch
- BuildMI(newMBB, TII->get(X86::JNE)).addMBB(newMBB);
-
- delete mInstr; // The pseudo instruction is gone now.
- return nextMBB;
-}
-
-
-MachineBasicBlock *
-X86TargetLowering::EmitInstrWithCustomInserter(MachineInstr *MI,
- MachineBasicBlock *BB) {
- const TargetInstrInfo *TII = getTargetMachine().getInstrInfo();
- switch (MI->getOpcode()) {
- default: assert(false && "Unexpected instr type to insert");
- case X86::CMOV_FR32:
- case X86::CMOV_FR64:
- case X86::CMOV_V4F32:
- case X86::CMOV_V2F64:
- case X86::CMOV_V2I64: {
- // To "insert" a SELECT_CC instruction, we actually have to insert the
- // diamond control-flow pattern. The incoming instruction knows the
- // destination vreg to set, the condition code register to branch on, the
- // true/false values to select between, and a branch opcode to use.
- const BasicBlock *LLVM_BB = BB->getBasicBlock();
- ilist<MachineBasicBlock>::iterator It = BB;
- ++It;
-
- // thisMBB:
- // ...
- // TrueVal = ...
- // cmpTY ccX, r1, r2
- // bCC copy1MBB
- // fallthrough --> copy0MBB
- MachineBasicBlock *thisMBB = BB;
- MachineBasicBlock *copy0MBB = new MachineBasicBlock(LLVM_BB);
- MachineBasicBlock *sinkMBB = new MachineBasicBlock(LLVM_BB);
- unsigned Opc =
- X86::GetCondBranchFromCond((X86::CondCode)MI->getOperand(3).getImm());
- BuildMI(BB, TII->get(Opc)).addMBB(sinkMBB);
- MachineFunction *F = BB->getParent();
- F->getBasicBlockList().insert(It, copy0MBB);
- F->getBasicBlockList().insert(It, sinkMBB);
- // Update machine-CFG edges by transferring all successors of the current
- // block to the new block which will contain the Phi node for the select.
- sinkMBB->transferSuccessors(BB);
-
- // Add the true and fallthrough blocks as its successors.
- BB->addSuccessor(copy0MBB);
- BB->addSuccessor(sinkMBB);
-
- // copy0MBB:
- // %FalseValue = ...
- // # fallthrough to sinkMBB
- BB = copy0MBB;
-
- // Update machine-CFG edges
- BB->addSuccessor(sinkMBB);
-
- // sinkMBB:
- // %Result = phi [ %FalseValue, copy0MBB ], [ %TrueValue, thisMBB ]
- // ...
- BB = sinkMBB;
- BuildMI(BB, TII->get(X86::PHI), MI->getOperand(0).getReg())
- .addReg(MI->getOperand(1).getReg()).addMBB(copy0MBB)
- .addReg(MI->getOperand(2).getReg()).addMBB(thisMBB);
-
- delete MI; // The pseudo instruction is gone now.
- return BB;
- }
-
- case X86::FP32_TO_INT16_IN_MEM:
- case X86::FP32_TO_INT32_IN_MEM:
- case X86::FP32_TO_INT64_IN_MEM:
- case X86::FP64_TO_INT16_IN_MEM:
- case X86::FP64_TO_INT32_IN_MEM:
- case X86::FP64_TO_INT64_IN_MEM:
- case X86::FP80_TO_INT16_IN_MEM:
- case X86::FP80_TO_INT32_IN_MEM:
- case X86::FP80_TO_INT64_IN_MEM: {
- // Change the floating point control register to use "round towards zero"
- // mode when truncating to an integer value.
- MachineFunction *F = BB->getParent();
- int CWFrameIdx = F->getFrameInfo()->CreateStackObject(2, 2);
- addFrameReference(BuildMI(BB, TII->get(X86::FNSTCW16m)), CWFrameIdx);
-
- // Load the old value of the high byte of the control word...
- unsigned OldCW =
- F->getRegInfo().createVirtualRegister(X86::GR16RegisterClass);
- addFrameReference(BuildMI(BB, TII->get(X86::MOV16rm), OldCW), CWFrameIdx);
-
- // Set the high part to be round to zero...
- addFrameReference(BuildMI(BB, TII->get(X86::MOV16mi)), CWFrameIdx)
- .addImm(0xC7F);
-
- // Reload the modified control word now...
- addFrameReference(BuildMI(BB, TII->get(X86::FLDCW16m)), CWFrameIdx);
-
- // Restore the memory image of control word to original value
- addFrameReference(BuildMI(BB, TII->get(X86::MOV16mr)), CWFrameIdx)
- .addReg(OldCW);
-
- // Get the X86 opcode to use.
- unsigned Opc;
- switch (MI->getOpcode()) {
- default: assert(0 && "illegal opcode!");
- case X86::FP32_TO_INT16_IN_MEM: Opc = X86::IST_Fp16m32; break;
- case X86::FP32_TO_INT32_IN_MEM: Opc = X86::IST_Fp32m32; break;
- case X86::FP32_TO_INT64_IN_MEM: Opc = X86::IST_Fp64m32; break;
- case X86::FP64_TO_INT16_IN_MEM: Opc = X86::IST_Fp16m64; break;
- case X86::FP64_TO_INT32_IN_MEM: Opc = X86::IST_Fp32m64; break;
- case X86::FP64_TO_INT64_IN_MEM: Opc = X86::IST_Fp64m64; break;
- case X86::FP80_TO_INT16_IN_MEM: Opc = X86::IST_Fp16m80; break;
- case X86::FP80_TO_INT32_IN_MEM: Opc = X86::IST_Fp32m80; break;
- case X86::FP80_TO_INT64_IN_MEM: Opc = X86::IST_Fp64m80; break;
- }
-
- X86AddressMode AM;
- MachineOperand &Op = MI->getOperand(0);
- if (Op.isRegister()) {
- AM.BaseType = X86AddressMode::RegBase;
- AM.Base.Reg = Op.getReg();
- } else {
- AM.BaseType = X86AddressMode::FrameIndexBase;
- AM.Base.FrameIndex = Op.getIndex();
- }
- Op = MI->getOperand(1);
- if (Op.isImmediate())
- AM.Scale = Op.getImm();
- Op = MI->getOperand(2);
- if (Op.isImmediate())
- AM.IndexReg = Op.getImm();
- Op = MI->getOperand(3);
- if (Op.isGlobalAddress()) {
- AM.GV = Op.getGlobal();
- } else {
- AM.Disp = Op.getImm();
- }
- addFullAddress(BuildMI(BB, TII->get(Opc)), AM)
- .addReg(MI->getOperand(4).getReg());
-
- // Reload the original control word now.
- addFrameReference(BuildMI(BB, TII->get(X86::FLDCW16m)), CWFrameIdx);
-
- delete MI; // The pseudo instruction is gone now.
- return BB;
- }
- case X86::ATOMAND32:
- return EmitAtomicBitwiseWithCustomInserter(MI, BB, X86::AND32rr,
- X86::AND32ri);
- case X86::ATOMOR32:
- return EmitAtomicBitwiseWithCustomInserter(MI, BB, X86::OR32rr,
- X86::OR32ri);
- case X86::ATOMXOR32:
- return EmitAtomicBitwiseWithCustomInserter(MI, BB, X86::XOR32rr,
- X86::XOR32ri);
- case X86::ATOMMIN32:
- return EmitAtomicMinMaxWithCustomInserter(MI, BB, X86::CMOVL32rr);
- case X86::ATOMMAX32:
- return EmitAtomicMinMaxWithCustomInserter(MI, BB, X86::CMOVG32rr);
- case X86::ATOMUMIN32:
- return EmitAtomicMinMaxWithCustomInserter(MI, BB, X86::CMOVB32rr);
- case X86::ATOMUMAX32:
- return EmitAtomicMinMaxWithCustomInserter(MI, BB, X86::CMOVA32rr);
- }
-}
-
-//===----------------------------------------------------------------------===//
-// X86 Optimization Hooks
-//===----------------------------------------------------------------------===//
-
-void X86TargetLowering::computeMaskedBitsForTargetNode(const SDOperand Op,
- const APInt &Mask,
- APInt &KnownZero,
- APInt &KnownOne,
- const SelectionDAG &DAG,
- unsigned Depth) const {
- unsigned Opc = Op.getOpcode();
- assert((Opc >= ISD::BUILTIN_OP_END ||
- Opc == ISD::INTRINSIC_WO_CHAIN ||
- Opc == ISD::INTRINSIC_W_CHAIN ||
- Opc == ISD::INTRINSIC_VOID) &&
- "Should use MaskedValueIsZero if you don't know whether Op"
- " is a target node!");
-
- KnownZero = KnownOne = APInt(Mask.getBitWidth(), 0); // Don't know anything.
- switch (Opc) {
- default: break;
- case X86ISD::SETCC:
- KnownZero |= APInt::getHighBitsSet(Mask.getBitWidth(),
- Mask.getBitWidth() - 1);
- break;
- }
-}
-
-/// getShuffleScalarElt - Returns the scalar element that will make up the ith
-/// element of the result of the vector shuffle.
-static SDOperand getShuffleScalarElt(SDNode *N, unsigned i, SelectionDAG &DAG) {
- MVT::ValueType VT = N->getValueType(0);
- SDOperand PermMask = N->getOperand(2);
- unsigned NumElems = PermMask.getNumOperands();
- SDOperand V = (i < NumElems) ? N->getOperand(0) : N->getOperand(1);
- i %= NumElems;
- if (V.getOpcode() == ISD::SCALAR_TO_VECTOR) {
- return (i == 0)
- ? V.getOperand(0) : DAG.getNode(ISD::UNDEF, MVT::getVectorElementType(VT));
- } else if (V.getOpcode() == ISD::VECTOR_SHUFFLE) {
- SDOperand Idx = PermMask.getOperand(i);
- if (Idx.getOpcode() == ISD::UNDEF)
- return DAG.getNode(ISD::UNDEF, MVT::getVectorElementType(VT));
- return getShuffleScalarElt(V.Val,cast<ConstantSDNode>(Idx)->getValue(),DAG);
- }
- return SDOperand();
-}
-
-/// isGAPlusOffset - Returns true (and the GlobalValue and the offset) if the
-/// node is a GlobalAddress + an offset.
-static bool isGAPlusOffset(SDNode *N, GlobalValue* &GA, int64_t &Offset) {
- unsigned Opc = N->getOpcode();
- if (Opc == X86ISD::Wrapper) {
- if (dyn_cast<GlobalAddressSDNode>(N->getOperand(0))) {
- GA = cast<GlobalAddressSDNode>(N->getOperand(0))->getGlobal();
- return true;
- }
- } else if (Opc == ISD::ADD) {
- SDOperand N1 = N->getOperand(0);
- SDOperand N2 = N->getOperand(1);
- if (isGAPlusOffset(N1.Val, GA, Offset)) {
- ConstantSDNode *V = dyn_cast<ConstantSDNode>(N2);
- if (V) {
- Offset += V->getSignExtended();
- return true;
- }
- } else if (isGAPlusOffset(N2.Val, GA, Offset)) {
- ConstantSDNode *V = dyn_cast<ConstantSDNode>(N1);
- if (V) {
- Offset += V->getSignExtended();
- return true;
- }
- }
- }
- return false;
-}
-
-/// isConsecutiveLoad - Returns true if N is loading from an address of Base
-/// + Dist * Size.
-static bool isConsecutiveLoad(SDNode *N, SDNode *Base, int Dist, int Size,
- MachineFrameInfo *MFI) {
- if (N->getOperand(0).Val != Base->getOperand(0).Val)
- return false;
-
- SDOperand Loc = N->getOperand(1);
- SDOperand BaseLoc = Base->getOperand(1);
- if (Loc.getOpcode() == ISD::FrameIndex) {
- if (BaseLoc.getOpcode() != ISD::FrameIndex)
- return false;
- int FI = cast<FrameIndexSDNode>(Loc)->getIndex();
- int BFI = cast<FrameIndexSDNode>(BaseLoc)->getIndex();
- int FS = MFI->getObjectSize(FI);
- int BFS = MFI->getObjectSize(BFI);
- if (FS != BFS || FS != Size) return false;
- return MFI->getObjectOffset(FI) == (MFI->getObjectOffset(BFI) + Dist*Size);
- } else {
- GlobalValue *GV1 = NULL;
- GlobalValue *GV2 = NULL;
- int64_t Offset1 = 0;
- int64_t Offset2 = 0;
- bool isGA1 = isGAPlusOffset(Loc.Val, GV1, Offset1);
- bool isGA2 = isGAPlusOffset(BaseLoc.Val, GV2, Offset2);
- if (isGA1 && isGA2 && GV1 == GV2)
- return Offset1 == (Offset2 + Dist*Size);
- }
-
- return false;
-}
-
-static bool isBaseAlignmentOfN(unsigned N, SDNode *Base, MachineFrameInfo *MFI,
- const X86Subtarget *Subtarget) {
- GlobalValue *GV;
- int64_t Offset = 0;
- if (isGAPlusOffset(Base, GV, Offset))
- return (GV->getAlignment() >= N && (Offset % N) == 0);
- // DAG combine handles the stack object case.
- return false;
-}
-
-static bool EltsFromConsecutiveLoads(SDNode *N, SDOperand PermMask,
- unsigned NumElems, MVT::ValueType EVT,
- MachineFrameInfo *MFI,
- SelectionDAG &DAG, SDNode *&Base) {
- Base = NULL;
- for (unsigned i = 0; i < NumElems; ++i) {
- SDOperand Idx = PermMask.getOperand(i);
- if (Idx.getOpcode() == ISD::UNDEF) {
- if (!Base)
- return false;
- continue;
- }
-
- unsigned Index = cast<ConstantSDNode>(Idx)->getValue();
- SDOperand Elt = getShuffleScalarElt(N, Index, DAG);
- if (!Elt.Val ||
- (Elt.getOpcode() != ISD::UNDEF && !ISD::isNON_EXTLoad(Elt.Val)))
- return false;
- if (!Base) {
- Base = Elt.Val;
- if (Base->getOpcode() == ISD::UNDEF)
- return false;
- continue;
- }
- if (Elt.getOpcode() == ISD::UNDEF)
- continue;
-
- if (!isConsecutiveLoad(Elt.Val, Base, i, MVT::getSizeInBits(EVT)/8,MFI))
- return false;
- }
- return true;
-}
-
-/// PerformShuffleCombine - Combine a vector_shuffle that is equal to
-/// build_vector load1, load2, load3, load4, <0, 1, 2, 3> into a 128-bit load
-/// if the load addresses are consecutive, non-overlapping, and in the right
-/// order.
-static SDOperand PerformShuffleCombine(SDNode *N, SelectionDAG &DAG,
- const X86Subtarget *Subtarget) {
- MachineFrameInfo *MFI = DAG.getMachineFunction().getFrameInfo();
- MVT::ValueType VT = N->getValueType(0);
- MVT::ValueType EVT = MVT::getVectorElementType(VT);
- SDOperand PermMask = N->getOperand(2);
- unsigned NumElems = PermMask.getNumOperands();
- SDNode *Base = NULL;
- if (!EltsFromConsecutiveLoads(N, PermMask, NumElems, EVT, MFI, DAG, Base))
- return SDOperand();
-
- LoadSDNode *LD = cast<LoadSDNode>(Base);
- if (isBaseAlignmentOfN(16, Base->getOperand(1).Val, MFI, Subtarget))
- return DAG.getLoad(VT, LD->getChain(), LD->getBasePtr(), LD->getSrcValue(),
- LD->getSrcValueOffset(), LD->isVolatile());
- return DAG.getLoad(VT, LD->getChain(), LD->getBasePtr(), LD->getSrcValue(),
- LD->getSrcValueOffset(), LD->isVolatile(),
- LD->getAlignment());
-}
-
-static SDNode *getBuildPairElt(SDNode *N, unsigned i) {
- SDOperand Elt = N->getOperand(i);
- if (Elt.getOpcode() != ISD::MERGE_VALUES)
- return Elt.Val;
- return Elt.getOperand(Elt.ResNo).Val;
-}
-
-static SDOperand PerformBuildVectorCombine(SDNode *N, SelectionDAG &DAG,
- const X86Subtarget *Subtarget) {
- // Ignore single operand BUILD_VECTOR.
- if (N->getNumOperands() == 1)
- return SDOperand();
-
- MVT::ValueType VT = N->getValueType(0);
- MVT::ValueType EVT = MVT::getVectorElementType(VT);
- if ((EVT != MVT::i64 && EVT != MVT::f64) || Subtarget->is64Bit())
- // We are looking for load i64 and zero extend. We want to transform
- // it before legalizer has a chance to expand it. Also look for i64
- // BUILD_PAIR bit casted to f64.
- return SDOperand();
- // This must be an insertion into a zero vector.
- SDOperand HighElt = N->getOperand(1);
- if (!isZeroNode(HighElt))
- return SDOperand();
-
- // Value must be a load.
- MachineFrameInfo *MFI = DAG.getMachineFunction().getFrameInfo();
- SDNode *Base = N->getOperand(0).Val;
- if (!isa<LoadSDNode>(Base)) {
- if (Base->getOpcode() == ISD::BIT_CONVERT)
- Base = Base->getOperand(0).Val;
- if (Base->getOpcode() != ISD::BUILD_PAIR)
- return SDOperand();
- SDNode *Pair = Base;
- Base = getBuildPairElt(Pair, 0);
- if (!ISD::isNON_EXTLoad(Base))
- return SDOperand();
- SDNode *NextLD = getBuildPairElt(Pair, 1);
- if (!ISD::isNON_EXTLoad(NextLD) ||
- !isConsecutiveLoad(NextLD, Base, 1, 4/*32 bits*/, MFI))
- return SDOperand();
- }
- LoadSDNode *LD = cast<LoadSDNode>(Base);
-
- // Transform it into VZEXT_LOAD addr.
- return DAG.getNode(X86ISD::VZEXT_LOAD, VT, LD->getChain(), LD->getBasePtr());
-}
-
-/// PerformSELECTCombine - Do target-specific dag combines on SELECT nodes.
-static SDOperand PerformSELECTCombine(SDNode *N, SelectionDAG &DAG,
- const X86Subtarget *Subtarget) {
- SDOperand Cond = N->getOperand(0);
-
- // If we have SSE[12] support, try to form min/max nodes.
- if (Subtarget->hasSSE2() &&
- (N->getValueType(0) == MVT::f32 || N->getValueType(0) == MVT::f64)) {
- if (Cond.getOpcode() == ISD::SETCC) {
- // Get the LHS/RHS of the select.
- SDOperand LHS = N->getOperand(1);
- SDOperand RHS = N->getOperand(2);
- ISD::CondCode CC = cast<CondCodeSDNode>(Cond.getOperand(2))->get();
-
- unsigned Opcode = 0;
- if (LHS == Cond.getOperand(0) && RHS == Cond.getOperand(1)) {
- switch (CC) {
- default: break;
- case ISD::SETOLE: // (X <= Y) ? X : Y -> min
- case ISD::SETULE:
- case ISD::SETLE:
- if (!UnsafeFPMath) break;
- // FALL THROUGH.
- case ISD::SETOLT: // (X olt/lt Y) ? X : Y -> min
- case ISD::SETLT:
- Opcode = X86ISD::FMIN;
- break;
-
- case ISD::SETOGT: // (X > Y) ? X : Y -> max
- case ISD::SETUGT:
- case ISD::SETGT:
- if (!UnsafeFPMath) break;
- // FALL THROUGH.
- case ISD::SETUGE: // (X uge/ge Y) ? X : Y -> max
- case ISD::SETGE:
- Opcode = X86ISD::FMAX;
- break;
- }
- } else if (LHS == Cond.getOperand(1) && RHS == Cond.getOperand(0)) {
- switch (CC) {
- default: break;
- case ISD::SETOGT: // (X > Y) ? Y : X -> min
- case ISD::SETUGT:
- case ISD::SETGT:
- if (!UnsafeFPMath) break;
- // FALL THROUGH.
- case ISD::SETUGE: // (X uge/ge Y) ? Y : X -> min
- case ISD::SETGE:
- Opcode = X86ISD::FMIN;
- break;
-
- case ISD::SETOLE: // (X <= Y) ? Y : X -> max
- case ISD::SETULE:
- case ISD::SETLE:
- if (!UnsafeFPMath) break;
- // FALL THROUGH.
- case ISD::SETOLT: // (X olt/lt Y) ? Y : X -> max
- case ISD::SETLT:
- Opcode = X86ISD::FMAX;
- break;
- }
- }
-
- if (Opcode)
- return DAG.getNode(Opcode, N->getValueType(0), LHS, RHS);
- }
-
- }
-
- return SDOperand();
-}
-
-/// PerformSTORECombine - Do target-specific dag combines on STORE nodes.
-static SDOperand PerformSTORECombine(SDNode *N, SelectionDAG &DAG,
- const X86Subtarget *Subtarget) {
- // Turn load->store of MMX types into GPR load/stores. This avoids clobbering
- // the FP state in cases where an emms may be missing.
- // A preferable solution to the general problem is to figure out the right
- // places to insert EMMS. This qualifies as a quick hack.
- StoreSDNode *St = cast<StoreSDNode>(N);
- if (MVT::isVector(St->getValue().getValueType()) &&
- MVT::getSizeInBits(St->getValue().getValueType()) == 64 &&
- isa<LoadSDNode>(St->getValue()) &&
- !cast<LoadSDNode>(St->getValue())->isVolatile() &&
- St->getChain().hasOneUse() && !St->isVolatile()) {
- SDNode* LdVal = St->getValue().Val;
- LoadSDNode *Ld = 0;
- int TokenFactorIndex = -1;
- SmallVector<SDOperand, 8> Ops;
- SDNode* ChainVal = St->getChain().Val;
- // Must be a store of a load. We currently handle two cases: the load
- // is a direct child, and it's under an intervening TokenFactor. It is
- // possible to dig deeper under nested TokenFactors.
- if (ChainVal == LdVal)
- Ld = cast<LoadSDNode>(St->getChain());
- else if (St->getValue().hasOneUse() &&
- ChainVal->getOpcode() == ISD::TokenFactor) {
- for (unsigned i=0, e = ChainVal->getNumOperands(); i != e; ++i) {
- if (ChainVal->getOperand(i).Val == LdVal) {
- TokenFactorIndex = i;
- Ld = cast<LoadSDNode>(St->getValue());
- } else
- Ops.push_back(ChainVal->getOperand(i));
- }
- }
- if (Ld) {
- // If we are a 64-bit capable x86, lower to a single movq load/store pair.
- if (Subtarget->is64Bit()) {
- SDOperand NewLd = DAG.getLoad(MVT::i64, Ld->getChain(),
- Ld->getBasePtr(), Ld->getSrcValue(),
- Ld->getSrcValueOffset(), Ld->isVolatile(),
- Ld->getAlignment());
- SDOperand NewChain = NewLd.getValue(1);
- if (TokenFactorIndex != -1) {
- Ops.push_back(NewChain);
- NewChain = DAG.getNode(ISD::TokenFactor, MVT::Other, &Ops[0],
- Ops.size());
- }
- return DAG.getStore(NewChain, NewLd, St->getBasePtr(),
- St->getSrcValue(), St->getSrcValueOffset(),
- St->isVolatile(), St->getAlignment());
- }
-
- // Otherwise, lower to two 32-bit copies.
- SDOperand LoAddr = Ld->getBasePtr();
- SDOperand HiAddr = DAG.getNode(ISD::ADD, MVT::i32, LoAddr,
- DAG.getConstant(MVT::i32, 4));
-
- SDOperand LoLd = DAG.getLoad(MVT::i32, Ld->getChain(), LoAddr,
- Ld->getSrcValue(), Ld->getSrcValueOffset(),
- Ld->isVolatile(), Ld->getAlignment());
- SDOperand HiLd = DAG.getLoad(MVT::i32, Ld->getChain(), HiAddr,
- Ld->getSrcValue(), Ld->getSrcValueOffset()+4,
- Ld->isVolatile(),
- MinAlign(Ld->getAlignment(), 4));
-
- SDOperand NewChain = LoLd.getValue(1);
- if (TokenFactorIndex != -1) {
- Ops.push_back(LoLd);
- Ops.push_back(HiLd);
- NewChain = DAG.getNode(ISD::TokenFactor, MVT::Other, &Ops[0],
- Ops.size());
- }
-
- LoAddr = St->getBasePtr();
- HiAddr = DAG.getNode(ISD::ADD, MVT::i32, LoAddr,
- DAG.getConstant(MVT::i32, 4));
-
- SDOperand LoSt = DAG.getStore(NewChain, LoLd, LoAddr,
- St->getSrcValue(), St->getSrcValueOffset(),
- St->isVolatile(), St->getAlignment());
- SDOperand HiSt = DAG.getStore(NewChain, HiLd, HiAddr,
- St->getSrcValue(), St->getSrcValueOffset()+4,
- St->isVolatile(),
- MinAlign(St->getAlignment(), 4));
- return DAG.getNode(ISD::TokenFactor, MVT::Other, LoSt, HiSt);
- }
- }
- return SDOperand();
-}
-
-/// PerformFORCombine - Do target-specific dag combines on X86ISD::FOR and
-/// X86ISD::FXOR nodes.
-static SDOperand PerformFORCombine(SDNode *N, SelectionDAG &DAG) {
- assert(N->getOpcode() == X86ISD::FOR || N->getOpcode() == X86ISD::FXOR);
- // F[X]OR(0.0, x) -> x
- // F[X]OR(x, 0.0) -> x
- if (ConstantFPSDNode *C = dyn_cast<ConstantFPSDNode>(N->getOperand(0)))
- if (C->getValueAPF().isPosZero())
- return N->getOperand(1);
- if (ConstantFPSDNode *C = dyn_cast<ConstantFPSDNode>(N->getOperand(1)))
- if (C->getValueAPF().isPosZero())
- return N->getOperand(0);
- return SDOperand();
-}
-
-/// PerformFANDCombine - Do target-specific dag combines on X86ISD::FAND nodes.
-static SDOperand PerformFANDCombine(SDNode *N, SelectionDAG &DAG) {
- // FAND(0.0, x) -> 0.0
- // FAND(x, 0.0) -> 0.0
- if (ConstantFPSDNode *C = dyn_cast<ConstantFPSDNode>(N->getOperand(0)))
- if (C->getValueAPF().isPosZero())
- return N->getOperand(0);
- if (ConstantFPSDNode *C = dyn_cast<ConstantFPSDNode>(N->getOperand(1)))
- if (C->getValueAPF().isPosZero())
- return N->getOperand(1);
- return SDOperand();
-}
-
-
-SDOperand X86TargetLowering::PerformDAGCombine(SDNode *N,
- DAGCombinerInfo &DCI) const {
- SelectionDAG &DAG = DCI.DAG;
- switch (N->getOpcode()) {
- default: break;
- case ISD::VECTOR_SHUFFLE: return PerformShuffleCombine(N, DAG, Subtarget);
- case ISD::BUILD_VECTOR: return PerformBuildVectorCombine(N, DAG, Subtarget);
- case ISD::SELECT: return PerformSELECTCombine(N, DAG, Subtarget);
- case ISD::STORE: return PerformSTORECombine(N, DAG, Subtarget);
- case X86ISD::FXOR:
- case X86ISD::FOR: return PerformFORCombine(N, DAG);
- case X86ISD::FAND: return PerformFANDCombine(N, DAG);
- }
-
- return SDOperand();
-}
-
-//===----------------------------------------------------------------------===//
-// X86 Inline Assembly Support
-//===----------------------------------------------------------------------===//
-
-/// getConstraintType - Given a constraint letter, return the type of
-/// constraint it is for this target.
-X86TargetLowering::ConstraintType
-X86TargetLowering::getConstraintType(const std::string &Constraint) const {
- if (Constraint.size() == 1) {
- switch (Constraint[0]) {
- case 'A':
- case 'f':
- case 'r':
- case 'R':
- case 'l':
- case 'q':
- case 'Q':
- case 'x':
- case 'y':
- case 'Y':
- return C_RegisterClass;
- default:
- break;
- }
- }
- return TargetLowering::getConstraintType(Constraint);
-}
-
-/// LowerXConstraint - try to replace an X constraint, which matches anything,
-/// with another that has more specific requirements based on the type of the
-/// corresponding operand.
-const char *X86TargetLowering::
-LowerXConstraint(MVT::ValueType ConstraintVT) const {
- // FP X constraints get lowered to SSE1/2 registers if available, otherwise
- // 'f' like normal targets.
- if (MVT::isFloatingPoint(ConstraintVT)) {
- if (Subtarget->hasSSE2())
- return "Y";
- if (Subtarget->hasSSE1())
- return "x";
- }
-
- return TargetLowering::LowerXConstraint(ConstraintVT);
-}
-
-/// LowerAsmOperandForConstraint - Lower the specified operand into the Ops
-/// vector. If it is invalid, don't add anything to Ops.
-void X86TargetLowering::LowerAsmOperandForConstraint(SDOperand Op,
- char Constraint,
- std::vector<SDOperand>&Ops,
- SelectionDAG &DAG) const {
- SDOperand Result(0, 0);
-
- switch (Constraint) {
- default: break;
- case 'I':
- if (ConstantSDNode *C = dyn_cast<ConstantSDNode>(Op)) {
- if (C->getValue() <= 31) {
- Result = DAG.getTargetConstant(C->getValue(), Op.getValueType());
- break;
- }
- }
- return;
- case 'N':
- if (ConstantSDNode *C = dyn_cast<ConstantSDNode>(Op)) {
- if (C->getValue() <= 255) {
- Result = DAG.getTargetConstant(C->getValue(), Op.getValueType());
- break;
- }
- }
- return;
- case 'i': {
- // Literal immediates are always ok.
- if (ConstantSDNode *CST = dyn_cast<ConstantSDNode>(Op)) {
- Result = DAG.getTargetConstant(CST->getValue(), Op.getValueType());
- break;
- }
-
- // If we are in non-pic codegen mode, we allow the address of a global (with
- // an optional displacement) to be used with 'i'.
- GlobalAddressSDNode *GA = dyn_cast<GlobalAddressSDNode>(Op);
- int64_t Offset = 0;
-
- // Match either (GA) or (GA+C)
- if (GA) {
- Offset = GA->getOffset();
- } else if (Op.getOpcode() == ISD::ADD) {
- ConstantSDNode *C = dyn_cast<ConstantSDNode>(Op.getOperand(1));
- GA = dyn_cast<GlobalAddressSDNode>(Op.getOperand(0));
- if (C && GA) {
- Offset = GA->getOffset()+C->getValue();
- } else {
- C = dyn_cast<ConstantSDNode>(Op.getOperand(1));
- GA = dyn_cast<GlobalAddressSDNode>(Op.getOperand(0));
- if (C && GA)
- Offset = GA->getOffset()+C->getValue();
- else
- C = 0, GA = 0;
- }
- }
-
- if (GA) {
- // If addressing this global requires a load (e.g. in PIC mode), we can't
- // match.
- if (Subtarget->GVRequiresExtraLoad(GA->getGlobal(), getTargetMachine(),
- false))
- return;
-
- Op = DAG.getTargetGlobalAddress(GA->getGlobal(), GA->getValueType(0),
- Offset);
- Result = Op;
- break;
- }
-
- // Otherwise, not valid for this mode.
- return;
- }
- }
-
- if (Result.Val) {
- Ops.push_back(Result);
- return;
- }
- return TargetLowering::LowerAsmOperandForConstraint(Op, Constraint, Ops, DAG);
-}
-
-std::vector<unsigned> X86TargetLowering::
-getRegClassForInlineAsmConstraint(const std::string &Constraint,
- MVT::ValueType VT) const {
- if (Constraint.size() == 1) {
- // FIXME: not handling fp-stack yet!
- switch (Constraint[0]) { // GCC X86 Constraint Letters
- default: break; // Unknown constraint letter
- case 'A': // EAX/EDX
- if (VT == MVT::i32 || VT == MVT::i64)
- return make_vector<unsigned>(X86::EAX, X86::EDX, 0);
- break;
- case 'q': // Q_REGS (GENERAL_REGS in 64-bit mode)
- case 'Q': // Q_REGS
- if (VT == MVT::i32)
- return make_vector<unsigned>(X86::EAX, X86::EDX, X86::ECX, X86::EBX, 0);
- else if (VT == MVT::i16)
- return make_vector<unsigned>(X86::AX, X86::DX, X86::CX, X86::BX, 0);
- else if (VT == MVT::i8)
- return make_vector<unsigned>(X86::AL, X86::DL, X86::CL, X86::BL, 0);
- else if (VT == MVT::i64)
- return make_vector<unsigned>(X86::RAX, X86::RDX, X86::RCX, X86::RBX, 0);
- break;
- }
- }
-
- return std::vector<unsigned>();
-}
-
-std::pair<unsigned, const TargetRegisterClass*>
-X86TargetLowering::getRegForInlineAsmConstraint(const std::string &Constraint,
- MVT::ValueType VT) const {
- // First, see if this is a constraint that directly corresponds to an LLVM
- // register class.
- if (Constraint.size() == 1) {
- // GCC Constraint Letters
- switch (Constraint[0]) {
- default: break;
- case 'r': // GENERAL_REGS
- case 'R': // LEGACY_REGS
- case 'l': // INDEX_REGS
- if (VT == MVT::i64 && Subtarget->is64Bit())
- return std::make_pair(0U, X86::GR64RegisterClass);
- if (VT == MVT::i32)
- return std::make_pair(0U, X86::GR32RegisterClass);
- else if (VT == MVT::i16)
- return std::make_pair(0U, X86::GR16RegisterClass);
- else if (VT == MVT::i8)
- return std::make_pair(0U, X86::GR8RegisterClass);
- break;
- case 'f': // FP Stack registers.
- // If SSE is enabled for this VT, use f80 to ensure the isel moves the
- // value to the correct fpstack register class.
- if (VT == MVT::f32 && !isScalarFPTypeInSSEReg(VT))
- return std::make_pair(0U, X86::RFP32RegisterClass);
- if (VT == MVT::f64 && !isScalarFPTypeInSSEReg(VT))
- return std::make_pair(0U, X86::RFP64RegisterClass);
- return std::make_pair(0U, X86::RFP80RegisterClass);
- case 'y': // MMX_REGS if MMX allowed.
- if (!Subtarget->hasMMX()) break;
- return std::make_pair(0U, X86::VR64RegisterClass);
- break;
- case 'Y': // SSE_REGS if SSE2 allowed
- if (!Subtarget->hasSSE2()) break;
- // FALL THROUGH.
- case 'x': // SSE_REGS if SSE1 allowed
- if (!Subtarget->hasSSE1()) break;
-
- switch (VT) {
- default: break;
- // Scalar SSE types.
- case MVT::f32:
- case MVT::i32:
- return std::make_pair(0U, X86::FR32RegisterClass);
- case MVT::f64:
- case MVT::i64:
- return std::make_pair(0U, X86::FR64RegisterClass);
- // Vector types.
- case MVT::v16i8:
- case MVT::v8i16:
- case MVT::v4i32:
- case MVT::v2i64:
- case MVT::v4f32:
- case MVT::v2f64:
- return std::make_pair(0U, X86::VR128RegisterClass);
- }
- break;
- }
- }
-
- // Use the default implementation in TargetLowering to convert the register
- // constraint into a member of a register class.
- std::pair<unsigned, const TargetRegisterClass*> Res;
- Res = TargetLowering::getRegForInlineAsmConstraint(Constraint, VT);
-
- // Not found as a standard register?
- if (Res.second == 0) {
- // GCC calls "st(0)" just plain "st".
- if (StringsEqualNoCase("{st}", Constraint)) {
- Res.first = X86::ST0;
- Res.second = X86::RFP80RegisterClass;
- }
-
- return Res;
- }
-
- // Otherwise, check to see if this is a register class of the wrong value
- // type. For example, we want to map "{ax},i32" -> {eax}, we don't want it to
- // turn into {ax},{dx}.
- if (Res.second->hasType(VT))
- return Res; // Correct type already, nothing to do.
-
- // All of the single-register GCC register classes map their values onto
- // 16-bit register pieces "ax","dx","cx","bx","si","di","bp","sp". If we
- // really want an 8-bit or 32-bit register, map to the appropriate register
- // class and return the appropriate register.
- if (Res.second != X86::GR16RegisterClass)
- return Res;
-
- if (VT == MVT::i8) {
- unsigned DestReg = 0;
- switch (Res.first) {
- default: break;
- case X86::AX: DestReg = X86::AL; break;
- case X86::DX: DestReg = X86::DL; break;
- case X86::CX: DestReg = X86::CL; break;
- case X86::BX: DestReg = X86::BL; break;
- }
- if (DestReg) {
- Res.first = DestReg;
- Res.second = Res.second = X86::GR8RegisterClass;
- }
- } else if (VT == MVT::i32) {
- unsigned DestReg = 0;
- switch (Res.first) {
- default: break;
- case X86::AX: DestReg = X86::EAX; break;
- case X86::DX: DestReg = X86::EDX; break;
- case X86::CX: DestReg = X86::ECX; break;
- case X86::BX: DestReg = X86::EBX; break;
- case X86::SI: DestReg = X86::ESI; break;
- case X86::DI: DestReg = X86::EDI; break;
- case X86::BP: DestReg = X86::EBP; break;
- case X86::SP: DestReg = X86::ESP; break;
- }
- if (DestReg) {
- Res.first = DestReg;
- Res.second = Res.second = X86::GR32RegisterClass;
- }
- } else if (VT == MVT::i64) {
- unsigned DestReg = 0;
- switch (Res.first) {
- default: break;
- case X86::AX: DestReg = X86::RAX; break;
- case X86::DX: DestReg = X86::RDX; break;
- case X86::CX: DestReg = X86::RCX; break;
- case X86::BX: DestReg = X86::RBX; break;
- case X86::SI: DestReg = X86::RSI; break;
- case X86::DI: DestReg = X86::RDI; break;
- case X86::BP: DestReg = X86::RBP; break;
- case X86::SP: DestReg = X86::RSP; break;
- }
- if (DestReg) {
- Res.first = DestReg;
- Res.second = Res.second = X86::GR64RegisterClass;
- }
- }
-
- return Res;
-}
diff --git a/release_23/lib/Target/X86/X86ISelLowering.h b/release_23/lib/Target/X86/X86ISelLowering.h
deleted file mode 100644
index 060a1f50d2f2..000000000000
--- a/release_23/lib/Target/X86/X86ISelLowering.h
+++ /dev/null
@@ -1,569 +0,0 @@
-//===-- X86ISelLowering.h - X86 DAG Lowering Interface ----------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines the interfaces that X86 uses to lower LLVM code into a
-// selection DAG.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef X86ISELLOWERING_H
-#define X86ISELLOWERING_H
-
-#include "X86Subtarget.h"
-#include "X86RegisterInfo.h"
-#include "X86MachineFunctionInfo.h"
-#include "llvm/Target/TargetLowering.h"
-#include "llvm/CodeGen/SelectionDAG.h"
-#include "llvm/CodeGen/CallingConvLower.h"
-
-namespace llvm {
- namespace X86ISD {
- // X86 Specific DAG Nodes
- enum NodeType {
- // Start the numbering where the builtin ops leave off.
- FIRST_NUMBER = ISD::BUILTIN_OP_END+X86::INSTRUCTION_LIST_END,
-
- /// BSF - Bit scan forward.
- /// BSR - Bit scan reverse.
- BSF,
- BSR,
-
- /// SHLD, SHRD - Double shift instructions. These correspond to
- /// X86::SHLDxx and X86::SHRDxx instructions.
- SHLD,
- SHRD,
-
- /// FAND - Bitwise logical AND of floating point values. This corresponds
- /// to X86::ANDPS or X86::ANDPD.
- FAND,
-
- /// FOR - Bitwise logical OR of floating point values. This corresponds
- /// to X86::ORPS or X86::ORPD.
- FOR,
-
- /// FXOR - Bitwise logical XOR of floating point values. This corresponds
- /// to X86::XORPS or X86::XORPD.
- FXOR,
-
- /// FSRL - Bitwise logical right shift of floating point values. These
- /// corresponds to X86::PSRLDQ.
- FSRL,
-
- /// FILD, FILD_FLAG - This instruction implements SINT_TO_FP with the
- /// integer source in memory and FP reg result. This corresponds to the
- /// X86::FILD*m instructions. It has three inputs (token chain, address,
- /// and source type) and two outputs (FP value and token chain). FILD_FLAG
- /// also produces a flag).
- FILD,
- FILD_FLAG,
-
- /// FP_TO_INT*_IN_MEM - This instruction implements FP_TO_SINT with the
- /// integer destination in memory and a FP reg source. This corresponds
- /// to the X86::FIST*m instructions and the rounding mode change stuff. It
- /// has two inputs (token chain and address) and two outputs (int value
- /// and token chain).
- FP_TO_INT16_IN_MEM,
- FP_TO_INT32_IN_MEM,
- FP_TO_INT64_IN_MEM,
-
- /// FLD - This instruction implements an extending load to FP stack slots.
- /// This corresponds to the X86::FLD32m / X86::FLD64m. It takes a chain
- /// operand, ptr to load from, and a ValueType node indicating the type
- /// to load to.
- FLD,
-
- /// FST - This instruction implements a truncating store to FP stack
- /// slots. This corresponds to the X86::FST32m / X86::FST64m. It takes a
- /// chain operand, value to store, address, and a ValueType to store it
- /// as.
- FST,
-
- /// CALL/TAILCALL - These operations represent an abstract X86 call
- /// instruction, which includes a bunch of information. In particular the
- /// operands of these node are:
- ///
- /// #0 - The incoming token chain
- /// #1 - The callee
- /// #2 - The number of arg bytes the caller pushes on the stack.
- /// #3 - The number of arg bytes the callee pops off the stack.
- /// #4 - The value to pass in AL/AX/EAX (optional)
- /// #5 - The value to pass in DL/DX/EDX (optional)
- ///
- /// The result values of these nodes are:
- ///
- /// #0 - The outgoing token chain
- /// #1 - The first register result value (optional)
- /// #2 - The second register result value (optional)
- ///
- /// The CALL vs TAILCALL distinction boils down to whether the callee is
- /// known not to modify the caller's stack frame, as is standard with
- /// LLVM.
- CALL,
- TAILCALL,
-
- /// RDTSC_DAG - This operation implements the lowering for
- /// readcyclecounter
- RDTSC_DAG,
-
- /// X86 compare and logical compare instructions.
- CMP, COMI, UCOMI,
-
- /// X86 SetCC. Operand 1 is condition code, and operand 2 is the flag
- /// operand produced by a CMP instruction.
- SETCC,
-
- /// X86 conditional moves. Operand 1 and operand 2 are the two values
- /// to select from (operand 1 is a R/W operand). Operand 3 is the
- /// condition code, and operand 4 is the flag operand produced by a CMP
- /// or TEST instruction. It also writes a flag result.
- CMOV,
-
- /// X86 conditional branches. Operand 1 is the chain operand, operand 2
- /// is the block to branch if condition is true, operand 3 is the
- /// condition code, and operand 4 is the flag operand produced by a CMP
- /// or TEST instruction.
- BRCOND,
-
- /// Return with a flag operand. Operand 1 is the chain operand, operand
- /// 2 is the number of bytes of stack to pop.
- RET_FLAG,
-
- /// REP_STOS - Repeat fill, corresponds to X86::REP_STOSx.
- REP_STOS,
-
- /// REP_MOVS - Repeat move, corresponds to X86::REP_MOVSx.
- REP_MOVS,
-
- /// GlobalBaseReg - On Darwin, this node represents the result of the popl
- /// at function entry, used for PIC code.
- GlobalBaseReg,
-
- /// Wrapper - A wrapper node for TargetConstantPool,
- /// TargetExternalSymbol, and TargetGlobalAddress.
- Wrapper,
-
- /// WrapperRIP - Special wrapper used under X86-64 PIC mode for RIP
- /// relative displacements.
- WrapperRIP,
-
- /// PEXTRB - Extract an 8-bit value from a vector and zero extend it to
- /// i32, corresponds to X86::PEXTRB.
- PEXTRB,
-
- /// PEXTRW - Extract a 16-bit value from a vector and zero extend it to
- /// i32, corresponds to X86::PEXTRW.
- PEXTRW,
-
- /// INSERTPS - Insert any element of a 4 x float vector into any element
- /// of a destination 4 x floatvector.
- INSERTPS,
-
- /// PINSRB - Insert the lower 8-bits of a 32-bit value to a vector,
- /// corresponds to X86::PINSRB.
- PINSRB,
-
- /// PINSRW - Insert the lower 16-bits of a 32-bit value to a vector,
- /// corresponds to X86::PINSRW.
- PINSRW,
-
- /// FMAX, FMIN - Floating point max and min.
- ///
- FMAX, FMIN,
-
- /// FRSQRT, FRCP - Floating point reciprocal-sqrt and reciprocal
- /// approximation. Note that these typically require refinement
- /// in order to obtain suitable precision.
- FRSQRT, FRCP,
-
- // TLSADDR, THREAThread - Thread Local Storage.
- TLSADDR, THREAD_POINTER,
-
- // EH_RETURN - Exception Handling helpers.
- EH_RETURN,
-
- /// TC_RETURN - Tail call return.
- /// operand #0 chain
- /// operand #1 callee (register or absolute)
- /// operand #2 stack adjustment
- /// operand #3 optional in flag
- TC_RETURN,
-
- // LCMPXCHG_DAG, LCMPXCHG8_DAG - Compare and swap.
- LCMPXCHG_DAG,
- LCMPXCHG8_DAG,
-
- // FNSTCW16m - Store FP control world into i16 memory.
- FNSTCW16m,
-
- // VZEXT_MOVL - Vector move low and zero extend.
- VZEXT_MOVL,
-
- // VZEXT_LOAD - Load, scalar_to_vector, and zero extend.
- VZEXT_LOAD
- };
- }
-
- /// Define some predicates that are used for node matching.
- namespace X86 {
- /// isPSHUFDMask - Return true if the specified VECTOR_SHUFFLE operand
- /// specifies a shuffle of elements that is suitable for input to PSHUFD.
- bool isPSHUFDMask(SDNode *N);
-
- /// isPSHUFHWMask - Return true if the specified VECTOR_SHUFFLE operand
- /// specifies a shuffle of elements that is suitable for input to PSHUFD.
- bool isPSHUFHWMask(SDNode *N);
-
- /// isPSHUFLWMask - Return true if the specified VECTOR_SHUFFLE operand
- /// specifies a shuffle of elements that is suitable for input to PSHUFD.
- bool isPSHUFLWMask(SDNode *N);
-
- /// isSHUFPMask - Return true if the specified VECTOR_SHUFFLE operand
- /// specifies a shuffle of elements that is suitable for input to SHUFP*.
- bool isSHUFPMask(SDNode *N);
-
- /// isMOVHLPSMask - Return true if the specified VECTOR_SHUFFLE operand
- /// specifies a shuffle of elements that is suitable for input to MOVHLPS.
- bool isMOVHLPSMask(SDNode *N);
-
- /// isMOVHLPS_v_undef_Mask - Special case of isMOVHLPSMask for canonical form
- /// of vector_shuffle v, v, <2, 3, 2, 3>, i.e. vector_shuffle v, undef,
- /// <2, 3, 2, 3>
- bool isMOVHLPS_v_undef_Mask(SDNode *N);
-
- /// isMOVLPMask - Return true if the specified VECTOR_SHUFFLE operand
- /// specifies a shuffle of elements that is suitable for input to MOVLP{S|D}.
- bool isMOVLPMask(SDNode *N);
-
- /// isMOVHPMask - Return true if the specified VECTOR_SHUFFLE operand
- /// specifies a shuffle of elements that is suitable for input to MOVHP{S|D}
- /// as well as MOVLHPS.
- bool isMOVHPMask(SDNode *N);
-
- /// isUNPCKLMask - Return true if the specified VECTOR_SHUFFLE operand
- /// specifies a shuffle of elements that is suitable for input to UNPCKL.
- bool isUNPCKLMask(SDNode *N, bool V2IsSplat = false);
-
- /// isUNPCKHMask - Return true if the specified VECTOR_SHUFFLE operand
- /// specifies a shuffle of elements that is suitable for input to UNPCKH.
- bool isUNPCKHMask(SDNode *N, bool V2IsSplat = false);
-
- /// isUNPCKL_v_undef_Mask - Special case of isUNPCKLMask for canonical form
- /// of vector_shuffle v, v, <0, 4, 1, 5>, i.e. vector_shuffle v, undef,
- /// <0, 0, 1, 1>
- bool isUNPCKL_v_undef_Mask(SDNode *N);
-
- /// isUNPCKH_v_undef_Mask - Special case of isUNPCKHMask for canonical form
- /// of vector_shuffle v, v, <2, 6, 3, 7>, i.e. vector_shuffle v, undef,
- /// <2, 2, 3, 3>
- bool isUNPCKH_v_undef_Mask(SDNode *N);
-
- /// isMOVLMask - Return true if the specified VECTOR_SHUFFLE operand
- /// specifies a shuffle of elements that is suitable for input to MOVSS,
- /// MOVSD, and MOVD, i.e. setting the lowest element.
- bool isMOVLMask(SDNode *N);
-
- /// isMOVSHDUPMask - Return true if the specified VECTOR_SHUFFLE operand
- /// specifies a shuffle of elements that is suitable for input to MOVSHDUP.
- bool isMOVSHDUPMask(SDNode *N);
-
- /// isMOVSLDUPMask - Return true if the specified VECTOR_SHUFFLE operand
- /// specifies a shuffle of elements that is suitable for input to MOVSLDUP.
- bool isMOVSLDUPMask(SDNode *N);
-
- /// isSplatMask - Return true if the specified VECTOR_SHUFFLE operand
- /// specifies a splat of a single element.
- bool isSplatMask(SDNode *N);
-
- /// isSplatLoMask - Return true if the specified VECTOR_SHUFFLE operand
- /// specifies a splat of zero element.
- bool isSplatLoMask(SDNode *N);
-
- /// getShuffleSHUFImmediate - Return the appropriate immediate to shuffle
- /// the specified isShuffleMask VECTOR_SHUFFLE mask with PSHUF* and SHUFP*
- /// instructions.
- unsigned getShuffleSHUFImmediate(SDNode *N);
-
- /// getShufflePSHUFHWImmediate - Return the appropriate immediate to shuffle
- /// the specified isShuffleMask VECTOR_SHUFFLE mask with PSHUFHW
- /// instructions.
- unsigned getShufflePSHUFHWImmediate(SDNode *N);
-
- /// getShufflePSHUFKWImmediate - Return the appropriate immediate to shuffle
- /// the specified isShuffleMask VECTOR_SHUFFLE mask with PSHUFLW
- /// instructions.
- unsigned getShufflePSHUFLWImmediate(SDNode *N);
- }
-
- //===--------------------------------------------------------------------===//
- // X86TargetLowering - X86 Implementation of the TargetLowering interface
- class X86TargetLowering : public TargetLowering {
- int VarArgsFrameIndex; // FrameIndex for start of varargs area.
- int RegSaveFrameIndex; // X86-64 vararg func register save area.
- unsigned VarArgsGPOffset; // X86-64 vararg func int reg offset.
- unsigned VarArgsFPOffset; // X86-64 vararg func fp reg offset.
- int BytesToPopOnReturn; // Number of arg bytes ret should pop.
- int BytesCallerReserves; // Number of arg bytes caller makes.
-
- public:
- explicit X86TargetLowering(TargetMachine &TM);
-
- /// getPICJumpTableRelocaBase - Returns relocation base for the given PIC
- /// jumptable.
- SDOperand getPICJumpTableRelocBase(SDOperand Table,
- SelectionDAG &DAG) const;
-
- // Return the number of bytes that a function should pop when it returns (in
- // addition to the space used by the return address).
- //
- unsigned getBytesToPopOnReturn() const { return BytesToPopOnReturn; }
-
- // Return the number of bytes that the caller reserves for arguments passed
- // to this function.
- unsigned getBytesCallerReserves() const { return BytesCallerReserves; }
-
- /// getStackPtrReg - Return the stack pointer register we are using: either
- /// ESP or RSP.
- unsigned getStackPtrReg() const { return X86StackPtr; }
-
- /// getByValTypeAlignment - Return the desired alignment for ByVal aggregate
- /// function arguments in the caller parameter area. For X86, aggregates
- /// that contains are placed at 16-byte boundaries while the rest are at
- /// 4-byte boundaries.
- virtual unsigned getByValTypeAlignment(const Type *Ty) const;
-
- /// LowerOperation - Provide custom lowering hooks for some operations.
- ///
- virtual SDOperand LowerOperation(SDOperand Op, SelectionDAG &DAG);
-
- /// ExpandOperation - Custom lower the specified operation, splitting the
- /// value into two pieces.
- ///
- virtual SDNode *ExpandOperationResult(SDNode *N, SelectionDAG &DAG);
-
-
- virtual SDOperand PerformDAGCombine(SDNode *N, DAGCombinerInfo &DCI) const;
-
- virtual MachineBasicBlock *EmitInstrWithCustomInserter(MachineInstr *MI,
- MachineBasicBlock *MBB);
-
-
- /// getTargetNodeName - This method returns the name of a target specific
- /// DAG node.
- virtual const char *getTargetNodeName(unsigned Opcode) const;
-
- /// getSetCCResultType - Return the ISD::SETCC ValueType
- virtual MVT::ValueType getSetCCResultType(const SDOperand &) const;
-
- /// computeMaskedBitsForTargetNode - Determine which of the bits specified
- /// in Mask are known to be either zero or one and return them in the
- /// KnownZero/KnownOne bitsets.
- virtual void computeMaskedBitsForTargetNode(const SDOperand Op,
- const APInt &Mask,
- APInt &KnownZero,
- APInt &KnownOne,
- const SelectionDAG &DAG,
- unsigned Depth = 0) const;
-
- SDOperand getReturnAddressFrameIndex(SelectionDAG &DAG);
-
- ConstraintType getConstraintType(const std::string &Constraint) const;
-
- std::vector<unsigned>
- getRegClassForInlineAsmConstraint(const std::string &Constraint,
- MVT::ValueType VT) const;
-
- virtual const char *LowerXConstraint(MVT::ValueType ConstraintVT) const;
-
- /// LowerAsmOperandForConstraint - Lower the specified operand into the Ops
- /// vector. If it is invalid, don't add anything to Ops.
- virtual void LowerAsmOperandForConstraint(SDOperand Op,
- char ConstraintLetter,
- std::vector<SDOperand> &Ops,
- SelectionDAG &DAG) const;
-
- /// getRegForInlineAsmConstraint - Given a physical register constraint
- /// (e.g. {edx}), return the register number and the register class for the
- /// register. This should only be used for C_Register constraints. On
- /// error, this returns a register number of 0.
- std::pair<unsigned, const TargetRegisterClass*>
- getRegForInlineAsmConstraint(const std::string &Constraint,
- MVT::ValueType VT) const;
-
- /// isLegalAddressingMode - Return true if the addressing mode represented
- /// by AM is legal for this target, for a load/store of the specified type.
- virtual bool isLegalAddressingMode(const AddrMode &AM, const Type *Ty)const;
-
- /// isTruncateFree - Return true if it's free to truncate a value of
- /// type Ty1 to type Ty2. e.g. On x86 it's free to truncate a i32 value in
- /// register EAX to i16 by referencing its sub-register AX.
- virtual bool isTruncateFree(const Type *Ty1, const Type *Ty2) const;
- virtual bool isTruncateFree(MVT::ValueType VT1, MVT::ValueType VT2) const;
-
- /// isShuffleMaskLegal - Targets can use this to indicate that they only
- /// support *some* VECTOR_SHUFFLE operations, those with specific masks.
- /// By default, if a target supports the VECTOR_SHUFFLE node, all mask
- /// values are assumed to be legal.
- virtual bool isShuffleMaskLegal(SDOperand Mask, MVT::ValueType VT) const;
-
- /// isVectorClearMaskLegal - Similar to isShuffleMaskLegal. This is
- /// used by Targets can use this to indicate if there is a suitable
- /// VECTOR_SHUFFLE that can be used to replace a VAND with a constant
- /// pool entry.
- virtual bool isVectorClearMaskLegal(const std::vector<SDOperand> &BVOps,
- MVT::ValueType EVT,
- SelectionDAG &DAG) const;
-
- /// ShouldShrinkFPConstant - If true, then instruction selection should
- /// seek to shrink the FP constant of the specified type to a smaller type
- /// in order to save space and / or reduce runtime.
- virtual bool ShouldShrinkFPConstant(MVT::ValueType VT) const {
- // Don't shrink FP constpool if SSE2 is available since cvtss2sd is more
- // expensive than a straight movsd. On the other hand, it's important to
- // shrink long double fp constant since fldt is very slow.
- return !X86ScalarSSEf64 || VT == MVT::f80;
- }
-
- /// IsEligibleForTailCallOptimization - Check whether the call is eligible
- /// for tail call optimization. Target which want to do tail call
- /// optimization should implement this function.
- virtual bool IsEligibleForTailCallOptimization(SDOperand Call,
- SDOperand Ret,
- SelectionDAG &DAG) const;
-
- virtual const X86Subtarget* getSubtarget() {
- return Subtarget;
- }
-
- /// isScalarFPTypeInSSEReg - Return true if the specified scalar FP type is
- /// computed in an SSE register, not on the X87 floating point stack.
- bool isScalarFPTypeInSSEReg(MVT::ValueType VT) const {
- return (VT == MVT::f64 && X86ScalarSSEf64) || // f64 is when SSE2
- (VT == MVT::f32 && X86ScalarSSEf32); // f32 is when SSE1
- }
-
- private:
- /// Subtarget - Keep a pointer to the X86Subtarget around so that we can
- /// make the right decision when generating code for different targets.
- const X86Subtarget *Subtarget;
- const TargetRegisterInfo *RegInfo;
-
- /// X86StackPtr - X86 physical register used as stack ptr.
- unsigned X86StackPtr;
-
- /// X86ScalarSSEf32, X86ScalarSSEf64 - Select between SSE or x87
- /// floating point ops.
- /// When SSE is available, use it for f32 operations.
- /// When SSE2 is available, use it for f64 operations.
- bool X86ScalarSSEf32;
- bool X86ScalarSSEf64;
-
- SDNode *LowerCallResult(SDOperand Chain, SDOperand InFlag, SDNode*TheCall,
- unsigned CallingConv, SelectionDAG &DAG);
-
- SDOperand LowerMemArgument(SDOperand Op, SelectionDAG &DAG,
- const CCValAssign &VA, MachineFrameInfo *MFI,
- unsigned CC, SDOperand Root, unsigned i);
-
- SDOperand LowerMemOpCallTo(SDOperand Op, SelectionDAG &DAG,
- const SDOperand &StackPtr,
- const CCValAssign &VA, SDOperand Chain,
- SDOperand Arg);
-
- // Call lowering helpers.
- bool IsCalleePop(SDOperand Op);
- bool CallRequiresGOTPtrInReg(bool Is64Bit, bool IsTailCall);
- bool CallRequiresFnAddressInReg(bool Is64Bit, bool IsTailCall);
- SDOperand EmitTailCallLoadRetAddr(SelectionDAG &DAG, SDOperand &OutRetAddr,
- SDOperand Chain, bool IsTailCall, bool Is64Bit,
- int FPDiff);
-
- CCAssignFn *CCAssignFnForNode(SDOperand Op) const;
- NameDecorationStyle NameDecorationForFORMAL_ARGUMENTS(SDOperand Op);
- unsigned GetAlignedArgumentStackSize(unsigned StackSize, SelectionDAG &DAG);
-
- std::pair<SDOperand,SDOperand> FP_TO_SINTHelper(SDOperand Op,
- SelectionDAG &DAG);
-
- SDOperand LowerBUILD_VECTOR(SDOperand Op, SelectionDAG &DAG);
- SDOperand LowerVECTOR_SHUFFLE(SDOperand Op, SelectionDAG &DAG);
- SDOperand LowerEXTRACT_VECTOR_ELT(SDOperand Op, SelectionDAG &DAG);
- SDOperand LowerEXTRACT_VECTOR_ELT_SSE4(SDOperand Op, SelectionDAG &DAG);
- SDOperand LowerINSERT_VECTOR_ELT(SDOperand Op, SelectionDAG &DAG);
- SDOperand LowerINSERT_VECTOR_ELT_SSE4(SDOperand Op, SelectionDAG &DAG);
- SDOperand LowerSCALAR_TO_VECTOR(SDOperand Op, SelectionDAG &DAG);
- SDOperand LowerConstantPool(SDOperand Op, SelectionDAG &DAG);
- SDOperand LowerGlobalAddress(SDOperand Op, SelectionDAG &DAG);
- SDOperand LowerGlobalTLSAddress(SDOperand Op, SelectionDAG &DAG);
- SDOperand LowerExternalSymbol(SDOperand Op, SelectionDAG &DAG);
- SDOperand LowerShift(SDOperand Op, SelectionDAG &DAG);
- SDOperand LowerSINT_TO_FP(SDOperand Op, SelectionDAG &DAG);
- SDOperand LowerFP_TO_SINT(SDOperand Op, SelectionDAG &DAG);
- SDOperand LowerFABS(SDOperand Op, SelectionDAG &DAG);
- SDOperand LowerFNEG(SDOperand Op, SelectionDAG &DAG);
- SDOperand LowerFCOPYSIGN(SDOperand Op, SelectionDAG &DAG);
- SDOperand LowerSETCC(SDOperand Op, SelectionDAG &DAG);
- SDOperand LowerSELECT(SDOperand Op, SelectionDAG &DAG);
- SDOperand LowerBRCOND(SDOperand Op, SelectionDAG &DAG);
- SDOperand LowerMEMSET(SDOperand Op, SelectionDAG &DAG);
- SDOperand LowerJumpTable(SDOperand Op, SelectionDAG &DAG);
- SDOperand LowerCALL(SDOperand Op, SelectionDAG &DAG);
- SDOperand LowerRET(SDOperand Op, SelectionDAG &DAG);
- SDOperand LowerDYNAMIC_STACKALLOC(SDOperand Op, SelectionDAG &DAG);
- SDOperand LowerFORMAL_ARGUMENTS(SDOperand Op, SelectionDAG &DAG);
- SDOperand LowerVASTART(SDOperand Op, SelectionDAG &DAG);
- SDOperand LowerVAARG(SDOperand Op, SelectionDAG &DAG);
- SDOperand LowerVACOPY(SDOperand Op, SelectionDAG &DAG);
- SDOperand LowerINTRINSIC_WO_CHAIN(SDOperand Op, SelectionDAG &DAG);
- SDOperand LowerRETURNADDR(SDOperand Op, SelectionDAG &DAG);
- SDOperand LowerFRAMEADDR(SDOperand Op, SelectionDAG &DAG);
- SDOperand LowerFRAME_TO_ARGS_OFFSET(SDOperand Op, SelectionDAG &DAG);
- SDOperand LowerEH_RETURN(SDOperand Op, SelectionDAG &DAG);
- SDOperand LowerTRAMPOLINE(SDOperand Op, SelectionDAG &DAG);
- SDOperand LowerFLT_ROUNDS_(SDOperand Op, SelectionDAG &DAG);
- SDOperand LowerCTLZ(SDOperand Op, SelectionDAG &DAG);
- SDOperand LowerCTTZ(SDOperand Op, SelectionDAG &DAG);
- SDOperand LowerLCS(SDOperand Op, SelectionDAG &DAG);
- SDNode *ExpandFP_TO_SINT(SDNode *N, SelectionDAG &DAG);
- SDNode *ExpandREADCYCLECOUNTER(SDNode *N, SelectionDAG &DAG);
- SDNode *ExpandATOMIC_LCS(SDNode *N, SelectionDAG &DAG);
- SDNode *ExpandATOMIC_LSS(SDNode *N, SelectionDAG &DAG);
-
- SDOperand EmitTargetCodeForMemset(SelectionDAG &DAG,
- SDOperand Chain,
- SDOperand Dst, SDOperand Src,
- SDOperand Size, unsigned Align,
- const Value *DstSV, uint64_t DstSVOff);
- SDOperand EmitTargetCodeForMemcpy(SelectionDAG &DAG,
- SDOperand Chain,
- SDOperand Dst, SDOperand Src,
- SDOperand Size, unsigned Align,
- bool AlwaysInline,
- const Value *DstSV, uint64_t DstSVOff,
- const Value *SrcSV, uint64_t SrcSVOff);
-
- /// Utility function to emit atomic bitwise operations (and, or, xor).
- // It takes the bitwise instruction to expand, the associated machine basic
- // block, and the associated X86 opcodes for reg/reg and reg/imm.
- MachineBasicBlock *EmitAtomicBitwiseWithCustomInserter(
- MachineInstr *BInstr,
- MachineBasicBlock *BB,
- unsigned regOpc,
- unsigned immOpc);
-
- /// Utility function to emit atomic min and max. It takes the min/max
- // instruction to expand, the associated basic block, and the associated
- // cmov opcode for moving the min or max value.
- MachineBasicBlock *EmitAtomicMinMaxWithCustomInserter(MachineInstr *BInstr,
- MachineBasicBlock *BB,
- unsigned cmovOpc);
-
- };
-}
-
-#endif // X86ISELLOWERING_H
diff --git a/release_23/lib/Target/X86/X86Instr64bit.td b/release_23/lib/Target/X86/X86Instr64bit.td
deleted file mode 100644
index 55f8ca399038..000000000000
--- a/release_23/lib/Target/X86/X86Instr64bit.td
+++ /dev/null
@@ -1,1354 +0,0 @@
-//====- X86Instr64bit.td - Describe X86-64 Instructions ----*- tablegen -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file describes the X86-64 instruction set, defining the instructions,
-// and properties of the instructions which are needed for code generation,
-// machine code emission, and analysis.
-//
-//===----------------------------------------------------------------------===//
-
-//===----------------------------------------------------------------------===//
-// Operand Definitions.
-//
-
-// 64-bits but only 32 bits are significant.
-def i64i32imm : Operand<i64>;
-// 64-bits but only 8 bits are significant.
-def i64i8imm : Operand<i64>;
-
-def lea64mem : Operand<i64> {
- let PrintMethod = "printi64mem";
- let MIOperandInfo = (ops GR64, i8imm, GR64, i32imm);
-}
-
-def lea64_32mem : Operand<i32> {
- let PrintMethod = "printlea64_32mem";
- let MIOperandInfo = (ops GR32, i8imm, GR32, i32imm);
-}
-
-//===----------------------------------------------------------------------===//
-// Complex Pattern Definitions.
-//
-def lea64addr : ComplexPattern<i64, 4, "SelectLEAAddr",
- [add, mul, shl, or, frameindex, X86Wrapper],
- []>;
-
-//===----------------------------------------------------------------------===//
-// Pattern fragments.
-//
-
-def i64immSExt32 : PatLeaf<(i64 imm), [{
- // i64immSExt32 predicate - True if the 64-bit immediate fits in a 32-bit
- // sign extended field.
- return (int64_t)N->getValue() == (int32_t)N->getValue();
-}]>;
-
-def i64immZExt32 : PatLeaf<(i64 imm), [{
- // i64immZExt32 predicate - True if the 64-bit immediate fits in a 32-bit
- // unsignedsign extended field.
- return (uint64_t)N->getValue() == (uint32_t)N->getValue();
-}]>;
-
-def i64immSExt8 : PatLeaf<(i64 imm), [{
- // i64immSExt8 predicate - True if the 64-bit immediate fits in a 8-bit
- // sign extended field.
- return (int64_t)N->getValue() == (int8_t)N->getValue();
-}]>;
-
-def i64immFFFFFFFF : PatLeaf<(i64 imm), [{
- // i64immFFFFFFFF - True if this is a specific constant we can't write in
- // tblgen files.
- return N->getValue() == 0x00000000FFFFFFFFULL;
-}]>;
-
-
-def sextloadi64i8 : PatFrag<(ops node:$ptr), (i64 (sextloadi8 node:$ptr))>;
-def sextloadi64i16 : PatFrag<(ops node:$ptr), (i64 (sextloadi16 node:$ptr))>;
-def sextloadi64i32 : PatFrag<(ops node:$ptr), (i64 (sextloadi32 node:$ptr))>;
-
-def zextloadi64i1 : PatFrag<(ops node:$ptr), (i64 (zextloadi1 node:$ptr))>;
-def zextloadi64i8 : PatFrag<(ops node:$ptr), (i64 (zextloadi8 node:$ptr))>;
-def zextloadi64i16 : PatFrag<(ops node:$ptr), (i64 (zextloadi16 node:$ptr))>;
-def zextloadi64i32 : PatFrag<(ops node:$ptr), (i64 (zextloadi32 node:$ptr))>;
-
-def extloadi64i1 : PatFrag<(ops node:$ptr), (i64 (extloadi1 node:$ptr))>;
-def extloadi64i8 : PatFrag<(ops node:$ptr), (i64 (extloadi8 node:$ptr))>;
-def extloadi64i16 : PatFrag<(ops node:$ptr), (i64 (extloadi16 node:$ptr))>;
-def extloadi64i32 : PatFrag<(ops node:$ptr), (i64 (extloadi32 node:$ptr))>;
-
-//===----------------------------------------------------------------------===//
-// Instruction list...
-//
-
-//===----------------------------------------------------------------------===//
-// Call Instructions...
-//
-let isCall = 1 in
- // All calls clobber the non-callee saved registers...
- let Defs = [RAX, RCX, RDX, RSI, RDI, R8, R9, R10, R11,
- FP0, FP1, FP2, FP3, FP4, FP5, FP6, ST0, ST1,
- MM0, MM1, MM2, MM3, MM4, MM5, MM6, MM7,
- XMM0, XMM1, XMM2, XMM3, XMM4, XMM5, XMM6, XMM7,
- XMM8, XMM9, XMM10, XMM11, XMM12, XMM13, XMM14, XMM15, EFLAGS] in {
- def CALL64pcrel32 : I<0xE8, RawFrm, (outs), (ins i64imm:$dst, variable_ops),
- "call\t${dst:call}", []>;
- def CALL64r : I<0xFF, MRM2r, (outs), (ins GR64:$dst, variable_ops),
- "call\t{*}$dst", [(X86call GR64:$dst)]>;
- def CALL64m : I<0xFF, MRM2m, (outs), (ins i64mem:$dst, variable_ops),
- "call\t{*}$dst", []>;
- }
-
-
-
-let isCall = 1, isTerminator = 1, isReturn = 1, isBarrier = 1 in
-def TCRETURNdi64 : I<0, Pseudo, (outs), (ins i64imm:$dst, i32imm:$offset, variable_ops),
- "#TC_RETURN $dst $offset",
- []>;
-
-let isCall = 1, isTerminator = 1, isReturn = 1, isBarrier = 1 in
-def TCRETURNri64 : I<0, Pseudo, (outs), (ins GR64:$dst, i32imm:$offset, variable_ops),
- "#TC_RETURN $dst $offset",
- []>;
-
-
-let isCall = 1, isTerminator = 1, isReturn = 1, isBarrier = 1 in
- def TAILJMPr64 : I<0xFF, MRM4r, (outs), (ins GR64:$dst), "jmp{q}\t{*}$dst # TAILCALL",
- []>;
-
-// Branches
-let isBranch = 1, isTerminator = 1, isBarrier = 1, isIndirectBranch = 1 in {
- def JMP64r : I<0xFF, MRM4r, (outs), (ins GR64:$dst), "jmp{q}\t{*}$dst",
- [(brind GR64:$dst)]>;
- def JMP64m : I<0xFF, MRM4m, (outs), (ins i64mem:$dst), "jmp{q}\t{*}$dst",
- [(brind (loadi64 addr:$dst))]>;
-}
-
-//===----------------------------------------------------------------------===//
-// Miscellaneous Instructions...
-//
-let Defs = [RBP,RSP], Uses = [RBP,RSP], mayLoad = 1, neverHasSideEffects = 1 in
-def LEAVE64 : I<0xC9, RawFrm,
- (outs), (ins), "leave", []>;
-let Defs = [RSP], Uses = [RSP], neverHasSideEffects=1 in {
-let mayLoad = 1 in
-def POP64r : I<0x58, AddRegFrm,
- (outs GR64:$reg), (ins), "pop{q}\t$reg", []>;
-let mayStore = 1 in
-def PUSH64r : I<0x50, AddRegFrm,
- (outs), (ins GR64:$reg), "push{q}\t$reg", []>;
-}
-
-let Defs = [RSP, EFLAGS], Uses = [RSP], mayLoad = 1 in
-def POPFQ : I<0x9D, RawFrm, (outs), (ins), "popf", []>, REX_W;
-let Defs = [RSP], Uses = [RSP, EFLAGS], mayStore = 1 in
-def PUSHFQ : I<0x9C, RawFrm, (outs), (ins), "pushf", []>;
-
-def LEA64_32r : I<0x8D, MRMSrcMem,
- (outs GR32:$dst), (ins lea64_32mem:$src),
- "lea{l}\t{$src|$dst}, {$dst|$src}",
- [(set GR32:$dst, lea32addr:$src)]>, Requires<[In64BitMode]>;
-
-let isReMaterializable = 1 in
-def LEA64r : RI<0x8D, MRMSrcMem, (outs GR64:$dst), (ins lea64mem:$src),
- "lea{q}\t{$src|$dst}, {$dst|$src}",
- [(set GR64:$dst, lea64addr:$src)]>;
-
-let isTwoAddress = 1 in
-def BSWAP64r : RI<0xC8, AddRegFrm, (outs GR64:$dst), (ins GR64:$src),
- "bswap{q}\t$dst",
- [(set GR64:$dst, (bswap GR64:$src))]>, TB;
-
-// Bit scan instructions.
-let Defs = [EFLAGS] in {
-def BSF64rr : RI<0xBC, MRMSrcReg, (outs GR64:$dst), (ins GR64:$src),
- "bsf{q}\t{$src, $dst|$dst, $src}",
- [(set GR64:$dst, (X86bsf GR64:$src)), (implicit EFLAGS)]>, TB;
-def BSF64rm : RI<0xBC, MRMSrcMem, (outs GR64:$dst), (ins i64mem:$src),
- "bsf{q}\t{$src, $dst|$dst, $src}",
- [(set GR64:$dst, (X86bsf (loadi64 addr:$src))),
- (implicit EFLAGS)]>, TB;
-
-def BSR64rr : RI<0xBD, MRMSrcReg, (outs GR64:$dst), (ins GR64:$src),
- "bsr{q}\t{$src, $dst|$dst, $src}",
- [(set GR64:$dst, (X86bsr GR64:$src)), (implicit EFLAGS)]>, TB;
-def BSR64rm : RI<0xBD, MRMSrcMem, (outs GR64:$dst), (ins i64mem:$src),
- "bsr{q}\t{$src, $dst|$dst, $src}",
- [(set GR64:$dst, (X86bsr (loadi64 addr:$src))),
- (implicit EFLAGS)]>, TB;
-} // Defs = [EFLAGS]
-
-// Repeat string ops
-let Defs = [RCX,RDI,RSI], Uses = [RCX,RDI,RSI] in
-def REP_MOVSQ : RI<0xA5, RawFrm, (outs), (ins), "{rep;movsq|rep movsq}",
- [(X86rep_movs i64)]>, REP;
-let Defs = [RCX,RDI], Uses = [RAX,RCX,RDI] in
-def REP_STOSQ : RI<0xAB, RawFrm, (outs), (ins), "{rep;stosq|rep stosq}",
- [(X86rep_stos i64)]>, REP;
-
-//===----------------------------------------------------------------------===//
-// Move Instructions...
-//
-
-let neverHasSideEffects = 1 in
-def MOV64rr : RI<0x89, MRMDestReg, (outs GR64:$dst), (ins GR64:$src),
- "mov{q}\t{$src, $dst|$dst, $src}", []>;
-
-let isReMaterializable = 1 in {
-def MOV64ri : RIi64<0xB8, AddRegFrm, (outs GR64:$dst), (ins i64imm:$src),
- "movabs{q}\t{$src, $dst|$dst, $src}",
- [(set GR64:$dst, imm:$src)]>;
-def MOV64ri32 : RIi32<0xC7, MRM0r, (outs GR64:$dst), (ins i64i32imm:$src),
- "mov{q}\t{$src, $dst|$dst, $src}",
- [(set GR64:$dst, i64immSExt32:$src)]>;
-}
-
-let isSimpleLoad = 1 in
-def MOV64rm : RI<0x8B, MRMSrcMem, (outs GR64:$dst), (ins i64mem:$src),
- "mov{q}\t{$src, $dst|$dst, $src}",
- [(set GR64:$dst, (load addr:$src))]>;
-
-def MOV64mr : RI<0x89, MRMDestMem, (outs), (ins i64mem:$dst, GR64:$src),
- "mov{q}\t{$src, $dst|$dst, $src}",
- [(store GR64:$src, addr:$dst)]>;
-def MOV64mi32 : RIi32<0xC7, MRM0m, (outs), (ins i64mem:$dst, i64i32imm:$src),
- "mov{q}\t{$src, $dst|$dst, $src}",
- [(store i64immSExt32:$src, addr:$dst)]>;
-
-// Sign/Zero extenders
-
-def MOVSX64rr8 : RI<0xBE, MRMSrcReg, (outs GR64:$dst), (ins GR8 :$src),
- "movs{bq|x}\t{$src, $dst|$dst, $src}",
- [(set GR64:$dst, (sext GR8:$src))]>, TB;
-def MOVSX64rm8 : RI<0xBE, MRMSrcMem, (outs GR64:$dst), (ins i8mem :$src),
- "movs{bq|x}\t{$src, $dst|$dst, $src}",
- [(set GR64:$dst, (sextloadi64i8 addr:$src))]>, TB;
-def MOVSX64rr16: RI<0xBF, MRMSrcReg, (outs GR64:$dst), (ins GR16:$src),
- "movs{wq|x}\t{$src, $dst|$dst, $src}",
- [(set GR64:$dst, (sext GR16:$src))]>, TB;
-def MOVSX64rm16: RI<0xBF, MRMSrcMem, (outs GR64:$dst), (ins i16mem:$src),
- "movs{wq|x}\t{$src, $dst|$dst, $src}",
- [(set GR64:$dst, (sextloadi64i16 addr:$src))]>, TB;
-def MOVSX64rr32: RI<0x63, MRMSrcReg, (outs GR64:$dst), (ins GR32:$src),
- "movs{lq|xd}\t{$src, $dst|$dst, $src}",
- [(set GR64:$dst, (sext GR32:$src))]>;
-def MOVSX64rm32: RI<0x63, MRMSrcMem, (outs GR64:$dst), (ins i32mem:$src),
- "movs{lq|xd}\t{$src, $dst|$dst, $src}",
- [(set GR64:$dst, (sextloadi64i32 addr:$src))]>;
-
-def MOVZX64rr8 : RI<0xB6, MRMSrcReg, (outs GR64:$dst), (ins GR8 :$src),
- "movz{bq|x}\t{$src, $dst|$dst, $src}",
- [(set GR64:$dst, (zext GR8:$src))]>, TB;
-def MOVZX64rm8 : RI<0xB6, MRMSrcMem, (outs GR64:$dst), (ins i8mem :$src),
- "movz{bq|x}\t{$src, $dst|$dst, $src}",
- [(set GR64:$dst, (zextloadi64i8 addr:$src))]>, TB;
-def MOVZX64rr16: RI<0xB7, MRMSrcReg, (outs GR64:$dst), (ins GR16:$src),
- "movz{wq|x}\t{$src, $dst|$dst, $src}",
- [(set GR64:$dst, (zext GR16:$src))]>, TB;
-def MOVZX64rm16: RI<0xB7, MRMSrcMem, (outs GR64:$dst), (ins i16mem:$src),
- "movz{wq|x}\t{$src, $dst|$dst, $src}",
- [(set GR64:$dst, (zextloadi64i16 addr:$src))]>, TB;
-
-let neverHasSideEffects = 1 in {
- let Defs = [RAX], Uses = [EAX] in
- def CDQE : RI<0x98, RawFrm, (outs), (ins),
- "{cltq|cdqe}", []>; // RAX = signext(EAX)
-
- let Defs = [RAX,RDX], Uses = [RAX] in
- def CQO : RI<0x99, RawFrm, (outs), (ins),
- "{cqto|cqo}", []>; // RDX:RAX = signext(RAX)
-}
-
-//===----------------------------------------------------------------------===//
-// Arithmetic Instructions...
-//
-
-let Defs = [EFLAGS] in {
-let isTwoAddress = 1 in {
-let isConvertibleToThreeAddress = 1 in {
-let isCommutable = 1 in
-def ADD64rr : RI<0x01, MRMDestReg, (outs GR64:$dst), (ins GR64:$src1, GR64:$src2),
- "add{q}\t{$src2, $dst|$dst, $src2}",
- [(set GR64:$dst, (add GR64:$src1, GR64:$src2))]>;
-
-def ADD64ri32 : RIi32<0x81, MRM0r, (outs GR64:$dst), (ins GR64:$src1, i64i32imm:$src2),
- "add{q}\t{$src2, $dst|$dst, $src2}",
- [(set GR64:$dst, (add GR64:$src1, i64immSExt32:$src2))]>;
-def ADD64ri8 : RIi8<0x83, MRM0r, (outs GR64:$dst), (ins GR64:$src1, i64i8imm:$src2),
- "add{q}\t{$src2, $dst|$dst, $src2}",
- [(set GR64:$dst, (add GR64:$src1, i64immSExt8:$src2))]>;
-} // isConvertibleToThreeAddress
-
-def ADD64rm : RI<0x03, MRMSrcMem, (outs GR64:$dst), (ins GR64:$src1, i64mem:$src2),
- "add{q}\t{$src2, $dst|$dst, $src2}",
- [(set GR64:$dst, (add GR64:$src1, (load addr:$src2)))]>;
-} // isTwoAddress
-
-def ADD64mr : RI<0x01, MRMDestMem, (outs), (ins i64mem:$dst, GR64:$src2),
- "add{q}\t{$src2, $dst|$dst, $src2}",
- [(store (add (load addr:$dst), GR64:$src2), addr:$dst)]>;
-def ADD64mi32 : RIi32<0x81, MRM0m, (outs), (ins i64mem:$dst, i64i32imm :$src2),
- "add{q}\t{$src2, $dst|$dst, $src2}",
- [(store (add (load addr:$dst), i64immSExt32:$src2), addr:$dst)]>;
-def ADD64mi8 : RIi8<0x83, MRM0m, (outs), (ins i64mem:$dst, i64i8imm :$src2),
- "add{q}\t{$src2, $dst|$dst, $src2}",
- [(store (add (load addr:$dst), i64immSExt8:$src2), addr:$dst)]>;
-
-let Uses = [EFLAGS] in {
-let isTwoAddress = 1 in {
-let isCommutable = 1 in
-def ADC64rr : RI<0x11, MRMDestReg, (outs GR64:$dst), (ins GR64:$src1, GR64:$src2),
- "adc{q}\t{$src2, $dst|$dst, $src2}",
- [(set GR64:$dst, (adde GR64:$src1, GR64:$src2))]>;
-
-def ADC64rm : RI<0x13, MRMSrcMem , (outs GR64:$dst), (ins GR64:$src1, i64mem:$src2),
- "adc{q}\t{$src2, $dst|$dst, $src2}",
- [(set GR64:$dst, (adde GR64:$src1, (load addr:$src2)))]>;
-
-def ADC64ri32 : RIi32<0x81, MRM2r, (outs GR64:$dst), (ins GR64:$src1, i64i32imm:$src2),
- "adc{q}\t{$src2, $dst|$dst, $src2}",
- [(set GR64:$dst, (adde GR64:$src1, i64immSExt32:$src2))]>;
-def ADC64ri8 : RIi8<0x83, MRM2r, (outs GR64:$dst), (ins GR64:$src1, i64i8imm:$src2),
- "adc{q}\t{$src2, $dst|$dst, $src2}",
- [(set GR64:$dst, (adde GR64:$src1, i64immSExt8:$src2))]>;
-} // isTwoAddress
-
-def ADC64mr : RI<0x11, MRMDestMem, (outs), (ins i64mem:$dst, GR64:$src2),
- "adc{q}\t{$src2, $dst|$dst, $src2}",
- [(store (adde (load addr:$dst), GR64:$src2), addr:$dst)]>;
-def ADC64mi32 : RIi32<0x81, MRM2m, (outs), (ins i64mem:$dst, i64i32imm:$src2),
- "adc{q}\t{$src2, $dst|$dst, $src2}",
- [(store (adde (load addr:$dst), i64immSExt8:$src2), addr:$dst)]>;
-def ADC64mi8 : RIi8<0x83, MRM2m, (outs), (ins i64mem:$dst, i64i8imm :$src2),
- "adc{q}\t{$src2, $dst|$dst, $src2}",
- [(store (adde (load addr:$dst), i64immSExt8:$src2), addr:$dst)]>;
-} // Uses = [EFLAGS]
-
-let isTwoAddress = 1 in {
-def SUB64rr : RI<0x29, MRMDestReg, (outs GR64:$dst), (ins GR64:$src1, GR64:$src2),
- "sub{q}\t{$src2, $dst|$dst, $src2}",
- [(set GR64:$dst, (sub GR64:$src1, GR64:$src2))]>;
-
-def SUB64rm : RI<0x2B, MRMSrcMem, (outs GR64:$dst), (ins GR64:$src1, i64mem:$src2),
- "sub{q}\t{$src2, $dst|$dst, $src2}",
- [(set GR64:$dst, (sub GR64:$src1, (load addr:$src2)))]>;
-
-def SUB64ri32 : RIi32<0x81, MRM5r, (outs GR64:$dst), (ins GR64:$src1, i64i32imm:$src2),
- "sub{q}\t{$src2, $dst|$dst, $src2}",
- [(set GR64:$dst, (sub GR64:$src1, i64immSExt32:$src2))]>;
-def SUB64ri8 : RIi8<0x83, MRM5r, (outs GR64:$dst), (ins GR64:$src1, i64i8imm:$src2),
- "sub{q}\t{$src2, $dst|$dst, $src2}",
- [(set GR64:$dst, (sub GR64:$src1, i64immSExt8:$src2))]>;
-} // isTwoAddress
-
-def SUB64mr : RI<0x29, MRMDestMem, (outs), (ins i64mem:$dst, GR64:$src2),
- "sub{q}\t{$src2, $dst|$dst, $src2}",
- [(store (sub (load addr:$dst), GR64:$src2), addr:$dst)]>;
-def SUB64mi32 : RIi32<0x81, MRM5m, (outs), (ins i64mem:$dst, i64i32imm:$src2),
- "sub{q}\t{$src2, $dst|$dst, $src2}",
- [(store (sub (load addr:$dst), i64immSExt32:$src2), addr:$dst)]>;
-def SUB64mi8 : RIi8<0x83, MRM5m, (outs), (ins i64mem:$dst, i64i8imm :$src2),
- "sub{q}\t{$src2, $dst|$dst, $src2}",
- [(store (sub (load addr:$dst), i64immSExt8:$src2), addr:$dst)]>;
-
-let Uses = [EFLAGS] in {
-let isTwoAddress = 1 in {
-def SBB64rr : RI<0x19, MRMDestReg, (outs GR64:$dst), (ins GR64:$src1, GR64:$src2),
- "sbb{q}\t{$src2, $dst|$dst, $src2}",
- [(set GR64:$dst, (sube GR64:$src1, GR64:$src2))]>;
-
-def SBB64rm : RI<0x1B, MRMSrcMem, (outs GR64:$dst), (ins GR64:$src1, i64mem:$src2),
- "sbb{q}\t{$src2, $dst|$dst, $src2}",
- [(set GR64:$dst, (sube GR64:$src1, (load addr:$src2)))]>;
-
-def SBB64ri32 : RIi32<0x81, MRM3r, (outs GR64:$dst), (ins GR64:$src1, i64i32imm:$src2),
- "sbb{q}\t{$src2, $dst|$dst, $src2}",
- [(set GR64:$dst, (sube GR64:$src1, i64immSExt32:$src2))]>;
-def SBB64ri8 : RIi8<0x83, MRM3r, (outs GR64:$dst), (ins GR64:$src1, i64i8imm:$src2),
- "sbb{q}\t{$src2, $dst|$dst, $src2}",
- [(set GR64:$dst, (sube GR64:$src1, i64immSExt8:$src2))]>;
-} // isTwoAddress
-
-def SBB64mr : RI<0x19, MRMDestMem, (outs), (ins i64mem:$dst, GR64:$src2),
- "sbb{q}\t{$src2, $dst|$dst, $src2}",
- [(store (sube (load addr:$dst), GR64:$src2), addr:$dst)]>;
-def SBB64mi32 : RIi32<0x81, MRM3m, (outs), (ins i64mem:$dst, i64i32imm:$src2),
- "sbb{q}\t{$src2, $dst|$dst, $src2}",
- [(store (sube (load addr:$dst), i64immSExt32:$src2), addr:$dst)]>;
-def SBB64mi8 : RIi8<0x83, MRM3m, (outs), (ins i64mem:$dst, i64i8imm :$src2),
- "sbb{q}\t{$src2, $dst|$dst, $src2}",
- [(store (sube (load addr:$dst), i64immSExt8:$src2), addr:$dst)]>;
-} // Uses = [EFLAGS]
-} // Defs = [EFLAGS]
-
-// Unsigned multiplication
-let Defs = [RAX,RDX,EFLAGS], Uses = [RAX], neverHasSideEffects = 1 in {
-def MUL64r : RI<0xF7, MRM4r, (outs), (ins GR64:$src),
- "mul{q}\t$src", []>; // RAX,RDX = RAX*GR64
-let mayLoad = 1 in
-def MUL64m : RI<0xF7, MRM4m, (outs), (ins i64mem:$src),
- "mul{q}\t$src", []>; // RAX,RDX = RAX*[mem64]
-
-// Signed multiplication
-def IMUL64r : RI<0xF7, MRM5r, (outs), (ins GR64:$src),
- "imul{q}\t$src", []>; // RAX,RDX = RAX*GR64
-let mayLoad = 1 in
-def IMUL64m : RI<0xF7, MRM5m, (outs), (ins i64mem:$src),
- "imul{q}\t$src", []>; // RAX,RDX = RAX*[mem64]
-}
-
-let Defs = [EFLAGS] in {
-let isTwoAddress = 1 in {
-let isCommutable = 1 in
-def IMUL64rr : RI<0xAF, MRMSrcReg, (outs GR64:$dst), (ins GR64:$src1, GR64:$src2),
- "imul{q}\t{$src2, $dst|$dst, $src2}",
- [(set GR64:$dst, (mul GR64:$src1, GR64:$src2))]>, TB;
-
-def IMUL64rm : RI<0xAF, MRMSrcMem, (outs GR64:$dst), (ins GR64:$src1, i64mem:$src2),
- "imul{q}\t{$src2, $dst|$dst, $src2}",
- [(set GR64:$dst, (mul GR64:$src1, (load addr:$src2)))]>, TB;
-} // isTwoAddress
-
-// Suprisingly enough, these are not two address instructions!
-def IMUL64rri32 : RIi32<0x69, MRMSrcReg, // GR64 = GR64*I32
- (outs GR64:$dst), (ins GR64:$src1, i64i32imm:$src2),
- "imul{q}\t{$src2, $src1, $dst|$dst, $src1, $src2}",
- [(set GR64:$dst, (mul GR64:$src1, i64immSExt32:$src2))]>;
-def IMUL64rri8 : RIi8<0x6B, MRMSrcReg, // GR64 = GR64*I8
- (outs GR64:$dst), (ins GR64:$src1, i64i8imm:$src2),
- "imul{q}\t{$src2, $src1, $dst|$dst, $src1, $src2}",
- [(set GR64:$dst, (mul GR64:$src1, i64immSExt8:$src2))]>;
-def IMUL64rmi32 : RIi32<0x69, MRMSrcMem, // GR64 = [mem64]*I32
- (outs GR64:$dst), (ins i64mem:$src1, i64i32imm:$src2),
- "imul{q}\t{$src2, $src1, $dst|$dst, $src1, $src2}",
- [(set GR64:$dst, (mul (load addr:$src1), i64immSExt32:$src2))]>;
-def IMUL64rmi8 : RIi8<0x6B, MRMSrcMem, // GR64 = [mem64]*I8
- (outs GR64:$dst), (ins i64mem:$src1, i64i8imm: $src2),
- "imul{q}\t{$src2, $src1, $dst|$dst, $src1, $src2}",
- [(set GR64:$dst, (mul (load addr:$src1), i64immSExt8:$src2))]>;
-} // Defs = [EFLAGS]
-
-// Unsigned division / remainder
-let neverHasSideEffects = 1 in {
-let Defs = [RAX,RDX,EFLAGS], Uses = [RAX,RDX] in {
-def DIV64r : RI<0xF7, MRM6r, (outs), (ins GR64:$src), // RDX:RAX/r64 = RAX,RDX
- "div{q}\t$src", []>;
-// Signed division / remainder
-def IDIV64r: RI<0xF7, MRM7r, (outs), (ins GR64:$src), // RDX:RAX/r64 = RAX,RDX
- "idiv{q}\t$src", []>;
-let mayLoad = 1 in {
-def DIV64m : RI<0xF7, MRM6m, (outs), (ins i64mem:$src), // RDX:RAX/[mem64] = RAX,RDX
- "div{q}\t$src", []>;
-def IDIV64m: RI<0xF7, MRM7m, (outs), (ins i64mem:$src), // RDX:RAX/[mem64] = RAX,RDX
- "idiv{q}\t$src", []>;
-}
-}
-}
-
-// Unary instructions
-let Defs = [EFLAGS], CodeSize = 2 in {
-let isTwoAddress = 1 in
-def NEG64r : RI<0xF7, MRM3r, (outs GR64:$dst), (ins GR64:$src), "neg{q}\t$dst",
- [(set GR64:$dst, (ineg GR64:$src))]>;
-def NEG64m : RI<0xF7, MRM3m, (outs), (ins i64mem:$dst), "neg{q}\t$dst",
- [(store (ineg (loadi64 addr:$dst)), addr:$dst)]>;
-
-let isTwoAddress = 1, isConvertibleToThreeAddress = 1 in
-def INC64r : RI<0xFF, MRM0r, (outs GR64:$dst), (ins GR64:$src), "inc{q}\t$dst",
- [(set GR64:$dst, (add GR64:$src, 1))]>;
-def INC64m : RI<0xFF, MRM0m, (outs), (ins i64mem:$dst), "inc{q}\t$dst",
- [(store (add (loadi64 addr:$dst), 1), addr:$dst)]>;
-
-let isTwoAddress = 1, isConvertibleToThreeAddress = 1 in
-def DEC64r : RI<0xFF, MRM1r, (outs GR64:$dst), (ins GR64:$src), "dec{q}\t$dst",
- [(set GR64:$dst, (add GR64:$src, -1))]>;
-def DEC64m : RI<0xFF, MRM1m, (outs), (ins i64mem:$dst), "dec{q}\t$dst",
- [(store (add (loadi64 addr:$dst), -1), addr:$dst)]>;
-
-// In 64-bit mode, single byte INC and DEC cannot be encoded.
-let isTwoAddress = 1, isConvertibleToThreeAddress = 1 in {
-// Can transform into LEA.
-def INC64_16r : I<0xFF, MRM0r, (outs GR16:$dst), (ins GR16:$src), "inc{w}\t$dst",
- [(set GR16:$dst, (add GR16:$src, 1))]>,
- OpSize, Requires<[In64BitMode]>;
-def INC64_32r : I<0xFF, MRM0r, (outs GR32:$dst), (ins GR32:$src), "inc{l}\t$dst",
- [(set GR32:$dst, (add GR32:$src, 1))]>,
- Requires<[In64BitMode]>;
-def DEC64_16r : I<0xFF, MRM1r, (outs GR16:$dst), (ins GR16:$src), "dec{w}\t$dst",
- [(set GR16:$dst, (add GR16:$src, -1))]>,
- OpSize, Requires<[In64BitMode]>;
-def DEC64_32r : I<0xFF, MRM1r, (outs GR32:$dst), (ins GR32:$src), "dec{l}\t$dst",
- [(set GR32:$dst, (add GR32:$src, -1))]>,
- Requires<[In64BitMode]>;
-} // isConvertibleToThreeAddress
-
-// These are duplicates of their 32-bit counterparts. Only needed so X86 knows
-// how to unfold them.
-let isTwoAddress = 0, CodeSize = 2 in {
- def INC64_16m : I<0xFF, MRM0m, (outs), (ins i16mem:$dst), "inc{w}\t$dst",
- [(store (add (loadi16 addr:$dst), 1), addr:$dst)]>,
- OpSize, Requires<[In64BitMode]>;
- def INC64_32m : I<0xFF, MRM0m, (outs), (ins i32mem:$dst), "inc{l}\t$dst",
- [(store (add (loadi32 addr:$dst), 1), addr:$dst)]>,
- Requires<[In64BitMode]>;
- def DEC64_16m : I<0xFF, MRM1m, (outs), (ins i16mem:$dst), "dec{w}\t$dst",
- [(store (add (loadi16 addr:$dst), -1), addr:$dst)]>,
- OpSize, Requires<[In64BitMode]>;
- def DEC64_32m : I<0xFF, MRM1m, (outs), (ins i32mem:$dst), "dec{l}\t$dst",
- [(store (add (loadi32 addr:$dst), -1), addr:$dst)]>,
- Requires<[In64BitMode]>;
-}
-} // Defs = [EFLAGS], CodeSize
-
-
-let Defs = [EFLAGS] in {
-// Shift instructions
-let isTwoAddress = 1 in {
-let Uses = [CL] in
-def SHL64rCL : RI<0xD3, MRM4r, (outs GR64:$dst), (ins GR64:$src),
- "shl{q}\t{%cl, $dst|$dst, %CL}",
- [(set GR64:$dst, (shl GR64:$src, CL))]>;
-let isConvertibleToThreeAddress = 1 in // Can transform into LEA.
-def SHL64ri : RIi8<0xC1, MRM4r, (outs GR64:$dst), (ins GR64:$src1, i8imm:$src2),
- "shl{q}\t{$src2, $dst|$dst, $src2}",
- [(set GR64:$dst, (shl GR64:$src1, (i8 imm:$src2)))]>;
-// NOTE: We don't use shifts of a register by one, because 'add reg,reg' is
-// cheaper.
-} // isTwoAddress
-
-let Uses = [CL] in
-def SHL64mCL : RI<0xD3, MRM4m, (outs), (ins i64mem:$dst),
- "shl{q}\t{%cl, $dst|$dst, %CL}",
- [(store (shl (loadi64 addr:$dst), CL), addr:$dst)]>;
-def SHL64mi : RIi8<0xC1, MRM4m, (outs), (ins i64mem:$dst, i8imm:$src),
- "shl{q}\t{$src, $dst|$dst, $src}",
- [(store (shl (loadi64 addr:$dst), (i8 imm:$src)), addr:$dst)]>;
-def SHL64m1 : RI<0xD1, MRM4m, (outs), (ins i64mem:$dst),
- "shl{q}\t$dst",
- [(store (shl (loadi64 addr:$dst), (i8 1)), addr:$dst)]>;
-
-let isTwoAddress = 1 in {
-let Uses = [CL] in
-def SHR64rCL : RI<0xD3, MRM5r, (outs GR64:$dst), (ins GR64:$src),
- "shr{q}\t{%cl, $dst|$dst, %CL}",
- [(set GR64:$dst, (srl GR64:$src, CL))]>;
-def SHR64ri : RIi8<0xC1, MRM5r, (outs GR64:$dst), (ins GR64:$src1, i8imm:$src2),
- "shr{q}\t{$src2, $dst|$dst, $src2}",
- [(set GR64:$dst, (srl GR64:$src1, (i8 imm:$src2)))]>;
-def SHR64r1 : RI<0xD1, MRM5r, (outs GR64:$dst), (ins GR64:$src1),
- "shr{q}\t$dst",
- [(set GR64:$dst, (srl GR64:$src1, (i8 1)))]>;
-} // isTwoAddress
-
-let Uses = [CL] in
-def SHR64mCL : RI<0xD3, MRM5m, (outs), (ins i64mem:$dst),
- "shr{q}\t{%cl, $dst|$dst, %CL}",
- [(store (srl (loadi64 addr:$dst), CL), addr:$dst)]>;
-def SHR64mi : RIi8<0xC1, MRM5m, (outs), (ins i64mem:$dst, i8imm:$src),
- "shr{q}\t{$src, $dst|$dst, $src}",
- [(store (srl (loadi64 addr:$dst), (i8 imm:$src)), addr:$dst)]>;
-def SHR64m1 : RI<0xD1, MRM5m, (outs), (ins i64mem:$dst),
- "shr{q}\t$dst",
- [(store (srl (loadi64 addr:$dst), (i8 1)), addr:$dst)]>;
-
-let isTwoAddress = 1 in {
-let Uses = [CL] in
-def SAR64rCL : RI<0xD3, MRM7r, (outs GR64:$dst), (ins GR64:$src),
- "sar{q}\t{%cl, $dst|$dst, %CL}",
- [(set GR64:$dst, (sra GR64:$src, CL))]>;
-def SAR64ri : RIi8<0xC1, MRM7r, (outs GR64:$dst), (ins GR64:$src1, i8imm:$src2),
- "sar{q}\t{$src2, $dst|$dst, $src2}",
- [(set GR64:$dst, (sra GR64:$src1, (i8 imm:$src2)))]>;
-def SAR64r1 : RI<0xD1, MRM7r, (outs GR64:$dst), (ins GR64:$src1),
- "sar{q}\t$dst",
- [(set GR64:$dst, (sra GR64:$src1, (i8 1)))]>;
-} // isTwoAddress
-
-let Uses = [CL] in
-def SAR64mCL : RI<0xD3, MRM7m, (outs), (ins i64mem:$dst),
- "sar{q}\t{%cl, $dst|$dst, %CL}",
- [(store (sra (loadi64 addr:$dst), CL), addr:$dst)]>;
-def SAR64mi : RIi8<0xC1, MRM7m, (outs), (ins i64mem:$dst, i8imm:$src),
- "sar{q}\t{$src, $dst|$dst, $src}",
- [(store (sra (loadi64 addr:$dst), (i8 imm:$src)), addr:$dst)]>;
-def SAR64m1 : RI<0xD1, MRM7m, (outs), (ins i64mem:$dst),
- "sar{q}\t$dst",
- [(store (sra (loadi64 addr:$dst), (i8 1)), addr:$dst)]>;
-
-// Rotate instructions
-let isTwoAddress = 1 in {
-let Uses = [CL] in
-def ROL64rCL : RI<0xD3, MRM0r, (outs GR64:$dst), (ins GR64:$src),
- "rol{q}\t{%cl, $dst|$dst, %CL}",
- [(set GR64:$dst, (rotl GR64:$src, CL))]>;
-def ROL64ri : RIi8<0xC1, MRM0r, (outs GR64:$dst), (ins GR64:$src1, i8imm:$src2),
- "rol{q}\t{$src2, $dst|$dst, $src2}",
- [(set GR64:$dst, (rotl GR64:$src1, (i8 imm:$src2)))]>;
-def ROL64r1 : RI<0xD1, MRM0r, (outs GR64:$dst), (ins GR64:$src1),
- "rol{q}\t$dst",
- [(set GR64:$dst, (rotl GR64:$src1, (i8 1)))]>;
-} // isTwoAddress
-
-let Uses = [CL] in
-def ROL64mCL : I<0xD3, MRM0m, (outs), (ins i64mem:$dst),
- "rol{q}\t{%cl, $dst|$dst, %CL}",
- [(store (rotl (loadi64 addr:$dst), CL), addr:$dst)]>;
-def ROL64mi : RIi8<0xC1, MRM0m, (outs), (ins i64mem:$dst, i8imm:$src),
- "rol{q}\t{$src, $dst|$dst, $src}",
- [(store (rotl (loadi64 addr:$dst), (i8 imm:$src)), addr:$dst)]>;
-def ROL64m1 : RI<0xD1, MRM0m, (outs), (ins i64mem:$dst),
- "rol{q}\t$dst",
- [(store (rotl (loadi64 addr:$dst), (i8 1)), addr:$dst)]>;
-
-let isTwoAddress = 1 in {
-let Uses = [CL] in
-def ROR64rCL : RI<0xD3, MRM1r, (outs GR64:$dst), (ins GR64:$src),
- "ror{q}\t{%cl, $dst|$dst, %CL}",
- [(set GR64:$dst, (rotr GR64:$src, CL))]>;
-def ROR64ri : RIi8<0xC1, MRM1r, (outs GR64:$dst), (ins GR64:$src1, i8imm:$src2),
- "ror{q}\t{$src2, $dst|$dst, $src2}",
- [(set GR64:$dst, (rotr GR64:$src1, (i8 imm:$src2)))]>;
-def ROR64r1 : RI<0xD1, MRM1r, (outs GR64:$dst), (ins GR64:$src1),
- "ror{q}\t$dst",
- [(set GR64:$dst, (rotr GR64:$src1, (i8 1)))]>;
-} // isTwoAddress
-
-let Uses = [CL] in
-def ROR64mCL : RI<0xD3, MRM1m, (outs), (ins i64mem:$dst),
- "ror{q}\t{%cl, $dst|$dst, %CL}",
- [(store (rotr (loadi64 addr:$dst), CL), addr:$dst)]>;
-def ROR64mi : RIi8<0xC1, MRM1m, (outs), (ins i64mem:$dst, i8imm:$src),
- "ror{q}\t{$src, $dst|$dst, $src}",
- [(store (rotr (loadi64 addr:$dst), (i8 imm:$src)), addr:$dst)]>;
-def ROR64m1 : RI<0xD1, MRM1m, (outs), (ins i64mem:$dst),
- "ror{q}\t$dst",
- [(store (rotr (loadi64 addr:$dst), (i8 1)), addr:$dst)]>;
-
-// Double shift instructions (generalizations of rotate)
-let isTwoAddress = 1 in {
-let Uses = [CL] in {
-def SHLD64rrCL : RI<0xA5, MRMDestReg, (outs GR64:$dst), (ins GR64:$src1, GR64:$src2),
- "shld{q}\t{%cl, $src2, $dst|$dst, $src2, %CL}",
- [(set GR64:$dst, (X86shld GR64:$src1, GR64:$src2, CL))]>, TB;
-def SHRD64rrCL : RI<0xAD, MRMDestReg, (outs GR64:$dst), (ins GR64:$src1, GR64:$src2),
- "shrd{q}\t{%cl, $src2, $dst|$dst, $src2, %CL}",
- [(set GR64:$dst, (X86shrd GR64:$src1, GR64:$src2, CL))]>, TB;
-}
-
-let isCommutable = 1 in { // FIXME: Update X86InstrInfo::commuteInstruction
-def SHLD64rri8 : RIi8<0xA4, MRMDestReg,
- (outs GR64:$dst), (ins GR64:$src1, GR64:$src2, i8imm:$src3),
- "shld{q}\t{$src3, $src2, $dst|$dst, $src2, $src3}",
- [(set GR64:$dst, (X86shld GR64:$src1, GR64:$src2,
- (i8 imm:$src3)))]>,
- TB;
-def SHRD64rri8 : RIi8<0xAC, MRMDestReg,
- (outs GR64:$dst), (ins GR64:$src1, GR64:$src2, i8imm:$src3),
- "shrd{q}\t{$src3, $src2, $dst|$dst, $src2, $src3}",
- [(set GR64:$dst, (X86shrd GR64:$src1, GR64:$src2,
- (i8 imm:$src3)))]>,
- TB;
-} // isCommutable
-} // isTwoAddress
-
-let Uses = [CL] in {
-def SHLD64mrCL : RI<0xA5, MRMDestMem, (outs), (ins i64mem:$dst, GR64:$src2),
- "shld{q}\t{%cl, $src2, $dst|$dst, $src2, %CL}",
- [(store (X86shld (loadi64 addr:$dst), GR64:$src2, CL),
- addr:$dst)]>, TB;
-def SHRD64mrCL : RI<0xAD, MRMDestMem, (outs), (ins i64mem:$dst, GR64:$src2),
- "shrd{q}\t{%cl, $src2, $dst|$dst, $src2, %CL}",
- [(store (X86shrd (loadi64 addr:$dst), GR64:$src2, CL),
- addr:$dst)]>, TB;
-}
-def SHLD64mri8 : RIi8<0xA4, MRMDestMem,
- (outs), (ins i64mem:$dst, GR64:$src2, i8imm:$src3),
- "shld{q}\t{$src3, $src2, $dst|$dst, $src2, $src3}",
- [(store (X86shld (loadi64 addr:$dst), GR64:$src2,
- (i8 imm:$src3)), addr:$dst)]>,
- TB;
-def SHRD64mri8 : RIi8<0xAC, MRMDestMem,
- (outs), (ins i64mem:$dst, GR64:$src2, i8imm:$src3),
- "shrd{q}\t{$src3, $src2, $dst|$dst, $src2, $src3}",
- [(store (X86shrd (loadi64 addr:$dst), GR64:$src2,
- (i8 imm:$src3)), addr:$dst)]>,
- TB;
-} // Defs = [EFLAGS]
-
-//===----------------------------------------------------------------------===//
-// Logical Instructions...
-//
-
-let isTwoAddress = 1 in
-def NOT64r : RI<0xF7, MRM2r, (outs GR64:$dst), (ins GR64:$src), "not{q}\t$dst",
- [(set GR64:$dst, (not GR64:$src))]>;
-def NOT64m : RI<0xF7, MRM2m, (outs), (ins i64mem:$dst), "not{q}\t$dst",
- [(store (not (loadi64 addr:$dst)), addr:$dst)]>;
-
-let Defs = [EFLAGS] in {
-let isTwoAddress = 1 in {
-let isCommutable = 1 in
-def AND64rr : RI<0x21, MRMDestReg,
- (outs GR64:$dst), (ins GR64:$src1, GR64:$src2),
- "and{q}\t{$src2, $dst|$dst, $src2}",
- [(set GR64:$dst, (and GR64:$src1, GR64:$src2))]>;
-def AND64rm : RI<0x23, MRMSrcMem,
- (outs GR64:$dst), (ins GR64:$src1, i64mem:$src2),
- "and{q}\t{$src2, $dst|$dst, $src2}",
- [(set GR64:$dst, (and GR64:$src1, (load addr:$src2)))]>;
-def AND64ri32 : RIi32<0x81, MRM4r,
- (outs GR64:$dst), (ins GR64:$src1, i64i32imm:$src2),
- "and{q}\t{$src2, $dst|$dst, $src2}",
- [(set GR64:$dst, (and GR64:$src1, i64immSExt32:$src2))]>;
-def AND64ri8 : RIi8<0x83, MRM4r,
- (outs GR64:$dst), (ins GR64:$src1, i64i8imm:$src2),
- "and{q}\t{$src2, $dst|$dst, $src2}",
- [(set GR64:$dst, (and GR64:$src1, i64immSExt8:$src2))]>;
-} // isTwoAddress
-
-def AND64mr : RI<0x21, MRMDestMem,
- (outs), (ins i64mem:$dst, GR64:$src),
- "and{q}\t{$src, $dst|$dst, $src}",
- [(store (and (load addr:$dst), GR64:$src), addr:$dst)]>;
-def AND64mi32 : RIi32<0x81, MRM4m,
- (outs), (ins i64mem:$dst, i64i32imm:$src),
- "and{q}\t{$src, $dst|$dst, $src}",
- [(store (and (loadi64 addr:$dst), i64immSExt32:$src), addr:$dst)]>;
-def AND64mi8 : RIi8<0x83, MRM4m,
- (outs), (ins i64mem:$dst, i64i8imm :$src),
- "and{q}\t{$src, $dst|$dst, $src}",
- [(store (and (load addr:$dst), i64immSExt8:$src), addr:$dst)]>;
-
-let isTwoAddress = 1 in {
-let isCommutable = 1 in
-def OR64rr : RI<0x09, MRMDestReg, (outs GR64:$dst), (ins GR64:$src1, GR64:$src2),
- "or{q}\t{$src2, $dst|$dst, $src2}",
- [(set GR64:$dst, (or GR64:$src1, GR64:$src2))]>;
-def OR64rm : RI<0x0B, MRMSrcMem , (outs GR64:$dst), (ins GR64:$src1, i64mem:$src2),
- "or{q}\t{$src2, $dst|$dst, $src2}",
- [(set GR64:$dst, (or GR64:$src1, (load addr:$src2)))]>;
-def OR64ri32 : RIi32<0x81, MRM1r, (outs GR64:$dst), (ins GR64:$src1, i64i32imm:$src2),
- "or{q}\t{$src2, $dst|$dst, $src2}",
- [(set GR64:$dst, (or GR64:$src1, i64immSExt32:$src2))]>;
-def OR64ri8 : RIi8<0x83, MRM1r, (outs GR64:$dst), (ins GR64:$src1, i64i8imm:$src2),
- "or{q}\t{$src2, $dst|$dst, $src2}",
- [(set GR64:$dst, (or GR64:$src1, i64immSExt8:$src2))]>;
-} // isTwoAddress
-
-def OR64mr : RI<0x09, MRMDestMem, (outs), (ins i64mem:$dst, GR64:$src),
- "or{q}\t{$src, $dst|$dst, $src}",
- [(store (or (load addr:$dst), GR64:$src), addr:$dst)]>;
-def OR64mi32 : RIi32<0x81, MRM1m, (outs), (ins i64mem:$dst, i64i32imm:$src),
- "or{q}\t{$src, $dst|$dst, $src}",
- [(store (or (loadi64 addr:$dst), i64immSExt32:$src), addr:$dst)]>;
-def OR64mi8 : RIi8<0x83, MRM1m, (outs), (ins i64mem:$dst, i64i8imm:$src),
- "or{q}\t{$src, $dst|$dst, $src}",
- [(store (or (load addr:$dst), i64immSExt8:$src), addr:$dst)]>;
-
-let isTwoAddress = 1 in {
-let isCommutable = 1 in
-def XOR64rr : RI<0x31, MRMDestReg, (outs GR64:$dst), (ins GR64:$src1, GR64:$src2),
- "xor{q}\t{$src2, $dst|$dst, $src2}",
- [(set GR64:$dst, (xor GR64:$src1, GR64:$src2))]>;
-def XOR64rm : RI<0x33, MRMSrcMem, (outs GR64:$dst), (ins GR64:$src1, i64mem:$src2),
- "xor{q}\t{$src2, $dst|$dst, $src2}",
- [(set GR64:$dst, (xor GR64:$src1, (load addr:$src2)))]>;
-def XOR64ri32 : RIi32<0x81, MRM6r,
- (outs GR64:$dst), (ins GR64:$src1, i64i32imm:$src2),
- "xor{q}\t{$src2, $dst|$dst, $src2}",
- [(set GR64:$dst, (xor GR64:$src1, i64immSExt32:$src2))]>;
-def XOR64ri8 : RIi8<0x83, MRM6r, (outs GR64:$dst), (ins GR64:$src1, i64i8imm:$src2),
- "xor{q}\t{$src2, $dst|$dst, $src2}",
- [(set GR64:$dst, (xor GR64:$src1, i64immSExt8:$src2))]>;
-} // isTwoAddress
-
-def XOR64mr : RI<0x31, MRMDestMem, (outs), (ins i64mem:$dst, GR64:$src),
- "xor{q}\t{$src, $dst|$dst, $src}",
- [(store (xor (load addr:$dst), GR64:$src), addr:$dst)]>;
-def XOR64mi32 : RIi32<0x81, MRM6m, (outs), (ins i64mem:$dst, i64i32imm:$src),
- "xor{q}\t{$src, $dst|$dst, $src}",
- [(store (xor (loadi64 addr:$dst), i64immSExt32:$src), addr:$dst)]>;
-def XOR64mi8 : RIi8<0x83, MRM6m, (outs), (ins i64mem:$dst, i64i8imm :$src),
- "xor{q}\t{$src, $dst|$dst, $src}",
- [(store (xor (load addr:$dst), i64immSExt8:$src), addr:$dst)]>;
-} // Defs = [EFLAGS]
-
-//===----------------------------------------------------------------------===//
-// Comparison Instructions...
-//
-
-// Integer comparison
-let Defs = [EFLAGS] in {
-let isCommutable = 1 in
-def TEST64rr : RI<0x85, MRMDestReg, (outs), (ins GR64:$src1, GR64:$src2),
- "test{q}\t{$src2, $src1|$src1, $src2}",
- [(X86cmp (and GR64:$src1, GR64:$src2), 0),
- (implicit EFLAGS)]>;
-def TEST64rm : RI<0x85, MRMSrcMem, (outs), (ins GR64:$src1, i64mem:$src2),
- "test{q}\t{$src2, $src1|$src1, $src2}",
- [(X86cmp (and GR64:$src1, (loadi64 addr:$src2)), 0),
- (implicit EFLAGS)]>;
-def TEST64ri32 : RIi32<0xF7, MRM0r, (outs),
- (ins GR64:$src1, i64i32imm:$src2),
- "test{q}\t{$src2, $src1|$src1, $src2}",
- [(X86cmp (and GR64:$src1, i64immSExt32:$src2), 0),
- (implicit EFLAGS)]>;
-def TEST64mi32 : RIi32<0xF7, MRM0m, (outs),
- (ins i64mem:$src1, i64i32imm:$src2),
- "test{q}\t{$src2, $src1|$src1, $src2}",
- [(X86cmp (and (loadi64 addr:$src1), i64immSExt32:$src2), 0),
- (implicit EFLAGS)]>;
-
-def CMP64rr : RI<0x39, MRMDestReg, (outs), (ins GR64:$src1, GR64:$src2),
- "cmp{q}\t{$src2, $src1|$src1, $src2}",
- [(X86cmp GR64:$src1, GR64:$src2),
- (implicit EFLAGS)]>;
-def CMP64mr : RI<0x39, MRMDestMem, (outs), (ins i64mem:$src1, GR64:$src2),
- "cmp{q}\t{$src2, $src1|$src1, $src2}",
- [(X86cmp (loadi64 addr:$src1), GR64:$src2),
- (implicit EFLAGS)]>;
-def CMP64rm : RI<0x3B, MRMSrcMem, (outs), (ins GR64:$src1, i64mem:$src2),
- "cmp{q}\t{$src2, $src1|$src1, $src2}",
- [(X86cmp GR64:$src1, (loadi64 addr:$src2)),
- (implicit EFLAGS)]>;
-def CMP64ri32 : RIi32<0x81, MRM7r, (outs), (ins GR64:$src1, i64i32imm:$src2),
- "cmp{q}\t{$src2, $src1|$src1, $src2}",
- [(X86cmp GR64:$src1, i64immSExt32:$src2),
- (implicit EFLAGS)]>;
-def CMP64mi32 : RIi32<0x81, MRM7m, (outs),
- (ins i64mem:$src1, i64i32imm:$src2),
- "cmp{q}\t{$src2, $src1|$src1, $src2}",
- [(X86cmp (loadi64 addr:$src1), i64immSExt32:$src2),
- (implicit EFLAGS)]>;
-def CMP64mi8 : RIi8<0x83, MRM7m, (outs), (ins i64mem:$src1, i64i8imm:$src2),
- "cmp{q}\t{$src2, $src1|$src1, $src2}",
- [(X86cmp (loadi64 addr:$src1), i64immSExt8:$src2),
- (implicit EFLAGS)]>;
-def CMP64ri8 : RIi8<0x83, MRM7r, (outs), (ins GR64:$src1, i64i8imm:$src2),
- "cmp{q}\t{$src2, $src1|$src1, $src2}",
- [(X86cmp GR64:$src1, i64immSExt8:$src2),
- (implicit EFLAGS)]>;
-} // Defs = [EFLAGS]
-
-// Conditional moves
-let Uses = [EFLAGS], isTwoAddress = 1 in {
-let isCommutable = 1 in {
-def CMOVB64rr : RI<0x42, MRMSrcReg, // if <u, GR64 = GR64
- (outs GR64:$dst), (ins GR64:$src1, GR64:$src2),
- "cmovb\t{$src2, $dst|$dst, $src2}",
- [(set GR64:$dst, (X86cmov GR64:$src1, GR64:$src2,
- X86_COND_B, EFLAGS))]>, TB;
-def CMOVAE64rr: RI<0x43, MRMSrcReg, // if >=u, GR64 = GR64
- (outs GR64:$dst), (ins GR64:$src1, GR64:$src2),
- "cmovae\t{$src2, $dst|$dst, $src2}",
- [(set GR64:$dst, (X86cmov GR64:$src1, GR64:$src2,
- X86_COND_AE, EFLAGS))]>, TB;
-def CMOVE64rr : RI<0x44, MRMSrcReg, // if ==, GR64 = GR64
- (outs GR64:$dst), (ins GR64:$src1, GR64:$src2),
- "cmove\t{$src2, $dst|$dst, $src2}",
- [(set GR64:$dst, (X86cmov GR64:$src1, GR64:$src2,
- X86_COND_E, EFLAGS))]>, TB;
-def CMOVNE64rr: RI<0x45, MRMSrcReg, // if !=, GR64 = GR64
- (outs GR64:$dst), (ins GR64:$src1, GR64:$src2),
- "cmovne\t{$src2, $dst|$dst, $src2}",
- [(set GR64:$dst, (X86cmov GR64:$src1, GR64:$src2,
- X86_COND_NE, EFLAGS))]>, TB;
-def CMOVBE64rr: RI<0x46, MRMSrcReg, // if <=u, GR64 = GR64
- (outs GR64:$dst), (ins GR64:$src1, GR64:$src2),
- "cmovbe\t{$src2, $dst|$dst, $src2}",
- [(set GR64:$dst, (X86cmov GR64:$src1, GR64:$src2,
- X86_COND_BE, EFLAGS))]>, TB;
-def CMOVA64rr : RI<0x47, MRMSrcReg, // if >u, GR64 = GR64
- (outs GR64:$dst), (ins GR64:$src1, GR64:$src2),
- "cmova\t{$src2, $dst|$dst, $src2}",
- [(set GR64:$dst, (X86cmov GR64:$src1, GR64:$src2,
- X86_COND_A, EFLAGS))]>, TB;
-def CMOVL64rr : RI<0x4C, MRMSrcReg, // if <s, GR64 = GR64
- (outs GR64:$dst), (ins GR64:$src1, GR64:$src2),
- "cmovl\t{$src2, $dst|$dst, $src2}",
- [(set GR64:$dst, (X86cmov GR64:$src1, GR64:$src2,
- X86_COND_L, EFLAGS))]>, TB;
-def CMOVGE64rr: RI<0x4D, MRMSrcReg, // if >=s, GR64 = GR64
- (outs GR64:$dst), (ins GR64:$src1, GR64:$src2),
- "cmovge\t{$src2, $dst|$dst, $src2}",
- [(set GR64:$dst, (X86cmov GR64:$src1, GR64:$src2,
- X86_COND_GE, EFLAGS))]>, TB;
-def CMOVLE64rr: RI<0x4E, MRMSrcReg, // if <=s, GR64 = GR64
- (outs GR64:$dst), (ins GR64:$src1, GR64:$src2),
- "cmovle\t{$src2, $dst|$dst, $src2}",
- [(set GR64:$dst, (X86cmov GR64:$src1, GR64:$src2,
- X86_COND_LE, EFLAGS))]>, TB;
-def CMOVG64rr : RI<0x4F, MRMSrcReg, // if >s, GR64 = GR64
- (outs GR64:$dst), (ins GR64:$src1, GR64:$src2),
- "cmovg\t{$src2, $dst|$dst, $src2}",
- [(set GR64:$dst, (X86cmov GR64:$src1, GR64:$src2,
- X86_COND_G, EFLAGS))]>, TB;
-def CMOVS64rr : RI<0x48, MRMSrcReg, // if signed, GR64 = GR64
- (outs GR64:$dst), (ins GR64:$src1, GR64:$src2),
- "cmovs\t{$src2, $dst|$dst, $src2}",
- [(set GR64:$dst, (X86cmov GR64:$src1, GR64:$src2,
- X86_COND_S, EFLAGS))]>, TB;
-def CMOVNS64rr: RI<0x49, MRMSrcReg, // if !signed, GR64 = GR64
- (outs GR64:$dst), (ins GR64:$src1, GR64:$src2),
- "cmovns\t{$src2, $dst|$dst, $src2}",
- [(set GR64:$dst, (X86cmov GR64:$src1, GR64:$src2,
- X86_COND_NS, EFLAGS))]>, TB;
-def CMOVP64rr : RI<0x4A, MRMSrcReg, // if parity, GR64 = GR64
- (outs GR64:$dst), (ins GR64:$src1, GR64:$src2),
- "cmovp\t{$src2, $dst|$dst, $src2}",
- [(set GR64:$dst, (X86cmov GR64:$src1, GR64:$src2,
- X86_COND_P, EFLAGS))]>, TB;
-def CMOVNP64rr : RI<0x4B, MRMSrcReg, // if !parity, GR64 = GR64
- (outs GR64:$dst), (ins GR64:$src1, GR64:$src2),
- "cmovnp\t{$src2, $dst|$dst, $src2}",
- [(set GR64:$dst, (X86cmov GR64:$src1, GR64:$src2,
- X86_COND_NP, EFLAGS))]>, TB;
-} // isCommutable = 1
-
-def CMOVB64rm : RI<0x42, MRMSrcMem, // if <u, GR64 = [mem64]
- (outs GR64:$dst), (ins GR64:$src1, i64mem:$src2),
- "cmovb\t{$src2, $dst|$dst, $src2}",
- [(set GR64:$dst, (X86cmov GR64:$src1, (loadi64 addr:$src2),
- X86_COND_B, EFLAGS))]>, TB;
-def CMOVAE64rm: RI<0x43, MRMSrcMem, // if >=u, GR64 = [mem64]
- (outs GR64:$dst), (ins GR64:$src1, i64mem:$src2),
- "cmovae\t{$src2, $dst|$dst, $src2}",
- [(set GR64:$dst, (X86cmov GR64:$src1, (loadi64 addr:$src2),
- X86_COND_AE, EFLAGS))]>, TB;
-def CMOVE64rm : RI<0x44, MRMSrcMem, // if ==, GR64 = [mem64]
- (outs GR64:$dst), (ins GR64:$src1, i64mem:$src2),
- "cmove\t{$src2, $dst|$dst, $src2}",
- [(set GR64:$dst, (X86cmov GR64:$src1, (loadi64 addr:$src2),
- X86_COND_E, EFLAGS))]>, TB;
-def CMOVNE64rm: RI<0x45, MRMSrcMem, // if !=, GR64 = [mem64]
- (outs GR64:$dst), (ins GR64:$src1, i64mem:$src2),
- "cmovne\t{$src2, $dst|$dst, $src2}",
- [(set GR64:$dst, (X86cmov GR64:$src1, (loadi64 addr:$src2),
- X86_COND_NE, EFLAGS))]>, TB;
-def CMOVBE64rm: RI<0x46, MRMSrcMem, // if <=u, GR64 = [mem64]
- (outs GR64:$dst), (ins GR64:$src1, i64mem:$src2),
- "cmovbe\t{$src2, $dst|$dst, $src2}",
- [(set GR64:$dst, (X86cmov GR64:$src1, (loadi64 addr:$src2),
- X86_COND_BE, EFLAGS))]>, TB;
-def CMOVA64rm : RI<0x47, MRMSrcMem, // if >u, GR64 = [mem64]
- (outs GR64:$dst), (ins GR64:$src1, i64mem:$src2),
- "cmova\t{$src2, $dst|$dst, $src2}",
- [(set GR64:$dst, (X86cmov GR64:$src1, (loadi64 addr:$src2),
- X86_COND_A, EFLAGS))]>, TB;
-def CMOVL64rm : RI<0x4C, MRMSrcMem, // if <s, GR64 = [mem64]
- (outs GR64:$dst), (ins GR64:$src1, i64mem:$src2),
- "cmovl\t{$src2, $dst|$dst, $src2}",
- [(set GR64:$dst, (X86cmov GR64:$src1, (loadi64 addr:$src2),
- X86_COND_L, EFLAGS))]>, TB;
-def CMOVGE64rm: RI<0x4D, MRMSrcMem, // if >=s, GR64 = [mem64]
- (outs GR64:$dst), (ins GR64:$src1, i64mem:$src2),
- "cmovge\t{$src2, $dst|$dst, $src2}",
- [(set GR64:$dst, (X86cmov GR64:$src1, (loadi64 addr:$src2),
- X86_COND_GE, EFLAGS))]>, TB;
-def CMOVLE64rm: RI<0x4E, MRMSrcMem, // if <=s, GR64 = [mem64]
- (outs GR64:$dst), (ins GR64:$src1, i64mem:$src2),
- "cmovle\t{$src2, $dst|$dst, $src2}",
- [(set GR64:$dst, (X86cmov GR64:$src1, (loadi64 addr:$src2),
- X86_COND_LE, EFLAGS))]>, TB;
-def CMOVG64rm : RI<0x4F, MRMSrcMem, // if >s, GR64 = [mem64]
- (outs GR64:$dst), (ins GR64:$src1, i64mem:$src2),
- "cmovg\t{$src2, $dst|$dst, $src2}",
- [(set GR64:$dst, (X86cmov GR64:$src1, (loadi64 addr:$src2),
- X86_COND_G, EFLAGS))]>, TB;
-def CMOVS64rm : RI<0x48, MRMSrcMem, // if signed, GR64 = [mem64]
- (outs GR64:$dst), (ins GR64:$src1, i64mem:$src2),
- "cmovs\t{$src2, $dst|$dst, $src2}",
- [(set GR64:$dst, (X86cmov GR64:$src1, (loadi64 addr:$src2),
- X86_COND_S, EFLAGS))]>, TB;
-def CMOVNS64rm: RI<0x49, MRMSrcMem, // if !signed, GR64 = [mem64]
- (outs GR64:$dst), (ins GR64:$src1, i64mem:$src2),
- "cmovns\t{$src2, $dst|$dst, $src2}",
- [(set GR64:$dst, (X86cmov GR64:$src1, (loadi64 addr:$src2),
- X86_COND_NS, EFLAGS))]>, TB;
-def CMOVP64rm : RI<0x4A, MRMSrcMem, // if parity, GR64 = [mem64]
- (outs GR64:$dst), (ins GR64:$src1, i64mem:$src2),
- "cmovp\t{$src2, $dst|$dst, $src2}",
- [(set GR64:$dst, (X86cmov GR64:$src1, (loadi64 addr:$src2),
- X86_COND_P, EFLAGS))]>, TB;
-def CMOVNP64rm : RI<0x4B, MRMSrcMem, // if !parity, GR64 = [mem64]
- (outs GR64:$dst), (ins GR64:$src1, i64mem:$src2),
- "cmovnp\t{$src2, $dst|$dst, $src2}",
- [(set GR64:$dst, (X86cmov GR64:$src1, (loadi64 addr:$src2),
- X86_COND_NP, EFLAGS))]>, TB;
-} // isTwoAddress
-
-//===----------------------------------------------------------------------===//
-// Conversion Instructions...
-//
-
-// f64 -> signed i64
-def Int_CVTSD2SI64rr: RSDI<0x2D, MRMSrcReg, (outs GR64:$dst), (ins VR128:$src),
- "cvtsd2si{q}\t{$src, $dst|$dst, $src}",
- [(set GR64:$dst,
- (int_x86_sse2_cvtsd2si64 VR128:$src))]>;
-def Int_CVTSD2SI64rm: RSDI<0x2D, MRMSrcMem, (outs GR64:$dst), (ins f128mem:$src),
- "cvtsd2si{q}\t{$src, $dst|$dst, $src}",
- [(set GR64:$dst, (int_x86_sse2_cvtsd2si64
- (load addr:$src)))]>;
-def CVTTSD2SI64rr: RSDI<0x2C, MRMSrcReg, (outs GR64:$dst), (ins FR64:$src),
- "cvttsd2si{q}\t{$src, $dst|$dst, $src}",
- [(set GR64:$dst, (fp_to_sint FR64:$src))]>;
-def CVTTSD2SI64rm: RSDI<0x2C, MRMSrcMem, (outs GR64:$dst), (ins f64mem:$src),
- "cvttsd2si{q}\t{$src, $dst|$dst, $src}",
- [(set GR64:$dst, (fp_to_sint (loadf64 addr:$src)))]>;
-def Int_CVTTSD2SI64rr: RSDI<0x2C, MRMSrcReg, (outs GR64:$dst), (ins VR128:$src),
- "cvttsd2si{q}\t{$src, $dst|$dst, $src}",
- [(set GR64:$dst,
- (int_x86_sse2_cvttsd2si64 VR128:$src))]>;
-def Int_CVTTSD2SI64rm: RSDI<0x2C, MRMSrcMem, (outs GR64:$dst), (ins f128mem:$src),
- "cvttsd2si{q}\t{$src, $dst|$dst, $src}",
- [(set GR64:$dst,
- (int_x86_sse2_cvttsd2si64
- (load addr:$src)))]>;
-
-// Signed i64 -> f64
-def CVTSI2SD64rr: RSDI<0x2A, MRMSrcReg, (outs FR64:$dst), (ins GR64:$src),
- "cvtsi2sd{q}\t{$src, $dst|$dst, $src}",
- [(set FR64:$dst, (sint_to_fp GR64:$src))]>;
-def CVTSI2SD64rm: RSDI<0x2A, MRMSrcMem, (outs FR64:$dst), (ins i64mem:$src),
- "cvtsi2sd{q}\t{$src, $dst|$dst, $src}",
- [(set FR64:$dst, (sint_to_fp (loadi64 addr:$src)))]>;
-
-let isTwoAddress = 1 in {
-def Int_CVTSI2SD64rr: RSDI<0x2A, MRMSrcReg,
- (outs VR128:$dst), (ins VR128:$src1, GR64:$src2),
- "cvtsi2sd{q}\t{$src2, $dst|$dst, $src2}",
- [(set VR128:$dst,
- (int_x86_sse2_cvtsi642sd VR128:$src1,
- GR64:$src2))]>;
-def Int_CVTSI2SD64rm: RSDI<0x2A, MRMSrcMem,
- (outs VR128:$dst), (ins VR128:$src1, i64mem:$src2),
- "cvtsi2sd{q}\t{$src2, $dst|$dst, $src2}",
- [(set VR128:$dst,
- (int_x86_sse2_cvtsi642sd VR128:$src1,
- (loadi64 addr:$src2)))]>;
-} // isTwoAddress
-
-// Signed i64 -> f32
-def CVTSI2SS64rr: RSSI<0x2A, MRMSrcReg, (outs FR32:$dst), (ins GR64:$src),
- "cvtsi2ss{q}\t{$src, $dst|$dst, $src}",
- [(set FR32:$dst, (sint_to_fp GR64:$src))]>;
-def CVTSI2SS64rm: RSSI<0x2A, MRMSrcMem, (outs FR32:$dst), (ins i64mem:$src),
- "cvtsi2ss{q}\t{$src, $dst|$dst, $src}",
- [(set FR32:$dst, (sint_to_fp (loadi64 addr:$src)))]>;
-
-let isTwoAddress = 1 in {
- def Int_CVTSI2SS64rr : RSSI<0x2A, MRMSrcReg,
- (outs VR128:$dst), (ins VR128:$src1, GR64:$src2),
- "cvtsi2ss{q}\t{$src2, $dst|$dst, $src2}",
- [(set VR128:$dst,
- (int_x86_sse_cvtsi642ss VR128:$src1,
- GR64:$src2))]>;
- def Int_CVTSI2SS64rm : RSSI<0x2A, MRMSrcMem,
- (outs VR128:$dst), (ins VR128:$src1, i64mem:$src2),
- "cvtsi2ss{q}\t{$src2, $dst|$dst, $src2}",
- [(set VR128:$dst,
- (int_x86_sse_cvtsi642ss VR128:$src1,
- (loadi64 addr:$src2)))]>;
-}
-
-// f32 -> signed i64
-def Int_CVTSS2SI64rr: RSSI<0x2D, MRMSrcReg, (outs GR64:$dst), (ins VR128:$src),
- "cvtss2si{q}\t{$src, $dst|$dst, $src}",
- [(set GR64:$dst,
- (int_x86_sse_cvtss2si64 VR128:$src))]>;
-def Int_CVTSS2SI64rm: RSSI<0x2D, MRMSrcMem, (outs GR64:$dst), (ins f32mem:$src),
- "cvtss2si{q}\t{$src, $dst|$dst, $src}",
- [(set GR64:$dst, (int_x86_sse_cvtss2si64
- (load addr:$src)))]>;
-def CVTTSS2SI64rr: RSSI<0x2C, MRMSrcReg, (outs GR64:$dst), (ins FR32:$src),
- "cvttss2si{q}\t{$src, $dst|$dst, $src}",
- [(set GR64:$dst, (fp_to_sint FR32:$src))]>;
-def CVTTSS2SI64rm: RSSI<0x2C, MRMSrcMem, (outs GR64:$dst), (ins f32mem:$src),
- "cvttss2si{q}\t{$src, $dst|$dst, $src}",
- [(set GR64:$dst, (fp_to_sint (loadf32 addr:$src)))]>;
-def Int_CVTTSS2SI64rr: RSSI<0x2C, MRMSrcReg, (outs GR64:$dst), (ins VR128:$src),
- "cvttss2si{q}\t{$src, $dst|$dst, $src}",
- [(set GR64:$dst,
- (int_x86_sse_cvttss2si64 VR128:$src))]>;
-def Int_CVTTSS2SI64rm: RSSI<0x2C, MRMSrcMem, (outs GR64:$dst), (ins f32mem:$src),
- "cvttss2si{q}\t{$src, $dst|$dst, $src}",
- [(set GR64:$dst,
- (int_x86_sse_cvttss2si64 (load addr:$src)))]>;
-
-//===----------------------------------------------------------------------===//
-// Alias Instructions
-//===----------------------------------------------------------------------===//
-
-// Alias instructions that map movr0 to xor. Use xorl instead of xorq; it's
-// equivalent due to implicit zero-extending, and it sometimes has a smaller
-// encoding.
-// FIXME: remove when we can teach regalloc that xor reg, reg is ok.
-// FIXME: AddedComplexity gives MOV64r0 a higher priority than MOV64ri32. Remove
-// when we have a better way to specify isel priority.
-let Defs = [EFLAGS], AddedComplexity = 1, isReMaterializable = 1 in
-def MOV64r0 : RI<0x31, MRMInitReg, (outs GR64:$dst), (ins),
- "xor{l}\t${dst:subreg32}, ${dst:subreg32}",
- [(set GR64:$dst, 0)]>;
-
-// Materialize i64 constant where top 32-bits are zero.
-let AddedComplexity = 1, isReMaterializable = 1 in
-def MOV64ri64i32 : Ii32<0xB8, AddRegFrm, (outs GR64:$dst), (ins i64i32imm:$src),
- "mov{l}\t{$src, ${dst:subreg32}|${dst:subreg32}, $src}",
- [(set GR64:$dst, i64immZExt32:$src)]>;
-
-//===----------------------------------------------------------------------===//
-// Thread Local Storage Instructions
-//===----------------------------------------------------------------------===//
-
-def TLS_addr64 : I<0, Pseudo, (outs GR64:$dst), (ins i64imm:$sym),
- ".byte\t0x66; leaq\t${sym:mem}(%rip), $dst; .word\t0x6666; rex64",
- [(set GR64:$dst, (X86tlsaddr tglobaltlsaddr:$sym))]>;
-
-//===----------------------------------------------------------------------===//
-// Atomic Instructions
-//===----------------------------------------------------------------------===//
-
-let Defs = [RAX, EFLAGS], Uses = [RAX] in {
-def LCMPXCHG64 : RI<0xB1, MRMDestMem, (outs), (ins i64mem:$ptr, GR64:$swap),
- "lock cmpxchgq $swap,$ptr",
- [(X86cas addr:$ptr, GR64:$swap, 8)]>, TB, LOCK;
-}
-
-let Constraints = "$val = $dst", Defs = [EFLAGS] in {
-def LXADD64 : RI<0xC1, MRMSrcMem, (outs GR64:$dst), (ins i64mem:$ptr,GR64:$val),
- "lock xadd $val, $ptr",
- [(set GR64:$dst, (atomic_las_64 addr:$ptr, GR64:$val))]>,
- TB, LOCK;
-def XCHG64rm : RI<0x87, MRMSrcMem, (outs GR64:$dst), (ins i64mem:$ptr,GR64:$val),
- "xchg $val, $ptr",
- [(set GR64:$dst, (atomic_swap_64 addr:$ptr, GR64:$val))]>;
-}
-
-
-//===----------------------------------------------------------------------===//
-// Non-Instruction Patterns
-//===----------------------------------------------------------------------===//
-
-// ConstantPool GlobalAddress, ExternalSymbol, and JumpTable
-def : Pat<(i64 (X86Wrapper tconstpool :$dst)),
- (MOV64ri tconstpool :$dst)>, Requires<[NotSmallCode]>;
-def : Pat<(i64 (X86Wrapper tjumptable :$dst)),
- (MOV64ri tjumptable :$dst)>, Requires<[NotSmallCode]>;
-def : Pat<(i64 (X86Wrapper tglobaladdr :$dst)),
- (MOV64ri tglobaladdr :$dst)>, Requires<[NotSmallCode]>;
-def : Pat<(i64 (X86Wrapper texternalsym:$dst)),
- (MOV64ri texternalsym:$dst)>, Requires<[NotSmallCode]>;
-
-def : Pat<(store (i64 (X86Wrapper tconstpool:$src)), addr:$dst),
- (MOV64mi32 addr:$dst, tconstpool:$src)>,
- Requires<[SmallCode, IsStatic]>;
-def : Pat<(store (i64 (X86Wrapper tjumptable:$src)), addr:$dst),
- (MOV64mi32 addr:$dst, tjumptable:$src)>,
- Requires<[SmallCode, IsStatic]>;
-def : Pat<(store (i64 (X86Wrapper tglobaladdr:$src)), addr:$dst),
- (MOV64mi32 addr:$dst, tglobaladdr:$src)>,
- Requires<[SmallCode, IsStatic]>;
-def : Pat<(store (i64 (X86Wrapper texternalsym:$src)), addr:$dst),
- (MOV64mi32 addr:$dst, texternalsym:$src)>,
- Requires<[SmallCode, IsStatic]>;
-
-// Calls
-// Direct PC relative function call for small code model. 32-bit displacement
-// sign extended to 64-bit.
-def : Pat<(X86call (i64 tglobaladdr:$dst)),
- (CALL64pcrel32 tglobaladdr:$dst)>;
-def : Pat<(X86call (i64 texternalsym:$dst)),
- (CALL64pcrel32 texternalsym:$dst)>;
-
-def : Pat<(X86tailcall (i64 tglobaladdr:$dst)),
- (CALL64pcrel32 tglobaladdr:$dst)>;
-def : Pat<(X86tailcall (i64 texternalsym:$dst)),
- (CALL64pcrel32 texternalsym:$dst)>;
-
-def : Pat<(X86tailcall GR64:$dst),
- (CALL64r GR64:$dst)>;
-
-
-// tailcall stuff
-def : Pat<(X86tailcall GR32:$dst),
- (TAILCALL)>;
-def : Pat<(X86tailcall (i64 tglobaladdr:$dst)),
- (TAILCALL)>;
-def : Pat<(X86tailcall (i64 texternalsym:$dst)),
- (TAILCALL)>;
-
-def : Pat<(X86tcret GR64:$dst, imm:$off),
- (TCRETURNri64 GR64:$dst, imm:$off)>;
-
-def : Pat<(X86tcret (i64 tglobaladdr:$dst), imm:$off),
- (TCRETURNdi64 texternalsym:$dst, imm:$off)>;
-
-def : Pat<(X86tcret (i64 texternalsym:$dst), imm:$off),
- (TCRETURNdi64 texternalsym:$dst, imm:$off)>;
-
-// Comparisons.
-
-// TEST R,R is smaller than CMP R,0
-def : Pat<(parallel (X86cmp GR64:$src1, 0), (implicit EFLAGS)),
- (TEST64rr GR64:$src1, GR64:$src1)>;
-
-
-
-// Zero-extension
-def : Pat<(i64 (zext GR32:$src)),
- (SUBREG_TO_REG (i64 0), GR32:$src, x86_subreg_32bit)>;
-
-// zextload bool -> zextload byte
-def : Pat<(zextloadi64i1 addr:$src), (MOVZX64rm8 addr:$src)>;
-
-def : Pat<(zextloadi64i32 addr:$src),
- (SUBREG_TO_REG (i64 0), (MOV32rm addr:$src), x86_subreg_32bit)>;
-
-// extload
-def : Pat<(extloadi64i1 addr:$src), (MOVZX64rm8 addr:$src)>;
-def : Pat<(extloadi64i8 addr:$src), (MOVZX64rm8 addr:$src)>;
-def : Pat<(extloadi64i16 addr:$src), (MOVZX64rm16 addr:$src)>;
-def : Pat<(extloadi64i32 addr:$src),
- (INSERT_SUBREG (i64 (IMPLICIT_DEF)), (MOV32rm addr:$src),
- x86_subreg_32bit)>;
-
-// anyext -> zext
-def : Pat<(i64 (anyext GR8 :$src)), (MOVZX64rr8 GR8 :$src)>;
-def : Pat<(i64 (anyext GR16:$src)), (MOVZX64rr16 GR16:$src)>;
-def : Pat<(i64 (anyext GR32:$src)),
- (INSERT_SUBREG (i64 (IMPLICIT_DEF)), GR32:$src, x86_subreg_32bit)>;
-
-def : Pat<(i64 (anyext (loadi8 addr:$src))), (MOVZX64rm8 addr:$src)>;
-def : Pat<(i64 (anyext (loadi16 addr:$src))), (MOVZX64rm16 addr:$src)>;
-def : Pat<(i64 (anyext (loadi32 addr:$src))),
- (INSERT_SUBREG (i64 (IMPLICIT_DEF)), (MOV32rm addr:$src),
- x86_subreg_32bit)>;
-
-//===----------------------------------------------------------------------===//
-// Some peepholes
-//===----------------------------------------------------------------------===//
-
-// r & (2^32-1) ==> mov32 + implicit zext
-def : Pat<(and GR64:$src, i64immFFFFFFFF),
- (SUBREG_TO_REG (i64 0),
- (i32 (EXTRACT_SUBREG GR64:$src, x86_subreg_32bit)),
- x86_subreg_32bit)>;
-
-// (shl x, 1) ==> (add x, x)
-def : Pat<(shl GR64:$src1, (i8 1)), (ADD64rr GR64:$src1, GR64:$src1)>;
-
-// (or (x >> c) | (y << (64 - c))) ==> (shrd64 x, y, c)
-def : Pat<(or (srl GR64:$src1, CL:$amt),
- (shl GR64:$src2, (sub 64, CL:$amt))),
- (SHRD64rrCL GR64:$src1, GR64:$src2)>;
-
-def : Pat<(store (or (srl (loadi64 addr:$dst), CL:$amt),
- (shl GR64:$src2, (sub 64, CL:$amt))), addr:$dst),
- (SHRD64mrCL addr:$dst, GR64:$src2)>;
-
-// (or (x << c) | (y >> (64 - c))) ==> (shld64 x, y, c)
-def : Pat<(or (shl GR64:$src1, CL:$amt),
- (srl GR64:$src2, (sub 64, CL:$amt))),
- (SHLD64rrCL GR64:$src1, GR64:$src2)>;
-
-def : Pat<(store (or (shl (loadi64 addr:$dst), CL:$amt),
- (srl GR64:$src2, (sub 64, CL:$amt))), addr:$dst),
- (SHLD64mrCL addr:$dst, GR64:$src2)>;
-
-// X86 specific add which produces a flag.
-def : Pat<(addc GR64:$src1, GR64:$src2),
- (ADD64rr GR64:$src1, GR64:$src2)>;
-def : Pat<(addc GR64:$src1, (load addr:$src2)),
- (ADD64rm GR64:$src1, addr:$src2)>;
-def : Pat<(addc GR64:$src1, i64immSExt32:$src2),
- (ADD64ri32 GR64:$src1, imm:$src2)>;
-def : Pat<(addc GR64:$src1, i64immSExt8:$src2),
- (ADD64ri8 GR64:$src1, i64immSExt8:$src2)>;
-
-def : Pat<(subc GR64:$src1, GR64:$src2),
- (SUB64rr GR64:$src1, GR64:$src2)>;
-def : Pat<(subc GR64:$src1, (load addr:$src2)),
- (SUB64rm GR64:$src1, addr:$src2)>;
-def : Pat<(subc GR64:$src1, imm:$src2),
- (SUB64ri32 GR64:$src1, i64immSExt32:$src2)>;
-def : Pat<(subc GR64:$src1, i64immSExt8:$src2),
- (SUB64ri8 GR64:$src1, i64immSExt8:$src2)>;
-
-
-//===----------------------------------------------------------------------===//
-// X86-64 SSE Instructions
-//===----------------------------------------------------------------------===//
-
-// Move instructions...
-
-def MOV64toPQIrr : RPDI<0x6E, MRMSrcReg, (outs VR128:$dst), (ins GR64:$src),
- "mov{d|q}\t{$src, $dst|$dst, $src}",
- [(set VR128:$dst,
- (v2i64 (scalar_to_vector GR64:$src)))]>;
-def MOVPQIto64rr : RPDI<0x7E, MRMDestReg, (outs GR64:$dst), (ins VR128:$src),
- "mov{d|q}\t{$src, $dst|$dst, $src}",
- [(set GR64:$dst, (vector_extract (v2i64 VR128:$src),
- (iPTR 0)))]>;
-
-def MOV64toSDrr : RPDI<0x6E, MRMSrcReg, (outs FR64:$dst), (ins GR64:$src),
- "mov{d|q}\t{$src, $dst|$dst, $src}",
- [(set FR64:$dst, (bitconvert GR64:$src))]>;
-def MOV64toSDrm : RPDI<0x6E, MRMSrcMem, (outs FR64:$dst), (ins i64mem:$src),
- "mov{d|q}\t{$src, $dst|$dst, $src}",
- [(set FR64:$dst, (bitconvert (loadi64 addr:$src)))]>;
-
-def MOVSDto64rr : RPDI<0x7E, MRMDestReg, (outs GR64:$dst), (ins FR64:$src),
- "mov{d|q}\t{$src, $dst|$dst, $src}",
- [(set GR64:$dst, (bitconvert FR64:$src))]>;
-def MOVSDto64mr : RPDI<0x7E, MRMDestMem, (outs), (ins i64mem:$dst, FR64:$src),
- "mov{d|q}\t{$src, $dst|$dst, $src}",
- [(store (i64 (bitconvert FR64:$src)), addr:$dst)]>;
-
-//===----------------------------------------------------------------------===//
-// X86-64 SSE4.1 Instructions
-//===----------------------------------------------------------------------===//
-
-/// SS41I_extract32 - SSE 4.1 extract 32 bits to int reg or memory destination
-multiclass SS41I_extract64<bits<8> opc, string OpcodeStr> {
- def rr : SS4AIi8<opc, MRMSrcReg, (outs GR64:$dst),
- (ins VR128:$src1, i32i8imm:$src2),
- !strconcat(OpcodeStr,
- "\t{$src2, $src1, $dst|$dst, $src1, $src2}"),
- [(set GR64:$dst,
- (extractelt (v2i64 VR128:$src1), imm:$src2))]>, OpSize, REX_W;
- def mr : SS4AIi8<opc, MRMDestMem, (outs),
- (ins i64mem:$dst, VR128:$src1, i32i8imm:$src2),
- !strconcat(OpcodeStr,
- "\t{$src2, $src1, $dst|$dst, $src1, $src2}"),
- [(store (extractelt (v2i64 VR128:$src1), imm:$src2),
- addr:$dst)]>, OpSize, REX_W;
-}
-
-defm PEXTRQ : SS41I_extract64<0x16, "pextrq">;
-
-let isTwoAddress = 1 in {
- multiclass SS41I_insert64<bits<8> opc, string OpcodeStr> {
- def rr : SS4AIi8<opc, MRMSrcReg, (outs VR128:$dst),
- (ins VR128:$src1, GR64:$src2, i32i8imm:$src3),
- !strconcat(OpcodeStr,
- "\t{$src3, $src2, $dst|$dst, $src2, $src3}"),
- [(set VR128:$dst,
- (v2i64 (insertelt VR128:$src1, GR64:$src2, imm:$src3)))]>,
- OpSize, REX_W;
- def rm : SS4AIi8<opc, MRMSrcMem, (outs VR128:$dst),
- (ins VR128:$src1, i64mem:$src2, i32i8imm:$src3),
- !strconcat(OpcodeStr,
- "\t{$src3, $src2, $dst|$dst, $src2, $src3}"),
- [(set VR128:$dst,
- (v2i64 (insertelt VR128:$src1, (loadi64 addr:$src2),
- imm:$src3)))]>, OpSize, REX_W;
- }
-}
-
-defm PINSRQ : SS41I_insert64<0x22, "pinsrq">;
diff --git a/release_23/lib/Target/X86/X86InstrBuilder.h b/release_23/lib/Target/X86/X86InstrBuilder.h
deleted file mode 100644
index e5336bca8360..000000000000
--- a/release_23/lib/Target/X86/X86InstrBuilder.h
+++ /dev/null
@@ -1,125 +0,0 @@
-//===-- X86InstrBuilder.h - Functions to aid building x86 insts -*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file exposes functions that may be used with BuildMI from the
-// MachineInstrBuilder.h file to handle X86'isms in a clean way.
-//
-// The BuildMem function may be used with the BuildMI function to add entire
-// memory references in a single, typed, function call. X86 memory references
-// can be very complex expressions (described in the README), so wrapping them
-// up behind an easier to use interface makes sense. Descriptions of the
-// functions are included below.
-//
-// For reference, the order of operands for memory references is:
-// (Operand), Base, Scale, Index, Displacement.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef X86INSTRBUILDER_H
-#define X86INSTRBUILDER_H
-
-#include "llvm/CodeGen/MachineInstrBuilder.h"
-
-namespace llvm {
-
-/// X86AddressMode - This struct holds a generalized full x86 address mode.
-/// The base register can be a frame index, which will eventually be replaced
-/// with BP or SP and Disp being offsetted accordingly. The displacement may
-/// also include the offset of a global value.
-struct X86AddressMode {
- enum {
- RegBase,
- FrameIndexBase
- } BaseType;
-
- union {
- unsigned Reg;
- int FrameIndex;
- } Base;
-
- unsigned Scale;
- unsigned IndexReg;
- unsigned Disp;
- GlobalValue *GV;
-
- X86AddressMode() : BaseType(RegBase), Scale(1), IndexReg(0), Disp(0), GV(0) {
- Base.Reg = 0;
- }
-};
-
-/// addDirectMem - This function is used to add a direct memory reference to the
-/// current instruction -- that is, a dereference of an address in a register,
-/// with no scale, index or displacement. An example is: DWORD PTR [EAX].
-///
-inline const MachineInstrBuilder &addDirectMem(const MachineInstrBuilder &MIB,
- unsigned Reg) {
- // Because memory references are always represented with four
- // values, this adds: Reg, [1, NoReg, 0] to the instruction.
- return MIB.addReg(Reg).addImm(1).addReg(0).addImm(0);
-}
-
-
-/// addRegOffset - This function is used to add a memory reference of the form
-/// [Reg + Offset], i.e., one with no scale or index, but with a
-/// displacement. An example is: DWORD PTR [EAX + 4].
-///
-inline const MachineInstrBuilder &addRegOffset(const MachineInstrBuilder &MIB,
- unsigned Reg, int Offset) {
- return MIB.addReg(Reg).addImm(1).addReg(0).addImm(Offset);
-}
-
-/// addRegReg - This function is used to add a memory reference of the form:
-/// [Reg + Reg].
-inline const MachineInstrBuilder &addRegReg(const MachineInstrBuilder &MIB,
- unsigned Reg1, unsigned Reg2) {
- return MIB.addReg(Reg1).addImm(1).addReg(Reg2).addImm(0);
-}
-
-inline const MachineInstrBuilder &addFullAddress(const MachineInstrBuilder &MIB,
- const X86AddressMode &AM) {
- assert (AM.Scale == 1 || AM.Scale == 2 || AM.Scale == 4 || AM.Scale == 8);
-
- if (AM.BaseType == X86AddressMode::RegBase)
- MIB.addReg(AM.Base.Reg);
- else if (AM.BaseType == X86AddressMode::FrameIndexBase)
- MIB.addFrameIndex(AM.Base.FrameIndex);
- else
- assert (0);
- MIB.addImm(AM.Scale).addReg(AM.IndexReg);
- if (AM.GV)
- return MIB.addGlobalAddress(AM.GV, AM.Disp);
- else
- return MIB.addImm(AM.Disp);
-}
-
-/// addFrameReference - This function is used to add a reference to the base of
-/// an abstract object on the stack frame of the current function. This
-/// reference has base register as the FrameIndex offset until it is resolved.
-/// This allows a constant offset to be specified as well...
-///
-inline const MachineInstrBuilder &
-addFrameReference(const MachineInstrBuilder &MIB, int FI, int Offset = 0) {
- return MIB.addFrameIndex(FI).addImm(1).addReg(0).addImm(Offset);
-}
-
-/// addConstantPoolReference - This function is used to add a reference to the
-/// base of a constant value spilled to the per-function constant pool. The
-/// reference has base register ConstantPoolIndex offset which is retained until
-/// either machine code emission or assembly output. This allows an optional
-/// offset to be added as well.
-///
-inline const MachineInstrBuilder &
-addConstantPoolReference(const MachineInstrBuilder &MIB, unsigned CPI,
- int Offset = 0) {
- return MIB.addConstantPoolIndex(CPI).addImm(1).addReg(0).addImm(Offset);
-}
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/lib/Target/X86/X86InstrFPStack.td b/release_23/lib/Target/X86/X86InstrFPStack.td
deleted file mode 100644
index b07b6efddc88..000000000000
--- a/release_23/lib/Target/X86/X86InstrFPStack.td
+++ /dev/null
@@ -1,591 +0,0 @@
-//==- X86InstrFPStack.td - Describe the X86 Instruction Set --*- tablegen -*-=//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file describes the X86 x87 FPU instruction set, defining the
-// instructions, and properties of the instructions which are needed for code
-// generation, machine code emission, and analysis.
-//
-//===----------------------------------------------------------------------===//
-
-//===----------------------------------------------------------------------===//
-// FPStack specific DAG Nodes.
-//===----------------------------------------------------------------------===//
-
-def SDTX86FpGet2 : SDTypeProfile<2, 0, [SDTCisVT<0, f80>,
- SDTCisVT<1, f80>]>;
-def SDTX86Fld : SDTypeProfile<1, 2, [SDTCisFP<0>,
- SDTCisPtrTy<1>,
- SDTCisVT<2, OtherVT>]>;
-def SDTX86Fst : SDTypeProfile<0, 3, [SDTCisFP<0>,
- SDTCisPtrTy<1>,
- SDTCisVT<2, OtherVT>]>;
-def SDTX86Fild : SDTypeProfile<1, 2, [SDTCisFP<0>, SDTCisPtrTy<1>,
- SDTCisVT<2, OtherVT>]>;
-def SDTX86FpToIMem : SDTypeProfile<0, 2, [SDTCisFP<0>, SDTCisPtrTy<1>]>;
-
-def SDTX86CwdStore : SDTypeProfile<0, 1, [SDTCisPtrTy<0>]>;
-
-def X86fld : SDNode<"X86ISD::FLD", SDTX86Fld,
- [SDNPHasChain, SDNPMayLoad]>;
-def X86fst : SDNode<"X86ISD::FST", SDTX86Fst,
- [SDNPHasChain, SDNPInFlag, SDNPMayStore]>;
-def X86fild : SDNode<"X86ISD::FILD", SDTX86Fild,
- [SDNPHasChain, SDNPMayLoad]>;
-def X86fildflag : SDNode<"X86ISD::FILD_FLAG", SDTX86Fild,
- [SDNPHasChain, SDNPOutFlag, SDNPMayLoad]>;
-def X86fp_to_i16mem : SDNode<"X86ISD::FP_TO_INT16_IN_MEM", SDTX86FpToIMem,
- [SDNPHasChain, SDNPMayStore]>;
-def X86fp_to_i32mem : SDNode<"X86ISD::FP_TO_INT32_IN_MEM", SDTX86FpToIMem,
- [SDNPHasChain, SDNPMayStore]>;
-def X86fp_to_i64mem : SDNode<"X86ISD::FP_TO_INT64_IN_MEM", SDTX86FpToIMem,
- [SDNPHasChain, SDNPMayStore]>;
-def X86fp_cwd_get16 : SDNode<"X86ISD::FNSTCW16m", SDTX86CwdStore,
- [SDNPHasChain, SDNPMayStore, SDNPSideEffect]>;
-
-//===----------------------------------------------------------------------===//
-// FPStack pattern fragments
-//===----------------------------------------------------------------------===//
-
-def fpimm0 : PatLeaf<(fpimm), [{
- return N->isExactlyValue(+0.0);
-}]>;
-
-def fpimmneg0 : PatLeaf<(fpimm), [{
- return N->isExactlyValue(-0.0);
-}]>;
-
-def fpimm1 : PatLeaf<(fpimm), [{
- return N->isExactlyValue(+1.0);
-}]>;
-
-def fpimmneg1 : PatLeaf<(fpimm), [{
- return N->isExactlyValue(-1.0);
-}]>;
-
-// Some 'special' instructions
-let usesCustomDAGSchedInserter = 1 in { // Expanded by the scheduler.
- def FP32_TO_INT16_IN_MEM : I<0, Pseudo,
- (outs), (ins i16mem:$dst, RFP32:$src),
- "##FP32_TO_INT16_IN_MEM PSEUDO!",
- [(X86fp_to_i16mem RFP32:$src, addr:$dst)]>;
- def FP32_TO_INT32_IN_MEM : I<0, Pseudo,
- (outs), (ins i32mem:$dst, RFP32:$src),
- "##FP32_TO_INT32_IN_MEM PSEUDO!",
- [(X86fp_to_i32mem RFP32:$src, addr:$dst)]>;
- def FP32_TO_INT64_IN_MEM : I<0, Pseudo,
- (outs), (ins i64mem:$dst, RFP32:$src),
- "##FP32_TO_INT64_IN_MEM PSEUDO!",
- [(X86fp_to_i64mem RFP32:$src, addr:$dst)]>;
- def FP64_TO_INT16_IN_MEM : I<0, Pseudo,
- (outs), (ins i16mem:$dst, RFP64:$src),
- "##FP64_TO_INT16_IN_MEM PSEUDO!",
- [(X86fp_to_i16mem RFP64:$src, addr:$dst)]>;
- def FP64_TO_INT32_IN_MEM : I<0, Pseudo,
- (outs), (ins i32mem:$dst, RFP64:$src),
- "##FP64_TO_INT32_IN_MEM PSEUDO!",
- [(X86fp_to_i32mem RFP64:$src, addr:$dst)]>;
- def FP64_TO_INT64_IN_MEM : I<0, Pseudo,
- (outs), (ins i64mem:$dst, RFP64:$src),
- "##FP64_TO_INT64_IN_MEM PSEUDO!",
- [(X86fp_to_i64mem RFP64:$src, addr:$dst)]>;
- def FP80_TO_INT16_IN_MEM : I<0, Pseudo,
- (outs), (ins i16mem:$dst, RFP80:$src),
- "##FP80_TO_INT16_IN_MEM PSEUDO!",
- [(X86fp_to_i16mem RFP80:$src, addr:$dst)]>;
- def FP80_TO_INT32_IN_MEM : I<0, Pseudo,
- (outs), (ins i32mem:$dst, RFP80:$src),
- "##FP80_TO_INT32_IN_MEM PSEUDO!",
- [(X86fp_to_i32mem RFP80:$src, addr:$dst)]>;
- def FP80_TO_INT64_IN_MEM : I<0, Pseudo,
- (outs), (ins i64mem:$dst, RFP80:$src),
- "##FP80_TO_INT64_IN_MEM PSEUDO!",
- [(X86fp_to_i64mem RFP80:$src, addr:$dst)]>;
-}
-
-let isTerminator = 1 in
- let Defs = [FP0, FP1, FP2, FP3, FP4, FP5, FP6] in
- def FP_REG_KILL : I<0, Pseudo, (outs), (ins), "##FP_REG_KILL", []>;
-
-// All FP Stack operations are represented with four instructions here. The
-// first three instructions, generated by the instruction selector, use "RFP32"
-// "RFP64" or "RFP80" registers: traditional register files to reference 32-bit,
-// 64-bit or 80-bit floating point values. These sizes apply to the values,
-// not the registers, which are always 80 bits; RFP32, RFP64 and RFP80 can be
-// copied to each other without losing information. These instructions are all
-// pseudo instructions and use the "_Fp" suffix.
-// In some cases there are additional variants with a mixture of different
-// register sizes.
-// The second instruction is defined with FPI, which is the actual instruction
-// emitted by the assembler. These use "RST" registers, although frequently
-// the actual register(s) used are implicit. These are always 80 bits.
-// The FP stackifier pass converts one to the other after register allocation
-// occurs.
-//
-// Note that the FpI instruction should have instruction selection info (e.g.
-// a pattern) and the FPI instruction should have emission info (e.g. opcode
-// encoding and asm printing info).
-
-// Pseudo Instructions for FP stack return values.
-def FpGET_ST0_32 : FpI_<(outs RFP32:$dst), (ins), SpecialFP, []>; // FPR = ST(0)
-def FpGET_ST0_64 : FpI_<(outs RFP64:$dst), (ins), SpecialFP, []>; // FPR = ST(0)
-def FpGET_ST0_80 : FpI_<(outs RFP80:$dst), (ins), SpecialFP, []>; // FPR = ST(0)
-
-// FpGET_ST1* should only be issued *after* an FpGET_ST0* has been issued when
-// there are two values live out on the stack from a call or inlineasm. This
-// magic is handled by the stackifier. It is not valid to emit FpGET_ST1* and
-// then FpGET_ST0*. In addition, it is invalid for any FP-using operations to
-// occur between them.
-def FpGET_ST1_32 : FpI_<(outs RFP32:$dst), (ins), SpecialFP, []>; // FPR = ST(1)
-def FpGET_ST1_64 : FpI_<(outs RFP64:$dst), (ins), SpecialFP, []>; // FPR = ST(1)
-def FpGET_ST1_80 : FpI_<(outs RFP80:$dst), (ins), SpecialFP, []>; // FPR = ST(1)
-
-let Defs = [ST0] in {
-def FpSET_ST0_32 : FpI_<(outs), (ins RFP32:$src), SpecialFP, []>; // ST(0) = FPR
-def FpSET_ST0_64 : FpI_<(outs), (ins RFP64:$src), SpecialFP, []>; // ST(0) = FPR
-def FpSET_ST0_80 : FpI_<(outs), (ins RFP80:$src), SpecialFP, []>; // ST(0) = FPR
-}
-
-// FpIf32, FpIf64 - Floating Point Psuedo Instruction template.
-// f32 instructions can use SSE1 and are predicated on FPStackf32 == !SSE1.
-// f64 instructions can use SSE2 and are predicated on FPStackf64 == !SSE2.
-// f80 instructions cannot use SSE and use neither of these.
-class FpIf32<dag outs, dag ins, FPFormat fp, list<dag> pattern> :
- FpI_<outs, ins, fp, pattern>, Requires<[FPStackf32]>;
-class FpIf64<dag outs, dag ins, FPFormat fp, list<dag> pattern> :
- FpI_<outs, ins, fp, pattern>, Requires<[FPStackf64]>;
-
-// Register copies. Just copies, the shortening ones do not truncate.
-let neverHasSideEffects = 1 in {
- def MOV_Fp3232 : FpIf32<(outs RFP32:$dst), (ins RFP32:$src), SpecialFP, []>;
- def MOV_Fp3264 : FpIf32<(outs RFP64:$dst), (ins RFP32:$src), SpecialFP, []>;
- def MOV_Fp6432 : FpIf32<(outs RFP32:$dst), (ins RFP64:$src), SpecialFP, []>;
- def MOV_Fp6464 : FpIf64<(outs RFP64:$dst), (ins RFP64:$src), SpecialFP, []>;
- def MOV_Fp8032 : FpIf32<(outs RFP32:$dst), (ins RFP80:$src), SpecialFP, []>;
- def MOV_Fp3280 : FpIf32<(outs RFP80:$dst), (ins RFP32:$src), SpecialFP, []>;
- def MOV_Fp8064 : FpIf64<(outs RFP64:$dst), (ins RFP80:$src), SpecialFP, []>;
- def MOV_Fp6480 : FpIf64<(outs RFP80:$dst), (ins RFP64:$src), SpecialFP, []>;
- def MOV_Fp8080 : FpI_ <(outs RFP80:$dst), (ins RFP80:$src), SpecialFP, []>;
-}
-
-// Factoring for arithmetic.
-multiclass FPBinary_rr<SDNode OpNode> {
-// Register op register -> register
-// These are separated out because they have no reversed form.
-def _Fp32 : FpIf32<(outs RFP32:$dst), (ins RFP32:$src1, RFP32:$src2), TwoArgFP,
- [(set RFP32:$dst, (OpNode RFP32:$src1, RFP32:$src2))]>;
-def _Fp64 : FpIf64<(outs RFP64:$dst), (ins RFP64:$src1, RFP64:$src2), TwoArgFP,
- [(set RFP64:$dst, (OpNode RFP64:$src1, RFP64:$src2))]>;
-def _Fp80 : FpI_<(outs RFP80:$dst), (ins RFP80:$src1, RFP80:$src2), TwoArgFP,
- [(set RFP80:$dst, (OpNode RFP80:$src1, RFP80:$src2))]>;
-}
-// The FopST0 series are not included here because of the irregularities
-// in where the 'r' goes in assembly output.
-// These instructions cannot address 80-bit memory.
-multiclass FPBinary<SDNode OpNode, Format fp, string asmstring> {
-// ST(0) = ST(0) + [mem]
-def _Fp32m : FpIf32<(outs RFP32:$dst), (ins RFP32:$src1, f32mem:$src2), OneArgFPRW,
- [(set RFP32:$dst,
- (OpNode RFP32:$src1, (loadf32 addr:$src2)))]>;
-def _Fp64m : FpIf64<(outs RFP64:$dst), (ins RFP64:$src1, f64mem:$src2), OneArgFPRW,
- [(set RFP64:$dst,
- (OpNode RFP64:$src1, (loadf64 addr:$src2)))]>;
-def _Fp64m32: FpIf64<(outs RFP64:$dst), (ins RFP64:$src1, f32mem:$src2), OneArgFPRW,
- [(set RFP64:$dst,
- (OpNode RFP64:$src1, (f64 (extloadf32 addr:$src2))))]>;
-def _Fp80m32: FpI_<(outs RFP80:$dst), (ins RFP80:$src1, f32mem:$src2), OneArgFPRW,
- [(set RFP80:$dst,
- (OpNode RFP80:$src1, (f80 (extloadf32 addr:$src2))))]>;
-def _Fp80m64: FpI_<(outs RFP80:$dst), (ins RFP80:$src1, f64mem:$src2), OneArgFPRW,
- [(set RFP80:$dst,
- (OpNode RFP80:$src1, (f80 (extloadf64 addr:$src2))))]>;
-def _F32m : FPI<0xD8, fp, (outs), (ins f32mem:$src),
- !strconcat("f", !strconcat(asmstring, "{s}\t$src"))> { let mayLoad = 1; }
-def _F64m : FPI<0xDC, fp, (outs), (ins f64mem:$src),
- !strconcat("f", !strconcat(asmstring, "{l}\t$src"))> { let mayLoad = 1; }
-// ST(0) = ST(0) + [memint]
-def _FpI16m32 : FpIf32<(outs RFP32:$dst), (ins RFP32:$src1, i16mem:$src2), OneArgFPRW,
- [(set RFP32:$dst, (OpNode RFP32:$src1,
- (X86fild addr:$src2, i16)))]>;
-def _FpI32m32 : FpIf32<(outs RFP32:$dst), (ins RFP32:$src1, i32mem:$src2), OneArgFPRW,
- [(set RFP32:$dst, (OpNode RFP32:$src1,
- (X86fild addr:$src2, i32)))]>;
-def _FpI16m64 : FpIf64<(outs RFP64:$dst), (ins RFP64:$src1, i16mem:$src2), OneArgFPRW,
- [(set RFP64:$dst, (OpNode RFP64:$src1,
- (X86fild addr:$src2, i16)))]>;
-def _FpI32m64 : FpIf64<(outs RFP64:$dst), (ins RFP64:$src1, i32mem:$src2), OneArgFPRW,
- [(set RFP64:$dst, (OpNode RFP64:$src1,
- (X86fild addr:$src2, i32)))]>;
-def _FpI16m80 : FpI_<(outs RFP80:$dst), (ins RFP80:$src1, i16mem:$src2), OneArgFPRW,
- [(set RFP80:$dst, (OpNode RFP80:$src1,
- (X86fild addr:$src2, i16)))]>;
-def _FpI32m80 : FpI_<(outs RFP80:$dst), (ins RFP80:$src1, i32mem:$src2), OneArgFPRW,
- [(set RFP80:$dst, (OpNode RFP80:$src1,
- (X86fild addr:$src2, i32)))]>;
-def _FI16m : FPI<0xDE, fp, (outs), (ins i16mem:$src),
- !strconcat("fi", !strconcat(asmstring, "{s}\t$src"))> { let mayLoad = 1; }
-def _FI32m : FPI<0xDA, fp, (outs), (ins i32mem:$src),
- !strconcat("fi", !strconcat(asmstring, "{l}\t$src"))> { let mayLoad = 1; }
-}
-
-defm ADD : FPBinary_rr<fadd>;
-defm SUB : FPBinary_rr<fsub>;
-defm MUL : FPBinary_rr<fmul>;
-defm DIV : FPBinary_rr<fdiv>;
-defm ADD : FPBinary<fadd, MRM0m, "add">;
-defm SUB : FPBinary<fsub, MRM4m, "sub">;
-defm SUBR: FPBinary<fsub ,MRM5m, "subr">;
-defm MUL : FPBinary<fmul, MRM1m, "mul">;
-defm DIV : FPBinary<fdiv, MRM6m, "div">;
-defm DIVR: FPBinary<fdiv, MRM7m, "divr">;
-
-class FPST0rInst<bits<8> o, string asm>
- : FPI<o, AddRegFrm, (outs), (ins RST:$op), asm>, D8;
-class FPrST0Inst<bits<8> o, string asm>
- : FPI<o, AddRegFrm, (outs), (ins RST:$op), asm>, DC;
-class FPrST0PInst<bits<8> o, string asm>
- : FPI<o, AddRegFrm, (outs), (ins RST:$op), asm>, DE;
-
-// NOTE: GAS and apparently all other AT&T style assemblers have a broken notion
-// of some of the 'reverse' forms of the fsub and fdiv instructions. As such,
-// we have to put some 'r's in and take them out of weird places.
-def ADD_FST0r : FPST0rInst <0xC0, "fadd\t$op">;
-def ADD_FrST0 : FPrST0Inst <0xC0, "fadd\t{%st(0), $op|$op, %ST(0)}">;
-def ADD_FPrST0 : FPrST0PInst<0xC0, "faddp\t$op">;
-def SUBR_FST0r : FPST0rInst <0xE8, "fsubr\t$op">;
-def SUB_FrST0 : FPrST0Inst <0xE8, "fsub{r}\t{%st(0), $op|$op, %ST(0)}">;
-def SUB_FPrST0 : FPrST0PInst<0xE8, "fsub{r}p\t$op">;
-def SUB_FST0r : FPST0rInst <0xE0, "fsub\t$op">;
-def SUBR_FrST0 : FPrST0Inst <0xE0, "fsub{|r}\t{%st(0), $op|$op, %ST(0)}">;
-def SUBR_FPrST0 : FPrST0PInst<0xE0, "fsub{|r}p\t$op">;
-def MUL_FST0r : FPST0rInst <0xC8, "fmul\t$op">;
-def MUL_FrST0 : FPrST0Inst <0xC8, "fmul\t{%st(0), $op|$op, %ST(0)}">;
-def MUL_FPrST0 : FPrST0PInst<0xC8, "fmulp\t$op">;
-def DIVR_FST0r : FPST0rInst <0xF8, "fdivr\t$op">;
-def DIV_FrST0 : FPrST0Inst <0xF8, "fdiv{r}\t{%st(0), $op|$op, %ST(0)}">;
-def DIV_FPrST0 : FPrST0PInst<0xF8, "fdiv{r}p\t$op">;
-def DIV_FST0r : FPST0rInst <0xF0, "fdiv\t$op">;
-def DIVR_FrST0 : FPrST0Inst <0xF0, "fdiv{|r}\t{%st(0), $op|$op, %ST(0)}">;
-def DIVR_FPrST0 : FPrST0PInst<0xF0, "fdiv{|r}p\t$op">;
-
-// Unary operations.
-multiclass FPUnary<SDNode OpNode, bits<8> opcode, string asmstring> {
-def _Fp32 : FpIf32<(outs RFP32:$dst), (ins RFP32:$src), OneArgFPRW,
- [(set RFP32:$dst, (OpNode RFP32:$src))]>;
-def _Fp64 : FpIf64<(outs RFP64:$dst), (ins RFP64:$src), OneArgFPRW,
- [(set RFP64:$dst, (OpNode RFP64:$src))]>;
-def _Fp80 : FpI_<(outs RFP80:$dst), (ins RFP80:$src), OneArgFPRW,
- [(set RFP80:$dst, (OpNode RFP80:$src))]>;
-def _F : FPI<opcode, RawFrm, (outs), (ins), asmstring>, D9;
-}
-
-defm CHS : FPUnary<fneg, 0xE0, "fchs">;
-defm ABS : FPUnary<fabs, 0xE1, "fabs">;
-defm SQRT: FPUnary<fsqrt,0xFA, "fsqrt">;
-defm SIN : FPUnary<fsin, 0xFE, "fsin">;
-defm COS : FPUnary<fcos, 0xFF, "fcos">;
-
-let neverHasSideEffects = 1 in {
-def TST_Fp32 : FpIf32<(outs), (ins RFP32:$src), OneArgFP, []>;
-def TST_Fp64 : FpIf64<(outs), (ins RFP64:$src), OneArgFP, []>;
-def TST_Fp80 : FpI_<(outs), (ins RFP80:$src), OneArgFP, []>;
-}
-def TST_F : FPI<0xE4, RawFrm, (outs), (ins), "ftst">, D9;
-
-// Floating point cmovs.
-multiclass FPCMov<PatLeaf cc> {
- def _Fp32 : FpIf32<(outs RFP32:$dst), (ins RFP32:$src1, RFP32:$src2),
- CondMovFP,
- [(set RFP32:$dst, (X86cmov RFP32:$src1, RFP32:$src2,
- cc, EFLAGS))]>;
- def _Fp64 : FpIf64<(outs RFP64:$dst), (ins RFP64:$src1, RFP64:$src2),
- CondMovFP,
- [(set RFP64:$dst, (X86cmov RFP64:$src1, RFP64:$src2,
- cc, EFLAGS))]>;
- def _Fp80 : FpI_<(outs RFP80:$dst), (ins RFP80:$src1, RFP80:$src2),
- CondMovFP,
- [(set RFP80:$dst, (X86cmov RFP80:$src1, RFP80:$src2,
- cc, EFLAGS))]>;
-}
-let Uses = [EFLAGS], isTwoAddress = 1 in {
-defm CMOVB : FPCMov<X86_COND_B>;
-defm CMOVBE : FPCMov<X86_COND_BE>;
-defm CMOVE : FPCMov<X86_COND_E>;
-defm CMOVP : FPCMov<X86_COND_P>;
-defm CMOVNB : FPCMov<X86_COND_AE>;
-defm CMOVNBE: FPCMov<X86_COND_A>;
-defm CMOVNE : FPCMov<X86_COND_NE>;
-defm CMOVNP : FPCMov<X86_COND_NP>;
-}
-
-// These are not factored because there's no clean way to pass DA/DB.
-def CMOVB_F : FPI<0xC0, AddRegFrm, (outs RST:$op), (ins),
- "fcmovb\t{$op, %st(0)|%ST(0), $op}">, DA;
-def CMOVBE_F : FPI<0xD0, AddRegFrm, (outs RST:$op), (ins),
- "fcmovbe\t{$op, %st(0)|%ST(0), $op}">, DA;
-def CMOVE_F : FPI<0xC8, AddRegFrm, (outs RST:$op), (ins),
- "fcmove\t{$op, %st(0)|%ST(0), $op}">, DA;
-def CMOVP_F : FPI<0xD8, AddRegFrm, (outs RST:$op), (ins),
- "fcmovu\t {$op, %st(0)|%ST(0), $op}">, DA;
-def CMOVNB_F : FPI<0xC0, AddRegFrm, (outs RST:$op), (ins),
- "fcmovnb\t{$op, %st(0)|%ST(0), $op}">, DB;
-def CMOVNBE_F: FPI<0xD0, AddRegFrm, (outs RST:$op), (ins),
- "fcmovnbe\t{$op, %st(0)|%ST(0), $op}">, DB;
-def CMOVNE_F : FPI<0xC8, AddRegFrm, (outs RST:$op), (ins),
- "fcmovne\t{$op, %st(0)|%ST(0), $op}">, DB;
-def CMOVNP_F : FPI<0xD8, AddRegFrm, (outs RST:$op), (ins),
- "fcmovnu\t{$op, %st(0)|%ST(0), $op}">, DB;
-
-// Floating point loads & stores.
-let isSimpleLoad = 1 in {
-def LD_Fp32m : FpIf32<(outs RFP32:$dst), (ins f32mem:$src), ZeroArgFP,
- [(set RFP32:$dst, (loadf32 addr:$src))]>;
-let isReMaterializable = 1, mayHaveSideEffects = 1 in
- def LD_Fp64m : FpIf64<(outs RFP64:$dst), (ins f64mem:$src), ZeroArgFP,
- [(set RFP64:$dst, (loadf64 addr:$src))]>;
-def LD_Fp80m : FpI_<(outs RFP80:$dst), (ins f80mem:$src), ZeroArgFP,
- [(set RFP80:$dst, (loadf80 addr:$src))]>;
-}
-def LD_Fp32m64 : FpIf64<(outs RFP64:$dst), (ins f32mem:$src), ZeroArgFP,
- [(set RFP64:$dst, (f64 (extloadf32 addr:$src)))]>;
-def LD_Fp64m80 : FpI_<(outs RFP80:$dst), (ins f64mem:$src), ZeroArgFP,
- [(set RFP80:$dst, (f80 (extloadf64 addr:$src)))]>;
-def LD_Fp32m80 : FpI_<(outs RFP80:$dst), (ins f32mem:$src), ZeroArgFP,
- [(set RFP80:$dst, (f80 (extloadf32 addr:$src)))]>;
-def ILD_Fp16m32: FpIf32<(outs RFP32:$dst), (ins i16mem:$src), ZeroArgFP,
- [(set RFP32:$dst, (X86fild addr:$src, i16))]>;
-def ILD_Fp32m32: FpIf32<(outs RFP32:$dst), (ins i32mem:$src), ZeroArgFP,
- [(set RFP32:$dst, (X86fild addr:$src, i32))]>;
-def ILD_Fp64m32: FpIf32<(outs RFP32:$dst), (ins i64mem:$src), ZeroArgFP,
- [(set RFP32:$dst, (X86fild addr:$src, i64))]>;
-def ILD_Fp16m64: FpIf64<(outs RFP64:$dst), (ins i16mem:$src), ZeroArgFP,
- [(set RFP64:$dst, (X86fild addr:$src, i16))]>;
-def ILD_Fp32m64: FpIf64<(outs RFP64:$dst), (ins i32mem:$src), ZeroArgFP,
- [(set RFP64:$dst, (X86fild addr:$src, i32))]>;
-def ILD_Fp64m64: FpIf64<(outs RFP64:$dst), (ins i64mem:$src), ZeroArgFP,
- [(set RFP64:$dst, (X86fild addr:$src, i64))]>;
-def ILD_Fp16m80: FpI_<(outs RFP80:$dst), (ins i16mem:$src), ZeroArgFP,
- [(set RFP80:$dst, (X86fild addr:$src, i16))]>;
-def ILD_Fp32m80: FpI_<(outs RFP80:$dst), (ins i32mem:$src), ZeroArgFP,
- [(set RFP80:$dst, (X86fild addr:$src, i32))]>;
-def ILD_Fp64m80: FpI_<(outs RFP80:$dst), (ins i64mem:$src), ZeroArgFP,
- [(set RFP80:$dst, (X86fild addr:$src, i64))]>;
-
-def ST_Fp32m : FpIf32<(outs), (ins f32mem:$op, RFP32:$src), OneArgFP,
- [(store RFP32:$src, addr:$op)]>;
-def ST_Fp64m32 : FpIf64<(outs), (ins f32mem:$op, RFP64:$src), OneArgFP,
- [(truncstoref32 RFP64:$src, addr:$op)]>;
-def ST_Fp64m : FpIf64<(outs), (ins f64mem:$op, RFP64:$src), OneArgFP,
- [(store RFP64:$src, addr:$op)]>;
-def ST_Fp80m32 : FpI_<(outs), (ins f32mem:$op, RFP80:$src), OneArgFP,
- [(truncstoref32 RFP80:$src, addr:$op)]>;
-def ST_Fp80m64 : FpI_<(outs), (ins f64mem:$op, RFP80:$src), OneArgFP,
- [(truncstoref64 RFP80:$src, addr:$op)]>;
-// FST does not support 80-bit memory target; FSTP must be used.
-
-let mayStore = 1, neverHasSideEffects = 1 in {
-def ST_FpP32m : FpIf32<(outs), (ins f32mem:$op, RFP32:$src), OneArgFP, []>;
-def ST_FpP64m32 : FpIf64<(outs), (ins f32mem:$op, RFP64:$src), OneArgFP, []>;
-def ST_FpP64m : FpIf64<(outs), (ins f64mem:$op, RFP64:$src), OneArgFP, []>;
-def ST_FpP80m32 : FpI_<(outs), (ins f32mem:$op, RFP80:$src), OneArgFP, []>;
-def ST_FpP80m64 : FpI_<(outs), (ins f64mem:$op, RFP80:$src), OneArgFP, []>;
-}
-def ST_FpP80m : FpI_<(outs), (ins f80mem:$op, RFP80:$src), OneArgFP,
- [(store RFP80:$src, addr:$op)]>;
-let mayStore = 1, neverHasSideEffects = 1 in {
-def IST_Fp16m32 : FpIf32<(outs), (ins i16mem:$op, RFP32:$src), OneArgFP, []>;
-def IST_Fp32m32 : FpIf32<(outs), (ins i32mem:$op, RFP32:$src), OneArgFP, []>;
-def IST_Fp64m32 : FpIf32<(outs), (ins i64mem:$op, RFP32:$src), OneArgFP, []>;
-def IST_Fp16m64 : FpIf64<(outs), (ins i16mem:$op, RFP64:$src), OneArgFP, []>;
-def IST_Fp32m64 : FpIf64<(outs), (ins i32mem:$op, RFP64:$src), OneArgFP, []>;
-def IST_Fp64m64 : FpIf64<(outs), (ins i64mem:$op, RFP64:$src), OneArgFP, []>;
-def IST_Fp16m80 : FpI_<(outs), (ins i16mem:$op, RFP80:$src), OneArgFP, []>;
-def IST_Fp32m80 : FpI_<(outs), (ins i32mem:$op, RFP80:$src), OneArgFP, []>;
-def IST_Fp64m80 : FpI_<(outs), (ins i64mem:$op, RFP80:$src), OneArgFP, []>;
-}
-
-let mayLoad = 1 in {
-def LD_F32m : FPI<0xD9, MRM0m, (outs), (ins f32mem:$src), "fld{s}\t$src">;
-def LD_F64m : FPI<0xDD, MRM0m, (outs), (ins f64mem:$src), "fld{l}\t$src">;
-def LD_F80m : FPI<0xDB, MRM5m, (outs), (ins f80mem:$src), "fld{t}\t$src">;
-def ILD_F16m : FPI<0xDF, MRM0m, (outs), (ins i16mem:$src), "fild{s}\t$src">;
-def ILD_F32m : FPI<0xDB, MRM0m, (outs), (ins i32mem:$src), "fild{l}\t$src">;
-def ILD_F64m : FPI<0xDF, MRM5m, (outs), (ins i64mem:$src), "fild{ll}\t$src">;
-}
-let mayStore = 1 in {
-def ST_F32m : FPI<0xD9, MRM2m, (outs), (ins f32mem:$dst), "fst{s}\t$dst">;
-def ST_F64m : FPI<0xDD, MRM2m, (outs), (ins f64mem:$dst), "fst{l}\t$dst">;
-def ST_FP32m : FPI<0xD9, MRM3m, (outs), (ins f32mem:$dst), "fstp{s}\t$dst">;
-def ST_FP64m : FPI<0xDD, MRM3m, (outs), (ins f64mem:$dst), "fstp{l}\t$dst">;
-def ST_FP80m : FPI<0xDB, MRM7m, (outs), (ins f80mem:$dst), "fstp{t}\t$dst">;
-def IST_F16m : FPI<0xDF, MRM2m, (outs), (ins i16mem:$dst), "fist{s}\t$dst">;
-def IST_F32m : FPI<0xDB, MRM2m, (outs), (ins i32mem:$dst), "fist{l}\t$dst">;
-def IST_FP16m : FPI<0xDF, MRM3m, (outs), (ins i16mem:$dst), "fistp{s}\t$dst">;
-def IST_FP32m : FPI<0xDB, MRM3m, (outs), (ins i32mem:$dst), "fistp{l}\t$dst">;
-def IST_FP64m : FPI<0xDF, MRM7m, (outs), (ins i64mem:$dst), "fistp{ll}\t$dst">;
-}
-
-// FISTTP requires SSE3 even though it's a FPStack op.
-def ISTT_Fp16m32 : FpI_<(outs), (ins i16mem:$op, RFP32:$src), OneArgFP,
- [(X86fp_to_i16mem RFP32:$src, addr:$op)]>,
- Requires<[HasSSE3]>;
-def ISTT_Fp32m32 : FpI_<(outs), (ins i32mem:$op, RFP32:$src), OneArgFP,
- [(X86fp_to_i32mem RFP32:$src, addr:$op)]>,
- Requires<[HasSSE3]>;
-def ISTT_Fp64m32 : FpI_<(outs), (ins i64mem:$op, RFP32:$src), OneArgFP,
- [(X86fp_to_i64mem RFP32:$src, addr:$op)]>,
- Requires<[HasSSE3]>;
-def ISTT_Fp16m64 : FpI_<(outs), (ins i16mem:$op, RFP64:$src), OneArgFP,
- [(X86fp_to_i16mem RFP64:$src, addr:$op)]>,
- Requires<[HasSSE3]>;
-def ISTT_Fp32m64 : FpI_<(outs), (ins i32mem:$op, RFP64:$src), OneArgFP,
- [(X86fp_to_i32mem RFP64:$src, addr:$op)]>,
- Requires<[HasSSE3]>;
-def ISTT_Fp64m64 : FpI_<(outs), (ins i64mem:$op, RFP64:$src), OneArgFP,
- [(X86fp_to_i64mem RFP64:$src, addr:$op)]>,
- Requires<[HasSSE3]>;
-def ISTT_Fp16m80 : FpI_<(outs), (ins i16mem:$op, RFP80:$src), OneArgFP,
- [(X86fp_to_i16mem RFP80:$src, addr:$op)]>,
- Requires<[HasSSE3]>;
-def ISTT_Fp32m80 : FpI_<(outs), (ins i32mem:$op, RFP80:$src), OneArgFP,
- [(X86fp_to_i32mem RFP80:$src, addr:$op)]>,
- Requires<[HasSSE3]>;
-def ISTT_Fp64m80 : FpI_<(outs), (ins i64mem:$op, RFP80:$src), OneArgFP,
- [(X86fp_to_i64mem RFP80:$src, addr:$op)]>,
- Requires<[HasSSE3]>;
-
-let mayStore = 1 in {
-def ISTT_FP16m : FPI<0xDF, MRM1m, (outs), (ins i16mem:$dst), "fisttp{s}\t$dst">;
-def ISTT_FP32m : FPI<0xDB, MRM1m, (outs), (ins i32mem:$dst), "fisttp{l}\t$dst">;
-def ISTT_FP64m : FPI<0xDD, MRM1m, (outs), (ins i64mem:$dst), "fisttp{ll}\t$dst">;
-}
-
-// FP Stack manipulation instructions.
-def LD_Frr : FPI<0xC0, AddRegFrm, (outs), (ins RST:$op), "fld\t$op">, D9;
-def ST_Frr : FPI<0xD0, AddRegFrm, (outs), (ins RST:$op), "fst\t$op">, DD;
-def ST_FPrr : FPI<0xD8, AddRegFrm, (outs), (ins RST:$op), "fstp\t$op">, DD;
-def XCH_F : FPI<0xC8, AddRegFrm, (outs), (ins RST:$op), "fxch\t$op">, D9;
-
-// Floating point constant loads.
-let isReMaterializable = 1 in {
-def LD_Fp032 : FpIf32<(outs RFP32:$dst), (ins), ZeroArgFP,
- [(set RFP32:$dst, fpimm0)]>;
-def LD_Fp132 : FpIf32<(outs RFP32:$dst), (ins), ZeroArgFP,
- [(set RFP32:$dst, fpimm1)]>;
-def LD_Fp064 : FpIf64<(outs RFP64:$dst), (ins), ZeroArgFP,
- [(set RFP64:$dst, fpimm0)]>;
-def LD_Fp164 : FpIf64<(outs RFP64:$dst), (ins), ZeroArgFP,
- [(set RFP64:$dst, fpimm1)]>;
-def LD_Fp080 : FpI_<(outs RFP80:$dst), (ins), ZeroArgFP,
- [(set RFP80:$dst, fpimm0)]>;
-def LD_Fp180 : FpI_<(outs RFP80:$dst), (ins), ZeroArgFP,
- [(set RFP80:$dst, fpimm1)]>;
-}
-
-def LD_F0 : FPI<0xEE, RawFrm, (outs), (ins), "fldz">, D9;
-def LD_F1 : FPI<0xE8, RawFrm, (outs), (ins), "fld1">, D9;
-
-
-// Floating point compares.
-let Defs = [EFLAGS] in {
-def UCOM_Fpr32 : FpIf32<(outs), (ins RFP32:$lhs, RFP32:$rhs), CompareFP,
- []>; // FPSW = cmp ST(0) with ST(i)
-def UCOM_Fpr64 : FpIf64<(outs), (ins RFP64:$lhs, RFP64:$rhs), CompareFP,
- []>; // FPSW = cmp ST(0) with ST(i)
-def UCOM_Fpr80 : FpI_ <(outs), (ins RFP80:$lhs, RFP80:$rhs), CompareFP,
- []>; // FPSW = cmp ST(0) with ST(i)
-
-def UCOM_FpIr32: FpIf32<(outs), (ins RFP32:$lhs, RFP32:$rhs), CompareFP,
- [(X86cmp RFP32:$lhs, RFP32:$rhs),
- (implicit EFLAGS)]>; // CC = ST(0) cmp ST(i)
-def UCOM_FpIr64: FpIf64<(outs), (ins RFP64:$lhs, RFP64:$rhs), CompareFP,
- [(X86cmp RFP64:$lhs, RFP64:$rhs),
- (implicit EFLAGS)]>; // CC = ST(0) cmp ST(i)
-def UCOM_FpIr80: FpI_<(outs), (ins RFP80:$lhs, RFP80:$rhs), CompareFP,
- [(X86cmp RFP80:$lhs, RFP80:$rhs),
- (implicit EFLAGS)]>; // CC = ST(0) cmp ST(i)
-}
-
-let Defs = [EFLAGS], Uses = [ST0] in {
-def UCOM_Fr : FPI<0xE0, AddRegFrm, // FPSW = cmp ST(0) with ST(i)
- (outs), (ins RST:$reg),
- "fucom\t$reg">, DD;
-def UCOM_FPr : FPI<0xE8, AddRegFrm, // FPSW = cmp ST(0) with ST(i), pop
- (outs), (ins RST:$reg),
- "fucomp\t$reg">, DD;
-def UCOM_FPPr : FPI<0xE9, RawFrm, // cmp ST(0) with ST(1), pop, pop
- (outs), (ins),
- "fucompp">, DA;
-
-def UCOM_FIr : FPI<0xE8, AddRegFrm, // CC = cmp ST(0) with ST(i)
- (outs), (ins RST:$reg),
- "fucomi\t{$reg, %st(0)|%ST(0), $reg}">, DB;
-def UCOM_FIPr : FPI<0xE8, AddRegFrm, // CC = cmp ST(0) with ST(i), pop
- (outs), (ins RST:$reg),
- "fucomip\t{$reg, %st(0)|%ST(0), $reg}">, DF;
-}
-
-// Floating point flag ops.
-let Defs = [AX] in
-def FNSTSW8r : I<0xE0, RawFrm, // AX = fp flags
- (outs), (ins), "fnstsw", []>, DF;
-
-def FNSTCW16m : I<0xD9, MRM7m, // [mem16] = X87 control world
- (outs), (ins i16mem:$dst), "fnstcw\t$dst",
- [(X86fp_cwd_get16 addr:$dst)]>;
-
-let mayLoad = 1 in
-def FLDCW16m : I<0xD9, MRM5m, // X87 control world = [mem16]
- (outs), (ins i16mem:$dst), "fldcw\t$dst", []>;
-
-//===----------------------------------------------------------------------===//
-// Non-Instruction Patterns
-//===----------------------------------------------------------------------===//
-
-// Required for RET of f32 / f64 / f80 values.
-def : Pat<(X86fld addr:$src, f32), (LD_Fp32m addr:$src)>;
-def : Pat<(X86fld addr:$src, f64), (LD_Fp64m addr:$src)>;
-def : Pat<(X86fld addr:$src, f80), (LD_Fp80m addr:$src)>;
-
-// Required for CALL which return f32 / f64 / f80 values.
-def : Pat<(X86fst RFP32:$src, addr:$op, f32), (ST_Fp32m addr:$op, RFP32:$src)>;
-def : Pat<(X86fst RFP64:$src, addr:$op, f32), (ST_Fp64m32 addr:$op, RFP64:$src)>;
-def : Pat<(X86fst RFP64:$src, addr:$op, f64), (ST_Fp64m addr:$op, RFP64:$src)>;
-def : Pat<(X86fst RFP80:$src, addr:$op, f32), (ST_Fp80m32 addr:$op, RFP80:$src)>;
-def : Pat<(X86fst RFP80:$src, addr:$op, f64), (ST_Fp80m64 addr:$op, RFP80:$src)>;
-def : Pat<(X86fst RFP80:$src, addr:$op, f80), (ST_FpP80m addr:$op, RFP80:$src)>;
-
-// Floating point constant -0.0 and -1.0
-def : Pat<(f32 fpimmneg0), (CHS_Fp32 (LD_Fp032))>, Requires<[FPStackf32]>;
-def : Pat<(f32 fpimmneg1), (CHS_Fp32 (LD_Fp132))>, Requires<[FPStackf32]>;
-def : Pat<(f64 fpimmneg0), (CHS_Fp64 (LD_Fp064))>, Requires<[FPStackf64]>;
-def : Pat<(f64 fpimmneg1), (CHS_Fp64 (LD_Fp164))>, Requires<[FPStackf64]>;
-def : Pat<(f80 fpimmneg0), (CHS_Fp80 (LD_Fp080))>;
-def : Pat<(f80 fpimmneg1), (CHS_Fp80 (LD_Fp180))>;
-
-// Used to conv. i64 to f64 since there isn't a SSE version.
-def : Pat<(X86fildflag addr:$src, i64), (ILD_Fp64m64 addr:$src)>;
-
-// FP extensions map onto simple pseudo-value conversions if they are to/from
-// the FP stack.
-def : Pat<(f64 (fextend RFP32:$src)), (MOV_Fp3264 RFP32:$src)>,
- Requires<[FPStackf32]>;
-def : Pat<(f80 (fextend RFP32:$src)), (MOV_Fp3280 RFP32:$src)>,
- Requires<[FPStackf32]>;
-def : Pat<(f80 (fextend RFP64:$src)), (MOV_Fp6480 RFP64:$src)>,
- Requires<[FPStackf64]>;
-
-// FP truncations map onto simple pseudo-value conversions if they are to/from
-// the FP stack. We have validated that only value-preserving truncations make
-// it through isel.
-def : Pat<(f32 (fround RFP64:$src)), (MOV_Fp6432 RFP64:$src)>,
- Requires<[FPStackf32]>;
-def : Pat<(f32 (fround RFP80:$src)), (MOV_Fp8032 RFP80:$src)>,
- Requires<[FPStackf32]>;
-def : Pat<(f64 (fround RFP80:$src)), (MOV_Fp8064 RFP80:$src)>,
- Requires<[FPStackf64]>;
diff --git a/release_23/lib/Target/X86/X86InstrFormats.td b/release_23/lib/Target/X86/X86InstrFormats.td
deleted file mode 100644
index 8d098f12ae22..000000000000
--- a/release_23/lib/Target/X86/X86InstrFormats.td
+++ /dev/null
@@ -1,269 +0,0 @@
-//===- X86InstrFormats.td - X86 Instruction Formats --------*- tablegen -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-//===----------------------------------------------------------------------===//
-// X86 Instruction Format Definitions.
-//
-
-// Format specifies the encoding used by the instruction. This is part of the
-// ad-hoc solution used to emit machine instruction encodings by our machine
-// code emitter.
-class Format<bits<6> val> {
- bits<6> Value = val;
-}
-
-def Pseudo : Format<0>; def RawFrm : Format<1>;
-def AddRegFrm : Format<2>; def MRMDestReg : Format<3>;
-def MRMDestMem : Format<4>; def MRMSrcReg : Format<5>;
-def MRMSrcMem : Format<6>;
-def MRM0r : Format<16>; def MRM1r : Format<17>; def MRM2r : Format<18>;
-def MRM3r : Format<19>; def MRM4r : Format<20>; def MRM5r : Format<21>;
-def MRM6r : Format<22>; def MRM7r : Format<23>;
-def MRM0m : Format<24>; def MRM1m : Format<25>; def MRM2m : Format<26>;
-def MRM3m : Format<27>; def MRM4m : Format<28>; def MRM5m : Format<29>;
-def MRM6m : Format<30>; def MRM7m : Format<31>;
-def MRMInitReg : Format<32>;
-
-
-// ImmType - This specifies the immediate type used by an instruction. This is
-// part of the ad-hoc solution used to emit machine instruction encodings by our
-// machine code emitter.
-class ImmType<bits<3> val> {
- bits<3> Value = val;
-}
-def NoImm : ImmType<0>;
-def Imm8 : ImmType<1>;
-def Imm16 : ImmType<2>;
-def Imm32 : ImmType<3>;
-def Imm64 : ImmType<4>;
-
-// FPFormat - This specifies what form this FP instruction has. This is used by
-// the Floating-Point stackifier pass.
-class FPFormat<bits<3> val> {
- bits<3> Value = val;
-}
-def NotFP : FPFormat<0>;
-def ZeroArgFP : FPFormat<1>;
-def OneArgFP : FPFormat<2>;
-def OneArgFPRW : FPFormat<3>;
-def TwoArgFP : FPFormat<4>;
-def CompareFP : FPFormat<5>;
-def CondMovFP : FPFormat<6>;
-def SpecialFP : FPFormat<7>;
-
-// Prefix byte classes which are used to indicate to the ad-hoc machine code
-// emitter that various prefix bytes are required.
-class OpSize { bit hasOpSizePrefix = 1; }
-class AdSize { bit hasAdSizePrefix = 1; }
-class REX_W { bit hasREX_WPrefix = 1; }
-class LOCK { bit hasLockPrefix = 1; }
-class TB { bits<4> Prefix = 1; }
-class REP { bits<4> Prefix = 2; }
-class D8 { bits<4> Prefix = 3; }
-class D9 { bits<4> Prefix = 4; }
-class DA { bits<4> Prefix = 5; }
-class DB { bits<4> Prefix = 6; }
-class DC { bits<4> Prefix = 7; }
-class DD { bits<4> Prefix = 8; }
-class DE { bits<4> Prefix = 9; }
-class DF { bits<4> Prefix = 10; }
-class XD { bits<4> Prefix = 11; }
-class XS { bits<4> Prefix = 12; }
-class T8 { bits<4> Prefix = 13; }
-class TA { bits<4> Prefix = 14; }
-
-class X86Inst<bits<8> opcod, Format f, ImmType i, dag outs, dag ins,
- string AsmStr>
- : Instruction {
- let Namespace = "X86";
-
- bits<8> Opcode = opcod;
- Format Form = f;
- bits<6> FormBits = Form.Value;
- ImmType ImmT = i;
- bits<3> ImmTypeBits = ImmT.Value;
-
- dag OutOperandList = outs;
- dag InOperandList = ins;
- string AsmString = AsmStr;
-
- //
- // Attributes specific to X86 instructions...
- //
- bit hasOpSizePrefix = 0; // Does this inst have a 0x66 prefix?
- bit hasAdSizePrefix = 0; // Does this inst have a 0x67 prefix?
-
- bits<4> Prefix = 0; // Which prefix byte does this inst have?
- bit hasREX_WPrefix = 0; // Does this inst requires the REX.W prefix?
- FPFormat FPForm; // What flavor of FP instruction is this?
- bits<3> FPFormBits = 0;
- bit hasLockPrefix = 0; // Does this inst have a 0xF0 prefix?
-}
-
-class I<bits<8> o, Format f, dag outs, dag ins, string asm, list<dag> pattern>
- : X86Inst<o, f, NoImm, outs, ins, asm> {
- let Pattern = pattern;
- let CodeSize = 3;
-}
-class Ii8 <bits<8> o, Format f, dag outs, dag ins, string asm, list<dag> pattern>
- : X86Inst<o, f, Imm8 , outs, ins, asm> {
- let Pattern = pattern;
- let CodeSize = 3;
-}
-class Ii16<bits<8> o, Format f, dag outs, dag ins, string asm, list<dag> pattern>
- : X86Inst<o, f, Imm16, outs, ins, asm> {
- let Pattern = pattern;
- let CodeSize = 3;
-}
-class Ii32<bits<8> o, Format f, dag outs, dag ins, string asm, list<dag> pattern>
- : X86Inst<o, f, Imm32, outs, ins, asm> {
- let Pattern = pattern;
- let CodeSize = 3;
-}
-
-// FPStack Instruction Templates:
-// FPI - Floating Point Instruction template.
-class FPI<bits<8> o, Format F, dag outs, dag ins, string asm>
- : I<o, F, outs, ins, asm, []> {}
-
-// FpI_ - Floating Point Psuedo Instruction template. Not Predicated.
-class FpI_<dag outs, dag ins, FPFormat fp, list<dag> pattern>
- : X86Inst<0, Pseudo, NoImm, outs, ins, ""> {
- let FPForm = fp; let FPFormBits = FPForm.Value;
- let Pattern = pattern;
-}
-
-// SSE1 Instruction Templates:
-//
-// SSI - SSE1 instructions with XS prefix.
-// PSI - SSE1 instructions with TB prefix.
-// PSIi8 - SSE1 instructions with ImmT == Imm8 and TB prefix.
-
-class SSI<bits<8> o, Format F, dag outs, dag ins, string asm, list<dag> pattern>
- : I<o, F, outs, ins, asm, pattern>, XS, Requires<[HasSSE1]>;
-class SSIi8<bits<8> o, Format F, dag outs, dag ins, string asm, list<dag> pattern>
- : Ii8<o, F, outs, ins, asm, pattern>, XS, Requires<[HasSSE1]>;
-class PSI<bits<8> o, Format F, dag outs, dag ins, string asm, list<dag> pattern>
- : I<o, F, outs, ins, asm, pattern>, TB, Requires<[HasSSE1]>;
-class PSIi8<bits<8> o, Format F, dag outs, dag ins, string asm,
- list<dag> pattern>
- : Ii8<o, F, outs, ins, asm, pattern>, TB, Requires<[HasSSE1]>;
-
-// SSE2 Instruction Templates:
-//
-// SDI - SSE2 instructions with XD prefix.
-// SDIi8 - SSE2 instructions with ImmT == Imm8 and XD prefix.
-// PDI - SSE2 instructions with TB and OpSize prefixes.
-// PDIi8 - SSE2 instructions with ImmT == Imm8 and TB and OpSize prefixes.
-
-class SDI<bits<8> o, Format F, dag outs, dag ins, string asm, list<dag> pattern>
- : I<o, F, outs, ins, asm, pattern>, XD, Requires<[HasSSE2]>;
-class SDIi8<bits<8> o, Format F, dag outs, dag ins, string asm,
- list<dag> pattern>
- : Ii8<o, F, outs, ins, asm, pattern>, XD, Requires<[HasSSE2]>;
-class PDI<bits<8> o, Format F, dag outs, dag ins, string asm, list<dag> pattern>
- : I<o, F, outs, ins, asm, pattern>, TB, OpSize, Requires<[HasSSE2]>;
-class PDIi8<bits<8> o, Format F, dag outs, dag ins, string asm,
- list<dag> pattern>
- : Ii8<o, F, outs, ins, asm, pattern>, TB, OpSize, Requires<[HasSSE2]>;
-
-// SSE3 Instruction Templates:
-//
-// S3I - SSE3 instructions with TB and OpSize prefixes.
-// S3SI - SSE3 instructions with XS prefix.
-// S3DI - SSE3 instructions with XD prefix.
-
-class S3SI<bits<8> o, Format F, dag outs, dag ins, string asm, list<dag> pattern>
- : I<o, F, outs, ins, asm, pattern>, XS, Requires<[HasSSE3]>;
-class S3DI<bits<8> o, Format F, dag outs, dag ins, string asm, list<dag> pattern>
- : I<o, F, outs, ins, asm, pattern>, XD, Requires<[HasSSE3]>;
-class S3I<bits<8> o, Format F, dag outs, dag ins, string asm, list<dag> pattern>
- : I<o, F, outs, ins, asm, pattern>, TB, OpSize, Requires<[HasSSE3]>;
-
-
-// SSSE3 Instruction Templates:
-//
-// SS38I - SSSE3 instructions with T8 prefix.
-// SS3AI - SSSE3 instructions with TA prefix.
-//
-// Note: SSSE3 instructions have 64-bit and 128-bit versions. The 64-bit version
-// uses the MMX registers. We put those instructions here because they better
-// fit into the SSSE3 instruction category rather than the MMX category.
-
-class SS38I<bits<8> o, Format F, dag outs, dag ins, string asm,
- list<dag> pattern>
- : I<o, F, outs, ins, asm, pattern>, T8, Requires<[HasSSSE3]>;
-class SS3AI<bits<8> o, Format F, dag outs, dag ins, string asm,
- list<dag> pattern>
- : I<o, F, outs, ins, asm, pattern>, TA, Requires<[HasSSSE3]>;
-
-// SSE4.1 Instruction Templates:
-//
-// SS48I - SSE 4.1 instructions with T8 prefix.
-// SS41AIi8 - SSE 4.1 instructions with TA prefix and ImmT == Imm8.
-//
-class SS48I<bits<8> o, Format F, dag outs, dag ins, string asm,
- list<dag> pattern>
- : I<o, F, outs, ins, asm, pattern>, T8, Requires<[HasSSE41]>;
-class SS4AIi8<bits<8> o, Format F, dag outs, dag ins, string asm,
- list<dag> pattern>
- : Ii8<o, F, outs, ins, asm, pattern>, TA, Requires<[HasSSE41]>;
-
-
-// X86-64 Instruction templates...
-//
-
-class RI<bits<8> o, Format F, dag outs, dag ins, string asm, list<dag> pattern>
- : I<o, F, outs, ins, asm, pattern>, REX_W;
-class RIi8 <bits<8> o, Format F, dag outs, dag ins, string asm,
- list<dag> pattern>
- : Ii8<o, F, outs, ins, asm, pattern>, REX_W;
-class RIi32 <bits<8> o, Format F, dag outs, dag ins, string asm,
- list<dag> pattern>
- : Ii32<o, F, outs, ins, asm, pattern>, REX_W;
-
-class RIi64<bits<8> o, Format f, dag outs, dag ins, string asm,
- list<dag> pattern>
- : X86Inst<o, f, Imm64, outs, ins, asm>, REX_W {
- let Pattern = pattern;
- let CodeSize = 3;
-}
-
-class RSSI<bits<8> o, Format F, dag outs, dag ins, string asm,
- list<dag> pattern>
- : SSI<o, F, outs, ins, asm, pattern>, REX_W;
-class RSDI<bits<8> o, Format F, dag outs, dag ins, string asm,
- list<dag> pattern>
- : SDI<o, F, outs, ins, asm, pattern>, REX_W;
-class RPDI<bits<8> o, Format F, dag outs, dag ins, string asm,
- list<dag> pattern>
- : PDI<o, F, outs, ins, asm, pattern>, REX_W;
-
-// MMX Instruction templates
-//
-
-// MMXI - MMX instructions with TB prefix.
-// MMX2I - MMX / SSE2 instructions with TB and OpSize prefixes.
-// MMXIi8 - MMX instructions with ImmT == Imm8 and TB prefix.
-// MMXIi8 - MMX instructions with ImmT == Imm8 and TB prefix.
-// MMXID - MMX instructions with XD prefix.
-// MMXIS - MMX instructions with XS prefix.
-class MMXI<bits<8> o, Format F, dag outs, dag ins, string asm, list<dag> pattern>
- : I<o, F, outs, ins, asm, pattern>, TB, Requires<[HasMMX]>;
-class MMXRI<bits<8> o, Format F, dag outs, dag ins, string asm, list<dag> pattern>
- : I<o, F, outs, ins, asm, pattern>, TB, REX_W, Requires<[HasMMX]>;
-class MMX2I<bits<8> o, Format F, dag outs, dag ins, string asm, list<dag> pattern>
- : I<o, F, outs, ins, asm, pattern>, TB, OpSize, Requires<[HasMMX]>;
-class MMXIi8<bits<8> o, Format F, dag outs, dag ins, string asm, list<dag> pattern>
- : Ii8<o, F, outs, ins, asm, pattern>, TB, Requires<[HasMMX]>;
-class MMXID<bits<8> o, Format F, dag outs, dag ins, string asm, list<dag> pattern>
- : Ii8<o, F, outs, ins, asm, pattern>, XD, Requires<[HasMMX]>;
-class MMXIS<bits<8> o, Format F, dag outs, dag ins, string asm, list<dag> pattern>
- : Ii8<o, F, outs, ins, asm, pattern>, XS, Requires<[HasMMX]>;
-
diff --git a/release_23/lib/Target/X86/X86InstrInfo.cpp b/release_23/lib/Target/X86/X86InstrInfo.cpp
deleted file mode 100644
index 8b31f5d5f098..000000000000
--- a/release_23/lib/Target/X86/X86InstrInfo.cpp
+++ /dev/null
@@ -1,2828 +0,0 @@
-//===- X86InstrInfo.cpp - X86 Instruction Information -----------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains the X86 implementation of the TargetInstrInfo class.
-//
-//===----------------------------------------------------------------------===//
-
-#include "X86InstrInfo.h"
-#include "X86.h"
-#include "X86GenInstrInfo.inc"
-#include "X86InstrBuilder.h"
-#include "X86MachineFunctionInfo.h"
-#include "X86Subtarget.h"
-#include "X86TargetMachine.h"
-#include "llvm/ADT/STLExtras.h"
-#include "llvm/CodeGen/MachineFrameInfo.h"
-#include "llvm/CodeGen/MachineInstrBuilder.h"
-#include "llvm/CodeGen/MachineRegisterInfo.h"
-#include "llvm/CodeGen/LiveVariables.h"
-#include "llvm/Support/CommandLine.h"
-#include "llvm/Target/TargetOptions.h"
-#include "llvm/Target/TargetAsmInfo.h"
-
-using namespace llvm;
-
-namespace {
- cl::opt<bool>
- NoFusing("disable-spill-fusing",
- cl::desc("Disable fusing of spill code into instructions"));
- cl::opt<bool>
- PrintFailedFusing("print-failed-fuse-candidates",
- cl::desc("Print instructions that the allocator wants to"
- " fuse, but the X86 backend currently can't"),
- cl::Hidden);
- cl::opt<bool>
- ReMatPICStubLoad("remat-pic-stub-load",
- cl::desc("Re-materialize load from stub in PIC mode"),
- cl::init(false), cl::Hidden);
-}
-
-X86InstrInfo::X86InstrInfo(X86TargetMachine &tm)
- : TargetInstrInfoImpl(X86Insts, array_lengthof(X86Insts)),
- TM(tm), RI(tm, *this) {
- SmallVector<unsigned,16> AmbEntries;
- static const unsigned OpTbl2Addr[][2] = {
- { X86::ADC32ri, X86::ADC32mi },
- { X86::ADC32ri8, X86::ADC32mi8 },
- { X86::ADC32rr, X86::ADC32mr },
- { X86::ADC64ri32, X86::ADC64mi32 },
- { X86::ADC64ri8, X86::ADC64mi8 },
- { X86::ADC64rr, X86::ADC64mr },
- { X86::ADD16ri, X86::ADD16mi },
- { X86::ADD16ri8, X86::ADD16mi8 },
- { X86::ADD16rr, X86::ADD16mr },
- { X86::ADD32ri, X86::ADD32mi },
- { X86::ADD32ri8, X86::ADD32mi8 },
- { X86::ADD32rr, X86::ADD32mr },
- { X86::ADD64ri32, X86::ADD64mi32 },
- { X86::ADD64ri8, X86::ADD64mi8 },
- { X86::ADD64rr, X86::ADD64mr },
- { X86::ADD8ri, X86::ADD8mi },
- { X86::ADD8rr, X86::ADD8mr },
- { X86::AND16ri, X86::AND16mi },
- { X86::AND16ri8, X86::AND16mi8 },
- { X86::AND16rr, X86::AND16mr },
- { X86::AND32ri, X86::AND32mi },
- { X86::AND32ri8, X86::AND32mi8 },
- { X86::AND32rr, X86::AND32mr },
- { X86::AND64ri32, X86::AND64mi32 },
- { X86::AND64ri8, X86::AND64mi8 },
- { X86::AND64rr, X86::AND64mr },
- { X86::AND8ri, X86::AND8mi },
- { X86::AND8rr, X86::AND8mr },
- { X86::DEC16r, X86::DEC16m },
- { X86::DEC32r, X86::DEC32m },
- { X86::DEC64_16r, X86::DEC64_16m },
- { X86::DEC64_32r, X86::DEC64_32m },
- { X86::DEC64r, X86::DEC64m },
- { X86::DEC8r, X86::DEC8m },
- { X86::INC16r, X86::INC16m },
- { X86::INC32r, X86::INC32m },
- { X86::INC64_16r, X86::INC64_16m },
- { X86::INC64_32r, X86::INC64_32m },
- { X86::INC64r, X86::INC64m },
- { X86::INC8r, X86::INC8m },
- { X86::NEG16r, X86::NEG16m },
- { X86::NEG32r, X86::NEG32m },
- { X86::NEG64r, X86::NEG64m },
- { X86::NEG8r, X86::NEG8m },
- { X86::NOT16r, X86::NOT16m },
- { X86::NOT32r, X86::NOT32m },
- { X86::NOT64r, X86::NOT64m },
- { X86::NOT8r, X86::NOT8m },
- { X86::OR16ri, X86::OR16mi },
- { X86::OR16ri8, X86::OR16mi8 },
- { X86::OR16rr, X86::OR16mr },
- { X86::OR32ri, X86::OR32mi },
- { X86::OR32ri8, X86::OR32mi8 },
- { X86::OR32rr, X86::OR32mr },
- { X86::OR64ri32, X86::OR64mi32 },
- { X86::OR64ri8, X86::OR64mi8 },
- { X86::OR64rr, X86::OR64mr },
- { X86::OR8ri, X86::OR8mi },
- { X86::OR8rr, X86::OR8mr },
- { X86::ROL16r1, X86::ROL16m1 },
- { X86::ROL16rCL, X86::ROL16mCL },
- { X86::ROL16ri, X86::ROL16mi },
- { X86::ROL32r1, X86::ROL32m1 },
- { X86::ROL32rCL, X86::ROL32mCL },
- { X86::ROL32ri, X86::ROL32mi },
- { X86::ROL64r1, X86::ROL64m1 },
- { X86::ROL64rCL, X86::ROL64mCL },
- { X86::ROL64ri, X86::ROL64mi },
- { X86::ROL8r1, X86::ROL8m1 },
- { X86::ROL8rCL, X86::ROL8mCL },
- { X86::ROL8ri, X86::ROL8mi },
- { X86::ROR16r1, X86::ROR16m1 },
- { X86::ROR16rCL, X86::ROR16mCL },
- { X86::ROR16ri, X86::ROR16mi },
- { X86::ROR32r1, X86::ROR32m1 },
- { X86::ROR32rCL, X86::ROR32mCL },
- { X86::ROR32ri, X86::ROR32mi },
- { X86::ROR64r1, X86::ROR64m1 },
- { X86::ROR64rCL, X86::ROR64mCL },
- { X86::ROR64ri, X86::ROR64mi },
- { X86::ROR8r1, X86::ROR8m1 },
- { X86::ROR8rCL, X86::ROR8mCL },
- { X86::ROR8ri, X86::ROR8mi },
- { X86::SAR16r1, X86::SAR16m1 },
- { X86::SAR16rCL, X86::SAR16mCL },
- { X86::SAR16ri, X86::SAR16mi },
- { X86::SAR32r1, X86::SAR32m1 },
- { X86::SAR32rCL, X86::SAR32mCL },
- { X86::SAR32ri, X86::SAR32mi },
- { X86::SAR64r1, X86::SAR64m1 },
- { X86::SAR64rCL, X86::SAR64mCL },
- { X86::SAR64ri, X86::SAR64mi },
- { X86::SAR8r1, X86::SAR8m1 },
- { X86::SAR8rCL, X86::SAR8mCL },
- { X86::SAR8ri, X86::SAR8mi },
- { X86::SBB32ri, X86::SBB32mi },
- { X86::SBB32ri8, X86::SBB32mi8 },
- { X86::SBB32rr, X86::SBB32mr },
- { X86::SBB64ri32, X86::SBB64mi32 },
- { X86::SBB64ri8, X86::SBB64mi8 },
- { X86::SBB64rr, X86::SBB64mr },
- { X86::SHL16rCL, X86::SHL16mCL },
- { X86::SHL16ri, X86::SHL16mi },
- { X86::SHL32rCL, X86::SHL32mCL },
- { X86::SHL32ri, X86::SHL32mi },
- { X86::SHL64rCL, X86::SHL64mCL },
- { X86::SHL64ri, X86::SHL64mi },
- { X86::SHL8rCL, X86::SHL8mCL },
- { X86::SHL8ri, X86::SHL8mi },
- { X86::SHLD16rrCL, X86::SHLD16mrCL },
- { X86::SHLD16rri8, X86::SHLD16mri8 },
- { X86::SHLD32rrCL, X86::SHLD32mrCL },
- { X86::SHLD32rri8, X86::SHLD32mri8 },
- { X86::SHLD64rrCL, X86::SHLD64mrCL },
- { X86::SHLD64rri8, X86::SHLD64mri8 },
- { X86::SHR16r1, X86::SHR16m1 },
- { X86::SHR16rCL, X86::SHR16mCL },
- { X86::SHR16ri, X86::SHR16mi },
- { X86::SHR32r1, X86::SHR32m1 },
- { X86::SHR32rCL, X86::SHR32mCL },
- { X86::SHR32ri, X86::SHR32mi },
- { X86::SHR64r1, X86::SHR64m1 },
- { X86::SHR64rCL, X86::SHR64mCL },
- { X86::SHR64ri, X86::SHR64mi },
- { X86::SHR8r1, X86::SHR8m1 },
- { X86::SHR8rCL, X86::SHR8mCL },
- { X86::SHR8ri, X86::SHR8mi },
- { X86::SHRD16rrCL, X86::SHRD16mrCL },
- { X86::SHRD16rri8, X86::SHRD16mri8 },
- { X86::SHRD32rrCL, X86::SHRD32mrCL },
- { X86::SHRD32rri8, X86::SHRD32mri8 },
- { X86::SHRD64rrCL, X86::SHRD64mrCL },
- { X86::SHRD64rri8, X86::SHRD64mri8 },
- { X86::SUB16ri, X86::SUB16mi },
- { X86::SUB16ri8, X86::SUB16mi8 },
- { X86::SUB16rr, X86::SUB16mr },
- { X86::SUB32ri, X86::SUB32mi },
- { X86::SUB32ri8, X86::SUB32mi8 },
- { X86::SUB32rr, X86::SUB32mr },
- { X86::SUB64ri32, X86::SUB64mi32 },
- { X86::SUB64ri8, X86::SUB64mi8 },
- { X86::SUB64rr, X86::SUB64mr },
- { X86::SUB8ri, X86::SUB8mi },
- { X86::SUB8rr, X86::SUB8mr },
- { X86::XOR16ri, X86::XOR16mi },
- { X86::XOR16ri8, X86::XOR16mi8 },
- { X86::XOR16rr, X86::XOR16mr },
- { X86::XOR32ri, X86::XOR32mi },
- { X86::XOR32ri8, X86::XOR32mi8 },
- { X86::XOR32rr, X86::XOR32mr },
- { X86::XOR64ri32, X86::XOR64mi32 },
- { X86::XOR64ri8, X86::XOR64mi8 },
- { X86::XOR64rr, X86::XOR64mr },
- { X86::XOR8ri, X86::XOR8mi },
- { X86::XOR8rr, X86::XOR8mr }
- };
-
- for (unsigned i = 0, e = array_lengthof(OpTbl2Addr); i != e; ++i) {
- unsigned RegOp = OpTbl2Addr[i][0];
- unsigned MemOp = OpTbl2Addr[i][1];
- if (!RegOp2MemOpTable2Addr.insert(std::make_pair((unsigned*)RegOp, MemOp)))
- assert(false && "Duplicated entries?");
- unsigned AuxInfo = 0 | (1 << 4) | (1 << 5); // Index 0,folded load and store
- if (!MemOp2RegOpTable.insert(std::make_pair((unsigned*)MemOp,
- std::make_pair(RegOp, AuxInfo))))
- AmbEntries.push_back(MemOp);
- }
-
- // If the third value is 1, then it's folding either a load or a store.
- static const unsigned OpTbl0[][3] = {
- { X86::CALL32r, X86::CALL32m, 1 },
- { X86::CALL64r, X86::CALL64m, 1 },
- { X86::CMP16ri, X86::CMP16mi, 1 },
- { X86::CMP16ri8, X86::CMP16mi8, 1 },
- { X86::CMP16rr, X86::CMP16mr, 1 },
- { X86::CMP32ri, X86::CMP32mi, 1 },
- { X86::CMP32ri8, X86::CMP32mi8, 1 },
- { X86::CMP32rr, X86::CMP32mr, 1 },
- { X86::CMP64ri32, X86::CMP64mi32, 1 },
- { X86::CMP64ri8, X86::CMP64mi8, 1 },
- { X86::CMP64rr, X86::CMP64mr, 1 },
- { X86::CMP8ri, X86::CMP8mi, 1 },
- { X86::CMP8rr, X86::CMP8mr, 1 },
- { X86::DIV16r, X86::DIV16m, 1 },
- { X86::DIV32r, X86::DIV32m, 1 },
- { X86::DIV64r, X86::DIV64m, 1 },
- { X86::DIV8r, X86::DIV8m, 1 },
- { X86::FsMOVAPDrr, X86::MOVSDmr, 0 },
- { X86::FsMOVAPSrr, X86::MOVSSmr, 0 },
- { X86::IDIV16r, X86::IDIV16m, 1 },
- { X86::IDIV32r, X86::IDIV32m, 1 },
- { X86::IDIV64r, X86::IDIV64m, 1 },
- { X86::IDIV8r, X86::IDIV8m, 1 },
- { X86::IMUL16r, X86::IMUL16m, 1 },
- { X86::IMUL32r, X86::IMUL32m, 1 },
- { X86::IMUL64r, X86::IMUL64m, 1 },
- { X86::IMUL8r, X86::IMUL8m, 1 },
- { X86::JMP32r, X86::JMP32m, 1 },
- { X86::JMP64r, X86::JMP64m, 1 },
- { X86::MOV16ri, X86::MOV16mi, 0 },
- { X86::MOV16rr, X86::MOV16mr, 0 },
- { X86::MOV16to16_, X86::MOV16_mr, 0 },
- { X86::MOV32ri, X86::MOV32mi, 0 },
- { X86::MOV32rr, X86::MOV32mr, 0 },
- { X86::MOV32to32_, X86::MOV32_mr, 0 },
- { X86::MOV64ri32, X86::MOV64mi32, 0 },
- { X86::MOV64rr, X86::MOV64mr, 0 },
- { X86::MOV8ri, X86::MOV8mi, 0 },
- { X86::MOV8rr, X86::MOV8mr, 0 },
- { X86::MOVAPDrr, X86::MOVAPDmr, 0 },
- { X86::MOVAPSrr, X86::MOVAPSmr, 0 },
- { X86::MOVPDI2DIrr, X86::MOVPDI2DImr, 0 },
- { X86::MOVPQIto64rr,X86::MOVPQI2QImr, 0 },
- { X86::MOVPS2SSrr, X86::MOVPS2SSmr, 0 },
- { X86::MOVSDrr, X86::MOVSDmr, 0 },
- { X86::MOVSDto64rr, X86::MOVSDto64mr, 0 },
- { X86::MOVSS2DIrr, X86::MOVSS2DImr, 0 },
- { X86::MOVSSrr, X86::MOVSSmr, 0 },
- { X86::MOVUPDrr, X86::MOVUPDmr, 0 },
- { X86::MOVUPSrr, X86::MOVUPSmr, 0 },
- { X86::MUL16r, X86::MUL16m, 1 },
- { X86::MUL32r, X86::MUL32m, 1 },
- { X86::MUL64r, X86::MUL64m, 1 },
- { X86::MUL8r, X86::MUL8m, 1 },
- { X86::SETAEr, X86::SETAEm, 0 },
- { X86::SETAr, X86::SETAm, 0 },
- { X86::SETBEr, X86::SETBEm, 0 },
- { X86::SETBr, X86::SETBm, 0 },
- { X86::SETEr, X86::SETEm, 0 },
- { X86::SETGEr, X86::SETGEm, 0 },
- { X86::SETGr, X86::SETGm, 0 },
- { X86::SETLEr, X86::SETLEm, 0 },
- { X86::SETLr, X86::SETLm, 0 },
- { X86::SETNEr, X86::SETNEm, 0 },
- { X86::SETNPr, X86::SETNPm, 0 },
- { X86::SETNSr, X86::SETNSm, 0 },
- { X86::SETPr, X86::SETPm, 0 },
- { X86::SETSr, X86::SETSm, 0 },
- { X86::TAILJMPr, X86::TAILJMPm, 1 },
- { X86::TEST16ri, X86::TEST16mi, 1 },
- { X86::TEST32ri, X86::TEST32mi, 1 },
- { X86::TEST64ri32, X86::TEST64mi32, 1 },
- { X86::TEST8ri, X86::TEST8mi, 1 }
- };
-
- for (unsigned i = 0, e = array_lengthof(OpTbl0); i != e; ++i) {
- unsigned RegOp = OpTbl0[i][0];
- unsigned MemOp = OpTbl0[i][1];
- if (!RegOp2MemOpTable0.insert(std::make_pair((unsigned*)RegOp, MemOp)))
- assert(false && "Duplicated entries?");
- unsigned FoldedLoad = OpTbl0[i][2];
- // Index 0, folded load or store.
- unsigned AuxInfo = 0 | (FoldedLoad << 4) | ((FoldedLoad^1) << 5);
- if (RegOp != X86::FsMOVAPDrr && RegOp != X86::FsMOVAPSrr)
- if (!MemOp2RegOpTable.insert(std::make_pair((unsigned*)MemOp,
- std::make_pair(RegOp, AuxInfo))))
- AmbEntries.push_back(MemOp);
- }
-
- static const unsigned OpTbl1[][2] = {
- { X86::CMP16rr, X86::CMP16rm },
- { X86::CMP32rr, X86::CMP32rm },
- { X86::CMP64rr, X86::CMP64rm },
- { X86::CMP8rr, X86::CMP8rm },
- { X86::CVTSD2SSrr, X86::CVTSD2SSrm },
- { X86::CVTSI2SD64rr, X86::CVTSI2SD64rm },
- { X86::CVTSI2SDrr, X86::CVTSI2SDrm },
- { X86::CVTSI2SS64rr, X86::CVTSI2SS64rm },
- { X86::CVTSI2SSrr, X86::CVTSI2SSrm },
- { X86::CVTSS2SDrr, X86::CVTSS2SDrm },
- { X86::CVTTSD2SI64rr, X86::CVTTSD2SI64rm },
- { X86::CVTTSD2SIrr, X86::CVTTSD2SIrm },
- { X86::CVTTSS2SI64rr, X86::CVTTSS2SI64rm },
- { X86::CVTTSS2SIrr, X86::CVTTSS2SIrm },
- { X86::FsMOVAPDrr, X86::MOVSDrm },
- { X86::FsMOVAPSrr, X86::MOVSSrm },
- { X86::IMUL16rri, X86::IMUL16rmi },
- { X86::IMUL16rri8, X86::IMUL16rmi8 },
- { X86::IMUL32rri, X86::IMUL32rmi },
- { X86::IMUL32rri8, X86::IMUL32rmi8 },
- { X86::IMUL64rri32, X86::IMUL64rmi32 },
- { X86::IMUL64rri8, X86::IMUL64rmi8 },
- { X86::Int_CMPSDrr, X86::Int_CMPSDrm },
- { X86::Int_CMPSSrr, X86::Int_CMPSSrm },
- { X86::Int_COMISDrr, X86::Int_COMISDrm },
- { X86::Int_COMISSrr, X86::Int_COMISSrm },
- { X86::Int_CVTDQ2PDrr, X86::Int_CVTDQ2PDrm },
- { X86::Int_CVTDQ2PSrr, X86::Int_CVTDQ2PSrm },
- { X86::Int_CVTPD2DQrr, X86::Int_CVTPD2DQrm },
- { X86::Int_CVTPD2PSrr, X86::Int_CVTPD2PSrm },
- { X86::Int_CVTPS2DQrr, X86::Int_CVTPS2DQrm },
- { X86::Int_CVTPS2PDrr, X86::Int_CVTPS2PDrm },
- { X86::Int_CVTSD2SI64rr,X86::Int_CVTSD2SI64rm },
- { X86::Int_CVTSD2SIrr, X86::Int_CVTSD2SIrm },
- { X86::Int_CVTSD2SSrr, X86::Int_CVTSD2SSrm },
- { X86::Int_CVTSI2SD64rr,X86::Int_CVTSI2SD64rm },
- { X86::Int_CVTSI2SDrr, X86::Int_CVTSI2SDrm },
- { X86::Int_CVTSI2SS64rr,X86::Int_CVTSI2SS64rm },
- { X86::Int_CVTSI2SSrr, X86::Int_CVTSI2SSrm },
- { X86::Int_CVTSS2SDrr, X86::Int_CVTSS2SDrm },
- { X86::Int_CVTSS2SI64rr,X86::Int_CVTSS2SI64rm },
- { X86::Int_CVTSS2SIrr, X86::Int_CVTSS2SIrm },
- { X86::Int_CVTTPD2DQrr, X86::Int_CVTTPD2DQrm },
- { X86::Int_CVTTPS2DQrr, X86::Int_CVTTPS2DQrm },
- { X86::Int_CVTTSD2SI64rr,X86::Int_CVTTSD2SI64rm },
- { X86::Int_CVTTSD2SIrr, X86::Int_CVTTSD2SIrm },
- { X86::Int_CVTTSS2SI64rr,X86::Int_CVTTSS2SI64rm },
- { X86::Int_CVTTSS2SIrr, X86::Int_CVTTSS2SIrm },
- { X86::Int_UCOMISDrr, X86::Int_UCOMISDrm },
- { X86::Int_UCOMISSrr, X86::Int_UCOMISSrm },
- { X86::MOV16rr, X86::MOV16rm },
- { X86::MOV16to16_, X86::MOV16_rm },
- { X86::MOV32rr, X86::MOV32rm },
- { X86::MOV32to32_, X86::MOV32_rm },
- { X86::MOV64rr, X86::MOV64rm },
- { X86::MOV64toPQIrr, X86::MOVQI2PQIrm },
- { X86::MOV64toSDrr, X86::MOV64toSDrm },
- { X86::MOV8rr, X86::MOV8rm },
- { X86::MOVAPDrr, X86::MOVAPDrm },
- { X86::MOVAPSrr, X86::MOVAPSrm },
- { X86::MOVDDUPrr, X86::MOVDDUPrm },
- { X86::MOVDI2PDIrr, X86::MOVDI2PDIrm },
- { X86::MOVDI2SSrr, X86::MOVDI2SSrm },
- { X86::MOVSD2PDrr, X86::MOVSD2PDrm },
- { X86::MOVSDrr, X86::MOVSDrm },
- { X86::MOVSHDUPrr, X86::MOVSHDUPrm },
- { X86::MOVSLDUPrr, X86::MOVSLDUPrm },
- { X86::MOVSS2PSrr, X86::MOVSS2PSrm },
- { X86::MOVSSrr, X86::MOVSSrm },
- { X86::MOVSX16rr8, X86::MOVSX16rm8 },
- { X86::MOVSX32rr16, X86::MOVSX32rm16 },
- { X86::MOVSX32rr8, X86::MOVSX32rm8 },
- { X86::MOVSX64rr16, X86::MOVSX64rm16 },
- { X86::MOVSX64rr32, X86::MOVSX64rm32 },
- { X86::MOVSX64rr8, X86::MOVSX64rm8 },
- { X86::MOVUPDrr, X86::MOVUPDrm },
- { X86::MOVUPSrr, X86::MOVUPSrm },
- { X86::MOVZDI2PDIrr, X86::MOVZDI2PDIrm },
- { X86::MOVZQI2PQIrr, X86::MOVZQI2PQIrm },
- { X86::MOVZPQILo2PQIrr, X86::MOVZPQILo2PQIrm },
- { X86::MOVZX16rr8, X86::MOVZX16rm8 },
- { X86::MOVZX32rr16, X86::MOVZX32rm16 },
- { X86::MOVZX32rr8, X86::MOVZX32rm8 },
- { X86::MOVZX64rr16, X86::MOVZX64rm16 },
- { X86::MOVZX64rr8, X86::MOVZX64rm8 },
- { X86::PSHUFDri, X86::PSHUFDmi },
- { X86::PSHUFHWri, X86::PSHUFHWmi },
- { X86::PSHUFLWri, X86::PSHUFLWmi },
- { X86::RCPPSr, X86::RCPPSm },
- { X86::RCPPSr_Int, X86::RCPPSm_Int },
- { X86::RSQRTPSr, X86::RSQRTPSm },
- { X86::RSQRTPSr_Int, X86::RSQRTPSm_Int },
- { X86::RSQRTSSr, X86::RSQRTSSm },
- { X86::RSQRTSSr_Int, X86::RSQRTSSm_Int },
- { X86::SQRTPDr, X86::SQRTPDm },
- { X86::SQRTPDr_Int, X86::SQRTPDm_Int },
- { X86::SQRTPSr, X86::SQRTPSm },
- { X86::SQRTPSr_Int, X86::SQRTPSm_Int },
- { X86::SQRTSDr, X86::SQRTSDm },
- { X86::SQRTSDr_Int, X86::SQRTSDm_Int },
- { X86::SQRTSSr, X86::SQRTSSm },
- { X86::SQRTSSr_Int, X86::SQRTSSm_Int },
- { X86::TEST16rr, X86::TEST16rm },
- { X86::TEST32rr, X86::TEST32rm },
- { X86::TEST64rr, X86::TEST64rm },
- { X86::TEST8rr, X86::TEST8rm },
- // FIXME: TEST*rr EAX,EAX ---> CMP [mem], 0
- { X86::UCOMISDrr, X86::UCOMISDrm },
- { X86::UCOMISSrr, X86::UCOMISSrm }
- };
-
- for (unsigned i = 0, e = array_lengthof(OpTbl1); i != e; ++i) {
- unsigned RegOp = OpTbl1[i][0];
- unsigned MemOp = OpTbl1[i][1];
- if (!RegOp2MemOpTable1.insert(std::make_pair((unsigned*)RegOp, MemOp)))
- assert(false && "Duplicated entries?");
- unsigned AuxInfo = 1 | (1 << 4); // Index 1, folded load
- if (RegOp != X86::FsMOVAPDrr && RegOp != X86::FsMOVAPSrr)
- if (!MemOp2RegOpTable.insert(std::make_pair((unsigned*)MemOp,
- std::make_pair(RegOp, AuxInfo))))
- AmbEntries.push_back(MemOp);
- }
-
- static const unsigned OpTbl2[][2] = {
- { X86::ADC32rr, X86::ADC32rm },
- { X86::ADC64rr, X86::ADC64rm },
- { X86::ADD16rr, X86::ADD16rm },
- { X86::ADD32rr, X86::ADD32rm },
- { X86::ADD64rr, X86::ADD64rm },
- { X86::ADD8rr, X86::ADD8rm },
- { X86::ADDPDrr, X86::ADDPDrm },
- { X86::ADDPSrr, X86::ADDPSrm },
- { X86::ADDSDrr, X86::ADDSDrm },
- { X86::ADDSSrr, X86::ADDSSrm },
- { X86::ADDSUBPDrr, X86::ADDSUBPDrm },
- { X86::ADDSUBPSrr, X86::ADDSUBPSrm },
- { X86::AND16rr, X86::AND16rm },
- { X86::AND32rr, X86::AND32rm },
- { X86::AND64rr, X86::AND64rm },
- { X86::AND8rr, X86::AND8rm },
- { X86::ANDNPDrr, X86::ANDNPDrm },
- { X86::ANDNPSrr, X86::ANDNPSrm },
- { X86::ANDPDrr, X86::ANDPDrm },
- { X86::ANDPSrr, X86::ANDPSrm },
- { X86::CMOVA16rr, X86::CMOVA16rm },
- { X86::CMOVA32rr, X86::CMOVA32rm },
- { X86::CMOVA64rr, X86::CMOVA64rm },
- { X86::CMOVAE16rr, X86::CMOVAE16rm },
- { X86::CMOVAE32rr, X86::CMOVAE32rm },
- { X86::CMOVAE64rr, X86::CMOVAE64rm },
- { X86::CMOVB16rr, X86::CMOVB16rm },
- { X86::CMOVB32rr, X86::CMOVB32rm },
- { X86::CMOVB64rr, X86::CMOVB64rm },
- { X86::CMOVBE16rr, X86::CMOVBE16rm },
- { X86::CMOVBE32rr, X86::CMOVBE32rm },
- { X86::CMOVBE64rr, X86::CMOVBE64rm },
- { X86::CMOVE16rr, X86::CMOVE16rm },
- { X86::CMOVE32rr, X86::CMOVE32rm },
- { X86::CMOVE64rr, X86::CMOVE64rm },
- { X86::CMOVG16rr, X86::CMOVG16rm },
- { X86::CMOVG32rr, X86::CMOVG32rm },
- { X86::CMOVG64rr, X86::CMOVG64rm },
- { X86::CMOVGE16rr, X86::CMOVGE16rm },
- { X86::CMOVGE32rr, X86::CMOVGE32rm },
- { X86::CMOVGE64rr, X86::CMOVGE64rm },
- { X86::CMOVL16rr, X86::CMOVL16rm },
- { X86::CMOVL32rr, X86::CMOVL32rm },
- { X86::CMOVL64rr, X86::CMOVL64rm },
- { X86::CMOVLE16rr, X86::CMOVLE16rm },
- { X86::CMOVLE32rr, X86::CMOVLE32rm },
- { X86::CMOVLE64rr, X86::CMOVLE64rm },
- { X86::CMOVNE16rr, X86::CMOVNE16rm },
- { X86::CMOVNE32rr, X86::CMOVNE32rm },
- { X86::CMOVNE64rr, X86::CMOVNE64rm },
- { X86::CMOVNP16rr, X86::CMOVNP16rm },
- { X86::CMOVNP32rr, X86::CMOVNP32rm },
- { X86::CMOVNP64rr, X86::CMOVNP64rm },
- { X86::CMOVNS16rr, X86::CMOVNS16rm },
- { X86::CMOVNS32rr, X86::CMOVNS32rm },
- { X86::CMOVNS64rr, X86::CMOVNS64rm },
- { X86::CMOVP16rr, X86::CMOVP16rm },
- { X86::CMOVP32rr, X86::CMOVP32rm },
- { X86::CMOVP64rr, X86::CMOVP64rm },
- { X86::CMOVS16rr, X86::CMOVS16rm },
- { X86::CMOVS32rr, X86::CMOVS32rm },
- { X86::CMOVS64rr, X86::CMOVS64rm },
- { X86::CMPPDrri, X86::CMPPDrmi },
- { X86::CMPPSrri, X86::CMPPSrmi },
- { X86::CMPSDrr, X86::CMPSDrm },
- { X86::CMPSSrr, X86::CMPSSrm },
- { X86::DIVPDrr, X86::DIVPDrm },
- { X86::DIVPSrr, X86::DIVPSrm },
- { X86::DIVSDrr, X86::DIVSDrm },
- { X86::DIVSSrr, X86::DIVSSrm },
- { X86::FsANDNPDrr, X86::FsANDNPDrm },
- { X86::FsANDNPSrr, X86::FsANDNPSrm },
- { X86::FsANDPDrr, X86::FsANDPDrm },
- { X86::FsANDPSrr, X86::FsANDPSrm },
- { X86::FsORPDrr, X86::FsORPDrm },
- { X86::FsORPSrr, X86::FsORPSrm },
- { X86::FsXORPDrr, X86::FsXORPDrm },
- { X86::FsXORPSrr, X86::FsXORPSrm },
- { X86::HADDPDrr, X86::HADDPDrm },
- { X86::HADDPSrr, X86::HADDPSrm },
- { X86::HSUBPDrr, X86::HSUBPDrm },
- { X86::HSUBPSrr, X86::HSUBPSrm },
- { X86::IMUL16rr, X86::IMUL16rm },
- { X86::IMUL32rr, X86::IMUL32rm },
- { X86::IMUL64rr, X86::IMUL64rm },
- { X86::MAXPDrr, X86::MAXPDrm },
- { X86::MAXPDrr_Int, X86::MAXPDrm_Int },
- { X86::MAXPSrr, X86::MAXPSrm },
- { X86::MAXPSrr_Int, X86::MAXPSrm_Int },
- { X86::MAXSDrr, X86::MAXSDrm },
- { X86::MAXSDrr_Int, X86::MAXSDrm_Int },
- { X86::MAXSSrr, X86::MAXSSrm },
- { X86::MAXSSrr_Int, X86::MAXSSrm_Int },
- { X86::MINPDrr, X86::MINPDrm },
- { X86::MINPDrr_Int, X86::MINPDrm_Int },
- { X86::MINPSrr, X86::MINPSrm },
- { X86::MINPSrr_Int, X86::MINPSrm_Int },
- { X86::MINSDrr, X86::MINSDrm },
- { X86::MINSDrr_Int, X86::MINSDrm_Int },
- { X86::MINSSrr, X86::MINSSrm },
- { X86::MINSSrr_Int, X86::MINSSrm_Int },
- { X86::MULPDrr, X86::MULPDrm },
- { X86::MULPSrr, X86::MULPSrm },
- { X86::MULSDrr, X86::MULSDrm },
- { X86::MULSSrr, X86::MULSSrm },
- { X86::OR16rr, X86::OR16rm },
- { X86::OR32rr, X86::OR32rm },
- { X86::OR64rr, X86::OR64rm },
- { X86::OR8rr, X86::OR8rm },
- { X86::ORPDrr, X86::ORPDrm },
- { X86::ORPSrr, X86::ORPSrm },
- { X86::PACKSSDWrr, X86::PACKSSDWrm },
- { X86::PACKSSWBrr, X86::PACKSSWBrm },
- { X86::PACKUSWBrr, X86::PACKUSWBrm },
- { X86::PADDBrr, X86::PADDBrm },
- { X86::PADDDrr, X86::PADDDrm },
- { X86::PADDQrr, X86::PADDQrm },
- { X86::PADDSBrr, X86::PADDSBrm },
- { X86::PADDSWrr, X86::PADDSWrm },
- { X86::PADDWrr, X86::PADDWrm },
- { X86::PANDNrr, X86::PANDNrm },
- { X86::PANDrr, X86::PANDrm },
- { X86::PAVGBrr, X86::PAVGBrm },
- { X86::PAVGWrr, X86::PAVGWrm },
- { X86::PCMPEQBrr, X86::PCMPEQBrm },
- { X86::PCMPEQDrr, X86::PCMPEQDrm },
- { X86::PCMPEQWrr, X86::PCMPEQWrm },
- { X86::PCMPGTBrr, X86::PCMPGTBrm },
- { X86::PCMPGTDrr, X86::PCMPGTDrm },
- { X86::PCMPGTWrr, X86::PCMPGTWrm },
- { X86::PINSRWrri, X86::PINSRWrmi },
- { X86::PMADDWDrr, X86::PMADDWDrm },
- { X86::PMAXSWrr, X86::PMAXSWrm },
- { X86::PMAXUBrr, X86::PMAXUBrm },
- { X86::PMINSWrr, X86::PMINSWrm },
- { X86::PMINUBrr, X86::PMINUBrm },
- { X86::PMULHUWrr, X86::PMULHUWrm },
- { X86::PMULHWrr, X86::PMULHWrm },
- { X86::PMULLWrr, X86::PMULLWrm },
- { X86::PMULUDQrr, X86::PMULUDQrm },
- { X86::PORrr, X86::PORrm },
- { X86::PSADBWrr, X86::PSADBWrm },
- { X86::PSLLDrr, X86::PSLLDrm },
- { X86::PSLLQrr, X86::PSLLQrm },
- { X86::PSLLWrr, X86::PSLLWrm },
- { X86::PSRADrr, X86::PSRADrm },
- { X86::PSRAWrr, X86::PSRAWrm },
- { X86::PSRLDrr, X86::PSRLDrm },
- { X86::PSRLQrr, X86::PSRLQrm },
- { X86::PSRLWrr, X86::PSRLWrm },
- { X86::PSUBBrr, X86::PSUBBrm },
- { X86::PSUBDrr, X86::PSUBDrm },
- { X86::PSUBSBrr, X86::PSUBSBrm },
- { X86::PSUBSWrr, X86::PSUBSWrm },
- { X86::PSUBWrr, X86::PSUBWrm },
- { X86::PUNPCKHBWrr, X86::PUNPCKHBWrm },
- { X86::PUNPCKHDQrr, X86::PUNPCKHDQrm },
- { X86::PUNPCKHQDQrr, X86::PUNPCKHQDQrm },
- { X86::PUNPCKHWDrr, X86::PUNPCKHWDrm },
- { X86::PUNPCKLBWrr, X86::PUNPCKLBWrm },
- { X86::PUNPCKLDQrr, X86::PUNPCKLDQrm },
- { X86::PUNPCKLQDQrr, X86::PUNPCKLQDQrm },
- { X86::PUNPCKLWDrr, X86::PUNPCKLWDrm },
- { X86::PXORrr, X86::PXORrm },
- { X86::SBB32rr, X86::SBB32rm },
- { X86::SBB64rr, X86::SBB64rm },
- { X86::SHUFPDrri, X86::SHUFPDrmi },
- { X86::SHUFPSrri, X86::SHUFPSrmi },
- { X86::SUB16rr, X86::SUB16rm },
- { X86::SUB32rr, X86::SUB32rm },
- { X86::SUB64rr, X86::SUB64rm },
- { X86::SUB8rr, X86::SUB8rm },
- { X86::SUBPDrr, X86::SUBPDrm },
- { X86::SUBPSrr, X86::SUBPSrm },
- { X86::SUBSDrr, X86::SUBSDrm },
- { X86::SUBSSrr, X86::SUBSSrm },
- // FIXME: TEST*rr -> swapped operand of TEST*mr.
- { X86::UNPCKHPDrr, X86::UNPCKHPDrm },
- { X86::UNPCKHPSrr, X86::UNPCKHPSrm },
- { X86::UNPCKLPDrr, X86::UNPCKLPDrm },
- { X86::UNPCKLPSrr, X86::UNPCKLPSrm },
- { X86::XOR16rr, X86::XOR16rm },
- { X86::XOR32rr, X86::XOR32rm },
- { X86::XOR64rr, X86::XOR64rm },
- { X86::XOR8rr, X86::XOR8rm },
- { X86::XORPDrr, X86::XORPDrm },
- { X86::XORPSrr, X86::XORPSrm }
- };
-
- for (unsigned i = 0, e = array_lengthof(OpTbl2); i != e; ++i) {
- unsigned RegOp = OpTbl2[i][0];
- unsigned MemOp = OpTbl2[i][1];
- if (!RegOp2MemOpTable2.insert(std::make_pair((unsigned*)RegOp, MemOp)))
- assert(false && "Duplicated entries?");
- unsigned AuxInfo = 2 | (1 << 4); // Index 1, folded load
- if (!MemOp2RegOpTable.insert(std::make_pair((unsigned*)MemOp,
- std::make_pair(RegOp, AuxInfo))))
- AmbEntries.push_back(MemOp);
- }
-
- // Remove ambiguous entries.
- assert(AmbEntries.empty() && "Duplicated entries in unfolding maps?");
-}
-
-bool X86InstrInfo::isMoveInstr(const MachineInstr& MI,
- unsigned& sourceReg,
- unsigned& destReg) const {
- switch (MI.getOpcode()) {
- default:
- return false;
- case X86::MOV8rr:
- case X86::MOV16rr:
- case X86::MOV32rr:
- case X86::MOV64rr:
- case X86::MOV16to16_:
- case X86::MOV32to32_:
- case X86::MOVSSrr:
- case X86::MOVSDrr:
-
- // FP Stack register class copies
- case X86::MOV_Fp3232: case X86::MOV_Fp6464: case X86::MOV_Fp8080:
- case X86::MOV_Fp3264: case X86::MOV_Fp3280:
- case X86::MOV_Fp6432: case X86::MOV_Fp8032:
-
- case X86::FsMOVAPSrr:
- case X86::FsMOVAPDrr:
- case X86::MOVAPSrr:
- case X86::MOVAPDrr:
- case X86::MOVSS2PSrr:
- case X86::MOVSD2PDrr:
- case X86::MOVPS2SSrr:
- case X86::MOVPD2SDrr:
- case X86::MMX_MOVD64rr:
- case X86::MMX_MOVQ64rr:
- assert(MI.getNumOperands() >= 2 &&
- MI.getOperand(0).isRegister() &&
- MI.getOperand(1).isRegister() &&
- "invalid register-register move instruction");
- sourceReg = MI.getOperand(1).getReg();
- destReg = MI.getOperand(0).getReg();
- return true;
- }
-}
-
-unsigned X86InstrInfo::isLoadFromStackSlot(MachineInstr *MI,
- int &FrameIndex) const {
- switch (MI->getOpcode()) {
- default: break;
- case X86::MOV8rm:
- case X86::MOV16rm:
- case X86::MOV16_rm:
- case X86::MOV32rm:
- case X86::MOV32_rm:
- case X86::MOV64rm:
- case X86::LD_Fp64m:
- case X86::MOVSSrm:
- case X86::MOVSDrm:
- case X86::MOVAPSrm:
- case X86::MOVAPDrm:
- case X86::MMX_MOVD64rm:
- case X86::MMX_MOVQ64rm:
- if (MI->getOperand(1).isFI() && MI->getOperand(2).isImm() &&
- MI->getOperand(3).isReg() && MI->getOperand(4).isImm() &&
- MI->getOperand(2).getImm() == 1 &&
- MI->getOperand(3).getReg() == 0 &&
- MI->getOperand(4).getImm() == 0) {
- FrameIndex = MI->getOperand(1).getIndex();
- return MI->getOperand(0).getReg();
- }
- break;
- }
- return 0;
-}
-
-unsigned X86InstrInfo::isStoreToStackSlot(MachineInstr *MI,
- int &FrameIndex) const {
- switch (MI->getOpcode()) {
- default: break;
- case X86::MOV8mr:
- case X86::MOV16mr:
- case X86::MOV16_mr:
- case X86::MOV32mr:
- case X86::MOV32_mr:
- case X86::MOV64mr:
- case X86::ST_FpP64m:
- case X86::MOVSSmr:
- case X86::MOVSDmr:
- case X86::MOVAPSmr:
- case X86::MOVAPDmr:
- case X86::MMX_MOVD64mr:
- case X86::MMX_MOVQ64mr:
- case X86::MMX_MOVNTQmr:
- if (MI->getOperand(0).isFI() && MI->getOperand(1).isImm() &&
- MI->getOperand(2).isReg() && MI->getOperand(3).isImm() &&
- MI->getOperand(1).getImm() == 1 &&
- MI->getOperand(2).getReg() == 0 &&
- MI->getOperand(3).getImm() == 0) {
- FrameIndex = MI->getOperand(0).getIndex();
- return MI->getOperand(4).getReg();
- }
- break;
- }
- return 0;
-}
-
-
-/// regIsPICBase - Return true if register is PIC base (i.e.g defined by
-/// X86::MOVPC32r.
-static bool regIsPICBase(unsigned BaseReg, MachineRegisterInfo &MRI) {
- bool isPICBase = false;
- for (MachineRegisterInfo::def_iterator I = MRI.def_begin(BaseReg),
- E = MRI.def_end(); I != E; ++I) {
- MachineInstr *DefMI = I.getOperand().getParent();
- if (DefMI->getOpcode() != X86::MOVPC32r)
- return false;
- assert(!isPICBase && "More than one PIC base?");
- isPICBase = true;
- }
- return isPICBase;
-}
-
-/// isGVStub - Return true if the GV requires an extra load to get the
-/// real address.
-static inline bool isGVStub(GlobalValue *GV, X86TargetMachine &TM) {
- return TM.getSubtarget<X86Subtarget>().GVRequiresExtraLoad(GV, TM, false);
-}
-
-bool X86InstrInfo::isReallyTriviallyReMaterializable(MachineInstr *MI) const {
- switch (MI->getOpcode()) {
- default: break;
- case X86::MOV8rm:
- case X86::MOV16rm:
- case X86::MOV16_rm:
- case X86::MOV32rm:
- case X86::MOV32_rm:
- case X86::MOV64rm:
- case X86::LD_Fp64m:
- case X86::MOVSSrm:
- case X86::MOVSDrm:
- case X86::MOVAPSrm:
- case X86::MOVAPDrm:
- case X86::MMX_MOVD64rm:
- case X86::MMX_MOVQ64rm: {
- // Loads from constant pools are trivially rematerializable.
- if (MI->getOperand(1).isReg() &&
- MI->getOperand(2).isImm() &&
- MI->getOperand(3).isReg() && MI->getOperand(3).getReg() == 0 &&
- (MI->getOperand(4).isCPI() ||
- (MI->getOperand(4).isGlobal() &&
- isGVStub(MI->getOperand(4).getGlobal(), TM)))) {
- unsigned BaseReg = MI->getOperand(1).getReg();
- if (BaseReg == 0)
- return true;
- // Allow re-materialization of PIC load.
- if (!ReMatPICStubLoad && MI->getOperand(4).isGlobal())
- return false;
- MachineRegisterInfo &MRI = MI->getParent()->getParent()->getRegInfo();
- bool isPICBase = false;
- for (MachineRegisterInfo::def_iterator I = MRI.def_begin(BaseReg),
- E = MRI.def_end(); I != E; ++I) {
- MachineInstr *DefMI = I.getOperand().getParent();
- if (DefMI->getOpcode() != X86::MOVPC32r)
- return false;
- assert(!isPICBase && "More than one PIC base?");
- isPICBase = true;
- }
- return isPICBase;
- }
- return false;
- }
-
- case X86::LEA32r:
- case X86::LEA64r: {
- if (MI->getOperand(1).isReg() &&
- MI->getOperand(2).isImm() &&
- MI->getOperand(3).isReg() && MI->getOperand(3).getReg() == 0 &&
- !MI->getOperand(4).isReg()) {
- // lea fi#, lea GV, etc. are all rematerializable.
- unsigned BaseReg = MI->getOperand(1).getReg();
- if (BaseReg == 0)
- return true;
- // Allow re-materialization of lea PICBase + x.
- MachineRegisterInfo &MRI = MI->getParent()->getParent()->getRegInfo();
- return regIsPICBase(BaseReg, MRI);
- }
- return false;
- }
- }
-
- // All other instructions marked M_REMATERIALIZABLE are always trivially
- // rematerializable.
- return true;
-}
-
-void X86InstrInfo::reMaterialize(MachineBasicBlock &MBB,
- MachineBasicBlock::iterator I,
- unsigned DestReg,
- const MachineInstr *Orig) const {
- unsigned SubIdx = Orig->getOperand(0).isReg()
- ? Orig->getOperand(0).getSubReg() : 0;
- bool ChangeSubIdx = SubIdx != 0;
- if (SubIdx && TargetRegisterInfo::isPhysicalRegister(DestReg)) {
- DestReg = RI.getSubReg(DestReg, SubIdx);
- SubIdx = 0;
- }
-
- // MOV32r0 etc. are implemented with xor which clobbers condition code.
- // Re-materialize them as movri instructions to avoid side effects.
- switch (Orig->getOpcode()) {
- case X86::MOV8r0:
- BuildMI(MBB, I, get(X86::MOV8ri), DestReg).addImm(0);
- break;
- case X86::MOV16r0:
- BuildMI(MBB, I, get(X86::MOV16ri), DestReg).addImm(0);
- break;
- case X86::MOV32r0:
- BuildMI(MBB, I, get(X86::MOV32ri), DestReg).addImm(0);
- break;
- case X86::MOV64r0:
- BuildMI(MBB, I, get(X86::MOV64ri32), DestReg).addImm(0);
- break;
- default: {
- MachineInstr *MI = Orig->clone();
- MI->getOperand(0).setReg(DestReg);
- MBB.insert(I, MI);
- break;
- }
- }
-
- if (ChangeSubIdx) {
- MachineInstr *NewMI = prior(I);
- NewMI->getOperand(0).setSubReg(SubIdx);
- }
-}
-
-/// isInvariantLoad - Return true if the specified instruction (which is marked
-/// mayLoad) is loading from a location whose value is invariant across the
-/// function. For example, loading a value from the constant pool or from
-/// from the argument area of a function if it does not change. This should
-/// only return true of *all* loads the instruction does are invariant (if it
-/// does multiple loads).
-bool X86InstrInfo::isInvariantLoad(MachineInstr *MI) const {
- // This code cares about loads from three cases: constant pool entries,
- // invariant argument slots, and global stubs. In order to handle these cases
- // for all of the myriad of X86 instructions, we just scan for a CP/FI/GV
- // operand and base our analysis on it. This is safe because the address of
- // none of these three cases is ever used as anything other than a load base
- // and X86 doesn't have any instructions that load from multiple places.
-
- for (unsigned i = 0, e = MI->getNumOperands(); i != e; ++i) {
- const MachineOperand &MO = MI->getOperand(i);
- // Loads from constant pools are trivially invariant.
- if (MO.isCPI())
- return true;
-
- if (MO.isGlobal())
- return isGVStub(MO.getGlobal(), TM);
-
- // If this is a load from an invariant stack slot, the load is a constant.
- if (MO.isFI()) {
- const MachineFrameInfo &MFI =
- *MI->getParent()->getParent()->getFrameInfo();
- int Idx = MO.getIndex();
- return MFI.isFixedObjectIndex(Idx) && MFI.isImmutableObjectIndex(Idx);
- }
- }
-
- // All other instances of these instructions are presumed to have other
- // issues.
- return false;
-}
-
-/// hasLiveCondCodeDef - True if MI has a condition code def, e.g. EFLAGS, that
-/// is not marked dead.
-static bool hasLiveCondCodeDef(MachineInstr *MI) {
- for (unsigned i = 0, e = MI->getNumOperands(); i != e; ++i) {
- MachineOperand &MO = MI->getOperand(i);
- if (MO.isRegister() && MO.isDef() &&
- MO.getReg() == X86::EFLAGS && !MO.isDead()) {
- return true;
- }
- }
- return false;
-}
-
-/// convertToThreeAddress - This method must be implemented by targets that
-/// set the M_CONVERTIBLE_TO_3_ADDR flag. When this flag is set, the target
-/// may be able to convert a two-address instruction into a true
-/// three-address instruction on demand. This allows the X86 target (for
-/// example) to convert ADD and SHL instructions into LEA instructions if they
-/// would require register copies due to two-addressness.
-///
-/// This method returns a null pointer if the transformation cannot be
-/// performed, otherwise it returns the new instruction.
-///
-MachineInstr *
-X86InstrInfo::convertToThreeAddress(MachineFunction::iterator &MFI,
- MachineBasicBlock::iterator &MBBI,
- LiveVariables &LV) const {
- MachineInstr *MI = MBBI;
- // All instructions input are two-addr instructions. Get the known operands.
- unsigned Dest = MI->getOperand(0).getReg();
- unsigned Src = MI->getOperand(1).getReg();
-
- MachineInstr *NewMI = NULL;
- // FIXME: 16-bit LEA's are really slow on Athlons, but not bad on P4's. When
- // we have better subtarget support, enable the 16-bit LEA generation here.
- bool DisableLEA16 = true;
-
- unsigned MIOpc = MI->getOpcode();
- switch (MIOpc) {
- case X86::SHUFPSrri: {
- assert(MI->getNumOperands() == 4 && "Unknown shufps instruction!");
- if (!TM.getSubtarget<X86Subtarget>().hasSSE2()) return 0;
-
- unsigned A = MI->getOperand(0).getReg();
- unsigned B = MI->getOperand(1).getReg();
- unsigned C = MI->getOperand(2).getReg();
- unsigned M = MI->getOperand(3).getImm();
- if (B != C) return 0;
- NewMI = BuildMI(get(X86::PSHUFDri), A).addReg(B).addImm(M);
- break;
- }
- case X86::SHL64ri: {
- assert(MI->getNumOperands() >= 3 && "Unknown shift instruction!");
- // NOTE: LEA doesn't produce flags like shift does, but LLVM never uses
- // the flags produced by a shift yet, so this is safe.
- unsigned Dest = MI->getOperand(0).getReg();
- unsigned Src = MI->getOperand(1).getReg();
- unsigned ShAmt = MI->getOperand(2).getImm();
- if (ShAmt == 0 || ShAmt >= 4) return 0;
-
- NewMI = BuildMI(get(X86::LEA64r), Dest)
- .addReg(0).addImm(1 << ShAmt).addReg(Src).addImm(0);
- break;
- }
- case X86::SHL32ri: {
- assert(MI->getNumOperands() >= 3 && "Unknown shift instruction!");
- // NOTE: LEA doesn't produce flags like shift does, but LLVM never uses
- // the flags produced by a shift yet, so this is safe.
- unsigned Dest = MI->getOperand(0).getReg();
- unsigned Src = MI->getOperand(1).getReg();
- unsigned ShAmt = MI->getOperand(2).getImm();
- if (ShAmt == 0 || ShAmt >= 4) return 0;
-
- unsigned Opc = TM.getSubtarget<X86Subtarget>().is64Bit() ?
- X86::LEA64_32r : X86::LEA32r;
- NewMI = BuildMI(get(Opc), Dest)
- .addReg(0).addImm(1 << ShAmt).addReg(Src).addImm(0);
- break;
- }
- case X86::SHL16ri: {
- assert(MI->getNumOperands() >= 3 && "Unknown shift instruction!");
- // NOTE: LEA doesn't produce flags like shift does, but LLVM never uses
- // the flags produced by a shift yet, so this is safe.
- unsigned Dest = MI->getOperand(0).getReg();
- unsigned Src = MI->getOperand(1).getReg();
- unsigned ShAmt = MI->getOperand(2).getImm();
- if (ShAmt == 0 || ShAmt >= 4) return 0;
-
- if (DisableLEA16) {
- // If 16-bit LEA is disabled, use 32-bit LEA via subregisters.
- MachineRegisterInfo &RegInfo = MFI->getParent()->getRegInfo();
- unsigned Opc = TM.getSubtarget<X86Subtarget>().is64Bit()
- ? X86::LEA64_32r : X86::LEA32r;
- unsigned leaInReg = RegInfo.createVirtualRegister(&X86::GR32RegClass);
- unsigned leaOutReg = RegInfo.createVirtualRegister(&X86::GR32RegClass);
-
- // Build and insert into an implicit UNDEF value. This is OK because
- // well be shifting and then extracting the lower 16-bits.
- MachineInstr *Undef = BuildMI(get(X86::IMPLICIT_DEF), leaInReg);
-
- MachineInstr *Ins =
- BuildMI(get(X86::INSERT_SUBREG),leaInReg)
- .addReg(leaInReg).addReg(Src).addImm(X86::SUBREG_16BIT);
-
- NewMI = BuildMI(get(Opc), leaOutReg)
- .addReg(0).addImm(1 << ShAmt).addReg(leaInReg).addImm(0);
-
- MachineInstr *Ext =
- BuildMI(get(X86::EXTRACT_SUBREG), Dest)
- .addReg(leaOutReg).addImm(X86::SUBREG_16BIT);
- Ext->copyKillDeadInfo(MI);
-
- MFI->insert(MBBI, Undef);
- MFI->insert(MBBI, Ins); // Insert the insert_subreg
- LV.instructionChanged(MI, NewMI); // Update live variables
- LV.addVirtualRegisterKilled(leaInReg, NewMI);
- MFI->insert(MBBI, NewMI); // Insert the new inst
- LV.addVirtualRegisterKilled(leaOutReg, Ext);
- MFI->insert(MBBI, Ext); // Insert the extract_subreg
- return Ext;
- } else {
- NewMI = BuildMI(get(X86::LEA16r), Dest)
- .addReg(0).addImm(1 << ShAmt).addReg(Src).addImm(0);
- }
- break;
- }
- default: {
- // The following opcodes also sets the condition code register(s). Only
- // convert them to equivalent lea if the condition code register def's
- // are dead!
- if (hasLiveCondCodeDef(MI))
- return 0;
-
- bool is64Bit = TM.getSubtarget<X86Subtarget>().is64Bit();
- switch (MIOpc) {
- default: return 0;
- case X86::INC64r:
- case X86::INC32r: {
- assert(MI->getNumOperands() >= 2 && "Unknown inc instruction!");
- unsigned Opc = MIOpc == X86::INC64r ? X86::LEA64r
- : (is64Bit ? X86::LEA64_32r : X86::LEA32r);
- NewMI = addRegOffset(BuildMI(get(Opc), Dest), Src, 1);
- break;
- }
- case X86::INC16r:
- case X86::INC64_16r:
- if (DisableLEA16) return 0;
- assert(MI->getNumOperands() >= 2 && "Unknown inc instruction!");
- NewMI = addRegOffset(BuildMI(get(X86::LEA16r), Dest), Src, 1);
- break;
- case X86::DEC64r:
- case X86::DEC32r: {
- assert(MI->getNumOperands() >= 2 && "Unknown dec instruction!");
- unsigned Opc = MIOpc == X86::DEC64r ? X86::LEA64r
- : (is64Bit ? X86::LEA64_32r : X86::LEA32r);
- NewMI = addRegOffset(BuildMI(get(Opc), Dest), Src, -1);
- break;
- }
- case X86::DEC16r:
- case X86::DEC64_16r:
- if (DisableLEA16) return 0;
- assert(MI->getNumOperands() >= 2 && "Unknown dec instruction!");
- NewMI = addRegOffset(BuildMI(get(X86::LEA16r), Dest), Src, -1);
- break;
- case X86::ADD64rr:
- case X86::ADD32rr: {
- assert(MI->getNumOperands() >= 3 && "Unknown add instruction!");
- unsigned Opc = MIOpc == X86::ADD64rr ? X86::LEA64r
- : (is64Bit ? X86::LEA64_32r : X86::LEA32r);
- NewMI = addRegReg(BuildMI(get(Opc), Dest), Src,
- MI->getOperand(2).getReg());
- break;
- }
- case X86::ADD16rr:
- if (DisableLEA16) return 0;
- assert(MI->getNumOperands() >= 3 && "Unknown add instruction!");
- NewMI = addRegReg(BuildMI(get(X86::LEA16r), Dest), Src,
- MI->getOperand(2).getReg());
- break;
- case X86::ADD64ri32:
- case X86::ADD64ri8:
- assert(MI->getNumOperands() >= 3 && "Unknown add instruction!");
- if (MI->getOperand(2).isImmediate())
- NewMI = addRegOffset(BuildMI(get(X86::LEA64r), Dest), Src,
- MI->getOperand(2).getImm());
- break;
- case X86::ADD32ri:
- case X86::ADD32ri8:
- assert(MI->getNumOperands() >= 3 && "Unknown add instruction!");
- if (MI->getOperand(2).isImmediate()) {
- unsigned Opc = is64Bit ? X86::LEA64_32r : X86::LEA32r;
- NewMI = addRegOffset(BuildMI(get(Opc), Dest), Src,
- MI->getOperand(2).getImm());
- }
- break;
- case X86::ADD16ri:
- case X86::ADD16ri8:
- if (DisableLEA16) return 0;
- assert(MI->getNumOperands() >= 3 && "Unknown add instruction!");
- if (MI->getOperand(2).isImmediate())
- NewMI = addRegOffset(BuildMI(get(X86::LEA16r), Dest), Src,
- MI->getOperand(2).getImm());
- break;
- case X86::SHL16ri:
- if (DisableLEA16) return 0;
- case X86::SHL32ri:
- case X86::SHL64ri: {
- assert(MI->getNumOperands() >= 3 && MI->getOperand(2).isImmediate() &&
- "Unknown shl instruction!");
- unsigned ShAmt = MI->getOperand(2).getImm();
- if (ShAmt == 1 || ShAmt == 2 || ShAmt == 3) {
- X86AddressMode AM;
- AM.Scale = 1 << ShAmt;
- AM.IndexReg = Src;
- unsigned Opc = MIOpc == X86::SHL64ri ? X86::LEA64r
- : (MIOpc == X86::SHL32ri
- ? (is64Bit ? X86::LEA64_32r : X86::LEA32r) : X86::LEA16r);
- NewMI = addFullAddress(BuildMI(get(Opc), Dest), AM);
- }
- break;
- }
- }
- }
- }
-
- if (!NewMI) return 0;
-
- NewMI->copyKillDeadInfo(MI);
- LV.instructionChanged(MI, NewMI); // Update live variables
- MFI->insert(MBBI, NewMI); // Insert the new inst
- return NewMI;
-}
-
-/// commuteInstruction - We have a few instructions that must be hacked on to
-/// commute them.
-///
-MachineInstr *X86InstrInfo::commuteInstruction(MachineInstr *MI) const {
- switch (MI->getOpcode()) {
- case X86::SHRD16rri8: // A = SHRD16rri8 B, C, I -> A = SHLD16rri8 C, B, (16-I)
- case X86::SHLD16rri8: // A = SHLD16rri8 B, C, I -> A = SHRD16rri8 C, B, (16-I)
- case X86::SHRD32rri8: // A = SHRD32rri8 B, C, I -> A = SHLD32rri8 C, B, (32-I)
- case X86::SHLD32rri8: // A = SHLD32rri8 B, C, I -> A = SHRD32rri8 C, B, (32-I)
- case X86::SHRD64rri8: // A = SHRD64rri8 B, C, I -> A = SHLD64rri8 C, B, (64-I)
- case X86::SHLD64rri8:{// A = SHLD64rri8 B, C, I -> A = SHRD64rri8 C, B, (64-I)
- unsigned Opc;
- unsigned Size;
- switch (MI->getOpcode()) {
- default: assert(0 && "Unreachable!");
- case X86::SHRD16rri8: Size = 16; Opc = X86::SHLD16rri8; break;
- case X86::SHLD16rri8: Size = 16; Opc = X86::SHRD16rri8; break;
- case X86::SHRD32rri8: Size = 32; Opc = X86::SHLD32rri8; break;
- case X86::SHLD32rri8: Size = 32; Opc = X86::SHRD32rri8; break;
- case X86::SHRD64rri8: Size = 64; Opc = X86::SHLD64rri8; break;
- case X86::SHLD64rri8: Size = 64; Opc = X86::SHRD64rri8; break;
- }
- unsigned Amt = MI->getOperand(3).getImm();
- unsigned A = MI->getOperand(0).getReg();
- unsigned B = MI->getOperand(1).getReg();
- unsigned C = MI->getOperand(2).getReg();
- bool BisKill = MI->getOperand(1).isKill();
- bool CisKill = MI->getOperand(2).isKill();
- // If machine instrs are no longer in two-address forms, update
- // destination register as well.
- if (A == B) {
- // Must be two address instruction!
- assert(MI->getDesc().getOperandConstraint(0, TOI::TIED_TO) &&
- "Expecting a two-address instruction!");
- A = C;
- CisKill = false;
- }
- return BuildMI(get(Opc), A).addReg(C, false, false, CisKill)
- .addReg(B, false, false, BisKill).addImm(Size-Amt);
- }
- case X86::CMOVB16rr:
- case X86::CMOVB32rr:
- case X86::CMOVB64rr:
- case X86::CMOVAE16rr:
- case X86::CMOVAE32rr:
- case X86::CMOVAE64rr:
- case X86::CMOVE16rr:
- case X86::CMOVE32rr:
- case X86::CMOVE64rr:
- case X86::CMOVNE16rr:
- case X86::CMOVNE32rr:
- case X86::CMOVNE64rr:
- case X86::CMOVBE16rr:
- case X86::CMOVBE32rr:
- case X86::CMOVBE64rr:
- case X86::CMOVA16rr:
- case X86::CMOVA32rr:
- case X86::CMOVA64rr:
- case X86::CMOVL16rr:
- case X86::CMOVL32rr:
- case X86::CMOVL64rr:
- case X86::CMOVGE16rr:
- case X86::CMOVGE32rr:
- case X86::CMOVGE64rr:
- case X86::CMOVLE16rr:
- case X86::CMOVLE32rr:
- case X86::CMOVLE64rr:
- case X86::CMOVG16rr:
- case X86::CMOVG32rr:
- case X86::CMOVG64rr:
- case X86::CMOVS16rr:
- case X86::CMOVS32rr:
- case X86::CMOVS64rr:
- case X86::CMOVNS16rr:
- case X86::CMOVNS32rr:
- case X86::CMOVNS64rr:
- case X86::CMOVP16rr:
- case X86::CMOVP32rr:
- case X86::CMOVP64rr:
- case X86::CMOVNP16rr:
- case X86::CMOVNP32rr:
- case X86::CMOVNP64rr: {
- unsigned Opc = 0;
- switch (MI->getOpcode()) {
- default: break;
- case X86::CMOVB16rr: Opc = X86::CMOVAE16rr; break;
- case X86::CMOVB32rr: Opc = X86::CMOVAE32rr; break;
- case X86::CMOVB64rr: Opc = X86::CMOVAE64rr; break;
- case X86::CMOVAE16rr: Opc = X86::CMOVB16rr; break;
- case X86::CMOVAE32rr: Opc = X86::CMOVB32rr; break;
- case X86::CMOVAE64rr: Opc = X86::CMOVB64rr; break;
- case X86::CMOVE16rr: Opc = X86::CMOVNE16rr; break;
- case X86::CMOVE32rr: Opc = X86::CMOVNE32rr; break;
- case X86::CMOVE64rr: Opc = X86::CMOVNE64rr; break;
- case X86::CMOVNE16rr: Opc = X86::CMOVE16rr; break;
- case X86::CMOVNE32rr: Opc = X86::CMOVE32rr; break;
- case X86::CMOVNE64rr: Opc = X86::CMOVE64rr; break;
- case X86::CMOVBE16rr: Opc = X86::CMOVA16rr; break;
- case X86::CMOVBE32rr: Opc = X86::CMOVA32rr; break;
- case X86::CMOVBE64rr: Opc = X86::CMOVA64rr; break;
- case X86::CMOVA16rr: Opc = X86::CMOVBE16rr; break;
- case X86::CMOVA32rr: Opc = X86::CMOVBE32rr; break;
- case X86::CMOVA64rr: Opc = X86::CMOVBE64rr; break;
- case X86::CMOVL16rr: Opc = X86::CMOVGE16rr; break;
- case X86::CMOVL32rr: Opc = X86::CMOVGE32rr; break;
- case X86::CMOVL64rr: Opc = X86::CMOVGE64rr; break;
- case X86::CMOVGE16rr: Opc = X86::CMOVL16rr; break;
- case X86::CMOVGE32rr: Opc = X86::CMOVL32rr; break;
- case X86::CMOVGE64rr: Opc = X86::CMOVL64rr; break;
- case X86::CMOVLE16rr: Opc = X86::CMOVG16rr; break;
- case X86::CMOVLE32rr: Opc = X86::CMOVG32rr; break;
- case X86::CMOVLE64rr: Opc = X86::CMOVG64rr; break;
- case X86::CMOVG16rr: Opc = X86::CMOVLE16rr; break;
- case X86::CMOVG32rr: Opc = X86::CMOVLE32rr; break;
- case X86::CMOVG64rr: Opc = X86::CMOVLE64rr; break;
- case X86::CMOVS16rr: Opc = X86::CMOVNS16rr; break;
- case X86::CMOVS32rr: Opc = X86::CMOVNS32rr; break;
- case X86::CMOVS64rr: Opc = X86::CMOVNS32rr; break;
- case X86::CMOVNS16rr: Opc = X86::CMOVS16rr; break;
- case X86::CMOVNS32rr: Opc = X86::CMOVS32rr; break;
- case X86::CMOVNS64rr: Opc = X86::CMOVS64rr; break;
- case X86::CMOVP16rr: Opc = X86::CMOVNP16rr; break;
- case X86::CMOVP32rr: Opc = X86::CMOVNP32rr; break;
- case X86::CMOVP64rr: Opc = X86::CMOVNP32rr; break;
- case X86::CMOVNP16rr: Opc = X86::CMOVP16rr; break;
- case X86::CMOVNP32rr: Opc = X86::CMOVP32rr; break;
- case X86::CMOVNP64rr: Opc = X86::CMOVP64rr; break;
- }
-
- MI->setDesc(get(Opc));
- // Fallthrough intended.
- }
- default:
- return TargetInstrInfoImpl::commuteInstruction(MI);
- }
-}
-
-static X86::CondCode GetCondFromBranchOpc(unsigned BrOpc) {
- switch (BrOpc) {
- default: return X86::COND_INVALID;
- case X86::JE: return X86::COND_E;
- case X86::JNE: return X86::COND_NE;
- case X86::JL: return X86::COND_L;
- case X86::JLE: return X86::COND_LE;
- case X86::JG: return X86::COND_G;
- case X86::JGE: return X86::COND_GE;
- case X86::JB: return X86::COND_B;
- case X86::JBE: return X86::COND_BE;
- case X86::JA: return X86::COND_A;
- case X86::JAE: return X86::COND_AE;
- case X86::JS: return X86::COND_S;
- case X86::JNS: return X86::COND_NS;
- case X86::JP: return X86::COND_P;
- case X86::JNP: return X86::COND_NP;
- case X86::JO: return X86::COND_O;
- case X86::JNO: return X86::COND_NO;
- }
-}
-
-unsigned X86::GetCondBranchFromCond(X86::CondCode CC) {
- switch (CC) {
- default: assert(0 && "Illegal condition code!");
- case X86::COND_E: return X86::JE;
- case X86::COND_NE: return X86::JNE;
- case X86::COND_L: return X86::JL;
- case X86::COND_LE: return X86::JLE;
- case X86::COND_G: return X86::JG;
- case X86::COND_GE: return X86::JGE;
- case X86::COND_B: return X86::JB;
- case X86::COND_BE: return X86::JBE;
- case X86::COND_A: return X86::JA;
- case X86::COND_AE: return X86::JAE;
- case X86::COND_S: return X86::JS;
- case X86::COND_NS: return X86::JNS;
- case X86::COND_P: return X86::JP;
- case X86::COND_NP: return X86::JNP;
- case X86::COND_O: return X86::JO;
- case X86::COND_NO: return X86::JNO;
- }
-}
-
-/// GetOppositeBranchCondition - Return the inverse of the specified condition,
-/// e.g. turning COND_E to COND_NE.
-X86::CondCode X86::GetOppositeBranchCondition(X86::CondCode CC) {
- switch (CC) {
- default: assert(0 && "Illegal condition code!");
- case X86::COND_E: return X86::COND_NE;
- case X86::COND_NE: return X86::COND_E;
- case X86::COND_L: return X86::COND_GE;
- case X86::COND_LE: return X86::COND_G;
- case X86::COND_G: return X86::COND_LE;
- case X86::COND_GE: return X86::COND_L;
- case X86::COND_B: return X86::COND_AE;
- case X86::COND_BE: return X86::COND_A;
- case X86::COND_A: return X86::COND_BE;
- case X86::COND_AE: return X86::COND_B;
- case X86::COND_S: return X86::COND_NS;
- case X86::COND_NS: return X86::COND_S;
- case X86::COND_P: return X86::COND_NP;
- case X86::COND_NP: return X86::COND_P;
- case X86::COND_O: return X86::COND_NO;
- case X86::COND_NO: return X86::COND_O;
- }
-}
-
-bool X86InstrInfo::isUnpredicatedTerminator(const MachineInstr *MI) const {
- const TargetInstrDesc &TID = MI->getDesc();
- if (!TID.isTerminator()) return false;
-
- // Conditional branch is a special case.
- if (TID.isBranch() && !TID.isBarrier())
- return true;
- if (!TID.isPredicable())
- return true;
- return !isPredicated(MI);
-}
-
-// For purposes of branch analysis do not count FP_REG_KILL as a terminator.
-static bool isBrAnalysisUnpredicatedTerminator(const MachineInstr *MI,
- const X86InstrInfo &TII) {
- if (MI->getOpcode() == X86::FP_REG_KILL)
- return false;
- return TII.isUnpredicatedTerminator(MI);
-}
-
-bool X86InstrInfo::AnalyzeBranch(MachineBasicBlock &MBB,
- MachineBasicBlock *&TBB,
- MachineBasicBlock *&FBB,
- std::vector<MachineOperand> &Cond) const {
- // If the block has no terminators, it just falls into the block after it.
- MachineBasicBlock::iterator I = MBB.end();
- if (I == MBB.begin() || !isBrAnalysisUnpredicatedTerminator(--I, *this))
- return false;
-
- // Get the last instruction in the block.
- MachineInstr *LastInst = I;
-
- // If there is only one terminator instruction, process it.
- if (I == MBB.begin() || !isBrAnalysisUnpredicatedTerminator(--I, *this)) {
- if (!LastInst->getDesc().isBranch())
- return true;
-
- // If the block ends with a branch there are 3 possibilities:
- // it's an unconditional, conditional, or indirect branch.
-
- if (LastInst->getOpcode() == X86::JMP) {
- TBB = LastInst->getOperand(0).getMBB();
- return false;
- }
- X86::CondCode BranchCode = GetCondFromBranchOpc(LastInst->getOpcode());
- if (BranchCode == X86::COND_INVALID)
- return true; // Can't handle indirect branch.
-
- // Otherwise, block ends with fall-through condbranch.
- TBB = LastInst->getOperand(0).getMBB();
- Cond.push_back(MachineOperand::CreateImm(BranchCode));
- return false;
- }
-
- // Get the instruction before it if it's a terminator.
- MachineInstr *SecondLastInst = I;
-
- // If there are three terminators, we don't know what sort of block this is.
- if (SecondLastInst && I != MBB.begin() &&
- isBrAnalysisUnpredicatedTerminator(--I, *this))
- return true;
-
- // If the block ends with X86::JMP and a conditional branch, handle it.
- X86::CondCode BranchCode = GetCondFromBranchOpc(SecondLastInst->getOpcode());
- if (BranchCode != X86::COND_INVALID && LastInst->getOpcode() == X86::JMP) {
- TBB = SecondLastInst->getOperand(0).getMBB();
- Cond.push_back(MachineOperand::CreateImm(BranchCode));
- FBB = LastInst->getOperand(0).getMBB();
- return false;
- }
-
- // If the block ends with two X86::JMPs, handle it. The second one is not
- // executed, so remove it.
- if (SecondLastInst->getOpcode() == X86::JMP &&
- LastInst->getOpcode() == X86::JMP) {
- TBB = SecondLastInst->getOperand(0).getMBB();
- I = LastInst;
- I->eraseFromParent();
- return false;
- }
-
- // Otherwise, can't handle this.
- return true;
-}
-
-unsigned X86InstrInfo::RemoveBranch(MachineBasicBlock &MBB) const {
- MachineBasicBlock::iterator I = MBB.end();
- if (I == MBB.begin()) return 0;
- --I;
- if (I->getOpcode() != X86::JMP &&
- GetCondFromBranchOpc(I->getOpcode()) == X86::COND_INVALID)
- return 0;
-
- // Remove the branch.
- I->eraseFromParent();
-
- I = MBB.end();
-
- if (I == MBB.begin()) return 1;
- --I;
- if (GetCondFromBranchOpc(I->getOpcode()) == X86::COND_INVALID)
- return 1;
-
- // Remove the branch.
- I->eraseFromParent();
- return 2;
-}
-
-static const MachineInstrBuilder &X86InstrAddOperand(MachineInstrBuilder &MIB,
- MachineOperand &MO) {
- if (MO.isRegister())
- MIB = MIB.addReg(MO.getReg(), MO.isDef(), MO.isImplicit(),
- false, false, MO.getSubReg());
- else if (MO.isImmediate())
- MIB = MIB.addImm(MO.getImm());
- else if (MO.isFrameIndex())
- MIB = MIB.addFrameIndex(MO.getIndex());
- else if (MO.isGlobalAddress())
- MIB = MIB.addGlobalAddress(MO.getGlobal(), MO.getOffset());
- else if (MO.isConstantPoolIndex())
- MIB = MIB.addConstantPoolIndex(MO.getIndex(), MO.getOffset());
- else if (MO.isJumpTableIndex())
- MIB = MIB.addJumpTableIndex(MO.getIndex());
- else if (MO.isExternalSymbol())
- MIB = MIB.addExternalSymbol(MO.getSymbolName());
- else
- assert(0 && "Unknown operand for X86InstrAddOperand!");
-
- return MIB;
-}
-
-unsigned
-X86InstrInfo::InsertBranch(MachineBasicBlock &MBB, MachineBasicBlock *TBB,
- MachineBasicBlock *FBB,
- const std::vector<MachineOperand> &Cond) const {
- // Shouldn't be a fall through.
- assert(TBB && "InsertBranch must not be told to insert a fallthrough");
- assert((Cond.size() == 1 || Cond.size() == 0) &&
- "X86 branch conditions have one component!");
-
- if (FBB == 0) { // One way branch.
- if (Cond.empty()) {
- // Unconditional branch?
- BuildMI(&MBB, get(X86::JMP)).addMBB(TBB);
- } else {
- // Conditional branch.
- unsigned Opc = GetCondBranchFromCond((X86::CondCode)Cond[0].getImm());
- BuildMI(&MBB, get(Opc)).addMBB(TBB);
- }
- return 1;
- }
-
- // Two-way Conditional branch.
- unsigned Opc = GetCondBranchFromCond((X86::CondCode)Cond[0].getImm());
- BuildMI(&MBB, get(Opc)).addMBB(TBB);
- BuildMI(&MBB, get(X86::JMP)).addMBB(FBB);
- return 2;
-}
-
-void X86InstrInfo::copyRegToReg(MachineBasicBlock &MBB,
- MachineBasicBlock::iterator MI,
- unsigned DestReg, unsigned SrcReg,
- const TargetRegisterClass *DestRC,
- const TargetRegisterClass *SrcRC) const {
- if (DestRC == SrcRC) {
- unsigned Opc;
- if (DestRC == &X86::GR64RegClass) {
- Opc = X86::MOV64rr;
- } else if (DestRC == &X86::GR32RegClass) {
- Opc = X86::MOV32rr;
- } else if (DestRC == &X86::GR16RegClass) {
- Opc = X86::MOV16rr;
- } else if (DestRC == &X86::GR8RegClass) {
- Opc = X86::MOV8rr;
- } else if (DestRC == &X86::GR32_RegClass) {
- Opc = X86::MOV32_rr;
- } else if (DestRC == &X86::GR16_RegClass) {
- Opc = X86::MOV16_rr;
- } else if (DestRC == &X86::RFP32RegClass) {
- Opc = X86::MOV_Fp3232;
- } else if (DestRC == &X86::RFP64RegClass || DestRC == &X86::RSTRegClass) {
- Opc = X86::MOV_Fp6464;
- } else if (DestRC == &X86::RFP80RegClass) {
- Opc = X86::MOV_Fp8080;
- } else if (DestRC == &X86::FR32RegClass) {
- Opc = X86::FsMOVAPSrr;
- } else if (DestRC == &X86::FR64RegClass) {
- Opc = X86::FsMOVAPDrr;
- } else if (DestRC == &X86::VR128RegClass) {
- Opc = X86::MOVAPSrr;
- } else if (DestRC == &X86::VR64RegClass) {
- Opc = X86::MMX_MOVQ64rr;
- } else {
- assert(0 && "Unknown regclass");
- abort();
- }
- BuildMI(MBB, MI, get(Opc), DestReg).addReg(SrcReg);
- return;
- }
-
- // Moving EFLAGS to / from another register requires a push and a pop.
- if (SrcRC == &X86::CCRRegClass) {
- assert(SrcReg == X86::EFLAGS);
- if (DestRC == &X86::GR64RegClass) {
- BuildMI(MBB, MI, get(X86::PUSHFQ));
- BuildMI(MBB, MI, get(X86::POP64r), DestReg);
- return;
- } else if (DestRC == &X86::GR32RegClass) {
- BuildMI(MBB, MI, get(X86::PUSHFD));
- BuildMI(MBB, MI, get(X86::POP32r), DestReg);
- return;
- }
- } else if (DestRC == &X86::CCRRegClass) {
- assert(DestReg == X86::EFLAGS);
- if (SrcRC == &X86::GR64RegClass) {
- BuildMI(MBB, MI, get(X86::PUSH64r)).addReg(SrcReg);
- BuildMI(MBB, MI, get(X86::POPFQ));
- return;
- } else if (SrcRC == &X86::GR32RegClass) {
- BuildMI(MBB, MI, get(X86::PUSH32r)).addReg(SrcReg);
- BuildMI(MBB, MI, get(X86::POPFD));
- return;
- }
- }
-
- // Moving from ST(0) turns into FpGET_ST0_32 etc.
- if (SrcRC == &X86::RSTRegClass) {
- // Copying from ST(0)/ST(1).
- assert((SrcReg == X86::ST0 || SrcReg == X86::ST1) &&
- "Can only copy from ST(0)/ST(1) right now");
- bool isST0 = SrcReg == X86::ST0;
- unsigned Opc;
- if (DestRC == &X86::RFP32RegClass)
- Opc = isST0 ? X86::FpGET_ST0_32 : X86::FpGET_ST1_32;
- else if (DestRC == &X86::RFP64RegClass)
- Opc = isST0 ? X86::FpGET_ST0_64 : X86::FpGET_ST1_64;
- else {
- assert(DestRC == &X86::RFP80RegClass);
- Opc = isST0 ? X86::FpGET_ST0_80 : X86::FpGET_ST1_80;
- }
- BuildMI(MBB, MI, get(Opc), DestReg);
- return;
- }
-
- // Moving to ST(0) turns into FpSET_ST0_32 etc.
- if (DestRC == &X86::RSTRegClass) {
- // Copying to ST(0). FIXME: handle ST(1) also
- assert(DestReg == X86::ST0 && "Can only copy to TOS right now");
- unsigned Opc;
- if (SrcRC == &X86::RFP32RegClass)
- Opc = X86::FpSET_ST0_32;
- else if (SrcRC == &X86::RFP64RegClass)
- Opc = X86::FpSET_ST0_64;
- else {
- assert(SrcRC == &X86::RFP80RegClass);
- Opc = X86::FpSET_ST0_80;
- }
- BuildMI(MBB, MI, get(Opc)).addReg(SrcReg);
- return;
- }
-
- assert(0 && "Not yet supported!");
- abort();
-}
-
-static unsigned getStoreRegOpcode(const TargetRegisterClass *RC,
- unsigned StackAlign) {
- unsigned Opc = 0;
- if (RC == &X86::GR64RegClass) {
- Opc = X86::MOV64mr;
- } else if (RC == &X86::GR32RegClass) {
- Opc = X86::MOV32mr;
- } else if (RC == &X86::GR16RegClass) {
- Opc = X86::MOV16mr;
- } else if (RC == &X86::GR8RegClass) {
- Opc = X86::MOV8mr;
- } else if (RC == &X86::GR32_RegClass) {
- Opc = X86::MOV32_mr;
- } else if (RC == &X86::GR16_RegClass) {
- Opc = X86::MOV16_mr;
- } else if (RC == &X86::RFP80RegClass) {
- Opc = X86::ST_FpP80m; // pops
- } else if (RC == &X86::RFP64RegClass) {
- Opc = X86::ST_Fp64m;
- } else if (RC == &X86::RFP32RegClass) {
- Opc = X86::ST_Fp32m;
- } else if (RC == &X86::FR32RegClass) {
- Opc = X86::MOVSSmr;
- } else if (RC == &X86::FR64RegClass) {
- Opc = X86::MOVSDmr;
- } else if (RC == &X86::VR128RegClass) {
- // FIXME: Use movaps once we are capable of selectively
- // aligning functions that spill SSE registers on 16-byte boundaries.
- Opc = StackAlign >= 16 ? X86::MOVAPSmr : X86::MOVUPSmr;
- } else if (RC == &X86::VR64RegClass) {
- Opc = X86::MMX_MOVQ64mr;
- } else {
- assert(0 && "Unknown regclass");
- abort();
- }
-
- return Opc;
-}
-
-void X86InstrInfo::storeRegToStackSlot(MachineBasicBlock &MBB,
- MachineBasicBlock::iterator MI,
- unsigned SrcReg, bool isKill, int FrameIdx,
- const TargetRegisterClass *RC) const {
- unsigned Opc = getStoreRegOpcode(RC, RI.getStackAlignment());
- addFrameReference(BuildMI(MBB, MI, get(Opc)), FrameIdx)
- .addReg(SrcReg, false, false, isKill);
-}
-
-void X86InstrInfo::storeRegToAddr(MachineFunction &MF, unsigned SrcReg,
- bool isKill,
- SmallVectorImpl<MachineOperand> &Addr,
- const TargetRegisterClass *RC,
- SmallVectorImpl<MachineInstr*> &NewMIs) const {
- unsigned Opc = getStoreRegOpcode(RC, RI.getStackAlignment());
- MachineInstrBuilder MIB = BuildMI(get(Opc));
- for (unsigned i = 0, e = Addr.size(); i != e; ++i)
- MIB = X86InstrAddOperand(MIB, Addr[i]);
- MIB.addReg(SrcReg, false, false, isKill);
- NewMIs.push_back(MIB);
-}
-
-static unsigned getLoadRegOpcode(const TargetRegisterClass *RC,
- unsigned StackAlign) {
- unsigned Opc = 0;
- if (RC == &X86::GR64RegClass) {
- Opc = X86::MOV64rm;
- } else if (RC == &X86::GR32RegClass) {
- Opc = X86::MOV32rm;
- } else if (RC == &X86::GR16RegClass) {
- Opc = X86::MOV16rm;
- } else if (RC == &X86::GR8RegClass) {
- Opc = X86::MOV8rm;
- } else if (RC == &X86::GR32_RegClass) {
- Opc = X86::MOV32_rm;
- } else if (RC == &X86::GR16_RegClass) {
- Opc = X86::MOV16_rm;
- } else if (RC == &X86::RFP80RegClass) {
- Opc = X86::LD_Fp80m;
- } else if (RC == &X86::RFP64RegClass) {
- Opc = X86::LD_Fp64m;
- } else if (RC == &X86::RFP32RegClass) {
- Opc = X86::LD_Fp32m;
- } else if (RC == &X86::FR32RegClass) {
- Opc = X86::MOVSSrm;
- } else if (RC == &X86::FR64RegClass) {
- Opc = X86::MOVSDrm;
- } else if (RC == &X86::VR128RegClass) {
- // FIXME: Use movaps once we are capable of selectively
- // aligning functions that spill SSE registers on 16-byte boundaries.
- Opc = StackAlign >= 16 ? X86::MOVAPSrm : X86::MOVUPSrm;
- } else if (RC == &X86::VR64RegClass) {
- Opc = X86::MMX_MOVQ64rm;
- } else {
- assert(0 && "Unknown regclass");
- abort();
- }
-
- return Opc;
-}
-
-void X86InstrInfo::loadRegFromStackSlot(MachineBasicBlock &MBB,
- MachineBasicBlock::iterator MI,
- unsigned DestReg, int FrameIdx,
- const TargetRegisterClass *RC) const{
- unsigned Opc = getLoadRegOpcode(RC, RI.getStackAlignment());
- addFrameReference(BuildMI(MBB, MI, get(Opc), DestReg), FrameIdx);
-}
-
-void X86InstrInfo::loadRegFromAddr(MachineFunction &MF, unsigned DestReg,
- SmallVectorImpl<MachineOperand> &Addr,
- const TargetRegisterClass *RC,
- SmallVectorImpl<MachineInstr*> &NewMIs) const {
- unsigned Opc = getLoadRegOpcode(RC, RI.getStackAlignment());
- MachineInstrBuilder MIB = BuildMI(get(Opc), DestReg);
- for (unsigned i = 0, e = Addr.size(); i != e; ++i)
- MIB = X86InstrAddOperand(MIB, Addr[i]);
- NewMIs.push_back(MIB);
-}
-
-bool X86InstrInfo::spillCalleeSavedRegisters(MachineBasicBlock &MBB,
- MachineBasicBlock::iterator MI,
- const std::vector<CalleeSavedInfo> &CSI) const {
- if (CSI.empty())
- return false;
-
- bool is64Bit = TM.getSubtarget<X86Subtarget>().is64Bit();
- unsigned SlotSize = is64Bit ? 8 : 4;
-
- MachineFunction &MF = *MBB.getParent();
- X86MachineFunctionInfo *X86FI = MF.getInfo<X86MachineFunctionInfo>();
- X86FI->setCalleeSavedFrameSize(CSI.size() * SlotSize);
-
- unsigned Opc = is64Bit ? X86::PUSH64r : X86::PUSH32r;
- for (unsigned i = CSI.size(); i != 0; --i) {
- unsigned Reg = CSI[i-1].getReg();
- // Add the callee-saved register as live-in. It's killed at the spill.
- MBB.addLiveIn(Reg);
- BuildMI(MBB, MI, get(Opc)).addReg(Reg);
- }
- return true;
-}
-
-bool X86InstrInfo::restoreCalleeSavedRegisters(MachineBasicBlock &MBB,
- MachineBasicBlock::iterator MI,
- const std::vector<CalleeSavedInfo> &CSI) const {
- if (CSI.empty())
- return false;
-
- bool is64Bit = TM.getSubtarget<X86Subtarget>().is64Bit();
-
- unsigned Opc = is64Bit ? X86::POP64r : X86::POP32r;
- for (unsigned i = 0, e = CSI.size(); i != e; ++i) {
- unsigned Reg = CSI[i].getReg();
- BuildMI(MBB, MI, get(Opc), Reg);
- }
- return true;
-}
-
-static MachineInstr *FuseTwoAddrInst(unsigned Opcode,
- SmallVector<MachineOperand,4> &MOs,
- MachineInstr *MI, const TargetInstrInfo &TII) {
- // Create the base instruction with the memory operand as the first part.
- MachineInstr *NewMI = new MachineInstr(TII.get(Opcode), true);
- MachineInstrBuilder MIB(NewMI);
- unsigned NumAddrOps = MOs.size();
- for (unsigned i = 0; i != NumAddrOps; ++i)
- MIB = X86InstrAddOperand(MIB, MOs[i]);
- if (NumAddrOps < 4) // FrameIndex only
- MIB.addImm(1).addReg(0).addImm(0);
-
- // Loop over the rest of the ri operands, converting them over.
- unsigned NumOps = MI->getDesc().getNumOperands()-2;
- for (unsigned i = 0; i != NumOps; ++i) {
- MachineOperand &MO = MI->getOperand(i+2);
- MIB = X86InstrAddOperand(MIB, MO);
- }
- for (unsigned i = NumOps+2, e = MI->getNumOperands(); i != e; ++i) {
- MachineOperand &MO = MI->getOperand(i);
- MIB = X86InstrAddOperand(MIB, MO);
- }
- return MIB;
-}
-
-static MachineInstr *FuseInst(unsigned Opcode, unsigned OpNo,
- SmallVector<MachineOperand,4> &MOs,
- MachineInstr *MI, const TargetInstrInfo &TII) {
- MachineInstr *NewMI = new MachineInstr(TII.get(Opcode), true);
- MachineInstrBuilder MIB(NewMI);
-
- for (unsigned i = 0, e = MI->getNumOperands(); i != e; ++i) {
- MachineOperand &MO = MI->getOperand(i);
- if (i == OpNo) {
- assert(MO.isRegister() && "Expected to fold into reg operand!");
- unsigned NumAddrOps = MOs.size();
- for (unsigned i = 0; i != NumAddrOps; ++i)
- MIB = X86InstrAddOperand(MIB, MOs[i]);
- if (NumAddrOps < 4) // FrameIndex only
- MIB.addImm(1).addReg(0).addImm(0);
- } else {
- MIB = X86InstrAddOperand(MIB, MO);
- }
- }
- return MIB;
-}
-
-static MachineInstr *MakeM0Inst(const TargetInstrInfo &TII, unsigned Opcode,
- SmallVector<MachineOperand,4> &MOs,
- MachineInstr *MI) {
- MachineInstrBuilder MIB = BuildMI(TII.get(Opcode));
-
- unsigned NumAddrOps = MOs.size();
- for (unsigned i = 0; i != NumAddrOps; ++i)
- MIB = X86InstrAddOperand(MIB, MOs[i]);
- if (NumAddrOps < 4) // FrameIndex only
- MIB.addImm(1).addReg(0).addImm(0);
- return MIB.addImm(0);
-}
-
-MachineInstr*
-X86InstrInfo::foldMemoryOperand(MachineInstr *MI, unsigned i,
- SmallVector<MachineOperand,4> &MOs) const {
- const DenseMap<unsigned*, unsigned> *OpcodeTablePtr = NULL;
- bool isTwoAddrFold = false;
- unsigned NumOps = MI->getDesc().getNumOperands();
- bool isTwoAddr = NumOps > 1 &&
- MI->getDesc().getOperandConstraint(1, TOI::TIED_TO) != -1;
-
- MachineInstr *NewMI = NULL;
- // Folding a memory location into the two-address part of a two-address
- // instruction is different than folding it other places. It requires
- // replacing the *two* registers with the memory location.
- if (isTwoAddr && NumOps >= 2 && i < 2 &&
- MI->getOperand(0).isRegister() &&
- MI->getOperand(1).isRegister() &&
- MI->getOperand(0).getReg() == MI->getOperand(1).getReg()) {
- OpcodeTablePtr = &RegOp2MemOpTable2Addr;
- isTwoAddrFold = true;
- } else if (i == 0) { // If operand 0
- if (MI->getOpcode() == X86::MOV16r0)
- NewMI = MakeM0Inst(*this, X86::MOV16mi, MOs, MI);
- else if (MI->getOpcode() == X86::MOV32r0)
- NewMI = MakeM0Inst(*this, X86::MOV32mi, MOs, MI);
- else if (MI->getOpcode() == X86::MOV64r0)
- NewMI = MakeM0Inst(*this, X86::MOV64mi32, MOs, MI);
- else if (MI->getOpcode() == X86::MOV8r0)
- NewMI = MakeM0Inst(*this, X86::MOV8mi, MOs, MI);
- if (NewMI) {
- NewMI->copyKillDeadInfo(MI);
- return NewMI;
- }
-
- OpcodeTablePtr = &RegOp2MemOpTable0;
- } else if (i == 1) {
- OpcodeTablePtr = &RegOp2MemOpTable1;
- } else if (i == 2) {
- OpcodeTablePtr = &RegOp2MemOpTable2;
- }
-
- // If table selected...
- if (OpcodeTablePtr) {
- // Find the Opcode to fuse
- DenseMap<unsigned*, unsigned>::iterator I =
- OpcodeTablePtr->find((unsigned*)MI->getOpcode());
- if (I != OpcodeTablePtr->end()) {
- if (isTwoAddrFold)
- NewMI = FuseTwoAddrInst(I->second, MOs, MI, *this);
- else
- NewMI = FuseInst(I->second, i, MOs, MI, *this);
- NewMI->copyKillDeadInfo(MI);
- return NewMI;
- }
- }
-
- // No fusion
- if (PrintFailedFusing)
- cerr << "We failed to fuse operand " << i << *MI;
- return NULL;
-}
-
-
-MachineInstr* X86InstrInfo::foldMemoryOperand(MachineFunction &MF,
- MachineInstr *MI,
- SmallVectorImpl<unsigned> &Ops,
- int FrameIndex) const {
- // Check switch flag
- if (NoFusing) return NULL;
-
- const MachineFrameInfo *MFI = MF.getFrameInfo();
- unsigned Alignment = MFI->getObjectAlignment(FrameIndex);
- // FIXME: Move alignment requirement into tables?
- if (Alignment < 16) {
- switch (MI->getOpcode()) {
- default: break;
- // Not always safe to fold movsd into these instructions since their load
- // folding variants expects the address to be 16 byte aligned.
- case X86::FsANDNPDrr:
- case X86::FsANDNPSrr:
- case X86::FsANDPDrr:
- case X86::FsANDPSrr:
- case X86::FsORPDrr:
- case X86::FsORPSrr:
- case X86::FsXORPDrr:
- case X86::FsXORPSrr:
- return NULL;
- }
- }
-
- if (Ops.size() == 2 && Ops[0] == 0 && Ops[1] == 1) {
- unsigned NewOpc = 0;
- switch (MI->getOpcode()) {
- default: return NULL;
- case X86::TEST8rr: NewOpc = X86::CMP8ri; break;
- case X86::TEST16rr: NewOpc = X86::CMP16ri; break;
- case X86::TEST32rr: NewOpc = X86::CMP32ri; break;
- case X86::TEST64rr: NewOpc = X86::CMP64ri32; break;
- }
- // Change to CMPXXri r, 0 first.
- MI->setDesc(get(NewOpc));
- MI->getOperand(1).ChangeToImmediate(0);
- } else if (Ops.size() != 1)
- return NULL;
-
- SmallVector<MachineOperand,4> MOs;
- MOs.push_back(MachineOperand::CreateFI(FrameIndex));
- return foldMemoryOperand(MI, Ops[0], MOs);
-}
-
-MachineInstr* X86InstrInfo::foldMemoryOperand(MachineFunction &MF,
- MachineInstr *MI,
- SmallVectorImpl<unsigned> &Ops,
- MachineInstr *LoadMI) const {
- // Check switch flag
- if (NoFusing) return NULL;
-
- unsigned Alignment = 0;
- for (unsigned i = 0, e = LoadMI->getNumMemOperands(); i != e; ++i) {
- const MachineMemOperand &MRO = LoadMI->getMemOperand(i);
- unsigned Align = MRO.getAlignment();
- if (Align > Alignment)
- Alignment = Align;
- }
-
- // FIXME: Move alignment requirement into tables?
- if (Alignment < 16) {
- switch (MI->getOpcode()) {
- default: break;
- // Not always safe to fold movsd into these instructions since their load
- // folding variants expects the address to be 16 byte aligned.
- case X86::FsANDNPDrr:
- case X86::FsANDNPSrr:
- case X86::FsANDPDrr:
- case X86::FsANDPSrr:
- case X86::FsORPDrr:
- case X86::FsORPSrr:
- case X86::FsXORPDrr:
- case X86::FsXORPSrr:
- return NULL;
- }
- }
-
- if (Ops.size() == 2 && Ops[0] == 0 && Ops[1] == 1) {
- unsigned NewOpc = 0;
- switch (MI->getOpcode()) {
- default: return NULL;
- case X86::TEST8rr: NewOpc = X86::CMP8ri; break;
- case X86::TEST16rr: NewOpc = X86::CMP16ri; break;
- case X86::TEST32rr: NewOpc = X86::CMP32ri; break;
- case X86::TEST64rr: NewOpc = X86::CMP64ri32; break;
- }
- // Change to CMPXXri r, 0 first.
- MI->setDesc(get(NewOpc));
- MI->getOperand(1).ChangeToImmediate(0);
- } else if (Ops.size() != 1)
- return NULL;
-
- SmallVector<MachineOperand,4> MOs;
- unsigned NumOps = LoadMI->getDesc().getNumOperands();
- for (unsigned i = NumOps - 4; i != NumOps; ++i)
- MOs.push_back(LoadMI->getOperand(i));
- return foldMemoryOperand(MI, Ops[0], MOs);
-}
-
-
-bool X86InstrInfo::canFoldMemoryOperand(MachineInstr *MI,
- SmallVectorImpl<unsigned> &Ops) const {
- // Check switch flag
- if (NoFusing) return 0;
-
- if (Ops.size() == 2 && Ops[0] == 0 && Ops[1] == 1) {
- switch (MI->getOpcode()) {
- default: return false;
- case X86::TEST8rr:
- case X86::TEST16rr:
- case X86::TEST32rr:
- case X86::TEST64rr:
- return true;
- }
- }
-
- if (Ops.size() != 1)
- return false;
-
- unsigned OpNum = Ops[0];
- unsigned Opc = MI->getOpcode();
- unsigned NumOps = MI->getDesc().getNumOperands();
- bool isTwoAddr = NumOps > 1 &&
- MI->getDesc().getOperandConstraint(1, TOI::TIED_TO) != -1;
-
- // Folding a memory location into the two-address part of a two-address
- // instruction is different than folding it other places. It requires
- // replacing the *two* registers with the memory location.
- const DenseMap<unsigned*, unsigned> *OpcodeTablePtr = NULL;
- if (isTwoAddr && NumOps >= 2 && OpNum < 2) {
- OpcodeTablePtr = &RegOp2MemOpTable2Addr;
- } else if (OpNum == 0) { // If operand 0
- switch (Opc) {
- case X86::MOV16r0:
- case X86::MOV32r0:
- case X86::MOV64r0:
- case X86::MOV8r0:
- return true;
- default: break;
- }
- OpcodeTablePtr = &RegOp2MemOpTable0;
- } else if (OpNum == 1) {
- OpcodeTablePtr = &RegOp2MemOpTable1;
- } else if (OpNum == 2) {
- OpcodeTablePtr = &RegOp2MemOpTable2;
- }
-
- if (OpcodeTablePtr) {
- // Find the Opcode to fuse
- DenseMap<unsigned*, unsigned>::iterator I =
- OpcodeTablePtr->find((unsigned*)Opc);
- if (I != OpcodeTablePtr->end())
- return true;
- }
- return false;
-}
-
-bool X86InstrInfo::unfoldMemoryOperand(MachineFunction &MF, MachineInstr *MI,
- unsigned Reg, bool UnfoldLoad, bool UnfoldStore,
- SmallVectorImpl<MachineInstr*> &NewMIs) const {
- DenseMap<unsigned*, std::pair<unsigned,unsigned> >::iterator I =
- MemOp2RegOpTable.find((unsigned*)MI->getOpcode());
- if (I == MemOp2RegOpTable.end())
- return false;
- unsigned Opc = I->second.first;
- unsigned Index = I->second.second & 0xf;
- bool FoldedLoad = I->second.second & (1 << 4);
- bool FoldedStore = I->second.second & (1 << 5);
- if (UnfoldLoad && !FoldedLoad)
- return false;
- UnfoldLoad &= FoldedLoad;
- if (UnfoldStore && !FoldedStore)
- return false;
- UnfoldStore &= FoldedStore;
-
- const TargetInstrDesc &TID = get(Opc);
- const TargetOperandInfo &TOI = TID.OpInfo[Index];
- const TargetRegisterClass *RC = TOI.isLookupPtrRegClass()
- ? getPointerRegClass() : RI.getRegClass(TOI.RegClass);
- SmallVector<MachineOperand,4> AddrOps;
- SmallVector<MachineOperand,2> BeforeOps;
- SmallVector<MachineOperand,2> AfterOps;
- SmallVector<MachineOperand,4> ImpOps;
- for (unsigned i = 0, e = MI->getNumOperands(); i != e; ++i) {
- MachineOperand &Op = MI->getOperand(i);
- if (i >= Index && i < Index+4)
- AddrOps.push_back(Op);
- else if (Op.isRegister() && Op.isImplicit())
- ImpOps.push_back(Op);
- else if (i < Index)
- BeforeOps.push_back(Op);
- else if (i > Index)
- AfterOps.push_back(Op);
- }
-
- // Emit the load instruction.
- if (UnfoldLoad) {
- loadRegFromAddr(MF, Reg, AddrOps, RC, NewMIs);
- if (UnfoldStore) {
- // Address operands cannot be marked isKill.
- for (unsigned i = 1; i != 5; ++i) {
- MachineOperand &MO = NewMIs[0]->getOperand(i);
- if (MO.isRegister())
- MO.setIsKill(false);
- }
- }
- }
-
- // Emit the data processing instruction.
- MachineInstr *DataMI = new MachineInstr(TID, true);
- MachineInstrBuilder MIB(DataMI);
-
- if (FoldedStore)
- MIB.addReg(Reg, true);
- for (unsigned i = 0, e = BeforeOps.size(); i != e; ++i)
- MIB = X86InstrAddOperand(MIB, BeforeOps[i]);
- if (FoldedLoad)
- MIB.addReg(Reg);
- for (unsigned i = 0, e = AfterOps.size(); i != e; ++i)
- MIB = X86InstrAddOperand(MIB, AfterOps[i]);
- for (unsigned i = 0, e = ImpOps.size(); i != e; ++i) {
- MachineOperand &MO = ImpOps[i];
- MIB.addReg(MO.getReg(), MO.isDef(), true, MO.isKill(), MO.isDead());
- }
- // Change CMP32ri r, 0 back to TEST32rr r, r, etc.
- unsigned NewOpc = 0;
- switch (DataMI->getOpcode()) {
- default: break;
- case X86::CMP64ri32:
- case X86::CMP32ri:
- case X86::CMP16ri:
- case X86::CMP8ri: {
- MachineOperand &MO0 = DataMI->getOperand(0);
- MachineOperand &MO1 = DataMI->getOperand(1);
- if (MO1.getImm() == 0) {
- switch (DataMI->getOpcode()) {
- default: break;
- case X86::CMP64ri32: NewOpc = X86::TEST64rr; break;
- case X86::CMP32ri: NewOpc = X86::TEST32rr; break;
- case X86::CMP16ri: NewOpc = X86::TEST16rr; break;
- case X86::CMP8ri: NewOpc = X86::TEST8rr; break;
- }
- DataMI->setDesc(get(NewOpc));
- MO1.ChangeToRegister(MO0.getReg(), false);
- }
- }
- }
- NewMIs.push_back(DataMI);
-
- // Emit the store instruction.
- if (UnfoldStore) {
- const TargetOperandInfo &DstTOI = TID.OpInfo[0];
- const TargetRegisterClass *DstRC = DstTOI.isLookupPtrRegClass()
- ? getPointerRegClass() : RI.getRegClass(DstTOI.RegClass);
- storeRegToAddr(MF, Reg, true, AddrOps, DstRC, NewMIs);
- }
-
- return true;
-}
-
-bool
-X86InstrInfo::unfoldMemoryOperand(SelectionDAG &DAG, SDNode *N,
- SmallVectorImpl<SDNode*> &NewNodes) const {
- if (!N->isTargetOpcode())
- return false;
-
- DenseMap<unsigned*, std::pair<unsigned,unsigned> >::iterator I =
- MemOp2RegOpTable.find((unsigned*)N->getTargetOpcode());
- if (I == MemOp2RegOpTable.end())
- return false;
- unsigned Opc = I->second.first;
- unsigned Index = I->second.second & 0xf;
- bool FoldedLoad = I->second.second & (1 << 4);
- bool FoldedStore = I->second.second & (1 << 5);
- const TargetInstrDesc &TID = get(Opc);
- const TargetOperandInfo &TOI = TID.OpInfo[Index];
- const TargetRegisterClass *RC = TOI.isLookupPtrRegClass()
- ? getPointerRegClass() : RI.getRegClass(TOI.RegClass);
- std::vector<SDOperand> AddrOps;
- std::vector<SDOperand> BeforeOps;
- std::vector<SDOperand> AfterOps;
- unsigned NumOps = N->getNumOperands();
- for (unsigned i = 0; i != NumOps-1; ++i) {
- SDOperand Op = N->getOperand(i);
- if (i >= Index && i < Index+4)
- AddrOps.push_back(Op);
- else if (i < Index)
- BeforeOps.push_back(Op);
- else if (i > Index)
- AfterOps.push_back(Op);
- }
- SDOperand Chain = N->getOperand(NumOps-1);
- AddrOps.push_back(Chain);
-
- // Emit the load instruction.
- SDNode *Load = 0;
- if (FoldedLoad) {
- MVT::ValueType VT = *RC->vt_begin();
- Load = DAG.getTargetNode(getLoadRegOpcode(RC, RI.getStackAlignment()), VT,
- MVT::Other, &AddrOps[0], AddrOps.size());
- NewNodes.push_back(Load);
- }
-
- // Emit the data processing instruction.
- std::vector<MVT::ValueType> VTs;
- const TargetRegisterClass *DstRC = 0;
- if (TID.getNumDefs() > 0) {
- const TargetOperandInfo &DstTOI = TID.OpInfo[0];
- DstRC = DstTOI.isLookupPtrRegClass()
- ? getPointerRegClass() : RI.getRegClass(DstTOI.RegClass);
- VTs.push_back(*DstRC->vt_begin());
- }
- for (unsigned i = 0, e = N->getNumValues(); i != e; ++i) {
- MVT::ValueType VT = N->getValueType(i);
- if (VT != MVT::Other && i >= (unsigned)TID.getNumDefs())
- VTs.push_back(VT);
- }
- if (Load)
- BeforeOps.push_back(SDOperand(Load, 0));
- std::copy(AfterOps.begin(), AfterOps.end(), std::back_inserter(BeforeOps));
- SDNode *NewNode= DAG.getTargetNode(Opc, VTs, &BeforeOps[0], BeforeOps.size());
- NewNodes.push_back(NewNode);
-
- // Emit the store instruction.
- if (FoldedStore) {
- AddrOps.pop_back();
- AddrOps.push_back(SDOperand(NewNode, 0));
- AddrOps.push_back(Chain);
- SDNode *Store = DAG.getTargetNode(getStoreRegOpcode(DstRC, RI.getStackAlignment()),
- MVT::Other, &AddrOps[0], AddrOps.size());
- NewNodes.push_back(Store);
- }
-
- return true;
-}
-
-unsigned X86InstrInfo::getOpcodeAfterMemoryUnfold(unsigned Opc,
- bool UnfoldLoad, bool UnfoldStore) const {
- DenseMap<unsigned*, std::pair<unsigned,unsigned> >::iterator I =
- MemOp2RegOpTable.find((unsigned*)Opc);
- if (I == MemOp2RegOpTable.end())
- return 0;
- bool FoldedLoad = I->second.second & (1 << 4);
- bool FoldedStore = I->second.second & (1 << 5);
- if (UnfoldLoad && !FoldedLoad)
- return 0;
- if (UnfoldStore && !FoldedStore)
- return 0;
- return I->second.first;
-}
-
-bool X86InstrInfo::BlockHasNoFallThrough(MachineBasicBlock &MBB) const {
- if (MBB.empty()) return false;
-
- switch (MBB.back().getOpcode()) {
- case X86::TCRETURNri:
- case X86::TCRETURNdi:
- case X86::RET: // Return.
- case X86::RETI:
- case X86::TAILJMPd:
- case X86::TAILJMPr:
- case X86::TAILJMPm:
- case X86::JMP: // Uncond branch.
- case X86::JMP32r: // Indirect branch.
- case X86::JMP64r: // Indirect branch (64-bit).
- case X86::JMP32m: // Indirect branch through mem.
- case X86::JMP64m: // Indirect branch through mem (64-bit).
- return true;
- default: return false;
- }
-}
-
-bool X86InstrInfo::
-ReverseBranchCondition(std::vector<MachineOperand> &Cond) const {
- assert(Cond.size() == 1 && "Invalid X86 branch condition!");
- Cond[0].setImm(GetOppositeBranchCondition((X86::CondCode)Cond[0].getImm()));
- return false;
-}
-
-const TargetRegisterClass *X86InstrInfo::getPointerRegClass() const {
- const X86Subtarget *Subtarget = &TM.getSubtarget<X86Subtarget>();
- if (Subtarget->is64Bit())
- return &X86::GR64RegClass;
- else
- return &X86::GR32RegClass;
-}
-
-unsigned X86InstrInfo::sizeOfImm(const TargetInstrDesc *Desc) {
- switch (Desc->TSFlags & X86II::ImmMask) {
- case X86II::Imm8: return 1;
- case X86II::Imm16: return 2;
- case X86II::Imm32: return 4;
- case X86II::Imm64: return 8;
- default: assert(0 && "Immediate size not set!");
- return 0;
- }
-}
-
-/// isX86_64ExtendedReg - Is the MachineOperand a x86-64 extended register?
-/// e.g. r8, xmm8, etc.
-bool X86InstrInfo::isX86_64ExtendedReg(const MachineOperand &MO) {
- if (!MO.isRegister()) return false;
- switch (MO.getReg()) {
- default: break;
- case X86::R8: case X86::R9: case X86::R10: case X86::R11:
- case X86::R12: case X86::R13: case X86::R14: case X86::R15:
- case X86::R8D: case X86::R9D: case X86::R10D: case X86::R11D:
- case X86::R12D: case X86::R13D: case X86::R14D: case X86::R15D:
- case X86::R8W: case X86::R9W: case X86::R10W: case X86::R11W:
- case X86::R12W: case X86::R13W: case X86::R14W: case X86::R15W:
- case X86::R8B: case X86::R9B: case X86::R10B: case X86::R11B:
- case X86::R12B: case X86::R13B: case X86::R14B: case X86::R15B:
- case X86::XMM8: case X86::XMM9: case X86::XMM10: case X86::XMM11:
- case X86::XMM12: case X86::XMM13: case X86::XMM14: case X86::XMM15:
- return true;
- }
- return false;
-}
-
-
-/// determineREX - Determine if the MachineInstr has to be encoded with a X86-64
-/// REX prefix which specifies 1) 64-bit instructions, 2) non-default operand
-/// size, and 3) use of X86-64 extended registers.
-unsigned X86InstrInfo::determineREX(const MachineInstr &MI) {
- unsigned REX = 0;
- const TargetInstrDesc &Desc = MI.getDesc();
-
- // Pseudo instructions do not need REX prefix byte.
- if ((Desc.TSFlags & X86II::FormMask) == X86II::Pseudo)
- return 0;
- if (Desc.TSFlags & X86II::REX_W)
- REX |= 1 << 3;
-
- unsigned NumOps = Desc.getNumOperands();
- if (NumOps) {
- bool isTwoAddr = NumOps > 1 &&
- Desc.getOperandConstraint(1, TOI::TIED_TO) != -1;
-
- // If it accesses SPL, BPL, SIL, or DIL, then it requires a 0x40 REX prefix.
- unsigned i = isTwoAddr ? 1 : 0;
- for (unsigned e = NumOps; i != e; ++i) {
- const MachineOperand& MO = MI.getOperand(i);
- if (MO.isRegister()) {
- unsigned Reg = MO.getReg();
- if (isX86_64NonExtLowByteReg(Reg))
- REX |= 0x40;
- }
- }
-
- switch (Desc.TSFlags & X86II::FormMask) {
- case X86II::MRMInitReg:
- if (isX86_64ExtendedReg(MI.getOperand(0)))
- REX |= (1 << 0) | (1 << 2);
- break;
- case X86II::MRMSrcReg: {
- if (isX86_64ExtendedReg(MI.getOperand(0)))
- REX |= 1 << 2;
- i = isTwoAddr ? 2 : 1;
- for (unsigned e = NumOps; i != e; ++i) {
- const MachineOperand& MO = MI.getOperand(i);
- if (isX86_64ExtendedReg(MO))
- REX |= 1 << 0;
- }
- break;
- }
- case X86II::MRMSrcMem: {
- if (isX86_64ExtendedReg(MI.getOperand(0)))
- REX |= 1 << 2;
- unsigned Bit = 0;
- i = isTwoAddr ? 2 : 1;
- for (; i != NumOps; ++i) {
- const MachineOperand& MO = MI.getOperand(i);
- if (MO.isRegister()) {
- if (isX86_64ExtendedReg(MO))
- REX |= 1 << Bit;
- Bit++;
- }
- }
- break;
- }
- case X86II::MRM0m: case X86II::MRM1m:
- case X86II::MRM2m: case X86II::MRM3m:
- case X86II::MRM4m: case X86II::MRM5m:
- case X86II::MRM6m: case X86II::MRM7m:
- case X86II::MRMDestMem: {
- unsigned e = isTwoAddr ? 5 : 4;
- i = isTwoAddr ? 1 : 0;
- if (NumOps > e && isX86_64ExtendedReg(MI.getOperand(e)))
- REX |= 1 << 2;
- unsigned Bit = 0;
- for (; i != e; ++i) {
- const MachineOperand& MO = MI.getOperand(i);
- if (MO.isRegister()) {
- if (isX86_64ExtendedReg(MO))
- REX |= 1 << Bit;
- Bit++;
- }
- }
- break;
- }
- default: {
- if (isX86_64ExtendedReg(MI.getOperand(0)))
- REX |= 1 << 0;
- i = isTwoAddr ? 2 : 1;
- for (unsigned e = NumOps; i != e; ++i) {
- const MachineOperand& MO = MI.getOperand(i);
- if (isX86_64ExtendedReg(MO))
- REX |= 1 << 2;
- }
- break;
- }
- }
- }
- return REX;
-}
-
-/// sizePCRelativeBlockAddress - This method returns the size of a PC
-/// relative block address instruction
-///
-static unsigned sizePCRelativeBlockAddress() {
- return 4;
-}
-
-/// sizeGlobalAddress - Give the size of the emission of this global address
-///
-static unsigned sizeGlobalAddress(bool dword) {
- return dword ? 8 : 4;
-}
-
-/// sizeConstPoolAddress - Give the size of the emission of this constant
-/// pool address
-///
-static unsigned sizeConstPoolAddress(bool dword) {
- return dword ? 8 : 4;
-}
-
-/// sizeExternalSymbolAddress - Give the size of the emission of this external
-/// symbol
-///
-static unsigned sizeExternalSymbolAddress(bool dword) {
- return dword ? 8 : 4;
-}
-
-/// sizeJumpTableAddress - Give the size of the emission of this jump
-/// table address
-///
-static unsigned sizeJumpTableAddress(bool dword) {
- return dword ? 8 : 4;
-}
-
-static unsigned sizeConstant(unsigned Size) {
- return Size;
-}
-
-static unsigned sizeRegModRMByte(){
- return 1;
-}
-
-static unsigned sizeSIBByte(){
- return 1;
-}
-
-static unsigned getDisplacementFieldSize(const MachineOperand *RelocOp) {
- unsigned FinalSize = 0;
- // If this is a simple integer displacement that doesn't require a relocation.
- if (!RelocOp) {
- FinalSize += sizeConstant(4);
- return FinalSize;
- }
-
- // Otherwise, this is something that requires a relocation.
- if (RelocOp->isGlobalAddress()) {
- FinalSize += sizeGlobalAddress(false);
- } else if (RelocOp->isConstantPoolIndex()) {
- FinalSize += sizeConstPoolAddress(false);
- } else if (RelocOp->isJumpTableIndex()) {
- FinalSize += sizeJumpTableAddress(false);
- } else {
- assert(0 && "Unknown value to relocate!");
- }
- return FinalSize;
-}
-
-static unsigned getMemModRMByteSize(const MachineInstr &MI, unsigned Op,
- bool IsPIC, bool Is64BitMode) {
- const MachineOperand &Op3 = MI.getOperand(Op+3);
- int DispVal = 0;
- const MachineOperand *DispForReloc = 0;
- unsigned FinalSize = 0;
-
- // Figure out what sort of displacement we have to handle here.
- if (Op3.isGlobalAddress()) {
- DispForReloc = &Op3;
- } else if (Op3.isConstantPoolIndex()) {
- if (Is64BitMode || IsPIC) {
- DispForReloc = &Op3;
- } else {
- DispVal = 1;
- }
- } else if (Op3.isJumpTableIndex()) {
- if (Is64BitMode || IsPIC) {
- DispForReloc = &Op3;
- } else {
- DispVal = 1;
- }
- } else {
- DispVal = 1;
- }
-
- const MachineOperand &Base = MI.getOperand(Op);
- const MachineOperand &IndexReg = MI.getOperand(Op+2);
-
- unsigned BaseReg = Base.getReg();
-
- // Is a SIB byte needed?
- if (IndexReg.getReg() == 0 &&
- (BaseReg == 0 || X86RegisterInfo::getX86RegNum(BaseReg) != N86::ESP)) {
- if (BaseReg == 0) { // Just a displacement?
- // Emit special case [disp32] encoding
- ++FinalSize;
- FinalSize += getDisplacementFieldSize(DispForReloc);
- } else {
- unsigned BaseRegNo = X86RegisterInfo::getX86RegNum(BaseReg);
- if (!DispForReloc && DispVal == 0 && BaseRegNo != N86::EBP) {
- // Emit simple indirect register encoding... [EAX] f.e.
- ++FinalSize;
- // Be pessimistic and assume it's a disp32, not a disp8
- } else {
- // Emit the most general non-SIB encoding: [REG+disp32]
- ++FinalSize;
- FinalSize += getDisplacementFieldSize(DispForReloc);
- }
- }
-
- } else { // We need a SIB byte, so start by outputting the ModR/M byte first
- assert(IndexReg.getReg() != X86::ESP &&
- IndexReg.getReg() != X86::RSP && "Cannot use ESP as index reg!");
-
- bool ForceDisp32 = false;
- if (BaseReg == 0 || DispForReloc) {
- // Emit the normal disp32 encoding.
- ++FinalSize;
- ForceDisp32 = true;
- } else {
- ++FinalSize;
- }
-
- FinalSize += sizeSIBByte();
-
- // Do we need to output a displacement?
- if (DispVal != 0 || ForceDisp32) {
- FinalSize += getDisplacementFieldSize(DispForReloc);
- }
- }
- return FinalSize;
-}
-
-
-static unsigned GetInstSizeWithDesc(const MachineInstr &MI,
- const TargetInstrDesc *Desc,
- bool IsPIC, bool Is64BitMode) {
-
- unsigned Opcode = Desc->Opcode;
- unsigned FinalSize = 0;
-
- // Emit the lock opcode prefix as needed.
- if (Desc->TSFlags & X86II::LOCK) ++FinalSize;
-
- // Emit the repeat opcode prefix as needed.
- if ((Desc->TSFlags & X86II::Op0Mask) == X86II::REP) ++FinalSize;
-
- // Emit the operand size opcode prefix as needed.
- if (Desc->TSFlags & X86II::OpSize) ++FinalSize;
-
- // Emit the address size opcode prefix as needed.
- if (Desc->TSFlags & X86II::AdSize) ++FinalSize;
-
- bool Need0FPrefix = false;
- switch (Desc->TSFlags & X86II::Op0Mask) {
- case X86II::TB: // Two-byte opcode prefix
- case X86II::T8: // 0F 38
- case X86II::TA: // 0F 3A
- Need0FPrefix = true;
- break;
- case X86II::REP: break; // already handled.
- case X86II::XS: // F3 0F
- ++FinalSize;
- Need0FPrefix = true;
- break;
- case X86II::XD: // F2 0F
- ++FinalSize;
- Need0FPrefix = true;
- break;
- case X86II::D8: case X86II::D9: case X86II::DA: case X86II::DB:
- case X86II::DC: case X86II::DD: case X86II::DE: case X86II::DF:
- ++FinalSize;
- break; // Two-byte opcode prefix
- default: assert(0 && "Invalid prefix!");
- case 0: break; // No prefix!
- }
-
- if (Is64BitMode) {
- // REX prefix
- unsigned REX = X86InstrInfo::determineREX(MI);
- if (REX)
- ++FinalSize;
- }
-
- // 0x0F escape code must be emitted just before the opcode.
- if (Need0FPrefix)
- ++FinalSize;
-
- switch (Desc->TSFlags & X86II::Op0Mask) {
- case X86II::T8: // 0F 38
- ++FinalSize;
- break;
- case X86II::TA: // 0F 3A
- ++FinalSize;
- break;
- }
-
- // If this is a two-address instruction, skip one of the register operands.
- unsigned NumOps = Desc->getNumOperands();
- unsigned CurOp = 0;
- if (NumOps > 1 && Desc->getOperandConstraint(1, TOI::TIED_TO) != -1)
- CurOp++;
-
- switch (Desc->TSFlags & X86II::FormMask) {
- default: assert(0 && "Unknown FormMask value in X86 MachineCodeEmitter!");
- case X86II::Pseudo:
- // Remember the current PC offset, this is the PIC relocation
- // base address.
- switch (Opcode) {
- default:
- break;
- case TargetInstrInfo::INLINEASM: {
- const MachineFunction *MF = MI.getParent()->getParent();
- const char *AsmStr = MI.getOperand(0).getSymbolName();
- const TargetAsmInfo* AI = MF->getTarget().getTargetAsmInfo();
- FinalSize += AI->getInlineAsmLength(AsmStr);
- break;
- }
- case TargetInstrInfo::LABEL:
- break;
- case TargetInstrInfo::IMPLICIT_DEF:
- case TargetInstrInfo::DECLARE:
- case X86::DWARF_LOC:
- case X86::FP_REG_KILL:
- break;
- case X86::MOVPC32r: {
- // This emits the "call" portion of this pseudo instruction.
- ++FinalSize;
- FinalSize += sizeConstant(X86InstrInfo::sizeOfImm(Desc));
- break;
- }
- }
- CurOp = NumOps;
- break;
- case X86II::RawFrm:
- ++FinalSize;
-
- if (CurOp != NumOps) {
- const MachineOperand &MO = MI.getOperand(CurOp++);
- if (MO.isMachineBasicBlock()) {
- FinalSize += sizePCRelativeBlockAddress();
- } else if (MO.isGlobalAddress()) {
- FinalSize += sizeGlobalAddress(false);
- } else if (MO.isExternalSymbol()) {
- FinalSize += sizeExternalSymbolAddress(false);
- } else if (MO.isImmediate()) {
- FinalSize += sizeConstant(X86InstrInfo::sizeOfImm(Desc));
- } else {
- assert(0 && "Unknown RawFrm operand!");
- }
- }
- break;
-
- case X86II::AddRegFrm:
- ++FinalSize;
- ++CurOp;
-
- if (CurOp != NumOps) {
- const MachineOperand &MO1 = MI.getOperand(CurOp++);
- unsigned Size = X86InstrInfo::sizeOfImm(Desc);
- if (MO1.isImmediate())
- FinalSize += sizeConstant(Size);
- else {
- bool dword = false;
- if (Opcode == X86::MOV64ri)
- dword = true;
- if (MO1.isGlobalAddress()) {
- FinalSize += sizeGlobalAddress(dword);
- } else if (MO1.isExternalSymbol())
- FinalSize += sizeExternalSymbolAddress(dword);
- else if (MO1.isConstantPoolIndex())
- FinalSize += sizeConstPoolAddress(dword);
- else if (MO1.isJumpTableIndex())
- FinalSize += sizeJumpTableAddress(dword);
- }
- }
- break;
-
- case X86II::MRMDestReg: {
- ++FinalSize;
- FinalSize += sizeRegModRMByte();
- CurOp += 2;
- if (CurOp != NumOps) {
- ++CurOp;
- FinalSize += sizeConstant(X86InstrInfo::sizeOfImm(Desc));
- }
- break;
- }
- case X86II::MRMDestMem: {
- ++FinalSize;
- FinalSize += getMemModRMByteSize(MI, CurOp, IsPIC, Is64BitMode);
- CurOp += 5;
- if (CurOp != NumOps) {
- ++CurOp;
- FinalSize += sizeConstant(X86InstrInfo::sizeOfImm(Desc));
- }
- break;
- }
-
- case X86II::MRMSrcReg:
- ++FinalSize;
- FinalSize += sizeRegModRMByte();
- CurOp += 2;
- if (CurOp != NumOps) {
- ++CurOp;
- FinalSize += sizeConstant(X86InstrInfo::sizeOfImm(Desc));
- }
- break;
-
- case X86II::MRMSrcMem: {
-
- ++FinalSize;
- FinalSize += getMemModRMByteSize(MI, CurOp+1, IsPIC, Is64BitMode);
- CurOp += 5;
- if (CurOp != NumOps) {
- ++CurOp;
- FinalSize += sizeConstant(X86InstrInfo::sizeOfImm(Desc));
- }
- break;
- }
-
- case X86II::MRM0r: case X86II::MRM1r:
- case X86II::MRM2r: case X86II::MRM3r:
- case X86II::MRM4r: case X86II::MRM5r:
- case X86II::MRM6r: case X86II::MRM7r:
- ++FinalSize;
- ++CurOp;
- FinalSize += sizeRegModRMByte();
-
- if (CurOp != NumOps) {
- const MachineOperand &MO1 = MI.getOperand(CurOp++);
- unsigned Size = X86InstrInfo::sizeOfImm(Desc);
- if (MO1.isImmediate())
- FinalSize += sizeConstant(Size);
- else {
- bool dword = false;
- if (Opcode == X86::MOV64ri32)
- dword = true;
- if (MO1.isGlobalAddress()) {
- FinalSize += sizeGlobalAddress(dword);
- } else if (MO1.isExternalSymbol())
- FinalSize += sizeExternalSymbolAddress(dword);
- else if (MO1.isConstantPoolIndex())
- FinalSize += sizeConstPoolAddress(dword);
- else if (MO1.isJumpTableIndex())
- FinalSize += sizeJumpTableAddress(dword);
- }
- }
- break;
-
- case X86II::MRM0m: case X86II::MRM1m:
- case X86II::MRM2m: case X86II::MRM3m:
- case X86II::MRM4m: case X86II::MRM5m:
- case X86II::MRM6m: case X86II::MRM7m: {
-
- ++FinalSize;
- FinalSize += getMemModRMByteSize(MI, CurOp, IsPIC, Is64BitMode);
- CurOp += 4;
-
- if (CurOp != NumOps) {
- const MachineOperand &MO = MI.getOperand(CurOp++);
- unsigned Size = X86InstrInfo::sizeOfImm(Desc);
- if (MO.isImmediate())
- FinalSize += sizeConstant(Size);
- else {
- bool dword = false;
- if (Opcode == X86::MOV64mi32)
- dword = true;
- if (MO.isGlobalAddress()) {
- FinalSize += sizeGlobalAddress(dword);
- } else if (MO.isExternalSymbol())
- FinalSize += sizeExternalSymbolAddress(dword);
- else if (MO.isConstantPoolIndex())
- FinalSize += sizeConstPoolAddress(dword);
- else if (MO.isJumpTableIndex())
- FinalSize += sizeJumpTableAddress(dword);
- }
- }
- break;
- }
-
- case X86II::MRMInitReg:
- ++FinalSize;
- // Duplicate register, used by things like MOV8r0 (aka xor reg,reg).
- FinalSize += sizeRegModRMByte();
- ++CurOp;
- break;
- }
-
- if (!Desc->isVariadic() && CurOp != NumOps) {
- cerr << "Cannot determine size: ";
- MI.dump();
- cerr << '\n';
- abort();
- }
-
-
- return FinalSize;
-}
-
-
-unsigned X86InstrInfo::GetInstSizeInBytes(const MachineInstr *MI) const {
- const TargetInstrDesc &Desc = MI->getDesc();
- bool IsPIC = (TM.getRelocationModel() == Reloc::PIC_);
- bool Is64BitMode = ((X86Subtarget*)TM.getSubtargetImpl())->is64Bit();
- unsigned Size = GetInstSizeWithDesc(*MI, &Desc, IsPIC, Is64BitMode);
- if (Desc.getOpcode() == X86::MOVPC32r) {
- Size += GetInstSizeWithDesc(*MI, &get(X86::POP32r), IsPIC, Is64BitMode);
- }
- return Size;
-}
diff --git a/release_23/lib/Target/X86/X86InstrInfo.h b/release_23/lib/Target/X86/X86InstrInfo.h
deleted file mode 100644
index 5f09241f1652..000000000000
--- a/release_23/lib/Target/X86/X86InstrInfo.h
+++ /dev/null
@@ -1,407 +0,0 @@
-//===- X86InstrInfo.h - X86 Instruction Information ------------*- C++ -*- ===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains the X86 implementation of the TargetInstrInfo class.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef X86INSTRUCTIONINFO_H
-#define X86INSTRUCTIONINFO_H
-
-#include "llvm/Target/TargetInstrInfo.h"
-#include "X86.h"
-#include "X86RegisterInfo.h"
-#include "llvm/ADT/IndexedMap.h"
-#include "llvm/Target/TargetRegisterInfo.h"
-
-namespace llvm {
- class X86RegisterInfo;
- class X86TargetMachine;
-
-namespace X86 {
- // X86 specific condition code. These correspond to X86_*_COND in
- // X86InstrInfo.td. They must be kept in synch.
- enum CondCode {
- COND_A = 0,
- COND_AE = 1,
- COND_B = 2,
- COND_BE = 3,
- COND_E = 4,
- COND_G = 5,
- COND_GE = 6,
- COND_L = 7,
- COND_LE = 8,
- COND_NE = 9,
- COND_NO = 10,
- COND_NP = 11,
- COND_NS = 12,
- COND_O = 13,
- COND_P = 14,
- COND_S = 15,
- COND_INVALID
- };
-
- // Turn condition code into conditional branch opcode.
- unsigned GetCondBranchFromCond(CondCode CC);
-
- /// GetOppositeBranchCondition - Return the inverse of the specified cond,
- /// e.g. turning COND_E to COND_NE.
- CondCode GetOppositeBranchCondition(X86::CondCode CC);
-
-}
-
-/// X86II - This namespace holds all of the target specific flags that
-/// instruction info tracks.
-///
-namespace X86II {
- enum {
- //===------------------------------------------------------------------===//
- // Instruction types. These are the standard/most common forms for X86
- // instructions.
- //
-
- // PseudoFrm - This represents an instruction that is a pseudo instruction
- // or one that has not been implemented yet. It is illegal to code generate
- // it, but tolerated for intermediate implementation stages.
- Pseudo = 0,
-
- /// Raw - This form is for instructions that don't have any operands, so
- /// they are just a fixed opcode value, like 'leave'.
- RawFrm = 1,
-
- /// AddRegFrm - This form is used for instructions like 'push r32' that have
- /// their one register operand added to their opcode.
- AddRegFrm = 2,
-
- /// MRMDestReg - This form is used for instructions that use the Mod/RM byte
- /// to specify a destination, which in this case is a register.
- ///
- MRMDestReg = 3,
-
- /// MRMDestMem - This form is used for instructions that use the Mod/RM byte
- /// to specify a destination, which in this case is memory.
- ///
- MRMDestMem = 4,
-
- /// MRMSrcReg - This form is used for instructions that use the Mod/RM byte
- /// to specify a source, which in this case is a register.
- ///
- MRMSrcReg = 5,
-
- /// MRMSrcMem - This form is used for instructions that use the Mod/RM byte
- /// to specify a source, which in this case is memory.
- ///
- MRMSrcMem = 6,
-
- /// MRM[0-7][rm] - These forms are used to represent instructions that use
- /// a Mod/RM byte, and use the middle field to hold extended opcode
- /// information. In the intel manual these are represented as /0, /1, ...
- ///
-
- // First, instructions that operate on a register r/m operand...
- MRM0r = 16, MRM1r = 17, MRM2r = 18, MRM3r = 19, // Format /0 /1 /2 /3
- MRM4r = 20, MRM5r = 21, MRM6r = 22, MRM7r = 23, // Format /4 /5 /6 /7
-
- // Next, instructions that operate on a memory r/m operand...
- MRM0m = 24, MRM1m = 25, MRM2m = 26, MRM3m = 27, // Format /0 /1 /2 /3
- MRM4m = 28, MRM5m = 29, MRM6m = 30, MRM7m = 31, // Format /4 /5 /6 /7
-
- // MRMInitReg - This form is used for instructions whose source and
- // destinations are the same register.
- MRMInitReg = 32,
-
- FormMask = 63,
-
- //===------------------------------------------------------------------===//
- // Actual flags...
-
- // OpSize - Set if this instruction requires an operand size prefix (0x66),
- // which most often indicates that the instruction operates on 16 bit data
- // instead of 32 bit data.
- OpSize = 1 << 6,
-
- // AsSize - Set if this instruction requires an operand size prefix (0x67),
- // which most often indicates that the instruction address 16 bit address
- // instead of 32 bit address (or 32 bit address in 64 bit mode).
- AdSize = 1 << 7,
-
- //===------------------------------------------------------------------===//
- // Op0Mask - There are several prefix bytes that are used to form two byte
- // opcodes. These are currently 0x0F, 0xF3, and 0xD8-0xDF. This mask is
- // used to obtain the setting of this field. If no bits in this field is
- // set, there is no prefix byte for obtaining a multibyte opcode.
- //
- Op0Shift = 8,
- Op0Mask = 0xF << Op0Shift,
-
- // TB - TwoByte - Set if this instruction has a two byte opcode, which
- // starts with a 0x0F byte before the real opcode.
- TB = 1 << Op0Shift,
-
- // REP - The 0xF3 prefix byte indicating repetition of the following
- // instruction.
- REP = 2 << Op0Shift,
-
- // D8-DF - These escape opcodes are used by the floating point unit. These
- // values must remain sequential.
- D8 = 3 << Op0Shift, D9 = 4 << Op0Shift,
- DA = 5 << Op0Shift, DB = 6 << Op0Shift,
- DC = 7 << Op0Shift, DD = 8 << Op0Shift,
- DE = 9 << Op0Shift, DF = 10 << Op0Shift,
-
- // XS, XD - These prefix codes are for single and double precision scalar
- // floating point operations performed in the SSE registers.
- XD = 11 << Op0Shift, XS = 12 << Op0Shift,
-
- // T8, TA - Prefix after the 0x0F prefix.
- T8 = 13 << Op0Shift, TA = 14 << Op0Shift,
-
- //===------------------------------------------------------------------===//
- // REX_W - REX prefixes are instruction prefixes used in 64-bit mode.
- // They are used to specify GPRs and SSE registers, 64-bit operand size,
- // etc. We only cares about REX.W and REX.R bits and only the former is
- // statically determined.
- //
- REXShift = 12,
- REX_W = 1 << REXShift,
-
- //===------------------------------------------------------------------===//
- // This three-bit field describes the size of an immediate operand. Zero is
- // unused so that we can tell if we forgot to set a value.
- ImmShift = 13,
- ImmMask = 7 << ImmShift,
- Imm8 = 1 << ImmShift,
- Imm16 = 2 << ImmShift,
- Imm32 = 3 << ImmShift,
- Imm64 = 4 << ImmShift,
-
- //===------------------------------------------------------------------===//
- // FP Instruction Classification... Zero is non-fp instruction.
-
- // FPTypeMask - Mask for all of the FP types...
- FPTypeShift = 16,
- FPTypeMask = 7 << FPTypeShift,
-
- // NotFP - The default, set for instructions that do not use FP registers.
- NotFP = 0 << FPTypeShift,
-
- // ZeroArgFP - 0 arg FP instruction which implicitly pushes ST(0), f.e. fld0
- ZeroArgFP = 1 << FPTypeShift,
-
- // OneArgFP - 1 arg FP instructions which implicitly read ST(0), such as fst
- OneArgFP = 2 << FPTypeShift,
-
- // OneArgFPRW - 1 arg FP instruction which implicitly read ST(0) and write a
- // result back to ST(0). For example, fcos, fsqrt, etc.
- //
- OneArgFPRW = 3 << FPTypeShift,
-
- // TwoArgFP - 2 arg FP instructions which implicitly read ST(0), and an
- // explicit argument, storing the result to either ST(0) or the implicit
- // argument. For example: fadd, fsub, fmul, etc...
- TwoArgFP = 4 << FPTypeShift,
-
- // CompareFP - 2 arg FP instructions which implicitly read ST(0) and an
- // explicit argument, but have no destination. Example: fucom, fucomi, ...
- CompareFP = 5 << FPTypeShift,
-
- // CondMovFP - "2 operand" floating point conditional move instructions.
- CondMovFP = 6 << FPTypeShift,
-
- // SpecialFP - Special instruction forms. Dispatch by opcode explicitly.
- SpecialFP = 7 << FPTypeShift,
-
- // Lock prefix
- LOCKShift = 19,
- LOCK = 1 << LOCKShift,
-
- // Bits 20 -> 23 are unused
- OpcodeShift = 24,
- OpcodeMask = 0xFF << OpcodeShift
- };
-}
-
-class X86InstrInfo : public TargetInstrInfoImpl {
- X86TargetMachine &TM;
- const X86RegisterInfo RI;
-
- /// RegOp2MemOpTable2Addr, RegOp2MemOpTable0, RegOp2MemOpTable1,
- /// RegOp2MemOpTable2 - Load / store folding opcode maps.
- ///
- DenseMap<unsigned*, unsigned> RegOp2MemOpTable2Addr;
- DenseMap<unsigned*, unsigned> RegOp2MemOpTable0;
- DenseMap<unsigned*, unsigned> RegOp2MemOpTable1;
- DenseMap<unsigned*, unsigned> RegOp2MemOpTable2;
-
- /// MemOp2RegOpTable - Load / store unfolding opcode map.
- ///
- DenseMap<unsigned*, std::pair<unsigned, unsigned> > MemOp2RegOpTable;
-
-public:
- explicit X86InstrInfo(X86TargetMachine &tm);
-
- /// getRegisterInfo - TargetInstrInfo is a superset of MRegister info. As
- /// such, whenever a client has an instance of instruction info, it should
- /// always be able to get register info as well (through this method).
- ///
- virtual const TargetRegisterInfo &getRegisterInfo() const { return RI; }
-
- // Return true if the instruction is a register to register move and
- // leave the source and dest operands in the passed parameters.
- //
- bool isMoveInstr(const MachineInstr& MI, unsigned& sourceReg,
- unsigned& destReg) const;
- unsigned isLoadFromStackSlot(MachineInstr *MI, int &FrameIndex) const;
- unsigned isStoreToStackSlot(MachineInstr *MI, int &FrameIndex) const;
-
- bool isReallyTriviallyReMaterializable(MachineInstr *MI) const;
- void reMaterialize(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI,
- unsigned DestReg, const MachineInstr *Orig) const;
-
- bool isInvariantLoad(MachineInstr *MI) const;
-
- /// convertToThreeAddress - This method must be implemented by targets that
- /// set the M_CONVERTIBLE_TO_3_ADDR flag. When this flag is set, the target
- /// may be able to convert a two-address instruction into a true
- /// three-address instruction on demand. This allows the X86 target (for
- /// example) to convert ADD and SHL instructions into LEA instructions if they
- /// would require register copies due to two-addressness.
- ///
- /// This method returns a null pointer if the transformation cannot be
- /// performed, otherwise it returns the new instruction.
- ///
- virtual MachineInstr *convertToThreeAddress(MachineFunction::iterator &MFI,
- MachineBasicBlock::iterator &MBBI,
- LiveVariables &LV) const;
-
- /// commuteInstruction - We have a few instructions that must be hacked on to
- /// commute them.
- ///
- virtual MachineInstr *commuteInstruction(MachineInstr *MI) const;
-
- // Branch analysis.
- virtual bool isUnpredicatedTerminator(const MachineInstr* MI) const;
- virtual bool AnalyzeBranch(MachineBasicBlock &MBB, MachineBasicBlock *&TBB,
- MachineBasicBlock *&FBB,
- std::vector<MachineOperand> &Cond) const;
- virtual unsigned RemoveBranch(MachineBasicBlock &MBB) const;
- virtual unsigned InsertBranch(MachineBasicBlock &MBB, MachineBasicBlock *TBB,
- MachineBasicBlock *FBB,
- const std::vector<MachineOperand> &Cond) const;
- virtual void copyRegToReg(MachineBasicBlock &MBB,
- MachineBasicBlock::iterator MI,
- unsigned DestReg, unsigned SrcReg,
- const TargetRegisterClass *DestRC,
- const TargetRegisterClass *SrcRC) const;
- virtual void storeRegToStackSlot(MachineBasicBlock &MBB,
- MachineBasicBlock::iterator MI,
- unsigned SrcReg, bool isKill, int FrameIndex,
- const TargetRegisterClass *RC) const;
-
- virtual void storeRegToAddr(MachineFunction &MF, unsigned SrcReg, bool isKill,
- SmallVectorImpl<MachineOperand> &Addr,
- const TargetRegisterClass *RC,
- SmallVectorImpl<MachineInstr*> &NewMIs) const;
-
- virtual void loadRegFromStackSlot(MachineBasicBlock &MBB,
- MachineBasicBlock::iterator MI,
- unsigned DestReg, int FrameIndex,
- const TargetRegisterClass *RC) const;
-
- virtual void loadRegFromAddr(MachineFunction &MF, unsigned DestReg,
- SmallVectorImpl<MachineOperand> &Addr,
- const TargetRegisterClass *RC,
- SmallVectorImpl<MachineInstr*> &NewMIs) const;
-
- virtual bool spillCalleeSavedRegisters(MachineBasicBlock &MBB,
- MachineBasicBlock::iterator MI,
- const std::vector<CalleeSavedInfo> &CSI) const;
-
- virtual bool restoreCalleeSavedRegisters(MachineBasicBlock &MBB,
- MachineBasicBlock::iterator MI,
- const std::vector<CalleeSavedInfo> &CSI) const;
-
- /// foldMemoryOperand - If this target supports it, fold a load or store of
- /// the specified stack slot into the specified machine instruction for the
- /// specified operand(s). If this is possible, the target should perform the
- /// folding and return true, otherwise it should return false. If it folds
- /// the instruction, it is likely that the MachineInstruction the iterator
- /// references has been changed.
- virtual MachineInstr* foldMemoryOperand(MachineFunction &MF,
- MachineInstr* MI,
- SmallVectorImpl<unsigned> &Ops,
- int FrameIndex) const;
-
- /// foldMemoryOperand - Same as the previous version except it allows folding
- /// of any load and store from / to any address, not just from a specific
- /// stack slot.
- virtual MachineInstr* foldMemoryOperand(MachineFunction &MF,
- MachineInstr* MI,
- SmallVectorImpl<unsigned> &Ops,
- MachineInstr* LoadMI) const;
-
- /// canFoldMemoryOperand - Returns true if the specified load / store is
- /// folding is possible.
- virtual bool canFoldMemoryOperand(MachineInstr*, SmallVectorImpl<unsigned> &) const;
-
- /// unfoldMemoryOperand - Separate a single instruction which folded a load or
- /// a store or a load and a store into two or more instruction. If this is
- /// possible, returns true as well as the new instructions by reference.
- virtual bool unfoldMemoryOperand(MachineFunction &MF, MachineInstr *MI,
- unsigned Reg, bool UnfoldLoad, bool UnfoldStore,
- SmallVectorImpl<MachineInstr*> &NewMIs) const;
-
- virtual bool unfoldMemoryOperand(SelectionDAG &DAG, SDNode *N,
- SmallVectorImpl<SDNode*> &NewNodes) const;
-
- /// getOpcodeAfterMemoryUnfold - Returns the opcode of the would be new
- /// instruction after load / store are unfolded from an instruction of the
- /// specified opcode. It returns zero if the specified unfolding is not
- /// possible.
- virtual unsigned getOpcodeAfterMemoryUnfold(unsigned Opc,
- bool UnfoldLoad, bool UnfoldStore) const;
-
- virtual bool BlockHasNoFallThrough(MachineBasicBlock &MBB) const;
- virtual bool ReverseBranchCondition(std::vector<MachineOperand> &Cond) const;
-
- const TargetRegisterClass *getPointerRegClass() const;
-
- // getBaseOpcodeFor - This function returns the "base" X86 opcode for the
- // specified machine instruction.
- //
- unsigned char getBaseOpcodeFor(const TargetInstrDesc *TID) const {
- return TID->TSFlags >> X86II::OpcodeShift;
- }
- unsigned char getBaseOpcodeFor(unsigned Opcode) const {
- return getBaseOpcodeFor(&get(Opcode));
- }
-
- static bool isX86_64NonExtLowByteReg(unsigned reg) {
- return (reg == X86::SPL || reg == X86::BPL ||
- reg == X86::SIL || reg == X86::DIL);
- }
-
- static unsigned sizeOfImm(const TargetInstrDesc *Desc);
- static unsigned getX86RegNum(unsigned RegNo);
- static bool isX86_64ExtendedReg(const MachineOperand &MO);
- static unsigned determineREX(const MachineInstr &MI);
-
- /// GetInstSize - Returns the size of the specified MachineInstr.
- ///
- virtual unsigned GetInstSizeInBytes(const MachineInstr *MI) const;
-
-private:
- MachineInstr* foldMemoryOperand(MachineInstr* MI,
- unsigned OpNum,
- SmallVector<MachineOperand,4> &MOs) const;
-};
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/lib/Target/X86/X86InstrInfo.td b/release_23/lib/Target/X86/X86InstrInfo.td
deleted file mode 100644
index af615403612a..000000000000
--- a/release_23/lib/Target/X86/X86InstrInfo.td
+++ /dev/null
@@ -1,2828 +0,0 @@
-//===- X86InstrInfo.td - Describe the X86 Instruction Set --*- tablegen -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file describes the X86 instruction set, defining the instructions, and
-// properties of the instructions which are needed for code generation, machine
-// code emission, and analysis.
-//
-//===----------------------------------------------------------------------===//
-
-//===----------------------------------------------------------------------===//
-// X86 specific DAG Nodes.
-//
-
-def SDTIntShiftDOp: SDTypeProfile<1, 3,
- [SDTCisSameAs<0, 1>, SDTCisSameAs<0, 2>,
- SDTCisInt<0>, SDTCisInt<3>]>;
-
-def SDTX86CmpTest : SDTypeProfile<0, 2, [SDTCisSameAs<0, 1>]>;
-
-def SDTX86Cmov : SDTypeProfile<1, 4,
- [SDTCisSameAs<0, 1>, SDTCisSameAs<1, 2>,
- SDTCisVT<3, i8>, SDTCisVT<4, i32>]>;
-
-def SDTX86BrCond : SDTypeProfile<0, 3,
- [SDTCisVT<0, OtherVT>,
- SDTCisVT<1, i8>, SDTCisVT<2, i32>]>;
-
-def SDTX86SetCC : SDTypeProfile<1, 2,
- [SDTCisVT<0, i8>,
- SDTCisVT<1, i8>, SDTCisVT<2, i32>]>;
-
-def SDTX86cas : SDTypeProfile<0, 3, [SDTCisPtrTy<0>, SDTCisInt<1>,
- SDTCisVT<2, i8>]>;
-def SDTX86cas8 : SDTypeProfile<0, 1, [SDTCisPtrTy<0>]>;
-
-def SDTX86Ret : SDTypeProfile<0, -1, [SDTCisVT<0, i16>]>;
-
-def SDT_X86CallSeqStart : SDCallSeqStart<[ SDTCisVT<0, i32> ]>;
-def SDT_X86CallSeqEnd : SDCallSeqEnd<[ SDTCisVT<0, i32>,
- SDTCisVT<1, i32> ]>;
-
-def SDT_X86Call : SDTypeProfile<0, 1, [SDTCisVT<0, iPTR>]>;
-
-def SDTX86RepStr : SDTypeProfile<0, 1, [SDTCisVT<0, OtherVT>]>;
-
-def SDTX86RdTsc : SDTypeProfile<0, 0, []>;
-
-def SDTX86Wrapper : SDTypeProfile<1, 1, [SDTCisSameAs<0, 1>, SDTCisPtrTy<0>]>;
-
-def SDT_X86TLSADDR : SDTypeProfile<1, 1, [SDTCisPtrTy<0>, SDTCisInt<1>]>;
-
-def SDT_X86TLSTP : SDTypeProfile<1, 0, [SDTCisPtrTy<0>]>;
-
-def SDT_X86EHRET : SDTypeProfile<0, 1, [SDTCisInt<0>]>;
-
-def SDT_X86TCRET : SDTypeProfile<0, 2, [SDTCisPtrTy<0>, SDTCisVT<1, i32>]>;
-
-def X86bsf : SDNode<"X86ISD::BSF", SDTIntUnaryOp>;
-def X86bsr : SDNode<"X86ISD::BSR", SDTIntUnaryOp>;
-def X86shld : SDNode<"X86ISD::SHLD", SDTIntShiftDOp>;
-def X86shrd : SDNode<"X86ISD::SHRD", SDTIntShiftDOp>;
-
-def X86cmp : SDNode<"X86ISD::CMP" , SDTX86CmpTest>;
-
-def X86cmov : SDNode<"X86ISD::CMOV", SDTX86Cmov>;
-def X86brcond : SDNode<"X86ISD::BRCOND", SDTX86BrCond,
- [SDNPHasChain]>;
-def X86setcc : SDNode<"X86ISD::SETCC", SDTX86SetCC>;
-
-def X86cas : SDNode<"X86ISD::LCMPXCHG_DAG", SDTX86cas,
- [SDNPHasChain, SDNPInFlag, SDNPOutFlag, SDNPMayStore,
- SDNPMayLoad]>;
-def X86cas8 : SDNode<"X86ISD::LCMPXCHG8_DAG", SDTX86cas8,
- [SDNPHasChain, SDNPInFlag, SDNPOutFlag, SDNPMayStore,
- SDNPMayLoad]>;
-
-def X86retflag : SDNode<"X86ISD::RET_FLAG", SDTX86Ret,
- [SDNPHasChain, SDNPOptInFlag]>;
-
-def X86callseq_start :
- SDNode<"ISD::CALLSEQ_START", SDT_X86CallSeqStart,
- [SDNPHasChain, SDNPOutFlag]>;
-def X86callseq_end :
- SDNode<"ISD::CALLSEQ_END", SDT_X86CallSeqEnd,
- [SDNPHasChain, SDNPOptInFlag, SDNPOutFlag]>;
-
-def X86call : SDNode<"X86ISD::CALL", SDT_X86Call,
- [SDNPHasChain, SDNPOutFlag, SDNPOptInFlag]>;
-
-def X86tailcall: SDNode<"X86ISD::TAILCALL", SDT_X86Call,
- [SDNPHasChain, SDNPOutFlag, SDNPOptInFlag]>;
-
-def X86rep_stos: SDNode<"X86ISD::REP_STOS", SDTX86RepStr,
- [SDNPHasChain, SDNPInFlag, SDNPOutFlag, SDNPMayStore]>;
-def X86rep_movs: SDNode<"X86ISD::REP_MOVS", SDTX86RepStr,
- [SDNPHasChain, SDNPInFlag, SDNPOutFlag, SDNPMayStore,
- SDNPMayLoad]>;
-
-def X86rdtsc : SDNode<"X86ISD::RDTSC_DAG",SDTX86RdTsc,
- [SDNPHasChain, SDNPOutFlag, SDNPSideEffect]>;
-
-def X86Wrapper : SDNode<"X86ISD::Wrapper", SDTX86Wrapper>;
-def X86WrapperRIP : SDNode<"X86ISD::WrapperRIP", SDTX86Wrapper>;
-
-def X86tlsaddr : SDNode<"X86ISD::TLSADDR", SDT_X86TLSADDR,
- [SDNPHasChain, SDNPOptInFlag, SDNPOutFlag]>;
-def X86TLStp : SDNode<"X86ISD::THREAD_POINTER", SDT_X86TLSTP, []>;
-
-def X86ehret : SDNode<"X86ISD::EH_RETURN", SDT_X86EHRET,
- [SDNPHasChain]>;
-
-def X86tcret : SDNode<"X86ISD::TC_RETURN", SDT_X86TCRET,
- [SDNPHasChain, SDNPOptInFlag]>;
-
-//===----------------------------------------------------------------------===//
-// X86 Operand Definitions.
-//
-
-// *mem - Operand definitions for the funky X86 addressing mode operands.
-//
-class X86MemOperand<string printMethod> : Operand<iPTR> {
- let PrintMethod = printMethod;
- let MIOperandInfo = (ops ptr_rc, i8imm, ptr_rc, i32imm);
-}
-
-def i8mem : X86MemOperand<"printi8mem">;
-def i16mem : X86MemOperand<"printi16mem">;
-def i32mem : X86MemOperand<"printi32mem">;
-def i64mem : X86MemOperand<"printi64mem">;
-def i128mem : X86MemOperand<"printi128mem">;
-def f32mem : X86MemOperand<"printf32mem">;
-def f64mem : X86MemOperand<"printf64mem">;
-def f80mem : X86MemOperand<"printf80mem">;
-def f128mem : X86MemOperand<"printf128mem">;
-
-def lea32mem : Operand<i32> {
- let PrintMethod = "printi32mem";
- let MIOperandInfo = (ops GR32, i8imm, GR32, i32imm);
-}
-
-def SSECC : Operand<i8> {
- let PrintMethod = "printSSECC";
-}
-
-def piclabel: Operand<i32> {
- let PrintMethod = "printPICLabel";
-}
-
-// A couple of more descriptive operand definitions.
-// 16-bits but only 8 bits are significant.
-def i16i8imm : Operand<i16>;
-// 32-bits but only 8 bits are significant.
-def i32i8imm : Operand<i32>;
-
-// Branch targets have OtherVT type.
-def brtarget : Operand<OtherVT>;
-
-//===----------------------------------------------------------------------===//
-// X86 Complex Pattern Definitions.
-//
-
-// Define X86 specific addressing mode.
-def addr : ComplexPattern<iPTR, 4, "SelectAddr", [], []>;
-def lea32addr : ComplexPattern<i32, 4, "SelectLEAAddr",
- [add, mul, shl, or, frameindex], []>;
-
-//===----------------------------------------------------------------------===//
-// X86 Instruction Predicate Definitions.
-def HasMMX : Predicate<"Subtarget->hasMMX()">;
-def HasSSE1 : Predicate<"Subtarget->hasSSE1()">;
-def HasSSE2 : Predicate<"Subtarget->hasSSE2()">;
-def HasSSE3 : Predicate<"Subtarget->hasSSE3()">;
-def HasSSSE3 : Predicate<"Subtarget->hasSSSE3()">;
-def HasSSE41 : Predicate<"Subtarget->hasSSE41()">;
-def HasSSE42 : Predicate<"Subtarget->hasSSE42()">;
-def FPStackf32 : Predicate<"!Subtarget->hasSSE1()">;
-def FPStackf64 : Predicate<"!Subtarget->hasSSE2()">;
-def In32BitMode : Predicate<"!Subtarget->is64Bit()">;
-def In64BitMode : Predicate<"Subtarget->is64Bit()">;
-def SmallCode : Predicate<"TM.getCodeModel() == CodeModel::Small">;
-def NotSmallCode : Predicate<"TM.getCodeModel() != CodeModel::Small">;
-def IsStatic : Predicate<"TM.getRelocationModel() == Reloc::Static">;
-
-//===----------------------------------------------------------------------===//
-// X86 Instruction Format Definitions.
-//
-
-include "X86InstrFormats.td"
-
-//===----------------------------------------------------------------------===//
-// Pattern fragments...
-//
-
-// X86 specific condition code. These correspond to CondCode in
-// X86InstrInfo.h. They must be kept in synch.
-def X86_COND_A : PatLeaf<(i8 0)>;
-def X86_COND_AE : PatLeaf<(i8 1)>;
-def X86_COND_B : PatLeaf<(i8 2)>;
-def X86_COND_BE : PatLeaf<(i8 3)>;
-def X86_COND_E : PatLeaf<(i8 4)>;
-def X86_COND_G : PatLeaf<(i8 5)>;
-def X86_COND_GE : PatLeaf<(i8 6)>;
-def X86_COND_L : PatLeaf<(i8 7)>;
-def X86_COND_LE : PatLeaf<(i8 8)>;
-def X86_COND_NE : PatLeaf<(i8 9)>;
-def X86_COND_NO : PatLeaf<(i8 10)>;
-def X86_COND_NP : PatLeaf<(i8 11)>;
-def X86_COND_NS : PatLeaf<(i8 12)>;
-def X86_COND_O : PatLeaf<(i8 13)>;
-def X86_COND_P : PatLeaf<(i8 14)>;
-def X86_COND_S : PatLeaf<(i8 15)>;
-
-def i16immSExt8 : PatLeaf<(i16 imm), [{
- // i16immSExt8 predicate - True if the 16-bit immediate fits in a 8-bit
- // sign extended field.
- return (int16_t)N->getValue() == (int8_t)N->getValue();
-}]>;
-
-def i32immSExt8 : PatLeaf<(i32 imm), [{
- // i32immSExt8 predicate - True if the 32-bit immediate fits in a 8-bit
- // sign extended field.
- return (int32_t)N->getValue() == (int8_t)N->getValue();
-}]>;
-
-// Helper fragments for loads.
-def loadi8 : PatFrag<(ops node:$ptr), (i8 (load node:$ptr))>;
-def loadi16 : PatFrag<(ops node:$ptr), (i16 (load node:$ptr))>;
-def loadi32 : PatFrag<(ops node:$ptr), (i32 (load node:$ptr))>;
-def loadi64 : PatFrag<(ops node:$ptr), (i64 (load node:$ptr))>;
-
-def loadf32 : PatFrag<(ops node:$ptr), (f32 (load node:$ptr))>;
-def loadf64 : PatFrag<(ops node:$ptr), (f64 (load node:$ptr))>;
-def loadf80 : PatFrag<(ops node:$ptr), (f80 (load node:$ptr))>;
-
-def sextloadi16i8 : PatFrag<(ops node:$ptr), (i16 (sextloadi8 node:$ptr))>;
-def sextloadi32i8 : PatFrag<(ops node:$ptr), (i32 (sextloadi8 node:$ptr))>;
-def sextloadi32i16 : PatFrag<(ops node:$ptr), (i32 (sextloadi16 node:$ptr))>;
-
-def zextloadi8i1 : PatFrag<(ops node:$ptr), (i8 (zextloadi1 node:$ptr))>;
-def zextloadi16i1 : PatFrag<(ops node:$ptr), (i16 (zextloadi1 node:$ptr))>;
-def zextloadi32i1 : PatFrag<(ops node:$ptr), (i32 (zextloadi1 node:$ptr))>;
-def zextloadi16i8 : PatFrag<(ops node:$ptr), (i16 (zextloadi8 node:$ptr))>;
-def zextloadi32i8 : PatFrag<(ops node:$ptr), (i32 (zextloadi8 node:$ptr))>;
-def zextloadi32i16 : PatFrag<(ops node:$ptr), (i32 (zextloadi16 node:$ptr))>;
-
-def extloadi8i1 : PatFrag<(ops node:$ptr), (i8 (extloadi1 node:$ptr))>;
-def extloadi16i1 : PatFrag<(ops node:$ptr), (i16 (extloadi1 node:$ptr))>;
-def extloadi32i1 : PatFrag<(ops node:$ptr), (i32 (extloadi1 node:$ptr))>;
-def extloadi16i8 : PatFrag<(ops node:$ptr), (i16 (extloadi8 node:$ptr))>;
-def extloadi32i8 : PatFrag<(ops node:$ptr), (i32 (extloadi8 node:$ptr))>;
-def extloadi32i16 : PatFrag<(ops node:$ptr), (i32 (extloadi16 node:$ptr))>;
-
-
-// An 'and' node with a single use.
-def and_su : PatFrag<(ops node:$lhs, node:$rhs), (and node:$lhs, node:$rhs), [{
- return N->hasOneUse();
-}]>;
-
-//===----------------------------------------------------------------------===//
-// Instruction list...
-//
-
-// ADJCALLSTACKDOWN/UP implicitly use/def ESP because they may be expanded into
-// a stack adjustment and the codegen must know that they may modify the stack
-// pointer before prolog-epilog rewriting occurs.
-// Pessimistically assume ADJCALLSTACKDOWN / ADJCALLSTACKUP will become
-// sub / add which can clobber EFLAGS.
-let Defs = [ESP, EFLAGS], Uses = [ESP] in {
-def ADJCALLSTACKDOWN : I<0, Pseudo, (outs), (ins i32imm:$amt),
- "#ADJCALLSTACKDOWN",
- [(X86callseq_start imm:$amt)]>;
-def ADJCALLSTACKUP : I<0, Pseudo, (outs), (ins i32imm:$amt1, i32imm:$amt2),
- "#ADJCALLSTACKUP",
- [(X86callseq_end imm:$amt1, imm:$amt2)]>;
-}
-
-// Nop
-let neverHasSideEffects = 1 in
- def NOOP : I<0x90, RawFrm, (outs), (ins), "nop", []>;
-
-// PIC base
-let neverHasSideEffects = 1, isNotDuplicable = 1 in
- def MOVPC32r : Ii32<0xE8, Pseudo, (outs GR32:$reg), (ins piclabel:$label),
- "call\t$label\n\tpop{l}\t$reg", []>;
-
-//===----------------------------------------------------------------------===//
-// Control Flow Instructions...
-//
-
-// Return instructions.
-let isTerminator = 1, isReturn = 1, isBarrier = 1,
- hasCtrlDep = 1, FPForm = SpecialFP, FPFormBits = SpecialFP.Value in {
- def RET : I <0xC3, RawFrm, (outs), (ins variable_ops),
- "ret",
- [/*(X86retflag 0)*/ /*FIXME: Disabled: rdar://5791600*/]>;
- def RETI : Ii16<0xC2, RawFrm, (outs), (ins i16imm:$amt, variable_ops),
- "ret\t$amt",
- [(X86retflag imm:$amt)]>;
-}
-
-// All branches are RawFrm, Void, Branch, and Terminators
-let isBranch = 1, isTerminator = 1 in
- class IBr<bits<8> opcode, dag ins, string asm, list<dag> pattern> :
- I<opcode, RawFrm, (outs), ins, asm, pattern>;
-
-let isBranch = 1, isBarrier = 1 in
- def JMP : IBr<0xE9, (ins brtarget:$dst), "jmp\t$dst", [(br bb:$dst)]>;
-
-// Indirect branches
-let isBranch = 1, isTerminator = 1, isBarrier = 1, isIndirectBranch = 1 in {
- def JMP32r : I<0xFF, MRM4r, (outs), (ins GR32:$dst), "jmp{l}\t{*}$dst",
- [(brind GR32:$dst)]>;
- def JMP32m : I<0xFF, MRM4m, (outs), (ins i32mem:$dst), "jmp{l}\t{*}$dst",
- [(brind (loadi32 addr:$dst))]>;
-}
-
-// Conditional branches
-let Uses = [EFLAGS] in {
-def JE : IBr<0x84, (ins brtarget:$dst), "je\t$dst",
- [(X86brcond bb:$dst, X86_COND_E, EFLAGS)]>, TB;
-def JNE : IBr<0x85, (ins brtarget:$dst), "jne\t$dst",
- [(X86brcond bb:$dst, X86_COND_NE, EFLAGS)]>, TB;
-def JL : IBr<0x8C, (ins brtarget:$dst), "jl\t$dst",
- [(X86brcond bb:$dst, X86_COND_L, EFLAGS)]>, TB;
-def JLE : IBr<0x8E, (ins brtarget:$dst), "jle\t$dst",
- [(X86brcond bb:$dst, X86_COND_LE, EFLAGS)]>, TB;
-def JG : IBr<0x8F, (ins brtarget:$dst), "jg\t$dst",
- [(X86brcond bb:$dst, X86_COND_G, EFLAGS)]>, TB;
-def JGE : IBr<0x8D, (ins brtarget:$dst), "jge\t$dst",
- [(X86brcond bb:$dst, X86_COND_GE, EFLAGS)]>, TB;
-
-def JB : IBr<0x82, (ins brtarget:$dst), "jb\t$dst",
- [(X86brcond bb:$dst, X86_COND_B, EFLAGS)]>, TB;
-def JBE : IBr<0x86, (ins brtarget:$dst), "jbe\t$dst",
- [(X86brcond bb:$dst, X86_COND_BE, EFLAGS)]>, TB;
-def JA : IBr<0x87, (ins brtarget:$dst), "ja\t$dst",
- [(X86brcond bb:$dst, X86_COND_A, EFLAGS)]>, TB;
-def JAE : IBr<0x83, (ins brtarget:$dst), "jae\t$dst",
- [(X86brcond bb:$dst, X86_COND_AE, EFLAGS)]>, TB;
-
-def JS : IBr<0x88, (ins brtarget:$dst), "js\t$dst",
- [(X86brcond bb:$dst, X86_COND_S, EFLAGS)]>, TB;
-def JNS : IBr<0x89, (ins brtarget:$dst), "jns\t$dst",
- [(X86brcond bb:$dst, X86_COND_NS, EFLAGS)]>, TB;
-def JP : IBr<0x8A, (ins brtarget:$dst), "jp\t$dst",
- [(X86brcond bb:$dst, X86_COND_P, EFLAGS)]>, TB;
-def JNP : IBr<0x8B, (ins brtarget:$dst), "jnp\t$dst",
- [(X86brcond bb:$dst, X86_COND_NP, EFLAGS)]>, TB;
-def JO : IBr<0x80, (ins brtarget:$dst), "jo\t$dst",
- [(X86brcond bb:$dst, X86_COND_O, EFLAGS)]>, TB;
-def JNO : IBr<0x81, (ins brtarget:$dst), "jno\t$dst",
- [(X86brcond bb:$dst, X86_COND_NO, EFLAGS)]>, TB;
-} // Uses = [EFLAGS]
-
-//===----------------------------------------------------------------------===//
-// Call Instructions...
-//
-let isCall = 1 in
- // All calls clobber the non-callee saved registers...
- let Defs = [EAX, ECX, EDX, FP0, FP1, FP2, FP3, FP4, FP5, FP6, ST0,
- MM0, MM1, MM2, MM3, MM4, MM5, MM6, MM7,
- XMM0, XMM1, XMM2, XMM3, XMM4, XMM5, XMM6, XMM7, EFLAGS] in {
- def CALLpcrel32 : Ii32<0xE8, RawFrm, (outs), (ins i32imm:$dst,variable_ops),
- "call\t${dst:call}", []>;
- def CALL32r : I<0xFF, MRM2r, (outs), (ins GR32:$dst, variable_ops),
- "call\t{*}$dst", [(X86call GR32:$dst)]>;
- def CALL32m : I<0xFF, MRM2m, (outs), (ins i32mem:$dst, variable_ops),
- "call\t{*}$dst", []>;
- }
-
-// Tail call stuff.
-
-def TAILCALL : I<0, Pseudo, (outs), (ins),
- "#TAILCALL",
- []>;
-
-let isCall = 1, isTerminator = 1, isReturn = 1, isBarrier = 1 in
-def TCRETURNdi : I<0, Pseudo, (outs), (ins i32imm:$dst, i32imm:$offset, variable_ops),
- "#TC_RETURN $dst $offset",
- []>;
-
-let isCall = 1, isTerminator = 1, isReturn = 1, isBarrier = 1 in
-def TCRETURNri : I<0, Pseudo, (outs), (ins GR32:$dst, i32imm:$offset, variable_ops),
- "#TC_RETURN $dst $offset",
- []>;
-
-let isCall = 1, isTerminator = 1, isReturn = 1, isBarrier = 1 in
-
- def TAILJMPd : IBr<0xE9, (ins i32imm:$dst), "jmp\t${dst:call} # TAILCALL",
- []>;
-let isCall = 1, isTerminator = 1, isReturn = 1, isBarrier = 1 in
- def TAILJMPr : I<0xFF, MRM4r, (outs), (ins GR32:$dst), "jmp{l}\t{*}$dst # TAILCALL",
- []>;
-let isCall = 1, isTerminator = 1, isReturn = 1, isBarrier = 1 in
- def TAILJMPm : I<0xFF, MRM4m, (outs), (ins i32mem:$dst),
- "jmp\t{*}$dst # TAILCALL", []>;
-
-//===----------------------------------------------------------------------===//
-// Miscellaneous Instructions...
-//
-let Defs = [EBP, ESP], Uses = [EBP, ESP], mayLoad = 1, neverHasSideEffects=1 in
-def LEAVE : I<0xC9, RawFrm,
- (outs), (ins), "leave", []>;
-
-let Defs = [ESP], Uses = [ESP], neverHasSideEffects=1 in {
-let mayLoad = 1 in
-def POP32r : I<0x58, AddRegFrm, (outs GR32:$reg), (ins), "pop{l}\t$reg", []>;
-
-let mayStore = 1 in
-def PUSH32r : I<0x50, AddRegFrm, (outs), (ins GR32:$reg), "push{l}\t$reg",[]>;
-}
-
-let Defs = [ESP, EFLAGS], Uses = [ESP], mayLoad = 1, neverHasSideEffects=1 in
-def POPFD : I<0x9D, RawFrm, (outs), (ins), "popf", []>;
-let Defs = [ESP], Uses = [ESP, EFLAGS], mayStore = 1, neverHasSideEffects=1 in
-def PUSHFD : I<0x9C, RawFrm, (outs), (ins), "pushf", []>;
-
-let isTwoAddress = 1 in // GR32 = bswap GR32
- def BSWAP32r : I<0xC8, AddRegFrm,
- (outs GR32:$dst), (ins GR32:$src),
- "bswap{l}\t$dst",
- [(set GR32:$dst, (bswap GR32:$src))]>, TB;
-
-
-// Bit scan instructions.
-let Defs = [EFLAGS] in {
-def BSF16rr : I<0xBC, MRMSrcReg, (outs GR16:$dst), (ins GR16:$src),
- "bsf{w}\t{$src, $dst|$dst, $src}",
- [(set GR16:$dst, (X86bsf GR16:$src)), (implicit EFLAGS)]>, TB;
-def BSF16rm : I<0xBC, MRMSrcMem, (outs GR16:$dst), (ins i16mem:$src),
- "bsf{w}\t{$src, $dst|$dst, $src}",
- [(set GR16:$dst, (X86bsf (loadi16 addr:$src))),
- (implicit EFLAGS)]>, TB;
-def BSF32rr : I<0xBC, MRMSrcReg, (outs GR32:$dst), (ins GR32:$src),
- "bsf{l}\t{$src, $dst|$dst, $src}",
- [(set GR32:$dst, (X86bsf GR32:$src)), (implicit EFLAGS)]>, TB;
-def BSF32rm : I<0xBC, MRMSrcMem, (outs GR32:$dst), (ins i32mem:$src),
- "bsf{l}\t{$src, $dst|$dst, $src}",
- [(set GR32:$dst, (X86bsf (loadi32 addr:$src))),
- (implicit EFLAGS)]>, TB;
-
-def BSR16rr : I<0xBD, MRMSrcReg, (outs GR16:$dst), (ins GR16:$src),
- "bsr{w}\t{$src, $dst|$dst, $src}",
- [(set GR16:$dst, (X86bsr GR16:$src)), (implicit EFLAGS)]>, TB;
-def BSR16rm : I<0xBD, MRMSrcMem, (outs GR16:$dst), (ins i16mem:$src),
- "bsr{w}\t{$src, $dst|$dst, $src}",
- [(set GR16:$dst, (X86bsr (loadi16 addr:$src))),
- (implicit EFLAGS)]>, TB;
-def BSR32rr : I<0xBD, MRMSrcReg, (outs GR32:$dst), (ins GR32:$src),
- "bsr{l}\t{$src, $dst|$dst, $src}",
- [(set GR32:$dst, (X86bsr GR32:$src)), (implicit EFLAGS)]>, TB;
-def BSR32rm : I<0xBD, MRMSrcMem, (outs GR32:$dst), (ins i32mem:$src),
- "bsr{l}\t{$src, $dst|$dst, $src}",
- [(set GR32:$dst, (X86bsr (loadi32 addr:$src))),
- (implicit EFLAGS)]>, TB;
-} // Defs = [EFLAGS]
-
-let neverHasSideEffects = 1 in
-def LEA16r : I<0x8D, MRMSrcMem,
- (outs GR16:$dst), (ins i32mem:$src),
- "lea{w}\t{$src|$dst}, {$dst|$src}", []>, OpSize;
-let isReMaterializable = 1 in
-def LEA32r : I<0x8D, MRMSrcMem,
- (outs GR32:$dst), (ins lea32mem:$src),
- "lea{l}\t{$src|$dst}, {$dst|$src}",
- [(set GR32:$dst, lea32addr:$src)]>, Requires<[In32BitMode]>;
-
-let Defs = [ECX,EDI,ESI], Uses = [ECX,EDI,ESI] in {
-def REP_MOVSB : I<0xA4, RawFrm, (outs), (ins), "{rep;movsb|rep movsb}",
- [(X86rep_movs i8)]>, REP;
-def REP_MOVSW : I<0xA5, RawFrm, (outs), (ins), "{rep;movsw|rep movsw}",
- [(X86rep_movs i16)]>, REP, OpSize;
-def REP_MOVSD : I<0xA5, RawFrm, (outs), (ins), "{rep;movsl|rep movsd}",
- [(X86rep_movs i32)]>, REP;
-}
-
-let Defs = [ECX,EDI], Uses = [AL,ECX,EDI] in
-def REP_STOSB : I<0xAA, RawFrm, (outs), (ins), "{rep;stosb|rep stosb}",
- [(X86rep_stos i8)]>, REP;
-let Defs = [ECX,EDI], Uses = [AX,ECX,EDI] in
-def REP_STOSW : I<0xAB, RawFrm, (outs), (ins), "{rep;stosw|rep stosw}",
- [(X86rep_stos i16)]>, REP, OpSize;
-let Defs = [ECX,EDI], Uses = [EAX,ECX,EDI] in
-def REP_STOSD : I<0xAB, RawFrm, (outs), (ins), "{rep;stosl|rep stosd}",
- [(X86rep_stos i32)]>, REP;
-
-let Defs = [RAX, RDX] in
-def RDTSC : I<0x31, RawFrm, (outs), (ins), "rdtsc", [(X86rdtsc)]>,
- TB;
-
-let isBarrier = 1, hasCtrlDep = 1 in {
-def TRAP : I<0x0B, RawFrm, (outs), (ins), "ud2", [(trap)]>, TB;
-}
-
-//===----------------------------------------------------------------------===//
-// Input/Output Instructions...
-//
-let Defs = [AL], Uses = [DX] in
-def IN8rr : I<0xEC, RawFrm, (outs), (ins),
- "in{b}\t{%dx, %al|%AL, %DX}", []>;
-let Defs = [AX], Uses = [DX] in
-def IN16rr : I<0xED, RawFrm, (outs), (ins),
- "in{w}\t{%dx, %ax|%AX, %DX}", []>, OpSize;
-let Defs = [EAX], Uses = [DX] in
-def IN32rr : I<0xED, RawFrm, (outs), (ins),
- "in{l}\t{%dx, %eax|%EAX, %DX}", []>;
-
-let Defs = [AL] in
-def IN8ri : Ii8<0xE4, RawFrm, (outs), (ins i16i8imm:$port),
- "in{b}\t{$port, %al|%AL, $port}", []>;
-let Defs = [AX] in
-def IN16ri : Ii8<0xE5, RawFrm, (outs), (ins i16i8imm:$port),
- "in{w}\t{$port, %ax|%AX, $port}", []>, OpSize;
-let Defs = [EAX] in
-def IN32ri : Ii8<0xE5, RawFrm, (outs), (ins i16i8imm:$port),
- "in{l}\t{$port, %eax|%EAX, $port}", []>;
-
-let Uses = [DX, AL] in
-def OUT8rr : I<0xEE, RawFrm, (outs), (ins),
- "out{b}\t{%al, %dx|%DX, %AL}", []>;
-let Uses = [DX, AX] in
-def OUT16rr : I<0xEF, RawFrm, (outs), (ins),
- "out{w}\t{%ax, %dx|%DX, %AX}", []>, OpSize;
-let Uses = [DX, EAX] in
-def OUT32rr : I<0xEF, RawFrm, (outs), (ins),
- "out{l}\t{%eax, %dx|%DX, %EAX}", []>;
-
-let Uses = [AL] in
-def OUT8ir : Ii8<0xE6, RawFrm, (outs), (ins i16i8imm:$port),
- "out{b}\t{%al, $port|$port, %AL}", []>;
-let Uses = [AX] in
-def OUT16ir : Ii8<0xE7, RawFrm, (outs), (ins i16i8imm:$port),
- "out{w}\t{%ax, $port|$port, %AX}", []>, OpSize;
-let Uses = [EAX] in
-def OUT32ir : Ii8<0xE7, RawFrm, (outs), (ins i16i8imm:$port),
- "out{l}\t{%eax, $port|$port, %EAX}", []>;
-
-//===----------------------------------------------------------------------===//
-// Move Instructions...
-//
-let neverHasSideEffects = 1 in {
-def MOV8rr : I<0x88, MRMDestReg, (outs GR8 :$dst), (ins GR8 :$src),
- "mov{b}\t{$src, $dst|$dst, $src}", []>;
-def MOV16rr : I<0x89, MRMDestReg, (outs GR16:$dst), (ins GR16:$src),
- "mov{w}\t{$src, $dst|$dst, $src}", []>, OpSize;
-def MOV32rr : I<0x89, MRMDestReg, (outs GR32:$dst), (ins GR32:$src),
- "mov{l}\t{$src, $dst|$dst, $src}", []>;
-}
-let isReMaterializable = 1 in {
-def MOV8ri : Ii8 <0xB0, AddRegFrm, (outs GR8 :$dst), (ins i8imm :$src),
- "mov{b}\t{$src, $dst|$dst, $src}",
- [(set GR8:$dst, imm:$src)]>;
-def MOV16ri : Ii16<0xB8, AddRegFrm, (outs GR16:$dst), (ins i16imm:$src),
- "mov{w}\t{$src, $dst|$dst, $src}",
- [(set GR16:$dst, imm:$src)]>, OpSize;
-def MOV32ri : Ii32<0xB8, AddRegFrm, (outs GR32:$dst), (ins i32imm:$src),
- "mov{l}\t{$src, $dst|$dst, $src}",
- [(set GR32:$dst, imm:$src)]>;
-}
-def MOV8mi : Ii8 <0xC6, MRM0m, (outs), (ins i8mem :$dst, i8imm :$src),
- "mov{b}\t{$src, $dst|$dst, $src}",
- [(store (i8 imm:$src), addr:$dst)]>;
-def MOV16mi : Ii16<0xC7, MRM0m, (outs), (ins i16mem:$dst, i16imm:$src),
- "mov{w}\t{$src, $dst|$dst, $src}",
- [(store (i16 imm:$src), addr:$dst)]>, OpSize;
-def MOV32mi : Ii32<0xC7, MRM0m, (outs), (ins i32mem:$dst, i32imm:$src),
- "mov{l}\t{$src, $dst|$dst, $src}",
- [(store (i32 imm:$src), addr:$dst)]>;
-
-let isSimpleLoad = 1, isReMaterializable = 1, mayHaveSideEffects = 1 in {
-def MOV8rm : I<0x8A, MRMSrcMem, (outs GR8 :$dst), (ins i8mem :$src),
- "mov{b}\t{$src, $dst|$dst, $src}",
- [(set GR8:$dst, (load addr:$src))]>;
-def MOV16rm : I<0x8B, MRMSrcMem, (outs GR16:$dst), (ins i16mem:$src),
- "mov{w}\t{$src, $dst|$dst, $src}",
- [(set GR16:$dst, (load addr:$src))]>, OpSize;
-def MOV32rm : I<0x8B, MRMSrcMem, (outs GR32:$dst), (ins i32mem:$src),
- "mov{l}\t{$src, $dst|$dst, $src}",
- [(set GR32:$dst, (load addr:$src))]>;
-}
-
-def MOV8mr : I<0x88, MRMDestMem, (outs), (ins i8mem :$dst, GR8 :$src),
- "mov{b}\t{$src, $dst|$dst, $src}",
- [(store GR8:$src, addr:$dst)]>;
-def MOV16mr : I<0x89, MRMDestMem, (outs), (ins i16mem:$dst, GR16:$src),
- "mov{w}\t{$src, $dst|$dst, $src}",
- [(store GR16:$src, addr:$dst)]>, OpSize;
-def MOV32mr : I<0x89, MRMDestMem, (outs), (ins i32mem:$dst, GR32:$src),
- "mov{l}\t{$src, $dst|$dst, $src}",
- [(store GR32:$src, addr:$dst)]>;
-
-//===----------------------------------------------------------------------===//
-// Fixed-Register Multiplication and Division Instructions...
-//
-
-// Extra precision multiplication
-let Defs = [AL,AH,EFLAGS], Uses = [AL] in
-def MUL8r : I<0xF6, MRM4r, (outs), (ins GR8:$src), "mul{b}\t$src",
- // FIXME: Used for 8-bit mul, ignore result upper 8 bits.
- // This probably ought to be moved to a def : Pat<> if the
- // syntax can be accepted.
- [(set AL, (mul AL, GR8:$src))]>; // AL,AH = AL*GR8
-let Defs = [AX,DX,EFLAGS], Uses = [AX], neverHasSideEffects = 1 in
-def MUL16r : I<0xF7, MRM4r, (outs), (ins GR16:$src), "mul{w}\t$src", []>,
- OpSize; // AX,DX = AX*GR16
-let Defs = [EAX,EDX,EFLAGS], Uses = [EAX], neverHasSideEffects = 1 in
-def MUL32r : I<0xF7, MRM4r, (outs), (ins GR32:$src), "mul{l}\t$src", []>;
- // EAX,EDX = EAX*GR32
-let Defs = [AL,AH,EFLAGS], Uses = [AL] in
-def MUL8m : I<0xF6, MRM4m, (outs), (ins i8mem :$src),
- "mul{b}\t$src",
- // FIXME: Used for 8-bit mul, ignore result upper 8 bits.
- // This probably ought to be moved to a def : Pat<> if the
- // syntax can be accepted.
- [(set AL, (mul AL, (loadi8 addr:$src)))]>; // AL,AH = AL*[mem8]
-let mayLoad = 1, neverHasSideEffects = 1 in {
-let Defs = [AX,DX,EFLAGS], Uses = [AX] in
-def MUL16m : I<0xF7, MRM4m, (outs), (ins i16mem:$src),
- "mul{w}\t$src", []>, OpSize; // AX,DX = AX*[mem16]
-let Defs = [EAX,EDX,EFLAGS], Uses = [EAX] in
-def MUL32m : I<0xF7, MRM4m, (outs), (ins i32mem:$src),
- "mul{l}\t$src", []>; // EAX,EDX = EAX*[mem32]
-}
-
-let neverHasSideEffects = 1 in {
-let Defs = [AL,AH,EFLAGS], Uses = [AL] in
-def IMUL8r : I<0xF6, MRM5r, (outs), (ins GR8:$src), "imul{b}\t$src", []>;
- // AL,AH = AL*GR8
-let Defs = [AX,DX,EFLAGS], Uses = [AX] in
-def IMUL16r : I<0xF7, MRM5r, (outs), (ins GR16:$src), "imul{w}\t$src", []>,
- OpSize; // AX,DX = AX*GR16
-let Defs = [EAX,EDX,EFLAGS], Uses = [EAX] in
-def IMUL32r : I<0xF7, MRM5r, (outs), (ins GR32:$src), "imul{l}\t$src", []>;
- // EAX,EDX = EAX*GR32
-let mayLoad = 1 in {
-let Defs = [AL,AH,EFLAGS], Uses = [AL] in
-def IMUL8m : I<0xF6, MRM5m, (outs), (ins i8mem :$src),
- "imul{b}\t$src", []>; // AL,AH = AL*[mem8]
-let Defs = [AX,DX,EFLAGS], Uses = [AX] in
-def IMUL16m : I<0xF7, MRM5m, (outs), (ins i16mem:$src),
- "imul{w}\t$src", []>, OpSize; // AX,DX = AX*[mem16]
-let Defs = [EAX,EDX], Uses = [EAX] in
-def IMUL32m : I<0xF7, MRM5m, (outs), (ins i32mem:$src),
- "imul{l}\t$src", []>; // EAX,EDX = EAX*[mem32]
-}
-
-// unsigned division/remainder
-let Defs = [AX,EFLAGS], Uses = [AL,AH] in
-def DIV8r : I<0xF6, MRM6r, (outs), (ins GR8:$src), // AX/r8 = AL,AH
- "div{b}\t$src", []>;
-let Defs = [AX,DX,EFLAGS], Uses = [AX,DX] in
-def DIV16r : I<0xF7, MRM6r, (outs), (ins GR16:$src), // DX:AX/r16 = AX,DX
- "div{w}\t$src", []>, OpSize;
-let Defs = [EAX,EDX,EFLAGS], Uses = [EAX,EDX] in
-def DIV32r : I<0xF7, MRM6r, (outs), (ins GR32:$src), // EDX:EAX/r32 = EAX,EDX
- "div{l}\t$src", []>;
-let mayLoad = 1 in {
-let Defs = [AX,EFLAGS], Uses = [AL,AH] in
-def DIV8m : I<0xF6, MRM6m, (outs), (ins i8mem:$src), // AX/[mem8] = AL,AH
- "div{b}\t$src", []>;
-let Defs = [AX,DX,EFLAGS], Uses = [AX,DX] in
-def DIV16m : I<0xF7, MRM6m, (outs), (ins i16mem:$src), // DX:AX/[mem16] = AX,DX
- "div{w}\t$src", []>, OpSize;
-let Defs = [EAX,EDX,EFLAGS], Uses = [EAX,EDX] in
-def DIV32m : I<0xF7, MRM6m, (outs), (ins i32mem:$src), // EDX:EAX/[mem32] = EAX,EDX
- "div{l}\t$src", []>;
-}
-
-// Signed division/remainder.
-let Defs = [AX,EFLAGS], Uses = [AL,AH] in
-def IDIV8r : I<0xF6, MRM7r, (outs), (ins GR8:$src), // AX/r8 = AL,AH
- "idiv{b}\t$src", []>;
-let Defs = [AX,DX,EFLAGS], Uses = [AX,DX] in
-def IDIV16r: I<0xF7, MRM7r, (outs), (ins GR16:$src), // DX:AX/r16 = AX,DX
- "idiv{w}\t$src", []>, OpSize;
-let Defs = [EAX,EDX,EFLAGS], Uses = [EAX,EDX] in
-def IDIV32r: I<0xF7, MRM7r, (outs), (ins GR32:$src), // EDX:EAX/r32 = EAX,EDX
- "idiv{l}\t$src", []>;
-let mayLoad = 1, mayLoad = 1 in {
-let Defs = [AX,EFLAGS], Uses = [AL,AH] in
-def IDIV8m : I<0xF6, MRM7m, (outs), (ins i8mem:$src), // AX/[mem8] = AL,AH
- "idiv{b}\t$src", []>;
-let Defs = [AX,DX,EFLAGS], Uses = [AX,DX] in
-def IDIV16m: I<0xF7, MRM7m, (outs), (ins i16mem:$src), // DX:AX/[mem16] = AX,DX
- "idiv{w}\t$src", []>, OpSize;
-let Defs = [EAX,EDX,EFLAGS], Uses = [EAX,EDX] in
-def IDIV32m: I<0xF7, MRM7m, (outs), (ins i32mem:$src), // EDX:EAX/[mem32] = EAX,EDX
- "idiv{l}\t$src", []>;
-}
-} // neverHasSideEffects
-
-//===----------------------------------------------------------------------===//
-// Two address Instructions.
-//
-let isTwoAddress = 1 in {
-
-// Conditional moves
-let Uses = [EFLAGS] in {
-let isCommutable = 1 in {
-def CMOVB16rr : I<0x42, MRMSrcReg, // if <u, GR16 = GR16
- (outs GR16:$dst), (ins GR16:$src1, GR16:$src2),
- "cmovb\t{$src2, $dst|$dst, $src2}",
- [(set GR16:$dst, (X86cmov GR16:$src1, GR16:$src2,
- X86_COND_B, EFLAGS))]>,
- TB, OpSize;
-def CMOVB32rr : I<0x42, MRMSrcReg, // if <u, GR32 = GR32
- (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
- "cmovb\t{$src2, $dst|$dst, $src2}",
- [(set GR32:$dst, (X86cmov GR32:$src1, GR32:$src2,
- X86_COND_B, EFLAGS))]>,
- TB;
-
-def CMOVAE16rr: I<0x43, MRMSrcReg, // if >=u, GR16 = GR16
- (outs GR16:$dst), (ins GR16:$src1, GR16:$src2),
- "cmovae\t{$src2, $dst|$dst, $src2}",
- [(set GR16:$dst, (X86cmov GR16:$src1, GR16:$src2,
- X86_COND_AE, EFLAGS))]>,
- TB, OpSize;
-def CMOVAE32rr: I<0x43, MRMSrcReg, // if >=u, GR32 = GR32
- (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
- "cmovae\t{$src2, $dst|$dst, $src2}",
- [(set GR32:$dst, (X86cmov GR32:$src1, GR32:$src2,
- X86_COND_AE, EFLAGS))]>,
- TB;
-def CMOVE16rr : I<0x44, MRMSrcReg, // if ==, GR16 = GR16
- (outs GR16:$dst), (ins GR16:$src1, GR16:$src2),
- "cmove\t{$src2, $dst|$dst, $src2}",
- [(set GR16:$dst, (X86cmov GR16:$src1, GR16:$src2,
- X86_COND_E, EFLAGS))]>,
- TB, OpSize;
-def CMOVE32rr : I<0x44, MRMSrcReg, // if ==, GR32 = GR32
- (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
- "cmove\t{$src2, $dst|$dst, $src2}",
- [(set GR32:$dst, (X86cmov GR32:$src1, GR32:$src2,
- X86_COND_E, EFLAGS))]>,
- TB;
-def CMOVNE16rr: I<0x45, MRMSrcReg, // if !=, GR16 = GR16
- (outs GR16:$dst), (ins GR16:$src1, GR16:$src2),
- "cmovne\t{$src2, $dst|$dst, $src2}",
- [(set GR16:$dst, (X86cmov GR16:$src1, GR16:$src2,
- X86_COND_NE, EFLAGS))]>,
- TB, OpSize;
-def CMOVNE32rr: I<0x45, MRMSrcReg, // if !=, GR32 = GR32
- (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
- "cmovne\t{$src2, $dst|$dst, $src2}",
- [(set GR32:$dst, (X86cmov GR32:$src1, GR32:$src2,
- X86_COND_NE, EFLAGS))]>,
- TB;
-def CMOVBE16rr: I<0x46, MRMSrcReg, // if <=u, GR16 = GR16
- (outs GR16:$dst), (ins GR16:$src1, GR16:$src2),
- "cmovbe\t{$src2, $dst|$dst, $src2}",
- [(set GR16:$dst, (X86cmov GR16:$src1, GR16:$src2,
- X86_COND_BE, EFLAGS))]>,
- TB, OpSize;
-def CMOVBE32rr: I<0x46, MRMSrcReg, // if <=u, GR32 = GR32
- (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
- "cmovbe\t{$src2, $dst|$dst, $src2}",
- [(set GR32:$dst, (X86cmov GR32:$src1, GR32:$src2,
- X86_COND_BE, EFLAGS))]>,
- TB;
-def CMOVA16rr : I<0x47, MRMSrcReg, // if >u, GR16 = GR16
- (outs GR16:$dst), (ins GR16:$src1, GR16:$src2),
- "cmova\t{$src2, $dst|$dst, $src2}",
- [(set GR16:$dst, (X86cmov GR16:$src1, GR16:$src2,
- X86_COND_A, EFLAGS))]>,
- TB, OpSize;
-def CMOVA32rr : I<0x47, MRMSrcReg, // if >u, GR32 = GR32
- (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
- "cmova\t{$src2, $dst|$dst, $src2}",
- [(set GR32:$dst, (X86cmov GR32:$src1, GR32:$src2,
- X86_COND_A, EFLAGS))]>,
- TB;
-def CMOVL16rr : I<0x4C, MRMSrcReg, // if <s, GR16 = GR16
- (outs GR16:$dst), (ins GR16:$src1, GR16:$src2),
- "cmovl\t{$src2, $dst|$dst, $src2}",
- [(set GR16:$dst, (X86cmov GR16:$src1, GR16:$src2,
- X86_COND_L, EFLAGS))]>,
- TB, OpSize;
-def CMOVL32rr : I<0x4C, MRMSrcReg, // if <s, GR32 = GR32
- (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
- "cmovl\t{$src2, $dst|$dst, $src2}",
- [(set GR32:$dst, (X86cmov GR32:$src1, GR32:$src2,
- X86_COND_L, EFLAGS))]>,
- TB;
-def CMOVGE16rr: I<0x4D, MRMSrcReg, // if >=s, GR16 = GR16
- (outs GR16:$dst), (ins GR16:$src1, GR16:$src2),
- "cmovge\t{$src2, $dst|$dst, $src2}",
- [(set GR16:$dst, (X86cmov GR16:$src1, GR16:$src2,
- X86_COND_GE, EFLAGS))]>,
- TB, OpSize;
-def CMOVGE32rr: I<0x4D, MRMSrcReg, // if >=s, GR32 = GR32
- (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
- "cmovge\t{$src2, $dst|$dst, $src2}",
- [(set GR32:$dst, (X86cmov GR32:$src1, GR32:$src2,
- X86_COND_GE, EFLAGS))]>,
- TB;
-def CMOVLE16rr: I<0x4E, MRMSrcReg, // if <=s, GR16 = GR16
- (outs GR16:$dst), (ins GR16:$src1, GR16:$src2),
- "cmovle\t{$src2, $dst|$dst, $src2}",
- [(set GR16:$dst, (X86cmov GR16:$src1, GR16:$src2,
- X86_COND_LE, EFLAGS))]>,
- TB, OpSize;
-def CMOVLE32rr: I<0x4E, MRMSrcReg, // if <=s, GR32 = GR32
- (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
- "cmovle\t{$src2, $dst|$dst, $src2}",
- [(set GR32:$dst, (X86cmov GR32:$src1, GR32:$src2,
- X86_COND_LE, EFLAGS))]>,
- TB;
-def CMOVG16rr : I<0x4F, MRMSrcReg, // if >s, GR16 = GR16
- (outs GR16:$dst), (ins GR16:$src1, GR16:$src2),
- "cmovg\t{$src2, $dst|$dst, $src2}",
- [(set GR16:$dst, (X86cmov GR16:$src1, GR16:$src2,
- X86_COND_G, EFLAGS))]>,
- TB, OpSize;
-def CMOVG32rr : I<0x4F, MRMSrcReg, // if >s, GR32 = GR32
- (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
- "cmovg\t{$src2, $dst|$dst, $src2}",
- [(set GR32:$dst, (X86cmov GR32:$src1, GR32:$src2,
- X86_COND_G, EFLAGS))]>,
- TB;
-def CMOVS16rr : I<0x48, MRMSrcReg, // if signed, GR16 = GR16
- (outs GR16:$dst), (ins GR16:$src1, GR16:$src2),
- "cmovs\t{$src2, $dst|$dst, $src2}",
- [(set GR16:$dst, (X86cmov GR16:$src1, GR16:$src2,
- X86_COND_S, EFLAGS))]>,
- TB, OpSize;
-def CMOVS32rr : I<0x48, MRMSrcReg, // if signed, GR32 = GR32
- (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
- "cmovs\t{$src2, $dst|$dst, $src2}",
- [(set GR32:$dst, (X86cmov GR32:$src1, GR32:$src2,
- X86_COND_S, EFLAGS))]>,
- TB;
-def CMOVNS16rr: I<0x49, MRMSrcReg, // if !signed, GR16 = GR16
- (outs GR16:$dst), (ins GR16:$src1, GR16:$src2),
- "cmovns\t{$src2, $dst|$dst, $src2}",
- [(set GR16:$dst, (X86cmov GR16:$src1, GR16:$src2,
- X86_COND_NS, EFLAGS))]>,
- TB, OpSize;
-def CMOVNS32rr: I<0x49, MRMSrcReg, // if !signed, GR32 = GR32
- (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
- "cmovns\t{$src2, $dst|$dst, $src2}",
- [(set GR32:$dst, (X86cmov GR32:$src1, GR32:$src2,
- X86_COND_NS, EFLAGS))]>,
- TB;
-def CMOVP16rr : I<0x4A, MRMSrcReg, // if parity, GR16 = GR16
- (outs GR16:$dst), (ins GR16:$src1, GR16:$src2),
- "cmovp\t{$src2, $dst|$dst, $src2}",
- [(set GR16:$dst, (X86cmov GR16:$src1, GR16:$src2,
- X86_COND_P, EFLAGS))]>,
- TB, OpSize;
-def CMOVP32rr : I<0x4A, MRMSrcReg, // if parity, GR32 = GR32
- (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
- "cmovp\t{$src2, $dst|$dst, $src2}",
- [(set GR32:$dst, (X86cmov GR32:$src1, GR32:$src2,
- X86_COND_P, EFLAGS))]>,
- TB;
-def CMOVNP16rr : I<0x4B, MRMSrcReg, // if !parity, GR16 = GR16
- (outs GR16:$dst), (ins GR16:$src1, GR16:$src2),
- "cmovnp\t{$src2, $dst|$dst, $src2}",
- [(set GR16:$dst, (X86cmov GR16:$src1, GR16:$src2,
- X86_COND_NP, EFLAGS))]>,
- TB, OpSize;
-def CMOVNP32rr : I<0x4B, MRMSrcReg, // if !parity, GR32 = GR32
- (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
- "cmovnp\t{$src2, $dst|$dst, $src2}",
- [(set GR32:$dst, (X86cmov GR32:$src1, GR32:$src2,
- X86_COND_NP, EFLAGS))]>,
- TB;
-} // isCommutable = 1
-
-def CMOVNP32rm : I<0x4B, MRMSrcMem, // if !parity, GR32 = [mem32]
- (outs GR32:$dst), (ins GR32:$src1, i32mem:$src2),
- "cmovnp\t{$src2, $dst|$dst, $src2}",
- [(set GR32:$dst, (X86cmov GR32:$src1, (loadi32 addr:$src2),
- X86_COND_NP, EFLAGS))]>,
- TB;
-
-def CMOVB16rm : I<0x42, MRMSrcMem, // if <u, GR16 = [mem16]
- (outs GR16:$dst), (ins GR16:$src1, i16mem:$src2),
- "cmovb\t{$src2, $dst|$dst, $src2}",
- [(set GR16:$dst, (X86cmov GR16:$src1, (loadi16 addr:$src2),
- X86_COND_B, EFLAGS))]>,
- TB, OpSize;
-def CMOVB32rm : I<0x42, MRMSrcMem, // if <u, GR32 = [mem32]
- (outs GR32:$dst), (ins GR32:$src1, i32mem:$src2),
- "cmovb\t{$src2, $dst|$dst, $src2}",
- [(set GR32:$dst, (X86cmov GR32:$src1, (loadi32 addr:$src2),
- X86_COND_B, EFLAGS))]>,
- TB;
-def CMOVAE16rm: I<0x43, MRMSrcMem, // if >=u, GR16 = [mem16]
- (outs GR16:$dst), (ins GR16:$src1, i16mem:$src2),
- "cmovae\t{$src2, $dst|$dst, $src2}",
- [(set GR16:$dst, (X86cmov GR16:$src1, (loadi16 addr:$src2),
- X86_COND_AE, EFLAGS))]>,
- TB, OpSize;
-def CMOVAE32rm: I<0x43, MRMSrcMem, // if >=u, GR32 = [mem32]
- (outs GR32:$dst), (ins GR32:$src1, i32mem:$src2),
- "cmovae\t{$src2, $dst|$dst, $src2}",
- [(set GR32:$dst, (X86cmov GR32:$src1, (loadi32 addr:$src2),
- X86_COND_AE, EFLAGS))]>,
- TB;
-def CMOVE16rm : I<0x44, MRMSrcMem, // if ==, GR16 = [mem16]
- (outs GR16:$dst), (ins GR16:$src1, i16mem:$src2),
- "cmove\t{$src2, $dst|$dst, $src2}",
- [(set GR16:$dst, (X86cmov GR16:$src1, (loadi16 addr:$src2),
- X86_COND_E, EFLAGS))]>,
- TB, OpSize;
-def CMOVE32rm : I<0x44, MRMSrcMem, // if ==, GR32 = [mem32]
- (outs GR32:$dst), (ins GR32:$src1, i32mem:$src2),
- "cmove\t{$src2, $dst|$dst, $src2}",
- [(set GR32:$dst, (X86cmov GR32:$src1, (loadi32 addr:$src2),
- X86_COND_E, EFLAGS))]>,
- TB;
-def CMOVNE16rm: I<0x45, MRMSrcMem, // if !=, GR16 = [mem16]
- (outs GR16:$dst), (ins GR16:$src1, i16mem:$src2),
- "cmovne\t{$src2, $dst|$dst, $src2}",
- [(set GR16:$dst, (X86cmov GR16:$src1, (loadi16 addr:$src2),
- X86_COND_NE, EFLAGS))]>,
- TB, OpSize;
-def CMOVNE32rm: I<0x45, MRMSrcMem, // if !=, GR32 = [mem32]
- (outs GR32:$dst), (ins GR32:$src1, i32mem:$src2),
- "cmovne\t{$src2, $dst|$dst, $src2}",
- [(set GR32:$dst, (X86cmov GR32:$src1, (loadi32 addr:$src2),
- X86_COND_NE, EFLAGS))]>,
- TB;
-def CMOVBE16rm: I<0x46, MRMSrcMem, // if <=u, GR16 = [mem16]
- (outs GR16:$dst), (ins GR16:$src1, i16mem:$src2),
- "cmovbe\t{$src2, $dst|$dst, $src2}",
- [(set GR16:$dst, (X86cmov GR16:$src1, (loadi16 addr:$src2),
- X86_COND_BE, EFLAGS))]>,
- TB, OpSize;
-def CMOVBE32rm: I<0x46, MRMSrcMem, // if <=u, GR32 = [mem32]
- (outs GR32:$dst), (ins GR32:$src1, i32mem:$src2),
- "cmovbe\t{$src2, $dst|$dst, $src2}",
- [(set GR32:$dst, (X86cmov GR32:$src1, (loadi32 addr:$src2),
- X86_COND_BE, EFLAGS))]>,
- TB;
-def CMOVA16rm : I<0x47, MRMSrcMem, // if >u, GR16 = [mem16]
- (outs GR16:$dst), (ins GR16:$src1, i16mem:$src2),
- "cmova\t{$src2, $dst|$dst, $src2}",
- [(set GR16:$dst, (X86cmov GR16:$src1, (loadi16 addr:$src2),
- X86_COND_A, EFLAGS))]>,
- TB, OpSize;
-def CMOVA32rm : I<0x47, MRMSrcMem, // if >u, GR32 = [mem32]
- (outs GR32:$dst), (ins GR32:$src1, i32mem:$src2),
- "cmova\t{$src2, $dst|$dst, $src2}",
- [(set GR32:$dst, (X86cmov GR32:$src1, (loadi32 addr:$src2),
- X86_COND_A, EFLAGS))]>,
- TB;
-def CMOVL16rm : I<0x4C, MRMSrcMem, // if <s, GR16 = [mem16]
- (outs GR16:$dst), (ins GR16:$src1, i16mem:$src2),
- "cmovl\t{$src2, $dst|$dst, $src2}",
- [(set GR16:$dst, (X86cmov GR16:$src1, (loadi16 addr:$src2),
- X86_COND_L, EFLAGS))]>,
- TB, OpSize;
-def CMOVL32rm : I<0x4C, MRMSrcMem, // if <s, GR32 = [mem32]
- (outs GR32:$dst), (ins GR32:$src1, i32mem:$src2),
- "cmovl\t{$src2, $dst|$dst, $src2}",
- [(set GR32:$dst, (X86cmov GR32:$src1, (loadi32 addr:$src2),
- X86_COND_L, EFLAGS))]>,
- TB;
-def CMOVGE16rm: I<0x4D, MRMSrcMem, // if >=s, GR16 = [mem16]
- (outs GR16:$dst), (ins GR16:$src1, i16mem:$src2),
- "cmovge\t{$src2, $dst|$dst, $src2}",
- [(set GR16:$dst, (X86cmov GR16:$src1, (loadi16 addr:$src2),
- X86_COND_GE, EFLAGS))]>,
- TB, OpSize;
-def CMOVGE32rm: I<0x4D, MRMSrcMem, // if >=s, GR32 = [mem32]
- (outs GR32:$dst), (ins GR32:$src1, i32mem:$src2),
- "cmovge\t{$src2, $dst|$dst, $src2}",
- [(set GR32:$dst, (X86cmov GR32:$src1, (loadi32 addr:$src2),
- X86_COND_GE, EFLAGS))]>,
- TB;
-def CMOVLE16rm: I<0x4E, MRMSrcMem, // if <=s, GR16 = [mem16]
- (outs GR16:$dst), (ins GR16:$src1, i16mem:$src2),
- "cmovle\t{$src2, $dst|$dst, $src2}",
- [(set GR16:$dst, (X86cmov GR16:$src1, (loadi16 addr:$src2),
- X86_COND_LE, EFLAGS))]>,
- TB, OpSize;
-def CMOVLE32rm: I<0x4E, MRMSrcMem, // if <=s, GR32 = [mem32]
- (outs GR32:$dst), (ins GR32:$src1, i32mem:$src2),
- "cmovle\t{$src2, $dst|$dst, $src2}",
- [(set GR32:$dst, (X86cmov GR32:$src1, (loadi32 addr:$src2),
- X86_COND_LE, EFLAGS))]>,
- TB;
-def CMOVG16rm : I<0x4F, MRMSrcMem, // if >s, GR16 = [mem16]
- (outs GR16:$dst), (ins GR16:$src1, i16mem:$src2),
- "cmovg\t{$src2, $dst|$dst, $src2}",
- [(set GR16:$dst, (X86cmov GR16:$src1, (loadi16 addr:$src2),
- X86_COND_G, EFLAGS))]>,
- TB, OpSize;
-def CMOVG32rm : I<0x4F, MRMSrcMem, // if >s, GR32 = [mem32]
- (outs GR32:$dst), (ins GR32:$src1, i32mem:$src2),
- "cmovg\t{$src2, $dst|$dst, $src2}",
- [(set GR32:$dst, (X86cmov GR32:$src1, (loadi32 addr:$src2),
- X86_COND_G, EFLAGS))]>,
- TB;
-def CMOVS16rm : I<0x48, MRMSrcMem, // if signed, GR16 = [mem16]
- (outs GR16:$dst), (ins GR16:$src1, i16mem:$src2),
- "cmovs\t{$src2, $dst|$dst, $src2}",
- [(set GR16:$dst, (X86cmov GR16:$src1, (loadi16 addr:$src2),
- X86_COND_S, EFLAGS))]>,
- TB, OpSize;
-def CMOVS32rm : I<0x48, MRMSrcMem, // if signed, GR32 = [mem32]
- (outs GR32:$dst), (ins GR32:$src1, i32mem:$src2),
- "cmovs\t{$src2, $dst|$dst, $src2}",
- [(set GR32:$dst, (X86cmov GR32:$src1, (loadi32 addr:$src2),
- X86_COND_S, EFLAGS))]>,
- TB;
-def CMOVNS16rm: I<0x49, MRMSrcMem, // if !signed, GR16 = [mem16]
- (outs GR16:$dst), (ins GR16:$src1, i16mem:$src2),
- "cmovns\t{$src2, $dst|$dst, $src2}",
- [(set GR16:$dst, (X86cmov GR16:$src1, (loadi16 addr:$src2),
- X86_COND_NS, EFLAGS))]>,
- TB, OpSize;
-def CMOVNS32rm: I<0x49, MRMSrcMem, // if !signed, GR32 = [mem32]
- (outs GR32:$dst), (ins GR32:$src1, i32mem:$src2),
- "cmovns\t{$src2, $dst|$dst, $src2}",
- [(set GR32:$dst, (X86cmov GR32:$src1, (loadi32 addr:$src2),
- X86_COND_NS, EFLAGS))]>,
- TB;
-def CMOVP16rm : I<0x4A, MRMSrcMem, // if parity, GR16 = [mem16]
- (outs GR16:$dst), (ins GR16:$src1, i16mem:$src2),
- "cmovp\t{$src2, $dst|$dst, $src2}",
- [(set GR16:$dst, (X86cmov GR16:$src1, (loadi16 addr:$src2),
- X86_COND_P, EFLAGS))]>,
- TB, OpSize;
-def CMOVP32rm : I<0x4A, MRMSrcMem, // if parity, GR32 = [mem32]
- (outs GR32:$dst), (ins GR32:$src1, i32mem:$src2),
- "cmovp\t{$src2, $dst|$dst, $src2}",
- [(set GR32:$dst, (X86cmov GR32:$src1, (loadi32 addr:$src2),
- X86_COND_P, EFLAGS))]>,
- TB;
-def CMOVNP16rm : I<0x4B, MRMSrcMem, // if !parity, GR16 = [mem16]
- (outs GR16:$dst), (ins GR16:$src1, i16mem:$src2),
- "cmovnp\t{$src2, $dst|$dst, $src2}",
- [(set GR16:$dst, (X86cmov GR16:$src1, (loadi16 addr:$src2),
- X86_COND_NP, EFLAGS))]>,
- TB, OpSize;
-} // Uses = [EFLAGS]
-
-
-// unary instructions
-let CodeSize = 2 in {
-let Defs = [EFLAGS] in {
-def NEG8r : I<0xF6, MRM3r, (outs GR8 :$dst), (ins GR8 :$src), "neg{b}\t$dst",
- [(set GR8:$dst, (ineg GR8:$src))]>;
-def NEG16r : I<0xF7, MRM3r, (outs GR16:$dst), (ins GR16:$src), "neg{w}\t$dst",
- [(set GR16:$dst, (ineg GR16:$src))]>, OpSize;
-def NEG32r : I<0xF7, MRM3r, (outs GR32:$dst), (ins GR32:$src), "neg{l}\t$dst",
- [(set GR32:$dst, (ineg GR32:$src))]>;
-let isTwoAddress = 0 in {
- def NEG8m : I<0xF6, MRM3m, (outs), (ins i8mem :$dst), "neg{b}\t$dst",
- [(store (ineg (loadi8 addr:$dst)), addr:$dst)]>;
- def NEG16m : I<0xF7, MRM3m, (outs), (ins i16mem:$dst), "neg{w}\t$dst",
- [(store (ineg (loadi16 addr:$dst)), addr:$dst)]>, OpSize;
- def NEG32m : I<0xF7, MRM3m, (outs), (ins i32mem:$dst), "neg{l}\t$dst",
- [(store (ineg (loadi32 addr:$dst)), addr:$dst)]>;
-
-}
-} // Defs = [EFLAGS]
-
-def NOT8r : I<0xF6, MRM2r, (outs GR8 :$dst), (ins GR8 :$src), "not{b}\t$dst",
- [(set GR8:$dst, (not GR8:$src))]>;
-def NOT16r : I<0xF7, MRM2r, (outs GR16:$dst), (ins GR16:$src), "not{w}\t$dst",
- [(set GR16:$dst, (not GR16:$src))]>, OpSize;
-def NOT32r : I<0xF7, MRM2r, (outs GR32:$dst), (ins GR32:$src), "not{l}\t$dst",
- [(set GR32:$dst, (not GR32:$src))]>;
-let isTwoAddress = 0 in {
- def NOT8m : I<0xF6, MRM2m, (outs), (ins i8mem :$dst), "not{b}\t$dst",
- [(store (not (loadi8 addr:$dst)), addr:$dst)]>;
- def NOT16m : I<0xF7, MRM2m, (outs), (ins i16mem:$dst), "not{w}\t$dst",
- [(store (not (loadi16 addr:$dst)), addr:$dst)]>, OpSize;
- def NOT32m : I<0xF7, MRM2m, (outs), (ins i32mem:$dst), "not{l}\t$dst",
- [(store (not (loadi32 addr:$dst)), addr:$dst)]>;
-}
-} // CodeSize
-
-// TODO: inc/dec is slow for P4, but fast for Pentium-M.
-let Defs = [EFLAGS] in {
-let CodeSize = 2 in
-def INC8r : I<0xFE, MRM0r, (outs GR8 :$dst), (ins GR8 :$src), "inc{b}\t$dst",
- [(set GR8:$dst, (add GR8:$src, 1))]>;
-let isConvertibleToThreeAddress = 1, CodeSize = 1 in { // Can xform into LEA.
-def INC16r : I<0x40, AddRegFrm, (outs GR16:$dst), (ins GR16:$src), "inc{w}\t$dst",
- [(set GR16:$dst, (add GR16:$src, 1))]>,
- OpSize, Requires<[In32BitMode]>;
-def INC32r : I<0x40, AddRegFrm, (outs GR32:$dst), (ins GR32:$src), "inc{l}\t$dst",
- [(set GR32:$dst, (add GR32:$src, 1))]>, Requires<[In32BitMode]>;
-}
-let isTwoAddress = 0, CodeSize = 2 in {
- def INC8m : I<0xFE, MRM0m, (outs), (ins i8mem :$dst), "inc{b}\t$dst",
- [(store (add (loadi8 addr:$dst), 1), addr:$dst)]>;
- def INC16m : I<0xFF, MRM0m, (outs), (ins i16mem:$dst), "inc{w}\t$dst",
- [(store (add (loadi16 addr:$dst), 1), addr:$dst)]>,
- OpSize, Requires<[In32BitMode]>;
- def INC32m : I<0xFF, MRM0m, (outs), (ins i32mem:$dst), "inc{l}\t$dst",
- [(store (add (loadi32 addr:$dst), 1), addr:$dst)]>,
- Requires<[In32BitMode]>;
-}
-
-let CodeSize = 2 in
-def DEC8r : I<0xFE, MRM1r, (outs GR8 :$dst), (ins GR8 :$src), "dec{b}\t$dst",
- [(set GR8:$dst, (add GR8:$src, -1))]>;
-let isConvertibleToThreeAddress = 1, CodeSize = 1 in { // Can xform into LEA.
-def DEC16r : I<0x48, AddRegFrm, (outs GR16:$dst), (ins GR16:$src), "dec{w}\t$dst",
- [(set GR16:$dst, (add GR16:$src, -1))]>,
- OpSize, Requires<[In32BitMode]>;
-def DEC32r : I<0x48, AddRegFrm, (outs GR32:$dst), (ins GR32:$src), "dec{l}\t$dst",
- [(set GR32:$dst, (add GR32:$src, -1))]>, Requires<[In32BitMode]>;
-}
-
-let isTwoAddress = 0, CodeSize = 2 in {
- def DEC8m : I<0xFE, MRM1m, (outs), (ins i8mem :$dst), "dec{b}\t$dst",
- [(store (add (loadi8 addr:$dst), -1), addr:$dst)]>;
- def DEC16m : I<0xFF, MRM1m, (outs), (ins i16mem:$dst), "dec{w}\t$dst",
- [(store (add (loadi16 addr:$dst), -1), addr:$dst)]>,
- OpSize, Requires<[In32BitMode]>;
- def DEC32m : I<0xFF, MRM1m, (outs), (ins i32mem:$dst), "dec{l}\t$dst",
- [(store (add (loadi32 addr:$dst), -1), addr:$dst)]>,
- Requires<[In32BitMode]>;
-}
-} // Defs = [EFLAGS]
-
-// Logical operators...
-let Defs = [EFLAGS] in {
-let isCommutable = 1 in { // X = AND Y, Z --> X = AND Z, Y
-def AND8rr : I<0x20, MRMDestReg,
- (outs GR8 :$dst), (ins GR8 :$src1, GR8 :$src2),
- "and{b}\t{$src2, $dst|$dst, $src2}",
- [(set GR8:$dst, (and GR8:$src1, GR8:$src2))]>;
-def AND16rr : I<0x21, MRMDestReg,
- (outs GR16:$dst), (ins GR16:$src1, GR16:$src2),
- "and{w}\t{$src2, $dst|$dst, $src2}",
- [(set GR16:$dst, (and GR16:$src1, GR16:$src2))]>, OpSize;
-def AND32rr : I<0x21, MRMDestReg,
- (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
- "and{l}\t{$src2, $dst|$dst, $src2}",
- [(set GR32:$dst, (and GR32:$src1, GR32:$src2))]>;
-}
-
-def AND8rm : I<0x22, MRMSrcMem,
- (outs GR8 :$dst), (ins GR8 :$src1, i8mem :$src2),
- "and{b}\t{$src2, $dst|$dst, $src2}",
- [(set GR8:$dst, (and GR8:$src1, (load addr:$src2)))]>;
-def AND16rm : I<0x23, MRMSrcMem,
- (outs GR16:$dst), (ins GR16:$src1, i16mem:$src2),
- "and{w}\t{$src2, $dst|$dst, $src2}",
- [(set GR16:$dst, (and GR16:$src1, (load addr:$src2)))]>, OpSize;
-def AND32rm : I<0x23, MRMSrcMem,
- (outs GR32:$dst), (ins GR32:$src1, i32mem:$src2),
- "and{l}\t{$src2, $dst|$dst, $src2}",
- [(set GR32:$dst, (and GR32:$src1, (load addr:$src2)))]>;
-
-def AND8ri : Ii8<0x80, MRM4r,
- (outs GR8 :$dst), (ins GR8 :$src1, i8imm :$src2),
- "and{b}\t{$src2, $dst|$dst, $src2}",
- [(set GR8:$dst, (and GR8:$src1, imm:$src2))]>;
-def AND16ri : Ii16<0x81, MRM4r,
- (outs GR16:$dst), (ins GR16:$src1, i16imm:$src2),
- "and{w}\t{$src2, $dst|$dst, $src2}",
- [(set GR16:$dst, (and GR16:$src1, imm:$src2))]>, OpSize;
-def AND32ri : Ii32<0x81, MRM4r,
- (outs GR32:$dst), (ins GR32:$src1, i32imm:$src2),
- "and{l}\t{$src2, $dst|$dst, $src2}",
- [(set GR32:$dst, (and GR32:$src1, imm:$src2))]>;
-def AND16ri8 : Ii8<0x83, MRM4r,
- (outs GR16:$dst), (ins GR16:$src1, i16i8imm:$src2),
- "and{w}\t{$src2, $dst|$dst, $src2}",
- [(set GR16:$dst, (and GR16:$src1, i16immSExt8:$src2))]>,
- OpSize;
-def AND32ri8 : Ii8<0x83, MRM4r,
- (outs GR32:$dst), (ins GR32:$src1, i32i8imm:$src2),
- "and{l}\t{$src2, $dst|$dst, $src2}",
- [(set GR32:$dst, (and GR32:$src1, i32immSExt8:$src2))]>;
-
-let isTwoAddress = 0 in {
- def AND8mr : I<0x20, MRMDestMem,
- (outs), (ins i8mem :$dst, GR8 :$src),
- "and{b}\t{$src, $dst|$dst, $src}",
- [(store (and (load addr:$dst), GR8:$src), addr:$dst)]>;
- def AND16mr : I<0x21, MRMDestMem,
- (outs), (ins i16mem:$dst, GR16:$src),
- "and{w}\t{$src, $dst|$dst, $src}",
- [(store (and (load addr:$dst), GR16:$src), addr:$dst)]>,
- OpSize;
- def AND32mr : I<0x21, MRMDestMem,
- (outs), (ins i32mem:$dst, GR32:$src),
- "and{l}\t{$src, $dst|$dst, $src}",
- [(store (and (load addr:$dst), GR32:$src), addr:$dst)]>;
- def AND8mi : Ii8<0x80, MRM4m,
- (outs), (ins i8mem :$dst, i8imm :$src),
- "and{b}\t{$src, $dst|$dst, $src}",
- [(store (and (loadi8 addr:$dst), imm:$src), addr:$dst)]>;
- def AND16mi : Ii16<0x81, MRM4m,
- (outs), (ins i16mem:$dst, i16imm:$src),
- "and{w}\t{$src, $dst|$dst, $src}",
- [(store (and (loadi16 addr:$dst), imm:$src), addr:$dst)]>,
- OpSize;
- def AND32mi : Ii32<0x81, MRM4m,
- (outs), (ins i32mem:$dst, i32imm:$src),
- "and{l}\t{$src, $dst|$dst, $src}",
- [(store (and (loadi32 addr:$dst), imm:$src), addr:$dst)]>;
- def AND16mi8 : Ii8<0x83, MRM4m,
- (outs), (ins i16mem:$dst, i16i8imm :$src),
- "and{w}\t{$src, $dst|$dst, $src}",
- [(store (and (load addr:$dst), i16immSExt8:$src), addr:$dst)]>,
- OpSize;
- def AND32mi8 : Ii8<0x83, MRM4m,
- (outs), (ins i32mem:$dst, i32i8imm :$src),
- "and{l}\t{$src, $dst|$dst, $src}",
- [(store (and (load addr:$dst), i32immSExt8:$src), addr:$dst)]>;
-}
-
-
-let isCommutable = 1 in { // X = OR Y, Z --> X = OR Z, Y
-def OR8rr : I<0x08, MRMDestReg, (outs GR8 :$dst), (ins GR8 :$src1, GR8 :$src2),
- "or{b}\t{$src2, $dst|$dst, $src2}",
- [(set GR8:$dst, (or GR8:$src1, GR8:$src2))]>;
-def OR16rr : I<0x09, MRMDestReg, (outs GR16:$dst), (ins GR16:$src1, GR16:$src2),
- "or{w}\t{$src2, $dst|$dst, $src2}",
- [(set GR16:$dst, (or GR16:$src1, GR16:$src2))]>, OpSize;
-def OR32rr : I<0x09, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
- "or{l}\t{$src2, $dst|$dst, $src2}",
- [(set GR32:$dst, (or GR32:$src1, GR32:$src2))]>;
-}
-def OR8rm : I<0x0A, MRMSrcMem , (outs GR8 :$dst), (ins GR8 :$src1, i8mem :$src2),
- "or{b}\t{$src2, $dst|$dst, $src2}",
- [(set GR8:$dst, (or GR8:$src1, (load addr:$src2)))]>;
-def OR16rm : I<0x0B, MRMSrcMem , (outs GR16:$dst), (ins GR16:$src1, i16mem:$src2),
- "or{w}\t{$src2, $dst|$dst, $src2}",
- [(set GR16:$dst, (or GR16:$src1, (load addr:$src2)))]>, OpSize;
-def OR32rm : I<0x0B, MRMSrcMem , (outs GR32:$dst), (ins GR32:$src1, i32mem:$src2),
- "or{l}\t{$src2, $dst|$dst, $src2}",
- [(set GR32:$dst, (or GR32:$src1, (load addr:$src2)))]>;
-
-def OR8ri : Ii8 <0x80, MRM1r, (outs GR8 :$dst), (ins GR8 :$src1, i8imm:$src2),
- "or{b}\t{$src2, $dst|$dst, $src2}",
- [(set GR8:$dst, (or GR8:$src1, imm:$src2))]>;
-def OR16ri : Ii16<0x81, MRM1r, (outs GR16:$dst), (ins GR16:$src1, i16imm:$src2),
- "or{w}\t{$src2, $dst|$dst, $src2}",
- [(set GR16:$dst, (or GR16:$src1, imm:$src2))]>, OpSize;
-def OR32ri : Ii32<0x81, MRM1r, (outs GR32:$dst), (ins GR32:$src1, i32imm:$src2),
- "or{l}\t{$src2, $dst|$dst, $src2}",
- [(set GR32:$dst, (or GR32:$src1, imm:$src2))]>;
-
-def OR16ri8 : Ii8<0x83, MRM1r, (outs GR16:$dst), (ins GR16:$src1, i16i8imm:$src2),
- "or{w}\t{$src2, $dst|$dst, $src2}",
- [(set GR16:$dst, (or GR16:$src1, i16immSExt8:$src2))]>, OpSize;
-def OR32ri8 : Ii8<0x83, MRM1r, (outs GR32:$dst), (ins GR32:$src1, i32i8imm:$src2),
- "or{l}\t{$src2, $dst|$dst, $src2}",
- [(set GR32:$dst, (or GR32:$src1, i32immSExt8:$src2))]>;
-let isTwoAddress = 0 in {
- def OR8mr : I<0x08, MRMDestMem, (outs), (ins i8mem:$dst, GR8:$src),
- "or{b}\t{$src, $dst|$dst, $src}",
- [(store (or (load addr:$dst), GR8:$src), addr:$dst)]>;
- def OR16mr : I<0x09, MRMDestMem, (outs), (ins i16mem:$dst, GR16:$src),
- "or{w}\t{$src, $dst|$dst, $src}",
- [(store (or (load addr:$dst), GR16:$src), addr:$dst)]>, OpSize;
- def OR32mr : I<0x09, MRMDestMem, (outs), (ins i32mem:$dst, GR32:$src),
- "or{l}\t{$src, $dst|$dst, $src}",
- [(store (or (load addr:$dst), GR32:$src), addr:$dst)]>;
- def OR8mi : Ii8<0x80, MRM1m, (outs), (ins i8mem :$dst, i8imm:$src),
- "or{b}\t{$src, $dst|$dst, $src}",
- [(store (or (loadi8 addr:$dst), imm:$src), addr:$dst)]>;
- def OR16mi : Ii16<0x81, MRM1m, (outs), (ins i16mem:$dst, i16imm:$src),
- "or{w}\t{$src, $dst|$dst, $src}",
- [(store (or (loadi16 addr:$dst), imm:$src), addr:$dst)]>,
- OpSize;
- def OR32mi : Ii32<0x81, MRM1m, (outs), (ins i32mem:$dst, i32imm:$src),
- "or{l}\t{$src, $dst|$dst, $src}",
- [(store (or (loadi32 addr:$dst), imm:$src), addr:$dst)]>;
- def OR16mi8 : Ii8<0x83, MRM1m, (outs), (ins i16mem:$dst, i16i8imm:$src),
- "or{w}\t{$src, $dst|$dst, $src}",
- [(store (or (load addr:$dst), i16immSExt8:$src), addr:$dst)]>,
- OpSize;
- def OR32mi8 : Ii8<0x83, MRM1m, (outs), (ins i32mem:$dst, i32i8imm:$src),
- "or{l}\t{$src, $dst|$dst, $src}",
- [(store (or (load addr:$dst), i32immSExt8:$src), addr:$dst)]>;
-}
-
-
-let isCommutable = 1 in { // X = XOR Y, Z --> X = XOR Z, Y
-def XOR8rr : I<0x30, MRMDestReg,
- (outs GR8 :$dst), (ins GR8 :$src1, GR8 :$src2),
- "xor{b}\t{$src2, $dst|$dst, $src2}",
- [(set GR8:$dst, (xor GR8:$src1, GR8:$src2))]>;
-def XOR16rr : I<0x31, MRMDestReg,
- (outs GR16:$dst), (ins GR16:$src1, GR16:$src2),
- "xor{w}\t{$src2, $dst|$dst, $src2}",
- [(set GR16:$dst, (xor GR16:$src1, GR16:$src2))]>, OpSize;
-def XOR32rr : I<0x31, MRMDestReg,
- (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
- "xor{l}\t{$src2, $dst|$dst, $src2}",
- [(set GR32:$dst, (xor GR32:$src1, GR32:$src2))]>;
-}
-
-def XOR8rm : I<0x32, MRMSrcMem ,
- (outs GR8 :$dst), (ins GR8:$src1, i8mem :$src2),
- "xor{b}\t{$src2, $dst|$dst, $src2}",
- [(set GR8:$dst, (xor GR8:$src1, (load addr:$src2)))]>;
-def XOR16rm : I<0x33, MRMSrcMem ,
- (outs GR16:$dst), (ins GR16:$src1, i16mem:$src2),
- "xor{w}\t{$src2, $dst|$dst, $src2}",
- [(set GR16:$dst, (xor GR16:$src1, (load addr:$src2)))]>, OpSize;
-def XOR32rm : I<0x33, MRMSrcMem ,
- (outs GR32:$dst), (ins GR32:$src1, i32mem:$src2),
- "xor{l}\t{$src2, $dst|$dst, $src2}",
- [(set GR32:$dst, (xor GR32:$src1, (load addr:$src2)))]>;
-
-def XOR8ri : Ii8<0x80, MRM6r,
- (outs GR8:$dst), (ins GR8:$src1, i8imm:$src2),
- "xor{b}\t{$src2, $dst|$dst, $src2}",
- [(set GR8:$dst, (xor GR8:$src1, imm:$src2))]>;
-def XOR16ri : Ii16<0x81, MRM6r,
- (outs GR16:$dst), (ins GR16:$src1, i16imm:$src2),
- "xor{w}\t{$src2, $dst|$dst, $src2}",
- [(set GR16:$dst, (xor GR16:$src1, imm:$src2))]>, OpSize;
-def XOR32ri : Ii32<0x81, MRM6r,
- (outs GR32:$dst), (ins GR32:$src1, i32imm:$src2),
- "xor{l}\t{$src2, $dst|$dst, $src2}",
- [(set GR32:$dst, (xor GR32:$src1, imm:$src2))]>;
-def XOR16ri8 : Ii8<0x83, MRM6r,
- (outs GR16:$dst), (ins GR16:$src1, i16i8imm:$src2),
- "xor{w}\t{$src2, $dst|$dst, $src2}",
- [(set GR16:$dst, (xor GR16:$src1, i16immSExt8:$src2))]>,
- OpSize;
-def XOR32ri8 : Ii8<0x83, MRM6r,
- (outs GR32:$dst), (ins GR32:$src1, i32i8imm:$src2),
- "xor{l}\t{$src2, $dst|$dst, $src2}",
- [(set GR32:$dst, (xor GR32:$src1, i32immSExt8:$src2))]>;
-let isTwoAddress = 0 in {
- def XOR8mr : I<0x30, MRMDestMem,
- (outs), (ins i8mem :$dst, GR8 :$src),
- "xor{b}\t{$src, $dst|$dst, $src}",
- [(store (xor (load addr:$dst), GR8:$src), addr:$dst)]>;
- def XOR16mr : I<0x31, MRMDestMem,
- (outs), (ins i16mem:$dst, GR16:$src),
- "xor{w}\t{$src, $dst|$dst, $src}",
- [(store (xor (load addr:$dst), GR16:$src), addr:$dst)]>,
- OpSize;
- def XOR32mr : I<0x31, MRMDestMem,
- (outs), (ins i32mem:$dst, GR32:$src),
- "xor{l}\t{$src, $dst|$dst, $src}",
- [(store (xor (load addr:$dst), GR32:$src), addr:$dst)]>;
- def XOR8mi : Ii8<0x80, MRM6m,
- (outs), (ins i8mem :$dst, i8imm :$src),
- "xor{b}\t{$src, $dst|$dst, $src}",
- [(store (xor (loadi8 addr:$dst), imm:$src), addr:$dst)]>;
- def XOR16mi : Ii16<0x81, MRM6m,
- (outs), (ins i16mem:$dst, i16imm:$src),
- "xor{w}\t{$src, $dst|$dst, $src}",
- [(store (xor (loadi16 addr:$dst), imm:$src), addr:$dst)]>,
- OpSize;
- def XOR32mi : Ii32<0x81, MRM6m,
- (outs), (ins i32mem:$dst, i32imm:$src),
- "xor{l}\t{$src, $dst|$dst, $src}",
- [(store (xor (loadi32 addr:$dst), imm:$src), addr:$dst)]>;
- def XOR16mi8 : Ii8<0x83, MRM6m,
- (outs), (ins i16mem:$dst, i16i8imm :$src),
- "xor{w}\t{$src, $dst|$dst, $src}",
- [(store (xor (load addr:$dst), i16immSExt8:$src), addr:$dst)]>,
- OpSize;
- def XOR32mi8 : Ii8<0x83, MRM6m,
- (outs), (ins i32mem:$dst, i32i8imm :$src),
- "xor{l}\t{$src, $dst|$dst, $src}",
- [(store (xor (load addr:$dst), i32immSExt8:$src), addr:$dst)]>;
-}
-} // Defs = [EFLAGS]
-
-// Shift instructions
-let Defs = [EFLAGS] in {
-let Uses = [CL] in {
-def SHL8rCL : I<0xD2, MRM4r, (outs GR8 :$dst), (ins GR8 :$src),
- "shl{b}\t{%cl, $dst|$dst, %CL}",
- [(set GR8:$dst, (shl GR8:$src, CL))]>;
-def SHL16rCL : I<0xD3, MRM4r, (outs GR16:$dst), (ins GR16:$src),
- "shl{w}\t{%cl, $dst|$dst, %CL}",
- [(set GR16:$dst, (shl GR16:$src, CL))]>, OpSize;
-def SHL32rCL : I<0xD3, MRM4r, (outs GR32:$dst), (ins GR32:$src),
- "shl{l}\t{%cl, $dst|$dst, %CL}",
- [(set GR32:$dst, (shl GR32:$src, CL))]>;
-}
-
-def SHL8ri : Ii8<0xC0, MRM4r, (outs GR8 :$dst), (ins GR8 :$src1, i8imm:$src2),
- "shl{b}\t{$src2, $dst|$dst, $src2}",
- [(set GR8:$dst, (shl GR8:$src1, (i8 imm:$src2)))]>;
-let isConvertibleToThreeAddress = 1 in { // Can transform into LEA.
-def SHL16ri : Ii8<0xC1, MRM4r, (outs GR16:$dst), (ins GR16:$src1, i8imm:$src2),
- "shl{w}\t{$src2, $dst|$dst, $src2}",
- [(set GR16:$dst, (shl GR16:$src1, (i8 imm:$src2)))]>, OpSize;
-def SHL32ri : Ii8<0xC1, MRM4r, (outs GR32:$dst), (ins GR32:$src1, i8imm:$src2),
- "shl{l}\t{$src2, $dst|$dst, $src2}",
- [(set GR32:$dst, (shl GR32:$src1, (i8 imm:$src2)))]>;
-// NOTE: We don't use shifts of a register by one, because 'add reg,reg' is
-// cheaper.
-}
-
-let isTwoAddress = 0 in {
- let Uses = [CL] in {
- def SHL8mCL : I<0xD2, MRM4m, (outs), (ins i8mem :$dst),
- "shl{b}\t{%cl, $dst|$dst, %CL}",
- [(store (shl (loadi8 addr:$dst), CL), addr:$dst)]>;
- def SHL16mCL : I<0xD3, MRM4m, (outs), (ins i16mem:$dst),
- "shl{w}\t{%cl, $dst|$dst, %CL}",
- [(store (shl (loadi16 addr:$dst), CL), addr:$dst)]>, OpSize;
- def SHL32mCL : I<0xD3, MRM4m, (outs), (ins i32mem:$dst),
- "shl{l}\t{%cl, $dst|$dst, %CL}",
- [(store (shl (loadi32 addr:$dst), CL), addr:$dst)]>;
- }
- def SHL8mi : Ii8<0xC0, MRM4m, (outs), (ins i8mem :$dst, i8imm:$src),
- "shl{b}\t{$src, $dst|$dst, $src}",
- [(store (shl (loadi8 addr:$dst), (i8 imm:$src)), addr:$dst)]>;
- def SHL16mi : Ii8<0xC1, MRM4m, (outs), (ins i16mem:$dst, i8imm:$src),
- "shl{w}\t{$src, $dst|$dst, $src}",
- [(store (shl (loadi16 addr:$dst), (i8 imm:$src)), addr:$dst)]>,
- OpSize;
- def SHL32mi : Ii8<0xC1, MRM4m, (outs), (ins i32mem:$dst, i8imm:$src),
- "shl{l}\t{$src, $dst|$dst, $src}",
- [(store (shl (loadi32 addr:$dst), (i8 imm:$src)), addr:$dst)]>;
-
- // Shift by 1
- def SHL8m1 : I<0xD0, MRM4m, (outs), (ins i8mem :$dst),
- "shl{b}\t$dst",
- [(store (shl (loadi8 addr:$dst), (i8 1)), addr:$dst)]>;
- def SHL16m1 : I<0xD1, MRM4m, (outs), (ins i16mem:$dst),
- "shl{w}\t$dst",
- [(store (shl (loadi16 addr:$dst), (i8 1)), addr:$dst)]>,
- OpSize;
- def SHL32m1 : I<0xD1, MRM4m, (outs), (ins i32mem:$dst),
- "shl{l}\t$dst",
- [(store (shl (loadi32 addr:$dst), (i8 1)), addr:$dst)]>;
-}
-
-let Uses = [CL] in {
-def SHR8rCL : I<0xD2, MRM5r, (outs GR8 :$dst), (ins GR8 :$src),
- "shr{b}\t{%cl, $dst|$dst, %CL}",
- [(set GR8:$dst, (srl GR8:$src, CL))]>;
-def SHR16rCL : I<0xD3, MRM5r, (outs GR16:$dst), (ins GR16:$src),
- "shr{w}\t{%cl, $dst|$dst, %CL}",
- [(set GR16:$dst, (srl GR16:$src, CL))]>, OpSize;
-def SHR32rCL : I<0xD3, MRM5r, (outs GR32:$dst), (ins GR32:$src),
- "shr{l}\t{%cl, $dst|$dst, %CL}",
- [(set GR32:$dst, (srl GR32:$src, CL))]>;
-}
-
-def SHR8ri : Ii8<0xC0, MRM5r, (outs GR8:$dst), (ins GR8:$src1, i8imm:$src2),
- "shr{b}\t{$src2, $dst|$dst, $src2}",
- [(set GR8:$dst, (srl GR8:$src1, (i8 imm:$src2)))]>;
-def SHR16ri : Ii8<0xC1, MRM5r, (outs GR16:$dst), (ins GR16:$src1, i8imm:$src2),
- "shr{w}\t{$src2, $dst|$dst, $src2}",
- [(set GR16:$dst, (srl GR16:$src1, (i8 imm:$src2)))]>, OpSize;
-def SHR32ri : Ii8<0xC1, MRM5r, (outs GR32:$dst), (ins GR32:$src1, i8imm:$src2),
- "shr{l}\t{$src2, $dst|$dst, $src2}",
- [(set GR32:$dst, (srl GR32:$src1, (i8 imm:$src2)))]>;
-
-// Shift by 1
-def SHR8r1 : I<0xD0, MRM5r, (outs GR8:$dst), (ins GR8:$src1),
- "shr{b}\t$dst",
- [(set GR8:$dst, (srl GR8:$src1, (i8 1)))]>;
-def SHR16r1 : I<0xD1, MRM5r, (outs GR16:$dst), (ins GR16:$src1),
- "shr{w}\t$dst",
- [(set GR16:$dst, (srl GR16:$src1, (i8 1)))]>, OpSize;
-def SHR32r1 : I<0xD1, MRM5r, (outs GR32:$dst), (ins GR32:$src1),
- "shr{l}\t$dst",
- [(set GR32:$dst, (srl GR32:$src1, (i8 1)))]>;
-
-let isTwoAddress = 0 in {
- let Uses = [CL] in {
- def SHR8mCL : I<0xD2, MRM5m, (outs), (ins i8mem :$dst),
- "shr{b}\t{%cl, $dst|$dst, %CL}",
- [(store (srl (loadi8 addr:$dst), CL), addr:$dst)]>;
- def SHR16mCL : I<0xD3, MRM5m, (outs), (ins i16mem:$dst),
- "shr{w}\t{%cl, $dst|$dst, %CL}",
- [(store (srl (loadi16 addr:$dst), CL), addr:$dst)]>,
- OpSize;
- def SHR32mCL : I<0xD3, MRM5m, (outs), (ins i32mem:$dst),
- "shr{l}\t{%cl, $dst|$dst, %CL}",
- [(store (srl (loadi32 addr:$dst), CL), addr:$dst)]>;
- }
- def SHR8mi : Ii8<0xC0, MRM5m, (outs), (ins i8mem :$dst, i8imm:$src),
- "shr{b}\t{$src, $dst|$dst, $src}",
- [(store (srl (loadi8 addr:$dst), (i8 imm:$src)), addr:$dst)]>;
- def SHR16mi : Ii8<0xC1, MRM5m, (outs), (ins i16mem:$dst, i8imm:$src),
- "shr{w}\t{$src, $dst|$dst, $src}",
- [(store (srl (loadi16 addr:$dst), (i8 imm:$src)), addr:$dst)]>,
- OpSize;
- def SHR32mi : Ii8<0xC1, MRM5m, (outs), (ins i32mem:$dst, i8imm:$src),
- "shr{l}\t{$src, $dst|$dst, $src}",
- [(store (srl (loadi32 addr:$dst), (i8 imm:$src)), addr:$dst)]>;
-
- // Shift by 1
- def SHR8m1 : I<0xD0, MRM5m, (outs), (ins i8mem :$dst),
- "shr{b}\t$dst",
- [(store (srl (loadi8 addr:$dst), (i8 1)), addr:$dst)]>;
- def SHR16m1 : I<0xD1, MRM5m, (outs), (ins i16mem:$dst),
- "shr{w}\t$dst",
- [(store (srl (loadi16 addr:$dst), (i8 1)), addr:$dst)]>,OpSize;
- def SHR32m1 : I<0xD1, MRM5m, (outs), (ins i32mem:$dst),
- "shr{l}\t$dst",
- [(store (srl (loadi32 addr:$dst), (i8 1)), addr:$dst)]>;
-}
-
-let Uses = [CL] in {
-def SAR8rCL : I<0xD2, MRM7r, (outs GR8 :$dst), (ins GR8 :$src),
- "sar{b}\t{%cl, $dst|$dst, %CL}",
- [(set GR8:$dst, (sra GR8:$src, CL))]>;
-def SAR16rCL : I<0xD3, MRM7r, (outs GR16:$dst), (ins GR16:$src),
- "sar{w}\t{%cl, $dst|$dst, %CL}",
- [(set GR16:$dst, (sra GR16:$src, CL))]>, OpSize;
-def SAR32rCL : I<0xD3, MRM7r, (outs GR32:$dst), (ins GR32:$src),
- "sar{l}\t{%cl, $dst|$dst, %CL}",
- [(set GR32:$dst, (sra GR32:$src, CL))]>;
-}
-
-def SAR8ri : Ii8<0xC0, MRM7r, (outs GR8 :$dst), (ins GR8 :$src1, i8imm:$src2),
- "sar{b}\t{$src2, $dst|$dst, $src2}",
- [(set GR8:$dst, (sra GR8:$src1, (i8 imm:$src2)))]>;
-def SAR16ri : Ii8<0xC1, MRM7r, (outs GR16:$dst), (ins GR16:$src1, i8imm:$src2),
- "sar{w}\t{$src2, $dst|$dst, $src2}",
- [(set GR16:$dst, (sra GR16:$src1, (i8 imm:$src2)))]>,
- OpSize;
-def SAR32ri : Ii8<0xC1, MRM7r, (outs GR32:$dst), (ins GR32:$src1, i8imm:$src2),
- "sar{l}\t{$src2, $dst|$dst, $src2}",
- [(set GR32:$dst, (sra GR32:$src1, (i8 imm:$src2)))]>;
-
-// Shift by 1
-def SAR8r1 : I<0xD0, MRM7r, (outs GR8 :$dst), (ins GR8 :$src1),
- "sar{b}\t$dst",
- [(set GR8:$dst, (sra GR8:$src1, (i8 1)))]>;
-def SAR16r1 : I<0xD1, MRM7r, (outs GR16:$dst), (ins GR16:$src1),
- "sar{w}\t$dst",
- [(set GR16:$dst, (sra GR16:$src1, (i8 1)))]>, OpSize;
-def SAR32r1 : I<0xD1, MRM7r, (outs GR32:$dst), (ins GR32:$src1),
- "sar{l}\t$dst",
- [(set GR32:$dst, (sra GR32:$src1, (i8 1)))]>;
-
-let isTwoAddress = 0 in {
- let Uses = [CL] in {
- def SAR8mCL : I<0xD2, MRM7m, (outs), (ins i8mem :$dst),
- "sar{b}\t{%cl, $dst|$dst, %CL}",
- [(store (sra (loadi8 addr:$dst), CL), addr:$dst)]>;
- def SAR16mCL : I<0xD3, MRM7m, (outs), (ins i16mem:$dst),
- "sar{w}\t{%cl, $dst|$dst, %CL}",
- [(store (sra (loadi16 addr:$dst), CL), addr:$dst)]>, OpSize;
- def SAR32mCL : I<0xD3, MRM7m, (outs), (ins i32mem:$dst),
- "sar{l}\t{%cl, $dst|$dst, %CL}",
- [(store (sra (loadi32 addr:$dst), CL), addr:$dst)]>;
- }
- def SAR8mi : Ii8<0xC0, MRM7m, (outs), (ins i8mem :$dst, i8imm:$src),
- "sar{b}\t{$src, $dst|$dst, $src}",
- [(store (sra (loadi8 addr:$dst), (i8 imm:$src)), addr:$dst)]>;
- def SAR16mi : Ii8<0xC1, MRM7m, (outs), (ins i16mem:$dst, i8imm:$src),
- "sar{w}\t{$src, $dst|$dst, $src}",
- [(store (sra (loadi16 addr:$dst), (i8 imm:$src)), addr:$dst)]>,
- OpSize;
- def SAR32mi : Ii8<0xC1, MRM7m, (outs), (ins i32mem:$dst, i8imm:$src),
- "sar{l}\t{$src, $dst|$dst, $src}",
- [(store (sra (loadi32 addr:$dst), (i8 imm:$src)), addr:$dst)]>;
-
- // Shift by 1
- def SAR8m1 : I<0xD0, MRM7m, (outs), (ins i8mem :$dst),
- "sar{b}\t$dst",
- [(store (sra (loadi8 addr:$dst), (i8 1)), addr:$dst)]>;
- def SAR16m1 : I<0xD1, MRM7m, (outs), (ins i16mem:$dst),
- "sar{w}\t$dst",
- [(store (sra (loadi16 addr:$dst), (i8 1)), addr:$dst)]>,
- OpSize;
- def SAR32m1 : I<0xD1, MRM7m, (outs), (ins i32mem:$dst),
- "sar{l}\t$dst",
- [(store (sra (loadi32 addr:$dst), (i8 1)), addr:$dst)]>;
-}
-
-// Rotate instructions
-// FIXME: provide shorter instructions when imm8 == 1
-let Uses = [CL] in {
-def ROL8rCL : I<0xD2, MRM0r, (outs GR8 :$dst), (ins GR8 :$src),
- "rol{b}\t{%cl, $dst|$dst, %CL}",
- [(set GR8:$dst, (rotl GR8:$src, CL))]>;
-def ROL16rCL : I<0xD3, MRM0r, (outs GR16:$dst), (ins GR16:$src),
- "rol{w}\t{%cl, $dst|$dst, %CL}",
- [(set GR16:$dst, (rotl GR16:$src, CL))]>, OpSize;
-def ROL32rCL : I<0xD3, MRM0r, (outs GR32:$dst), (ins GR32:$src),
- "rol{l}\t{%cl, $dst|$dst, %CL}",
- [(set GR32:$dst, (rotl GR32:$src, CL))]>;
-}
-
-def ROL8ri : Ii8<0xC0, MRM0r, (outs GR8 :$dst), (ins GR8 :$src1, i8imm:$src2),
- "rol{b}\t{$src2, $dst|$dst, $src2}",
- [(set GR8:$dst, (rotl GR8:$src1, (i8 imm:$src2)))]>;
-def ROL16ri : Ii8<0xC1, MRM0r, (outs GR16:$dst), (ins GR16:$src1, i8imm:$src2),
- "rol{w}\t{$src2, $dst|$dst, $src2}",
- [(set GR16:$dst, (rotl GR16:$src1, (i8 imm:$src2)))]>, OpSize;
-def ROL32ri : Ii8<0xC1, MRM0r, (outs GR32:$dst), (ins GR32:$src1, i8imm:$src2),
- "rol{l}\t{$src2, $dst|$dst, $src2}",
- [(set GR32:$dst, (rotl GR32:$src1, (i8 imm:$src2)))]>;
-
-// Rotate by 1
-def ROL8r1 : I<0xD0, MRM0r, (outs GR8 :$dst), (ins GR8 :$src1),
- "rol{b}\t$dst",
- [(set GR8:$dst, (rotl GR8:$src1, (i8 1)))]>;
-def ROL16r1 : I<0xD1, MRM0r, (outs GR16:$dst), (ins GR16:$src1),
- "rol{w}\t$dst",
- [(set GR16:$dst, (rotl GR16:$src1, (i8 1)))]>, OpSize;
-def ROL32r1 : I<0xD1, MRM0r, (outs GR32:$dst), (ins GR32:$src1),
- "rol{l}\t$dst",
- [(set GR32:$dst, (rotl GR32:$src1, (i8 1)))]>;
-
-let isTwoAddress = 0 in {
- let Uses = [CL] in {
- def ROL8mCL : I<0xD2, MRM0m, (outs), (ins i8mem :$dst),
- "rol{b}\t{%cl, $dst|$dst, %CL}",
- [(store (rotl (loadi8 addr:$dst), CL), addr:$dst)]>;
- def ROL16mCL : I<0xD3, MRM0m, (outs), (ins i16mem:$dst),
- "rol{w}\t{%cl, $dst|$dst, %CL}",
- [(store (rotl (loadi16 addr:$dst), CL), addr:$dst)]>, OpSize;
- def ROL32mCL : I<0xD3, MRM0m, (outs), (ins i32mem:$dst),
- "rol{l}\t{%cl, $dst|$dst, %CL}",
- [(store (rotl (loadi32 addr:$dst), CL), addr:$dst)]>;
- }
- def ROL8mi : Ii8<0xC0, MRM0m, (outs), (ins i8mem :$dst, i8imm:$src),
- "rol{b}\t{$src, $dst|$dst, $src}",
- [(store (rotl (loadi8 addr:$dst), (i8 imm:$src)), addr:$dst)]>;
- def ROL16mi : Ii8<0xC1, MRM0m, (outs), (ins i16mem:$dst, i8imm:$src),
- "rol{w}\t{$src, $dst|$dst, $src}",
- [(store (rotl (loadi16 addr:$dst), (i8 imm:$src)), addr:$dst)]>,
- OpSize;
- def ROL32mi : Ii8<0xC1, MRM0m, (outs), (ins i32mem:$dst, i8imm:$src),
- "rol{l}\t{$src, $dst|$dst, $src}",
- [(store (rotl (loadi32 addr:$dst), (i8 imm:$src)), addr:$dst)]>;
-
- // Rotate by 1
- def ROL8m1 : I<0xD0, MRM0m, (outs), (ins i8mem :$dst),
- "rol{b}\t$dst",
- [(store (rotl (loadi8 addr:$dst), (i8 1)), addr:$dst)]>;
- def ROL16m1 : I<0xD1, MRM0m, (outs), (ins i16mem:$dst),
- "rol{w}\t$dst",
- [(store (rotl (loadi16 addr:$dst), (i8 1)), addr:$dst)]>,
- OpSize;
- def ROL32m1 : I<0xD1, MRM0m, (outs), (ins i32mem:$dst),
- "rol{l}\t$dst",
- [(store (rotl (loadi32 addr:$dst), (i8 1)), addr:$dst)]>;
-}
-
-let Uses = [CL] in {
-def ROR8rCL : I<0xD2, MRM1r, (outs GR8 :$dst), (ins GR8 :$src),
- "ror{b}\t{%cl, $dst|$dst, %CL}",
- [(set GR8:$dst, (rotr GR8:$src, CL))]>;
-def ROR16rCL : I<0xD3, MRM1r, (outs GR16:$dst), (ins GR16:$src),
- "ror{w}\t{%cl, $dst|$dst, %CL}",
- [(set GR16:$dst, (rotr GR16:$src, CL))]>, OpSize;
-def ROR32rCL : I<0xD3, MRM1r, (outs GR32:$dst), (ins GR32:$src),
- "ror{l}\t{%cl, $dst|$dst, %CL}",
- [(set GR32:$dst, (rotr GR32:$src, CL))]>;
-}
-
-def ROR8ri : Ii8<0xC0, MRM1r, (outs GR8 :$dst), (ins GR8 :$src1, i8imm:$src2),
- "ror{b}\t{$src2, $dst|$dst, $src2}",
- [(set GR8:$dst, (rotr GR8:$src1, (i8 imm:$src2)))]>;
-def ROR16ri : Ii8<0xC1, MRM1r, (outs GR16:$dst), (ins GR16:$src1, i8imm:$src2),
- "ror{w}\t{$src2, $dst|$dst, $src2}",
- [(set GR16:$dst, (rotr GR16:$src1, (i8 imm:$src2)))]>, OpSize;
-def ROR32ri : Ii8<0xC1, MRM1r, (outs GR32:$dst), (ins GR32:$src1, i8imm:$src2),
- "ror{l}\t{$src2, $dst|$dst, $src2}",
- [(set GR32:$dst, (rotr GR32:$src1, (i8 imm:$src2)))]>;
-
-// Rotate by 1
-def ROR8r1 : I<0xD0, MRM1r, (outs GR8 :$dst), (ins GR8 :$src1),
- "ror{b}\t$dst",
- [(set GR8:$dst, (rotr GR8:$src1, (i8 1)))]>;
-def ROR16r1 : I<0xD1, MRM1r, (outs GR16:$dst), (ins GR16:$src1),
- "ror{w}\t$dst",
- [(set GR16:$dst, (rotr GR16:$src1, (i8 1)))]>, OpSize;
-def ROR32r1 : I<0xD1, MRM1r, (outs GR32:$dst), (ins GR32:$src1),
- "ror{l}\t$dst",
- [(set GR32:$dst, (rotr GR32:$src1, (i8 1)))]>;
-
-let isTwoAddress = 0 in {
- let Uses = [CL] in {
- def ROR8mCL : I<0xD2, MRM1m, (outs), (ins i8mem :$dst),
- "ror{b}\t{%cl, $dst|$dst, %CL}",
- [(store (rotr (loadi8 addr:$dst), CL), addr:$dst)]>;
- def ROR16mCL : I<0xD3, MRM1m, (outs), (ins i16mem:$dst),
- "ror{w}\t{%cl, $dst|$dst, %CL}",
- [(store (rotr (loadi16 addr:$dst), CL), addr:$dst)]>, OpSize;
- def ROR32mCL : I<0xD3, MRM1m, (outs), (ins i32mem:$dst),
- "ror{l}\t{%cl, $dst|$dst, %CL}",
- [(store (rotr (loadi32 addr:$dst), CL), addr:$dst)]>;
- }
- def ROR8mi : Ii8<0xC0, MRM1m, (outs), (ins i8mem :$dst, i8imm:$src),
- "ror{b}\t{$src, $dst|$dst, $src}",
- [(store (rotr (loadi8 addr:$dst), (i8 imm:$src)), addr:$dst)]>;
- def ROR16mi : Ii8<0xC1, MRM1m, (outs), (ins i16mem:$dst, i8imm:$src),
- "ror{w}\t{$src, $dst|$dst, $src}",
- [(store (rotr (loadi16 addr:$dst), (i8 imm:$src)), addr:$dst)]>,
- OpSize;
- def ROR32mi : Ii8<0xC1, MRM1m, (outs), (ins i32mem:$dst, i8imm:$src),
- "ror{l}\t{$src, $dst|$dst, $src}",
- [(store (rotr (loadi32 addr:$dst), (i8 imm:$src)), addr:$dst)]>;
-
- // Rotate by 1
- def ROR8m1 : I<0xD0, MRM1m, (outs), (ins i8mem :$dst),
- "ror{b}\t$dst",
- [(store (rotr (loadi8 addr:$dst), (i8 1)), addr:$dst)]>;
- def ROR16m1 : I<0xD1, MRM1m, (outs), (ins i16mem:$dst),
- "ror{w}\t$dst",
- [(store (rotr (loadi16 addr:$dst), (i8 1)), addr:$dst)]>,
- OpSize;
- def ROR32m1 : I<0xD1, MRM1m, (outs), (ins i32mem:$dst),
- "ror{l}\t$dst",
- [(store (rotr (loadi32 addr:$dst), (i8 1)), addr:$dst)]>;
-}
-
-
-
-// Double shift instructions (generalizations of rotate)
-let Uses = [CL] in {
-def SHLD32rrCL : I<0xA5, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
- "shld{l}\t{%cl, $src2, $dst|$dst, $src2, %CL}",
- [(set GR32:$dst, (X86shld GR32:$src1, GR32:$src2, CL))]>, TB;
-def SHRD32rrCL : I<0xAD, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
- "shrd{l}\t{%cl, $src2, $dst|$dst, $src2, %CL}",
- [(set GR32:$dst, (X86shrd GR32:$src1, GR32:$src2, CL))]>, TB;
-def SHLD16rrCL : I<0xA5, MRMDestReg, (outs GR16:$dst), (ins GR16:$src1, GR16:$src2),
- "shld{w}\t{%cl, $src2, $dst|$dst, $src2, %CL}",
- [(set GR16:$dst, (X86shld GR16:$src1, GR16:$src2, CL))]>,
- TB, OpSize;
-def SHRD16rrCL : I<0xAD, MRMDestReg, (outs GR16:$dst), (ins GR16:$src1, GR16:$src2),
- "shrd{w}\t{%cl, $src2, $dst|$dst, $src2, %CL}",
- [(set GR16:$dst, (X86shrd GR16:$src1, GR16:$src2, CL))]>,
- TB, OpSize;
-}
-
-let isCommutable = 1 in { // These instructions commute to each other.
-def SHLD32rri8 : Ii8<0xA4, MRMDestReg,
- (outs GR32:$dst), (ins GR32:$src1, GR32:$src2, i8imm:$src3),
- "shld{l}\t{$src3, $src2, $dst|$dst, $src2, $src3}",
- [(set GR32:$dst, (X86shld GR32:$src1, GR32:$src2,
- (i8 imm:$src3)))]>,
- TB;
-def SHRD32rri8 : Ii8<0xAC, MRMDestReg,
- (outs GR32:$dst), (ins GR32:$src1, GR32:$src2, i8imm:$src3),
- "shrd{l}\t{$src3, $src2, $dst|$dst, $src2, $src3}",
- [(set GR32:$dst, (X86shrd GR32:$src1, GR32:$src2,
- (i8 imm:$src3)))]>,
- TB;
-def SHLD16rri8 : Ii8<0xA4, MRMDestReg,
- (outs GR16:$dst), (ins GR16:$src1, GR16:$src2, i8imm:$src3),
- "shld{w}\t{$src3, $src2, $dst|$dst, $src2, $src3}",
- [(set GR16:$dst, (X86shld GR16:$src1, GR16:$src2,
- (i8 imm:$src3)))]>,
- TB, OpSize;
-def SHRD16rri8 : Ii8<0xAC, MRMDestReg,
- (outs GR16:$dst), (ins GR16:$src1, GR16:$src2, i8imm:$src3),
- "shrd{w}\t{$src3, $src2, $dst|$dst, $src2, $src3}",
- [(set GR16:$dst, (X86shrd GR16:$src1, GR16:$src2,
- (i8 imm:$src3)))]>,
- TB, OpSize;
-}
-
-let isTwoAddress = 0 in {
- let Uses = [CL] in {
- def SHLD32mrCL : I<0xA5, MRMDestMem, (outs), (ins i32mem:$dst, GR32:$src2),
- "shld{l}\t{%cl, $src2, $dst|$dst, $src2, %CL}",
- [(store (X86shld (loadi32 addr:$dst), GR32:$src2, CL),
- addr:$dst)]>, TB;
- def SHRD32mrCL : I<0xAD, MRMDestMem, (outs), (ins i32mem:$dst, GR32:$src2),
- "shrd{l}\t{%cl, $src2, $dst|$dst, $src2, %CL}",
- [(store (X86shrd (loadi32 addr:$dst), GR32:$src2, CL),
- addr:$dst)]>, TB;
- }
- def SHLD32mri8 : Ii8<0xA4, MRMDestMem,
- (outs), (ins i32mem:$dst, GR32:$src2, i8imm:$src3),
- "shld{l}\t{$src3, $src2, $dst|$dst, $src2, $src3}",
- [(store (X86shld (loadi32 addr:$dst), GR32:$src2,
- (i8 imm:$src3)), addr:$dst)]>,
- TB;
- def SHRD32mri8 : Ii8<0xAC, MRMDestMem,
- (outs), (ins i32mem:$dst, GR32:$src2, i8imm:$src3),
- "shrd{l}\t{$src3, $src2, $dst|$dst, $src2, $src3}",
- [(store (X86shrd (loadi32 addr:$dst), GR32:$src2,
- (i8 imm:$src3)), addr:$dst)]>,
- TB;
-
- let Uses = [CL] in {
- def SHLD16mrCL : I<0xA5, MRMDestMem, (outs), (ins i16mem:$dst, GR16:$src2),
- "shld{w}\t{%cl, $src2, $dst|$dst, $src2, %CL}",
- [(store (X86shld (loadi16 addr:$dst), GR16:$src2, CL),
- addr:$dst)]>, TB, OpSize;
- def SHRD16mrCL : I<0xAD, MRMDestMem, (outs), (ins i16mem:$dst, GR16:$src2),
- "shrd{w}\t{%cl, $src2, $dst|$dst, $src2, %CL}",
- [(store (X86shrd (loadi16 addr:$dst), GR16:$src2, CL),
- addr:$dst)]>, TB, OpSize;
- }
- def SHLD16mri8 : Ii8<0xA4, MRMDestMem,
- (outs), (ins i16mem:$dst, GR16:$src2, i8imm:$src3),
- "shld{w}\t{$src3, $src2, $dst|$dst, $src2, $src3}",
- [(store (X86shld (loadi16 addr:$dst), GR16:$src2,
- (i8 imm:$src3)), addr:$dst)]>,
- TB, OpSize;
- def SHRD16mri8 : Ii8<0xAC, MRMDestMem,
- (outs), (ins i16mem:$dst, GR16:$src2, i8imm:$src3),
- "shrd{w}\t{$src3, $src2, $dst|$dst, $src2, $src3}",
- [(store (X86shrd (loadi16 addr:$dst), GR16:$src2,
- (i8 imm:$src3)), addr:$dst)]>,
- TB, OpSize;
-}
-} // Defs = [EFLAGS]
-
-
-// Arithmetic.
-let Defs = [EFLAGS] in {
-let isCommutable = 1 in { // X = ADD Y, Z --> X = ADD Z, Y
-def ADD8rr : I<0x00, MRMDestReg, (outs GR8 :$dst),
- (ins GR8 :$src1, GR8 :$src2),
- "add{b}\t{$src2, $dst|$dst, $src2}",
- [(set GR8:$dst, (add GR8:$src1, GR8:$src2))]>;
-let isConvertibleToThreeAddress = 1 in { // Can transform into LEA.
-def ADD16rr : I<0x01, MRMDestReg, (outs GR16:$dst),
- (ins GR16:$src1, GR16:$src2),
- "add{w}\t{$src2, $dst|$dst, $src2}",
- [(set GR16:$dst, (add GR16:$src1, GR16:$src2))]>, OpSize;
-def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst),
- (ins GR32:$src1, GR32:$src2),
- "add{l}\t{$src2, $dst|$dst, $src2}",
- [(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
-} // end isConvertibleToThreeAddress
-} // end isCommutable
-def ADD8rm : I<0x02, MRMSrcMem, (outs GR8 :$dst),
- (ins GR8 :$src1, i8mem :$src2),
- "add{b}\t{$src2, $dst|$dst, $src2}",
- [(set GR8:$dst, (add GR8:$src1, (load addr:$src2)))]>;
-def ADD16rm : I<0x03, MRMSrcMem, (outs GR16:$dst),
- (ins GR16:$src1, i16mem:$src2),
- "add{w}\t{$src2, $dst|$dst, $src2}",
- [(set GR16:$dst, (add GR16:$src1, (load addr:$src2)))]>,OpSize;
-def ADD32rm : I<0x03, MRMSrcMem, (outs GR32:$dst),
- (ins GR32:$src1, i32mem:$src2),
- "add{l}\t{$src2, $dst|$dst, $src2}",
- [(set GR32:$dst, (add GR32:$src1, (load addr:$src2)))]>;
-
-def ADD8ri : Ii8<0x80, MRM0r, (outs GR8:$dst), (ins GR8:$src1, i8imm:$src2),
- "add{b}\t{$src2, $dst|$dst, $src2}",
- [(set GR8:$dst, (add GR8:$src1, imm:$src2))]>;
-
-let isConvertibleToThreeAddress = 1 in { // Can transform into LEA.
-def ADD16ri : Ii16<0x81, MRM0r, (outs GR16:$dst),
- (ins GR16:$src1, i16imm:$src2),
- "add{w}\t{$src2, $dst|$dst, $src2}",
- [(set GR16:$dst, (add GR16:$src1, imm:$src2))]>, OpSize;
-def ADD32ri : Ii32<0x81, MRM0r, (outs GR32:$dst),
- (ins GR32:$src1, i32imm:$src2),
- "add{l}\t{$src2, $dst|$dst, $src2}",
- [(set GR32:$dst, (add GR32:$src1, imm:$src2))]>;
-def ADD16ri8 : Ii8<0x83, MRM0r, (outs GR16:$dst),
- (ins GR16:$src1, i16i8imm:$src2),
- "add{w}\t{$src2, $dst|$dst, $src2}",
- [(set GR16:$dst, (add GR16:$src1, i16immSExt8:$src2))]>, OpSize;
-def ADD32ri8 : Ii8<0x83, MRM0r, (outs GR32:$dst),
- (ins GR32:$src1, i32i8imm:$src2),
- "add{l}\t{$src2, $dst|$dst, $src2}",
- [(set GR32:$dst, (add GR32:$src1, i32immSExt8:$src2))]>;
-}
-
-let isTwoAddress = 0 in {
- def ADD8mr : I<0x00, MRMDestMem, (outs), (ins i8mem :$dst, GR8 :$src2),
- "add{b}\t{$src2, $dst|$dst, $src2}",
- [(store (add (load addr:$dst), GR8:$src2), addr:$dst)]>;
- def ADD16mr : I<0x01, MRMDestMem, (outs), (ins i16mem:$dst, GR16:$src2),
- "add{w}\t{$src2, $dst|$dst, $src2}",
- [(store (add (load addr:$dst), GR16:$src2), addr:$dst)]>,
- OpSize;
- def ADD32mr : I<0x01, MRMDestMem, (outs), (ins i32mem:$dst, GR32:$src2),
- "add{l}\t{$src2, $dst|$dst, $src2}",
- [(store (add (load addr:$dst), GR32:$src2), addr:$dst)]>;
- def ADD8mi : Ii8<0x80, MRM0m, (outs), (ins i8mem :$dst, i8imm :$src2),
- "add{b}\t{$src2, $dst|$dst, $src2}",
- [(store (add (loadi8 addr:$dst), imm:$src2), addr:$dst)]>;
- def ADD16mi : Ii16<0x81, MRM0m, (outs), (ins i16mem:$dst, i16imm:$src2),
- "add{w}\t{$src2, $dst|$dst, $src2}",
- [(store (add (loadi16 addr:$dst), imm:$src2), addr:$dst)]>,
- OpSize;
- def ADD32mi : Ii32<0x81, MRM0m, (outs), (ins i32mem:$dst, i32imm:$src2),
- "add{l}\t{$src2, $dst|$dst, $src2}",
- [(store (add (loadi32 addr:$dst), imm:$src2), addr:$dst)]>;
- def ADD16mi8 : Ii8<0x83, MRM0m, (outs), (ins i16mem:$dst, i16i8imm :$src2),
- "add{w}\t{$src2, $dst|$dst, $src2}",
- [(store (add (load addr:$dst), i16immSExt8:$src2), addr:$dst)]>,
- OpSize;
- def ADD32mi8 : Ii8<0x83, MRM0m, (outs), (ins i32mem:$dst, i32i8imm :$src2),
- "add{l}\t{$src2, $dst|$dst, $src2}",
- [(store (add (load addr:$dst), i32immSExt8:$src2), addr:$dst)]>;
-}
-
-let Uses = [EFLAGS] in {
-let isCommutable = 1 in { // X = ADC Y, Z --> X = ADC Z, Y
-def ADC32rr : I<0x11, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
- "adc{l}\t{$src2, $dst|$dst, $src2}",
- [(set GR32:$dst, (adde GR32:$src1, GR32:$src2))]>;
-}
-def ADC32rm : I<0x13, MRMSrcMem , (outs GR32:$dst), (ins GR32:$src1, i32mem:$src2),
- "adc{l}\t{$src2, $dst|$dst, $src2}",
- [(set GR32:$dst, (adde GR32:$src1, (load addr:$src2)))]>;
-def ADC32ri : Ii32<0x81, MRM2r, (outs GR32:$dst), (ins GR32:$src1, i32imm:$src2),
- "adc{l}\t{$src2, $dst|$dst, $src2}",
- [(set GR32:$dst, (adde GR32:$src1, imm:$src2))]>;
-def ADC32ri8 : Ii8<0x83, MRM2r, (outs GR32:$dst), (ins GR32:$src1, i32i8imm:$src2),
- "adc{l}\t{$src2, $dst|$dst, $src2}",
- [(set GR32:$dst, (adde GR32:$src1, i32immSExt8:$src2))]>;
-
-let isTwoAddress = 0 in {
- def ADC32mr : I<0x11, MRMDestMem, (outs), (ins i32mem:$dst, GR32:$src2),
- "adc{l}\t{$src2, $dst|$dst, $src2}",
- [(store (adde (load addr:$dst), GR32:$src2), addr:$dst)]>;
- def ADC32mi : Ii32<0x81, MRM2m, (outs), (ins i32mem:$dst, i32imm:$src2),
- "adc{l}\t{$src2, $dst|$dst, $src2}",
- [(store (adde (loadi32 addr:$dst), imm:$src2), addr:$dst)]>;
- def ADC32mi8 : Ii8<0x83, MRM2m, (outs), (ins i32mem:$dst, i32i8imm :$src2),
- "adc{l}\t{$src2, $dst|$dst, $src2}",
- [(store (adde (load addr:$dst), i32immSExt8:$src2), addr:$dst)]>;
-}
-} // Uses = [EFLAGS]
-
-def SUB8rr : I<0x28, MRMDestReg, (outs GR8 :$dst), (ins GR8 :$src1, GR8 :$src2),
- "sub{b}\t{$src2, $dst|$dst, $src2}",
- [(set GR8:$dst, (sub GR8:$src1, GR8:$src2))]>;
-def SUB16rr : I<0x29, MRMDestReg, (outs GR16:$dst), (ins GR16:$src1, GR16:$src2),
- "sub{w}\t{$src2, $dst|$dst, $src2}",
- [(set GR16:$dst, (sub GR16:$src1, GR16:$src2))]>, OpSize;
-def SUB32rr : I<0x29, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
- "sub{l}\t{$src2, $dst|$dst, $src2}",
- [(set GR32:$dst, (sub GR32:$src1, GR32:$src2))]>;
-def SUB8rm : I<0x2A, MRMSrcMem, (outs GR8 :$dst), (ins GR8 :$src1, i8mem :$src2),
- "sub{b}\t{$src2, $dst|$dst, $src2}",
- [(set GR8:$dst, (sub GR8:$src1, (load addr:$src2)))]>;
-def SUB16rm : I<0x2B, MRMSrcMem, (outs GR16:$dst), (ins GR16:$src1, i16mem:$src2),
- "sub{w}\t{$src2, $dst|$dst, $src2}",
- [(set GR16:$dst, (sub GR16:$src1, (load addr:$src2)))]>, OpSize;
-def SUB32rm : I<0x2B, MRMSrcMem, (outs GR32:$dst), (ins GR32:$src1, i32mem:$src2),
- "sub{l}\t{$src2, $dst|$dst, $src2}",
- [(set GR32:$dst, (sub GR32:$src1, (load addr:$src2)))]>;
-
-def SUB8ri : Ii8 <0x80, MRM5r, (outs GR8:$dst), (ins GR8:$src1, i8imm:$src2),
- "sub{b}\t{$src2, $dst|$dst, $src2}",
- [(set GR8:$dst, (sub GR8:$src1, imm:$src2))]>;
-def SUB16ri : Ii16<0x81, MRM5r, (outs GR16:$dst), (ins GR16:$src1, i16imm:$src2),
- "sub{w}\t{$src2, $dst|$dst, $src2}",
- [(set GR16:$dst, (sub GR16:$src1, imm:$src2))]>, OpSize;
-def SUB32ri : Ii32<0x81, MRM5r, (outs GR32:$dst), (ins GR32:$src1, i32imm:$src2),
- "sub{l}\t{$src2, $dst|$dst, $src2}",
- [(set GR32:$dst, (sub GR32:$src1, imm:$src2))]>;
-def SUB16ri8 : Ii8<0x83, MRM5r, (outs GR16:$dst), (ins GR16:$src1, i16i8imm:$src2),
- "sub{w}\t{$src2, $dst|$dst, $src2}",
- [(set GR16:$dst, (sub GR16:$src1, i16immSExt8:$src2))]>,
- OpSize;
-def SUB32ri8 : Ii8<0x83, MRM5r, (outs GR32:$dst), (ins GR32:$src1, i32i8imm:$src2),
- "sub{l}\t{$src2, $dst|$dst, $src2}",
- [(set GR32:$dst, (sub GR32:$src1, i32immSExt8:$src2))]>;
-let isTwoAddress = 0 in {
- def SUB8mr : I<0x28, MRMDestMem, (outs), (ins i8mem :$dst, GR8 :$src2),
- "sub{b}\t{$src2, $dst|$dst, $src2}",
- [(store (sub (load addr:$dst), GR8:$src2), addr:$dst)]>;
- def SUB16mr : I<0x29, MRMDestMem, (outs), (ins i16mem:$dst, GR16:$src2),
- "sub{w}\t{$src2, $dst|$dst, $src2}",
- [(store (sub (load addr:$dst), GR16:$src2), addr:$dst)]>,
- OpSize;
- def SUB32mr : I<0x29, MRMDestMem, (outs), (ins i32mem:$dst, GR32:$src2),
- "sub{l}\t{$src2, $dst|$dst, $src2}",
- [(store (sub (load addr:$dst), GR32:$src2), addr:$dst)]>;
- def SUB8mi : Ii8<0x80, MRM5m, (outs), (ins i8mem :$dst, i8imm:$src2),
- "sub{b}\t{$src2, $dst|$dst, $src2}",
- [(store (sub (loadi8 addr:$dst), imm:$src2), addr:$dst)]>;
- def SUB16mi : Ii16<0x81, MRM5m, (outs), (ins i16mem:$dst, i16imm:$src2),
- "sub{w}\t{$src2, $dst|$dst, $src2}",
- [(store (sub (loadi16 addr:$dst), imm:$src2), addr:$dst)]>,
- OpSize;
- def SUB32mi : Ii32<0x81, MRM5m, (outs), (ins i32mem:$dst, i32imm:$src2),
- "sub{l}\t{$src2, $dst|$dst, $src2}",
- [(store (sub (loadi32 addr:$dst), imm:$src2), addr:$dst)]>;
- def SUB16mi8 : Ii8<0x83, MRM5m, (outs), (ins i16mem:$dst, i16i8imm :$src2),
- "sub{w}\t{$src2, $dst|$dst, $src2}",
- [(store (sub (load addr:$dst), i16immSExt8:$src2), addr:$dst)]>,
- OpSize;
- def SUB32mi8 : Ii8<0x83, MRM5m, (outs), (ins i32mem:$dst, i32i8imm :$src2),
- "sub{l}\t{$src2, $dst|$dst, $src2}",
- [(store (sub (load addr:$dst), i32immSExt8:$src2), addr:$dst)]>;
-}
-
-let Uses = [EFLAGS] in {
-def SBB32rr : I<0x19, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
- "sbb{l}\t{$src2, $dst|$dst, $src2}",
- [(set GR32:$dst, (sube GR32:$src1, GR32:$src2))]>;
-
-let isTwoAddress = 0 in {
- def SBB32mr : I<0x19, MRMDestMem, (outs), (ins i32mem:$dst, GR32:$src2),
- "sbb{l}\t{$src2, $dst|$dst, $src2}",
- [(store (sube (load addr:$dst), GR32:$src2), addr:$dst)]>;
- def SBB8mi : Ii32<0x80, MRM3m, (outs), (ins i8mem:$dst, i8imm:$src2),
- "sbb{b}\t{$src2, $dst|$dst, $src2}",
- [(store (sube (loadi8 addr:$dst), imm:$src2), addr:$dst)]>;
- def SBB32mi : Ii32<0x81, MRM3m, (outs), (ins i32mem:$dst, i32imm:$src2),
- "sbb{l}\t{$src2, $dst|$dst, $src2}",
- [(store (sube (loadi32 addr:$dst), imm:$src2), addr:$dst)]>;
- def SBB32mi8 : Ii8<0x83, MRM3m, (outs), (ins i32mem:$dst, i32i8imm :$src2),
- "sbb{l}\t{$src2, $dst|$dst, $src2}",
- [(store (sube (load addr:$dst), i32immSExt8:$src2), addr:$dst)]>;
-}
-def SBB32rm : I<0x1B, MRMSrcMem, (outs GR32:$dst), (ins GR32:$src1, i32mem:$src2),
- "sbb{l}\t{$src2, $dst|$dst, $src2}",
- [(set GR32:$dst, (sube GR32:$src1, (load addr:$src2)))]>;
-def SBB32ri : Ii32<0x81, MRM3r, (outs GR32:$dst), (ins GR32:$src1, i32imm:$src2),
- "sbb{l}\t{$src2, $dst|$dst, $src2}",
- [(set GR32:$dst, (sube GR32:$src1, imm:$src2))]>;
-def SBB32ri8 : Ii8<0x83, MRM3r, (outs GR32:$dst), (ins GR32:$src1, i32i8imm:$src2),
- "sbb{l}\t{$src2, $dst|$dst, $src2}",
- [(set GR32:$dst, (sube GR32:$src1, i32immSExt8:$src2))]>;
-} // Uses = [EFLAGS]
-} // Defs = [EFLAGS]
-
-let Defs = [EFLAGS] in {
-let isCommutable = 1 in { // X = IMUL Y, Z --> X = IMUL Z, Y
-def IMUL16rr : I<0xAF, MRMSrcReg, (outs GR16:$dst), (ins GR16:$src1, GR16:$src2),
- "imul{w}\t{$src2, $dst|$dst, $src2}",
- [(set GR16:$dst, (mul GR16:$src1, GR16:$src2))]>, TB, OpSize;
-def IMUL32rr : I<0xAF, MRMSrcReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
- "imul{l}\t{$src2, $dst|$dst, $src2}",
- [(set GR32:$dst, (mul GR32:$src1, GR32:$src2))]>, TB;
-}
-def IMUL16rm : I<0xAF, MRMSrcMem, (outs GR16:$dst), (ins GR16:$src1, i16mem:$src2),
- "imul{w}\t{$src2, $dst|$dst, $src2}",
- [(set GR16:$dst, (mul GR16:$src1, (load addr:$src2)))]>,
- TB, OpSize;
-def IMUL32rm : I<0xAF, MRMSrcMem, (outs GR32:$dst), (ins GR32:$src1, i32mem:$src2),
- "imul{l}\t{$src2, $dst|$dst, $src2}",
- [(set GR32:$dst, (mul GR32:$src1, (load addr:$src2)))]>, TB;
-} // Defs = [EFLAGS]
-} // end Two Address instructions
-
-// Suprisingly enough, these are not two address instructions!
-let Defs = [EFLAGS] in {
-def IMUL16rri : Ii16<0x69, MRMSrcReg, // GR16 = GR16*I16
- (outs GR16:$dst), (ins GR16:$src1, i16imm:$src2),
- "imul{w}\t{$src2, $src1, $dst|$dst, $src1, $src2}",
- [(set GR16:$dst, (mul GR16:$src1, imm:$src2))]>, OpSize;
-def IMUL32rri : Ii32<0x69, MRMSrcReg, // GR32 = GR32*I32
- (outs GR32:$dst), (ins GR32:$src1, i32imm:$src2),
- "imul{l}\t{$src2, $src1, $dst|$dst, $src1, $src2}",
- [(set GR32:$dst, (mul GR32:$src1, imm:$src2))]>;
-def IMUL16rri8 : Ii8<0x6B, MRMSrcReg, // GR16 = GR16*I8
- (outs GR16:$dst), (ins GR16:$src1, i16i8imm:$src2),
- "imul{w}\t{$src2, $src1, $dst|$dst, $src1, $src2}",
- [(set GR16:$dst, (mul GR16:$src1, i16immSExt8:$src2))]>,
- OpSize;
-def IMUL32rri8 : Ii8<0x6B, MRMSrcReg, // GR32 = GR32*I8
- (outs GR32:$dst), (ins GR32:$src1, i32i8imm:$src2),
- "imul{l}\t{$src2, $src1, $dst|$dst, $src1, $src2}",
- [(set GR32:$dst, (mul GR32:$src1, i32immSExt8:$src2))]>;
-
-def IMUL16rmi : Ii16<0x69, MRMSrcMem, // GR16 = [mem16]*I16
- (outs GR16:$dst), (ins i16mem:$src1, i16imm:$src2),
- "imul{w}\t{$src2, $src1, $dst|$dst, $src1, $src2}",
- [(set GR16:$dst, (mul (load addr:$src1), imm:$src2))]>,
- OpSize;
-def IMUL32rmi : Ii32<0x69, MRMSrcMem, // GR32 = [mem32]*I32
- (outs GR32:$dst), (ins i32mem:$src1, i32imm:$src2),
- "imul{l}\t{$src2, $src1, $dst|$dst, $src1, $src2}",
- [(set GR32:$dst, (mul (load addr:$src1), imm:$src2))]>;
-def IMUL16rmi8 : Ii8<0x6B, MRMSrcMem, // GR16 = [mem16]*I8
- (outs GR16:$dst), (ins i16mem:$src1, i16i8imm :$src2),
- "imul{w}\t{$src2, $src1, $dst|$dst, $src1, $src2}",
- [(set GR16:$dst, (mul (load addr:$src1), i16immSExt8:$src2))]>,
- OpSize;
-def IMUL32rmi8 : Ii8<0x6B, MRMSrcMem, // GR32 = [mem32]*I8
- (outs GR32:$dst), (ins i32mem:$src1, i32i8imm: $src2),
- "imul{l}\t{$src2, $src1, $dst|$dst, $src1, $src2}",
- [(set GR32:$dst, (mul (load addr:$src1), i32immSExt8:$src2))]>;
-} // Defs = [EFLAGS]
-
-//===----------------------------------------------------------------------===//
-// Test instructions are just like AND, except they don't generate a result.
-//
-let Defs = [EFLAGS] in {
-let isCommutable = 1 in { // TEST X, Y --> TEST Y, X
-def TEST8rr : I<0x84, MRMDestReg, (outs), (ins GR8:$src1, GR8:$src2),
- "test{b}\t{$src2, $src1|$src1, $src2}",
- [(X86cmp (and_su GR8:$src1, GR8:$src2), 0),
- (implicit EFLAGS)]>;
-def TEST16rr : I<0x85, MRMDestReg, (outs), (ins GR16:$src1, GR16:$src2),
- "test{w}\t{$src2, $src1|$src1, $src2}",
- [(X86cmp (and_su GR16:$src1, GR16:$src2), 0),
- (implicit EFLAGS)]>,
- OpSize;
-def TEST32rr : I<0x85, MRMDestReg, (outs), (ins GR32:$src1, GR32:$src2),
- "test{l}\t{$src2, $src1|$src1, $src2}",
- [(X86cmp (and_su GR32:$src1, GR32:$src2), 0),
- (implicit EFLAGS)]>;
-}
-
-def TEST8rm : I<0x84, MRMSrcMem, (outs), (ins GR8 :$src1, i8mem :$src2),
- "test{b}\t{$src2, $src1|$src1, $src2}",
- [(X86cmp (and GR8:$src1, (loadi8 addr:$src2)), 0),
- (implicit EFLAGS)]>;
-def TEST16rm : I<0x85, MRMSrcMem, (outs), (ins GR16:$src1, i16mem:$src2),
- "test{w}\t{$src2, $src1|$src1, $src2}",
- [(X86cmp (and GR16:$src1, (loadi16 addr:$src2)), 0),
- (implicit EFLAGS)]>, OpSize;
-def TEST32rm : I<0x85, MRMSrcMem, (outs), (ins GR32:$src1, i32mem:$src2),
- "test{l}\t{$src2, $src1|$src1, $src2}",
- [(X86cmp (and GR32:$src1, (loadi32 addr:$src2)), 0),
- (implicit EFLAGS)]>;
-
-def TEST8ri : Ii8 <0xF6, MRM0r, // flags = GR8 & imm8
- (outs), (ins GR8:$src1, i8imm:$src2),
- "test{b}\t{$src2, $src1|$src1, $src2}",
- [(X86cmp (and_su GR8:$src1, imm:$src2), 0),
- (implicit EFLAGS)]>;
-def TEST16ri : Ii16<0xF7, MRM0r, // flags = GR16 & imm16
- (outs), (ins GR16:$src1, i16imm:$src2),
- "test{w}\t{$src2, $src1|$src1, $src2}",
- [(X86cmp (and_su GR16:$src1, imm:$src2), 0),
- (implicit EFLAGS)]>, OpSize;
-def TEST32ri : Ii32<0xF7, MRM0r, // flags = GR32 & imm32
- (outs), (ins GR32:$src1, i32imm:$src2),
- "test{l}\t{$src2, $src1|$src1, $src2}",
- [(X86cmp (and_su GR32:$src1, imm:$src2), 0),
- (implicit EFLAGS)]>;
-
-def TEST8mi : Ii8 <0xF6, MRM0m, // flags = [mem8] & imm8
- (outs), (ins i8mem:$src1, i8imm:$src2),
- "test{b}\t{$src2, $src1|$src1, $src2}",
- [(X86cmp (and (loadi8 addr:$src1), imm:$src2), 0),
- (implicit EFLAGS)]>;
-def TEST16mi : Ii16<0xF7, MRM0m, // flags = [mem16] & imm16
- (outs), (ins i16mem:$src1, i16imm:$src2),
- "test{w}\t{$src2, $src1|$src1, $src2}",
- [(X86cmp (and (loadi16 addr:$src1), imm:$src2), 0),
- (implicit EFLAGS)]>, OpSize;
-def TEST32mi : Ii32<0xF7, MRM0m, // flags = [mem32] & imm32
- (outs), (ins i32mem:$src1, i32imm:$src2),
- "test{l}\t{$src2, $src1|$src1, $src2}",
- [(X86cmp (and (loadi32 addr:$src1), imm:$src2), 0),
- (implicit EFLAGS)]>;
-} // Defs = [EFLAGS]
-
-
-// Condition code ops, incl. set if equal/not equal/...
-let Defs = [EFLAGS], Uses = [AH], neverHasSideEffects = 1 in
-def SAHF : I<0x9E, RawFrm, (outs), (ins), "sahf", []>; // flags = AH
-let Defs = [AH], Uses = [EFLAGS], neverHasSideEffects = 1 in
-def LAHF : I<0x9F, RawFrm, (outs), (ins), "lahf", []>; // AH = flags
-
-let Uses = [EFLAGS] in {
-def SETEr : I<0x94, MRM0r,
- (outs GR8 :$dst), (ins),
- "sete\t$dst",
- [(set GR8:$dst, (X86setcc X86_COND_E, EFLAGS))]>,
- TB; // GR8 = ==
-def SETEm : I<0x94, MRM0m,
- (outs), (ins i8mem:$dst),
- "sete\t$dst",
- [(store (X86setcc X86_COND_E, EFLAGS), addr:$dst)]>,
- TB; // [mem8] = ==
-def SETNEr : I<0x95, MRM0r,
- (outs GR8 :$dst), (ins),
- "setne\t$dst",
- [(set GR8:$dst, (X86setcc X86_COND_NE, EFLAGS))]>,
- TB; // GR8 = !=
-def SETNEm : I<0x95, MRM0m,
- (outs), (ins i8mem:$dst),
- "setne\t$dst",
- [(store (X86setcc X86_COND_NE, EFLAGS), addr:$dst)]>,
- TB; // [mem8] = !=
-def SETLr : I<0x9C, MRM0r,
- (outs GR8 :$dst), (ins),
- "setl\t$dst",
- [(set GR8:$dst, (X86setcc X86_COND_L, EFLAGS))]>,
- TB; // GR8 = < signed
-def SETLm : I<0x9C, MRM0m,
- (outs), (ins i8mem:$dst),
- "setl\t$dst",
- [(store (X86setcc X86_COND_L, EFLAGS), addr:$dst)]>,
- TB; // [mem8] = < signed
-def SETGEr : I<0x9D, MRM0r,
- (outs GR8 :$dst), (ins),
- "setge\t$dst",
- [(set GR8:$dst, (X86setcc X86_COND_GE, EFLAGS))]>,
- TB; // GR8 = >= signed
-def SETGEm : I<0x9D, MRM0m,
- (outs), (ins i8mem:$dst),
- "setge\t$dst",
- [(store (X86setcc X86_COND_GE, EFLAGS), addr:$dst)]>,
- TB; // [mem8] = >= signed
-def SETLEr : I<0x9E, MRM0r,
- (outs GR8 :$dst), (ins),
- "setle\t$dst",
- [(set GR8:$dst, (X86setcc X86_COND_LE, EFLAGS))]>,
- TB; // GR8 = <= signed
-def SETLEm : I<0x9E, MRM0m,
- (outs), (ins i8mem:$dst),
- "setle\t$dst",
- [(store (X86setcc X86_COND_LE, EFLAGS), addr:$dst)]>,
- TB; // [mem8] = <= signed
-def SETGr : I<0x9F, MRM0r,
- (outs GR8 :$dst), (ins),
- "setg\t$dst",
- [(set GR8:$dst, (X86setcc X86_COND_G, EFLAGS))]>,
- TB; // GR8 = > signed
-def SETGm : I<0x9F, MRM0m,
- (outs), (ins i8mem:$dst),
- "setg\t$dst",
- [(store (X86setcc X86_COND_G, EFLAGS), addr:$dst)]>,
- TB; // [mem8] = > signed
-
-def SETBr : I<0x92, MRM0r,
- (outs GR8 :$dst), (ins),
- "setb\t$dst",
- [(set GR8:$dst, (X86setcc X86_COND_B, EFLAGS))]>,
- TB; // GR8 = < unsign
-def SETBm : I<0x92, MRM0m,
- (outs), (ins i8mem:$dst),
- "setb\t$dst",
- [(store (X86setcc X86_COND_B, EFLAGS), addr:$dst)]>,
- TB; // [mem8] = < unsign
-def SETAEr : I<0x93, MRM0r,
- (outs GR8 :$dst), (ins),
- "setae\t$dst",
- [(set GR8:$dst, (X86setcc X86_COND_AE, EFLAGS))]>,
- TB; // GR8 = >= unsign
-def SETAEm : I<0x93, MRM0m,
- (outs), (ins i8mem:$dst),
- "setae\t$dst",
- [(store (X86setcc X86_COND_AE, EFLAGS), addr:$dst)]>,
- TB; // [mem8] = >= unsign
-def SETBEr : I<0x96, MRM0r,
- (outs GR8 :$dst), (ins),
- "setbe\t$dst",
- [(set GR8:$dst, (X86setcc X86_COND_BE, EFLAGS))]>,
- TB; // GR8 = <= unsign
-def SETBEm : I<0x96, MRM0m,
- (outs), (ins i8mem:$dst),
- "setbe\t$dst",
- [(store (X86setcc X86_COND_BE, EFLAGS), addr:$dst)]>,
- TB; // [mem8] = <= unsign
-def SETAr : I<0x97, MRM0r,
- (outs GR8 :$dst), (ins),
- "seta\t$dst",
- [(set GR8:$dst, (X86setcc X86_COND_A, EFLAGS))]>,
- TB; // GR8 = > signed
-def SETAm : I<0x97, MRM0m,
- (outs), (ins i8mem:$dst),
- "seta\t$dst",
- [(store (X86setcc X86_COND_A, EFLAGS), addr:$dst)]>,
- TB; // [mem8] = > signed
-
-def SETSr : I<0x98, MRM0r,
- (outs GR8 :$dst), (ins),
- "sets\t$dst",
- [(set GR8:$dst, (X86setcc X86_COND_S, EFLAGS))]>,
- TB; // GR8 = <sign bit>
-def SETSm : I<0x98, MRM0m,
- (outs), (ins i8mem:$dst),
- "sets\t$dst",
- [(store (X86setcc X86_COND_S, EFLAGS), addr:$dst)]>,
- TB; // [mem8] = <sign bit>
-def SETNSr : I<0x99, MRM0r,
- (outs GR8 :$dst), (ins),
- "setns\t$dst",
- [(set GR8:$dst, (X86setcc X86_COND_NS, EFLAGS))]>,
- TB; // GR8 = !<sign bit>
-def SETNSm : I<0x99, MRM0m,
- (outs), (ins i8mem:$dst),
- "setns\t$dst",
- [(store (X86setcc X86_COND_NS, EFLAGS), addr:$dst)]>,
- TB; // [mem8] = !<sign bit>
-def SETPr : I<0x9A, MRM0r,
- (outs GR8 :$dst), (ins),
- "setp\t$dst",
- [(set GR8:$dst, (X86setcc X86_COND_P, EFLAGS))]>,
- TB; // GR8 = parity
-def SETPm : I<0x9A, MRM0m,
- (outs), (ins i8mem:$dst),
- "setp\t$dst",
- [(store (X86setcc X86_COND_P, EFLAGS), addr:$dst)]>,
- TB; // [mem8] = parity
-def SETNPr : I<0x9B, MRM0r,
- (outs GR8 :$dst), (ins),
- "setnp\t$dst",
- [(set GR8:$dst, (X86setcc X86_COND_NP, EFLAGS))]>,
- TB; // GR8 = not parity
-def SETNPm : I<0x9B, MRM0m,
- (outs), (ins i8mem:$dst),
- "setnp\t$dst",
- [(store (X86setcc X86_COND_NP, EFLAGS), addr:$dst)]>,
- TB; // [mem8] = not parity
-} // Uses = [EFLAGS]
-
-
-// Integer comparisons
-let Defs = [EFLAGS] in {
-def CMP8rr : I<0x38, MRMDestReg,
- (outs), (ins GR8 :$src1, GR8 :$src2),
- "cmp{b}\t{$src2, $src1|$src1, $src2}",
- [(X86cmp GR8:$src1, GR8:$src2), (implicit EFLAGS)]>;
-def CMP16rr : I<0x39, MRMDestReg,
- (outs), (ins GR16:$src1, GR16:$src2),
- "cmp{w}\t{$src2, $src1|$src1, $src2}",
- [(X86cmp GR16:$src1, GR16:$src2), (implicit EFLAGS)]>, OpSize;
-def CMP32rr : I<0x39, MRMDestReg,
- (outs), (ins GR32:$src1, GR32:$src2),
- "cmp{l}\t{$src2, $src1|$src1, $src2}",
- [(X86cmp GR32:$src1, GR32:$src2), (implicit EFLAGS)]>;
-def CMP8mr : I<0x38, MRMDestMem,
- (outs), (ins i8mem :$src1, GR8 :$src2),
- "cmp{b}\t{$src2, $src1|$src1, $src2}",
- [(X86cmp (loadi8 addr:$src1), GR8:$src2),
- (implicit EFLAGS)]>;
-def CMP16mr : I<0x39, MRMDestMem,
- (outs), (ins i16mem:$src1, GR16:$src2),
- "cmp{w}\t{$src2, $src1|$src1, $src2}",
- [(X86cmp (loadi16 addr:$src1), GR16:$src2),
- (implicit EFLAGS)]>, OpSize;
-def CMP32mr : I<0x39, MRMDestMem,
- (outs), (ins i32mem:$src1, GR32:$src2),
- "cmp{l}\t{$src2, $src1|$src1, $src2}",
- [(X86cmp (loadi32 addr:$src1), GR32:$src2),
- (implicit EFLAGS)]>;
-def CMP8rm : I<0x3A, MRMSrcMem,
- (outs), (ins GR8 :$src1, i8mem :$src2),
- "cmp{b}\t{$src2, $src1|$src1, $src2}",
- [(X86cmp GR8:$src1, (loadi8 addr:$src2)),
- (implicit EFLAGS)]>;
-def CMP16rm : I<0x3B, MRMSrcMem,
- (outs), (ins GR16:$src1, i16mem:$src2),
- "cmp{w}\t{$src2, $src1|$src1, $src2}",
- [(X86cmp GR16:$src1, (loadi16 addr:$src2)),
- (implicit EFLAGS)]>, OpSize;
-def CMP32rm : I<0x3B, MRMSrcMem,
- (outs), (ins GR32:$src1, i32mem:$src2),
- "cmp{l}\t{$src2, $src1|$src1, $src2}",
- [(X86cmp GR32:$src1, (loadi32 addr:$src2)),
- (implicit EFLAGS)]>;
-def CMP8ri : Ii8<0x80, MRM7r,
- (outs), (ins GR8:$src1, i8imm:$src2),
- "cmp{b}\t{$src2, $src1|$src1, $src2}",
- [(X86cmp GR8:$src1, imm:$src2), (implicit EFLAGS)]>;
-def CMP16ri : Ii16<0x81, MRM7r,
- (outs), (ins GR16:$src1, i16imm:$src2),
- "cmp{w}\t{$src2, $src1|$src1, $src2}",
- [(X86cmp GR16:$src1, imm:$src2),
- (implicit EFLAGS)]>, OpSize;
-def CMP32ri : Ii32<0x81, MRM7r,
- (outs), (ins GR32:$src1, i32imm:$src2),
- "cmp{l}\t{$src2, $src1|$src1, $src2}",
- [(X86cmp GR32:$src1, imm:$src2), (implicit EFLAGS)]>;
-def CMP8mi : Ii8 <0x80, MRM7m,
- (outs), (ins i8mem :$src1, i8imm :$src2),
- "cmp{b}\t{$src2, $src1|$src1, $src2}",
- [(X86cmp (loadi8 addr:$src1), imm:$src2),
- (implicit EFLAGS)]>;
-def CMP16mi : Ii16<0x81, MRM7m,
- (outs), (ins i16mem:$src1, i16imm:$src2),
- "cmp{w}\t{$src2, $src1|$src1, $src2}",
- [(X86cmp (loadi16 addr:$src1), imm:$src2),
- (implicit EFLAGS)]>, OpSize;
-def CMP32mi : Ii32<0x81, MRM7m,
- (outs), (ins i32mem:$src1, i32imm:$src2),
- "cmp{l}\t{$src2, $src1|$src1, $src2}",
- [(X86cmp (loadi32 addr:$src1), imm:$src2),
- (implicit EFLAGS)]>;
-def CMP16ri8 : Ii8<0x83, MRM7r,
- (outs), (ins GR16:$src1, i16i8imm:$src2),
- "cmp{w}\t{$src2, $src1|$src1, $src2}",
- [(X86cmp GR16:$src1, i16immSExt8:$src2),
- (implicit EFLAGS)]>, OpSize;
-def CMP16mi8 : Ii8<0x83, MRM7m,
- (outs), (ins i16mem:$src1, i16i8imm:$src2),
- "cmp{w}\t{$src2, $src1|$src1, $src2}",
- [(X86cmp (loadi16 addr:$src1), i16immSExt8:$src2),
- (implicit EFLAGS)]>, OpSize;
-def CMP32mi8 : Ii8<0x83, MRM7m,
- (outs), (ins i32mem:$src1, i32i8imm:$src2),
- "cmp{l}\t{$src2, $src1|$src1, $src2}",
- [(X86cmp (loadi32 addr:$src1), i32immSExt8:$src2),
- (implicit EFLAGS)]>;
-def CMP32ri8 : Ii8<0x83, MRM7r,
- (outs), (ins GR32:$src1, i32i8imm:$src2),
- "cmp{l}\t{$src2, $src1|$src1, $src2}",
- [(X86cmp GR32:$src1, i32immSExt8:$src2),
- (implicit EFLAGS)]>;
-} // Defs = [EFLAGS]
-
-// Sign/Zero extenders
-def MOVSX16rr8 : I<0xBE, MRMSrcReg, (outs GR16:$dst), (ins GR8 :$src),
- "movs{bw|x}\t{$src, $dst|$dst, $src}",
- [(set GR16:$dst, (sext GR8:$src))]>, TB, OpSize;
-def MOVSX16rm8 : I<0xBE, MRMSrcMem, (outs GR16:$dst), (ins i8mem :$src),
- "movs{bw|x}\t{$src, $dst|$dst, $src}",
- [(set GR16:$dst, (sextloadi16i8 addr:$src))]>, TB, OpSize;
-def MOVSX32rr8 : I<0xBE, MRMSrcReg, (outs GR32:$dst), (ins GR8 :$src),
- "movs{bl|x}\t{$src, $dst|$dst, $src}",
- [(set GR32:$dst, (sext GR8:$src))]>, TB;
-def MOVSX32rm8 : I<0xBE, MRMSrcMem, (outs GR32:$dst), (ins i8mem :$src),
- "movs{bl|x}\t{$src, $dst|$dst, $src}",
- [(set GR32:$dst, (sextloadi32i8 addr:$src))]>, TB;
-def MOVSX32rr16: I<0xBF, MRMSrcReg, (outs GR32:$dst), (ins GR16:$src),
- "movs{wl|x}\t{$src, $dst|$dst, $src}",
- [(set GR32:$dst, (sext GR16:$src))]>, TB;
-def MOVSX32rm16: I<0xBF, MRMSrcMem, (outs GR32:$dst), (ins i16mem:$src),
- "movs{wl|x}\t{$src, $dst|$dst, $src}",
- [(set GR32:$dst, (sextloadi32i16 addr:$src))]>, TB;
-
-def MOVZX16rr8 : I<0xB6, MRMSrcReg, (outs GR16:$dst), (ins GR8 :$src),
- "movz{bw|x}\t{$src, $dst|$dst, $src}",
- [(set GR16:$dst, (zext GR8:$src))]>, TB, OpSize;
-def MOVZX16rm8 : I<0xB6, MRMSrcMem, (outs GR16:$dst), (ins i8mem :$src),
- "movz{bw|x}\t{$src, $dst|$dst, $src}",
- [(set GR16:$dst, (zextloadi16i8 addr:$src))]>, TB, OpSize;
-def MOVZX32rr8 : I<0xB6, MRMSrcReg, (outs GR32:$dst), (ins GR8 :$src),
- "movz{bl|x}\t{$src, $dst|$dst, $src}",
- [(set GR32:$dst, (zext GR8:$src))]>, TB;
-def MOVZX32rm8 : I<0xB6, MRMSrcMem, (outs GR32:$dst), (ins i8mem :$src),
- "movz{bl|x}\t{$src, $dst|$dst, $src}",
- [(set GR32:$dst, (zextloadi32i8 addr:$src))]>, TB;
-def MOVZX32rr16: I<0xB7, MRMSrcReg, (outs GR32:$dst), (ins GR16:$src),
- "movz{wl|x}\t{$src, $dst|$dst, $src}",
- [(set GR32:$dst, (zext GR16:$src))]>, TB;
-def MOVZX32rm16: I<0xB7, MRMSrcMem, (outs GR32:$dst), (ins i16mem:$src),
- "movz{wl|x}\t{$src, $dst|$dst, $src}",
- [(set GR32:$dst, (zextloadi32i16 addr:$src))]>, TB;
-
-let neverHasSideEffects = 1 in {
- let Defs = [AX], Uses = [AL] in
- def CBW : I<0x98, RawFrm, (outs), (ins),
- "{cbtw|cbw}", []>, OpSize; // AX = signext(AL)
- let Defs = [EAX], Uses = [AX] in
- def CWDE : I<0x98, RawFrm, (outs), (ins),
- "{cwtl|cwde}", []>; // EAX = signext(AX)
-
- let Defs = [AX,DX], Uses = [AX] in
- def CWD : I<0x99, RawFrm, (outs), (ins),
- "{cwtd|cwd}", []>, OpSize; // DX:AX = signext(AX)
- let Defs = [EAX,EDX], Uses = [EAX] in
- def CDQ : I<0x99, RawFrm, (outs), (ins),
- "{cltd|cdq}", []>; // EDX:EAX = signext(EAX)
-}
-
-//===----------------------------------------------------------------------===//
-// Alias Instructions
-//===----------------------------------------------------------------------===//
-
-// Alias instructions that map movr0 to xor.
-// FIXME: remove when we can teach regalloc that xor reg, reg is ok.
-let Defs = [EFLAGS], isReMaterializable = 1 in {
-def MOV8r0 : I<0x30, MRMInitReg, (outs GR8 :$dst), (ins),
- "xor{b}\t$dst, $dst",
- [(set GR8:$dst, 0)]>;
-def MOV16r0 : I<0x31, MRMInitReg, (outs GR16:$dst), (ins),
- "xor{w}\t$dst, $dst",
- [(set GR16:$dst, 0)]>, OpSize;
-def MOV32r0 : I<0x31, MRMInitReg, (outs GR32:$dst), (ins),
- "xor{l}\t$dst, $dst",
- [(set GR32:$dst, 0)]>;
-}
-
-// Basic operations on GR16 / GR32 subclasses GR16_ and GR32_ which contains only
-// those registers that have GR8 sub-registers (i.e. AX - DX, EAX - EDX).
-let neverHasSideEffects = 1 in {
-def MOV16to16_ : I<0x89, MRMDestReg, (outs GR16_:$dst), (ins GR16:$src),
- "mov{w}\t{$src, $dst|$dst, $src}", []>, OpSize;
-def MOV32to32_ : I<0x89, MRMDestReg, (outs GR32_:$dst), (ins GR32:$src),
- "mov{l}\t{$src, $dst|$dst, $src}", []>;
-
-def MOV16_rr : I<0x89, MRMDestReg, (outs GR16_:$dst), (ins GR16_:$src),
- "mov{w}\t{$src, $dst|$dst, $src}", []>, OpSize;
-def MOV32_rr : I<0x89, MRMDestReg, (outs GR32_:$dst), (ins GR32_:$src),
- "mov{l}\t{$src, $dst|$dst, $src}", []>;
-} // neverHasSideEffects
-
-let isSimpleLoad = 1, mayLoad = 1, isReMaterializable = 1, mayHaveSideEffects = 1 in {
-def MOV16_rm : I<0x8B, MRMSrcMem, (outs GR16_:$dst), (ins i16mem:$src),
- "mov{w}\t{$src, $dst|$dst, $src}", []>, OpSize;
-def MOV32_rm : I<0x8B, MRMSrcMem, (outs GR32_:$dst), (ins i32mem:$src),
- "mov{l}\t{$src, $dst|$dst, $src}", []>;
-}
-let mayStore = 1, neverHasSideEffects = 1 in {
-def MOV16_mr : I<0x89, MRMDestMem, (outs), (ins i16mem:$dst, GR16_:$src),
- "mov{w}\t{$src, $dst|$dst, $src}", []>, OpSize;
-def MOV32_mr : I<0x89, MRMDestMem, (outs), (ins i32mem:$dst, GR32_:$src),
- "mov{l}\t{$src, $dst|$dst, $src}", []>;
-}
-
-//===----------------------------------------------------------------------===//
-// Thread Local Storage Instructions
-//
-
-let Uses = [EBX] in
-def TLS_addr32 : I<0, Pseudo, (outs GR32:$dst), (ins i32imm:$sym),
- "leal\t${sym:mem}(,%ebx,1), $dst",
- [(set GR32:$dst, (X86tlsaddr tglobaltlsaddr:$sym))]>;
-
-let AddedComplexity = 10 in
-def TLS_gs_rr : I<0, Pseudo, (outs GR32:$dst), (ins GR32:$src),
- "movl\t%gs:($src), $dst",
- [(set GR32:$dst, (load (add X86TLStp, GR32:$src)))]>;
-
-let AddedComplexity = 15 in
-def TLS_gs_ri : I<0, Pseudo, (outs GR32:$dst), (ins i32imm:$src),
- "movl\t%gs:${src:mem}, $dst",
- [(set GR32:$dst,
- (load (add X86TLStp, (X86Wrapper tglobaltlsaddr:$src))))]>;
-
-def TLS_tp : I<0, Pseudo, (outs GR32:$dst), (ins),
- "movl\t%gs:0, $dst",
- [(set GR32:$dst, X86TLStp)]>;
-
-//===----------------------------------------------------------------------===//
-// DWARF Pseudo Instructions
-//
-
-def DWARF_LOC : I<0, Pseudo, (outs),
- (ins i32imm:$line, i32imm:$col, i32imm:$file),
- ".loc\t${file:debug} ${line:debug} ${col:debug}",
- [(dwarf_loc (i32 imm:$line), (i32 imm:$col),
- (i32 imm:$file))]>;
-
-//===----------------------------------------------------------------------===//
-// EH Pseudo Instructions
-//
-let isTerminator = 1, isReturn = 1, isBarrier = 1,
- hasCtrlDep = 1 in {
-def EH_RETURN : I<0xC3, RawFrm, (outs), (ins GR32:$addr),
- "ret\t#eh_return, addr: $addr",
- [(X86ehret GR32:$addr)]>;
-
-}
-
-//===----------------------------------------------------------------------===//
-// Atomic support
-//
-
-// Atomic swap. These are just normal xchg instructions. But since a memory
-// operand is referenced, the atomicity is ensured.
-let Constraints = "$val = $dst", Defs = [EFLAGS] in {
-def XCHG32rm : I<0x87, MRMSrcMem, (outs GR32:$dst), (ins i32mem:$ptr, GR32:$val),
- "xchg{l}\t{$val, $ptr|$ptr, $val}",
- [(set GR32:$dst, (atomic_swap_32 addr:$ptr, GR32:$val))]>;
-def XCHG16rm : I<0x87, MRMSrcMem, (outs GR16:$dst), (ins i16mem:$ptr, GR16:$val),
- "xchg{w}\t{$val, $ptr|$ptr, $val}",
- [(set GR16:$dst, (atomic_swap_16 addr:$ptr, GR16:$val))]>,
- OpSize;
-def XCHG8rm : I<0x86, MRMSrcMem, (outs GR8:$dst), (ins i8mem:$ptr, GR8:$val),
- "xchg{b}\t{$val, $ptr|$ptr, $val}",
- [(set GR8:$dst, (atomic_swap_8 addr:$ptr, GR8:$val))]>;
-}
-
-// Atomic compare and swap.
-let Defs = [EAX, EFLAGS], Uses = [EAX] in {
-def LCMPXCHG32 : I<0xB1, MRMDestMem, (outs), (ins i32mem:$ptr, GR32:$swap),
- "lock cmpxchg{l}\t{$swap, $ptr|$ptr, $swap}",
- [(X86cas addr:$ptr, GR32:$swap, 4)]>, TB, LOCK;
-}
-let Defs = [EAX, EBX, ECX, EDX, EFLAGS], Uses = [EAX, EBX, ECX, EDX] in {
-def LCMPXCHG8B : I<0xC7, MRMDestMem, (outs), (ins i32mem:$ptr),
- "lock cmpxchg8b\t$ptr",
- [(X86cas8 addr:$ptr)]>, TB, LOCK;
-}
-
-let Defs = [AX, EFLAGS], Uses = [AX] in {
-def LCMPXCHG16 : I<0xB1, MRMDestMem, (outs), (ins i16mem:$ptr, GR16:$swap),
- "lock cmpxchg{w}\t{$swap, $ptr|$ptr, $swap}",
- [(X86cas addr:$ptr, GR16:$swap, 2)]>, TB, OpSize, LOCK;
-}
-let Defs = [AL, EFLAGS], Uses = [AL] in {
-def LCMPXCHG8 : I<0xB0, MRMDestMem, (outs), (ins i8mem:$ptr, GR8:$swap),
- "lock cmpxchg{b}\t{$swap, $ptr|$ptr, $swap}",
- [(X86cas addr:$ptr, GR8:$swap, 1)]>, TB, LOCK;
-}
-
-// Atomic exchange and add
-let Constraints = "$val = $dst", Defs = [EFLAGS] in {
-def LXADD32 : I<0xC1, MRMSrcMem, (outs GR32:$dst), (ins i32mem:$ptr, GR32:$val),
- "lock xadd{l}\t{$val, $ptr|$ptr, $val}",
- [(set GR32:$dst, (atomic_las_32 addr:$ptr, GR32:$val))]>,
- TB, LOCK;
-def LXADD16 : I<0xC1, MRMSrcMem, (outs GR16:$dst), (ins i16mem:$ptr, GR16:$val),
- "lock xadd{w}\t{$val, $ptr|$ptr, $val}",
- [(set GR16:$dst, (atomic_las_16 addr:$ptr, GR16:$val))]>,
- TB, OpSize, LOCK;
-def LXADD8 : I<0xC0, MRMSrcMem, (outs GR8:$dst), (ins i8mem:$ptr, GR8:$val),
- "lock xadd{b}\t{$val, $ptr|$ptr, $val}",
- [(set GR8:$dst, (atomic_las_8 addr:$ptr, GR8:$val))]>,
- TB, LOCK;
-}
-
-// Atomic exchange and and, or, xor
-let Constraints = "$val = $dst", Defs = [EFLAGS],
- usesCustomDAGSchedInserter = 1 in {
-def ATOMAND32 : I<0xC1, MRMSrcMem,(outs GR32:$dst),(ins i32mem:$ptr, GR32:$val),
- "#ATOMAND32 PSUEDO!",
- [(set GR32:$dst, (atomic_load_and addr:$ptr, GR32:$val))]>,
- TB, LOCK;
-}
-
-let Constraints = "$val = $dst", Defs = [EFLAGS],
- usesCustomDAGSchedInserter = 1 in {
-def ATOMOR32 : I<0xC1, MRMSrcMem, (outs GR32:$dst),(ins i32mem:$ptr, GR32:$val),
- "#ATOMOR32 PSUEDO!",
- [(set GR32:$dst, (atomic_load_or addr:$ptr, GR32:$val))]>,
- TB, LOCK;
-}
-
-let Constraints = "$val = $dst", Defs = [EFLAGS],
- usesCustomDAGSchedInserter = 1 in {
-def ATOMXOR32 : I<0xC1, MRMSrcMem,(outs GR32:$dst),(ins i32mem:$ptr, GR32:$val),
- "#ATOMXOR32 PSUEDO!",
- [(set GR32:$dst, (atomic_load_xor addr:$ptr, GR32:$val))]>,
- TB, LOCK;
-}
-
-let Constraints = "$val = $dst", Defs = [EFLAGS],
- usesCustomDAGSchedInserter = 1 in {
-def ATOMMIN32: I<0xC1, MRMSrcMem, (outs GR32:$dst), (ins i32mem:$ptr, GR32:$val),
- "#ATOMMIN32 PSUEDO!",
- [(set GR32:$dst, (atomic_load_min addr:$ptr, GR32:$val))]>,
- TB, LOCK;
-}
-
-let Constraints = "$val = $dst", Defs = [EFLAGS],
- usesCustomDAGSchedInserter = 1 in {
-def ATOMMAX32: I<0xC1, MRMSrcMem, (outs GR32:$dst),(ins i32mem:$ptr, GR32:$val),
- "#ATOMMAX32 PSUEDO!",
- [(set GR32:$dst, (atomic_load_max addr:$ptr, GR32:$val))]>,
- TB, LOCK;
-}
-
-let Constraints = "$val = $dst", Defs = [EFLAGS],
- usesCustomDAGSchedInserter = 1 in {
-def ATOMUMIN32: I<0xC1, MRMSrcMem,(outs GR32:$dst),(ins i32mem:$ptr, GR32:$val),
- "#ATOMUMIN32 PSUEDO!",
- [(set GR32:$dst, (atomic_load_umin addr:$ptr, GR32:$val))]>,
- TB, LOCK;
-}
-
-let Constraints = "$val = $dst", Defs = [EFLAGS],
- usesCustomDAGSchedInserter = 1 in {
-def ATOMUMAX32: I<0xC1, MRMSrcMem,(outs GR32:$dst),(ins i32mem:$ptr, GR32:$val),
- "#ATOMUMAX32 PSUEDO!",
- [(set GR32:$dst, (atomic_load_umax addr:$ptr, GR32:$val))]>,
- TB, LOCK;
-}
-
-//===----------------------------------------------------------------------===//
-// Non-Instruction Patterns
-//===----------------------------------------------------------------------===//
-
-// ConstantPool GlobalAddress, ExternalSymbol, and JumpTable
-def : Pat<(i32 (X86Wrapper tconstpool :$dst)), (MOV32ri tconstpool :$dst)>;
-def : Pat<(i32 (X86Wrapper tjumptable :$dst)), (MOV32ri tjumptable :$dst)>;
-def : Pat<(i32 (X86Wrapper tglobaltlsaddr:$dst)),(MOV32ri tglobaltlsaddr:$dst)>;
-def : Pat<(i32 (X86Wrapper tglobaladdr :$dst)), (MOV32ri tglobaladdr :$dst)>;
-def : Pat<(i32 (X86Wrapper texternalsym:$dst)), (MOV32ri texternalsym:$dst)>;
-
-def : Pat<(add GR32:$src1, (X86Wrapper tconstpool:$src2)),
- (ADD32ri GR32:$src1, tconstpool:$src2)>;
-def : Pat<(add GR32:$src1, (X86Wrapper tjumptable:$src2)),
- (ADD32ri GR32:$src1, tjumptable:$src2)>;
-def : Pat<(add GR32:$src1, (X86Wrapper tglobaladdr :$src2)),
- (ADD32ri GR32:$src1, tglobaladdr:$src2)>;
-def : Pat<(add GR32:$src1, (X86Wrapper texternalsym:$src2)),
- (ADD32ri GR32:$src1, texternalsym:$src2)>;
-
-def : Pat<(store (i32 (X86Wrapper tglobaladdr:$src)), addr:$dst),
- (MOV32mi addr:$dst, tglobaladdr:$src)>;
-def : Pat<(store (i32 (X86Wrapper texternalsym:$src)), addr:$dst),
- (MOV32mi addr:$dst, texternalsym:$src)>;
-
-// Calls
-// tailcall stuff
-def : Pat<(X86tailcall GR32:$dst),
- (TAILCALL)>;
-
-def : Pat<(X86tailcall (i32 tglobaladdr:$dst)),
- (TAILCALL)>;
-def : Pat<(X86tailcall (i32 texternalsym:$dst)),
- (TAILCALL)>;
-
-def : Pat<(X86tcret GR32:$dst, imm:$off),
- (TCRETURNri GR32:$dst, imm:$off)>;
-
-def : Pat<(X86tcret (i32 tglobaladdr:$dst), imm:$off),
- (TCRETURNdi texternalsym:$dst, imm:$off)>;
-
-def : Pat<(X86tcret (i32 texternalsym:$dst), imm:$off),
- (TCRETURNdi texternalsym:$dst, imm:$off)>;
-
-def : Pat<(X86call (i32 tglobaladdr:$dst)),
- (CALLpcrel32 tglobaladdr:$dst)>;
-def : Pat<(X86call (i32 texternalsym:$dst)),
- (CALLpcrel32 texternalsym:$dst)>;
-
-// X86 specific add which produces a flag.
-def : Pat<(addc GR32:$src1, GR32:$src2),
- (ADD32rr GR32:$src1, GR32:$src2)>;
-def : Pat<(addc GR32:$src1, (load addr:$src2)),
- (ADD32rm GR32:$src1, addr:$src2)>;
-def : Pat<(addc GR32:$src1, imm:$src2),
- (ADD32ri GR32:$src1, imm:$src2)>;
-def : Pat<(addc GR32:$src1, i32immSExt8:$src2),
- (ADD32ri8 GR32:$src1, i32immSExt8:$src2)>;
-
-def : Pat<(subc GR32:$src1, GR32:$src2),
- (SUB32rr GR32:$src1, GR32:$src2)>;
-def : Pat<(subc GR32:$src1, (load addr:$src2)),
- (SUB32rm GR32:$src1, addr:$src2)>;
-def : Pat<(subc GR32:$src1, imm:$src2),
- (SUB32ri GR32:$src1, imm:$src2)>;
-def : Pat<(subc GR32:$src1, i32immSExt8:$src2),
- (SUB32ri8 GR32:$src1, i32immSExt8:$src2)>;
-
-// Comparisons.
-
-// TEST R,R is smaller than CMP R,0
-def : Pat<(parallel (X86cmp GR8:$src1, 0), (implicit EFLAGS)),
- (TEST8rr GR8:$src1, GR8:$src1)>;
-def : Pat<(parallel (X86cmp GR16:$src1, 0), (implicit EFLAGS)),
- (TEST16rr GR16:$src1, GR16:$src1)>;
-def : Pat<(parallel (X86cmp GR32:$src1, 0), (implicit EFLAGS)),
- (TEST32rr GR32:$src1, GR32:$src1)>;
-
-// zextload bool -> zextload byte
-def : Pat<(zextloadi8i1 addr:$src), (MOV8rm addr:$src)>;
-def : Pat<(zextloadi16i1 addr:$src), (MOVZX16rm8 addr:$src)>;
-def : Pat<(zextloadi32i1 addr:$src), (MOVZX32rm8 addr:$src)>;
-
-// extload bool -> extload byte
-def : Pat<(extloadi8i1 addr:$src), (MOV8rm addr:$src)>;
-def : Pat<(extloadi16i1 addr:$src), (MOVZX16rm8 addr:$src)>;
-def : Pat<(extloadi32i1 addr:$src), (MOVZX32rm8 addr:$src)>;
-def : Pat<(extloadi16i8 addr:$src), (MOVZX16rm8 addr:$src)>;
-def : Pat<(extloadi32i8 addr:$src), (MOVZX32rm8 addr:$src)>;
-def : Pat<(extloadi32i16 addr:$src), (MOVZX32rm16 addr:$src)>;
-
-// anyext -> zext
-def : Pat<(i16 (anyext GR8 :$src)), (MOVZX16rr8 GR8 :$src)>;
-def : Pat<(i32 (anyext GR8 :$src)), (MOVZX32rr8 GR8 :$src)>;
-def : Pat<(i32 (anyext GR16:$src)), (MOVZX32rr16 GR16:$src)>;
-def : Pat<(i16 (anyext (loadi8 addr:$src))), (MOVZX16rm8 addr:$src)>;
-def : Pat<(i32 (anyext (loadi8 addr:$src))), (MOVZX32rm8 addr:$src)>;
-def : Pat<(i32 (anyext (loadi16 addr:$src))), (MOVZX32rm16 addr:$src)>;
-
-// (and (i32 load), 255) -> (zextload i8)
-def : Pat<(i32 (and (loadi32 addr:$src), (i32 255))), (MOVZX32rm8 addr:$src)>;
-def : Pat<(i32 (and (loadi32 addr:$src), (i32 65535))),(MOVZX32rm16 addr:$src)>;
-
-//===----------------------------------------------------------------------===//
-// Some peepholes
-//===----------------------------------------------------------------------===//
-
-// (shl x, 1) ==> (add x, x)
-def : Pat<(shl GR8 :$src1, (i8 1)), (ADD8rr GR8 :$src1, GR8 :$src1)>;
-def : Pat<(shl GR16:$src1, (i8 1)), (ADD16rr GR16:$src1, GR16:$src1)>;
-def : Pat<(shl GR32:$src1, (i8 1)), (ADD32rr GR32:$src1, GR32:$src1)>;
-
-// (or (x >> c) | (y << (32 - c))) ==> (shrd32 x, y, c)
-def : Pat<(or (srl GR32:$src1, CL:$amt),
- (shl GR32:$src2, (sub 32, CL:$amt))),
- (SHRD32rrCL GR32:$src1, GR32:$src2)>;
-
-def : Pat<(store (or (srl (loadi32 addr:$dst), CL:$amt),
- (shl GR32:$src2, (sub 32, CL:$amt))), addr:$dst),
- (SHRD32mrCL addr:$dst, GR32:$src2)>;
-
-// (or (x << c) | (y >> (32 - c))) ==> (shld32 x, y, c)
-def : Pat<(or (shl GR32:$src1, CL:$amt),
- (srl GR32:$src2, (sub 32, CL:$amt))),
- (SHLD32rrCL GR32:$src1, GR32:$src2)>;
-
-def : Pat<(store (or (shl (loadi32 addr:$dst), CL:$amt),
- (srl GR32:$src2, (sub 32, CL:$amt))), addr:$dst),
- (SHLD32mrCL addr:$dst, GR32:$src2)>;
-
-// (or (x >> c) | (y << (16 - c))) ==> (shrd16 x, y, c)
-def : Pat<(or (srl GR16:$src1, CL:$amt),
- (shl GR16:$src2, (sub 16, CL:$amt))),
- (SHRD16rrCL GR16:$src1, GR16:$src2)>;
-
-def : Pat<(store (or (srl (loadi16 addr:$dst), CL:$amt),
- (shl GR16:$src2, (sub 16, CL:$amt))), addr:$dst),
- (SHRD16mrCL addr:$dst, GR16:$src2)>;
-
-// (or (x << c) | (y >> (16 - c))) ==> (shld16 x, y, c)
-def : Pat<(or (shl GR16:$src1, CL:$amt),
- (srl GR16:$src2, (sub 16, CL:$amt))),
- (SHLD16rrCL GR16:$src1, GR16:$src2)>;
-
-def : Pat<(store (or (shl (loadi16 addr:$dst), CL:$amt),
- (srl GR16:$src2, (sub 16, CL:$amt))), addr:$dst),
- (SHLD16mrCL addr:$dst, GR16:$src2)>;
-
-//===----------------------------------------------------------------------===//
-// Floating Point Stack Support
-//===----------------------------------------------------------------------===//
-
-include "X86InstrFPStack.td"
-
-//===----------------------------------------------------------------------===//
-// X86-64 Support
-//===----------------------------------------------------------------------===//
-
-include "X86Instr64bit.td"
-
-//===----------------------------------------------------------------------===//
-// XMM Floating point support (requires SSE / SSE2)
-//===----------------------------------------------------------------------===//
-
-include "X86InstrSSE.td"
-
-//===----------------------------------------------------------------------===//
-// MMX and XMM Packed Integer support (requires MMX, SSE, and SSE2)
-//===----------------------------------------------------------------------===//
-
-include "X86InstrMMX.td"
diff --git a/release_23/lib/Target/X86/X86InstrMMX.td b/release_23/lib/Target/X86/X86InstrMMX.td
deleted file mode 100644
index 42f19af1f8b6..000000000000
--- a/release_23/lib/Target/X86/X86InstrMMX.td
+++ /dev/null
@@ -1,645 +0,0 @@
-//====- X86InstrMMX.td - Describe the X86 Instruction Set --*- tablegen -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file describes the X86 MMX instruction set, defining the instructions,
-// and properties of the instructions which are needed for code generation,
-// machine code emission, and analysis.
-//
-//===----------------------------------------------------------------------===//
-
-//===----------------------------------------------------------------------===//
-// MMX Pattern Fragments
-//===----------------------------------------------------------------------===//
-
-def load_mmx : PatFrag<(ops node:$ptr), (v1i64 (load node:$ptr))>;
-
-def bc_v8i8 : PatFrag<(ops node:$in), (v8i8 (bitconvert node:$in))>;
-def bc_v4i16 : PatFrag<(ops node:$in), (v4i16 (bitconvert node:$in))>;
-def bc_v2i32 : PatFrag<(ops node:$in), (v2i32 (bitconvert node:$in))>;
-def bc_v1i64 : PatFrag<(ops node:$in), (v1i64 (bitconvert node:$in))>;
-
-//===----------------------------------------------------------------------===//
-// MMX Masks
-//===----------------------------------------------------------------------===//
-
-// MMX_SHUFFLE_get_shuf_imm xform function: convert vector_shuffle mask to
-// PSHUFW imm.
-def MMX_SHUFFLE_get_shuf_imm : SDNodeXForm<build_vector, [{
- return getI8Imm(X86::getShuffleSHUFImmediate(N));
-}]>;
-
-// Patterns for: vector_shuffle v1, v2, <2, 6, 3, 7, ...>
-def MMX_UNPCKH_shuffle_mask : PatLeaf<(build_vector), [{
- return X86::isUNPCKHMask(N);
-}]>;
-
-// Patterns for: vector_shuffle v1, v2, <0, 4, 2, 5, ...>
-def MMX_UNPCKL_shuffle_mask : PatLeaf<(build_vector), [{
- return X86::isUNPCKLMask(N);
-}]>;
-
-// Patterns for: vector_shuffle v1, <undef>, <0, 0, 1, 1, ...>
-def MMX_UNPCKH_v_undef_shuffle_mask : PatLeaf<(build_vector), [{
- return X86::isUNPCKH_v_undef_Mask(N);
-}]>;
-
-// Patterns for: vector_shuffle v1, <undef>, <2, 2, 3, 3, ...>
-def MMX_UNPCKL_v_undef_shuffle_mask : PatLeaf<(build_vector), [{
- return X86::isUNPCKL_v_undef_Mask(N);
-}]>;
-
-// Patterns for shuffling.
-def MMX_PSHUFW_shuffle_mask : PatLeaf<(build_vector), [{
- return X86::isPSHUFDMask(N);
-}], MMX_SHUFFLE_get_shuf_imm>;
-
-// Patterns for: vector_shuffle v1, v2, <4, 5, 2, 3>; etc.
-def MMX_MOVL_shuffle_mask : PatLeaf<(build_vector), [{
- return X86::isMOVLMask(N);
-}]>;
-
-//===----------------------------------------------------------------------===//
-// MMX Multiclasses
-//===----------------------------------------------------------------------===//
-
-let isTwoAddress = 1 in {
- // MMXI_binop_rm - Simple MMX binary operator.
- multiclass MMXI_binop_rm<bits<8> opc, string OpcodeStr, SDNode OpNode,
- ValueType OpVT, bit Commutable = 0> {
- def rr : MMXI<opc, MRMSrcReg, (outs VR64:$dst), (ins VR64:$src1, VR64:$src2),
- !strconcat(OpcodeStr, "\t{$src2, $dst|$dst, $src2}"),
- [(set VR64:$dst, (OpVT (OpNode VR64:$src1, VR64:$src2)))]> {
- let isCommutable = Commutable;
- }
- def rm : MMXI<opc, MRMSrcMem, (outs VR64:$dst), (ins VR64:$src1, i64mem:$src2),
- !strconcat(OpcodeStr, "\t{$src2, $dst|$dst, $src2}"),
- [(set VR64:$dst, (OpVT (OpNode VR64:$src1,
- (bitconvert
- (load_mmx addr:$src2)))))]>;
- }
-
- multiclass MMXI_binop_rm_int<bits<8> opc, string OpcodeStr, Intrinsic IntId,
- bit Commutable = 0> {
- def rr : MMXI<opc, MRMSrcReg, (outs VR64:$dst), (ins VR64:$src1, VR64:$src2),
- !strconcat(OpcodeStr, "\t{$src2, $dst|$dst, $src2}"),
- [(set VR64:$dst, (IntId VR64:$src1, VR64:$src2))]> {
- let isCommutable = Commutable;
- }
- def rm : MMXI<opc, MRMSrcMem, (outs VR64:$dst), (ins VR64:$src1, i64mem:$src2),
- !strconcat(OpcodeStr, "\t{$src2, $dst|$dst, $src2}"),
- [(set VR64:$dst, (IntId VR64:$src1,
- (bitconvert (load_mmx addr:$src2))))]>;
- }
-
- // MMXI_binop_rm_v1i64 - Simple MMX binary operator whose type is v1i64.
- //
- // FIXME: we could eliminate this and use MMXI_binop_rm instead if tblgen knew
- // to collapse (bitconvert VT to VT) into its operand.
- //
- multiclass MMXI_binop_rm_v1i64<bits<8> opc, string OpcodeStr, SDNode OpNode,
- bit Commutable = 0> {
- def rr : MMXI<opc, MRMSrcReg, (outs VR64:$dst),
- (ins VR64:$src1, VR64:$src2),
- !strconcat(OpcodeStr, "\t{$src2, $dst|$dst, $src2}"),
- [(set VR64:$dst, (v1i64 (OpNode VR64:$src1, VR64:$src2)))]> {
- let isCommutable = Commutable;
- }
- def rm : MMXI<opc, MRMSrcMem, (outs VR64:$dst),
- (ins VR64:$src1, i64mem:$src2),
- !strconcat(OpcodeStr, "\t{$src2, $dst|$dst, $src2}"),
- [(set VR64:$dst,
- (OpNode VR64:$src1,(load_mmx addr:$src2)))]>;
- }
-
- multiclass MMXI_binop_rmi_int<bits<8> opc, bits<8> opc2, Format ImmForm,
- string OpcodeStr, Intrinsic IntId,
- Intrinsic IntId2> {
- def rr : MMXI<opc, MRMSrcReg, (outs VR64:$dst),
- (ins VR64:$src1, VR64:$src2),
- !strconcat(OpcodeStr, "\t{$src2, $dst|$dst, $src2}"),
- [(set VR64:$dst, (IntId VR64:$src1, VR64:$src2))]>;
- def rm : MMXI<opc, MRMSrcMem, (outs VR64:$dst),
- (ins VR64:$src1, i64mem:$src2),
- !strconcat(OpcodeStr, "\t{$src2, $dst|$dst, $src2}"),
- [(set VR64:$dst, (IntId VR64:$src1,
- (bitconvert (load_mmx addr:$src2))))]>;
- def ri : MMXIi8<opc2, ImmForm, (outs VR64:$dst),
- (ins VR64:$src1, i32i8imm:$src2),
- !strconcat(OpcodeStr, "\t{$src2, $dst|$dst, $src2}"),
- [(set VR64:$dst, (IntId2 VR64:$src1, (i32 imm:$src2)))]>;
- }
-}
-
-//===----------------------------------------------------------------------===//
-// MMX EMMS & FEMMS Instructions
-//===----------------------------------------------------------------------===//
-
-def MMX_EMMS : MMXI<0x77, RawFrm, (outs), (ins), "emms", [(int_x86_mmx_emms)]>;
-def MMX_FEMMS : MMXI<0x0E, RawFrm, (outs), (ins), "femms", [(int_x86_mmx_femms)]>;
-
-//===----------------------------------------------------------------------===//
-// MMX Scalar Instructions
-//===----------------------------------------------------------------------===//
-
-// Data Transfer Instructions
-def MMX_MOVD64rr : MMXI<0x6E, MRMSrcReg, (outs VR64:$dst), (ins GR32:$src),
- "movd\t{$src, $dst|$dst, $src}",
- [(set VR64:$dst, (v2i32 (scalar_to_vector GR32:$src)))]>;
-let isSimpleLoad = 1, isReMaterializable = 1 in
-def MMX_MOVD64rm : MMXI<0x6E, MRMSrcMem, (outs VR64:$dst), (ins i32mem:$src),
- "movd\t{$src, $dst|$dst, $src}",
- [(set VR64:$dst, (v2i32 (scalar_to_vector (loadi32 addr:$src))))]>;
-let mayStore = 1 in
-def MMX_MOVD64mr : MMXI<0x7E, MRMDestMem, (outs), (ins i32mem:$dst, VR64:$src),
- "movd\t{$src, $dst|$dst, $src}", []>;
-
-let neverHasSideEffects = 1 in
-def MMX_MOVD64to64rr : MMXRI<0x6E, MRMSrcReg, (outs VR64:$dst), (ins GR64:$src),
- "movd\t{$src, $dst|$dst, $src}", []>;
-
-let neverHasSideEffects = 1 in
-def MMX_MOVD64from64rr : MMXRI<0x7E, MRMSrcReg, (outs GR64:$dst), (ins VR64:$src),
- "movd\t{$src, $dst|$dst, $src}", []>;
-
-let neverHasSideEffects = 1 in
-def MMX_MOVQ64rr : MMXI<0x6F, MRMSrcReg, (outs VR64:$dst), (ins VR64:$src),
- "movq\t{$src, $dst|$dst, $src}", []>;
-let isSimpleLoad = 1, isReMaterializable = 1, mayHaveSideEffects = 1 in
-def MMX_MOVQ64rm : MMXI<0x6F, MRMSrcMem, (outs VR64:$dst), (ins i64mem:$src),
- "movq\t{$src, $dst|$dst, $src}",
- [(set VR64:$dst, (load_mmx addr:$src))]>;
-def MMX_MOVQ64mr : MMXI<0x7F, MRMDestMem, (outs), (ins i64mem:$dst, VR64:$src),
- "movq\t{$src, $dst|$dst, $src}",
- [(store (v1i64 VR64:$src), addr:$dst)]>;
-
-def MMX_MOVDQ2Qrr : MMXID<0xD6, MRMDestMem, (outs VR64:$dst), (ins VR128:$src),
- "movdq2q\t{$src, $dst|$dst, $src}",
- [(set VR64:$dst,
- (v1i64 (bitconvert
- (i64 (vector_extract (v2i64 VR128:$src),
- (iPTR 0))))))]>;
-
-def MMX_MOVQ2DQrr : MMXIS<0xD6, MRMDestMem, (outs VR128:$dst), (ins VR64:$src),
- "movq2dq\t{$src, $dst|$dst, $src}",
- [(set VR128:$dst,
- (v2i64 (vector_shuffle immAllZerosV,
- (v2i64 (scalar_to_vector (i64 (bitconvert VR64:$src)))),
- MOVL_shuffle_mask)))]>;
-
-def MMX_MOVNTQmr : MMXI<0xE7, MRMDestMem, (outs), (ins i64mem:$dst, VR64:$src),
- "movntq\t{$src, $dst|$dst, $src}",
- [(int_x86_mmx_movnt_dq addr:$dst, VR64:$src)]>;
-
-let AddedComplexity = 15 in
-// movd to MMX register zero-extends
-def MMX_MOVZDI2PDIrr : MMXI<0x6E, MRMSrcReg, (outs VR64:$dst), (ins GR32:$src),
- "movd\t{$src, $dst|$dst, $src}",
- [(set VR64:$dst,
- (v2i32 (X86vzmovl (v2i32 (scalar_to_vector GR32:$src)))))]>;
-let AddedComplexity = 20 in
-def MMX_MOVZDI2PDIrm : MMXI<0x6E, MRMSrcMem, (outs VR64:$dst), (ins i32mem:$src),
- "movd\t{$src, $dst|$dst, $src}",
- [(set VR64:$dst,
- (v2i32 (X86vzmovl (v2i32
- (scalar_to_vector (loadi32 addr:$src))))))]>;
-
-// Arithmetic Instructions
-
-// -- Addition
-defm MMX_PADDB : MMXI_binop_rm<0xFC, "paddb", add, v8i8, 1>;
-defm MMX_PADDW : MMXI_binop_rm<0xFD, "paddw", add, v4i16, 1>;
-defm MMX_PADDD : MMXI_binop_rm<0xFE, "paddd", add, v2i32, 1>;
-defm MMX_PADDQ : MMXI_binop_rm<0xD4, "paddq", add, v1i64, 1>;
-
-defm MMX_PADDSB : MMXI_binop_rm_int<0xEC, "paddsb" , int_x86_mmx_padds_b, 1>;
-defm MMX_PADDSW : MMXI_binop_rm_int<0xED, "paddsw" , int_x86_mmx_padds_w, 1>;
-
-defm MMX_PADDUSB : MMXI_binop_rm_int<0xDC, "paddusb", int_x86_mmx_paddus_b, 1>;
-defm MMX_PADDUSW : MMXI_binop_rm_int<0xDD, "paddusw", int_x86_mmx_paddus_w, 1>;
-
-// -- Subtraction
-defm MMX_PSUBB : MMXI_binop_rm<0xF8, "psubb", sub, v8i8>;
-defm MMX_PSUBW : MMXI_binop_rm<0xF9, "psubw", sub, v4i16>;
-defm MMX_PSUBD : MMXI_binop_rm<0xFA, "psubd", sub, v2i32>;
-defm MMX_PSUBQ : MMXI_binop_rm<0xFB, "psubq", sub, v1i64>;
-
-defm MMX_PSUBSB : MMXI_binop_rm_int<0xE8, "psubsb" , int_x86_mmx_psubs_b>;
-defm MMX_PSUBSW : MMXI_binop_rm_int<0xE9, "psubsw" , int_x86_mmx_psubs_w>;
-
-defm MMX_PSUBUSB : MMXI_binop_rm_int<0xD8, "psubusb", int_x86_mmx_psubus_b>;
-defm MMX_PSUBUSW : MMXI_binop_rm_int<0xD9, "psubusw", int_x86_mmx_psubus_w>;
-
-// -- Multiplication
-defm MMX_PMULLW : MMXI_binop_rm<0xD5, "pmullw", mul, v4i16, 1>;
-
-defm MMX_PMULHW : MMXI_binop_rm_int<0xE5, "pmulhw", int_x86_mmx_pmulh_w, 1>;
-defm MMX_PMULHUW : MMXI_binop_rm_int<0xE4, "pmulhuw", int_x86_mmx_pmulhu_w, 1>;
-defm MMX_PMULUDQ : MMXI_binop_rm_int<0xF4, "pmuludq", int_x86_mmx_pmulu_dq, 1>;
-
-// -- Miscellanea
-defm MMX_PMADDWD : MMXI_binop_rm_int<0xF5, "pmaddwd", int_x86_mmx_pmadd_wd, 1>;
-
-defm MMX_PAVGB : MMXI_binop_rm_int<0xE0, "pavgb", int_x86_mmx_pavg_b, 1>;
-defm MMX_PAVGW : MMXI_binop_rm_int<0xE3, "pavgw", int_x86_mmx_pavg_w, 1>;
-
-defm MMX_PMINUB : MMXI_binop_rm_int<0xDA, "pminub", int_x86_mmx_pminu_b, 1>;
-defm MMX_PMINSW : MMXI_binop_rm_int<0xEA, "pminsw", int_x86_mmx_pmins_w, 1>;
-
-defm MMX_PMAXUB : MMXI_binop_rm_int<0xDE, "pmaxub", int_x86_mmx_pmaxu_b, 1>;
-defm MMX_PMAXSW : MMXI_binop_rm_int<0xEE, "pmaxsw", int_x86_mmx_pmaxs_w, 1>;
-
-defm MMX_PSADBW : MMXI_binop_rm_int<0xE0, "psadbw", int_x86_mmx_psad_bw, 1>;
-
-// Logical Instructions
-defm MMX_PAND : MMXI_binop_rm_v1i64<0xDB, "pand", and, 1>;
-defm MMX_POR : MMXI_binop_rm_v1i64<0xEB, "por" , or, 1>;
-defm MMX_PXOR : MMXI_binop_rm_v1i64<0xEF, "pxor", xor, 1>;
-
-let isTwoAddress = 1 in {
- def MMX_PANDNrr : MMXI<0xDF, MRMSrcReg,
- (outs VR64:$dst), (ins VR64:$src1, VR64:$src2),
- "pandn\t{$src2, $dst|$dst, $src2}",
- [(set VR64:$dst, (v1i64 (and (vnot VR64:$src1),
- VR64:$src2)))]>;
- def MMX_PANDNrm : MMXI<0xDF, MRMSrcMem,
- (outs VR64:$dst), (ins VR64:$src1, i64mem:$src2),
- "pandn\t{$src2, $dst|$dst, $src2}",
- [(set VR64:$dst, (v1i64 (and (vnot VR64:$src1),
- (load addr:$src2))))]>;
-}
-
-// Shift Instructions
-defm MMX_PSRLW : MMXI_binop_rmi_int<0xD1, 0x71, MRM2r, "psrlw",
- int_x86_mmx_psrl_w, int_x86_mmx_psrli_w>;
-defm MMX_PSRLD : MMXI_binop_rmi_int<0xD2, 0x72, MRM2r, "psrld",
- int_x86_mmx_psrl_d, int_x86_mmx_psrli_d>;
-defm MMX_PSRLQ : MMXI_binop_rmi_int<0xD3, 0x73, MRM2r, "psrlq",
- int_x86_mmx_psrl_q, int_x86_mmx_psrli_q>;
-
-defm MMX_PSLLW : MMXI_binop_rmi_int<0xF1, 0x71, MRM6r, "psllw",
- int_x86_mmx_psll_w, int_x86_mmx_pslli_w>;
-defm MMX_PSLLD : MMXI_binop_rmi_int<0xF2, 0x72, MRM6r, "pslld",
- int_x86_mmx_psll_d, int_x86_mmx_pslli_d>;
-defm MMX_PSLLQ : MMXI_binop_rmi_int<0xF3, 0x73, MRM6r, "psllq",
- int_x86_mmx_psll_q, int_x86_mmx_pslli_q>;
-
-defm MMX_PSRAW : MMXI_binop_rmi_int<0xE1, 0x71, MRM4r, "psraw",
- int_x86_mmx_psra_w, int_x86_mmx_psrai_w>;
-defm MMX_PSRAD : MMXI_binop_rmi_int<0xE2, 0x72, MRM4r, "psrad",
- int_x86_mmx_psra_d, int_x86_mmx_psrai_d>;
-
-// Comparison Instructions
-defm MMX_PCMPEQB : MMXI_binop_rm_int<0x74, "pcmpeqb", int_x86_mmx_pcmpeq_b>;
-defm MMX_PCMPEQW : MMXI_binop_rm_int<0x75, "pcmpeqw", int_x86_mmx_pcmpeq_w>;
-defm MMX_PCMPEQD : MMXI_binop_rm_int<0x76, "pcmpeqd", int_x86_mmx_pcmpeq_d>;
-
-defm MMX_PCMPGTB : MMXI_binop_rm_int<0x64, "pcmpgtb", int_x86_mmx_pcmpgt_b>;
-defm MMX_PCMPGTW : MMXI_binop_rm_int<0x65, "pcmpgtw", int_x86_mmx_pcmpgt_w>;
-defm MMX_PCMPGTD : MMXI_binop_rm_int<0x66, "pcmpgtd", int_x86_mmx_pcmpgt_d>;
-
-// Conversion Instructions
-
-// -- Unpack Instructions
-let isTwoAddress = 1 in {
- // Unpack High Packed Data Instructions
- def MMX_PUNPCKHBWrr : MMXI<0x68, MRMSrcReg,
- (outs VR64:$dst), (ins VR64:$src1, VR64:$src2),
- "punpckhbw\t{$src2, $dst|$dst, $src2}",
- [(set VR64:$dst,
- (v8i8 (vector_shuffle VR64:$src1, VR64:$src2,
- MMX_UNPCKH_shuffle_mask)))]>;
- def MMX_PUNPCKHBWrm : MMXI<0x68, MRMSrcMem,
- (outs VR64:$dst), (ins VR64:$src1, i64mem:$src2),
- "punpckhbw\t{$src2, $dst|$dst, $src2}",
- [(set VR64:$dst,
- (v8i8 (vector_shuffle VR64:$src1,
- (bc_v8i8 (load_mmx addr:$src2)),
- MMX_UNPCKH_shuffle_mask)))]>;
-
- def MMX_PUNPCKHWDrr : MMXI<0x69, MRMSrcReg,
- (outs VR64:$dst), (ins VR64:$src1, VR64:$src2),
- "punpckhwd\t{$src2, $dst|$dst, $src2}",
- [(set VR64:$dst,
- (v4i16 (vector_shuffle VR64:$src1, VR64:$src2,
- MMX_UNPCKH_shuffle_mask)))]>;
- def MMX_PUNPCKHWDrm : MMXI<0x69, MRMSrcMem,
- (outs VR64:$dst), (ins VR64:$src1, i64mem:$src2),
- "punpckhwd\t{$src2, $dst|$dst, $src2}",
- [(set VR64:$dst,
- (v4i16 (vector_shuffle VR64:$src1,
- (bc_v4i16 (load_mmx addr:$src2)),
- MMX_UNPCKH_shuffle_mask)))]>;
-
- def MMX_PUNPCKHDQrr : MMXI<0x6A, MRMSrcReg,
- (outs VR64:$dst), (ins VR64:$src1, VR64:$src2),
- "punpckhdq\t{$src2, $dst|$dst, $src2}",
- [(set VR64:$dst,
- (v2i32 (vector_shuffle VR64:$src1, VR64:$src2,
- MMX_UNPCKH_shuffle_mask)))]>;
- def MMX_PUNPCKHDQrm : MMXI<0x6A, MRMSrcMem,
- (outs VR64:$dst), (ins VR64:$src1, i64mem:$src2),
- "punpckhdq\t{$src2, $dst|$dst, $src2}",
- [(set VR64:$dst,
- (v2i32 (vector_shuffle VR64:$src1,
- (bc_v2i32 (load_mmx addr:$src2)),
- MMX_UNPCKH_shuffle_mask)))]>;
-
- // Unpack Low Packed Data Instructions
- def MMX_PUNPCKLBWrr : MMXI<0x60, MRMSrcReg,
- (outs VR64:$dst), (ins VR64:$src1, VR64:$src2),
- "punpcklbw\t{$src2, $dst|$dst, $src2}",
- [(set VR64:$dst,
- (v8i8 (vector_shuffle VR64:$src1, VR64:$src2,
- MMX_UNPCKL_shuffle_mask)))]>;
- def MMX_PUNPCKLBWrm : MMXI<0x60, MRMSrcMem,
- (outs VR64:$dst), (ins VR64:$src1, i64mem:$src2),
- "punpcklbw\t{$src2, $dst|$dst, $src2}",
- [(set VR64:$dst,
- (v8i8 (vector_shuffle VR64:$src1,
- (bc_v8i8 (load_mmx addr:$src2)),
- MMX_UNPCKL_shuffle_mask)))]>;
-
- def MMX_PUNPCKLWDrr : MMXI<0x61, MRMSrcReg,
- (outs VR64:$dst), (ins VR64:$src1, VR64:$src2),
- "punpcklwd\t{$src2, $dst|$dst, $src2}",
- [(set VR64:$dst,
- (v4i16 (vector_shuffle VR64:$src1, VR64:$src2,
- MMX_UNPCKL_shuffle_mask)))]>;
- def MMX_PUNPCKLWDrm : MMXI<0x61, MRMSrcMem,
- (outs VR64:$dst), (ins VR64:$src1, i64mem:$src2),
- "punpcklwd\t{$src2, $dst|$dst, $src2}",
- [(set VR64:$dst,
- (v4i16 (vector_shuffle VR64:$src1,
- (bc_v4i16 (load_mmx addr:$src2)),
- MMX_UNPCKL_shuffle_mask)))]>;
-
- def MMX_PUNPCKLDQrr : MMXI<0x62, MRMSrcReg,
- (outs VR64:$dst), (ins VR64:$src1, VR64:$src2),
- "punpckldq\t{$src2, $dst|$dst, $src2}",
- [(set VR64:$dst,
- (v2i32 (vector_shuffle VR64:$src1, VR64:$src2,
- MMX_UNPCKL_shuffle_mask)))]>;
- def MMX_PUNPCKLDQrm : MMXI<0x62, MRMSrcMem,
- (outs VR64:$dst), (ins VR64:$src1, i64mem:$src2),
- "punpckldq\t{$src2, $dst|$dst, $src2}",
- [(set VR64:$dst,
- (v2i32 (vector_shuffle VR64:$src1,
- (bc_v2i32 (load_mmx addr:$src2)),
- MMX_UNPCKL_shuffle_mask)))]>;
-}
-
-// -- Pack Instructions
-defm MMX_PACKSSWB : MMXI_binop_rm_int<0x63, "packsswb", int_x86_mmx_packsswb>;
-defm MMX_PACKSSDW : MMXI_binop_rm_int<0x6B, "packssdw", int_x86_mmx_packssdw>;
-defm MMX_PACKUSWB : MMXI_binop_rm_int<0x67, "packuswb", int_x86_mmx_packuswb>;
-
-// -- Shuffle Instructions
-def MMX_PSHUFWri : MMXIi8<0x70, MRMSrcReg,
- (outs VR64:$dst), (ins VR64:$src1, i8imm:$src2),
- "pshufw\t{$src2, $src1, $dst|$dst, $src1, $src2}",
- [(set VR64:$dst,
- (v4i16 (vector_shuffle
- VR64:$src1, (undef),
- MMX_PSHUFW_shuffle_mask:$src2)))]>;
-def MMX_PSHUFWmi : MMXIi8<0x70, MRMSrcMem,
- (outs VR64:$dst), (ins i64mem:$src1, i8imm:$src2),
- "pshufw\t{$src2, $src1, $dst|$dst, $src1, $src2}",
- [(set VR64:$dst,
- (v4i16 (vector_shuffle
- (bc_v4i16 (load_mmx addr:$src1)),
- (undef),
- MMX_PSHUFW_shuffle_mask:$src2)))]>;
-
-// -- Conversion Instructions
-let neverHasSideEffects = 1 in {
-def MMX_CVTPD2PIrr : MMX2I<0x2D, MRMSrcReg, (outs VR64:$dst), (ins VR128:$src),
- "cvtpd2pi\t{$src, $dst|$dst, $src}", []>;
-let mayLoad = 1 in
-def MMX_CVTPD2PIrm : MMX2I<0x2D, MRMSrcMem, (outs VR64:$dst), (ins f128mem:$src),
- "cvtpd2pi\t{$src, $dst|$dst, $src}", []>;
-
-def MMX_CVTPI2PDrr : MMX2I<0x2A, MRMSrcReg, (outs VR128:$dst), (ins VR64:$src),
- "cvtpi2pd\t{$src, $dst|$dst, $src}", []>;
-let mayLoad = 1 in
-def MMX_CVTPI2PDrm : MMX2I<0x2A, MRMSrcMem, (outs VR128:$dst), (ins i64mem:$src),
- "cvtpi2pd\t{$src, $dst|$dst, $src}", []>;
-
-def MMX_CVTPI2PSrr : MMXI<0x2A, MRMSrcReg, (outs VR128:$dst), (ins VR64:$src),
- "cvtpi2ps\t{$src, $dst|$dst, $src}", []>;
-let mayLoad = 1 in
-def MMX_CVTPI2PSrm : MMXI<0x2A, MRMSrcMem, (outs VR128:$dst), (ins i64mem:$src),
- "cvtpi2ps\t{$src, $dst|$dst, $src}", []>;
-
-def MMX_CVTPS2PIrr : MMXI<0x2D, MRMSrcReg, (outs VR64:$dst), (ins VR128:$src),
- "cvtps2pi\t{$src, $dst|$dst, $src}", []>;
-let mayLoad = 1 in
-def MMX_CVTPS2PIrm : MMXI<0x2D, MRMSrcMem, (outs VR64:$dst), (ins f64mem:$src),
- "cvtps2pi\t{$src, $dst|$dst, $src}", []>;
-
-def MMX_CVTTPD2PIrr : MMX2I<0x2C, MRMSrcReg, (outs VR64:$dst), (ins VR128:$src),
- "cvttpd2pi\t{$src, $dst|$dst, $src}", []>;
-let mayLoad = 1 in
-def MMX_CVTTPD2PIrm : MMX2I<0x2C, MRMSrcMem, (outs VR64:$dst), (ins f128mem:$src),
- "cvttpd2pi\t{$src, $dst|$dst, $src}", []>;
-
-def MMX_CVTTPS2PIrr : MMXI<0x2C, MRMSrcReg, (outs VR64:$dst), (ins VR128:$src),
- "cvttps2pi\t{$src, $dst|$dst, $src}", []>;
-let mayLoad = 1 in
-def MMX_CVTTPS2PIrm : MMXI<0x2C, MRMSrcMem, (outs VR64:$dst), (ins f64mem:$src),
- "cvttps2pi\t{$src, $dst|$dst, $src}", []>;
-} // end neverHasSideEffects
-
-
-// Extract / Insert
-def MMX_X86pextrw : SDNode<"X86ISD::PEXTRW", SDTypeProfile<1, 2, []>, []>;
-def MMX_X86pinsrw : SDNode<"X86ISD::PINSRW", SDTypeProfile<1, 3, []>, []>;
-
-def MMX_PEXTRWri : MMXIi8<0xC5, MRMSrcReg,
- (outs GR32:$dst), (ins VR64:$src1, i16i8imm:$src2),
- "pextrw\t{$src2, $src1, $dst|$dst, $src1, $src2}",
- [(set GR32:$dst, (MMX_X86pextrw (v4i16 VR64:$src1),
- (iPTR imm:$src2)))]>;
-let isTwoAddress = 1 in {
- def MMX_PINSRWrri : MMXIi8<0xC4, MRMSrcReg,
- (outs VR64:$dst), (ins VR64:$src1, GR32:$src2, i16i8imm:$src3),
- "pinsrw\t{$src3, $src2, $dst|$dst, $src2, $src3}",
- [(set VR64:$dst, (v4i16 (MMX_X86pinsrw (v4i16 VR64:$src1),
- GR32:$src2, (iPTR imm:$src3))))]>;
- def MMX_PINSRWrmi : MMXIi8<0xC4, MRMSrcMem,
- (outs VR64:$dst), (ins VR64:$src1, i16mem:$src2, i16i8imm:$src3),
- "pinsrw\t{$src3, $src2, $dst|$dst, $src2, $src3}",
- [(set VR64:$dst,
- (v4i16 (MMX_X86pinsrw (v4i16 VR64:$src1),
- (i32 (anyext (loadi16 addr:$src2))),
- (iPTR imm:$src3))))]>;
-}
-
-// Mask creation
-def MMX_PMOVMSKBrr : MMXI<0xD7, MRMSrcReg, (outs GR32:$dst), (ins VR64:$src),
- "pmovmskb\t{$src, $dst|$dst, $src}",
- [(set GR32:$dst, (int_x86_mmx_pmovmskb VR64:$src))]>;
-
-// Misc.
-let Uses = [EDI] in
-def MMX_MASKMOVQ : MMXI<0xF7, MRMDestMem, (outs), (ins VR64:$src, VR64:$mask),
- "maskmovq\t{$mask, $src|$src, $mask}",
- [(int_x86_mmx_maskmovq VR64:$src, VR64:$mask, EDI)]>;
-
-//===----------------------------------------------------------------------===//
-// Alias Instructions
-//===----------------------------------------------------------------------===//
-
-// Alias instructions that map zero vector to pxor.
-let isReMaterializable = 1 in {
- def MMX_V_SET0 : MMXI<0xEF, MRMInitReg, (outs VR64:$dst), (ins),
- "pxor\t$dst, $dst",
- [(set VR64:$dst, (v2i32 immAllZerosV))]>;
- def MMX_V_SETALLONES : MMXI<0x76, MRMInitReg, (outs VR64:$dst), (ins),
- "pcmpeqd\t$dst, $dst",
- [(set VR64:$dst, (v2i32 immAllOnesV))]>;
-}
-
-let Predicates = [HasMMX] in {
- def : Pat<(v1i64 immAllZerosV), (MMX_V_SET0)>;
- def : Pat<(v4i16 immAllZerosV), (MMX_V_SET0)>;
- def : Pat<(v8i8 immAllZerosV), (MMX_V_SET0)>;
-}
-
-//===----------------------------------------------------------------------===//
-// Non-Instruction Patterns
-//===----------------------------------------------------------------------===//
-
-// Store 64-bit integer vector values.
-def : Pat<(store (v8i8 VR64:$src), addr:$dst),
- (MMX_MOVQ64mr addr:$dst, VR64:$src)>;
-def : Pat<(store (v4i16 VR64:$src), addr:$dst),
- (MMX_MOVQ64mr addr:$dst, VR64:$src)>;
-def : Pat<(store (v2i32 VR64:$src), addr:$dst),
- (MMX_MOVQ64mr addr:$dst, VR64:$src)>;
-def : Pat<(store (v1i64 VR64:$src), addr:$dst),
- (MMX_MOVQ64mr addr:$dst, VR64:$src)>;
-
-// Bit convert.
-def : Pat<(v8i8 (bitconvert (v1i64 VR64:$src))), (v8i8 VR64:$src)>;
-def : Pat<(v8i8 (bitconvert (v2i32 VR64:$src))), (v8i8 VR64:$src)>;
-def : Pat<(v8i8 (bitconvert (v4i16 VR64:$src))), (v8i8 VR64:$src)>;
-def : Pat<(v4i16 (bitconvert (v1i64 VR64:$src))), (v4i16 VR64:$src)>;
-def : Pat<(v4i16 (bitconvert (v2i32 VR64:$src))), (v4i16 VR64:$src)>;
-def : Pat<(v4i16 (bitconvert (v8i8 VR64:$src))), (v4i16 VR64:$src)>;
-def : Pat<(v2i32 (bitconvert (v1i64 VR64:$src))), (v2i32 VR64:$src)>;
-def : Pat<(v2i32 (bitconvert (v4i16 VR64:$src))), (v2i32 VR64:$src)>;
-def : Pat<(v2i32 (bitconvert (v8i8 VR64:$src))), (v2i32 VR64:$src)>;
-def : Pat<(v1i64 (bitconvert (v2i32 VR64:$src))), (v1i64 VR64:$src)>;
-def : Pat<(v1i64 (bitconvert (v4i16 VR64:$src))), (v1i64 VR64:$src)>;
-def : Pat<(v1i64 (bitconvert (v8i8 VR64:$src))), (v1i64 VR64:$src)>;
-
-// 64-bit bit convert.
-def : Pat<(v1i64 (bitconvert (i64 GR64:$src))),
- (MMX_MOVD64to64rr GR64:$src)>;
-def : Pat<(v2i32 (bitconvert (i64 GR64:$src))),
- (MMX_MOVD64to64rr GR64:$src)>;
-def : Pat<(v4i16 (bitconvert (i64 GR64:$src))),
- (MMX_MOVD64to64rr GR64:$src)>;
-def : Pat<(v8i8 (bitconvert (i64 GR64:$src))),
- (MMX_MOVD64to64rr GR64:$src)>;
-def : Pat<(i64 (bitconvert (v1i64 VR64:$src))),
- (MMX_MOVD64from64rr VR64:$src)>;
-def : Pat<(i64 (bitconvert (v2i32 VR64:$src))),
- (MMX_MOVD64from64rr VR64:$src)>;
-def : Pat<(i64 (bitconvert (v4i16 VR64:$src))),
- (MMX_MOVD64from64rr VR64:$src)>;
-def : Pat<(i64 (bitconvert (v8i8 VR64:$src))),
- (MMX_MOVD64from64rr VR64:$src)>;
-
-// Move scalar to XMM zero-extended
-// movd to XMM register zero-extends
-let AddedComplexity = 15 in {
- def : Pat<(v8i8 (X86vzmovl (bc_v8i8 (v2i32 (scalar_to_vector GR32:$src))))),
- (MMX_MOVZDI2PDIrr GR32:$src)>;
- def : Pat<(v4i16 (X86vzmovl (bc_v4i16 (v2i32 (scalar_to_vector GR32:$src))))),
- (MMX_MOVZDI2PDIrr GR32:$src)>;
-}
-
-// Scalar to v4i16 / v8i8. The source may be a GR32, but only the lower
-// 8 or 16-bits matter.
-def : Pat<(bc_v8i8 (v2i32 (scalar_to_vector GR32:$src))),
- (MMX_MOVD64rr GR32:$src)>;
-def : Pat<(bc_v4i16 (v2i32 (scalar_to_vector GR32:$src))),
- (MMX_MOVD64rr GR32:$src)>;
-
-// Patterns to perform canonical versions of vector shuffling.
-let AddedComplexity = 10 in {
- def : Pat<(v8i8 (vector_shuffle VR64:$src, (undef),
- MMX_UNPCKL_v_undef_shuffle_mask)),
- (MMX_PUNPCKLBWrr VR64:$src, VR64:$src)>;
- def : Pat<(v4i16 (vector_shuffle VR64:$src, (undef),
- MMX_UNPCKL_v_undef_shuffle_mask)),
- (MMX_PUNPCKLWDrr VR64:$src, VR64:$src)>;
- def : Pat<(v2i32 (vector_shuffle VR64:$src, (undef),
- MMX_UNPCKL_v_undef_shuffle_mask)),
- (MMX_PUNPCKLDQrr VR64:$src, VR64:$src)>;
-}
-
-let AddedComplexity = 10 in {
- def : Pat<(v8i8 (vector_shuffle VR64:$src, (undef),
- MMX_UNPCKH_v_undef_shuffle_mask)),
- (MMX_PUNPCKHBWrr VR64:$src, VR64:$src)>;
- def : Pat<(v4i16 (vector_shuffle VR64:$src, (undef),
- MMX_UNPCKH_v_undef_shuffle_mask)),
- (MMX_PUNPCKHWDrr VR64:$src, VR64:$src)>;
- def : Pat<(v2i32 (vector_shuffle VR64:$src, (undef),
- MMX_UNPCKH_v_undef_shuffle_mask)),
- (MMX_PUNPCKHDQrr VR64:$src, VR64:$src)>;
-}
-
-// Patterns to perform vector shuffling with a zeroed out vector.
-let AddedComplexity = 20 in {
- def : Pat<(bc_v2i32 (vector_shuffle immAllZerosV,
- (v2i32 (scalar_to_vector (load_mmx addr:$src))),
- MMX_UNPCKL_shuffle_mask)),
- (MMX_PUNPCKLDQrm VR64:$src, VR64:$src)>;
-}
-
-// Some special case PANDN patterns.
-// FIXME: Get rid of these.
-def : Pat<(v1i64 (and (xor VR64:$src1, (bc_v1i64 (v2i32 immAllOnesV))),
- VR64:$src2)),
- (MMX_PANDNrr VR64:$src1, VR64:$src2)>;
-def : Pat<(v1i64 (and (xor VR64:$src1, (bc_v1i64 (v4i16 immAllOnesV_bc))),
- VR64:$src2)),
- (MMX_PANDNrr VR64:$src1, VR64:$src2)>;
-def : Pat<(v1i64 (and (xor VR64:$src1, (bc_v1i64 (v8i8 immAllOnesV_bc))),
- VR64:$src2)),
- (MMX_PANDNrr VR64:$src1, VR64:$src2)>;
-
-def : Pat<(v1i64 (and (xor VR64:$src1, (bc_v1i64 (v2i32 immAllOnesV))),
- (load addr:$src2))),
- (MMX_PANDNrm VR64:$src1, addr:$src2)>;
-def : Pat<(v1i64 (and (xor VR64:$src1, (bc_v1i64 (v4i16 immAllOnesV_bc))),
- (load addr:$src2))),
- (MMX_PANDNrm VR64:$src1, addr:$src2)>;
-def : Pat<(v1i64 (and (xor VR64:$src1, (bc_v1i64 (v8i8 immAllOnesV_bc))),
- (load addr:$src2))),
- (MMX_PANDNrm VR64:$src1, addr:$src2)>;
-
-// Move MMX to lower 64-bit of XMM
-def : Pat<(v2i64 (scalar_to_vector (i64 (bitconvert VR64:$src)))),
- (v2i64 (MMX_MOVQ2DQrr VR64:$src))>;
-
-// Move lower 64-bit of XMM to MMX.
-def : Pat<(v2i32 (bitconvert (i64 (vector_extract (v2i64 VR128:$src),
- (iPTR 0))))),
- (v2i32 (MMX_MOVDQ2Qrr VR128:$src))>;
-def : Pat<(v4i16 (bitconvert (i64 (vector_extract (v2i64 VR128:$src),
- (iPTR 0))))),
- (v4i16 (MMX_MOVDQ2Qrr VR128:$src))>;
-def : Pat<(v8i8 (bitconvert (i64 (vector_extract (v2i64 VR128:$src),
- (iPTR 0))))),
- (v8i8 (MMX_MOVDQ2Qrr VR128:$src))>;
-
diff --git a/release_23/lib/Target/X86/X86InstrSSE.td b/release_23/lib/Target/X86/X86InstrSSE.td
deleted file mode 100644
index e19b97e1ab6b..000000000000
--- a/release_23/lib/Target/X86/X86InstrSSE.td
+++ /dev/null
@@ -1,3457 +0,0 @@
-//====- X86InstrSSE.td - Describe the X86 Instruction Set --*- tablegen -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file describes the X86 SSE instruction set, defining the instructions,
-// and properties of the instructions which are needed for code generation,
-// machine code emission, and analysis.
-//
-//===----------------------------------------------------------------------===//
-
-
-//===----------------------------------------------------------------------===//
-// SSE specific DAG Nodes.
-//===----------------------------------------------------------------------===//
-
-def SDTX86FPShiftOp : SDTypeProfile<1, 2, [ SDTCisSameAs<0, 1>,
- SDTCisFP<0>, SDTCisInt<2> ]>;
-
-def X86fmin : SDNode<"X86ISD::FMIN", SDTFPBinOp>;
-def X86fmax : SDNode<"X86ISD::FMAX", SDTFPBinOp>;
-def X86fand : SDNode<"X86ISD::FAND", SDTFPBinOp,
- [SDNPCommutative, SDNPAssociative]>;
-def X86for : SDNode<"X86ISD::FOR", SDTFPBinOp,
- [SDNPCommutative, SDNPAssociative]>;
-def X86fxor : SDNode<"X86ISD::FXOR", SDTFPBinOp,
- [SDNPCommutative, SDNPAssociative]>;
-def X86frsqrt : SDNode<"X86ISD::FRSQRT", SDTFPUnaryOp>;
-def X86frcp : SDNode<"X86ISD::FRCP", SDTFPUnaryOp>;
-def X86fsrl : SDNode<"X86ISD::FSRL", SDTX86FPShiftOp>;
-def X86comi : SDNode<"X86ISD::COMI", SDTX86CmpTest>;
-def X86ucomi : SDNode<"X86ISD::UCOMI", SDTX86CmpTest>;
-def X86pextrb : SDNode<"X86ISD::PEXTRB",
- SDTypeProfile<1, 2, [SDTCisVT<0, i32>, SDTCisPtrTy<2>]>>;
-def X86pextrw : SDNode<"X86ISD::PEXTRW",
- SDTypeProfile<1, 2, [SDTCisVT<0, i32>, SDTCisPtrTy<2>]>>;
-def X86pinsrb : SDNode<"X86ISD::PINSRB",
- SDTypeProfile<1, 3, [SDTCisVT<0, v16i8>, SDTCisSameAs<0,1>,
- SDTCisVT<2, i32>, SDTCisPtrTy<3>]>>;
-def X86pinsrw : SDNode<"X86ISD::PINSRW",
- SDTypeProfile<1, 3, [SDTCisVT<0, v8i16>, SDTCisSameAs<0,1>,
- SDTCisVT<2, i32>, SDTCisPtrTy<3>]>>;
-def X86insrtps : SDNode<"X86ISD::INSERTPS",
- SDTypeProfile<1, 3, [SDTCisVT<0, v4f32>, SDTCisSameAs<0,1>,
- SDTCisVT<2, f32>, SDTCisPtrTy<3>]>>;
-def X86vzmovl : SDNode<"X86ISD::VZEXT_MOVL",
- SDTypeProfile<1, 1, [SDTCisSameAs<0,1>]>>;
-def X86vzload : SDNode<"X86ISD::VZEXT_LOAD", SDTLoad,
- [SDNPHasChain, SDNPMayLoad]>;
-
-//===----------------------------------------------------------------------===//
-// SSE Complex Patterns
-//===----------------------------------------------------------------------===//
-
-// These are 'extloads' from a scalar to the low element of a vector, zeroing
-// the top elements. These are used for the SSE 'ss' and 'sd' instruction
-// forms.
-def sse_load_f32 : ComplexPattern<v4f32, 4, "SelectScalarSSELoad", [],
- [SDNPHasChain, SDNPMayLoad]>;
-def sse_load_f64 : ComplexPattern<v2f64, 4, "SelectScalarSSELoad", [],
- [SDNPHasChain, SDNPMayLoad]>;
-
-def ssmem : Operand<v4f32> {
- let PrintMethod = "printf32mem";
- let MIOperandInfo = (ops ptr_rc, i8imm, ptr_rc, i32imm);
-}
-def sdmem : Operand<v2f64> {
- let PrintMethod = "printf64mem";
- let MIOperandInfo = (ops ptr_rc, i8imm, ptr_rc, i32imm);
-}
-
-//===----------------------------------------------------------------------===//
-// SSE pattern fragments
-//===----------------------------------------------------------------------===//
-
-def loadv4f32 : PatFrag<(ops node:$ptr), (v4f32 (load node:$ptr))>;
-def loadv2f64 : PatFrag<(ops node:$ptr), (v2f64 (load node:$ptr))>;
-def loadv4i32 : PatFrag<(ops node:$ptr), (v4i32 (load node:$ptr))>;
-def loadv2i64 : PatFrag<(ops node:$ptr), (v2i64 (load node:$ptr))>;
-
-// Like 'store', but always requires vector alignment.
-def alignedstore : PatFrag<(ops node:$val, node:$ptr),
- (st node:$val, node:$ptr), [{
- if (StoreSDNode *ST = dyn_cast<StoreSDNode>(N))
- return !ST->isTruncatingStore() &&
- ST->getAddressingMode() == ISD::UNINDEXED &&
- ST->getAlignment() >= 16;
- return false;
-}]>;
-
-// Like 'load', but always requires vector alignment.
-def alignedload : PatFrag<(ops node:$ptr), (ld node:$ptr), [{
- if (LoadSDNode *LD = dyn_cast<LoadSDNode>(N))
- return LD->getExtensionType() == ISD::NON_EXTLOAD &&
- LD->getAddressingMode() == ISD::UNINDEXED &&
- LD->getAlignment() >= 16;
- return false;
-}]>;
-
-def alignedloadfsf32 : PatFrag<(ops node:$ptr), (f32 (alignedload node:$ptr))>;
-def alignedloadfsf64 : PatFrag<(ops node:$ptr), (f64 (alignedload node:$ptr))>;
-def alignedloadv4f32 : PatFrag<(ops node:$ptr), (v4f32 (alignedload node:$ptr))>;
-def alignedloadv2f64 : PatFrag<(ops node:$ptr), (v2f64 (alignedload node:$ptr))>;
-def alignedloadv4i32 : PatFrag<(ops node:$ptr), (v4i32 (alignedload node:$ptr))>;
-def alignedloadv2i64 : PatFrag<(ops node:$ptr), (v2i64 (alignedload node:$ptr))>;
-
-// Like 'load', but uses special alignment checks suitable for use in
-// memory operands in most SSE instructions, which are required to
-// be naturally aligned on some targets but not on others.
-// FIXME: Actually implement support for targets that don't require the
-// alignment. This probably wants a subtarget predicate.
-def memop : PatFrag<(ops node:$ptr), (ld node:$ptr), [{
- if (LoadSDNode *LD = dyn_cast<LoadSDNode>(N))
- return LD->getExtensionType() == ISD::NON_EXTLOAD &&
- LD->getAddressingMode() == ISD::UNINDEXED &&
- LD->getAlignment() >= 16;
- return false;
-}]>;
-
-def memopfsf32 : PatFrag<(ops node:$ptr), (f32 (memop node:$ptr))>;
-def memopfsf64 : PatFrag<(ops node:$ptr), (f64 (memop node:$ptr))>;
-def memopv4f32 : PatFrag<(ops node:$ptr), (v4f32 (memop node:$ptr))>;
-def memopv2f64 : PatFrag<(ops node:$ptr), (v2f64 (memop node:$ptr))>;
-def memopv4i32 : PatFrag<(ops node:$ptr), (v4i32 (memop node:$ptr))>;
-def memopv2i64 : PatFrag<(ops node:$ptr), (v2i64 (memop node:$ptr))>;
-def memopv16i8 : PatFrag<(ops node:$ptr), (v16i8 (memop node:$ptr))>;
-
-// SSSE3 uses MMX registers for some instructions. They aren't aligned on a
-// 16-byte boundary.
-// FIXME: 8 byte alignment for mmx reads is not required
-def memop64 : PatFrag<(ops node:$ptr), (ld node:$ptr), [{
- if (LoadSDNode *LD = dyn_cast<LoadSDNode>(N))
- return LD->getExtensionType() == ISD::NON_EXTLOAD &&
- LD->getAddressingMode() == ISD::UNINDEXED &&
- LD->getAlignment() >= 8;
- return false;
-}]>;
-
-def memopv8i8 : PatFrag<(ops node:$ptr), (v8i8 (memop64 node:$ptr))>;
-def memopv4i16 : PatFrag<(ops node:$ptr), (v4i16 (memop64 node:$ptr))>;
-def memopv8i16 : PatFrag<(ops node:$ptr), (v8i16 (memop64 node:$ptr))>;
-def memopv2i32 : PatFrag<(ops node:$ptr), (v2i32 (memop64 node:$ptr))>;
-
-def bc_v4f32 : PatFrag<(ops node:$in), (v4f32 (bitconvert node:$in))>;
-def bc_v2f64 : PatFrag<(ops node:$in), (v2f64 (bitconvert node:$in))>;
-def bc_v16i8 : PatFrag<(ops node:$in), (v16i8 (bitconvert node:$in))>;
-def bc_v8i16 : PatFrag<(ops node:$in), (v8i16 (bitconvert node:$in))>;
-def bc_v4i32 : PatFrag<(ops node:$in), (v4i32 (bitconvert node:$in))>;
-def bc_v2i64 : PatFrag<(ops node:$in), (v2i64 (bitconvert node:$in))>;
-
-def fp32imm0 : PatLeaf<(f32 fpimm), [{
- return N->isExactlyValue(+0.0);
-}]>;
-
-def PSxLDQ_imm : SDNodeXForm<imm, [{
- // Transformation function: imm >> 3
- return getI32Imm(N->getValue() >> 3);
-}]>;
-
-// SHUFFLE_get_shuf_imm xform function: convert vector_shuffle mask to PSHUF*,
-// SHUFP* etc. imm.
-def SHUFFLE_get_shuf_imm : SDNodeXForm<build_vector, [{
- return getI8Imm(X86::getShuffleSHUFImmediate(N));
-}]>;
-
-// SHUFFLE_get_pshufhw_imm xform function: convert vector_shuffle mask to
-// PSHUFHW imm.
-def SHUFFLE_get_pshufhw_imm : SDNodeXForm<build_vector, [{
- return getI8Imm(X86::getShufflePSHUFHWImmediate(N));
-}]>;
-
-// SHUFFLE_get_pshuflw_imm xform function: convert vector_shuffle mask to
-// PSHUFLW imm.
-def SHUFFLE_get_pshuflw_imm : SDNodeXForm<build_vector, [{
- return getI8Imm(X86::getShufflePSHUFLWImmediate(N));
-}]>;
-
-def SSE_splat_mask : PatLeaf<(build_vector), [{
- return X86::isSplatMask(N);
-}], SHUFFLE_get_shuf_imm>;
-
-def SSE_splat_lo_mask : PatLeaf<(build_vector), [{
- return X86::isSplatLoMask(N);
-}]>;
-
-def MOVHLPS_shuffle_mask : PatLeaf<(build_vector), [{
- return X86::isMOVHLPSMask(N);
-}]>;
-
-def MOVHLPS_v_undef_shuffle_mask : PatLeaf<(build_vector), [{
- return X86::isMOVHLPS_v_undef_Mask(N);
-}]>;
-
-def MOVHP_shuffle_mask : PatLeaf<(build_vector), [{
- return X86::isMOVHPMask(N);
-}]>;
-
-def MOVLP_shuffle_mask : PatLeaf<(build_vector), [{
- return X86::isMOVLPMask(N);
-}]>;
-
-def MOVL_shuffle_mask : PatLeaf<(build_vector), [{
- return X86::isMOVLMask(N);
-}]>;
-
-def MOVSHDUP_shuffle_mask : PatLeaf<(build_vector), [{
- return X86::isMOVSHDUPMask(N);
-}]>;
-
-def MOVSLDUP_shuffle_mask : PatLeaf<(build_vector), [{
- return X86::isMOVSLDUPMask(N);
-}]>;
-
-def UNPCKL_shuffle_mask : PatLeaf<(build_vector), [{
- return X86::isUNPCKLMask(N);
-}]>;
-
-def UNPCKH_shuffle_mask : PatLeaf<(build_vector), [{
- return X86::isUNPCKHMask(N);
-}]>;
-
-def UNPCKL_v_undef_shuffle_mask : PatLeaf<(build_vector), [{
- return X86::isUNPCKL_v_undef_Mask(N);
-}]>;
-
-def UNPCKH_v_undef_shuffle_mask : PatLeaf<(build_vector), [{
- return X86::isUNPCKH_v_undef_Mask(N);
-}]>;
-
-def PSHUFD_shuffle_mask : PatLeaf<(build_vector), [{
- return X86::isPSHUFDMask(N);
-}], SHUFFLE_get_shuf_imm>;
-
-def PSHUFHW_shuffle_mask : PatLeaf<(build_vector), [{
- return X86::isPSHUFHWMask(N);
-}], SHUFFLE_get_pshufhw_imm>;
-
-def PSHUFLW_shuffle_mask : PatLeaf<(build_vector), [{
- return X86::isPSHUFLWMask(N);
-}], SHUFFLE_get_pshuflw_imm>;
-
-def SHUFP_unary_shuffle_mask : PatLeaf<(build_vector), [{
- return X86::isPSHUFDMask(N);
-}], SHUFFLE_get_shuf_imm>;
-
-def SHUFP_shuffle_mask : PatLeaf<(build_vector), [{
- return X86::isSHUFPMask(N);
-}], SHUFFLE_get_shuf_imm>;
-
-def PSHUFD_binary_shuffle_mask : PatLeaf<(build_vector), [{
- return X86::isSHUFPMask(N);
-}], SHUFFLE_get_shuf_imm>;
-
-//===----------------------------------------------------------------------===//
-// SSE scalar FP Instructions
-//===----------------------------------------------------------------------===//
-
-// CMOV* - Used to implement the SSE SELECT DAG operation. Expanded by the
-// scheduler into a branch sequence.
-// These are expanded by the scheduler.
-let Uses = [EFLAGS], usesCustomDAGSchedInserter = 1 in {
- def CMOV_FR32 : I<0, Pseudo,
- (outs FR32:$dst), (ins FR32:$t, FR32:$f, i8imm:$cond),
- "#CMOV_FR32 PSEUDO!",
- [(set FR32:$dst, (X86cmov FR32:$t, FR32:$f, imm:$cond,
- EFLAGS))]>;
- def CMOV_FR64 : I<0, Pseudo,
- (outs FR64:$dst), (ins FR64:$t, FR64:$f, i8imm:$cond),
- "#CMOV_FR64 PSEUDO!",
- [(set FR64:$dst, (X86cmov FR64:$t, FR64:$f, imm:$cond,
- EFLAGS))]>;
- def CMOV_V4F32 : I<0, Pseudo,
- (outs VR128:$dst), (ins VR128:$t, VR128:$f, i8imm:$cond),
- "#CMOV_V4F32 PSEUDO!",
- [(set VR128:$dst,
- (v4f32 (X86cmov VR128:$t, VR128:$f, imm:$cond,
- EFLAGS)))]>;
- def CMOV_V2F64 : I<0, Pseudo,
- (outs VR128:$dst), (ins VR128:$t, VR128:$f, i8imm:$cond),
- "#CMOV_V2F64 PSEUDO!",
- [(set VR128:$dst,
- (v2f64 (X86cmov VR128:$t, VR128:$f, imm:$cond,
- EFLAGS)))]>;
- def CMOV_V2I64 : I<0, Pseudo,
- (outs VR128:$dst), (ins VR128:$t, VR128:$f, i8imm:$cond),
- "#CMOV_V2I64 PSEUDO!",
- [(set VR128:$dst,
- (v2i64 (X86cmov VR128:$t, VR128:$f, imm:$cond,
- EFLAGS)))]>;
-}
-
-//===----------------------------------------------------------------------===//
-// SSE1 Instructions
-//===----------------------------------------------------------------------===//
-
-// Move Instructions
-let neverHasSideEffects = 1 in
-def MOVSSrr : SSI<0x10, MRMSrcReg, (outs FR32:$dst), (ins FR32:$src),
- "movss\t{$src, $dst|$dst, $src}", []>;
-let isSimpleLoad = 1, isReMaterializable = 1, mayHaveSideEffects = 1 in
-def MOVSSrm : SSI<0x10, MRMSrcMem, (outs FR32:$dst), (ins f32mem:$src),
- "movss\t{$src, $dst|$dst, $src}",
- [(set FR32:$dst, (loadf32 addr:$src))]>;
-def MOVSSmr : SSI<0x11, MRMDestMem, (outs), (ins f32mem:$dst, FR32:$src),
- "movss\t{$src, $dst|$dst, $src}",
- [(store FR32:$src, addr:$dst)]>;
-
-// Conversion instructions
-def CVTTSS2SIrr : SSI<0x2C, MRMSrcReg, (outs GR32:$dst), (ins FR32:$src),
- "cvttss2si\t{$src, $dst|$dst, $src}",
- [(set GR32:$dst, (fp_to_sint FR32:$src))]>;
-def CVTTSS2SIrm : SSI<0x2C, MRMSrcMem, (outs GR32:$dst), (ins f32mem:$src),
- "cvttss2si\t{$src, $dst|$dst, $src}",
- [(set GR32:$dst, (fp_to_sint (loadf32 addr:$src)))]>;
-def CVTSI2SSrr : SSI<0x2A, MRMSrcReg, (outs FR32:$dst), (ins GR32:$src),
- "cvtsi2ss\t{$src, $dst|$dst, $src}",
- [(set FR32:$dst, (sint_to_fp GR32:$src))]>;
-def CVTSI2SSrm : SSI<0x2A, MRMSrcMem, (outs FR32:$dst), (ins i32mem:$src),
- "cvtsi2ss\t{$src, $dst|$dst, $src}",
- [(set FR32:$dst, (sint_to_fp (loadi32 addr:$src)))]>;
-
-// Match intrinsics which expect XMM operand(s).
-def Int_CVTSS2SIrr : SSI<0x2D, MRMSrcReg, (outs GR32:$dst), (ins VR128:$src),
- "cvtss2si\t{$src, $dst|$dst, $src}",
- [(set GR32:$dst, (int_x86_sse_cvtss2si VR128:$src))]>;
-def Int_CVTSS2SIrm : SSI<0x2D, MRMSrcMem, (outs GR32:$dst), (ins f32mem:$src),
- "cvtss2si\t{$src, $dst|$dst, $src}",
- [(set GR32:$dst, (int_x86_sse_cvtss2si
- (load addr:$src)))]>;
-
-// Match intrinisics which expect MM and XMM operand(s).
-def Int_CVTPS2PIrr : PSI<0x2D, MRMSrcReg, (outs VR64:$dst), (ins VR128:$src),
- "cvtps2pi\t{$src, $dst|$dst, $src}",
- [(set VR64:$dst, (int_x86_sse_cvtps2pi VR128:$src))]>;
-def Int_CVTPS2PIrm : PSI<0x2D, MRMSrcMem, (outs VR64:$dst), (ins f64mem:$src),
- "cvtps2pi\t{$src, $dst|$dst, $src}",
- [(set VR64:$dst, (int_x86_sse_cvtps2pi
- (load addr:$src)))]>;
-def Int_CVTTPS2PIrr: PSI<0x2C, MRMSrcReg, (outs VR64:$dst), (ins VR128:$src),
- "cvttps2pi\t{$src, $dst|$dst, $src}",
- [(set VR64:$dst, (int_x86_sse_cvttps2pi VR128:$src))]>;
-def Int_CVTTPS2PIrm: PSI<0x2C, MRMSrcMem, (outs VR64:$dst), (ins f64mem:$src),
- "cvttps2pi\t{$src, $dst|$dst, $src}",
- [(set VR64:$dst, (int_x86_sse_cvttps2pi
- (load addr:$src)))]>;
-let Constraints = "$src1 = $dst" in {
- def Int_CVTPI2PSrr : PSI<0x2A, MRMSrcReg,
- (outs VR128:$dst), (ins VR128:$src1, VR64:$src2),
- "cvtpi2ps\t{$src2, $dst|$dst, $src2}",
- [(set VR128:$dst, (int_x86_sse_cvtpi2ps VR128:$src1,
- VR64:$src2))]>;
- def Int_CVTPI2PSrm : PSI<0x2A, MRMSrcMem,
- (outs VR128:$dst), (ins VR128:$src1, i64mem:$src2),
- "cvtpi2ps\t{$src2, $dst|$dst, $src2}",
- [(set VR128:$dst, (int_x86_sse_cvtpi2ps VR128:$src1,
- (load addr:$src2)))]>;
-}
-
-// Aliases for intrinsics
-def Int_CVTTSS2SIrr : SSI<0x2C, MRMSrcReg, (outs GR32:$dst), (ins VR128:$src),
- "cvttss2si\t{$src, $dst|$dst, $src}",
- [(set GR32:$dst,
- (int_x86_sse_cvttss2si VR128:$src))]>;
-def Int_CVTTSS2SIrm : SSI<0x2C, MRMSrcMem, (outs GR32:$dst), (ins f32mem:$src),
- "cvttss2si\t{$src, $dst|$dst, $src}",
- [(set GR32:$dst,
- (int_x86_sse_cvttss2si(load addr:$src)))]>;
-
-let Constraints = "$src1 = $dst" in {
- def Int_CVTSI2SSrr : SSI<0x2A, MRMSrcReg,
- (outs VR128:$dst), (ins VR128:$src1, GR32:$src2),
- "cvtsi2ss\t{$src2, $dst|$dst, $src2}",
- [(set VR128:$dst, (int_x86_sse_cvtsi2ss VR128:$src1,
- GR32:$src2))]>;
- def Int_CVTSI2SSrm : SSI<0x2A, MRMSrcMem,
- (outs VR128:$dst), (ins VR128:$src1, i32mem:$src2),
- "cvtsi2ss\t{$src2, $dst|$dst, $src2}",
- [(set VR128:$dst, (int_x86_sse_cvtsi2ss VR128:$src1,
- (loadi32 addr:$src2)))]>;
-}
-
-// Comparison instructions
-let Constraints = "$src1 = $dst" in {
-let neverHasSideEffects = 1 in
- def CMPSSrr : SSIi8<0xC2, MRMSrcReg,
- (outs FR32:$dst), (ins FR32:$src1, FR32:$src, SSECC:$cc),
- "cmp${cc}ss\t{$src, $dst|$dst, $src}", []>;
-let neverHasSideEffects = 1, mayLoad = 1 in
- def CMPSSrm : SSIi8<0xC2, MRMSrcMem,
- (outs FR32:$dst), (ins FR32:$src1, f32mem:$src, SSECC:$cc),
- "cmp${cc}ss\t{$src, $dst|$dst, $src}", []>;
-}
-
-let Defs = [EFLAGS] in {
-def UCOMISSrr: PSI<0x2E, MRMSrcReg, (outs), (ins FR32:$src1, FR32:$src2),
- "ucomiss\t{$src2, $src1|$src1, $src2}",
- [(X86cmp FR32:$src1, FR32:$src2), (implicit EFLAGS)]>;
-def UCOMISSrm: PSI<0x2E, MRMSrcMem, (outs), (ins FR32:$src1, f32mem:$src2),
- "ucomiss\t{$src2, $src1|$src1, $src2}",
- [(X86cmp FR32:$src1, (loadf32 addr:$src2)),
- (implicit EFLAGS)]>;
-} // Defs = [EFLAGS]
-
-// Aliases to match intrinsics which expect XMM operand(s).
-let Constraints = "$src1 = $dst" in {
- def Int_CMPSSrr : SSIi8<0xC2, MRMSrcReg,
- (outs VR128:$dst), (ins VR128:$src1, VR128:$src, SSECC:$cc),
- "cmp${cc}ss\t{$src, $dst|$dst, $src}",
- [(set VR128:$dst, (int_x86_sse_cmp_ss VR128:$src1,
- VR128:$src, imm:$cc))]>;
- def Int_CMPSSrm : SSIi8<0xC2, MRMSrcMem,
- (outs VR128:$dst), (ins VR128:$src1, f32mem:$src, SSECC:$cc),
- "cmp${cc}ss\t{$src, $dst|$dst, $src}",
- [(set VR128:$dst, (int_x86_sse_cmp_ss VR128:$src1,
- (load addr:$src), imm:$cc))]>;
-}
-
-let Defs = [EFLAGS] in {
-def Int_UCOMISSrr: PSI<0x2E, MRMSrcReg, (outs),
- (ins VR128:$src1, VR128:$src2),
- "ucomiss\t{$src2, $src1|$src1, $src2}",
- [(X86ucomi (v4f32 VR128:$src1), VR128:$src2),
- (implicit EFLAGS)]>;
-def Int_UCOMISSrm: PSI<0x2E, MRMSrcMem, (outs),
- (ins VR128:$src1, f128mem:$src2),
- "ucomiss\t{$src2, $src1|$src1, $src2}",
- [(X86ucomi (v4f32 VR128:$src1), (load addr:$src2)),
- (implicit EFLAGS)]>;
-
-def Int_COMISSrr: PSI<0x2F, MRMSrcReg, (outs),
- (ins VR128:$src1, VR128:$src2),
- "comiss\t{$src2, $src1|$src1, $src2}",
- [(X86comi (v4f32 VR128:$src1), VR128:$src2),
- (implicit EFLAGS)]>;
-def Int_COMISSrm: PSI<0x2F, MRMSrcMem, (outs),
- (ins VR128:$src1, f128mem:$src2),
- "comiss\t{$src2, $src1|$src1, $src2}",
- [(X86comi (v4f32 VR128:$src1), (load addr:$src2)),
- (implicit EFLAGS)]>;
-} // Defs = [EFLAGS]
-
-// Aliases of packed SSE1 instructions for scalar use. These all have names that
-// start with 'Fs'.
-
-// Alias instructions that map fld0 to pxor for sse.
-let isReMaterializable = 1 in
-def FsFLD0SS : I<0xEF, MRMInitReg, (outs FR32:$dst), (ins),
- "pxor\t$dst, $dst", [(set FR32:$dst, fp32imm0)]>,
- Requires<[HasSSE1]>, TB, OpSize;
-
-// Alias instruction to do FR32 reg-to-reg copy using movaps. Upper bits are
-// disregarded.
-let neverHasSideEffects = 1 in
-def FsMOVAPSrr : PSI<0x28, MRMSrcReg, (outs FR32:$dst), (ins FR32:$src),
- "movaps\t{$src, $dst|$dst, $src}", []>;
-
-// Alias instruction to load FR32 from f128mem using movaps. Upper bits are
-// disregarded.
-let isSimpleLoad = 1 in
-def FsMOVAPSrm : PSI<0x28, MRMSrcMem, (outs FR32:$dst), (ins f128mem:$src),
- "movaps\t{$src, $dst|$dst, $src}",
- [(set FR32:$dst, (alignedloadfsf32 addr:$src))]>;
-
-// Alias bitwise logical operations using SSE logical ops on packed FP values.
-let Constraints = "$src1 = $dst" in {
-let isCommutable = 1 in {
- def FsANDPSrr : PSI<0x54, MRMSrcReg, (outs FR32:$dst), (ins FR32:$src1, FR32:$src2),
- "andps\t{$src2, $dst|$dst, $src2}",
- [(set FR32:$dst, (X86fand FR32:$src1, FR32:$src2))]>;
- def FsORPSrr : PSI<0x56, MRMSrcReg, (outs FR32:$dst), (ins FR32:$src1, FR32:$src2),
- "orps\t{$src2, $dst|$dst, $src2}",
- [(set FR32:$dst, (X86for FR32:$src1, FR32:$src2))]>;
- def FsXORPSrr : PSI<0x57, MRMSrcReg, (outs FR32:$dst), (ins FR32:$src1, FR32:$src2),
- "xorps\t{$src2, $dst|$dst, $src2}",
- [(set FR32:$dst, (X86fxor FR32:$src1, FR32:$src2))]>;
-}
-
-def FsANDPSrm : PSI<0x54, MRMSrcMem, (outs FR32:$dst), (ins FR32:$src1, f128mem:$src2),
- "andps\t{$src2, $dst|$dst, $src2}",
- [(set FR32:$dst, (X86fand FR32:$src1,
- (memopfsf32 addr:$src2)))]>;
-def FsORPSrm : PSI<0x56, MRMSrcMem, (outs FR32:$dst), (ins FR32:$src1, f128mem:$src2),
- "orps\t{$src2, $dst|$dst, $src2}",
- [(set FR32:$dst, (X86for FR32:$src1,
- (memopfsf32 addr:$src2)))]>;
-def FsXORPSrm : PSI<0x57, MRMSrcMem, (outs FR32:$dst), (ins FR32:$src1, f128mem:$src2),
- "xorps\t{$src2, $dst|$dst, $src2}",
- [(set FR32:$dst, (X86fxor FR32:$src1,
- (memopfsf32 addr:$src2)))]>;
-let neverHasSideEffects = 1 in {
-def FsANDNPSrr : PSI<0x55, MRMSrcReg,
- (outs FR32:$dst), (ins FR32:$src1, FR32:$src2),
- "andnps\t{$src2, $dst|$dst, $src2}", []>;
-
-let mayLoad = 1 in
-def FsANDNPSrm : PSI<0x55, MRMSrcMem,
- (outs FR32:$dst), (ins FR32:$src1, f128mem:$src2),
- "andnps\t{$src2, $dst|$dst, $src2}", []>;
-}
-}
-
-/// basic_sse1_fp_binop_rm - SSE1 binops come in both scalar and vector forms.
-///
-/// In addition, we also have a special variant of the scalar form here to
-/// represent the associated intrinsic operation. This form is unlike the
-/// plain scalar form, in that it takes an entire vector (instead of a scalar)
-/// and leaves the top elements undefined.
-///
-/// These three forms can each be reg+reg or reg+mem, so there are a total of
-/// six "instructions".
-///
-let Constraints = "$src1 = $dst" in {
-multiclass basic_sse1_fp_binop_rm<bits<8> opc, string OpcodeStr,
- SDNode OpNode, Intrinsic F32Int,
- bit Commutable = 0> {
- // Scalar operation, reg+reg.
- def SSrr : SSI<opc, MRMSrcReg, (outs FR32:$dst), (ins FR32:$src1, FR32:$src2),
- !strconcat(OpcodeStr, "ss\t{$src2, $dst|$dst, $src2}"),
- [(set FR32:$dst, (OpNode FR32:$src1, FR32:$src2))]> {
- let isCommutable = Commutable;
- }
-
- // Scalar operation, reg+mem.
- def SSrm : SSI<opc, MRMSrcMem, (outs FR32:$dst), (ins FR32:$src1, f32mem:$src2),
- !strconcat(OpcodeStr, "ss\t{$src2, $dst|$dst, $src2}"),
- [(set FR32:$dst, (OpNode FR32:$src1, (load addr:$src2)))]>;
-
- // Vector operation, reg+reg.
- def PSrr : PSI<opc, MRMSrcReg, (outs VR128:$dst), (ins VR128:$src1, VR128:$src2),
- !strconcat(OpcodeStr, "ps\t{$src2, $dst|$dst, $src2}"),
- [(set VR128:$dst, (v4f32 (OpNode VR128:$src1, VR128:$src2)))]> {
- let isCommutable = Commutable;
- }
-
- // Vector operation, reg+mem.
- def PSrm : PSI<opc, MRMSrcMem, (outs VR128:$dst), (ins VR128:$src1, f128mem:$src2),
- !strconcat(OpcodeStr, "ps\t{$src2, $dst|$dst, $src2}"),
- [(set VR128:$dst, (OpNode VR128:$src1, (memopv4f32 addr:$src2)))]>;
-
- // Intrinsic operation, reg+reg.
- def SSrr_Int : SSI<opc, MRMSrcReg, (outs VR128:$dst), (ins VR128:$src1, VR128:$src2),
- !strconcat(OpcodeStr, "ss\t{$src2, $dst|$dst, $src2}"),
- [(set VR128:$dst, (F32Int VR128:$src1, VR128:$src2))]> {
- let isCommutable = Commutable;
- }
-
- // Intrinsic operation, reg+mem.
- def SSrm_Int : SSI<opc, MRMSrcMem, (outs VR128:$dst), (ins VR128:$src1, ssmem:$src2),
- !strconcat(OpcodeStr, "ss\t{$src2, $dst|$dst, $src2}"),
- [(set VR128:$dst, (F32Int VR128:$src1,
- sse_load_f32:$src2))]>;
-}
-}
-
-// Arithmetic instructions
-defm ADD : basic_sse1_fp_binop_rm<0x58, "add", fadd, int_x86_sse_add_ss, 1>;
-defm MUL : basic_sse1_fp_binop_rm<0x59, "mul", fmul, int_x86_sse_mul_ss, 1>;
-defm SUB : basic_sse1_fp_binop_rm<0x5C, "sub", fsub, int_x86_sse_sub_ss>;
-defm DIV : basic_sse1_fp_binop_rm<0x5E, "div", fdiv, int_x86_sse_div_ss>;
-
-/// sse1_fp_binop_rm - Other SSE1 binops
-///
-/// This multiclass is like basic_sse1_fp_binop_rm, with the addition of
-/// instructions for a full-vector intrinsic form. Operations that map
-/// onto C operators don't use this form since they just use the plain
-/// vector form instead of having a separate vector intrinsic form.
-///
-/// This provides a total of eight "instructions".
-///
-let Constraints = "$src1 = $dst" in {
-multiclass sse1_fp_binop_rm<bits<8> opc, string OpcodeStr,
- SDNode OpNode,
- Intrinsic F32Int,
- Intrinsic V4F32Int,
- bit Commutable = 0> {
-
- // Scalar operation, reg+reg.
- def SSrr : SSI<opc, MRMSrcReg, (outs FR32:$dst), (ins FR32:$src1, FR32:$src2),
- !strconcat(OpcodeStr, "ss\t{$src2, $dst|$dst, $src2}"),
- [(set FR32:$dst, (OpNode FR32:$src1, FR32:$src2))]> {
- let isCommutable = Commutable;
- }
-
- // Scalar operation, reg+mem.
- def SSrm : SSI<opc, MRMSrcMem, (outs FR32:$dst), (ins FR32:$src1, f32mem:$src2),
- !strconcat(OpcodeStr, "ss\t{$src2, $dst|$dst, $src2}"),
- [(set FR32:$dst, (OpNode FR32:$src1, (load addr:$src2)))]>;
-
- // Vector operation, reg+reg.
- def PSrr : PSI<opc, MRMSrcReg, (outs VR128:$dst), (ins VR128:$src1, VR128:$src2),
- !strconcat(OpcodeStr, "ps\t{$src2, $dst|$dst, $src2}"),
- [(set VR128:$dst, (v4f32 (OpNode VR128:$src1, VR128:$src2)))]> {
- let isCommutable = Commutable;
- }
-
- // Vector operation, reg+mem.
- def PSrm : PSI<opc, MRMSrcMem, (outs VR128:$dst), (ins VR128:$src1, f128mem:$src2),
- !strconcat(OpcodeStr, "ps\t{$src2, $dst|$dst, $src2}"),
- [(set VR128:$dst, (OpNode VR128:$src1, (memopv4f32 addr:$src2)))]>;
-
- // Intrinsic operation, reg+reg.
- def SSrr_Int : SSI<opc, MRMSrcReg, (outs VR128:$dst), (ins VR128:$src1, VR128:$src2),
- !strconcat(OpcodeStr, "ss\t{$src2, $dst|$dst, $src2}"),
- [(set VR128:$dst, (F32Int VR128:$src1, VR128:$src2))]> {
- let isCommutable = Commutable;
- }
-
- // Intrinsic operation, reg+mem.
- def SSrm_Int : SSI<opc, MRMSrcMem, (outs VR128:$dst), (ins VR128:$src1, ssmem:$src2),
- !strconcat(OpcodeStr, "ss\t{$src2, $dst|$dst, $src2}"),
- [(set VR128:$dst, (F32Int VR128:$src1,
- sse_load_f32:$src2))]>;
-
- // Vector intrinsic operation, reg+reg.
- def PSrr_Int : PSI<opc, MRMSrcReg, (outs VR128:$dst), (ins VR128:$src1, VR128:$src2),
- !strconcat(OpcodeStr, "ps\t{$src2, $dst|$dst, $src2}"),
- [(set VR128:$dst, (V4F32Int VR128:$src1, VR128:$src2))]> {
- let isCommutable = Commutable;
- }
-
- // Vector intrinsic operation, reg+mem.
- def PSrm_Int : PSI<opc, MRMSrcMem, (outs VR128:$dst), (ins VR128:$src1, f128mem:$src2),
- !strconcat(OpcodeStr, "ps\t{$src2, $dst|$dst, $src2}"),
- [(set VR128:$dst, (V4F32Int VR128:$src1, (load addr:$src2)))]>;
-}
-}
-
-defm MAX : sse1_fp_binop_rm<0x5F, "max", X86fmax,
- int_x86_sse_max_ss, int_x86_sse_max_ps>;
-defm MIN : sse1_fp_binop_rm<0x5D, "min", X86fmin,
- int_x86_sse_min_ss, int_x86_sse_min_ps>;
-
-//===----------------------------------------------------------------------===//
-// SSE packed FP Instructions
-
-// Move Instructions
-let neverHasSideEffects = 1 in
-def MOVAPSrr : PSI<0x28, MRMSrcReg, (outs VR128:$dst), (ins VR128:$src),
- "movaps\t{$src, $dst|$dst, $src}", []>;
-let isSimpleLoad = 1, isReMaterializable = 1, mayHaveSideEffects = 1 in
-def MOVAPSrm : PSI<0x28, MRMSrcMem, (outs VR128:$dst), (ins f128mem:$src),
- "movaps\t{$src, $dst|$dst, $src}",
- [(set VR128:$dst, (alignedloadv4f32 addr:$src))]>;
-
-def MOVAPSmr : PSI<0x29, MRMDestMem, (outs), (ins f128mem:$dst, VR128:$src),
- "movaps\t{$src, $dst|$dst, $src}",
- [(alignedstore (v4f32 VR128:$src), addr:$dst)]>;
-
-let neverHasSideEffects = 1 in
-def MOVUPSrr : PSI<0x10, MRMSrcReg, (outs VR128:$dst), (ins VR128:$src),
- "movups\t{$src, $dst|$dst, $src}", []>;
-let isSimpleLoad = 1 in
-def MOVUPSrm : PSI<0x10, MRMSrcMem, (outs VR128:$dst), (ins f128mem:$src),
- "movups\t{$src, $dst|$dst, $src}",
- [(set VR128:$dst, (loadv4f32 addr:$src))]>;
-def MOVUPSmr : PSI<0x11, MRMDestMem, (outs), (ins f128mem:$dst, VR128:$src),
- "movups\t{$src, $dst|$dst, $src}",
- [(store (v4f32 VR128:$src), addr:$dst)]>;
-
-// Intrinsic forms of MOVUPS load and store
-let isSimpleLoad = 1 in
-def MOVUPSrm_Int : PSI<0x10, MRMSrcMem, (outs VR128:$dst), (ins f128mem:$src),
- "movups\t{$src, $dst|$dst, $src}",
- [(set VR128:$dst, (int_x86_sse_loadu_ps addr:$src))]>;
-def MOVUPSmr_Int : PSI<0x11, MRMDestMem, (outs), (ins f128mem:$dst, VR128:$src),
- "movups\t{$src, $dst|$dst, $src}",
- [(int_x86_sse_storeu_ps addr:$dst, VR128:$src)]>;
-
-let Constraints = "$src1 = $dst" in {
- let AddedComplexity = 20 in {
- def MOVLPSrm : PSI<0x12, MRMSrcMem,
- (outs VR128:$dst), (ins VR128:$src1, f64mem:$src2),
- "movlps\t{$src2, $dst|$dst, $src2}",
- [(set VR128:$dst,
- (v4f32 (vector_shuffle VR128:$src1,
- (bc_v4f32 (v2f64 (scalar_to_vector (loadf64 addr:$src2)))),
- MOVLP_shuffle_mask)))]>;
- def MOVHPSrm : PSI<0x16, MRMSrcMem,
- (outs VR128:$dst), (ins VR128:$src1, f64mem:$src2),
- "movhps\t{$src2, $dst|$dst, $src2}",
- [(set VR128:$dst,
- (v4f32 (vector_shuffle VR128:$src1,
- (bc_v4f32 (v2f64 (scalar_to_vector (loadf64 addr:$src2)))),
- MOVHP_shuffle_mask)))]>;
- } // AddedComplexity
-} // Constraints = "$src1 = $dst"
-
-
-def MOVLPSmr : PSI<0x13, MRMDestMem, (outs), (ins f64mem:$dst, VR128:$src),
- "movlps\t{$src, $dst|$dst, $src}",
- [(store (f64 (vector_extract (bc_v2f64 (v4f32 VR128:$src)),
- (iPTR 0))), addr:$dst)]>;
-
-// v2f64 extract element 1 is always custom lowered to unpack high to low
-// and extract element 0 so the non-store version isn't too horrible.
-def MOVHPSmr : PSI<0x17, MRMDestMem, (outs), (ins f64mem:$dst, VR128:$src),
- "movhps\t{$src, $dst|$dst, $src}",
- [(store (f64 (vector_extract
- (v2f64 (vector_shuffle
- (bc_v2f64 (v4f32 VR128:$src)), (undef),
- UNPCKH_shuffle_mask)), (iPTR 0))),
- addr:$dst)]>;
-
-let Constraints = "$src1 = $dst" in {
-let AddedComplexity = 15 in {
-def MOVLHPSrr : PSI<0x16, MRMSrcReg, (outs VR128:$dst), (ins VR128:$src1, VR128:$src2),
- "movlhps\t{$src2, $dst|$dst, $src2}",
- [(set VR128:$dst,
- (v4f32 (vector_shuffle VR128:$src1, VR128:$src2,
- MOVHP_shuffle_mask)))]>;
-
-def MOVHLPSrr : PSI<0x12, MRMSrcReg, (outs VR128:$dst), (ins VR128:$src1, VR128:$src2),
- "movhlps\t{$src2, $dst|$dst, $src2}",
- [(set VR128:$dst,
- (v4f32 (vector_shuffle VR128:$src1, VR128:$src2,
- MOVHLPS_shuffle_mask)))]>;
-} // AddedComplexity
-} // Constraints = "$src1 = $dst"
-
-
-
-// Arithmetic
-
-/// sse1_fp_unop_rm - SSE1 unops come in both scalar and vector forms.
-///
-/// In addition, we also have a special variant of the scalar form here to
-/// represent the associated intrinsic operation. This form is unlike the
-/// plain scalar form, in that it takes an entire vector (instead of a
-/// scalar) and leaves the top elements undefined.
-///
-/// And, we have a special variant form for a full-vector intrinsic form.
-///
-/// These four forms can each have a reg or a mem operand, so there are a
-/// total of eight "instructions".
-///
-multiclass sse1_fp_unop_rm<bits<8> opc, string OpcodeStr,
- SDNode OpNode,
- Intrinsic F32Int,
- Intrinsic V4F32Int,
- bit Commutable = 0> {
- // Scalar operation, reg.
- def SSr : SSI<opc, MRMSrcReg, (outs FR32:$dst), (ins FR32:$src),
- !strconcat(OpcodeStr, "ss\t{$src, $dst|$dst, $src}"),
- [(set FR32:$dst, (OpNode FR32:$src))]> {
- let isCommutable = Commutable;
- }
-
- // Scalar operation, mem.
- def SSm : SSI<opc, MRMSrcMem, (outs FR32:$dst), (ins f32mem:$src),
- !strconcat(OpcodeStr, "ss\t{$src, $dst|$dst, $src}"),
- [(set FR32:$dst, (OpNode (load addr:$src)))]>;
-
- // Vector operation, reg.
- def PSr : PSI<opc, MRMSrcReg, (outs VR128:$dst), (ins VR128:$src),
- !strconcat(OpcodeStr, "ps\t{$src, $dst|$dst, $src}"),
- [(set VR128:$dst, (v4f32 (OpNode VR128:$src)))]> {
- let isCommutable = Commutable;
- }
-
- // Vector operation, mem.
- def PSm : PSI<opc, MRMSrcMem, (outs VR128:$dst), (ins f128mem:$src),
- !strconcat(OpcodeStr, "ps\t{$src, $dst|$dst, $src}"),
- [(set VR128:$dst, (OpNode (memopv4f32 addr:$src)))]>;
-
- // Intrinsic operation, reg.
- def SSr_Int : SSI<opc, MRMSrcReg, (outs VR128:$dst), (ins VR128:$src),
- !strconcat(OpcodeStr, "ss\t{$src, $dst|$dst, $src}"),
- [(set VR128:$dst, (F32Int VR128:$src))]> {
- let isCommutable = Commutable;
- }
-
- // Intrinsic operation, mem.
- def SSm_Int : SSI<opc, MRMSrcMem, (outs VR128:$dst), (ins ssmem:$src),
- !strconcat(OpcodeStr, "ss\t{$src, $dst|$dst, $src}"),
- [(set VR128:$dst, (F32Int sse_load_f32:$src))]>;
-
- // Vector intrinsic operation, reg
- def PSr_Int : PSI<opc, MRMSrcReg, (outs VR128:$dst), (ins VR128:$src),
- !strconcat(OpcodeStr, "ps\t{$src, $dst|$dst, $src}"),
- [(set VR128:$dst, (V4F32Int VR128:$src))]> {
- let isCommutable = Commutable;
- }
-
- // Vector intrinsic operation, mem
- def PSm_Int : PSI<opc, MRMSrcMem, (outs VR128:$dst), (ins f128mem:$src),
- !strconcat(OpcodeStr, "ps\t{$src, $dst|$dst, $src}"),
- [(set VR128:$dst, (V4F32Int (load addr:$src)))]>;
-}
-
-// Square root.
-defm SQRT : sse1_fp_unop_rm<0x51, "sqrt", fsqrt,
- int_x86_sse_sqrt_ss, int_x86_sse_sqrt_ps>;
-
-// Reciprocal approximations. Note that these typically require refinement
-// in order to obtain suitable precision.
-defm RSQRT : sse1_fp_unop_rm<0x52, "rsqrt", X86frsqrt,
- int_x86_sse_rsqrt_ss, int_x86_sse_rsqrt_ps>;
-defm RCP : sse1_fp_unop_rm<0x53, "rcp", X86frcp,
- int_x86_sse_rcp_ss, int_x86_sse_rcp_ps>;
-
-// Logical
-let Constraints = "$src1 = $dst" in {
- let isCommutable = 1 in {
- def ANDPSrr : PSI<0x54, MRMSrcReg,
- (outs VR128:$dst), (ins VR128:$src1, VR128:$src2),
- "andps\t{$src2, $dst|$dst, $src2}",
- [(set VR128:$dst, (v2i64
- (and VR128:$src1, VR128:$src2)))]>;
- def ORPSrr : PSI<0x56, MRMSrcReg,
- (outs VR128:$dst), (ins VR128:$src1, VR128:$src2),
- "orps\t{$src2, $dst|$dst, $src2}",
- [(set VR128:$dst, (v2i64
- (or VR128:$src1, VR128:$src2)))]>;
- def XORPSrr : PSI<0x57, MRMSrcReg,
- (outs VR128:$dst), (ins VR128:$src1, VR128:$src2),
- "xorps\t{$src2, $dst|$dst, $src2}",
- [(set VR128:$dst, (v2i64
- (xor VR128:$src1, VR128:$src2)))]>;
- }
-
- def ANDPSrm : PSI<0x54, MRMSrcMem,
- (outs VR128:$dst), (ins VR128:$src1, f128mem:$src2),
- "andps\t{$src2, $dst|$dst, $src2}",
- [(set VR128:$dst, (and (bc_v2i64 (v4f32 VR128:$src1)),
- (memopv2i64 addr:$src2)))]>;
- def ORPSrm : PSI<0x56, MRMSrcMem,
- (outs VR128:$dst), (ins VR128:$src1, f128mem:$src2),
- "orps\t{$src2, $dst|$dst, $src2}",
- [(set VR128:$dst, (or (bc_v2i64 (v4f32 VR128:$src1)),
- (memopv2i64 addr:$src2)))]>;
- def XORPSrm : PSI<0x57, MRMSrcMem,
- (outs VR128:$dst), (ins VR128:$src1, f128mem:$src2),
- "xorps\t{$src2, $dst|$dst, $src2}",
- [(set VR128:$dst, (xor (bc_v2i64 (v4f32 VR128:$src1)),
- (memopv2i64 addr:$src2)))]>;
- def ANDNPSrr : PSI<0x55, MRMSrcReg,
- (outs VR128:$dst), (ins VR128:$src1, VR128:$src2),
- "andnps\t{$src2, $dst|$dst, $src2}",
- [(set VR128:$dst,
- (v2i64 (and (xor VR128:$src1,
- (bc_v2i64 (v4i32 immAllOnesV))),
- VR128:$src2)))]>;
- def ANDNPSrm : PSI<0x55, MRMSrcMem,
- (outs VR128:$dst), (ins VR128:$src1,f128mem:$src2),
- "andnps\t{$src2, $dst|$dst, $src2}",
- [(set VR128:$dst,
- (v2i64 (and (xor (bc_v2i64 (v4f32 VR128:$src1)),
- (bc_v2i64 (v4i32 immAllOnesV))),
- (memopv2i64 addr:$src2))))]>;
-}
-
-let Constraints = "$src1 = $dst" in {
- def CMPPSrri : PSIi8<0xC2, MRMSrcReg,
- (outs VR128:$dst), (ins VR128:$src1, VR128:$src, SSECC:$cc),
- "cmp${cc}ps\t{$src, $dst|$dst, $src}",
- [(set VR128:$dst, (int_x86_sse_cmp_ps VR128:$src1,
- VR128:$src, imm:$cc))]>;
- def CMPPSrmi : PSIi8<0xC2, MRMSrcMem,
- (outs VR128:$dst), (ins VR128:$src1, f128mem:$src, SSECC:$cc),
- "cmp${cc}ps\t{$src, $dst|$dst, $src}",
- [(set VR128:$dst, (int_x86_sse_cmp_ps VR128:$src1,
- (load addr:$src), imm:$cc))]>;
-}
-
-// Shuffle and unpack instructions
-let Constraints = "$src1 = $dst" in {
- let isConvertibleToThreeAddress = 1 in // Convert to pshufd
- def SHUFPSrri : PSIi8<0xC6, MRMSrcReg,
- (outs VR128:$dst), (ins VR128:$src1,
- VR128:$src2, i32i8imm:$src3),
- "shufps\t{$src3, $src2, $dst|$dst, $src2, $src3}",
- [(set VR128:$dst,
- (v4f32 (vector_shuffle
- VR128:$src1, VR128:$src2,
- SHUFP_shuffle_mask:$src3)))]>;
- def SHUFPSrmi : PSIi8<0xC6, MRMSrcMem,
- (outs VR128:$dst), (ins VR128:$src1,
- f128mem:$src2, i32i8imm:$src3),
- "shufps\t{$src3, $src2, $dst|$dst, $src2, $src3}",
- [(set VR128:$dst,
- (v4f32 (vector_shuffle
- VR128:$src1, (memopv4f32 addr:$src2),
- SHUFP_shuffle_mask:$src3)))]>;
-
- let AddedComplexity = 10 in {
- def UNPCKHPSrr : PSI<0x15, MRMSrcReg,
- (outs VR128:$dst), (ins VR128:$src1, VR128:$src2),
- "unpckhps\t{$src2, $dst|$dst, $src2}",
- [(set VR128:$dst,
- (v4f32 (vector_shuffle
- VR128:$src1, VR128:$src2,
- UNPCKH_shuffle_mask)))]>;
- def UNPCKHPSrm : PSI<0x15, MRMSrcMem,
- (outs VR128:$dst), (ins VR128:$src1, f128mem:$src2),
- "unpckhps\t{$src2, $dst|$dst, $src2}",
- [(set VR128:$dst,
- (v4f32 (vector_shuffle
- VR128:$src1, (memopv4f32 addr:$src2),
- UNPCKH_shuffle_mask)))]>;
-
- def UNPCKLPSrr : PSI<0x14, MRMSrcReg,
- (outs VR128:$dst), (ins VR128:$src1, VR128:$src2),
- "unpcklps\t{$src2, $dst|$dst, $src2}",
- [(set VR128:$dst,
- (v4f32 (vector_shuffle
- VR128:$src1, VR128:$src2,
- UNPCKL_shuffle_mask)))]>;
- def UNPCKLPSrm : PSI<0x14, MRMSrcMem,
- (outs VR128:$dst), (ins VR128:$src1, f128mem:$src2),
- "unpcklps\t{$src2, $dst|$dst, $src2}",
- [(set VR128:$dst,
- (v4f32 (vector_shuffle
- VR128:$src1, (memopv4f32 addr:$src2),
- UNPCKL_shuffle_mask)))]>;
- } // AddedComplexity
-} // Constraints = "$src1 = $dst"
-
-// Mask creation
-def MOVMSKPSrr : PSI<0x50, MRMSrcReg, (outs GR32:$dst), (ins VR128:$src),
- "movmskps\t{$src, $dst|$dst, $src}",
- [(set GR32:$dst, (int_x86_sse_movmsk_ps VR128:$src))]>;
-def MOVMSKPDrr : PSI<0x50, MRMSrcReg, (outs GR32:$dst), (ins VR128:$src),
- "movmskpd\t{$src, $dst|$dst, $src}",
- [(set GR32:$dst, (int_x86_sse2_movmsk_pd VR128:$src))]>;
-
-// Prefetch intrinsic.
-def PREFETCHT0 : PSI<0x18, MRM1m, (outs), (ins i8mem:$src),
- "prefetcht0\t$src", [(prefetch addr:$src, imm, (i32 3))]>;
-def PREFETCHT1 : PSI<0x18, MRM2m, (outs), (ins i8mem:$src),
- "prefetcht1\t$src", [(prefetch addr:$src, imm, (i32 2))]>;
-def PREFETCHT2 : PSI<0x18, MRM3m, (outs), (ins i8mem:$src),
- "prefetcht2\t$src", [(prefetch addr:$src, imm, (i32 1))]>;
-def PREFETCHNTA : PSI<0x18, MRM0m, (outs), (ins i8mem:$src),
- "prefetchnta\t$src", [(prefetch addr:$src, imm, (i32 0))]>;
-
-// Non-temporal stores
-def MOVNTPSmr : PSI<0x2B, MRMDestMem, (outs), (ins i128mem:$dst, VR128:$src),
- "movntps\t{$src, $dst|$dst, $src}",
- [(int_x86_sse_movnt_ps addr:$dst, VR128:$src)]>;
-
-// Load, store, and memory fence
-def SFENCE : PSI<0xAE, MRM7m, (outs), (ins), "sfence", [(int_x86_sse_sfence)]>;
-
-// MXCSR register
-def LDMXCSR : PSI<0xAE, MRM2m, (outs), (ins i32mem:$src),
- "ldmxcsr\t$src", [(int_x86_sse_ldmxcsr addr:$src)]>;
-def STMXCSR : PSI<0xAE, MRM3m, (outs), (ins i32mem:$dst),
- "stmxcsr\t$dst", [(int_x86_sse_stmxcsr addr:$dst)]>;
-
-// Alias instructions that map zero vector to pxor / xorp* for sse.
-let isReMaterializable = 1 in
-def V_SET0 : PSI<0x57, MRMInitReg, (outs VR128:$dst), (ins),
- "xorps\t$dst, $dst",
- [(set VR128:$dst, (v4i32 immAllZerosV))]>;
-
-let Predicates = [HasSSE1] in {
- def : Pat<(v2i64 immAllZerosV), (V_SET0)>;
- def : Pat<(v8i16 immAllZerosV), (V_SET0)>;
- def : Pat<(v16i8 immAllZerosV), (V_SET0)>;
- def : Pat<(v2f64 immAllZerosV), (V_SET0)>;
- def : Pat<(v4f32 immAllZerosV), (V_SET0)>;
-}
-
-// FR32 to 128-bit vector conversion.
-def MOVSS2PSrr : SSI<0x10, MRMSrcReg, (outs VR128:$dst), (ins FR32:$src),
- "movss\t{$src, $dst|$dst, $src}",
- [(set VR128:$dst,
- (v4f32 (scalar_to_vector FR32:$src)))]>;
-def MOVSS2PSrm : SSI<0x10, MRMSrcMem, (outs VR128:$dst), (ins f32mem:$src),
- "movss\t{$src, $dst|$dst, $src}",
- [(set VR128:$dst,
- (v4f32 (scalar_to_vector (loadf32 addr:$src))))]>;
-
-// FIXME: may not be able to eliminate this movss with coalescing the src and
-// dest register classes are different. We really want to write this pattern
-// like this:
-// def : Pat<(f32 (vector_extract (v4f32 VR128:$src), (iPTR 0))),
-// (f32 FR32:$src)>;
-def MOVPS2SSrr : SSI<0x10, MRMSrcReg, (outs FR32:$dst), (ins VR128:$src),
- "movss\t{$src, $dst|$dst, $src}",
- [(set FR32:$dst, (vector_extract (v4f32 VR128:$src),
- (iPTR 0)))]>;
-def MOVPS2SSmr : SSI<0x11, MRMDestMem, (outs), (ins f32mem:$dst, VR128:$src),
- "movss\t{$src, $dst|$dst, $src}",
- [(store (f32 (vector_extract (v4f32 VR128:$src),
- (iPTR 0))), addr:$dst)]>;
-
-
-// Move to lower bits of a VR128, leaving upper bits alone.
-// Three operand (but two address) aliases.
-let Constraints = "$src1 = $dst" in {
-let neverHasSideEffects = 1 in
- def MOVLSS2PSrr : SSI<0x10, MRMSrcReg,
- (outs VR128:$dst), (ins VR128:$src1, FR32:$src2),
- "movss\t{$src2, $dst|$dst, $src2}", []>;
-
- let AddedComplexity = 15 in
- def MOVLPSrr : SSI<0x10, MRMSrcReg,
- (outs VR128:$dst), (ins VR128:$src1, VR128:$src2),
- "movss\t{$src2, $dst|$dst, $src2}",
- [(set VR128:$dst,
- (v4f32 (vector_shuffle VR128:$src1, VR128:$src2,
- MOVL_shuffle_mask)))]>;
-}
-
-// Move to lower bits of a VR128 and zeroing upper bits.
-// Loading from memory automatically zeroing upper bits.
-let AddedComplexity = 20 in
-def MOVZSS2PSrm : SSI<0x10, MRMSrcMem, (outs VR128:$dst), (ins f32mem:$src),
- "movss\t{$src, $dst|$dst, $src}",
- [(set VR128:$dst, (v4f32 (X86vzmovl (v4f32 (scalar_to_vector
- (loadf32 addr:$src))))))]>;
-
-def : Pat<(v4f32 (X86vzmovl (loadv4f32 addr:$src))),
- (MOVZSS2PSrm addr:$src)>;
-
-//===----------------------------------------------------------------------===//
-// SSE2 Instructions
-//===----------------------------------------------------------------------===//
-
-// Move Instructions
-let neverHasSideEffects = 1 in
-def MOVSDrr : SDI<0x10, MRMSrcReg, (outs FR64:$dst), (ins FR64:$src),
- "movsd\t{$src, $dst|$dst, $src}", []>;
-let isSimpleLoad = 1, isReMaterializable = 1, mayHaveSideEffects = 1 in
-def MOVSDrm : SDI<0x10, MRMSrcMem, (outs FR64:$dst), (ins f64mem:$src),
- "movsd\t{$src, $dst|$dst, $src}",
- [(set FR64:$dst, (loadf64 addr:$src))]>;
-def MOVSDmr : SDI<0x11, MRMDestMem, (outs), (ins f64mem:$dst, FR64:$src),
- "movsd\t{$src, $dst|$dst, $src}",
- [(store FR64:$src, addr:$dst)]>;
-
-// Conversion instructions
-def CVTTSD2SIrr : SDI<0x2C, MRMSrcReg, (outs GR32:$dst), (ins FR64:$src),
- "cvttsd2si\t{$src, $dst|$dst, $src}",
- [(set GR32:$dst, (fp_to_sint FR64:$src))]>;
-def CVTTSD2SIrm : SDI<0x2C, MRMSrcMem, (outs GR32:$dst), (ins f64mem:$src),
- "cvttsd2si\t{$src, $dst|$dst, $src}",
- [(set GR32:$dst, (fp_to_sint (loadf64 addr:$src)))]>;
-def CVTSD2SSrr : SDI<0x5A, MRMSrcReg, (outs FR32:$dst), (ins FR64:$src),
- "cvtsd2ss\t{$src, $dst|$dst, $src}",
- [(set FR32:$dst, (fround FR64:$src))]>;
-def CVTSD2SSrm : SDI<0x5A, MRMSrcMem, (outs FR32:$dst), (ins f64mem:$src),
- "cvtsd2ss\t{$src, $dst|$dst, $src}",
- [(set FR32:$dst, (fround (loadf64 addr:$src)))]>;
-def CVTSI2SDrr : SDI<0x2A, MRMSrcReg, (outs FR64:$dst), (ins GR32:$src),
- "cvtsi2sd\t{$src, $dst|$dst, $src}",
- [(set FR64:$dst, (sint_to_fp GR32:$src))]>;
-def CVTSI2SDrm : SDI<0x2A, MRMSrcMem, (outs FR64:$dst), (ins i32mem:$src),
- "cvtsi2sd\t{$src, $dst|$dst, $src}",
- [(set FR64:$dst, (sint_to_fp (loadi32 addr:$src)))]>;
-
-// SSE2 instructions with XS prefix
-def CVTSS2SDrr : I<0x5A, MRMSrcReg, (outs FR64:$dst), (ins FR32:$src),
- "cvtss2sd\t{$src, $dst|$dst, $src}",
- [(set FR64:$dst, (fextend FR32:$src))]>, XS,
- Requires<[HasSSE2]>;
-def CVTSS2SDrm : I<0x5A, MRMSrcMem, (outs FR64:$dst), (ins f32mem:$src),
- "cvtss2sd\t{$src, $dst|$dst, $src}",
- [(set FR64:$dst, (extloadf32 addr:$src))]>, XS,
- Requires<[HasSSE2]>;
-
-// Match intrinsics which expect XMM operand(s).
-def Int_CVTSD2SIrr : SDI<0x2D, MRMSrcReg, (outs GR32:$dst), (ins VR128:$src),
- "cvtsd2si\t{$src, $dst|$dst, $src}",
- [(set GR32:$dst, (int_x86_sse2_cvtsd2si VR128:$src))]>;
-def Int_CVTSD2SIrm : SDI<0x2D, MRMSrcMem, (outs GR32:$dst), (ins f128mem:$src),
- "cvtsd2si\t{$src, $dst|$dst, $src}",
- [(set GR32:$dst, (int_x86_sse2_cvtsd2si
- (load addr:$src)))]>;
-
-// Match intrinisics which expect MM and XMM operand(s).
-def Int_CVTPD2PIrr : PDI<0x2D, MRMSrcReg, (outs VR64:$dst), (ins VR128:$src),
- "cvtpd2pi\t{$src, $dst|$dst, $src}",
- [(set VR64:$dst, (int_x86_sse_cvtpd2pi VR128:$src))]>;
-def Int_CVTPD2PIrm : PDI<0x2D, MRMSrcMem, (outs VR64:$dst), (ins f128mem:$src),
- "cvtpd2pi\t{$src, $dst|$dst, $src}",
- [(set VR64:$dst, (int_x86_sse_cvtpd2pi
- (load addr:$src)))]>;
-def Int_CVTTPD2PIrr: PDI<0x2C, MRMSrcReg, (outs VR64:$dst), (ins VR128:$src),
- "cvttpd2pi\t{$src, $dst|$dst, $src}",
- [(set VR64:$dst, (int_x86_sse_cvttpd2pi VR128:$src))]>;
-def Int_CVTTPD2PIrm: PDI<0x2C, MRMSrcMem, (outs VR64:$dst), (ins f128mem:$src),
- "cvttpd2pi\t{$src, $dst|$dst, $src}",
- [(set VR64:$dst, (int_x86_sse_cvttpd2pi
- (load addr:$src)))]>;
-def Int_CVTPI2PDrr : PDI<0x2A, MRMSrcReg, (outs VR128:$dst), (ins VR64:$src),
- "cvtpi2pd\t{$src, $dst|$dst, $src}",
- [(set VR128:$dst, (int_x86_sse_cvtpi2pd VR64:$src))]>;
-def Int_CVTPI2PDrm : PDI<0x2A, MRMSrcMem, (outs VR128:$dst), (ins i64mem:$src),
- "cvtpi2pd\t{$src, $dst|$dst, $src}",
- [(set VR128:$dst, (int_x86_sse_cvtpi2pd
- (load addr:$src)))]>;
-
-// Aliases for intrinsics
-def Int_CVTTSD2SIrr : SDI<0x2C, MRMSrcReg, (outs GR32:$dst), (ins VR128:$src),
- "cvttsd2si\t{$src, $dst|$dst, $src}",
- [(set GR32:$dst,
- (int_x86_sse2_cvttsd2si VR128:$src))]>;
-def Int_CVTTSD2SIrm : SDI<0x2C, MRMSrcMem, (outs GR32:$dst), (ins f128mem:$src),
- "cvttsd2si\t{$src, $dst|$dst, $src}",
- [(set GR32:$dst, (int_x86_sse2_cvttsd2si
- (load addr:$src)))]>;
-
-// Comparison instructions
-let Constraints = "$src1 = $dst", neverHasSideEffects = 1 in {
- def CMPSDrr : SDIi8<0xC2, MRMSrcReg,
- (outs FR64:$dst), (ins FR64:$src1, FR64:$src, SSECC:$cc),
- "cmp${cc}sd\t{$src, $dst|$dst, $src}", []>;
-let mayLoad = 1 in
- def CMPSDrm : SDIi8<0xC2, MRMSrcMem,
- (outs FR64:$dst), (ins FR64:$src1, f64mem:$src, SSECC:$cc),
- "cmp${cc}sd\t{$src, $dst|$dst, $src}", []>;
-}
-
-let Defs = [EFLAGS] in {
-def UCOMISDrr: PDI<0x2E, MRMSrcReg, (outs), (ins FR64:$src1, FR64:$src2),
- "ucomisd\t{$src2, $src1|$src1, $src2}",
- [(X86cmp FR64:$src1, FR64:$src2), (implicit EFLAGS)]>;
-def UCOMISDrm: PDI<0x2E, MRMSrcMem, (outs), (ins FR64:$src1, f64mem:$src2),
- "ucomisd\t{$src2, $src1|$src1, $src2}",
- [(X86cmp FR64:$src1, (loadf64 addr:$src2)),
- (implicit EFLAGS)]>;
-}
-
-// Aliases to match intrinsics which expect XMM operand(s).
-let Constraints = "$src1 = $dst" in {
- def Int_CMPSDrr : SDIi8<0xC2, MRMSrcReg,
- (outs VR128:$dst), (ins VR128:$src1, VR128:$src, SSECC:$cc),
- "cmp${cc}sd\t{$src, $dst|$dst, $src}",
- [(set VR128:$dst, (int_x86_sse2_cmp_sd VR128:$src1,
- VR128:$src, imm:$cc))]>;
- def Int_CMPSDrm : SDIi8<0xC2, MRMSrcMem,
- (outs VR128:$dst), (ins VR128:$src1, f64mem:$src, SSECC:$cc),
- "cmp${cc}sd\t{$src, $dst|$dst, $src}",
- [(set VR128:$dst, (int_x86_sse2_cmp_sd VR128:$src1,
- (load addr:$src), imm:$cc))]>;
-}
-
-let Defs = [EFLAGS] in {
-def Int_UCOMISDrr: PDI<0x2E, MRMSrcReg, (outs), (ins VR128:$src1, VR128:$src2),
- "ucomisd\t{$src2, $src1|$src1, $src2}",
- [(X86ucomi (v2f64 VR128:$src1), (v2f64 VR128:$src2)),
- (implicit EFLAGS)]>;
-def Int_UCOMISDrm: PDI<0x2E, MRMSrcMem, (outs),(ins VR128:$src1, f128mem:$src2),
- "ucomisd\t{$src2, $src1|$src1, $src2}",
- [(X86ucomi (v2f64 VR128:$src1), (load addr:$src2)),
- (implicit EFLAGS)]>;
-
-def Int_COMISDrr: PDI<0x2F, MRMSrcReg, (outs), (ins VR128:$src1, VR128:$src2),
- "comisd\t{$src2, $src1|$src1, $src2}",
- [(X86comi (v2f64 VR128:$src1), (v2f64 VR128:$src2)),
- (implicit EFLAGS)]>;
-def Int_COMISDrm: PDI<0x2F, MRMSrcMem, (outs), (ins VR128:$src1, f128mem:$src2),
- "comisd\t{$src2, $src1|$src1, $src2}",
- [(X86comi (v2f64 VR128:$src1), (load addr:$src2)),
- (implicit EFLAGS)]>;
-} // Defs = EFLAGS]
-
-// Aliases of packed SSE2 instructions for scalar use. These all have names that
-// start with 'Fs'.
-
-// Alias instructions that map fld0 to pxor for sse.
-let isReMaterializable = 1 in
-def FsFLD0SD : I<0xEF, MRMInitReg, (outs FR64:$dst), (ins),
- "pxor\t$dst, $dst", [(set FR64:$dst, fpimm0)]>,
- Requires<[HasSSE2]>, TB, OpSize;
-
-// Alias instruction to do FR64 reg-to-reg copy using movapd. Upper bits are
-// disregarded.
-let neverHasSideEffects = 1 in
-def FsMOVAPDrr : PDI<0x28, MRMSrcReg, (outs FR64:$dst), (ins FR64:$src),
- "movapd\t{$src, $dst|$dst, $src}", []>;
-
-// Alias instruction to load FR64 from f128mem using movapd. Upper bits are
-// disregarded.
-let isSimpleLoad = 1 in
-def FsMOVAPDrm : PDI<0x28, MRMSrcMem, (outs FR64:$dst), (ins f128mem:$src),
- "movapd\t{$src, $dst|$dst, $src}",
- [(set FR64:$dst, (alignedloadfsf64 addr:$src))]>;
-
-// Alias bitwise logical operations using SSE logical ops on packed FP values.
-let Constraints = "$src1 = $dst" in {
-let isCommutable = 1 in {
- def FsANDPDrr : PDI<0x54, MRMSrcReg, (outs FR64:$dst),
- (ins FR64:$src1, FR64:$src2),
- "andpd\t{$src2, $dst|$dst, $src2}",
- [(set FR64:$dst, (X86fand FR64:$src1, FR64:$src2))]>;
- def FsORPDrr : PDI<0x56, MRMSrcReg, (outs FR64:$dst),
- (ins FR64:$src1, FR64:$src2),
- "orpd\t{$src2, $dst|$dst, $src2}",
- [(set FR64:$dst, (X86for FR64:$src1, FR64:$src2))]>;
- def FsXORPDrr : PDI<0x57, MRMSrcReg, (outs FR64:$dst),
- (ins FR64:$src1, FR64:$src2),
- "xorpd\t{$src2, $dst|$dst, $src2}",
- [(set FR64:$dst, (X86fxor FR64:$src1, FR64:$src2))]>;
-}
-
-def FsANDPDrm : PDI<0x54, MRMSrcMem, (outs FR64:$dst),
- (ins FR64:$src1, f128mem:$src2),
- "andpd\t{$src2, $dst|$dst, $src2}",
- [(set FR64:$dst, (X86fand FR64:$src1,
- (memopfsf64 addr:$src2)))]>;
-def FsORPDrm : PDI<0x56, MRMSrcMem, (outs FR64:$dst),
- (ins FR64:$src1, f128mem:$src2),
- "orpd\t{$src2, $dst|$dst, $src2}",
- [(set FR64:$dst, (X86for FR64:$src1,
- (memopfsf64 addr:$src2)))]>;
-def FsXORPDrm : PDI<0x57, MRMSrcMem, (outs FR64:$dst),
- (ins FR64:$src1, f128mem:$src2),
- "xorpd\t{$src2, $dst|$dst, $src2}",
- [(set FR64:$dst, (X86fxor FR64:$src1,
- (memopfsf64 addr:$src2)))]>;
-
-let neverHasSideEffects = 1 in {
-def FsANDNPDrr : PDI<0x55, MRMSrcReg,
- (outs FR64:$dst), (ins FR64:$src1, FR64:$src2),
- "andnpd\t{$src2, $dst|$dst, $src2}", []>;
-let mayLoad = 1 in
-def FsANDNPDrm : PDI<0x55, MRMSrcMem,
- (outs FR64:$dst), (ins FR64:$src1, f128mem:$src2),
- "andnpd\t{$src2, $dst|$dst, $src2}", []>;
-}
-}
-
-/// basic_sse2_fp_binop_rm - SSE2 binops come in both scalar and vector forms.
-///
-/// In addition, we also have a special variant of the scalar form here to
-/// represent the associated intrinsic operation. This form is unlike the
-/// plain scalar form, in that it takes an entire vector (instead of a scalar)
-/// and leaves the top elements undefined.
-///
-/// These three forms can each be reg+reg or reg+mem, so there are a total of
-/// six "instructions".
-///
-let Constraints = "$src1 = $dst" in {
-multiclass basic_sse2_fp_binop_rm<bits<8> opc, string OpcodeStr,
- SDNode OpNode, Intrinsic F64Int,
- bit Commutable = 0> {
- // Scalar operation, reg+reg.
- def SDrr : SDI<opc, MRMSrcReg, (outs FR64:$dst), (ins FR64:$src1, FR64:$src2),
- !strconcat(OpcodeStr, "sd\t{$src2, $dst|$dst, $src2}"),
- [(set FR64:$dst, (OpNode FR64:$src1, FR64:$src2))]> {
- let isCommutable = Commutable;
- }
-
- // Scalar operation, reg+mem.
- def SDrm : SDI<opc, MRMSrcMem, (outs FR64:$dst), (ins FR64:$src1, f64mem:$src2),
- !strconcat(OpcodeStr, "sd\t{$src2, $dst|$dst, $src2}"),
- [(set FR64:$dst, (OpNode FR64:$src1, (load addr:$src2)))]>;
-
- // Vector operation, reg+reg.
- def PDrr : PDI<opc, MRMSrcReg, (outs VR128:$dst), (ins VR128:$src1, VR128:$src2),
- !strconcat(OpcodeStr, "pd\t{$src2, $dst|$dst, $src2}"),
- [(set VR128:$dst, (v2f64 (OpNode VR128:$src1, VR128:$src2)))]> {
- let isCommutable = Commutable;
- }
-
- // Vector operation, reg+mem.
- def PDrm : PDI<opc, MRMSrcMem, (outs VR128:$dst), (ins VR128:$src1, f128mem:$src2),
- !strconcat(OpcodeStr, "pd\t{$src2, $dst|$dst, $src2}"),
- [(set VR128:$dst, (OpNode VR128:$src1, (memopv2f64 addr:$src2)))]>;
-
- // Intrinsic operation, reg+reg.
- def SDrr_Int : SDI<opc, MRMSrcReg, (outs VR128:$dst), (ins VR128:$src1, VR128:$src2),
- !strconcat(OpcodeStr, "sd\t{$src2, $dst|$dst, $src2}"),
- [(set VR128:$dst, (F64Int VR128:$src1, VR128:$src2))]> {
- let isCommutable = Commutable;
- }
-
- // Intrinsic operation, reg+mem.
- def SDrm_Int : SDI<opc, MRMSrcMem, (outs VR128:$dst), (ins VR128:$src1, sdmem:$src2),
- !strconcat(OpcodeStr, "sd\t{$src2, $dst|$dst, $src2}"),
- [(set VR128:$dst, (F64Int VR128:$src1,
- sse_load_f64:$src2))]>;
-}
-}
-
-// Arithmetic instructions
-defm ADD : basic_sse2_fp_binop_rm<0x58, "add", fadd, int_x86_sse2_add_sd, 1>;
-defm MUL : basic_sse2_fp_binop_rm<0x59, "mul", fmul, int_x86_sse2_mul_sd, 1>;
-defm SUB : basic_sse2_fp_binop_rm<0x5C, "sub", fsub, int_x86_sse2_sub_sd>;
-defm DIV : basic_sse2_fp_binop_rm<0x5E, "div", fdiv, int_x86_sse2_div_sd>;
-
-/// sse2_fp_binop_rm - Other SSE2 binops
-///
-/// This multiclass is like basic_sse2_fp_binop_rm, with the addition of
-/// instructions for a full-vector intrinsic form. Operations that map
-/// onto C operators don't use this form since they just use the plain
-/// vector form instead of having a separate vector intrinsic form.
-///
-/// This provides a total of eight "instructions".
-///
-let Constraints = "$src1 = $dst" in {
-multiclass sse2_fp_binop_rm<bits<8> opc, string OpcodeStr,
- SDNode OpNode,
- Intrinsic F64Int,
- Intrinsic V2F64Int,
- bit Commutable = 0> {
-
- // Scalar operation, reg+reg.
- def SDrr : SDI<opc, MRMSrcReg, (outs FR64:$dst), (ins FR64:$src1, FR64:$src2),
- !strconcat(OpcodeStr, "sd\t{$src2, $dst|$dst, $src2}"),
- [(set FR64:$dst, (OpNode FR64:$src1, FR64:$src2))]> {
- let isCommutable = Commutable;
- }
-
- // Scalar operation, reg+mem.
- def SDrm : SDI<opc, MRMSrcMem, (outs FR64:$dst), (ins FR64:$src1, f64mem:$src2),
- !strconcat(OpcodeStr, "sd\t{$src2, $dst|$dst, $src2}"),
- [(set FR64:$dst, (OpNode FR64:$src1, (load addr:$src2)))]>;
-
- // Vector operation, reg+reg.
- def PDrr : PDI<opc, MRMSrcReg, (outs VR128:$dst), (ins VR128:$src1, VR128:$src2),
- !strconcat(OpcodeStr, "pd\t{$src2, $dst|$dst, $src2}"),
- [(set VR128:$dst, (v2f64 (OpNode VR128:$src1, VR128:$src2)))]> {
- let isCommutable = Commutable;
- }
-
- // Vector operation, reg+mem.
- def PDrm : PDI<opc, MRMSrcMem, (outs VR128:$dst), (ins VR128:$src1, f128mem:$src2),
- !strconcat(OpcodeStr, "pd\t{$src2, $dst|$dst, $src2}"),
- [(set VR128:$dst, (OpNode VR128:$src1, (memopv2f64 addr:$src2)))]>;
-
- // Intrinsic operation, reg+reg.
- def SDrr_Int : SDI<opc, MRMSrcReg, (outs VR128:$dst), (ins VR128:$src1, VR128:$src2),
- !strconcat(OpcodeStr, "sd\t{$src2, $dst|$dst, $src2}"),
- [(set VR128:$dst, (F64Int VR128:$src1, VR128:$src2))]> {
- let isCommutable = Commutable;
- }
-
- // Intrinsic operation, reg+mem.
- def SDrm_Int : SDI<opc, MRMSrcMem, (outs VR128:$dst), (ins VR128:$src1, sdmem:$src2),
- !strconcat(OpcodeStr, "sd\t{$src2, $dst|$dst, $src2}"),
- [(set VR128:$dst, (F64Int VR128:$src1,
- sse_load_f64:$src2))]>;
-
- // Vector intrinsic operation, reg+reg.
- def PDrr_Int : PDI<opc, MRMSrcReg, (outs VR128:$dst), (ins VR128:$src1, VR128:$src2),
- !strconcat(OpcodeStr, "pd\t{$src2, $dst|$dst, $src2}"),
- [(set VR128:$dst, (V2F64Int VR128:$src1, VR128:$src2))]> {
- let isCommutable = Commutable;
- }
-
- // Vector intrinsic operation, reg+mem.
- def PDrm_Int : PDI<opc, MRMSrcMem, (outs VR128:$dst), (ins VR128:$src1, f128mem:$src2),
- !strconcat(OpcodeStr, "pd\t{$src2, $dst|$dst, $src2}"),
- [(set VR128:$dst, (V2F64Int VR128:$src1, (load addr:$src2)))]>;
-}
-}
-
-defm MAX : sse2_fp_binop_rm<0x5F, "max", X86fmax,
- int_x86_sse2_max_sd, int_x86_sse2_max_pd>;
-defm MIN : sse2_fp_binop_rm<0x5D, "min", X86fmin,
- int_x86_sse2_min_sd, int_x86_sse2_min_pd>;
-
-//===----------------------------------------------------------------------===//
-// SSE packed FP Instructions
-
-// Move Instructions
-let neverHasSideEffects = 1 in
-def MOVAPDrr : PDI<0x28, MRMSrcReg, (outs VR128:$dst), (ins VR128:$src),
- "movapd\t{$src, $dst|$dst, $src}", []>;
-let isSimpleLoad = 1, isReMaterializable = 1, mayHaveSideEffects = 1 in
-def MOVAPDrm : PDI<0x28, MRMSrcMem, (outs VR128:$dst), (ins f128mem:$src),
- "movapd\t{$src, $dst|$dst, $src}",
- [(set VR128:$dst, (alignedloadv2f64 addr:$src))]>;
-
-def MOVAPDmr : PDI<0x29, MRMDestMem, (outs), (ins f128mem:$dst, VR128:$src),
- "movapd\t{$src, $dst|$dst, $src}",
- [(alignedstore (v2f64 VR128:$src), addr:$dst)]>;
-
-let neverHasSideEffects = 1 in
-def MOVUPDrr : PDI<0x10, MRMSrcReg, (outs VR128:$dst), (ins VR128:$src),
- "movupd\t{$src, $dst|$dst, $src}", []>;
-let isSimpleLoad = 1 in
-def MOVUPDrm : PDI<0x10, MRMSrcMem, (outs VR128:$dst), (ins f128mem:$src),
- "movupd\t{$src, $dst|$dst, $src}",
- [(set VR128:$dst, (loadv2f64 addr:$src))]>;
-def MOVUPDmr : PDI<0x11, MRMDestMem, (outs), (ins f128mem:$dst, VR128:$src),
- "movupd\t{$src, $dst|$dst, $src}",
- [(store (v2f64 VR128:$src), addr:$dst)]>;
-
-// Intrinsic forms of MOVUPD load and store
-def MOVUPDrm_Int : PDI<0x10, MRMSrcMem, (outs VR128:$dst), (ins f128mem:$src),
- "movupd\t{$src, $dst|$dst, $src}",
- [(set VR128:$dst, (int_x86_sse2_loadu_pd addr:$src))]>;
-def MOVUPDmr_Int : PDI<0x11, MRMDestMem, (outs), (ins f128mem:$dst, VR128:$src),
- "movupd\t{$src, $dst|$dst, $src}",
- [(int_x86_sse2_storeu_pd addr:$dst, VR128:$src)]>;
-
-let Constraints = "$src1 = $dst" in {
- let AddedComplexity = 20 in {
- def MOVLPDrm : PDI<0x12, MRMSrcMem,
- (outs VR128:$dst), (ins VR128:$src1, f64mem:$src2),
- "movlpd\t{$src2, $dst|$dst, $src2}",
- [(set VR128:$dst,
- (v2f64 (vector_shuffle VR128:$src1,
- (scalar_to_vector (loadf64 addr:$src2)),
- MOVLP_shuffle_mask)))]>;
- def MOVHPDrm : PDI<0x16, MRMSrcMem,
- (outs VR128:$dst), (ins VR128:$src1, f64mem:$src2),
- "movhpd\t{$src2, $dst|$dst, $src2}",
- [(set VR128:$dst,
- (v2f64 (vector_shuffle VR128:$src1,
- (scalar_to_vector (loadf64 addr:$src2)),
- MOVHP_shuffle_mask)))]>;
- } // AddedComplexity
-} // Constraints = "$src1 = $dst"
-
-def MOVLPDmr : PDI<0x13, MRMDestMem, (outs), (ins f64mem:$dst, VR128:$src),
- "movlpd\t{$src, $dst|$dst, $src}",
- [(store (f64 (vector_extract (v2f64 VR128:$src),
- (iPTR 0))), addr:$dst)]>;
-
-// v2f64 extract element 1 is always custom lowered to unpack high to low
-// and extract element 0 so the non-store version isn't too horrible.
-def MOVHPDmr : PDI<0x17, MRMDestMem, (outs), (ins f64mem:$dst, VR128:$src),
- "movhpd\t{$src, $dst|$dst, $src}",
- [(store (f64 (vector_extract
- (v2f64 (vector_shuffle VR128:$src, (undef),
- UNPCKH_shuffle_mask)), (iPTR 0))),
- addr:$dst)]>;
-
-// SSE2 instructions without OpSize prefix
-def Int_CVTDQ2PSrr : I<0x5B, MRMSrcReg, (outs VR128:$dst), (ins VR128:$src),
- "cvtdq2ps\t{$src, $dst|$dst, $src}",
- [(set VR128:$dst, (int_x86_sse2_cvtdq2ps VR128:$src))]>,
- TB, Requires<[HasSSE2]>;
-def Int_CVTDQ2PSrm : I<0x5B, MRMSrcMem, (outs VR128:$dst), (ins i128mem:$src),
- "cvtdq2ps\t{$src, $dst|$dst, $src}",
- [(set VR128:$dst, (int_x86_sse2_cvtdq2ps
- (bitconvert (memopv2i64 addr:$src))))]>,
- TB, Requires<[HasSSE2]>;
-
-// SSE2 instructions with XS prefix
-def Int_CVTDQ2PDrr : I<0xE6, MRMSrcReg, (outs VR128:$dst), (ins VR128:$src),
- "cvtdq2pd\t{$src, $dst|$dst, $src}",
- [(set VR128:$dst, (int_x86_sse2_cvtdq2pd VR128:$src))]>,
- XS, Requires<[HasSSE2]>;
-def Int_CVTDQ2PDrm : I<0xE6, MRMSrcMem, (outs VR128:$dst), (ins i64mem:$src),
- "cvtdq2pd\t{$src, $dst|$dst, $src}",
- [(set VR128:$dst, (int_x86_sse2_cvtdq2pd
- (bitconvert (memopv2i64 addr:$src))))]>,
- XS, Requires<[HasSSE2]>;
-
-def Int_CVTPS2DQrr : PDI<0x5B, MRMSrcReg, (outs VR128:$dst), (ins VR128:$src),
- "cvtps2dq\t{$src, $dst|$dst, $src}",
- [(set VR128:$dst, (int_x86_sse2_cvtps2dq VR128:$src))]>;
-def Int_CVTPS2DQrm : PDI<0x5B, MRMSrcMem, (outs VR128:$dst), (ins f128mem:$src),
- "cvtps2dq\t{$src, $dst|$dst, $src}",
- [(set VR128:$dst, (int_x86_sse2_cvtps2dq
- (load addr:$src)))]>;
-// SSE2 packed instructions with XS prefix
-def Int_CVTTPS2DQrr : I<0x5B, MRMSrcReg, (outs VR128:$dst), (ins VR128:$src),
- "cvttps2dq\t{$src, $dst|$dst, $src}",
- [(set VR128:$dst, (int_x86_sse2_cvttps2dq VR128:$src))]>,
- XS, Requires<[HasSSE2]>;
-def Int_CVTTPS2DQrm : I<0x5B, MRMSrcMem, (outs VR128:$dst), (ins f128mem:$src),
- "cvttps2dq\t{$src, $dst|$dst, $src}",
- [(set VR128:$dst, (int_x86_sse2_cvttps2dq
- (load addr:$src)))]>,
- XS, Requires<[HasSSE2]>;
-
-// SSE2 packed instructions with XD prefix
-def Int_CVTPD2DQrr : I<0xE6, MRMSrcReg, (outs VR128:$dst), (ins VR128:$src),
- "cvtpd2dq\t{$src, $dst|$dst, $src}",
- [(set VR128:$dst, (int_x86_sse2_cvtpd2dq VR128:$src))]>,
- XD, Requires<[HasSSE2]>;
-def Int_CVTPD2DQrm : I<0xE6, MRMSrcMem, (outs VR128:$dst), (ins f128mem:$src),
- "cvtpd2dq\t{$src, $dst|$dst, $src}",
- [(set VR128:$dst, (int_x86_sse2_cvtpd2dq
- (load addr:$src)))]>,
- XD, Requires<[HasSSE2]>;
-
-def Int_CVTTPD2DQrr : PDI<0xE6, MRMSrcReg, (outs VR128:$dst), (ins VR128:$src),
- "cvttpd2dq\t{$src, $dst|$dst, $src}",
- [(set VR128:$dst, (int_x86_sse2_cvttpd2dq VR128:$src))]>;
-def Int_CVTTPD2DQrm : PDI<0xE6, MRMSrcMem, (outs VR128:$dst),(ins f128mem:$src),
- "cvttpd2dq\t{$src, $dst|$dst, $src}",
- [(set VR128:$dst, (int_x86_sse2_cvttpd2dq
- (load addr:$src)))]>;
-
-// SSE2 instructions without OpSize prefix
-def Int_CVTPS2PDrr : I<0x5A, MRMSrcReg, (outs VR128:$dst), (ins VR128:$src),
- "cvtps2pd\t{$src, $dst|$dst, $src}",
- [(set VR128:$dst, (int_x86_sse2_cvtps2pd VR128:$src))]>,
- TB, Requires<[HasSSE2]>;
-def Int_CVTPS2PDrm : I<0x5A, MRMSrcReg, (outs VR128:$dst), (ins f64mem:$src),
- "cvtps2pd\t{$src, $dst|$dst, $src}",
- [(set VR128:$dst, (int_x86_sse2_cvtps2pd
- (load addr:$src)))]>,
- TB, Requires<[HasSSE2]>;
-
-def Int_CVTPD2PSrr : PDI<0x5A, MRMSrcReg, (outs VR128:$dst), (ins VR128:$src),
- "cvtpd2ps\t{$src, $dst|$dst, $src}",
- [(set VR128:$dst, (int_x86_sse2_cvtpd2ps VR128:$src))]>;
-def Int_CVTPD2PSrm : PDI<0x5A, MRMSrcReg, (outs VR128:$dst), (ins f128mem:$src),
- "cvtpd2ps\t{$src, $dst|$dst, $src}",
- [(set VR128:$dst, (int_x86_sse2_cvtpd2ps
- (load addr:$src)))]>;
-
-// Match intrinsics which expect XMM operand(s).
-// Aliases for intrinsics
-let Constraints = "$src1 = $dst" in {
-def Int_CVTSI2SDrr: SDI<0x2A, MRMSrcReg,
- (outs VR128:$dst), (ins VR128:$src1, GR32:$src2),
- "cvtsi2sd\t{$src2, $dst|$dst, $src2}",
- [(set VR128:$dst, (int_x86_sse2_cvtsi2sd VR128:$src1,
- GR32:$src2))]>;
-def Int_CVTSI2SDrm: SDI<0x2A, MRMSrcMem,
- (outs VR128:$dst), (ins VR128:$src1, i32mem:$src2),
- "cvtsi2sd\t{$src2, $dst|$dst, $src2}",
- [(set VR128:$dst, (int_x86_sse2_cvtsi2sd VR128:$src1,
- (loadi32 addr:$src2)))]>;
-def Int_CVTSD2SSrr: SDI<0x5A, MRMSrcReg,
- (outs VR128:$dst), (ins VR128:$src1, VR128:$src2),
- "cvtsd2ss\t{$src2, $dst|$dst, $src2}",
- [(set VR128:$dst, (int_x86_sse2_cvtsd2ss VR128:$src1,
- VR128:$src2))]>;
-def Int_CVTSD2SSrm: SDI<0x5A, MRMSrcMem,
- (outs VR128:$dst), (ins VR128:$src1, f64mem:$src2),
- "cvtsd2ss\t{$src2, $dst|$dst, $src2}",
- [(set VR128:$dst, (int_x86_sse2_cvtsd2ss VR128:$src1,
- (load addr:$src2)))]>;
-def Int_CVTSS2SDrr: I<0x5A, MRMSrcReg,
- (outs VR128:$dst), (ins VR128:$src1, VR128:$src2),
- "cvtss2sd\t{$src2, $dst|$dst, $src2}",
- [(set VR128:$dst, (int_x86_sse2_cvtss2sd VR128:$src1,
- VR128:$src2))]>, XS,
- Requires<[HasSSE2]>;
-def Int_CVTSS2SDrm: I<0x5A, MRMSrcMem,
- (outs VR128:$dst), (ins VR128:$src1, f32mem:$src2),
- "cvtss2sd\t{$src2, $dst|$dst, $src2}",
- [(set VR128:$dst, (int_x86_sse2_cvtss2sd VR128:$src1,
- (load addr:$src2)))]>, XS,
- Requires<[HasSSE2]>;
-}
-
-// Arithmetic
-
-/// sse2_fp_unop_rm - SSE2 unops come in both scalar and vector forms.
-///
-/// In addition, we also have a special variant of the scalar form here to
-/// represent the associated intrinsic operation. This form is unlike the
-/// plain scalar form, in that it takes an entire vector (instead of a
-/// scalar) and leaves the top elements undefined.
-///
-/// And, we have a special variant form for a full-vector intrinsic form.
-///
-/// These four forms can each have a reg or a mem operand, so there are a
-/// total of eight "instructions".
-///
-multiclass sse2_fp_unop_rm<bits<8> opc, string OpcodeStr,
- SDNode OpNode,
- Intrinsic F64Int,
- Intrinsic V2F64Int,
- bit Commutable = 0> {
- // Scalar operation, reg.
- def SDr : SDI<opc, MRMSrcReg, (outs FR64:$dst), (ins FR64:$src),
- !strconcat(OpcodeStr, "sd\t{$src, $dst|$dst, $src}"),
- [(set FR64:$dst, (OpNode FR64:$src))]> {
- let isCommutable = Commutable;
- }
-
- // Scalar operation, mem.
- def SDm : SDI<opc, MRMSrcMem, (outs FR64:$dst), (ins f64mem:$src),
- !strconcat(OpcodeStr, "sd\t{$src, $dst|$dst, $src}"),
- [(set FR64:$dst, (OpNode (load addr:$src)))]>;
-
- // Vector operation, reg.
- def PDr : PDI<opc, MRMSrcReg, (outs VR128:$dst), (ins VR128:$src),
- !strconcat(OpcodeStr, "pd\t{$src, $dst|$dst, $src}"),
- [(set VR128:$dst, (v2f64 (OpNode VR128:$src)))]> {
- let isCommutable = Commutable;
- }
-
- // Vector operation, mem.
- def PDm : PDI<opc, MRMSrcMem, (outs VR128:$dst), (ins f128mem:$src),
- !strconcat(OpcodeStr, "pd\t{$src, $dst|$dst, $src}"),
- [(set VR128:$dst, (OpNode (memopv2f64 addr:$src)))]>;
-
- // Intrinsic operation, reg.
- def SDr_Int : SDI<opc, MRMSrcReg, (outs VR128:$dst), (ins VR128:$src),
- !strconcat(OpcodeStr, "sd\t{$src, $dst|$dst, $src}"),
- [(set VR128:$dst, (F64Int VR128:$src))]> {
- let isCommutable = Commutable;
- }
-
- // Intrinsic operation, mem.
- def SDm_Int : SDI<opc, MRMSrcMem, (outs VR128:$dst), (ins sdmem:$src),
- !strconcat(OpcodeStr, "sd\t{$src, $dst|$dst, $src}"),
- [(set VR128:$dst, (F64Int sse_load_f64:$src))]>;
-
- // Vector intrinsic operation, reg
- def PDr_Int : PDI<opc, MRMSrcReg, (outs VR128:$dst), (ins VR128:$src),
- !strconcat(OpcodeStr, "pd\t{$src, $dst|$dst, $src}"),
- [(set VR128:$dst, (V2F64Int VR128:$src))]> {
- let isCommutable = Commutable;
- }
-
- // Vector intrinsic operation, mem
- def PDm_Int : PDI<opc, MRMSrcMem, (outs VR128:$dst), (ins f128mem:$src),
- !strconcat(OpcodeStr, "pd\t{$src, $dst|$dst, $src}"),
- [(set VR128:$dst, (V2F64Int (load addr:$src)))]>;
-}
-
-// Square root.
-defm SQRT : sse2_fp_unop_rm<0x51, "sqrt", fsqrt,
- int_x86_sse2_sqrt_sd, int_x86_sse2_sqrt_pd>;
-
-// There is no f64 version of the reciprocal approximation instructions.
-
-// Logical
-let Constraints = "$src1 = $dst" in {
- let isCommutable = 1 in {
- def ANDPDrr : PDI<0x54, MRMSrcReg,
- (outs VR128:$dst), (ins VR128:$src1, VR128:$src2),
- "andpd\t{$src2, $dst|$dst, $src2}",
- [(set VR128:$dst,
- (and (bc_v2i64 (v2f64 VR128:$src1)),
- (bc_v2i64 (v2f64 VR128:$src2))))]>;
- def ORPDrr : PDI<0x56, MRMSrcReg,
- (outs VR128:$dst), (ins VR128:$src1, VR128:$src2),
- "orpd\t{$src2, $dst|$dst, $src2}",
- [(set VR128:$dst,
- (or (bc_v2i64 (v2f64 VR128:$src1)),
- (bc_v2i64 (v2f64 VR128:$src2))))]>;
- def XORPDrr : PDI<0x57, MRMSrcReg,
- (outs VR128:$dst), (ins VR128:$src1, VR128:$src2),
- "xorpd\t{$src2, $dst|$dst, $src2}",
- [(set VR128:$dst,
- (xor (bc_v2i64 (v2f64 VR128:$src1)),
- (bc_v2i64 (v2f64 VR128:$src2))))]>;
- }
-
- def ANDPDrm : PDI<0x54, MRMSrcMem,
- (outs VR128:$dst), (ins VR128:$src1, f128mem:$src2),
- "andpd\t{$src2, $dst|$dst, $src2}",
- [(set VR128:$dst,
- (and (bc_v2i64 (v2f64 VR128:$src1)),
- (memopv2i64 addr:$src2)))]>;
- def ORPDrm : PDI<0x56, MRMSrcMem,
- (outs VR128:$dst), (ins VR128:$src1, f128mem:$src2),
- "orpd\t{$src2, $dst|$dst, $src2}",
- [(set VR128:$dst,
- (or (bc_v2i64 (v2f64 VR128:$src1)),
- (memopv2i64 addr:$src2)))]>;
- def XORPDrm : PDI<0x57, MRMSrcMem,
- (outs VR128:$dst), (ins VR128:$src1, f128mem:$src2),
- "xorpd\t{$src2, $dst|$dst, $src2}",
- [(set VR128:$dst,
- (xor (bc_v2i64 (v2f64 VR128:$src1)),
- (memopv2i64 addr:$src2)))]>;
- def ANDNPDrr : PDI<0x55, MRMSrcReg,
- (outs VR128:$dst), (ins VR128:$src1, VR128:$src2),
- "andnpd\t{$src2, $dst|$dst, $src2}",
- [(set VR128:$dst,
- (and (vnot (bc_v2i64 (v2f64 VR128:$src1))),
- (bc_v2i64 (v2f64 VR128:$src2))))]>;
- def ANDNPDrm : PDI<0x55, MRMSrcMem,
- (outs VR128:$dst), (ins VR128:$src1,f128mem:$src2),
- "andnpd\t{$src2, $dst|$dst, $src2}",
- [(set VR128:$dst,
- (and (vnot (bc_v2i64 (v2f64 VR128:$src1))),
- (memopv2i64 addr:$src2)))]>;
-}
-
-let Constraints = "$src1 = $dst" in {
- def CMPPDrri : PDIi8<0xC2, MRMSrcReg,
- (outs VR128:$dst), (ins VR128:$src1, VR128:$src, SSECC:$cc),
- "cmp${cc}pd\t{$src, $dst|$dst, $src}",
- [(set VR128:$dst, (int_x86_sse2_cmp_pd VR128:$src1,
- VR128:$src, imm:$cc))]>;
- def CMPPDrmi : PDIi8<0xC2, MRMSrcMem,
- (outs VR128:$dst), (ins VR128:$src1, f128mem:$src, SSECC:$cc),
- "cmp${cc}pd\t{$src, $dst|$dst, $src}",
- [(set VR128:$dst, (int_x86_sse2_cmp_pd VR128:$src1,
- (load addr:$src), imm:$cc))]>;
-}
-
-// Shuffle and unpack instructions
-let Constraints = "$src1 = $dst" in {
- def SHUFPDrri : PDIi8<0xC6, MRMSrcReg,
- (outs VR128:$dst), (ins VR128:$src1, VR128:$src2, i8imm:$src3),
- "shufpd\t{$src3, $src2, $dst|$dst, $src2, $src3}",
- [(set VR128:$dst, (v2f64 (vector_shuffle
- VR128:$src1, VR128:$src2,
- SHUFP_shuffle_mask:$src3)))]>;
- def SHUFPDrmi : PDIi8<0xC6, MRMSrcMem,
- (outs VR128:$dst), (ins VR128:$src1,
- f128mem:$src2, i8imm:$src3),
- "shufpd\t{$src3, $src2, $dst|$dst, $src2, $src3}",
- [(set VR128:$dst,
- (v2f64 (vector_shuffle
- VR128:$src1, (memopv2f64 addr:$src2),
- SHUFP_shuffle_mask:$src3)))]>;
-
- let AddedComplexity = 10 in {
- def UNPCKHPDrr : PDI<0x15, MRMSrcReg,
- (outs VR128:$dst), (ins VR128:$src1, VR128:$src2),
- "unpckhpd\t{$src2, $dst|$dst, $src2}",
- [(set VR128:$dst,
- (v2f64 (vector_shuffle
- VR128:$src1, VR128:$src2,
- UNPCKH_shuffle_mask)))]>;
- def UNPCKHPDrm : PDI<0x15, MRMSrcMem,
- (outs VR128:$dst), (ins VR128:$src1, f128mem:$src2),
- "unpckhpd\t{$src2, $dst|$dst, $src2}",
- [(set VR128:$dst,
- (v2f64 (vector_shuffle
- VR128:$src1, (memopv2f64 addr:$src2),
- UNPCKH_shuffle_mask)))]>;
-
- def UNPCKLPDrr : PDI<0x14, MRMSrcReg,
- (outs VR128:$dst), (ins VR128:$src1, VR128:$src2),
- "unpcklpd\t{$src2, $dst|$dst, $src2}",
- [(set VR128:$dst,
- (v2f64 (vector_shuffle
- VR128:$src1, VR128:$src2,
- UNPCKL_shuffle_mask)))]>;
- def UNPCKLPDrm : PDI<0x14, MRMSrcMem,
- (outs VR128:$dst), (ins VR128:$src1, f128mem:$src2),
- "unpcklpd\t{$src2, $dst|$dst, $src2}",
- [(set VR128:$dst,
- (v2f64 (vector_shuffle
- VR128:$src1, (memopv2f64 addr:$src2),
- UNPCKL_shuffle_mask)))]>;
- } // AddedComplexity
-} // Constraints = "$src1 = $dst"
-
-
-//===----------------------------------------------------------------------===//
-// SSE integer instructions
-
-// Move Instructions
-let neverHasSideEffects = 1 in
-def MOVDQArr : PDI<0x6F, MRMSrcReg, (outs VR128:$dst), (ins VR128:$src),
- "movdqa\t{$src, $dst|$dst, $src}", []>;
-let isSimpleLoad = 1, mayLoad = 1 in
-def MOVDQArm : PDI<0x6F, MRMSrcMem, (outs VR128:$dst), (ins i128mem:$src),
- "movdqa\t{$src, $dst|$dst, $src}",
- [/*(set VR128:$dst, (alignedloadv2i64 addr:$src))*/]>;
-let mayStore = 1 in
-def MOVDQAmr : PDI<0x7F, MRMDestMem, (outs), (ins i128mem:$dst, VR128:$src),
- "movdqa\t{$src, $dst|$dst, $src}",
- [/*(alignedstore (v2i64 VR128:$src), addr:$dst)*/]>;
-let isSimpleLoad = 1, mayLoad = 1 in
-def MOVDQUrm : I<0x6F, MRMSrcMem, (outs VR128:$dst), (ins i128mem:$src),
- "movdqu\t{$src, $dst|$dst, $src}",
- [/*(set VR128:$dst, (loadv2i64 addr:$src))*/]>,
- XS, Requires<[HasSSE2]>;
-let mayStore = 1 in
-def MOVDQUmr : I<0x7F, MRMDestMem, (outs), (ins i128mem:$dst, VR128:$src),
- "movdqu\t{$src, $dst|$dst, $src}",
- [/*(store (v2i64 VR128:$src), addr:$dst)*/]>,
- XS, Requires<[HasSSE2]>;
-
-// Intrinsic forms of MOVDQU load and store
-let isSimpleLoad = 1 in
-def MOVDQUrm_Int : I<0x6F, MRMSrcMem, (outs VR128:$dst), (ins i128mem:$src),
- "movdqu\t{$src, $dst|$dst, $src}",
- [(set VR128:$dst, (int_x86_sse2_loadu_dq addr:$src))]>,
- XS, Requires<[HasSSE2]>;
-def MOVDQUmr_Int : I<0x7F, MRMDestMem, (outs), (ins i128mem:$dst, VR128:$src),
- "movdqu\t{$src, $dst|$dst, $src}",
- [(int_x86_sse2_storeu_dq addr:$dst, VR128:$src)]>,
- XS, Requires<[HasSSE2]>;
-
-let Constraints = "$src1 = $dst" in {
-
-multiclass PDI_binop_rm_int<bits<8> opc, string OpcodeStr, Intrinsic IntId,
- bit Commutable = 0> {
- def rr : PDI<opc, MRMSrcReg, (outs VR128:$dst), (ins VR128:$src1, VR128:$src2),
- !strconcat(OpcodeStr, "\t{$src2, $dst|$dst, $src2}"),
- [(set VR128:$dst, (IntId VR128:$src1, VR128:$src2))]> {
- let isCommutable = Commutable;
- }
- def rm : PDI<opc, MRMSrcMem, (outs VR128:$dst), (ins VR128:$src1, i128mem:$src2),
- !strconcat(OpcodeStr, "\t{$src2, $dst|$dst, $src2}"),
- [(set VR128:$dst, (IntId VR128:$src1,
- (bitconvert (memopv2i64 addr:$src2))))]>;
-}
-
-multiclass PDI_binop_rmi_int<bits<8> opc, bits<8> opc2, Format ImmForm,
- string OpcodeStr,
- Intrinsic IntId, Intrinsic IntId2> {
- def rr : PDI<opc, MRMSrcReg, (outs VR128:$dst), (ins VR128:$src1, VR128:$src2),
- !strconcat(OpcodeStr, "\t{$src2, $dst|$dst, $src2}"),
- [(set VR128:$dst, (IntId VR128:$src1, VR128:$src2))]>;
- def rm : PDI<opc, MRMSrcMem, (outs VR128:$dst), (ins VR128:$src1, i128mem:$src2),
- !strconcat(OpcodeStr, "\t{$src2, $dst|$dst, $src2}"),
- [(set VR128:$dst, (IntId VR128:$src1,
- (bitconvert (memopv2i64 addr:$src2))))]>;
- def ri : PDIi8<opc2, ImmForm, (outs VR128:$dst), (ins VR128:$src1, i32i8imm:$src2),
- !strconcat(OpcodeStr, "\t{$src2, $dst|$dst, $src2}"),
- [(set VR128:$dst, (IntId2 VR128:$src1, (i32 imm:$src2)))]>;
-}
-
-/// PDI_binop_rm - Simple SSE2 binary operator.
-multiclass PDI_binop_rm<bits<8> opc, string OpcodeStr, SDNode OpNode,
- ValueType OpVT, bit Commutable = 0> {
- def rr : PDI<opc, MRMSrcReg, (outs VR128:$dst), (ins VR128:$src1, VR128:$src2),
- !strconcat(OpcodeStr, "\t{$src2, $dst|$dst, $src2}"),
- [(set VR128:$dst, (OpVT (OpNode VR128:$src1, VR128:$src2)))]> {
- let isCommutable = Commutable;
- }
- def rm : PDI<opc, MRMSrcMem, (outs VR128:$dst), (ins VR128:$src1, i128mem:$src2),
- !strconcat(OpcodeStr, "\t{$src2, $dst|$dst, $src2}"),
- [(set VR128:$dst, (OpVT (OpNode VR128:$src1,
- (bitconvert (memopv2i64 addr:$src2)))))]>;
-}
-
-/// PDI_binop_rm_v2i64 - Simple SSE2 binary operator whose type is v2i64.
-///
-/// FIXME: we could eliminate this and use PDI_binop_rm instead if tblgen knew
-/// to collapse (bitconvert VT to VT) into its operand.
-///
-multiclass PDI_binop_rm_v2i64<bits<8> opc, string OpcodeStr, SDNode OpNode,
- bit Commutable = 0> {
- def rr : PDI<opc, MRMSrcReg, (outs VR128:$dst), (ins VR128:$src1, VR128:$src2),
- !strconcat(OpcodeStr, "\t{$src2, $dst|$dst, $src2}"),
- [(set VR128:$dst, (v2i64 (OpNode VR128:$src1, VR128:$src2)))]> {
- let isCommutable = Commutable;
- }
- def rm : PDI<opc, MRMSrcMem, (outs VR128:$dst), (ins VR128:$src1, i128mem:$src2),
- !strconcat(OpcodeStr, "\t{$src2, $dst|$dst, $src2}"),
- [(set VR128:$dst, (OpNode VR128:$src1,(memopv2i64 addr:$src2)))]>;
-}
-
-} // Constraints = "$src1 = $dst"
-
-// 128-bit Integer Arithmetic
-
-defm PADDB : PDI_binop_rm<0xFC, "paddb", add, v16i8, 1>;
-defm PADDW : PDI_binop_rm<0xFD, "paddw", add, v8i16, 1>;
-defm PADDD : PDI_binop_rm<0xFE, "paddd", add, v4i32, 1>;
-defm PADDQ : PDI_binop_rm_v2i64<0xD4, "paddq", add, 1>;
-
-defm PADDSB : PDI_binop_rm_int<0xEC, "paddsb" , int_x86_sse2_padds_b, 1>;
-defm PADDSW : PDI_binop_rm_int<0xED, "paddsw" , int_x86_sse2_padds_w, 1>;
-defm PADDUSB : PDI_binop_rm_int<0xDC, "paddusb", int_x86_sse2_paddus_b, 1>;
-defm PADDUSW : PDI_binop_rm_int<0xDD, "paddusw", int_x86_sse2_paddus_w, 1>;
-
-defm PSUBB : PDI_binop_rm<0xF8, "psubb", sub, v16i8>;
-defm PSUBW : PDI_binop_rm<0xF9, "psubw", sub, v8i16>;
-defm PSUBD : PDI_binop_rm<0xFA, "psubd", sub, v4i32>;
-defm PSUBQ : PDI_binop_rm_v2i64<0xFB, "psubq", sub>;
-
-defm PSUBSB : PDI_binop_rm_int<0xE8, "psubsb" , int_x86_sse2_psubs_b>;
-defm PSUBSW : PDI_binop_rm_int<0xE9, "psubsw" , int_x86_sse2_psubs_w>;
-defm PSUBUSB : PDI_binop_rm_int<0xD8, "psubusb", int_x86_sse2_psubus_b>;
-defm PSUBUSW : PDI_binop_rm_int<0xD9, "psubusw", int_x86_sse2_psubus_w>;
-
-defm PMULLW : PDI_binop_rm<0xD5, "pmullw", mul, v8i16, 1>;
-
-defm PMULHUW : PDI_binop_rm_int<0xE4, "pmulhuw", int_x86_sse2_pmulhu_w, 1>;
-defm PMULHW : PDI_binop_rm_int<0xE5, "pmulhw" , int_x86_sse2_pmulh_w , 1>;
-defm PMULUDQ : PDI_binop_rm_int<0xF4, "pmuludq", int_x86_sse2_pmulu_dq, 1>;
-
-defm PMADDWD : PDI_binop_rm_int<0xF5, "pmaddwd", int_x86_sse2_pmadd_wd, 1>;
-
-defm PAVGB : PDI_binop_rm_int<0xE0, "pavgb", int_x86_sse2_pavg_b, 1>;
-defm PAVGW : PDI_binop_rm_int<0xE3, "pavgw", int_x86_sse2_pavg_w, 1>;
-
-
-defm PMINUB : PDI_binop_rm_int<0xDA, "pminub", int_x86_sse2_pminu_b, 1>;
-defm PMINSW : PDI_binop_rm_int<0xEA, "pminsw", int_x86_sse2_pmins_w, 1>;
-defm PMAXUB : PDI_binop_rm_int<0xDE, "pmaxub", int_x86_sse2_pmaxu_b, 1>;
-defm PMAXSW : PDI_binop_rm_int<0xEE, "pmaxsw", int_x86_sse2_pmaxs_w, 1>;
-defm PSADBW : PDI_binop_rm_int<0xE0, "psadbw", int_x86_sse2_psad_bw, 1>;
-
-
-defm PSLLW : PDI_binop_rmi_int<0xF1, 0x71, MRM6r, "psllw",
- int_x86_sse2_psll_w, int_x86_sse2_pslli_w>;
-defm PSLLD : PDI_binop_rmi_int<0xF2, 0x72, MRM6r, "pslld",
- int_x86_sse2_psll_d, int_x86_sse2_pslli_d>;
-defm PSLLQ : PDI_binop_rmi_int<0xF3, 0x73, MRM6r, "psllq",
- int_x86_sse2_psll_q, int_x86_sse2_pslli_q>;
-
-defm PSRLW : PDI_binop_rmi_int<0xD1, 0x71, MRM2r, "psrlw",
- int_x86_sse2_psrl_w, int_x86_sse2_psrli_w>;
-defm PSRLD : PDI_binop_rmi_int<0xD2, 0x72, MRM2r, "psrld",
- int_x86_sse2_psrl_d, int_x86_sse2_psrli_d>;
-defm PSRLQ : PDI_binop_rmi_int<0xD3, 0x73, MRM2r, "psrlq",
- int_x86_sse2_psrl_q, int_x86_sse2_psrli_q>;
-
-defm PSRAW : PDI_binop_rmi_int<0xE1, 0x71, MRM4r, "psraw",
- int_x86_sse2_psra_w, int_x86_sse2_psrai_w>;
-defm PSRAD : PDI_binop_rmi_int<0xE2, 0x72, MRM4r, "psrad",
- int_x86_sse2_psra_d, int_x86_sse2_psrai_d>;
-
-// 128-bit logical shifts.
-let Constraints = "$src1 = $dst", neverHasSideEffects = 1 in {
- def PSLLDQri : PDIi8<0x73, MRM7r,
- (outs VR128:$dst), (ins VR128:$src1, i32i8imm:$src2),
- "pslldq\t{$src2, $dst|$dst, $src2}", []>;
- def PSRLDQri : PDIi8<0x73, MRM3r,
- (outs VR128:$dst), (ins VR128:$src1, i32i8imm:$src2),
- "psrldq\t{$src2, $dst|$dst, $src2}", []>;
- // PSRADQri doesn't exist in SSE[1-3].
-}
-
-let Predicates = [HasSSE2] in {
- def : Pat<(int_x86_sse2_psll_dq VR128:$src1, imm:$src2),
- (v2i64 (PSLLDQri VR128:$src1, (PSxLDQ_imm imm:$src2)))>;
- def : Pat<(int_x86_sse2_psrl_dq VR128:$src1, imm:$src2),
- (v2i64 (PSRLDQri VR128:$src1, (PSxLDQ_imm imm:$src2)))>;
- def : Pat<(v2f64 (X86fsrl VR128:$src1, i32immSExt8:$src2)),
- (v2f64 (PSRLDQri VR128:$src1, (PSxLDQ_imm imm:$src2)))>;
-}
-
-// Logical
-defm PAND : PDI_binop_rm_v2i64<0xDB, "pand", and, 1>;
-defm POR : PDI_binop_rm_v2i64<0xEB, "por" , or , 1>;
-defm PXOR : PDI_binop_rm_v2i64<0xEF, "pxor", xor, 1>;
-
-let Constraints = "$src1 = $dst" in {
- def PANDNrr : PDI<0xDF, MRMSrcReg,
- (outs VR128:$dst), (ins VR128:$src1, VR128:$src2),
- "pandn\t{$src2, $dst|$dst, $src2}",
- [(set VR128:$dst, (v2i64 (and (vnot VR128:$src1),
- VR128:$src2)))]>;
-
- def PANDNrm : PDI<0xDF, MRMSrcMem,
- (outs VR128:$dst), (ins VR128:$src1, i128mem:$src2),
- "pandn\t{$src2, $dst|$dst, $src2}",
- [(set VR128:$dst, (v2i64 (and (vnot VR128:$src1),
- (memopv2i64 addr:$src2))))]>;
-}
-
-// SSE2 Integer comparison
-defm PCMPEQB : PDI_binop_rm_int<0x74, "pcmpeqb", int_x86_sse2_pcmpeq_b>;
-defm PCMPEQW : PDI_binop_rm_int<0x75, "pcmpeqw", int_x86_sse2_pcmpeq_w>;
-defm PCMPEQD : PDI_binop_rm_int<0x76, "pcmpeqd", int_x86_sse2_pcmpeq_d>;
-defm PCMPGTB : PDI_binop_rm_int<0x64, "pcmpgtb", int_x86_sse2_pcmpgt_b>;
-defm PCMPGTW : PDI_binop_rm_int<0x65, "pcmpgtw", int_x86_sse2_pcmpgt_w>;
-defm PCMPGTD : PDI_binop_rm_int<0x66, "pcmpgtd", int_x86_sse2_pcmpgt_d>;
-
-// Pack instructions
-defm PACKSSWB : PDI_binop_rm_int<0x63, "packsswb", int_x86_sse2_packsswb_128>;
-defm PACKSSDW : PDI_binop_rm_int<0x6B, "packssdw", int_x86_sse2_packssdw_128>;
-defm PACKUSWB : PDI_binop_rm_int<0x67, "packuswb", int_x86_sse2_packuswb_128>;
-
-// Shuffle and unpack instructions
-def PSHUFDri : PDIi8<0x70, MRMSrcReg,
- (outs VR128:$dst), (ins VR128:$src1, i8imm:$src2),
- "pshufd\t{$src2, $src1, $dst|$dst, $src1, $src2}",
- [(set VR128:$dst, (v4i32 (vector_shuffle
- VR128:$src1, (undef),
- PSHUFD_shuffle_mask:$src2)))]>;
-def PSHUFDmi : PDIi8<0x70, MRMSrcMem,
- (outs VR128:$dst), (ins i128mem:$src1, i8imm:$src2),
- "pshufd\t{$src2, $src1, $dst|$dst, $src1, $src2}",
- [(set VR128:$dst, (v4i32 (vector_shuffle
- (bc_v4i32(memopv2i64 addr:$src1)),
- (undef),
- PSHUFD_shuffle_mask:$src2)))]>;
-
-// SSE2 with ImmT == Imm8 and XS prefix.
-def PSHUFHWri : Ii8<0x70, MRMSrcReg,
- (outs VR128:$dst), (ins VR128:$src1, i8imm:$src2),
- "pshufhw\t{$src2, $src1, $dst|$dst, $src1, $src2}",
- [(set VR128:$dst, (v8i16 (vector_shuffle
- VR128:$src1, (undef),
- PSHUFHW_shuffle_mask:$src2)))]>,
- XS, Requires<[HasSSE2]>;
-def PSHUFHWmi : Ii8<0x70, MRMSrcMem,
- (outs VR128:$dst), (ins i128mem:$src1, i8imm:$src2),
- "pshufhw\t{$src2, $src1, $dst|$dst, $src1, $src2}",
- [(set VR128:$dst, (v8i16 (vector_shuffle
- (bc_v8i16 (memopv2i64 addr:$src1)),
- (undef),
- PSHUFHW_shuffle_mask:$src2)))]>,
- XS, Requires<[HasSSE2]>;
-
-// SSE2 with ImmT == Imm8 and XD prefix.
-def PSHUFLWri : Ii8<0x70, MRMSrcReg,
- (outs VR128:$dst), (ins VR128:$src1, i32i8imm:$src2),
- "pshuflw\t{$src2, $src1, $dst|$dst, $src1, $src2}",
- [(set VR128:$dst, (v8i16 (vector_shuffle
- VR128:$src1, (undef),
- PSHUFLW_shuffle_mask:$src2)))]>,
- XD, Requires<[HasSSE2]>;
-def PSHUFLWmi : Ii8<0x70, MRMSrcMem,
- (outs VR128:$dst), (ins i128mem:$src1, i32i8imm:$src2),
- "pshuflw\t{$src2, $src1, $dst|$dst, $src1, $src2}",
- [(set VR128:$dst, (v8i16 (vector_shuffle
- (bc_v8i16 (memopv2i64 addr:$src1)),
- (undef),
- PSHUFLW_shuffle_mask:$src2)))]>,
- XD, Requires<[HasSSE2]>;
-
-
-let Constraints = "$src1 = $dst" in {
- def PUNPCKLBWrr : PDI<0x60, MRMSrcReg,
- (outs VR128:$dst), (ins VR128:$src1, VR128:$src2),
- "punpcklbw\t{$src2, $dst|$dst, $src2}",
- [(set VR128:$dst,
- (v16i8 (vector_shuffle VR128:$src1, VR128:$src2,
- UNPCKL_shuffle_mask)))]>;
- def PUNPCKLBWrm : PDI<0x60, MRMSrcMem,
- (outs VR128:$dst), (ins VR128:$src1, i128mem:$src2),
- "punpcklbw\t{$src2, $dst|$dst, $src2}",
- [(set VR128:$dst,
- (v16i8 (vector_shuffle VR128:$src1,
- (bc_v16i8 (memopv2i64 addr:$src2)),
- UNPCKL_shuffle_mask)))]>;
- def PUNPCKLWDrr : PDI<0x61, MRMSrcReg,
- (outs VR128:$dst), (ins VR128:$src1, VR128:$src2),
- "punpcklwd\t{$src2, $dst|$dst, $src2}",
- [(set VR128:$dst,
- (v8i16 (vector_shuffle VR128:$src1, VR128:$src2,
- UNPCKL_shuffle_mask)))]>;
- def PUNPCKLWDrm : PDI<0x61, MRMSrcMem,
- (outs VR128:$dst), (ins VR128:$src1, i128mem:$src2),
- "punpcklwd\t{$src2, $dst|$dst, $src2}",
- [(set VR128:$dst,
- (v8i16 (vector_shuffle VR128:$src1,
- (bc_v8i16 (memopv2i64 addr:$src2)),
- UNPCKL_shuffle_mask)))]>;
- def PUNPCKLDQrr : PDI<0x62, MRMSrcReg,
- (outs VR128:$dst), (ins VR128:$src1, VR128:$src2),
- "punpckldq\t{$src2, $dst|$dst, $src2}",
- [(set VR128:$dst,
- (v4i32 (vector_shuffle VR128:$src1, VR128:$src2,
- UNPCKL_shuffle_mask)))]>;
- def PUNPCKLDQrm : PDI<0x62, MRMSrcMem,
- (outs VR128:$dst), (ins VR128:$src1, i128mem:$src2),
- "punpckldq\t{$src2, $dst|$dst, $src2}",
- [(set VR128:$dst,
- (v4i32 (vector_shuffle VR128:$src1,
- (bc_v4i32 (memopv2i64 addr:$src2)),
- UNPCKL_shuffle_mask)))]>;
- def PUNPCKLQDQrr : PDI<0x6C, MRMSrcReg,
- (outs VR128:$dst), (ins VR128:$src1, VR128:$src2),
- "punpcklqdq\t{$src2, $dst|$dst, $src2}",
- [(set VR128:$dst,
- (v2i64 (vector_shuffle VR128:$src1, VR128:$src2,
- UNPCKL_shuffle_mask)))]>;
- def PUNPCKLQDQrm : PDI<0x6C, MRMSrcMem,
- (outs VR128:$dst), (ins VR128:$src1, i128mem:$src2),
- "punpcklqdq\t{$src2, $dst|$dst, $src2}",
- [(set VR128:$dst,
- (v2i64 (vector_shuffle VR128:$src1,
- (memopv2i64 addr:$src2),
- UNPCKL_shuffle_mask)))]>;
-
- def PUNPCKHBWrr : PDI<0x68, MRMSrcReg,
- (outs VR128:$dst), (ins VR128:$src1, VR128:$src2),
- "punpckhbw\t{$src2, $dst|$dst, $src2}",
- [(set VR128:$dst,
- (v16i8 (vector_shuffle VR128:$src1, VR128:$src2,
- UNPCKH_shuffle_mask)))]>;
- def PUNPCKHBWrm : PDI<0x68, MRMSrcMem,
- (outs VR128:$dst), (ins VR128:$src1, i128mem:$src2),
- "punpckhbw\t{$src2, $dst|$dst, $src2}",
- [(set VR128:$dst,
- (v16i8 (vector_shuffle VR128:$src1,
- (bc_v16i8 (memopv2i64 addr:$src2)),
- UNPCKH_shuffle_mask)))]>;
- def PUNPCKHWDrr : PDI<0x69, MRMSrcReg,
- (outs VR128:$dst), (ins VR128:$src1, VR128:$src2),
- "punpckhwd\t{$src2, $dst|$dst, $src2}",
- [(set VR128:$dst,
- (v8i16 (vector_shuffle VR128:$src1, VR128:$src2,
- UNPCKH_shuffle_mask)))]>;
- def PUNPCKHWDrm : PDI<0x69, MRMSrcMem,
- (outs VR128:$dst), (ins VR128:$src1, i128mem:$src2),
- "punpckhwd\t{$src2, $dst|$dst, $src2}",
- [(set VR128:$dst,
- (v8i16 (vector_shuffle VR128:$src1,
- (bc_v8i16 (memopv2i64 addr:$src2)),
- UNPCKH_shuffle_mask)))]>;
- def PUNPCKHDQrr : PDI<0x6A, MRMSrcReg,
- (outs VR128:$dst), (ins VR128:$src1, VR128:$src2),
- "punpckhdq\t{$src2, $dst|$dst, $src2}",
- [(set VR128:$dst,
- (v4i32 (vector_shuffle VR128:$src1, VR128:$src2,
- UNPCKH_shuffle_mask)))]>;
- def PUNPCKHDQrm : PDI<0x6A, MRMSrcMem,
- (outs VR128:$dst), (ins VR128:$src1, i128mem:$src2),
- "punpckhdq\t{$src2, $dst|$dst, $src2}",
- [(set VR128:$dst,
- (v4i32 (vector_shuffle VR128:$src1,
- (bc_v4i32 (memopv2i64 addr:$src2)),
- UNPCKH_shuffle_mask)))]>;
- def PUNPCKHQDQrr : PDI<0x6D, MRMSrcReg,
- (outs VR128:$dst), (ins VR128:$src1, VR128:$src2),
- "punpckhqdq\t{$src2, $dst|$dst, $src2}",
- [(set VR128:$dst,
- (v2i64 (vector_shuffle VR128:$src1, VR128:$src2,
- UNPCKH_shuffle_mask)))]>;
- def PUNPCKHQDQrm : PDI<0x6D, MRMSrcMem,
- (outs VR128:$dst), (ins VR128:$src1, i128mem:$src2),
- "punpckhqdq\t{$src2, $dst|$dst, $src2}",
- [(set VR128:$dst,
- (v2i64 (vector_shuffle VR128:$src1,
- (memopv2i64 addr:$src2),
- UNPCKH_shuffle_mask)))]>;
-}
-
-// Extract / Insert
-def PEXTRWri : PDIi8<0xC5, MRMSrcReg,
- (outs GR32:$dst), (ins VR128:$src1, i32i8imm:$src2),
- "pextrw\t{$src2, $src1, $dst|$dst, $src1, $src2}",
- [(set GR32:$dst, (X86pextrw (v8i16 VR128:$src1),
- imm:$src2))]>;
-let Constraints = "$src1 = $dst" in {
- def PINSRWrri : PDIi8<0xC4, MRMSrcReg,
- (outs VR128:$dst), (ins VR128:$src1,
- GR32:$src2, i32i8imm:$src3),
- "pinsrw\t{$src3, $src2, $dst|$dst, $src2, $src3}",
- [(set VR128:$dst,
- (X86pinsrw VR128:$src1, GR32:$src2, imm:$src3))]>;
- def PINSRWrmi : PDIi8<0xC4, MRMSrcMem,
- (outs VR128:$dst), (ins VR128:$src1,
- i16mem:$src2, i32i8imm:$src3),
- "pinsrw\t{$src3, $src2, $dst|$dst, $src2, $src3}",
- [(set VR128:$dst,
- (X86pinsrw VR128:$src1, (extloadi16 addr:$src2),
- imm:$src3))]>;
-}
-
-// Mask creation
-def PMOVMSKBrr : PDI<0xD7, MRMSrcReg, (outs GR32:$dst), (ins VR128:$src),
- "pmovmskb\t{$src, $dst|$dst, $src}",
- [(set GR32:$dst, (int_x86_sse2_pmovmskb_128 VR128:$src))]>;
-
-// Conditional store
-let Uses = [EDI] in
-def MASKMOVDQU : PDI<0xF7, MRMSrcReg, (outs), (ins VR128:$src, VR128:$mask),
- "maskmovdqu\t{$mask, $src|$src, $mask}",
- [(int_x86_sse2_maskmov_dqu VR128:$src, VR128:$mask, EDI)]>;
-
-// Non-temporal stores
-def MOVNTPDmr : PDI<0x2B, MRMDestMem, (outs), (ins i128mem:$dst, VR128:$src),
- "movntpd\t{$src, $dst|$dst, $src}",
- [(int_x86_sse2_movnt_pd addr:$dst, VR128:$src)]>;
-def MOVNTDQmr : PDI<0xE7, MRMDestMem, (outs), (ins f128mem:$dst, VR128:$src),
- "movntdq\t{$src, $dst|$dst, $src}",
- [(int_x86_sse2_movnt_dq addr:$dst, VR128:$src)]>;
-def MOVNTImr : I<0xC3, MRMDestMem, (outs), (ins i32mem:$dst, GR32:$src),
- "movnti\t{$src, $dst|$dst, $src}",
- [(int_x86_sse2_movnt_i addr:$dst, GR32:$src)]>,
- TB, Requires<[HasSSE2]>;
-
-// Flush cache
-def CLFLUSH : I<0xAE, MRM7m, (outs), (ins i8mem:$src),
- "clflush\t$src", [(int_x86_sse2_clflush addr:$src)]>,
- TB, Requires<[HasSSE2]>;
-
-// Load, store, and memory fence
-def LFENCE : I<0xAE, MRM5m, (outs), (ins),
- "lfence", [(int_x86_sse2_lfence)]>, TB, Requires<[HasSSE2]>;
-def MFENCE : I<0xAE, MRM6m, (outs), (ins),
- "mfence", [(int_x86_sse2_mfence)]>, TB, Requires<[HasSSE2]>;
-
-//TODO: custom lower this so as to never even generate the noop
-def : Pat<(membarrier (i8 imm:$ll), (i8 imm:$ls), (i8 imm:$sl), (i8 imm:$ss),
- (i8 0)), (NOOP)>;
-def : Pat<(membarrier (i8 0), (i8 0), (i8 0), (i8 1), (i8 1)), (SFENCE)>;
-def : Pat<(membarrier (i8 1), (i8 0), (i8 0), (i8 0), (i8 1)), (LFENCE)>;
-def : Pat<(membarrier (i8 imm:$ll), (i8 imm:$ls), (i8 imm:$sl), (i8 imm:$ss),
- (i8 1)), (MFENCE)>;
-
-// Alias instructions that map zero vector to pxor / xorp* for sse.
-let isReMaterializable = 1 in
- def V_SETALLONES : PDI<0x76, MRMInitReg, (outs VR128:$dst), (ins),
- "pcmpeqd\t$dst, $dst",
- [(set VR128:$dst, (v4i32 immAllOnesV))]>;
-
-// FR64 to 128-bit vector conversion.
-def MOVSD2PDrr : SDI<0x10, MRMSrcReg, (outs VR128:$dst), (ins FR64:$src),
- "movsd\t{$src, $dst|$dst, $src}",
- [(set VR128:$dst,
- (v2f64 (scalar_to_vector FR64:$src)))]>;
-def MOVSD2PDrm : SDI<0x10, MRMSrcMem, (outs VR128:$dst), (ins f64mem:$src),
- "movsd\t{$src, $dst|$dst, $src}",
- [(set VR128:$dst,
- (v2f64 (scalar_to_vector (loadf64 addr:$src))))]>;
-
-def MOVDI2PDIrr : PDI<0x6E, MRMSrcReg, (outs VR128:$dst), (ins GR32:$src),
- "movd\t{$src, $dst|$dst, $src}",
- [(set VR128:$dst,
- (v4i32 (scalar_to_vector GR32:$src)))]>;
-def MOVDI2PDIrm : PDI<0x6E, MRMSrcMem, (outs VR128:$dst), (ins i32mem:$src),
- "movd\t{$src, $dst|$dst, $src}",
- [(set VR128:$dst,
- (v4i32 (scalar_to_vector (loadi32 addr:$src))))]>;
-
-def MOVDI2SSrr : PDI<0x6E, MRMSrcReg, (outs FR32:$dst), (ins GR32:$src),
- "movd\t{$src, $dst|$dst, $src}",
- [(set FR32:$dst, (bitconvert GR32:$src))]>;
-
-def MOVDI2SSrm : PDI<0x6E, MRMSrcMem, (outs FR32:$dst), (ins i32mem:$src),
- "movd\t{$src, $dst|$dst, $src}",
- [(set FR32:$dst, (bitconvert (loadi32 addr:$src)))]>;
-
-// SSE2 instructions with XS prefix
-def MOVQI2PQIrm : I<0x7E, MRMSrcMem, (outs VR128:$dst), (ins i64mem:$src),
- "movq\t{$src, $dst|$dst, $src}",
- [(set VR128:$dst,
- (v2i64 (scalar_to_vector (loadi64 addr:$src))))]>, XS,
- Requires<[HasSSE2]>;
-def MOVPQI2QImr : PDI<0xD6, MRMDestMem, (outs), (ins i64mem:$dst, VR128:$src),
- "movq\t{$src, $dst|$dst, $src}",
- [(store (i64 (vector_extract (v2i64 VR128:$src),
- (iPTR 0))), addr:$dst)]>;
-
-// FIXME: may not be able to eliminate this movss with coalescing the src and
-// dest register classes are different. We really want to write this pattern
-// like this:
-// def : Pat<(f32 (vector_extract (v4f32 VR128:$src), (iPTR 0))),
-// (f32 FR32:$src)>;
-def MOVPD2SDrr : SDI<0x10, MRMSrcReg, (outs FR64:$dst), (ins VR128:$src),
- "movsd\t{$src, $dst|$dst, $src}",
- [(set FR64:$dst, (vector_extract (v2f64 VR128:$src),
- (iPTR 0)))]>;
-def MOVPD2SDmr : SDI<0x11, MRMDestMem, (outs), (ins f64mem:$dst, VR128:$src),
- "movsd\t{$src, $dst|$dst, $src}",
- [(store (f64 (vector_extract (v2f64 VR128:$src),
- (iPTR 0))), addr:$dst)]>;
-def MOVPDI2DIrr : PDI<0x7E, MRMDestReg, (outs GR32:$dst), (ins VR128:$src),
- "movd\t{$src, $dst|$dst, $src}",
- [(set GR32:$dst, (vector_extract (v4i32 VR128:$src),
- (iPTR 0)))]>;
-def MOVPDI2DImr : PDI<0x7E, MRMDestMem, (outs), (ins i32mem:$dst, VR128:$src),
- "movd\t{$src, $dst|$dst, $src}",
- [(store (i32 (vector_extract (v4i32 VR128:$src),
- (iPTR 0))), addr:$dst)]>;
-
-def MOVSS2DIrr : PDI<0x7E, MRMDestReg, (outs GR32:$dst), (ins FR32:$src),
- "movd\t{$src, $dst|$dst, $src}",
- [(set GR32:$dst, (bitconvert FR32:$src))]>;
-def MOVSS2DImr : PDI<0x7E, MRMDestMem, (outs), (ins i32mem:$dst, FR32:$src),
- "movd\t{$src, $dst|$dst, $src}",
- [(store (i32 (bitconvert FR32:$src)), addr:$dst)]>;
-
-
-// Move to lower bits of a VR128, leaving upper bits alone.
-// Three operand (but two address) aliases.
-let Constraints = "$src1 = $dst" in {
- let neverHasSideEffects = 1 in
- def MOVLSD2PDrr : SDI<0x10, MRMSrcReg,
- (outs VR128:$dst), (ins VR128:$src1, FR64:$src2),
- "movsd\t{$src2, $dst|$dst, $src2}", []>;
-
- let AddedComplexity = 15 in
- def MOVLPDrr : SDI<0x10, MRMSrcReg,
- (outs VR128:$dst), (ins VR128:$src1, VR128:$src2),
- "movsd\t{$src2, $dst|$dst, $src2}",
- [(set VR128:$dst,
- (v2f64 (vector_shuffle VR128:$src1, VR128:$src2,
- MOVL_shuffle_mask)))]>;
-}
-
-// Store / copy lower 64-bits of a XMM register.
-def MOVLQ128mr : PDI<0xD6, MRMDestMem, (outs), (ins i64mem:$dst, VR128:$src),
- "movq\t{$src, $dst|$dst, $src}",
- [(int_x86_sse2_storel_dq addr:$dst, VR128:$src)]>;
-
-// Move to lower bits of a VR128 and zeroing upper bits.
-// Loading from memory automatically zeroing upper bits.
-let AddedComplexity = 20 in {
-def MOVZSD2PDrm : SDI<0x10, MRMSrcMem, (outs VR128:$dst), (ins f64mem:$src),
- "movsd\t{$src, $dst|$dst, $src}",
- [(set VR128:$dst,
- (v2f64 (X86vzmovl (v2f64 (scalar_to_vector
- (loadf64 addr:$src))))))]>;
-
-def : Pat<(v2f64 (X86vzmovl (loadv2f64 addr:$src))),
- (MOVZSD2PDrm addr:$src)>;
-def : Pat<(v2f64 (X86vzmovl (bc_v2f64 (loadv4f32 addr:$src)))),
- (MOVZSD2PDrm addr:$src)>;
-def : Pat<(v2f64 (X86vzload addr:$src)), (MOVZSD2PDrm addr:$src)>;
-}
-
-// movd / movq to XMM register zero-extends
-let AddedComplexity = 15 in {
-def MOVZDI2PDIrr : PDI<0x6E, MRMSrcReg, (outs VR128:$dst), (ins GR32:$src),
- "movd\t{$src, $dst|$dst, $src}",
- [(set VR128:$dst, (v4i32 (X86vzmovl
- (v4i32 (scalar_to_vector GR32:$src)))))]>;
-// This is X86-64 only.
-def MOVZQI2PQIrr : RPDI<0x6E, MRMSrcReg, (outs VR128:$dst), (ins GR64:$src),
- "mov{d|q}\t{$src, $dst|$dst, $src}",
- [(set VR128:$dst, (v2i64 (X86vzmovl
- (v2i64 (scalar_to_vector GR64:$src)))))]>;
-}
-
-let AddedComplexity = 20 in {
-def MOVZDI2PDIrm : PDI<0x6E, MRMSrcMem, (outs VR128:$dst), (ins i32mem:$src),
- "movd\t{$src, $dst|$dst, $src}",
- [(set VR128:$dst,
- (v4i32 (X86vzmovl (v4i32 (scalar_to_vector
- (loadi32 addr:$src))))))]>;
-def MOVZQI2PQIrm : I<0x7E, MRMSrcMem, (outs VR128:$dst), (ins i64mem:$src),
- "movq\t{$src, $dst|$dst, $src}",
- [(set VR128:$dst,
- (v2i64 (X86vzmovl (v2i64 (scalar_to_vector
- (loadi64 addr:$src))))))]>, XS,
- Requires<[HasSSE2]>;
-
-def : Pat<(v2i64 (X86vzload addr:$src)), (MOVZQI2PQIrm addr:$src)>;
-}
-
-// Moving from XMM to XMM and clear upper 64 bits. Note, there is a bug in
-// IA32 document. movq xmm1, xmm2 does clear the high bits.
-let AddedComplexity = 15 in
-def MOVZPQILo2PQIrr : I<0x7E, MRMSrcReg, (outs VR128:$dst), (ins VR128:$src),
- "movq\t{$src, $dst|$dst, $src}",
- [(set VR128:$dst, (v2i64 (X86vzmovl (v2i64 VR128:$src))))]>,
- XS, Requires<[HasSSE2]>;
-
-let AddedComplexity = 20 in {
-def MOVZPQILo2PQIrm : I<0x7E, MRMSrcMem, (outs VR128:$dst), (ins i128mem:$src),
- "movq\t{$src, $dst|$dst, $src}",
- [(set VR128:$dst, (v2i64 (X86vzmovl
- (loadv2i64 addr:$src))))]>,
- XS, Requires<[HasSSE2]>;
-
-def : Pat<(v2i64 (X86vzmovl (bc_v2i64 (loadv4i32 addr:$src)))),
- (MOVZPQILo2PQIrm addr:$src)>;
-}
-
-//===----------------------------------------------------------------------===//
-// SSE3 Instructions
-//===----------------------------------------------------------------------===//
-
-// Move Instructions
-def MOVSHDUPrr : S3SI<0x16, MRMSrcReg, (outs VR128:$dst), (ins VR128:$src),
- "movshdup\t{$src, $dst|$dst, $src}",
- [(set VR128:$dst, (v4f32 (vector_shuffle
- VR128:$src, (undef),
- MOVSHDUP_shuffle_mask)))]>;
-def MOVSHDUPrm : S3SI<0x16, MRMSrcMem, (outs VR128:$dst), (ins f128mem:$src),
- "movshdup\t{$src, $dst|$dst, $src}",
- [(set VR128:$dst, (v4f32 (vector_shuffle
- (memopv4f32 addr:$src), (undef),
- MOVSHDUP_shuffle_mask)))]>;
-
-def MOVSLDUPrr : S3SI<0x12, MRMSrcReg, (outs VR128:$dst), (ins VR128:$src),
- "movsldup\t{$src, $dst|$dst, $src}",
- [(set VR128:$dst, (v4f32 (vector_shuffle
- VR128:$src, (undef),
- MOVSLDUP_shuffle_mask)))]>;
-def MOVSLDUPrm : S3SI<0x12, MRMSrcMem, (outs VR128:$dst), (ins f128mem:$src),
- "movsldup\t{$src, $dst|$dst, $src}",
- [(set VR128:$dst, (v4f32 (vector_shuffle
- (memopv4f32 addr:$src), (undef),
- MOVSLDUP_shuffle_mask)))]>;
-
-def MOVDDUPrr : S3DI<0x12, MRMSrcReg, (outs VR128:$dst), (ins VR128:$src),
- "movddup\t{$src, $dst|$dst, $src}",
- [(set VR128:$dst, (v2f64 (vector_shuffle
- VR128:$src, (undef),
- SSE_splat_lo_mask)))]>;
-def MOVDDUPrm : S3DI<0x12, MRMSrcMem, (outs VR128:$dst), (ins f64mem:$src),
- "movddup\t{$src, $dst|$dst, $src}",
- [(set VR128:$dst,
- (v2f64 (vector_shuffle
- (scalar_to_vector (loadf64 addr:$src)),
- (undef),
- SSE_splat_lo_mask)))]>;
-
-// Arithmetic
-let Constraints = "$src1 = $dst" in {
- def ADDSUBPSrr : S3DI<0xD0, MRMSrcReg,
- (outs VR128:$dst), (ins VR128:$src1, VR128:$src2),
- "addsubps\t{$src2, $dst|$dst, $src2}",
- [(set VR128:$dst, (int_x86_sse3_addsub_ps VR128:$src1,
- VR128:$src2))]>;
- def ADDSUBPSrm : S3DI<0xD0, MRMSrcMem,
- (outs VR128:$dst), (ins VR128:$src1, f128mem:$src2),
- "addsubps\t{$src2, $dst|$dst, $src2}",
- [(set VR128:$dst, (int_x86_sse3_addsub_ps VR128:$src1,
- (load addr:$src2)))]>;
- def ADDSUBPDrr : S3I<0xD0, MRMSrcReg,
- (outs VR128:$dst), (ins VR128:$src1, VR128:$src2),
- "addsubpd\t{$src2, $dst|$dst, $src2}",
- [(set VR128:$dst, (int_x86_sse3_addsub_pd VR128:$src1,
- VR128:$src2))]>;
- def ADDSUBPDrm : S3I<0xD0, MRMSrcMem,
- (outs VR128:$dst), (ins VR128:$src1, f128mem:$src2),
- "addsubpd\t{$src2, $dst|$dst, $src2}",
- [(set VR128:$dst, (int_x86_sse3_addsub_pd VR128:$src1,
- (load addr:$src2)))]>;
-}
-
-def LDDQUrm : S3DI<0xF0, MRMSrcMem, (outs VR128:$dst), (ins i128mem:$src),
- "lddqu\t{$src, $dst|$dst, $src}",
- [(set VR128:$dst, (int_x86_sse3_ldu_dq addr:$src))]>;
-
-// Horizontal ops
-class S3D_Intrr<bits<8> o, string OpcodeStr, Intrinsic IntId>
- : S3DI<o, MRMSrcReg, (outs VR128:$dst), (ins VR128:$src1, VR128:$src2),
- !strconcat(OpcodeStr, "\t{$src2, $dst|$dst, $src2}"),
- [(set VR128:$dst, (v4f32 (IntId VR128:$src1, VR128:$src2)))]>;
-class S3D_Intrm<bits<8> o, string OpcodeStr, Intrinsic IntId>
- : S3DI<o, MRMSrcMem, (outs VR128:$dst), (ins VR128:$src1, f128mem:$src2),
- !strconcat(OpcodeStr, "\t{$src2, $dst|$dst, $src2}"),
- [(set VR128:$dst, (v4f32 (IntId VR128:$src1, (load addr:$src2))))]>;
-class S3_Intrr<bits<8> o, string OpcodeStr, Intrinsic IntId>
- : S3I<o, MRMSrcReg, (outs VR128:$dst), (ins VR128:$src1, VR128:$src2),
- !strconcat(OpcodeStr, "\t{$src2, $dst|$dst, $src2}"),
- [(set VR128:$dst, (v2f64 (IntId VR128:$src1, VR128:$src2)))]>;
-class S3_Intrm<bits<8> o, string OpcodeStr, Intrinsic IntId>
- : S3I<o, MRMSrcMem, (outs VR128:$dst), (ins VR128:$src1, f128mem:$src2),
- !strconcat(OpcodeStr, "\t{$src2, $dst|$dst, $src2}"),
- [(set VR128:$dst, (v2f64 (IntId VR128:$src1, (load addr:$src2))))]>;
-
-let Constraints = "$src1 = $dst" in {
- def HADDPSrr : S3D_Intrr<0x7C, "haddps", int_x86_sse3_hadd_ps>;
- def HADDPSrm : S3D_Intrm<0x7C, "haddps", int_x86_sse3_hadd_ps>;
- def HADDPDrr : S3_Intrr <0x7C, "haddpd", int_x86_sse3_hadd_pd>;
- def HADDPDrm : S3_Intrm <0x7C, "haddpd", int_x86_sse3_hadd_pd>;
- def HSUBPSrr : S3D_Intrr<0x7D, "hsubps", int_x86_sse3_hsub_ps>;
- def HSUBPSrm : S3D_Intrm<0x7D, "hsubps", int_x86_sse3_hsub_ps>;
- def HSUBPDrr : S3_Intrr <0x7D, "hsubpd", int_x86_sse3_hsub_pd>;
- def HSUBPDrm : S3_Intrm <0x7D, "hsubpd", int_x86_sse3_hsub_pd>;
-}
-
-// Thread synchronization
-def MONITOR : I<0xC8, RawFrm, (outs), (ins), "monitor",
- [(int_x86_sse3_monitor EAX, ECX, EDX)]>,TB, Requires<[HasSSE3]>;
-def MWAIT : I<0xC9, RawFrm, (outs), (ins), "mwait",
- [(int_x86_sse3_mwait ECX, EAX)]>, TB, Requires<[HasSSE3]>;
-
-// vector_shuffle v1, <undef> <1, 1, 3, 3>
-let AddedComplexity = 15 in
-def : Pat<(v4i32 (vector_shuffle VR128:$src, (undef),
- MOVSHDUP_shuffle_mask)),
- (MOVSHDUPrr VR128:$src)>, Requires<[HasSSE3]>;
-let AddedComplexity = 20 in
-def : Pat<(v4i32 (vector_shuffle (bc_v4i32 (memopv2i64 addr:$src)), (undef),
- MOVSHDUP_shuffle_mask)),
- (MOVSHDUPrm addr:$src)>, Requires<[HasSSE3]>;
-
-// vector_shuffle v1, <undef> <0, 0, 2, 2>
-let AddedComplexity = 15 in
- def : Pat<(v4i32 (vector_shuffle VR128:$src, (undef),
- MOVSLDUP_shuffle_mask)),
- (MOVSLDUPrr VR128:$src)>, Requires<[HasSSE3]>;
-let AddedComplexity = 20 in
- def : Pat<(v4i32 (vector_shuffle (bc_v4i32 (memopv2i64 addr:$src)), (undef),
- MOVSLDUP_shuffle_mask)),
- (MOVSLDUPrm addr:$src)>, Requires<[HasSSE3]>;
-
-//===----------------------------------------------------------------------===//
-// SSSE3 Instructions
-//===----------------------------------------------------------------------===//
-
-/// SS3I_unop_rm_int_8 - Simple SSSE3 unary operator whose type is v*i8.
-multiclass SS3I_unop_rm_int_8<bits<8> opc, string OpcodeStr,
- Intrinsic IntId64, Intrinsic IntId128> {
- def rr64 : SS38I<opc, MRMSrcReg, (outs VR64:$dst), (ins VR64:$src),
- !strconcat(OpcodeStr, "\t{$src, $dst|$dst, $src}"),
- [(set VR64:$dst, (IntId64 VR64:$src))]>;
-
- def rm64 : SS38I<opc, MRMSrcMem, (outs VR64:$dst), (ins i64mem:$src),
- !strconcat(OpcodeStr, "\t{$src, $dst|$dst, $src}"),
- [(set VR64:$dst,
- (IntId64 (bitconvert (memopv8i8 addr:$src))))]>;
-
- def rr128 : SS38I<opc, MRMSrcReg, (outs VR128:$dst),
- (ins VR128:$src),
- !strconcat(OpcodeStr, "\t{$src, $dst|$dst, $src}"),
- [(set VR128:$dst, (IntId128 VR128:$src))]>,
- OpSize;
-
- def rm128 : SS38I<opc, MRMSrcMem, (outs VR128:$dst),
- (ins i128mem:$src),
- !strconcat(OpcodeStr, "\t{$src, $dst|$dst, $src}"),
- [(set VR128:$dst,
- (IntId128
- (bitconvert (memopv16i8 addr:$src))))]>, OpSize;
-}
-
-/// SS3I_unop_rm_int_16 - Simple SSSE3 unary operator whose type is v*i16.
-multiclass SS3I_unop_rm_int_16<bits<8> opc, string OpcodeStr,
- Intrinsic IntId64, Intrinsic IntId128> {
- def rr64 : SS38I<opc, MRMSrcReg, (outs VR64:$dst),
- (ins VR64:$src),
- !strconcat(OpcodeStr, "\t{$src, $dst|$dst, $src}"),
- [(set VR64:$dst, (IntId64 VR64:$src))]>;
-
- def rm64 : SS38I<opc, MRMSrcMem, (outs VR64:$dst),
- (ins i64mem:$src),
- !strconcat(OpcodeStr, "\t{$src, $dst|$dst, $src}"),
- [(set VR64:$dst,
- (IntId64
- (bitconvert (memopv4i16 addr:$src))))]>;
-
- def rr128 : SS38I<opc, MRMSrcReg, (outs VR128:$dst),
- (ins VR128:$src),
- !strconcat(OpcodeStr, "\t{$src, $dst|$dst, $src}"),
- [(set VR128:$dst, (IntId128 VR128:$src))]>,
- OpSize;
-
- def rm128 : SS38I<opc, MRMSrcMem, (outs VR128:$dst),
- (ins i128mem:$src),
- !strconcat(OpcodeStr, "\t{$src, $dst|$dst, $src}"),
- [(set VR128:$dst,
- (IntId128
- (bitconvert (memopv8i16 addr:$src))))]>, OpSize;
-}
-
-/// SS3I_unop_rm_int_32 - Simple SSSE3 unary operator whose type is v*i32.
-multiclass SS3I_unop_rm_int_32<bits<8> opc, string OpcodeStr,
- Intrinsic IntId64, Intrinsic IntId128> {
- def rr64 : SS38I<opc, MRMSrcReg, (outs VR64:$dst),
- (ins VR64:$src),
- !strconcat(OpcodeStr, "\t{$src, $dst|$dst, $src}"),
- [(set VR64:$dst, (IntId64 VR64:$src))]>;
-
- def rm64 : SS38I<opc, MRMSrcMem, (outs VR64:$dst),
- (ins i64mem:$src),
- !strconcat(OpcodeStr, "\t{$src, $dst|$dst, $src}"),
- [(set VR64:$dst,
- (IntId64
- (bitconvert (memopv2i32 addr:$src))))]>;
-
- def rr128 : SS38I<opc, MRMSrcReg, (outs VR128:$dst),
- (ins VR128:$src),
- !strconcat(OpcodeStr, "\t{$src, $dst|$dst, $src}"),
- [(set VR128:$dst, (IntId128 VR128:$src))]>,
- OpSize;
-
- def rm128 : SS38I<opc, MRMSrcMem, (outs VR128:$dst),
- (ins i128mem:$src),
- !strconcat(OpcodeStr, "\t{$src, $dst|$dst, $src}"),
- [(set VR128:$dst,
- (IntId128
- (bitconvert (memopv4i32 addr:$src))))]>, OpSize;
-}
-
-defm PABSB : SS3I_unop_rm_int_8 <0x1C, "pabsb",
- int_x86_ssse3_pabs_b,
- int_x86_ssse3_pabs_b_128>;
-defm PABSW : SS3I_unop_rm_int_16<0x1D, "pabsw",
- int_x86_ssse3_pabs_w,
- int_x86_ssse3_pabs_w_128>;
-defm PABSD : SS3I_unop_rm_int_32<0x1E, "pabsd",
- int_x86_ssse3_pabs_d,
- int_x86_ssse3_pabs_d_128>;
-
-/// SS3I_binop_rm_int_8 - Simple SSSE3 binary operator whose type is v*i8.
-let Constraints = "$src1 = $dst" in {
- multiclass SS3I_binop_rm_int_8<bits<8> opc, string OpcodeStr,
- Intrinsic IntId64, Intrinsic IntId128,
- bit Commutable = 0> {
- def rr64 : SS38I<opc, MRMSrcReg, (outs VR64:$dst),
- (ins VR64:$src1, VR64:$src2),
- !strconcat(OpcodeStr, "\t{$src2, $dst|$dst, $src2}"),
- [(set VR64:$dst, (IntId64 VR64:$src1, VR64:$src2))]> {
- let isCommutable = Commutable;
- }
- def rm64 : SS38I<opc, MRMSrcMem, (outs VR64:$dst),
- (ins VR64:$src1, i64mem:$src2),
- !strconcat(OpcodeStr, "\t{$src2, $dst|$dst, $src2}"),
- [(set VR64:$dst,
- (IntId64 VR64:$src1,
- (bitconvert (memopv8i8 addr:$src2))))]>;
-
- def rr128 : SS38I<opc, MRMSrcReg, (outs VR128:$dst),
- (ins VR128:$src1, VR128:$src2),
- !strconcat(OpcodeStr, "\t{$src2, $dst|$dst, $src2}"),
- [(set VR128:$dst, (IntId128 VR128:$src1, VR128:$src2))]>,
- OpSize {
- let isCommutable = Commutable;
- }
- def rm128 : SS38I<opc, MRMSrcMem, (outs VR128:$dst),
- (ins VR128:$src1, i128mem:$src2),
- !strconcat(OpcodeStr, "\t{$src2, $dst|$dst, $src2}"),
- [(set VR128:$dst,
- (IntId128 VR128:$src1,
- (bitconvert (memopv16i8 addr:$src2))))]>, OpSize;
- }
-}
-
-/// SS3I_binop_rm_int_16 - Simple SSSE3 binary operator whose type is v*i16.
-let Constraints = "$src1 = $dst" in {
- multiclass SS3I_binop_rm_int_16<bits<8> opc, string OpcodeStr,
- Intrinsic IntId64, Intrinsic IntId128,
- bit Commutable = 0> {
- def rr64 : SS38I<opc, MRMSrcReg, (outs VR64:$dst),
- (ins VR64:$src1, VR64:$src2),
- !strconcat(OpcodeStr, "\t{$src2, $dst|$dst, $src2}"),
- [(set VR64:$dst, (IntId64 VR64:$src1, VR64:$src2))]> {
- let isCommutable = Commutable;
- }
- def rm64 : SS38I<opc, MRMSrcMem, (outs VR64:$dst),
- (ins VR64:$src1, i64mem:$src2),
- !strconcat(OpcodeStr, "\t{$src2, $dst|$dst, $src2}"),
- [(set VR64:$dst,
- (IntId64 VR64:$src1,
- (bitconvert (memopv4i16 addr:$src2))))]>;
-
- def rr128 : SS38I<opc, MRMSrcReg, (outs VR128:$dst),
- (ins VR128:$src1, VR128:$src2),
- !strconcat(OpcodeStr, "\t{$src2, $dst|$dst, $src2}"),
- [(set VR128:$dst, (IntId128 VR128:$src1, VR128:$src2))]>,
- OpSize {
- let isCommutable = Commutable;
- }
- def rm128 : SS38I<opc, MRMSrcMem, (outs VR128:$dst),
- (ins VR128:$src1, i128mem:$src2),
- !strconcat(OpcodeStr, "\t{$src2, $dst|$dst, $src2}"),
- [(set VR128:$dst,
- (IntId128 VR128:$src1,
- (bitconvert (memopv8i16 addr:$src2))))]>, OpSize;
- }
-}
-
-/// SS3I_binop_rm_int_32 - Simple SSSE3 binary operator whose type is v*i32.
-let Constraints = "$src1 = $dst" in {
- multiclass SS3I_binop_rm_int_32<bits<8> opc, string OpcodeStr,
- Intrinsic IntId64, Intrinsic IntId128,
- bit Commutable = 0> {
- def rr64 : SS38I<opc, MRMSrcReg, (outs VR64:$dst),
- (ins VR64:$src1, VR64:$src2),
- !strconcat(OpcodeStr, "\t{$src2, $dst|$dst, $src2}"),
- [(set VR64:$dst, (IntId64 VR64:$src1, VR64:$src2))]> {
- let isCommutable = Commutable;
- }
- def rm64 : SS38I<opc, MRMSrcMem, (outs VR64:$dst),
- (ins VR64:$src1, i64mem:$src2),
- !strconcat(OpcodeStr, "\t{$src2, $dst|$dst, $src2}"),
- [(set VR64:$dst,
- (IntId64 VR64:$src1,
- (bitconvert (memopv2i32 addr:$src2))))]>;
-
- def rr128 : SS38I<opc, MRMSrcReg, (outs VR128:$dst),
- (ins VR128:$src1, VR128:$src2),
- !strconcat(OpcodeStr, "\t{$src2, $dst|$dst, $src2}"),
- [(set VR128:$dst, (IntId128 VR128:$src1, VR128:$src2))]>,
- OpSize {
- let isCommutable = Commutable;
- }
- def rm128 : SS38I<opc, MRMSrcMem, (outs VR128:$dst),
- (ins VR128:$src1, i128mem:$src2),
- !strconcat(OpcodeStr, "\t{$src2, $dst|$dst, $src2}"),
- [(set VR128:$dst,
- (IntId128 VR128:$src1,
- (bitconvert (memopv4i32 addr:$src2))))]>, OpSize;
- }
-}
-
-defm PHADDW : SS3I_binop_rm_int_16<0x01, "phaddw",
- int_x86_ssse3_phadd_w,
- int_x86_ssse3_phadd_w_128, 1>;
-defm PHADDD : SS3I_binop_rm_int_32<0x02, "phaddd",
- int_x86_ssse3_phadd_d,
- int_x86_ssse3_phadd_d_128, 1>;
-defm PHADDSW : SS3I_binop_rm_int_16<0x03, "phaddsw",
- int_x86_ssse3_phadd_sw,
- int_x86_ssse3_phadd_sw_128, 1>;
-defm PHSUBW : SS3I_binop_rm_int_16<0x05, "phsubw",
- int_x86_ssse3_phsub_w,
- int_x86_ssse3_phsub_w_128>;
-defm PHSUBD : SS3I_binop_rm_int_32<0x06, "phsubd",
- int_x86_ssse3_phsub_d,
- int_x86_ssse3_phsub_d_128>;
-defm PHSUBSW : SS3I_binop_rm_int_16<0x07, "phsubsw",
- int_x86_ssse3_phsub_sw,
- int_x86_ssse3_phsub_sw_128>;
-defm PMADDUBSW : SS3I_binop_rm_int_8 <0x04, "pmaddubsw",
- int_x86_ssse3_pmadd_ub_sw,
- int_x86_ssse3_pmadd_ub_sw_128, 1>;
-defm PMULHRSW : SS3I_binop_rm_int_16<0x0B, "pmulhrsw",
- int_x86_ssse3_pmul_hr_sw,
- int_x86_ssse3_pmul_hr_sw_128, 1>;
-defm PSHUFB : SS3I_binop_rm_int_8 <0x00, "pshufb",
- int_x86_ssse3_pshuf_b,
- int_x86_ssse3_pshuf_b_128>;
-defm PSIGNB : SS3I_binop_rm_int_8 <0x08, "psignb",
- int_x86_ssse3_psign_b,
- int_x86_ssse3_psign_b_128>;
-defm PSIGNW : SS3I_binop_rm_int_16<0x09, "psignw",
- int_x86_ssse3_psign_w,
- int_x86_ssse3_psign_w_128>;
-defm PSIGND : SS3I_binop_rm_int_32<0x09, "psignd",
- int_x86_ssse3_psign_d,
- int_x86_ssse3_psign_d_128>;
-
-let Constraints = "$src1 = $dst" in {
- def PALIGNR64rr : SS3AI<0x0F, MRMSrcReg, (outs VR64:$dst),
- (ins VR64:$src1, VR64:$src2, i16imm:$src3),
- "palignr\t{$src3, $src2, $dst|$dst, $src2, $src3}",
- [(set VR64:$dst,
- (int_x86_ssse3_palign_r
- VR64:$src1, VR64:$src2,
- imm:$src3))]>;
- def PALIGNR64rm : SS3AI<0x0F, MRMSrcReg, (outs VR64:$dst),
- (ins VR64:$src1, i64mem:$src2, i16imm:$src3),
- "palignr\t{$src3, $src2, $dst|$dst, $src2, $src3}",
- [(set VR64:$dst,
- (int_x86_ssse3_palign_r
- VR64:$src1,
- (bitconvert (memopv2i32 addr:$src2)),
- imm:$src3))]>;
-
- def PALIGNR128rr : SS3AI<0x0F, MRMSrcReg, (outs VR128:$dst),
- (ins VR128:$src1, VR128:$src2, i32imm:$src3),
- "palignr\t{$src3, $src2, $dst|$dst, $src2, $src3}",
- [(set VR128:$dst,
- (int_x86_ssse3_palign_r_128
- VR128:$src1, VR128:$src2,
- imm:$src3))]>, OpSize;
- def PALIGNR128rm : SS3AI<0x0F, MRMSrcReg, (outs VR128:$dst),
- (ins VR128:$src1, i128mem:$src2, i32imm:$src3),
- "palignr\t{$src3, $src2, $dst|$dst, $src2, $src3}",
- [(set VR128:$dst,
- (int_x86_ssse3_palign_r_128
- VR128:$src1,
- (bitconvert (memopv4i32 addr:$src2)),
- imm:$src3))]>, OpSize;
-}
-
-//===----------------------------------------------------------------------===//
-// Non-Instruction Patterns
-//===----------------------------------------------------------------------===//
-
-// extload f32 -> f64. This matches load+fextend because we have a hack in
-// the isel (PreprocessForFPConvert) that can introduce loads after dag combine.
-// Since these loads aren't folded into the fextend, we have to match it
-// explicitly here.
-let Predicates = [HasSSE2] in
- def : Pat<(fextend (loadf32 addr:$src)),
- (CVTSS2SDrm addr:$src)>;
-
-// bit_convert
-let Predicates = [HasSSE2] in {
- def : Pat<(v2i64 (bitconvert (v4i32 VR128:$src))), (v2i64 VR128:$src)>;
- def : Pat<(v2i64 (bitconvert (v8i16 VR128:$src))), (v2i64 VR128:$src)>;
- def : Pat<(v2i64 (bitconvert (v16i8 VR128:$src))), (v2i64 VR128:$src)>;
- def : Pat<(v2i64 (bitconvert (v2f64 VR128:$src))), (v2i64 VR128:$src)>;
- def : Pat<(v2i64 (bitconvert (v4f32 VR128:$src))), (v2i64 VR128:$src)>;
- def : Pat<(v4i32 (bitconvert (v2i64 VR128:$src))), (v4i32 VR128:$src)>;
- def : Pat<(v4i32 (bitconvert (v8i16 VR128:$src))), (v4i32 VR128:$src)>;
- def : Pat<(v4i32 (bitconvert (v16i8 VR128:$src))), (v4i32 VR128:$src)>;
- def : Pat<(v4i32 (bitconvert (v2f64 VR128:$src))), (v4i32 VR128:$src)>;
- def : Pat<(v4i32 (bitconvert (v4f32 VR128:$src))), (v4i32 VR128:$src)>;
- def : Pat<(v8i16 (bitconvert (v2i64 VR128:$src))), (v8i16 VR128:$src)>;
- def : Pat<(v8i16 (bitconvert (v4i32 VR128:$src))), (v8i16 VR128:$src)>;
- def : Pat<(v8i16 (bitconvert (v16i8 VR128:$src))), (v8i16 VR128:$src)>;
- def : Pat<(v8i16 (bitconvert (v2f64 VR128:$src))), (v8i16 VR128:$src)>;
- def : Pat<(v8i16 (bitconvert (v4f32 VR128:$src))), (v8i16 VR128:$src)>;
- def : Pat<(v16i8 (bitconvert (v2i64 VR128:$src))), (v16i8 VR128:$src)>;
- def : Pat<(v16i8 (bitconvert (v4i32 VR128:$src))), (v16i8 VR128:$src)>;
- def : Pat<(v16i8 (bitconvert (v8i16 VR128:$src))), (v16i8 VR128:$src)>;
- def : Pat<(v16i8 (bitconvert (v2f64 VR128:$src))), (v16i8 VR128:$src)>;
- def : Pat<(v16i8 (bitconvert (v4f32 VR128:$src))), (v16i8 VR128:$src)>;
- def : Pat<(v4f32 (bitconvert (v2i64 VR128:$src))), (v4f32 VR128:$src)>;
- def : Pat<(v4f32 (bitconvert (v4i32 VR128:$src))), (v4f32 VR128:$src)>;
- def : Pat<(v4f32 (bitconvert (v8i16 VR128:$src))), (v4f32 VR128:$src)>;
- def : Pat<(v4f32 (bitconvert (v16i8 VR128:$src))), (v4f32 VR128:$src)>;
- def : Pat<(v4f32 (bitconvert (v2f64 VR128:$src))), (v4f32 VR128:$src)>;
- def : Pat<(v2f64 (bitconvert (v2i64 VR128:$src))), (v2f64 VR128:$src)>;
- def : Pat<(v2f64 (bitconvert (v4i32 VR128:$src))), (v2f64 VR128:$src)>;
- def : Pat<(v2f64 (bitconvert (v8i16 VR128:$src))), (v2f64 VR128:$src)>;
- def : Pat<(v2f64 (bitconvert (v16i8 VR128:$src))), (v2f64 VR128:$src)>;
- def : Pat<(v2f64 (bitconvert (v4f32 VR128:$src))), (v2f64 VR128:$src)>;
-}
-
-// Move scalar to XMM zero-extended
-// movd to XMM register zero-extends
-let AddedComplexity = 15 in {
-// Zeroing a VR128 then do a MOVS{S|D} to the lower bits.
-def : Pat<(v2f64 (X86vzmovl (v2f64 (scalar_to_vector FR64:$src)))),
- (MOVLSD2PDrr (V_SET0), FR64:$src)>, Requires<[HasSSE2]>;
-def : Pat<(v4f32 (X86vzmovl (v4f32 (scalar_to_vector FR32:$src)))),
- (MOVLSS2PSrr (V_SET0), FR32:$src)>, Requires<[HasSSE2]>;
-def : Pat<(v4f32 (X86vzmovl (v4f32 VR128:$src))),
- (MOVLPSrr (V_SET0), VR128:$src)>, Requires<[HasSSE2]>;
-}
-
-// Splat v2f64 / v2i64
-let AddedComplexity = 10 in {
-def : Pat<(vector_shuffle (v2f64 VR128:$src), (undef), SSE_splat_lo_mask:$sm),
- (UNPCKLPDrr VR128:$src, VR128:$src)>, Requires<[HasSSE2]>;
-def : Pat<(vector_shuffle (v2f64 VR128:$src), (undef), UNPCKH_shuffle_mask:$sm),
- (UNPCKHPDrr VR128:$src, VR128:$src)>, Requires<[HasSSE2]>;
-def : Pat<(vector_shuffle (v2i64 VR128:$src), (undef), SSE_splat_lo_mask:$sm),
- (PUNPCKLQDQrr VR128:$src, VR128:$src)>, Requires<[HasSSE2]>;
-def : Pat<(vector_shuffle (v2i64 VR128:$src), (undef), UNPCKH_shuffle_mask:$sm),
- (PUNPCKHQDQrr VR128:$src, VR128:$src)>, Requires<[HasSSE2]>;
-}
-
-// Special unary SHUFPSrri case.
-def : Pat<(v4f32 (vector_shuffle VR128:$src1, (undef),
- SHUFP_unary_shuffle_mask:$sm)),
- (SHUFPSrri VR128:$src1, VR128:$src1, SHUFP_unary_shuffle_mask:$sm)>,
- Requires<[HasSSE1]>;
-// Special unary SHUFPDrri case.
-def : Pat<(v2f64 (vector_shuffle VR128:$src1, (undef),
- SHUFP_unary_shuffle_mask:$sm)),
- (SHUFPDrri VR128:$src1, VR128:$src1, SHUFP_unary_shuffle_mask:$sm)>,
- Requires<[HasSSE2]>;
-// Unary v4f32 shuffle with PSHUF* in order to fold a load.
-def : Pat<(vector_shuffle (bc_v4i32 (memopv4f32 addr:$src1)), (undef),
- SHUFP_unary_shuffle_mask:$sm),
- (PSHUFDmi addr:$src1, SHUFP_unary_shuffle_mask:$sm)>,
- Requires<[HasSSE2]>;
-// Special binary v4i32 shuffle cases with SHUFPS.
-def : Pat<(v4i32 (vector_shuffle VR128:$src1, (v4i32 VR128:$src2),
- PSHUFD_binary_shuffle_mask:$sm)),
- (SHUFPSrri VR128:$src1, VR128:$src2, PSHUFD_binary_shuffle_mask:$sm)>,
- Requires<[HasSSE2]>;
-def : Pat<(v4i32 (vector_shuffle VR128:$src1,
- (bc_v4i32 (memopv2i64 addr:$src2)), PSHUFD_binary_shuffle_mask:$sm)),
- (SHUFPSrmi VR128:$src1, addr:$src2, PSHUFD_binary_shuffle_mask:$sm)>,
- Requires<[HasSSE2]>;
-// Special binary v2i64 shuffle cases using SHUFPDrri.
-def : Pat<(v2i64 (vector_shuffle VR128:$src1, VR128:$src2,
- SHUFP_shuffle_mask:$sm)),
- (SHUFPDrri VR128:$src1, VR128:$src2, SHUFP_shuffle_mask:$sm)>,
- Requires<[HasSSE2]>;
-// Special unary SHUFPDrri case.
-def : Pat<(v2i64 (vector_shuffle VR128:$src1, (undef),
- SHUFP_unary_shuffle_mask:$sm)),
- (SHUFPDrri VR128:$src1, VR128:$src1, SHUFP_unary_shuffle_mask:$sm)>,
- Requires<[HasSSE2]>;
-
-// vector_shuffle v1, <undef>, <0, 0, 1, 1, ...>
-let AddedComplexity = 10 in {
-def : Pat<(v4f32 (vector_shuffle VR128:$src, (undef),
- UNPCKL_v_undef_shuffle_mask)),
- (UNPCKLPSrr VR128:$src, VR128:$src)>, Requires<[HasSSE2]>;
-def : Pat<(v16i8 (vector_shuffle VR128:$src, (undef),
- UNPCKL_v_undef_shuffle_mask)),
- (PUNPCKLBWrr VR128:$src, VR128:$src)>, Requires<[HasSSE2]>;
-def : Pat<(v8i16 (vector_shuffle VR128:$src, (undef),
- UNPCKL_v_undef_shuffle_mask)),
- (PUNPCKLWDrr VR128:$src, VR128:$src)>, Requires<[HasSSE2]>;
-def : Pat<(v4i32 (vector_shuffle VR128:$src, (undef),
- UNPCKL_v_undef_shuffle_mask)),
- (PUNPCKLDQrr VR128:$src, VR128:$src)>, Requires<[HasSSE1]>;
-}
-
-// vector_shuffle v1, <undef>, <2, 2, 3, 3, ...>
-let AddedComplexity = 10 in {
-def : Pat<(v4f32 (vector_shuffle VR128:$src, (undef),
- UNPCKH_v_undef_shuffle_mask)),
- (UNPCKHPSrr VR128:$src, VR128:$src)>, Requires<[HasSSE2]>;
-def : Pat<(v16i8 (vector_shuffle VR128:$src, (undef),
- UNPCKH_v_undef_shuffle_mask)),
- (PUNPCKHBWrr VR128:$src, VR128:$src)>, Requires<[HasSSE2]>;
-def : Pat<(v8i16 (vector_shuffle VR128:$src, (undef),
- UNPCKH_v_undef_shuffle_mask)),
- (PUNPCKHWDrr VR128:$src, VR128:$src)>, Requires<[HasSSE2]>;
-def : Pat<(v4i32 (vector_shuffle VR128:$src, (undef),
- UNPCKH_v_undef_shuffle_mask)),
- (PUNPCKHDQrr VR128:$src, VR128:$src)>, Requires<[HasSSE1]>;
-}
-
-let AddedComplexity = 15 in {
-// vector_shuffle v1, v2 <0, 1, 4, 5> using MOVLHPS
-def : Pat<(v4i32 (vector_shuffle VR128:$src1, VR128:$src2,
- MOVHP_shuffle_mask)),
- (MOVLHPSrr VR128:$src1, VR128:$src2)>;
-
-// vector_shuffle v1, v2 <6, 7, 2, 3> using MOVHLPS
-def : Pat<(v4i32 (vector_shuffle VR128:$src1, VR128:$src2,
- MOVHLPS_shuffle_mask)),
- (MOVHLPSrr VR128:$src1, VR128:$src2)>;
-
-// vector_shuffle v1, undef <2, ?, ?, ?> using MOVHLPS
-def : Pat<(v4f32 (vector_shuffle VR128:$src1, (undef),
- MOVHLPS_v_undef_shuffle_mask)),
- (MOVHLPSrr VR128:$src1, VR128:$src1)>;
-def : Pat<(v4i32 (vector_shuffle VR128:$src1, (undef),
- MOVHLPS_v_undef_shuffle_mask)),
- (MOVHLPSrr VR128:$src1, VR128:$src1)>;
-}
-
-let AddedComplexity = 20 in {
-// vector_shuffle v1, (load v2) <4, 5, 2, 3> using MOVLPS
-// vector_shuffle v1, (load v2) <0, 1, 4, 5> using MOVHPS
-def : Pat<(v4f32 (vector_shuffle VR128:$src1, (memopv4f32 addr:$src2),
- MOVLP_shuffle_mask)),
- (MOVLPSrm VR128:$src1, addr:$src2)>, Requires<[HasSSE1]>;
-def : Pat<(v2f64 (vector_shuffle VR128:$src1, (memopv2f64 addr:$src2),
- MOVLP_shuffle_mask)),
- (MOVLPDrm VR128:$src1, addr:$src2)>, Requires<[HasSSE2]>;
-def : Pat<(v4f32 (vector_shuffle VR128:$src1, (memopv4f32 addr:$src2),
- MOVHP_shuffle_mask)),
- (MOVHPSrm VR128:$src1, addr:$src2)>, Requires<[HasSSE1]>;
-def : Pat<(v2f64 (vector_shuffle VR128:$src1, (memopv2f64 addr:$src2),
- MOVHP_shuffle_mask)),
- (MOVHPDrm VR128:$src1, addr:$src2)>, Requires<[HasSSE2]>;
-
-def : Pat<(v4i32 (vector_shuffle VR128:$src1, (bc_v4i32 (memopv2i64 addr:$src2)),
- MOVLP_shuffle_mask)),
- (MOVLPSrm VR128:$src1, addr:$src2)>, Requires<[HasSSE2]>;
-def : Pat<(v2i64 (vector_shuffle VR128:$src1, (memopv2i64 addr:$src2),
- MOVLP_shuffle_mask)),
- (MOVLPDrm VR128:$src1, addr:$src2)>, Requires<[HasSSE2]>;
-def : Pat<(v4i32 (vector_shuffle VR128:$src1, (bc_v4i32 (memopv2i64 addr:$src2)),
- MOVHP_shuffle_mask)),
- (MOVHPSrm VR128:$src1, addr:$src2)>, Requires<[HasSSE1]>;
-def : Pat<(v2i64 (vector_shuffle VR128:$src1, (memopv2i64 addr:$src2),
- MOVLP_shuffle_mask)),
- (MOVLPDrm VR128:$src1, addr:$src2)>, Requires<[HasSSE2]>;
-}
-
-let AddedComplexity = 15 in {
-// Setting the lowest element in the vector.
-def : Pat<(v4i32 (vector_shuffle VR128:$src1, VR128:$src2,
- MOVL_shuffle_mask)),
- (MOVLPSrr VR128:$src1, VR128:$src2)>, Requires<[HasSSE2]>;
-def : Pat<(v2i64 (vector_shuffle VR128:$src1, VR128:$src2,
- MOVL_shuffle_mask)),
- (MOVLPDrr VR128:$src1, VR128:$src2)>, Requires<[HasSSE2]>;
-
-// vector_shuffle v1, v2 <4, 5, 2, 3> using MOVLPDrr (movsd)
-def : Pat<(v4f32 (vector_shuffle VR128:$src1, VR128:$src2,
- MOVLP_shuffle_mask)),
- (MOVLPDrr VR128:$src1, VR128:$src2)>, Requires<[HasSSE2]>;
-def : Pat<(v4i32 (vector_shuffle VR128:$src1, VR128:$src2,
- MOVLP_shuffle_mask)),
- (MOVLPDrr VR128:$src1, VR128:$src2)>, Requires<[HasSSE2]>;
-}
-
-// Set lowest element and zero upper elements.
-let AddedComplexity = 15 in
-def : Pat<(v2f64 (vector_shuffle immAllZerosV_bc, VR128:$src,
- MOVL_shuffle_mask)),
- (MOVZPQILo2PQIrr VR128:$src)>, Requires<[HasSSE2]>;
-def : Pat<(v2f64 (X86vzmovl (v2f64 VR128:$src))),
- (MOVZPQILo2PQIrr VR128:$src)>, Requires<[HasSSE2]>;
-
-// FIXME: Temporary workaround since 2-wide shuffle is broken.
-def : Pat<(int_x86_sse2_movs_d VR128:$src1, VR128:$src2),
- (v2f64 (MOVLPDrr VR128:$src1, VR128:$src2))>, Requires<[HasSSE2]>;
-def : Pat<(int_x86_sse2_loadh_pd VR128:$src1, addr:$src2),
- (v2f64 (MOVHPDrm VR128:$src1, addr:$src2))>, Requires<[HasSSE2]>;
-def : Pat<(int_x86_sse2_loadl_pd VR128:$src1, addr:$src2),
- (v2f64 (MOVLPDrm VR128:$src1, addr:$src2))>, Requires<[HasSSE2]>;
-def : Pat<(int_x86_sse2_shuf_pd VR128:$src1, VR128:$src2, imm:$src3),
- (v2f64 (SHUFPDrri VR128:$src1, VR128:$src2, imm:$src3))>,
- Requires<[HasSSE2]>;
-def : Pat<(int_x86_sse2_shuf_pd VR128:$src1, (load addr:$src2), imm:$src3),
- (v2f64 (SHUFPDrmi VR128:$src1, addr:$src2, imm:$src3))>,
- Requires<[HasSSE2]>;
-def : Pat<(int_x86_sse2_unpckh_pd VR128:$src1, VR128:$src2),
- (v2f64 (UNPCKHPDrr VR128:$src1, VR128:$src2))>, Requires<[HasSSE2]>;
-def : Pat<(int_x86_sse2_unpckh_pd VR128:$src1, (load addr:$src2)),
- (v2f64 (UNPCKHPDrm VR128:$src1, addr:$src2))>, Requires<[HasSSE2]>;
-def : Pat<(int_x86_sse2_unpckl_pd VR128:$src1, VR128:$src2),
- (v2f64 (UNPCKLPDrr VR128:$src1, VR128:$src2))>, Requires<[HasSSE2]>;
-def : Pat<(int_x86_sse2_unpckl_pd VR128:$src1, (load addr:$src2)),
- (v2f64 (UNPCKLPDrm VR128:$src1, addr:$src2))>, Requires<[HasSSE2]>;
-def : Pat<(int_x86_sse2_punpckh_qdq VR128:$src1, VR128:$src2),
- (v2i64 (PUNPCKHQDQrr VR128:$src1, VR128:$src2))>, Requires<[HasSSE2]>;
-def : Pat<(int_x86_sse2_punpckh_qdq VR128:$src1, (load addr:$src2)),
- (v2i64 (PUNPCKHQDQrm VR128:$src1, addr:$src2))>, Requires<[HasSSE2]>;
-def : Pat<(int_x86_sse2_punpckl_qdq VR128:$src1, VR128:$src2),
- (v2i64 (PUNPCKLQDQrr VR128:$src1, VR128:$src2))>, Requires<[HasSSE2]>;
-def : Pat<(int_x86_sse2_punpckl_qdq VR128:$src1, (load addr:$src2)),
- (PUNPCKLQDQrm VR128:$src1, addr:$src2)>, Requires<[HasSSE2]>;
-
-// Some special case pandn patterns.
-def : Pat<(v2i64 (and (xor VR128:$src1, (bc_v2i64 (v4i32 immAllOnesV))),
- VR128:$src2)),
- (PANDNrr VR128:$src1, VR128:$src2)>, Requires<[HasSSE2]>;
-def : Pat<(v2i64 (and (xor VR128:$src1, (bc_v2i64 (v8i16 immAllOnesV))),
- VR128:$src2)),
- (PANDNrr VR128:$src1, VR128:$src2)>, Requires<[HasSSE2]>;
-def : Pat<(v2i64 (and (xor VR128:$src1, (bc_v2i64 (v16i8 immAllOnesV))),
- VR128:$src2)),
- (PANDNrr VR128:$src1, VR128:$src2)>, Requires<[HasSSE2]>;
-
-def : Pat<(v2i64 (and (xor VR128:$src1, (bc_v2i64 (v4i32 immAllOnesV))),
- (memopv2i64 addr:$src2))),
- (PANDNrm VR128:$src1, addr:$src2)>, Requires<[HasSSE2]>;
-def : Pat<(v2i64 (and (xor VR128:$src1, (bc_v2i64 (v8i16 immAllOnesV))),
- (memopv2i64 addr:$src2))),
- (PANDNrm VR128:$src1, addr:$src2)>, Requires<[HasSSE2]>;
-def : Pat<(v2i64 (and (xor VR128:$src1, (bc_v2i64 (v16i8 immAllOnesV))),
- (memopv2i64 addr:$src2))),
- (PANDNrm VR128:$src1, addr:$src2)>, Requires<[HasSSE2]>;
-
-// vector -> vector casts
-def : Pat<(v4f32 (sint_to_fp (v4i32 VR128:$src))),
- (Int_CVTDQ2PSrr VR128:$src)>, Requires<[HasSSE2]>;
-def : Pat<(v4i32 (fp_to_sint (v4f32 VR128:$src))),
- (Int_CVTTPS2DQrr VR128:$src)>, Requires<[HasSSE2]>;
-
-// Use movaps / movups for SSE integer load / store (one byte shorter).
-def : Pat<(alignedloadv4i32 addr:$src),
- (MOVAPSrm addr:$src)>, Requires<[HasSSE1]>;
-def : Pat<(loadv4i32 addr:$src),
- (MOVUPSrm addr:$src)>, Requires<[HasSSE1]>;
-def : Pat<(alignedloadv2i64 addr:$src),
- (MOVAPSrm addr:$src)>, Requires<[HasSSE2]>;
-def : Pat<(loadv2i64 addr:$src),
- (MOVUPSrm addr:$src)>, Requires<[HasSSE2]>;
-
-def : Pat<(alignedstore (v2i64 VR128:$src), addr:$dst),
- (MOVAPSmr addr:$dst, VR128:$src)>, Requires<[HasSSE2]>;
-def : Pat<(alignedstore (v4i32 VR128:$src), addr:$dst),
- (MOVAPSmr addr:$dst, VR128:$src)>, Requires<[HasSSE2]>;
-def : Pat<(alignedstore (v8i16 VR128:$src), addr:$dst),
- (MOVAPSmr addr:$dst, VR128:$src)>, Requires<[HasSSE2]>;
-def : Pat<(alignedstore (v16i8 VR128:$src), addr:$dst),
- (MOVAPSmr addr:$dst, VR128:$src)>, Requires<[HasSSE2]>;
-def : Pat<(store (v2i64 VR128:$src), addr:$dst),
- (MOVUPSmr addr:$dst, VR128:$src)>, Requires<[HasSSE2]>;
-def : Pat<(store (v4i32 VR128:$src), addr:$dst),
- (MOVUPSmr addr:$dst, VR128:$src)>, Requires<[HasSSE2]>;
-def : Pat<(store (v8i16 VR128:$src), addr:$dst),
- (MOVUPSmr addr:$dst, VR128:$src)>, Requires<[HasSSE2]>;
-def : Pat<(store (v16i8 VR128:$src), addr:$dst),
- (MOVUPSmr addr:$dst, VR128:$src)>, Requires<[HasSSE2]>;
-
-//===----------------------------------------------------------------------===//
-// SSE4.1 Instructions
-//===----------------------------------------------------------------------===//
-
-multiclass sse41_fp_unop_rm<bits<8> opcss, bits<8> opcps,
- bits<8> opcsd, bits<8> opcpd,
- string OpcodeStr,
- Intrinsic F32Int,
- Intrinsic V4F32Int,
- Intrinsic F64Int,
- Intrinsic V2F64Int> {
- // Intrinsic operation, reg.
- def SSr_Int : SS4AIi8<opcss, MRMSrcReg,
- (outs VR128:$dst), (ins VR128:$src1, i32i8imm:$src2),
- !strconcat(OpcodeStr,
- "ss\t{$src2, $src1, $dst|$dst, $src1, $src2}"),
- [(set VR128:$dst, (F32Int VR128:$src1, imm:$src2))]>,
- OpSize;
-
- // Intrinsic operation, mem.
- def SSm_Int : SS4AIi8<opcss, MRMSrcMem,
- (outs VR128:$dst), (ins ssmem:$src1, i32i8imm:$src2),
- !strconcat(OpcodeStr,
- "ss\t{$src2, $src1, $dst|$dst, $src1, $src2}"),
- [(set VR128:$dst, (F32Int sse_load_f32:$src1, imm:$src2))]>,
- OpSize;
-
- // Vector intrinsic operation, reg
- def PSr_Int : SS4AIi8<opcps, MRMSrcReg,
- (outs VR128:$dst), (ins VR128:$src1, i32i8imm:$src2),
- !strconcat(OpcodeStr,
- "ps\t{$src2, $src1, $dst|$dst, $src1, $src2}"),
- [(set VR128:$dst, (V4F32Int VR128:$src1, imm:$src2))]>,
- OpSize;
-
- // Vector intrinsic operation, mem
- def PSm_Int : SS4AIi8<opcps, MRMSrcMem,
- (outs VR128:$dst), (ins f128mem:$src1, i32i8imm:$src2),
- !strconcat(OpcodeStr,
- "ps\t{$src2, $src1, $dst|$dst, $src1, $src2}"),
- [(set VR128:$dst, (V4F32Int (load addr:$src1),imm:$src2))]>,
- OpSize;
-
- // Intrinsic operation, reg.
- def SDr_Int : SS4AIi8<opcsd, MRMSrcReg,
- (outs VR128:$dst), (ins VR128:$src1, i32i8imm:$src2),
- !strconcat(OpcodeStr,
- "sd\t{$src2, $src1, $dst|$dst, $src1, $src2}"),
- [(set VR128:$dst, (F64Int VR128:$src1, imm:$src2))]>,
- OpSize;
-
- // Intrinsic operation, mem.
- def SDm_Int : SS4AIi8<opcsd, MRMSrcMem,
- (outs VR128:$dst), (ins sdmem:$src1, i32i8imm:$src2),
- !strconcat(OpcodeStr,
- "sd\t{$src2, $src1, $dst|$dst, $src1, $src2}"),
- [(set VR128:$dst, (F64Int sse_load_f64:$src1, imm:$src2))]>,
- OpSize;
-
- // Vector intrinsic operation, reg
- def PDr_Int : SS4AIi8<opcpd, MRMSrcReg,
- (outs VR128:$dst), (ins VR128:$src1, i32i8imm:$src2),
- !strconcat(OpcodeStr,
- "pd\t{$src2, $src1, $dst|$dst, $src1, $src2}"),
- [(set VR128:$dst, (V2F64Int VR128:$src1, imm:$src2))]>,
- OpSize;
-
- // Vector intrinsic operation, mem
- def PDm_Int : SS4AIi8<opcpd, MRMSrcMem,
- (outs VR128:$dst), (ins f128mem:$src1, i32i8imm:$src2),
- !strconcat(OpcodeStr,
- "pd\t{$src2, $src1, $dst|$dst, $src1, $src2}"),
- [(set VR128:$dst, (V2F64Int (load addr:$src1),imm:$src2))]>,
- OpSize;
-}
-
-// FP round - roundss, roundps, roundsd, roundpd
-defm ROUND : sse41_fp_unop_rm<0x0A, 0x08, 0x0B, 0x09, "round",
- int_x86_sse41_round_ss, int_x86_sse41_round_ps,
- int_x86_sse41_round_sd, int_x86_sse41_round_pd>;
-
-// SS41I_unop_rm_int_v16 - SSE 4.1 unary operator whose type is v8i16.
-multiclass SS41I_unop_rm_int_v16<bits<8> opc, string OpcodeStr,
- Intrinsic IntId128> {
- def rr128 : SS48I<opc, MRMSrcReg, (outs VR128:$dst),
- (ins VR128:$src),
- !strconcat(OpcodeStr, "\t{$src, $dst|$dst, $src}"),
- [(set VR128:$dst, (IntId128 VR128:$src))]>, OpSize;
- def rm128 : SS48I<opc, MRMSrcMem, (outs VR128:$dst),
- (ins i128mem:$src),
- !strconcat(OpcodeStr, "\t{$src, $dst|$dst, $src}"),
- [(set VR128:$dst,
- (IntId128
- (bitconvert (memopv8i16 addr:$src))))]>, OpSize;
-}
-
-defm PHMINPOSUW : SS41I_unop_rm_int_v16 <0x41, "phminposuw",
- int_x86_sse41_phminposuw>;
-
-/// SS41I_binop_rm_int - Simple SSE 4.1 binary operator
-let Constraints = "$src1 = $dst" in {
- multiclass SS41I_binop_rm_int<bits<8> opc, string OpcodeStr,
- Intrinsic IntId128, bit Commutable = 0> {
- def rr : SS48I<opc, MRMSrcReg, (outs VR128:$dst),
- (ins VR128:$src1, VR128:$src2),
- !strconcat(OpcodeStr, "\t{$src2, $dst|$dst, $src2}"),
- [(set VR128:$dst, (IntId128 VR128:$src1, VR128:$src2))]>,
- OpSize {
- let isCommutable = Commutable;
- }
- def rm : SS48I<opc, MRMSrcMem, (outs VR128:$dst),
- (ins VR128:$src1, i128mem:$src2),
- !strconcat(OpcodeStr, "\t{$src2, $dst|$dst, $src2}"),
- [(set VR128:$dst,
- (IntId128 VR128:$src1,
- (bitconvert (memopv16i8 addr:$src2))))]>, OpSize;
- }
-}
-
-defm PCMPEQQ : SS41I_binop_rm_int<0x29, "pcmpeqq",
- int_x86_sse41_pcmpeqq, 1>;
-defm PACKUSDW : SS41I_binop_rm_int<0x2B, "packusdw",
- int_x86_sse41_packusdw, 0>;
-defm PMINSB : SS41I_binop_rm_int<0x38, "pminsb",
- int_x86_sse41_pminsb, 1>;
-defm PMINSD : SS41I_binop_rm_int<0x39, "pminsd",
- int_x86_sse41_pminsd, 1>;
-defm PMINUD : SS41I_binop_rm_int<0x3B, "pminud",
- int_x86_sse41_pminud, 1>;
-defm PMINUW : SS41I_binop_rm_int<0x3A, "pminuw",
- int_x86_sse41_pminuw, 1>;
-defm PMAXSB : SS41I_binop_rm_int<0x3C, "pmaxsb",
- int_x86_sse41_pmaxsb, 1>;
-defm PMAXSD : SS41I_binop_rm_int<0x3D, "pmaxsd",
- int_x86_sse41_pmaxsd, 1>;
-defm PMAXUD : SS41I_binop_rm_int<0x3F, "pmaxud",
- int_x86_sse41_pmaxud, 1>;
-defm PMAXUW : SS41I_binop_rm_int<0x3E, "pmaxuw",
- int_x86_sse41_pmaxuw, 1>;
-defm PMULDQ : SS41I_binop_rm_int<0x28, "pmuldq",
- int_x86_sse41_pmuldq, 1>;
-
-
-/// SS41I_binop_rm_int - Simple SSE 4.1 binary operator
-let Constraints = "$src1 = $dst" in {
- multiclass SS41I_binop_patint<bits<8> opc, string OpcodeStr, SDNode OpNode,
- Intrinsic IntId128, bit Commutable = 0> {
- def rr : SS48I<opc, MRMSrcReg, (outs VR128:$dst),
- (ins VR128:$src1, VR128:$src2),
- !strconcat(OpcodeStr, "\t{$src2, $dst|$dst, $src2}"),
- [(set VR128:$dst, (OpNode (v4i32 VR128:$src1),
- VR128:$src2))]>, OpSize {
- let isCommutable = Commutable;
- }
- def rr_int : SS48I<opc, MRMSrcReg, (outs VR128:$dst),
- (ins VR128:$src1, VR128:$src2),
- !strconcat(OpcodeStr, "\t{$src2, $dst|$dst, $src2}"),
- [(set VR128:$dst, (IntId128 VR128:$src1, VR128:$src2))]>,
- OpSize {
- let isCommutable = Commutable;
- }
- def rm : SS48I<opc, MRMSrcMem, (outs VR128:$dst),
- (ins VR128:$src1, i128mem:$src2),
- !strconcat(OpcodeStr, "\t{$src2, $dst|$dst, $src2}"),
- [(set VR128:$dst,
- (OpNode VR128:$src1, (memopv4i32 addr:$src2)))]>, OpSize;
- def rm_int : SS48I<opc, MRMSrcMem, (outs VR128:$dst),
- (ins VR128:$src1, i128mem:$src2),
- !strconcat(OpcodeStr, "\t{$src2, $dst|$dst, $src2}"),
- [(set VR128:$dst,
- (IntId128 VR128:$src1, (memopv4i32 addr:$src2)))]>,
- OpSize;
- }
-}
-defm PMULLD : SS41I_binop_patint<0x40, "pmulld", mul,
- int_x86_sse41_pmulld, 1>;
-
-
-/// SS41I_binop_rmi_int - SSE 4.1 binary operator with 8-bit immediate
-let Constraints = "$src1 = $dst" in {
- multiclass SS41I_binop_rmi_int<bits<8> opc, string OpcodeStr,
- Intrinsic IntId128, bit Commutable = 0> {
- def rri : SS4AIi8<opc, MRMSrcReg, (outs VR128:$dst),
- (ins VR128:$src1, VR128:$src2, i32i8imm:$src3),
- !strconcat(OpcodeStr,
- "\t{$src3, $src2, $dst|$dst, $src2, $src3}"),
- [(set VR128:$dst,
- (IntId128 VR128:$src1, VR128:$src2, imm:$src3))]>,
- OpSize {
- let isCommutable = Commutable;
- }
- def rmi : SS4AIi8<opc, MRMSrcMem, (outs VR128:$dst),
- (ins VR128:$src1, i128mem:$src2, i32i8imm:$src3),
- !strconcat(OpcodeStr,
- "\t{$src3, $src2, $dst|$dst, $src2, $src3}"),
- [(set VR128:$dst,
- (IntId128 VR128:$src1,
- (bitconvert (memopv16i8 addr:$src2)), imm:$src3))]>,
- OpSize;
- }
-}
-
-defm BLENDPS : SS41I_binop_rmi_int<0x0C, "blendps",
- int_x86_sse41_blendps, 0>;
-defm BLENDPD : SS41I_binop_rmi_int<0x0D, "blendpd",
- int_x86_sse41_blendpd, 0>;
-defm PBLENDW : SS41I_binop_rmi_int<0x0E, "pblendw",
- int_x86_sse41_pblendw, 0>;
-defm DPPS : SS41I_binop_rmi_int<0x40, "dpps",
- int_x86_sse41_dpps, 1>;
-defm DPPD : SS41I_binop_rmi_int<0x41, "dppd",
- int_x86_sse41_dppd, 1>;
-defm MPSADBW : SS41I_binop_rmi_int<0x42, "mpsadbw",
- int_x86_sse41_mpsadbw, 0>;
-
-
-/// SS41I_ternary_int - SSE 4.1 ternary operator
-let Uses = [XMM0], Constraints = "$src1 = $dst" in {
- multiclass SS41I_ternary_int<bits<8> opc, string OpcodeStr, Intrinsic IntId> {
- def rr0 : SS48I<opc, MRMSrcReg, (outs VR128:$dst),
- (ins VR128:$src1, VR128:$src2),
- !strconcat(OpcodeStr,
- "\t{%xmm0, $src2, $dst|$dst, $src2, %xmm0}"),
- [(set VR128:$dst, (IntId VR128:$src1, VR128:$src2, XMM0))]>,
- OpSize;
-
- def rm0 : SS48I<opc, MRMSrcMem, (outs VR128:$dst),
- (ins VR128:$src1, i128mem:$src2),
- !strconcat(OpcodeStr,
- "\t{%xmm0, $src2, $dst|$dst, $src2, %xmm0}"),
- [(set VR128:$dst,
- (IntId VR128:$src1,
- (bitconvert (memopv16i8 addr:$src2)), XMM0))]>, OpSize;
- }
-}
-
-defm BLENDVPD : SS41I_ternary_int<0x15, "blendvpd", int_x86_sse41_blendvpd>;
-defm BLENDVPS : SS41I_ternary_int<0x14, "blendvps", int_x86_sse41_blendvps>;
-defm PBLENDVB : SS41I_ternary_int<0x10, "pblendvb", int_x86_sse41_pblendvb>;
-
-
-multiclass SS41I_binop_rm_int8<bits<8> opc, string OpcodeStr, Intrinsic IntId> {
- def rr : SS48I<opc, MRMSrcReg, (outs VR128:$dst), (ins VR128:$src),
- !strconcat(OpcodeStr, "\t{$src, $dst|$dst, $src}"),
- [(set VR128:$dst, (IntId VR128:$src))]>, OpSize;
-
- def rm : SS48I<opc, MRMSrcMem, (outs VR128:$dst), (ins i64mem:$src),
- !strconcat(OpcodeStr, "\t{$src, $dst|$dst, $src}"),
- [(set VR128:$dst,
- (IntId (bitconvert (v4i32 (load addr:$src)))))]>, OpSize;
-}
-
-defm PMOVSXBW : SS41I_binop_rm_int8<0x20, "pmovsxbw", int_x86_sse41_pmovsxbw>;
-defm PMOVSXWD : SS41I_binop_rm_int8<0x23, "pmovsxwd", int_x86_sse41_pmovsxwd>;
-defm PMOVSXDQ : SS41I_binop_rm_int8<0x25, "pmovsxdq", int_x86_sse41_pmovsxdq>;
-defm PMOVZXBW : SS41I_binop_rm_int8<0x30, "pmovzxbw", int_x86_sse41_pmovzxbw>;
-defm PMOVZXWD : SS41I_binop_rm_int8<0x33, "pmovzxwd", int_x86_sse41_pmovzxwd>;
-defm PMOVZXDQ : SS41I_binop_rm_int8<0x35, "pmovzxdq", int_x86_sse41_pmovzxdq>;
-
-multiclass SS41I_binop_rm_int4<bits<8> opc, string OpcodeStr, Intrinsic IntId> {
- def rr : SS48I<opc, MRMSrcReg, (outs VR128:$dst), (ins VR128:$src),
- !strconcat(OpcodeStr, "\t{$src, $dst|$dst, $src}"),
- [(set VR128:$dst, (IntId VR128:$src))]>, OpSize;
-
- def rm : SS48I<opc, MRMSrcMem, (outs VR128:$dst), (ins i32mem:$src),
- !strconcat(OpcodeStr, "\t{$src, $dst|$dst, $src}"),
- [(set VR128:$dst,
- (IntId (bitconvert (v4i32 (load addr:$src)))))]>, OpSize;
-}
-
-defm PMOVSXBD : SS41I_binop_rm_int4<0x21, "pmovsxbd", int_x86_sse41_pmovsxbd>;
-defm PMOVSXWQ : SS41I_binop_rm_int4<0x24, "pmovsxwq", int_x86_sse41_pmovsxwq>;
-defm PMOVZXBD : SS41I_binop_rm_int4<0x31, "pmovzxbd", int_x86_sse41_pmovzxbd>;
-defm PMOVZXWQ : SS41I_binop_rm_int4<0x34, "pmovzxwq", int_x86_sse41_pmovzxwq>;
-
-multiclass SS41I_binop_rm_int2<bits<8> opc, string OpcodeStr, Intrinsic IntId> {
- def rr : SS48I<opc, MRMSrcReg, (outs VR128:$dst), (ins VR128:$src),
- !strconcat(OpcodeStr, "\t{$src, $dst|$dst, $src}"),
- [(set VR128:$dst, (IntId VR128:$src))]>, OpSize;
-
- def rm : SS48I<opc, MRMSrcMem, (outs VR128:$dst), (ins i16mem:$src),
- !strconcat(OpcodeStr, "\t{$src, $dst|$dst, $src}"),
- [(set VR128:$dst,
- (IntId (bitconvert (v4i32 (load addr:$src)))))]>, OpSize;
-}
-
-defm PMOVSXBQ : SS41I_binop_rm_int2<0x22, "pmovsxbq", int_x86_sse41_pmovsxbq>;
-defm PMOVZXBQ : SS41I_binop_rm_int2<0x32, "pmovsxbq", int_x86_sse41_pmovzxbq>;
-
-
-/// SS41I_binop_ext8 - SSE 4.1 extract 8 bits to 32 bit reg or 8 bit mem
-multiclass SS41I_extract8<bits<8> opc, string OpcodeStr> {
- def rr : SS4AIi8<opc, MRMDestReg, (outs GR32:$dst),
- (ins VR128:$src1, i32i8imm:$src2),
- !strconcat(OpcodeStr,
- "\t{$src2, $src1, $dst|$dst, $src1, $src2}"),
- [(set GR32:$dst, (X86pextrb (v16i8 VR128:$src1), imm:$src2))]>,
- OpSize;
- def mr : SS4AIi8<opc, MRMDestMem, (outs),
- (ins i8mem:$dst, VR128:$src1, i32i8imm:$src2),
- !strconcat(OpcodeStr,
- "\t{$src2, $src1, $dst|$dst, $src1, $src2}"),
- []>, OpSize;
-// FIXME:
-// There's an AssertZext in the way of writing the store pattern
-// (store (i8 (trunc (X86pextrb (v16i8 VR128:$src1), imm:$src2))), addr:$dst)
-}
-
-defm PEXTRB : SS41I_extract8<0x14, "pextrb">;
-
-
-/// SS41I_extract16 - SSE 4.1 extract 16 bits to memory destination
-multiclass SS41I_extract16<bits<8> opc, string OpcodeStr> {
- def mr : SS4AIi8<opc, MRMDestMem, (outs),
- (ins i16mem:$dst, VR128:$src1, i32i8imm:$src2),
- !strconcat(OpcodeStr,
- "\t{$src2, $src1, $dst|$dst, $src1, $src2}"),
- []>, OpSize;
-// FIXME:
-// There's an AssertZext in the way of writing the store pattern
-// (store (i16 (trunc (X86pextrw (v16i8 VR128:$src1), imm:$src2))), addr:$dst)
-}
-
-defm PEXTRW : SS41I_extract16<0x15, "pextrw">;
-
-
-/// SS41I_extract32 - SSE 4.1 extract 32 bits to int reg or memory destination
-multiclass SS41I_extract32<bits<8> opc, string OpcodeStr> {
- def rr : SS4AIi8<opc, MRMDestReg, (outs GR32:$dst),
- (ins VR128:$src1, i32i8imm:$src2),
- !strconcat(OpcodeStr,
- "\t{$src2, $src1, $dst|$dst, $src1, $src2}"),
- [(set GR32:$dst,
- (extractelt (v4i32 VR128:$src1), imm:$src2))]>, OpSize;
- def mr : SS4AIi8<opc, MRMDestMem, (outs),
- (ins i32mem:$dst, VR128:$src1, i32i8imm:$src2),
- !strconcat(OpcodeStr,
- "\t{$src2, $src1, $dst|$dst, $src1, $src2}"),
- [(store (extractelt (v4i32 VR128:$src1), imm:$src2),
- addr:$dst)]>, OpSize;
-}
-
-defm PEXTRD : SS41I_extract32<0x16, "pextrd">;
-
-
-/// SS41I_extractf32 - SSE 4.1 extract 32 bits fp value to int reg or memory
-/// destination
-multiclass SS41I_extractf32<bits<8> opc, string OpcodeStr> {
- def rr : SS4AIi8<opc, MRMDestReg, (outs GR32:$dst),
- (ins VR128:$src1, i32i8imm:$src2),
- !strconcat(OpcodeStr,
- "\t{$src2, $src1, $dst|$dst, $src1, $src2}"),
- [(set GR32:$dst,
- (extractelt (bc_v4i32 (v4f32 VR128:$src1)), imm:$src2))]>,
- OpSize;
- def mr : SS4AIi8<opc, MRMDestMem, (outs),
- (ins f32mem:$dst, VR128:$src1, i32i8imm:$src2),
- !strconcat(OpcodeStr,
- "\t{$src2, $src1, $dst|$dst, $src1, $src2}"),
- [(store (extractelt (bc_v4i32 (v4f32 VR128:$src1)), imm:$src2),
- addr:$dst)]>, OpSize;
-}
-
-defm EXTRACTPS : SS41I_extractf32<0x17, "extractps">;
-
-let Constraints = "$src1 = $dst" in {
- multiclass SS41I_insert8<bits<8> opc, string OpcodeStr> {
- def rr : SS4AIi8<opc, MRMSrcReg, (outs VR128:$dst),
- (ins VR128:$src1, GR32:$src2, i32i8imm:$src3),
- !strconcat(OpcodeStr,
- "\t{$src3, $src2, $dst|$dst, $src2, $src3}"),
- [(set VR128:$dst,
- (X86pinsrb VR128:$src1, GR32:$src2, imm:$src3))]>, OpSize;
- def rm : SS4AIi8<opc, MRMSrcMem, (outs VR128:$dst),
- (ins VR128:$src1, i8mem:$src2, i32i8imm:$src3),
- !strconcat(OpcodeStr,
- "\t{$src3, $src2, $dst|$dst, $src2, $src3}"),
- [(set VR128:$dst,
- (X86pinsrb VR128:$src1, (extloadi8 addr:$src2),
- imm:$src3))]>, OpSize;
- }
-}
-
-defm PINSRB : SS41I_insert8<0x20, "pinsrb">;
-
-let Constraints = "$src1 = $dst" in {
- multiclass SS41I_insert32<bits<8> opc, string OpcodeStr> {
- def rr : SS4AIi8<opc, MRMSrcReg, (outs VR128:$dst),
- (ins VR128:$src1, GR32:$src2, i32i8imm:$src3),
- !strconcat(OpcodeStr,
- "\t{$src3, $src2, $dst|$dst, $src2, $src3}"),
- [(set VR128:$dst,
- (v4i32 (insertelt VR128:$src1, GR32:$src2, imm:$src3)))]>,
- OpSize;
- def rm : SS4AIi8<opc, MRMSrcMem, (outs VR128:$dst),
- (ins VR128:$src1, i32mem:$src2, i32i8imm:$src3),
- !strconcat(OpcodeStr,
- "\t{$src3, $src2, $dst|$dst, $src2, $src3}"),
- [(set VR128:$dst,
- (v4i32 (insertelt VR128:$src1, (loadi32 addr:$src2),
- imm:$src3)))]>, OpSize;
- }
-}
-
-defm PINSRD : SS41I_insert32<0x22, "pinsrd">;
-
-let Constraints = "$src1 = $dst" in {
- multiclass SS41I_insertf32<bits<8> opc, string OpcodeStr> {
- def rr : SS4AIi8<opc, MRMSrcReg, (outs VR128:$dst),
- (ins VR128:$src1, FR32:$src2, i32i8imm:$src3),
- !strconcat(OpcodeStr,
- "\t{$src3, $src2, $dst|$dst, $src2, $src3}"),
- [(set VR128:$dst,
- (X86insrtps VR128:$src1, FR32:$src2, imm:$src3))]>, OpSize;
- def rm : SS4AIi8<opc, MRMSrcMem, (outs VR128:$dst),
- (ins VR128:$src1, f32mem:$src2, i32i8imm:$src3),
- !strconcat(OpcodeStr,
- "\t{$src3, $src2, $dst|$dst, $src2, $src3}"),
- [(set VR128:$dst,
- (X86insrtps VR128:$src1, (loadf32 addr:$src2),
- imm:$src3))]>, OpSize;
- }
-}
-
-defm INSERTPS : SS41I_insertf32<0x21, "insertps">;
-
-let Defs = [EFLAGS] in {
-def PTESTrr : SS48I<0x17, MRMSrcReg, (outs), (ins VR128:$src1, VR128:$src2),
- "ptest \t{$src2, $src1|$src1, $src2}", []>, OpSize;
-def PTESTrm : SS48I<0x17, MRMSrcMem, (outs), (ins VR128:$src1, i128mem:$src2),
- "ptest \t{$src2, $src1|$src1, $src2}", []>, OpSize;
-}
-
-def MOVNTDQArm : SS48I<0x2A, MRMSrcMem, (outs VR128:$dst), (ins i128mem:$src),
- "movntdqa\t{$src, $dst|$dst, $src}",
- [(set VR128:$dst, (int_x86_sse41_movntdqa addr:$src))]>;
diff --git a/release_23/lib/Target/X86/X86IntelAsmPrinter.cpp b/release_23/lib/Target/X86/X86IntelAsmPrinter.cpp
deleted file mode 100644
index ddd90cd40a87..000000000000
--- a/release_23/lib/Target/X86/X86IntelAsmPrinter.cpp
+++ /dev/null
@@ -1,512 +0,0 @@
-//===-- X86IntelAsmPrinter.cpp - Convert X86 LLVM code to Intel assembly --===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains a printer that converts from our internal representation
-// of machine-dependent LLVM code to Intel format assembly language.
-// This printer is the output mechanism used by `llc'.
-//
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "asm-printer"
-#include "X86IntelAsmPrinter.h"
-#include "X86TargetAsmInfo.h"
-#include "X86.h"
-#include "llvm/CallingConv.h"
-#include "llvm/Constants.h"
-#include "llvm/Module.h"
-#include "llvm/Assembly/Writer.h"
-#include "llvm/Support/Mangler.h"
-#include "llvm/Target/TargetAsmInfo.h"
-#include "llvm/Target/TargetOptions.h"
-#include "llvm/ADT/Statistic.h"
-using namespace llvm;
-
-STATISTIC(EmittedInsts, "Number of machine instrs printed");
-
-std::string X86IntelAsmPrinter::getSectionForFunction(const Function &F) const {
- // Intel asm always emits functions to _text.
- return "_text";
-}
-
-/// runOnMachineFunction - This uses the printMachineInstruction()
-/// method to print assembly for each instruction.
-///
-bool X86IntelAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
- SetupMachineFunction(MF);
- O << "\n\n";
-
- // Print out constants referenced by the function
- EmitConstantPool(MF.getConstantPool());
-
- // Print out labels for the function.
- const Function *F = MF.getFunction();
- unsigned CC = F->getCallingConv();
-
- // Populate function information map. Actually, We don't want to populate
- // non-stdcall or non-fastcall functions' information right now.
- if (CC == CallingConv::X86_StdCall || CC == CallingConv::X86_FastCall)
- FunctionInfoMap[F] = *MF.getInfo<X86MachineFunctionInfo>();
-
- X86SharedAsmPrinter::decorateName(CurrentFnName, F);
-
- SwitchToTextSection(getSectionForFunction(*F).c_str(), F);
-
- unsigned FnAlign = OptimizeForSize ? 1 : 4;
- switch (F->getLinkage()) {
- default: assert(0 && "Unsupported linkage type!");
- case Function::InternalLinkage:
- EmitAlignment(FnAlign);
- break;
- case Function::DLLExportLinkage:
- DLLExportedFns.insert(CurrentFnName);
- //FALLS THROUGH
- case Function::ExternalLinkage:
- O << "\tpublic " << CurrentFnName << "\n";
- EmitAlignment(FnAlign);
- break;
- }
-
- O << CurrentFnName << "\tproc near\n";
-
- // Print out code for the function.
- for (MachineFunction::const_iterator I = MF.begin(), E = MF.end();
- I != E; ++I) {
- // Print a label for the basic block if there are any predecessors.
- if (!I->pred_empty()) {
- printBasicBlockLabel(I, true, true);
- O << '\n';
- }
- for (MachineBasicBlock::const_iterator II = I->begin(), E = I->end();
- II != E; ++II) {
- // Print the assembly for the instruction.
- printMachineInstruction(II);
- }
- }
-
- // Print out jump tables referenced by the function.
- EmitJumpTableInfo(MF.getJumpTableInfo(), MF);
-
- O << CurrentFnName << "\tendp\n";
-
- // We didn't modify anything.
- return false;
-}
-
-void X86IntelAsmPrinter::printSSECC(const MachineInstr *MI, unsigned Op) {
- unsigned char value = MI->getOperand(Op).getImm();
- assert(value <= 7 && "Invalid ssecc argument!");
- switch (value) {
- case 0: O << "eq"; break;
- case 1: O << "lt"; break;
- case 2: O << "le"; break;
- case 3: O << "unord"; break;
- case 4: O << "neq"; break;
- case 5: O << "nlt"; break;
- case 6: O << "nle"; break;
- case 7: O << "ord"; break;
- }
-}
-
-void X86IntelAsmPrinter::printOp(const MachineOperand &MO,
- const char *Modifier) {
- switch (MO.getType()) {
- case MachineOperand::MO_Register: {
- if (TargetRegisterInfo::isPhysicalRegister(MO.getReg())) {
- unsigned Reg = MO.getReg();
- if (Modifier && strncmp(Modifier, "subreg", strlen("subreg")) == 0) {
- MVT::ValueType VT = (strcmp(Modifier,"subreg64") == 0) ?
- MVT::i64 : ((strcmp(Modifier, "subreg32") == 0) ? MVT::i32 :
- ((strcmp(Modifier,"subreg16") == 0) ? MVT::i16 :MVT::i8));
- Reg = getX86SubSuperRegister(Reg, VT);
- }
- O << TRI->getAsmName(Reg);
- } else
- O << "reg" << MO.getReg();
- return;
- }
- case MachineOperand::MO_Immediate:
- O << MO.getImm();
- return;
- case MachineOperand::MO_MachineBasicBlock:
- printBasicBlockLabel(MO.getMBB());
- return;
- case MachineOperand::MO_JumpTableIndex: {
- bool isMemOp = Modifier && !strcmp(Modifier, "mem");
- if (!isMemOp) O << "OFFSET ";
- O << TAI->getPrivateGlobalPrefix() << "JTI" << getFunctionNumber()
- << "_" << MO.getIndex();
- return;
- }
- case MachineOperand::MO_ConstantPoolIndex: {
- bool isMemOp = Modifier && !strcmp(Modifier, "mem");
- if (!isMemOp) O << "OFFSET ";
- O << "[" << TAI->getPrivateGlobalPrefix() << "CPI"
- << getFunctionNumber() << "_" << MO.getIndex();
- int Offset = MO.getOffset();
- if (Offset > 0)
- O << " + " << Offset;
- else if (Offset < 0)
- O << Offset;
- O << "]";
- return;
- }
- case MachineOperand::MO_GlobalAddress: {
- bool isCallOp = Modifier && !strcmp(Modifier, "call");
- bool isMemOp = Modifier && !strcmp(Modifier, "mem");
- GlobalValue *GV = MO.getGlobal();
- std::string Name = Mang->getValueName(GV);
-
- X86SharedAsmPrinter::decorateName(Name, GV);
-
- if (!isMemOp && !isCallOp) O << "OFFSET ";
- if (GV->hasDLLImportLinkage()) {
- // FIXME: This should be fixed with full support of stdcall & fastcall
- // CC's
- O << "__imp_";
- }
- O << Name;
- int Offset = MO.getOffset();
- if (Offset > 0)
- O << " + " << Offset;
- else if (Offset < 0)
- O << Offset;
- return;
- }
- case MachineOperand::MO_ExternalSymbol: {
- bool isCallOp = Modifier && !strcmp(Modifier, "call");
- if (!isCallOp) O << "OFFSET ";
- O << TAI->getGlobalPrefix() << MO.getSymbolName();
- return;
- }
- default:
- O << "<unknown operand type>"; return;
- }
-}
-
-void X86IntelAsmPrinter::printMemReference(const MachineInstr *MI, unsigned Op,
- const char *Modifier) {
- assert(isMem(MI, Op) && "Invalid memory reference!");
-
- const MachineOperand &BaseReg = MI->getOperand(Op);
- int ScaleVal = MI->getOperand(Op+1).getImm();
- const MachineOperand &IndexReg = MI->getOperand(Op+2);
- const MachineOperand &DispSpec = MI->getOperand(Op+3);
-
- O << "[";
- bool NeedPlus = false;
- if (BaseReg.getReg()) {
- printOp(BaseReg, Modifier);
- NeedPlus = true;
- }
-
- if (IndexReg.getReg()) {
- if (NeedPlus) O << " + ";
- if (ScaleVal != 1)
- O << ScaleVal << "*";
- printOp(IndexReg, Modifier);
- NeedPlus = true;
- }
-
- if (DispSpec.isGlobalAddress() || DispSpec.isConstantPoolIndex() ||
- DispSpec.isJumpTableIndex()) {
- if (NeedPlus)
- O << " + ";
- printOp(DispSpec, "mem");
- } else {
- int DispVal = DispSpec.getImm();
- if (DispVal || (!BaseReg.getReg() && !IndexReg.getReg())) {
- if (NeedPlus) {
- if (DispVal > 0)
- O << " + ";
- else {
- O << " - ";
- DispVal = -DispVal;
- }
- }
- O << DispVal;
- }
- }
- O << "]";
-}
-
-void X86IntelAsmPrinter::printPICJumpTableSetLabel(unsigned uid,
- const MachineBasicBlock *MBB) const {
- if (!TAI->getSetDirective())
- return;
-
- O << TAI->getSetDirective() << ' ' << TAI->getPrivateGlobalPrefix()
- << getFunctionNumber() << '_' << uid << "_set_" << MBB->getNumber() << ',';
- printBasicBlockLabel(MBB, false, false, false);
- O << '-' << "\"L" << getFunctionNumber() << "$pb\"'\n";
-}
-
-void X86IntelAsmPrinter::printPICLabel(const MachineInstr *MI, unsigned Op) {
- O << "\"L" << getFunctionNumber() << "$pb\"\n";
- O << "\"L" << getFunctionNumber() << "$pb\":";
-}
-
-bool X86IntelAsmPrinter::printAsmMRegister(const MachineOperand &MO,
- const char Mode) {
- unsigned Reg = MO.getReg();
- switch (Mode) {
- default: return true; // Unknown mode.
- case 'b': // Print QImode register
- Reg = getX86SubSuperRegister(Reg, MVT::i8);
- break;
- case 'h': // Print QImode high register
- Reg = getX86SubSuperRegister(Reg, MVT::i8, true);
- break;
- case 'w': // Print HImode register
- Reg = getX86SubSuperRegister(Reg, MVT::i16);
- break;
- case 'k': // Print SImode register
- Reg = getX86SubSuperRegister(Reg, MVT::i32);
- break;
- }
-
- O << '%' << TRI->getAsmName(Reg);
- return false;
-}
-
-/// PrintAsmOperand - Print out an operand for an inline asm expression.
-///
-bool X86IntelAsmPrinter::PrintAsmOperand(const MachineInstr *MI, unsigned OpNo,
- unsigned AsmVariant,
- const char *ExtraCode) {
- // Does this asm operand have a single letter operand modifier?
- if (ExtraCode && ExtraCode[0]) {
- if (ExtraCode[1] != 0) return true; // Unknown modifier.
-
- switch (ExtraCode[0]) {
- default: return true; // Unknown modifier.
- case 'b': // Print QImode register
- case 'h': // Print QImode high register
- case 'w': // Print HImode register
- case 'k': // Print SImode register
- return printAsmMRegister(MI->getOperand(OpNo), ExtraCode[0]);
- }
- }
-
- printOperand(MI, OpNo);
- return false;
-}
-
-bool X86IntelAsmPrinter::PrintAsmMemoryOperand(const MachineInstr *MI,
- unsigned OpNo,
- unsigned AsmVariant,
- const char *ExtraCode) {
- if (ExtraCode && ExtraCode[0])
- return true; // Unknown modifier.
- printMemReference(MI, OpNo);
- return false;
-}
-
-/// printMachineInstruction -- Print out a single X86 LLVM instruction
-/// MI in Intel syntax to the current output stream.
-///
-void X86IntelAsmPrinter::printMachineInstruction(const MachineInstr *MI) {
- ++EmittedInsts;
-
- // Call the autogenerated instruction printer routines.
- printInstruction(MI);
-}
-
-bool X86IntelAsmPrinter::doInitialization(Module &M) {
- bool Result = X86SharedAsmPrinter::doInitialization(M);
-
- Mang->markCharUnacceptable('.');
-
- O << "\t.686\n\t.model flat\n\n";
-
- // Emit declarations for external functions.
- for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I)
- if (I->isDeclaration()) {
- std::string Name = Mang->getValueName(I);
- X86SharedAsmPrinter::decorateName(Name, I);
-
- O << "\textern " ;
- if (I->hasDLLImportLinkage()) {
- O << "__imp_";
- }
- O << Name << ":near\n";
- }
-
- // Emit declarations for external globals. Note that VC++ always declares
- // external globals to have type byte, and if that's good enough for VC++...
- for (Module::const_global_iterator I = M.global_begin(), E = M.global_end();
- I != E; ++I) {
- if (I->isDeclaration()) {
- std::string Name = Mang->getValueName(I);
-
- O << "\textern " ;
- if (I->hasDLLImportLinkage()) {
- O << "__imp_";
- }
- O << Name << ":byte\n";
- }
- }
-
- return Result;
-}
-
-bool X86IntelAsmPrinter::doFinalization(Module &M) {
- const TargetData *TD = TM.getTargetData();
-
- // Print out module-level global variables here.
- for (Module::const_global_iterator I = M.global_begin(), E = M.global_end();
- I != E; ++I) {
- if (I->isDeclaration()) continue; // External global require no code
-
- // Check to see if this is a special global used by LLVM, if so, emit it.
- if (EmitSpecialLLVMGlobal(I))
- continue;
-
- std::string name = Mang->getValueName(I);
- Constant *C = I->getInitializer();
- unsigned Align = TD->getPreferredAlignmentLog(I);
- bool bCustomSegment = false;
-
- switch (I->getLinkage()) {
- case GlobalValue::LinkOnceLinkage:
- case GlobalValue::WeakLinkage:
- SwitchToDataSection("");
- O << name << "?\tsegment common 'COMMON'\n";
- bCustomSegment = true;
- // FIXME: the default alignment is 16 bytes, but 1, 2, 4, and 256
- // are also available.
- break;
- case GlobalValue::AppendingLinkage:
- SwitchToDataSection("");
- O << name << "?\tsegment public 'DATA'\n";
- bCustomSegment = true;
- // FIXME: the default alignment is 16 bytes, but 1, 2, 4, and 256
- // are also available.
- break;
- case GlobalValue::DLLExportLinkage:
- DLLExportedGVs.insert(name);
- // FALL THROUGH
- case GlobalValue::ExternalLinkage:
- O << "\tpublic " << name << "\n";
- // FALL THROUGH
- case GlobalValue::InternalLinkage:
- SwitchToDataSection(TAI->getDataSection(), I);
- break;
- default:
- assert(0 && "Unknown linkage type!");
- }
-
- if (!bCustomSegment)
- EmitAlignment(Align, I);
-
- O << name << ":\t\t\t\t" << TAI->getCommentString()
- << " " << I->getName() << '\n';
-
- EmitGlobalConstant(C);
-
- if (bCustomSegment)
- O << name << "?\tends\n";
- }
-
- // Output linker support code for dllexported globals
- if (!DLLExportedGVs.empty() ||
- !DLLExportedFns.empty()) {
- SwitchToDataSection("");
- O << "; WARNING: The following code is valid only with MASM v8.x and (possible) higher\n"
- << "; This version of MASM is usually shipped with Microsoft Visual Studio 2005\n"
- << "; or (possible) further versions. Unfortunately, there is no way to support\n"
- << "; dllexported symbols in the earlier versions of MASM in fully automatic way\n\n";
- O << "_drectve\t segment info alias('.drectve')\n";
- }
-
- for (std::set<std::string>::iterator i = DLLExportedGVs.begin(),
- e = DLLExportedGVs.end();
- i != e; ++i) {
- O << "\t db ' /EXPORT:" << *i << ",data'\n";
- }
-
- for (std::set<std::string>::iterator i = DLLExportedFns.begin(),
- e = DLLExportedFns.end();
- i != e; ++i) {
- O << "\t db ' /EXPORT:" << *i << "'\n";
- }
-
- if (!DLLExportedGVs.empty() ||
- !DLLExportedFns.empty()) {
- O << "_drectve\t ends\n";
- }
-
- // Bypass X86SharedAsmPrinter::doFinalization().
- bool Result = AsmPrinter::doFinalization(M);
- SwitchToDataSection("");
- O << "\tend\n";
- return Result;
-}
-
-void X86IntelAsmPrinter::EmitString(const ConstantArray *CVA) const {
- unsigned NumElts = CVA->getNumOperands();
- if (NumElts) {
- // ML does not have escape sequences except '' for '. It also has a maximum
- // string length of 255.
- unsigned len = 0;
- bool inString = false;
- for (unsigned i = 0; i < NumElts; i++) {
- int n = cast<ConstantInt>(CVA->getOperand(i))->getZExtValue() & 255;
- if (len == 0)
- O << "\tdb ";
-
- if (n >= 32 && n <= 127) {
- if (!inString) {
- if (len > 0) {
- O << ",'";
- len += 2;
- } else {
- O << "'";
- len++;
- }
- inString = true;
- }
- if (n == '\'') {
- O << "'";
- len++;
- }
- O << char(n);
- } else {
- if (inString) {
- O << "'";
- len++;
- inString = false;
- }
- if (len > 0) {
- O << ",";
- len++;
- }
- O << n;
- len += 1 + (n > 9) + (n > 99);
- }
-
- if (len > 60) {
- if (inString) {
- O << "'";
- inString = false;
- }
- O << "\n";
- len = 0;
- }
- }
-
- if (len > 0) {
- if (inString)
- O << "'";
- O << "\n";
- }
- }
-}
-
-// Include the auto-generated portion of the assembly writer.
-#include "X86GenAsmWriter1.inc"
diff --git a/release_23/lib/Target/X86/X86IntelAsmPrinter.h b/release_23/lib/Target/X86/X86IntelAsmPrinter.h
deleted file mode 100644
index 2a10e1c9b71c..000000000000
--- a/release_23/lib/Target/X86/X86IntelAsmPrinter.h
+++ /dev/null
@@ -1,123 +0,0 @@
-//===-- X86IntelAsmPrinter.h - Convert X86 LLVM code to Intel assembly ----===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// Intel assembly code printer class.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef X86INTELASMPRINTER_H
-#define X86INTELASMPRINTER_H
-
-#include "X86AsmPrinter.h"
-#include "llvm/CodeGen/ValueTypes.h"
-#include "llvm/Target/TargetRegisterInfo.h"
-
-namespace llvm {
-
-struct VISIBILITY_HIDDEN X86IntelAsmPrinter : public X86SharedAsmPrinter {
- X86IntelAsmPrinter(std::ostream &O, X86TargetMachine &TM,
- const TargetAsmInfo *T)
- : X86SharedAsmPrinter(O, TM, T) {
- }
-
- virtual const char *getPassName() const {
- return "X86 Intel-Style Assembly Printer";
- }
-
- /// printInstruction - This method is automatically generated by tablegen
- /// from the instruction set description. This method returns true if the
- /// machine instruction was sufficiently described to print it, otherwise it
- /// returns false.
- bool printInstruction(const MachineInstr *MI);
-
- // This method is used by the tablegen'erated instruction printer.
- void printOperand(const MachineInstr *MI, unsigned OpNo,
- const char *Modifier = 0) {
- const MachineOperand &MO = MI->getOperand(OpNo);
- if (MO.isRegister()) {
- assert(TargetRegisterInfo::isPhysicalRegister(MO.getReg()) &&
- "Not physreg??");
- O << TM.getRegisterInfo()->get(MO.getReg()).AsmName;
- } else {
- printOp(MO, Modifier);
- }
- }
-
- void printi8mem(const MachineInstr *MI, unsigned OpNo) {
- O << "BYTE PTR ";
- printMemReference(MI, OpNo);
- }
- void printi16mem(const MachineInstr *MI, unsigned OpNo) {
- O << "WORD PTR ";
- printMemReference(MI, OpNo);
- }
- void printi32mem(const MachineInstr *MI, unsigned OpNo) {
- O << "DWORD PTR ";
- printMemReference(MI, OpNo);
- }
- void printi64mem(const MachineInstr *MI, unsigned OpNo) {
- O << "QWORD PTR ";
- printMemReference(MI, OpNo);
- }
- void printi128mem(const MachineInstr *MI, unsigned OpNo) {
- O << "XMMWORD PTR ";
- printMemReference(MI, OpNo);
- }
- void printf32mem(const MachineInstr *MI, unsigned OpNo) {
- O << "DWORD PTR ";
- printMemReference(MI, OpNo);
- }
- void printf64mem(const MachineInstr *MI, unsigned OpNo) {
- O << "QWORD PTR ";
- printMemReference(MI, OpNo);
- }
- void printf80mem(const MachineInstr *MI, unsigned OpNo) {
- O << "XWORD PTR ";
- printMemReference(MI, OpNo);
- }
- void printf128mem(const MachineInstr *MI, unsigned OpNo) {
- O << "XMMWORD PTR ";
- printMemReference(MI, OpNo);
- }
- void printlea64_32mem(const MachineInstr *MI, unsigned OpNo) {
- O << "QWORD PTR ";
- printMemReference(MI, OpNo, "subreg64");
- }
-
- bool printAsmMRegister(const MachineOperand &MO, const char Mode);
- bool PrintAsmOperand(const MachineInstr *MI, unsigned OpNo,
- unsigned AsmVariant, const char *ExtraCode);
- bool PrintAsmMemoryOperand(const MachineInstr *MI, unsigned OpNo,
- unsigned AsmVariant, const char *ExtraCode);
- void printMachineInstruction(const MachineInstr *MI);
- void printOp(const MachineOperand &MO, const char *Modifier = 0);
- void printSSECC(const MachineInstr *MI, unsigned Op);
- void printMemReference(const MachineInstr *MI, unsigned Op,
- const char *Modifier=NULL);
- void printPICJumpTableSetLabel(unsigned uid,
- const MachineBasicBlock *MBB) const;
- void printPICJumpTableSetLabel(unsigned uid, unsigned uid2,
- const MachineBasicBlock *MBB) const {
- AsmPrinter::printPICJumpTableSetLabel(uid, uid2, MBB);
- }
- void printPICLabel(const MachineInstr *MI, unsigned Op);
- bool runOnMachineFunction(MachineFunction &F);
- bool doInitialization(Module &M);
- bool doFinalization(Module &M);
-
- /// getSectionForFunction - Return the section that we should emit the
- /// specified function body into.
- virtual std::string getSectionForFunction(const Function &F) const;
-
- virtual void EmitString(const ConstantArray *CVA) const;
-};
-
-} // end namespace llvm
-
-#endif
diff --git a/release_23/lib/Target/X86/X86JITInfo.cpp b/release_23/lib/Target/X86/X86JITInfo.cpp
deleted file mode 100644
index 0ca93d9e92ff..000000000000
--- a/release_23/lib/Target/X86/X86JITInfo.cpp
+++ /dev/null
@@ -1,495 +0,0 @@
-//===-- X86JITInfo.cpp - Implement the JIT interfaces for the X86 target --===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the JIT interfaces for the X86 target.
-//
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "jit"
-#include "X86JITInfo.h"
-#include "X86Relocations.h"
-#include "X86Subtarget.h"
-#include "llvm/Function.h"
-#include "llvm/CodeGen/MachineCodeEmitter.h"
-#include "llvm/Config/alloca.h"
-#include <cstdlib>
-#include <cstring>
-using namespace llvm;
-
-// Determine the platform we're running on
-#if defined (__x86_64__) || defined (_M_AMD64)
-# define X86_64_JIT
-#elif defined(__i386__) || defined(i386) || defined(_M_IX86)
-# define X86_32_JIT
-#endif
-
-void X86JITInfo::replaceMachineCodeForFunction(void *Old, void *New) {
- unsigned char *OldByte = (unsigned char *)Old;
- *OldByte++ = 0xE9; // Emit JMP opcode.
- unsigned *OldWord = (unsigned *)OldByte;
- unsigned NewAddr = (intptr_t)New;
- unsigned OldAddr = (intptr_t)OldWord;
- *OldWord = NewAddr - OldAddr - 4; // Emit PC-relative addr of New code.
-}
-
-
-/// JITCompilerFunction - This contains the address of the JIT function used to
-/// compile a function lazily.
-static TargetJITInfo::JITCompilerFn JITCompilerFunction;
-
-// Get the ASMPREFIX for the current host. This is often '_'.
-#ifndef __USER_LABEL_PREFIX__
-#define __USER_LABEL_PREFIX__
-#endif
-#define GETASMPREFIX2(X) #X
-#define GETASMPREFIX(X) GETASMPREFIX2(X)
-#define ASMPREFIX GETASMPREFIX(__USER_LABEL_PREFIX__)
-
-// Provide a convenient way for disabling usage of CFI directives.
-// This is needed for old/broken assemblers (for example, gas on
-// Darwin is pretty old and doesn't support these directives)
-#if defined(__APPLE__)
-# define CFI(x)
-#else
-// FIXME: Disable this until we really want to use it. Also, we will
-// need to add some workarounds for compilers, which support
-// only subset of these directives.
-# define CFI(x)
-#endif
-
-// Provide a wrapper for X86CompilationCallback2 that saves non-traditional
-// callee saved registers, for the fastcc calling convention.
-extern "C" {
-#if defined(X86_64_JIT)
-# ifndef _MSC_VER
- // No need to save EAX/EDX for X86-64.
- void X86CompilationCallback(void);
- asm(
- ".text\n"
- ".align 8\n"
- ".globl " ASMPREFIX "X86CompilationCallback\n"
- ASMPREFIX "X86CompilationCallback:\n"
- CFI(".cfi_startproc\n")
- // Save RBP
- "pushq %rbp\n"
- CFI(".cfi_def_cfa_offset 16\n")
- CFI(".cfi_offset %rbp, -16\n")
- // Save RSP
- "movq %rsp, %rbp\n"
- CFI(".cfi_def_cfa_register %rbp\n")
- // Save all int arg registers
- "pushq %rdi\n"
- CFI(".cfi_rel_offset %rdi, 0\n")
- "pushq %rsi\n"
- CFI(".cfi_rel_offset %rsi, 8\n")
- "pushq %rdx\n"
- CFI(".cfi_rel_offset %rdx, 16\n")
- "pushq %rcx\n"
- CFI(".cfi_rel_offset %rcx, 24\n")
- "pushq %r8\n"
- CFI(".cfi_rel_offset %r8, 32\n")
- "pushq %r9\n"
- CFI(".cfi_rel_offset %r9, 40\n")
- // Align stack on 16-byte boundary. ESP might not be properly aligned
- // (8 byte) if this is called from an indirect stub.
- "andq $-16, %rsp\n"
- // Save all XMM arg registers
- "subq $128, %rsp\n"
- "movaps %xmm0, (%rsp)\n"
- "movaps %xmm1, 16(%rsp)\n"
- "movaps %xmm2, 32(%rsp)\n"
- "movaps %xmm3, 48(%rsp)\n"
- "movaps %xmm4, 64(%rsp)\n"
- "movaps %xmm5, 80(%rsp)\n"
- "movaps %xmm6, 96(%rsp)\n"
- "movaps %xmm7, 112(%rsp)\n"
- // JIT callee
- "movq %rbp, %rdi\n" // Pass prev frame and return address
- "movq 8(%rbp), %rsi\n"
- "call " ASMPREFIX "X86CompilationCallback2\n"
- // Restore all XMM arg registers
- "movaps 112(%rsp), %xmm7\n"
- "movaps 96(%rsp), %xmm6\n"
- "movaps 80(%rsp), %xmm5\n"
- "movaps 64(%rsp), %xmm4\n"
- "movaps 48(%rsp), %xmm3\n"
- "movaps 32(%rsp), %xmm2\n"
- "movaps 16(%rsp), %xmm1\n"
- "movaps (%rsp), %xmm0\n"
- // Restore RSP
- "movq %rbp, %rsp\n"
- CFI(".cfi_def_cfa_register %rsp\n")
- // Restore all int arg registers
- "subq $48, %rsp\n"
- CFI(".cfi_adjust_cfa_offset 48\n")
- "popq %r9\n"
- CFI(".cfi_adjust_cfa_offset -8\n")
- CFI(".cfi_restore %r9\n")
- "popq %r8\n"
- CFI(".cfi_adjust_cfa_offset -8\n")
- CFI(".cfi_restore %r8\n")
- "popq %rcx\n"
- CFI(".cfi_adjust_cfa_offset -8\n")
- CFI(".cfi_restore %rcx\n")
- "popq %rdx\n"
- CFI(".cfi_adjust_cfa_offset -8\n")
- CFI(".cfi_restore %rdx\n")
- "popq %rsi\n"
- CFI(".cfi_adjust_cfa_offset -8\n")
- CFI(".cfi_restore %rsi\n")
- "popq %rdi\n"
- CFI(".cfi_adjust_cfa_offset -8\n")
- CFI(".cfi_restore %rdi\n")
- // Restore RBP
- "popq %rbp\n"
- CFI(".cfi_adjust_cfa_offset -8\n")
- CFI(".cfi_restore %rbp\n")
- "ret\n"
- CFI(".cfi_endproc\n")
- );
-# else
- // No inline assembler support on this platform. The routine is in external
- // file.
- void X86CompilationCallback();
-
-# endif
-#elif defined (X86_32_JIT)
-# ifndef _MSC_VER
- void X86CompilationCallback(void);
- asm(
- ".text\n"
- ".align 8\n"
- ".globl " ASMPREFIX "X86CompilationCallback\n"
- ASMPREFIX "X86CompilationCallback:\n"
- CFI(".cfi_startproc\n")
- "pushl %ebp\n"
- CFI(".cfi_def_cfa_offset 8\n")
- CFI(".cfi_offset %ebp, -8\n")
- "movl %esp, %ebp\n" // Standard prologue
- CFI(".cfi_def_cfa_register %ebp\n")
- "pushl %eax\n"
- CFI(".cfi_rel_offset %eax, 0\n")
- "pushl %edx\n" // Save EAX/EDX/ECX
- CFI(".cfi_rel_offset %edx, 4\n")
- "pushl %ecx\n"
- CFI(".cfi_rel_offset %ecx, 8\n")
-# if defined(__APPLE__)
- "andl $-16, %esp\n" // Align ESP on 16-byte boundary
-# endif
- "subl $16, %esp\n"
- "movl 4(%ebp), %eax\n" // Pass prev frame and return address
- "movl %eax, 4(%esp)\n"
- "movl %ebp, (%esp)\n"
- "call " ASMPREFIX "X86CompilationCallback2\n"
- "movl %ebp, %esp\n" // Restore ESP
- CFI(".cfi_def_cfa_register %esp\n")
- "subl $12, %esp\n"
- CFI(".cfi_adjust_cfa_offset 12\n")
- "popl %ecx\n"
- CFI(".cfi_adjust_cfa_offset -4\n")
- CFI(".cfi_restore %ecx\n")
- "popl %edx\n"
- CFI(".cfi_adjust_cfa_offset -4\n")
- CFI(".cfi_restore %edx\n")
- "popl %eax\n"
- CFI(".cfi_adjust_cfa_offset -4\n")
- CFI(".cfi_restore %eax\n")
- "popl %ebp\n"
- CFI(".cfi_adjust_cfa_offset -4\n")
- CFI(".cfi_restore %ebp\n")
- "ret\n"
- CFI(".cfi_endproc\n")
- );
-
- // Same as X86CompilationCallback but also saves XMM argument registers.
- void X86CompilationCallback_SSE(void);
- asm(
- ".text\n"
- ".align 8\n"
- ".globl " ASMPREFIX "X86CompilationCallback_SSE\n"
- ASMPREFIX "X86CompilationCallback_SSE:\n"
- CFI(".cfi_startproc\n")
- "pushl %ebp\n"
- CFI(".cfi_def_cfa_offset 8\n")
- CFI(".cfi_offset %ebp, -8\n")
- "movl %esp, %ebp\n" // Standard prologue
- CFI(".cfi_def_cfa_register %ebp\n")
- "pushl %eax\n"
- CFI(".cfi_rel_offset %eax, 0\n")
- "pushl %edx\n" // Save EAX/EDX/ECX
- CFI(".cfi_rel_offset %edx, 4\n")
- "pushl %ecx\n"
- CFI(".cfi_rel_offset %ecx, 8\n")
- "andl $-16, %esp\n" // Align ESP on 16-byte boundary
- // Save all XMM arg registers
- "subl $64, %esp\n"
- // FIXME: provide frame move information for xmm registers.
- // This can be tricky, because CFA register is ebp (unaligned)
- // and we need to produce offsets relative to it.
- "movaps %xmm0, (%esp)\n"
- "movaps %xmm1, 16(%esp)\n"
- "movaps %xmm2, 32(%esp)\n"
- "movaps %xmm3, 48(%esp)\n"
- "subl $16, %esp\n"
- "movl 4(%ebp), %eax\n" // Pass prev frame and return address
- "movl %eax, 4(%esp)\n"
- "movl %ebp, (%esp)\n"
- "call " ASMPREFIX "X86CompilationCallback2\n"
- "addl $16, %esp\n"
- "movaps 48(%esp), %xmm3\n"
- CFI(".cfi_restore %xmm3\n")
- "movaps 32(%esp), %xmm2\n"
- CFI(".cfi_restore %xmm2\n")
- "movaps 16(%esp), %xmm1\n"
- CFI(".cfi_restore %xmm1\n")
- "movaps (%esp), %xmm0\n"
- CFI(".cfi_restore %xmm0\n")
- "movl %ebp, %esp\n" // Restore ESP
- CFI(".cfi_def_cfa_register esp\n")
- "subl $12, %esp\n"
- CFI(".cfi_adjust_cfa_offset 12\n")
- "popl %ecx\n"
- CFI(".cfi_adjust_cfa_offset -4\n")
- CFI(".cfi_restore %ecx\n")
- "popl %edx\n"
- CFI(".cfi_adjust_cfa_offset -4\n")
- CFI(".cfi_restore %edx\n")
- "popl %eax\n"
- CFI(".cfi_adjust_cfa_offset -4\n")
- CFI(".cfi_restore %eax\n")
- "popl %ebp\n"
- CFI(".cfi_adjust_cfa_offset -4\n")
- CFI(".cfi_restore %ebp\n")
- "ret\n"
- CFI(".cfi_endproc\n")
- );
-# else
- void X86CompilationCallback2(intptr_t *StackPtr, intptr_t RetAddr);
-
- _declspec(naked) void X86CompilationCallback(void) {
- __asm {
- push ebp
- mov ebp, esp
- push eax
- push edx
- push ecx
- and esp, -16
- mov eax, dword ptr [ebp+4]
- mov dword ptr [esp+4], eax
- mov dword ptr [esp], ebp
- call X86CompilationCallback2
- mov esp, ebp
- sub esp, 12
- pop ecx
- pop edx
- pop eax
- pop ebp
- ret
- }
- }
-
-# endif // _MSC_VER
-
-#else // Not an i386 host
- void X86CompilationCallback() {
- assert(0 && "Cannot call X86CompilationCallback() on a non-x86 arch!\n");
- abort();
- }
-#endif
-}
-
-/// X86CompilationCallback - This is the target-specific function invoked by the
-/// function stub when we did not know the real target of a call. This function
-/// must locate the start of the stub or call site and pass it into the JIT
-/// compiler function.
-extern "C" void X86CompilationCallback2(intptr_t *StackPtr, intptr_t RetAddr) {
- intptr_t *RetAddrLoc = &StackPtr[1];
- assert(*RetAddrLoc == RetAddr &&
- "Could not find return address on the stack!");
-
- // It's a stub if there is an interrupt marker after the call.
- bool isStub = ((unsigned char*)RetAddr)[0] == 0xCD;
-
- // The call instruction should have pushed the return value onto the stack...
-#if defined (X86_64_JIT)
- RetAddr--; // Backtrack to the reference itself...
-#else
- RetAddr -= 4; // Backtrack to the reference itself...
-#endif
-
-#if 0
- DOUT << "In callback! Addr=" << (void*)RetAddr
- << " ESP=" << (void*)StackPtr
- << ": Resolving call to function: "
- << TheVM->getFunctionReferencedName((void*)RetAddr) << "\n";
-#endif
-
- // Sanity check to make sure this really is a call instruction.
-#if defined (X86_64_JIT)
- assert(((unsigned char*)RetAddr)[-2] == 0x41 &&"Not a call instr!");
- assert(((unsigned char*)RetAddr)[-1] == 0xFF &&"Not a call instr!");
-#else
- assert(((unsigned char*)RetAddr)[-1] == 0xE8 &&"Not a call instr!");
-#endif
-
- intptr_t NewVal = (intptr_t)JITCompilerFunction((void*)RetAddr);
-
- // Rewrite the call target... so that we don't end up here every time we
- // execute the call.
-#if defined (X86_64_JIT)
- *(intptr_t *)(RetAddr - 0xa) = NewVal;
-#else
- *(intptr_t *)RetAddr = (intptr_t)(NewVal-RetAddr-4);
-#endif
-
- if (isStub) {
- // If this is a stub, rewrite the call into an unconditional branch
- // instruction so that two return addresses are not pushed onto the stack
- // when the requested function finally gets called. This also makes the
- // 0xCD byte (interrupt) dead, so the marker doesn't effect anything.
-#if defined (X86_64_JIT)
- ((unsigned char*)RetAddr)[0] = (2 | (4 << 3) | (3 << 6));
-#else
- ((unsigned char*)RetAddr)[-1] = 0xE9;
-#endif
- }
-
- // Change the return address to reexecute the call instruction...
-#if defined (X86_64_JIT)
- *RetAddrLoc -= 0xd;
-#else
- *RetAddrLoc -= 5;
-#endif
-}
-
-TargetJITInfo::LazyResolverFn
-X86JITInfo::getLazyResolverFunction(JITCompilerFn F) {
- JITCompilerFunction = F;
-
-#if defined (X86_32_JIT) && !defined (_MSC_VER)
- unsigned EAX = 0, EBX = 0, ECX = 0, EDX = 0;
- union {
- unsigned u[3];
- char c[12];
- } text;
-
- if (!X86::GetCpuIDAndInfo(0, &EAX, text.u+0, text.u+2, text.u+1)) {
- // FIXME: support for AMD family of processors.
- if (memcmp(text.c, "GenuineIntel", 12) == 0) {
- X86::GetCpuIDAndInfo(0x1, &EAX, &EBX, &ECX, &EDX);
- if ((EDX >> 25) & 0x1)
- return X86CompilationCallback_SSE;
- }
- }
-#endif
-
- return X86CompilationCallback;
-}
-
-void *X86JITInfo::emitGlobalValueLazyPtr(const GlobalValue* GV, void *ptr,
- MachineCodeEmitter &MCE) {
-#if defined (X86_64_JIT)
- MCE.startFunctionStub(GV, 8, 8);
- MCE.emitWordLE(((unsigned *)&ptr)[0]);
- MCE.emitWordLE(((unsigned *)&ptr)[1]);
-#else
- MCE.startFunctionStub(GV, 4, 4);
- MCE.emitWordLE((intptr_t)ptr);
-#endif
- return MCE.finishFunctionStub(GV);
-}
-
-void *X86JITInfo::emitFunctionStub(const Function* F, void *Fn,
- MachineCodeEmitter &MCE) {
- // Note, we cast to intptr_t here to silence a -pedantic warning that
- // complains about casting a function pointer to a normal pointer.
-#if defined (X86_32_JIT) && !defined (_MSC_VER)
- bool NotCC = (Fn != (void*)(intptr_t)X86CompilationCallback &&
- Fn != (void*)(intptr_t)X86CompilationCallback_SSE);
-#else
- bool NotCC = Fn != (void*)(intptr_t)X86CompilationCallback;
-#endif
- if (NotCC) {
-#if defined (X86_64_JIT)
- MCE.startFunctionStub(F, 13, 4);
- MCE.emitByte(0x49); // REX prefix
- MCE.emitByte(0xB8+2); // movabsq r10
- MCE.emitWordLE(((unsigned *)&Fn)[0]);
- MCE.emitWordLE(((unsigned *)&Fn)[1]);
- MCE.emitByte(0x41); // REX prefix
- MCE.emitByte(0xFF); // jmpq *r10
- MCE.emitByte(2 | (4 << 3) | (3 << 6));
-#else
- MCE.startFunctionStub(F, 5, 4);
- MCE.emitByte(0xE9);
- MCE.emitWordLE((intptr_t)Fn-MCE.getCurrentPCValue()-4);
-#endif
- return MCE.finishFunctionStub(F);
- }
-
-#if defined (X86_64_JIT)
- MCE.startFunctionStub(F, 14, 4);
- MCE.emitByte(0x49); // REX prefix
- MCE.emitByte(0xB8+2); // movabsq r10
- MCE.emitWordLE(((unsigned *)&Fn)[0]);
- MCE.emitWordLE(((unsigned *)&Fn)[1]);
- MCE.emitByte(0x41); // REX prefix
- MCE.emitByte(0xFF); // callq *r10
- MCE.emitByte(2 | (2 << 3) | (3 << 6));
-#else
- MCE.startFunctionStub(F, 6, 4);
- MCE.emitByte(0xE8); // Call with 32 bit pc-rel destination...
-
- MCE.emitWordLE((intptr_t)Fn-MCE.getCurrentPCValue()-4);
-#endif
-
- MCE.emitByte(0xCD); // Interrupt - Just a marker identifying the stub!
- return MCE.finishFunctionStub(F);
-}
-
-/// getPICJumpTableEntry - Returns the value of the jumptable entry for the
-/// specific basic block.
-intptr_t X86JITInfo::getPICJumpTableEntry(intptr_t BB, intptr_t Entry) {
- return BB - PICBase;
-}
-
-/// relocate - Before the JIT can run a block of code that has been emitted,
-/// it must rewrite the code to contain the actual addresses of any
-/// referenced global symbols.
-void X86JITInfo::relocate(void *Function, MachineRelocation *MR,
- unsigned NumRelocs, unsigned char* GOTBase) {
- for (unsigned i = 0; i != NumRelocs; ++i, ++MR) {
- void *RelocPos = (char*)Function + MR->getMachineCodeOffset();
- intptr_t ResultPtr = (intptr_t)MR->getResultPointer();
- switch ((X86::RelocationType)MR->getRelocationType()) {
- case X86::reloc_pcrel_word: {
- // PC relative relocation, add the relocated value to the value already in
- // memory, after we adjust it for where the PC is.
- ResultPtr = ResultPtr -(intptr_t)RelocPos - 4 - MR->getConstantVal();
- *((unsigned*)RelocPos) += (unsigned)ResultPtr;
- break;
- }
- case X86::reloc_picrel_word: {
- // PIC base relative relocation, add the relocated value to the value
- // already in memory, after we adjust it for where the PIC base is.
- ResultPtr = ResultPtr - ((intptr_t)Function + MR->getConstantVal());
- *((unsigned*)RelocPos) += (unsigned)ResultPtr;
- break;
- }
- case X86::reloc_absolute_word:
- // Absolute relocation, just add the relocated value to the value already
- // in memory.
- *((unsigned*)RelocPos) += (unsigned)ResultPtr;
- break;
- case X86::reloc_absolute_dword:
- *((intptr_t*)RelocPos) += ResultPtr;
- break;
- }
- }
-}
diff --git a/release_23/lib/Target/X86/X86JITInfo.h b/release_23/lib/Target/X86/X86JITInfo.h
deleted file mode 100644
index f9fcefecff5b..000000000000
--- a/release_23/lib/Target/X86/X86JITInfo.h
+++ /dev/null
@@ -1,67 +0,0 @@
-//===- X86JITInfo.h - X86 implementation of the JIT interface --*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains the X86 implementation of the TargetJITInfo class.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef X86JITINFO_H
-#define X86JITINFO_H
-
-#include "llvm/Function.h"
-#include "llvm/Target/TargetJITInfo.h"
-
-namespace llvm {
- class X86TargetMachine;
-
- class X86JITInfo : public TargetJITInfo {
- X86TargetMachine &TM;
- intptr_t PICBase;
- public:
- explicit X86JITInfo(X86TargetMachine &tm) : TM(tm) {useGOT = 0;}
-
- /// replaceMachineCodeForFunction - Make it so that calling the function
- /// whose machine code is at OLD turns into a call to NEW, perhaps by
- /// overwriting OLD with a branch to NEW. This is used for self-modifying
- /// code.
- ///
- virtual void replaceMachineCodeForFunction(void *Old, void *New);
-
- /// emitGlobalValueLazyPtr - Use the specified MachineCodeEmitter object to
- /// emit a lazy pointer which contains the address of the specified ptr.
- virtual void *emitGlobalValueLazyPtr(const GlobalValue* GV, void *ptr,
- MachineCodeEmitter &MCE);
-
- /// emitFunctionStub - Use the specified MachineCodeEmitter object to emit a
- /// small native function that simply calls the function at the specified
- /// address.
- virtual void *emitFunctionStub(const Function* F, void *Fn,
- MachineCodeEmitter &MCE);
-
- /// getPICJumpTableEntry - Returns the value of the jumptable entry for the
- /// specific basic block.
- virtual intptr_t getPICJumpTableEntry(intptr_t BB, intptr_t JTBase);
-
- /// getLazyResolverFunction - Expose the lazy resolver to the JIT.
- virtual LazyResolverFn getLazyResolverFunction(JITCompilerFn);
-
- /// relocate - Before the JIT can run a block of code that has been emitted,
- /// it must rewrite the code to contain the actual addresses of any
- /// referenced global symbols.
- virtual void relocate(void *Function, MachineRelocation *MR,
- unsigned NumRelocs, unsigned char* GOTBase);
-
- /// setPICBase / getPICBase - Getter / setter of PICBase, used to compute
- /// PIC jumptable entry.
- void setPICBase(intptr_t Base) { PICBase = Base; }
- intptr_t getPICBase() const { return PICBase; }
- };
-}
-
-#endif
diff --git a/release_23/lib/Target/X86/X86MachineFunctionInfo.h b/release_23/lib/Target/X86/X86MachineFunctionInfo.h
deleted file mode 100644
index b5c9cafeca82..000000000000
--- a/release_23/lib/Target/X86/X86MachineFunctionInfo.h
+++ /dev/null
@@ -1,101 +0,0 @@
-//====- X86MachineFuctionInfo.h - X86 machine function info -----*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file declares X86-specific per-machine-function information.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef X86MACHINEFUNCTIONINFO_H
-#define X86MACHINEFUNCTIONINFO_H
-
-#include "llvm/CodeGen/MachineFunction.h"
-
-namespace llvm {
-
-enum NameDecorationStyle {
- None,
- StdCall,
- FastCall
-};
-
-/// X86MachineFunctionInfo - This class is derived from MachineFunction private
-/// X86 target-specific information for each MachineFunction.
-class X86MachineFunctionInfo : public MachineFunctionInfo {
- /// ForceFramePointer - True if the function is required to use of frame
- /// pointer for reasons other than it containing dynamic allocation or
- /// that FP eliminatation is turned off. For example, Cygwin main function
- /// contains stack pointer re-alignment code which requires FP.
- bool ForceFramePointer;
-
- /// CalleeSavedFrameSize - Size of the callee-saved register portion of the
- /// stack frame in bytes.
- unsigned CalleeSavedFrameSize;
-
- /// BytesToPopOnReturn - Number of bytes function pops on return.
- /// Used on windows platform for stdcall & fastcall name decoration
- unsigned BytesToPopOnReturn;
-
- /// DecorationStyle - If the function requires additional name decoration,
- /// DecorationStyle holds the right way to do so.
- NameDecorationStyle DecorationStyle;
-
- /// ReturnAddrIndex - FrameIndex for return slot.
- int ReturnAddrIndex;
-
- /// TailCallReturnAddrDelta - Delta the ReturnAddr stack slot is moved
- /// Used for creating an area before the register spill area on the stack
- /// the returnaddr can be savely move to this area
- int TailCallReturnAddrDelta;
-
- /// SRetReturnReg - Some subtargets require that sret lowering includes
- /// returning the value of the returned struct in a register. This field
- /// holds the virtual register into which the sret argument is passed.
- unsigned SRetReturnReg;
-
-public:
- X86MachineFunctionInfo() : ForceFramePointer(false),
- CalleeSavedFrameSize(0),
- BytesToPopOnReturn(0),
- DecorationStyle(None),
- ReturnAddrIndex(0),
- TailCallReturnAddrDelta(0),
- SRetReturnReg(0) {}
-
- X86MachineFunctionInfo(MachineFunction &MF) : ForceFramePointer(false),
- CalleeSavedFrameSize(0),
- BytesToPopOnReturn(0),
- DecorationStyle(None),
- ReturnAddrIndex(0),
- TailCallReturnAddrDelta(0),
- SRetReturnReg(0) {}
-
- bool getForceFramePointer() const { return ForceFramePointer;}
- void setForceFramePointer(bool forceFP) { ForceFramePointer = forceFP; }
-
- unsigned getCalleeSavedFrameSize() const { return CalleeSavedFrameSize; }
- void setCalleeSavedFrameSize(unsigned bytes) { CalleeSavedFrameSize = bytes; }
-
- unsigned getBytesToPopOnReturn() const { return BytesToPopOnReturn; }
- void setBytesToPopOnReturn (unsigned bytes) { BytesToPopOnReturn = bytes;}
-
- NameDecorationStyle getDecorationStyle() const { return DecorationStyle; }
- void setDecorationStyle(NameDecorationStyle style) { DecorationStyle = style;}
-
- int getRAIndex() const { return ReturnAddrIndex; }
- void setRAIndex(int Index) { ReturnAddrIndex = Index; }
-
- int getTCReturnAddrDelta() const { return TailCallReturnAddrDelta; }
- void setTCReturnAddrDelta(int delta) {TailCallReturnAddrDelta = delta;}
-
- unsigned getSRetReturnReg() const { return SRetReturnReg; }
- void setSRetReturnReg(unsigned Reg) { SRetReturnReg = Reg; }
-};
-} // End llvm namespace
-
-#endif
diff --git a/release_23/lib/Target/X86/X86RegisterInfo.cpp b/release_23/lib/Target/X86/X86RegisterInfo.cpp
deleted file mode 100644
index a75c1de8a622..000000000000
--- a/release_23/lib/Target/X86/X86RegisterInfo.cpp
+++ /dev/null
@@ -1,1151 +0,0 @@
-//===- X86RegisterInfo.cpp - X86 Register Information -----------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains the X86 implementation of the TargetRegisterInfo class.
-// This file is responsible for the frame pointer elimination optimization
-// on X86.
-//
-//===----------------------------------------------------------------------===//
-
-#include "X86.h"
-#include "X86RegisterInfo.h"
-#include "X86InstrBuilder.h"
-#include "X86MachineFunctionInfo.h"
-#include "X86Subtarget.h"
-#include "X86TargetMachine.h"
-#include "llvm/Constants.h"
-#include "llvm/Function.h"
-#include "llvm/Type.h"
-#include "llvm/CodeGen/ValueTypes.h"
-#include "llvm/CodeGen/MachineInstrBuilder.h"
-#include "llvm/CodeGen/MachineFunction.h"
-#include "llvm/CodeGen/MachineFrameInfo.h"
-#include "llvm/CodeGen/MachineLocation.h"
-#include "llvm/CodeGen/MachineModuleInfo.h"
-#include "llvm/CodeGen/MachineRegisterInfo.h"
-#include "llvm/Target/TargetAsmInfo.h"
-#include "llvm/Target/TargetFrameInfo.h"
-#include "llvm/Target/TargetInstrInfo.h"
-#include "llvm/Target/TargetMachine.h"
-#include "llvm/Target/TargetOptions.h"
-#include "llvm/ADT/BitVector.h"
-#include "llvm/ADT/STLExtras.h"
-#include "llvm/Support/Compiler.h"
-using namespace llvm;
-
-X86RegisterInfo::X86RegisterInfo(X86TargetMachine &tm,
- const TargetInstrInfo &tii)
- : X86GenRegisterInfo(X86::ADJCALLSTACKDOWN, X86::ADJCALLSTACKUP),
- TM(tm), TII(tii) {
- // Cache some information.
- const X86Subtarget *Subtarget = &TM.getSubtarget<X86Subtarget>();
- Is64Bit = Subtarget->is64Bit();
- IsWin64 = Subtarget->isTargetWin64();
- StackAlign = TM.getFrameInfo()->getStackAlignment();
- if (Is64Bit) {
- SlotSize = 8;
- StackPtr = X86::RSP;
- FramePtr = X86::RBP;
- } else {
- SlotSize = 4;
- StackPtr = X86::ESP;
- FramePtr = X86::EBP;
- }
-}
-
-// getDwarfRegNum - This function maps LLVM register identifiers to the
-// Dwarf specific numbering, used in debug info and exception tables.
-
-int X86RegisterInfo::getDwarfRegNum(unsigned RegNo, bool isEH) const {
- const X86Subtarget *Subtarget = &TM.getSubtarget<X86Subtarget>();
- unsigned Flavour = DWARFFlavour::X86_64;
- if (!Subtarget->is64Bit()) {
- if (Subtarget->isTargetDarwin()) {
- if (isEH)
- Flavour = DWARFFlavour::X86_32_DarwinEH;
- else
- Flavour = DWARFFlavour::X86_32_Generic;
- } else if (Subtarget->isTargetCygMing()) {
- // Unsupported by now, just quick fallback
- Flavour = DWARFFlavour::X86_32_Generic;
- } else {
- Flavour = DWARFFlavour::X86_32_Generic;
- }
- }
-
- return X86GenRegisterInfo::getDwarfRegNumFull(RegNo, Flavour);
-}
-
-// getX86RegNum - This function maps LLVM register identifiers to their X86
-// specific numbering, which is used in various places encoding instructions.
-//
-unsigned X86RegisterInfo::getX86RegNum(unsigned RegNo) {
- switch(RegNo) {
- case X86::RAX: case X86::EAX: case X86::AX: case X86::AL: return N86::EAX;
- case X86::RCX: case X86::ECX: case X86::CX: case X86::CL: return N86::ECX;
- case X86::RDX: case X86::EDX: case X86::DX: case X86::DL: return N86::EDX;
- case X86::RBX: case X86::EBX: case X86::BX: case X86::BL: return N86::EBX;
- case X86::RSP: case X86::ESP: case X86::SP: case X86::SPL: case X86::AH:
- return N86::ESP;
- case X86::RBP: case X86::EBP: case X86::BP: case X86::BPL: case X86::CH:
- return N86::EBP;
- case X86::RSI: case X86::ESI: case X86::SI: case X86::SIL: case X86::DH:
- return N86::ESI;
- case X86::RDI: case X86::EDI: case X86::DI: case X86::DIL: case X86::BH:
- return N86::EDI;
-
- case X86::R8: case X86::R8D: case X86::R8W: case X86::R8B:
- return N86::EAX;
- case X86::R9: case X86::R9D: case X86::R9W: case X86::R9B:
- return N86::ECX;
- case X86::R10: case X86::R10D: case X86::R10W: case X86::R10B:
- return N86::EDX;
- case X86::R11: case X86::R11D: case X86::R11W: case X86::R11B:
- return N86::EBX;
- case X86::R12: case X86::R12D: case X86::R12W: case X86::R12B:
- return N86::ESP;
- case X86::R13: case X86::R13D: case X86::R13W: case X86::R13B:
- return N86::EBP;
- case X86::R14: case X86::R14D: case X86::R14W: case X86::R14B:
- return N86::ESI;
- case X86::R15: case X86::R15D: case X86::R15W: case X86::R15B:
- return N86::EDI;
-
- case X86::ST0: case X86::ST1: case X86::ST2: case X86::ST3:
- case X86::ST4: case X86::ST5: case X86::ST6: case X86::ST7:
- return RegNo-X86::ST0;
-
- case X86::XMM0: case X86::XMM8: case X86::MM0:
- return 0;
- case X86::XMM1: case X86::XMM9: case X86::MM1:
- return 1;
- case X86::XMM2: case X86::XMM10: case X86::MM2:
- return 2;
- case X86::XMM3: case X86::XMM11: case X86::MM3:
- return 3;
- case X86::XMM4: case X86::XMM12: case X86::MM4:
- return 4;
- case X86::XMM5: case X86::XMM13: case X86::MM5:
- return 5;
- case X86::XMM6: case X86::XMM14: case X86::MM6:
- return 6;
- case X86::XMM7: case X86::XMM15: case X86::MM7:
- return 7;
-
- default:
- assert(isVirtualRegister(RegNo) && "Unknown physical register!");
- assert(0 && "Register allocator hasn't allocated reg correctly yet!");
- return 0;
- }
-}
-
-const TargetRegisterClass *
-X86RegisterInfo::getCrossCopyRegClass(const TargetRegisterClass *RC) const {
- if (RC == &X86::CCRRegClass) {
- if (Is64Bit)
- return &X86::GR64RegClass;
- else
- return &X86::GR32RegClass;
- }
- return NULL;
-}
-
-const unsigned *
-X86RegisterInfo::getCalleeSavedRegs(const MachineFunction *MF) const {
- static const unsigned CalleeSavedRegs32Bit[] = {
- X86::ESI, X86::EDI, X86::EBX, X86::EBP, 0
- };
-
- static const unsigned CalleeSavedRegs32EHRet[] = {
- X86::EAX, X86::EDX, X86::ESI, X86::EDI, X86::EBX, X86::EBP, 0
- };
-
- static const unsigned CalleeSavedRegs64Bit[] = {
- X86::RBX, X86::R12, X86::R13, X86::R14, X86::R15, X86::RBP, 0
- };
-
- static const unsigned CalleeSavedRegsWin64[] = {
- X86::RBX, X86::RBP, X86::RDI, X86::RSI,
- X86::R12, X86::R13, X86::R14, X86::R15, 0
- };
-
- if (Is64Bit) {
- if (IsWin64)
- return CalleeSavedRegsWin64;
- else
- return CalleeSavedRegs64Bit;
- } else {
- if (MF) {
- MachineFrameInfo *MFI = MF->getFrameInfo();
- MachineModuleInfo *MMI = MFI->getMachineModuleInfo();
- if (MMI && MMI->callsEHReturn())
- return CalleeSavedRegs32EHRet;
- }
- return CalleeSavedRegs32Bit;
- }
-}
-
-const TargetRegisterClass* const*
-X86RegisterInfo::getCalleeSavedRegClasses(const MachineFunction *MF) const {
- static const TargetRegisterClass * const CalleeSavedRegClasses32Bit[] = {
- &X86::GR32RegClass, &X86::GR32RegClass,
- &X86::GR32RegClass, &X86::GR32RegClass, 0
- };
- static const TargetRegisterClass * const CalleeSavedRegClasses32EHRet[] = {
- &X86::GR32RegClass, &X86::GR32RegClass,
- &X86::GR32RegClass, &X86::GR32RegClass,
- &X86::GR32RegClass, &X86::GR32RegClass, 0
- };
- static const TargetRegisterClass * const CalleeSavedRegClasses64Bit[] = {
- &X86::GR64RegClass, &X86::GR64RegClass,
- &X86::GR64RegClass, &X86::GR64RegClass,
- &X86::GR64RegClass, &X86::GR64RegClass, 0
- };
- static const TargetRegisterClass * const CalleeSavedRegClassesWin64[] = {
- &X86::GR64RegClass, &X86::GR64RegClass,
- &X86::GR64RegClass, &X86::GR64RegClass,
- &X86::GR64RegClass, &X86::GR64RegClass,
- &X86::GR64RegClass, &X86::GR64RegClass, 0
- };
-
- if (Is64Bit) {
- if (IsWin64)
- return CalleeSavedRegClassesWin64;
- else
- return CalleeSavedRegClasses64Bit;
- } else {
- if (MF) {
- MachineFrameInfo *MFI = MF->getFrameInfo();
- MachineModuleInfo *MMI = MFI->getMachineModuleInfo();
- if (MMI && MMI->callsEHReturn())
- return CalleeSavedRegClasses32EHRet;
- }
- return CalleeSavedRegClasses32Bit;
- }
-
-}
-
-BitVector X86RegisterInfo::getReservedRegs(const MachineFunction &MF) const {
- BitVector Reserved(getNumRegs());
- Reserved.set(X86::RSP);
- Reserved.set(X86::ESP);
- Reserved.set(X86::SP);
- Reserved.set(X86::SPL);
- if (hasFP(MF)) {
- Reserved.set(X86::RBP);
- Reserved.set(X86::EBP);
- Reserved.set(X86::BP);
- Reserved.set(X86::BPL);
- }
- return Reserved;
-}
-
-//===----------------------------------------------------------------------===//
-// Stack Frame Processing methods
-//===----------------------------------------------------------------------===//
-
-static unsigned calculateMaxStackAlignment(const MachineFrameInfo *FFI) {
- unsigned MaxAlign = 0;
- for (int i = FFI->getObjectIndexBegin(),
- e = FFI->getObjectIndexEnd(); i != e; ++i) {
- if (FFI->isDeadObjectIndex(i))
- continue;
- unsigned Align = FFI->getObjectAlignment(i);
- MaxAlign = std::max(MaxAlign, Align);
- }
-
- return MaxAlign;
-}
-
-// hasFP - Return true if the specified function should have a dedicated frame
-// pointer register. This is true if the function has variable sized allocas or
-// if frame pointer elimination is disabled.
-//
-bool X86RegisterInfo::hasFP(const MachineFunction &MF) const {
- MachineFrameInfo *MFI = MF.getFrameInfo();
- MachineModuleInfo *MMI = MFI->getMachineModuleInfo();
-
- return (NoFramePointerElim ||
- needsStackRealignment(MF) ||
- MFI->hasVarSizedObjects() ||
- MF.getInfo<X86MachineFunctionInfo>()->getForceFramePointer() ||
- (MMI && MMI->callsUnwindInit()));
-}
-
-bool X86RegisterInfo::needsStackRealignment(const MachineFunction &MF) const {
- MachineFrameInfo *MFI = MF.getFrameInfo();;
-
- // FIXME: Currently we don't support stack realignment for functions with
- // variable-sized allocas
- return (RealignStack &&
- (MFI->getMaxAlignment() > StackAlign &&
- !MFI->hasVarSizedObjects()));
-}
-
-bool X86RegisterInfo::hasReservedCallFrame(MachineFunction &MF) const {
- return !MF.getFrameInfo()->hasVarSizedObjects();
-}
-
-int
-X86RegisterInfo::getFrameIndexOffset(MachineFunction &MF, int FI) const {
- int Offset = MF.getFrameInfo()->getObjectOffset(FI) + SlotSize;
- uint64_t StackSize = MF.getFrameInfo()->getStackSize();
-
- if (needsStackRealignment(MF)) {
- if (FI < 0)
- // Skip the saved EBP
- Offset += SlotSize;
- else {
- unsigned MaxAlign = MF.getFrameInfo()->getMaxAlignment();
- uint64_t FrameSize =
- (StackSize - SlotSize + MaxAlign - 1)/MaxAlign*MaxAlign;
-
- return Offset + FrameSize - SlotSize;
- }
-
- // FIXME: Support tail calls
- } else {
- if (!hasFP(MF))
- return Offset + StackSize;
-
- // Skip the saved EBP
- Offset += SlotSize;
-
- // Skip the RETADDR move area
- X86MachineFunctionInfo *X86FI = MF.getInfo<X86MachineFunctionInfo>();
- int TailCallReturnAddrDelta = X86FI->getTCReturnAddrDelta();
- if (TailCallReturnAddrDelta < 0) Offset -= TailCallReturnAddrDelta;
- }
-
- return Offset;
-}
-
-void X86RegisterInfo::
-eliminateCallFramePseudoInstr(MachineFunction &MF, MachineBasicBlock &MBB,
- MachineBasicBlock::iterator I) const {
- if (!hasReservedCallFrame(MF)) {
- // If the stack pointer can be changed after prologue, turn the
- // adjcallstackup instruction into a 'sub ESP, <amt>' and the
- // adjcallstackdown instruction into 'add ESP, <amt>'
- // TODO: consider using push / pop instead of sub + store / add
- MachineInstr *Old = I;
- uint64_t Amount = Old->getOperand(0).getImm();
- if (Amount != 0) {
- // We need to keep the stack aligned properly. To do this, we round the
- // amount of space needed for the outgoing arguments up to the next
- // alignment boundary.
- Amount = (Amount+StackAlign-1)/StackAlign*StackAlign;
-
- MachineInstr *New = 0;
- if (Old->getOpcode() == X86::ADJCALLSTACKDOWN) {
- New=BuildMI(TII.get(Is64Bit ? X86::SUB64ri32 : X86::SUB32ri), StackPtr)
- .addReg(StackPtr).addImm(Amount);
- } else {
- assert(Old->getOpcode() == X86::ADJCALLSTACKUP);
- // factor out the amount the callee already popped.
- uint64_t CalleeAmt = Old->getOperand(1).getImm();
- Amount -= CalleeAmt;
- if (Amount) {
- unsigned Opc = (Amount < 128) ?
- (Is64Bit ? X86::ADD64ri8 : X86::ADD32ri8) :
- (Is64Bit ? X86::ADD64ri32 : X86::ADD32ri);
- New = BuildMI(TII.get(Opc), StackPtr).addReg(StackPtr).addImm(Amount);
- }
- }
-
- // Replace the pseudo instruction with a new instruction...
- if (New) MBB.insert(I, New);
- }
- } else if (I->getOpcode() == X86::ADJCALLSTACKUP) {
- // If we are performing frame pointer elimination and if the callee pops
- // something off the stack pointer, add it back. We do this until we have
- // more advanced stack pointer tracking ability.
- if (uint64_t CalleeAmt = I->getOperand(1).getImm()) {
- unsigned Opc = (CalleeAmt < 128) ?
- (Is64Bit ? X86::SUB64ri8 : X86::SUB32ri8) :
- (Is64Bit ? X86::SUB64ri32 : X86::SUB32ri);
- MachineInstr *New =
- BuildMI(TII.get(Opc), StackPtr).addReg(StackPtr).addImm(CalleeAmt);
- MBB.insert(I, New);
- }
- }
-
- MBB.erase(I);
-}
-
-void X86RegisterInfo::eliminateFrameIndex(MachineBasicBlock::iterator II,
- int SPAdj, RegScavenger *RS) const{
- assert(SPAdj == 0 && "Unexpected");
-
- unsigned i = 0;
- MachineInstr &MI = *II;
- MachineFunction &MF = *MI.getParent()->getParent();
- while (!MI.getOperand(i).isFrameIndex()) {
- ++i;
- assert(i < MI.getNumOperands() && "Instr doesn't have FrameIndex operand!");
- }
-
- int FrameIndex = MI.getOperand(i).getIndex();
-
- unsigned BasePtr;
- if (needsStackRealignment(MF))
- BasePtr = (FrameIndex < 0 ? FramePtr : StackPtr);
- else
- BasePtr = (hasFP(MF) ? FramePtr : StackPtr);
-
- // This must be part of a four operand memory reference. Replace the
- // FrameIndex with base register with EBP. Add an offset to the offset.
- MI.getOperand(i).ChangeToRegister(BasePtr, false);
-
- // Now add the frame object offset to the offset from EBP.
- int64_t Offset = getFrameIndexOffset(MF, FrameIndex) +
- MI.getOperand(i+3).getImm();
-
- MI.getOperand(i+3).ChangeToImmediate(Offset);
-}
-
-void
-X86RegisterInfo::processFunctionBeforeCalleeSavedScan(MachineFunction &MF,
- RegScavenger *RS) const {
- MachineFrameInfo *FFI = MF.getFrameInfo();
-
- // Calculate and set max stack object alignment early, so we can decide
- // whether we will need stack realignment (and thus FP).
- unsigned MaxAlign = std::max(FFI->getMaxAlignment(),
- calculateMaxStackAlignment(FFI));
-
- FFI->setMaxAlignment(MaxAlign);
-}
-
-void
-X86RegisterInfo::processFunctionBeforeFrameFinalized(MachineFunction &MF) const{
- X86MachineFunctionInfo *X86FI = MF.getInfo<X86MachineFunctionInfo>();
- int32_t TailCallReturnAddrDelta = X86FI->getTCReturnAddrDelta();
- if (TailCallReturnAddrDelta < 0) {
- // create RETURNADDR area
- // arg
- // arg
- // RETADDR
- // { ...
- // RETADDR area
- // ...
- // }
- // [EBP]
- MF.getFrameInfo()->
- CreateFixedObject(-TailCallReturnAddrDelta,
- (-1*SlotSize)+TailCallReturnAddrDelta);
- }
- if (hasFP(MF)) {
- assert((TailCallReturnAddrDelta <= 0) &&
- "The Delta should always be zero or negative");
- // Create a frame entry for the EBP register that must be saved.
- int FrameIdx = MF.getFrameInfo()->CreateFixedObject(SlotSize,
- (int)SlotSize * -2+
- TailCallReturnAddrDelta);
- assert(FrameIdx == MF.getFrameInfo()->getObjectIndexBegin() &&
- "Slot for EBP register must be last in order to be found!");
- }
-}
-
-/// emitSPUpdate - Emit a series of instructions to increment / decrement the
-/// stack pointer by a constant value.
-static
-void emitSPUpdate(MachineBasicBlock &MBB, MachineBasicBlock::iterator &MBBI,
- unsigned StackPtr, int64_t NumBytes, bool Is64Bit,
- const TargetInstrInfo &TII) {
- bool isSub = NumBytes < 0;
- uint64_t Offset = isSub ? -NumBytes : NumBytes;
- unsigned Opc = isSub
- ? ((Offset < 128) ?
- (Is64Bit ? X86::SUB64ri8 : X86::SUB32ri8) :
- (Is64Bit ? X86::SUB64ri32 : X86::SUB32ri))
- : ((Offset < 128) ?
- (Is64Bit ? X86::ADD64ri8 : X86::ADD32ri8) :
- (Is64Bit ? X86::ADD64ri32 : X86::ADD32ri));
- uint64_t Chunk = (1LL << 31) - 1;
-
- while (Offset) {
- uint64_t ThisVal = (Offset > Chunk) ? Chunk : Offset;
- BuildMI(MBB, MBBI, TII.get(Opc), StackPtr).addReg(StackPtr).addImm(ThisVal);
- Offset -= ThisVal;
- }
-}
-
-// mergeSPUpdatesUp - Merge two stack-manipulating instructions upper iterator.
-static
-void mergeSPUpdatesUp(MachineBasicBlock &MBB, MachineBasicBlock::iterator &MBBI,
- unsigned StackPtr, uint64_t *NumBytes = NULL) {
- if (MBBI == MBB.begin()) return;
-
- MachineBasicBlock::iterator PI = prior(MBBI);
- unsigned Opc = PI->getOpcode();
- if ((Opc == X86::ADD64ri32 || Opc == X86::ADD64ri8 ||
- Opc == X86::ADD32ri || Opc == X86::ADD32ri8) &&
- PI->getOperand(0).getReg() == StackPtr) {
- if (NumBytes)
- *NumBytes += PI->getOperand(2).getImm();
- MBB.erase(PI);
- } else if ((Opc == X86::SUB64ri32 || Opc == X86::SUB64ri8 ||
- Opc == X86::SUB32ri || Opc == X86::SUB32ri8) &&
- PI->getOperand(0).getReg() == StackPtr) {
- if (NumBytes)
- *NumBytes -= PI->getOperand(2).getImm();
- MBB.erase(PI);
- }
-}
-
-// mergeSPUpdatesUp - Merge two stack-manipulating instructions lower iterator.
-static
-void mergeSPUpdatesDown(MachineBasicBlock &MBB,
- MachineBasicBlock::iterator &MBBI,
- unsigned StackPtr, uint64_t *NumBytes = NULL) {
- return;
-
- if (MBBI == MBB.end()) return;
-
- MachineBasicBlock::iterator NI = next(MBBI);
- if (NI == MBB.end()) return;
-
- unsigned Opc = NI->getOpcode();
- if ((Opc == X86::ADD64ri32 || Opc == X86::ADD64ri8 ||
- Opc == X86::ADD32ri || Opc == X86::ADD32ri8) &&
- NI->getOperand(0).getReg() == StackPtr) {
- if (NumBytes)
- *NumBytes -= NI->getOperand(2).getImm();
- MBB.erase(NI);
- MBBI = NI;
- } else if ((Opc == X86::SUB64ri32 || Opc == X86::SUB64ri8 ||
- Opc == X86::SUB32ri || Opc == X86::SUB32ri8) &&
- NI->getOperand(0).getReg() == StackPtr) {
- if (NumBytes)
- *NumBytes += NI->getOperand(2).getImm();
- MBB.erase(NI);
- MBBI = NI;
- }
-}
-
-/// mergeSPUpdates - Checks the instruction before/after the passed
-/// instruction. If it is an ADD/SUB instruction it is deleted
-/// argument and the stack adjustment is returned as a positive value for ADD
-/// and a negative for SUB.
-static int mergeSPUpdates(MachineBasicBlock &MBB,
- MachineBasicBlock::iterator &MBBI,
- unsigned StackPtr,
- bool doMergeWithPrevious) {
-
- if ((doMergeWithPrevious && MBBI == MBB.begin()) ||
- (!doMergeWithPrevious && MBBI == MBB.end()))
- return 0;
-
- int Offset = 0;
-
- MachineBasicBlock::iterator PI = doMergeWithPrevious ? prior(MBBI) : MBBI;
- MachineBasicBlock::iterator NI = doMergeWithPrevious ? 0 : next(MBBI);
- unsigned Opc = PI->getOpcode();
- if ((Opc == X86::ADD64ri32 || Opc == X86::ADD64ri8 ||
- Opc == X86::ADD32ri || Opc == X86::ADD32ri8) &&
- PI->getOperand(0).getReg() == StackPtr){
- Offset += PI->getOperand(2).getImm();
- MBB.erase(PI);
- if (!doMergeWithPrevious) MBBI = NI;
- } else if ((Opc == X86::SUB64ri32 || Opc == X86::SUB64ri8 ||
- Opc == X86::SUB32ri || Opc == X86::SUB32ri8) &&
- PI->getOperand(0).getReg() == StackPtr) {
- Offset -= PI->getOperand(2).getImm();
- MBB.erase(PI);
- if (!doMergeWithPrevious) MBBI = NI;
- }
-
- return Offset;
-}
-
-void X86RegisterInfo::emitFrameMoves(MachineFunction &MF,
- unsigned FrameLabelId,
- unsigned ReadyLabelId) const {
- MachineFrameInfo *MFI = MF.getFrameInfo();
- MachineModuleInfo *MMI = MFI->getMachineModuleInfo();
- if (!MMI)
- return;
-
- uint64_t StackSize = MFI->getStackSize();
- std::vector<MachineMove> &Moves = MMI->getFrameMoves();
- const TargetData *TD = MF.getTarget().getTargetData();
-
- // Calculate amount of bytes used for return address storing
- int stackGrowth =
- (MF.getTarget().getFrameInfo()->getStackGrowthDirection() ==
- TargetFrameInfo::StackGrowsUp ?
- TD->getPointerSize() : -TD->getPointerSize());
-
- if (StackSize) {
- // Show update of SP.
- if (hasFP(MF)) {
- // Adjust SP
- MachineLocation SPDst(MachineLocation::VirtualFP);
- MachineLocation SPSrc(MachineLocation::VirtualFP, 2*stackGrowth);
- Moves.push_back(MachineMove(FrameLabelId, SPDst, SPSrc));
- } else {
- MachineLocation SPDst(MachineLocation::VirtualFP);
- MachineLocation SPSrc(MachineLocation::VirtualFP,
- -StackSize+stackGrowth);
- Moves.push_back(MachineMove(FrameLabelId, SPDst, SPSrc));
- }
- } else {
- //FIXME: Verify & implement for FP
- MachineLocation SPDst(StackPtr);
- MachineLocation SPSrc(StackPtr, stackGrowth);
- Moves.push_back(MachineMove(FrameLabelId, SPDst, SPSrc));
- }
-
- // Add callee saved registers to move list.
- const std::vector<CalleeSavedInfo> &CSI = MFI->getCalleeSavedInfo();
-
- // FIXME: This is dirty hack. The code itself is pretty mess right now.
- // It should be rewritten from scratch and generalized sometimes.
-
- // Determine maximum offset (minumum due to stack growth)
- int64_t MaxOffset = 0;
- for (unsigned I = 0, E = CSI.size(); I!=E; ++I)
- MaxOffset = std::min(MaxOffset,
- MFI->getObjectOffset(CSI[I].getFrameIdx()));
-
- // Calculate offsets
- int64_t saveAreaOffset = (hasFP(MF) ? 3 : 2)*stackGrowth;
- for (unsigned I = 0, E = CSI.size(); I!=E; ++I) {
- int64_t Offset = MFI->getObjectOffset(CSI[I].getFrameIdx());
- unsigned Reg = CSI[I].getReg();
- Offset = (MaxOffset-Offset+saveAreaOffset);
- MachineLocation CSDst(MachineLocation::VirtualFP, Offset);
- MachineLocation CSSrc(Reg);
- Moves.push_back(MachineMove(FrameLabelId, CSDst, CSSrc));
- }
-
- if (hasFP(MF)) {
- // Save FP
- MachineLocation FPDst(MachineLocation::VirtualFP, 2*stackGrowth);
- MachineLocation FPSrc(FramePtr);
- Moves.push_back(MachineMove(ReadyLabelId, FPDst, FPSrc));
- }
-
- MachineLocation FPDst(hasFP(MF) ? FramePtr : StackPtr);
- MachineLocation FPSrc(MachineLocation::VirtualFP);
- Moves.push_back(MachineMove(ReadyLabelId, FPDst, FPSrc));
-}
-
-
-void X86RegisterInfo::emitPrologue(MachineFunction &MF) const {
- MachineBasicBlock &MBB = MF.front(); // Prolog goes in entry BB
- MachineFrameInfo *MFI = MF.getFrameInfo();
- const Function* Fn = MF.getFunction();
- const X86Subtarget* Subtarget = &MF.getTarget().getSubtarget<X86Subtarget>();
- MachineModuleInfo *MMI = MFI->getMachineModuleInfo();
- X86MachineFunctionInfo *X86FI = MF.getInfo<X86MachineFunctionInfo>();
- MachineBasicBlock::iterator MBBI = MBB.begin();
- bool needsFrameMoves = (MMI && MMI->hasDebugInfo()) ||
- !Fn->doesNotThrow() ||
- UnwindTablesMandatory;
- // Prepare for frame info.
- unsigned FrameLabelId = 0;
-
- // Get the number of bytes to allocate from the FrameInfo.
- uint64_t StackSize = MFI->getStackSize();
- // Get desired stack alignment
- uint64_t MaxAlign = MFI->getMaxAlignment();
-
- // Add RETADDR move area to callee saved frame size.
- int TailCallReturnAddrDelta = X86FI->getTCReturnAddrDelta();
- if (TailCallReturnAddrDelta < 0)
- X86FI->setCalleeSavedFrameSize(
- X86FI->getCalleeSavedFrameSize() +(-TailCallReturnAddrDelta));
-
- // Insert stack pointer adjustment for later moving of return addr. Only
- // applies to tail call optimized functions where the callee argument stack
- // size is bigger than the callers.
- if (TailCallReturnAddrDelta < 0) {
- BuildMI(MBB, MBBI, TII.get(Is64Bit? X86::SUB64ri32 : X86::SUB32ri),
- StackPtr).addReg(StackPtr).addImm(-TailCallReturnAddrDelta);
- }
-
- uint64_t NumBytes = 0;
- if (hasFP(MF)) {
- // Calculate required stack adjustment
- uint64_t FrameSize = StackSize - SlotSize;
- if (needsStackRealignment(MF))
- FrameSize = (FrameSize + MaxAlign - 1)/MaxAlign*MaxAlign;
-
- NumBytes = FrameSize - X86FI->getCalleeSavedFrameSize();
-
- // Get the offset of the stack slot for the EBP register... which is
- // guaranteed to be the last slot by processFunctionBeforeFrameFinalized.
- // Update the frame offset adjustment.
- MFI->setOffsetAdjustment(-NumBytes);
-
- // Save EBP into the appropriate stack slot...
- BuildMI(MBB, MBBI, TII.get(Is64Bit ? X86::PUSH64r : X86::PUSH32r))
- .addReg(FramePtr);
-
- if (needsFrameMoves) {
- // Mark effective beginning of when frame pointer becomes valid.
- FrameLabelId = MMI->NextLabelID();
- BuildMI(MBB, MBBI, TII.get(X86::LABEL)).addImm(FrameLabelId).addImm(0);
- }
-
- // Update EBP with the new base value...
- BuildMI(MBB, MBBI, TII.get(Is64Bit ? X86::MOV64rr : X86::MOV32rr), FramePtr)
- .addReg(StackPtr);
-
- // Realign stack
- if (needsStackRealignment(MF))
- BuildMI(MBB, MBBI,
- TII.get(Is64Bit ? X86::AND64ri32 : X86::AND32ri),
- StackPtr).addReg(StackPtr).addImm(-MaxAlign);
- } else
- NumBytes = StackSize - X86FI->getCalleeSavedFrameSize();
-
- unsigned ReadyLabelId = 0;
- if (needsFrameMoves) {
- // Mark effective beginning of when frame pointer is ready.
- ReadyLabelId = MMI->NextLabelID();
- BuildMI(MBB, MBBI, TII.get(X86::LABEL)).addImm(ReadyLabelId).addImm(0);
- }
-
- // Skip the callee-saved push instructions.
- while (MBBI != MBB.end() &&
- (MBBI->getOpcode() == X86::PUSH32r ||
- MBBI->getOpcode() == X86::PUSH64r))
- ++MBBI;
-
- if (NumBytes) { // adjust stack pointer: ESP -= numbytes
- if (NumBytes >= 4096 && Subtarget->isTargetCygMing()) {
- // Check, whether EAX is livein for this function
- bool isEAXAlive = false;
- for (MachineRegisterInfo::livein_iterator
- II = MF.getRegInfo().livein_begin(),
- EE = MF.getRegInfo().livein_end(); (II != EE) && !isEAXAlive; ++II) {
- unsigned Reg = II->first;
- isEAXAlive = (Reg == X86::EAX || Reg == X86::AX ||
- Reg == X86::AH || Reg == X86::AL);
- }
-
- // Function prologue calls _alloca to probe the stack when allocating
- // more than 4k bytes in one go. Touching the stack at 4K increments is
- // necessary to ensure that the guard pages used by the OS virtual memory
- // manager are allocated in correct sequence.
- if (!isEAXAlive) {
- BuildMI(MBB, MBBI, TII.get(X86::MOV32ri), X86::EAX).addImm(NumBytes);
- BuildMI(MBB, MBBI, TII.get(X86::CALLpcrel32))
- .addExternalSymbol("_alloca");
- } else {
- // Save EAX
- BuildMI(MBB, MBBI, TII.get(X86::PUSH32r), X86::EAX);
- // Allocate NumBytes-4 bytes on stack. We'll also use 4 already
- // allocated bytes for EAX.
- BuildMI(MBB, MBBI, TII.get(X86::MOV32ri), X86::EAX).addImm(NumBytes-4);
- BuildMI(MBB, MBBI, TII.get(X86::CALLpcrel32))
- .addExternalSymbol("_alloca");
- // Restore EAX
- MachineInstr *MI = addRegOffset(BuildMI(TII.get(X86::MOV32rm),X86::EAX),
- StackPtr, NumBytes-4);
- MBB.insert(MBBI, MI);
- }
- } else {
- // If there is an SUB32ri of ESP immediately before this instruction,
- // merge the two. This can be the case when tail call elimination is
- // enabled and the callee has more arguments then the caller.
- NumBytes -= mergeSPUpdates(MBB, MBBI, StackPtr, true);
- // If there is an ADD32ri or SUB32ri of ESP immediately after this
- // instruction, merge the two instructions.
- mergeSPUpdatesDown(MBB, MBBI, StackPtr, &NumBytes);
-
- if (NumBytes)
- emitSPUpdate(MBB, MBBI, StackPtr, -(int64_t)NumBytes, Is64Bit, TII);
- }
- }
-
- if (needsFrameMoves)
- emitFrameMoves(MF, FrameLabelId, ReadyLabelId);
-}
-
-void X86RegisterInfo::emitEpilogue(MachineFunction &MF,
- MachineBasicBlock &MBB) const {
- const MachineFrameInfo *MFI = MF.getFrameInfo();
- X86MachineFunctionInfo *X86FI = MF.getInfo<X86MachineFunctionInfo>();
- MachineBasicBlock::iterator MBBI = prior(MBB.end());
- unsigned RetOpcode = MBBI->getOpcode();
-
- switch (RetOpcode) {
- case X86::RET:
- case X86::RETI:
- case X86::TCRETURNdi:
- case X86::TCRETURNri:
- case X86::TCRETURNri64:
- case X86::TCRETURNdi64:
- case X86::EH_RETURN:
- case X86::TAILJMPd:
- case X86::TAILJMPr:
- case X86::TAILJMPm: break; // These are ok
- default:
- assert(0 && "Can only insert epilog into returning blocks");
- }
-
- // Get the number of bytes to allocate from the FrameInfo
- uint64_t StackSize = MFI->getStackSize();
- uint64_t MaxAlign = MFI->getMaxAlignment();
- unsigned CSSize = X86FI->getCalleeSavedFrameSize();
- uint64_t NumBytes = 0;
-
- if (hasFP(MF)) {
- // Calculate required stack adjustment
- uint64_t FrameSize = StackSize - SlotSize;
- if (needsStackRealignment(MF))
- FrameSize = (FrameSize + MaxAlign - 1)/MaxAlign*MaxAlign;
-
- NumBytes = FrameSize - CSSize;
-
- // pop EBP.
- BuildMI(MBB, MBBI, TII.get(Is64Bit ? X86::POP64r : X86::POP32r), FramePtr);
- } else
- NumBytes = StackSize - CSSize;
-
- // Skip the callee-saved pop instructions.
- MachineBasicBlock::iterator LastCSPop = MBBI;
- while (MBBI != MBB.begin()) {
- MachineBasicBlock::iterator PI = prior(MBBI);
- unsigned Opc = PI->getOpcode();
- if (Opc != X86::POP32r && Opc != X86::POP64r &&
- !PI->getDesc().isTerminator())
- break;
- --MBBI;
- }
-
- // If there is an ADD32ri or SUB32ri of ESP immediately before this
- // instruction, merge the two instructions.
- if (NumBytes || MFI->hasVarSizedObjects())
- mergeSPUpdatesUp(MBB, MBBI, StackPtr, &NumBytes);
-
- // If dynamic alloca is used, then reset esp to point to the last callee-saved
- // slot before popping them off! Same applies for the case, when stack was
- // realigned
- if (needsStackRealignment(MF)) {
- // We cannot use LEA here, because stack pointer was realigned. We need to
- // deallocate local frame back
- if (CSSize) {
- emitSPUpdate(MBB, MBBI, StackPtr, NumBytes, Is64Bit, TII);
- MBBI = prior(LastCSPop);
- }
-
- BuildMI(MBB, MBBI,
- TII.get(Is64Bit ? X86::MOV64rr : X86::MOV32rr),
- StackPtr).addReg(FramePtr);
- } else if (MFI->hasVarSizedObjects()) {
- if (CSSize) {
- unsigned Opc = Is64Bit ? X86::LEA64r : X86::LEA32r;
- MachineInstr *MI = addRegOffset(BuildMI(TII.get(Opc), StackPtr),
- FramePtr, -CSSize);
- MBB.insert(MBBI, MI);
- } else
- BuildMI(MBB, MBBI, TII.get(Is64Bit ? X86::MOV64rr : X86::MOV32rr),StackPtr).
- addReg(FramePtr);
-
- } else {
- // adjust stack pointer back: ESP += numbytes
- if (NumBytes)
- emitSPUpdate(MBB, MBBI, StackPtr, NumBytes, Is64Bit, TII);
- }
-
- // We're returning from function via eh_return.
- if (RetOpcode == X86::EH_RETURN) {
- MBBI = prior(MBB.end());
- MachineOperand &DestAddr = MBBI->getOperand(0);
- assert(DestAddr.isRegister() && "Offset should be in register!");
- BuildMI(MBB, MBBI, TII.get(Is64Bit ? X86::MOV64rr : X86::MOV32rr),StackPtr).
- addReg(DestAddr.getReg());
- // Tail call return: adjust the stack pointer and jump to callee
- } else if (RetOpcode == X86::TCRETURNri || RetOpcode == X86::TCRETURNdi ||
- RetOpcode== X86::TCRETURNri64 || RetOpcode == X86::TCRETURNdi64) {
- MBBI = prior(MBB.end());
- MachineOperand &JumpTarget = MBBI->getOperand(0);
- MachineOperand &StackAdjust = MBBI->getOperand(1);
- assert( StackAdjust.isImmediate() && "Expecting immediate value.");
-
- // Adjust stack pointer.
- int StackAdj = StackAdjust.getImm();
- int MaxTCDelta = X86FI->getTCReturnAddrDelta();
- int Offset = 0;
- assert(MaxTCDelta <= 0 && "MaxTCDelta should never be positive");
- // Incoporate the retaddr area.
- Offset = StackAdj-MaxTCDelta;
- assert(Offset >= 0 && "Offset should never be negative");
- if (Offset) {
- // Check for possible merge with preceeding ADD instruction.
- Offset += mergeSPUpdates(MBB, MBBI, StackPtr, true);
- emitSPUpdate(MBB, MBBI, StackPtr, Offset, Is64Bit, TII);
- }
- // Jump to label or value in register.
- if (RetOpcode == X86::TCRETURNdi|| RetOpcode == X86::TCRETURNdi64)
- BuildMI(MBB, MBBI, TII.get(X86::TAILJMPd)).
- addGlobalAddress(JumpTarget.getGlobal(), JumpTarget.getOffset());
- else if (RetOpcode== X86::TCRETURNri64) {
- BuildMI(MBB, MBBI, TII.get(X86::TAILJMPr64), JumpTarget.getReg());
- } else
- BuildMI(MBB, MBBI, TII.get(X86::TAILJMPr), JumpTarget.getReg());
- // Delete the pseudo instruction TCRETURN.
- MBB.erase(MBBI);
- } else if ((RetOpcode == X86::RET || RetOpcode == X86::RETI) &&
- (X86FI->getTCReturnAddrDelta() < 0)) {
- // Add the return addr area delta back since we are not tail calling.
- int delta = -1*X86FI->getTCReturnAddrDelta();
- MBBI = prior(MBB.end());
- // Check for possible merge with preceeding ADD instruction.
- delta += mergeSPUpdates(MBB, MBBI, StackPtr, true);
- emitSPUpdate(MBB, MBBI, StackPtr, delta, Is64Bit, TII);
- }
-}
-
-unsigned X86RegisterInfo::getRARegister() const {
- if (Is64Bit)
- return X86::RIP; // Should have dwarf #16
- else
- return X86::EIP; // Should have dwarf #8
-}
-
-unsigned X86RegisterInfo::getFrameRegister(MachineFunction &MF) const {
- return hasFP(MF) ? FramePtr : StackPtr;
-}
-
-void X86RegisterInfo::getInitialFrameState(std::vector<MachineMove> &Moves)
- const {
- // Calculate amount of bytes used for return address storing
- int stackGrowth = (Is64Bit ? -8 : -4);
-
- // Initial state of the frame pointer is esp+4.
- MachineLocation Dst(MachineLocation::VirtualFP);
- MachineLocation Src(StackPtr, stackGrowth);
- Moves.push_back(MachineMove(0, Dst, Src));
-
- // Add return address to move list
- MachineLocation CSDst(StackPtr, stackGrowth);
- MachineLocation CSSrc(getRARegister());
- Moves.push_back(MachineMove(0, CSDst, CSSrc));
-}
-
-unsigned X86RegisterInfo::getEHExceptionRegister() const {
- assert(0 && "What is the exception register");
- return 0;
-}
-
-unsigned X86RegisterInfo::getEHHandlerRegister() const {
- assert(0 && "What is the exception handler register");
- return 0;
-}
-
-namespace llvm {
-unsigned getX86SubSuperRegister(unsigned Reg, MVT::ValueType VT, bool High) {
- switch (VT) {
- default: return Reg;
- case MVT::i8:
- if (High) {
- switch (Reg) {
- default: return 0;
- case X86::AH: case X86::AL: case X86::AX: case X86::EAX: case X86::RAX:
- return X86::AH;
- case X86::DH: case X86::DL: case X86::DX: case X86::EDX: case X86::RDX:
- return X86::DH;
- case X86::CH: case X86::CL: case X86::CX: case X86::ECX: case X86::RCX:
- return X86::CH;
- case X86::BH: case X86::BL: case X86::BX: case X86::EBX: case X86::RBX:
- return X86::BH;
- }
- } else {
- switch (Reg) {
- default: return 0;
- case X86::AH: case X86::AL: case X86::AX: case X86::EAX: case X86::RAX:
- return X86::AL;
- case X86::DH: case X86::DL: case X86::DX: case X86::EDX: case X86::RDX:
- return X86::DL;
- case X86::CH: case X86::CL: case X86::CX: case X86::ECX: case X86::RCX:
- return X86::CL;
- case X86::BH: case X86::BL: case X86::BX: case X86::EBX: case X86::RBX:
- return X86::BL;
- case X86::SIL: case X86::SI: case X86::ESI: case X86::RSI:
- return X86::SIL;
- case X86::DIL: case X86::DI: case X86::EDI: case X86::RDI:
- return X86::DIL;
- case X86::BPL: case X86::BP: case X86::EBP: case X86::RBP:
- return X86::BPL;
- case X86::SPL: case X86::SP: case X86::ESP: case X86::RSP:
- return X86::SPL;
- case X86::R8B: case X86::R8W: case X86::R8D: case X86::R8:
- return X86::R8B;
- case X86::R9B: case X86::R9W: case X86::R9D: case X86::R9:
- return X86::R9B;
- case X86::R10B: case X86::R10W: case X86::R10D: case X86::R10:
- return X86::R10B;
- case X86::R11B: case X86::R11W: case X86::R11D: case X86::R11:
- return X86::R11B;
- case X86::R12B: case X86::R12W: case X86::R12D: case X86::R12:
- return X86::R12B;
- case X86::R13B: case X86::R13W: case X86::R13D: case X86::R13:
- return X86::R13B;
- case X86::R14B: case X86::R14W: case X86::R14D: case X86::R14:
- return X86::R14B;
- case X86::R15B: case X86::R15W: case X86::R15D: case X86::R15:
- return X86::R15B;
- }
- }
- case MVT::i16:
- switch (Reg) {
- default: return Reg;
- case X86::AH: case X86::AL: case X86::AX: case X86::EAX: case X86::RAX:
- return X86::AX;
- case X86::DH: case X86::DL: case X86::DX: case X86::EDX: case X86::RDX:
- return X86::DX;
- case X86::CH: case X86::CL: case X86::CX: case X86::ECX: case X86::RCX:
- return X86::CX;
- case X86::BH: case X86::BL: case X86::BX: case X86::EBX: case X86::RBX:
- return X86::BX;
- case X86::SIL: case X86::SI: case X86::ESI: case X86::RSI:
- return X86::SI;
- case X86::DIL: case X86::DI: case X86::EDI: case X86::RDI:
- return X86::DI;
- case X86::BPL: case X86::BP: case X86::EBP: case X86::RBP:
- return X86::BP;
- case X86::SPL: case X86::SP: case X86::ESP: case X86::RSP:
- return X86::SP;
- case X86::R8B: case X86::R8W: case X86::R8D: case X86::R8:
- return X86::R8W;
- case X86::R9B: case X86::R9W: case X86::R9D: case X86::R9:
- return X86::R9W;
- case X86::R10B: case X86::R10W: case X86::R10D: case X86::R10:
- return X86::R10W;
- case X86::R11B: case X86::R11W: case X86::R11D: case X86::R11:
- return X86::R11W;
- case X86::R12B: case X86::R12W: case X86::R12D: case X86::R12:
- return X86::R12W;
- case X86::R13B: case X86::R13W: case X86::R13D: case X86::R13:
- return X86::R13W;
- case X86::R14B: case X86::R14W: case X86::R14D: case X86::R14:
- return X86::R14W;
- case X86::R15B: case X86::R15W: case X86::R15D: case X86::R15:
- return X86::R15W;
- }
- case MVT::i32:
- switch (Reg) {
- default: return Reg;
- case X86::AH: case X86::AL: case X86::AX: case X86::EAX: case X86::RAX:
- return X86::EAX;
- case X86::DH: case X86::DL: case X86::DX: case X86::EDX: case X86::RDX:
- return X86::EDX;
- case X86::CH: case X86::CL: case X86::CX: case X86::ECX: case X86::RCX:
- return X86::ECX;
- case X86::BH: case X86::BL: case X86::BX: case X86::EBX: case X86::RBX:
- return X86::EBX;
- case X86::SIL: case X86::SI: case X86::ESI: case X86::RSI:
- return X86::ESI;
- case X86::DIL: case X86::DI: case X86::EDI: case X86::RDI:
- return X86::EDI;
- case X86::BPL: case X86::BP: case X86::EBP: case X86::RBP:
- return X86::EBP;
- case X86::SPL: case X86::SP: case X86::ESP: case X86::RSP:
- return X86::ESP;
- case X86::R8B: case X86::R8W: case X86::R8D: case X86::R8:
- return X86::R8D;
- case X86::R9B: case X86::R9W: case X86::R9D: case X86::R9:
- return X86::R9D;
- case X86::R10B: case X86::R10W: case X86::R10D: case X86::R10:
- return X86::R10D;
- case X86::R11B: case X86::R11W: case X86::R11D: case X86::R11:
- return X86::R11D;
- case X86::R12B: case X86::R12W: case X86::R12D: case X86::R12:
- return X86::R12D;
- case X86::R13B: case X86::R13W: case X86::R13D: case X86::R13:
- return X86::R13D;
- case X86::R14B: case X86::R14W: case X86::R14D: case X86::R14:
- return X86::R14D;
- case X86::R15B: case X86::R15W: case X86::R15D: case X86::R15:
- return X86::R15D;
- }
- case MVT::i64:
- switch (Reg) {
- default: return Reg;
- case X86::AH: case X86::AL: case X86::AX: case X86::EAX: case X86::RAX:
- return X86::RAX;
- case X86::DH: case X86::DL: case X86::DX: case X86::EDX: case X86::RDX:
- return X86::RDX;
- case X86::CH: case X86::CL: case X86::CX: case X86::ECX: case X86::RCX:
- return X86::RCX;
- case X86::BH: case X86::BL: case X86::BX: case X86::EBX: case X86::RBX:
- return X86::RBX;
- case X86::SIL: case X86::SI: case X86::ESI: case X86::RSI:
- return X86::RSI;
- case X86::DIL: case X86::DI: case X86::EDI: case X86::RDI:
- return X86::RDI;
- case X86::BPL: case X86::BP: case X86::EBP: case X86::RBP:
- return X86::RBP;
- case X86::SPL: case X86::SP: case X86::ESP: case X86::RSP:
- return X86::RSP;
- case X86::R8B: case X86::R8W: case X86::R8D: case X86::R8:
- return X86::R8;
- case X86::R9B: case X86::R9W: case X86::R9D: case X86::R9:
- return X86::R9;
- case X86::R10B: case X86::R10W: case X86::R10D: case X86::R10:
- return X86::R10;
- case X86::R11B: case X86::R11W: case X86::R11D: case X86::R11:
- return X86::R11;
- case X86::R12B: case X86::R12W: case X86::R12D: case X86::R12:
- return X86::R12;
- case X86::R13B: case X86::R13W: case X86::R13D: case X86::R13:
- return X86::R13;
- case X86::R14B: case X86::R14W: case X86::R14D: case X86::R14:
- return X86::R14;
- case X86::R15B: case X86::R15W: case X86::R15D: case X86::R15:
- return X86::R15;
- }
- }
-
- return Reg;
-}
-}
-
-#include "X86GenRegisterInfo.inc"
-
-namespace {
- struct VISIBILITY_HIDDEN MSAC : public MachineFunctionPass {
- static char ID;
- MSAC() : MachineFunctionPass((intptr_t)&ID) {}
-
- virtual bool runOnMachineFunction(MachineFunction &MF) {
- MachineFrameInfo *FFI = MF.getFrameInfo();
- MachineRegisterInfo &RI = MF.getRegInfo();
-
- // Calculate max stack alignment of all already allocated stack objects.
- unsigned MaxAlign = calculateMaxStackAlignment(FFI);
-
- // Be over-conservative: scan over all vreg defs and find, whether vector
- // registers are used. If yes - there is probability, that vector register
- // will be spilled and thus stack needs to be aligned properly.
- for (unsigned RegNum = TargetRegisterInfo::FirstVirtualRegister;
- RegNum < RI.getLastVirtReg(); ++RegNum)
- MaxAlign = std::max(MaxAlign, RI.getRegClass(RegNum)->getAlignment());
-
- FFI->setMaxAlignment(MaxAlign);
-
- return false;
- }
-
- virtual const char *getPassName() const {
- return "X86 Maximal Stack Alignment Calculator";
- }
- };
-
- char MSAC::ID = 0;
-}
-
-FunctionPass*
-llvm::createX86MaxStackAlignmentCalculatorPass() { return new MSAC(); }
diff --git a/release_23/lib/Target/X86/X86RegisterInfo.h b/release_23/lib/Target/X86/X86RegisterInfo.h
deleted file mode 100644
index 40fdfb00e3e9..000000000000
--- a/release_23/lib/Target/X86/X86RegisterInfo.h
+++ /dev/null
@@ -1,157 +0,0 @@
-//===- X86RegisterInfo.h - X86 Register Information Impl --------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains the X86 implementation of the TargetRegisterInfo class.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef X86REGISTERINFO_H
-#define X86REGISTERINFO_H
-
-#include "llvm/ADT/DenseMap.h"
-#include "llvm/ADT/SmallVector.h"
-#include "llvm/Target/TargetRegisterInfo.h"
-#include "X86GenRegisterInfo.h.inc"
-
-namespace llvm {
- class Type;
- class TargetInstrInfo;
- class X86TargetMachine;
-
-/// N86 namespace - Native X86 register numbers
-///
-namespace N86 {
- enum {
- EAX = 0, ECX = 1, EDX = 2, EBX = 3, ESP = 4, EBP = 5, ESI = 6, EDI = 7
- };
-}
-
-namespace X86 {
- /// SubregIndex - The index of various sized subregister classes. Note that
- /// these indices must be kept in sync with the class indices in the
- /// X86RegisterInfo.td file.
- enum SubregIndex {
- SUBREG_8BIT = 1, SUBREG_16BIT = 2, SUBREG_32BIT = 3
- };
-}
-
-/// DWARFFlavour - Flavour of dwarf regnumbers
-///
-namespace DWARFFlavour {
- enum {
- X86_64 = 0, X86_32_DarwinEH = 1, X86_32_Generic = 2
- };
-}
-
-class X86RegisterInfo : public X86GenRegisterInfo {
-public:
- X86TargetMachine &TM;
- const TargetInstrInfo &TII;
-
-private:
- /// Is64Bit - Is the target 64-bits.
- ///
- bool Is64Bit;
-
- /// IsWin64 - Is the target on of win64 flavours
- ///
- bool IsWin64;
-
- /// SlotSize - Stack slot size in bytes.
- ///
- unsigned SlotSize;
-
- /// StackAlign - Default stack alignment.
- ///
- unsigned StackAlign;
-
- /// StackPtr - X86 physical register used as stack ptr.
- ///
- unsigned StackPtr;
-
- /// FramePtr - X86 physical register used as frame ptr.
- ///
- unsigned FramePtr;
-
-public:
- X86RegisterInfo(X86TargetMachine &tm, const TargetInstrInfo &tii);
-
- /// getX86RegNum - Returns the native X86 register number for the given LLVM
- /// register identifier.
- static unsigned getX86RegNum(unsigned RegNo);
-
- unsigned getStackAlignment() const { return StackAlign; }
-
- /// getDwarfRegNum - allows modification of X86GenRegisterInfo::getDwarfRegNum
- /// (created by TableGen) for target dependencies.
- int getDwarfRegNum(unsigned RegNum, bool isEH) const;
-
- /// Code Generation virtual methods...
- ///
- const TargetRegisterClass *
- getCrossCopyRegClass(const TargetRegisterClass *RC) const;
-
- /// getCalleeSavedRegs - Return a null-terminated list of all of the
- /// callee-save registers on this target.
- const unsigned *getCalleeSavedRegs(const MachineFunction* MF = 0) const;
-
- /// getCalleeSavedRegClasses - Return a null-terminated list of the preferred
- /// register classes to spill each callee-saved register with. The order and
- /// length of this list match the getCalleeSavedRegs() list.
- const TargetRegisterClass* const*
- getCalleeSavedRegClasses(const MachineFunction *MF = 0) const;
-
- /// getReservedRegs - Returns a bitset indexed by physical register number
- /// indicating if a register is a special register that has particular uses and
- /// should be considered unavailable at all times, e.g. SP, RA. This is used by
- /// register scavenger to determine what registers are free.
- BitVector getReservedRegs(const MachineFunction &MF) const;
-
- bool hasFP(const MachineFunction &MF) const;
-
- bool needsStackRealignment(const MachineFunction &MF) const;
-
- bool hasReservedCallFrame(MachineFunction &MF) const;
-
- void eliminateCallFramePseudoInstr(MachineFunction &MF,
- MachineBasicBlock &MBB,
- MachineBasicBlock::iterator MI) const;
-
- void eliminateFrameIndex(MachineBasicBlock::iterator MI,
- int SPAdj, RegScavenger *RS = NULL) const;
-
- void processFunctionBeforeFrameFinalized(MachineFunction &MF) const;
- void processFunctionBeforeCalleeSavedScan(MachineFunction &MF,
- RegScavenger *RS = NULL) const;
-
- void emitPrologue(MachineFunction &MF) const;
- void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const;
-
- void emitFrameMoves(MachineFunction &MF,
- unsigned FrameLabelId, unsigned ReadyLabelId) const;
-
- // Debug information queries.
- unsigned getRARegister() const;
- unsigned getFrameRegister(MachineFunction &MF) const;
- int getFrameIndexOffset(MachineFunction &MF, int FI) const;
- void getInitialFrameState(std::vector<MachineMove> &Moves) const;
-
- // Exception handling queries.
- unsigned getEHExceptionRegister() const;
- unsigned getEHHandlerRegister() const;
-};
-
-// getX86SubSuperRegister - X86 utility function. It returns the sub or super
-// register of a specific X86 register.
-// e.g. getX86SubSuperRegister(X86::EAX, MVT::i16) return X86:AX
-unsigned getX86SubSuperRegister(unsigned, MVT::ValueType, bool High=false);
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/lib/Target/X86/X86RegisterInfo.td b/release_23/lib/Target/X86/X86RegisterInfo.td
deleted file mode 100644
index b713c892ba1a..000000000000
--- a/release_23/lib/Target/X86/X86RegisterInfo.td
+++ /dev/null
@@ -1,537 +0,0 @@
-//===- X86RegisterInfo.td - Describe the X86 Register File --*- tablegen -*-==//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file describes the X86 Register file, defining the registers themselves,
-// aliases between the registers, and the register classes built out of the
-// registers.
-//
-//===----------------------------------------------------------------------===//
-
-//===----------------------------------------------------------------------===//
-// Register definitions...
-//
-let Namespace = "X86" in {
-
- // In the register alias definitions below, we define which registers alias
- // which others. We only specify which registers the small registers alias,
- // because the register file generator is smart enough to figure out that
- // AL aliases AX if we tell it that AX aliased AL (for example).
-
- // Dwarf numbering is different for 32-bit and 64-bit, and there are
- // variations by target as well. Currently the first entry is for X86-64,
- // second - for EH on X86-32/Darwin and third is 'generic' one (X86-32/Linux
- // and debug information on X86-32/Darwin)
-
- // 8-bit registers
- // Low registers
- def AL : Register<"AL">, DwarfRegNum<[0, 0, 0]>;
- def DL : Register<"DL">, DwarfRegNum<[1, 2, 2]>;
- def CL : Register<"CL">, DwarfRegNum<[2, 1, 1]>;
- def BL : Register<"BL">, DwarfRegNum<[3, 3, 3]>;
-
- // X86-64 only
- def SIL : Register<"SIL">, DwarfRegNum<[4, 6, 6]>;
- def DIL : Register<"DIL">, DwarfRegNum<[5, 7, 7]>;
- def BPL : Register<"BPL">, DwarfRegNum<[6, 4, 5]>;
- def SPL : Register<"SPL">, DwarfRegNum<[7, 5, 4]>;
- def R8B : Register<"R8B">, DwarfRegNum<[8, -2, -2]>;
- def R9B : Register<"R9B">, DwarfRegNum<[9, -2, -2]>;
- def R10B : Register<"R10B">, DwarfRegNum<[10, -2, -2]>;
- def R11B : Register<"R11B">, DwarfRegNum<[11, -2, -2]>;
- def R12B : Register<"R12B">, DwarfRegNum<[12, -2, -2]>;
- def R13B : Register<"R13B">, DwarfRegNum<[13, -2, -2]>;
- def R14B : Register<"R14B">, DwarfRegNum<[14, -2, -2]>;
- def R15B : Register<"R15B">, DwarfRegNum<[15, -2, -2]>;
-
- // High registers X86-32 only
- def AH : Register<"AH">, DwarfRegNum<[0, 0, 0]>;
- def DH : Register<"DH">, DwarfRegNum<[1, 2, 2]>;
- def CH : Register<"CH">, DwarfRegNum<[2, 1, 1]>;
- def BH : Register<"BH">, DwarfRegNum<[3, 3, 3]>;
-
- // 16-bit registers
- def AX : RegisterWithSubRegs<"AX", [AH,AL]>, DwarfRegNum<[0, 0, 0]>;
- def DX : RegisterWithSubRegs<"DX", [DH,DL]>, DwarfRegNum<[1, 2, 2]>;
- def CX : RegisterWithSubRegs<"CX", [CH,CL]>, DwarfRegNum<[2, 1, 1]>;
- def BX : RegisterWithSubRegs<"BX", [BH,BL]>, DwarfRegNum<[3, 3, 3]>;
- def SI : RegisterWithSubRegs<"SI", [SIL]>, DwarfRegNum<[4, 6, 6]>;
- def DI : RegisterWithSubRegs<"DI", [DIL]>, DwarfRegNum<[5, 7, 7]>;
- def BP : RegisterWithSubRegs<"BP", [BPL]>, DwarfRegNum<[6, 4, 5]>;
- def SP : RegisterWithSubRegs<"SP", [SPL]>, DwarfRegNum<[7, 5, 4]>;
- def IP : Register<"IP">, DwarfRegNum<[16]>;
-
- // X86-64 only
- def R8W : RegisterWithSubRegs<"R8W", [R8B]>, DwarfRegNum<[8, -2, -2]>;
- def R9W : RegisterWithSubRegs<"R9W", [R9B]>, DwarfRegNum<[9, -2, -2]>;
- def R10W : RegisterWithSubRegs<"R10W", [R10B]>, DwarfRegNum<[10, -2, -2]>;
- def R11W : RegisterWithSubRegs<"R11W", [R11B]>, DwarfRegNum<[11, -2, -2]>;
- def R12W : RegisterWithSubRegs<"R12W", [R12B]>, DwarfRegNum<[12, -2, -2]>;
- def R13W : RegisterWithSubRegs<"R13W", [R13B]>, DwarfRegNum<[13, -2, -2]>;
- def R14W : RegisterWithSubRegs<"R14W", [R14B]>, DwarfRegNum<[14, -2, -2]>;
- def R15W : RegisterWithSubRegs<"R15W", [R15B]>, DwarfRegNum<[15, -2, -2]>;
-
- // 32-bit registers
- def EAX : RegisterWithSubRegs<"EAX", [AX]>, DwarfRegNum<[0, 0, 0]>;
- def EDX : RegisterWithSubRegs<"EDX", [DX]>, DwarfRegNum<[1, 2, 2]>;
- def ECX : RegisterWithSubRegs<"ECX", [CX]>, DwarfRegNum<[2, 1, 1]>;
- def EBX : RegisterWithSubRegs<"EBX", [BX]>, DwarfRegNum<[3, 3, 3]>;
- def ESI : RegisterWithSubRegs<"ESI", [SI]>, DwarfRegNum<[4, 6, 6]>;
- def EDI : RegisterWithSubRegs<"EDI", [DI]>, DwarfRegNum<[5, 7, 7]>;
- def EBP : RegisterWithSubRegs<"EBP", [BP]>, DwarfRegNum<[6, 4, 5]>;
- def ESP : RegisterWithSubRegs<"ESP", [SP]>, DwarfRegNum<[7, 5, 4]>;
- def EIP : RegisterWithSubRegs<"EIP", [IP]>, DwarfRegNum<[16, 8, 8]>;
-
- // X86-64 only
- def R8D : RegisterWithSubRegs<"R8D", [R8W]>, DwarfRegNum<[8, -2, -2]>;
- def R9D : RegisterWithSubRegs<"R9D", [R9W]>, DwarfRegNum<[9, -2, -2]>;
- def R10D : RegisterWithSubRegs<"R10D", [R10W]>, DwarfRegNum<[10, -2, -2]>;
- def R11D : RegisterWithSubRegs<"R11D", [R11W]>, DwarfRegNum<[11, -2, -2]>;
- def R12D : RegisterWithSubRegs<"R12D", [R12W]>, DwarfRegNum<[12, -2, -2]>;
- def R13D : RegisterWithSubRegs<"R13D", [R13W]>, DwarfRegNum<[13, -2, -2]>;
- def R14D : RegisterWithSubRegs<"R14D", [R14W]>, DwarfRegNum<[14, -2, -2]>;
- def R15D : RegisterWithSubRegs<"R15D", [R15W]>, DwarfRegNum<[15, -2, -2]>;
-
- // 64-bit registers, X86-64 only
- def RAX : RegisterWithSubRegs<"RAX", [EAX]>, DwarfRegNum<[0, -2, -2]>;
- def RDX : RegisterWithSubRegs<"RDX", [EDX]>, DwarfRegNum<[1, -2, -2]>;
- def RCX : RegisterWithSubRegs<"RCX", [ECX]>, DwarfRegNum<[2, -2, -2]>;
- def RBX : RegisterWithSubRegs<"RBX", [EBX]>, DwarfRegNum<[3, -2, -2]>;
- def RSI : RegisterWithSubRegs<"RSI", [ESI]>, DwarfRegNum<[4, -2, -2]>;
- def RDI : RegisterWithSubRegs<"RDI", [EDI]>, DwarfRegNum<[5, -2, -2]>;
- def RBP : RegisterWithSubRegs<"RBP", [EBP]>, DwarfRegNum<[6, -2, -2]>;
- def RSP : RegisterWithSubRegs<"RSP", [ESP]>, DwarfRegNum<[7, -2, -2]>;
-
- def R8 : RegisterWithSubRegs<"R8", [R8D]>, DwarfRegNum<[8, -2, -2]>;
- def R9 : RegisterWithSubRegs<"R9", [R9D]>, DwarfRegNum<[9, -2, -2]>;
- def R10 : RegisterWithSubRegs<"R10", [R10D]>, DwarfRegNum<[10, -2, -2]>;
- def R11 : RegisterWithSubRegs<"R11", [R11D]>, DwarfRegNum<[11, -2, -2]>;
- def R12 : RegisterWithSubRegs<"R12", [R12D]>, DwarfRegNum<[12, -2, -2]>;
- def R13 : RegisterWithSubRegs<"R13", [R13D]>, DwarfRegNum<[13, -2, -2]>;
- def R14 : RegisterWithSubRegs<"R14", [R14D]>, DwarfRegNum<[14, -2, -2]>;
- def R15 : RegisterWithSubRegs<"R15", [R15D]>, DwarfRegNum<[15, -2, -2]>;
- def RIP : RegisterWithSubRegs<"RIP", [EIP]>, DwarfRegNum<[16, -2, -2]>;
-
- // MMX Registers. These are actually aliased to ST0 .. ST7
- def MM0 : Register<"MM0">, DwarfRegNum<[41, 29, 29]>;
- def MM1 : Register<"MM1">, DwarfRegNum<[42, 30, 30]>;
- def MM2 : Register<"MM2">, DwarfRegNum<[43, 31, 31]>;
- def MM3 : Register<"MM3">, DwarfRegNum<[44, 32, 32]>;
- def MM4 : Register<"MM4">, DwarfRegNum<[45, 33, 33]>;
- def MM5 : Register<"MM5">, DwarfRegNum<[46, 34, 34]>;
- def MM6 : Register<"MM6">, DwarfRegNum<[47, 35, 35]>;
- def MM7 : Register<"MM7">, DwarfRegNum<[48, 36, 36]>;
-
- // Pseudo Floating Point registers
- def FP0 : Register<"FP0">;
- def FP1 : Register<"FP1">;
- def FP2 : Register<"FP2">;
- def FP3 : Register<"FP3">;
- def FP4 : Register<"FP4">;
- def FP5 : Register<"FP5">;
- def FP6 : Register<"FP6">;
-
- // XMM Registers, used by the various SSE instruction set extensions
- def XMM0: Register<"XMM0">, DwarfRegNum<[17, 21, 21]>;
- def XMM1: Register<"XMM1">, DwarfRegNum<[18, 22, 22]>;
- def XMM2: Register<"XMM2">, DwarfRegNum<[19, 23, 23]>;
- def XMM3: Register<"XMM3">, DwarfRegNum<[20, 24, 24]>;
- def XMM4: Register<"XMM4">, DwarfRegNum<[21, 25, 25]>;
- def XMM5: Register<"XMM5">, DwarfRegNum<[22, 26, 26]>;
- def XMM6: Register<"XMM6">, DwarfRegNum<[23, 27, 27]>;
- def XMM7: Register<"XMM7">, DwarfRegNum<[24, 28, 28]>;
-
- // X86-64 only
- def XMM8: Register<"XMM8">, DwarfRegNum<[25, -2, -2]>;
- def XMM9: Register<"XMM9">, DwarfRegNum<[26, -2, -2]>;
- def XMM10: Register<"XMM10">, DwarfRegNum<[27, -2, -2]>;
- def XMM11: Register<"XMM11">, DwarfRegNum<[28, -2, -2]>;
- def XMM12: Register<"XMM12">, DwarfRegNum<[29, -2, -2]>;
- def XMM13: Register<"XMM13">, DwarfRegNum<[30, -2, -2]>;
- def XMM14: Register<"XMM14">, DwarfRegNum<[31, -2, -2]>;
- def XMM15: Register<"XMM15">, DwarfRegNum<[32, -2, -2]>;
-
- // Floating point stack registers
- def ST0 : Register<"ST(0)">, DwarfRegNum<[33, 12, 11]>;
- def ST1 : Register<"ST(1)">, DwarfRegNum<[34, 13, 12]>;
- def ST2 : Register<"ST(2)">, DwarfRegNum<[35, 14, 13]>;
- def ST3 : Register<"ST(3)">, DwarfRegNum<[36, 15, 14]>;
- def ST4 : Register<"ST(4)">, DwarfRegNum<[37, 16, 15]>;
- def ST5 : Register<"ST(5)">, DwarfRegNum<[38, 17, 16]>;
- def ST6 : Register<"ST(6)">, DwarfRegNum<[39, 18, 17]>;
- def ST7 : Register<"ST(7)">, DwarfRegNum<[40, 19, 18]>;
-
- // Status flags register
- def EFLAGS : Register<"EFLAGS">;
-}
-
-
-//===----------------------------------------------------------------------===//
-// Subregister Set Definitions... now that we have all of the pieces, define the
-// sub registers for each register.
-//
-
-def x86_subreg_8bit : PatLeaf<(i32 1)>;
-def x86_subreg_16bit : PatLeaf<(i32 2)>;
-def x86_subreg_32bit : PatLeaf<(i32 3)>;
-
-def : SubRegSet<1, [AX, CX, DX, BX, SP, BP, SI, DI,
- R8W, R9W, R10W, R11W, R12W, R13W, R14W, R15W],
- [AL, CL, DL, BL, SPL, BPL, SIL, DIL,
- R8B, R9B, R10B, R11B, R12B, R13B, R14B, R15B]>;
-
-// It's unclear if this subreg set is safe, given that not all registers
-// in the class have an 'H' subreg.
-// def : SubRegSet<2, [AX, CX, DX, BX],
-// [AH, CH, DH, BH]>;
-
-def : SubRegSet<1, [EAX, ECX, EDX, EBX, ESP, EBP, ESI, EDI,
- R8D, R9D, R10D, R11D, R12D, R13D, R14D, R15D],
- [AL, CL, DL, BL, SPL, BPL, SIL, DIL,
- R8B, R9B, R10B, R11B, R12B, R13B, R14B, R15B]>;
-
-def : SubRegSet<2, [EAX, ECX, EDX, EBX, ESP, EBP, ESI, EDI,
- R8D, R9D, R10D, R11D, R12D, R13D, R14D, R15D],
- [AX, CX, DX, BX, SP, BP, SI, DI,
- R8W, R9W, R10W, R11W, R12W, R13W, R14W, R15W]>;
-
-
-def : SubRegSet<1, [RAX, RCX, RDX, RBX, RSP, RBP, RSI, RDI,
- R8, R9, R10, R11, R12, R13, R14, R15],
- [AL, CL, DL, BL, SPL, BPL, SIL, DIL,
- R8B, R9B, R10B, R11B, R12B, R13B, R14B, R15B]>;
-
-def : SubRegSet<2, [RAX, RCX, RDX, RBX, RSP, RBP, RSI, RDI,
- R8, R9, R10, R11, R12, R13, R14, R15],
- [AX, CX, DX, BX, SP, BP, SI, DI,
- R8W, R9W, R10W, R11W, R12W, R13W, R14W, R15W]>;
-
-def : SubRegSet<3, [RAX, RCX, RDX, RBX, RSP, RBP, RSI, RDI,
- R8, R9, R10, R11, R12, R13, R14, R15],
- [EAX, ECX, EDX, EBX, ESP, EBP, ESI, EDI,
- R8D, R9D, R10D, R11D, R12D, R13D, R14D, R15D]>;
-
-//===----------------------------------------------------------------------===//
-// Register Class Definitions... now that we have all of the pieces, define the
-// top-level register classes. The order specified in the register list is
-// implicitly defined to be the register allocation order.
-//
-
-// List call-clobbered registers before callee-save registers. RBX, RBP, (and
-// R12, R13, R14, and R15 for X86-64) are callee-save registers.
-// In 64-mode, there are 12 additional i8 registers, SIL, DIL, BPL, SPL, and
-// R8B, ... R15B.
-// FIXME: Allow AH, CH, DH, BH in 64-mode for non-REX instructions,
-def GR8 : RegisterClass<"X86", [i8], 8,
- [AL, CL, DL, BL, AH, CH, DH, BH, SIL, DIL, BPL, SPL,
- R8B, R9B, R10B, R11B, R12B, R13B, R14B, R15B]> {
- let MethodProtos = [{
- iterator allocation_order_begin(const MachineFunction &MF) const;
- iterator allocation_order_end(const MachineFunction &MF) const;
- }];
- let MethodBodies = [{
- // Does the function dedicate RBP / EBP to being a frame ptr?
- // If so, don't allocate SPL or BPL.
- static const unsigned X86_GR8_AO_64_fp[] =
- {X86::AL, X86::CL, X86::DL, X86::SIL, X86::DIL,
- X86::R8B, X86::R9B, X86::R10B, X86::R11B,
- X86::BL, X86::R14B, X86::R15B, X86::R12B, X86::R13B};
- // If not, just don't allocate SPL.
- static const unsigned X86_GR8_AO_64[] =
- {X86::AL, X86::CL, X86::DL, X86::SIL, X86::DIL,
- X86::R8B, X86::R9B, X86::R10B, X86::R11B,
- X86::BL, X86::R14B, X86::R15B, X86::R12B, X86::R13B, X86::BPL};
- // In 32-mode, none of the 8-bit registers aliases EBP or ESP.
- static const unsigned X86_GR8_AO_32[] =
- {X86::AL, X86::CL, X86::DL, X86::AH, X86::CH, X86::DH, X86::BL, X86::BH};
-
- GR8Class::iterator
- GR8Class::allocation_order_begin(const MachineFunction &MF) const {
- const TargetMachine &TM = MF.getTarget();
- const TargetRegisterInfo *RI = TM.getRegisterInfo();
- const X86Subtarget &Subtarget = TM.getSubtarget<X86Subtarget>();
- if (!Subtarget.is64Bit())
- return X86_GR8_AO_32;
- else if (RI->hasFP(MF))
- return X86_GR8_AO_64_fp;
- else
- return X86_GR8_AO_64;
- }
-
- GR8Class::iterator
- GR8Class::allocation_order_end(const MachineFunction &MF) const {
- const TargetMachine &TM = MF.getTarget();
- const TargetRegisterInfo *RI = TM.getRegisterInfo();
- const X86Subtarget &Subtarget = TM.getSubtarget<X86Subtarget>();
- if (!Subtarget.is64Bit())
- return X86_GR8_AO_32 + (sizeof(X86_GR8_AO_32) / sizeof(unsigned));
- else if (RI->hasFP(MF))
- return X86_GR8_AO_64_fp + (sizeof(X86_GR8_AO_64_fp) / sizeof(unsigned));
- else
- return X86_GR8_AO_64 + (sizeof(X86_GR8_AO_64) / sizeof(unsigned));
- }
- }];
-}
-
-
-def GR16 : RegisterClass<"X86", [i16], 16,
- [AX, CX, DX, SI, DI, BX, BP, SP,
- R8W, R9W, R10W, R11W, R12W, R13W, R14W, R15W]> {
- let SubRegClassList = [GR8];
- let MethodProtos = [{
- iterator allocation_order_begin(const MachineFunction &MF) const;
- iterator allocation_order_end(const MachineFunction &MF) const;
- }];
- let MethodBodies = [{
- // Does the function dedicate RBP / EBP to being a frame ptr?
- // If so, don't allocate SP or BP.
- static const unsigned X86_GR16_AO_64_fp[] =
- {X86::AX, X86::CX, X86::DX, X86::SI, X86::DI,
- X86::R8W, X86::R9W, X86::R10W, X86::R11W,
- X86::BX, X86::R14W, X86::R15W, X86::R12W, X86::R13W};
- static const unsigned X86_GR16_AO_32_fp[] =
- {X86::AX, X86::CX, X86::DX, X86::SI, X86::DI, X86::BX};
- // If not, just don't allocate SPL.
- static const unsigned X86_GR16_AO_64[] =
- {X86::AX, X86::CX, X86::DX, X86::SI, X86::DI,
- X86::R8W, X86::R9W, X86::R10W, X86::R11W,
- X86::BX, X86::R14W, X86::R15W, X86::R12W, X86::R13W, X86::BP};
- static const unsigned X86_GR16_AO_32[] =
- {X86::AX, X86::CX, X86::DX, X86::SI, X86::DI, X86::BX, X86::BP};
-
- GR16Class::iterator
- GR16Class::allocation_order_begin(const MachineFunction &MF) const {
- const TargetMachine &TM = MF.getTarget();
- const TargetRegisterInfo *RI = TM.getRegisterInfo();
- const X86Subtarget &Subtarget = TM.getSubtarget<X86Subtarget>();
- if (Subtarget.is64Bit()) {
- if (RI->hasFP(MF))
- return X86_GR16_AO_64_fp;
- else
- return X86_GR16_AO_64;
- } else {
- if (RI->hasFP(MF))
- return X86_GR16_AO_32_fp;
- else
- return X86_GR16_AO_32;
- }
- }
-
- GR16Class::iterator
- GR16Class::allocation_order_end(const MachineFunction &MF) const {
- const TargetMachine &TM = MF.getTarget();
- const TargetRegisterInfo *RI = TM.getRegisterInfo();
- const X86Subtarget &Subtarget = TM.getSubtarget<X86Subtarget>();
- if (Subtarget.is64Bit()) {
- if (RI->hasFP(MF))
- return X86_GR16_AO_64_fp+(sizeof(X86_GR16_AO_64_fp)/sizeof(unsigned));
- else
- return X86_GR16_AO_64 + (sizeof(X86_GR16_AO_64) / sizeof(unsigned));
- } else {
- if (RI->hasFP(MF))
- return X86_GR16_AO_32_fp+(sizeof(X86_GR16_AO_32_fp)/sizeof(unsigned));
- else
- return X86_GR16_AO_32 + (sizeof(X86_GR16_AO_32) / sizeof(unsigned));
- }
- }
- }];
-}
-
-
-def GR32 : RegisterClass<"X86", [i32], 32,
- [EAX, ECX, EDX, ESI, EDI, EBX, EBP, ESP,
- R8D, R9D, R10D, R11D, R12D, R13D, R14D, R15D]> {
- let SubRegClassList = [GR8, GR16];
- let MethodProtos = [{
- iterator allocation_order_begin(const MachineFunction &MF) const;
- iterator allocation_order_end(const MachineFunction &MF) const;
- }];
- let MethodBodies = [{
- // Does the function dedicate RBP / EBP to being a frame ptr?
- // If so, don't allocate ESP or EBP.
- static const unsigned X86_GR32_AO_64_fp[] =
- {X86::EAX, X86::ECX, X86::EDX, X86::ESI, X86::EDI,
- X86::R8D, X86::R9D, X86::R10D, X86::R11D,
- X86::EBX, X86::R14D, X86::R15D, X86::R12D, X86::R13D};
- static const unsigned X86_GR32_AO_32_fp[] =
- {X86::EAX, X86::ECX, X86::EDX, X86::ESI, X86::EDI, X86::EBX};
- // If not, just don't allocate SPL.
- static const unsigned X86_GR32_AO_64[] =
- {X86::EAX, X86::ECX, X86::EDX, X86::ESI, X86::EDI,
- X86::R8D, X86::R9D, X86::R10D, X86::R11D,
- X86::EBX, X86::R14D, X86::R15D, X86::R12D, X86::R13D, X86::EBP};
- static const unsigned X86_GR32_AO_32[] =
- {X86::EAX, X86::ECX, X86::EDX, X86::ESI, X86::EDI, X86::EBX, X86::EBP};
-
- GR32Class::iterator
- GR32Class::allocation_order_begin(const MachineFunction &MF) const {
- const TargetMachine &TM = MF.getTarget();
- const TargetRegisterInfo *RI = TM.getRegisterInfo();
- const X86Subtarget &Subtarget = TM.getSubtarget<X86Subtarget>();
- if (Subtarget.is64Bit()) {
- if (RI->hasFP(MF))
- return X86_GR32_AO_64_fp;
- else
- return X86_GR32_AO_64;
- } else {
- if (RI->hasFP(MF))
- return X86_GR32_AO_32_fp;
- else
- return X86_GR32_AO_32;
- }
- }
-
- GR32Class::iterator
- GR32Class::allocation_order_end(const MachineFunction &MF) const {
- const TargetMachine &TM = MF.getTarget();
- const TargetRegisterInfo *RI = TM.getRegisterInfo();
- const X86Subtarget &Subtarget = TM.getSubtarget<X86Subtarget>();
- if (Subtarget.is64Bit()) {
- if (RI->hasFP(MF))
- return X86_GR32_AO_64_fp+(sizeof(X86_GR32_AO_64_fp)/sizeof(unsigned));
- else
- return X86_GR32_AO_64 + (sizeof(X86_GR32_AO_64) / sizeof(unsigned));
- } else {
- if (RI->hasFP(MF))
- return X86_GR32_AO_32_fp+(sizeof(X86_GR32_AO_32_fp)/sizeof(unsigned));
- else
- return X86_GR32_AO_32 + (sizeof(X86_GR32_AO_32) / sizeof(unsigned));
- }
- }
- }];
-}
-
-
-def GR64 : RegisterClass<"X86", [i64], 64,
- [RAX, RCX, RDX, RSI, RDI, R8, R9, R10, R11,
- RBX, R14, R15, R12, R13, RBP, RSP]> {
- let SubRegClassList = [GR8, GR16, GR32];
- let MethodProtos = [{
- iterator allocation_order_end(const MachineFunction &MF) const;
- }];
- let MethodBodies = [{
- GR64Class::iterator
- GR64Class::allocation_order_end(const MachineFunction &MF) const {
- const TargetMachine &TM = MF.getTarget();
- const TargetRegisterInfo *RI = TM.getRegisterInfo();
- const X86Subtarget &Subtarget = TM.getSubtarget<X86Subtarget>();
- if (!Subtarget.is64Bit())
- return begin(); // None of these are allocatable in 32-bit.
- if (RI->hasFP(MF)) // Does the function dedicate RBP to being a frame ptr?
- return end()-2; // If so, don't allocate RSP or RBP
- else
- return end()-1; // If not, just don't allocate RSP
- }
- }];
-}
-
-
-// GR16, GR32 subclasses which contain registers that have GR8 sub-registers.
-// These should only be used for 32-bit mode.
-def GR16_ : RegisterClass<"X86", [i16], 16, [AX, CX, DX, BX]> {
- let SubRegClassList = [GR8];
-}
-def GR32_ : RegisterClass<"X86", [i32], 32, [EAX, ECX, EDX, EBX]> {
- let SubRegClassList = [GR8, GR16];
-}
-
-// Scalar SSE2 floating point registers.
-def FR32 : RegisterClass<"X86", [f32], 32,
- [XMM0, XMM1, XMM2, XMM3, XMM4, XMM5, XMM6, XMM7,
- XMM8, XMM9, XMM10, XMM11,
- XMM12, XMM13, XMM14, XMM15]> {
- let MethodProtos = [{
- iterator allocation_order_end(const MachineFunction &MF) const;
- }];
- let MethodBodies = [{
- FR32Class::iterator
- FR32Class::allocation_order_end(const MachineFunction &MF) const {
- const TargetMachine &TM = MF.getTarget();
- const X86Subtarget &Subtarget = TM.getSubtarget<X86Subtarget>();
- if (!Subtarget.is64Bit())
- return end()-8; // Only XMM0 to XMM7 are available in 32-bit mode.
- else
- return end();
- }
- }];
-}
-
-def FR64 : RegisterClass<"X86", [f64], 64,
- [XMM0, XMM1, XMM2, XMM3, XMM4, XMM5, XMM6, XMM7,
- XMM8, XMM9, XMM10, XMM11,
- XMM12, XMM13, XMM14, XMM15]> {
- let MethodProtos = [{
- iterator allocation_order_end(const MachineFunction &MF) const;
- }];
- let MethodBodies = [{
- FR64Class::iterator
- FR64Class::allocation_order_end(const MachineFunction &MF) const {
- const TargetMachine &TM = MF.getTarget();
- const X86Subtarget &Subtarget = TM.getSubtarget<X86Subtarget>();
- if (!Subtarget.is64Bit())
- return end()-8; // Only XMM0 to XMM7 are available in 32-bit mode.
- else
- return end();
- }
- }];
-}
-
-
-// FIXME: This sets up the floating point register files as though they are f64
-// values, though they really are f80 values. This will cause us to spill
-// values as 64-bit quantities instead of 80-bit quantities, which is much much
-// faster on common hardware. In reality, this should be controlled by a
-// command line option or something.
-
-def RFP32 : RegisterClass<"X86",[f32], 32, [FP0, FP1, FP2, FP3, FP4, FP5, FP6]>;
-def RFP64 : RegisterClass<"X86",[f64], 32, [FP0, FP1, FP2, FP3, FP4, FP5, FP6]>;
-def RFP80 : RegisterClass<"X86",[f80], 32, [FP0, FP1, FP2, FP3, FP4, FP5, FP6]>;
-
-// Floating point stack registers (these are not allocatable by the
-// register allocator - the floating point stackifier is responsible
-// for transforming FPn allocations to STn registers)
-def RST : RegisterClass<"X86", [f80, f64, f32], 32,
- [ST0, ST1, ST2, ST3, ST4, ST5, ST6, ST7]> {
- let MethodProtos = [{
- iterator allocation_order_end(const MachineFunction &MF) const;
- }];
- let MethodBodies = [{
- RSTClass::iterator
- RSTClass::allocation_order_end(const MachineFunction &MF) const {
- return begin();
- }
- }];
-}
-
-// Generic vector registers: VR64 and VR128.
-def VR64 : RegisterClass<"X86", [v8i8, v4i16, v2i32, v1i64], 64,
- [MM0, MM1, MM2, MM3, MM4, MM5, MM6, MM7]>;
-def VR128 : RegisterClass<"X86", [v16i8, v8i16, v4i32, v2i64, v4f32, v2f64],128,
- [XMM0, XMM1, XMM2, XMM3, XMM4, XMM5, XMM6, XMM7,
- XMM8, XMM9, XMM10, XMM11,
- XMM12, XMM13, XMM14, XMM15]> {
- let MethodProtos = [{
- iterator allocation_order_end(const MachineFunction &MF) const;
- }];
- let MethodBodies = [{
- VR128Class::iterator
- VR128Class::allocation_order_end(const MachineFunction &MF) const {
- const TargetMachine &TM = MF.getTarget();
- const X86Subtarget &Subtarget = TM.getSubtarget<X86Subtarget>();
- if (!Subtarget.is64Bit())
- return end()-8; // Only XMM0 to XMM7 are available in 32-bit mode.
- else
- return end();
- }
- }];
-}
-
-// Status flags registers.
-def CCR : RegisterClass<"X86", [i32], 32, [EFLAGS]> {
- let CopyCost = -1; // Don't allow copying of status registers.
-}
diff --git a/release_23/lib/Target/X86/X86Relocations.h b/release_23/lib/Target/X86/X86Relocations.h
deleted file mode 100644
index 709ef865eef4..000000000000
--- a/release_23/lib/Target/X86/X86Relocations.h
+++ /dev/null
@@ -1,39 +0,0 @@
-//===- X86Relocations.h - X86 Code Relocations ------------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines the X86 target-specific relocation types.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef X86RELOCATIONS_H
-#define X86RELOCATIONS_H
-
-#include "llvm/CodeGen/MachineRelocation.h"
-
-namespace llvm {
- namespace X86 {
- enum RelocationType {
- // reloc_pcrel_word - PC relative relocation, add the relocated value to
- // the value already in memory, after we adjust it for where the PC is.
- reloc_pcrel_word = 0,
-
- // reloc_picrel_word - PIC base relative relocation, add the relocated
- // value to the value already in memory, after we adjust it for where the
- // PIC base is.
- reloc_picrel_word = 1,
-
- // reloc_absolute_word, reloc_absolute_dword - Absolute relocation, just
- // add the relocated value to the value already in memory.
- reloc_absolute_word = 2,
- reloc_absolute_dword = 3
- };
- }
-}
-
-#endif
diff --git a/release_23/lib/Target/X86/X86Subtarget.cpp b/release_23/lib/Target/X86/X86Subtarget.cpp
deleted file mode 100644
index c0040779a9ae..000000000000
--- a/release_23/lib/Target/X86/X86Subtarget.cpp
+++ /dev/null
@@ -1,331 +0,0 @@
-//===-- X86Subtarget.cpp - X86 Subtarget Information ------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the X86 specific subclass of TargetSubtarget.
-//
-//===----------------------------------------------------------------------===//
-
-#include "X86Subtarget.h"
-#include "X86GenSubtarget.inc"
-#include "llvm/Module.h"
-#include "llvm/Support/CommandLine.h"
-#include "llvm/Target/TargetMachine.h"
-#include "llvm/Target/TargetOptions.h"
-using namespace llvm;
-
-cl::opt<X86Subtarget::AsmWriterFlavorTy>
-AsmWriterFlavor("x86-asm-syntax", cl::init(X86Subtarget::Unset),
- cl::desc("Choose style of code to emit from X86 backend:"),
- cl::values(
- clEnumValN(X86Subtarget::ATT, "att", " Emit AT&T-style assembly"),
- clEnumValN(X86Subtarget::Intel, "intel", " Emit Intel-style assembly"),
- clEnumValEnd));
-
-
-/// True if accessing the GV requires an extra load. For Windows, dllimported
-/// symbols are indirect, loading the value at address GV rather then the
-/// value of GV itself. This means that the GlobalAddress must be in the base
-/// or index register of the address, not the GV offset field.
-bool X86Subtarget::GVRequiresExtraLoad(const GlobalValue* GV,
- const TargetMachine& TM,
- bool isDirectCall) const
-{
- // FIXME: PIC
- if (TM.getRelocationModel() != Reloc::Static) {
- if (isTargetDarwin()) {
- return (!isDirectCall &&
- (GV->hasWeakLinkage() || GV->hasLinkOnceLinkage() ||
- (GV->isDeclaration() && !GV->hasNotBeenReadFromBitcode())));
- } else if (isTargetELF()) {
- // Extra load is needed for all non-statics.
- return (!isDirectCall &&
- (GV->isDeclaration() || !GV->hasInternalLinkage()));
- } else if (isTargetCygMing() || isTargetWindows()) {
- return (GV->hasDLLImportLinkage());
- }
- }
-
- return false;
-}
-
-/// This function returns the name of a function which has an interface
-/// like the non-standard bzero function, if such a function exists on
-/// the current subtarget and it is considered prefereable over
-/// memset with zero passed as the second argument. Otherwise it
-/// returns null.
-const char *X86Subtarget::getBZeroEntry() const {
-
- // Darwin 10 has a __bzero entry point for this purpose.
- if (getDarwinVers() >= 10)
- return "__bzero";
-
- return 0;
-}
-
-/// GetCpuIDAndInfo - Execute the specified cpuid and return the 4 values in the
-/// specified arguments. If we can't run cpuid on the host, return true.
-bool X86::GetCpuIDAndInfo(unsigned value, unsigned *rEAX, unsigned *rEBX,
- unsigned *rECX, unsigned *rEDX) {
-#if defined(__x86_64__)
- // gcc doesn't know cpuid would clobber ebx/rbx. Preseve it manually.
- asm ("movq\t%%rbx, %%rsi\n\t"
- "cpuid\n\t"
- "xchgq\t%%rbx, %%rsi\n\t"
- : "=a" (*rEAX),
- "=S" (*rEBX),
- "=c" (*rECX),
- "=d" (*rEDX)
- : "a" (value));
- return false;
-#elif defined(i386) || defined(__i386__) || defined(__x86__) || defined(_M_IX86)
-#if defined(__GNUC__)
- asm ("movl\t%%ebx, %%esi\n\t"
- "cpuid\n\t"
- "xchgl\t%%ebx, %%esi\n\t"
- : "=a" (*rEAX),
- "=S" (*rEBX),
- "=c" (*rECX),
- "=d" (*rEDX)
- : "a" (value));
- return false;
-#elif defined(_MSC_VER)
- __asm {
- mov eax,value
- cpuid
- mov esi,rEAX
- mov dword ptr [esi],eax
- mov esi,rEBX
- mov dword ptr [esi],ebx
- mov esi,rECX
- mov dword ptr [esi],ecx
- mov esi,rEDX
- mov dword ptr [esi],edx
- }
- return false;
-#endif
-#endif
- return true;
-}
-
-void X86Subtarget::AutoDetectSubtargetFeatures() {
- unsigned EAX = 0, EBX = 0, ECX = 0, EDX = 0;
- union {
- unsigned u[3];
- char c[12];
- } text;
-
- if (X86::GetCpuIDAndInfo(0, &EAX, text.u+0, text.u+2, text.u+1))
- return;
-
- X86::GetCpuIDAndInfo(0x1, &EAX, &EBX, &ECX, &EDX);
-
- if ((EDX >> 23) & 0x1) X86SSELevel = MMX;
- if ((EDX >> 25) & 0x1) X86SSELevel = SSE1;
- if ((EDX >> 26) & 0x1) X86SSELevel = SSE2;
- if (ECX & 0x1) X86SSELevel = SSE3;
- if ((ECX >> 9) & 0x1) X86SSELevel = SSSE3;
- if ((ECX >> 19) & 0x1) X86SSELevel = SSE41;
- if ((ECX >> 20) & 0x1) X86SSELevel = SSE42;
-
- if (memcmp(text.c, "GenuineIntel", 12) == 0 ||
- memcmp(text.c, "AuthenticAMD", 12) == 0) {
- X86::GetCpuIDAndInfo(0x80000001, &EAX, &EBX, &ECX, &EDX);
- HasX86_64 = (EDX >> 29) & 0x1;
- }
-}
-
-static const char *GetCurrentX86CPU() {
- unsigned EAX = 0, EBX = 0, ECX = 0, EDX = 0;
- if (X86::GetCpuIDAndInfo(0x1, &EAX, &EBX, &ECX, &EDX))
- return "generic";
- unsigned Family = (EAX >> 8) & 0xf; // Bits 8 - 11
- unsigned Model = (EAX >> 4) & 0xf; // Bits 4 - 7
- X86::GetCpuIDAndInfo(0x80000001, &EAX, &EBX, &ECX, &EDX);
- bool Em64T = (EDX >> 29) & 0x1;
-
- union {
- unsigned u[3];
- char c[12];
- } text;
-
- X86::GetCpuIDAndInfo(0, &EAX, text.u+0, text.u+2, text.u+1);
- if (memcmp(text.c, "GenuineIntel", 12) == 0) {
- switch (Family) {
- case 3:
- return "i386";
- case 4:
- return "i486";
- case 5:
- switch (Model) {
- case 4: return "pentium-mmx";
- default: return "pentium";
- }
- case 6:
- switch (Model) {
- case 1: return "pentiumpro";
- case 3:
- case 5:
- case 6: return "pentium2";
- case 7:
- case 8:
- case 10:
- case 11: return "pentium3";
- case 9:
- case 13: return "pentium-m";
- case 14: return "yonah";
- case 15: return "core2";
- default: return "i686";
- }
- case 15: {
- switch (Model) {
- case 3:
- case 4:
- return (Em64T) ? "nocona" : "prescott";
- default:
- return (Em64T) ? "x86-64" : "pentium4";
- }
- }
-
- default:
- return "generic";
- }
- } else if (memcmp(text.c, "AuthenticAMD", 12) == 0) {
- // FIXME: this poorly matches the generated SubtargetFeatureKV table. There
- // appears to be no way to generate the wide variety of AMD-specific targets
- // from the information returned from CPUID.
- switch (Family) {
- case 4:
- return "i486";
- case 5:
- switch (Model) {
- case 6:
- case 7: return "k6";
- case 8: return "k6-2";
- case 9:
- case 13: return "k6-3";
- default: return "pentium";
- }
- case 6:
- switch (Model) {
- case 4: return "athlon-tbird";
- case 6:
- case 7:
- case 8: return "athlon-mp";
- case 10: return "athlon-xp";
- default: return "athlon";
- }
- case 15:
- switch (Model) {
- case 1: return "opteron";
- case 5: return "athlon-fx"; // also opteron
- default: return "athlon64";
- }
- default:
- return "generic";
- }
- } else {
- return "generic";
- }
-}
-
-X86Subtarget::X86Subtarget(const Module &M, const std::string &FS, bool is64Bit)
- : AsmFlavor(AsmWriterFlavor)
- , PICStyle(PICStyle::None)
- , X86SSELevel(NoMMXSSE)
- , X863DNowLevel(NoThreeDNow)
- , HasX86_64(false)
- , DarwinVers(0)
- , IsLinux(false)
- , stackAlignment(8)
- // FIXME: this is a known good value for Yonah. How about others?
- , MaxInlineSizeThreshold(128)
- , Is64Bit(is64Bit)
- , TargetType(isELF) { // Default to ELF unless otherwise specified.
-
- // Determine default and user specified characteristics
- if (!FS.empty()) {
- // If feature string is not empty, parse features string.
- std::string CPU = GetCurrentX86CPU();
- ParseSubtargetFeatures(FS, CPU);
- } else {
- // Otherwise, use CPUID to auto-detect feature set.
- AutoDetectSubtargetFeatures();
- }
-
- // If requesting codegen for X86-64, make sure that 64-bit and SSE2 features
- // are enabled. These are available on all x86-64 CPUs.
- if (Is64Bit) {
- HasX86_64 = true;
- if (X86SSELevel < SSE2)
- X86SSELevel = SSE2;
- }
-
- // Set the boolean corresponding to the current target triple, or the default
- // if one cannot be determined, to true.
- const std::string& TT = M.getTargetTriple();
- if (TT.length() > 5) {
- size_t Pos;
- if ((Pos = TT.find("-darwin")) != std::string::npos) {
- TargetType = isDarwin;
-
- // Compute the darwin version number.
- if (isdigit(TT[Pos+7]))
- DarwinVers = atoi(&TT[Pos+7]);
- else
- DarwinVers = 8; // Minimum supported darwin is Tiger.
- } else if (TT.find("linux") != std::string::npos) {
- // Linux doesn't imply ELF, but we don't currently support anything else.
- TargetType = isELF;
- IsLinux = true;
- } else if (TT.find("cygwin") != std::string::npos) {
- TargetType = isCygwin;
- } else if (TT.find("mingw") != std::string::npos) {
- TargetType = isMingw;
- } else if (TT.find("win32") != std::string::npos) {
- TargetType = isWindows;
- } else if (TT.find("windows") != std::string::npos) {
- TargetType = isWindows;
- }
- } else if (TT.empty()) {
-#if defined(__CYGWIN__)
- TargetType = isCygwin;
-#elif defined(__MINGW32__) || defined(__MINGW64__)
- TargetType = isMingw;
-#elif defined(__APPLE__)
- TargetType = isDarwin;
-#if __APPLE_CC__ > 5400
- DarwinVers = 9; // GCC 5400+ is Leopard.
-#else
- DarwinVers = 8; // Minimum supported darwin is Tiger.
-#endif
-
-#elif defined(_WIN32) || defined(_WIN64)
- TargetType = isWindows;
-#elif defined(__linux__)
- // Linux doesn't imply ELF, but we don't currently support anything else.
- TargetType = isELF;
- IsLinux = true;
-#endif
- }
-
- // If the asm syntax hasn't been overridden on the command line, use whatever
- // the target wants.
- if (AsmFlavor == X86Subtarget::Unset) {
- AsmFlavor = (TargetType == isWindows)
- ? X86Subtarget::Intel : X86Subtarget::ATT;
- }
-
- // Stack alignment is 16 bytes on Darwin (both 32 and 64 bit) and for all 64
- // bit targets.
- if (TargetType == isDarwin || Is64Bit)
- stackAlignment = 16;
-
- if (StackAlignment)
- stackAlignment = StackAlignment;
-}
diff --git a/release_23/lib/Target/X86/X86Subtarget.h b/release_23/lib/Target/X86/X86Subtarget.h
deleted file mode 100644
index b95a2e45e5ec..000000000000
--- a/release_23/lib/Target/X86/X86Subtarget.h
+++ /dev/null
@@ -1,199 +0,0 @@
-//=====---- X86Subtarget.h - Define Subtarget for the X86 -----*- C++ -*--====//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file declares the X86 specific subclass of TargetSubtarget.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef X86SUBTARGET_H
-#define X86SUBTARGET_H
-
-#include "llvm/Target/TargetSubtarget.h"
-
-#include <string>
-
-namespace llvm {
-class Module;
-class GlobalValue;
-class TargetMachine;
-
-namespace PICStyle {
-enum Style {
- Stub, GOT, RIPRel, WinPIC, None
-};
-}
-
-class X86Subtarget : public TargetSubtarget {
-public:
- enum AsmWriterFlavorTy {
- // Note: This numbering has to match the GCC assembler dialects for inline
- // asm alternatives to work right.
- ATT = 0, Intel = 1, Unset
- };
-protected:
- enum X86SSEEnum {
- NoMMXSSE, MMX, SSE1, SSE2, SSE3, SSSE3, SSE41, SSE42
- };
-
- enum X863DNowEnum {
- NoThreeDNow, ThreeDNow, ThreeDNowA
- };
-
- /// AsmFlavor - Which x86 asm dialect to use.
- ///
- AsmWriterFlavorTy AsmFlavor;
-
- /// PICStyle - Which PIC style to use
- ///
- PICStyle::Style PICStyle;
-
- /// X86SSELevel - MMX, SSE1, SSE2, SSE3, SSSE3, SSE41, SSE42, or
- /// none supported.
- X86SSEEnum X86SSELevel;
-
- /// X863DNowLevel - 3DNow or 3DNow Athlon, or none supported.
- ///
- X863DNowEnum X863DNowLevel;
-
- /// HasX86_64 - True if the processor supports X86-64 instructions.
- ///
- bool HasX86_64;
-
- /// DarwinVers - Nonzero if this is a darwin platform: the numeric
- /// version of the platform, e.g. 8 = 10.4 (Tiger), 9 = 10.5 (Leopard), etc.
- unsigned char DarwinVers; // Is any darwin-x86 platform.
-
- /// isLinux - true if this is a "linux" platform.
- bool IsLinux;
-
- /// stackAlignment - The minimum alignment known to hold of the stack frame on
- /// entry to the function and which must be maintained by every function.
- unsigned stackAlignment;
-
- /// Max. memset / memcpy size that is turned into rep/movs, rep/stos ops.
- ///
- unsigned MaxInlineSizeThreshold;
-
-private:
- /// Is64Bit - True if the processor supports 64-bit instructions and module
- /// pointer size is 64 bit.
- bool Is64Bit;
-
-public:
- enum {
- isELF, isCygwin, isDarwin, isWindows, isMingw
- } TargetType;
-
- /// This constructor initializes the data members to match that
- /// of the specified module.
- ///
- X86Subtarget(const Module &M, const std::string &FS, bool is64Bit);
-
- /// getStackAlignment - Returns the minimum alignment known to hold of the
- /// stack frame on entry to the function and which must be maintained by every
- /// function for this subtarget.
- unsigned getStackAlignment() const { return stackAlignment; }
-
- /// getMaxInlineSizeThreshold - Returns the maximum memset / memcpy size
- /// that still makes it profitable to inline the call.
- unsigned getMaxInlineSizeThreshold() const { return MaxInlineSizeThreshold; }
-
- /// ParseSubtargetFeatures - Parses features string setting specified
- /// subtarget options. Definition of function is auto generated by tblgen.
- void ParseSubtargetFeatures(const std::string &FS, const std::string &CPU);
-
- /// AutoDetectSubtargetFeatures - Auto-detect CPU features using CPUID
- /// instruction.
- void AutoDetectSubtargetFeatures();
-
- bool is64Bit() const { return Is64Bit; }
-
- PICStyle::Style getPICStyle() const { return PICStyle; }
- void setPICStyle(PICStyle::Style Style) { PICStyle = Style; }
-
- bool hasMMX() const { return X86SSELevel >= MMX; }
- bool hasSSE1() const { return X86SSELevel >= SSE1; }
- bool hasSSE2() const { return X86SSELevel >= SSE2; }
- bool hasSSE3() const { return X86SSELevel >= SSE3; }
- bool hasSSSE3() const { return X86SSELevel >= SSSE3; }
- bool hasSSE41() const { return X86SSELevel >= SSE41; }
- bool hasSSE42() const { return X86SSELevel >= SSE42; }
- bool has3DNow() const { return X863DNowLevel >= ThreeDNow; }
- bool has3DNowA() const { return X863DNowLevel >= ThreeDNowA; }
-
- unsigned getAsmFlavor() const {
- return AsmFlavor != Unset ? unsigned(AsmFlavor) : 0;
- }
-
- bool isFlavorAtt() const { return AsmFlavor == ATT; }
- bool isFlavorIntel() const { return AsmFlavor == Intel; }
-
- bool isTargetDarwin() const { return TargetType == isDarwin; }
- bool isTargetELF() const {
- return TargetType == isELF;
- }
- bool isTargetWindows() const { return TargetType == isWindows; }
- bool isTargetMingw() const { return TargetType == isMingw; }
- bool isTargetCygMing() const { return (TargetType == isMingw ||
- TargetType == isCygwin); }
- bool isTargetCygwin() const { return TargetType == isCygwin; }
- bool isTargetWin64() const {
- return (Is64Bit && (TargetType == isMingw || TargetType == isWindows));
- }
-
- std::string getDataLayout() const {
- const char *p;
- if (is64Bit())
- p = "e-p:64:64-s:64-f64:64:64-i64:64:64-f80:128:128";
- else {
- if (isTargetDarwin())
- p = "e-p:32:32-f64:32:64-i64:32:64-f80:128:128";
- else
- p = "e-p:32:32-f64:32:64-i64:32:64-f80:32:32";
- }
- return std::string(p);
- }
-
- bool isPICStyleSet() const { return PICStyle != PICStyle::None; }
- bool isPICStyleGOT() const { return PICStyle == PICStyle::GOT; }
- bool isPICStyleStub() const { return PICStyle == PICStyle::Stub; }
- bool isPICStyleRIPRel() const { return PICStyle == PICStyle::RIPRel; }
- bool isPICStyleWinPIC() const { return PICStyle == PICStyle:: WinPIC; }
-
- /// getDarwinVers - Return the darwin version number, 8 = tiger, 9 = leopard.
- unsigned getDarwinVers() const { return DarwinVers; }
-
- /// isLinux - Return true if the target is "Linux".
- bool isLinux() const { return IsLinux; }
-
- /// True if accessing the GV requires an extra load. For Windows, dllimported
- /// symbols are indirect, loading the value at address GV rather then the
- /// value of GV itself. This means that the GlobalAddress must be in the base
- /// or index register of the address, not the GV offset field.
- bool GVRequiresExtraLoad(const GlobalValue* GV, const TargetMachine& TM,
- bool isDirectCall) const;
-
- /// This function returns the name of a function which has an interface
- /// like the non-standard bzero function, if such a function exists on
- /// the current subtarget and it is considered prefereable over
- /// memset with zero passed as the second argument. Otherwise it
- /// returns null.
- const char *getBZeroEntry() const;
-};
-
-namespace X86 {
- /// GetCpuIDAndInfo - Execute the specified cpuid and return the 4 values in
- /// the specified arguments. If we can't run cpuid on the host, return true.
- bool GetCpuIDAndInfo(unsigned value, unsigned *rEAX, unsigned *rEBX,
- unsigned *rECX, unsigned *rEDX);
-}
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/lib/Target/X86/X86TargetAsmInfo.cpp b/release_23/lib/Target/X86/X86TargetAsmInfo.cpp
deleted file mode 100644
index 7e90cd9b3e7e..000000000000
--- a/release_23/lib/Target/X86/X86TargetAsmInfo.cpp
+++ /dev/null
@@ -1,376 +0,0 @@
-//===-- X86TargetAsmInfo.cpp - X86 asm properties ---------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains the declarations of the X86TargetAsmInfo properties.
-//
-//===----------------------------------------------------------------------===//
-
-#include "X86TargetAsmInfo.h"
-#include "X86TargetMachine.h"
-#include "X86Subtarget.h"
-#include "llvm/DerivedTypes.h"
-#include "llvm/InlineAsm.h"
-#include "llvm/Instructions.h"
-#include "llvm/Intrinsics.h"
-#include "llvm/Module.h"
-#include "llvm/ADT/StringExtras.h"
-#include "llvm/Support/Dwarf.h"
-
-using namespace llvm;
-using namespace llvm::dwarf;
-
-static const char *const x86_asm_table[] = {
- "{si}", "S",
- "{di}", "D",
- "{ax}", "a",
- "{cx}", "c",
- "{memory}", "memory",
- "{flags}", "",
- "{dirflag}", "",
- "{fpsr}", "",
- "{cc}", "cc",
- 0,0};
-
-X86TargetAsmInfo::X86TargetAsmInfo(const X86TargetMachine &TM) {
- const X86Subtarget *Subtarget = &TM.getSubtarget<X86Subtarget>();
- X86TM = &TM;
-
- // FIXME - Should be simplified.
-
- AsmTransCBE = x86_asm_table;
-
- switch (Subtarget->TargetType) {
- case X86Subtarget::isDarwin:
- AlignmentIsInBytes = false;
- TextAlignFillValue = 0x90;
- GlobalPrefix = "_";
- if (!Subtarget->is64Bit())
- Data64bitsDirective = 0; // we can't emit a 64-bit unit
- ZeroDirective = "\t.space\t"; // ".space N" emits N zeros.
- PrivateGlobalPrefix = "L"; // Marker for constant pool idxs
- BSSSection = 0; // no BSS section.
- ZeroFillDirective = "\t.zerofill\t"; // Uses .zerofill
- ConstantPoolSection = "\t.const\n";
- JumpTableDataSection = "\t.const\n";
- CStringSection = "\t.cstring";
- FourByteConstantSection = "\t.literal4\n";
- EightByteConstantSection = "\t.literal8\n";
- if (Subtarget->is64Bit())
- SixteenByteConstantSection = "\t.literal16\n";
- ReadOnlySection = "\t.const\n";
- LCOMMDirective = "\t.lcomm\t";
- SwitchToSectionDirective = "\t.section ";
- COMMDirectiveTakesAlignment = false;
- HasDotTypeDotSizeDirective = false;
- if (TM.getRelocationModel() == Reloc::Static) {
- StaticCtorsSection = ".constructor";
- StaticDtorsSection = ".destructor";
- } else {
- StaticCtorsSection = ".mod_init_func";
- StaticDtorsSection = ".mod_term_func";
- }
- if (Subtarget->is64Bit()) {
- PersonalityPrefix = "";
- PersonalitySuffix = "+4@GOTPCREL";
- } else {
- PersonalityPrefix = "L";
- PersonalitySuffix = "$non_lazy_ptr";
- }
- NeedsIndirectEncoding = true;
- InlineAsmStart = "## InlineAsm Start";
- InlineAsmEnd = "## InlineAsm End";
- CommentString = "##";
- SetDirective = "\t.set";
- PCSymbol = ".";
- UsedDirective = "\t.no_dead_strip\t";
- WeakDefDirective = "\t.weak_definition ";
- WeakRefDirective = "\t.weak_reference ";
- HiddenDirective = "\t.private_extern ";
- ProtectedDirective = "\t.globl\t";
-
- // In non-PIC modes, emit a special label before jump tables so that the
- // linker can perform more accurate dead code stripping.
- if (TM.getRelocationModel() != Reloc::PIC_) {
- // Emit a local label that is preserved until the linker runs.
- JumpTableSpecialLabelPrefix = "l";
- }
-
- SupportsDebugInformation = true;
- NeedsSet = true;
- DwarfAbbrevSection = ".section __DWARF,__debug_abbrev,regular,debug";
- DwarfInfoSection = ".section __DWARF,__debug_info,regular,debug";
- DwarfLineSection = ".section __DWARF,__debug_line,regular,debug";
- DwarfFrameSection = ".section __DWARF,__debug_frame,regular,debug";
- DwarfPubNamesSection = ".section __DWARF,__debug_pubnames,regular,debug";
- DwarfPubTypesSection = ".section __DWARF,__debug_pubtypes,regular,debug";
- DwarfStrSection = ".section __DWARF,__debug_str,regular,debug";
- DwarfLocSection = ".section __DWARF,__debug_loc,regular,debug";
- DwarfARangesSection = ".section __DWARF,__debug_aranges,regular,debug";
- DwarfRangesSection = ".section __DWARF,__debug_ranges,regular,debug";
- DwarfMacInfoSection = ".section __DWARF,__debug_macinfo,regular,debug";
-
- // Exceptions handling
- SupportsExceptionHandling = true;
- GlobalEHDirective = "\t.globl\t";
- SupportsWeakOmittedEHFrame = false;
- AbsoluteEHSectionOffsets = false;
- DwarfEHFrameSection =
- ".section __TEXT,__eh_frame,coalesced,no_toc+strip_static_syms+live_support";
- DwarfExceptionSection = ".section __DATA,__gcc_except_tab";
- break;
-
- case X86Subtarget::isELF:
- ReadOnlySection = "\t.section\t.rodata";
- FourByteConstantSection = "\t.section\t.rodata.cst4,\"aM\",@progbits,4";
- EightByteConstantSection = "\t.section\t.rodata.cst8,\"aM\",@progbits,8";
- SixteenByteConstantSection = "\t.section\t.rodata.cst16,\"aM\",@progbits,16";
- CStringSection = "\t.section\t.rodata.str1.1,\"aMS\",@progbits,1";
- PrivateGlobalPrefix = ".L";
- WeakRefDirective = "\t.weak\t";
- SetDirective = "\t.set\t";
- PCSymbol = ".";
-
- // Set up DWARF directives
- HasLEB128 = true; // Target asm supports leb128 directives (little-endian)
-
- // Debug Information
- AbsoluteDebugSectionOffsets = true;
- SupportsDebugInformation = true;
- DwarfAbbrevSection = "\t.section\t.debug_abbrev,\"\",@progbits";
- DwarfInfoSection = "\t.section\t.debug_info,\"\",@progbits";
- DwarfLineSection = "\t.section\t.debug_line,\"\",@progbits";
- DwarfFrameSection = "\t.section\t.debug_frame,\"\",@progbits";
- DwarfPubNamesSection ="\t.section\t.debug_pubnames,\"\",@progbits";
- DwarfPubTypesSection ="\t.section\t.debug_pubtypes,\"\",@progbits";
- DwarfStrSection = "\t.section\t.debug_str,\"\",@progbits";
- DwarfLocSection = "\t.section\t.debug_loc,\"\",@progbits";
- DwarfARangesSection = "\t.section\t.debug_aranges,\"\",@progbits";
- DwarfRangesSection = "\t.section\t.debug_ranges,\"\",@progbits";
- DwarfMacInfoSection = "\t.section\t.debug_macinfo,\"\",@progbits";
-
- // Exceptions handling
- if (!Subtarget->is64Bit())
- SupportsExceptionHandling = true;
- AbsoluteEHSectionOffsets = false;
- DwarfEHFrameSection = "\t.section\t.eh_frame,\"aw\",@progbits";
- DwarfExceptionSection = "\t.section\t.gcc_except_table,\"a\",@progbits";
- break;
-
- case X86Subtarget::isCygwin:
- case X86Subtarget::isMingw:
- GlobalPrefix = "_";
- LCOMMDirective = "\t.lcomm\t";
- COMMDirectiveTakesAlignment = false;
- HasDotTypeDotSizeDirective = false;
- StaticCtorsSection = "\t.section .ctors,\"aw\"";
- StaticDtorsSection = "\t.section .dtors,\"aw\"";
- HiddenDirective = NULL;
- PrivateGlobalPrefix = "L"; // Prefix for private global symbols
- WeakRefDirective = "\t.weak\t";
- SetDirective = "\t.set\t";
-
- // Set up DWARF directives
- HasLEB128 = true; // Target asm supports leb128 directives (little-endian)
- AbsoluteDebugSectionOffsets = true;
- AbsoluteEHSectionOffsets = false;
- SupportsDebugInformation = true;
- DwarfSectionOffsetDirective = "\t.secrel32\t";
- DwarfAbbrevSection = "\t.section\t.debug_abbrev,\"dr\"";
- DwarfInfoSection = "\t.section\t.debug_info,\"dr\"";
- DwarfLineSection = "\t.section\t.debug_line,\"dr\"";
- DwarfFrameSection = "\t.section\t.debug_frame,\"dr\"";
- DwarfPubNamesSection ="\t.section\t.debug_pubnames,\"dr\"";
- DwarfPubTypesSection ="\t.section\t.debug_pubtypes,\"dr\"";
- DwarfStrSection = "\t.section\t.debug_str,\"dr\"";
- DwarfLocSection = "\t.section\t.debug_loc,\"dr\"";
- DwarfARangesSection = "\t.section\t.debug_aranges,\"dr\"";
- DwarfRangesSection = "\t.section\t.debug_ranges,\"dr\"";
- DwarfMacInfoSection = "\t.section\t.debug_macinfo,\"dr\"";
- break;
-
- case X86Subtarget::isWindows:
- GlobalPrefix = "_";
- HasDotTypeDotSizeDirective = false;
- break;
-
- default: break;
- }
-
- if (Subtarget->isFlavorIntel()) {
- GlobalPrefix = "_";
- CommentString = ";";
-
- PrivateGlobalPrefix = "$";
- AlignDirective = "\talign\t";
- ZeroDirective = "\tdb\t";
- ZeroDirectiveSuffix = " dup(0)";
- AsciiDirective = "\tdb\t";
- AscizDirective = 0;
- Data8bitsDirective = "\tdb\t";
- Data16bitsDirective = "\tdw\t";
- Data32bitsDirective = "\tdd\t";
- Data64bitsDirective = "\tdq\t";
- HasDotTypeDotSizeDirective = false;
-
- TextSection = "_text";
- DataSection = "_data";
- JumpTableDataSection = NULL;
- SwitchToSectionDirective = "";
- TextSectionStartSuffix = "\tsegment 'CODE'";
- DataSectionStartSuffix = "\tsegment 'DATA'";
- SectionEndDirectiveSuffix = "\tends\n";
- }
-
- // On Linux we must declare when we can use a non-executable stack.
- if (Subtarget->isLinux())
- NonexecutableStackDirective = "\t.section\t.note.GNU-stack,\"\",@progbits";
-
- AssemblerDialect = Subtarget->getAsmFlavor();
-}
-
-bool X86TargetAsmInfo::LowerToBSwap(CallInst *CI) const {
- // FIXME: this should verify that we are targetting a 486 or better. If not,
- // we will turn this bswap into something that will be lowered to logical ops
- // instead of emitting the bswap asm. For now, we don't support 486 or lower
- // so don't worry about this.
-
- // Verify this is a simple bswap.
- if (CI->getNumOperands() != 2 ||
- CI->getType() != CI->getOperand(1)->getType() ||
- !CI->getType()->isInteger())
- return false;
-
- const IntegerType *Ty = dyn_cast<IntegerType>(CI->getType());
- if (!Ty || Ty->getBitWidth() % 16 != 0)
- return false;
-
- // Okay, we can do this xform, do so now.
- const Type *Tys[] = { Ty };
- Module *M = CI->getParent()->getParent()->getParent();
- Constant *Int = Intrinsic::getDeclaration(M, Intrinsic::bswap, Tys, 1);
-
- Value *Op = CI->getOperand(1);
- Op = CallInst::Create(Int, Op, CI->getName(), CI);
-
- CI->replaceAllUsesWith(Op);
- CI->eraseFromParent();
- return true;
-}
-
-
-bool X86TargetAsmInfo::ExpandInlineAsm(CallInst *CI) const {
- InlineAsm *IA = cast<InlineAsm>(CI->getCalledValue());
- std::vector<InlineAsm::ConstraintInfo> Constraints = IA->ParseConstraints();
-
- std::string AsmStr = IA->getAsmString();
-
- // TODO: should remove alternatives from the asmstring: "foo {a|b}" -> "foo a"
- std::vector<std::string> AsmPieces;
- SplitString(AsmStr, AsmPieces, "\n"); // ; as separator?
-
- switch (AsmPieces.size()) {
- default: return false;
- case 1:
- AsmStr = AsmPieces[0];
- AsmPieces.clear();
- SplitString(AsmStr, AsmPieces, " \t"); // Split with whitespace.
-
- // bswap $0
- if (AsmPieces.size() == 2 &&
- AsmPieces[0] == "bswap" && AsmPieces[1] == "$0") {
- // No need to check constraints, nothing other than the equivalent of
- // "=r,0" would be valid here.
- return LowerToBSwap(CI);
- }
- break;
- case 3:
- if (CI->getType() == Type::Int64Ty && Constraints.size() >= 2 &&
- Constraints[0].Codes.size() == 1 && Constraints[0].Codes[0] == "A" &&
- Constraints[1].Codes.size() == 1 && Constraints[1].Codes[0] == "0") {
- // bswap %eax / bswap %edx / xchgl %eax, %edx -> llvm.bswap.i64
- std::vector<std::string> Words;
- SplitString(AsmPieces[0], Words, " \t");
- if (Words.size() == 2 && Words[0] == "bswap" && Words[1] == "%eax") {
- Words.clear();
- SplitString(AsmPieces[1], Words, " \t");
- if (Words.size() == 2 && Words[0] == "bswap" && Words[1] == "%edx") {
- Words.clear();
- SplitString(AsmPieces[2], Words, " \t,");
- if (Words.size() == 3 && Words[0] == "xchgl" && Words[1] == "%eax" &&
- Words[2] == "%edx") {
- return LowerToBSwap(CI);
- }
- }
- }
- }
- break;
- }
- return false;
-}
-
-/// PreferredEHDataFormat - This hook allows the target to select data
-/// format used for encoding pointers in exception handling data. Reason is
-/// 0 for data, 1 for code labels, 2 for function pointers. Global is true
-/// if the symbol can be relocated.
-unsigned X86TargetAsmInfo::PreferredEHDataFormat(DwarfEncoding::Target Reason,
- bool Global) const {
- const X86Subtarget *Subtarget = &X86TM->getSubtarget<X86Subtarget>();
-
- switch (Subtarget->TargetType) {
- case X86Subtarget::isDarwin:
- if (Reason == DwarfEncoding::Functions && Global)
- return (DW_EH_PE_pcrel | DW_EH_PE_indirect | DW_EH_PE_sdata4);
- else if (Reason == DwarfEncoding::CodeLabels || !Global)
- return DW_EH_PE_pcrel;
- else
- return DW_EH_PE_absptr;
-
- case X86Subtarget::isELF:
- case X86Subtarget::isCygwin:
- case X86Subtarget::isMingw: {
- CodeModel::Model CM = X86TM->getCodeModel();
-
- if (X86TM->getRelocationModel() == Reloc::PIC_) {
- unsigned Format = 0;
-
- if (!Subtarget->is64Bit())
- // 32 bit targets always encode pointers as 4 bytes
- Format = DW_EH_PE_sdata4;
- else {
- // 64 bit targets encode pointers in 4 bytes iff:
- // - code model is small OR
- // - code model is medium and we're emitting externally visible symbols or
- // any code symbols
- if (CM == CodeModel::Small ||
- (CM == CodeModel::Medium && (Global ||
- Reason != DwarfEncoding::Data)))
- Format = DW_EH_PE_sdata4;
- else
- Format = DW_EH_PE_sdata8;
- }
-
- if (Global)
- Format |= DW_EH_PE_indirect;
-
- return (Format | DW_EH_PE_pcrel);
- } else {
- if (Subtarget->is64Bit() &&
- (CM == CodeModel::Small ||
- (CM == CodeModel::Medium && Reason != DwarfEncoding::Data)))
- return DW_EH_PE_udata4;
- else
- return DW_EH_PE_absptr;
- }
- }
-
- default:
- return TargetAsmInfo::PreferredEHDataFormat(Reason, Global);
- }
-}
-
diff --git a/release_23/lib/Target/X86/X86TargetAsmInfo.h b/release_23/lib/Target/X86/X86TargetAsmInfo.h
deleted file mode 100644
index d9dd2753571a..000000000000
--- a/release_23/lib/Target/X86/X86TargetAsmInfo.h
+++ /dev/null
@@ -1,37 +0,0 @@
-//=====-- X86TargetAsmInfo.h - X86 asm properties -------------*- C++ -*--====//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains the declaration of the X86TargetAsmInfo class.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef X86TARGETASMINFO_H
-#define X86TARGETASMINFO_H
-
-#include "llvm/Target/TargetAsmInfo.h"
-
-namespace llvm {
-
- // Forward declaration.
- class X86TargetMachine;
-
- struct X86TargetAsmInfo : public TargetAsmInfo {
- explicit X86TargetAsmInfo(const X86TargetMachine &TM);
-
- virtual bool ExpandInlineAsm(CallInst *CI) const;
- virtual unsigned PreferredEHDataFormat(DwarfEncoding::Target Reason,
- bool Global) const;
-
- private:
- const X86TargetMachine* X86TM;
- bool LowerToBSwap(CallInst *CI) const;
- };
-} // namespace llvm
-
-#endif
diff --git a/release_23/lib/Target/X86/X86TargetMachine.cpp b/release_23/lib/Target/X86/X86TargetMachine.cpp
deleted file mode 100644
index 218f356b9217..000000000000
--- a/release_23/lib/Target/X86/X86TargetMachine.cpp
+++ /dev/null
@@ -1,207 +0,0 @@
-//===-- X86TargetMachine.cpp - Define TargetMachine for the X86 -----------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines the X86 specific subclass of TargetMachine.
-//
-//===----------------------------------------------------------------------===//
-
-#include "X86TargetAsmInfo.h"
-#include "X86TargetMachine.h"
-#include "X86.h"
-#include "llvm/Module.h"
-#include "llvm/PassManager.h"
-#include "llvm/CodeGen/MachineFunction.h"
-#include "llvm/CodeGen/Passes.h"
-#include "llvm/Target/TargetOptions.h"
-#include "llvm/Target/TargetMachineRegistry.h"
-#include "llvm/Transforms/Scalar.h"
-using namespace llvm;
-
-/// X86TargetMachineModule - Note that this is used on hosts that cannot link
-/// in a library unless there are references into the library. In particular,
-/// it seems that it is not possible to get things to work on Win32 without
-/// this. Though it is unused, do not remove it.
-extern "C" int X86TargetMachineModule;
-int X86TargetMachineModule = 0;
-
-namespace {
- // Register the target.
- RegisterTarget<X86_32TargetMachine>
- X("x86", " 32-bit X86: Pentium-Pro and above");
- RegisterTarget<X86_64TargetMachine>
- Y("x86-64", " 64-bit X86: EM64T and AMD64");
-}
-
-const TargetAsmInfo *X86TargetMachine::createTargetAsmInfo() const {
- return new X86TargetAsmInfo(*this);
-}
-
-unsigned X86_32TargetMachine::getJITMatchQuality() {
-#if defined(i386) || defined(__i386__) || defined(__x86__) || defined(_M_IX86)
- return 10;
-#endif
- return 0;
-}
-
-unsigned X86_64TargetMachine::getJITMatchQuality() {
-#if defined(__x86_64__) || defined(_M_AMD64)
- return 10;
-#endif
- return 0;
-}
-
-unsigned X86_32TargetMachine::getModuleMatchQuality(const Module &M) {
- // We strongly match "i[3-9]86-*".
- std::string TT = M.getTargetTriple();
- if (TT.size() >= 5 && TT[0] == 'i' && TT[2] == '8' && TT[3] == '6' &&
- TT[4] == '-' && TT[1] - '3' < 6)
- return 20;
- // If the target triple is something non-X86, we don't match.
- if (!TT.empty()) return 0;
-
- if (M.getEndianness() == Module::LittleEndian &&
- M.getPointerSize() == Module::Pointer32)
- return 10; // Weak match
- else if (M.getEndianness() != Module::AnyEndianness ||
- M.getPointerSize() != Module::AnyPointerSize)
- return 0; // Match for some other target
-
- return getJITMatchQuality()/2;
-}
-
-unsigned X86_64TargetMachine::getModuleMatchQuality(const Module &M) {
- // We strongly match "x86_64-*".
- std::string TT = M.getTargetTriple();
- if (TT.size() >= 7 && TT[0] == 'x' && TT[1] == '8' && TT[2] == '6' &&
- TT[3] == '_' && TT[4] == '6' && TT[5] == '4' && TT[6] == '-')
- return 20;
-
- // We strongly match "amd64-*".
- if (TT.size() >= 6 && TT[0] == 'a' && TT[1] == 'm' && TT[2] == 'd' &&
- TT[3] == '6' && TT[4] == '4' && TT[5] == '-')
- return 20;
-
- // If the target triple is something non-X86-64, we don't match.
- if (!TT.empty()) return 0;
-
- if (M.getEndianness() == Module::LittleEndian &&
- M.getPointerSize() == Module::Pointer64)
- return 10; // Weak match
- else if (M.getEndianness() != Module::AnyEndianness ||
- M.getPointerSize() != Module::AnyPointerSize)
- return 0; // Match for some other target
-
- return getJITMatchQuality()/2;
-}
-
-X86_32TargetMachine::X86_32TargetMachine(const Module &M, const std::string &FS)
- : X86TargetMachine(M, FS, false) {
-}
-
-
-X86_64TargetMachine::X86_64TargetMachine(const Module &M, const std::string &FS)
- : X86TargetMachine(M, FS, true) {
-}
-
-/// X86TargetMachine ctor - Create an ILP32 architecture model
-///
-X86TargetMachine::X86TargetMachine(const Module &M, const std::string &FS,
- bool is64Bit)
- : Subtarget(M, FS, is64Bit),
- DataLayout(Subtarget.getDataLayout()),
- FrameInfo(TargetFrameInfo::StackGrowsDown,
- Subtarget.getStackAlignment(), Subtarget.is64Bit() ? -8 : -4),
- InstrInfo(*this), JITInfo(*this), TLInfo(*this) {
- DefRelocModel = getRelocationModel();
- // FIXME: Correctly select PIC model for Win64 stuff
- if (getRelocationModel() == Reloc::Default) {
- if (Subtarget.isTargetDarwin() ||
- (Subtarget.isTargetCygMing() && !Subtarget.isTargetWin64()))
- setRelocationModel(Reloc::DynamicNoPIC);
- else
- setRelocationModel(Reloc::Static);
- }
- if (Subtarget.is64Bit()) {
- // No DynamicNoPIC support under X86-64.
- if (getRelocationModel() == Reloc::DynamicNoPIC)
- setRelocationModel(Reloc::PIC_);
- // Default X86-64 code model is small.
- if (getCodeModel() == CodeModel::Default)
- setCodeModel(CodeModel::Small);
- }
-
- if (Subtarget.isTargetCygMing())
- Subtarget.setPICStyle(PICStyle::WinPIC);
- else if (Subtarget.isTargetDarwin()) {
- if (Subtarget.is64Bit())
- Subtarget.setPICStyle(PICStyle::RIPRel);
- else
- Subtarget.setPICStyle(PICStyle::Stub);
- } else if (Subtarget.isTargetELF()) {
- if (Subtarget.is64Bit())
- Subtarget.setPICStyle(PICStyle::RIPRel);
- else
- Subtarget.setPICStyle(PICStyle::GOT);
- }
-}
-
-//===----------------------------------------------------------------------===//
-// Pass Pipeline Configuration
-//===----------------------------------------------------------------------===//
-
-bool X86TargetMachine::addInstSelector(PassManagerBase &PM, bool Fast) {
- // Install an instruction selector.
- PM.add(createX86ISelDag(*this, Fast));
- return false;
-}
-
-bool X86TargetMachine::addPreRegAlloc(PassManagerBase &PM, bool Fast) {
- // Calculate and set max stack object alignment early, so we can decide
- // whether we will need stack realignment (and thus FP).
- PM.add(createX86MaxStackAlignmentCalculatorPass());
- return false; // -print-machineinstr shouldn't print after this.
-}
-
-bool X86TargetMachine::addPostRegAlloc(PassManagerBase &PM, bool Fast) {
- PM.add(createX86FloatingPointStackifierPass());
- return true; // -print-machineinstr should print after this.
-}
-
-bool X86TargetMachine::addAssemblyEmitter(PassManagerBase &PM, bool Fast,
- std::ostream &Out) {
- PM.add(createX86CodePrinterPass(Out, *this));
- return false;
-}
-
-bool X86TargetMachine::addCodeEmitter(PassManagerBase &PM, bool Fast,
- bool DumpAsm, MachineCodeEmitter &MCE) {
- // FIXME: Move this to TargetJITInfo!
- if (DefRelocModel == Reloc::Default) {
- setRelocationModel(Reloc::Static);
- Subtarget.setPICStyle(PICStyle::None);
- }
-
- // JIT cannot ensure globals are placed in the lower 4G of address.
- if (Subtarget.is64Bit())
- setCodeModel(CodeModel::Large);
-
- PM.add(createX86CodeEmitterPass(*this, MCE));
- if (DumpAsm)
- PM.add(createX86CodePrinterPass(*cerr.stream(), *this));
-
- return false;
-}
-
-bool X86TargetMachine::addSimpleCodeEmitter(PassManagerBase &PM, bool Fast,
- bool DumpAsm, MachineCodeEmitter &MCE) {
- PM.add(createX86CodeEmitterPass(*this, MCE));
- if (DumpAsm)
- PM.add(createX86CodePrinterPass(*cerr.stream(), *this));
- return false;
-}
diff --git a/release_23/lib/Target/X86/X86TargetMachine.h b/release_23/lib/Target/X86/X86TargetMachine.h
deleted file mode 100644
index 294478c3a285..000000000000
--- a/release_23/lib/Target/X86/X86TargetMachine.h
+++ /dev/null
@@ -1,97 +0,0 @@
-//===-- X86TargetMachine.h - Define TargetMachine for the X86 ---*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file declares the X86 specific subclass of TargetMachine.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef X86TARGETMACHINE_H
-#define X86TARGETMACHINE_H
-
-#include "llvm/Target/TargetMachine.h"
-#include "llvm/Target/TargetData.h"
-#include "llvm/Target/TargetFrameInfo.h"
-#include "X86.h"
-#include "X86ELFWriterInfo.h"
-#include "X86InstrInfo.h"
-#include "X86JITInfo.h"
-#include "X86Subtarget.h"
-#include "X86ISelLowering.h"
-
-namespace llvm {
-
-class X86TargetMachine : public LLVMTargetMachine {
- X86Subtarget Subtarget;
- const TargetData DataLayout; // Calculates type size & alignment
- TargetFrameInfo FrameInfo;
- X86InstrInfo InstrInfo;
- X86JITInfo JITInfo;
- X86TargetLowering TLInfo;
- X86ELFWriterInfo ELFWriterInfo;
- Reloc::Model DefRelocModel; // Reloc model before it's overridden.
-
-protected:
- virtual const TargetAsmInfo *createTargetAsmInfo() const;
-
-public:
- X86TargetMachine(const Module &M, const std::string &FS, bool is64Bit);
-
- virtual const X86InstrInfo *getInstrInfo() const { return &InstrInfo; }
- virtual const TargetFrameInfo *getFrameInfo() const { return &FrameInfo; }
- virtual TargetJITInfo *getJITInfo() { return &JITInfo; }
- virtual const TargetSubtarget *getSubtargetImpl() const{ return &Subtarget; }
- virtual X86TargetLowering *getTargetLowering() const {
- return const_cast<X86TargetLowering*>(&TLInfo);
- }
- virtual const TargetRegisterInfo *getRegisterInfo() const {
- return &InstrInfo.getRegisterInfo();
- }
- virtual const TargetData *getTargetData() const { return &DataLayout; }
- virtual const X86ELFWriterInfo *getELFWriterInfo() const {
- return Subtarget.isTargetELF() ? &ELFWriterInfo : 0;
- }
-
- static unsigned getModuleMatchQuality(const Module &M);
- static unsigned getJITMatchQuality();
-
- // Set up the pass pipeline.
- virtual bool addInstSelector(PassManagerBase &PM, bool Fast);
- virtual bool addPreRegAlloc(PassManagerBase &PM, bool Fast);
- virtual bool addPostRegAlloc(PassManagerBase &PM, bool Fast);
- virtual bool addAssemblyEmitter(PassManagerBase &PM, bool Fast,
- std::ostream &Out);
- virtual bool addCodeEmitter(PassManagerBase &PM, bool Fast,
- bool DumpAsm, MachineCodeEmitter &MCE);
- virtual bool addSimpleCodeEmitter(PassManagerBase &PM, bool Fast,
- bool DumpAsm, MachineCodeEmitter &MCE);
-};
-
-/// X86_32TargetMachine - X86 32-bit target machine.
-///
-class X86_32TargetMachine : public X86TargetMachine {
-public:
- X86_32TargetMachine(const Module &M, const std::string &FS);
-
- static unsigned getJITMatchQuality();
- static unsigned getModuleMatchQuality(const Module &M);
-};
-
-/// X86_64TargetMachine - X86 64-bit target machine.
-///
-class X86_64TargetMachine : public X86TargetMachine {
-public:
- X86_64TargetMachine(const Module &M, const std::string &FS);
-
- static unsigned getJITMatchQuality();
- static unsigned getModuleMatchQuality(const Module &M);
-};
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/lib/Transforms/Hello/Hello.cpp b/release_23/lib/Transforms/Hello/Hello.cpp
deleted file mode 100644
index 5f27e04683c5..000000000000
--- a/release_23/lib/Transforms/Hello/Hello.cpp
+++ /dev/null
@@ -1,64 +0,0 @@
-//===- Hello.cpp - Example code from "Writing an LLVM Pass" ---------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements two versions of the LLVM "Hello World" pass described
-// in docs/WritingAnLLVMPass.html
-//
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "hello"
-#include "llvm/Pass.h"
-#include "llvm/Function.h"
-#include "llvm/ADT/StringExtras.h"
-#include "llvm/Support/Streams.h"
-#include "llvm/ADT/Statistic.h"
-using namespace llvm;
-
-STATISTIC(HelloCounter, "Counts number of functions greeted");
-
-namespace {
- // Hello - The first implementation, without getAnalysisUsage.
- struct Hello : public FunctionPass {
- static char ID; // Pass identification, replacement for typeid
- Hello() : FunctionPass((intptr_t)&ID) {}
-
- virtual bool runOnFunction(Function &F) {
- HelloCounter++;
- std::string fname = F.getName();
- EscapeString(fname);
- cerr << "Hello: " << fname << "\n";
- return false;
- }
- };
-
- char Hello::ID = 0;
- RegisterPass<Hello> X("hello", "Hello World Pass");
-
- // Hello2 - The second implementation with getAnalysisUsage implemented.
- struct Hello2 : public FunctionPass {
- static char ID; // Pass identification, replacement for typeid
- Hello2() : FunctionPass((intptr_t)&ID) {}
-
- virtual bool runOnFunction(Function &F) {
- HelloCounter++;
- std::string fname = F.getName();
- EscapeString(fname);
- cerr << "Hello: " << fname << "\n";
- return false;
- }
-
- // We don't modify the program, so we preserve all analyses
- virtual void getAnalysisUsage(AnalysisUsage &AU) const {
- AU.setPreservesAll();
- };
- };
- char Hello2::ID = 0;
- RegisterPass<Hello2> Y("hello2",
- "Hello World Pass (with getAnalysisUsage implemented)");
-}
diff --git a/release_23/lib/Transforms/Hello/Makefile b/release_23/lib/Transforms/Hello/Makefile
deleted file mode 100644
index 6ca5774de420..000000000000
--- a/release_23/lib/Transforms/Hello/Makefile
+++ /dev/null
@@ -1,16 +0,0 @@
-##===- lib/Transforms/Hello/Makefile -----------------------*- Makefile -*-===##
-#
-# The LLVM Compiler Infrastructure
-#
-# This file is distributed under the University of Illinois Open Source
-# License. See LICENSE.TXT for details.
-#
-##===----------------------------------------------------------------------===##
-
-LEVEL = ../../..
-LIBRARYNAME = LLVMHello
-LOADABLE_MODULE = 1
-USEDLIBS =
-
-include $(LEVEL)/Makefile.common
-
diff --git a/release_23/lib/Transforms/IPO/ArgumentPromotion.cpp b/release_23/lib/Transforms/IPO/ArgumentPromotion.cpp
deleted file mode 100644
index c6e27b4d627a..000000000000
--- a/release_23/lib/Transforms/IPO/ArgumentPromotion.cpp
+++ /dev/null
@@ -1,710 +0,0 @@
-//===-- ArgumentPromotion.cpp - Promote by-reference arguments ------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This pass promotes "by reference" arguments to be "by value" arguments. In
-// practice, this means looking for internal functions that have pointer
-// arguments. If it can prove, through the use of alias analysis, that an
-// argument is *only* loaded, then it can pass the value into the function
-// instead of the address of the value. This can cause recursive simplification
-// of code and lead to the elimination of allocas (especially in C++ template
-// code like the STL).
-//
-// This pass also handles aggregate arguments that are passed into a function,
-// scalarizing them if the elements of the aggregate are only loaded. Note that
-// by default it refuses to scalarize aggregates which would require passing in more than
-// three operands to the function, because passing thousands of operands for a
-// large array or structure is unprofitable! This limit is can be configured or
-// disabled, however.
-//
-// Note that this transformation could also be done for arguments that are only
-// stored to (returning the value instead), but does not currently. This case
-// would be best handled when and if LLVM begins supporting multiple return
-// values from functions.
-//
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "argpromotion"
-#include "llvm/Transforms/IPO.h"
-#include "llvm/Constants.h"
-#include "llvm/DerivedTypes.h"
-#include "llvm/Module.h"
-#include "llvm/CallGraphSCCPass.h"
-#include "llvm/Instructions.h"
-#include "llvm/Analysis/AliasAnalysis.h"
-#include "llvm/Analysis/CallGraph.h"
-#include "llvm/Target/TargetData.h"
-#include "llvm/Support/CallSite.h"
-#include "llvm/Support/CFG.h"
-#include "llvm/Support/Debug.h"
-#include "llvm/ADT/DepthFirstIterator.h"
-#include "llvm/ADT/Statistic.h"
-#include "llvm/ADT/StringExtras.h"
-#include "llvm/Support/Compiler.h"
-#include <set>
-using namespace llvm;
-
-STATISTIC(NumArgumentsPromoted , "Number of pointer arguments promoted");
-STATISTIC(NumAggregatesPromoted, "Number of aggregate arguments promoted");
-STATISTIC(NumByValArgsPromoted , "Number of byval arguments promoted");
-STATISTIC(NumArgumentsDead , "Number of dead pointer args eliminated");
-
-namespace {
- /// ArgPromotion - The 'by reference' to 'by value' argument promotion pass.
- ///
- struct VISIBILITY_HIDDEN ArgPromotion : public CallGraphSCCPass {
- virtual void getAnalysisUsage(AnalysisUsage &AU) const {
- AU.addRequired<AliasAnalysis>();
- AU.addRequired<TargetData>();
- CallGraphSCCPass::getAnalysisUsage(AU);
- }
-
- virtual bool runOnSCC(const std::vector<CallGraphNode *> &SCC);
- static char ID; // Pass identification, replacement for typeid
- ArgPromotion(unsigned maxElements = 3) : CallGraphSCCPass((intptr_t)&ID), maxElements(maxElements) {}
-
- private:
- bool PromoteArguments(CallGraphNode *CGN);
- bool isSafeToPromoteArgument(Argument *Arg, bool isByVal) const;
- Function *DoPromotion(Function *F,
- SmallPtrSet<Argument*, 8> &ArgsToPromote,
- SmallPtrSet<Argument*, 8> &ByValArgsToTransform);
- /// The maximum number of elements to expand, or 0 for unlimited.
- unsigned maxElements;
- };
-
- char ArgPromotion::ID = 0;
- RegisterPass<ArgPromotion> X("argpromotion",
- "Promote 'by reference' arguments to scalars");
-}
-
-Pass *llvm::createArgumentPromotionPass(unsigned maxElements) {
- return new ArgPromotion(maxElements);
-}
-
-bool ArgPromotion::runOnSCC(const std::vector<CallGraphNode *> &SCC) {
- bool Changed = false, LocalChange;
-
- do { // Iterate until we stop promoting from this SCC.
- LocalChange = false;
- // Attempt to promote arguments from all functions in this SCC.
- for (unsigned i = 0, e = SCC.size(); i != e; ++i)
- LocalChange |= PromoteArguments(SCC[i]);
- Changed |= LocalChange; // Remember that we changed something.
- } while (LocalChange);
-
- return Changed;
-}
-
-/// PromoteArguments - This method checks the specified function to see if there
-/// are any promotable arguments and if it is safe to promote the function (for
-/// example, all callers are direct). If safe to promote some arguments, it
-/// calls the DoPromotion method.
-///
-bool ArgPromotion::PromoteArguments(CallGraphNode *CGN) {
- Function *F = CGN->getFunction();
-
- // Make sure that it is local to this module.
- if (!F || !F->hasInternalLinkage()) return false;
-
- // First check: see if there are any pointer arguments! If not, quick exit.
- SmallVector<std::pair<Argument*, unsigned>, 16> PointerArgs;
- unsigned ArgNo = 0;
- for (Function::arg_iterator I = F->arg_begin(), E = F->arg_end();
- I != E; ++I, ++ArgNo)
- if (isa<PointerType>(I->getType()))
- PointerArgs.push_back(std::pair<Argument*, unsigned>(I, ArgNo));
- if (PointerArgs.empty()) return false;
-
- // Second check: make sure that all callers are direct callers. We can't
- // transform functions that have indirect callers.
- for (Value::use_iterator UI = F->use_begin(), E = F->use_end();
- UI != E; ++UI) {
- CallSite CS = CallSite::get(*UI);
- if (!CS.getInstruction()) // "Taking the address" of the function
- return false;
-
- // Ensure that this call site is CALLING the function, not passing it as
- // an argument.
- if (UI.getOperandNo() != 0)
- return false;
- }
-
- // Check to see which arguments are promotable. If an argument is promotable,
- // add it to ArgsToPromote.
- SmallPtrSet<Argument*, 8> ArgsToPromote;
- SmallPtrSet<Argument*, 8> ByValArgsToTransform;
- for (unsigned i = 0; i != PointerArgs.size(); ++i) {
- bool isByVal = F->paramHasAttr(PointerArgs[i].second+1, ParamAttr::ByVal);
-
- // If this is a byval argument, and if the aggregate type is small, just
- // pass the elements, which is always safe.
- Argument *PtrArg = PointerArgs[i].first;
- if (isByVal) {
- const Type *AgTy = cast<PointerType>(PtrArg->getType())->getElementType();
- if (const StructType *STy = dyn_cast<StructType>(AgTy))
- if (maxElements > 0 && STy->getNumElements() > maxElements) {
- DOUT << "argpromotion disable promoting argument '"
- << PtrArg->getName() << "' because it would require adding more "
- << "than " << maxElements << " arguments to the function.\n";
- } else {
- // If all the elements are first class types, we can promote it.
- bool AllSimple = true;
- for (unsigned i = 0, e = STy->getNumElements(); i != e; ++i)
- if (!STy->getElementType(i)->isFirstClassType()) {
- AllSimple = false;
- break;
- }
-
- // Safe to transform, don't even bother trying to "promote" it.
- // Passing the elements as a scalar will allow scalarrepl to hack on
- // the new alloca we introduce.
- if (AllSimple) {
- ByValArgsToTransform.insert(PtrArg);
- continue;
- }
- }
- }
-
- // Otherwise, see if we can promote the pointer to its value.
- if (isSafeToPromoteArgument(PtrArg, isByVal))
- ArgsToPromote.insert(PtrArg);
- }
-
- // No promotable pointer arguments.
- if (ArgsToPromote.empty() && ByValArgsToTransform.empty()) return false;
-
- Function *NewF = DoPromotion(F, ArgsToPromote, ByValArgsToTransform);
-
- // Update the call graph to know that the function has been transformed.
- getAnalysis<CallGraph>().changeFunction(F, NewF);
- return true;
-}
-
-/// IsAlwaysValidPointer - Return true if the specified pointer is always legal
-/// to load.
-static bool IsAlwaysValidPointer(Value *V) {
- if (isa<AllocaInst>(V) || isa<GlobalVariable>(V)) return true;
- if (GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(V))
- return IsAlwaysValidPointer(GEP->getOperand(0));
- if (ConstantExpr *CE = dyn_cast<ConstantExpr>(V))
- if (CE->getOpcode() == Instruction::GetElementPtr)
- return IsAlwaysValidPointer(CE->getOperand(0));
-
- return false;
-}
-
-/// AllCalleesPassInValidPointerForArgument - Return true if we can prove that
-/// all callees pass in a valid pointer for the specified function argument.
-static bool AllCalleesPassInValidPointerForArgument(Argument *Arg) {
- Function *Callee = Arg->getParent();
-
- unsigned ArgNo = std::distance(Callee->arg_begin(),
- Function::arg_iterator(Arg));
-
- // Look at all call sites of the function. At this pointer we know we only
- // have direct callees.
- for (Value::use_iterator UI = Callee->use_begin(), E = Callee->use_end();
- UI != E; ++UI) {
- CallSite CS = CallSite::get(*UI);
- assert(CS.getInstruction() && "Should only have direct calls!");
-
- if (!IsAlwaysValidPointer(CS.getArgument(ArgNo)))
- return false;
- }
- return true;
-}
-
-
-/// isSafeToPromoteArgument - As you might guess from the name of this method,
-/// it checks to see if it is both safe and useful to promote the argument.
-/// This method limits promotion of aggregates to only promote up to three
-/// elements of the aggregate in order to avoid exploding the number of
-/// arguments passed in.
-bool ArgPromotion::isSafeToPromoteArgument(Argument *Arg, bool isByVal) const {
- // We can only promote this argument if all of the uses are loads, or are GEP
- // instructions (with constant indices) that are subsequently loaded.
-
- // We can also only promote the load if we can guarantee that it will happen.
- // Promoting a load causes the load to be unconditionally executed in the
- // caller, so we can't turn a conditional load into an unconditional load in
- // general.
- bool SafeToUnconditionallyLoad = false;
- if (isByVal) // ByVal arguments are always safe to load from.
- SafeToUnconditionallyLoad = true;
-
- BasicBlock *EntryBlock = Arg->getParent()->begin();
- SmallVector<LoadInst*, 16> Loads;
- std::vector<SmallVector<ConstantInt*, 8> > GEPIndices;
- for (Value::use_iterator UI = Arg->use_begin(), E = Arg->use_end();
- UI != E; ++UI)
- if (LoadInst *LI = dyn_cast<LoadInst>(*UI)) {
- if (LI->isVolatile()) return false; // Don't hack volatile loads
- Loads.push_back(LI);
-
- // If this load occurs in the entry block, then the pointer is
- // unconditionally loaded.
- SafeToUnconditionallyLoad |= LI->getParent() == EntryBlock;
- } else if (GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(*UI)) {
- if (GEP->use_empty()) {
- // Dead GEP's cause trouble later. Just remove them if we run into
- // them.
- getAnalysis<AliasAnalysis>().deleteValue(GEP);
- GEP->eraseFromParent();
- return isSafeToPromoteArgument(Arg, isByVal);
- }
- // Ensure that all of the indices are constants.
- SmallVector<ConstantInt*, 8> Operands;
- for (unsigned i = 1, e = GEP->getNumOperands(); i != e; ++i)
- if (ConstantInt *C = dyn_cast<ConstantInt>(GEP->getOperand(i)))
- Operands.push_back(C);
- else
- return false; // Not a constant operand GEP!
-
- // Ensure that the only users of the GEP are load instructions.
- for (Value::use_iterator UI = GEP->use_begin(), E = GEP->use_end();
- UI != E; ++UI)
- if (LoadInst *LI = dyn_cast<LoadInst>(*UI)) {
- if (LI->isVolatile()) return false; // Don't hack volatile loads
- Loads.push_back(LI);
-
- // If this load occurs in the entry block, then the pointer is
- // unconditionally loaded.
- SafeToUnconditionallyLoad |= LI->getParent() == EntryBlock;
- } else {
- return false;
- }
-
- // See if there is already a GEP with these indices. If not, check to
- // make sure that we aren't promoting too many elements. If so, nothing
- // to do.
- if (std::find(GEPIndices.begin(), GEPIndices.end(), Operands) ==
- GEPIndices.end()) {
- if (maxElements > 0 && GEPIndices.size() == maxElements) {
- DOUT << "argpromotion disable promoting argument '"
- << Arg->getName() << "' because it would require adding more "
- << "than " << maxElements << " arguments to the function.\n";
- // We limit aggregate promotion to only promoting up to a fixed number
- // of elements of the aggregate.
- return false;
- }
- GEPIndices.push_back(Operands);
- }
- } else {
- return false; // Not a load or a GEP.
- }
-
- if (Loads.empty()) return true; // No users, this is a dead argument.
-
- // If we decide that we want to promote this argument, the value is going to
- // be unconditionally loaded in all callees. This is only safe to do if the
- // pointer was going to be unconditionally loaded anyway (i.e. there is a load
- // of the pointer in the entry block of the function) or if we can prove that
- // all pointers passed in are always to legal locations (for example, no null
- // pointers are passed in, no pointers to free'd memory, etc).
- if (!SafeToUnconditionallyLoad &&
- !AllCalleesPassInValidPointerForArgument(Arg))
- return false; // Cannot prove that this is safe!!
-
- // Okay, now we know that the argument is only used by load instructions and
- // it is safe to unconditionally load the pointer. Use alias analysis to
- // check to see if the pointer is guaranteed to not be modified from entry of
- // the function to each of the load instructions.
-
- // Because there could be several/many load instructions, remember which
- // blocks we know to be transparent to the load.
- SmallPtrSet<BasicBlock*, 16> TranspBlocks;
-
- AliasAnalysis &AA = getAnalysis<AliasAnalysis>();
- TargetData &TD = getAnalysis<TargetData>();
-
- for (unsigned i = 0, e = Loads.size(); i != e; ++i) {
- // Check to see if the load is invalidated from the start of the block to
- // the load itself.
- LoadInst *Load = Loads[i];
- BasicBlock *BB = Load->getParent();
-
- const PointerType *LoadTy =
- cast<PointerType>(Load->getOperand(0)->getType());
- unsigned LoadSize = (unsigned)TD.getTypeStoreSize(LoadTy->getElementType());
-
- if (AA.canInstructionRangeModify(BB->front(), *Load, Arg, LoadSize))
- return false; // Pointer is invalidated!
-
- // Now check every path from the entry block to the load for transparency.
- // To do this, we perform a depth first search on the inverse CFG from the
- // loading block.
- for (pred_iterator PI = pred_begin(BB), E = pred_end(BB); PI != E; ++PI)
- for (idf_ext_iterator<BasicBlock*, SmallPtrSet<BasicBlock*, 16> >
- I = idf_ext_begin(*PI, TranspBlocks),
- E = idf_ext_end(*PI, TranspBlocks); I != E; ++I)
- if (AA.canBasicBlockModify(**I, Arg, LoadSize))
- return false;
- }
-
- // If the path from the entry of the function to each load is free of
- // instructions that potentially invalidate the load, we can make the
- // transformation!
- return true;
-}
-
-namespace {
- /// GEPIdxComparator - Provide a strong ordering for GEP indices. All Value*
- /// elements are instances of ConstantInt.
- ///
- struct GEPIdxComparator {
- bool operator()(const std::vector<Value*> &LHS,
- const std::vector<Value*> &RHS) const {
- unsigned idx = 0;
- for (; idx < LHS.size() && idx < RHS.size(); ++idx) {
- if (LHS[idx] != RHS[idx]) {
- return cast<ConstantInt>(LHS[idx])->getZExtValue() <
- cast<ConstantInt>(RHS[idx])->getZExtValue();
- }
- }
-
- // Return less than if we ran out of stuff in LHS and we didn't run out of
- // stuff in RHS.
- return idx == LHS.size() && idx != RHS.size();
- }
- };
-}
-
-
-/// DoPromotion - This method actually performs the promotion of the specified
-/// arguments, and returns the new function. At this point, we know that it's
-/// safe to do so.
-Function *ArgPromotion::DoPromotion(Function *F,
- SmallPtrSet<Argument*, 8> &ArgsToPromote,
- SmallPtrSet<Argument*, 8> &ByValArgsToTransform) {
-
- // Start by computing a new prototype for the function, which is the same as
- // the old function, but has modified arguments.
- const FunctionType *FTy = F->getFunctionType();
- std::vector<const Type*> Params;
-
- typedef std::set<std::vector<Value*>, GEPIdxComparator> ScalarizeTable;
-
- // ScalarizedElements - If we are promoting a pointer that has elements
- // accessed out of it, keep track of which elements are accessed so that we
- // can add one argument for each.
- //
- // Arguments that are directly loaded will have a zero element value here, to
- // handle cases where there are both a direct load and GEP accesses.
- //
- std::map<Argument*, ScalarizeTable> ScalarizedElements;
-
- // OriginalLoads - Keep track of a representative load instruction from the
- // original function so that we can tell the alias analysis implementation
- // what the new GEP/Load instructions we are inserting look like.
- std::map<std::vector<Value*>, LoadInst*> OriginalLoads;
-
- // ParamAttrs - Keep track of the parameter attributes for the arguments
- // that we are *not* promoting. For the ones that we do promote, the parameter
- // attributes are lost
- SmallVector<ParamAttrsWithIndex, 8> ParamAttrsVec;
- const PAListPtr &PAL = F->getParamAttrs();
-
- // Add any return attributes.
- if (ParameterAttributes attrs = PAL.getParamAttrs(0))
- ParamAttrsVec.push_back(ParamAttrsWithIndex::get(0, attrs));
-
- unsigned ArgIndex = 1;
- for (Function::arg_iterator I = F->arg_begin(), E = F->arg_end(); I != E;
- ++I, ++ArgIndex) {
- if (ByValArgsToTransform.count(I)) {
- // Just add all the struct element types.
- const Type *AgTy = cast<PointerType>(I->getType())->getElementType();
- const StructType *STy = cast<StructType>(AgTy);
- for (unsigned i = 0, e = STy->getNumElements(); i != e; ++i)
- Params.push_back(STy->getElementType(i));
- ++NumByValArgsPromoted;
- } else if (!ArgsToPromote.count(I)) {
- Params.push_back(I->getType());
- if (ParameterAttributes attrs = PAL.getParamAttrs(ArgIndex))
- ParamAttrsVec.push_back(ParamAttrsWithIndex::get(Params.size(), attrs));
- } else if (I->use_empty()) {
- ++NumArgumentsDead;
- } else {
- // Okay, this is being promoted. Check to see if there are any GEP uses
- // of the argument.
- ScalarizeTable &ArgIndices = ScalarizedElements[I];
- for (Value::use_iterator UI = I->use_begin(), E = I->use_end(); UI != E;
- ++UI) {
- Instruction *User = cast<Instruction>(*UI);
- assert(isa<LoadInst>(User) || isa<GetElementPtrInst>(User));
- std::vector<Value*> Indices(User->op_begin()+1, User->op_end());
- ArgIndices.insert(Indices);
- LoadInst *OrigLoad;
- if (LoadInst *L = dyn_cast<LoadInst>(User))
- OrigLoad = L;
- else
- OrigLoad = cast<LoadInst>(User->use_back());
- OriginalLoads[Indices] = OrigLoad;
- }
-
- // Add a parameter to the function for each element passed in.
- for (ScalarizeTable::iterator SI = ArgIndices.begin(),
- E = ArgIndices.end(); SI != E; ++SI)
- Params.push_back(GetElementPtrInst::getIndexedType(I->getType(),
- SI->begin(),
- SI->end()));
-
- if (ArgIndices.size() == 1 && ArgIndices.begin()->empty())
- ++NumArgumentsPromoted;
- else
- ++NumAggregatesPromoted;
- }
- }
-
- const Type *RetTy = FTy->getReturnType();
-
- // Work around LLVM bug PR56: the CWriter cannot emit varargs functions which
- // have zero fixed arguments.
- bool ExtraArgHack = false;
- if (Params.empty() && FTy->isVarArg()) {
- ExtraArgHack = true;
- Params.push_back(Type::Int32Ty);
- }
-
- // Construct the new function type using the new arguments.
- FunctionType *NFTy = FunctionType::get(RetTy, Params, FTy->isVarArg());
-
- // Create the new function body and insert it into the module...
- Function *NF = Function::Create(NFTy, F->getLinkage(), F->getName());
- NF->setCallingConv(F->getCallingConv());
-
- // Recompute the parameter attributes list based on the new arguments for
- // the function.
- NF->setParamAttrs(PAListPtr::get(ParamAttrsVec.begin(), ParamAttrsVec.end()));
- ParamAttrsVec.clear();
-
- if (F->hasCollector())
- NF->setCollector(F->getCollector());
- F->getParent()->getFunctionList().insert(F, NF);
- NF->takeName(F);
-
- // Get the alias analysis information that we need to update to reflect our
- // changes.
- AliasAnalysis &AA = getAnalysis<AliasAnalysis>();
-
- // Loop over all of the callers of the function, transforming the call sites
- // to pass in the loaded pointers.
- //
- SmallVector<Value*, 16> Args;
- while (!F->use_empty()) {
- CallSite CS = CallSite::get(F->use_back());
- Instruction *Call = CS.getInstruction();
- const PAListPtr &CallPAL = CS.getParamAttrs();
-
- // Add any return attributes.
- if (ParameterAttributes attrs = CallPAL.getParamAttrs(0))
- ParamAttrsVec.push_back(ParamAttrsWithIndex::get(0, attrs));
-
- // Loop over the operands, inserting GEP and loads in the caller as
- // appropriate.
- CallSite::arg_iterator AI = CS.arg_begin();
- ArgIndex = 1;
- for (Function::arg_iterator I = F->arg_begin(), E = F->arg_end();
- I != E; ++I, ++AI, ++ArgIndex)
- if (!ArgsToPromote.count(I) && !ByValArgsToTransform.count(I)) {
- Args.push_back(*AI); // Unmodified argument
-
- if (ParameterAttributes Attrs = CallPAL.getParamAttrs(ArgIndex))
- ParamAttrsVec.push_back(ParamAttrsWithIndex::get(Args.size(), Attrs));
-
- } else if (ByValArgsToTransform.count(I)) {
- // Emit a GEP and load for each element of the struct.
- const Type *AgTy = cast<PointerType>(I->getType())->getElementType();
- const StructType *STy = cast<StructType>(AgTy);
- Value *Idxs[2] = { ConstantInt::get(Type::Int32Ty, 0), 0 };
- for (unsigned i = 0, e = STy->getNumElements(); i != e; ++i) {
- Idxs[1] = ConstantInt::get(Type::Int32Ty, i);
- Value *Idx = GetElementPtrInst::Create(*AI, Idxs, Idxs+2,
- (*AI)->getName()+"."+utostr(i),
- Call);
- // TODO: Tell AA about the new values?
- Args.push_back(new LoadInst(Idx, Idx->getName()+".val", Call));
- }
- } else if (!I->use_empty()) {
- // Non-dead argument: insert GEPs and loads as appropriate.
- ScalarizeTable &ArgIndices = ScalarizedElements[I];
- for (ScalarizeTable::iterator SI = ArgIndices.begin(),
- E = ArgIndices.end(); SI != E; ++SI) {
- Value *V = *AI;
- LoadInst *OrigLoad = OriginalLoads[*SI];
- if (!SI->empty()) {
- V = GetElementPtrInst::Create(V, SI->begin(), SI->end(),
- V->getName()+".idx", Call);
- AA.copyValue(OrigLoad->getOperand(0), V);
- }
- Args.push_back(new LoadInst(V, V->getName()+".val", Call));
- AA.copyValue(OrigLoad, Args.back());
- }
- }
-
- if (ExtraArgHack)
- Args.push_back(Constant::getNullValue(Type::Int32Ty));
-
- // Push any varargs arguments on the list
- for (; AI != CS.arg_end(); ++AI, ++ArgIndex) {
- Args.push_back(*AI);
- if (ParameterAttributes Attrs = CallPAL.getParamAttrs(ArgIndex))
- ParamAttrsVec.push_back(ParamAttrsWithIndex::get(Args.size(), Attrs));
- }
-
- Instruction *New;
- if (InvokeInst *II = dyn_cast<InvokeInst>(Call)) {
- New = InvokeInst::Create(NF, II->getNormalDest(), II->getUnwindDest(),
- Args.begin(), Args.end(), "", Call);
- cast<InvokeInst>(New)->setCallingConv(CS.getCallingConv());
- cast<InvokeInst>(New)->setParamAttrs(PAListPtr::get(ParamAttrsVec.begin(),
- ParamAttrsVec.end()));
- } else {
- New = CallInst::Create(NF, Args.begin(), Args.end(), "", Call);
- cast<CallInst>(New)->setCallingConv(CS.getCallingConv());
- cast<CallInst>(New)->setParamAttrs(PAListPtr::get(ParamAttrsVec.begin(),
- ParamAttrsVec.end()));
- if (cast<CallInst>(Call)->isTailCall())
- cast<CallInst>(New)->setTailCall();
- }
- Args.clear();
- ParamAttrsVec.clear();
-
- // Update the alias analysis implementation to know that we are replacing
- // the old call with a new one.
- AA.replaceWithNewValue(Call, New);
-
- if (!Call->use_empty()) {
- Call->replaceAllUsesWith(New);
- New->takeName(Call);
- }
-
- // Finally, remove the old call from the program, reducing the use-count of
- // F.
- Call->eraseFromParent();
- }
-
- // Since we have now created the new function, splice the body of the old
- // function right into the new function, leaving the old rotting hulk of the
- // function empty.
- NF->getBasicBlockList().splice(NF->begin(), F->getBasicBlockList());
-
- // Loop over the argument list, transfering uses of the old arguments over to
- // the new arguments, also transfering over the names as well.
- //
- for (Function::arg_iterator I = F->arg_begin(), E = F->arg_end(),
- I2 = NF->arg_begin(); I != E; ++I) {
- if (!ArgsToPromote.count(I) && !ByValArgsToTransform.count(I)) {
- // If this is an unmodified argument, move the name and users over to the
- // new version.
- I->replaceAllUsesWith(I2);
- I2->takeName(I);
- AA.replaceWithNewValue(I, I2);
- ++I2;
- continue;
- }
-
- if (ByValArgsToTransform.count(I)) {
- // In the callee, we create an alloca, and store each of the new incoming
- // arguments into the alloca.
- Instruction *InsertPt = NF->begin()->begin();
-
- // Just add all the struct element types.
- const Type *AgTy = cast<PointerType>(I->getType())->getElementType();
- Value *TheAlloca = new AllocaInst(AgTy, 0, "", InsertPt);
- const StructType *STy = cast<StructType>(AgTy);
- Value *Idxs[2] = { ConstantInt::get(Type::Int32Ty, 0), 0 };
-
- for (unsigned i = 0, e = STy->getNumElements(); i != e; ++i) {
- Idxs[1] = ConstantInt::get(Type::Int32Ty, i);
- Value *Idx = GetElementPtrInst::Create(TheAlloca, Idxs, Idxs+2,
- TheAlloca->getName()+"."+utostr(i),
- InsertPt);
- I2->setName(I->getName()+"."+utostr(i));
- new StoreInst(I2++, Idx, InsertPt);
- }
-
- // Anything that used the arg should now use the alloca.
- I->replaceAllUsesWith(TheAlloca);
- TheAlloca->takeName(I);
- AA.replaceWithNewValue(I, TheAlloca);
- continue;
- }
-
- if (I->use_empty()) {
- AA.deleteValue(I);
- continue;
- }
-
- // Otherwise, if we promoted this argument, then all users are load
- // instructions, and all loads should be using the new argument that we
- // added.
- ScalarizeTable &ArgIndices = ScalarizedElements[I];
-
- while (!I->use_empty()) {
- if (LoadInst *LI = dyn_cast<LoadInst>(I->use_back())) {
- assert(ArgIndices.begin()->empty() &&
- "Load element should sort to front!");
- I2->setName(I->getName()+".val");
- LI->replaceAllUsesWith(I2);
- AA.replaceWithNewValue(LI, I2);
- LI->eraseFromParent();
- DOUT << "*** Promoted load of argument '" << I->getName()
- << "' in function '" << F->getName() << "'\n";
- } else {
- GetElementPtrInst *GEP = cast<GetElementPtrInst>(I->use_back());
- std::vector<Value*> Operands(GEP->op_begin()+1, GEP->op_end());
-
- Function::arg_iterator TheArg = I2;
- for (ScalarizeTable::iterator It = ArgIndices.begin();
- *It != Operands; ++It, ++TheArg) {
- assert(It != ArgIndices.end() && "GEP not handled??");
- }
-
- std::string NewName = I->getName();
- for (unsigned i = 0, e = Operands.size(); i != e; ++i)
- if (ConstantInt *CI = dyn_cast<ConstantInt>(Operands[i]))
- NewName += "." + CI->getValue().toStringUnsigned(10);
- else
- NewName += ".x";
- TheArg->setName(NewName+".val");
-
- DOUT << "*** Promoted agg argument '" << TheArg->getName()
- << "' of function '" << F->getName() << "'\n";
-
- // All of the uses must be load instructions. Replace them all with
- // the argument specified by ArgNo.
- while (!GEP->use_empty()) {
- LoadInst *L = cast<LoadInst>(GEP->use_back());
- L->replaceAllUsesWith(TheArg);
- AA.replaceWithNewValue(L, TheArg);
- L->eraseFromParent();
- }
- AA.deleteValue(GEP);
- GEP->eraseFromParent();
- }
- }
-
- // Increment I2 past all of the arguments added for this promoted pointer.
- for (unsigned i = 0, e = ArgIndices.size(); i != e; ++i)
- ++I2;
- }
-
- // Notify the alias analysis implementation that we inserted a new argument.
- if (ExtraArgHack)
- AA.copyValue(Constant::getNullValue(Type::Int32Ty), NF->arg_begin());
-
-
- // Tell the alias analysis that the old function is about to disappear.
- AA.replaceWithNewValue(F, NF);
-
- // Now that the old function is dead, delete it.
- F->eraseFromParent();
- return NF;
-}
diff --git a/release_23/lib/Transforms/IPO/ConstantMerge.cpp b/release_23/lib/Transforms/IPO/ConstantMerge.cpp
deleted file mode 100644
index a8a149237554..000000000000
--- a/release_23/lib/Transforms/IPO/ConstantMerge.cpp
+++ /dev/null
@@ -1,113 +0,0 @@
-//===- ConstantMerge.cpp - Merge duplicate global constants ---------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines the interface to a pass that merges duplicate global
-// constants together into a single constant that is shared. This is useful
-// because some passes (ie TraceValues) insert a lot of string constants into
-// the program, regardless of whether or not an existing string is available.
-//
-// Algorithm: ConstantMerge is designed to build up a map of available constants
-// and eliminate duplicates when it is initialized.
-//
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "constmerge"
-#include "llvm/Transforms/IPO.h"
-#include "llvm/Module.h"
-#include "llvm/Pass.h"
-#include "llvm/ADT/Statistic.h"
-#include "llvm/Support/Compiler.h"
-#include <map>
-using namespace llvm;
-
-STATISTIC(NumMerged, "Number of global constants merged");
-
-namespace {
- struct VISIBILITY_HIDDEN ConstantMerge : public ModulePass {
- static char ID; // Pass identification, replacement for typeid
- ConstantMerge() : ModulePass((intptr_t)&ID) {}
-
- // run - For this pass, process all of the globals in the module,
- // eliminating duplicate constants.
- //
- bool runOnModule(Module &M);
- };
-
- char ConstantMerge::ID = 0;
- RegisterPass<ConstantMerge>X("constmerge","Merge Duplicate Global Constants");
-}
-
-ModulePass *llvm::createConstantMergePass() { return new ConstantMerge(); }
-
-bool ConstantMerge::runOnModule(Module &M) {
- // Map unique constant/section pairs to globals. We don't want to merge
- // globals in different sections.
- std::map<std::pair<Constant*, std::string>, GlobalVariable*> CMap;
-
- // Replacements - This vector contains a list of replacements to perform.
- std::vector<std::pair<GlobalVariable*, GlobalVariable*> > Replacements;
-
- bool MadeChange = false;
-
- // Iterate constant merging while we are still making progress. Merging two
- // constants together may allow us to merge other constants together if the
- // second level constants have initializers which point to the globals that
- // were just merged.
- while (1) {
- // First pass: identify all globals that can be merged together, filling in
- // the Replacements vector. We cannot do the replacement in this pass
- // because doing so may cause initializers of other globals to be rewritten,
- // invalidating the Constant* pointers in CMap.
- //
- for (Module::global_iterator GVI = M.global_begin(), E = M.global_end();
- GVI != E; ) {
- GlobalVariable *GV = GVI++;
-
- // If this GV is dead, remove it.
- GV->removeDeadConstantUsers();
- if (GV->use_empty() && GV->hasInternalLinkage()) {
- GV->eraseFromParent();
- continue;
- }
-
- // Only process constants with initializers.
- if (GV->isConstant() && GV->hasInitializer()) {
- Constant *Init = GV->getInitializer();
-
- // Check to see if the initializer is already known.
- GlobalVariable *&Slot = CMap[std::make_pair(Init, GV->getSection())];
-
- if (Slot == 0) { // Nope, add it to the map.
- Slot = GV;
- } else if (GV->hasInternalLinkage()) { // Yup, this is a duplicate!
- // Make all uses of the duplicate constant use the canonical version.
- Replacements.push_back(std::make_pair(GV, Slot));
- }
- }
- }
-
- if (Replacements.empty())
- return MadeChange;
- CMap.clear();
-
- // Now that we have figured out which replacements must be made, do them all
- // now. This avoid invalidating the pointers in CMap, which are unneeded
- // now.
- for (unsigned i = 0, e = Replacements.size(); i != e; ++i) {
- // Eliminate any uses of the dead global...
- Replacements[i].first->replaceAllUsesWith(Replacements[i].second);
-
- // Delete the global value from the module...
- M.getGlobalList().erase(Replacements[i].first);
- }
-
- NumMerged += Replacements.size();
- Replacements.clear();
- }
-}
diff --git a/release_23/lib/Transforms/IPO/DeadArgumentElimination.cpp b/release_23/lib/Transforms/IPO/DeadArgumentElimination.cpp
deleted file mode 100644
index 6cd128b7c458..000000000000
--- a/release_23/lib/Transforms/IPO/DeadArgumentElimination.cpp
+++ /dev/null
@@ -1,773 +0,0 @@
-//===-- DeadArgumentElimination.cpp - Eliminate dead arguments ------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This pass deletes dead arguments from internal functions. Dead argument
-// elimination removes arguments which are directly dead, as well as arguments
-// only passed into function calls as dead arguments of other functions. This
-// pass also deletes dead arguments in a similar way.
-//
-// This pass is often useful as a cleanup pass to run after aggressive
-// interprocedural passes, which add possibly-dead arguments.
-//
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "deadargelim"
-#include "llvm/Transforms/IPO.h"
-#include "llvm/CallingConv.h"
-#include "llvm/Constant.h"
-#include "llvm/DerivedTypes.h"
-#include "llvm/Instructions.h"
-#include "llvm/IntrinsicInst.h"
-#include "llvm/Module.h"
-#include "llvm/Pass.h"
-#include "llvm/Support/CallSite.h"
-#include "llvm/Support/Debug.h"
-#include "llvm/ADT/SmallVector.h"
-#include "llvm/ADT/Statistic.h"
-#include "llvm/Support/Compiler.h"
-#include <map>
-#include <set>
-using namespace llvm;
-
-STATISTIC(NumArgumentsEliminated, "Number of unread args removed");
-STATISTIC(NumRetValsEliminated , "Number of unused return values removed");
-
-namespace {
- /// DAE - The dead argument elimination pass.
- ///
- class VISIBILITY_HIDDEN DAE : public ModulePass {
- /// Liveness enum - During our initial pass over the program, we determine
- /// that things are either definately alive, definately dead, or in need of
- /// interprocedural analysis (MaybeLive).
- ///
- enum Liveness { Live, MaybeLive, Dead };
-
- /// LiveArguments, MaybeLiveArguments, DeadArguments - These sets contain
- /// all of the arguments in the program. The Dead set contains arguments
- /// which are completely dead (never used in the function). The MaybeLive
- /// set contains arguments which are only passed into other function calls,
- /// thus may be live and may be dead. The Live set contains arguments which
- /// are known to be alive.
- ///
- std::set<Argument*> DeadArguments, MaybeLiveArguments, LiveArguments;
-
- /// DeadRetVal, MaybeLiveRetVal, LifeRetVal - These sets contain all of the
- /// functions in the program. The Dead set contains functions whose return
- /// value is known to be dead. The MaybeLive set contains functions whose
- /// return values are only used by return instructions, and the Live set
- /// contains functions whose return values are used, functions that are
- /// external, and functions that already return void.
- ///
- std::set<Function*> DeadRetVal, MaybeLiveRetVal, LiveRetVal;
-
- /// InstructionsToInspect - As we mark arguments and return values
- /// MaybeLive, we keep track of which instructions could make the values
- /// live here. Once the entire program has had the return value and
- /// arguments analyzed, this set is scanned to promote the MaybeLive objects
- /// to be Live if they really are used.
- std::vector<Instruction*> InstructionsToInspect;
-
- /// CallSites - Keep track of the call sites of functions that have
- /// MaybeLive arguments or return values.
- std::multimap<Function*, CallSite> CallSites;
-
- public:
- static char ID; // Pass identification, replacement for typeid
- DAE() : ModulePass((intptr_t)&ID) {}
- bool runOnModule(Module &M);
-
- virtual bool ShouldHackArguments() const { return false; }
-
- private:
- Liveness getArgumentLiveness(const Argument &A);
- bool isMaybeLiveArgumentNowLive(Argument *Arg);
-
- bool DeleteDeadVarargs(Function &Fn);
- void SurveyFunction(Function &Fn);
-
- void MarkArgumentLive(Argument *Arg);
- void MarkRetValLive(Function *F);
- void MarkReturnInstArgumentLive(ReturnInst *RI);
-
- void RemoveDeadArgumentsFromFunction(Function *F);
- };
- char DAE::ID = 0;
- RegisterPass<DAE> X("deadargelim", "Dead Argument Elimination");
-
- /// DAH - DeadArgumentHacking pass - Same as dead argument elimination, but
- /// deletes arguments to functions which are external. This is only for use
- /// by bugpoint.
- struct DAH : public DAE {
- static char ID;
- virtual bool ShouldHackArguments() const { return true; }
- };
- char DAH::ID = 0;
- RegisterPass<DAH> Y("deadarghaX0r",
- "Dead Argument Hacking (BUGPOINT USE ONLY; DO NOT USE)");
-}
-
-/// createDeadArgEliminationPass - This pass removes arguments from functions
-/// which are not used by the body of the function.
-///
-ModulePass *llvm::createDeadArgEliminationPass() { return new DAE(); }
-ModulePass *llvm::createDeadArgHackingPass() { return new DAH(); }
-
-/// DeleteDeadVarargs - If this is an function that takes a ... list, and if
-/// llvm.vastart is never called, the varargs list is dead for the function.
-bool DAE::DeleteDeadVarargs(Function &Fn) {
- assert(Fn.getFunctionType()->isVarArg() && "Function isn't varargs!");
- if (Fn.isDeclaration() || !Fn.hasInternalLinkage()) return false;
-
- // Ensure that the function is only directly called.
- for (Value::use_iterator I = Fn.use_begin(), E = Fn.use_end(); I != E; ++I) {
- // If this use is anything other than a call site, give up.
- CallSite CS = CallSite::get(*I);
- Instruction *TheCall = CS.getInstruction();
- if (!TheCall) return false; // Not a direct call site?
-
- // The addr of this function is passed to the call.
- if (I.getOperandNo() != 0) return false;
- }
-
- // Okay, we know we can transform this function if safe. Scan its body
- // looking for calls to llvm.vastart.
- for (Function::iterator BB = Fn.begin(), E = Fn.end(); BB != E; ++BB) {
- for (BasicBlock::iterator I = BB->begin(), E = BB->end(); I != E; ++I) {
- if (IntrinsicInst *II = dyn_cast<IntrinsicInst>(I)) {
- if (II->getIntrinsicID() == Intrinsic::vastart)
- return false;
- }
- }
- }
-
- // If we get here, there are no calls to llvm.vastart in the function body,
- // remove the "..." and adjust all the calls.
-
- // Start by computing a new prototype for the function, which is the same as
- // the old function, but has fewer arguments.
- const FunctionType *FTy = Fn.getFunctionType();
- std::vector<const Type*> Params(FTy->param_begin(), FTy->param_end());
- FunctionType *NFTy = FunctionType::get(FTy->getReturnType(), Params, false);
- unsigned NumArgs = Params.size();
-
- // Create the new function body and insert it into the module...
- Function *NF = Function::Create(NFTy, Fn.getLinkage());
- NF->setCallingConv(Fn.getCallingConv());
- NF->setParamAttrs(Fn.getParamAttrs());
- if (Fn.hasCollector())
- NF->setCollector(Fn.getCollector());
- Fn.getParent()->getFunctionList().insert(&Fn, NF);
- NF->takeName(&Fn);
-
- // Loop over all of the callers of the function, transforming the call sites
- // to pass in a smaller number of arguments into the new function.
- //
- std::vector<Value*> Args;
- while (!Fn.use_empty()) {
- CallSite CS = CallSite::get(Fn.use_back());
- Instruction *Call = CS.getInstruction();
-
- // Pass all the same arguments.
- Args.assign(CS.arg_begin(), CS.arg_begin()+NumArgs);
-
- // Drop any attributes that were on the vararg arguments.
- PAListPtr PAL = CS.getParamAttrs();
- if (!PAL.isEmpty() && PAL.getSlot(PAL.getNumSlots() - 1).Index > NumArgs) {
- SmallVector<ParamAttrsWithIndex, 8> ParamAttrsVec;
- for (unsigned i = 0; PAL.getSlot(i).Index <= NumArgs; ++i)
- ParamAttrsVec.push_back(PAL.getSlot(i));
- PAL = PAListPtr::get(ParamAttrsVec.begin(), ParamAttrsVec.end());
- }
-
- Instruction *New;
- if (InvokeInst *II = dyn_cast<InvokeInst>(Call)) {
- New = InvokeInst::Create(NF, II->getNormalDest(), II->getUnwindDest(),
- Args.begin(), Args.end(), "", Call);
- cast<InvokeInst>(New)->setCallingConv(CS.getCallingConv());
- cast<InvokeInst>(New)->setParamAttrs(PAL);
- } else {
- New = CallInst::Create(NF, Args.begin(), Args.end(), "", Call);
- cast<CallInst>(New)->setCallingConv(CS.getCallingConv());
- cast<CallInst>(New)->setParamAttrs(PAL);
- if (cast<CallInst>(Call)->isTailCall())
- cast<CallInst>(New)->setTailCall();
- }
- Args.clear();
-
- if (!Call->use_empty())
- Call->replaceAllUsesWith(New);
-
- New->takeName(Call);
-
- // Finally, remove the old call from the program, reducing the use-count of
- // F.
- Call->eraseFromParent();
- }
-
- // Since we have now created the new function, splice the body of the old
- // function right into the new function, leaving the old rotting hulk of the
- // function empty.
- NF->getBasicBlockList().splice(NF->begin(), Fn.getBasicBlockList());
-
- // Loop over the argument list, transfering uses of the old arguments over to
- // the new arguments, also transfering over the names as well. While we're at
- // it, remove the dead arguments from the DeadArguments list.
- //
- for (Function::arg_iterator I = Fn.arg_begin(), E = Fn.arg_end(),
- I2 = NF->arg_begin(); I != E; ++I, ++I2) {
- // Move the name and users over to the new version.
- I->replaceAllUsesWith(I2);
- I2->takeName(I);
- }
-
- // Finally, nuke the old function.
- Fn.eraseFromParent();
- return true;
-}
-
-
-static inline bool CallPassesValueThoughVararg(Instruction *Call,
- const Value *Arg) {
- CallSite CS = CallSite::get(Call);
- const Type *CalledValueTy = CS.getCalledValue()->getType();
- const Type *FTy = cast<PointerType>(CalledValueTy)->getElementType();
- unsigned NumFixedArgs = cast<FunctionType>(FTy)->getNumParams();
- for (CallSite::arg_iterator AI = CS.arg_begin()+NumFixedArgs;
- AI != CS.arg_end(); ++AI)
- if (AI->get() == Arg)
- return true;
- return false;
-}
-
-// getArgumentLiveness - Inspect an argument, determining if is known Live
-// (used in a computation), MaybeLive (only passed as an argument to a call), or
-// Dead (not used).
-DAE::Liveness DAE::getArgumentLiveness(const Argument &A) {
- const Function *F = A.getParent();
-
- // If this is the return value of a struct function, it's not really dead.
- if (F->hasStructRetAttr() && &*(F->arg_begin()) == &A)
- return Live;
-
- if (A.use_empty()) // First check, directly dead?
- return Dead;
-
- // Scan through all of the uses, looking for non-argument passing uses.
- for (Value::use_const_iterator I = A.use_begin(), E = A.use_end(); I!=E;++I) {
- // Return instructions do not immediately effect liveness.
- if (isa<ReturnInst>(*I))
- continue;
-
- CallSite CS = CallSite::get(const_cast<User*>(*I));
- if (!CS.getInstruction()) {
- // If its used by something that is not a call or invoke, it's alive!
- return Live;
- }
- // If it's an indirect call, mark it alive...
- Function *Callee = CS.getCalledFunction();
- if (!Callee) return Live;
-
- // Check to see if it's passed through a va_arg area: if so, we cannot
- // remove it.
- if (CallPassesValueThoughVararg(CS.getInstruction(), &A))
- return Live; // If passed through va_arg area, we cannot remove it
- }
-
- return MaybeLive; // It must be used, but only as argument to a function
-}
-
-
-// SurveyFunction - This performs the initial survey of the specified function,
-// checking out whether or not it uses any of its incoming arguments or whether
-// any callers use the return value. This fills in the
-// (Dead|MaybeLive|Live)(Arguments|RetVal) sets.
-//
-// We consider arguments of non-internal functions to be intrinsically alive as
-// well as arguments to functions which have their "address taken".
-//
-void DAE::SurveyFunction(Function &F) {
- bool FunctionIntrinsicallyLive = false;
- Liveness RetValLiveness = F.getReturnType() == Type::VoidTy ? Live : Dead;
-
- if (!F.hasInternalLinkage() &&
- (!ShouldHackArguments() || F.isIntrinsic()))
- FunctionIntrinsicallyLive = true;
- else
- for (Value::use_iterator I = F.use_begin(), E = F.use_end(); I != E; ++I) {
- // If this use is anything other than a call site, the function is alive.
- CallSite CS = CallSite::get(*I);
- Instruction *TheCall = CS.getInstruction();
- if (!TheCall) { // Not a direct call site?
- FunctionIntrinsicallyLive = true;
- break;
- }
-
- // Check to see if the return value is used...
- if (RetValLiveness != Live)
- for (Value::use_iterator I = TheCall->use_begin(),
- E = TheCall->use_end(); I != E; ++I)
- if (isa<ReturnInst>(cast<Instruction>(*I))) {
- RetValLiveness = MaybeLive;
- } else if (isa<CallInst>(cast<Instruction>(*I)) ||
- isa<InvokeInst>(cast<Instruction>(*I))) {
- if (CallPassesValueThoughVararg(cast<Instruction>(*I), TheCall) ||
- !CallSite::get(cast<Instruction>(*I)).getCalledFunction()) {
- RetValLiveness = Live;
- break;
- } else {
- RetValLiveness = MaybeLive;
- }
- } else {
- RetValLiveness = Live;
- break;
- }
-
- // If the function is PASSED IN as an argument, its address has been taken
- for (CallSite::arg_iterator AI = CS.arg_begin(), E = CS.arg_end();
- AI != E; ++AI)
- if (AI->get() == &F) {
- FunctionIntrinsicallyLive = true;
- break;
- }
- if (FunctionIntrinsicallyLive) break;
- }
-
- if (FunctionIntrinsicallyLive) {
- DOUT << " Intrinsically live fn: " << F.getName() << "\n";
- for (Function::arg_iterator AI = F.arg_begin(), E = F.arg_end();
- AI != E; ++AI)
- LiveArguments.insert(AI);
- LiveRetVal.insert(&F);
- return;
- }
-
- switch (RetValLiveness) {
- case Live: LiveRetVal.insert(&F); break;
- case MaybeLive: MaybeLiveRetVal.insert(&F); break;
- case Dead: DeadRetVal.insert(&F); break;
- }
-
- DOUT << " Inspecting args for fn: " << F.getName() << "\n";
-
- // If it is not intrinsically alive, we know that all users of the
- // function are call sites. Mark all of the arguments live which are
- // directly used, and keep track of all of the call sites of this function
- // if there are any arguments we assume that are dead.
- //
- bool AnyMaybeLiveArgs = false;
- for (Function::arg_iterator AI = F.arg_begin(), E = F.arg_end();
- AI != E; ++AI)
- switch (getArgumentLiveness(*AI)) {
- case Live:
- DOUT << " Arg live by use: " << AI->getName() << "\n";
- LiveArguments.insert(AI);
- break;
- case Dead:
- DOUT << " Arg definitely dead: " << AI->getName() <<"\n";
- DeadArguments.insert(AI);
- break;
- case MaybeLive:
- DOUT << " Arg only passed to calls: " << AI->getName() << "\n";
- AnyMaybeLiveArgs = true;
- MaybeLiveArguments.insert(AI);
- break;
- }
-
- // If there are any "MaybeLive" arguments, we need to check callees of
- // this function when/if they become alive. Record which functions are
- // callees...
- if (AnyMaybeLiveArgs || RetValLiveness == MaybeLive)
- for (Value::use_iterator I = F.use_begin(), E = F.use_end();
- I != E; ++I) {
- if (AnyMaybeLiveArgs)
- CallSites.insert(std::make_pair(&F, CallSite::get(*I)));
-
- if (RetValLiveness == MaybeLive)
- for (Value::use_iterator UI = I->use_begin(), E = I->use_end();
- UI != E; ++UI)
- InstructionsToInspect.push_back(cast<Instruction>(*UI));
- }
-}
-
-// isMaybeLiveArgumentNowLive - Check to see if Arg is alive. At this point, we
-// know that the only uses of Arg are to be passed in as an argument to a
-// function call or return. Check to see if the formal argument passed in is in
-// the LiveArguments set. If so, return true.
-//
-bool DAE::isMaybeLiveArgumentNowLive(Argument *Arg) {
- for (Value::use_iterator I = Arg->use_begin(), E = Arg->use_end(); I!=E; ++I){
- if (isa<ReturnInst>(*I)) {
- if (LiveRetVal.count(Arg->getParent())) return true;
- continue;
- }
-
- CallSite CS = CallSite::get(*I);
-
- // We know that this can only be used for direct calls...
- Function *Callee = CS.getCalledFunction();
-
- // Loop over all of the arguments (because Arg may be passed into the call
- // multiple times) and check to see if any are now alive...
- CallSite::arg_iterator CSAI = CS.arg_begin();
- for (Function::arg_iterator AI = Callee->arg_begin(), E = Callee->arg_end();
- AI != E; ++AI, ++CSAI)
- // If this is the argument we are looking for, check to see if it's alive
- if (*CSAI == Arg && LiveArguments.count(AI))
- return true;
- }
- return false;
-}
-
-/// MarkArgumentLive - The MaybeLive argument 'Arg' is now known to be alive.
-/// Mark it live in the specified sets and recursively mark arguments in callers
-/// live that are needed to pass in a value.
-///
-void DAE::MarkArgumentLive(Argument *Arg) {
- std::set<Argument*>::iterator It = MaybeLiveArguments.lower_bound(Arg);
- if (It == MaybeLiveArguments.end() || *It != Arg) return;
-
- DOUT << " MaybeLive argument now live: " << Arg->getName() <<"\n";
- MaybeLiveArguments.erase(It);
- LiveArguments.insert(Arg);
-
- // Loop over all of the call sites of the function, making any arguments
- // passed in to provide a value for this argument live as necessary.
- //
- Function *Fn = Arg->getParent();
- unsigned ArgNo = std::distance(Fn->arg_begin(), Function::arg_iterator(Arg));
-
- std::multimap<Function*, CallSite>::iterator I = CallSites.lower_bound(Fn);
- for (; I != CallSites.end() && I->first == Fn; ++I) {
- CallSite CS = I->second;
- Value *ArgVal = *(CS.arg_begin()+ArgNo);
- if (Argument *ActualArg = dyn_cast<Argument>(ArgVal)) {
- MarkArgumentLive(ActualArg);
- } else {
- // If the value passed in at this call site is a return value computed by
- // some other call site, make sure to mark the return value at the other
- // call site as being needed.
- CallSite ArgCS = CallSite::get(ArgVal);
- if (ArgCS.getInstruction())
- if (Function *Fn = ArgCS.getCalledFunction())
- MarkRetValLive(Fn);
- }
- }
-}
-
-/// MarkArgumentLive - The MaybeLive return value for the specified function is
-/// now known to be alive. Propagate this fact to the return instructions which
-/// produce it.
-void DAE::MarkRetValLive(Function *F) {
- assert(F && "Shame shame, we can't have null pointers here!");
-
- // Check to see if we already knew it was live
- std::set<Function*>::iterator I = MaybeLiveRetVal.lower_bound(F);
- if (I == MaybeLiveRetVal.end() || *I != F) return; // It's already alive!
-
- DOUT << " MaybeLive retval now live: " << F->getName() << "\n";
-
- MaybeLiveRetVal.erase(I);
- LiveRetVal.insert(F); // It is now known to be live!
-
- // Loop over all of the functions, noticing that the return value is now live.
- for (Function::iterator BB = F->begin(), E = F->end(); BB != E; ++BB)
- if (ReturnInst *RI = dyn_cast<ReturnInst>(BB->getTerminator()))
- MarkReturnInstArgumentLive(RI);
-}
-
-void DAE::MarkReturnInstArgumentLive(ReturnInst *RI) {
- Value *Op = RI->getOperand(0);
- if (Argument *A = dyn_cast<Argument>(Op)) {
- MarkArgumentLive(A);
- } else if (CallInst *CI = dyn_cast<CallInst>(Op)) {
- if (Function *F = CI->getCalledFunction())
- MarkRetValLive(F);
- } else if (InvokeInst *II = dyn_cast<InvokeInst>(Op)) {
- if (Function *F = II->getCalledFunction())
- MarkRetValLive(F);
- }
-}
-
-// RemoveDeadArgumentsFromFunction - We know that F has dead arguments, as
-// specified by the DeadArguments list. Transform the function and all of the
-// callees of the function to not have these arguments.
-//
-void DAE::RemoveDeadArgumentsFromFunction(Function *F) {
- // Start by computing a new prototype for the function, which is the same as
- // the old function, but has fewer arguments.
- const FunctionType *FTy = F->getFunctionType();
- std::vector<const Type*> Params;
-
- // Set up to build a new list of parameter attributes
- SmallVector<ParamAttrsWithIndex, 8> ParamAttrsVec;
- const PAListPtr &PAL = F->getParamAttrs();
-
- // The existing function return attributes.
- ParameterAttributes RAttrs = PAL.getParamAttrs(0);
-
- // Make the function return void if the return value is dead.
- const Type *RetTy = FTy->getReturnType();
- if (DeadRetVal.count(F)) {
- RetTy = Type::VoidTy;
- RAttrs &= ~ParamAttr::typeIncompatible(RetTy);
- DeadRetVal.erase(F);
- }
-
- if (RAttrs)
- ParamAttrsVec.push_back(ParamAttrsWithIndex::get(0, RAttrs));
-
- // Construct the new parameter list from non-dead arguments. Also construct
- // a new set of parameter attributes to correspond.
- unsigned index = 1;
- for (Function::arg_iterator I = F->arg_begin(), E = F->arg_end(); I != E;
- ++I, ++index)
- if (!DeadArguments.count(I)) {
- Params.push_back(I->getType());
-
- if (ParameterAttributes Attrs = PAL.getParamAttrs(index))
- ParamAttrsVec.push_back(ParamAttrsWithIndex::get(Params.size(), Attrs));
- }
-
- // Reconstruct the ParamAttrsList based on the vector we constructed.
- PAListPtr NewPAL = PAListPtr::get(ParamAttrsVec.begin(), ParamAttrsVec.end());
-
- // Work around LLVM bug PR56: the CWriter cannot emit varargs functions which
- // have zero fixed arguments.
- //
- bool ExtraArgHack = false;
- if (Params.empty() && FTy->isVarArg()) {
- ExtraArgHack = true;
- Params.push_back(Type::Int32Ty);
- }
-
- // Create the new function type based on the recomputed parameters.
- FunctionType *NFTy = FunctionType::get(RetTy, Params, FTy->isVarArg());
-
- // Create the new function body and insert it into the module...
- Function *NF = Function::Create(NFTy, F->getLinkage());
- NF->setCallingConv(F->getCallingConv());
- NF->setParamAttrs(NewPAL);
- if (F->hasCollector())
- NF->setCollector(F->getCollector());
- F->getParent()->getFunctionList().insert(F, NF);
- NF->takeName(F);
-
- // Loop over all of the callers of the function, transforming the call sites
- // to pass in a smaller number of arguments into the new function.
- //
- std::vector<Value*> Args;
- while (!F->use_empty()) {
- CallSite CS = CallSite::get(F->use_back());
- Instruction *Call = CS.getInstruction();
- ParamAttrsVec.clear();
- const PAListPtr &CallPAL = CS.getParamAttrs();
-
- // The call return attributes.
- ParameterAttributes RAttrs = CallPAL.getParamAttrs(0);
- // Adjust in case the function was changed to return void.
- RAttrs &= ~ParamAttr::typeIncompatible(NF->getReturnType());
- if (RAttrs)
- ParamAttrsVec.push_back(ParamAttrsWithIndex::get(0, RAttrs));
-
- // Loop over the operands, deleting dead ones...
- CallSite::arg_iterator AI = CS.arg_begin();
- index = 1;
- for (Function::arg_iterator I = F->arg_begin(), E = F->arg_end();
- I != E; ++I, ++AI, ++index)
- if (!DeadArguments.count(I)) { // Remove operands for dead arguments
- Args.push_back(*AI);
- if (ParameterAttributes Attrs = CallPAL.getParamAttrs(index))
- ParamAttrsVec.push_back(ParamAttrsWithIndex::get(Args.size(), Attrs));
- }
-
- if (ExtraArgHack)
- Args.push_back(UndefValue::get(Type::Int32Ty));
-
- // Push any varargs arguments on the list. Don't forget their attributes.
- for (; AI != CS.arg_end(); ++AI) {
- Args.push_back(*AI);
- if (ParameterAttributes Attrs = CallPAL.getParamAttrs(index++))
- ParamAttrsVec.push_back(ParamAttrsWithIndex::get(Args.size(), Attrs));
- }
-
- // Reconstruct the ParamAttrsList based on the vector we constructed.
- PAListPtr NewCallPAL = PAListPtr::get(ParamAttrsVec.begin(),
- ParamAttrsVec.end());
-
- Instruction *New;
- if (InvokeInst *II = dyn_cast<InvokeInst>(Call)) {
- New = InvokeInst::Create(NF, II->getNormalDest(), II->getUnwindDest(),
- Args.begin(), Args.end(), "", Call);
- cast<InvokeInst>(New)->setCallingConv(CS.getCallingConv());
- cast<InvokeInst>(New)->setParamAttrs(NewCallPAL);
- } else {
- New = CallInst::Create(NF, Args.begin(), Args.end(), "", Call);
- cast<CallInst>(New)->setCallingConv(CS.getCallingConv());
- cast<CallInst>(New)->setParamAttrs(NewCallPAL);
- if (cast<CallInst>(Call)->isTailCall())
- cast<CallInst>(New)->setTailCall();
- }
- Args.clear();
-
- if (!Call->use_empty()) {
- if (New->getType() == Type::VoidTy)
- Call->replaceAllUsesWith(Constant::getNullValue(Call->getType()));
- else {
- Call->replaceAllUsesWith(New);
- New->takeName(Call);
- }
- }
-
- // Finally, remove the old call from the program, reducing the use-count of
- // F.
- Call->getParent()->getInstList().erase(Call);
- }
-
- // Since we have now created the new function, splice the body of the old
- // function right into the new function, leaving the old rotting hulk of the
- // function empty.
- NF->getBasicBlockList().splice(NF->begin(), F->getBasicBlockList());
-
- // Loop over the argument list, transfering uses of the old arguments over to
- // the new arguments, also transfering over the names as well. While we're at
- // it, remove the dead arguments from the DeadArguments list.
- //
- for (Function::arg_iterator I = F->arg_begin(), E = F->arg_end(),
- I2 = NF->arg_begin();
- I != E; ++I)
- if (!DeadArguments.count(I)) {
- // If this is a live argument, move the name and users over to the new
- // version.
- I->replaceAllUsesWith(I2);
- I2->takeName(I);
- ++I2;
- } else {
- // If this argument is dead, replace any uses of it with null constants
- // (these are guaranteed to only be operands to call instructions which
- // will later be simplified).
- I->replaceAllUsesWith(Constant::getNullValue(I->getType()));
- DeadArguments.erase(I);
- }
-
- // If we change the return value of the function we must rewrite any return
- // instructions. Check this now.
- if (F->getReturnType() != NF->getReturnType())
- for (Function::iterator BB = NF->begin(), E = NF->end(); BB != E; ++BB)
- if (ReturnInst *RI = dyn_cast<ReturnInst>(BB->getTerminator())) {
- ReturnInst::Create(0, RI);
- BB->getInstList().erase(RI);
- }
-
- // Now that the old function is dead, delete it.
- F->getParent()->getFunctionList().erase(F);
-}
-
-bool DAE::runOnModule(Module &M) {
- bool Changed = false;
- // First pass: Do a simple check to see if any functions can have their "..."
- // removed. We can do this if they never call va_start. This loop cannot be
- // fused with the next loop, because deleting a function invalidates
- // information computed while surveying other functions.
- DOUT << "DAE - Deleting dead varargs\n";
- for (Module::iterator I = M.begin(), E = M.end(); I != E; ) {
- Function &F = *I++;
- if (F.getFunctionType()->isVarArg())
- Changed |= DeleteDeadVarargs(F);
- }
-
- // Second phase:loop through the module, determining which arguments are live.
- // We assume all arguments are dead unless proven otherwise (allowing us to
- // determine that dead arguments passed into recursive functions are dead).
- //
- DOUT << "DAE - Determining liveness\n";
- for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I)
- SurveyFunction(*I);
-
- // Loop over the instructions to inspect, propagating liveness among arguments
- // and return values which are MaybeLive.
- while (!InstructionsToInspect.empty()) {
- Instruction *I = InstructionsToInspect.back();
- InstructionsToInspect.pop_back();
-
- if (ReturnInst *RI = dyn_cast<ReturnInst>(I)) {
- // For return instructions, we just have to check to see if the return
- // value for the current function is known now to be alive. If so, any
- // arguments used by it are now alive, and any call instruction return
- // value is alive as well.
- if (LiveRetVal.count(RI->getParent()->getParent()))
- MarkReturnInstArgumentLive(RI);
-
- } else {
- CallSite CS = CallSite::get(I);
- assert(CS.getInstruction() && "Unknown instruction for the I2I list!");
-
- Function *Callee = CS.getCalledFunction();
-
- // If we found a call or invoke instruction on this list, that means that
- // an argument of the function is a call instruction. If the argument is
- // live, then the return value of the called instruction is now live.
- //
- CallSite::arg_iterator AI = CS.arg_begin(); // ActualIterator
- for (Function::arg_iterator FI = Callee->arg_begin(),
- E = Callee->arg_end(); FI != E; ++AI, ++FI) {
- // If this argument is another call...
- CallSite ArgCS = CallSite::get(*AI);
- if (ArgCS.getInstruction() && LiveArguments.count(FI))
- if (Function *Callee = ArgCS.getCalledFunction())
- MarkRetValLive(Callee);
- }
- }
- }
-
- // Now we loop over all of the MaybeLive arguments, promoting them to be live
- // arguments if one of the calls that uses the arguments to the calls they are
- // passed into requires them to be live. Of course this could make other
- // arguments live, so process callers recursively.
- //
- // Because elements can be removed from the MaybeLiveArguments set, copy it to
- // a temporary vector.
- //
- std::vector<Argument*> TmpArgList(MaybeLiveArguments.begin(),
- MaybeLiveArguments.end());
- for (unsigned i = 0, e = TmpArgList.size(); i != e; ++i) {
- Argument *MLA = TmpArgList[i];
- if (MaybeLiveArguments.count(MLA) &&
- isMaybeLiveArgumentNowLive(MLA))
- MarkArgumentLive(MLA);
- }
-
- // Recover memory early...
- CallSites.clear();
-
- // At this point, we know that all arguments in DeadArguments and
- // MaybeLiveArguments are dead. If the two sets are empty, there is nothing
- // to do.
- if (MaybeLiveArguments.empty() && DeadArguments.empty() &&
- MaybeLiveRetVal.empty() && DeadRetVal.empty())
- return Changed;
-
- // Otherwise, compact into one set, and start eliminating the arguments from
- // the functions.
- DeadArguments.insert(MaybeLiveArguments.begin(), MaybeLiveArguments.end());
- MaybeLiveArguments.clear();
- DeadRetVal.insert(MaybeLiveRetVal.begin(), MaybeLiveRetVal.end());
- MaybeLiveRetVal.clear();
-
- LiveArguments.clear();
- LiveRetVal.clear();
-
- NumArgumentsEliminated += DeadArguments.size();
- NumRetValsEliminated += DeadRetVal.size();
- while (!DeadArguments.empty())
- RemoveDeadArgumentsFromFunction((*DeadArguments.begin())->getParent());
-
- while (!DeadRetVal.empty())
- RemoveDeadArgumentsFromFunction(*DeadRetVal.begin());
- return true;
-}
diff --git a/release_23/lib/Transforms/IPO/DeadTypeElimination.cpp b/release_23/lib/Transforms/IPO/DeadTypeElimination.cpp
deleted file mode 100644
index b9d9b547ea3e..000000000000
--- a/release_23/lib/Transforms/IPO/DeadTypeElimination.cpp
+++ /dev/null
@@ -1,106 +0,0 @@
-//===- DeadTypeElimination.cpp - Eliminate unused types for symbol table --===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This pass is used to cleanup the output of GCC. It eliminate names for types
-// that are unused in the entire translation unit, using the FindUsedTypes pass.
-//
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "deadtypeelim"
-#include "llvm/Transforms/IPO.h"
-#include "llvm/Analysis/FindUsedTypes.h"
-#include "llvm/Module.h"
-#include "llvm/TypeSymbolTable.h"
-#include "llvm/DerivedTypes.h"
-#include "llvm/ADT/Statistic.h"
-#include "llvm/Support/Compiler.h"
-using namespace llvm;
-
-STATISTIC(NumKilled, "Number of unused typenames removed from symtab");
-
-namespace {
- struct VISIBILITY_HIDDEN DTE : public ModulePass {
- static char ID; // Pass identification, replacement for typeid
- DTE() : ModulePass((intptr_t)&ID) {}
-
- // doPassInitialization - For this pass, it removes global symbol table
- // entries for primitive types. These are never used for linking in GCC and
- // they make the output uglier to look at, so we nuke them.
- //
- // Also, initialize instance variables.
- //
- bool runOnModule(Module &M);
-
- // getAnalysisUsage - This function needs FindUsedTypes to do its job...
- //
- virtual void getAnalysisUsage(AnalysisUsage &AU) const {
- AU.addRequired<FindUsedTypes>();
- }
- };
- char DTE::ID = 0;
- RegisterPass<DTE> X("deadtypeelim", "Dead Type Elimination");
-}
-
-ModulePass *llvm::createDeadTypeEliminationPass() {
- return new DTE();
-}
-
-
-// ShouldNukeSymtabEntry - Return true if this module level symbol table entry
-// should be eliminated.
-//
-static inline bool ShouldNukeSymtabEntry(const Type *Ty){
- // Nuke all names for primitive types!
- if (Ty->isPrimitiveType() || Ty->isInteger())
- return true;
-
- // Nuke all pointers to primitive types as well...
- if (const PointerType *PT = dyn_cast<PointerType>(Ty))
- if (PT->getElementType()->isPrimitiveType() ||
- PT->getElementType()->isInteger())
- return true;
-
- return false;
-}
-
-// run - For this pass, it removes global symbol table entries for primitive
-// types. These are never used for linking in GCC and they make the output
-// uglier to look at, so we nuke them. Also eliminate types that are never used
-// in the entire program as indicated by FindUsedTypes.
-//
-bool DTE::runOnModule(Module &M) {
- bool Changed = false;
-
- TypeSymbolTable &ST = M.getTypeSymbolTable();
- std::set<const Type *> UsedTypes = getAnalysis<FindUsedTypes>().getTypes();
-
- // Check the symbol table for superfluous type entries...
- //
- // Grab the 'type' plane of the module symbol...
- TypeSymbolTable::iterator TI = ST.begin();
- TypeSymbolTable::iterator TE = ST.end();
- while ( TI != TE ) {
- // If this entry should be unconditionally removed, or if we detect that
- // the type is not used, remove it.
- const Type *RHS = TI->second;
- if (ShouldNukeSymtabEntry(RHS) || !UsedTypes.count(RHS)) {
- ST.remove(TI++);
- ++NumKilled;
- Changed = true;
- } else {
- ++TI;
- // We only need to leave one name for each type.
- UsedTypes.erase(RHS);
- }
- }
-
- return Changed;
-}
-
-// vim: sw=2
diff --git a/release_23/lib/Transforms/IPO/ExtractGV.cpp b/release_23/lib/Transforms/IPO/ExtractGV.cpp
deleted file mode 100644
index 46232b880b1d..000000000000
--- a/release_23/lib/Transforms/IPO/ExtractGV.cpp
+++ /dev/null
@@ -1,175 +0,0 @@
-//===-- ExtractGV.cpp - Global Value extraction pass ----------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This pass extracts global values
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Instructions.h"
-#include "llvm/Module.h"
-#include "llvm/Pass.h"
-#include "llvm/Constants.h"
-#include "llvm/Transforms/IPO.h"
-#include "llvm/Support/Compiler.h"
-#include <algorithm>
-using namespace llvm;
-
-namespace {
- /// @brief A pass to extract specific functions and their dependencies.
- class VISIBILITY_HIDDEN GVExtractorPass : public ModulePass {
- std::vector<GlobalValue*> Named;
- bool deleteStuff;
- bool reLink;
- public:
- static char ID; // Pass identification, replacement for typeid
-
- /// FunctionExtractorPass - If deleteFn is true, this pass deletes as the
- /// specified function. Otherwise, it deletes as much of the module as
- /// possible, except for the function specified.
- ///
- explicit GVExtractorPass(std::vector<GlobalValue*>& GVs, bool deleteS = true,
- bool relinkCallees = false)
- : ModulePass((intptr_t)&ID), Named(GVs), deleteStuff(deleteS),
- reLink(relinkCallees) {}
-
- bool runOnModule(Module &M) {
- if (Named.size() == 0) {
- return false; // Nothing to extract
- }
-
- if (deleteStuff)
- return deleteGV();
- M.setModuleInlineAsm("");
- return isolateGV(M);
- }
-
- bool deleteGV() {
- for (std::vector<GlobalValue*>::iterator GI = Named.begin(),
- GE = Named.end(); GI != GE; ++GI) {
- if (Function* NamedFunc = dyn_cast<Function>(&*GI)) {
- // If we're in relinking mode, set linkage of all internal callees to
- // external. This will allow us extract function, and then - link
- // everything together
- if (reLink) {
- for (Function::iterator B = NamedFunc->begin(), BE = NamedFunc->end();
- B != BE; ++B) {
- for (BasicBlock::iterator I = B->begin(), E = B->end();
- I != E; ++I) {
- if (CallInst* callInst = dyn_cast<CallInst>(&*I)) {
- Function* Callee = callInst->getCalledFunction();
- if (Callee && Callee->hasInternalLinkage())
- Callee->setLinkage(GlobalValue::ExternalLinkage);
- }
- }
- }
- }
-
- NamedFunc->setLinkage(GlobalValue::ExternalLinkage);
- NamedFunc->deleteBody();
- assert(NamedFunc->isDeclaration() && "This didn't make the function external!");
- } else {
- if (!(*GI)->isDeclaration()) {
- cast<GlobalVariable>(*GI)->setInitializer(0); //clear the initializer
- (*GI)->setLinkage(GlobalValue::ExternalLinkage);
- }
- }
- }
- return true;
- }
-
- bool isolateGV(Module &M) {
- // Mark all globals internal
- for (Module::global_iterator I = M.global_begin(), E = M.global_end(); I != E; ++I)
- if (!I->isDeclaration()) {
- I->setLinkage(GlobalValue::InternalLinkage);
- }
- for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I)
- if (!I->isDeclaration()) {
- I->setLinkage(GlobalValue::InternalLinkage);
- }
-
- // Make sure our result is globally accessible...
- // by putting them in the used array
- {
- std::vector<Constant *> AUGs;
- const Type *SBP= PointerType::getUnqual(Type::Int8Ty);
- for (std::vector<GlobalValue*>::iterator GI = Named.begin(),
- GE = Named.end(); GI != GE; ++GI) {
- (*GI)->setLinkage(GlobalValue::ExternalLinkage);
- AUGs.push_back(ConstantExpr::getBitCast(*GI, SBP));
- }
- ArrayType *AT = ArrayType::get(SBP, AUGs.size());
- Constant *Init = ConstantArray::get(AT, AUGs);
- GlobalValue *gv = new GlobalVariable(AT, false,
- GlobalValue::AppendingLinkage,
- Init, "llvm.used", &M);
- gv->setSection("llvm.metadata");
- }
-
- // All of the functions may be used by global variables or the named
- // globals. Loop through them and create a new, external functions that
- // can be "used", instead of ones with bodies.
- std::vector<Function*> NewFunctions;
-
- Function *Last = --M.end(); // Figure out where the last real fn is.
-
- for (Module::iterator I = M.begin(); ; ++I) {
- if (std::find(Named.begin(), Named.end(), &*I) == Named.end()) {
- Function *New = Function::Create(I->getFunctionType(),
- GlobalValue::ExternalLinkage);
- New->setCallingConv(I->getCallingConv());
- New->setParamAttrs(I->getParamAttrs());
- if (I->hasCollector())
- New->setCollector(I->getCollector());
-
- // If it's not the named function, delete the body of the function
- I->dropAllReferences();
-
- M.getFunctionList().push_back(New);
- NewFunctions.push_back(New);
- New->takeName(I);
- }
-
- if (&*I == Last) break; // Stop after processing the last function
- }
-
- // Now that we have replacements all set up, loop through the module,
- // deleting the old functions, replacing them with the newly created
- // functions.
- if (!NewFunctions.empty()) {
- unsigned FuncNum = 0;
- Module::iterator I = M.begin();
- do {
- if (std::find(Named.begin(), Named.end(), &*I) == Named.end()) {
- // Make everything that uses the old function use the new dummy fn
- I->replaceAllUsesWith(NewFunctions[FuncNum++]);
-
- Function *Old = I;
- ++I; // Move the iterator to the new function
-
- // Delete the old function!
- M.getFunctionList().erase(Old);
-
- } else {
- ++I; // Skip the function we are extracting
- }
- } while (&*I != NewFunctions[0]);
- }
-
- return true;
- }
- };
-
- char GVExtractorPass::ID = 0;
-}
-
-ModulePass *llvm::createGVExtractionPass(std::vector<GlobalValue*>& GVs,
- bool deleteFn, bool relinkCallees) {
- return new GVExtractorPass(GVs, deleteFn, relinkCallees);
-}
diff --git a/release_23/lib/Transforms/IPO/GlobalDCE.cpp b/release_23/lib/Transforms/IPO/GlobalDCE.cpp
deleted file mode 100644
index 4e30c105475a..000000000000
--- a/release_23/lib/Transforms/IPO/GlobalDCE.cpp
+++ /dev/null
@@ -1,203 +0,0 @@
-//===-- GlobalDCE.cpp - DCE unreachable internal functions ----------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This transform is designed to eliminate unreachable internal globals from the
-// program. It uses an aggressive algorithm, searching out globals that are
-// known to be alive. After it finds all of the globals which are needed, it
-// deletes whatever is left over. This allows it to delete recursive chunks of
-// the program which are unreachable.
-//
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "globaldce"
-#include "llvm/Transforms/IPO.h"
-#include "llvm/Constants.h"
-#include "llvm/Module.h"
-#include "llvm/Pass.h"
-#include "llvm/ADT/Statistic.h"
-#include "llvm/Support/Compiler.h"
-#include <set>
-using namespace llvm;
-
-STATISTIC(NumFunctions, "Number of functions removed");
-STATISTIC(NumVariables, "Number of global variables removed");
-
-namespace {
- struct VISIBILITY_HIDDEN GlobalDCE : public ModulePass {
- static char ID; // Pass identification, replacement for typeid
- GlobalDCE() : ModulePass((intptr_t)&ID) {}
-
- // run - Do the GlobalDCE pass on the specified module, optionally updating
- // the specified callgraph to reflect the changes.
- //
- bool runOnModule(Module &M);
-
- private:
- std::set<GlobalValue*> AliveGlobals;
-
- /// MarkGlobalIsNeeded - the specific global value as needed, and
- /// recursively mark anything that it uses as also needed.
- void GlobalIsNeeded(GlobalValue *GV);
- void MarkUsedGlobalsAsNeeded(Constant *C);
-
- bool SafeToDestroyConstant(Constant* C);
- bool RemoveUnusedGlobalValue(GlobalValue &GV);
- };
- char GlobalDCE::ID = 0;
- RegisterPass<GlobalDCE> X("globaldce", "Dead Global Elimination");
-}
-
-ModulePass *llvm::createGlobalDCEPass() { return new GlobalDCE(); }
-
-bool GlobalDCE::runOnModule(Module &M) {
- bool Changed = false;
- // Loop over the module, adding globals which are obviously necessary.
- for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I) {
- Changed |= RemoveUnusedGlobalValue(*I);
- // Functions with external linkage are needed if they have a body
- if ((!I->hasInternalLinkage() && !I->hasLinkOnceLinkage()) &&
- !I->isDeclaration())
- GlobalIsNeeded(I);
- }
-
- for (Module::global_iterator I = M.global_begin(), E = M.global_end();
- I != E; ++I) {
- Changed |= RemoveUnusedGlobalValue(*I);
- // Externally visible & appending globals are needed, if they have an
- // initializer.
- if ((!I->hasInternalLinkage() && !I->hasLinkOnceLinkage()) &&
- !I->isDeclaration())
- GlobalIsNeeded(I);
- }
-
-
- for (Module::alias_iterator I = M.alias_begin(), E = M.alias_end();
- I != E; ++I) {
- // Aliases are always needed even if they are not used.
- MarkUsedGlobalsAsNeeded(I->getAliasee());
- }
-
- // Now that all globals which are needed are in the AliveGlobals set, we loop
- // through the program, deleting those which are not alive.
- //
-
- // The first pass is to drop initializers of global variables which are dead.
- std::vector<GlobalVariable*> DeadGlobalVars; // Keep track of dead globals
- for (Module::global_iterator I = M.global_begin(), E = M.global_end(); I != E; ++I)
- if (!AliveGlobals.count(I)) {
- DeadGlobalVars.push_back(I); // Keep track of dead globals
- I->setInitializer(0);
- }
-
-
- // The second pass drops the bodies of functions which are dead...
- std::vector<Function*> DeadFunctions;
- for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I)
- if (!AliveGlobals.count(I)) {
- DeadFunctions.push_back(I); // Keep track of dead globals
- if (!I->isDeclaration())
- I->deleteBody();
- }
-
- if (!DeadFunctions.empty()) {
- // Now that all interreferences have been dropped, delete the actual objects
- // themselves.
- for (unsigned i = 0, e = DeadFunctions.size(); i != e; ++i) {
- RemoveUnusedGlobalValue(*DeadFunctions[i]);
- M.getFunctionList().erase(DeadFunctions[i]);
- }
- NumFunctions += DeadFunctions.size();
- Changed = true;
- }
-
- if (!DeadGlobalVars.empty()) {
- for (unsigned i = 0, e = DeadGlobalVars.size(); i != e; ++i) {
- RemoveUnusedGlobalValue(*DeadGlobalVars[i]);
- M.getGlobalList().erase(DeadGlobalVars[i]);
- }
- NumVariables += DeadGlobalVars.size();
- Changed = true;
- }
-
- // Make sure that all memory is released
- AliveGlobals.clear();
- return Changed;
-}
-
-/// MarkGlobalIsNeeded - the specific global value as needed, and
-/// recursively mark anything that it uses as also needed.
-void GlobalDCE::GlobalIsNeeded(GlobalValue *G) {
- std::set<GlobalValue*>::iterator I = AliveGlobals.lower_bound(G);
-
- // If the global is already in the set, no need to reprocess it.
- if (I != AliveGlobals.end() && *I == G) return;
-
- // Otherwise insert it now, so we do not infinitely recurse
- AliveGlobals.insert(I, G);
-
- if (GlobalVariable *GV = dyn_cast<GlobalVariable>(G)) {
- // If this is a global variable, we must make sure to add any global values
- // referenced by the initializer to the alive set.
- if (GV->hasInitializer())
- MarkUsedGlobalsAsNeeded(GV->getInitializer());
- } else if (!isa<GlobalAlias>(G)) {
- // Otherwise this must be a function object. We have to scan the body of
- // the function looking for constants and global values which are used as
- // operands. Any operands of these types must be processed to ensure that
- // any globals used will be marked as needed.
- Function *F = cast<Function>(G);
- // For all basic blocks...
- for (Function::iterator BB = F->begin(), E = F->end(); BB != E; ++BB)
- // For all instructions...
- for (BasicBlock::iterator I = BB->begin(), E = BB->end(); I != E; ++I)
- // For all operands...
- for (User::op_iterator U = I->op_begin(), E = I->op_end(); U != E; ++U)
- if (GlobalValue *GV = dyn_cast<GlobalValue>(*U))
- GlobalIsNeeded(GV);
- else if (Constant *C = dyn_cast<Constant>(*U))
- MarkUsedGlobalsAsNeeded(C);
- }
-}
-
-void GlobalDCE::MarkUsedGlobalsAsNeeded(Constant *C) {
- if (GlobalValue *GV = dyn_cast<GlobalValue>(C))
- GlobalIsNeeded(GV);
- else {
- // Loop over all of the operands of the constant, adding any globals they
- // use to the list of needed globals.
- for (User::op_iterator I = C->op_begin(), E = C->op_end(); I != E; ++I)
- MarkUsedGlobalsAsNeeded(cast<Constant>(*I));
- }
-}
-
-// RemoveUnusedGlobalValue - Loop over all of the uses of the specified
-// GlobalValue, looking for the constant pointer ref that may be pointing to it.
-// If found, check to see if the constant pointer ref is safe to destroy, and if
-// so, nuke it. This will reduce the reference count on the global value, which
-// might make it deader.
-//
-bool GlobalDCE::RemoveUnusedGlobalValue(GlobalValue &GV) {
- if (GV.use_empty()) return false;
- GV.removeDeadConstantUsers();
- return GV.use_empty();
-}
-
-// SafeToDestroyConstant - It is safe to destroy a constant iff it is only used
-// by constants itself. Note that constants cannot be cyclic, so this test is
-// pretty easy to implement recursively.
-//
-bool GlobalDCE::SafeToDestroyConstant(Constant *C) {
- for (Value::use_iterator I = C->use_begin(), E = C->use_end(); I != E; ++I)
- if (Constant *User = dyn_cast<Constant>(*I)) {
- if (!SafeToDestroyConstant(User)) return false;
- } else {
- return false;
- }
- return true;
-}
diff --git a/release_23/lib/Transforms/IPO/GlobalOpt.cpp b/release_23/lib/Transforms/IPO/GlobalOpt.cpp
deleted file mode 100644
index 600be26620a8..000000000000
--- a/release_23/lib/Transforms/IPO/GlobalOpt.cpp
+++ /dev/null
@@ -1,2234 +0,0 @@
-//===- GlobalOpt.cpp - Optimize Global Variables --------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This pass transforms simple global variables that never have their address
-// taken. If obviously true, it marks read/write globals as constant, deletes
-// variables only stored to, etc.
-//
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "globalopt"
-#include "llvm/Transforms/IPO.h"
-#include "llvm/CallingConv.h"
-#include "llvm/Constants.h"
-#include "llvm/DerivedTypes.h"
-#include "llvm/Instructions.h"
-#include "llvm/IntrinsicInst.h"
-#include "llvm/Module.h"
-#include "llvm/Pass.h"
-#include "llvm/Analysis/ConstantFolding.h"
-#include "llvm/Target/TargetData.h"
-#include "llvm/Support/CallSite.h"
-#include "llvm/Support/Compiler.h"
-#include "llvm/Support/Debug.h"
-#include "llvm/Support/GetElementPtrTypeIterator.h"
-#include "llvm/Support/MathExtras.h"
-#include "llvm/ADT/SmallPtrSet.h"
-#include "llvm/ADT/SmallVector.h"
-#include "llvm/ADT/Statistic.h"
-#include "llvm/ADT/StringExtras.h"
-#include <algorithm>
-#include <map>
-#include <set>
-using namespace llvm;
-
-STATISTIC(NumMarked , "Number of globals marked constant");
-STATISTIC(NumSRA , "Number of aggregate globals broken into scalars");
-STATISTIC(NumHeapSRA , "Number of heap objects SRA'd");
-STATISTIC(NumSubstitute,"Number of globals with initializers stored into them");
-STATISTIC(NumDeleted , "Number of globals deleted");
-STATISTIC(NumFnDeleted , "Number of functions deleted");
-STATISTIC(NumGlobUses , "Number of global uses devirtualized");
-STATISTIC(NumLocalized , "Number of globals localized");
-STATISTIC(NumShrunkToBool , "Number of global vars shrunk to booleans");
-STATISTIC(NumFastCallFns , "Number of functions converted to fastcc");
-STATISTIC(NumCtorsEvaluated, "Number of static ctors evaluated");
-STATISTIC(NumNestRemoved , "Number of nest attributes removed");
-
-namespace {
- struct VISIBILITY_HIDDEN GlobalOpt : public ModulePass {
- virtual void getAnalysisUsage(AnalysisUsage &AU) const {
- AU.addRequired<TargetData>();
- }
- static char ID; // Pass identification, replacement for typeid
- GlobalOpt() : ModulePass((intptr_t)&ID) {}
-
- bool runOnModule(Module &M);
-
- private:
- GlobalVariable *FindGlobalCtors(Module &M);
- bool OptimizeFunctions(Module &M);
- bool OptimizeGlobalVars(Module &M);
- bool OptimizeGlobalCtorsList(GlobalVariable *&GCL);
- bool ProcessInternalGlobal(GlobalVariable *GV,Module::global_iterator &GVI);
- };
-
- char GlobalOpt::ID = 0;
- RegisterPass<GlobalOpt> X("globalopt", "Global Variable Optimizer");
-}
-
-ModulePass *llvm::createGlobalOptimizerPass() { return new GlobalOpt(); }
-
-/// GlobalStatus - As we analyze each global, keep track of some information
-/// about it. If we find out that the address of the global is taken, none of
-/// this info will be accurate.
-struct VISIBILITY_HIDDEN GlobalStatus {
- /// isLoaded - True if the global is ever loaded. If the global isn't ever
- /// loaded it can be deleted.
- bool isLoaded;
-
- /// StoredType - Keep track of what stores to the global look like.
- ///
- enum StoredType {
- /// NotStored - There is no store to this global. It can thus be marked
- /// constant.
- NotStored,
-
- /// isInitializerStored - This global is stored to, but the only thing
- /// stored is the constant it was initialized with. This is only tracked
- /// for scalar globals.
- isInitializerStored,
-
- /// isStoredOnce - This global is stored to, but only its initializer and
- /// one other value is ever stored to it. If this global isStoredOnce, we
- /// track the value stored to it in StoredOnceValue below. This is only
- /// tracked for scalar globals.
- isStoredOnce,
-
- /// isStored - This global is stored to by multiple values or something else
- /// that we cannot track.
- isStored
- } StoredType;
-
- /// StoredOnceValue - If only one value (besides the initializer constant) is
- /// ever stored to this global, keep track of what value it is.
- Value *StoredOnceValue;
-
- /// AccessingFunction/HasMultipleAccessingFunctions - These start out
- /// null/false. When the first accessing function is noticed, it is recorded.
- /// When a second different accessing function is noticed,
- /// HasMultipleAccessingFunctions is set to true.
- Function *AccessingFunction;
- bool HasMultipleAccessingFunctions;
-
- /// HasNonInstructionUser - Set to true if this global has a user that is not
- /// an instruction (e.g. a constant expr or GV initializer).
- bool HasNonInstructionUser;
-
- /// HasPHIUser - Set to true if this global has a user that is a PHI node.
- bool HasPHIUser;
-
- GlobalStatus() : isLoaded(false), StoredType(NotStored), StoredOnceValue(0),
- AccessingFunction(0), HasMultipleAccessingFunctions(false),
- HasNonInstructionUser(false), HasPHIUser(false) {}
-};
-
-
-
-/// ConstantIsDead - Return true if the specified constant is (transitively)
-/// dead. The constant may be used by other constants (e.g. constant arrays and
-/// constant exprs) as long as they are dead, but it cannot be used by anything
-/// else.
-static bool ConstantIsDead(Constant *C) {
- if (isa<GlobalValue>(C)) return false;
-
- for (Value::use_iterator UI = C->use_begin(), E = C->use_end(); UI != E; ++UI)
- if (Constant *CU = dyn_cast<Constant>(*UI)) {
- if (!ConstantIsDead(CU)) return false;
- } else
- return false;
- return true;
-}
-
-
-/// AnalyzeGlobal - Look at all uses of the global and fill in the GlobalStatus
-/// structure. If the global has its address taken, return true to indicate we
-/// can't do anything with it.
-///
-static bool AnalyzeGlobal(Value *V, GlobalStatus &GS,
- std::set<PHINode*> &PHIUsers) {
- for (Value::use_iterator UI = V->use_begin(), E = V->use_end(); UI != E; ++UI)
- if (ConstantExpr *CE = dyn_cast<ConstantExpr>(*UI)) {
- GS.HasNonInstructionUser = true;
-
- if (AnalyzeGlobal(CE, GS, PHIUsers)) return true;
-
- } else if (Instruction *I = dyn_cast<Instruction>(*UI)) {
- if (!GS.HasMultipleAccessingFunctions) {
- Function *F = I->getParent()->getParent();
- if (GS.AccessingFunction == 0)
- GS.AccessingFunction = F;
- else if (GS.AccessingFunction != F)
- GS.HasMultipleAccessingFunctions = true;
- }
- if (LoadInst *LI = dyn_cast<LoadInst>(I)) {
- GS.isLoaded = true;
- if (LI->isVolatile()) return true; // Don't hack on volatile loads.
- } else if (StoreInst *SI = dyn_cast<StoreInst>(I)) {
- // Don't allow a store OF the address, only stores TO the address.
- if (SI->getOperand(0) == V) return true;
-
- if (SI->isVolatile()) return true; // Don't hack on volatile stores.
-
- // If this is a direct store to the global (i.e., the global is a scalar
- // value, not an aggregate), keep more specific information about
- // stores.
- if (GS.StoredType != GlobalStatus::isStored) {
- if (GlobalVariable *GV = dyn_cast<GlobalVariable>(SI->getOperand(1))){
- Value *StoredVal = SI->getOperand(0);
- if (StoredVal == GV->getInitializer()) {
- if (GS.StoredType < GlobalStatus::isInitializerStored)
- GS.StoredType = GlobalStatus::isInitializerStored;
- } else if (isa<LoadInst>(StoredVal) &&
- cast<LoadInst>(StoredVal)->getOperand(0) == GV) {
- // G = G
- if (GS.StoredType < GlobalStatus::isInitializerStored)
- GS.StoredType = GlobalStatus::isInitializerStored;
- } else if (GS.StoredType < GlobalStatus::isStoredOnce) {
- GS.StoredType = GlobalStatus::isStoredOnce;
- GS.StoredOnceValue = StoredVal;
- } else if (GS.StoredType == GlobalStatus::isStoredOnce &&
- GS.StoredOnceValue == StoredVal) {
- // noop.
- } else {
- GS.StoredType = GlobalStatus::isStored;
- }
- } else {
- GS.StoredType = GlobalStatus::isStored;
- }
- }
- } else if (isa<GetElementPtrInst>(I)) {
- if (AnalyzeGlobal(I, GS, PHIUsers)) return true;
- } else if (isa<SelectInst>(I)) {
- if (AnalyzeGlobal(I, GS, PHIUsers)) return true;
- } else if (PHINode *PN = dyn_cast<PHINode>(I)) {
- // PHI nodes we can check just like select or GEP instructions, but we
- // have to be careful about infinite recursion.
- if (PHIUsers.insert(PN).second) // Not already visited.
- if (AnalyzeGlobal(I, GS, PHIUsers)) return true;
- GS.HasPHIUser = true;
- } else if (isa<CmpInst>(I)) {
- } else if (isa<MemCpyInst>(I) || isa<MemMoveInst>(I)) {
- if (I->getOperand(1) == V)
- GS.StoredType = GlobalStatus::isStored;
- if (I->getOperand(2) == V)
- GS.isLoaded = true;
- } else if (isa<MemSetInst>(I)) {
- assert(I->getOperand(1) == V && "Memset only takes one pointer!");
- GS.StoredType = GlobalStatus::isStored;
- } else {
- return true; // Any other non-load instruction might take address!
- }
- } else if (Constant *C = dyn_cast<Constant>(*UI)) {
- GS.HasNonInstructionUser = true;
- // We might have a dead and dangling constant hanging off of here.
- if (!ConstantIsDead(C))
- return true;
- } else {
- GS.HasNonInstructionUser = true;
- // Otherwise must be some other user.
- return true;
- }
-
- return false;
-}
-
-static Constant *getAggregateConstantElement(Constant *Agg, Constant *Idx) {
- ConstantInt *CI = dyn_cast<ConstantInt>(Idx);
- if (!CI) return 0;
- unsigned IdxV = CI->getZExtValue();
-
- if (ConstantStruct *CS = dyn_cast<ConstantStruct>(Agg)) {
- if (IdxV < CS->getNumOperands()) return CS->getOperand(IdxV);
- } else if (ConstantArray *CA = dyn_cast<ConstantArray>(Agg)) {
- if (IdxV < CA->getNumOperands()) return CA->getOperand(IdxV);
- } else if (ConstantVector *CP = dyn_cast<ConstantVector>(Agg)) {
- if (IdxV < CP->getNumOperands()) return CP->getOperand(IdxV);
- } else if (isa<ConstantAggregateZero>(Agg)) {
- if (const StructType *STy = dyn_cast<StructType>(Agg->getType())) {
- if (IdxV < STy->getNumElements())
- return Constant::getNullValue(STy->getElementType(IdxV));
- } else if (const SequentialType *STy =
- dyn_cast<SequentialType>(Agg->getType())) {
- return Constant::getNullValue(STy->getElementType());
- }
- } else if (isa<UndefValue>(Agg)) {
- if (const StructType *STy = dyn_cast<StructType>(Agg->getType())) {
- if (IdxV < STy->getNumElements())
- return UndefValue::get(STy->getElementType(IdxV));
- } else if (const SequentialType *STy =
- dyn_cast<SequentialType>(Agg->getType())) {
- return UndefValue::get(STy->getElementType());
- }
- }
- return 0;
-}
-
-
-/// CleanupConstantGlobalUsers - We just marked GV constant. Loop over all
-/// users of the global, cleaning up the obvious ones. This is largely just a
-/// quick scan over the use list to clean up the easy and obvious cruft. This
-/// returns true if it made a change.
-static bool CleanupConstantGlobalUsers(Value *V, Constant *Init) {
- bool Changed = false;
- for (Value::use_iterator UI = V->use_begin(), E = V->use_end(); UI != E;) {
- User *U = *UI++;
-
- if (LoadInst *LI = dyn_cast<LoadInst>(U)) {
- if (Init) {
- // Replace the load with the initializer.
- LI->replaceAllUsesWith(Init);
- LI->eraseFromParent();
- Changed = true;
- }
- } else if (StoreInst *SI = dyn_cast<StoreInst>(U)) {
- // Store must be unreachable or storing Init into the global.
- SI->eraseFromParent();
- Changed = true;
- } else if (ConstantExpr *CE = dyn_cast<ConstantExpr>(U)) {
- if (CE->getOpcode() == Instruction::GetElementPtr) {
- Constant *SubInit = 0;
- if (Init)
- SubInit = ConstantFoldLoadThroughGEPConstantExpr(Init, CE);
- Changed |= CleanupConstantGlobalUsers(CE, SubInit);
- } else if (CE->getOpcode() == Instruction::BitCast &&
- isa<PointerType>(CE->getType())) {
- // Pointer cast, delete any stores and memsets to the global.
- Changed |= CleanupConstantGlobalUsers(CE, 0);
- }
-
- if (CE->use_empty()) {
- CE->destroyConstant();
- Changed = true;
- }
- } else if (GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(U)) {
- // Do not transform "gepinst (gep constexpr (GV))" here, because forming
- // "gepconstexpr (gep constexpr (GV))" will cause the two gep's to fold
- // and will invalidate our notion of what Init is.
- Constant *SubInit = 0;
- if (!isa<ConstantExpr>(GEP->getOperand(0))) {
- ConstantExpr *CE =
- dyn_cast_or_null<ConstantExpr>(ConstantFoldInstruction(GEP));
- if (Init && CE && CE->getOpcode() == Instruction::GetElementPtr)
- SubInit = ConstantFoldLoadThroughGEPConstantExpr(Init, CE);
- }
- Changed |= CleanupConstantGlobalUsers(GEP, SubInit);
-
- if (GEP->use_empty()) {
- GEP->eraseFromParent();
- Changed = true;
- }
- } else if (MemIntrinsic *MI = dyn_cast<MemIntrinsic>(U)) { // memset/cpy/mv
- if (MI->getRawDest() == V) {
- MI->eraseFromParent();
- Changed = true;
- }
-
- } else if (Constant *C = dyn_cast<Constant>(U)) {
- // If we have a chain of dead constantexprs or other things dangling from
- // us, and if they are all dead, nuke them without remorse.
- if (ConstantIsDead(C)) {
- C->destroyConstant();
- // This could have invalidated UI, start over from scratch.
- CleanupConstantGlobalUsers(V, Init);
- return true;
- }
- }
- }
- return Changed;
-}
-
-/// isSafeSROAElementUse - Return true if the specified instruction is a safe
-/// user of a derived expression from a global that we want to SROA.
-static bool isSafeSROAElementUse(Value *V) {
- // We might have a dead and dangling constant hanging off of here.
- if (Constant *C = dyn_cast<Constant>(V))
- return ConstantIsDead(C);
-
- Instruction *I = dyn_cast<Instruction>(V);
- if (!I) return false;
-
- // Loads are ok.
- if (isa<LoadInst>(I)) return true;
-
- // Stores *to* the pointer are ok.
- if (StoreInst *SI = dyn_cast<StoreInst>(I))
- return SI->getOperand(0) != V;
-
- // Otherwise, it must be a GEP.
- GetElementPtrInst *GEPI = dyn_cast<GetElementPtrInst>(I);
- if (GEPI == 0) return false;
-
- if (GEPI->getNumOperands() < 3 || !isa<Constant>(GEPI->getOperand(1)) ||
- !cast<Constant>(GEPI->getOperand(1))->isNullValue())
- return false;
-
- for (Value::use_iterator I = GEPI->use_begin(), E = GEPI->use_end();
- I != E; ++I)
- if (!isSafeSROAElementUse(*I))
- return false;
- return true;
-}
-
-
-/// IsUserOfGlobalSafeForSRA - U is a direct user of the specified global value.
-/// Look at it and its uses and decide whether it is safe to SROA this global.
-///
-static bool IsUserOfGlobalSafeForSRA(User *U, GlobalValue *GV) {
- // The user of the global must be a GEP Inst or a ConstantExpr GEP.
- if (!isa<GetElementPtrInst>(U) &&
- (!isa<ConstantExpr>(U) ||
- cast<ConstantExpr>(U)->getOpcode() != Instruction::GetElementPtr))
- return false;
-
- // Check to see if this ConstantExpr GEP is SRA'able. In particular, we
- // don't like < 3 operand CE's, and we don't like non-constant integer
- // indices. This enforces that all uses are 'gep GV, 0, C, ...' for some
- // value of C.
- if (U->getNumOperands() < 3 || !isa<Constant>(U->getOperand(1)) ||
- !cast<Constant>(U->getOperand(1))->isNullValue() ||
- !isa<ConstantInt>(U->getOperand(2)))
- return false;
-
- gep_type_iterator GEPI = gep_type_begin(U), E = gep_type_end(U);
- ++GEPI; // Skip over the pointer index.
-
- // If this is a use of an array allocation, do a bit more checking for sanity.
- if (const ArrayType *AT = dyn_cast<ArrayType>(*GEPI)) {
- uint64_t NumElements = AT->getNumElements();
- ConstantInt *Idx = cast<ConstantInt>(U->getOperand(2));
-
- // Check to make sure that index falls within the array. If not,
- // something funny is going on, so we won't do the optimization.
- //
- if (Idx->getZExtValue() >= NumElements)
- return false;
-
- // We cannot scalar repl this level of the array unless any array
- // sub-indices are in-range constants. In particular, consider:
- // A[0][i]. We cannot know that the user isn't doing invalid things like
- // allowing i to index an out-of-range subscript that accesses A[1].
- //
- // Scalar replacing *just* the outer index of the array is probably not
- // going to be a win anyway, so just give up.
- for (++GEPI; // Skip array index.
- GEPI != E && (isa<ArrayType>(*GEPI) || isa<VectorType>(*GEPI));
- ++GEPI) {
- uint64_t NumElements;
- if (const ArrayType *SubArrayTy = dyn_cast<ArrayType>(*GEPI))
- NumElements = SubArrayTy->getNumElements();
- else
- NumElements = cast<VectorType>(*GEPI)->getNumElements();
-
- ConstantInt *IdxVal = dyn_cast<ConstantInt>(GEPI.getOperand());
- if (!IdxVal || IdxVal->getZExtValue() >= NumElements)
- return false;
- }
- }
-
- for (Value::use_iterator I = U->use_begin(), E = U->use_end(); I != E; ++I)
- if (!isSafeSROAElementUse(*I))
- return false;
- return true;
-}
-
-/// GlobalUsersSafeToSRA - Look at all uses of the global and decide whether it
-/// is safe for us to perform this transformation.
-///
-static bool GlobalUsersSafeToSRA(GlobalValue *GV) {
- for (Value::use_iterator UI = GV->use_begin(), E = GV->use_end();
- UI != E; ++UI) {
- if (!IsUserOfGlobalSafeForSRA(*UI, GV))
- return false;
- }
- return true;
-}
-
-
-/// SRAGlobal - Perform scalar replacement of aggregates on the specified global
-/// variable. This opens the door for other optimizations by exposing the
-/// behavior of the program in a more fine-grained way. We have determined that
-/// this transformation is safe already. We return the first global variable we
-/// insert so that the caller can reprocess it.
-static GlobalVariable *SRAGlobal(GlobalVariable *GV, const TargetData &TD) {
- // Make sure this global only has simple uses that we can SRA.
- if (!GlobalUsersSafeToSRA(GV))
- return 0;
-
- assert(GV->hasInternalLinkage() && !GV->isConstant());
- Constant *Init = GV->getInitializer();
- const Type *Ty = Init->getType();
-
- std::vector<GlobalVariable*> NewGlobals;
- Module::GlobalListType &Globals = GV->getParent()->getGlobalList();
-
- // Get the alignment of the global, either explicit or target-specific.
- unsigned StartAlignment = GV->getAlignment();
- if (StartAlignment == 0)
- StartAlignment = TD.getABITypeAlignment(GV->getType());
-
- if (const StructType *STy = dyn_cast<StructType>(Ty)) {
- NewGlobals.reserve(STy->getNumElements());
- const StructLayout &Layout = *TD.getStructLayout(STy);
- for (unsigned i = 0, e = STy->getNumElements(); i != e; ++i) {
- Constant *In = getAggregateConstantElement(Init,
- ConstantInt::get(Type::Int32Ty, i));
- assert(In && "Couldn't get element of initializer?");
- GlobalVariable *NGV = new GlobalVariable(STy->getElementType(i), false,
- GlobalVariable::InternalLinkage,
- In, GV->getName()+"."+utostr(i),
- (Module *)NULL,
- GV->isThreadLocal());
- Globals.insert(GV, NGV);
- NewGlobals.push_back(NGV);
-
- // Calculate the known alignment of the field. If the original aggregate
- // had 256 byte alignment for example, something might depend on that:
- // propagate info to each field.
- uint64_t FieldOffset = Layout.getElementOffset(i);
- unsigned NewAlign = (unsigned)MinAlign(StartAlignment, FieldOffset);
- if (NewAlign > TD.getABITypeAlignment(STy->getElementType(i)))
- NGV->setAlignment(NewAlign);
- }
- } else if (const SequentialType *STy = dyn_cast<SequentialType>(Ty)) {
- unsigned NumElements = 0;
- if (const ArrayType *ATy = dyn_cast<ArrayType>(STy))
- NumElements = ATy->getNumElements();
- else
- NumElements = cast<VectorType>(STy)->getNumElements();
-
- if (NumElements > 16 && GV->hasNUsesOrMore(16))
- return 0; // It's not worth it.
- NewGlobals.reserve(NumElements);
-
- uint64_t EltSize = TD.getABITypeSize(STy->getElementType());
- unsigned EltAlign = TD.getABITypeAlignment(STy->getElementType());
- for (unsigned i = 0, e = NumElements; i != e; ++i) {
- Constant *In = getAggregateConstantElement(Init,
- ConstantInt::get(Type::Int32Ty, i));
- assert(In && "Couldn't get element of initializer?");
-
- GlobalVariable *NGV = new GlobalVariable(STy->getElementType(), false,
- GlobalVariable::InternalLinkage,
- In, GV->getName()+"."+utostr(i),
- (Module *)NULL,
- GV->isThreadLocal());
- Globals.insert(GV, NGV);
- NewGlobals.push_back(NGV);
-
- // Calculate the known alignment of the field. If the original aggregate
- // had 256 byte alignment for example, something might depend on that:
- // propagate info to each field.
- unsigned NewAlign = (unsigned)MinAlign(StartAlignment, EltSize*i);
- if (NewAlign > EltAlign)
- NGV->setAlignment(NewAlign);
- }
- }
-
- if (NewGlobals.empty())
- return 0;
-
- DOUT << "PERFORMING GLOBAL SRA ON: " << *GV;
-
- Constant *NullInt = Constant::getNullValue(Type::Int32Ty);
-
- // Loop over all of the uses of the global, replacing the constantexpr geps,
- // with smaller constantexpr geps or direct references.
- while (!GV->use_empty()) {
- User *GEP = GV->use_back();
- assert(((isa<ConstantExpr>(GEP) &&
- cast<ConstantExpr>(GEP)->getOpcode()==Instruction::GetElementPtr)||
- isa<GetElementPtrInst>(GEP)) && "NonGEP CE's are not SRAable!");
-
- // Ignore the 1th operand, which has to be zero or else the program is quite
- // broken (undefined). Get the 2nd operand, which is the structure or array
- // index.
- unsigned Val = cast<ConstantInt>(GEP->getOperand(2))->getZExtValue();
- if (Val >= NewGlobals.size()) Val = 0; // Out of bound array access.
-
- Value *NewPtr = NewGlobals[Val];
-
- // Form a shorter GEP if needed.
- if (GEP->getNumOperands() > 3) {
- if (ConstantExpr *CE = dyn_cast<ConstantExpr>(GEP)) {
- SmallVector<Constant*, 8> Idxs;
- Idxs.push_back(NullInt);
- for (unsigned i = 3, e = CE->getNumOperands(); i != e; ++i)
- Idxs.push_back(CE->getOperand(i));
- NewPtr = ConstantExpr::getGetElementPtr(cast<Constant>(NewPtr),
- &Idxs[0], Idxs.size());
- } else {
- GetElementPtrInst *GEPI = cast<GetElementPtrInst>(GEP);
- SmallVector<Value*, 8> Idxs;
- Idxs.push_back(NullInt);
- for (unsigned i = 3, e = GEPI->getNumOperands(); i != e; ++i)
- Idxs.push_back(GEPI->getOperand(i));
- NewPtr = GetElementPtrInst::Create(NewPtr, Idxs.begin(), Idxs.end(),
- GEPI->getName()+"."+utostr(Val), GEPI);
- }
- }
- GEP->replaceAllUsesWith(NewPtr);
-
- if (GetElementPtrInst *GEPI = dyn_cast<GetElementPtrInst>(GEP))
- GEPI->eraseFromParent();
- else
- cast<ConstantExpr>(GEP)->destroyConstant();
- }
-
- // Delete the old global, now that it is dead.
- Globals.erase(GV);
- ++NumSRA;
-
- // Loop over the new globals array deleting any globals that are obviously
- // dead. This can arise due to scalarization of a structure or an array that
- // has elements that are dead.
- unsigned FirstGlobal = 0;
- for (unsigned i = 0, e = NewGlobals.size(); i != e; ++i)
- if (NewGlobals[i]->use_empty()) {
- Globals.erase(NewGlobals[i]);
- if (FirstGlobal == i) ++FirstGlobal;
- }
-
- return FirstGlobal != NewGlobals.size() ? NewGlobals[FirstGlobal] : 0;
-}
-
-/// AllUsesOfValueWillTrapIfNull - Return true if all users of the specified
-/// value will trap if the value is dynamically null. PHIs keeps track of any
-/// phi nodes we've seen to avoid reprocessing them.
-static bool AllUsesOfValueWillTrapIfNull(Value *V,
- SmallPtrSet<PHINode*, 8> &PHIs) {
- for (Value::use_iterator UI = V->use_begin(), E = V->use_end(); UI != E; ++UI)
- if (isa<LoadInst>(*UI)) {
- // Will trap.
- } else if (StoreInst *SI = dyn_cast<StoreInst>(*UI)) {
- if (SI->getOperand(0) == V) {
- //cerr << "NONTRAPPING USE: " << **UI;
- return false; // Storing the value.
- }
- } else if (CallInst *CI = dyn_cast<CallInst>(*UI)) {
- if (CI->getOperand(0) != V) {
- //cerr << "NONTRAPPING USE: " << **UI;
- return false; // Not calling the ptr
- }
- } else if (InvokeInst *II = dyn_cast<InvokeInst>(*UI)) {
- if (II->getOperand(0) != V) {
- //cerr << "NONTRAPPING USE: " << **UI;
- return false; // Not calling the ptr
- }
- } else if (BitCastInst *CI = dyn_cast<BitCastInst>(*UI)) {
- if (!AllUsesOfValueWillTrapIfNull(CI, PHIs)) return false;
- } else if (GetElementPtrInst *GEPI = dyn_cast<GetElementPtrInst>(*UI)) {
- if (!AllUsesOfValueWillTrapIfNull(GEPI, PHIs)) return false;
- } else if (PHINode *PN = dyn_cast<PHINode>(*UI)) {
- // If we've already seen this phi node, ignore it, it has already been
- // checked.
- if (PHIs.insert(PN))
- return AllUsesOfValueWillTrapIfNull(PN, PHIs);
- } else if (isa<ICmpInst>(*UI) &&
- isa<ConstantPointerNull>(UI->getOperand(1))) {
- // Ignore setcc X, null
- } else {
- //cerr << "NONTRAPPING USE: " << **UI;
- return false;
- }
- return true;
-}
-
-/// AllUsesOfLoadedValueWillTrapIfNull - Return true if all uses of any loads
-/// from GV will trap if the loaded value is null. Note that this also permits
-/// comparisons of the loaded value against null, as a special case.
-static bool AllUsesOfLoadedValueWillTrapIfNull(GlobalVariable *GV) {
- for (Value::use_iterator UI = GV->use_begin(), E = GV->use_end(); UI!=E; ++UI)
- if (LoadInst *LI = dyn_cast<LoadInst>(*UI)) {
- SmallPtrSet<PHINode*, 8> PHIs;
- if (!AllUsesOfValueWillTrapIfNull(LI, PHIs))
- return false;
- } else if (isa<StoreInst>(*UI)) {
- // Ignore stores to the global.
- } else {
- // We don't know or understand this user, bail out.
- //cerr << "UNKNOWN USER OF GLOBAL!: " << **UI;
- return false;
- }
-
- return true;
-}
-
-static bool OptimizeAwayTrappingUsesOfValue(Value *V, Constant *NewV) {
- bool Changed = false;
- for (Value::use_iterator UI = V->use_begin(), E = V->use_end(); UI != E; ) {
- Instruction *I = cast<Instruction>(*UI++);
- if (LoadInst *LI = dyn_cast<LoadInst>(I)) {
- LI->setOperand(0, NewV);
- Changed = true;
- } else if (StoreInst *SI = dyn_cast<StoreInst>(I)) {
- if (SI->getOperand(1) == V) {
- SI->setOperand(1, NewV);
- Changed = true;
- }
- } else if (isa<CallInst>(I) || isa<InvokeInst>(I)) {
- if (I->getOperand(0) == V) {
- // Calling through the pointer! Turn into a direct call, but be careful
- // that the pointer is not also being passed as an argument.
- I->setOperand(0, NewV);
- Changed = true;
- bool PassedAsArg = false;
- for (unsigned i = 1, e = I->getNumOperands(); i != e; ++i)
- if (I->getOperand(i) == V) {
- PassedAsArg = true;
- I->setOperand(i, NewV);
- }
-
- if (PassedAsArg) {
- // Being passed as an argument also. Be careful to not invalidate UI!
- UI = V->use_begin();
- }
- }
- } else if (CastInst *CI = dyn_cast<CastInst>(I)) {
- Changed |= OptimizeAwayTrappingUsesOfValue(CI,
- ConstantExpr::getCast(CI->getOpcode(),
- NewV, CI->getType()));
- if (CI->use_empty()) {
- Changed = true;
- CI->eraseFromParent();
- }
- } else if (GetElementPtrInst *GEPI = dyn_cast<GetElementPtrInst>(I)) {
- // Should handle GEP here.
- SmallVector<Constant*, 8> Idxs;
- Idxs.reserve(GEPI->getNumOperands()-1);
- for (unsigned i = 1, e = GEPI->getNumOperands(); i != e; ++i)
- if (Constant *C = dyn_cast<Constant>(GEPI->getOperand(i)))
- Idxs.push_back(C);
- else
- break;
- if (Idxs.size() == GEPI->getNumOperands()-1)
- Changed |= OptimizeAwayTrappingUsesOfValue(GEPI,
- ConstantExpr::getGetElementPtr(NewV, &Idxs[0],
- Idxs.size()));
- if (GEPI->use_empty()) {
- Changed = true;
- GEPI->eraseFromParent();
- }
- }
- }
-
- return Changed;
-}
-
-
-/// OptimizeAwayTrappingUsesOfLoads - The specified global has only one non-null
-/// value stored into it. If there are uses of the loaded value that would trap
-/// if the loaded value is dynamically null, then we know that they cannot be
-/// reachable with a null optimize away the load.
-static bool OptimizeAwayTrappingUsesOfLoads(GlobalVariable *GV, Constant *LV) {
- std::vector<LoadInst*> Loads;
- bool Changed = false;
-
- // Replace all uses of loads with uses of uses of the stored value.
- for (Value::use_iterator GUI = GV->use_begin(), E = GV->use_end();
- GUI != E; ++GUI)
- if (LoadInst *LI = dyn_cast<LoadInst>(*GUI)) {
- Loads.push_back(LI);
- Changed |= OptimizeAwayTrappingUsesOfValue(LI, LV);
- } else {
- // If we get here we could have stores, selects, or phi nodes whose values
- // are loaded.
- assert((isa<StoreInst>(*GUI) || isa<PHINode>(*GUI) ||
- isa<SelectInst>(*GUI) || isa<ConstantExpr>(*GUI)) &&
- "Only expect load and stores!");
- }
-
- if (Changed) {
- DOUT << "OPTIMIZED LOADS FROM STORED ONCE POINTER: " << *GV;
- ++NumGlobUses;
- }
-
- // Delete all of the loads we can, keeping track of whether we nuked them all!
- bool AllLoadsGone = true;
- while (!Loads.empty()) {
- LoadInst *L = Loads.back();
- if (L->use_empty()) {
- L->eraseFromParent();
- Changed = true;
- } else {
- AllLoadsGone = false;
- }
- Loads.pop_back();
- }
-
- // If we nuked all of the loads, then none of the stores are needed either,
- // nor is the global.
- if (AllLoadsGone) {
- DOUT << " *** GLOBAL NOW DEAD!\n";
- CleanupConstantGlobalUsers(GV, 0);
- if (GV->use_empty()) {
- GV->eraseFromParent();
- ++NumDeleted;
- }
- Changed = true;
- }
- return Changed;
-}
-
-/// ConstantPropUsersOf - Walk the use list of V, constant folding all of the
-/// instructions that are foldable.
-static void ConstantPropUsersOf(Value *V) {
- for (Value::use_iterator UI = V->use_begin(), E = V->use_end(); UI != E; )
- if (Instruction *I = dyn_cast<Instruction>(*UI++))
- if (Constant *NewC = ConstantFoldInstruction(I)) {
- I->replaceAllUsesWith(NewC);
-
- // Advance UI to the next non-I use to avoid invalidating it!
- // Instructions could multiply use V.
- while (UI != E && *UI == I)
- ++UI;
- I->eraseFromParent();
- }
-}
-
-/// OptimizeGlobalAddressOfMalloc - This function takes the specified global
-/// variable, and transforms the program as if it always contained the result of
-/// the specified malloc. Because it is always the result of the specified
-/// malloc, there is no reason to actually DO the malloc. Instead, turn the
-/// malloc into a global, and any loads of GV as uses of the new global.
-static GlobalVariable *OptimizeGlobalAddressOfMalloc(GlobalVariable *GV,
- MallocInst *MI) {
- DOUT << "PROMOTING MALLOC GLOBAL: " << *GV << " MALLOC = " << *MI;
- ConstantInt *NElements = cast<ConstantInt>(MI->getArraySize());
-
- if (NElements->getZExtValue() != 1) {
- // If we have an array allocation, transform it to a single element
- // allocation to make the code below simpler.
- Type *NewTy = ArrayType::get(MI->getAllocatedType(),
- NElements->getZExtValue());
- MallocInst *NewMI =
- new MallocInst(NewTy, Constant::getNullValue(Type::Int32Ty),
- MI->getAlignment(), MI->getName(), MI);
- Value* Indices[2];
- Indices[0] = Indices[1] = Constant::getNullValue(Type::Int32Ty);
- Value *NewGEP = GetElementPtrInst::Create(NewMI, Indices, Indices + 2,
- NewMI->getName()+".el0", MI);
- MI->replaceAllUsesWith(NewGEP);
- MI->eraseFromParent();
- MI = NewMI;
- }
-
- // Create the new global variable. The contents of the malloc'd memory is
- // undefined, so initialize with an undef value.
- Constant *Init = UndefValue::get(MI->getAllocatedType());
- GlobalVariable *NewGV = new GlobalVariable(MI->getAllocatedType(), false,
- GlobalValue::InternalLinkage, Init,
- GV->getName()+".body",
- (Module *)NULL,
- GV->isThreadLocal());
- // FIXME: This new global should have the alignment returned by malloc. Code
- // could depend on malloc returning large alignment (on the mac, 16 bytes) but
- // this would only guarantee some lower alignment.
- GV->getParent()->getGlobalList().insert(GV, NewGV);
-
- // Anything that used the malloc now uses the global directly.
- MI->replaceAllUsesWith(NewGV);
-
- Constant *RepValue = NewGV;
- if (NewGV->getType() != GV->getType()->getElementType())
- RepValue = ConstantExpr::getBitCast(RepValue,
- GV->getType()->getElementType());
-
- // If there is a comparison against null, we will insert a global bool to
- // keep track of whether the global was initialized yet or not.
- GlobalVariable *InitBool =
- new GlobalVariable(Type::Int1Ty, false, GlobalValue::InternalLinkage,
- ConstantInt::getFalse(), GV->getName()+".init",
- (Module *)NULL, GV->isThreadLocal());
- bool InitBoolUsed = false;
-
- // Loop over all uses of GV, processing them in turn.
- std::vector<StoreInst*> Stores;
- while (!GV->use_empty())
- if (LoadInst *LI = dyn_cast<LoadInst>(GV->use_back())) {
- while (!LI->use_empty()) {
- Use &LoadUse = LI->use_begin().getUse();
- if (!isa<ICmpInst>(LoadUse.getUser()))
- LoadUse = RepValue;
- else {
- ICmpInst *CI = cast<ICmpInst>(LoadUse.getUser());
- // Replace the cmp X, 0 with a use of the bool value.
- Value *LV = new LoadInst(InitBool, InitBool->getName()+".val", CI);
- InitBoolUsed = true;
- switch (CI->getPredicate()) {
- default: assert(0 && "Unknown ICmp Predicate!");
- case ICmpInst::ICMP_ULT:
- case ICmpInst::ICMP_SLT:
- LV = ConstantInt::getFalse(); // X < null -> always false
- break;
- case ICmpInst::ICMP_ULE:
- case ICmpInst::ICMP_SLE:
- case ICmpInst::ICMP_EQ:
- LV = BinaryOperator::createNot(LV, "notinit", CI);
- break;
- case ICmpInst::ICMP_NE:
- case ICmpInst::ICMP_UGE:
- case ICmpInst::ICMP_SGE:
- case ICmpInst::ICMP_UGT:
- case ICmpInst::ICMP_SGT:
- break; // no change.
- }
- CI->replaceAllUsesWith(LV);
- CI->eraseFromParent();
- }
- }
- LI->eraseFromParent();
- } else {
- StoreInst *SI = cast<StoreInst>(GV->use_back());
- // The global is initialized when the store to it occurs.
- new StoreInst(ConstantInt::getTrue(), InitBool, SI);
- SI->eraseFromParent();
- }
-
- // If the initialization boolean was used, insert it, otherwise delete it.
- if (!InitBoolUsed) {
- while (!InitBool->use_empty()) // Delete initializations
- cast<Instruction>(InitBool->use_back())->eraseFromParent();
- delete InitBool;
- } else
- GV->getParent()->getGlobalList().insert(GV, InitBool);
-
-
- // Now the GV is dead, nuke it and the malloc.
- GV->eraseFromParent();
- MI->eraseFromParent();
-
- // To further other optimizations, loop over all users of NewGV and try to
- // constant prop them. This will promote GEP instructions with constant
- // indices into GEP constant-exprs, which will allow global-opt to hack on it.
- ConstantPropUsersOf(NewGV);
- if (RepValue != NewGV)
- ConstantPropUsersOf(RepValue);
-
- return NewGV;
-}
-
-/// ValueIsOnlyUsedLocallyOrStoredToOneGlobal - Scan the use-list of V checking
-/// to make sure that there are no complex uses of V. We permit simple things
-/// like dereferencing the pointer, but not storing through the address, unless
-/// it is to the specified global.
-static bool ValueIsOnlyUsedLocallyOrStoredToOneGlobal(Instruction *V,
- GlobalVariable *GV,
- SmallPtrSet<PHINode*, 8> &PHIs) {
- for (Value::use_iterator UI = V->use_begin(), E = V->use_end(); UI != E; ++UI)
- if (isa<LoadInst>(*UI) || isa<CmpInst>(*UI)) {
- // Fine, ignore.
- } else if (StoreInst *SI = dyn_cast<StoreInst>(*UI)) {
- if (SI->getOperand(0) == V && SI->getOperand(1) != GV)
- return false; // Storing the pointer itself... bad.
- // Otherwise, storing through it, or storing into GV... fine.
- } else if (isa<GetElementPtrInst>(*UI)) {
- if (!ValueIsOnlyUsedLocallyOrStoredToOneGlobal(cast<Instruction>(*UI),
- GV, PHIs))
- return false;
- } else if (PHINode *PN = dyn_cast<PHINode>(*UI)) {
- // PHIs are ok if all uses are ok. Don't infinitely recurse through PHI
- // cycles.
- if (PHIs.insert(PN))
- if (!ValueIsOnlyUsedLocallyOrStoredToOneGlobal(PN, GV, PHIs))
- return false;
- } else {
- return false;
- }
- return true;
-}
-
-/// ReplaceUsesOfMallocWithGlobal - The Alloc pointer is stored into GV
-/// somewhere. Transform all uses of the allocation into loads from the
-/// global and uses of the resultant pointer. Further, delete the store into
-/// GV. This assumes that these value pass the
-/// 'ValueIsOnlyUsedLocallyOrStoredToOneGlobal' predicate.
-static void ReplaceUsesOfMallocWithGlobal(Instruction *Alloc,
- GlobalVariable *GV) {
- while (!Alloc->use_empty()) {
- Instruction *U = cast<Instruction>(*Alloc->use_begin());
- Instruction *InsertPt = U;
- if (StoreInst *SI = dyn_cast<StoreInst>(U)) {
- // If this is the store of the allocation into the global, remove it.
- if (SI->getOperand(1) == GV) {
- SI->eraseFromParent();
- continue;
- }
- } else if (PHINode *PN = dyn_cast<PHINode>(U)) {
- // Insert the load in the corresponding predecessor, not right before the
- // PHI.
- unsigned PredNo = Alloc->use_begin().getOperandNo()/2;
- InsertPt = PN->getIncomingBlock(PredNo)->getTerminator();
- }
-
- // Insert a load from the global, and use it instead of the malloc.
- Value *NL = new LoadInst(GV, GV->getName()+".val", InsertPt);
- U->replaceUsesOfWith(Alloc, NL);
- }
-}
-
-/// GlobalLoadUsesSimpleEnoughForHeapSRA - If all users of values loaded from
-/// GV are simple enough to perform HeapSRA, return true.
-static bool GlobalLoadUsesSimpleEnoughForHeapSRA(GlobalVariable *GV,
- MallocInst *MI) {
- for (Value::use_iterator UI = GV->use_begin(), E = GV->use_end(); UI != E;
- ++UI)
- if (LoadInst *LI = dyn_cast<LoadInst>(*UI)) {
- // We permit two users of the load: setcc comparing against the null
- // pointer, and a getelementptr of a specific form.
- for (Value::use_iterator UI = LI->use_begin(), E = LI->use_end(); UI != E;
- ++UI) {
- // Comparison against null is ok.
- if (ICmpInst *ICI = dyn_cast<ICmpInst>(*UI)) {
- if (!isa<ConstantPointerNull>(ICI->getOperand(1)))
- return false;
- continue;
- }
-
- // getelementptr is also ok, but only a simple form.
- if (GetElementPtrInst *GEPI = dyn_cast<GetElementPtrInst>(*UI)) {
- // Must index into the array and into the struct.
- if (GEPI->getNumOperands() < 3)
- return false;
-
- // Otherwise the GEP is ok.
- continue;
- }
-
- if (PHINode *PN = dyn_cast<PHINode>(*UI)) {
- // We have a phi of a load from the global. We can only handle this
- // if the other PHI'd values are actually the same. In this case,
- // the rewriter will just drop the phi entirely.
- for (unsigned i = 0, e = PN->getNumIncomingValues(); i != e; ++i) {
- Value *IV = PN->getIncomingValue(i);
- if (IV == LI) continue; // Trivial the same.
-
- // If the phi'd value is from the malloc that initializes the value,
- // we can xform it.
- if (IV == MI) continue;
-
- // Otherwise, we don't know what it is.
- return false;
- }
- return true;
- }
-
- // Otherwise we don't know what this is, not ok.
- return false;
- }
- }
- return true;
-}
-
-/// GetHeapSROALoad - Return the load for the specified field of the HeapSROA'd
-/// value, lazily creating it on demand.
-static Value *GetHeapSROALoad(Instruction *Load, unsigned FieldNo,
- const std::vector<GlobalVariable*> &FieldGlobals,
- std::vector<Value *> &InsertedLoadsForPtr) {
- if (InsertedLoadsForPtr.size() <= FieldNo)
- InsertedLoadsForPtr.resize(FieldNo+1);
- if (InsertedLoadsForPtr[FieldNo] == 0)
- InsertedLoadsForPtr[FieldNo] = new LoadInst(FieldGlobals[FieldNo],
- Load->getName()+".f" +
- utostr(FieldNo), Load);
- return InsertedLoadsForPtr[FieldNo];
-}
-
-/// RewriteHeapSROALoadUser - Given a load instruction and a value derived from
-/// the load, rewrite the derived value to use the HeapSRoA'd load.
-static void RewriteHeapSROALoadUser(LoadInst *Load, Instruction *LoadUser,
- const std::vector<GlobalVariable*> &FieldGlobals,
- std::vector<Value *> &InsertedLoadsForPtr) {
- // If this is a comparison against null, handle it.
- if (ICmpInst *SCI = dyn_cast<ICmpInst>(LoadUser)) {
- assert(isa<ConstantPointerNull>(SCI->getOperand(1)));
- // If we have a setcc of the loaded pointer, we can use a setcc of any
- // field.
- Value *NPtr;
- if (InsertedLoadsForPtr.empty()) {
- NPtr = GetHeapSROALoad(Load, 0, FieldGlobals, InsertedLoadsForPtr);
- } else {
- NPtr = InsertedLoadsForPtr.back();
- }
-
- Value *New = new ICmpInst(SCI->getPredicate(), NPtr,
- Constant::getNullValue(NPtr->getType()),
- SCI->getName(), SCI);
- SCI->replaceAllUsesWith(New);
- SCI->eraseFromParent();
- return;
- }
-
- // Handle 'getelementptr Ptr, Idx, uint FieldNo ...'
- if (GetElementPtrInst *GEPI = dyn_cast<GetElementPtrInst>(LoadUser)) {
- assert(GEPI->getNumOperands() >= 3 && isa<ConstantInt>(GEPI->getOperand(2))
- && "Unexpected GEPI!");
-
- // Load the pointer for this field.
- unsigned FieldNo = cast<ConstantInt>(GEPI->getOperand(2))->getZExtValue();
- Value *NewPtr = GetHeapSROALoad(Load, FieldNo,
- FieldGlobals, InsertedLoadsForPtr);
-
- // Create the new GEP idx vector.
- SmallVector<Value*, 8> GEPIdx;
- GEPIdx.push_back(GEPI->getOperand(1));
- GEPIdx.append(GEPI->op_begin()+3, GEPI->op_end());
-
- Value *NGEPI = GetElementPtrInst::Create(NewPtr, GEPIdx.begin(), GEPIdx.end(),
- GEPI->getName(), GEPI);
- GEPI->replaceAllUsesWith(NGEPI);
- GEPI->eraseFromParent();
- return;
- }
-
- // Handle PHI nodes. PHI nodes must be merging in the same values, plus
- // potentially the original malloc. Insert phi nodes for each field, then
- // process uses of the PHI.
- PHINode *PN = cast<PHINode>(LoadUser);
- std::vector<Value *> PHIsForField;
- PHIsForField.resize(FieldGlobals.size());
- for (unsigned i = 0, e = FieldGlobals.size(); i != e; ++i) {
- Value *LoadV = GetHeapSROALoad(Load, i, FieldGlobals, InsertedLoadsForPtr);
-
- PHINode *FieldPN = PHINode::Create(LoadV->getType(),
- PN->getName()+"."+utostr(i), PN);
- // Fill in the predecessor values.
- for (unsigned pred = 0, e = PN->getNumIncomingValues(); pred != e; ++pred) {
- // Each predecessor either uses the load or the original malloc.
- Value *InVal = PN->getIncomingValue(pred);
- BasicBlock *BB = PN->getIncomingBlock(pred);
- Value *NewVal;
- if (isa<MallocInst>(InVal)) {
- // Insert a reload from the global in the predecessor.
- NewVal = GetHeapSROALoad(BB->getTerminator(), i, FieldGlobals,
- PHIsForField);
- } else {
- NewVal = InsertedLoadsForPtr[i];
- }
- FieldPN->addIncoming(NewVal, BB);
- }
- PHIsForField[i] = FieldPN;
- }
-
- // Since PHIsForField specifies a phi for every input value, the lazy inserter
- // will never insert a load.
- while (!PN->use_empty())
- RewriteHeapSROALoadUser(Load, PN->use_back(), FieldGlobals, PHIsForField);
- PN->eraseFromParent();
-}
-
-/// RewriteUsesOfLoadForHeapSRoA - We are performing Heap SRoA on a global. Ptr
-/// is a value loaded from the global. Eliminate all uses of Ptr, making them
-/// use FieldGlobals instead. All uses of loaded values satisfy
-/// GlobalLoadUsesSimpleEnoughForHeapSRA.
-static void RewriteUsesOfLoadForHeapSRoA(LoadInst *Load,
- const std::vector<GlobalVariable*> &FieldGlobals) {
- std::vector<Value *> InsertedLoadsForPtr;
- //InsertedLoadsForPtr.resize(FieldGlobals.size());
- while (!Load->use_empty())
- RewriteHeapSROALoadUser(Load, Load->use_back(),
- FieldGlobals, InsertedLoadsForPtr);
-}
-
-/// PerformHeapAllocSRoA - MI is an allocation of an array of structures. Break
-/// it up into multiple allocations of arrays of the fields.
-static GlobalVariable *PerformHeapAllocSRoA(GlobalVariable *GV, MallocInst *MI){
- DOUT << "SROA HEAP ALLOC: " << *GV << " MALLOC = " << *MI;
- const StructType *STy = cast<StructType>(MI->getAllocatedType());
-
- // There is guaranteed to be at least one use of the malloc (storing
- // it into GV). If there are other uses, change them to be uses of
- // the global to simplify later code. This also deletes the store
- // into GV.
- ReplaceUsesOfMallocWithGlobal(MI, GV);
-
- // Okay, at this point, there are no users of the malloc. Insert N
- // new mallocs at the same place as MI, and N globals.
- std::vector<GlobalVariable*> FieldGlobals;
- std::vector<MallocInst*> FieldMallocs;
-
- for (unsigned FieldNo = 0, e = STy->getNumElements(); FieldNo != e;++FieldNo){
- const Type *FieldTy = STy->getElementType(FieldNo);
- const Type *PFieldTy = PointerType::getUnqual(FieldTy);
-
- GlobalVariable *NGV =
- new GlobalVariable(PFieldTy, false, GlobalValue::InternalLinkage,
- Constant::getNullValue(PFieldTy),
- GV->getName() + ".f" + utostr(FieldNo), GV,
- GV->isThreadLocal());
- FieldGlobals.push_back(NGV);
-
- MallocInst *NMI = new MallocInst(FieldTy, MI->getArraySize(),
- MI->getName() + ".f" + utostr(FieldNo),MI);
- FieldMallocs.push_back(NMI);
- new StoreInst(NMI, NGV, MI);
- }
-
- // The tricky aspect of this transformation is handling the case when malloc
- // fails. In the original code, malloc failing would set the result pointer
- // of malloc to null. In this case, some mallocs could succeed and others
- // could fail. As such, we emit code that looks like this:
- // F0 = malloc(field0)
- // F1 = malloc(field1)
- // F2 = malloc(field2)
- // if (F0 == 0 || F1 == 0 || F2 == 0) {
- // if (F0) { free(F0); F0 = 0; }
- // if (F1) { free(F1); F1 = 0; }
- // if (F2) { free(F2); F2 = 0; }
- // }
- Value *RunningOr = 0;
- for (unsigned i = 0, e = FieldMallocs.size(); i != e; ++i) {
- Value *Cond = new ICmpInst(ICmpInst::ICMP_EQ, FieldMallocs[i],
- Constant::getNullValue(FieldMallocs[i]->getType()),
- "isnull", MI);
- if (!RunningOr)
- RunningOr = Cond; // First seteq
- else
- RunningOr = BinaryOperator::createOr(RunningOr, Cond, "tmp", MI);
- }
-
- // Split the basic block at the old malloc.
- BasicBlock *OrigBB = MI->getParent();
- BasicBlock *ContBB = OrigBB->splitBasicBlock(MI, "malloc_cont");
-
- // Create the block to check the first condition. Put all these blocks at the
- // end of the function as they are unlikely to be executed.
- BasicBlock *NullPtrBlock = BasicBlock::Create("malloc_ret_null",
- OrigBB->getParent());
-
- // Remove the uncond branch from OrigBB to ContBB, turning it into a cond
- // branch on RunningOr.
- OrigBB->getTerminator()->eraseFromParent();
- BranchInst::Create(NullPtrBlock, ContBB, RunningOr, OrigBB);
-
- // Within the NullPtrBlock, we need to emit a comparison and branch for each
- // pointer, because some may be null while others are not.
- for (unsigned i = 0, e = FieldGlobals.size(); i != e; ++i) {
- Value *GVVal = new LoadInst(FieldGlobals[i], "tmp", NullPtrBlock);
- Value *Cmp = new ICmpInst(ICmpInst::ICMP_NE, GVVal,
- Constant::getNullValue(GVVal->getType()),
- "tmp", NullPtrBlock);
- BasicBlock *FreeBlock = BasicBlock::Create("free_it", OrigBB->getParent());
- BasicBlock *NextBlock = BasicBlock::Create("next", OrigBB->getParent());
- BranchInst::Create(FreeBlock, NextBlock, Cmp, NullPtrBlock);
-
- // Fill in FreeBlock.
- new FreeInst(GVVal, FreeBlock);
- new StoreInst(Constant::getNullValue(GVVal->getType()), FieldGlobals[i],
- FreeBlock);
- BranchInst::Create(NextBlock, FreeBlock);
-
- NullPtrBlock = NextBlock;
- }
-
- BranchInst::Create(ContBB, NullPtrBlock);
-
- // MI is no longer needed, remove it.
- MI->eraseFromParent();
-
-
- // Okay, the malloc site is completely handled. All of the uses of GV are now
- // loads, and all uses of those loads are simple. Rewrite them to use loads
- // of the per-field globals instead.
- while (!GV->use_empty()) {
- if (LoadInst *LI = dyn_cast<LoadInst>(GV->use_back())) {
- RewriteUsesOfLoadForHeapSRoA(LI, FieldGlobals);
- LI->eraseFromParent();
- } else {
- // Must be a store of null.
- StoreInst *SI = cast<StoreInst>(GV->use_back());
- assert(isa<Constant>(SI->getOperand(0)) &&
- cast<Constant>(SI->getOperand(0))->isNullValue() &&
- "Unexpected heap-sra user!");
-
- // Insert a store of null into each global.
- for (unsigned i = 0, e = FieldGlobals.size(); i != e; ++i) {
- Constant *Null =
- Constant::getNullValue(FieldGlobals[i]->getType()->getElementType());
- new StoreInst(Null, FieldGlobals[i], SI);
- }
- // Erase the original store.
- SI->eraseFromParent();
- }
- }
-
- // The old global is now dead, remove it.
- GV->eraseFromParent();
-
- ++NumHeapSRA;
- return FieldGlobals[0];
-}
-
-
-// OptimizeOnceStoredGlobal - Try to optimize globals based on the knowledge
-// that only one value (besides its initializer) is ever stored to the global.
-static bool OptimizeOnceStoredGlobal(GlobalVariable *GV, Value *StoredOnceVal,
- Module::global_iterator &GVI,
- TargetData &TD) {
- if (CastInst *CI = dyn_cast<CastInst>(StoredOnceVal))
- StoredOnceVal = CI->getOperand(0);
- else if (GetElementPtrInst *GEPI =dyn_cast<GetElementPtrInst>(StoredOnceVal)){
- // "getelementptr Ptr, 0, 0, 0" is really just a cast.
- bool IsJustACast = true;
- for (unsigned i = 1, e = GEPI->getNumOperands(); i != e; ++i)
- if (!isa<Constant>(GEPI->getOperand(i)) ||
- !cast<Constant>(GEPI->getOperand(i))->isNullValue()) {
- IsJustACast = false;
- break;
- }
- if (IsJustACast)
- StoredOnceVal = GEPI->getOperand(0);
- }
-
- // If we are dealing with a pointer global that is initialized to null and
- // only has one (non-null) value stored into it, then we can optimize any
- // users of the loaded value (often calls and loads) that would trap if the
- // value was null.
- if (isa<PointerType>(GV->getInitializer()->getType()) &&
- GV->getInitializer()->isNullValue()) {
- if (Constant *SOVC = dyn_cast<Constant>(StoredOnceVal)) {
- if (GV->getInitializer()->getType() != SOVC->getType())
- SOVC = ConstantExpr::getBitCast(SOVC, GV->getInitializer()->getType());
-
- // Optimize away any trapping uses of the loaded value.
- if (OptimizeAwayTrappingUsesOfLoads(GV, SOVC))
- return true;
- } else if (MallocInst *MI = dyn_cast<MallocInst>(StoredOnceVal)) {
- // If this is a malloc of an abstract type, don't touch it.
- if (!MI->getAllocatedType()->isSized())
- return false;
-
- // We can't optimize this global unless all uses of it are *known* to be
- // of the malloc value, not of the null initializer value (consider a use
- // that compares the global's value against zero to see if the malloc has
- // been reached). To do this, we check to see if all uses of the global
- // would trap if the global were null: this proves that they must all
- // happen after the malloc.
- if (!AllUsesOfLoadedValueWillTrapIfNull(GV))
- return false;
-
- // We can't optimize this if the malloc itself is used in a complex way,
- // for example, being stored into multiple globals. This allows the
- // malloc to be stored into the specified global, loaded setcc'd, and
- // GEP'd. These are all things we could transform to using the global
- // for.
- {
- SmallPtrSet<PHINode*, 8> PHIs;
- if (!ValueIsOnlyUsedLocallyOrStoredToOneGlobal(MI, GV, PHIs))
- return false;
- }
-
-
- // If we have a global that is only initialized with a fixed size malloc,
- // transform the program to use global memory instead of malloc'd memory.
- // This eliminates dynamic allocation, avoids an indirection accessing the
- // data, and exposes the resultant global to further GlobalOpt.
- if (ConstantInt *NElements = dyn_cast<ConstantInt>(MI->getArraySize())) {
- // Restrict this transformation to only working on small allocations
- // (2048 bytes currently), as we don't want to introduce a 16M global or
- // something.
- if (NElements->getZExtValue()*
- TD.getABITypeSize(MI->getAllocatedType()) < 2048) {
- GVI = OptimizeGlobalAddressOfMalloc(GV, MI);
- return true;
- }
- }
-
- // If the allocation is an array of structures, consider transforming this
- // into multiple malloc'd arrays, one for each field. This is basically
- // SRoA for malloc'd memory.
- if (const StructType *AllocTy =
- dyn_cast<StructType>(MI->getAllocatedType())) {
- // This the structure has an unreasonable number of fields, leave it
- // alone.
- if (AllocTy->getNumElements() <= 16 && AllocTy->getNumElements() > 0 &&
- GlobalLoadUsesSimpleEnoughForHeapSRA(GV, MI)) {
- GVI = PerformHeapAllocSRoA(GV, MI);
- return true;
- }
- }
- }
- }
-
- return false;
-}
-
-/// TryToShrinkGlobalToBoolean - At this point, we have learned that the only
-/// two values ever stored into GV are its initializer and OtherVal. See if we
-/// can shrink the global into a boolean and select between the two values
-/// whenever it is used. This exposes the values to other scalar optimizations.
-static bool TryToShrinkGlobalToBoolean(GlobalVariable *GV, Constant *OtherVal) {
- const Type *GVElType = GV->getType()->getElementType();
-
- // If GVElType is already i1, it is already shrunk. If the type of the GV is
- // an FP value or vector, don't do this optimization because a select between
- // them is very expensive and unlikely to lead to later simplification.
- if (GVElType == Type::Int1Ty || GVElType->isFloatingPoint() ||
- isa<VectorType>(GVElType))
- return false;
-
- // Walk the use list of the global seeing if all the uses are load or store.
- // If there is anything else, bail out.
- for (Value::use_iterator I = GV->use_begin(), E = GV->use_end(); I != E; ++I)
- if (!isa<LoadInst>(I) && !isa<StoreInst>(I))
- return false;
-
- DOUT << " *** SHRINKING TO BOOL: " << *GV;
-
- // Create the new global, initializing it to false.
- GlobalVariable *NewGV = new GlobalVariable(Type::Int1Ty, false,
- GlobalValue::InternalLinkage, ConstantInt::getFalse(),
- GV->getName()+".b",
- (Module *)NULL,
- GV->isThreadLocal());
- GV->getParent()->getGlobalList().insert(GV, NewGV);
-
- Constant *InitVal = GV->getInitializer();
- assert(InitVal->getType() != Type::Int1Ty && "No reason to shrink to bool!");
-
- // If initialized to zero and storing one into the global, we can use a cast
- // instead of a select to synthesize the desired value.
- bool IsOneZero = false;
- if (ConstantInt *CI = dyn_cast<ConstantInt>(OtherVal))
- IsOneZero = InitVal->isNullValue() && CI->isOne();
-
- while (!GV->use_empty()) {
- Instruction *UI = cast<Instruction>(GV->use_back());
- if (StoreInst *SI = dyn_cast<StoreInst>(UI)) {
- // Change the store into a boolean store.
- bool StoringOther = SI->getOperand(0) == OtherVal;
- // Only do this if we weren't storing a loaded value.
- Value *StoreVal;
- if (StoringOther || SI->getOperand(0) == InitVal)
- StoreVal = ConstantInt::get(Type::Int1Ty, StoringOther);
- else {
- // Otherwise, we are storing a previously loaded copy. To do this,
- // change the copy from copying the original value to just copying the
- // bool.
- Instruction *StoredVal = cast<Instruction>(SI->getOperand(0));
-
- // If we're already replaced the input, StoredVal will be a cast or
- // select instruction. If not, it will be a load of the original
- // global.
- if (LoadInst *LI = dyn_cast<LoadInst>(StoredVal)) {
- assert(LI->getOperand(0) == GV && "Not a copy!");
- // Insert a new load, to preserve the saved value.
- StoreVal = new LoadInst(NewGV, LI->getName()+".b", LI);
- } else {
- assert((isa<CastInst>(StoredVal) || isa<SelectInst>(StoredVal)) &&
- "This is not a form that we understand!");
- StoreVal = StoredVal->getOperand(0);
- assert(isa<LoadInst>(StoreVal) && "Not a load of NewGV!");
- }
- }
- new StoreInst(StoreVal, NewGV, SI);
- } else {
- // Change the load into a load of bool then a select.
- LoadInst *LI = cast<LoadInst>(UI);
- LoadInst *NLI = new LoadInst(NewGV, LI->getName()+".b", LI);
- Value *NSI;
- if (IsOneZero)
- NSI = new ZExtInst(NLI, LI->getType(), "", LI);
- else
- NSI = SelectInst::Create(NLI, OtherVal, InitVal, "", LI);
- NSI->takeName(LI);
- LI->replaceAllUsesWith(NSI);
- }
- UI->eraseFromParent();
- }
-
- GV->eraseFromParent();
- return true;
-}
-
-
-/// ProcessInternalGlobal - Analyze the specified global variable and optimize
-/// it if possible. If we make a change, return true.
-bool GlobalOpt::ProcessInternalGlobal(GlobalVariable *GV,
- Module::global_iterator &GVI) {
- std::set<PHINode*> PHIUsers;
- GlobalStatus GS;
- GV->removeDeadConstantUsers();
-
- if (GV->use_empty()) {
- DOUT << "GLOBAL DEAD: " << *GV;
- GV->eraseFromParent();
- ++NumDeleted;
- return true;
- }
-
- if (!AnalyzeGlobal(GV, GS, PHIUsers)) {
-#if 0
- cerr << "Global: " << *GV;
- cerr << " isLoaded = " << GS.isLoaded << "\n";
- cerr << " StoredType = ";
- switch (GS.StoredType) {
- case GlobalStatus::NotStored: cerr << "NEVER STORED\n"; break;
- case GlobalStatus::isInitializerStored: cerr << "INIT STORED\n"; break;
- case GlobalStatus::isStoredOnce: cerr << "STORED ONCE\n"; break;
- case GlobalStatus::isStored: cerr << "stored\n"; break;
- }
- if (GS.StoredType == GlobalStatus::isStoredOnce && GS.StoredOnceValue)
- cerr << " StoredOnceValue = " << *GS.StoredOnceValue << "\n";
- if (GS.AccessingFunction && !GS.HasMultipleAccessingFunctions)
- cerr << " AccessingFunction = " << GS.AccessingFunction->getName()
- << "\n";
- cerr << " HasMultipleAccessingFunctions = "
- << GS.HasMultipleAccessingFunctions << "\n";
- cerr << " HasNonInstructionUser = " << GS.HasNonInstructionUser<<"\n";
- cerr << "\n";
-#endif
-
- // If this is a first class global and has only one accessing function
- // and this function is main (which we know is not recursive we can make
- // this global a local variable) we replace the global with a local alloca
- // in this function.
- //
- // NOTE: It doesn't make sense to promote non first class types since we
- // are just replacing static memory to stack memory.
- if (!GS.HasMultipleAccessingFunctions &&
- GS.AccessingFunction && !GS.HasNonInstructionUser &&
- GV->getType()->getElementType()->isFirstClassType() &&
- GS.AccessingFunction->getName() == "main" &&
- GS.AccessingFunction->hasExternalLinkage()) {
- DOUT << "LOCALIZING GLOBAL: " << *GV;
- Instruction* FirstI = GS.AccessingFunction->getEntryBlock().begin();
- const Type* ElemTy = GV->getType()->getElementType();
- // FIXME: Pass Global's alignment when globals have alignment
- AllocaInst* Alloca = new AllocaInst(ElemTy, NULL, GV->getName(), FirstI);
- if (!isa<UndefValue>(GV->getInitializer()))
- new StoreInst(GV->getInitializer(), Alloca, FirstI);
-
- GV->replaceAllUsesWith(Alloca);
- GV->eraseFromParent();
- ++NumLocalized;
- return true;
- }
-
- // If the global is never loaded (but may be stored to), it is dead.
- // Delete it now.
- if (!GS.isLoaded) {
- DOUT << "GLOBAL NEVER LOADED: " << *GV;
-
- // Delete any stores we can find to the global. We may not be able to
- // make it completely dead though.
- bool Changed = CleanupConstantGlobalUsers(GV, GV->getInitializer());
-
- // If the global is dead now, delete it.
- if (GV->use_empty()) {
- GV->eraseFromParent();
- ++NumDeleted;
- Changed = true;
- }
- return Changed;
-
- } else if (GS.StoredType <= GlobalStatus::isInitializerStored) {
- DOUT << "MARKING CONSTANT: " << *GV;
- GV->setConstant(true);
-
- // Clean up any obviously simplifiable users now.
- CleanupConstantGlobalUsers(GV, GV->getInitializer());
-
- // If the global is dead now, just nuke it.
- if (GV->use_empty()) {
- DOUT << " *** Marking constant allowed us to simplify "
- << "all users and delete global!\n";
- GV->eraseFromParent();
- ++NumDeleted;
- }
-
- ++NumMarked;
- return true;
- } else if (!GV->getInitializer()->getType()->isFirstClassType()) {
- if (GlobalVariable *FirstNewGV = SRAGlobal(GV,
- getAnalysis<TargetData>())) {
- GVI = FirstNewGV; // Don't skip the newly produced globals!
- return true;
- }
- } else if (GS.StoredType == GlobalStatus::isStoredOnce) {
- // If the initial value for the global was an undef value, and if only
- // one other value was stored into it, we can just change the
- // initializer to be an undef value, then delete all stores to the
- // global. This allows us to mark it constant.
- if (Constant *SOVConstant = dyn_cast<Constant>(GS.StoredOnceValue))
- if (isa<UndefValue>(GV->getInitializer())) {
- // Change the initial value here.
- GV->setInitializer(SOVConstant);
-
- // Clean up any obviously simplifiable users now.
- CleanupConstantGlobalUsers(GV, GV->getInitializer());
-
- if (GV->use_empty()) {
- DOUT << " *** Substituting initializer allowed us to "
- << "simplify all users and delete global!\n";
- GV->eraseFromParent();
- ++NumDeleted;
- } else {
- GVI = GV;
- }
- ++NumSubstitute;
- return true;
- }
-
- // Try to optimize globals based on the knowledge that only one value
- // (besides its initializer) is ever stored to the global.
- if (OptimizeOnceStoredGlobal(GV, GS.StoredOnceValue, GVI,
- getAnalysis<TargetData>()))
- return true;
-
- // Otherwise, if the global was not a boolean, we can shrink it to be a
- // boolean.
- if (Constant *SOVConstant = dyn_cast<Constant>(GS.StoredOnceValue))
- if (TryToShrinkGlobalToBoolean(GV, SOVConstant)) {
- ++NumShrunkToBool;
- return true;
- }
- }
- }
- return false;
-}
-
-/// OnlyCalledDirectly - Return true if the specified function is only called
-/// directly. In other words, its address is never taken.
-static bool OnlyCalledDirectly(Function *F) {
- for (Value::use_iterator UI = F->use_begin(), E = F->use_end(); UI != E;++UI){
- Instruction *User = dyn_cast<Instruction>(*UI);
- if (!User) return false;
- if (!isa<CallInst>(User) && !isa<InvokeInst>(User)) return false;
-
- // See if the function address is passed as an argument.
- for (unsigned i = 1, e = User->getNumOperands(); i != e; ++i)
- if (User->getOperand(i) == F) return false;
- }
- return true;
-}
-
-/// ChangeCalleesToFastCall - Walk all of the direct calls of the specified
-/// function, changing them to FastCC.
-static void ChangeCalleesToFastCall(Function *F) {
- for (Value::use_iterator UI = F->use_begin(), E = F->use_end(); UI != E;++UI){
- CallSite User(cast<Instruction>(*UI));
- User.setCallingConv(CallingConv::Fast);
- }
-}
-
-static PAListPtr StripNest(const PAListPtr &Attrs) {
- for (unsigned i = 0, e = Attrs.getNumSlots(); i != e; ++i) {
- if ((Attrs.getSlot(i).Attrs & ParamAttr::Nest) == 0)
- continue;
-
- // There can be only one.
- return Attrs.removeAttr(Attrs.getSlot(i).Index, ParamAttr::Nest);
- }
-
- return Attrs;
-}
-
-static void RemoveNestAttribute(Function *F) {
- F->setParamAttrs(StripNest(F->getParamAttrs()));
- for (Value::use_iterator UI = F->use_begin(), E = F->use_end(); UI != E;++UI){
- CallSite User(cast<Instruction>(*UI));
- User.setParamAttrs(StripNest(User.getParamAttrs()));
- }
-}
-
-bool GlobalOpt::OptimizeFunctions(Module &M) {
- bool Changed = false;
- // Optimize functions.
- for (Module::iterator FI = M.begin(), E = M.end(); FI != E; ) {
- Function *F = FI++;
- F->removeDeadConstantUsers();
- if (F->use_empty() && (F->hasInternalLinkage() ||
- F->hasLinkOnceLinkage())) {
- M.getFunctionList().erase(F);
- Changed = true;
- ++NumFnDeleted;
- } else if (F->hasInternalLinkage()) {
- if (F->getCallingConv() == CallingConv::C && !F->isVarArg() &&
- OnlyCalledDirectly(F)) {
- // If this function has C calling conventions, is not a varargs
- // function, and is only called directly, promote it to use the Fast
- // calling convention.
- F->setCallingConv(CallingConv::Fast);
- ChangeCalleesToFastCall(F);
- ++NumFastCallFns;
- Changed = true;
- }
-
- if (F->getParamAttrs().hasAttrSomewhere(ParamAttr::Nest) &&
- OnlyCalledDirectly(F)) {
- // The function is not used by a trampoline intrinsic, so it is safe
- // to remove the 'nest' attribute.
- RemoveNestAttribute(F);
- ++NumNestRemoved;
- Changed = true;
- }
- }
- }
- return Changed;
-}
-
-bool GlobalOpt::OptimizeGlobalVars(Module &M) {
- bool Changed = false;
- for (Module::global_iterator GVI = M.global_begin(), E = M.global_end();
- GVI != E; ) {
- GlobalVariable *GV = GVI++;
- if (!GV->isConstant() && GV->hasInternalLinkage() &&
- GV->hasInitializer())
- Changed |= ProcessInternalGlobal(GV, GVI);
- }
- return Changed;
-}
-
-/// FindGlobalCtors - Find the llvm.globalctors list, verifying that all
-/// initializers have an init priority of 65535.
-GlobalVariable *GlobalOpt::FindGlobalCtors(Module &M) {
- for (Module::global_iterator I = M.global_begin(), E = M.global_end();
- I != E; ++I)
- if (I->getName() == "llvm.global_ctors") {
- // Found it, verify it's an array of { int, void()* }.
- const ArrayType *ATy =dyn_cast<ArrayType>(I->getType()->getElementType());
- if (!ATy) return 0;
- const StructType *STy = dyn_cast<StructType>(ATy->getElementType());
- if (!STy || STy->getNumElements() != 2 ||
- STy->getElementType(0) != Type::Int32Ty) return 0;
- const PointerType *PFTy = dyn_cast<PointerType>(STy->getElementType(1));
- if (!PFTy) return 0;
- const FunctionType *FTy = dyn_cast<FunctionType>(PFTy->getElementType());
- if (!FTy || FTy->getReturnType() != Type::VoidTy || FTy->isVarArg() ||
- FTy->getNumParams() != 0)
- return 0;
-
- // Verify that the initializer is simple enough for us to handle.
- if (!I->hasInitializer()) return 0;
- ConstantArray *CA = dyn_cast<ConstantArray>(I->getInitializer());
- if (!CA) return 0;
- for (unsigned i = 0, e = CA->getNumOperands(); i != e; ++i)
- if (ConstantStruct *CS = dyn_cast<ConstantStruct>(CA->getOperand(i))) {
- if (isa<ConstantPointerNull>(CS->getOperand(1)))
- continue;
-
- // Must have a function or null ptr.
- if (!isa<Function>(CS->getOperand(1)))
- return 0;
-
- // Init priority must be standard.
- ConstantInt *CI = dyn_cast<ConstantInt>(CS->getOperand(0));
- if (!CI || CI->getZExtValue() != 65535)
- return 0;
- } else {
- return 0;
- }
-
- return I;
- }
- return 0;
-}
-
-/// ParseGlobalCtors - Given a llvm.global_ctors list that we can understand,
-/// return a list of the functions and null terminator as a vector.
-static std::vector<Function*> ParseGlobalCtors(GlobalVariable *GV) {
- ConstantArray *CA = cast<ConstantArray>(GV->getInitializer());
- std::vector<Function*> Result;
- Result.reserve(CA->getNumOperands());
- for (unsigned i = 0, e = CA->getNumOperands(); i != e; ++i) {
- ConstantStruct *CS = cast<ConstantStruct>(CA->getOperand(i));
- Result.push_back(dyn_cast<Function>(CS->getOperand(1)));
- }
- return Result;
-}
-
-/// InstallGlobalCtors - Given a specified llvm.global_ctors list, install the
-/// specified array, returning the new global to use.
-static GlobalVariable *InstallGlobalCtors(GlobalVariable *GCL,
- const std::vector<Function*> &Ctors) {
- // If we made a change, reassemble the initializer list.
- std::vector<Constant*> CSVals;
- CSVals.push_back(ConstantInt::get(Type::Int32Ty, 65535));
- CSVals.push_back(0);
-
- // Create the new init list.
- std::vector<Constant*> CAList;
- for (unsigned i = 0, e = Ctors.size(); i != e; ++i) {
- if (Ctors[i]) {
- CSVals[1] = Ctors[i];
- } else {
- const Type *FTy = FunctionType::get(Type::VoidTy,
- std::vector<const Type*>(), false);
- const PointerType *PFTy = PointerType::getUnqual(FTy);
- CSVals[1] = Constant::getNullValue(PFTy);
- CSVals[0] = ConstantInt::get(Type::Int32Ty, 2147483647);
- }
- CAList.push_back(ConstantStruct::get(CSVals));
- }
-
- // Create the array initializer.
- const Type *StructTy =
- cast<ArrayType>(GCL->getType()->getElementType())->getElementType();
- Constant *CA = ConstantArray::get(ArrayType::get(StructTy, CAList.size()),
- CAList);
-
- // If we didn't change the number of elements, don't create a new GV.
- if (CA->getType() == GCL->getInitializer()->getType()) {
- GCL->setInitializer(CA);
- return GCL;
- }
-
- // Create the new global and insert it next to the existing list.
- GlobalVariable *NGV = new GlobalVariable(CA->getType(), GCL->isConstant(),
- GCL->getLinkage(), CA, "",
- (Module *)NULL,
- GCL->isThreadLocal());
- GCL->getParent()->getGlobalList().insert(GCL, NGV);
- NGV->takeName(GCL);
-
- // Nuke the old list, replacing any uses with the new one.
- if (!GCL->use_empty()) {
- Constant *V = NGV;
- if (V->getType() != GCL->getType())
- V = ConstantExpr::getBitCast(V, GCL->getType());
- GCL->replaceAllUsesWith(V);
- }
- GCL->eraseFromParent();
-
- if (Ctors.size())
- return NGV;
- else
- return 0;
-}
-
-
-static Constant *getVal(std::map<Value*, Constant*> &ComputedValues,
- Value *V) {
- if (Constant *CV = dyn_cast<Constant>(V)) return CV;
- Constant *R = ComputedValues[V];
- assert(R && "Reference to an uncomputed value!");
- return R;
-}
-
-/// isSimpleEnoughPointerToCommit - Return true if this constant is simple
-/// enough for us to understand. In particular, if it is a cast of something,
-/// we punt. We basically just support direct accesses to globals and GEP's of
-/// globals. This should be kept up to date with CommitValueTo.
-static bool isSimpleEnoughPointerToCommit(Constant *C) {
- if (GlobalVariable *GV = dyn_cast<GlobalVariable>(C)) {
- if (!GV->hasExternalLinkage() && !GV->hasInternalLinkage())
- return false; // do not allow weak/linkonce/dllimport/dllexport linkage.
- return !GV->isDeclaration(); // reject external globals.
- }
- if (ConstantExpr *CE = dyn_cast<ConstantExpr>(C))
- // Handle a constantexpr gep.
- if (CE->getOpcode() == Instruction::GetElementPtr &&
- isa<GlobalVariable>(CE->getOperand(0))) {
- GlobalVariable *GV = cast<GlobalVariable>(CE->getOperand(0));
- if (!GV->hasExternalLinkage() && !GV->hasInternalLinkage())
- return false; // do not allow weak/linkonce/dllimport/dllexport linkage.
- return GV->hasInitializer() &&
- ConstantFoldLoadThroughGEPConstantExpr(GV->getInitializer(), CE);
- }
- return false;
-}
-
-/// EvaluateStoreInto - Evaluate a piece of a constantexpr store into a global
-/// initializer. This returns 'Init' modified to reflect 'Val' stored into it.
-/// At this point, the GEP operands of Addr [0, OpNo) have been stepped into.
-static Constant *EvaluateStoreInto(Constant *Init, Constant *Val,
- ConstantExpr *Addr, unsigned OpNo) {
- // Base case of the recursion.
- if (OpNo == Addr->getNumOperands()) {
- assert(Val->getType() == Init->getType() && "Type mismatch!");
- return Val;
- }
-
- if (const StructType *STy = dyn_cast<StructType>(Init->getType())) {
- std::vector<Constant*> Elts;
-
- // Break up the constant into its elements.
- if (ConstantStruct *CS = dyn_cast<ConstantStruct>(Init)) {
- for (unsigned i = 0, e = CS->getNumOperands(); i != e; ++i)
- Elts.push_back(CS->getOperand(i));
- } else if (isa<ConstantAggregateZero>(Init)) {
- for (unsigned i = 0, e = STy->getNumElements(); i != e; ++i)
- Elts.push_back(Constant::getNullValue(STy->getElementType(i)));
- } else if (isa<UndefValue>(Init)) {
- for (unsigned i = 0, e = STy->getNumElements(); i != e; ++i)
- Elts.push_back(UndefValue::get(STy->getElementType(i)));
- } else {
- assert(0 && "This code is out of sync with "
- " ConstantFoldLoadThroughGEPConstantExpr");
- }
-
- // Replace the element that we are supposed to.
- ConstantInt *CU = cast<ConstantInt>(Addr->getOperand(OpNo));
- unsigned Idx = CU->getZExtValue();
- assert(Idx < STy->getNumElements() && "Struct index out of range!");
- Elts[Idx] = EvaluateStoreInto(Elts[Idx], Val, Addr, OpNo+1);
-
- // Return the modified struct.
- return ConstantStruct::get(&Elts[0], Elts.size(), STy->isPacked());
- } else {
- ConstantInt *CI = cast<ConstantInt>(Addr->getOperand(OpNo));
- const ArrayType *ATy = cast<ArrayType>(Init->getType());
-
- // Break up the array into elements.
- std::vector<Constant*> Elts;
- if (ConstantArray *CA = dyn_cast<ConstantArray>(Init)) {
- for (unsigned i = 0, e = CA->getNumOperands(); i != e; ++i)
- Elts.push_back(CA->getOperand(i));
- } else if (isa<ConstantAggregateZero>(Init)) {
- Constant *Elt = Constant::getNullValue(ATy->getElementType());
- Elts.assign(ATy->getNumElements(), Elt);
- } else if (isa<UndefValue>(Init)) {
- Constant *Elt = UndefValue::get(ATy->getElementType());
- Elts.assign(ATy->getNumElements(), Elt);
- } else {
- assert(0 && "This code is out of sync with "
- " ConstantFoldLoadThroughGEPConstantExpr");
- }
-
- assert(CI->getZExtValue() < ATy->getNumElements());
- Elts[CI->getZExtValue()] =
- EvaluateStoreInto(Elts[CI->getZExtValue()], Val, Addr, OpNo+1);
- return ConstantArray::get(ATy, Elts);
- }
-}
-
-/// CommitValueTo - We have decided that Addr (which satisfies the predicate
-/// isSimpleEnoughPointerToCommit) should get Val as its value. Make it happen.
-static void CommitValueTo(Constant *Val, Constant *Addr) {
- if (GlobalVariable *GV = dyn_cast<GlobalVariable>(Addr)) {
- assert(GV->hasInitializer());
- GV->setInitializer(Val);
- return;
- }
-
- ConstantExpr *CE = cast<ConstantExpr>(Addr);
- GlobalVariable *GV = cast<GlobalVariable>(CE->getOperand(0));
-
- Constant *Init = GV->getInitializer();
- Init = EvaluateStoreInto(Init, Val, CE, 2);
- GV->setInitializer(Init);
-}
-
-/// ComputeLoadResult - Return the value that would be computed by a load from
-/// P after the stores reflected by 'memory' have been performed. If we can't
-/// decide, return null.
-static Constant *ComputeLoadResult(Constant *P,
- const std::map<Constant*, Constant*> &Memory) {
- // If this memory location has been recently stored, use the stored value: it
- // is the most up-to-date.
- std::map<Constant*, Constant*>::const_iterator I = Memory.find(P);
- if (I != Memory.end()) return I->second;
-
- // Access it.
- if (GlobalVariable *GV = dyn_cast<GlobalVariable>(P)) {
- if (GV->hasInitializer())
- return GV->getInitializer();
- return 0;
- }
-
- // Handle a constantexpr getelementptr.
- if (ConstantExpr *CE = dyn_cast<ConstantExpr>(P))
- if (CE->getOpcode() == Instruction::GetElementPtr &&
- isa<GlobalVariable>(CE->getOperand(0))) {
- GlobalVariable *GV = cast<GlobalVariable>(CE->getOperand(0));
- if (GV->hasInitializer())
- return ConstantFoldLoadThroughGEPConstantExpr(GV->getInitializer(), CE);
- }
-
- return 0; // don't know how to evaluate.
-}
-
-/// EvaluateFunction - Evaluate a call to function F, returning true if
-/// successful, false if we can't evaluate it. ActualArgs contains the formal
-/// arguments for the function.
-static bool EvaluateFunction(Function *F, Constant *&RetVal,
- const std::vector<Constant*> &ActualArgs,
- std::vector<Function*> &CallStack,
- std::map<Constant*, Constant*> &MutatedMemory,
- std::vector<GlobalVariable*> &AllocaTmps) {
- // Check to see if this function is already executing (recursion). If so,
- // bail out. TODO: we might want to accept limited recursion.
- if (std::find(CallStack.begin(), CallStack.end(), F) != CallStack.end())
- return false;
-
- CallStack.push_back(F);
-
- /// Values - As we compute SSA register values, we store their contents here.
- std::map<Value*, Constant*> Values;
-
- // Initialize arguments to the incoming values specified.
- unsigned ArgNo = 0;
- for (Function::arg_iterator AI = F->arg_begin(), E = F->arg_end(); AI != E;
- ++AI, ++ArgNo)
- Values[AI] = ActualArgs[ArgNo];
-
- /// ExecutedBlocks - We only handle non-looping, non-recursive code. As such,
- /// we can only evaluate any one basic block at most once. This set keeps
- /// track of what we have executed so we can detect recursive cases etc.
- std::set<BasicBlock*> ExecutedBlocks;
-
- // CurInst - The current instruction we're evaluating.
- BasicBlock::iterator CurInst = F->begin()->begin();
-
- // This is the main evaluation loop.
- while (1) {
- Constant *InstResult = 0;
-
- if (StoreInst *SI = dyn_cast<StoreInst>(CurInst)) {
- if (SI->isVolatile()) return false; // no volatile accesses.
- Constant *Ptr = getVal(Values, SI->getOperand(1));
- if (!isSimpleEnoughPointerToCommit(Ptr))
- // If this is too complex for us to commit, reject it.
- return false;
- Constant *Val = getVal(Values, SI->getOperand(0));
- MutatedMemory[Ptr] = Val;
- } else if (BinaryOperator *BO = dyn_cast<BinaryOperator>(CurInst)) {
- InstResult = ConstantExpr::get(BO->getOpcode(),
- getVal(Values, BO->getOperand(0)),
- getVal(Values, BO->getOperand(1)));
- } else if (CmpInst *CI = dyn_cast<CmpInst>(CurInst)) {
- InstResult = ConstantExpr::getCompare(CI->getPredicate(),
- getVal(Values, CI->getOperand(0)),
- getVal(Values, CI->getOperand(1)));
- } else if (CastInst *CI = dyn_cast<CastInst>(CurInst)) {
- InstResult = ConstantExpr::getCast(CI->getOpcode(),
- getVal(Values, CI->getOperand(0)),
- CI->getType());
- } else if (SelectInst *SI = dyn_cast<SelectInst>(CurInst)) {
- InstResult = ConstantExpr::getSelect(getVal(Values, SI->getOperand(0)),
- getVal(Values, SI->getOperand(1)),
- getVal(Values, SI->getOperand(2)));
- } else if (GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(CurInst)) {
- Constant *P = getVal(Values, GEP->getOperand(0));
- SmallVector<Constant*, 8> GEPOps;
- for (unsigned i = 1, e = GEP->getNumOperands(); i != e; ++i)
- GEPOps.push_back(getVal(Values, GEP->getOperand(i)));
- InstResult = ConstantExpr::getGetElementPtr(P, &GEPOps[0], GEPOps.size());
- } else if (LoadInst *LI = dyn_cast<LoadInst>(CurInst)) {
- if (LI->isVolatile()) return false; // no volatile accesses.
- InstResult = ComputeLoadResult(getVal(Values, LI->getOperand(0)),
- MutatedMemory);
- if (InstResult == 0) return false; // Could not evaluate load.
- } else if (AllocaInst *AI = dyn_cast<AllocaInst>(CurInst)) {
- if (AI->isArrayAllocation()) return false; // Cannot handle array allocs.
- const Type *Ty = AI->getType()->getElementType();
- AllocaTmps.push_back(new GlobalVariable(Ty, false,
- GlobalValue::InternalLinkage,
- UndefValue::get(Ty),
- AI->getName()));
- InstResult = AllocaTmps.back();
- } else if (CallInst *CI = dyn_cast<CallInst>(CurInst)) {
- // Cannot handle inline asm.
- if (isa<InlineAsm>(CI->getOperand(0))) return false;
-
- // Resolve function pointers.
- Function *Callee = dyn_cast<Function>(getVal(Values, CI->getOperand(0)));
- if (!Callee) return false; // Cannot resolve.
-
- std::vector<Constant*> Formals;
- for (unsigned i = 1, e = CI->getNumOperands(); i != e; ++i)
- Formals.push_back(getVal(Values, CI->getOperand(i)));
-
- if (Callee->isDeclaration()) {
- // If this is a function we can constant fold, do it.
- if (Constant *C = ConstantFoldCall(Callee, &Formals[0],
- Formals.size())) {
- InstResult = C;
- } else {
- return false;
- }
- } else {
- if (Callee->getFunctionType()->isVarArg())
- return false;
-
- Constant *RetVal;
-
- // Execute the call, if successful, use the return value.
- if (!EvaluateFunction(Callee, RetVal, Formals, CallStack,
- MutatedMemory, AllocaTmps))
- return false;
- InstResult = RetVal;
- }
- } else if (isa<TerminatorInst>(CurInst)) {
- BasicBlock *NewBB = 0;
- if (BranchInst *BI = dyn_cast<BranchInst>(CurInst)) {
- if (BI->isUnconditional()) {
- NewBB = BI->getSuccessor(0);
- } else {
- ConstantInt *Cond =
- dyn_cast<ConstantInt>(getVal(Values, BI->getCondition()));
- if (!Cond) return false; // Cannot determine.
-
- NewBB = BI->getSuccessor(!Cond->getZExtValue());
- }
- } else if (SwitchInst *SI = dyn_cast<SwitchInst>(CurInst)) {
- ConstantInt *Val =
- dyn_cast<ConstantInt>(getVal(Values, SI->getCondition()));
- if (!Val) return false; // Cannot determine.
- NewBB = SI->getSuccessor(SI->findCaseValue(Val));
- } else if (ReturnInst *RI = dyn_cast<ReturnInst>(CurInst)) {
- if (RI->getNumOperands())
- RetVal = getVal(Values, RI->getOperand(0));
-
- CallStack.pop_back(); // return from fn.
- return true; // We succeeded at evaluating this ctor!
- } else {
- // invoke, unwind, unreachable.
- return false; // Cannot handle this terminator.
- }
-
- // Okay, we succeeded in evaluating this control flow. See if we have
- // executed the new block before. If so, we have a looping function,
- // which we cannot evaluate in reasonable time.
- if (!ExecutedBlocks.insert(NewBB).second)
- return false; // looped!
-
- // Okay, we have never been in this block before. Check to see if there
- // are any PHI nodes. If so, evaluate them with information about where
- // we came from.
- BasicBlock *OldBB = CurInst->getParent();
- CurInst = NewBB->begin();
- PHINode *PN;
- for (; (PN = dyn_cast<PHINode>(CurInst)); ++CurInst)
- Values[PN] = getVal(Values, PN->getIncomingValueForBlock(OldBB));
-
- // Do NOT increment CurInst. We know that the terminator had no value.
- continue;
- } else {
- // Did not know how to evaluate this!
- return false;
- }
-
- if (!CurInst->use_empty())
- Values[CurInst] = InstResult;
-
- // Advance program counter.
- ++CurInst;
- }
-}
-
-/// EvaluateStaticConstructor - Evaluate static constructors in the function, if
-/// we can. Return true if we can, false otherwise.
-static bool EvaluateStaticConstructor(Function *F) {
- /// MutatedMemory - For each store we execute, we update this map. Loads
- /// check this to get the most up-to-date value. If evaluation is successful,
- /// this state is committed to the process.
- std::map<Constant*, Constant*> MutatedMemory;
-
- /// AllocaTmps - To 'execute' an alloca, we create a temporary global variable
- /// to represent its body. This vector is needed so we can delete the
- /// temporary globals when we are done.
- std::vector<GlobalVariable*> AllocaTmps;
-
- /// CallStack - This is used to detect recursion. In pathological situations
- /// we could hit exponential behavior, but at least there is nothing
- /// unbounded.
- std::vector<Function*> CallStack;
-
- // Call the function.
- Constant *RetValDummy;
- bool EvalSuccess = EvaluateFunction(F, RetValDummy, std::vector<Constant*>(),
- CallStack, MutatedMemory, AllocaTmps);
- if (EvalSuccess) {
- // We succeeded at evaluation: commit the result.
- DOUT << "FULLY EVALUATED GLOBAL CTOR FUNCTION '"
- << F->getName() << "' to " << MutatedMemory.size()
- << " stores.\n";
- for (std::map<Constant*, Constant*>::iterator I = MutatedMemory.begin(),
- E = MutatedMemory.end(); I != E; ++I)
- CommitValueTo(I->second, I->first);
- }
-
- // At this point, we are done interpreting. If we created any 'alloca'
- // temporaries, release them now.
- while (!AllocaTmps.empty()) {
- GlobalVariable *Tmp = AllocaTmps.back();
- AllocaTmps.pop_back();
-
- // If there are still users of the alloca, the program is doing something
- // silly, e.g. storing the address of the alloca somewhere and using it
- // later. Since this is undefined, we'll just make it be null.
- if (!Tmp->use_empty())
- Tmp->replaceAllUsesWith(Constant::getNullValue(Tmp->getType()));
- delete Tmp;
- }
-
- return EvalSuccess;
-}
-
-
-
-/// OptimizeGlobalCtorsList - Simplify and evaluation global ctors if possible.
-/// Return true if anything changed.
-bool GlobalOpt::OptimizeGlobalCtorsList(GlobalVariable *&GCL) {
- std::vector<Function*> Ctors = ParseGlobalCtors(GCL);
- bool MadeChange = false;
- if (Ctors.empty()) return false;
-
- // Loop over global ctors, optimizing them when we can.
- for (unsigned i = 0; i != Ctors.size(); ++i) {
- Function *F = Ctors[i];
- // Found a null terminator in the middle of the list, prune off the rest of
- // the list.
- if (F == 0) {
- if (i != Ctors.size()-1) {
- Ctors.resize(i+1);
- MadeChange = true;
- }
- break;
- }
-
- // We cannot simplify external ctor functions.
- if (F->empty()) continue;
-
- // If we can evaluate the ctor at compile time, do.
- if (EvaluateStaticConstructor(F)) {
- Ctors.erase(Ctors.begin()+i);
- MadeChange = true;
- --i;
- ++NumCtorsEvaluated;
- continue;
- }
- }
-
- if (!MadeChange) return false;
-
- GCL = InstallGlobalCtors(GCL, Ctors);
- return true;
-}
-
-
-bool GlobalOpt::runOnModule(Module &M) {
- bool Changed = false;
-
- // Try to find the llvm.globalctors list.
- GlobalVariable *GlobalCtors = FindGlobalCtors(M);
-
- bool LocalChange = true;
- while (LocalChange) {
- LocalChange = false;
-
- // Delete functions that are trivially dead, ccc -> fastcc
- LocalChange |= OptimizeFunctions(M);
-
- // Optimize global_ctors list.
- if (GlobalCtors)
- LocalChange |= OptimizeGlobalCtorsList(GlobalCtors);
-
- // Optimize non-address-taken globals.
- LocalChange |= OptimizeGlobalVars(M);
- Changed |= LocalChange;
- }
-
- // TODO: Move all global ctors functions to the end of the module for code
- // layout.
-
- return Changed;
-}
diff --git a/release_23/lib/Transforms/IPO/IPConstantPropagation.cpp b/release_23/lib/Transforms/IPO/IPConstantPropagation.cpp
deleted file mode 100644
index c51c023c6861..000000000000
--- a/release_23/lib/Transforms/IPO/IPConstantPropagation.cpp
+++ /dev/null
@@ -1,237 +0,0 @@
-//===-- IPConstantPropagation.cpp - Propagate constants through calls -----===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This pass implements an _extremely_ simple interprocedural constant
-// propagation pass. It could certainly be improved in many different ways,
-// like using a worklist. This pass makes arguments dead, but does not remove
-// them. The existing dead argument elimination pass should be run after this
-// to clean up the mess.
-//
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "ipconstprop"
-#include "llvm/Transforms/IPO.h"
-#include "llvm/Constants.h"
-#include "llvm/Instructions.h"
-#include "llvm/Module.h"
-#include "llvm/Pass.h"
-#include "llvm/Support/CallSite.h"
-#include "llvm/Support/Compiler.h"
-#include "llvm/ADT/Statistic.h"
-#include "llvm/ADT/SmallVector.h"
-using namespace llvm;
-
-STATISTIC(NumArgumentsProped, "Number of args turned into constants");
-STATISTIC(NumReturnValProped, "Number of return values turned into constants");
-
-namespace {
- /// IPCP - The interprocedural constant propagation pass
- ///
- struct VISIBILITY_HIDDEN IPCP : public ModulePass {
- static char ID; // Pass identification, replacement for typeid
- IPCP() : ModulePass((intptr_t)&ID) {}
-
- bool runOnModule(Module &M);
- private:
- bool PropagateConstantsIntoArguments(Function &F);
- bool PropagateConstantReturn(Function &F);
- };
- char IPCP::ID = 0;
- RegisterPass<IPCP> X("ipconstprop", "Interprocedural constant propagation");
-}
-
-ModulePass *llvm::createIPConstantPropagationPass() { return new IPCP(); }
-
-bool IPCP::runOnModule(Module &M) {
- bool Changed = false;
- bool LocalChange = true;
-
- // FIXME: instead of using smart algorithms, we just iterate until we stop
- // making changes.
- while (LocalChange) {
- LocalChange = false;
- for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I)
- if (!I->isDeclaration()) {
- // Delete any klingons.
- I->removeDeadConstantUsers();
- if (I->hasInternalLinkage())
- LocalChange |= PropagateConstantsIntoArguments(*I);
- Changed |= PropagateConstantReturn(*I);
- }
- Changed |= LocalChange;
- }
- return Changed;
-}
-
-/// PropagateConstantsIntoArguments - Look at all uses of the specified
-/// function. If all uses are direct call sites, and all pass a particular
-/// constant in for an argument, propagate that constant in as the argument.
-///
-bool IPCP::PropagateConstantsIntoArguments(Function &F) {
- if (F.arg_empty() || F.use_empty()) return false; // No arguments? Early exit.
-
- // For each argument, keep track of its constant value and whether it is a
- // constant or not. The bool is driven to true when found to be non-constant.
- SmallVector<std::pair<Constant*, bool>, 16> ArgumentConstants;
- ArgumentConstants.resize(F.arg_size());
-
- unsigned NumNonconstant = 0;
- for (Value::use_iterator UI = F.use_begin(), E = F.use_end(); UI != E; ++UI) {
- // Used by a non-instruction, or not the callee of a function, do not
- // transform.
- if (UI.getOperandNo() != 0 ||
- (!isa<CallInst>(*UI) && !isa<InvokeInst>(*UI)))
- return false;
-
- CallSite CS = CallSite::get(cast<Instruction>(*UI));
-
- // Check out all of the potentially constant arguments. Note that we don't
- // inspect varargs here.
- CallSite::arg_iterator AI = CS.arg_begin();
- Function::arg_iterator Arg = F.arg_begin();
- for (unsigned i = 0, e = ArgumentConstants.size(); i != e;
- ++i, ++AI, ++Arg) {
-
- // If this argument is known non-constant, ignore it.
- if (ArgumentConstants[i].second)
- continue;
-
- Constant *C = dyn_cast<Constant>(*AI);
- if (C && ArgumentConstants[i].first == 0) {
- ArgumentConstants[i].first = C; // First constant seen.
- } else if (C && ArgumentConstants[i].first == C) {
- // Still the constant value we think it is.
- } else if (*AI == &*Arg) {
- // Ignore recursive calls passing argument down.
- } else {
- // Argument became non-constant. If all arguments are non-constant now,
- // give up on this function.
- if (++NumNonconstant == ArgumentConstants.size())
- return false;
- ArgumentConstants[i].second = true;
- }
- }
- }
-
- // If we got to this point, there is a constant argument!
- assert(NumNonconstant != ArgumentConstants.size());
- bool MadeChange = false;
- Function::arg_iterator AI = F.arg_begin();
- for (unsigned i = 0, e = ArgumentConstants.size(); i != e; ++i, ++AI) {
- // Do we have a constant argument?
- if (ArgumentConstants[i].second || AI->use_empty())
- continue;
-
- Value *V = ArgumentConstants[i].first;
- if (V == 0) V = UndefValue::get(AI->getType());
- AI->replaceAllUsesWith(V);
- ++NumArgumentsProped;
- MadeChange = true;
- }
- return MadeChange;
-}
-
-
-// Check to see if this function returns a constant. If so, replace all callers
-// that user the return value with the returned valued. If we can replace ALL
-// callers,
-bool IPCP::PropagateConstantReturn(Function &F) {
- if (F.getReturnType() == Type::VoidTy)
- return false; // No return value.
-
- // Check to see if this function returns a constant.
- SmallVector<Value *,4> RetVals;
- const StructType *STy = dyn_cast<StructType>(F.getReturnType());
- if (STy)
- RetVals.assign(STy->getNumElements(), 0);
- else
- RetVals.push_back(0);
-
- for (Function::iterator BB = F.begin(), E = F.end(); BB != E; ++BB)
- if (ReturnInst *RI = dyn_cast<ReturnInst>(BB->getTerminator())) {
- assert(RetVals.size() == RI->getNumOperands() &&
- "Invalid ReturnInst operands!");
- for (unsigned i = 0, e = RetVals.size(); i != e; ++i) {
- if (isa<UndefValue>(RI->getOperand(i)))
- continue; // Ignore
- Constant *C = dyn_cast<Constant>(RI->getOperand(i));
- if (C == 0)
- return false; // Does not return a constant.
-
- Value *RV = RetVals[i];
- if (RV == 0)
- RetVals[i] = C;
- else if (RV != C)
- return false; // Does not return the same constant.
- }
- }
-
- if (STy) {
- for (unsigned i = 0, e = RetVals.size(); i < e; ++i)
- if (RetVals[i] == 0)
- RetVals[i] = UndefValue::get(STy->getElementType(i));
- } else {
- assert(RetVals.size() == 1);
- if (RetVals[0] == 0)
- RetVals[0] = UndefValue::get(F.getReturnType());
- }
-
- // If we got here, the function returns a constant value. Loop over all
- // users, replacing any uses of the return value with the returned constant.
- bool ReplacedAllUsers = true;
- bool MadeChange = false;
- for (Value::use_iterator UI = F.use_begin(), E = F.use_end(); UI != E; ++UI) {
- // Make sure this is an invoke or call and that the use is for the callee.
- if (!(isa<InvokeInst>(*UI) || isa<CallInst>(*UI)) ||
- UI.getOperandNo() != 0) {
- ReplacedAllUsers = false;
- continue;
- }
-
- Instruction *Call = cast<Instruction>(*UI);
- if (Call->use_empty())
- continue;
-
- MadeChange = true;
-
- if (STy == 0) {
- Call->replaceAllUsesWith(RetVals[0]);
- continue;
- }
-
- while (!Call->use_empty()) {
- GetResultInst *GR = cast<GetResultInst>(Call->use_back());
- GR->replaceAllUsesWith(RetVals[GR->getIndex()]);
- GR->eraseFromParent();
- }
- }
-
- // If we replace all users with the returned constant, and there can be no
- // other callers of the function, replace the constant being returned in the
- // function with an undef value.
- if (ReplacedAllUsers && F.hasInternalLinkage()) {
- for (Function::iterator BB = F.begin(), E = F.end(); BB != E; ++BB) {
- if (ReturnInst *RI = dyn_cast<ReturnInst>(BB->getTerminator())) {
- for (unsigned i = 0, e = RetVals.size(); i < e; ++i) {
- Value *RetVal = RetVals[i];
- if (isa<UndefValue>(RetVal))
- continue;
- Value *RV = UndefValue::get(RetVal->getType());
- if (RI->getOperand(i) != RV) {
- RI->setOperand(i, RV);
- MadeChange = true;
- }
- }
- }
- }
- }
-
- if (MadeChange) ++NumReturnValProped;
- return MadeChange;
-}
diff --git a/release_23/lib/Transforms/IPO/IndMemRemoval.cpp b/release_23/lib/Transforms/IPO/IndMemRemoval.cpp
deleted file mode 100644
index 2f9c34d5cf6f..000000000000
--- a/release_23/lib/Transforms/IPO/IndMemRemoval.cpp
+++ /dev/null
@@ -1,89 +0,0 @@
-//===-- IndMemRemoval.cpp - Remove indirect allocations and frees ----------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This pass finds places where memory allocation functions may escape into
-// indirect land. Some transforms are much easier (aka possible) only if free
-// or malloc are not called indirectly.
-// Thus find places where the address of memory functions are taken and construct
-// bounce functions with direct calls of those functions.
-//
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "indmemrem"
-#include "llvm/Transforms/IPO.h"
-#include "llvm/Pass.h"
-#include "llvm/Module.h"
-#include "llvm/Instructions.h"
-#include "llvm/Type.h"
-#include "llvm/DerivedTypes.h"
-#include "llvm/ADT/Statistic.h"
-#include "llvm/Support/Compiler.h"
-using namespace llvm;
-
-STATISTIC(NumBounceSites, "Number of sites modified");
-STATISTIC(NumBounce , "Number of bounce functions created");
-
-namespace {
- class VISIBILITY_HIDDEN IndMemRemPass : public ModulePass {
- public:
- static char ID; // Pass identification, replacement for typeid
- IndMemRemPass() : ModulePass((intptr_t)&ID) {}
-
- virtual bool runOnModule(Module &M);
- };
- char IndMemRemPass::ID = 0;
- RegisterPass<IndMemRemPass> X("indmemrem","Indirect Malloc and Free Removal");
-} // end anonymous namespace
-
-
-bool IndMemRemPass::runOnModule(Module &M) {
- //in Theory, all direct calls of malloc and free should be promoted
- //to intrinsics. Therefor, this goes through and finds where the
- //address of free or malloc are taken and replaces those with bounce
- //functions, ensuring that all malloc and free that might happen
- //happen through intrinsics.
- bool changed = false;
- if (Function* F = M.getFunction("free")) {
- assert(F->isDeclaration() && "free not external?");
- if (!F->use_empty()) {
- Function* FN = Function::Create(F->getFunctionType(),
- GlobalValue::LinkOnceLinkage,
- "free_llvm_bounce", &M);
- BasicBlock* bb = BasicBlock::Create("entry",FN);
- Instruction* R = ReturnInst::Create(bb);
- new FreeInst(FN->arg_begin(), R);
- ++NumBounce;
- NumBounceSites += F->getNumUses();
- F->replaceAllUsesWith(FN);
- changed = true;
- }
- }
- if (Function* F = M.getFunction("malloc")) {
- assert(F->isDeclaration() && "malloc not external?");
- if (!F->use_empty()) {
- Function* FN = Function::Create(F->getFunctionType(),
- GlobalValue::LinkOnceLinkage,
- "malloc_llvm_bounce", &M);
- BasicBlock* bb = BasicBlock::Create("entry",FN);
- Instruction* c = CastInst::createIntegerCast(
- FN->arg_begin(), Type::Int32Ty, false, "c", bb);
- Instruction* a = new MallocInst(Type::Int8Ty, c, "m", bb);
- ReturnInst::Create(a, bb);
- ++NumBounce;
- NumBounceSites += F->getNumUses();
- F->replaceAllUsesWith(FN);
- changed = true;
- }
- }
- return changed;
-}
-
-ModulePass *llvm::createIndMemRemPass() {
- return new IndMemRemPass();
-}
diff --git a/release_23/lib/Transforms/IPO/InlineSimple.cpp b/release_23/lib/Transforms/IPO/InlineSimple.cpp
deleted file mode 100644
index a007103a5990..000000000000
--- a/release_23/lib/Transforms/IPO/InlineSimple.cpp
+++ /dev/null
@@ -1,96 +0,0 @@
-//===- InlineSimple.cpp - Code to perform simple function inlining --------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements bottom-up inlining of functions into callees.
-//
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "inline"
-#include "llvm/CallingConv.h"
-#include "llvm/Instructions.h"
-#include "llvm/IntrinsicInst.h"
-#include "llvm/Module.h"
-#include "llvm/Type.h"
-#include "llvm/Analysis/CallGraph.h"
-#include "llvm/Support/CallSite.h"
-#include "llvm/Support/Compiler.h"
-#include "llvm/Transforms/IPO.h"
-#include "llvm/Transforms/IPO/InlinerPass.h"
-#include "llvm/Transforms/Utils/InlineCost.h"
-#include "llvm/ADT/SmallPtrSet.h"
-
-using namespace llvm;
-
-namespace {
-
- class VISIBILITY_HIDDEN SimpleInliner : public Inliner {
- // Functions that are never inlined
- SmallPtrSet<const Function*, 16> NeverInline;
- InlineCostAnalyzer CA;
- public:
- SimpleInliner() : Inliner(&ID) {}
- SimpleInliner(int Threshold) : Inliner(&ID, Threshold) {}
- static char ID; // Pass identification, replacement for typeid
- int getInlineCost(CallSite CS) {
- return CA.getInlineCost(CS, NeverInline);
- }
- float getInlineFudgeFactor(CallSite CS) {
- return CA.getInlineFudgeFactor(CS);
- }
- virtual bool doInitialization(CallGraph &CG);
- };
- char SimpleInliner::ID = 0;
- RegisterPass<SimpleInliner> X("inline", "Function Integration/Inlining");
-}
-
-Pass *llvm::createFunctionInliningPass() { return new SimpleInliner(); }
-
-Pass *llvm::createFunctionInliningPass(int Threshold) {
- return new SimpleInliner(Threshold);
-}
-
-// doInitialization - Initializes the vector of functions that have been
-// annotated with the noinline attribute.
-bool SimpleInliner::doInitialization(CallGraph &CG) {
-
- Module &M = CG.getModule();
-
- // Get llvm.noinline
- GlobalVariable *GV = M.getNamedGlobal("llvm.noinline");
-
- if (GV == 0)
- return false;
-
- // Don't crash on invalid code
- if (!GV->hasInitializer())
- return false;
-
- const ConstantArray *InitList = dyn_cast<ConstantArray>(GV->getInitializer());
-
- if (InitList == 0)
- return false;
-
- // Iterate over each element and add to the NeverInline set
- for (unsigned i = 0, e = InitList->getNumOperands(); i != e; ++i) {
-
- // Get Source
- const Constant *Elt = InitList->getOperand(i);
-
- if (const ConstantExpr *CE = dyn_cast<ConstantExpr>(Elt))
- if (CE->getOpcode() == Instruction::BitCast)
- Elt = CE->getOperand(0);
-
- // Insert into set of functions to never inline
- if (const Function *F = dyn_cast<Function>(Elt))
- NeverInline.insert(F);
- }
-
- return false;
-}
-
diff --git a/release_23/lib/Transforms/IPO/Inliner.cpp b/release_23/lib/Transforms/IPO/Inliner.cpp
deleted file mode 100644
index f44e78429b62..000000000000
--- a/release_23/lib/Transforms/IPO/Inliner.cpp
+++ /dev/null
@@ -1,222 +0,0 @@
-//===- Inliner.cpp - Code common to all inliners --------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the mechanics required to implement inlining without
-// missing any calls and updating the call graph. The decisions of which calls
-// are profitable to inline are implemented elsewhere.
-//
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "inline"
-#include "llvm/Module.h"
-#include "llvm/Instructions.h"
-#include "llvm/Analysis/CallGraph.h"
-#include "llvm/Support/CallSite.h"
-#include "llvm/Target/TargetData.h"
-#include "llvm/Transforms/IPO/InlinerPass.h"
-#include "llvm/Transforms/Utils/Cloning.h"
-#include "llvm/Support/CommandLine.h"
-#include "llvm/Support/Debug.h"
-#include "llvm/ADT/Statistic.h"
-#include <set>
-using namespace llvm;
-
-STATISTIC(NumInlined, "Number of functions inlined");
-STATISTIC(NumDeleted, "Number of functions deleted because all callers found");
-
-namespace {
- static cl::opt<int>
- InlineLimit("inline-threshold", cl::Hidden, cl::init(200),
- cl::desc("Control the amount of inlining to perform (default = 200)"));
-}
-
-Inliner::Inliner(const void *ID)
- : CallGraphSCCPass((intptr_t)ID), InlineThreshold(InlineLimit) {}
-
-Inliner::Inliner(const void *ID, int Threshold)
- : CallGraphSCCPass((intptr_t)ID), InlineThreshold(Threshold) {}
-
-/// getAnalysisUsage - For this class, we declare that we require and preserve
-/// the call graph. If the derived class implements this method, it should
-/// always explicitly call the implementation here.
-void Inliner::getAnalysisUsage(AnalysisUsage &Info) const {
- Info.addRequired<TargetData>();
- CallGraphSCCPass::getAnalysisUsage(Info);
-}
-
-// InlineCallIfPossible - If it is possible to inline the specified call site,
-// do so and update the CallGraph for this operation.
-static bool InlineCallIfPossible(CallSite CS, CallGraph &CG,
- const std::set<Function*> &SCCFunctions,
- const TargetData &TD) {
- Function *Callee = CS.getCalledFunction();
- if (!InlineFunction(CS, &CG, &TD)) return false;
-
- // If we inlined the last possible call site to the function, delete the
- // function body now.
- if (Callee->use_empty() && Callee->hasInternalLinkage() &&
- !SCCFunctions.count(Callee)) {
- DOUT << " -> Deleting dead function: " << Callee->getName() << "\n";
-
- // Remove any call graph edges from the callee to its callees.
- CallGraphNode *CalleeNode = CG[Callee];
- while (!CalleeNode->empty())
- CalleeNode->removeCallEdgeTo((CalleeNode->end()-1)->second);
-
- // Removing the node for callee from the call graph and delete it.
- delete CG.removeFunctionFromModule(CalleeNode);
- ++NumDeleted;
- }
- return true;
-}
-
-bool Inliner::runOnSCC(const std::vector<CallGraphNode*> &SCC) {
- CallGraph &CG = getAnalysis<CallGraph>();
-
- std::set<Function*> SCCFunctions;
- DOUT << "Inliner visiting SCC:";
- for (unsigned i = 0, e = SCC.size(); i != e; ++i) {
- Function *F = SCC[i]->getFunction();
- if (F) SCCFunctions.insert(F);
- DOUT << " " << (F ? F->getName() : "INDIRECTNODE");
- }
-
- // Scan through and identify all call sites ahead of time so that we only
- // inline call sites in the original functions, not call sites that result
- // from inlining other functions.
- std::vector<CallSite> CallSites;
-
- for (unsigned i = 0, e = SCC.size(); i != e; ++i)
- if (Function *F = SCC[i]->getFunction())
- for (Function::iterator BB = F->begin(), E = F->end(); BB != E; ++BB)
- for (BasicBlock::iterator I = BB->begin(); I != BB->end(); ++I) {
- CallSite CS = CallSite::get(I);
- if (CS.getInstruction() && (!CS.getCalledFunction() ||
- !CS.getCalledFunction()->isDeclaration()))
- CallSites.push_back(CS);
- }
-
- DOUT << ": " << CallSites.size() << " call sites.\n";
-
- // Now that we have all of the call sites, move the ones to functions in the
- // current SCC to the end of the list.
- unsigned FirstCallInSCC = CallSites.size();
- for (unsigned i = 0; i < FirstCallInSCC; ++i)
- if (Function *F = CallSites[i].getCalledFunction())
- if (SCCFunctions.count(F))
- std::swap(CallSites[i--], CallSites[--FirstCallInSCC]);
-
- // Now that we have all of the call sites, loop over them and inline them if
- // it looks profitable to do so.
- bool Changed = false;
- bool LocalChange;
- do {
- LocalChange = false;
- // Iterate over the outer loop because inlining functions can cause indirect
- // calls to become direct calls.
- for (unsigned CSi = 0; CSi != CallSites.size(); ++CSi)
- if (Function *Callee = CallSites[CSi].getCalledFunction()) {
- // Calls to external functions are never inlinable.
- if (Callee->isDeclaration() ||
- CallSites[CSi].getInstruction()->getParent()->getParent() ==Callee){
- if (SCC.size() == 1) {
- std::swap(CallSites[CSi], CallSites.back());
- CallSites.pop_back();
- } else {
- // Keep the 'in SCC / not in SCC' boundary correct.
- CallSites.erase(CallSites.begin()+CSi);
- }
- --CSi;
- continue;
- }
-
- // If the policy determines that we should inline this function,
- // try to do so.
- CallSite CS = CallSites[CSi];
- int InlineCost = getInlineCost(CS);
- float FudgeFactor = getInlineFudgeFactor(CS);
-
- if (InlineCost >= (int)(InlineThreshold * FudgeFactor)) {
- DOUT << " NOT Inlining: cost=" << InlineCost
- << ", Call: " << *CS.getInstruction();
- } else {
- DOUT << " Inlining: cost=" << InlineCost
- << ", Call: " << *CS.getInstruction();
-
- // Attempt to inline the function...
- if (InlineCallIfPossible(CS, CG, SCCFunctions,
- getAnalysis<TargetData>())) {
- // Remove this call site from the list. If possible, use
- // swap/pop_back for efficiency, but do not use it if doing so would
- // move a call site to a function in this SCC before the
- // 'FirstCallInSCC' barrier.
- if (SCC.size() == 1) {
- std::swap(CallSites[CSi], CallSites.back());
- CallSites.pop_back();
- } else {
- CallSites.erase(CallSites.begin()+CSi);
- }
- --CSi;
-
- ++NumInlined;
- Changed = true;
- LocalChange = true;
- }
- }
- }
- } while (LocalChange);
-
- return Changed;
-}
-
-// doFinalization - Remove now-dead linkonce functions at the end of
-// processing to avoid breaking the SCC traversal.
-bool Inliner::doFinalization(CallGraph &CG) {
- std::set<CallGraphNode*> FunctionsToRemove;
-
- // Scan for all of the functions, looking for ones that should now be removed
- // from the program. Insert the dead ones in the FunctionsToRemove set.
- for (CallGraph::iterator I = CG.begin(), E = CG.end(); I != E; ++I) {
- CallGraphNode *CGN = I->second;
- if (Function *F = CGN ? CGN->getFunction() : 0) {
- // If the only remaining users of the function are dead constants, remove
- // them.
- F->removeDeadConstantUsers();
-
- if ((F->hasLinkOnceLinkage() || F->hasInternalLinkage()) &&
- F->use_empty()) {
-
- // Remove any call graph edges from the function to its callees.
- while (!CGN->empty())
- CGN->removeCallEdgeTo((CGN->end()-1)->second);
-
- // Remove any edges from the external node to the function's call graph
- // node. These edges might have been made irrelegant due to
- // optimization of the program.
- CG.getExternalCallingNode()->removeAnyCallEdgeTo(CGN);
-
- // Removing the node for callee from the call graph and delete it.
- FunctionsToRemove.insert(CGN);
- }
- }
- }
-
- // Now that we know which functions to delete, do so. We didn't want to do
- // this inline, because that would invalidate our CallGraph::iterator
- // objects. :(
- bool Changed = false;
- for (std::set<CallGraphNode*>::iterator I = FunctionsToRemove.begin(),
- E = FunctionsToRemove.end(); I != E; ++I) {
- delete CG.removeFunctionFromModule(*I);
- ++NumDeleted;
- Changed = true;
- }
-
- return Changed;
-}
diff --git a/release_23/lib/Transforms/IPO/Internalize.cpp b/release_23/lib/Transforms/IPO/Internalize.cpp
deleted file mode 100644
index f3adb5692f17..000000000000
--- a/release_23/lib/Transforms/IPO/Internalize.cpp
+++ /dev/null
@@ -1,156 +0,0 @@
-//===-- Internalize.cpp - Mark functions internal -------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This pass loops over all of the functions in the input module, looking for a
-// main function. If a main function is found, all other functions and all
-// global variables with initializers are marked as internal.
-//
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "internalize"
-#include "llvm/Transforms/IPO.h"
-#include "llvm/Pass.h"
-#include "llvm/Module.h"
-#include "llvm/Support/CommandLine.h"
-#include "llvm/Support/Compiler.h"
-#include "llvm/Support/Debug.h"
-#include "llvm/ADT/Statistic.h"
-#include <fstream>
-#include <set>
-using namespace llvm;
-
-STATISTIC(NumFunctions, "Number of functions internalized");
-STATISTIC(NumGlobals , "Number of global vars internalized");
-
-namespace {
-
- // APIFile - A file which contains a list of symbols that should not be marked
- // external.
- static cl::opt<std::string>
- APIFile("internalize-public-api-file", cl::value_desc("filename"),
- cl::desc("A file containing list of symbol names to preserve"));
-
- // APIList - A list of symbols that should not be marked internal.
- static cl::list<std::string>
- APIList("internalize-public-api-list", cl::value_desc("list"),
- cl::desc("A list of symbol names to preserve"),
- cl::CommaSeparated);
-
- class VISIBILITY_HIDDEN InternalizePass : public ModulePass {
- std::set<std::string> ExternalNames;
- bool DontInternalize;
- public:
- static char ID; // Pass identification, replacement for typeid
- explicit InternalizePass(bool InternalizeEverything = true);
- explicit InternalizePass(const std::vector <const char *>& exportList);
- void LoadFile(const char *Filename);
- virtual bool runOnModule(Module &M);
- };
- char InternalizePass::ID = 0;
- RegisterPass<InternalizePass> X("internalize", "Internalize Global Symbols");
-} // end anonymous namespace
-
-InternalizePass::InternalizePass(bool InternalizeEverything)
- : ModulePass((intptr_t)&ID), DontInternalize(false){
- if (!APIFile.empty()) // If a filename is specified, use it
- LoadFile(APIFile.c_str());
- else if (!APIList.empty()) // Else, if a list is specified, use it.
- ExternalNames.insert(APIList.begin(), APIList.end());
- else if (!InternalizeEverything)
- // Finally, if we're allowed to, internalize all but main.
- DontInternalize = true;
-}
-
-InternalizePass::InternalizePass(const std::vector<const char *>&exportList)
- : ModulePass((intptr_t)&ID), DontInternalize(false){
- for(std::vector<const char *>::const_iterator itr = exportList.begin();
- itr != exportList.end(); itr++) {
- ExternalNames.insert(*itr);
- }
-}
-
-void InternalizePass::LoadFile(const char *Filename) {
- // Load the APIFile...
- std::ifstream In(Filename);
- if (!In.good()) {
- cerr << "WARNING: Internalize couldn't load file '" << Filename << "'!\n";
- return; // Do not internalize anything...
- }
- while (In) {
- std::string Symbol;
- In >> Symbol;
- if (!Symbol.empty())
- ExternalNames.insert(Symbol);
- }
-}
-
-bool InternalizePass::runOnModule(Module &M) {
- if (DontInternalize) return false;
-
- // If no list or file of symbols was specified, check to see if there is a
- // "main" symbol defined in the module. If so, use it, otherwise do not
- // internalize the module, it must be a library or something.
- //
- if (ExternalNames.empty()) {
- Function *MainFunc = M.getFunction("main");
- if (MainFunc == 0 || MainFunc->isDeclaration())
- return false; // No main found, must be a library...
-
- // Preserve main, internalize all else.
- ExternalNames.insert(MainFunc->getName());
- }
-
- bool Changed = false;
-
- // Found a main function, mark all functions not named main as internal.
- for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I)
- if (!I->isDeclaration() && // Function must be defined here
- !I->hasInternalLinkage() && // Can't already have internal linkage
- !ExternalNames.count(I->getName())) {// Not marked to keep external?
- I->setLinkage(GlobalValue::InternalLinkage);
- Changed = true;
- ++NumFunctions;
- DOUT << "Internalizing func " << I->getName() << "\n";
- }
-
- // Never internalize the llvm.used symbol. It is used to implement
- // attribute((used)).
- ExternalNames.insert("llvm.used");
-
- // Never internalize anchors used by the machine module info, else the info
- // won't find them. (see MachineModuleInfo.)
- ExternalNames.insert("llvm.dbg.compile_units");
- ExternalNames.insert("llvm.dbg.global_variables");
- ExternalNames.insert("llvm.dbg.subprograms");
- ExternalNames.insert("llvm.global_ctors");
- ExternalNames.insert("llvm.global_dtors");
- ExternalNames.insert("llvm.noinline");
- ExternalNames.insert("llvm.global.annotations");
-
- // Mark all global variables with initializers as internal as well.
- for (Module::global_iterator I = M.global_begin(), E = M.global_end();
- I != E; ++I)
- if (!I->isDeclaration() && !I->hasInternalLinkage() &&
- !ExternalNames.count(I->getName())) {
- I->setLinkage(GlobalValue::InternalLinkage);
- Changed = true;
- ++NumGlobals;
- DOUT << "Internalized gvar " << I->getName() << "\n";
- }
-
- return Changed;
-}
-
-ModulePass *llvm::createInternalizePass(bool InternalizeEverything) {
- return new InternalizePass(InternalizeEverything);
-}
-
-ModulePass *llvm::createInternalizePass(const std::vector <const char *> &el) {
- return new InternalizePass(el);
-}
diff --git a/release_23/lib/Transforms/IPO/LoopExtractor.cpp b/release_23/lib/Transforms/IPO/LoopExtractor.cpp
deleted file mode 100644
index 54fc44252e78..000000000000
--- a/release_23/lib/Transforms/IPO/LoopExtractor.cpp
+++ /dev/null
@@ -1,259 +0,0 @@
-//===- LoopExtractor.cpp - Extract each loop into a new function ----------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// A pass wrapper around the ExtractLoop() scalar transformation to extract each
-// top-level loop into its own new function. If the loop is the ONLY loop in a
-// given function, it is not touched. This is a pass most useful for debugging
-// via bugpoint.
-//
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "loop-extract"
-#include "llvm/Transforms/IPO.h"
-#include "llvm/Instructions.h"
-#include "llvm/Module.h"
-#include "llvm/Pass.h"
-#include "llvm/Analysis/Dominators.h"
-#include "llvm/Analysis/LoopInfo.h"
-#include "llvm/Support/CommandLine.h"
-#include "llvm/Support/Compiler.h"
-#include "llvm/Transforms/Scalar.h"
-#include "llvm/Transforms/Utils/FunctionUtils.h"
-#include "llvm/ADT/Statistic.h"
-#include <fstream>
-#include <set>
-using namespace llvm;
-
-STATISTIC(NumExtracted, "Number of loops extracted");
-
-namespace {
- // FIXME: This is not a function pass, but the PassManager doesn't allow
- // Module passes to require FunctionPasses, so we can't get loop info if we're
- // not a function pass.
- struct VISIBILITY_HIDDEN LoopExtractor : public FunctionPass {
- static char ID; // Pass identification, replacement for typeid
- unsigned NumLoops;
-
- explicit LoopExtractor(unsigned numLoops = ~0)
- : FunctionPass((intptr_t)&ID), NumLoops(numLoops) {}
-
- virtual bool runOnFunction(Function &F);
-
- virtual void getAnalysisUsage(AnalysisUsage &AU) const {
- AU.addRequiredID(BreakCriticalEdgesID);
- AU.addRequiredID(LoopSimplifyID);
- AU.addRequired<DominatorTree>();
- AU.addRequired<LoopInfo>();
- }
- };
-
- char LoopExtractor::ID = 0;
- RegisterPass<LoopExtractor>
- X("loop-extract", "Extract loops into new functions");
-
- /// SingleLoopExtractor - For bugpoint.
- struct SingleLoopExtractor : public LoopExtractor {
- static char ID; // Pass identification, replacement for typeid
- SingleLoopExtractor() : LoopExtractor(1) {}
- };
-
- char SingleLoopExtractor::ID = 0;
- RegisterPass<SingleLoopExtractor>
- Y("loop-extract-single", "Extract at most one loop into a new function");
-} // End anonymous namespace
-
-// createLoopExtractorPass - This pass extracts all natural loops from the
-// program into a function if it can.
-//
-FunctionPass *llvm::createLoopExtractorPass() { return new LoopExtractor(); }
-
-bool LoopExtractor::runOnFunction(Function &F) {
- LoopInfo &LI = getAnalysis<LoopInfo>();
-
- // If this function has no loops, there is nothing to do.
- if (LI.begin() == LI.end())
- return false;
-
- DominatorTree &DT = getAnalysis<DominatorTree>();
-
- // If there is more than one top-level loop in this function, extract all of
- // the loops.
- bool Changed = false;
- if (LI.end()-LI.begin() > 1) {
- for (LoopInfo::iterator i = LI.begin(), e = LI.end(); i != e; ++i) {
- if (NumLoops == 0) return Changed;
- --NumLoops;
- Changed |= ExtractLoop(DT, *i) != 0;
- ++NumExtracted;
- }
- } else {
- // Otherwise there is exactly one top-level loop. If this function is more
- // than a minimal wrapper around the loop, extract the loop.
- Loop *TLL = *LI.begin();
- bool ShouldExtractLoop = false;
-
- // Extract the loop if the entry block doesn't branch to the loop header.
- TerminatorInst *EntryTI = F.getEntryBlock().getTerminator();
- if (!isa<BranchInst>(EntryTI) ||
- !cast<BranchInst>(EntryTI)->isUnconditional() ||
- EntryTI->getSuccessor(0) != TLL->getHeader())
- ShouldExtractLoop = true;
- else {
- // Check to see if any exits from the loop are more than just return
- // blocks.
- SmallVector<BasicBlock*, 8> ExitBlocks;
- TLL->getExitBlocks(ExitBlocks);
- for (unsigned i = 0, e = ExitBlocks.size(); i != e; ++i)
- if (!isa<ReturnInst>(ExitBlocks[i]->getTerminator())) {
- ShouldExtractLoop = true;
- break;
- }
- }
-
- if (ShouldExtractLoop) {
- if (NumLoops == 0) return Changed;
- --NumLoops;
- Changed |= ExtractLoop(DT, TLL) != 0;
- ++NumExtracted;
- } else {
- // Okay, this function is a minimal container around the specified loop.
- // If we extract the loop, we will continue to just keep extracting it
- // infinitely... so don't extract it. However, if the loop contains any
- // subloops, extract them.
- for (Loop::iterator i = TLL->begin(), e = TLL->end(); i != e; ++i) {
- if (NumLoops == 0) return Changed;
- --NumLoops;
- Changed |= ExtractLoop(DT, *i) != 0;
- ++NumExtracted;
- }
- }
- }
-
- return Changed;
-}
-
-// createSingleLoopExtractorPass - This pass extracts one natural loop from the
-// program into a function if it can. This is used by bugpoint.
-//
-FunctionPass *llvm::createSingleLoopExtractorPass() {
- return new SingleLoopExtractor();
-}
-
-
-namespace {
- // BlockFile - A file which contains a list of blocks that should not be
- // extracted.
- static cl::opt<std::string>
- BlockFile("extract-blocks-file", cl::value_desc("filename"),
- cl::desc("A file containing list of basic blocks to not extract"),
- cl::Hidden);
-
- /// BlockExtractorPass - This pass is used by bugpoint to extract all blocks
- /// from the module into their own functions except for those specified by the
- /// BlocksToNotExtract list.
- class BlockExtractorPass : public ModulePass {
- void LoadFile(const char *Filename);
-
- std::vector<BasicBlock*> BlocksToNotExtract;
- std::vector<std::pair<std::string, std::string> > BlocksToNotExtractByName;
- public:
- static char ID; // Pass identification, replacement for typeid
- explicit BlockExtractorPass(const std::vector<BasicBlock*> &B)
- : ModulePass((intptr_t)&ID), BlocksToNotExtract(B) {
- if (!BlockFile.empty())
- LoadFile(BlockFile.c_str());
- }
- BlockExtractorPass() : ModulePass((intptr_t)&ID) {}
-
- bool runOnModule(Module &M);
- };
-
- char BlockExtractorPass::ID = 0;
- RegisterPass<BlockExtractorPass>
- XX("extract-blocks", "Extract Basic Blocks From Module (for bugpoint use)");
-}
-
-// createBlockExtractorPass - This pass extracts all blocks (except those
-// specified in the argument list) from the functions in the module.
-//
-ModulePass *llvm::createBlockExtractorPass(const std::vector<BasicBlock*> &BTNE)
-{
- return new BlockExtractorPass(BTNE);
-}
-
-void BlockExtractorPass::LoadFile(const char *Filename) {
- // Load the BlockFile...
- std::ifstream In(Filename);
- if (!In.good()) {
- cerr << "WARNING: BlockExtractor couldn't load file '" << Filename
- << "'!\n";
- return;
- }
- while (In) {
- std::string FunctionName, BlockName;
- In >> FunctionName;
- In >> BlockName;
- if (!BlockName.empty())
- BlocksToNotExtractByName.push_back(
- std::make_pair(FunctionName, BlockName));
- }
-}
-
-bool BlockExtractorPass::runOnModule(Module &M) {
- std::set<BasicBlock*> TranslatedBlocksToNotExtract;
- for (unsigned i = 0, e = BlocksToNotExtract.size(); i != e; ++i) {
- BasicBlock *BB = BlocksToNotExtract[i];
- Function *F = BB->getParent();
-
- // Map the corresponding function in this module.
- Function *MF = M.getFunction(F->getName());
- assert(MF->getFunctionType() == F->getFunctionType() && "Wrong function?");
-
- // Figure out which index the basic block is in its function.
- Function::iterator BBI = MF->begin();
- std::advance(BBI, std::distance(F->begin(), Function::iterator(BB)));
- TranslatedBlocksToNotExtract.insert(BBI);
- }
-
- while (!BlocksToNotExtractByName.empty()) {
- // There's no way to find BBs by name without looking at every BB inside
- // every Function. Fortunately, this is always empty except when used by
- // bugpoint in which case correctness is more important than performance.
-
- std::string &FuncName = BlocksToNotExtractByName.back().first;
- std::string &BlockName = BlocksToNotExtractByName.back().second;
-
- for (Module::iterator FI = M.begin(), FE = M.end(); FI != FE; ++FI) {
- Function &F = *FI;
- if (F.getName() != FuncName) continue;
-
- for (Function::iterator BI = F.begin(), BE = F.end(); BI != BE; ++BI) {
- BasicBlock &BB = *BI;
- if (BB.getName() != BlockName) continue;
-
- TranslatedBlocksToNotExtract.insert(BI);
- }
- }
-
- BlocksToNotExtractByName.pop_back();
- }
-
- // Now that we know which blocks to not extract, figure out which ones we WANT
- // to extract.
- std::vector<BasicBlock*> BlocksToExtract;
- for (Module::iterator F = M.begin(), E = M.end(); F != E; ++F)
- for (Function::iterator BB = F->begin(), E = F->end(); BB != E; ++BB)
- if (!TranslatedBlocksToNotExtract.count(BB))
- BlocksToExtract.push_back(BB);
-
- for (unsigned i = 0, e = BlocksToExtract.size(); i != e; ++i)
- ExtractBasicBlock(BlocksToExtract[i]);
-
- return !BlocksToExtract.empty();
-}
diff --git a/release_23/lib/Transforms/IPO/LowerSetJmp.cpp b/release_23/lib/Transforms/IPO/LowerSetJmp.cpp
deleted file mode 100644
index 2db8257b84fd..000000000000
--- a/release_23/lib/Transforms/IPO/LowerSetJmp.cpp
+++ /dev/null
@@ -1,541 +0,0 @@
-//===- LowerSetJmp.cpp - Code pertaining to lowering set/long jumps -------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the lowering of setjmp and longjmp to use the
-// LLVM invoke and unwind instructions as necessary.
-//
-// Lowering of longjmp is fairly trivial. We replace the call with a
-// call to the LLVM library function "__llvm_sjljeh_throw_longjmp()".
-// This unwinds the stack for us calling all of the destructors for
-// objects allocated on the stack.
-//
-// At a setjmp call, the basic block is split and the setjmp removed.
-// The calls in a function that have a setjmp are converted to invoke
-// where the except part checks to see if it's a longjmp exception and,
-// if so, if it's handled in the function. If it is, then it gets the
-// value returned by the longjmp and goes to where the basic block was
-// split. Invoke instructions are handled in a similar fashion with the
-// original except block being executed if it isn't a longjmp except
-// that is handled by that function.
-//
-//===----------------------------------------------------------------------===//
-
-//===----------------------------------------------------------------------===//
-// FIXME: This pass doesn't deal with PHI statements just yet. That is,
-// we expect this to occur before SSAification is done. This would seem
-// to make sense, but in general, it might be a good idea to make this
-// pass invokable via the "opt" command at will.
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "lowersetjmp"
-#include "llvm/Transforms/IPO.h"
-#include "llvm/Constants.h"
-#include "llvm/DerivedTypes.h"
-#include "llvm/Instructions.h"
-#include "llvm/Intrinsics.h"
-#include "llvm/Module.h"
-#include "llvm/Pass.h"
-#include "llvm/Support/CFG.h"
-#include "llvm/Support/Compiler.h"
-#include "llvm/Support/InstVisitor.h"
-#include "llvm/Transforms/Utils/Local.h"
-#include "llvm/ADT/DepthFirstIterator.h"
-#include "llvm/ADT/Statistic.h"
-#include "llvm/ADT/StringExtras.h"
-#include "llvm/ADT/VectorExtras.h"
-#include "llvm/ADT/SmallVector.h"
-#include <map>
-using namespace llvm;
-
-STATISTIC(LongJmpsTransformed, "Number of longjmps transformed");
-STATISTIC(SetJmpsTransformed , "Number of setjmps transformed");
-STATISTIC(CallsTransformed , "Number of calls invokified");
-STATISTIC(InvokesTransformed , "Number of invokes modified");
-
-namespace {
- //===--------------------------------------------------------------------===//
- // LowerSetJmp pass implementation.
- class VISIBILITY_HIDDEN LowerSetJmp : public ModulePass,
- public InstVisitor<LowerSetJmp> {
- // LLVM library functions...
- Constant *InitSJMap; // __llvm_sjljeh_init_setjmpmap
- Constant *DestroySJMap; // __llvm_sjljeh_destroy_setjmpmap
- Constant *AddSJToMap; // __llvm_sjljeh_add_setjmp_to_map
- Constant *ThrowLongJmp; // __llvm_sjljeh_throw_longjmp
- Constant *TryCatchLJ; // __llvm_sjljeh_try_catching_longjmp_exception
- Constant *IsLJException; // __llvm_sjljeh_is_longjmp_exception
- Constant *GetLJValue; // __llvm_sjljeh_get_longjmp_value
-
- typedef std::pair<SwitchInst*, CallInst*> SwitchValuePair;
-
- // Keep track of those basic blocks reachable via a depth-first search of
- // the CFG from a setjmp call. We only need to transform those "call" and
- // "invoke" instructions that are reachable from the setjmp call site.
- std::set<BasicBlock*> DFSBlocks;
-
- // The setjmp map is going to hold information about which setjmps
- // were called (each setjmp gets its own number) and with which
- // buffer it was called.
- std::map<Function*, AllocaInst*> SJMap;
-
- // The rethrow basic block map holds the basic block to branch to if
- // the exception isn't handled in the current function and needs to
- // be rethrown.
- std::map<const Function*, BasicBlock*> RethrowBBMap;
-
- // The preliminary basic block map holds a basic block that grabs the
- // exception and determines if it's handled by the current function.
- std::map<const Function*, BasicBlock*> PrelimBBMap;
-
- // The switch/value map holds a switch inst/call inst pair. The
- // switch inst controls which handler (if any) gets called and the
- // value is the value returned to that handler by the call to
- // __llvm_sjljeh_get_longjmp_value.
- std::map<const Function*, SwitchValuePair> SwitchValMap;
-
- // A map of which setjmps we've seen so far in a function.
- std::map<const Function*, unsigned> SetJmpIDMap;
-
- AllocaInst* GetSetJmpMap(Function* Func);
- BasicBlock* GetRethrowBB(Function* Func);
- SwitchValuePair GetSJSwitch(Function* Func, BasicBlock* Rethrow);
-
- void TransformLongJmpCall(CallInst* Inst);
- void TransformSetJmpCall(CallInst* Inst);
-
- bool IsTransformableFunction(const std::string& Name);
- public:
- static char ID; // Pass identification, replacement for typeid
- LowerSetJmp() : ModulePass((intptr_t)&ID) {}
-
- void visitCallInst(CallInst& CI);
- void visitInvokeInst(InvokeInst& II);
- void visitReturnInst(ReturnInst& RI);
- void visitUnwindInst(UnwindInst& UI);
-
- bool runOnModule(Module& M);
- bool doInitialization(Module& M);
- };
-
- char LowerSetJmp::ID = 0;
- RegisterPass<LowerSetJmp> X("lowersetjmp", "Lower Set Jump");
-} // end anonymous namespace
-
-// run - Run the transformation on the program. We grab the function
-// prototypes for longjmp and setjmp. If they are used in the program,
-// then we can go directly to the places they're at and transform them.
-bool LowerSetJmp::runOnModule(Module& M) {
- bool Changed = false;
-
- // These are what the functions are called.
- Function* SetJmp = M.getFunction("llvm.setjmp");
- Function* LongJmp = M.getFunction("llvm.longjmp");
-
- // This program doesn't have longjmp and setjmp calls.
- if ((!LongJmp || LongJmp->use_empty()) &&
- (!SetJmp || SetJmp->use_empty())) return false;
-
- // Initialize some values and functions we'll need to transform the
- // setjmp/longjmp functions.
- doInitialization(M);
-
- if (SetJmp) {
- for (Value::use_iterator B = SetJmp->use_begin(), E = SetJmp->use_end();
- B != E; ++B) {
- BasicBlock* BB = cast<Instruction>(*B)->getParent();
- for (df_ext_iterator<BasicBlock*> I = df_ext_begin(BB, DFSBlocks),
- E = df_ext_end(BB, DFSBlocks); I != E; ++I)
- /* empty */;
- }
-
- while (!SetJmp->use_empty()) {
- assert(isa<CallInst>(SetJmp->use_back()) &&
- "User of setjmp intrinsic not a call?");
- TransformSetJmpCall(cast<CallInst>(SetJmp->use_back()));
- Changed = true;
- }
- }
-
- if (LongJmp)
- while (!LongJmp->use_empty()) {
- assert(isa<CallInst>(LongJmp->use_back()) &&
- "User of longjmp intrinsic not a call?");
- TransformLongJmpCall(cast<CallInst>(LongJmp->use_back()));
- Changed = true;
- }
-
- // Now go through the affected functions and convert calls and invokes
- // to new invokes...
- for (std::map<Function*, AllocaInst*>::iterator
- B = SJMap.begin(), E = SJMap.end(); B != E; ++B) {
- Function* F = B->first;
- for (Function::iterator BB = F->begin(), BE = F->end(); BB != BE; ++BB)
- for (BasicBlock::iterator IB = BB->begin(), IE = BB->end(); IB != IE; ) {
- visit(*IB++);
- if (IB != BB->end() && IB->getParent() != BB)
- break; // The next instruction got moved to a different block!
- }
- }
-
- DFSBlocks.clear();
- SJMap.clear();
- RethrowBBMap.clear();
- PrelimBBMap.clear();
- SwitchValMap.clear();
- SetJmpIDMap.clear();
-
- return Changed;
-}
-
-// doInitialization - For the lower long/setjmp pass, this ensures that a
-// module contains a declaration for the intrisic functions we are going
-// to call to convert longjmp and setjmp calls.
-//
-// This function is always successful, unless it isn't.
-bool LowerSetJmp::doInitialization(Module& M)
-{
- const Type *SBPTy = PointerType::getUnqual(Type::Int8Ty);
- const Type *SBPPTy = PointerType::getUnqual(SBPTy);
-
- // N.B. See llvm/runtime/GCCLibraries/libexception/SJLJ-Exception.h for
- // a description of the following library functions.
-
- // void __llvm_sjljeh_init_setjmpmap(void**)
- InitSJMap = M.getOrInsertFunction("__llvm_sjljeh_init_setjmpmap",
- Type::VoidTy, SBPPTy, (Type *)0);
- // void __llvm_sjljeh_destroy_setjmpmap(void**)
- DestroySJMap = M.getOrInsertFunction("__llvm_sjljeh_destroy_setjmpmap",
- Type::VoidTy, SBPPTy, (Type *)0);
-
- // void __llvm_sjljeh_add_setjmp_to_map(void**, void*, unsigned)
- AddSJToMap = M.getOrInsertFunction("__llvm_sjljeh_add_setjmp_to_map",
- Type::VoidTy, SBPPTy, SBPTy,
- Type::Int32Ty, (Type *)0);
-
- // void __llvm_sjljeh_throw_longjmp(int*, int)
- ThrowLongJmp = M.getOrInsertFunction("__llvm_sjljeh_throw_longjmp",
- Type::VoidTy, SBPTy, Type::Int32Ty,
- (Type *)0);
-
- // unsigned __llvm_sjljeh_try_catching_longjmp_exception(void **)
- TryCatchLJ =
- M.getOrInsertFunction("__llvm_sjljeh_try_catching_longjmp_exception",
- Type::Int32Ty, SBPPTy, (Type *)0);
-
- // bool __llvm_sjljeh_is_longjmp_exception()
- IsLJException = M.getOrInsertFunction("__llvm_sjljeh_is_longjmp_exception",
- Type::Int1Ty, (Type *)0);
-
- // int __llvm_sjljeh_get_longjmp_value()
- GetLJValue = M.getOrInsertFunction("__llvm_sjljeh_get_longjmp_value",
- Type::Int32Ty, (Type *)0);
- return true;
-}
-
-// IsTransformableFunction - Return true if the function name isn't one
-// of the ones we don't want transformed. Currently, don't transform any
-// "llvm.{setjmp,longjmp}" functions and none of the setjmp/longjmp error
-// handling functions (beginning with __llvm_sjljeh_...they don't throw
-// exceptions).
-bool LowerSetJmp::IsTransformableFunction(const std::string& Name) {
- std::string SJLJEh("__llvm_sjljeh");
-
- if (Name.size() > SJLJEh.size())
- return std::string(Name.begin(), Name.begin() + SJLJEh.size()) != SJLJEh;
-
- return true;
-}
-
-// TransformLongJmpCall - Transform a longjmp call into a call to the
-// internal __llvm_sjljeh_throw_longjmp function. It then takes care of
-// throwing the exception for us.
-void LowerSetJmp::TransformLongJmpCall(CallInst* Inst)
-{
- const Type* SBPTy = PointerType::getUnqual(Type::Int8Ty);
-
- // Create the call to "__llvm_sjljeh_throw_longjmp". This takes the
- // same parameters as "longjmp", except that the buffer is cast to a
- // char*. It returns "void", so it doesn't need to replace any of
- // Inst's uses and doesn't get a name.
- CastInst* CI =
- new BitCastInst(Inst->getOperand(1), SBPTy, "LJBuf", Inst);
- SmallVector<Value *, 2> Args;
- Args.push_back(CI);
- Args.push_back(Inst->getOperand(2));
- CallInst::Create(ThrowLongJmp, Args.begin(), Args.end(), "", Inst);
-
- SwitchValuePair& SVP = SwitchValMap[Inst->getParent()->getParent()];
-
- // If the function has a setjmp call in it (they are transformed first)
- // we should branch to the basic block that determines if this longjmp
- // is applicable here. Otherwise, issue an unwind.
- if (SVP.first)
- BranchInst::Create(SVP.first->getParent(), Inst);
- else
- new UnwindInst(Inst);
-
- // Remove all insts after the branch/unwind inst. Go from back to front to
- // avoid replaceAllUsesWith if possible.
- BasicBlock *BB = Inst->getParent();
- Instruction *Removed;
- do {
- Removed = &BB->back();
- // If the removed instructions have any users, replace them now.
- if (!Removed->use_empty())
- Removed->replaceAllUsesWith(UndefValue::get(Removed->getType()));
- Removed->eraseFromParent();
- } while (Removed != Inst);
-
- ++LongJmpsTransformed;
-}
-
-// GetSetJmpMap - Retrieve (create and initialize, if necessary) the
-// setjmp map. This map is going to hold information about which setjmps
-// were called (each setjmp gets its own number) and with which buffer it
-// was called. There can be only one!
-AllocaInst* LowerSetJmp::GetSetJmpMap(Function* Func)
-{
- if (SJMap[Func]) return SJMap[Func];
-
- // Insert the setjmp map initialization before the first instruction in
- // the function.
- Instruction* Inst = Func->getEntryBlock().begin();
- assert(Inst && "Couldn't find even ONE instruction in entry block!");
-
- // Fill in the alloca and call to initialize the SJ map.
- const Type *SBPTy = PointerType::getUnqual(Type::Int8Ty);
- AllocaInst* Map = new AllocaInst(SBPTy, 0, "SJMap", Inst);
- CallInst::Create(InitSJMap, Map, "", Inst);
- return SJMap[Func] = Map;
-}
-
-// GetRethrowBB - Only one rethrow basic block is needed per function.
-// If this is a longjmp exception but not handled in this block, this BB
-// performs the rethrow.
-BasicBlock* LowerSetJmp::GetRethrowBB(Function* Func)
-{
- if (RethrowBBMap[Func]) return RethrowBBMap[Func];
-
- // The basic block we're going to jump to if we need to rethrow the
- // exception.
- BasicBlock* Rethrow = BasicBlock::Create("RethrowExcept", Func);
-
- // Fill in the "Rethrow" BB with a call to rethrow the exception. This
- // is the last instruction in the BB since at this point the runtime
- // should exit this function and go to the next function.
- new UnwindInst(Rethrow);
- return RethrowBBMap[Func] = Rethrow;
-}
-
-// GetSJSwitch - Return the switch statement that controls which handler
-// (if any) gets called and the value returned to that handler.
-LowerSetJmp::SwitchValuePair LowerSetJmp::GetSJSwitch(Function* Func,
- BasicBlock* Rethrow)
-{
- if (SwitchValMap[Func].first) return SwitchValMap[Func];
-
- BasicBlock* LongJmpPre = BasicBlock::Create("LongJmpBlkPre", Func);
- BasicBlock::InstListType& LongJmpPreIL = LongJmpPre->getInstList();
-
- // Keep track of the preliminary basic block for some of the other
- // transformations.
- PrelimBBMap[Func] = LongJmpPre;
-
- // Grab the exception.
- CallInst* Cond = CallInst::Create(IsLJException, "IsLJExcept");
- LongJmpPreIL.push_back(Cond);
-
- // The "decision basic block" gets the number associated with the
- // setjmp call returning to switch on and the value returned by
- // longjmp.
- BasicBlock* DecisionBB = BasicBlock::Create("LJDecisionBB", Func);
- BasicBlock::InstListType& DecisionBBIL = DecisionBB->getInstList();
-
- BranchInst::Create(DecisionBB, Rethrow, Cond, LongJmpPre);
-
- // Fill in the "decision" basic block.
- CallInst* LJVal = CallInst::Create(GetLJValue, "LJVal");
- DecisionBBIL.push_back(LJVal);
- CallInst* SJNum = CallInst::Create(TryCatchLJ, GetSetJmpMap(Func), "SJNum");
- DecisionBBIL.push_back(SJNum);
-
- SwitchInst* SI = SwitchInst::Create(SJNum, Rethrow, 0, DecisionBB);
- return SwitchValMap[Func] = SwitchValuePair(SI, LJVal);
-}
-
-// TransformSetJmpCall - The setjmp call is a bit trickier to transform.
-// We're going to convert all setjmp calls to nops. Then all "call" and
-// "invoke" instructions in the function are converted to "invoke" where
-// the "except" branch is used when returning from a longjmp call.
-void LowerSetJmp::TransformSetJmpCall(CallInst* Inst)
-{
- BasicBlock* ABlock = Inst->getParent();
- Function* Func = ABlock->getParent();
-
- // Add this setjmp to the setjmp map.
- const Type* SBPTy = PointerType::getUnqual(Type::Int8Ty);
- CastInst* BufPtr =
- new BitCastInst(Inst->getOperand(1), SBPTy, "SBJmpBuf", Inst);
- std::vector<Value*> Args =
- make_vector<Value*>(GetSetJmpMap(Func), BufPtr,
- ConstantInt::get(Type::Int32Ty,
- SetJmpIDMap[Func]++), 0);
- CallInst::Create(AddSJToMap, Args.begin(), Args.end(), "", Inst);
-
- // We are guaranteed that there are no values live across basic blocks
- // (because we are "not in SSA form" yet), but there can still be values live
- // in basic blocks. Because of this, splitting the setjmp block can cause
- // values above the setjmp to not dominate uses which are after the setjmp
- // call. For all of these occasions, we must spill the value to the stack.
- //
- std::set<Instruction*> InstrsAfterCall;
-
- // The call is probably very close to the end of the basic block, for the
- // common usage pattern of: 'if (setjmp(...))', so keep track of the
- // instructions after the call.
- for (BasicBlock::iterator I = ++BasicBlock::iterator(Inst), E = ABlock->end();
- I != E; ++I)
- InstrsAfterCall.insert(I);
-
- for (BasicBlock::iterator II = ABlock->begin();
- II != BasicBlock::iterator(Inst); ++II)
- // Loop over all of the uses of instruction. If any of them are after the
- // call, "spill" the value to the stack.
- for (Value::use_iterator UI = II->use_begin(), E = II->use_end();
- UI != E; ++UI)
- if (cast<Instruction>(*UI)->getParent() != ABlock ||
- InstrsAfterCall.count(cast<Instruction>(*UI))) {
- DemoteRegToStack(*II);
- break;
- }
- InstrsAfterCall.clear();
-
- // Change the setjmp call into a branch statement. We'll remove the
- // setjmp call in a little bit. No worries.
- BasicBlock* SetJmpContBlock = ABlock->splitBasicBlock(Inst);
- assert(SetJmpContBlock && "Couldn't split setjmp BB!!");
-
- SetJmpContBlock->setName(ABlock->getName()+"SetJmpCont");
-
- // Add the SetJmpContBlock to the set of blocks reachable from a setjmp.
- DFSBlocks.insert(SetJmpContBlock);
-
- // This PHI node will be in the new block created from the
- // splitBasicBlock call.
- PHINode* PHI = PHINode::Create(Type::Int32Ty, "SetJmpReturn", Inst);
-
- // Coming from a call to setjmp, the return is 0.
- PHI->addIncoming(ConstantInt::getNullValue(Type::Int32Ty), ABlock);
-
- // Add the case for this setjmp's number...
- SwitchValuePair SVP = GetSJSwitch(Func, GetRethrowBB(Func));
- SVP.first->addCase(ConstantInt::get(Type::Int32Ty, SetJmpIDMap[Func] - 1),
- SetJmpContBlock);
-
- // Value coming from the handling of the exception.
- PHI->addIncoming(SVP.second, SVP.second->getParent());
-
- // Replace all uses of this instruction with the PHI node created by
- // the eradication of setjmp.
- Inst->replaceAllUsesWith(PHI);
- Inst->getParent()->getInstList().erase(Inst);
-
- ++SetJmpsTransformed;
-}
-
-// visitCallInst - This converts all LLVM call instructions into invoke
-// instructions. The except part of the invoke goes to the "LongJmpBlkPre"
-// that grabs the exception and proceeds to determine if it's a longjmp
-// exception or not.
-void LowerSetJmp::visitCallInst(CallInst& CI)
-{
- if (CI.getCalledFunction())
- if (!IsTransformableFunction(CI.getCalledFunction()->getName()) ||
- CI.getCalledFunction()->isIntrinsic()) return;
-
- BasicBlock* OldBB = CI.getParent();
-
- // If not reachable from a setjmp call, don't transform.
- if (!DFSBlocks.count(OldBB)) return;
-
- BasicBlock* NewBB = OldBB->splitBasicBlock(CI);
- assert(NewBB && "Couldn't split BB of \"call\" instruction!!");
- DFSBlocks.insert(NewBB);
- NewBB->setName("Call2Invoke");
-
- Function* Func = OldBB->getParent();
-
- // Construct the new "invoke" instruction.
- TerminatorInst* Term = OldBB->getTerminator();
- std::vector<Value*> Params(CI.op_begin() + 1, CI.op_end());
- InvokeInst* II =
- InvokeInst::Create(CI.getCalledValue(), NewBB, PrelimBBMap[Func],
- Params.begin(), Params.end(), CI.getName(), Term);
- II->setCallingConv(CI.getCallingConv());
- II->setParamAttrs(CI.getParamAttrs());
-
- // Replace the old call inst with the invoke inst and remove the call.
- CI.replaceAllUsesWith(II);
- CI.getParent()->getInstList().erase(&CI);
-
- // The old terminator is useless now that we have the invoke inst.
- Term->getParent()->getInstList().erase(Term);
- ++CallsTransformed;
-}
-
-// visitInvokeInst - Converting the "invoke" instruction is fairly
-// straight-forward. The old exception part is replaced by a query asking
-// if this is a longjmp exception. If it is, then it goes to the longjmp
-// exception blocks. Otherwise, control is passed the old exception.
-void LowerSetJmp::visitInvokeInst(InvokeInst& II)
-{
- if (II.getCalledFunction())
- if (!IsTransformableFunction(II.getCalledFunction()->getName()) ||
- II.getCalledFunction()->isIntrinsic()) return;
-
- BasicBlock* BB = II.getParent();
-
- // If not reachable from a setjmp call, don't transform.
- if (!DFSBlocks.count(BB)) return;
-
- BasicBlock* ExceptBB = II.getUnwindDest();
-
- Function* Func = BB->getParent();
- BasicBlock* NewExceptBB = BasicBlock::Create("InvokeExcept", Func);
- BasicBlock::InstListType& InstList = NewExceptBB->getInstList();
-
- // If this is a longjmp exception, then branch to the preliminary BB of
- // the longjmp exception handling. Otherwise, go to the old exception.
- CallInst* IsLJExcept = CallInst::Create(IsLJException, "IsLJExcept");
- InstList.push_back(IsLJExcept);
-
- BranchInst::Create(PrelimBBMap[Func], ExceptBB, IsLJExcept, NewExceptBB);
-
- II.setUnwindDest(NewExceptBB);
- ++InvokesTransformed;
-}
-
-// visitReturnInst - We want to destroy the setjmp map upon exit from the
-// function.
-void LowerSetJmp::visitReturnInst(ReturnInst &RI) {
- Function* Func = RI.getParent()->getParent();
- CallInst::Create(DestroySJMap, GetSetJmpMap(Func), "", &RI);
-}
-
-// visitUnwindInst - We want to destroy the setjmp map upon exit from the
-// function.
-void LowerSetJmp::visitUnwindInst(UnwindInst &UI) {
- Function* Func = UI.getParent()->getParent();
- CallInst::Create(DestroySJMap, GetSetJmpMap(Func), "", &UI);
-}
-
-ModulePass *llvm::createLowerSetJmpPass() {
- return new LowerSetJmp();
-}
-
diff --git a/release_23/lib/Transforms/IPO/Makefile b/release_23/lib/Transforms/IPO/Makefile
deleted file mode 100644
index 77a20c0264ec..000000000000
--- a/release_23/lib/Transforms/IPO/Makefile
+++ /dev/null
@@ -1,15 +0,0 @@
-##===- lib/Transforms/IPO/Makefile -------------------------*- Makefile -*-===##
-#
-# The LLVM Compiler Infrastructure
-#
-# This file is distributed under the University of Illinois Open Source
-# License. See LICENSE.TXT for details.
-#
-##===----------------------------------------------------------------------===##
-
-LEVEL = ../../..
-LIBRARYNAME = LLVMipo
-BUILD_ARCHIVE = 1
-
-include $(LEVEL)/Makefile.common
-
diff --git a/release_23/lib/Transforms/IPO/PruneEH.cpp b/release_23/lib/Transforms/IPO/PruneEH.cpp
deleted file mode 100644
index 018160525690..000000000000
--- a/release_23/lib/Transforms/IPO/PruneEH.cpp
+++ /dev/null
@@ -1,236 +0,0 @@
-//===- PruneEH.cpp - Pass which deletes unused exception handlers ---------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements a simple interprocedural pass which walks the
-// call-graph, turning invoke instructions into calls, iff the callee cannot
-// throw an exception, and marking functions 'nounwind' if they cannot throw.
-// It implements this as a bottom-up traversal of the call-graph.
-//
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "prune-eh"
-#include "llvm/Transforms/IPO.h"
-#include "llvm/CallGraphSCCPass.h"
-#include "llvm/Constants.h"
-#include "llvm/Function.h"
-#include "llvm/Instructions.h"
-#include "llvm/Analysis/CallGraph.h"
-#include "llvm/ADT/SmallVector.h"
-#include "llvm/ADT/Statistic.h"
-#include "llvm/Support/CFG.h"
-#include "llvm/Support/Compiler.h"
-#include <set>
-#include <algorithm>
-using namespace llvm;
-
-STATISTIC(NumRemoved, "Number of invokes removed");
-STATISTIC(NumUnreach, "Number of noreturn calls optimized");
-
-namespace {
- struct VISIBILITY_HIDDEN PruneEH : public CallGraphSCCPass {
- static char ID; // Pass identification, replacement for typeid
- PruneEH() : CallGraphSCCPass((intptr_t)&ID) {}
-
- // runOnSCC - Analyze the SCC, performing the transformation if possible.
- bool runOnSCC(const std::vector<CallGraphNode *> &SCC);
-
- bool SimplifyFunction(Function *F);
- void DeleteBasicBlock(BasicBlock *BB);
- };
-
- char PruneEH::ID = 0;
- RegisterPass<PruneEH> X("prune-eh", "Remove unused exception handling info");
-}
-
-Pass *llvm::createPruneEHPass() { return new PruneEH(); }
-
-
-bool PruneEH::runOnSCC(const std::vector<CallGraphNode *> &SCC) {
- CallGraph &CG = getAnalysis<CallGraph>();
- bool MadeChange = false;
-
- // First pass, scan all of the functions in the SCC, simplifying them
- // according to what we know.
- for (unsigned i = 0, e = SCC.size(); i != e; ++i)
- if (Function *F = SCC[i]->getFunction())
- MadeChange |= SimplifyFunction(F);
-
- // Next, check to see if any callees might throw or if there are any external
- // functions in this SCC: if so, we cannot prune any functions in this SCC.
- // If this SCC includes the unwind instruction, we KNOW it throws, so
- // obviously the SCC might throw.
- //
- bool SCCMightUnwind = false, SCCMightReturn = false;
- for (unsigned i = 0, e = SCC.size();
- (!SCCMightUnwind || !SCCMightReturn) && i != e; ++i) {
- Function *F = SCC[i]->getFunction();
- if (F == 0) {
- SCCMightUnwind = true;
- SCCMightReturn = true;
- } else if (F->isDeclaration()) {
- SCCMightUnwind |= !F->doesNotThrow();
- SCCMightReturn |= !F->doesNotReturn();
- } else {
- bool CheckUnwind = !SCCMightUnwind && !F->doesNotThrow();
- bool CheckReturn = !SCCMightReturn && !F->doesNotReturn();
-
- if (!CheckUnwind && !CheckReturn)
- continue;
-
- // Check to see if this function performs an unwind or calls an
- // unwinding function.
- for (Function::iterator BB = F->begin(), E = F->end(); BB != E; ++BB) {
- if (CheckUnwind && isa<UnwindInst>(BB->getTerminator())) {
- // Uses unwind!
- SCCMightUnwind = true;
- } else if (CheckReturn && isa<ReturnInst>(BB->getTerminator())) {
- SCCMightReturn = true;
- }
-
- // Invoke instructions don't allow unwinding to continue, so we are
- // only interested in call instructions.
- if (CheckUnwind && !SCCMightUnwind)
- for (BasicBlock::iterator I = BB->begin(), E = BB->end(); I != E; ++I)
- if (CallInst *CI = dyn_cast<CallInst>(I)) {
- if (CI->doesNotThrow()) {
- // This call cannot throw.
- } else if (Function *Callee = CI->getCalledFunction()) {
- CallGraphNode *CalleeNode = CG[Callee];
- // If the callee is outside our current SCC then we may
- // throw because it might.
- if (std::find(SCC.begin(), SCC.end(), CalleeNode) == SCC.end()){
- SCCMightUnwind = true;
- break;
- }
- } else {
- // Indirect call, it might throw.
- SCCMightUnwind = true;
- break;
- }
- }
- if (SCCMightUnwind && SCCMightReturn) break;
- }
- }
- }
-
- // If the SCC doesn't unwind or doesn't throw, note this fact.
- if (!SCCMightUnwind || !SCCMightReturn)
- for (unsigned i = 0, e = SCC.size(); i != e; ++i) {
- ParameterAttributes NewAttributes = ParamAttr::None;
-
- if (!SCCMightUnwind)
- NewAttributes |= ParamAttr::NoUnwind;
- if (!SCCMightReturn)
- NewAttributes |= ParamAttr::NoReturn;
-
- const PAListPtr &PAL = SCC[i]->getFunction()->getParamAttrs();
- SCC[i]->getFunction()->setParamAttrs(PAL.addAttr(0, NewAttributes));
- }
-
- for (unsigned i = 0, e = SCC.size(); i != e; ++i) {
- // Convert any invoke instructions to non-throwing functions in this node
- // into call instructions with a branch. This makes the exception blocks
- // dead.
- if (Function *F = SCC[i]->getFunction())
- MadeChange |= SimplifyFunction(F);
- }
-
- return MadeChange;
-}
-
-
-// SimplifyFunction - Given information about callees, simplify the specified
-// function if we have invokes to non-unwinding functions or code after calls to
-// no-return functions.
-bool PruneEH::SimplifyFunction(Function *F) {
- bool MadeChange = false;
- for (Function::iterator BB = F->begin(), E = F->end(); BB != E; ++BB) {
- if (InvokeInst *II = dyn_cast<InvokeInst>(BB->getTerminator()))
- if (II->doesNotThrow()) {
- SmallVector<Value*, 8> Args(II->op_begin()+3, II->op_end());
- // Insert a call instruction before the invoke.
- CallInst *Call = CallInst::Create(II->getCalledValue(),
- Args.begin(), Args.end(), "", II);
- Call->takeName(II);
- Call->setCallingConv(II->getCallingConv());
- Call->setParamAttrs(II->getParamAttrs());
-
- // Anything that used the value produced by the invoke instruction
- // now uses the value produced by the call instruction.
- II->replaceAllUsesWith(Call);
- BasicBlock *UnwindBlock = II->getUnwindDest();
- UnwindBlock->removePredecessor(II->getParent());
-
- // Insert a branch to the normal destination right before the
- // invoke.
- BranchInst::Create(II->getNormalDest(), II);
-
- // Finally, delete the invoke instruction!
- BB->getInstList().pop_back();
-
- // If the unwind block is now dead, nuke it.
- if (pred_begin(UnwindBlock) == pred_end(UnwindBlock))
- DeleteBasicBlock(UnwindBlock); // Delete the new BB.
-
- ++NumRemoved;
- MadeChange = true;
- }
-
- for (BasicBlock::iterator I = BB->begin(), E = BB->end(); I != E; )
- if (CallInst *CI = dyn_cast<CallInst>(I++))
- if (CI->doesNotReturn() && !isa<UnreachableInst>(I)) {
- // This call calls a function that cannot return. Insert an
- // unreachable instruction after it and simplify the code. Do this
- // by splitting the BB, adding the unreachable, then deleting the
- // new BB.
- BasicBlock *New = BB->splitBasicBlock(I);
-
- // Remove the uncond branch and add an unreachable.
- BB->getInstList().pop_back();
- new UnreachableInst(BB);
-
- DeleteBasicBlock(New); // Delete the new BB.
- MadeChange = true;
- ++NumUnreach;
- break;
- }
- }
-
- return MadeChange;
-}
-
-/// DeleteBasicBlock - remove the specified basic block from the program,
-/// updating the callgraph to reflect any now-obsolete edges due to calls that
-/// exist in the BB.
-void PruneEH::DeleteBasicBlock(BasicBlock *BB) {
- assert(pred_begin(BB) == pred_end(BB) && "BB is not dead!");
- CallGraph &CG = getAnalysis<CallGraph>();
-
- CallGraphNode *CGN = CG[BB->getParent()];
- for (BasicBlock::iterator I = BB->end(), E = BB->begin(); I != E; ) {
- --I;
- if (CallInst *CI = dyn_cast<CallInst>(I)) {
- if (Function *Callee = CI->getCalledFunction())
- CGN->removeCallEdgeTo(CG[Callee]);
- } else if (InvokeInst *II = dyn_cast<InvokeInst>(I)) {
- if (Function *Callee = II->getCalledFunction())
- CGN->removeCallEdgeTo(CG[Callee]);
- }
- if (!I->use_empty())
- I->replaceAllUsesWith(UndefValue::get(I->getType()));
- }
-
- // Get the list of successors of this block.
- std::vector<BasicBlock*> Succs(succ_begin(BB), succ_end(BB));
-
- for (unsigned i = 0, e = Succs.size(); i != e; ++i)
- Succs[i]->removePredecessor(BB);
-
- BB->eraseFromParent();
-}
diff --git a/release_23/lib/Transforms/IPO/RaiseAllocations.cpp b/release_23/lib/Transforms/IPO/RaiseAllocations.cpp
deleted file mode 100644
index 1f12fcf79d3f..000000000000
--- a/release_23/lib/Transforms/IPO/RaiseAllocations.cpp
+++ /dev/null
@@ -1,252 +0,0 @@
-//===- RaiseAllocations.cpp - Convert @malloc & @free calls to insts ------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines the RaiseAllocations pass which convert malloc and free
-// calls to malloc and free instructions.
-//
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "raiseallocs"
-#include "llvm/Transforms/IPO.h"
-#include "llvm/Constants.h"
-#include "llvm/DerivedTypes.h"
-#include "llvm/Module.h"
-#include "llvm/Instructions.h"
-#include "llvm/Pass.h"
-#include "llvm/Support/CallSite.h"
-#include "llvm/Support/Compiler.h"
-#include "llvm/ADT/Statistic.h"
-#include <algorithm>
-using namespace llvm;
-
-STATISTIC(NumRaised, "Number of allocations raised");
-
-namespace {
- // RaiseAllocations - Turn @malloc and @free calls into the appropriate
- // instruction.
- //
- class VISIBILITY_HIDDEN RaiseAllocations : public ModulePass {
- Function *MallocFunc; // Functions in the module we are processing
- Function *FreeFunc; // Initialized by doPassInitializationVirt
- public:
- static char ID; // Pass identification, replacement for typeid
- RaiseAllocations()
- : ModulePass((intptr_t)&ID), MallocFunc(0), FreeFunc(0) {}
-
- // doPassInitialization - For the raise allocations pass, this finds a
- // declaration for malloc and free if they exist.
- //
- void doInitialization(Module &M);
-
- // run - This method does the actual work of converting instructions over.
- //
- bool runOnModule(Module &M);
- };
-
- char RaiseAllocations::ID = 0;
- RegisterPass<RaiseAllocations>
- X("raiseallocs", "Raise allocations from calls to instructions");
-} // end anonymous namespace
-
-
-// createRaiseAllocationsPass - The interface to this file...
-ModulePass *llvm::createRaiseAllocationsPass() {
- return new RaiseAllocations();
-}
-
-
-// If the module has a symbol table, they might be referring to the malloc and
-// free functions. If this is the case, grab the method pointers that the
-// module is using.
-//
-// Lookup @malloc and @free in the symbol table, for later use. If they don't
-// exist, or are not external, we do not worry about converting calls to that
-// function into the appropriate instruction.
-//
-void RaiseAllocations::doInitialization(Module &M) {
-
- // Get Malloc and free prototypes if they exist!
- MallocFunc = M.getFunction("malloc");
- if (MallocFunc) {
- const FunctionType* TyWeHave = MallocFunc->getFunctionType();
-
- // Get the expected prototype for malloc
- const FunctionType *Malloc1Type =
- FunctionType::get(PointerType::getUnqual(Type::Int8Ty),
- std::vector<const Type*>(1, Type::Int64Ty), false);
-
- // Chck to see if we got the expected malloc
- if (TyWeHave != Malloc1Type) {
- // Check to see if the prototype is wrong, giving us sbyte*(uint) * malloc
- // This handles the common declaration of: 'void *malloc(unsigned);'
- const FunctionType *Malloc2Type =
- FunctionType::get(PointerType::getUnqual(Type::Int8Ty),
- std::vector<const Type*>(1, Type::Int32Ty), false);
- if (TyWeHave != Malloc2Type) {
- // Check to see if the prototype is missing, giving us
- // sbyte*(...) * malloc
- // This handles the common declaration of: 'void *malloc();'
- const FunctionType *Malloc3Type =
- FunctionType::get(PointerType::getUnqual(Type::Int8Ty),
- std::vector<const Type*>(), true);
- if (TyWeHave != Malloc3Type)
- // Give up
- MallocFunc = 0;
- }
- }
- }
-
- FreeFunc = M.getFunction("free");
- if (FreeFunc) {
- const FunctionType* TyWeHave = FreeFunc->getFunctionType();
-
- // Get the expected prototype for void free(i8*)
- const FunctionType *Free1Type = FunctionType::get(Type::VoidTy,
- std::vector<const Type*>(1, PointerType::getUnqual(Type::Int8Ty)), false);
-
- if (TyWeHave != Free1Type) {
- // Check to see if the prototype was forgotten, giving us
- // void (...) * free
- // This handles the common forward declaration of: 'void free();'
- const FunctionType* Free2Type = FunctionType::get(Type::VoidTy,
- std::vector<const Type*>(),true);
-
- if (TyWeHave != Free2Type) {
- // One last try, check to see if we can find free as
- // int (...)* free. This handles the case where NOTHING was declared.
- const FunctionType* Free3Type = FunctionType::get(Type::Int32Ty,
- std::vector<const Type*>(),true);
-
- if (TyWeHave != Free3Type) {
- // Give up.
- FreeFunc = 0;
- }
- }
- }
- }
-
- // Don't mess with locally defined versions of these functions...
- if (MallocFunc && !MallocFunc->isDeclaration()) MallocFunc = 0;
- if (FreeFunc && !FreeFunc->isDeclaration()) FreeFunc = 0;
-}
-
-// run - Transform calls into instructions...
-//
-bool RaiseAllocations::runOnModule(Module &M) {
- // Find the malloc/free prototypes...
- doInitialization(M);
-
- bool Changed = false;
-
- // First, process all of the malloc calls...
- if (MallocFunc) {
- std::vector<User*> Users(MallocFunc->use_begin(), MallocFunc->use_end());
- std::vector<Value*> EqPointers; // Values equal to MallocFunc
- while (!Users.empty()) {
- User *U = Users.back();
- Users.pop_back();
-
- if (Instruction *I = dyn_cast<Instruction>(U)) {
- CallSite CS = CallSite::get(I);
- if (CS.getInstruction() && !CS.arg_empty() &&
- (CS.getCalledFunction() == MallocFunc ||
- std::find(EqPointers.begin(), EqPointers.end(),
- CS.getCalledValue()) != EqPointers.end())) {
-
- Value *Source = *CS.arg_begin();
-
- // If no prototype was provided for malloc, we may need to cast the
- // source size.
- if (Source->getType() != Type::Int32Ty)
- Source =
- CastInst::createIntegerCast(Source, Type::Int32Ty, false/*ZExt*/,
- "MallocAmtCast", I);
-
- MallocInst *MI = new MallocInst(Type::Int8Ty, Source, "", I);
- MI->takeName(I);
- I->replaceAllUsesWith(MI);
-
- // If the old instruction was an invoke, add an unconditional branch
- // before the invoke, which will become the new terminator.
- if (InvokeInst *II = dyn_cast<InvokeInst>(I))
- BranchInst::Create(II->getNormalDest(), I);
-
- // Delete the old call site
- MI->getParent()->getInstList().erase(I);
- Changed = true;
- ++NumRaised;
- }
- } else if (GlobalValue *GV = dyn_cast<GlobalValue>(U)) {
- Users.insert(Users.end(), GV->use_begin(), GV->use_end());
- EqPointers.push_back(GV);
- } else if (ConstantExpr *CE = dyn_cast<ConstantExpr>(U)) {
- if (CE->isCast()) {
- Users.insert(Users.end(), CE->use_begin(), CE->use_end());
- EqPointers.push_back(CE);
- }
- }
- }
- }
-
- // Next, process all free calls...
- if (FreeFunc) {
- std::vector<User*> Users(FreeFunc->use_begin(), FreeFunc->use_end());
- std::vector<Value*> EqPointers; // Values equal to FreeFunc
-
- while (!Users.empty()) {
- User *U = Users.back();
- Users.pop_back();
-
- if (Instruction *I = dyn_cast<Instruction>(U)) {
- if (isa<InvokeInst>(I))
- continue;
- CallSite CS = CallSite::get(I);
- if (CS.getInstruction() && !CS.arg_empty() &&
- (CS.getCalledFunction() == FreeFunc ||
- std::find(EqPointers.begin(), EqPointers.end(),
- CS.getCalledValue()) != EqPointers.end())) {
-
- // If no prototype was provided for free, we may need to cast the
- // source pointer. This should be really uncommon, but it's necessary
- // just in case we are dealing with weird code like this:
- // free((long)ptr);
- //
- Value *Source = *CS.arg_begin();
- if (!isa<PointerType>(Source->getType()))
- Source = new IntToPtrInst(Source,
- PointerType::getUnqual(Type::Int8Ty),
- "FreePtrCast", I);
- new FreeInst(Source, I);
-
- // If the old instruction was an invoke, add an unconditional branch
- // before the invoke, which will become the new terminator.
- if (InvokeInst *II = dyn_cast<InvokeInst>(I))
- BranchInst::Create(II->getNormalDest(), I);
-
- // Delete the old call site
- if (I->getType() != Type::VoidTy)
- I->replaceAllUsesWith(UndefValue::get(I->getType()));
- I->eraseFromParent();
- Changed = true;
- ++NumRaised;
- }
- } else if (GlobalValue *GV = dyn_cast<GlobalValue>(U)) {
- Users.insert(Users.end(), GV->use_begin(), GV->use_end());
- EqPointers.push_back(GV);
- } else if (ConstantExpr *CE = dyn_cast<ConstantExpr>(U)) {
- if (CE->isCast()) {
- Users.insert(Users.end(), CE->use_begin(), CE->use_end());
- EqPointers.push_back(CE);
- }
- }
- }
- }
-
- return Changed;
-}
diff --git a/release_23/lib/Transforms/IPO/StripDeadPrototypes.cpp b/release_23/lib/Transforms/IPO/StripDeadPrototypes.cpp
deleted file mode 100644
index ca8a436844a5..000000000000
--- a/release_23/lib/Transforms/IPO/StripDeadPrototypes.cpp
+++ /dev/null
@@ -1,72 +0,0 @@
-//===-- StripDeadPrototypes.cpp - Remove unused function declarations ----===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This pass loops over all of the functions in the input module, looking for
-// dead declarations and removes them. Dead declarations are declarations of
-// functions for which no implementation is available (i.e., declarations for
-// unused library functions).
-//
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "strip-dead-prototypes"
-#include "llvm/Transforms/IPO.h"
-#include "llvm/Pass.h"
-#include "llvm/Module.h"
-#include "llvm/ADT/Statistic.h"
-#include "llvm/Support/Compiler.h"
-using namespace llvm;
-
-STATISTIC(NumDeadPrototypes, "Number of dead prototypes removed");
-
-namespace {
-
-/// @brief Pass to remove unused function declarations.
-class VISIBILITY_HIDDEN StripDeadPrototypesPass : public ModulePass {
-public:
- static char ID; // Pass identification, replacement for typeid
- StripDeadPrototypesPass() : ModulePass((intptr_t)&ID) { }
- virtual bool runOnModule(Module &M);
-};
-
-char StripDeadPrototypesPass::ID = 0;
-RegisterPass<StripDeadPrototypesPass> X("strip-dead-prototypes",
- "Strip Unused Function Prototypes");
-
-} // end anonymous namespace
-
-bool StripDeadPrototypesPass::runOnModule(Module &M) {
- bool MadeChange = false;
-
- // Erase dead function prototypes.
- for (Module::iterator I = M.begin(), E = M.end(); I != E; ) {
- Function *F = I++;
- // Function must be a prototype and unused.
- if (F->isDeclaration() && F->use_empty()) {
- F->eraseFromParent();
- ++NumDeadPrototypes;
- MadeChange = true;
- }
- }
-
- // Erase dead global var prototypes.
- for (Module::global_iterator I = M.global_begin(), E = M.global_end();
- I != E; ) {
- GlobalVariable *GV = I++;
- // Global must be a prototype and unused.
- if (GV->isDeclaration() && GV->use_empty())
- GV->eraseFromParent();
- }
-
- // Return an indication of whether we changed anything or not.
- return MadeChange;
-}
-
-ModulePass *llvm::createStripDeadPrototypesPass() {
- return new StripDeadPrototypesPass();
-}
diff --git a/release_23/lib/Transforms/IPO/StripSymbols.cpp b/release_23/lib/Transforms/IPO/StripSymbols.cpp
deleted file mode 100644
index cd2396258c41..000000000000
--- a/release_23/lib/Transforms/IPO/StripSymbols.cpp
+++ /dev/null
@@ -1,225 +0,0 @@
-//===- StripSymbols.cpp - Strip symbols and debug info from a module ------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// The StripSymbols transformation implements code stripping. Specifically, it
-// can delete:
-//
-// * names for virtual registers
-// * symbols for internal globals and functions
-// * debug information
-//
-// Note that this transformation makes code much less readable, so it should
-// only be used in situations where the 'strip' utility would be used, such as
-// reducing code size or making it harder to reverse engineer code.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Transforms/IPO.h"
-#include "llvm/Constants.h"
-#include "llvm/DerivedTypes.h"
-#include "llvm/Instructions.h"
-#include "llvm/Module.h"
-#include "llvm/Pass.h"
-#include "llvm/ValueSymbolTable.h"
-#include "llvm/TypeSymbolTable.h"
-#include "llvm/Support/Compiler.h"
-#include "llvm/ADT/SmallPtrSet.h"
-using namespace llvm;
-
-namespace {
- class VISIBILITY_HIDDEN StripSymbols : public ModulePass {
- bool OnlyDebugInfo;
- public:
- static char ID; // Pass identification, replacement for typeid
- explicit StripSymbols(bool ODI = false)
- : ModulePass((intptr_t)&ID), OnlyDebugInfo(ODI) {}
-
- virtual bool runOnModule(Module &M);
-
- virtual void getAnalysisUsage(AnalysisUsage &AU) const {
- AU.setPreservesAll();
- }
- };
-
- char StripSymbols::ID = 0;
- RegisterPass<StripSymbols> X("strip", "Strip all symbols from a module");
-}
-
-ModulePass *llvm::createStripSymbolsPass(bool OnlyDebugInfo) {
- return new StripSymbols(OnlyDebugInfo);
-}
-
-static void RemoveDeadConstant(Constant *C) {
- assert(C->use_empty() && "Constant is not dead!");
- std::vector<Constant*> Operands;
- for (unsigned i = 0, e = C->getNumOperands(); i != e; ++i)
- if (isa<DerivedType>(C->getOperand(i)->getType()) &&
- C->getOperand(i)->hasOneUse())
- Operands.push_back(C->getOperand(i));
- if (GlobalVariable *GV = dyn_cast<GlobalVariable>(C)) {
- if (!GV->hasInternalLinkage()) return; // Don't delete non static globals.
- GV->eraseFromParent();
- }
- else if (!isa<Function>(C))
- C->destroyConstant();
-
- // If the constant referenced anything, see if we can delete it as well.
- while (!Operands.empty()) {
- RemoveDeadConstant(Operands.back());
- Operands.pop_back();
- }
-}
-
-// Strip the symbol table of its names.
-//
-static void StripSymtab(ValueSymbolTable &ST) {
- for (ValueSymbolTable::iterator VI = ST.begin(), VE = ST.end(); VI != VE; ) {
- Value *V = VI->getValue();
- ++VI;
- if (!isa<GlobalValue>(V) || cast<GlobalValue>(V)->hasInternalLinkage()) {
- // Set name to "", removing from symbol table!
- V->setName("");
- }
- }
-}
-
-// Strip the symbol table of its names.
-static void StripTypeSymtab(TypeSymbolTable &ST) {
- for (TypeSymbolTable::iterator TI = ST.begin(), E = ST.end(); TI != E; )
- ST.remove(TI++);
-}
-
-
-
-bool StripSymbols::runOnModule(Module &M) {
- // If we're not just stripping debug info, strip all symbols from the
- // functions and the names from any internal globals.
- if (!OnlyDebugInfo) {
- SmallPtrSet<const GlobalValue*, 8> llvmUsedValues;
- if (GlobalVariable *LLVMUsed = M.getGlobalVariable("llvm.used")) {
- llvmUsedValues.insert(LLVMUsed);
- // Collect values that are preserved as per explicit request.
- // llvm.used is used to list these values.
- if (ConstantArray *Inits =
- dyn_cast<ConstantArray>(LLVMUsed->getInitializer())) {
- for (unsigned i = 0, e = Inits->getNumOperands(); i != e; ++i) {
- if (GlobalValue *GV = dyn_cast<GlobalValue>(Inits->getOperand(i)))
- llvmUsedValues.insert(GV);
- else if (ConstantExpr *CE =
- dyn_cast<ConstantExpr>(Inits->getOperand(i)))
- if (CE->getOpcode() == Instruction::BitCast)
- if (GlobalValue *GV = dyn_cast<GlobalValue>(CE->getOperand(0)))
- llvmUsedValues.insert(GV);
- }
- }
- }
-
- for (Module::global_iterator I = M.global_begin(), E = M.global_end();
- I != E; ++I) {
- if (I->hasInternalLinkage() && llvmUsedValues.count(I) == 0)
- I->setName(""); // Internal symbols can't participate in linkage
- }
-
- for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I) {
- if (I->hasInternalLinkage() && llvmUsedValues.count(I) == 0)
- I->setName(""); // Internal symbols can't participate in linkage
- StripSymtab(I->getValueSymbolTable());
- }
-
- // Remove all names from types.
- StripTypeSymtab(M.getTypeSymbolTable());
- }
-
- // Strip debug info in the module if it exists. To do this, we remove
- // llvm.dbg.func.start, llvm.dbg.stoppoint, and llvm.dbg.region.end calls, and
- // any globals they point to if now dead.
- Function *FuncStart = M.getFunction("llvm.dbg.func.start");
- Function *StopPoint = M.getFunction("llvm.dbg.stoppoint");
- Function *RegionStart = M.getFunction("llvm.dbg.region.start");
- Function *RegionEnd = M.getFunction("llvm.dbg.region.end");
- Function *Declare = M.getFunction("llvm.dbg.declare");
- if (!FuncStart && !StopPoint && !RegionStart && !RegionEnd && !Declare)
- return true;
-
- std::vector<GlobalVariable*> DeadGlobals;
-
- // Remove all of the calls to the debugger intrinsics, and remove them from
- // the module.
- if (FuncStart) {
- while (!FuncStart->use_empty()) {
- CallInst *CI = cast<CallInst>(FuncStart->use_back());
- Value *Arg = CI->getOperand(1);
- assert(CI->use_empty() && "llvm.dbg intrinsic should have void result");
- CI->eraseFromParent();
- if (Arg->use_empty())
- if (GlobalVariable *GV = dyn_cast<GlobalVariable>(Arg))
- DeadGlobals.push_back(GV);
- }
- FuncStart->eraseFromParent();
- }
- if (StopPoint) {
- while (!StopPoint->use_empty()) {
- CallInst *CI = cast<CallInst>(StopPoint->use_back());
- Value *Arg = CI->getOperand(3);
- assert(CI->use_empty() && "llvm.dbg intrinsic should have void result");
- CI->eraseFromParent();
- if (Arg->use_empty())
- if (GlobalVariable *GV = dyn_cast<GlobalVariable>(Arg))
- DeadGlobals.push_back(GV);
- }
- StopPoint->eraseFromParent();
- }
- if (RegionStart) {
- while (!RegionStart->use_empty()) {
- CallInst *CI = cast<CallInst>(RegionStart->use_back());
- Value *Arg = CI->getOperand(1);
- assert(CI->use_empty() && "llvm.dbg intrinsic should have void result");
- CI->eraseFromParent();
- if (Arg->use_empty())
- if (GlobalVariable *GV = dyn_cast<GlobalVariable>(Arg))
- DeadGlobals.push_back(GV);
- }
- RegionStart->eraseFromParent();
- }
- if (RegionEnd) {
- while (!RegionEnd->use_empty()) {
- CallInst *CI = cast<CallInst>(RegionEnd->use_back());
- Value *Arg = CI->getOperand(1);
- assert(CI->use_empty() && "llvm.dbg intrinsic should have void result");
- CI->eraseFromParent();
- if (Arg->use_empty())
- if (GlobalVariable *GV = dyn_cast<GlobalVariable>(Arg))
- DeadGlobals.push_back(GV);
- }
- RegionEnd->eraseFromParent();
- }
- if (Declare) {
- while (!Declare->use_empty()) {
- CallInst *CI = cast<CallInst>(Declare->use_back());
- Value *Arg = CI->getOperand(2);
- assert(CI->use_empty() && "llvm.dbg intrinsic should have void result");
- CI->eraseFromParent();
- if (Arg->use_empty())
- if (GlobalVariable *GV = dyn_cast<GlobalVariable>(Arg))
- DeadGlobals.push_back(GV);
- }
- Declare->eraseFromParent();
- }
-
- // Finally, delete any internal globals that were only used by the debugger
- // intrinsics.
- while (!DeadGlobals.empty()) {
- GlobalVariable *GV = DeadGlobals.back();
- DeadGlobals.pop_back();
- if (GV->hasInternalLinkage())
- RemoveDeadConstant(GV);
- }
-
- return true;
-}
diff --git a/release_23/lib/Transforms/IPO/StructRetPromotion.cpp b/release_23/lib/Transforms/IPO/StructRetPromotion.cpp
deleted file mode 100644
index 34d977452c6d..000000000000
--- a/release_23/lib/Transforms/IPO/StructRetPromotion.cpp
+++ /dev/null
@@ -1,346 +0,0 @@
-//===-- StructRetPromotion.cpp - Promote sret arguments ------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This pass finds functions that return a struct (using a pointer to the struct
-// as the first argument of the function, marked with the 'sret' attribute) and
-// replaces them with a new function that simply returns each of the elements of
-// that struct (using multiple return values).
-//
-// This pass works under a number of conditions:
-// 1. The returned struct must not contain other structs
-// 2. The returned struct must only be used to load values from
-// 3. The placeholder struct passed in is the result of an alloca
-//
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "sretpromotion"
-#include "llvm/Transforms/IPO.h"
-#include "llvm/Constants.h"
-#include "llvm/DerivedTypes.h"
-#include "llvm/Module.h"
-#include "llvm/CallGraphSCCPass.h"
-#include "llvm/Instructions.h"
-#include "llvm/Analysis/CallGraph.h"
-#include "llvm/Support/CallSite.h"
-#include "llvm/Support/CFG.h"
-#include "llvm/Support/Debug.h"
-#include "llvm/ADT/Statistic.h"
-#include "llvm/ADT/SmallVector.h"
-#include "llvm/ADT/Statistic.h"
-#include "llvm/Support/Compiler.h"
-using namespace llvm;
-
-STATISTIC(NumRejectedSRETUses , "Number of sret rejected due to unexpected uses");
-STATISTIC(NumSRET , "Number of sret promoted");
-namespace {
- /// SRETPromotion - This pass removes sret parameter and updates
- /// function to use multiple return value.
- ///
- struct VISIBILITY_HIDDEN SRETPromotion : public CallGraphSCCPass {
- virtual void getAnalysisUsage(AnalysisUsage &AU) const {
- CallGraphSCCPass::getAnalysisUsage(AU);
- }
-
- virtual bool runOnSCC(const std::vector<CallGraphNode *> &SCC);
- static char ID; // Pass identification, replacement for typeid
- SRETPromotion() : CallGraphSCCPass((intptr_t)&ID) {}
-
- private:
- bool PromoteReturn(CallGraphNode *CGN);
- bool isSafeToUpdateAllCallers(Function *F);
- Function *cloneFunctionBody(Function *F, const StructType *STy);
- void updateCallSites(Function *F, Function *NF);
- bool nestedStructType(const StructType *STy);
- };
-
- char SRETPromotion::ID = 0;
- RegisterPass<SRETPromotion> X("sretpromotion",
- "Promote sret arguments to multiple ret values");
-}
-
-Pass *llvm::createStructRetPromotionPass() {
- return new SRETPromotion();
-}
-
-bool SRETPromotion::runOnSCC(const std::vector<CallGraphNode *> &SCC) {
- bool Changed = false;
-
- for (unsigned i = 0, e = SCC.size(); i != e; ++i)
- Changed |= PromoteReturn(SCC[i]);
-
- return Changed;
-}
-
-/// PromoteReturn - This method promotes function that uses StructRet paramater
-/// into a function that uses mulitple return value.
-bool SRETPromotion::PromoteReturn(CallGraphNode *CGN) {
- Function *F = CGN->getFunction();
-
- if (!F || F->isDeclaration() || !F->hasInternalLinkage())
- return false;
-
- // Make sure that function returns struct.
- if (F->arg_size() == 0 || !F->hasStructRetAttr() || F->doesNotReturn())
- return false;
-
- assert (F->getReturnType() == Type::VoidTy && "Invalid function return type");
- Function::arg_iterator AI = F->arg_begin();
- const llvm::PointerType *FArgType = dyn_cast<PointerType>(AI->getType());
- assert (FArgType && "Invalid sret parameter type");
- const llvm::StructType *STy =
- dyn_cast<StructType>(FArgType->getElementType());
- assert (STy && "Invalid sret parameter element type");
-
- if (nestedStructType(STy))
- return false;
-
- // Check if it is ok to perform this promotion.
- if (isSafeToUpdateAllCallers(F) == false) {
- NumRejectedSRETUses++;
- return false;
- }
-
- NumSRET++;
- // [1] Replace use of sret parameter
- AllocaInst *TheAlloca = new AllocaInst (STy, NULL, "mrv",
- F->getEntryBlock().begin());
- Value *NFirstArg = F->arg_begin();
- NFirstArg->replaceAllUsesWith(TheAlloca);
-
- // [2] Find and replace ret instructions
- SmallVector<Value *,4> RetVals;
- for (Function::iterator FI = F->begin(), FE = F->end(); FI != FE; ++FI)
- for(BasicBlock::iterator BI = FI->begin(), BE = FI->end(); BI != BE; ) {
- Instruction *I = BI;
- ++BI;
- if (isa<ReturnInst>(I)) {
- RetVals.clear();
- for (unsigned idx = 0; idx < STy->getNumElements(); ++idx) {
- SmallVector<Value*, 2> GEPIdx;
- GEPIdx.push_back(ConstantInt::get(Type::Int32Ty, 0));
- GEPIdx.push_back(ConstantInt::get(Type::Int32Ty, idx));
- Value *NGEPI = GetElementPtrInst::Create(TheAlloca, GEPIdx.begin(),
- GEPIdx.end(),
- "mrv.gep", I);
- Value *NV = new LoadInst(NGEPI, "mrv.ld", I);
- RetVals.push_back(NV);
- }
-
- ReturnInst *NR = ReturnInst::Create(&RetVals[0], RetVals.size(), I);
- I->replaceAllUsesWith(NR);
- I->eraseFromParent();
- }
- }
-
- // [3] Create the new function body and insert it into the module.
- Function *NF = cloneFunctionBody(F, STy);
-
- // [4] Update all call sites to use new function
- updateCallSites(F, NF);
-
- F->eraseFromParent();
- getAnalysis<CallGraph>().changeFunction(F, NF);
- return true;
-}
-
-// Check if it is ok to perform this promotion.
-bool SRETPromotion::isSafeToUpdateAllCallers(Function *F) {
-
- if (F->use_empty())
- // No users. OK to modify signature.
- return true;
-
- for (Value::use_iterator FnUseI = F->use_begin(), FnUseE = F->use_end();
- FnUseI != FnUseE; ++FnUseI) {
-
- CallSite CS = CallSite::get(*FnUseI);
- Instruction *Call = CS.getInstruction();
- CallSite::arg_iterator AI = CS.arg_begin();
- Value *FirstArg = *AI;
-
- if (!isa<AllocaInst>(FirstArg))
- return false;
-
- // Check FirstArg's users.
- for (Value::use_iterator ArgI = FirstArg->use_begin(),
- ArgE = FirstArg->use_end(); ArgI != ArgE; ++ArgI) {
-
- // If FirstArg user is a CallInst that does not correspond to current
- // call site then this function F is not suitable for sret promotion.
- if (CallInst *CI = dyn_cast<CallInst>(ArgI)) {
- if (CI != Call)
- return false;
- }
- // If FirstArg user is a GEP whose all users are not LoadInst then
- // this function F is not suitable for sret promotion.
- else if (GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(ArgI)) {
- // TODO : Use dom info and insert PHINodes to collect get results
- // from multiple call sites for this GEP.
- if (GEP->getParent() != Call->getParent())
- return false;
- for (Value::use_iterator GEPI = GEP->use_begin(), GEPE = GEP->use_end();
- GEPI != GEPE; ++GEPI)
- if (!isa<LoadInst>(GEPI))
- return false;
- }
- // Any other FirstArg users make this function unsuitable for sret
- // promotion.
- else
- return false;
- }
- }
-
- return true;
-}
-
-/// cloneFunctionBody - Create a new function based on F and
-/// insert it into module. Remove first argument. Use STy as
-/// the return type for new function.
-Function *SRETPromotion::cloneFunctionBody(Function *F,
- const StructType *STy) {
-
- const FunctionType *FTy = F->getFunctionType();
- std::vector<const Type*> Params;
-
- // ParamAttrs - Keep track of the parameter attributes for the arguments.
- SmallVector<ParamAttrsWithIndex, 8> ParamAttrsVec;
- const PAListPtr &PAL = F->getParamAttrs();
-
- // Add any return attributes.
- if (ParameterAttributes attrs = PAL.getParamAttrs(0))
- ParamAttrsVec.push_back(ParamAttrsWithIndex::get(0, attrs));
-
- // Skip first argument.
- Function::arg_iterator I = F->arg_begin(), E = F->arg_end();
- ++I;
- // 0th parameter attribute is reserved for return type.
- // 1th parameter attribute is for first 1st sret argument.
- unsigned ParamIndex = 2;
- while (I != E) {
- Params.push_back(I->getType());
- if (ParameterAttributes Attrs = PAL.getParamAttrs(ParamIndex))
- ParamAttrsVec.push_back(ParamAttrsWithIndex::get(ParamIndex - 1, Attrs));
- ++I;
- ++ParamIndex;
- }
-
- FunctionType *NFTy = FunctionType::get(STy, Params, FTy->isVarArg());
- Function *NF = Function::Create(NFTy, F->getLinkage(), F->getName());
- NF->setCallingConv(F->getCallingConv());
- NF->setParamAttrs(PAListPtr::get(ParamAttrsVec.begin(), ParamAttrsVec.end()));
- F->getParent()->getFunctionList().insert(F, NF);
- NF->getBasicBlockList().splice(NF->begin(), F->getBasicBlockList());
-
- // Replace arguments
- I = F->arg_begin();
- E = F->arg_end();
- Function::arg_iterator NI = NF->arg_begin();
- ++I;
- while (I != E) {
- I->replaceAllUsesWith(NI);
- NI->takeName(I);
- ++I;
- ++NI;
- }
-
- return NF;
-}
-
-/// updateCallSites - Update all sites that call F to use NF.
-void SRETPromotion::updateCallSites(Function *F, Function *NF) {
-
- SmallVector<Value*, 16> Args;
-
- // ParamAttrs - Keep track of the parameter attributes for the arguments.
- SmallVector<ParamAttrsWithIndex, 8> ArgAttrsVec;
-
- for (Value::use_iterator FUI = F->use_begin(), FUE = F->use_end();
- FUI != FUE;) {
- CallSite CS = CallSite::get(*FUI);
- ++FUI;
- Instruction *Call = CS.getInstruction();
-
- const PAListPtr &PAL = F->getParamAttrs();
- // Add any return attributes.
- if (ParameterAttributes attrs = PAL.getParamAttrs(0))
- ArgAttrsVec.push_back(ParamAttrsWithIndex::get(0, attrs));
-
- // Copy arguments, however skip first one.
- CallSite::arg_iterator AI = CS.arg_begin(), AE = CS.arg_end();
- Value *FirstCArg = *AI;
- ++AI;
- // 0th parameter attribute is reserved for return type.
- // 1th parameter attribute is for first 1st sret argument.
- unsigned ParamIndex = 2;
- while (AI != AE) {
- Args.push_back(*AI);
- if (ParameterAttributes Attrs = PAL.getParamAttrs(ParamIndex))
- ArgAttrsVec.push_back(ParamAttrsWithIndex::get(ParamIndex - 1, Attrs));
- ++ParamIndex;
- ++AI;
- }
-
-
- PAListPtr NewPAL = PAListPtr::get(ArgAttrsVec.begin(), ArgAttrsVec.end());
-
- // Build new call instruction.
- Instruction *New;
- if (InvokeInst *II = dyn_cast<InvokeInst>(Call)) {
- New = InvokeInst::Create(NF, II->getNormalDest(), II->getUnwindDest(),
- Args.begin(), Args.end(), "", Call);
- cast<InvokeInst>(New)->setCallingConv(CS.getCallingConv());
- cast<InvokeInst>(New)->setParamAttrs(NewPAL);
- } else {
- New = CallInst::Create(NF, Args.begin(), Args.end(), "", Call);
- cast<CallInst>(New)->setCallingConv(CS.getCallingConv());
- cast<CallInst>(New)->setParamAttrs(NewPAL);
- if (cast<CallInst>(Call)->isTailCall())
- cast<CallInst>(New)->setTailCall();
- }
- Args.clear();
- ArgAttrsVec.clear();
- New->takeName(Call);
-
- // Update all users of sret parameter to extract value using getresult.
- for (Value::use_iterator UI = FirstCArg->use_begin(),
- UE = FirstCArg->use_end(); UI != UE; ) {
- User *U2 = *UI++;
- CallInst *C2 = dyn_cast<CallInst>(U2);
- if (C2 && (C2 == Call))
- continue;
- else if (GetElementPtrInst *UGEP = dyn_cast<GetElementPtrInst>(U2)) {
- ConstantInt *Idx = dyn_cast<ConstantInt>(UGEP->getOperand(2));
- assert (Idx && "Unexpected getelementptr index!");
- Value *GR = new GetResultInst(New, Idx->getZExtValue(), "gr", UGEP);
- for (Value::use_iterator GI = UGEP->use_begin(),
- GE = UGEP->use_end(); GI != GE; ++GI) {
- if (LoadInst *L = dyn_cast<LoadInst>(*GI)) {
- L->replaceAllUsesWith(GR);
- L->eraseFromParent();
- }
- }
- UGEP->eraseFromParent();
- }
- else assert( 0 && "Unexpected sret parameter use");
- }
- Call->eraseFromParent();
- }
-}
-
-/// nestedStructType - Return true if STy includes any
-/// other aggregate types
-bool SRETPromotion::nestedStructType(const StructType *STy) {
- unsigned Num = STy->getNumElements();
- for (unsigned i = 0; i < Num; i++) {
- const Type *Ty = STy->getElementType(i);
- if (!Ty->isFirstClassType() && Ty != Type::VoidTy)
- return true;
- }
- return false;
-}
diff --git a/release_23/lib/Transforms/Instrumentation/BlockProfiling.cpp b/release_23/lib/Transforms/Instrumentation/BlockProfiling.cpp
deleted file mode 100644
index 7068db281de4..000000000000
--- a/release_23/lib/Transforms/Instrumentation/BlockProfiling.cpp
+++ /dev/null
@@ -1,126 +0,0 @@
-//===- BlockProfiling.cpp - Insert counters for block profiling -----------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This pass instruments the specified program with counters for basic block or
-// function profiling. This is the most basic form of profiling, which can tell
-// which blocks are hot, but cannot reliably detect hot paths through the CFG.
-// Block profiling counts the number of times each basic block executes, and
-// function profiling counts the number of times each function is called.
-//
-// Note that this implementation is very naive. Control equivalent regions of
-// the CFG should not require duplicate counters, but we do put duplicate
-// counters in.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Constants.h"
-#include "llvm/DerivedTypes.h"
-#include "llvm/Module.h"
-#include "llvm/Pass.h"
-#include "llvm/Support/Compiler.h"
-#include "llvm/Support/Streams.h"
-#include "llvm/Transforms/Instrumentation.h"
-#include "RSProfiling.h"
-#include "ProfilingUtils.h"
-using namespace llvm;
-
-namespace {
- class VISIBILITY_HIDDEN FunctionProfiler : public RSProfilers_std {
- public:
- static char ID;
- bool runOnModule(Module &M);
- };
-
- char FunctionProfiler::ID = 0;
-
- RegisterPass<FunctionProfiler> X("insert-function-profiling",
- "Insert instrumentation for function profiling");
- RegisterAnalysisGroup<RSProfilers> XG(X);
-
-}
-
-ModulePass *llvm::createFunctionProfilerPass() {
- return new FunctionProfiler();
-}
-
-bool FunctionProfiler::runOnModule(Module &M) {
- Function *Main = M.getFunction("main");
- if (Main == 0) {
- cerr << "WARNING: cannot insert function profiling into a module"
- << " with no main function!\n";
- return false; // No main, no instrumentation!
- }
-
- unsigned NumFunctions = 0;
- for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I)
- if (!I->isDeclaration())
- ++NumFunctions;
-
- const Type *ATy = ArrayType::get(Type::Int32Ty, NumFunctions);
- GlobalVariable *Counters =
- new GlobalVariable(ATy, false, GlobalValue::InternalLinkage,
- Constant::getNullValue(ATy), "FuncProfCounters", &M);
-
- // Instrument all of the functions...
- unsigned i = 0;
- for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I)
- if (!I->isDeclaration())
- // Insert counter at the start of the function
- IncrementCounterInBlock(I->begin(), i++, Counters);
-
- // Add the initialization call to main.
- InsertProfilingInitCall(Main, "llvm_start_func_profiling", Counters);
- return true;
-}
-
-
-namespace {
- class BlockProfiler : public RSProfilers_std {
- bool runOnModule(Module &M);
- public:
- static char ID;
- };
-
- char BlockProfiler::ID = 0;
- RegisterPass<BlockProfiler> Y("insert-block-profiling",
- "Insert instrumentation for block profiling");
- RegisterAnalysisGroup<RSProfilers> YG(Y);
-}
-
-ModulePass *llvm::createBlockProfilerPass() { return new BlockProfiler(); }
-
-bool BlockProfiler::runOnModule(Module &M) {
- Function *Main = M.getFunction("main");
- if (Main == 0) {
- cerr << "WARNING: cannot insert block profiling into a module"
- << " with no main function!\n";
- return false; // No main, no instrumentation!
- }
-
- unsigned NumBlocks = 0;
- for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I)
- NumBlocks += I->size();
-
- const Type *ATy = ArrayType::get(Type::Int32Ty, NumBlocks);
- GlobalVariable *Counters =
- new GlobalVariable(ATy, false, GlobalValue::InternalLinkage,
- Constant::getNullValue(ATy), "BlockProfCounters", &M);
-
- // Instrument all of the blocks...
- unsigned i = 0;
- for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I)
- for (Function::iterator BB = I->begin(), E = I->end(); BB != E; ++BB)
- // Insert counter at the start of the block
- IncrementCounterInBlock(BB, i++, Counters);
-
- // Add the initialization call to main.
- InsertProfilingInitCall(Main, "llvm_start_block_profiling", Counters);
- return true;
-}
-
diff --git a/release_23/lib/Transforms/Instrumentation/EdgeProfiling.cpp b/release_23/lib/Transforms/Instrumentation/EdgeProfiling.cpp
deleted file mode 100644
index 72f43e512476..000000000000
--- a/release_23/lib/Transforms/Instrumentation/EdgeProfiling.cpp
+++ /dev/null
@@ -1,101 +0,0 @@
-//===- EdgeProfiling.cpp - Insert counters for edge profiling -------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This pass instruments the specified program with counters for edge profiling.
-// Edge profiling can give a reasonable approximation of the hot paths through a
-// program, and is used for a wide variety of program transformations.
-//
-// Note that this implementation is very naive. We insert a counter for *every*
-// edge in the program, instead of using control flow information to prune the
-// number of counters inserted.
-//
-//===----------------------------------------------------------------------===//
-
-#include "ProfilingUtils.h"
-#include "llvm/Constants.h"
-#include "llvm/DerivedTypes.h"
-#include "llvm/Module.h"
-#include "llvm/Pass.h"
-#include "llvm/Support/Compiler.h"
-#include "llvm/Support/Streams.h"
-#include "llvm/Transforms/Utils/BasicBlockUtils.h"
-#include "llvm/Transforms/Instrumentation.h"
-#include <set>
-using namespace llvm;
-
-namespace {
- class VISIBILITY_HIDDEN EdgeProfiler : public ModulePass {
- bool runOnModule(Module &M);
- public:
- static char ID; // Pass identification, replacement for typeid
- EdgeProfiler() : ModulePass((intptr_t)&ID) {}
- };
-
- char EdgeProfiler::ID = 0;
- RegisterPass<EdgeProfiler> X("insert-edge-profiling",
- "Insert instrumentation for edge profiling");
-}
-
-ModulePass *llvm::createEdgeProfilerPass() { return new EdgeProfiler(); }
-
-bool EdgeProfiler::runOnModule(Module &M) {
- Function *Main = M.getFunction("main");
- if (Main == 0) {
- cerr << "WARNING: cannot insert edge profiling into a module"
- << " with no main function!\n";
- return false; // No main, no instrumentation!
- }
-
- std::set<BasicBlock*> BlocksToInstrument;
- unsigned NumEdges = 0;
- for (Module::iterator F = M.begin(), E = M.end(); F != E; ++F)
- for (Function::iterator BB = F->begin(), E = F->end(); BB != E; ++BB) {
- // Keep track of which blocks need to be instrumented. We don't want to
- // instrument blocks that are added as the result of breaking critical
- // edges!
- BlocksToInstrument.insert(BB);
- NumEdges += BB->getTerminator()->getNumSuccessors();
- }
-
- const Type *ATy = ArrayType::get(Type::Int32Ty, NumEdges);
- GlobalVariable *Counters =
- new GlobalVariable(ATy, false, GlobalValue::InternalLinkage,
- Constant::getNullValue(ATy), "EdgeProfCounters", &M);
-
- // Instrument all of the edges...
- unsigned i = 0;
- for (Module::iterator F = M.begin(), E = M.end(); F != E; ++F)
- for (Function::iterator BB = F->begin(), E = F->end(); BB != E; ++BB)
- if (BlocksToInstrument.count(BB)) { // Don't instrument inserted blocks
- // Okay, we have to add a counter of each outgoing edge. If the
- // outgoing edge is not critical don't split it, just insert the counter
- // in the source or destination of the edge.
- TerminatorInst *TI = BB->getTerminator();
- for (unsigned s = 0, e = TI->getNumSuccessors(); s != e; ++s) {
- // If the edge is critical, split it.
- SplitCriticalEdge(TI, s, this);
-
- // Okay, we are guaranteed that the edge is no longer critical. If we
- // only have a single successor, insert the counter in this block,
- // otherwise insert it in the successor block.
- if (TI->getNumSuccessors() == 1) {
- // Insert counter at the start of the block
- IncrementCounterInBlock(BB, i++, Counters);
- } else {
- // Insert counter at the start of the block
- IncrementCounterInBlock(TI->getSuccessor(s), i++, Counters);
- }
- }
- }
-
- // Add the initialization call to main.
- InsertProfilingInitCall(Main, "llvm_start_edge_profiling", Counters);
- return true;
-}
-
diff --git a/release_23/lib/Transforms/Instrumentation/Makefile b/release_23/lib/Transforms/Instrumentation/Makefile
deleted file mode 100644
index b1f709c595b6..000000000000
--- a/release_23/lib/Transforms/Instrumentation/Makefile
+++ /dev/null
@@ -1,15 +0,0 @@
-##===- lib/Transforms/Instrumentation/Makefile -------------*- Makefile -*-===##
-#
-# The LLVM Compiler Infrastructure
-#
-# This file is distributed under the University of Illinois Open Source
-# License. See LICENSE.TXT for details.
-#
-##===----------------------------------------------------------------------===##
-
-LEVEL = ../../..
-LIBRARYNAME = LLVMInstrumentation
-BUILD_ARCHIVE = 1
-
-include $(LEVEL)/Makefile.common
-
diff --git a/release_23/lib/Transforms/Instrumentation/ProfilingUtils.cpp b/release_23/lib/Transforms/Instrumentation/ProfilingUtils.cpp
deleted file mode 100644
index 4617fbbd809c..000000000000
--- a/release_23/lib/Transforms/Instrumentation/ProfilingUtils.cpp
+++ /dev/null
@@ -1,120 +0,0 @@
-//===- ProfilingUtils.cpp - Helper functions shared by profilers ----------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements a few helper functions which are used by profile
-// instrumentation code to instrument the code. This allows the profiler pass
-// to worry about *what* to insert, and these functions take care of *how* to do
-// it.
-//
-//===----------------------------------------------------------------------===//
-
-#include "ProfilingUtils.h"
-#include "llvm/Constants.h"
-#include "llvm/DerivedTypes.h"
-#include "llvm/Instructions.h"
-#include "llvm/Module.h"
-
-void llvm::InsertProfilingInitCall(Function *MainFn, const char *FnName,
- GlobalValue *Array) {
- const Type *ArgVTy =
- PointerType::getUnqual(PointerType::getUnqual(Type::Int8Ty));
- const PointerType *UIntPtr = PointerType::getUnqual(Type::Int32Ty);
- Module &M = *MainFn->getParent();
- Constant *InitFn = M.getOrInsertFunction(FnName, Type::Int32Ty, Type::Int32Ty,
- ArgVTy, UIntPtr, Type::Int32Ty,
- (Type *)0);
-
- // This could force argc and argv into programs that wouldn't otherwise have
- // them, but instead we just pass null values in.
- std::vector<Value*> Args(4);
- Args[0] = Constant::getNullValue(Type::Int32Ty);
- Args[1] = Constant::getNullValue(ArgVTy);
-
- // Skip over any allocas in the entry block.
- BasicBlock *Entry = MainFn->begin();
- BasicBlock::iterator InsertPos = Entry->begin();
- while (isa<AllocaInst>(InsertPos)) ++InsertPos;
-
- std::vector<Constant*> GEPIndices(2, Constant::getNullValue(Type::Int32Ty));
- unsigned NumElements = 0;
- if (Array) {
- Args[2] = ConstantExpr::getGetElementPtr(Array, &GEPIndices[0],
- GEPIndices.size());
- NumElements =
- cast<ArrayType>(Array->getType()->getElementType())->getNumElements();
- } else {
- // If this profiling instrumentation doesn't have a constant array, just
- // pass null.
- Args[2] = ConstantPointerNull::get(UIntPtr);
- }
- Args[3] = ConstantInt::get(Type::Int32Ty, NumElements);
-
- Instruction *InitCall = CallInst::Create(InitFn, Args.begin(), Args.end(),
- "newargc", InsertPos);
-
- // If argc or argv are not available in main, just pass null values in.
- Function::arg_iterator AI;
- switch (MainFn->arg_size()) {
- default:
- case 2:
- AI = MainFn->arg_begin(); ++AI;
- if (AI->getType() != ArgVTy) {
- Instruction::CastOps opcode = CastInst::getCastOpcode(AI, false, ArgVTy,
- false);
- InitCall->setOperand(2,
- CastInst::create(opcode, AI, ArgVTy, "argv.cast", InitCall));
- } else {
- InitCall->setOperand(2, AI);
- }
- /* FALL THROUGH */
-
- case 1:
- AI = MainFn->arg_begin();
- // If the program looked at argc, have it look at the return value of the
- // init call instead.
- if (AI->getType() != Type::Int32Ty) {
- Instruction::CastOps opcode;
- if (!AI->use_empty()) {
- opcode = CastInst::getCastOpcode(InitCall, true, AI->getType(), true);
- AI->replaceAllUsesWith(
- CastInst::create(opcode, InitCall, AI->getType(), "", InsertPos));
- }
- opcode = CastInst::getCastOpcode(AI, true, Type::Int32Ty, true);
- InitCall->setOperand(1,
- CastInst::create(opcode, AI, Type::Int32Ty, "argc.cast", InitCall));
- } else {
- AI->replaceAllUsesWith(InitCall);
- InitCall->setOperand(1, AI);
- }
-
- case 0: break;
- }
-}
-
-void llvm::IncrementCounterInBlock(BasicBlock *BB, unsigned CounterNum,
- GlobalValue *CounterArray) {
- // Insert the increment after any alloca or PHI instructions...
- BasicBlock::iterator InsertPos = BB->begin();
- while (isa<AllocaInst>(InsertPos) || isa<PHINode>(InsertPos))
- ++InsertPos;
-
- // Create the getelementptr constant expression
- std::vector<Constant*> Indices(2);
- Indices[0] = Constant::getNullValue(Type::Int32Ty);
- Indices[1] = ConstantInt::get(Type::Int32Ty, CounterNum);
- Constant *ElementPtr =
- ConstantExpr::getGetElementPtr(CounterArray, &Indices[0], Indices.size());
-
- // Load, increment and store the value back.
- Value *OldVal = new LoadInst(ElementPtr, "OldFuncCounter", InsertPos);
- Value *NewVal = BinaryOperator::create(Instruction::Add, OldVal,
- ConstantInt::get(Type::Int32Ty, 1),
- "NewFuncCounter", InsertPos);
- new StoreInst(NewVal, ElementPtr, InsertPos);
-}
diff --git a/release_23/lib/Transforms/Instrumentation/ProfilingUtils.h b/release_23/lib/Transforms/Instrumentation/ProfilingUtils.h
deleted file mode 100644
index 94efffec8a3d..000000000000
--- a/release_23/lib/Transforms/Instrumentation/ProfilingUtils.h
+++ /dev/null
@@ -1,31 +0,0 @@
-//===- ProfilingUtils.h - Helper functions shared by profilers --*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines a few helper functions which are used by profile
-// instrumentation code to instrument the code. This allows the profiler pass
-// to worry about *what* to insert, and these functions take care of *how* to do
-// it.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef PROFILINGUTILS_H
-#define PROFILINGUTILS_H
-
-namespace llvm {
- class Function;
- class GlobalValue;
- class BasicBlock;
-
- void InsertProfilingInitCall(Function *MainFn, const char *FnName,
- GlobalValue *Arr = 0);
- void IncrementCounterInBlock(BasicBlock *BB, unsigned CounterNum,
- GlobalValue *CounterArray);
-}
-
-#endif
diff --git a/release_23/lib/Transforms/Instrumentation/RSProfiling.cpp b/release_23/lib/Transforms/Instrumentation/RSProfiling.cpp
deleted file mode 100644
index c22a29ff7a42..000000000000
--- a/release_23/lib/Transforms/Instrumentation/RSProfiling.cpp
+++ /dev/null
@@ -1,652 +0,0 @@
-//===- RSProfiling.cpp - Various profiling using random sampling ----------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// These passes implement a random sampling based profiling. Different methods
-// of choosing when to sample are supported, as well as different types of
-// profiling. This is done as two passes. The first is a sequence of profiling
-// passes which insert profiling into the program, and remember what they
-// inserted.
-//
-// The second stage duplicates all instructions in a function, ignoring the
-// profiling code, then connects the two versions togeather at the entry and at
-// backedges. At each connection point a choice is made as to whether to jump
-// to the profiled code (take a sample) or execute the unprofiled code.
-//
-// It is highly recommended that after this pass one runs mem2reg and adce
-// (instcombine load-vn gdce dse also are good to run afterwards)
-//
-// This design is intended to make the profiling passes independent of the RS
-// framework, but any profiling pass that implements the RSProfiling interface
-// is compatible with the rs framework (and thus can be sampled)
-//
-// TODO: obviously the block and function profiling are almost identical to the
-// existing ones, so they can be unified (esp since these passes are valid
-// without the rs framework).
-// TODO: Fix choice code so that frequency is not hard coded
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Pass.h"
-#include "llvm/Module.h"
-#include "llvm/Instructions.h"
-#include "llvm/Constants.h"
-#include "llvm/DerivedTypes.h"
-#include "llvm/Intrinsics.h"
-#include "llvm/Transforms/Scalar.h"
-#include "llvm/Transforms/Utils/BasicBlockUtils.h"
-#include "llvm/Support/CommandLine.h"
-#include "llvm/Support/Compiler.h"
-#include "llvm/Support/Debug.h"
-#include "llvm/Transforms/Instrumentation.h"
-#include "RSProfiling.h"
-#include <set>
-#include <map>
-#include <queue>
-#include <list>
-using namespace llvm;
-
-namespace {
- enum RandomMeth {
- GBV, GBVO, HOSTCC
- };
-
- static cl::opt<RandomMeth> RandomMethod("profile-randomness",
- cl::desc("How to randomly choose to profile:"),
- cl::values(
- clEnumValN(GBV, "global", "global counter"),
- clEnumValN(GBVO, "ra_global",
- "register allocated global counter"),
- clEnumValN(HOSTCC, "rdcc", "cycle counter"),
- clEnumValEnd));
-
- /// NullProfilerRS - The basic profiler that does nothing. It is the default
- /// profiler and thus terminates RSProfiler chains. It is useful for
- /// measuring framework overhead
- class VISIBILITY_HIDDEN NullProfilerRS : public RSProfilers {
- public:
- static char ID; // Pass identification, replacement for typeid
- bool isProfiling(Value* v) {
- return false;
- }
- bool runOnModule(Module &M) {
- return false;
- }
- void getAnalysisUsage(AnalysisUsage &AU) const {
- AU.setPreservesAll();
- }
- };
-
- static RegisterAnalysisGroup<RSProfilers> A("Profiling passes");
- static RegisterPass<NullProfilerRS> NP("insert-null-profiling-rs",
- "Measure profiling framework overhead");
- static RegisterAnalysisGroup<RSProfilers, true> NPT(NP);
-
- /// Chooser - Something that chooses when to make a sample of the profiled code
- class VISIBILITY_HIDDEN Chooser {
- public:
- /// ProcessChoicePoint - is called for each basic block inserted to choose
- /// between normal and sample code
- virtual void ProcessChoicePoint(BasicBlock*) = 0;
- /// PrepFunction - is called once per function before other work is done.
- /// This gives the opertunity to insert new allocas and such.
- virtual void PrepFunction(Function*) = 0;
- virtual ~Chooser() {}
- };
-
- //Things that implement sampling policies
- //A global value that is read-mod-stored to choose when to sample.
- //A sample is taken when the global counter hits 0
- class VISIBILITY_HIDDEN GlobalRandomCounter : public Chooser {
- GlobalVariable* Counter;
- Value* ResetValue;
- const Type* T;
- public:
- GlobalRandomCounter(Module& M, const Type* t, uint64_t resetval);
- virtual ~GlobalRandomCounter();
- virtual void PrepFunction(Function* F);
- virtual void ProcessChoicePoint(BasicBlock* bb);
- };
-
- //Same is GRC, but allow register allocation of the global counter
- class VISIBILITY_HIDDEN GlobalRandomCounterOpt : public Chooser {
- GlobalVariable* Counter;
- Value* ResetValue;
- AllocaInst* AI;
- const Type* T;
- public:
- GlobalRandomCounterOpt(Module& M, const Type* t, uint64_t resetval);
- virtual ~GlobalRandomCounterOpt();
- virtual void PrepFunction(Function* F);
- virtual void ProcessChoicePoint(BasicBlock* bb);
- };
-
- //Use the cycle counter intrinsic as a source of pseudo randomness when
- //deciding when to sample.
- class VISIBILITY_HIDDEN CycleCounter : public Chooser {
- uint64_t rm;
- Constant *F;
- public:
- CycleCounter(Module& m, uint64_t resetmask);
- virtual ~CycleCounter();
- virtual void PrepFunction(Function* F);
- virtual void ProcessChoicePoint(BasicBlock* bb);
- };
-
- /// ProfilerRS - Insert the random sampling framework
- struct VISIBILITY_HIDDEN ProfilerRS : public FunctionPass {
- static char ID; // Pass identification, replacement for typeid
- ProfilerRS() : FunctionPass((intptr_t)&ID) {}
-
- std::map<Value*, Value*> TransCache;
- std::set<BasicBlock*> ChoicePoints;
- Chooser* c;
-
- //Translate and duplicate values for the new profile free version of stuff
- Value* Translate(Value* v);
- //Duplicate an entire function (with out profiling)
- void Duplicate(Function& F, RSProfilers& LI);
- //Called once for each backedge, handle the insertion of choice points and
- //the interconection of the two versions of the code
- void ProcessBackEdge(BasicBlock* src, BasicBlock* dst, Function& F);
- bool runOnFunction(Function& F);
- bool doInitialization(Module &M);
- virtual void getAnalysisUsage(AnalysisUsage &AU) const;
- };
-
- RegisterPass<ProfilerRS> X("insert-rs-profiling-framework",
- "Insert random sampling instrumentation framework");
-}
-
-char RSProfilers::ID = 0;
-char NullProfilerRS::ID = 0;
-char ProfilerRS::ID = 0;
-
-//Local utilities
-static void ReplacePhiPred(BasicBlock* btarget,
- BasicBlock* bold, BasicBlock* bnew);
-
-static void CollapsePhi(BasicBlock* btarget, BasicBlock* bsrc);
-
-template<class T>
-static void recBackEdge(BasicBlock* bb, T& BackEdges,
- std::map<BasicBlock*, int>& color,
- std::map<BasicBlock*, int>& depth,
- std::map<BasicBlock*, int>& finish,
- int& time);
-
-//find the back edges and where they go to
-template<class T>
-static void getBackEdges(Function& F, T& BackEdges);
-
-
-///////////////////////////////////////
-// Methods of choosing when to profile
-///////////////////////////////////////
-
-GlobalRandomCounter::GlobalRandomCounter(Module& M, const Type* t,
- uint64_t resetval) : T(t) {
- ConstantInt* Init = ConstantInt::get(T, resetval);
- ResetValue = Init;
- Counter = new GlobalVariable(T, false, GlobalValue::InternalLinkage,
- Init, "RandomSteeringCounter", &M);
-}
-
-GlobalRandomCounter::~GlobalRandomCounter() {}
-
-void GlobalRandomCounter::PrepFunction(Function* F) {}
-
-void GlobalRandomCounter::ProcessChoicePoint(BasicBlock* bb) {
- BranchInst* t = cast<BranchInst>(bb->getTerminator());
-
- //decrement counter
- LoadInst* l = new LoadInst(Counter, "counter", t);
-
- ICmpInst* s = new ICmpInst(ICmpInst::ICMP_EQ, l, ConstantInt::get(T, 0),
- "countercc", t);
-
- Value* nv = BinaryOperator::createSub(l, ConstantInt::get(T, 1),
- "counternew", t);
- new StoreInst(nv, Counter, t);
- t->setCondition(s);
-
- //reset counter
- BasicBlock* oldnext = t->getSuccessor(0);
- BasicBlock* resetblock = BasicBlock::Create("reset", oldnext->getParent(),
- oldnext);
- TerminatorInst* t2 = BranchInst::Create(oldnext, resetblock);
- t->setSuccessor(0, resetblock);
- new StoreInst(ResetValue, Counter, t2);
- ReplacePhiPred(oldnext, bb, resetblock);
-}
-
-GlobalRandomCounterOpt::GlobalRandomCounterOpt(Module& M, const Type* t,
- uint64_t resetval)
- : AI(0), T(t) {
- ConstantInt* Init = ConstantInt::get(T, resetval);
- ResetValue = Init;
- Counter = new GlobalVariable(T, false, GlobalValue::InternalLinkage,
- Init, "RandomSteeringCounter", &M);
-}
-
-GlobalRandomCounterOpt::~GlobalRandomCounterOpt() {}
-
-void GlobalRandomCounterOpt::PrepFunction(Function* F) {
- //make a local temporary to cache the global
- BasicBlock& bb = F->getEntryBlock();
- BasicBlock::iterator InsertPt = bb.begin();
- AI = new AllocaInst(T, 0, "localcounter", InsertPt);
- LoadInst* l = new LoadInst(Counter, "counterload", InsertPt);
- new StoreInst(l, AI, InsertPt);
-
- //modify all functions and return values to restore the local variable to/from
- //the global variable
- for(Function::iterator fib = F->begin(), fie = F->end();
- fib != fie; ++fib)
- for(BasicBlock::iterator bib = fib->begin(), bie = fib->end();
- bib != bie; ++bib)
- if (isa<CallInst>(bib)) {
- LoadInst* l = new LoadInst(AI, "counter", bib);
- new StoreInst(l, Counter, bib);
- l = new LoadInst(Counter, "counter", ++bib);
- new StoreInst(l, AI, bib--);
- } else if (isa<InvokeInst>(bib)) {
- LoadInst* l = new LoadInst(AI, "counter", bib);
- new StoreInst(l, Counter, bib);
-
- BasicBlock* bb = cast<InvokeInst>(bib)->getNormalDest();
- BasicBlock::iterator i = bb->begin();
- while (isa<PHINode>(i))
- ++i;
- l = new LoadInst(Counter, "counter", i);
-
- bb = cast<InvokeInst>(bib)->getUnwindDest();
- i = bb->begin();
- while (isa<PHINode>(i)) ++i;
- l = new LoadInst(Counter, "counter", i);
- new StoreInst(l, AI, i);
- } else if (isa<UnwindInst>(&*bib) || isa<ReturnInst>(&*bib)) {
- LoadInst* l = new LoadInst(AI, "counter", bib);
- new StoreInst(l, Counter, bib);
- }
-}
-
-void GlobalRandomCounterOpt::ProcessChoicePoint(BasicBlock* bb) {
- BranchInst* t = cast<BranchInst>(bb->getTerminator());
-
- //decrement counter
- LoadInst* l = new LoadInst(AI, "counter", t);
-
- ICmpInst* s = new ICmpInst(ICmpInst::ICMP_EQ, l, ConstantInt::get(T, 0),
- "countercc", t);
-
- Value* nv = BinaryOperator::createSub(l, ConstantInt::get(T, 1),
- "counternew", t);
- new StoreInst(nv, AI, t);
- t->setCondition(s);
-
- //reset counter
- BasicBlock* oldnext = t->getSuccessor(0);
- BasicBlock* resetblock = BasicBlock::Create("reset", oldnext->getParent(),
- oldnext);
- TerminatorInst* t2 = BranchInst::Create(oldnext, resetblock);
- t->setSuccessor(0, resetblock);
- new StoreInst(ResetValue, AI, t2);
- ReplacePhiPred(oldnext, bb, resetblock);
-}
-
-
-CycleCounter::CycleCounter(Module& m, uint64_t resetmask) : rm(resetmask) {
- F = Intrinsic::getDeclaration(&m, Intrinsic::readcyclecounter);
-}
-
-CycleCounter::~CycleCounter() {}
-
-void CycleCounter::PrepFunction(Function* F) {}
-
-void CycleCounter::ProcessChoicePoint(BasicBlock* bb) {
- BranchInst* t = cast<BranchInst>(bb->getTerminator());
-
- CallInst* c = CallInst::Create(F, "rdcc", t);
- BinaryOperator* b =
- BinaryOperator::createAnd(c, ConstantInt::get(Type::Int64Ty, rm),
- "mrdcc", t);
-
- ICmpInst *s = new ICmpInst(ICmpInst::ICMP_EQ, b,
- ConstantInt::get(Type::Int64Ty, 0),
- "mrdccc", t);
-
- t->setCondition(s);
-}
-
-///////////////////////////////////////
-// Profiling:
-///////////////////////////////////////
-bool RSProfilers_std::isProfiling(Value* v) {
- if (profcode.find(v) != profcode.end())
- return true;
- //else
- RSProfilers& LI = getAnalysis<RSProfilers>();
- return LI.isProfiling(v);
-}
-
-void RSProfilers_std::IncrementCounterInBlock(BasicBlock *BB, unsigned CounterNum,
- GlobalValue *CounterArray) {
- // Insert the increment after any alloca or PHI instructions...
- BasicBlock::iterator InsertPos = BB->begin();
- while (isa<AllocaInst>(InsertPos) || isa<PHINode>(InsertPos))
- ++InsertPos;
-
- // Create the getelementptr constant expression
- std::vector<Constant*> Indices(2);
- Indices[0] = Constant::getNullValue(Type::Int32Ty);
- Indices[1] = ConstantInt::get(Type::Int32Ty, CounterNum);
- Constant *ElementPtr = ConstantExpr::getGetElementPtr(CounterArray,
- &Indices[0], 2);
-
- // Load, increment and store the value back.
- Value *OldVal = new LoadInst(ElementPtr, "OldCounter", InsertPos);
- profcode.insert(OldVal);
- Value *NewVal = BinaryOperator::createAdd(OldVal,
- ConstantInt::get(Type::Int32Ty, 1),
- "NewCounter", InsertPos);
- profcode.insert(NewVal);
- profcode.insert(new StoreInst(NewVal, ElementPtr, InsertPos));
-}
-
-void RSProfilers_std::getAnalysisUsage(AnalysisUsage &AU) const {
- //grab any outstanding profiler, or get the null one
- AU.addRequired<RSProfilers>();
-}
-
-///////////////////////////////////////
-// RS Framework
-///////////////////////////////////////
-
-Value* ProfilerRS::Translate(Value* v) {
- if(TransCache[v])
- return TransCache[v];
-
- if (BasicBlock* bb = dyn_cast<BasicBlock>(v)) {
- if (bb == &bb->getParent()->getEntryBlock())
- TransCache[bb] = bb; //don't translate entry block
- else
- TransCache[bb] = BasicBlock::Create("dup_" + bb->getName(), bb->getParent(),
- NULL);
- return TransCache[bb];
- } else if (Instruction* i = dyn_cast<Instruction>(v)) {
- //we have already translated this
- //do not translate entry block allocas
- if(&i->getParent()->getParent()->getEntryBlock() == i->getParent()) {
- TransCache[i] = i;
- return i;
- } else {
- //translate this
- Instruction* i2 = i->clone();
- if (i->hasName())
- i2->setName("dup_" + i->getName());
- TransCache[i] = i2;
- //NumNewInst++;
- for (unsigned x = 0; x < i2->getNumOperands(); ++x)
- i2->setOperand(x, Translate(i2->getOperand(x)));
- return i2;
- }
- } else if (isa<Function>(v) || isa<Constant>(v) || isa<Argument>(v)) {
- TransCache[v] = v;
- return v;
- }
- assert(0 && "Value not handled");
- return 0;
-}
-
-void ProfilerRS::Duplicate(Function& F, RSProfilers& LI)
-{
- //perform a breadth first search, building up a duplicate of the code
- std::queue<BasicBlock*> worklist;
- std::set<BasicBlock*> seen;
-
- //This loop ensures proper BB order, to help performance
- for (Function::iterator fib = F.begin(), fie = F.end(); fib != fie; ++fib)
- worklist.push(fib);
- while (!worklist.empty()) {
- Translate(worklist.front());
- worklist.pop();
- }
-
- //remember than reg2mem created a new entry block we don't want to duplicate
- worklist.push(F.getEntryBlock().getTerminator()->getSuccessor(0));
- seen.insert(&F.getEntryBlock());
-
- while (!worklist.empty()) {
- BasicBlock* bb = worklist.front();
- worklist.pop();
- if(seen.find(bb) == seen.end()) {
- BasicBlock* bbtarget = cast<BasicBlock>(Translate(bb));
- BasicBlock::InstListType& instlist = bbtarget->getInstList();
- for (BasicBlock::iterator iib = bb->begin(), iie = bb->end();
- iib != iie; ++iib) {
- //NumOldInst++;
- if (!LI.isProfiling(&*iib)) {
- Instruction* i = cast<Instruction>(Translate(iib));
- instlist.insert(bbtarget->end(), i);
- }
- }
- //updated search state;
- seen.insert(bb);
- TerminatorInst* ti = bb->getTerminator();
- for (unsigned x = 0; x < ti->getNumSuccessors(); ++x) {
- BasicBlock* bbs = ti->getSuccessor(x);
- if (seen.find(bbs) == seen.end()) {
- worklist.push(bbs);
- }
- }
- }
- }
-}
-
-void ProfilerRS::ProcessBackEdge(BasicBlock* src, BasicBlock* dst, Function& F) {
- //given a backedge from B -> A, and translations A' and B',
- //a: insert C and C'
- //b: add branches in C to A and A' and in C' to A and A'
- //c: mod terminators@B, replace A with C
- //d: mod terminators@B', replace A' with C'
- //e: mod phis@A for pred B to be pred C
- // if multiple entries, simplify to one
- //f: mod phis@A' for pred B' to be pred C'
- // if multiple entries, simplify to one
- //g: for all phis@A with pred C using x
- // add in edge from C' using x'
- // add in edge from C using x in A'
-
- //a:
- Function::iterator BBN = src; ++BBN;
- BasicBlock* bbC = BasicBlock::Create("choice", &F, BBN);
- //ChoicePoints.insert(bbC);
- BBN = cast<BasicBlock>(Translate(src));
- BasicBlock* bbCp = BasicBlock::Create("choice", &F, ++BBN);
- ChoicePoints.insert(bbCp);
-
- //b:
- BranchInst::Create(cast<BasicBlock>(Translate(dst)), bbC);
- BranchInst::Create(dst, cast<BasicBlock>(Translate(dst)),
- ConstantInt::get(Type::Int1Ty, true), bbCp);
- //c:
- {
- TerminatorInst* iB = src->getTerminator();
- for (unsigned x = 0; x < iB->getNumSuccessors(); ++x)
- if (iB->getSuccessor(x) == dst)
- iB->setSuccessor(x, bbC);
- }
- //d:
- {
- TerminatorInst* iBp = cast<TerminatorInst>(Translate(src->getTerminator()));
- for (unsigned x = 0; x < iBp->getNumSuccessors(); ++x)
- if (iBp->getSuccessor(x) == cast<BasicBlock>(Translate(dst)))
- iBp->setSuccessor(x, bbCp);
- }
- //e:
- ReplacePhiPred(dst, src, bbC);
- //src could be a switch, in which case we are replacing several edges with one
- //thus collapse those edges int the Phi
- CollapsePhi(dst, bbC);
- //f:
- ReplacePhiPred(cast<BasicBlock>(Translate(dst)),
- cast<BasicBlock>(Translate(src)),bbCp);
- CollapsePhi(cast<BasicBlock>(Translate(dst)), bbCp);
- //g:
- for(BasicBlock::iterator ib = dst->begin(), ie = dst->end(); ib != ie;
- ++ib)
- if (PHINode* phi = dyn_cast<PHINode>(&*ib)) {
- for(unsigned x = 0; x < phi->getNumIncomingValues(); ++x)
- if(bbC == phi->getIncomingBlock(x)) {
- phi->addIncoming(Translate(phi->getIncomingValue(x)), bbCp);
- cast<PHINode>(Translate(phi))->addIncoming(phi->getIncomingValue(x),
- bbC);
- }
- phi->removeIncomingValue(bbC);
- }
-}
-
-bool ProfilerRS::runOnFunction(Function& F) {
- if (!F.isDeclaration()) {
- std::set<std::pair<BasicBlock*, BasicBlock*> > BackEdges;
- RSProfilers& LI = getAnalysis<RSProfilers>();
-
- getBackEdges(F, BackEdges);
- Duplicate(F, LI);
- //assume that stuff worked. now connect the duplicated basic blocks
- //with the originals in such a way as to preserve ssa. yuk!
- for (std::set<std::pair<BasicBlock*, BasicBlock*> >::iterator
- ib = BackEdges.begin(), ie = BackEdges.end(); ib != ie; ++ib)
- ProcessBackEdge(ib->first, ib->second, F);
-
- //oh, and add the edge from the reg2mem created entry node to the
- //duplicated second node
- TerminatorInst* T = F.getEntryBlock().getTerminator();
- ReplaceInstWithInst(T, BranchInst::Create(T->getSuccessor(0),
- cast<BasicBlock>(
- Translate(T->getSuccessor(0))),
- ConstantInt::get(Type::Int1Ty,
- true)));
-
- //do whatever is needed now that the function is duplicated
- c->PrepFunction(&F);
-
- //add entry node to choice points
- ChoicePoints.insert(&F.getEntryBlock());
-
- for (std::set<BasicBlock*>::iterator
- ii = ChoicePoints.begin(), ie = ChoicePoints.end(); ii != ie; ++ii)
- c->ProcessChoicePoint(*ii);
-
- ChoicePoints.clear();
- TransCache.clear();
-
- return true;
- }
- return false;
-}
-
-bool ProfilerRS::doInitialization(Module &M) {
- switch (RandomMethod) {
- case GBV:
- c = new GlobalRandomCounter(M, Type::Int32Ty, (1 << 14) - 1);
- break;
- case GBVO:
- c = new GlobalRandomCounterOpt(M, Type::Int32Ty, (1 << 14) - 1);
- break;
- case HOSTCC:
- c = new CycleCounter(M, (1 << 14) - 1);
- break;
- };
- return true;
-}
-
-void ProfilerRS::getAnalysisUsage(AnalysisUsage &AU) const {
- AU.addRequired<RSProfilers>();
- AU.addRequiredID(DemoteRegisterToMemoryID);
-}
-
-///////////////////////////////////////
-// Utilities:
-///////////////////////////////////////
-static void ReplacePhiPred(BasicBlock* btarget,
- BasicBlock* bold, BasicBlock* bnew) {
- for(BasicBlock::iterator ib = btarget->begin(), ie = btarget->end();
- ib != ie; ++ib)
- if (PHINode* phi = dyn_cast<PHINode>(&*ib)) {
- for(unsigned x = 0; x < phi->getNumIncomingValues(); ++x)
- if(bold == phi->getIncomingBlock(x))
- phi->setIncomingBlock(x, bnew);
- }
-}
-
-static void CollapsePhi(BasicBlock* btarget, BasicBlock* bsrc) {
- for(BasicBlock::iterator ib = btarget->begin(), ie = btarget->end();
- ib != ie; ++ib)
- if (PHINode* phi = dyn_cast<PHINode>(&*ib)) {
- std::map<BasicBlock*, Value*> counter;
- for(unsigned i = 0; i < phi->getNumIncomingValues(); ) {
- if (counter[phi->getIncomingBlock(i)]) {
- assert(phi->getIncomingValue(i) == counter[phi->getIncomingBlock(i)]);
- phi->removeIncomingValue(i, false);
- } else {
- counter[phi->getIncomingBlock(i)] = phi->getIncomingValue(i);
- ++i;
- }
- }
- }
-}
-
-template<class T>
-static void recBackEdge(BasicBlock* bb, T& BackEdges,
- std::map<BasicBlock*, int>& color,
- std::map<BasicBlock*, int>& depth,
- std::map<BasicBlock*, int>& finish,
- int& time)
-{
- color[bb] = 1;
- ++time;
- depth[bb] = time;
- TerminatorInst* t= bb->getTerminator();
- for(unsigned i = 0; i < t->getNumSuccessors(); ++i) {
- BasicBlock* bbnew = t->getSuccessor(i);
- if (color[bbnew] == 0)
- recBackEdge(bbnew, BackEdges, color, depth, finish, time);
- else if (color[bbnew] == 1) {
- BackEdges.insert(std::make_pair(bb, bbnew));
- //NumBackEdges++;
- }
- }
- color[bb] = 2;
- ++time;
- finish[bb] = time;
-}
-
-
-
-//find the back edges and where they go to
-template<class T>
-static void getBackEdges(Function& F, T& BackEdges) {
- std::map<BasicBlock*, int> color;
- std::map<BasicBlock*, int> depth;
- std::map<BasicBlock*, int> finish;
- int time = 0;
- recBackEdge(&F.getEntryBlock(), BackEdges, color, depth, finish, time);
- DOUT << F.getName() << " " << BackEdges.size() << "\n";
-}
-
-
-//Creation functions
-ModulePass* llvm::createNullProfilerRSPass() {
- return new NullProfilerRS();
-}
-
-FunctionPass* llvm::createRSProfilingPass() {
- return new ProfilerRS();
-}
diff --git a/release_23/lib/Transforms/Instrumentation/RSProfiling.h b/release_23/lib/Transforms/Instrumentation/RSProfiling.h
deleted file mode 100644
index 8bbe7c7b28fe..000000000000
--- a/release_23/lib/Transforms/Instrumentation/RSProfiling.h
+++ /dev/null
@@ -1,31 +0,0 @@
-//===- RSProfiling.h - Various profiling using random sampling ----------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// See notes in RSProfiling.cpp
-//
-//===----------------------------------------------------------------------===//
-#include "llvm/Transforms/RSProfiling.h"
-#include <set>
-
-namespace llvm {
- /// RSProfilers_std - a simple support class for profilers that handles most
- /// of the work of chaining and tracking inserted code.
- struct RSProfilers_std : public RSProfilers {
- static char ID;
- std::set<Value*> profcode;
- // Lookup up values in profcode
- virtual bool isProfiling(Value* v);
- // handles required chaining
- virtual void getAnalysisUsage(AnalysisUsage &AU) const;
- // places counter updates in basic blocks and recordes added instructions in
- // profcode
- void IncrementCounterInBlock(BasicBlock *BB, unsigned CounterNum,
- GlobalValue *CounterArray);
- };
-}
diff --git a/release_23/lib/Transforms/Makefile b/release_23/lib/Transforms/Makefile
deleted file mode 100644
index bf9599ad53b5..000000000000
--- a/release_23/lib/Transforms/Makefile
+++ /dev/null
@@ -1,14 +0,0 @@
-##===- lib/Transforms/Makefile -----------------------------*- Makefile -*-===##
-#
-# The LLVM Compiler Infrastructure
-#
-# This file is distributed under the University of Illinois Open Source
-# License. See LICENSE.TXT for details.
-#
-##===----------------------------------------------------------------------===##
-
-LEVEL = ../..
-PARALLEL_DIRS = Utils Instrumentation Scalar IPO Hello
-
-include $(LEVEL)/Makefile.common
-
diff --git a/release_23/lib/Transforms/Scalar/ADCE.cpp b/release_23/lib/Transforms/Scalar/ADCE.cpp
deleted file mode 100644
index d909d0227c03..000000000000
--- a/release_23/lib/Transforms/Scalar/ADCE.cpp
+++ /dev/null
@@ -1,470 +0,0 @@
-//===- ADCE.cpp - Code to perform aggressive dead code elimination --------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements "aggressive" dead code elimination. ADCE is DCe where
-// values are assumed to be dead until proven otherwise. This is similar to
-// SCCP, except applied to the liveness of values.
-//
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "adce"
-#include "llvm/Transforms/Scalar.h"
-#include "llvm/Constants.h"
-#include "llvm/Instructions.h"
-#include "llvm/Analysis/AliasAnalysis.h"
-#include "llvm/Analysis/PostDominators.h"
-#include "llvm/Support/CFG.h"
-#include "llvm/Transforms/Utils/BasicBlockUtils.h"
-#include "llvm/Transforms/Utils/Local.h"
-#include "llvm/Transforms/Utils/UnifyFunctionExitNodes.h"
-#include "llvm/Support/Debug.h"
-#include "llvm/ADT/DepthFirstIterator.h"
-#include "llvm/ADT/SmallVector.h"
-#include "llvm/ADT/Statistic.h"
-#include "llvm/ADT/STLExtras.h"
-#include "llvm/Support/Compiler.h"
-#include <algorithm>
-using namespace llvm;
-
-STATISTIC(NumBlockRemoved, "Number of basic blocks removed");
-STATISTIC(NumInstRemoved , "Number of instructions removed");
-STATISTIC(NumCallRemoved , "Number of calls removed");
-
-namespace {
-//===----------------------------------------------------------------------===//
-// ADCE Class
-//
-// This class does all of the work of Aggressive Dead Code Elimination.
-// It's public interface consists of a constructor and a doADCE() method.
-//
-class VISIBILITY_HIDDEN ADCE : public FunctionPass {
- Function *Func; // The function that we are working on
- std::vector<Instruction*> WorkList; // Instructions that just became live
- std::set<Instruction*> LiveSet; // The set of live instructions
-
- //===--------------------------------------------------------------------===//
- // The public interface for this class
- //
-public:
- static char ID; // Pass identification, replacement for typeid
- ADCE() : FunctionPass((intptr_t)&ID) {}
-
- // Execute the Aggressive Dead Code Elimination Algorithm
- //
- virtual bool runOnFunction(Function &F) {
- Func = &F;
- bool Changed = doADCE();
- assert(WorkList.empty());
- LiveSet.clear();
- return Changed;
- }
- // getAnalysisUsage - We require post dominance frontiers (aka Control
- // Dependence Graph)
- virtual void getAnalysisUsage(AnalysisUsage &AU) const {
- // We require that all function nodes are unified, because otherwise code
- // can be marked live that wouldn't necessarily be otherwise.
- AU.addRequired<UnifyFunctionExitNodes>();
- AU.addRequired<AliasAnalysis>();
- AU.addRequired<PostDominatorTree>();
- AU.addRequired<PostDominanceFrontier>();
- }
-
-
- //===--------------------------------------------------------------------===//
- // The implementation of this class
- //
-private:
- // doADCE() - Run the Aggressive Dead Code Elimination algorithm, returning
- // true if the function was modified.
- //
- bool doADCE();
-
- void markBlockAlive(BasicBlock *BB);
-
-
- // deleteDeadInstructionsInLiveBlock - Loop over all of the instructions in
- // the specified basic block, deleting ones that are dead according to
- // LiveSet.
- bool deleteDeadInstructionsInLiveBlock(BasicBlock *BB);
-
- TerminatorInst *convertToUnconditionalBranch(TerminatorInst *TI);
-
- inline void markInstructionLive(Instruction *I) {
- if (!LiveSet.insert(I).second) return;
- DOUT << "Insn Live: " << *I;
- WorkList.push_back(I);
- }
-
- inline void markTerminatorLive(const BasicBlock *BB) {
- DOUT << "Terminator Live: " << *BB->getTerminator();
- markInstructionLive(const_cast<TerminatorInst*>(BB->getTerminator()));
- }
-};
-
- char ADCE::ID = 0;
- RegisterPass<ADCE> X("adce", "Aggressive Dead Code Elimination");
-} // End of anonymous namespace
-
-FunctionPass *llvm::createAggressiveDCEPass() { return new ADCE(); }
-
-void ADCE::markBlockAlive(BasicBlock *BB) {
- // Mark the basic block as being newly ALIVE... and mark all branches that
- // this block is control dependent on as being alive also...
- //
- PostDominanceFrontier &CDG = getAnalysis<PostDominanceFrontier>();
-
- PostDominanceFrontier::const_iterator It = CDG.find(BB);
- if (It != CDG.end()) {
- // Get the blocks that this node is control dependent on...
- const PostDominanceFrontier::DomSetType &CDB = It->second;
- for (PostDominanceFrontier::DomSetType::const_iterator I =
- CDB.begin(), E = CDB.end(); I != E; ++I)
- markTerminatorLive(*I); // Mark all their terminators as live
- }
-
- // If this basic block is live, and it ends in an unconditional branch, then
- // the branch is alive as well...
- if (BranchInst *BI = dyn_cast<BranchInst>(BB->getTerminator()))
- if (BI->isUnconditional())
- markTerminatorLive(BB);
-}
-
-// deleteDeadInstructionsInLiveBlock - Loop over all of the instructions in the
-// specified basic block, deleting ones that are dead according to LiveSet.
-bool ADCE::deleteDeadInstructionsInLiveBlock(BasicBlock *BB) {
- bool Changed = false;
- for (BasicBlock::iterator II = BB->begin(), E = --BB->end(); II != E; ) {
- Instruction *I = II++;
- if (!LiveSet.count(I)) { // Is this instruction alive?
- if (!I->use_empty())
- I->replaceAllUsesWith(UndefValue::get(I->getType()));
-
- // Nope... remove the instruction from it's basic block...
- if (isa<CallInst>(I))
- ++NumCallRemoved;
- else
- ++NumInstRemoved;
- BB->getInstList().erase(I);
- Changed = true;
- }
- }
- return Changed;
-}
-
-
-/// convertToUnconditionalBranch - Transform this conditional terminator
-/// instruction into an unconditional branch because we don't care which of the
-/// successors it goes to. This eliminate a use of the condition as well.
-///
-TerminatorInst *ADCE::convertToUnconditionalBranch(TerminatorInst *TI) {
- BranchInst *NB = BranchInst::Create(TI->getSuccessor(0), TI);
- BasicBlock *BB = TI->getParent();
-
- // Remove entries from PHI nodes to avoid confusing ourself later...
- for (unsigned i = 1, e = TI->getNumSuccessors(); i != e; ++i)
- TI->getSuccessor(i)->removePredecessor(BB);
-
- // Delete the old branch itself...
- BB->getInstList().erase(TI);
- return NB;
-}
-
-
-// doADCE() - Run the Aggressive Dead Code Elimination algorithm, returning
-// true if the function was modified.
-//
-bool ADCE::doADCE() {
- bool MadeChanges = false;
-
- AliasAnalysis &AA = getAnalysis<AliasAnalysis>();
-
- // Iterate over all of the instructions in the function, eliminating trivially
- // dead instructions, and marking instructions live that are known to be
- // needed. Perform the walk in depth first order so that we avoid marking any
- // instructions live in basic blocks that are unreachable. These blocks will
- // be eliminated later, along with the instructions inside.
- //
- std::set<BasicBlock*> ReachableBBs;
- for (df_ext_iterator<BasicBlock*>
- BBI = df_ext_begin(&Func->front(), ReachableBBs),
- BBE = df_ext_end(&Func->front(), ReachableBBs); BBI != BBE; ++BBI) {
- BasicBlock *BB = *BBI;
- for (BasicBlock::iterator II = BB->begin(), EI = BB->end(); II != EI; ) {
- Instruction *I = II++;
- if (CallInst *CI = dyn_cast<CallInst>(I)) {
- if (AA.onlyReadsMemory(CI)) {
- if (CI->use_empty()) {
- BB->getInstList().erase(CI);
- ++NumCallRemoved;
- }
- } else {
- markInstructionLive(I);
- }
- } else if (I->mayWriteToMemory() || isa<ReturnInst>(I) ||
- isa<UnwindInst>(I) || isa<UnreachableInst>(I)) {
- // FIXME: Unreachable instructions should not be marked intrinsically
- // live here.
- markInstructionLive(I);
- } else if (isInstructionTriviallyDead(I)) {
- // Remove the instruction from it's basic block...
- BB->getInstList().erase(I);
- ++NumInstRemoved;
- }
- }
- }
-
- // Check to ensure we have an exit node for this CFG. If we don't, we won't
- // have any post-dominance information, thus we cannot perform our
- // transformations safely.
- //
- PostDominatorTree &DT = getAnalysis<PostDominatorTree>();
- if (DT[&Func->getEntryBlock()] == 0) {
- WorkList.clear();
- return MadeChanges;
- }
-
- // Scan the function marking blocks without post-dominance information as
- // live. Blocks without post-dominance information occur when there is an
- // infinite loop in the program. Because the infinite loop could contain a
- // function which unwinds, exits or has side-effects, we don't want to delete
- // the infinite loop or those blocks leading up to it.
- for (Function::iterator I = Func->begin(), E = Func->end(); I != E; ++I)
- if (DT[I] == 0 && ReachableBBs.count(I))
- for (pred_iterator PI = pred_begin(I), E = pred_end(I); PI != E; ++PI)
- markInstructionLive((*PI)->getTerminator());
-
- DOUT << "Processing work list\n";
-
- // AliveBlocks - Set of basic blocks that we know have instructions that are
- // alive in them...
- //
- std::set<BasicBlock*> AliveBlocks;
-
- // Process the work list of instructions that just became live... if they
- // became live, then that means that all of their operands are necessary as
- // well... make them live as well.
- //
- while (!WorkList.empty()) {
- Instruction *I = WorkList.back(); // Get an instruction that became live...
- WorkList.pop_back();
-
- BasicBlock *BB = I->getParent();
- if (!ReachableBBs.count(BB)) continue;
- if (AliveBlocks.insert(BB).second) // Basic block not alive yet.
- markBlockAlive(BB); // Make it so now!
-
- // PHI nodes are a special case, because the incoming values are actually
- // defined in the predecessor nodes of this block, meaning that the PHI
- // makes the predecessors alive.
- //
- if (PHINode *PN = dyn_cast<PHINode>(I)) {
- for (unsigned i = 0, e = PN->getNumIncomingValues(); i != e; ++i) {
- // If the incoming edge is clearly dead, it won't have control
- // dependence information. Do not mark it live.
- BasicBlock *PredBB = PN->getIncomingBlock(i);
- if (ReachableBBs.count(PredBB)) {
- // FIXME: This should mark the control dependent edge as live, not
- // necessarily the predecessor itself!
- if (AliveBlocks.insert(PredBB).second)
- markBlockAlive(PN->getIncomingBlock(i)); // Block is newly ALIVE!
- if (Instruction *Op = dyn_cast<Instruction>(PN->getIncomingValue(i)))
- markInstructionLive(Op);
- }
- }
- } else {
- // Loop over all of the operands of the live instruction, making sure that
- // they are known to be alive as well.
- //
- for (unsigned op = 0, End = I->getNumOperands(); op != End; ++op)
- if (Instruction *Operand = dyn_cast<Instruction>(I->getOperand(op)))
- markInstructionLive(Operand);
- }
- }
-
- DEBUG(
- DOUT << "Current Function: X = Live\n";
- for (Function::iterator I = Func->begin(), E = Func->end(); I != E; ++I){
- DOUT << I->getName() << ":\t"
- << (AliveBlocks.count(I) ? "LIVE\n" : "DEAD\n");
- for (BasicBlock::iterator BI = I->begin(), BE = I->end(); BI != BE; ++BI){
- if (LiveSet.count(BI)) DOUT << "X ";
- DOUT << *BI;
- }
- });
-
- // All blocks being live is a common case, handle it specially.
- if (AliveBlocks.size() == Func->size()) { // No dead blocks?
- for (Function::iterator I = Func->begin(), E = Func->end(); I != E; ++I) {
- // Loop over all of the instructions in the function deleting instructions
- // to drop their references.
- deleteDeadInstructionsInLiveBlock(I);
-
- // Check to make sure the terminator instruction is live. If it isn't,
- // this means that the condition that it branches on (we know it is not an
- // unconditional branch), is not needed to make the decision of where to
- // go to, because all outgoing edges go to the same place. We must remove
- // the use of the condition (because it's probably dead), so we convert
- // the terminator to an unconditional branch.
- //
- TerminatorInst *TI = I->getTerminator();
- if (!LiveSet.count(TI))
- convertToUnconditionalBranch(TI);
- }
-
- return MadeChanges;
- }
-
-
- // If the entry node is dead, insert a new entry node to eliminate the entry
- // node as a special case.
- //
- if (!AliveBlocks.count(&Func->front())) {
- BasicBlock *NewEntry = BasicBlock::Create();
- BranchInst::Create(&Func->front(), NewEntry);
- Func->getBasicBlockList().push_front(NewEntry);
- AliveBlocks.insert(NewEntry); // This block is always alive!
- LiveSet.insert(NewEntry->getTerminator()); // The branch is live
- }
-
- // Loop over all of the alive blocks in the function. If any successor
- // blocks are not alive, we adjust the outgoing branches to branch to the
- // first live postdominator of the live block, adjusting any PHI nodes in
- // the block to reflect this.
- //
- for (Function::iterator I = Func->begin(), E = Func->end(); I != E; ++I)
- if (AliveBlocks.count(I)) {
- BasicBlock *BB = I;
- TerminatorInst *TI = BB->getTerminator();
-
- // If the terminator instruction is alive, but the block it is contained
- // in IS alive, this means that this terminator is a conditional branch on
- // a condition that doesn't matter. Make it an unconditional branch to
- // ONE of the successors. This has the side effect of dropping a use of
- // the conditional value, which may also be dead.
- if (!LiveSet.count(TI))
- TI = convertToUnconditionalBranch(TI);
-
- // Loop over all of the successors, looking for ones that are not alive.
- // We cannot save the number of successors in the terminator instruction
- // here because we may remove them if we don't have a postdominator.
- //
- for (unsigned i = 0; i != TI->getNumSuccessors(); ++i)
- if (!AliveBlocks.count(TI->getSuccessor(i))) {
- // Scan up the postdominator tree, looking for the first
- // postdominator that is alive, and the last postdominator that is
- // dead...
- //
- DomTreeNode *LastNode = DT[TI->getSuccessor(i)];
- DomTreeNode *NextNode = 0;
-
- if (LastNode) {
- NextNode = LastNode->getIDom();
- while (!AliveBlocks.count(NextNode->getBlock())) {
- LastNode = NextNode;
- NextNode = NextNode->getIDom();
- if (NextNode == 0) {
- LastNode = 0;
- break;
- }
- }
- }
-
- // There is a special case here... if there IS no post-dominator for
- // the block we have nowhere to point our branch to. Instead, convert
- // it to a return. This can only happen if the code branched into an
- // infinite loop. Note that this may not be desirable, because we
- // _are_ altering the behavior of the code. This is a well known
- // drawback of ADCE, so in the future if we choose to revisit the
- // decision, this is where it should be.
- //
- if (LastNode == 0) { // No postdominator!
- if (!isa<InvokeInst>(TI)) {
- // Call RemoveSuccessor to transmogrify the terminator instruction
- // to not contain the outgoing branch, or to create a new
- // terminator if the form fundamentally changes (i.e.,
- // unconditional branch to return). Note that this will change a
- // branch into an infinite loop into a return instruction!
- //
- RemoveSuccessor(TI, i);
-
- // RemoveSuccessor may replace TI... make sure we have a fresh
- // pointer.
- //
- TI = BB->getTerminator();
-
- // Rescan this successor...
- --i;
- } else {
-
- }
- } else {
- // Get the basic blocks that we need...
- BasicBlock *LastDead = LastNode->getBlock();
- BasicBlock *NextAlive = NextNode->getBlock();
-
- // Make the conditional branch now go to the next alive block...
- TI->getSuccessor(i)->removePredecessor(BB);
- TI->setSuccessor(i, NextAlive);
-
- // If there are PHI nodes in NextAlive, we need to add entries to
- // the PHI nodes for the new incoming edge. The incoming values
- // should be identical to the incoming values for LastDead.
- //
- for (BasicBlock::iterator II = NextAlive->begin();
- isa<PHINode>(II); ++II) {
- PHINode *PN = cast<PHINode>(II);
- if (LiveSet.count(PN)) { // Only modify live phi nodes
- // Get the incoming value for LastDead...
- int OldIdx = PN->getBasicBlockIndex(LastDead);
- assert(OldIdx != -1 &&"LastDead is not a pred of NextAlive!");
- Value *InVal = PN->getIncomingValue(OldIdx);
-
- // Add an incoming value for BB now...
- PN->addIncoming(InVal, BB);
- }
- }
- }
- }
-
- // Now loop over all of the instructions in the basic block, deleting
- // dead instructions. This is so that the next sweep over the program
- // can safely delete dead instructions without other dead instructions
- // still referring to them.
- //
- deleteDeadInstructionsInLiveBlock(BB);
- }
-
- // Loop over all of the basic blocks in the function, dropping references of
- // the dead basic blocks. We must do this after the previous step to avoid
- // dropping references to PHIs which still have entries...
- //
- std::vector<BasicBlock*> DeadBlocks;
- for (Function::iterator BB = Func->begin(), E = Func->end(); BB != E; ++BB)
- if (!AliveBlocks.count(BB)) {
- // Remove PHI node entries for this block in live successor blocks.
- for (succ_iterator SI = succ_begin(BB), E = succ_end(BB); SI != E; ++SI)
- if (!SI->empty() && isa<PHINode>(SI->front()) && AliveBlocks.count(*SI))
- (*SI)->removePredecessor(BB);
-
- BB->dropAllReferences();
- MadeChanges = true;
- DeadBlocks.push_back(BB);
- }
-
- NumBlockRemoved += DeadBlocks.size();
-
- // Now loop through all of the blocks and delete the dead ones. We can safely
- // do this now because we know that there are no references to dead blocks
- // (because they have dropped all of their references).
- for (std::vector<BasicBlock*>::iterator I = DeadBlocks.begin(),
- E = DeadBlocks.end(); I != E; ++I)
- Func->getBasicBlockList().erase(*I);
-
- return MadeChanges;
-}
diff --git a/release_23/lib/Transforms/Scalar/BasicBlockPlacement.cpp b/release_23/lib/Transforms/Scalar/BasicBlockPlacement.cpp
deleted file mode 100644
index 9bde74903575..000000000000
--- a/release_23/lib/Transforms/Scalar/BasicBlockPlacement.cpp
+++ /dev/null
@@ -1,148 +0,0 @@
-//===-- BasicBlockPlacement.cpp - Basic Block Code Layout optimization ----===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements a very simple profile guided basic block placement
-// algorithm. The idea is to put frequently executed blocks together at the
-// start of the function, and hopefully increase the number of fall-through
-// conditional branches. If there is no profile information for a particular
-// function, this pass basically orders blocks in depth-first order
-//
-// The algorithm implemented here is basically "Algo1" from "Profile Guided Code
-// Positioning" by Pettis and Hansen, except that it uses basic block counts
-// instead of edge counts. This should be improved in many ways, but is very
-// simple for now.
-//
-// Basically we "place" the entry block, then loop over all successors in a DFO,
-// placing the most frequently executed successor until we run out of blocks. I
-// told you this was _extremely_ simplistic. :) This is also much slower than it
-// could be. When it becomes important, this pass will be rewritten to use a
-// better algorithm, and then we can worry about efficiency.
-//
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "block-placement"
-#include "llvm/Analysis/ProfileInfo.h"
-#include "llvm/Function.h"
-#include "llvm/Pass.h"
-#include "llvm/Support/CFG.h"
-#include "llvm/Support/Compiler.h"
-#include "llvm/ADT/Statistic.h"
-#include "llvm/Transforms/Scalar.h"
-#include <set>
-using namespace llvm;
-
-STATISTIC(NumMoved, "Number of basic blocks moved");
-
-namespace {
- struct VISIBILITY_HIDDEN BlockPlacement : public FunctionPass {
- static char ID; // Pass identification, replacement for typeid
- BlockPlacement() : FunctionPass((intptr_t)&ID) {}
-
- virtual bool runOnFunction(Function &F);
-
- virtual void getAnalysisUsage(AnalysisUsage &AU) const {
- AU.setPreservesCFG();
- AU.addRequired<ProfileInfo>();
- //AU.addPreserved<ProfileInfo>(); // Does this work?
- }
- private:
- /// PI - The profile information that is guiding us.
- ///
- ProfileInfo *PI;
-
- /// NumMovedBlocks - Every time we move a block, increment this counter.
- ///
- unsigned NumMovedBlocks;
-
- /// PlacedBlocks - Every time we place a block, remember it so we don't get
- /// into infinite loops.
- std::set<BasicBlock*> PlacedBlocks;
-
- /// InsertPos - This an iterator to the next place we want to insert a
- /// block.
- Function::iterator InsertPos;
-
- /// PlaceBlocks - Recursively place the specified blocks and any unplaced
- /// successors.
- void PlaceBlocks(BasicBlock *BB);
- };
-
- char BlockPlacement::ID = 0;
- RegisterPass<BlockPlacement> X("block-placement",
- "Profile Guided Basic Block Placement");
-}
-
-FunctionPass *llvm::createBlockPlacementPass() { return new BlockPlacement(); }
-
-bool BlockPlacement::runOnFunction(Function &F) {
- PI = &getAnalysis<ProfileInfo>();
-
- NumMovedBlocks = 0;
- InsertPos = F.begin();
-
- // Recursively place all blocks.
- PlaceBlocks(F.begin());
-
- PlacedBlocks.clear();
- NumMoved += NumMovedBlocks;
- return NumMovedBlocks != 0;
-}
-
-
-/// PlaceBlocks - Recursively place the specified blocks and any unplaced
-/// successors.
-void BlockPlacement::PlaceBlocks(BasicBlock *BB) {
- assert(!PlacedBlocks.count(BB) && "Already placed this block!");
- PlacedBlocks.insert(BB);
-
- // Place the specified block.
- if (&*InsertPos != BB) {
- // Use splice to move the block into the right place. This avoids having to
- // remove the block from the function then readd it, which causes a bunch of
- // symbol table traffic that is entirely pointless.
- Function::BasicBlockListType &Blocks = BB->getParent()->getBasicBlockList();
- Blocks.splice(InsertPos, Blocks, BB);
-
- ++NumMovedBlocks;
- } else {
- // This block is already in the right place, we don't have to do anything.
- ++InsertPos;
- }
-
- // Keep placing successors until we run out of ones to place. Note that this
- // loop is very inefficient (N^2) for blocks with many successors, like switch
- // statements. FIXME!
- while (1) {
- // Okay, now place any unplaced successors.
- succ_iterator SI = succ_begin(BB), E = succ_end(BB);
-
- // Scan for the first unplaced successor.
- for (; SI != E && PlacedBlocks.count(*SI); ++SI)
- /*empty*/;
- if (SI == E) return; // No more successors to place.
-
- unsigned MaxExecutionCount = PI->getExecutionCount(*SI);
- BasicBlock *MaxSuccessor = *SI;
-
- // Scan for more frequently executed successors
- for (; SI != E; ++SI)
- if (!PlacedBlocks.count(*SI)) {
- unsigned Count = PI->getExecutionCount(*SI);
- if (Count > MaxExecutionCount ||
- // Prefer to not disturb the code.
- (Count == MaxExecutionCount && *SI == &*InsertPos)) {
- MaxExecutionCount = Count;
- MaxSuccessor = *SI;
- }
- }
-
- // Now that we picked the maximally executed successor, place it.
- PlaceBlocks(MaxSuccessor);
- }
-}
diff --git a/release_23/lib/Transforms/Scalar/CodeGenPrepare.cpp b/release_23/lib/Transforms/Scalar/CodeGenPrepare.cpp
deleted file mode 100644
index bc19114fa2d5..000000000000
--- a/release_23/lib/Transforms/Scalar/CodeGenPrepare.cpp
+++ /dev/null
@@ -1,1135 +0,0 @@
-//===- CodeGenPrepare.cpp - Prepare a function for code generation --------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This pass munges the code in the input function to better prepare it for
-// SelectionDAG-based code generation. This works around limitations in it's
-// basic-block-at-a-time approach. It should eventually be removed.
-//
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "codegenprepare"
-#include "llvm/Transforms/Scalar.h"
-#include "llvm/Constants.h"
-#include "llvm/DerivedTypes.h"
-#include "llvm/Function.h"
-#include "llvm/InlineAsm.h"
-#include "llvm/Instructions.h"
-#include "llvm/Pass.h"
-#include "llvm/Target/TargetAsmInfo.h"
-#include "llvm/Target/TargetData.h"
-#include "llvm/Target/TargetLowering.h"
-#include "llvm/Target/TargetMachine.h"
-#include "llvm/Transforms/Utils/BasicBlockUtils.h"
-#include "llvm/Transforms/Utils/Local.h"
-#include "llvm/ADT/DenseMap.h"
-#include "llvm/ADT/SmallSet.h"
-#include "llvm/Support/CallSite.h"
-#include "llvm/Support/Compiler.h"
-#include "llvm/Support/Debug.h"
-#include "llvm/Support/GetElementPtrTypeIterator.h"
-using namespace llvm;
-
-namespace {
- class VISIBILITY_HIDDEN CodeGenPrepare : public FunctionPass {
- /// TLI - Keep a pointer of a TargetLowering to consult for determining
- /// transformation profitability.
- const TargetLowering *TLI;
- public:
- static char ID; // Pass identification, replacement for typeid
- explicit CodeGenPrepare(const TargetLowering *tli = 0)
- : FunctionPass((intptr_t)&ID), TLI(tli) {}
- bool runOnFunction(Function &F);
-
- private:
- bool EliminateMostlyEmptyBlocks(Function &F);
- bool CanMergeBlocks(const BasicBlock *BB, const BasicBlock *DestBB) const;
- void EliminateMostlyEmptyBlock(BasicBlock *BB);
- bool OptimizeBlock(BasicBlock &BB);
- bool OptimizeLoadStoreInst(Instruction *I, Value *Addr,
- const Type *AccessTy,
- DenseMap<Value*,Value*> &SunkAddrs);
- bool OptimizeInlineAsmInst(Instruction *I, CallSite CS,
- DenseMap<Value*,Value*> &SunkAddrs);
- bool OptimizeExtUses(Instruction *I);
- };
-}
-
-char CodeGenPrepare::ID = 0;
-static RegisterPass<CodeGenPrepare> X("codegenprepare",
- "Optimize for code generation");
-
-FunctionPass *llvm::createCodeGenPreparePass(const TargetLowering *TLI) {
- return new CodeGenPrepare(TLI);
-}
-
-
-bool CodeGenPrepare::runOnFunction(Function &F) {
- bool EverMadeChange = false;
-
- // First pass, eliminate blocks that contain only PHI nodes and an
- // unconditional branch.
- EverMadeChange |= EliminateMostlyEmptyBlocks(F);
-
- bool MadeChange = true;
- while (MadeChange) {
- MadeChange = false;
- for (Function::iterator BB = F.begin(), E = F.end(); BB != E; ++BB)
- MadeChange |= OptimizeBlock(*BB);
- EverMadeChange |= MadeChange;
- }
- return EverMadeChange;
-}
-
-/// EliminateMostlyEmptyBlocks - eliminate blocks that contain only PHI nodes
-/// and an unconditional branch. Passes before isel (e.g. LSR/loopsimplify)
-/// often split edges in ways that are non-optimal for isel. Start by
-/// eliminating these blocks so we can split them the way we want them.
-bool CodeGenPrepare::EliminateMostlyEmptyBlocks(Function &F) {
- bool MadeChange = false;
- // Note that this intentionally skips the entry block.
- for (Function::iterator I = ++F.begin(), E = F.end(); I != E; ) {
- BasicBlock *BB = I++;
-
- // If this block doesn't end with an uncond branch, ignore it.
- BranchInst *BI = dyn_cast<BranchInst>(BB->getTerminator());
- if (!BI || !BI->isUnconditional())
- continue;
-
- // If the instruction before the branch isn't a phi node, then other stuff
- // is happening here.
- BasicBlock::iterator BBI = BI;
- if (BBI != BB->begin()) {
- --BBI;
- if (!isa<PHINode>(BBI)) continue;
- }
-
- // Do not break infinite loops.
- BasicBlock *DestBB = BI->getSuccessor(0);
- if (DestBB == BB)
- continue;
-
- if (!CanMergeBlocks(BB, DestBB))
- continue;
-
- EliminateMostlyEmptyBlock(BB);
- MadeChange = true;
- }
- return MadeChange;
-}
-
-/// CanMergeBlocks - Return true if we can merge BB into DestBB if there is a
-/// single uncond branch between them, and BB contains no other non-phi
-/// instructions.
-bool CodeGenPrepare::CanMergeBlocks(const BasicBlock *BB,
- const BasicBlock *DestBB) const {
- // We only want to eliminate blocks whose phi nodes are used by phi nodes in
- // the successor. If there are more complex condition (e.g. preheaders),
- // don't mess around with them.
- BasicBlock::const_iterator BBI = BB->begin();
- while (const PHINode *PN = dyn_cast<PHINode>(BBI++)) {
- for (Value::use_const_iterator UI = PN->use_begin(), E = PN->use_end();
- UI != E; ++UI) {
- const Instruction *User = cast<Instruction>(*UI);
- if (User->getParent() != DestBB || !isa<PHINode>(User))
- return false;
- // If User is inside DestBB block and it is a PHINode then check
- // incoming value. If incoming value is not from BB then this is
- // a complex condition (e.g. preheaders) we want to avoid here.
- if (User->getParent() == DestBB) {
- if (const PHINode *UPN = dyn_cast<PHINode>(User))
- for (unsigned I = 0, E = UPN->getNumIncomingValues(); I != E; ++I) {
- Instruction *Insn = dyn_cast<Instruction>(UPN->getIncomingValue(I));
- if (Insn && Insn->getParent() == BB &&
- Insn->getParent() != UPN->getIncomingBlock(I))
- return false;
- }
- }
- }
- }
-
- // If BB and DestBB contain any common predecessors, then the phi nodes in BB
- // and DestBB may have conflicting incoming values for the block. If so, we
- // can't merge the block.
- const PHINode *DestBBPN = dyn_cast<PHINode>(DestBB->begin());
- if (!DestBBPN) return true; // no conflict.
-
- // Collect the preds of BB.
- SmallPtrSet<const BasicBlock*, 16> BBPreds;
- if (const PHINode *BBPN = dyn_cast<PHINode>(BB->begin())) {
- // It is faster to get preds from a PHI than with pred_iterator.
- for (unsigned i = 0, e = BBPN->getNumIncomingValues(); i != e; ++i)
- BBPreds.insert(BBPN->getIncomingBlock(i));
- } else {
- BBPreds.insert(pred_begin(BB), pred_end(BB));
- }
-
- // Walk the preds of DestBB.
- for (unsigned i = 0, e = DestBBPN->getNumIncomingValues(); i != e; ++i) {
- BasicBlock *Pred = DestBBPN->getIncomingBlock(i);
- if (BBPreds.count(Pred)) { // Common predecessor?
- BBI = DestBB->begin();
- while (const PHINode *PN = dyn_cast<PHINode>(BBI++)) {
- const Value *V1 = PN->getIncomingValueForBlock(Pred);
- const Value *V2 = PN->getIncomingValueForBlock(BB);
-
- // If V2 is a phi node in BB, look up what the mapped value will be.
- if (const PHINode *V2PN = dyn_cast<PHINode>(V2))
- if (V2PN->getParent() == BB)
- V2 = V2PN->getIncomingValueForBlock(Pred);
-
- // If there is a conflict, bail out.
- if (V1 != V2) return false;
- }
- }
- }
-
- return true;
-}
-
-
-/// EliminateMostlyEmptyBlock - Eliminate a basic block that have only phi's and
-/// an unconditional branch in it.
-void CodeGenPrepare::EliminateMostlyEmptyBlock(BasicBlock *BB) {
- BranchInst *BI = cast<BranchInst>(BB->getTerminator());
- BasicBlock *DestBB = BI->getSuccessor(0);
-
- DOUT << "MERGING MOSTLY EMPTY BLOCKS - BEFORE:\n" << *BB << *DestBB;
-
- // If the destination block has a single pred, then this is a trivial edge,
- // just collapse it.
- if (DestBB->getSinglePredecessor()) {
- // If DestBB has single-entry PHI nodes, fold them.
- while (PHINode *PN = dyn_cast<PHINode>(DestBB->begin())) {
- PN->replaceAllUsesWith(PN->getIncomingValue(0));
- PN->eraseFromParent();
- }
-
- // Splice all the PHI nodes from BB over to DestBB.
- DestBB->getInstList().splice(DestBB->begin(), BB->getInstList(),
- BB->begin(), BI);
-
- // Anything that branched to BB now branches to DestBB.
- BB->replaceAllUsesWith(DestBB);
-
- // Nuke BB.
- BB->eraseFromParent();
-
- DOUT << "AFTER:\n" << *DestBB << "\n\n\n";
- return;
- }
-
- // Otherwise, we have multiple predecessors of BB. Update the PHIs in DestBB
- // to handle the new incoming edges it is about to have.
- PHINode *PN;
- for (BasicBlock::iterator BBI = DestBB->begin();
- (PN = dyn_cast<PHINode>(BBI)); ++BBI) {
- // Remove the incoming value for BB, and remember it.
- Value *InVal = PN->removeIncomingValue(BB, false);
-
- // Two options: either the InVal is a phi node defined in BB or it is some
- // value that dominates BB.
- PHINode *InValPhi = dyn_cast<PHINode>(InVal);
- if (InValPhi && InValPhi->getParent() == BB) {
- // Add all of the input values of the input PHI as inputs of this phi.
- for (unsigned i = 0, e = InValPhi->getNumIncomingValues(); i != e; ++i)
- PN->addIncoming(InValPhi->getIncomingValue(i),
- InValPhi->getIncomingBlock(i));
- } else {
- // Otherwise, add one instance of the dominating value for each edge that
- // we will be adding.
- if (PHINode *BBPN = dyn_cast<PHINode>(BB->begin())) {
- for (unsigned i = 0, e = BBPN->getNumIncomingValues(); i != e; ++i)
- PN->addIncoming(InVal, BBPN->getIncomingBlock(i));
- } else {
- for (pred_iterator PI = pred_begin(BB), E = pred_end(BB); PI != E; ++PI)
- PN->addIncoming(InVal, *PI);
- }
- }
- }
-
- // The PHIs are now updated, change everything that refers to BB to use
- // DestBB and remove BB.
- BB->replaceAllUsesWith(DestBB);
- BB->eraseFromParent();
-
- DOUT << "AFTER:\n" << *DestBB << "\n\n\n";
-}
-
-
-/// SplitEdgeNicely - Split the critical edge from TI to its specified
-/// successor if it will improve codegen. We only do this if the successor has
-/// phi nodes (otherwise critical edges are ok). If there is already another
-/// predecessor of the succ that is empty (and thus has no phi nodes), use it
-/// instead of introducing a new block.
-static void SplitEdgeNicely(TerminatorInst *TI, unsigned SuccNum, Pass *P) {
- BasicBlock *TIBB = TI->getParent();
- BasicBlock *Dest = TI->getSuccessor(SuccNum);
- assert(isa<PHINode>(Dest->begin()) &&
- "This should only be called if Dest has a PHI!");
-
- // As a hack, never split backedges of loops. Even though the copy for any
- // PHIs inserted on the backedge would be dead for exits from the loop, we
- // assume that the cost of *splitting* the backedge would be too high.
- if (Dest == TIBB)
- return;
-
- /// TIPHIValues - This array is lazily computed to determine the values of
- /// PHIs in Dest that TI would provide.
- SmallVector<Value*, 32> TIPHIValues;
-
- // Check to see if Dest has any blocks that can be used as a split edge for
- // this terminator.
- for (pred_iterator PI = pred_begin(Dest), E = pred_end(Dest); PI != E; ++PI) {
- BasicBlock *Pred = *PI;
- // To be usable, the pred has to end with an uncond branch to the dest.
- BranchInst *PredBr = dyn_cast<BranchInst>(Pred->getTerminator());
- if (!PredBr || !PredBr->isUnconditional() ||
- // Must be empty other than the branch.
- &Pred->front() != PredBr ||
- // Cannot be the entry block; its label does not get emitted.
- Pred == &(Dest->getParent()->getEntryBlock()))
- continue;
-
- // Finally, since we know that Dest has phi nodes in it, we have to make
- // sure that jumping to Pred will have the same affect as going to Dest in
- // terms of PHI values.
- PHINode *PN;
- unsigned PHINo = 0;
- bool FoundMatch = true;
- for (BasicBlock::iterator I = Dest->begin();
- (PN = dyn_cast<PHINode>(I)); ++I, ++PHINo) {
- if (PHINo == TIPHIValues.size())
- TIPHIValues.push_back(PN->getIncomingValueForBlock(TIBB));
-
- // If the PHI entry doesn't work, we can't use this pred.
- if (TIPHIValues[PHINo] != PN->getIncomingValueForBlock(Pred)) {
- FoundMatch = false;
- break;
- }
- }
-
- // If we found a workable predecessor, change TI to branch to Succ.
- if (FoundMatch) {
- Dest->removePredecessor(TIBB);
- TI->setSuccessor(SuccNum, Pred);
- return;
- }
- }
-
- SplitCriticalEdge(TI, SuccNum, P, true);
-}
-
-/// OptimizeNoopCopyExpression - If the specified cast instruction is a noop
-/// copy (e.g. it's casting from one pointer type to another, int->uint, or
-/// int->sbyte on PPC), sink it into user blocks to reduce the number of virtual
-/// registers that must be created and coalesced.
-///
-/// Return true if any changes are made.
-static bool OptimizeNoopCopyExpression(CastInst *CI, const TargetLowering &TLI){
- // If this is a noop copy,
- MVT::ValueType SrcVT = TLI.getValueType(CI->getOperand(0)->getType());
- MVT::ValueType DstVT = TLI.getValueType(CI->getType());
-
- // This is an fp<->int conversion?
- if (MVT::isInteger(SrcVT) != MVT::isInteger(DstVT))
- return false;
-
- // If this is an extension, it will be a zero or sign extension, which
- // isn't a noop.
- if (SrcVT < DstVT) return false;
-
- // If these values will be promoted, find out what they will be promoted
- // to. This helps us consider truncates on PPC as noop copies when they
- // are.
- if (TLI.getTypeAction(SrcVT) == TargetLowering::Promote)
- SrcVT = TLI.getTypeToTransformTo(SrcVT);
- if (TLI.getTypeAction(DstVT) == TargetLowering::Promote)
- DstVT = TLI.getTypeToTransformTo(DstVT);
-
- // If, after promotion, these are the same types, this is a noop copy.
- if (SrcVT != DstVT)
- return false;
-
- BasicBlock *DefBB = CI->getParent();
-
- /// InsertedCasts - Only insert a cast in each block once.
- DenseMap<BasicBlock*, CastInst*> InsertedCasts;
-
- bool MadeChange = false;
- for (Value::use_iterator UI = CI->use_begin(), E = CI->use_end();
- UI != E; ) {
- Use &TheUse = UI.getUse();
- Instruction *User = cast<Instruction>(*UI);
-
- // Figure out which BB this cast is used in. For PHI's this is the
- // appropriate predecessor block.
- BasicBlock *UserBB = User->getParent();
- if (PHINode *PN = dyn_cast<PHINode>(User)) {
- unsigned OpVal = UI.getOperandNo()/2;
- UserBB = PN->getIncomingBlock(OpVal);
- }
-
- // Preincrement use iterator so we don't invalidate it.
- ++UI;
-
- // If this user is in the same block as the cast, don't change the cast.
- if (UserBB == DefBB) continue;
-
- // If we have already inserted a cast into this block, use it.
- CastInst *&InsertedCast = InsertedCasts[UserBB];
-
- if (!InsertedCast) {
- BasicBlock::iterator InsertPt = UserBB->begin();
- while (isa<PHINode>(InsertPt)) ++InsertPt;
-
- InsertedCast =
- CastInst::create(CI->getOpcode(), CI->getOperand(0), CI->getType(), "",
- InsertPt);
- MadeChange = true;
- }
-
- // Replace a use of the cast with a use of the new cast.
- TheUse = InsertedCast;
- }
-
- // If we removed all uses, nuke the cast.
- if (CI->use_empty()) {
- CI->eraseFromParent();
- MadeChange = true;
- }
-
- return MadeChange;
-}
-
-/// OptimizeCmpExpression - sink the given CmpInst into user blocks to reduce
-/// the number of virtual registers that must be created and coalesced. This is
-/// a clear win except on targets with multiple condition code registers
-/// (PowerPC), where it might lose; some adjustment may be wanted there.
-///
-/// Return true if any changes are made.
-static bool OptimizeCmpExpression(CmpInst *CI){
-
- BasicBlock *DefBB = CI->getParent();
-
- /// InsertedCmp - Only insert a cmp in each block once.
- DenseMap<BasicBlock*, CmpInst*> InsertedCmps;
-
- bool MadeChange = false;
- for (Value::use_iterator UI = CI->use_begin(), E = CI->use_end();
- UI != E; ) {
- Use &TheUse = UI.getUse();
- Instruction *User = cast<Instruction>(*UI);
-
- // Preincrement use iterator so we don't invalidate it.
- ++UI;
-
- // Don't bother for PHI nodes.
- if (isa<PHINode>(User))
- continue;
-
- // Figure out which BB this cmp is used in.
- BasicBlock *UserBB = User->getParent();
-
- // If this user is in the same block as the cmp, don't change the cmp.
- if (UserBB == DefBB) continue;
-
- // If we have already inserted a cmp into this block, use it.
- CmpInst *&InsertedCmp = InsertedCmps[UserBB];
-
- if (!InsertedCmp) {
- BasicBlock::iterator InsertPt = UserBB->begin();
- while (isa<PHINode>(InsertPt)) ++InsertPt;
-
- InsertedCmp =
- CmpInst::create(CI->getOpcode(), CI->getPredicate(), CI->getOperand(0),
- CI->getOperand(1), "", InsertPt);
- MadeChange = true;
- }
-
- // Replace a use of the cmp with a use of the new cmp.
- TheUse = InsertedCmp;
- }
-
- // If we removed all uses, nuke the cmp.
- if (CI->use_empty())
- CI->eraseFromParent();
-
- return MadeChange;
-}
-
-/// EraseDeadInstructions - Erase any dead instructions
-static void EraseDeadInstructions(Value *V) {
- Instruction *I = dyn_cast<Instruction>(V);
- if (!I || !I->use_empty()) return;
-
- SmallPtrSet<Instruction*, 16> Insts;
- Insts.insert(I);
-
- while (!Insts.empty()) {
- I = *Insts.begin();
- Insts.erase(I);
- if (isInstructionTriviallyDead(I)) {
- for (unsigned i = 0, e = I->getNumOperands(); i != e; ++i)
- if (Instruction *U = dyn_cast<Instruction>(I->getOperand(i)))
- Insts.insert(U);
- I->eraseFromParent();
- }
- }
-}
-
-
-/// ExtAddrMode - This is an extended version of TargetLowering::AddrMode which
-/// holds actual Value*'s for register values.
-struct ExtAddrMode : public TargetLowering::AddrMode {
- Value *BaseReg;
- Value *ScaledReg;
- ExtAddrMode() : BaseReg(0), ScaledReg(0) {}
- void dump() const;
-};
-
-static std::ostream &operator<<(std::ostream &OS, const ExtAddrMode &AM) {
- bool NeedPlus = false;
- OS << "[";
- if (AM.BaseGV)
- OS << (NeedPlus ? " + " : "")
- << "GV:%" << AM.BaseGV->getName(), NeedPlus = true;
-
- if (AM.BaseOffs)
- OS << (NeedPlus ? " + " : "") << AM.BaseOffs, NeedPlus = true;
-
- if (AM.BaseReg)
- OS << (NeedPlus ? " + " : "")
- << "Base:%" << AM.BaseReg->getName(), NeedPlus = true;
- if (AM.Scale)
- OS << (NeedPlus ? " + " : "")
- << AM.Scale << "*%" << AM.ScaledReg->getName(), NeedPlus = true;
-
- return OS << "]";
-}
-
-void ExtAddrMode::dump() const {
- cerr << *this << "\n";
-}
-
-static bool TryMatchingScaledValue(Value *ScaleReg, int64_t Scale,
- const Type *AccessTy, ExtAddrMode &AddrMode,
- SmallVector<Instruction*, 16> &AddrModeInsts,
- const TargetLowering &TLI, unsigned Depth);
-
-/// FindMaximalLegalAddressingMode - If we can, try to merge the computation of
-/// Addr into the specified addressing mode. If Addr can't be added to AddrMode
-/// this returns false. This assumes that Addr is either a pointer type or
-/// intptr_t for the target.
-static bool FindMaximalLegalAddressingMode(Value *Addr, const Type *AccessTy,
- ExtAddrMode &AddrMode,
- SmallVector<Instruction*, 16> &AddrModeInsts,
- const TargetLowering &TLI,
- unsigned Depth) {
-
- // If this is a global variable, fold it into the addressing mode if possible.
- if (GlobalValue *GV = dyn_cast<GlobalValue>(Addr)) {
- if (AddrMode.BaseGV == 0) {
- AddrMode.BaseGV = GV;
- if (TLI.isLegalAddressingMode(AddrMode, AccessTy))
- return true;
- AddrMode.BaseGV = 0;
- }
- } else if (ConstantInt *CI = dyn_cast<ConstantInt>(Addr)) {
- AddrMode.BaseOffs += CI->getSExtValue();
- if (TLI.isLegalAddressingMode(AddrMode, AccessTy))
- return true;
- AddrMode.BaseOffs -= CI->getSExtValue();
- } else if (isa<ConstantPointerNull>(Addr)) {
- return true;
- }
-
- // Look through constant exprs and instructions.
- unsigned Opcode = ~0U;
- User *AddrInst = 0;
- if (Instruction *I = dyn_cast<Instruction>(Addr)) {
- Opcode = I->getOpcode();
- AddrInst = I;
- } else if (ConstantExpr *CE = dyn_cast<ConstantExpr>(Addr)) {
- Opcode = CE->getOpcode();
- AddrInst = CE;
- }
-
- // Limit recursion to avoid exponential behavior.
- if (Depth == 5) { AddrInst = 0; Opcode = ~0U; }
-
- // If this is really an instruction, add it to our list of related
- // instructions.
- if (Instruction *I = dyn_cast_or_null<Instruction>(AddrInst))
- AddrModeInsts.push_back(I);
-
- switch (Opcode) {
- case Instruction::PtrToInt:
- // PtrToInt is always a noop, as we know that the int type is pointer sized.
- if (FindMaximalLegalAddressingMode(AddrInst->getOperand(0), AccessTy,
- AddrMode, AddrModeInsts, TLI, Depth))
- return true;
- break;
- case Instruction::IntToPtr:
- // This inttoptr is a no-op if the integer type is pointer sized.
- if (TLI.getValueType(AddrInst->getOperand(0)->getType()) ==
- TLI.getPointerTy()) {
- if (FindMaximalLegalAddressingMode(AddrInst->getOperand(0), AccessTy,
- AddrMode, AddrModeInsts, TLI, Depth))
- return true;
- }
- break;
- case Instruction::Add: {
- // Check to see if we can merge in the RHS then the LHS. If so, we win.
- ExtAddrMode BackupAddrMode = AddrMode;
- unsigned OldSize = AddrModeInsts.size();
- if (FindMaximalLegalAddressingMode(AddrInst->getOperand(1), AccessTy,
- AddrMode, AddrModeInsts, TLI, Depth+1) &&
- FindMaximalLegalAddressingMode(AddrInst->getOperand(0), AccessTy,
- AddrMode, AddrModeInsts, TLI, Depth+1))
- return true;
-
- // Restore the old addr mode info.
- AddrMode = BackupAddrMode;
- AddrModeInsts.resize(OldSize);
-
- // Otherwise this was over-aggressive. Try merging in the LHS then the RHS.
- if (FindMaximalLegalAddressingMode(AddrInst->getOperand(0), AccessTy,
- AddrMode, AddrModeInsts, TLI, Depth+1) &&
- FindMaximalLegalAddressingMode(AddrInst->getOperand(1), AccessTy,
- AddrMode, AddrModeInsts, TLI, Depth+1))
- return true;
-
- // Otherwise we definitely can't merge the ADD in.
- AddrMode = BackupAddrMode;
- AddrModeInsts.resize(OldSize);
- break;
- }
- case Instruction::Or: {
- ConstantInt *RHS = dyn_cast<ConstantInt>(AddrInst->getOperand(1));
- if (!RHS) break;
- // TODO: We can handle "Or Val, Imm" iff this OR is equivalent to an ADD.
- break;
- }
- case Instruction::Mul:
- case Instruction::Shl: {
- // Can only handle X*C and X << C, and can only handle this when the scale
- // field is available.
- ConstantInt *RHS = dyn_cast<ConstantInt>(AddrInst->getOperand(1));
- if (!RHS) break;
- int64_t Scale = RHS->getSExtValue();
- if (Opcode == Instruction::Shl)
- Scale = 1 << Scale;
-
- if (TryMatchingScaledValue(AddrInst->getOperand(0), Scale, AccessTy,
- AddrMode, AddrModeInsts, TLI, Depth))
- return true;
- break;
- }
- case Instruction::GetElementPtr: {
- // Scan the GEP. We check it if it contains constant offsets and at most
- // one variable offset.
- int VariableOperand = -1;
- unsigned VariableScale = 0;
-
- int64_t ConstantOffset = 0;
- const TargetData *TD = TLI.getTargetData();
- gep_type_iterator GTI = gep_type_begin(AddrInst);
- for (unsigned i = 1, e = AddrInst->getNumOperands(); i != e; ++i, ++GTI) {
- if (const StructType *STy = dyn_cast<StructType>(*GTI)) {
- const StructLayout *SL = TD->getStructLayout(STy);
- unsigned Idx =
- cast<ConstantInt>(AddrInst->getOperand(i))->getZExtValue();
- ConstantOffset += SL->getElementOffset(Idx);
- } else {
- uint64_t TypeSize = TD->getABITypeSize(GTI.getIndexedType());
- if (ConstantInt *CI = dyn_cast<ConstantInt>(AddrInst->getOperand(i))) {
- ConstantOffset += CI->getSExtValue()*TypeSize;
- } else if (TypeSize) { // Scales of zero don't do anything.
- // We only allow one variable index at the moment.
- if (VariableOperand != -1) {
- VariableOperand = -2;
- break;
- }
-
- // Remember the variable index.
- VariableOperand = i;
- VariableScale = TypeSize;
- }
- }
- }
-
- // If the GEP had multiple variable indices, punt.
- if (VariableOperand == -2)
- break;
-
- // A common case is for the GEP to only do a constant offset. In this case,
- // just add it to the disp field and check validity.
- if (VariableOperand == -1) {
- AddrMode.BaseOffs += ConstantOffset;
- if (ConstantOffset == 0 || TLI.isLegalAddressingMode(AddrMode, AccessTy)){
- // Check to see if we can fold the base pointer in too.
- if (FindMaximalLegalAddressingMode(AddrInst->getOperand(0), AccessTy,
- AddrMode, AddrModeInsts, TLI,
- Depth+1))
- return true;
- }
- AddrMode.BaseOffs -= ConstantOffset;
- } else {
- // Check that this has no base reg yet. If so, we won't have a place to
- // put the base of the GEP (assuming it is not a null ptr).
- bool SetBaseReg = false;
- if (AddrMode.HasBaseReg) {
- if (!isa<ConstantPointerNull>(AddrInst->getOperand(0)))
- break;
- } else {
- AddrMode.HasBaseReg = true;
- AddrMode.BaseReg = AddrInst->getOperand(0);
- SetBaseReg = true;
- }
-
- // See if the scale amount is valid for this target.
- AddrMode.BaseOffs += ConstantOffset;
- if (TryMatchingScaledValue(AddrInst->getOperand(VariableOperand),
- VariableScale, AccessTy, AddrMode,
- AddrModeInsts, TLI, Depth)) {
- if (!SetBaseReg) return true;
-
- // If this match succeeded, we know that we can form an address with the
- // GepBase as the basereg. See if we can match *more*.
- AddrMode.HasBaseReg = false;
- AddrMode.BaseReg = 0;
- if (FindMaximalLegalAddressingMode(AddrInst->getOperand(0), AccessTy,
- AddrMode, AddrModeInsts, TLI,
- Depth+1))
- return true;
- // Strange, shouldn't happen. Restore the base reg and succeed the easy
- // way.
- AddrMode.HasBaseReg = true;
- AddrMode.BaseReg = AddrInst->getOperand(0);
- return true;
- }
-
- AddrMode.BaseOffs -= ConstantOffset;
- if (SetBaseReg) {
- AddrMode.HasBaseReg = false;
- AddrMode.BaseReg = 0;
- }
- }
- break;
- }
- }
-
- if (Instruction *I = dyn_cast_or_null<Instruction>(AddrInst)) {
- assert(AddrModeInsts.back() == I && "Stack imbalance"); I = I;
- AddrModeInsts.pop_back();
- }
-
- // Worse case, the target should support [reg] addressing modes. :)
- if (!AddrMode.HasBaseReg) {
- AddrMode.HasBaseReg = true;
- // Still check for legality in case the target supports [imm] but not [i+r].
- if (TLI.isLegalAddressingMode(AddrMode, AccessTy)) {
- AddrMode.BaseReg = Addr;
- return true;
- }
- AddrMode.HasBaseReg = false;
- }
-
- // If the base register is already taken, see if we can do [r+r].
- if (AddrMode.Scale == 0) {
- AddrMode.Scale = 1;
- if (TLI.isLegalAddressingMode(AddrMode, AccessTy)) {
- AddrMode.ScaledReg = Addr;
- return true;
- }
- AddrMode.Scale = 0;
- }
- // Couldn't match.
- return false;
-}
-
-/// TryMatchingScaledValue - Try adding ScaleReg*Scale to the specified
-/// addressing mode. Return true if this addr mode is legal for the target,
-/// false if not.
-static bool TryMatchingScaledValue(Value *ScaleReg, int64_t Scale,
- const Type *AccessTy, ExtAddrMode &AddrMode,
- SmallVector<Instruction*, 16> &AddrModeInsts,
- const TargetLowering &TLI, unsigned Depth) {
- // If we already have a scale of this value, we can add to it, otherwise, we
- // need an available scale field.
- if (AddrMode.Scale != 0 && AddrMode.ScaledReg != ScaleReg)
- return false;
-
- ExtAddrMode InputAddrMode = AddrMode;
-
- // Add scale to turn X*4+X*3 -> X*7. This could also do things like
- // [A+B + A*7] -> [B+A*8].
- AddrMode.Scale += Scale;
- AddrMode.ScaledReg = ScaleReg;
-
- if (TLI.isLegalAddressingMode(AddrMode, AccessTy)) {
- // Okay, we decided that we can add ScaleReg+Scale to AddrMode. Check now
- // to see if ScaleReg is actually X+C. If so, we can turn this into adding
- // X*Scale + C*Scale to addr mode.
- BinaryOperator *BinOp = dyn_cast<BinaryOperator>(ScaleReg);
- if (BinOp && BinOp->getOpcode() == Instruction::Add &&
- isa<ConstantInt>(BinOp->getOperand(1)) && InputAddrMode.ScaledReg ==0) {
-
- InputAddrMode.Scale = Scale;
- InputAddrMode.ScaledReg = BinOp->getOperand(0);
- InputAddrMode.BaseOffs +=
- cast<ConstantInt>(BinOp->getOperand(1))->getSExtValue()*Scale;
- if (TLI.isLegalAddressingMode(InputAddrMode, AccessTy)) {
- AddrModeInsts.push_back(BinOp);
- AddrMode = InputAddrMode;
- return true;
- }
- }
-
- // Otherwise, not (x+c)*scale, just return what we have.
- return true;
- }
-
- // Otherwise, back this attempt out.
- AddrMode.Scale -= Scale;
- if (AddrMode.Scale == 0) AddrMode.ScaledReg = 0;
-
- return false;
-}
-
-
-/// IsNonLocalValue - Return true if the specified values are defined in a
-/// different basic block than BB.
-static bool IsNonLocalValue(Value *V, BasicBlock *BB) {
- if (Instruction *I = dyn_cast<Instruction>(V))
- return I->getParent() != BB;
- return false;
-}
-
-/// OptimizeLoadStoreInst - Load and Store Instructions have often have
-/// addressing modes that can do significant amounts of computation. As such,
-/// instruction selection will try to get the load or store to do as much
-/// computation as possible for the program. The problem is that isel can only
-/// see within a single block. As such, we sink as much legal addressing mode
-/// stuff into the block as possible.
-bool CodeGenPrepare::OptimizeLoadStoreInst(Instruction *LdStInst, Value *Addr,
- const Type *AccessTy,
- DenseMap<Value*,Value*> &SunkAddrs) {
- // Figure out what addressing mode will be built up for this operation.
- SmallVector<Instruction*, 16> AddrModeInsts;
- ExtAddrMode AddrMode;
- bool Success = FindMaximalLegalAddressingMode(Addr, AccessTy, AddrMode,
- AddrModeInsts, *TLI, 0);
- Success = Success; assert(Success && "Couldn't select *anything*?");
-
- // Check to see if any of the instructions supersumed by this addr mode are
- // non-local to I's BB.
- bool AnyNonLocal = false;
- for (unsigned i = 0, e = AddrModeInsts.size(); i != e; ++i) {
- if (IsNonLocalValue(AddrModeInsts[i], LdStInst->getParent())) {
- AnyNonLocal = true;
- break;
- }
- }
-
- // If all the instructions matched are already in this BB, don't do anything.
- if (!AnyNonLocal) {
- DEBUG(cerr << "CGP: Found local addrmode: " << AddrMode << "\n");
- return false;
- }
-
- // Insert this computation right after this user. Since our caller is
- // scanning from the top of the BB to the bottom, reuse of the expr are
- // guaranteed to happen later.
- BasicBlock::iterator InsertPt = LdStInst;
-
- // Now that we determined the addressing expression we want to use and know
- // that we have to sink it into this block. Check to see if we have already
- // done this for some other load/store instr in this block. If so, reuse the
- // computation.
- Value *&SunkAddr = SunkAddrs[Addr];
- if (SunkAddr) {
- DEBUG(cerr << "CGP: Reusing nonlocal addrmode: " << AddrMode << "\n");
- if (SunkAddr->getType() != Addr->getType())
- SunkAddr = new BitCastInst(SunkAddr, Addr->getType(), "tmp", InsertPt);
- } else {
- DEBUG(cerr << "CGP: SINKING nonlocal addrmode: " << AddrMode << "\n");
- const Type *IntPtrTy = TLI->getTargetData()->getIntPtrType();
-
- Value *Result = 0;
- // Start with the scale value.
- if (AddrMode.Scale) {
- Value *V = AddrMode.ScaledReg;
- if (V->getType() == IntPtrTy) {
- // done.
- } else if (isa<PointerType>(V->getType())) {
- V = new PtrToIntInst(V, IntPtrTy, "sunkaddr", InsertPt);
- } else if (cast<IntegerType>(IntPtrTy)->getBitWidth() <
- cast<IntegerType>(V->getType())->getBitWidth()) {
- V = new TruncInst(V, IntPtrTy, "sunkaddr", InsertPt);
- } else {
- V = new SExtInst(V, IntPtrTy, "sunkaddr", InsertPt);
- }
- if (AddrMode.Scale != 1)
- V = BinaryOperator::createMul(V, ConstantInt::get(IntPtrTy,
- AddrMode.Scale),
- "sunkaddr", InsertPt);
- Result = V;
- }
-
- // Add in the base register.
- if (AddrMode.BaseReg) {
- Value *V = AddrMode.BaseReg;
- if (V->getType() != IntPtrTy)
- V = new PtrToIntInst(V, IntPtrTy, "sunkaddr", InsertPt);
- if (Result)
- Result = BinaryOperator::createAdd(Result, V, "sunkaddr", InsertPt);
- else
- Result = V;
- }
-
- // Add in the BaseGV if present.
- if (AddrMode.BaseGV) {
- Value *V = new PtrToIntInst(AddrMode.BaseGV, IntPtrTy, "sunkaddr",
- InsertPt);
- if (Result)
- Result = BinaryOperator::createAdd(Result, V, "sunkaddr", InsertPt);
- else
- Result = V;
- }
-
- // Add in the Base Offset if present.
- if (AddrMode.BaseOffs) {
- Value *V = ConstantInt::get(IntPtrTy, AddrMode.BaseOffs);
- if (Result)
- Result = BinaryOperator::createAdd(Result, V, "sunkaddr", InsertPt);
- else
- Result = V;
- }
-
- if (Result == 0)
- SunkAddr = Constant::getNullValue(Addr->getType());
- else
- SunkAddr = new IntToPtrInst(Result, Addr->getType(), "sunkaddr",InsertPt);
- }
-
- LdStInst->replaceUsesOfWith(Addr, SunkAddr);
-
- if (Addr->use_empty())
- EraseDeadInstructions(Addr);
- return true;
-}
-
-/// OptimizeInlineAsmInst - If there are any memory operands, use
-/// OptimizeLoadStoreInt to sink their address computing into the block when
-/// possible / profitable.
-bool CodeGenPrepare::OptimizeInlineAsmInst(Instruction *I, CallSite CS,
- DenseMap<Value*,Value*> &SunkAddrs) {
- bool MadeChange = false;
- InlineAsm *IA = cast<InlineAsm>(CS.getCalledValue());
-
- // Do a prepass over the constraints, canonicalizing them, and building up the
- // ConstraintOperands list.
- std::vector<InlineAsm::ConstraintInfo>
- ConstraintInfos = IA->ParseConstraints();
-
- /// ConstraintOperands - Information about all of the constraints.
- std::vector<TargetLowering::AsmOperandInfo> ConstraintOperands;
- unsigned ArgNo = 0; // ArgNo - The argument of the CallInst.
- for (unsigned i = 0, e = ConstraintInfos.size(); i != e; ++i) {
- ConstraintOperands.
- push_back(TargetLowering::AsmOperandInfo(ConstraintInfos[i]));
- TargetLowering::AsmOperandInfo &OpInfo = ConstraintOperands.back();
-
- // Compute the value type for each operand.
- switch (OpInfo.Type) {
- case InlineAsm::isOutput:
- if (OpInfo.isIndirect)
- OpInfo.CallOperandVal = CS.getArgument(ArgNo++);
- break;
- case InlineAsm::isInput:
- OpInfo.CallOperandVal = CS.getArgument(ArgNo++);
- break;
- case InlineAsm::isClobber:
- // Nothing to do.
- break;
- }
-
- // Compute the constraint code and ConstraintType to use.
- TLI->ComputeConstraintToUse(OpInfo, SDOperand());
-
- if (OpInfo.ConstraintType == TargetLowering::C_Memory &&
- OpInfo.isIndirect) {
- Value *OpVal = OpInfo.CallOperandVal;
- MadeChange |= OptimizeLoadStoreInst(I, OpVal, OpVal->getType(),
- SunkAddrs);
- }
- }
-
- return MadeChange;
-}
-
-bool CodeGenPrepare::OptimizeExtUses(Instruction *I) {
- BasicBlock *DefBB = I->getParent();
-
- // If both result of the {s|z}xt and its source are live out, rewrite all
- // other uses of the source with result of extension.
- Value *Src = I->getOperand(0);
- if (Src->hasOneUse())
- return false;
-
- // Only do this xform if truncating is free.
- if (TLI && !TLI->isTruncateFree(I->getType(), Src->getType()))
- return false;
-
- // Only safe to perform the optimization if the source is also defined in
- // this block.
- if (!isa<Instruction>(Src) || DefBB != cast<Instruction>(Src)->getParent())
- return false;
-
- bool DefIsLiveOut = false;
- for (Value::use_iterator UI = I->use_begin(), E = I->use_end();
- UI != E; ++UI) {
- Instruction *User = cast<Instruction>(*UI);
-
- // Figure out which BB this ext is used in.
- BasicBlock *UserBB = User->getParent();
- if (UserBB == DefBB) continue;
- DefIsLiveOut = true;
- break;
- }
- if (!DefIsLiveOut)
- return false;
-
- // Make sure non of the uses are PHI nodes.
- for (Value::use_iterator UI = Src->use_begin(), E = Src->use_end();
- UI != E; ++UI) {
- Instruction *User = cast<Instruction>(*UI);
- BasicBlock *UserBB = User->getParent();
- if (UserBB == DefBB) continue;
- // Be conservative. We don't want this xform to end up introducing
- // reloads just before load / store instructions.
- if (isa<PHINode>(User) || isa<LoadInst>(User) || isa<StoreInst>(User))
- return false;
- }
-
- // InsertedTruncs - Only insert one trunc in each block once.
- DenseMap<BasicBlock*, Instruction*> InsertedTruncs;
-
- bool MadeChange = false;
- for (Value::use_iterator UI = Src->use_begin(), E = Src->use_end();
- UI != E; ++UI) {
- Use &TheUse = UI.getUse();
- Instruction *User = cast<Instruction>(*UI);
-
- // Figure out which BB this ext is used in.
- BasicBlock *UserBB = User->getParent();
- if (UserBB == DefBB) continue;
-
- // Both src and def are live in this block. Rewrite the use.
- Instruction *&InsertedTrunc = InsertedTruncs[UserBB];
-
- if (!InsertedTrunc) {
- BasicBlock::iterator InsertPt = UserBB->begin();
- while (isa<PHINode>(InsertPt)) ++InsertPt;
-
- InsertedTrunc = new TruncInst(I, Src->getType(), "", InsertPt);
- }
-
- // Replace a use of the {s|z}ext source with a use of the result.
- TheUse = InsertedTrunc;
-
- MadeChange = true;
- }
-
- return MadeChange;
-}
-
-// In this pass we look for GEP and cast instructions that are used
-// across basic blocks and rewrite them to improve basic-block-at-a-time
-// selection.
-bool CodeGenPrepare::OptimizeBlock(BasicBlock &BB) {
- bool MadeChange = false;
-
- // Split all critical edges where the dest block has a PHI and where the phi
- // has shared immediate operands.
- TerminatorInst *BBTI = BB.getTerminator();
- if (BBTI->getNumSuccessors() > 1) {
- for (unsigned i = 0, e = BBTI->getNumSuccessors(); i != e; ++i)
- if (isa<PHINode>(BBTI->getSuccessor(i)->begin()) &&
- isCriticalEdge(BBTI, i, true))
- SplitEdgeNicely(BBTI, i, this);
- }
-
-
- // Keep track of non-local addresses that have been sunk into this block.
- // This allows us to avoid inserting duplicate code for blocks with multiple
- // load/stores of the same address.
- DenseMap<Value*, Value*> SunkAddrs;
-
- for (BasicBlock::iterator BBI = BB.begin(), E = BB.end(); BBI != E; ) {
- Instruction *I = BBI++;
-
- if (CastInst *CI = dyn_cast<CastInst>(I)) {
- // If the source of the cast is a constant, then this should have
- // already been constant folded. The only reason NOT to constant fold
- // it is if something (e.g. LSR) was careful to place the constant
- // evaluation in a block other than then one that uses it (e.g. to hoist
- // the address of globals out of a loop). If this is the case, we don't
- // want to forward-subst the cast.
- if (isa<Constant>(CI->getOperand(0)))
- continue;
-
- bool Change = false;
- if (TLI) {
- Change = OptimizeNoopCopyExpression(CI, *TLI);
- MadeChange |= Change;
- }
-
- if (!Change && (isa<ZExtInst>(I) || isa<SExtInst>(I)))
- MadeChange |= OptimizeExtUses(I);
- } else if (CmpInst *CI = dyn_cast<CmpInst>(I)) {
- MadeChange |= OptimizeCmpExpression(CI);
- } else if (LoadInst *LI = dyn_cast<LoadInst>(I)) {
- if (TLI)
- MadeChange |= OptimizeLoadStoreInst(I, I->getOperand(0), LI->getType(),
- SunkAddrs);
- } else if (StoreInst *SI = dyn_cast<StoreInst>(I)) {
- if (TLI)
- MadeChange |= OptimizeLoadStoreInst(I, SI->getOperand(1),
- SI->getOperand(0)->getType(),
- SunkAddrs);
- } else if (GetElementPtrInst *GEPI = dyn_cast<GetElementPtrInst>(I)) {
- if (GEPI->hasAllZeroIndices()) {
- /// The GEP operand must be a pointer, so must its result -> BitCast
- Instruction *NC = new BitCastInst(GEPI->getOperand(0), GEPI->getType(),
- GEPI->getName(), GEPI);
- GEPI->replaceAllUsesWith(NC);
- GEPI->eraseFromParent();
- MadeChange = true;
- BBI = NC;
- }
- } else if (CallInst *CI = dyn_cast<CallInst>(I)) {
- // If we found an inline asm expession, and if the target knows how to
- // lower it to normal LLVM code, do so now.
- if (TLI && isa<InlineAsm>(CI->getCalledValue()))
- if (const TargetAsmInfo *TAI =
- TLI->getTargetMachine().getTargetAsmInfo()) {
- if (TAI->ExpandInlineAsm(CI))
- BBI = BB.begin();
- else
- // Sink address computing for memory operands into the block.
- MadeChange |= OptimizeInlineAsmInst(I, &(*CI), SunkAddrs);
- }
- }
- }
-
- return MadeChange;
-}
-
diff --git a/release_23/lib/Transforms/Scalar/CondPropagate.cpp b/release_23/lib/Transforms/Scalar/CondPropagate.cpp
deleted file mode 100644
index bed2b359a0e3..000000000000
--- a/release_23/lib/Transforms/Scalar/CondPropagate.cpp
+++ /dev/null
@@ -1,221 +0,0 @@
-//===-- CondPropagate.cpp - Propagate Conditional Expressions -------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This pass propagates information about conditional expressions through the
-// program, allowing it to eliminate conditional branches in some cases.
-//
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "condprop"
-#include "llvm/Transforms/Scalar.h"
-#include "llvm/Transforms/Utils/Local.h"
-#include "llvm/Constants.h"
-#include "llvm/Function.h"
-#include "llvm/Instructions.h"
-#include "llvm/Pass.h"
-#include "llvm/Type.h"
-#include "llvm/ADT/STLExtras.h"
-#include "llvm/ADT/Statistic.h"
-#include "llvm/Support/Compiler.h"
-#include "llvm/Support/Streams.h"
-using namespace llvm;
-
-STATISTIC(NumBrThread, "Number of CFG edges threaded through branches");
-STATISTIC(NumSwThread, "Number of CFG edges threaded through switches");
-
-namespace {
- struct VISIBILITY_HIDDEN CondProp : public FunctionPass {
- static char ID; // Pass identification, replacement for typeid
- CondProp() : FunctionPass((intptr_t)&ID) {}
-
- virtual bool runOnFunction(Function &F);
-
- virtual void getAnalysisUsage(AnalysisUsage &AU) const {
- AU.addRequiredID(BreakCriticalEdgesID);
- //AU.addRequired<DominanceFrontier>();
- }
-
- private:
- bool MadeChange;
- void SimplifyBlock(BasicBlock *BB);
- void SimplifyPredecessors(BranchInst *BI);
- void SimplifyPredecessors(SwitchInst *SI);
- void RevectorBlockTo(BasicBlock *FromBB, BasicBlock *ToBB);
- };
-
- char CondProp::ID = 0;
- RegisterPass<CondProp> X("condprop", "Conditional Propagation");
-}
-
-FunctionPass *llvm::createCondPropagationPass() {
- return new CondProp();
-}
-
-bool CondProp::runOnFunction(Function &F) {
- bool EverMadeChange = false;
-
- // While we are simplifying blocks, keep iterating.
- do {
- MadeChange = false;
- for (Function::iterator BB = F.begin(), E = F.end(); BB != E; ++BB)
- SimplifyBlock(BB);
- EverMadeChange = EverMadeChange || MadeChange;
- } while (MadeChange);
- return EverMadeChange;
-}
-
-void CondProp::SimplifyBlock(BasicBlock *BB) {
- if (BranchInst *BI = dyn_cast<BranchInst>(BB->getTerminator())) {
- // If this is a conditional branch based on a phi node that is defined in
- // this block, see if we can simplify predecessors of this block.
- if (BI->isConditional() && isa<PHINode>(BI->getCondition()) &&
- cast<PHINode>(BI->getCondition())->getParent() == BB)
- SimplifyPredecessors(BI);
-
- } else if (SwitchInst *SI = dyn_cast<SwitchInst>(BB->getTerminator())) {
- if (isa<PHINode>(SI->getCondition()) &&
- cast<PHINode>(SI->getCondition())->getParent() == BB)
- SimplifyPredecessors(SI);
- }
-
- // If possible, simplify the terminator of this block.
- if (ConstantFoldTerminator(BB))
- MadeChange = true;
-
- // If this block ends with an unconditional branch and the only successor has
- // only this block as a predecessor, merge the two blocks together.
- if (BranchInst *BI = dyn_cast<BranchInst>(BB->getTerminator()))
- if (BI->isUnconditional() && BI->getSuccessor(0)->getSinglePredecessor() &&
- BB != BI->getSuccessor(0)) {
- BasicBlock *Succ = BI->getSuccessor(0);
-
- // If Succ has any PHI nodes, they are all single-entry PHI's.
- while (PHINode *PN = dyn_cast<PHINode>(Succ->begin())) {
- assert(PN->getNumIncomingValues() == 1 &&
- "PHI doesn't match parent block");
- PN->replaceAllUsesWith(PN->getIncomingValue(0));
- PN->eraseFromParent();
- }
-
- // Remove BI.
- BI->eraseFromParent();
-
- // Move over all of the instructions.
- BB->getInstList().splice(BB->end(), Succ->getInstList());
-
- // Any phi nodes that had entries for Succ now have entries from BB.
- Succ->replaceAllUsesWith(BB);
-
- // Succ is now dead, but we cannot delete it without potentially
- // invalidating iterators elsewhere. Just insert an unreachable
- // instruction in it.
- new UnreachableInst(Succ);
- MadeChange = true;
- }
-}
-
-// SimplifyPredecessors(branches) - We know that BI is a conditional branch
-// based on a PHI node defined in this block. If the phi node contains constant
-// operands, then the blocks corresponding to those operands can be modified to
-// jump directly to the destination instead of going through this block.
-void CondProp::SimplifyPredecessors(BranchInst *BI) {
- // TODO: We currently only handle the most trival case, where the PHI node has
- // one use (the branch), and is the only instruction besides the branch in the
- // block.
- PHINode *PN = cast<PHINode>(BI->getCondition());
- if (!PN->hasOneUse()) return;
-
- BasicBlock *BB = BI->getParent();
- if (&*BB->begin() != PN || &*next(BB->begin()) != BI)
- return;
-
- // Ok, we have this really simple case, walk the PHI operands, looking for
- // constants. Walk from the end to remove operands from the end when
- // possible, and to avoid invalidating "i".
- for (unsigned i = PN->getNumIncomingValues(); i != 0; --i)
- if (ConstantInt *CB = dyn_cast<ConstantInt>(PN->getIncomingValue(i-1))) {
- // If we have a constant, forward the edge from its current to its
- // ultimate destination.
- RevectorBlockTo(PN->getIncomingBlock(i-1),
- BI->getSuccessor(CB->isZero()));
- ++NumBrThread;
-
- // If there were two predecessors before this simplification, or if the
- // PHI node contained all the same value except for the one we just
- // substituted, the PHI node may be deleted. Don't iterate through it the
- // last time.
- if (BI->getCondition() != PN) return;
- }
-}
-
-// SimplifyPredecessors(switch) - We know that SI is switch based on a PHI node
-// defined in this block. If the phi node contains constant operands, then the
-// blocks corresponding to those operands can be modified to jump directly to
-// the destination instead of going through this block.
-void CondProp::SimplifyPredecessors(SwitchInst *SI) {
- // TODO: We currently only handle the most trival case, where the PHI node has
- // one use (the branch), and is the only instruction besides the branch in the
- // block.
- PHINode *PN = cast<PHINode>(SI->getCondition());
- if (!PN->hasOneUse()) return;
-
- BasicBlock *BB = SI->getParent();
- if (&*BB->begin() != PN || &*next(BB->begin()) != SI)
- return;
-
- bool RemovedPreds = false;
-
- // Ok, we have this really simple case, walk the PHI operands, looking for
- // constants. Walk from the end to remove operands from the end when
- // possible, and to avoid invalidating "i".
- for (unsigned i = PN->getNumIncomingValues(); i != 0; --i)
- if (ConstantInt *CI = dyn_cast<ConstantInt>(PN->getIncomingValue(i-1))) {
- // If we have a constant, forward the edge from its current to its
- // ultimate destination.
- unsigned DestCase = SI->findCaseValue(CI);
- RevectorBlockTo(PN->getIncomingBlock(i-1),
- SI->getSuccessor(DestCase));
- ++NumSwThread;
- RemovedPreds = true;
-
- // If there were two predecessors before this simplification, or if the
- // PHI node contained all the same value except for the one we just
- // substituted, the PHI node may be deleted. Don't iterate through it the
- // last time.
- if (SI->getCondition() != PN) return;
- }
-}
-
-
-// RevectorBlockTo - Revector the unconditional branch at the end of FromBB to
-// the ToBB block, which is one of the successors of its current successor.
-void CondProp::RevectorBlockTo(BasicBlock *FromBB, BasicBlock *ToBB) {
- BranchInst *FromBr = cast<BranchInst>(FromBB->getTerminator());
- assert(FromBr->isUnconditional() && "FromBB should end with uncond br!");
-
- // Get the old block we are threading through.
- BasicBlock *OldSucc = FromBr->getSuccessor(0);
-
- // OldSucc had multiple successors. If ToBB has multiple predecessors, then
- // the edge between them would be critical, which we already took care of.
- // If ToBB has single operand PHI node then take care of it here.
- while (PHINode *PN = dyn_cast<PHINode>(ToBB->begin())) {
- assert(PN->getNumIncomingValues() == 1 && "Critical Edge Found!");
- PN->replaceAllUsesWith(PN->getIncomingValue(0));
- PN->eraseFromParent();
- }
-
- // Update PHI nodes in OldSucc to know that FromBB no longer branches to it.
- OldSucc->removePredecessor(FromBB);
-
- // Change FromBr to branch to the new destination.
- FromBr->setSuccessor(0, ToBB);
-
- MadeChange = true;
-}
diff --git a/release_23/lib/Transforms/Scalar/ConstantProp.cpp b/release_23/lib/Transforms/Scalar/ConstantProp.cpp
deleted file mode 100644
index 60b915a1b5e4..000000000000
--- a/release_23/lib/Transforms/Scalar/ConstantProp.cpp
+++ /dev/null
@@ -1,90 +0,0 @@
-//===- ConstantProp.cpp - Code to perform Simple Constant Propagation -----===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements constant propagation and merging:
-//
-// Specifically, this:
-// * Converts instructions like "add int 1, 2" into 3
-//
-// Notice that:
-// * This pass has a habit of making definitions be dead. It is a good idea
-// to to run a DIE pass sometime after running this pass.
-//
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "constprop"
-#include "llvm/Transforms/Scalar.h"
-#include "llvm/Analysis/ConstantFolding.h"
-#include "llvm/Constant.h"
-#include "llvm/Instruction.h"
-#include "llvm/Pass.h"
-#include "llvm/Support/Compiler.h"
-#include "llvm/Support/InstIterator.h"
-#include "llvm/ADT/Statistic.h"
-#include <set>
-using namespace llvm;
-
-STATISTIC(NumInstKilled, "Number of instructions killed");
-
-namespace {
- struct VISIBILITY_HIDDEN ConstantPropagation : public FunctionPass {
- static char ID; // Pass identification, replacement for typeid
- ConstantPropagation() : FunctionPass((intptr_t)&ID) {}
-
- bool runOnFunction(Function &F);
-
- virtual void getAnalysisUsage(AnalysisUsage &AU) const {
- AU.setPreservesCFG();
- }
- };
-
- char ConstantPropagation::ID = 0;
- RegisterPass<ConstantPropagation> X("constprop",
- "Simple constant propagation");
-}
-
-FunctionPass *llvm::createConstantPropagationPass() {
- return new ConstantPropagation();
-}
-
-
-bool ConstantPropagation::runOnFunction(Function &F) {
- // Initialize the worklist to all of the instructions ready to process...
- std::set<Instruction*> WorkList;
- for(inst_iterator i = inst_begin(F), e = inst_end(F); i != e; ++i) {
- WorkList.insert(&*i);
- }
- bool Changed = false;
-
- while (!WorkList.empty()) {
- Instruction *I = *WorkList.begin();
- WorkList.erase(WorkList.begin()); // Get an element from the worklist...
-
- if (!I->use_empty()) // Don't muck with dead instructions...
- if (Constant *C = ConstantFoldInstruction(I)) {
- // Add all of the users of this instruction to the worklist, they might
- // be constant propagatable now...
- for (Value::use_iterator UI = I->use_begin(), UE = I->use_end();
- UI != UE; ++UI)
- WorkList.insert(cast<Instruction>(*UI));
-
- // Replace all of the uses of a variable with uses of the constant.
- I->replaceAllUsesWith(C);
-
- // Remove the dead instruction.
- WorkList.erase(I);
- I->getParent()->getInstList().erase(I);
-
- // We made a change to the function...
- Changed = true;
- ++NumInstKilled;
- }
- }
- return Changed;
-}
diff --git a/release_23/lib/Transforms/Scalar/DCE.cpp b/release_23/lib/Transforms/Scalar/DCE.cpp
deleted file mode 100644
index 539dd22d47d1..000000000000
--- a/release_23/lib/Transforms/Scalar/DCE.cpp
+++ /dev/null
@@ -1,129 +0,0 @@
-//===- DCE.cpp - Code to perform dead code elimination --------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements dead inst elimination and dead code elimination.
-//
-// Dead Inst Elimination performs a single pass over the function removing
-// instructions that are obviously dead. Dead Code Elimination is similar, but
-// it rechecks instructions that were used by removed instructions to see if
-// they are newly dead.
-//
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "dce"
-#include "llvm/Transforms/Scalar.h"
-#include "llvm/Transforms/Utils/Local.h"
-#include "llvm/Instruction.h"
-#include "llvm/Pass.h"
-#include "llvm/Support/Compiler.h"
-#include "llvm/Support/InstIterator.h"
-#include "llvm/ADT/Statistic.h"
-#include <set>
-using namespace llvm;
-
-STATISTIC(DIEEliminated, "Number of insts removed by DIE pass");
-STATISTIC(DCEEliminated, "Number of insts removed");
-
-namespace {
- //===--------------------------------------------------------------------===//
- // DeadInstElimination pass implementation
- //
- struct VISIBILITY_HIDDEN DeadInstElimination : public BasicBlockPass {
- static char ID; // Pass identification, replacement for typeid
- DeadInstElimination() : BasicBlockPass(intptr_t(&ID)) {}
- virtual bool runOnBasicBlock(BasicBlock &BB) {
- bool Changed = false;
- for (BasicBlock::iterator DI = BB.begin(); DI != BB.end(); )
- if (dceInstruction(DI)) {
- Changed = true;
- ++DIEEliminated;
- } else
- ++DI;
- return Changed;
- }
-
- virtual void getAnalysisUsage(AnalysisUsage &AU) const {
- AU.setPreservesCFG();
- }
- };
-
- char DeadInstElimination::ID = 0;
- RegisterPass<DeadInstElimination> X("die", "Dead Instruction Elimination");
-}
-
-Pass *llvm::createDeadInstEliminationPass() {
- return new DeadInstElimination();
-}
-
-
-namespace {
- //===--------------------------------------------------------------------===//
- // DeadCodeElimination pass implementation
- //
- struct DCE : public FunctionPass {
- static char ID; // Pass identification, replacement for typeid
- DCE() : FunctionPass((intptr_t)&ID) {}
-
- virtual bool runOnFunction(Function &F);
-
- virtual void getAnalysisUsage(AnalysisUsage &AU) const {
- AU.setPreservesCFG();
- }
- };
-
- char DCE::ID = 0;
- RegisterPass<DCE> Y("dce", "Dead Code Elimination");
-}
-
-bool DCE::runOnFunction(Function &F) {
- // Start out with all of the instructions in the worklist...
- std::vector<Instruction*> WorkList;
- for (inst_iterator i = inst_begin(F), e = inst_end(F); i != e; ++i)
- WorkList.push_back(&*i);
-
- // Loop over the worklist finding instructions that are dead. If they are
- // dead make them drop all of their uses, making other instructions
- // potentially dead, and work until the worklist is empty.
- //
- bool MadeChange = false;
- while (!WorkList.empty()) {
- Instruction *I = WorkList.back();
- WorkList.pop_back();
-
- if (isInstructionTriviallyDead(I)) { // If the instruction is dead.
- // Loop over all of the values that the instruction uses, if there are
- // instructions being used, add them to the worklist, because they might
- // go dead after this one is removed.
- //
- for (User::op_iterator OI = I->op_begin(), E = I->op_end(); OI != E; ++OI)
- if (Instruction *Used = dyn_cast<Instruction>(*OI))
- WorkList.push_back(Used);
-
- // Remove the instruction.
- I->eraseFromParent();
-
- // Remove the instruction from the worklist if it still exists in it.
- for (std::vector<Instruction*>::iterator WI = WorkList.begin();
- WI != WorkList.end(); ++WI)
- if (*WI == I) {
- WI = WorkList.erase(WI);
- --WI;
- }
-
- MadeChange = true;
- ++DCEEliminated;
- }
- }
- return MadeChange;
-}
-
-FunctionPass *llvm::createDeadCodeEliminationPass() {
- return new DCE();
-}
-
diff --git a/release_23/lib/Transforms/Scalar/DeadStoreElimination.cpp b/release_23/lib/Transforms/Scalar/DeadStoreElimination.cpp
deleted file mode 100644
index 89afa911e758..000000000000
--- a/release_23/lib/Transforms/Scalar/DeadStoreElimination.cpp
+++ /dev/null
@@ -1,559 +0,0 @@
-//===- DeadStoreElimination.cpp - Fast Dead Store Elimination -------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements a trivial dead store elimination that only considers
-// basic-block local redundant stores.
-//
-// FIXME: This should eventually be extended to be a post-dominator tree
-// traversal. Doing so would be pretty trivial.
-//
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "dse"
-#include "llvm/Transforms/Scalar.h"
-#include "llvm/Constants.h"
-#include "llvm/Function.h"
-#include "llvm/Instructions.h"
-#include "llvm/IntrinsicInst.h"
-#include "llvm/Pass.h"
-#include "llvm/ADT/SetVector.h"
-#include "llvm/ADT/SmallPtrSet.h"
-#include "llvm/ADT/Statistic.h"
-#include "llvm/Analysis/AliasAnalysis.h"
-#include "llvm/Analysis/MemoryDependenceAnalysis.h"
-#include "llvm/Target/TargetData.h"
-#include "llvm/Transforms/Utils/Local.h"
-#include "llvm/Support/Compiler.h"
-using namespace llvm;
-
-STATISTIC(NumFastStores, "Number of stores deleted");
-STATISTIC(NumFastOther , "Number of other instrs removed");
-
-namespace {
- struct VISIBILITY_HIDDEN DSE : public FunctionPass {
- static char ID; // Pass identification, replacement for typeid
- DSE() : FunctionPass((intptr_t)&ID) {}
-
- virtual bool runOnFunction(Function &F) {
- bool Changed = false;
- for (Function::iterator I = F.begin(), E = F.end(); I != E; ++I)
- Changed |= runOnBasicBlock(*I);
- return Changed;
- }
-
- bool runOnBasicBlock(BasicBlock &BB);
- bool handleFreeWithNonTrivialDependency(FreeInst* F,
- Instruction* dependency,
- SetVector<Instruction*>& possiblyDead);
- bool handleEndBlock(BasicBlock& BB, SetVector<Instruction*>& possiblyDead);
- bool RemoveUndeadPointers(Value* pointer, uint64_t killPointerSize,
- BasicBlock::iterator& BBI,
- SmallPtrSet<Value*, 64>& deadPointers,
- SetVector<Instruction*>& possiblyDead);
- void DeleteDeadInstructionChains(Instruction *I,
- SetVector<Instruction*> &DeadInsts);
-
- /// Find the base pointer that a pointer came from
- /// Because this is used to find pointers that originate
- /// from allocas, it is safe to ignore GEP indices, since
- /// either the store will be in the alloca, and thus dead,
- /// or beyond the end of the alloca, and thus undefined.
- void TranslatePointerBitCasts(Value*& v, bool zeroGepsOnly = false) {
- assert(isa<PointerType>(v->getType()) &&
- "Translating a non-pointer type?");
- while (true) {
- if (BitCastInst* C = dyn_cast<BitCastInst>(v))
- v = C->getOperand(0);
- else if (GetElementPtrInst* G = dyn_cast<GetElementPtrInst>(v))
- if (!zeroGepsOnly || G->hasAllZeroIndices()) {
- v = G->getOperand(0);
- } else {
- break;
- }
- else
- break;
- }
- }
-
- // getAnalysisUsage - We require post dominance frontiers (aka Control
- // Dependence Graph)
- virtual void getAnalysisUsage(AnalysisUsage &AU) const {
- AU.setPreservesCFG();
- AU.addRequired<TargetData>();
- AU.addRequired<AliasAnalysis>();
- AU.addRequired<MemoryDependenceAnalysis>();
- AU.addPreserved<AliasAnalysis>();
- AU.addPreserved<MemoryDependenceAnalysis>();
- }
- };
- char DSE::ID = 0;
- RegisterPass<DSE> X("dse", "Dead Store Elimination");
-}
-
-FunctionPass *llvm::createDeadStoreEliminationPass() { return new DSE(); }
-
-bool DSE::runOnBasicBlock(BasicBlock &BB) {
- MemoryDependenceAnalysis& MD = getAnalysis<MemoryDependenceAnalysis>();
- TargetData &TD = getAnalysis<TargetData>();
-
- // Record the last-seen store to this pointer
- DenseMap<Value*, StoreInst*> lastStore;
- // Record instructions possibly made dead by deleting a store
- SetVector<Instruction*> possiblyDead;
-
- bool MadeChange = false;
-
- // Do a top-down walk on the BB
- for (BasicBlock::iterator BBI = BB.begin(), BBE = BB.end();
- BBI != BBE; ++BBI) {
- // If we find a store or a free...
- if (!isa<StoreInst>(BBI) && !isa<FreeInst>(BBI))
- continue;
-
- Value* pointer = 0;
- if (StoreInst* S = dyn_cast<StoreInst>(BBI)) {
- if (!S->isVolatile())
- pointer = S->getPointerOperand();
- else
- continue;
- } else
- pointer = cast<FreeInst>(BBI)->getPointerOperand();
-
- TranslatePointerBitCasts(pointer, true);
- StoreInst*& last = lastStore[pointer];
- bool deletedStore = false;
-
- // ... to a pointer that has been stored to before...
- if (last) {
- Instruction* dep = MD.getDependency(BBI);
-
- // ... and no other memory dependencies are between them....
- while (dep != MemoryDependenceAnalysis::None &&
- dep != MemoryDependenceAnalysis::NonLocal &&
- isa<StoreInst>(dep)) {
- if (dep != last ||
- TD.getTypeStoreSize(last->getOperand(0)->getType()) >
- TD.getTypeStoreSize(BBI->getOperand(0)->getType())) {
- dep = MD.getDependency(BBI, dep);
- continue;
- }
-
- // Remove it!
- MD.removeInstruction(last);
-
- // DCE instructions only used to calculate that store
- if (Instruction* D = dyn_cast<Instruction>(last->getOperand(0)))
- possiblyDead.insert(D);
- if (Instruction* D = dyn_cast<Instruction>(last->getOperand(1)))
- possiblyDead.insert(D);
-
- last->eraseFromParent();
- NumFastStores++;
- deletedStore = true;
- MadeChange = true;
-
- break;
- }
- }
-
- // Handle frees whose dependencies are non-trivial.
- if (FreeInst* F = dyn_cast<FreeInst>(BBI)) {
- if (!deletedStore)
- MadeChange |= handleFreeWithNonTrivialDependency(F,
- MD.getDependency(F),
- possiblyDead);
- // No known stores after the free
- last = 0;
- } else {
- // Update our most-recent-store map.
- last = cast<StoreInst>(BBI);
- }
- }
-
- // If this block ends in a return, unwind, unreachable, and eventually
- // tailcall, then all allocas are dead at its end.
- if (BB.getTerminator()->getNumSuccessors() == 0)
- MadeChange |= handleEndBlock(BB, possiblyDead);
-
- // Do a trivial DCE
- while (!possiblyDead.empty()) {
- Instruction *I = possiblyDead.back();
- possiblyDead.pop_back();
- DeleteDeadInstructionChains(I, possiblyDead);
- }
-
- return MadeChange;
-}
-
-/// handleFreeWithNonTrivialDependency - Handle frees of entire structures whose
-/// dependency is a store to a field of that structure
-bool DSE::handleFreeWithNonTrivialDependency(FreeInst* F, Instruction* dep,
- SetVector<Instruction*>& possiblyDead) {
- TargetData &TD = getAnalysis<TargetData>();
- AliasAnalysis &AA = getAnalysis<AliasAnalysis>();
- MemoryDependenceAnalysis& MD = getAnalysis<MemoryDependenceAnalysis>();
-
- if (dep == MemoryDependenceAnalysis::None ||
- dep == MemoryDependenceAnalysis::NonLocal)
- return false;
-
- StoreInst* dependency = dyn_cast<StoreInst>(dep);
- if (!dependency)
- return false;
- else if (dependency->isVolatile())
- return false;
-
- Value* depPointer = dependency->getPointerOperand();
- const Type* depType = dependency->getOperand(0)->getType();
- unsigned depPointerSize = TD.getTypeStoreSize(depType);
-
- // Check for aliasing
- AliasAnalysis::AliasResult A = AA.alias(F->getPointerOperand(), ~0U,
- depPointer, depPointerSize);
-
- if (A == AliasAnalysis::MustAlias) {
- // Remove it!
- MD.removeInstruction(dependency);
-
- // DCE instructions only used to calculate that store
- if (Instruction* D = dyn_cast<Instruction>(dependency->getOperand(0)))
- possiblyDead.insert(D);
- if (Instruction* D = dyn_cast<Instruction>(dependency->getOperand(1)))
- possiblyDead.insert(D);
-
- dependency->eraseFromParent();
- NumFastStores++;
- return true;
- }
-
- return false;
-}
-
-/// handleEndBlock - Remove dead stores to stack-allocated locations in the
-/// function end block. Ex:
-/// %A = alloca i32
-/// ...
-/// store i32 1, i32* %A
-/// ret void
-bool DSE::handleEndBlock(BasicBlock& BB,
- SetVector<Instruction*>& possiblyDead) {
- TargetData &TD = getAnalysis<TargetData>();
- AliasAnalysis &AA = getAnalysis<AliasAnalysis>();
- MemoryDependenceAnalysis& MD = getAnalysis<MemoryDependenceAnalysis>();
-
- bool MadeChange = false;
-
- // Pointers alloca'd in this function are dead in the end block
- SmallPtrSet<Value*, 64> deadPointers;
-
- // Find all of the alloca'd pointers in the entry block
- BasicBlock *Entry = BB.getParent()->begin();
- for (BasicBlock::iterator I = Entry->begin(), E = Entry->end(); I != E; ++I)
- if (AllocaInst *AI = dyn_cast<AllocaInst>(I))
- deadPointers.insert(AI);
- for (Function::arg_iterator AI = BB.getParent()->arg_begin(),
- AE = BB.getParent()->arg_end(); AI != AE; ++AI)
- if (AI->hasByValAttr())
- deadPointers.insert(AI);
-
- // Scan the basic block backwards
- for (BasicBlock::iterator BBI = BB.end(); BBI != BB.begin(); ){
- --BBI;
-
- // If we find a store whose pointer is dead...
- if (StoreInst* S = dyn_cast<StoreInst>(BBI)) {
- if (!S->isVolatile()) {
- Value* pointerOperand = S->getPointerOperand();
- // See through pointer-to-pointer bitcasts
- TranslatePointerBitCasts(pointerOperand);
-
- // Alloca'd pointers or byval arguments (which are functionally like
- // alloca's) are valid candidates for removal.
- if (deadPointers.count(pointerOperand)) {
- // Remove it!
- MD.removeInstruction(S);
-
- // DCE instructions only used to calculate that store
- if (Instruction* D = dyn_cast<Instruction>(S->getOperand(0)))
- possiblyDead.insert(D);
- if (Instruction* D = dyn_cast<Instruction>(S->getOperand(1)))
- possiblyDead.insert(D);
-
- BBI++;
- S->eraseFromParent();
- NumFastStores++;
- MadeChange = true;
- }
- }
-
- continue;
-
- // We can also remove memcpy's to local variables at the end of a function
- } else if (MemCpyInst* M = dyn_cast<MemCpyInst>(BBI)) {
- Value* dest = M->getDest();
- TranslatePointerBitCasts(dest);
-
- if (deadPointers.count(dest)) {
- MD.removeInstruction(M);
-
- // DCE instructions only used to calculate that memcpy
- if (Instruction* D = dyn_cast<Instruction>(M->getRawSource()))
- possiblyDead.insert(D);
- if (Instruction* D = dyn_cast<Instruction>(M->getLength()))
- possiblyDead.insert(D);
- if (Instruction* D = dyn_cast<Instruction>(M->getRawDest()))
- possiblyDead.insert(D);
-
- BBI++;
- M->eraseFromParent();
- NumFastOther++;
- MadeChange = true;
-
- continue;
- }
-
- // Because a memcpy is also a load, we can't skip it if we didn't remove it
- }
-
- Value* killPointer = 0;
- uint64_t killPointerSize = ~0UL;
-
- // If we encounter a use of the pointer, it is no longer considered dead
- if (LoadInst* L = dyn_cast<LoadInst>(BBI)) {
- // However, if this load is unused and not volatile, we can go ahead and remove it,
- // and not have to worry about it making our pointer undead!
- if (L->use_empty() && !L->isVolatile()) {
- MD.removeInstruction(L);
-
- // DCE instructions only used to calculate that load
- if (Instruction* D = dyn_cast<Instruction>(L->getPointerOperand()))
- possiblyDead.insert(D);
-
- BBI++;
- L->eraseFromParent();
- NumFastOther++;
- MadeChange = true;
- possiblyDead.remove(L);
-
- continue;
- }
-
- killPointer = L->getPointerOperand();
- } else if (VAArgInst* V = dyn_cast<VAArgInst>(BBI)) {
- killPointer = V->getOperand(0);
- } else if (isa<MemCpyInst>(BBI) &&
- isa<ConstantInt>(cast<MemCpyInst>(BBI)->getLength())) {
- killPointer = cast<MemCpyInst>(BBI)->getSource();
- killPointerSize = cast<ConstantInt>(
- cast<MemCpyInst>(BBI)->getLength())->getZExtValue();
- } else if (AllocaInst* A = dyn_cast<AllocaInst>(BBI)) {
- deadPointers.erase(A);
-
- // Dead alloca's can be DCE'd when we reach them
- if (A->use_empty()) {
- MD.removeInstruction(A);
-
- // DCE instructions only used to calculate that load
- if (Instruction* D = dyn_cast<Instruction>(A->getArraySize()))
- possiblyDead.insert(D);
-
- BBI++;
- A->eraseFromParent();
- NumFastOther++;
- MadeChange = true;
- possiblyDead.remove(A);
- }
-
- continue;
- } else if (CallSite::get(BBI).getInstruction() != 0) {
- // If this call does not access memory, it can't
- // be undeadifying any of our pointers.
- CallSite CS = CallSite::get(BBI);
- if (AA.doesNotAccessMemory(CS))
- continue;
-
- unsigned modRef = 0;
- unsigned other = 0;
-
- // Remove any pointers made undead by the call from the dead set
- std::vector<Value*> dead;
- for (SmallPtrSet<Value*, 64>::iterator I = deadPointers.begin(),
- E = deadPointers.end(); I != E; ++I) {
- // HACK: if we detect that our AA is imprecise, it's not
- // worth it to scan the rest of the deadPointers set. Just
- // assume that the AA will return ModRef for everything, and
- // go ahead and bail.
- if (modRef >= 16 && other == 0) {
- deadPointers.clear();
- return MadeChange;
- }
-
- // Get size information for the alloca
- unsigned pointerSize = ~0U;
- if (AllocaInst* A = dyn_cast<AllocaInst>(*I)) {
- if (ConstantInt* C = dyn_cast<ConstantInt>(A->getArraySize()))
- pointerSize = C->getZExtValue() * \
- TD.getABITypeSize(A->getAllocatedType());
- } else {
- const PointerType* PT = cast<PointerType>(
- cast<Argument>(*I)->getType());
- pointerSize = TD.getABITypeSize(PT->getElementType());
- }
-
- // See if the call site touches it
- AliasAnalysis::ModRefResult A = AA.getModRefInfo(CS, *I, pointerSize);
-
- if (A == AliasAnalysis::ModRef)
- modRef++;
- else
- other++;
-
- if (A == AliasAnalysis::ModRef || A == AliasAnalysis::Ref)
- dead.push_back(*I);
- }
-
- for (std::vector<Value*>::iterator I = dead.begin(), E = dead.end();
- I != E; ++I)
- deadPointers.erase(*I);
-
- continue;
- } else {
- // For any non-memory-affecting non-terminators, DCE them as we reach them
- Instruction *CI = BBI;
- if (!CI->isTerminator() && CI->use_empty() && !isa<FreeInst>(CI)) {
-
- // DCE instructions only used to calculate that load
- for (Instruction::op_iterator OI = CI->op_begin(), OE = CI->op_end();
- OI != OE; ++OI)
- if (Instruction* D = dyn_cast<Instruction>(OI))
- possiblyDead.insert(D);
-
- BBI++;
- CI->eraseFromParent();
- NumFastOther++;
- MadeChange = true;
- possiblyDead.remove(CI);
-
- continue;
- }
- }
-
- if (!killPointer)
- continue;
-
- TranslatePointerBitCasts(killPointer);
-
- // Deal with undead pointers
- MadeChange |= RemoveUndeadPointers(killPointer, killPointerSize, BBI,
- deadPointers, possiblyDead);
- }
-
- return MadeChange;
-}
-
-/// RemoveUndeadPointers - check for uses of a pointer that make it
-/// undead when scanning for dead stores to alloca's.
-bool DSE::RemoveUndeadPointers(Value* killPointer, uint64_t killPointerSize,
- BasicBlock::iterator& BBI,
- SmallPtrSet<Value*, 64>& deadPointers,
- SetVector<Instruction*>& possiblyDead) {
- TargetData &TD = getAnalysis<TargetData>();
- AliasAnalysis &AA = getAnalysis<AliasAnalysis>();
- MemoryDependenceAnalysis& MD = getAnalysis<MemoryDependenceAnalysis>();
-
- // If the kill pointer can be easily reduced to an alloca,
- // don't bother doing extraneous AA queries
- if (deadPointers.count(killPointer)) {
- deadPointers.erase(killPointer);
- return false;
- } else if (isa<GlobalValue>(killPointer)) {
- // A global can't be in the dead pointer set
- return false;
- }
-
- bool MadeChange = false;
-
- std::vector<Value*> undead;
-
- for (SmallPtrSet<Value*, 64>::iterator I = deadPointers.begin(),
- E = deadPointers.end(); I != E; ++I) {
- // Get size information for the alloca
- unsigned pointerSize = ~0U;
- if (AllocaInst* A = dyn_cast<AllocaInst>(*I)) {
- if (ConstantInt* C = dyn_cast<ConstantInt>(A->getArraySize()))
- pointerSize = C->getZExtValue() * \
- TD.getABITypeSize(A->getAllocatedType());
- } else {
- const PointerType* PT = cast<PointerType>(
- cast<Argument>(*I)->getType());
- pointerSize = TD.getABITypeSize(PT->getElementType());
- }
-
- // See if this pointer could alias it
- AliasAnalysis::AliasResult A = AA.alias(*I, pointerSize,
- killPointer, killPointerSize);
-
- // If it must-alias and a store, we can delete it
- if (isa<StoreInst>(BBI) && A == AliasAnalysis::MustAlias) {
- StoreInst* S = cast<StoreInst>(BBI);
-
- // Remove it!
- MD.removeInstruction(S);
-
- // DCE instructions only used to calculate that store
- if (Instruction* D = dyn_cast<Instruction>(S->getOperand(0)))
- possiblyDead.insert(D);
- if (Instruction* D = dyn_cast<Instruction>(S->getOperand(1)))
- possiblyDead.insert(D);
-
- BBI++;
- S->eraseFromParent();
- NumFastStores++;
- MadeChange = true;
-
- continue;
-
- // Otherwise, it is undead
- } else if (A != AliasAnalysis::NoAlias)
- undead.push_back(*I);
- }
-
- for (std::vector<Value*>::iterator I = undead.begin(), E = undead.end();
- I != E; ++I)
- deadPointers.erase(*I);
-
- return MadeChange;
-}
-
-/// DeleteDeadInstructionChains - takes an instruction and a setvector of
-/// dead instructions. If I is dead, it is erased, and its operands are
-/// checked for deadness. If they are dead, they are added to the dead
-/// setvector.
-void DSE::DeleteDeadInstructionChains(Instruction *I,
- SetVector<Instruction*> &DeadInsts) {
- // Instruction must be dead.
- if (!I->use_empty() || !isInstructionTriviallyDead(I)) return;
-
- // Let the memory dependence know
- getAnalysis<MemoryDependenceAnalysis>().removeInstruction(I);
-
- // See if this made any operands dead. We do it this way in case the
- // instruction uses the same operand twice. We don't want to delete a
- // value then reference it.
- for (unsigned i = 0, e = I->getNumOperands(); i != e; ++i) {
- if (I->getOperand(i)->hasOneUse())
- if (Instruction* Op = dyn_cast<Instruction>(I->getOperand(i)))
- DeadInsts.insert(Op); // Attempt to nuke it later.
-
- I->setOperand(i, 0); // Drop from the operand list.
- }
-
- I->eraseFromParent();
- ++NumFastOther;
-}
diff --git a/release_23/lib/Transforms/Scalar/GCSE.cpp b/release_23/lib/Transforms/Scalar/GCSE.cpp
deleted file mode 100644
index 39a1b2572580..000000000000
--- a/release_23/lib/Transforms/Scalar/GCSE.cpp
+++ /dev/null
@@ -1,201 +0,0 @@
-//===-- GCSE.cpp - SSA-based Global Common Subexpression Elimination ------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This pass is designed to be a very quick global transformation that
-// eliminates global common subexpressions from a function. It does this by
-// using an existing value numbering implementation to identify the common
-// subexpressions, eliminating them when possible.
-//
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "gcse"
-#include "llvm/Transforms/Scalar.h"
-#include "llvm/Instructions.h"
-#include "llvm/Function.h"
-#include "llvm/Type.h"
-#include "llvm/Analysis/ConstantFolding.h"
-#include "llvm/Analysis/Dominators.h"
-#include "llvm/Analysis/ValueNumbering.h"
-#include "llvm/ADT/DepthFirstIterator.h"
-#include "llvm/ADT/Statistic.h"
-#include "llvm/Support/Compiler.h"
-#include <algorithm>
-using namespace llvm;
-
-STATISTIC(NumInstRemoved, "Number of instructions removed");
-STATISTIC(NumLoadRemoved, "Number of loads removed");
-STATISTIC(NumCallRemoved, "Number of calls removed");
-STATISTIC(NumNonInsts , "Number of instructions removed due "
- "to non-instruction values");
-STATISTIC(NumArgsRepl , "Number of function arguments replaced "
- "with constant values");
-namespace {
- struct VISIBILITY_HIDDEN GCSE : public FunctionPass {
- static char ID; // Pass identification, replacement for typeid
- GCSE() : FunctionPass((intptr_t)&ID) {}
-
- virtual bool runOnFunction(Function &F);
-
- private:
- void ReplaceInstructionWith(Instruction *I, Value *V);
-
- // This transformation requires dominator and immediate dominator info
- virtual void getAnalysisUsage(AnalysisUsage &AU) const {
- AU.setPreservesCFG();
- AU.addRequired<DominatorTree>();
- AU.addRequired<ValueNumbering>();
- }
- };
-
- char GCSE::ID = 0;
- RegisterPass<GCSE> X("gcse", "Global Common Subexpression Elimination");
-}
-
-// createGCSEPass - The public interface to this file...
-FunctionPass *llvm::createGCSEPass() { return new GCSE(); }
-
-// GCSE::runOnFunction - This is the main transformation entry point for a
-// function.
-//
-bool GCSE::runOnFunction(Function &F) {
- bool Changed = false;
-
- // Get pointers to the analysis results that we will be using...
- DominatorTree &DT = getAnalysis<DominatorTree>();
- ValueNumbering &VN = getAnalysis<ValueNumbering>();
-
- std::vector<Value*> EqualValues;
-
- // Check for value numbers of arguments. If the value numbering
- // implementation can prove that an incoming argument is a constant or global
- // value address, substitute it, making the argument dead.
- for (Function::arg_iterator AI = F.arg_begin(), E = F.arg_end(); AI != E;++AI)
- if (!AI->use_empty()) {
- VN.getEqualNumberNodes(AI, EqualValues);
- if (!EqualValues.empty()) {
- for (unsigned i = 0, e = EqualValues.size(); i != e; ++i)
- if (isa<Constant>(EqualValues[i])) {
- AI->replaceAllUsesWith(EqualValues[i]);
- ++NumArgsRepl;
- Changed = true;
- break;
- }
- EqualValues.clear();
- }
- }
-
- // Traverse the CFG of the function in dominator order, so that we see each
- // instruction after we see its operands.
- for (df_iterator<DomTreeNode*> DI = df_begin(DT.getRootNode()),
- E = df_end(DT.getRootNode()); DI != E; ++DI) {
- BasicBlock *BB = DI->getBlock();
-
- // Remember which instructions we've seen in this basic block as we scan.
- std::set<Instruction*> BlockInsts;
-
- for (BasicBlock::iterator I = BB->begin(), E = BB->end(); I != E; ) {
- Instruction *Inst = I++;
-
- if (Constant *C = ConstantFoldInstruction(Inst)) {
- ReplaceInstructionWith(Inst, C);
- } else if (Inst->getType() != Type::VoidTy) {
- // If this instruction computes a value, try to fold together common
- // instructions that compute it.
- //
- VN.getEqualNumberNodes(Inst, EqualValues);
-
- // If this instruction computes a value that is already computed
- // elsewhere, try to recycle the old value.
- if (!EqualValues.empty()) {
- if (Inst == &*BB->begin())
- I = BB->end();
- else {
- I = Inst; --I;
- }
-
- // First check to see if we were able to value number this instruction
- // to a non-instruction value. If so, prefer that value over other
- // instructions which may compute the same thing.
- for (unsigned i = 0, e = EqualValues.size(); i != e; ++i)
- if (!isa<Instruction>(EqualValues[i])) {
- ++NumNonInsts; // Keep track of # of insts repl with values
-
- // Change all users of Inst to use the replacement and remove it
- // from the program.
- ReplaceInstructionWith(Inst, EqualValues[i]);
- Inst = 0;
- EqualValues.clear(); // don't enter the next loop
- break;
- }
-
- // If there were no non-instruction values that this instruction
- // produces, find a dominating instruction that produces the same
- // value. If we find one, use it's value instead of ours.
- for (unsigned i = 0, e = EqualValues.size(); i != e; ++i) {
- Instruction *OtherI = cast<Instruction>(EqualValues[i]);
- bool Dominates = false;
- if (OtherI->getParent() == BB)
- Dominates = BlockInsts.count(OtherI);
- else
- Dominates = DT.dominates(OtherI->getParent(), BB);
-
- if (Dominates) {
- // Okay, we found an instruction with the same value as this one
- // and that dominates this one. Replace this instruction with the
- // specified one.
- ReplaceInstructionWith(Inst, OtherI);
- Inst = 0;
- break;
- }
- }
-
- EqualValues.clear();
-
- if (Inst) {
- I = Inst; ++I; // Deleted no instructions
- } else if (I == BB->end()) { // Deleted first instruction
- I = BB->begin();
- } else { // Deleted inst in middle of block.
- ++I;
- }
- }
-
- if (Inst)
- BlockInsts.insert(Inst);
- }
- }
- }
-
- // When the worklist is empty, return whether or not we changed anything...
- return Changed;
-}
-
-
-void GCSE::ReplaceInstructionWith(Instruction *I, Value *V) {
- if (isa<LoadInst>(I))
- ++NumLoadRemoved; // Keep track of loads eliminated
- if (isa<CallInst>(I))
- ++NumCallRemoved; // Keep track of calls eliminated
- ++NumInstRemoved; // Keep track of number of insts eliminated
-
- // Update value numbering
- getAnalysis<ValueNumbering>().deleteValue(I);
-
- I->replaceAllUsesWith(V);
-
- if (InvokeInst *II = dyn_cast<InvokeInst>(I)) {
- // Removing an invoke instruction requires adding a branch to the normal
- // destination and removing PHI node entries in the exception destination.
- BranchInst::Create(II->getNormalDest(), II);
- II->getUnwindDest()->removePredecessor(II->getParent());
- }
-
- // Erase the instruction from the program.
- I->getParent()->getInstList().erase(I);
-}
diff --git a/release_23/lib/Transforms/Scalar/GVN.cpp b/release_23/lib/Transforms/Scalar/GVN.cpp
deleted file mode 100644
index c482aae96c85..000000000000
--- a/release_23/lib/Transforms/Scalar/GVN.cpp
+++ /dev/null
@@ -1,1121 +0,0 @@
-//===- GVN.cpp - Eliminate redundant values and loads ------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This pass performs global value numbering to eliminate fully redundant
-// instructions. It also performs simple dead load elimination.
-//
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "gvn"
-#include "llvm/Transforms/Scalar.h"
-#include "llvm/BasicBlock.h"
-#include "llvm/Constants.h"
-#include "llvm/DerivedTypes.h"
-#include "llvm/Function.h"
-#include "llvm/Instructions.h"
-#include "llvm/Value.h"
-#include "llvm/ADT/DenseMap.h"
-#include "llvm/ADT/DepthFirstIterator.h"
-#include "llvm/ADT/SmallPtrSet.h"
-#include "llvm/ADT/SmallVector.h"
-#include "llvm/ADT/SparseBitVector.h"
-#include "llvm/ADT/Statistic.h"
-#include "llvm/Analysis/Dominators.h"
-#include "llvm/Analysis/AliasAnalysis.h"
-#include "llvm/Analysis/MemoryDependenceAnalysis.h"
-#include "llvm/Support/CFG.h"
-#include "llvm/Support/Compiler.h"
-#include "llvm/Support/Debug.h"
-#include <list>
-using namespace llvm;
-
-STATISTIC(NumGVNInstr, "Number of instructions deleted");
-STATISTIC(NumGVNLoad, "Number of loads deleted");
-
-//===----------------------------------------------------------------------===//
-// ValueTable Class
-//===----------------------------------------------------------------------===//
-
-/// This class holds the mapping between values and value numbers. It is used
-/// as an efficient mechanism to determine the expression-wise equivalence of
-/// two values.
-namespace {
- struct VISIBILITY_HIDDEN Expression {
- enum ExpressionOpcode { ADD, SUB, MUL, UDIV, SDIV, FDIV, UREM, SREM,
- FREM, SHL, LSHR, ASHR, AND, OR, XOR, ICMPEQ,
- ICMPNE, ICMPUGT, ICMPUGE, ICMPULT, ICMPULE,
- ICMPSGT, ICMPSGE, ICMPSLT, ICMPSLE, FCMPOEQ,
- FCMPOGT, FCMPOGE, FCMPOLT, FCMPOLE, FCMPONE,
- FCMPORD, FCMPUNO, FCMPUEQ, FCMPUGT, FCMPUGE,
- FCMPULT, FCMPULE, FCMPUNE, EXTRACT, INSERT,
- SHUFFLE, SELECT, TRUNC, ZEXT, SEXT, FPTOUI,
- FPTOSI, UITOFP, SITOFP, FPTRUNC, FPEXT,
- PTRTOINT, INTTOPTR, BITCAST, GEP, CALL, EMPTY,
- TOMBSTONE };
-
- ExpressionOpcode opcode;
- const Type* type;
- uint32_t firstVN;
- uint32_t secondVN;
- uint32_t thirdVN;
- SmallVector<uint32_t, 4> varargs;
- Value* function;
-
- Expression() { }
- Expression(ExpressionOpcode o) : opcode(o) { }
-
- bool operator==(const Expression &other) const {
- if (opcode != other.opcode)
- return false;
- else if (opcode == EMPTY || opcode == TOMBSTONE)
- return true;
- else if (type != other.type)
- return false;
- else if (function != other.function)
- return false;
- else if (firstVN != other.firstVN)
- return false;
- else if (secondVN != other.secondVN)
- return false;
- else if (thirdVN != other.thirdVN)
- return false;
- else {
- if (varargs.size() != other.varargs.size())
- return false;
-
- for (size_t i = 0; i < varargs.size(); ++i)
- if (varargs[i] != other.varargs[i])
- return false;
-
- return true;
- }
- }
-
- bool operator!=(const Expression &other) const {
- if (opcode != other.opcode)
- return true;
- else if (opcode == EMPTY || opcode == TOMBSTONE)
- return false;
- else if (type != other.type)
- return true;
- else if (function != other.function)
- return true;
- else if (firstVN != other.firstVN)
- return true;
- else if (secondVN != other.secondVN)
- return true;
- else if (thirdVN != other.thirdVN)
- return true;
- else {
- if (varargs.size() != other.varargs.size())
- return true;
-
- for (size_t i = 0; i < varargs.size(); ++i)
- if (varargs[i] != other.varargs[i])
- return true;
-
- return false;
- }
- }
- };
-
- class VISIBILITY_HIDDEN ValueTable {
- private:
- DenseMap<Value*, uint32_t> valueNumbering;
- DenseMap<Expression, uint32_t> expressionNumbering;
- AliasAnalysis* AA;
- MemoryDependenceAnalysis* MD;
-
- uint32_t nextValueNumber;
-
- Expression::ExpressionOpcode getOpcode(BinaryOperator* BO);
- Expression::ExpressionOpcode getOpcode(CmpInst* C);
- Expression::ExpressionOpcode getOpcode(CastInst* C);
- Expression create_expression(BinaryOperator* BO);
- Expression create_expression(CmpInst* C);
- Expression create_expression(ShuffleVectorInst* V);
- Expression create_expression(ExtractElementInst* C);
- Expression create_expression(InsertElementInst* V);
- Expression create_expression(SelectInst* V);
- Expression create_expression(CastInst* C);
- Expression create_expression(GetElementPtrInst* G);
- Expression create_expression(CallInst* C);
- public:
- ValueTable() : nextValueNumber(1) { }
- uint32_t lookup_or_add(Value* V);
- uint32_t lookup(Value* V) const;
- void add(Value* V, uint32_t num);
- void clear();
- void erase(Value* v);
- unsigned size();
- void setAliasAnalysis(AliasAnalysis* A) { AA = A; }
- void setMemDep(MemoryDependenceAnalysis* M) { MD = M; }
- };
-}
-
-namespace llvm {
-template <> struct DenseMapInfo<Expression> {
- static inline Expression getEmptyKey() {
- return Expression(Expression::EMPTY);
- }
-
- static inline Expression getTombstoneKey() {
- return Expression(Expression::TOMBSTONE);
- }
-
- static unsigned getHashValue(const Expression e) {
- unsigned hash = e.opcode;
-
- hash = e.firstVN + hash * 37;
- hash = e.secondVN + hash * 37;
- hash = e.thirdVN + hash * 37;
-
- hash = ((unsigned)((uintptr_t)e.type >> 4) ^
- (unsigned)((uintptr_t)e.type >> 9)) +
- hash * 37;
-
- for (SmallVector<uint32_t, 4>::const_iterator I = e.varargs.begin(),
- E = e.varargs.end(); I != E; ++I)
- hash = *I + hash * 37;
-
- hash = ((unsigned)((uintptr_t)e.function >> 4) ^
- (unsigned)((uintptr_t)e.function >> 9)) +
- hash * 37;
-
- return hash;
- }
- static bool isEqual(const Expression &LHS, const Expression &RHS) {
- return LHS == RHS;
- }
- static bool isPod() { return true; }
-};
-}
-
-//===----------------------------------------------------------------------===//
-// ValueTable Internal Functions
-//===----------------------------------------------------------------------===//
-Expression::ExpressionOpcode ValueTable::getOpcode(BinaryOperator* BO) {
- switch(BO->getOpcode()) {
- default: // THIS SHOULD NEVER HAPPEN
- assert(0 && "Binary operator with unknown opcode?");
- case Instruction::Add: return Expression::ADD;
- case Instruction::Sub: return Expression::SUB;
- case Instruction::Mul: return Expression::MUL;
- case Instruction::UDiv: return Expression::UDIV;
- case Instruction::SDiv: return Expression::SDIV;
- case Instruction::FDiv: return Expression::FDIV;
- case Instruction::URem: return Expression::UREM;
- case Instruction::SRem: return Expression::SREM;
- case Instruction::FRem: return Expression::FREM;
- case Instruction::Shl: return Expression::SHL;
- case Instruction::LShr: return Expression::LSHR;
- case Instruction::AShr: return Expression::ASHR;
- case Instruction::And: return Expression::AND;
- case Instruction::Or: return Expression::OR;
- case Instruction::Xor: return Expression::XOR;
- }
-}
-
-Expression::ExpressionOpcode ValueTable::getOpcode(CmpInst* C) {
- if (isa<ICmpInst>(C)) {
- switch (C->getPredicate()) {
- default: // THIS SHOULD NEVER HAPPEN
- assert(0 && "Comparison with unknown predicate?");
- case ICmpInst::ICMP_EQ: return Expression::ICMPEQ;
- case ICmpInst::ICMP_NE: return Expression::ICMPNE;
- case ICmpInst::ICMP_UGT: return Expression::ICMPUGT;
- case ICmpInst::ICMP_UGE: return Expression::ICMPUGE;
- case ICmpInst::ICMP_ULT: return Expression::ICMPULT;
- case ICmpInst::ICMP_ULE: return Expression::ICMPULE;
- case ICmpInst::ICMP_SGT: return Expression::ICMPSGT;
- case ICmpInst::ICMP_SGE: return Expression::ICMPSGE;
- case ICmpInst::ICMP_SLT: return Expression::ICMPSLT;
- case ICmpInst::ICMP_SLE: return Expression::ICMPSLE;
- }
- }
- assert(isa<FCmpInst>(C) && "Unknown compare");
- switch (C->getPredicate()) {
- default: // THIS SHOULD NEVER HAPPEN
- assert(0 && "Comparison with unknown predicate?");
- case FCmpInst::FCMP_OEQ: return Expression::FCMPOEQ;
- case FCmpInst::FCMP_OGT: return Expression::FCMPOGT;
- case FCmpInst::FCMP_OGE: return Expression::FCMPOGE;
- case FCmpInst::FCMP_OLT: return Expression::FCMPOLT;
- case FCmpInst::FCMP_OLE: return Expression::FCMPOLE;
- case FCmpInst::FCMP_ONE: return Expression::FCMPONE;
- case FCmpInst::FCMP_ORD: return Expression::FCMPORD;
- case FCmpInst::FCMP_UNO: return Expression::FCMPUNO;
- case FCmpInst::FCMP_UEQ: return Expression::FCMPUEQ;
- case FCmpInst::FCMP_UGT: return Expression::FCMPUGT;
- case FCmpInst::FCMP_UGE: return Expression::FCMPUGE;
- case FCmpInst::FCMP_ULT: return Expression::FCMPULT;
- case FCmpInst::FCMP_ULE: return Expression::FCMPULE;
- case FCmpInst::FCMP_UNE: return Expression::FCMPUNE;
- }
-}
-
-Expression::ExpressionOpcode ValueTable::getOpcode(CastInst* C) {
- switch(C->getOpcode()) {
- default: // THIS SHOULD NEVER HAPPEN
- assert(0 && "Cast operator with unknown opcode?");
- case Instruction::Trunc: return Expression::TRUNC;
- case Instruction::ZExt: return Expression::ZEXT;
- case Instruction::SExt: return Expression::SEXT;
- case Instruction::FPToUI: return Expression::FPTOUI;
- case Instruction::FPToSI: return Expression::FPTOSI;
- case Instruction::UIToFP: return Expression::UITOFP;
- case Instruction::SIToFP: return Expression::SITOFP;
- case Instruction::FPTrunc: return Expression::FPTRUNC;
- case Instruction::FPExt: return Expression::FPEXT;
- case Instruction::PtrToInt: return Expression::PTRTOINT;
- case Instruction::IntToPtr: return Expression::INTTOPTR;
- case Instruction::BitCast: return Expression::BITCAST;
- }
-}
-
-Expression ValueTable::create_expression(CallInst* C) {
- Expression e;
-
- e.type = C->getType();
- e.firstVN = 0;
- e.secondVN = 0;
- e.thirdVN = 0;
- e.function = C->getCalledFunction();
- e.opcode = Expression::CALL;
-
- for (CallInst::op_iterator I = C->op_begin()+1, E = C->op_end();
- I != E; ++I)
- e.varargs.push_back(lookup_or_add(*I));
-
- return e;
-}
-
-Expression ValueTable::create_expression(BinaryOperator* BO) {
- Expression e;
-
- e.firstVN = lookup_or_add(BO->getOperand(0));
- e.secondVN = lookup_or_add(BO->getOperand(1));
- e.thirdVN = 0;
- e.function = 0;
- e.type = BO->getType();
- e.opcode = getOpcode(BO);
-
- return e;
-}
-
-Expression ValueTable::create_expression(CmpInst* C) {
- Expression e;
-
- e.firstVN = lookup_or_add(C->getOperand(0));
- e.secondVN = lookup_or_add(C->getOperand(1));
- e.thirdVN = 0;
- e.function = 0;
- e.type = C->getType();
- e.opcode = getOpcode(C);
-
- return e;
-}
-
-Expression ValueTable::create_expression(CastInst* C) {
- Expression e;
-
- e.firstVN = lookup_or_add(C->getOperand(0));
- e.secondVN = 0;
- e.thirdVN = 0;
- e.function = 0;
- e.type = C->getType();
- e.opcode = getOpcode(C);
-
- return e;
-}
-
-Expression ValueTable::create_expression(ShuffleVectorInst* S) {
- Expression e;
-
- e.firstVN = lookup_or_add(S->getOperand(0));
- e.secondVN = lookup_or_add(S->getOperand(1));
- e.thirdVN = lookup_or_add(S->getOperand(2));
- e.function = 0;
- e.type = S->getType();
- e.opcode = Expression::SHUFFLE;
-
- return e;
-}
-
-Expression ValueTable::create_expression(ExtractElementInst* E) {
- Expression e;
-
- e.firstVN = lookup_or_add(E->getOperand(0));
- e.secondVN = lookup_or_add(E->getOperand(1));
- e.thirdVN = 0;
- e.function = 0;
- e.type = E->getType();
- e.opcode = Expression::EXTRACT;
-
- return e;
-}
-
-Expression ValueTable::create_expression(InsertElementInst* I) {
- Expression e;
-
- e.firstVN = lookup_or_add(I->getOperand(0));
- e.secondVN = lookup_or_add(I->getOperand(1));
- e.thirdVN = lookup_or_add(I->getOperand(2));
- e.function = 0;
- e.type = I->getType();
- e.opcode = Expression::INSERT;
-
- return e;
-}
-
-Expression ValueTable::create_expression(SelectInst* I) {
- Expression e;
-
- e.firstVN = lookup_or_add(I->getCondition());
- e.secondVN = lookup_or_add(I->getTrueValue());
- e.thirdVN = lookup_or_add(I->getFalseValue());
- e.function = 0;
- e.type = I->getType();
- e.opcode = Expression::SELECT;
-
- return e;
-}
-
-Expression ValueTable::create_expression(GetElementPtrInst* G) {
- Expression e;
-
- e.firstVN = lookup_or_add(G->getPointerOperand());
- e.secondVN = 0;
- e.thirdVN = 0;
- e.function = 0;
- e.type = G->getType();
- e.opcode = Expression::GEP;
-
- for (GetElementPtrInst::op_iterator I = G->idx_begin(), E = G->idx_end();
- I != E; ++I)
- e.varargs.push_back(lookup_or_add(*I));
-
- return e;
-}
-
-//===----------------------------------------------------------------------===//
-// ValueTable External Functions
-//===----------------------------------------------------------------------===//
-
-/// lookup_or_add - Returns the value number for the specified value, assigning
-/// it a new number if it did not have one before.
-uint32_t ValueTable::lookup_or_add(Value* V) {
- DenseMap<Value*, uint32_t>::iterator VI = valueNumbering.find(V);
- if (VI != valueNumbering.end())
- return VI->second;
-
- if (CallInst* C = dyn_cast<CallInst>(V)) {
- if (AA->doesNotAccessMemory(C)) {
- Expression e = create_expression(C);
-
- DenseMap<Expression, uint32_t>::iterator EI = expressionNumbering.find(e);
- if (EI != expressionNumbering.end()) {
- valueNumbering.insert(std::make_pair(V, EI->second));
- return EI->second;
- } else {
- expressionNumbering.insert(std::make_pair(e, nextValueNumber));
- valueNumbering.insert(std::make_pair(V, nextValueNumber));
-
- return nextValueNumber++;
- }
- } else if (AA->onlyReadsMemory(C)) {
- Expression e = create_expression(C);
-
- Instruction* dep = MD->getDependency(C);
-
- if (dep == MemoryDependenceAnalysis::NonLocal ||
- !isa<CallInst>(dep)) {
- expressionNumbering.insert(std::make_pair(e, nextValueNumber));
- valueNumbering.insert(std::make_pair(V, nextValueNumber));
-
- return nextValueNumber++;
- }
-
- CallInst* cdep = cast<CallInst>(dep);
- Expression d_exp = create_expression(cdep);
-
- if (e != d_exp) {
- expressionNumbering.insert(std::make_pair(e, nextValueNumber));
- valueNumbering.insert(std::make_pair(V, nextValueNumber));
-
- return nextValueNumber++;
- } else {
- uint32_t v = expressionNumbering[d_exp];
- valueNumbering.insert(std::make_pair(V, v));
- return v;
- }
-
- } else {
- valueNumbering.insert(std::make_pair(V, nextValueNumber));
- return nextValueNumber++;
- }
- } else if (BinaryOperator* BO = dyn_cast<BinaryOperator>(V)) {
- Expression e = create_expression(BO);
-
- DenseMap<Expression, uint32_t>::iterator EI = expressionNumbering.find(e);
- if (EI != expressionNumbering.end()) {
- valueNumbering.insert(std::make_pair(V, EI->second));
- return EI->second;
- } else {
- expressionNumbering.insert(std::make_pair(e, nextValueNumber));
- valueNumbering.insert(std::make_pair(V, nextValueNumber));
-
- return nextValueNumber++;
- }
- } else if (CmpInst* C = dyn_cast<CmpInst>(V)) {
- Expression e = create_expression(C);
-
- DenseMap<Expression, uint32_t>::iterator EI = expressionNumbering.find(e);
- if (EI != expressionNumbering.end()) {
- valueNumbering.insert(std::make_pair(V, EI->second));
- return EI->second;
- } else {
- expressionNumbering.insert(std::make_pair(e, nextValueNumber));
- valueNumbering.insert(std::make_pair(V, nextValueNumber));
-
- return nextValueNumber++;
- }
- } else if (ShuffleVectorInst* U = dyn_cast<ShuffleVectorInst>(V)) {
- Expression e = create_expression(U);
-
- DenseMap<Expression, uint32_t>::iterator EI = expressionNumbering.find(e);
- if (EI != expressionNumbering.end()) {
- valueNumbering.insert(std::make_pair(V, EI->second));
- return EI->second;
- } else {
- expressionNumbering.insert(std::make_pair(e, nextValueNumber));
- valueNumbering.insert(std::make_pair(V, nextValueNumber));
-
- return nextValueNumber++;
- }
- } else if (ExtractElementInst* U = dyn_cast<ExtractElementInst>(V)) {
- Expression e = create_expression(U);
-
- DenseMap<Expression, uint32_t>::iterator EI = expressionNumbering.find(e);
- if (EI != expressionNumbering.end()) {
- valueNumbering.insert(std::make_pair(V, EI->second));
- return EI->second;
- } else {
- expressionNumbering.insert(std::make_pair(e, nextValueNumber));
- valueNumbering.insert(std::make_pair(V, nextValueNumber));
-
- return nextValueNumber++;
- }
- } else if (InsertElementInst* U = dyn_cast<InsertElementInst>(V)) {
- Expression e = create_expression(U);
-
- DenseMap<Expression, uint32_t>::iterator EI = expressionNumbering.find(e);
- if (EI != expressionNumbering.end()) {
- valueNumbering.insert(std::make_pair(V, EI->second));
- return EI->second;
- } else {
- expressionNumbering.insert(std::make_pair(e, nextValueNumber));
- valueNumbering.insert(std::make_pair(V, nextValueNumber));
-
- return nextValueNumber++;
- }
- } else if (SelectInst* U = dyn_cast<SelectInst>(V)) {
- Expression e = create_expression(U);
-
- DenseMap<Expression, uint32_t>::iterator EI = expressionNumbering.find(e);
- if (EI != expressionNumbering.end()) {
- valueNumbering.insert(std::make_pair(V, EI->second));
- return EI->second;
- } else {
- expressionNumbering.insert(std::make_pair(e, nextValueNumber));
- valueNumbering.insert(std::make_pair(V, nextValueNumber));
-
- return nextValueNumber++;
- }
- } else if (CastInst* U = dyn_cast<CastInst>(V)) {
- Expression e = create_expression(U);
-
- DenseMap<Expression, uint32_t>::iterator EI = expressionNumbering.find(e);
- if (EI != expressionNumbering.end()) {
- valueNumbering.insert(std::make_pair(V, EI->second));
- return EI->second;
- } else {
- expressionNumbering.insert(std::make_pair(e, nextValueNumber));
- valueNumbering.insert(std::make_pair(V, nextValueNumber));
-
- return nextValueNumber++;
- }
- } else if (GetElementPtrInst* U = dyn_cast<GetElementPtrInst>(V)) {
- Expression e = create_expression(U);
-
- DenseMap<Expression, uint32_t>::iterator EI = expressionNumbering.find(e);
- if (EI != expressionNumbering.end()) {
- valueNumbering.insert(std::make_pair(V, EI->second));
- return EI->second;
- } else {
- expressionNumbering.insert(std::make_pair(e, nextValueNumber));
- valueNumbering.insert(std::make_pair(V, nextValueNumber));
-
- return nextValueNumber++;
- }
- } else {
- valueNumbering.insert(std::make_pair(V, nextValueNumber));
- return nextValueNumber++;
- }
-}
-
-/// lookup - Returns the value number of the specified value. Fails if
-/// the value has not yet been numbered.
-uint32_t ValueTable::lookup(Value* V) const {
- DenseMap<Value*, uint32_t>::iterator VI = valueNumbering.find(V);
- assert(VI != valueNumbering.end() && "Value not numbered?");
- return VI->second;
-}
-
-/// clear - Remove all entries from the ValueTable
-void ValueTable::clear() {
- valueNumbering.clear();
- expressionNumbering.clear();
- nextValueNumber = 1;
-}
-
-/// erase - Remove a value from the value numbering
-void ValueTable::erase(Value* V) {
- valueNumbering.erase(V);
-}
-
-//===----------------------------------------------------------------------===//
-// ValueNumberedSet Class
-//===----------------------------------------------------------------------===//
-namespace {
-class VISIBILITY_HIDDEN ValueNumberedSet {
- private:
- SmallPtrSet<Value*, 8> contents;
- SparseBitVector<64> numbers;
- public:
- ValueNumberedSet() { }
- ValueNumberedSet(const ValueNumberedSet& other) {
- numbers = other.numbers;
- contents = other.contents;
- }
-
- typedef SmallPtrSet<Value*, 8>::iterator iterator;
-
- iterator begin() { return contents.begin(); }
- iterator end() { return contents.end(); }
-
- bool insert(Value* v) { return contents.insert(v); }
- void insert(iterator I, iterator E) { contents.insert(I, E); }
- void erase(Value* v) { contents.erase(v); }
- unsigned count(Value* v) { return contents.count(v); }
- size_t size() { return contents.size(); }
-
- void set(unsigned i) {
- numbers.set(i);
- }
-
- void operator=(const ValueNumberedSet& other) {
- contents = other.contents;
- numbers = other.numbers;
- }
-
- void reset(unsigned i) {
- numbers.reset(i);
- }
-
- bool test(unsigned i) {
- return numbers.test(i);
- }
-};
-}
-
-//===----------------------------------------------------------------------===//
-// GVN Pass
-//===----------------------------------------------------------------------===//
-
-namespace {
-
- class VISIBILITY_HIDDEN GVN : public FunctionPass {
- bool runOnFunction(Function &F);
- public:
- static char ID; // Pass identification, replacement for typeid
- GVN() : FunctionPass((intptr_t)&ID) { }
-
- private:
- ValueTable VN;
-
- DenseMap<BasicBlock*, ValueNumberedSet> availableOut;
-
- typedef DenseMap<Value*, SmallPtrSet<Instruction*, 4> > PhiMapType;
- PhiMapType phiMap;
-
-
- // This transformation requires dominator postdominator info
- virtual void getAnalysisUsage(AnalysisUsage &AU) const {
- AU.setPreservesCFG();
- AU.addRequired<DominatorTree>();
- AU.addRequired<MemoryDependenceAnalysis>();
- AU.addRequired<AliasAnalysis>();
- AU.addPreserved<AliasAnalysis>();
- AU.addPreserved<MemoryDependenceAnalysis>();
- }
-
- // Helper fuctions
- // FIXME: eliminate or document these better
- Value* find_leader(ValueNumberedSet& vals, uint32_t v) ;
- void val_insert(ValueNumberedSet& s, Value* v);
- bool processLoad(LoadInst* L,
- DenseMap<Value*, LoadInst*> &lastLoad,
- SmallVectorImpl<Instruction*> &toErase);
- bool processInstruction(Instruction* I,
- ValueNumberedSet& currAvail,
- DenseMap<Value*, LoadInst*>& lastSeenLoad,
- SmallVectorImpl<Instruction*> &toErase);
- bool processNonLocalLoad(LoadInst* L,
- SmallVectorImpl<Instruction*> &toErase);
- Value *GetValueForBlock(BasicBlock *BB, LoadInst* orig,
- DenseMap<BasicBlock*, Value*> &Phis,
- bool top_level = false);
- void dump(DenseMap<BasicBlock*, Value*>& d);
- bool iterateOnFunction(Function &F);
- Value* CollapsePhi(PHINode* p);
- bool isSafeReplacement(PHINode* p, Instruction* inst);
- };
-
- char GVN::ID = 0;
-}
-
-// createGVNPass - The public interface to this file...
-FunctionPass *llvm::createGVNPass() { return new GVN(); }
-
-static RegisterPass<GVN> X("gvn",
- "Global Value Numbering");
-
-/// find_leader - Given a set and a value number, return the first
-/// element of the set with that value number, or 0 if no such element
-/// is present
-Value* GVN::find_leader(ValueNumberedSet& vals, uint32_t v) {
- if (!vals.test(v))
- return 0;
-
- for (ValueNumberedSet::iterator I = vals.begin(), E = vals.end();
- I != E; ++I)
- if (v == VN.lookup(*I))
- return *I;
-
- assert(0 && "No leader found, but present bit is set?");
- return 0;
-}
-
-/// val_insert - Insert a value into a set only if there is not a value
-/// with the same value number already in the set
-void GVN::val_insert(ValueNumberedSet& s, Value* v) {
- uint32_t num = VN.lookup(v);
- if (!s.test(num))
- s.insert(v);
-}
-
-void GVN::dump(DenseMap<BasicBlock*, Value*>& d) {
- printf("{\n");
- for (DenseMap<BasicBlock*, Value*>::iterator I = d.begin(),
- E = d.end(); I != E; ++I) {
- if (I->second == MemoryDependenceAnalysis::None)
- printf("None\n");
- else
- I->second->dump();
- }
- printf("}\n");
-}
-
-Value* GVN::CollapsePhi(PHINode* p) {
- DominatorTree &DT = getAnalysis<DominatorTree>();
- Value* constVal = p->hasConstantValue();
-
- if (!constVal) return 0;
-
- Instruction* inst = dyn_cast<Instruction>(constVal);
- if (!inst)
- return constVal;
-
- if (DT.dominates(inst, p))
- if (isSafeReplacement(p, inst))
- return inst;
- return 0;
-}
-
-bool GVN::isSafeReplacement(PHINode* p, Instruction* inst) {
- if (!isa<PHINode>(inst))
- return true;
-
- for (Instruction::use_iterator UI = p->use_begin(), E = p->use_end();
- UI != E; ++UI)
- if (PHINode* use_phi = dyn_cast<PHINode>(UI))
- if (use_phi->getParent() == inst->getParent())
- return false;
-
- return true;
-}
-
-/// GetValueForBlock - Get the value to use within the specified basic block.
-/// available values are in Phis.
-Value *GVN::GetValueForBlock(BasicBlock *BB, LoadInst* orig,
- DenseMap<BasicBlock*, Value*> &Phis,
- bool top_level) {
-
- // If we have already computed this value, return the previously computed val.
- DenseMap<BasicBlock*, Value*>::iterator V = Phis.find(BB);
- if (V != Phis.end() && !top_level) return V->second;
-
- BasicBlock* singlePred = BB->getSinglePredecessor();
- if (singlePred) {
- Value *ret = GetValueForBlock(singlePred, orig, Phis);
- Phis[BB] = ret;
- return ret;
- }
-
- // Otherwise, the idom is the loop, so we need to insert a PHI node. Do so
- // now, then get values to fill in the incoming values for the PHI.
- PHINode *PN = PHINode::Create(orig->getType(), orig->getName()+".rle",
- BB->begin());
- PN->reserveOperandSpace(std::distance(pred_begin(BB), pred_end(BB)));
-
- if (Phis.count(BB) == 0)
- Phis.insert(std::make_pair(BB, PN));
-
- // Fill in the incoming values for the block.
- for (pred_iterator PI = pred_begin(BB), E = pred_end(BB); PI != E; ++PI) {
- Value* val = GetValueForBlock(*PI, orig, Phis);
- PN->addIncoming(val, *PI);
- }
-
- AliasAnalysis& AA = getAnalysis<AliasAnalysis>();
- AA.copyValue(orig, PN);
-
- // Attempt to collapse PHI nodes that are trivially redundant
- Value* v = CollapsePhi(PN);
- if (!v) {
- // Cache our phi construction results
- phiMap[orig->getPointerOperand()].insert(PN);
- return PN;
- }
-
- MemoryDependenceAnalysis& MD = getAnalysis<MemoryDependenceAnalysis>();
-
- MD.removeInstruction(PN);
- PN->replaceAllUsesWith(v);
-
- for (DenseMap<BasicBlock*, Value*>::iterator I = Phis.begin(),
- E = Phis.end(); I != E; ++I)
- if (I->second == PN)
- I->second = v;
-
- PN->eraseFromParent();
-
- Phis[BB] = v;
- return v;
-}
-
-/// processNonLocalLoad - Attempt to eliminate a load whose dependencies are
-/// non-local by performing PHI construction.
-bool GVN::processNonLocalLoad(LoadInst* L,
- SmallVectorImpl<Instruction*> &toErase) {
- MemoryDependenceAnalysis& MD = getAnalysis<MemoryDependenceAnalysis>();
-
- // Find the non-local dependencies of the load
- DenseMap<BasicBlock*, Value*> deps;
- MD.getNonLocalDependency(L, deps);
-
- DenseMap<BasicBlock*, Value*> repl;
-
- // Filter out useless results (non-locals, etc)
- for (DenseMap<BasicBlock*, Value*>::iterator I = deps.begin(), E = deps.end();
- I != E; ++I) {
- if (I->second == MemoryDependenceAnalysis::None)
- return false;
-
- if (I->second == MemoryDependenceAnalysis::NonLocal)
- continue;
-
- if (StoreInst* S = dyn_cast<StoreInst>(I->second)) {
- if (S->getPointerOperand() != L->getPointerOperand())
- return false;
- repl[I->first] = S->getOperand(0);
- } else if (LoadInst* LD = dyn_cast<LoadInst>(I->second)) {
- if (LD->getPointerOperand() != L->getPointerOperand())
- return false;
- repl[I->first] = LD;
- } else {
- return false;
- }
- }
-
- // Use cached PHI construction information from previous runs
- SmallPtrSet<Instruction*, 4>& p = phiMap[L->getPointerOperand()];
- for (SmallPtrSet<Instruction*, 4>::iterator I = p.begin(), E = p.end();
- I != E; ++I) {
- if ((*I)->getParent() == L->getParent()) {
- MD.removeInstruction(L);
- L->replaceAllUsesWith(*I);
- toErase.push_back(L);
- NumGVNLoad++;
- return true;
- }
-
- repl.insert(std::make_pair((*I)->getParent(), *I));
- }
-
- // Perform PHI construction
- SmallPtrSet<BasicBlock*, 4> visited;
- Value* v = GetValueForBlock(L->getParent(), L, repl, true);
-
- MD.removeInstruction(L);
- L->replaceAllUsesWith(v);
- toErase.push_back(L);
- NumGVNLoad++;
-
- return true;
-}
-
-/// processLoad - Attempt to eliminate a load, first by eliminating it
-/// locally, and then attempting non-local elimination if that fails.
-bool GVN::processLoad(LoadInst *L, DenseMap<Value*, LoadInst*> &lastLoad,
- SmallVectorImpl<Instruction*> &toErase) {
- if (L->isVolatile()) {
- lastLoad[L->getPointerOperand()] = L;
- return false;
- }
-
- Value* pointer = L->getPointerOperand();
- LoadInst*& last = lastLoad[pointer];
-
- // ... to a pointer that has been loaded from before...
- MemoryDependenceAnalysis& MD = getAnalysis<MemoryDependenceAnalysis>();
- bool removedNonLocal = false;
- Instruction* dep = MD.getDependency(L);
- if (dep == MemoryDependenceAnalysis::NonLocal &&
- L->getParent() != &L->getParent()->getParent()->getEntryBlock()) {
- removedNonLocal = processNonLocalLoad(L, toErase);
-
- if (!removedNonLocal)
- last = L;
-
- return removedNonLocal;
- }
-
-
- bool deletedLoad = false;
-
- // Walk up the dependency chain until we either find
- // a dependency we can use, or we can't walk any further
- while (dep != MemoryDependenceAnalysis::None &&
- dep != MemoryDependenceAnalysis::NonLocal &&
- (isa<LoadInst>(dep) || isa<StoreInst>(dep))) {
- // ... that depends on a store ...
- if (StoreInst* S = dyn_cast<StoreInst>(dep)) {
- if (S->getPointerOperand() == pointer) {
- // Remove it!
- MD.removeInstruction(L);
-
- L->replaceAllUsesWith(S->getOperand(0));
- toErase.push_back(L);
- deletedLoad = true;
- NumGVNLoad++;
- }
-
- // Whether we removed it or not, we can't
- // go any further
- break;
- } else if (!last) {
- // If we don't depend on a store, and we haven't
- // been loaded before, bail.
- break;
- } else if (dep == last) {
- // Remove it!
- MD.removeInstruction(L);
-
- L->replaceAllUsesWith(last);
- toErase.push_back(L);
- deletedLoad = true;
- NumGVNLoad++;
-
- break;
- } else {
- dep = MD.getDependency(L, dep);
- }
- }
-
- if (dep != MemoryDependenceAnalysis::None &&
- dep != MemoryDependenceAnalysis::NonLocal &&
- isa<AllocationInst>(dep)) {
- // Check that this load is actually from the
- // allocation we found
- Value* v = L->getOperand(0);
- while (true) {
- if (BitCastInst *BC = dyn_cast<BitCastInst>(v))
- v = BC->getOperand(0);
- else if (GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(v))
- v = GEP->getOperand(0);
- else
- break;
- }
- if (v == dep) {
- // If this load depends directly on an allocation, there isn't
- // anything stored there; therefore, we can optimize this load
- // to undef.
- MD.removeInstruction(L);
-
- L->replaceAllUsesWith(UndefValue::get(L->getType()));
- toErase.push_back(L);
- deletedLoad = true;
- NumGVNLoad++;
- }
- }
-
- if (!deletedLoad)
- last = L;
-
- return deletedLoad;
-}
-
-/// processInstruction - When calculating availability, handle an instruction
-/// by inserting it into the appropriate sets
-bool GVN::processInstruction(Instruction *I, ValueNumberedSet &currAvail,
- DenseMap<Value*, LoadInst*> &lastSeenLoad,
- SmallVectorImpl<Instruction*> &toErase) {
- if (LoadInst* L = dyn_cast<LoadInst>(I))
- return processLoad(L, lastSeenLoad, toErase);
-
- // Allocations are always uniquely numbered, so we can save time and memory
- // by fast failing them.
- if (isa<AllocationInst>(I))
- return false;
-
- unsigned num = VN.lookup_or_add(I);
-
- // Collapse PHI nodes
- if (PHINode* p = dyn_cast<PHINode>(I)) {
- Value* constVal = CollapsePhi(p);
-
- if (constVal) {
- for (PhiMapType::iterator PI = phiMap.begin(), PE = phiMap.end();
- PI != PE; ++PI)
- if (PI->second.count(p))
- PI->second.erase(p);
-
- p->replaceAllUsesWith(constVal);
- toErase.push_back(p);
- }
- // Perform value-number based elimination
- } else if (currAvail.test(num)) {
- Value* repl = find_leader(currAvail, num);
-
- // Remove it!
- MemoryDependenceAnalysis& MD = getAnalysis<MemoryDependenceAnalysis>();
- MD.removeInstruction(I);
-
- VN.erase(I);
- I->replaceAllUsesWith(repl);
- toErase.push_back(I);
- return true;
- } else if (!I->isTerminator()) {
- currAvail.set(num);
- currAvail.insert(I);
- }
-
- return false;
-}
-
-// GVN::runOnFunction - This is the main transformation entry point for a
-// function.
-//
-bool GVN::runOnFunction(Function& F) {
- VN.setAliasAnalysis(&getAnalysis<AliasAnalysis>());
- VN.setMemDep(&getAnalysis<MemoryDependenceAnalysis>());
-
- bool changed = false;
- bool shouldContinue = true;
-
- while (shouldContinue) {
- shouldContinue = iterateOnFunction(F);
- changed |= shouldContinue;
- }
-
- return changed;
-}
-
-
-// GVN::iterateOnFunction - Executes one iteration of GVN
-bool GVN::iterateOnFunction(Function &F) {
- // Clean out global sets from any previous functions
- VN.clear();
- availableOut.clear();
- phiMap.clear();
-
- bool changed_function = false;
-
- DominatorTree &DT = getAnalysis<DominatorTree>();
-
- SmallVector<Instruction*, 8> toErase;
- DenseMap<Value*, LoadInst*> lastSeenLoad;
- DenseMap<DomTreeNode*, size_t> numChildrenVisited;
-
- // Top-down walk of the dominator tree
- for (df_iterator<DomTreeNode*> DI = df_begin(DT.getRootNode()),
- E = df_end(DT.getRootNode()); DI != E; ++DI) {
-
- // Get the set to update for this block
- ValueNumberedSet& currAvail = availableOut[DI->getBlock()];
- lastSeenLoad.clear();
-
- BasicBlock* BB = DI->getBlock();
-
- // A block inherits AVAIL_OUT from its dominator
- if (DI->getIDom() != 0) {
- currAvail = availableOut[DI->getIDom()->getBlock()];
-
- numChildrenVisited[DI->getIDom()]++;
-
- if (numChildrenVisited[DI->getIDom()] == DI->getIDom()->getNumChildren()) {
- availableOut.erase(DI->getIDom()->getBlock());
- numChildrenVisited.erase(DI->getIDom());
- }
- }
-
- for (BasicBlock::iterator BI = BB->begin(), BE = BB->end();
- BI != BE;) {
- changed_function |= processInstruction(BI, currAvail,
- lastSeenLoad, toErase);
- if (toErase.empty()) {
- ++BI;
- continue;
- }
-
- // If we need some instructions deleted, do it now.
- NumGVNInstr += toErase.size();
-
- // Avoid iterator invalidation.
- bool AtStart = BI == BB->begin();
- if (!AtStart)
- --BI;
-
- for (SmallVector<Instruction*, 4>::iterator I = toErase.begin(),
- E = toErase.end(); I != E; ++I)
- (*I)->eraseFromParent();
-
- if (AtStart)
- BI = BB->begin();
- else
- ++BI;
-
- toErase.clear();
- }
- }
-
- return changed_function;
-}
diff --git a/release_23/lib/Transforms/Scalar/GVNPRE.cpp b/release_23/lib/Transforms/Scalar/GVNPRE.cpp
deleted file mode 100644
index 3bd6bff5d607..000000000000
--- a/release_23/lib/Transforms/Scalar/GVNPRE.cpp
+++ /dev/null
@@ -1,1874 +0,0 @@
-//===- GVNPRE.cpp - Eliminate redundant values and expressions ------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This pass performs a hybrid of global value numbering and partial redundancy
-// elimination, known as GVN-PRE. It performs partial redundancy elimination on
-// values, rather than lexical expressions, allowing a more comprehensive view
-// the optimization. It replaces redundant values with uses of earlier
-// occurences of the same value. While this is beneficial in that it eliminates
-// unneeded computation, it also increases register pressure by creating large
-// live ranges, and should be used with caution on platforms that are very
-// sensitive to register pressure.
-//
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "gvnpre"
-#include "llvm/Value.h"
-#include "llvm/Transforms/Scalar.h"
-#include "llvm/Instructions.h"
-#include "llvm/Function.h"
-#include "llvm/DerivedTypes.h"
-#include "llvm/Analysis/Dominators.h"
-#include "llvm/ADT/BitVector.h"
-#include "llvm/ADT/DenseMap.h"
-#include "llvm/ADT/DepthFirstIterator.h"
-#include "llvm/ADT/PostOrderIterator.h"
-#include "llvm/ADT/SmallPtrSet.h"
-#include "llvm/ADT/SmallVector.h"
-#include "llvm/ADT/Statistic.h"
-#include "llvm/Transforms/Utils/UnifyFunctionExitNodes.h"
-#include "llvm/Support/CFG.h"
-#include "llvm/Support/Compiler.h"
-#include "llvm/Support/Debug.h"
-#include <algorithm>
-#include <deque>
-#include <map>
-using namespace llvm;
-
-//===----------------------------------------------------------------------===//
-// ValueTable Class
-//===----------------------------------------------------------------------===//
-
-/// This class holds the mapping between values and value numbers. It is used
-/// as an efficient mechanism to determine the expression-wise equivalence of
-/// two values.
-
-struct Expression {
- enum ExpressionOpcode { ADD, SUB, MUL, UDIV, SDIV, FDIV, UREM, SREM,
- FREM, SHL, LSHR, ASHR, AND, OR, XOR, ICMPEQ,
- ICMPNE, ICMPUGT, ICMPUGE, ICMPULT, ICMPULE,
- ICMPSGT, ICMPSGE, ICMPSLT, ICMPSLE, FCMPOEQ,
- FCMPOGT, FCMPOGE, FCMPOLT, FCMPOLE, FCMPONE,
- FCMPORD, FCMPUNO, FCMPUEQ, FCMPUGT, FCMPUGE,
- FCMPULT, FCMPULE, FCMPUNE, EXTRACT, INSERT,
- SHUFFLE, SELECT, TRUNC, ZEXT, SEXT, FPTOUI,
- FPTOSI, UITOFP, SITOFP, FPTRUNC, FPEXT,
- PTRTOINT, INTTOPTR, BITCAST, GEP, EMPTY,
- TOMBSTONE };
-
- ExpressionOpcode opcode;
- const Type* type;
- uint32_t firstVN;
- uint32_t secondVN;
- uint32_t thirdVN;
- SmallVector<uint32_t, 4> varargs;
-
- Expression() { }
- explicit Expression(ExpressionOpcode o) : opcode(o) { }
-
- bool operator==(const Expression &other) const {
- if (opcode != other.opcode)
- return false;
- else if (opcode == EMPTY || opcode == TOMBSTONE)
- return true;
- else if (type != other.type)
- return false;
- else if (firstVN != other.firstVN)
- return false;
- else if (secondVN != other.secondVN)
- return false;
- else if (thirdVN != other.thirdVN)
- return false;
- else {
- if (varargs.size() != other.varargs.size())
- return false;
-
- for (size_t i = 0; i < varargs.size(); ++i)
- if (varargs[i] != other.varargs[i])
- return false;
-
- return true;
- }
- }
-
- bool operator!=(const Expression &other) const {
- if (opcode != other.opcode)
- return true;
- else if (opcode == EMPTY || opcode == TOMBSTONE)
- return false;
- else if (type != other.type)
- return true;
- else if (firstVN != other.firstVN)
- return true;
- else if (secondVN != other.secondVN)
- return true;
- else if (thirdVN != other.thirdVN)
- return true;
- else {
- if (varargs.size() != other.varargs.size())
- return true;
-
- for (size_t i = 0; i < varargs.size(); ++i)
- if (varargs[i] != other.varargs[i])
- return true;
-
- return false;
- }
- }
-};
-
-
-namespace {
- class VISIBILITY_HIDDEN ValueTable {
- private:
- DenseMap<Value*, uint32_t> valueNumbering;
- DenseMap<Expression, uint32_t> expressionNumbering;
-
- uint32_t nextValueNumber;
-
- Expression::ExpressionOpcode getOpcode(BinaryOperator* BO);
- Expression::ExpressionOpcode getOpcode(CmpInst* C);
- Expression::ExpressionOpcode getOpcode(CastInst* C);
- Expression create_expression(BinaryOperator* BO);
- Expression create_expression(CmpInst* C);
- Expression create_expression(ShuffleVectorInst* V);
- Expression create_expression(ExtractElementInst* C);
- Expression create_expression(InsertElementInst* V);
- Expression create_expression(SelectInst* V);
- Expression create_expression(CastInst* C);
- Expression create_expression(GetElementPtrInst* G);
- public:
- ValueTable() { nextValueNumber = 1; }
- uint32_t lookup_or_add(Value* V);
- uint32_t lookup(Value* V) const;
- void add(Value* V, uint32_t num);
- void clear();
- void erase(Value* v);
- unsigned size();
- };
-}
-
-namespace llvm {
-template <> struct DenseMapInfo<Expression> {
- static inline Expression getEmptyKey() {
- return Expression(Expression::EMPTY);
- }
-
- static inline Expression getTombstoneKey() {
- return Expression(Expression::TOMBSTONE);
- }
-
- static unsigned getHashValue(const Expression e) {
- unsigned hash = e.opcode;
-
- hash = e.firstVN + hash * 37;
- hash = e.secondVN + hash * 37;
- hash = e.thirdVN + hash * 37;
-
- hash = ((unsigned)((uintptr_t)e.type >> 4) ^
- (unsigned)((uintptr_t)e.type >> 9)) +
- hash * 37;
-
- for (SmallVector<uint32_t, 4>::const_iterator I = e.varargs.begin(),
- E = e.varargs.end(); I != E; ++I)
- hash = *I + hash * 37;
-
- return hash;
- }
- static bool isEqual(const Expression &LHS, const Expression &RHS) {
- return LHS == RHS;
- }
- static bool isPod() { return true; }
-};
-}
-
-//===----------------------------------------------------------------------===//
-// ValueTable Internal Functions
-//===----------------------------------------------------------------------===//
-Expression::ExpressionOpcode
- ValueTable::getOpcode(BinaryOperator* BO) {
- switch(BO->getOpcode()) {
- case Instruction::Add:
- return Expression::ADD;
- case Instruction::Sub:
- return Expression::SUB;
- case Instruction::Mul:
- return Expression::MUL;
- case Instruction::UDiv:
- return Expression::UDIV;
- case Instruction::SDiv:
- return Expression::SDIV;
- case Instruction::FDiv:
- return Expression::FDIV;
- case Instruction::URem:
- return Expression::UREM;
- case Instruction::SRem:
- return Expression::SREM;
- case Instruction::FRem:
- return Expression::FREM;
- case Instruction::Shl:
- return Expression::SHL;
- case Instruction::LShr:
- return Expression::LSHR;
- case Instruction::AShr:
- return Expression::ASHR;
- case Instruction::And:
- return Expression::AND;
- case Instruction::Or:
- return Expression::OR;
- case Instruction::Xor:
- return Expression::XOR;
-
- // THIS SHOULD NEVER HAPPEN
- default:
- assert(0 && "Binary operator with unknown opcode?");
- return Expression::ADD;
- }
-}
-
-Expression::ExpressionOpcode ValueTable::getOpcode(CmpInst* C) {
- if (C->getOpcode() == Instruction::ICmp) {
- switch (C->getPredicate()) {
- case ICmpInst::ICMP_EQ:
- return Expression::ICMPEQ;
- case ICmpInst::ICMP_NE:
- return Expression::ICMPNE;
- case ICmpInst::ICMP_UGT:
- return Expression::ICMPUGT;
- case ICmpInst::ICMP_UGE:
- return Expression::ICMPUGE;
- case ICmpInst::ICMP_ULT:
- return Expression::ICMPULT;
- case ICmpInst::ICMP_ULE:
- return Expression::ICMPULE;
- case ICmpInst::ICMP_SGT:
- return Expression::ICMPSGT;
- case ICmpInst::ICMP_SGE:
- return Expression::ICMPSGE;
- case ICmpInst::ICMP_SLT:
- return Expression::ICMPSLT;
- case ICmpInst::ICMP_SLE:
- return Expression::ICMPSLE;
-
- // THIS SHOULD NEVER HAPPEN
- default:
- assert(0 && "Comparison with unknown predicate?");
- return Expression::ICMPEQ;
- }
- } else {
- switch (C->getPredicate()) {
- case FCmpInst::FCMP_OEQ:
- return Expression::FCMPOEQ;
- case FCmpInst::FCMP_OGT:
- return Expression::FCMPOGT;
- case FCmpInst::FCMP_OGE:
- return Expression::FCMPOGE;
- case FCmpInst::FCMP_OLT:
- return Expression::FCMPOLT;
- case FCmpInst::FCMP_OLE:
- return Expression::FCMPOLE;
- case FCmpInst::FCMP_ONE:
- return Expression::FCMPONE;
- case FCmpInst::FCMP_ORD:
- return Expression::FCMPORD;
- case FCmpInst::FCMP_UNO:
- return Expression::FCMPUNO;
- case FCmpInst::FCMP_UEQ:
- return Expression::FCMPUEQ;
- case FCmpInst::FCMP_UGT:
- return Expression::FCMPUGT;
- case FCmpInst::FCMP_UGE:
- return Expression::FCMPUGE;
- case FCmpInst::FCMP_ULT:
- return Expression::FCMPULT;
- case FCmpInst::FCMP_ULE:
- return Expression::FCMPULE;
- case FCmpInst::FCMP_UNE:
- return Expression::FCMPUNE;
-
- // THIS SHOULD NEVER HAPPEN
- default:
- assert(0 && "Comparison with unknown predicate?");
- return Expression::FCMPOEQ;
- }
- }
-}
-
-Expression::ExpressionOpcode
- ValueTable::getOpcode(CastInst* C) {
- switch(C->getOpcode()) {
- case Instruction::Trunc:
- return Expression::TRUNC;
- case Instruction::ZExt:
- return Expression::ZEXT;
- case Instruction::SExt:
- return Expression::SEXT;
- case Instruction::FPToUI:
- return Expression::FPTOUI;
- case Instruction::FPToSI:
- return Expression::FPTOSI;
- case Instruction::UIToFP:
- return Expression::UITOFP;
- case Instruction::SIToFP:
- return Expression::SITOFP;
- case Instruction::FPTrunc:
- return Expression::FPTRUNC;
- case Instruction::FPExt:
- return Expression::FPEXT;
- case Instruction::PtrToInt:
- return Expression::PTRTOINT;
- case Instruction::IntToPtr:
- return Expression::INTTOPTR;
- case Instruction::BitCast:
- return Expression::BITCAST;
-
- // THIS SHOULD NEVER HAPPEN
- default:
- assert(0 && "Cast operator with unknown opcode?");
- return Expression::BITCAST;
- }
-}
-
-Expression ValueTable::create_expression(BinaryOperator* BO) {
- Expression e;
-
- e.firstVN = lookup_or_add(BO->getOperand(0));
- e.secondVN = lookup_or_add(BO->getOperand(1));
- e.thirdVN = 0;
- e.type = BO->getType();
- e.opcode = getOpcode(BO);
-
- return e;
-}
-
-Expression ValueTable::create_expression(CmpInst* C) {
- Expression e;
-
- e.firstVN = lookup_or_add(C->getOperand(0));
- e.secondVN = lookup_or_add(C->getOperand(1));
- e.thirdVN = 0;
- e.type = C->getType();
- e.opcode = getOpcode(C);
-
- return e;
-}
-
-Expression ValueTable::create_expression(CastInst* C) {
- Expression e;
-
- e.firstVN = lookup_or_add(C->getOperand(0));
- e.secondVN = 0;
- e.thirdVN = 0;
- e.type = C->getType();
- e.opcode = getOpcode(C);
-
- return e;
-}
-
-Expression ValueTable::create_expression(ShuffleVectorInst* S) {
- Expression e;
-
- e.firstVN = lookup_or_add(S->getOperand(0));
- e.secondVN = lookup_or_add(S->getOperand(1));
- e.thirdVN = lookup_or_add(S->getOperand(2));
- e.type = S->getType();
- e.opcode = Expression::SHUFFLE;
-
- return e;
-}
-
-Expression ValueTable::create_expression(ExtractElementInst* E) {
- Expression e;
-
- e.firstVN = lookup_or_add(E->getOperand(0));
- e.secondVN = lookup_or_add(E->getOperand(1));
- e.thirdVN = 0;
- e.type = E->getType();
- e.opcode = Expression::EXTRACT;
-
- return e;
-}
-
-Expression ValueTable::create_expression(InsertElementInst* I) {
- Expression e;
-
- e.firstVN = lookup_or_add(I->getOperand(0));
- e.secondVN = lookup_or_add(I->getOperand(1));
- e.thirdVN = lookup_or_add(I->getOperand(2));
- e.type = I->getType();
- e.opcode = Expression::INSERT;
-
- return e;
-}
-
-Expression ValueTable::create_expression(SelectInst* I) {
- Expression e;
-
- e.firstVN = lookup_or_add(I->getCondition());
- e.secondVN = lookup_or_add(I->getTrueValue());
- e.thirdVN = lookup_or_add(I->getFalseValue());
- e.type = I->getType();
- e.opcode = Expression::SELECT;
-
- return e;
-}
-
-Expression ValueTable::create_expression(GetElementPtrInst* G) {
- Expression e;
-
- e.firstVN = lookup_or_add(G->getPointerOperand());
- e.secondVN = 0;
- e.thirdVN = 0;
- e.type = G->getType();
- e.opcode = Expression::GEP;
-
- for (GetElementPtrInst::op_iterator I = G->idx_begin(), E = G->idx_end();
- I != E; ++I)
- e.varargs.push_back(lookup_or_add(*I));
-
- return e;
-}
-
-//===----------------------------------------------------------------------===//
-// ValueTable External Functions
-//===----------------------------------------------------------------------===//
-
-/// lookup_or_add - Returns the value number for the specified value, assigning
-/// it a new number if it did not have one before.
-uint32_t ValueTable::lookup_or_add(Value* V) {
- DenseMap<Value*, uint32_t>::iterator VI = valueNumbering.find(V);
- if (VI != valueNumbering.end())
- return VI->second;
-
-
- if (BinaryOperator* BO = dyn_cast<BinaryOperator>(V)) {
- Expression e = create_expression(BO);
-
- DenseMap<Expression, uint32_t>::iterator EI = expressionNumbering.find(e);
- if (EI != expressionNumbering.end()) {
- valueNumbering.insert(std::make_pair(V, EI->second));
- return EI->second;
- } else {
- expressionNumbering.insert(std::make_pair(e, nextValueNumber));
- valueNumbering.insert(std::make_pair(V, nextValueNumber));
-
- return nextValueNumber++;
- }
- } else if (CmpInst* C = dyn_cast<CmpInst>(V)) {
- Expression e = create_expression(C);
-
- DenseMap<Expression, uint32_t>::iterator EI = expressionNumbering.find(e);
- if (EI != expressionNumbering.end()) {
- valueNumbering.insert(std::make_pair(V, EI->second));
- return EI->second;
- } else {
- expressionNumbering.insert(std::make_pair(e, nextValueNumber));
- valueNumbering.insert(std::make_pair(V, nextValueNumber));
-
- return nextValueNumber++;
- }
- } else if (ShuffleVectorInst* U = dyn_cast<ShuffleVectorInst>(V)) {
- Expression e = create_expression(U);
-
- DenseMap<Expression, uint32_t>::iterator EI = expressionNumbering.find(e);
- if (EI != expressionNumbering.end()) {
- valueNumbering.insert(std::make_pair(V, EI->second));
- return EI->second;
- } else {
- expressionNumbering.insert(std::make_pair(e, nextValueNumber));
- valueNumbering.insert(std::make_pair(V, nextValueNumber));
-
- return nextValueNumber++;
- }
- } else if (ExtractElementInst* U = dyn_cast<ExtractElementInst>(V)) {
- Expression e = create_expression(U);
-
- DenseMap<Expression, uint32_t>::iterator EI = expressionNumbering.find(e);
- if (EI != expressionNumbering.end()) {
- valueNumbering.insert(std::make_pair(V, EI->second));
- return EI->second;
- } else {
- expressionNumbering.insert(std::make_pair(e, nextValueNumber));
- valueNumbering.insert(std::make_pair(V, nextValueNumber));
-
- return nextValueNumber++;
- }
- } else if (InsertElementInst* U = dyn_cast<InsertElementInst>(V)) {
- Expression e = create_expression(U);
-
- DenseMap<Expression, uint32_t>::iterator EI = expressionNumbering.find(e);
- if (EI != expressionNumbering.end()) {
- valueNumbering.insert(std::make_pair(V, EI->second));
- return EI->second;
- } else {
- expressionNumbering.insert(std::make_pair(e, nextValueNumber));
- valueNumbering.insert(std::make_pair(V, nextValueNumber));
-
- return nextValueNumber++;
- }
- } else if (SelectInst* U = dyn_cast<SelectInst>(V)) {
- Expression e = create_expression(U);
-
- DenseMap<Expression, uint32_t>::iterator EI = expressionNumbering.find(e);
- if (EI != expressionNumbering.end()) {
- valueNumbering.insert(std::make_pair(V, EI->second));
- return EI->second;
- } else {
- expressionNumbering.insert(std::make_pair(e, nextValueNumber));
- valueNumbering.insert(std::make_pair(V, nextValueNumber));
-
- return nextValueNumber++;
- }
- } else if (CastInst* U = dyn_cast<CastInst>(V)) {
- Expression e = create_expression(U);
-
- DenseMap<Expression, uint32_t>::iterator EI = expressionNumbering.find(e);
- if (EI != expressionNumbering.end()) {
- valueNumbering.insert(std::make_pair(V, EI->second));
- return EI->second;
- } else {
- expressionNumbering.insert(std::make_pair(e, nextValueNumber));
- valueNumbering.insert(std::make_pair(V, nextValueNumber));
-
- return nextValueNumber++;
- }
- } else if (GetElementPtrInst* U = dyn_cast<GetElementPtrInst>(V)) {
- Expression e = create_expression(U);
-
- DenseMap<Expression, uint32_t>::iterator EI = expressionNumbering.find(e);
- if (EI != expressionNumbering.end()) {
- valueNumbering.insert(std::make_pair(V, EI->second));
- return EI->second;
- } else {
- expressionNumbering.insert(std::make_pair(e, nextValueNumber));
- valueNumbering.insert(std::make_pair(V, nextValueNumber));
-
- return nextValueNumber++;
- }
- } else {
- valueNumbering.insert(std::make_pair(V, nextValueNumber));
- return nextValueNumber++;
- }
-}
-
-/// lookup - Returns the value number of the specified value. Fails if
-/// the value has not yet been numbered.
-uint32_t ValueTable::lookup(Value* V) const {
- DenseMap<Value*, uint32_t>::iterator VI = valueNumbering.find(V);
- if (VI != valueNumbering.end())
- return VI->second;
- else
- assert(0 && "Value not numbered?");
-
- return 0;
-}
-
-/// add - Add the specified value with the given value number, removing
-/// its old number, if any
-void ValueTable::add(Value* V, uint32_t num) {
- DenseMap<Value*, uint32_t>::iterator VI = valueNumbering.find(V);
- if (VI != valueNumbering.end())
- valueNumbering.erase(VI);
- valueNumbering.insert(std::make_pair(V, num));
-}
-
-/// clear - Remove all entries from the ValueTable
-void ValueTable::clear() {
- valueNumbering.clear();
- expressionNumbering.clear();
- nextValueNumber = 1;
-}
-
-/// erase - Remove a value from the value numbering
-void ValueTable::erase(Value* V) {
- valueNumbering.erase(V);
-}
-
-/// size - Return the number of assigned value numbers
-unsigned ValueTable::size() {
- // NOTE: zero is never assigned
- return nextValueNumber;
-}
-
-//===----------------------------------------------------------------------===//
-// ValueNumberedSet Class
-//===----------------------------------------------------------------------===//
-
-class ValueNumberedSet {
- private:
- SmallPtrSet<Value*, 8> contents;
- BitVector numbers;
- public:
- ValueNumberedSet() { numbers.resize(1); }
- ValueNumberedSet(const ValueNumberedSet& other) {
- numbers = other.numbers;
- contents = other.contents;
- }
-
- typedef SmallPtrSet<Value*, 8>::iterator iterator;
-
- iterator begin() { return contents.begin(); }
- iterator end() { return contents.end(); }
-
- bool insert(Value* v) { return contents.insert(v); }
- void insert(iterator I, iterator E) { contents.insert(I, E); }
- void erase(Value* v) { contents.erase(v); }
- unsigned count(Value* v) { return contents.count(v); }
- size_t size() { return contents.size(); }
-
- void set(unsigned i) {
- if (i >= numbers.size())
- numbers.resize(i+1);
-
- numbers.set(i);
- }
-
- void operator=(const ValueNumberedSet& other) {
- contents = other.contents;
- numbers = other.numbers;
- }
-
- void reset(unsigned i) {
- if (i < numbers.size())
- numbers.reset(i);
- }
-
- bool test(unsigned i) {
- if (i >= numbers.size())
- return false;
-
- return numbers.test(i);
- }
-
- void clear() {
- contents.clear();
- numbers.clear();
- }
-};
-
-//===----------------------------------------------------------------------===//
-// GVNPRE Pass
-//===----------------------------------------------------------------------===//
-
-namespace {
-
- class VISIBILITY_HIDDEN GVNPRE : public FunctionPass {
- bool runOnFunction(Function &F);
- public:
- static char ID; // Pass identification, replacement for typeid
- GVNPRE() : FunctionPass((intptr_t)&ID) { }
-
- private:
- ValueTable VN;
- SmallVector<Instruction*, 8> createdExpressions;
-
- DenseMap<BasicBlock*, ValueNumberedSet> availableOut;
- DenseMap<BasicBlock*, ValueNumberedSet> anticipatedIn;
- DenseMap<BasicBlock*, ValueNumberedSet> generatedPhis;
-
- // This transformation requires dominator postdominator info
- virtual void getAnalysisUsage(AnalysisUsage &AU) const {
- AU.setPreservesCFG();
- AU.addRequiredID(BreakCriticalEdgesID);
- AU.addRequired<UnifyFunctionExitNodes>();
- AU.addRequired<DominatorTree>();
- }
-
- // Helper fuctions
- // FIXME: eliminate or document these better
- void dump(ValueNumberedSet& s) const ;
- void clean(ValueNumberedSet& set) ;
- Value* find_leader(ValueNumberedSet& vals, uint32_t v) ;
- Value* phi_translate(Value* V, BasicBlock* pred, BasicBlock* succ) ;
- void phi_translate_set(ValueNumberedSet& anticIn, BasicBlock* pred,
- BasicBlock* succ, ValueNumberedSet& out) ;
-
- void topo_sort(ValueNumberedSet& set,
- SmallVector<Value*, 8>& vec) ;
-
- void cleanup() ;
- bool elimination() ;
-
- void val_insert(ValueNumberedSet& s, Value* v) ;
- void val_replace(ValueNumberedSet& s, Value* v) ;
- bool dependsOnInvoke(Value* V) ;
- void buildsets_availout(BasicBlock::iterator I,
- ValueNumberedSet& currAvail,
- ValueNumberedSet& currPhis,
- ValueNumberedSet& currExps,
- SmallPtrSet<Value*, 16>& currTemps);
- bool buildsets_anticout(BasicBlock* BB,
- ValueNumberedSet& anticOut,
- SmallPtrSet<BasicBlock*, 8>& visited);
- unsigned buildsets_anticin(BasicBlock* BB,
- ValueNumberedSet& anticOut,
- ValueNumberedSet& currExps,
- SmallPtrSet<Value*, 16>& currTemps,
- SmallPtrSet<BasicBlock*, 8>& visited);
- void buildsets(Function& F) ;
-
- void insertion_pre(Value* e, BasicBlock* BB,
- DenseMap<BasicBlock*, Value*>& avail,
- std::map<BasicBlock*,ValueNumberedSet>& new_set);
- unsigned insertion_mergepoint(SmallVector<Value*, 8>& workList,
- df_iterator<DomTreeNode*>& D,
- std::map<BasicBlock*, ValueNumberedSet>& new_set);
- bool insertion(Function& F) ;
-
- };
-
- char GVNPRE::ID = 0;
-
-}
-
-// createGVNPREPass - The public interface to this file...
-FunctionPass *llvm::createGVNPREPass() { return new GVNPRE(); }
-
-static RegisterPass<GVNPRE> X("gvnpre",
- "Global Value Numbering/Partial Redundancy Elimination");
-
-
-STATISTIC(NumInsertedVals, "Number of values inserted");
-STATISTIC(NumInsertedPhis, "Number of PHI nodes inserted");
-STATISTIC(NumEliminated, "Number of redundant instructions eliminated");
-
-/// find_leader - Given a set and a value number, return the first
-/// element of the set with that value number, or 0 if no such element
-/// is present
-Value* GVNPRE::find_leader(ValueNumberedSet& vals, uint32_t v) {
- if (!vals.test(v))
- return 0;
-
- for (ValueNumberedSet::iterator I = vals.begin(), E = vals.end();
- I != E; ++I)
- if (v == VN.lookup(*I))
- return *I;
-
- assert(0 && "No leader found, but present bit is set?");
- return 0;
-}
-
-/// val_insert - Insert a value into a set only if there is not a value
-/// with the same value number already in the set
-void GVNPRE::val_insert(ValueNumberedSet& s, Value* v) {
- uint32_t num = VN.lookup(v);
- if (!s.test(num))
- s.insert(v);
-}
-
-/// val_replace - Insert a value into a set, replacing any values already in
-/// the set that have the same value number
-void GVNPRE::val_replace(ValueNumberedSet& s, Value* v) {
- if (s.count(v)) return;
-
- uint32_t num = VN.lookup(v);
- Value* leader = find_leader(s, num);
- if (leader != 0)
- s.erase(leader);
- s.insert(v);
- s.set(num);
-}
-
-/// phi_translate - Given a value, its parent block, and a predecessor of its
-/// parent, translate the value into legal for the predecessor block. This
-/// means translating its operands (and recursively, their operands) through
-/// any phi nodes in the parent into values available in the predecessor
-Value* GVNPRE::phi_translate(Value* V, BasicBlock* pred, BasicBlock* succ) {
- if (V == 0)
- return 0;
-
- // Unary Operations
- if (CastInst* U = dyn_cast<CastInst>(V)) {
- Value* newOp1 = 0;
- if (isa<Instruction>(U->getOperand(0)))
- newOp1 = phi_translate(U->getOperand(0), pred, succ);
- else
- newOp1 = U->getOperand(0);
-
- if (newOp1 == 0)
- return 0;
-
- if (newOp1 != U->getOperand(0)) {
- Instruction* newVal = 0;
- if (CastInst* C = dyn_cast<CastInst>(U))
- newVal = CastInst::create(C->getOpcode(),
- newOp1, C->getType(),
- C->getName()+".expr");
-
- uint32_t v = VN.lookup_or_add(newVal);
-
- Value* leader = find_leader(availableOut[pred], v);
- if (leader == 0) {
- createdExpressions.push_back(newVal);
- return newVal;
- } else {
- VN.erase(newVal);
- delete newVal;
- return leader;
- }
- }
-
- // Binary Operations
- } if (isa<BinaryOperator>(V) || isa<CmpInst>(V) ||
- isa<ExtractElementInst>(V)) {
- User* U = cast<User>(V);
-
- Value* newOp1 = 0;
- if (isa<Instruction>(U->getOperand(0)))
- newOp1 = phi_translate(U->getOperand(0), pred, succ);
- else
- newOp1 = U->getOperand(0);
-
- if (newOp1 == 0)
- return 0;
-
- Value* newOp2 = 0;
- if (isa<Instruction>(U->getOperand(1)))
- newOp2 = phi_translate(U->getOperand(1), pred, succ);
- else
- newOp2 = U->getOperand(1);
-
- if (newOp2 == 0)
- return 0;
-
- if (newOp1 != U->getOperand(0) || newOp2 != U->getOperand(1)) {
- Instruction* newVal = 0;
- if (BinaryOperator* BO = dyn_cast<BinaryOperator>(U))
- newVal = BinaryOperator::create(BO->getOpcode(),
- newOp1, newOp2,
- BO->getName()+".expr");
- else if (CmpInst* C = dyn_cast<CmpInst>(U))
- newVal = CmpInst::create(C->getOpcode(),
- C->getPredicate(),
- newOp1, newOp2,
- C->getName()+".expr");
- else if (ExtractElementInst* E = dyn_cast<ExtractElementInst>(U))
- newVal = new ExtractElementInst(newOp1, newOp2, E->getName()+".expr");
-
- uint32_t v = VN.lookup_or_add(newVal);
-
- Value* leader = find_leader(availableOut[pred], v);
- if (leader == 0) {
- createdExpressions.push_back(newVal);
- return newVal;
- } else {
- VN.erase(newVal);
- delete newVal;
- return leader;
- }
- }
-
- // Ternary Operations
- } else if (isa<ShuffleVectorInst>(V) || isa<InsertElementInst>(V) ||
- isa<SelectInst>(V)) {
- User* U = cast<User>(V);
-
- Value* newOp1 = 0;
- if (isa<Instruction>(U->getOperand(0)))
- newOp1 = phi_translate(U->getOperand(0), pred, succ);
- else
- newOp1 = U->getOperand(0);
-
- if (newOp1 == 0)
- return 0;
-
- Value* newOp2 = 0;
- if (isa<Instruction>(U->getOperand(1)))
- newOp2 = phi_translate(U->getOperand(1), pred, succ);
- else
- newOp2 = U->getOperand(1);
-
- if (newOp2 == 0)
- return 0;
-
- Value* newOp3 = 0;
- if (isa<Instruction>(U->getOperand(2)))
- newOp3 = phi_translate(U->getOperand(2), pred, succ);
- else
- newOp3 = U->getOperand(2);
-
- if (newOp3 == 0)
- return 0;
-
- if (newOp1 != U->getOperand(0) ||
- newOp2 != U->getOperand(1) ||
- newOp3 != U->getOperand(2)) {
- Instruction* newVal = 0;
- if (ShuffleVectorInst* S = dyn_cast<ShuffleVectorInst>(U))
- newVal = new ShuffleVectorInst(newOp1, newOp2, newOp3,
- S->getName()+".expr");
- else if (InsertElementInst* I = dyn_cast<InsertElementInst>(U))
- newVal = InsertElementInst::Create(newOp1, newOp2, newOp3,
- I->getName()+".expr");
- else if (SelectInst* I = dyn_cast<SelectInst>(U))
- newVal = SelectInst::Create(newOp1, newOp2, newOp3, I->getName()+".expr");
-
- uint32_t v = VN.lookup_or_add(newVal);
-
- Value* leader = find_leader(availableOut[pred], v);
- if (leader == 0) {
- createdExpressions.push_back(newVal);
- return newVal;
- } else {
- VN.erase(newVal);
- delete newVal;
- return leader;
- }
- }
-
- // Varargs operators
- } else if (GetElementPtrInst* U = dyn_cast<GetElementPtrInst>(V)) {
- Value* newOp1 = 0;
- if (isa<Instruction>(U->getPointerOperand()))
- newOp1 = phi_translate(U->getPointerOperand(), pred, succ);
- else
- newOp1 = U->getPointerOperand();
-
- if (newOp1 == 0)
- return 0;
-
- bool changed_idx = false;
- SmallVector<Value*, 4> newIdx;
- for (GetElementPtrInst::op_iterator I = U->idx_begin(), E = U->idx_end();
- I != E; ++I)
- if (isa<Instruction>(*I)) {
- Value* newVal = phi_translate(*I, pred, succ);
- newIdx.push_back(newVal);
- if (newVal != *I)
- changed_idx = true;
- } else {
- newIdx.push_back(*I);
- }
-
- if (newOp1 != U->getPointerOperand() || changed_idx) {
- Instruction* newVal =
- GetElementPtrInst::Create(newOp1,
- newIdx.begin(), newIdx.end(),
- U->getName()+".expr");
-
- uint32_t v = VN.lookup_or_add(newVal);
-
- Value* leader = find_leader(availableOut[pred], v);
- if (leader == 0) {
- createdExpressions.push_back(newVal);
- return newVal;
- } else {
- VN.erase(newVal);
- delete newVal;
- return leader;
- }
- }
-
- // PHI Nodes
- } else if (PHINode* P = dyn_cast<PHINode>(V)) {
- if (P->getParent() == succ)
- return P->getIncomingValueForBlock(pred);
- }
-
- return V;
-}
-
-/// phi_translate_set - Perform phi translation on every element of a set
-void GVNPRE::phi_translate_set(ValueNumberedSet& anticIn,
- BasicBlock* pred, BasicBlock* succ,
- ValueNumberedSet& out) {
- for (ValueNumberedSet::iterator I = anticIn.begin(),
- E = anticIn.end(); I != E; ++I) {
- Value* V = phi_translate(*I, pred, succ);
- if (V != 0 && !out.test(VN.lookup_or_add(V))) {
- out.insert(V);
- out.set(VN.lookup(V));
- }
- }
-}
-
-/// dependsOnInvoke - Test if a value has an phi node as an operand, any of
-/// whose inputs is an invoke instruction. If this is true, we cannot safely
-/// PRE the instruction or anything that depends on it.
-bool GVNPRE::dependsOnInvoke(Value* V) {
- if (PHINode* p = dyn_cast<PHINode>(V)) {
- for (PHINode::op_iterator I = p->op_begin(), E = p->op_end(); I != E; ++I)
- if (isa<InvokeInst>(*I))
- return true;
- return false;
- } else {
- return false;
- }
-}
-
-/// clean - Remove all non-opaque values from the set whose operands are not
-/// themselves in the set, as well as all values that depend on invokes (see
-/// above)
-void GVNPRE::clean(ValueNumberedSet& set) {
- SmallVector<Value*, 8> worklist;
- worklist.reserve(set.size());
- topo_sort(set, worklist);
-
- for (unsigned i = 0; i < worklist.size(); ++i) {
- Value* v = worklist[i];
-
- // Handle unary ops
- if (CastInst* U = dyn_cast<CastInst>(v)) {
- bool lhsValid = !isa<Instruction>(U->getOperand(0));
- lhsValid |= set.test(VN.lookup(U->getOperand(0)));
- if (lhsValid)
- lhsValid = !dependsOnInvoke(U->getOperand(0));
-
- if (!lhsValid) {
- set.erase(U);
- set.reset(VN.lookup(U));
- }
-
- // Handle binary ops
- } else if (isa<BinaryOperator>(v) || isa<CmpInst>(v) ||
- isa<ExtractElementInst>(v)) {
- User* U = cast<User>(v);
-
- bool lhsValid = !isa<Instruction>(U->getOperand(0));
- lhsValid |= set.test(VN.lookup(U->getOperand(0)));
- if (lhsValid)
- lhsValid = !dependsOnInvoke(U->getOperand(0));
-
- bool rhsValid = !isa<Instruction>(U->getOperand(1));
- rhsValid |= set.test(VN.lookup(U->getOperand(1)));
- if (rhsValid)
- rhsValid = !dependsOnInvoke(U->getOperand(1));
-
- if (!lhsValid || !rhsValid) {
- set.erase(U);
- set.reset(VN.lookup(U));
- }
-
- // Handle ternary ops
- } else if (isa<ShuffleVectorInst>(v) || isa<InsertElementInst>(v) ||
- isa<SelectInst>(v)) {
- User* U = cast<User>(v);
-
- bool lhsValid = !isa<Instruction>(U->getOperand(0));
- lhsValid |= set.test(VN.lookup(U->getOperand(0)));
- if (lhsValid)
- lhsValid = !dependsOnInvoke(U->getOperand(0));
-
- bool rhsValid = !isa<Instruction>(U->getOperand(1));
- rhsValid |= set.test(VN.lookup(U->getOperand(1)));
- if (rhsValid)
- rhsValid = !dependsOnInvoke(U->getOperand(1));
-
- bool thirdValid = !isa<Instruction>(U->getOperand(2));
- thirdValid |= set.test(VN.lookup(U->getOperand(2)));
- if (thirdValid)
- thirdValid = !dependsOnInvoke(U->getOperand(2));
-
- if (!lhsValid || !rhsValid || !thirdValid) {
- set.erase(U);
- set.reset(VN.lookup(U));
- }
-
- // Handle varargs ops
- } else if (GetElementPtrInst* U = dyn_cast<GetElementPtrInst>(v)) {
- bool ptrValid = !isa<Instruction>(U->getPointerOperand());
- ptrValid |= set.test(VN.lookup(U->getPointerOperand()));
- if (ptrValid)
- ptrValid = !dependsOnInvoke(U->getPointerOperand());
-
- bool varValid = true;
- for (GetElementPtrInst::op_iterator I = U->idx_begin(), E = U->idx_end();
- I != E; ++I)
- if (varValid) {
- varValid &= !isa<Instruction>(*I) || set.test(VN.lookup(*I));
- varValid &= !dependsOnInvoke(*I);
- }
-
- if (!ptrValid || !varValid) {
- set.erase(U);
- set.reset(VN.lookup(U));
- }
- }
- }
-}
-
-/// topo_sort - Given a set of values, sort them by topological
-/// order into the provided vector.
-void GVNPRE::topo_sort(ValueNumberedSet& set, SmallVector<Value*, 8>& vec) {
- SmallPtrSet<Value*, 16> visited;
- SmallVector<Value*, 8> stack;
- for (ValueNumberedSet::iterator I = set.begin(), E = set.end();
- I != E; ++I) {
- if (visited.count(*I) == 0)
- stack.push_back(*I);
-
- while (!stack.empty()) {
- Value* e = stack.back();
-
- // Handle unary ops
- if (CastInst* U = dyn_cast<CastInst>(e)) {
- Value* l = find_leader(set, VN.lookup(U->getOperand(0)));
-
- if (l != 0 && isa<Instruction>(l) &&
- visited.count(l) == 0)
- stack.push_back(l);
- else {
- vec.push_back(e);
- visited.insert(e);
- stack.pop_back();
- }
-
- // Handle binary ops
- } else if (isa<BinaryOperator>(e) || isa<CmpInst>(e) ||
- isa<ExtractElementInst>(e)) {
- User* U = cast<User>(e);
- Value* l = find_leader(set, VN.lookup(U->getOperand(0)));
- Value* r = find_leader(set, VN.lookup(U->getOperand(1)));
-
- if (l != 0 && isa<Instruction>(l) &&
- visited.count(l) == 0)
- stack.push_back(l);
- else if (r != 0 && isa<Instruction>(r) &&
- visited.count(r) == 0)
- stack.push_back(r);
- else {
- vec.push_back(e);
- visited.insert(e);
- stack.pop_back();
- }
-
- // Handle ternary ops
- } else if (isa<InsertElementInst>(e) || isa<ShuffleVectorInst>(e) ||
- isa<SelectInst>(e)) {
- User* U = cast<User>(e);
- Value* l = find_leader(set, VN.lookup(U->getOperand(0)));
- Value* r = find_leader(set, VN.lookup(U->getOperand(1)));
- Value* m = find_leader(set, VN.lookup(U->getOperand(2)));
-
- if (l != 0 && isa<Instruction>(l) &&
- visited.count(l) == 0)
- stack.push_back(l);
- else if (r != 0 && isa<Instruction>(r) &&
- visited.count(r) == 0)
- stack.push_back(r);
- else if (m != 0 && isa<Instruction>(m) &&
- visited.count(m) == 0)
- stack.push_back(m);
- else {
- vec.push_back(e);
- visited.insert(e);
- stack.pop_back();
- }
-
- // Handle vararg ops
- } else if (GetElementPtrInst* U = dyn_cast<GetElementPtrInst>(e)) {
- Value* p = find_leader(set, VN.lookup(U->getPointerOperand()));
-
- if (p != 0 && isa<Instruction>(p) &&
- visited.count(p) == 0)
- stack.push_back(p);
- else {
- bool push_va = false;
- for (GetElementPtrInst::op_iterator I = U->idx_begin(),
- E = U->idx_end(); I != E; ++I) {
- Value * v = find_leader(set, VN.lookup(*I));
- if (v != 0 && isa<Instruction>(v) && visited.count(v) == 0) {
- stack.push_back(v);
- push_va = true;
- }
- }
-
- if (!push_va) {
- vec.push_back(e);
- visited.insert(e);
- stack.pop_back();
- }
- }
-
- // Handle opaque ops
- } else {
- visited.insert(e);
- vec.push_back(e);
- stack.pop_back();
- }
- }
-
- stack.clear();
- }
-}
-
-/// dump - Dump a set of values to standard error
-void GVNPRE::dump(ValueNumberedSet& s) const {
- DOUT << "{ ";
- for (ValueNumberedSet::iterator I = s.begin(), E = s.end();
- I != E; ++I) {
- DOUT << "" << VN.lookup(*I) << ": ";
- DEBUG((*I)->dump());
- }
- DOUT << "}\n\n";
-}
-
-/// elimination - Phase 3 of the main algorithm. Perform full redundancy
-/// elimination by walking the dominator tree and removing any instruction that
-/// is dominated by another instruction with the same value number.
-bool GVNPRE::elimination() {
- bool changed_function = false;
-
- SmallVector<std::pair<Instruction*, Value*>, 8> replace;
- SmallVector<Instruction*, 8> erase;
-
- DominatorTree& DT = getAnalysis<DominatorTree>();
-
- for (df_iterator<DomTreeNode*> DI = df_begin(DT.getRootNode()),
- E = df_end(DT.getRootNode()); DI != E; ++DI) {
- BasicBlock* BB = DI->getBlock();
-
- for (BasicBlock::iterator BI = BB->begin(), BE = BB->end();
- BI != BE; ++BI) {
-
- if (isa<BinaryOperator>(BI) || isa<CmpInst>(BI) ||
- isa<ShuffleVectorInst>(BI) || isa<InsertElementInst>(BI) ||
- isa<ExtractElementInst>(BI) || isa<SelectInst>(BI) ||
- isa<CastInst>(BI) || isa<GetElementPtrInst>(BI)) {
-
- if (availableOut[BB].test(VN.lookup(BI)) &&
- !availableOut[BB].count(BI)) {
- Value *leader = find_leader(availableOut[BB], VN.lookup(BI));
- if (Instruction* Instr = dyn_cast<Instruction>(leader))
- if (Instr->getParent() != 0 && Instr != BI) {
- replace.push_back(std::make_pair(BI, leader));
- erase.push_back(BI);
- ++NumEliminated;
- }
- }
- }
- }
- }
-
- while (!replace.empty()) {
- std::pair<Instruction*, Value*> rep = replace.back();
- replace.pop_back();
- rep.first->replaceAllUsesWith(rep.second);
- changed_function = true;
- }
-
- for (SmallVector<Instruction*, 8>::iterator I = erase.begin(),
- E = erase.end(); I != E; ++I)
- (*I)->eraseFromParent();
-
- return changed_function;
-}
-
-/// cleanup - Delete any extraneous values that were created to represent
-/// expressions without leaders.
-void GVNPRE::cleanup() {
- while (!createdExpressions.empty()) {
- Instruction* I = createdExpressions.back();
- createdExpressions.pop_back();
-
- delete I;
- }
-}
-
-/// buildsets_availout - When calculating availability, handle an instruction
-/// by inserting it into the appropriate sets
-void GVNPRE::buildsets_availout(BasicBlock::iterator I,
- ValueNumberedSet& currAvail,
- ValueNumberedSet& currPhis,
- ValueNumberedSet& currExps,
- SmallPtrSet<Value*, 16>& currTemps) {
- // Handle PHI nodes
- if (PHINode* p = dyn_cast<PHINode>(I)) {
- unsigned num = VN.lookup_or_add(p);
-
- currPhis.insert(p);
- currPhis.set(num);
-
- // Handle unary ops
- } else if (CastInst* U = dyn_cast<CastInst>(I)) {
- Value* leftValue = U->getOperand(0);
-
- unsigned num = VN.lookup_or_add(U);
-
- if (isa<Instruction>(leftValue))
- if (!currExps.test(VN.lookup(leftValue))) {
- currExps.insert(leftValue);
- currExps.set(VN.lookup(leftValue));
- }
-
- if (!currExps.test(num)) {
- currExps.insert(U);
- currExps.set(num);
- }
-
- // Handle binary ops
- } else if (isa<BinaryOperator>(I) || isa<CmpInst>(I) ||
- isa<ExtractElementInst>(I)) {
- User* U = cast<User>(I);
- Value* leftValue = U->getOperand(0);
- Value* rightValue = U->getOperand(1);
-
- unsigned num = VN.lookup_or_add(U);
-
- if (isa<Instruction>(leftValue))
- if (!currExps.test(VN.lookup(leftValue))) {
- currExps.insert(leftValue);
- currExps.set(VN.lookup(leftValue));
- }
-
- if (isa<Instruction>(rightValue))
- if (!currExps.test(VN.lookup(rightValue))) {
- currExps.insert(rightValue);
- currExps.set(VN.lookup(rightValue));
- }
-
- if (!currExps.test(num)) {
- currExps.insert(U);
- currExps.set(num);
- }
-
- // Handle ternary ops
- } else if (isa<InsertElementInst>(I) || isa<ShuffleVectorInst>(I) ||
- isa<SelectInst>(I)) {
- User* U = cast<User>(I);
- Value* leftValue = U->getOperand(0);
- Value* rightValue = U->getOperand(1);
- Value* thirdValue = U->getOperand(2);
-
- VN.lookup_or_add(U);
-
- unsigned num = VN.lookup_or_add(U);
-
- if (isa<Instruction>(leftValue))
- if (!currExps.test(VN.lookup(leftValue))) {
- currExps.insert(leftValue);
- currExps.set(VN.lookup(leftValue));
- }
- if (isa<Instruction>(rightValue))
- if (!currExps.test(VN.lookup(rightValue))) {
- currExps.insert(rightValue);
- currExps.set(VN.lookup(rightValue));
- }
- if (isa<Instruction>(thirdValue))
- if (!currExps.test(VN.lookup(thirdValue))) {
- currExps.insert(thirdValue);
- currExps.set(VN.lookup(thirdValue));
- }
-
- if (!currExps.test(num)) {
- currExps.insert(U);
- currExps.set(num);
- }
-
- // Handle vararg ops
- } else if (GetElementPtrInst* U = dyn_cast<GetElementPtrInst>(I)) {
- Value* ptrValue = U->getPointerOperand();
-
- VN.lookup_or_add(U);
-
- unsigned num = VN.lookup_or_add(U);
-
- if (isa<Instruction>(ptrValue))
- if (!currExps.test(VN.lookup(ptrValue))) {
- currExps.insert(ptrValue);
- currExps.set(VN.lookup(ptrValue));
- }
-
- for (GetElementPtrInst::op_iterator OI = U->idx_begin(), OE = U->idx_end();
- OI != OE; ++OI)
- if (isa<Instruction>(*OI) && !currExps.test(VN.lookup(*OI))) {
- currExps.insert(*OI);
- currExps.set(VN.lookup(*OI));
- }
-
- if (!currExps.test(VN.lookup(U))) {
- currExps.insert(U);
- currExps.set(num);
- }
-
- // Handle opaque ops
- } else if (!I->isTerminator()){
- VN.lookup_or_add(I);
-
- currTemps.insert(I);
- }
-
- if (!I->isTerminator())
- if (!currAvail.test(VN.lookup(I))) {
- currAvail.insert(I);
- currAvail.set(VN.lookup(I));
- }
-}
-
-/// buildsets_anticout - When walking the postdom tree, calculate the ANTIC_OUT
-/// set as a function of the ANTIC_IN set of the block's predecessors
-bool GVNPRE::buildsets_anticout(BasicBlock* BB,
- ValueNumberedSet& anticOut,
- SmallPtrSet<BasicBlock*, 8>& visited) {
- if (BB->getTerminator()->getNumSuccessors() == 1) {
- if (BB->getTerminator()->getSuccessor(0) != BB &&
- visited.count(BB->getTerminator()->getSuccessor(0)) == 0) {
- return true;
- }
- else {
- phi_translate_set(anticipatedIn[BB->getTerminator()->getSuccessor(0)],
- BB, BB->getTerminator()->getSuccessor(0), anticOut);
- }
- } else if (BB->getTerminator()->getNumSuccessors() > 1) {
- BasicBlock* first = BB->getTerminator()->getSuccessor(0);
- for (ValueNumberedSet::iterator I = anticipatedIn[first].begin(),
- E = anticipatedIn[first].end(); I != E; ++I) {
- anticOut.insert(*I);
- anticOut.set(VN.lookup(*I));
- }
-
- for (unsigned i = 1; i < BB->getTerminator()->getNumSuccessors(); ++i) {
- BasicBlock* currSucc = BB->getTerminator()->getSuccessor(i);
- ValueNumberedSet& succAnticIn = anticipatedIn[currSucc];
-
- SmallVector<Value*, 16> temp;
-
- for (ValueNumberedSet::iterator I = anticOut.begin(),
- E = anticOut.end(); I != E; ++I)
- if (!succAnticIn.test(VN.lookup(*I)))
- temp.push_back(*I);
-
- for (SmallVector<Value*, 16>::iterator I = temp.begin(), E = temp.end();
- I != E; ++I) {
- anticOut.erase(*I);
- anticOut.reset(VN.lookup(*I));
- }
- }
- }
-
- return false;
-}
-
-/// buildsets_anticin - Walk the postdom tree, calculating ANTIC_OUT for
-/// each block. ANTIC_IN is then a function of ANTIC_OUT and the GEN
-/// sets populated in buildsets_availout
-unsigned GVNPRE::buildsets_anticin(BasicBlock* BB,
- ValueNumberedSet& anticOut,
- ValueNumberedSet& currExps,
- SmallPtrSet<Value*, 16>& currTemps,
- SmallPtrSet<BasicBlock*, 8>& visited) {
- ValueNumberedSet& anticIn = anticipatedIn[BB];
- unsigned old = anticIn.size();
-
- bool defer = buildsets_anticout(BB, anticOut, visited);
- if (defer)
- return 0;
-
- anticIn.clear();
-
- for (ValueNumberedSet::iterator I = anticOut.begin(),
- E = anticOut.end(); I != E; ++I) {
- anticIn.insert(*I);
- anticIn.set(VN.lookup(*I));
- }
- for (ValueNumberedSet::iterator I = currExps.begin(),
- E = currExps.end(); I != E; ++I) {
- if (!anticIn.test(VN.lookup(*I))) {
- anticIn.insert(*I);
- anticIn.set(VN.lookup(*I));
- }
- }
-
- for (SmallPtrSet<Value*, 16>::iterator I = currTemps.begin(),
- E = currTemps.end(); I != E; ++I) {
- anticIn.erase(*I);
- anticIn.reset(VN.lookup(*I));
- }
-
- clean(anticIn);
- anticOut.clear();
-
- if (old != anticIn.size())
- return 2;
- else
- return 1;
-}
-
-/// buildsets - Phase 1 of the main algorithm. Construct the AVAIL_OUT
-/// and the ANTIC_IN sets.
-void GVNPRE::buildsets(Function& F) {
- DenseMap<BasicBlock*, ValueNumberedSet> generatedExpressions;
- DenseMap<BasicBlock*, SmallPtrSet<Value*, 16> > generatedTemporaries;
-
- DominatorTree &DT = getAnalysis<DominatorTree>();
-
- // Phase 1, Part 1: calculate AVAIL_OUT
-
- // Top-down walk of the dominator tree
- for (df_iterator<DomTreeNode*> DI = df_begin(DT.getRootNode()),
- E = df_end(DT.getRootNode()); DI != E; ++DI) {
-
- // Get the sets to update for this block
- ValueNumberedSet& currExps = generatedExpressions[DI->getBlock()];
- ValueNumberedSet& currPhis = generatedPhis[DI->getBlock()];
- SmallPtrSet<Value*, 16>& currTemps = generatedTemporaries[DI->getBlock()];
- ValueNumberedSet& currAvail = availableOut[DI->getBlock()];
-
- BasicBlock* BB = DI->getBlock();
-
- // A block inherits AVAIL_OUT from its dominator
- if (DI->getIDom() != 0)
- currAvail = availableOut[DI->getIDom()->getBlock()];
-
- for (BasicBlock::iterator BI = BB->begin(), BE = BB->end();
- BI != BE; ++BI)
- buildsets_availout(BI, currAvail, currPhis, currExps,
- currTemps);
-
- }
-
- // Phase 1, Part 2: calculate ANTIC_IN
-
- SmallPtrSet<BasicBlock*, 8> visited;
- SmallPtrSet<BasicBlock*, 4> block_changed;
- for (Function::iterator FI = F.begin(), FE = F.end(); FI != FE; ++FI)
- block_changed.insert(FI);
-
- bool changed = true;
- unsigned iterations = 0;
-
- while (changed) {
- changed = false;
- ValueNumberedSet anticOut;
-
- // Postorder walk of the CFG
- for (po_iterator<BasicBlock*> BBI = po_begin(&F.getEntryBlock()),
- BBE = po_end(&F.getEntryBlock()); BBI != BBE; ++BBI) {
- BasicBlock* BB = *BBI;
-
- if (block_changed.count(BB) != 0) {
- unsigned ret = buildsets_anticin(BB, anticOut,generatedExpressions[BB],
- generatedTemporaries[BB], visited);
-
- if (ret == 0) {
- changed = true;
- continue;
- } else {
- visited.insert(BB);
-
- if (ret == 2)
- for (pred_iterator PI = pred_begin(BB), PE = pred_end(BB);
- PI != PE; ++PI) {
- block_changed.insert(*PI);
- }
- else
- block_changed.erase(BB);
-
- changed |= (ret == 2);
- }
- }
- }
-
- iterations++;
- }
-}
-
-/// insertion_pre - When a partial redundancy has been identified, eliminate it
-/// by inserting appropriate values into the predecessors and a phi node in
-/// the main block
-void GVNPRE::insertion_pre(Value* e, BasicBlock* BB,
- DenseMap<BasicBlock*, Value*>& avail,
- std::map<BasicBlock*, ValueNumberedSet>& new_sets) {
- for (pred_iterator PI = pred_begin(BB), PE = pred_end(BB); PI != PE; ++PI) {
- Value* e2 = avail[*PI];
- if (!availableOut[*PI].test(VN.lookup(e2))) {
- User* U = cast<User>(e2);
-
- Value* s1 = 0;
- if (isa<BinaryOperator>(U->getOperand(0)) ||
- isa<CmpInst>(U->getOperand(0)) ||
- isa<ShuffleVectorInst>(U->getOperand(0)) ||
- isa<ExtractElementInst>(U->getOperand(0)) ||
- isa<InsertElementInst>(U->getOperand(0)) ||
- isa<SelectInst>(U->getOperand(0)) ||
- isa<CastInst>(U->getOperand(0)) ||
- isa<GetElementPtrInst>(U->getOperand(0)))
- s1 = find_leader(availableOut[*PI], VN.lookup(U->getOperand(0)));
- else
- s1 = U->getOperand(0);
-
- Value* s2 = 0;
-
- if (isa<BinaryOperator>(U) ||
- isa<CmpInst>(U) ||
- isa<ShuffleVectorInst>(U) ||
- isa<ExtractElementInst>(U) ||
- isa<InsertElementInst>(U) ||
- isa<SelectInst>(U)) {
- if (isa<BinaryOperator>(U->getOperand(1)) ||
- isa<CmpInst>(U->getOperand(1)) ||
- isa<ShuffleVectorInst>(U->getOperand(1)) ||
- isa<ExtractElementInst>(U->getOperand(1)) ||
- isa<InsertElementInst>(U->getOperand(1)) ||
- isa<SelectInst>(U->getOperand(1)) ||
- isa<CastInst>(U->getOperand(1)) ||
- isa<GetElementPtrInst>(U->getOperand(1))) {
- s2 = find_leader(availableOut[*PI], VN.lookup(U->getOperand(1)));
- } else {
- s2 = U->getOperand(1);
- }
- }
-
- // Ternary Operators
- Value* s3 = 0;
- if (isa<ShuffleVectorInst>(U) ||
- isa<InsertElementInst>(U) ||
- isa<SelectInst>(U)) {
- if (isa<BinaryOperator>(U->getOperand(2)) ||
- isa<CmpInst>(U->getOperand(2)) ||
- isa<ShuffleVectorInst>(U->getOperand(2)) ||
- isa<ExtractElementInst>(U->getOperand(2)) ||
- isa<InsertElementInst>(U->getOperand(2)) ||
- isa<SelectInst>(U->getOperand(2)) ||
- isa<CastInst>(U->getOperand(2)) ||
- isa<GetElementPtrInst>(U->getOperand(2))) {
- s3 = find_leader(availableOut[*PI], VN.lookup(U->getOperand(2)));
- } else {
- s3 = U->getOperand(2);
- }
- }
-
- // Vararg operators
- SmallVector<Value*, 4> sVarargs;
- if (GetElementPtrInst* G = dyn_cast<GetElementPtrInst>(U)) {
- for (GetElementPtrInst::op_iterator OI = G->idx_begin(),
- OE = G->idx_end(); OI != OE; ++OI) {
- if (isa<BinaryOperator>(*OI) ||
- isa<CmpInst>(*OI) ||
- isa<ShuffleVectorInst>(*OI) ||
- isa<ExtractElementInst>(*OI) ||
- isa<InsertElementInst>(*OI) ||
- isa<SelectInst>(*OI) ||
- isa<CastInst>(*OI) ||
- isa<GetElementPtrInst>(*OI)) {
- sVarargs.push_back(find_leader(availableOut[*PI],
- VN.lookup(*OI)));
- } else {
- sVarargs.push_back(*OI);
- }
- }
- }
-
- Value* newVal = 0;
- if (BinaryOperator* BO = dyn_cast<BinaryOperator>(U))
- newVal = BinaryOperator::create(BO->getOpcode(), s1, s2,
- BO->getName()+".gvnpre",
- (*PI)->getTerminator());
- else if (CmpInst* C = dyn_cast<CmpInst>(U))
- newVal = CmpInst::create(C->getOpcode(), C->getPredicate(), s1, s2,
- C->getName()+".gvnpre",
- (*PI)->getTerminator());
- else if (ShuffleVectorInst* S = dyn_cast<ShuffleVectorInst>(U))
- newVal = new ShuffleVectorInst(s1, s2, s3, S->getName()+".gvnpre",
- (*PI)->getTerminator());
- else if (InsertElementInst* S = dyn_cast<InsertElementInst>(U))
- newVal = InsertElementInst::Create(s1, s2, s3, S->getName()+".gvnpre",
- (*PI)->getTerminator());
- else if (ExtractElementInst* S = dyn_cast<ExtractElementInst>(U))
- newVal = new ExtractElementInst(s1, s2, S->getName()+".gvnpre",
- (*PI)->getTerminator());
- else if (SelectInst* S = dyn_cast<SelectInst>(U))
- newVal = SelectInst::Create(s1, s2, s3, S->getName()+".gvnpre",
- (*PI)->getTerminator());
- else if (CastInst* C = dyn_cast<CastInst>(U))
- newVal = CastInst::create(C->getOpcode(), s1, C->getType(),
- C->getName()+".gvnpre",
- (*PI)->getTerminator());
- else if (GetElementPtrInst* G = dyn_cast<GetElementPtrInst>(U))
- newVal = GetElementPtrInst::Create(s1, sVarargs.begin(), sVarargs.end(),
- G->getName()+".gvnpre",
- (*PI)->getTerminator());
-
- VN.add(newVal, VN.lookup(U));
-
- ValueNumberedSet& predAvail = availableOut[*PI];
- val_replace(predAvail, newVal);
- val_replace(new_sets[*PI], newVal);
- predAvail.set(VN.lookup(newVal));
-
- DenseMap<BasicBlock*, Value*>::iterator av = avail.find(*PI);
- if (av != avail.end())
- avail.erase(av);
- avail.insert(std::make_pair(*PI, newVal));
-
- ++NumInsertedVals;
- }
- }
-
- PHINode* p = 0;
-
- for (pred_iterator PI = pred_begin(BB), PE = pred_end(BB); PI != PE; ++PI) {
- if (p == 0)
- p = PHINode::Create(avail[*PI]->getType(), "gvnpre-join", BB->begin());
-
- p->addIncoming(avail[*PI], *PI);
- }
-
- VN.add(p, VN.lookup(e));
- val_replace(availableOut[BB], p);
- availableOut[BB].set(VN.lookup(e));
- generatedPhis[BB].insert(p);
- generatedPhis[BB].set(VN.lookup(e));
- new_sets[BB].insert(p);
- new_sets[BB].set(VN.lookup(e));
-
- ++NumInsertedPhis;
-}
-
-/// insertion_mergepoint - When walking the dom tree, check at each merge
-/// block for the possibility of a partial redundancy. If present, eliminate it
-unsigned GVNPRE::insertion_mergepoint(SmallVector<Value*, 8>& workList,
- df_iterator<DomTreeNode*>& D,
- std::map<BasicBlock*, ValueNumberedSet >& new_sets) {
- bool changed_function = false;
- bool new_stuff = false;
-
- BasicBlock* BB = D->getBlock();
- for (unsigned i = 0; i < workList.size(); ++i) {
- Value* e = workList[i];
-
- if (isa<BinaryOperator>(e) || isa<CmpInst>(e) ||
- isa<ExtractElementInst>(e) || isa<InsertElementInst>(e) ||
- isa<ShuffleVectorInst>(e) || isa<SelectInst>(e) || isa<CastInst>(e) ||
- isa<GetElementPtrInst>(e)) {
- if (availableOut[D->getIDom()->getBlock()].test(VN.lookup(e)))
- continue;
-
- DenseMap<BasicBlock*, Value*> avail;
- bool by_some = false;
- bool all_same = true;
- Value * first_s = 0;
-
- for (pred_iterator PI = pred_begin(BB), PE = pred_end(BB); PI != PE;
- ++PI) {
- Value *e2 = phi_translate(e, *PI, BB);
- Value *e3 = find_leader(availableOut[*PI], VN.lookup(e2));
-
- if (e3 == 0) {
- DenseMap<BasicBlock*, Value*>::iterator av = avail.find(*PI);
- if (av != avail.end())
- avail.erase(av);
- avail.insert(std::make_pair(*PI, e2));
- all_same = false;
- } else {
- DenseMap<BasicBlock*, Value*>::iterator av = avail.find(*PI);
- if (av != avail.end())
- avail.erase(av);
- avail.insert(std::make_pair(*PI, e3));
-
- by_some = true;
- if (first_s == 0)
- first_s = e3;
- else if (first_s != e3)
- all_same = false;
- }
- }
-
- if (by_some && !all_same &&
- !generatedPhis[BB].test(VN.lookup(e))) {
- insertion_pre(e, BB, avail, new_sets);
-
- changed_function = true;
- new_stuff = true;
- }
- }
- }
-
- unsigned retval = 0;
- if (changed_function)
- retval += 1;
- if (new_stuff)
- retval += 2;
-
- return retval;
-}
-
-/// insert - Phase 2 of the main algorithm. Walk the dominator tree looking for
-/// merge points. When one is found, check for a partial redundancy. If one is
-/// present, eliminate it. Repeat this walk until no changes are made.
-bool GVNPRE::insertion(Function& F) {
- bool changed_function = false;
-
- DominatorTree &DT = getAnalysis<DominatorTree>();
-
- std::map<BasicBlock*, ValueNumberedSet> new_sets;
- bool new_stuff = true;
- while (new_stuff) {
- new_stuff = false;
- for (df_iterator<DomTreeNode*> DI = df_begin(DT.getRootNode()),
- E = df_end(DT.getRootNode()); DI != E; ++DI) {
- BasicBlock* BB = DI->getBlock();
-
- if (BB == 0)
- continue;
-
- ValueNumberedSet& availOut = availableOut[BB];
- ValueNumberedSet& anticIn = anticipatedIn[BB];
-
- // Replace leaders with leaders inherited from dominator
- if (DI->getIDom() != 0) {
- ValueNumberedSet& dom_set = new_sets[DI->getIDom()->getBlock()];
- for (ValueNumberedSet::iterator I = dom_set.begin(),
- E = dom_set.end(); I != E; ++I) {
- val_replace(new_sets[BB], *I);
- val_replace(availOut, *I);
- }
- }
-
- // If there is more than one predecessor...
- if (pred_begin(BB) != pred_end(BB) && ++pred_begin(BB) != pred_end(BB)) {
- SmallVector<Value*, 8> workList;
- workList.reserve(anticIn.size());
- topo_sort(anticIn, workList);
-
- unsigned result = insertion_mergepoint(workList, DI, new_sets);
- if (result & 1)
- changed_function = true;
- if (result & 2)
- new_stuff = true;
- }
- }
- }
-
- return changed_function;
-}
-
-// GVNPRE::runOnFunction - This is the main transformation entry point for a
-// function.
-//
-bool GVNPRE::runOnFunction(Function &F) {
- // Clean out global sets from any previous functions
- VN.clear();
- createdExpressions.clear();
- availableOut.clear();
- anticipatedIn.clear();
- generatedPhis.clear();
-
- bool changed_function = false;
-
- // Phase 1: BuildSets
- // This phase calculates the AVAIL_OUT and ANTIC_IN sets
- buildsets(F);
-
- // Phase 2: Insert
- // This phase inserts values to make partially redundant values
- // fully redundant
- changed_function |= insertion(F);
-
- // Phase 3: Eliminate
- // This phase performs trivial full redundancy elimination
- changed_function |= elimination();
-
- // Phase 4: Cleanup
- // This phase cleans up values that were created solely
- // as leaders for expressions
- cleanup();
-
- return changed_function;
-}
diff --git a/release_23/lib/Transforms/Scalar/IndVarSimplify.cpp b/release_23/lib/Transforms/Scalar/IndVarSimplify.cpp
deleted file mode 100644
index 43054227aeae..000000000000
--- a/release_23/lib/Transforms/Scalar/IndVarSimplify.cpp
+++ /dev/null
@@ -1,607 +0,0 @@
-//===- IndVarSimplify.cpp - Induction Variable Elimination ----------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This transformation analyzes and transforms the induction variables (and
-// computations derived from them) into simpler forms suitable for subsequent
-// analysis and transformation.
-//
-// This transformation makes the following changes to each loop with an
-// identifiable induction variable:
-// 1. All loops are transformed to have a SINGLE canonical induction variable
-// which starts at zero and steps by one.
-// 2. The canonical induction variable is guaranteed to be the first PHI node
-// in the loop header block.
-// 3. Any pointer arithmetic recurrences are raised to use array subscripts.
-//
-// If the trip count of a loop is computable, this pass also makes the following
-// changes:
-// 1. The exit condition for the loop is canonicalized to compare the
-// induction value against the exit value. This turns loops like:
-// 'for (i = 7; i*i < 1000; ++i)' into 'for (i = 0; i != 25; ++i)'
-// 2. Any use outside of the loop of an expression derived from the indvar
-// is changed to compute the derived value outside of the loop, eliminating
-// the dependence on the exit value of the induction variable. If the only
-// purpose of the loop is to compute the exit value of some derived
-// expression, this transformation will make the loop dead.
-//
-// This transformation should be followed by strength reduction after all of the
-// desired loop transformations have been performed. Additionally, on targets
-// where it is profitable, the loop could be transformed to count down to zero
-// (the "do loop" optimization).
-//
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "indvars"
-#include "llvm/Transforms/Scalar.h"
-#include "llvm/BasicBlock.h"
-#include "llvm/Constants.h"
-#include "llvm/Instructions.h"
-#include "llvm/Type.h"
-#include "llvm/Analysis/ScalarEvolutionExpander.h"
-#include "llvm/Analysis/LoopInfo.h"
-#include "llvm/Analysis/LoopPass.h"
-#include "llvm/Support/CFG.h"
-#include "llvm/Support/Compiler.h"
-#include "llvm/Support/Debug.h"
-#include "llvm/Support/GetElementPtrTypeIterator.h"
-#include "llvm/Transforms/Utils/Local.h"
-#include "llvm/Support/CommandLine.h"
-#include "llvm/ADT/SmallVector.h"
-#include "llvm/ADT/Statistic.h"
-using namespace llvm;
-
-STATISTIC(NumRemoved , "Number of aux indvars removed");
-STATISTIC(NumPointer , "Number of pointer indvars promoted");
-STATISTIC(NumInserted, "Number of canonical indvars added");
-STATISTIC(NumReplaced, "Number of exit values replaced");
-STATISTIC(NumLFTR , "Number of loop exit tests replaced");
-
-namespace {
- class VISIBILITY_HIDDEN IndVarSimplify : public LoopPass {
- LoopInfo *LI;
- ScalarEvolution *SE;
- bool Changed;
- public:
-
- static char ID; // Pass identification, replacement for typeid
- IndVarSimplify() : LoopPass((intptr_t)&ID) {}
-
- bool runOnLoop(Loop *L, LPPassManager &LPM);
- bool doInitialization(Loop *L, LPPassManager &LPM);
- virtual void getAnalysisUsage(AnalysisUsage &AU) const {
- AU.addRequired<ScalarEvolution>();
- AU.addRequiredID(LCSSAID);
- AU.addRequiredID(LoopSimplifyID);
- AU.addRequired<LoopInfo>();
- AU.addPreservedID(LoopSimplifyID);
- AU.addPreservedID(LCSSAID);
- AU.setPreservesCFG();
- }
-
- private:
-
- void EliminatePointerRecurrence(PHINode *PN, BasicBlock *Preheader,
- std::set<Instruction*> &DeadInsts);
- Instruction *LinearFunctionTestReplace(Loop *L, SCEV *IterationCount,
- SCEVExpander &RW);
- void RewriteLoopExitValues(Loop *L);
-
- void DeleteTriviallyDeadInstructions(std::set<Instruction*> &Insts);
- };
-
- char IndVarSimplify::ID = 0;
- RegisterPass<IndVarSimplify> X("indvars", "Canonicalize Induction Variables");
-}
-
-LoopPass *llvm::createIndVarSimplifyPass() {
- return new IndVarSimplify();
-}
-
-/// DeleteTriviallyDeadInstructions - If any of the instructions is the
-/// specified set are trivially dead, delete them and see if this makes any of
-/// their operands subsequently dead.
-void IndVarSimplify::
-DeleteTriviallyDeadInstructions(std::set<Instruction*> &Insts) {
- while (!Insts.empty()) {
- Instruction *I = *Insts.begin();
- Insts.erase(Insts.begin());
- if (isInstructionTriviallyDead(I)) {
- for (unsigned i = 0, e = I->getNumOperands(); i != e; ++i)
- if (Instruction *U = dyn_cast<Instruction>(I->getOperand(i)))
- Insts.insert(U);
- SE->deleteValueFromRecords(I);
- DOUT << "INDVARS: Deleting: " << *I;
- I->eraseFromParent();
- Changed = true;
- }
- }
-}
-
-
-/// EliminatePointerRecurrence - Check to see if this is a trivial GEP pointer
-/// recurrence. If so, change it into an integer recurrence, permitting
-/// analysis by the SCEV routines.
-void IndVarSimplify::EliminatePointerRecurrence(PHINode *PN,
- BasicBlock *Preheader,
- std::set<Instruction*> &DeadInsts) {
- assert(PN->getNumIncomingValues() == 2 && "Noncanonicalized loop!");
- unsigned PreheaderIdx = PN->getBasicBlockIndex(Preheader);
- unsigned BackedgeIdx = PreheaderIdx^1;
- if (GetElementPtrInst *GEPI =
- dyn_cast<GetElementPtrInst>(PN->getIncomingValue(BackedgeIdx)))
- if (GEPI->getOperand(0) == PN) {
- assert(GEPI->getNumOperands() == 2 && "GEP types must match!");
- DOUT << "INDVARS: Eliminating pointer recurrence: " << *GEPI;
-
- // Okay, we found a pointer recurrence. Transform this pointer
- // recurrence into an integer recurrence. Compute the value that gets
- // added to the pointer at every iteration.
- Value *AddedVal = GEPI->getOperand(1);
-
- // Insert a new integer PHI node into the top of the block.
- PHINode *NewPhi = PHINode::Create(AddedVal->getType(),
- PN->getName()+".rec", PN);
- NewPhi->addIncoming(Constant::getNullValue(NewPhi->getType()), Preheader);
-
- // Create the new add instruction.
- Value *NewAdd = BinaryOperator::createAdd(NewPhi, AddedVal,
- GEPI->getName()+".rec", GEPI);
- NewPhi->addIncoming(NewAdd, PN->getIncomingBlock(BackedgeIdx));
-
- // Update the existing GEP to use the recurrence.
- GEPI->setOperand(0, PN->getIncomingValue(PreheaderIdx));
-
- // Update the GEP to use the new recurrence we just inserted.
- GEPI->setOperand(1, NewAdd);
-
- // If the incoming value is a constant expr GEP, try peeling out the array
- // 0 index if possible to make things simpler.
- if (ConstantExpr *CE = dyn_cast<ConstantExpr>(GEPI->getOperand(0)))
- if (CE->getOpcode() == Instruction::GetElementPtr) {
- unsigned NumOps = CE->getNumOperands();
- assert(NumOps > 1 && "CE folding didn't work!");
- if (CE->getOperand(NumOps-1)->isNullValue()) {
- // Check to make sure the last index really is an array index.
- gep_type_iterator GTI = gep_type_begin(CE);
- for (unsigned i = 1, e = CE->getNumOperands()-1;
- i != e; ++i, ++GTI)
- /*empty*/;
- if (isa<SequentialType>(*GTI)) {
- // Pull the last index out of the constant expr GEP.
- SmallVector<Value*, 8> CEIdxs(CE->op_begin()+1, CE->op_end()-1);
- Constant *NCE = ConstantExpr::getGetElementPtr(CE->getOperand(0),
- &CEIdxs[0],
- CEIdxs.size());
- Value *Idx[2];
- Idx[0] = Constant::getNullValue(Type::Int32Ty);
- Idx[1] = NewAdd;
- GetElementPtrInst *NGEPI = GetElementPtrInst::Create(
- NCE, Idx, Idx + 2,
- GEPI->getName(), GEPI);
- SE->deleteValueFromRecords(GEPI);
- GEPI->replaceAllUsesWith(NGEPI);
- GEPI->eraseFromParent();
- GEPI = NGEPI;
- }
- }
- }
-
-
- // Finally, if there are any other users of the PHI node, we must
- // insert a new GEP instruction that uses the pre-incremented version
- // of the induction amount.
- if (!PN->use_empty()) {
- BasicBlock::iterator InsertPos = PN; ++InsertPos;
- while (isa<PHINode>(InsertPos)) ++InsertPos;
- Value *PreInc =
- GetElementPtrInst::Create(PN->getIncomingValue(PreheaderIdx),
- NewPhi, "", InsertPos);
- PreInc->takeName(PN);
- PN->replaceAllUsesWith(PreInc);
- }
-
- // Delete the old PHI for sure, and the GEP if its otherwise unused.
- DeadInsts.insert(PN);
-
- ++NumPointer;
- Changed = true;
- }
-}
-
-/// LinearFunctionTestReplace - This method rewrites the exit condition of the
-/// loop to be a canonical != comparison against the incremented loop induction
-/// variable. This pass is able to rewrite the exit tests of any loop where the
-/// SCEV analysis can determine a loop-invariant trip count of the loop, which
-/// is actually a much broader range than just linear tests.
-///
-/// This method returns a "potentially dead" instruction whose computation chain
-/// should be deleted when convenient.
-Instruction *IndVarSimplify::LinearFunctionTestReplace(Loop *L,
- SCEV *IterationCount,
- SCEVExpander &RW) {
- // Find the exit block for the loop. We can currently only handle loops with
- // a single exit.
- SmallVector<BasicBlock*, 8> ExitBlocks;
- L->getExitBlocks(ExitBlocks);
- if (ExitBlocks.size() != 1) return 0;
- BasicBlock *ExitBlock = ExitBlocks[0];
-
- // Make sure there is only one predecessor block in the loop.
- BasicBlock *ExitingBlock = 0;
- for (pred_iterator PI = pred_begin(ExitBlock), PE = pred_end(ExitBlock);
- PI != PE; ++PI)
- if (L->contains(*PI)) {
- if (ExitingBlock == 0)
- ExitingBlock = *PI;
- else
- return 0; // Multiple exits from loop to this block.
- }
- assert(ExitingBlock && "Loop info is broken");
-
- if (!isa<BranchInst>(ExitingBlock->getTerminator()))
- return 0; // Can't rewrite non-branch yet
- BranchInst *BI = cast<BranchInst>(ExitingBlock->getTerminator());
- assert(BI->isConditional() && "Must be conditional to be part of loop!");
-
- Instruction *PotentiallyDeadInst = dyn_cast<Instruction>(BI->getCondition());
-
- // If the exiting block is not the same as the backedge block, we must compare
- // against the preincremented value, otherwise we prefer to compare against
- // the post-incremented value.
- BasicBlock *Header = L->getHeader();
- pred_iterator HPI = pred_begin(Header);
- assert(HPI != pred_end(Header) && "Loop with zero preds???");
- if (!L->contains(*HPI)) ++HPI;
- assert(HPI != pred_end(Header) && L->contains(*HPI) &&
- "No backedge in loop?");
-
- SCEVHandle TripCount = IterationCount;
- Value *IndVar;
- if (*HPI == ExitingBlock) {
- // The IterationCount expression contains the number of times that the
- // backedge actually branches to the loop header. This is one less than the
- // number of times the loop executes, so add one to it.
- ConstantInt *OneC = ConstantInt::get(IterationCount->getType(), 1);
- TripCount = SE->getAddExpr(IterationCount, SE->getConstant(OneC));
- IndVar = L->getCanonicalInductionVariableIncrement();
- } else {
- // We have to use the preincremented value...
- IndVar = L->getCanonicalInductionVariable();
- }
-
- DOUT << "INDVARS: LFTR: TripCount = " << *TripCount
- << " IndVar = " << *IndVar << "\n";
-
- // Expand the code for the iteration count into the preheader of the loop.
- BasicBlock *Preheader = L->getLoopPreheader();
- Value *ExitCnt = RW.expandCodeFor(TripCount, Preheader->getTerminator());
-
- // Insert a new icmp_ne or icmp_eq instruction before the branch.
- ICmpInst::Predicate Opcode;
- if (L->contains(BI->getSuccessor(0)))
- Opcode = ICmpInst::ICMP_NE;
- else
- Opcode = ICmpInst::ICMP_EQ;
-
- Value *Cond = new ICmpInst(Opcode, IndVar, ExitCnt, "exitcond", BI);
- BI->setCondition(Cond);
- ++NumLFTR;
- Changed = true;
- return PotentiallyDeadInst;
-}
-
-
-/// RewriteLoopExitValues - Check to see if this loop has a computable
-/// loop-invariant execution count. If so, this means that we can compute the
-/// final value of any expressions that are recurrent in the loop, and
-/// substitute the exit values from the loop into any instructions outside of
-/// the loop that use the final values of the current expressions.
-void IndVarSimplify::RewriteLoopExitValues(Loop *L) {
- BasicBlock *Preheader = L->getLoopPreheader();
-
- // Scan all of the instructions in the loop, looking at those that have
- // extra-loop users and which are recurrences.
- SCEVExpander Rewriter(*SE, *LI);
-
- // We insert the code into the preheader of the loop if the loop contains
- // multiple exit blocks, or in the exit block if there is exactly one.
- BasicBlock *BlockToInsertInto;
- SmallVector<BasicBlock*, 8> ExitBlocks;
- L->getUniqueExitBlocks(ExitBlocks);
- if (ExitBlocks.size() == 1)
- BlockToInsertInto = ExitBlocks[0];
- else
- BlockToInsertInto = Preheader;
- BasicBlock::iterator InsertPt = BlockToInsertInto->begin();
- while (isa<PHINode>(InsertPt)) ++InsertPt;
-
- bool HasConstantItCount = isa<SCEVConstant>(SE->getIterationCount(L));
-
- std::set<Instruction*> InstructionsToDelete;
- std::map<Instruction*, Value*> ExitValues;
-
- // Find all values that are computed inside the loop, but used outside of it.
- // Because of LCSSA, these values will only occur in LCSSA PHI Nodes. Scan
- // the exit blocks of the loop to find them.
- for (unsigned i = 0, e = ExitBlocks.size(); i != e; ++i) {
- BasicBlock *ExitBB = ExitBlocks[i];
-
- // If there are no PHI nodes in this exit block, then no values defined
- // inside the loop are used on this path, skip it.
- PHINode *PN = dyn_cast<PHINode>(ExitBB->begin());
- if (!PN) continue;
-
- unsigned NumPreds = PN->getNumIncomingValues();
-
- // Iterate over all of the PHI nodes.
- BasicBlock::iterator BBI = ExitBB->begin();
- while ((PN = dyn_cast<PHINode>(BBI++))) {
-
- // Iterate over all of the values in all the PHI nodes.
- for (unsigned i = 0; i != NumPreds; ++i) {
- // If the value being merged in is not integer or is not defined
- // in the loop, skip it.
- Value *InVal = PN->getIncomingValue(i);
- if (!isa<Instruction>(InVal) ||
- // SCEV only supports integer expressions for now.
- !isa<IntegerType>(InVal->getType()))
- continue;
-
- // If this pred is for a subloop, not L itself, skip it.
- if (LI->getLoopFor(PN->getIncomingBlock(i)) != L)
- continue; // The Block is in a subloop, skip it.
-
- // Check that InVal is defined in the loop.
- Instruction *Inst = cast<Instruction>(InVal);
- if (!L->contains(Inst->getParent()))
- continue;
-
- // We require that this value either have a computable evolution or that
- // the loop have a constant iteration count. In the case where the loop
- // has a constant iteration count, we can sometimes force evaluation of
- // the exit value through brute force.
- SCEVHandle SH = SE->getSCEV(Inst);
- if (!SH->hasComputableLoopEvolution(L) && !HasConstantItCount)
- continue; // Cannot get exit evolution for the loop value.
-
- // Okay, this instruction has a user outside of the current loop
- // and varies predictably *inside* the loop. Evaluate the value it
- // contains when the loop exits, if possible.
- SCEVHandle ExitValue = SE->getSCEVAtScope(Inst, L->getParentLoop());
- if (isa<SCEVCouldNotCompute>(ExitValue) ||
- !ExitValue->isLoopInvariant(L))
- continue;
-
- Changed = true;
- ++NumReplaced;
-
- // See if we already computed the exit value for the instruction, if so,
- // just reuse it.
- Value *&ExitVal = ExitValues[Inst];
- if (!ExitVal)
- ExitVal = Rewriter.expandCodeFor(ExitValue, InsertPt);
-
- DOUT << "INDVARS: RLEV: AfterLoopVal = " << *ExitVal
- << " LoopVal = " << *Inst << "\n";
-
- PN->setIncomingValue(i, ExitVal);
-
- // If this instruction is dead now, schedule it to be removed.
- if (Inst->use_empty())
- InstructionsToDelete.insert(Inst);
-
- // See if this is a single-entry LCSSA PHI node. If so, we can (and
- // have to) remove
- // the PHI entirely. This is safe, because the NewVal won't be variant
- // in the loop, so we don't need an LCSSA phi node anymore.
- if (NumPreds == 1) {
- SE->deleteValueFromRecords(PN);
- PN->replaceAllUsesWith(ExitVal);
- PN->eraseFromParent();
- break;
- }
- }
- }
- }
-
- DeleteTriviallyDeadInstructions(InstructionsToDelete);
-}
-
-bool IndVarSimplify::doInitialization(Loop *L, LPPassManager &LPM) {
-
- Changed = false;
- // First step. Check to see if there are any trivial GEP pointer recurrences.
- // If there are, change them into integer recurrences, permitting analysis by
- // the SCEV routines.
- //
- BasicBlock *Header = L->getHeader();
- BasicBlock *Preheader = L->getLoopPreheader();
- SE = &LPM.getAnalysis<ScalarEvolution>();
-
- std::set<Instruction*> DeadInsts;
- for (BasicBlock::iterator I = Header->begin(); isa<PHINode>(I); ++I) {
- PHINode *PN = cast<PHINode>(I);
- if (isa<PointerType>(PN->getType()))
- EliminatePointerRecurrence(PN, Preheader, DeadInsts);
- }
-
- if (!DeadInsts.empty())
- DeleteTriviallyDeadInstructions(DeadInsts);
-
- return Changed;
-}
-
-bool IndVarSimplify::runOnLoop(Loop *L, LPPassManager &LPM) {
-
-
- LI = &getAnalysis<LoopInfo>();
- SE = &getAnalysis<ScalarEvolution>();
-
- Changed = false;
- BasicBlock *Header = L->getHeader();
- std::set<Instruction*> DeadInsts;
-
- // Verify the input to the pass in already in LCSSA form.
- assert(L->isLCSSAForm());
-
- // Check to see if this loop has a computable loop-invariant execution count.
- // If so, this means that we can compute the final value of any expressions
- // that are recurrent in the loop, and substitute the exit values from the
- // loop into any instructions outside of the loop that use the final values of
- // the current expressions.
- //
- SCEVHandle IterationCount = SE->getIterationCount(L);
- if (!isa<SCEVCouldNotCompute>(IterationCount))
- RewriteLoopExitValues(L);
-
- // Next, analyze all of the induction variables in the loop, canonicalizing
- // auxillary induction variables.
- std::vector<std::pair<PHINode*, SCEVHandle> > IndVars;
-
- for (BasicBlock::iterator I = Header->begin(); isa<PHINode>(I); ++I) {
- PHINode *PN = cast<PHINode>(I);
- if (PN->getType()->isInteger()) { // FIXME: when we have fast-math, enable!
- SCEVHandle SCEV = SE->getSCEV(PN);
- if (SCEV->hasComputableLoopEvolution(L))
- // FIXME: It is an extremely bad idea to indvar substitute anything more
- // complex than affine induction variables. Doing so will put expensive
- // polynomial evaluations inside of the loop, and the str reduction pass
- // currently can only reduce affine polynomials. For now just disable
- // indvar subst on anything more complex than an affine addrec.
- if (SCEVAddRecExpr *AR = dyn_cast<SCEVAddRecExpr>(SCEV))
- if (AR->isAffine())
- IndVars.push_back(std::make_pair(PN, SCEV));
- }
- }
-
- // If there are no induction variables in the loop, there is nothing more to
- // do.
- if (IndVars.empty()) {
- // Actually, if we know how many times the loop iterates, lets insert a
- // canonical induction variable to help subsequent passes.
- if (!isa<SCEVCouldNotCompute>(IterationCount)) {
- SCEVExpander Rewriter(*SE, *LI);
- Rewriter.getOrInsertCanonicalInductionVariable(L,
- IterationCount->getType());
- if (Instruction *I = LinearFunctionTestReplace(L, IterationCount,
- Rewriter)) {
- std::set<Instruction*> InstructionsToDelete;
- InstructionsToDelete.insert(I);
- DeleteTriviallyDeadInstructions(InstructionsToDelete);
- }
- }
- return Changed;
- }
-
- // Compute the type of the largest recurrence expression.
- //
- const Type *LargestType = IndVars[0].first->getType();
- bool DifferingSizes = false;
- for (unsigned i = 1, e = IndVars.size(); i != e; ++i) {
- const Type *Ty = IndVars[i].first->getType();
- DifferingSizes |=
- Ty->getPrimitiveSizeInBits() != LargestType->getPrimitiveSizeInBits();
- if (Ty->getPrimitiveSizeInBits() > LargestType->getPrimitiveSizeInBits())
- LargestType = Ty;
- }
-
- // Create a rewriter object which we'll use to transform the code with.
- SCEVExpander Rewriter(*SE, *LI);
-
- // Now that we know the largest of of the induction variables in this loop,
- // insert a canonical induction variable of the largest size.
- Value *IndVar = Rewriter.getOrInsertCanonicalInductionVariable(L,LargestType);
- ++NumInserted;
- Changed = true;
- DOUT << "INDVARS: New CanIV: " << *IndVar;
-
- if (!isa<SCEVCouldNotCompute>(IterationCount)) {
- if (IterationCount->getType()->getPrimitiveSizeInBits() <
- LargestType->getPrimitiveSizeInBits())
- IterationCount = SE->getZeroExtendExpr(IterationCount, LargestType);
- else if (IterationCount->getType() != LargestType)
- IterationCount = SE->getTruncateExpr(IterationCount, LargestType);
- if (Instruction *DI = LinearFunctionTestReplace(L, IterationCount,Rewriter))
- DeadInsts.insert(DI);
- }
-
- // Now that we have a canonical induction variable, we can rewrite any
- // recurrences in terms of the induction variable. Start with the auxillary
- // induction variables, and recursively rewrite any of their uses.
- BasicBlock::iterator InsertPt = Header->begin();
- while (isa<PHINode>(InsertPt)) ++InsertPt;
-
- // If there were induction variables of other sizes, cast the primary
- // induction variable to the right size for them, avoiding the need for the
- // code evaluation methods to insert induction variables of different sizes.
- if (DifferingSizes) {
- SmallVector<unsigned,4> InsertedSizes;
- InsertedSizes.push_back(LargestType->getPrimitiveSizeInBits());
- for (unsigned i = 0, e = IndVars.size(); i != e; ++i) {
- unsigned ithSize = IndVars[i].first->getType()->getPrimitiveSizeInBits();
- if (std::find(InsertedSizes.begin(), InsertedSizes.end(), ithSize)
- == InsertedSizes.end()) {
- PHINode *PN = IndVars[i].first;
- InsertedSizes.push_back(ithSize);
- Instruction *New = new TruncInst(IndVar, PN->getType(), "indvar",
- InsertPt);
- Rewriter.addInsertedValue(New, SE->getSCEV(New));
- DOUT << "INDVARS: Made trunc IV for " << *PN
- << " NewVal = " << *New << "\n";
- }
- }
- }
-
- // Rewrite all induction variables in terms of the canonical induction
- // variable.
- std::map<unsigned, Value*> InsertedSizes;
- while (!IndVars.empty()) {
- PHINode *PN = IndVars.back().first;
- Value *NewVal = Rewriter.expandCodeFor(IndVars.back().second, InsertPt);
- DOUT << "INDVARS: Rewrote IV '" << *IndVars.back().second << "' " << *PN
- << " into = " << *NewVal << "\n";
- NewVal->takeName(PN);
-
- // Replace the old PHI Node with the inserted computation.
- PN->replaceAllUsesWith(NewVal);
- DeadInsts.insert(PN);
- IndVars.pop_back();
- ++NumRemoved;
- Changed = true;
- }
-
-#if 0
- // Now replace all derived expressions in the loop body with simpler
- // expressions.
- for (unsigned i = 0, e = L->getBlocks().size(); i != e; ++i)
- if (LI->getLoopFor(L->getBlocks()[i]) == L) { // Not in a subloop...
- BasicBlock *BB = L->getBlocks()[i];
- for (BasicBlock::iterator I = BB->begin(), E = BB->end(); I != E; ++I)
- if (I->getType()->isInteger() && // Is an integer instruction
- !I->use_empty() &&
- !Rewriter.isInsertedInstruction(I)) {
- SCEVHandle SH = SE->getSCEV(I);
- Value *V = Rewriter.expandCodeFor(SH, I, I->getType());
- if (V != I) {
- if (isa<Instruction>(V))
- V->takeName(I);
- I->replaceAllUsesWith(V);
- DeadInsts.insert(I);
- ++NumRemoved;
- Changed = true;
- }
- }
- }
-#endif
-
- DeleteTriviallyDeadInstructions(DeadInsts);
-
- assert(L->isLCSSAForm());
- return Changed;
-}
diff --git a/release_23/lib/Transforms/Scalar/InstructionCombining.cpp b/release_23/lib/Transforms/Scalar/InstructionCombining.cpp
deleted file mode 100644
index f3591879f7bb..000000000000
--- a/release_23/lib/Transforms/Scalar/InstructionCombining.cpp
+++ /dev/null
@@ -1,11520 +0,0 @@
-//===- InstructionCombining.cpp - Combine multiple instructions -----------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// InstructionCombining - Combine instructions to form fewer, simple
-// instructions. This pass does not modify the CFG This pass is where algebraic
-// simplification happens.
-//
-// This pass combines things like:
-// %Y = add i32 %X, 1
-// %Z = add i32 %Y, 1
-// into:
-// %Z = add i32 %X, 2
-//
-// This is a simple worklist driven algorithm.
-//
-// This pass guarantees that the following canonicalizations are performed on
-// the program:
-// 1. If a binary operator has a constant operand, it is moved to the RHS
-// 2. Bitwise operators with constant operands are always grouped so that
-// shifts are performed first, then or's, then and's, then xor's.
-// 3. Compare instructions are converted from <,>,<=,>= to ==,!= if possible
-// 4. All cmp instructions on boolean values are replaced with logical ops
-// 5. add X, X is represented as (X*2) => (X << 1)
-// 6. Multiplies with a power-of-two constant argument are transformed into
-// shifts.
-// ... etc.
-//
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "instcombine"
-#include "llvm/Transforms/Scalar.h"
-#include "llvm/IntrinsicInst.h"
-#include "llvm/Pass.h"
-#include "llvm/DerivedTypes.h"
-#include "llvm/GlobalVariable.h"
-#include "llvm/Analysis/ConstantFolding.h"
-#include "llvm/Target/TargetData.h"
-#include "llvm/Transforms/Utils/BasicBlockUtils.h"
-#include "llvm/Transforms/Utils/Local.h"
-#include "llvm/Support/CallSite.h"
-#include "llvm/Support/ConstantRange.h"
-#include "llvm/Support/Debug.h"
-#include "llvm/Support/GetElementPtrTypeIterator.h"
-#include "llvm/Support/InstVisitor.h"
-#include "llvm/Support/MathExtras.h"
-#include "llvm/Support/PatternMatch.h"
-#include "llvm/Support/Compiler.h"
-#include "llvm/ADT/DenseMap.h"
-#include "llvm/ADT/SmallVector.h"
-#include "llvm/ADT/SmallPtrSet.h"
-#include "llvm/ADT/Statistic.h"
-#include "llvm/ADT/STLExtras.h"
-#include <algorithm>
-#include <climits>
-#include <sstream>
-using namespace llvm;
-using namespace llvm::PatternMatch;
-
-STATISTIC(NumCombined , "Number of insts combined");
-STATISTIC(NumConstProp, "Number of constant folds");
-STATISTIC(NumDeadInst , "Number of dead inst eliminated");
-STATISTIC(NumDeadStore, "Number of dead stores eliminated");
-STATISTIC(NumSunkInst , "Number of instructions sunk");
-
-namespace {
- class VISIBILITY_HIDDEN InstCombiner
- : public FunctionPass,
- public InstVisitor<InstCombiner, Instruction*> {
- // Worklist of all of the instructions that need to be simplified.
- std::vector<Instruction*> Worklist;
- DenseMap<Instruction*, unsigned> WorklistMap;
- TargetData *TD;
- bool MustPreserveLCSSA;
- public:
- static char ID; // Pass identification, replacement for typeid
- InstCombiner() : FunctionPass((intptr_t)&ID) {}
-
- /// AddToWorkList - Add the specified instruction to the worklist if it
- /// isn't already in it.
- void AddToWorkList(Instruction *I) {
- if (WorklistMap.insert(std::make_pair(I, Worklist.size())))
- Worklist.push_back(I);
- }
-
- // RemoveFromWorkList - remove I from the worklist if it exists.
- void RemoveFromWorkList(Instruction *I) {
- DenseMap<Instruction*, unsigned>::iterator It = WorklistMap.find(I);
- if (It == WorklistMap.end()) return; // Not in worklist.
-
- // Don't bother moving everything down, just null out the slot.
- Worklist[It->second] = 0;
-
- WorklistMap.erase(It);
- }
-
- Instruction *RemoveOneFromWorkList() {
- Instruction *I = Worklist.back();
- Worklist.pop_back();
- WorklistMap.erase(I);
- return I;
- }
-
-
- /// AddUsersToWorkList - When an instruction is simplified, add all users of
- /// the instruction to the work lists because they might get more simplified
- /// now.
- ///
- void AddUsersToWorkList(Value &I) {
- for (Value::use_iterator UI = I.use_begin(), UE = I.use_end();
- UI != UE; ++UI)
- AddToWorkList(cast<Instruction>(*UI));
- }
-
- /// AddUsesToWorkList - When an instruction is simplified, add operands to
- /// the work lists because they might get more simplified now.
- ///
- void AddUsesToWorkList(Instruction &I) {
- for (unsigned i = 0, e = I.getNumOperands(); i != e; ++i)
- if (Instruction *Op = dyn_cast<Instruction>(I.getOperand(i)))
- AddToWorkList(Op);
- }
-
- /// AddSoonDeadInstToWorklist - The specified instruction is about to become
- /// dead. Add all of its operands to the worklist, turning them into
- /// undef's to reduce the number of uses of those instructions.
- ///
- /// Return the specified operand before it is turned into an undef.
- ///
- Value *AddSoonDeadInstToWorklist(Instruction &I, unsigned op) {
- Value *R = I.getOperand(op);
-
- for (unsigned i = 0, e = I.getNumOperands(); i != e; ++i)
- if (Instruction *Op = dyn_cast<Instruction>(I.getOperand(i))) {
- AddToWorkList(Op);
- // Set the operand to undef to drop the use.
- I.setOperand(i, UndefValue::get(Op->getType()));
- }
-
- return R;
- }
-
- public:
- virtual bool runOnFunction(Function &F);
-
- bool DoOneIteration(Function &F, unsigned ItNum);
-
- virtual void getAnalysisUsage(AnalysisUsage &AU) const {
- AU.addRequired<TargetData>();
- AU.addPreservedID(LCSSAID);
- AU.setPreservesCFG();
- }
-
- TargetData &getTargetData() const { return *TD; }
-
- // Visitation implementation - Implement instruction combining for different
- // instruction types. The semantics are as follows:
- // Return Value:
- // null - No change was made
- // I - Change was made, I is still valid, I may be dead though
- // otherwise - Change was made, replace I with returned instruction
- //
- Instruction *visitAdd(BinaryOperator &I);
- Instruction *visitSub(BinaryOperator &I);
- Instruction *visitMul(BinaryOperator &I);
- Instruction *visitURem(BinaryOperator &I);
- Instruction *visitSRem(BinaryOperator &I);
- Instruction *visitFRem(BinaryOperator &I);
- Instruction *commonRemTransforms(BinaryOperator &I);
- Instruction *commonIRemTransforms(BinaryOperator &I);
- Instruction *commonDivTransforms(BinaryOperator &I);
- Instruction *commonIDivTransforms(BinaryOperator &I);
- Instruction *visitUDiv(BinaryOperator &I);
- Instruction *visitSDiv(BinaryOperator &I);
- Instruction *visitFDiv(BinaryOperator &I);
- Instruction *visitAnd(BinaryOperator &I);
- Instruction *visitOr (BinaryOperator &I);
- Instruction *visitXor(BinaryOperator &I);
- Instruction *visitShl(BinaryOperator &I);
- Instruction *visitAShr(BinaryOperator &I);
- Instruction *visitLShr(BinaryOperator &I);
- Instruction *commonShiftTransforms(BinaryOperator &I);
- Instruction *visitFCmpInst(FCmpInst &I);
- Instruction *visitICmpInst(ICmpInst &I);
- Instruction *visitICmpInstWithCastAndCast(ICmpInst &ICI);
- Instruction *visitICmpInstWithInstAndIntCst(ICmpInst &ICI,
- Instruction *LHS,
- ConstantInt *RHS);
- Instruction *FoldICmpDivCst(ICmpInst &ICI, BinaryOperator *DivI,
- ConstantInt *DivRHS);
-
- Instruction *FoldGEPICmp(User *GEPLHS, Value *RHS,
- ICmpInst::Predicate Cond, Instruction &I);
- Instruction *FoldShiftByConstant(Value *Op0, ConstantInt *Op1,
- BinaryOperator &I);
- Instruction *commonCastTransforms(CastInst &CI);
- Instruction *commonIntCastTransforms(CastInst &CI);
- Instruction *commonPointerCastTransforms(CastInst &CI);
- Instruction *visitTrunc(TruncInst &CI);
- Instruction *visitZExt(ZExtInst &CI);
- Instruction *visitSExt(SExtInst &CI);
- Instruction *visitFPTrunc(FPTruncInst &CI);
- Instruction *visitFPExt(CastInst &CI);
- Instruction *visitFPToUI(CastInst &CI);
- Instruction *visitFPToSI(CastInst &CI);
- Instruction *visitUIToFP(CastInst &CI);
- Instruction *visitSIToFP(CastInst &CI);
- Instruction *visitPtrToInt(CastInst &CI);
- Instruction *visitIntToPtr(IntToPtrInst &CI);
- Instruction *visitBitCast(BitCastInst &CI);
- Instruction *FoldSelectOpOp(SelectInst &SI, Instruction *TI,
- Instruction *FI);
- Instruction *visitSelectInst(SelectInst &CI);
- Instruction *visitCallInst(CallInst &CI);
- Instruction *visitInvokeInst(InvokeInst &II);
- Instruction *visitPHINode(PHINode &PN);
- Instruction *visitGetElementPtrInst(GetElementPtrInst &GEP);
- Instruction *visitAllocationInst(AllocationInst &AI);
- Instruction *visitFreeInst(FreeInst &FI);
- Instruction *visitLoadInst(LoadInst &LI);
- Instruction *visitStoreInst(StoreInst &SI);
- Instruction *visitBranchInst(BranchInst &BI);
- Instruction *visitSwitchInst(SwitchInst &SI);
- Instruction *visitInsertElementInst(InsertElementInst &IE);
- Instruction *visitExtractElementInst(ExtractElementInst &EI);
- Instruction *visitShuffleVectorInst(ShuffleVectorInst &SVI);
-
- // visitInstruction - Specify what to return for unhandled instructions...
- Instruction *visitInstruction(Instruction &I) { return 0; }
-
- private:
- Instruction *visitCallSite(CallSite CS);
- bool transformConstExprCastCall(CallSite CS);
- Instruction *transformCallThroughTrampoline(CallSite CS);
- Instruction *transformZExtICmp(ICmpInst *ICI, Instruction &CI,
- bool DoXform = true);
-
- public:
- // InsertNewInstBefore - insert an instruction New before instruction Old
- // in the program. Add the new instruction to the worklist.
- //
- Instruction *InsertNewInstBefore(Instruction *New, Instruction &Old) {
- assert(New && New->getParent() == 0 &&
- "New instruction already inserted into a basic block!");
- BasicBlock *BB = Old.getParent();
- BB->getInstList().insert(&Old, New); // Insert inst
- AddToWorkList(New);
- return New;
- }
-
- /// InsertCastBefore - Insert a cast of V to TY before the instruction POS.
- /// This also adds the cast to the worklist. Finally, this returns the
- /// cast.
- Value *InsertCastBefore(Instruction::CastOps opc, Value *V, const Type *Ty,
- Instruction &Pos) {
- if (V->getType() == Ty) return V;
-
- if (Constant *CV = dyn_cast<Constant>(V))
- return ConstantExpr::getCast(opc, CV, Ty);
-
- Instruction *C = CastInst::create(opc, V, Ty, V->getName(), &Pos);
- AddToWorkList(C);
- return C;
- }
-
- Value *InsertBitCastBefore(Value *V, const Type *Ty, Instruction &Pos) {
- return InsertCastBefore(Instruction::BitCast, V, Ty, Pos);
- }
-
-
- // ReplaceInstUsesWith - This method is to be used when an instruction is
- // found to be dead, replacable with another preexisting expression. Here
- // we add all uses of I to the worklist, replace all uses of I with the new
- // value, then return I, so that the inst combiner will know that I was
- // modified.
- //
- Instruction *ReplaceInstUsesWith(Instruction &I, Value *V) {
- AddUsersToWorkList(I); // Add all modified instrs to worklist
- if (&I != V) {
- I.replaceAllUsesWith(V);
- return &I;
- } else {
- // If we are replacing the instruction with itself, this must be in a
- // segment of unreachable code, so just clobber the instruction.
- I.replaceAllUsesWith(UndefValue::get(I.getType()));
- return &I;
- }
- }
-
- // UpdateValueUsesWith - This method is to be used when an value is
- // found to be replacable with another preexisting expression or was
- // updated. Here we add all uses of I to the worklist, replace all uses of
- // I with the new value (unless the instruction was just updated), then
- // return true, so that the inst combiner will know that I was modified.
- //
- bool UpdateValueUsesWith(Value *Old, Value *New) {
- AddUsersToWorkList(*Old); // Add all modified instrs to worklist
- if (Old != New)
- Old->replaceAllUsesWith(New);
- if (Instruction *I = dyn_cast<Instruction>(Old))
- AddToWorkList(I);
- if (Instruction *I = dyn_cast<Instruction>(New))
- AddToWorkList(I);
- return true;
- }
-
- // EraseInstFromFunction - When dealing with an instruction that has side
- // effects or produces a void value, we can't rely on DCE to delete the
- // instruction. Instead, visit methods should return the value returned by
- // this function.
- Instruction *EraseInstFromFunction(Instruction &I) {
- assert(I.use_empty() && "Cannot erase instruction that is used!");
- AddUsesToWorkList(I);
- RemoveFromWorkList(&I);
- I.eraseFromParent();
- return 0; // Don't do anything with FI
- }
-
- private:
- /// InsertOperandCastBefore - This inserts a cast of V to DestTy before the
- /// InsertBefore instruction. This is specialized a bit to avoid inserting
- /// casts that are known to not do anything...
- ///
- Value *InsertOperandCastBefore(Instruction::CastOps opcode,
- Value *V, const Type *DestTy,
- Instruction *InsertBefore);
-
- /// SimplifyCommutative - This performs a few simplifications for
- /// commutative operators.
- bool SimplifyCommutative(BinaryOperator &I);
-
- /// SimplifyCompare - This reorders the operands of a CmpInst to get them in
- /// most-complex to least-complex order.
- bool SimplifyCompare(CmpInst &I);
-
- /// SimplifyDemandedBits - Attempts to replace V with a simpler value based
- /// on the demanded bits.
- bool SimplifyDemandedBits(Value *V, APInt DemandedMask,
- APInt& KnownZero, APInt& KnownOne,
- unsigned Depth = 0);
-
- Value *SimplifyDemandedVectorElts(Value *V, uint64_t DemandedElts,
- uint64_t &UndefElts, unsigned Depth = 0);
-
- // FoldOpIntoPhi - Given a binary operator or cast instruction which has a
- // PHI node as operand #0, see if we can fold the instruction into the PHI
- // (which is only possible if all operands to the PHI are constants).
- Instruction *FoldOpIntoPhi(Instruction &I);
-
- // FoldPHIArgOpIntoPHI - If all operands to a PHI node are the same "unary"
- // operator and they all are only used by the PHI, PHI together their
- // inputs, and do the operation once, to the result of the PHI.
- Instruction *FoldPHIArgOpIntoPHI(PHINode &PN);
- Instruction *FoldPHIArgBinOpIntoPHI(PHINode &PN);
-
-
- Instruction *OptAndOp(Instruction *Op, ConstantInt *OpRHS,
- ConstantInt *AndRHS, BinaryOperator &TheAnd);
-
- Value *FoldLogicalPlusAnd(Value *LHS, Value *RHS, ConstantInt *Mask,
- bool isSub, Instruction &I);
- Instruction *InsertRangeTest(Value *V, Constant *Lo, Constant *Hi,
- bool isSigned, bool Inside, Instruction &IB);
- Instruction *PromoteCastOfAllocation(BitCastInst &CI, AllocationInst &AI);
- Instruction *MatchBSwap(BinaryOperator &I);
- bool SimplifyStoreAtEndOfBlock(StoreInst &SI);
- Instruction *SimplifyMemTransfer(MemIntrinsic *MI);
- Instruction *SimplifyMemSet(MemSetInst *MI);
-
-
- Value *EvaluateInDifferentType(Value *V, const Type *Ty, bool isSigned);
-
- void ComputeMaskedBits(Value *V, const APInt &Mask, APInt& KnownZero,
- APInt& KnownOne, unsigned Depth = 0);
- bool MaskedValueIsZero(Value *V, const APInt& Mask, unsigned Depth = 0);
- bool CanEvaluateInDifferentType(Value *V, const IntegerType *Ty,
- unsigned CastOpc,
- int &NumCastsRemoved);
- unsigned GetOrEnforceKnownAlignment(Value *V,
- unsigned PrefAlign = 0);
- };
-
- char InstCombiner::ID = 0;
- RegisterPass<InstCombiner> X("instcombine", "Combine redundant instructions");
-}
-
-// getComplexity: Assign a complexity or rank value to LLVM Values...
-// 0 -> undef, 1 -> Const, 2 -> Other, 3 -> Arg, 3 -> Unary, 4 -> OtherInst
-static unsigned getComplexity(Value *V) {
- if (isa<Instruction>(V)) {
- if (BinaryOperator::isNeg(V) || BinaryOperator::isNot(V))
- return 3;
- return 4;
- }
- if (isa<Argument>(V)) return 3;
- return isa<Constant>(V) ? (isa<UndefValue>(V) ? 0 : 1) : 2;
-}
-
-// isOnlyUse - Return true if this instruction will be deleted if we stop using
-// it.
-static bool isOnlyUse(Value *V) {
- return V->hasOneUse() || isa<Constant>(V);
-}
-
-// getPromotedType - Return the specified type promoted as it would be to pass
-// though a va_arg area...
-static const Type *getPromotedType(const Type *Ty) {
- if (const IntegerType* ITy = dyn_cast<IntegerType>(Ty)) {
- if (ITy->getBitWidth() < 32)
- return Type::Int32Ty;
- }
- return Ty;
-}
-
-/// getBitCastOperand - If the specified operand is a CastInst or a constant
-/// expression bitcast, return the operand value, otherwise return null.
-static Value *getBitCastOperand(Value *V) {
- if (BitCastInst *I = dyn_cast<BitCastInst>(V))
- return I->getOperand(0);
- else if (ConstantExpr *CE = dyn_cast<ConstantExpr>(V))
- if (CE->getOpcode() == Instruction::BitCast)
- return CE->getOperand(0);
- return 0;
-}
-
-/// This function is a wrapper around CastInst::isEliminableCastPair. It
-/// simply extracts arguments and returns what that function returns.
-static Instruction::CastOps
-isEliminableCastPair(
- const CastInst *CI, ///< The first cast instruction
- unsigned opcode, ///< The opcode of the second cast instruction
- const Type *DstTy, ///< The target type for the second cast instruction
- TargetData *TD ///< The target data for pointer size
-) {
-
- const Type *SrcTy = CI->getOperand(0)->getType(); // A from above
- const Type *MidTy = CI->getType(); // B from above
-
- // Get the opcodes of the two Cast instructions
- Instruction::CastOps firstOp = Instruction::CastOps(CI->getOpcode());
- Instruction::CastOps secondOp = Instruction::CastOps(opcode);
-
- return Instruction::CastOps(
- CastInst::isEliminableCastPair(firstOp, secondOp, SrcTy, MidTy,
- DstTy, TD->getIntPtrType()));
-}
-
-/// ValueRequiresCast - Return true if the cast from "V to Ty" actually results
-/// in any code being generated. It does not require codegen if V is simple
-/// enough or if the cast can be folded into other casts.
-static bool ValueRequiresCast(Instruction::CastOps opcode, const Value *V,
- const Type *Ty, TargetData *TD) {
- if (V->getType() == Ty || isa<Constant>(V)) return false;
-
- // If this is another cast that can be eliminated, it isn't codegen either.
- if (const CastInst *CI = dyn_cast<CastInst>(V))
- if (isEliminableCastPair(CI, opcode, Ty, TD))
- return false;
- return true;
-}
-
-/// InsertOperandCastBefore - This inserts a cast of V to DestTy before the
-/// InsertBefore instruction. This is specialized a bit to avoid inserting
-/// casts that are known to not do anything...
-///
-Value *InstCombiner::InsertOperandCastBefore(Instruction::CastOps opcode,
- Value *V, const Type *DestTy,
- Instruction *InsertBefore) {
- if (V->getType() == DestTy) return V;
- if (Constant *C = dyn_cast<Constant>(V))
- return ConstantExpr::getCast(opcode, C, DestTy);
-
- return InsertCastBefore(opcode, V, DestTy, *InsertBefore);
-}
-
-// SimplifyCommutative - This performs a few simplifications for commutative
-// operators:
-//
-// 1. Order operands such that they are listed from right (least complex) to
-// left (most complex). This puts constants before unary operators before
-// binary operators.
-//
-// 2. Transform: (op (op V, C1), C2) ==> (op V, (op C1, C2))
-// 3. Transform: (op (op V1, C1), (op V2, C2)) ==> (op (op V1, V2), (op C1,C2))
-//
-bool InstCombiner::SimplifyCommutative(BinaryOperator &I) {
- bool Changed = false;
- if (getComplexity(I.getOperand(0)) < getComplexity(I.getOperand(1)))
- Changed = !I.swapOperands();
-
- if (!I.isAssociative()) return Changed;
- Instruction::BinaryOps Opcode = I.getOpcode();
- if (BinaryOperator *Op = dyn_cast<BinaryOperator>(I.getOperand(0)))
- if (Op->getOpcode() == Opcode && isa<Constant>(Op->getOperand(1))) {
- if (isa<Constant>(I.getOperand(1))) {
- Constant *Folded = ConstantExpr::get(I.getOpcode(),
- cast<Constant>(I.getOperand(1)),
- cast<Constant>(Op->getOperand(1)));
- I.setOperand(0, Op->getOperand(0));
- I.setOperand(1, Folded);
- return true;
- } else if (BinaryOperator *Op1=dyn_cast<BinaryOperator>(I.getOperand(1)))
- if (Op1->getOpcode() == Opcode && isa<Constant>(Op1->getOperand(1)) &&
- isOnlyUse(Op) && isOnlyUse(Op1)) {
- Constant *C1 = cast<Constant>(Op->getOperand(1));
- Constant *C2 = cast<Constant>(Op1->getOperand(1));
-
- // Fold (op (op V1, C1), (op V2, C2)) ==> (op (op V1, V2), (op C1,C2))
- Constant *Folded = ConstantExpr::get(I.getOpcode(), C1, C2);
- Instruction *New = BinaryOperator::create(Opcode, Op->getOperand(0),
- Op1->getOperand(0),
- Op1->getName(), &I);
- AddToWorkList(New);
- I.setOperand(0, New);
- I.setOperand(1, Folded);
- return true;
- }
- }
- return Changed;
-}
-
-/// SimplifyCompare - For a CmpInst this function just orders the operands
-/// so that theyare listed from right (least complex) to left (most complex).
-/// This puts constants before unary operators before binary operators.
-bool InstCombiner::SimplifyCompare(CmpInst &I) {
- if (getComplexity(I.getOperand(0)) >= getComplexity(I.getOperand(1)))
- return false;
- I.swapOperands();
- // Compare instructions are not associative so there's nothing else we can do.
- return true;
-}
-
-// dyn_castNegVal - Given a 'sub' instruction, return the RHS of the instruction
-// if the LHS is a constant zero (which is the 'negate' form).
-//
-static inline Value *dyn_castNegVal(Value *V) {
- if (BinaryOperator::isNeg(V))
- return BinaryOperator::getNegArgument(V);
-
- // Constants can be considered to be negated values if they can be folded.
- if (ConstantInt *C = dyn_cast<ConstantInt>(V))
- return ConstantExpr::getNeg(C);
- return 0;
-}
-
-static inline Value *dyn_castNotVal(Value *V) {
- if (BinaryOperator::isNot(V))
- return BinaryOperator::getNotArgument(V);
-
- // Constants can be considered to be not'ed values...
- if (ConstantInt *C = dyn_cast<ConstantInt>(V))
- return ConstantInt::get(~C->getValue());
- return 0;
-}
-
-// dyn_castFoldableMul - If this value is a multiply that can be folded into
-// other computations (because it has a constant operand), return the
-// non-constant operand of the multiply, and set CST to point to the multiplier.
-// Otherwise, return null.
-//
-static inline Value *dyn_castFoldableMul(Value *V, ConstantInt *&CST) {
- if (V->hasOneUse() && V->getType()->isInteger())
- if (Instruction *I = dyn_cast<Instruction>(V)) {
- if (I->getOpcode() == Instruction::Mul)
- if ((CST = dyn_cast<ConstantInt>(I->getOperand(1))))
- return I->getOperand(0);
- if (I->getOpcode() == Instruction::Shl)
- if ((CST = dyn_cast<ConstantInt>(I->getOperand(1)))) {
- // The multiplier is really 1 << CST.
- uint32_t BitWidth = cast<IntegerType>(V->getType())->getBitWidth();
- uint32_t CSTVal = CST->getLimitedValue(BitWidth);
- CST = ConstantInt::get(APInt(BitWidth, 1).shl(CSTVal));
- return I->getOperand(0);
- }
- }
- return 0;
-}
-
-/// dyn_castGetElementPtr - If this is a getelementptr instruction or constant
-/// expression, return it.
-static User *dyn_castGetElementPtr(Value *V) {
- if (isa<GetElementPtrInst>(V)) return cast<User>(V);
- if (ConstantExpr *CE = dyn_cast<ConstantExpr>(V))
- if (CE->getOpcode() == Instruction::GetElementPtr)
- return cast<User>(V);
- return false;
-}
-
-/// getOpcode - If this is an Instruction or a ConstantExpr, return the
-/// opcode value. Otherwise return UserOp1.
-static unsigned getOpcode(User *U) {
- if (Instruction *I = dyn_cast<Instruction>(U))
- return I->getOpcode();
- if (ConstantExpr *CE = dyn_cast<ConstantExpr>(U))
- return CE->getOpcode();
- // Use UserOp1 to mean there's no opcode.
- return Instruction::UserOp1;
-}
-
-/// AddOne - Add one to a ConstantInt
-static ConstantInt *AddOne(ConstantInt *C) {
- APInt Val(C->getValue());
- return ConstantInt::get(++Val);
-}
-/// SubOne - Subtract one from a ConstantInt
-static ConstantInt *SubOne(ConstantInt *C) {
- APInt Val(C->getValue());
- return ConstantInt::get(--Val);
-}
-/// Add - Add two ConstantInts together
-static ConstantInt *Add(ConstantInt *C1, ConstantInt *C2) {
- return ConstantInt::get(C1->getValue() + C2->getValue());
-}
-/// And - Bitwise AND two ConstantInts together
-static ConstantInt *And(ConstantInt *C1, ConstantInt *C2) {
- return ConstantInt::get(C1->getValue() & C2->getValue());
-}
-/// Subtract - Subtract one ConstantInt from another
-static ConstantInt *Subtract(ConstantInt *C1, ConstantInt *C2) {
- return ConstantInt::get(C1->getValue() - C2->getValue());
-}
-/// Multiply - Multiply two ConstantInts together
-static ConstantInt *Multiply(ConstantInt *C1, ConstantInt *C2) {
- return ConstantInt::get(C1->getValue() * C2->getValue());
-}
-/// MultiplyOverflows - True if the multiply can not be expressed in an int
-/// this size.
-static bool MultiplyOverflows(ConstantInt *C1, ConstantInt *C2, bool sign) {
- uint32_t W = C1->getBitWidth();
- APInt LHSExt = C1->getValue(), RHSExt = C2->getValue();
- if (sign) {
- LHSExt.sext(W * 2);
- RHSExt.sext(W * 2);
- } else {
- LHSExt.zext(W * 2);
- RHSExt.zext(W * 2);
- }
-
- APInt MulExt = LHSExt * RHSExt;
-
- if (sign) {
- APInt Min = APInt::getSignedMinValue(W).sext(W * 2);
- APInt Max = APInt::getSignedMaxValue(W).sext(W * 2);
- return MulExt.slt(Min) || MulExt.sgt(Max);
- } else
- return MulExt.ugt(APInt::getLowBitsSet(W * 2, W));
-}
-
-/// ComputeMaskedBits - Determine which of the bits specified in Mask are
-/// known to be either zero or one and return them in the KnownZero/KnownOne
-/// bit sets. This code only analyzes bits in Mask, in order to short-circuit
-/// processing.
-/// NOTE: we cannot consider 'undef' to be "IsZero" here. The problem is that
-/// we cannot optimize based on the assumption that it is zero without changing
-/// it to be an explicit zero. If we don't change it to zero, other code could
-/// optimized based on the contradictory assumption that it is non-zero.
-/// Because instcombine aggressively folds operations with undef args anyway,
-/// this won't lose us code quality.
-void InstCombiner::ComputeMaskedBits(Value *V, const APInt &Mask,
- APInt& KnownZero, APInt& KnownOne,
- unsigned Depth) {
- assert(V && "No Value?");
- assert(Depth <= 6 && "Limit Search Depth");
- uint32_t BitWidth = Mask.getBitWidth();
- assert((V->getType()->isInteger() || isa<PointerType>(V->getType())) &&
- "Not integer or pointer type!");
- assert((!TD || TD->getTypeSizeInBits(V->getType()) == BitWidth) &&
- (!isa<IntegerType>(V->getType()) ||
- V->getType()->getPrimitiveSizeInBits() == BitWidth) &&
- KnownZero.getBitWidth() == BitWidth &&
- KnownOne.getBitWidth() == BitWidth &&
- "V, Mask, KnownOne and KnownZero should have same BitWidth");
- if (ConstantInt *CI = dyn_cast<ConstantInt>(V)) {
- // We know all of the bits for a constant!
- KnownOne = CI->getValue() & Mask;
- KnownZero = ~KnownOne & Mask;
- return;
- }
- // Null is all-zeros.
- if (isa<ConstantPointerNull>(V)) {
- KnownOne.clear();
- KnownZero = Mask;
- return;
- }
- // The address of an aligned GlobalValue has trailing zeros.
- if (GlobalValue *GV = dyn_cast<GlobalValue>(V)) {
- unsigned Align = GV->getAlignment();
- if (Align == 0 && TD && GV->getType()->getElementType()->isSized())
- Align = TD->getPrefTypeAlignment(GV->getType()->getElementType());
- if (Align > 0)
- KnownZero = Mask & APInt::getLowBitsSet(BitWidth,
- CountTrailingZeros_32(Align));
- else
- KnownZero.clear();
- KnownOne.clear();
- return;
- }
-
- KnownZero.clear(); KnownOne.clear(); // Start out not knowing anything.
-
- if (Depth == 6 || Mask == 0)
- return; // Limit search depth.
-
- User *I = dyn_cast<User>(V);
- if (!I) return;
-
- APInt KnownZero2(KnownZero), KnownOne2(KnownOne);
- switch (getOpcode(I)) {
- default: break;
- case Instruction::And: {
- // If either the LHS or the RHS are Zero, the result is zero.
- ComputeMaskedBits(I->getOperand(1), Mask, KnownZero, KnownOne, Depth+1);
- APInt Mask2(Mask & ~KnownZero);
- ComputeMaskedBits(I->getOperand(0), Mask2, KnownZero2, KnownOne2, Depth+1);
- assert((KnownZero & KnownOne) == 0 && "Bits known to be one AND zero?");
- assert((KnownZero2 & KnownOne2) == 0 && "Bits known to be one AND zero?");
-
- // Output known-1 bits are only known if set in both the LHS & RHS.
- KnownOne &= KnownOne2;
- // Output known-0 are known to be clear if zero in either the LHS | RHS.
- KnownZero |= KnownZero2;
- return;
- }
- case Instruction::Or: {
- ComputeMaskedBits(I->getOperand(1), Mask, KnownZero, KnownOne, Depth+1);
- APInt Mask2(Mask & ~KnownOne);
- ComputeMaskedBits(I->getOperand(0), Mask2, KnownZero2, KnownOne2, Depth+1);
- assert((KnownZero & KnownOne) == 0 && "Bits known to be one AND zero?");
- assert((KnownZero2 & KnownOne2) == 0 && "Bits known to be one AND zero?");
-
- // Output known-0 bits are only known if clear in both the LHS & RHS.
- KnownZero &= KnownZero2;
- // Output known-1 are known to be set if set in either the LHS | RHS.
- KnownOne |= KnownOne2;
- return;
- }
- case Instruction::Xor: {
- ComputeMaskedBits(I->getOperand(1), Mask, KnownZero, KnownOne, Depth+1);
- ComputeMaskedBits(I->getOperand(0), Mask, KnownZero2, KnownOne2, Depth+1);
- assert((KnownZero & KnownOne) == 0 && "Bits known to be one AND zero?");
- assert((KnownZero2 & KnownOne2) == 0 && "Bits known to be one AND zero?");
-
- // Output known-0 bits are known if clear or set in both the LHS & RHS.
- APInt KnownZeroOut = (KnownZero & KnownZero2) | (KnownOne & KnownOne2);
- // Output known-1 are known to be set if set in only one of the LHS, RHS.
- KnownOne = (KnownZero & KnownOne2) | (KnownOne & KnownZero2);
- KnownZero = KnownZeroOut;
- return;
- }
- case Instruction::Mul: {
- APInt Mask2 = APInt::getAllOnesValue(BitWidth);
- ComputeMaskedBits(I->getOperand(1), Mask2, KnownZero, KnownOne, Depth+1);
- ComputeMaskedBits(I->getOperand(0), Mask2, KnownZero2, KnownOne2, Depth+1);
- assert((KnownZero & KnownOne) == 0 && "Bits known to be one AND zero?");
- assert((KnownZero2 & KnownOne2) == 0 && "Bits known to be one AND zero?");
-
- // If low bits are zero in either operand, output low known-0 bits.
- // Also compute a conserative estimate for high known-0 bits.
- // More trickiness is possible, but this is sufficient for the
- // interesting case of alignment computation.
- KnownOne.clear();
- unsigned TrailZ = KnownZero.countTrailingOnes() +
- KnownZero2.countTrailingOnes();
- unsigned LeadZ = std::max(KnownZero.countLeadingOnes() +
- KnownZero2.countLeadingOnes(),
- BitWidth) - BitWidth;
-
- TrailZ = std::min(TrailZ, BitWidth);
- LeadZ = std::min(LeadZ, BitWidth);
- KnownZero = APInt::getLowBitsSet(BitWidth, TrailZ) |
- APInt::getHighBitsSet(BitWidth, LeadZ);
- KnownZero &= Mask;
- return;
- }
- case Instruction::UDiv: {
- // For the purposes of computing leading zeros we can conservatively
- // treat a udiv as a logical right shift by the power of 2 known to
- // be less than the denominator.
- APInt AllOnes = APInt::getAllOnesValue(BitWidth);
- ComputeMaskedBits(I->getOperand(0),
- AllOnes, KnownZero2, KnownOne2, Depth+1);
- unsigned LeadZ = KnownZero2.countLeadingOnes();
-
- KnownOne2.clear();
- KnownZero2.clear();
- ComputeMaskedBits(I->getOperand(1),
- AllOnes, KnownZero2, KnownOne2, Depth+1);
- unsigned RHSUnknownLeadingOnes = KnownOne2.countLeadingZeros();
- if (RHSUnknownLeadingOnes != BitWidth)
- LeadZ = std::min(BitWidth,
- LeadZ + BitWidth - RHSUnknownLeadingOnes - 1);
-
- KnownZero = APInt::getHighBitsSet(BitWidth, LeadZ) & Mask;
- return;
- }
- case Instruction::Select:
- ComputeMaskedBits(I->getOperand(2), Mask, KnownZero, KnownOne, Depth+1);
- ComputeMaskedBits(I->getOperand(1), Mask, KnownZero2, KnownOne2, Depth+1);
- assert((KnownZero & KnownOne) == 0 && "Bits known to be one AND zero?");
- assert((KnownZero2 & KnownOne2) == 0 && "Bits known to be one AND zero?");
-
- // Only known if known in both the LHS and RHS.
- KnownOne &= KnownOne2;
- KnownZero &= KnownZero2;
- return;
- case Instruction::FPTrunc:
- case Instruction::FPExt:
- case Instruction::FPToUI:
- case Instruction::FPToSI:
- case Instruction::SIToFP:
- case Instruction::UIToFP:
- return; // Can't work with floating point.
- case Instruction::PtrToInt:
- case Instruction::IntToPtr:
- // We can't handle these if we don't know the pointer size.
- if (!TD) return;
- // Fall through and handle them the same as zext/trunc.
- case Instruction::ZExt:
- case Instruction::Trunc: {
- // All these have integer operands
- const Type *SrcTy = I->getOperand(0)->getType();
- uint32_t SrcBitWidth = TD ?
- TD->getTypeSizeInBits(SrcTy) :
- SrcTy->getPrimitiveSizeInBits();
- APInt MaskIn(Mask);
- MaskIn.zextOrTrunc(SrcBitWidth);
- KnownZero.zextOrTrunc(SrcBitWidth);
- KnownOne.zextOrTrunc(SrcBitWidth);
- ComputeMaskedBits(I->getOperand(0), MaskIn, KnownZero, KnownOne, Depth+1);
- KnownZero.zextOrTrunc(BitWidth);
- KnownOne.zextOrTrunc(BitWidth);
- // Any top bits are known to be zero.
- if (BitWidth > SrcBitWidth)
- KnownZero |= APInt::getHighBitsSet(BitWidth, BitWidth - SrcBitWidth);
- return;
- }
- case Instruction::BitCast: {
- const Type *SrcTy = I->getOperand(0)->getType();
- if (SrcTy->isInteger() || isa<PointerType>(SrcTy)) {
- ComputeMaskedBits(I->getOperand(0), Mask, KnownZero, KnownOne, Depth+1);
- return;
- }
- break;
- }
- case Instruction::SExt: {
- // Compute the bits in the result that are not present in the input.
- const IntegerType *SrcTy = cast<IntegerType>(I->getOperand(0)->getType());
- uint32_t SrcBitWidth = SrcTy->getBitWidth();
-
- APInt MaskIn(Mask);
- MaskIn.trunc(SrcBitWidth);
- KnownZero.trunc(SrcBitWidth);
- KnownOne.trunc(SrcBitWidth);
- ComputeMaskedBits(I->getOperand(0), MaskIn, KnownZero, KnownOne, Depth+1);
- assert((KnownZero & KnownOne) == 0 && "Bits known to be one AND zero?");
- KnownZero.zext(BitWidth);
- KnownOne.zext(BitWidth);
-
- // If the sign bit of the input is known set or clear, then we know the
- // top bits of the result.
- if (KnownZero[SrcBitWidth-1]) // Input sign bit known zero
- KnownZero |= APInt::getHighBitsSet(BitWidth, BitWidth - SrcBitWidth);
- else if (KnownOne[SrcBitWidth-1]) // Input sign bit known set
- KnownOne |= APInt::getHighBitsSet(BitWidth, BitWidth - SrcBitWidth);
- return;
- }
- case Instruction::Shl:
- // (shl X, C1) & C2 == 0 iff (X & C2 >>u C1) == 0
- if (ConstantInt *SA = dyn_cast<ConstantInt>(I->getOperand(1))) {
- uint64_t ShiftAmt = SA->getLimitedValue(BitWidth);
- APInt Mask2(Mask.lshr(ShiftAmt));
- ComputeMaskedBits(I->getOperand(0), Mask2, KnownZero, KnownOne, Depth+1);
- assert((KnownZero & KnownOne) == 0 && "Bits known to be one AND zero?");
- KnownZero <<= ShiftAmt;
- KnownOne <<= ShiftAmt;
- KnownZero |= APInt::getLowBitsSet(BitWidth, ShiftAmt); // low bits known 0
- return;
- }
- break;
- case Instruction::LShr:
- // (ushr X, C1) & C2 == 0 iff (-1 >> C1) & C2 == 0
- if (ConstantInt *SA = dyn_cast<ConstantInt>(I->getOperand(1))) {
- // Compute the new bits that are at the top now.
- uint64_t ShiftAmt = SA->getLimitedValue(BitWidth);
-
- // Unsigned shift right.
- APInt Mask2(Mask.shl(ShiftAmt));
- ComputeMaskedBits(I->getOperand(0), Mask2, KnownZero,KnownOne,Depth+1);
- assert((KnownZero & KnownOne) == 0&&"Bits known to be one AND zero?");
- KnownZero = APIntOps::lshr(KnownZero, ShiftAmt);
- KnownOne = APIntOps::lshr(KnownOne, ShiftAmt);
- // high bits known zero.
- KnownZero |= APInt::getHighBitsSet(BitWidth, ShiftAmt);
- return;
- }
- break;
- case Instruction::AShr:
- // (ashr X, C1) & C2 == 0 iff (-1 >> C1) & C2 == 0
- if (ConstantInt *SA = dyn_cast<ConstantInt>(I->getOperand(1))) {
- // Compute the new bits that are at the top now.
- uint64_t ShiftAmt = SA->getLimitedValue(BitWidth);
-
- // Signed shift right.
- APInt Mask2(Mask.shl(ShiftAmt));
- ComputeMaskedBits(I->getOperand(0), Mask2, KnownZero,KnownOne,Depth+1);
- assert((KnownZero & KnownOne) == 0&&"Bits known to be one AND zero?");
- KnownZero = APIntOps::lshr(KnownZero, ShiftAmt);
- KnownOne = APIntOps::lshr(KnownOne, ShiftAmt);
-
- APInt HighBits(APInt::getHighBitsSet(BitWidth, ShiftAmt));
- if (KnownZero[BitWidth-ShiftAmt-1]) // New bits are known zero.
- KnownZero |= HighBits;
- else if (KnownOne[BitWidth-ShiftAmt-1]) // New bits are known one.
- KnownOne |= HighBits;
- return;
- }
- break;
- case Instruction::Sub: {
- if (ConstantInt *CLHS = dyn_cast<ConstantInt>(I->getOperand(0))) {
- // We know that the top bits of C-X are clear if X contains less bits
- // than C (i.e. no wrap-around can happen). For example, 20-X is
- // positive if we can prove that X is >= 0 and < 16.
- if (!CLHS->getValue().isNegative()) {
- unsigned NLZ = (CLHS->getValue()+1).countLeadingZeros();
- // NLZ can't be BitWidth with no sign bit
- APInt MaskV = APInt::getHighBitsSet(BitWidth, NLZ+1);
- ComputeMaskedBits(I->getOperand(1), MaskV, KnownZero2, KnownOne2,
- Depth+1);
-
- // If all of the MaskV bits are known to be zero, then we know the
- // output top bits are zero, because we now know that the output is
- // from [0-C].
- if ((KnownZero2 & MaskV) == MaskV) {
- unsigned NLZ2 = CLHS->getValue().countLeadingZeros();
- // Top bits known zero.
- KnownZero = APInt::getHighBitsSet(BitWidth, NLZ2) & Mask;
- }
- }
- }
- }
- // fall through
- case Instruction::Add: {
- // Output known-0 bits are known if clear or set in both the low clear bits
- // common to both LHS & RHS. For example, 8+(X<<3) is known to have the
- // low 3 bits clear.
- APInt Mask2 = APInt::getLowBitsSet(BitWidth, Mask.countTrailingOnes());
- ComputeMaskedBits(I->getOperand(0), Mask2, KnownZero2, KnownOne2, Depth+1);
- assert((KnownZero2 & KnownOne2) == 0 && "Bits known to be one AND zero?");
- unsigned KnownZeroOut = KnownZero2.countTrailingOnes();
-
- ComputeMaskedBits(I->getOperand(1), Mask2, KnownZero2, KnownOne2, Depth+1);
- assert((KnownZero2 & KnownOne2) == 0 && "Bits known to be one AND zero?");
- KnownZeroOut = std::min(KnownZeroOut,
- KnownZero2.countTrailingOnes());
-
- KnownZero |= APInt::getLowBitsSet(BitWidth, KnownZeroOut);
- return;
- }
- case Instruction::SRem:
- if (ConstantInt *Rem = dyn_cast<ConstantInt>(I->getOperand(1))) {
- APInt RA = Rem->getValue();
- if (RA.isPowerOf2() || (-RA).isPowerOf2()) {
- APInt LowBits = RA.isStrictlyPositive() ? (RA - 1) : ~RA;
- APInt Mask2 = LowBits | APInt::getSignBit(BitWidth);
- ComputeMaskedBits(I->getOperand(0), Mask2,KnownZero2,KnownOne2,Depth+1);
-
- // The sign of a remainder is equal to the sign of the first
- // operand (zero being positive).
- if (KnownZero2[BitWidth-1] || ((KnownZero2 & LowBits) == LowBits))
- KnownZero2 |= ~LowBits;
- else if (KnownOne2[BitWidth-1])
- KnownOne2 |= ~LowBits;
-
- KnownZero |= KnownZero2 & Mask;
- KnownOne |= KnownOne2 & Mask;
-
- assert((KnownZero & KnownOne) == 0&&"Bits known to be one AND zero?");
- }
- }
- break;
- case Instruction::URem: {
- if (ConstantInt *Rem = dyn_cast<ConstantInt>(I->getOperand(1))) {
- APInt RA = Rem->getValue();
- if (RA.isPowerOf2()) {
- APInt LowBits = (RA - 1);
- APInt Mask2 = LowBits & Mask;
- KnownZero |= ~LowBits & Mask;
- ComputeMaskedBits(I->getOperand(0), Mask2, KnownZero, KnownOne,Depth+1);
- assert((KnownZero & KnownOne) == 0&&"Bits known to be one AND zero?");
- break;
- }
- }
-
- // Since the result is less than or equal to either operand, any leading
- // zero bits in either operand must also exist in the result.
- APInt AllOnes = APInt::getAllOnesValue(BitWidth);
- ComputeMaskedBits(I->getOperand(0), AllOnes, KnownZero, KnownOne,
- Depth+1);
- ComputeMaskedBits(I->getOperand(1), AllOnes, KnownZero2, KnownOne2,
- Depth+1);
-
- uint32_t Leaders = std::max(KnownZero.countLeadingOnes(),
- KnownZero2.countLeadingOnes());
- KnownOne.clear();
- KnownZero = APInt::getHighBitsSet(BitWidth, Leaders) & Mask;
- break;
- }
-
- case Instruction::Alloca:
- case Instruction::Malloc: {
- AllocationInst *AI = cast<AllocationInst>(V);
- unsigned Align = AI->getAlignment();
- if (Align == 0 && TD) {
- if (isa<AllocaInst>(AI))
- Align = TD->getPrefTypeAlignment(AI->getType()->getElementType());
- else if (isa<MallocInst>(AI)) {
- // Malloc returns maximally aligned memory.
- Align = TD->getABITypeAlignment(AI->getType()->getElementType());
- Align =
- std::max(Align,
- (unsigned)TD->getABITypeAlignment(Type::DoubleTy));
- Align =
- std::max(Align,
- (unsigned)TD->getABITypeAlignment(Type::Int64Ty));
- }
- }
-
- if (Align > 0)
- KnownZero = Mask & APInt::getLowBitsSet(BitWidth,
- CountTrailingZeros_32(Align));
- break;
- }
- case Instruction::GetElementPtr: {
- // Analyze all of the subscripts of this getelementptr instruction
- // to determine if we can prove known low zero bits.
- APInt LocalMask = APInt::getAllOnesValue(BitWidth);
- APInt LocalKnownZero(BitWidth, 0), LocalKnownOne(BitWidth, 0);
- ComputeMaskedBits(I->getOperand(0), LocalMask,
- LocalKnownZero, LocalKnownOne, Depth+1);
- unsigned TrailZ = LocalKnownZero.countTrailingOnes();
-
- gep_type_iterator GTI = gep_type_begin(I);
- for (unsigned i = 1, e = I->getNumOperands(); i != e; ++i, ++GTI) {
- Value *Index = I->getOperand(i);
- if (const StructType *STy = dyn_cast<StructType>(*GTI)) {
- // Handle struct member offset arithmetic.
- if (!TD) return;
- const StructLayout *SL = TD->getStructLayout(STy);
- unsigned Idx = cast<ConstantInt>(Index)->getZExtValue();
- uint64_t Offset = SL->getElementOffset(Idx);
- TrailZ = std::min(TrailZ,
- CountTrailingZeros_64(Offset));
- } else {
- // Handle array index arithmetic.
- const Type *IndexedTy = GTI.getIndexedType();
- if (!IndexedTy->isSized()) return;
- unsigned GEPOpiBits = Index->getType()->getPrimitiveSizeInBits();
- uint64_t TypeSize = TD ? TD->getABITypeSize(IndexedTy) : 1;
- LocalMask = APInt::getAllOnesValue(GEPOpiBits);
- LocalKnownZero = LocalKnownOne = APInt(GEPOpiBits, 0);
- ComputeMaskedBits(Index, LocalMask,
- LocalKnownZero, LocalKnownOne, Depth+1);
- TrailZ = std::min(TrailZ,
- CountTrailingZeros_64(TypeSize) +
- LocalKnownZero.countTrailingOnes());
- }
- }
-
- KnownZero = APInt::getLowBitsSet(BitWidth, TrailZ) & Mask;
- break;
- }
- case Instruction::PHI: {
- PHINode *P = cast<PHINode>(I);
- // Handle the case of a simple two-predecessor recurrence PHI.
- // There's a lot more that could theoretically be done here, but
- // this is sufficient to catch some interesting cases.
- if (P->getNumIncomingValues() == 2) {
- for (unsigned i = 0; i != 2; ++i) {
- Value *L = P->getIncomingValue(i);
- Value *R = P->getIncomingValue(!i);
- User *LU = dyn_cast<User>(L);
- unsigned Opcode = LU ? getOpcode(LU) : (unsigned)Instruction::UserOp1;
- // Check for operations that have the property that if
- // both their operands have low zero bits, the result
- // will have low zero bits.
- if (Opcode == Instruction::Add ||
- Opcode == Instruction::Sub ||
- Opcode == Instruction::And ||
- Opcode == Instruction::Or ||
- Opcode == Instruction::Mul) {
- Value *LL = LU->getOperand(0);
- Value *LR = LU->getOperand(1);
- // Find a recurrence.
- if (LL == I)
- L = LR;
- else if (LR == I)
- L = LL;
- else
- break;
- // Ok, we have a PHI of the form L op= R. Check for low
- // zero bits.
- APInt Mask2 = APInt::getAllOnesValue(BitWidth);
- ComputeMaskedBits(R, Mask2, KnownZero2, KnownOne2, Depth+1);
- Mask2 = APInt::getLowBitsSet(BitWidth,
- KnownZero2.countTrailingOnes());
- KnownOne2.clear();
- KnownZero2.clear();
- ComputeMaskedBits(L, Mask2, KnownZero2, KnownOne2, Depth+1);
- KnownZero = Mask &
- APInt::getLowBitsSet(BitWidth,
- KnownZero2.countTrailingOnes());
- break;
- }
- }
- }
- break;
- }
- case Instruction::Call:
- if (IntrinsicInst *II = dyn_cast<IntrinsicInst>(I)) {
- switch (II->getIntrinsicID()) {
- default: break;
- case Intrinsic::ctpop:
- case Intrinsic::ctlz:
- case Intrinsic::cttz: {
- unsigned LowBits = Log2_32(BitWidth)+1;
- KnownZero = APInt::getHighBitsSet(BitWidth, BitWidth - LowBits);
- break;
- }
- }
- }
- break;
- }
-}
-
-/// MaskedValueIsZero - Return true if 'V & Mask' is known to be zero. We use
-/// this predicate to simplify operations downstream. Mask is known to be zero
-/// for bits that V cannot have.
-bool InstCombiner::MaskedValueIsZero(Value *V, const APInt& Mask,
- unsigned Depth) {
- APInt KnownZero(Mask.getBitWidth(), 0), KnownOne(Mask.getBitWidth(), 0);
- ComputeMaskedBits(V, Mask, KnownZero, KnownOne, Depth);
- assert((KnownZero & KnownOne) == 0 && "Bits known to be one AND zero?");
- return (KnownZero & Mask) == Mask;
-}
-
-/// ShrinkDemandedConstant - Check to see if the specified operand of the
-/// specified instruction is a constant integer. If so, check to see if there
-/// are any bits set in the constant that are not demanded. If so, shrink the
-/// constant and return true.
-static bool ShrinkDemandedConstant(Instruction *I, unsigned OpNo,
- APInt Demanded) {
- assert(I && "No instruction?");
- assert(OpNo < I->getNumOperands() && "Operand index too large");
-
- // If the operand is not a constant integer, nothing to do.
- ConstantInt *OpC = dyn_cast<ConstantInt>(I->getOperand(OpNo));
- if (!OpC) return false;
-
- // If there are no bits set that aren't demanded, nothing to do.
- Demanded.zextOrTrunc(OpC->getValue().getBitWidth());
- if ((~Demanded & OpC->getValue()) == 0)
- return false;
-
- // This instruction is producing bits that are not demanded. Shrink the RHS.
- Demanded &= OpC->getValue();
- I->setOperand(OpNo, ConstantInt::get(Demanded));
- return true;
-}
-
-// ComputeSignedMinMaxValuesFromKnownBits - Given a signed integer type and a
-// set of known zero and one bits, compute the maximum and minimum values that
-// could have the specified known zero and known one bits, returning them in
-// min/max.
-static void ComputeSignedMinMaxValuesFromKnownBits(const Type *Ty,
- const APInt& KnownZero,
- const APInt& KnownOne,
- APInt& Min, APInt& Max) {
- uint32_t BitWidth = cast<IntegerType>(Ty)->getBitWidth();
- assert(KnownZero.getBitWidth() == BitWidth &&
- KnownOne.getBitWidth() == BitWidth &&
- Min.getBitWidth() == BitWidth && Max.getBitWidth() == BitWidth &&
- "Ty, KnownZero, KnownOne and Min, Max must have equal bitwidth.");
- APInt UnknownBits = ~(KnownZero|KnownOne);
-
- // The minimum value is when all unknown bits are zeros, EXCEPT for the sign
- // bit if it is unknown.
- Min = KnownOne;
- Max = KnownOne|UnknownBits;
-
- if (UnknownBits[BitWidth-1]) { // Sign bit is unknown
- Min.set(BitWidth-1);
- Max.clear(BitWidth-1);
- }
-}
-
-// ComputeUnsignedMinMaxValuesFromKnownBits - Given an unsigned integer type and
-// a set of known zero and one bits, compute the maximum and minimum values that
-// could have the specified known zero and known one bits, returning them in
-// min/max.
-static void ComputeUnsignedMinMaxValuesFromKnownBits(const Type *Ty,
- const APInt &KnownZero,
- const APInt &KnownOne,
- APInt &Min, APInt &Max) {
- uint32_t BitWidth = cast<IntegerType>(Ty)->getBitWidth(); BitWidth = BitWidth;
- assert(KnownZero.getBitWidth() == BitWidth &&
- KnownOne.getBitWidth() == BitWidth &&
- Min.getBitWidth() == BitWidth && Max.getBitWidth() &&
- "Ty, KnownZero, KnownOne and Min, Max must have equal bitwidth.");
- APInt UnknownBits = ~(KnownZero|KnownOne);
-
- // The minimum value is when the unknown bits are all zeros.
- Min = KnownOne;
- // The maximum value is when the unknown bits are all ones.
- Max = KnownOne|UnknownBits;
-}
-
-/// SimplifyDemandedBits - This function attempts to replace V with a simpler
-/// value based on the demanded bits. When this function is called, it is known
-/// that only the bits set in DemandedMask of the result of V are ever used
-/// downstream. Consequently, depending on the mask and V, it may be possible
-/// to replace V with a constant or one of its operands. In such cases, this
-/// function does the replacement and returns true. In all other cases, it
-/// returns false after analyzing the expression and setting KnownOne and known
-/// to be one in the expression. KnownZero contains all the bits that are known
-/// to be zero in the expression. These are provided to potentially allow the
-/// caller (which might recursively be SimplifyDemandedBits itself) to simplify
-/// the expression. KnownOne and KnownZero always follow the invariant that
-/// KnownOne & KnownZero == 0. That is, a bit can't be both 1 and 0. Note that
-/// the bits in KnownOne and KnownZero may only be accurate for those bits set
-/// in DemandedMask. Note also that the bitwidth of V, DemandedMask, KnownZero
-/// and KnownOne must all be the same.
-bool InstCombiner::SimplifyDemandedBits(Value *V, APInt DemandedMask,
- APInt& KnownZero, APInt& KnownOne,
- unsigned Depth) {
- assert(V != 0 && "Null pointer of Value???");
- assert(Depth <= 6 && "Limit Search Depth");
- uint32_t BitWidth = DemandedMask.getBitWidth();
- const IntegerType *VTy = cast<IntegerType>(V->getType());
- assert(VTy->getBitWidth() == BitWidth &&
- KnownZero.getBitWidth() == BitWidth &&
- KnownOne.getBitWidth() == BitWidth &&
- "Value *V, DemandedMask, KnownZero and KnownOne \
- must have same BitWidth");
- if (ConstantInt *CI = dyn_cast<ConstantInt>(V)) {
- // We know all of the bits for a constant!
- KnownOne = CI->getValue() & DemandedMask;
- KnownZero = ~KnownOne & DemandedMask;
- return false;
- }
-
- KnownZero.clear();
- KnownOne.clear();
- if (!V->hasOneUse()) { // Other users may use these bits.
- if (Depth != 0) { // Not at the root.
- // Just compute the KnownZero/KnownOne bits to simplify things downstream.
- ComputeMaskedBits(V, DemandedMask, KnownZero, KnownOne, Depth);
- return false;
- }
- // If this is the root being simplified, allow it to have multiple uses,
- // just set the DemandedMask to all bits.
- DemandedMask = APInt::getAllOnesValue(BitWidth);
- } else if (DemandedMask == 0) { // Not demanding any bits from V.
- if (V != UndefValue::get(VTy))
- return UpdateValueUsesWith(V, UndefValue::get(VTy));
- return false;
- } else if (Depth == 6) { // Limit search depth.
- return false;
- }
-
- Instruction *I = dyn_cast<Instruction>(V);
- if (!I) return false; // Only analyze instructions.
-
- APInt LHSKnownZero(BitWidth, 0), LHSKnownOne(BitWidth, 0);
- APInt &RHSKnownZero = KnownZero, &RHSKnownOne = KnownOne;
- switch (I->getOpcode()) {
- default:
- ComputeMaskedBits(V, DemandedMask, RHSKnownZero, RHSKnownOne, Depth);
- break;
- case Instruction::And:
- // If either the LHS or the RHS are Zero, the result is zero.
- if (SimplifyDemandedBits(I->getOperand(1), DemandedMask,
- RHSKnownZero, RHSKnownOne, Depth+1))
- return true;
- assert((RHSKnownZero & RHSKnownOne) == 0 &&
- "Bits known to be one AND zero?");
-
- // If something is known zero on the RHS, the bits aren't demanded on the
- // LHS.
- if (SimplifyDemandedBits(I->getOperand(0), DemandedMask & ~RHSKnownZero,
- LHSKnownZero, LHSKnownOne, Depth+1))
- return true;
- assert((LHSKnownZero & LHSKnownOne) == 0 &&
- "Bits known to be one AND zero?");
-
- // If all of the demanded bits are known 1 on one side, return the other.
- // These bits cannot contribute to the result of the 'and'.
- if ((DemandedMask & ~LHSKnownZero & RHSKnownOne) ==
- (DemandedMask & ~LHSKnownZero))
- return UpdateValueUsesWith(I, I->getOperand(0));
- if ((DemandedMask & ~RHSKnownZero & LHSKnownOne) ==
- (DemandedMask & ~RHSKnownZero))
- return UpdateValueUsesWith(I, I->getOperand(1));
-
- // If all of the demanded bits in the inputs are known zeros, return zero.
- if ((DemandedMask & (RHSKnownZero|LHSKnownZero)) == DemandedMask)
- return UpdateValueUsesWith(I, Constant::getNullValue(VTy));
-
- // If the RHS is a constant, see if we can simplify it.
- if (ShrinkDemandedConstant(I, 1, DemandedMask & ~LHSKnownZero))
- return UpdateValueUsesWith(I, I);
-
- // Output known-1 bits are only known if set in both the LHS & RHS.
- RHSKnownOne &= LHSKnownOne;
- // Output known-0 are known to be clear if zero in either the LHS | RHS.
- RHSKnownZero |= LHSKnownZero;
- break;
- case Instruction::Or:
- // If either the LHS or the RHS are One, the result is One.
- if (SimplifyDemandedBits(I->getOperand(1), DemandedMask,
- RHSKnownZero, RHSKnownOne, Depth+1))
- return true;
- assert((RHSKnownZero & RHSKnownOne) == 0 &&
- "Bits known to be one AND zero?");
- // If something is known one on the RHS, the bits aren't demanded on the
- // LHS.
- if (SimplifyDemandedBits(I->getOperand(0), DemandedMask & ~RHSKnownOne,
- LHSKnownZero, LHSKnownOne, Depth+1))
- return true;
- assert((LHSKnownZero & LHSKnownOne) == 0 &&
- "Bits known to be one AND zero?");
-
- // If all of the demanded bits are known zero on one side, return the other.
- // These bits cannot contribute to the result of the 'or'.
- if ((DemandedMask & ~LHSKnownOne & RHSKnownZero) ==
- (DemandedMask & ~LHSKnownOne))
- return UpdateValueUsesWith(I, I->getOperand(0));
- if ((DemandedMask & ~RHSKnownOne & LHSKnownZero) ==
- (DemandedMask & ~RHSKnownOne))
- return UpdateValueUsesWith(I, I->getOperand(1));
-
- // If all of the potentially set bits on one side are known to be set on
- // the other side, just use the 'other' side.
- if ((DemandedMask & (~RHSKnownZero) & LHSKnownOne) ==
- (DemandedMask & (~RHSKnownZero)))
- return UpdateValueUsesWith(I, I->getOperand(0));
- if ((DemandedMask & (~LHSKnownZero) & RHSKnownOne) ==
- (DemandedMask & (~LHSKnownZero)))
- return UpdateValueUsesWith(I, I->getOperand(1));
-
- // If the RHS is a constant, see if we can simplify it.
- if (ShrinkDemandedConstant(I, 1, DemandedMask))
- return UpdateValueUsesWith(I, I);
-
- // Output known-0 bits are only known if clear in both the LHS & RHS.
- RHSKnownZero &= LHSKnownZero;
- // Output known-1 are known to be set if set in either the LHS | RHS.
- RHSKnownOne |= LHSKnownOne;
- break;
- case Instruction::Xor: {
- if (SimplifyDemandedBits(I->getOperand(1), DemandedMask,
- RHSKnownZero, RHSKnownOne, Depth+1))
- return true;
- assert((RHSKnownZero & RHSKnownOne) == 0 &&
- "Bits known to be one AND zero?");
- if (SimplifyDemandedBits(I->getOperand(0), DemandedMask,
- LHSKnownZero, LHSKnownOne, Depth+1))
- return true;
- assert((LHSKnownZero & LHSKnownOne) == 0 &&
- "Bits known to be one AND zero?");
-
- // If all of the demanded bits are known zero on one side, return the other.
- // These bits cannot contribute to the result of the 'xor'.
- if ((DemandedMask & RHSKnownZero) == DemandedMask)
- return UpdateValueUsesWith(I, I->getOperand(0));
- if ((DemandedMask & LHSKnownZero) == DemandedMask)
- return UpdateValueUsesWith(I, I->getOperand(1));
-
- // Output known-0 bits are known if clear or set in both the LHS & RHS.
- APInt KnownZeroOut = (RHSKnownZero & LHSKnownZero) |
- (RHSKnownOne & LHSKnownOne);
- // Output known-1 are known to be set if set in only one of the LHS, RHS.
- APInt KnownOneOut = (RHSKnownZero & LHSKnownOne) |
- (RHSKnownOne & LHSKnownZero);
-
- // If all of the demanded bits are known to be zero on one side or the
- // other, turn this into an *inclusive* or.
- // e.g. (A & C1)^(B & C2) -> (A & C1)|(B & C2) iff C1&C2 == 0
- if ((DemandedMask & ~RHSKnownZero & ~LHSKnownZero) == 0) {
- Instruction *Or =
- BinaryOperator::createOr(I->getOperand(0), I->getOperand(1),
- I->getName());
- InsertNewInstBefore(Or, *I);
- return UpdateValueUsesWith(I, Or);
- }
-
- // If all of the demanded bits on one side are known, and all of the set
- // bits on that side are also known to be set on the other side, turn this
- // into an AND, as we know the bits will be cleared.
- // e.g. (X | C1) ^ C2 --> (X | C1) & ~C2 iff (C1&C2) == C2
- if ((DemandedMask & (RHSKnownZero|RHSKnownOne)) == DemandedMask) {
- // all known
- if ((RHSKnownOne & LHSKnownOne) == RHSKnownOne) {
- Constant *AndC = ConstantInt::get(~RHSKnownOne & DemandedMask);
- Instruction *And =
- BinaryOperator::createAnd(I->getOperand(0), AndC, "tmp");
- InsertNewInstBefore(And, *I);
- return UpdateValueUsesWith(I, And);
- }
- }
-
- // If the RHS is a constant, see if we can simplify it.
- // FIXME: for XOR, we prefer to force bits to 1 if they will make a -1.
- if (ShrinkDemandedConstant(I, 1, DemandedMask))
- return UpdateValueUsesWith(I, I);
-
- RHSKnownZero = KnownZeroOut;
- RHSKnownOne = KnownOneOut;
- break;
- }
- case Instruction::Select:
- if (SimplifyDemandedBits(I->getOperand(2), DemandedMask,
- RHSKnownZero, RHSKnownOne, Depth+1))
- return true;
- if (SimplifyDemandedBits(I->getOperand(1), DemandedMask,
- LHSKnownZero, LHSKnownOne, Depth+1))
- return true;
- assert((RHSKnownZero & RHSKnownOne) == 0 &&
- "Bits known to be one AND zero?");
- assert((LHSKnownZero & LHSKnownOne) == 0 &&
- "Bits known to be one AND zero?");
-
- // If the operands are constants, see if we can simplify them.
- if (ShrinkDemandedConstant(I, 1, DemandedMask))
- return UpdateValueUsesWith(I, I);
- if (ShrinkDemandedConstant(I, 2, DemandedMask))
- return UpdateValueUsesWith(I, I);
-
- // Only known if known in both the LHS and RHS.
- RHSKnownOne &= LHSKnownOne;
- RHSKnownZero &= LHSKnownZero;
- break;
- case Instruction::Trunc: {
- uint32_t truncBf =
- cast<IntegerType>(I->getOperand(0)->getType())->getBitWidth();
- DemandedMask.zext(truncBf);
- RHSKnownZero.zext(truncBf);
- RHSKnownOne.zext(truncBf);
- if (SimplifyDemandedBits(I->getOperand(0), DemandedMask,
- RHSKnownZero, RHSKnownOne, Depth+1))
- return true;
- DemandedMask.trunc(BitWidth);
- RHSKnownZero.trunc(BitWidth);
- RHSKnownOne.trunc(BitWidth);
- assert((RHSKnownZero & RHSKnownOne) == 0 &&
- "Bits known to be one AND zero?");
- break;
- }
- case Instruction::BitCast:
- if (!I->getOperand(0)->getType()->isInteger())
- return false;
-
- if (SimplifyDemandedBits(I->getOperand(0), DemandedMask,
- RHSKnownZero, RHSKnownOne, Depth+1))
- return true;
- assert((RHSKnownZero & RHSKnownOne) == 0 &&
- "Bits known to be one AND zero?");
- break;
- case Instruction::ZExt: {
- // Compute the bits in the result that are not present in the input.
- const IntegerType *SrcTy = cast<IntegerType>(I->getOperand(0)->getType());
- uint32_t SrcBitWidth = SrcTy->getBitWidth();
-
- DemandedMask.trunc(SrcBitWidth);
- RHSKnownZero.trunc(SrcBitWidth);
- RHSKnownOne.trunc(SrcBitWidth);
- if (SimplifyDemandedBits(I->getOperand(0), DemandedMask,
- RHSKnownZero, RHSKnownOne, Depth+1))
- return true;
- DemandedMask.zext(BitWidth);
- RHSKnownZero.zext(BitWidth);
- RHSKnownOne.zext(BitWidth);
- assert((RHSKnownZero & RHSKnownOne) == 0 &&
- "Bits known to be one AND zero?");
- // The top bits are known to be zero.
- RHSKnownZero |= APInt::getHighBitsSet(BitWidth, BitWidth - SrcBitWidth);
- break;
- }
- case Instruction::SExt: {
- // Compute the bits in the result that are not present in the input.
- const IntegerType *SrcTy = cast<IntegerType>(I->getOperand(0)->getType());
- uint32_t SrcBitWidth = SrcTy->getBitWidth();
-
- APInt InputDemandedBits = DemandedMask &
- APInt::getLowBitsSet(BitWidth, SrcBitWidth);
-
- APInt NewBits(APInt::getHighBitsSet(BitWidth, BitWidth - SrcBitWidth));
- // If any of the sign extended bits are demanded, we know that the sign
- // bit is demanded.
- if ((NewBits & DemandedMask) != 0)
- InputDemandedBits.set(SrcBitWidth-1);
-
- InputDemandedBits.trunc(SrcBitWidth);
- RHSKnownZero.trunc(SrcBitWidth);
- RHSKnownOne.trunc(SrcBitWidth);
- if (SimplifyDemandedBits(I->getOperand(0), InputDemandedBits,
- RHSKnownZero, RHSKnownOne, Depth+1))
- return true;
- InputDemandedBits.zext(BitWidth);
- RHSKnownZero.zext(BitWidth);
- RHSKnownOne.zext(BitWidth);
- assert((RHSKnownZero & RHSKnownOne) == 0 &&
- "Bits known to be one AND zero?");
-
- // If the sign bit of the input is known set or clear, then we know the
- // top bits of the result.
-
- // If the input sign bit is known zero, or if the NewBits are not demanded
- // convert this into a zero extension.
- if (RHSKnownZero[SrcBitWidth-1] || (NewBits & ~DemandedMask) == NewBits)
- {
- // Convert to ZExt cast
- CastInst *NewCast = new ZExtInst(I->getOperand(0), VTy, I->getName(), I);
- return UpdateValueUsesWith(I, NewCast);
- } else if (RHSKnownOne[SrcBitWidth-1]) { // Input sign bit known set
- RHSKnownOne |= NewBits;
- }
- break;
- }
- case Instruction::Add: {
- // Figure out what the input bits are. If the top bits of the and result
- // are not demanded, then the add doesn't demand them from its input
- // either.
- uint32_t NLZ = DemandedMask.countLeadingZeros();
-
- // If there is a constant on the RHS, there are a variety of xformations
- // we can do.
- if (ConstantInt *RHS = dyn_cast<ConstantInt>(I->getOperand(1))) {
- // If null, this should be simplified elsewhere. Some of the xforms here
- // won't work if the RHS is zero.
- if (RHS->isZero())
- break;
-
- // If the top bit of the output is demanded, demand everything from the
- // input. Otherwise, we demand all the input bits except NLZ top bits.
- APInt InDemandedBits(APInt::getLowBitsSet(BitWidth, BitWidth - NLZ));
-
- // Find information about known zero/one bits in the input.
- if (SimplifyDemandedBits(I->getOperand(0), InDemandedBits,
- LHSKnownZero, LHSKnownOne, Depth+1))
- return true;
-
- // If the RHS of the add has bits set that can't affect the input, reduce
- // the constant.
- if (ShrinkDemandedConstant(I, 1, InDemandedBits))
- return UpdateValueUsesWith(I, I);
-
- // Avoid excess work.
- if (LHSKnownZero == 0 && LHSKnownOne == 0)
- break;
-
- // Turn it into OR if input bits are zero.
- if ((LHSKnownZero & RHS->getValue()) == RHS->getValue()) {
- Instruction *Or =
- BinaryOperator::createOr(I->getOperand(0), I->getOperand(1),
- I->getName());
- InsertNewInstBefore(Or, *I);
- return UpdateValueUsesWith(I, Or);
- }
-
- // We can say something about the output known-zero and known-one bits,
- // depending on potential carries from the input constant and the
- // unknowns. For example if the LHS is known to have at most the 0x0F0F0
- // bits set and the RHS constant is 0x01001, then we know we have a known
- // one mask of 0x00001 and a known zero mask of 0xE0F0E.
-
- // To compute this, we first compute the potential carry bits. These are
- // the bits which may be modified. I'm not aware of a better way to do
- // this scan.
- const APInt& RHSVal = RHS->getValue();
- APInt CarryBits((~LHSKnownZero + RHSVal) ^ (~LHSKnownZero ^ RHSVal));
-
- // Now that we know which bits have carries, compute the known-1/0 sets.
-
- // Bits are known one if they are known zero in one operand and one in the
- // other, and there is no input carry.
- RHSKnownOne = ((LHSKnownZero & RHSVal) |
- (LHSKnownOne & ~RHSVal)) & ~CarryBits;
-
- // Bits are known zero if they are known zero in both operands and there
- // is no input carry.
- RHSKnownZero = LHSKnownZero & ~RHSVal & ~CarryBits;
- } else {
- // If the high-bits of this ADD are not demanded, then it does not demand
- // the high bits of its LHS or RHS.
- if (DemandedMask[BitWidth-1] == 0) {
- // Right fill the mask of bits for this ADD to demand the most
- // significant bit and all those below it.
- APInt DemandedFromOps(APInt::getLowBitsSet(BitWidth, BitWidth-NLZ));
- if (SimplifyDemandedBits(I->getOperand(0), DemandedFromOps,
- LHSKnownZero, LHSKnownOne, Depth+1))
- return true;
- if (SimplifyDemandedBits(I->getOperand(1), DemandedFromOps,
- LHSKnownZero, LHSKnownOne, Depth+1))
- return true;
- }
- }
- break;
- }
- case Instruction::Sub:
- // If the high-bits of this SUB are not demanded, then it does not demand
- // the high bits of its LHS or RHS.
- if (DemandedMask[BitWidth-1] == 0) {
- // Right fill the mask of bits for this SUB to demand the most
- // significant bit and all those below it.
- uint32_t NLZ = DemandedMask.countLeadingZeros();
- APInt DemandedFromOps(APInt::getLowBitsSet(BitWidth, BitWidth-NLZ));
- if (SimplifyDemandedBits(I->getOperand(0), DemandedFromOps,
- LHSKnownZero, LHSKnownOne, Depth+1))
- return true;
- if (SimplifyDemandedBits(I->getOperand(1), DemandedFromOps,
- LHSKnownZero, LHSKnownOne, Depth+1))
- return true;
- }
- // Otherwise just hand the sub off to ComputeMaskedBits to fill in
- // the known zeros and ones.
- ComputeMaskedBits(V, DemandedMask, RHSKnownZero, RHSKnownOne, Depth);
- break;
- case Instruction::Shl:
- if (ConstantInt *SA = dyn_cast<ConstantInt>(I->getOperand(1))) {
- uint64_t ShiftAmt = SA->getLimitedValue(BitWidth);
- APInt DemandedMaskIn(DemandedMask.lshr(ShiftAmt));
- if (SimplifyDemandedBits(I->getOperand(0), DemandedMaskIn,
- RHSKnownZero, RHSKnownOne, Depth+1))
- return true;
- assert((RHSKnownZero & RHSKnownOne) == 0 &&
- "Bits known to be one AND zero?");
- RHSKnownZero <<= ShiftAmt;
- RHSKnownOne <<= ShiftAmt;
- // low bits known zero.
- if (ShiftAmt)
- RHSKnownZero |= APInt::getLowBitsSet(BitWidth, ShiftAmt);
- }
- break;
- case Instruction::LShr:
- // For a logical shift right
- if (ConstantInt *SA = dyn_cast<ConstantInt>(I->getOperand(1))) {
- uint64_t ShiftAmt = SA->getLimitedValue(BitWidth);
-
- // Unsigned shift right.
- APInt DemandedMaskIn(DemandedMask.shl(ShiftAmt));
- if (SimplifyDemandedBits(I->getOperand(0), DemandedMaskIn,
- RHSKnownZero, RHSKnownOne, Depth+1))
- return true;
- assert((RHSKnownZero & RHSKnownOne) == 0 &&
- "Bits known to be one AND zero?");
- RHSKnownZero = APIntOps::lshr(RHSKnownZero, ShiftAmt);
- RHSKnownOne = APIntOps::lshr(RHSKnownOne, ShiftAmt);
- if (ShiftAmt) {
- // Compute the new bits that are at the top now.
- APInt HighBits(APInt::getHighBitsSet(BitWidth, ShiftAmt));
- RHSKnownZero |= HighBits; // high bits known zero.
- }
- }
- break;
- case Instruction::AShr:
- // If this is an arithmetic shift right and only the low-bit is set, we can
- // always convert this into a logical shr, even if the shift amount is
- // variable. The low bit of the shift cannot be an input sign bit unless
- // the shift amount is >= the size of the datatype, which is undefined.
- if (DemandedMask == 1) {
- // Perform the logical shift right.
- Value *NewVal = BinaryOperator::createLShr(
- I->getOperand(0), I->getOperand(1), I->getName());
- InsertNewInstBefore(cast<Instruction>(NewVal), *I);
- return UpdateValueUsesWith(I, NewVal);
- }
-
- // If the sign bit is the only bit demanded by this ashr, then there is no
- // need to do it, the shift doesn't change the high bit.
- if (DemandedMask.isSignBit())
- return UpdateValueUsesWith(I, I->getOperand(0));
-
- if (ConstantInt *SA = dyn_cast<ConstantInt>(I->getOperand(1))) {
- uint32_t ShiftAmt = SA->getLimitedValue(BitWidth);
-
- // Signed shift right.
- APInt DemandedMaskIn(DemandedMask.shl(ShiftAmt));
- // If any of the "high bits" are demanded, we should set the sign bit as
- // demanded.
- if (DemandedMask.countLeadingZeros() <= ShiftAmt)
- DemandedMaskIn.set(BitWidth-1);
- if (SimplifyDemandedBits(I->getOperand(0),
- DemandedMaskIn,
- RHSKnownZero, RHSKnownOne, Depth+1))
- return true;
- assert((RHSKnownZero & RHSKnownOne) == 0 &&
- "Bits known to be one AND zero?");
- // Compute the new bits that are at the top now.
- APInt HighBits(APInt::getHighBitsSet(BitWidth, ShiftAmt));
- RHSKnownZero = APIntOps::lshr(RHSKnownZero, ShiftAmt);
- RHSKnownOne = APIntOps::lshr(RHSKnownOne, ShiftAmt);
-
- // Handle the sign bits.
- APInt SignBit(APInt::getSignBit(BitWidth));
- // Adjust to where it is now in the mask.
- SignBit = APIntOps::lshr(SignBit, ShiftAmt);
-
- // If the input sign bit is known to be zero, or if none of the top bits
- // are demanded, turn this into an unsigned shift right.
- if (RHSKnownZero[BitWidth-ShiftAmt-1] ||
- (HighBits & ~DemandedMask) == HighBits) {
- // Perform the logical shift right.
- Value *NewVal = BinaryOperator::createLShr(
- I->getOperand(0), SA, I->getName());
- InsertNewInstBefore(cast<Instruction>(NewVal), *I);
- return UpdateValueUsesWith(I, NewVal);
- } else if ((RHSKnownOne & SignBit) != 0) { // New bits are known one.
- RHSKnownOne |= HighBits;
- }
- }
- break;
- case Instruction::SRem:
- if (ConstantInt *Rem = dyn_cast<ConstantInt>(I->getOperand(1))) {
- APInt RA = Rem->getValue();
- if (RA.isPowerOf2() || (-RA).isPowerOf2()) {
- APInt LowBits = RA.isStrictlyPositive() ? (RA - 1) : ~RA;
- APInt Mask2 = LowBits | APInt::getSignBit(BitWidth);
- if (SimplifyDemandedBits(I->getOperand(0), Mask2,
- LHSKnownZero, LHSKnownOne, Depth+1))
- return true;
-
- if (LHSKnownZero[BitWidth-1] || ((LHSKnownZero & LowBits) == LowBits))
- LHSKnownZero |= ~LowBits;
- else if (LHSKnownOne[BitWidth-1])
- LHSKnownOne |= ~LowBits;
-
- KnownZero |= LHSKnownZero & DemandedMask;
- KnownOne |= LHSKnownOne & DemandedMask;
-
- assert((KnownZero & KnownOne) == 0&&"Bits known to be one AND zero?");
- }
- }
- break;
- case Instruction::URem: {
- if (ConstantInt *Rem = dyn_cast<ConstantInt>(I->getOperand(1))) {
- APInt RA = Rem->getValue();
- if (RA.isPowerOf2()) {
- APInt LowBits = (RA - 1);
- APInt Mask2 = LowBits & DemandedMask;
- KnownZero |= ~LowBits & DemandedMask;
- if (SimplifyDemandedBits(I->getOperand(0), Mask2,
- KnownZero, KnownOne, Depth+1))
- return true;
-
- assert((KnownZero & KnownOne) == 0&&"Bits known to be one AND zero?");
- break;
- }
- }
-
- APInt KnownZero2(BitWidth, 0), KnownOne2(BitWidth, 0);
- APInt AllOnes = APInt::getAllOnesValue(BitWidth);
- if (SimplifyDemandedBits(I->getOperand(0), AllOnes,
- KnownZero2, KnownOne2, Depth+1))
- return true;
-
- uint32_t Leaders = KnownZero2.countLeadingOnes();
- if (SimplifyDemandedBits(I->getOperand(1), AllOnes,
- KnownZero2, KnownOne2, Depth+1))
- return true;
-
- Leaders = std::max(Leaders,
- KnownZero2.countLeadingOnes());
- KnownZero = APInt::getHighBitsSet(BitWidth, Leaders) & DemandedMask;
- break;
- }
- }
-
- // If the client is only demanding bits that we know, return the known
- // constant.
- if ((DemandedMask & (RHSKnownZero|RHSKnownOne)) == DemandedMask)
- return UpdateValueUsesWith(I, ConstantInt::get(RHSKnownOne));
- return false;
-}
-
-
-/// SimplifyDemandedVectorElts - The specified value producecs a vector with
-/// 64 or fewer elements. DemandedElts contains the set of elements that are
-/// actually used by the caller. This method analyzes which elements of the
-/// operand are undef and returns that information in UndefElts.
-///
-/// If the information about demanded elements can be used to simplify the
-/// operation, the operation is simplified, then the resultant value is
-/// returned. This returns null if no change was made.
-Value *InstCombiner::SimplifyDemandedVectorElts(Value *V, uint64_t DemandedElts,
- uint64_t &UndefElts,
- unsigned Depth) {
- unsigned VWidth = cast<VectorType>(V->getType())->getNumElements();
- assert(VWidth <= 64 && "Vector too wide to analyze!");
- uint64_t EltMask = ~0ULL >> (64-VWidth);
- assert(DemandedElts != EltMask && (DemandedElts & ~EltMask) == 0 &&
- "Invalid DemandedElts!");
-
- if (isa<UndefValue>(V)) {
- // If the entire vector is undefined, just return this info.
- UndefElts = EltMask;
- return 0;
- } else if (DemandedElts == 0) { // If nothing is demanded, provide undef.
- UndefElts = EltMask;
- return UndefValue::get(V->getType());
- }
-
- UndefElts = 0;
- if (ConstantVector *CP = dyn_cast<ConstantVector>(V)) {
- const Type *EltTy = cast<VectorType>(V->getType())->getElementType();
- Constant *Undef = UndefValue::get(EltTy);
-
- std::vector<Constant*> Elts;
- for (unsigned i = 0; i != VWidth; ++i)
- if (!(DemandedElts & (1ULL << i))) { // If not demanded, set to undef.
- Elts.push_back(Undef);
- UndefElts |= (1ULL << i);
- } else if (isa<UndefValue>(CP->getOperand(i))) { // Already undef.
- Elts.push_back(Undef);
- UndefElts |= (1ULL << i);
- } else { // Otherwise, defined.
- Elts.push_back(CP->getOperand(i));
- }
-
- // If we changed the constant, return it.
- Constant *NewCP = ConstantVector::get(Elts);
- return NewCP != CP ? NewCP : 0;
- } else if (isa<ConstantAggregateZero>(V)) {
- // Simplify the CAZ to a ConstantVector where the non-demanded elements are
- // set to undef.
- const Type *EltTy = cast<VectorType>(V->getType())->getElementType();
- Constant *Zero = Constant::getNullValue(EltTy);
- Constant *Undef = UndefValue::get(EltTy);
- std::vector<Constant*> Elts;
- for (unsigned i = 0; i != VWidth; ++i)
- Elts.push_back((DemandedElts & (1ULL << i)) ? Zero : Undef);
- UndefElts = DemandedElts ^ EltMask;
- return ConstantVector::get(Elts);
- }
-
- if (!V->hasOneUse()) { // Other users may use these bits.
- if (Depth != 0) { // Not at the root.
- // TODO: Just compute the UndefElts information recursively.
- return false;
- }
- return false;
- } else if (Depth == 10) { // Limit search depth.
- return false;
- }
-
- Instruction *I = dyn_cast<Instruction>(V);
- if (!I) return false; // Only analyze instructions.
-
- bool MadeChange = false;
- uint64_t UndefElts2;
- Value *TmpV;
- switch (I->getOpcode()) {
- default: break;
-
- case Instruction::InsertElement: {
- // If this is a variable index, we don't know which element it overwrites.
- // demand exactly the same input as we produce.
- ConstantInt *Idx = dyn_cast<ConstantInt>(I->getOperand(2));
- if (Idx == 0) {
- // Note that we can't propagate undef elt info, because we don't know
- // which elt is getting updated.
- TmpV = SimplifyDemandedVectorElts(I->getOperand(0), DemandedElts,
- UndefElts2, Depth+1);
- if (TmpV) { I->setOperand(0, TmpV); MadeChange = true; }
- break;
- }
-
- // If this is inserting an element that isn't demanded, remove this
- // insertelement.
- unsigned IdxNo = Idx->getZExtValue();
- if (IdxNo >= VWidth || (DemandedElts & (1ULL << IdxNo)) == 0)
- return AddSoonDeadInstToWorklist(*I, 0);
-
- // Otherwise, the element inserted overwrites whatever was there, so the
- // input demanded set is simpler than the output set.
- TmpV = SimplifyDemandedVectorElts(I->getOperand(0),
- DemandedElts & ~(1ULL << IdxNo),
- UndefElts, Depth+1);
- if (TmpV) { I->setOperand(0, TmpV); MadeChange = true; }
-
- // The inserted element is defined.
- UndefElts |= 1ULL << IdxNo;
- break;
- }
- case Instruction::BitCast: {
- // Vector->vector casts only.
- const VectorType *VTy = dyn_cast<VectorType>(I->getOperand(0)->getType());
- if (!VTy) break;
- unsigned InVWidth = VTy->getNumElements();
- uint64_t InputDemandedElts = 0;
- unsigned Ratio;
-
- if (VWidth == InVWidth) {
- // If we are converting from <4 x i32> -> <4 x f32>, we demand the same
- // elements as are demanded of us.
- Ratio = 1;
- InputDemandedElts = DemandedElts;
- } else if (VWidth > InVWidth) {
- // Untested so far.
- break;
-
- // If there are more elements in the result than there are in the source,
- // then an input element is live if any of the corresponding output
- // elements are live.
- Ratio = VWidth/InVWidth;
- for (unsigned OutIdx = 0; OutIdx != VWidth; ++OutIdx) {
- if (DemandedElts & (1ULL << OutIdx))
- InputDemandedElts |= 1ULL << (OutIdx/Ratio);
- }
- } else {
- // Untested so far.
- break;
-
- // If there are more elements in the source than there are in the result,
- // then an input element is live if the corresponding output element is
- // live.
- Ratio = InVWidth/VWidth;
- for (unsigned InIdx = 0; InIdx != InVWidth; ++InIdx)
- if (DemandedElts & (1ULL << InIdx/Ratio))
- InputDemandedElts |= 1ULL << InIdx;
- }
-
- // div/rem demand all inputs, because they don't want divide by zero.
- TmpV = SimplifyDemandedVectorElts(I->getOperand(0), InputDemandedElts,
- UndefElts2, Depth+1);
- if (TmpV) {
- I->setOperand(0, TmpV);
- MadeChange = true;
- }
-
- UndefElts = UndefElts2;
- if (VWidth > InVWidth) {
- assert(0 && "Unimp");
- // If there are more elements in the result than there are in the source,
- // then an output element is undef if the corresponding input element is
- // undef.
- for (unsigned OutIdx = 0; OutIdx != VWidth; ++OutIdx)
- if (UndefElts2 & (1ULL << (OutIdx/Ratio)))
- UndefElts |= 1ULL << OutIdx;
- } else if (VWidth < InVWidth) {
- assert(0 && "Unimp");
- // If there are more elements in the source than there are in the result,
- // then a result element is undef if all of the corresponding input
- // elements are undef.
- UndefElts = ~0ULL >> (64-VWidth); // Start out all undef.
- for (unsigned InIdx = 0; InIdx != InVWidth; ++InIdx)
- if ((UndefElts2 & (1ULL << InIdx)) == 0) // Not undef?
- UndefElts &= ~(1ULL << (InIdx/Ratio)); // Clear undef bit.
- }
- break;
- }
- case Instruction::And:
- case Instruction::Or:
- case Instruction::Xor:
- case Instruction::Add:
- case Instruction::Sub:
- case Instruction::Mul:
- // div/rem demand all inputs, because they don't want divide by zero.
- TmpV = SimplifyDemandedVectorElts(I->getOperand(0), DemandedElts,
- UndefElts, Depth+1);
- if (TmpV) { I->setOperand(0, TmpV); MadeChange = true; }
- TmpV = SimplifyDemandedVectorElts(I->getOperand(1), DemandedElts,
- UndefElts2, Depth+1);
- if (TmpV) { I->setOperand(1, TmpV); MadeChange = true; }
-
- // Output elements are undefined if both are undefined. Consider things
- // like undef&0. The result is known zero, not undef.
- UndefElts &= UndefElts2;
- break;
-
- case Instruction::Call: {
- IntrinsicInst *II = dyn_cast<IntrinsicInst>(I);
- if (!II) break;
- switch (II->getIntrinsicID()) {
- default: break;
-
- // Binary vector operations that work column-wise. A dest element is a
- // function of the corresponding input elements from the two inputs.
- case Intrinsic::x86_sse_sub_ss:
- case Intrinsic::x86_sse_mul_ss:
- case Intrinsic::x86_sse_min_ss:
- case Intrinsic::x86_sse_max_ss:
- case Intrinsic::x86_sse2_sub_sd:
- case Intrinsic::x86_sse2_mul_sd:
- case Intrinsic::x86_sse2_min_sd:
- case Intrinsic::x86_sse2_max_sd:
- TmpV = SimplifyDemandedVectorElts(II->getOperand(1), DemandedElts,
- UndefElts, Depth+1);
- if (TmpV) { II->setOperand(1, TmpV); MadeChange = true; }
- TmpV = SimplifyDemandedVectorElts(II->getOperand(2), DemandedElts,
- UndefElts2, Depth+1);
- if (TmpV) { II->setOperand(2, TmpV); MadeChange = true; }
-
- // If only the low elt is demanded and this is a scalarizable intrinsic,
- // scalarize it now.
- if (DemandedElts == 1) {
- switch (II->getIntrinsicID()) {
- default: break;
- case Intrinsic::x86_sse_sub_ss:
- case Intrinsic::x86_sse_mul_ss:
- case Intrinsic::x86_sse2_sub_sd:
- case Intrinsic::x86_sse2_mul_sd:
- // TODO: Lower MIN/MAX/ABS/etc
- Value *LHS = II->getOperand(1);
- Value *RHS = II->getOperand(2);
- // Extract the element as scalars.
- LHS = InsertNewInstBefore(new ExtractElementInst(LHS, 0U,"tmp"), *II);
- RHS = InsertNewInstBefore(new ExtractElementInst(RHS, 0U,"tmp"), *II);
-
- switch (II->getIntrinsicID()) {
- default: assert(0 && "Case stmts out of sync!");
- case Intrinsic::x86_sse_sub_ss:
- case Intrinsic::x86_sse2_sub_sd:
- TmpV = InsertNewInstBefore(BinaryOperator::createSub(LHS, RHS,
- II->getName()), *II);
- break;
- case Intrinsic::x86_sse_mul_ss:
- case Intrinsic::x86_sse2_mul_sd:
- TmpV = InsertNewInstBefore(BinaryOperator::createMul(LHS, RHS,
- II->getName()), *II);
- break;
- }
-
- Instruction *New =
- InsertElementInst::Create(UndefValue::get(II->getType()), TmpV, 0U,
- II->getName());
- InsertNewInstBefore(New, *II);
- AddSoonDeadInstToWorklist(*II, 0);
- return New;
- }
- }
-
- // Output elements are undefined if both are undefined. Consider things
- // like undef&0. The result is known zero, not undef.
- UndefElts &= UndefElts2;
- break;
- }
- break;
- }
- }
- return MadeChange ? I : 0;
-}
-
-/// @returns true if the specified compare predicate is
-/// true when both operands are equal...
-/// @brief Determine if the icmp Predicate is true when both operands are equal
-static bool isTrueWhenEqual(ICmpInst::Predicate pred) {
- return pred == ICmpInst::ICMP_EQ || pred == ICmpInst::ICMP_UGE ||
- pred == ICmpInst::ICMP_SGE || pred == ICmpInst::ICMP_ULE ||
- pred == ICmpInst::ICMP_SLE;
-}
-
-/// @returns true if the specified compare instruction is
-/// true when both operands are equal...
-/// @brief Determine if the ICmpInst returns true when both operands are equal
-static bool isTrueWhenEqual(ICmpInst &ICI) {
- return isTrueWhenEqual(ICI.getPredicate());
-}
-
-/// AssociativeOpt - Perform an optimization on an associative operator. This
-/// function is designed to check a chain of associative operators for a
-/// potential to apply a certain optimization. Since the optimization may be
-/// applicable if the expression was reassociated, this checks the chain, then
-/// reassociates the expression as necessary to expose the optimization
-/// opportunity. This makes use of a special Functor, which must define
-/// 'shouldApply' and 'apply' methods.
-///
-template<typename Functor>
-Instruction *AssociativeOpt(BinaryOperator &Root, const Functor &F) {
- unsigned Opcode = Root.getOpcode();
- Value *LHS = Root.getOperand(0);
-
- // Quick check, see if the immediate LHS matches...
- if (F.shouldApply(LHS))
- return F.apply(Root);
-
- // Otherwise, if the LHS is not of the same opcode as the root, return.
- Instruction *LHSI = dyn_cast<Instruction>(LHS);
- while (LHSI && LHSI->getOpcode() == Opcode && LHSI->hasOneUse()) {
- // Should we apply this transform to the RHS?
- bool ShouldApply = F.shouldApply(LHSI->getOperand(1));
-
- // If not to the RHS, check to see if we should apply to the LHS...
- if (!ShouldApply && F.shouldApply(LHSI->getOperand(0))) {
- cast<BinaryOperator>(LHSI)->swapOperands(); // Make the LHS the RHS
- ShouldApply = true;
- }
-
- // If the functor wants to apply the optimization to the RHS of LHSI,
- // reassociate the expression from ((? op A) op B) to (? op (A op B))
- if (ShouldApply) {
- BasicBlock *BB = Root.getParent();
-
- // Now all of the instructions are in the current basic block, go ahead
- // and perform the reassociation.
- Instruction *TmpLHSI = cast<Instruction>(Root.getOperand(0));
-
- // First move the selected RHS to the LHS of the root...
- Root.setOperand(0, LHSI->getOperand(1));
-
- // Make what used to be the LHS of the root be the user of the root...
- Value *ExtraOperand = TmpLHSI->getOperand(1);
- if (&Root == TmpLHSI) {
- Root.replaceAllUsesWith(Constant::getNullValue(TmpLHSI->getType()));
- return 0;
- }
- Root.replaceAllUsesWith(TmpLHSI); // Users now use TmpLHSI
- TmpLHSI->setOperand(1, &Root); // TmpLHSI now uses the root
- TmpLHSI->getParent()->getInstList().remove(TmpLHSI);
- BasicBlock::iterator ARI = &Root; ++ARI;
- BB->getInstList().insert(ARI, TmpLHSI); // Move TmpLHSI to after Root
- ARI = Root;
-
- // Now propagate the ExtraOperand down the chain of instructions until we
- // get to LHSI.
- while (TmpLHSI != LHSI) {
- Instruction *NextLHSI = cast<Instruction>(TmpLHSI->getOperand(0));
- // Move the instruction to immediately before the chain we are
- // constructing to avoid breaking dominance properties.
- NextLHSI->getParent()->getInstList().remove(NextLHSI);
- BB->getInstList().insert(ARI, NextLHSI);
- ARI = NextLHSI;
-
- Value *NextOp = NextLHSI->getOperand(1);
- NextLHSI->setOperand(1, ExtraOperand);
- TmpLHSI = NextLHSI;
- ExtraOperand = NextOp;
- }
-
- // Now that the instructions are reassociated, have the functor perform
- // the transformation...
- return F.apply(Root);
- }
-
- LHSI = dyn_cast<Instruction>(LHSI->getOperand(0));
- }
- return 0;
-}
-
-
-// AddRHS - Implements: X + X --> X << 1
-struct AddRHS {
- Value *RHS;
- AddRHS(Value *rhs) : RHS(rhs) {}
- bool shouldApply(Value *LHS) const { return LHS == RHS; }
- Instruction *apply(BinaryOperator &Add) const {
- return BinaryOperator::createShl(Add.getOperand(0),
- ConstantInt::get(Add.getType(), 1));
- }
-};
-
-// AddMaskingAnd - Implements (A & C1)+(B & C2) --> (A & C1)|(B & C2)
-// iff C1&C2 == 0
-struct AddMaskingAnd {
- Constant *C2;
- AddMaskingAnd(Constant *c) : C2(c) {}
- bool shouldApply(Value *LHS) const {
- ConstantInt *C1;
- return match(LHS, m_And(m_Value(), m_ConstantInt(C1))) &&
- ConstantExpr::getAnd(C1, C2)->isNullValue();
- }
- Instruction *apply(BinaryOperator &Add) const {
- return BinaryOperator::createOr(Add.getOperand(0), Add.getOperand(1));
- }
-};
-
-static Value *FoldOperationIntoSelectOperand(Instruction &I, Value *SO,
- InstCombiner *IC) {
- if (CastInst *CI = dyn_cast<CastInst>(&I)) {
- if (Constant *SOC = dyn_cast<Constant>(SO))
- return ConstantExpr::getCast(CI->getOpcode(), SOC, I.getType());
-
- return IC->InsertNewInstBefore(CastInst::create(
- CI->getOpcode(), SO, I.getType(), SO->getName() + ".cast"), I);
- }
-
- // Figure out if the constant is the left or the right argument.
- bool ConstIsRHS = isa<Constant>(I.getOperand(1));
- Constant *ConstOperand = cast<Constant>(I.getOperand(ConstIsRHS));
-
- if (Constant *SOC = dyn_cast<Constant>(SO)) {
- if (ConstIsRHS)
- return ConstantExpr::get(I.getOpcode(), SOC, ConstOperand);
- return ConstantExpr::get(I.getOpcode(), ConstOperand, SOC);
- }
-
- Value *Op0 = SO, *Op1 = ConstOperand;
- if (!ConstIsRHS)
- std::swap(Op0, Op1);
- Instruction *New;
- if (BinaryOperator *BO = dyn_cast<BinaryOperator>(&I))
- New = BinaryOperator::create(BO->getOpcode(), Op0, Op1,SO->getName()+".op");
- else if (CmpInst *CI = dyn_cast<CmpInst>(&I))
- New = CmpInst::create(CI->getOpcode(), CI->getPredicate(), Op0, Op1,
- SO->getName()+".cmp");
- else {
- assert(0 && "Unknown binary instruction type!");
- abort();
- }
- return IC->InsertNewInstBefore(New, I);
-}
-
-// FoldOpIntoSelect - Given an instruction with a select as one operand and a
-// constant as the other operand, try to fold the binary operator into the
-// select arguments. This also works for Cast instructions, which obviously do
-// not have a second operand.
-static Instruction *FoldOpIntoSelect(Instruction &Op, SelectInst *SI,
- InstCombiner *IC) {
- // Don't modify shared select instructions
- if (!SI->hasOneUse()) return 0;
- Value *TV = SI->getOperand(1);
- Value *FV = SI->getOperand(2);
-
- if (isa<Constant>(TV) || isa<Constant>(FV)) {
- // Bool selects with constant operands can be folded to logical ops.
- if (SI->getType() == Type::Int1Ty) return 0;
-
- Value *SelectTrueVal = FoldOperationIntoSelectOperand(Op, TV, IC);
- Value *SelectFalseVal = FoldOperationIntoSelectOperand(Op, FV, IC);
-
- return SelectInst::Create(SI->getCondition(), SelectTrueVal,
- SelectFalseVal);
- }
- return 0;
-}
-
-
-/// FoldOpIntoPhi - Given a binary operator or cast instruction which has a PHI
-/// node as operand #0, see if we can fold the instruction into the PHI (which
-/// is only possible if all operands to the PHI are constants).
-Instruction *InstCombiner::FoldOpIntoPhi(Instruction &I) {
- PHINode *PN = cast<PHINode>(I.getOperand(0));
- unsigned NumPHIValues = PN->getNumIncomingValues();
- if (!PN->hasOneUse() || NumPHIValues == 0) return 0;
-
- // Check to see if all of the operands of the PHI are constants. If there is
- // one non-constant value, remember the BB it is. If there is more than one
- // or if *it* is a PHI, bail out.
- BasicBlock *NonConstBB = 0;
- for (unsigned i = 0; i != NumPHIValues; ++i)
- if (!isa<Constant>(PN->getIncomingValue(i))) {
- if (NonConstBB) return 0; // More than one non-const value.
- if (isa<PHINode>(PN->getIncomingValue(i))) return 0; // Itself a phi.
- NonConstBB = PN->getIncomingBlock(i);
-
- // If the incoming non-constant value is in I's block, we have an infinite
- // loop.
- if (NonConstBB == I.getParent())
- return 0;
- }
-
- // If there is exactly one non-constant value, we can insert a copy of the
- // operation in that block. However, if this is a critical edge, we would be
- // inserting the computation one some other paths (e.g. inside a loop). Only
- // do this if the pred block is unconditionally branching into the phi block.
- if (NonConstBB) {
- BranchInst *BI = dyn_cast<BranchInst>(NonConstBB->getTerminator());
- if (!BI || !BI->isUnconditional()) return 0;
- }
-
- // Okay, we can do the transformation: create the new PHI node.
- PHINode *NewPN = PHINode::Create(I.getType(), "");
- NewPN->reserveOperandSpace(PN->getNumOperands()/2);
- InsertNewInstBefore(NewPN, *PN);
- NewPN->takeName(PN);
-
- // Next, add all of the operands to the PHI.
- if (I.getNumOperands() == 2) {
- Constant *C = cast<Constant>(I.getOperand(1));
- for (unsigned i = 0; i != NumPHIValues; ++i) {
- Value *InV = 0;
- if (Constant *InC = dyn_cast<Constant>(PN->getIncomingValue(i))) {
- if (CmpInst *CI = dyn_cast<CmpInst>(&I))
- InV = ConstantExpr::getCompare(CI->getPredicate(), InC, C);
- else
- InV = ConstantExpr::get(I.getOpcode(), InC, C);
- } else {
- assert(PN->getIncomingBlock(i) == NonConstBB);
- if (BinaryOperator *BO = dyn_cast<BinaryOperator>(&I))
- InV = BinaryOperator::create(BO->getOpcode(),
- PN->getIncomingValue(i), C, "phitmp",
- NonConstBB->getTerminator());
- else if (CmpInst *CI = dyn_cast<CmpInst>(&I))
- InV = CmpInst::create(CI->getOpcode(),
- CI->getPredicate(),
- PN->getIncomingValue(i), C, "phitmp",
- NonConstBB->getTerminator());
- else
- assert(0 && "Unknown binop!");
-
- AddToWorkList(cast<Instruction>(InV));
- }
- NewPN->addIncoming(InV, PN->getIncomingBlock(i));
- }
- } else {
- CastInst *CI = cast<CastInst>(&I);
- const Type *RetTy = CI->getType();
- for (unsigned i = 0; i != NumPHIValues; ++i) {
- Value *InV;
- if (Constant *InC = dyn_cast<Constant>(PN->getIncomingValue(i))) {
- InV = ConstantExpr::getCast(CI->getOpcode(), InC, RetTy);
- } else {
- assert(PN->getIncomingBlock(i) == NonConstBB);
- InV = CastInst::create(CI->getOpcode(), PN->getIncomingValue(i),
- I.getType(), "phitmp",
- NonConstBB->getTerminator());
- AddToWorkList(cast<Instruction>(InV));
- }
- NewPN->addIncoming(InV, PN->getIncomingBlock(i));
- }
- }
- return ReplaceInstUsesWith(I, NewPN);
-}
-
-
-/// CannotBeNegativeZero - Return true if we can prove that the specified FP
-/// value is never equal to -0.0.
-///
-/// Note that this function will need to be revisited when we support nondefault
-/// rounding modes!
-///
-static bool CannotBeNegativeZero(const Value *V) {
- if (const ConstantFP *CFP = dyn_cast<ConstantFP>(V))
- return !CFP->getValueAPF().isNegZero();
-
- // (add x, 0.0) is guaranteed to return +0.0, not -0.0.
- if (const Instruction *I = dyn_cast<Instruction>(V)) {
- if (I->getOpcode() == Instruction::Add &&
- isa<ConstantFP>(I->getOperand(1)) &&
- cast<ConstantFP>(I->getOperand(1))->isNullValue())
- return true;
-
- if (const IntrinsicInst *II = dyn_cast<IntrinsicInst>(I))
- if (II->getIntrinsicID() == Intrinsic::sqrt)
- return CannotBeNegativeZero(II->getOperand(1));
-
- if (const CallInst *CI = dyn_cast<CallInst>(I))
- if (const Function *F = CI->getCalledFunction()) {
- if (F->isDeclaration()) {
- switch (F->getNameLen()) {
- case 3: // abs(x) != -0.0
- if (!strcmp(F->getNameStart(), "abs")) return true;
- break;
- case 4: // abs[lf](x) != -0.0
- if (!strcmp(F->getNameStart(), "absf")) return true;
- if (!strcmp(F->getNameStart(), "absl")) return true;
- break;
- }
- }
- }
- }
-
- return false;
-}
-
-
-Instruction *InstCombiner::visitAdd(BinaryOperator &I) {
- bool Changed = SimplifyCommutative(I);
- Value *LHS = I.getOperand(0), *RHS = I.getOperand(1);
-
- if (Constant *RHSC = dyn_cast<Constant>(RHS)) {
- // X + undef -> undef
- if (isa<UndefValue>(RHS))
- return ReplaceInstUsesWith(I, RHS);
-
- // X + 0 --> X
- if (!I.getType()->isFPOrFPVector()) { // NOTE: -0 + +0 = +0.
- if (RHSC->isNullValue())
- return ReplaceInstUsesWith(I, LHS);
- } else if (ConstantFP *CFP = dyn_cast<ConstantFP>(RHSC)) {
- if (CFP->isExactlyValue(ConstantFP::getNegativeZero
- (I.getType())->getValueAPF()))
- return ReplaceInstUsesWith(I, LHS);
- }
-
- if (ConstantInt *CI = dyn_cast<ConstantInt>(RHSC)) {
- // X + (signbit) --> X ^ signbit
- const APInt& Val = CI->getValue();
- uint32_t BitWidth = Val.getBitWidth();
- if (Val == APInt::getSignBit(BitWidth))
- return BinaryOperator::createXor(LHS, RHS);
-
- // See if SimplifyDemandedBits can simplify this. This handles stuff like
- // (X & 254)+1 -> (X&254)|1
- if (!isa<VectorType>(I.getType())) {
- APInt KnownZero(BitWidth, 0), KnownOne(BitWidth, 0);
- if (SimplifyDemandedBits(&I, APInt::getAllOnesValue(BitWidth),
- KnownZero, KnownOne))
- return &I;
- }
- }
-
- if (isa<PHINode>(LHS))
- if (Instruction *NV = FoldOpIntoPhi(I))
- return NV;
-
- ConstantInt *XorRHS = 0;
- Value *XorLHS = 0;
- if (isa<ConstantInt>(RHSC) &&
- match(LHS, m_Xor(m_Value(XorLHS), m_ConstantInt(XorRHS)))) {
- uint32_t TySizeBits = I.getType()->getPrimitiveSizeInBits();
- const APInt& RHSVal = cast<ConstantInt>(RHSC)->getValue();
-
- uint32_t Size = TySizeBits / 2;
- APInt C0080Val(APInt(TySizeBits, 1ULL).shl(Size - 1));
- APInt CFF80Val(-C0080Val);
- do {
- if (TySizeBits > Size) {
- // If we have ADD(XOR(AND(X, 0xFF), 0x80), 0xF..F80), it's a sext.
- // If we have ADD(XOR(AND(X, 0xFF), 0xF..F80), 0x80), it's a sext.
- if ((RHSVal == CFF80Val && XorRHS->getValue() == C0080Val) ||
- (RHSVal == C0080Val && XorRHS->getValue() == CFF80Val)) {
- // This is a sign extend if the top bits are known zero.
- if (!MaskedValueIsZero(XorLHS,
- APInt::getHighBitsSet(TySizeBits, TySizeBits - Size)))
- Size = 0; // Not a sign ext, but can't be any others either.
- break;
- }
- }
- Size >>= 1;
- C0080Val = APIntOps::lshr(C0080Val, Size);
- CFF80Val = APIntOps::ashr(CFF80Val, Size);
- } while (Size >= 1);
-
- // FIXME: This shouldn't be necessary. When the backends can handle types
- // with funny bit widths then this whole cascade of if statements should
- // be removed. It is just here to get the size of the "middle" type back
- // up to something that the back ends can handle.
- const Type *MiddleType = 0;
- switch (Size) {
- default: break;
- case 32: MiddleType = Type::Int32Ty; break;
- case 16: MiddleType = Type::Int16Ty; break;
- case 8: MiddleType = Type::Int8Ty; break;
- }
- if (MiddleType) {
- Instruction *NewTrunc = new TruncInst(XorLHS, MiddleType, "sext");
- InsertNewInstBefore(NewTrunc, I);
- return new SExtInst(NewTrunc, I.getType(), I.getName());
- }
- }
- }
-
- // X + X --> X << 1
- if (I.getType()->isInteger() && I.getType() != Type::Int1Ty) {
- if (Instruction *Result = AssociativeOpt(I, AddRHS(RHS))) return Result;
-
- if (Instruction *RHSI = dyn_cast<Instruction>(RHS)) {
- if (RHSI->getOpcode() == Instruction::Sub)
- if (LHS == RHSI->getOperand(1)) // A + (B - A) --> B
- return ReplaceInstUsesWith(I, RHSI->getOperand(0));
- }
- if (Instruction *LHSI = dyn_cast<Instruction>(LHS)) {
- if (LHSI->getOpcode() == Instruction::Sub)
- if (RHS == LHSI->getOperand(1)) // (B - A) + A --> B
- return ReplaceInstUsesWith(I, LHSI->getOperand(0));
- }
- }
-
- // -A + B --> B - A
- // -A + -B --> -(A + B)
- if (Value *LHSV = dyn_castNegVal(LHS)) {
- if (LHS->getType()->isIntOrIntVector()) {
- if (Value *RHSV = dyn_castNegVal(RHS)) {
- Instruction *NewAdd = BinaryOperator::createAdd(LHSV, RHSV, "sum");
- InsertNewInstBefore(NewAdd, I);
- return BinaryOperator::createNeg(NewAdd);
- }
- }
-
- return BinaryOperator::createSub(RHS, LHSV);
- }
-
- // A + -B --> A - B
- if (!isa<Constant>(RHS))
- if (Value *V = dyn_castNegVal(RHS))
- return BinaryOperator::createSub(LHS, V);
-
-
- ConstantInt *C2;
- if (Value *X = dyn_castFoldableMul(LHS, C2)) {
- if (X == RHS) // X*C + X --> X * (C+1)
- return BinaryOperator::createMul(RHS, AddOne(C2));
-
- // X*C1 + X*C2 --> X * (C1+C2)
- ConstantInt *C1;
- if (X == dyn_castFoldableMul(RHS, C1))
- return BinaryOperator::createMul(X, Add(C1, C2));
- }
-
- // X + X*C --> X * (C+1)
- if (dyn_castFoldableMul(RHS, C2) == LHS)
- return BinaryOperator::createMul(LHS, AddOne(C2));
-
- // X + ~X --> -1 since ~X = -X-1
- if (dyn_castNotVal(LHS) == RHS || dyn_castNotVal(RHS) == LHS)
- return ReplaceInstUsesWith(I, Constant::getAllOnesValue(I.getType()));
-
-
- // (A & C1)+(B & C2) --> (A & C1)|(B & C2) iff C1&C2 == 0
- if (match(RHS, m_And(m_Value(), m_ConstantInt(C2))))
- if (Instruction *R = AssociativeOpt(I, AddMaskingAnd(C2)))
- return R;
-
- // W*X + Y*Z --> W * (X+Z) iff W == Y
- if (I.getType()->isIntOrIntVector()) {
- Value *W, *X, *Y, *Z;
- if (match(LHS, m_Mul(m_Value(W), m_Value(X))) &&
- match(RHS, m_Mul(m_Value(Y), m_Value(Z)))) {
- if (W != Y) {
- if (W == Z) {
- std::swap(Y, Z);
- } else if (Y == X) {
- std::swap(W, X);
- } else if (X == Z) {
- std::swap(Y, Z);
- std::swap(W, X);
- }
- }
-
- if (W == Y) {
- Value *NewAdd = InsertNewInstBefore(BinaryOperator::createAdd(X, Z,
- LHS->getName()), I);
- return BinaryOperator::createMul(W, NewAdd);
- }
- }
- }
-
- if (ConstantInt *CRHS = dyn_cast<ConstantInt>(RHS)) {
- Value *X = 0;
- if (match(LHS, m_Not(m_Value(X)))) // ~X + C --> (C-1) - X
- return BinaryOperator::createSub(SubOne(CRHS), X);
-
- // (X & FF00) + xx00 -> (X+xx00) & FF00
- if (LHS->hasOneUse() && match(LHS, m_And(m_Value(X), m_ConstantInt(C2)))) {
- Constant *Anded = And(CRHS, C2);
- if (Anded == CRHS) {
- // See if all bits from the first bit set in the Add RHS up are included
- // in the mask. First, get the rightmost bit.
- const APInt& AddRHSV = CRHS->getValue();
-
- // Form a mask of all bits from the lowest bit added through the top.
- APInt AddRHSHighBits(~((AddRHSV & -AddRHSV)-1));
-
- // See if the and mask includes all of these bits.
- APInt AddRHSHighBitsAnd(AddRHSHighBits & C2->getValue());
-
- if (AddRHSHighBits == AddRHSHighBitsAnd) {
- // Okay, the xform is safe. Insert the new add pronto.
- Value *NewAdd = InsertNewInstBefore(BinaryOperator::createAdd(X, CRHS,
- LHS->getName()), I);
- return BinaryOperator::createAnd(NewAdd, C2);
- }
- }
- }
-
- // Try to fold constant add into select arguments.
- if (SelectInst *SI = dyn_cast<SelectInst>(LHS))
- if (Instruction *R = FoldOpIntoSelect(I, SI, this))
- return R;
- }
-
- // add (cast *A to intptrtype) B ->
- // cast (GEP (cast *A to sbyte*) B) --> intptrtype
- {
- CastInst *CI = dyn_cast<CastInst>(LHS);
- Value *Other = RHS;
- if (!CI) {
- CI = dyn_cast<CastInst>(RHS);
- Other = LHS;
- }
- if (CI && CI->getType()->isSized() &&
- (CI->getType()->getPrimitiveSizeInBits() ==
- TD->getIntPtrType()->getPrimitiveSizeInBits())
- && isa<PointerType>(CI->getOperand(0)->getType())) {
- unsigned AS =
- cast<PointerType>(CI->getOperand(0)->getType())->getAddressSpace();
- Value *I2 = InsertBitCastBefore(CI->getOperand(0),
- PointerType::get(Type::Int8Ty, AS), I);
- I2 = InsertNewInstBefore(GetElementPtrInst::Create(I2, Other, "ctg2"), I);
- return new PtrToIntInst(I2, CI->getType());
- }
- }
-
- // add (select X 0 (sub n A)) A --> select X A n
- {
- SelectInst *SI = dyn_cast<SelectInst>(LHS);
- Value *Other = RHS;
- if (!SI) {
- SI = dyn_cast<SelectInst>(RHS);
- Other = LHS;
- }
- if (SI && SI->hasOneUse()) {
- Value *TV = SI->getTrueValue();
- Value *FV = SI->getFalseValue();
- Value *A, *N;
-
- // Can we fold the add into the argument of the select?
- // We check both true and false select arguments for a matching subtract.
- if (match(FV, m_Zero()) && match(TV, m_Sub(m_Value(N), m_Value(A))) &&
- A == Other) // Fold the add into the true select value.
- return SelectInst::Create(SI->getCondition(), N, A);
- if (match(TV, m_Zero()) && match(FV, m_Sub(m_Value(N), m_Value(A))) &&
- A == Other) // Fold the add into the false select value.
- return SelectInst::Create(SI->getCondition(), A, N);
- }
- }
-
- // Check for X+0.0. Simplify it to X if we know X is not -0.0.
- if (ConstantFP *CFP = dyn_cast<ConstantFP>(RHS))
- if (CFP->getValueAPF().isPosZero() && CannotBeNegativeZero(LHS))
- return ReplaceInstUsesWith(I, LHS);
-
- return Changed ? &I : 0;
-}
-
-// isSignBit - Return true if the value represented by the constant only has the
-// highest order bit set.
-static bool isSignBit(ConstantInt *CI) {
- uint32_t NumBits = CI->getType()->getPrimitiveSizeInBits();
- return CI->getValue() == APInt::getSignBit(NumBits);
-}
-
-Instruction *InstCombiner::visitSub(BinaryOperator &I) {
- Value *Op0 = I.getOperand(0), *Op1 = I.getOperand(1);
-
- if (Op0 == Op1) // sub X, X -> 0
- return ReplaceInstUsesWith(I, Constant::getNullValue(I.getType()));
-
- // If this is a 'B = x-(-A)', change to B = x+A...
- if (Value *V = dyn_castNegVal(Op1))
- return BinaryOperator::createAdd(Op0, V);
-
- if (isa<UndefValue>(Op0))
- return ReplaceInstUsesWith(I, Op0); // undef - X -> undef
- if (isa<UndefValue>(Op1))
- return ReplaceInstUsesWith(I, Op1); // X - undef -> undef
-
- if (ConstantInt *C = dyn_cast<ConstantInt>(Op0)) {
- // Replace (-1 - A) with (~A)...
- if (C->isAllOnesValue())
- return BinaryOperator::createNot(Op1);
-
- // C - ~X == X + (1+C)
- Value *X = 0;
- if (match(Op1, m_Not(m_Value(X))))
- return BinaryOperator::createAdd(X, AddOne(C));
-
- // -(X >>u 31) -> (X >>s 31)
- // -(X >>s 31) -> (X >>u 31)
- if (C->isZero()) {
- if (BinaryOperator *SI = dyn_cast<BinaryOperator>(Op1)) {
- if (SI->getOpcode() == Instruction::LShr) {
- if (ConstantInt *CU = dyn_cast<ConstantInt>(SI->getOperand(1))) {
- // Check to see if we are shifting out everything but the sign bit.
- if (CU->getLimitedValue(SI->getType()->getPrimitiveSizeInBits()) ==
- SI->getType()->getPrimitiveSizeInBits()-1) {
- // Ok, the transformation is safe. Insert AShr.
- return BinaryOperator::create(Instruction::AShr,
- SI->getOperand(0), CU, SI->getName());
- }
- }
- }
- else if (SI->getOpcode() == Instruction::AShr) {
- if (ConstantInt *CU = dyn_cast<ConstantInt>(SI->getOperand(1))) {
- // Check to see if we are shifting out everything but the sign bit.
- if (CU->getLimitedValue(SI->getType()->getPrimitiveSizeInBits()) ==
- SI->getType()->getPrimitiveSizeInBits()-1) {
- // Ok, the transformation is safe. Insert LShr.
- return BinaryOperator::createLShr(
- SI->getOperand(0), CU, SI->getName());
- }
- }
- }
- }
- }
-
- // Try to fold constant sub into select arguments.
- if (SelectInst *SI = dyn_cast<SelectInst>(Op1))
- if (Instruction *R = FoldOpIntoSelect(I, SI, this))
- return R;
-
- if (isa<PHINode>(Op0))
- if (Instruction *NV = FoldOpIntoPhi(I))
- return NV;
- }
-
- if (BinaryOperator *Op1I = dyn_cast<BinaryOperator>(Op1)) {
- if (Op1I->getOpcode() == Instruction::Add &&
- !Op0->getType()->isFPOrFPVector()) {
- if (Op1I->getOperand(0) == Op0) // X-(X+Y) == -Y
- return BinaryOperator::createNeg(Op1I->getOperand(1), I.getName());
- else if (Op1I->getOperand(1) == Op0) // X-(Y+X) == -Y
- return BinaryOperator::createNeg(Op1I->getOperand(0), I.getName());
- else if (ConstantInt *CI1 = dyn_cast<ConstantInt>(I.getOperand(0))) {
- if (ConstantInt *CI2 = dyn_cast<ConstantInt>(Op1I->getOperand(1)))
- // C1-(X+C2) --> (C1-C2)-X
- return BinaryOperator::createSub(Subtract(CI1, CI2),
- Op1I->getOperand(0));
- }
- }
-
- if (Op1I->hasOneUse()) {
- // Replace (x - (y - z)) with (x + (z - y)) if the (y - z) subexpression
- // is not used by anyone else...
- //
- if (Op1I->getOpcode() == Instruction::Sub &&
- !Op1I->getType()->isFPOrFPVector()) {
- // Swap the two operands of the subexpr...
- Value *IIOp0 = Op1I->getOperand(0), *IIOp1 = Op1I->getOperand(1);
- Op1I->setOperand(0, IIOp1);
- Op1I->setOperand(1, IIOp0);
-
- // Create the new top level add instruction...
- return BinaryOperator::createAdd(Op0, Op1);
- }
-
- // Replace (A - (A & B)) with (A & ~B) if this is the only use of (A&B)...
- //
- if (Op1I->getOpcode() == Instruction::And &&
- (Op1I->getOperand(0) == Op0 || Op1I->getOperand(1) == Op0)) {
- Value *OtherOp = Op1I->getOperand(Op1I->getOperand(0) == Op0);
-
- Value *NewNot =
- InsertNewInstBefore(BinaryOperator::createNot(OtherOp, "B.not"), I);
- return BinaryOperator::createAnd(Op0, NewNot);
- }
-
- // 0 - (X sdiv C) -> (X sdiv -C)
- if (Op1I->getOpcode() == Instruction::SDiv)
- if (ConstantInt *CSI = dyn_cast<ConstantInt>(Op0))
- if (CSI->isZero())
- if (Constant *DivRHS = dyn_cast<Constant>(Op1I->getOperand(1)))
- return BinaryOperator::createSDiv(Op1I->getOperand(0),
- ConstantExpr::getNeg(DivRHS));
-
- // X - X*C --> X * (1-C)
- ConstantInt *C2 = 0;
- if (dyn_castFoldableMul(Op1I, C2) == Op0) {
- Constant *CP1 = Subtract(ConstantInt::get(I.getType(), 1), C2);
- return BinaryOperator::createMul(Op0, CP1);
- }
-
- // X - ((X / Y) * Y) --> X % Y
- if (Op1I->getOpcode() == Instruction::Mul)
- if (Instruction *I = dyn_cast<Instruction>(Op1I->getOperand(0)))
- if (Op0 == I->getOperand(0) &&
- Op1I->getOperand(1) == I->getOperand(1)) {
- if (I->getOpcode() == Instruction::SDiv)
- return BinaryOperator::createSRem(Op0, Op1I->getOperand(1));
- if (I->getOpcode() == Instruction::UDiv)
- return BinaryOperator::createURem(Op0, Op1I->getOperand(1));
- }
- }
- }
-
- if (!Op0->getType()->isFPOrFPVector())
- if (BinaryOperator *Op0I = dyn_cast<BinaryOperator>(Op0)) {
- if (Op0I->getOpcode() == Instruction::Add) {
- if (Op0I->getOperand(0) == Op1) // (Y+X)-Y == X
- return ReplaceInstUsesWith(I, Op0I->getOperand(1));
- else if (Op0I->getOperand(1) == Op1) // (X+Y)-Y == X
- return ReplaceInstUsesWith(I, Op0I->getOperand(0));
- } else if (Op0I->getOpcode() == Instruction::Sub) {
- if (Op0I->getOperand(0) == Op1) // (X-Y)-X == -Y
- return BinaryOperator::createNeg(Op0I->getOperand(1), I.getName());
- }
- }
-
- ConstantInt *C1;
- if (Value *X = dyn_castFoldableMul(Op0, C1)) {
- if (X == Op1) // X*C - X --> X * (C-1)
- return BinaryOperator::createMul(Op1, SubOne(C1));
-
- ConstantInt *C2; // X*C1 - X*C2 -> X * (C1-C2)
- if (X == dyn_castFoldableMul(Op1, C2))
- return BinaryOperator::createMul(X, Subtract(C1, C2));
- }
- return 0;
-}
-
-/// isSignBitCheck - Given an exploded icmp instruction, return true if the
-/// comparison only checks the sign bit. If it only checks the sign bit, set
-/// TrueIfSigned if the result of the comparison is true when the input value is
-/// signed.
-static bool isSignBitCheck(ICmpInst::Predicate pred, ConstantInt *RHS,
- bool &TrueIfSigned) {
- switch (pred) {
- case ICmpInst::ICMP_SLT: // True if LHS s< 0
- TrueIfSigned = true;
- return RHS->isZero();
- case ICmpInst::ICMP_SLE: // True if LHS s<= RHS and RHS == -1
- TrueIfSigned = true;
- return RHS->isAllOnesValue();
- case ICmpInst::ICMP_SGT: // True if LHS s> -1
- TrueIfSigned = false;
- return RHS->isAllOnesValue();
- case ICmpInst::ICMP_UGT:
- // True if LHS u> RHS and RHS == high-bit-mask - 1
- TrueIfSigned = true;
- return RHS->getValue() ==
- APInt::getSignedMaxValue(RHS->getType()->getPrimitiveSizeInBits());
- case ICmpInst::ICMP_UGE:
- // True if LHS u>= RHS and RHS == high-bit-mask (2^7, 2^15, 2^31, etc)
- TrueIfSigned = true;
- return RHS->getValue() ==
- APInt::getSignBit(RHS->getType()->getPrimitiveSizeInBits());
- default:
- return false;
- }
-}
-
-Instruction *InstCombiner::visitMul(BinaryOperator &I) {
- bool Changed = SimplifyCommutative(I);
- Value *Op0 = I.getOperand(0);
-
- if (isa<UndefValue>(I.getOperand(1))) // undef * X -> 0
- return ReplaceInstUsesWith(I, Constant::getNullValue(I.getType()));
-
- // Simplify mul instructions with a constant RHS...
- if (Constant *Op1 = dyn_cast<Constant>(I.getOperand(1))) {
- if (ConstantInt *CI = dyn_cast<ConstantInt>(Op1)) {
-
- // ((X << C1)*C2) == (X * (C2 << C1))
- if (BinaryOperator *SI = dyn_cast<BinaryOperator>(Op0))
- if (SI->getOpcode() == Instruction::Shl)
- if (Constant *ShOp = dyn_cast<Constant>(SI->getOperand(1)))
- return BinaryOperator::createMul(SI->getOperand(0),
- ConstantExpr::getShl(CI, ShOp));
-
- if (CI->isZero())
- return ReplaceInstUsesWith(I, Op1); // X * 0 == 0
- if (CI->equalsInt(1)) // X * 1 == X
- return ReplaceInstUsesWith(I, Op0);
- if (CI->isAllOnesValue()) // X * -1 == 0 - X
- return BinaryOperator::createNeg(Op0, I.getName());
-
- const APInt& Val = cast<ConstantInt>(CI)->getValue();
- if (Val.isPowerOf2()) { // Replace X*(2^C) with X << C
- return BinaryOperator::createShl(Op0,
- ConstantInt::get(Op0->getType(), Val.logBase2()));
- }
- } else if (ConstantFP *Op1F = dyn_cast<ConstantFP>(Op1)) {
- if (Op1F->isNullValue())
- return ReplaceInstUsesWith(I, Op1);
-
- // "In IEEE floating point, x*1 is not equivalent to x for nans. However,
- // ANSI says we can drop signals, so we can do this anyway." (from GCC)
- // We need a better interface for long double here.
- if (Op1->getType() == Type::FloatTy || Op1->getType() == Type::DoubleTy)
- if (Op1F->isExactlyValue(1.0))
- return ReplaceInstUsesWith(I, Op0); // Eliminate 'mul double %X, 1.0'
- }
-
- if (BinaryOperator *Op0I = dyn_cast<BinaryOperator>(Op0))
- if (Op0I->getOpcode() == Instruction::Add && Op0I->hasOneUse() &&
- isa<ConstantInt>(Op0I->getOperand(1))) {
- // Canonicalize (X+C1)*C2 -> X*C2+C1*C2.
- Instruction *Add = BinaryOperator::createMul(Op0I->getOperand(0),
- Op1, "tmp");
- InsertNewInstBefore(Add, I);
- Value *C1C2 = ConstantExpr::getMul(Op1,
- cast<Constant>(Op0I->getOperand(1)));
- return BinaryOperator::createAdd(Add, C1C2);
-
- }
-
- // Try to fold constant mul into select arguments.
- if (SelectInst *SI = dyn_cast<SelectInst>(Op0))
- if (Instruction *R = FoldOpIntoSelect(I, SI, this))
- return R;
-
- if (isa<PHINode>(Op0))
- if (Instruction *NV = FoldOpIntoPhi(I))
- return NV;
- }
-
- if (Value *Op0v = dyn_castNegVal(Op0)) // -X * -Y = X*Y
- if (Value *Op1v = dyn_castNegVal(I.getOperand(1)))
- return BinaryOperator::createMul(Op0v, Op1v);
-
- // If one of the operands of the multiply is a cast from a boolean value, then
- // we know the bool is either zero or one, so this is a 'masking' multiply.
- // See if we can simplify things based on how the boolean was originally
- // formed.
- CastInst *BoolCast = 0;
- if (ZExtInst *CI = dyn_cast<ZExtInst>(I.getOperand(0)))
- if (CI->getOperand(0)->getType() == Type::Int1Ty)
- BoolCast = CI;
- if (!BoolCast)
- if (ZExtInst *CI = dyn_cast<ZExtInst>(I.getOperand(1)))
- if (CI->getOperand(0)->getType() == Type::Int1Ty)
- BoolCast = CI;
- if (BoolCast) {
- if (ICmpInst *SCI = dyn_cast<ICmpInst>(BoolCast->getOperand(0))) {
- Value *SCIOp0 = SCI->getOperand(0), *SCIOp1 = SCI->getOperand(1);
- const Type *SCOpTy = SCIOp0->getType();
- bool TIS = false;
-
- // If the icmp is true iff the sign bit of X is set, then convert this
- // multiply into a shift/and combination.
- if (isa<ConstantInt>(SCIOp1) &&
- isSignBitCheck(SCI->getPredicate(), cast<ConstantInt>(SCIOp1), TIS) &&
- TIS) {
- // Shift the X value right to turn it into "all signbits".
- Constant *Amt = ConstantInt::get(SCIOp0->getType(),
- SCOpTy->getPrimitiveSizeInBits()-1);
- Value *V =
- InsertNewInstBefore(
- BinaryOperator::create(Instruction::AShr, SCIOp0, Amt,
- BoolCast->getOperand(0)->getName()+
- ".mask"), I);
-
- // If the multiply type is not the same as the source type, sign extend
- // or truncate to the multiply type.
- if (I.getType() != V->getType()) {
- uint32_t SrcBits = V->getType()->getPrimitiveSizeInBits();
- uint32_t DstBits = I.getType()->getPrimitiveSizeInBits();
- Instruction::CastOps opcode =
- (SrcBits == DstBits ? Instruction::BitCast :
- (SrcBits < DstBits ? Instruction::SExt : Instruction::Trunc));
- V = InsertCastBefore(opcode, V, I.getType(), I);
- }
-
- Value *OtherOp = Op0 == BoolCast ? I.getOperand(1) : Op0;
- return BinaryOperator::createAnd(V, OtherOp);
- }
- }
- }
-
- return Changed ? &I : 0;
-}
-
-/// This function implements the transforms on div instructions that work
-/// regardless of the kind of div instruction it is (udiv, sdiv, or fdiv). It is
-/// used by the visitors to those instructions.
-/// @brief Transforms common to all three div instructions
-Instruction *InstCombiner::commonDivTransforms(BinaryOperator &I) {
- Value *Op0 = I.getOperand(0), *Op1 = I.getOperand(1);
-
- // undef / X -> 0 for integer.
- // undef / X -> undef for FP (the undef could be a snan).
- if (isa<UndefValue>(Op0)) {
- if (Op0->getType()->isFPOrFPVector())
- return ReplaceInstUsesWith(I, Op0);
- return ReplaceInstUsesWith(I, Constant::getNullValue(I.getType()));
- }
-
- // X / undef -> undef
- if (isa<UndefValue>(Op1))
- return ReplaceInstUsesWith(I, Op1);
-
- // Handle cases involving: [su]div X, (select Cond, Y, Z)
- // This does not apply for fdiv.
- if (SelectInst *SI = dyn_cast<SelectInst>(Op1)) {
- // [su]div X, (Cond ? 0 : Y) -> div X, Y. If the div and the select are in
- // the same basic block, then we replace the select with Y, and the
- // condition of the select with false (if the cond value is in the same BB).
- // If the select has uses other than the div, this allows them to be
- // simplified also. Note that div X, Y is just as good as div X, 0 (undef)
- if (ConstantInt *ST = dyn_cast<ConstantInt>(SI->getOperand(1)))
- if (ST->isNullValue()) {
- Instruction *CondI = dyn_cast<Instruction>(SI->getOperand(0));
- if (CondI && CondI->getParent() == I.getParent())
- UpdateValueUsesWith(CondI, ConstantInt::getFalse());
- else if (I.getParent() != SI->getParent() || SI->hasOneUse())
- I.setOperand(1, SI->getOperand(2));
- else
- UpdateValueUsesWith(SI, SI->getOperand(2));
- return &I;
- }
-
- // Likewise for: [su]div X, (Cond ? Y : 0) -> div X, Y
- if (ConstantInt *ST = dyn_cast<ConstantInt>(SI->getOperand(2)))
- if (ST->isNullValue()) {
- Instruction *CondI = dyn_cast<Instruction>(SI->getOperand(0));
- if (CondI && CondI->getParent() == I.getParent())
- UpdateValueUsesWith(CondI, ConstantInt::getTrue());
- else if (I.getParent() != SI->getParent() || SI->hasOneUse())
- I.setOperand(1, SI->getOperand(1));
- else
- UpdateValueUsesWith(SI, SI->getOperand(1));
- return &I;
- }
- }
-
- return 0;
-}
-
-/// This function implements the transforms common to both integer division
-/// instructions (udiv and sdiv). It is called by the visitors to those integer
-/// division instructions.
-/// @brief Common integer divide transforms
-Instruction *InstCombiner::commonIDivTransforms(BinaryOperator &I) {
- Value *Op0 = I.getOperand(0), *Op1 = I.getOperand(1);
-
- if (Instruction *Common = commonDivTransforms(I))
- return Common;
-
- if (ConstantInt *RHS = dyn_cast<ConstantInt>(Op1)) {
- // div X, 1 == X
- if (RHS->equalsInt(1))
- return ReplaceInstUsesWith(I, Op0);
-
- // (X / C1) / C2 -> X / (C1*C2)
- if (Instruction *LHS = dyn_cast<Instruction>(Op0))
- if (Instruction::BinaryOps(LHS->getOpcode()) == I.getOpcode())
- if (ConstantInt *LHSRHS = dyn_cast<ConstantInt>(LHS->getOperand(1))) {
- if (MultiplyOverflows(RHS, LHSRHS, I.getOpcode()==Instruction::SDiv))
- return ReplaceInstUsesWith(I, Constant::getNullValue(I.getType()));
- else
- return BinaryOperator::create(I.getOpcode(), LHS->getOperand(0),
- Multiply(RHS, LHSRHS));
- }
-
- if (!RHS->isZero()) { // avoid X udiv 0
- if (SelectInst *SI = dyn_cast<SelectInst>(Op0))
- if (Instruction *R = FoldOpIntoSelect(I, SI, this))
- return R;
- if (isa<PHINode>(Op0))
- if (Instruction *NV = FoldOpIntoPhi(I))
- return NV;
- }
- }
-
- // 0 / X == 0, we don't need to preserve faults!
- if (ConstantInt *LHS = dyn_cast<ConstantInt>(Op0))
- if (LHS->equalsInt(0))
- return ReplaceInstUsesWith(I, Constant::getNullValue(I.getType()));
-
- return 0;
-}
-
-Instruction *InstCombiner::visitUDiv(BinaryOperator &I) {
- Value *Op0 = I.getOperand(0), *Op1 = I.getOperand(1);
-
- // Handle the integer div common cases
- if (Instruction *Common = commonIDivTransforms(I))
- return Common;
-
- // X udiv C^2 -> X >> C
- // Check to see if this is an unsigned division with an exact power of 2,
- // if so, convert to a right shift.
- if (ConstantInt *C = dyn_cast<ConstantInt>(Op1)) {
- if (C->getValue().isPowerOf2()) // 0 not included in isPowerOf2
- return BinaryOperator::createLShr(Op0,
- ConstantInt::get(Op0->getType(), C->getValue().logBase2()));
- }
-
- // X udiv (C1 << N), where C1 is "1<<C2" --> X >> (N+C2)
- if (BinaryOperator *RHSI = dyn_cast<BinaryOperator>(I.getOperand(1))) {
- if (RHSI->getOpcode() == Instruction::Shl &&
- isa<ConstantInt>(RHSI->getOperand(0))) {
- const APInt& C1 = cast<ConstantInt>(RHSI->getOperand(0))->getValue();
- if (C1.isPowerOf2()) {
- Value *N = RHSI->getOperand(1);
- const Type *NTy = N->getType();
- if (uint32_t C2 = C1.logBase2()) {
- Constant *C2V = ConstantInt::get(NTy, C2);
- N = InsertNewInstBefore(BinaryOperator::createAdd(N, C2V, "tmp"), I);
- }
- return BinaryOperator::createLShr(Op0, N);
- }
- }
- }
-
- // udiv X, (Select Cond, C1, C2) --> Select Cond, (shr X, C1), (shr X, C2)
- // where C1&C2 are powers of two.
- if (SelectInst *SI = dyn_cast<SelectInst>(Op1))
- if (ConstantInt *STO = dyn_cast<ConstantInt>(SI->getOperand(1)))
- if (ConstantInt *SFO = dyn_cast<ConstantInt>(SI->getOperand(2))) {
- const APInt &TVA = STO->getValue(), &FVA = SFO->getValue();
- if (TVA.isPowerOf2() && FVA.isPowerOf2()) {
- // Compute the shift amounts
- uint32_t TSA = TVA.logBase2(), FSA = FVA.logBase2();
- // Construct the "on true" case of the select
- Constant *TC = ConstantInt::get(Op0->getType(), TSA);
- Instruction *TSI = BinaryOperator::createLShr(
- Op0, TC, SI->getName()+".t");
- TSI = InsertNewInstBefore(TSI, I);
-
- // Construct the "on false" case of the select
- Constant *FC = ConstantInt::get(Op0->getType(), FSA);
- Instruction *FSI = BinaryOperator::createLShr(
- Op0, FC, SI->getName()+".f");
- FSI = InsertNewInstBefore(FSI, I);
-
- // construct the select instruction and return it.
- return SelectInst::Create(SI->getOperand(0), TSI, FSI, SI->getName());
- }
- }
- return 0;
-}
-
-Instruction *InstCombiner::visitSDiv(BinaryOperator &I) {
- Value *Op0 = I.getOperand(0), *Op1 = I.getOperand(1);
-
- // Handle the integer div common cases
- if (Instruction *Common = commonIDivTransforms(I))
- return Common;
-
- if (ConstantInt *RHS = dyn_cast<ConstantInt>(Op1)) {
- // sdiv X, -1 == -X
- if (RHS->isAllOnesValue())
- return BinaryOperator::createNeg(Op0);
-
- // -X/C -> X/-C
- if (Value *LHSNeg = dyn_castNegVal(Op0))
- return BinaryOperator::createSDiv(LHSNeg, ConstantExpr::getNeg(RHS));
- }
-
- // If the sign bits of both operands are zero (i.e. we can prove they are
- // unsigned inputs), turn this into a udiv.
- if (I.getType()->isInteger()) {
- APInt Mask(APInt::getSignBit(I.getType()->getPrimitiveSizeInBits()));
- if (MaskedValueIsZero(Op1, Mask) && MaskedValueIsZero(Op0, Mask)) {
- // X sdiv Y -> X udiv Y, iff X and Y don't have sign bit set
- return BinaryOperator::createUDiv(Op0, Op1, I.getName());
- }
- }
-
- return 0;
-}
-
-Instruction *InstCombiner::visitFDiv(BinaryOperator &I) {
- return commonDivTransforms(I);
-}
-
-/// This function implements the transforms on rem instructions that work
-/// regardless of the kind of rem instruction it is (urem, srem, or frem). It
-/// is used by the visitors to those instructions.
-/// @brief Transforms common to all three rem instructions
-Instruction *InstCombiner::commonRemTransforms(BinaryOperator &I) {
- Value *Op0 = I.getOperand(0), *Op1 = I.getOperand(1);
-
- // 0 % X == 0 for integer, we don't need to preserve faults!
- if (Constant *LHS = dyn_cast<Constant>(Op0))
- if (LHS->isNullValue())
- return ReplaceInstUsesWith(I, Constant::getNullValue(I.getType()));
-
- if (isa<UndefValue>(Op0)) { // undef % X -> 0
- if (I.getType()->isFPOrFPVector())
- return ReplaceInstUsesWith(I, Op0); // X % undef -> undef (could be SNaN)
- return ReplaceInstUsesWith(I, Constant::getNullValue(I.getType()));
- }
- if (isa<UndefValue>(Op1))
- return ReplaceInstUsesWith(I, Op1); // X % undef -> undef
-
- // Handle cases involving: rem X, (select Cond, Y, Z)
- if (SelectInst *SI = dyn_cast<SelectInst>(Op1)) {
- // rem X, (Cond ? 0 : Y) -> rem X, Y. If the rem and the select are in
- // the same basic block, then we replace the select with Y, and the
- // condition of the select with false (if the cond value is in the same
- // BB). If the select has uses other than the div, this allows them to be
- // simplified also.
- if (Constant *ST = dyn_cast<Constant>(SI->getOperand(1)))
- if (ST->isNullValue()) {
- Instruction *CondI = dyn_cast<Instruction>(SI->getOperand(0));
- if (CondI && CondI->getParent() == I.getParent())
- UpdateValueUsesWith(CondI, ConstantInt::getFalse());
- else if (I.getParent() != SI->getParent() || SI->hasOneUse())
- I.setOperand(1, SI->getOperand(2));
- else
- UpdateValueUsesWith(SI, SI->getOperand(2));
- return &I;
- }
- // Likewise for: rem X, (Cond ? Y : 0) -> rem X, Y
- if (Constant *ST = dyn_cast<Constant>(SI->getOperand(2)))
- if (ST->isNullValue()) {
- Instruction *CondI = dyn_cast<Instruction>(SI->getOperand(0));
- if (CondI && CondI->getParent() == I.getParent())
- UpdateValueUsesWith(CondI, ConstantInt::getTrue());
- else if (I.getParent() != SI->getParent() || SI->hasOneUse())
- I.setOperand(1, SI->getOperand(1));
- else
- UpdateValueUsesWith(SI, SI->getOperand(1));
- return &I;
- }
- }
-
- return 0;
-}
-
-/// This function implements the transforms common to both integer remainder
-/// instructions (urem and srem). It is called by the visitors to those integer
-/// remainder instructions.
-/// @brief Common integer remainder transforms
-Instruction *InstCombiner::commonIRemTransforms(BinaryOperator &I) {
- Value *Op0 = I.getOperand(0), *Op1 = I.getOperand(1);
-
- if (Instruction *common = commonRemTransforms(I))
- return common;
-
- if (ConstantInt *RHS = dyn_cast<ConstantInt>(Op1)) {
- // X % 0 == undef, we don't need to preserve faults!
- if (RHS->equalsInt(0))
- return ReplaceInstUsesWith(I, UndefValue::get(I.getType()));
-
- if (RHS->equalsInt(1)) // X % 1 == 0
- return ReplaceInstUsesWith(I, Constant::getNullValue(I.getType()));
-
- if (Instruction *Op0I = dyn_cast<Instruction>(Op0)) {
- if (SelectInst *SI = dyn_cast<SelectInst>(Op0I)) {
- if (Instruction *R = FoldOpIntoSelect(I, SI, this))
- return R;
- } else if (isa<PHINode>(Op0I)) {
- if (Instruction *NV = FoldOpIntoPhi(I))
- return NV;
- }
-
- // See if we can fold away this rem instruction.
- uint32_t BitWidth = cast<IntegerType>(I.getType())->getBitWidth();
- APInt KnownZero(BitWidth, 0), KnownOne(BitWidth, 0);
- if (SimplifyDemandedBits(&I, APInt::getAllOnesValue(BitWidth),
- KnownZero, KnownOne))
- return &I;
- }
- }
-
- return 0;
-}
-
-Instruction *InstCombiner::visitURem(BinaryOperator &I) {
- Value *Op0 = I.getOperand(0), *Op1 = I.getOperand(1);
-
- if (Instruction *common = commonIRemTransforms(I))
- return common;
-
- if (ConstantInt *RHS = dyn_cast<ConstantInt>(Op1)) {
- // X urem C^2 -> X and C
- // Check to see if this is an unsigned remainder with an exact power of 2,
- // if so, convert to a bitwise and.
- if (ConstantInt *C = dyn_cast<ConstantInt>(RHS))
- if (C->getValue().isPowerOf2())
- return BinaryOperator::createAnd(Op0, SubOne(C));
- }
-
- if (Instruction *RHSI = dyn_cast<Instruction>(I.getOperand(1))) {
- // Turn A % (C << N), where C is 2^k, into A & ((C << N)-1)
- if (RHSI->getOpcode() == Instruction::Shl &&
- isa<ConstantInt>(RHSI->getOperand(0))) {
- if (cast<ConstantInt>(RHSI->getOperand(0))->getValue().isPowerOf2()) {
- Constant *N1 = ConstantInt::getAllOnesValue(I.getType());
- Value *Add = InsertNewInstBefore(BinaryOperator::createAdd(RHSI, N1,
- "tmp"), I);
- return BinaryOperator::createAnd(Op0, Add);
- }
- }
- }
-
- // urem X, (select Cond, 2^C1, 2^C2) --> select Cond, (and X, C1), (and X, C2)
- // where C1&C2 are powers of two.
- if (SelectInst *SI = dyn_cast<SelectInst>(Op1)) {
- if (ConstantInt *STO = dyn_cast<ConstantInt>(SI->getOperand(1)))
- if (ConstantInt *SFO = dyn_cast<ConstantInt>(SI->getOperand(2))) {
- // STO == 0 and SFO == 0 handled above.
- if ((STO->getValue().isPowerOf2()) &&
- (SFO->getValue().isPowerOf2())) {
- Value *TrueAnd = InsertNewInstBefore(
- BinaryOperator::createAnd(Op0, SubOne(STO), SI->getName()+".t"), I);
- Value *FalseAnd = InsertNewInstBefore(
- BinaryOperator::createAnd(Op0, SubOne(SFO), SI->getName()+".f"), I);
- return SelectInst::Create(SI->getOperand(0), TrueAnd, FalseAnd);
- }
- }
- }
-
- return 0;
-}
-
-Instruction *InstCombiner::visitSRem(BinaryOperator &I) {
- Value *Op0 = I.getOperand(0), *Op1 = I.getOperand(1);
-
- // Handle the integer rem common cases
- if (Instruction *common = commonIRemTransforms(I))
- return common;
-
- if (Value *RHSNeg = dyn_castNegVal(Op1))
- if (!isa<ConstantInt>(RHSNeg) ||
- cast<ConstantInt>(RHSNeg)->getValue().isStrictlyPositive()) {
- // X % -Y -> X % Y
- AddUsesToWorkList(I);
- I.setOperand(1, RHSNeg);
- return &I;
- }
-
- // If the sign bits of both operands are zero (i.e. we can prove they are
- // unsigned inputs), turn this into a urem.
- if (I.getType()->isInteger()) {
- APInt Mask(APInt::getSignBit(I.getType()->getPrimitiveSizeInBits()));
- if (MaskedValueIsZero(Op1, Mask) && MaskedValueIsZero(Op0, Mask)) {
- // X srem Y -> X urem Y, iff X and Y don't have sign bit set
- return BinaryOperator::createURem(Op0, Op1, I.getName());
- }
- }
-
- return 0;
-}
-
-Instruction *InstCombiner::visitFRem(BinaryOperator &I) {
- return commonRemTransforms(I);
-}
-
-// isMaxValueMinusOne - return true if this is Max-1
-static bool isMaxValueMinusOne(const ConstantInt *C, bool isSigned) {
- uint32_t TypeBits = C->getType()->getPrimitiveSizeInBits();
- if (!isSigned)
- return C->getValue() == APInt::getAllOnesValue(TypeBits) - 1;
- return C->getValue() == APInt::getSignedMaxValue(TypeBits)-1;
-}
-
-// isMinValuePlusOne - return true if this is Min+1
-static bool isMinValuePlusOne(const ConstantInt *C, bool isSigned) {
- if (!isSigned)
- return C->getValue() == 1; // unsigned
-
- // Calculate 1111111111000000000000
- uint32_t TypeBits = C->getType()->getPrimitiveSizeInBits();
- return C->getValue() == APInt::getSignedMinValue(TypeBits)+1;
-}
-
-// isOneBitSet - Return true if there is exactly one bit set in the specified
-// constant.
-static bool isOneBitSet(const ConstantInt *CI) {
- return CI->getValue().isPowerOf2();
-}
-
-// isHighOnes - Return true if the constant is of the form 1+0+.
-// This is the same as lowones(~X).
-static bool isHighOnes(const ConstantInt *CI) {
- return (~CI->getValue() + 1).isPowerOf2();
-}
-
-/// getICmpCode - Encode a icmp predicate into a three bit mask. These bits
-/// are carefully arranged to allow folding of expressions such as:
-///
-/// (A < B) | (A > B) --> (A != B)
-///
-/// Note that this is only valid if the first and second predicates have the
-/// same sign. Is illegal to do: (A u< B) | (A s> B)
-///
-/// Three bits are used to represent the condition, as follows:
-/// 0 A > B
-/// 1 A == B
-/// 2 A < B
-///
-/// <=> Value Definition
-/// 000 0 Always false
-/// 001 1 A > B
-/// 010 2 A == B
-/// 011 3 A >= B
-/// 100 4 A < B
-/// 101 5 A != B
-/// 110 6 A <= B
-/// 111 7 Always true
-///
-static unsigned getICmpCode(const ICmpInst *ICI) {
- switch (ICI->getPredicate()) {
- // False -> 0
- case ICmpInst::ICMP_UGT: return 1; // 001
- case ICmpInst::ICMP_SGT: return 1; // 001
- case ICmpInst::ICMP_EQ: return 2; // 010
- case ICmpInst::ICMP_UGE: return 3; // 011
- case ICmpInst::ICMP_SGE: return 3; // 011
- case ICmpInst::ICMP_ULT: return 4; // 100
- case ICmpInst::ICMP_SLT: return 4; // 100
- case ICmpInst::ICMP_NE: return 5; // 101
- case ICmpInst::ICMP_ULE: return 6; // 110
- case ICmpInst::ICMP_SLE: return 6; // 110
- // True -> 7
- default:
- assert(0 && "Invalid ICmp predicate!");
- return 0;
- }
-}
-
-/// getICmpValue - This is the complement of getICmpCode, which turns an
-/// opcode and two operands into either a constant true or false, or a brand
-/// new ICmp instruction. The sign is passed in to determine which kind
-/// of predicate to use in new icmp instructions.
-static Value *getICmpValue(bool sign, unsigned code, Value *LHS, Value *RHS) {
- switch (code) {
- default: assert(0 && "Illegal ICmp code!");
- case 0: return ConstantInt::getFalse();
- case 1:
- if (sign)
- return new ICmpInst(ICmpInst::ICMP_SGT, LHS, RHS);
- else
- return new ICmpInst(ICmpInst::ICMP_UGT, LHS, RHS);
- case 2: return new ICmpInst(ICmpInst::ICMP_EQ, LHS, RHS);
- case 3:
- if (sign)
- return new ICmpInst(ICmpInst::ICMP_SGE, LHS, RHS);
- else
- return new ICmpInst(ICmpInst::ICMP_UGE, LHS, RHS);
- case 4:
- if (sign)
- return new ICmpInst(ICmpInst::ICMP_SLT, LHS, RHS);
- else
- return new ICmpInst(ICmpInst::ICMP_ULT, LHS, RHS);
- case 5: return new ICmpInst(ICmpInst::ICMP_NE, LHS, RHS);
- case 6:
- if (sign)
- return new ICmpInst(ICmpInst::ICMP_SLE, LHS, RHS);
- else
- return new ICmpInst(ICmpInst::ICMP_ULE, LHS, RHS);
- case 7: return ConstantInt::getTrue();
- }
-}
-
-static bool PredicatesFoldable(ICmpInst::Predicate p1, ICmpInst::Predicate p2) {
- return (ICmpInst::isSignedPredicate(p1) == ICmpInst::isSignedPredicate(p2)) ||
- (ICmpInst::isSignedPredicate(p1) &&
- (p2 == ICmpInst::ICMP_EQ || p2 == ICmpInst::ICMP_NE)) ||
- (ICmpInst::isSignedPredicate(p2) &&
- (p1 == ICmpInst::ICMP_EQ || p1 == ICmpInst::ICMP_NE));
-}
-
-namespace {
-// FoldICmpLogical - Implements (icmp1 A, B) & (icmp2 A, B) --> (icmp3 A, B)
-struct FoldICmpLogical {
- InstCombiner &IC;
- Value *LHS, *RHS;
- ICmpInst::Predicate pred;
- FoldICmpLogical(InstCombiner &ic, ICmpInst *ICI)
- : IC(ic), LHS(ICI->getOperand(0)), RHS(ICI->getOperand(1)),
- pred(ICI->getPredicate()) {}
- bool shouldApply(Value *V) const {
- if (ICmpInst *ICI = dyn_cast<ICmpInst>(V))
- if (PredicatesFoldable(pred, ICI->getPredicate()))
- return ((ICI->getOperand(0) == LHS && ICI->getOperand(1) == RHS) ||
- (ICI->getOperand(0) == RHS && ICI->getOperand(1) == LHS));
- return false;
- }
- Instruction *apply(Instruction &Log) const {
- ICmpInst *ICI = cast<ICmpInst>(Log.getOperand(0));
- if (ICI->getOperand(0) != LHS) {
- assert(ICI->getOperand(1) == LHS);
- ICI->swapOperands(); // Swap the LHS and RHS of the ICmp
- }
-
- ICmpInst *RHSICI = cast<ICmpInst>(Log.getOperand(1));
- unsigned LHSCode = getICmpCode(ICI);
- unsigned RHSCode = getICmpCode(RHSICI);
- unsigned Code;
- switch (Log.getOpcode()) {
- case Instruction::And: Code = LHSCode & RHSCode; break;
- case Instruction::Or: Code = LHSCode | RHSCode; break;
- case Instruction::Xor: Code = LHSCode ^ RHSCode; break;
- default: assert(0 && "Illegal logical opcode!"); return 0;
- }
-
- bool isSigned = ICmpInst::isSignedPredicate(RHSICI->getPredicate()) ||
- ICmpInst::isSignedPredicate(ICI->getPredicate());
-
- Value *RV = getICmpValue(isSigned, Code, LHS, RHS);
- if (Instruction *I = dyn_cast<Instruction>(RV))
- return I;
- // Otherwise, it's a constant boolean value...
- return IC.ReplaceInstUsesWith(Log, RV);
- }
-};
-} // end anonymous namespace
-
-// OptAndOp - This handles expressions of the form ((val OP C1) & C2). Where
-// the Op parameter is 'OP', OpRHS is 'C1', and AndRHS is 'C2'. Op is
-// guaranteed to be a binary operator.
-Instruction *InstCombiner::OptAndOp(Instruction *Op,
- ConstantInt *OpRHS,
- ConstantInt *AndRHS,
- BinaryOperator &TheAnd) {
- Value *X = Op->getOperand(0);
- Constant *Together = 0;
- if (!Op->isShift())
- Together = And(AndRHS, OpRHS);
-
- switch (Op->getOpcode()) {
- case Instruction::Xor:
- if (Op->hasOneUse()) {
- // (X ^ C1) & C2 --> (X & C2) ^ (C1&C2)
- Instruction *And = BinaryOperator::createAnd(X, AndRHS);
- InsertNewInstBefore(And, TheAnd);
- And->takeName(Op);
- return BinaryOperator::createXor(And, Together);
- }
- break;
- case Instruction::Or:
- if (Together == AndRHS) // (X | C) & C --> C
- return ReplaceInstUsesWith(TheAnd, AndRHS);
-
- if (Op->hasOneUse() && Together != OpRHS) {
- // (X | C1) & C2 --> (X | (C1&C2)) & C2
- Instruction *Or = BinaryOperator::createOr(X, Together);
- InsertNewInstBefore(Or, TheAnd);
- Or->takeName(Op);
- return BinaryOperator::createAnd(Or, AndRHS);
- }
- break;
- case Instruction::Add:
- if (Op->hasOneUse()) {
- // Adding a one to a single bit bit-field should be turned into an XOR
- // of the bit. First thing to check is to see if this AND is with a
- // single bit constant.
- const APInt& AndRHSV = cast<ConstantInt>(AndRHS)->getValue();
-
- // If there is only one bit set...
- if (isOneBitSet(cast<ConstantInt>(AndRHS))) {
- // Ok, at this point, we know that we are masking the result of the
- // ADD down to exactly one bit. If the constant we are adding has
- // no bits set below this bit, then we can eliminate the ADD.
- const APInt& AddRHS = cast<ConstantInt>(OpRHS)->getValue();
-
- // Check to see if any bits below the one bit set in AndRHSV are set.
- if ((AddRHS & (AndRHSV-1)) == 0) {
- // If not, the only thing that can effect the output of the AND is
- // the bit specified by AndRHSV. If that bit is set, the effect of
- // the XOR is to toggle the bit. If it is clear, then the ADD has
- // no effect.
- if ((AddRHS & AndRHSV) == 0) { // Bit is not set, noop
- TheAnd.setOperand(0, X);
- return &TheAnd;
- } else {
- // Pull the XOR out of the AND.
- Instruction *NewAnd = BinaryOperator::createAnd(X, AndRHS);
- InsertNewInstBefore(NewAnd, TheAnd);
- NewAnd->takeName(Op);
- return BinaryOperator::createXor(NewAnd, AndRHS);
- }
- }
- }
- }
- break;
-
- case Instruction::Shl: {
- // We know that the AND will not produce any of the bits shifted in, so if
- // the anded constant includes them, clear them now!
- //
- uint32_t BitWidth = AndRHS->getType()->getBitWidth();
- uint32_t OpRHSVal = OpRHS->getLimitedValue(BitWidth);
- APInt ShlMask(APInt::getHighBitsSet(BitWidth, BitWidth-OpRHSVal));
- ConstantInt *CI = ConstantInt::get(AndRHS->getValue() & ShlMask);
-
- if (CI->getValue() == ShlMask) {
- // Masking out bits that the shift already masks
- return ReplaceInstUsesWith(TheAnd, Op); // No need for the and.
- } else if (CI != AndRHS) { // Reducing bits set in and.
- TheAnd.setOperand(1, CI);
- return &TheAnd;
- }
- break;
- }
- case Instruction::LShr:
- {
- // We know that the AND will not produce any of the bits shifted in, so if
- // the anded constant includes them, clear them now! This only applies to
- // unsigned shifts, because a signed shr may bring in set bits!
- //
- uint32_t BitWidth = AndRHS->getType()->getBitWidth();
- uint32_t OpRHSVal = OpRHS->getLimitedValue(BitWidth);
- APInt ShrMask(APInt::getLowBitsSet(BitWidth, BitWidth - OpRHSVal));
- ConstantInt *CI = ConstantInt::get(AndRHS->getValue() & ShrMask);
-
- if (CI->getValue() == ShrMask) {
- // Masking out bits that the shift already masks.
- return ReplaceInstUsesWith(TheAnd, Op);
- } else if (CI != AndRHS) {
- TheAnd.setOperand(1, CI); // Reduce bits set in and cst.
- return &TheAnd;
- }
- break;
- }
- case Instruction::AShr:
- // Signed shr.
- // See if this is shifting in some sign extension, then masking it out
- // with an and.
- if (Op->hasOneUse()) {
- uint32_t BitWidth = AndRHS->getType()->getBitWidth();
- uint32_t OpRHSVal = OpRHS->getLimitedValue(BitWidth);
- APInt ShrMask(APInt::getLowBitsSet(BitWidth, BitWidth - OpRHSVal));
- Constant *C = ConstantInt::get(AndRHS->getValue() & ShrMask);
- if (C == AndRHS) { // Masking out bits shifted in.
- // (Val ashr C1) & C2 -> (Val lshr C1) & C2
- // Make the argument unsigned.
- Value *ShVal = Op->getOperand(0);
- ShVal = InsertNewInstBefore(
- BinaryOperator::createLShr(ShVal, OpRHS,
- Op->getName()), TheAnd);
- return BinaryOperator::createAnd(ShVal, AndRHS, TheAnd.getName());
- }
- }
- break;
- }
- return 0;
-}
-
-
-/// InsertRangeTest - Emit a computation of: (V >= Lo && V < Hi) if Inside is
-/// true, otherwise (V < Lo || V >= Hi). In pratice, we emit the more efficient
-/// (V-Lo) <u Hi-Lo. This method expects that Lo <= Hi. isSigned indicates
-/// whether to treat the V, Lo and HI as signed or not. IB is the location to
-/// insert new instructions.
-Instruction *InstCombiner::InsertRangeTest(Value *V, Constant *Lo, Constant *Hi,
- bool isSigned, bool Inside,
- Instruction &IB) {
- assert(cast<ConstantInt>(ConstantExpr::getICmp((isSigned ?
- ICmpInst::ICMP_SLE:ICmpInst::ICMP_ULE), Lo, Hi))->getZExtValue() &&
- "Lo is not <= Hi in range emission code!");
-
- if (Inside) {
- if (Lo == Hi) // Trivially false.
- return new ICmpInst(ICmpInst::ICMP_NE, V, V);
-
- // V >= Min && V < Hi --> V < Hi
- if (cast<ConstantInt>(Lo)->isMinValue(isSigned)) {
- ICmpInst::Predicate pred = (isSigned ?
- ICmpInst::ICMP_SLT : ICmpInst::ICMP_ULT);
- return new ICmpInst(pred, V, Hi);
- }
-
- // Emit V-Lo <u Hi-Lo
- Constant *NegLo = ConstantExpr::getNeg(Lo);
- Instruction *Add = BinaryOperator::createAdd(V, NegLo, V->getName()+".off");
- InsertNewInstBefore(Add, IB);
- Constant *UpperBound = ConstantExpr::getAdd(NegLo, Hi);
- return new ICmpInst(ICmpInst::ICMP_ULT, Add, UpperBound);
- }
-
- if (Lo == Hi) // Trivially true.
- return new ICmpInst(ICmpInst::ICMP_EQ, V, V);
-
- // V < Min || V >= Hi -> V > Hi-1
- Hi = SubOne(cast<ConstantInt>(Hi));
- if (cast<ConstantInt>(Lo)->isMinValue(isSigned)) {
- ICmpInst::Predicate pred = (isSigned ?
- ICmpInst::ICMP_SGT : ICmpInst::ICMP_UGT);
- return new ICmpInst(pred, V, Hi);
- }
-
- // Emit V-Lo >u Hi-1-Lo
- // Note that Hi has already had one subtracted from it, above.
- ConstantInt *NegLo = cast<ConstantInt>(ConstantExpr::getNeg(Lo));
- Instruction *Add = BinaryOperator::createAdd(V, NegLo, V->getName()+".off");
- InsertNewInstBefore(Add, IB);
- Constant *LowerBound = ConstantExpr::getAdd(NegLo, Hi);
- return new ICmpInst(ICmpInst::ICMP_UGT, Add, LowerBound);
-}
-
-// isRunOfOnes - Returns true iff Val consists of one contiguous run of 1s with
-// any number of 0s on either side. The 1s are allowed to wrap from LSB to
-// MSB, so 0x000FFF0, 0x0000FFFF, and 0xFF0000FF are all runs. 0x0F0F0000 is
-// not, since all 1s are not contiguous.
-static bool isRunOfOnes(ConstantInt *Val, uint32_t &MB, uint32_t &ME) {
- const APInt& V = Val->getValue();
- uint32_t BitWidth = Val->getType()->getBitWidth();
- if (!APIntOps::isShiftedMask(BitWidth, V)) return false;
-
- // look for the first zero bit after the run of ones
- MB = BitWidth - ((V - 1) ^ V).countLeadingZeros();
- // look for the first non-zero bit
- ME = V.getActiveBits();
- return true;
-}
-
-/// FoldLogicalPlusAnd - This is part of an expression (LHS +/- RHS) & Mask,
-/// where isSub determines whether the operator is a sub. If we can fold one of
-/// the following xforms:
-///
-/// ((A & N) +/- B) & Mask -> (A +/- B) & Mask iff N&Mask == Mask
-/// ((A | N) +/- B) & Mask -> (A +/- B) & Mask iff N&Mask == 0
-/// ((A ^ N) +/- B) & Mask -> (A +/- B) & Mask iff N&Mask == 0
-///
-/// return (A +/- B).
-///
-Value *InstCombiner::FoldLogicalPlusAnd(Value *LHS, Value *RHS,
- ConstantInt *Mask, bool isSub,
- Instruction &I) {
- Instruction *LHSI = dyn_cast<Instruction>(LHS);
- if (!LHSI || LHSI->getNumOperands() != 2 ||
- !isa<ConstantInt>(LHSI->getOperand(1))) return 0;
-
- ConstantInt *N = cast<ConstantInt>(LHSI->getOperand(1));
-
- switch (LHSI->getOpcode()) {
- default: return 0;
- case Instruction::And:
- if (And(N, Mask) == Mask) {
- // If the AndRHS is a power of two minus one (0+1+), this is simple.
- if ((Mask->getValue().countLeadingZeros() +
- Mask->getValue().countPopulation()) ==
- Mask->getValue().getBitWidth())
- break;
-
- // Otherwise, if Mask is 0+1+0+, and if B is known to have the low 0+
- // part, we don't need any explicit masks to take them out of A. If that
- // is all N is, ignore it.
- uint32_t MB = 0, ME = 0;
- if (isRunOfOnes(Mask, MB, ME)) { // begin/end bit of run, inclusive
- uint32_t BitWidth = cast<IntegerType>(RHS->getType())->getBitWidth();
- APInt Mask(APInt::getLowBitsSet(BitWidth, MB-1));
- if (MaskedValueIsZero(RHS, Mask))
- break;
- }
- }
- return 0;
- case Instruction::Or:
- case Instruction::Xor:
- // If the AndRHS is a power of two minus one (0+1+), and N&Mask == 0
- if ((Mask->getValue().countLeadingZeros() +
- Mask->getValue().countPopulation()) == Mask->getValue().getBitWidth()
- && And(N, Mask)->isZero())
- break;
- return 0;
- }
-
- Instruction *New;
- if (isSub)
- New = BinaryOperator::createSub(LHSI->getOperand(0), RHS, "fold");
- else
- New = BinaryOperator::createAdd(LHSI->getOperand(0), RHS, "fold");
- return InsertNewInstBefore(New, I);
-}
-
-Instruction *InstCombiner::visitAnd(BinaryOperator &I) {
- bool Changed = SimplifyCommutative(I);
- Value *Op0 = I.getOperand(0), *Op1 = I.getOperand(1);
-
- if (isa<UndefValue>(Op1)) // X & undef -> 0
- return ReplaceInstUsesWith(I, Constant::getNullValue(I.getType()));
-
- // and X, X = X
- if (Op0 == Op1)
- return ReplaceInstUsesWith(I, Op1);
-
- // See if we can simplify any instructions used by the instruction whose sole
- // purpose is to compute bits we don't care about.
- if (!isa<VectorType>(I.getType())) {
- uint32_t BitWidth = cast<IntegerType>(I.getType())->getBitWidth();
- APInt KnownZero(BitWidth, 0), KnownOne(BitWidth, 0);
- if (SimplifyDemandedBits(&I, APInt::getAllOnesValue(BitWidth),
- KnownZero, KnownOne))
- return &I;
- } else {
- if (ConstantVector *CP = dyn_cast<ConstantVector>(Op1)) {
- if (CP->isAllOnesValue()) // X & <-1,-1> -> X
- return ReplaceInstUsesWith(I, I.getOperand(0));
- } else if (isa<ConstantAggregateZero>(Op1)) {
- return ReplaceInstUsesWith(I, Op1); // X & <0,0> -> <0,0>
- }
- }
-
- if (ConstantInt *AndRHS = dyn_cast<ConstantInt>(Op1)) {
- const APInt& AndRHSMask = AndRHS->getValue();
- APInt NotAndRHS(~AndRHSMask);
-
- // Optimize a variety of ((val OP C1) & C2) combinations...
- if (isa<BinaryOperator>(Op0)) {
- Instruction *Op0I = cast<Instruction>(Op0);
- Value *Op0LHS = Op0I->getOperand(0);
- Value *Op0RHS = Op0I->getOperand(1);
- switch (Op0I->getOpcode()) {
- case Instruction::Xor:
- case Instruction::Or:
- // If the mask is only needed on one incoming arm, push it up.
- if (Op0I->hasOneUse()) {
- if (MaskedValueIsZero(Op0LHS, NotAndRHS)) {
- // Not masking anything out for the LHS, move to RHS.
- Instruction *NewRHS = BinaryOperator::createAnd(Op0RHS, AndRHS,
- Op0RHS->getName()+".masked");
- InsertNewInstBefore(NewRHS, I);
- return BinaryOperator::create(
- cast<BinaryOperator>(Op0I)->getOpcode(), Op0LHS, NewRHS);
- }
- if (!isa<Constant>(Op0RHS) &&
- MaskedValueIsZero(Op0RHS, NotAndRHS)) {
- // Not masking anything out for the RHS, move to LHS.
- Instruction *NewLHS = BinaryOperator::createAnd(Op0LHS, AndRHS,
- Op0LHS->getName()+".masked");
- InsertNewInstBefore(NewLHS, I);
- return BinaryOperator::create(
- cast<BinaryOperator>(Op0I)->getOpcode(), NewLHS, Op0RHS);
- }
- }
-
- break;
- case Instruction::Add:
- // ((A & N) + B) & AndRHS -> (A + B) & AndRHS iff N&AndRHS == AndRHS.
- // ((A | N) + B) & AndRHS -> (A + B) & AndRHS iff N&AndRHS == 0
- // ((A ^ N) + B) & AndRHS -> (A + B) & AndRHS iff N&AndRHS == 0
- if (Value *V = FoldLogicalPlusAnd(Op0LHS, Op0RHS, AndRHS, false, I))
- return BinaryOperator::createAnd(V, AndRHS);
- if (Value *V = FoldLogicalPlusAnd(Op0RHS, Op0LHS, AndRHS, false, I))
- return BinaryOperator::createAnd(V, AndRHS); // Add commutes
- break;
-
- case Instruction::Sub:
- // ((A & N) - B) & AndRHS -> (A - B) & AndRHS iff N&AndRHS == AndRHS.
- // ((A | N) - B) & AndRHS -> (A - B) & AndRHS iff N&AndRHS == 0
- // ((A ^ N) - B) & AndRHS -> (A - B) & AndRHS iff N&AndRHS == 0
- if (Value *V = FoldLogicalPlusAnd(Op0LHS, Op0RHS, AndRHS, true, I))
- return BinaryOperator::createAnd(V, AndRHS);
- break;
- }
-
- if (ConstantInt *Op0CI = dyn_cast<ConstantInt>(Op0I->getOperand(1)))
- if (Instruction *Res = OptAndOp(Op0I, Op0CI, AndRHS, I))
- return Res;
- } else if (CastInst *CI = dyn_cast<CastInst>(Op0)) {
- // If this is an integer truncation or change from signed-to-unsigned, and
- // if the source is an and/or with immediate, transform it. This
- // frequently occurs for bitfield accesses.
- if (Instruction *CastOp = dyn_cast<Instruction>(CI->getOperand(0))) {
- if ((isa<TruncInst>(CI) || isa<BitCastInst>(CI)) &&
- CastOp->getNumOperands() == 2)
- if (ConstantInt *AndCI = dyn_cast<ConstantInt>(CastOp->getOperand(1))) {
- if (CastOp->getOpcode() == Instruction::And) {
- // Change: and (cast (and X, C1) to T), C2
- // into : and (cast X to T), trunc_or_bitcast(C1)&C2
- // This will fold the two constants together, which may allow
- // other simplifications.
- Instruction *NewCast = CastInst::createTruncOrBitCast(
- CastOp->getOperand(0), I.getType(),
- CastOp->getName()+".shrunk");
- NewCast = InsertNewInstBefore(NewCast, I);
- // trunc_or_bitcast(C1)&C2
- Constant *C3 = ConstantExpr::getTruncOrBitCast(AndCI,I.getType());
- C3 = ConstantExpr::getAnd(C3, AndRHS);
- return BinaryOperator::createAnd(NewCast, C3);
- } else if (CastOp->getOpcode() == Instruction::Or) {
- // Change: and (cast (or X, C1) to T), C2
- // into : trunc(C1)&C2 iff trunc(C1)&C2 == C2
- Constant *C3 = ConstantExpr::getTruncOrBitCast(AndCI,I.getType());
- if (ConstantExpr::getAnd(C3, AndRHS) == AndRHS) // trunc(C1)&C2
- return ReplaceInstUsesWith(I, AndRHS);
- }
- }
- }
- }
-
- // Try to fold constant and into select arguments.
- if (SelectInst *SI = dyn_cast<SelectInst>(Op0))
- if (Instruction *R = FoldOpIntoSelect(I, SI, this))
- return R;
- if (isa<PHINode>(Op0))
- if (Instruction *NV = FoldOpIntoPhi(I))
- return NV;
- }
-
- Value *Op0NotVal = dyn_castNotVal(Op0);
- Value *Op1NotVal = dyn_castNotVal(Op1);
-
- if (Op0NotVal == Op1 || Op1NotVal == Op0) // A & ~A == ~A & A == 0
- return ReplaceInstUsesWith(I, Constant::getNullValue(I.getType()));
-
- // (~A & ~B) == (~(A | B)) - De Morgan's Law
- if (Op0NotVal && Op1NotVal && isOnlyUse(Op0) && isOnlyUse(Op1)) {
- Instruction *Or = BinaryOperator::createOr(Op0NotVal, Op1NotVal,
- I.getName()+".demorgan");
- InsertNewInstBefore(Or, I);
- return BinaryOperator::createNot(Or);
- }
-
- {
- Value *A = 0, *B = 0, *C = 0, *D = 0;
- if (match(Op0, m_Or(m_Value(A), m_Value(B)))) {
- if (A == Op1 || B == Op1) // (A | ?) & A --> A
- return ReplaceInstUsesWith(I, Op1);
-
- // (A|B) & ~(A&B) -> A^B
- if (match(Op1, m_Not(m_And(m_Value(C), m_Value(D))))) {
- if ((A == C && B == D) || (A == D && B == C))
- return BinaryOperator::createXor(A, B);
- }
- }
-
- if (match(Op1, m_Or(m_Value(A), m_Value(B)))) {
- if (A == Op0 || B == Op0) // A & (A | ?) --> A
- return ReplaceInstUsesWith(I, Op0);
-
- // ~(A&B) & (A|B) -> A^B
- if (match(Op0, m_Not(m_And(m_Value(C), m_Value(D))))) {
- if ((A == C && B == D) || (A == D && B == C))
- return BinaryOperator::createXor(A, B);
- }
- }
-
- if (Op0->hasOneUse() &&
- match(Op0, m_Xor(m_Value(A), m_Value(B)))) {
- if (A == Op1) { // (A^B)&A -> A&(A^B)
- I.swapOperands(); // Simplify below
- std::swap(Op0, Op1);
- } else if (B == Op1) { // (A^B)&B -> B&(B^A)
- cast<BinaryOperator>(Op0)->swapOperands();
- I.swapOperands(); // Simplify below
- std::swap(Op0, Op1);
- }
- }
- if (Op1->hasOneUse() &&
- match(Op1, m_Xor(m_Value(A), m_Value(B)))) {
- if (B == Op0) { // B&(A^B) -> B&(B^A)
- cast<BinaryOperator>(Op1)->swapOperands();
- std::swap(A, B);
- }
- if (A == Op0) { // A&(A^B) -> A & ~B
- Instruction *NotB = BinaryOperator::createNot(B, "tmp");
- InsertNewInstBefore(NotB, I);
- return BinaryOperator::createAnd(A, NotB);
- }
- }
- }
-
- if (ICmpInst *RHS = dyn_cast<ICmpInst>(Op1)) {
- // (icmp1 A, B) & (icmp2 A, B) --> (icmp3 A, B)
- if (Instruction *R = AssociativeOpt(I, FoldICmpLogical(*this, RHS)))
- return R;
-
- Value *LHSVal, *RHSVal;
- ConstantInt *LHSCst, *RHSCst;
- ICmpInst::Predicate LHSCC, RHSCC;
- if (match(Op0, m_ICmp(LHSCC, m_Value(LHSVal), m_ConstantInt(LHSCst))))
- if (match(RHS, m_ICmp(RHSCC, m_Value(RHSVal), m_ConstantInt(RHSCst))))
- if (LHSVal == RHSVal && // Found (X icmp C1) & (X icmp C2)
- // ICMP_[GL]E X, CST is folded to ICMP_[GL]T elsewhere.
- LHSCC != ICmpInst::ICMP_UGE && LHSCC != ICmpInst::ICMP_ULE &&
- RHSCC != ICmpInst::ICMP_UGE && RHSCC != ICmpInst::ICMP_ULE &&
- LHSCC != ICmpInst::ICMP_SGE && LHSCC != ICmpInst::ICMP_SLE &&
- RHSCC != ICmpInst::ICMP_SGE && RHSCC != ICmpInst::ICMP_SLE &&
-
- // Don't try to fold ICMP_SLT + ICMP_ULT.
- (ICmpInst::isEquality(LHSCC) || ICmpInst::isEquality(RHSCC) ||
- ICmpInst::isSignedPredicate(LHSCC) ==
- ICmpInst::isSignedPredicate(RHSCC))) {
- // Ensure that the larger constant is on the RHS.
- ICmpInst::Predicate GT;
- if (ICmpInst::isSignedPredicate(LHSCC) ||
- (ICmpInst::isEquality(LHSCC) &&
- ICmpInst::isSignedPredicate(RHSCC)))
- GT = ICmpInst::ICMP_SGT;
- else
- GT = ICmpInst::ICMP_UGT;
-
- Constant *Cmp = ConstantExpr::getICmp(GT, LHSCst, RHSCst);
- ICmpInst *LHS = cast<ICmpInst>(Op0);
- if (cast<ConstantInt>(Cmp)->getZExtValue()) {
- std::swap(LHS, RHS);
- std::swap(LHSCst, RHSCst);
- std::swap(LHSCC, RHSCC);
- }
-
- // At this point, we know we have have two icmp instructions
- // comparing a value against two constants and and'ing the result
- // together. Because of the above check, we know that we only have
- // icmp eq, icmp ne, icmp [su]lt, and icmp [SU]gt here. We also know
- // (from the FoldICmpLogical check above), that the two constants
- // are not equal and that the larger constant is on the RHS
- assert(LHSCst != RHSCst && "Compares not folded above?");
-
- switch (LHSCC) {
- default: assert(0 && "Unknown integer condition code!");
- case ICmpInst::ICMP_EQ:
- switch (RHSCC) {
- default: assert(0 && "Unknown integer condition code!");
- case ICmpInst::ICMP_EQ: // (X == 13 & X == 15) -> false
- case ICmpInst::ICMP_UGT: // (X == 13 & X > 15) -> false
- case ICmpInst::ICMP_SGT: // (X == 13 & X > 15) -> false
- return ReplaceInstUsesWith(I, ConstantInt::getFalse());
- case ICmpInst::ICMP_NE: // (X == 13 & X != 15) -> X == 13
- case ICmpInst::ICMP_ULT: // (X == 13 & X < 15) -> X == 13
- case ICmpInst::ICMP_SLT: // (X == 13 & X < 15) -> X == 13
- return ReplaceInstUsesWith(I, LHS);
- }
- case ICmpInst::ICMP_NE:
- switch (RHSCC) {
- default: assert(0 && "Unknown integer condition code!");
- case ICmpInst::ICMP_ULT:
- if (LHSCst == SubOne(RHSCst)) // (X != 13 & X u< 14) -> X < 13
- return new ICmpInst(ICmpInst::ICMP_ULT, LHSVal, LHSCst);
- break; // (X != 13 & X u< 15) -> no change
- case ICmpInst::ICMP_SLT:
- if (LHSCst == SubOne(RHSCst)) // (X != 13 & X s< 14) -> X < 13
- return new ICmpInst(ICmpInst::ICMP_SLT, LHSVal, LHSCst);
- break; // (X != 13 & X s< 15) -> no change
- case ICmpInst::ICMP_EQ: // (X != 13 & X == 15) -> X == 15
- case ICmpInst::ICMP_UGT: // (X != 13 & X u> 15) -> X u> 15
- case ICmpInst::ICMP_SGT: // (X != 13 & X s> 15) -> X s> 15
- return ReplaceInstUsesWith(I, RHS);
- case ICmpInst::ICMP_NE:
- if (LHSCst == SubOne(RHSCst)){// (X != 13 & X != 14) -> X-13 >u 1
- Constant *AddCST = ConstantExpr::getNeg(LHSCst);
- Instruction *Add = BinaryOperator::createAdd(LHSVal, AddCST,
- LHSVal->getName()+".off");
- InsertNewInstBefore(Add, I);
- return new ICmpInst(ICmpInst::ICMP_UGT, Add,
- ConstantInt::get(Add->getType(), 1));
- }
- break; // (X != 13 & X != 15) -> no change
- }
- break;
- case ICmpInst::ICMP_ULT:
- switch (RHSCC) {
- default: assert(0 && "Unknown integer condition code!");
- case ICmpInst::ICMP_EQ: // (X u< 13 & X == 15) -> false
- case ICmpInst::ICMP_UGT: // (X u< 13 & X u> 15) -> false
- return ReplaceInstUsesWith(I, ConstantInt::getFalse());
- case ICmpInst::ICMP_SGT: // (X u< 13 & X s> 15) -> no change
- break;
- case ICmpInst::ICMP_NE: // (X u< 13 & X != 15) -> X u< 13
- case ICmpInst::ICMP_ULT: // (X u< 13 & X u< 15) -> X u< 13
- return ReplaceInstUsesWith(I, LHS);
- case ICmpInst::ICMP_SLT: // (X u< 13 & X s< 15) -> no change
- break;
- }
- break;
- case ICmpInst::ICMP_SLT:
- switch (RHSCC) {
- default: assert(0 && "Unknown integer condition code!");
- case ICmpInst::ICMP_EQ: // (X s< 13 & X == 15) -> false
- case ICmpInst::ICMP_SGT: // (X s< 13 & X s> 15) -> false
- return ReplaceInstUsesWith(I, ConstantInt::getFalse());
- case ICmpInst::ICMP_UGT: // (X s< 13 & X u> 15) -> no change
- break;
- case ICmpInst::ICMP_NE: // (X s< 13 & X != 15) -> X < 13
- case ICmpInst::ICMP_SLT: // (X s< 13 & X s< 15) -> X < 13
- return ReplaceInstUsesWith(I, LHS);
- case ICmpInst::ICMP_ULT: // (X s< 13 & X u< 15) -> no change
- break;
- }
- break;
- case ICmpInst::ICMP_UGT:
- switch (RHSCC) {
- default: assert(0 && "Unknown integer condition code!");
- case ICmpInst::ICMP_EQ: // (X u> 13 & X == 15) -> X > 13
- return ReplaceInstUsesWith(I, LHS);
- case ICmpInst::ICMP_UGT: // (X u> 13 & X u> 15) -> X u> 15
- return ReplaceInstUsesWith(I, RHS);
- case ICmpInst::ICMP_SGT: // (X u> 13 & X s> 15) -> no change
- break;
- case ICmpInst::ICMP_NE:
- if (RHSCst == AddOne(LHSCst)) // (X u> 13 & X != 14) -> X u> 14
- return new ICmpInst(LHSCC, LHSVal, RHSCst);
- break; // (X u> 13 & X != 15) -> no change
- case ICmpInst::ICMP_ULT: // (X u> 13 & X u< 15) ->(X-14) <u 1
- return InsertRangeTest(LHSVal, AddOne(LHSCst), RHSCst, false,
- true, I);
- case ICmpInst::ICMP_SLT: // (X u> 13 & X s< 15) -> no change
- break;
- }
- break;
- case ICmpInst::ICMP_SGT:
- switch (RHSCC) {
- default: assert(0 && "Unknown integer condition code!");
- case ICmpInst::ICMP_EQ: // (X s> 13 & X == 15) -> X == 15
- case ICmpInst::ICMP_SGT: // (X s> 13 & X s> 15) -> X s> 15
- return ReplaceInstUsesWith(I, RHS);
- case ICmpInst::ICMP_UGT: // (X s> 13 & X u> 15) -> no change
- break;
- case ICmpInst::ICMP_NE:
- if (RHSCst == AddOne(LHSCst)) // (X s> 13 & X != 14) -> X s> 14
- return new ICmpInst(LHSCC, LHSVal, RHSCst);
- break; // (X s> 13 & X != 15) -> no change
- case ICmpInst::ICMP_SLT: // (X s> 13 & X s< 15) ->(X-14) s< 1
- return InsertRangeTest(LHSVal, AddOne(LHSCst), RHSCst, true,
- true, I);
- case ICmpInst::ICMP_ULT: // (X s> 13 & X u< 15) -> no change
- break;
- }
- break;
- }
- }
- }
-
- // fold (and (cast A), (cast B)) -> (cast (and A, B))
- if (CastInst *Op0C = dyn_cast<CastInst>(Op0))
- if (CastInst *Op1C = dyn_cast<CastInst>(Op1))
- if (Op0C->getOpcode() == Op1C->getOpcode()) { // same cast kind ?
- const Type *SrcTy = Op0C->getOperand(0)->getType();
- if (SrcTy == Op1C->getOperand(0)->getType() && SrcTy->isInteger() &&
- // Only do this if the casts both really cause code to be generated.
- ValueRequiresCast(Op0C->getOpcode(), Op0C->getOperand(0),
- I.getType(), TD) &&
- ValueRequiresCast(Op1C->getOpcode(), Op1C->getOperand(0),
- I.getType(), TD)) {
- Instruction *NewOp = BinaryOperator::createAnd(Op0C->getOperand(0),
- Op1C->getOperand(0),
- I.getName());
- InsertNewInstBefore(NewOp, I);
- return CastInst::create(Op0C->getOpcode(), NewOp, I.getType());
- }
- }
-
- // (X >> Z) & (Y >> Z) -> (X&Y) >> Z for all shifts.
- if (BinaryOperator *SI1 = dyn_cast<BinaryOperator>(Op1)) {
- if (BinaryOperator *SI0 = dyn_cast<BinaryOperator>(Op0))
- if (SI0->isShift() && SI0->getOpcode() == SI1->getOpcode() &&
- SI0->getOperand(1) == SI1->getOperand(1) &&
- (SI0->hasOneUse() || SI1->hasOneUse())) {
- Instruction *NewOp =
- InsertNewInstBefore(BinaryOperator::createAnd(SI0->getOperand(0),
- SI1->getOperand(0),
- SI0->getName()), I);
- return BinaryOperator::create(SI1->getOpcode(), NewOp,
- SI1->getOperand(1));
- }
- }
-
- // (fcmp ord x, c) & (fcmp ord y, c) -> (fcmp ord x, y)
- if (FCmpInst *LHS = dyn_cast<FCmpInst>(I.getOperand(0))) {
- if (FCmpInst *RHS = dyn_cast<FCmpInst>(I.getOperand(1))) {
- if (LHS->getPredicate() == FCmpInst::FCMP_ORD &&
- RHS->getPredicate() == FCmpInst::FCMP_ORD)
- if (ConstantFP *LHSC = dyn_cast<ConstantFP>(LHS->getOperand(1)))
- if (ConstantFP *RHSC = dyn_cast<ConstantFP>(RHS->getOperand(1))) {
- // If either of the constants are nans, then the whole thing returns
- // false.
- if (LHSC->getValueAPF().isNaN() || RHSC->getValueAPF().isNaN())
- return ReplaceInstUsesWith(I, ConstantInt::getFalse());
- return new FCmpInst(FCmpInst::FCMP_ORD, LHS->getOperand(0),
- RHS->getOperand(0));
- }
- }
- }
-
- return Changed ? &I : 0;
-}
-
-/// CollectBSwapParts - Look to see if the specified value defines a single byte
-/// in the result. If it does, and if the specified byte hasn't been filled in
-/// yet, fill it in and return false.
-static bool CollectBSwapParts(Value *V, SmallVector<Value*, 8> &ByteValues) {
- Instruction *I = dyn_cast<Instruction>(V);
- if (I == 0) return true;
-
- // If this is an or instruction, it is an inner node of the bswap.
- if (I->getOpcode() == Instruction::Or)
- return CollectBSwapParts(I->getOperand(0), ByteValues) ||
- CollectBSwapParts(I->getOperand(1), ByteValues);
-
- uint32_t BitWidth = I->getType()->getPrimitiveSizeInBits();
- // If this is a shift by a constant int, and it is "24", then its operand
- // defines a byte. We only handle unsigned types here.
- if (I->isShift() && isa<ConstantInt>(I->getOperand(1))) {
- // Not shifting the entire input by N-1 bytes?
- if (cast<ConstantInt>(I->getOperand(1))->getLimitedValue(BitWidth) !=
- 8*(ByteValues.size()-1))
- return true;
-
- unsigned DestNo;
- if (I->getOpcode() == Instruction::Shl) {
- // X << 24 defines the top byte with the lowest of the input bytes.
- DestNo = ByteValues.size()-1;
- } else {
- // X >>u 24 defines the low byte with the highest of the input bytes.
- DestNo = 0;
- }
-
- // If the destination byte value is already defined, the values are or'd
- // together, which isn't a bswap (unless it's an or of the same bits).
- if (ByteValues[DestNo] && ByteValues[DestNo] != I->getOperand(0))
- return true;
- ByteValues[DestNo] = I->getOperand(0);
- return false;
- }
-
- // Otherwise, we can only handle and(shift X, imm), imm). Bail out of if we
- // don't have this.
- Value *Shift = 0, *ShiftLHS = 0;
- ConstantInt *AndAmt = 0, *ShiftAmt = 0;
- if (!match(I, m_And(m_Value(Shift), m_ConstantInt(AndAmt))) ||
- !match(Shift, m_Shift(m_Value(ShiftLHS), m_ConstantInt(ShiftAmt))))
- return true;
- Instruction *SI = cast<Instruction>(Shift);
-
- // Make sure that the shift amount is by a multiple of 8 and isn't too big.
- if (ShiftAmt->getLimitedValue(BitWidth) & 7 ||
- ShiftAmt->getLimitedValue(BitWidth) > 8*ByteValues.size())
- return true;
-
- // Turn 0xFF -> 0, 0xFF00 -> 1, 0xFF0000 -> 2, etc.
- unsigned DestByte;
- if (AndAmt->getValue().getActiveBits() > 64)
- return true;
- uint64_t AndAmtVal = AndAmt->getZExtValue();
- for (DestByte = 0; DestByte != ByteValues.size(); ++DestByte)
- if (AndAmtVal == uint64_t(0xFF) << 8*DestByte)
- break;
- // Unknown mask for bswap.
- if (DestByte == ByteValues.size()) return true;
-
- unsigned ShiftBytes = ShiftAmt->getZExtValue()/8;
- unsigned SrcByte;
- if (SI->getOpcode() == Instruction::Shl)
- SrcByte = DestByte - ShiftBytes;
- else
- SrcByte = DestByte + ShiftBytes;
-
- // If the SrcByte isn't a bswapped value from the DestByte, reject it.
- if (SrcByte != ByteValues.size()-DestByte-1)
- return true;
-
- // If the destination byte value is already defined, the values are or'd
- // together, which isn't a bswap (unless it's an or of the same bits).
- if (ByteValues[DestByte] && ByteValues[DestByte] != SI->getOperand(0))
- return true;
- ByteValues[DestByte] = SI->getOperand(0);
- return false;
-}
-
-/// MatchBSwap - Given an OR instruction, check to see if this is a bswap idiom.
-/// If so, insert the new bswap intrinsic and return it.
-Instruction *InstCombiner::MatchBSwap(BinaryOperator &I) {
- const IntegerType *ITy = dyn_cast<IntegerType>(I.getType());
- if (!ITy || ITy->getBitWidth() % 16)
- return 0; // Can only bswap pairs of bytes. Can't do vectors.
-
- /// ByteValues - For each byte of the result, we keep track of which value
- /// defines each byte.
- SmallVector<Value*, 8> ByteValues;
- ByteValues.resize(ITy->getBitWidth()/8);
-
- // Try to find all the pieces corresponding to the bswap.
- if (CollectBSwapParts(I.getOperand(0), ByteValues) ||
- CollectBSwapParts(I.getOperand(1), ByteValues))
- return 0;
-
- // Check to see if all of the bytes come from the same value.
- Value *V = ByteValues[0];
- if (V == 0) return 0; // Didn't find a byte? Must be zero.
-
- // Check to make sure that all of the bytes come from the same value.
- for (unsigned i = 1, e = ByteValues.size(); i != e; ++i)
- if (ByteValues[i] != V)
- return 0;
- const Type *Tys[] = { ITy };
- Module *M = I.getParent()->getParent()->getParent();
- Function *F = Intrinsic::getDeclaration(M, Intrinsic::bswap, Tys, 1);
- return CallInst::Create(F, V);
-}
-
-
-Instruction *InstCombiner::visitOr(BinaryOperator &I) {
- bool Changed = SimplifyCommutative(I);
- Value *Op0 = I.getOperand(0), *Op1 = I.getOperand(1);
-
- if (isa<UndefValue>(Op1)) // X | undef -> -1
- return ReplaceInstUsesWith(I, Constant::getAllOnesValue(I.getType()));
-
- // or X, X = X
- if (Op0 == Op1)
- return ReplaceInstUsesWith(I, Op0);
-
- // See if we can simplify any instructions used by the instruction whose sole
- // purpose is to compute bits we don't care about.
- if (!isa<VectorType>(I.getType())) {
- uint32_t BitWidth = cast<IntegerType>(I.getType())->getBitWidth();
- APInt KnownZero(BitWidth, 0), KnownOne(BitWidth, 0);
- if (SimplifyDemandedBits(&I, APInt::getAllOnesValue(BitWidth),
- KnownZero, KnownOne))
- return &I;
- } else if (isa<ConstantAggregateZero>(Op1)) {
- return ReplaceInstUsesWith(I, Op0); // X | <0,0> -> X
- } else if (ConstantVector *CP = dyn_cast<ConstantVector>(Op1)) {
- if (CP->isAllOnesValue()) // X | <-1,-1> -> <-1,-1>
- return ReplaceInstUsesWith(I, I.getOperand(1));
- }
-
-
-
- // or X, -1 == -1
- if (ConstantInt *RHS = dyn_cast<ConstantInt>(Op1)) {
- ConstantInt *C1 = 0; Value *X = 0;
- // (X & C1) | C2 --> (X | C2) & (C1|C2)
- if (match(Op0, m_And(m_Value(X), m_ConstantInt(C1))) && isOnlyUse(Op0)) {
- Instruction *Or = BinaryOperator::createOr(X, RHS);
- InsertNewInstBefore(Or, I);
- Or->takeName(Op0);
- return BinaryOperator::createAnd(Or,
- ConstantInt::get(RHS->getValue() | C1->getValue()));
- }
-
- // (X ^ C1) | C2 --> (X | C2) ^ (C1&~C2)
- if (match(Op0, m_Xor(m_Value(X), m_ConstantInt(C1))) && isOnlyUse(Op0)) {
- Instruction *Or = BinaryOperator::createOr(X, RHS);
- InsertNewInstBefore(Or, I);
- Or->takeName(Op0);
- return BinaryOperator::createXor(Or,
- ConstantInt::get(C1->getValue() & ~RHS->getValue()));
- }
-
- // Try to fold constant and into select arguments.
- if (SelectInst *SI = dyn_cast<SelectInst>(Op0))
- if (Instruction *R = FoldOpIntoSelect(I, SI, this))
- return R;
- if (isa<PHINode>(Op0))
- if (Instruction *NV = FoldOpIntoPhi(I))
- return NV;
- }
-
- Value *A = 0, *B = 0;
- ConstantInt *C1 = 0, *C2 = 0;
-
- if (match(Op0, m_And(m_Value(A), m_Value(B))))
- if (A == Op1 || B == Op1) // (A & ?) | A --> A
- return ReplaceInstUsesWith(I, Op1);
- if (match(Op1, m_And(m_Value(A), m_Value(B))))
- if (A == Op0 || B == Op0) // A | (A & ?) --> A
- return ReplaceInstUsesWith(I, Op0);
-
- // (A | B) | C and A | (B | C) -> bswap if possible.
- // (A >> B) | (C << D) and (A << B) | (B >> C) -> bswap if possible.
- if (match(Op0, m_Or(m_Value(), m_Value())) ||
- match(Op1, m_Or(m_Value(), m_Value())) ||
- (match(Op0, m_Shift(m_Value(), m_Value())) &&
- match(Op1, m_Shift(m_Value(), m_Value())))) {
- if (Instruction *BSwap = MatchBSwap(I))
- return BSwap;
- }
-
- // (X^C)|Y -> (X|Y)^C iff Y&C == 0
- if (Op0->hasOneUse() && match(Op0, m_Xor(m_Value(A), m_ConstantInt(C1))) &&
- MaskedValueIsZero(Op1, C1->getValue())) {
- Instruction *NOr = BinaryOperator::createOr(A, Op1);
- InsertNewInstBefore(NOr, I);
- NOr->takeName(Op0);
- return BinaryOperator::createXor(NOr, C1);
- }
-
- // Y|(X^C) -> (X|Y)^C iff Y&C == 0
- if (Op1->hasOneUse() && match(Op1, m_Xor(m_Value(A), m_ConstantInt(C1))) &&
- MaskedValueIsZero(Op0, C1->getValue())) {
- Instruction *NOr = BinaryOperator::createOr(A, Op0);
- InsertNewInstBefore(NOr, I);
- NOr->takeName(Op0);
- return BinaryOperator::createXor(NOr, C1);
- }
-
- // (A & C)|(B & D)
- Value *C = 0, *D = 0;
- if (match(Op0, m_And(m_Value(A), m_Value(C))) &&
- match(Op1, m_And(m_Value(B), m_Value(D)))) {
- Value *V1 = 0, *V2 = 0, *V3 = 0;
- C1 = dyn_cast<ConstantInt>(C);
- C2 = dyn_cast<ConstantInt>(D);
- if (C1 && C2) { // (A & C1)|(B & C2)
- // If we have: ((V + N) & C1) | (V & C2)
- // .. and C2 = ~C1 and C2 is 0+1+ and (N & C2) == 0
- // replace with V+N.
- if (C1->getValue() == ~C2->getValue()) {
- if ((C2->getValue() & (C2->getValue()+1)) == 0 && // C2 == 0+1+
- match(A, m_Add(m_Value(V1), m_Value(V2)))) {
- // Add commutes, try both ways.
- if (V1 == B && MaskedValueIsZero(V2, C2->getValue()))
- return ReplaceInstUsesWith(I, A);
- if (V2 == B && MaskedValueIsZero(V1, C2->getValue()))
- return ReplaceInstUsesWith(I, A);
- }
- // Or commutes, try both ways.
- if ((C1->getValue() & (C1->getValue()+1)) == 0 &&
- match(B, m_Add(m_Value(V1), m_Value(V2)))) {
- // Add commutes, try both ways.
- if (V1 == A && MaskedValueIsZero(V2, C1->getValue()))
- return ReplaceInstUsesWith(I, B);
- if (V2 == A && MaskedValueIsZero(V1, C1->getValue()))
- return ReplaceInstUsesWith(I, B);
- }
- }
- V1 = 0; V2 = 0; V3 = 0;
- }
-
- // Check to see if we have any common things being and'ed. If so, find the
- // terms for V1 & (V2|V3).
- if (isOnlyUse(Op0) || isOnlyUse(Op1)) {
- if (A == B) // (A & C)|(A & D) == A & (C|D)
- V1 = A, V2 = C, V3 = D;
- else if (A == D) // (A & C)|(B & A) == A & (B|C)
- V1 = A, V2 = B, V3 = C;
- else if (C == B) // (A & C)|(C & D) == C & (A|D)
- V1 = C, V2 = A, V3 = D;
- else if (C == D) // (A & C)|(B & C) == C & (A|B)
- V1 = C, V2 = A, V3 = B;
-
- if (V1) {
- Value *Or =
- InsertNewInstBefore(BinaryOperator::createOr(V2, V3, "tmp"), I);
- return BinaryOperator::createAnd(V1, Or);
- }
- }
- }
-
- // (X >> Z) | (Y >> Z) -> (X|Y) >> Z for all shifts.
- if (BinaryOperator *SI1 = dyn_cast<BinaryOperator>(Op1)) {
- if (BinaryOperator *SI0 = dyn_cast<BinaryOperator>(Op0))
- if (SI0->isShift() && SI0->getOpcode() == SI1->getOpcode() &&
- SI0->getOperand(1) == SI1->getOperand(1) &&
- (SI0->hasOneUse() || SI1->hasOneUse())) {
- Instruction *NewOp =
- InsertNewInstBefore(BinaryOperator::createOr(SI0->getOperand(0),
- SI1->getOperand(0),
- SI0->getName()), I);
- return BinaryOperator::create(SI1->getOpcode(), NewOp,
- SI1->getOperand(1));
- }
- }
-
- if (match(Op0, m_Not(m_Value(A)))) { // ~A | Op1
- if (A == Op1) // ~A | A == -1
- return ReplaceInstUsesWith(I, Constant::getAllOnesValue(I.getType()));
- } else {
- A = 0;
- }
- // Note, A is still live here!
- if (match(Op1, m_Not(m_Value(B)))) { // Op0 | ~B
- if (Op0 == B)
- return ReplaceInstUsesWith(I, Constant::getAllOnesValue(I.getType()));
-
- // (~A | ~B) == (~(A & B)) - De Morgan's Law
- if (A && isOnlyUse(Op0) && isOnlyUse(Op1)) {
- Value *And = InsertNewInstBefore(BinaryOperator::createAnd(A, B,
- I.getName()+".demorgan"), I);
- return BinaryOperator::createNot(And);
- }
- }
-
- // (icmp1 A, B) | (icmp2 A, B) --> (icmp3 A, B)
- if (ICmpInst *RHS = dyn_cast<ICmpInst>(I.getOperand(1))) {
- if (Instruction *R = AssociativeOpt(I, FoldICmpLogical(*this, RHS)))
- return R;
-
- Value *LHSVal, *RHSVal;
- ConstantInt *LHSCst, *RHSCst;
- ICmpInst::Predicate LHSCC, RHSCC;
- if (match(Op0, m_ICmp(LHSCC, m_Value(LHSVal), m_ConstantInt(LHSCst))))
- if (match(RHS, m_ICmp(RHSCC, m_Value(RHSVal), m_ConstantInt(RHSCst))))
- if (LHSVal == RHSVal && // Found (X icmp C1) | (X icmp C2)
- // icmp [us][gl]e x, cst is folded to icmp [us][gl]t elsewhere.
- LHSCC != ICmpInst::ICMP_UGE && LHSCC != ICmpInst::ICMP_ULE &&
- RHSCC != ICmpInst::ICMP_UGE && RHSCC != ICmpInst::ICMP_ULE &&
- LHSCC != ICmpInst::ICMP_SGE && LHSCC != ICmpInst::ICMP_SLE &&
- RHSCC != ICmpInst::ICMP_SGE && RHSCC != ICmpInst::ICMP_SLE &&
- // We can't fold (ugt x, C) | (sgt x, C2).
- PredicatesFoldable(LHSCC, RHSCC)) {
- // Ensure that the larger constant is on the RHS.
- ICmpInst *LHS = cast<ICmpInst>(Op0);
- bool NeedsSwap;
- if (ICmpInst::isSignedPredicate(LHSCC))
- NeedsSwap = LHSCst->getValue().sgt(RHSCst->getValue());
- else
- NeedsSwap = LHSCst->getValue().ugt(RHSCst->getValue());
-
- if (NeedsSwap) {
- std::swap(LHS, RHS);
- std::swap(LHSCst, RHSCst);
- std::swap(LHSCC, RHSCC);
- }
-
- // At this point, we know we have have two icmp instructions
- // comparing a value against two constants and or'ing the result
- // together. Because of the above check, we know that we only have
- // ICMP_EQ, ICMP_NE, ICMP_LT, and ICMP_GT here. We also know (from the
- // FoldICmpLogical check above), that the two constants are not
- // equal.
- assert(LHSCst != RHSCst && "Compares not folded above?");
-
- switch (LHSCC) {
- default: assert(0 && "Unknown integer condition code!");
- case ICmpInst::ICMP_EQ:
- switch (RHSCC) {
- default: assert(0 && "Unknown integer condition code!");
- case ICmpInst::ICMP_EQ:
- if (LHSCst == SubOne(RHSCst)) {// (X == 13 | X == 14) -> X-13 <u 2
- Constant *AddCST = ConstantExpr::getNeg(LHSCst);
- Instruction *Add = BinaryOperator::createAdd(LHSVal, AddCST,
- LHSVal->getName()+".off");
- InsertNewInstBefore(Add, I);
- AddCST = Subtract(AddOne(RHSCst), LHSCst);
- return new ICmpInst(ICmpInst::ICMP_ULT, Add, AddCST);
- }
- break; // (X == 13 | X == 15) -> no change
- case ICmpInst::ICMP_UGT: // (X == 13 | X u> 14) -> no change
- case ICmpInst::ICMP_SGT: // (X == 13 | X s> 14) -> no change
- break;
- case ICmpInst::ICMP_NE: // (X == 13 | X != 15) -> X != 15
- case ICmpInst::ICMP_ULT: // (X == 13 | X u< 15) -> X u< 15
- case ICmpInst::ICMP_SLT: // (X == 13 | X s< 15) -> X s< 15
- return ReplaceInstUsesWith(I, RHS);
- }
- break;
- case ICmpInst::ICMP_NE:
- switch (RHSCC) {
- default: assert(0 && "Unknown integer condition code!");
- case ICmpInst::ICMP_EQ: // (X != 13 | X == 15) -> X != 13
- case ICmpInst::ICMP_UGT: // (X != 13 | X u> 15) -> X != 13
- case ICmpInst::ICMP_SGT: // (X != 13 | X s> 15) -> X != 13
- return ReplaceInstUsesWith(I, LHS);
- case ICmpInst::ICMP_NE: // (X != 13 | X != 15) -> true
- case ICmpInst::ICMP_ULT: // (X != 13 | X u< 15) -> true
- case ICmpInst::ICMP_SLT: // (X != 13 | X s< 15) -> true
- return ReplaceInstUsesWith(I, ConstantInt::getTrue());
- }
- break;
- case ICmpInst::ICMP_ULT:
- switch (RHSCC) {
- default: assert(0 && "Unknown integer condition code!");
- case ICmpInst::ICMP_EQ: // (X u< 13 | X == 14) -> no change
- break;
- case ICmpInst::ICMP_UGT: // (X u< 13 | X u> 15) ->(X-13) u> 2
- // If RHSCst is [us]MAXINT, it is always false. Not handling
- // this can cause overflow.
- if (RHSCst->isMaxValue(false))
- return ReplaceInstUsesWith(I, LHS);
- return InsertRangeTest(LHSVal, LHSCst, AddOne(RHSCst), false,
- false, I);
- case ICmpInst::ICMP_SGT: // (X u< 13 | X s> 15) -> no change
- break;
- case ICmpInst::ICMP_NE: // (X u< 13 | X != 15) -> X != 15
- case ICmpInst::ICMP_ULT: // (X u< 13 | X u< 15) -> X u< 15
- return ReplaceInstUsesWith(I, RHS);
- case ICmpInst::ICMP_SLT: // (X u< 13 | X s< 15) -> no change
- break;
- }
- break;
- case ICmpInst::ICMP_SLT:
- switch (RHSCC) {
- default: assert(0 && "Unknown integer condition code!");
- case ICmpInst::ICMP_EQ: // (X s< 13 | X == 14) -> no change
- break;
- case ICmpInst::ICMP_SGT: // (X s< 13 | X s> 15) ->(X-13) s> 2
- // If RHSCst is [us]MAXINT, it is always false. Not handling
- // this can cause overflow.
- if (RHSCst->isMaxValue(true))
- return ReplaceInstUsesWith(I, LHS);
- return InsertRangeTest(LHSVal, LHSCst, AddOne(RHSCst), true,
- false, I);
- case ICmpInst::ICMP_UGT: // (X s< 13 | X u> 15) -> no change
- break;
- case ICmpInst::ICMP_NE: // (X s< 13 | X != 15) -> X != 15
- case ICmpInst::ICMP_SLT: // (X s< 13 | X s< 15) -> X s< 15
- return ReplaceInstUsesWith(I, RHS);
- case ICmpInst::ICMP_ULT: // (X s< 13 | X u< 15) -> no change
- break;
- }
- break;
- case ICmpInst::ICMP_UGT:
- switch (RHSCC) {
- default: assert(0 && "Unknown integer condition code!");
- case ICmpInst::ICMP_EQ: // (X u> 13 | X == 15) -> X u> 13
- case ICmpInst::ICMP_UGT: // (X u> 13 | X u> 15) -> X u> 13
- return ReplaceInstUsesWith(I, LHS);
- case ICmpInst::ICMP_SGT: // (X u> 13 | X s> 15) -> no change
- break;
- case ICmpInst::ICMP_NE: // (X u> 13 | X != 15) -> true
- case ICmpInst::ICMP_ULT: // (X u> 13 | X u< 15) -> true
- return ReplaceInstUsesWith(I, ConstantInt::getTrue());
- case ICmpInst::ICMP_SLT: // (X u> 13 | X s< 15) -> no change
- break;
- }
- break;
- case ICmpInst::ICMP_SGT:
- switch (RHSCC) {
- default: assert(0 && "Unknown integer condition code!");
- case ICmpInst::ICMP_EQ: // (X s> 13 | X == 15) -> X > 13
- case ICmpInst::ICMP_SGT: // (X s> 13 | X s> 15) -> X > 13
- return ReplaceInstUsesWith(I, LHS);
- case ICmpInst::ICMP_UGT: // (X s> 13 | X u> 15) -> no change
- break;
- case ICmpInst::ICMP_NE: // (X s> 13 | X != 15) -> true
- case ICmpInst::ICMP_SLT: // (X s> 13 | X s< 15) -> true
- return ReplaceInstUsesWith(I, ConstantInt::getTrue());
- case ICmpInst::ICMP_ULT: // (X s> 13 | X u< 15) -> no change
- break;
- }
- break;
- }
- }
- }
-
- // fold (or (cast A), (cast B)) -> (cast (or A, B))
- if (CastInst *Op0C = dyn_cast<CastInst>(Op0)) {
- if (CastInst *Op1C = dyn_cast<CastInst>(Op1))
- if (Op0C->getOpcode() == Op1C->getOpcode()) {// same cast kind ?
- if (!isa<ICmpInst>(Op0C->getOperand(0)) ||
- !isa<ICmpInst>(Op1C->getOperand(0))) {
- const Type *SrcTy = Op0C->getOperand(0)->getType();
- if (SrcTy == Op1C->getOperand(0)->getType() && SrcTy->isInteger() &&
- // Only do this if the casts both really cause code to be
- // generated.
- ValueRequiresCast(Op0C->getOpcode(), Op0C->getOperand(0),
- I.getType(), TD) &&
- ValueRequiresCast(Op1C->getOpcode(), Op1C->getOperand(0),
- I.getType(), TD)) {
- Instruction *NewOp = BinaryOperator::createOr(Op0C->getOperand(0),
- Op1C->getOperand(0),
- I.getName());
- InsertNewInstBefore(NewOp, I);
- return CastInst::create(Op0C->getOpcode(), NewOp, I.getType());
- }
- }
- }
- }
-
-
- // (fcmp uno x, c) | (fcmp uno y, c) -> (fcmp uno x, y)
- if (FCmpInst *LHS = dyn_cast<FCmpInst>(I.getOperand(0))) {
- if (FCmpInst *RHS = dyn_cast<FCmpInst>(I.getOperand(1))) {
- if (LHS->getPredicate() == FCmpInst::FCMP_UNO &&
- RHS->getPredicate() == FCmpInst::FCMP_UNO &&
- LHS->getOperand(0)->getType() == RHS->getOperand(0)->getType())
- if (ConstantFP *LHSC = dyn_cast<ConstantFP>(LHS->getOperand(1)))
- if (ConstantFP *RHSC = dyn_cast<ConstantFP>(RHS->getOperand(1))) {
- // If either of the constants are nans, then the whole thing returns
- // true.
- if (LHSC->getValueAPF().isNaN() || RHSC->getValueAPF().isNaN())
- return ReplaceInstUsesWith(I, ConstantInt::getTrue());
-
- // Otherwise, no need to compare the two constants, compare the
- // rest.
- return new FCmpInst(FCmpInst::FCMP_UNO, LHS->getOperand(0),
- RHS->getOperand(0));
- }
- }
- }
-
- return Changed ? &I : 0;
-}
-
-// XorSelf - Implements: X ^ X --> 0
-struct XorSelf {
- Value *RHS;
- XorSelf(Value *rhs) : RHS(rhs) {}
- bool shouldApply(Value *LHS) const { return LHS == RHS; }
- Instruction *apply(BinaryOperator &Xor) const {
- return &Xor;
- }
-};
-
-
-Instruction *InstCombiner::visitXor(BinaryOperator &I) {
- bool Changed = SimplifyCommutative(I);
- Value *Op0 = I.getOperand(0), *Op1 = I.getOperand(1);
-
- if (isa<UndefValue>(Op1)) {
- if (isa<UndefValue>(Op0))
- // Handle undef ^ undef -> 0 special case. This is a common
- // idiom (misuse).
- return ReplaceInstUsesWith(I, Constant::getNullValue(I.getType()));
- return ReplaceInstUsesWith(I, Op1); // X ^ undef -> undef
- }
-
- // xor X, X = 0, even if X is nested in a sequence of Xor's.
- if (Instruction *Result = AssociativeOpt(I, XorSelf(Op1))) {
- assert(Result == &I && "AssociativeOpt didn't work?"); Result=Result;
- return ReplaceInstUsesWith(I, Constant::getNullValue(I.getType()));
- }
-
- // See if we can simplify any instructions used by the instruction whose sole
- // purpose is to compute bits we don't care about.
- if (!isa<VectorType>(I.getType())) {
- uint32_t BitWidth = cast<IntegerType>(I.getType())->getBitWidth();
- APInt KnownZero(BitWidth, 0), KnownOne(BitWidth, 0);
- if (SimplifyDemandedBits(&I, APInt::getAllOnesValue(BitWidth),
- KnownZero, KnownOne))
- return &I;
- } else if (isa<ConstantAggregateZero>(Op1)) {
- return ReplaceInstUsesWith(I, Op0); // X ^ <0,0> -> X
- }
-
- // Is this a ~ operation?
- if (Value *NotOp = dyn_castNotVal(&I)) {
- // ~(~X & Y) --> (X | ~Y) - De Morgan's Law
- // ~(~X | Y) === (X & ~Y) - De Morgan's Law
- if (BinaryOperator *Op0I = dyn_cast<BinaryOperator>(NotOp)) {
- if (Op0I->getOpcode() == Instruction::And ||
- Op0I->getOpcode() == Instruction::Or) {
- if (dyn_castNotVal(Op0I->getOperand(1))) Op0I->swapOperands();
- if (Value *Op0NotVal = dyn_castNotVal(Op0I->getOperand(0))) {
- Instruction *NotY =
- BinaryOperator::createNot(Op0I->getOperand(1),
- Op0I->getOperand(1)->getName()+".not");
- InsertNewInstBefore(NotY, I);
- if (Op0I->getOpcode() == Instruction::And)
- return BinaryOperator::createOr(Op0NotVal, NotY);
- else
- return BinaryOperator::createAnd(Op0NotVal, NotY);
- }
- }
- }
- }
-
-
- if (ConstantInt *RHS = dyn_cast<ConstantInt>(Op1)) {
- // xor (cmp A, B), true = not (cmp A, B) = !cmp A, B
- if (RHS == ConstantInt::getTrue() && Op0->hasOneUse()) {
- if (ICmpInst *ICI = dyn_cast<ICmpInst>(Op0))
- return new ICmpInst(ICI->getInversePredicate(),
- ICI->getOperand(0), ICI->getOperand(1));
-
- if (FCmpInst *FCI = dyn_cast<FCmpInst>(Op0))
- return new FCmpInst(FCI->getInversePredicate(),
- FCI->getOperand(0), FCI->getOperand(1));
- }
-
- if (BinaryOperator *Op0I = dyn_cast<BinaryOperator>(Op0)) {
- // ~(c-X) == X-c-1 == X+(-c-1)
- if (Op0I->getOpcode() == Instruction::Sub && RHS->isAllOnesValue())
- if (Constant *Op0I0C = dyn_cast<Constant>(Op0I->getOperand(0))) {
- Constant *NegOp0I0C = ConstantExpr::getNeg(Op0I0C);
- Constant *ConstantRHS = ConstantExpr::getSub(NegOp0I0C,
- ConstantInt::get(I.getType(), 1));
- return BinaryOperator::createAdd(Op0I->getOperand(1), ConstantRHS);
- }
-
- if (ConstantInt *Op0CI = dyn_cast<ConstantInt>(Op0I->getOperand(1))) {
- if (Op0I->getOpcode() == Instruction::Add) {
- // ~(X-c) --> (-c-1)-X
- if (RHS->isAllOnesValue()) {
- Constant *NegOp0CI = ConstantExpr::getNeg(Op0CI);
- return BinaryOperator::createSub(
- ConstantExpr::getSub(NegOp0CI,
- ConstantInt::get(I.getType(), 1)),
- Op0I->getOperand(0));
- } else if (RHS->getValue().isSignBit()) {
- // (X + C) ^ signbit -> (X + C + signbit)
- Constant *C = ConstantInt::get(RHS->getValue() + Op0CI->getValue());
- return BinaryOperator::createAdd(Op0I->getOperand(0), C);
-
- }
- } else if (Op0I->getOpcode() == Instruction::Or) {
- // (X|C1)^C2 -> X^(C1|C2) iff X&~C1 == 0
- if (MaskedValueIsZero(Op0I->getOperand(0), Op0CI->getValue())) {
- Constant *NewRHS = ConstantExpr::getOr(Op0CI, RHS);
- // Anything in both C1 and C2 is known to be zero, remove it from
- // NewRHS.
- Constant *CommonBits = And(Op0CI, RHS);
- NewRHS = ConstantExpr::getAnd(NewRHS,
- ConstantExpr::getNot(CommonBits));
- AddToWorkList(Op0I);
- I.setOperand(0, Op0I->getOperand(0));
- I.setOperand(1, NewRHS);
- return &I;
- }
- }
- }
- }
-
- // Try to fold constant and into select arguments.
- if (SelectInst *SI = dyn_cast<SelectInst>(Op0))
- if (Instruction *R = FoldOpIntoSelect(I, SI, this))
- return R;
- if (isa<PHINode>(Op0))
- if (Instruction *NV = FoldOpIntoPhi(I))
- return NV;
- }
-
- if (Value *X = dyn_castNotVal(Op0)) // ~A ^ A == -1
- if (X == Op1)
- return ReplaceInstUsesWith(I, Constant::getAllOnesValue(I.getType()));
-
- if (Value *X = dyn_castNotVal(Op1)) // A ^ ~A == -1
- if (X == Op0)
- return ReplaceInstUsesWith(I, Constant::getAllOnesValue(I.getType()));
-
-
- BinaryOperator *Op1I = dyn_cast<BinaryOperator>(Op1);
- if (Op1I) {
- Value *A, *B;
- if (match(Op1I, m_Or(m_Value(A), m_Value(B)))) {
- if (A == Op0) { // B^(B|A) == (A|B)^B
- Op1I->swapOperands();
- I.swapOperands();
- std::swap(Op0, Op1);
- } else if (B == Op0) { // B^(A|B) == (A|B)^B
- I.swapOperands(); // Simplified below.
- std::swap(Op0, Op1);
- }
- } else if (match(Op1I, m_Xor(m_Value(A), m_Value(B)))) {
- if (Op0 == A) // A^(A^B) == B
- return ReplaceInstUsesWith(I, B);
- else if (Op0 == B) // A^(B^A) == B
- return ReplaceInstUsesWith(I, A);
- } else if (match(Op1I, m_And(m_Value(A), m_Value(B))) && Op1I->hasOneUse()){
- if (A == Op0) { // A^(A&B) -> A^(B&A)
- Op1I->swapOperands();
- std::swap(A, B);
- }
- if (B == Op0) { // A^(B&A) -> (B&A)^A
- I.swapOperands(); // Simplified below.
- std::swap(Op0, Op1);
- }
- }
- }
-
- BinaryOperator *Op0I = dyn_cast<BinaryOperator>(Op0);
- if (Op0I) {
- Value *A, *B;
- if (match(Op0I, m_Or(m_Value(A), m_Value(B))) && Op0I->hasOneUse()) {
- if (A == Op1) // (B|A)^B == (A|B)^B
- std::swap(A, B);
- if (B == Op1) { // (A|B)^B == A & ~B
- Instruction *NotB =
- InsertNewInstBefore(BinaryOperator::createNot(Op1, "tmp"), I);
- return BinaryOperator::createAnd(A, NotB);
- }
- } else if (match(Op0I, m_Xor(m_Value(A), m_Value(B)))) {
- if (Op1 == A) // (A^B)^A == B
- return ReplaceInstUsesWith(I, B);
- else if (Op1 == B) // (B^A)^A == B
- return ReplaceInstUsesWith(I, A);
- } else if (match(Op0I, m_And(m_Value(A), m_Value(B))) && Op0I->hasOneUse()){
- if (A == Op1) // (A&B)^A -> (B&A)^A
- std::swap(A, B);
- if (B == Op1 && // (B&A)^A == ~B & A
- !isa<ConstantInt>(Op1)) { // Canonical form is (B&C)^C
- Instruction *N =
- InsertNewInstBefore(BinaryOperator::createNot(A, "tmp"), I);
- return BinaryOperator::createAnd(N, Op1);
- }
- }
- }
-
- // (X >> Z) ^ (Y >> Z) -> (X^Y) >> Z for all shifts.
- if (Op0I && Op1I && Op0I->isShift() &&
- Op0I->getOpcode() == Op1I->getOpcode() &&
- Op0I->getOperand(1) == Op1I->getOperand(1) &&
- (Op1I->hasOneUse() || Op1I->hasOneUse())) {
- Instruction *NewOp =
- InsertNewInstBefore(BinaryOperator::createXor(Op0I->getOperand(0),
- Op1I->getOperand(0),
- Op0I->getName()), I);
- return BinaryOperator::create(Op1I->getOpcode(), NewOp,
- Op1I->getOperand(1));
- }
-
- if (Op0I && Op1I) {
- Value *A, *B, *C, *D;
- // (A & B)^(A | B) -> A ^ B
- if (match(Op0I, m_And(m_Value(A), m_Value(B))) &&
- match(Op1I, m_Or(m_Value(C), m_Value(D)))) {
- if ((A == C && B == D) || (A == D && B == C))
- return BinaryOperator::createXor(A, B);
- }
- // (A | B)^(A & B) -> A ^ B
- if (match(Op0I, m_Or(m_Value(A), m_Value(B))) &&
- match(Op1I, m_And(m_Value(C), m_Value(D)))) {
- if ((A == C && B == D) || (A == D && B == C))
- return BinaryOperator::createXor(A, B);
- }
-
- // (A & B)^(C & D)
- if ((Op0I->hasOneUse() || Op1I->hasOneUse()) &&
- match(Op0I, m_And(m_Value(A), m_Value(B))) &&
- match(Op1I, m_And(m_Value(C), m_Value(D)))) {
- // (X & Y)^(X & Y) -> (Y^Z) & X
- Value *X = 0, *Y = 0, *Z = 0;
- if (A == C)
- X = A, Y = B, Z = D;
- else if (A == D)
- X = A, Y = B, Z = C;
- else if (B == C)
- X = B, Y = A, Z = D;
- else if (B == D)
- X = B, Y = A, Z = C;
-
- if (X) {
- Instruction *NewOp =
- InsertNewInstBefore(BinaryOperator::createXor(Y, Z, Op0->getName()), I);
- return BinaryOperator::createAnd(NewOp, X);
- }
- }
- }
-
- // (icmp1 A, B) ^ (icmp2 A, B) --> (icmp3 A, B)
- if (ICmpInst *RHS = dyn_cast<ICmpInst>(I.getOperand(1)))
- if (Instruction *R = AssociativeOpt(I, FoldICmpLogical(*this, RHS)))
- return R;
-
- // fold (xor (cast A), (cast B)) -> (cast (xor A, B))
- if (CastInst *Op0C = dyn_cast<CastInst>(Op0)) {
- if (CastInst *Op1C = dyn_cast<CastInst>(Op1))
- if (Op0C->getOpcode() == Op1C->getOpcode()) { // same cast kind?
- const Type *SrcTy = Op0C->getOperand(0)->getType();
- if (SrcTy == Op1C->getOperand(0)->getType() && SrcTy->isInteger() &&
- // Only do this if the casts both really cause code to be generated.
- ValueRequiresCast(Op0C->getOpcode(), Op0C->getOperand(0),
- I.getType(), TD) &&
- ValueRequiresCast(Op1C->getOpcode(), Op1C->getOperand(0),
- I.getType(), TD)) {
- Instruction *NewOp = BinaryOperator::createXor(Op0C->getOperand(0),
- Op1C->getOperand(0),
- I.getName());
- InsertNewInstBefore(NewOp, I);
- return CastInst::create(Op0C->getOpcode(), NewOp, I.getType());
- }
- }
- }
- return Changed ? &I : 0;
-}
-
-/// AddWithOverflow - Compute Result = In1+In2, returning true if the result
-/// overflowed for this type.
-static bool AddWithOverflow(ConstantInt *&Result, ConstantInt *In1,
- ConstantInt *In2, bool IsSigned = false) {
- Result = cast<ConstantInt>(Add(In1, In2));
-
- if (IsSigned)
- if (In2->getValue().isNegative())
- return Result->getValue().sgt(In1->getValue());
- else
- return Result->getValue().slt(In1->getValue());
- else
- return Result->getValue().ult(In1->getValue());
-}
-
-/// EmitGEPOffset - Given a getelementptr instruction/constantexpr, emit the
-/// code necessary to compute the offset from the base pointer (without adding
-/// in the base pointer). Return the result as a signed integer of intptr size.
-static Value *EmitGEPOffset(User *GEP, Instruction &I, InstCombiner &IC) {
- TargetData &TD = IC.getTargetData();
- gep_type_iterator GTI = gep_type_begin(GEP);
- const Type *IntPtrTy = TD.getIntPtrType();
- Value *Result = Constant::getNullValue(IntPtrTy);
-
- // Build a mask for high order bits.
- unsigned IntPtrWidth = TD.getPointerSizeInBits();
- uint64_t PtrSizeMask = ~0ULL >> (64-IntPtrWidth);
-
- for (unsigned i = 1, e = GEP->getNumOperands(); i != e; ++i, ++GTI) {
- Value *Op = GEP->getOperand(i);
- uint64_t Size = TD.getABITypeSize(GTI.getIndexedType()) & PtrSizeMask;
- if (ConstantInt *OpC = dyn_cast<ConstantInt>(Op)) {
- if (OpC->isZero()) continue;
-
- // Handle a struct index, which adds its field offset to the pointer.
- if (const StructType *STy = dyn_cast<StructType>(*GTI)) {
- Size = TD.getStructLayout(STy)->getElementOffset(OpC->getZExtValue());
-
- if (ConstantInt *RC = dyn_cast<ConstantInt>(Result))
- Result = ConstantInt::get(RC->getValue() + APInt(IntPtrWidth, Size));
- else
- Result = IC.InsertNewInstBefore(
- BinaryOperator::createAdd(Result,
- ConstantInt::get(IntPtrTy, Size),
- GEP->getName()+".offs"), I);
- continue;
- }
-
- Constant *Scale = ConstantInt::get(IntPtrTy, Size);
- Constant *OC = ConstantExpr::getIntegerCast(OpC, IntPtrTy, true /*SExt*/);
- Scale = ConstantExpr::getMul(OC, Scale);
- if (Constant *RC = dyn_cast<Constant>(Result))
- Result = ConstantExpr::getAdd(RC, Scale);
- else {
- // Emit an add instruction.
- Result = IC.InsertNewInstBefore(
- BinaryOperator::createAdd(Result, Scale,
- GEP->getName()+".offs"), I);
- }
- continue;
- }
- // Convert to correct type.
- if (Op->getType() != IntPtrTy) {
- if (Constant *OpC = dyn_cast<Constant>(Op))
- Op = ConstantExpr::getSExt(OpC, IntPtrTy);
- else
- Op = IC.InsertNewInstBefore(new SExtInst(Op, IntPtrTy,
- Op->getName()+".c"), I);
- }
- if (Size != 1) {
- Constant *Scale = ConstantInt::get(IntPtrTy, Size);
- if (Constant *OpC = dyn_cast<Constant>(Op))
- Op = ConstantExpr::getMul(OpC, Scale);
- else // We'll let instcombine(mul) convert this to a shl if possible.
- Op = IC.InsertNewInstBefore(BinaryOperator::createMul(Op, Scale,
- GEP->getName()+".idx"), I);
- }
-
- // Emit an add instruction.
- if (isa<Constant>(Op) && isa<Constant>(Result))
- Result = ConstantExpr::getAdd(cast<Constant>(Op),
- cast<Constant>(Result));
- else
- Result = IC.InsertNewInstBefore(BinaryOperator::createAdd(Op, Result,
- GEP->getName()+".offs"), I);
- }
- return Result;
-}
-
-
-/// EvaluateGEPOffsetExpression - Return an value that can be used to compare of
-/// the *offset* implied by GEP to zero. For example, if we have &A[i], we want
-/// to return 'i' for "icmp ne i, 0". Note that, in general, indices can be
-/// complex, and scales are involved. The above expression would also be legal
-/// to codegen as "icmp ne (i*4), 0" (assuming A is a pointer to i32). This
-/// later form is less amenable to optimization though, and we are allowed to
-/// generate the first by knowing that pointer arithmetic doesn't overflow.
-///
-/// If we can't emit an optimized form for this expression, this returns null.
-///
-static Value *EvaluateGEPOffsetExpression(User *GEP, Instruction &I,
- InstCombiner &IC) {
- TargetData &TD = IC.getTargetData();
- gep_type_iterator GTI = gep_type_begin(GEP);
-
- // Check to see if this gep only has a single variable index. If so, and if
- // any constant indices are a multiple of its scale, then we can compute this
- // in terms of the scale of the variable index. For example, if the GEP
- // implies an offset of "12 + i*4", then we can codegen this as "3 + i",
- // because the expression will cross zero at the same point.
- unsigned i, e = GEP->getNumOperands();
- int64_t Offset = 0;
- for (i = 1; i != e; ++i, ++GTI) {
- if (ConstantInt *CI = dyn_cast<ConstantInt>(GEP->getOperand(i))) {
- // Compute the aggregate offset of constant indices.
- if (CI->isZero()) continue;
-
- // Handle a struct index, which adds its field offset to the pointer.
- if (const StructType *STy = dyn_cast<StructType>(*GTI)) {
- Offset += TD.getStructLayout(STy)->getElementOffset(CI->getZExtValue());
- } else {
- uint64_t Size = TD.getABITypeSize(GTI.getIndexedType());
- Offset += Size*CI->getSExtValue();
- }
- } else {
- // Found our variable index.
- break;
- }
- }
-
- // If there are no variable indices, we must have a constant offset, just
- // evaluate it the general way.
- if (i == e) return 0;
-
- Value *VariableIdx = GEP->getOperand(i);
- // Determine the scale factor of the variable element. For example, this is
- // 4 if the variable index is into an array of i32.
- uint64_t VariableScale = TD.getABITypeSize(GTI.getIndexedType());
-
- // Verify that there are no other variable indices. If so, emit the hard way.
- for (++i, ++GTI; i != e; ++i, ++GTI) {
- ConstantInt *CI = dyn_cast<ConstantInt>(GEP->getOperand(i));
- if (!CI) return 0;
-
- // Compute the aggregate offset of constant indices.
- if (CI->isZero()) continue;
-
- // Handle a struct index, which adds its field offset to the pointer.
- if (const StructType *STy = dyn_cast<StructType>(*GTI)) {
- Offset += TD.getStructLayout(STy)->getElementOffset(CI->getZExtValue());
- } else {
- uint64_t Size = TD.getABITypeSize(GTI.getIndexedType());
- Offset += Size*CI->getSExtValue();
- }
- }
-
- // Okay, we know we have a single variable index, which must be a
- // pointer/array/vector index. If there is no offset, life is simple, return
- // the index.
- unsigned IntPtrWidth = TD.getPointerSizeInBits();
- if (Offset == 0) {
- // Cast to intptrty in case a truncation occurs. If an extension is needed,
- // we don't need to bother extending: the extension won't affect where the
- // computation crosses zero.
- if (VariableIdx->getType()->getPrimitiveSizeInBits() > IntPtrWidth)
- VariableIdx = new TruncInst(VariableIdx, TD.getIntPtrType(),
- VariableIdx->getNameStart(), &I);
- return VariableIdx;
- }
-
- // Otherwise, there is an index. The computation we will do will be modulo
- // the pointer size, so get it.
- uint64_t PtrSizeMask = ~0ULL >> (64-IntPtrWidth);
-
- Offset &= PtrSizeMask;
- VariableScale &= PtrSizeMask;
-
- // To do this transformation, any constant index must be a multiple of the
- // variable scale factor. For example, we can evaluate "12 + 4*i" as "3 + i",
- // but we can't evaluate "10 + 3*i" in terms of i. Check that the offset is a
- // multiple of the variable scale.
- int64_t NewOffs = Offset / (int64_t)VariableScale;
- if (Offset != NewOffs*(int64_t)VariableScale)
- return 0;
-
- // Okay, we can do this evaluation. Start by converting the index to intptr.
- const Type *IntPtrTy = TD.getIntPtrType();
- if (VariableIdx->getType() != IntPtrTy)
- VariableIdx = CastInst::createIntegerCast(VariableIdx, IntPtrTy,
- true /*SExt*/,
- VariableIdx->getNameStart(), &I);
- Constant *OffsetVal = ConstantInt::get(IntPtrTy, NewOffs);
- return BinaryOperator::createAdd(VariableIdx, OffsetVal, "offset", &I);
-}
-
-
-/// FoldGEPICmp - Fold comparisons between a GEP instruction and something
-/// else. At this point we know that the GEP is on the LHS of the comparison.
-Instruction *InstCombiner::FoldGEPICmp(User *GEPLHS, Value *RHS,
- ICmpInst::Predicate Cond,
- Instruction &I) {
- assert(dyn_castGetElementPtr(GEPLHS) && "LHS is not a getelementptr!");
-
- // Look through bitcasts.
- if (BitCastInst *BCI = dyn_cast<BitCastInst>(RHS))
- RHS = BCI->getOperand(0);
-
- Value *PtrBase = GEPLHS->getOperand(0);
- if (PtrBase == RHS) {
- // ((gep Ptr, OFFSET) cmp Ptr) ---> (OFFSET cmp 0).
- // This transformation (ignoring the base and scales) is valid because we
- // know pointers can't overflow. See if we can output an optimized form.
- Value *Offset = EvaluateGEPOffsetExpression(GEPLHS, I, *this);
-
- // If not, synthesize the offset the hard way.
- if (Offset == 0)
- Offset = EmitGEPOffset(GEPLHS, I, *this);
- return new ICmpInst(ICmpInst::getSignedPredicate(Cond), Offset,
- Constant::getNullValue(Offset->getType()));
- } else if (User *GEPRHS = dyn_castGetElementPtr(RHS)) {
- // If the base pointers are different, but the indices are the same, just
- // compare the base pointer.
- if (PtrBase != GEPRHS->getOperand(0)) {
- bool IndicesTheSame = GEPLHS->getNumOperands()==GEPRHS->getNumOperands();
- IndicesTheSame &= GEPLHS->getOperand(0)->getType() ==
- GEPRHS->getOperand(0)->getType();
- if (IndicesTheSame)
- for (unsigned i = 1, e = GEPLHS->getNumOperands(); i != e; ++i)
- if (GEPLHS->getOperand(i) != GEPRHS->getOperand(i)) {
- IndicesTheSame = false;
- break;
- }
-
- // If all indices are the same, just compare the base pointers.
- if (IndicesTheSame)
- return new ICmpInst(ICmpInst::getSignedPredicate(Cond),
- GEPLHS->getOperand(0), GEPRHS->getOperand(0));
-
- // Otherwise, the base pointers are different and the indices are
- // different, bail out.
- return 0;
- }
-
- // If one of the GEPs has all zero indices, recurse.
- bool AllZeros = true;
- for (unsigned i = 1, e = GEPLHS->getNumOperands(); i != e; ++i)
- if (!isa<Constant>(GEPLHS->getOperand(i)) ||
- !cast<Constant>(GEPLHS->getOperand(i))->isNullValue()) {
- AllZeros = false;
- break;
- }
- if (AllZeros)
- return FoldGEPICmp(GEPRHS, GEPLHS->getOperand(0),
- ICmpInst::getSwappedPredicate(Cond), I);
-
- // If the other GEP has all zero indices, recurse.
- AllZeros = true;
- for (unsigned i = 1, e = GEPRHS->getNumOperands(); i != e; ++i)
- if (!isa<Constant>(GEPRHS->getOperand(i)) ||
- !cast<Constant>(GEPRHS->getOperand(i))->isNullValue()) {
- AllZeros = false;
- break;
- }
- if (AllZeros)
- return FoldGEPICmp(GEPLHS, GEPRHS->getOperand(0), Cond, I);
-
- if (GEPLHS->getNumOperands() == GEPRHS->getNumOperands()) {
- // If the GEPs only differ by one index, compare it.
- unsigned NumDifferences = 0; // Keep track of # differences.
- unsigned DiffOperand = 0; // The operand that differs.
- for (unsigned i = 1, e = GEPRHS->getNumOperands(); i != e; ++i)
- if (GEPLHS->getOperand(i) != GEPRHS->getOperand(i)) {
- if (GEPLHS->getOperand(i)->getType()->getPrimitiveSizeInBits() !=
- GEPRHS->getOperand(i)->getType()->getPrimitiveSizeInBits()) {
- // Irreconcilable differences.
- NumDifferences = 2;
- break;
- } else {
- if (NumDifferences++) break;
- DiffOperand = i;
- }
- }
-
- if (NumDifferences == 0) // SAME GEP?
- return ReplaceInstUsesWith(I, // No comparison is needed here.
- ConstantInt::get(Type::Int1Ty,
- isTrueWhenEqual(Cond)));
-
- else if (NumDifferences == 1) {
- Value *LHSV = GEPLHS->getOperand(DiffOperand);
- Value *RHSV = GEPRHS->getOperand(DiffOperand);
- // Make sure we do a signed comparison here.
- return new ICmpInst(ICmpInst::getSignedPredicate(Cond), LHSV, RHSV);
- }
- }
-
- // Only lower this if the icmp is the only user of the GEP or if we expect
- // the result to fold to a constant!
- if ((isa<ConstantExpr>(GEPLHS) || GEPLHS->hasOneUse()) &&
- (isa<ConstantExpr>(GEPRHS) || GEPRHS->hasOneUse())) {
- // ((gep Ptr, OFFSET1) cmp (gep Ptr, OFFSET2) ---> (OFFSET1 cmp OFFSET2)
- Value *L = EmitGEPOffset(GEPLHS, I, *this);
- Value *R = EmitGEPOffset(GEPRHS, I, *this);
- return new ICmpInst(ICmpInst::getSignedPredicate(Cond), L, R);
- }
- }
- return 0;
-}
-
-Instruction *InstCombiner::visitFCmpInst(FCmpInst &I) {
- bool Changed = SimplifyCompare(I);
- Value *Op0 = I.getOperand(0), *Op1 = I.getOperand(1);
-
- // Fold trivial predicates.
- if (I.getPredicate() == FCmpInst::FCMP_FALSE)
- return ReplaceInstUsesWith(I, Constant::getNullValue(Type::Int1Ty));
- if (I.getPredicate() == FCmpInst::FCMP_TRUE)
- return ReplaceInstUsesWith(I, ConstantInt::get(Type::Int1Ty, 1));
-
- // Simplify 'fcmp pred X, X'
- if (Op0 == Op1) {
- switch (I.getPredicate()) {
- default: assert(0 && "Unknown predicate!");
- case FCmpInst::FCMP_UEQ: // True if unordered or equal
- case FCmpInst::FCMP_UGE: // True if unordered, greater than, or equal
- case FCmpInst::FCMP_ULE: // True if unordered, less than, or equal
- return ReplaceInstUsesWith(I, ConstantInt::get(Type::Int1Ty, 1));
- case FCmpInst::FCMP_OGT: // True if ordered and greater than
- case FCmpInst::FCMP_OLT: // True if ordered and less than
- case FCmpInst::FCMP_ONE: // True if ordered and operands are unequal
- return ReplaceInstUsesWith(I, ConstantInt::get(Type::Int1Ty, 0));
-
- case FCmpInst::FCMP_UNO: // True if unordered: isnan(X) | isnan(Y)
- case FCmpInst::FCMP_ULT: // True if unordered or less than
- case FCmpInst::FCMP_UGT: // True if unordered or greater than
- case FCmpInst::FCMP_UNE: // True if unordered or not equal
- // Canonicalize these to be 'fcmp uno %X, 0.0'.
- I.setPredicate(FCmpInst::FCMP_UNO);
- I.setOperand(1, Constant::getNullValue(Op0->getType()));
- return &I;
-
- case FCmpInst::FCMP_ORD: // True if ordered (no nans)
- case FCmpInst::FCMP_OEQ: // True if ordered and equal
- case FCmpInst::FCMP_OGE: // True if ordered and greater than or equal
- case FCmpInst::FCMP_OLE: // True if ordered and less than or equal
- // Canonicalize these to be 'fcmp ord %X, 0.0'.
- I.setPredicate(FCmpInst::FCMP_ORD);
- I.setOperand(1, Constant::getNullValue(Op0->getType()));
- return &I;
- }
- }
-
- if (isa<UndefValue>(Op1)) // fcmp pred X, undef -> undef
- return ReplaceInstUsesWith(I, UndefValue::get(Type::Int1Ty));
-
- // Handle fcmp with constant RHS
- if (Constant *RHSC = dyn_cast<Constant>(Op1)) {
- if (Instruction *LHSI = dyn_cast<Instruction>(Op0))
- switch (LHSI->getOpcode()) {
- case Instruction::PHI:
- if (Instruction *NV = FoldOpIntoPhi(I))
- return NV;
- break;
- case Instruction::Select:
- // If either operand of the select is a constant, we can fold the
- // comparison into the select arms, which will cause one to be
- // constant folded and the select turned into a bitwise or.
- Value *Op1 = 0, *Op2 = 0;
- if (LHSI->hasOneUse()) {
- if (Constant *C = dyn_cast<Constant>(LHSI->getOperand(1))) {
- // Fold the known value into the constant operand.
- Op1 = ConstantExpr::getCompare(I.getPredicate(), C, RHSC);
- // Insert a new FCmp of the other select operand.
- Op2 = InsertNewInstBefore(new FCmpInst(I.getPredicate(),
- LHSI->getOperand(2), RHSC,
- I.getName()), I);
- } else if (Constant *C = dyn_cast<Constant>(LHSI->getOperand(2))) {
- // Fold the known value into the constant operand.
- Op2 = ConstantExpr::getCompare(I.getPredicate(), C, RHSC);
- // Insert a new FCmp of the other select operand.
- Op1 = InsertNewInstBefore(new FCmpInst(I.getPredicate(),
- LHSI->getOperand(1), RHSC,
- I.getName()), I);
- }
- }
-
- if (Op1)
- return SelectInst::Create(LHSI->getOperand(0), Op1, Op2);
- break;
- }
- }
-
- return Changed ? &I : 0;
-}
-
-Instruction *InstCombiner::visitICmpInst(ICmpInst &I) {
- bool Changed = SimplifyCompare(I);
- Value *Op0 = I.getOperand(0), *Op1 = I.getOperand(1);
- const Type *Ty = Op0->getType();
-
- // icmp X, X
- if (Op0 == Op1)
- return ReplaceInstUsesWith(I, ConstantInt::get(Type::Int1Ty,
- isTrueWhenEqual(I)));
-
- if (isa<UndefValue>(Op1)) // X icmp undef -> undef
- return ReplaceInstUsesWith(I, UndefValue::get(Type::Int1Ty));
-
- // icmp <global/alloca*/null>, <global/alloca*/null> - Global/Stack value
- // addresses never equal each other! We already know that Op0 != Op1.
- if ((isa<GlobalValue>(Op0) || isa<AllocaInst>(Op0) ||
- isa<ConstantPointerNull>(Op0)) &&
- (isa<GlobalValue>(Op1) || isa<AllocaInst>(Op1) ||
- isa<ConstantPointerNull>(Op1)))
- return ReplaceInstUsesWith(I, ConstantInt::get(Type::Int1Ty,
- !isTrueWhenEqual(I)));
-
- // icmp's with boolean values can always be turned into bitwise operations
- if (Ty == Type::Int1Ty) {
- switch (I.getPredicate()) {
- default: assert(0 && "Invalid icmp instruction!");
- case ICmpInst::ICMP_EQ: { // icmp eq bool %A, %B -> ~(A^B)
- Instruction *Xor = BinaryOperator::createXor(Op0, Op1, I.getName()+"tmp");
- InsertNewInstBefore(Xor, I);
- return BinaryOperator::createNot(Xor);
- }
- case ICmpInst::ICMP_NE: // icmp eq bool %A, %B -> A^B
- return BinaryOperator::createXor(Op0, Op1);
-
- case ICmpInst::ICMP_UGT:
- case ICmpInst::ICMP_SGT:
- std::swap(Op0, Op1); // Change icmp gt -> icmp lt
- // FALL THROUGH
- case ICmpInst::ICMP_ULT:
- case ICmpInst::ICMP_SLT: { // icmp lt bool A, B -> ~X & Y
- Instruction *Not = BinaryOperator::createNot(Op0, I.getName()+"tmp");
- InsertNewInstBefore(Not, I);
- return BinaryOperator::createAnd(Not, Op1);
- }
- case ICmpInst::ICMP_UGE:
- case ICmpInst::ICMP_SGE:
- std::swap(Op0, Op1); // Change icmp ge -> icmp le
- // FALL THROUGH
- case ICmpInst::ICMP_ULE:
- case ICmpInst::ICMP_SLE: { // icmp le bool %A, %B -> ~A | B
- Instruction *Not = BinaryOperator::createNot(Op0, I.getName()+"tmp");
- InsertNewInstBefore(Not, I);
- return BinaryOperator::createOr(Not, Op1);
- }
- }
- }
-
- // See if we are doing a comparison between a constant and an instruction that
- // can be folded into the comparison.
- if (ConstantInt *CI = dyn_cast<ConstantInt>(Op1)) {
- Value *A, *B;
-
- // (icmp ne/eq (sub A B) 0) -> (icmp ne/eq A, B)
- if (I.isEquality() && CI->isNullValue() &&
- match(Op0, m_Sub(m_Value(A), m_Value(B)))) {
- // (icmp cond A B) if cond is equality
- return new ICmpInst(I.getPredicate(), A, B);
- }
-
- switch (I.getPredicate()) {
- default: break;
- case ICmpInst::ICMP_ULT: // A <u MIN -> FALSE
- if (CI->isMinValue(false))
- return ReplaceInstUsesWith(I, ConstantInt::getFalse());
- if (CI->isMaxValue(false)) // A <u MAX -> A != MAX
- return new ICmpInst(ICmpInst::ICMP_NE, Op0,Op1);
- if (isMinValuePlusOne(CI,false)) // A <u MIN+1 -> A == MIN
- return new ICmpInst(ICmpInst::ICMP_EQ, Op0, SubOne(CI));
- // (x <u 2147483648) -> (x >s -1) -> true if sign bit clear
- if (CI->isMinValue(true))
- return new ICmpInst(ICmpInst::ICMP_SGT, Op0,
- ConstantInt::getAllOnesValue(Op0->getType()));
-
- break;
-
- case ICmpInst::ICMP_SLT:
- if (CI->isMinValue(true)) // A <s MIN -> FALSE
- return ReplaceInstUsesWith(I, ConstantInt::getFalse());
- if (CI->isMaxValue(true)) // A <s MAX -> A != MAX
- return new ICmpInst(ICmpInst::ICMP_NE, Op0, Op1);
- if (isMinValuePlusOne(CI,true)) // A <s MIN+1 -> A == MIN
- return new ICmpInst(ICmpInst::ICMP_EQ, Op0, SubOne(CI));
- break;
-
- case ICmpInst::ICMP_UGT:
- if (CI->isMaxValue(false)) // A >u MAX -> FALSE
- return ReplaceInstUsesWith(I, ConstantInt::getFalse());
- if (CI->isMinValue(false)) // A >u MIN -> A != MIN
- return new ICmpInst(ICmpInst::ICMP_NE, Op0, Op1);
- if (isMaxValueMinusOne(CI, false)) // A >u MAX-1 -> A == MAX
- return new ICmpInst(ICmpInst::ICMP_EQ, Op0, AddOne(CI));
-
- // (x >u 2147483647) -> (x <s 0) -> true if sign bit set
- if (CI->isMaxValue(true))
- return new ICmpInst(ICmpInst::ICMP_SLT, Op0,
- ConstantInt::getNullValue(Op0->getType()));
- break;
-
- case ICmpInst::ICMP_SGT:
- if (CI->isMaxValue(true)) // A >s MAX -> FALSE
- return ReplaceInstUsesWith(I, ConstantInt::getFalse());
- if (CI->isMinValue(true)) // A >s MIN -> A != MIN
- return new ICmpInst(ICmpInst::ICMP_NE, Op0, Op1);
- if (isMaxValueMinusOne(CI, true)) // A >s MAX-1 -> A == MAX
- return new ICmpInst(ICmpInst::ICMP_EQ, Op0, AddOne(CI));
- break;
-
- case ICmpInst::ICMP_ULE:
- if (CI->isMaxValue(false)) // A <=u MAX -> TRUE
- return ReplaceInstUsesWith(I, ConstantInt::getTrue());
- if (CI->isMinValue(false)) // A <=u MIN -> A == MIN
- return new ICmpInst(ICmpInst::ICMP_EQ, Op0, Op1);
- if (isMaxValueMinusOne(CI,false)) // A <=u MAX-1 -> A != MAX
- return new ICmpInst(ICmpInst::ICMP_NE, Op0, AddOne(CI));
- break;
-
- case ICmpInst::ICMP_SLE:
- if (CI->isMaxValue(true)) // A <=s MAX -> TRUE
- return ReplaceInstUsesWith(I, ConstantInt::getTrue());
- if (CI->isMinValue(true)) // A <=s MIN -> A == MIN
- return new ICmpInst(ICmpInst::ICMP_EQ, Op0, Op1);
- if (isMaxValueMinusOne(CI,true)) // A <=s MAX-1 -> A != MAX
- return new ICmpInst(ICmpInst::ICMP_NE, Op0, AddOne(CI));
- break;
-
- case ICmpInst::ICMP_UGE:
- if (CI->isMinValue(false)) // A >=u MIN -> TRUE
- return ReplaceInstUsesWith(I, ConstantInt::getTrue());
- if (CI->isMaxValue(false)) // A >=u MAX -> A == MAX
- return new ICmpInst(ICmpInst::ICMP_EQ, Op0, Op1);
- if (isMinValuePlusOne(CI,false)) // A >=u MIN-1 -> A != MIN
- return new ICmpInst(ICmpInst::ICMP_NE, Op0, SubOne(CI));
- break;
-
- case ICmpInst::ICMP_SGE:
- if (CI->isMinValue(true)) // A >=s MIN -> TRUE
- return ReplaceInstUsesWith(I, ConstantInt::getTrue());
- if (CI->isMaxValue(true)) // A >=s MAX -> A == MAX
- return new ICmpInst(ICmpInst::ICMP_EQ, Op0, Op1);
- if (isMinValuePlusOne(CI,true)) // A >=s MIN-1 -> A != MIN
- return new ICmpInst(ICmpInst::ICMP_NE, Op0, SubOne(CI));
- break;
- }
-
- // If we still have a icmp le or icmp ge instruction, turn it into the
- // appropriate icmp lt or icmp gt instruction. Since the border cases have
- // already been handled above, this requires little checking.
- //
- switch (I.getPredicate()) {
- default: break;
- case ICmpInst::ICMP_ULE:
- return new ICmpInst(ICmpInst::ICMP_ULT, Op0, AddOne(CI));
- case ICmpInst::ICMP_SLE:
- return new ICmpInst(ICmpInst::ICMP_SLT, Op0, AddOne(CI));
- case ICmpInst::ICMP_UGE:
- return new ICmpInst( ICmpInst::ICMP_UGT, Op0, SubOne(CI));
- case ICmpInst::ICMP_SGE:
- return new ICmpInst(ICmpInst::ICMP_SGT, Op0, SubOne(CI));
- }
-
- // See if we can fold the comparison based on bits known to be zero or one
- // in the input. If this comparison is a normal comparison, it demands all
- // bits, if it is a sign bit comparison, it only demands the sign bit.
-
- bool UnusedBit;
- bool isSignBit = isSignBitCheck(I.getPredicate(), CI, UnusedBit);
-
- uint32_t BitWidth = cast<IntegerType>(Ty)->getBitWidth();
- APInt KnownZero(BitWidth, 0), KnownOne(BitWidth, 0);
- if (SimplifyDemandedBits(Op0,
- isSignBit ? APInt::getSignBit(BitWidth)
- : APInt::getAllOnesValue(BitWidth),
- KnownZero, KnownOne, 0))
- return &I;
-
- // Given the known and unknown bits, compute a range that the LHS could be
- // in.
- if ((KnownOne | KnownZero) != 0) {
- // Compute the Min, Max and RHS values based on the known bits. For the
- // EQ and NE we use unsigned values.
- APInt Min(BitWidth, 0), Max(BitWidth, 0);
- const APInt& RHSVal = CI->getValue();
- if (ICmpInst::isSignedPredicate(I.getPredicate())) {
- ComputeSignedMinMaxValuesFromKnownBits(Ty, KnownZero, KnownOne, Min,
- Max);
- } else {
- ComputeUnsignedMinMaxValuesFromKnownBits(Ty, KnownZero, KnownOne, Min,
- Max);
- }
- switch (I.getPredicate()) { // LE/GE have been folded already.
- default: assert(0 && "Unknown icmp opcode!");
- case ICmpInst::ICMP_EQ:
- if (Max.ult(RHSVal) || Min.ugt(RHSVal))
- return ReplaceInstUsesWith(I, ConstantInt::getFalse());
- break;
- case ICmpInst::ICMP_NE:
- if (Max.ult(RHSVal) || Min.ugt(RHSVal))
- return ReplaceInstUsesWith(I, ConstantInt::getTrue());
- break;
- case ICmpInst::ICMP_ULT:
- if (Max.ult(RHSVal))
- return ReplaceInstUsesWith(I, ConstantInt::getTrue());
- if (Min.uge(RHSVal))
- return ReplaceInstUsesWith(I, ConstantInt::getFalse());
- break;
- case ICmpInst::ICMP_UGT:
- if (Min.ugt(RHSVal))
- return ReplaceInstUsesWith(I, ConstantInt::getTrue());
- if (Max.ule(RHSVal))
- return ReplaceInstUsesWith(I, ConstantInt::getFalse());
- break;
- case ICmpInst::ICMP_SLT:
- if (Max.slt(RHSVal))
- return ReplaceInstUsesWith(I, ConstantInt::getTrue());
- if (Min.sgt(RHSVal))
- return ReplaceInstUsesWith(I, ConstantInt::getFalse());
- break;
- case ICmpInst::ICMP_SGT:
- if (Min.sgt(RHSVal))
- return ReplaceInstUsesWith(I, ConstantInt::getTrue());
- if (Max.sle(RHSVal))
- return ReplaceInstUsesWith(I, ConstantInt::getFalse());
- break;
- }
- }
-
- // Since the RHS is a ConstantInt (CI), if the left hand side is an
- // instruction, see if that instruction also has constants so that the
- // instruction can be folded into the icmp
- if (Instruction *LHSI = dyn_cast<Instruction>(Op0))
- if (Instruction *Res = visitICmpInstWithInstAndIntCst(I, LHSI, CI))
- return Res;
- }
-
- // Handle icmp with constant (but not simple integer constant) RHS
- if (Constant *RHSC = dyn_cast<Constant>(Op1)) {
- if (Instruction *LHSI = dyn_cast<Instruction>(Op0))
- switch (LHSI->getOpcode()) {
- case Instruction::GetElementPtr:
- if (RHSC->isNullValue()) {
- // icmp pred GEP (P, int 0, int 0, int 0), null -> icmp pred P, null
- bool isAllZeros = true;
- for (unsigned i = 1, e = LHSI->getNumOperands(); i != e; ++i)
- if (!isa<Constant>(LHSI->getOperand(i)) ||
- !cast<Constant>(LHSI->getOperand(i))->isNullValue()) {
- isAllZeros = false;
- break;
- }
- if (isAllZeros)
- return new ICmpInst(I.getPredicate(), LHSI->getOperand(0),
- Constant::getNullValue(LHSI->getOperand(0)->getType()));
- }
- break;
-
- case Instruction::PHI:
- if (Instruction *NV = FoldOpIntoPhi(I))
- return NV;
- break;
- case Instruction::Select: {
- // If either operand of the select is a constant, we can fold the
- // comparison into the select arms, which will cause one to be
- // constant folded and the select turned into a bitwise or.
- Value *Op1 = 0, *Op2 = 0;
- if (LHSI->hasOneUse()) {
- if (Constant *C = dyn_cast<Constant>(LHSI->getOperand(1))) {
- // Fold the known value into the constant operand.
- Op1 = ConstantExpr::getICmp(I.getPredicate(), C, RHSC);
- // Insert a new ICmp of the other select operand.
- Op2 = InsertNewInstBefore(new ICmpInst(I.getPredicate(),
- LHSI->getOperand(2), RHSC,
- I.getName()), I);
- } else if (Constant *C = dyn_cast<Constant>(LHSI->getOperand(2))) {
- // Fold the known value into the constant operand.
- Op2 = ConstantExpr::getICmp(I.getPredicate(), C, RHSC);
- // Insert a new ICmp of the other select operand.
- Op1 = InsertNewInstBefore(new ICmpInst(I.getPredicate(),
- LHSI->getOperand(1), RHSC,
- I.getName()), I);
- }
- }
-
- if (Op1)
- return SelectInst::Create(LHSI->getOperand(0), Op1, Op2);
- break;
- }
- case Instruction::Malloc:
- // If we have (malloc != null), and if the malloc has a single use, we
- // can assume it is successful and remove the malloc.
- if (LHSI->hasOneUse() && isa<ConstantPointerNull>(RHSC)) {
- AddToWorkList(LHSI);
- return ReplaceInstUsesWith(I, ConstantInt::get(Type::Int1Ty,
- !isTrueWhenEqual(I)));
- }
- break;
- }
- }
-
- // If we can optimize a 'icmp GEP, P' or 'icmp P, GEP', do so now.
- if (User *GEP = dyn_castGetElementPtr(Op0))
- if (Instruction *NI = FoldGEPICmp(GEP, Op1, I.getPredicate(), I))
- return NI;
- if (User *GEP = dyn_castGetElementPtr(Op1))
- if (Instruction *NI = FoldGEPICmp(GEP, Op0,
- ICmpInst::getSwappedPredicate(I.getPredicate()), I))
- return NI;
-
- // Test to see if the operands of the icmp are casted versions of other
- // values. If the ptr->ptr cast can be stripped off both arguments, we do so
- // now.
- if (BitCastInst *CI = dyn_cast<BitCastInst>(Op0)) {
- if (isa<PointerType>(Op0->getType()) &&
- (isa<Constant>(Op1) || isa<BitCastInst>(Op1))) {
- // We keep moving the cast from the left operand over to the right
- // operand, where it can often be eliminated completely.
- Op0 = CI->getOperand(0);
-
- // If operand #1 is a bitcast instruction, it must also be a ptr->ptr cast
- // so eliminate it as well.
- if (BitCastInst *CI2 = dyn_cast<BitCastInst>(Op1))
- Op1 = CI2->getOperand(0);
-
- // If Op1 is a constant, we can fold the cast into the constant.
- if (Op0->getType() != Op1->getType()) {
- if (Constant *Op1C = dyn_cast<Constant>(Op1)) {
- Op1 = ConstantExpr::getBitCast(Op1C, Op0->getType());
- } else {
- // Otherwise, cast the RHS right before the icmp
- Op1 = InsertBitCastBefore(Op1, Op0->getType(), I);
- }
- }
- return new ICmpInst(I.getPredicate(), Op0, Op1);
- }
- }
-
- if (isa<CastInst>(Op0)) {
- // Handle the special case of: icmp (cast bool to X), <cst>
- // This comes up when you have code like
- // int X = A < B;
- // if (X) ...
- // For generality, we handle any zero-extension of any operand comparison
- // with a constant or another cast from the same type.
- if (isa<ConstantInt>(Op1) || isa<CastInst>(Op1))
- if (Instruction *R = visitICmpInstWithCastAndCast(I))
- return R;
- }
-
- // ~x < ~y --> y < x
- { Value *A, *B;
- if (match(Op0, m_Not(m_Value(A))) &&
- match(Op1, m_Not(m_Value(B))))
- return new ICmpInst(I.getPredicate(), B, A);
- }
-
- if (I.isEquality()) {
- Value *A, *B, *C, *D;
-
- // -x == -y --> x == y
- if (match(Op0, m_Neg(m_Value(A))) &&
- match(Op1, m_Neg(m_Value(B))))
- return new ICmpInst(I.getPredicate(), A, B);
-
- if (match(Op0, m_Xor(m_Value(A), m_Value(B)))) {
- if (A == Op1 || B == Op1) { // (A^B) == A -> B == 0
- Value *OtherVal = A == Op1 ? B : A;
- return new ICmpInst(I.getPredicate(), OtherVal,
- Constant::getNullValue(A->getType()));
- }
-
- if (match(Op1, m_Xor(m_Value(C), m_Value(D)))) {
- // A^c1 == C^c2 --> A == C^(c1^c2)
- if (ConstantInt *C1 = dyn_cast<ConstantInt>(B))
- if (ConstantInt *C2 = dyn_cast<ConstantInt>(D))
- if (Op1->hasOneUse()) {
- Constant *NC = ConstantInt::get(C1->getValue() ^ C2->getValue());
- Instruction *Xor = BinaryOperator::createXor(C, NC, "tmp");
- return new ICmpInst(I.getPredicate(), A,
- InsertNewInstBefore(Xor, I));
- }
-
- // A^B == A^D -> B == D
- if (A == C) return new ICmpInst(I.getPredicate(), B, D);
- if (A == D) return new ICmpInst(I.getPredicate(), B, C);
- if (B == C) return new ICmpInst(I.getPredicate(), A, D);
- if (B == D) return new ICmpInst(I.getPredicate(), A, C);
- }
- }
-
- if (match(Op1, m_Xor(m_Value(A), m_Value(B))) &&
- (A == Op0 || B == Op0)) {
- // A == (A^B) -> B == 0
- Value *OtherVal = A == Op0 ? B : A;
- return new ICmpInst(I.getPredicate(), OtherVal,
- Constant::getNullValue(A->getType()));
- }
- if (match(Op0, m_Sub(m_Value(A), m_Value(B))) && A == Op1) {
- // (A-B) == A -> B == 0
- return new ICmpInst(I.getPredicate(), B,
- Constant::getNullValue(B->getType()));
- }
- if (match(Op1, m_Sub(m_Value(A), m_Value(B))) && A == Op0) {
- // A == (A-B) -> B == 0
- return new ICmpInst(I.getPredicate(), B,
- Constant::getNullValue(B->getType()));
- }
-
- // (X&Z) == (Y&Z) -> (X^Y) & Z == 0
- if (Op0->hasOneUse() && Op1->hasOneUse() &&
- match(Op0, m_And(m_Value(A), m_Value(B))) &&
- match(Op1, m_And(m_Value(C), m_Value(D)))) {
- Value *X = 0, *Y = 0, *Z = 0;
-
- if (A == C) {
- X = B; Y = D; Z = A;
- } else if (A == D) {
- X = B; Y = C; Z = A;
- } else if (B == C) {
- X = A; Y = D; Z = B;
- } else if (B == D) {
- X = A; Y = C; Z = B;
- }
-
- if (X) { // Build (X^Y) & Z
- Op1 = InsertNewInstBefore(BinaryOperator::createXor(X, Y, "tmp"), I);
- Op1 = InsertNewInstBefore(BinaryOperator::createAnd(Op1, Z, "tmp"), I);
- I.setOperand(0, Op1);
- I.setOperand(1, Constant::getNullValue(Op1->getType()));
- return &I;
- }
- }
- }
- return Changed ? &I : 0;
-}
-
-
-/// FoldICmpDivCst - Fold "icmp pred, ([su]div X, DivRHS), CmpRHS" where DivRHS
-/// and CmpRHS are both known to be integer constants.
-Instruction *InstCombiner::FoldICmpDivCst(ICmpInst &ICI, BinaryOperator *DivI,
- ConstantInt *DivRHS) {
- ConstantInt *CmpRHS = cast<ConstantInt>(ICI.getOperand(1));
- const APInt &CmpRHSV = CmpRHS->getValue();
-
- // FIXME: If the operand types don't match the type of the divide
- // then don't attempt this transform. The code below doesn't have the
- // logic to deal with a signed divide and an unsigned compare (and
- // vice versa). This is because (x /s C1) <s C2 produces different
- // results than (x /s C1) <u C2 or (x /u C1) <s C2 or even
- // (x /u C1) <u C2. Simply casting the operands and result won't
- // work. :( The if statement below tests that condition and bails
- // if it finds it.
- bool DivIsSigned = DivI->getOpcode() == Instruction::SDiv;
- if (!ICI.isEquality() && DivIsSigned != ICI.isSignedPredicate())
- return 0;
- if (DivRHS->isZero())
- return 0; // The ProdOV computation fails on divide by zero.
-
- // Compute Prod = CI * DivRHS. We are essentially solving an equation
- // of form X/C1=C2. We solve for X by multiplying C1 (DivRHS) and
- // C2 (CI). By solving for X we can turn this into a range check
- // instead of computing a divide.
- ConstantInt *Prod = Multiply(CmpRHS, DivRHS);
-
- // Determine if the product overflows by seeing if the product is
- // not equal to the divide. Make sure we do the same kind of divide
- // as in the LHS instruction that we're folding.
- bool ProdOV = (DivIsSigned ? ConstantExpr::getSDiv(Prod, DivRHS) :
- ConstantExpr::getUDiv(Prod, DivRHS)) != CmpRHS;
-
- // Get the ICmp opcode
- ICmpInst::Predicate Pred = ICI.getPredicate();
-
- // Figure out the interval that is being checked. For example, a comparison
- // like "X /u 5 == 0" is really checking that X is in the interval [0, 5).
- // Compute this interval based on the constants involved and the signedness of
- // the compare/divide. This computes a half-open interval, keeping track of
- // whether either value in the interval overflows. After analysis each
- // overflow variable is set to 0 if it's corresponding bound variable is valid
- // -1 if overflowed off the bottom end, or +1 if overflowed off the top end.
- int LoOverflow = 0, HiOverflow = 0;
- ConstantInt *LoBound = 0, *HiBound = 0;
-
-
- if (!DivIsSigned) { // udiv
- // e.g. X/5 op 3 --> [15, 20)
- LoBound = Prod;
- HiOverflow = LoOverflow = ProdOV;
- if (!HiOverflow)
- HiOverflow = AddWithOverflow(HiBound, LoBound, DivRHS, false);
- } else if (DivRHS->getValue().isStrictlyPositive()) { // Divisor is > 0.
- if (CmpRHSV == 0) { // (X / pos) op 0
- // Can't overflow. e.g. X/2 op 0 --> [-1, 2)
- LoBound = cast<ConstantInt>(ConstantExpr::getNeg(SubOne(DivRHS)));
- HiBound = DivRHS;
- } else if (CmpRHSV.isStrictlyPositive()) { // (X / pos) op pos
- LoBound = Prod; // e.g. X/5 op 3 --> [15, 20)
- HiOverflow = LoOverflow = ProdOV;
- if (!HiOverflow)
- HiOverflow = AddWithOverflow(HiBound, Prod, DivRHS, true);
- } else { // (X / pos) op neg
- // e.g. X/5 op -3 --> [-15-4, -15+1) --> [-19, -14)
- Constant *DivRHSH = ConstantExpr::getNeg(SubOne(DivRHS));
- LoOverflow = AddWithOverflow(LoBound, Prod,
- cast<ConstantInt>(DivRHSH), true) ? -1 : 0;
- HiBound = AddOne(Prod);
- HiOverflow = ProdOV ? -1 : 0;
- }
- } else if (DivRHS->getValue().isNegative()) { // Divisor is < 0.
- if (CmpRHSV == 0) { // (X / neg) op 0
- // e.g. X/-5 op 0 --> [-4, 5)
- LoBound = AddOne(DivRHS);
- HiBound = cast<ConstantInt>(ConstantExpr::getNeg(DivRHS));
- if (HiBound == DivRHS) { // -INTMIN = INTMIN
- HiOverflow = 1; // [INTMIN+1, overflow)
- HiBound = 0; // e.g. X/INTMIN = 0 --> X > INTMIN
- }
- } else if (CmpRHSV.isStrictlyPositive()) { // (X / neg) op pos
- // e.g. X/-5 op 3 --> [-19, -14)
- HiOverflow = LoOverflow = ProdOV ? -1 : 0;
- if (!LoOverflow)
- LoOverflow = AddWithOverflow(LoBound, Prod, AddOne(DivRHS), true) ?-1:0;
- HiBound = AddOne(Prod);
- } else { // (X / neg) op neg
- // e.g. X/-5 op -3 --> [15, 20)
- LoBound = Prod;
- LoOverflow = HiOverflow = ProdOV ? 1 : 0;
- HiBound = Subtract(Prod, DivRHS);
- }
-
- // Dividing by a negative swaps the condition. LT <-> GT
- Pred = ICmpInst::getSwappedPredicate(Pred);
- }
-
- Value *X = DivI->getOperand(0);
- switch (Pred) {
- default: assert(0 && "Unhandled icmp opcode!");
- case ICmpInst::ICMP_EQ:
- if (LoOverflow && HiOverflow)
- return ReplaceInstUsesWith(ICI, ConstantInt::getFalse());
- else if (HiOverflow)
- return new ICmpInst(DivIsSigned ? ICmpInst::ICMP_SGE :
- ICmpInst::ICMP_UGE, X, LoBound);
- else if (LoOverflow)
- return new ICmpInst(DivIsSigned ? ICmpInst::ICMP_SLT :
- ICmpInst::ICMP_ULT, X, HiBound);
- else
- return InsertRangeTest(X, LoBound, HiBound, DivIsSigned, true, ICI);
- case ICmpInst::ICMP_NE:
- if (LoOverflow && HiOverflow)
- return ReplaceInstUsesWith(ICI, ConstantInt::getTrue());
- else if (HiOverflow)
- return new ICmpInst(DivIsSigned ? ICmpInst::ICMP_SLT :
- ICmpInst::ICMP_ULT, X, LoBound);
- else if (LoOverflow)
- return new ICmpInst(DivIsSigned ? ICmpInst::ICMP_SGE :
- ICmpInst::ICMP_UGE, X, HiBound);
- else
- return InsertRangeTest(X, LoBound, HiBound, DivIsSigned, false, ICI);
- case ICmpInst::ICMP_ULT:
- case ICmpInst::ICMP_SLT:
- if (LoOverflow == +1) // Low bound is greater than input range.
- return ReplaceInstUsesWith(ICI, ConstantInt::getTrue());
- if (LoOverflow == -1) // Low bound is less than input range.
- return ReplaceInstUsesWith(ICI, ConstantInt::getFalse());
- return new ICmpInst(Pred, X, LoBound);
- case ICmpInst::ICMP_UGT:
- case ICmpInst::ICMP_SGT:
- if (HiOverflow == +1) // High bound greater than input range.
- return ReplaceInstUsesWith(ICI, ConstantInt::getFalse());
- else if (HiOverflow == -1) // High bound less than input range.
- return ReplaceInstUsesWith(ICI, ConstantInt::getTrue());
- if (Pred == ICmpInst::ICMP_UGT)
- return new ICmpInst(ICmpInst::ICMP_UGE, X, HiBound);
- else
- return new ICmpInst(ICmpInst::ICMP_SGE, X, HiBound);
- }
-}
-
-
-/// visitICmpInstWithInstAndIntCst - Handle "icmp (instr, intcst)".
-///
-Instruction *InstCombiner::visitICmpInstWithInstAndIntCst(ICmpInst &ICI,
- Instruction *LHSI,
- ConstantInt *RHS) {
- const APInt &RHSV = RHS->getValue();
-
- switch (LHSI->getOpcode()) {
- case Instruction::Xor: // (icmp pred (xor X, XorCST), CI)
- if (ConstantInt *XorCST = dyn_cast<ConstantInt>(LHSI->getOperand(1))) {
- // If this is a comparison that tests the signbit (X < 0) or (x > -1),
- // fold the xor.
- if ((ICI.getPredicate() == ICmpInst::ICMP_SLT && RHSV == 0) ||
- (ICI.getPredicate() == ICmpInst::ICMP_SGT && RHSV.isAllOnesValue())) {
- Value *CompareVal = LHSI->getOperand(0);
-
- // If the sign bit of the XorCST is not set, there is no change to
- // the operation, just stop using the Xor.
- if (!XorCST->getValue().isNegative()) {
- ICI.setOperand(0, CompareVal);
- AddToWorkList(LHSI);
- return &ICI;
- }
-
- // Was the old condition true if the operand is positive?
- bool isTrueIfPositive = ICI.getPredicate() == ICmpInst::ICMP_SGT;
-
- // If so, the new one isn't.
- isTrueIfPositive ^= true;
-
- if (isTrueIfPositive)
- return new ICmpInst(ICmpInst::ICMP_SGT, CompareVal, SubOne(RHS));
- else
- return new ICmpInst(ICmpInst::ICMP_SLT, CompareVal, AddOne(RHS));
- }
- }
- break;
- case Instruction::And: // (icmp pred (and X, AndCST), RHS)
- if (LHSI->hasOneUse() && isa<ConstantInt>(LHSI->getOperand(1)) &&
- LHSI->getOperand(0)->hasOneUse()) {
- ConstantInt *AndCST = cast<ConstantInt>(LHSI->getOperand(1));
-
- // If the LHS is an AND of a truncating cast, we can widen the
- // and/compare to be the input width without changing the value
- // produced, eliminating a cast.
- if (TruncInst *Cast = dyn_cast<TruncInst>(LHSI->getOperand(0))) {
- // We can do this transformation if either the AND constant does not
- // have its sign bit set or if it is an equality comparison.
- // Extending a relational comparison when we're checking the sign
- // bit would not work.
- if (Cast->hasOneUse() &&
- (ICI.isEquality() ||
- (AndCST->getValue().isNonNegative() && RHSV.isNonNegative()))) {
- uint32_t BitWidth =
- cast<IntegerType>(Cast->getOperand(0)->getType())->getBitWidth();
- APInt NewCST = AndCST->getValue();
- NewCST.zext(BitWidth);
- APInt NewCI = RHSV;
- NewCI.zext(BitWidth);
- Instruction *NewAnd =
- BinaryOperator::createAnd(Cast->getOperand(0),
- ConstantInt::get(NewCST),LHSI->getName());
- InsertNewInstBefore(NewAnd, ICI);
- return new ICmpInst(ICI.getPredicate(), NewAnd,
- ConstantInt::get(NewCI));
- }
- }
-
- // If this is: (X >> C1) & C2 != C3 (where any shift and any compare
- // could exist), turn it into (X & (C2 << C1)) != (C3 << C1). This
- // happens a LOT in code produced by the C front-end, for bitfield
- // access.
- BinaryOperator *Shift = dyn_cast<BinaryOperator>(LHSI->getOperand(0));
- if (Shift && !Shift->isShift())
- Shift = 0;
-
- ConstantInt *ShAmt;
- ShAmt = Shift ? dyn_cast<ConstantInt>(Shift->getOperand(1)) : 0;
- const Type *Ty = Shift ? Shift->getType() : 0; // Type of the shift.
- const Type *AndTy = AndCST->getType(); // Type of the and.
-
- // We can fold this as long as we can't shift unknown bits
- // into the mask. This can only happen with signed shift
- // rights, as they sign-extend.
- if (ShAmt) {
- bool CanFold = Shift->isLogicalShift();
- if (!CanFold) {
- // To test for the bad case of the signed shr, see if any
- // of the bits shifted in could be tested after the mask.
- uint32_t TyBits = Ty->getPrimitiveSizeInBits();
- int ShAmtVal = TyBits - ShAmt->getLimitedValue(TyBits);
-
- uint32_t BitWidth = AndTy->getPrimitiveSizeInBits();
- if ((APInt::getHighBitsSet(BitWidth, BitWidth-ShAmtVal) &
- AndCST->getValue()) == 0)
- CanFold = true;
- }
-
- if (CanFold) {
- Constant *NewCst;
- if (Shift->getOpcode() == Instruction::Shl)
- NewCst = ConstantExpr::getLShr(RHS, ShAmt);
- else
- NewCst = ConstantExpr::getShl(RHS, ShAmt);
-
- // Check to see if we are shifting out any of the bits being
- // compared.
- if (ConstantExpr::get(Shift->getOpcode(), NewCst, ShAmt) != RHS) {
- // If we shifted bits out, the fold is not going to work out.
- // As a special case, check to see if this means that the
- // result is always true or false now.
- if (ICI.getPredicate() == ICmpInst::ICMP_EQ)
- return ReplaceInstUsesWith(ICI, ConstantInt::getFalse());
- if (ICI.getPredicate() == ICmpInst::ICMP_NE)
- return ReplaceInstUsesWith(ICI, ConstantInt::getTrue());
- } else {
- ICI.setOperand(1, NewCst);
- Constant *NewAndCST;
- if (Shift->getOpcode() == Instruction::Shl)
- NewAndCST = ConstantExpr::getLShr(AndCST, ShAmt);
- else
- NewAndCST = ConstantExpr::getShl(AndCST, ShAmt);
- LHSI->setOperand(1, NewAndCST);
- LHSI->setOperand(0, Shift->getOperand(0));
- AddToWorkList(Shift); // Shift is dead.
- AddUsesToWorkList(ICI);
- return &ICI;
- }
- }
- }
-
- // Turn ((X >> Y) & C) == 0 into (X & (C << Y)) == 0. The later is
- // preferable because it allows the C<<Y expression to be hoisted out
- // of a loop if Y is invariant and X is not.
- if (Shift && Shift->hasOneUse() && RHSV == 0 &&
- ICI.isEquality() && !Shift->isArithmeticShift() &&
- isa<Instruction>(Shift->getOperand(0))) {
- // Compute C << Y.
- Value *NS;
- if (Shift->getOpcode() == Instruction::LShr) {
- NS = BinaryOperator::createShl(AndCST,
- Shift->getOperand(1), "tmp");
- } else {
- // Insert a logical shift.
- NS = BinaryOperator::createLShr(AndCST,
- Shift->getOperand(1), "tmp");
- }
- InsertNewInstBefore(cast<Instruction>(NS), ICI);
-
- // Compute X & (C << Y).
- Instruction *NewAnd =
- BinaryOperator::createAnd(Shift->getOperand(0), NS, LHSI->getName());
- InsertNewInstBefore(NewAnd, ICI);
-
- ICI.setOperand(0, NewAnd);
- return &ICI;
- }
- }
- break;
-
- case Instruction::Shl: { // (icmp pred (shl X, ShAmt), CI)
- ConstantInt *ShAmt = dyn_cast<ConstantInt>(LHSI->getOperand(1));
- if (!ShAmt) break;
-
- uint32_t TypeBits = RHSV.getBitWidth();
-
- // Check that the shift amount is in range. If not, don't perform
- // undefined shifts. When the shift is visited it will be
- // simplified.
- if (ShAmt->uge(TypeBits))
- break;
-
- if (ICI.isEquality()) {
- // If we are comparing against bits always shifted out, the
- // comparison cannot succeed.
- Constant *Comp =
- ConstantExpr::getShl(ConstantExpr::getLShr(RHS, ShAmt), ShAmt);
- if (Comp != RHS) {// Comparing against a bit that we know is zero.
- bool IsICMP_NE = ICI.getPredicate() == ICmpInst::ICMP_NE;
- Constant *Cst = ConstantInt::get(Type::Int1Ty, IsICMP_NE);
- return ReplaceInstUsesWith(ICI, Cst);
- }
-
- if (LHSI->hasOneUse()) {
- // Otherwise strength reduce the shift into an and.
- uint32_t ShAmtVal = (uint32_t)ShAmt->getLimitedValue(TypeBits);
- Constant *Mask =
- ConstantInt::get(APInt::getLowBitsSet(TypeBits, TypeBits-ShAmtVal));
-
- Instruction *AndI =
- BinaryOperator::createAnd(LHSI->getOperand(0),
- Mask, LHSI->getName()+".mask");
- Value *And = InsertNewInstBefore(AndI, ICI);
- return new ICmpInst(ICI.getPredicate(), And,
- ConstantInt::get(RHSV.lshr(ShAmtVal)));
- }
- }
-
- // Otherwise, if this is a comparison of the sign bit, simplify to and/test.
- bool TrueIfSigned = false;
- if (LHSI->hasOneUse() &&
- isSignBitCheck(ICI.getPredicate(), RHS, TrueIfSigned)) {
- // (X << 31) <s 0 --> (X&1) != 0
- Constant *Mask = ConstantInt::get(APInt(TypeBits, 1) <<
- (TypeBits-ShAmt->getZExtValue()-1));
- Instruction *AndI =
- BinaryOperator::createAnd(LHSI->getOperand(0),
- Mask, LHSI->getName()+".mask");
- Value *And = InsertNewInstBefore(AndI, ICI);
-
- return new ICmpInst(TrueIfSigned ? ICmpInst::ICMP_NE : ICmpInst::ICMP_EQ,
- And, Constant::getNullValue(And->getType()));
- }
- break;
- }
-
- case Instruction::LShr: // (icmp pred (shr X, ShAmt), CI)
- case Instruction::AShr: {
- // Only handle equality comparisons of shift-by-constant.
- ConstantInt *ShAmt = dyn_cast<ConstantInt>(LHSI->getOperand(1));
- if (!ShAmt || !ICI.isEquality()) break;
-
- // Check that the shift amount is in range. If not, don't perform
- // undefined shifts. When the shift is visited it will be
- // simplified.
- uint32_t TypeBits = RHSV.getBitWidth();
- if (ShAmt->uge(TypeBits))
- break;
-
- uint32_t ShAmtVal = (uint32_t)ShAmt->getLimitedValue(TypeBits);
-
- // If we are comparing against bits always shifted out, the
- // comparison cannot succeed.
- APInt Comp = RHSV << ShAmtVal;
- if (LHSI->getOpcode() == Instruction::LShr)
- Comp = Comp.lshr(ShAmtVal);
- else
- Comp = Comp.ashr(ShAmtVal);
-
- if (Comp != RHSV) { // Comparing against a bit that we know is zero.
- bool IsICMP_NE = ICI.getPredicate() == ICmpInst::ICMP_NE;
- Constant *Cst = ConstantInt::get(Type::Int1Ty, IsICMP_NE);
- return ReplaceInstUsesWith(ICI, Cst);
- }
-
- // Otherwise, check to see if the bits shifted out are known to be zero.
- // If so, we can compare against the unshifted value:
- // (X & 4) >> 1 == 2 --> (X & 4) == 4.
- if (LHSI->hasOneUse() &&
- MaskedValueIsZero(LHSI->getOperand(0),
- APInt::getLowBitsSet(Comp.getBitWidth(), ShAmtVal))) {
- return new ICmpInst(ICI.getPredicate(), LHSI->getOperand(0),
- ConstantExpr::getShl(RHS, ShAmt));
- }
-
- if (LHSI->hasOneUse()) {
- // Otherwise strength reduce the shift into an and.
- APInt Val(APInt::getHighBitsSet(TypeBits, TypeBits - ShAmtVal));
- Constant *Mask = ConstantInt::get(Val);
-
- Instruction *AndI =
- BinaryOperator::createAnd(LHSI->getOperand(0),
- Mask, LHSI->getName()+".mask");
- Value *And = InsertNewInstBefore(AndI, ICI);
- return new ICmpInst(ICI.getPredicate(), And,
- ConstantExpr::getShl(RHS, ShAmt));
- }
- break;
- }
-
- case Instruction::SDiv:
- case Instruction::UDiv:
- // Fold: icmp pred ([us]div X, C1), C2 -> range test
- // Fold this div into the comparison, producing a range check.
- // Determine, based on the divide type, what the range is being
- // checked. If there is an overflow on the low or high side, remember
- // it, otherwise compute the range [low, hi) bounding the new value.
- // See: InsertRangeTest above for the kinds of replacements possible.
- if (ConstantInt *DivRHS = dyn_cast<ConstantInt>(LHSI->getOperand(1)))
- if (Instruction *R = FoldICmpDivCst(ICI, cast<BinaryOperator>(LHSI),
- DivRHS))
- return R;
- break;
-
- case Instruction::Add:
- // Fold: icmp pred (add, X, C1), C2
-
- if (!ICI.isEquality()) {
- ConstantInt *LHSC = dyn_cast<ConstantInt>(LHSI->getOperand(1));
- if (!LHSC) break;
- const APInt &LHSV = LHSC->getValue();
-
- ConstantRange CR = ICI.makeConstantRange(ICI.getPredicate(), RHSV)
- .subtract(LHSV);
-
- if (ICI.isSignedPredicate()) {
- if (CR.getLower().isSignBit()) {
- return new ICmpInst(ICmpInst::ICMP_SLT, LHSI->getOperand(0),
- ConstantInt::get(CR.getUpper()));
- } else if (CR.getUpper().isSignBit()) {
- return new ICmpInst(ICmpInst::ICMP_SGE, LHSI->getOperand(0),
- ConstantInt::get(CR.getLower()));
- }
- } else {
- if (CR.getLower().isMinValue()) {
- return new ICmpInst(ICmpInst::ICMP_ULT, LHSI->getOperand(0),
- ConstantInt::get(CR.getUpper()));
- } else if (CR.getUpper().isMinValue()) {
- return new ICmpInst(ICmpInst::ICMP_UGE, LHSI->getOperand(0),
- ConstantInt::get(CR.getLower()));
- }
- }
- }
- break;
- }
-
- // Simplify icmp_eq and icmp_ne instructions with integer constant RHS.
- if (ICI.isEquality()) {
- bool isICMP_NE = ICI.getPredicate() == ICmpInst::ICMP_NE;
-
- // If the first operand is (add|sub|and|or|xor|rem) with a constant, and
- // the second operand is a constant, simplify a bit.
- if (BinaryOperator *BO = dyn_cast<BinaryOperator>(LHSI)) {
- switch (BO->getOpcode()) {
- case Instruction::SRem:
- // If we have a signed (X % (2^c)) == 0, turn it into an unsigned one.
- if (RHSV == 0 && isa<ConstantInt>(BO->getOperand(1)) &&BO->hasOneUse()){
- const APInt &V = cast<ConstantInt>(BO->getOperand(1))->getValue();
- if (V.sgt(APInt(V.getBitWidth(), 1)) && V.isPowerOf2()) {
- Instruction *NewRem =
- BinaryOperator::createURem(BO->getOperand(0), BO->getOperand(1),
- BO->getName());
- InsertNewInstBefore(NewRem, ICI);
- return new ICmpInst(ICI.getPredicate(), NewRem,
- Constant::getNullValue(BO->getType()));
- }
- }
- break;
- case Instruction::Add:
- // Replace ((add A, B) != C) with (A != C-B) if B & C are constants.
- if (ConstantInt *BOp1C = dyn_cast<ConstantInt>(BO->getOperand(1))) {
- if (BO->hasOneUse())
- return new ICmpInst(ICI.getPredicate(), BO->getOperand(0),
- Subtract(RHS, BOp1C));
- } else if (RHSV == 0) {
- // Replace ((add A, B) != 0) with (A != -B) if A or B is
- // efficiently invertible, or if the add has just this one use.
- Value *BOp0 = BO->getOperand(0), *BOp1 = BO->getOperand(1);
-
- if (Value *NegVal = dyn_castNegVal(BOp1))
- return new ICmpInst(ICI.getPredicate(), BOp0, NegVal);
- else if (Value *NegVal = dyn_castNegVal(BOp0))
- return new ICmpInst(ICI.getPredicate(), NegVal, BOp1);
- else if (BO->hasOneUse()) {
- Instruction *Neg = BinaryOperator::createNeg(BOp1);
- InsertNewInstBefore(Neg, ICI);
- Neg->takeName(BO);
- return new ICmpInst(ICI.getPredicate(), BOp0, Neg);
- }
- }
- break;
- case Instruction::Xor:
- // For the xor case, we can xor two constants together, eliminating
- // the explicit xor.
- if (Constant *BOC = dyn_cast<Constant>(BO->getOperand(1)))
- return new ICmpInst(ICI.getPredicate(), BO->getOperand(0),
- ConstantExpr::getXor(RHS, BOC));
-
- // FALLTHROUGH
- case Instruction::Sub:
- // Replace (([sub|xor] A, B) != 0) with (A != B)
- if (RHSV == 0)
- return new ICmpInst(ICI.getPredicate(), BO->getOperand(0),
- BO->getOperand(1));
- break;
-
- case Instruction::Or:
- // If bits are being or'd in that are not present in the constant we
- // are comparing against, then the comparison could never succeed!
- if (Constant *BOC = dyn_cast<Constant>(BO->getOperand(1))) {
- Constant *NotCI = ConstantExpr::getNot(RHS);
- if (!ConstantExpr::getAnd(BOC, NotCI)->isNullValue())
- return ReplaceInstUsesWith(ICI, ConstantInt::get(Type::Int1Ty,
- isICMP_NE));
- }
- break;
-
- case Instruction::And:
- if (ConstantInt *BOC = dyn_cast<ConstantInt>(BO->getOperand(1))) {
- // If bits are being compared against that are and'd out, then the
- // comparison can never succeed!
- if ((RHSV & ~BOC->getValue()) != 0)
- return ReplaceInstUsesWith(ICI, ConstantInt::get(Type::Int1Ty,
- isICMP_NE));
-
- // If we have ((X & C) == C), turn it into ((X & C) != 0).
- if (RHS == BOC && RHSV.isPowerOf2())
- return new ICmpInst(isICMP_NE ? ICmpInst::ICMP_EQ :
- ICmpInst::ICMP_NE, LHSI,
- Constant::getNullValue(RHS->getType()));
-
- // Replace (and X, (1 << size(X)-1) != 0) with x s< 0
- if (isSignBit(BOC)) {
- Value *X = BO->getOperand(0);
- Constant *Zero = Constant::getNullValue(X->getType());
- ICmpInst::Predicate pred = isICMP_NE ?
- ICmpInst::ICMP_SLT : ICmpInst::ICMP_SGE;
- return new ICmpInst(pred, X, Zero);
- }
-
- // ((X & ~7) == 0) --> X < 8
- if (RHSV == 0 && isHighOnes(BOC)) {
- Value *X = BO->getOperand(0);
- Constant *NegX = ConstantExpr::getNeg(BOC);
- ICmpInst::Predicate pred = isICMP_NE ?
- ICmpInst::ICMP_UGE : ICmpInst::ICMP_ULT;
- return new ICmpInst(pred, X, NegX);
- }
- }
- default: break;
- }
- } else if (IntrinsicInst *II = dyn_cast<IntrinsicInst>(LHSI)) {
- // Handle icmp {eq|ne} <intrinsic>, intcst.
- if (II->getIntrinsicID() == Intrinsic::bswap) {
- AddToWorkList(II);
- ICI.setOperand(0, II->getOperand(1));
- ICI.setOperand(1, ConstantInt::get(RHSV.byteSwap()));
- return &ICI;
- }
- }
- } else { // Not a ICMP_EQ/ICMP_NE
- // If the LHS is a cast from an integral value of the same size,
- // then since we know the RHS is a constant, try to simlify.
- if (CastInst *Cast = dyn_cast<CastInst>(LHSI)) {
- Value *CastOp = Cast->getOperand(0);
- const Type *SrcTy = CastOp->getType();
- uint32_t SrcTySize = SrcTy->getPrimitiveSizeInBits();
- if (SrcTy->isInteger() &&
- SrcTySize == Cast->getType()->getPrimitiveSizeInBits()) {
- // If this is an unsigned comparison, try to make the comparison use
- // smaller constant values.
- if (ICI.getPredicate() == ICmpInst::ICMP_ULT && RHSV.isSignBit()) {
- // X u< 128 => X s> -1
- return new ICmpInst(ICmpInst::ICMP_SGT, CastOp,
- ConstantInt::get(APInt::getAllOnesValue(SrcTySize)));
- } else if (ICI.getPredicate() == ICmpInst::ICMP_UGT &&
- RHSV == APInt::getSignedMaxValue(SrcTySize)) {
- // X u> 127 => X s< 0
- return new ICmpInst(ICmpInst::ICMP_SLT, CastOp,
- Constant::getNullValue(SrcTy));
- }
- }
- }
- }
- return 0;
-}
-
-/// visitICmpInstWithCastAndCast - Handle icmp (cast x to y), (cast/cst).
-/// We only handle extending casts so far.
-///
-Instruction *InstCombiner::visitICmpInstWithCastAndCast(ICmpInst &ICI) {
- const CastInst *LHSCI = cast<CastInst>(ICI.getOperand(0));
- Value *LHSCIOp = LHSCI->getOperand(0);
- const Type *SrcTy = LHSCIOp->getType();
- const Type *DestTy = LHSCI->getType();
- Value *RHSCIOp;
-
- // Turn icmp (ptrtoint x), (ptrtoint/c) into a compare of the input if the
- // integer type is the same size as the pointer type.
- if (LHSCI->getOpcode() == Instruction::PtrToInt &&
- getTargetData().getPointerSizeInBits() ==
- cast<IntegerType>(DestTy)->getBitWidth()) {
- Value *RHSOp = 0;
- if (Constant *RHSC = dyn_cast<Constant>(ICI.getOperand(1))) {
- RHSOp = ConstantExpr::getIntToPtr(RHSC, SrcTy);
- } else if (PtrToIntInst *RHSC = dyn_cast<PtrToIntInst>(ICI.getOperand(1))) {
- RHSOp = RHSC->getOperand(0);
- // If the pointer types don't match, insert a bitcast.
- if (LHSCIOp->getType() != RHSOp->getType())
- RHSOp = InsertBitCastBefore(RHSOp, LHSCIOp->getType(), ICI);
- }
-
- if (RHSOp)
- return new ICmpInst(ICI.getPredicate(), LHSCIOp, RHSOp);
- }
-
- // The code below only handles extension cast instructions, so far.
- // Enforce this.
- if (LHSCI->getOpcode() != Instruction::ZExt &&
- LHSCI->getOpcode() != Instruction::SExt)
- return 0;
-
- bool isSignedExt = LHSCI->getOpcode() == Instruction::SExt;
- bool isSignedCmp = ICI.isSignedPredicate();
-
- if (CastInst *CI = dyn_cast<CastInst>(ICI.getOperand(1))) {
- // Not an extension from the same type?
- RHSCIOp = CI->getOperand(0);
- if (RHSCIOp->getType() != LHSCIOp->getType())
- return 0;
-
- // If the signedness of the two casts doesn't agree (i.e. one is a sext
- // and the other is a zext), then we can't handle this.
- if (CI->getOpcode() != LHSCI->getOpcode())
- return 0;
-
- // Deal with equality cases early.
- if (ICI.isEquality())
- return new ICmpInst(ICI.getPredicate(), LHSCIOp, RHSCIOp);
-
- // A signed comparison of sign extended values simplifies into a
- // signed comparison.
- if (isSignedCmp && isSignedExt)
- return new ICmpInst(ICI.getPredicate(), LHSCIOp, RHSCIOp);
-
- // The other three cases all fold into an unsigned comparison.
- return new ICmpInst(ICI.getUnsignedPredicate(), LHSCIOp, RHSCIOp);
- }
-
- // If we aren't dealing with a constant on the RHS, exit early
- ConstantInt *CI = dyn_cast<ConstantInt>(ICI.getOperand(1));
- if (!CI)
- return 0;
-
- // Compute the constant that would happen if we truncated to SrcTy then
- // reextended to DestTy.
- Constant *Res1 = ConstantExpr::getTrunc(CI, SrcTy);
- Constant *Res2 = ConstantExpr::getCast(LHSCI->getOpcode(), Res1, DestTy);
-
- // If the re-extended constant didn't change...
- if (Res2 == CI) {
- // Make sure that sign of the Cmp and the sign of the Cast are the same.
- // For example, we might have:
- // %A = sext short %X to uint
- // %B = icmp ugt uint %A, 1330
- // It is incorrect to transform this into
- // %B = icmp ugt short %X, 1330
- // because %A may have negative value.
- //
- // However, it is OK if SrcTy is bool (See cast-set.ll testcase)
- // OR operation is EQ/NE.
- if (isSignedExt == isSignedCmp || SrcTy == Type::Int1Ty || ICI.isEquality())
- return new ICmpInst(ICI.getPredicate(), LHSCIOp, Res1);
- else
- return 0;
- }
-
- // The re-extended constant changed so the constant cannot be represented
- // in the shorter type. Consequently, we cannot emit a simple comparison.
-
- // First, handle some easy cases. We know the result cannot be equal at this
- // point so handle the ICI.isEquality() cases
- if (ICI.getPredicate() == ICmpInst::ICMP_EQ)
- return ReplaceInstUsesWith(ICI, ConstantInt::getFalse());
- if (ICI.getPredicate() == ICmpInst::ICMP_NE)
- return ReplaceInstUsesWith(ICI, ConstantInt::getTrue());
-
- // Evaluate the comparison for LT (we invert for GT below). LE and GE cases
- // should have been folded away previously and not enter in here.
- Value *Result;
- if (isSignedCmp) {
- // We're performing a signed comparison.
- if (cast<ConstantInt>(CI)->getValue().isNegative())
- Result = ConstantInt::getFalse(); // X < (small) --> false
- else
- Result = ConstantInt::getTrue(); // X < (large) --> true
- } else {
- // We're performing an unsigned comparison.
- if (isSignedExt) {
- // We're performing an unsigned comp with a sign extended value.
- // This is true if the input is >= 0. [aka >s -1]
- Constant *NegOne = ConstantInt::getAllOnesValue(SrcTy);
- Result = InsertNewInstBefore(new ICmpInst(ICmpInst::ICMP_SGT, LHSCIOp,
- NegOne, ICI.getName()), ICI);
- } else {
- // Unsigned extend & unsigned compare -> always true.
- Result = ConstantInt::getTrue();
- }
- }
-
- // Finally, return the value computed.
- if (ICI.getPredicate() == ICmpInst::ICMP_ULT ||
- ICI.getPredicate() == ICmpInst::ICMP_SLT) {
- return ReplaceInstUsesWith(ICI, Result);
- } else {
- assert((ICI.getPredicate()==ICmpInst::ICMP_UGT ||
- ICI.getPredicate()==ICmpInst::ICMP_SGT) &&
- "ICmp should be folded!");
- if (Constant *CI = dyn_cast<Constant>(Result))
- return ReplaceInstUsesWith(ICI, ConstantExpr::getNot(CI));
- else
- return BinaryOperator::createNot(Result);
- }
-}
-
-Instruction *InstCombiner::visitShl(BinaryOperator &I) {
- return commonShiftTransforms(I);
-}
-
-Instruction *InstCombiner::visitLShr(BinaryOperator &I) {
- return commonShiftTransforms(I);
-}
-
-Instruction *InstCombiner::visitAShr(BinaryOperator &I) {
- if (Instruction *R = commonShiftTransforms(I))
- return R;
-
- Value *Op0 = I.getOperand(0);
-
- // ashr int -1, X = -1 (for any arithmetic shift rights of ~0)
- if (ConstantInt *CSI = dyn_cast<ConstantInt>(Op0))
- if (CSI->isAllOnesValue())
- return ReplaceInstUsesWith(I, CSI);
-
- // See if we can turn a signed shr into an unsigned shr.
- if (MaskedValueIsZero(Op0,
- APInt::getSignBit(I.getType()->getPrimitiveSizeInBits())))
- return BinaryOperator::createLShr(Op0, I.getOperand(1));
-
- return 0;
-}
-
-Instruction *InstCombiner::commonShiftTransforms(BinaryOperator &I) {
- assert(I.getOperand(1)->getType() == I.getOperand(0)->getType());
- Value *Op0 = I.getOperand(0), *Op1 = I.getOperand(1);
-
- // shl X, 0 == X and shr X, 0 == X
- // shl 0, X == 0 and shr 0, X == 0
- if (Op1 == Constant::getNullValue(Op1->getType()) ||
- Op0 == Constant::getNullValue(Op0->getType()))
- return ReplaceInstUsesWith(I, Op0);
-
- if (isa<UndefValue>(Op0)) {
- if (I.getOpcode() == Instruction::AShr) // undef >>s X -> undef
- return ReplaceInstUsesWith(I, Op0);
- else // undef << X -> 0, undef >>u X -> 0
- return ReplaceInstUsesWith(I, Constant::getNullValue(I.getType()));
- }
- if (isa<UndefValue>(Op1)) {
- if (I.getOpcode() == Instruction::AShr) // X >>s undef -> X
- return ReplaceInstUsesWith(I, Op0);
- else // X << undef, X >>u undef -> 0
- return ReplaceInstUsesWith(I, Constant::getNullValue(I.getType()));
- }
-
- // Try to fold constant and into select arguments.
- if (isa<Constant>(Op0))
- if (SelectInst *SI = dyn_cast<SelectInst>(Op1))
- if (Instruction *R = FoldOpIntoSelect(I, SI, this))
- return R;
-
- if (ConstantInt *CUI = dyn_cast<ConstantInt>(Op1))
- if (Instruction *Res = FoldShiftByConstant(Op0, CUI, I))
- return Res;
- return 0;
-}
-
-Instruction *InstCombiner::FoldShiftByConstant(Value *Op0, ConstantInt *Op1,
- BinaryOperator &I) {
- bool isLeftShift = I.getOpcode() == Instruction::Shl;
-
- // See if we can simplify any instructions used by the instruction whose sole
- // purpose is to compute bits we don't care about.
- uint32_t TypeBits = Op0->getType()->getPrimitiveSizeInBits();
- APInt KnownZero(TypeBits, 0), KnownOne(TypeBits, 0);
- if (SimplifyDemandedBits(&I, APInt::getAllOnesValue(TypeBits),
- KnownZero, KnownOne))
- return &I;
-
- // shl uint X, 32 = 0 and shr ubyte Y, 9 = 0, ... just don't eliminate shr
- // of a signed value.
- //
- if (Op1->uge(TypeBits)) {
- if (I.getOpcode() != Instruction::AShr)
- return ReplaceInstUsesWith(I, Constant::getNullValue(Op0->getType()));
- else {
- I.setOperand(1, ConstantInt::get(I.getType(), TypeBits-1));
- return &I;
- }
- }
-
- // ((X*C1) << C2) == (X * (C1 << C2))
- if (BinaryOperator *BO = dyn_cast<BinaryOperator>(Op0))
- if (BO->getOpcode() == Instruction::Mul && isLeftShift)
- if (Constant *BOOp = dyn_cast<Constant>(BO->getOperand(1)))
- return BinaryOperator::createMul(BO->getOperand(0),
- ConstantExpr::getShl(BOOp, Op1));
-
- // Try to fold constant and into select arguments.
- if (SelectInst *SI = dyn_cast<SelectInst>(Op0))
- if (Instruction *R = FoldOpIntoSelect(I, SI, this))
- return R;
- if (isa<PHINode>(Op0))
- if (Instruction *NV = FoldOpIntoPhi(I))
- return NV;
-
- // Fold shift2(trunc(shift1(x,c1)), c2) -> trunc(shift2(shift1(x,c1),c2))
- if (TruncInst *TI = dyn_cast<TruncInst>(Op0)) {
- Instruction *TrOp = dyn_cast<Instruction>(TI->getOperand(0));
- // If 'shift2' is an ashr, we would have to get the sign bit into a funny
- // place. Don't try to do this transformation in this case. Also, we
- // require that the input operand is a shift-by-constant so that we have
- // confidence that the shifts will get folded together. We could do this
- // xform in more cases, but it is unlikely to be profitable.
- if (TrOp && I.isLogicalShift() && TrOp->isShift() &&
- isa<ConstantInt>(TrOp->getOperand(1))) {
- // Okay, we'll do this xform. Make the shift of shift.
- Constant *ShAmt = ConstantExpr::getZExt(Op1, TrOp->getType());
- Instruction *NSh = BinaryOperator::create(I.getOpcode(), TrOp, ShAmt,
- I.getName());
- InsertNewInstBefore(NSh, I); // (shift2 (shift1 & 0x00FF), c2)
-
- // For logical shifts, the truncation has the effect of making the high
- // part of the register be zeros. Emulate this by inserting an AND to
- // clear the top bits as needed. This 'and' will usually be zapped by
- // other xforms later if dead.
- unsigned SrcSize = TrOp->getType()->getPrimitiveSizeInBits();
- unsigned DstSize = TI->getType()->getPrimitiveSizeInBits();
- APInt MaskV(APInt::getLowBitsSet(SrcSize, DstSize));
-
- // The mask we constructed says what the trunc would do if occurring
- // between the shifts. We want to know the effect *after* the second
- // shift. We know that it is a logical shift by a constant, so adjust the
- // mask as appropriate.
- if (I.getOpcode() == Instruction::Shl)
- MaskV <<= Op1->getZExtValue();
- else {
- assert(I.getOpcode() == Instruction::LShr && "Unknown logical shift");
- MaskV = MaskV.lshr(Op1->getZExtValue());
- }
-
- Instruction *And = BinaryOperator::createAnd(NSh, ConstantInt::get(MaskV),
- TI->getName());
- InsertNewInstBefore(And, I); // shift1 & 0x00FF
-
- // Return the value truncated to the interesting size.
- return new TruncInst(And, I.getType());
- }
- }
-
- if (Op0->hasOneUse()) {
- if (BinaryOperator *Op0BO = dyn_cast<BinaryOperator>(Op0)) {
- // Turn ((X >> C) + Y) << C -> (X + (Y << C)) & (~0 << C)
- Value *V1, *V2;
- ConstantInt *CC;
- switch (Op0BO->getOpcode()) {
- default: break;
- case Instruction::Add:
- case Instruction::And:
- case Instruction::Or:
- case Instruction::Xor: {
- // These operators commute.
- // Turn (Y + (X >> C)) << C -> (X + (Y << C)) & (~0 << C)
- if (isLeftShift && Op0BO->getOperand(1)->hasOneUse() &&
- match(Op0BO->getOperand(1),
- m_Shr(m_Value(V1), m_ConstantInt(CC))) && CC == Op1) {
- Instruction *YS = BinaryOperator::createShl(
- Op0BO->getOperand(0), Op1,
- Op0BO->getName());
- InsertNewInstBefore(YS, I); // (Y << C)
- Instruction *X =
- BinaryOperator::create(Op0BO->getOpcode(), YS, V1,
- Op0BO->getOperand(1)->getName());
- InsertNewInstBefore(X, I); // (X + (Y << C))
- uint32_t Op1Val = Op1->getLimitedValue(TypeBits);
- return BinaryOperator::createAnd(X, ConstantInt::get(
- APInt::getHighBitsSet(TypeBits, TypeBits-Op1Val)));
- }
-
- // Turn (Y + ((X >> C) & CC)) << C -> ((X & (CC << C)) + (Y << C))
- Value *Op0BOOp1 = Op0BO->getOperand(1);
- if (isLeftShift && Op0BOOp1->hasOneUse() &&
- match(Op0BOOp1,
- m_And(m_Shr(m_Value(V1), m_Value(V2)),m_ConstantInt(CC))) &&
- cast<BinaryOperator>(Op0BOOp1)->getOperand(0)->hasOneUse() &&
- V2 == Op1) {
- Instruction *YS = BinaryOperator::createShl(
- Op0BO->getOperand(0), Op1,
- Op0BO->getName());
- InsertNewInstBefore(YS, I); // (Y << C)
- Instruction *XM =
- BinaryOperator::createAnd(V1, ConstantExpr::getShl(CC, Op1),
- V1->getName()+".mask");
- InsertNewInstBefore(XM, I); // X & (CC << C)
-
- return BinaryOperator::create(Op0BO->getOpcode(), YS, XM);
- }
- }
-
- // FALL THROUGH.
- case Instruction::Sub: {
- // Turn ((X >> C) + Y) << C -> (X + (Y << C)) & (~0 << C)
- if (isLeftShift && Op0BO->getOperand(0)->hasOneUse() &&
- match(Op0BO->getOperand(0),
- m_Shr(m_Value(V1), m_ConstantInt(CC))) && CC == Op1) {
- Instruction *YS = BinaryOperator::createShl(
- Op0BO->getOperand(1), Op1,
- Op0BO->getName());
- InsertNewInstBefore(YS, I); // (Y << C)
- Instruction *X =
- BinaryOperator::create(Op0BO->getOpcode(), V1, YS,
- Op0BO->getOperand(0)->getName());
- InsertNewInstBefore(X, I); // (X + (Y << C))
- uint32_t Op1Val = Op1->getLimitedValue(TypeBits);
- return BinaryOperator::createAnd(X, ConstantInt::get(
- APInt::getHighBitsSet(TypeBits, TypeBits-Op1Val)));
- }
-
- // Turn (((X >> C)&CC) + Y) << C -> (X + (Y << C)) & (CC << C)
- if (isLeftShift && Op0BO->getOperand(0)->hasOneUse() &&
- match(Op0BO->getOperand(0),
- m_And(m_Shr(m_Value(V1), m_Value(V2)),
- m_ConstantInt(CC))) && V2 == Op1 &&
- cast<BinaryOperator>(Op0BO->getOperand(0))
- ->getOperand(0)->hasOneUse()) {
- Instruction *YS = BinaryOperator::createShl(
- Op0BO->getOperand(1), Op1,
- Op0BO->getName());
- InsertNewInstBefore(YS, I); // (Y << C)
- Instruction *XM =
- BinaryOperator::createAnd(V1, ConstantExpr::getShl(CC, Op1),
- V1->getName()+".mask");
- InsertNewInstBefore(XM, I); // X & (CC << C)
-
- return BinaryOperator::create(Op0BO->getOpcode(), XM, YS);
- }
-
- break;
- }
- }
-
-
- // If the operand is an bitwise operator with a constant RHS, and the
- // shift is the only use, we can pull it out of the shift.
- if (ConstantInt *Op0C = dyn_cast<ConstantInt>(Op0BO->getOperand(1))) {
- bool isValid = true; // Valid only for And, Or, Xor
- bool highBitSet = false; // Transform if high bit of constant set?
-
- switch (Op0BO->getOpcode()) {
- default: isValid = false; break; // Do not perform transform!
- case Instruction::Add:
- isValid = isLeftShift;
- break;
- case Instruction::Or:
- case Instruction::Xor:
- highBitSet = false;
- break;
- case Instruction::And:
- highBitSet = true;
- break;
- }
-
- // If this is a signed shift right, and the high bit is modified
- // by the logical operation, do not perform the transformation.
- // The highBitSet boolean indicates the value of the high bit of
- // the constant which would cause it to be modified for this
- // operation.
- //
- if (isValid && I.getOpcode() == Instruction::AShr)
- isValid = Op0C->getValue()[TypeBits-1] == highBitSet;
-
- if (isValid) {
- Constant *NewRHS = ConstantExpr::get(I.getOpcode(), Op0C, Op1);
-
- Instruction *NewShift =
- BinaryOperator::create(I.getOpcode(), Op0BO->getOperand(0), Op1);
- InsertNewInstBefore(NewShift, I);
- NewShift->takeName(Op0BO);
-
- return BinaryOperator::create(Op0BO->getOpcode(), NewShift,
- NewRHS);
- }
- }
- }
- }
-
- // Find out if this is a shift of a shift by a constant.
- BinaryOperator *ShiftOp = dyn_cast<BinaryOperator>(Op0);
- if (ShiftOp && !ShiftOp->isShift())
- ShiftOp = 0;
-
- if (ShiftOp && isa<ConstantInt>(ShiftOp->getOperand(1))) {
- ConstantInt *ShiftAmt1C = cast<ConstantInt>(ShiftOp->getOperand(1));
- uint32_t ShiftAmt1 = ShiftAmt1C->getLimitedValue(TypeBits);
- uint32_t ShiftAmt2 = Op1->getLimitedValue(TypeBits);
- assert(ShiftAmt2 != 0 && "Should have been simplified earlier");
- if (ShiftAmt1 == 0) return 0; // Will be simplified in the future.
- Value *X = ShiftOp->getOperand(0);
-
- uint32_t AmtSum = ShiftAmt1+ShiftAmt2; // Fold into one big shift.
- if (AmtSum > TypeBits)
- AmtSum = TypeBits;
-
- const IntegerType *Ty = cast<IntegerType>(I.getType());
-
- // Check for (X << c1) << c2 and (X >> c1) >> c2
- if (I.getOpcode() == ShiftOp->getOpcode()) {
- return BinaryOperator::create(I.getOpcode(), X,
- ConstantInt::get(Ty, AmtSum));
- } else if (ShiftOp->getOpcode() == Instruction::LShr &&
- I.getOpcode() == Instruction::AShr) {
- // ((X >>u C1) >>s C2) -> (X >>u (C1+C2)) since C1 != 0.
- return BinaryOperator::createLShr(X, ConstantInt::get(Ty, AmtSum));
- } else if (ShiftOp->getOpcode() == Instruction::AShr &&
- I.getOpcode() == Instruction::LShr) {
- // ((X >>s C1) >>u C2) -> ((X >>s (C1+C2)) & mask) since C1 != 0.
- Instruction *Shift =
- BinaryOperator::createAShr(X, ConstantInt::get(Ty, AmtSum));
- InsertNewInstBefore(Shift, I);
-
- APInt Mask(APInt::getLowBitsSet(TypeBits, TypeBits - ShiftAmt2));
- return BinaryOperator::createAnd(Shift, ConstantInt::get(Mask));
- }
-
- // Okay, if we get here, one shift must be left, and the other shift must be
- // right. See if the amounts are equal.
- if (ShiftAmt1 == ShiftAmt2) {
- // If we have ((X >>? C) << C), turn this into X & (-1 << C).
- if (I.getOpcode() == Instruction::Shl) {
- APInt Mask(APInt::getHighBitsSet(TypeBits, TypeBits - ShiftAmt1));
- return BinaryOperator::createAnd(X, ConstantInt::get(Mask));
- }
- // If we have ((X << C) >>u C), turn this into X & (-1 >>u C).
- if (I.getOpcode() == Instruction::LShr) {
- APInt Mask(APInt::getLowBitsSet(TypeBits, TypeBits - ShiftAmt1));
- return BinaryOperator::createAnd(X, ConstantInt::get(Mask));
- }
- // We can simplify ((X << C) >>s C) into a trunc + sext.
- // NOTE: we could do this for any C, but that would make 'unusual' integer
- // types. For now, just stick to ones well-supported by the code
- // generators.
- const Type *SExtType = 0;
- switch (Ty->getBitWidth() - ShiftAmt1) {
- case 1 :
- case 8 :
- case 16 :
- case 32 :
- case 64 :
- case 128:
- SExtType = IntegerType::get(Ty->getBitWidth() - ShiftAmt1);
- break;
- default: break;
- }
- if (SExtType) {
- Instruction *NewTrunc = new TruncInst(X, SExtType, "sext");
- InsertNewInstBefore(NewTrunc, I);
- return new SExtInst(NewTrunc, Ty);
- }
- // Otherwise, we can't handle it yet.
- } else if (ShiftAmt1 < ShiftAmt2) {
- uint32_t ShiftDiff = ShiftAmt2-ShiftAmt1;
-
- // (X >>? C1) << C2 --> X << (C2-C1) & (-1 << C2)
- if (I.getOpcode() == Instruction::Shl) {
- assert(ShiftOp->getOpcode() == Instruction::LShr ||
- ShiftOp->getOpcode() == Instruction::AShr);
- Instruction *Shift =
- BinaryOperator::createShl(X, ConstantInt::get(Ty, ShiftDiff));
- InsertNewInstBefore(Shift, I);
-
- APInt Mask(APInt::getHighBitsSet(TypeBits, TypeBits - ShiftAmt2));
- return BinaryOperator::createAnd(Shift, ConstantInt::get(Mask));
- }
-
- // (X << C1) >>u C2 --> X >>u (C2-C1) & (-1 >> C2)
- if (I.getOpcode() == Instruction::LShr) {
- assert(ShiftOp->getOpcode() == Instruction::Shl);
- Instruction *Shift =
- BinaryOperator::createLShr(X, ConstantInt::get(Ty, ShiftDiff));
- InsertNewInstBefore(Shift, I);
-
- APInt Mask(APInt::getLowBitsSet(TypeBits, TypeBits - ShiftAmt2));
- return BinaryOperator::createAnd(Shift, ConstantInt::get(Mask));
- }
-
- // We can't handle (X << C1) >>s C2, it shifts arbitrary bits in.
- } else {
- assert(ShiftAmt2 < ShiftAmt1);
- uint32_t ShiftDiff = ShiftAmt1-ShiftAmt2;
-
- // (X >>? C1) << C2 --> X >>? (C1-C2) & (-1 << C2)
- if (I.getOpcode() == Instruction::Shl) {
- assert(ShiftOp->getOpcode() == Instruction::LShr ||
- ShiftOp->getOpcode() == Instruction::AShr);
- Instruction *Shift =
- BinaryOperator::create(ShiftOp->getOpcode(), X,
- ConstantInt::get(Ty, ShiftDiff));
- InsertNewInstBefore(Shift, I);
-
- APInt Mask(APInt::getHighBitsSet(TypeBits, TypeBits - ShiftAmt2));
- return BinaryOperator::createAnd(Shift, ConstantInt::get(Mask));
- }
-
- // (X << C1) >>u C2 --> X << (C1-C2) & (-1 >> C2)
- if (I.getOpcode() == Instruction::LShr) {
- assert(ShiftOp->getOpcode() == Instruction::Shl);
- Instruction *Shift =
- BinaryOperator::createShl(X, ConstantInt::get(Ty, ShiftDiff));
- InsertNewInstBefore(Shift, I);
-
- APInt Mask(APInt::getLowBitsSet(TypeBits, TypeBits - ShiftAmt2));
- return BinaryOperator::createAnd(Shift, ConstantInt::get(Mask));
- }
-
- // We can't handle (X << C1) >>a C2, it shifts arbitrary bits in.
- }
- }
- return 0;
-}
-
-
-/// DecomposeSimpleLinearExpr - Analyze 'Val', seeing if it is a simple linear
-/// expression. If so, decompose it, returning some value X, such that Val is
-/// X*Scale+Offset.
-///
-static Value *DecomposeSimpleLinearExpr(Value *Val, unsigned &Scale,
- int &Offset) {
- assert(Val->getType() == Type::Int32Ty && "Unexpected allocation size type!");
- if (ConstantInt *CI = dyn_cast<ConstantInt>(Val)) {
- Offset = CI->getZExtValue();
- Scale = 0;
- return ConstantInt::get(Type::Int32Ty, 0);
- } else if (BinaryOperator *I = dyn_cast<BinaryOperator>(Val)) {
- if (ConstantInt *RHS = dyn_cast<ConstantInt>(I->getOperand(1))) {
- if (I->getOpcode() == Instruction::Shl) {
- // This is a value scaled by '1 << the shift amt'.
- Scale = 1U << RHS->getZExtValue();
- Offset = 0;
- return I->getOperand(0);
- } else if (I->getOpcode() == Instruction::Mul) {
- // This value is scaled by 'RHS'.
- Scale = RHS->getZExtValue();
- Offset = 0;
- return I->getOperand(0);
- } else if (I->getOpcode() == Instruction::Add) {
- // We have X+C. Check to see if we really have (X*C2)+C1,
- // where C1 is divisible by C2.
- unsigned SubScale;
- Value *SubVal =
- DecomposeSimpleLinearExpr(I->getOperand(0), SubScale, Offset);
- Offset += RHS->getZExtValue();
- Scale = SubScale;
- return SubVal;
- }
- }
- }
-
- // Otherwise, we can't look past this.
- Scale = 1;
- Offset = 0;
- return Val;
-}
-
-
-/// PromoteCastOfAllocation - If we find a cast of an allocation instruction,
-/// try to eliminate the cast by moving the type information into the alloc.
-Instruction *InstCombiner::PromoteCastOfAllocation(BitCastInst &CI,
- AllocationInst &AI) {
- const PointerType *PTy = cast<PointerType>(CI.getType());
-
- // Remove any uses of AI that are dead.
- assert(!CI.use_empty() && "Dead instructions should be removed earlier!");
-
- for (Value::use_iterator UI = AI.use_begin(), E = AI.use_end(); UI != E; ) {
- Instruction *User = cast<Instruction>(*UI++);
- if (isInstructionTriviallyDead(User)) {
- while (UI != E && *UI == User)
- ++UI; // If this instruction uses AI more than once, don't break UI.
-
- ++NumDeadInst;
- DOUT << "IC: DCE: " << *User;
- EraseInstFromFunction(*User);
- }
- }
-
- // Get the type really allocated and the type casted to.
- const Type *AllocElTy = AI.getAllocatedType();
- const Type *CastElTy = PTy->getElementType();
- if (!AllocElTy->isSized() || !CastElTy->isSized()) return 0;
-
- unsigned AllocElTyAlign = TD->getABITypeAlignment(AllocElTy);
- unsigned CastElTyAlign = TD->getABITypeAlignment(CastElTy);
- if (CastElTyAlign < AllocElTyAlign) return 0;
-
- // If the allocation has multiple uses, only promote it if we are strictly
- // increasing the alignment of the resultant allocation. If we keep it the
- // same, we open the door to infinite loops of various kinds.
- if (!AI.hasOneUse() && CastElTyAlign == AllocElTyAlign) return 0;
-
- uint64_t AllocElTySize = TD->getABITypeSize(AllocElTy);
- uint64_t CastElTySize = TD->getABITypeSize(CastElTy);
- if (CastElTySize == 0 || AllocElTySize == 0) return 0;
-
- // See if we can satisfy the modulus by pulling a scale out of the array
- // size argument.
- unsigned ArraySizeScale;
- int ArrayOffset;
- Value *NumElements = // See if the array size is a decomposable linear expr.
- DecomposeSimpleLinearExpr(AI.getOperand(0), ArraySizeScale, ArrayOffset);
-
- // If we can now satisfy the modulus, by using a non-1 scale, we really can
- // do the xform.
- if ((AllocElTySize*ArraySizeScale) % CastElTySize != 0 ||
- (AllocElTySize*ArrayOffset ) % CastElTySize != 0) return 0;
-
- unsigned Scale = (AllocElTySize*ArraySizeScale)/CastElTySize;
- Value *Amt = 0;
- if (Scale == 1) {
- Amt = NumElements;
- } else {
- // If the allocation size is constant, form a constant mul expression
- Amt = ConstantInt::get(Type::Int32Ty, Scale);
- if (isa<ConstantInt>(NumElements))
- Amt = Multiply(cast<ConstantInt>(NumElements), cast<ConstantInt>(Amt));
- // otherwise multiply the amount and the number of elements
- else if (Scale != 1) {
- Instruction *Tmp = BinaryOperator::createMul(Amt, NumElements, "tmp");
- Amt = InsertNewInstBefore(Tmp, AI);
- }
- }
-
- if (int Offset = (AllocElTySize*ArrayOffset)/CastElTySize) {
- Value *Off = ConstantInt::get(Type::Int32Ty, Offset, true);
- Instruction *Tmp = BinaryOperator::createAdd(Amt, Off, "tmp");
- Amt = InsertNewInstBefore(Tmp, AI);
- }
-
- AllocationInst *New;
- if (isa<MallocInst>(AI))
- New = new MallocInst(CastElTy, Amt, AI.getAlignment());
- else
- New = new AllocaInst(CastElTy, Amt, AI.getAlignment());
- InsertNewInstBefore(New, AI);
- New->takeName(&AI);
-
- // If the allocation has multiple uses, insert a cast and change all things
- // that used it to use the new cast. This will also hack on CI, but it will
- // die soon.
- if (!AI.hasOneUse()) {
- AddUsesToWorkList(AI);
- // New is the allocation instruction, pointer typed. AI is the original
- // allocation instruction, also pointer typed. Thus, cast to use is BitCast.
- CastInst *NewCast = new BitCastInst(New, AI.getType(), "tmpcast");
- InsertNewInstBefore(NewCast, AI);
- AI.replaceAllUsesWith(NewCast);
- }
- return ReplaceInstUsesWith(CI, New);
-}
-
-/// CanEvaluateInDifferentType - Return true if we can take the specified value
-/// and return it as type Ty without inserting any new casts and without
-/// changing the computed value. This is used by code that tries to decide
-/// whether promoting or shrinking integer operations to wider or smaller types
-/// will allow us to eliminate a truncate or extend.
-///
-/// This is a truncation operation if Ty is smaller than V->getType(), or an
-/// extension operation if Ty is larger.
-bool InstCombiner::CanEvaluateInDifferentType(Value *V, const IntegerType *Ty,
- unsigned CastOpc,
- int &NumCastsRemoved) {
- // We can always evaluate constants in another type.
- if (isa<ConstantInt>(V))
- return true;
-
- Instruction *I = dyn_cast<Instruction>(V);
- if (!I) return false;
-
- const IntegerType *OrigTy = cast<IntegerType>(V->getType());
-
- // If this is an extension or truncate, we can often eliminate it.
- if (isa<TruncInst>(I) || isa<ZExtInst>(I) || isa<SExtInst>(I)) {
- // If this is a cast from the destination type, we can trivially eliminate
- // it, and this will remove a cast overall.
- if (I->getOperand(0)->getType() == Ty) {
- // If the first operand is itself a cast, and is eliminable, do not count
- // this as an eliminable cast. We would prefer to eliminate those two
- // casts first.
- if (!isa<CastInst>(I->getOperand(0)))
- ++NumCastsRemoved;
- return true;
- }
- }
-
- // We can't extend or shrink something that has multiple uses: doing so would
- // require duplicating the instruction in general, which isn't profitable.
- if (!I->hasOneUse()) return false;
-
- switch (I->getOpcode()) {
- case Instruction::Add:
- case Instruction::Sub:
- case Instruction::And:
- case Instruction::Or:
- case Instruction::Xor:
- // These operators can all arbitrarily be extended or truncated.
- return CanEvaluateInDifferentType(I->getOperand(0), Ty, CastOpc,
- NumCastsRemoved) &&
- CanEvaluateInDifferentType(I->getOperand(1), Ty, CastOpc,
- NumCastsRemoved);
-
- case Instruction::Mul:
- // A multiply can be truncated by truncating its operands.
- return Ty->getBitWidth() < OrigTy->getBitWidth() &&
- CanEvaluateInDifferentType(I->getOperand(0), Ty, CastOpc,
- NumCastsRemoved) &&
- CanEvaluateInDifferentType(I->getOperand(1), Ty, CastOpc,
- NumCastsRemoved);
-
- case Instruction::Shl:
- // If we are truncating the result of this SHL, and if it's a shift of a
- // constant amount, we can always perform a SHL in a smaller type.
- if (ConstantInt *CI = dyn_cast<ConstantInt>(I->getOperand(1))) {
- uint32_t BitWidth = Ty->getBitWidth();
- if (BitWidth < OrigTy->getBitWidth() &&
- CI->getLimitedValue(BitWidth) < BitWidth)
- return CanEvaluateInDifferentType(I->getOperand(0), Ty, CastOpc,
- NumCastsRemoved);
- }
- break;
- case Instruction::LShr:
- // If this is a truncate of a logical shr, we can truncate it to a smaller
- // lshr iff we know that the bits we would otherwise be shifting in are
- // already zeros.
- if (ConstantInt *CI = dyn_cast<ConstantInt>(I->getOperand(1))) {
- uint32_t OrigBitWidth = OrigTy->getBitWidth();
- uint32_t BitWidth = Ty->getBitWidth();
- if (BitWidth < OrigBitWidth &&
- MaskedValueIsZero(I->getOperand(0),
- APInt::getHighBitsSet(OrigBitWidth, OrigBitWidth-BitWidth)) &&
- CI->getLimitedValue(BitWidth) < BitWidth) {
- return CanEvaluateInDifferentType(I->getOperand(0), Ty, CastOpc,
- NumCastsRemoved);
- }
- }
- break;
- case Instruction::ZExt:
- case Instruction::SExt:
- case Instruction::Trunc:
- // If this is the same kind of case as our original (e.g. zext+zext), we
- // can safely replace it. Note that replacing it does not reduce the number
- // of casts in the input.
- if (I->getOpcode() == CastOpc)
- return true;
-
- break;
- default:
- // TODO: Can handle more cases here.
- break;
- }
-
- return false;
-}
-
-/// EvaluateInDifferentType - Given an expression that
-/// CanEvaluateInDifferentType returns true for, actually insert the code to
-/// evaluate the expression.
-Value *InstCombiner::EvaluateInDifferentType(Value *V, const Type *Ty,
- bool isSigned) {
- if (Constant *C = dyn_cast<Constant>(V))
- return ConstantExpr::getIntegerCast(C, Ty, isSigned /*Sext or ZExt*/);
-
- // Otherwise, it must be an instruction.
- Instruction *I = cast<Instruction>(V);
- Instruction *Res = 0;
- switch (I->getOpcode()) {
- case Instruction::Add:
- case Instruction::Sub:
- case Instruction::Mul:
- case Instruction::And:
- case Instruction::Or:
- case Instruction::Xor:
- case Instruction::AShr:
- case Instruction::LShr:
- case Instruction::Shl: {
- Value *LHS = EvaluateInDifferentType(I->getOperand(0), Ty, isSigned);
- Value *RHS = EvaluateInDifferentType(I->getOperand(1), Ty, isSigned);
- Res = BinaryOperator::create((Instruction::BinaryOps)I->getOpcode(),
- LHS, RHS, I->getName());
- break;
- }
- case Instruction::Trunc:
- case Instruction::ZExt:
- case Instruction::SExt:
- // If the source type of the cast is the type we're trying for then we can
- // just return the source. There's no need to insert it because it is not
- // new.
- if (I->getOperand(0)->getType() == Ty)
- return I->getOperand(0);
-
- // Otherwise, must be the same type of case, so just reinsert a new one.
- Res = CastInst::create(cast<CastInst>(I)->getOpcode(), I->getOperand(0),
- Ty, I->getName());
- break;
- default:
- // TODO: Can handle more cases here.
- assert(0 && "Unreachable!");
- break;
- }
-
- return InsertNewInstBefore(Res, *I);
-}
-
-/// @brief Implement the transforms common to all CastInst visitors.
-Instruction *InstCombiner::commonCastTransforms(CastInst &CI) {
- Value *Src = CI.getOperand(0);
-
- // Many cases of "cast of a cast" are eliminable. If it's eliminable we just
- // eliminate it now.
- if (CastInst *CSrc = dyn_cast<CastInst>(Src)) { // A->B->C cast
- if (Instruction::CastOps opc =
- isEliminableCastPair(CSrc, CI.getOpcode(), CI.getType(), TD)) {
- // The first cast (CSrc) is eliminable so we need to fix up or replace
- // the second cast (CI). CSrc will then have a good chance of being dead.
- return CastInst::create(opc, CSrc->getOperand(0), CI.getType());
- }
- }
-
- // If we are casting a select then fold the cast into the select
- if (SelectInst *SI = dyn_cast<SelectInst>(Src))
- if (Instruction *NV = FoldOpIntoSelect(CI, SI, this))
- return NV;
-
- // If we are casting a PHI then fold the cast into the PHI
- if (isa<PHINode>(Src))
- if (Instruction *NV = FoldOpIntoPhi(CI))
- return NV;
-
- return 0;
-}
-
-/// @brief Implement the transforms for cast of pointer (bitcast/ptrtoint)
-Instruction *InstCombiner::commonPointerCastTransforms(CastInst &CI) {
- Value *Src = CI.getOperand(0);
-
- if (GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(Src)) {
- // If casting the result of a getelementptr instruction with no offset, turn
- // this into a cast of the original pointer!
- if (GEP->hasAllZeroIndices()) {
- // Changing the cast operand is usually not a good idea but it is safe
- // here because the pointer operand is being replaced with another
- // pointer operand so the opcode doesn't need to change.
- AddToWorkList(GEP);
- CI.setOperand(0, GEP->getOperand(0));
- return &CI;
- }
-
- // If the GEP has a single use, and the base pointer is a bitcast, and the
- // GEP computes a constant offset, see if we can convert these three
- // instructions into fewer. This typically happens with unions and other
- // non-type-safe code.
- if (GEP->hasOneUse() && isa<BitCastInst>(GEP->getOperand(0))) {
- if (GEP->hasAllConstantIndices()) {
- // We are guaranteed to get a constant from EmitGEPOffset.
- ConstantInt *OffsetV = cast<ConstantInt>(EmitGEPOffset(GEP, CI, *this));
- int64_t Offset = OffsetV->getSExtValue();
-
- // Get the base pointer input of the bitcast, and the type it points to.
- Value *OrigBase = cast<BitCastInst>(GEP->getOperand(0))->getOperand(0);
- const Type *GEPIdxTy =
- cast<PointerType>(OrigBase->getType())->getElementType();
- if (GEPIdxTy->isSized()) {
- SmallVector<Value*, 8> NewIndices;
-
- // Start with the index over the outer type. Note that the type size
- // might be zero (even if the offset isn't zero) if the indexed type
- // is something like [0 x {int, int}]
- const Type *IntPtrTy = TD->getIntPtrType();
- int64_t FirstIdx = 0;
- if (int64_t TySize = TD->getABITypeSize(GEPIdxTy)) {
- FirstIdx = Offset/TySize;
- Offset %= TySize;
-
- // Handle silly modulus not returning values values [0..TySize).
- if (Offset < 0) {
- --FirstIdx;
- Offset += TySize;
- assert(Offset >= 0);
- }
- assert((uint64_t)Offset < (uint64_t)TySize &&"Out of range offset");
- }
-
- NewIndices.push_back(ConstantInt::get(IntPtrTy, FirstIdx));
-
- // Index into the types. If we fail, set OrigBase to null.
- while (Offset) {
- if (const StructType *STy = dyn_cast<StructType>(GEPIdxTy)) {
- const StructLayout *SL = TD->getStructLayout(STy);
- if (Offset < (int64_t)SL->getSizeInBytes()) {
- unsigned Elt = SL->getElementContainingOffset(Offset);
- NewIndices.push_back(ConstantInt::get(Type::Int32Ty, Elt));
-
- Offset -= SL->getElementOffset(Elt);
- GEPIdxTy = STy->getElementType(Elt);
- } else {
- // Otherwise, we can't index into this, bail out.
- Offset = 0;
- OrigBase = 0;
- }
- } else if (isa<ArrayType>(GEPIdxTy) || isa<VectorType>(GEPIdxTy)) {
- const SequentialType *STy = cast<SequentialType>(GEPIdxTy);
- if (uint64_t EltSize = TD->getABITypeSize(STy->getElementType())){
- NewIndices.push_back(ConstantInt::get(IntPtrTy,Offset/EltSize));
- Offset %= EltSize;
- } else {
- NewIndices.push_back(ConstantInt::get(IntPtrTy, 0));
- }
- GEPIdxTy = STy->getElementType();
- } else {
- // Otherwise, we can't index into this, bail out.
- Offset = 0;
- OrigBase = 0;
- }
- }
- if (OrigBase) {
- // If we were able to index down into an element, create the GEP
- // and bitcast the result. This eliminates one bitcast, potentially
- // two.
- Instruction *NGEP = GetElementPtrInst::Create(OrigBase,
- NewIndices.begin(),
- NewIndices.end(), "");
- InsertNewInstBefore(NGEP, CI);
- NGEP->takeName(GEP);
-
- if (isa<BitCastInst>(CI))
- return new BitCastInst(NGEP, CI.getType());
- assert(isa<PtrToIntInst>(CI));
- return new PtrToIntInst(NGEP, CI.getType());
- }
- }
- }
- }
- }
-
- return commonCastTransforms(CI);
-}
-
-
-
-/// Only the TRUNC, ZEXT, SEXT, and BITCAST can both operand and result as
-/// integer types. This function implements the common transforms for all those
-/// cases.
-/// @brief Implement the transforms common to CastInst with integer operands
-Instruction *InstCombiner::commonIntCastTransforms(CastInst &CI) {
- if (Instruction *Result = commonCastTransforms(CI))
- return Result;
-
- Value *Src = CI.getOperand(0);
- const Type *SrcTy = Src->getType();
- const Type *DestTy = CI.getType();
- uint32_t SrcBitSize = SrcTy->getPrimitiveSizeInBits();
- uint32_t DestBitSize = DestTy->getPrimitiveSizeInBits();
-
- // See if we can simplify any instructions used by the LHS whose sole
- // purpose is to compute bits we don't care about.
- APInt KnownZero(DestBitSize, 0), KnownOne(DestBitSize, 0);
- if (SimplifyDemandedBits(&CI, APInt::getAllOnesValue(DestBitSize),
- KnownZero, KnownOne))
- return &CI;
-
- // If the source isn't an instruction or has more than one use then we
- // can't do anything more.
- Instruction *SrcI = dyn_cast<Instruction>(Src);
- if (!SrcI || !Src->hasOneUse())
- return 0;
-
- // Attempt to propagate the cast into the instruction for int->int casts.
- int NumCastsRemoved = 0;
- if (!isa<BitCastInst>(CI) &&
- CanEvaluateInDifferentType(SrcI, cast<IntegerType>(DestTy),
- CI.getOpcode(), NumCastsRemoved)) {
- // If this cast is a truncate, evaluting in a different type always
- // eliminates the cast, so it is always a win. If this is a zero-extension,
- // we need to do an AND to maintain the clear top-part of the computation,
- // so we require that the input have eliminated at least one cast. If this
- // is a sign extension, we insert two new casts (to do the extension) so we
- // require that two casts have been eliminated.
- bool DoXForm;
- switch (CI.getOpcode()) {
- default:
- // All the others use floating point so we shouldn't actually
- // get here because of the check above.
- assert(0 && "Unknown cast type");
- case Instruction::Trunc:
- DoXForm = true;
- break;
- case Instruction::ZExt:
- DoXForm = NumCastsRemoved >= 1;
- break;
- case Instruction::SExt:
- DoXForm = NumCastsRemoved >= 2;
- break;
- }
-
- if (DoXForm) {
- Value *Res = EvaluateInDifferentType(SrcI, DestTy,
- CI.getOpcode() == Instruction::SExt);
- assert(Res->getType() == DestTy);
- switch (CI.getOpcode()) {
- default: assert(0 && "Unknown cast type!");
- case Instruction::Trunc:
- case Instruction::BitCast:
- // Just replace this cast with the result.
- return ReplaceInstUsesWith(CI, Res);
- case Instruction::ZExt: {
- // We need to emit an AND to clear the high bits.
- assert(SrcBitSize < DestBitSize && "Not a zext?");
- Constant *C = ConstantInt::get(APInt::getLowBitsSet(DestBitSize,
- SrcBitSize));
- return BinaryOperator::createAnd(Res, C);
- }
- case Instruction::SExt:
- // We need to emit a cast to truncate, then a cast to sext.
- return CastInst::create(Instruction::SExt,
- InsertCastBefore(Instruction::Trunc, Res, Src->getType(),
- CI), DestTy);
- }
- }
- }
-
- Value *Op0 = SrcI->getNumOperands() > 0 ? SrcI->getOperand(0) : 0;
- Value *Op1 = SrcI->getNumOperands() > 1 ? SrcI->getOperand(1) : 0;
-
- switch (SrcI->getOpcode()) {
- case Instruction::Add:
- case Instruction::Mul:
- case Instruction::And:
- case Instruction::Or:
- case Instruction::Xor:
- // If we are discarding information, rewrite.
- if (DestBitSize <= SrcBitSize && DestBitSize != 1) {
- // Don't insert two casts if they cannot be eliminated. We allow
- // two casts to be inserted if the sizes are the same. This could
- // only be converting signedness, which is a noop.
- if (DestBitSize == SrcBitSize ||
- !ValueRequiresCast(CI.getOpcode(), Op1, DestTy,TD) ||
- !ValueRequiresCast(CI.getOpcode(), Op0, DestTy, TD)) {
- Instruction::CastOps opcode = CI.getOpcode();
- Value *Op0c = InsertOperandCastBefore(opcode, Op0, DestTy, SrcI);
- Value *Op1c = InsertOperandCastBefore(opcode, Op1, DestTy, SrcI);
- return BinaryOperator::create(
- cast<BinaryOperator>(SrcI)->getOpcode(), Op0c, Op1c);
- }
- }
-
- // cast (xor bool X, true) to int --> xor (cast bool X to int), 1
- if (isa<ZExtInst>(CI) && SrcBitSize == 1 &&
- SrcI->getOpcode() == Instruction::Xor &&
- Op1 == ConstantInt::getTrue() &&
- (!Op0->hasOneUse() || !isa<CmpInst>(Op0))) {
- Value *New = InsertOperandCastBefore(Instruction::ZExt, Op0, DestTy, &CI);
- return BinaryOperator::createXor(New, ConstantInt::get(CI.getType(), 1));
- }
- break;
- case Instruction::SDiv:
- case Instruction::UDiv:
- case Instruction::SRem:
- case Instruction::URem:
- // If we are just changing the sign, rewrite.
- if (DestBitSize == SrcBitSize) {
- // Don't insert two casts if they cannot be eliminated. We allow
- // two casts to be inserted if the sizes are the same. This could
- // only be converting signedness, which is a noop.
- if (!ValueRequiresCast(CI.getOpcode(), Op1, DestTy, TD) ||
- !ValueRequiresCast(CI.getOpcode(), Op0, DestTy, TD)) {
- Value *Op0c = InsertOperandCastBefore(Instruction::BitCast,
- Op0, DestTy, SrcI);
- Value *Op1c = InsertOperandCastBefore(Instruction::BitCast,
- Op1, DestTy, SrcI);
- return BinaryOperator::create(
- cast<BinaryOperator>(SrcI)->getOpcode(), Op0c, Op1c);
- }
- }
- break;
-
- case Instruction::Shl:
- // Allow changing the sign of the source operand. Do not allow
- // changing the size of the shift, UNLESS the shift amount is a
- // constant. We must not change variable sized shifts to a smaller
- // size, because it is undefined to shift more bits out than exist
- // in the value.
- if (DestBitSize == SrcBitSize ||
- (DestBitSize < SrcBitSize && isa<Constant>(Op1))) {
- Instruction::CastOps opcode = (DestBitSize == SrcBitSize ?
- Instruction::BitCast : Instruction::Trunc);
- Value *Op0c = InsertOperandCastBefore(opcode, Op0, DestTy, SrcI);
- Value *Op1c = InsertOperandCastBefore(opcode, Op1, DestTy, SrcI);
- return BinaryOperator::createShl(Op0c, Op1c);
- }
- break;
- case Instruction::AShr:
- // If this is a signed shr, and if all bits shifted in are about to be
- // truncated off, turn it into an unsigned shr to allow greater
- // simplifications.
- if (DestBitSize < SrcBitSize &&
- isa<ConstantInt>(Op1)) {
- uint32_t ShiftAmt = cast<ConstantInt>(Op1)->getLimitedValue(SrcBitSize);
- if (SrcBitSize > ShiftAmt && SrcBitSize-ShiftAmt >= DestBitSize) {
- // Insert the new logical shift right.
- return BinaryOperator::createLShr(Op0, Op1);
- }
- }
- break;
- }
- return 0;
-}
-
-Instruction *InstCombiner::visitTrunc(TruncInst &CI) {
- if (Instruction *Result = commonIntCastTransforms(CI))
- return Result;
-
- Value *Src = CI.getOperand(0);
- const Type *Ty = CI.getType();
- uint32_t DestBitWidth = Ty->getPrimitiveSizeInBits();
- uint32_t SrcBitWidth = cast<IntegerType>(Src->getType())->getBitWidth();
-
- if (Instruction *SrcI = dyn_cast<Instruction>(Src)) {
- switch (SrcI->getOpcode()) {
- default: break;
- case Instruction::LShr:
- // We can shrink lshr to something smaller if we know the bits shifted in
- // are already zeros.
- if (ConstantInt *ShAmtV = dyn_cast<ConstantInt>(SrcI->getOperand(1))) {
- uint32_t ShAmt = ShAmtV->getLimitedValue(SrcBitWidth);
-
- // Get a mask for the bits shifting in.
- APInt Mask(APInt::getLowBitsSet(SrcBitWidth, ShAmt).shl(DestBitWidth));
- Value* SrcIOp0 = SrcI->getOperand(0);
- if (SrcI->hasOneUse() && MaskedValueIsZero(SrcIOp0, Mask)) {
- if (ShAmt >= DestBitWidth) // All zeros.
- return ReplaceInstUsesWith(CI, Constant::getNullValue(Ty));
-
- // Okay, we can shrink this. Truncate the input, then return a new
- // shift.
- Value *V1 = InsertCastBefore(Instruction::Trunc, SrcIOp0, Ty, CI);
- Value *V2 = InsertCastBefore(Instruction::Trunc, SrcI->getOperand(1),
- Ty, CI);
- return BinaryOperator::createLShr(V1, V2);
- }
- } else { // This is a variable shr.
-
- // Turn 'trunc (lshr X, Y) to bool' into '(X & (1 << Y)) != 0'. This is
- // more LLVM instructions, but allows '1 << Y' to be hoisted if
- // loop-invariant and CSE'd.
- if (CI.getType() == Type::Int1Ty && SrcI->hasOneUse()) {
- Value *One = ConstantInt::get(SrcI->getType(), 1);
-
- Value *V = InsertNewInstBefore(
- BinaryOperator::createShl(One, SrcI->getOperand(1),
- "tmp"), CI);
- V = InsertNewInstBefore(BinaryOperator::createAnd(V,
- SrcI->getOperand(0),
- "tmp"), CI);
- Value *Zero = Constant::getNullValue(V->getType());
- return new ICmpInst(ICmpInst::ICMP_NE, V, Zero);
- }
- }
- break;
- }
- }
-
- return 0;
-}
-
-/// transformZExtICmp - Transform (zext icmp) to bitwise / integer operations
-/// in order to eliminate the icmp.
-Instruction *InstCombiner::transformZExtICmp(ICmpInst *ICI, Instruction &CI,
- bool DoXform) {
- // If we are just checking for a icmp eq of a single bit and zext'ing it
- // to an integer, then shift the bit to the appropriate place and then
- // cast to integer to avoid the comparison.
- if (ConstantInt *Op1C = dyn_cast<ConstantInt>(ICI->getOperand(1))) {
- const APInt &Op1CV = Op1C->getValue();
-
- // zext (x <s 0) to i32 --> x>>u31 true if signbit set.
- // zext (x >s -1) to i32 --> (x>>u31)^1 true if signbit clear.
- if ((ICI->getPredicate() == ICmpInst::ICMP_SLT && Op1CV == 0) ||
- (ICI->getPredicate() == ICmpInst::ICMP_SGT &&Op1CV.isAllOnesValue())) {
- if (!DoXform) return ICI;
-
- Value *In = ICI->getOperand(0);
- Value *Sh = ConstantInt::get(In->getType(),
- In->getType()->getPrimitiveSizeInBits()-1);
- In = InsertNewInstBefore(BinaryOperator::createLShr(In, Sh,
- In->getName()+".lobit"),
- CI);
- if (In->getType() != CI.getType())
- In = CastInst::createIntegerCast(In, CI.getType(),
- false/*ZExt*/, "tmp", &CI);
-
- if (ICI->getPredicate() == ICmpInst::ICMP_SGT) {
- Constant *One = ConstantInt::get(In->getType(), 1);
- In = InsertNewInstBefore(BinaryOperator::createXor(In, One,
- In->getName()+".not"),
- CI);
- }
-
- return ReplaceInstUsesWith(CI, In);
- }
-
-
-
- // zext (X == 0) to i32 --> X^1 iff X has only the low bit set.
- // zext (X == 0) to i32 --> (X>>1)^1 iff X has only the 2nd bit set.
- // zext (X == 1) to i32 --> X iff X has only the low bit set.
- // zext (X == 2) to i32 --> X>>1 iff X has only the 2nd bit set.
- // zext (X != 0) to i32 --> X iff X has only the low bit set.
- // zext (X != 0) to i32 --> X>>1 iff X has only the 2nd bit set.
- // zext (X != 1) to i32 --> X^1 iff X has only the low bit set.
- // zext (X != 2) to i32 --> (X>>1)^1 iff X has only the 2nd bit set.
- if ((Op1CV == 0 || Op1CV.isPowerOf2()) &&
- // This only works for EQ and NE
- ICI->isEquality()) {
- // If Op1C some other power of two, convert:
- uint32_t BitWidth = Op1C->getType()->getBitWidth();
- APInt KnownZero(BitWidth, 0), KnownOne(BitWidth, 0);
- APInt TypeMask(APInt::getAllOnesValue(BitWidth));
- ComputeMaskedBits(ICI->getOperand(0), TypeMask, KnownZero, KnownOne);
-
- APInt KnownZeroMask(~KnownZero);
- if (KnownZeroMask.isPowerOf2()) { // Exactly 1 possible 1?
- if (!DoXform) return ICI;
-
- bool isNE = ICI->getPredicate() == ICmpInst::ICMP_NE;
- if (Op1CV != 0 && (Op1CV != KnownZeroMask)) {
- // (X&4) == 2 --> false
- // (X&4) != 2 --> true
- Constant *Res = ConstantInt::get(Type::Int1Ty, isNE);
- Res = ConstantExpr::getZExt(Res, CI.getType());
- return ReplaceInstUsesWith(CI, Res);
- }
-
- uint32_t ShiftAmt = KnownZeroMask.logBase2();
- Value *In = ICI->getOperand(0);
- if (ShiftAmt) {
- // Perform a logical shr by shiftamt.
- // Insert the shift to put the result in the low bit.
- In = InsertNewInstBefore(BinaryOperator::createLShr(In,
- ConstantInt::get(In->getType(), ShiftAmt),
- In->getName()+".lobit"), CI);
- }
-
- if ((Op1CV != 0) == isNE) { // Toggle the low bit.
- Constant *One = ConstantInt::get(In->getType(), 1);
- In = BinaryOperator::createXor(In, One, "tmp");
- InsertNewInstBefore(cast<Instruction>(In), CI);
- }
-
- if (CI.getType() == In->getType())
- return ReplaceInstUsesWith(CI, In);
- else
- return CastInst::createIntegerCast(In, CI.getType(), false/*ZExt*/);
- }
- }
- }
-
- return 0;
-}
-
-Instruction *InstCombiner::visitZExt(ZExtInst &CI) {
- // If one of the common conversion will work ..
- if (Instruction *Result = commonIntCastTransforms(CI))
- return Result;
-
- Value *Src = CI.getOperand(0);
-
- // If this is a cast of a cast
- if (CastInst *CSrc = dyn_cast<CastInst>(Src)) { // A->B->C cast
- // If this is a TRUNC followed by a ZEXT then we are dealing with integral
- // types and if the sizes are just right we can convert this into a logical
- // 'and' which will be much cheaper than the pair of casts.
- if (isa<TruncInst>(CSrc)) {
- // Get the sizes of the types involved
- Value *A = CSrc->getOperand(0);
- uint32_t SrcSize = A->getType()->getPrimitiveSizeInBits();
- uint32_t MidSize = CSrc->getType()->getPrimitiveSizeInBits();
- uint32_t DstSize = CI.getType()->getPrimitiveSizeInBits();
- // If we're actually extending zero bits and the trunc is a no-op
- if (MidSize < DstSize && SrcSize == DstSize) {
- // Replace both of the casts with an And of the type mask.
- APInt AndValue(APInt::getLowBitsSet(SrcSize, MidSize));
- Constant *AndConst = ConstantInt::get(AndValue);
- Instruction *And =
- BinaryOperator::createAnd(CSrc->getOperand(0), AndConst);
- // Unfortunately, if the type changed, we need to cast it back.
- if (And->getType() != CI.getType()) {
- And->setName(CSrc->getName()+".mask");
- InsertNewInstBefore(And, CI);
- And = CastInst::createIntegerCast(And, CI.getType(), false/*ZExt*/);
- }
- return And;
- }
- }
- }
-
- if (ICmpInst *ICI = dyn_cast<ICmpInst>(Src))
- return transformZExtICmp(ICI, CI);
-
- BinaryOperator *SrcI = dyn_cast<BinaryOperator>(Src);
- if (SrcI && SrcI->getOpcode() == Instruction::Or) {
- // zext (or icmp, icmp) --> or (zext icmp), (zext icmp) if at least one
- // of the (zext icmp) will be transformed.
- ICmpInst *LHS = dyn_cast<ICmpInst>(SrcI->getOperand(0));
- ICmpInst *RHS = dyn_cast<ICmpInst>(SrcI->getOperand(1));
- if (LHS && RHS && LHS->hasOneUse() && RHS->hasOneUse() &&
- (transformZExtICmp(LHS, CI, false) ||
- transformZExtICmp(RHS, CI, false))) {
- Value *LCast = InsertCastBefore(Instruction::ZExt, LHS, CI.getType(), CI);
- Value *RCast = InsertCastBefore(Instruction::ZExt, RHS, CI.getType(), CI);
- return BinaryOperator::create(Instruction::Or, LCast, RCast);
- }
- }
-
- return 0;
-}
-
-Instruction *InstCombiner::visitSExt(SExtInst &CI) {
- if (Instruction *I = commonIntCastTransforms(CI))
- return I;
-
- Value *Src = CI.getOperand(0);
-
- // sext (x <s 0) -> ashr x, 31 -> all ones if signed
- // sext (x >s -1) -> ashr x, 31 -> all ones if not signed
- if (ICmpInst *ICI = dyn_cast<ICmpInst>(Src)) {
- // If we are just checking for a icmp eq of a single bit and zext'ing it
- // to an integer, then shift the bit to the appropriate place and then
- // cast to integer to avoid the comparison.
- if (ConstantInt *Op1C = dyn_cast<ConstantInt>(ICI->getOperand(1))) {
- const APInt &Op1CV = Op1C->getValue();
-
- // sext (x <s 0) to i32 --> x>>s31 true if signbit set.
- // sext (x >s -1) to i32 --> (x>>s31)^-1 true if signbit clear.
- if ((ICI->getPredicate() == ICmpInst::ICMP_SLT && Op1CV == 0) ||
- (ICI->getPredicate() == ICmpInst::ICMP_SGT &&Op1CV.isAllOnesValue())){
- Value *In = ICI->getOperand(0);
- Value *Sh = ConstantInt::get(In->getType(),
- In->getType()->getPrimitiveSizeInBits()-1);
- In = InsertNewInstBefore(BinaryOperator::createAShr(In, Sh,
- In->getName()+".lobit"),
- CI);
- if (In->getType() != CI.getType())
- In = CastInst::createIntegerCast(In, CI.getType(),
- true/*SExt*/, "tmp", &CI);
-
- if (ICI->getPredicate() == ICmpInst::ICMP_SGT)
- In = InsertNewInstBefore(BinaryOperator::createNot(In,
- In->getName()+".not"), CI);
-
- return ReplaceInstUsesWith(CI, In);
- }
- }
- }
-
- return 0;
-}
-
-/// FitsInFPType - Return a Constant* for the specified FP constant if it fits
-/// in the specified FP type without changing its value.
-static Constant *FitsInFPType(ConstantFP *CFP, const fltSemantics &Sem) {
- APFloat F = CFP->getValueAPF();
- if (F.convert(Sem, APFloat::rmNearestTiesToEven) == APFloat::opOK)
- return ConstantFP::get(F);
- return 0;
-}
-
-/// LookThroughFPExtensions - If this is an fp extension instruction, look
-/// through it until we get the source value.
-static Value *LookThroughFPExtensions(Value *V) {
- if (Instruction *I = dyn_cast<Instruction>(V))
- if (I->getOpcode() == Instruction::FPExt)
- return LookThroughFPExtensions(I->getOperand(0));
-
- // If this value is a constant, return the constant in the smallest FP type
- // that can accurately represent it. This allows us to turn
- // (float)((double)X+2.0) into x+2.0f.
- if (ConstantFP *CFP = dyn_cast<ConstantFP>(V)) {
- if (CFP->getType() == Type::PPC_FP128Ty)
- return V; // No constant folding of this.
- // See if the value can be truncated to float and then reextended.
- if (Value *V = FitsInFPType(CFP, APFloat::IEEEsingle))
- return V;
- if (CFP->getType() == Type::DoubleTy)
- return V; // Won't shrink.
- if (Value *V = FitsInFPType(CFP, APFloat::IEEEdouble))
- return V;
- // Don't try to shrink to various long double types.
- }
-
- return V;
-}
-
-Instruction *InstCombiner::visitFPTrunc(FPTruncInst &CI) {
- if (Instruction *I = commonCastTransforms(CI))
- return I;
-
- // If we have fptrunc(add (fpextend x), (fpextend y)), where x and y are
- // smaller than the destination type, we can eliminate the truncate by doing
- // the add as the smaller type. This applies to add/sub/mul/div as well as
- // many builtins (sqrt, etc).
- BinaryOperator *OpI = dyn_cast<BinaryOperator>(CI.getOperand(0));
- if (OpI && OpI->hasOneUse()) {
- switch (OpI->getOpcode()) {
- default: break;
- case Instruction::Add:
- case Instruction::Sub:
- case Instruction::Mul:
- case Instruction::FDiv:
- case Instruction::FRem:
- const Type *SrcTy = OpI->getType();
- Value *LHSTrunc = LookThroughFPExtensions(OpI->getOperand(0));
- Value *RHSTrunc = LookThroughFPExtensions(OpI->getOperand(1));
- if (LHSTrunc->getType() != SrcTy &&
- RHSTrunc->getType() != SrcTy) {
- unsigned DstSize = CI.getType()->getPrimitiveSizeInBits();
- // If the source types were both smaller than the destination type of
- // the cast, do this xform.
- if (LHSTrunc->getType()->getPrimitiveSizeInBits() <= DstSize &&
- RHSTrunc->getType()->getPrimitiveSizeInBits() <= DstSize) {
- LHSTrunc = InsertCastBefore(Instruction::FPExt, LHSTrunc,
- CI.getType(), CI);
- RHSTrunc = InsertCastBefore(Instruction::FPExt, RHSTrunc,
- CI.getType(), CI);
- return BinaryOperator::create(OpI->getOpcode(), LHSTrunc, RHSTrunc);
- }
- }
- break;
- }
- }
- return 0;
-}
-
-Instruction *InstCombiner::visitFPExt(CastInst &CI) {
- return commonCastTransforms(CI);
-}
-
-Instruction *InstCombiner::visitFPToUI(CastInst &CI) {
- return commonCastTransforms(CI);
-}
-
-Instruction *InstCombiner::visitFPToSI(CastInst &CI) {
- return commonCastTransforms(CI);
-}
-
-Instruction *InstCombiner::visitUIToFP(CastInst &CI) {
- return commonCastTransforms(CI);
-}
-
-Instruction *InstCombiner::visitSIToFP(CastInst &CI) {
- return commonCastTransforms(CI);
-}
-
-Instruction *InstCombiner::visitPtrToInt(CastInst &CI) {
- return commonPointerCastTransforms(CI);
-}
-
-Instruction *InstCombiner::visitIntToPtr(IntToPtrInst &CI) {
- if (Instruction *I = commonCastTransforms(CI))
- return I;
-
- const Type *DestPointee = cast<PointerType>(CI.getType())->getElementType();
- if (!DestPointee->isSized()) return 0;
-
- // If this is inttoptr(add (ptrtoint x), cst), try to turn this into a GEP.
- ConstantInt *Cst;
- Value *X;
- if (match(CI.getOperand(0), m_Add(m_Cast<PtrToIntInst>(m_Value(X)),
- m_ConstantInt(Cst)))) {
- // If the source and destination operands have the same type, see if this
- // is a single-index GEP.
- if (X->getType() == CI.getType()) {
- // Get the size of the pointee type.
- uint64_t Size = TD->getABITypeSize(DestPointee);
-
- // Convert the constant to intptr type.
- APInt Offset = Cst->getValue();
- Offset.sextOrTrunc(TD->getPointerSizeInBits());
-
- // If Offset is evenly divisible by Size, we can do this xform.
- if (Size && !APIntOps::srem(Offset, APInt(Offset.getBitWidth(), Size))){
- Offset = APIntOps::sdiv(Offset, APInt(Offset.getBitWidth(), Size));
- return GetElementPtrInst::Create(X, ConstantInt::get(Offset));
- }
- }
- // TODO: Could handle other cases, e.g. where add is indexing into field of
- // struct etc.
- } else if (CI.getOperand(0)->hasOneUse() &&
- match(CI.getOperand(0), m_Add(m_Value(X), m_ConstantInt(Cst)))) {
- // Otherwise, if this is inttoptr(add x, cst), try to turn this into an
- // "inttoptr+GEP" instead of "add+intptr".
-
- // Get the size of the pointee type.
- uint64_t Size = TD->getABITypeSize(DestPointee);
-
- // Convert the constant to intptr type.
- APInt Offset = Cst->getValue();
- Offset.sextOrTrunc(TD->getPointerSizeInBits());
-
- // If Offset is evenly divisible by Size, we can do this xform.
- if (Size && !APIntOps::srem(Offset, APInt(Offset.getBitWidth(), Size))){
- Offset = APIntOps::sdiv(Offset, APInt(Offset.getBitWidth(), Size));
-
- Instruction *P = InsertNewInstBefore(new IntToPtrInst(X, CI.getType(),
- "tmp"), CI);
- return GetElementPtrInst::Create(P, ConstantInt::get(Offset), "tmp");
- }
- }
- return 0;
-}
-
-Instruction *InstCombiner::visitBitCast(BitCastInst &CI) {
- // If the operands are integer typed then apply the integer transforms,
- // otherwise just apply the common ones.
- Value *Src = CI.getOperand(0);
- const Type *SrcTy = Src->getType();
- const Type *DestTy = CI.getType();
-
- if (SrcTy->isInteger() && DestTy->isInteger()) {
- if (Instruction *Result = commonIntCastTransforms(CI))
- return Result;
- } else if (isa<PointerType>(SrcTy)) {
- if (Instruction *I = commonPointerCastTransforms(CI))
- return I;
- } else {
- if (Instruction *Result = commonCastTransforms(CI))
- return Result;
- }
-
-
- // Get rid of casts from one type to the same type. These are useless and can
- // be replaced by the operand.
- if (DestTy == Src->getType())
- return ReplaceInstUsesWith(CI, Src);
-
- if (const PointerType *DstPTy = dyn_cast<PointerType>(DestTy)) {
- const PointerType *SrcPTy = cast<PointerType>(SrcTy);
- const Type *DstElTy = DstPTy->getElementType();
- const Type *SrcElTy = SrcPTy->getElementType();
-
- // If the address spaces don't match, don't eliminate the bitcast, which is
- // required for changing types.
- if (SrcPTy->getAddressSpace() != DstPTy->getAddressSpace())
- return 0;
-
- // If we are casting a malloc or alloca to a pointer to a type of the same
- // size, rewrite the allocation instruction to allocate the "right" type.
- if (AllocationInst *AI = dyn_cast<AllocationInst>(Src))
- if (Instruction *V = PromoteCastOfAllocation(CI, *AI))
- return V;
-
- // If the source and destination are pointers, and this cast is equivalent
- // to a getelementptr X, 0, 0, 0... turn it into the appropriate gep.
- // This can enhance SROA and other transforms that want type-safe pointers.
- Constant *ZeroUInt = Constant::getNullValue(Type::Int32Ty);
- unsigned NumZeros = 0;
- while (SrcElTy != DstElTy &&
- isa<CompositeType>(SrcElTy) && !isa<PointerType>(SrcElTy) &&
- SrcElTy->getNumContainedTypes() /* not "{}" */) {
- SrcElTy = cast<CompositeType>(SrcElTy)->getTypeAtIndex(ZeroUInt);
- ++NumZeros;
- }
-
- // If we found a path from the src to dest, create the getelementptr now.
- if (SrcElTy == DstElTy) {
- SmallVector<Value*, 8> Idxs(NumZeros+1, ZeroUInt);
- return GetElementPtrInst::Create(Src, Idxs.begin(), Idxs.end(), "",
- ((Instruction*) NULL));
- }
- }
-
- if (ShuffleVectorInst *SVI = dyn_cast<ShuffleVectorInst>(Src)) {
- if (SVI->hasOneUse()) {
- // Okay, we have (bitconvert (shuffle ..)). Check to see if this is
- // a bitconvert to a vector with the same # elts.
- if (isa<VectorType>(DestTy) &&
- cast<VectorType>(DestTy)->getNumElements() ==
- SVI->getType()->getNumElements()) {
- CastInst *Tmp;
- // If either of the operands is a cast from CI.getType(), then
- // evaluating the shuffle in the casted destination's type will allow
- // us to eliminate at least one cast.
- if (((Tmp = dyn_cast<CastInst>(SVI->getOperand(0))) &&
- Tmp->getOperand(0)->getType() == DestTy) ||
- ((Tmp = dyn_cast<CastInst>(SVI->getOperand(1))) &&
- Tmp->getOperand(0)->getType() == DestTy)) {
- Value *LHS = InsertOperandCastBefore(Instruction::BitCast,
- SVI->getOperand(0), DestTy, &CI);
- Value *RHS = InsertOperandCastBefore(Instruction::BitCast,
- SVI->getOperand(1), DestTy, &CI);
- // Return a new shuffle vector. Use the same element ID's, as we
- // know the vector types match #elts.
- return new ShuffleVectorInst(LHS, RHS, SVI->getOperand(2));
- }
- }
- }
- }
- return 0;
-}
-
-/// GetSelectFoldableOperands - We want to turn code that looks like this:
-/// %C = or %A, %B
-/// %D = select %cond, %C, %A
-/// into:
-/// %C = select %cond, %B, 0
-/// %D = or %A, %C
-///
-/// Assuming that the specified instruction is an operand to the select, return
-/// a bitmask indicating which operands of this instruction are foldable if they
-/// equal the other incoming value of the select.
-///
-static unsigned GetSelectFoldableOperands(Instruction *I) {
- switch (I->getOpcode()) {
- case Instruction::Add:
- case Instruction::Mul:
- case Instruction::And:
- case Instruction::Or:
- case Instruction::Xor:
- return 3; // Can fold through either operand.
- case Instruction::Sub: // Can only fold on the amount subtracted.
- case Instruction::Shl: // Can only fold on the shift amount.
- case Instruction::LShr:
- case Instruction::AShr:
- return 1;
- default:
- return 0; // Cannot fold
- }
-}
-
-/// GetSelectFoldableConstant - For the same transformation as the previous
-/// function, return the identity constant that goes into the select.
-static Constant *GetSelectFoldableConstant(Instruction *I) {
- switch (I->getOpcode()) {
- default: assert(0 && "This cannot happen!"); abort();
- case Instruction::Add:
- case Instruction::Sub:
- case Instruction::Or:
- case Instruction::Xor:
- case Instruction::Shl:
- case Instruction::LShr:
- case Instruction::AShr:
- return Constant::getNullValue(I->getType());
- case Instruction::And:
- return Constant::getAllOnesValue(I->getType());
- case Instruction::Mul:
- return ConstantInt::get(I->getType(), 1);
- }
-}
-
-/// FoldSelectOpOp - Here we have (select c, TI, FI), and we know that TI and FI
-/// have the same opcode and only one use each. Try to simplify this.
-Instruction *InstCombiner::FoldSelectOpOp(SelectInst &SI, Instruction *TI,
- Instruction *FI) {
- if (TI->getNumOperands() == 1) {
- // If this is a non-volatile load or a cast from the same type,
- // merge.
- if (TI->isCast()) {
- if (TI->getOperand(0)->getType() != FI->getOperand(0)->getType())
- return 0;
- } else {
- return 0; // unknown unary op.
- }
-
- // Fold this by inserting a select from the input values.
- SelectInst *NewSI = SelectInst::Create(SI.getCondition(), TI->getOperand(0),
- FI->getOperand(0), SI.getName()+".v");
- InsertNewInstBefore(NewSI, SI);
- return CastInst::create(Instruction::CastOps(TI->getOpcode()), NewSI,
- TI->getType());
- }
-
- // Only handle binary operators here.
- if (!isa<BinaryOperator>(TI))
- return 0;
-
- // Figure out if the operations have any operands in common.
- Value *MatchOp, *OtherOpT, *OtherOpF;
- bool MatchIsOpZero;
- if (TI->getOperand(0) == FI->getOperand(0)) {
- MatchOp = TI->getOperand(0);
- OtherOpT = TI->getOperand(1);
- OtherOpF = FI->getOperand(1);
- MatchIsOpZero = true;
- } else if (TI->getOperand(1) == FI->getOperand(1)) {
- MatchOp = TI->getOperand(1);
- OtherOpT = TI->getOperand(0);
- OtherOpF = FI->getOperand(0);
- MatchIsOpZero = false;
- } else if (!TI->isCommutative()) {
- return 0;
- } else if (TI->getOperand(0) == FI->getOperand(1)) {
- MatchOp = TI->getOperand(0);
- OtherOpT = TI->getOperand(1);
- OtherOpF = FI->getOperand(0);
- MatchIsOpZero = true;
- } else if (TI->getOperand(1) == FI->getOperand(0)) {
- MatchOp = TI->getOperand(1);
- OtherOpT = TI->getOperand(0);
- OtherOpF = FI->getOperand(1);
- MatchIsOpZero = true;
- } else {
- return 0;
- }
-
- // If we reach here, they do have operations in common.
- SelectInst *NewSI = SelectInst::Create(SI.getCondition(), OtherOpT,
- OtherOpF, SI.getName()+".v");
- InsertNewInstBefore(NewSI, SI);
-
- if (BinaryOperator *BO = dyn_cast<BinaryOperator>(TI)) {
- if (MatchIsOpZero)
- return BinaryOperator::create(BO->getOpcode(), MatchOp, NewSI);
- else
- return BinaryOperator::create(BO->getOpcode(), NewSI, MatchOp);
- }
- assert(0 && "Shouldn't get here");
- return 0;
-}
-
-Instruction *InstCombiner::visitSelectInst(SelectInst &SI) {
- Value *CondVal = SI.getCondition();
- Value *TrueVal = SI.getTrueValue();
- Value *FalseVal = SI.getFalseValue();
-
- // select true, X, Y -> X
- // select false, X, Y -> Y
- if (ConstantInt *C = dyn_cast<ConstantInt>(CondVal))
- return ReplaceInstUsesWith(SI, C->getZExtValue() ? TrueVal : FalseVal);
-
- // select C, X, X -> X
- if (TrueVal == FalseVal)
- return ReplaceInstUsesWith(SI, TrueVal);
-
- if (isa<UndefValue>(TrueVal)) // select C, undef, X -> X
- return ReplaceInstUsesWith(SI, FalseVal);
- if (isa<UndefValue>(FalseVal)) // select C, X, undef -> X
- return ReplaceInstUsesWith(SI, TrueVal);
- if (isa<UndefValue>(CondVal)) { // select undef, X, Y -> X or Y
- if (isa<Constant>(TrueVal))
- return ReplaceInstUsesWith(SI, TrueVal);
- else
- return ReplaceInstUsesWith(SI, FalseVal);
- }
-
- if (SI.getType() == Type::Int1Ty) {
- if (ConstantInt *C = dyn_cast<ConstantInt>(TrueVal)) {
- if (C->getZExtValue()) {
- // Change: A = select B, true, C --> A = or B, C
- return BinaryOperator::createOr(CondVal, FalseVal);
- } else {
- // Change: A = select B, false, C --> A = and !B, C
- Value *NotCond =
- InsertNewInstBefore(BinaryOperator::createNot(CondVal,
- "not."+CondVal->getName()), SI);
- return BinaryOperator::createAnd(NotCond, FalseVal);
- }
- } else if (ConstantInt *C = dyn_cast<ConstantInt>(FalseVal)) {
- if (C->getZExtValue() == false) {
- // Change: A = select B, C, false --> A = and B, C
- return BinaryOperator::createAnd(CondVal, TrueVal);
- } else {
- // Change: A = select B, C, true --> A = or !B, C
- Value *NotCond =
- InsertNewInstBefore(BinaryOperator::createNot(CondVal,
- "not."+CondVal->getName()), SI);
- return BinaryOperator::createOr(NotCond, TrueVal);
- }
- }
-
- // select a, b, a -> a&b
- // select a, a, b -> a|b
- if (CondVal == TrueVal)
- return BinaryOperator::createOr(CondVal, FalseVal);
- else if (CondVal == FalseVal)
- return BinaryOperator::createAnd(CondVal, TrueVal);
- }
-
- // Selecting between two integer constants?
- if (ConstantInt *TrueValC = dyn_cast<ConstantInt>(TrueVal))
- if (ConstantInt *FalseValC = dyn_cast<ConstantInt>(FalseVal)) {
- // select C, 1, 0 -> zext C to int
- if (FalseValC->isZero() && TrueValC->getValue() == 1) {
- return CastInst::create(Instruction::ZExt, CondVal, SI.getType());
- } else if (TrueValC->isZero() && FalseValC->getValue() == 1) {
- // select C, 0, 1 -> zext !C to int
- Value *NotCond =
- InsertNewInstBefore(BinaryOperator::createNot(CondVal,
- "not."+CondVal->getName()), SI);
- return CastInst::create(Instruction::ZExt, NotCond, SI.getType());
- }
-
- // FIXME: Turn select 0/-1 and -1/0 into sext from condition!
-
- if (ICmpInst *IC = dyn_cast<ICmpInst>(SI.getCondition())) {
-
- // (x <s 0) ? -1 : 0 -> ashr x, 31
- if (TrueValC->isAllOnesValue() && FalseValC->isZero())
- if (ConstantInt *CmpCst = dyn_cast<ConstantInt>(IC->getOperand(1))) {
- if (IC->getPredicate() == ICmpInst::ICMP_SLT && CmpCst->isZero()) {
- // The comparison constant and the result are not neccessarily the
- // same width. Make an all-ones value by inserting a AShr.
- Value *X = IC->getOperand(0);
- uint32_t Bits = X->getType()->getPrimitiveSizeInBits();
- Constant *ShAmt = ConstantInt::get(X->getType(), Bits-1);
- Instruction *SRA = BinaryOperator::create(Instruction::AShr, X,
- ShAmt, "ones");
- InsertNewInstBefore(SRA, SI);
-
- // Finally, convert to the type of the select RHS. We figure out
- // if this requires a SExt, Trunc or BitCast based on the sizes.
- Instruction::CastOps opc = Instruction::BitCast;
- uint32_t SRASize = SRA->getType()->getPrimitiveSizeInBits();
- uint32_t SISize = SI.getType()->getPrimitiveSizeInBits();
- if (SRASize < SISize)
- opc = Instruction::SExt;
- else if (SRASize > SISize)
- opc = Instruction::Trunc;
- return CastInst::create(opc, SRA, SI.getType());
- }
- }
-
-
- // If one of the constants is zero (we know they can't both be) and we
- // have an icmp instruction with zero, and we have an 'and' with the
- // non-constant value, eliminate this whole mess. This corresponds to
- // cases like this: ((X & 27) ? 27 : 0)
- if (TrueValC->isZero() || FalseValC->isZero())
- if (IC->isEquality() && isa<ConstantInt>(IC->getOperand(1)) &&
- cast<Constant>(IC->getOperand(1))->isNullValue())
- if (Instruction *ICA = dyn_cast<Instruction>(IC->getOperand(0)))
- if (ICA->getOpcode() == Instruction::And &&
- isa<ConstantInt>(ICA->getOperand(1)) &&
- (ICA->getOperand(1) == TrueValC ||
- ICA->getOperand(1) == FalseValC) &&
- isOneBitSet(cast<ConstantInt>(ICA->getOperand(1)))) {
- // Okay, now we know that everything is set up, we just don't
- // know whether we have a icmp_ne or icmp_eq and whether the
- // true or false val is the zero.
- bool ShouldNotVal = !TrueValC->isZero();
- ShouldNotVal ^= IC->getPredicate() == ICmpInst::ICMP_NE;
- Value *V = ICA;
- if (ShouldNotVal)
- V = InsertNewInstBefore(BinaryOperator::create(
- Instruction::Xor, V, ICA->getOperand(1)), SI);
- return ReplaceInstUsesWith(SI, V);
- }
- }
- }
-
- // See if we are selecting two values based on a comparison of the two values.
- if (FCmpInst *FCI = dyn_cast<FCmpInst>(CondVal)) {
- if (FCI->getOperand(0) == TrueVal && FCI->getOperand(1) == FalseVal) {
- // Transform (X == Y) ? X : Y -> Y
- if (FCI->getPredicate() == FCmpInst::FCMP_OEQ) {
- // This is not safe in general for floating point:
- // consider X== -0, Y== +0.
- // It becomes safe if either operand is a nonzero constant.
- ConstantFP *CFPt, *CFPf;
- if (((CFPt = dyn_cast<ConstantFP>(TrueVal)) &&
- !CFPt->getValueAPF().isZero()) ||
- ((CFPf = dyn_cast<ConstantFP>(FalseVal)) &&
- !CFPf->getValueAPF().isZero()))
- return ReplaceInstUsesWith(SI, FalseVal);
- }
- // Transform (X != Y) ? X : Y -> X
- if (FCI->getPredicate() == FCmpInst::FCMP_ONE)
- return ReplaceInstUsesWith(SI, TrueVal);
- // NOTE: if we wanted to, this is where to detect MIN/MAX/ABS/etc.
-
- } else if (FCI->getOperand(0) == FalseVal && FCI->getOperand(1) == TrueVal){
- // Transform (X == Y) ? Y : X -> X
- if (FCI->getPredicate() == FCmpInst::FCMP_OEQ) {
- // This is not safe in general for floating point:
- // consider X== -0, Y== +0.
- // It becomes safe if either operand is a nonzero constant.
- ConstantFP *CFPt, *CFPf;
- if (((CFPt = dyn_cast<ConstantFP>(TrueVal)) &&
- !CFPt->getValueAPF().isZero()) ||
- ((CFPf = dyn_cast<ConstantFP>(FalseVal)) &&
- !CFPf->getValueAPF().isZero()))
- return ReplaceInstUsesWith(SI, FalseVal);
- }
- // Transform (X != Y) ? Y : X -> Y
- if (FCI->getPredicate() == FCmpInst::FCMP_ONE)
- return ReplaceInstUsesWith(SI, TrueVal);
- // NOTE: if we wanted to, this is where to detect MIN/MAX/ABS/etc.
- }
- }
-
- // See if we are selecting two values based on a comparison of the two values.
- if (ICmpInst *ICI = dyn_cast<ICmpInst>(CondVal)) {
- if (ICI->getOperand(0) == TrueVal && ICI->getOperand(1) == FalseVal) {
- // Transform (X == Y) ? X : Y -> Y
- if (ICI->getPredicate() == ICmpInst::ICMP_EQ)
- return ReplaceInstUsesWith(SI, FalseVal);
- // Transform (X != Y) ? X : Y -> X
- if (ICI->getPredicate() == ICmpInst::ICMP_NE)
- return ReplaceInstUsesWith(SI, TrueVal);
- // NOTE: if we wanted to, this is where to detect MIN/MAX/ABS/etc.
-
- } else if (ICI->getOperand(0) == FalseVal && ICI->getOperand(1) == TrueVal){
- // Transform (X == Y) ? Y : X -> X
- if (ICI->getPredicate() == ICmpInst::ICMP_EQ)
- return ReplaceInstUsesWith(SI, FalseVal);
- // Transform (X != Y) ? Y : X -> Y
- if (ICI->getPredicate() == ICmpInst::ICMP_NE)
- return ReplaceInstUsesWith(SI, TrueVal);
- // NOTE: if we wanted to, this is where to detect MIN/MAX/ABS/etc.
- }
- }
-
- if (Instruction *TI = dyn_cast<Instruction>(TrueVal))
- if (Instruction *FI = dyn_cast<Instruction>(FalseVal))
- if (TI->hasOneUse() && FI->hasOneUse()) {
- Instruction *AddOp = 0, *SubOp = 0;
-
- // Turn (select C, (op X, Y), (op X, Z)) -> (op X, (select C, Y, Z))
- if (TI->getOpcode() == FI->getOpcode())
- if (Instruction *IV = FoldSelectOpOp(SI, TI, FI))
- return IV;
-
- // Turn select C, (X+Y), (X-Y) --> (X+(select C, Y, (-Y))). This is
- // even legal for FP.
- if (TI->getOpcode() == Instruction::Sub &&
- FI->getOpcode() == Instruction::Add) {
- AddOp = FI; SubOp = TI;
- } else if (FI->getOpcode() == Instruction::Sub &&
- TI->getOpcode() == Instruction::Add) {
- AddOp = TI; SubOp = FI;
- }
-
- if (AddOp) {
- Value *OtherAddOp = 0;
- if (SubOp->getOperand(0) == AddOp->getOperand(0)) {
- OtherAddOp = AddOp->getOperand(1);
- } else if (SubOp->getOperand(0) == AddOp->getOperand(1)) {
- OtherAddOp = AddOp->getOperand(0);
- }
-
- if (OtherAddOp) {
- // So at this point we know we have (Y -> OtherAddOp):
- // select C, (add X, Y), (sub X, Z)
- Value *NegVal; // Compute -Z
- if (Constant *C = dyn_cast<Constant>(SubOp->getOperand(1))) {
- NegVal = ConstantExpr::getNeg(C);
- } else {
- NegVal = InsertNewInstBefore(
- BinaryOperator::createNeg(SubOp->getOperand(1), "tmp"), SI);
- }
-
- Value *NewTrueOp = OtherAddOp;
- Value *NewFalseOp = NegVal;
- if (AddOp != TI)
- std::swap(NewTrueOp, NewFalseOp);
- Instruction *NewSel =
- SelectInst::Create(CondVal, NewTrueOp,NewFalseOp,SI.getName()+".p");
-
- NewSel = InsertNewInstBefore(NewSel, SI);
- return BinaryOperator::createAdd(SubOp->getOperand(0), NewSel);
- }
- }
- }
-
- // See if we can fold the select into one of our operands.
- if (SI.getType()->isInteger()) {
- // See the comment above GetSelectFoldableOperands for a description of the
- // transformation we are doing here.
- if (Instruction *TVI = dyn_cast<Instruction>(TrueVal))
- if (TVI->hasOneUse() && TVI->getNumOperands() == 2 &&
- !isa<Constant>(FalseVal))
- if (unsigned SFO = GetSelectFoldableOperands(TVI)) {
- unsigned OpToFold = 0;
- if ((SFO & 1) && FalseVal == TVI->getOperand(0)) {
- OpToFold = 1;
- } else if ((SFO & 2) && FalseVal == TVI->getOperand(1)) {
- OpToFold = 2;
- }
-
- if (OpToFold) {
- Constant *C = GetSelectFoldableConstant(TVI);
- Instruction *NewSel =
- SelectInst::Create(SI.getCondition(), TVI->getOperand(2-OpToFold), C);
- InsertNewInstBefore(NewSel, SI);
- NewSel->takeName(TVI);
- if (BinaryOperator *BO = dyn_cast<BinaryOperator>(TVI))
- return BinaryOperator::create(BO->getOpcode(), FalseVal, NewSel);
- else {
- assert(0 && "Unknown instruction!!");
- }
- }
- }
-
- if (Instruction *FVI = dyn_cast<Instruction>(FalseVal))
- if (FVI->hasOneUse() && FVI->getNumOperands() == 2 &&
- !isa<Constant>(TrueVal))
- if (unsigned SFO = GetSelectFoldableOperands(FVI)) {
- unsigned OpToFold = 0;
- if ((SFO & 1) && TrueVal == FVI->getOperand(0)) {
- OpToFold = 1;
- } else if ((SFO & 2) && TrueVal == FVI->getOperand(1)) {
- OpToFold = 2;
- }
-
- if (OpToFold) {
- Constant *C = GetSelectFoldableConstant(FVI);
- Instruction *NewSel =
- SelectInst::Create(SI.getCondition(), C, FVI->getOperand(2-OpToFold));
- InsertNewInstBefore(NewSel, SI);
- NewSel->takeName(FVI);
- if (BinaryOperator *BO = dyn_cast<BinaryOperator>(FVI))
- return BinaryOperator::create(BO->getOpcode(), TrueVal, NewSel);
- else
- assert(0 && "Unknown instruction!!");
- }
- }
- }
-
- if (BinaryOperator::isNot(CondVal)) {
- SI.setOperand(0, BinaryOperator::getNotArgument(CondVal));
- SI.setOperand(1, FalseVal);
- SI.setOperand(2, TrueVal);
- return &SI;
- }
-
- return 0;
-}
-
-/// EnforceKnownAlignment - If the specified pointer points to an object that
-/// we control, modify the object's alignment to PrefAlign. This isn't
-/// often possible though. If alignment is important, a more reliable approach
-/// is to simply align all global variables and allocation instructions to
-/// their preferred alignment from the beginning.
-///
-static unsigned EnforceKnownAlignment(Value *V,
- unsigned Align, unsigned PrefAlign) {
-
- User *U = dyn_cast<User>(V);
- if (!U) return Align;
-
- switch (getOpcode(U)) {
- default: break;
- case Instruction::BitCast:
- return EnforceKnownAlignment(U->getOperand(0), Align, PrefAlign);
- case Instruction::GetElementPtr: {
- // If all indexes are zero, it is just the alignment of the base pointer.
- bool AllZeroOperands = true;
- for (unsigned i = 1, e = U->getNumOperands(); i != e; ++i)
- if (!isa<Constant>(U->getOperand(i)) ||
- !cast<Constant>(U->getOperand(i))->isNullValue()) {
- AllZeroOperands = false;
- break;
- }
-
- if (AllZeroOperands) {
- // Treat this like a bitcast.
- return EnforceKnownAlignment(U->getOperand(0), Align, PrefAlign);
- }
- break;
- }
- }
-
- if (GlobalValue *GV = dyn_cast<GlobalValue>(V)) {
- // If there is a large requested alignment and we can, bump up the alignment
- // of the global.
- if (!GV->isDeclaration()) {
- GV->setAlignment(PrefAlign);
- Align = PrefAlign;
- }
- } else if (AllocationInst *AI = dyn_cast<AllocationInst>(V)) {
- // If there is a requested alignment and if this is an alloca, round up. We
- // don't do this for malloc, because some systems can't respect the request.
- if (isa<AllocaInst>(AI)) {
- AI->setAlignment(PrefAlign);
- Align = PrefAlign;
- }
- }
-
- return Align;
-}
-
-/// GetOrEnforceKnownAlignment - If the specified pointer has an alignment that
-/// we can determine, return it, otherwise return 0. If PrefAlign is specified,
-/// and it is more than the alignment of the ultimate object, see if we can
-/// increase the alignment of the ultimate object, making this check succeed.
-unsigned InstCombiner::GetOrEnforceKnownAlignment(Value *V,
- unsigned PrefAlign) {
- unsigned BitWidth = TD ? TD->getTypeSizeInBits(V->getType()) :
- sizeof(PrefAlign) * CHAR_BIT;
- APInt Mask = APInt::getAllOnesValue(BitWidth);
- APInt KnownZero(BitWidth, 0), KnownOne(BitWidth, 0);
- ComputeMaskedBits(V, Mask, KnownZero, KnownOne);
- unsigned TrailZ = KnownZero.countTrailingOnes();
- unsigned Align = 1u << std::min(BitWidth - 1, TrailZ);
-
- if (PrefAlign > Align)
- Align = EnforceKnownAlignment(V, Align, PrefAlign);
-
- // We don't need to make any adjustment.
- return Align;
-}
-
-Instruction *InstCombiner::SimplifyMemTransfer(MemIntrinsic *MI) {
- unsigned DstAlign = GetOrEnforceKnownAlignment(MI->getOperand(1));
- unsigned SrcAlign = GetOrEnforceKnownAlignment(MI->getOperand(2));
- unsigned MinAlign = std::min(DstAlign, SrcAlign);
- unsigned CopyAlign = MI->getAlignment()->getZExtValue();
-
- if (CopyAlign < MinAlign) {
- MI->setAlignment(ConstantInt::get(Type::Int32Ty, MinAlign));
- return MI;
- }
-
- // If MemCpyInst length is 1/2/4/8 bytes then replace memcpy with
- // load/store.
- ConstantInt *MemOpLength = dyn_cast<ConstantInt>(MI->getOperand(3));
- if (MemOpLength == 0) return 0;
-
- // Source and destination pointer types are always "i8*" for intrinsic. See
- // if the size is something we can handle with a single primitive load/store.
- // A single load+store correctly handles overlapping memory in the memmove
- // case.
- unsigned Size = MemOpLength->getZExtValue();
- if (Size == 0) return MI; // Delete this mem transfer.
-
- if (Size > 8 || (Size&(Size-1)))
- return 0; // If not 1/2/4/8 bytes, exit.
-
- // Use an integer load+store unless we can find something better.
- Type *NewPtrTy = PointerType::getUnqual(IntegerType::get(Size<<3));
-
- // Memcpy forces the use of i8* for the source and destination. That means
- // that if you're using memcpy to move one double around, you'll get a cast
- // from double* to i8*. We'd much rather use a double load+store rather than
- // an i64 load+store, here because this improves the odds that the source or
- // dest address will be promotable. See if we can find a better type than the
- // integer datatype.
- if (Value *Op = getBitCastOperand(MI->getOperand(1))) {
- const Type *SrcETy = cast<PointerType>(Op->getType())->getElementType();
- if (SrcETy->isSized() && TD->getTypeStoreSize(SrcETy) == Size) {
- // The SrcETy might be something like {{{double}}} or [1 x double]. Rip
- // down through these levels if so.
- while (!SrcETy->isFirstClassType()) {
- if (const StructType *STy = dyn_cast<StructType>(SrcETy)) {
- if (STy->getNumElements() == 1)
- SrcETy = STy->getElementType(0);
- else
- break;
- } else if (const ArrayType *ATy = dyn_cast<ArrayType>(SrcETy)) {
- if (ATy->getNumElements() == 1)
- SrcETy = ATy->getElementType();
- else
- break;
- } else
- break;
- }
-
- if (SrcETy->isFirstClassType())
- NewPtrTy = PointerType::getUnqual(SrcETy);
- }
- }
-
-
- // If the memcpy/memmove provides better alignment info than we can
- // infer, use it.
- SrcAlign = std::max(SrcAlign, CopyAlign);
- DstAlign = std::max(DstAlign, CopyAlign);
-
- Value *Src = InsertBitCastBefore(MI->getOperand(2), NewPtrTy, *MI);
- Value *Dest = InsertBitCastBefore(MI->getOperand(1), NewPtrTy, *MI);
- Instruction *L = new LoadInst(Src, "tmp", false, SrcAlign);
- InsertNewInstBefore(L, *MI);
- InsertNewInstBefore(new StoreInst(L, Dest, false, DstAlign), *MI);
-
- // Set the size of the copy to 0, it will be deleted on the next iteration.
- MI->setOperand(3, Constant::getNullValue(MemOpLength->getType()));
- return MI;
-}
-
-Instruction *InstCombiner::SimplifyMemSet(MemSetInst *MI) {
- unsigned Alignment = GetOrEnforceKnownAlignment(MI->getDest());
- if (MI->getAlignment()->getZExtValue() < Alignment) {
- MI->setAlignment(ConstantInt::get(Type::Int32Ty, Alignment));
- return MI;
- }
-
- // Extract the length and alignment and fill if they are constant.
- ConstantInt *LenC = dyn_cast<ConstantInt>(MI->getLength());
- ConstantInt *FillC = dyn_cast<ConstantInt>(MI->getValue());
- if (!LenC || !FillC || FillC->getType() != Type::Int8Ty)
- return 0;
- uint64_t Len = LenC->getZExtValue();
- Alignment = MI->getAlignment()->getZExtValue();
-
- // If the length is zero, this is a no-op
- if (Len == 0) return MI; // memset(d,c,0,a) -> noop
-
- // memset(s,c,n) -> store s, c (for n=1,2,4,8)
- if (Len <= 8 && isPowerOf2_32((uint32_t)Len)) {
- const Type *ITy = IntegerType::get(Len*8); // n=1 -> i8.
-
- Value *Dest = MI->getDest();
- Dest = InsertBitCastBefore(Dest, PointerType::getUnqual(ITy), *MI);
-
- // Alignment 0 is identity for alignment 1 for memset, but not store.
- if (Alignment == 0) Alignment = 1;
-
- // Extract the fill value and store.
- uint64_t Fill = FillC->getZExtValue()*0x0101010101010101ULL;
- InsertNewInstBefore(new StoreInst(ConstantInt::get(ITy, Fill), Dest, false,
- Alignment), *MI);
-
- // Set the size of the copy to 0, it will be deleted on the next iteration.
- MI->setLength(Constant::getNullValue(LenC->getType()));
- return MI;
- }
-
- return 0;
-}
-
-
-/// visitCallInst - CallInst simplification. This mostly only handles folding
-/// of intrinsic instructions. For normal calls, it allows visitCallSite to do
-/// the heavy lifting.
-///
-Instruction *InstCombiner::visitCallInst(CallInst &CI) {
- IntrinsicInst *II = dyn_cast<IntrinsicInst>(&CI);
- if (!II) return visitCallSite(&CI);
-
- // Intrinsics cannot occur in an invoke, so handle them here instead of in
- // visitCallSite.
- if (MemIntrinsic *MI = dyn_cast<MemIntrinsic>(II)) {
- bool Changed = false;
-
- // memmove/cpy/set of zero bytes is a noop.
- if (Constant *NumBytes = dyn_cast<Constant>(MI->getLength())) {
- if (NumBytes->isNullValue()) return EraseInstFromFunction(CI);
-
- if (ConstantInt *CI = dyn_cast<ConstantInt>(NumBytes))
- if (CI->getZExtValue() == 1) {
- // Replace the instruction with just byte operations. We would
- // transform other cases to loads/stores, but we don't know if
- // alignment is sufficient.
- }
- }
-
- // If we have a memmove and the source operation is a constant global,
- // then the source and dest pointers can't alias, so we can change this
- // into a call to memcpy.
- if (MemMoveInst *MMI = dyn_cast<MemMoveInst>(MI)) {
- if (GlobalVariable *GVSrc = dyn_cast<GlobalVariable>(MMI->getSource()))
- if (GVSrc->isConstant()) {
- Module *M = CI.getParent()->getParent()->getParent();
- Intrinsic::ID MemCpyID;
- if (CI.getOperand(3)->getType() == Type::Int32Ty)
- MemCpyID = Intrinsic::memcpy_i32;
- else
- MemCpyID = Intrinsic::memcpy_i64;
- CI.setOperand(0, Intrinsic::getDeclaration(M, MemCpyID));
- Changed = true;
- }
- }
-
- // If we can determine a pointer alignment that is bigger than currently
- // set, update the alignment.
- if (isa<MemCpyInst>(MI) || isa<MemMoveInst>(MI)) {
- if (Instruction *I = SimplifyMemTransfer(MI))
- return I;
- } else if (MemSetInst *MSI = dyn_cast<MemSetInst>(MI)) {
- if (Instruction *I = SimplifyMemSet(MSI))
- return I;
- }
-
- if (Changed) return II;
- } else {
- switch (II->getIntrinsicID()) {
- default: break;
- case Intrinsic::ppc_altivec_lvx:
- case Intrinsic::ppc_altivec_lvxl:
- case Intrinsic::x86_sse_loadu_ps:
- case Intrinsic::x86_sse2_loadu_pd:
- case Intrinsic::x86_sse2_loadu_dq:
- // Turn PPC lvx -> load if the pointer is known aligned.
- // Turn X86 loadups -> load if the pointer is known aligned.
- if (GetOrEnforceKnownAlignment(II->getOperand(1), 16) >= 16) {
- Value *Ptr = InsertBitCastBefore(II->getOperand(1),
- PointerType::getUnqual(II->getType()),
- CI);
- return new LoadInst(Ptr);
- }
- break;
- case Intrinsic::ppc_altivec_stvx:
- case Intrinsic::ppc_altivec_stvxl:
- // Turn stvx -> store if the pointer is known aligned.
- if (GetOrEnforceKnownAlignment(II->getOperand(2), 16) >= 16) {
- const Type *OpPtrTy =
- PointerType::getUnqual(II->getOperand(1)->getType());
- Value *Ptr = InsertBitCastBefore(II->getOperand(2), OpPtrTy, CI);
- return new StoreInst(II->getOperand(1), Ptr);
- }
- break;
- case Intrinsic::x86_sse_storeu_ps:
- case Intrinsic::x86_sse2_storeu_pd:
- case Intrinsic::x86_sse2_storeu_dq:
- case Intrinsic::x86_sse2_storel_dq:
- // Turn X86 storeu -> store if the pointer is known aligned.
- if (GetOrEnforceKnownAlignment(II->getOperand(1), 16) >= 16) {
- const Type *OpPtrTy =
- PointerType::getUnqual(II->getOperand(2)->getType());
- Value *Ptr = InsertBitCastBefore(II->getOperand(1), OpPtrTy, CI);
- return new StoreInst(II->getOperand(2), Ptr);
- }
- break;
-
- case Intrinsic::x86_sse_cvttss2si: {
- // These intrinsics only demands the 0th element of its input vector. If
- // we can simplify the input based on that, do so now.
- uint64_t UndefElts;
- if (Value *V = SimplifyDemandedVectorElts(II->getOperand(1), 1,
- UndefElts)) {
- II->setOperand(1, V);
- return II;
- }
- break;
- }
-
- case Intrinsic::ppc_altivec_vperm:
- // Turn vperm(V1,V2,mask) -> shuffle(V1,V2,mask) if mask is a constant.
- if (ConstantVector *Mask = dyn_cast<ConstantVector>(II->getOperand(3))) {
- assert(Mask->getNumOperands() == 16 && "Bad type for intrinsic!");
-
- // Check that all of the elements are integer constants or undefs.
- bool AllEltsOk = true;
- for (unsigned i = 0; i != 16; ++i) {
- if (!isa<ConstantInt>(Mask->getOperand(i)) &&
- !isa<UndefValue>(Mask->getOperand(i))) {
- AllEltsOk = false;
- break;
- }
- }
-
- if (AllEltsOk) {
- // Cast the input vectors to byte vectors.
- Value *Op0 =InsertBitCastBefore(II->getOperand(1),Mask->getType(),CI);
- Value *Op1 =InsertBitCastBefore(II->getOperand(2),Mask->getType(),CI);
- Value *Result = UndefValue::get(Op0->getType());
-
- // Only extract each element once.
- Value *ExtractedElts[32];
- memset(ExtractedElts, 0, sizeof(ExtractedElts));
-
- for (unsigned i = 0; i != 16; ++i) {
- if (isa<UndefValue>(Mask->getOperand(i)))
- continue;
- unsigned Idx=cast<ConstantInt>(Mask->getOperand(i))->getZExtValue();
- Idx &= 31; // Match the hardware behavior.
-
- if (ExtractedElts[Idx] == 0) {
- Instruction *Elt =
- new ExtractElementInst(Idx < 16 ? Op0 : Op1, Idx&15, "tmp");
- InsertNewInstBefore(Elt, CI);
- ExtractedElts[Idx] = Elt;
- }
-
- // Insert this value into the result vector.
- Result = InsertElementInst::Create(Result, ExtractedElts[Idx], i, "tmp");
- InsertNewInstBefore(cast<Instruction>(Result), CI);
- }
- return CastInst::create(Instruction::BitCast, Result, CI.getType());
- }
- }
- break;
-
- case Intrinsic::stackrestore: {
- // If the save is right next to the restore, remove the restore. This can
- // happen when variable allocas are DCE'd.
- if (IntrinsicInst *SS = dyn_cast<IntrinsicInst>(II->getOperand(1))) {
- if (SS->getIntrinsicID() == Intrinsic::stacksave) {
- BasicBlock::iterator BI = SS;
- if (&*++BI == II)
- return EraseInstFromFunction(CI);
- }
- }
-
- // Scan down this block to see if there is another stack restore in the
- // same block without an intervening call/alloca.
- BasicBlock::iterator BI = II;
- TerminatorInst *TI = II->getParent()->getTerminator();
- bool CannotRemove = false;
- for (++BI; &*BI != TI; ++BI) {
- if (isa<AllocaInst>(BI)) {
- CannotRemove = true;
- break;
- }
- if (isa<CallInst>(BI)) {
- if (!isa<IntrinsicInst>(BI)) {
- CannotRemove = true;
- break;
- }
- // If there is a stackrestore below this one, remove this one.
- return EraseInstFromFunction(CI);
- }
- }
-
- // If the stack restore is in a return/unwind block and if there are no
- // allocas or calls between the restore and the return, nuke the restore.
- if (!CannotRemove && (isa<ReturnInst>(TI) || isa<UnwindInst>(TI)))
- return EraseInstFromFunction(CI);
- break;
- }
- }
- }
-
- return visitCallSite(II);
-}
-
-// InvokeInst simplification
-//
-Instruction *InstCombiner::visitInvokeInst(InvokeInst &II) {
- return visitCallSite(&II);
-}
-
-/// isSafeToEliminateVarargsCast - If this cast does not affect the value
-/// passed through the varargs area, we can eliminate the use of the cast.
-static bool isSafeToEliminateVarargsCast(const CallSite CS,
- const CastInst * const CI,
- const TargetData * const TD,
- const int ix) {
- if (!CI->isLosslessCast())
- return false;
-
- // The size of ByVal arguments is derived from the type, so we
- // can't change to a type with a different size. If the size were
- // passed explicitly we could avoid this check.
- if (!CS.paramHasAttr(ix, ParamAttr::ByVal))
- return true;
-
- const Type* SrcTy =
- cast<PointerType>(CI->getOperand(0)->getType())->getElementType();
- const Type* DstTy = cast<PointerType>(CI->getType())->getElementType();
- if (!SrcTy->isSized() || !DstTy->isSized())
- return false;
- if (TD->getABITypeSize(SrcTy) != TD->getABITypeSize(DstTy))
- return false;
- return true;
-}
-
-// visitCallSite - Improvements for call and invoke instructions.
-//
-Instruction *InstCombiner::visitCallSite(CallSite CS) {
- bool Changed = false;
-
- // If the callee is a constexpr cast of a function, attempt to move the cast
- // to the arguments of the call/invoke.
- if (transformConstExprCastCall(CS)) return 0;
-
- Value *Callee = CS.getCalledValue();
-
- if (Function *CalleeF = dyn_cast<Function>(Callee))
- if (CalleeF->getCallingConv() != CS.getCallingConv()) {
- Instruction *OldCall = CS.getInstruction();
- // If the call and callee calling conventions don't match, this call must
- // be unreachable, as the call is undefined.
- new StoreInst(ConstantInt::getTrue(),
- UndefValue::get(PointerType::getUnqual(Type::Int1Ty)),
- OldCall);
- if (!OldCall->use_empty())
- OldCall->replaceAllUsesWith(UndefValue::get(OldCall->getType()));
- if (isa<CallInst>(OldCall)) // Not worth removing an invoke here.
- return EraseInstFromFunction(*OldCall);
- return 0;
- }
-
- if (isa<ConstantPointerNull>(Callee) || isa<UndefValue>(Callee)) {
- // This instruction is not reachable, just remove it. We insert a store to
- // undef so that we know that this code is not reachable, despite the fact
- // that we can't modify the CFG here.
- new StoreInst(ConstantInt::getTrue(),
- UndefValue::get(PointerType::getUnqual(Type::Int1Ty)),
- CS.getInstruction());
-
- if (!CS.getInstruction()->use_empty())
- CS.getInstruction()->
- replaceAllUsesWith(UndefValue::get(CS.getInstruction()->getType()));
-
- if (InvokeInst *II = dyn_cast<InvokeInst>(CS.getInstruction())) {
- // Don't break the CFG, insert a dummy cond branch.
- BranchInst::Create(II->getNormalDest(), II->getUnwindDest(),
- ConstantInt::getTrue(), II);
- }
- return EraseInstFromFunction(*CS.getInstruction());
- }
-
- if (BitCastInst *BC = dyn_cast<BitCastInst>(Callee))
- if (IntrinsicInst *In = dyn_cast<IntrinsicInst>(BC->getOperand(0)))
- if (In->getIntrinsicID() == Intrinsic::init_trampoline)
- return transformCallThroughTrampoline(CS);
-
- const PointerType *PTy = cast<PointerType>(Callee->getType());
- const FunctionType *FTy = cast<FunctionType>(PTy->getElementType());
- if (FTy->isVarArg()) {
- int ix = FTy->getNumParams() + (isa<InvokeInst>(Callee) ? 3 : 1);
- // See if we can optimize any arguments passed through the varargs area of
- // the call.
- for (CallSite::arg_iterator I = CS.arg_begin()+FTy->getNumParams(),
- E = CS.arg_end(); I != E; ++I, ++ix) {
- CastInst *CI = dyn_cast<CastInst>(*I);
- if (CI && isSafeToEliminateVarargsCast(CS, CI, TD, ix)) {
- *I = CI->getOperand(0);
- Changed = true;
- }
- }
- }
-
- if (isa<InlineAsm>(Callee) && !CS.doesNotThrow()) {
- // Inline asm calls cannot throw - mark them 'nounwind'.
- CS.setDoesNotThrow();
- Changed = true;
- }
-
- return Changed ? CS.getInstruction() : 0;
-}
-
-// transformConstExprCastCall - If the callee is a constexpr cast of a function,
-// attempt to move the cast to the arguments of the call/invoke.
-//
-bool InstCombiner::transformConstExprCastCall(CallSite CS) {
- if (!isa<ConstantExpr>(CS.getCalledValue())) return false;
- ConstantExpr *CE = cast<ConstantExpr>(CS.getCalledValue());
- if (CE->getOpcode() != Instruction::BitCast ||
- !isa<Function>(CE->getOperand(0)))
- return false;
- Function *Callee = cast<Function>(CE->getOperand(0));
- Instruction *Caller = CS.getInstruction();
- const PAListPtr &CallerPAL = CS.getParamAttrs();
-
- // Okay, this is a cast from a function to a different type. Unless doing so
- // would cause a type conversion of one of our arguments, change this call to
- // be a direct call with arguments casted to the appropriate types.
- //
- const FunctionType *FT = Callee->getFunctionType();
- const Type *OldRetTy = Caller->getType();
-
- if (isa<StructType>(FT->getReturnType()))
- return false; // TODO: Handle multiple return values.
-
- // Check to see if we are changing the return type...
- if (OldRetTy != FT->getReturnType()) {
- if (Callee->isDeclaration() && !Caller->use_empty() &&
- // Conversion is ok if changing from pointer to int of same size.
- !(isa<PointerType>(FT->getReturnType()) &&
- TD->getIntPtrType() == OldRetTy))
- return false; // Cannot transform this return value.
-
- if (!Caller->use_empty() &&
- // void -> non-void is handled specially
- FT->getReturnType() != Type::VoidTy &&
- !CastInst::isCastable(FT->getReturnType(), OldRetTy))
- return false; // Cannot transform this return value.
-
- if (!CallerPAL.isEmpty() && !Caller->use_empty()) {
- ParameterAttributes RAttrs = CallerPAL.getParamAttrs(0);
- if (RAttrs & ParamAttr::typeIncompatible(FT->getReturnType()))
- return false; // Attribute not compatible with transformed value.
- }
-
- // If the callsite is an invoke instruction, and the return value is used by
- // a PHI node in a successor, we cannot change the return type of the call
- // because there is no place to put the cast instruction (without breaking
- // the critical edge). Bail out in this case.
- if (!Caller->use_empty())
- if (InvokeInst *II = dyn_cast<InvokeInst>(Caller))
- for (Value::use_iterator UI = II->use_begin(), E = II->use_end();
- UI != E; ++UI)
- if (PHINode *PN = dyn_cast<PHINode>(*UI))
- if (PN->getParent() == II->getNormalDest() ||
- PN->getParent() == II->getUnwindDest())
- return false;
- }
-
- unsigned NumActualArgs = unsigned(CS.arg_end()-CS.arg_begin());
- unsigned NumCommonArgs = std::min(FT->getNumParams(), NumActualArgs);
-
- CallSite::arg_iterator AI = CS.arg_begin();
- for (unsigned i = 0, e = NumCommonArgs; i != e; ++i, ++AI) {
- const Type *ParamTy = FT->getParamType(i);
- const Type *ActTy = (*AI)->getType();
-
- if (!CastInst::isCastable(ActTy, ParamTy))
- return false; // Cannot transform this parameter value.
-
- if (CallerPAL.getParamAttrs(i + 1) & ParamAttr::typeIncompatible(ParamTy))
- return false; // Attribute not compatible with transformed value.
-
- ConstantInt *c = dyn_cast<ConstantInt>(*AI);
- // Some conversions are safe even if we do not have a body.
- // Either we can cast directly, or we can upconvert the argument
- bool isConvertible = ActTy == ParamTy ||
- (isa<PointerType>(ParamTy) && isa<PointerType>(ActTy)) ||
- (ParamTy->isInteger() && ActTy->isInteger() &&
- ParamTy->getPrimitiveSizeInBits() >= ActTy->getPrimitiveSizeInBits()) ||
- (c && ParamTy->getPrimitiveSizeInBits() >= ActTy->getPrimitiveSizeInBits()
- && c->getValue().isStrictlyPositive());
- if (Callee->isDeclaration() && !isConvertible) return false;
- }
-
- if (FT->getNumParams() < NumActualArgs && !FT->isVarArg() &&
- Callee->isDeclaration())
- return false; // Do not delete arguments unless we have a function body.
-
- if (FT->getNumParams() < NumActualArgs && FT->isVarArg() &&
- !CallerPAL.isEmpty())
- // In this case we have more arguments than the new function type, but we
- // won't be dropping them. Check that these extra arguments have attributes
- // that are compatible with being a vararg call argument.
- for (unsigned i = CallerPAL.getNumSlots(); i; --i) {
- if (CallerPAL.getSlot(i - 1).Index <= FT->getNumParams())
- break;
- ParameterAttributes PAttrs = CallerPAL.getSlot(i - 1).Attrs;
- if (PAttrs & ParamAttr::VarArgsIncompatible)
- return false;
- }
-
- // Okay, we decided that this is a safe thing to do: go ahead and start
- // inserting cast instructions as necessary...
- std::vector<Value*> Args;
- Args.reserve(NumActualArgs);
- SmallVector<ParamAttrsWithIndex, 8> attrVec;
- attrVec.reserve(NumCommonArgs);
-
- // Get any return attributes.
- ParameterAttributes RAttrs = CallerPAL.getParamAttrs(0);
-
- // If the return value is not being used, the type may not be compatible
- // with the existing attributes. Wipe out any problematic attributes.
- RAttrs &= ~ParamAttr::typeIncompatible(FT->getReturnType());
-
- // Add the new return attributes.
- if (RAttrs)
- attrVec.push_back(ParamAttrsWithIndex::get(0, RAttrs));
-
- AI = CS.arg_begin();
- for (unsigned i = 0; i != NumCommonArgs; ++i, ++AI) {
- const Type *ParamTy = FT->getParamType(i);
- if ((*AI)->getType() == ParamTy) {
- Args.push_back(*AI);
- } else {
- Instruction::CastOps opcode = CastInst::getCastOpcode(*AI,
- false, ParamTy, false);
- CastInst *NewCast = CastInst::create(opcode, *AI, ParamTy, "tmp");
- Args.push_back(InsertNewInstBefore(NewCast, *Caller));
- }
-
- // Add any parameter attributes.
- if (ParameterAttributes PAttrs = CallerPAL.getParamAttrs(i + 1))
- attrVec.push_back(ParamAttrsWithIndex::get(i + 1, PAttrs));
- }
-
- // If the function takes more arguments than the call was taking, add them
- // now...
- for (unsigned i = NumCommonArgs; i != FT->getNumParams(); ++i)
- Args.push_back(Constant::getNullValue(FT->getParamType(i)));
-
- // If we are removing arguments to the function, emit an obnoxious warning...
- if (FT->getNumParams() < NumActualArgs) {
- if (!FT->isVarArg()) {
- cerr << "WARNING: While resolving call to function '"
- << Callee->getName() << "' arguments were dropped!\n";
- } else {
- // Add all of the arguments in their promoted form to the arg list...
- for (unsigned i = FT->getNumParams(); i != NumActualArgs; ++i, ++AI) {
- const Type *PTy = getPromotedType((*AI)->getType());
- if (PTy != (*AI)->getType()) {
- // Must promote to pass through va_arg area!
- Instruction::CastOps opcode = CastInst::getCastOpcode(*AI, false,
- PTy, false);
- Instruction *Cast = CastInst::create(opcode, *AI, PTy, "tmp");
- InsertNewInstBefore(Cast, *Caller);
- Args.push_back(Cast);
- } else {
- Args.push_back(*AI);
- }
-
- // Add any parameter attributes.
- if (ParameterAttributes PAttrs = CallerPAL.getParamAttrs(i + 1))
- attrVec.push_back(ParamAttrsWithIndex::get(i + 1, PAttrs));
- }
- }
- }
-
- if (FT->getReturnType() == Type::VoidTy)
- Caller->setName(""); // Void type should not have a name.
-
- const PAListPtr &NewCallerPAL = PAListPtr::get(attrVec.begin(),attrVec.end());
-
- Instruction *NC;
- if (InvokeInst *II = dyn_cast<InvokeInst>(Caller)) {
- NC = InvokeInst::Create(Callee, II->getNormalDest(), II->getUnwindDest(),
- Args.begin(), Args.end(), Caller->getName(), Caller);
- cast<InvokeInst>(NC)->setCallingConv(II->getCallingConv());
- cast<InvokeInst>(NC)->setParamAttrs(NewCallerPAL);
- } else {
- NC = CallInst::Create(Callee, Args.begin(), Args.end(),
- Caller->getName(), Caller);
- CallInst *CI = cast<CallInst>(Caller);
- if (CI->isTailCall())
- cast<CallInst>(NC)->setTailCall();
- cast<CallInst>(NC)->setCallingConv(CI->getCallingConv());
- cast<CallInst>(NC)->setParamAttrs(NewCallerPAL);
- }
-
- // Insert a cast of the return type as necessary.
- Value *NV = NC;
- if (OldRetTy != NV->getType() && !Caller->use_empty()) {
- if (NV->getType() != Type::VoidTy) {
- Instruction::CastOps opcode = CastInst::getCastOpcode(NC, false,
- OldRetTy, false);
- NV = NC = CastInst::create(opcode, NC, OldRetTy, "tmp");
-
- // If this is an invoke instruction, we should insert it after the first
- // non-phi, instruction in the normal successor block.
- if (InvokeInst *II = dyn_cast<InvokeInst>(Caller)) {
- BasicBlock::iterator I = II->getNormalDest()->begin();
- while (isa<PHINode>(I)) ++I;
- InsertNewInstBefore(NC, *I);
- } else {
- // Otherwise, it's a call, just insert cast right after the call instr
- InsertNewInstBefore(NC, *Caller);
- }
- AddUsersToWorkList(*Caller);
- } else {
- NV = UndefValue::get(Caller->getType());
- }
- }
-
- if (Caller->getType() != Type::VoidTy && !Caller->use_empty())
- Caller->replaceAllUsesWith(NV);
- Caller->eraseFromParent();
- RemoveFromWorkList(Caller);
- return true;
-}
-
-// transformCallThroughTrampoline - Turn a call to a function created by the
-// init_trampoline intrinsic into a direct call to the underlying function.
-//
-Instruction *InstCombiner::transformCallThroughTrampoline(CallSite CS) {
- Value *Callee = CS.getCalledValue();
- const PointerType *PTy = cast<PointerType>(Callee->getType());
- const FunctionType *FTy = cast<FunctionType>(PTy->getElementType());
- const PAListPtr &Attrs = CS.getParamAttrs();
-
- // If the call already has the 'nest' attribute somewhere then give up -
- // otherwise 'nest' would occur twice after splicing in the chain.
- if (Attrs.hasAttrSomewhere(ParamAttr::Nest))
- return 0;
-
- IntrinsicInst *Tramp =
- cast<IntrinsicInst>(cast<BitCastInst>(Callee)->getOperand(0));
-
- Function *NestF = cast<Function>(Tramp->getOperand(2)->stripPointerCasts());
- const PointerType *NestFPTy = cast<PointerType>(NestF->getType());
- const FunctionType *NestFTy = cast<FunctionType>(NestFPTy->getElementType());
-
- const PAListPtr &NestAttrs = NestF->getParamAttrs();
- if (!NestAttrs.isEmpty()) {
- unsigned NestIdx = 1;
- const Type *NestTy = 0;
- ParameterAttributes NestAttr = ParamAttr::None;
-
- // Look for a parameter marked with the 'nest' attribute.
- for (FunctionType::param_iterator I = NestFTy->param_begin(),
- E = NestFTy->param_end(); I != E; ++NestIdx, ++I)
- if (NestAttrs.paramHasAttr(NestIdx, ParamAttr::Nest)) {
- // Record the parameter type and any other attributes.
- NestTy = *I;
- NestAttr = NestAttrs.getParamAttrs(NestIdx);
- break;
- }
-
- if (NestTy) {
- Instruction *Caller = CS.getInstruction();
- std::vector<Value*> NewArgs;
- NewArgs.reserve(unsigned(CS.arg_end()-CS.arg_begin())+1);
-
- SmallVector<ParamAttrsWithIndex, 8> NewAttrs;
- NewAttrs.reserve(Attrs.getNumSlots() + 1);
-
- // Insert the nest argument into the call argument list, which may
- // mean appending it. Likewise for attributes.
-
- // Add any function result attributes.
- if (ParameterAttributes Attr = Attrs.getParamAttrs(0))
- NewAttrs.push_back(ParamAttrsWithIndex::get(0, Attr));
-
- {
- unsigned Idx = 1;
- CallSite::arg_iterator I = CS.arg_begin(), E = CS.arg_end();
- do {
- if (Idx == NestIdx) {
- // Add the chain argument and attributes.
- Value *NestVal = Tramp->getOperand(3);
- if (NestVal->getType() != NestTy)
- NestVal = new BitCastInst(NestVal, NestTy, "nest", Caller);
- NewArgs.push_back(NestVal);
- NewAttrs.push_back(ParamAttrsWithIndex::get(NestIdx, NestAttr));
- }
-
- if (I == E)
- break;
-
- // Add the original argument and attributes.
- NewArgs.push_back(*I);
- if (ParameterAttributes Attr = Attrs.getParamAttrs(Idx))
- NewAttrs.push_back
- (ParamAttrsWithIndex::get(Idx + (Idx >= NestIdx), Attr));
-
- ++Idx, ++I;
- } while (1);
- }
-
- // The trampoline may have been bitcast to a bogus type (FTy).
- // Handle this by synthesizing a new function type, equal to FTy
- // with the chain parameter inserted.
-
- std::vector<const Type*> NewTypes;
- NewTypes.reserve(FTy->getNumParams()+1);
-
- // Insert the chain's type into the list of parameter types, which may
- // mean appending it.
- {
- unsigned Idx = 1;
- FunctionType::param_iterator I = FTy->param_begin(),
- E = FTy->param_end();
-
- do {
- if (Idx == NestIdx)
- // Add the chain's type.
- NewTypes.push_back(NestTy);
-
- if (I == E)
- break;
-
- // Add the original type.
- NewTypes.push_back(*I);
-
- ++Idx, ++I;
- } while (1);
- }
-
- // Replace the trampoline call with a direct call. Let the generic
- // code sort out any function type mismatches.
- FunctionType *NewFTy =
- FunctionType::get(FTy->getReturnType(), NewTypes, FTy->isVarArg());
- Constant *NewCallee = NestF->getType() == PointerType::getUnqual(NewFTy) ?
- NestF : ConstantExpr::getBitCast(NestF, PointerType::getUnqual(NewFTy));
- const PAListPtr &NewPAL = PAListPtr::get(NewAttrs.begin(),NewAttrs.end());
-
- Instruction *NewCaller;
- if (InvokeInst *II = dyn_cast<InvokeInst>(Caller)) {
- NewCaller = InvokeInst::Create(NewCallee,
- II->getNormalDest(), II->getUnwindDest(),
- NewArgs.begin(), NewArgs.end(),
- Caller->getName(), Caller);
- cast<InvokeInst>(NewCaller)->setCallingConv(II->getCallingConv());
- cast<InvokeInst>(NewCaller)->setParamAttrs(NewPAL);
- } else {
- NewCaller = CallInst::Create(NewCallee, NewArgs.begin(), NewArgs.end(),
- Caller->getName(), Caller);
- if (cast<CallInst>(Caller)->isTailCall())
- cast<CallInst>(NewCaller)->setTailCall();
- cast<CallInst>(NewCaller)->
- setCallingConv(cast<CallInst>(Caller)->getCallingConv());
- cast<CallInst>(NewCaller)->setParamAttrs(NewPAL);
- }
- if (Caller->getType() != Type::VoidTy && !Caller->use_empty())
- Caller->replaceAllUsesWith(NewCaller);
- Caller->eraseFromParent();
- RemoveFromWorkList(Caller);
- return 0;
- }
- }
-
- // Replace the trampoline call with a direct call. Since there is no 'nest'
- // parameter, there is no need to adjust the argument list. Let the generic
- // code sort out any function type mismatches.
- Constant *NewCallee =
- NestF->getType() == PTy ? NestF : ConstantExpr::getBitCast(NestF, PTy);
- CS.setCalledFunction(NewCallee);
- return CS.getInstruction();
-}
-
-/// FoldPHIArgBinOpIntoPHI - If we have something like phi [add (a,b), add(c,d)]
-/// and if a/b/c/d and the add's all have a single use, turn this into two phi's
-/// and a single binop.
-Instruction *InstCombiner::FoldPHIArgBinOpIntoPHI(PHINode &PN) {
- Instruction *FirstInst = cast<Instruction>(PN.getIncomingValue(0));
- assert(isa<BinaryOperator>(FirstInst) || isa<GetElementPtrInst>(FirstInst) ||
- isa<CmpInst>(FirstInst));
- unsigned Opc = FirstInst->getOpcode();
- Value *LHSVal = FirstInst->getOperand(0);
- Value *RHSVal = FirstInst->getOperand(1);
-
- const Type *LHSType = LHSVal->getType();
- const Type *RHSType = RHSVal->getType();
-
- // Scan to see if all operands are the same opcode, all have one use, and all
- // kill their operands (i.e. the operands have one use).
- for (unsigned i = 0; i != PN.getNumIncomingValues(); ++i) {
- Instruction *I = dyn_cast<Instruction>(PN.getIncomingValue(i));
- if (!I || I->getOpcode() != Opc || !I->hasOneUse() ||
- // Verify type of the LHS matches so we don't fold cmp's of different
- // types or GEP's with different index types.
- I->getOperand(0)->getType() != LHSType ||
- I->getOperand(1)->getType() != RHSType)
- return 0;
-
- // If they are CmpInst instructions, check their predicates
- if (Opc == Instruction::ICmp || Opc == Instruction::FCmp)
- if (cast<CmpInst>(I)->getPredicate() !=
- cast<CmpInst>(FirstInst)->getPredicate())
- return 0;
-
- // Keep track of which operand needs a phi node.
- if (I->getOperand(0) != LHSVal) LHSVal = 0;
- if (I->getOperand(1) != RHSVal) RHSVal = 0;
- }
-
- // Otherwise, this is safe to transform, determine if it is profitable.
-
- // If this is a GEP, and if the index (not the pointer) needs a PHI, bail out.
- // Indexes are often folded into load/store instructions, so we don't want to
- // hide them behind a phi.
- if (isa<GetElementPtrInst>(FirstInst) && RHSVal == 0)
- return 0;
-
- Value *InLHS = FirstInst->getOperand(0);
- Value *InRHS = FirstInst->getOperand(1);
- PHINode *NewLHS = 0, *NewRHS = 0;
- if (LHSVal == 0) {
- NewLHS = PHINode::Create(LHSType, FirstInst->getOperand(0)->getName()+".pn");
- NewLHS->reserveOperandSpace(PN.getNumOperands()/2);
- NewLHS->addIncoming(InLHS, PN.getIncomingBlock(0));
- InsertNewInstBefore(NewLHS, PN);
- LHSVal = NewLHS;
- }
-
- if (RHSVal == 0) {
- NewRHS = PHINode::Create(RHSType, FirstInst->getOperand(1)->getName()+".pn");
- NewRHS->reserveOperandSpace(PN.getNumOperands()/2);
- NewRHS->addIncoming(InRHS, PN.getIncomingBlock(0));
- InsertNewInstBefore(NewRHS, PN);
- RHSVal = NewRHS;
- }
-
- // Add all operands to the new PHIs.
- for (unsigned i = 1, e = PN.getNumIncomingValues(); i != e; ++i) {
- if (NewLHS) {
- Value *NewInLHS =cast<Instruction>(PN.getIncomingValue(i))->getOperand(0);
- NewLHS->addIncoming(NewInLHS, PN.getIncomingBlock(i));
- }
- if (NewRHS) {
- Value *NewInRHS =cast<Instruction>(PN.getIncomingValue(i))->getOperand(1);
- NewRHS->addIncoming(NewInRHS, PN.getIncomingBlock(i));
- }
- }
-
- if (BinaryOperator *BinOp = dyn_cast<BinaryOperator>(FirstInst))
- return BinaryOperator::create(BinOp->getOpcode(), LHSVal, RHSVal);
- else if (CmpInst *CIOp = dyn_cast<CmpInst>(FirstInst))
- return CmpInst::create(CIOp->getOpcode(), CIOp->getPredicate(), LHSVal,
- RHSVal);
- else {
- assert(isa<GetElementPtrInst>(FirstInst));
- return GetElementPtrInst::Create(LHSVal, RHSVal);
- }
-}
-
-/// isSafeToSinkLoad - Return true if we know that it is safe sink the load out
-/// of the block that defines it. This means that it must be obvious the value
-/// of the load is not changed from the point of the load to the end of the
-/// block it is in.
-///
-/// Finally, it is safe, but not profitable, to sink a load targetting a
-/// non-address-taken alloca. Doing so will cause us to not promote the alloca
-/// to a register.
-static bool isSafeToSinkLoad(LoadInst *L) {
- BasicBlock::iterator BBI = L, E = L->getParent()->end();
-
- for (++BBI; BBI != E; ++BBI)
- if (BBI->mayWriteToMemory())
- return false;
-
- // Check for non-address taken alloca. If not address-taken already, it isn't
- // profitable to do this xform.
- if (AllocaInst *AI = dyn_cast<AllocaInst>(L->getOperand(0))) {
- bool isAddressTaken = false;
- for (Value::use_iterator UI = AI->use_begin(), E = AI->use_end();
- UI != E; ++UI) {
- if (isa<LoadInst>(UI)) continue;
- if (StoreInst *SI = dyn_cast<StoreInst>(*UI)) {
- // If storing TO the alloca, then the address isn't taken.
- if (SI->getOperand(1) == AI) continue;
- }
- isAddressTaken = true;
- break;
- }
-
- if (!isAddressTaken)
- return false;
- }
-
- return true;
-}
-
-
-// FoldPHIArgOpIntoPHI - If all operands to a PHI node are the same "unary"
-// operator and they all are only used by the PHI, PHI together their
-// inputs, and do the operation once, to the result of the PHI.
-Instruction *InstCombiner::FoldPHIArgOpIntoPHI(PHINode &PN) {
- Instruction *FirstInst = cast<Instruction>(PN.getIncomingValue(0));
-
- // Scan the instruction, looking for input operations that can be folded away.
- // If all input operands to the phi are the same instruction (e.g. a cast from
- // the same type or "+42") we can pull the operation through the PHI, reducing
- // code size and simplifying code.
- Constant *ConstantOp = 0;
- const Type *CastSrcTy = 0;
- bool isVolatile = false;
- if (isa<CastInst>(FirstInst)) {
- CastSrcTy = FirstInst->getOperand(0)->getType();
- } else if (isa<BinaryOperator>(FirstInst) || isa<CmpInst>(FirstInst)) {
- // Can fold binop, compare or shift here if the RHS is a constant,
- // otherwise call FoldPHIArgBinOpIntoPHI.
- ConstantOp = dyn_cast<Constant>(FirstInst->getOperand(1));
- if (ConstantOp == 0)
- return FoldPHIArgBinOpIntoPHI(PN);
- } else if (LoadInst *LI = dyn_cast<LoadInst>(FirstInst)) {
- isVolatile = LI->isVolatile();
- // We can't sink the load if the loaded value could be modified between the
- // load and the PHI.
- if (LI->getParent() != PN.getIncomingBlock(0) ||
- !isSafeToSinkLoad(LI))
- return 0;
- } else if (isa<GetElementPtrInst>(FirstInst)) {
- if (FirstInst->getNumOperands() == 2)
- return FoldPHIArgBinOpIntoPHI(PN);
- // Can't handle general GEPs yet.
- return 0;
- } else {
- return 0; // Cannot fold this operation.
- }
-
- // Check to see if all arguments are the same operation.
- for (unsigned i = 1, e = PN.getNumIncomingValues(); i != e; ++i) {
- if (!isa<Instruction>(PN.getIncomingValue(i))) return 0;
- Instruction *I = cast<Instruction>(PN.getIncomingValue(i));
- if (!I->hasOneUse() || !I->isSameOperationAs(FirstInst))
- return 0;
- if (CastSrcTy) {
- if (I->getOperand(0)->getType() != CastSrcTy)
- return 0; // Cast operation must match.
- } else if (LoadInst *LI = dyn_cast<LoadInst>(I)) {
- // We can't sink the load if the loaded value could be modified between
- // the load and the PHI.
- if (LI->isVolatile() != isVolatile ||
- LI->getParent() != PN.getIncomingBlock(i) ||
- !isSafeToSinkLoad(LI))
- return 0;
-
- // If the PHI is volatile and its block has multiple successors, sinking
- // it would remove a load of the volatile value from the path through the
- // other successor.
- if (isVolatile &&
- LI->getParent()->getTerminator()->getNumSuccessors() != 1)
- return 0;
-
-
- } else if (I->getOperand(1) != ConstantOp) {
- return 0;
- }
- }
-
- // Okay, they are all the same operation. Create a new PHI node of the
- // correct type, and PHI together all of the LHS's of the instructions.
- PHINode *NewPN = PHINode::Create(FirstInst->getOperand(0)->getType(),
- PN.getName()+".in");
- NewPN->reserveOperandSpace(PN.getNumOperands()/2);
-
- Value *InVal = FirstInst->getOperand(0);
- NewPN->addIncoming(InVal, PN.getIncomingBlock(0));
-
- // Add all operands to the new PHI.
- for (unsigned i = 1, e = PN.getNumIncomingValues(); i != e; ++i) {
- Value *NewInVal = cast<Instruction>(PN.getIncomingValue(i))->getOperand(0);
- if (NewInVal != InVal)
- InVal = 0;
- NewPN->addIncoming(NewInVal, PN.getIncomingBlock(i));
- }
-
- Value *PhiVal;
- if (InVal) {
- // The new PHI unions all of the same values together. This is really
- // common, so we handle it intelligently here for compile-time speed.
- PhiVal = InVal;
- delete NewPN;
- } else {
- InsertNewInstBefore(NewPN, PN);
- PhiVal = NewPN;
- }
-
- // Insert and return the new operation.
- if (CastInst* FirstCI = dyn_cast<CastInst>(FirstInst))
- return CastInst::create(FirstCI->getOpcode(), PhiVal, PN.getType());
- if (BinaryOperator *BinOp = dyn_cast<BinaryOperator>(FirstInst))
- return BinaryOperator::create(BinOp->getOpcode(), PhiVal, ConstantOp);
- if (CmpInst *CIOp = dyn_cast<CmpInst>(FirstInst))
- return CmpInst::create(CIOp->getOpcode(), CIOp->getPredicate(),
- PhiVal, ConstantOp);
- assert(isa<LoadInst>(FirstInst) && "Unknown operation");
-
- // If this was a volatile load that we are merging, make sure to loop through
- // and mark all the input loads as non-volatile. If we don't do this, we will
- // insert a new volatile load and the old ones will not be deletable.
- if (isVolatile)
- for (unsigned i = 0, e = PN.getNumIncomingValues(); i != e; ++i)
- cast<LoadInst>(PN.getIncomingValue(i))->setVolatile(false);
-
- return new LoadInst(PhiVal, "", isVolatile);
-}
-
-/// DeadPHICycle - Return true if this PHI node is only used by a PHI node cycle
-/// that is dead.
-static bool DeadPHICycle(PHINode *PN,
- SmallPtrSet<PHINode*, 16> &PotentiallyDeadPHIs) {
- if (PN->use_empty()) return true;
- if (!PN->hasOneUse()) return false;
-
- // Remember this node, and if we find the cycle, return.
- if (!PotentiallyDeadPHIs.insert(PN))
- return true;
-
- // Don't scan crazily complex things.
- if (PotentiallyDeadPHIs.size() == 16)
- return false;
-
- if (PHINode *PU = dyn_cast<PHINode>(PN->use_back()))
- return DeadPHICycle(PU, PotentiallyDeadPHIs);
-
- return false;
-}
-
-/// PHIsEqualValue - Return true if this phi node is always equal to
-/// NonPhiInVal. This happens with mutually cyclic phi nodes like:
-/// z = some value; x = phi (y, z); y = phi (x, z)
-static bool PHIsEqualValue(PHINode *PN, Value *NonPhiInVal,
- SmallPtrSet<PHINode*, 16> &ValueEqualPHIs) {
- // See if we already saw this PHI node.
- if (!ValueEqualPHIs.insert(PN))
- return true;
-
- // Don't scan crazily complex things.
- if (ValueEqualPHIs.size() == 16)
- return false;
-
- // Scan the operands to see if they are either phi nodes or are equal to
- // the value.
- for (unsigned i = 0, e = PN->getNumIncomingValues(); i != e; ++i) {
- Value *Op = PN->getIncomingValue(i);
- if (PHINode *OpPN = dyn_cast<PHINode>(Op)) {
- if (!PHIsEqualValue(OpPN, NonPhiInVal, ValueEqualPHIs))
- return false;
- } else if (Op != NonPhiInVal)
- return false;
- }
-
- return true;
-}
-
-
-// PHINode simplification
-//
-Instruction *InstCombiner::visitPHINode(PHINode &PN) {
- // If LCSSA is around, don't mess with Phi nodes
- if (MustPreserveLCSSA) return 0;
-
- if (Value *V = PN.hasConstantValue())
- return ReplaceInstUsesWith(PN, V);
-
- // If all PHI operands are the same operation, pull them through the PHI,
- // reducing code size.
- if (isa<Instruction>(PN.getIncomingValue(0)) &&
- PN.getIncomingValue(0)->hasOneUse())
- if (Instruction *Result = FoldPHIArgOpIntoPHI(PN))
- return Result;
-
- // If this is a trivial cycle in the PHI node graph, remove it. Basically, if
- // this PHI only has a single use (a PHI), and if that PHI only has one use (a
- // PHI)... break the cycle.
- if (PN.hasOneUse()) {
- Instruction *PHIUser = cast<Instruction>(PN.use_back());
- if (PHINode *PU = dyn_cast<PHINode>(PHIUser)) {
- SmallPtrSet<PHINode*, 16> PotentiallyDeadPHIs;
- PotentiallyDeadPHIs.insert(&PN);
- if (DeadPHICycle(PU, PotentiallyDeadPHIs))
- return ReplaceInstUsesWith(PN, UndefValue::get(PN.getType()));
- }
-
- // If this phi has a single use, and if that use just computes a value for
- // the next iteration of a loop, delete the phi. This occurs with unused
- // induction variables, e.g. "for (int j = 0; ; ++j);". Detecting this
- // common case here is good because the only other things that catch this
- // are induction variable analysis (sometimes) and ADCE, which is only run
- // late.
- if (PHIUser->hasOneUse() &&
- (isa<BinaryOperator>(PHIUser) || isa<GetElementPtrInst>(PHIUser)) &&
- PHIUser->use_back() == &PN) {
- return ReplaceInstUsesWith(PN, UndefValue::get(PN.getType()));
- }
- }
-
- // We sometimes end up with phi cycles that non-obviously end up being the
- // same value, for example:
- // z = some value; x = phi (y, z); y = phi (x, z)
- // where the phi nodes don't necessarily need to be in the same block. Do a
- // quick check to see if the PHI node only contains a single non-phi value, if
- // so, scan to see if the phi cycle is actually equal to that value.
- {
- unsigned InValNo = 0, NumOperandVals = PN.getNumIncomingValues();
- // Scan for the first non-phi operand.
- while (InValNo != NumOperandVals &&
- isa<PHINode>(PN.getIncomingValue(InValNo)))
- ++InValNo;
-
- if (InValNo != NumOperandVals) {
- Value *NonPhiInVal = PN.getOperand(InValNo);
-
- // Scan the rest of the operands to see if there are any conflicts, if so
- // there is no need to recursively scan other phis.
- for (++InValNo; InValNo != NumOperandVals; ++InValNo) {
- Value *OpVal = PN.getIncomingValue(InValNo);
- if (OpVal != NonPhiInVal && !isa<PHINode>(OpVal))
- break;
- }
-
- // If we scanned over all operands, then we have one unique value plus
- // phi values. Scan PHI nodes to see if they all merge in each other or
- // the value.
- if (InValNo == NumOperandVals) {
- SmallPtrSet<PHINode*, 16> ValueEqualPHIs;
- if (PHIsEqualValue(&PN, NonPhiInVal, ValueEqualPHIs))
- return ReplaceInstUsesWith(PN, NonPhiInVal);
- }
- }
- }
- return 0;
-}
-
-static Value *InsertCastToIntPtrTy(Value *V, const Type *DTy,
- Instruction *InsertPoint,
- InstCombiner *IC) {
- unsigned PtrSize = DTy->getPrimitiveSizeInBits();
- unsigned VTySize = V->getType()->getPrimitiveSizeInBits();
- // We must cast correctly to the pointer type. Ensure that we
- // sign extend the integer value if it is smaller as this is
- // used for address computation.
- Instruction::CastOps opcode =
- (VTySize < PtrSize ? Instruction::SExt :
- (VTySize == PtrSize ? Instruction::BitCast : Instruction::Trunc));
- return IC->InsertCastBefore(opcode, V, DTy, *InsertPoint);
-}
-
-
-Instruction *InstCombiner::visitGetElementPtrInst(GetElementPtrInst &GEP) {
- Value *PtrOp = GEP.getOperand(0);
- // Is it 'getelementptr %P, i32 0' or 'getelementptr %P'
- // If so, eliminate the noop.
- if (GEP.getNumOperands() == 1)
- return ReplaceInstUsesWith(GEP, PtrOp);
-
- if (isa<UndefValue>(GEP.getOperand(0)))
- return ReplaceInstUsesWith(GEP, UndefValue::get(GEP.getType()));
-
- bool HasZeroPointerIndex = false;
- if (Constant *C = dyn_cast<Constant>(GEP.getOperand(1)))
- HasZeroPointerIndex = C->isNullValue();
-
- if (GEP.getNumOperands() == 2 && HasZeroPointerIndex)
- return ReplaceInstUsesWith(GEP, PtrOp);
-
- // Eliminate unneeded casts for indices.
- bool MadeChange = false;
-
- gep_type_iterator GTI = gep_type_begin(GEP);
- for (unsigned i = 1, e = GEP.getNumOperands(); i != e; ++i, ++GTI) {
- if (isa<SequentialType>(*GTI)) {
- if (CastInst *CI = dyn_cast<CastInst>(GEP.getOperand(i))) {
- if (CI->getOpcode() == Instruction::ZExt ||
- CI->getOpcode() == Instruction::SExt) {
- const Type *SrcTy = CI->getOperand(0)->getType();
- // We can eliminate a cast from i32 to i64 iff the target
- // is a 32-bit pointer target.
- if (SrcTy->getPrimitiveSizeInBits() >= TD->getPointerSizeInBits()) {
- MadeChange = true;
- GEP.setOperand(i, CI->getOperand(0));
- }
- }
- }
- // If we are using a wider index than needed for this platform, shrink it
- // to what we need. If the incoming value needs a cast instruction,
- // insert it. This explicit cast can make subsequent optimizations more
- // obvious.
- Value *Op = GEP.getOperand(i);
- if (TD->getTypeSizeInBits(Op->getType()) > TD->getPointerSizeInBits()) {
- if (Constant *C = dyn_cast<Constant>(Op)) {
- GEP.setOperand(i, ConstantExpr::getTrunc(C, TD->getIntPtrType()));
- MadeChange = true;
- } else {
- Op = InsertCastBefore(Instruction::Trunc, Op, TD->getIntPtrType(),
- GEP);
- GEP.setOperand(i, Op);
- MadeChange = true;
- }
- }
- }
- }
- if (MadeChange) return &GEP;
-
- // If this GEP instruction doesn't move the pointer, and if the input operand
- // is a bitcast of another pointer, just replace the GEP with a bitcast of the
- // real input to the dest type.
- if (GEP.hasAllZeroIndices()) {
- if (BitCastInst *BCI = dyn_cast<BitCastInst>(GEP.getOperand(0))) {
- // If the bitcast is of an allocation, and the allocation will be
- // converted to match the type of the cast, don't touch this.
- if (isa<AllocationInst>(BCI->getOperand(0))) {
- // See if the bitcast simplifies, if so, don't nuke this GEP yet.
- if (Instruction *I = visitBitCast(*BCI)) {
- if (I != BCI) {
- I->takeName(BCI);
- BCI->getParent()->getInstList().insert(BCI, I);
- ReplaceInstUsesWith(*BCI, I);
- }
- return &GEP;
- }
- }
- return new BitCastInst(BCI->getOperand(0), GEP.getType());
- }
- }
-
- // Combine Indices - If the source pointer to this getelementptr instruction
- // is a getelementptr instruction, combine the indices of the two
- // getelementptr instructions into a single instruction.
- //
- SmallVector<Value*, 8> SrcGEPOperands;
- if (User *Src = dyn_castGetElementPtr(PtrOp))
- SrcGEPOperands.append(Src->op_begin(), Src->op_end());
-
- if (!SrcGEPOperands.empty()) {
- // Note that if our source is a gep chain itself that we wait for that
- // chain to be resolved before we perform this transformation. This
- // avoids us creating a TON of code in some cases.
- //
- if (isa<GetElementPtrInst>(SrcGEPOperands[0]) &&
- cast<Instruction>(SrcGEPOperands[0])->getNumOperands() == 2)
- return 0; // Wait until our source is folded to completion.
-
- SmallVector<Value*, 8> Indices;
-
- // Find out whether the last index in the source GEP is a sequential idx.
- bool EndsWithSequential = false;
- for (gep_type_iterator I = gep_type_begin(*cast<User>(PtrOp)),
- E = gep_type_end(*cast<User>(PtrOp)); I != E; ++I)
- EndsWithSequential = !isa<StructType>(*I);
-
- // Can we combine the two pointer arithmetics offsets?
- if (EndsWithSequential) {
- // Replace: gep (gep %P, long B), long A, ...
- // With: T = long A+B; gep %P, T, ...
- //
- Value *Sum, *SO1 = SrcGEPOperands.back(), *GO1 = GEP.getOperand(1);
- if (SO1 == Constant::getNullValue(SO1->getType())) {
- Sum = GO1;
- } else if (GO1 == Constant::getNullValue(GO1->getType())) {
- Sum = SO1;
- } else {
- // If they aren't the same type, convert both to an integer of the
- // target's pointer size.
- if (SO1->getType() != GO1->getType()) {
- if (Constant *SO1C = dyn_cast<Constant>(SO1)) {
- SO1 = ConstantExpr::getIntegerCast(SO1C, GO1->getType(), true);
- } else if (Constant *GO1C = dyn_cast<Constant>(GO1)) {
- GO1 = ConstantExpr::getIntegerCast(GO1C, SO1->getType(), true);
- } else {
- unsigned PS = TD->getPointerSizeInBits();
- if (TD->getTypeSizeInBits(SO1->getType()) == PS) {
- // Convert GO1 to SO1's type.
- GO1 = InsertCastToIntPtrTy(GO1, SO1->getType(), &GEP, this);
-
- } else if (TD->getTypeSizeInBits(GO1->getType()) == PS) {
- // Convert SO1 to GO1's type.
- SO1 = InsertCastToIntPtrTy(SO1, GO1->getType(), &GEP, this);
- } else {
- const Type *PT = TD->getIntPtrType();
- SO1 = InsertCastToIntPtrTy(SO1, PT, &GEP, this);
- GO1 = InsertCastToIntPtrTy(GO1, PT, &GEP, this);
- }
- }
- }
- if (isa<Constant>(SO1) && isa<Constant>(GO1))
- Sum = ConstantExpr::getAdd(cast<Constant>(SO1), cast<Constant>(GO1));
- else {
- Sum = BinaryOperator::createAdd(SO1, GO1, PtrOp->getName()+".sum");
- InsertNewInstBefore(cast<Instruction>(Sum), GEP);
- }
- }
-
- // Recycle the GEP we already have if possible.
- if (SrcGEPOperands.size() == 2) {
- GEP.setOperand(0, SrcGEPOperands[0]);
- GEP.setOperand(1, Sum);
- return &GEP;
- } else {
- Indices.insert(Indices.end(), SrcGEPOperands.begin()+1,
- SrcGEPOperands.end()-1);
- Indices.push_back(Sum);
- Indices.insert(Indices.end(), GEP.op_begin()+2, GEP.op_end());
- }
- } else if (isa<Constant>(*GEP.idx_begin()) &&
- cast<Constant>(*GEP.idx_begin())->isNullValue() &&
- SrcGEPOperands.size() != 1) {
- // Otherwise we can do the fold if the first index of the GEP is a zero
- Indices.insert(Indices.end(), SrcGEPOperands.begin()+1,
- SrcGEPOperands.end());
- Indices.insert(Indices.end(), GEP.idx_begin()+1, GEP.idx_end());
- }
-
- if (!Indices.empty())
- return GetElementPtrInst::Create(SrcGEPOperands[0], Indices.begin(),
- Indices.end(), GEP.getName());
-
- } else if (GlobalValue *GV = dyn_cast<GlobalValue>(PtrOp)) {
- // GEP of global variable. If all of the indices for this GEP are
- // constants, we can promote this to a constexpr instead of an instruction.
-
- // Scan for nonconstants...
- SmallVector<Constant*, 8> Indices;
- User::op_iterator I = GEP.idx_begin(), E = GEP.idx_end();
- for (; I != E && isa<Constant>(*I); ++I)
- Indices.push_back(cast<Constant>(*I));
-
- if (I == E) { // If they are all constants...
- Constant *CE = ConstantExpr::getGetElementPtr(GV,
- &Indices[0],Indices.size());
-
- // Replace all uses of the GEP with the new constexpr...
- return ReplaceInstUsesWith(GEP, CE);
- }
- } else if (Value *X = getBitCastOperand(PtrOp)) { // Is the operand a cast?
- if (!isa<PointerType>(X->getType())) {
- // Not interesting. Source pointer must be a cast from pointer.
- } else if (HasZeroPointerIndex) {
- // transform: GEP (bitcast [10 x i8]* X to [0 x i8]*), i32 0, ...
- // into : GEP [10 x i8]* X, i32 0, ...
- //
- // This occurs when the program declares an array extern like "int X[];"
- //
- const PointerType *CPTy = cast<PointerType>(PtrOp->getType());
- const PointerType *XTy = cast<PointerType>(X->getType());
- if (const ArrayType *XATy =
- dyn_cast<ArrayType>(XTy->getElementType()))
- if (const ArrayType *CATy =
- dyn_cast<ArrayType>(CPTy->getElementType()))
- if (CATy->getElementType() == XATy->getElementType()) {
- // At this point, we know that the cast source type is a pointer
- // to an array of the same type as the destination pointer
- // array. Because the array type is never stepped over (there
- // is a leading zero) we can fold the cast into this GEP.
- GEP.setOperand(0, X);
- return &GEP;
- }
- } else if (GEP.getNumOperands() == 2) {
- // Transform things like:
- // %t = getelementptr i32* bitcast ([2 x i32]* %str to i32*), i32 %V
- // into: %t1 = getelementptr [2 x i32]* %str, i32 0, i32 %V; bitcast
- const Type *SrcElTy = cast<PointerType>(X->getType())->getElementType();
- const Type *ResElTy=cast<PointerType>(PtrOp->getType())->getElementType();
- if (isa<ArrayType>(SrcElTy) &&
- TD->getABITypeSize(cast<ArrayType>(SrcElTy)->getElementType()) ==
- TD->getABITypeSize(ResElTy)) {
- Value *Idx[2];
- Idx[0] = Constant::getNullValue(Type::Int32Ty);
- Idx[1] = GEP.getOperand(1);
- Value *V = InsertNewInstBefore(
- GetElementPtrInst::Create(X, Idx, Idx + 2, GEP.getName()), GEP);
- // V and GEP are both pointer types --> BitCast
- return new BitCastInst(V, GEP.getType());
- }
-
- // Transform things like:
- // getelementptr i8* bitcast ([100 x double]* X to i8*), i32 %tmp
- // (where tmp = 8*tmp2) into:
- // getelementptr [100 x double]* %arr, i32 0, i32 %tmp2; bitcast
-
- if (isa<ArrayType>(SrcElTy) && ResElTy == Type::Int8Ty) {
- uint64_t ArrayEltSize =
- TD->getABITypeSize(cast<ArrayType>(SrcElTy)->getElementType());
-
- // Check to see if "tmp" is a scale by a multiple of ArrayEltSize. We
- // allow either a mul, shift, or constant here.
- Value *NewIdx = 0;
- ConstantInt *Scale = 0;
- if (ArrayEltSize == 1) {
- NewIdx = GEP.getOperand(1);
- Scale = ConstantInt::get(NewIdx->getType(), 1);
- } else if (ConstantInt *CI = dyn_cast<ConstantInt>(GEP.getOperand(1))) {
- NewIdx = ConstantInt::get(CI->getType(), 1);
- Scale = CI;
- } else if (Instruction *Inst =dyn_cast<Instruction>(GEP.getOperand(1))){
- if (Inst->getOpcode() == Instruction::Shl &&
- isa<ConstantInt>(Inst->getOperand(1))) {
- ConstantInt *ShAmt = cast<ConstantInt>(Inst->getOperand(1));
- uint32_t ShAmtVal = ShAmt->getLimitedValue(64);
- Scale = ConstantInt::get(Inst->getType(), 1ULL << ShAmtVal);
- NewIdx = Inst->getOperand(0);
- } else if (Inst->getOpcode() == Instruction::Mul &&
- isa<ConstantInt>(Inst->getOperand(1))) {
- Scale = cast<ConstantInt>(Inst->getOperand(1));
- NewIdx = Inst->getOperand(0);
- }
- }
-
- // If the index will be to exactly the right offset with the scale taken
- // out, perform the transformation. Note, we don't know whether Scale is
- // signed or not. We'll use unsigned version of division/modulo
- // operation after making sure Scale doesn't have the sign bit set.
- if (Scale && Scale->getSExtValue() >= 0LL &&
- Scale->getZExtValue() % ArrayEltSize == 0) {
- Scale = ConstantInt::get(Scale->getType(),
- Scale->getZExtValue() / ArrayEltSize);
- if (Scale->getZExtValue() != 1) {
- Constant *C = ConstantExpr::getIntegerCast(Scale, NewIdx->getType(),
- false /*ZExt*/);
- Instruction *Sc = BinaryOperator::createMul(NewIdx, C, "idxscale");
- NewIdx = InsertNewInstBefore(Sc, GEP);
- }
-
- // Insert the new GEP instruction.
- Value *Idx[2];
- Idx[0] = Constant::getNullValue(Type::Int32Ty);
- Idx[1] = NewIdx;
- Instruction *NewGEP =
- GetElementPtrInst::Create(X, Idx, Idx + 2, GEP.getName());
- NewGEP = InsertNewInstBefore(NewGEP, GEP);
- // The NewGEP must be pointer typed, so must the old one -> BitCast
- return new BitCastInst(NewGEP, GEP.getType());
- }
- }
- }
- }
-
- return 0;
-}
-
-Instruction *InstCombiner::visitAllocationInst(AllocationInst &AI) {
- // Convert: malloc Ty, C - where C is a constant != 1 into: malloc [C x Ty], 1
- if (AI.isArrayAllocation()) { // Check C != 1
- if (const ConstantInt *C = dyn_cast<ConstantInt>(AI.getArraySize())) {
- const Type *NewTy =
- ArrayType::get(AI.getAllocatedType(), C->getZExtValue());
- AllocationInst *New = 0;
-
- // Create and insert the replacement instruction...
- if (isa<MallocInst>(AI))
- New = new MallocInst(NewTy, 0, AI.getAlignment(), AI.getName());
- else {
- assert(isa<AllocaInst>(AI) && "Unknown type of allocation inst!");
- New = new AllocaInst(NewTy, 0, AI.getAlignment(), AI.getName());
- }
-
- InsertNewInstBefore(New, AI);
-
- // Scan to the end of the allocation instructions, to skip over a block of
- // allocas if possible...
- //
- BasicBlock::iterator It = New;
- while (isa<AllocationInst>(*It)) ++It;
-
- // Now that I is pointing to the first non-allocation-inst in the block,
- // insert our getelementptr instruction...
- //
- Value *NullIdx = Constant::getNullValue(Type::Int32Ty);
- Value *Idx[2];
- Idx[0] = NullIdx;
- Idx[1] = NullIdx;
- Value *V = GetElementPtrInst::Create(New, Idx, Idx + 2,
- New->getName()+".sub", It);
-
- // Now make everything use the getelementptr instead of the original
- // allocation.
- return ReplaceInstUsesWith(AI, V);
- } else if (isa<UndefValue>(AI.getArraySize())) {
- return ReplaceInstUsesWith(AI, Constant::getNullValue(AI.getType()));
- }
- }
-
- // If alloca'ing a zero byte object, replace the alloca with a null pointer.
- // Note that we only do this for alloca's, because malloc should allocate and
- // return a unique pointer, even for a zero byte allocation.
- if (isa<AllocaInst>(AI) && AI.getAllocatedType()->isSized() &&
- TD->getABITypeSize(AI.getAllocatedType()) == 0)
- return ReplaceInstUsesWith(AI, Constant::getNullValue(AI.getType()));
-
- return 0;
-}
-
-Instruction *InstCombiner::visitFreeInst(FreeInst &FI) {
- Value *Op = FI.getOperand(0);
-
- // free undef -> unreachable.
- if (isa<UndefValue>(Op)) {
- // Insert a new store to null because we cannot modify the CFG here.
- new StoreInst(ConstantInt::getTrue(),
- UndefValue::get(PointerType::getUnqual(Type::Int1Ty)), &FI);
- return EraseInstFromFunction(FI);
- }
-
- // If we have 'free null' delete the instruction. This can happen in stl code
- // when lots of inlining happens.
- if (isa<ConstantPointerNull>(Op))
- return EraseInstFromFunction(FI);
-
- // Change free <ty>* (cast <ty2>* X to <ty>*) into free <ty2>* X
- if (BitCastInst *CI = dyn_cast<BitCastInst>(Op)) {
- FI.setOperand(0, CI->getOperand(0));
- return &FI;
- }
-
- // Change free (gep X, 0,0,0,0) into free(X)
- if (GetElementPtrInst *GEPI = dyn_cast<GetElementPtrInst>(Op)) {
- if (GEPI->hasAllZeroIndices()) {
- AddToWorkList(GEPI);
- FI.setOperand(0, GEPI->getOperand(0));
- return &FI;
- }
- }
-
- // Change free(malloc) into nothing, if the malloc has a single use.
- if (MallocInst *MI = dyn_cast<MallocInst>(Op))
- if (MI->hasOneUse()) {
- EraseInstFromFunction(FI);
- return EraseInstFromFunction(*MI);
- }
-
- return 0;
-}
-
-
-/// InstCombineLoadCast - Fold 'load (cast P)' -> cast (load P)' when possible.
-static Instruction *InstCombineLoadCast(InstCombiner &IC, LoadInst &LI,
- const TargetData *TD) {
- User *CI = cast<User>(LI.getOperand(0));
- Value *CastOp = CI->getOperand(0);
-
- if (ConstantExpr *CE = dyn_cast<ConstantExpr>(CI)) {
- // Instead of loading constant c string, use corresponding integer value
- // directly if string length is small enough.
- const std::string &Str = CE->getOperand(0)->getStringValue();
- if (!Str.empty()) {
- unsigned len = Str.length();
- const Type *Ty = cast<PointerType>(CE->getType())->getElementType();
- unsigned numBits = Ty->getPrimitiveSizeInBits();
- // Replace LI with immediate integer store.
- if ((numBits >> 3) == len + 1) {
- APInt StrVal(numBits, 0);
- APInt SingleChar(numBits, 0);
- if (TD->isLittleEndian()) {
- for (signed i = len-1; i >= 0; i--) {
- SingleChar = (uint64_t) Str[i];
- StrVal = (StrVal << 8) | SingleChar;
- }
- } else {
- for (unsigned i = 0; i < len; i++) {
- SingleChar = (uint64_t) Str[i];
- StrVal = (StrVal << 8) | SingleChar;
- }
- // Append NULL at the end.
- SingleChar = 0;
- StrVal = (StrVal << 8) | SingleChar;
- }
- Value *NL = ConstantInt::get(StrVal);
- return IC.ReplaceInstUsesWith(LI, NL);
- }
- }
- }
-
- const Type *DestPTy = cast<PointerType>(CI->getType())->getElementType();
- if (const PointerType *SrcTy = dyn_cast<PointerType>(CastOp->getType())) {
- const Type *SrcPTy = SrcTy->getElementType();
-
- if (DestPTy->isInteger() || isa<PointerType>(DestPTy) ||
- isa<VectorType>(DestPTy)) {
- // If the source is an array, the code below will not succeed. Check to
- // see if a trivial 'gep P, 0, 0' will help matters. Only do this for
- // constants.
- if (const ArrayType *ASrcTy = dyn_cast<ArrayType>(SrcPTy))
- if (Constant *CSrc = dyn_cast<Constant>(CastOp))
- if (ASrcTy->getNumElements() != 0) {
- Value *Idxs[2];
- Idxs[0] = Idxs[1] = Constant::getNullValue(Type::Int32Ty);
- CastOp = ConstantExpr::getGetElementPtr(CSrc, Idxs, 2);
- SrcTy = cast<PointerType>(CastOp->getType());
- SrcPTy = SrcTy->getElementType();
- }
-
- if ((SrcPTy->isInteger() || isa<PointerType>(SrcPTy) ||
- isa<VectorType>(SrcPTy)) &&
- // Do not allow turning this into a load of an integer, which is then
- // casted to a pointer, this pessimizes pointer analysis a lot.
- (isa<PointerType>(SrcPTy) == isa<PointerType>(LI.getType())) &&
- IC.getTargetData().getTypeSizeInBits(SrcPTy) ==
- IC.getTargetData().getTypeSizeInBits(DestPTy)) {
-
- // Okay, we are casting from one integer or pointer type to another of
- // the same size. Instead of casting the pointer before the load, cast
- // the result of the loaded value.
- Value *NewLoad = IC.InsertNewInstBefore(new LoadInst(CastOp,
- CI->getName(),
- LI.isVolatile()),LI);
- // Now cast the result of the load.
- return new BitCastInst(NewLoad, LI.getType());
- }
- }
- }
- return 0;
-}
-
-/// isSafeToLoadUnconditionally - Return true if we know that executing a load
-/// from this value cannot trap. If it is not obviously safe to load from the
-/// specified pointer, we do a quick local scan of the basic block containing
-/// ScanFrom, to determine if the address is already accessed.
-static bool isSafeToLoadUnconditionally(Value *V, Instruction *ScanFrom) {
- // If it is an alloca it is always safe to load from.
- if (isa<AllocaInst>(V)) return true;
-
- // If it is a global variable it is mostly safe to load from.
- if (const GlobalValue *GV = dyn_cast<GlobalVariable>(V))
- // Don't try to evaluate aliases. External weak GV can be null.
- return !isa<GlobalAlias>(GV) && !GV->hasExternalWeakLinkage();
-
- // Otherwise, be a little bit agressive by scanning the local block where we
- // want to check to see if the pointer is already being loaded or stored
- // from/to. If so, the previous load or store would have already trapped,
- // so there is no harm doing an extra load (also, CSE will later eliminate
- // the load entirely).
- BasicBlock::iterator BBI = ScanFrom, E = ScanFrom->getParent()->begin();
-
- while (BBI != E) {
- --BBI;
-
- if (LoadInst *LI = dyn_cast<LoadInst>(BBI)) {
- if (LI->getOperand(0) == V) return true;
- } else if (StoreInst *SI = dyn_cast<StoreInst>(BBI))
- if (SI->getOperand(1) == V) return true;
-
- }
- return false;
-}
-
-/// GetUnderlyingObject - Trace through a series of getelementptrs and bitcasts
-/// until we find the underlying object a pointer is referring to or something
-/// we don't understand. Note that the returned pointer may be offset from the
-/// input, because we ignore GEP indices.
-static Value *GetUnderlyingObject(Value *Ptr) {
- while (1) {
- if (ConstantExpr *CE = dyn_cast<ConstantExpr>(Ptr)) {
- if (CE->getOpcode() == Instruction::BitCast ||
- CE->getOpcode() == Instruction::GetElementPtr)
- Ptr = CE->getOperand(0);
- else
- return Ptr;
- } else if (BitCastInst *BCI = dyn_cast<BitCastInst>(Ptr)) {
- Ptr = BCI->getOperand(0);
- } else if (GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(Ptr)) {
- Ptr = GEP->getOperand(0);
- } else {
- return Ptr;
- }
- }
-}
-
-Instruction *InstCombiner::visitLoadInst(LoadInst &LI) {
- Value *Op = LI.getOperand(0);
-
- // Attempt to improve the alignment.
- unsigned KnownAlign = GetOrEnforceKnownAlignment(Op);
- if (KnownAlign >
- (LI.getAlignment() == 0 ? TD->getABITypeAlignment(LI.getType()) :
- LI.getAlignment()))
- LI.setAlignment(KnownAlign);
-
- // load (cast X) --> cast (load X) iff safe
- if (isa<CastInst>(Op))
- if (Instruction *Res = InstCombineLoadCast(*this, LI, TD))
- return Res;
-
- // None of the following transforms are legal for volatile loads.
- if (LI.isVolatile()) return 0;
-
- if (&LI.getParent()->front() != &LI) {
- BasicBlock::iterator BBI = &LI; --BBI;
- // If the instruction immediately before this is a store to the same
- // address, do a simple form of store->load forwarding.
- if (StoreInst *SI = dyn_cast<StoreInst>(BBI))
- if (SI->getOperand(1) == LI.getOperand(0))
- return ReplaceInstUsesWith(LI, SI->getOperand(0));
- if (LoadInst *LIB = dyn_cast<LoadInst>(BBI))
- if (LIB->getOperand(0) == LI.getOperand(0))
- return ReplaceInstUsesWith(LI, LIB);
- }
-
- if (GetElementPtrInst *GEPI = dyn_cast<GetElementPtrInst>(Op)) {
- const Value *GEPI0 = GEPI->getOperand(0);
- // TODO: Consider a target hook for valid address spaces for this xform.
- if (isa<ConstantPointerNull>(GEPI0) &&
- cast<PointerType>(GEPI0->getType())->getAddressSpace() == 0) {
- // Insert a new store to null instruction before the load to indicate
- // that this code is not reachable. We do this instead of inserting
- // an unreachable instruction directly because we cannot modify the
- // CFG.
- new StoreInst(UndefValue::get(LI.getType()),
- Constant::getNullValue(Op->getType()), &LI);
- return ReplaceInstUsesWith(LI, UndefValue::get(LI.getType()));
- }
- }
-
- if (Constant *C = dyn_cast<Constant>(Op)) {
- // load null/undef -> undef
- // TODO: Consider a target hook for valid address spaces for this xform.
- if (isa<UndefValue>(C) || (C->isNullValue() &&
- cast<PointerType>(Op->getType())->getAddressSpace() == 0)) {
- // Insert a new store to null instruction before the load to indicate that
- // this code is not reachable. We do this instead of inserting an
- // unreachable instruction directly because we cannot modify the CFG.
- new StoreInst(UndefValue::get(LI.getType()),
- Constant::getNullValue(Op->getType()), &LI);
- return ReplaceInstUsesWith(LI, UndefValue::get(LI.getType()));
- }
-
- // Instcombine load (constant global) into the value loaded.
- if (GlobalVariable *GV = dyn_cast<GlobalVariable>(Op))
- if (GV->isConstant() && !GV->isDeclaration())
- return ReplaceInstUsesWith(LI, GV->getInitializer());
-
- // Instcombine load (constantexpr_GEP global, 0, ...) into the value loaded.
- if (ConstantExpr *CE = dyn_cast<ConstantExpr>(Op)) {
- if (CE->getOpcode() == Instruction::GetElementPtr) {
- if (GlobalVariable *GV = dyn_cast<GlobalVariable>(CE->getOperand(0)))
- if (GV->isConstant() && !GV->isDeclaration())
- if (Constant *V =
- ConstantFoldLoadThroughGEPConstantExpr(GV->getInitializer(), CE))
- return ReplaceInstUsesWith(LI, V);
- if (CE->getOperand(0)->isNullValue()) {
- // Insert a new store to null instruction before the load to indicate
- // that this code is not reachable. We do this instead of inserting
- // an unreachable instruction directly because we cannot modify the
- // CFG.
- new StoreInst(UndefValue::get(LI.getType()),
- Constant::getNullValue(Op->getType()), &LI);
- return ReplaceInstUsesWith(LI, UndefValue::get(LI.getType()));
- }
-
- } else if (CE->isCast()) {
- if (Instruction *Res = InstCombineLoadCast(*this, LI, TD))
- return Res;
- }
- }
- }
-
- // If this load comes from anywhere in a constant global, and if the global
- // is all undef or zero, we know what it loads.
- if (GlobalVariable *GV = dyn_cast<GlobalVariable>(GetUnderlyingObject(Op))) {
- if (GV->isConstant() && GV->hasInitializer()) {
- if (GV->getInitializer()->isNullValue())
- return ReplaceInstUsesWith(LI, Constant::getNullValue(LI.getType()));
- else if (isa<UndefValue>(GV->getInitializer()))
- return ReplaceInstUsesWith(LI, UndefValue::get(LI.getType()));
- }
- }
-
- if (Op->hasOneUse()) {
- // Change select and PHI nodes to select values instead of addresses: this
- // helps alias analysis out a lot, allows many others simplifications, and
- // exposes redundancy in the code.
- //
- // Note that we cannot do the transformation unless we know that the
- // introduced loads cannot trap! Something like this is valid as long as
- // the condition is always false: load (select bool %C, int* null, int* %G),
- // but it would not be valid if we transformed it to load from null
- // unconditionally.
- //
- if (SelectInst *SI = dyn_cast<SelectInst>(Op)) {
- // load (select (Cond, &V1, &V2)) --> select(Cond, load &V1, load &V2).
- if (isSafeToLoadUnconditionally(SI->getOperand(1), SI) &&
- isSafeToLoadUnconditionally(SI->getOperand(2), SI)) {
- Value *V1 = InsertNewInstBefore(new LoadInst(SI->getOperand(1),
- SI->getOperand(1)->getName()+".val"), LI);
- Value *V2 = InsertNewInstBefore(new LoadInst(SI->getOperand(2),
- SI->getOperand(2)->getName()+".val"), LI);
- return SelectInst::Create(SI->getCondition(), V1, V2);
- }
-
- // load (select (cond, null, P)) -> load P
- if (Constant *C = dyn_cast<Constant>(SI->getOperand(1)))
- if (C->isNullValue()) {
- LI.setOperand(0, SI->getOperand(2));
- return &LI;
- }
-
- // load (select (cond, P, null)) -> load P
- if (Constant *C = dyn_cast<Constant>(SI->getOperand(2)))
- if (C->isNullValue()) {
- LI.setOperand(0, SI->getOperand(1));
- return &LI;
- }
- }
- }
- return 0;
-}
-
-/// InstCombineStoreToCast - Fold store V, (cast P) -> store (cast V), P
-/// when possible.
-static Instruction *InstCombineStoreToCast(InstCombiner &IC, StoreInst &SI) {
- User *CI = cast<User>(SI.getOperand(1));
- Value *CastOp = CI->getOperand(0);
-
- const Type *DestPTy = cast<PointerType>(CI->getType())->getElementType();
- if (const PointerType *SrcTy = dyn_cast<PointerType>(CastOp->getType())) {
- const Type *SrcPTy = SrcTy->getElementType();
-
- if (DestPTy->isInteger() || isa<PointerType>(DestPTy)) {
- // If the source is an array, the code below will not succeed. Check to
- // see if a trivial 'gep P, 0, 0' will help matters. Only do this for
- // constants.
- if (const ArrayType *ASrcTy = dyn_cast<ArrayType>(SrcPTy))
- if (Constant *CSrc = dyn_cast<Constant>(CastOp))
- if (ASrcTy->getNumElements() != 0) {
- Value* Idxs[2];
- Idxs[0] = Idxs[1] = Constant::getNullValue(Type::Int32Ty);
- CastOp = ConstantExpr::getGetElementPtr(CSrc, Idxs, 2);
- SrcTy = cast<PointerType>(CastOp->getType());
- SrcPTy = SrcTy->getElementType();
- }
-
- if ((SrcPTy->isInteger() || isa<PointerType>(SrcPTy)) &&
- IC.getTargetData().getTypeSizeInBits(SrcPTy) ==
- IC.getTargetData().getTypeSizeInBits(DestPTy)) {
-
- // Okay, we are casting from one integer or pointer type to another of
- // the same size. Instead of casting the pointer before
- // the store, cast the value to be stored.
- Value *NewCast;
- Value *SIOp0 = SI.getOperand(0);
- Instruction::CastOps opcode = Instruction::BitCast;
- const Type* CastSrcTy = SIOp0->getType();
- const Type* CastDstTy = SrcPTy;
- if (isa<PointerType>(CastDstTy)) {
- if (CastSrcTy->isInteger())
- opcode = Instruction::IntToPtr;
- } else if (isa<IntegerType>(CastDstTy)) {
- if (isa<PointerType>(SIOp0->getType()))
- opcode = Instruction::PtrToInt;
- }
- if (Constant *C = dyn_cast<Constant>(SIOp0))
- NewCast = ConstantExpr::getCast(opcode, C, CastDstTy);
- else
- NewCast = IC.InsertNewInstBefore(
- CastInst::create(opcode, SIOp0, CastDstTy, SIOp0->getName()+".c"),
- SI);
- return new StoreInst(NewCast, CastOp);
- }
- }
- }
- return 0;
-}
-
-Instruction *InstCombiner::visitStoreInst(StoreInst &SI) {
- Value *Val = SI.getOperand(0);
- Value *Ptr = SI.getOperand(1);
-
- if (isa<UndefValue>(Ptr)) { // store X, undef -> noop (even if volatile)
- EraseInstFromFunction(SI);
- ++NumCombined;
- return 0;
- }
-
- // If the RHS is an alloca with a single use, zapify the store, making the
- // alloca dead.
- if (Ptr->hasOneUse() && !SI.isVolatile()) {
- if (isa<AllocaInst>(Ptr)) {
- EraseInstFromFunction(SI);
- ++NumCombined;
- return 0;
- }
-
- if (GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(Ptr))
- if (isa<AllocaInst>(GEP->getOperand(0)) &&
- GEP->getOperand(0)->hasOneUse()) {
- EraseInstFromFunction(SI);
- ++NumCombined;
- return 0;
- }
- }
-
- // Attempt to improve the alignment.
- unsigned KnownAlign = GetOrEnforceKnownAlignment(Ptr);
- if (KnownAlign >
- (SI.getAlignment() == 0 ? TD->getABITypeAlignment(Val->getType()) :
- SI.getAlignment()))
- SI.setAlignment(KnownAlign);
-
- // Do really simple DSE, to catch cases where there are several consequtive
- // stores to the same location, separated by a few arithmetic operations. This
- // situation often occurs with bitfield accesses.
- BasicBlock::iterator BBI = &SI;
- for (unsigned ScanInsts = 6; BBI != SI.getParent()->begin() && ScanInsts;
- --ScanInsts) {
- --BBI;
-
- if (StoreInst *PrevSI = dyn_cast<StoreInst>(BBI)) {
- // Prev store isn't volatile, and stores to the same location?
- if (!PrevSI->isVolatile() && PrevSI->getOperand(1) == SI.getOperand(1)) {
- ++NumDeadStore;
- ++BBI;
- EraseInstFromFunction(*PrevSI);
- continue;
- }
- break;
- }
-
- // If this is a load, we have to stop. However, if the loaded value is from
- // the pointer we're loading and is producing the pointer we're storing,
- // then *this* store is dead (X = load P; store X -> P).
- if (LoadInst *LI = dyn_cast<LoadInst>(BBI)) {
- if (LI == Val && LI->getOperand(0) == Ptr && !SI.isVolatile()) {
- EraseInstFromFunction(SI);
- ++NumCombined;
- return 0;
- }
- // Otherwise, this is a load from some other location. Stores before it
- // may not be dead.
- break;
- }
-
- // Don't skip over loads or things that can modify memory.
- if (BBI->mayWriteToMemory() || BBI->mayReadFromMemory())
- break;
- }
-
-
- if (SI.isVolatile()) return 0; // Don't hack volatile stores.
-
- // store X, null -> turns into 'unreachable' in SimplifyCFG
- if (isa<ConstantPointerNull>(Ptr)) {
- if (!isa<UndefValue>(Val)) {
- SI.setOperand(0, UndefValue::get(Val->getType()));
- if (Instruction *U = dyn_cast<Instruction>(Val))
- AddToWorkList(U); // Dropped a use.
- ++NumCombined;
- }
- return 0; // Do not modify these!
- }
-
- // store undef, Ptr -> noop
- if (isa<UndefValue>(Val)) {
- EraseInstFromFunction(SI);
- ++NumCombined;
- return 0;
- }
-
- // If the pointer destination is a cast, see if we can fold the cast into the
- // source instead.
- if (isa<CastInst>(Ptr))
- if (Instruction *Res = InstCombineStoreToCast(*this, SI))
- return Res;
- if (ConstantExpr *CE = dyn_cast<ConstantExpr>(Ptr))
- if (CE->isCast())
- if (Instruction *Res = InstCombineStoreToCast(*this, SI))
- return Res;
-
-
- // If this store is the last instruction in the basic block, and if the block
- // ends with an unconditional branch, try to move it to the successor block.
- BBI = &SI; ++BBI;
- if (BranchInst *BI = dyn_cast<BranchInst>(BBI))
- if (BI->isUnconditional())
- if (SimplifyStoreAtEndOfBlock(SI))
- return 0; // xform done!
-
- return 0;
-}
-
-/// SimplifyStoreAtEndOfBlock - Turn things like:
-/// if () { *P = v1; } else { *P = v2 }
-/// into a phi node with a store in the successor.
-///
-/// Simplify things like:
-/// *P = v1; if () { *P = v2; }
-/// into a phi node with a store in the successor.
-///
-bool InstCombiner::SimplifyStoreAtEndOfBlock(StoreInst &SI) {
- BasicBlock *StoreBB = SI.getParent();
-
- // Check to see if the successor block has exactly two incoming edges. If
- // so, see if the other predecessor contains a store to the same location.
- // if so, insert a PHI node (if needed) and move the stores down.
- BasicBlock *DestBB = StoreBB->getTerminator()->getSuccessor(0);
-
- // Determine whether Dest has exactly two predecessors and, if so, compute
- // the other predecessor.
- pred_iterator PI = pred_begin(DestBB);
- BasicBlock *OtherBB = 0;
- if (*PI != StoreBB)
- OtherBB = *PI;
- ++PI;
- if (PI == pred_end(DestBB))
- return false;
-
- if (*PI != StoreBB) {
- if (OtherBB)
- return false;
- OtherBB = *PI;
- }
- if (++PI != pred_end(DestBB))
- return false;
-
-
- // Verify that the other block ends in a branch and is not otherwise empty.
- BasicBlock::iterator BBI = OtherBB->getTerminator();
- BranchInst *OtherBr = dyn_cast<BranchInst>(BBI);
- if (!OtherBr || BBI == OtherBB->begin())
- return false;
-
- // If the other block ends in an unconditional branch, check for the 'if then
- // else' case. there is an instruction before the branch.
- StoreInst *OtherStore = 0;
- if (OtherBr->isUnconditional()) {
- // If this isn't a store, or isn't a store to the same location, bail out.
- --BBI;
- OtherStore = dyn_cast<StoreInst>(BBI);
- if (!OtherStore || OtherStore->getOperand(1) != SI.getOperand(1))
- return false;
- } else {
- // Otherwise, the other block ended with a conditional branch. If one of the
- // destinations is StoreBB, then we have the if/then case.
- if (OtherBr->getSuccessor(0) != StoreBB &&
- OtherBr->getSuccessor(1) != StoreBB)
- return false;
-
- // Okay, we know that OtherBr now goes to Dest and StoreBB, so this is an
- // if/then triangle. See if there is a store to the same ptr as SI that
- // lives in OtherBB.
- for (;; --BBI) {
- // Check to see if we find the matching store.
- if ((OtherStore = dyn_cast<StoreInst>(BBI))) {
- if (OtherStore->getOperand(1) != SI.getOperand(1))
- return false;
- break;
- }
- // If we find something that may be using the stored value, or if we run
- // out of instructions, we can't do the xform.
- if (isa<LoadInst>(BBI) || BBI->mayWriteToMemory() ||
- BBI == OtherBB->begin())
- return false;
- }
-
- // In order to eliminate the store in OtherBr, we have to
- // make sure nothing reads the stored value in StoreBB.
- for (BasicBlock::iterator I = StoreBB->begin(); &*I != &SI; ++I) {
- // FIXME: This should really be AA driven.
- if (isa<LoadInst>(I) || I->mayWriteToMemory())
- return false;
- }
- }
-
- // Insert a PHI node now if we need it.
- Value *MergedVal = OtherStore->getOperand(0);
- if (MergedVal != SI.getOperand(0)) {
- PHINode *PN = PHINode::Create(MergedVal->getType(), "storemerge");
- PN->reserveOperandSpace(2);
- PN->addIncoming(SI.getOperand(0), SI.getParent());
- PN->addIncoming(OtherStore->getOperand(0), OtherBB);
- MergedVal = InsertNewInstBefore(PN, DestBB->front());
- }
-
- // Advance to a place where it is safe to insert the new store and
- // insert it.
- BBI = DestBB->begin();
- while (isa<PHINode>(BBI)) ++BBI;
- InsertNewInstBefore(new StoreInst(MergedVal, SI.getOperand(1),
- OtherStore->isVolatile()), *BBI);
-
- // Nuke the old stores.
- EraseInstFromFunction(SI);
- EraseInstFromFunction(*OtherStore);
- ++NumCombined;
- return true;
-}
-
-
-Instruction *InstCombiner::visitBranchInst(BranchInst &BI) {
- // Change br (not X), label True, label False to: br X, label False, True
- Value *X = 0;
- BasicBlock *TrueDest;
- BasicBlock *FalseDest;
- if (match(&BI, m_Br(m_Not(m_Value(X)), TrueDest, FalseDest)) &&
- !isa<Constant>(X)) {
- // Swap Destinations and condition...
- BI.setCondition(X);
- BI.setSuccessor(0, FalseDest);
- BI.setSuccessor(1, TrueDest);
- return &BI;
- }
-
- // Cannonicalize fcmp_one -> fcmp_oeq
- FCmpInst::Predicate FPred; Value *Y;
- if (match(&BI, m_Br(m_FCmp(FPred, m_Value(X), m_Value(Y)),
- TrueDest, FalseDest)))
- if ((FPred == FCmpInst::FCMP_ONE || FPred == FCmpInst::FCMP_OLE ||
- FPred == FCmpInst::FCMP_OGE) && BI.getCondition()->hasOneUse()) {
- FCmpInst *I = cast<FCmpInst>(BI.getCondition());
- FCmpInst::Predicate NewPred = FCmpInst::getInversePredicate(FPred);
- Instruction *NewSCC = new FCmpInst(NewPred, X, Y, "", I);
- NewSCC->takeName(I);
- // Swap Destinations and condition...
- BI.setCondition(NewSCC);
- BI.setSuccessor(0, FalseDest);
- BI.setSuccessor(1, TrueDest);
- RemoveFromWorkList(I);
- I->eraseFromParent();
- AddToWorkList(NewSCC);
- return &BI;
- }
-
- // Cannonicalize icmp_ne -> icmp_eq
- ICmpInst::Predicate IPred;
- if (match(&BI, m_Br(m_ICmp(IPred, m_Value(X), m_Value(Y)),
- TrueDest, FalseDest)))
- if ((IPred == ICmpInst::ICMP_NE || IPred == ICmpInst::ICMP_ULE ||
- IPred == ICmpInst::ICMP_SLE || IPred == ICmpInst::ICMP_UGE ||
- IPred == ICmpInst::ICMP_SGE) && BI.getCondition()->hasOneUse()) {
- ICmpInst *I = cast<ICmpInst>(BI.getCondition());
- ICmpInst::Predicate NewPred = ICmpInst::getInversePredicate(IPred);
- Instruction *NewSCC = new ICmpInst(NewPred, X, Y, "", I);
- NewSCC->takeName(I);
- // Swap Destinations and condition...
- BI.setCondition(NewSCC);
- BI.setSuccessor(0, FalseDest);
- BI.setSuccessor(1, TrueDest);
- RemoveFromWorkList(I);
- I->eraseFromParent();;
- AddToWorkList(NewSCC);
- return &BI;
- }
-
- return 0;
-}
-
-Instruction *InstCombiner::visitSwitchInst(SwitchInst &SI) {
- Value *Cond = SI.getCondition();
- if (Instruction *I = dyn_cast<Instruction>(Cond)) {
- if (I->getOpcode() == Instruction::Add)
- if (ConstantInt *AddRHS = dyn_cast<ConstantInt>(I->getOperand(1))) {
- // change 'switch (X+4) case 1:' into 'switch (X) case -3'
- for (unsigned i = 2, e = SI.getNumOperands(); i != e; i += 2)
- SI.setOperand(i,ConstantExpr::getSub(cast<Constant>(SI.getOperand(i)),
- AddRHS));
- SI.setOperand(0, I->getOperand(0));
- AddToWorkList(I);
- return &SI;
- }
- }
- return 0;
-}
-
-/// CheapToScalarize - Return true if the value is cheaper to scalarize than it
-/// is to leave as a vector operation.
-static bool CheapToScalarize(Value *V, bool isConstant) {
- if (isa<ConstantAggregateZero>(V))
- return true;
- if (ConstantVector *C = dyn_cast<ConstantVector>(V)) {
- if (isConstant) return true;
- // If all elts are the same, we can extract.
- Constant *Op0 = C->getOperand(0);
- for (unsigned i = 1; i < C->getNumOperands(); ++i)
- if (C->getOperand(i) != Op0)
- return false;
- return true;
- }
- Instruction *I = dyn_cast<Instruction>(V);
- if (!I) return false;
-
- // Insert element gets simplified to the inserted element or is deleted if
- // this is constant idx extract element and its a constant idx insertelt.
- if (I->getOpcode() == Instruction::InsertElement && isConstant &&
- isa<ConstantInt>(I->getOperand(2)))
- return true;
- if (I->getOpcode() == Instruction::Load && I->hasOneUse())
- return true;
- if (BinaryOperator *BO = dyn_cast<BinaryOperator>(I))
- if (BO->hasOneUse() &&
- (CheapToScalarize(BO->getOperand(0), isConstant) ||
- CheapToScalarize(BO->getOperand(1), isConstant)))
- return true;
- if (CmpInst *CI = dyn_cast<CmpInst>(I))
- if (CI->hasOneUse() &&
- (CheapToScalarize(CI->getOperand(0), isConstant) ||
- CheapToScalarize(CI->getOperand(1), isConstant)))
- return true;
-
- return false;
-}
-
-/// Read and decode a shufflevector mask.
-///
-/// It turns undef elements into values that are larger than the number of
-/// elements in the input.
-static std::vector<unsigned> getShuffleMask(const ShuffleVectorInst *SVI) {
- unsigned NElts = SVI->getType()->getNumElements();
- if (isa<ConstantAggregateZero>(SVI->getOperand(2)))
- return std::vector<unsigned>(NElts, 0);
- if (isa<UndefValue>(SVI->getOperand(2)))
- return std::vector<unsigned>(NElts, 2*NElts);
-
- std::vector<unsigned> Result;
- const ConstantVector *CP = cast<ConstantVector>(SVI->getOperand(2));
- for (unsigned i = 0, e = CP->getNumOperands(); i != e; ++i)
- if (isa<UndefValue>(CP->getOperand(i)))
- Result.push_back(NElts*2); // undef -> 8
- else
- Result.push_back(cast<ConstantInt>(CP->getOperand(i))->getZExtValue());
- return Result;
-}
-
-/// FindScalarElement - Given a vector and an element number, see if the scalar
-/// value is already around as a register, for example if it were inserted then
-/// extracted from the vector.
-static Value *FindScalarElement(Value *V, unsigned EltNo) {
- assert(isa<VectorType>(V->getType()) && "Not looking at a vector?");
- const VectorType *PTy = cast<VectorType>(V->getType());
- unsigned Width = PTy->getNumElements();
- if (EltNo >= Width) // Out of range access.
- return UndefValue::get(PTy->getElementType());
-
- if (isa<UndefValue>(V))
- return UndefValue::get(PTy->getElementType());
- else if (isa<ConstantAggregateZero>(V))
- return Constant::getNullValue(PTy->getElementType());
- else if (ConstantVector *CP = dyn_cast<ConstantVector>(V))
- return CP->getOperand(EltNo);
- else if (InsertElementInst *III = dyn_cast<InsertElementInst>(V)) {
- // If this is an insert to a variable element, we don't know what it is.
- if (!isa<ConstantInt>(III->getOperand(2)))
- return 0;
- unsigned IIElt = cast<ConstantInt>(III->getOperand(2))->getZExtValue();
-
- // If this is an insert to the element we are looking for, return the
- // inserted value.
- if (EltNo == IIElt)
- return III->getOperand(1);
-
- // Otherwise, the insertelement doesn't modify the value, recurse on its
- // vector input.
- return FindScalarElement(III->getOperand(0), EltNo);
- } else if (ShuffleVectorInst *SVI = dyn_cast<ShuffleVectorInst>(V)) {
- unsigned InEl = getShuffleMask(SVI)[EltNo];
- if (InEl < Width)
- return FindScalarElement(SVI->getOperand(0), InEl);
- else if (InEl < Width*2)
- return FindScalarElement(SVI->getOperand(1), InEl - Width);
- else
- return UndefValue::get(PTy->getElementType());
- }
-
- // Otherwise, we don't know.
- return 0;
-}
-
-Instruction *InstCombiner::visitExtractElementInst(ExtractElementInst &EI) {
-
- // If vector val is undef, replace extract with scalar undef.
- if (isa<UndefValue>(EI.getOperand(0)))
- return ReplaceInstUsesWith(EI, UndefValue::get(EI.getType()));
-
- // If vector val is constant 0, replace extract with scalar 0.
- if (isa<ConstantAggregateZero>(EI.getOperand(0)))
- return ReplaceInstUsesWith(EI, Constant::getNullValue(EI.getType()));
-
- if (ConstantVector *C = dyn_cast<ConstantVector>(EI.getOperand(0))) {
- // If vector val is constant with uniform operands, replace EI
- // with that operand
- Constant *op0 = C->getOperand(0);
- for (unsigned i = 1; i < C->getNumOperands(); ++i)
- if (C->getOperand(i) != op0) {
- op0 = 0;
- break;
- }
- if (op0)
- return ReplaceInstUsesWith(EI, op0);
- }
-
- // If extracting a specified index from the vector, see if we can recursively
- // find a previously computed scalar that was inserted into the vector.
- if (ConstantInt *IdxC = dyn_cast<ConstantInt>(EI.getOperand(1))) {
- unsigned IndexVal = IdxC->getZExtValue();
- unsigned VectorWidth =
- cast<VectorType>(EI.getOperand(0)->getType())->getNumElements();
-
- // If this is extracting an invalid index, turn this into undef, to avoid
- // crashing the code below.
- if (IndexVal >= VectorWidth)
- return ReplaceInstUsesWith(EI, UndefValue::get(EI.getType()));
-
- // This instruction only demands the single element from the input vector.
- // If the input vector has a single use, simplify it based on this use
- // property.
- if (EI.getOperand(0)->hasOneUse() && VectorWidth != 1) {
- uint64_t UndefElts;
- if (Value *V = SimplifyDemandedVectorElts(EI.getOperand(0),
- 1 << IndexVal,
- UndefElts)) {
- EI.setOperand(0, V);
- return &EI;
- }
- }
-
- if (Value *Elt = FindScalarElement(EI.getOperand(0), IndexVal))
- return ReplaceInstUsesWith(EI, Elt);
-
- // If the this extractelement is directly using a bitcast from a vector of
- // the same number of elements, see if we can find the source element from
- // it. In this case, we will end up needing to bitcast the scalars.
- if (BitCastInst *BCI = dyn_cast<BitCastInst>(EI.getOperand(0))) {
- if (const VectorType *VT =
- dyn_cast<VectorType>(BCI->getOperand(0)->getType()))
- if (VT->getNumElements() == VectorWidth)
- if (Value *Elt = FindScalarElement(BCI->getOperand(0), IndexVal))
- return new BitCastInst(Elt, EI.getType());
- }
- }
-
- if (Instruction *I = dyn_cast<Instruction>(EI.getOperand(0))) {
- if (I->hasOneUse()) {
- // Push extractelement into predecessor operation if legal and
- // profitable to do so
- if (BinaryOperator *BO = dyn_cast<BinaryOperator>(I)) {
- bool isConstantElt = isa<ConstantInt>(EI.getOperand(1));
- if (CheapToScalarize(BO, isConstantElt)) {
- ExtractElementInst *newEI0 =
- new ExtractElementInst(BO->getOperand(0), EI.getOperand(1),
- EI.getName()+".lhs");
- ExtractElementInst *newEI1 =
- new ExtractElementInst(BO->getOperand(1), EI.getOperand(1),
- EI.getName()+".rhs");
- InsertNewInstBefore(newEI0, EI);
- InsertNewInstBefore(newEI1, EI);
- return BinaryOperator::create(BO->getOpcode(), newEI0, newEI1);
- }
- } else if (isa<LoadInst>(I)) {
- unsigned AS =
- cast<PointerType>(I->getOperand(0)->getType())->getAddressSpace();
- Value *Ptr = InsertBitCastBefore(I->getOperand(0),
- PointerType::get(EI.getType(), AS),EI);
- GetElementPtrInst *GEP =
- GetElementPtrInst::Create(Ptr, EI.getOperand(1), I->getName() + ".gep");
- InsertNewInstBefore(GEP, EI);
- return new LoadInst(GEP);
- }
- }
- if (InsertElementInst *IE = dyn_cast<InsertElementInst>(I)) {
- // Extracting the inserted element?
- if (IE->getOperand(2) == EI.getOperand(1))
- return ReplaceInstUsesWith(EI, IE->getOperand(1));
- // If the inserted and extracted elements are constants, they must not
- // be the same value, extract from the pre-inserted value instead.
- if (isa<Constant>(IE->getOperand(2)) &&
- isa<Constant>(EI.getOperand(1))) {
- AddUsesToWorkList(EI);
- EI.setOperand(0, IE->getOperand(0));
- return &EI;
- }
- } else if (ShuffleVectorInst *SVI = dyn_cast<ShuffleVectorInst>(I)) {
- // If this is extracting an element from a shufflevector, figure out where
- // it came from and extract from the appropriate input element instead.
- if (ConstantInt *Elt = dyn_cast<ConstantInt>(EI.getOperand(1))) {
- unsigned SrcIdx = getShuffleMask(SVI)[Elt->getZExtValue()];
- Value *Src;
- if (SrcIdx < SVI->getType()->getNumElements())
- Src = SVI->getOperand(0);
- else if (SrcIdx < SVI->getType()->getNumElements()*2) {
- SrcIdx -= SVI->getType()->getNumElements();
- Src = SVI->getOperand(1);
- } else {
- return ReplaceInstUsesWith(EI, UndefValue::get(EI.getType()));
- }
- return new ExtractElementInst(Src, SrcIdx);
- }
- }
- }
- return 0;
-}
-
-/// CollectSingleShuffleElements - If V is a shuffle of values that ONLY returns
-/// elements from either LHS or RHS, return the shuffle mask and true.
-/// Otherwise, return false.
-static bool CollectSingleShuffleElements(Value *V, Value *LHS, Value *RHS,
- std::vector<Constant*> &Mask) {
- assert(V->getType() == LHS->getType() && V->getType() == RHS->getType() &&
- "Invalid CollectSingleShuffleElements");
- unsigned NumElts = cast<VectorType>(V->getType())->getNumElements();
-
- if (isa<UndefValue>(V)) {
- Mask.assign(NumElts, UndefValue::get(Type::Int32Ty));
- return true;
- } else if (V == LHS) {
- for (unsigned i = 0; i != NumElts; ++i)
- Mask.push_back(ConstantInt::get(Type::Int32Ty, i));
- return true;
- } else if (V == RHS) {
- for (unsigned i = 0; i != NumElts; ++i)
- Mask.push_back(ConstantInt::get(Type::Int32Ty, i+NumElts));
- return true;
- } else if (InsertElementInst *IEI = dyn_cast<InsertElementInst>(V)) {
- // If this is an insert of an extract from some other vector, include it.
- Value *VecOp = IEI->getOperand(0);
- Value *ScalarOp = IEI->getOperand(1);
- Value *IdxOp = IEI->getOperand(2);
-
- if (!isa<ConstantInt>(IdxOp))
- return false;
- unsigned InsertedIdx = cast<ConstantInt>(IdxOp)->getZExtValue();
-
- if (isa<UndefValue>(ScalarOp)) { // inserting undef into vector.
- // Okay, we can handle this if the vector we are insertinting into is
- // transitively ok.
- if (CollectSingleShuffleElements(VecOp, LHS, RHS, Mask)) {
- // If so, update the mask to reflect the inserted undef.
- Mask[InsertedIdx] = UndefValue::get(Type::Int32Ty);
- return true;
- }
- } else if (ExtractElementInst *EI = dyn_cast<ExtractElementInst>(ScalarOp)){
- if (isa<ConstantInt>(EI->getOperand(1)) &&
- EI->getOperand(0)->getType() == V->getType()) {
- unsigned ExtractedIdx =
- cast<ConstantInt>(EI->getOperand(1))->getZExtValue();
-
- // This must be extracting from either LHS or RHS.
- if (EI->getOperand(0) == LHS || EI->getOperand(0) == RHS) {
- // Okay, we can handle this if the vector we are insertinting into is
- // transitively ok.
- if (CollectSingleShuffleElements(VecOp, LHS, RHS, Mask)) {
- // If so, update the mask to reflect the inserted value.
- if (EI->getOperand(0) == LHS) {
- Mask[InsertedIdx & (NumElts-1)] =
- ConstantInt::get(Type::Int32Ty, ExtractedIdx);
- } else {
- assert(EI->getOperand(0) == RHS);
- Mask[InsertedIdx & (NumElts-1)] =
- ConstantInt::get(Type::Int32Ty, ExtractedIdx+NumElts);
-
- }
- return true;
- }
- }
- }
- }
- }
- // TODO: Handle shufflevector here!
-
- return false;
-}
-
-/// CollectShuffleElements - We are building a shuffle of V, using RHS as the
-/// RHS of the shuffle instruction, if it is not null. Return a shuffle mask
-/// that computes V and the LHS value of the shuffle.
-static Value *CollectShuffleElements(Value *V, std::vector<Constant*> &Mask,
- Value *&RHS) {
- assert(isa<VectorType>(V->getType()) &&
- (RHS == 0 || V->getType() == RHS->getType()) &&
- "Invalid shuffle!");
- unsigned NumElts = cast<VectorType>(V->getType())->getNumElements();
-
- if (isa<UndefValue>(V)) {
- Mask.assign(NumElts, UndefValue::get(Type::Int32Ty));
- return V;
- } else if (isa<ConstantAggregateZero>(V)) {
- Mask.assign(NumElts, ConstantInt::get(Type::Int32Ty, 0));
- return V;
- } else if (InsertElementInst *IEI = dyn_cast<InsertElementInst>(V)) {
- // If this is an insert of an extract from some other vector, include it.
- Value *VecOp = IEI->getOperand(0);
- Value *ScalarOp = IEI->getOperand(1);
- Value *IdxOp = IEI->getOperand(2);
-
- if (ExtractElementInst *EI = dyn_cast<ExtractElementInst>(ScalarOp)) {
- if (isa<ConstantInt>(EI->getOperand(1)) && isa<ConstantInt>(IdxOp) &&
- EI->getOperand(0)->getType() == V->getType()) {
- unsigned ExtractedIdx =
- cast<ConstantInt>(EI->getOperand(1))->getZExtValue();
- unsigned InsertedIdx = cast<ConstantInt>(IdxOp)->getZExtValue();
-
- // Either the extracted from or inserted into vector must be RHSVec,
- // otherwise we'd end up with a shuffle of three inputs.
- if (EI->getOperand(0) == RHS || RHS == 0) {
- RHS = EI->getOperand(0);
- Value *V = CollectShuffleElements(VecOp, Mask, RHS);
- Mask[InsertedIdx & (NumElts-1)] =
- ConstantInt::get(Type::Int32Ty, NumElts+ExtractedIdx);
- return V;
- }
-
- if (VecOp == RHS) {
- Value *V = CollectShuffleElements(EI->getOperand(0), Mask, RHS);
- // Everything but the extracted element is replaced with the RHS.
- for (unsigned i = 0; i != NumElts; ++i) {
- if (i != InsertedIdx)
- Mask[i] = ConstantInt::get(Type::Int32Ty, NumElts+i);
- }
- return V;
- }
-
- // If this insertelement is a chain that comes from exactly these two
- // vectors, return the vector and the effective shuffle.
- if (CollectSingleShuffleElements(IEI, EI->getOperand(0), RHS, Mask))
- return EI->getOperand(0);
-
- }
- }
- }
- // TODO: Handle shufflevector here!
-
- // Otherwise, can't do anything fancy. Return an identity vector.
- for (unsigned i = 0; i != NumElts; ++i)
- Mask.push_back(ConstantInt::get(Type::Int32Ty, i));
- return V;
-}
-
-Instruction *InstCombiner::visitInsertElementInst(InsertElementInst &IE) {
- Value *VecOp = IE.getOperand(0);
- Value *ScalarOp = IE.getOperand(1);
- Value *IdxOp = IE.getOperand(2);
-
- // Inserting an undef or into an undefined place, remove this.
- if (isa<UndefValue>(ScalarOp) || isa<UndefValue>(IdxOp))
- ReplaceInstUsesWith(IE, VecOp);
-
- // If the inserted element was extracted from some other vector, and if the
- // indexes are constant, try to turn this into a shufflevector operation.
- if (ExtractElementInst *EI = dyn_cast<ExtractElementInst>(ScalarOp)) {
- if (isa<ConstantInt>(EI->getOperand(1)) && isa<ConstantInt>(IdxOp) &&
- EI->getOperand(0)->getType() == IE.getType()) {
- unsigned NumVectorElts = IE.getType()->getNumElements();
- unsigned ExtractedIdx =
- cast<ConstantInt>(EI->getOperand(1))->getZExtValue();
- unsigned InsertedIdx = cast<ConstantInt>(IdxOp)->getZExtValue();
-
- if (ExtractedIdx >= NumVectorElts) // Out of range extract.
- return ReplaceInstUsesWith(IE, VecOp);
-
- if (InsertedIdx >= NumVectorElts) // Out of range insert.
- return ReplaceInstUsesWith(IE, UndefValue::get(IE.getType()));
-
- // If we are extracting a value from a vector, then inserting it right
- // back into the same place, just use the input vector.
- if (EI->getOperand(0) == VecOp && ExtractedIdx == InsertedIdx)
- return ReplaceInstUsesWith(IE, VecOp);
-
- // We could theoretically do this for ANY input. However, doing so could
- // turn chains of insertelement instructions into a chain of shufflevector
- // instructions, and right now we do not merge shufflevectors. As such,
- // only do this in a situation where it is clear that there is benefit.
- if (isa<UndefValue>(VecOp) || isa<ConstantAggregateZero>(VecOp)) {
- // Turn this into shuffle(EIOp0, VecOp, Mask). The result has all of
- // the values of VecOp, except then one read from EIOp0.
- // Build a new shuffle mask.
- std::vector<Constant*> Mask;
- if (isa<UndefValue>(VecOp))
- Mask.assign(NumVectorElts, UndefValue::get(Type::Int32Ty));
- else {
- assert(isa<ConstantAggregateZero>(VecOp) && "Unknown thing");
- Mask.assign(NumVectorElts, ConstantInt::get(Type::Int32Ty,
- NumVectorElts));
- }
- Mask[InsertedIdx] = ConstantInt::get(Type::Int32Ty, ExtractedIdx);
- return new ShuffleVectorInst(EI->getOperand(0), VecOp,
- ConstantVector::get(Mask));
- }
-
- // If this insertelement isn't used by some other insertelement, turn it
- // (and any insertelements it points to), into one big shuffle.
- if (!IE.hasOneUse() || !isa<InsertElementInst>(IE.use_back())) {
- std::vector<Constant*> Mask;
- Value *RHS = 0;
- Value *LHS = CollectShuffleElements(&IE, Mask, RHS);
- if (RHS == 0) RHS = UndefValue::get(LHS->getType());
- // We now have a shuffle of LHS, RHS, Mask.
- return new ShuffleVectorInst(LHS, RHS, ConstantVector::get(Mask));
- }
- }
- }
-
- return 0;
-}
-
-
-Instruction *InstCombiner::visitShuffleVectorInst(ShuffleVectorInst &SVI) {
- Value *LHS = SVI.getOperand(0);
- Value *RHS = SVI.getOperand(1);
- std::vector<unsigned> Mask = getShuffleMask(&SVI);
-
- bool MadeChange = false;
-
- // Undefined shuffle mask -> undefined value.
- if (isa<UndefValue>(SVI.getOperand(2)))
- return ReplaceInstUsesWith(SVI, UndefValue::get(SVI.getType()));
-
- // If we have shuffle(x, undef, mask) and any elements of mask refer to
- // the undef, change them to undefs.
- if (isa<UndefValue>(SVI.getOperand(1))) {
- // Scan to see if there are any references to the RHS. If so, replace them
- // with undef element refs and set MadeChange to true.
- for (unsigned i = 0, e = Mask.size(); i != e; ++i) {
- if (Mask[i] >= e && Mask[i] != 2*e) {
- Mask[i] = 2*e;
- MadeChange = true;
- }
- }
-
- if (MadeChange) {
- // Remap any references to RHS to use LHS.
- std::vector<Constant*> Elts;
- for (unsigned i = 0, e = Mask.size(); i != e; ++i) {
- if (Mask[i] == 2*e)
- Elts.push_back(UndefValue::get(Type::Int32Ty));
- else
- Elts.push_back(ConstantInt::get(Type::Int32Ty, Mask[i]));
- }
- SVI.setOperand(2, ConstantVector::get(Elts));
- }
- }
-
- // Canonicalize shuffle(x ,x,mask) -> shuffle(x, undef,mask')
- // Canonicalize shuffle(undef,x,mask) -> shuffle(x, undef,mask').
- if (LHS == RHS || isa<UndefValue>(LHS)) {
- if (isa<UndefValue>(LHS) && LHS == RHS) {
- // shuffle(undef,undef,mask) -> undef.
- return ReplaceInstUsesWith(SVI, LHS);
- }
-
- // Remap any references to RHS to use LHS.
- std::vector<Constant*> Elts;
- for (unsigned i = 0, e = Mask.size(); i != e; ++i) {
- if (Mask[i] >= 2*e)
- Elts.push_back(UndefValue::get(Type::Int32Ty));
- else {
- if ((Mask[i] >= e && isa<UndefValue>(RHS)) ||
- (Mask[i] < e && isa<UndefValue>(LHS)))
- Mask[i] = 2*e; // Turn into undef.
- else
- Mask[i] &= (e-1); // Force to LHS.
- Elts.push_back(ConstantInt::get(Type::Int32Ty, Mask[i]));
- }
- }
- SVI.setOperand(0, SVI.getOperand(1));
- SVI.setOperand(1, UndefValue::get(RHS->getType()));
- SVI.setOperand(2, ConstantVector::get(Elts));
- LHS = SVI.getOperand(0);
- RHS = SVI.getOperand(1);
- MadeChange = true;
- }
-
- // Analyze the shuffle, are the LHS or RHS and identity shuffles?
- bool isLHSID = true, isRHSID = true;
-
- for (unsigned i = 0, e = Mask.size(); i != e; ++i) {
- if (Mask[i] >= e*2) continue; // Ignore undef values.
- // Is this an identity shuffle of the LHS value?
- isLHSID &= (Mask[i] == i);
-
- // Is this an identity shuffle of the RHS value?
- isRHSID &= (Mask[i]-e == i);
- }
-
- // Eliminate identity shuffles.
- if (isLHSID) return ReplaceInstUsesWith(SVI, LHS);
- if (isRHSID) return ReplaceInstUsesWith(SVI, RHS);
-
- // If the LHS is a shufflevector itself, see if we can combine it with this
- // one without producing an unusual shuffle. Here we are really conservative:
- // we are absolutely afraid of producing a shuffle mask not in the input
- // program, because the code gen may not be smart enough to turn a merged
- // shuffle into two specific shuffles: it may produce worse code. As such,
- // we only merge two shuffles if the result is one of the two input shuffle
- // masks. In this case, merging the shuffles just removes one instruction,
- // which we know is safe. This is good for things like turning:
- // (splat(splat)) -> splat.
- if (ShuffleVectorInst *LHSSVI = dyn_cast<ShuffleVectorInst>(LHS)) {
- if (isa<UndefValue>(RHS)) {
- std::vector<unsigned> LHSMask = getShuffleMask(LHSSVI);
-
- std::vector<unsigned> NewMask;
- for (unsigned i = 0, e = Mask.size(); i != e; ++i)
- if (Mask[i] >= 2*e)
- NewMask.push_back(2*e);
- else
- NewMask.push_back(LHSMask[Mask[i]]);
-
- // If the result mask is equal to the src shuffle or this shuffle mask, do
- // the replacement.
- if (NewMask == LHSMask || NewMask == Mask) {
- std::vector<Constant*> Elts;
- for (unsigned i = 0, e = NewMask.size(); i != e; ++i) {
- if (NewMask[i] >= e*2) {
- Elts.push_back(UndefValue::get(Type::Int32Ty));
- } else {
- Elts.push_back(ConstantInt::get(Type::Int32Ty, NewMask[i]));
- }
- }
- return new ShuffleVectorInst(LHSSVI->getOperand(0),
- LHSSVI->getOperand(1),
- ConstantVector::get(Elts));
- }
- }
- }
-
- return MadeChange ? &SVI : 0;
-}
-
-
-
-
-/// TryToSinkInstruction - Try to move the specified instruction from its
-/// current block into the beginning of DestBlock, which can only happen if it's
-/// safe to move the instruction past all of the instructions between it and the
-/// end of its block.
-static bool TryToSinkInstruction(Instruction *I, BasicBlock *DestBlock) {
- assert(I->hasOneUse() && "Invariants didn't hold!");
-
- // Cannot move control-flow-involving, volatile loads, vaarg, etc.
- if (isa<PHINode>(I) || I->mayWriteToMemory() || isa<TerminatorInst>(I))
- return false;
-
- // Do not sink alloca instructions out of the entry block.
- if (isa<AllocaInst>(I) && I->getParent() ==
- &DestBlock->getParent()->getEntryBlock())
- return false;
-
- // We can only sink load instructions if there is nothing between the load and
- // the end of block that could change the value.
- if (I->mayReadFromMemory()) {
- for (BasicBlock::iterator Scan = I, E = I->getParent()->end();
- Scan != E; ++Scan)
- if (Scan->mayWriteToMemory())
- return false;
- }
-
- BasicBlock::iterator InsertPos = DestBlock->begin();
- while (isa<PHINode>(InsertPos)) ++InsertPos;
-
- I->moveBefore(InsertPos);
- ++NumSunkInst;
- return true;
-}
-
-
-/// AddReachableCodeToWorklist - Walk the function in depth-first order, adding
-/// all reachable code to the worklist.
-///
-/// This has a couple of tricks to make the code faster and more powerful. In
-/// particular, we constant fold and DCE instructions as we go, to avoid adding
-/// them to the worklist (this significantly speeds up instcombine on code where
-/// many instructions are dead or constant). Additionally, if we find a branch
-/// whose condition is a known constant, we only visit the reachable successors.
-///
-static void AddReachableCodeToWorklist(BasicBlock *BB,
- SmallPtrSet<BasicBlock*, 64> &Visited,
- InstCombiner &IC,
- const TargetData *TD) {
- std::vector<BasicBlock*> Worklist;
- Worklist.push_back(BB);
-
- while (!Worklist.empty()) {
- BB = Worklist.back();
- Worklist.pop_back();
-
- // We have now visited this block! If we've already been here, ignore it.
- if (!Visited.insert(BB)) continue;
-
- for (BasicBlock::iterator BBI = BB->begin(), E = BB->end(); BBI != E; ) {
- Instruction *Inst = BBI++;
-
- // DCE instruction if trivially dead.
- if (isInstructionTriviallyDead(Inst)) {
- ++NumDeadInst;
- DOUT << "IC: DCE: " << *Inst;
- Inst->eraseFromParent();
- continue;
- }
-
- // ConstantProp instruction if trivially constant.
- if (Constant *C = ConstantFoldInstruction(Inst, TD)) {
- DOUT << "IC: ConstFold to: " << *C << " from: " << *Inst;
- Inst->replaceAllUsesWith(C);
- ++NumConstProp;
- Inst->eraseFromParent();
- continue;
- }
-
- IC.AddToWorkList(Inst);
- }
-
- // Recursively visit successors. If this is a branch or switch on a
- // constant, only visit the reachable successor.
- TerminatorInst *TI = BB->getTerminator();
- if (BranchInst *BI = dyn_cast<BranchInst>(TI)) {
- if (BI->isConditional() && isa<ConstantInt>(BI->getCondition())) {
- bool CondVal = cast<ConstantInt>(BI->getCondition())->getZExtValue();
- BasicBlock *ReachableBB = BI->getSuccessor(!CondVal);
- Worklist.push_back(ReachableBB);
- continue;
- }
- } else if (SwitchInst *SI = dyn_cast<SwitchInst>(TI)) {
- if (ConstantInt *Cond = dyn_cast<ConstantInt>(SI->getCondition())) {
- // See if this is an explicit destination.
- for (unsigned i = 1, e = SI->getNumSuccessors(); i != e; ++i)
- if (SI->getCaseValue(i) == Cond) {
- BasicBlock *ReachableBB = SI->getSuccessor(i);
- Worklist.push_back(ReachableBB);
- continue;
- }
-
- // Otherwise it is the default destination.
- Worklist.push_back(SI->getSuccessor(0));
- continue;
- }
- }
-
- for (unsigned i = 0, e = TI->getNumSuccessors(); i != e; ++i)
- Worklist.push_back(TI->getSuccessor(i));
- }
-}
-
-bool InstCombiner::DoOneIteration(Function &F, unsigned Iteration) {
- bool Changed = false;
- TD = &getAnalysis<TargetData>();
-
- DEBUG(DOUT << "\n\nINSTCOMBINE ITERATION #" << Iteration << " on "
- << F.getNameStr() << "\n");
-
- {
- // Do a depth-first traversal of the function, populate the worklist with
- // the reachable instructions. Ignore blocks that are not reachable. Keep
- // track of which blocks we visit.
- SmallPtrSet<BasicBlock*, 64> Visited;
- AddReachableCodeToWorklist(F.begin(), Visited, *this, TD);
-
- // Do a quick scan over the function. If we find any blocks that are
- // unreachable, remove any instructions inside of them. This prevents
- // the instcombine code from having to deal with some bad special cases.
- for (Function::iterator BB = F.begin(), E = F.end(); BB != E; ++BB)
- if (!Visited.count(BB)) {
- Instruction *Term = BB->getTerminator();
- while (Term != BB->begin()) { // Remove instrs bottom-up
- BasicBlock::iterator I = Term; --I;
-
- DOUT << "IC: DCE: " << *I;
- ++NumDeadInst;
-
- if (!I->use_empty())
- I->replaceAllUsesWith(UndefValue::get(I->getType()));
- I->eraseFromParent();
- }
- }
- }
-
- while (!Worklist.empty()) {
- Instruction *I = RemoveOneFromWorkList();
- if (I == 0) continue; // skip null values.
-
- // Check to see if we can DCE the instruction.
- if (isInstructionTriviallyDead(I)) {
- // Add operands to the worklist.
- if (I->getNumOperands() < 4)
- AddUsesToWorkList(*I);
- ++NumDeadInst;
-
- DOUT << "IC: DCE: " << *I;
-
- I->eraseFromParent();
- RemoveFromWorkList(I);
- continue;
- }
-
- // Instruction isn't dead, see if we can constant propagate it.
- if (Constant *C = ConstantFoldInstruction(I, TD)) {
- DOUT << "IC: ConstFold to: " << *C << " from: " << *I;
-
- // Add operands to the worklist.
- AddUsesToWorkList(*I);
- ReplaceInstUsesWith(*I, C);
-
- ++NumConstProp;
- I->eraseFromParent();
- RemoveFromWorkList(I);
- continue;
- }
-
- // See if we can trivially sink this instruction to a successor basic block.
- // FIXME: Remove GetResultInst test when first class support for aggregates
- // is implemented.
- if (I->hasOneUse() && !isa<GetResultInst>(I)) {
- BasicBlock *BB = I->getParent();
- BasicBlock *UserParent = cast<Instruction>(I->use_back())->getParent();
- if (UserParent != BB) {
- bool UserIsSuccessor = false;
- // See if the user is one of our successors.
- for (succ_iterator SI = succ_begin(BB), E = succ_end(BB); SI != E; ++SI)
- if (*SI == UserParent) {
- UserIsSuccessor = true;
- break;
- }
-
- // If the user is one of our immediate successors, and if that successor
- // only has us as a predecessors (we'd have to split the critical edge
- // otherwise), we can keep going.
- if (UserIsSuccessor && !isa<PHINode>(I->use_back()) &&
- next(pred_begin(UserParent)) == pred_end(UserParent))
- // Okay, the CFG is simple enough, try to sink this instruction.
- Changed |= TryToSinkInstruction(I, UserParent);
- }
- }
-
- // Now that we have an instruction, try combining it to simplify it...
-#ifndef NDEBUG
- std::string OrigI;
-#endif
- DEBUG(std::ostringstream SS; I->print(SS); OrigI = SS.str(););
- if (Instruction *Result = visit(*I)) {
- ++NumCombined;
- // Should we replace the old instruction with a new one?
- if (Result != I) {
- DOUT << "IC: Old = " << *I
- << " New = " << *Result;
-
- // Everything uses the new instruction now.
- I->replaceAllUsesWith(Result);
-
- // Push the new instruction and any users onto the worklist.
- AddToWorkList(Result);
- AddUsersToWorkList(*Result);
-
- // Move the name to the new instruction first.
- Result->takeName(I);
-
- // Insert the new instruction into the basic block...
- BasicBlock *InstParent = I->getParent();
- BasicBlock::iterator InsertPos = I;
-
- if (!isa<PHINode>(Result)) // If combining a PHI, don't insert
- while (isa<PHINode>(InsertPos)) // middle of a block of PHIs.
- ++InsertPos;
-
- InstParent->getInstList().insert(InsertPos, Result);
-
- // Make sure that we reprocess all operands now that we reduced their
- // use counts.
- AddUsesToWorkList(*I);
-
- // Instructions can end up on the worklist more than once. Make sure
- // we do not process an instruction that has been deleted.
- RemoveFromWorkList(I);
-
- // Erase the old instruction.
- InstParent->getInstList().erase(I);
- } else {
-#ifndef NDEBUG
- DOUT << "IC: Mod = " << OrigI
- << " New = " << *I;
-#endif
-
- // If the instruction was modified, it's possible that it is now dead.
- // if so, remove it.
- if (isInstructionTriviallyDead(I)) {
- // Make sure we process all operands now that we are reducing their
- // use counts.
- AddUsesToWorkList(*I);
-
- // Instructions may end up in the worklist more than once. Erase all
- // occurrences of this instruction.
- RemoveFromWorkList(I);
- I->eraseFromParent();
- } else {
- AddToWorkList(I);
- AddUsersToWorkList(*I);
- }
- }
- Changed = true;
- }
- }
-
- assert(WorklistMap.empty() && "Worklist empty, but map not?");
-
- // Do an explicit clear, this shrinks the map if needed.
- WorklistMap.clear();
- return Changed;
-}
-
-
-bool InstCombiner::runOnFunction(Function &F) {
- MustPreserveLCSSA = mustPreserveAnalysisID(LCSSAID);
-
- bool EverMadeChange = false;
-
- // Iterate while there is work to do.
- unsigned Iteration = 0;
- while (DoOneIteration(F, Iteration++))
- EverMadeChange = true;
- return EverMadeChange;
-}
-
-FunctionPass *llvm::createInstructionCombiningPass() {
- return new InstCombiner();
-}
-
diff --git a/release_23/lib/Transforms/Scalar/JumpThreading.cpp b/release_23/lib/Transforms/Scalar/JumpThreading.cpp
deleted file mode 100644
index 991b11110b41..000000000000
--- a/release_23/lib/Transforms/Scalar/JumpThreading.cpp
+++ /dev/null
@@ -1,514 +0,0 @@
-//===- JumpThreading.cpp - Thread control through conditional blocks ------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the Jump Threading pass.
-//
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "jump-threading"
-#include "llvm/Transforms/Scalar.h"
-#include "llvm/IntrinsicInst.h"
-#include "llvm/Pass.h"
-#include "llvm/ADT/DenseMap.h"
-#include "llvm/ADT/Statistic.h"
-#include "llvm/Transforms/Utils/BasicBlockUtils.h"
-#include "llvm/Transforms/Utils/Local.h"
-#include "llvm/Support/CommandLine.h"
-#include "llvm/Support/Compiler.h"
-#include "llvm/Support/Debug.h"
-using namespace llvm;
-
-STATISTIC(NumThreads, "Number of jumps threaded");
-STATISTIC(NumFolds, "Number of terminators folded");
-
-static cl::opt<unsigned>
-Threshold("jump-threading-threshold",
- cl::desc("Max block size to duplicate for jump threading"),
- cl::init(6), cl::Hidden);
-
-namespace {
- /// This pass performs 'jump threading', which looks at blocks that have
- /// multiple predecessors and multiple successors. If one or more of the
- /// predecessors of the block can be proven to always jump to one of the
- /// successors, we forward the edge from the predecessor to the successor by
- /// duplicating the contents of this block.
- ///
- /// An example of when this can occur is code like this:
- ///
- /// if () { ...
- /// X = 4;
- /// }
- /// if (X < 3) {
- ///
- /// In this case, the unconditional branch at the end of the first if can be
- /// revectored to the false side of the second if.
- ///
- class VISIBILITY_HIDDEN JumpThreading : public FunctionPass {
- public:
- static char ID; // Pass identification
- JumpThreading() : FunctionPass((intptr_t)&ID) {}
-
- bool runOnFunction(Function &F);
- bool ThreadBlock(BasicBlock *BB);
- void ThreadEdge(BasicBlock *BB, BasicBlock *PredBB, BasicBlock *SuccBB);
- BasicBlock *FactorCommonPHIPreds(PHINode *PN, Constant *CstVal);
-
- bool ProcessJumpOnPHI(PHINode *PN);
- bool ProcessBranchOnLogical(Value *V, BasicBlock *BB, bool isAnd);
- bool ProcessBranchOnCompare(CmpInst *Cmp, BasicBlock *BB);
- };
- char JumpThreading::ID = 0;
- RegisterPass<JumpThreading> X("jump-threading", "Jump Threading");
-}
-
-// Public interface to the Jump Threading pass
-FunctionPass *llvm::createJumpThreadingPass() { return new JumpThreading(); }
-
-/// runOnFunction - Top level algorithm.
-///
-bool JumpThreading::runOnFunction(Function &F) {
- DOUT << "Jump threading on function '" << F.getNameStart() << "'\n";
-
- bool AnotherIteration = true, EverChanged = false;
- while (AnotherIteration) {
- AnotherIteration = false;
- bool Changed = false;
- for (Function::iterator I = F.begin(), E = F.end(); I != E; ++I)
- while (ThreadBlock(I))
- Changed = true;
- AnotherIteration = Changed;
- EverChanged |= Changed;
- }
- return EverChanged;
-}
-
-/// FactorCommonPHIPreds - If there are multiple preds with the same incoming
-/// value for the PHI, factor them together so we get one block to thread for
-/// the whole group.
-/// This is important for things like "phi i1 [true, true, false, true, x]"
-/// where we only need to clone the block for the true blocks once.
-///
-BasicBlock *JumpThreading::FactorCommonPHIPreds(PHINode *PN, Constant *CstVal) {
- SmallVector<BasicBlock*, 16> CommonPreds;
- for (unsigned i = 0, e = PN->getNumIncomingValues(); i != e; ++i)
- if (PN->getIncomingValue(i) == CstVal)
- CommonPreds.push_back(PN->getIncomingBlock(i));
-
- if (CommonPreds.size() == 1)
- return CommonPreds[0];
-
- DOUT << " Factoring out " << CommonPreds.size()
- << " common predecessors.\n";
- return SplitBlockPredecessors(PN->getParent(),
- &CommonPreds[0], CommonPreds.size(),
- ".thr_comm", this);
-}
-
-
-/// getJumpThreadDuplicationCost - Return the cost of duplicating this block to
-/// thread across it.
-static unsigned getJumpThreadDuplicationCost(const BasicBlock *BB) {
- BasicBlock::const_iterator I = BB->begin();
- /// Ignore PHI nodes, these will be flattened when duplication happens.
- while (isa<PHINode>(*I)) ++I;
-
- // Sum up the cost of each instruction until we get to the terminator. Don't
- // include the terminator because the copy won't include it.
- unsigned Size = 0;
- for (; !isa<TerminatorInst>(I); ++I) {
- // Debugger intrinsics don't incur code size.
- if (isa<DbgInfoIntrinsic>(I)) continue;
-
- // If this is a pointer->pointer bitcast, it is free.
- if (isa<BitCastInst>(I) && isa<PointerType>(I->getType()))
- continue;
-
- // All other instructions count for at least one unit.
- ++Size;
-
- // Calls are more expensive. If they are non-intrinsic calls, we model them
- // as having cost of 4. If they are a non-vector intrinsic, we model them
- // as having cost of 2 total, and if they are a vector intrinsic, we model
- // them as having cost 1.
- if (const CallInst *CI = dyn_cast<CallInst>(I)) {
- if (!isa<IntrinsicInst>(CI))
- Size += 3;
- else if (isa<VectorType>(CI->getType()))
- Size += 1;
- }
- }
-
- // Threading through a switch statement is particularly profitable. If this
- // block ends in a switch, decrease its cost to make it more likely to happen.
- if (isa<SwitchInst>(I))
- Size = Size > 6 ? Size-6 : 0;
-
- return Size;
-}
-
-
-/// ThreadBlock - If there are any predecessors whose control can be threaded
-/// through to a successor, transform them now.
-bool JumpThreading::ThreadBlock(BasicBlock *BB) {
- // See if this block ends with a branch of switch. If so, see if the
- // condition is a phi node. If so, and if an entry of the phi node is a
- // constant, we can thread the block.
- Value *Condition;
- if (BranchInst *BI = dyn_cast<BranchInst>(BB->getTerminator())) {
- // Can't thread an unconditional jump.
- if (BI->isUnconditional()) return false;
- Condition = BI->getCondition();
- } else if (SwitchInst *SI = dyn_cast<SwitchInst>(BB->getTerminator()))
- Condition = SI->getCondition();
- else
- return false; // Must be an invoke.
-
- // If the terminator of this block is branching on a constant, simplify the
- // terminator to an unconditional branch. This can occur due to threading in
- // other blocks.
- if (isa<ConstantInt>(Condition)) {
- DOUT << " In block '" << BB->getNameStart()
- << "' folding terminator: " << *BB->getTerminator();
- ++NumFolds;
- ConstantFoldTerminator(BB);
- return true;
- }
-
- // If there is only a single predecessor of this block, nothing to fold.
- if (BB->getSinglePredecessor())
- return false;
-
- // See if this is a phi node in the current block.
- PHINode *PN = dyn_cast<PHINode>(Condition);
- if (PN && PN->getParent() == BB)
- return ProcessJumpOnPHI(PN);
-
- // If this is a conditional branch whose condition is and/or of a phi, try to
- // simplify it.
- if (BinaryOperator *CondI = dyn_cast<BinaryOperator>(Condition)) {
- if ((CondI->getOpcode() == Instruction::And ||
- CondI->getOpcode() == Instruction::Or) &&
- isa<BranchInst>(BB->getTerminator()) &&
- ProcessBranchOnLogical(CondI, BB,
- CondI->getOpcode() == Instruction::And))
- return true;
- }
-
- // If we have "br (phi != 42)" and the phi node has any constant values as
- // operands, we can thread through this block.
- if (CmpInst *CondCmp = dyn_cast<CmpInst>(Condition))
- if (isa<PHINode>(CondCmp->getOperand(0)) &&
- isa<Constant>(CondCmp->getOperand(1)) &&
- ProcessBranchOnCompare(CondCmp, BB))
- return true;
-
- return false;
-}
-
-/// ProcessJumpOnPHI - We have a conditional branch of switch on a PHI node in
-/// the current block. See if there are any simplifications we can do based on
-/// inputs to the phi node.
-///
-bool JumpThreading::ProcessJumpOnPHI(PHINode *PN) {
- // See if the phi node has any constant values. If so, we can determine where
- // the corresponding predecessor will branch.
- ConstantInt *PredCst = 0;
- for (unsigned i = 0, e = PN->getNumIncomingValues(); i != e; ++i)
- if ((PredCst = dyn_cast<ConstantInt>(PN->getIncomingValue(i))))
- break;
-
- // If no incoming value has a constant, we don't know the destination of any
- // predecessors.
- if (PredCst == 0)
- return false;
-
- // See if the cost of duplicating this block is low enough.
- BasicBlock *BB = PN->getParent();
- unsigned JumpThreadCost = getJumpThreadDuplicationCost(BB);
- if (JumpThreadCost > Threshold) {
- DOUT << " Not threading BB '" << BB->getNameStart()
- << "' - Cost is too high: " << JumpThreadCost << "\n";
- return false;
- }
-
- // If so, we can actually do this threading. Merge any common predecessors
- // that will act the same.
- BasicBlock *PredBB = FactorCommonPHIPreds(PN, PredCst);
-
- // Next, figure out which successor we are threading to.
- BasicBlock *SuccBB;
- if (BranchInst *BI = dyn_cast<BranchInst>(BB->getTerminator()))
- SuccBB = BI->getSuccessor(PredCst == ConstantInt::getFalse());
- else {
- SwitchInst *SI = cast<SwitchInst>(BB->getTerminator());
- SuccBB = SI->getSuccessor(SI->findCaseValue(PredCst));
- }
-
- // If threading to the same block as we come from, we would infinite loop.
- if (SuccBB == BB) {
- DOUT << " Not threading BB '" << BB->getNameStart()
- << "' - would thread to self!\n";
- return false;
- }
-
- // And finally, do it!
- DOUT << " Threading edge from '" << PredBB->getNameStart() << "' to '"
- << SuccBB->getNameStart() << "' with cost: " << JumpThreadCost
- << ", across block:\n "
- << *BB << "\n";
-
- ThreadEdge(BB, PredBB, SuccBB);
- ++NumThreads;
- return true;
-}
-
-/// ProcessJumpOnLogicalPHI - PN's basic block contains a conditional branch
-/// whose condition is an AND/OR where one side is PN. If PN has constant
-/// operands that permit us to evaluate the condition for some operand, thread
-/// through the block. For example with:
-/// br (and X, phi(Y, Z, false))
-/// the predecessor corresponding to the 'false' will always jump to the false
-/// destination of the branch.
-///
-bool JumpThreading::ProcessBranchOnLogical(Value *V, BasicBlock *BB,
- bool isAnd) {
- // If this is a binary operator tree of the same AND/OR opcode, check the
- // LHS/RHS.
- if (BinaryOperator *BO = dyn_cast<BinaryOperator>(V))
- if (isAnd && BO->getOpcode() == Instruction::And ||
- !isAnd && BO->getOpcode() == Instruction::Or) {
- if (ProcessBranchOnLogical(BO->getOperand(0), BB, isAnd))
- return true;
- if (ProcessBranchOnLogical(BO->getOperand(1), BB, isAnd))
- return true;
- }
-
- // If this isn't a PHI node, we can't handle it.
- PHINode *PN = dyn_cast<PHINode>(V);
- if (!PN || PN->getParent() != BB) return false;
-
- // We can only do the simplification for phi nodes of 'false' with AND or
- // 'true' with OR. See if we have any entries in the phi for this.
- unsigned PredNo = ~0U;
- ConstantInt *PredCst = ConstantInt::get(Type::Int1Ty, !isAnd);
- for (unsigned i = 0, e = PN->getNumIncomingValues(); i != e; ++i) {
- if (PN->getIncomingValue(i) == PredCst) {
- PredNo = i;
- break;
- }
- }
-
- // If no match, bail out.
- if (PredNo == ~0U)
- return false;
-
- // See if the cost of duplicating this block is low enough.
- unsigned JumpThreadCost = getJumpThreadDuplicationCost(BB);
- if (JumpThreadCost > Threshold) {
- DOUT << " Not threading BB '" << BB->getNameStart()
- << "' - Cost is too high: " << JumpThreadCost << "\n";
- return false;
- }
-
- // If so, we can actually do this threading. Merge any common predecessors
- // that will act the same.
- BasicBlock *PredBB = FactorCommonPHIPreds(PN, PredCst);
-
- // Next, figure out which successor we are threading to. If this was an AND,
- // the constant must be FALSE, and we must be targeting the 'false' block.
- // If this is an OR, the constant must be TRUE, and we must be targeting the
- // 'true' block.
- BasicBlock *SuccBB = BB->getTerminator()->getSuccessor(isAnd);
-
- // If threading to the same block as we come from, we would infinite loop.
- if (SuccBB == BB) {
- DOUT << " Not threading BB '" << BB->getNameStart()
- << "' - would thread to self!\n";
- return false;
- }
-
- // And finally, do it!
- DOUT << " Threading edge through bool from '" << PredBB->getNameStart()
- << "' to '" << SuccBB->getNameStart() << "' with cost: "
- << JumpThreadCost << ", across block:\n "
- << *BB << "\n";
-
- ThreadEdge(BB, PredBB, SuccBB);
- ++NumThreads;
- return true;
-}
-
-/// ProcessBranchOnCompare - We found a branch on a comparison between a phi
-/// node and a constant. If the PHI node contains any constants as inputs, we
-/// can fold the compare for that edge and thread through it.
-bool JumpThreading::ProcessBranchOnCompare(CmpInst *Cmp, BasicBlock *BB) {
- PHINode *PN = cast<PHINode>(Cmp->getOperand(0));
- Constant *RHS = cast<Constant>(Cmp->getOperand(1));
-
- // If the phi isn't in the current block, an incoming edge to this block
- // doesn't control the destination.
- if (PN->getParent() != BB)
- return false;
-
- // We can do this simplification if any comparisons fold to true or false.
- // See if any do.
- Constant *PredCst = 0;
- bool TrueDirection = false;
- for (unsigned i = 0, e = PN->getNumIncomingValues(); i != e; ++i) {
- PredCst = dyn_cast<Constant>(PN->getIncomingValue(i));
- if (PredCst == 0) continue;
-
- Constant *Res;
- if (ICmpInst *ICI = dyn_cast<ICmpInst>(Cmp))
- Res = ConstantExpr::getICmp(ICI->getPredicate(), PredCst, RHS);
- else
- Res = ConstantExpr::getFCmp(cast<FCmpInst>(Cmp)->getPredicate(),
- PredCst, RHS);
- // If this folded to a constant expr, we can't do anything.
- if (ConstantInt *ResC = dyn_cast<ConstantInt>(Res)) {
- TrueDirection = ResC->getZExtValue();
- break;
- }
- // If this folded to undef, just go the false way.
- if (isa<UndefValue>(Res)) {
- TrueDirection = false;
- break;
- }
-
- // Otherwise, we can't fold this input.
- PredCst = 0;
- }
-
- // If no match, bail out.
- if (PredCst == 0)
- return false;
-
- // See if the cost of duplicating this block is low enough.
- unsigned JumpThreadCost = getJumpThreadDuplicationCost(BB);
- if (JumpThreadCost > Threshold) {
- DOUT << " Not threading BB '" << BB->getNameStart()
- << "' - Cost is too high: " << JumpThreadCost << "\n";
- return false;
- }
-
- // If so, we can actually do this threading. Merge any common predecessors
- // that will act the same.
- BasicBlock *PredBB = FactorCommonPHIPreds(PN, PredCst);
-
- // Next, get our successor.
- BasicBlock *SuccBB = BB->getTerminator()->getSuccessor(!TrueDirection);
-
- // If threading to the same block as we come from, we would infinite loop.
- if (SuccBB == BB) {
- DOUT << " Not threading BB '" << BB->getNameStart()
- << "' - would thread to self!\n";
- return false;
- }
-
-
- // And finally, do it!
- DOUT << " Threading edge through bool from '" << PredBB->getNameStart()
- << "' to '" << SuccBB->getNameStart() << "' with cost: "
- << JumpThreadCost << ", across block:\n "
- << *BB << "\n";
-
- ThreadEdge(BB, PredBB, SuccBB);
- ++NumThreads;
- return true;
-}
-
-
-/// ThreadEdge - We have decided that it is safe and profitable to thread an
-/// edge from PredBB to SuccBB across BB. Transform the IR to reflect this
-/// change.
-void JumpThreading::ThreadEdge(BasicBlock *BB, BasicBlock *PredBB,
- BasicBlock *SuccBB) {
-
- // Jump Threading can not update SSA properties correctly if the values
- // defined in the duplicated block are used outside of the block itself. For
- // this reason, we spill all values that are used outside of BB to the stack.
- for (BasicBlock::iterator I = BB->begin(); I != BB->end(); ++I) {
- if (!I->isUsedOutsideOfBlock(BB))
- continue;
-
- // We found a use of I outside of BB. Create a new stack slot to
- // break this inter-block usage pattern.
- if (!isa<StructType>(I->getType())) {
- DemoteRegToStack(*I);
- continue;
- }
-
- // Alternatively, I must be a call or invoke that returns multiple retvals.
- // We can't use 'DemoteRegToStack' because that will create loads and
- // stores of aggregates which is not valid yet. If I is a call, we can just
- // pull all the getresult instructions up to this block. If I is an invoke,
- // we are out of luck.
- BasicBlock::iterator IP = I; ++IP;
- for (Value::use_iterator UI = I->use_begin(), E = I->use_end();
- UI != E; ++UI)
- cast<GetResultInst>(UI)->moveBefore(IP);
- }
-
- // We are going to have to map operands from the original BB block to the new
- // copy of the block 'NewBB'. If there are PHI nodes in BB, evaluate them to
- // account for entry from PredBB.
- DenseMap<Instruction*, Value*> ValueMapping;
-
- BasicBlock *NewBB =
- BasicBlock::Create(BB->getName()+".thread", BB->getParent(), BB);
- NewBB->moveAfter(PredBB);
-
- BasicBlock::iterator BI = BB->begin();
- for (; PHINode *PN = dyn_cast<PHINode>(BI); ++BI)
- ValueMapping[PN] = PN->getIncomingValueForBlock(PredBB);
-
- // Clone the non-phi instructions of BB into NewBB, keeping track of the
- // mapping and using it to remap operands in the cloned instructions.
- for (; !isa<TerminatorInst>(BI); ++BI) {
- Instruction *New = BI->clone();
- New->setName(BI->getNameStart());
- NewBB->getInstList().push_back(New);
- ValueMapping[BI] = New;
-
- // Remap operands to patch up intra-block references.
- for (unsigned i = 0, e = New->getNumOperands(); i != e; ++i)
- if (Instruction *Inst = dyn_cast<Instruction>(New->getOperand(i)))
- if (Value *Remapped = ValueMapping[Inst])
- New->setOperand(i, Remapped);
- }
-
- // We didn't copy the terminator from BB over to NewBB, because there is now
- // an unconditional jump to SuccBB. Insert the unconditional jump.
- BranchInst::Create(SuccBB, NewBB);
-
- // Check to see if SuccBB has PHI nodes. If so, we need to add entries to the
- // PHI nodes for NewBB now.
- for (BasicBlock::iterator PNI = SuccBB->begin(); isa<PHINode>(PNI); ++PNI) {
- PHINode *PN = cast<PHINode>(PNI);
- // Ok, we have a PHI node. Figure out what the incoming value was for the
- // DestBlock.
- Value *IV = PN->getIncomingValueForBlock(BB);
-
- // Remap the value if necessary.
- if (Instruction *Inst = dyn_cast<Instruction>(IV))
- if (Value *MappedIV = ValueMapping[Inst])
- IV = MappedIV;
- PN->addIncoming(IV, NewBB);
- }
-
- // Finally, NewBB is good to go. Update the terminator of PredBB to jump to
- // NewBB instead of BB. This eliminates predecessors from BB, which requires
- // us to simplify any PHI nodes in BB.
- TerminatorInst *PredTerm = PredBB->getTerminator();
- for (unsigned i = 0, e = PredTerm->getNumSuccessors(); i != e; ++i)
- if (PredTerm->getSuccessor(i) == BB) {
- BB->removePredecessor(PredBB);
- PredTerm->setSuccessor(i, NewBB);
- }
-}
diff --git a/release_23/lib/Transforms/Scalar/LICM.cpp b/release_23/lib/Transforms/Scalar/LICM.cpp
deleted file mode 100644
index 2d535326d2a4..000000000000
--- a/release_23/lib/Transforms/Scalar/LICM.cpp
+++ /dev/null
@@ -1,876 +0,0 @@
-//===-- LICM.cpp - Loop Invariant Code Motion Pass ------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This pass performs loop invariant code motion, attempting to remove as much
-// code from the body of a loop as possible. It does this by either hoisting
-// code into the preheader block, or by sinking code to the exit blocks if it is
-// safe. This pass also promotes must-aliased memory locations in the loop to
-// live in registers, thus hoisting and sinking "invariant" loads and stores.
-//
-// This pass uses alias analysis for two purposes:
-//
-// 1. Moving loop invariant loads and calls out of loops. If we can determine
-// that a load or call inside of a loop never aliases anything stored to,
-// we can hoist it or sink it like any other instruction.
-// 2. Scalar Promotion of Memory - If there is a store instruction inside of
-// the loop, we try to move the store to happen AFTER the loop instead of
-// inside of the loop. This can only happen if a few conditions are true:
-// A. The pointer stored through is loop invariant
-// B. There are no stores or loads in the loop which _may_ alias the
-// pointer. There are no calls in the loop which mod/ref the pointer.
-// If these conditions are true, we can promote the loads and stores in the
-// loop of the pointer to use a temporary alloca'd variable. We then use
-// the mem2reg functionality to construct the appropriate SSA form for the
-// variable.
-//
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "licm"
-#include "llvm/Transforms/Scalar.h"
-#include "llvm/Constants.h"
-#include "llvm/DerivedTypes.h"
-#include "llvm/Instructions.h"
-#include "llvm/Target/TargetData.h"
-#include "llvm/Analysis/LoopInfo.h"
-#include "llvm/Analysis/LoopPass.h"
-#include "llvm/Analysis/AliasAnalysis.h"
-#include "llvm/Analysis/AliasSetTracker.h"
-#include "llvm/Analysis/Dominators.h"
-#include "llvm/Analysis/ScalarEvolution.h"
-#include "llvm/Transforms/Utils/PromoteMemToReg.h"
-#include "llvm/Support/CFG.h"
-#include "llvm/Support/Compiler.h"
-#include "llvm/Support/CommandLine.h"
-#include "llvm/Support/Debug.h"
-#include "llvm/ADT/Statistic.h"
-#include <algorithm>
-using namespace llvm;
-
-STATISTIC(NumSunk , "Number of instructions sunk out of loop");
-STATISTIC(NumHoisted , "Number of instructions hoisted out of loop");
-STATISTIC(NumMovedLoads, "Number of load insts hoisted or sunk");
-STATISTIC(NumMovedCalls, "Number of call insts hoisted or sunk");
-STATISTIC(NumPromoted , "Number of memory locations promoted to registers");
-
-namespace {
- static cl::opt<bool>
- DisablePromotion("disable-licm-promotion", cl::Hidden,
- cl::desc("Disable memory promotion in LICM pass"));
-
- struct VISIBILITY_HIDDEN LICM : public LoopPass {
- static char ID; // Pass identification, replacement for typeid
- LICM() : LoopPass((intptr_t)&ID) {}
-
- virtual bool runOnLoop(Loop *L, LPPassManager &LPM);
-
- /// This transformation requires natural loop information & requires that
- /// loop preheaders be inserted into the CFG...
- ///
- virtual void getAnalysisUsage(AnalysisUsage &AU) const {
- AU.setPreservesCFG();
- AU.addRequiredID(LoopSimplifyID);
- AU.addRequired<LoopInfo>();
- AU.addRequired<DominatorTree>();
- AU.addRequired<DominanceFrontier>(); // For scalar promotion (mem2reg)
- AU.addRequired<AliasAnalysis>();
- AU.addPreserved<ScalarEvolution>();
- AU.addPreserved<DominanceFrontier>();
- }
-
- bool doFinalization() {
- // Free the values stored in the map
- for (std::map<Loop *, AliasSetTracker *>::iterator
- I = LoopToAliasMap.begin(), E = LoopToAliasMap.end(); I != E; ++I)
- delete I->second;
-
- LoopToAliasMap.clear();
- return false;
- }
-
- private:
- // Various analyses that we use...
- AliasAnalysis *AA; // Current AliasAnalysis information
- LoopInfo *LI; // Current LoopInfo
- DominatorTree *DT; // Dominator Tree for the current Loop...
- DominanceFrontier *DF; // Current Dominance Frontier
-
- // State that is updated as we process loops
- bool Changed; // Set to true when we change anything.
- BasicBlock *Preheader; // The preheader block of the current loop...
- Loop *CurLoop; // The current loop we are working on...
- AliasSetTracker *CurAST; // AliasSet information for the current loop...
- std::map<Loop *, AliasSetTracker *> LoopToAliasMap;
-
- /// cloneBasicBlockAnalysis - Simple Analysis hook. Clone alias set info.
- void cloneBasicBlockAnalysis(BasicBlock *From, BasicBlock *To, Loop *L);
-
- /// deleteAnalysisValue - Simple Analysis hook. Delete value V from alias
- /// set.
- void deleteAnalysisValue(Value *V, Loop *L);
-
- /// SinkRegion - Walk the specified region of the CFG (defined by all blocks
- /// dominated by the specified block, and that are in the current loop) in
- /// reverse depth first order w.r.t the DominatorTree. This allows us to
- /// visit uses before definitions, allowing us to sink a loop body in one
- /// pass without iteration.
- ///
- void SinkRegion(DomTreeNode *N);
-
- /// HoistRegion - Walk the specified region of the CFG (defined by all
- /// blocks dominated by the specified block, and that are in the current
- /// loop) in depth first order w.r.t the DominatorTree. This allows us to
- /// visit definitions before uses, allowing us to hoist a loop body in one
- /// pass without iteration.
- ///
- void HoistRegion(DomTreeNode *N);
-
- /// inSubLoop - Little predicate that returns true if the specified basic
- /// block is in a subloop of the current one, not the current one itself.
- ///
- bool inSubLoop(BasicBlock *BB) {
- assert(CurLoop->contains(BB) && "Only valid if BB is IN the loop");
- for (Loop::iterator I = CurLoop->begin(), E = CurLoop->end(); I != E; ++I)
- if ((*I)->contains(BB))
- return true; // A subloop actually contains this block!
- return false;
- }
-
- /// isExitBlockDominatedByBlockInLoop - This method checks to see if the
- /// specified exit block of the loop is dominated by the specified block
- /// that is in the body of the loop. We use these constraints to
- /// dramatically limit the amount of the dominator tree that needs to be
- /// searched.
- bool isExitBlockDominatedByBlockInLoop(BasicBlock *ExitBlock,
- BasicBlock *BlockInLoop) const {
- // If the block in the loop is the loop header, it must be dominated!
- BasicBlock *LoopHeader = CurLoop->getHeader();
- if (BlockInLoop == LoopHeader)
- return true;
-
- DomTreeNode *BlockInLoopNode = DT->getNode(BlockInLoop);
- DomTreeNode *IDom = DT->getNode(ExitBlock);
-
- // Because the exit block is not in the loop, we know we have to get _at
- // least_ its immediate dominator.
- do {
- // Get next Immediate Dominator.
- IDom = IDom->getIDom();
-
- // If we have got to the header of the loop, then the instructions block
- // did not dominate the exit node, so we can't hoist it.
- if (IDom->getBlock() == LoopHeader)
- return false;
-
- } while (IDom != BlockInLoopNode);
-
- return true;
- }
-
- /// sink - When an instruction is found to only be used outside of the loop,
- /// this function moves it to the exit blocks and patches up SSA form as
- /// needed.
- ///
- void sink(Instruction &I);
-
- /// hoist - When an instruction is found to only use loop invariant operands
- /// that is safe to hoist, this instruction is called to do the dirty work.
- ///
- void hoist(Instruction &I);
-
- /// isSafeToExecuteUnconditionally - Only sink or hoist an instruction if it
- /// is not a trapping instruction or if it is a trapping instruction and is
- /// guaranteed to execute.
- ///
- bool isSafeToExecuteUnconditionally(Instruction &I);
-
- /// pointerInvalidatedByLoop - Return true if the body of this loop may
- /// store into the memory location pointed to by V.
- ///
- bool pointerInvalidatedByLoop(Value *V, unsigned Size) {
- // Check to see if any of the basic blocks in CurLoop invalidate *V.
- return CurAST->getAliasSetForPointer(V, Size).isMod();
- }
-
- bool canSinkOrHoistInst(Instruction &I);
- bool isLoopInvariantInst(Instruction &I);
- bool isNotUsedInLoop(Instruction &I);
-
- /// PromoteValuesInLoop - Look at the stores in the loop and promote as many
- /// to scalars as we can.
- ///
- void PromoteValuesInLoop();
-
- /// FindPromotableValuesInLoop - Check the current loop for stores to
- /// definite pointers, which are not loaded and stored through may aliases.
- /// If these are found, create an alloca for the value, add it to the
- /// PromotedValues list, and keep track of the mapping from value to
- /// alloca...
- ///
- void FindPromotableValuesInLoop(
- std::vector<std::pair<AllocaInst*, Value*> > &PromotedValues,
- std::map<Value*, AllocaInst*> &Val2AlMap);
- };
-
- char LICM::ID = 0;
- RegisterPass<LICM> X("licm", "Loop Invariant Code Motion");
-}
-
-LoopPass *llvm::createLICMPass() { return new LICM(); }
-
-/// Hoist expressions out of the specified loop. Note, alias info for inner
-/// loop is not preserved so it is not a good idea to run LICM multiple
-/// times on one loop.
-///
-bool LICM::runOnLoop(Loop *L, LPPassManager &LPM) {
- Changed = false;
-
- // Get our Loop and Alias Analysis information...
- LI = &getAnalysis<LoopInfo>();
- AA = &getAnalysis<AliasAnalysis>();
- DF = &getAnalysis<DominanceFrontier>();
- DT = &getAnalysis<DominatorTree>();
-
- CurAST = new AliasSetTracker(*AA);
- // Collect Alias info from subloops
- for (Loop::iterator LoopItr = L->begin(), LoopItrE = L->end();
- LoopItr != LoopItrE; ++LoopItr) {
- Loop *InnerL = *LoopItr;
- AliasSetTracker *InnerAST = LoopToAliasMap[InnerL];
- assert (InnerAST && "Where is my AST?");
-
- // What if InnerLoop was modified by other passes ?
- CurAST->add(*InnerAST);
- }
-
- CurLoop = L;
-
- // Get the preheader block to move instructions into...
- Preheader = L->getLoopPreheader();
- assert(Preheader&&"Preheader insertion pass guarantees we have a preheader!");
-
- // Loop over the body of this loop, looking for calls, invokes, and stores.
- // Because subloops have already been incorporated into AST, we skip blocks in
- // subloops.
- //
- for (std::vector<BasicBlock*>::const_iterator I = L->getBlocks().begin(),
- E = L->getBlocks().end(); I != E; ++I)
- if (LI->getLoopFor(*I) == L) // Ignore blocks in subloops...
- CurAST->add(**I); // Incorporate the specified basic block
-
- // We want to visit all of the instructions in this loop... that are not parts
- // of our subloops (they have already had their invariants hoisted out of
- // their loop, into this loop, so there is no need to process the BODIES of
- // the subloops).
- //
- // Traverse the body of the loop in depth first order on the dominator tree so
- // that we are guaranteed to see definitions before we see uses. This allows
- // us to sink instructions in one pass, without iteration. After sinking
- // instructions, we perform another pass to hoist them out of the loop.
- //
- SinkRegion(DT->getNode(L->getHeader()));
- HoistRegion(DT->getNode(L->getHeader()));
-
- // Now that all loop invariants have been removed from the loop, promote any
- // memory references to scalars that we can...
- if (!DisablePromotion)
- PromoteValuesInLoop();
-
- // Clear out loops state information for the next iteration
- CurLoop = 0;
- Preheader = 0;
-
- LoopToAliasMap[L] = CurAST;
- return Changed;
-}
-
-/// SinkRegion - Walk the specified region of the CFG (defined by all blocks
-/// dominated by the specified block, and that are in the current loop) in
-/// reverse depth first order w.r.t the DominatorTree. This allows us to visit
-/// uses before definitions, allowing us to sink a loop body in one pass without
-/// iteration.
-///
-void LICM::SinkRegion(DomTreeNode *N) {
- assert(N != 0 && "Null dominator tree node?");
- BasicBlock *BB = N->getBlock();
-
- // If this subregion is not in the top level loop at all, exit.
- if (!CurLoop->contains(BB)) return;
-
- // We are processing blocks in reverse dfo, so process children first...
- const std::vector<DomTreeNode*> &Children = N->getChildren();
- for (unsigned i = 0, e = Children.size(); i != e; ++i)
- SinkRegion(Children[i]);
-
- // Only need to process the contents of this block if it is not part of a
- // subloop (which would already have been processed).
- if (inSubLoop(BB)) return;
-
- for (BasicBlock::iterator II = BB->end(); II != BB->begin(); ) {
- Instruction &I = *--II;
-
- // Check to see if we can sink this instruction to the exit blocks
- // of the loop. We can do this if the all users of the instruction are
- // outside of the loop. In this case, it doesn't even matter if the
- // operands of the instruction are loop invariant.
- //
- if (isNotUsedInLoop(I) && canSinkOrHoistInst(I)) {
- ++II;
- sink(I);
- }
- }
-}
-
-
-/// HoistRegion - Walk the specified region of the CFG (defined by all blocks
-/// dominated by the specified block, and that are in the current loop) in depth
-/// first order w.r.t the DominatorTree. This allows us to visit definitions
-/// before uses, allowing us to hoist a loop body in one pass without iteration.
-///
-void LICM::HoistRegion(DomTreeNode *N) {
- assert(N != 0 && "Null dominator tree node?");
- BasicBlock *BB = N->getBlock();
-
- // If this subregion is not in the top level loop at all, exit.
- if (!CurLoop->contains(BB)) return;
-
- // Only need to process the contents of this block if it is not part of a
- // subloop (which would already have been processed).
- if (!inSubLoop(BB))
- for (BasicBlock::iterator II = BB->begin(), E = BB->end(); II != E; ) {
- Instruction &I = *II++;
-
- // Try hoisting the instruction out to the preheader. We can only do this
- // if all of the operands of the instruction are loop invariant and if it
- // is safe to hoist the instruction.
- //
- if (isLoopInvariantInst(I) && canSinkOrHoistInst(I) &&
- isSafeToExecuteUnconditionally(I))
- hoist(I);
- }
-
- const std::vector<DomTreeNode*> &Children = N->getChildren();
- for (unsigned i = 0, e = Children.size(); i != e; ++i)
- HoistRegion(Children[i]);
-}
-
-/// canSinkOrHoistInst - Return true if the hoister and sinker can handle this
-/// instruction.
-///
-bool LICM::canSinkOrHoistInst(Instruction &I) {
- // Loads have extra constraints we have to verify before we can hoist them.
- if (LoadInst *LI = dyn_cast<LoadInst>(&I)) {
- if (LI->isVolatile())
- return false; // Don't hoist volatile loads!
-
- // Don't hoist loads which have may-aliased stores in loop.
- unsigned Size = 0;
- if (LI->getType()->isSized())
- Size = AA->getTargetData().getTypeStoreSize(LI->getType());
- return !pointerInvalidatedByLoop(LI->getOperand(0), Size);
- } else if (CallInst *CI = dyn_cast<CallInst>(&I)) {
- // Handle obvious cases efficiently.
- AliasAnalysis::ModRefBehavior Behavior = AA->getModRefBehavior(CI);
- if (Behavior == AliasAnalysis::DoesNotAccessMemory)
- return true;
- else if (Behavior == AliasAnalysis::OnlyReadsMemory) {
- // If this call only reads from memory and there are no writes to memory
- // in the loop, we can hoist or sink the call as appropriate.
- bool FoundMod = false;
- for (AliasSetTracker::iterator I = CurAST->begin(), E = CurAST->end();
- I != E; ++I) {
- AliasSet &AS = *I;
- if (!AS.isForwardingAliasSet() && AS.isMod()) {
- FoundMod = true;
- break;
- }
- }
- if (!FoundMod) return true;
- }
-
- // FIXME: This should use mod/ref information to see if we can hoist or sink
- // the call.
-
- return false;
- }
-
- // Otherwise these instructions are hoistable/sinkable
- return isa<BinaryOperator>(I) || isa<CastInst>(I) ||
- isa<SelectInst>(I) || isa<GetElementPtrInst>(I) || isa<CmpInst>(I) ||
- isa<InsertElementInst>(I) || isa<ExtractElementInst>(I) ||
- isa<ShuffleVectorInst>(I);
-}
-
-/// isNotUsedInLoop - Return true if the only users of this instruction are
-/// outside of the loop. If this is true, we can sink the instruction to the
-/// exit blocks of the loop.
-///
-bool LICM::isNotUsedInLoop(Instruction &I) {
- for (Value::use_iterator UI = I.use_begin(), E = I.use_end(); UI != E; ++UI) {
- Instruction *User = cast<Instruction>(*UI);
- if (PHINode *PN = dyn_cast<PHINode>(User)) {
- // PHI node uses occur in predecessor blocks!
- for (unsigned i = 0, e = PN->getNumIncomingValues(); i != e; ++i)
- if (PN->getIncomingValue(i) == &I)
- if (CurLoop->contains(PN->getIncomingBlock(i)))
- return false;
- } else if (CurLoop->contains(User->getParent())) {
- return false;
- }
- }
- return true;
-}
-
-
-/// isLoopInvariantInst - Return true if all operands of this instruction are
-/// loop invariant. We also filter out non-hoistable instructions here just for
-/// efficiency.
-///
-bool LICM::isLoopInvariantInst(Instruction &I) {
- // The instruction is loop invariant if all of its operands are loop-invariant
- for (unsigned i = 0, e = I.getNumOperands(); i != e; ++i)
- if (!CurLoop->isLoopInvariant(I.getOperand(i)))
- return false;
-
- // If we got this far, the instruction is loop invariant!
- return true;
-}
-
-/// sink - When an instruction is found to only be used outside of the loop,
-/// this function moves it to the exit blocks and patches up SSA form as needed.
-/// This method is guaranteed to remove the original instruction from its
-/// position, and may either delete it or move it to outside of the loop.
-///
-void LICM::sink(Instruction &I) {
- DOUT << "LICM sinking instruction: " << I;
-
- SmallVector<BasicBlock*, 8> ExitBlocks;
- CurLoop->getExitBlocks(ExitBlocks);
-
- if (isa<LoadInst>(I)) ++NumMovedLoads;
- else if (isa<CallInst>(I)) ++NumMovedCalls;
- ++NumSunk;
- Changed = true;
-
- // The case where there is only a single exit node of this loop is common
- // enough that we handle it as a special (more efficient) case. It is more
- // efficient to handle because there are no PHI nodes that need to be placed.
- if (ExitBlocks.size() == 1) {
- if (!isExitBlockDominatedByBlockInLoop(ExitBlocks[0], I.getParent())) {
- // Instruction is not used, just delete it.
- CurAST->deleteValue(&I);
- if (!I.use_empty()) // If I has users in unreachable blocks, eliminate.
- I.replaceAllUsesWith(UndefValue::get(I.getType()));
- I.eraseFromParent();
- } else {
- // Move the instruction to the start of the exit block, after any PHI
- // nodes in it.
- I.removeFromParent();
-
- BasicBlock::iterator InsertPt = ExitBlocks[0]->begin();
- while (isa<PHINode>(InsertPt)) ++InsertPt;
- ExitBlocks[0]->getInstList().insert(InsertPt, &I);
- }
- } else if (ExitBlocks.empty()) {
- // The instruction is actually dead if there ARE NO exit blocks.
- CurAST->deleteValue(&I);
- if (!I.use_empty()) // If I has users in unreachable blocks, eliminate.
- I.replaceAllUsesWith(UndefValue::get(I.getType()));
- I.eraseFromParent();
- } else {
- // Otherwise, if we have multiple exits, use the PromoteMem2Reg function to
- // do all of the hard work of inserting PHI nodes as necessary. We convert
- // the value into a stack object to get it to do this.
-
- // Firstly, we create a stack object to hold the value...
- AllocaInst *AI = 0;
-
- if (I.getType() != Type::VoidTy) {
- AI = new AllocaInst(I.getType(), 0, I.getName(),
- I.getParent()->getParent()->getEntryBlock().begin());
- CurAST->add(AI);
- }
-
- // Secondly, insert load instructions for each use of the instruction
- // outside of the loop.
- while (!I.use_empty()) {
- Instruction *U = cast<Instruction>(I.use_back());
-
- // If the user is a PHI Node, we actually have to insert load instructions
- // in all predecessor blocks, not in the PHI block itself!
- if (PHINode *UPN = dyn_cast<PHINode>(U)) {
- // Only insert into each predecessor once, so that we don't have
- // different incoming values from the same block!
- std::map<BasicBlock*, Value*> InsertedBlocks;
- for (unsigned i = 0, e = UPN->getNumIncomingValues(); i != e; ++i)
- if (UPN->getIncomingValue(i) == &I) {
- BasicBlock *Pred = UPN->getIncomingBlock(i);
- Value *&PredVal = InsertedBlocks[Pred];
- if (!PredVal) {
- // Insert a new load instruction right before the terminator in
- // the predecessor block.
- PredVal = new LoadInst(AI, "", Pred->getTerminator());
- CurAST->add(cast<LoadInst>(PredVal));
- }
-
- UPN->setIncomingValue(i, PredVal);
- }
-
- } else {
- LoadInst *L = new LoadInst(AI, "", U);
- U->replaceUsesOfWith(&I, L);
- CurAST->add(L);
- }
- }
-
- // Thirdly, insert a copy of the instruction in each exit block of the loop
- // that is dominated by the instruction, storing the result into the memory
- // location. Be careful not to insert the instruction into any particular
- // basic block more than once.
- std::set<BasicBlock*> InsertedBlocks;
- BasicBlock *InstOrigBB = I.getParent();
-
- for (unsigned i = 0, e = ExitBlocks.size(); i != e; ++i) {
- BasicBlock *ExitBlock = ExitBlocks[i];
-
- if (isExitBlockDominatedByBlockInLoop(ExitBlock, InstOrigBB)) {
- // If we haven't already processed this exit block, do so now.
- if (InsertedBlocks.insert(ExitBlock).second) {
- // Insert the code after the last PHI node...
- BasicBlock::iterator InsertPt = ExitBlock->begin();
- while (isa<PHINode>(InsertPt)) ++InsertPt;
-
- // If this is the first exit block processed, just move the original
- // instruction, otherwise clone the original instruction and insert
- // the copy.
- Instruction *New;
- if (InsertedBlocks.size() == 1) {
- I.removeFromParent();
- ExitBlock->getInstList().insert(InsertPt, &I);
- New = &I;
- } else {
- New = I.clone();
- CurAST->copyValue(&I, New);
- if (!I.getName().empty())
- New->setName(I.getName()+".le");
- ExitBlock->getInstList().insert(InsertPt, New);
- }
-
- // Now that we have inserted the instruction, store it into the alloca
- if (AI) new StoreInst(New, AI, InsertPt);
- }
- }
- }
-
- // If the instruction doesn't dominate any exit blocks, it must be dead.
- if (InsertedBlocks.empty()) {
- CurAST->deleteValue(&I);
- I.eraseFromParent();
- }
-
- // Finally, promote the fine value to SSA form.
- if (AI) {
- std::vector<AllocaInst*> Allocas;
- Allocas.push_back(AI);
- PromoteMemToReg(Allocas, *DT, *DF, CurAST);
- }
- }
-}
-
-/// hoist - When an instruction is found to only use loop invariant operands
-/// that is safe to hoist, this instruction is called to do the dirty work.
-///
-void LICM::hoist(Instruction &I) {
- DOUT << "LICM hoisting to " << Preheader->getName() << ": " << I;
-
- // Remove the instruction from its current basic block... but don't delete the
- // instruction.
- I.removeFromParent();
-
- // Insert the new node in Preheader, before the terminator.
- Preheader->getInstList().insert(Preheader->getTerminator(), &I);
-
- if (isa<LoadInst>(I)) ++NumMovedLoads;
- else if (isa<CallInst>(I)) ++NumMovedCalls;
- ++NumHoisted;
- Changed = true;
-}
-
-/// isSafeToExecuteUnconditionally - Only sink or hoist an instruction if it is
-/// not a trapping instruction or if it is a trapping instruction and is
-/// guaranteed to execute.
-///
-bool LICM::isSafeToExecuteUnconditionally(Instruction &Inst) {
- // If it is not a trapping instruction, it is always safe to hoist.
- if (!Inst.isTrapping()) return true;
-
- // Otherwise we have to check to make sure that the instruction dominates all
- // of the exit blocks. If it doesn't, then there is a path out of the loop
- // which does not execute this instruction, so we can't hoist it.
-
- // If the instruction is in the header block for the loop (which is very
- // common), it is always guaranteed to dominate the exit blocks. Since this
- // is a common case, and can save some work, check it now.
- if (Inst.getParent() == CurLoop->getHeader())
- return true;
-
- // It's always safe to load from a global or alloca.
- if (isa<LoadInst>(Inst))
- if (isa<AllocationInst>(Inst.getOperand(0)) ||
- isa<GlobalVariable>(Inst.getOperand(0)))
- return true;
-
- // Get the exit blocks for the current loop.
- SmallVector<BasicBlock*, 8> ExitBlocks;
- CurLoop->getExitBlocks(ExitBlocks);
-
- // For each exit block, get the DT node and walk up the DT until the
- // instruction's basic block is found or we exit the loop.
- for (unsigned i = 0, e = ExitBlocks.size(); i != e; ++i)
- if (!isExitBlockDominatedByBlockInLoop(ExitBlocks[i], Inst.getParent()))
- return false;
-
- return true;
-}
-
-
-/// PromoteValuesInLoop - Try to promote memory values to scalars by sinking
-/// stores out of the loop and moving loads to before the loop. We do this by
-/// looping over the stores in the loop, looking for stores to Must pointers
-/// which are loop invariant. We promote these memory locations to use allocas
-/// instead. These allocas can easily be raised to register values by the
-/// PromoteMem2Reg functionality.
-///
-void LICM::PromoteValuesInLoop() {
- // PromotedValues - List of values that are promoted out of the loop. Each
- // value has an alloca instruction for it, and a canonical version of the
- // pointer.
- std::vector<std::pair<AllocaInst*, Value*> > PromotedValues;
- std::map<Value*, AllocaInst*> ValueToAllocaMap; // Map of ptr to alloca
-
- FindPromotableValuesInLoop(PromotedValues, ValueToAllocaMap);
- if (ValueToAllocaMap.empty()) return; // If there are values to promote.
-
- Changed = true;
- NumPromoted += PromotedValues.size();
-
- std::vector<Value*> PointerValueNumbers;
-
- // Emit a copy from the value into the alloca'd value in the loop preheader
- TerminatorInst *LoopPredInst = Preheader->getTerminator();
- for (unsigned i = 0, e = PromotedValues.size(); i != e; ++i) {
- Value *Ptr = PromotedValues[i].second;
-
- // If we are promoting a pointer value, update alias information for the
- // inserted load.
- Value *LoadValue = 0;
- if (isa<PointerType>(cast<PointerType>(Ptr->getType())->getElementType())) {
- // Locate a load or store through the pointer, and assign the same value
- // to LI as we are loading or storing. Since we know that the value is
- // stored in this loop, this will always succeed.
- for (Value::use_iterator UI = Ptr->use_begin(), E = Ptr->use_end();
- UI != E; ++UI)
- if (LoadInst *LI = dyn_cast<LoadInst>(*UI)) {
- LoadValue = LI;
- break;
- } else if (StoreInst *SI = dyn_cast<StoreInst>(*UI)) {
- if (SI->getOperand(1) == Ptr) {
- LoadValue = SI->getOperand(0);
- break;
- }
- }
- assert(LoadValue && "No store through the pointer found!");
- PointerValueNumbers.push_back(LoadValue); // Remember this for later.
- }
-
- // Load from the memory we are promoting.
- LoadInst *LI = new LoadInst(Ptr, Ptr->getName()+".promoted", LoopPredInst);
-
- if (LoadValue) CurAST->copyValue(LoadValue, LI);
-
- // Store into the temporary alloca.
- new StoreInst(LI, PromotedValues[i].first, LoopPredInst);
- }
-
- // Scan the basic blocks in the loop, replacing uses of our pointers with
- // uses of the allocas in question.
- //
- const std::vector<BasicBlock*> &LoopBBs = CurLoop->getBlocks();
- for (std::vector<BasicBlock*>::const_iterator I = LoopBBs.begin(),
- E = LoopBBs.end(); I != E; ++I) {
- // Rewrite all loads and stores in the block of the pointer...
- for (BasicBlock::iterator II = (*I)->begin(), E = (*I)->end();
- II != E; ++II) {
- if (LoadInst *L = dyn_cast<LoadInst>(II)) {
- std::map<Value*, AllocaInst*>::iterator
- I = ValueToAllocaMap.find(L->getOperand(0));
- if (I != ValueToAllocaMap.end())
- L->setOperand(0, I->second); // Rewrite load instruction...
- } else if (StoreInst *S = dyn_cast<StoreInst>(II)) {
- std::map<Value*, AllocaInst*>::iterator
- I = ValueToAllocaMap.find(S->getOperand(1));
- if (I != ValueToAllocaMap.end())
- S->setOperand(1, I->second); // Rewrite store instruction...
- }
- }
- }
-
- // Now that the body of the loop uses the allocas instead of the original
- // memory locations, insert code to copy the alloca value back into the
- // original memory location on all exits from the loop. Note that we only
- // want to insert one copy of the code in each exit block, though the loop may
- // exit to the same block more than once.
- //
- std::set<BasicBlock*> ProcessedBlocks;
-
- SmallVector<BasicBlock*, 8> ExitBlocks;
- CurLoop->getExitBlocks(ExitBlocks);
- for (unsigned i = 0, e = ExitBlocks.size(); i != e; ++i)
- if (ProcessedBlocks.insert(ExitBlocks[i]).second) {
- // Copy all of the allocas into their memory locations.
- BasicBlock::iterator BI = ExitBlocks[i]->begin();
- while (isa<PHINode>(*BI))
- ++BI; // Skip over all of the phi nodes in the block.
- Instruction *InsertPos = BI;
- unsigned PVN = 0;
- for (unsigned i = 0, e = PromotedValues.size(); i != e; ++i) {
- // Load from the alloca.
- LoadInst *LI = new LoadInst(PromotedValues[i].first, "", InsertPos);
-
- // If this is a pointer type, update alias info appropriately.
- if (isa<PointerType>(LI->getType()))
- CurAST->copyValue(PointerValueNumbers[PVN++], LI);
-
- // Store into the memory we promoted.
- new StoreInst(LI, PromotedValues[i].second, InsertPos);
- }
- }
-
- // Now that we have done the deed, use the mem2reg functionality to promote
- // all of the new allocas we just created into real SSA registers.
- //
- std::vector<AllocaInst*> PromotedAllocas;
- PromotedAllocas.reserve(PromotedValues.size());
- for (unsigned i = 0, e = PromotedValues.size(); i != e; ++i)
- PromotedAllocas.push_back(PromotedValues[i].first);
- PromoteMemToReg(PromotedAllocas, *DT, *DF, CurAST);
-}
-
-/// FindPromotableValuesInLoop - Check the current loop for stores to definite
-/// pointers, which are not loaded and stored through may aliases and are safe
-/// for promotion. If these are found, create an alloca for the value, add it
-/// to the PromotedValues list, and keep track of the mapping from value to
-/// alloca.
-void LICM::FindPromotableValuesInLoop(
- std::vector<std::pair<AllocaInst*, Value*> > &PromotedValues,
- std::map<Value*, AllocaInst*> &ValueToAllocaMap) {
- Instruction *FnStart = CurLoop->getHeader()->getParent()->begin()->begin();
-
- SmallVector<Instruction *, 4> LoopExits;
- SmallVector<BasicBlock *, 4> Blocks;
- CurLoop->getExitingBlocks(Blocks);
- for (SmallVector<BasicBlock *, 4>::iterator BI = Blocks.begin(),
- BE = Blocks.end(); BI != BE; ++BI) {
- BasicBlock *BB = *BI;
- LoopExits.push_back(BB->getTerminator());
- }
-
- // Loop over all of the alias sets in the tracker object.
- for (AliasSetTracker::iterator I = CurAST->begin(), E = CurAST->end();
- I != E; ++I) {
- AliasSet &AS = *I;
- // We can promote this alias set if it has a store, if it is a "Must" alias
- // set, if the pointer is loop invariant, and if we are not eliminating any
- // volatile loads or stores.
- if (!AS.isForwardingAliasSet() && AS.isMod() && AS.isMustAlias() &&
- !AS.isVolatile() && CurLoop->isLoopInvariant(AS.begin()->first)) {
- assert(!AS.empty() &&
- "Must alias set should have at least one pointer element in it!");
- Value *V = AS.begin()->first;
-
- // Check that all of the pointers in the alias set have the same type. We
- // cannot (yet) promote a memory location that is loaded and stored in
- // different sizes.
- bool PointerOk = true;
- for (AliasSet::iterator I = AS.begin(), E = AS.end(); I != E; ++I)
- if (V->getType() != I->first->getType()) {
- PointerOk = false;
- break;
- }
-
- // If one use of value V inside the loop is safe then it is OK to promote
- // this value. On the otherside if there is not any unsafe use inside the
- // loop then also it is OK to promote this value. Otherwise it is
- // unsafe to promote this value.
- if (PointerOk) {
- bool oneSafeUse = false;
- bool oneUnsafeUse = false;
- for(Value::use_iterator UI = V->use_begin(), UE = V->use_end();
- UI != UE; ++UI) {
- Instruction *Use = dyn_cast<Instruction>(*UI);
- if (!Use || !CurLoop->contains(Use->getParent()))
- continue;
- for (SmallVector<Instruction *, 4>::iterator
- ExitI = LoopExits.begin(), ExitE = LoopExits.end();
- ExitI != ExitE; ++ExitI) {
- Instruction *Ex = *ExitI;
- if (!isa<PHINode>(Use) && DT->dominates(Use, Ex)) {
- oneSafeUse = true;
- break;
- }
- else
- oneUnsafeUse = true;
- }
-
- if (oneSafeUse)
- break;
- }
-
- if (oneSafeUse)
- PointerOk = true;
- else if (!oneUnsafeUse)
- PointerOk = true;
- else
- PointerOk = false;
- }
-
- if (PointerOk) {
- const Type *Ty = cast<PointerType>(V->getType())->getElementType();
- AllocaInst *AI = new AllocaInst(Ty, 0, V->getName()+".tmp", FnStart);
- PromotedValues.push_back(std::make_pair(AI, V));
-
- // Update the AST and alias analysis.
- CurAST->copyValue(V, AI);
-
- for (AliasSet::iterator I = AS.begin(), E = AS.end(); I != E; ++I)
- ValueToAllocaMap.insert(std::make_pair(I->first, AI));
-
- DOUT << "LICM: Promoting value: " << *V << "\n";
- }
- }
- }
-}
-
-/// cloneBasicBlockAnalysis - Simple Analysis hook. Clone alias set info.
-void LICM::cloneBasicBlockAnalysis(BasicBlock *From, BasicBlock *To, Loop *L) {
- AliasSetTracker *AST = LoopToAliasMap[L];
- if (!AST)
- return;
-
- AST->copyValue(From, To);
-}
-
-/// deleteAnalysisValue - Simple Analysis hook. Delete value V from alias
-/// set.
-void LICM::deleteAnalysisValue(Value *V, Loop *L) {
- AliasSetTracker *AST = LoopToAliasMap[L];
- if (!AST)
- return;
-
- AST->deleteValue(V);
-}
diff --git a/release_23/lib/Transforms/Scalar/LoopDeletion.cpp b/release_23/lib/Transforms/Scalar/LoopDeletion.cpp
deleted file mode 100644
index 02a5ca98d977..000000000000
--- a/release_23/lib/Transforms/Scalar/LoopDeletion.cpp
+++ /dev/null
@@ -1,280 +0,0 @@
-//===- LoopDeletion.cpp - Dead Loop Deletion Pass ---------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the Dead Loop Deletion Pass. This pass is responsible
-// for eliminating loops with non-infinite computable trip counts that have no
-// side effects or volatile instructions, and do not contribute to the
-// computation of the function's return value.
-//
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "loop-delete"
-
-#include "llvm/Transforms/Scalar.h"
-#include "llvm/Analysis/LoopPass.h"
-#include "llvm/ADT/Statistic.h"
-#include "llvm/ADT/SmallVector.h"
-
-using namespace llvm;
-
-STATISTIC(NumDeleted, "Number of loops deleted");
-
-namespace {
- class VISIBILITY_HIDDEN LoopDeletion : public LoopPass {
- public:
- static char ID; // Pass ID, replacement for typeid
- LoopDeletion() : LoopPass((intptr_t)&ID) { }
-
- // Possibly eliminate loop L if it is dead.
- bool runOnLoop(Loop* L, LPPassManager& LPM);
-
- bool SingleDominatingExit(Loop* L,
- SmallVector<BasicBlock*, 4>& exitingBlocks);
- bool IsLoopDead(Loop* L, SmallVector<BasicBlock*, 4>& exitingBlocks,
- SmallVector<BasicBlock*, 4>& exitBlocks);
- bool IsLoopInvariantInst(Instruction *I, Loop* L);
-
- virtual void getAnalysisUsage(AnalysisUsage& AU) const {
- AU.addRequired<DominatorTree>();
- AU.addRequired<LoopInfo>();
- AU.addRequiredID(LoopSimplifyID);
- AU.addRequiredID(LCSSAID);
-
- AU.addPreserved<DominatorTree>();
- AU.addPreserved<LoopInfo>();
- AU.addPreservedID(LoopSimplifyID);
- AU.addPreservedID(LCSSAID);
- }
- };
-
- char LoopDeletion::ID = 0;
- RegisterPass<LoopDeletion> X ("loop-deletion", "Delete dead loops");
-}
-
-LoopPass* llvm::createLoopDeletionPass() {
- return new LoopDeletion();
-}
-
-/// SingleDominatingExit - Checks that there is only a single blocks that
-/// branches out of the loop, and that it also dominates the latch block. Loops
-/// with multiple or non-latch-dominating exiting blocks could be dead, but we'd
-/// have to do more extensive analysis to make sure, for instance, that the
-/// control flow logic involves was or could be made loop-invariant.
-bool LoopDeletion::SingleDominatingExit(Loop* L,
- SmallVector<BasicBlock*, 4>& exitingBlocks) {
-
- if (exitingBlocks.size() != 1)
- return false;
-
- BasicBlock* latch = L->getLoopLatch();
- if (!latch)
- return false;
-
- DominatorTree& DT = getAnalysis<DominatorTree>();
- if (DT.dominates(exitingBlocks[0], latch))
- return true;
- else
- return false;
-}
-
-/// IsLoopInvariantInst - Checks if an instruction is invariant with respect to
-/// a loop, which is defined as being true if all of its operands are defined
-/// outside of the loop. These instructions can be hoisted out of the loop
-/// if their results are needed. This could be made more aggressive by
-/// recursively checking the operands for invariance, but it's not clear that
-/// it's worth it.
-bool LoopDeletion::IsLoopInvariantInst(Instruction *I, Loop* L) {
- // PHI nodes are not loop invariant if defined in the loop.
- if (isa<PHINode>(I) && L->contains(I->getParent()))
- return false;
-
- // The instruction is loop invariant if all of its operands are loop-invariant
- for (unsigned i = 0, e = I->getNumOperands(); i != e; ++i)
- if (!L->isLoopInvariant(I->getOperand(i)))
- return false;
-
- // If we got this far, the instruction is loop invariant!
- return true;
-}
-
-/// IsLoopDead - Determined if a loop is dead. This assumes that we've already
-/// checked for unique exit and exiting blocks, and that the code is in LCSSA
-/// form.
-bool LoopDeletion::IsLoopDead(Loop* L,
- SmallVector<BasicBlock*, 4>& exitingBlocks,
- SmallVector<BasicBlock*, 4>& exitBlocks) {
- BasicBlock* exitingBlock = exitingBlocks[0];
- BasicBlock* exitBlock = exitBlocks[0];
-
- // Make sure that all PHI entries coming from the loop are loop invariant.
- // Because the code is in LCSSA form, any values used outside of the loop
- // must pass through a PHI in the exit block, meaning that this check is
- // sufficient to guarantee that no loop-variant values are used outside
- // of the loop.
- BasicBlock::iterator BI = exitBlock->begin();
- while (PHINode* P = dyn_cast<PHINode>(BI)) {
- Value* incoming = P->getIncomingValueForBlock(exitingBlock);
- if (Instruction* I = dyn_cast<Instruction>(incoming))
- if (!IsLoopInvariantInst(I, L))
- return false;
-
- BI++;
- }
-
- // Make sure that no instructions in the block have potential side-effects.
- // This includes instructions that could write to memory, and loads that are
- // marked volatile. This could be made more aggressive by using aliasing
- // information to identify readonly and readnone calls.
- for (Loop::block_iterator LI = L->block_begin(), LE = L->block_end();
- LI != LE; ++LI) {
- for (BasicBlock::iterator BI = (*LI)->begin(), BE = (*LI)->end();
- BI != BE; ++BI) {
- if (BI->mayWriteToMemory())
- return false;
- else if (LoadInst* L = dyn_cast<LoadInst>(BI))
- if (L->isVolatile())
- return false;
- }
- }
-
- return true;
-}
-
-/// runOnLoop - Remove dead loops, by which we mean loops that do not impact the
-/// observable behavior of the program other than finite running time. Note
-/// we do ensure that this never remove a loop that might be infinite, as doing
-/// so could change the halting/non-halting nature of a program.
-/// NOTE: This entire process relies pretty heavily on LoopSimplify and LCSSA
-/// in order to make various safety checks work.
-bool LoopDeletion::runOnLoop(Loop* L, LPPassManager& LPM) {
- SmallVector<BasicBlock*, 4> exitingBlocks;
- L->getExitingBlocks(exitingBlocks);
-
- SmallVector<BasicBlock*, 4> exitBlocks;
- L->getUniqueExitBlocks(exitBlocks);
-
- // We require that the loop only have a single exit block. Otherwise, we'd
- // be in the situation of needing to be able to solve statically which exit
- // block will be branced to, or trying to preserve the branching logic in
- // a loop invariant manner.
- if (exitBlocks.size() != 1)
- return false;
-
- // We can only remove the loop if there is a preheader that we can
- // branch from after removing it.
- BasicBlock* preheader = L->getLoopPreheader();
- if (!preheader)
- return false;
-
- // We can't remove loops that contain subloops. If the subloops were dead,
- // they would already have been removed in earlier executions of this pass.
- if (L->begin() != L->end())
- return false;
-
- // Don't remove loops for which we can't solve the trip count.
- // They could be infinite, in which case we'd be changing program behavior.
- if (!L->getTripCount())
- return false;
-
- // Loops with multiple exits or exits that don't dominate the latch
- // are too complicated to handle correctly.
- if (!SingleDominatingExit(L, exitingBlocks))
- return false;
-
- // Finally, we have to check that the loop really is dead.
- if (!IsLoopDead(L, exitingBlocks, exitBlocks))
- return false;
-
- // Now that we know the removal is safe, remove the loop by changing the
- // branch from the preheader to go to the single exit block.
- BasicBlock* exitBlock = exitBlocks[0];
- BasicBlock* exitingBlock = exitingBlocks[0];
-
- // Because we're deleting a large chunk of code at once, the sequence in which
- // we remove things is very important to avoid invalidation issues. Don't
- // mess with this unless you have good reason and know what you're doing.
-
- // Move simple loop-invariant expressions out of the loop, since they
- // might be needed by the exit phis.
- for (Loop::block_iterator LI = L->block_begin(), LE = L->block_end();
- LI != LE; ++LI)
- for (BasicBlock::iterator BI = (*LI)->begin(), BE = (*LI)->end();
- BI != BE; ) {
- Instruction* I = BI++;
- if (I->getNumUses() > 0 && IsLoopInvariantInst(I, L))
- I->moveBefore(preheader->getTerminator());
- }
-
- // Connect the preheader directly to the exit block.
- TerminatorInst* TI = preheader->getTerminator();
- TI->replaceUsesOfWith(L->getHeader(), exitBlock);
-
- // Rewrite phis in the exit block to get their inputs from
- // the preheader instead of the exiting block.
- BasicBlock::iterator BI = exitBlock->begin();
- while (PHINode* P = dyn_cast<PHINode>(BI)) {
- P->replaceUsesOfWith(exitingBlock, preheader);
- BI++;
- }
-
- // Update the dominator tree and remove the instructions and blocks that will
- // be deleted from the reference counting scheme.
- DominatorTree& DT = getAnalysis<DominatorTree>();
- SmallPtrSet<DomTreeNode*, 8> ChildNodes;
- for (Loop::block_iterator LI = L->block_begin(), LE = L->block_end();
- LI != LE; ++LI) {
- // Move all of the block's children to be children of the preheader, which
- // allows us to remove the domtree entry for the block.
- ChildNodes.insert(DT[*LI]->begin(), DT[*LI]->end());
- for (SmallPtrSet<DomTreeNode*, 8>::iterator DI = ChildNodes.begin(),
- DE = ChildNodes.end(); DI != DE; ++DI)
- DT.changeImmediateDominator(*DI, DT[preheader]);
-
- ChildNodes.clear();
- DT.eraseNode(*LI);
-
- // Drop all references between the instructions and the block so
- // that we don't have reference counting problems later.
- for (BasicBlock::iterator BI = (*LI)->begin(), BE = (*LI)->end();
- BI != BE; ++BI) {
- BI->dropAllReferences();
- }
-
- (*LI)->dropAllReferences();
- }
-
- // Erase the instructions and the blocks without having to worry
- // about ordering because we already dropped the references.
- // NOTE: This iteration is safe because erasing the block does not remove its
- // entry from the loop's block list. We do that in the next section.
- for (Loop::block_iterator LI = L->block_begin(), LE = L->block_end();
- LI != LE; ++LI) {
- for (Value::use_iterator UI = (*LI)->use_begin(), UE = (*LI)->use_end();
- UI != UE; ++UI)
- (*UI)->dump();
- (*LI)->eraseFromParent();
- }
-
- // Finally, the blocks from loopinfo. This has to happen late because
- // otherwise our loop iterators won't work.
- LoopInfo& loopInfo = getAnalysis<LoopInfo>();
- SmallPtrSet<BasicBlock*, 8> blocks;
- blocks.insert(L->block_begin(), L->block_end());
- for (SmallPtrSet<BasicBlock*,8>::iterator I = blocks.begin(),
- E = blocks.end(); I != E; ++I)
- loopInfo.removeBlock(*I);
-
- // The last step is to inform the loop pass manager that we've
- // eliminated this loop.
- LPM.deleteLoopFromQueue(L);
-
- NumDeleted++;
-
- return true;
-}
diff --git a/release_23/lib/Transforms/Scalar/LoopIndexSplit.cpp b/release_23/lib/Transforms/Scalar/LoopIndexSplit.cpp
deleted file mode 100644
index a6bd9ff20a9a..000000000000
--- a/release_23/lib/Transforms/Scalar/LoopIndexSplit.cpp
+++ /dev/null
@@ -1,1692 +0,0 @@
-//===- LoopIndexSplit.cpp - Loop Index Splitting Pass ---------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements Loop Index Splitting Pass.
-//
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "loop-index-split"
-
-#include "llvm/Transforms/Scalar.h"
-#include "llvm/Analysis/LoopPass.h"
-#include "llvm/Analysis/ScalarEvolutionExpander.h"
-#include "llvm/Analysis/Dominators.h"
-#include "llvm/Transforms/Utils/BasicBlockUtils.h"
-#include "llvm/Transforms/Utils/Cloning.h"
-#include "llvm/Support/Compiler.h"
-#include "llvm/ADT/DepthFirstIterator.h"
-#include "llvm/ADT/Statistic.h"
-
-using namespace llvm;
-
-STATISTIC(NumIndexSplit, "Number of loops index split");
-
-namespace {
-
- class VISIBILITY_HIDDEN LoopIndexSplit : public LoopPass {
-
- public:
- static char ID; // Pass ID, replacement for typeid
- LoopIndexSplit() : LoopPass((intptr_t)&ID) {}
-
- // Index split Loop L. Return true if loop is split.
- bool runOnLoop(Loop *L, LPPassManager &LPM);
-
- void getAnalysisUsage(AnalysisUsage &AU) const {
- AU.addRequired<ScalarEvolution>();
- AU.addPreserved<ScalarEvolution>();
- AU.addRequiredID(LCSSAID);
- AU.addPreservedID(LCSSAID);
- AU.addRequired<LoopInfo>();
- AU.addPreserved<LoopInfo>();
- AU.addRequiredID(LoopSimplifyID);
- AU.addPreservedID(LoopSimplifyID);
- AU.addRequired<DominatorTree>();
- AU.addRequired<DominanceFrontier>();
- AU.addPreserved<DominatorTree>();
- AU.addPreserved<DominanceFrontier>();
- }
-
- private:
-
- class SplitInfo {
- public:
- SplitInfo() : SplitValue(NULL), SplitCondition(NULL),
- UseTrueBranchFirst(true), A_ExitValue(NULL),
- B_StartValue(NULL) {}
-
- // Induction variable's range is split at this value.
- Value *SplitValue;
-
- // This instruction compares IndVar against SplitValue.
- Instruction *SplitCondition;
-
- // True if after loop index split, first loop will execute split condition's
- // true branch.
- bool UseTrueBranchFirst;
-
- // Exit value for first loop after loop split.
- Value *A_ExitValue;
-
- // Start value for second loop after loop split.
- Value *B_StartValue;
-
- // Clear split info.
- void clear() {
- SplitValue = NULL;
- SplitCondition = NULL;
- UseTrueBranchFirst = true;
- A_ExitValue = NULL;
- B_StartValue = NULL;
- }
-
- };
-
- private:
-
- // safeIcmpInst - CI is considered safe instruction if one of the operand
- // is SCEVAddRecExpr based on induction variable and other operand is
- // loop invariant. If CI is safe then populate SplitInfo object SD appropriately
- // and return true;
- bool safeICmpInst(ICmpInst *CI, SplitInfo &SD);
-
- /// Find condition inside a loop that is suitable candidate for index split.
- void findSplitCondition();
-
- /// Find loop's exit condition.
- void findLoopConditionals();
-
- /// Return induction variable associated with value V.
- void findIndVar(Value *V, Loop *L);
-
- /// processOneIterationLoop - Current loop L contains compare instruction
- /// that compares induction variable, IndVar, agains loop invariant. If
- /// entire (i.e. meaningful) loop body is dominated by this compare
- /// instruction then loop body is executed only for one iteration. In
- /// such case eliminate loop structure surrounding this loop body. For
- bool processOneIterationLoop(SplitInfo &SD);
-
- void updateLoopBounds(ICmpInst *CI);
- /// updateLoopIterationSpace - Current loop body is covered by an AND
- /// instruction whose operands compares induction variables with loop
- /// invariants. If possible, hoist this check outside the loop by
- /// updating appropriate start and end values for induction variable.
- bool updateLoopIterationSpace(SplitInfo &SD);
-
- /// If loop header includes loop variant instruction operands then
- /// this loop may not be eliminated.
- bool safeHeader(SplitInfo &SD, BasicBlock *BB);
-
- /// If Exiting block includes loop variant instructions then this
- /// loop may not be eliminated.
- bool safeExitingBlock(SplitInfo &SD, BasicBlock *BB);
-
- /// removeBlocks - Remove basic block DeadBB and all blocks dominated by DeadBB.
- /// This routine is used to remove split condition's dead branch, dominated by
- /// DeadBB. LiveBB dominates split conidition's other branch.
- void removeBlocks(BasicBlock *DeadBB, Loop *LP, BasicBlock *LiveBB);
-
- /// safeSplitCondition - Return true if it is possible to
- /// split loop using given split condition.
- bool safeSplitCondition(SplitInfo &SD);
-
- /// calculateLoopBounds - ALoop exit value and BLoop start values are calculated
- /// based on split value.
- void calculateLoopBounds(SplitInfo &SD);
-
- /// updatePHINodes - CFG has been changed.
- /// Before
- /// - ExitBB's single predecessor was Latch
- /// - Latch's second successor was Header
- /// Now
- /// - ExitBB's single predecessor was Header
- /// - Latch's one and only successor was Header
- ///
- /// Update ExitBB PHINodes' to reflect this change.
- void updatePHINodes(BasicBlock *ExitBB, BasicBlock *Latch,
- BasicBlock *Header,
- PHINode *IV, Instruction *IVIncrement, Loop *LP);
-
- /// moveExitCondition - Move exit condition EC into split condition block CondBB.
- void moveExitCondition(BasicBlock *CondBB, BasicBlock *ActiveBB,
- BasicBlock *ExitBB, ICmpInst *EC, ICmpInst *SC,
- PHINode *IV, Instruction *IVAdd, Loop *LP);
-
- /// splitLoop - Split current loop L in two loops using split information
- /// SD. Update dominator information. Maintain LCSSA form.
- bool splitLoop(SplitInfo &SD);
-
- void initialize() {
- IndVar = NULL;
- IndVarIncrement = NULL;
- ExitCondition = NULL;
- StartValue = NULL;
- ExitValueNum = 0;
- SplitData.clear();
- }
-
- private:
-
- // Current Loop.
- Loop *L;
- LPPassManager *LPM;
- LoopInfo *LI;
- ScalarEvolution *SE;
- DominatorTree *DT;
- DominanceFrontier *DF;
- SmallVector<SplitInfo, 4> SplitData;
-
- // Induction variable whose range is being split by this transformation.
- PHINode *IndVar;
- Instruction *IndVarIncrement;
-
- // Loop exit condition.
- ICmpInst *ExitCondition;
-
- // Induction variable's initial value.
- Value *StartValue;
-
- // Induction variable's final loop exit value operand number in exit condition..
- unsigned ExitValueNum;
- };
-
- char LoopIndexSplit::ID = 0;
- RegisterPass<LoopIndexSplit> X ("loop-index-split", "Index Split Loops");
-}
-
-LoopPass *llvm::createLoopIndexSplitPass() {
- return new LoopIndexSplit();
-}
-
-// Index split Loop L. Return true if loop is split.
-bool LoopIndexSplit::runOnLoop(Loop *IncomingLoop, LPPassManager &LPM_Ref) {
- bool Changed = false;
- L = IncomingLoop;
- LPM = &LPM_Ref;
-
- // FIXME - Nested loops make dominator info updates tricky.
- if (!L->getSubLoops().empty())
- return false;
-
- SE = &getAnalysis<ScalarEvolution>();
- DT = &getAnalysis<DominatorTree>();
- LI = &getAnalysis<LoopInfo>();
- DF = &getAnalysis<DominanceFrontier>();
-
- initialize();
-
- findLoopConditionals();
-
- if (!ExitCondition)
- return false;
-
- findSplitCondition();
-
- if (SplitData.empty())
- return false;
-
- // First see if it is possible to eliminate loop itself or not.
- for (SmallVector<SplitInfo, 4>::iterator SI = SplitData.begin();
- SI != SplitData.end();) {
- SplitInfo &SD = *SI;
- ICmpInst *CI = dyn_cast<ICmpInst>(SD.SplitCondition);
- if (SD.SplitCondition->getOpcode() == Instruction::And) {
- Changed = updateLoopIterationSpace(SD);
- if (Changed) {
- ++NumIndexSplit;
- // If is loop is eliminated then nothing else to do here.
- return Changed;
- } else {
- SmallVector<SplitInfo, 4>::iterator Delete_SI = SI;
- SI = SplitData.erase(Delete_SI);
- }
- }
- else if (CI && CI->getPredicate() == ICmpInst::ICMP_EQ) {
- Changed = processOneIterationLoop(SD);
- if (Changed) {
- ++NumIndexSplit;
- // If is loop is eliminated then nothing else to do here.
- return Changed;
- } else {
- SmallVector<SplitInfo, 4>::iterator Delete_SI = SI;
- SI = SplitData.erase(Delete_SI);
- }
- } else
- ++SI;
- }
-
- if (SplitData.empty())
- return false;
-
- // Split most profitiable condition.
- // FIXME : Implement cost analysis.
- unsigned MostProfitableSDIndex = 0;
- Changed = splitLoop(SplitData[MostProfitableSDIndex]);
-
- if (Changed)
- ++NumIndexSplit;
-
- return Changed;
-}
-
-/// Return true if V is a induction variable or induction variable's
-/// increment for loop L.
-void LoopIndexSplit::findIndVar(Value *V, Loop *L) {
-
- Instruction *I = dyn_cast<Instruction>(V);
- if (!I)
- return;
-
- // Check if I is a phi node from loop header or not.
- if (PHINode *PN = dyn_cast<PHINode>(V)) {
- if (PN->getParent() == L->getHeader()) {
- IndVar = PN;
- return;
- }
- }
-
- // Check if I is a add instruction whose one operand is
- // phi node from loop header and second operand is constant.
- if (I->getOpcode() != Instruction::Add)
- return;
-
- Value *Op0 = I->getOperand(0);
- Value *Op1 = I->getOperand(1);
-
- if (PHINode *PN = dyn_cast<PHINode>(Op0))
- if (PN->getParent() == L->getHeader())
- if (ConstantInt *CI = dyn_cast<ConstantInt>(Op1))
- if (CI->isOne()) {
- IndVar = PN;
- IndVarIncrement = I;
- return;
- }
-
- if (PHINode *PN = dyn_cast<PHINode>(Op1))
- if (PN->getParent() == L->getHeader())
- if (ConstantInt *CI = dyn_cast<ConstantInt>(Op0))
- if (CI->isOne()) {
- IndVar = PN;
- IndVarIncrement = I;
- return;
- }
-
- return;
-}
-
-// Find loop's exit condition and associated induction variable.
-void LoopIndexSplit::findLoopConditionals() {
-
- BasicBlock *ExitingBlock = NULL;
-
- for (Loop::block_iterator I = L->block_begin(), E = L->block_end();
- I != E; ++I) {
- BasicBlock *BB = *I;
- if (!L->isLoopExit(BB))
- continue;
- if (ExitingBlock)
- return;
- ExitingBlock = BB;
- }
-
- if (!ExitingBlock)
- return;
-
- // If exiting block is neither loop header nor loop latch then this loop is
- // not suitable.
- if (ExitingBlock != L->getHeader() && ExitingBlock != L->getLoopLatch())
- return;
-
- // If exit block's terminator is conditional branch inst then we have found
- // exit condition.
- BranchInst *BR = dyn_cast<BranchInst>(ExitingBlock->getTerminator());
- if (!BR || BR->isUnconditional())
- return;
-
- ICmpInst *CI = dyn_cast<ICmpInst>(BR->getCondition());
- if (!CI)
- return;
-
- // FIXME
- if (CI->getPredicate() == ICmpInst::ICMP_EQ
- || CI->getPredicate() == ICmpInst::ICMP_NE)
- return;
-
- ExitCondition = CI;
-
- // Exit condition's one operand is loop invariant exit value and second
- // operand is SCEVAddRecExpr based on induction variable.
- Value *V0 = CI->getOperand(0);
- Value *V1 = CI->getOperand(1);
-
- SCEVHandle SH0 = SE->getSCEV(V0);
- SCEVHandle SH1 = SE->getSCEV(V1);
-
- if (SH0->isLoopInvariant(L) && isa<SCEVAddRecExpr>(SH1)) {
- ExitValueNum = 0;
- findIndVar(V1, L);
- }
- else if (SH1->isLoopInvariant(L) && isa<SCEVAddRecExpr>(SH0)) {
- ExitValueNum = 1;
- findIndVar(V0, L);
- }
-
- if (!IndVar)
- ExitCondition = NULL;
- else if (IndVar) {
- BasicBlock *Preheader = L->getLoopPreheader();
- StartValue = IndVar->getIncomingValueForBlock(Preheader);
- }
-}
-
-/// Find condition inside a loop that is suitable candidate for index split.
-void LoopIndexSplit::findSplitCondition() {
-
- SplitInfo SD;
- // Check all basic block's terminators.
- for (Loop::block_iterator I = L->block_begin(), E = L->block_end();
- I != E; ++I) {
- SD.clear();
- BasicBlock *BB = *I;
-
- // If this basic block does not terminate in a conditional branch
- // then terminator is not a suitable split condition.
- BranchInst *BR = dyn_cast<BranchInst>(BB->getTerminator());
- if (!BR)
- continue;
-
- if (BR->isUnconditional())
- continue;
-
- if (Instruction *AndI = dyn_cast<Instruction>(BR->getCondition())) {
- if (AndI->getOpcode() == Instruction::And) {
- ICmpInst *Op0 = dyn_cast<ICmpInst>(AndI->getOperand(0));
- ICmpInst *Op1 = dyn_cast<ICmpInst>(AndI->getOperand(1));
-
- if (!Op0 || !Op1)
- continue;
-
- if (!safeICmpInst(Op0, SD))
- continue;
- SD.clear();
- if (!safeICmpInst(Op1, SD))
- continue;
- SD.clear();
- SD.SplitCondition = AndI;
- SplitData.push_back(SD);
- continue;
- }
- }
- ICmpInst *CI = dyn_cast<ICmpInst>(BR->getCondition());
- if (!CI || CI == ExitCondition)
- continue;
-
- if (CI->getPredicate() == ICmpInst::ICMP_NE)
- continue;
-
- // If split condition predicate is GT or GE then first execute
- // false branch of split condition.
- if (CI->getPredicate() == ICmpInst::ICMP_UGT
- || CI->getPredicate() == ICmpInst::ICMP_SGT
- || CI->getPredicate() == ICmpInst::ICMP_UGE
- || CI->getPredicate() == ICmpInst::ICMP_SGE)
- SD.UseTrueBranchFirst = false;
-
- // If one operand is loop invariant and second operand is SCEVAddRecExpr
- // based on induction variable then CI is a candidate split condition.
- if (safeICmpInst(CI, SD))
- SplitData.push_back(SD);
- }
-}
-
-// safeIcmpInst - CI is considered safe instruction if one of the operand
-// is SCEVAddRecExpr based on induction variable and other operand is
-// loop invariant. If CI is safe then populate SplitInfo object SD appropriately
-// and return true;
-bool LoopIndexSplit::safeICmpInst(ICmpInst *CI, SplitInfo &SD) {
-
- Value *V0 = CI->getOperand(0);
- Value *V1 = CI->getOperand(1);
-
- SCEVHandle SH0 = SE->getSCEV(V0);
- SCEVHandle SH1 = SE->getSCEV(V1);
-
- if (SH0->isLoopInvariant(L) && isa<SCEVAddRecExpr>(SH1)) {
- SD.SplitValue = V0;
- SD.SplitCondition = CI;
- if (PHINode *PN = dyn_cast<PHINode>(V1)) {
- if (PN == IndVar)
- return true;
- }
- else if (Instruction *Insn = dyn_cast<Instruction>(V1)) {
- if (IndVarIncrement && IndVarIncrement == Insn)
- return true;
- }
- }
- else if (SH1->isLoopInvariant(L) && isa<SCEVAddRecExpr>(SH0)) {
- SD.SplitValue = V1;
- SD.SplitCondition = CI;
- if (PHINode *PN = dyn_cast<PHINode>(V0)) {
- if (PN == IndVar)
- return true;
- }
- else if (Instruction *Insn = dyn_cast<Instruction>(V0)) {
- if (IndVarIncrement && IndVarIncrement == Insn)
- return true;
- }
- }
-
- return false;
-}
-
-/// processOneIterationLoop - Current loop L contains compare instruction
-/// that compares induction variable, IndVar, against loop invariant. If
-/// entire (i.e. meaningful) loop body is dominated by this compare
-/// instruction then loop body is executed only once. In such case eliminate
-/// loop structure surrounding this loop body. For example,
-/// for (int i = start; i < end; ++i) {
-/// if ( i == somevalue) {
-/// loop_body
-/// }
-/// }
-/// can be transformed into
-/// if (somevalue >= start && somevalue < end) {
-/// i = somevalue;
-/// loop_body
-/// }
-bool LoopIndexSplit::processOneIterationLoop(SplitInfo &SD) {
-
- BasicBlock *Header = L->getHeader();
-
- // First of all, check if SplitCondition dominates entire loop body
- // or not.
-
- // If SplitCondition is not in loop header then this loop is not suitable
- // for this transformation.
- if (SD.SplitCondition->getParent() != Header)
- return false;
-
- // If loop header includes loop variant instruction operands then
- // this loop may not be eliminated.
- if (!safeHeader(SD, Header))
- return false;
-
- // If Exiting block includes loop variant instructions then this
- // loop may not be eliminated.
- if (!safeExitingBlock(SD, ExitCondition->getParent()))
- return false;
-
- // Filter loops where split condition's false branch is not empty.
- if (ExitCondition->getParent() != Header->getTerminator()->getSuccessor(1))
- return false;
-
- // If split condition is not safe then do not process this loop.
- // For example,
- // for(int i = 0; i < N; i++) {
- // if ( i == XYZ) {
- // A;
- // else
- // B;
- // }
- // C;
- // D;
- // }
- if (!safeSplitCondition(SD))
- return false;
-
- BasicBlock *Latch = L->getLoopLatch();
- BranchInst *BR = dyn_cast<BranchInst>(Latch->getTerminator());
- if (!BR)
- return false;
-
- // Update CFG.
-
- // Replace index variable with split value in loop body. Loop body is executed
- // only when index variable is equal to split value.
- IndVar->replaceAllUsesWith(SD.SplitValue);
-
- // Remove Latch to Header edge.
- BasicBlock *LatchSucc = NULL;
- Header->removePredecessor(Latch);
- for (succ_iterator SI = succ_begin(Latch), E = succ_end(Latch);
- SI != E; ++SI) {
- if (Header != *SI)
- LatchSucc = *SI;
- }
- BR->setUnconditionalDest(LatchSucc);
-
- Instruction *Terminator = Header->getTerminator();
- Value *ExitValue = ExitCondition->getOperand(ExitValueNum);
-
- // Replace split condition in header.
- // Transform
- // SplitCondition : icmp eq i32 IndVar, SplitValue
- // into
- // c1 = icmp uge i32 SplitValue, StartValue
- // c2 = icmp ult i32 SplitValue, ExitValue
- // and i32 c1, c2
- bool SignedPredicate = ExitCondition->isSignedPredicate();
- Instruction *C1 = new ICmpInst(SignedPredicate ?
- ICmpInst::ICMP_SGE : ICmpInst::ICMP_UGE,
- SD.SplitValue, StartValue, "lisplit",
- Terminator);
- Instruction *C2 = new ICmpInst(SignedPredicate ?
- ICmpInst::ICMP_SLT : ICmpInst::ICMP_ULT,
- SD.SplitValue, ExitValue, "lisplit",
- Terminator);
- Instruction *NSplitCond = BinaryOperator::createAnd(C1, C2, "lisplit",
- Terminator);
- SD.SplitCondition->replaceAllUsesWith(NSplitCond);
- SD.SplitCondition->eraseFromParent();
-
- // Now, clear latch block. Remove instructions that are responsible
- // to increment induction variable.
- Instruction *LTerminator = Latch->getTerminator();
- for (BasicBlock::iterator LB = Latch->begin(), LE = Latch->end();
- LB != LE; ) {
- Instruction *I = LB;
- ++LB;
- if (isa<PHINode>(I) || I == LTerminator)
- continue;
-
- if (I == IndVarIncrement)
- I->replaceAllUsesWith(ExitValue);
- else
- I->replaceAllUsesWith(UndefValue::get(I->getType()));
- I->eraseFromParent();
- }
-
- LPM->deleteLoopFromQueue(L);
-
- // Update Dominator Info.
- // Only CFG change done is to remove Latch to Header edge. This
- // does not change dominator tree because Latch did not dominate
- // Header.
- if (DF) {
- DominanceFrontier::iterator HeaderDF = DF->find(Header);
- if (HeaderDF != DF->end())
- DF->removeFromFrontier(HeaderDF, Header);
-
- DominanceFrontier::iterator LatchDF = DF->find(Latch);
- if (LatchDF != DF->end())
- DF->removeFromFrontier(LatchDF, Header);
- }
- return true;
-}
-
-// If loop header includes loop variant instruction operands then
-// this loop can not be eliminated. This is used by processOneIterationLoop().
-bool LoopIndexSplit::safeHeader(SplitInfo &SD, BasicBlock *Header) {
-
- Instruction *Terminator = Header->getTerminator();
- for(BasicBlock::iterator BI = Header->begin(), BE = Header->end();
- BI != BE; ++BI) {
- Instruction *I = BI;
-
- // PHI Nodes are OK.
- if (isa<PHINode>(I))
- continue;
-
- // SplitCondition itself is OK.
- if (I == SD.SplitCondition)
- continue;
-
- // Induction variable is OK.
- if (I == IndVar)
- continue;
-
- // Induction variable increment is OK.
- if (I == IndVarIncrement)
- continue;
-
- // Terminator is also harmless.
- if (I == Terminator)
- continue;
-
- // Otherwise we have a instruction that may not be safe.
- return false;
- }
-
- return true;
-}
-
-// If Exiting block includes loop variant instructions then this
-// loop may not be eliminated. This is used by processOneIterationLoop().
-bool LoopIndexSplit::safeExitingBlock(SplitInfo &SD,
- BasicBlock *ExitingBlock) {
-
- for (BasicBlock::iterator BI = ExitingBlock->begin(),
- BE = ExitingBlock->end(); BI != BE; ++BI) {
- Instruction *I = BI;
-
- // PHI Nodes are OK.
- if (isa<PHINode>(I))
- continue;
-
- // Induction variable increment is OK.
- if (IndVarIncrement && IndVarIncrement == I)
- continue;
-
- // Check if I is induction variable increment instruction.
- if (I->getOpcode() == Instruction::Add) {
-
- Value *Op0 = I->getOperand(0);
- Value *Op1 = I->getOperand(1);
- PHINode *PN = NULL;
- ConstantInt *CI = NULL;
-
- if ((PN = dyn_cast<PHINode>(Op0))) {
- if ((CI = dyn_cast<ConstantInt>(Op1)))
- if (CI->isOne()) {
- if (!IndVarIncrement && PN == IndVar)
- IndVarIncrement = I;
- // else this is another loop induction variable
- continue;
- }
- } else
- if ((PN = dyn_cast<PHINode>(Op1))) {
- if ((CI = dyn_cast<ConstantInt>(Op0)))
- if (CI->isOne()) {
- if (!IndVarIncrement && PN == IndVar)
- IndVarIncrement = I;
- // else this is another loop induction variable
- continue;
- }
- }
- }
-
- // I is an Exit condition if next instruction is block terminator.
- // Exit condition is OK if it compares loop invariant exit value,
- // which is checked below.
- else if (ICmpInst *EC = dyn_cast<ICmpInst>(I)) {
- if (EC == ExitCondition)
- continue;
- }
-
- if (I == ExitingBlock->getTerminator())
- continue;
-
- // Otherwise we have instruction that may not be safe.
- return false;
- }
-
- // We could not find any reason to consider ExitingBlock unsafe.
- return true;
-}
-
-void LoopIndexSplit::updateLoopBounds(ICmpInst *CI) {
-
- Value *V0 = CI->getOperand(0);
- Value *V1 = CI->getOperand(1);
- Value *NV = NULL;
-
- SCEVHandle SH0 = SE->getSCEV(V0);
-
- if (SH0->isLoopInvariant(L))
- NV = V0;
- else
- NV = V1;
-
- if (ExitCondition->getPredicate() == ICmpInst::ICMP_SGT
- || ExitCondition->getPredicate() == ICmpInst::ICMP_UGT
- || ExitCondition->getPredicate() == ICmpInst::ICMP_SGE
- || ExitCondition->getPredicate() == ICmpInst::ICMP_UGE) {
- ExitCondition->swapOperands();
- if (ExitValueNum)
- ExitValueNum = 0;
- else
- ExitValueNum = 1;
- }
-
- Value *NUB = NULL;
- Value *NLB = NULL;
- Value *UB = ExitCondition->getOperand(ExitValueNum);
- const Type *Ty = NV->getType();
- bool Sign = ExitCondition->isSignedPredicate();
- BasicBlock *Preheader = L->getLoopPreheader();
- Instruction *PHTerminator = Preheader->getTerminator();
-
- assert (NV && "Unexpected value");
-
- switch (CI->getPredicate()) {
- case ICmpInst::ICMP_ULE:
- case ICmpInst::ICMP_SLE:
- // for (i = LB; i < UB; ++i)
- // if (i <= NV && ...)
- // LOOP_BODY
- //
- // is transformed into
- // NUB = min (NV+1, UB)
- // for (i = LB; i < NUB ; ++i)
- // LOOP_BODY
- //
- if (ExitCondition->getPredicate() == ICmpInst::ICMP_SLT
- || ExitCondition->getPredicate() == ICmpInst::ICMP_ULT) {
- Value *A = BinaryOperator::createAdd(NV, ConstantInt::get(Ty, 1, Sign),
- "lsplit.add", PHTerminator);
- Value *C = new ICmpInst(Sign ? ICmpInst::ICMP_SLT : ICmpInst::ICMP_ULT,
- A, UB,"lsplit,c", PHTerminator);
- NUB = SelectInst::Create(C, A, UB, "lsplit.nub", PHTerminator);
- }
-
- // for (i = LB; i <= UB; ++i)
- // if (i <= NV && ...)
- // LOOP_BODY
- //
- // is transformed into
- // NUB = min (NV, UB)
- // for (i = LB; i <= NUB ; ++i)
- // LOOP_BODY
- //
- else if (ExitCondition->getPredicate() == ICmpInst::ICMP_SLE
- || ExitCondition->getPredicate() == ICmpInst::ICMP_ULE) {
- Value *C = new ICmpInst(Sign ? ICmpInst::ICMP_SLT : ICmpInst::ICMP_ULT,
- NV, UB, "lsplit.c", PHTerminator);
- NUB = SelectInst::Create(C, NV, UB, "lsplit.nub", PHTerminator);
- }
- break;
- case ICmpInst::ICMP_ULT:
- case ICmpInst::ICMP_SLT:
- // for (i = LB; i < UB; ++i)
- // if (i < NV && ...)
- // LOOP_BODY
- //
- // is transformed into
- // NUB = min (NV, UB)
- // for (i = LB; i < NUB ; ++i)
- // LOOP_BODY
- //
- if (ExitCondition->getPredicate() == ICmpInst::ICMP_SLT
- || ExitCondition->getPredicate() == ICmpInst::ICMP_ULT) {
- Value *C = new ICmpInst(Sign ? ICmpInst::ICMP_SLT : ICmpInst::ICMP_ULT,
- NV, UB, "lsplit.c", PHTerminator);
- NUB = SelectInst::Create(C, NV, UB, "lsplit.nub", PHTerminator);
- }
-
- // for (i = LB; i <= UB; ++i)
- // if (i < NV && ...)
- // LOOP_BODY
- //
- // is transformed into
- // NUB = min (NV -1 , UB)
- // for (i = LB; i <= NUB ; ++i)
- // LOOP_BODY
- //
- else if (ExitCondition->getPredicate() == ICmpInst::ICMP_SLE
- || ExitCondition->getPredicate() == ICmpInst::ICMP_ULE) {
- Value *S = BinaryOperator::createSub(NV, ConstantInt::get(Ty, 1, Sign),
- "lsplit.add", PHTerminator);
- Value *C = new ICmpInst(Sign ? ICmpInst::ICMP_SLT : ICmpInst::ICMP_ULT,
- S, UB, "lsplit.c", PHTerminator);
- NUB = SelectInst::Create(C, S, UB, "lsplit.nub", PHTerminator);
- }
- break;
- case ICmpInst::ICMP_UGE:
- case ICmpInst::ICMP_SGE:
- // for (i = LB; i (< or <=) UB; ++i)
- // if (i >= NV && ...)
- // LOOP_BODY
- //
- // is transformed into
- // NLB = max (NV, LB)
- // for (i = NLB; i (< or <=) UB ; ++i)
- // LOOP_BODY
- //
- {
- Value *C = new ICmpInst(Sign ? ICmpInst::ICMP_SLT : ICmpInst::ICMP_ULT,
- NV, StartValue, "lsplit.c", PHTerminator);
- NLB = SelectInst::Create(C, StartValue, NV, "lsplit.nlb", PHTerminator);
- }
- break;
- case ICmpInst::ICMP_UGT:
- case ICmpInst::ICMP_SGT:
- // for (i = LB; i (< or <=) UB; ++i)
- // if (i > NV && ...)
- // LOOP_BODY
- //
- // is transformed into
- // NLB = max (NV+1, LB)
- // for (i = NLB; i (< or <=) UB ; ++i)
- // LOOP_BODY
- //
- {
- Value *A = BinaryOperator::createAdd(NV, ConstantInt::get(Ty, 1, Sign),
- "lsplit.add", PHTerminator);
- Value *C = new ICmpInst(Sign ? ICmpInst::ICMP_SLT : ICmpInst::ICMP_ULT,
- A, StartValue, "lsplit.c", PHTerminator);
- NLB = SelectInst::Create(C, StartValue, A, "lsplit.nlb", PHTerminator);
- }
- break;
- default:
- assert ( 0 && "Unexpected split condition predicate");
- }
-
- if (NLB) {
- unsigned i = IndVar->getBasicBlockIndex(Preheader);
- IndVar->setIncomingValue(i, NLB);
- }
-
- if (NUB) {
- ExitCondition->setOperand(ExitValueNum, NUB);
- }
-}
-/// updateLoopIterationSpace - Current loop body is covered by an AND
-/// instruction whose operands compares induction variables with loop
-/// invariants. If possible, hoist this check outside the loop by
-/// updating appropriate start and end values for induction variable.
-bool LoopIndexSplit::updateLoopIterationSpace(SplitInfo &SD) {
- BasicBlock *Header = L->getHeader();
- BasicBlock *ExitingBlock = ExitCondition->getParent();
- BasicBlock *SplitCondBlock = SD.SplitCondition->getParent();
-
- ICmpInst *Op0 = cast<ICmpInst>(SD.SplitCondition->getOperand(0));
- ICmpInst *Op1 = cast<ICmpInst>(SD.SplitCondition->getOperand(1));
-
- if (Op0->getPredicate() == ICmpInst::ICMP_EQ
- || Op0->getPredicate() == ICmpInst::ICMP_NE
- || Op0->getPredicate() == ICmpInst::ICMP_EQ
- || Op0->getPredicate() == ICmpInst::ICMP_NE)
- return false;
-
- // Check if SplitCondition dominates entire loop body
- // or not.
-
- // If SplitCondition is not in loop header then this loop is not suitable
- // for this transformation.
- if (SD.SplitCondition->getParent() != Header)
- return false;
-
- // If loop header includes loop variant instruction operands then
- // this loop may not be eliminated.
- Instruction *Terminator = Header->getTerminator();
- for(BasicBlock::iterator BI = Header->begin(), BE = Header->end();
- BI != BE; ++BI) {
- Instruction *I = BI;
-
- // PHI Nodes are OK.
- if (isa<PHINode>(I))
- continue;
-
- // SplitCondition itself is OK.
- if (I == SD.SplitCondition)
- continue;
- if (I == Op0 || I == Op1)
- continue;
-
- // Induction variable is OK.
- if (I == IndVar)
- continue;
-
- // Induction variable increment is OK.
- if (I == IndVarIncrement)
- continue;
-
- // Terminator is also harmless.
- if (I == Terminator)
- continue;
-
- // Otherwise we have a instruction that may not be safe.
- return false;
- }
-
- // If Exiting block includes loop variant instructions then this
- // loop may not be eliminated.
- if (!safeExitingBlock(SD, ExitCondition->getParent()))
- return false;
-
- // Verify that loop exiting block has only two predecessor, where one predecessor
- // is split condition block. The other predecessor will become exiting block's
- // dominator after CFG is updated. TODO : Handle CFG's where exiting block has
- // more then two predecessors. This requires extra work in updating dominator
- // information.
- BasicBlock *ExitingBBPred = NULL;
- for (pred_iterator PI = pred_begin(ExitingBlock), PE = pred_end(ExitingBlock);
- PI != PE; ++PI) {
- BasicBlock *BB = *PI;
- if (SplitCondBlock == BB)
- continue;
- if (ExitingBBPred)
- return false;
- else
- ExitingBBPred = BB;
- }
-
- // Update loop bounds to absorb Op0 check.
- updateLoopBounds(Op0);
- // Update loop bounds to absorb Op1 check.
- updateLoopBounds(Op1);
-
- // Update CFG
-
- // Unconditionally connect split block to its remaining successor.
- BranchInst *SplitTerminator =
- cast<BranchInst>(SplitCondBlock->getTerminator());
- BasicBlock *Succ0 = SplitTerminator->getSuccessor(0);
- BasicBlock *Succ1 = SplitTerminator->getSuccessor(1);
- if (Succ0 == ExitCondition->getParent())
- SplitTerminator->setUnconditionalDest(Succ1);
- else
- SplitTerminator->setUnconditionalDest(Succ0);
-
- // Remove split condition.
- SD.SplitCondition->eraseFromParent();
- if (Op0->use_begin() == Op0->use_end())
- Op0->eraseFromParent();
- if (Op1->use_begin() == Op1->use_end())
- Op1->eraseFromParent();
-
- BranchInst *ExitInsn =
- dyn_cast<BranchInst>(ExitingBlock->getTerminator());
- assert (ExitInsn && "Unable to find suitable loop exit branch");
- BasicBlock *ExitBlock = ExitInsn->getSuccessor(1);
- if (L->contains(ExitBlock))
- ExitBlock = ExitInsn->getSuccessor(0);
-
- // Update domiantor info. Now, ExitingBlock has only one predecessor,
- // ExitingBBPred, and it is ExitingBlock's immediate domiantor.
- DT->changeImmediateDominator(ExitingBlock, ExitingBBPred);
-
- // If ExitingBlock is a member of loop BB's DF list then replace it with
- // loop header and exit block.
- for (Loop::block_iterator I = L->block_begin(), E = L->block_end();
- I != E; ++I) {
- BasicBlock *BB = *I;
- if (BB == Header || BB == ExitingBlock)
- continue;
- DominanceFrontier::iterator BBDF = DF->find(BB);
- DominanceFrontier::DomSetType::iterator DomSetI = BBDF->second.begin();
- DominanceFrontier::DomSetType::iterator DomSetE = BBDF->second.end();
- while (DomSetI != DomSetE) {
- DominanceFrontier::DomSetType::iterator CurrentItr = DomSetI;
- ++DomSetI;
- BasicBlock *DFBB = *CurrentItr;
- if (DFBB == ExitingBlock) {
- BBDF->second.erase(DFBB);
- BBDF->second.insert(Header);
- if (Header != ExitingBlock)
- BBDF->second.insert(ExitBlock);
- }
- }
- }
-
- return true;
-}
-
-
-/// removeBlocks - Remove basic block DeadBB and all blocks dominated by DeadBB.
-/// This routine is used to remove split condition's dead branch, dominated by
-/// DeadBB. LiveBB dominates split conidition's other branch.
-void LoopIndexSplit::removeBlocks(BasicBlock *DeadBB, Loop *LP,
- BasicBlock *LiveBB) {
-
- // First update DeadBB's dominance frontier.
- SmallVector<BasicBlock *, 8> FrontierBBs;
- DominanceFrontier::iterator DeadBBDF = DF->find(DeadBB);
- if (DeadBBDF != DF->end()) {
- SmallVector<BasicBlock *, 8> PredBlocks;
-
- DominanceFrontier::DomSetType DeadBBSet = DeadBBDF->second;
- for (DominanceFrontier::DomSetType::iterator DeadBBSetI = DeadBBSet.begin(),
- DeadBBSetE = DeadBBSet.end(); DeadBBSetI != DeadBBSetE; ++DeadBBSetI) {
- BasicBlock *FrontierBB = *DeadBBSetI;
- FrontierBBs.push_back(FrontierBB);
-
- // Rremove any PHI incoming edge from blocks dominated by DeadBB.
- PredBlocks.clear();
- for(pred_iterator PI = pred_begin(FrontierBB), PE = pred_end(FrontierBB);
- PI != PE; ++PI) {
- BasicBlock *P = *PI;
- if (P == DeadBB || DT->dominates(DeadBB, P))
- PredBlocks.push_back(P);
- }
-
- for(BasicBlock::iterator FBI = FrontierBB->begin(), FBE = FrontierBB->end();
- FBI != FBE; ++FBI) {
- if (PHINode *PN = dyn_cast<PHINode>(FBI)) {
- for(SmallVector<BasicBlock *, 8>::iterator PI = PredBlocks.begin(),
- PE = PredBlocks.end(); PI != PE; ++PI) {
- BasicBlock *P = *PI;
- PN->removeIncomingValue(P);
- }
- }
- else
- break;
- }
- }
- }
-
- // Now remove DeadBB and all nodes dominated by DeadBB in df order.
- SmallVector<BasicBlock *, 32> WorkList;
- DomTreeNode *DN = DT->getNode(DeadBB);
- for (df_iterator<DomTreeNode*> DI = df_begin(DN),
- E = df_end(DN); DI != E; ++DI) {
- BasicBlock *BB = DI->getBlock();
- WorkList.push_back(BB);
- BB->replaceAllUsesWith(UndefValue::get(Type::LabelTy));
- }
-
- while (!WorkList.empty()) {
- BasicBlock *BB = WorkList.back(); WorkList.pop_back();
- for(BasicBlock::iterator BBI = BB->begin(), BBE = BB->end();
- BBI != BBE; ) {
- Instruction *I = BBI;
- ++BBI;
- I->replaceAllUsesWith(UndefValue::get(I->getType()));
- I->eraseFromParent();
- }
- LPM->deleteSimpleAnalysisValue(BB, LP);
- DT->eraseNode(BB);
- DF->removeBlock(BB);
- LI->removeBlock(BB);
- BB->eraseFromParent();
- }
-
- // Update Frontier BBs' dominator info.
- while (!FrontierBBs.empty()) {
- BasicBlock *FBB = FrontierBBs.back(); FrontierBBs.pop_back();
- BasicBlock *NewDominator = FBB->getSinglePredecessor();
- if (!NewDominator) {
- pred_iterator PI = pred_begin(FBB), PE = pred_end(FBB);
- NewDominator = *PI;
- ++PI;
- if (NewDominator != LiveBB) {
- for(; PI != PE; ++PI) {
- BasicBlock *P = *PI;
- if (P == LiveBB) {
- NewDominator = LiveBB;
- break;
- }
- NewDominator = DT->findNearestCommonDominator(NewDominator, P);
- }
- }
- }
- assert (NewDominator && "Unable to fix dominator info.");
- DT->changeImmediateDominator(FBB, NewDominator);
- DF->changeImmediateDominator(FBB, NewDominator, DT);
- }
-
-}
-
-/// safeSplitCondition - Return true if it is possible to
-/// split loop using given split condition.
-bool LoopIndexSplit::safeSplitCondition(SplitInfo &SD) {
-
- BasicBlock *SplitCondBlock = SD.SplitCondition->getParent();
- BasicBlock *Latch = L->getLoopLatch();
- BranchInst *SplitTerminator =
- cast<BranchInst>(SplitCondBlock->getTerminator());
- BasicBlock *Succ0 = SplitTerminator->getSuccessor(0);
- BasicBlock *Succ1 = SplitTerminator->getSuccessor(1);
-
- // If split block does not dominate the latch then this is not a diamond.
- // Such loop may not benefit from index split.
- if (!DT->dominates(SplitCondBlock, Latch))
- return false;
-
- // Finally this split condition is safe only if merge point for
- // split condition branch is loop latch. This check along with previous
- // check, to ensure that exit condition is in either loop latch or header,
- // filters all loops with non-empty loop body between merge point
- // and exit condition.
- DominanceFrontier::iterator Succ0DF = DF->find(Succ0);
- assert (Succ0DF != DF->end() && "Unable to find Succ0 dominance frontier");
- if (Succ0DF->second.count(Latch))
- return true;
-
- DominanceFrontier::iterator Succ1DF = DF->find(Succ1);
- assert (Succ1DF != DF->end() && "Unable to find Succ1 dominance frontier");
- if (Succ1DF->second.count(Latch))
- return true;
-
- return false;
-}
-
-/// calculateLoopBounds - ALoop exit value and BLoop start values are calculated
-/// based on split value.
-void LoopIndexSplit::calculateLoopBounds(SplitInfo &SD) {
-
- ICmpInst *SC = cast<ICmpInst>(SD.SplitCondition);
- ICmpInst::Predicate SP = SC->getPredicate();
- const Type *Ty = SD.SplitValue->getType();
- bool Sign = ExitCondition->isSignedPredicate();
- BasicBlock *Preheader = L->getLoopPreheader();
- Instruction *PHTerminator = Preheader->getTerminator();
-
- // Initially use split value as upper loop bound for first loop and lower loop
- // bound for second loop.
- Value *AEV = SD.SplitValue;
- Value *BSV = SD.SplitValue;
-
- if (ExitCondition->getPredicate() == ICmpInst::ICMP_SGT
- || ExitCondition->getPredicate() == ICmpInst::ICMP_UGT
- || ExitCondition->getPredicate() == ICmpInst::ICMP_SGE
- || ExitCondition->getPredicate() == ICmpInst::ICMP_UGE) {
- ExitCondition->swapOperands();
- if (ExitValueNum)
- ExitValueNum = 0;
- else
- ExitValueNum = 1;
- }
-
- switch (ExitCondition->getPredicate()) {
- case ICmpInst::ICMP_SGT:
- case ICmpInst::ICMP_UGT:
- case ICmpInst::ICMP_SGE:
- case ICmpInst::ICMP_UGE:
- default:
- assert (0 && "Unexpected exit condition predicate");
-
- case ICmpInst::ICMP_SLT:
- case ICmpInst::ICMP_ULT:
- {
- switch (SP) {
- case ICmpInst::ICMP_SLT:
- case ICmpInst::ICMP_ULT:
- //
- // for (i = LB; i < UB; ++i) { if (i < SV) A; else B; }
- //
- // is transformed into
- // AEV = BSV = SV
- // for (i = LB; i < min(UB, AEV); ++i)
- // A;
- // for (i = max(LB, BSV); i < UB; ++i);
- // B;
- break;
- case ICmpInst::ICMP_SLE:
- case ICmpInst::ICMP_ULE:
- {
- //
- // for (i = LB; i < UB; ++i) { if (i <= SV) A; else B; }
- //
- // is transformed into
- //
- // AEV = SV + 1
- // BSV = SV + 1
- // for (i = LB; i < min(UB, AEV); ++i)
- // A;
- // for (i = max(LB, BSV); i < UB; ++i)
- // B;
- BSV = BinaryOperator::createAdd(SD.SplitValue,
- ConstantInt::get(Ty, 1, Sign),
- "lsplit.add", PHTerminator);
- AEV = BSV;
- }
- break;
- case ICmpInst::ICMP_SGE:
- case ICmpInst::ICMP_UGE:
- //
- // for (i = LB; i < UB; ++i) { if (i >= SV) A; else B; }
- //
- // is transformed into
- // AEV = BSV = SV
- // for (i = LB; i < min(UB, AEV); ++i)
- // B;
- // for (i = max(BSV, LB); i < UB; ++i)
- // A;
- break;
- case ICmpInst::ICMP_SGT:
- case ICmpInst::ICMP_UGT:
- {
- //
- // for (i = LB; i < UB; ++i) { if (i > SV) A; else B; }
- //
- // is transformed into
- //
- // BSV = AEV = SV + 1
- // for (i = LB; i < min(UB, AEV); ++i)
- // B;
- // for (i = max(LB, BSV); i < UB; ++i)
- // A;
- BSV = BinaryOperator::createAdd(SD.SplitValue,
- ConstantInt::get(Ty, 1, Sign),
- "lsplit.add", PHTerminator);
- AEV = BSV;
- }
- break;
- default:
- assert (0 && "Unexpected split condition predicate");
- break;
- } // end switch (SP)
- }
- break;
- case ICmpInst::ICMP_SLE:
- case ICmpInst::ICMP_ULE:
- {
- switch (SP) {
- case ICmpInst::ICMP_SLT:
- case ICmpInst::ICMP_ULT:
- //
- // for (i = LB; i <= UB; ++i) { if (i < SV) A; else B; }
- //
- // is transformed into
- // AEV = SV - 1;
- // BSV = SV;
- // for (i = LB; i <= min(UB, AEV); ++i)
- // A;
- // for (i = max(LB, BSV); i <= UB; ++i)
- // B;
- AEV = BinaryOperator::createSub(SD.SplitValue,
- ConstantInt::get(Ty, 1, Sign),
- "lsplit.sub", PHTerminator);
- break;
- case ICmpInst::ICMP_SLE:
- case ICmpInst::ICMP_ULE:
- //
- // for (i = LB; i <= UB; ++i) { if (i <= SV) A; else B; }
- //
- // is transformed into
- // AEV = SV;
- // BSV = SV + 1;
- // for (i = LB; i <= min(UB, AEV); ++i)
- // A;
- // for (i = max(LB, BSV); i <= UB; ++i)
- // B;
- BSV = BinaryOperator::createAdd(SD.SplitValue,
- ConstantInt::get(Ty, 1, Sign),
- "lsplit.add", PHTerminator);
- break;
- case ICmpInst::ICMP_SGT:
- case ICmpInst::ICMP_UGT:
- //
- // for (i = LB; i <= UB; ++i) { if (i > SV) A; else B; }
- //
- // is transformed into
- // AEV = SV;
- // BSV = SV + 1;
- // for (i = LB; i <= min(AEV, UB); ++i)
- // B;
- // for (i = max(LB, BSV); i <= UB; ++i)
- // A;
- BSV = BinaryOperator::createAdd(SD.SplitValue,
- ConstantInt::get(Ty, 1, Sign),
- "lsplit.add", PHTerminator);
- break;
- case ICmpInst::ICMP_SGE:
- case ICmpInst::ICMP_UGE:
- // ** TODO **
- //
- // for (i = LB; i <= UB; ++i) { if (i >= SV) A; else B; }
- //
- // is transformed into
- // AEV = SV - 1;
- // BSV = SV;
- // for (i = LB; i <= min(AEV, UB); ++i)
- // B;
- // for (i = max(LB, BSV); i <= UB; ++i)
- // A;
- AEV = BinaryOperator::createSub(SD.SplitValue,
- ConstantInt::get(Ty, 1, Sign),
- "lsplit.sub", PHTerminator);
- break;
- default:
- assert (0 && "Unexpected split condition predicate");
- break;
- } // end switch (SP)
- }
- break;
- }
-
- // Calculate ALoop induction variable's new exiting value and
- // BLoop induction variable's new starting value. Calculuate these
- // values in original loop's preheader.
- // A_ExitValue = min(SplitValue, OrignalLoopExitValue)
- // B_StartValue = max(SplitValue, OriginalLoopStartValue)
- Instruction *InsertPt = L->getHeader()->getFirstNonPHI();
-
- // If ExitValue operand is also defined in Loop header then
- // insert new ExitValue after this operand definition.
- if (Instruction *EVN =
- dyn_cast<Instruction>(ExitCondition->getOperand(ExitValueNum))) {
- if (!isa<PHINode>(EVN))
- if (InsertPt->getParent() == EVN->getParent()) {
- BasicBlock::iterator LHBI = L->getHeader()->begin();
- BasicBlock::iterator LHBE = L->getHeader()->end();
- for(;LHBI != LHBE; ++LHBI) {
- Instruction *I = LHBI;
- if (I == EVN)
- break;
- }
- InsertPt = ++LHBI;
- }
- }
- Value *C1 = new ICmpInst(Sign ?
- ICmpInst::ICMP_SLT : ICmpInst::ICMP_ULT,
- AEV,
- ExitCondition->getOperand(ExitValueNum),
- "lsplit.ev", InsertPt);
-
- SD.A_ExitValue = SelectInst::Create(C1, AEV,
- ExitCondition->getOperand(ExitValueNum),
- "lsplit.ev", InsertPt);
-
- Value *C2 = new ICmpInst(Sign ?
- ICmpInst::ICMP_SLT : ICmpInst::ICMP_ULT,
- BSV, StartValue, "lsplit.sv",
- PHTerminator);
- SD.B_StartValue = SelectInst::Create(C2, StartValue, BSV,
- "lsplit.sv", PHTerminator);
-}
-
-/// splitLoop - Split current loop L in two loops using split information
-/// SD. Update dominator information. Maintain LCSSA form.
-bool LoopIndexSplit::splitLoop(SplitInfo &SD) {
-
- if (!safeSplitCondition(SD))
- return false;
-
- BasicBlock *SplitCondBlock = SD.SplitCondition->getParent();
-
- // Unable to handle triange loops at the moment.
- // In triangle loop, split condition is in header and one of the
- // the split destination is loop latch. If split condition is EQ
- // then such loops are already handle in processOneIterationLoop().
- BasicBlock *Latch = L->getLoopLatch();
- BranchInst *SplitTerminator =
- cast<BranchInst>(SplitCondBlock->getTerminator());
- BasicBlock *Succ0 = SplitTerminator->getSuccessor(0);
- BasicBlock *Succ1 = SplitTerminator->getSuccessor(1);
- if (L->getHeader() == SplitCondBlock
- && (Latch == Succ0 || Latch == Succ1))
- return false;
-
- // If split condition branches heads do not have single predecessor,
- // SplitCondBlock, then is not possible to remove inactive branch.
- if (!Succ0->getSinglePredecessor() || !Succ1->getSinglePredecessor())
- return false;
-
- // If Exiting block includes loop variant instructions then this
- // loop may not be split safely.
- if (!safeExitingBlock(SD, ExitCondition->getParent()))
- return false;
-
- // After loop is cloned there are two loops.
- //
- // First loop, referred as ALoop, executes first part of loop's iteration
- // space split. Second loop, referred as BLoop, executes remaining
- // part of loop's iteration space.
- //
- // ALoop's exit edge enters BLoop's header through a forwarding block which
- // acts as a BLoop's preheader.
- BasicBlock *Preheader = L->getLoopPreheader();
-
- // Calculate ALoop induction variable's new exiting value and
- // BLoop induction variable's new starting value.
- calculateLoopBounds(SD);
-
- //[*] Clone loop.
- DenseMap<const Value *, Value *> ValueMap;
- Loop *BLoop = CloneLoop(L, LPM, LI, ValueMap, this);
- Loop *ALoop = L;
- BasicBlock *B_Header = BLoop->getHeader();
-
- //[*] ALoop's exiting edge BLoop's header.
- // ALoop's original exit block becomes BLoop's exit block.
- PHINode *B_IndVar = cast<PHINode>(ValueMap[IndVar]);
- BasicBlock *A_ExitingBlock = ExitCondition->getParent();
- BranchInst *A_ExitInsn =
- dyn_cast<BranchInst>(A_ExitingBlock->getTerminator());
- assert (A_ExitInsn && "Unable to find suitable loop exit branch");
- BasicBlock *B_ExitBlock = A_ExitInsn->getSuccessor(1);
- if (L->contains(B_ExitBlock)) {
- B_ExitBlock = A_ExitInsn->getSuccessor(0);
- A_ExitInsn->setSuccessor(0, B_Header);
- } else
- A_ExitInsn->setSuccessor(1, B_Header);
-
- //[*] Update ALoop's exit value using new exit value.
- ExitCondition->setOperand(ExitValueNum, SD.A_ExitValue);
-
- // [*] Update BLoop's header phi nodes. Remove incoming PHINode's from
- // original loop's preheader. Add incoming PHINode values from
- // ALoop's exiting block. Update BLoop header's domiantor info.
-
- // Collect inverse map of Header PHINodes.
- DenseMap<Value *, Value *> InverseMap;
- for (BasicBlock::iterator BI = L->getHeader()->begin(),
- BE = L->getHeader()->end(); BI != BE; ++BI) {
- if (PHINode *PN = dyn_cast<PHINode>(BI)) {
- PHINode *PNClone = cast<PHINode>(ValueMap[PN]);
- InverseMap[PNClone] = PN;
- } else
- break;
- }
-
- for (BasicBlock::iterator BI = B_Header->begin(), BE = B_Header->end();
- BI != BE; ++BI) {
- if (PHINode *PN = dyn_cast<PHINode>(BI)) {
- // Remove incoming value from original preheader.
- PN->removeIncomingValue(Preheader);
-
- // Add incoming value from A_ExitingBlock.
- if (PN == B_IndVar)
- PN->addIncoming(SD.B_StartValue, A_ExitingBlock);
- else {
- PHINode *OrigPN = cast<PHINode>(InverseMap[PN]);
- Value *V2 = NULL;
- // If loop header is also loop exiting block then
- // OrigPN is incoming value for B loop header.
- if (A_ExitingBlock == L->getHeader())
- V2 = OrigPN;
- else
- V2 = OrigPN->getIncomingValueForBlock(A_ExitingBlock);
- PN->addIncoming(V2, A_ExitingBlock);
- }
- } else
- break;
- }
- DT->changeImmediateDominator(B_Header, A_ExitingBlock);
- DF->changeImmediateDominator(B_Header, A_ExitingBlock, DT);
-
- // [*] Update BLoop's exit block. Its new predecessor is BLoop's exit
- // block. Remove incoming PHINode values from ALoop's exiting block.
- // Add new incoming values from BLoop's incoming exiting value.
- // Update BLoop exit block's dominator info..
- BasicBlock *B_ExitingBlock = cast<BasicBlock>(ValueMap[A_ExitingBlock]);
- for (BasicBlock::iterator BI = B_ExitBlock->begin(), BE = B_ExitBlock->end();
- BI != BE; ++BI) {
- if (PHINode *PN = dyn_cast<PHINode>(BI)) {
- PN->addIncoming(ValueMap[PN->getIncomingValueForBlock(A_ExitingBlock)],
- B_ExitingBlock);
- PN->removeIncomingValue(A_ExitingBlock);
- } else
- break;
- }
-
- DT->changeImmediateDominator(B_ExitBlock, B_ExitingBlock);
- DF->changeImmediateDominator(B_ExitBlock, B_ExitingBlock, DT);
-
- //[*] Split ALoop's exit edge. This creates a new block which
- // serves two purposes. First one is to hold PHINode defnitions
- // to ensure that ALoop's LCSSA form. Second use it to act
- // as a preheader for BLoop.
- BasicBlock *A_ExitBlock = SplitEdge(A_ExitingBlock, B_Header, this);
-
- //[*] Preserve ALoop's LCSSA form. Create new forwarding PHINodes
- // in A_ExitBlock to redefine outgoing PHI definitions from ALoop.
- for(BasicBlock::iterator BI = B_Header->begin(), BE = B_Header->end();
- BI != BE; ++BI) {
- if (PHINode *PN = dyn_cast<PHINode>(BI)) {
- Value *V1 = PN->getIncomingValueForBlock(A_ExitBlock);
- PHINode *newPHI = PHINode::Create(PN->getType(), PN->getName());
- newPHI->addIncoming(V1, A_ExitingBlock);
- A_ExitBlock->getInstList().push_front(newPHI);
- PN->removeIncomingValue(A_ExitBlock);
- PN->addIncoming(newPHI, A_ExitBlock);
- } else
- break;
- }
-
- //[*] Eliminate split condition's inactive branch from ALoop.
- BasicBlock *A_SplitCondBlock = SD.SplitCondition->getParent();
- BranchInst *A_BR = cast<BranchInst>(A_SplitCondBlock->getTerminator());
- BasicBlock *A_InactiveBranch = NULL;
- BasicBlock *A_ActiveBranch = NULL;
- if (SD.UseTrueBranchFirst) {
- A_ActiveBranch = A_BR->getSuccessor(0);
- A_InactiveBranch = A_BR->getSuccessor(1);
- } else {
- A_ActiveBranch = A_BR->getSuccessor(1);
- A_InactiveBranch = A_BR->getSuccessor(0);
- }
- A_BR->setUnconditionalDest(A_ActiveBranch);
- removeBlocks(A_InactiveBranch, L, A_ActiveBranch);
-
- //[*] Eliminate split condition's inactive branch in from BLoop.
- BasicBlock *B_SplitCondBlock = cast<BasicBlock>(ValueMap[A_SplitCondBlock]);
- BranchInst *B_BR = cast<BranchInst>(B_SplitCondBlock->getTerminator());
- BasicBlock *B_InactiveBranch = NULL;
- BasicBlock *B_ActiveBranch = NULL;
- if (SD.UseTrueBranchFirst) {
- B_ActiveBranch = B_BR->getSuccessor(1);
- B_InactiveBranch = B_BR->getSuccessor(0);
- } else {
- B_ActiveBranch = B_BR->getSuccessor(0);
- B_InactiveBranch = B_BR->getSuccessor(1);
- }
- B_BR->setUnconditionalDest(B_ActiveBranch);
- removeBlocks(B_InactiveBranch, BLoop, B_ActiveBranch);
-
- BasicBlock *A_Header = L->getHeader();
- if (A_ExitingBlock == A_Header)
- return true;
-
- //[*] Move exit condition into split condition block to avoid
- // executing dead loop iteration.
- ICmpInst *B_ExitCondition = cast<ICmpInst>(ValueMap[ExitCondition]);
- Instruction *B_IndVarIncrement = cast<Instruction>(ValueMap[IndVarIncrement]);
- ICmpInst *B_SplitCondition = cast<ICmpInst>(ValueMap[SD.SplitCondition]);
-
- moveExitCondition(A_SplitCondBlock, A_ActiveBranch, A_ExitBlock, ExitCondition,
- cast<ICmpInst>(SD.SplitCondition), IndVar, IndVarIncrement,
- ALoop);
-
- moveExitCondition(B_SplitCondBlock, B_ActiveBranch, B_ExitBlock, B_ExitCondition,
- B_SplitCondition, B_IndVar, B_IndVarIncrement, BLoop);
-
- return true;
-}
-
-// moveExitCondition - Move exit condition EC into split condition block CondBB.
-void LoopIndexSplit::moveExitCondition(BasicBlock *CondBB, BasicBlock *ActiveBB,
- BasicBlock *ExitBB, ICmpInst *EC, ICmpInst *SC,
- PHINode *IV, Instruction *IVAdd, Loop *LP) {
-
- BasicBlock *ExitingBB = EC->getParent();
- Instruction *CurrentBR = CondBB->getTerminator();
-
- // Move exit condition into split condition block.
- EC->moveBefore(CurrentBR);
- EC->setOperand(ExitValueNum == 0 ? 1 : 0, IV);
-
- // Move exiting block's branch into split condition block. Update its branch
- // destination.
- BranchInst *ExitingBR = cast<BranchInst>(ExitingBB->getTerminator());
- ExitingBR->moveBefore(CurrentBR);
- BasicBlock *OrigDestBB = NULL;
- if (ExitingBR->getSuccessor(0) == ExitBB) {
- OrigDestBB = ExitingBR->getSuccessor(1);
- ExitingBR->setSuccessor(1, ActiveBB);
- }
- else {
- OrigDestBB = ExitingBR->getSuccessor(0);
- ExitingBR->setSuccessor(0, ActiveBB);
- }
-
- // Remove split condition and current split condition branch.
- SC->eraseFromParent();
- CurrentBR->eraseFromParent();
-
- // Connect exiting block to original destination.
- BranchInst::Create(OrigDestBB, ExitingBB);
-
- // Update PHINodes
- updatePHINodes(ExitBB, ExitingBB, CondBB, IV, IVAdd, LP);
-
- // Fix dominator info.
- // ExitBB is now dominated by CondBB
- DT->changeImmediateDominator(ExitBB, CondBB);
- DF->changeImmediateDominator(ExitBB, CondBB, DT);
-
- // Basicblocks dominated by ActiveBB may have ExitingBB or
- // a basic block outside the loop in their DF list. If so,
- // replace it with CondBB.
- DomTreeNode *Node = DT->getNode(ActiveBB);
- for (df_iterator<DomTreeNode *> DI = df_begin(Node), DE = df_end(Node);
- DI != DE; ++DI) {
- BasicBlock *BB = DI->getBlock();
- DominanceFrontier::iterator BBDF = DF->find(BB);
- DominanceFrontier::DomSetType::iterator DomSetI = BBDF->second.begin();
- DominanceFrontier::DomSetType::iterator DomSetE = BBDF->second.end();
- while (DomSetI != DomSetE) {
- DominanceFrontier::DomSetType::iterator CurrentItr = DomSetI;
- ++DomSetI;
- BasicBlock *DFBB = *CurrentItr;
- if (DFBB == ExitingBB || !L->contains(DFBB)) {
- BBDF->second.erase(DFBB);
- BBDF->second.insert(CondBB);
- }
- }
- }
-}
-
-/// updatePHINodes - CFG has been changed.
-/// Before
-/// - ExitBB's single predecessor was Latch
-/// - Latch's second successor was Header
-/// Now
-/// - ExitBB's single predecessor is Header
-/// - Latch's one and only successor is Header
-///
-/// Update ExitBB PHINodes' to reflect this change.
-void LoopIndexSplit::updatePHINodes(BasicBlock *ExitBB, BasicBlock *Latch,
- BasicBlock *Header,
- PHINode *IV, Instruction *IVIncrement,
- Loop *LP) {
-
- for (BasicBlock::iterator BI = ExitBB->begin(), BE = ExitBB->end();
- BI != BE; ) {
- PHINode *PN = dyn_cast<PHINode>(BI);
- ++BI;
- if (!PN)
- break;
-
- Value *V = PN->getIncomingValueForBlock(Latch);
- if (PHINode *PHV = dyn_cast<PHINode>(V)) {
- // PHV is in Latch. PHV has one use is in ExitBB PHINode. And one use
- // in Header which is new incoming value for PN.
- Value *NewV = NULL;
- for (Value::use_iterator UI = PHV->use_begin(), E = PHV->use_end();
- UI != E; ++UI)
- if (PHINode *U = dyn_cast<PHINode>(*UI))
- if (LP->contains(U->getParent())) {
- NewV = U;
- break;
- }
-
- // Add incoming value from header only if PN has any use inside the loop.
- if (NewV)
- PN->addIncoming(NewV, Header);
-
- } else if (Instruction *PHI = dyn_cast<Instruction>(V)) {
- // If this instruction is IVIncrement then IV is new incoming value
- // from header otherwise this instruction must be incoming value from
- // header because loop is in LCSSA form.
- if (PHI == IVIncrement)
- PN->addIncoming(IV, Header);
- else
- PN->addIncoming(V, Header);
- } else
- // Otherwise this is an incoming value from header because loop is in
- // LCSSA form.
- PN->addIncoming(V, Header);
-
- // Remove incoming value from Latch.
- PN->removeIncomingValue(Latch);
- }
-}
diff --git a/release_23/lib/Transforms/Scalar/LoopRotation.cpp b/release_23/lib/Transforms/Scalar/LoopRotation.cpp
deleted file mode 100644
index 91a96bcedacd..000000000000
--- a/release_23/lib/Transforms/Scalar/LoopRotation.cpp
+++ /dev/null
@@ -1,605 +0,0 @@
-//===- LoopRotation.cpp - Loop Rotation Pass ------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements Loop Rotation Pass.
-//
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "loop-rotate"
-
-#include "llvm/Transforms/Scalar.h"
-#include "llvm/Function.h"
-#include "llvm/Instructions.h"
-#include "llvm/Analysis/LoopInfo.h"
-#include "llvm/Analysis/LoopPass.h"
-#include "llvm/Analysis/Dominators.h"
-#include "llvm/Analysis/ScalarEvolution.h"
-#include "llvm/Transforms/Utils/Local.h"
-#include "llvm/Transforms/Utils/BasicBlockUtils.h"
-#include "llvm/Support/CommandLine.h"
-#include "llvm/Support/Debug.h"
-#include "llvm/ADT/Statistic.h"
-#include "llvm/ADT/SmallVector.h"
-
-using namespace llvm;
-
-#define MAX_HEADER_SIZE 16
-
-STATISTIC(NumRotated, "Number of loops rotated");
-namespace {
-
- class VISIBILITY_HIDDEN RenameData {
- public:
- RenameData(Instruction *O, Value *P, Instruction *H)
- : Original(O), PreHeader(P), Header(H) { }
- public:
- Instruction *Original; // Original instruction
- Value *PreHeader; // Original pre-header replacement
- Instruction *Header; // New header replacement
- };
-
- class VISIBILITY_HIDDEN LoopRotate : public LoopPass {
-
- public:
- static char ID; // Pass ID, replacement for typeid
- LoopRotate() : LoopPass((intptr_t)&ID) {}
-
- // Rotate Loop L as many times as possible. Return true if
- // loop is rotated at least once.
- bool runOnLoop(Loop *L, LPPassManager &LPM);
-
- // LCSSA form makes instruction renaming easier.
- virtual void getAnalysisUsage(AnalysisUsage &AU) const {
- AU.addRequiredID(LoopSimplifyID);
- AU.addPreservedID(LoopSimplifyID);
- AU.addRequiredID(LCSSAID);
- AU.addPreservedID(LCSSAID);
- AU.addPreserved<ScalarEvolution>();
- AU.addPreserved<LoopInfo>();
- AU.addPreserved<DominatorTree>();
- AU.addPreserved<DominanceFrontier>();
- }
-
- // Helper functions
-
- /// Do actual work
- bool rotateLoop(Loop *L, LPPassManager &LPM);
-
- /// Initialize local data
- void initialize();
-
- /// Make sure all Exit block PHINodes have required incoming values.
- /// If incoming value is constant or defined outside the loop then
- /// PHINode may not have an entry for original pre-header.
- void updateExitBlock();
-
- /// Return true if this instruction is used outside original header.
- bool usedOutsideOriginalHeader(Instruction *In);
-
- /// Find Replacement information for instruction. Return NULL if it is
- /// not available.
- const RenameData *findReplacementData(Instruction *I);
-
- /// After loop rotation, loop pre-header has multiple sucessors.
- /// Insert one forwarding basic block to ensure that loop pre-header
- /// has only one successor.
- void preserveCanonicalLoopForm(LPPassManager &LPM);
-
- private:
-
- Loop *L;
- BasicBlock *OrigHeader;
- BasicBlock *OrigPreHeader;
- BasicBlock *OrigLatch;
- BasicBlock *NewHeader;
- BasicBlock *Exit;
- LPPassManager *LPM_Ptr;
- SmallVector<RenameData, MAX_HEADER_SIZE> LoopHeaderInfo;
- };
-
- char LoopRotate::ID = 0;
- RegisterPass<LoopRotate> X ("loop-rotate", "Rotate Loops");
-}
-
-LoopPass *llvm::createLoopRotatePass() { return new LoopRotate(); }
-
-/// Rotate Loop L as many times as possible. Return true if
-/// loop is rotated at least once.
-bool LoopRotate::runOnLoop(Loop *Lp, LPPassManager &LPM) {
-
- bool RotatedOneLoop = false;
- initialize();
- LPM_Ptr = &LPM;
-
- // One loop can be rotated multiple times.
- while (rotateLoop(Lp,LPM)) {
- RotatedOneLoop = true;
- initialize();
- }
-
- return RotatedOneLoop;
-}
-
-/// Rotate loop LP. Return true if the loop is rotated.
-bool LoopRotate::rotateLoop(Loop *Lp, LPPassManager &LPM) {
-
- L = Lp;
-
- OrigHeader = L->getHeader();
- OrigPreHeader = L->getLoopPreheader();
- OrigLatch = L->getLoopLatch();
-
- // If loop has only one block then there is not much to rotate.
- if (L->getBlocks().size() == 1)
- return false;
-
- assert (OrigHeader && OrigLatch && OrigPreHeader &&
- "Loop is not in canonical form");
-
- // If loop header is not one of the loop exit block then
- // either this loop is already rotated or it is not
- // suitable for loop rotation transformations.
- if (!L->isLoopExit(OrigHeader))
- return false;
-
- BranchInst *BI = dyn_cast<BranchInst>(OrigHeader->getTerminator());
- if (!BI)
- return false;
- assert (BI->isConditional() && "Branch Instruction is not conditional");
-
- // Updating PHInodes in loops with multiple exits adds complexity.
- // Keep it simple, and restrict loop rotation to loops with one exit only.
- // In future, lift this restriction and support for multiple exits if
- // required.
- SmallVector<BasicBlock*, 8> ExitBlocks;
- L->getExitBlocks(ExitBlocks);
- if (ExitBlocks.size() > 1)
- return false;
-
- // Check size of original header and reject
- // loop if it is very big.
- if (OrigHeader->getInstList().size() > MAX_HEADER_SIZE)
- return false;
-
- // Now, this loop is suitable for rotation.
-
- // Find new Loop header. NewHeader is a Header's one and only successor
- // that is inside loop. Header's other successor is out side the
- // loop. Otherwise loop is not suitable for rotation.
- Exit = BI->getSuccessor(0);
- NewHeader = BI->getSuccessor(1);
- if (L->contains(Exit))
- std::swap(Exit, NewHeader);
- assert (NewHeader && "Unable to determine new loop header");
- assert(L->contains(NewHeader) && !L->contains(Exit) &&
- "Unable to determine loop header and exit blocks");
-
- // Copy PHI nodes and other instructions from original header
- // into original pre-header. Unlike original header, original pre-header is
- // not a member of loop.
- //
- // New loop header is one and only successor of original header that
- // is inside the loop. All other original header successors are outside
- // the loop. Copy PHI Nodes from original header into new loop header.
- // Add second incoming value, from original loop pre-header into these phi
- // nodes. If a value defined in original header is used outside original
- // header then new loop header will need new phi nodes with two incoming
- // values, one definition from original header and second definition is
- // from original loop pre-header.
-
- // Remove terminator from Original pre-header. Original pre-header will
- // receive a clone of original header terminator as a new terminator.
- OrigPreHeader->getInstList().pop_back();
- BasicBlock::iterator I = OrigHeader->begin(), E = OrigHeader->end();
- PHINode *PN = NULL;
- for (; (PN = dyn_cast<PHINode>(I)); ++I) {
- Instruction *In = I;
-
- // PHI nodes are not copied into original pre-header. Instead their values
- // are directly propagated.
- Value * NPV = PN->getIncomingValueForBlock(OrigPreHeader);
-
- // Create new PHI node with two incoming values for NewHeader.
- // One incoming value is from OrigLatch (through OrigHeader) and
- // second incoming value is from original pre-header.
- PHINode *NH = PHINode::Create(In->getType(), In->getName());
- NH->addIncoming(PN->getIncomingValueForBlock(OrigLatch), OrigHeader);
- NH->addIncoming(NPV, OrigPreHeader);
- NewHeader->getInstList().push_front(NH);
-
- // "In" can be replaced by NH at various places.
- LoopHeaderInfo.push_back(RenameData(In, NPV, NH));
- }
-
- // Now, handle non-phi instructions.
- for (; I != E; ++I) {
- Instruction *In = I;
-
- assert (!isa<PHINode>(In) && "PHINode is not expected here");
- // This is not a PHI instruction. Insert its clone into original pre-header.
- // If this instruction is using a value from same basic block then
- // update it to use value from cloned instruction.
- Instruction *C = In->clone();
- C->setName(In->getName());
- OrigPreHeader->getInstList().push_back(C);
-
- for (unsigned opi = 0, e = In->getNumOperands(); opi != e; ++opi) {
- if (Instruction *OpPhi = dyn_cast<PHINode>(In->getOperand(opi))) {
- if (const RenameData *D = findReplacementData(OpPhi)) {
- // This is using values from original header PHI node.
- // Here, directly used incoming value from original pre-header.
- C->setOperand(opi, D->PreHeader);
- }
- }
- else if (Instruction *OpInsn =
- dyn_cast<Instruction>(In->getOperand(opi))) {
- if (const RenameData *D = findReplacementData(OpInsn))
- C->setOperand(opi, D->PreHeader);
- }
- }
-
-
- // If this instruction is used outside this basic block then
- // create new PHINode for this instruction.
- Instruction *NewHeaderReplacement = NULL;
- if (usedOutsideOriginalHeader(In)) {
- // FIXME: remove this when we have first-class aggregates.
- if (isa<StructType>(In->getType())) {
- // Can't create PHI nodes for this type. If there are any getResults
- // not defined in this block, move them back to this block. PHI
- // nodes will be created for all getResults later.
- BasicBlock::iterator InsertPoint;
- if (InvokeInst *II = dyn_cast<InvokeInst>(In)) {
- InsertPoint = II->getNormalDest()->begin();
- while (isa<PHINode>(InsertPoint))
- ++InsertPoint;
- } else {
- InsertPoint = I; // call
- ++InsertPoint;
- }
- for (Value::use_iterator UI = In->use_begin(), UE = In->use_end();
- UI != UE; ++UI) {
- GetResultInst *InGR = cast<GetResultInst>(UI);
- if (InGR->getParent() != OrigHeader) {
- // Move InGR to immediately after the call or in the normal dest of
- // the invoke. It will be picked up, cloned and PHI'd on the next
- // iteration.
- InGR->moveBefore(InsertPoint);
- }
- }
- } else {
- PHINode *PN = PHINode::Create(In->getType(), In->getName());
- PN->addIncoming(In, OrigHeader);
- PN->addIncoming(C, OrigPreHeader);
- NewHeader->getInstList().push_front(PN);
- NewHeaderReplacement = PN;
- }
- }
- LoopHeaderInfo.push_back(RenameData(In, C, NewHeaderReplacement));
- }
-
- // Rename uses of original header instructions to reflect their new
- // definitions (either from original pre-header node or from newly created
- // new header PHINodes.
- //
- // Original header instructions are used in
- // 1) Original header:
- //
- // If instruction is used in non-phi instructions then it is using
- // defintion from original heder iteself. Do not replace this use
- // with definition from new header or original pre-header.
- //
- // If instruction is used in phi node then it is an incoming
- // value. Rename its use to reflect new definition from new-preheader
- // or new header.
- //
- // 2) Inside loop but not in original header
- //
- // Replace this use to reflect definition from new header.
- for(unsigned LHI = 0, LHI_E = LoopHeaderInfo.size(); LHI != LHI_E; ++LHI) {
- const RenameData &ILoopHeaderInfo = LoopHeaderInfo[LHI];
-
- if (!ILoopHeaderInfo.Header)
- continue;
-
- Instruction *OldPhi = ILoopHeaderInfo.Original;
- Instruction *NewPhi = ILoopHeaderInfo.Header;
-
- // Before replacing uses, collect them first, so that iterator is
- // not invalidated.
- SmallVector<Instruction *, 16> AllUses;
- for (Value::use_iterator UI = OldPhi->use_begin(), UE = OldPhi->use_end();
- UI != UE; ++UI) {
- Instruction *U = cast<Instruction>(UI);
- AllUses.push_back(U);
- }
-
- for (SmallVector<Instruction *, 16>::iterator UI = AllUses.begin(),
- UE = AllUses.end(); UI != UE; ++UI) {
- Instruction *U = *UI;
- BasicBlock *Parent = U->getParent();
-
- // Used inside original header
- if (Parent == OrigHeader) {
- // Do not rename uses inside original header non-phi instructions.
- PHINode *PU = dyn_cast<PHINode>(U);
- if (!PU)
- continue;
-
- // Do not rename uses inside original header phi nodes, if the
- // incoming value is for new header.
- if (PU->getBasicBlockIndex(NewHeader) != -1
- && PU->getIncomingValueForBlock(NewHeader) == U)
- continue;
-
- U->replaceUsesOfWith(OldPhi, NewPhi);
- continue;
- }
-
- // Used inside loop, but not in original header.
- if (L->contains(U->getParent())) {
- if (U != NewPhi)
- U->replaceUsesOfWith(OldPhi, NewPhi);
- continue;
- }
-
- // Used inside Exit Block. Since we are in LCSSA form, U must be PHINode.
- if (U->getParent() == Exit) {
- assert (isa<PHINode>(U) && "Use in Exit Block that is not PHINode");
-
- PHINode *UPhi = cast<PHINode>(U);
- // UPhi already has one incoming argument from original header.
- // Add second incoming argument from new Pre header.
- UPhi->addIncoming(ILoopHeaderInfo.PreHeader, OrigPreHeader);
- } else {
- // Used outside Exit block. Create a new PHI node from exit block
- // to receive value from ne new header ane pre header.
- PHINode *PN = PHINode::Create(U->getType(), U->getName());
- PN->addIncoming(ILoopHeaderInfo.PreHeader, OrigPreHeader);
- PN->addIncoming(OldPhi, OrigHeader);
- Exit->getInstList().push_front(PN);
- U->replaceUsesOfWith(OldPhi, PN);
- }
- }
- }
-
- /// Make sure all Exit block PHINodes have required incoming values.
- updateExitBlock();
-
- // Update CFG
-
- // Removing incoming branch from loop preheader to original header.
- // Now original header is inside the loop.
- for (BasicBlock::iterator I = OrigHeader->begin(), E = OrigHeader->end();
- I != E; ++I) {
- Instruction *In = I;
- PHINode *PN = dyn_cast<PHINode>(In);
- if (!PN)
- break;
-
- PN->removeIncomingValue(OrigPreHeader);
- }
-
- // Make NewHeader as the new header for the loop.
- L->moveToHeader(NewHeader);
-
- preserveCanonicalLoopForm(LPM);
-
- NumRotated++;
- return true;
-}
-
-/// Make sure all Exit block PHINodes have required incoming values.
-/// If incoming value is constant or defined outside the loop then
-/// PHINode may not have an entry for original pre-header.
-void LoopRotate::updateExitBlock() {
-
- for (BasicBlock::iterator I = Exit->begin(), E = Exit->end();
- I != E; ++I) {
-
- PHINode *PN = dyn_cast<PHINode>(I);
- if (!PN)
- break;
-
- // There is already one incoming value from original pre-header block.
- if (PN->getBasicBlockIndex(OrigPreHeader) != -1)
- continue;
-
- const RenameData *ILoopHeaderInfo;
- Value *V = PN->getIncomingValueForBlock(OrigHeader);
- if (isa<Instruction>(V) &&
- (ILoopHeaderInfo = findReplacementData(cast<Instruction>(V)))) {
- assert(ILoopHeaderInfo->PreHeader && "Missing New Preheader Instruction");
- PN->addIncoming(ILoopHeaderInfo->PreHeader, OrigPreHeader);
- } else {
- PN->addIncoming(V, OrigPreHeader);
- }
- }
-}
-
-/// Initialize local data
-void LoopRotate::initialize() {
- L = NULL;
- OrigHeader = NULL;
- OrigPreHeader = NULL;
- NewHeader = NULL;
- Exit = NULL;
-
- LoopHeaderInfo.clear();
-}
-
-/// Return true if this instruction is used by any instructions in the loop that
-/// aren't in original header.
-bool LoopRotate::usedOutsideOriginalHeader(Instruction *In) {
-
- for (Value::use_iterator UI = In->use_begin(), UE = In->use_end();
- UI != UE; ++UI) {
- Instruction *U = cast<Instruction>(UI);
- if (U->getParent() != OrigHeader) {
- if (L->contains(U->getParent()))
- return true;
- }
- }
-
- return false;
-}
-
-/// Find Replacement information for instruction. Return NULL if it is
-/// not available.
-const RenameData *LoopRotate::findReplacementData(Instruction *In) {
-
- // Since LoopHeaderInfo is small, linear walk is OK.
- for(unsigned LHI = 0, LHI_E = LoopHeaderInfo.size(); LHI != LHI_E; ++LHI) {
- const RenameData &ILoopHeaderInfo = LoopHeaderInfo[LHI];
- if (ILoopHeaderInfo.Original == In)
- return &ILoopHeaderInfo;
- }
- return NULL;
-}
-
-/// After loop rotation, loop pre-header has multiple sucessors.
-/// Insert one forwarding basic block to ensure that loop pre-header
-/// has only one successor.
-void LoopRotate::preserveCanonicalLoopForm(LPPassManager &LPM) {
-
- // Right now original pre-header has two successors, new header and
- // exit block. Insert new block between original pre-header and
- // new header such that loop's new pre-header has only one successor.
- BasicBlock *NewPreHeader = BasicBlock::Create("bb.nph", OrigHeader->getParent(),
- NewHeader);
- LoopInfo &LI = LPM.getAnalysis<LoopInfo>();
- if (Loop *PL = LI.getLoopFor(OrigPreHeader))
- PL->addBasicBlockToLoop(NewPreHeader, LI.getBase());
- BranchInst::Create(NewHeader, NewPreHeader);
-
- BranchInst *OrigPH_BI = cast<BranchInst>(OrigPreHeader->getTerminator());
- if (OrigPH_BI->getSuccessor(0) == NewHeader)
- OrigPH_BI->setSuccessor(0, NewPreHeader);
- else {
- assert (OrigPH_BI->getSuccessor(1) == NewHeader &&
- "Unexpected original pre-header terminator");
- OrigPH_BI->setSuccessor(1, NewPreHeader);
- }
-
- for (BasicBlock::iterator I = NewHeader->begin(), E = NewHeader->end();
- I != E; ++I) {
- Instruction *In = I;
- PHINode *PN = dyn_cast<PHINode>(In);
- if (!PN)
- break;
-
- int index = PN->getBasicBlockIndex(OrigPreHeader);
- assert (index != -1 && "Expected incoming value from Original PreHeader");
- PN->setIncomingBlock(index, NewPreHeader);
- assert (PN->getBasicBlockIndex(OrigPreHeader) == -1 &&
- "Expected only one incoming value from Original PreHeader");
- }
-
- if (DominatorTree *DT = getAnalysisToUpdate<DominatorTree>()) {
- DT->addNewBlock(NewPreHeader, OrigPreHeader);
- DT->changeImmediateDominator(L->getHeader(), NewPreHeader);
- DT->changeImmediateDominator(Exit, OrigPreHeader);
- for (Loop::block_iterator BI = L->block_begin(), BE = L->block_end();
- BI != BE; ++BI) {
- BasicBlock *B = *BI;
- if (L->getHeader() != B) {
- DomTreeNode *Node = DT->getNode(B);
- if (Node && Node->getBlock() == OrigHeader)
- DT->changeImmediateDominator(*BI, L->getHeader());
- }
- }
- DT->changeImmediateDominator(OrigHeader, OrigLatch);
- }
-
- if(DominanceFrontier *DF = getAnalysisToUpdate<DominanceFrontier>()) {
-
- // New Preheader's dominance frontier is Exit block.
- DominanceFrontier::DomSetType NewPHSet;
- NewPHSet.insert(Exit);
- DF->addBasicBlock(NewPreHeader, NewPHSet);
-
- // New Header's dominance frontier now includes itself and Exit block
- DominanceFrontier::iterator HeadI = DF->find(L->getHeader());
- if (HeadI != DF->end()) {
- DominanceFrontier::DomSetType & HeaderSet = HeadI->second;
- HeaderSet.clear();
- HeaderSet.insert(L->getHeader());
- HeaderSet.insert(Exit);
- } else {
- DominanceFrontier::DomSetType HeaderSet;
- HeaderSet.insert(L->getHeader());
- HeaderSet.insert(Exit);
- DF->addBasicBlock(L->getHeader(), HeaderSet);
- }
-
- // Original header (new Loop Latch)'s dominance frontier is Exit.
- DominanceFrontier::iterator LatchI = DF->find(L->getLoopLatch());
- if (LatchI != DF->end()) {
- DominanceFrontier::DomSetType &LatchSet = LatchI->second;
- LatchSet = LatchI->second;
- LatchSet.clear();
- LatchSet.insert(Exit);
- } else {
- DominanceFrontier::DomSetType LatchSet;
- LatchSet.insert(Exit);
- DF->addBasicBlock(L->getHeader(), LatchSet);
- }
-
- // If a loop block dominates new loop latch then its frontier is
- // new header and Exit.
- BasicBlock *NewLatch = L->getLoopLatch();
- DominatorTree *DT = getAnalysisToUpdate<DominatorTree>();
- for (Loop::block_iterator BI = L->block_begin(), BE = L->block_end();
- BI != BE; ++BI) {
- BasicBlock *B = *BI;
- if (DT->dominates(B, NewLatch)) {
- DominanceFrontier::iterator BDFI = DF->find(B);
- if (BDFI != DF->end()) {
- DominanceFrontier::DomSetType &BSet = BDFI->second;
- BSet = BDFI->second;
- BSet.clear();
- BSet.insert(L->getHeader());
- BSet.insert(Exit);
- } else {
- DominanceFrontier::DomSetType BSet;
- BSet.insert(L->getHeader());
- BSet.insert(Exit);
- DF->addBasicBlock(B, BSet);
- }
- }
- }
- }
-
- // Preserve canonical loop form, which means Exit block should
- // have only one predecessor.
- BasicBlock *NExit = SplitEdge(L->getLoopLatch(), Exit, this);
-
- // Preserve LCSSA.
- BasicBlock::iterator I = Exit->begin(), E = Exit->end();
- PHINode *PN = NULL;
- for (; (PN = dyn_cast<PHINode>(I)); ++I) {
- PHINode *NewPN = PHINode::Create(PN->getType(), PN->getName());
- unsigned N = PN->getNumIncomingValues();
- for (unsigned index = 0; index < N; ++index)
- if (PN->getIncomingBlock(index) == NExit) {
- NewPN->addIncoming(PN->getIncomingValue(index), L->getLoopLatch());
- PN->setIncomingValue(index, NewPN);
- PN->setIncomingBlock(index, NExit);
- NExit->getInstList().push_front(NewPN);
- }
- }
-
- assert (NewHeader && L->getHeader() == NewHeader
- && "Invalid loop header after loop rotation");
- assert (NewPreHeader && L->getLoopPreheader() == NewPreHeader
- && "Invalid loop preheader after loop rotation");
- assert (L->getLoopLatch()
- && "Invalid loop latch after loop rotation");
-
-}
diff --git a/release_23/lib/Transforms/Scalar/LoopStrengthReduce.cpp b/release_23/lib/Transforms/Scalar/LoopStrengthReduce.cpp
deleted file mode 100644
index 4dc7d60b0cb7..000000000000
--- a/release_23/lib/Transforms/Scalar/LoopStrengthReduce.cpp
+++ /dev/null
@@ -1,1822 +0,0 @@
-//===- LoopStrengthReduce.cpp - Strength Reduce GEPs in Loops -------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This pass performs a strength reduction on array references inside loops that
-// have as one or more of their components the loop induction variable. This is
-// accomplished by creating a new Value to hold the initial value of the array
-// access for the first iteration, and then creating a new GEP instruction in
-// the loop to increment the value by the appropriate amount.
-//
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "loop-reduce"
-#include "llvm/Transforms/Scalar.h"
-#include "llvm/Constants.h"
-#include "llvm/Instructions.h"
-#include "llvm/IntrinsicInst.h"
-#include "llvm/Type.h"
-#include "llvm/DerivedTypes.h"
-#include "llvm/Analysis/Dominators.h"
-#include "llvm/Analysis/LoopInfo.h"
-#include "llvm/Analysis/LoopPass.h"
-#include "llvm/Analysis/ScalarEvolutionExpander.h"
-#include "llvm/Support/CFG.h"
-#include "llvm/Support/GetElementPtrTypeIterator.h"
-#include "llvm/Transforms/Utils/BasicBlockUtils.h"
-#include "llvm/Transforms/Utils/Local.h"
-#include "llvm/Target/TargetData.h"
-#include "llvm/ADT/SmallPtrSet.h"
-#include "llvm/ADT/Statistic.h"
-#include "llvm/Support/Debug.h"
-#include "llvm/Support/Compiler.h"
-#include "llvm/Target/TargetLowering.h"
-#include <algorithm>
-#include <set>
-using namespace llvm;
-
-STATISTIC(NumReduced , "Number of GEPs strength reduced");
-STATISTIC(NumInserted, "Number of PHIs inserted");
-STATISTIC(NumVariable, "Number of PHIs with variable strides");
-STATISTIC(NumEliminated , "Number of strides eliminated");
-
-namespace {
-
- struct BasedUser;
-
- /// IVStrideUse - Keep track of one use of a strided induction variable, where
- /// the stride is stored externally. The Offset member keeps track of the
- /// offset from the IV, User is the actual user of the operand, and
- /// 'OperandValToReplace' is the operand of the User that is the use.
- struct VISIBILITY_HIDDEN IVStrideUse {
- SCEVHandle Offset;
- Instruction *User;
- Value *OperandValToReplace;
-
- // isUseOfPostIncrementedValue - True if this should use the
- // post-incremented version of this IV, not the preincremented version.
- // This can only be set in special cases, such as the terminating setcc
- // instruction for a loop or uses dominated by the loop.
- bool isUseOfPostIncrementedValue;
-
- IVStrideUse(const SCEVHandle &Offs, Instruction *U, Value *O)
- : Offset(Offs), User(U), OperandValToReplace(O),
- isUseOfPostIncrementedValue(false) {}
- };
-
- /// IVUsersOfOneStride - This structure keeps track of all instructions that
- /// have an operand that is based on the trip count multiplied by some stride.
- /// The stride for all of these users is common and kept external to this
- /// structure.
- struct VISIBILITY_HIDDEN IVUsersOfOneStride {
- /// Users - Keep track of all of the users of this stride as well as the
- /// initial value and the operand that uses the IV.
- std::vector<IVStrideUse> Users;
-
- void addUser(const SCEVHandle &Offset,Instruction *User, Value *Operand) {
- Users.push_back(IVStrideUse(Offset, User, Operand));
- }
- };
-
- /// IVInfo - This structure keeps track of one IV expression inserted during
- /// StrengthReduceStridedIVUsers. It contains the stride, the common base, as
- /// well as the PHI node and increment value created for rewrite.
- struct VISIBILITY_HIDDEN IVExpr {
- SCEVHandle Stride;
- SCEVHandle Base;
- PHINode *PHI;
- Value *IncV;
-
- IVExpr(const SCEVHandle &stride, const SCEVHandle &base, PHINode *phi,
- Value *incv)
- : Stride(stride), Base(base), PHI(phi), IncV(incv) {}
- };
-
- /// IVsOfOneStride - This structure keeps track of all IV expression inserted
- /// during StrengthReduceStridedIVUsers for a particular stride of the IV.
- struct VISIBILITY_HIDDEN IVsOfOneStride {
- std::vector<IVExpr> IVs;
-
- void addIV(const SCEVHandle &Stride, const SCEVHandle &Base, PHINode *PHI,
- Value *IncV) {
- IVs.push_back(IVExpr(Stride, Base, PHI, IncV));
- }
- };
-
- class VISIBILITY_HIDDEN LoopStrengthReduce : public LoopPass {
- LoopInfo *LI;
- DominatorTree *DT;
- ScalarEvolution *SE;
- const TargetData *TD;
- const Type *UIntPtrTy;
- bool Changed;
-
- /// IVUsesByStride - Keep track of all uses of induction variables that we
- /// are interested in. The key of the map is the stride of the access.
- std::map<SCEVHandle, IVUsersOfOneStride> IVUsesByStride;
-
- /// IVsByStride - Keep track of all IVs that have been inserted for a
- /// particular stride.
- std::map<SCEVHandle, IVsOfOneStride> IVsByStride;
-
- /// StrideOrder - An ordering of the keys in IVUsesByStride that is stable:
- /// We use this to iterate over the IVUsesByStride collection without being
- /// dependent on random ordering of pointers in the process.
- SmallVector<SCEVHandle, 16> StrideOrder;
-
- /// CastedValues - As we need to cast values to uintptr_t, this keeps track
- /// of the casted version of each value. This is accessed by
- /// getCastedVersionOf.
- DenseMap<Value*, Value*> CastedPointers;
-
- /// DeadInsts - Keep track of instructions we may have made dead, so that
- /// we can remove them after we are done working.
- SmallPtrSet<Instruction*,16> DeadInsts;
-
- /// TLI - Keep a pointer of a TargetLowering to consult for determining
- /// transformation profitability.
- const TargetLowering *TLI;
-
- public:
- static char ID; // Pass ID, replacement for typeid
- explicit LoopStrengthReduce(const TargetLowering *tli = NULL) :
- LoopPass((intptr_t)&ID), TLI(tli) {
- }
-
- bool runOnLoop(Loop *L, LPPassManager &LPM);
-
- virtual void getAnalysisUsage(AnalysisUsage &AU) const {
- // We split critical edges, so we change the CFG. However, we do update
- // many analyses if they are around.
- AU.addPreservedID(LoopSimplifyID);
- AU.addPreserved<LoopInfo>();
- AU.addPreserved<DominanceFrontier>();
- AU.addPreserved<DominatorTree>();
-
- AU.addRequiredID(LoopSimplifyID);
- AU.addRequired<LoopInfo>();
- AU.addRequired<DominatorTree>();
- AU.addRequired<TargetData>();
- AU.addRequired<ScalarEvolution>();
- }
-
- /// getCastedVersionOf - Return the specified value casted to uintptr_t.
- ///
- Value *getCastedVersionOf(Instruction::CastOps opcode, Value *V);
-private:
- bool AddUsersIfInteresting(Instruction *I, Loop *L,
- SmallPtrSet<Instruction*,16> &Processed);
- SCEVHandle GetExpressionSCEV(Instruction *E);
- ICmpInst *ChangeCompareStride(Loop *L, ICmpInst *Cond,
- IVStrideUse* &CondUse,
- const SCEVHandle* &CondStride);
- void OptimizeIndvars(Loop *L);
- bool FindIVForUser(ICmpInst *Cond, IVStrideUse *&CondUse,
- const SCEVHandle *&CondStride);
- bool RequiresTypeConversion(const Type *Ty, const Type *NewTy);
- unsigned CheckForIVReuse(bool, bool, const SCEVHandle&,
- IVExpr&, const Type*,
- const std::vector<BasedUser>& UsersToProcess);
- bool ValidStride(bool, int64_t,
- const std::vector<BasedUser>& UsersToProcess);
- SCEVHandle CollectIVUsers(const SCEVHandle &Stride,
- IVUsersOfOneStride &Uses,
- Loop *L,
- bool &AllUsesAreAddresses,
- std::vector<BasedUser> &UsersToProcess);
- void StrengthReduceStridedIVUsers(const SCEVHandle &Stride,
- IVUsersOfOneStride &Uses,
- Loop *L, bool isOnlyStride);
- void DeleteTriviallyDeadInstructions(SmallPtrSet<Instruction*,16> &Insts);
- };
- char LoopStrengthReduce::ID = 0;
- RegisterPass<LoopStrengthReduce> X("loop-reduce", "Loop Strength Reduction");
-}
-
-LoopPass *llvm::createLoopStrengthReducePass(const TargetLowering *TLI) {
- return new LoopStrengthReduce(TLI);
-}
-
-/// getCastedVersionOf - Return the specified value casted to uintptr_t. This
-/// assumes that the Value* V is of integer or pointer type only.
-///
-Value *LoopStrengthReduce::getCastedVersionOf(Instruction::CastOps opcode,
- Value *V) {
- if (V->getType() == UIntPtrTy) return V;
- if (Constant *CB = dyn_cast<Constant>(V))
- return ConstantExpr::getCast(opcode, CB, UIntPtrTy);
-
- Value *&New = CastedPointers[V];
- if (New) return New;
-
- New = SCEVExpander::InsertCastOfTo(opcode, V, UIntPtrTy);
- DeadInsts.insert(cast<Instruction>(New));
- return New;
-}
-
-
-/// DeleteTriviallyDeadInstructions - If any of the instructions is the
-/// specified set are trivially dead, delete them and see if this makes any of
-/// their operands subsequently dead.
-void LoopStrengthReduce::
-DeleteTriviallyDeadInstructions(SmallPtrSet<Instruction*,16> &Insts) {
- while (!Insts.empty()) {
- Instruction *I = *Insts.begin();
- Insts.erase(I);
-
- if (PHINode *PN = dyn_cast<PHINode>(I)) {
- // If all incoming values to the Phi are the same, we can replace the Phi
- // with that value.
- if (Value *PNV = PN->hasConstantValue()) {
- if (Instruction *U = dyn_cast<Instruction>(PNV))
- Insts.insert(U);
- PN->replaceAllUsesWith(PNV);
- SE->deleteValueFromRecords(PN);
- PN->eraseFromParent();
- Changed = true;
- continue;
- }
- }
-
- if (isInstructionTriviallyDead(I)) {
- for (unsigned i = 0, e = I->getNumOperands(); i != e; ++i)
- if (Instruction *U = dyn_cast<Instruction>(I->getOperand(i)))
- Insts.insert(U);
- SE->deleteValueFromRecords(I);
- I->eraseFromParent();
- Changed = true;
- }
- }
-}
-
-
-/// GetExpressionSCEV - Compute and return the SCEV for the specified
-/// instruction.
-SCEVHandle LoopStrengthReduce::GetExpressionSCEV(Instruction *Exp) {
- // Pointer to pointer bitcast instructions return the same value as their
- // operand.
- if (BitCastInst *BCI = dyn_cast<BitCastInst>(Exp)) {
- if (SE->hasSCEV(BCI) || !isa<Instruction>(BCI->getOperand(0)))
- return SE->getSCEV(BCI);
- SCEVHandle R = GetExpressionSCEV(cast<Instruction>(BCI->getOperand(0)));
- SE->setSCEV(BCI, R);
- return R;
- }
-
- // Scalar Evolutions doesn't know how to compute SCEV's for GEP instructions.
- // If this is a GEP that SE doesn't know about, compute it now and insert it.
- // If this is not a GEP, or if we have already done this computation, just let
- // SE figure it out.
- GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(Exp);
- if (!GEP || SE->hasSCEV(GEP))
- return SE->getSCEV(Exp);
-
- // Analyze all of the subscripts of this getelementptr instruction, looking
- // for uses that are determined by the trip count of the loop. First, skip
- // all operands the are not dependent on the IV.
-
- // Build up the base expression. Insert an LLVM cast of the pointer to
- // uintptr_t first.
- SCEVHandle GEPVal = SE->getUnknown(
- getCastedVersionOf(Instruction::PtrToInt, GEP->getOperand(0)));
-
- gep_type_iterator GTI = gep_type_begin(GEP);
-
- for (unsigned i = 1, e = GEP->getNumOperands(); i != e; ++i, ++GTI) {
- // If this is a use of a recurrence that we can analyze, and it comes before
- // Op does in the GEP operand list, we will handle this when we process this
- // operand.
- if (const StructType *STy = dyn_cast<StructType>(*GTI)) {
- const StructLayout *SL = TD->getStructLayout(STy);
- unsigned Idx = cast<ConstantInt>(GEP->getOperand(i))->getZExtValue();
- uint64_t Offset = SL->getElementOffset(Idx);
- GEPVal = SE->getAddExpr(GEPVal,
- SE->getIntegerSCEV(Offset, UIntPtrTy));
- } else {
- unsigned GEPOpiBits =
- GEP->getOperand(i)->getType()->getPrimitiveSizeInBits();
- unsigned IntPtrBits = UIntPtrTy->getPrimitiveSizeInBits();
- Instruction::CastOps opcode = (GEPOpiBits < IntPtrBits ?
- Instruction::SExt : (GEPOpiBits > IntPtrBits ? Instruction::Trunc :
- Instruction::BitCast));
- Value *OpVal = getCastedVersionOf(opcode, GEP->getOperand(i));
- SCEVHandle Idx = SE->getSCEV(OpVal);
-
- uint64_t TypeSize = TD->getABITypeSize(GTI.getIndexedType());
- if (TypeSize != 1)
- Idx = SE->getMulExpr(Idx,
- SE->getConstant(ConstantInt::get(UIntPtrTy,
- TypeSize)));
- GEPVal = SE->getAddExpr(GEPVal, Idx);
- }
- }
-
- SE->setSCEV(GEP, GEPVal);
- return GEPVal;
-}
-
-/// getSCEVStartAndStride - Compute the start and stride of this expression,
-/// returning false if the expression is not a start/stride pair, or true if it
-/// is. The stride must be a loop invariant expression, but the start may be
-/// a mix of loop invariant and loop variant expressions.
-static bool getSCEVStartAndStride(const SCEVHandle &SH, Loop *L,
- SCEVHandle &Start, SCEVHandle &Stride,
- ScalarEvolution *SE) {
- SCEVHandle TheAddRec = Start; // Initialize to zero.
-
- // If the outer level is an AddExpr, the operands are all start values except
- // for a nested AddRecExpr.
- if (SCEVAddExpr *AE = dyn_cast<SCEVAddExpr>(SH)) {
- for (unsigned i = 0, e = AE->getNumOperands(); i != e; ++i)
- if (SCEVAddRecExpr *AddRec =
- dyn_cast<SCEVAddRecExpr>(AE->getOperand(i))) {
- if (AddRec->getLoop() == L)
- TheAddRec = SE->getAddExpr(AddRec, TheAddRec);
- else
- return false; // Nested IV of some sort?
- } else {
- Start = SE->getAddExpr(Start, AE->getOperand(i));
- }
-
- } else if (isa<SCEVAddRecExpr>(SH)) {
- TheAddRec = SH;
- } else {
- return false; // not analyzable.
- }
-
- SCEVAddRecExpr *AddRec = dyn_cast<SCEVAddRecExpr>(TheAddRec);
- if (!AddRec || AddRec->getLoop() != L) return false;
-
- // FIXME: Generalize to non-affine IV's.
- if (!AddRec->isAffine()) return false;
-
- Start = SE->getAddExpr(Start, AddRec->getOperand(0));
-
- if (!isa<SCEVConstant>(AddRec->getOperand(1)))
- DOUT << "[" << L->getHeader()->getName()
- << "] Variable stride: " << *AddRec << "\n";
-
- Stride = AddRec->getOperand(1);
- return true;
-}
-
-/// IVUseShouldUsePostIncValue - We have discovered a "User" of an IV expression
-/// and now we need to decide whether the user should use the preinc or post-inc
-/// value. If this user should use the post-inc version of the IV, return true.
-///
-/// Choosing wrong here can break dominance properties (if we choose to use the
-/// post-inc value when we cannot) or it can end up adding extra live-ranges to
-/// the loop, resulting in reg-reg copies (if we use the pre-inc value when we
-/// should use the post-inc value).
-static bool IVUseShouldUsePostIncValue(Instruction *User, Instruction *IV,
- Loop *L, DominatorTree *DT, Pass *P,
- SmallPtrSet<Instruction*,16> &DeadInsts){
- // If the user is in the loop, use the preinc value.
- if (L->contains(User->getParent())) return false;
-
- BasicBlock *LatchBlock = L->getLoopLatch();
-
- // Ok, the user is outside of the loop. If it is dominated by the latch
- // block, use the post-inc value.
- if (DT->dominates(LatchBlock, User->getParent()))
- return true;
-
- // There is one case we have to be careful of: PHI nodes. These little guys
- // can live in blocks that do not dominate the latch block, but (since their
- // uses occur in the predecessor block, not the block the PHI lives in) should
- // still use the post-inc value. Check for this case now.
- PHINode *PN = dyn_cast<PHINode>(User);
- if (!PN) return false; // not a phi, not dominated by latch block.
-
- // Look at all of the uses of IV by the PHI node. If any use corresponds to
- // a block that is not dominated by the latch block, give up and use the
- // preincremented value.
- unsigned NumUses = 0;
- for (unsigned i = 0, e = PN->getNumIncomingValues(); i != e; ++i)
- if (PN->getIncomingValue(i) == IV) {
- ++NumUses;
- if (!DT->dominates(LatchBlock, PN->getIncomingBlock(i)))
- return false;
- }
-
- // Okay, all uses of IV by PN are in predecessor blocks that really are
- // dominated by the latch block. Split the critical edges and use the
- // post-incremented value.
- for (unsigned i = 0, e = PN->getNumIncomingValues(); i != e; ++i)
- if (PN->getIncomingValue(i) == IV) {
- SplitCriticalEdge(PN->getIncomingBlock(i), PN->getParent(), P, false);
- // Splitting the critical edge can reduce the number of entries in this
- // PHI.
- e = PN->getNumIncomingValues();
- if (--NumUses == 0) break;
- }
-
- // PHI node might have become a constant value after SplitCriticalEdge.
- DeadInsts.insert(User);
-
- return true;
-}
-
-
-
-/// AddUsersIfInteresting - Inspect the specified instruction. If it is a
-/// reducible SCEV, recursively add its users to the IVUsesByStride set and
-/// return true. Otherwise, return false.
-bool LoopStrengthReduce::AddUsersIfInteresting(Instruction *I, Loop *L,
- SmallPtrSet<Instruction*,16> &Processed) {
- if (!I->getType()->isInteger() && !isa<PointerType>(I->getType()))
- return false; // Void and FP expressions cannot be reduced.
- if (!Processed.insert(I))
- return true; // Instruction already handled.
-
- // Get the symbolic expression for this instruction.
- SCEVHandle ISE = GetExpressionSCEV(I);
- if (isa<SCEVCouldNotCompute>(ISE)) return false;
-
- // Get the start and stride for this expression.
- SCEVHandle Start = SE->getIntegerSCEV(0, ISE->getType());
- SCEVHandle Stride = Start;
- if (!getSCEVStartAndStride(ISE, L, Start, Stride, SE))
- return false; // Non-reducible symbolic expression, bail out.
-
- std::vector<Instruction *> IUsers;
- // Collect all I uses now because IVUseShouldUsePostIncValue may
- // invalidate use_iterator.
- for (Value::use_iterator UI = I->use_begin(), E = I->use_end(); UI != E; ++UI)
- IUsers.push_back(cast<Instruction>(*UI));
-
- for (unsigned iused_index = 0, iused_size = IUsers.size();
- iused_index != iused_size; ++iused_index) {
-
- Instruction *User = IUsers[iused_index];
-
- // Do not infinitely recurse on PHI nodes.
- if (isa<PHINode>(User) && Processed.count(User))
- continue;
-
- // If this is an instruction defined in a nested loop, or outside this loop,
- // don't recurse into it.
- bool AddUserToIVUsers = false;
- if (LI->getLoopFor(User->getParent()) != L) {
- DOUT << "FOUND USER in other loop: " << *User
- << " OF SCEV: " << *ISE << "\n";
- AddUserToIVUsers = true;
- } else if (!AddUsersIfInteresting(User, L, Processed)) {
- DOUT << "FOUND USER: " << *User
- << " OF SCEV: " << *ISE << "\n";
- AddUserToIVUsers = true;
- }
-
- if (AddUserToIVUsers) {
- IVUsersOfOneStride &StrideUses = IVUsesByStride[Stride];
- if (StrideUses.Users.empty()) // First occurance of this stride?
- StrideOrder.push_back(Stride);
-
- // Okay, we found a user that we cannot reduce. Analyze the instruction
- // and decide what to do with it. If we are a use inside of the loop, use
- // the value before incrementation, otherwise use it after incrementation.
- if (IVUseShouldUsePostIncValue(User, I, L, DT, this, DeadInsts)) {
- // The value used will be incremented by the stride more than we are
- // expecting, so subtract this off.
- SCEVHandle NewStart = SE->getMinusSCEV(Start, Stride);
- StrideUses.addUser(NewStart, User, I);
- StrideUses.Users.back().isUseOfPostIncrementedValue = true;
- DOUT << " USING POSTINC SCEV, START=" << *NewStart<< "\n";
- } else {
- StrideUses.addUser(Start, User, I);
- }
- }
- }
- return true;
-}
-
-namespace {
- /// BasedUser - For a particular base value, keep information about how we've
- /// partitioned the expression so far.
- struct BasedUser {
- /// SE - The current ScalarEvolution object.
- ScalarEvolution *SE;
-
- /// Base - The Base value for the PHI node that needs to be inserted for
- /// this use. As the use is processed, information gets moved from this
- /// field to the Imm field (below). BasedUser values are sorted by this
- /// field.
- SCEVHandle Base;
-
- /// Inst - The instruction using the induction variable.
- Instruction *Inst;
-
- /// OperandValToReplace - The operand value of Inst to replace with the
- /// EmittedBase.
- Value *OperandValToReplace;
-
- /// Imm - The immediate value that should be added to the base immediately
- /// before Inst, because it will be folded into the imm field of the
- /// instruction.
- SCEVHandle Imm;
-
- /// EmittedBase - The actual value* to use for the base value of this
- /// operation. This is null if we should just use zero so far.
- Value *EmittedBase;
-
- // isUseOfPostIncrementedValue - True if this should use the
- // post-incremented version of this IV, not the preincremented version.
- // This can only be set in special cases, such as the terminating setcc
- // instruction for a loop and uses outside the loop that are dominated by
- // the loop.
- bool isUseOfPostIncrementedValue;
-
- BasedUser(IVStrideUse &IVSU, ScalarEvolution *se)
- : SE(se), Base(IVSU.Offset), Inst(IVSU.User),
- OperandValToReplace(IVSU.OperandValToReplace),
- Imm(SE->getIntegerSCEV(0, Base->getType())), EmittedBase(0),
- isUseOfPostIncrementedValue(IVSU.isUseOfPostIncrementedValue) {}
-
- // Once we rewrite the code to insert the new IVs we want, update the
- // operands of Inst to use the new expression 'NewBase', with 'Imm' added
- // to it.
- void RewriteInstructionToUseNewBase(const SCEVHandle &NewBase,
- SCEVExpander &Rewriter, Loop *L, Pass *P,
- SmallPtrSet<Instruction*,16> &DeadInsts);
-
- Value *InsertCodeForBaseAtPosition(const SCEVHandle &NewBase,
- SCEVExpander &Rewriter,
- Instruction *IP, Loop *L);
- void dump() const;
- };
-}
-
-void BasedUser::dump() const {
- cerr << " Base=" << *Base;
- cerr << " Imm=" << *Imm;
- if (EmittedBase)
- cerr << " EB=" << *EmittedBase;
-
- cerr << " Inst: " << *Inst;
-}
-
-Value *BasedUser::InsertCodeForBaseAtPosition(const SCEVHandle &NewBase,
- SCEVExpander &Rewriter,
- Instruction *IP, Loop *L) {
- // Figure out where we *really* want to insert this code. In particular, if
- // the user is inside of a loop that is nested inside of L, we really don't
- // want to insert this expression before the user, we'd rather pull it out as
- // many loops as possible.
- LoopInfo &LI = Rewriter.getLoopInfo();
- Instruction *BaseInsertPt = IP;
-
- // Figure out the most-nested loop that IP is in.
- Loop *InsertLoop = LI.getLoopFor(IP->getParent());
-
- // If InsertLoop is not L, and InsertLoop is nested inside of L, figure out
- // the preheader of the outer-most loop where NewBase is not loop invariant.
- while (InsertLoop && NewBase->isLoopInvariant(InsertLoop)) {
- BaseInsertPt = InsertLoop->getLoopPreheader()->getTerminator();
- InsertLoop = InsertLoop->getParentLoop();
- }
-
- // If there is no immediate value, skip the next part.
- if (SCEVConstant *SC = dyn_cast<SCEVConstant>(Imm))
- if (SC->getValue()->isZero())
- return Rewriter.expandCodeFor(NewBase, BaseInsertPt);
-
- Value *Base = Rewriter.expandCodeFor(NewBase, BaseInsertPt);
-
- // If we are inserting the base and imm values in the same block, make sure to
- // adjust the IP position if insertion reused a result.
- if (IP == BaseInsertPt)
- IP = Rewriter.getInsertionPoint();
-
- // Always emit the immediate (if non-zero) into the same block as the user.
- SCEVHandle NewValSCEV = SE->getAddExpr(SE->getUnknown(Base), Imm);
- return Rewriter.expandCodeFor(NewValSCEV, IP);
-
-}
-
-
-// Once we rewrite the code to insert the new IVs we want, update the
-// operands of Inst to use the new expression 'NewBase', with 'Imm' added
-// to it.
-void BasedUser::RewriteInstructionToUseNewBase(const SCEVHandle &NewBase,
- SCEVExpander &Rewriter, Loop *L, Pass *P,
- SmallPtrSet<Instruction*,16> &DeadInsts) {
- if (!isa<PHINode>(Inst)) {
- // By default, insert code at the user instruction.
- BasicBlock::iterator InsertPt = Inst;
-
- // However, if the Operand is itself an instruction, the (potentially
- // complex) inserted code may be shared by many users. Because of this, we
- // want to emit code for the computation of the operand right before its old
- // computation. This is usually safe, because we obviously used to use the
- // computation when it was computed in its current block. However, in some
- // cases (e.g. use of a post-incremented induction variable) the NewBase
- // value will be pinned to live somewhere after the original computation.
- // In this case, we have to back off.
- if (!isUseOfPostIncrementedValue) {
- if (Instruction *OpInst = dyn_cast<Instruction>(OperandValToReplace)) {
- InsertPt = OpInst;
- while (isa<PHINode>(InsertPt)) ++InsertPt;
- }
- }
- Value *NewVal = InsertCodeForBaseAtPosition(NewBase, Rewriter, InsertPt, L);
- // Adjust the type back to match the Inst. Note that we can't use InsertPt
- // here because the SCEVExpander may have inserted the instructions after
- // that point, in its efforts to avoid inserting redundant expressions.
- if (isa<PointerType>(OperandValToReplace->getType())) {
- NewVal = SCEVExpander::InsertCastOfTo(Instruction::IntToPtr,
- NewVal,
- OperandValToReplace->getType());
- }
- // Replace the use of the operand Value with the new Phi we just created.
- Inst->replaceUsesOfWith(OperandValToReplace, NewVal);
- DOUT << " CHANGED: IMM =" << *Imm;
- DOUT << " \tNEWBASE =" << *NewBase;
- DOUT << " \tInst = " << *Inst;
- return;
- }
-
- // PHI nodes are more complex. We have to insert one copy of the NewBase+Imm
- // expression into each operand block that uses it. Note that PHI nodes can
- // have multiple entries for the same predecessor. We use a map to make sure
- // that a PHI node only has a single Value* for each predecessor (which also
- // prevents us from inserting duplicate code in some blocks).
- DenseMap<BasicBlock*, Value*> InsertedCode;
- PHINode *PN = cast<PHINode>(Inst);
- for (unsigned i = 0, e = PN->getNumIncomingValues(); i != e; ++i) {
- if (PN->getIncomingValue(i) == OperandValToReplace) {
- // If this is a critical edge, split the edge so that we do not insert the
- // code on all predecessor/successor paths. We do this unless this is the
- // canonical backedge for this loop, as this can make some inserted code
- // be in an illegal position.
- BasicBlock *PHIPred = PN->getIncomingBlock(i);
- if (e != 1 && PHIPred->getTerminator()->getNumSuccessors() > 1 &&
- (PN->getParent() != L->getHeader() || !L->contains(PHIPred))) {
-
- // First step, split the critical edge.
- SplitCriticalEdge(PHIPred, PN->getParent(), P, false);
-
- // Next step: move the basic block. In particular, if the PHI node
- // is outside of the loop, and PredTI is in the loop, we want to
- // move the block to be immediately before the PHI block, not
- // immediately after PredTI.
- if (L->contains(PHIPred) && !L->contains(PN->getParent())) {
- BasicBlock *NewBB = PN->getIncomingBlock(i);
- NewBB->moveBefore(PN->getParent());
- }
-
- // Splitting the edge can reduce the number of PHI entries we have.
- e = PN->getNumIncomingValues();
- }
-
- Value *&Code = InsertedCode[PN->getIncomingBlock(i)];
- if (!Code) {
- // Insert the code into the end of the predecessor block.
- Instruction *InsertPt = PN->getIncomingBlock(i)->getTerminator();
- Code = InsertCodeForBaseAtPosition(NewBase, Rewriter, InsertPt, L);
-
- // Adjust the type back to match the PHI. Note that we can't use
- // InsertPt here because the SCEVExpander may have inserted its
- // instructions after that point, in its efforts to avoid inserting
- // redundant expressions.
- if (isa<PointerType>(PN->getType())) {
- Code = SCEVExpander::InsertCastOfTo(Instruction::IntToPtr,
- Code,
- PN->getType());
- }
- }
-
- // Replace the use of the operand Value with the new Phi we just created.
- PN->setIncomingValue(i, Code);
- Rewriter.clear();
- }
- }
-
- // PHI node might have become a constant value after SplitCriticalEdge.
- DeadInsts.insert(Inst);
-
- DOUT << " CHANGED: IMM =" << *Imm << " Inst = " << *Inst;
-}
-
-
-/// isTargetConstant - Return true if the following can be referenced by the
-/// immediate field of a target instruction.
-static bool isTargetConstant(const SCEVHandle &V, const Type *UseTy,
- const TargetLowering *TLI) {
- if (SCEVConstant *SC = dyn_cast<SCEVConstant>(V)) {
- int64_t VC = SC->getValue()->getSExtValue();
- if (TLI) {
- TargetLowering::AddrMode AM;
- AM.BaseOffs = VC;
- return TLI->isLegalAddressingMode(AM, UseTy);
- } else {
- // Defaults to PPC. PPC allows a sign-extended 16-bit immediate field.
- return (VC > -(1 << 16) && VC < (1 << 16)-1);
- }
- }
-
- if (SCEVUnknown *SU = dyn_cast<SCEVUnknown>(V))
- if (ConstantExpr *CE = dyn_cast<ConstantExpr>(SU->getValue()))
- if (TLI && CE->getOpcode() == Instruction::PtrToInt) {
- Constant *Op0 = CE->getOperand(0);
- if (GlobalValue *GV = dyn_cast<GlobalValue>(Op0)) {
- TargetLowering::AddrMode AM;
- AM.BaseGV = GV;
- return TLI->isLegalAddressingMode(AM, UseTy);
- }
- }
- return false;
-}
-
-/// MoveLoopVariantsToImediateField - Move any subexpressions from Val that are
-/// loop varying to the Imm operand.
-static void MoveLoopVariantsToImediateField(SCEVHandle &Val, SCEVHandle &Imm,
- Loop *L, ScalarEvolution *SE) {
- if (Val->isLoopInvariant(L)) return; // Nothing to do.
-
- if (SCEVAddExpr *SAE = dyn_cast<SCEVAddExpr>(Val)) {
- std::vector<SCEVHandle> NewOps;
- NewOps.reserve(SAE->getNumOperands());
-
- for (unsigned i = 0; i != SAE->getNumOperands(); ++i)
- if (!SAE->getOperand(i)->isLoopInvariant(L)) {
- // If this is a loop-variant expression, it must stay in the immediate
- // field of the expression.
- Imm = SE->getAddExpr(Imm, SAE->getOperand(i));
- } else {
- NewOps.push_back(SAE->getOperand(i));
- }
-
- if (NewOps.empty())
- Val = SE->getIntegerSCEV(0, Val->getType());
- else
- Val = SE->getAddExpr(NewOps);
- } else if (SCEVAddRecExpr *SARE = dyn_cast<SCEVAddRecExpr>(Val)) {
- // Try to pull immediates out of the start value of nested addrec's.
- SCEVHandle Start = SARE->getStart();
- MoveLoopVariantsToImediateField(Start, Imm, L, SE);
-
- std::vector<SCEVHandle> Ops(SARE->op_begin(), SARE->op_end());
- Ops[0] = Start;
- Val = SE->getAddRecExpr(Ops, SARE->getLoop());
- } else {
- // Otherwise, all of Val is variant, move the whole thing over.
- Imm = SE->getAddExpr(Imm, Val);
- Val = SE->getIntegerSCEV(0, Val->getType());
- }
-}
-
-
-/// MoveImmediateValues - Look at Val, and pull out any additions of constants
-/// that can fit into the immediate field of instructions in the target.
-/// Accumulate these immediate values into the Imm value.
-static void MoveImmediateValues(const TargetLowering *TLI,
- Instruction *User,
- SCEVHandle &Val, SCEVHandle &Imm,
- bool isAddress, Loop *L,
- ScalarEvolution *SE) {
- const Type *UseTy = User->getType();
- if (StoreInst *SI = dyn_cast<StoreInst>(User))
- UseTy = SI->getOperand(0)->getType();
-
- if (SCEVAddExpr *SAE = dyn_cast<SCEVAddExpr>(Val)) {
- std::vector<SCEVHandle> NewOps;
- NewOps.reserve(SAE->getNumOperands());
-
- for (unsigned i = 0; i != SAE->getNumOperands(); ++i) {
- SCEVHandle NewOp = SAE->getOperand(i);
- MoveImmediateValues(TLI, User, NewOp, Imm, isAddress, L, SE);
-
- if (!NewOp->isLoopInvariant(L)) {
- // If this is a loop-variant expression, it must stay in the immediate
- // field of the expression.
- Imm = SE->getAddExpr(Imm, NewOp);
- } else {
- NewOps.push_back(NewOp);
- }
- }
-
- if (NewOps.empty())
- Val = SE->getIntegerSCEV(0, Val->getType());
- else
- Val = SE->getAddExpr(NewOps);
- return;
- } else if (SCEVAddRecExpr *SARE = dyn_cast<SCEVAddRecExpr>(Val)) {
- // Try to pull immediates out of the start value of nested addrec's.
- SCEVHandle Start = SARE->getStart();
- MoveImmediateValues(TLI, User, Start, Imm, isAddress, L, SE);
-
- if (Start != SARE->getStart()) {
- std::vector<SCEVHandle> Ops(SARE->op_begin(), SARE->op_end());
- Ops[0] = Start;
- Val = SE->getAddRecExpr(Ops, SARE->getLoop());
- }
- return;
- } else if (SCEVMulExpr *SME = dyn_cast<SCEVMulExpr>(Val)) {
- // Transform "8 * (4 + v)" -> "32 + 8*V" if "32" fits in the immed field.
- if (isAddress && isTargetConstant(SME->getOperand(0), UseTy, TLI) &&
- SME->getNumOperands() == 2 && SME->isLoopInvariant(L)) {
-
- SCEVHandle SubImm = SE->getIntegerSCEV(0, Val->getType());
- SCEVHandle NewOp = SME->getOperand(1);
- MoveImmediateValues(TLI, User, NewOp, SubImm, isAddress, L, SE);
-
- // If we extracted something out of the subexpressions, see if we can
- // simplify this!
- if (NewOp != SME->getOperand(1)) {
- // Scale SubImm up by "8". If the result is a target constant, we are
- // good.
- SubImm = SE->getMulExpr(SubImm, SME->getOperand(0));
- if (isTargetConstant(SubImm, UseTy, TLI)) {
- // Accumulate the immediate.
- Imm = SE->getAddExpr(Imm, SubImm);
-
- // Update what is left of 'Val'.
- Val = SE->getMulExpr(SME->getOperand(0), NewOp);
- return;
- }
- }
- }
- }
-
- // Loop-variant expressions must stay in the immediate field of the
- // expression.
- if ((isAddress && isTargetConstant(Val, UseTy, TLI)) ||
- !Val->isLoopInvariant(L)) {
- Imm = SE->getAddExpr(Imm, Val);
- Val = SE->getIntegerSCEV(0, Val->getType());
- return;
- }
-
- // Otherwise, no immediates to move.
-}
-
-
-/// SeparateSubExprs - Decompose Expr into all of the subexpressions that are
-/// added together. This is used to reassociate common addition subexprs
-/// together for maximal sharing when rewriting bases.
-static void SeparateSubExprs(std::vector<SCEVHandle> &SubExprs,
- SCEVHandle Expr,
- ScalarEvolution *SE) {
- if (SCEVAddExpr *AE = dyn_cast<SCEVAddExpr>(Expr)) {
- for (unsigned j = 0, e = AE->getNumOperands(); j != e; ++j)
- SeparateSubExprs(SubExprs, AE->getOperand(j), SE);
- } else if (SCEVAddRecExpr *SARE = dyn_cast<SCEVAddRecExpr>(Expr)) {
- SCEVHandle Zero = SE->getIntegerSCEV(0, Expr->getType());
- if (SARE->getOperand(0) == Zero) {
- SubExprs.push_back(Expr);
- } else {
- // Compute the addrec with zero as its base.
- std::vector<SCEVHandle> Ops(SARE->op_begin(), SARE->op_end());
- Ops[0] = Zero; // Start with zero base.
- SubExprs.push_back(SE->getAddRecExpr(Ops, SARE->getLoop()));
-
-
- SeparateSubExprs(SubExprs, SARE->getOperand(0), SE);
- }
- } else if (!isa<SCEVConstant>(Expr) ||
- !cast<SCEVConstant>(Expr)->getValue()->isZero()) {
- // Do not add zero.
- SubExprs.push_back(Expr);
- }
-}
-
-
-/// RemoveCommonExpressionsFromUseBases - Look through all of the uses in Bases,
-/// removing any common subexpressions from it. Anything truly common is
-/// removed, accumulated, and returned. This looks for things like (a+b+c) and
-/// (a+c+d) -> (a+c). The common expression is *removed* from the Bases.
-static SCEVHandle
-RemoveCommonExpressionsFromUseBases(std::vector<BasedUser> &Uses,
- ScalarEvolution *SE) {
- unsigned NumUses = Uses.size();
-
- // Only one use? Use its base, regardless of what it is!
- SCEVHandle Zero = SE->getIntegerSCEV(0, Uses[0].Base->getType());
- SCEVHandle Result = Zero;
- if (NumUses == 1) {
- std::swap(Result, Uses[0].Base);
- return Result;
- }
-
- // To find common subexpressions, count how many of Uses use each expression.
- // If any subexpressions are used Uses.size() times, they are common.
- std::map<SCEVHandle, unsigned> SubExpressionUseCounts;
-
- // UniqueSubExprs - Keep track of all of the subexpressions we see in the
- // order we see them.
- std::vector<SCEVHandle> UniqueSubExprs;
-
- std::vector<SCEVHandle> SubExprs;
- for (unsigned i = 0; i != NumUses; ++i) {
- // If the base is zero (which is common), return zero now, there are no
- // CSEs we can find.
- if (Uses[i].Base == Zero) return Zero;
-
- // Split the expression into subexprs.
- SeparateSubExprs(SubExprs, Uses[i].Base, SE);
- // Add one to SubExpressionUseCounts for each subexpr present.
- for (unsigned j = 0, e = SubExprs.size(); j != e; ++j)
- if (++SubExpressionUseCounts[SubExprs[j]] == 1)
- UniqueSubExprs.push_back(SubExprs[j]);
- SubExprs.clear();
- }
-
- // Now that we know how many times each is used, build Result. Iterate over
- // UniqueSubexprs so that we have a stable ordering.
- for (unsigned i = 0, e = UniqueSubExprs.size(); i != e; ++i) {
- std::map<SCEVHandle, unsigned>::iterator I =
- SubExpressionUseCounts.find(UniqueSubExprs[i]);
- assert(I != SubExpressionUseCounts.end() && "Entry not found?");
- if (I->second == NumUses) { // Found CSE!
- Result = SE->getAddExpr(Result, I->first);
- } else {
- // Remove non-cse's from SubExpressionUseCounts.
- SubExpressionUseCounts.erase(I);
- }
- }
-
- // If we found no CSE's, return now.
- if (Result == Zero) return Result;
-
- // Otherwise, remove all of the CSE's we found from each of the base values.
- for (unsigned i = 0; i != NumUses; ++i) {
- // Split the expression into subexprs.
- SeparateSubExprs(SubExprs, Uses[i].Base, SE);
-
- // Remove any common subexpressions.
- for (unsigned j = 0, e = SubExprs.size(); j != e; ++j)
- if (SubExpressionUseCounts.count(SubExprs[j])) {
- SubExprs.erase(SubExprs.begin()+j);
- --j; --e;
- }
-
- // Finally, the non-shared expressions together.
- if (SubExprs.empty())
- Uses[i].Base = Zero;
- else
- Uses[i].Base = SE->getAddExpr(SubExprs);
- SubExprs.clear();
- }
-
- return Result;
-}
-
-/// isZero - returns true if the scalar evolution expression is zero.
-///
-static bool isZero(const SCEVHandle &V) {
- if (const SCEVConstant *SC = dyn_cast<SCEVConstant>(V))
- return SC->getValue()->isZero();
- return false;
-}
-
-/// ValidStride - Check whether the given Scale is valid for all loads and
-/// stores in UsersToProcess.
-///
-bool LoopStrengthReduce::ValidStride(bool HasBaseReg,
- int64_t Scale,
- const std::vector<BasedUser>& UsersToProcess) {
- if (!TLI)
- return true;
-
- for (unsigned i=0, e = UsersToProcess.size(); i!=e; ++i) {
- // If this is a load or other access, pass the type of the access in.
- const Type *AccessTy = Type::VoidTy;
- if (StoreInst *SI = dyn_cast<StoreInst>(UsersToProcess[i].Inst))
- AccessTy = SI->getOperand(0)->getType();
- else if (LoadInst *LI = dyn_cast<LoadInst>(UsersToProcess[i].Inst))
- AccessTy = LI->getType();
- else if (isa<PHINode>(UsersToProcess[i].Inst))
- continue;
-
- TargetLowering::AddrMode AM;
- if (SCEVConstant *SC = dyn_cast<SCEVConstant>(UsersToProcess[i].Imm))
- AM.BaseOffs = SC->getValue()->getSExtValue();
- AM.HasBaseReg = HasBaseReg || !isZero(UsersToProcess[i].Base);
- AM.Scale = Scale;
-
- // If load[imm+r*scale] is illegal, bail out.
- if (!TLI->isLegalAddressingMode(AM, AccessTy))
- return false;
- }
- return true;
-}
-
-/// RequiresTypeConversion - Returns true if converting Ty to NewTy is not
-/// a nop.
-bool LoopStrengthReduce::RequiresTypeConversion(const Type *Ty1,
- const Type *Ty2) {
- if (Ty1 == Ty2)
- return false;
- if (TLI && TLI->isTruncateFree(Ty1, Ty2))
- return false;
- return (!Ty1->canLosslesslyBitCastTo(Ty2) &&
- !(isa<PointerType>(Ty2) &&
- Ty1->canLosslesslyBitCastTo(UIntPtrTy)) &&
- !(isa<PointerType>(Ty1) &&
- Ty2->canLosslesslyBitCastTo(UIntPtrTy)));
-}
-
-/// CheckForIVReuse - Returns the multiple if the stride is the multiple
-/// of a previous stride and it is a legal value for the target addressing
-/// mode scale component and optional base reg. This allows the users of
-/// this stride to be rewritten as prev iv * factor. It returns 0 if no
-/// reuse is possible.
-unsigned LoopStrengthReduce::CheckForIVReuse(bool HasBaseReg,
- bool AllUsesAreAddresses,
- const SCEVHandle &Stride,
- IVExpr &IV, const Type *Ty,
- const std::vector<BasedUser>& UsersToProcess) {
- if (SCEVConstant *SC = dyn_cast<SCEVConstant>(Stride)) {
- int64_t SInt = SC->getValue()->getSExtValue();
- for (unsigned NewStride = 0, e = StrideOrder.size(); NewStride != e;
- ++NewStride) {
- std::map<SCEVHandle, IVsOfOneStride>::iterator SI =
- IVsByStride.find(StrideOrder[NewStride]);
- if (SI == IVsByStride.end())
- continue;
- int64_t SSInt = cast<SCEVConstant>(SI->first)->getValue()->getSExtValue();
- if (SI->first != Stride &&
- (unsigned(abs(SInt)) < SSInt || (SInt % SSInt) != 0))
- continue;
- int64_t Scale = SInt / SSInt;
- // Check that this stride is valid for all the types used for loads and
- // stores; if it can be used for some and not others, we might as well use
- // the original stride everywhere, since we have to create the IV for it
- // anyway. If the scale is 1, then we don't need to worry about folding
- // multiplications.
- if (Scale == 1 ||
- (AllUsesAreAddresses &&
- ValidStride(HasBaseReg, Scale, UsersToProcess)))
- for (std::vector<IVExpr>::iterator II = SI->second.IVs.begin(),
- IE = SI->second.IVs.end(); II != IE; ++II)
- // FIXME: Only handle base == 0 for now.
- // Only reuse previous IV if it would not require a type conversion.
- if (isZero(II->Base) &&
- !RequiresTypeConversion(II->Base->getType(), Ty)) {
- IV = *II;
- return Scale;
- }
- }
- }
- return 0;
-}
-
-/// PartitionByIsUseOfPostIncrementedValue - Simple boolean predicate that
-/// returns true if Val's isUseOfPostIncrementedValue is true.
-static bool PartitionByIsUseOfPostIncrementedValue(const BasedUser &Val) {
- return Val.isUseOfPostIncrementedValue;
-}
-
-/// isNonConstantNegative - Return true if the specified scev is negated, but
-/// not a constant.
-static bool isNonConstantNegative(const SCEVHandle &Expr) {
- SCEVMulExpr *Mul = dyn_cast<SCEVMulExpr>(Expr);
- if (!Mul) return false;
-
- // If there is a constant factor, it will be first.
- SCEVConstant *SC = dyn_cast<SCEVConstant>(Mul->getOperand(0));
- if (!SC) return false;
-
- // Return true if the value is negative, this matches things like (-42 * V).
- return SC->getValue()->getValue().isNegative();
-}
-
-/// isAddress - Returns true if the specified instruction is using the
-/// specified value as an address.
-static bool isAddressUse(Instruction *Inst, Value *OperandVal) {
- bool isAddress = isa<LoadInst>(Inst);
- if (StoreInst *SI = dyn_cast<StoreInst>(Inst)) {
- if (SI->getOperand(1) == OperandVal)
- isAddress = true;
- } else if (IntrinsicInst *II = dyn_cast<IntrinsicInst>(Inst)) {
- // Addressing modes can also be folded into prefetches and a variety
- // of intrinsics.
- switch (II->getIntrinsicID()) {
- default: break;
- case Intrinsic::prefetch:
- case Intrinsic::x86_sse2_loadu_dq:
- case Intrinsic::x86_sse2_loadu_pd:
- case Intrinsic::x86_sse_loadu_ps:
- case Intrinsic::x86_sse_storeu_ps:
- case Intrinsic::x86_sse2_storeu_pd:
- case Intrinsic::x86_sse2_storeu_dq:
- case Intrinsic::x86_sse2_storel_dq:
- if (II->getOperand(1) == OperandVal)
- isAddress = true;
- break;
- case Intrinsic::x86_sse2_loadh_pd:
- case Intrinsic::x86_sse2_loadl_pd:
- if (II->getOperand(2) == OperandVal)
- isAddress = true;
- break;
- }
- }
- return isAddress;
-}
-
-// CollectIVUsers - Transform our list of users and offsets to a bit more
-// complex table. In this new vector, each 'BasedUser' contains 'Base' the base
-// of the strided accessas well as the old information from Uses. We
-// progressively move information from the Base field to the Imm field, until
-// we eventually have the full access expression to rewrite the use.
-SCEVHandle LoopStrengthReduce::CollectIVUsers(const SCEVHandle &Stride,
- IVUsersOfOneStride &Uses,
- Loop *L,
- bool &AllUsesAreAddresses,
- std::vector<BasedUser> &UsersToProcess) {
- UsersToProcess.reserve(Uses.Users.size());
- for (unsigned i = 0, e = Uses.Users.size(); i != e; ++i) {
- UsersToProcess.push_back(BasedUser(Uses.Users[i], SE));
-
- // Move any loop invariant operands from the offset field to the immediate
- // field of the use, so that we don't try to use something before it is
- // computed.
- MoveLoopVariantsToImediateField(UsersToProcess.back().Base,
- UsersToProcess.back().Imm, L, SE);
- assert(UsersToProcess.back().Base->isLoopInvariant(L) &&
- "Base value is not loop invariant!");
- }
-
- // We now have a whole bunch of uses of like-strided induction variables, but
- // they might all have different bases. We want to emit one PHI node for this
- // stride which we fold as many common expressions (between the IVs) into as
- // possible. Start by identifying the common expressions in the base values
- // for the strides (e.g. if we have "A+C+B" and "A+B+D" as our bases, find
- // "A+B"), emit it to the preheader, then remove the expression from the
- // UsersToProcess base values.
- SCEVHandle CommonExprs =
- RemoveCommonExpressionsFromUseBases(UsersToProcess, SE);
-
- // Next, figure out what we can represent in the immediate fields of
- // instructions. If we can represent anything there, move it to the imm
- // fields of the BasedUsers. We do this so that it increases the commonality
- // of the remaining uses.
- unsigned NumPHI = 0;
- for (unsigned i = 0, e = UsersToProcess.size(); i != e; ++i) {
- // If the user is not in the current loop, this means it is using the exit
- // value of the IV. Do not put anything in the base, make sure it's all in
- // the immediate field to allow as much factoring as possible.
- if (!L->contains(UsersToProcess[i].Inst->getParent())) {
- UsersToProcess[i].Imm = SE->getAddExpr(UsersToProcess[i].Imm,
- UsersToProcess[i].Base);
- UsersToProcess[i].Base =
- SE->getIntegerSCEV(0, UsersToProcess[i].Base->getType());
- } else {
-
- // Addressing modes can be folded into loads and stores. Be careful that
- // the store is through the expression, not of the expression though.
- bool isPHI = false;
- bool isAddress = isAddressUse(UsersToProcess[i].Inst,
- UsersToProcess[i].OperandValToReplace);
- if (isa<PHINode>(UsersToProcess[i].Inst)) {
- isPHI = true;
- ++NumPHI;
- }
-
- // If this use isn't an address, then not all uses are addresses.
- if (!isAddress && !isPHI)
- AllUsesAreAddresses = false;
-
- MoveImmediateValues(TLI, UsersToProcess[i].Inst, UsersToProcess[i].Base,
- UsersToProcess[i].Imm, isAddress, L, SE);
- }
- }
-
- // If one of the use if a PHI node and all other uses are addresses, still
- // allow iv reuse. Essentially we are trading one constant multiplication
- // for one fewer iv.
- if (NumPHI > 1)
- AllUsesAreAddresses = false;
-
- return CommonExprs;
-}
-
-/// StrengthReduceStridedIVUsers - Strength reduce all of the users of a single
-/// stride of IV. All of the users may have different starting values, and this
-/// may not be the only stride (we know it is if isOnlyStride is true).
-void LoopStrengthReduce::StrengthReduceStridedIVUsers(const SCEVHandle &Stride,
- IVUsersOfOneStride &Uses,
- Loop *L,
- bool isOnlyStride) {
- // If all the users are moved to another stride, then there is nothing to do.
- if (Uses.Users.empty())
- return;
-
- // Keep track if every use in UsersToProcess is an address. If they all are,
- // we may be able to rewrite the entire collection of them in terms of a
- // smaller-stride IV.
- bool AllUsesAreAddresses = true;
-
- // Transform our list of users and offsets to a bit more complex table. In
- // this new vector, each 'BasedUser' contains 'Base' the base of the
- // strided accessas well as the old information from Uses. We progressively
- // move information from the Base field to the Imm field, until we eventually
- // have the full access expression to rewrite the use.
- std::vector<BasedUser> UsersToProcess;
- SCEVHandle CommonExprs = CollectIVUsers(Stride, Uses, L, AllUsesAreAddresses,
- UsersToProcess);
-
- // If we managed to find some expressions in common, we'll need to carry
- // their value in a register and add it in for each use. This will take up
- // a register operand, which potentially restricts what stride values are
- // valid.
- bool HaveCommonExprs = !isZero(CommonExprs);
-
- // If all uses are addresses, check if it is possible to reuse an IV with a
- // stride that is a factor of this stride. And that the multiple is a number
- // that can be encoded in the scale field of the target addressing mode. And
- // that we will have a valid instruction after this substition, including the
- // immediate field, if any.
- PHINode *NewPHI = NULL;
- Value *IncV = NULL;
- IVExpr ReuseIV(SE->getIntegerSCEV(0, Type::Int32Ty),
- SE->getIntegerSCEV(0, Type::Int32Ty),
- 0, 0);
- unsigned RewriteFactor = 0;
- RewriteFactor = CheckForIVReuse(HaveCommonExprs, AllUsesAreAddresses,
- Stride, ReuseIV, CommonExprs->getType(),
- UsersToProcess);
- if (RewriteFactor != 0) {
- DOUT << "BASED ON IV of STRIDE " << *ReuseIV.Stride
- << " and BASE " << *ReuseIV.Base << " :\n";
- NewPHI = ReuseIV.PHI;
- IncV = ReuseIV.IncV;
- }
-
- const Type *ReplacedTy = CommonExprs->getType();
-
- // Now that we know what we need to do, insert the PHI node itself.
- //
- DOUT << "INSERTING IV of TYPE " << *ReplacedTy << " of STRIDE "
- << *Stride << " and BASE " << *CommonExprs << ": ";
-
- SCEVExpander Rewriter(*SE, *LI);
- SCEVExpander PreheaderRewriter(*SE, *LI);
-
- BasicBlock *Preheader = L->getLoopPreheader();
- Instruction *PreInsertPt = Preheader->getTerminator();
- Instruction *PhiInsertBefore = L->getHeader()->begin();
-
- BasicBlock *LatchBlock = L->getLoopLatch();
-
-
- // Emit the initial base value into the loop preheader.
- Value *CommonBaseV
- = PreheaderRewriter.expandCodeFor(CommonExprs, PreInsertPt);
-
- if (RewriteFactor == 0) {
- // Create a new Phi for this base, and stick it in the loop header.
- NewPHI = PHINode::Create(ReplacedTy, "iv.", PhiInsertBefore);
- ++NumInserted;
-
- // Add common base to the new Phi node.
- NewPHI->addIncoming(CommonBaseV, Preheader);
-
- // If the stride is negative, insert a sub instead of an add for the
- // increment.
- bool isNegative = isNonConstantNegative(Stride);
- SCEVHandle IncAmount = Stride;
- if (isNegative)
- IncAmount = SE->getNegativeSCEV(Stride);
-
- // Insert the stride into the preheader.
- Value *StrideV = PreheaderRewriter.expandCodeFor(IncAmount, PreInsertPt);
- if (!isa<ConstantInt>(StrideV)) ++NumVariable;
-
- // Emit the increment of the base value before the terminator of the loop
- // latch block, and add it to the Phi node.
- SCEVHandle IncExp = SE->getUnknown(StrideV);
- if (isNegative)
- IncExp = SE->getNegativeSCEV(IncExp);
- IncExp = SE->getAddExpr(SE->getUnknown(NewPHI), IncExp);
-
- IncV = Rewriter.expandCodeFor(IncExp, LatchBlock->getTerminator());
- IncV->setName(NewPHI->getName()+".inc");
- NewPHI->addIncoming(IncV, LatchBlock);
-
- // Remember this in case a later stride is multiple of this.
- IVsByStride[Stride].addIV(Stride, CommonExprs, NewPHI, IncV);
-
- DOUT << " IV=%" << NewPHI->getNameStr() << " INC=%" << IncV->getNameStr();
- } else {
- Constant *C = dyn_cast<Constant>(CommonBaseV);
- if (!C ||
- (!C->isNullValue() &&
- !isTargetConstant(SE->getUnknown(CommonBaseV), ReplacedTy, TLI)))
- // We want the common base emitted into the preheader! This is just
- // using cast as a copy so BitCast (no-op cast) is appropriate
- CommonBaseV = new BitCastInst(CommonBaseV, CommonBaseV->getType(),
- "commonbase", PreInsertPt);
- }
- DOUT << "\n";
-
- // We want to emit code for users inside the loop first. To do this, we
- // rearrange BasedUser so that the entries at the end have
- // isUseOfPostIncrementedValue = false, because we pop off the end of the
- // vector (so we handle them first).
- std::partition(UsersToProcess.begin(), UsersToProcess.end(),
- PartitionByIsUseOfPostIncrementedValue);
-
- // Sort this by base, so that things with the same base are handled
- // together. By partitioning first and stable-sorting later, we are
- // guaranteed that within each base we will pop off users from within the
- // loop before users outside of the loop with a particular base.
- //
- // We would like to use stable_sort here, but we can't. The problem is that
- // SCEVHandle's don't have a deterministic ordering w.r.t to each other, so
- // we don't have anything to do a '<' comparison on. Because we think the
- // number of uses is small, do a horrible bubble sort which just relies on
- // ==.
- for (unsigned i = 0, e = UsersToProcess.size(); i != e; ++i) {
- // Get a base value.
- SCEVHandle Base = UsersToProcess[i].Base;
-
- // Compact everything with this base to be consequtive with this one.
- for (unsigned j = i+1; j != e; ++j) {
- if (UsersToProcess[j].Base == Base) {
- std::swap(UsersToProcess[i+1], UsersToProcess[j]);
- ++i;
- }
- }
- }
-
- // Process all the users now. This outer loop handles all bases, the inner
- // loop handles all users of a particular base.
- while (!UsersToProcess.empty()) {
- SCEVHandle Base = UsersToProcess.back().Base;
-
- // Emit the code for Base into the preheader.
- Value *BaseV = PreheaderRewriter.expandCodeFor(Base, PreInsertPt);
-
- DOUT << " INSERTING code for BASE = " << *Base << ":";
- if (BaseV->hasName())
- DOUT << " Result value name = %" << BaseV->getNameStr();
- DOUT << "\n";
-
- // If BaseV is a constant other than 0, make sure that it gets inserted into
- // the preheader, instead of being forward substituted into the uses. We do
- // this by forcing a BitCast (noop cast) to be inserted into the preheader
- // in this case.
- if (Constant *C = dyn_cast<Constant>(BaseV)) {
- if (!C->isNullValue() && !isTargetConstant(Base, ReplacedTy, TLI)) {
- // We want this constant emitted into the preheader! This is just
- // using cast as a copy so BitCast (no-op cast) is appropriate
- BaseV = new BitCastInst(BaseV, BaseV->getType(), "preheaderinsert",
- PreInsertPt);
- }
- }
-
- // Emit the code to add the immediate offset to the Phi value, just before
- // the instructions that we identified as using this stride and base.
- do {
- // FIXME: Use emitted users to emit other users.
- BasedUser &User = UsersToProcess.back();
-
- // If this instruction wants to use the post-incremented value, move it
- // after the post-inc and use its value instead of the PHI.
- Value *RewriteOp = NewPHI;
- if (User.isUseOfPostIncrementedValue) {
- RewriteOp = IncV;
-
- // If this user is in the loop, make sure it is the last thing in the
- // loop to ensure it is dominated by the increment.
- if (L->contains(User.Inst->getParent()))
- User.Inst->moveBefore(LatchBlock->getTerminator());
- }
- if (RewriteOp->getType() != ReplacedTy) {
- Instruction::CastOps opcode = Instruction::Trunc;
- if (ReplacedTy->getPrimitiveSizeInBits() ==
- RewriteOp->getType()->getPrimitiveSizeInBits())
- opcode = Instruction::BitCast;
- RewriteOp = SCEVExpander::InsertCastOfTo(opcode, RewriteOp, ReplacedTy);
- }
-
- SCEVHandle RewriteExpr = SE->getUnknown(RewriteOp);
-
- // Clear the SCEVExpander's expression map so that we are guaranteed
- // to have the code emitted where we expect it.
- Rewriter.clear();
-
- // If we are reusing the iv, then it must be multiplied by a constant
- // factor take advantage of addressing mode scale component.
- if (RewriteFactor != 0) {
- RewriteExpr = SE->getMulExpr(SE->getIntegerSCEV(RewriteFactor,
- RewriteExpr->getType()),
- RewriteExpr);
-
- // The common base is emitted in the loop preheader. But since we
- // are reusing an IV, it has not been used to initialize the PHI node.
- // Add it to the expression used to rewrite the uses.
- if (!isa<ConstantInt>(CommonBaseV) ||
- !cast<ConstantInt>(CommonBaseV)->isZero())
- RewriteExpr = SE->getAddExpr(RewriteExpr,
- SE->getUnknown(CommonBaseV));
- }
-
- // Now that we know what we need to do, insert code before User for the
- // immediate and any loop-variant expressions.
- if (!isa<ConstantInt>(BaseV) || !cast<ConstantInt>(BaseV)->isZero())
- // Add BaseV to the PHI value if needed.
- RewriteExpr = SE->getAddExpr(RewriteExpr, SE->getUnknown(BaseV));
-
- User.RewriteInstructionToUseNewBase(RewriteExpr, Rewriter, L, this,
- DeadInsts);
-
- // Mark old value we replaced as possibly dead, so that it is elminated
- // if we just replaced the last use of that value.
- DeadInsts.insert(cast<Instruction>(User.OperandValToReplace));
-
- UsersToProcess.pop_back();
- ++NumReduced;
-
- // If there are any more users to process with the same base, process them
- // now. We sorted by base above, so we just have to check the last elt.
- } while (!UsersToProcess.empty() && UsersToProcess.back().Base == Base);
- // TODO: Next, find out which base index is the most common, pull it out.
- }
-
- // IMPORTANT TODO: Figure out how to partition the IV's with this stride, but
- // different starting values, into different PHIs.
-}
-
-/// FindIVForUser - If Cond has an operand that is an expression of an IV,
-/// set the IV user and stride information and return true, otherwise return
-/// false.
-bool LoopStrengthReduce::FindIVForUser(ICmpInst *Cond, IVStrideUse *&CondUse,
- const SCEVHandle *&CondStride) {
- for (unsigned Stride = 0, e = StrideOrder.size(); Stride != e && !CondUse;
- ++Stride) {
- std::map<SCEVHandle, IVUsersOfOneStride>::iterator SI =
- IVUsesByStride.find(StrideOrder[Stride]);
- assert(SI != IVUsesByStride.end() && "Stride doesn't exist!");
-
- for (std::vector<IVStrideUse>::iterator UI = SI->second.Users.begin(),
- E = SI->second.Users.end(); UI != E; ++UI)
- if (UI->User == Cond) {
- // NOTE: we could handle setcc instructions with multiple uses here, but
- // InstCombine does it as well for simple uses, it's not clear that it
- // occurs enough in real life to handle.
- CondUse = &*UI;
- CondStride = &SI->first;
- return true;
- }
- }
- return false;
-}
-
-namespace {
- // Constant strides come first which in turns are sorted by their absolute
- // values. If absolute values are the same, then positive strides comes first.
- // e.g.
- // 4, -1, X, 1, 2 ==> 1, -1, 2, 4, X
- struct StrideCompare {
- bool operator()(const SCEVHandle &LHS, const SCEVHandle &RHS) {
- SCEVConstant *LHSC = dyn_cast<SCEVConstant>(LHS);
- SCEVConstant *RHSC = dyn_cast<SCEVConstant>(RHS);
- if (LHSC && RHSC) {
- int64_t LV = LHSC->getValue()->getSExtValue();
- int64_t RV = RHSC->getValue()->getSExtValue();
- uint64_t ALV = (LV < 0) ? -LV : LV;
- uint64_t ARV = (RV < 0) ? -RV : RV;
- if (ALV == ARV)
- return LV > RV;
- else
- return ALV < ARV;
- }
- return (LHSC && !RHSC);
- }
- };
-}
-
-/// ChangeCompareStride - If a loop termination compare instruction is the
-/// only use of its stride, and the compaison is against a constant value,
-/// try eliminate the stride by moving the compare instruction to another
-/// stride and change its constant operand accordingly. e.g.
-///
-/// loop:
-/// ...
-/// v1 = v1 + 3
-/// v2 = v2 + 1
-/// if (v2 < 10) goto loop
-/// =>
-/// loop:
-/// ...
-/// v1 = v1 + 3
-/// if (v1 < 30) goto loop
-ICmpInst *LoopStrengthReduce::ChangeCompareStride(Loop *L, ICmpInst *Cond,
- IVStrideUse* &CondUse,
- const SCEVHandle* &CondStride) {
- if (StrideOrder.size() < 2 ||
- IVUsesByStride[*CondStride].Users.size() != 1)
- return Cond;
- const SCEVConstant *SC = dyn_cast<SCEVConstant>(*CondStride);
- if (!SC) return Cond;
- ConstantInt *C = dyn_cast<ConstantInt>(Cond->getOperand(1));
- if (!C) return Cond;
-
- ICmpInst::Predicate Predicate = Cond->getPredicate();
- int64_t CmpSSInt = SC->getValue()->getSExtValue();
- int64_t CmpVal = C->getValue().getSExtValue();
- unsigned BitWidth = C->getValue().getBitWidth();
- uint64_t SignBit = 1ULL << (BitWidth-1);
- const Type *CmpTy = C->getType();
- const Type *NewCmpTy = NULL;
- unsigned TyBits = CmpTy->getPrimitiveSizeInBits();
- unsigned NewTyBits = 0;
- int64_t NewCmpVal = CmpVal;
- SCEVHandle *NewStride = NULL;
- Value *NewIncV = NULL;
- int64_t Scale = 1;
-
- // Look for a suitable stride / iv as replacement.
- std::stable_sort(StrideOrder.begin(), StrideOrder.end(), StrideCompare());
- for (unsigned i = 0, e = StrideOrder.size(); i != e; ++i) {
- std::map<SCEVHandle, IVUsersOfOneStride>::iterator SI =
- IVUsesByStride.find(StrideOrder[i]);
- if (!isa<SCEVConstant>(SI->first))
- continue;
- int64_t SSInt = cast<SCEVConstant>(SI->first)->getValue()->getSExtValue();
- if (abs(SSInt) <= abs(CmpSSInt) || (SSInt % CmpSSInt) != 0)
- continue;
-
- Scale = SSInt / CmpSSInt;
- NewCmpVal = CmpVal * Scale;
- APInt Mul = APInt(BitWidth, NewCmpVal);
- // Check for overflow.
- if (Mul.getSExtValue() != NewCmpVal) {
- NewCmpVal = CmpVal;
- continue;
- }
-
- // Watch out for overflow.
- if (ICmpInst::isSignedPredicate(Predicate) &&
- (CmpVal & SignBit) != (NewCmpVal & SignBit))
- NewCmpVal = CmpVal;
-
- if (NewCmpVal != CmpVal) {
- // Pick the best iv to use trying to avoid a cast.
- NewIncV = NULL;
- for (std::vector<IVStrideUse>::iterator UI = SI->second.Users.begin(),
- E = SI->second.Users.end(); UI != E; ++UI) {
- NewIncV = UI->OperandValToReplace;
- if (NewIncV->getType() == CmpTy)
- break;
- }
- if (!NewIncV) {
- NewCmpVal = CmpVal;
- continue;
- }
-
- NewCmpTy = NewIncV->getType();
- NewTyBits = isa<PointerType>(NewCmpTy)
- ? UIntPtrTy->getPrimitiveSizeInBits()
- : NewCmpTy->getPrimitiveSizeInBits();
- if (RequiresTypeConversion(NewCmpTy, CmpTy)) {
- // Check if it is possible to rewrite it using a iv / stride of a smaller
- // integer type.
- bool TruncOk = false;
- if (NewCmpTy->isInteger()) {
- unsigned Bits = NewTyBits;
- if (ICmpInst::isSignedPredicate(Predicate))
- --Bits;
- uint64_t Mask = (1ULL << Bits) - 1;
- if (((uint64_t)NewCmpVal & Mask) == (uint64_t)NewCmpVal)
- TruncOk = true;
- }
- if (!TruncOk) {
- NewCmpVal = CmpVal;
- continue;
- }
- }
-
- // Don't rewrite if use offset is non-constant and the new type is
- // of a different type.
- // FIXME: too conservative?
- if (NewTyBits != TyBits && !isa<SCEVConstant>(CondUse->Offset)) {
- NewCmpVal = CmpVal;
- continue;
- }
-
- bool AllUsesAreAddresses = true;
- std::vector<BasedUser> UsersToProcess;
- SCEVHandle CommonExprs = CollectIVUsers(SI->first, SI->second, L,
- AllUsesAreAddresses,
- UsersToProcess);
- // Avoid rewriting the compare instruction with an iv of new stride
- // if it's likely the new stride uses will be rewritten using the
- if (AllUsesAreAddresses &&
- ValidStride(!isZero(CommonExprs), Scale, UsersToProcess)) {
- NewCmpVal = CmpVal;
- continue;
- }
-
- // If scale is negative, use inverse predicate unless it's testing
- // for equality.
- if (Scale < 0 && !Cond->isEquality())
- Predicate = ICmpInst::getInversePredicate(Predicate);
-
- NewStride = &StrideOrder[i];
- break;
- }
- }
-
- if (NewCmpVal != CmpVal) {
- // Create a new compare instruction using new stride / iv.
- ICmpInst *OldCond = Cond;
- Value *RHS;
- if (!isa<PointerType>(NewCmpTy))
- RHS = ConstantInt::get(NewCmpTy, NewCmpVal);
- else {
- RHS = ConstantInt::get(UIntPtrTy, NewCmpVal);
- RHS = SCEVExpander::InsertCastOfTo(Instruction::IntToPtr, RHS, NewCmpTy);
- }
- // Insert new compare instruction.
- Cond = new ICmpInst(Predicate, NewIncV, RHS);
- Cond->setName(L->getHeader()->getName() + ".termcond");
- OldCond->getParent()->getInstList().insert(OldCond, Cond);
-
- // Remove the old compare instruction. The old indvar is probably dead too.
- DeadInsts.insert(cast<Instruction>(CondUse->OperandValToReplace));
- OldCond->replaceAllUsesWith(Cond);
- SE->deleteValueFromRecords(OldCond);
- OldCond->eraseFromParent();
-
- IVUsesByStride[*CondStride].Users.pop_back();
- SCEVHandle NewOffset = TyBits == NewTyBits
- ? SE->getMulExpr(CondUse->Offset,
- SE->getConstant(ConstantInt::get(CmpTy, Scale)))
- : SE->getConstant(ConstantInt::get(NewCmpTy,
- cast<SCEVConstant>(CondUse->Offset)->getValue()->getSExtValue()*Scale));
- IVUsesByStride[*NewStride].addUser(NewOffset, Cond, NewIncV);
- CondUse = &IVUsesByStride[*NewStride].Users.back();
- CondStride = NewStride;
- ++NumEliminated;
- }
-
- return Cond;
-}
-
-// OptimizeIndvars - Now that IVUsesByStride is set up with all of the indvar
-// uses in the loop, look to see if we can eliminate some, in favor of using
-// common indvars for the different uses.
-void LoopStrengthReduce::OptimizeIndvars(Loop *L) {
- // TODO: implement optzns here.
-
- // Finally, get the terminating condition for the loop if possible. If we
- // can, we want to change it to use a post-incremented version of its
- // induction variable, to allow coalescing the live ranges for the IV into
- // one register value.
- PHINode *SomePHI = cast<PHINode>(L->getHeader()->begin());
- BasicBlock *Preheader = L->getLoopPreheader();
- BasicBlock *LatchBlock =
- SomePHI->getIncomingBlock(SomePHI->getIncomingBlock(0) == Preheader);
- BranchInst *TermBr = dyn_cast<BranchInst>(LatchBlock->getTerminator());
- if (!TermBr || TermBr->isUnconditional() ||
- !isa<ICmpInst>(TermBr->getCondition()))
- return;
- ICmpInst *Cond = cast<ICmpInst>(TermBr->getCondition());
-
- // Search IVUsesByStride to find Cond's IVUse if there is one.
- IVStrideUse *CondUse = 0;
- const SCEVHandle *CondStride = 0;
-
- if (!FindIVForUser(Cond, CondUse, CondStride))
- return; // setcc doesn't use the IV.
-
- // If possible, change stride and operands of the compare instruction to
- // eliminate one stride.
- Cond = ChangeCompareStride(L, Cond, CondUse, CondStride);
-
- // It's possible for the setcc instruction to be anywhere in the loop, and
- // possible for it to have multiple users. If it is not immediately before
- // the latch block branch, move it.
- if (&*++BasicBlock::iterator(Cond) != (Instruction*)TermBr) {
- if (Cond->hasOneUse()) { // Condition has a single use, just move it.
- Cond->moveBefore(TermBr);
- } else {
- // Otherwise, clone the terminating condition and insert into the loopend.
- Cond = cast<ICmpInst>(Cond->clone());
- Cond->setName(L->getHeader()->getName() + ".termcond");
- LatchBlock->getInstList().insert(TermBr, Cond);
-
- // Clone the IVUse, as the old use still exists!
- IVUsesByStride[*CondStride].addUser(CondUse->Offset, Cond,
- CondUse->OperandValToReplace);
- CondUse = &IVUsesByStride[*CondStride].Users.back();
- }
- }
-
- // If we get to here, we know that we can transform the setcc instruction to
- // use the post-incremented version of the IV, allowing us to coalesce the
- // live ranges for the IV correctly.
- CondUse->Offset = SE->getMinusSCEV(CondUse->Offset, *CondStride);
- CondUse->isUseOfPostIncrementedValue = true;
-}
-
-bool LoopStrengthReduce::runOnLoop(Loop *L, LPPassManager &LPM) {
-
- LI = &getAnalysis<LoopInfo>();
- DT = &getAnalysis<DominatorTree>();
- SE = &getAnalysis<ScalarEvolution>();
- TD = &getAnalysis<TargetData>();
- UIntPtrTy = TD->getIntPtrType();
-
- // Find all uses of induction variables in this loop, and catagorize
- // them by stride. Start by finding all of the PHI nodes in the header for
- // this loop. If they are induction variables, inspect their uses.
- SmallPtrSet<Instruction*,16> Processed; // Don't reprocess instructions.
- for (BasicBlock::iterator I = L->getHeader()->begin(); isa<PHINode>(I); ++I)
- AddUsersIfInteresting(I, L, Processed);
-
- // If we have nothing to do, return.
- if (IVUsesByStride.empty()) return false;
-
- // Optimize induction variables. Some indvar uses can be transformed to use
- // strides that will be needed for other purposes. A common example of this
- // is the exit test for the loop, which can often be rewritten to use the
- // computation of some other indvar to decide when to terminate the loop.
- OptimizeIndvars(L);
-
-
- // FIXME: We can widen subreg IV's here for RISC targets. e.g. instead of
- // doing computation in byte values, promote to 32-bit values if safe.
-
- // FIXME: Attempt to reuse values across multiple IV's. In particular, we
- // could have something like "for(i) { foo(i*8); bar(i*16) }", which should be
- // codegened as "for (j = 0;; j+=8) { foo(j); bar(j+j); }" on X86/PPC. Need
- // to be careful that IV's are all the same type. Only works for intptr_t
- // indvars.
-
- // If we only have one stride, we can more aggressively eliminate some things.
- bool HasOneStride = IVUsesByStride.size() == 1;
-
-#ifndef NDEBUG
- DOUT << "\nLSR on ";
- DEBUG(L->dump());
-#endif
-
- // IVsByStride keeps IVs for one particular loop.
- IVsByStride.clear();
-
- // Sort the StrideOrder so we process larger strides first.
- std::stable_sort(StrideOrder.begin(), StrideOrder.end(), StrideCompare());
-
- // Note: this processes each stride/type pair individually. All users passed
- // into StrengthReduceStridedIVUsers have the same type AND stride. Also,
- // note that we iterate over IVUsesByStride indirectly by using StrideOrder.
- // This extra layer of indirection makes the ordering of strides deterministic
- // - not dependent on map order.
- for (unsigned Stride = 0, e = StrideOrder.size(); Stride != e; ++Stride) {
- std::map<SCEVHandle, IVUsersOfOneStride>::iterator SI =
- IVUsesByStride.find(StrideOrder[Stride]);
- assert(SI != IVUsesByStride.end() && "Stride doesn't exist!");
- StrengthReduceStridedIVUsers(SI->first, SI->second, L, HasOneStride);
- }
-
- // Clean up after ourselves
- if (!DeadInsts.empty()) {
- DeleteTriviallyDeadInstructions(DeadInsts);
-
- BasicBlock::iterator I = L->getHeader()->begin();
- PHINode *PN;
- while ((PN = dyn_cast<PHINode>(I))) {
- ++I; // Preincrement iterator to avoid invalidating it when deleting PN.
-
- // At this point, we know that we have killed one or more GEP
- // instructions. It is worth checking to see if the cann indvar is also
- // dead, so that we can remove it as well. The requirements for the cann
- // indvar to be considered dead are:
- // 1. the cann indvar has one use
- // 2. the use is an add instruction
- // 3. the add has one use
- // 4. the add is used by the cann indvar
- // If all four cases above are true, then we can remove both the add and
- // the cann indvar.
- // FIXME: this needs to eliminate an induction variable even if it's being
- // compared against some value to decide loop termination.
- if (PN->hasOneUse()) {
- Instruction *BO = dyn_cast<Instruction>(*PN->use_begin());
- if (BO && (isa<BinaryOperator>(BO) || isa<CmpInst>(BO))) {
- if (BO->hasOneUse() && PN == *(BO->use_begin())) {
- DeadInsts.insert(BO);
- // Break the cycle, then delete the PHI.
- PN->replaceAllUsesWith(UndefValue::get(PN->getType()));
- SE->deleteValueFromRecords(PN);
- PN->eraseFromParent();
- }
- }
- }
- }
- DeleteTriviallyDeadInstructions(DeadInsts);
- }
-
- CastedPointers.clear();
- IVUsesByStride.clear();
- StrideOrder.clear();
- return false;
-}
diff --git a/release_23/lib/Transforms/Scalar/LoopUnroll.cpp b/release_23/lib/Transforms/Scalar/LoopUnroll.cpp
deleted file mode 100644
index 0db964125adb..000000000000
--- a/release_23/lib/Transforms/Scalar/LoopUnroll.cpp
+++ /dev/null
@@ -1,508 +0,0 @@
-//===-- LoopUnroll.cpp - Loop unroller pass -------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This pass implements a simple loop unroller. It works best when loops have
-// been canonicalized by the -indvars pass, allowing it to determine the trip
-// counts of loops easily.
-//
-// This pass will multi-block loops only if they contain no non-unrolled
-// subloops. The process of unrolling can produce extraneous basic blocks
-// linked with unconditional branches. This will be corrected in the future.
-//
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "loop-unroll"
-#include "llvm/Transforms/Scalar.h"
-#include "llvm/Constants.h"
-#include "llvm/Function.h"
-#include "llvm/Instructions.h"
-#include "llvm/Analysis/ConstantFolding.h"
-#include "llvm/Analysis/LoopInfo.h"
-#include "llvm/Analysis/LoopPass.h"
-#include "llvm/Transforms/Utils/Cloning.h"
-#include "llvm/Transforms/Utils/Local.h"
-#include "llvm/Support/CFG.h"
-#include "llvm/Support/Compiler.h"
-#include "llvm/Support/CommandLine.h"
-#include "llvm/Support/Debug.h"
-#include "llvm/Support/MathExtras.h"
-#include "llvm/ADT/Statistic.h"
-#include "llvm/ADT/STLExtras.h"
-#include "llvm/ADT/SmallPtrSet.h"
-#include "llvm/IntrinsicInst.h"
-#include <algorithm>
-#include <climits>
-#include <cstdio>
-using namespace llvm;
-
-STATISTIC(NumCompletelyUnrolled, "Number of loops completely unrolled");
-STATISTIC(NumUnrolled, "Number of loops unrolled (completely or otherwise)");
-
-namespace {
- static cl::opt<unsigned>
- UnrollThreshold
- ("unroll-threshold", cl::init(100), cl::Hidden,
- cl::desc("The cut-off point for automatic loop unrolling"));
-
- static cl::opt<unsigned>
- UnrollCount
- ("unroll-count", cl::init(0), cl::Hidden,
- cl::desc("Use this unroll count for all loops, for testing purposes"));
-
- class VISIBILITY_HIDDEN LoopUnroll : public LoopPass {
- LoopInfo *LI; // The current loop information
- public:
- static char ID; // Pass ID, replacement for typeid
- LoopUnroll() : LoopPass((intptr_t)&ID) {}
-
- /// A magic value for use with the Threshold parameter to indicate
- /// that the loop unroll should be performed regardless of how much
- /// code expansion would result.
- static const unsigned NoThreshold = UINT_MAX;
-
- bool runOnLoop(Loop *L, LPPassManager &LPM);
- bool unrollLoop(Loop *L, unsigned Count, unsigned Threshold);
- BasicBlock *FoldBlockIntoPredecessor(BasicBlock *BB);
-
- /// This transformation requires natural loop information & requires that
- /// loop preheaders be inserted into the CFG...
- ///
- virtual void getAnalysisUsage(AnalysisUsage &AU) const {
- AU.addRequiredID(LoopSimplifyID);
- AU.addRequiredID(LCSSAID);
- AU.addRequired<LoopInfo>();
- AU.addPreservedID(LCSSAID);
- AU.addPreserved<LoopInfo>();
- }
- };
- char LoopUnroll::ID = 0;
- RegisterPass<LoopUnroll> X("loop-unroll", "Unroll loops");
-}
-
-LoopPass *llvm::createLoopUnrollPass() { return new LoopUnroll(); }
-
-/// ApproximateLoopSize - Approximate the size of the loop.
-static unsigned ApproximateLoopSize(const Loop *L) {
- unsigned Size = 0;
- for (unsigned i = 0, e = L->getBlocks().size(); i != e; ++i) {
- BasicBlock *BB = L->getBlocks()[i];
- Instruction *Term = BB->getTerminator();
- for (BasicBlock::iterator I = BB->begin(), E = BB->end(); I != E; ++I) {
- if (isa<PHINode>(I) && BB == L->getHeader()) {
- // Ignore PHI nodes in the header.
- } else if (I->hasOneUse() && I->use_back() == Term) {
- // Ignore instructions only used by the loop terminator.
- } else if (isa<DbgInfoIntrinsic>(I)) {
- // Ignore debug instructions
- } else if (isa<CallInst>(I)) {
- // Estimate size overhead introduced by call instructions which
- // is higher than other instructions. Here 3 and 10 are magic
- // numbers that help one isolated test case from PR2067 without
- // negatively impacting measured benchmarks.
- if (isa<IntrinsicInst>(I))
- Size = Size + 3;
- else
- Size = Size + 10;
- } else {
- ++Size;
- }
-
- // TODO: Ignore expressions derived from PHI and constants if inval of phi
- // is a constant, or if operation is associative. This will get induction
- // variables.
- }
- }
-
- return Size;
-}
-
-// RemapInstruction - Convert the instruction operands from referencing the
-// current values into those specified by ValueMap.
-//
-static inline void RemapInstruction(Instruction *I,
- DenseMap<const Value *, Value*> &ValueMap) {
- for (unsigned op = 0, E = I->getNumOperands(); op != E; ++op) {
- Value *Op = I->getOperand(op);
- DenseMap<const Value *, Value*>::iterator It = ValueMap.find(Op);
- if (It != ValueMap.end()) Op = It->second;
- I->setOperand(op, Op);
- }
-}
-
-// FoldBlockIntoPredecessor - Folds a basic block into its predecessor if it
-// only has one predecessor, and that predecessor only has one successor.
-// Returns the new combined block.
-BasicBlock *LoopUnroll::FoldBlockIntoPredecessor(BasicBlock *BB) {
- // Merge basic blocks into their predecessor if there is only one distinct
- // pred, and if there is only one distinct successor of the predecessor, and
- // if there are no PHI nodes.
- //
- BasicBlock *OnlyPred = BB->getSinglePredecessor();
- if (!OnlyPred) return 0;
-
- if (OnlyPred->getTerminator()->getNumSuccessors() != 1)
- return 0;
-
- DOUT << "Merging: " << *BB << "into: " << *OnlyPred;
-
- // Resolve any PHI nodes at the start of the block. They are all
- // guaranteed to have exactly one entry if they exist, unless there are
- // multiple duplicate (but guaranteed to be equal) entries for the
- // incoming edges. This occurs when there are multiple edges from
- // OnlyPred to OnlySucc.
- //
- while (PHINode *PN = dyn_cast<PHINode>(&BB->front())) {
- PN->replaceAllUsesWith(PN->getIncomingValue(0));
- BB->getInstList().pop_front(); // Delete the phi node...
- }
-
- // Delete the unconditional branch from the predecessor...
- OnlyPred->getInstList().pop_back();
-
- // Move all definitions in the successor to the predecessor...
- OnlyPred->getInstList().splice(OnlyPred->end(), BB->getInstList());
-
- // Make all PHI nodes that referred to BB now refer to Pred as their
- // source...
- BB->replaceAllUsesWith(OnlyPred);
-
- std::string OldName = BB->getName();
-
- // Erase basic block from the function...
- LI->removeBlock(BB);
- BB->eraseFromParent();
-
- // Inherit predecessor's name if it exists...
- if (!OldName.empty() && !OnlyPred->hasName())
- OnlyPred->setName(OldName);
-
- return OnlyPred;
-}
-
-bool LoopUnroll::runOnLoop(Loop *L, LPPassManager &LPM) {
- LI = &getAnalysis<LoopInfo>();
-
- // Unroll the loop.
- if (!unrollLoop(L, UnrollCount, UnrollThreshold))
- return false;
-
- // Update the loop information for this loop.
- // If we completely unrolled the loop, remove it from the parent.
- if (L->getNumBackEdges() == 0)
- LPM.deleteLoopFromQueue(L);
-
- return true;
-}
-
-/// Unroll the given loop by UnrollCount, or by a heuristically-determined
-/// value if Count is zero. If Threshold is not NoThreshold, it is a value
-/// to limit code size expansion. If the loop size would expand beyond the
-/// threshold value, unrolling is suppressed. The return value is true if
-/// any transformations are performed.
-///
-bool LoopUnroll::unrollLoop(Loop *L, unsigned Count, unsigned Threshold) {
- assert(L->isLCSSAForm());
-
- BasicBlock *Header = L->getHeader();
- BasicBlock *LatchBlock = L->getLoopLatch();
- BranchInst *BI = dyn_cast<BranchInst>(LatchBlock->getTerminator());
-
- DOUT << "Loop Unroll: F[" << Header->getParent()->getName()
- << "] Loop %" << Header->getName() << "\n";
-
- if (!BI || BI->isUnconditional()) {
- // The loop-rotate pass can be helpful to avoid this in many cases.
- DOUT << " Can't unroll; loop not terminated by a conditional branch.\n";
- return false;
- }
-
- // Determine the trip count and/or trip multiple. A TripCount value of zero
- // is used to mean an unknown trip count. The TripMultiple value is the
- // greatest known integer multiple of the trip count.
- unsigned TripCount = 0;
- unsigned TripMultiple = 1;
- if (Value *TripCountValue = L->getTripCount()) {
- if (ConstantInt *TripCountC = dyn_cast<ConstantInt>(TripCountValue)) {
- // Guard against huge trip counts. This also guards against assertions in
- // APInt from the use of getZExtValue, below.
- if (TripCountC->getValue().getActiveBits() <= 32) {
- TripCount = (unsigned)TripCountC->getZExtValue();
- }
- } else if (BinaryOperator *BO = dyn_cast<BinaryOperator>(TripCountValue)) {
- switch (BO->getOpcode()) {
- case BinaryOperator::Mul:
- if (ConstantInt *MultipleC = dyn_cast<ConstantInt>(BO->getOperand(1))) {
- if (MultipleC->getValue().getActiveBits() <= 32) {
- TripMultiple = (unsigned)MultipleC->getZExtValue();
- }
- }
- break;
- default: break;
- }
- }
- }
- if (TripCount != 0)
- DOUT << " Trip Count = " << TripCount << "\n";
- if (TripMultiple != 1)
- DOUT << " Trip Multiple = " << TripMultiple << "\n";
-
- // Automatically select an unroll count.
- if (Count == 0) {
- // Conservative heuristic: if we know the trip count, see if we can
- // completely unroll (subject to the threshold, checked below); otherwise
- // don't unroll.
- if (TripCount != 0) {
- Count = TripCount;
- } else {
- return false;
- }
- }
-
- // Effectively "DCE" unrolled iterations that are beyond the tripcount
- // and will never be executed.
- if (TripCount != 0 && Count > TripCount)
- Count = TripCount;
-
- assert(Count > 0);
- assert(TripMultiple > 0);
- assert(TripCount == 0 || TripCount % TripMultiple == 0);
-
- // Enforce the threshold.
- if (Threshold != NoThreshold) {
- unsigned LoopSize = ApproximateLoopSize(L);
- DOUT << " Loop Size = " << LoopSize << "\n";
- uint64_t Size = (uint64_t)LoopSize*Count;
- if (TripCount != 1 && Size > Threshold) {
- DOUT << " TOO LARGE TO UNROLL: "
- << Size << ">" << Threshold << "\n";
- return false;
- }
- }
-
- // Are we eliminating the loop control altogether?
- bool CompletelyUnroll = Count == TripCount;
-
- // If we know the trip count, we know the multiple...
- unsigned BreakoutTrip = 0;
- if (TripCount != 0) {
- BreakoutTrip = TripCount % Count;
- TripMultiple = 0;
- } else {
- // Figure out what multiple to use.
- BreakoutTrip = TripMultiple =
- (unsigned)GreatestCommonDivisor64(Count, TripMultiple);
- }
-
- if (CompletelyUnroll) {
- DOUT << "COMPLETELY UNROLLING loop %" << Header->getName()
- << " with trip count " << TripCount << "!\n";
- } else {
- DOUT << "UNROLLING loop %" << Header->getName()
- << " by " << Count;
- if (TripMultiple == 0 || BreakoutTrip != TripMultiple) {
- DOUT << " with a breakout at trip " << BreakoutTrip;
- } else if (TripMultiple != 1) {
- DOUT << " with " << TripMultiple << " trips per branch";
- }
- DOUT << "!\n";
- }
-
- std::vector<BasicBlock*> LoopBlocks = L->getBlocks();
-
- bool ContinueOnTrue = L->contains(BI->getSuccessor(0));
- BasicBlock *LoopExit = BI->getSuccessor(ContinueOnTrue);
-
- // For the first iteration of the loop, we should use the precloned values for
- // PHI nodes. Insert associations now.
- typedef DenseMap<const Value*, Value*> ValueMapTy;
- ValueMapTy LastValueMap;
- std::vector<PHINode*> OrigPHINode;
- for (BasicBlock::iterator I = Header->begin(); isa<PHINode>(I); ++I) {
- PHINode *PN = cast<PHINode>(I);
- OrigPHINode.push_back(PN);
- if (Instruction *I =
- dyn_cast<Instruction>(PN->getIncomingValueForBlock(LatchBlock)))
- if (L->contains(I->getParent()))
- LastValueMap[I] = I;
- }
-
- std::vector<BasicBlock*> Headers;
- std::vector<BasicBlock*> Latches;
- Headers.push_back(Header);
- Latches.push_back(LatchBlock);
-
- for (unsigned It = 1; It != Count; ++It) {
- char SuffixBuffer[100];
- sprintf(SuffixBuffer, ".%d", It);
-
- std::vector<BasicBlock*> NewBlocks;
-
- for (std::vector<BasicBlock*>::iterator BB = LoopBlocks.begin(),
- E = LoopBlocks.end(); BB != E; ++BB) {
- ValueMapTy ValueMap;
- BasicBlock *New = CloneBasicBlock(*BB, ValueMap, SuffixBuffer);
- Header->getParent()->getBasicBlockList().push_back(New);
-
- // Loop over all of the PHI nodes in the block, changing them to use the
- // incoming values from the previous block.
- if (*BB == Header)
- for (unsigned i = 0, e = OrigPHINode.size(); i != e; ++i) {
- PHINode *NewPHI = cast<PHINode>(ValueMap[OrigPHINode[i]]);
- Value *InVal = NewPHI->getIncomingValueForBlock(LatchBlock);
- if (Instruction *InValI = dyn_cast<Instruction>(InVal))
- if (It > 1 && L->contains(InValI->getParent()))
- InVal = LastValueMap[InValI];
- ValueMap[OrigPHINode[i]] = InVal;
- New->getInstList().erase(NewPHI);
- }
-
- // Update our running map of newest clones
- LastValueMap[*BB] = New;
- for (ValueMapTy::iterator VI = ValueMap.begin(), VE = ValueMap.end();
- VI != VE; ++VI)
- LastValueMap[VI->first] = VI->second;
-
- L->addBasicBlockToLoop(New, LI->getBase());
-
- // Add phi entries for newly created values to all exit blocks except
- // the successor of the latch block. The successor of the exit block will
- // be updated specially after unrolling all the way.
- if (*BB != LatchBlock)
- for (Value::use_iterator UI = (*BB)->use_begin(), UE = (*BB)->use_end();
- UI != UE;) {
- Instruction *UseInst = cast<Instruction>(*UI);
- ++UI;
- if (isa<PHINode>(UseInst) && !L->contains(UseInst->getParent())) {
- PHINode *phi = cast<PHINode>(UseInst);
- Value *Incoming = phi->getIncomingValueForBlock(*BB);
- phi->addIncoming(Incoming, New);
- }
- }
-
- // Keep track of new headers and latches as we create them, so that
- // we can insert the proper branches later.
- if (*BB == Header)
- Headers.push_back(New);
- if (*BB == LatchBlock) {
- Latches.push_back(New);
-
- // Also, clear out the new latch's back edge so that it doesn't look
- // like a new loop, so that it's amenable to being merged with adjacent
- // blocks later on.
- TerminatorInst *Term = New->getTerminator();
- assert(L->contains(Term->getSuccessor(!ContinueOnTrue)));
- assert(Term->getSuccessor(ContinueOnTrue) == LoopExit);
- Term->setSuccessor(!ContinueOnTrue, NULL);
- }
-
- NewBlocks.push_back(New);
- }
-
- // Remap all instructions in the most recent iteration
- for (unsigned i = 0; i < NewBlocks.size(); ++i)
- for (BasicBlock::iterator I = NewBlocks[i]->begin(),
- E = NewBlocks[i]->end(); I != E; ++I)
- RemapInstruction(I, LastValueMap);
- }
-
- // The latch block exits the loop. If there are any PHI nodes in the
- // successor blocks, update them to use the appropriate values computed as the
- // last iteration of the loop.
- if (Count != 1) {
- SmallPtrSet<PHINode*, 8> Users;
- for (Value::use_iterator UI = LatchBlock->use_begin(),
- UE = LatchBlock->use_end(); UI != UE; ++UI)
- if (PHINode *phi = dyn_cast<PHINode>(*UI))
- Users.insert(phi);
-
- BasicBlock *LastIterationBB = cast<BasicBlock>(LastValueMap[LatchBlock]);
- for (SmallPtrSet<PHINode*,8>::iterator SI = Users.begin(), SE = Users.end();
- SI != SE; ++SI) {
- PHINode *PN = *SI;
- Value *InVal = PN->removeIncomingValue(LatchBlock, false);
- // If this value was defined in the loop, take the value defined by the
- // last iteration of the loop.
- if (Instruction *InValI = dyn_cast<Instruction>(InVal)) {
- if (L->contains(InValI->getParent()))
- InVal = LastValueMap[InVal];
- }
- PN->addIncoming(InVal, LastIterationBB);
- }
- }
-
- // Now, if we're doing complete unrolling, loop over the PHI nodes in the
- // original block, setting them to their incoming values.
- if (CompletelyUnroll) {
- BasicBlock *Preheader = L->getLoopPreheader();
- for (unsigned i = 0, e = OrigPHINode.size(); i != e; ++i) {
- PHINode *PN = OrigPHINode[i];
- PN->replaceAllUsesWith(PN->getIncomingValueForBlock(Preheader));
- Header->getInstList().erase(PN);
- }
- }
-
- // Now that all the basic blocks for the unrolled iterations are in place,
- // set up the branches to connect them.
- for (unsigned i = 0, e = Latches.size(); i != e; ++i) {
- // The original branch was replicated in each unrolled iteration.
- BranchInst *Term = cast<BranchInst>(Latches[i]->getTerminator());
-
- // The branch destination.
- unsigned j = (i + 1) % e;
- BasicBlock *Dest = Headers[j];
- bool NeedConditional = true;
-
- // For a complete unroll, make the last iteration end with a branch
- // to the exit block.
- if (CompletelyUnroll && j == 0) {
- Dest = LoopExit;
- NeedConditional = false;
- }
-
- // If we know the trip count or a multiple of it, we can safely use an
- // unconditional branch for some iterations.
- if (j != BreakoutTrip && (TripMultiple == 0 || j % TripMultiple != 0)) {
- NeedConditional = false;
- }
-
- if (NeedConditional) {
- // Update the conditional branch's successor for the following
- // iteration.
- Term->setSuccessor(!ContinueOnTrue, Dest);
- } else {
- Term->setUnconditionalDest(Dest);
- // Merge adjacent basic blocks, if possible.
- if (BasicBlock *Fold = FoldBlockIntoPredecessor(Dest)) {
- std::replace(Latches.begin(), Latches.end(), Dest, Fold);
- std::replace(Headers.begin(), Headers.end(), Dest, Fold);
- }
- }
- }
-
- // At this point, the code is well formed. We now do a quick sweep over the
- // inserted code, doing constant propagation and dead code elimination as we
- // go.
- const std::vector<BasicBlock*> &NewLoopBlocks = L->getBlocks();
- for (std::vector<BasicBlock*>::const_iterator BB = NewLoopBlocks.begin(),
- BBE = NewLoopBlocks.end(); BB != BBE; ++BB)
- for (BasicBlock::iterator I = (*BB)->begin(), E = (*BB)->end(); I != E; ) {
- Instruction *Inst = I++;
-
- if (isInstructionTriviallyDead(Inst))
- (*BB)->getInstList().erase(Inst);
- else if (Constant *C = ConstantFoldInstruction(Inst)) {
- Inst->replaceAllUsesWith(C);
- (*BB)->getInstList().erase(Inst);
- }
- }
-
- NumCompletelyUnrolled += CompletelyUnroll;
- ++NumUnrolled;
- return true;
-}
diff --git a/release_23/lib/Transforms/Scalar/LoopUnswitch.cpp b/release_23/lib/Transforms/Scalar/LoopUnswitch.cpp
deleted file mode 100644
index 5af0a57a80f9..000000000000
--- a/release_23/lib/Transforms/Scalar/LoopUnswitch.cpp
+++ /dev/null
@@ -1,1308 +0,0 @@
-//===-- LoopUnswitch.cpp - Hoist loop-invariant conditionals in loop ------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This pass transforms loops that contain branches on loop-invariant conditions
-// to have multiple loops. For example, it turns the left into the right code:
-//
-// for (...) if (lic)
-// A for (...)
-// if (lic) A; B; C
-// B else
-// C for (...)
-// A; C
-//
-// This can increase the size of the code exponentially (doubling it every time
-// a loop is unswitched) so we only unswitch if the resultant code will be
-// smaller than a threshold.
-//
-// This pass expects LICM to be run before it to hoist invariant conditions out
-// of the loop, to make the unswitching opportunity obvious.
-//
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "loop-unswitch"
-#include "llvm/Transforms/Scalar.h"
-#include "llvm/Constants.h"
-#include "llvm/DerivedTypes.h"
-#include "llvm/Function.h"
-#include "llvm/Instructions.h"
-#include "llvm/Analysis/ConstantFolding.h"
-#include "llvm/Analysis/LoopInfo.h"
-#include "llvm/Analysis/LoopPass.h"
-#include "llvm/Analysis/Dominators.h"
-#include "llvm/Transforms/Utils/Cloning.h"
-#include "llvm/Transforms/Utils/Local.h"
-#include "llvm/Transforms/Utils/BasicBlockUtils.h"
-#include "llvm/ADT/Statistic.h"
-#include "llvm/ADT/SmallPtrSet.h"
-#include "llvm/Support/CommandLine.h"
-#include "llvm/Support/Compiler.h"
-#include "llvm/Support/Debug.h"
-#include <algorithm>
-#include <set>
-using namespace llvm;
-
-STATISTIC(NumBranches, "Number of branches unswitched");
-STATISTIC(NumSwitches, "Number of switches unswitched");
-STATISTIC(NumSelects , "Number of selects unswitched");
-STATISTIC(NumTrivial , "Number of unswitches that are trivial");
-STATISTIC(NumSimplify, "Number of simplifications of unswitched code");
-
-namespace {
- static cl::opt<unsigned>
- Threshold("loop-unswitch-threshold", cl::desc("Max loop size to unswitch"),
- cl::init(10), cl::Hidden);
-
- class VISIBILITY_HIDDEN LoopUnswitch : public LoopPass {
- LoopInfo *LI; // Loop information
- LPPassManager *LPM;
-
- // LoopProcessWorklist - Used to check if second loop needs processing
- // after RewriteLoopBodyWithConditionConstant rewrites first loop.
- std::vector<Loop*> LoopProcessWorklist;
- SmallPtrSet<Value *,8> UnswitchedVals;
-
- bool OptimizeForSize;
- bool redoLoop;
-
- DominanceFrontier *DF;
- DominatorTree *DT;
-
- /// LoopDF - Loop's dominance frontier. This set is a collection of
- /// loop exiting blocks' DF member blocks. However this does set does not
- /// includes basic blocks that are inside loop.
- SmallPtrSet<BasicBlock *, 8> LoopDF;
-
- /// OrigLoopExitMap - This is used to map loop exiting block with
- /// corresponding loop exit block, before updating CFG.
- DenseMap<BasicBlock *, BasicBlock *> OrigLoopExitMap;
- public:
- static char ID; // Pass ID, replacement for typeid
- explicit LoopUnswitch(bool Os = false) :
- LoopPass((intptr_t)&ID), OptimizeForSize(Os), redoLoop(false) {}
-
- bool runOnLoop(Loop *L, LPPassManager &LPM);
- bool processLoop(Loop *L);
-
- /// This transformation requires natural loop information & requires that
- /// loop preheaders be inserted into the CFG...
- ///
- virtual void getAnalysisUsage(AnalysisUsage &AU) const {
- AU.addRequiredID(LoopSimplifyID);
- AU.addPreservedID(LoopSimplifyID);
- AU.addRequired<LoopInfo>();
- AU.addPreserved<LoopInfo>();
- AU.addRequiredID(LCSSAID);
- AU.addPreservedID(LCSSAID);
- AU.addPreserved<DominatorTree>();
- AU.addPreserved<DominanceFrontier>();
- }
-
- private:
-
- /// RemoveLoopFromWorklist - If the specified loop is on the loop worklist,
- /// remove it.
- void RemoveLoopFromWorklist(Loop *L) {
- std::vector<Loop*>::iterator I = std::find(LoopProcessWorklist.begin(),
- LoopProcessWorklist.end(), L);
- if (I != LoopProcessWorklist.end())
- LoopProcessWorklist.erase(I);
- }
-
- /// Split all of the edges from inside the loop to their exit blocks.
- /// Update the appropriate Phi nodes as we do so.
- void SplitExitEdges(Loop *L, const SmallVector<BasicBlock *, 8> &ExitBlocks,
- SmallVector<BasicBlock *, 8> &MiddleBlocks);
-
- /// If BB's dominance frontier has a member that is not part of loop L then
- /// remove it. Add NewDFMember in BB's dominance frontier.
- void ReplaceLoopExternalDFMember(Loop *L, BasicBlock *BB,
- BasicBlock *NewDFMember);
-
- bool UnswitchIfProfitable(Value *LoopCond, Constant *Val,Loop *L);
- unsigned getLoopUnswitchCost(Loop *L, Value *LIC);
- void UnswitchTrivialCondition(Loop *L, Value *Cond, Constant *Val,
- BasicBlock *ExitBlock);
- void UnswitchNontrivialCondition(Value *LIC, Constant *OnVal, Loop *L);
-
- void RewriteLoopBodyWithConditionConstant(Loop *L, Value *LIC,
- Constant *Val, bool isEqual);
-
- void EmitPreheaderBranchOnCondition(Value *LIC, Constant *Val,
- BasicBlock *TrueDest,
- BasicBlock *FalseDest,
- Instruction *InsertPt);
-
- void SimplifyCode(std::vector<Instruction*> &Worklist, Loop *L);
- void RemoveBlockIfDead(BasicBlock *BB,
- std::vector<Instruction*> &Worklist, Loop *l);
- void RemoveLoopFromHierarchy(Loop *L);
- };
- char LoopUnswitch::ID = 0;
- RegisterPass<LoopUnswitch> X("loop-unswitch", "Unswitch loops");
-}
-
-LoopPass *llvm::createLoopUnswitchPass(bool Os) {
- return new LoopUnswitch(Os);
-}
-
-/// FindLIVLoopCondition - Cond is a condition that occurs in L. If it is
-/// invariant in the loop, or has an invariant piece, return the invariant.
-/// Otherwise, return null.
-static Value *FindLIVLoopCondition(Value *Cond, Loop *L, bool &Changed) {
- // Constants should be folded, not unswitched on!
- if (isa<Constant>(Cond)) return false;
-
- // TODO: Handle: br (VARIANT|INVARIANT).
- // TODO: Hoist simple expressions out of loops.
- if (L->isLoopInvariant(Cond)) return Cond;
-
- if (BinaryOperator *BO = dyn_cast<BinaryOperator>(Cond))
- if (BO->getOpcode() == Instruction::And ||
- BO->getOpcode() == Instruction::Or) {
- // If either the left or right side is invariant, we can unswitch on this,
- // which will cause the branch to go away in one loop and the condition to
- // simplify in the other one.
- if (Value *LHS = FindLIVLoopCondition(BO->getOperand(0), L, Changed))
- return LHS;
- if (Value *RHS = FindLIVLoopCondition(BO->getOperand(1), L, Changed))
- return RHS;
- }
-
- return 0;
-}
-
-bool LoopUnswitch::runOnLoop(Loop *L, LPPassManager &LPM_Ref) {
- LI = &getAnalysis<LoopInfo>();
- LPM = &LPM_Ref;
- DF = getAnalysisToUpdate<DominanceFrontier>();
- DT = getAnalysisToUpdate<DominatorTree>();
-
- bool Changed = false;
-
- do {
- redoLoop = false;
- Changed |= processLoop(L);
- } while(redoLoop);
-
- return Changed;
-}
-
-/// processLoop - Do actual work and unswitch loop if possible and profitable.
-bool LoopUnswitch::processLoop(Loop *L) {
- assert(L->isLCSSAForm());
- bool Changed = false;
-
- // Loop over all of the basic blocks in the loop. If we find an interior
- // block that is branching on a loop-invariant condition, we can unswitch this
- // loop.
- for (Loop::block_iterator I = L->block_begin(), E = L->block_end();
- I != E; ++I) {
- TerminatorInst *TI = (*I)->getTerminator();
- if (BranchInst *BI = dyn_cast<BranchInst>(TI)) {
- // If this isn't branching on an invariant condition, we can't unswitch
- // it.
- if (BI->isConditional()) {
- // See if this, or some part of it, is loop invariant. If so, we can
- // unswitch on it if we desire.
- Value *LoopCond = FindLIVLoopCondition(BI->getCondition(), L, Changed);
- if (LoopCond && UnswitchIfProfitable(LoopCond, ConstantInt::getTrue(),
- L)) {
- ++NumBranches;
- return true;
- }
- }
- } else if (SwitchInst *SI = dyn_cast<SwitchInst>(TI)) {
- Value *LoopCond = FindLIVLoopCondition(SI->getCondition(), L, Changed);
- if (LoopCond && SI->getNumCases() > 1) {
- // Find a value to unswitch on:
- // FIXME: this should chose the most expensive case!
- Constant *UnswitchVal = SI->getCaseValue(1);
- // Do not process same value again and again.
- if (!UnswitchedVals.insert(UnswitchVal))
- continue;
-
- if (UnswitchIfProfitable(LoopCond, UnswitchVal, L)) {
- ++NumSwitches;
- return true;
- }
- }
- }
-
- // Scan the instructions to check for unswitchable values.
- for (BasicBlock::iterator BBI = (*I)->begin(), E = (*I)->end();
- BBI != E; ++BBI)
- if (SelectInst *SI = dyn_cast<SelectInst>(BBI)) {
- Value *LoopCond = FindLIVLoopCondition(SI->getCondition(), L, Changed);
- if (LoopCond && UnswitchIfProfitable(LoopCond, ConstantInt::getTrue(),
- L)) {
- ++NumSelects;
- return true;
- }
- }
- }
-
- assert(L->isLCSSAForm());
-
- return Changed;
-}
-
-/// isTrivialLoopExitBlock - Check to see if all paths from BB either:
-/// 1. Exit the loop with no side effects.
-/// 2. Branch to the latch block with no side-effects.
-///
-/// If these conditions are true, we return true and set ExitBB to the block we
-/// exit through.
-///
-static bool isTrivialLoopExitBlockHelper(Loop *L, BasicBlock *BB,
- BasicBlock *&ExitBB,
- std::set<BasicBlock*> &Visited) {
- if (!Visited.insert(BB).second) {
- // Already visited and Ok, end of recursion.
- return true;
- } else if (!L->contains(BB)) {
- // Otherwise, this is a loop exit, this is fine so long as this is the
- // first exit.
- if (ExitBB != 0) return false;
- ExitBB = BB;
- return true;
- }
-
- // Otherwise, this is an unvisited intra-loop node. Check all successors.
- for (succ_iterator SI = succ_begin(BB), E = succ_end(BB); SI != E; ++SI) {
- // Check to see if the successor is a trivial loop exit.
- if (!isTrivialLoopExitBlockHelper(L, *SI, ExitBB, Visited))
- return false;
- }
-
- // Okay, everything after this looks good, check to make sure that this block
- // doesn't include any side effects.
- for (BasicBlock::iterator I = BB->begin(), E = BB->end(); I != E; ++I)
- if (I->mayWriteToMemory())
- return false;
-
- return true;
-}
-
-/// isTrivialLoopExitBlock - Return true if the specified block unconditionally
-/// leads to an exit from the specified loop, and has no side-effects in the
-/// process. If so, return the block that is exited to, otherwise return null.
-static BasicBlock *isTrivialLoopExitBlock(Loop *L, BasicBlock *BB) {
- std::set<BasicBlock*> Visited;
- Visited.insert(L->getHeader()); // Branches to header are ok.
- BasicBlock *ExitBB = 0;
- if (isTrivialLoopExitBlockHelper(L, BB, ExitBB, Visited))
- return ExitBB;
- return 0;
-}
-
-/// IsTrivialUnswitchCondition - Check to see if this unswitch condition is
-/// trivial: that is, that the condition controls whether or not the loop does
-/// anything at all. If this is a trivial condition, unswitching produces no
-/// code duplications (equivalently, it produces a simpler loop and a new empty
-/// loop, which gets deleted).
-///
-/// If this is a trivial condition, return true, otherwise return false. When
-/// returning true, this sets Cond and Val to the condition that controls the
-/// trivial condition: when Cond dynamically equals Val, the loop is known to
-/// exit. Finally, this sets LoopExit to the BB that the loop exits to when
-/// Cond == Val.
-///
-static bool IsTrivialUnswitchCondition(Loop *L, Value *Cond, Constant **Val = 0,
- BasicBlock **LoopExit = 0) {
- BasicBlock *Header = L->getHeader();
- TerminatorInst *HeaderTerm = Header->getTerminator();
-
- BasicBlock *LoopExitBB = 0;
- if (BranchInst *BI = dyn_cast<BranchInst>(HeaderTerm)) {
- // If the header block doesn't end with a conditional branch on Cond, we
- // can't handle it.
- if (!BI->isConditional() || BI->getCondition() != Cond)
- return false;
-
- // Check to see if a successor of the branch is guaranteed to go to the
- // latch block or exit through a one exit block without having any
- // side-effects. If so, determine the value of Cond that causes it to do
- // this.
- if ((LoopExitBB = isTrivialLoopExitBlock(L, BI->getSuccessor(0)))) {
- if (Val) *Val = ConstantInt::getTrue();
- } else if ((LoopExitBB = isTrivialLoopExitBlock(L, BI->getSuccessor(1)))) {
- if (Val) *Val = ConstantInt::getFalse();
- }
- } else if (SwitchInst *SI = dyn_cast<SwitchInst>(HeaderTerm)) {
- // If this isn't a switch on Cond, we can't handle it.
- if (SI->getCondition() != Cond) return false;
-
- // Check to see if a successor of the switch is guaranteed to go to the
- // latch block or exit through a one exit block without having any
- // side-effects. If so, determine the value of Cond that causes it to do
- // this. Note that we can't trivially unswitch on the default case.
- for (unsigned i = 1, e = SI->getNumSuccessors(); i != e; ++i)
- if ((LoopExitBB = isTrivialLoopExitBlock(L, SI->getSuccessor(i)))) {
- // Okay, we found a trivial case, remember the value that is trivial.
- if (Val) *Val = SI->getCaseValue(i);
- break;
- }
- }
-
- // If we didn't find a single unique LoopExit block, or if the loop exit block
- // contains phi nodes, this isn't trivial.
- if (!LoopExitBB || isa<PHINode>(LoopExitBB->begin()))
- return false; // Can't handle this.
-
- if (LoopExit) *LoopExit = LoopExitBB;
-
- // We already know that nothing uses any scalar values defined inside of this
- // loop. As such, we just have to check to see if this loop will execute any
- // side-effecting instructions (e.g. stores, calls, volatile loads) in the
- // part of the loop that the code *would* execute. We already checked the
- // tail, check the header now.
- for (BasicBlock::iterator I = Header->begin(), E = Header->end(); I != E; ++I)
- if (I->mayWriteToMemory())
- return false;
- return true;
-}
-
-/// getLoopUnswitchCost - Return the cost (code size growth) that will happen if
-/// we choose to unswitch the specified loop on the specified value.
-///
-unsigned LoopUnswitch::getLoopUnswitchCost(Loop *L, Value *LIC) {
- // If the condition is trivial, always unswitch. There is no code growth for
- // this case.
- if (IsTrivialUnswitchCondition(L, LIC))
- return 0;
-
- // FIXME: This is really overly conservative. However, more liberal
- // estimations have thus far resulted in excessive unswitching, which is bad
- // both in compile time and in code size. This should be replaced once
- // someone figures out how a good estimation.
- return L->getBlocks().size();
-
- unsigned Cost = 0;
- // FIXME: this is brain dead. It should take into consideration code
- // shrinkage.
- for (Loop::block_iterator I = L->block_begin(), E = L->block_end();
- I != E; ++I) {
- BasicBlock *BB = *I;
- // Do not include empty blocks in the cost calculation. This happen due to
- // loop canonicalization and will be removed.
- if (BB->begin() == BasicBlock::iterator(BB->getTerminator()))
- continue;
-
- // Count basic blocks.
- ++Cost;
- }
-
- return Cost;
-}
-
-/// UnswitchIfProfitable - We have found that we can unswitch L when
-/// LoopCond == Val to simplify the loop. If we decide that this is profitable,
-/// unswitch the loop, reprocess the pieces, then return true.
-bool LoopUnswitch::UnswitchIfProfitable(Value *LoopCond, Constant *Val,Loop *L){
- // Check to see if it would be profitable to unswitch this loop.
- unsigned Cost = getLoopUnswitchCost(L, LoopCond);
-
- // Do not do non-trivial unswitch while optimizing for size.
- if (Cost && OptimizeForSize)
- return false;
-
- if (Cost > Threshold) {
- // FIXME: this should estimate growth by the amount of code shared by the
- // resultant unswitched loops.
- //
- DOUT << "NOT unswitching loop %"
- << L->getHeader()->getName() << ", cost too high: "
- << L->getBlocks().size() << "\n";
- return false;
- }
-
- // If this is a trivial condition to unswitch (which results in no code
- // duplication), do it now.
- Constant *CondVal;
- BasicBlock *ExitBlock;
- if (IsTrivialUnswitchCondition(L, LoopCond, &CondVal, &ExitBlock)) {
- UnswitchTrivialCondition(L, LoopCond, CondVal, ExitBlock);
- } else {
- UnswitchNontrivialCondition(LoopCond, Val, L);
- }
-
- return true;
-}
-
-// RemapInstruction - Convert the instruction operands from referencing the
-// current values into those specified by ValueMap.
-//
-static inline void RemapInstruction(Instruction *I,
- DenseMap<const Value *, Value*> &ValueMap) {
- for (unsigned op = 0, E = I->getNumOperands(); op != E; ++op) {
- Value *Op = I->getOperand(op);
- DenseMap<const Value *, Value*>::iterator It = ValueMap.find(Op);
- if (It != ValueMap.end()) Op = It->second;
- I->setOperand(op, Op);
- }
-}
-
-// CloneDomInfo - NewBB is cloned from Orig basic block. Now clone Dominator
-// Info.
-//
-// If Orig block's immediate dominator is mapped in VM then use corresponding
-// immediate dominator from the map. Otherwise Orig block's dominator is also
-// NewBB's dominator.
-//
-// OrigPreheader is loop pre-header before this pass started
-// updating CFG. NewPrehader is loops new pre-header. However, after CFG
-// manipulation, loop L may not exist. So rely on input parameter NewPreheader.
-void CloneDomInfo(BasicBlock *NewBB, BasicBlock *Orig,
- BasicBlock *NewPreheader, BasicBlock *OrigPreheader,
- BasicBlock *OrigHeader,
- DominatorTree *DT, DominanceFrontier *DF,
- DenseMap<const Value*, Value*> &VM) {
-
- // If NewBB alreay has found its place in domiantor tree then no need to do
- // anything.
- if (DT->getNode(NewBB))
- return;
-
- // If Orig does not have any immediate domiantor then its clone, NewBB, does
- // not need any immediate dominator.
- DomTreeNode *OrigNode = DT->getNode(Orig);
- if (!OrigNode)
- return;
- DomTreeNode *OrigIDomNode = OrigNode->getIDom();
- if (!OrigIDomNode)
- return;
-
- BasicBlock *OrigIDom = NULL;
-
- // If Orig is original loop header then its immediate dominator is
- // NewPreheader.
- if (Orig == OrigHeader)
- OrigIDom = NewPreheader;
-
- // If Orig is new pre-header then its immediate dominator is
- // original pre-header.
- else if (Orig == NewPreheader)
- OrigIDom = OrigPreheader;
-
- // Other as DT to find Orig's immediate dominator.
- else
- OrigIDom = OrigIDomNode->getBlock();
-
- // Initially use Orig's immediate dominator as NewBB's immediate dominator.
- BasicBlock *NewIDom = OrigIDom;
- DenseMap<const Value*, Value*>::iterator I = VM.find(OrigIDom);
- if (I != VM.end()) {
- NewIDom = cast<BasicBlock>(I->second);
-
- // If NewIDom does not have corresponding dominatore tree node then
- // get one.
- if (!DT->getNode(NewIDom))
- CloneDomInfo(NewIDom, OrigIDom, NewPreheader, OrigPreheader,
- OrigHeader, DT, DF, VM);
- }
-
- DT->addNewBlock(NewBB, NewIDom);
-
- // Copy cloned dominance frontiner set
- DominanceFrontier::DomSetType NewDFSet;
- if (DF) {
- DominanceFrontier::iterator DFI = DF->find(Orig);
- if ( DFI != DF->end()) {
- DominanceFrontier::DomSetType S = DFI->second;
- for (DominanceFrontier::DomSetType::iterator I = S.begin(), E = S.end();
- I != E; ++I) {
- BasicBlock *BB = *I;
- DenseMap<const Value*, Value*>::iterator IDM = VM.find(BB);
- if (IDM != VM.end())
- NewDFSet.insert(cast<BasicBlock>(IDM->second));
- else
- NewDFSet.insert(BB);
- }
- }
- DF->addBasicBlock(NewBB, NewDFSet);
- }
-}
-
-/// CloneLoop - Recursively clone the specified loop and all of its children,
-/// mapping the blocks with the specified map.
-static Loop *CloneLoop(Loop *L, Loop *PL, DenseMap<const Value*, Value*> &VM,
- LoopInfo *LI, LPPassManager *LPM) {
- Loop *New = new Loop();
-
- LPM->insertLoop(New, PL);
-
- // Add all of the blocks in L to the new loop.
- for (Loop::block_iterator I = L->block_begin(), E = L->block_end();
- I != E; ++I)
- if (LI->getLoopFor(*I) == L)
- New->addBasicBlockToLoop(cast<BasicBlock>(VM[*I]), LI->getBase());
-
- // Add all of the subloops to the new loop.
- for (Loop::iterator I = L->begin(), E = L->end(); I != E; ++I)
- CloneLoop(*I, New, VM, LI, LPM);
-
- return New;
-}
-
-/// EmitPreheaderBranchOnCondition - Emit a conditional branch on two values
-/// if LIC == Val, branch to TrueDst, otherwise branch to FalseDest. Insert the
-/// code immediately before InsertPt.
-void LoopUnswitch::EmitPreheaderBranchOnCondition(Value *LIC, Constant *Val,
- BasicBlock *TrueDest,
- BasicBlock *FalseDest,
- Instruction *InsertPt) {
- // Insert a conditional branch on LIC to the two preheaders. The original
- // code is the true version and the new code is the false version.
- Value *BranchVal = LIC;
- if (!isa<ConstantInt>(Val) || Val->getType() != Type::Int1Ty)
- BranchVal = new ICmpInst(ICmpInst::ICMP_EQ, LIC, Val, "tmp", InsertPt);
- else if (Val != ConstantInt::getTrue())
- // We want to enter the new loop when the condition is true.
- std::swap(TrueDest, FalseDest);
-
- // Insert the new branch.
- BranchInst::Create(TrueDest, FalseDest, BranchVal, InsertPt);
-
-}
-
-
-/// UnswitchTrivialCondition - Given a loop that has a trivial unswitchable
-/// condition in it (a cond branch from its header block to its latch block,
-/// where the path through the loop that doesn't execute its body has no
-/// side-effects), unswitch it. This doesn't involve any code duplication, just
-/// moving the conditional branch outside of the loop and updating loop info.
-void LoopUnswitch::UnswitchTrivialCondition(Loop *L, Value *Cond,
- Constant *Val,
- BasicBlock *ExitBlock) {
- DOUT << "loop-unswitch: Trivial-Unswitch loop %"
- << L->getHeader()->getName() << " [" << L->getBlocks().size()
- << " blocks] in Function " << L->getHeader()->getParent()->getName()
- << " on cond: " << *Val << " == " << *Cond << "\n";
-
- // First step, split the preheader, so that we know that there is a safe place
- // to insert the conditional branch. We will change 'OrigPH' to have a
- // conditional branch on Cond.
- BasicBlock *OrigPH = L->getLoopPreheader();
- BasicBlock *NewPH = SplitEdge(OrigPH, L->getHeader(), this);
-
- // Now that we have a place to insert the conditional branch, create a place
- // to branch to: this is the exit block out of the loop that we should
- // short-circuit to.
-
- // Split this block now, so that the loop maintains its exit block, and so
- // that the jump from the preheader can execute the contents of the exit block
- // without actually branching to it (the exit block should be dominated by the
- // loop header, not the preheader).
- assert(!L->contains(ExitBlock) && "Exit block is in the loop?");
- BasicBlock *NewExit = SplitBlock(ExitBlock, ExitBlock->begin(), this);
-
- // Okay, now we have a position to branch from and a position to branch to,
- // insert the new conditional branch.
- EmitPreheaderBranchOnCondition(Cond, Val, NewExit, NewPH,
- OrigPH->getTerminator());
- LPM->deleteSimpleAnalysisValue(OrigPH->getTerminator(), L);
- OrigPH->getTerminator()->eraseFromParent();
-
- // We need to reprocess this loop, it could be unswitched again.
- redoLoop = true;
-
- // Now that we know that the loop is never entered when this condition is a
- // particular value, rewrite the loop with this info. We know that this will
- // at least eliminate the old branch.
- RewriteLoopBodyWithConditionConstant(L, Cond, Val, false);
- ++NumTrivial;
-}
-
-/// ReplaceLoopExternalDFMember -
-/// If BB's dominance frontier has a member that is not part of loop L then
-/// remove it. Add NewDFMember in BB's dominance frontier.
-void LoopUnswitch::ReplaceLoopExternalDFMember(Loop *L, BasicBlock *BB,
- BasicBlock *NewDFMember) {
-
- DominanceFrontier::iterator DFI = DF->find(BB);
- if (DFI == DF->end())
- return;
-
- DominanceFrontier::DomSetType &DFSet = DFI->second;
- for (DominanceFrontier::DomSetType::iterator DI = DFSet.begin(),
- DE = DFSet.end(); DI != DE;) {
- BasicBlock *B = *DI++;
- if (L->contains(B))
- continue;
-
- DF->removeFromFrontier(DFI, B);
- LoopDF.insert(B);
- }
-
- DF->addToFrontier(DFI, NewDFMember);
-}
-
-/// SplitExitEdges - Split all of the edges from inside the loop to their exit
-/// blocks. Update the appropriate Phi nodes as we do so.
-void LoopUnswitch::SplitExitEdges(Loop *L,
- const SmallVector<BasicBlock *, 8> &ExitBlocks,
- SmallVector<BasicBlock *, 8> &MiddleBlocks) {
-
- for (unsigned i = 0, e = ExitBlocks.size(); i != e; ++i) {
- BasicBlock *ExitBlock = ExitBlocks[i];
- std::vector<BasicBlock*> Preds(pred_begin(ExitBlock), pred_end(ExitBlock));
-
- for (unsigned j = 0, e = Preds.size(); j != e; ++j) {
- BasicBlock* MiddleBlock = SplitEdge(Preds[j], ExitBlock, this);
- MiddleBlocks.push_back(MiddleBlock);
- BasicBlock* StartBlock = Preds[j];
- BasicBlock* EndBlock;
- if (MiddleBlock->getSinglePredecessor() == ExitBlock) {
- EndBlock = MiddleBlock;
- MiddleBlock = EndBlock->getSinglePredecessor();;
- } else {
- EndBlock = ExitBlock;
- }
-
- OrigLoopExitMap[StartBlock] = EndBlock;
-
- std::set<PHINode*> InsertedPHIs;
- PHINode* OldLCSSA = 0;
- for (BasicBlock::iterator I = EndBlock->begin();
- (OldLCSSA = dyn_cast<PHINode>(I)); ++I) {
- Value* OldValue = OldLCSSA->getIncomingValueForBlock(MiddleBlock);
- PHINode* NewLCSSA = PHINode::Create(OldLCSSA->getType(),
- OldLCSSA->getName() + ".us-lcssa",
- MiddleBlock->getTerminator());
- NewLCSSA->addIncoming(OldValue, StartBlock);
- OldLCSSA->setIncomingValue(OldLCSSA->getBasicBlockIndex(MiddleBlock),
- NewLCSSA);
- InsertedPHIs.insert(NewLCSSA);
- }
-
- BasicBlock::iterator InsertPt = EndBlock->begin();
- while (dyn_cast<PHINode>(InsertPt)) ++InsertPt;
- for (BasicBlock::iterator I = MiddleBlock->begin();
- (OldLCSSA = dyn_cast<PHINode>(I)) && InsertedPHIs.count(OldLCSSA) == 0;
- ++I) {
- PHINode *NewLCSSA = PHINode::Create(OldLCSSA->getType(),
- OldLCSSA->getName() + ".us-lcssa",
- InsertPt);
- OldLCSSA->replaceAllUsesWith(NewLCSSA);
- NewLCSSA->addIncoming(OldLCSSA, MiddleBlock);
- }
-
- if (DF && DT) {
- // StartBlock -- > MiddleBlock -- > EndBlock
- // StartBlock is loop exiting block. EndBlock will become merge point
- // of two loop exits after loop unswitch.
-
- // If StartBlock's DF member includes a block that is not loop member
- // then replace that DF member with EndBlock.
-
- // If MiddleBlock's DF member includes a block that is not loop member
- // tnen replace that DF member with EndBlock.
-
- ReplaceLoopExternalDFMember(L, StartBlock, EndBlock);
- ReplaceLoopExternalDFMember(L, MiddleBlock, EndBlock);
- }
- }
- }
-
-}
-
-/// UnswitchNontrivialCondition - We determined that the loop is profitable
-/// to unswitch when LIC equal Val. Split it into loop versions and test the
-/// condition outside of either loop. Return the loops created as Out1/Out2.
-void LoopUnswitch::UnswitchNontrivialCondition(Value *LIC, Constant *Val,
- Loop *L) {
- Function *F = L->getHeader()->getParent();
- DOUT << "loop-unswitch: Unswitching loop %"
- << L->getHeader()->getName() << " [" << L->getBlocks().size()
- << " blocks] in Function " << F->getName()
- << " when '" << *Val << "' == " << *LIC << "\n";
-
- // LoopBlocks contains all of the basic blocks of the loop, including the
- // preheader of the loop, the body of the loop, and the exit blocks of the
- // loop, in that order.
- std::vector<BasicBlock*> LoopBlocks;
-
- // First step, split the preheader and exit blocks, and add these blocks to
- // the LoopBlocks list.
- BasicBlock *OrigHeader = L->getHeader();
- BasicBlock *OrigPreheader = L->getLoopPreheader();
- BasicBlock *NewPreheader = SplitEdge(OrigPreheader, L->getHeader(), this);
- LoopBlocks.push_back(NewPreheader);
-
- // We want the loop to come after the preheader, but before the exit blocks.
- LoopBlocks.insert(LoopBlocks.end(), L->block_begin(), L->block_end());
-
- SmallVector<BasicBlock*, 8> ExitBlocks;
- L->getUniqueExitBlocks(ExitBlocks);
-
- // Split all of the edges from inside the loop to their exit blocks. Update
- // the appropriate Phi nodes as we do so.
- SmallVector<BasicBlock *,8> MiddleBlocks;
- SplitExitEdges(L, ExitBlocks, MiddleBlocks);
-
- // The exit blocks may have been changed due to edge splitting, recompute.
- ExitBlocks.clear();
- L->getUniqueExitBlocks(ExitBlocks);
-
- // Add exit blocks to the loop blocks.
- LoopBlocks.insert(LoopBlocks.end(), ExitBlocks.begin(), ExitBlocks.end());
-
- // Next step, clone all of the basic blocks that make up the loop (including
- // the loop preheader and exit blocks), keeping track of the mapping between
- // the instructions and blocks.
- std::vector<BasicBlock*> NewBlocks;
- NewBlocks.reserve(LoopBlocks.size());
- DenseMap<const Value*, Value*> ValueMap;
- for (unsigned i = 0, e = LoopBlocks.size(); i != e; ++i) {
- BasicBlock *New = CloneBasicBlock(LoopBlocks[i], ValueMap, ".us", F);
- NewBlocks.push_back(New);
- ValueMap[LoopBlocks[i]] = New; // Keep the BB mapping.
- LPM->cloneBasicBlockSimpleAnalysis(LoopBlocks[i], New, L);
- }
-
- // OutSiders are basic block that are dominated by original header and
- // at the same time they are not part of loop.
- SmallPtrSet<BasicBlock *, 8> OutSiders;
- if (DT) {
- DomTreeNode *OrigHeaderNode = DT->getNode(OrigHeader);
- for(std::vector<DomTreeNode*>::iterator DI = OrigHeaderNode->begin(),
- DE = OrigHeaderNode->end(); DI != DE; ++DI) {
- BasicBlock *B = (*DI)->getBlock();
-
- DenseMap<const Value*, Value*>::iterator VI = ValueMap.find(B);
- if (VI == ValueMap.end())
- OutSiders.insert(B);
- }
- }
-
- // Splice the newly inserted blocks into the function right before the
- // original preheader.
- F->getBasicBlockList().splice(LoopBlocks[0], F->getBasicBlockList(),
- NewBlocks[0], F->end());
-
- // Now we create the new Loop object for the versioned loop.
- Loop *NewLoop = CloneLoop(L, L->getParentLoop(), ValueMap, LI, LPM);
- Loop *ParentLoop = L->getParentLoop();
- if (ParentLoop) {
- // Make sure to add the cloned preheader and exit blocks to the parent loop
- // as well.
- ParentLoop->addBasicBlockToLoop(NewBlocks[0], LI->getBase());
- }
-
- for (unsigned i = 0, e = ExitBlocks.size(); i != e; ++i) {
- BasicBlock *NewExit = cast<BasicBlock>(ValueMap[ExitBlocks[i]]);
- // The new exit block should be in the same loop as the old one.
- if (Loop *ExitBBLoop = LI->getLoopFor(ExitBlocks[i]))
- ExitBBLoop->addBasicBlockToLoop(NewExit, LI->getBase());
-
- assert(NewExit->getTerminator()->getNumSuccessors() == 1 &&
- "Exit block should have been split to have one successor!");
- BasicBlock *ExitSucc = NewExit->getTerminator()->getSuccessor(0);
-
- // If the successor of the exit block had PHI nodes, add an entry for
- // NewExit.
- PHINode *PN;
- for (BasicBlock::iterator I = ExitSucc->begin();
- (PN = dyn_cast<PHINode>(I)); ++I) {
- Value *V = PN->getIncomingValueForBlock(ExitBlocks[i]);
- DenseMap<const Value *, Value*>::iterator It = ValueMap.find(V);
- if (It != ValueMap.end()) V = It->second;
- PN->addIncoming(V, NewExit);
- }
- }
-
- // Rewrite the code to refer to itself.
- for (unsigned i = 0, e = NewBlocks.size(); i != e; ++i)
- for (BasicBlock::iterator I = NewBlocks[i]->begin(),
- E = NewBlocks[i]->end(); I != E; ++I)
- RemapInstruction(I, ValueMap);
-
- // Rewrite the original preheader to select between versions of the loop.
- BranchInst *OldBR = cast<BranchInst>(OrigPreheader->getTerminator());
- assert(OldBR->isUnconditional() && OldBR->getSuccessor(0) == LoopBlocks[0] &&
- "Preheader splitting did not work correctly!");
-
- // Emit the new branch that selects between the two versions of this loop.
- EmitPreheaderBranchOnCondition(LIC, Val, NewBlocks[0], LoopBlocks[0], OldBR);
- LPM->deleteSimpleAnalysisValue(OldBR, L);
- OldBR->eraseFromParent();
-
- // Update dominator info
- if (DF && DT) {
-
- SmallVector<BasicBlock *,4> ExitingBlocks;
- L->getExitingBlocks(ExitingBlocks);
-
- // Clone dominator info for all cloned basic block.
- for (unsigned i = 0, e = LoopBlocks.size(); i != e; ++i) {
- BasicBlock *LBB = LoopBlocks[i];
- BasicBlock *NBB = NewBlocks[i];
- CloneDomInfo(NBB, LBB, NewPreheader, OrigPreheader,
- OrigHeader, DT, DF, ValueMap);
-
- // If LBB's dominance frontier includes DFMember
- // such that DFMember is also a member of LoopDF then
- // - Remove DFMember from LBB's dominance frontier
- // - Copy loop exiting blocks', that are dominated by BB,
- // dominance frontier member in BB's dominance frontier
-
- DominanceFrontier::iterator LBBI = DF->find(LBB);
- DominanceFrontier::iterator NBBI = DF->find(NBB);
- if (LBBI == DF->end())
- continue;
-
- DominanceFrontier::DomSetType &LBSet = LBBI->second;
- for (DominanceFrontier::DomSetType::iterator LI = LBSet.begin(),
- LE = LBSet.end(); LI != LE; /* NULL */) {
- BasicBlock *B = *LI++;
- if (B == LBB && B == L->getHeader())
- continue;
- bool removeB = false;
- if (!LoopDF.count(B))
- continue;
-
- // If LBB dominates loop exits then insert loop exit block's DF
- // into B's DF.
- for(SmallVector<BasicBlock *, 4>::iterator
- LExitI = ExitingBlocks.begin(),
- LExitE = ExitingBlocks.end(); LExitI != LExitE; ++LExitI) {
- BasicBlock *E = *LExitI;
-
- if (!DT->dominates(LBB,E))
- continue;
-
- DenseMap<BasicBlock *, BasicBlock *>::iterator DFBI =
- OrigLoopExitMap.find(E);
- if (DFBI == OrigLoopExitMap.end())
- continue;
-
- BasicBlock *DFB = DFBI->second;
- DF->addToFrontier(LBBI, DFB);
- DF->addToFrontier(NBBI, DFB);
- removeB = true;
- }
-
- // If B's replacement is inserted in DF then now is the time to remove
- // B.
- if (removeB) {
- DF->removeFromFrontier(LBBI, B);
- if (L->contains(B))
- DF->removeFromFrontier(NBBI, cast<BasicBlock>(ValueMap[B]));
- else
- DF->removeFromFrontier(NBBI, B);
- }
- }
-
- }
-
- // MiddleBlocks are dominated by original pre header. SplitEdge updated
- // MiddleBlocks' dominance frontier appropriately.
- for (unsigned i = 0, e = MiddleBlocks.size(); i != e; ++i) {
- BasicBlock *MBB = MiddleBlocks[i];
- if (!MBB->getSinglePredecessor())
- DT->changeImmediateDominator(MBB, OrigPreheader);
- }
-
- // All Outsiders are now dominated by original pre header.
- for (SmallPtrSet<BasicBlock *, 8>::iterator OI = OutSiders.begin(),
- OE = OutSiders.end(); OI != OE; ++OI) {
- BasicBlock *OB = *OI;
- DT->changeImmediateDominator(OB, OrigPreheader);
- }
-
- // New loop headers are dominated by original preheader
- DT->changeImmediateDominator(NewBlocks[0], OrigPreheader);
- DT->changeImmediateDominator(LoopBlocks[0], OrigPreheader);
- }
-
- LoopProcessWorklist.push_back(NewLoop);
- redoLoop = true;
-
- // Now we rewrite the original code to know that the condition is true and the
- // new code to know that the condition is false.
- RewriteLoopBodyWithConditionConstant(L , LIC, Val, false);
-
- // It's possible that simplifying one loop could cause the other to be
- // deleted. If so, don't simplify it.
- if (!LoopProcessWorklist.empty() && LoopProcessWorklist.back() == NewLoop)
- RewriteLoopBodyWithConditionConstant(NewLoop, LIC, Val, true);
-}
-
-/// RemoveFromWorklist - Remove all instances of I from the worklist vector
-/// specified.
-static void RemoveFromWorklist(Instruction *I,
- std::vector<Instruction*> &Worklist) {
- std::vector<Instruction*>::iterator WI = std::find(Worklist.begin(),
- Worklist.end(), I);
- while (WI != Worklist.end()) {
- unsigned Offset = WI-Worklist.begin();
- Worklist.erase(WI);
- WI = std::find(Worklist.begin()+Offset, Worklist.end(), I);
- }
-}
-
-/// ReplaceUsesOfWith - When we find that I really equals V, remove I from the
-/// program, replacing all uses with V and update the worklist.
-static void ReplaceUsesOfWith(Instruction *I, Value *V,
- std::vector<Instruction*> &Worklist,
- Loop *L, LPPassManager *LPM) {
- DOUT << "Replace with '" << *V << "': " << *I;
-
- // Add uses to the worklist, which may be dead now.
- for (unsigned i = 0, e = I->getNumOperands(); i != e; ++i)
- if (Instruction *Use = dyn_cast<Instruction>(I->getOperand(i)))
- Worklist.push_back(Use);
-
- // Add users to the worklist which may be simplified now.
- for (Value::use_iterator UI = I->use_begin(), E = I->use_end();
- UI != E; ++UI)
- Worklist.push_back(cast<Instruction>(*UI));
- LPM->deleteSimpleAnalysisValue(I, L);
- RemoveFromWorklist(I, Worklist);
- I->replaceAllUsesWith(V);
- I->eraseFromParent();
- ++NumSimplify;
-}
-
-/// RemoveBlockIfDead - If the specified block is dead, remove it, update loop
-/// information, and remove any dead successors it has.
-///
-void LoopUnswitch::RemoveBlockIfDead(BasicBlock *BB,
- std::vector<Instruction*> &Worklist,
- Loop *L) {
- if (pred_begin(BB) != pred_end(BB)) {
- // This block isn't dead, since an edge to BB was just removed, see if there
- // are any easy simplifications we can do now.
- if (BasicBlock *Pred = BB->getSinglePredecessor()) {
- // If it has one pred, fold phi nodes in BB.
- while (isa<PHINode>(BB->begin()))
- ReplaceUsesOfWith(BB->begin(),
- cast<PHINode>(BB->begin())->getIncomingValue(0),
- Worklist, L, LPM);
-
- // If this is the header of a loop and the only pred is the latch, we now
- // have an unreachable loop.
- if (Loop *L = LI->getLoopFor(BB))
- if (L->getHeader() == BB && L->contains(Pred)) {
- // Remove the branch from the latch to the header block, this makes
- // the header dead, which will make the latch dead (because the header
- // dominates the latch).
- LPM->deleteSimpleAnalysisValue(Pred->getTerminator(), L);
- Pred->getTerminator()->eraseFromParent();
- new UnreachableInst(Pred);
-
- // The loop is now broken, remove it from LI.
- RemoveLoopFromHierarchy(L);
-
- // Reprocess the header, which now IS dead.
- RemoveBlockIfDead(BB, Worklist, L);
- return;
- }
-
- // If pred ends in a uncond branch, add uncond branch to worklist so that
- // the two blocks will get merged.
- if (BranchInst *BI = dyn_cast<BranchInst>(Pred->getTerminator()))
- if (BI->isUnconditional())
- Worklist.push_back(BI);
- }
- return;
- }
-
- DOUT << "Nuking dead block: " << *BB;
-
- // Remove the instructions in the basic block from the worklist.
- for (BasicBlock::iterator I = BB->begin(), E = BB->end(); I != E; ++I) {
- RemoveFromWorklist(I, Worklist);
-
- // Anything that uses the instructions in this basic block should have their
- // uses replaced with undefs.
- if (!I->use_empty())
- I->replaceAllUsesWith(UndefValue::get(I->getType()));
- }
-
- // If this is the edge to the header block for a loop, remove the loop and
- // promote all subloops.
- if (Loop *BBLoop = LI->getLoopFor(BB)) {
- if (BBLoop->getLoopLatch() == BB)
- RemoveLoopFromHierarchy(BBLoop);
- }
-
- // Remove the block from the loop info, which removes it from any loops it
- // was in.
- LI->removeBlock(BB);
-
-
- // Remove phi node entries in successors for this block.
- TerminatorInst *TI = BB->getTerminator();
- std::vector<BasicBlock*> Succs;
- for (unsigned i = 0, e = TI->getNumSuccessors(); i != e; ++i) {
- Succs.push_back(TI->getSuccessor(i));
- TI->getSuccessor(i)->removePredecessor(BB);
- }
-
- // Unique the successors, remove anything with multiple uses.
- std::sort(Succs.begin(), Succs.end());
- Succs.erase(std::unique(Succs.begin(), Succs.end()), Succs.end());
-
- // Remove the basic block, including all of the instructions contained in it.
- LPM->deleteSimpleAnalysisValue(BB, L);
- BB->eraseFromParent();
- // Remove successor blocks here that are not dead, so that we know we only
- // have dead blocks in this list. Nondead blocks have a way of becoming dead,
- // then getting removed before we revisit them, which is badness.
- //
- for (unsigned i = 0; i != Succs.size(); ++i)
- if (pred_begin(Succs[i]) != pred_end(Succs[i])) {
- // One exception is loop headers. If this block was the preheader for a
- // loop, then we DO want to visit the loop so the loop gets deleted.
- // We know that if the successor is a loop header, that this loop had to
- // be the preheader: the case where this was the latch block was handled
- // above and headers can only have two predecessors.
- if (!LI->isLoopHeader(Succs[i])) {
- Succs.erase(Succs.begin()+i);
- --i;
- }
- }
-
- for (unsigned i = 0, e = Succs.size(); i != e; ++i)
- RemoveBlockIfDead(Succs[i], Worklist, L);
-}
-
-/// RemoveLoopFromHierarchy - We have discovered that the specified loop has
-/// become unwrapped, either because the backedge was deleted, or because the
-/// edge into the header was removed. If the edge into the header from the
-/// latch block was removed, the loop is unwrapped but subloops are still alive,
-/// so they just reparent loops. If the loops are actually dead, they will be
-/// removed later.
-void LoopUnswitch::RemoveLoopFromHierarchy(Loop *L) {
- LPM->deleteLoopFromQueue(L);
- RemoveLoopFromWorklist(L);
-}
-
-
-
-// RewriteLoopBodyWithConditionConstant - We know either that the value LIC has
-// the value specified by Val in the specified loop, or we know it does NOT have
-// that value. Rewrite any uses of LIC or of properties correlated to it.
-void LoopUnswitch::RewriteLoopBodyWithConditionConstant(Loop *L, Value *LIC,
- Constant *Val,
- bool IsEqual) {
- assert(!isa<Constant>(LIC) && "Why are we unswitching on a constant?");
-
- // FIXME: Support correlated properties, like:
- // for (...)
- // if (li1 < li2)
- // ...
- // if (li1 > li2)
- // ...
-
- // FOLD boolean conditions (X|LIC), (X&LIC). Fold conditional branches,
- // selects, switches.
- std::vector<User*> Users(LIC->use_begin(), LIC->use_end());
- std::vector<Instruction*> Worklist;
-
- // If we know that LIC == Val, or that LIC == NotVal, just replace uses of LIC
- // in the loop with the appropriate one directly.
- if (IsEqual || (isa<ConstantInt>(Val) && Val->getType() == Type::Int1Ty)) {
- Value *Replacement;
- if (IsEqual)
- Replacement = Val;
- else
- Replacement = ConstantInt::get(Type::Int1Ty,
- !cast<ConstantInt>(Val)->getZExtValue());
-
- for (unsigned i = 0, e = Users.size(); i != e; ++i)
- if (Instruction *U = cast<Instruction>(Users[i])) {
- if (!L->contains(U->getParent()))
- continue;
- U->replaceUsesOfWith(LIC, Replacement);
- Worklist.push_back(U);
- }
- } else {
- // Otherwise, we don't know the precise value of LIC, but we do know that it
- // is certainly NOT "Val". As such, simplify any uses in the loop that we
- // can. This case occurs when we unswitch switch statements.
- for (unsigned i = 0, e = Users.size(); i != e; ++i)
- if (Instruction *U = cast<Instruction>(Users[i])) {
- if (!L->contains(U->getParent()))
- continue;
-
- Worklist.push_back(U);
-
- // If we know that LIC is not Val, use this info to simplify code.
- if (SwitchInst *SI = dyn_cast<SwitchInst>(U)) {
- for (unsigned i = 1, e = SI->getNumCases(); i != e; ++i) {
- if (SI->getCaseValue(i) == Val) {
- // Found a dead case value. Don't remove PHI nodes in the
- // successor if they become single-entry, those PHI nodes may
- // be in the Users list.
-
- // FIXME: This is a hack. We need to keep the successor around
- // and hooked up so as to preserve the loop structure, because
- // trying to update it is complicated. So instead we preserve the
- // loop structure and put the block on an dead code path.
-
- BasicBlock* Old = SI->getParent();
- BasicBlock* Split = SplitBlock(Old, SI, this);
-
- Instruction* OldTerm = Old->getTerminator();
- BranchInst::Create(Split, SI->getSuccessor(i),
- ConstantInt::getTrue(), OldTerm);
-
- LPM->deleteSimpleAnalysisValue(Old->getTerminator(), L);
- Old->getTerminator()->eraseFromParent();
-
- PHINode *PN;
- for (BasicBlock::iterator II = SI->getSuccessor(i)->begin();
- (PN = dyn_cast<PHINode>(II)); ++II) {
- Value *InVal = PN->removeIncomingValue(Split, false);
- PN->addIncoming(InVal, Old);
- }
-
- SI->removeCase(i);
- break;
- }
- }
- }
-
- // TODO: We could do other simplifications, for example, turning
- // LIC == Val -> false.
- }
- }
-
- SimplifyCode(Worklist, L);
-}
-
-/// SimplifyCode - Okay, now that we have simplified some instructions in the
-/// loop, walk over it and constant prop, dce, and fold control flow where
-/// possible. Note that this is effectively a very simple loop-structure-aware
-/// optimizer. During processing of this loop, L could very well be deleted, so
-/// it must not be used.
-///
-/// FIXME: When the loop optimizer is more mature, separate this out to a new
-/// pass.
-///
-void LoopUnswitch::SimplifyCode(std::vector<Instruction*> &Worklist, Loop *L) {
- while (!Worklist.empty()) {
- Instruction *I = Worklist.back();
- Worklist.pop_back();
-
- // Simple constant folding.
- if (Constant *C = ConstantFoldInstruction(I)) {
- ReplaceUsesOfWith(I, C, Worklist, L, LPM);
- continue;
- }
-
- // Simple DCE.
- if (isInstructionTriviallyDead(I)) {
- DOUT << "Remove dead instruction '" << *I;
-
- // Add uses to the worklist, which may be dead now.
- for (unsigned i = 0, e = I->getNumOperands(); i != e; ++i)
- if (Instruction *Use = dyn_cast<Instruction>(I->getOperand(i)))
- Worklist.push_back(Use);
- LPM->deleteSimpleAnalysisValue(I, L);
- RemoveFromWorklist(I, Worklist);
- I->eraseFromParent();
- ++NumSimplify;
- continue;
- }
-
- // Special case hacks that appear commonly in unswitched code.
- switch (I->getOpcode()) {
- case Instruction::Select:
- if (ConstantInt *CB = dyn_cast<ConstantInt>(I->getOperand(0))) {
- ReplaceUsesOfWith(I, I->getOperand(!CB->getZExtValue()+1), Worklist, L,
- LPM);
- continue;
- }
- break;
- case Instruction::And:
- if (isa<ConstantInt>(I->getOperand(0)) &&
- I->getOperand(0)->getType() == Type::Int1Ty) // constant -> RHS
- cast<BinaryOperator>(I)->swapOperands();
- if (ConstantInt *CB = dyn_cast<ConstantInt>(I->getOperand(1)))
- if (CB->getType() == Type::Int1Ty) {
- if (CB->isOne()) // X & 1 -> X
- ReplaceUsesOfWith(I, I->getOperand(0), Worklist, L, LPM);
- else // X & 0 -> 0
- ReplaceUsesOfWith(I, I->getOperand(1), Worklist, L, LPM);
- continue;
- }
- break;
- case Instruction::Or:
- if (isa<ConstantInt>(I->getOperand(0)) &&
- I->getOperand(0)->getType() == Type::Int1Ty) // constant -> RHS
- cast<BinaryOperator>(I)->swapOperands();
- if (ConstantInt *CB = dyn_cast<ConstantInt>(I->getOperand(1)))
- if (CB->getType() == Type::Int1Ty) {
- if (CB->isOne()) // X | 1 -> 1
- ReplaceUsesOfWith(I, I->getOperand(1), Worklist, L, LPM);
- else // X | 0 -> X
- ReplaceUsesOfWith(I, I->getOperand(0), Worklist, L, LPM);
- continue;
- }
- break;
- case Instruction::Br: {
- BranchInst *BI = cast<BranchInst>(I);
- if (BI->isUnconditional()) {
- // If BI's parent is the only pred of the successor, fold the two blocks
- // together.
- BasicBlock *Pred = BI->getParent();
- BasicBlock *Succ = BI->getSuccessor(0);
- BasicBlock *SinglePred = Succ->getSinglePredecessor();
- if (!SinglePred) continue; // Nothing to do.
- assert(SinglePred == Pred && "CFG broken");
-
- DOUT << "Merging blocks: " << Pred->getName() << " <- "
- << Succ->getName() << "\n";
-
- // Resolve any single entry PHI nodes in Succ.
- while (PHINode *PN = dyn_cast<PHINode>(Succ->begin()))
- ReplaceUsesOfWith(PN, PN->getIncomingValue(0), Worklist, L, LPM);
-
- // Move all of the successor contents from Succ to Pred.
- Pred->getInstList().splice(BI, Succ->getInstList(), Succ->begin(),
- Succ->end());
- LPM->deleteSimpleAnalysisValue(BI, L);
- BI->eraseFromParent();
- RemoveFromWorklist(BI, Worklist);
-
- // If Succ has any successors with PHI nodes, update them to have
- // entries coming from Pred instead of Succ.
- Succ->replaceAllUsesWith(Pred);
-
- // Remove Succ from the loop tree.
- LI->removeBlock(Succ);
- LPM->deleteSimpleAnalysisValue(Succ, L);
- Succ->eraseFromParent();
- ++NumSimplify;
- } else if (ConstantInt *CB = dyn_cast<ConstantInt>(BI->getCondition())){
- // Conditional branch. Turn it into an unconditional branch, then
- // remove dead blocks.
- break; // FIXME: Enable.
-
- DOUT << "Folded branch: " << *BI;
- BasicBlock *DeadSucc = BI->getSuccessor(CB->getZExtValue());
- BasicBlock *LiveSucc = BI->getSuccessor(!CB->getZExtValue());
- DeadSucc->removePredecessor(BI->getParent(), true);
- Worklist.push_back(BranchInst::Create(LiveSucc, BI));
- LPM->deleteSimpleAnalysisValue(BI, L);
- BI->eraseFromParent();
- RemoveFromWorklist(BI, Worklist);
- ++NumSimplify;
-
- RemoveBlockIfDead(DeadSucc, Worklist, L);
- }
- break;
- }
- }
- }
-}
diff --git a/release_23/lib/Transforms/Scalar/Makefile b/release_23/lib/Transforms/Scalar/Makefile
deleted file mode 100644
index b091f342d58d..000000000000
--- a/release_23/lib/Transforms/Scalar/Makefile
+++ /dev/null
@@ -1,15 +0,0 @@
-##===- lib/Transforms/Scalar/Makefile ----------------------*- Makefile -*-===##
-#
-# The LLVM Compiler Infrastructure
-#
-# This file is distributed under the University of Illinois Open Source
-# License. See LICENSE.TXT for details.
-#
-##===----------------------------------------------------------------------===##
-
-LEVEL = ../../..
-LIBRARYNAME = LLVMScalarOpts
-BUILD_ARCHIVE = 1
-
-include $(LEVEL)/Makefile.common
-
diff --git a/release_23/lib/Transforms/Scalar/MemCpyOptimizer.cpp b/release_23/lib/Transforms/Scalar/MemCpyOptimizer.cpp
deleted file mode 100644
index 8036bf89d5fe..000000000000
--- a/release_23/lib/Transforms/Scalar/MemCpyOptimizer.cpp
+++ /dev/null
@@ -1,728 +0,0 @@
-//===- MemCpyOptimizer.cpp - Optimize use of memcpy and friends -----------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This pass performs various transformations related to eliminating memcpy
-// calls, or transforming sets of stores into memset's.
-//
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "memcpyopt"
-#include "llvm/Transforms/Scalar.h"
-#include "llvm/IntrinsicInst.h"
-#include "llvm/Instructions.h"
-#include "llvm/ParameterAttributes.h"
-#include "llvm/ADT/SmallVector.h"
-#include "llvm/ADT/Statistic.h"
-#include "llvm/Analysis/Dominators.h"
-#include "llvm/Analysis/AliasAnalysis.h"
-#include "llvm/Analysis/MemoryDependenceAnalysis.h"
-#include "llvm/Support/Debug.h"
-#include "llvm/Support/GetElementPtrTypeIterator.h"
-#include "llvm/Target/TargetData.h"
-#include <list>
-using namespace llvm;
-
-STATISTIC(NumMemCpyInstr, "Number of memcpy instructions deleted");
-STATISTIC(NumMemSetInfer, "Number of memsets inferred");
-
-/// isBytewiseValue - If the specified value can be set by repeating the same
-/// byte in memory, return the i8 value that it is represented with. This is
-/// true for all i8 values obviously, but is also true for i32 0, i32 -1,
-/// i16 0xF0F0, double 0.0 etc. If the value can't be handled with a repeated
-/// byte store (e.g. i16 0x1234), return null.
-static Value *isBytewiseValue(Value *V) {
- // All byte-wide stores are splatable, even of arbitrary variables.
- if (V->getType() == Type::Int8Ty) return V;
-
- // Constant float and double values can be handled as integer values if the
- // corresponding integer value is "byteable". An important case is 0.0.
- if (ConstantFP *CFP = dyn_cast<ConstantFP>(V)) {
- if (CFP->getType() == Type::FloatTy)
- V = ConstantExpr::getBitCast(CFP, Type::Int32Ty);
- if (CFP->getType() == Type::DoubleTy)
- V = ConstantExpr::getBitCast(CFP, Type::Int64Ty);
- // Don't handle long double formats, which have strange constraints.
- }
-
- // We can handle constant integers that are power of two in size and a
- // multiple of 8 bits.
- if (ConstantInt *CI = dyn_cast<ConstantInt>(V)) {
- unsigned Width = CI->getBitWidth();
- if (isPowerOf2_32(Width) && Width > 8) {
- // We can handle this value if the recursive binary decomposition is the
- // same at all levels.
- APInt Val = CI->getValue();
- APInt Val2;
- while (Val.getBitWidth() != 8) {
- unsigned NextWidth = Val.getBitWidth()/2;
- Val2 = Val.lshr(NextWidth);
- Val2.trunc(Val.getBitWidth()/2);
- Val.trunc(Val.getBitWidth()/2);
-
- // If the top/bottom halves aren't the same, reject it.
- if (Val != Val2)
- return 0;
- }
- return ConstantInt::get(Val);
- }
- }
-
- // Conceptually, we could handle things like:
- // %a = zext i8 %X to i16
- // %b = shl i16 %a, 8
- // %c = or i16 %a, %b
- // but until there is an example that actually needs this, it doesn't seem
- // worth worrying about.
- return 0;
-}
-
-static int64_t GetOffsetFromIndex(const GetElementPtrInst *GEP, unsigned Idx,
- bool &VariableIdxFound, TargetData &TD) {
- // Skip over the first indices.
- gep_type_iterator GTI = gep_type_begin(GEP);
- for (unsigned i = 1; i != Idx; ++i, ++GTI)
- /*skip along*/;
-
- // Compute the offset implied by the rest of the indices.
- int64_t Offset = 0;
- for (unsigned i = Idx, e = GEP->getNumOperands(); i != e; ++i, ++GTI) {
- ConstantInt *OpC = dyn_cast<ConstantInt>(GEP->getOperand(i));
- if (OpC == 0)
- return VariableIdxFound = true;
- if (OpC->isZero()) continue; // No offset.
-
- // Handle struct indices, which add their field offset to the pointer.
- if (const StructType *STy = dyn_cast<StructType>(*GTI)) {
- Offset += TD.getStructLayout(STy)->getElementOffset(OpC->getZExtValue());
- continue;
- }
-
- // Otherwise, we have a sequential type like an array or vector. Multiply
- // the index by the ElementSize.
- uint64_t Size = TD.getABITypeSize(GTI.getIndexedType());
- Offset += Size*OpC->getSExtValue();
- }
-
- return Offset;
-}
-
-/// IsPointerOffset - Return true if Ptr1 is provably equal to Ptr2 plus a
-/// constant offset, and return that constant offset. For example, Ptr1 might
-/// be &A[42], and Ptr2 might be &A[40]. In this case offset would be -8.
-static bool IsPointerOffset(Value *Ptr1, Value *Ptr2, int64_t &Offset,
- TargetData &TD) {
- // Right now we handle the case when Ptr1/Ptr2 are both GEPs with an identical
- // base. After that base, they may have some number of common (and
- // potentially variable) indices. After that they handle some constant
- // offset, which determines their offset from each other. At this point, we
- // handle no other case.
- GetElementPtrInst *GEP1 = dyn_cast<GetElementPtrInst>(Ptr1);
- GetElementPtrInst *GEP2 = dyn_cast<GetElementPtrInst>(Ptr2);
- if (!GEP1 || !GEP2 || GEP1->getOperand(0) != GEP2->getOperand(0))
- return false;
-
- // Skip any common indices and track the GEP types.
- unsigned Idx = 1;
- for (; Idx != GEP1->getNumOperands() && Idx != GEP2->getNumOperands(); ++Idx)
- if (GEP1->getOperand(Idx) != GEP2->getOperand(Idx))
- break;
-
- bool VariableIdxFound = false;
- int64_t Offset1 = GetOffsetFromIndex(GEP1, Idx, VariableIdxFound, TD);
- int64_t Offset2 = GetOffsetFromIndex(GEP2, Idx, VariableIdxFound, TD);
- if (VariableIdxFound) return false;
-
- Offset = Offset2-Offset1;
- return true;
-}
-
-
-/// MemsetRange - Represents a range of memset'd bytes with the ByteVal value.
-/// This allows us to analyze stores like:
-/// store 0 -> P+1
-/// store 0 -> P+0
-/// store 0 -> P+3
-/// store 0 -> P+2
-/// which sometimes happens with stores to arrays of structs etc. When we see
-/// the first store, we make a range [1, 2). The second store extends the range
-/// to [0, 2). The third makes a new range [2, 3). The fourth store joins the
-/// two ranges into [0, 3) which is memset'able.
-namespace {
-struct MemsetRange {
- // Start/End - A semi range that describes the span that this range covers.
- // The range is closed at the start and open at the end: [Start, End).
- int64_t Start, End;
-
- /// StartPtr - The getelementptr instruction that points to the start of the
- /// range.
- Value *StartPtr;
-
- /// Alignment - The known alignment of the first store.
- unsigned Alignment;
-
- /// TheStores - The actual stores that make up this range.
- SmallVector<StoreInst*, 16> TheStores;
-
- bool isProfitableToUseMemset(const TargetData &TD) const;
-
-};
-} // end anon namespace
-
-bool MemsetRange::isProfitableToUseMemset(const TargetData &TD) const {
- // If we found more than 8 stores to merge or 64 bytes, use memset.
- if (TheStores.size() >= 8 || End-Start >= 64) return true;
-
- // Assume that the code generator is capable of merging pairs of stores
- // together if it wants to.
- if (TheStores.size() <= 2) return false;
-
- // If we have fewer than 8 stores, it can still be worthwhile to do this.
- // For example, merging 4 i8 stores into an i32 store is useful almost always.
- // However, merging 2 32-bit stores isn't useful on a 32-bit architecture (the
- // memset will be split into 2 32-bit stores anyway) and doing so can
- // pessimize the llvm optimizer.
- //
- // Since we don't have perfect knowledge here, make some assumptions: assume
- // the maximum GPR width is the same size as the pointer size and assume that
- // this width can be stored. If so, check to see whether we will end up
- // actually reducing the number of stores used.
- unsigned Bytes = unsigned(End-Start);
- unsigned NumPointerStores = Bytes/TD.getPointerSize();
-
- // Assume the remaining bytes if any are done a byte at a time.
- unsigned NumByteStores = Bytes - NumPointerStores*TD.getPointerSize();
-
- // If we will reduce the # stores (according to this heuristic), do the
- // transformation. This encourages merging 4 x i8 -> i32 and 2 x i16 -> i32
- // etc.
- return TheStores.size() > NumPointerStores+NumByteStores;
-}
-
-
-namespace {
-class MemsetRanges {
- /// Ranges - A sorted list of the memset ranges. We use std::list here
- /// because each element is relatively large and expensive to copy.
- std::list<MemsetRange> Ranges;
- typedef std::list<MemsetRange>::iterator range_iterator;
- TargetData &TD;
-public:
- MemsetRanges(TargetData &td) : TD(td) {}
-
- typedef std::list<MemsetRange>::const_iterator const_iterator;
- const_iterator begin() const { return Ranges.begin(); }
- const_iterator end() const { return Ranges.end(); }
- bool empty() const { return Ranges.empty(); }
-
- void addStore(int64_t OffsetFromFirst, StoreInst *SI);
-};
-
-} // end anon namespace
-
-
-/// addStore - Add a new store to the MemsetRanges data structure. This adds a
-/// new range for the specified store at the specified offset, merging into
-/// existing ranges as appropriate.
-void MemsetRanges::addStore(int64_t Start, StoreInst *SI) {
- int64_t End = Start+TD.getTypeStoreSize(SI->getOperand(0)->getType());
-
- // Do a linear search of the ranges to see if this can be joined and/or to
- // find the insertion point in the list. We keep the ranges sorted for
- // simplicity here. This is a linear search of a linked list, which is ugly,
- // however the number of ranges is limited, so this won't get crazy slow.
- range_iterator I = Ranges.begin(), E = Ranges.end();
-
- while (I != E && Start > I->End)
- ++I;
-
- // We now know that I == E, in which case we didn't find anything to merge
- // with, or that Start <= I->End. If End < I->Start or I == E, then we need
- // to insert a new range. Handle this now.
- if (I == E || End < I->Start) {
- MemsetRange &R = *Ranges.insert(I, MemsetRange());
- R.Start = Start;
- R.End = End;
- R.StartPtr = SI->getPointerOperand();
- R.Alignment = SI->getAlignment();
- R.TheStores.push_back(SI);
- return;
- }
-
- // This store overlaps with I, add it.
- I->TheStores.push_back(SI);
-
- // At this point, we may have an interval that completely contains our store.
- // If so, just add it to the interval and return.
- if (I->Start <= Start && I->End >= End)
- return;
-
- // Now we know that Start <= I->End and End >= I->Start so the range overlaps
- // but is not entirely contained within the range.
-
- // See if the range extends the start of the range. In this case, it couldn't
- // possibly cause it to join the prior range, because otherwise we would have
- // stopped on *it*.
- if (Start < I->Start) {
- I->Start = Start;
- I->StartPtr = SI->getPointerOperand();
- }
-
- // Now we know that Start <= I->End and Start >= I->Start (so the startpoint
- // is in or right at the end of I), and that End >= I->Start. Extend I out to
- // End.
- if (End > I->End) {
- I->End = End;
- range_iterator NextI = I;;
- while (++NextI != E && End >= NextI->Start) {
- // Merge the range in.
- I->TheStores.append(NextI->TheStores.begin(), NextI->TheStores.end());
- if (NextI->End > I->End)
- I->End = NextI->End;
- Ranges.erase(NextI);
- NextI = I;
- }
- }
-}
-
-//===----------------------------------------------------------------------===//
-// MemCpyOpt Pass
-//===----------------------------------------------------------------------===//
-
-namespace {
-
- class VISIBILITY_HIDDEN MemCpyOpt : public FunctionPass {
- bool runOnFunction(Function &F);
- public:
- static char ID; // Pass identification, replacement for typeid
- MemCpyOpt() : FunctionPass((intptr_t)&ID) { }
-
- private:
- // This transformation requires dominator postdominator info
- virtual void getAnalysisUsage(AnalysisUsage &AU) const {
- AU.setPreservesCFG();
- AU.addRequired<DominatorTree>();
- AU.addRequired<MemoryDependenceAnalysis>();
- AU.addRequired<AliasAnalysis>();
- AU.addRequired<TargetData>();
- AU.addPreserved<AliasAnalysis>();
- AU.addPreserved<MemoryDependenceAnalysis>();
- AU.addPreserved<TargetData>();
- }
-
- // Helper fuctions
- bool processStore(StoreInst *SI, BasicBlock::iterator& BBI);
- bool processMemCpy(MemCpyInst* M);
- bool performCallSlotOptzn(MemCpyInst* cpy, CallInst* C);
- bool iterateOnFunction(Function &F);
- };
-
- char MemCpyOpt::ID = 0;
-}
-
-// createMemCpyOptPass - The public interface to this file...
-FunctionPass *llvm::createMemCpyOptPass() { return new MemCpyOpt(); }
-
-static RegisterPass<MemCpyOpt> X("memcpyopt",
- "MemCpy Optimization");
-
-
-
-/// processStore - When GVN is scanning forward over instructions, we look for
-/// some other patterns to fold away. In particular, this looks for stores to
-/// neighboring locations of memory. If it sees enough consequtive ones
-/// (currently 4) it attempts to merge them together into a memcpy/memset.
-bool MemCpyOpt::processStore(StoreInst *SI, BasicBlock::iterator& BBI) {
- if (SI->isVolatile()) return false;
-
- // There are two cases that are interesting for this code to handle: memcpy
- // and memset. Right now we only handle memset.
-
- // Ensure that the value being stored is something that can be memset'able a
- // byte at a time like "0" or "-1" or any width, as well as things like
- // 0xA0A0A0A0 and 0.0.
- Value *ByteVal = isBytewiseValue(SI->getOperand(0));
- if (!ByteVal)
- return false;
-
- TargetData &TD = getAnalysis<TargetData>();
- AliasAnalysis &AA = getAnalysis<AliasAnalysis>();
-
- // Okay, so we now have a single store that can be splatable. Scan to find
- // all subsequent stores of the same value to offset from the same pointer.
- // Join these together into ranges, so we can decide whether contiguous blocks
- // are stored.
- MemsetRanges Ranges(TD);
-
- Value *StartPtr = SI->getPointerOperand();
-
- BasicBlock::iterator BI = SI;
- for (++BI; !isa<TerminatorInst>(BI); ++BI) {
- if (isa<CallInst>(BI) || isa<InvokeInst>(BI)) {
- // If the call is readnone, ignore it, otherwise bail out. We don't even
- // allow readonly here because we don't want something like:
- // A[1] = 2; strlen(A); A[2] = 2; -> memcpy(A, ...); strlen(A).
- if (AA.getModRefBehavior(CallSite::get(BI)) ==
- AliasAnalysis::DoesNotAccessMemory)
- continue;
-
- // TODO: If this is a memset, try to join it in.
-
- break;
- } else if (isa<VAArgInst>(BI) || isa<LoadInst>(BI))
- break;
-
- // If this is a non-store instruction it is fine, ignore it.
- StoreInst *NextStore = dyn_cast<StoreInst>(BI);
- if (NextStore == 0) continue;
-
- // If this is a store, see if we can merge it in.
- if (NextStore->isVolatile()) break;
-
- // Check to see if this stored value is of the same byte-splattable value.
- if (ByteVal != isBytewiseValue(NextStore->getOperand(0)))
- break;
-
- // Check to see if this store is to a constant offset from the start ptr.
- int64_t Offset;
- if (!IsPointerOffset(StartPtr, NextStore->getPointerOperand(), Offset, TD))
- break;
-
- Ranges.addStore(Offset, NextStore);
- }
-
- // If we have no ranges, then we just had a single store with nothing that
- // could be merged in. This is a very common case of course.
- if (Ranges.empty())
- return false;
-
- // If we had at least one store that could be merged in, add the starting
- // store as well. We try to avoid this unless there is at least something
- // interesting as a small compile-time optimization.
- Ranges.addStore(0, SI);
-
-
- Function *MemSetF = 0;
-
- // Now that we have full information about ranges, loop over the ranges and
- // emit memset's for anything big enough to be worthwhile.
- bool MadeChange = false;
- for (MemsetRanges::const_iterator I = Ranges.begin(), E = Ranges.end();
- I != E; ++I) {
- const MemsetRange &Range = *I;
-
- if (Range.TheStores.size() == 1) continue;
-
- // If it is profitable to lower this range to memset, do so now.
- if (!Range.isProfitableToUseMemset(TD))
- continue;
-
- // Otherwise, we do want to transform this! Create a new memset. We put
- // the memset right before the first instruction that isn't part of this
- // memset block. This ensure that the memset is dominated by any addressing
- // instruction needed by the start of the block.
- BasicBlock::iterator InsertPt = BI;
-
- if (MemSetF == 0)
- MemSetF = Intrinsic::getDeclaration(SI->getParent()->getParent()
- ->getParent(), Intrinsic::memset_i64);
-
- // Get the starting pointer of the block.
- StartPtr = Range.StartPtr;
-
- // Cast the start ptr to be i8* as memset requires.
- const Type *i8Ptr = PointerType::getUnqual(Type::Int8Ty);
- if (StartPtr->getType() != i8Ptr)
- StartPtr = new BitCastInst(StartPtr, i8Ptr, StartPtr->getNameStart(),
- InsertPt);
-
- Value *Ops[] = {
- StartPtr, ByteVal, // Start, value
- ConstantInt::get(Type::Int64Ty, Range.End-Range.Start), // size
- ConstantInt::get(Type::Int32Ty, Range.Alignment) // align
- };
- Value *C = CallInst::Create(MemSetF, Ops, Ops+4, "", InsertPt);
- DEBUG(cerr << "Replace stores:\n";
- for (unsigned i = 0, e = Range.TheStores.size(); i != e; ++i)
- cerr << *Range.TheStores[i];
- cerr << "With: " << *C); C=C;
-
- // Don't invalidate the iterator
- BBI = BI;
-
- // Zap all the stores.
- for (SmallVector<StoreInst*, 16>::const_iterator SI = Range.TheStores.begin(),
- SE = Range.TheStores.end(); SI != SE; ++SI)
- (*SI)->eraseFromParent();
- ++NumMemSetInfer;
- MadeChange = true;
- }
-
- return MadeChange;
-}
-
-
-/// performCallSlotOptzn - takes a memcpy and a call that it depends on,
-/// and checks for the possibility of a call slot optimization by having
-/// the call write its result directly into the destination of the memcpy.
-bool MemCpyOpt::performCallSlotOptzn(MemCpyInst *cpy, CallInst *C) {
- // The general transformation to keep in mind is
- //
- // call @func(..., src, ...)
- // memcpy(dest, src, ...)
- //
- // ->
- //
- // memcpy(dest, src, ...)
- // call @func(..., dest, ...)
- //
- // Since moving the memcpy is technically awkward, we additionally check that
- // src only holds uninitialized values at the moment of the call, meaning that
- // the memcpy can be discarded rather than moved.
-
- // Deliberately get the source and destination with bitcasts stripped away,
- // because we'll need to do type comparisons based on the underlying type.
- Value* cpyDest = cpy->getDest();
- Value* cpySrc = cpy->getSource();
- CallSite CS = CallSite::get(C);
-
- // We need to be able to reason about the size of the memcpy, so we require
- // that it be a constant.
- ConstantInt* cpyLength = dyn_cast<ConstantInt>(cpy->getLength());
- if (!cpyLength)
- return false;
-
- // Require that src be an alloca. This simplifies the reasoning considerably.
- AllocaInst* srcAlloca = dyn_cast<AllocaInst>(cpySrc);
- if (!srcAlloca)
- return false;
-
- // Check that all of src is copied to dest.
- TargetData& TD = getAnalysis<TargetData>();
-
- ConstantInt* srcArraySize = dyn_cast<ConstantInt>(srcAlloca->getArraySize());
- if (!srcArraySize)
- return false;
-
- uint64_t srcSize = TD.getABITypeSize(srcAlloca->getAllocatedType()) *
- srcArraySize->getZExtValue();
-
- if (cpyLength->getZExtValue() < srcSize)
- return false;
-
- // Check that accessing the first srcSize bytes of dest will not cause a
- // trap. Otherwise the transform is invalid since it might cause a trap
- // to occur earlier than it otherwise would.
- if (AllocaInst* A = dyn_cast<AllocaInst>(cpyDest)) {
- // The destination is an alloca. Check it is larger than srcSize.
- ConstantInt* destArraySize = dyn_cast<ConstantInt>(A->getArraySize());
- if (!destArraySize)
- return false;
-
- uint64_t destSize = TD.getABITypeSize(A->getAllocatedType()) *
- destArraySize->getZExtValue();
-
- if (destSize < srcSize)
- return false;
- } else if (Argument* A = dyn_cast<Argument>(cpyDest)) {
- // If the destination is an sret parameter then only accesses that are
- // outside of the returned struct type can trap.
- if (!A->hasStructRetAttr())
- return false;
-
- const Type* StructTy = cast<PointerType>(A->getType())->getElementType();
- uint64_t destSize = TD.getABITypeSize(StructTy);
-
- if (destSize < srcSize)
- return false;
- } else {
- return false;
- }
-
- // Check that src is not accessed except via the call and the memcpy. This
- // guarantees that it holds only undefined values when passed in (so the final
- // memcpy can be dropped), that it is not read or written between the call and
- // the memcpy, and that writing beyond the end of it is undefined.
- SmallVector<User*, 8> srcUseList(srcAlloca->use_begin(),
- srcAlloca->use_end());
- while (!srcUseList.empty()) {
- User* UI = srcUseList.back();
- srcUseList.pop_back();
-
- if (isa<GetElementPtrInst>(UI) || isa<BitCastInst>(UI)) {
- for (User::use_iterator I = UI->use_begin(), E = UI->use_end();
- I != E; ++I)
- srcUseList.push_back(*I);
- } else if (UI != C && UI != cpy) {
- return false;
- }
- }
-
- // Since we're changing the parameter to the callsite, we need to make sure
- // that what would be the new parameter dominates the callsite.
- DominatorTree& DT = getAnalysis<DominatorTree>();
- if (Instruction* cpyDestInst = dyn_cast<Instruction>(cpyDest))
- if (!DT.dominates(cpyDestInst, C))
- return false;
-
- // In addition to knowing that the call does not access src in some
- // unexpected manner, for example via a global, which we deduce from
- // the use analysis, we also need to know that it does not sneakily
- // access dest. We rely on AA to figure this out for us.
- AliasAnalysis& AA = getAnalysis<AliasAnalysis>();
- if (AA.getModRefInfo(C, cpy->getRawDest(), srcSize) !=
- AliasAnalysis::NoModRef)
- return false;
-
- // All the checks have passed, so do the transformation.
- for (unsigned i = 0; i < CS.arg_size(); ++i)
- if (CS.getArgument(i) == cpySrc) {
- if (cpySrc->getType() != cpyDest->getType())
- cpyDest = CastInst::createPointerCast(cpyDest, cpySrc->getType(),
- cpyDest->getName(), C);
- CS.setArgument(i, cpyDest);
- }
-
- // Drop any cached information about the call, because we may have changed
- // its dependence information by changing its parameter.
- MemoryDependenceAnalysis& MD = getAnalysis<MemoryDependenceAnalysis>();
- MD.dropInstruction(C);
-
- // Remove the memcpy
- MD.removeInstruction(cpy);
- cpy->eraseFromParent();
- NumMemCpyInstr++;
-
- return true;
-}
-
-/// processMemCpy - perform simplication of memcpy's. If we have memcpy A which
-/// copies X to Y, and memcpy B which copies Y to Z, then we can rewrite B to be
-/// a memcpy from X to Z (or potentially a memmove, depending on circumstances).
-/// This allows later passes to remove the first memcpy altogether.
-bool MemCpyOpt::processMemCpy(MemCpyInst* M) {
- MemoryDependenceAnalysis& MD = getAnalysis<MemoryDependenceAnalysis>();
-
- // The are two possible optimizations we can do for memcpy:
- // a) memcpy-memcpy xform which exposes redundance for DSE
- // b) call-memcpy xform for return slot optimization
- Instruction* dep = MD.getDependency(M);
- if (dep == MemoryDependenceAnalysis::None ||
- dep == MemoryDependenceAnalysis::NonLocal)
- return false;
- else if (!isa<MemCpyInst>(dep)) {
- if (CallInst* C = dyn_cast<CallInst>(dep))
- return performCallSlotOptzn(M, C);
- else
- return false;
- }
-
- MemCpyInst* MDep = cast<MemCpyInst>(dep);
-
- // We can only transforms memcpy's where the dest of one is the source of the
- // other
- if (M->getSource() != MDep->getDest())
- return false;
-
- // Second, the length of the memcpy's must be the same, or the preceeding one
- // must be larger than the following one.
- ConstantInt* C1 = dyn_cast<ConstantInt>(MDep->getLength());
- ConstantInt* C2 = dyn_cast<ConstantInt>(M->getLength());
- if (!C1 || !C2)
- return false;
-
- uint64_t DepSize = C1->getValue().getZExtValue();
- uint64_t CpySize = C2->getValue().getZExtValue();
-
- if (DepSize < CpySize)
- return false;
-
- // Finally, we have to make sure that the dest of the second does not
- // alias the source of the first
- AliasAnalysis& AA = getAnalysis<AliasAnalysis>();
- if (AA.alias(M->getRawDest(), CpySize, MDep->getRawSource(), DepSize) !=
- AliasAnalysis::NoAlias)
- return false;
- else if (AA.alias(M->getRawDest(), CpySize, M->getRawSource(), CpySize) !=
- AliasAnalysis::NoAlias)
- return false;
- else if (AA.alias(MDep->getRawDest(), DepSize, MDep->getRawSource(), DepSize)
- != AliasAnalysis::NoAlias)
- return false;
-
- // If all checks passed, then we can transform these memcpy's
- Function* MemCpyFun = Intrinsic::getDeclaration(
- M->getParent()->getParent()->getParent(),
- M->getIntrinsicID());
-
- std::vector<Value*> args;
- args.push_back(M->getRawDest());
- args.push_back(MDep->getRawSource());
- args.push_back(M->getLength());
- args.push_back(M->getAlignment());
-
- CallInst* C = CallInst::Create(MemCpyFun, args.begin(), args.end(), "", M);
-
-
- // If C and M don't interfere, then this is a valid transformation. If they
- // did, this would mean that the two sources overlap, which would be bad.
- if (MD.getDependency(C) == MDep) {
- MD.dropInstruction(M);
- M->eraseFromParent();
-
- NumMemCpyInstr++;
-
- return true;
- }
-
- // Otherwise, there was no point in doing this, so we remove the call we
- // inserted and act like nothing happened.
- MD.removeInstruction(C);
- C->eraseFromParent();
-
- return false;
-}
-
-// MemCpyOpt::runOnFunction - This is the main transformation entry point for a
-// function.
-//
-bool MemCpyOpt::runOnFunction(Function& F) {
-
- bool changed = false;
- bool shouldContinue = true;
-
- while (shouldContinue) {
- shouldContinue = iterateOnFunction(F);
- changed |= shouldContinue;
- }
-
- return changed;
-}
-
-
-// MemCpyOpt::iterateOnFunction - Executes one iteration of GVN
-bool MemCpyOpt::iterateOnFunction(Function &F) {
- bool changed_function = false;
-
- // Walk all instruction in the function
- for (Function::iterator BB = F.begin(), BBE = F.end(); BB != BBE; ++BB) {
- for (BasicBlock::iterator BI = BB->begin(), BE = BB->end();
- BI != BE;) {
- // Avoid invalidating the iterator
- Instruction* I = BI++;
-
- if (StoreInst *SI = dyn_cast<StoreInst>(I))
- changed_function |= processStore(SI, BI);
- else if (MemCpyInst* M = dyn_cast<MemCpyInst>(I)) {
- changed_function |= processMemCpy(M);
- }
- }
- }
-
- return changed_function;
-}
diff --git a/release_23/lib/Transforms/Scalar/PredicateSimplifier.cpp b/release_23/lib/Transforms/Scalar/PredicateSimplifier.cpp
deleted file mode 100644
index 1b36d84a7bd3..000000000000
--- a/release_23/lib/Transforms/Scalar/PredicateSimplifier.cpp
+++ /dev/null
@@ -1,2657 +0,0 @@
-//===-- PredicateSimplifier.cpp - Path Sensitive Simplifier ---------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// Path-sensitive optimizer. In a branch where x == y, replace uses of
-// x with y. Permits further optimization, such as the elimination of
-// the unreachable call:
-//
-// void test(int *p, int *q)
-// {
-// if (p != q)
-// return;
-//
-// if (*p != *q)
-// foo(); // unreachable
-// }
-//
-//===----------------------------------------------------------------------===//
-//
-// The InequalityGraph focusses on four properties; equals, not equals,
-// less-than and less-than-or-equals-to. The greater-than forms are also held
-// just to allow walking from a lesser node to a greater one. These properties
-// are stored in a lattice; LE can become LT or EQ, NE can become LT or GT.
-//
-// These relationships define a graph between values of the same type. Each
-// Value is stored in a map table that retrieves the associated Node. This
-// is how EQ relationships are stored; the map contains pointers from equal
-// Value to the same node. The node contains a most canonical Value* form
-// and the list of known relationships with other nodes.
-//
-// If two nodes are known to be inequal, then they will contain pointers to
-// each other with an "NE" relationship. If node getNode(%x) is less than
-// getNode(%y), then the %x node will contain <%y, GT> and %y will contain
-// <%x, LT>. This allows us to tie nodes together into a graph like this:
-//
-// %a < %b < %c < %d
-//
-// with four nodes representing the properties. The InequalityGraph provides
-// querying with "isRelatedBy" and mutators "addEquality" and "addInequality".
-// To find a relationship, we start with one of the nodes any binary search
-// through its list to find where the relationships with the second node start.
-// Then we iterate through those to find the first relationship that dominates
-// our context node.
-//
-// To create these properties, we wait until a branch or switch instruction
-// implies that a particular value is true (or false). The VRPSolver is
-// responsible for analyzing the variable and seeing what new inferences
-// can be made from each property. For example:
-//
-// %P = icmp ne i32* %ptr, null
-// %a = and i1 %P, %Q
-// br i1 %a label %cond_true, label %cond_false
-//
-// For the true branch, the VRPSolver will start with %a EQ true and look at
-// the definition of %a and find that it can infer that %P and %Q are both
-// true. From %P being true, it can infer that %ptr NE null. For the false
-// branch it can't infer anything from the "and" instruction.
-//
-// Besides branches, we can also infer properties from instruction that may
-// have undefined behaviour in certain cases. For example, the dividend of
-// a division may never be zero. After the division instruction, we may assume
-// that the dividend is not equal to zero.
-//
-//===----------------------------------------------------------------------===//
-//
-// The ValueRanges class stores the known integer bounds of a Value. When we
-// encounter i8 %a u< %b, the ValueRanges stores that %a = [1, 255] and
-// %b = [0, 254].
-//
-// It never stores an empty range, because that means that the code is
-// unreachable. It never stores a single-element range since that's an equality
-// relationship and better stored in the InequalityGraph, nor an empty range
-// since that is better stored in UnreachableBlocks.
-//
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "predsimplify"
-#include "llvm/Transforms/Scalar.h"
-#include "llvm/Constants.h"
-#include "llvm/DerivedTypes.h"
-#include "llvm/Instructions.h"
-#include "llvm/Pass.h"
-#include "llvm/ADT/DepthFirstIterator.h"
-#include "llvm/ADT/SetOperations.h"
-#include "llvm/ADT/SetVector.h"
-#include "llvm/ADT/Statistic.h"
-#include "llvm/ADT/STLExtras.h"
-#include "llvm/Analysis/Dominators.h"
-#include "llvm/Assembly/Writer.h"
-#include "llvm/Support/CFG.h"
-#include "llvm/Support/Compiler.h"
-#include "llvm/Support/ConstantRange.h"
-#include "llvm/Support/Debug.h"
-#include "llvm/Support/InstVisitor.h"
-#include "llvm/Target/TargetData.h"
-#include "llvm/Transforms/Utils/Local.h"
-#include <algorithm>
-#include <deque>
-#include <stack>
-using namespace llvm;
-
-STATISTIC(NumVarsReplaced, "Number of argument substitutions");
-STATISTIC(NumInstruction , "Number of instructions removed");
-STATISTIC(NumSimple , "Number of simple replacements");
-STATISTIC(NumBlocks , "Number of blocks marked unreachable");
-STATISTIC(NumSnuggle , "Number of comparisons snuggled");
-
-namespace {
- class DomTreeDFS {
- public:
- class Node {
- friend class DomTreeDFS;
- public:
- typedef std::vector<Node *>::iterator iterator;
- typedef std::vector<Node *>::const_iterator const_iterator;
-
- unsigned getDFSNumIn() const { return DFSin; }
- unsigned getDFSNumOut() const { return DFSout; }
-
- BasicBlock *getBlock() const { return BB; }
-
- iterator begin() { return Children.begin(); }
- iterator end() { return Children.end(); }
-
- const_iterator begin() const { return Children.begin(); }
- const_iterator end() const { return Children.end(); }
-
- bool dominates(const Node *N) const {
- return DFSin <= N->DFSin && DFSout >= N->DFSout;
- }
-
- bool DominatedBy(const Node *N) const {
- return N->dominates(this);
- }
-
- /// Sorts by the number of descendants. With this, you can iterate
- /// through a sorted list and the first matching entry is the most
- /// specific match for your basic block. The order provided is stable;
- /// DomTreeDFS::Nodes with the same number of descendants are sorted by
- /// DFS in number.
- bool operator<(const Node &N) const {
- unsigned spread = DFSout - DFSin;
- unsigned N_spread = N.DFSout - N.DFSin;
- if (spread == N_spread) return DFSin < N.DFSin;
- return spread < N_spread;
- }
- bool operator>(const Node &N) const { return N < *this; }
-
- private:
- unsigned DFSin, DFSout;
- BasicBlock *BB;
-
- std::vector<Node *> Children;
- };
-
- // XXX: this may be slow. Instead of using "new" for each node, consider
- // putting them in a vector to keep them contiguous.
- explicit DomTreeDFS(DominatorTree *DT) {
- std::stack<std::pair<Node *, DomTreeNode *> > S;
-
- Entry = new Node;
- Entry->BB = DT->getRootNode()->getBlock();
- S.push(std::make_pair(Entry, DT->getRootNode()));
-
- NodeMap[Entry->BB] = Entry;
-
- while (!S.empty()) {
- std::pair<Node *, DomTreeNode *> &Pair = S.top();
- Node *N = Pair.first;
- DomTreeNode *DTNode = Pair.second;
- S.pop();
-
- for (DomTreeNode::iterator I = DTNode->begin(), E = DTNode->end();
- I != E; ++I) {
- Node *NewNode = new Node;
- NewNode->BB = (*I)->getBlock();
- N->Children.push_back(NewNode);
- S.push(std::make_pair(NewNode, *I));
-
- NodeMap[NewNode->BB] = NewNode;
- }
- }
-
- renumber();
-
-#ifndef NDEBUG
- DEBUG(dump());
-#endif
- }
-
-#ifndef NDEBUG
- virtual
-#endif
- ~DomTreeDFS() {
- std::stack<Node *> S;
-
- S.push(Entry);
- while (!S.empty()) {
- Node *N = S.top(); S.pop();
-
- for (Node::iterator I = N->begin(), E = N->end(); I != E; ++I)
- S.push(*I);
-
- delete N;
- }
- }
-
- /// getRootNode - This returns the entry node for the CFG of the function.
- Node *getRootNode() const { return Entry; }
-
- /// getNodeForBlock - return the node for the specified basic block.
- Node *getNodeForBlock(BasicBlock *BB) const {
- if (!NodeMap.count(BB)) return 0;
- return const_cast<DomTreeDFS*>(this)->NodeMap[BB];
- }
-
- /// dominates - returns true if the basic block for I1 dominates that of
- /// the basic block for I2. If the instructions belong to the same basic
- /// block, the instruction first instruction sequentially in the block is
- /// considered dominating.
- bool dominates(Instruction *I1, Instruction *I2) {
- BasicBlock *BB1 = I1->getParent(),
- *BB2 = I2->getParent();
- if (BB1 == BB2) {
- if (isa<TerminatorInst>(I1)) return false;
- if (isa<TerminatorInst>(I2)) return true;
- if ( isa<PHINode>(I1) && !isa<PHINode>(I2)) return true;
- if (!isa<PHINode>(I1) && isa<PHINode>(I2)) return false;
-
- for (BasicBlock::const_iterator I = BB2->begin(), E = BB2->end();
- I != E; ++I) {
- if (&*I == I1) return true;
- else if (&*I == I2) return false;
- }
- assert(!"Instructions not found in parent BasicBlock?");
- } else {
- Node *Node1 = getNodeForBlock(BB1),
- *Node2 = getNodeForBlock(BB2);
- return Node1 && Node2 && Node1->dominates(Node2);
- }
- return false; // Not reached
- }
-
- private:
- /// renumber - calculates the depth first search numberings and applies
- /// them onto the nodes.
- void renumber() {
- std::stack<std::pair<Node *, Node::iterator> > S;
- unsigned n = 0;
-
- Entry->DFSin = ++n;
- S.push(std::make_pair(Entry, Entry->begin()));
-
- while (!S.empty()) {
- std::pair<Node *, Node::iterator> &Pair = S.top();
- Node *N = Pair.first;
- Node::iterator &I = Pair.second;
-
- if (I == N->end()) {
- N->DFSout = ++n;
- S.pop();
- } else {
- Node *Next = *I++;
- Next->DFSin = ++n;
- S.push(std::make_pair(Next, Next->begin()));
- }
- }
- }
-
-#ifndef NDEBUG
- virtual void dump() const {
- dump(*cerr.stream());
- }
-
- void dump(std::ostream &os) const {
- os << "Predicate simplifier DomTreeDFS: \n";
- dump(Entry, 0, os);
- os << "\n\n";
- }
-
- void dump(Node *N, int depth, std::ostream &os) const {
- ++depth;
- for (int i = 0; i < depth; ++i) { os << " "; }
- os << "[" << depth << "] ";
-
- os << N->getBlock()->getName() << " (" << N->getDFSNumIn()
- << ", " << N->getDFSNumOut() << ")\n";
-
- for (Node::iterator I = N->begin(), E = N->end(); I != E; ++I)
- dump(*I, depth, os);
- }
-#endif
-
- Node *Entry;
- std::map<BasicBlock *, Node *> NodeMap;
- };
-
- // SLT SGT ULT UGT EQ
- // 0 1 0 1 0 -- GT 10
- // 0 1 0 1 1 -- GE 11
- // 0 1 1 0 0 -- SGTULT 12
- // 0 1 1 0 1 -- SGEULE 13
- // 0 1 1 1 0 -- SGT 14
- // 0 1 1 1 1 -- SGE 15
- // 1 0 0 1 0 -- SLTUGT 18
- // 1 0 0 1 1 -- SLEUGE 19
- // 1 0 1 0 0 -- LT 20
- // 1 0 1 0 1 -- LE 21
- // 1 0 1 1 0 -- SLT 22
- // 1 0 1 1 1 -- SLE 23
- // 1 1 0 1 0 -- UGT 26
- // 1 1 0 1 1 -- UGE 27
- // 1 1 1 0 0 -- ULT 28
- // 1 1 1 0 1 -- ULE 29
- // 1 1 1 1 0 -- NE 30
- enum LatticeBits {
- EQ_BIT = 1, UGT_BIT = 2, ULT_BIT = 4, SGT_BIT = 8, SLT_BIT = 16
- };
- enum LatticeVal {
- GT = SGT_BIT | UGT_BIT,
- GE = GT | EQ_BIT,
- LT = SLT_BIT | ULT_BIT,
- LE = LT | EQ_BIT,
- NE = SLT_BIT | SGT_BIT | ULT_BIT | UGT_BIT,
- SGTULT = SGT_BIT | ULT_BIT,
- SGEULE = SGTULT | EQ_BIT,
- SLTUGT = SLT_BIT | UGT_BIT,
- SLEUGE = SLTUGT | EQ_BIT,
- ULT = SLT_BIT | SGT_BIT | ULT_BIT,
- UGT = SLT_BIT | SGT_BIT | UGT_BIT,
- SLT = SLT_BIT | ULT_BIT | UGT_BIT,
- SGT = SGT_BIT | ULT_BIT | UGT_BIT,
- SLE = SLT | EQ_BIT,
- SGE = SGT | EQ_BIT,
- ULE = ULT | EQ_BIT,
- UGE = UGT | EQ_BIT
- };
-
- /// validPredicate - determines whether a given value is actually a lattice
- /// value. Only used in assertions or debugging.
- static bool validPredicate(LatticeVal LV) {
- switch (LV) {
- case GT: case GE: case LT: case LE: case NE:
- case SGTULT: case SGT: case SGEULE:
- case SLTUGT: case SLT: case SLEUGE:
- case ULT: case UGT:
- case SLE: case SGE: case ULE: case UGE:
- return true;
- default:
- return false;
- }
- }
-
- /// reversePredicate - reverse the direction of the inequality
- static LatticeVal reversePredicate(LatticeVal LV) {
- unsigned reverse = LV ^ (SLT_BIT|SGT_BIT|ULT_BIT|UGT_BIT); //preserve EQ_BIT
-
- if ((reverse & (SLT_BIT|SGT_BIT)) == 0)
- reverse |= (SLT_BIT|SGT_BIT);
-
- if ((reverse & (ULT_BIT|UGT_BIT)) == 0)
- reverse |= (ULT_BIT|UGT_BIT);
-
- LatticeVal Rev = static_cast<LatticeVal>(reverse);
- assert(validPredicate(Rev) && "Failed reversing predicate.");
- return Rev;
- }
-
- /// ValueNumbering stores the scope-specific value numbers for a given Value.
- class VISIBILITY_HIDDEN ValueNumbering {
-
- /// VNPair is a tuple of {Value, index number, DomTreeDFS::Node}. It
- /// includes the comparison operators necessary to allow you to store it
- /// in a sorted vector.
- class VISIBILITY_HIDDEN VNPair {
- public:
- Value *V;
- unsigned index;
- DomTreeDFS::Node *Subtree;
-
- VNPair(Value *V, unsigned index, DomTreeDFS::Node *Subtree)
- : V(V), index(index), Subtree(Subtree) {}
-
- bool operator==(const VNPair &RHS) const {
- return V == RHS.V && Subtree == RHS.Subtree;
- }
-
- bool operator<(const VNPair &RHS) const {
- if (V != RHS.V) return V < RHS.V;
- return *Subtree < *RHS.Subtree;
- }
-
- bool operator<(Value *RHS) const {
- return V < RHS;
- }
-
- bool operator>(Value *RHS) const {
- return V > RHS;
- }
-
- friend bool operator<(Value *RHS, const VNPair &pair) {
- return pair.operator>(RHS);
- }
- };
-
- typedef std::vector<VNPair> VNMapType;
- VNMapType VNMap;
-
- /// The canonical choice for value number at index.
- std::vector<Value *> Values;
-
- DomTreeDFS *DTDFS;
-
- public:
-#ifndef NDEBUG
- virtual ~ValueNumbering() {}
- virtual void dump() {
- dump(*cerr.stream());
- }
-
- void dump(std::ostream &os) {
- for (unsigned i = 1; i <= Values.size(); ++i) {
- os << i << " = ";
- WriteAsOperand(os, Values[i-1]);
- os << " {";
- for (unsigned j = 0; j < VNMap.size(); ++j) {
- if (VNMap[j].index == i) {
- WriteAsOperand(os, VNMap[j].V);
- os << " (" << VNMap[j].Subtree->getDFSNumIn() << ") ";
- }
- }
- os << "}\n";
- }
- }
-#endif
-
- /// compare - returns true if V1 is a better canonical value than V2.
- bool compare(Value *V1, Value *V2) const {
- if (isa<Constant>(V1))
- return !isa<Constant>(V2);
- else if (isa<Constant>(V2))
- return false;
- else if (isa<Argument>(V1))
- return !isa<Argument>(V2);
- else if (isa<Argument>(V2))
- return false;
-
- Instruction *I1 = dyn_cast<Instruction>(V1);
- Instruction *I2 = dyn_cast<Instruction>(V2);
-
- if (!I1 || !I2)
- return V1->getNumUses() < V2->getNumUses();
-
- return DTDFS->dominates(I1, I2);
- }
-
- ValueNumbering(DomTreeDFS *DTDFS) : DTDFS(DTDFS) {}
-
- /// valueNumber - finds the value number for V under the Subtree. If
- /// there is no value number, returns zero.
- unsigned valueNumber(Value *V, DomTreeDFS::Node *Subtree) {
- if (!(isa<Constant>(V) || isa<Argument>(V) || isa<Instruction>(V))
- || V->getType() == Type::VoidTy) return 0;
-
- VNMapType::iterator E = VNMap.end();
- VNPair pair(V, 0, Subtree);
- VNMapType::iterator I = std::lower_bound(VNMap.begin(), E, pair);
- while (I != E && I->V == V) {
- if (I->Subtree->dominates(Subtree))
- return I->index;
- ++I;
- }
- return 0;
- }
-
- /// getOrInsertVN - always returns a value number, creating it if necessary.
- unsigned getOrInsertVN(Value *V, DomTreeDFS::Node *Subtree) {
- if (unsigned n = valueNumber(V, Subtree))
- return n;
- else
- return newVN(V);
- }
-
- /// newVN - creates a new value number. Value V must not already have a
- /// value number assigned.
- unsigned newVN(Value *V) {
- assert((isa<Constant>(V) || isa<Argument>(V) || isa<Instruction>(V)) &&
- "Bad Value for value numbering.");
- assert(V->getType() != Type::VoidTy && "Won't value number a void value");
-
- Values.push_back(V);
-
- VNPair pair = VNPair(V, Values.size(), DTDFS->getRootNode());
- VNMapType::iterator I = std::lower_bound(VNMap.begin(), VNMap.end(), pair);
- assert((I == VNMap.end() || value(I->index) != V) &&
- "Attempt to create a duplicate value number.");
- VNMap.insert(I, pair);
-
- return Values.size();
- }
-
- /// value - returns the Value associated with a value number.
- Value *value(unsigned index) const {
- assert(index != 0 && "Zero index is reserved for not found.");
- assert(index <= Values.size() && "Index out of range.");
- return Values[index-1];
- }
-
- /// canonicalize - return a Value that is equal to V under Subtree.
- Value *canonicalize(Value *V, DomTreeDFS::Node *Subtree) {
- if (isa<Constant>(V)) return V;
-
- if (unsigned n = valueNumber(V, Subtree))
- return value(n);
- else
- return V;
- }
-
- /// addEquality - adds that value V belongs to the set of equivalent
- /// values defined by value number n under Subtree.
- void addEquality(unsigned n, Value *V, DomTreeDFS::Node *Subtree) {
- assert(canonicalize(value(n), Subtree) == value(n) &&
- "Node's 'canonical' choice isn't best within this subtree.");
-
- // Suppose that we are given "%x -> node #1 (%y)". The problem is that
- // we may already have "%z -> node #2 (%x)" somewhere above us in the
- // graph. We need to find those edges and add "%z -> node #1 (%y)"
- // to keep the lookups canonical.
-
- std::vector<Value *> ToRepoint(1, V);
-
- if (unsigned Conflict = valueNumber(V, Subtree)) {
- for (VNMapType::iterator I = VNMap.begin(), E = VNMap.end();
- I != E; ++I) {
- if (I->index == Conflict && I->Subtree->dominates(Subtree))
- ToRepoint.push_back(I->V);
- }
- }
-
- for (std::vector<Value *>::iterator VI = ToRepoint.begin(),
- VE = ToRepoint.end(); VI != VE; ++VI) {
- Value *V = *VI;
-
- VNPair pair(V, n, Subtree);
- VNMapType::iterator B = VNMap.begin(), E = VNMap.end();
- VNMapType::iterator I = std::lower_bound(B, E, pair);
- if (I != E && I->V == V && I->Subtree == Subtree)
- I->index = n; // Update best choice
- else
- VNMap.insert(I, pair); // New Value
-
- // XXX: we currently don't have to worry about updating values with
- // more specific Subtrees, but we will need to for PHI node support.
-
-#ifndef NDEBUG
- Value *V_n = value(n);
- if (isa<Constant>(V) && isa<Constant>(V_n)) {
- assert(V == V_n && "Constant equals different constant?");
- }
-#endif
- }
- }
-
- /// remove - removes all references to value V.
- void remove(Value *V) {
- VNMapType::iterator B = VNMap.begin(), E = VNMap.end();
- VNPair pair(V, 0, DTDFS->getRootNode());
- VNMapType::iterator J = std::upper_bound(B, E, pair);
- VNMapType::iterator I = J;
-
- while (I != B && (I == E || I->V == V)) --I;
-
- VNMap.erase(I, J);
- }
- };
-
- /// The InequalityGraph stores the relationships between values.
- /// Each Value in the graph is assigned to a Node. Nodes are pointer
- /// comparable for equality. The caller is expected to maintain the logical
- /// consistency of the system.
- ///
- /// The InequalityGraph class may invalidate Node*s after any mutator call.
- /// @brief The InequalityGraph stores the relationships between values.
- class VISIBILITY_HIDDEN InequalityGraph {
- ValueNumbering &VN;
- DomTreeDFS::Node *TreeRoot;
-
- InequalityGraph(); // DO NOT IMPLEMENT
- InequalityGraph(InequalityGraph &); // DO NOT IMPLEMENT
- public:
- InequalityGraph(ValueNumbering &VN, DomTreeDFS::Node *TreeRoot)
- : VN(VN), TreeRoot(TreeRoot) {}
-
- class Node;
-
- /// An Edge is contained inside a Node making one end of the edge implicit
- /// and contains a pointer to the other end. The edge contains a lattice
- /// value specifying the relationship and an DomTreeDFS::Node specifying
- /// the root in the dominator tree to which this edge applies.
- class VISIBILITY_HIDDEN Edge {
- public:
- Edge(unsigned T, LatticeVal V, DomTreeDFS::Node *ST)
- : To(T), LV(V), Subtree(ST) {}
-
- unsigned To;
- LatticeVal LV;
- DomTreeDFS::Node *Subtree;
-
- bool operator<(const Edge &edge) const {
- if (To != edge.To) return To < edge.To;
- return *Subtree < *edge.Subtree;
- }
-
- bool operator<(unsigned to) const {
- return To < to;
- }
-
- bool operator>(unsigned to) const {
- return To > to;
- }
-
- friend bool operator<(unsigned to, const Edge &edge) {
- return edge.operator>(to);
- }
- };
-
- /// A single node in the InequalityGraph. This stores the canonical Value
- /// for the node, as well as the relationships with the neighbours.
- ///
- /// @brief A single node in the InequalityGraph.
- class VISIBILITY_HIDDEN Node {
- friend class InequalityGraph;
-
- typedef SmallVector<Edge, 4> RelationsType;
- RelationsType Relations;
-
- // TODO: can this idea improve performance?
- //friend class std::vector<Node>;
- //Node(Node &N) { RelationsType.swap(N.RelationsType); }
-
- public:
- typedef RelationsType::iterator iterator;
- typedef RelationsType::const_iterator const_iterator;
-
-#ifndef NDEBUG
- virtual ~Node() {}
- virtual void dump() const {
- dump(*cerr.stream());
- }
- private:
- void dump(std::ostream &os) const {
- static const std::string names[32] =
- { "000000", "000001", "000002", "000003", "000004", "000005",
- "000006", "000007", "000008", "000009", " >", " >=",
- " s>u<", "s>=u<=", " s>", " s>=", "000016", "000017",
- " s<u>", "s<=u>=", " <", " <=", " s<", " s<=",
- "000024", "000025", " u>", " u>=", " u<", " u<=",
- " !=", "000031" };
- for (Node::const_iterator NI = begin(), NE = end(); NI != NE; ++NI) {
- os << names[NI->LV] << " " << NI->To
- << " (" << NI->Subtree->getDFSNumIn() << "), ";
- }
- }
- public:
-#endif
-
- iterator begin() { return Relations.begin(); }
- iterator end() { return Relations.end(); }
- const_iterator begin() const { return Relations.begin(); }
- const_iterator end() const { return Relations.end(); }
-
- iterator find(unsigned n, DomTreeDFS::Node *Subtree) {
- iterator E = end();
- for (iterator I = std::lower_bound(begin(), E, n);
- I != E && I->To == n; ++I) {
- if (Subtree->DominatedBy(I->Subtree))
- return I;
- }
- return E;
- }
-
- const_iterator find(unsigned n, DomTreeDFS::Node *Subtree) const {
- const_iterator E = end();
- for (const_iterator I = std::lower_bound(begin(), E, n);
- I != E && I->To == n; ++I) {
- if (Subtree->DominatedBy(I->Subtree))
- return I;
- }
- return E;
- }
-
- /// update - updates the lattice value for a given node, creating a new
- /// entry if one doesn't exist. The new lattice value must not be
- /// inconsistent with any previously existing value.
- void update(unsigned n, LatticeVal R, DomTreeDFS::Node *Subtree) {
- assert(validPredicate(R) && "Invalid predicate.");
-
- Edge edge(n, R, Subtree);
- iterator B = begin(), E = end();
- iterator I = std::lower_bound(B, E, edge);
-
- iterator J = I;
- while (J != E && J->To == n) {
- if (Subtree->DominatedBy(J->Subtree))
- break;
- ++J;
- }
-
- if (J != E && J->To == n) {
- edge.LV = static_cast<LatticeVal>(J->LV & R);
- assert(validPredicate(edge.LV) && "Invalid union of lattice values.");
-
- if (edge.LV == J->LV)
- return; // This update adds nothing new.
- }
-
- if (I != B) {
- // We also have to tighten any edge beneath our update.
- for (iterator K = I - 1; K->To == n; --K) {
- if (K->Subtree->DominatedBy(Subtree)) {
- LatticeVal LV = static_cast<LatticeVal>(K->LV & edge.LV);
- assert(validPredicate(LV) && "Invalid union of lattice values");
- K->LV = LV;
- }
- if (K == B) break;
- }
- }
-
- // Insert new edge at Subtree if it isn't already there.
- if (I == E || I->To != n || Subtree != I->Subtree)
- Relations.insert(I, edge);
- }
- };
-
- private:
-
- std::vector<Node> Nodes;
-
- public:
- /// node - returns the node object at a given value number. The pointer
- /// returned may be invalidated on the next call to node().
- Node *node(unsigned index) {
- assert(VN.value(index)); // This triggers the necessary checks.
- if (Nodes.size() < index) Nodes.resize(index);
- return &Nodes[index-1];
- }
-
- /// isRelatedBy - true iff n1 op n2
- bool isRelatedBy(unsigned n1, unsigned n2, DomTreeDFS::Node *Subtree,
- LatticeVal LV) {
- if (n1 == n2) return LV & EQ_BIT;
-
- Node *N1 = node(n1);
- Node::iterator I = N1->find(n2, Subtree), E = N1->end();
- if (I != E) return (I->LV & LV) == I->LV;
-
- return false;
- }
-
- // The add* methods assume that your input is logically valid and may
- // assertion-fail or infinitely loop if you attempt a contradiction.
-
- /// addInequality - Sets n1 op n2.
- /// It is also an error to call this on an inequality that is already true.
- void addInequality(unsigned n1, unsigned n2, DomTreeDFS::Node *Subtree,
- LatticeVal LV1) {
- assert(n1 != n2 && "A node can't be inequal to itself.");
-
- if (LV1 != NE)
- assert(!isRelatedBy(n1, n2, Subtree, reversePredicate(LV1)) &&
- "Contradictory inequality.");
-
- // Suppose we're adding %n1 < %n2. Find all the %a < %n1 and
- // add %a < %n2 too. This keeps the graph fully connected.
- if (LV1 != NE) {
- // Break up the relationship into signed and unsigned comparison parts.
- // If the signed parts of %a op1 %n1 match that of %n1 op2 %n2, and
- // op1 and op2 aren't NE, then add %a op3 %n2. The new relationship
- // should have the EQ_BIT iff it's set for both op1 and op2.
-
- unsigned LV1_s = LV1 & (SLT_BIT|SGT_BIT);
- unsigned LV1_u = LV1 & (ULT_BIT|UGT_BIT);
-
- for (Node::iterator I = node(n1)->begin(), E = node(n1)->end(); I != E; ++I) {
- if (I->LV != NE && I->To != n2) {
-
- DomTreeDFS::Node *Local_Subtree = NULL;
- if (Subtree->DominatedBy(I->Subtree))
- Local_Subtree = Subtree;
- else if (I->Subtree->DominatedBy(Subtree))
- Local_Subtree = I->Subtree;
-
- if (Local_Subtree) {
- unsigned new_relationship = 0;
- LatticeVal ILV = reversePredicate(I->LV);
- unsigned ILV_s = ILV & (SLT_BIT|SGT_BIT);
- unsigned ILV_u = ILV & (ULT_BIT|UGT_BIT);
-
- if (LV1_s != (SLT_BIT|SGT_BIT) && ILV_s == LV1_s)
- new_relationship |= ILV_s;
- if (LV1_u != (ULT_BIT|UGT_BIT) && ILV_u == LV1_u)
- new_relationship |= ILV_u;
-
- if (new_relationship) {
- if ((new_relationship & (SLT_BIT|SGT_BIT)) == 0)
- new_relationship |= (SLT_BIT|SGT_BIT);
- if ((new_relationship & (ULT_BIT|UGT_BIT)) == 0)
- new_relationship |= (ULT_BIT|UGT_BIT);
- if ((LV1 & EQ_BIT) && (ILV & EQ_BIT))
- new_relationship |= EQ_BIT;
-
- LatticeVal NewLV = static_cast<LatticeVal>(new_relationship);
-
- node(I->To)->update(n2, NewLV, Local_Subtree);
- node(n2)->update(I->To, reversePredicate(NewLV), Local_Subtree);
- }
- }
- }
- }
-
- for (Node::iterator I = node(n2)->begin(), E = node(n2)->end(); I != E; ++I) {
- if (I->LV != NE && I->To != n1) {
- DomTreeDFS::Node *Local_Subtree = NULL;
- if (Subtree->DominatedBy(I->Subtree))
- Local_Subtree = Subtree;
- else if (I->Subtree->DominatedBy(Subtree))
- Local_Subtree = I->Subtree;
-
- if (Local_Subtree) {
- unsigned new_relationship = 0;
- unsigned ILV_s = I->LV & (SLT_BIT|SGT_BIT);
- unsigned ILV_u = I->LV & (ULT_BIT|UGT_BIT);
-
- if (LV1_s != (SLT_BIT|SGT_BIT) && ILV_s == LV1_s)
- new_relationship |= ILV_s;
-
- if (LV1_u != (ULT_BIT|UGT_BIT) && ILV_u == LV1_u)
- new_relationship |= ILV_u;
-
- if (new_relationship) {
- if ((new_relationship & (SLT_BIT|SGT_BIT)) == 0)
- new_relationship |= (SLT_BIT|SGT_BIT);
- if ((new_relationship & (ULT_BIT|UGT_BIT)) == 0)
- new_relationship |= (ULT_BIT|UGT_BIT);
- if ((LV1 & EQ_BIT) && (I->LV & EQ_BIT))
- new_relationship |= EQ_BIT;
-
- LatticeVal NewLV = static_cast<LatticeVal>(new_relationship);
-
- node(n1)->update(I->To, NewLV, Local_Subtree);
- node(I->To)->update(n1, reversePredicate(NewLV), Local_Subtree);
- }
- }
- }
- }
- }
-
- node(n1)->update(n2, LV1, Subtree);
- node(n2)->update(n1, reversePredicate(LV1), Subtree);
- }
-
- /// remove - removes a node from the graph by removing all references to
- /// and from it.
- void remove(unsigned n) {
- Node *N = node(n);
- for (Node::iterator NI = N->begin(), NE = N->end(); NI != NE; ++NI) {
- Node::iterator Iter = node(NI->To)->find(n, TreeRoot);
- do {
- node(NI->To)->Relations.erase(Iter);
- Iter = node(NI->To)->find(n, TreeRoot);
- } while (Iter != node(NI->To)->end());
- }
- N->Relations.clear();
- }
-
-#ifndef NDEBUG
- virtual ~InequalityGraph() {}
- virtual void dump() {
- dump(*cerr.stream());
- }
-
- void dump(std::ostream &os) {
- for (unsigned i = 1; i <= Nodes.size(); ++i) {
- os << i << " = {";
- node(i)->dump(os);
- os << "}\n";
- }
- }
-#endif
- };
-
- class VRPSolver;
-
- /// ValueRanges tracks the known integer ranges and anti-ranges of the nodes
- /// in the InequalityGraph.
- class VISIBILITY_HIDDEN ValueRanges {
- ValueNumbering &VN;
- TargetData *TD;
-
- class VISIBILITY_HIDDEN ScopedRange {
- typedef std::vector<std::pair<DomTreeDFS::Node *, ConstantRange> >
- RangeListType;
- RangeListType RangeList;
-
- static bool swo(const std::pair<DomTreeDFS::Node *, ConstantRange> &LHS,
- const std::pair<DomTreeDFS::Node *, ConstantRange> &RHS) {
- return *LHS.first < *RHS.first;
- }
-
- public:
-#ifndef NDEBUG
- virtual ~ScopedRange() {}
- virtual void dump() const {
- dump(*cerr.stream());
- }
-
- void dump(std::ostream &os) const {
- os << "{";
- for (const_iterator I = begin(), E = end(); I != E; ++I) {
- os << I->second << " (" << I->first->getDFSNumIn() << "), ";
- }
- os << "}";
- }
-#endif
-
- typedef RangeListType::iterator iterator;
- typedef RangeListType::const_iterator const_iterator;
-
- iterator begin() { return RangeList.begin(); }
- iterator end() { return RangeList.end(); }
- const_iterator begin() const { return RangeList.begin(); }
- const_iterator end() const { return RangeList.end(); }
-
- iterator find(DomTreeDFS::Node *Subtree) {
- static ConstantRange empty(1, false);
- iterator E = end();
- iterator I = std::lower_bound(begin(), E,
- std::make_pair(Subtree, empty), swo);
-
- while (I != E && !I->first->dominates(Subtree)) ++I;
- return I;
- }
-
- const_iterator find(DomTreeDFS::Node *Subtree) const {
- static const ConstantRange empty(1, false);
- const_iterator E = end();
- const_iterator I = std::lower_bound(begin(), E,
- std::make_pair(Subtree, empty), swo);
-
- while (I != E && !I->first->dominates(Subtree)) ++I;
- return I;
- }
-
- void update(const ConstantRange &CR, DomTreeDFS::Node *Subtree) {
- assert(!CR.isEmptySet() && "Empty ConstantRange.");
- assert(!CR.isSingleElement() && "Refusing to store single element.");
-
- static ConstantRange empty(1, false);
- iterator E = end();
- iterator I =
- std::lower_bound(begin(), E, std::make_pair(Subtree, empty), swo);
-
- if (I != end() && I->first == Subtree) {
- ConstantRange CR2 = I->second.maximalIntersectWith(CR);
- assert(!CR2.isEmptySet() && !CR2.isSingleElement() &&
- "Invalid union of ranges.");
- I->second = CR2;
- } else
- RangeList.insert(I, std::make_pair(Subtree, CR));
- }
- };
-
- std::vector<ScopedRange> Ranges;
-
- void update(unsigned n, const ConstantRange &CR, DomTreeDFS::Node *Subtree){
- if (CR.isFullSet()) return;
- if (Ranges.size() < n) Ranges.resize(n);
- Ranges[n-1].update(CR, Subtree);
- }
-
- /// create - Creates a ConstantRange that matches the given LatticeVal
- /// relation with a given integer.
- ConstantRange create(LatticeVal LV, const ConstantRange &CR) {
- assert(!CR.isEmptySet() && "Can't deal with empty set.");
-
- if (LV == NE)
- return makeConstantRange(ICmpInst::ICMP_NE, CR);
-
- unsigned LV_s = LV & (SGT_BIT|SLT_BIT);
- unsigned LV_u = LV & (UGT_BIT|ULT_BIT);
- bool hasEQ = LV & EQ_BIT;
-
- ConstantRange Range(CR.getBitWidth());
-
- if (LV_s == SGT_BIT) {
- Range = Range.maximalIntersectWith(makeConstantRange(
- hasEQ ? ICmpInst::ICMP_SGE : ICmpInst::ICMP_SGT, CR));
- } else if (LV_s == SLT_BIT) {
- Range = Range.maximalIntersectWith(makeConstantRange(
- hasEQ ? ICmpInst::ICMP_SLE : ICmpInst::ICMP_SLT, CR));
- }
-
- if (LV_u == UGT_BIT) {
- Range = Range.maximalIntersectWith(makeConstantRange(
- hasEQ ? ICmpInst::ICMP_UGE : ICmpInst::ICMP_UGT, CR));
- } else if (LV_u == ULT_BIT) {
- Range = Range.maximalIntersectWith(makeConstantRange(
- hasEQ ? ICmpInst::ICMP_ULE : ICmpInst::ICMP_ULT, CR));
- }
-
- return Range;
- }
-
- /// makeConstantRange - Creates a ConstantRange representing the set of all
- /// value that match the ICmpInst::Predicate with any of the values in CR.
- ConstantRange makeConstantRange(ICmpInst::Predicate ICmpOpcode,
- const ConstantRange &CR) {
- uint32_t W = CR.getBitWidth();
- switch (ICmpOpcode) {
- default: assert(!"Invalid ICmp opcode to makeConstantRange()");
- case ICmpInst::ICMP_EQ:
- return ConstantRange(CR.getLower(), CR.getUpper());
- case ICmpInst::ICMP_NE:
- if (CR.isSingleElement())
- return ConstantRange(CR.getUpper(), CR.getLower());
- return ConstantRange(W);
- case ICmpInst::ICMP_ULT:
- return ConstantRange(APInt::getMinValue(W), CR.getUnsignedMax());
- case ICmpInst::ICMP_SLT:
- return ConstantRange(APInt::getSignedMinValue(W), CR.getSignedMax());
- case ICmpInst::ICMP_ULE: {
- APInt UMax(CR.getUnsignedMax());
- if (UMax.isMaxValue())
- return ConstantRange(W);
- return ConstantRange(APInt::getMinValue(W), UMax + 1);
- }
- case ICmpInst::ICMP_SLE: {
- APInt SMax(CR.getSignedMax());
- if (SMax.isMaxSignedValue() || (SMax+1).isMaxSignedValue())
- return ConstantRange(W);
- return ConstantRange(APInt::getSignedMinValue(W), SMax + 1);
- }
- case ICmpInst::ICMP_UGT:
- return ConstantRange(CR.getUnsignedMin() + 1, APInt::getNullValue(W));
- case ICmpInst::ICMP_SGT:
- return ConstantRange(CR.getSignedMin() + 1,
- APInt::getSignedMinValue(W));
- case ICmpInst::ICMP_UGE: {
- APInt UMin(CR.getUnsignedMin());
- if (UMin.isMinValue())
- return ConstantRange(W);
- return ConstantRange(UMin, APInt::getNullValue(W));
- }
- case ICmpInst::ICMP_SGE: {
- APInt SMin(CR.getSignedMin());
- if (SMin.isMinSignedValue())
- return ConstantRange(W);
- return ConstantRange(SMin, APInt::getSignedMinValue(W));
- }
- }
- }
-
-#ifndef NDEBUG
- bool isCanonical(Value *V, DomTreeDFS::Node *Subtree) {
- return V == VN.canonicalize(V, Subtree);
- }
-#endif
-
- public:
-
- ValueRanges(ValueNumbering &VN, TargetData *TD) : VN(VN), TD(TD) {}
-
-#ifndef NDEBUG
- virtual ~ValueRanges() {}
-
- virtual void dump() const {
- dump(*cerr.stream());
- }
-
- void dump(std::ostream &os) const {
- for (unsigned i = 0, e = Ranges.size(); i != e; ++i) {
- os << (i+1) << " = ";
- Ranges[i].dump(os);
- os << "\n";
- }
- }
-#endif
-
- /// range - looks up the ConstantRange associated with a value number.
- ConstantRange range(unsigned n, DomTreeDFS::Node *Subtree) {
- assert(VN.value(n)); // performs range checks
-
- if (n <= Ranges.size()) {
- ScopedRange::iterator I = Ranges[n-1].find(Subtree);
- if (I != Ranges[n-1].end()) return I->second;
- }
-
- Value *V = VN.value(n);
- ConstantRange CR = range(V);
- return CR;
- }
-
- /// range - determine a range from a Value without performing any lookups.
- ConstantRange range(Value *V) const {
- if (ConstantInt *C = dyn_cast<ConstantInt>(V))
- return ConstantRange(C->getValue());
- else if (isa<ConstantPointerNull>(V))
- return ConstantRange(APInt::getNullValue(typeToWidth(V->getType())));
- else
- return ConstantRange(typeToWidth(V->getType()));
- }
-
- // typeToWidth - returns the number of bits necessary to store a value of
- // this type, or zero if unknown.
- uint32_t typeToWidth(const Type *Ty) const {
- if (TD)
- return TD->getTypeSizeInBits(Ty);
- else
- return Ty->getPrimitiveSizeInBits();
- }
-
- static bool isRelatedBy(const ConstantRange &CR1, const ConstantRange &CR2,
- LatticeVal LV) {
- switch (LV) {
- default: assert(!"Impossible lattice value!");
- case NE:
- return CR1.maximalIntersectWith(CR2).isEmptySet();
- case ULT:
- return CR1.getUnsignedMax().ult(CR2.getUnsignedMin());
- case ULE:
- return CR1.getUnsignedMax().ule(CR2.getUnsignedMin());
- case UGT:
- return CR1.getUnsignedMin().ugt(CR2.getUnsignedMax());
- case UGE:
- return CR1.getUnsignedMin().uge(CR2.getUnsignedMax());
- case SLT:
- return CR1.getSignedMax().slt(CR2.getSignedMin());
- case SLE:
- return CR1.getSignedMax().sle(CR2.getSignedMin());
- case SGT:
- return CR1.getSignedMin().sgt(CR2.getSignedMax());
- case SGE:
- return CR1.getSignedMin().sge(CR2.getSignedMax());
- case LT:
- return CR1.getUnsignedMax().ult(CR2.getUnsignedMin()) &&
- CR1.getSignedMax().slt(CR2.getUnsignedMin());
- case LE:
- return CR1.getUnsignedMax().ule(CR2.getUnsignedMin()) &&
- CR1.getSignedMax().sle(CR2.getUnsignedMin());
- case GT:
- return CR1.getUnsignedMin().ugt(CR2.getUnsignedMax()) &&
- CR1.getSignedMin().sgt(CR2.getSignedMax());
- case GE:
- return CR1.getUnsignedMin().uge(CR2.getUnsignedMax()) &&
- CR1.getSignedMin().sge(CR2.getSignedMax());
- case SLTUGT:
- return CR1.getSignedMax().slt(CR2.getSignedMin()) &&
- CR1.getUnsignedMin().ugt(CR2.getUnsignedMax());
- case SLEUGE:
- return CR1.getSignedMax().sle(CR2.getSignedMin()) &&
- CR1.getUnsignedMin().uge(CR2.getUnsignedMax());
- case SGTULT:
- return CR1.getSignedMin().sgt(CR2.getSignedMax()) &&
- CR1.getUnsignedMax().ult(CR2.getUnsignedMin());
- case SGEULE:
- return CR1.getSignedMin().sge(CR2.getSignedMax()) &&
- CR1.getUnsignedMax().ule(CR2.getUnsignedMin());
- }
- }
-
- bool isRelatedBy(unsigned n1, unsigned n2, DomTreeDFS::Node *Subtree,
- LatticeVal LV) {
- ConstantRange CR1 = range(n1, Subtree);
- ConstantRange CR2 = range(n2, Subtree);
-
- // True iff all values in CR1 are LV to all values in CR2.
- return isRelatedBy(CR1, CR2, LV);
- }
-
- void addToWorklist(Value *V, Constant *C, ICmpInst::Predicate Pred,
- VRPSolver *VRP);
- void markBlock(VRPSolver *VRP);
-
- void mergeInto(Value **I, unsigned n, unsigned New,
- DomTreeDFS::Node *Subtree, VRPSolver *VRP) {
- ConstantRange CR_New = range(New, Subtree);
- ConstantRange Merged = CR_New;
-
- for (; n != 0; ++I, --n) {
- unsigned i = VN.valueNumber(*I, Subtree);
- ConstantRange CR_Kill = i ? range(i, Subtree) : range(*I);
- if (CR_Kill.isFullSet()) continue;
- Merged = Merged.maximalIntersectWith(CR_Kill);
- }
-
- if (Merged.isFullSet() || Merged == CR_New) return;
-
- applyRange(New, Merged, Subtree, VRP);
- }
-
- void applyRange(unsigned n, const ConstantRange &CR,
- DomTreeDFS::Node *Subtree, VRPSolver *VRP) {
- ConstantRange Merged = CR.maximalIntersectWith(range(n, Subtree));
- if (Merged.isEmptySet()) {
- markBlock(VRP);
- return;
- }
-
- if (const APInt *I = Merged.getSingleElement()) {
- Value *V = VN.value(n); // XXX: redesign worklist.
- const Type *Ty = V->getType();
- if (Ty->isInteger()) {
- addToWorklist(V, ConstantInt::get(*I), ICmpInst::ICMP_EQ, VRP);
- return;
- } else if (const PointerType *PTy = dyn_cast<PointerType>(Ty)) {
- assert(*I == 0 && "Pointer is null but not zero?");
- addToWorklist(V, ConstantPointerNull::get(PTy),
- ICmpInst::ICMP_EQ, VRP);
- return;
- }
- }
-
- update(n, Merged, Subtree);
- }
-
- void addNotEquals(unsigned n1, unsigned n2, DomTreeDFS::Node *Subtree,
- VRPSolver *VRP) {
- ConstantRange CR1 = range(n1, Subtree);
- ConstantRange CR2 = range(n2, Subtree);
-
- uint32_t W = CR1.getBitWidth();
-
- if (const APInt *I = CR1.getSingleElement()) {
- if (CR2.isFullSet()) {
- ConstantRange NewCR2(CR1.getUpper(), CR1.getLower());
- applyRange(n2, NewCR2, Subtree, VRP);
- } else if (*I == CR2.getLower()) {
- APInt NewLower(CR2.getLower() + 1),
- NewUpper(CR2.getUpper());
- if (NewLower == NewUpper)
- NewLower = NewUpper = APInt::getMinValue(W);
-
- ConstantRange NewCR2(NewLower, NewUpper);
- applyRange(n2, NewCR2, Subtree, VRP);
- } else if (*I == CR2.getUpper() - 1) {
- APInt NewLower(CR2.getLower()),
- NewUpper(CR2.getUpper() - 1);
- if (NewLower == NewUpper)
- NewLower = NewUpper = APInt::getMinValue(W);
-
- ConstantRange NewCR2(NewLower, NewUpper);
- applyRange(n2, NewCR2, Subtree, VRP);
- }
- }
-
- if (const APInt *I = CR2.getSingleElement()) {
- if (CR1.isFullSet()) {
- ConstantRange NewCR1(CR2.getUpper(), CR2.getLower());
- applyRange(n1, NewCR1, Subtree, VRP);
- } else if (*I == CR1.getLower()) {
- APInt NewLower(CR1.getLower() + 1),
- NewUpper(CR1.getUpper());
- if (NewLower == NewUpper)
- NewLower = NewUpper = APInt::getMinValue(W);
-
- ConstantRange NewCR1(NewLower, NewUpper);
- applyRange(n1, NewCR1, Subtree, VRP);
- } else if (*I == CR1.getUpper() - 1) {
- APInt NewLower(CR1.getLower()),
- NewUpper(CR1.getUpper() - 1);
- if (NewLower == NewUpper)
- NewLower = NewUpper = APInt::getMinValue(W);
-
- ConstantRange NewCR1(NewLower, NewUpper);
- applyRange(n1, NewCR1, Subtree, VRP);
- }
- }
- }
-
- void addInequality(unsigned n1, unsigned n2, DomTreeDFS::Node *Subtree,
- LatticeVal LV, VRPSolver *VRP) {
- assert(!isRelatedBy(n1, n2, Subtree, LV) && "Asked to do useless work.");
-
- if (LV == NE) {
- addNotEquals(n1, n2, Subtree, VRP);
- return;
- }
-
- ConstantRange CR1 = range(n1, Subtree);
- ConstantRange CR2 = range(n2, Subtree);
-
- if (!CR1.isSingleElement()) {
- ConstantRange NewCR1 = CR1.maximalIntersectWith(create(LV, CR2));
- if (NewCR1 != CR1)
- applyRange(n1, NewCR1, Subtree, VRP);
- }
-
- if (!CR2.isSingleElement()) {
- ConstantRange NewCR2 = CR2.maximalIntersectWith(
- create(reversePredicate(LV), CR1));
- if (NewCR2 != CR2)
- applyRange(n2, NewCR2, Subtree, VRP);
- }
- }
- };
-
- /// UnreachableBlocks keeps tracks of blocks that are for one reason or
- /// another discovered to be unreachable. This is used to cull the graph when
- /// analyzing instructions, and to mark blocks with the "unreachable"
- /// terminator instruction after the function has executed.
- class VISIBILITY_HIDDEN UnreachableBlocks {
- private:
- std::vector<BasicBlock *> DeadBlocks;
-
- public:
- /// mark - mark a block as dead
- void mark(BasicBlock *BB) {
- std::vector<BasicBlock *>::iterator E = DeadBlocks.end();
- std::vector<BasicBlock *>::iterator I =
- std::lower_bound(DeadBlocks.begin(), E, BB);
-
- if (I == E || *I != BB) DeadBlocks.insert(I, BB);
- }
-
- /// isDead - returns whether a block is known to be dead already
- bool isDead(BasicBlock *BB) {
- std::vector<BasicBlock *>::iterator E = DeadBlocks.end();
- std::vector<BasicBlock *>::iterator I =
- std::lower_bound(DeadBlocks.begin(), E, BB);
-
- return I != E && *I == BB;
- }
-
- /// kill - replace the dead blocks' terminator with an UnreachableInst.
- bool kill() {
- bool modified = false;
- for (std::vector<BasicBlock *>::iterator I = DeadBlocks.begin(),
- E = DeadBlocks.end(); I != E; ++I) {
- BasicBlock *BB = *I;
-
- DOUT << "unreachable block: " << BB->getName() << "\n";
-
- for (succ_iterator SI = succ_begin(BB), SE = succ_end(BB);
- SI != SE; ++SI) {
- BasicBlock *Succ = *SI;
- Succ->removePredecessor(BB);
- }
-
- TerminatorInst *TI = BB->getTerminator();
- TI->replaceAllUsesWith(UndefValue::get(TI->getType()));
- TI->eraseFromParent();
- new UnreachableInst(BB);
- ++NumBlocks;
- modified = true;
- }
- DeadBlocks.clear();
- return modified;
- }
- };
-
- /// VRPSolver keeps track of how changes to one variable affect other
- /// variables, and forwards changes along to the InequalityGraph. It
- /// also maintains the correct choice for "canonical" in the IG.
- /// @brief VRPSolver calculates inferences from a new relationship.
- class VISIBILITY_HIDDEN VRPSolver {
- private:
- friend class ValueRanges;
-
- struct Operation {
- Value *LHS, *RHS;
- ICmpInst::Predicate Op;
-
- BasicBlock *ContextBB; // XXX use a DomTreeDFS::Node instead
- Instruction *ContextInst;
- };
- std::deque<Operation> WorkList;
-
- ValueNumbering &VN;
- InequalityGraph &IG;
- UnreachableBlocks &UB;
- ValueRanges &VR;
- DomTreeDFS *DTDFS;
- DomTreeDFS::Node *Top;
- BasicBlock *TopBB;
- Instruction *TopInst;
- bool &modified;
-
- typedef InequalityGraph::Node Node;
-
- // below - true if the Instruction is dominated by the current context
- // block or instruction
- bool below(Instruction *I) {
- BasicBlock *BB = I->getParent();
- if (TopInst && TopInst->getParent() == BB) {
- if (isa<TerminatorInst>(TopInst)) return false;
- if (isa<TerminatorInst>(I)) return true;
- if ( isa<PHINode>(TopInst) && !isa<PHINode>(I)) return true;
- if (!isa<PHINode>(TopInst) && isa<PHINode>(I)) return false;
-
- for (BasicBlock::const_iterator Iter = BB->begin(), E = BB->end();
- Iter != E; ++Iter) {
- if (&*Iter == TopInst) return true;
- else if (&*Iter == I) return false;
- }
- assert(!"Instructions not found in parent BasicBlock?");
- } else {
- DomTreeDFS::Node *Node = DTDFS->getNodeForBlock(BB);
- if (!Node) return false;
- return Top->dominates(Node);
- }
- return false; // Not reached
- }
-
- // aboveOrBelow - true if the Instruction either dominates or is dominated
- // by the current context block or instruction
- bool aboveOrBelow(Instruction *I) {
- BasicBlock *BB = I->getParent();
- DomTreeDFS::Node *Node = DTDFS->getNodeForBlock(BB);
- if (!Node) return false;
-
- return Top == Node || Top->dominates(Node) || Node->dominates(Top);
- }
-
- bool makeEqual(Value *V1, Value *V2) {
- DOUT << "makeEqual(" << *V1 << ", " << *V2 << ")\n";
- DOUT << "context is ";
- if (TopInst) DOUT << "I: " << *TopInst << "\n";
- else DOUT << "BB: " << TopBB->getName()
- << "(" << Top->getDFSNumIn() << ")\n";
-
- assert(V1->getType() == V2->getType() &&
- "Can't make two values with different types equal.");
-
- if (V1 == V2) return true;
-
- if (isa<Constant>(V1) && isa<Constant>(V2))
- return false;
-
- unsigned n1 = VN.valueNumber(V1, Top), n2 = VN.valueNumber(V2, Top);
-
- if (n1 && n2) {
- if (n1 == n2) return true;
- if (IG.isRelatedBy(n1, n2, Top, NE)) return false;
- }
-
- if (n1) assert(V1 == VN.value(n1) && "Value isn't canonical.");
- if (n2) assert(V2 == VN.value(n2) && "Value isn't canonical.");
-
- assert(!VN.compare(V2, V1) && "Please order parameters to makeEqual.");
-
- assert(!isa<Constant>(V2) && "Tried to remove a constant.");
-
- SetVector<unsigned> Remove;
- if (n2) Remove.insert(n2);
-
- if (n1 && n2) {
- // Suppose we're being told that %x == %y, and %x <= %z and %y >= %z.
- // We can't just merge %x and %y because the relationship with %z would
- // be EQ and that's invalid. What we're doing is looking for any nodes
- // %z such that %x <= %z and %y >= %z, and vice versa.
-
- Node::iterator end = IG.node(n2)->end();
-
- // Find the intersection between N1 and N2 which is dominated by
- // Top. If we find %x where N1 <= %x <= N2 (or >=) then add %x to
- // Remove.
- for (Node::iterator I = IG.node(n1)->begin(), E = IG.node(n1)->end();
- I != E; ++I) {
- if (!(I->LV & EQ_BIT) || !Top->DominatedBy(I->Subtree)) continue;
-
- unsigned ILV_s = I->LV & (SLT_BIT|SGT_BIT);
- unsigned ILV_u = I->LV & (ULT_BIT|UGT_BIT);
- Node::iterator NI = IG.node(n2)->find(I->To, Top);
- if (NI != end) {
- LatticeVal NILV = reversePredicate(NI->LV);
- unsigned NILV_s = NILV & (SLT_BIT|SGT_BIT);
- unsigned NILV_u = NILV & (ULT_BIT|UGT_BIT);
-
- if ((ILV_s != (SLT_BIT|SGT_BIT) && ILV_s == NILV_s) ||
- (ILV_u != (ULT_BIT|UGT_BIT) && ILV_u == NILV_u))
- Remove.insert(I->To);
- }
- }
-
- // See if one of the nodes about to be removed is actually a better
- // canonical choice than n1.
- unsigned orig_n1 = n1;
- SetVector<unsigned>::iterator DontRemove = Remove.end();
- for (SetVector<unsigned>::iterator I = Remove.begin()+1 /* skip n2 */,
- E = Remove.end(); I != E; ++I) {
- unsigned n = *I;
- Value *V = VN.value(n);
- if (VN.compare(V, V1)) {
- V1 = V;
- n1 = n;
- DontRemove = I;
- }
- }
- if (DontRemove != Remove.end()) {
- unsigned n = *DontRemove;
- Remove.remove(n);
- Remove.insert(orig_n1);
- }
- }
-
- // We'd like to allow makeEqual on two values to perform a simple
- // substitution without every creating nodes in the IG whenever possible.
- //
- // The first iteration through this loop operates on V2 before going
- // through the Remove list and operating on those too. If all of the
- // iterations performed simple replacements then we exit early.
- bool mergeIGNode = false;
- unsigned i = 0;
- for (Value *R = V2; i == 0 || i < Remove.size(); ++i) {
- if (i) R = VN.value(Remove[i]); // skip n2.
-
- // Try to replace the whole instruction. If we can, we're done.
- Instruction *I2 = dyn_cast<Instruction>(R);
- if (I2 && below(I2)) {
- std::vector<Instruction *> ToNotify;
- for (Value::use_iterator UI = R->use_begin(), UE = R->use_end();
- UI != UE;) {
- Use &TheUse = UI.getUse();
- ++UI;
- if (Instruction *I = dyn_cast<Instruction>(TheUse.getUser()))
- ToNotify.push_back(I);
- }
-
- DOUT << "Simply removing " << *I2
- << ", replacing with " << *V1 << "\n";
- I2->replaceAllUsesWith(V1);
- // leave it dead; it'll get erased later.
- ++NumInstruction;
- modified = true;
-
- for (std::vector<Instruction *>::iterator II = ToNotify.begin(),
- IE = ToNotify.end(); II != IE; ++II) {
- opsToDef(*II);
- }
-
- continue;
- }
-
- // Otherwise, replace all dominated uses.
- for (Value::use_iterator UI = R->use_begin(), UE = R->use_end();
- UI != UE;) {
- Use &TheUse = UI.getUse();
- ++UI;
- if (Instruction *I = dyn_cast<Instruction>(TheUse.getUser())) {
- if (below(I)) {
- TheUse.set(V1);
- modified = true;
- ++NumVarsReplaced;
- opsToDef(I);
- }
- }
- }
-
- // If that killed the instruction, stop here.
- if (I2 && isInstructionTriviallyDead(I2)) {
- DOUT << "Killed all uses of " << *I2
- << ", replacing with " << *V1 << "\n";
- continue;
- }
-
- // If we make it to here, then we will need to create a node for N1.
- // Otherwise, we can skip out early!
- mergeIGNode = true;
- }
-
- if (!isa<Constant>(V1)) {
- if (Remove.empty()) {
- VR.mergeInto(&V2, 1, VN.getOrInsertVN(V1, Top), Top, this);
- } else {
- std::vector<Value*> RemoveVals;
- RemoveVals.reserve(Remove.size());
-
- for (SetVector<unsigned>::iterator I = Remove.begin(),
- E = Remove.end(); I != E; ++I) {
- Value *V = VN.value(*I);
- if (!V->use_empty())
- RemoveVals.push_back(V);
- }
- VR.mergeInto(&RemoveVals[0], RemoveVals.size(),
- VN.getOrInsertVN(V1, Top), Top, this);
- }
- }
-
- if (mergeIGNode) {
- // Create N1.
- if (!n1) n1 = VN.getOrInsertVN(V1, Top);
-
- // Migrate relationships from removed nodes to N1.
- for (SetVector<unsigned>::iterator I = Remove.begin(), E = Remove.end();
- I != E; ++I) {
- unsigned n = *I;
- for (Node::iterator NI = IG.node(n)->begin(), NE = IG.node(n)->end();
- NI != NE; ++NI) {
- if (NI->Subtree->DominatedBy(Top)) {
- if (NI->To == n1) {
- assert((NI->LV & EQ_BIT) && "Node inequal to itself.");
- continue;
- }
- if (Remove.count(NI->To))
- continue;
-
- IG.node(NI->To)->update(n1, reversePredicate(NI->LV), Top);
- IG.node(n1)->update(NI->To, NI->LV, Top);
- }
- }
- }
-
- // Point V2 (and all items in Remove) to N1.
- if (!n2)
- VN.addEquality(n1, V2, Top);
- else {
- for (SetVector<unsigned>::iterator I = Remove.begin(),
- E = Remove.end(); I != E; ++I) {
- VN.addEquality(n1, VN.value(*I), Top);
- }
- }
-
- // If !Remove.empty() then V2 = Remove[0]->getValue().
- // Even when Remove is empty, we still want to process V2.
- i = 0;
- for (Value *R = V2; i == 0 || i < Remove.size(); ++i) {
- if (i) R = VN.value(Remove[i]); // skip n2.
-
- if (Instruction *I2 = dyn_cast<Instruction>(R)) {
- if (aboveOrBelow(I2))
- defToOps(I2);
- }
- for (Value::use_iterator UI = V2->use_begin(), UE = V2->use_end();
- UI != UE;) {
- Use &TheUse = UI.getUse();
- ++UI;
- if (Instruction *I = dyn_cast<Instruction>(TheUse.getUser())) {
- if (aboveOrBelow(I))
- opsToDef(I);
- }
- }
- }
- }
-
- // re-opsToDef all dominated users of V1.
- if (Instruction *I = dyn_cast<Instruction>(V1)) {
- for (Value::use_iterator UI = I->use_begin(), UE = I->use_end();
- UI != UE;) {
- Use &TheUse = UI.getUse();
- ++UI;
- Value *V = TheUse.getUser();
- if (!V->use_empty()) {
- if (Instruction *Inst = dyn_cast<Instruction>(V)) {
- if (aboveOrBelow(Inst))
- opsToDef(Inst);
- }
- }
- }
- }
-
- return true;
- }
-
- /// cmpInstToLattice - converts an CmpInst::Predicate to lattice value
- /// Requires that the lattice value be valid; does not accept ICMP_EQ.
- static LatticeVal cmpInstToLattice(ICmpInst::Predicate Pred) {
- switch (Pred) {
- case ICmpInst::ICMP_EQ:
- assert(!"No matching lattice value.");
- return static_cast<LatticeVal>(EQ_BIT);
- default:
- assert(!"Invalid 'icmp' predicate.");
- case ICmpInst::ICMP_NE:
- return NE;
- case ICmpInst::ICMP_UGT:
- return UGT;
- case ICmpInst::ICMP_UGE:
- return UGE;
- case ICmpInst::ICMP_ULT:
- return ULT;
- case ICmpInst::ICMP_ULE:
- return ULE;
- case ICmpInst::ICMP_SGT:
- return SGT;
- case ICmpInst::ICMP_SGE:
- return SGE;
- case ICmpInst::ICMP_SLT:
- return SLT;
- case ICmpInst::ICMP_SLE:
- return SLE;
- }
- }
-
- public:
- VRPSolver(ValueNumbering &VN, InequalityGraph &IG, UnreachableBlocks &UB,
- ValueRanges &VR, DomTreeDFS *DTDFS, bool &modified,
- BasicBlock *TopBB)
- : VN(VN),
- IG(IG),
- UB(UB),
- VR(VR),
- DTDFS(DTDFS),
- Top(DTDFS->getNodeForBlock(TopBB)),
- TopBB(TopBB),
- TopInst(NULL),
- modified(modified)
- {
- assert(Top && "VRPSolver created for unreachable basic block.");
- }
-
- VRPSolver(ValueNumbering &VN, InequalityGraph &IG, UnreachableBlocks &UB,
- ValueRanges &VR, DomTreeDFS *DTDFS, bool &modified,
- Instruction *TopInst)
- : VN(VN),
- IG(IG),
- UB(UB),
- VR(VR),
- DTDFS(DTDFS),
- Top(DTDFS->getNodeForBlock(TopInst->getParent())),
- TopBB(TopInst->getParent()),
- TopInst(TopInst),
- modified(modified)
- {
- assert(Top && "VRPSolver created for unreachable basic block.");
- assert(Top->getBlock() == TopInst->getParent() && "Context mismatch.");
- }
-
- bool isRelatedBy(Value *V1, Value *V2, ICmpInst::Predicate Pred) const {
- if (Constant *C1 = dyn_cast<Constant>(V1))
- if (Constant *C2 = dyn_cast<Constant>(V2))
- return ConstantExpr::getCompare(Pred, C1, C2) ==
- ConstantInt::getTrue();
-
- unsigned n1 = VN.valueNumber(V1, Top);
- unsigned n2 = VN.valueNumber(V2, Top);
-
- if (n1 && n2) {
- if (n1 == n2) return Pred == ICmpInst::ICMP_EQ ||
- Pred == ICmpInst::ICMP_ULE ||
- Pred == ICmpInst::ICMP_UGE ||
- Pred == ICmpInst::ICMP_SLE ||
- Pred == ICmpInst::ICMP_SGE;
- if (Pred == ICmpInst::ICMP_EQ) return false;
- if (IG.isRelatedBy(n1, n2, Top, cmpInstToLattice(Pred))) return true;
- if (VR.isRelatedBy(n1, n2, Top, cmpInstToLattice(Pred))) return true;
- }
-
- if ((n1 && !n2 && isa<Constant>(V2)) ||
- (n2 && !n1 && isa<Constant>(V1))) {
- ConstantRange CR1 = n1 ? VR.range(n1, Top) : VR.range(V1);
- ConstantRange CR2 = n2 ? VR.range(n2, Top) : VR.range(V2);
-
- if (Pred == ICmpInst::ICMP_EQ)
- return CR1.isSingleElement() &&
- CR1.getSingleElement() == CR2.getSingleElement();
-
- return VR.isRelatedBy(CR1, CR2, cmpInstToLattice(Pred));
- }
- if (Pred == ICmpInst::ICMP_EQ) return V1 == V2;
- return false;
- }
-
- /// add - adds a new property to the work queue
- void add(Value *V1, Value *V2, ICmpInst::Predicate Pred,
- Instruction *I = NULL) {
- DOUT << "adding " << *V1 << " " << Pred << " " << *V2;
- if (I) DOUT << " context: " << *I;
- else DOUT << " default context (" << Top->getDFSNumIn() << ")";
- DOUT << "\n";
-
- assert(V1->getType() == V2->getType() &&
- "Can't relate two values with different types.");
-
- WorkList.push_back(Operation());
- Operation &O = WorkList.back();
- O.LHS = V1, O.RHS = V2, O.Op = Pred, O.ContextInst = I;
- O.ContextBB = I ? I->getParent() : TopBB;
- }
-
- /// defToOps - Given an instruction definition that we've learned something
- /// new about, find any new relationships between its operands.
- void defToOps(Instruction *I) {
- Instruction *NewContext = below(I) ? I : TopInst;
- Value *Canonical = VN.canonicalize(I, Top);
-
- if (BinaryOperator *BO = dyn_cast<BinaryOperator>(I)) {
- const Type *Ty = BO->getType();
- assert(!Ty->isFPOrFPVector() && "Float in work queue!");
-
- Value *Op0 = VN.canonicalize(BO->getOperand(0), Top);
- Value *Op1 = VN.canonicalize(BO->getOperand(1), Top);
-
- // TODO: "and i32 -1, %x" EQ %y then %x EQ %y.
-
- switch (BO->getOpcode()) {
- case Instruction::And: {
- // "and i32 %a, %b" EQ -1 then %a EQ -1 and %b EQ -1
- ConstantInt *CI = ConstantInt::getAllOnesValue(Ty);
- if (Canonical == CI) {
- add(CI, Op0, ICmpInst::ICMP_EQ, NewContext);
- add(CI, Op1, ICmpInst::ICMP_EQ, NewContext);
- }
- } break;
- case Instruction::Or: {
- // "or i32 %a, %b" EQ 0 then %a EQ 0 and %b EQ 0
- Constant *Zero = Constant::getNullValue(Ty);
- if (Canonical == Zero) {
- add(Zero, Op0, ICmpInst::ICMP_EQ, NewContext);
- add(Zero, Op1, ICmpInst::ICMP_EQ, NewContext);
- }
- } break;
- case Instruction::Xor: {
- // "xor i32 %c, %a" EQ %b then %a EQ %c ^ %b
- // "xor i32 %c, %a" EQ %c then %a EQ 0
- // "xor i32 %c, %a" NE %c then %a NE 0
- // Repeat the above, with order of operands reversed.
- Value *LHS = Op0;
- Value *RHS = Op1;
- if (!isa<Constant>(LHS)) std::swap(LHS, RHS);
-
- if (ConstantInt *CI = dyn_cast<ConstantInt>(Canonical)) {
- if (ConstantInt *Arg = dyn_cast<ConstantInt>(LHS)) {
- add(RHS, ConstantInt::get(CI->getValue() ^ Arg->getValue()),
- ICmpInst::ICMP_EQ, NewContext);
- }
- }
- if (Canonical == LHS) {
- if (isa<ConstantInt>(Canonical))
- add(RHS, Constant::getNullValue(Ty), ICmpInst::ICMP_EQ,
- NewContext);
- } else if (isRelatedBy(LHS, Canonical, ICmpInst::ICMP_NE)) {
- add(RHS, Constant::getNullValue(Ty), ICmpInst::ICMP_NE,
- NewContext);
- }
- } break;
- default:
- break;
- }
- } else if (ICmpInst *IC = dyn_cast<ICmpInst>(I)) {
- // "icmp ult i32 %a, %y" EQ true then %a u< y
- // etc.
-
- if (Canonical == ConstantInt::getTrue()) {
- add(IC->getOperand(0), IC->getOperand(1), IC->getPredicate(),
- NewContext);
- } else if (Canonical == ConstantInt::getFalse()) {
- add(IC->getOperand(0), IC->getOperand(1),
- ICmpInst::getInversePredicate(IC->getPredicate()), NewContext);
- }
- } else if (SelectInst *SI = dyn_cast<SelectInst>(I)) {
- if (I->getType()->isFPOrFPVector()) return;
-
- // Given: "%a = select i1 %x, i32 %b, i32 %c"
- // %a EQ %b and %b NE %c then %x EQ true
- // %a EQ %c and %b NE %c then %x EQ false
-
- Value *True = SI->getTrueValue();
- Value *False = SI->getFalseValue();
- if (isRelatedBy(True, False, ICmpInst::ICMP_NE)) {
- if (Canonical == VN.canonicalize(True, Top) ||
- isRelatedBy(Canonical, False, ICmpInst::ICMP_NE))
- add(SI->getCondition(), ConstantInt::getTrue(),
- ICmpInst::ICMP_EQ, NewContext);
- else if (Canonical == VN.canonicalize(False, Top) ||
- isRelatedBy(Canonical, True, ICmpInst::ICMP_NE))
- add(SI->getCondition(), ConstantInt::getFalse(),
- ICmpInst::ICMP_EQ, NewContext);
- }
- } else if (GetElementPtrInst *GEPI = dyn_cast<GetElementPtrInst>(I)) {
- for (GetElementPtrInst::op_iterator OI = GEPI->idx_begin(),
- OE = GEPI->idx_end(); OI != OE; ++OI) {
- ConstantInt *Op = dyn_cast<ConstantInt>(VN.canonicalize(*OI, Top));
- if (!Op || !Op->isZero()) return;
- }
- // TODO: The GEPI indices are all zero. Copy from definition to operand,
- // jumping the type plane as needed.
- if (isRelatedBy(GEPI, Constant::getNullValue(GEPI->getType()),
- ICmpInst::ICMP_NE)) {
- Value *Ptr = GEPI->getPointerOperand();
- add(Ptr, Constant::getNullValue(Ptr->getType()), ICmpInst::ICMP_NE,
- NewContext);
- }
- } else if (CastInst *CI = dyn_cast<CastInst>(I)) {
- const Type *SrcTy = CI->getSrcTy();
-
- unsigned ci = VN.getOrInsertVN(CI, Top);
- uint32_t W = VR.typeToWidth(SrcTy);
- if (!W) return;
- ConstantRange CR = VR.range(ci, Top);
-
- if (CR.isFullSet()) return;
-
- switch (CI->getOpcode()) {
- default: break;
- case Instruction::ZExt:
- case Instruction::SExt:
- VR.applyRange(VN.getOrInsertVN(CI->getOperand(0), Top),
- CR.truncate(W), Top, this);
- break;
- case Instruction::BitCast:
- VR.applyRange(VN.getOrInsertVN(CI->getOperand(0), Top),
- CR, Top, this);
- break;
- }
- }
- }
-
- /// opsToDef - A new relationship was discovered involving one of this
- /// instruction's operands. Find any new relationship involving the
- /// definition, or another operand.
- void opsToDef(Instruction *I) {
- Instruction *NewContext = below(I) ? I : TopInst;
-
- if (BinaryOperator *BO = dyn_cast<BinaryOperator>(I)) {
- Value *Op0 = VN.canonicalize(BO->getOperand(0), Top);
- Value *Op1 = VN.canonicalize(BO->getOperand(1), Top);
-
- if (ConstantInt *CI0 = dyn_cast<ConstantInt>(Op0))
- if (ConstantInt *CI1 = dyn_cast<ConstantInt>(Op1)) {
- add(BO, ConstantExpr::get(BO->getOpcode(), CI0, CI1),
- ICmpInst::ICMP_EQ, NewContext);
- return;
- }
-
- // "%y = and i1 true, %x" then %x EQ %y
- // "%y = or i1 false, %x" then %x EQ %y
- // "%x = add i32 %y, 0" then %x EQ %y
- // "%x = mul i32 %y, 0" then %x EQ 0
-
- Instruction::BinaryOps Opcode = BO->getOpcode();
- const Type *Ty = BO->getType();
- assert(!Ty->isFPOrFPVector() && "Float in work queue!");
-
- Constant *Zero = Constant::getNullValue(Ty);
- ConstantInt *AllOnes = ConstantInt::getAllOnesValue(Ty);
-
- switch (Opcode) {
- default: break;
- case Instruction::LShr:
- case Instruction::AShr:
- case Instruction::Shl:
- case Instruction::Sub:
- if (Op1 == Zero) {
- add(BO, Op0, ICmpInst::ICMP_EQ, NewContext);
- return;
- }
- break;
- case Instruction::Or:
- if (Op0 == AllOnes || Op1 == AllOnes) {
- add(BO, AllOnes, ICmpInst::ICMP_EQ, NewContext);
- return;
- } // fall-through
- case Instruction::Xor:
- case Instruction::Add:
- if (Op0 == Zero) {
- add(BO, Op1, ICmpInst::ICMP_EQ, NewContext);
- return;
- } else if (Op1 == Zero) {
- add(BO, Op0, ICmpInst::ICMP_EQ, NewContext);
- return;
- }
- break;
- case Instruction::And:
- if (Op0 == AllOnes) {
- add(BO, Op1, ICmpInst::ICMP_EQ, NewContext);
- return;
- } else if (Op1 == AllOnes) {
- add(BO, Op0, ICmpInst::ICMP_EQ, NewContext);
- return;
- }
- // fall-through
- case Instruction::Mul:
- if (Op0 == Zero || Op1 == Zero) {
- add(BO, Zero, ICmpInst::ICMP_EQ, NewContext);
- return;
- }
- break;
- }
-
- // "%x = add i32 %y, %z" and %x EQ %y then %z EQ 0
- // "%x = add i32 %y, %z" and %x EQ %z then %y EQ 0
- // "%x = shl i32 %y, %z" and %x EQ %y and %y NE 0 then %z EQ 0
- // "%x = udiv i32 %y, %z" and %x EQ %y then %z EQ 1
-
- Value *Known = Op0, *Unknown = Op1,
- *TheBO = VN.canonicalize(BO, Top);
- if (Known != TheBO) std::swap(Known, Unknown);
- if (Known == TheBO) {
- switch (Opcode) {
- default: break;
- case Instruction::LShr:
- case Instruction::AShr:
- case Instruction::Shl:
- if (!isRelatedBy(Known, Zero, ICmpInst::ICMP_NE)) break;
- // otherwise, fall-through.
- case Instruction::Sub:
- if (Unknown == Op0) break;
- // otherwise, fall-through.
- case Instruction::Xor:
- case Instruction::Add:
- add(Unknown, Zero, ICmpInst::ICMP_EQ, NewContext);
- break;
- case Instruction::UDiv:
- case Instruction::SDiv:
- if (Unknown == Op1) break;
- if (isRelatedBy(Known, Zero, ICmpInst::ICMP_NE)) {
- Constant *One = ConstantInt::get(Ty, 1);
- add(Unknown, One, ICmpInst::ICMP_EQ, NewContext);
- }
- break;
- }
- }
-
- // TODO: "%a = add i32 %b, 1" and %b > %z then %a >= %z.
-
- } else if (ICmpInst *IC = dyn_cast<ICmpInst>(I)) {
- // "%a = icmp ult i32 %b, %c" and %b u< %c then %a EQ true
- // "%a = icmp ult i32 %b, %c" and %b u>= %c then %a EQ false
- // etc.
-
- Value *Op0 = VN.canonicalize(IC->getOperand(0), Top);
- Value *Op1 = VN.canonicalize(IC->getOperand(1), Top);
-
- ICmpInst::Predicate Pred = IC->getPredicate();
- if (isRelatedBy(Op0, Op1, Pred))
- add(IC, ConstantInt::getTrue(), ICmpInst::ICMP_EQ, NewContext);
- else if (isRelatedBy(Op0, Op1, ICmpInst::getInversePredicate(Pred)))
- add(IC, ConstantInt::getFalse(), ICmpInst::ICMP_EQ, NewContext);
-
- } else if (SelectInst *SI = dyn_cast<SelectInst>(I)) {
- if (I->getType()->isFPOrFPVector()) return;
-
- // Given: "%a = select i1 %x, i32 %b, i32 %c"
- // %x EQ true then %a EQ %b
- // %x EQ false then %a EQ %c
- // %b EQ %c then %a EQ %b
-
- Value *Canonical = VN.canonicalize(SI->getCondition(), Top);
- if (Canonical == ConstantInt::getTrue()) {
- add(SI, SI->getTrueValue(), ICmpInst::ICMP_EQ, NewContext);
- } else if (Canonical == ConstantInt::getFalse()) {
- add(SI, SI->getFalseValue(), ICmpInst::ICMP_EQ, NewContext);
- } else if (VN.canonicalize(SI->getTrueValue(), Top) ==
- VN.canonicalize(SI->getFalseValue(), Top)) {
- add(SI, SI->getTrueValue(), ICmpInst::ICMP_EQ, NewContext);
- }
- } else if (CastInst *CI = dyn_cast<CastInst>(I)) {
- const Type *DestTy = CI->getDestTy();
- if (DestTy->isFPOrFPVector()) return;
-
- Value *Op = VN.canonicalize(CI->getOperand(0), Top);
- Instruction::CastOps Opcode = CI->getOpcode();
-
- if (Constant *C = dyn_cast<Constant>(Op)) {
- add(CI, ConstantExpr::getCast(Opcode, C, DestTy),
- ICmpInst::ICMP_EQ, NewContext);
- }
-
- uint32_t W = VR.typeToWidth(DestTy);
- unsigned ci = VN.getOrInsertVN(CI, Top);
- ConstantRange CR = VR.range(VN.getOrInsertVN(Op, Top), Top);
-
- if (!CR.isFullSet()) {
- switch (Opcode) {
- default: break;
- case Instruction::ZExt:
- VR.applyRange(ci, CR.zeroExtend(W), Top, this);
- break;
- case Instruction::SExt:
- VR.applyRange(ci, CR.signExtend(W), Top, this);
- break;
- case Instruction::Trunc: {
- ConstantRange Result = CR.truncate(W);
- if (!Result.isFullSet())
- VR.applyRange(ci, Result, Top, this);
- } break;
- case Instruction::BitCast:
- VR.applyRange(ci, CR, Top, this);
- break;
- // TODO: other casts?
- }
- }
- } else if (GetElementPtrInst *GEPI = dyn_cast<GetElementPtrInst>(I)) {
- for (GetElementPtrInst::op_iterator OI = GEPI->idx_begin(),
- OE = GEPI->idx_end(); OI != OE; ++OI) {
- ConstantInt *Op = dyn_cast<ConstantInt>(VN.canonicalize(*OI, Top));
- if (!Op || !Op->isZero()) return;
- }
- // TODO: The GEPI indices are all zero. Copy from operand to definition,
- // jumping the type plane as needed.
- Value *Ptr = GEPI->getPointerOperand();
- if (isRelatedBy(Ptr, Constant::getNullValue(Ptr->getType()),
- ICmpInst::ICMP_NE)) {
- add(GEPI, Constant::getNullValue(GEPI->getType()), ICmpInst::ICMP_NE,
- NewContext);
- }
- }
- }
-
- /// solve - process the work queue
- void solve() {
- //DOUT << "WorkList entry, size: " << WorkList.size() << "\n";
- while (!WorkList.empty()) {
- //DOUT << "WorkList size: " << WorkList.size() << "\n";
-
- Operation &O = WorkList.front();
- TopInst = O.ContextInst;
- TopBB = O.ContextBB;
- Top = DTDFS->getNodeForBlock(TopBB); // XXX move this into Context
-
- O.LHS = VN.canonicalize(O.LHS, Top);
- O.RHS = VN.canonicalize(O.RHS, Top);
-
- assert(O.LHS == VN.canonicalize(O.LHS, Top) && "Canonicalize isn't.");
- assert(O.RHS == VN.canonicalize(O.RHS, Top) && "Canonicalize isn't.");
-
- DOUT << "solving " << *O.LHS << " " << O.Op << " " << *O.RHS;
- if (O.ContextInst) DOUT << " context inst: " << *O.ContextInst;
- else DOUT << " context block: " << O.ContextBB->getName();
- DOUT << "\n";
-
- DEBUG(VN.dump());
- DEBUG(IG.dump());
- DEBUG(VR.dump());
-
- // If they're both Constant, skip it. Check for contradiction and mark
- // the BB as unreachable if so.
- if (Constant *CI_L = dyn_cast<Constant>(O.LHS)) {
- if (Constant *CI_R = dyn_cast<Constant>(O.RHS)) {
- if (ConstantExpr::getCompare(O.Op, CI_L, CI_R) ==
- ConstantInt::getFalse())
- UB.mark(TopBB);
-
- WorkList.pop_front();
- continue;
- }
- }
-
- if (VN.compare(O.LHS, O.RHS)) {
- std::swap(O.LHS, O.RHS);
- O.Op = ICmpInst::getSwappedPredicate(O.Op);
- }
-
- if (O.Op == ICmpInst::ICMP_EQ) {
- if (!makeEqual(O.RHS, O.LHS))
- UB.mark(TopBB);
- } else {
- LatticeVal LV = cmpInstToLattice(O.Op);
-
- if ((LV & EQ_BIT) &&
- isRelatedBy(O.LHS, O.RHS, ICmpInst::getSwappedPredicate(O.Op))) {
- if (!makeEqual(O.RHS, O.LHS))
- UB.mark(TopBB);
- } else {
- if (isRelatedBy(O.LHS, O.RHS, ICmpInst::getInversePredicate(O.Op))){
- UB.mark(TopBB);
- WorkList.pop_front();
- continue;
- }
-
- unsigned n1 = VN.getOrInsertVN(O.LHS, Top);
- unsigned n2 = VN.getOrInsertVN(O.RHS, Top);
-
- if (n1 == n2) {
- if (O.Op != ICmpInst::ICMP_UGE && O.Op != ICmpInst::ICMP_ULE &&
- O.Op != ICmpInst::ICMP_SGE && O.Op != ICmpInst::ICMP_SLE)
- UB.mark(TopBB);
-
- WorkList.pop_front();
- continue;
- }
-
- if (VR.isRelatedBy(n1, n2, Top, LV) ||
- IG.isRelatedBy(n1, n2, Top, LV)) {
- WorkList.pop_front();
- continue;
- }
-
- VR.addInequality(n1, n2, Top, LV, this);
- if ((!isa<ConstantInt>(O.RHS) && !isa<ConstantInt>(O.LHS)) ||
- LV == NE)
- IG.addInequality(n1, n2, Top, LV);
-
- if (Instruction *I1 = dyn_cast<Instruction>(O.LHS)) {
- if (aboveOrBelow(I1))
- defToOps(I1);
- }
- if (isa<Instruction>(O.LHS) || isa<Argument>(O.LHS)) {
- for (Value::use_iterator UI = O.LHS->use_begin(),
- UE = O.LHS->use_end(); UI != UE;) {
- Use &TheUse = UI.getUse();
- ++UI;
- if (Instruction *I = dyn_cast<Instruction>(TheUse.getUser())) {
- if (aboveOrBelow(I))
- opsToDef(I);
- }
- }
- }
- if (Instruction *I2 = dyn_cast<Instruction>(O.RHS)) {
- if (aboveOrBelow(I2))
- defToOps(I2);
- }
- if (isa<Instruction>(O.RHS) || isa<Argument>(O.RHS)) {
- for (Value::use_iterator UI = O.RHS->use_begin(),
- UE = O.RHS->use_end(); UI != UE;) {
- Use &TheUse = UI.getUse();
- ++UI;
- if (Instruction *I = dyn_cast<Instruction>(TheUse.getUser())) {
- if (aboveOrBelow(I))
- opsToDef(I);
- }
- }
- }
- }
- }
- WorkList.pop_front();
- }
- }
- };
-
- void ValueRanges::addToWorklist(Value *V, Constant *C,
- ICmpInst::Predicate Pred, VRPSolver *VRP) {
- VRP->add(V, C, Pred, VRP->TopInst);
- }
-
- void ValueRanges::markBlock(VRPSolver *VRP) {
- VRP->UB.mark(VRP->TopBB);
- }
-
- /// PredicateSimplifier - This class is a simplifier that replaces
- /// one equivalent variable with another. It also tracks what
- /// can't be equal and will solve setcc instructions when possible.
- /// @brief Root of the predicate simplifier optimization.
- class VISIBILITY_HIDDEN PredicateSimplifier : public FunctionPass {
- DomTreeDFS *DTDFS;
- bool modified;
- ValueNumbering *VN;
- InequalityGraph *IG;
- UnreachableBlocks UB;
- ValueRanges *VR;
-
- std::vector<DomTreeDFS::Node *> WorkList;
-
- public:
- static char ID; // Pass identification, replacement for typeid
- PredicateSimplifier() : FunctionPass((intptr_t)&ID) {}
-
- bool runOnFunction(Function &F);
-
- virtual void getAnalysisUsage(AnalysisUsage &AU) const {
- AU.addRequiredID(BreakCriticalEdgesID);
- AU.addRequired<DominatorTree>();
- AU.addRequired<TargetData>();
- AU.addPreserved<TargetData>();
- }
-
- private:
- /// Forwards - Adds new properties to VRPSolver and uses them to
- /// simplify instructions. Because new properties sometimes apply to
- /// a transition from one BasicBlock to another, this will use the
- /// PredicateSimplifier::proceedToSuccessor(s) interface to enter the
- /// basic block.
- /// @brief Performs abstract execution of the program.
- class VISIBILITY_HIDDEN Forwards : public InstVisitor<Forwards> {
- friend class InstVisitor<Forwards>;
- PredicateSimplifier *PS;
- DomTreeDFS::Node *DTNode;
-
- public:
- ValueNumbering &VN;
- InequalityGraph &IG;
- UnreachableBlocks &UB;
- ValueRanges &VR;
-
- Forwards(PredicateSimplifier *PS, DomTreeDFS::Node *DTNode)
- : PS(PS), DTNode(DTNode), VN(*PS->VN), IG(*PS->IG), UB(PS->UB),
- VR(*PS->VR) {}
-
- void visitTerminatorInst(TerminatorInst &TI);
- void visitBranchInst(BranchInst &BI);
- void visitSwitchInst(SwitchInst &SI);
-
- void visitAllocaInst(AllocaInst &AI);
- void visitLoadInst(LoadInst &LI);
- void visitStoreInst(StoreInst &SI);
-
- void visitSExtInst(SExtInst &SI);
- void visitZExtInst(ZExtInst &ZI);
-
- void visitBinaryOperator(BinaryOperator &BO);
- void visitICmpInst(ICmpInst &IC);
- };
-
- // Used by terminator instructions to proceed from the current basic
- // block to the next. Verifies that "current" dominates "next",
- // then calls visitBasicBlock.
- void proceedToSuccessors(DomTreeDFS::Node *Current) {
- for (DomTreeDFS::Node::iterator I = Current->begin(),
- E = Current->end(); I != E; ++I) {
- WorkList.push_back(*I);
- }
- }
-
- void proceedToSuccessor(DomTreeDFS::Node *Next) {
- WorkList.push_back(Next);
- }
-
- // Visits each instruction in the basic block.
- void visitBasicBlock(DomTreeDFS::Node *Node) {
- BasicBlock *BB = Node->getBlock();
- DOUT << "Entering Basic Block: " << BB->getName()
- << " (" << Node->getDFSNumIn() << ")\n";
- for (BasicBlock::iterator I = BB->begin(), E = BB->end(); I != E;) {
- visitInstruction(I++, Node);
- }
- }
-
- // Tries to simplify each Instruction and add new properties.
- void visitInstruction(Instruction *I, DomTreeDFS::Node *DT) {
- DOUT << "Considering instruction " << *I << "\n";
- DEBUG(VN->dump());
- DEBUG(IG->dump());
- DEBUG(VR->dump());
-
- // Sometimes instructions are killed in earlier analysis.
- if (isInstructionTriviallyDead(I)) {
- ++NumSimple;
- modified = true;
- if (unsigned n = VN->valueNumber(I, DTDFS->getRootNode()))
- if (VN->value(n) == I) IG->remove(n);
- VN->remove(I);
- I->eraseFromParent();
- return;
- }
-
-#ifndef NDEBUG
- // Try to replace the whole instruction.
- Value *V = VN->canonicalize(I, DT);
- assert(V == I && "Late instruction canonicalization.");
- if (V != I) {
- modified = true;
- ++NumInstruction;
- DOUT << "Removing " << *I << ", replacing with " << *V << "\n";
- if (unsigned n = VN->valueNumber(I, DTDFS->getRootNode()))
- if (VN->value(n) == I) IG->remove(n);
- VN->remove(I);
- I->replaceAllUsesWith(V);
- I->eraseFromParent();
- return;
- }
-
- // Try to substitute operands.
- for (unsigned i = 0, e = I->getNumOperands(); i != e; ++i) {
- Value *Oper = I->getOperand(i);
- Value *V = VN->canonicalize(Oper, DT);
- assert(V == Oper && "Late operand canonicalization.");
- if (V != Oper) {
- modified = true;
- ++NumVarsReplaced;
- DOUT << "Resolving " << *I;
- I->setOperand(i, V);
- DOUT << " into " << *I;
- }
- }
-#endif
-
- std::string name = I->getParent()->getName();
- DOUT << "push (%" << name << ")\n";
- Forwards visit(this, DT);
- visit.visit(*I);
- DOUT << "pop (%" << name << ")\n";
- }
- };
-
- bool PredicateSimplifier::runOnFunction(Function &F) {
- DominatorTree *DT = &getAnalysis<DominatorTree>();
- DTDFS = new DomTreeDFS(DT);
- TargetData *TD = &getAnalysis<TargetData>();
-
- DOUT << "Entering Function: " << F.getName() << "\n";
-
- modified = false;
- DomTreeDFS::Node *Root = DTDFS->getRootNode();
- VN = new ValueNumbering(DTDFS);
- IG = new InequalityGraph(*VN, Root);
- VR = new ValueRanges(*VN, TD);
- WorkList.push_back(Root);
-
- do {
- DomTreeDFS::Node *DTNode = WorkList.back();
- WorkList.pop_back();
- if (!UB.isDead(DTNode->getBlock())) visitBasicBlock(DTNode);
- } while (!WorkList.empty());
-
- delete DTDFS;
- delete VR;
- delete IG;
-
- modified |= UB.kill();
-
- return modified;
- }
-
- void PredicateSimplifier::Forwards::visitTerminatorInst(TerminatorInst &TI) {
- PS->proceedToSuccessors(DTNode);
- }
-
- void PredicateSimplifier::Forwards::visitBranchInst(BranchInst &BI) {
- if (BI.isUnconditional()) {
- PS->proceedToSuccessors(DTNode);
- return;
- }
-
- Value *Condition = BI.getCondition();
- BasicBlock *TrueDest = BI.getSuccessor(0);
- BasicBlock *FalseDest = BI.getSuccessor(1);
-
- if (isa<Constant>(Condition) || TrueDest == FalseDest) {
- PS->proceedToSuccessors(DTNode);
- return;
- }
-
- for (DomTreeDFS::Node::iterator I = DTNode->begin(), E = DTNode->end();
- I != E; ++I) {
- BasicBlock *Dest = (*I)->getBlock();
- DOUT << "Branch thinking about %" << Dest->getName()
- << "(" << PS->DTDFS->getNodeForBlock(Dest)->getDFSNumIn() << ")\n";
-
- if (Dest == TrueDest) {
- DOUT << "(" << DTNode->getBlock()->getName() << ") true set:\n";
- VRPSolver VRP(VN, IG, UB, VR, PS->DTDFS, PS->modified, Dest);
- VRP.add(ConstantInt::getTrue(), Condition, ICmpInst::ICMP_EQ);
- VRP.solve();
- DEBUG(VN.dump());
- DEBUG(IG.dump());
- DEBUG(VR.dump());
- } else if (Dest == FalseDest) {
- DOUT << "(" << DTNode->getBlock()->getName() << ") false set:\n";
- VRPSolver VRP(VN, IG, UB, VR, PS->DTDFS, PS->modified, Dest);
- VRP.add(ConstantInt::getFalse(), Condition, ICmpInst::ICMP_EQ);
- VRP.solve();
- DEBUG(VN.dump());
- DEBUG(IG.dump());
- DEBUG(VR.dump());
- }
-
- PS->proceedToSuccessor(*I);
- }
- }
-
- void PredicateSimplifier::Forwards::visitSwitchInst(SwitchInst &SI) {
- Value *Condition = SI.getCondition();
-
- // Set the EQProperty in each of the cases BBs, and the NEProperties
- // in the default BB.
-
- for (DomTreeDFS::Node::iterator I = DTNode->begin(), E = DTNode->end();
- I != E; ++I) {
- BasicBlock *BB = (*I)->getBlock();
- DOUT << "Switch thinking about BB %" << BB->getName()
- << "(" << PS->DTDFS->getNodeForBlock(BB)->getDFSNumIn() << ")\n";
-
- VRPSolver VRP(VN, IG, UB, VR, PS->DTDFS, PS->modified, BB);
- if (BB == SI.getDefaultDest()) {
- for (unsigned i = 1, e = SI.getNumCases(); i < e; ++i)
- if (SI.getSuccessor(i) != BB)
- VRP.add(Condition, SI.getCaseValue(i), ICmpInst::ICMP_NE);
- VRP.solve();
- } else if (ConstantInt *CI = SI.findCaseDest(BB)) {
- VRP.add(Condition, CI, ICmpInst::ICMP_EQ);
- VRP.solve();
- }
- PS->proceedToSuccessor(*I);
- }
- }
-
- void PredicateSimplifier::Forwards::visitAllocaInst(AllocaInst &AI) {
- VRPSolver VRP(VN, IG, UB, VR, PS->DTDFS, PS->modified, &AI);
- VRP.add(Constant::getNullValue(AI.getType()), &AI, ICmpInst::ICMP_NE);
- VRP.solve();
- }
-
- void PredicateSimplifier::Forwards::visitLoadInst(LoadInst &LI) {
- Value *Ptr = LI.getPointerOperand();
- // avoid "load uint* null" -> null NE null.
- if (isa<Constant>(Ptr)) return;
-
- VRPSolver VRP(VN, IG, UB, VR, PS->DTDFS, PS->modified, &LI);
- VRP.add(Constant::getNullValue(Ptr->getType()), Ptr, ICmpInst::ICMP_NE);
- VRP.solve();
- }
-
- void PredicateSimplifier::Forwards::visitStoreInst(StoreInst &SI) {
- Value *Ptr = SI.getPointerOperand();
- if (isa<Constant>(Ptr)) return;
-
- VRPSolver VRP(VN, IG, UB, VR, PS->DTDFS, PS->modified, &SI);
- VRP.add(Constant::getNullValue(Ptr->getType()), Ptr, ICmpInst::ICMP_NE);
- VRP.solve();
- }
-
- void PredicateSimplifier::Forwards::visitSExtInst(SExtInst &SI) {
- VRPSolver VRP(VN, IG, UB, VR, PS->DTDFS, PS->modified, &SI);
- uint32_t SrcBitWidth = cast<IntegerType>(SI.getSrcTy())->getBitWidth();
- uint32_t DstBitWidth = cast<IntegerType>(SI.getDestTy())->getBitWidth();
- APInt Min(APInt::getHighBitsSet(DstBitWidth, DstBitWidth-SrcBitWidth+1));
- APInt Max(APInt::getLowBitsSet(DstBitWidth, SrcBitWidth-1));
- VRP.add(ConstantInt::get(Min), &SI, ICmpInst::ICMP_SLE);
- VRP.add(ConstantInt::get(Max), &SI, ICmpInst::ICMP_SGE);
- VRP.solve();
- }
-
- void PredicateSimplifier::Forwards::visitZExtInst(ZExtInst &ZI) {
- VRPSolver VRP(VN, IG, UB, VR, PS->DTDFS, PS->modified, &ZI);
- uint32_t SrcBitWidth = cast<IntegerType>(ZI.getSrcTy())->getBitWidth();
- uint32_t DstBitWidth = cast<IntegerType>(ZI.getDestTy())->getBitWidth();
- APInt Max(APInt::getLowBitsSet(DstBitWidth, SrcBitWidth));
- VRP.add(ConstantInt::get(Max), &ZI, ICmpInst::ICMP_UGE);
- VRP.solve();
- }
-
- void PredicateSimplifier::Forwards::visitBinaryOperator(BinaryOperator &BO) {
- Instruction::BinaryOps ops = BO.getOpcode();
-
- switch (ops) {
- default: break;
- case Instruction::URem:
- case Instruction::SRem:
- case Instruction::UDiv:
- case Instruction::SDiv: {
- Value *Divisor = BO.getOperand(1);
- VRPSolver VRP(VN, IG, UB, VR, PS->DTDFS, PS->modified, &BO);
- VRP.add(Constant::getNullValue(Divisor->getType()), Divisor,
- ICmpInst::ICMP_NE);
- VRP.solve();
- break;
- }
- }
-
- switch (ops) {
- default: break;
- case Instruction::Shl: {
- VRPSolver VRP(VN, IG, UB, VR, PS->DTDFS, PS->modified, &BO);
- VRP.add(&BO, BO.getOperand(0), ICmpInst::ICMP_UGE);
- VRP.solve();
- } break;
- case Instruction::AShr: {
- VRPSolver VRP(VN, IG, UB, VR, PS->DTDFS, PS->modified, &BO);
- VRP.add(&BO, BO.getOperand(0), ICmpInst::ICMP_SLE);
- VRP.solve();
- } break;
- case Instruction::LShr:
- case Instruction::UDiv: {
- VRPSolver VRP(VN, IG, UB, VR, PS->DTDFS, PS->modified, &BO);
- VRP.add(&BO, BO.getOperand(0), ICmpInst::ICMP_ULE);
- VRP.solve();
- } break;
- case Instruction::URem: {
- VRPSolver VRP(VN, IG, UB, VR, PS->DTDFS, PS->modified, &BO);
- VRP.add(&BO, BO.getOperand(1), ICmpInst::ICMP_ULE);
- VRP.solve();
- } break;
- case Instruction::And: {
- VRPSolver VRP(VN, IG, UB, VR, PS->DTDFS, PS->modified, &BO);
- VRP.add(&BO, BO.getOperand(0), ICmpInst::ICMP_ULE);
- VRP.add(&BO, BO.getOperand(1), ICmpInst::ICMP_ULE);
- VRP.solve();
- } break;
- case Instruction::Or: {
- VRPSolver VRP(VN, IG, UB, VR, PS->DTDFS, PS->modified, &BO);
- VRP.add(&BO, BO.getOperand(0), ICmpInst::ICMP_UGE);
- VRP.add(&BO, BO.getOperand(1), ICmpInst::ICMP_UGE);
- VRP.solve();
- } break;
- }
- }
-
- void PredicateSimplifier::Forwards::visitICmpInst(ICmpInst &IC) {
- // If possible, squeeze the ICmp predicate into something simpler.
- // Eg., if x = [0, 4) and we're being asked icmp uge %x, 3 then change
- // the predicate to eq.
-
- // XXX: once we do full PHI handling, modifying the instruction in the
- // Forwards visitor will cause missed optimizations.
-
- ICmpInst::Predicate Pred = IC.getPredicate();
-
- switch (Pred) {
- default: break;
- case ICmpInst::ICMP_ULE: Pred = ICmpInst::ICMP_ULT; break;
- case ICmpInst::ICMP_UGE: Pred = ICmpInst::ICMP_UGT; break;
- case ICmpInst::ICMP_SLE: Pred = ICmpInst::ICMP_SLT; break;
- case ICmpInst::ICMP_SGE: Pred = ICmpInst::ICMP_SGT; break;
- }
- if (Pred != IC.getPredicate()) {
- VRPSolver VRP(VN, IG, UB, VR, PS->DTDFS, PS->modified, &IC);
- if (VRP.isRelatedBy(IC.getOperand(1), IC.getOperand(0),
- ICmpInst::ICMP_NE)) {
- ++NumSnuggle;
- PS->modified = true;
- IC.setPredicate(Pred);
- }
- }
-
- Pred = IC.getPredicate();
-
- if (ConstantInt *Op1 = dyn_cast<ConstantInt>(IC.getOperand(1))) {
- ConstantInt *NextVal = 0;
- switch (Pred) {
- default: break;
- case ICmpInst::ICMP_SLT:
- case ICmpInst::ICMP_ULT:
- if (Op1->getValue() != 0)
- NextVal = ConstantInt::get(Op1->getValue()-1);
- break;
- case ICmpInst::ICMP_SGT:
- case ICmpInst::ICMP_UGT:
- if (!Op1->getValue().isAllOnesValue())
- NextVal = ConstantInt::get(Op1->getValue()+1);
- break;
-
- }
- if (NextVal) {
- VRPSolver VRP(VN, IG, UB, VR, PS->DTDFS, PS->modified, &IC);
- if (VRP.isRelatedBy(IC.getOperand(0), NextVal,
- ICmpInst::getInversePredicate(Pred))) {
- ICmpInst *NewIC = new ICmpInst(ICmpInst::ICMP_EQ, IC.getOperand(0),
- NextVal, "", &IC);
- NewIC->takeName(&IC);
- IC.replaceAllUsesWith(NewIC);
-
- // XXX: prove this isn't necessary
- if (unsigned n = VN.valueNumber(&IC, PS->DTDFS->getRootNode()))
- if (VN.value(n) == &IC) IG.remove(n);
- VN.remove(&IC);
-
- IC.eraseFromParent();
- ++NumSnuggle;
- PS->modified = true;
- }
- }
- }
- }
-
- char PredicateSimplifier::ID = 0;
- RegisterPass<PredicateSimplifier> X("predsimplify",
- "Predicate Simplifier");
-}
-
-FunctionPass *llvm::createPredicateSimplifierPass() {
- return new PredicateSimplifier();
-}
diff --git a/release_23/lib/Transforms/Scalar/Reassociate.cpp b/release_23/lib/Transforms/Scalar/Reassociate.cpp
deleted file mode 100644
index 0a118cd338b9..000000000000
--- a/release_23/lib/Transforms/Scalar/Reassociate.cpp
+++ /dev/null
@@ -1,883 +0,0 @@
-//===- Reassociate.cpp - Reassociate binary expressions -------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This pass reassociates commutative expressions in an order that is designed
-// to promote better constant propagation, GCSE, LICM, PRE...
-//
-// For example: 4 + (x + 5) -> x + (4 + 5)
-//
-// In the implementation of this algorithm, constants are assigned rank = 0,
-// function arguments are rank = 1, and other values are assigned ranks
-// corresponding to the reverse post order traversal of current function
-// (starting at 2), which effectively gives values in deep loops higher rank
-// than values not in loops.
-//
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "reassociate"
-#include "llvm/Transforms/Scalar.h"
-#include "llvm/Constants.h"
-#include "llvm/DerivedTypes.h"
-#include "llvm/Function.h"
-#include "llvm/Instructions.h"
-#include "llvm/Pass.h"
-#include "llvm/Assembly/Writer.h"
-#include "llvm/Support/CFG.h"
-#include "llvm/Support/Compiler.h"
-#include "llvm/Support/Debug.h"
-#include "llvm/ADT/PostOrderIterator.h"
-#include "llvm/ADT/Statistic.h"
-#include <algorithm>
-#include <map>
-using namespace llvm;
-
-STATISTIC(NumLinear , "Number of insts linearized");
-STATISTIC(NumChanged, "Number of insts reassociated");
-STATISTIC(NumAnnihil, "Number of expr tree annihilated");
-STATISTIC(NumFactor , "Number of multiplies factored");
-
-namespace {
- struct VISIBILITY_HIDDEN ValueEntry {
- unsigned Rank;
- Value *Op;
- ValueEntry(unsigned R, Value *O) : Rank(R), Op(O) {}
- };
- inline bool operator<(const ValueEntry &LHS, const ValueEntry &RHS) {
- return LHS.Rank > RHS.Rank; // Sort so that highest rank goes to start.
- }
-}
-
-/// PrintOps - Print out the expression identified in the Ops list.
-///
-static void PrintOps(Instruction *I, const std::vector<ValueEntry> &Ops) {
- Module *M = I->getParent()->getParent()->getParent();
- cerr << Instruction::getOpcodeName(I->getOpcode()) << " "
- << *Ops[0].Op->getType();
- for (unsigned i = 0, e = Ops.size(); i != e; ++i)
- WriteAsOperand(*cerr.stream() << " ", Ops[i].Op, false, M)
- << "," << Ops[i].Rank;
-}
-
-namespace {
- class VISIBILITY_HIDDEN Reassociate : public FunctionPass {
- std::map<BasicBlock*, unsigned> RankMap;
- std::map<Value*, unsigned> ValueRankMap;
- bool MadeChange;
- public:
- static char ID; // Pass identification, replacement for typeid
- Reassociate() : FunctionPass((intptr_t)&ID) {}
-
- bool runOnFunction(Function &F);
-
- virtual void getAnalysisUsage(AnalysisUsage &AU) const {
- AU.setPreservesCFG();
- }
- private:
- void BuildRankMap(Function &F);
- unsigned getRank(Value *V);
- void ReassociateExpression(BinaryOperator *I);
- void RewriteExprTree(BinaryOperator *I, std::vector<ValueEntry> &Ops,
- unsigned Idx = 0);
- Value *OptimizeExpression(BinaryOperator *I, std::vector<ValueEntry> &Ops);
- void LinearizeExprTree(BinaryOperator *I, std::vector<ValueEntry> &Ops);
- void LinearizeExpr(BinaryOperator *I);
- Value *RemoveFactorFromExpression(Value *V, Value *Factor);
- void ReassociateBB(BasicBlock *BB);
-
- void RemoveDeadBinaryOp(Value *V);
- };
-
- char Reassociate::ID = 0;
- RegisterPass<Reassociate> X("reassociate", "Reassociate expressions");
-}
-
-// Public interface to the Reassociate pass
-FunctionPass *llvm::createReassociatePass() { return new Reassociate(); }
-
-void Reassociate::RemoveDeadBinaryOp(Value *V) {
- Instruction *Op = dyn_cast<Instruction>(V);
- if (!Op || !isa<BinaryOperator>(Op) || !isa<CmpInst>(Op) || !Op->use_empty())
- return;
-
- Value *LHS = Op->getOperand(0), *RHS = Op->getOperand(1);
- RemoveDeadBinaryOp(LHS);
- RemoveDeadBinaryOp(RHS);
-}
-
-
-static bool isUnmovableInstruction(Instruction *I) {
- if (I->getOpcode() == Instruction::PHI ||
- I->getOpcode() == Instruction::Alloca ||
- I->getOpcode() == Instruction::Load ||
- I->getOpcode() == Instruction::Malloc ||
- I->getOpcode() == Instruction::Invoke ||
- I->getOpcode() == Instruction::Call ||
- I->getOpcode() == Instruction::UDiv ||
- I->getOpcode() == Instruction::SDiv ||
- I->getOpcode() == Instruction::FDiv ||
- I->getOpcode() == Instruction::URem ||
- I->getOpcode() == Instruction::SRem ||
- I->getOpcode() == Instruction::FRem)
- return true;
- return false;
-}
-
-void Reassociate::BuildRankMap(Function &F) {
- unsigned i = 2;
-
- // Assign distinct ranks to function arguments
- for (Function::arg_iterator I = F.arg_begin(), E = F.arg_end(); I != E; ++I)
- ValueRankMap[I] = ++i;
-
- ReversePostOrderTraversal<Function*> RPOT(&F);
- for (ReversePostOrderTraversal<Function*>::rpo_iterator I = RPOT.begin(),
- E = RPOT.end(); I != E; ++I) {
- BasicBlock *BB = *I;
- unsigned BBRank = RankMap[BB] = ++i << 16;
-
- // Walk the basic block, adding precomputed ranks for any instructions that
- // we cannot move. This ensures that the ranks for these instructions are
- // all different in the block.
- for (BasicBlock::iterator I = BB->begin(), E = BB->end(); I != E; ++I)
- if (isUnmovableInstruction(I))
- ValueRankMap[I] = ++BBRank;
- }
-}
-
-unsigned Reassociate::getRank(Value *V) {
- if (isa<Argument>(V)) return ValueRankMap[V]; // Function argument...
-
- Instruction *I = dyn_cast<Instruction>(V);
- if (I == 0) return 0; // Otherwise it's a global or constant, rank 0.
-
- unsigned &CachedRank = ValueRankMap[I];
- if (CachedRank) return CachedRank; // Rank already known?
-
- // If this is an expression, return the 1+MAX(rank(LHS), rank(RHS)) so that
- // we can reassociate expressions for code motion! Since we do not recurse
- // for PHI nodes, we cannot have infinite recursion here, because there
- // cannot be loops in the value graph that do not go through PHI nodes.
- unsigned Rank = 0, MaxRank = RankMap[I->getParent()];
- for (unsigned i = 0, e = I->getNumOperands();
- i != e && Rank != MaxRank; ++i)
- Rank = std::max(Rank, getRank(I->getOperand(i)));
-
- // If this is a not or neg instruction, do not count it for rank. This
- // assures us that X and ~X will have the same rank.
- if (!I->getType()->isInteger() ||
- (!BinaryOperator::isNot(I) && !BinaryOperator::isNeg(I)))
- ++Rank;
-
- //DOUT << "Calculated Rank[" << V->getName() << "] = "
- // << Rank << "\n";
-
- return CachedRank = Rank;
-}
-
-/// isReassociableOp - Return true if V is an instruction of the specified
-/// opcode and if it only has one use.
-static BinaryOperator *isReassociableOp(Value *V, unsigned Opcode) {
- if ((V->hasOneUse() || V->use_empty()) && isa<Instruction>(V) &&
- cast<Instruction>(V)->getOpcode() == Opcode)
- return cast<BinaryOperator>(V);
- return 0;
-}
-
-/// LowerNegateToMultiply - Replace 0-X with X*-1.
-///
-static Instruction *LowerNegateToMultiply(Instruction *Neg) {
- Constant *Cst = ConstantInt::getAllOnesValue(Neg->getType());
-
- Instruction *Res = BinaryOperator::createMul(Neg->getOperand(1), Cst, "",Neg);
- Res->takeName(Neg);
- Neg->replaceAllUsesWith(Res);
- Neg->eraseFromParent();
- return Res;
-}
-
-// Given an expression of the form '(A+B)+(D+C)', turn it into '(((A+B)+C)+D)'.
-// Note that if D is also part of the expression tree that we recurse to
-// linearize it as well. Besides that case, this does not recurse into A,B, or
-// C.
-void Reassociate::LinearizeExpr(BinaryOperator *I) {
- BinaryOperator *LHS = cast<BinaryOperator>(I->getOperand(0));
- BinaryOperator *RHS = cast<BinaryOperator>(I->getOperand(1));
- assert(isReassociableOp(LHS, I->getOpcode()) &&
- isReassociableOp(RHS, I->getOpcode()) &&
- "Not an expression that needs linearization?");
-
- DOUT << "Linear" << *LHS << *RHS << *I;
-
- // Move the RHS instruction to live immediately before I, avoiding breaking
- // dominator properties.
- RHS->moveBefore(I);
-
- // Move operands around to do the linearization.
- I->setOperand(1, RHS->getOperand(0));
- RHS->setOperand(0, LHS);
- I->setOperand(0, RHS);
-
- ++NumLinear;
- MadeChange = true;
- DOUT << "Linearized: " << *I;
-
- // If D is part of this expression tree, tail recurse.
- if (isReassociableOp(I->getOperand(1), I->getOpcode()))
- LinearizeExpr(I);
-}
-
-
-/// LinearizeExprTree - Given an associative binary expression tree, traverse
-/// all of the uses putting it into canonical form. This forces a left-linear
-/// form of the the expression (((a+b)+c)+d), and collects information about the
-/// rank of the non-tree operands.
-///
-/// NOTE: These intentionally destroys the expression tree operands (turning
-/// them into undef values) to reduce #uses of the values. This means that the
-/// caller MUST use something like RewriteExprTree to put the values back in.
-///
-void Reassociate::LinearizeExprTree(BinaryOperator *I,
- std::vector<ValueEntry> &Ops) {
- Value *LHS = I->getOperand(0), *RHS = I->getOperand(1);
- unsigned Opcode = I->getOpcode();
-
- // First step, linearize the expression if it is in ((A+B)+(C+D)) form.
- BinaryOperator *LHSBO = isReassociableOp(LHS, Opcode);
- BinaryOperator *RHSBO = isReassociableOp(RHS, Opcode);
-
- // If this is a multiply expression tree and it contains internal negations,
- // transform them into multiplies by -1 so they can be reassociated.
- if (I->getOpcode() == Instruction::Mul) {
- if (!LHSBO && LHS->hasOneUse() && BinaryOperator::isNeg(LHS)) {
- LHS = LowerNegateToMultiply(cast<Instruction>(LHS));
- LHSBO = isReassociableOp(LHS, Opcode);
- }
- if (!RHSBO && RHS->hasOneUse() && BinaryOperator::isNeg(RHS)) {
- RHS = LowerNegateToMultiply(cast<Instruction>(RHS));
- RHSBO = isReassociableOp(RHS, Opcode);
- }
- }
-
- if (!LHSBO) {
- if (!RHSBO) {
- // Neither the LHS or RHS as part of the tree, thus this is a leaf. As
- // such, just remember these operands and their rank.
- Ops.push_back(ValueEntry(getRank(LHS), LHS));
- Ops.push_back(ValueEntry(getRank(RHS), RHS));
-
- // Clear the leaves out.
- I->setOperand(0, UndefValue::get(I->getType()));
- I->setOperand(1, UndefValue::get(I->getType()));
- return;
- } else {
- // Turn X+(Y+Z) -> (Y+Z)+X
- std::swap(LHSBO, RHSBO);
- std::swap(LHS, RHS);
- bool Success = !I->swapOperands();
- assert(Success && "swapOperands failed");
- MadeChange = true;
- }
- } else if (RHSBO) {
- // Turn (A+B)+(C+D) -> (((A+B)+C)+D). This guarantees the the RHS is not
- // part of the expression tree.
- LinearizeExpr(I);
- LHS = LHSBO = cast<BinaryOperator>(I->getOperand(0));
- RHS = I->getOperand(1);
- RHSBO = 0;
- }
-
- // Okay, now we know that the LHS is a nested expression and that the RHS is
- // not. Perform reassociation.
- assert(!isReassociableOp(RHS, Opcode) && "LinearizeExpr failed!");
-
- // Move LHS right before I to make sure that the tree expression dominates all
- // values.
- LHSBO->moveBefore(I);
-
- // Linearize the expression tree on the LHS.
- LinearizeExprTree(LHSBO, Ops);
-
- // Remember the RHS operand and its rank.
- Ops.push_back(ValueEntry(getRank(RHS), RHS));
-
- // Clear the RHS leaf out.
- I->setOperand(1, UndefValue::get(I->getType()));
-}
-
-// RewriteExprTree - Now that the operands for this expression tree are
-// linearized and optimized, emit them in-order. This function is written to be
-// tail recursive.
-void Reassociate::RewriteExprTree(BinaryOperator *I,
- std::vector<ValueEntry> &Ops,
- unsigned i) {
- if (i+2 == Ops.size()) {
- if (I->getOperand(0) != Ops[i].Op ||
- I->getOperand(1) != Ops[i+1].Op) {
- Value *OldLHS = I->getOperand(0);
- DOUT << "RA: " << *I;
- I->setOperand(0, Ops[i].Op);
- I->setOperand(1, Ops[i+1].Op);
- DOUT << "TO: " << *I;
- MadeChange = true;
- ++NumChanged;
-
- // If we reassociated a tree to fewer operands (e.g. (1+a+2) -> (a+3)
- // delete the extra, now dead, nodes.
- RemoveDeadBinaryOp(OldLHS);
- }
- return;
- }
- assert(i+2 < Ops.size() && "Ops index out of range!");
-
- if (I->getOperand(1) != Ops[i].Op) {
- DOUT << "RA: " << *I;
- I->setOperand(1, Ops[i].Op);
- DOUT << "TO: " << *I;
- MadeChange = true;
- ++NumChanged;
- }
-
- BinaryOperator *LHS = cast<BinaryOperator>(I->getOperand(0));
- assert(LHS->getOpcode() == I->getOpcode() &&
- "Improper expression tree!");
-
- // Compactify the tree instructions together with each other to guarantee
- // that the expression tree is dominated by all of Ops.
- LHS->moveBefore(I);
- RewriteExprTree(LHS, Ops, i+1);
-}
-
-
-
-// NegateValue - Insert instructions before the instruction pointed to by BI,
-// that computes the negative version of the value specified. The negative
-// version of the value is returned, and BI is left pointing at the instruction
-// that should be processed next by the reassociation pass.
-//
-static Value *NegateValue(Value *V, Instruction *BI) {
- // We are trying to expose opportunity for reassociation. One of the things
- // that we want to do to achieve this is to push a negation as deep into an
- // expression chain as possible, to expose the add instructions. In practice,
- // this means that we turn this:
- // X = -(A+12+C+D) into X = -A + -12 + -C + -D = -12 + -A + -C + -D
- // so that later, a: Y = 12+X could get reassociated with the -12 to eliminate
- // the constants. We assume that instcombine will clean up the mess later if
- // we introduce tons of unnecessary negation instructions...
- //
- if (Instruction *I = dyn_cast<Instruction>(V))
- if (I->getOpcode() == Instruction::Add && I->hasOneUse()) {
- // Push the negates through the add.
- I->setOperand(0, NegateValue(I->getOperand(0), BI));
- I->setOperand(1, NegateValue(I->getOperand(1), BI));
-
- // We must move the add instruction here, because the neg instructions do
- // not dominate the old add instruction in general. By moving it, we are
- // assured that the neg instructions we just inserted dominate the
- // instruction we are about to insert after them.
- //
- I->moveBefore(BI);
- I->setName(I->getName()+".neg");
- return I;
- }
-
- // Insert a 'neg' instruction that subtracts the value from zero to get the
- // negation.
- //
- return BinaryOperator::createNeg(V, V->getName() + ".neg", BI);
-}
-
-/// ShouldBreakUpSubtract - Return true if we should break up this subtract of
-/// X-Y into (X + -Y).
-static bool ShouldBreakUpSubtract(Instruction *Sub) {
- // If this is a negation, we can't split it up!
- if (BinaryOperator::isNeg(Sub))
- return false;
-
- // Don't bother to break this up unless either the LHS is an associable add or
- // subtract or if this is only used by one.
- if (isReassociableOp(Sub->getOperand(0), Instruction::Add) ||
- isReassociableOp(Sub->getOperand(0), Instruction::Sub))
- return true;
- if (isReassociableOp(Sub->getOperand(1), Instruction::Add) ||
- isReassociableOp(Sub->getOperand(1), Instruction::Sub))
- return true;
- if (Sub->hasOneUse() &&
- (isReassociableOp(Sub->use_back(), Instruction::Add) ||
- isReassociableOp(Sub->use_back(), Instruction::Sub)))
- return true;
-
- return false;
-}
-
-/// BreakUpSubtract - If we have (X-Y), and if either X is an add, or if this is
-/// only used by an add, transform this into (X+(0-Y)) to promote better
-/// reassociation.
-static Instruction *BreakUpSubtract(Instruction *Sub) {
- // Convert a subtract into an add and a neg instruction... so that sub
- // instructions can be commuted with other add instructions...
- //
- // Calculate the negative value of Operand 1 of the sub instruction...
- // and set it as the RHS of the add instruction we just made...
- //
- Value *NegVal = NegateValue(Sub->getOperand(1), Sub);
- Instruction *New =
- BinaryOperator::createAdd(Sub->getOperand(0), NegVal, "", Sub);
- New->takeName(Sub);
-
- // Everyone now refers to the add instruction.
- Sub->replaceAllUsesWith(New);
- Sub->eraseFromParent();
-
- DOUT << "Negated: " << *New;
- return New;
-}
-
-/// ConvertShiftToMul - If this is a shift of a reassociable multiply or is used
-/// by one, change this into a multiply by a constant to assist with further
-/// reassociation.
-static Instruction *ConvertShiftToMul(Instruction *Shl) {
- // If an operand of this shift is a reassociable multiply, or if the shift
- // is used by a reassociable multiply or add, turn into a multiply.
- if (isReassociableOp(Shl->getOperand(0), Instruction::Mul) ||
- (Shl->hasOneUse() &&
- (isReassociableOp(Shl->use_back(), Instruction::Mul) ||
- isReassociableOp(Shl->use_back(), Instruction::Add)))) {
- Constant *MulCst = ConstantInt::get(Shl->getType(), 1);
- MulCst = ConstantExpr::getShl(MulCst, cast<Constant>(Shl->getOperand(1)));
-
- Instruction *Mul = BinaryOperator::createMul(Shl->getOperand(0), MulCst,
- "", Shl);
- Mul->takeName(Shl);
- Shl->replaceAllUsesWith(Mul);
- Shl->eraseFromParent();
- return Mul;
- }
- return 0;
-}
-
-// Scan backwards and forwards among values with the same rank as element i to
-// see if X exists. If X does not exist, return i.
-static unsigned FindInOperandList(std::vector<ValueEntry> &Ops, unsigned i,
- Value *X) {
- unsigned XRank = Ops[i].Rank;
- unsigned e = Ops.size();
- for (unsigned j = i+1; j != e && Ops[j].Rank == XRank; ++j)
- if (Ops[j].Op == X)
- return j;
- // Scan backwards
- for (unsigned j = i-1; j != ~0U && Ops[j].Rank == XRank; --j)
- if (Ops[j].Op == X)
- return j;
- return i;
-}
-
-/// EmitAddTreeOfValues - Emit a tree of add instructions, summing Ops together
-/// and returning the result. Insert the tree before I.
-static Value *EmitAddTreeOfValues(Instruction *I, std::vector<Value*> &Ops) {
- if (Ops.size() == 1) return Ops.back();
-
- Value *V1 = Ops.back();
- Ops.pop_back();
- Value *V2 = EmitAddTreeOfValues(I, Ops);
- return BinaryOperator::createAdd(V2, V1, "tmp", I);
-}
-
-/// RemoveFactorFromExpression - If V is an expression tree that is a
-/// multiplication sequence, and if this sequence contains a multiply by Factor,
-/// remove Factor from the tree and return the new tree.
-Value *Reassociate::RemoveFactorFromExpression(Value *V, Value *Factor) {
- BinaryOperator *BO = isReassociableOp(V, Instruction::Mul);
- if (!BO) return 0;
-
- std::vector<ValueEntry> Factors;
- LinearizeExprTree(BO, Factors);
-
- bool FoundFactor = false;
- for (unsigned i = 0, e = Factors.size(); i != e; ++i)
- if (Factors[i].Op == Factor) {
- FoundFactor = true;
- Factors.erase(Factors.begin()+i);
- break;
- }
- if (!FoundFactor) {
- // Make sure to restore the operands to the expression tree.
- RewriteExprTree(BO, Factors);
- return 0;
- }
-
- if (Factors.size() == 1) return Factors[0].Op;
-
- RewriteExprTree(BO, Factors);
- return BO;
-}
-
-/// FindSingleUseMultiplyFactors - If V is a single-use multiply, recursively
-/// add its operands as factors, otherwise add V to the list of factors.
-static void FindSingleUseMultiplyFactors(Value *V,
- std::vector<Value*> &Factors) {
- BinaryOperator *BO;
- if ((!V->hasOneUse() && !V->use_empty()) ||
- !(BO = dyn_cast<BinaryOperator>(V)) ||
- BO->getOpcode() != Instruction::Mul) {
- Factors.push_back(V);
- return;
- }
-
- // Otherwise, add the LHS and RHS to the list of factors.
- FindSingleUseMultiplyFactors(BO->getOperand(1), Factors);
- FindSingleUseMultiplyFactors(BO->getOperand(0), Factors);
-}
-
-
-
-Value *Reassociate::OptimizeExpression(BinaryOperator *I,
- std::vector<ValueEntry> &Ops) {
- // Now that we have the linearized expression tree, try to optimize it.
- // Start by folding any constants that we found.
- bool IterateOptimization = false;
- if (Ops.size() == 1) return Ops[0].Op;
-
- unsigned Opcode = I->getOpcode();
-
- if (Constant *V1 = dyn_cast<Constant>(Ops[Ops.size()-2].Op))
- if (Constant *V2 = dyn_cast<Constant>(Ops.back().Op)) {
- Ops.pop_back();
- Ops.back().Op = ConstantExpr::get(Opcode, V1, V2);
- return OptimizeExpression(I, Ops);
- }
-
- // Check for destructive annihilation due to a constant being used.
- if (ConstantInt *CstVal = dyn_cast<ConstantInt>(Ops.back().Op))
- switch (Opcode) {
- default: break;
- case Instruction::And:
- if (CstVal->isZero()) { // ... & 0 -> 0
- ++NumAnnihil;
- return CstVal;
- } else if (CstVal->isAllOnesValue()) { // ... & -1 -> ...
- Ops.pop_back();
- }
- break;
- case Instruction::Mul:
- if (CstVal->isZero()) { // ... * 0 -> 0
- ++NumAnnihil;
- return CstVal;
- } else if (cast<ConstantInt>(CstVal)->isOne()) {
- Ops.pop_back(); // ... * 1 -> ...
- }
- break;
- case Instruction::Or:
- if (CstVal->isAllOnesValue()) { // ... | -1 -> -1
- ++NumAnnihil;
- return CstVal;
- }
- // FALLTHROUGH!
- case Instruction::Add:
- case Instruction::Xor:
- if (CstVal->isZero()) // ... [|^+] 0 -> ...
- Ops.pop_back();
- break;
- }
- if (Ops.size() == 1) return Ops[0].Op;
-
- // Handle destructive annihilation do to identities between elements in the
- // argument list here.
- switch (Opcode) {
- default: break;
- case Instruction::And:
- case Instruction::Or:
- case Instruction::Xor:
- // Scan the operand lists looking for X and ~X pairs, along with X,X pairs.
- // If we find any, we can simplify the expression. X&~X == 0, X|~X == -1.
- for (unsigned i = 0, e = Ops.size(); i != e; ++i) {
- // First, check for X and ~X in the operand list.
- assert(i < Ops.size());
- if (BinaryOperator::isNot(Ops[i].Op)) { // Cannot occur for ^.
- Value *X = BinaryOperator::getNotArgument(Ops[i].Op);
- unsigned FoundX = FindInOperandList(Ops, i, X);
- if (FoundX != i) {
- if (Opcode == Instruction::And) { // ...&X&~X = 0
- ++NumAnnihil;
- return Constant::getNullValue(X->getType());
- } else if (Opcode == Instruction::Or) { // ...|X|~X = -1
- ++NumAnnihil;
- return ConstantInt::getAllOnesValue(X->getType());
- }
- }
- }
-
- // Next, check for duplicate pairs of values, which we assume are next to
- // each other, due to our sorting criteria.
- assert(i < Ops.size());
- if (i+1 != Ops.size() && Ops[i+1].Op == Ops[i].Op) {
- if (Opcode == Instruction::And || Opcode == Instruction::Or) {
- // Drop duplicate values.
- Ops.erase(Ops.begin()+i);
- --i; --e;
- IterateOptimization = true;
- ++NumAnnihil;
- } else {
- assert(Opcode == Instruction::Xor);
- if (e == 2) {
- ++NumAnnihil;
- return Constant::getNullValue(Ops[0].Op->getType());
- }
- // ... X^X -> ...
- Ops.erase(Ops.begin()+i, Ops.begin()+i+2);
- i -= 1; e -= 2;
- IterateOptimization = true;
- ++NumAnnihil;
- }
- }
- }
- break;
-
- case Instruction::Add:
- // Scan the operand lists looking for X and -X pairs. If we find any, we
- // can simplify the expression. X+-X == 0.
- for (unsigned i = 0, e = Ops.size(); i != e; ++i) {
- assert(i < Ops.size());
- // Check for X and -X in the operand list.
- if (BinaryOperator::isNeg(Ops[i].Op)) {
- Value *X = BinaryOperator::getNegArgument(Ops[i].Op);
- unsigned FoundX = FindInOperandList(Ops, i, X);
- if (FoundX != i) {
- // Remove X and -X from the operand list.
- if (Ops.size() == 2) {
- ++NumAnnihil;
- return Constant::getNullValue(X->getType());
- } else {
- Ops.erase(Ops.begin()+i);
- if (i < FoundX)
- --FoundX;
- else
- --i; // Need to back up an extra one.
- Ops.erase(Ops.begin()+FoundX);
- IterateOptimization = true;
- ++NumAnnihil;
- --i; // Revisit element.
- e -= 2; // Removed two elements.
- }
- }
- }
- }
-
-
- // Scan the operand list, checking to see if there are any common factors
- // between operands. Consider something like A*A+A*B*C+D. We would like to
- // reassociate this to A*(A+B*C)+D, which reduces the number of multiplies.
- // To efficiently find this, we count the number of times a factor occurs
- // for any ADD operands that are MULs.
- std::map<Value*, unsigned> FactorOccurrences;
- unsigned MaxOcc = 0;
- Value *MaxOccVal = 0;
- for (unsigned i = 0, e = Ops.size(); i != e; ++i) {
- if (BinaryOperator *BOp = dyn_cast<BinaryOperator>(Ops[i].Op)) {
- if (BOp->getOpcode() == Instruction::Mul && BOp->use_empty()) {
- // Compute all of the factors of this added value.
- std::vector<Value*> Factors;
- FindSingleUseMultiplyFactors(BOp, Factors);
- assert(Factors.size() > 1 && "Bad linearize!");
-
- // Add one to FactorOccurrences for each unique factor in this op.
- if (Factors.size() == 2) {
- unsigned Occ = ++FactorOccurrences[Factors[0]];
- if (Occ > MaxOcc) { MaxOcc = Occ; MaxOccVal = Factors[0]; }
- if (Factors[0] != Factors[1]) { // Don't double count A*A.
- Occ = ++FactorOccurrences[Factors[1]];
- if (Occ > MaxOcc) { MaxOcc = Occ; MaxOccVal = Factors[1]; }
- }
- } else {
- std::set<Value*> Duplicates;
- for (unsigned i = 0, e = Factors.size(); i != e; ++i) {
- if (Duplicates.insert(Factors[i]).second) {
- unsigned Occ = ++FactorOccurrences[Factors[i]];
- if (Occ > MaxOcc) { MaxOcc = Occ; MaxOccVal = Factors[i]; }
- }
- }
- }
- }
- }
- }
-
- // If any factor occurred more than one time, we can pull it out.
- if (MaxOcc > 1) {
- DOUT << "\nFACTORING [" << MaxOcc << "]: " << *MaxOccVal << "\n";
-
- // Create a new instruction that uses the MaxOccVal twice. If we don't do
- // this, we could otherwise run into situations where removing a factor
- // from an expression will drop a use of maxocc, and this can cause
- // RemoveFactorFromExpression on successive values to behave differently.
- Instruction *DummyInst = BinaryOperator::createAdd(MaxOccVal, MaxOccVal);
- std::vector<Value*> NewMulOps;
- for (unsigned i = 0, e = Ops.size(); i != e; ++i) {
- if (Value *V = RemoveFactorFromExpression(Ops[i].Op, MaxOccVal)) {
- NewMulOps.push_back(V);
- Ops.erase(Ops.begin()+i);
- --i; --e;
- }
- }
-
- // No need for extra uses anymore.
- delete DummyInst;
-
- unsigned NumAddedValues = NewMulOps.size();
- Value *V = EmitAddTreeOfValues(I, NewMulOps);
- Value *V2 = BinaryOperator::createMul(V, MaxOccVal, "tmp", I);
-
- // Now that we have inserted V and its sole use, optimize it. This allows
- // us to handle cases that require multiple factoring steps, such as this:
- // A*A*B + A*A*C --> A*(A*B+A*C) --> A*(A*(B+C))
- if (NumAddedValues > 1)
- ReassociateExpression(cast<BinaryOperator>(V));
-
- ++NumFactor;
-
- if (Ops.empty())
- return V2;
-
- // Add the new value to the list of things being added.
- Ops.insert(Ops.begin(), ValueEntry(getRank(V2), V2));
-
- // Rewrite the tree so that there is now a use of V.
- RewriteExprTree(I, Ops);
- return OptimizeExpression(I, Ops);
- }
- break;
- //case Instruction::Mul:
- }
-
- if (IterateOptimization)
- return OptimizeExpression(I, Ops);
- return 0;
-}
-
-
-/// ReassociateBB - Inspect all of the instructions in this basic block,
-/// reassociating them as we go.
-void Reassociate::ReassociateBB(BasicBlock *BB) {
- for (BasicBlock::iterator BBI = BB->begin(); BBI != BB->end(); ) {
- Instruction *BI = BBI++;
- if (BI->getOpcode() == Instruction::Shl &&
- isa<ConstantInt>(BI->getOperand(1)))
- if (Instruction *NI = ConvertShiftToMul(BI)) {
- MadeChange = true;
- BI = NI;
- }
-
- // Reject cases where it is pointless to do this.
- if (!isa<BinaryOperator>(BI) || BI->getType()->isFloatingPoint() ||
- isa<VectorType>(BI->getType()))
- continue; // Floating point ops are not associative.
-
- // If this is a subtract instruction which is not already in negate form,
- // see if we can convert it to X+-Y.
- if (BI->getOpcode() == Instruction::Sub) {
- if (ShouldBreakUpSubtract(BI)) {
- BI = BreakUpSubtract(BI);
- MadeChange = true;
- } else if (BinaryOperator::isNeg(BI)) {
- // Otherwise, this is a negation. See if the operand is a multiply tree
- // and if this is not an inner node of a multiply tree.
- if (isReassociableOp(BI->getOperand(1), Instruction::Mul) &&
- (!BI->hasOneUse() ||
- !isReassociableOp(BI->use_back(), Instruction::Mul))) {
- BI = LowerNegateToMultiply(BI);
- MadeChange = true;
- }
- }
- }
-
- // If this instruction is a commutative binary operator, process it.
- if (!BI->isAssociative()) continue;
- BinaryOperator *I = cast<BinaryOperator>(BI);
-
- // If this is an interior node of a reassociable tree, ignore it until we
- // get to the root of the tree, to avoid N^2 analysis.
- if (I->hasOneUse() && isReassociableOp(I->use_back(), I->getOpcode()))
- continue;
-
- // If this is an add tree that is used by a sub instruction, ignore it
- // until we process the subtract.
- if (I->hasOneUse() && I->getOpcode() == Instruction::Add &&
- cast<Instruction>(I->use_back())->getOpcode() == Instruction::Sub)
- continue;
-
- ReassociateExpression(I);
- }
-}
-
-void Reassociate::ReassociateExpression(BinaryOperator *I) {
-
- // First, walk the expression tree, linearizing the tree, collecting
- std::vector<ValueEntry> Ops;
- LinearizeExprTree(I, Ops);
-
- DOUT << "RAIn:\t"; DEBUG(PrintOps(I, Ops)); DOUT << "\n";
-
- // Now that we have linearized the tree to a list and have gathered all of
- // the operands and their ranks, sort the operands by their rank. Use a
- // stable_sort so that values with equal ranks will have their relative
- // positions maintained (and so the compiler is deterministic). Note that
- // this sorts so that the highest ranking values end up at the beginning of
- // the vector.
- std::stable_sort(Ops.begin(), Ops.end());
-
- // OptimizeExpression - Now that we have the expression tree in a convenient
- // sorted form, optimize it globally if possible.
- if (Value *V = OptimizeExpression(I, Ops)) {
- // This expression tree simplified to something that isn't a tree,
- // eliminate it.
- DOUT << "Reassoc to scalar: " << *V << "\n";
- I->replaceAllUsesWith(V);
- RemoveDeadBinaryOp(I);
- return;
- }
-
- // We want to sink immediates as deeply as possible except in the case where
- // this is a multiply tree used only by an add, and the immediate is a -1.
- // In this case we reassociate to put the negation on the outside so that we
- // can fold the negation into the add: (-X)*Y + Z -> Z-X*Y
- if (I->getOpcode() == Instruction::Mul && I->hasOneUse() &&
- cast<Instruction>(I->use_back())->getOpcode() == Instruction::Add &&
- isa<ConstantInt>(Ops.back().Op) &&
- cast<ConstantInt>(Ops.back().Op)->isAllOnesValue()) {
- Ops.insert(Ops.begin(), Ops.back());
- Ops.pop_back();
- }
-
- DOUT << "RAOut:\t"; DEBUG(PrintOps(I, Ops)); DOUT << "\n";
-
- if (Ops.size() == 1) {
- // This expression tree simplified to something that isn't a tree,
- // eliminate it.
- I->replaceAllUsesWith(Ops[0].Op);
- RemoveDeadBinaryOp(I);
- } else {
- // Now that we ordered and optimized the expressions, splat them back into
- // the expression tree, removing any unneeded nodes.
- RewriteExprTree(I, Ops);
- }
-}
-
-
-bool Reassociate::runOnFunction(Function &F) {
- // Recalculate the rank map for F
- BuildRankMap(F);
-
- MadeChange = false;
- for (Function::iterator FI = F.begin(), FE = F.end(); FI != FE; ++FI)
- ReassociateBB(FI);
-
- // We are done with the rank map...
- RankMap.clear();
- ValueRankMap.clear();
- return MadeChange;
-}
-
diff --git a/release_23/lib/Transforms/Scalar/Reg2Mem.cpp b/release_23/lib/Transforms/Scalar/Reg2Mem.cpp
deleted file mode 100644
index eda0c0e93a19..000000000000
--- a/release_23/lib/Transforms/Scalar/Reg2Mem.cpp
+++ /dev/null
@@ -1,124 +0,0 @@
-//===- Reg2Mem.cpp - Convert registers to allocas -------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file demotes all registers to memory references. It is intented to be
-// the inverse of PromoteMemoryToRegister. By converting to loads, the only
-// values live accross basic blocks are allocas and loads before phi nodes.
-// It is intended that this should make CFG hacking much easier.
-// To make later hacking easier, the entry block is split into two, such that
-// all introduced allocas and nothing else are in the entry block.
-//
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "reg2mem"
-#include "llvm/Transforms/Scalar.h"
-#include "llvm/Transforms/Utils/Local.h"
-#include "llvm/Pass.h"
-#include "llvm/Function.h"
-#include "llvm/Module.h"
-#include "llvm/BasicBlock.h"
-#include "llvm/Instructions.h"
-#include "llvm/ADT/Statistic.h"
-#include "llvm/Support/Compiler.h"
-#include "llvm/Support/CFG.h"
-#include <list>
-using namespace llvm;
-
-STATISTIC(NumRegsDemoted, "Number of registers demoted");
-STATISTIC(NumPhisDemoted, "Number of phi-nodes demoted");
-
-namespace {
- struct VISIBILITY_HIDDEN RegToMem : public FunctionPass {
- static char ID; // Pass identification, replacement for typeid
- RegToMem() : FunctionPass((intptr_t)&ID) {}
-
- virtual void getAnalysisUsage(AnalysisUsage &AU) const {
- AU.addRequiredID(BreakCriticalEdgesID);
- AU.addPreservedID(BreakCriticalEdgesID);
- }
-
- bool valueEscapes(Instruction* i) {
- BasicBlock* bb = i->getParent();
- for (Value::use_iterator ii = i->use_begin(), ie = i->use_end();
- ii != ie; ++ii)
- if (cast<Instruction>(*ii)->getParent() != bb ||
- isa<PHINode>(*ii))
- return true;
- return false;
- }
-
- virtual bool runOnFunction(Function &F) {
- if (!F.isDeclaration()) {
- // Insert all new allocas into entry block.
- BasicBlock* BBEntry = &F.getEntryBlock();
- assert(pred_begin(BBEntry) == pred_end(BBEntry) &&
- "Entry block to function must not have predecessors!");
-
- // Find first non-alloca instruction and create insertion point. This is
- // safe if block is well-formed: it always have terminator, otherwise
- // we'll get and assertion.
- BasicBlock::iterator I = BBEntry->begin();
- while (isa<AllocaInst>(I)) ++I;
-
- CastInst *AllocaInsertionPoint =
- CastInst::create(Instruction::BitCast,
- Constant::getNullValue(Type::Int32Ty), Type::Int32Ty,
- "reg2mem alloca point", I);
-
- // Find the escaped instructions. But don't create stack slots for
- // allocas in entry block.
- std::list<Instruction*> worklist;
- for (Function::iterator ibb = F.begin(), ibe = F.end();
- ibb != ibe; ++ibb)
- for (BasicBlock::iterator iib = ibb->begin(), iie = ibb->end();
- iib != iie; ++iib) {
- if (!(isa<AllocaInst>(iib) && iib->getParent() == BBEntry) &&
- valueEscapes(iib)) {
- worklist.push_front(&*iib);
- }
- }
-
- // Demote escaped instructions
- NumRegsDemoted += worklist.size();
- for (std::list<Instruction*>::iterator ilb = worklist.begin(),
- ile = worklist.end(); ilb != ile; ++ilb)
- DemoteRegToStack(**ilb, false, AllocaInsertionPoint);
-
- worklist.clear();
-
- // Find all phi's
- for (Function::iterator ibb = F.begin(), ibe = F.end();
- ibb != ibe; ++ibb)
- for (BasicBlock::iterator iib = ibb->begin(), iie = ibb->end();
- iib != iie; ++iib)
- if (isa<PHINode>(iib))
- worklist.push_front(&*iib);
-
- // Demote phi nodes
- NumPhisDemoted += worklist.size();
- for (std::list<Instruction*>::iterator ilb = worklist.begin(),
- ile = worklist.end(); ilb != ile; ++ilb)
- DemotePHIToStack(cast<PHINode>(*ilb), AllocaInsertionPoint);
-
- return true;
- }
- return false;
- }
- };
-
- char RegToMem::ID = 0;
- RegisterPass<RegToMem> X("reg2mem", "Demote all values to stack slots");
-}
-
-// createDemoteRegisterToMemory - Provide an entry point to create this pass.
-//
-const PassInfo *llvm::DemoteRegisterToMemoryID = X.getPassInfo();
-FunctionPass *llvm::createDemoteRegisterToMemoryPass() {
- return new RegToMem();
-}
diff --git a/release_23/lib/Transforms/Scalar/SCCP.cpp b/release_23/lib/Transforms/Scalar/SCCP.cpp
deleted file mode 100644
index be071f8b1fa5..000000000000
--- a/release_23/lib/Transforms/Scalar/SCCP.cpp
+++ /dev/null
@@ -1,1799 +0,0 @@
-//===- SCCP.cpp - Sparse Conditional Constant Propagation -----------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements sparse conditional constant propagation and merging:
-//
-// Specifically, this:
-// * Assumes values are constant unless proven otherwise
-// * Assumes BasicBlocks are dead unless proven otherwise
-// * Proves values to be constant, and replaces them with constants
-// * Proves conditional branches to be unconditional
-//
-// Notice that:
-// * This pass has a habit of making definitions be dead. It is a good idea
-// to to run a DCE pass sometime after running this pass.
-//
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "sccp"
-#include "llvm/Transforms/Scalar.h"
-#include "llvm/Transforms/IPO.h"
-#include "llvm/Constants.h"
-#include "llvm/DerivedTypes.h"
-#include "llvm/Instructions.h"
-#include "llvm/Pass.h"
-#include "llvm/Analysis/ConstantFolding.h"
-#include "llvm/Transforms/Utils/Local.h"
-#include "llvm/Support/CallSite.h"
-#include "llvm/Support/Compiler.h"
-#include "llvm/Support/Debug.h"
-#include "llvm/Support/InstVisitor.h"
-#include "llvm/ADT/DenseMap.h"
-#include "llvm/ADT/SmallSet.h"
-#include "llvm/ADT/SmallVector.h"
-#include "llvm/ADT/Statistic.h"
-#include "llvm/ADT/STLExtras.h"
-#include <algorithm>
-#include <map>
-using namespace llvm;
-
-STATISTIC(NumInstRemoved, "Number of instructions removed");
-STATISTIC(NumDeadBlocks , "Number of basic blocks unreachable");
-
-STATISTIC(IPNumInstRemoved, "Number of instructions removed by IPSCCP");
-STATISTIC(IPNumDeadBlocks , "Number of basic blocks unreachable by IPSCCP");
-STATISTIC(IPNumArgsElimed ,"Number of arguments constant propagated by IPSCCP");
-STATISTIC(IPNumGlobalConst, "Number of globals found to be constant by IPSCCP");
-
-namespace {
-/// LatticeVal class - This class represents the different lattice values that
-/// an LLVM value may occupy. It is a simple class with value semantics.
-///
-class VISIBILITY_HIDDEN LatticeVal {
- enum {
- /// undefined - This LLVM Value has no known value yet.
- undefined,
-
- /// constant - This LLVM Value has a specific constant value.
- constant,
-
- /// forcedconstant - This LLVM Value was thought to be undef until
- /// ResolvedUndefsIn. This is treated just like 'constant', but if merged
- /// with another (different) constant, it goes to overdefined, instead of
- /// asserting.
- forcedconstant,
-
- /// overdefined - This instruction is not known to be constant, and we know
- /// it has a value.
- overdefined
- } LatticeValue; // The current lattice position
-
- Constant *ConstantVal; // If Constant value, the current value
-public:
- inline LatticeVal() : LatticeValue(undefined), ConstantVal(0) {}
-
- // markOverdefined - Return true if this is a new status to be in...
- inline bool markOverdefined() {
- if (LatticeValue != overdefined) {
- LatticeValue = overdefined;
- return true;
- }
- return false;
- }
-
- // markConstant - Return true if this is a new status for us.
- inline bool markConstant(Constant *V) {
- if (LatticeValue != constant) {
- if (LatticeValue == undefined) {
- LatticeValue = constant;
- assert(V && "Marking constant with NULL");
- ConstantVal = V;
- } else {
- assert(LatticeValue == forcedconstant &&
- "Cannot move from overdefined to constant!");
- // Stay at forcedconstant if the constant is the same.
- if (V == ConstantVal) return false;
-
- // Otherwise, we go to overdefined. Assumptions made based on the
- // forced value are possibly wrong. Assuming this is another constant
- // could expose a contradiction.
- LatticeValue = overdefined;
- }
- return true;
- } else {
- assert(ConstantVal == V && "Marking constant with different value");
- }
- return false;
- }
-
- inline void markForcedConstant(Constant *V) {
- assert(LatticeValue == undefined && "Can't force a defined value!");
- LatticeValue = forcedconstant;
- ConstantVal = V;
- }
-
- inline bool isUndefined() const { return LatticeValue == undefined; }
- inline bool isConstant() const {
- return LatticeValue == constant || LatticeValue == forcedconstant;
- }
- inline bool isOverdefined() const { return LatticeValue == overdefined; }
-
- inline Constant *getConstant() const {
- assert(isConstant() && "Cannot get the constant of a non-constant!");
- return ConstantVal;
- }
-};
-
-//===----------------------------------------------------------------------===//
-//
-/// SCCPSolver - This class is a general purpose solver for Sparse Conditional
-/// Constant Propagation.
-///
-class SCCPSolver : public InstVisitor<SCCPSolver> {
- SmallSet<BasicBlock*, 16> BBExecutable;// The basic blocks that are executable
- std::map<Value*, LatticeVal> ValueState; // The state each value is in.
-
- /// GlobalValue - If we are tracking any values for the contents of a global
- /// variable, we keep a mapping from the constant accessor to the element of
- /// the global, to the currently known value. If the value becomes
- /// overdefined, it's entry is simply removed from this map.
- DenseMap<GlobalVariable*, LatticeVal> TrackedGlobals;
-
- /// TrackedRetVals - If we are tracking arguments into and the return
- /// value out of a function, it will have an entry in this map, indicating
- /// what the known return value for the function is.
- DenseMap<Function*, LatticeVal> TrackedRetVals;
-
- /// TrackedMultipleRetVals - Same as TrackedRetVals, but used for functions
- /// that return multiple values.
- std::map<std::pair<Function*, unsigned>, LatticeVal> TrackedMultipleRetVals;
-
- // The reason for two worklists is that overdefined is the lowest state
- // on the lattice, and moving things to overdefined as fast as possible
- // makes SCCP converge much faster.
- // By having a separate worklist, we accomplish this because everything
- // possibly overdefined will become overdefined at the soonest possible
- // point.
- std::vector<Value*> OverdefinedInstWorkList;
- std::vector<Value*> InstWorkList;
-
-
- std::vector<BasicBlock*> BBWorkList; // The BasicBlock work list
-
- /// UsersOfOverdefinedPHIs - Keep track of any users of PHI nodes that are not
- /// overdefined, despite the fact that the PHI node is overdefined.
- std::multimap<PHINode*, Instruction*> UsersOfOverdefinedPHIs;
-
- /// KnownFeasibleEdges - Entries in this set are edges which have already had
- /// PHI nodes retriggered.
- typedef std::pair<BasicBlock*,BasicBlock*> Edge;
- std::set<Edge> KnownFeasibleEdges;
-public:
-
- /// MarkBlockExecutable - This method can be used by clients to mark all of
- /// the blocks that are known to be intrinsically live in the processed unit.
- void MarkBlockExecutable(BasicBlock *BB) {
- DOUT << "Marking Block Executable: " << BB->getName() << "\n";
- BBExecutable.insert(BB); // Basic block is executable!
- BBWorkList.push_back(BB); // Add the block to the work list!
- }
-
- /// TrackValueOfGlobalVariable - Clients can use this method to
- /// inform the SCCPSolver that it should track loads and stores to the
- /// specified global variable if it can. This is only legal to call if
- /// performing Interprocedural SCCP.
- void TrackValueOfGlobalVariable(GlobalVariable *GV) {
- const Type *ElTy = GV->getType()->getElementType();
- if (ElTy->isFirstClassType()) {
- LatticeVal &IV = TrackedGlobals[GV];
- if (!isa<UndefValue>(GV->getInitializer()))
- IV.markConstant(GV->getInitializer());
- }
- }
-
- /// AddTrackedFunction - If the SCCP solver is supposed to track calls into
- /// and out of the specified function (which cannot have its address taken),
- /// this method must be called.
- void AddTrackedFunction(Function *F) {
- assert(F->hasInternalLinkage() && "Can only track internal functions!");
- // Add an entry, F -> undef.
- if (const StructType *STy = dyn_cast<StructType>(F->getReturnType())) {
- for (unsigned i = 0, e = STy->getNumElements(); i != e; ++i)
- TrackedMultipleRetVals.insert(std::make_pair(std::make_pair(F, i),
- LatticeVal()));
- } else
- TrackedRetVals.insert(std::make_pair(F, LatticeVal()));
- }
-
- /// Solve - Solve for constants and executable blocks.
- ///
- void Solve();
-
- /// ResolvedUndefsIn - While solving the dataflow for a function, we assume
- /// that branches on undef values cannot reach any of their successors.
- /// However, this is not a safe assumption. After we solve dataflow, this
- /// method should be use to handle this. If this returns true, the solver
- /// should be rerun.
- bool ResolvedUndefsIn(Function &F);
-
- /// getExecutableBlocks - Once we have solved for constants, return the set of
- /// blocks that is known to be executable.
- SmallSet<BasicBlock*, 16> &getExecutableBlocks() {
- return BBExecutable;
- }
-
- /// getValueMapping - Once we have solved for constants, return the mapping of
- /// LLVM values to LatticeVals.
- std::map<Value*, LatticeVal> &getValueMapping() {
- return ValueState;
- }
-
- /// getTrackedRetVals - Get the inferred return value map.
- ///
- const DenseMap<Function*, LatticeVal> &getTrackedRetVals() {
- return TrackedRetVals;
- }
-
- /// getTrackedGlobals - Get and return the set of inferred initializers for
- /// global variables.
- const DenseMap<GlobalVariable*, LatticeVal> &getTrackedGlobals() {
- return TrackedGlobals;
- }
-
- inline void markOverdefined(Value *V) {
- markOverdefined(ValueState[V], V);
- }
-
-private:
- // markConstant - Make a value be marked as "constant". If the value
- // is not already a constant, add it to the instruction work list so that
- // the users of the instruction are updated later.
- //
- inline void markConstant(LatticeVal &IV, Value *V, Constant *C) {
- if (IV.markConstant(C)) {
- DOUT << "markConstant: " << *C << ": " << *V;
- InstWorkList.push_back(V);
- }
- }
-
- inline void markForcedConstant(LatticeVal &IV, Value *V, Constant *C) {
- IV.markForcedConstant(C);
- DOUT << "markForcedConstant: " << *C << ": " << *V;
- InstWorkList.push_back(V);
- }
-
- inline void markConstant(Value *V, Constant *C) {
- markConstant(ValueState[V], V, C);
- }
-
- // markOverdefined - Make a value be marked as "overdefined". If the
- // value is not already overdefined, add it to the overdefined instruction
- // work list so that the users of the instruction are updated later.
- inline void markOverdefined(LatticeVal &IV, Value *V) {
- if (IV.markOverdefined()) {
- DEBUG(DOUT << "markOverdefined: ";
- if (Function *F = dyn_cast<Function>(V))
- DOUT << "Function '" << F->getName() << "'\n";
- else
- DOUT << *V);
- // Only instructions go on the work list
- OverdefinedInstWorkList.push_back(V);
- }
- }
-
- inline void mergeInValue(LatticeVal &IV, Value *V, LatticeVal &MergeWithV) {
- if (IV.isOverdefined() || MergeWithV.isUndefined())
- return; // Noop.
- if (MergeWithV.isOverdefined())
- markOverdefined(IV, V);
- else if (IV.isUndefined())
- markConstant(IV, V, MergeWithV.getConstant());
- else if (IV.getConstant() != MergeWithV.getConstant())
- markOverdefined(IV, V);
- }
-
- inline void mergeInValue(Value *V, LatticeVal &MergeWithV) {
- return mergeInValue(ValueState[V], V, MergeWithV);
- }
-
-
- // getValueState - Return the LatticeVal object that corresponds to the value.
- // This function is necessary because not all values should start out in the
- // underdefined state... Argument's should be overdefined, and
- // constants should be marked as constants. If a value is not known to be an
- // Instruction object, then use this accessor to get its value from the map.
- //
- inline LatticeVal &getValueState(Value *V) {
- std::map<Value*, LatticeVal>::iterator I = ValueState.find(V);
- if (I != ValueState.end()) return I->second; // Common case, in the map
-
- if (Constant *C = dyn_cast<Constant>(V)) {
- if (isa<UndefValue>(V)) {
- // Nothing to do, remain undefined.
- } else {
- LatticeVal &LV = ValueState[C];
- LV.markConstant(C); // Constants are constant
- return LV;
- }
- }
- // All others are underdefined by default...
- return ValueState[V];
- }
-
- // markEdgeExecutable - Mark a basic block as executable, adding it to the BB
- // work list if it is not already executable...
- //
- void markEdgeExecutable(BasicBlock *Source, BasicBlock *Dest) {
- if (!KnownFeasibleEdges.insert(Edge(Source, Dest)).second)
- return; // This edge is already known to be executable!
-
- if (BBExecutable.count(Dest)) {
- DOUT << "Marking Edge Executable: " << Source->getName()
- << " -> " << Dest->getName() << "\n";
-
- // The destination is already executable, but we just made an edge
- // feasible that wasn't before. Revisit the PHI nodes in the block
- // because they have potentially new operands.
- for (BasicBlock::iterator I = Dest->begin(); isa<PHINode>(I); ++I)
- visitPHINode(*cast<PHINode>(I));
-
- } else {
- MarkBlockExecutable(Dest);
- }
- }
-
- // getFeasibleSuccessors - Return a vector of booleans to indicate which
- // successors are reachable from a given terminator instruction.
- //
- void getFeasibleSuccessors(TerminatorInst &TI, SmallVector<bool, 16> &Succs);
-
- // isEdgeFeasible - Return true if the control flow edge from the 'From' basic
- // block to the 'To' basic block is currently feasible...
- //
- bool isEdgeFeasible(BasicBlock *From, BasicBlock *To);
-
- // OperandChangedState - This method is invoked on all of the users of an
- // instruction that was just changed state somehow.... Based on this
- // information, we need to update the specified user of this instruction.
- //
- void OperandChangedState(User *U) {
- // Only instructions use other variable values!
- Instruction &I = cast<Instruction>(*U);
- if (BBExecutable.count(I.getParent())) // Inst is executable?
- visit(I);
- }
-
-private:
- friend class InstVisitor<SCCPSolver>;
-
- // visit implementations - Something changed in this instruction... Either an
- // operand made a transition, or the instruction is newly executable. Change
- // the value type of I to reflect these changes if appropriate.
- //
- void visitPHINode(PHINode &I);
-
- // Terminators
- void visitReturnInst(ReturnInst &I);
- void visitTerminatorInst(TerminatorInst &TI);
-
- void visitCastInst(CastInst &I);
- void visitGetResultInst(GetResultInst &GRI);
- void visitSelectInst(SelectInst &I);
- void visitBinaryOperator(Instruction &I);
- void visitCmpInst(CmpInst &I);
- void visitExtractElementInst(ExtractElementInst &I);
- void visitInsertElementInst(InsertElementInst &I);
- void visitShuffleVectorInst(ShuffleVectorInst &I);
-
- // Instructions that cannot be folded away...
- void visitStoreInst (Instruction &I);
- void visitLoadInst (LoadInst &I);
- void visitGetElementPtrInst(GetElementPtrInst &I);
- void visitCallInst (CallInst &I) { visitCallSite(CallSite::get(&I)); }
- void visitInvokeInst (InvokeInst &II) {
- visitCallSite(CallSite::get(&II));
- visitTerminatorInst(II);
- }
- void visitCallSite (CallSite CS);
- void visitUnwindInst (TerminatorInst &I) { /*returns void*/ }
- void visitUnreachableInst(TerminatorInst &I) { /*returns void*/ }
- void visitAllocationInst(Instruction &I) { markOverdefined(&I); }
- void visitVANextInst (Instruction &I) { markOverdefined(&I); }
- void visitVAArgInst (Instruction &I) { markOverdefined(&I); }
- void visitFreeInst (Instruction &I) { /*returns void*/ }
-
- void visitInstruction(Instruction &I) {
- // If a new instruction is added to LLVM that we don't handle...
- cerr << "SCCP: Don't know how to handle: " << I;
- markOverdefined(&I); // Just in case
- }
-};
-
-} // end anonymous namespace
-
-
-// getFeasibleSuccessors - Return a vector of booleans to indicate which
-// successors are reachable from a given terminator instruction.
-//
-void SCCPSolver::getFeasibleSuccessors(TerminatorInst &TI,
- SmallVector<bool, 16> &Succs) {
- Succs.resize(TI.getNumSuccessors());
- if (BranchInst *BI = dyn_cast<BranchInst>(&TI)) {
- if (BI->isUnconditional()) {
- Succs[0] = true;
- } else {
- LatticeVal &BCValue = getValueState(BI->getCondition());
- if (BCValue.isOverdefined() ||
- (BCValue.isConstant() && !isa<ConstantInt>(BCValue.getConstant()))) {
- // Overdefined condition variables, and branches on unfoldable constant
- // conditions, mean the branch could go either way.
- Succs[0] = Succs[1] = true;
- } else if (BCValue.isConstant()) {
- // Constant condition variables mean the branch can only go a single way
- Succs[BCValue.getConstant() == ConstantInt::getFalse()] = true;
- }
- }
- } else if (isa<InvokeInst>(&TI)) {
- // Invoke instructions successors are always executable.
- Succs[0] = Succs[1] = true;
- } else if (SwitchInst *SI = dyn_cast<SwitchInst>(&TI)) {
- LatticeVal &SCValue = getValueState(SI->getCondition());
- if (SCValue.isOverdefined() || // Overdefined condition?
- (SCValue.isConstant() && !isa<ConstantInt>(SCValue.getConstant()))) {
- // All destinations are executable!
- Succs.assign(TI.getNumSuccessors(), true);
- } else if (SCValue.isConstant()) {
- Constant *CPV = SCValue.getConstant();
- // Make sure to skip the "default value" which isn't a value
- for (unsigned i = 1, E = SI->getNumSuccessors(); i != E; ++i) {
- if (SI->getSuccessorValue(i) == CPV) {// Found the right branch...
- Succs[i] = true;
- return;
- }
- }
-
- // Constant value not equal to any of the branches... must execute
- // default branch then...
- Succs[0] = true;
- }
- } else {
- assert(0 && "SCCP: Don't know how to handle this terminator!");
- }
-}
-
-
-// isEdgeFeasible - Return true if the control flow edge from the 'From' basic
-// block to the 'To' basic block is currently feasible...
-//
-bool SCCPSolver::isEdgeFeasible(BasicBlock *From, BasicBlock *To) {
- assert(BBExecutable.count(To) && "Dest should always be alive!");
-
- // Make sure the source basic block is executable!!
- if (!BBExecutable.count(From)) return false;
-
- // Check to make sure this edge itself is actually feasible now...
- TerminatorInst *TI = From->getTerminator();
- if (BranchInst *BI = dyn_cast<BranchInst>(TI)) {
- if (BI->isUnconditional())
- return true;
- else {
- LatticeVal &BCValue = getValueState(BI->getCondition());
- if (BCValue.isOverdefined()) {
- // Overdefined condition variables mean the branch could go either way.
- return true;
- } else if (BCValue.isConstant()) {
- // Not branching on an evaluatable constant?
- if (!isa<ConstantInt>(BCValue.getConstant())) return true;
-
- // Constant condition variables mean the branch can only go a single way
- return BI->getSuccessor(BCValue.getConstant() ==
- ConstantInt::getFalse()) == To;
- }
- return false;
- }
- } else if (isa<InvokeInst>(TI)) {
- // Invoke instructions successors are always executable.
- return true;
- } else if (SwitchInst *SI = dyn_cast<SwitchInst>(TI)) {
- LatticeVal &SCValue = getValueState(SI->getCondition());
- if (SCValue.isOverdefined()) { // Overdefined condition?
- // All destinations are executable!
- return true;
- } else if (SCValue.isConstant()) {
- Constant *CPV = SCValue.getConstant();
- if (!isa<ConstantInt>(CPV))
- return true; // not a foldable constant?
-
- // Make sure to skip the "default value" which isn't a value
- for (unsigned i = 1, E = SI->getNumSuccessors(); i != E; ++i)
- if (SI->getSuccessorValue(i) == CPV) // Found the taken branch...
- return SI->getSuccessor(i) == To;
-
- // Constant value not equal to any of the branches... must execute
- // default branch then...
- return SI->getDefaultDest() == To;
- }
- return false;
- } else {
- cerr << "Unknown terminator instruction: " << *TI;
- abort();
- }
-}
-
-// visit Implementations - Something changed in this instruction... Either an
-// operand made a transition, or the instruction is newly executable. Change
-// the value type of I to reflect these changes if appropriate. This method
-// makes sure to do the following actions:
-//
-// 1. If a phi node merges two constants in, and has conflicting value coming
-// from different branches, or if the PHI node merges in an overdefined
-// value, then the PHI node becomes overdefined.
-// 2. If a phi node merges only constants in, and they all agree on value, the
-// PHI node becomes a constant value equal to that.
-// 3. If V <- x (op) y && isConstant(x) && isConstant(y) V = Constant
-// 4. If V <- x (op) y && (isOverdefined(x) || isOverdefined(y)) V = Overdefined
-// 5. If V <- MEM or V <- CALL or V <- (unknown) then V = Overdefined
-// 6. If a conditional branch has a value that is constant, make the selected
-// destination executable
-// 7. If a conditional branch has a value that is overdefined, make all
-// successors executable.
-//
-void SCCPSolver::visitPHINode(PHINode &PN) {
- LatticeVal &PNIV = getValueState(&PN);
- if (PNIV.isOverdefined()) {
- // There may be instructions using this PHI node that are not overdefined
- // themselves. If so, make sure that they know that the PHI node operand
- // changed.
- std::multimap<PHINode*, Instruction*>::iterator I, E;
- tie(I, E) = UsersOfOverdefinedPHIs.equal_range(&PN);
- if (I != E) {
- SmallVector<Instruction*, 16> Users;
- for (; I != E; ++I) Users.push_back(I->second);
- while (!Users.empty()) {
- visit(Users.back());
- Users.pop_back();
- }
- }
- return; // Quick exit
- }
-
- // Super-extra-high-degree PHI nodes are unlikely to ever be marked constant,
- // and slow us down a lot. Just mark them overdefined.
- if (PN.getNumIncomingValues() > 64) {
- markOverdefined(PNIV, &PN);
- return;
- }
-
- // Look at all of the executable operands of the PHI node. If any of them
- // are overdefined, the PHI becomes overdefined as well. If they are all
- // constant, and they agree with each other, the PHI becomes the identical
- // constant. If they are constant and don't agree, the PHI is overdefined.
- // If there are no executable operands, the PHI remains undefined.
- //
- Constant *OperandVal = 0;
- for (unsigned i = 0, e = PN.getNumIncomingValues(); i != e; ++i) {
- LatticeVal &IV = getValueState(PN.getIncomingValue(i));
- if (IV.isUndefined()) continue; // Doesn't influence PHI node.
-
- if (isEdgeFeasible(PN.getIncomingBlock(i), PN.getParent())) {
- if (IV.isOverdefined()) { // PHI node becomes overdefined!
- markOverdefined(PNIV, &PN);
- return;
- }
-
- if (OperandVal == 0) { // Grab the first value...
- OperandVal = IV.getConstant();
- } else { // Another value is being merged in!
- // There is already a reachable operand. If we conflict with it,
- // then the PHI node becomes overdefined. If we agree with it, we
- // can continue on.
-
- // Check to see if there are two different constants merging...
- if (IV.getConstant() != OperandVal) {
- // Yes there is. This means the PHI node is not constant.
- // You must be overdefined poor PHI.
- //
- markOverdefined(PNIV, &PN); // The PHI node now becomes overdefined
- return; // I'm done analyzing you
- }
- }
- }
- }
-
- // If we exited the loop, this means that the PHI node only has constant
- // arguments that agree with each other(and OperandVal is the constant) or
- // OperandVal is null because there are no defined incoming arguments. If
- // this is the case, the PHI remains undefined.
- //
- if (OperandVal)
- markConstant(PNIV, &PN, OperandVal); // Acquire operand value
-}
-
-void SCCPSolver::visitReturnInst(ReturnInst &I) {
- if (I.getNumOperands() == 0) return; // Ret void
-
- Function *F = I.getParent()->getParent();
- // If we are tracking the return value of this function, merge it in.
- if (!F->hasInternalLinkage())
- return;
-
- if (!TrackedRetVals.empty() && I.getNumOperands() == 1) {
- DenseMap<Function*, LatticeVal>::iterator TFRVI =
- TrackedRetVals.find(F);
- if (TFRVI != TrackedRetVals.end() &&
- !TFRVI->second.isOverdefined()) {
- LatticeVal &IV = getValueState(I.getOperand(0));
- mergeInValue(TFRVI->second, F, IV);
- return;
- }
- }
-
- // Handle functions that return multiple values.
- if (!TrackedMultipleRetVals.empty() && I.getNumOperands() > 1) {
- for (unsigned i = 0, e = I.getNumOperands(); i != e; ++i) {
- std::map<std::pair<Function*, unsigned>, LatticeVal>::iterator
- It = TrackedMultipleRetVals.find(std::make_pair(F, i));
- if (It == TrackedMultipleRetVals.end()) break;
- mergeInValue(It->second, F, getValueState(I.getOperand(i)));
- }
- }
-}
-
-void SCCPSolver::visitTerminatorInst(TerminatorInst &TI) {
- SmallVector<bool, 16> SuccFeasible;
- getFeasibleSuccessors(TI, SuccFeasible);
-
- BasicBlock *BB = TI.getParent();
-
- // Mark all feasible successors executable...
- for (unsigned i = 0, e = SuccFeasible.size(); i != e; ++i)
- if (SuccFeasible[i])
- markEdgeExecutable(BB, TI.getSuccessor(i));
-}
-
-void SCCPSolver::visitCastInst(CastInst &I) {
- Value *V = I.getOperand(0);
- LatticeVal &VState = getValueState(V);
- if (VState.isOverdefined()) // Inherit overdefinedness of operand
- markOverdefined(&I);
- else if (VState.isConstant()) // Propagate constant value
- markConstant(&I, ConstantExpr::getCast(I.getOpcode(),
- VState.getConstant(), I.getType()));
-}
-
-void SCCPSolver::visitGetResultInst(GetResultInst &GRI) {
- Value *Aggr = GRI.getOperand(0);
-
- // If the operand to the getresult is an undef, the result is undef.
- if (isa<UndefValue>(Aggr))
- return;
-
- Function *F;
- if (CallInst *CI = dyn_cast<CallInst>(Aggr))
- F = CI->getCalledFunction();
- else
- F = cast<InvokeInst>(Aggr)->getCalledFunction();
-
- // TODO: If IPSCCP resolves the callee of this function, we could propagate a
- // result back!
- if (F == 0 || TrackedMultipleRetVals.empty()) {
- markOverdefined(&GRI);
- return;
- }
-
- // See if we are tracking the result of the callee.
- std::map<std::pair<Function*, unsigned>, LatticeVal>::iterator
- It = TrackedMultipleRetVals.find(std::make_pair(F, GRI.getIndex()));
-
- // If not tracking this function (for example, it is a declaration) just move
- // to overdefined.
- if (It == TrackedMultipleRetVals.end()) {
- markOverdefined(&GRI);
- return;
- }
-
- // Otherwise, the value will be merged in here as a result of CallSite
- // handling.
-}
-
-void SCCPSolver::visitSelectInst(SelectInst &I) {
- LatticeVal &CondValue = getValueState(I.getCondition());
- if (CondValue.isUndefined())
- return;
- if (CondValue.isConstant()) {
- if (ConstantInt *CondCB = dyn_cast<ConstantInt>(CondValue.getConstant())){
- mergeInValue(&I, getValueState(CondCB->getZExtValue() ? I.getTrueValue()
- : I.getFalseValue()));
- return;
- }
- }
-
- // Otherwise, the condition is overdefined or a constant we can't evaluate.
- // See if we can produce something better than overdefined based on the T/F
- // value.
- LatticeVal &TVal = getValueState(I.getTrueValue());
- LatticeVal &FVal = getValueState(I.getFalseValue());
-
- // select ?, C, C -> C.
- if (TVal.isConstant() && FVal.isConstant() &&
- TVal.getConstant() == FVal.getConstant()) {
- markConstant(&I, FVal.getConstant());
- return;
- }
-
- if (TVal.isUndefined()) { // select ?, undef, X -> X.
- mergeInValue(&I, FVal);
- } else if (FVal.isUndefined()) { // select ?, X, undef -> X.
- mergeInValue(&I, TVal);
- } else {
- markOverdefined(&I);
- }
-}
-
-// Handle BinaryOperators and Shift Instructions...
-void SCCPSolver::visitBinaryOperator(Instruction &I) {
- LatticeVal &IV = ValueState[&I];
- if (IV.isOverdefined()) return;
-
- LatticeVal &V1State = getValueState(I.getOperand(0));
- LatticeVal &V2State = getValueState(I.getOperand(1));
-
- if (V1State.isOverdefined() || V2State.isOverdefined()) {
- // If this is an AND or OR with 0 or -1, it doesn't matter that the other
- // operand is overdefined.
- if (I.getOpcode() == Instruction::And || I.getOpcode() == Instruction::Or) {
- LatticeVal *NonOverdefVal = 0;
- if (!V1State.isOverdefined()) {
- NonOverdefVal = &V1State;
- } else if (!V2State.isOverdefined()) {
- NonOverdefVal = &V2State;
- }
-
- if (NonOverdefVal) {
- if (NonOverdefVal->isUndefined()) {
- // Could annihilate value.
- if (I.getOpcode() == Instruction::And)
- markConstant(IV, &I, Constant::getNullValue(I.getType()));
- else if (const VectorType *PT = dyn_cast<VectorType>(I.getType()))
- markConstant(IV, &I, ConstantVector::getAllOnesValue(PT));
- else
- markConstant(IV, &I, ConstantInt::getAllOnesValue(I.getType()));
- return;
- } else {
- if (I.getOpcode() == Instruction::And) {
- if (NonOverdefVal->getConstant()->isNullValue()) {
- markConstant(IV, &I, NonOverdefVal->getConstant());
- return; // X and 0 = 0
- }
- } else {
- if (ConstantInt *CI =
- dyn_cast<ConstantInt>(NonOverdefVal->getConstant()))
- if (CI->isAllOnesValue()) {
- markConstant(IV, &I, NonOverdefVal->getConstant());
- return; // X or -1 = -1
- }
- }
- }
- }
- }
-
-
- // If both operands are PHI nodes, it is possible that this instruction has
- // a constant value, despite the fact that the PHI node doesn't. Check for
- // this condition now.
- if (PHINode *PN1 = dyn_cast<PHINode>(I.getOperand(0)))
- if (PHINode *PN2 = dyn_cast<PHINode>(I.getOperand(1)))
- if (PN1->getParent() == PN2->getParent()) {
- // Since the two PHI nodes are in the same basic block, they must have
- // entries for the same predecessors. Walk the predecessor list, and
- // if all of the incoming values are constants, and the result of
- // evaluating this expression with all incoming value pairs is the
- // same, then this expression is a constant even though the PHI node
- // is not a constant!
- LatticeVal Result;
- for (unsigned i = 0, e = PN1->getNumIncomingValues(); i != e; ++i) {
- LatticeVal &In1 = getValueState(PN1->getIncomingValue(i));
- BasicBlock *InBlock = PN1->getIncomingBlock(i);
- LatticeVal &In2 =
- getValueState(PN2->getIncomingValueForBlock(InBlock));
-
- if (In1.isOverdefined() || In2.isOverdefined()) {
- Result.markOverdefined();
- break; // Cannot fold this operation over the PHI nodes!
- } else if (In1.isConstant() && In2.isConstant()) {
- Constant *V = ConstantExpr::get(I.getOpcode(), In1.getConstant(),
- In2.getConstant());
- if (Result.isUndefined())
- Result.markConstant(V);
- else if (Result.isConstant() && Result.getConstant() != V) {
- Result.markOverdefined();
- break;
- }
- }
- }
-
- // If we found a constant value here, then we know the instruction is
- // constant despite the fact that the PHI nodes are overdefined.
- if (Result.isConstant()) {
- markConstant(IV, &I, Result.getConstant());
- // Remember that this instruction is virtually using the PHI node
- // operands.
- UsersOfOverdefinedPHIs.insert(std::make_pair(PN1, &I));
- UsersOfOverdefinedPHIs.insert(std::make_pair(PN2, &I));
- return;
- } else if (Result.isUndefined()) {
- return;
- }
-
- // Okay, this really is overdefined now. Since we might have
- // speculatively thought that this was not overdefined before, and
- // added ourselves to the UsersOfOverdefinedPHIs list for the PHIs,
- // make sure to clean out any entries that we put there, for
- // efficiency.
- std::multimap<PHINode*, Instruction*>::iterator It, E;
- tie(It, E) = UsersOfOverdefinedPHIs.equal_range(PN1);
- while (It != E) {
- if (It->second == &I) {
- UsersOfOverdefinedPHIs.erase(It++);
- } else
- ++It;
- }
- tie(It, E) = UsersOfOverdefinedPHIs.equal_range(PN2);
- while (It != E) {
- if (It->second == &I) {
- UsersOfOverdefinedPHIs.erase(It++);
- } else
- ++It;
- }
- }
-
- markOverdefined(IV, &I);
- } else if (V1State.isConstant() && V2State.isConstant()) {
- markConstant(IV, &I, ConstantExpr::get(I.getOpcode(), V1State.getConstant(),
- V2State.getConstant()));
- }
-}
-
-// Handle ICmpInst instruction...
-void SCCPSolver::visitCmpInst(CmpInst &I) {
- LatticeVal &IV = ValueState[&I];
- if (IV.isOverdefined()) return;
-
- LatticeVal &V1State = getValueState(I.getOperand(0));
- LatticeVal &V2State = getValueState(I.getOperand(1));
-
- if (V1State.isOverdefined() || V2State.isOverdefined()) {
- // If both operands are PHI nodes, it is possible that this instruction has
- // a constant value, despite the fact that the PHI node doesn't. Check for
- // this condition now.
- if (PHINode *PN1 = dyn_cast<PHINode>(I.getOperand(0)))
- if (PHINode *PN2 = dyn_cast<PHINode>(I.getOperand(1)))
- if (PN1->getParent() == PN2->getParent()) {
- // Since the two PHI nodes are in the same basic block, they must have
- // entries for the same predecessors. Walk the predecessor list, and
- // if all of the incoming values are constants, and the result of
- // evaluating this expression with all incoming value pairs is the
- // same, then this expression is a constant even though the PHI node
- // is not a constant!
- LatticeVal Result;
- for (unsigned i = 0, e = PN1->getNumIncomingValues(); i != e; ++i) {
- LatticeVal &In1 = getValueState(PN1->getIncomingValue(i));
- BasicBlock *InBlock = PN1->getIncomingBlock(i);
- LatticeVal &In2 =
- getValueState(PN2->getIncomingValueForBlock(InBlock));
-
- if (In1.isOverdefined() || In2.isOverdefined()) {
- Result.markOverdefined();
- break; // Cannot fold this operation over the PHI nodes!
- } else if (In1.isConstant() && In2.isConstant()) {
- Constant *V = ConstantExpr::getCompare(I.getPredicate(),
- In1.getConstant(),
- In2.getConstant());
- if (Result.isUndefined())
- Result.markConstant(V);
- else if (Result.isConstant() && Result.getConstant() != V) {
- Result.markOverdefined();
- break;
- }
- }
- }
-
- // If we found a constant value here, then we know the instruction is
- // constant despite the fact that the PHI nodes are overdefined.
- if (Result.isConstant()) {
- markConstant(IV, &I, Result.getConstant());
- // Remember that this instruction is virtually using the PHI node
- // operands.
- UsersOfOverdefinedPHIs.insert(std::make_pair(PN1, &I));
- UsersOfOverdefinedPHIs.insert(std::make_pair(PN2, &I));
- return;
- } else if (Result.isUndefined()) {
- return;
- }
-
- // Okay, this really is overdefined now. Since we might have
- // speculatively thought that this was not overdefined before, and
- // added ourselves to the UsersOfOverdefinedPHIs list for the PHIs,
- // make sure to clean out any entries that we put there, for
- // efficiency.
- std::multimap<PHINode*, Instruction*>::iterator It, E;
- tie(It, E) = UsersOfOverdefinedPHIs.equal_range(PN1);
- while (It != E) {
- if (It->second == &I) {
- UsersOfOverdefinedPHIs.erase(It++);
- } else
- ++It;
- }
- tie(It, E) = UsersOfOverdefinedPHIs.equal_range(PN2);
- while (It != E) {
- if (It->second == &I) {
- UsersOfOverdefinedPHIs.erase(It++);
- } else
- ++It;
- }
- }
-
- markOverdefined(IV, &I);
- } else if (V1State.isConstant() && V2State.isConstant()) {
- markConstant(IV, &I, ConstantExpr::getCompare(I.getPredicate(),
- V1State.getConstant(),
- V2State.getConstant()));
- }
-}
-
-void SCCPSolver::visitExtractElementInst(ExtractElementInst &I) {
- // FIXME : SCCP does not handle vectors properly.
- markOverdefined(&I);
- return;
-
-#if 0
- LatticeVal &ValState = getValueState(I.getOperand(0));
- LatticeVal &IdxState = getValueState(I.getOperand(1));
-
- if (ValState.isOverdefined() || IdxState.isOverdefined())
- markOverdefined(&I);
- else if(ValState.isConstant() && IdxState.isConstant())
- markConstant(&I, ConstantExpr::getExtractElement(ValState.getConstant(),
- IdxState.getConstant()));
-#endif
-}
-
-void SCCPSolver::visitInsertElementInst(InsertElementInst &I) {
- // FIXME : SCCP does not handle vectors properly.
- markOverdefined(&I);
- return;
-#if 0
- LatticeVal &ValState = getValueState(I.getOperand(0));
- LatticeVal &EltState = getValueState(I.getOperand(1));
- LatticeVal &IdxState = getValueState(I.getOperand(2));
-
- if (ValState.isOverdefined() || EltState.isOverdefined() ||
- IdxState.isOverdefined())
- markOverdefined(&I);
- else if(ValState.isConstant() && EltState.isConstant() &&
- IdxState.isConstant())
- markConstant(&I, ConstantExpr::getInsertElement(ValState.getConstant(),
- EltState.getConstant(),
- IdxState.getConstant()));
- else if (ValState.isUndefined() && EltState.isConstant() &&
- IdxState.isConstant())
- markConstant(&I,ConstantExpr::getInsertElement(UndefValue::get(I.getType()),
- EltState.getConstant(),
- IdxState.getConstant()));
-#endif
-}
-
-void SCCPSolver::visitShuffleVectorInst(ShuffleVectorInst &I) {
- // FIXME : SCCP does not handle vectors properly.
- markOverdefined(&I);
- return;
-#if 0
- LatticeVal &V1State = getValueState(I.getOperand(0));
- LatticeVal &V2State = getValueState(I.getOperand(1));
- LatticeVal &MaskState = getValueState(I.getOperand(2));
-
- if (MaskState.isUndefined() ||
- (V1State.isUndefined() && V2State.isUndefined()))
- return; // Undefined output if mask or both inputs undefined.
-
- if (V1State.isOverdefined() || V2State.isOverdefined() ||
- MaskState.isOverdefined()) {
- markOverdefined(&I);
- } else {
- // A mix of constant/undef inputs.
- Constant *V1 = V1State.isConstant() ?
- V1State.getConstant() : UndefValue::get(I.getType());
- Constant *V2 = V2State.isConstant() ?
- V2State.getConstant() : UndefValue::get(I.getType());
- Constant *Mask = MaskState.isConstant() ?
- MaskState.getConstant() : UndefValue::get(I.getOperand(2)->getType());
- markConstant(&I, ConstantExpr::getShuffleVector(V1, V2, Mask));
- }
-#endif
-}
-
-// Handle getelementptr instructions... if all operands are constants then we
-// can turn this into a getelementptr ConstantExpr.
-//
-void SCCPSolver::visitGetElementPtrInst(GetElementPtrInst &I) {
- LatticeVal &IV = ValueState[&I];
- if (IV.isOverdefined()) return;
-
- SmallVector<Constant*, 8> Operands;
- Operands.reserve(I.getNumOperands());
-
- for (unsigned i = 0, e = I.getNumOperands(); i != e; ++i) {
- LatticeVal &State = getValueState(I.getOperand(i));
- if (State.isUndefined())
- return; // Operands are not resolved yet...
- else if (State.isOverdefined()) {
- markOverdefined(IV, &I);
- return;
- }
- assert(State.isConstant() && "Unknown state!");
- Operands.push_back(State.getConstant());
- }
-
- Constant *Ptr = Operands[0];
- Operands.erase(Operands.begin()); // Erase the pointer from idx list...
-
- markConstant(IV, &I, ConstantExpr::getGetElementPtr(Ptr, &Operands[0],
- Operands.size()));
-}
-
-void SCCPSolver::visitStoreInst(Instruction &SI) {
- if (TrackedGlobals.empty() || !isa<GlobalVariable>(SI.getOperand(1)))
- return;
- GlobalVariable *GV = cast<GlobalVariable>(SI.getOperand(1));
- DenseMap<GlobalVariable*, LatticeVal>::iterator I = TrackedGlobals.find(GV);
- if (I == TrackedGlobals.end() || I->second.isOverdefined()) return;
-
- // Get the value we are storing into the global.
- LatticeVal &PtrVal = getValueState(SI.getOperand(0));
-
- mergeInValue(I->second, GV, PtrVal);
- if (I->second.isOverdefined())
- TrackedGlobals.erase(I); // No need to keep tracking this!
-}
-
-
-// Handle load instructions. If the operand is a constant pointer to a constant
-// global, we can replace the load with the loaded constant value!
-void SCCPSolver::visitLoadInst(LoadInst &I) {
- LatticeVal &IV = ValueState[&I];
- if (IV.isOverdefined()) return;
-
- LatticeVal &PtrVal = getValueState(I.getOperand(0));
- if (PtrVal.isUndefined()) return; // The pointer is not resolved yet!
- if (PtrVal.isConstant() && !I.isVolatile()) {
- Value *Ptr = PtrVal.getConstant();
- // TODO: Consider a target hook for valid address spaces for this xform.
- if (isa<ConstantPointerNull>(Ptr) &&
- cast<PointerType>(Ptr->getType())->getAddressSpace() == 0) {
- // load null -> null
- markConstant(IV, &I, Constant::getNullValue(I.getType()));
- return;
- }
-
- // Transform load (constant global) into the value loaded.
- if (GlobalVariable *GV = dyn_cast<GlobalVariable>(Ptr)) {
- if (GV->isConstant()) {
- if (!GV->isDeclaration()) {
- markConstant(IV, &I, GV->getInitializer());
- return;
- }
- } else if (!TrackedGlobals.empty()) {
- // If we are tracking this global, merge in the known value for it.
- DenseMap<GlobalVariable*, LatticeVal>::iterator It =
- TrackedGlobals.find(GV);
- if (It != TrackedGlobals.end()) {
- mergeInValue(IV, &I, It->second);
- return;
- }
- }
- }
-
- // Transform load (constantexpr_GEP global, 0, ...) into the value loaded.
- if (ConstantExpr *CE = dyn_cast<ConstantExpr>(Ptr))
- if (CE->getOpcode() == Instruction::GetElementPtr)
- if (GlobalVariable *GV = dyn_cast<GlobalVariable>(CE->getOperand(0)))
- if (GV->isConstant() && !GV->isDeclaration())
- if (Constant *V =
- ConstantFoldLoadThroughGEPConstantExpr(GV->getInitializer(), CE)) {
- markConstant(IV, &I, V);
- return;
- }
- }
-
- // Otherwise we cannot say for certain what value this load will produce.
- // Bail out.
- markOverdefined(IV, &I);
-}
-
-void SCCPSolver::visitCallSite(CallSite CS) {
- Function *F = CS.getCalledFunction();
- Instruction *I = CS.getInstruction();
-
- // The common case is that we aren't tracking the callee, either because we
- // are not doing interprocedural analysis or the callee is indirect, or is
- // external. Handle these cases first.
- if (F == 0 || !F->hasInternalLinkage()) {
-CallOverdefined:
- // Void return and not tracking callee, just bail.
- if (I->getType() == Type::VoidTy) return;
-
- // Otherwise, if we have a single return value case, and if the function is
- // a declaration, maybe we can constant fold it.
- if (!isa<StructType>(I->getType()) && F && F->isDeclaration() &&
- canConstantFoldCallTo(F)) {
-
- SmallVector<Constant*, 8> Operands;
- for (CallSite::arg_iterator AI = CS.arg_begin(), E = CS.arg_end();
- AI != E; ++AI) {
- LatticeVal &State = getValueState(*AI);
- if (State.isUndefined())
- return; // Operands are not resolved yet.
- else if (State.isOverdefined()) {
- markOverdefined(I);
- return;
- }
- assert(State.isConstant() && "Unknown state!");
- Operands.push_back(State.getConstant());
- }
-
- // If we can constant fold this, mark the result of the call as a
- // constant.
- if (Constant *C = ConstantFoldCall(F, &Operands[0], Operands.size())) {
- markConstant(I, C);
- return;
- }
- }
-
- // Otherwise, we don't know anything about this call, mark it overdefined.
- markOverdefined(I);
- return;
- }
-
- // If this is a single/zero retval case, see if we're tracking the function.
- const StructType *RetSTy = dyn_cast<StructType>(I->getType());
- if (RetSTy == 0) {
- // Check to see if we're tracking this callee, if not, handle it in the
- // common path above.
- DenseMap<Function*, LatticeVal>::iterator TFRVI = TrackedRetVals.find(F);
- if (TFRVI == TrackedRetVals.end())
- goto CallOverdefined;
-
- // If so, propagate the return value of the callee into this call result.
- mergeInValue(I, TFRVI->second);
- } else {
- // Check to see if we're tracking this callee, if not, handle it in the
- // common path above.
- std::map<std::pair<Function*, unsigned>, LatticeVal>::iterator
- TMRVI = TrackedMultipleRetVals.find(std::make_pair(F, 0));
- if (TMRVI == TrackedMultipleRetVals.end())
- goto CallOverdefined;
-
- // If we are tracking this callee, propagate the return values of the call
- // into this call site. We do this by walking all the getresult uses.
- for (Value::use_iterator UI = I->use_begin(), E = I->use_end();
- UI != E; ++UI) {
- GetResultInst *GRI = cast<GetResultInst>(*UI);
- mergeInValue(GRI,
- TrackedMultipleRetVals[std::make_pair(F, GRI->getIndex())]);
- }
- }
-
- // Finally, if this is the first call to the function hit, mark its entry
- // block executable.
- if (!BBExecutable.count(F->begin()))
- MarkBlockExecutable(F->begin());
-
- // Propagate information from this call site into the callee.
- CallSite::arg_iterator CAI = CS.arg_begin();
- for (Function::arg_iterator AI = F->arg_begin(), E = F->arg_end();
- AI != E; ++AI, ++CAI) {
- LatticeVal &IV = ValueState[AI];
- if (!IV.isOverdefined())
- mergeInValue(IV, AI, getValueState(*CAI));
- }
-}
-
-
-void SCCPSolver::Solve() {
- // Process the work lists until they are empty!
- while (!BBWorkList.empty() || !InstWorkList.empty() ||
- !OverdefinedInstWorkList.empty()) {
- // Process the instruction work list...
- while (!OverdefinedInstWorkList.empty()) {
- Value *I = OverdefinedInstWorkList.back();
- OverdefinedInstWorkList.pop_back();
-
- DOUT << "\nPopped off OI-WL: " << *I;
-
- // "I" got into the work list because it either made the transition from
- // bottom to constant
- //
- // Anything on this worklist that is overdefined need not be visited
- // since all of its users will have already been marked as overdefined
- // Update all of the users of this instruction's value...
- //
- for (Value::use_iterator UI = I->use_begin(), E = I->use_end();
- UI != E; ++UI)
- OperandChangedState(*UI);
- }
- // Process the instruction work list...
- while (!InstWorkList.empty()) {
- Value *I = InstWorkList.back();
- InstWorkList.pop_back();
-
- DOUT << "\nPopped off I-WL: " << *I;
-
- // "I" got into the work list because it either made the transition from
- // bottom to constant
- //
- // Anything on this worklist that is overdefined need not be visited
- // since all of its users will have already been marked as overdefined.
- // Update all of the users of this instruction's value...
- //
- if (!getValueState(I).isOverdefined())
- for (Value::use_iterator UI = I->use_begin(), E = I->use_end();
- UI != E; ++UI)
- OperandChangedState(*UI);
- }
-
- // Process the basic block work list...
- while (!BBWorkList.empty()) {
- BasicBlock *BB = BBWorkList.back();
- BBWorkList.pop_back();
-
- DOUT << "\nPopped off BBWL: " << *BB;
-
- // Notify all instructions in this basic block that they are newly
- // executable.
- visit(BB);
- }
- }
-}
-
-/// ResolvedUndefsIn - While solving the dataflow for a function, we assume
-/// that branches on undef values cannot reach any of their successors.
-/// However, this is not a safe assumption. After we solve dataflow, this
-/// method should be use to handle this. If this returns true, the solver
-/// should be rerun.
-///
-/// This method handles this by finding an unresolved branch and marking it one
-/// of the edges from the block as being feasible, even though the condition
-/// doesn't say it would otherwise be. This allows SCCP to find the rest of the
-/// CFG and only slightly pessimizes the analysis results (by marking one,
-/// potentially infeasible, edge feasible). This cannot usefully modify the
-/// constraints on the condition of the branch, as that would impact other users
-/// of the value.
-///
-/// This scan also checks for values that use undefs, whose results are actually
-/// defined. For example, 'zext i8 undef to i32' should produce all zeros
-/// conservatively, as "(zext i8 X -> i32) & 0xFF00" must always return zero,
-/// even if X isn't defined.
-bool SCCPSolver::ResolvedUndefsIn(Function &F) {
- for (Function::iterator BB = F.begin(), E = F.end(); BB != E; ++BB) {
- if (!BBExecutable.count(BB))
- continue;
-
- for (BasicBlock::iterator I = BB->begin(), E = BB->end(); I != E; ++I) {
- // Look for instructions which produce undef values.
- if (I->getType() == Type::VoidTy) continue;
-
- LatticeVal &LV = getValueState(I);
- if (!LV.isUndefined()) continue;
-
- // Get the lattice values of the first two operands for use below.
- LatticeVal &Op0LV = getValueState(I->getOperand(0));
- LatticeVal Op1LV;
- if (I->getNumOperands() == 2) {
- // If this is a two-operand instruction, and if both operands are
- // undefs, the result stays undef.
- Op1LV = getValueState(I->getOperand(1));
- if (Op0LV.isUndefined() && Op1LV.isUndefined())
- continue;
- }
-
- // If this is an instructions whose result is defined even if the input is
- // not fully defined, propagate the information.
- const Type *ITy = I->getType();
- switch (I->getOpcode()) {
- default: break; // Leave the instruction as an undef.
- case Instruction::ZExt:
- // After a zero extend, we know the top part is zero. SExt doesn't have
- // to be handled here, because we don't know whether the top part is 1's
- // or 0's.
- assert(Op0LV.isUndefined());
- markForcedConstant(LV, I, Constant::getNullValue(ITy));
- return true;
- case Instruction::Mul:
- case Instruction::And:
- // undef * X -> 0. X could be zero.
- // undef & X -> 0. X could be zero.
- markForcedConstant(LV, I, Constant::getNullValue(ITy));
- return true;
-
- case Instruction::Or:
- // undef | X -> -1. X could be -1.
- if (const VectorType *PTy = dyn_cast<VectorType>(ITy))
- markForcedConstant(LV, I, ConstantVector::getAllOnesValue(PTy));
- else
- markForcedConstant(LV, I, ConstantInt::getAllOnesValue(ITy));
- return true;
-
- case Instruction::SDiv:
- case Instruction::UDiv:
- case Instruction::SRem:
- case Instruction::URem:
- // X / undef -> undef. No change.
- // X % undef -> undef. No change.
- if (Op1LV.isUndefined()) break;
-
- // undef / X -> 0. X could be maxint.
- // undef % X -> 0. X could be 1.
- markForcedConstant(LV, I, Constant::getNullValue(ITy));
- return true;
-
- case Instruction::AShr:
- // undef >>s X -> undef. No change.
- if (Op0LV.isUndefined()) break;
-
- // X >>s undef -> X. X could be 0, X could have the high-bit known set.
- if (Op0LV.isConstant())
- markForcedConstant(LV, I, Op0LV.getConstant());
- else
- markOverdefined(LV, I);
- return true;
- case Instruction::LShr:
- case Instruction::Shl:
- // undef >> X -> undef. No change.
- // undef << X -> undef. No change.
- if (Op0LV.isUndefined()) break;
-
- // X >> undef -> 0. X could be 0.
- // X << undef -> 0. X could be 0.
- markForcedConstant(LV, I, Constant::getNullValue(ITy));
- return true;
- case Instruction::Select:
- // undef ? X : Y -> X or Y. There could be commonality between X/Y.
- if (Op0LV.isUndefined()) {
- if (!Op1LV.isConstant()) // Pick the constant one if there is any.
- Op1LV = getValueState(I->getOperand(2));
- } else if (Op1LV.isUndefined()) {
- // c ? undef : undef -> undef. No change.
- Op1LV = getValueState(I->getOperand(2));
- if (Op1LV.isUndefined())
- break;
- // Otherwise, c ? undef : x -> x.
- } else {
- // Leave Op1LV as Operand(1)'s LatticeValue.
- }
-
- if (Op1LV.isConstant())
- markForcedConstant(LV, I, Op1LV.getConstant());
- else
- markOverdefined(LV, I);
- return true;
- }
- }
-
- TerminatorInst *TI = BB->getTerminator();
- if (BranchInst *BI = dyn_cast<BranchInst>(TI)) {
- if (!BI->isConditional()) continue;
- if (!getValueState(BI->getCondition()).isUndefined())
- continue;
- } else if (SwitchInst *SI = dyn_cast<SwitchInst>(TI)) {
- if (!getValueState(SI->getCondition()).isUndefined())
- continue;
- } else {
- continue;
- }
-
- // If the edge to the second successor isn't thought to be feasible yet,
- // mark it so now. We pick the second one so that this goes to some
- // enumerated value in a switch instead of going to the default destination.
- if (KnownFeasibleEdges.count(Edge(BB, TI->getSuccessor(1))))
- continue;
-
- // Otherwise, it isn't already thought to be feasible. Mark it as such now
- // and return. This will make other blocks reachable, which will allow new
- // values to be discovered and existing ones to be moved in the lattice.
- markEdgeExecutable(BB, TI->getSuccessor(1));
-
- // This must be a conditional branch of switch on undef. At this point,
- // force the old terminator to branch to the first successor. This is
- // required because we are now influencing the dataflow of the function with
- // the assumption that this edge is taken. If we leave the branch condition
- // as undef, then further analysis could think the undef went another way
- // leading to an inconsistent set of conclusions.
- if (BranchInst *BI = dyn_cast<BranchInst>(TI)) {
- BI->setCondition(ConstantInt::getFalse());
- } else {
- SwitchInst *SI = cast<SwitchInst>(TI);
- SI->setCondition(SI->getCaseValue(1));
- }
-
- return true;
- }
-
- return false;
-}
-
-
-namespace {
- //===--------------------------------------------------------------------===//
- //
- /// SCCP Class - This class uses the SCCPSolver to implement a per-function
- /// Sparse Conditional Constant Propagator.
- ///
- struct VISIBILITY_HIDDEN SCCP : public FunctionPass {
- static char ID; // Pass identification, replacement for typeid
- SCCP() : FunctionPass((intptr_t)&ID) {}
-
- // runOnFunction - Run the Sparse Conditional Constant Propagation
- // algorithm, and return true if the function was modified.
- //
- bool runOnFunction(Function &F);
-
- virtual void getAnalysisUsage(AnalysisUsage &AU) const {
- AU.setPreservesCFG();
- }
- };
-
- char SCCP::ID = 0;
- RegisterPass<SCCP> X("sccp", "Sparse Conditional Constant Propagation");
-} // end anonymous namespace
-
-
-// createSCCPPass - This is the public interface to this file...
-FunctionPass *llvm::createSCCPPass() {
- return new SCCP();
-}
-
-
-// runOnFunction() - Run the Sparse Conditional Constant Propagation algorithm,
-// and return true if the function was modified.
-//
-bool SCCP::runOnFunction(Function &F) {
- DOUT << "SCCP on function '" << F.getName() << "'\n";
- SCCPSolver Solver;
-
- // Mark the first block of the function as being executable.
- Solver.MarkBlockExecutable(F.begin());
-
- // Mark all arguments to the function as being overdefined.
- for (Function::arg_iterator AI = F.arg_begin(), E = F.arg_end(); AI != E;++AI)
- Solver.markOverdefined(AI);
-
- // Solve for constants.
- bool ResolvedUndefs = true;
- while (ResolvedUndefs) {
- Solver.Solve();
- DOUT << "RESOLVING UNDEFs\n";
- ResolvedUndefs = Solver.ResolvedUndefsIn(F);
- }
-
- bool MadeChanges = false;
-
- // If we decided that there are basic blocks that are dead in this function,
- // delete their contents now. Note that we cannot actually delete the blocks,
- // as we cannot modify the CFG of the function.
- //
- SmallSet<BasicBlock*, 16> &ExecutableBBs = Solver.getExecutableBlocks();
- SmallVector<Instruction*, 32> Insts;
- std::map<Value*, LatticeVal> &Values = Solver.getValueMapping();
-
- for (Function::iterator BB = F.begin(), E = F.end(); BB != E; ++BB)
- if (!ExecutableBBs.count(BB)) {
- DOUT << " BasicBlock Dead:" << *BB;
- ++NumDeadBlocks;
-
- // Delete the instructions backwards, as it has a reduced likelihood of
- // having to update as many def-use and use-def chains.
- for (BasicBlock::iterator I = BB->begin(), E = BB->getTerminator();
- I != E; ++I)
- Insts.push_back(I);
- while (!Insts.empty()) {
- Instruction *I = Insts.back();
- Insts.pop_back();
- if (!I->use_empty())
- I->replaceAllUsesWith(UndefValue::get(I->getType()));
- BB->getInstList().erase(I);
- MadeChanges = true;
- ++NumInstRemoved;
- }
- } else {
- // Iterate over all of the instructions in a function, replacing them with
- // constants if we have found them to be of constant values.
- //
- for (BasicBlock::iterator BI = BB->begin(), E = BB->end(); BI != E; ) {
- Instruction *Inst = BI++;
- if (Inst->getType() == Type::VoidTy ||
- isa<StructType>(Inst->getType()) ||
- isa<TerminatorInst>(Inst))
- continue;
-
- LatticeVal &IV = Values[Inst];
- if (!IV.isConstant() && !IV.isUndefined())
- continue;
-
- Constant *Const = IV.isConstant()
- ? IV.getConstant() : UndefValue::get(Inst->getType());
- DOUT << " Constant: " << *Const << " = " << *Inst;
-
- // Replaces all of the uses of a variable with uses of the constant.
- Inst->replaceAllUsesWith(Const);
-
- // Delete the instruction.
- Inst->eraseFromParent();
-
- // Hey, we just changed something!
- MadeChanges = true;
- ++NumInstRemoved;
- }
- }
-
- return MadeChanges;
-}
-
-namespace {
- //===--------------------------------------------------------------------===//
- //
- /// IPSCCP Class - This class implements interprocedural Sparse Conditional
- /// Constant Propagation.
- ///
- struct VISIBILITY_HIDDEN IPSCCP : public ModulePass {
- static char ID;
- IPSCCP() : ModulePass((intptr_t)&ID) {}
- bool runOnModule(Module &M);
- };
-
- char IPSCCP::ID = 0;
- RegisterPass<IPSCCP>
- Y("ipsccp", "Interprocedural Sparse Conditional Constant Propagation");
-} // end anonymous namespace
-
-// createIPSCCPPass - This is the public interface to this file...
-ModulePass *llvm::createIPSCCPPass() {
- return new IPSCCP();
-}
-
-
-static bool AddressIsTaken(GlobalValue *GV) {
- // Delete any dead constantexpr klingons.
- GV->removeDeadConstantUsers();
-
- for (Value::use_iterator UI = GV->use_begin(), E = GV->use_end();
- UI != E; ++UI)
- if (StoreInst *SI = dyn_cast<StoreInst>(*UI)) {
- if (SI->getOperand(0) == GV || SI->isVolatile())
- return true; // Storing addr of GV.
- } else if (isa<InvokeInst>(*UI) || isa<CallInst>(*UI)) {
- // Make sure we are calling the function, not passing the address.
- CallSite CS = CallSite::get(cast<Instruction>(*UI));
- for (CallSite::arg_iterator AI = CS.arg_begin(),
- E = CS.arg_end(); AI != E; ++AI)
- if (*AI == GV)
- return true;
- } else if (LoadInst *LI = dyn_cast<LoadInst>(*UI)) {
- if (LI->isVolatile())
- return true;
- } else {
- return true;
- }
- return false;
-}
-
-bool IPSCCP::runOnModule(Module &M) {
- SCCPSolver Solver;
-
- // Loop over all functions, marking arguments to those with their addresses
- // taken or that are external as overdefined.
- //
- for (Module::iterator F = M.begin(), E = M.end(); F != E; ++F)
- if (!F->hasInternalLinkage() || AddressIsTaken(F)) {
- if (!F->isDeclaration())
- Solver.MarkBlockExecutable(F->begin());
- for (Function::arg_iterator AI = F->arg_begin(), E = F->arg_end();
- AI != E; ++AI)
- Solver.markOverdefined(AI);
- } else {
- Solver.AddTrackedFunction(F);
- }
-
- // Loop over global variables. We inform the solver about any internal global
- // variables that do not have their 'addresses taken'. If they don't have
- // their addresses taken, we can propagate constants through them.
- for (Module::global_iterator G = M.global_begin(), E = M.global_end();
- G != E; ++G)
- if (!G->isConstant() && G->hasInternalLinkage() && !AddressIsTaken(G))
- Solver.TrackValueOfGlobalVariable(G);
-
- // Solve for constants.
- bool ResolvedUndefs = true;
- while (ResolvedUndefs) {
- Solver.Solve();
-
- DOUT << "RESOLVING UNDEFS\n";
- ResolvedUndefs = false;
- for (Module::iterator F = M.begin(), E = M.end(); F != E; ++F)
- ResolvedUndefs |= Solver.ResolvedUndefsIn(*F);
- }
-
- bool MadeChanges = false;
-
- // Iterate over all of the instructions in the module, replacing them with
- // constants if we have found them to be of constant values.
- //
- SmallSet<BasicBlock*, 16> &ExecutableBBs = Solver.getExecutableBlocks();
- SmallVector<Instruction*, 32> Insts;
- SmallVector<BasicBlock*, 32> BlocksToErase;
- std::map<Value*, LatticeVal> &Values = Solver.getValueMapping();
-
- for (Module::iterator F = M.begin(), E = M.end(); F != E; ++F) {
- for (Function::arg_iterator AI = F->arg_begin(), E = F->arg_end();
- AI != E; ++AI)
- if (!AI->use_empty()) {
- LatticeVal &IV = Values[AI];
- if (IV.isConstant() || IV.isUndefined()) {
- Constant *CST = IV.isConstant() ?
- IV.getConstant() : UndefValue::get(AI->getType());
- DOUT << "*** Arg " << *AI << " = " << *CST <<"\n";
-
- // Replaces all of the uses of a variable with uses of the
- // constant.
- AI->replaceAllUsesWith(CST);
- ++IPNumArgsElimed;
- }
- }
-
- for (Function::iterator BB = F->begin(), E = F->end(); BB != E; ++BB)
- if (!ExecutableBBs.count(BB)) {
- DOUT << " BasicBlock Dead:" << *BB;
- ++IPNumDeadBlocks;
-
- // Delete the instructions backwards, as it has a reduced likelihood of
- // having to update as many def-use and use-def chains.
- TerminatorInst *TI = BB->getTerminator();
- for (BasicBlock::iterator I = BB->begin(), E = TI; I != E; ++I)
- Insts.push_back(I);
-
- while (!Insts.empty()) {
- Instruction *I = Insts.back();
- Insts.pop_back();
- if (!I->use_empty())
- I->replaceAllUsesWith(UndefValue::get(I->getType()));
- BB->getInstList().erase(I);
- MadeChanges = true;
- ++IPNumInstRemoved;
- }
-
- for (unsigned i = 0, e = TI->getNumSuccessors(); i != e; ++i) {
- BasicBlock *Succ = TI->getSuccessor(i);
- if (!Succ->empty() && isa<PHINode>(Succ->begin()))
- TI->getSuccessor(i)->removePredecessor(BB);
- }
- if (!TI->use_empty())
- TI->replaceAllUsesWith(UndefValue::get(TI->getType()));
- BB->getInstList().erase(TI);
-
- if (&*BB != &F->front())
- BlocksToErase.push_back(BB);
- else
- new UnreachableInst(BB);
-
- } else {
- for (BasicBlock::iterator BI = BB->begin(), E = BB->end(); BI != E; ) {
- Instruction *Inst = BI++;
- if (Inst->getType() == Type::VoidTy ||
- isa<StructType>(Inst->getType()) ||
- isa<TerminatorInst>(Inst))
- continue;
-
- LatticeVal &IV = Values[Inst];
- if (!IV.isConstant() && !IV.isUndefined())
- continue;
-
- Constant *Const = IV.isConstant()
- ? IV.getConstant() : UndefValue::get(Inst->getType());
- DOUT << " Constant: " << *Const << " = " << *Inst;
-
- // Replaces all of the uses of a variable with uses of the
- // constant.
- Inst->replaceAllUsesWith(Const);
-
- // Delete the instruction.
- if (!isa<CallInst>(Inst))
- Inst->eraseFromParent();
-
- // Hey, we just changed something!
- MadeChanges = true;
- ++IPNumInstRemoved;
- }
- }
-
- // Now that all instructions in the function are constant folded, erase dead
- // blocks, because we can now use ConstantFoldTerminator to get rid of
- // in-edges.
- for (unsigned i = 0, e = BlocksToErase.size(); i != e; ++i) {
- // If there are any PHI nodes in this successor, drop entries for BB now.
- BasicBlock *DeadBB = BlocksToErase[i];
- while (!DeadBB->use_empty()) {
- Instruction *I = cast<Instruction>(DeadBB->use_back());
- bool Folded = ConstantFoldTerminator(I->getParent());
- if (!Folded) {
- // The constant folder may not have been able to fold the terminator
- // if this is a branch or switch on undef. Fold it manually as a
- // branch to the first successor.
- if (BranchInst *BI = dyn_cast<BranchInst>(I)) {
- assert(BI->isConditional() && isa<UndefValue>(BI->getCondition()) &&
- "Branch should be foldable!");
- } else if (SwitchInst *SI = dyn_cast<SwitchInst>(I)) {
- assert(isa<UndefValue>(SI->getCondition()) && "Switch should fold");
- } else {
- assert(0 && "Didn't fold away reference to block!");
- }
-
- // Make this an uncond branch to the first successor.
- TerminatorInst *TI = I->getParent()->getTerminator();
- BranchInst::Create(TI->getSuccessor(0), TI);
-
- // Remove entries in successor phi nodes to remove edges.
- for (unsigned i = 1, e = TI->getNumSuccessors(); i != e; ++i)
- TI->getSuccessor(i)->removePredecessor(TI->getParent());
-
- // Remove the old terminator.
- TI->eraseFromParent();
- }
- }
-
- // Finally, delete the basic block.
- F->getBasicBlockList().erase(DeadBB);
- }
- BlocksToErase.clear();
- }
-
- // If we inferred constant or undef return values for a function, we replaced
- // all call uses with the inferred value. This means we don't need to bother
- // actually returning anything from the function. Replace all return
- // instructions with return undef.
- // TODO: Process multiple value ret instructions also.
- const DenseMap<Function*, LatticeVal> &RV = Solver.getTrackedRetVals();
- for (DenseMap<Function*, LatticeVal>::const_iterator I = RV.begin(),
- E = RV.end(); I != E; ++I)
- if (!I->second.isOverdefined() &&
- I->first->getReturnType() != Type::VoidTy) {
- Function *F = I->first;
- for (Function::iterator BB = F->begin(), E = F->end(); BB != E; ++BB)
- if (ReturnInst *RI = dyn_cast<ReturnInst>(BB->getTerminator()))
- if (!isa<UndefValue>(RI->getOperand(0)))
- RI->setOperand(0, UndefValue::get(F->getReturnType()));
- }
-
- // If we infered constant or undef values for globals variables, we can delete
- // the global and any stores that remain to it.
- const DenseMap<GlobalVariable*, LatticeVal> &TG = Solver.getTrackedGlobals();
- for (DenseMap<GlobalVariable*, LatticeVal>::const_iterator I = TG.begin(),
- E = TG.end(); I != E; ++I) {
- GlobalVariable *GV = I->first;
- assert(!I->second.isOverdefined() &&
- "Overdefined values should have been taken out of the map!");
- DOUT << "Found that GV '" << GV->getName()<< "' is constant!\n";
- while (!GV->use_empty()) {
- StoreInst *SI = cast<StoreInst>(GV->use_back());
- SI->eraseFromParent();
- }
- M.getGlobalList().erase(GV);
- ++IPNumGlobalConst;
- }
-
- return MadeChanges;
-}
diff --git a/release_23/lib/Transforms/Scalar/Scalar.cpp b/release_23/lib/Transforms/Scalar/Scalar.cpp
deleted file mode 100644
index 838f52b35f81..000000000000
--- a/release_23/lib/Transforms/Scalar/Scalar.cpp
+++ /dev/null
@@ -1,47 +0,0 @@
-//===-- Scalar.cpp --------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the C bindings for libLLVMScalarOpts.a, which implements
-// several scalar transformations over the LLVM intermediate representation.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm-c/Transforms/Scalar.h"
-#include "llvm/PassManager.h"
-#include "llvm/Transforms/Scalar.h"
-
-using namespace llvm;
-
-void LLVMAddConstantPropagationPass(LLVMPassManagerRef PM) {
- unwrap(PM)->add(createConstantPropagationPass());
-}
-
-void LLVMAddInstructionCombiningPass(LLVMPassManagerRef PM) {
- unwrap(PM)->add(createInstructionCombiningPass());
-}
-
-void LLVMAddPromoteMemoryToRegisterPass(LLVMPassManagerRef PM) {
- unwrap(PM)->add(createPromoteMemoryToRegisterPass());
-}
-
-void LLVMAddDemoteMemoryToRegisterPass(LLVMPassManagerRef PM) {
- unwrap(PM)->add(createDemoteRegisterToMemoryPass());
-}
-
-void LLVMAddReassociatePass(LLVMPassManagerRef PM) {
- unwrap(PM)->add(createReassociatePass());
-}
-
-void LLVMAddGVNPass(LLVMPassManagerRef PM) {
- unwrap(PM)->add(createGVNPass());
-}
-
-void LLVMAddCFGSimplificationPass(LLVMPassManagerRef PM) {
- unwrap(PM)->add(createCFGSimplificationPass());
-}
diff --git a/release_23/lib/Transforms/Scalar/ScalarReplAggregates.cpp b/release_23/lib/Transforms/Scalar/ScalarReplAggregates.cpp
deleted file mode 100644
index 51aad84c0725..000000000000
--- a/release_23/lib/Transforms/Scalar/ScalarReplAggregates.cpp
+++ /dev/null
@@ -1,1413 +0,0 @@
-//===- ScalarReplAggregates.cpp - Scalar Replacement of Aggregates --------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This transformation implements the well known scalar replacement of
-// aggregates transformation. This xform breaks up alloca instructions of
-// aggregate type (structure or array) into individual alloca instructions for
-// each member (if possible). Then, if possible, it transforms the individual
-// alloca instructions into nice clean scalar SSA form.
-//
-// This combines a simple SRoA algorithm with the Mem2Reg algorithm because
-// often interact, especially for C++ programs. As such, iterating between
-// SRoA, then Mem2Reg until we run out of things to promote works well.
-//
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "scalarrepl"
-#include "llvm/Transforms/Scalar.h"
-#include "llvm/Constants.h"
-#include "llvm/DerivedTypes.h"
-#include "llvm/Function.h"
-#include "llvm/GlobalVariable.h"
-#include "llvm/Instructions.h"
-#include "llvm/IntrinsicInst.h"
-#include "llvm/Pass.h"
-#include "llvm/Analysis/Dominators.h"
-#include "llvm/Target/TargetData.h"
-#include "llvm/Transforms/Utils/PromoteMemToReg.h"
-#include "llvm/Support/Debug.h"
-#include "llvm/Support/GetElementPtrTypeIterator.h"
-#include "llvm/Support/MathExtras.h"
-#include "llvm/Support/Compiler.h"
-#include "llvm/ADT/SmallVector.h"
-#include "llvm/ADT/Statistic.h"
-#include "llvm/ADT/StringExtras.h"
-using namespace llvm;
-
-STATISTIC(NumReplaced, "Number of allocas broken up");
-STATISTIC(NumPromoted, "Number of allocas promoted");
-STATISTIC(NumConverted, "Number of aggregates converted to scalar");
-STATISTIC(NumGlobals, "Number of allocas copied from constant global");
-
-namespace {
- struct VISIBILITY_HIDDEN SROA : public FunctionPass {
- static char ID; // Pass identification, replacement for typeid
- explicit SROA(signed T = -1) : FunctionPass((intptr_t)&ID) {
- if (T == -1)
- SRThreshold = 128;
- else
- SRThreshold = T;
- }
-
- bool runOnFunction(Function &F);
-
- bool performScalarRepl(Function &F);
- bool performPromotion(Function &F);
-
- // getAnalysisUsage - This pass does not require any passes, but we know it
- // will not alter the CFG, so say so.
- virtual void getAnalysisUsage(AnalysisUsage &AU) const {
- AU.addRequired<DominatorTree>();
- AU.addRequired<DominanceFrontier>();
- AU.addRequired<TargetData>();
- AU.setPreservesCFG();
- }
-
- private:
- /// AllocaInfo - When analyzing uses of an alloca instruction, this captures
- /// information about the uses. All these fields are initialized to false
- /// and set to true when something is learned.
- struct AllocaInfo {
- /// isUnsafe - This is set to true if the alloca cannot be SROA'd.
- bool isUnsafe : 1;
-
- /// needsCanon - This is set to true if there is some use of the alloca
- /// that requires canonicalization.
- bool needsCanon : 1;
-
- /// isMemCpySrc - This is true if this aggregate is memcpy'd from.
- bool isMemCpySrc : 1;
-
- /// isMemCpyDst - This is true if this aggregate is memcpy'd into.
- bool isMemCpyDst : 1;
-
- AllocaInfo()
- : isUnsafe(false), needsCanon(false),
- isMemCpySrc(false), isMemCpyDst(false) {}
- };
-
- unsigned SRThreshold;
-
- void MarkUnsafe(AllocaInfo &I) { I.isUnsafe = true; }
-
- int isSafeAllocaToScalarRepl(AllocationInst *AI);
-
- void isSafeUseOfAllocation(Instruction *User, AllocationInst *AI,
- AllocaInfo &Info);
- void isSafeElementUse(Value *Ptr, bool isFirstElt, AllocationInst *AI,
- AllocaInfo &Info);
- void isSafeMemIntrinsicOnAllocation(MemIntrinsic *MI, AllocationInst *AI,
- unsigned OpNo, AllocaInfo &Info);
- void isSafeUseOfBitCastedAllocation(BitCastInst *User, AllocationInst *AI,
- AllocaInfo &Info);
-
- void DoScalarReplacement(AllocationInst *AI,
- std::vector<AllocationInst*> &WorkList);
- void CanonicalizeAllocaUsers(AllocationInst *AI);
- AllocaInst *AddNewAlloca(Function &F, const Type *Ty, AllocationInst *Base);
-
- void RewriteBitCastUserOfAlloca(Instruction *BCInst, AllocationInst *AI,
- SmallVector<AllocaInst*, 32> &NewElts);
-
- const Type *CanConvertToScalar(Value *V, bool &IsNotTrivial);
- void ConvertToScalar(AllocationInst *AI, const Type *Ty);
- void ConvertUsesToScalar(Value *Ptr, AllocaInst *NewAI, unsigned Offset);
- Value *ConvertUsesOfLoadToScalar(LoadInst *LI, AllocaInst *NewAI,
- unsigned Offset);
- Value *ConvertUsesOfStoreToScalar(StoreInst *SI, AllocaInst *NewAI,
- unsigned Offset);
- static Instruction *isOnlyCopiedFromConstantGlobal(AllocationInst *AI);
- };
-
- char SROA::ID = 0;
- RegisterPass<SROA> X("scalarrepl", "Scalar Replacement of Aggregates");
-}
-
-// Public interface to the ScalarReplAggregates pass
-FunctionPass *llvm::createScalarReplAggregatesPass(signed int Threshold) {
- return new SROA(Threshold);
-}
-
-
-bool SROA::runOnFunction(Function &F) {
- bool Changed = performPromotion(F);
- while (1) {
- bool LocalChange = performScalarRepl(F);
- if (!LocalChange) break; // No need to repromote if no scalarrepl
- Changed = true;
- LocalChange = performPromotion(F);
- if (!LocalChange) break; // No need to re-scalarrepl if no promotion
- }
-
- return Changed;
-}
-
-
-bool SROA::performPromotion(Function &F) {
- std::vector<AllocaInst*> Allocas;
- DominatorTree &DT = getAnalysis<DominatorTree>();
- DominanceFrontier &DF = getAnalysis<DominanceFrontier>();
-
- BasicBlock &BB = F.getEntryBlock(); // Get the entry node for the function
-
- bool Changed = false;
-
- while (1) {
- Allocas.clear();
-
- // Find allocas that are safe to promote, by looking at all instructions in
- // the entry node
- for (BasicBlock::iterator I = BB.begin(), E = --BB.end(); I != E; ++I)
- if (AllocaInst *AI = dyn_cast<AllocaInst>(I)) // Is it an alloca?
- if (isAllocaPromotable(AI))
- Allocas.push_back(AI);
-
- if (Allocas.empty()) break;
-
- PromoteMemToReg(Allocas, DT, DF);
- NumPromoted += Allocas.size();
- Changed = true;
- }
-
- return Changed;
-}
-
-// performScalarRepl - This algorithm is a simple worklist driven algorithm,
-// which runs on all of the malloc/alloca instructions in the function, removing
-// them if they are only used by getelementptr instructions.
-//
-bool SROA::performScalarRepl(Function &F) {
- std::vector<AllocationInst*> WorkList;
-
- // Scan the entry basic block, adding any alloca's and mallocs to the worklist
- BasicBlock &BB = F.getEntryBlock();
- for (BasicBlock::iterator I = BB.begin(), E = BB.end(); I != E; ++I)
- if (AllocationInst *A = dyn_cast<AllocationInst>(I))
- WorkList.push_back(A);
-
- const TargetData &TD = getAnalysis<TargetData>();
-
- // Process the worklist
- bool Changed = false;
- while (!WorkList.empty()) {
- AllocationInst *AI = WorkList.back();
- WorkList.pop_back();
-
- // Handle dead allocas trivially. These can be formed by SROA'ing arrays
- // with unused elements.
- if (AI->use_empty()) {
- AI->eraseFromParent();
- continue;
- }
-
- // If we can turn this aggregate value (potentially with casts) into a
- // simple scalar value that can be mem2reg'd into a register value.
- bool IsNotTrivial = false;
- if (const Type *ActualType = CanConvertToScalar(AI, IsNotTrivial))
- if (IsNotTrivial && ActualType != Type::VoidTy) {
- ConvertToScalar(AI, ActualType);
- Changed = true;
- continue;
- }
-
- // Check to see if we can perform the core SROA transformation. We cannot
- // transform the allocation instruction if it is an array allocation
- // (allocations OF arrays are ok though), and an allocation of a scalar
- // value cannot be decomposed at all.
- if (!AI->isArrayAllocation() &&
- (isa<StructType>(AI->getAllocatedType()) ||
- isa<ArrayType>(AI->getAllocatedType())) &&
- AI->getAllocatedType()->isSized() &&
- TD.getABITypeSize(AI->getAllocatedType()) < SRThreshold) {
- // Check that all of the users of the allocation are capable of being
- // transformed.
- switch (isSafeAllocaToScalarRepl(AI)) {
- default: assert(0 && "Unexpected value!");
- case 0: // Not safe to scalar replace.
- break;
- case 1: // Safe, but requires cleanup/canonicalizations first
- CanonicalizeAllocaUsers(AI);
- // FALL THROUGH.
- case 3: // Safe to scalar replace.
- DoScalarReplacement(AI, WorkList);
- Changed = true;
- continue;
- }
- }
-
- // Check to see if this allocation is only modified by a memcpy/memmove from
- // a constant global. If this is the case, we can change all users to use
- // the constant global instead. This is commonly produced by the CFE by
- // constructs like "void foo() { int A[] = {1,2,3,4,5,6,7,8,9...}; }" if 'A'
- // is only subsequently read.
- if (Instruction *TheCopy = isOnlyCopiedFromConstantGlobal(AI)) {
- DOUT << "Found alloca equal to global: " << *AI;
- DOUT << " memcpy = " << *TheCopy;
- Constant *TheSrc = cast<Constant>(TheCopy->getOperand(2));
- AI->replaceAllUsesWith(ConstantExpr::getBitCast(TheSrc, AI->getType()));
- TheCopy->eraseFromParent(); // Don't mutate the global.
- AI->eraseFromParent();
- ++NumGlobals;
- Changed = true;
- continue;
- }
-
- // Otherwise, couldn't process this.
- }
-
- return Changed;
-}
-
-/// DoScalarReplacement - This alloca satisfied the isSafeAllocaToScalarRepl
-/// predicate, do SROA now.
-void SROA::DoScalarReplacement(AllocationInst *AI,
- std::vector<AllocationInst*> &WorkList) {
- DOUT << "Found inst to SROA: " << *AI;
- SmallVector<AllocaInst*, 32> ElementAllocas;
- if (const StructType *ST = dyn_cast<StructType>(AI->getAllocatedType())) {
- ElementAllocas.reserve(ST->getNumContainedTypes());
- for (unsigned i = 0, e = ST->getNumContainedTypes(); i != e; ++i) {
- AllocaInst *NA = new AllocaInst(ST->getContainedType(i), 0,
- AI->getAlignment(),
- AI->getName() + "." + utostr(i), AI);
- ElementAllocas.push_back(NA);
- WorkList.push_back(NA); // Add to worklist for recursive processing
- }
- } else {
- const ArrayType *AT = cast<ArrayType>(AI->getAllocatedType());
- ElementAllocas.reserve(AT->getNumElements());
- const Type *ElTy = AT->getElementType();
- for (unsigned i = 0, e = AT->getNumElements(); i != e; ++i) {
- AllocaInst *NA = new AllocaInst(ElTy, 0, AI->getAlignment(),
- AI->getName() + "." + utostr(i), AI);
- ElementAllocas.push_back(NA);
- WorkList.push_back(NA); // Add to worklist for recursive processing
- }
- }
-
- // Now that we have created the alloca instructions that we want to use,
- // expand the getelementptr instructions to use them.
- //
- while (!AI->use_empty()) {
- Instruction *User = cast<Instruction>(AI->use_back());
- if (BitCastInst *BCInst = dyn_cast<BitCastInst>(User)) {
- RewriteBitCastUserOfAlloca(BCInst, AI, ElementAllocas);
- BCInst->eraseFromParent();
- continue;
- }
-
- GetElementPtrInst *GEPI = cast<GetElementPtrInst>(User);
- // We now know that the GEP is of the form: GEP <ptr>, 0, <cst>
- unsigned Idx =
- (unsigned)cast<ConstantInt>(GEPI->getOperand(2))->getZExtValue();
-
- assert(Idx < ElementAllocas.size() && "Index out of range?");
- AllocaInst *AllocaToUse = ElementAllocas[Idx];
-
- Value *RepValue;
- if (GEPI->getNumOperands() == 3) {
- // Do not insert a new getelementptr instruction with zero indices, only
- // to have it optimized out later.
- RepValue = AllocaToUse;
- } else {
- // We are indexing deeply into the structure, so we still need a
- // getelement ptr instruction to finish the indexing. This may be
- // expanded itself once the worklist is rerun.
- //
- SmallVector<Value*, 8> NewArgs;
- NewArgs.push_back(Constant::getNullValue(Type::Int32Ty));
- NewArgs.append(GEPI->op_begin()+3, GEPI->op_end());
- RepValue = GetElementPtrInst::Create(AllocaToUse, NewArgs.begin(),
- NewArgs.end(), "", GEPI);
- RepValue->takeName(GEPI);
- }
-
- // If this GEP is to the start of the aggregate, check for memcpys.
- if (Idx == 0) {
- bool IsStartOfAggregateGEP = true;
- for (unsigned i = 3, e = GEPI->getNumOperands(); i != e; ++i) {
- if (!isa<ConstantInt>(GEPI->getOperand(i))) {
- IsStartOfAggregateGEP = false;
- break;
- }
- if (!cast<ConstantInt>(GEPI->getOperand(i))->isZero()) {
- IsStartOfAggregateGEP = false;
- break;
- }
- }
-
- if (IsStartOfAggregateGEP)
- RewriteBitCastUserOfAlloca(GEPI, AI, ElementAllocas);
- }
-
-
- // Move all of the users over to the new GEP.
- GEPI->replaceAllUsesWith(RepValue);
- // Delete the old GEP
- GEPI->eraseFromParent();
- }
-
- // Finally, delete the Alloca instruction
- AI->eraseFromParent();
- NumReplaced++;
-}
-
-
-/// isSafeElementUse - Check to see if this use is an allowed use for a
-/// getelementptr instruction of an array aggregate allocation. isFirstElt
-/// indicates whether Ptr is known to the start of the aggregate.
-///
-void SROA::isSafeElementUse(Value *Ptr, bool isFirstElt, AllocationInst *AI,
- AllocaInfo &Info) {
- for (Value::use_iterator I = Ptr->use_begin(), E = Ptr->use_end();
- I != E; ++I) {
- Instruction *User = cast<Instruction>(*I);
- switch (User->getOpcode()) {
- case Instruction::Load: break;
- case Instruction::Store:
- // Store is ok if storing INTO the pointer, not storing the pointer
- if (User->getOperand(0) == Ptr) return MarkUnsafe(Info);
- break;
- case Instruction::GetElementPtr: {
- GetElementPtrInst *GEP = cast<GetElementPtrInst>(User);
- bool AreAllZeroIndices = isFirstElt;
- if (GEP->getNumOperands() > 1) {
- if (!isa<ConstantInt>(GEP->getOperand(1)) ||
- !cast<ConstantInt>(GEP->getOperand(1))->isZero())
- // Using pointer arithmetic to navigate the array.
- return MarkUnsafe(Info);
-
- if (AreAllZeroIndices) {
- for (unsigned i = 2, e = GEP->getNumOperands(); i != e; ++i) {
- if (!isa<ConstantInt>(GEP->getOperand(i)) ||
- !cast<ConstantInt>(GEP->getOperand(i))->isZero()) {
- AreAllZeroIndices = false;
- break;
- }
- }
- }
- }
- isSafeElementUse(GEP, AreAllZeroIndices, AI, Info);
- if (Info.isUnsafe) return;
- break;
- }
- case Instruction::BitCast:
- if (isFirstElt) {
- isSafeUseOfBitCastedAllocation(cast<BitCastInst>(User), AI, Info);
- if (Info.isUnsafe) return;
- break;
- }
- DOUT << " Transformation preventing inst: " << *User;
- return MarkUnsafe(Info);
- case Instruction::Call:
- if (MemIntrinsic *MI = dyn_cast<MemIntrinsic>(User)) {
- if (isFirstElt) {
- isSafeMemIntrinsicOnAllocation(MI, AI, I.getOperandNo(), Info);
- if (Info.isUnsafe) return;
- break;
- }
- }
- DOUT << " Transformation preventing inst: " << *User;
- return MarkUnsafe(Info);
- default:
- DOUT << " Transformation preventing inst: " << *User;
- return MarkUnsafe(Info);
- }
- }
- return; // All users look ok :)
-}
-
-/// AllUsersAreLoads - Return true if all users of this value are loads.
-static bool AllUsersAreLoads(Value *Ptr) {
- for (Value::use_iterator I = Ptr->use_begin(), E = Ptr->use_end();
- I != E; ++I)
- if (cast<Instruction>(*I)->getOpcode() != Instruction::Load)
- return false;
- return true;
-}
-
-/// isSafeUseOfAllocation - Check to see if this user is an allowed use for an
-/// aggregate allocation.
-///
-void SROA::isSafeUseOfAllocation(Instruction *User, AllocationInst *AI,
- AllocaInfo &Info) {
- if (BitCastInst *C = dyn_cast<BitCastInst>(User))
- return isSafeUseOfBitCastedAllocation(C, AI, Info);
-
- GetElementPtrInst *GEPI = dyn_cast<GetElementPtrInst>(User);
- if (GEPI == 0)
- return MarkUnsafe(Info);
-
- gep_type_iterator I = gep_type_begin(GEPI), E = gep_type_end(GEPI);
-
- // The GEP is not safe to transform if not of the form "GEP <ptr>, 0, <cst>".
- if (I == E ||
- I.getOperand() != Constant::getNullValue(I.getOperand()->getType())) {
- return MarkUnsafe(Info);
- }
-
- ++I;
- if (I == E) return MarkUnsafe(Info); // ran out of GEP indices??
-
- bool IsAllZeroIndices = true;
-
- // If this is a use of an array allocation, do a bit more checking for sanity.
- if (const ArrayType *AT = dyn_cast<ArrayType>(*I)) {
- uint64_t NumElements = AT->getNumElements();
-
- if (ConstantInt *Idx = dyn_cast<ConstantInt>(I.getOperand())) {
- IsAllZeroIndices &= Idx->isZero();
-
- // Check to make sure that index falls within the array. If not,
- // something funny is going on, so we won't do the optimization.
- //
- if (Idx->getZExtValue() >= NumElements)
- return MarkUnsafe(Info);
-
- // We cannot scalar repl this level of the array unless any array
- // sub-indices are in-range constants. In particular, consider:
- // A[0][i]. We cannot know that the user isn't doing invalid things like
- // allowing i to index an out-of-range subscript that accesses A[1].
- //
- // Scalar replacing *just* the outer index of the array is probably not
- // going to be a win anyway, so just give up.
- for (++I; I != E && (isa<ArrayType>(*I) || isa<VectorType>(*I)); ++I) {
- uint64_t NumElements;
- if (const ArrayType *SubArrayTy = dyn_cast<ArrayType>(*I))
- NumElements = SubArrayTy->getNumElements();
- else
- NumElements = cast<VectorType>(*I)->getNumElements();
-
- ConstantInt *IdxVal = dyn_cast<ConstantInt>(I.getOperand());
- if (!IdxVal) return MarkUnsafe(Info);
- if (IdxVal->getZExtValue() >= NumElements)
- return MarkUnsafe(Info);
- IsAllZeroIndices &= IdxVal->isZero();
- }
-
- } else {
- IsAllZeroIndices = 0;
-
- // If this is an array index and the index is not constant, we cannot
- // promote... that is unless the array has exactly one or two elements in
- // it, in which case we CAN promote it, but we have to canonicalize this
- // out if this is the only problem.
- if ((NumElements == 1 || NumElements == 2) &&
- AllUsersAreLoads(GEPI)) {
- Info.needsCanon = true;
- return; // Canonicalization required!
- }
- return MarkUnsafe(Info);
- }
- }
-
- // If there are any non-simple uses of this getelementptr, make sure to reject
- // them.
- return isSafeElementUse(GEPI, IsAllZeroIndices, AI, Info);
-}
-
-/// isSafeMemIntrinsicOnAllocation - Return true if the specified memory
-/// intrinsic can be promoted by SROA. At this point, we know that the operand
-/// of the memintrinsic is a pointer to the beginning of the allocation.
-void SROA::isSafeMemIntrinsicOnAllocation(MemIntrinsic *MI, AllocationInst *AI,
- unsigned OpNo, AllocaInfo &Info) {
- // If not constant length, give up.
- ConstantInt *Length = dyn_cast<ConstantInt>(MI->getLength());
- if (!Length) return MarkUnsafe(Info);
-
- // If not the whole aggregate, give up.
- const TargetData &TD = getAnalysis<TargetData>();
- if (Length->getZExtValue() !=
- TD.getABITypeSize(AI->getType()->getElementType()))
- return MarkUnsafe(Info);
-
- // We only know about memcpy/memset/memmove.
- if (!isa<MemCpyInst>(MI) && !isa<MemSetInst>(MI) && !isa<MemMoveInst>(MI))
- return MarkUnsafe(Info);
-
- // Otherwise, we can transform it. Determine whether this is a memcpy/set
- // into or out of the aggregate.
- if (OpNo == 1)
- Info.isMemCpyDst = true;
- else {
- assert(OpNo == 2);
- Info.isMemCpySrc = true;
- }
-}
-
-/// isSafeUseOfBitCastedAllocation - Return true if all users of this bitcast
-/// are
-void SROA::isSafeUseOfBitCastedAllocation(BitCastInst *BC, AllocationInst *AI,
- AllocaInfo &Info) {
- for (Value::use_iterator UI = BC->use_begin(), E = BC->use_end();
- UI != E; ++UI) {
- if (BitCastInst *BCU = dyn_cast<BitCastInst>(UI)) {
- isSafeUseOfBitCastedAllocation(BCU, AI, Info);
- } else if (MemIntrinsic *MI = dyn_cast<MemIntrinsic>(UI)) {
- isSafeMemIntrinsicOnAllocation(MI, AI, UI.getOperandNo(), Info);
- } else {
- return MarkUnsafe(Info);
- }
- if (Info.isUnsafe) return;
- }
-}
-
-/// RewriteBitCastUserOfAlloca - BCInst (transitively) bitcasts AI, or indexes
-/// to its first element. Transform users of the cast to use the new values
-/// instead.
-void SROA::RewriteBitCastUserOfAlloca(Instruction *BCInst, AllocationInst *AI,
- SmallVector<AllocaInst*, 32> &NewElts) {
- Constant *Zero = Constant::getNullValue(Type::Int32Ty);
- const TargetData &TD = getAnalysis<TargetData>();
-
- Value::use_iterator UI = BCInst->use_begin(), UE = BCInst->use_end();
- while (UI != UE) {
- if (BitCastInst *BCU = dyn_cast<BitCastInst>(*UI)) {
- RewriteBitCastUserOfAlloca(BCU, AI, NewElts);
- ++UI;
- BCU->eraseFromParent();
- continue;
- }
-
- // Otherwise, must be memcpy/memmove/memset of the entire aggregate. Split
- // into one per element.
- MemIntrinsic *MI = dyn_cast<MemIntrinsic>(*UI);
-
- // If it's not a mem intrinsic, it must be some other user of a gep of the
- // first pointer. Just leave these alone.
- if (!MI) {
- ++UI;
- continue;
- }
-
- // If this is a memcpy/memmove, construct the other pointer as the
- // appropriate type.
- Value *OtherPtr = 0;
- if (MemCpyInst *MCI = dyn_cast<MemCpyInst>(MI)) {
- if (BCInst == MCI->getRawDest())
- OtherPtr = MCI->getRawSource();
- else {
- assert(BCInst == MCI->getRawSource());
- OtherPtr = MCI->getRawDest();
- }
- } else if (MemMoveInst *MMI = dyn_cast<MemMoveInst>(MI)) {
- if (BCInst == MMI->getRawDest())
- OtherPtr = MMI->getRawSource();
- else {
- assert(BCInst == MMI->getRawSource());
- OtherPtr = MMI->getRawDest();
- }
- }
-
- // If there is an other pointer, we want to convert it to the same pointer
- // type as AI has, so we can GEP through it.
- if (OtherPtr) {
- // It is likely that OtherPtr is a bitcast, if so, remove it.
- if (BitCastInst *BC = dyn_cast<BitCastInst>(OtherPtr))
- OtherPtr = BC->getOperand(0);
- if (ConstantExpr *BCE = dyn_cast<ConstantExpr>(OtherPtr))
- if (BCE->getOpcode() == Instruction::BitCast)
- OtherPtr = BCE->getOperand(0);
-
- // If the pointer is not the right type, insert a bitcast to the right
- // type.
- if (OtherPtr->getType() != AI->getType())
- OtherPtr = new BitCastInst(OtherPtr, AI->getType(), OtherPtr->getName(),
- MI);
- }
-
- // Process each element of the aggregate.
- Value *TheFn = MI->getOperand(0);
- const Type *BytePtrTy = MI->getRawDest()->getType();
- bool SROADest = MI->getRawDest() == BCInst;
-
- for (unsigned i = 0, e = NewElts.size(); i != e; ++i) {
- // If this is a memcpy/memmove, emit a GEP of the other element address.
- Value *OtherElt = 0;
- if (OtherPtr) {
- Value *Idx[2];
- Idx[0] = Zero;
- Idx[1] = ConstantInt::get(Type::Int32Ty, i);
- OtherElt = GetElementPtrInst::Create(OtherPtr, Idx, Idx + 2,
- OtherPtr->getNameStr()+"."+utostr(i),
- MI);
- }
-
- Value *EltPtr = NewElts[i];
- const Type *EltTy =cast<PointerType>(EltPtr->getType())->getElementType();
-
- // If we got down to a scalar, insert a load or store as appropriate.
- if (EltTy->isFirstClassType()) {
- if (isa<MemCpyInst>(MI) || isa<MemMoveInst>(MI)) {
- Value *Elt = new LoadInst(SROADest ? OtherElt : EltPtr, "tmp",
- MI);
- new StoreInst(Elt, SROADest ? EltPtr : OtherElt, MI);
- continue;
- } else {
- assert(isa<MemSetInst>(MI));
-
- // If the stored element is zero (common case), just store a null
- // constant.
- Constant *StoreVal;
- if (ConstantInt *CI = dyn_cast<ConstantInt>(MI->getOperand(2))) {
- if (CI->isZero()) {
- StoreVal = Constant::getNullValue(EltTy); // 0.0, null, 0, <0,0>
- } else {
- // If EltTy is a vector type, get the element type.
- const Type *ValTy = EltTy;
- if (const VectorType *VTy = dyn_cast<VectorType>(ValTy))
- ValTy = VTy->getElementType();
-
- // Construct an integer with the right value.
- unsigned EltSize = TD.getTypeSizeInBits(ValTy);
- APInt OneVal(EltSize, CI->getZExtValue());
- APInt TotalVal(OneVal);
- // Set each byte.
- for (unsigned i = 0; 8*i < EltSize; ++i) {
- TotalVal = TotalVal.shl(8);
- TotalVal |= OneVal;
- }
-
- // Convert the integer value to the appropriate type.
- StoreVal = ConstantInt::get(TotalVal);
- if (isa<PointerType>(ValTy))
- StoreVal = ConstantExpr::getIntToPtr(StoreVal, ValTy);
- else if (ValTy->isFloatingPoint())
- StoreVal = ConstantExpr::getBitCast(StoreVal, ValTy);
- assert(StoreVal->getType() == ValTy && "Type mismatch!");
-
- // If the requested value was a vector constant, create it.
- if (EltTy != ValTy) {
- unsigned NumElts = cast<VectorType>(ValTy)->getNumElements();
- SmallVector<Constant*, 16> Elts(NumElts, StoreVal);
- StoreVal = ConstantVector::get(&Elts[0], NumElts);
- }
- }
- new StoreInst(StoreVal, EltPtr, MI);
- continue;
- }
- // Otherwise, if we're storing a byte variable, use a memset call for
- // this element.
- }
- }
-
- // Cast the element pointer to BytePtrTy.
- if (EltPtr->getType() != BytePtrTy)
- EltPtr = new BitCastInst(EltPtr, BytePtrTy, EltPtr->getNameStr(), MI);
-
- // Cast the other pointer (if we have one) to BytePtrTy.
- if (OtherElt && OtherElt->getType() != BytePtrTy)
- OtherElt = new BitCastInst(OtherElt, BytePtrTy,OtherElt->getNameStr(),
- MI);
-
- unsigned EltSize = TD.getABITypeSize(EltTy);
-
- // Finally, insert the meminst for this element.
- if (isa<MemCpyInst>(MI) || isa<MemMoveInst>(MI)) {
- Value *Ops[] = {
- SROADest ? EltPtr : OtherElt, // Dest ptr
- SROADest ? OtherElt : EltPtr, // Src ptr
- ConstantInt::get(MI->getOperand(3)->getType(), EltSize), // Size
- Zero // Align
- };
- CallInst::Create(TheFn, Ops, Ops + 4, "", MI);
- } else {
- assert(isa<MemSetInst>(MI));
- Value *Ops[] = {
- EltPtr, MI->getOperand(2), // Dest, Value,
- ConstantInt::get(MI->getOperand(3)->getType(), EltSize), // Size
- Zero // Align
- };
- CallInst::Create(TheFn, Ops, Ops + 4, "", MI);
- }
- }
-
- // Finally, MI is now dead, as we've modified its actions to occur on all of
- // the elements of the aggregate.
- ++UI;
- MI->eraseFromParent();
- }
-}
-
-/// HasPadding - Return true if the specified type has any structure or
-/// alignment padding, false otherwise.
-static bool HasPadding(const Type *Ty, const TargetData &TD,
- bool inPacked = false) {
- if (const StructType *STy = dyn_cast<StructType>(Ty)) {
- const StructLayout *SL = TD.getStructLayout(STy);
- unsigned PrevFieldBitOffset = 0;
- for (unsigned i = 0, e = STy->getNumElements(); i != e; ++i) {
- unsigned FieldBitOffset = SL->getElementOffsetInBits(i);
-
- // Padding in sub-elements?
- if (HasPadding(STy->getElementType(i), TD, STy->isPacked()))
- return true;
-
- // Check to see if there is any padding between this element and the
- // previous one.
- if (i) {
- unsigned PrevFieldEnd =
- PrevFieldBitOffset+TD.getTypeSizeInBits(STy->getElementType(i-1));
- if (PrevFieldEnd < FieldBitOffset)
- return true;
- }
-
- PrevFieldBitOffset = FieldBitOffset;
- }
-
- // Check for tail padding.
- if (unsigned EltCount = STy->getNumElements()) {
- unsigned PrevFieldEnd = PrevFieldBitOffset +
- TD.getTypeSizeInBits(STy->getElementType(EltCount-1));
- if (PrevFieldEnd < SL->getSizeInBits())
- return true;
- }
-
- } else if (const ArrayType *ATy = dyn_cast<ArrayType>(Ty)) {
- return HasPadding(ATy->getElementType(), TD, false);
- } else if (const VectorType *VTy = dyn_cast<VectorType>(Ty)) {
- return HasPadding(VTy->getElementType(), TD, false);
- }
- return inPacked ?
- false : TD.getTypeSizeInBits(Ty) != TD.getABITypeSizeInBits(Ty);
-}
-
-/// isSafeStructAllocaToScalarRepl - Check to see if the specified allocation of
-/// an aggregate can be broken down into elements. Return 0 if not, 3 if safe,
-/// or 1 if safe after canonicalization has been performed.
-///
-int SROA::isSafeAllocaToScalarRepl(AllocationInst *AI) {
- // Loop over the use list of the alloca. We can only transform it if all of
- // the users are safe to transform.
- AllocaInfo Info;
-
- for (Value::use_iterator I = AI->use_begin(), E = AI->use_end();
- I != E; ++I) {
- isSafeUseOfAllocation(cast<Instruction>(*I), AI, Info);
- if (Info.isUnsafe) {
- DOUT << "Cannot transform: " << *AI << " due to user: " << **I;
- return 0;
- }
- }
-
- // Okay, we know all the users are promotable. If the aggregate is a memcpy
- // source and destination, we have to be careful. In particular, the memcpy
- // could be moving around elements that live in structure padding of the LLVM
- // types, but may actually be used. In these cases, we refuse to promote the
- // struct.
- if (Info.isMemCpySrc && Info.isMemCpyDst &&
- HasPadding(AI->getType()->getElementType(), getAnalysis<TargetData>()))
- return 0;
-
- // If we require cleanup, return 1, otherwise return 3.
- return Info.needsCanon ? 1 : 3;
-}
-
-/// CanonicalizeAllocaUsers - If SROA reported that it can promote the specified
-/// allocation, but only if cleaned up, perform the cleanups required.
-void SROA::CanonicalizeAllocaUsers(AllocationInst *AI) {
- // At this point, we know that the end result will be SROA'd and promoted, so
- // we can insert ugly code if required so long as sroa+mem2reg will clean it
- // up.
- for (Value::use_iterator UI = AI->use_begin(), E = AI->use_end();
- UI != E; ) {
- GetElementPtrInst *GEPI = dyn_cast<GetElementPtrInst>(*UI++);
- if (!GEPI) continue;
- gep_type_iterator I = gep_type_begin(GEPI);
- ++I;
-
- if (const ArrayType *AT = dyn_cast<ArrayType>(*I)) {
- uint64_t NumElements = AT->getNumElements();
-
- if (!isa<ConstantInt>(I.getOperand())) {
- if (NumElements == 1) {
- GEPI->setOperand(2, Constant::getNullValue(Type::Int32Ty));
- } else {
- assert(NumElements == 2 && "Unhandled case!");
- // All users of the GEP must be loads. At each use of the GEP, insert
- // two loads of the appropriate indexed GEP and select between them.
- Value *IsOne = new ICmpInst(ICmpInst::ICMP_NE, I.getOperand(),
- Constant::getNullValue(I.getOperand()->getType()),
- "isone", GEPI);
- // Insert the new GEP instructions, which are properly indexed.
- SmallVector<Value*, 8> Indices(GEPI->op_begin()+1, GEPI->op_end());
- Indices[1] = Constant::getNullValue(Type::Int32Ty);
- Value *ZeroIdx = GetElementPtrInst::Create(GEPI->getOperand(0),
- Indices.begin(),
- Indices.end(),
- GEPI->getName()+".0", GEPI);
- Indices[1] = ConstantInt::get(Type::Int32Ty, 1);
- Value *OneIdx = GetElementPtrInst::Create(GEPI->getOperand(0),
- Indices.begin(),
- Indices.end(),
- GEPI->getName()+".1", GEPI);
- // Replace all loads of the variable index GEP with loads from both
- // indexes and a select.
- while (!GEPI->use_empty()) {
- LoadInst *LI = cast<LoadInst>(GEPI->use_back());
- Value *Zero = new LoadInst(ZeroIdx, LI->getName()+".0", LI);
- Value *One = new LoadInst(OneIdx , LI->getName()+".1", LI);
- Value *R = SelectInst::Create(IsOne, One, Zero, LI->getName(), LI);
- LI->replaceAllUsesWith(R);
- LI->eraseFromParent();
- }
- GEPI->eraseFromParent();
- }
- }
- }
- }
-}
-
-/// MergeInType - Add the 'In' type to the accumulated type so far. If the
-/// types are incompatible, return true, otherwise update Accum and return
-/// false.
-///
-/// There are three cases we handle here:
-/// 1) An effectively-integer union, where the pieces are stored into as
-/// smaller integers (common with byte swap and other idioms).
-/// 2) A union of vector types of the same size and potentially its elements.
-/// Here we turn element accesses into insert/extract element operations.
-/// 3) A union of scalar types, such as int/float or int/pointer. Here we
-/// merge together into integers, allowing the xform to work with #1 as
-/// well.
-static bool MergeInType(const Type *In, const Type *&Accum,
- const TargetData &TD) {
- // If this is our first type, just use it.
- const VectorType *PTy;
- if (Accum == Type::VoidTy || In == Accum) {
- Accum = In;
- } else if (In == Type::VoidTy) {
- // Noop.
- } else if (In->isInteger() && Accum->isInteger()) { // integer union.
- // Otherwise pick whichever type is larger.
- if (cast<IntegerType>(In)->getBitWidth() >
- cast<IntegerType>(Accum)->getBitWidth())
- Accum = In;
- } else if (isa<PointerType>(In) && isa<PointerType>(Accum)) {
- // Pointer unions just stay as one of the pointers.
- } else if (isa<VectorType>(In) || isa<VectorType>(Accum)) {
- if ((PTy = dyn_cast<VectorType>(Accum)) &&
- PTy->getElementType() == In) {
- // Accum is a vector, and we are accessing an element: ok.
- } else if ((PTy = dyn_cast<VectorType>(In)) &&
- PTy->getElementType() == Accum) {
- // In is a vector, and accum is an element: ok, remember In.
- Accum = In;
- } else if ((PTy = dyn_cast<VectorType>(In)) && isa<VectorType>(Accum) &&
- PTy->getBitWidth() == cast<VectorType>(Accum)->getBitWidth()) {
- // Two vectors of the same size: keep Accum.
- } else {
- // Cannot insert an short into a <4 x int> or handle
- // <2 x int> -> <4 x int>
- return true;
- }
- } else {
- // Pointer/FP/Integer unions merge together as integers.
- switch (Accum->getTypeID()) {
- case Type::PointerTyID: Accum = TD.getIntPtrType(); break;
- case Type::FloatTyID: Accum = Type::Int32Ty; break;
- case Type::DoubleTyID: Accum = Type::Int64Ty; break;
- case Type::X86_FP80TyID: return true;
- case Type::FP128TyID: return true;
- case Type::PPC_FP128TyID: return true;
- default:
- assert(Accum->isInteger() && "Unknown FP type!");
- break;
- }
-
- switch (In->getTypeID()) {
- case Type::PointerTyID: In = TD.getIntPtrType(); break;
- case Type::FloatTyID: In = Type::Int32Ty; break;
- case Type::DoubleTyID: In = Type::Int64Ty; break;
- case Type::X86_FP80TyID: return true;
- case Type::FP128TyID: return true;
- case Type::PPC_FP128TyID: return true;
- default:
- assert(In->isInteger() && "Unknown FP type!");
- break;
- }
- return MergeInType(In, Accum, TD);
- }
- return false;
-}
-
-/// getUIntAtLeastAsBigAs - Return an unsigned integer type that is at least
-/// as big as the specified type. If there is no suitable type, this returns
-/// null.
-const Type *getUIntAtLeastAsBigAs(unsigned NumBits) {
- if (NumBits > 64) return 0;
- if (NumBits > 32) return Type::Int64Ty;
- if (NumBits > 16) return Type::Int32Ty;
- if (NumBits > 8) return Type::Int16Ty;
- return Type::Int8Ty;
-}
-
-/// CanConvertToScalar - V is a pointer. If we can convert the pointee to a
-/// single scalar integer type, return that type. Further, if the use is not
-/// a completely trivial use that mem2reg could promote, set IsNotTrivial. If
-/// there are no uses of this pointer, return Type::VoidTy to differentiate from
-/// failure.
-///
-const Type *SROA::CanConvertToScalar(Value *V, bool &IsNotTrivial) {
- const Type *UsedType = Type::VoidTy; // No uses, no forced type.
- const TargetData &TD = getAnalysis<TargetData>();
- const PointerType *PTy = cast<PointerType>(V->getType());
-
- for (Value::use_iterator UI = V->use_begin(), E = V->use_end(); UI!=E; ++UI) {
- Instruction *User = cast<Instruction>(*UI);
-
- if (LoadInst *LI = dyn_cast<LoadInst>(User)) {
- if (MergeInType(LI->getType(), UsedType, TD))
- return 0;
-
- } else if (StoreInst *SI = dyn_cast<StoreInst>(User)) {
- // Storing the pointer, not into the value?
- if (SI->getOperand(0) == V) return 0;
-
- // NOTE: We could handle storing of FP imms into integers here!
-
- if (MergeInType(SI->getOperand(0)->getType(), UsedType, TD))
- return 0;
- } else if (BitCastInst *CI = dyn_cast<BitCastInst>(User)) {
- IsNotTrivial = true;
- const Type *SubTy = CanConvertToScalar(CI, IsNotTrivial);
- if (!SubTy || MergeInType(SubTy, UsedType, TD)) return 0;
- } else if (GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(User)) {
- // Check to see if this is stepping over an element: GEP Ptr, int C
- if (GEP->getNumOperands() == 2 && isa<ConstantInt>(GEP->getOperand(1))) {
- unsigned Idx = cast<ConstantInt>(GEP->getOperand(1))->getZExtValue();
- unsigned ElSize = TD.getABITypeSize(PTy->getElementType());
- unsigned BitOffset = Idx*ElSize*8;
- if (BitOffset > 64 || !isPowerOf2_32(ElSize)) return 0;
-
- IsNotTrivial = true;
- const Type *SubElt = CanConvertToScalar(GEP, IsNotTrivial);
- if (SubElt == 0) return 0;
- if (SubElt != Type::VoidTy && SubElt->isInteger()) {
- const Type *NewTy =
- getUIntAtLeastAsBigAs(TD.getABITypeSizeInBits(SubElt)+BitOffset);
- if (NewTy == 0 || MergeInType(NewTy, UsedType, TD)) return 0;
- continue;
- }
- } else if (GEP->getNumOperands() == 3 &&
- isa<ConstantInt>(GEP->getOperand(1)) &&
- isa<ConstantInt>(GEP->getOperand(2)) &&
- cast<ConstantInt>(GEP->getOperand(1))->isZero()) {
- // We are stepping into an element, e.g. a structure or an array:
- // GEP Ptr, int 0, uint C
- const Type *AggTy = PTy->getElementType();
- unsigned Idx = cast<ConstantInt>(GEP->getOperand(2))->getZExtValue();
-
- if (const ArrayType *ATy = dyn_cast<ArrayType>(AggTy)) {
- if (Idx >= ATy->getNumElements()) return 0; // Out of range.
- } else if (const VectorType *VectorTy = dyn_cast<VectorType>(AggTy)) {
- // Getting an element of the vector.
- if (Idx >= VectorTy->getNumElements()) return 0; // Out of range.
-
- // Merge in the vector type.
- if (MergeInType(VectorTy, UsedType, TD)) return 0;
-
- const Type *SubTy = CanConvertToScalar(GEP, IsNotTrivial);
- if (SubTy == 0) return 0;
-
- if (SubTy != Type::VoidTy && MergeInType(SubTy, UsedType, TD))
- return 0;
-
- // We'll need to change this to an insert/extract element operation.
- IsNotTrivial = true;
- continue; // Everything looks ok
-
- } else if (isa<StructType>(AggTy)) {
- // Structs are always ok.
- } else {
- return 0;
- }
- const Type *NTy = getUIntAtLeastAsBigAs(TD.getABITypeSizeInBits(AggTy));
- if (NTy == 0 || MergeInType(NTy, UsedType, TD)) return 0;
- const Type *SubTy = CanConvertToScalar(GEP, IsNotTrivial);
- if (SubTy == 0) return 0;
- if (SubTy != Type::VoidTy && MergeInType(SubTy, UsedType, TD))
- return 0;
- continue; // Everything looks ok
- }
- return 0;
- } else {
- // Cannot handle this!
- return 0;
- }
- }
-
- return UsedType;
-}
-
-/// ConvertToScalar - The specified alloca passes the CanConvertToScalar
-/// predicate and is non-trivial. Convert it to something that can be trivially
-/// promoted into a register by mem2reg.
-void SROA::ConvertToScalar(AllocationInst *AI, const Type *ActualTy) {
- DOUT << "CONVERT TO SCALAR: " << *AI << " TYPE = "
- << *ActualTy << "\n";
- ++NumConverted;
-
- BasicBlock *EntryBlock = AI->getParent();
- assert(EntryBlock == &EntryBlock->getParent()->getEntryBlock() &&
- "Not in the entry block!");
- EntryBlock->getInstList().remove(AI); // Take the alloca out of the program.
-
- // Create and insert the alloca.
- AllocaInst *NewAI = new AllocaInst(ActualTy, 0, AI->getName(),
- EntryBlock->begin());
- ConvertUsesToScalar(AI, NewAI, 0);
- delete AI;
-}
-
-
-/// ConvertUsesToScalar - Convert all of the users of Ptr to use the new alloca
-/// directly. This happens when we are converting an "integer union" to a
-/// single integer scalar, or when we are converting a "vector union" to a
-/// vector with insert/extractelement instructions.
-///
-/// Offset is an offset from the original alloca, in bits that need to be
-/// shifted to the right. By the end of this, there should be no uses of Ptr.
-void SROA::ConvertUsesToScalar(Value *Ptr, AllocaInst *NewAI, unsigned Offset) {
- while (!Ptr->use_empty()) {
- Instruction *User = cast<Instruction>(Ptr->use_back());
-
- if (LoadInst *LI = dyn_cast<LoadInst>(User)) {
- Value *NV = ConvertUsesOfLoadToScalar(LI, NewAI, Offset);
- LI->replaceAllUsesWith(NV);
- LI->eraseFromParent();
- } else if (StoreInst *SI = dyn_cast<StoreInst>(User)) {
- assert(SI->getOperand(0) != Ptr && "Consistency error!");
-
- Value *SV = ConvertUsesOfStoreToScalar(SI, NewAI, Offset);
- new StoreInst(SV, NewAI, SI);
- SI->eraseFromParent();
-
- } else if (BitCastInst *CI = dyn_cast<BitCastInst>(User)) {
- ConvertUsesToScalar(CI, NewAI, Offset);
- CI->eraseFromParent();
- } else if (GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(User)) {
- const PointerType *AggPtrTy =
- cast<PointerType>(GEP->getOperand(0)->getType());
- const TargetData &TD = getAnalysis<TargetData>();
- unsigned AggSizeInBits =
- TD.getABITypeSizeInBits(AggPtrTy->getElementType());
-
- // Check to see if this is stepping over an element: GEP Ptr, int C
- unsigned NewOffset = Offset;
- if (GEP->getNumOperands() == 2) {
- unsigned Idx = cast<ConstantInt>(GEP->getOperand(1))->getZExtValue();
- unsigned BitOffset = Idx*AggSizeInBits;
-
- NewOffset += BitOffset;
- } else if (GEP->getNumOperands() == 3) {
- // We know that operand #2 is zero.
- unsigned Idx = cast<ConstantInt>(GEP->getOperand(2))->getZExtValue();
- const Type *AggTy = AggPtrTy->getElementType();
- if (const SequentialType *SeqTy = dyn_cast<SequentialType>(AggTy)) {
- unsigned ElSizeBits =
- TD.getABITypeSizeInBits(SeqTy->getElementType());
-
- NewOffset += ElSizeBits*Idx;
- } else if (const StructType *STy = dyn_cast<StructType>(AggTy)) {
- unsigned EltBitOffset =
- TD.getStructLayout(STy)->getElementOffsetInBits(Idx);
-
- NewOffset += EltBitOffset;
- } else {
- assert(0 && "Unsupported operation!");
- abort();
- }
- } else {
- assert(0 && "Unsupported operation!");
- abort();
- }
- ConvertUsesToScalar(GEP, NewAI, NewOffset);
- GEP->eraseFromParent();
- } else {
- assert(0 && "Unsupported operation!");
- abort();
- }
- }
-}
-
-/// ConvertUsesOfLoadToScalar - Convert all of the users the specified load to
-/// use the new alloca directly, returning the value that should replace the
-/// load. This happens when we are converting an "integer union" to a
-/// single integer scalar, or when we are converting a "vector union" to a
-/// vector with insert/extractelement instructions.
-///
-/// Offset is an offset from the original alloca, in bits that need to be
-/// shifted to the right. By the end of this, there should be no uses of Ptr.
-Value *SROA::ConvertUsesOfLoadToScalar(LoadInst *LI, AllocaInst *NewAI,
- unsigned Offset) {
- // The load is a bit extract from NewAI shifted right by Offset bits.
- Value *NV = new LoadInst(NewAI, LI->getName(), LI);
-
- if (NV->getType() == LI->getType() && Offset == 0) {
- // We win, no conversion needed.
- return NV;
- }
-
- // If the result type of the 'union' is a pointer, then this must be ptr->ptr
- // cast. Anything else would result in NV being an integer.
- if (isa<PointerType>(NV->getType())) {
- assert(isa<PointerType>(LI->getType()));
- return new BitCastInst(NV, LI->getType(), LI->getName(), LI);
- }
-
- if (const VectorType *VTy = dyn_cast<VectorType>(NV->getType())) {
- // If the result alloca is a vector type, this is either an element
- // access or a bitcast to another vector type.
- if (isa<VectorType>(LI->getType()))
- return new BitCastInst(NV, LI->getType(), LI->getName(), LI);
-
- // Otherwise it must be an element access.
- const TargetData &TD = getAnalysis<TargetData>();
- unsigned Elt = 0;
- if (Offset) {
- unsigned EltSize = TD.getABITypeSizeInBits(VTy->getElementType());
- Elt = Offset/EltSize;
- Offset -= EltSize*Elt;
- }
- NV = new ExtractElementInst(NV, ConstantInt::get(Type::Int32Ty, Elt),
- "tmp", LI);
-
- // If we're done, return this element.
- if (NV->getType() == LI->getType() && Offset == 0)
- return NV;
- }
-
- const IntegerType *NTy = cast<IntegerType>(NV->getType());
-
- // If this is a big-endian system and the load is narrower than the
- // full alloca type, we need to do a shift to get the right bits.
- int ShAmt = 0;
- const TargetData &TD = getAnalysis<TargetData>();
- if (TD.isBigEndian()) {
- // On big-endian machines, the lowest bit is stored at the bit offset
- // from the pointer given by getTypeStoreSizeInBits. This matters for
- // integers with a bitwidth that is not a multiple of 8.
- ShAmt = TD.getTypeStoreSizeInBits(NTy) -
- TD.getTypeStoreSizeInBits(LI->getType()) - Offset;
- } else {
- ShAmt = Offset;
- }
-
- // Note: we support negative bitwidths (with shl) which are not defined.
- // We do this to support (f.e.) loads off the end of a structure where
- // only some bits are used.
- if (ShAmt > 0 && (unsigned)ShAmt < NTy->getBitWidth())
- NV = BinaryOperator::createLShr(NV,
- ConstantInt::get(NV->getType(),ShAmt),
- LI->getName(), LI);
- else if (ShAmt < 0 && (unsigned)-ShAmt < NTy->getBitWidth())
- NV = BinaryOperator::createShl(NV,
- ConstantInt::get(NV->getType(),-ShAmt),
- LI->getName(), LI);
-
- // Finally, unconditionally truncate the integer to the right width.
- unsigned LIBitWidth = TD.getTypeSizeInBits(LI->getType());
- if (LIBitWidth < NTy->getBitWidth())
- NV = new TruncInst(NV, IntegerType::get(LIBitWidth),
- LI->getName(), LI);
-
- // If the result is an integer, this is a trunc or bitcast.
- if (isa<IntegerType>(LI->getType())) {
- // Should be done.
- } else if (LI->getType()->isFloatingPoint()) {
- // Just do a bitcast, we know the sizes match up.
- NV = new BitCastInst(NV, LI->getType(), LI->getName(), LI);
- } else {
- // Otherwise must be a pointer.
- NV = new IntToPtrInst(NV, LI->getType(), LI->getName(), LI);
- }
- assert(NV->getType() == LI->getType() && "Didn't convert right?");
- return NV;
-}
-
-
-/// ConvertUsesOfStoreToScalar - Convert the specified store to a load+store
-/// pair of the new alloca directly, returning the value that should be stored
-/// to the alloca. This happens when we are converting an "integer union" to a
-/// single integer scalar, or when we are converting a "vector union" to a
-/// vector with insert/extractelement instructions.
-///
-/// Offset is an offset from the original alloca, in bits that need to be
-/// shifted to the right. By the end of this, there should be no uses of Ptr.
-Value *SROA::ConvertUsesOfStoreToScalar(StoreInst *SI, AllocaInst *NewAI,
- unsigned Offset) {
-
- // Convert the stored type to the actual type, shift it left to insert
- // then 'or' into place.
- Value *SV = SI->getOperand(0);
- const Type *AllocaType = NewAI->getType()->getElementType();
- if (SV->getType() == AllocaType && Offset == 0) {
- // All is well.
- } else if (const VectorType *PTy = dyn_cast<VectorType>(AllocaType)) {
- Value *Old = new LoadInst(NewAI, NewAI->getName()+".in", SI);
-
- // If the result alloca is a vector type, this is either an element
- // access or a bitcast to another vector type.
- if (isa<VectorType>(SV->getType())) {
- SV = new BitCastInst(SV, AllocaType, SV->getName(), SI);
- } else {
- // Must be an element insertion.
- const TargetData &TD = getAnalysis<TargetData>();
- unsigned Elt = Offset/TD.getABITypeSizeInBits(PTy->getElementType());
- SV = InsertElementInst::Create(Old, SV,
- ConstantInt::get(Type::Int32Ty, Elt),
- "tmp", SI);
- }
- } else if (isa<PointerType>(AllocaType)) {
- // If the alloca type is a pointer, then all the elements must be
- // pointers.
- if (SV->getType() != AllocaType)
- SV = new BitCastInst(SV, AllocaType, SV->getName(), SI);
- } else {
- Value *Old = new LoadInst(NewAI, NewAI->getName()+".in", SI);
-
- // If SV is a float, convert it to the appropriate integer type.
- // If it is a pointer, do the same, and also handle ptr->ptr casts
- // here.
- const TargetData &TD = getAnalysis<TargetData>();
- unsigned SrcWidth = TD.getTypeSizeInBits(SV->getType());
- unsigned DestWidth = TD.getTypeSizeInBits(AllocaType);
- unsigned SrcStoreWidth = TD.getTypeStoreSizeInBits(SV->getType());
- unsigned DestStoreWidth = TD.getTypeStoreSizeInBits(AllocaType);
- if (SV->getType()->isFloatingPoint())
- SV = new BitCastInst(SV, IntegerType::get(SrcWidth),
- SV->getName(), SI);
- else if (isa<PointerType>(SV->getType()))
- SV = new PtrToIntInst(SV, TD.getIntPtrType(), SV->getName(), SI);
-
- // Always zero extend the value if needed.
- if (SV->getType() != AllocaType)
- SV = new ZExtInst(SV, AllocaType, SV->getName(), SI);
-
- // If this is a big-endian system and the store is narrower than the
- // full alloca type, we need to do a shift to get the right bits.
- int ShAmt = 0;
- if (TD.isBigEndian()) {
- // On big-endian machines, the lowest bit is stored at the bit offset
- // from the pointer given by getTypeStoreSizeInBits. This matters for
- // integers with a bitwidth that is not a multiple of 8.
- ShAmt = DestStoreWidth - SrcStoreWidth - Offset;
- } else {
- ShAmt = Offset;
- }
-
- // Note: we support negative bitwidths (with shr) which are not defined.
- // We do this to support (f.e.) stores off the end of a structure where
- // only some bits in the structure are set.
- APInt Mask(APInt::getLowBitsSet(DestWidth, SrcWidth));
- if (ShAmt > 0 && (unsigned)ShAmt < DestWidth) {
- SV = BinaryOperator::createShl(SV,
- ConstantInt::get(SV->getType(), ShAmt),
- SV->getName(), SI);
- Mask <<= ShAmt;
- } else if (ShAmt < 0 && (unsigned)-ShAmt < DestWidth) {
- SV = BinaryOperator::createLShr(SV,
- ConstantInt::get(SV->getType(),-ShAmt),
- SV->getName(), SI);
- Mask = Mask.lshr(ShAmt);
- }
-
- // Mask out the bits we are about to insert from the old value, and or
- // in the new bits.
- if (SrcWidth != DestWidth) {
- assert(DestWidth > SrcWidth);
- Old = BinaryOperator::createAnd(Old, ConstantInt::get(~Mask),
- Old->getName()+".mask", SI);
- SV = BinaryOperator::createOr(Old, SV, SV->getName()+".ins", SI);
- }
- }
- return SV;
-}
-
-
-
-/// PointsToConstantGlobal - Return true if V (possibly indirectly) points to
-/// some part of a constant global variable. This intentionally only accepts
-/// constant expressions because we don't can't rewrite arbitrary instructions.
-static bool PointsToConstantGlobal(Value *V) {
- if (GlobalVariable *GV = dyn_cast<GlobalVariable>(V))
- return GV->isConstant();
- if (ConstantExpr *CE = dyn_cast<ConstantExpr>(V))
- if (CE->getOpcode() == Instruction::BitCast ||
- CE->getOpcode() == Instruction::GetElementPtr)
- return PointsToConstantGlobal(CE->getOperand(0));
- return false;
-}
-
-/// isOnlyCopiedFromConstantGlobal - Recursively walk the uses of a (derived)
-/// pointer to an alloca. Ignore any reads of the pointer, return false if we
-/// see any stores or other unknown uses. If we see pointer arithmetic, keep
-/// track of whether it moves the pointer (with isOffset) but otherwise traverse
-/// the uses. If we see a memcpy/memmove that targets an unoffseted pointer to
-/// the alloca, and if the source pointer is a pointer to a constant global, we
-/// can optimize this.
-static bool isOnlyCopiedFromConstantGlobal(Value *V, Instruction *&TheCopy,
- bool isOffset) {
- for (Value::use_iterator UI = V->use_begin(), E = V->use_end(); UI!=E; ++UI) {
- if (isa<LoadInst>(*UI)) {
- // Ignore loads, they are always ok.
- continue;
- }
- if (BitCastInst *BCI = dyn_cast<BitCastInst>(*UI)) {
- // If uses of the bitcast are ok, we are ok.
- if (!isOnlyCopiedFromConstantGlobal(BCI, TheCopy, isOffset))
- return false;
- continue;
- }
- if (GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(*UI)) {
- // If the GEP has all zero indices, it doesn't offset the pointer. If it
- // doesn't, it does.
- if (!isOnlyCopiedFromConstantGlobal(GEP, TheCopy,
- isOffset || !GEP->hasAllZeroIndices()))
- return false;
- continue;
- }
-
- // If this is isn't our memcpy/memmove, reject it as something we can't
- // handle.
- if (!isa<MemCpyInst>(*UI) && !isa<MemMoveInst>(*UI))
- return false;
-
- // If we already have seen a copy, reject the second one.
- if (TheCopy) return false;
-
- // If the pointer has been offset from the start of the alloca, we can't
- // safely handle this.
- if (isOffset) return false;
-
- // If the memintrinsic isn't using the alloca as the dest, reject it.
- if (UI.getOperandNo() != 1) return false;
-
- MemIntrinsic *MI = cast<MemIntrinsic>(*UI);
-
- // If the source of the memcpy/move is not a constant global, reject it.
- if (!PointsToConstantGlobal(MI->getOperand(2)))
- return false;
-
- // Otherwise, the transform is safe. Remember the copy instruction.
- TheCopy = MI;
- }
- return true;
-}
-
-/// isOnlyCopiedFromConstantGlobal - Return true if the specified alloca is only
-/// modified by a copy from a constant global. If we can prove this, we can
-/// replace any uses of the alloca with uses of the global directly.
-Instruction *SROA::isOnlyCopiedFromConstantGlobal(AllocationInst *AI) {
- Instruction *TheCopy = 0;
- if (::isOnlyCopiedFromConstantGlobal(AI, TheCopy, false))
- return TheCopy;
- return 0;
-}
diff --git a/release_23/lib/Transforms/Scalar/SimplifyCFG.cpp b/release_23/lib/Transforms/Scalar/SimplifyCFG.cpp
deleted file mode 100644
index 48342bdc11f1..000000000000
--- a/release_23/lib/Transforms/Scalar/SimplifyCFG.cpp
+++ /dev/null
@@ -1,230 +0,0 @@
-//===- SimplifyCFG.cpp - CFG Simplification Pass --------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements dead code elimination and basic block merging, along
-// with a collection of other peephole control flow optimizations. For example:
-//
-// * Removes basic blocks with no predecessors.
-// * Merges a basic block into its predecessor if there is only one and the
-// predecessor only has one successor.
-// * Eliminates PHI nodes for basic blocks with a single predecessor.
-// * Eliminates a basic block that only contains an unconditional branch.
-// * Changes invoke instructions to nounwind functions to be calls.
-// * Change things like "if (x) if (y)" into "if (x&y)".
-// * etc..
-//
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "simplifycfg"
-#include "llvm/Transforms/Scalar.h"
-#include "llvm/Transforms/Utils/Local.h"
-#include "llvm/Constants.h"
-#include "llvm/Instructions.h"
-#include "llvm/Module.h"
-#include "llvm/ParameterAttributes.h"
-#include "llvm/Support/CFG.h"
-#include "llvm/Support/Compiler.h"
-#include "llvm/Pass.h"
-#include "llvm/ADT/SmallVector.h"
-#include "llvm/ADT/SmallPtrSet.h"
-#include "llvm/ADT/Statistic.h"
-using namespace llvm;
-
-STATISTIC(NumSimpl, "Number of blocks simplified");
-
-namespace {
- struct VISIBILITY_HIDDEN CFGSimplifyPass : public FunctionPass {
- static char ID; // Pass identification, replacement for typeid
- CFGSimplifyPass() : FunctionPass((intptr_t)&ID) {}
-
- virtual bool runOnFunction(Function &F);
- };
- char CFGSimplifyPass::ID = 0;
- RegisterPass<CFGSimplifyPass> X("simplifycfg", "Simplify the CFG");
-}
-
-// Public interface to the CFGSimplification pass
-FunctionPass *llvm::createCFGSimplificationPass() {
- return new CFGSimplifyPass();
-}
-
-/// ChangeToUnreachable - Insert an unreachable instruction before the specified
-/// instruction, making it and the rest of the code in the block dead.
-static void ChangeToUnreachable(Instruction *I) {
- BasicBlock *BB = I->getParent();
- // Loop over all of the successors, removing BB's entry from any PHI
- // nodes.
- for (succ_iterator SI = succ_begin(BB), SE = succ_end(BB); SI != SE; ++SI)
- (*SI)->removePredecessor(BB);
-
- new UnreachableInst(I);
-
- // All instructions after this are dead.
- BasicBlock::iterator BBI = I, BBE = BB->end();
- while (BBI != BBE) {
- if (!BBI->use_empty())
- BBI->replaceAllUsesWith(UndefValue::get(BBI->getType()));
- BB->getInstList().erase(BBI++);
- }
-}
-
-/// ChangeToCall - Convert the specified invoke into a normal call.
-static void ChangeToCall(InvokeInst *II) {
- BasicBlock *BB = II->getParent();
- SmallVector<Value*, 8> Args(II->op_begin()+3, II->op_end());
- CallInst *NewCall = CallInst::Create(II->getCalledValue(), Args.begin(),
- Args.end(), "", II);
- NewCall->takeName(II);
- NewCall->setCallingConv(II->getCallingConv());
- NewCall->setParamAttrs(II->getParamAttrs());
- II->replaceAllUsesWith(NewCall);
-
- // Follow the call by a branch to the normal destination.
- BranchInst::Create(II->getNormalDest(), II);
-
- // Update PHI nodes in the unwind destination
- II->getUnwindDest()->removePredecessor(BB);
- BB->getInstList().erase(II);
-}
-
-static bool MarkAliveBlocks(BasicBlock *BB,
- SmallPtrSet<BasicBlock*, 128> &Reachable) {
-
- SmallVector<BasicBlock*, 128> Worklist;
- Worklist.push_back(BB);
- bool Changed = false;
- while (!Worklist.empty()) {
- BB = Worklist.back();
- Worklist.pop_back();
-
- if (!Reachable.insert(BB))
- continue;
-
- // Do a quick scan of the basic block, turning any obviously unreachable
- // instructions into LLVM unreachable insts. The instruction combining pass
- // canonicalizes unreachable insts into stores to null or undef.
- for (BasicBlock::iterator BBI = BB->begin(), E = BB->end(); BBI != E;++BBI){
- if (CallInst *CI = dyn_cast<CallInst>(BBI)) {
- if (CI->doesNotReturn()) {
- // If we found a call to a no-return function, insert an unreachable
- // instruction after it. Make sure there isn't *already* one there
- // though.
- ++BBI;
- if (!isa<UnreachableInst>(BBI)) {
- ChangeToUnreachable(BBI);
- Changed = true;
- }
- break;
- }
- }
-
- if (StoreInst *SI = dyn_cast<StoreInst>(BBI))
- if (isa<ConstantPointerNull>(SI->getOperand(1)) ||
- isa<UndefValue>(SI->getOperand(1))) {
- ChangeToUnreachable(SI);
- Changed = true;
- break;
- }
- }
-
- // Turn invokes that call 'nounwind' functions into ordinary calls.
- if (InvokeInst *II = dyn_cast<InvokeInst>(BB->getTerminator()))
- if (II->doesNotThrow()) {
- ChangeToCall(II);
- Changed = true;
- }
-
- Changed |= ConstantFoldTerminator(BB);
- for (succ_iterator SI = succ_begin(BB), SE = succ_end(BB); SI != SE; ++SI)
- Worklist.push_back(*SI);
- }
- return Changed;
-}
-
-/// RemoveUnreachableBlocks - Remove blocks that are not reachable, even if they
-/// are in a dead cycle. Return true if a change was made, false otherwise.
-static bool RemoveUnreachableBlocks(Function &F) {
- SmallPtrSet<BasicBlock*, 128> Reachable;
- bool Changed = MarkAliveBlocks(F.begin(), Reachable);
-
- // If there are unreachable blocks in the CFG...
- if (Reachable.size() == F.size())
- return Changed;
-
- assert(Reachable.size() < F.size());
- NumSimpl += F.size()-Reachable.size();
-
- // Loop over all of the basic blocks that are not reachable, dropping all of
- // their internal references...
- for (Function::iterator BB = ++F.begin(), E = F.end(); BB != E; ++BB) {
- if (Reachable.count(BB))
- continue;
-
- for (succ_iterator SI = succ_begin(BB), SE = succ_end(BB); SI != SE; ++SI)
- if (Reachable.count(*SI))
- (*SI)->removePredecessor(BB);
- BB->dropAllReferences();
- }
-
- for (Function::iterator I = ++F.begin(); I != F.end();)
- if (!Reachable.count(I))
- I = F.getBasicBlockList().erase(I);
- else
- ++I;
-
- return true;
-}
-
-/// IterativeSimplifyCFG - Call SimplifyCFG on all the blocks in the function,
-/// iterating until no more changes are made.
-static bool IterativeSimplifyCFG(Function &F) {
- bool Changed = false;
- bool LocalChange = true;
- while (LocalChange) {
- LocalChange = false;
-
- // Loop over all of the basic blocks (except the first one) and remove them
- // if they are unneeded...
- //
- for (Function::iterator BBIt = ++F.begin(); BBIt != F.end(); ) {
- if (SimplifyCFG(BBIt++)) {
- LocalChange = true;
- ++NumSimpl;
- }
- }
- Changed |= LocalChange;
- }
- return Changed;
-}
-
-// It is possible that we may require multiple passes over the code to fully
-// simplify the CFG.
-//
-bool CFGSimplifyPass::runOnFunction(Function &F) {
- bool EverChanged = RemoveUnreachableBlocks(F);
- EverChanged |= IterativeSimplifyCFG(F);
-
- // If neither pass changed anything, we're done.
- if (!EverChanged) return false;
-
- // IterativeSimplifyCFG can (rarely) make some loops dead. If this happens,
- // RemoveUnreachableBlocks is needed to nuke them, which means we should
- // iterate between the two optimizations. We structure the code like this to
- // avoid reruning IterativeSimplifyCFG if the second pass of
- // RemoveUnreachableBlocks doesn't do anything.
- if (!RemoveUnreachableBlocks(F))
- return true;
-
- do {
- EverChanged = IterativeSimplifyCFG(F);
- EverChanged |= RemoveUnreachableBlocks(F);
- } while (EverChanged);
-
- return true;
-}
diff --git a/release_23/lib/Transforms/Scalar/SimplifyLibCalls.cpp b/release_23/lib/Transforms/Scalar/SimplifyLibCalls.cpp
deleted file mode 100644
index 2b5b2b05b2ce..000000000000
--- a/release_23/lib/Transforms/Scalar/SimplifyLibCalls.cpp
+++ /dev/null
@@ -1,1498 +0,0 @@
-//===- SimplifyLibCalls.cpp - Optimize specific well-known library calls --===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements a simple pass that applies a variety of small
-// optimizations for calls to specific well-known function calls (e.g. runtime
-// library functions). For example, a call to the function "exit(3)" that
-// occurs within the main() function can be transformed into a simple "return 3"
-// instruction. Any optimization that takes this form (replace call to library
-// function with simpler code that provides the same result) belongs in this
-// file.
-//
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "simplify-libcalls"
-#include "llvm/Transforms/Scalar.h"
-#include "llvm/Intrinsics.h"
-#include "llvm/Module.h"
-#include "llvm/Pass.h"
-#include "llvm/Support/IRBuilder.h"
-#include "llvm/Target/TargetData.h"
-#include "llvm/ADT/SmallPtrSet.h"
-#include "llvm/ADT/StringMap.h"
-#include "llvm/ADT/Statistic.h"
-#include "llvm/Support/Compiler.h"
-#include "llvm/Support/Debug.h"
-#include "llvm/Config/config.h"
-using namespace llvm;
-
-STATISTIC(NumSimplified, "Number of library calls simplified");
-
-//===----------------------------------------------------------------------===//
-// Optimizer Base Class
-//===----------------------------------------------------------------------===//
-
-/// This class is the abstract base class for the set of optimizations that
-/// corresponds to one library call.
-namespace {
-class VISIBILITY_HIDDEN LibCallOptimization {
-protected:
- Function *Caller;
- const TargetData *TD;
-public:
- LibCallOptimization() { }
- virtual ~LibCallOptimization() {}
-
- /// CallOptimizer - This pure virtual method is implemented by base classes to
- /// do various optimizations. If this returns null then no transformation was
- /// performed. If it returns CI, then it transformed the call and CI is to be
- /// deleted. If it returns something else, replace CI with the new value and
- /// delete CI.
- virtual Value *CallOptimizer(Function *Callee, CallInst *CI, IRBuilder &B) =0;
-
- Value *OptimizeCall(CallInst *CI, const TargetData &TD, IRBuilder &B) {
- Caller = CI->getParent()->getParent();
- this->TD = &TD;
- return CallOptimizer(CI->getCalledFunction(), CI, B);
- }
-
- /// CastToCStr - Return V if it is an i8*, otherwise cast it to i8*.
- Value *CastToCStr(Value *V, IRBuilder &B);
-
- /// EmitStrLen - Emit a call to the strlen function to the builder, for the
- /// specified pointer. Ptr is required to be some pointer type, and the
- /// return value has 'intptr_t' type.
- Value *EmitStrLen(Value *Ptr, IRBuilder &B);
-
- /// EmitMemCpy - Emit a call to the memcpy function to the builder. This
- /// always expects that the size has type 'intptr_t' and Dst/Src are pointers.
- Value *EmitMemCpy(Value *Dst, Value *Src, Value *Len,
- unsigned Align, IRBuilder &B);
-
- /// EmitMemChr - Emit a call to the memchr function. This assumes that Ptr is
- /// a pointer, Val is an i32 value, and Len is an 'intptr_t' value.
- Value *EmitMemChr(Value *Ptr, Value *Val, Value *Len, IRBuilder &B);
-
- /// EmitUnaryFloatFnCall - Emit a call to the unary function named 'Name' (e.g.
- /// 'floor'). This function is known to take a single of type matching 'Op'
- /// and returns one value with the same type. If 'Op' is a long double, 'l'
- /// is added as the suffix of name, if 'Op' is a float, we add a 'f' suffix.
- Value *EmitUnaryFloatFnCall(Value *Op, const char *Name, IRBuilder &B);
-
- /// EmitPutChar - Emit a call to the putchar function. This assumes that Char
- /// is an integer.
- void EmitPutChar(Value *Char, IRBuilder &B);
-
- /// EmitPutS - Emit a call to the puts function. This assumes that Str is
- /// some pointer.
- void EmitPutS(Value *Str, IRBuilder &B);
-
- /// EmitFPutC - Emit a call to the fputc function. This assumes that Char is
- /// an i32, and File is a pointer to FILE.
- void EmitFPutC(Value *Char, Value *File, IRBuilder &B);
-
- /// EmitFPutS - Emit a call to the puts function. Str is required to be a
- /// pointer and File is a pointer to FILE.
- void EmitFPutS(Value *Str, Value *File, IRBuilder &B);
-
- /// EmitFWrite - Emit a call to the fwrite function. This assumes that Ptr is
- /// a pointer, Size is an 'intptr_t', and File is a pointer to FILE.
- void EmitFWrite(Value *Ptr, Value *Size, Value *File, IRBuilder &B);
-
-};
-} // End anonymous namespace.
-
-/// CastToCStr - Return V if it is an i8*, otherwise cast it to i8*.
-Value *LibCallOptimization::CastToCStr(Value *V, IRBuilder &B) {
- return B.CreateBitCast(V, PointerType::getUnqual(Type::Int8Ty), "cstr");
-}
-
-/// EmitStrLen - Emit a call to the strlen function to the builder, for the
-/// specified pointer. This always returns an integer value of size intptr_t.
-Value *LibCallOptimization::EmitStrLen(Value *Ptr, IRBuilder &B) {
- Module *M = Caller->getParent();
- Constant *StrLen =M->getOrInsertFunction("strlen", TD->getIntPtrType(),
- PointerType::getUnqual(Type::Int8Ty),
- NULL);
- return B.CreateCall(StrLen, CastToCStr(Ptr, B), "strlen");
-}
-
-/// EmitMemCpy - Emit a call to the memcpy function to the builder. This always
-/// expects that the size has type 'intptr_t' and Dst/Src are pointers.
-Value *LibCallOptimization::EmitMemCpy(Value *Dst, Value *Src, Value *Len,
- unsigned Align, IRBuilder &B) {
- Module *M = Caller->getParent();
- Intrinsic::ID IID = TD->getIntPtrType() == Type::Int32Ty ?
- Intrinsic::memcpy_i32 : Intrinsic::memcpy_i64;
- Value *MemCpy = Intrinsic::getDeclaration(M, IID);
- return B.CreateCall4(MemCpy, CastToCStr(Dst, B), CastToCStr(Src, B), Len,
- ConstantInt::get(Type::Int32Ty, Align));
-}
-
-/// EmitMemChr - Emit a call to the memchr function. This assumes that Ptr is
-/// a pointer, Val is an i32 value, and Len is an 'intptr_t' value.
-Value *LibCallOptimization::EmitMemChr(Value *Ptr, Value *Val,
- Value *Len, IRBuilder &B) {
- Module *M = Caller->getParent();
- Value *MemChr = M->getOrInsertFunction("memchr",
- PointerType::getUnqual(Type::Int8Ty),
- PointerType::getUnqual(Type::Int8Ty),
- Type::Int32Ty, TD->getIntPtrType(),
- NULL);
- return B.CreateCall3(MemChr, CastToCStr(Ptr, B), Val, Len, "memchr");
-}
-
-/// EmitUnaryFloatFnCall - Emit a call to the unary function named 'Name' (e.g.
-/// 'floor'). This function is known to take a single of type matching 'Op' and
-/// returns one value with the same type. If 'Op' is a long double, 'l' is
-/// added as the suffix of name, if 'Op' is a float, we add a 'f' suffix.
-Value *LibCallOptimization::EmitUnaryFloatFnCall(Value *Op, const char *Name,
- IRBuilder &B) {
- char NameBuffer[20];
- if (Op->getType() != Type::DoubleTy) {
- // If we need to add a suffix, copy into NameBuffer.
- unsigned NameLen = strlen(Name);
- assert(NameLen < sizeof(NameBuffer)-2);
- memcpy(NameBuffer, Name, NameLen);
- if (Op->getType() == Type::FloatTy)
- NameBuffer[NameLen] = 'f'; // floorf
- else
- NameBuffer[NameLen] = 'l'; // floorl
- NameBuffer[NameLen+1] = 0;
- Name = NameBuffer;
- }
-
- Module *M = Caller->getParent();
- Value *Callee = M->getOrInsertFunction(Name, Op->getType(),
- Op->getType(), NULL);
- return B.CreateCall(Callee, Op, Name);
-}
-
-/// EmitPutChar - Emit a call to the putchar function. This assumes that Char
-/// is an integer.
-void LibCallOptimization::EmitPutChar(Value *Char, IRBuilder &B) {
- Module *M = Caller->getParent();
- Value *F = M->getOrInsertFunction("putchar", Type::Int32Ty,
- Type::Int32Ty, NULL);
- B.CreateCall(F, B.CreateIntCast(Char, Type::Int32Ty, "chari"), "putchar");
-}
-
-/// EmitPutS - Emit a call to the puts function. This assumes that Str is
-/// some pointer.
-void LibCallOptimization::EmitPutS(Value *Str, IRBuilder &B) {
- Module *M = Caller->getParent();
- Value *F = M->getOrInsertFunction("puts", Type::Int32Ty,
- PointerType::getUnqual(Type::Int8Ty), NULL);
- B.CreateCall(F, CastToCStr(Str, B), "puts");
-}
-
-/// EmitFPutC - Emit a call to the fputc function. This assumes that Char is
-/// an integer and File is a pointer to FILE.
-void LibCallOptimization::EmitFPutC(Value *Char, Value *File, IRBuilder &B) {
- Module *M = Caller->getParent();
- Constant *F = M->getOrInsertFunction("fputc", Type::Int32Ty, Type::Int32Ty,
- File->getType(), NULL);
- Char = B.CreateIntCast(Char, Type::Int32Ty, "chari");
- B.CreateCall2(F, Char, File, "fputc");
-}
-
-/// EmitFPutS - Emit a call to the puts function. Str is required to be a
-/// pointer and File is a pointer to FILE.
-void LibCallOptimization::EmitFPutS(Value *Str, Value *File, IRBuilder &B) {
- Module *M = Caller->getParent();
- Constant *F = M->getOrInsertFunction("fputs", Type::Int32Ty,
- PointerType::getUnqual(Type::Int8Ty),
- File->getType(), NULL);
- B.CreateCall2(F, CastToCStr(Str, B), File, "fputs");
-}
-
-/// EmitFWrite - Emit a call to the fwrite function. This assumes that Ptr is
-/// a pointer, Size is an 'intptr_t', and File is a pointer to FILE.
-void LibCallOptimization::EmitFWrite(Value *Ptr, Value *Size, Value *File,
- IRBuilder &B) {
- Module *M = Caller->getParent();
- Constant *F = M->getOrInsertFunction("fwrite", TD->getIntPtrType(),
- PointerType::getUnqual(Type::Int8Ty),
- TD->getIntPtrType(), TD->getIntPtrType(),
- File->getType(), NULL);
- B.CreateCall4(F, CastToCStr(Ptr, B), Size,
- ConstantInt::get(TD->getIntPtrType(), 1), File);
-}
-
-//===----------------------------------------------------------------------===//
-// Helper Functions
-//===----------------------------------------------------------------------===//
-
-/// GetConstantStringInfo - This function computes the length of a
-/// null-terminated C string pointed to by V. If successful, it returns true
-/// and returns the string in Str. If unsuccessful, it returns false.
-static bool GetConstantStringInfo(Value *V, std::string &Str) {
- // Look bitcast instructions.
- if (BitCastInst *BCI = dyn_cast<BitCastInst>(V))
- return GetConstantStringInfo(BCI->getOperand(0), Str);
-
- // If the value is not a GEP instruction nor a constant expression with a
- // GEP instruction, then return false because ConstantArray can't occur
- // any other way
- User *GEP = 0;
- if (GetElementPtrInst *GEPI = dyn_cast<GetElementPtrInst>(V)) {
- GEP = GEPI;
- } else if (ConstantExpr *CE = dyn_cast<ConstantExpr>(V)) {
- if (CE->getOpcode() != Instruction::GetElementPtr)
- return false;
- GEP = CE;
- } else {
- return false;
- }
-
- // Make sure the GEP has exactly three arguments.
- if (GEP->getNumOperands() != 3)
- return false;
-
- // Check to make sure that the first operand of the GEP is an integer and
- // has value 0 so that we are sure we're indexing into the initializer.
- if (ConstantInt *Idx = dyn_cast<ConstantInt>(GEP->getOperand(1))) {
- if (!Idx->isZero())
- return false;
- } else
- return false;
-
- // If the second index isn't a ConstantInt, then this is a variable index
- // into the array. If this occurs, we can't say anything meaningful about
- // the string.
- uint64_t StartIdx = 0;
- if (ConstantInt *CI = dyn_cast<ConstantInt>(GEP->getOperand(2)))
- StartIdx = CI->getZExtValue();
- else
- return false;
-
- // The GEP instruction, constant or instruction, must reference a global
- // variable that is a constant and is initialized. The referenced constant
- // initializer is the array that we'll use for optimization.
- GlobalVariable* GV = dyn_cast<GlobalVariable>(GEP->getOperand(0));
- if (!GV || !GV->isConstant() || !GV->hasInitializer())
- return false;
- Constant *GlobalInit = GV->getInitializer();
-
- // Handle the ConstantAggregateZero case
- if (isa<ConstantAggregateZero>(GlobalInit)) {
- // This is a degenerate case. The initializer is constant zero so the
- // length of the string must be zero.
- Str.clear();
- return true;
- }
-
- // Must be a Constant Array
- ConstantArray *Array = dyn_cast<ConstantArray>(GlobalInit);
- if (Array == 0 || Array->getType()->getElementType() != Type::Int8Ty)
- return false;
-
- // Get the number of elements in the array
- uint64_t NumElts = Array->getType()->getNumElements();
-
- // Traverse the constant array from StartIdx (derived above) which is
- // the place the GEP refers to in the array.
- for (unsigned i = StartIdx; i < NumElts; ++i) {
- Constant *Elt = Array->getOperand(i);
- ConstantInt *CI = dyn_cast<ConstantInt>(Elt);
- if (!CI) // This array isn't suitable, non-int initializer.
- return false;
- if (CI->isZero())
- return true; // we found end of string, success!
- Str += (char)CI->getZExtValue();
- }
-
- return false; // The array isn't null terminated.
-}
-
-/// GetStringLengthH - If we can compute the length of the string pointed to by
-/// the specified pointer, return 'len+1'. If we can't, return 0.
-static uint64_t GetStringLengthH(Value *V, SmallPtrSet<PHINode*, 32> &PHIs) {
- // Look through noop bitcast instructions.
- if (BitCastInst *BCI = dyn_cast<BitCastInst>(V))
- return GetStringLengthH(BCI->getOperand(0), PHIs);
-
- // If this is a PHI node, there are two cases: either we have already seen it
- // or we haven't.
- if (PHINode *PN = dyn_cast<PHINode>(V)) {
- if (!PHIs.insert(PN))
- return ~0ULL; // already in the set.
-
- // If it was new, see if all the input strings are the same length.
- uint64_t LenSoFar = ~0ULL;
- for (unsigned i = 0, e = PN->getNumIncomingValues(); i != e; ++i) {
- uint64_t Len = GetStringLengthH(PN->getIncomingValue(i), PHIs);
- if (Len == 0) return 0; // Unknown length -> unknown.
-
- if (Len == ~0ULL) continue;
-
- if (Len != LenSoFar && LenSoFar != ~0ULL)
- return 0; // Disagree -> unknown.
- LenSoFar = Len;
- }
-
- // Success, all agree.
- return LenSoFar;
- }
-
- // strlen(select(c,x,y)) -> strlen(x) ^ strlen(y)
- if (SelectInst *SI = dyn_cast<SelectInst>(V)) {
- uint64_t Len1 = GetStringLengthH(SI->getTrueValue(), PHIs);
- if (Len1 == 0) return 0;
- uint64_t Len2 = GetStringLengthH(SI->getFalseValue(), PHIs);
- if (Len2 == 0) return 0;
- if (Len1 == ~0ULL) return Len2;
- if (Len2 == ~0ULL) return Len1;
- if (Len1 != Len2) return 0;
- return Len1;
- }
-
- // If the value is not a GEP instruction nor a constant expression with a
- // GEP instruction, then return unknown.
- User *GEP = 0;
- if (GetElementPtrInst *GEPI = dyn_cast<GetElementPtrInst>(V)) {
- GEP = GEPI;
- } else if (ConstantExpr *CE = dyn_cast<ConstantExpr>(V)) {
- if (CE->getOpcode() != Instruction::GetElementPtr)
- return 0;
- GEP = CE;
- } else {
- return 0;
- }
-
- // Make sure the GEP has exactly three arguments.
- if (GEP->getNumOperands() != 3)
- return 0;
-
- // Check to make sure that the first operand of the GEP is an integer and
- // has value 0 so that we are sure we're indexing into the initializer.
- if (ConstantInt *Idx = dyn_cast<ConstantInt>(GEP->getOperand(1))) {
- if (!Idx->isZero())
- return 0;
- } else
- return 0;
-
- // If the second index isn't a ConstantInt, then this is a variable index
- // into the array. If this occurs, we can't say anything meaningful about
- // the string.
- uint64_t StartIdx = 0;
- if (ConstantInt *CI = dyn_cast<ConstantInt>(GEP->getOperand(2)))
- StartIdx = CI->getZExtValue();
- else
- return 0;
-
- // The GEP instruction, constant or instruction, must reference a global
- // variable that is a constant and is initialized. The referenced constant
- // initializer is the array that we'll use for optimization.
- GlobalVariable* GV = dyn_cast<GlobalVariable>(GEP->getOperand(0));
- if (!GV || !GV->isConstant() || !GV->hasInitializer())
- return 0;
- Constant *GlobalInit = GV->getInitializer();
-
- // Handle the ConstantAggregateZero case, which is a degenerate case. The
- // initializer is constant zero so the length of the string must be zero.
- if (isa<ConstantAggregateZero>(GlobalInit))
- return 1; // Len = 0 offset by 1.
-
- // Must be a Constant Array
- ConstantArray *Array = dyn_cast<ConstantArray>(GlobalInit);
- if (!Array || Array->getType()->getElementType() != Type::Int8Ty)
- return false;
-
- // Get the number of elements in the array
- uint64_t NumElts = Array->getType()->getNumElements();
-
- // Traverse the constant array from StartIdx (derived above) which is
- // the place the GEP refers to in the array.
- for (unsigned i = StartIdx; i != NumElts; ++i) {
- Constant *Elt = Array->getOperand(i);
- ConstantInt *CI = dyn_cast<ConstantInt>(Elt);
- if (!CI) // This array isn't suitable, non-int initializer.
- return 0;
- if (CI->isZero())
- return i-StartIdx+1; // We found end of string, success!
- }
-
- return 0; // The array isn't null terminated, conservatively return 'unknown'.
-}
-
-/// GetStringLength - If we can compute the length of the string pointed to by
-/// the specified pointer, return 'len+1'. If we can't, return 0.
-static uint64_t GetStringLength(Value *V) {
- if (!isa<PointerType>(V->getType())) return 0;
-
- SmallPtrSet<PHINode*, 32> PHIs;
- uint64_t Len = GetStringLengthH(V, PHIs);
- // If Len is ~0ULL, we had an infinite phi cycle: this is dead code, so return
- // an empty string as a length.
- return Len == ~0ULL ? 1 : Len;
-}
-
-/// IsOnlyUsedInZeroEqualityComparison - Return true if it only matters that the
-/// value is equal or not-equal to zero.
-static bool IsOnlyUsedInZeroEqualityComparison(Value *V) {
- for (Value::use_iterator UI = V->use_begin(), E = V->use_end();
- UI != E; ++UI) {
- if (ICmpInst *IC = dyn_cast<ICmpInst>(*UI))
- if (IC->isEquality())
- if (Constant *C = dyn_cast<Constant>(IC->getOperand(1)))
- if (C->isNullValue())
- continue;
- // Unknown instruction.
- return false;
- }
- return true;
-}
-
-//===----------------------------------------------------------------------===//
-// Miscellaneous LibCall Optimizations
-//===----------------------------------------------------------------------===//
-
-namespace {
-//===---------------------------------------===//
-// 'exit' Optimizations
-
-/// ExitOpt - int main() { exit(4); } --> int main() { return 4; }
-struct VISIBILITY_HIDDEN ExitOpt : public LibCallOptimization {
- virtual Value *CallOptimizer(Function *Callee, CallInst *CI, IRBuilder &B) {
- // Verify we have a reasonable prototype for exit.
- if (Callee->arg_size() == 0 || !CI->use_empty())
- return 0;
-
- // Verify the caller is main, and that the result type of main matches the
- // argument type of exit.
- if (!Caller->isName("main") || !Caller->hasExternalLinkage() ||
- Caller->getReturnType() != CI->getOperand(1)->getType())
- return 0;
-
- TerminatorInst *OldTI = CI->getParent()->getTerminator();
-
- // Create the return after the call.
- ReturnInst *RI = B.CreateRet(CI->getOperand(1));
-
- // Drop all successor phi node entries.
- for (unsigned i = 0, e = OldTI->getNumSuccessors(); i != e; ++i)
- OldTI->getSuccessor(i)->removePredecessor(CI->getParent());
-
- // Erase all instructions from after our return instruction until the end of
- // the block.
- BasicBlock::iterator FirstDead = RI; ++FirstDead;
- CI->getParent()->getInstList().erase(FirstDead, CI->getParent()->end());
- return CI;
- }
-};
-
-//===----------------------------------------------------------------------===//
-// String and Memory LibCall Optimizations
-//===----------------------------------------------------------------------===//
-
-//===---------------------------------------===//
-// 'strcat' Optimizations
-
-struct VISIBILITY_HIDDEN StrCatOpt : public LibCallOptimization {
- virtual Value *CallOptimizer(Function *Callee, CallInst *CI, IRBuilder &B) {
- // Verify the "strcat" function prototype.
- const FunctionType *FT = Callee->getFunctionType();
- if (FT->getNumParams() != 2 ||
- FT->getReturnType() != PointerType::getUnqual(Type::Int8Ty) ||
- FT->getParamType(0) != FT->getReturnType() ||
- FT->getParamType(1) != FT->getReturnType())
- return 0;
-
- // Extract some information from the instruction
- Value *Dst = CI->getOperand(1);
- Value *Src = CI->getOperand(2);
-
- // See if we can get the length of the input string.
- uint64_t Len = GetStringLength(Src);
- if (Len == 0) return 0;
- --Len; // Unbias length.
-
- // Handle the simple, do-nothing case: strcat(x, "") -> x
- if (Len == 0)
- return Dst;
-
- // We need to find the end of the destination string. That's where the
- // memory is to be moved to. We just generate a call to strlen.
- Value *DstLen = EmitStrLen(Dst, B);
-
- // Now that we have the destination's length, we must index into the
- // destination's pointer to get the actual memcpy destination (end of
- // the string .. we're concatenating).
- Dst = B.CreateGEP(Dst, DstLen, "endptr");
-
- // We have enough information to now generate the memcpy call to do the
- // concatenation for us. Make a memcpy to copy the nul byte with align = 1.
- EmitMemCpy(Dst, Src, ConstantInt::get(TD->getIntPtrType(), Len+1), 1, B);
- return Dst;
- }
-};
-
-//===---------------------------------------===//
-// 'strchr' Optimizations
-
-struct VISIBILITY_HIDDEN StrChrOpt : public LibCallOptimization {
- virtual Value *CallOptimizer(Function *Callee, CallInst *CI, IRBuilder &B) {
- // Verify the "strchr" function prototype.
- const FunctionType *FT = Callee->getFunctionType();
- if (FT->getNumParams() != 2 ||
- FT->getReturnType() != PointerType::getUnqual(Type::Int8Ty) ||
- FT->getParamType(0) != FT->getReturnType())
- return 0;
-
- Value *SrcStr = CI->getOperand(1);
-
- // If the second operand is non-constant, see if we can compute the length
- // of the input string and turn this into memchr.
- ConstantInt *CharC = dyn_cast<ConstantInt>(CI->getOperand(2));
- if (CharC == 0) {
- uint64_t Len = GetStringLength(SrcStr);
- if (Len == 0 || FT->getParamType(1) != Type::Int32Ty) // memchr needs i32.
- return 0;
-
- return EmitMemChr(SrcStr, CI->getOperand(2), // include nul.
- ConstantInt::get(TD->getIntPtrType(), Len), B);
- }
-
- // Otherwise, the character is a constant, see if the first argument is
- // a string literal. If so, we can constant fold.
- std::string Str;
- if (!GetConstantStringInfo(SrcStr, Str))
- return 0;
-
- // strchr can find the nul character.
- Str += '\0';
- char CharValue = CharC->getSExtValue();
-
- // Compute the offset.
- uint64_t i = 0;
- while (1) {
- if (i == Str.size()) // Didn't find the char. strchr returns null.
- return Constant::getNullValue(CI->getType());
- // Did we find our match?
- if (Str[i] == CharValue)
- break;
- ++i;
- }
-
- // strchr(s+n,c) -> gep(s+n+i,c)
- Value *Idx = ConstantInt::get(Type::Int64Ty, i);
- return B.CreateGEP(SrcStr, Idx, "strchr");
- }
-};
-
-//===---------------------------------------===//
-// 'strcmp' Optimizations
-
-struct VISIBILITY_HIDDEN StrCmpOpt : public LibCallOptimization {
- virtual Value *CallOptimizer(Function *Callee, CallInst *CI, IRBuilder &B) {
- // Verify the "strcmp" function prototype.
- const FunctionType *FT = Callee->getFunctionType();
- if (FT->getNumParams() != 2 || FT->getReturnType() != Type::Int32Ty ||
- FT->getParamType(0) != FT->getParamType(1) ||
- FT->getParamType(0) != PointerType::getUnqual(Type::Int8Ty))
- return 0;
-
- Value *Str1P = CI->getOperand(1), *Str2P = CI->getOperand(2);
- if (Str1P == Str2P) // strcmp(x,x) -> 0
- return ConstantInt::get(CI->getType(), 0);
-
- std::string Str1, Str2;
- bool HasStr1 = GetConstantStringInfo(Str1P, Str1);
- bool HasStr2 = GetConstantStringInfo(Str2P, Str2);
-
- if (HasStr1 && Str1.empty()) // strcmp("", x) -> *x
- return B.CreateZExt(B.CreateLoad(Str2P, "strcmpload"), CI->getType());
-
- if (HasStr2 && Str2.empty()) // strcmp(x,"") -> *x
- return B.CreateZExt(B.CreateLoad(Str1P, "strcmpload"), CI->getType());
-
- // strcmp(x, y) -> cnst (if both x and y are constant strings)
- if (HasStr1 && HasStr2)
- return ConstantInt::get(CI->getType(), strcmp(Str1.c_str(),Str2.c_str()));
- return 0;
- }
-};
-
-//===---------------------------------------===//
-// 'strncmp' Optimizations
-
-struct VISIBILITY_HIDDEN StrNCmpOpt : public LibCallOptimization {
- virtual Value *CallOptimizer(Function *Callee, CallInst *CI, IRBuilder &B) {
- // Verify the "strncmp" function prototype.
- const FunctionType *FT = Callee->getFunctionType();
- if (FT->getNumParams() != 3 || FT->getReturnType() != Type::Int32Ty ||
- FT->getParamType(0) != FT->getParamType(1) ||
- FT->getParamType(0) != PointerType::getUnqual(Type::Int8Ty) ||
- !isa<IntegerType>(FT->getParamType(2)))
- return 0;
-
- Value *Str1P = CI->getOperand(1), *Str2P = CI->getOperand(2);
- if (Str1P == Str2P) // strncmp(x,x,n) -> 0
- return ConstantInt::get(CI->getType(), 0);
-
- // Get the length argument if it is constant.
- uint64_t Length;
- if (ConstantInt *LengthArg = dyn_cast<ConstantInt>(CI->getOperand(3)))
- Length = LengthArg->getZExtValue();
- else
- return 0;
-
- if (Length == 0) // strncmp(x,y,0) -> 0
- return ConstantInt::get(CI->getType(), 0);
-
- std::string Str1, Str2;
- bool HasStr1 = GetConstantStringInfo(Str1P, Str1);
- bool HasStr2 = GetConstantStringInfo(Str2P, Str2);
-
- if (HasStr1 && Str1.empty()) // strncmp("", x, n) -> *x
- return B.CreateZExt(B.CreateLoad(Str2P, "strcmpload"), CI->getType());
-
- if (HasStr2 && Str2.empty()) // strncmp(x, "", n) -> *x
- return B.CreateZExt(B.CreateLoad(Str1P, "strcmpload"), CI->getType());
-
- // strncmp(x, y) -> cnst (if both x and y are constant strings)
- if (HasStr1 && HasStr2)
- return ConstantInt::get(CI->getType(),
- strncmp(Str1.c_str(), Str2.c_str(), Length));
- return 0;
- }
-};
-
-
-//===---------------------------------------===//
-// 'strcpy' Optimizations
-
-struct VISIBILITY_HIDDEN StrCpyOpt : public LibCallOptimization {
- virtual Value *CallOptimizer(Function *Callee, CallInst *CI, IRBuilder &B) {
- // Verify the "strcpy" function prototype.
- const FunctionType *FT = Callee->getFunctionType();
- if (FT->getNumParams() != 2 || FT->getReturnType() != FT->getParamType(0) ||
- FT->getParamType(0) != FT->getParamType(1) ||
- FT->getParamType(0) != PointerType::getUnqual(Type::Int8Ty))
- return 0;
-
- Value *Dst = CI->getOperand(1), *Src = CI->getOperand(2);
- if (Dst == Src) // strcpy(x,x) -> x
- return Src;
-
- // See if we can get the length of the input string.
- uint64_t Len = GetStringLength(Src);
- if (Len == 0) return 0;
-
- // We have enough information to now generate the memcpy call to do the
- // concatenation for us. Make a memcpy to copy the nul byte with align = 1.
- EmitMemCpy(Dst, Src, ConstantInt::get(TD->getIntPtrType(), Len), 1, B);
- return Dst;
- }
-};
-
-
-
-//===---------------------------------------===//
-// 'strlen' Optimizations
-
-struct VISIBILITY_HIDDEN StrLenOpt : public LibCallOptimization {
- virtual Value *CallOptimizer(Function *Callee, CallInst *CI, IRBuilder &B) {
- const FunctionType *FT = Callee->getFunctionType();
- if (FT->getNumParams() != 1 ||
- FT->getParamType(0) != PointerType::getUnqual(Type::Int8Ty) ||
- !isa<IntegerType>(FT->getReturnType()))
- return 0;
-
- Value *Src = CI->getOperand(1);
-
- // Constant folding: strlen("xyz") -> 3
- if (uint64_t Len = GetStringLength(Src))
- return ConstantInt::get(CI->getType(), Len-1);
-
- // Handle strlen(p) != 0.
- if (!IsOnlyUsedInZeroEqualityComparison(CI)) return 0;
-
- // strlen(x) != 0 --> *x != 0
- // strlen(x) == 0 --> *x == 0
- return B.CreateZExt(B.CreateLoad(Src, "strlenfirst"), CI->getType());
- }
-};
-
-//===---------------------------------------===//
-// 'memcmp' Optimizations
-
-struct VISIBILITY_HIDDEN MemCmpOpt : public LibCallOptimization {
- virtual Value *CallOptimizer(Function *Callee, CallInst *CI, IRBuilder &B) {
- const FunctionType *FT = Callee->getFunctionType();
- if (FT->getNumParams() != 3 || !isa<PointerType>(FT->getParamType(0)) ||
- !isa<PointerType>(FT->getParamType(1)) ||
- FT->getReturnType() != Type::Int32Ty)
- return 0;
-
- Value *LHS = CI->getOperand(1), *RHS = CI->getOperand(2);
-
- if (LHS == RHS) // memcmp(s,s,x) -> 0
- return Constant::getNullValue(CI->getType());
-
- // Make sure we have a constant length.
- ConstantInt *LenC = dyn_cast<ConstantInt>(CI->getOperand(3));
- if (!LenC) return 0;
- uint64_t Len = LenC->getZExtValue();
-
- if (Len == 0) // memcmp(s1,s2,0) -> 0
- return Constant::getNullValue(CI->getType());
-
- if (Len == 1) { // memcmp(S1,S2,1) -> *LHS - *RHS
- Value *LHSV = B.CreateLoad(CastToCStr(LHS, B), "lhsv");
- Value *RHSV = B.CreateLoad(CastToCStr(RHS, B), "rhsv");
- return B.CreateZExt(B.CreateSub(LHSV, RHSV, "chardiff"), CI->getType());
- }
-
- // memcmp(S1,S2,2) != 0 -> (*(short*)LHS ^ *(short*)RHS) != 0
- // memcmp(S1,S2,4) != 0 -> (*(int*)LHS ^ *(int*)RHS) != 0
- if ((Len == 2 || Len == 4) && IsOnlyUsedInZeroEqualityComparison(CI)) {
- LHS = B.CreateBitCast(LHS, PointerType::getUnqual(Type::Int16Ty), "tmp");
- RHS = B.CreateBitCast(RHS, LHS->getType(), "tmp");
- LoadInst *LHSV = B.CreateLoad(LHS, "lhsv");
- LoadInst *RHSV = B.CreateLoad(RHS, "rhsv");
- LHSV->setAlignment(1); RHSV->setAlignment(1); // Unaligned loads.
- return B.CreateZExt(B.CreateXor(LHSV, RHSV, "shortdiff"), CI->getType());
- }
-
- return 0;
- }
-};
-
-//===---------------------------------------===//
-// 'memcpy' Optimizations
-
-struct VISIBILITY_HIDDEN MemCpyOpt : public LibCallOptimization {
- virtual Value *CallOptimizer(Function *Callee, CallInst *CI, IRBuilder &B) {
- const FunctionType *FT = Callee->getFunctionType();
- if (FT->getNumParams() != 3 || FT->getReturnType() != FT->getParamType(0) ||
- !isa<PointerType>(FT->getParamType(0)) ||
- !isa<PointerType>(FT->getParamType(1)) ||
- FT->getParamType(2) != TD->getIntPtrType())
- return 0;
-
- // memcpy(x, y, n) -> llvm.memcpy(x, y, n, 1)
- EmitMemCpy(CI->getOperand(1), CI->getOperand(2), CI->getOperand(3), 1, B);
- return CI->getOperand(1);
- }
-};
-
-//===----------------------------------------------------------------------===//
-// Math Library Optimizations
-//===----------------------------------------------------------------------===//
-
-//===---------------------------------------===//
-// 'pow*' Optimizations
-
-struct VISIBILITY_HIDDEN PowOpt : public LibCallOptimization {
- virtual Value *CallOptimizer(Function *Callee, CallInst *CI, IRBuilder &B) {
- const FunctionType *FT = Callee->getFunctionType();
- // Just make sure this has 2 arguments of the same FP type, which match the
- // result type.
- if (FT->getNumParams() != 2 || FT->getReturnType() != FT->getParamType(0) ||
- FT->getParamType(0) != FT->getParamType(1) ||
- !FT->getParamType(0)->isFloatingPoint())
- return 0;
-
- Value *Op1 = CI->getOperand(1), *Op2 = CI->getOperand(2);
- if (ConstantFP *Op1C = dyn_cast<ConstantFP>(Op1)) {
- if (Op1C->isExactlyValue(1.0)) // pow(1.0, x) -> 1.0
- return Op1C;
- if (Op1C->isExactlyValue(2.0)) // pow(2.0, x) -> exp2(x)
- return EmitUnaryFloatFnCall(Op2, "exp2", B);
- }
-
- ConstantFP *Op2C = dyn_cast<ConstantFP>(Op2);
- if (Op2C == 0) return 0;
-
- if (Op2C->getValueAPF().isZero()) // pow(x, 0.0) -> 1.0
- return ConstantFP::get(CI->getType(), 1.0);
-
- if (Op2C->isExactlyValue(0.5)) {
- // FIXME: This is not safe for -0.0 and -inf. This can only be done when
- // 'unsafe' math optimizations are allowed.
- // x pow(x, 0.5) sqrt(x)
- // ---------------------------------------------
- // -0.0 +0.0 -0.0
- // -inf +inf NaN
-#if 0
- // pow(x, 0.5) -> sqrt(x)
- return B.CreateCall(get_sqrt(), Op1, "sqrt");
-#endif
- }
-
- if (Op2C->isExactlyValue(1.0)) // pow(x, 1.0) -> x
- return Op1;
- if (Op2C->isExactlyValue(2.0)) // pow(x, 2.0) -> x*x
- return B.CreateMul(Op1, Op1, "pow2");
- if (Op2C->isExactlyValue(-1.0)) // pow(x, -1.0) -> 1.0/x
- return B.CreateFDiv(ConstantFP::get(CI->getType(), 1.0), Op1, "powrecip");
- return 0;
- }
-};
-
-//===---------------------------------------===//
-// 'exp2' Optimizations
-
-struct VISIBILITY_HIDDEN Exp2Opt : public LibCallOptimization {
- virtual Value *CallOptimizer(Function *Callee, CallInst *CI, IRBuilder &B) {
- const FunctionType *FT = Callee->getFunctionType();
- // Just make sure this has 1 argument of FP type, which matches the
- // result type.
- if (FT->getNumParams() != 1 || FT->getReturnType() != FT->getParamType(0) ||
- !FT->getParamType(0)->isFloatingPoint())
- return 0;
-
- Value *Op = CI->getOperand(1);
- // Turn exp2(sitofp(x)) -> ldexp(1.0, sext(x)) if sizeof(x) <= 32
- // Turn exp2(uitofp(x)) -> ldexp(1.0, zext(x)) if sizeof(x) < 32
- Value *LdExpArg = 0;
- if (SIToFPInst *OpC = dyn_cast<SIToFPInst>(Op)) {
- if (OpC->getOperand(0)->getType()->getPrimitiveSizeInBits() <= 32)
- LdExpArg = B.CreateSExt(OpC->getOperand(0), Type::Int32Ty, "tmp");
- } else if (UIToFPInst *OpC = dyn_cast<UIToFPInst>(Op)) {
- if (OpC->getOperand(0)->getType()->getPrimitiveSizeInBits() < 32)
- LdExpArg = B.CreateZExt(OpC->getOperand(0), Type::Int32Ty, "tmp");
- }
-
- if (LdExpArg) {
- const char *Name;
- if (Op->getType() == Type::FloatTy)
- Name = "ldexpf";
- else if (Op->getType() == Type::DoubleTy)
- Name = "ldexp";
- else
- Name = "ldexpl";
-
- Constant *One = ConstantFP::get(APFloat(1.0f));
- if (Op->getType() != Type::FloatTy)
- One = ConstantExpr::getFPExtend(One, Op->getType());
-
- Module *M = Caller->getParent();
- Value *Callee = M->getOrInsertFunction(Name, Op->getType(),
- Op->getType(), Type::Int32Ty,NULL);
- return B.CreateCall2(Callee, One, LdExpArg);
- }
- return 0;
- }
-};
-
-
-//===---------------------------------------===//
-// Double -> Float Shrinking Optimizations for Unary Functions like 'floor'
-
-struct VISIBILITY_HIDDEN UnaryDoubleFPOpt : public LibCallOptimization {
- virtual Value *CallOptimizer(Function *Callee, CallInst *CI, IRBuilder &B) {
- const FunctionType *FT = Callee->getFunctionType();
- if (FT->getNumParams() != 1 || FT->getReturnType() != Type::DoubleTy ||
- FT->getParamType(0) != Type::DoubleTy)
- return 0;
-
- // If this is something like 'floor((double)floatval)', convert to floorf.
- FPExtInst *Cast = dyn_cast<FPExtInst>(CI->getOperand(1));
- if (Cast == 0 || Cast->getOperand(0)->getType() != Type::FloatTy)
- return 0;
-
- // floor((double)floatval) -> (double)floorf(floatval)
- Value *V = Cast->getOperand(0);
- V = EmitUnaryFloatFnCall(V, Callee->getNameStart(), B);
- return B.CreateFPExt(V, Type::DoubleTy);
- }
-};
-
-//===----------------------------------------------------------------------===//
-// Integer Optimizations
-//===----------------------------------------------------------------------===//
-
-//===---------------------------------------===//
-// 'ffs*' Optimizations
-
-struct VISIBILITY_HIDDEN FFSOpt : public LibCallOptimization {
- virtual Value *CallOptimizer(Function *Callee, CallInst *CI, IRBuilder &B) {
- const FunctionType *FT = Callee->getFunctionType();
- // Just make sure this has 2 arguments of the same FP type, which match the
- // result type.
- if (FT->getNumParams() != 1 || FT->getReturnType() != Type::Int32Ty ||
- !isa<IntegerType>(FT->getParamType(0)))
- return 0;
-
- Value *Op = CI->getOperand(1);
-
- // Constant fold.
- if (ConstantInt *CI = dyn_cast<ConstantInt>(Op)) {
- if (CI->getValue() == 0) // ffs(0) -> 0.
- return Constant::getNullValue(CI->getType());
- return ConstantInt::get(Type::Int32Ty, // ffs(c) -> cttz(c)+1
- CI->getValue().countTrailingZeros()+1);
- }
-
- // ffs(x) -> x != 0 ? (i32)llvm.cttz(x)+1 : 0
- const Type *ArgType = Op->getType();
- Value *F = Intrinsic::getDeclaration(Callee->getParent(),
- Intrinsic::cttz, &ArgType, 1);
- Value *V = B.CreateCall(F, Op, "cttz");
- V = B.CreateAdd(V, ConstantInt::get(Type::Int32Ty, 1), "tmp");
- V = B.CreateIntCast(V, Type::Int32Ty, false, "tmp");
-
- Value *Cond = B.CreateICmpNE(Op, Constant::getNullValue(ArgType), "tmp");
- return B.CreateSelect(Cond, V, ConstantInt::get(Type::Int32Ty, 0));
- }
-};
-
-//===---------------------------------------===//
-// 'isdigit' Optimizations
-
-struct VISIBILITY_HIDDEN IsDigitOpt : public LibCallOptimization {
- virtual Value *CallOptimizer(Function *Callee, CallInst *CI, IRBuilder &B) {
- const FunctionType *FT = Callee->getFunctionType();
- // We require integer(i32)
- if (FT->getNumParams() != 1 || !isa<IntegerType>(FT->getReturnType()) ||
- FT->getParamType(0) != Type::Int32Ty)
- return 0;
-
- // isdigit(c) -> (c-'0') <u 10
- Value *Op = CI->getOperand(1);
- Op = B.CreateSub(Op, ConstantInt::get(Type::Int32Ty, '0'), "isdigittmp");
- Op = B.CreateICmpULT(Op, ConstantInt::get(Type::Int32Ty, 10), "isdigit");
- return B.CreateZExt(Op, CI->getType());
- }
-};
-
-//===---------------------------------------===//
-// 'isascii' Optimizations
-
-struct VISIBILITY_HIDDEN IsAsciiOpt : public LibCallOptimization {
- virtual Value *CallOptimizer(Function *Callee, CallInst *CI, IRBuilder &B) {
- const FunctionType *FT = Callee->getFunctionType();
- // We require integer(i32)
- if (FT->getNumParams() != 1 || !isa<IntegerType>(FT->getReturnType()) ||
- FT->getParamType(0) != Type::Int32Ty)
- return 0;
-
- // isascii(c) -> c <u 128
- Value *Op = CI->getOperand(1);
- Op = B.CreateICmpULT(Op, ConstantInt::get(Type::Int32Ty, 128), "isascii");
- return B.CreateZExt(Op, CI->getType());
- }
-};
-
-//===---------------------------------------===//
-// 'toascii' Optimizations
-
-struct VISIBILITY_HIDDEN ToAsciiOpt : public LibCallOptimization {
- virtual Value *CallOptimizer(Function *Callee, CallInst *CI, IRBuilder &B) {
- const FunctionType *FT = Callee->getFunctionType();
- // We require i32(i32)
- if (FT->getNumParams() != 1 || FT->getReturnType() != FT->getParamType(0) ||
- FT->getParamType(0) != Type::Int32Ty)
- return 0;
-
- // isascii(c) -> c & 0x7f
- return B.CreateAnd(CI->getOperand(1), ConstantInt::get(CI->getType(),0x7F));
- }
-};
-
-//===----------------------------------------------------------------------===//
-// Formatting and IO Optimizations
-//===----------------------------------------------------------------------===//
-
-//===---------------------------------------===//
-// 'printf' Optimizations
-
-struct VISIBILITY_HIDDEN PrintFOpt : public LibCallOptimization {
- virtual Value *CallOptimizer(Function *Callee, CallInst *CI, IRBuilder &B) {
- // Require one fixed pointer argument and an integer/void result.
- const FunctionType *FT = Callee->getFunctionType();
- if (FT->getNumParams() < 1 || !isa<PointerType>(FT->getParamType(0)) ||
- !(isa<IntegerType>(FT->getReturnType()) ||
- FT->getReturnType() == Type::VoidTy))
- return 0;
-
- // Check for a fixed format string.
- std::string FormatStr;
- if (!GetConstantStringInfo(CI->getOperand(1), FormatStr))
- return 0;
-
- // Empty format string -> noop.
- if (FormatStr.empty()) // Tolerate printf's declared void.
- return CI->use_empty() ? (Value*)CI : ConstantInt::get(CI->getType(), 0);
-
- // printf("x") -> putchar('x'), even for '%'.
- if (FormatStr.size() == 1) {
- EmitPutChar(ConstantInt::get(Type::Int32Ty, FormatStr[0]), B);
- return CI->use_empty() ? (Value*)CI : ConstantInt::get(CI->getType(), 1);
- }
-
- // printf("foo\n") --> puts("foo")
- if (FormatStr[FormatStr.size()-1] == '\n' &&
- FormatStr.find('%') == std::string::npos) { // no format characters.
- // Create a string literal with no \n on it. We expect the constant merge
- // pass to be run after this pass, to merge duplicate strings.
- FormatStr.erase(FormatStr.end()-1);
- Constant *C = ConstantArray::get(FormatStr, true);
- C = new GlobalVariable(C->getType(), true,GlobalVariable::InternalLinkage,
- C, "str", Callee->getParent());
- EmitPutS(C, B);
- return CI->use_empty() ? (Value*)CI :
- ConstantInt::get(CI->getType(), FormatStr.size()+1);
- }
-
- // Optimize specific format strings.
- // printf("%c", chr) --> putchar(*(i8*)dst)
- if (FormatStr == "%c" && CI->getNumOperands() > 2 &&
- isa<IntegerType>(CI->getOperand(2)->getType())) {
- EmitPutChar(CI->getOperand(2), B);
- return CI->use_empty() ? (Value*)CI : ConstantInt::get(CI->getType(), 1);
- }
-
- // printf("%s\n", str) --> puts(str)
- if (FormatStr == "%s\n" && CI->getNumOperands() > 2 &&
- isa<PointerType>(CI->getOperand(2)->getType()) &&
- CI->use_empty()) {
- EmitPutS(CI->getOperand(2), B);
- return CI;
- }
- return 0;
- }
-};
-
-//===---------------------------------------===//
-// 'sprintf' Optimizations
-
-struct VISIBILITY_HIDDEN SPrintFOpt : public LibCallOptimization {
- virtual Value *CallOptimizer(Function *Callee, CallInst *CI, IRBuilder &B) {
- // Require two fixed pointer arguments and an integer result.
- const FunctionType *FT = Callee->getFunctionType();
- if (FT->getNumParams() != 2 || !isa<PointerType>(FT->getParamType(0)) ||
- !isa<PointerType>(FT->getParamType(1)) ||
- !isa<IntegerType>(FT->getReturnType()))
- return 0;
-
- // Check for a fixed format string.
- std::string FormatStr;
- if (!GetConstantStringInfo(CI->getOperand(2), FormatStr))
- return 0;
-
- // If we just have a format string (nothing else crazy) transform it.
- if (CI->getNumOperands() == 3) {
- // Make sure there's no % in the constant array. We could try to handle
- // %% -> % in the future if we cared.
- for (unsigned i = 0, e = FormatStr.size(); i != e; ++i)
- if (FormatStr[i] == '%')
- return 0; // we found a format specifier, bail out.
-
- // sprintf(str, fmt) -> llvm.memcpy(str, fmt, strlen(fmt)+1, 1)
- EmitMemCpy(CI->getOperand(1), CI->getOperand(2), // Copy the nul byte.
- ConstantInt::get(TD->getIntPtrType(), FormatStr.size()+1),1,B);
- return ConstantInt::get(CI->getType(), FormatStr.size());
- }
-
- // The remaining optimizations require the format string to be "%s" or "%c"
- // and have an extra operand.
- if (FormatStr.size() != 2 || FormatStr[0] != '%' || CI->getNumOperands() <4)
- return 0;
-
- // Decode the second character of the format string.
- if (FormatStr[1] == 'c') {
- // sprintf(dst, "%c", chr) --> *(i8*)dst = chr; *((i8*)dst+1) = 0
- if (!isa<IntegerType>(CI->getOperand(3)->getType())) return 0;
- Value *V = B.CreateTrunc(CI->getOperand(3), Type::Int8Ty, "char");
- Value *Ptr = CastToCStr(CI->getOperand(1), B);
- B.CreateStore(V, Ptr);
- Ptr = B.CreateGEP(Ptr, ConstantInt::get(Type::Int32Ty, 1), "nul");
- B.CreateStore(Constant::getNullValue(Type::Int8Ty), Ptr);
-
- return ConstantInt::get(CI->getType(), 1);
- }
-
- if (FormatStr[1] == 's') {
- // sprintf(dest, "%s", str) -> llvm.memcpy(dest, str, strlen(str)+1, 1)
- if (!isa<PointerType>(CI->getOperand(3)->getType())) return 0;
-
- Value *Len = EmitStrLen(CI->getOperand(3), B);
- Value *IncLen = B.CreateAdd(Len, ConstantInt::get(Len->getType(), 1),
- "leninc");
- EmitMemCpy(CI->getOperand(1), CI->getOperand(3), IncLen, 1, B);
-
- // The sprintf result is the unincremented number of bytes in the string.
- return B.CreateIntCast(Len, CI->getType(), false);
- }
- return 0;
- }
-};
-
-//===---------------------------------------===//
-// 'fwrite' Optimizations
-
-struct VISIBILITY_HIDDEN FWriteOpt : public LibCallOptimization {
- virtual Value *CallOptimizer(Function *Callee, CallInst *CI, IRBuilder &B) {
- // Require a pointer, an integer, an integer, a pointer, returning integer.
- const FunctionType *FT = Callee->getFunctionType();
- if (FT->getNumParams() != 4 || !isa<PointerType>(FT->getParamType(0)) ||
- !isa<IntegerType>(FT->getParamType(1)) ||
- !isa<IntegerType>(FT->getParamType(2)) ||
- !isa<PointerType>(FT->getParamType(3)) ||
- !isa<IntegerType>(FT->getReturnType()))
- return 0;
-
- // Get the element size and count.
- ConstantInt *SizeC = dyn_cast<ConstantInt>(CI->getOperand(2));
- ConstantInt *CountC = dyn_cast<ConstantInt>(CI->getOperand(3));
- if (!SizeC || !CountC) return 0;
- uint64_t Bytes = SizeC->getZExtValue()*CountC->getZExtValue();
-
- // If this is writing zero records, remove the call (it's a noop).
- if (Bytes == 0)
- return ConstantInt::get(CI->getType(), 0);
-
- // If this is writing one byte, turn it into fputc.
- if (Bytes == 1) { // fwrite(S,1,1,F) -> fputc(S[0],F)
- Value *Char = B.CreateLoad(CastToCStr(CI->getOperand(1), B), "char");
- EmitFPutC(Char, CI->getOperand(4), B);
- return ConstantInt::get(CI->getType(), 1);
- }
-
- return 0;
- }
-};
-
-//===---------------------------------------===//
-// 'fputs' Optimizations
-
-struct VISIBILITY_HIDDEN FPutsOpt : public LibCallOptimization {
- virtual Value *CallOptimizer(Function *Callee, CallInst *CI, IRBuilder &B) {
- // Require two pointers. Also, we can't optimize if return value is used.
- const FunctionType *FT = Callee->getFunctionType();
- if (FT->getNumParams() != 2 || !isa<PointerType>(FT->getParamType(0)) ||
- !isa<PointerType>(FT->getParamType(1)) ||
- !CI->use_empty())
- return 0;
-
- // fputs(s,F) --> fwrite(s,1,strlen(s),F)
- uint64_t Len = GetStringLength(CI->getOperand(1));
- if (!Len) return 0;
- EmitFWrite(CI->getOperand(1), ConstantInt::get(TD->getIntPtrType(), Len-1),
- CI->getOperand(2), B);
- return CI; // Known to have no uses (see above).
- }
-};
-
-//===---------------------------------------===//
-// 'fprintf' Optimizations
-
-struct VISIBILITY_HIDDEN FPrintFOpt : public LibCallOptimization {
- virtual Value *CallOptimizer(Function *Callee, CallInst *CI, IRBuilder &B) {
- // Require two fixed paramters as pointers and integer result.
- const FunctionType *FT = Callee->getFunctionType();
- if (FT->getNumParams() != 2 || !isa<PointerType>(FT->getParamType(0)) ||
- !isa<PointerType>(FT->getParamType(1)) ||
- !isa<IntegerType>(FT->getReturnType()))
- return 0;
-
- // All the optimizations depend on the format string.
- std::string FormatStr;
- if (!GetConstantStringInfo(CI->getOperand(2), FormatStr))
- return 0;
-
- // fprintf(F, "foo") --> fwrite("foo", 3, 1, F)
- if (CI->getNumOperands() == 3) {
- for (unsigned i = 0, e = FormatStr.size(); i != e; ++i)
- if (FormatStr[i] == '%') // Could handle %% -> % if we cared.
- return 0; // We found a format specifier.
-
- EmitFWrite(CI->getOperand(2), ConstantInt::get(TD->getIntPtrType(),
- FormatStr.size()),
- CI->getOperand(1), B);
- return ConstantInt::get(CI->getType(), FormatStr.size());
- }
-
- // The remaining optimizations require the format string to be "%s" or "%c"
- // and have an extra operand.
- if (FormatStr.size() != 2 || FormatStr[0] != '%' || CI->getNumOperands() <4)
- return 0;
-
- // Decode the second character of the format string.
- if (FormatStr[1] == 'c') {
- // fprintf(F, "%c", chr) --> *(i8*)dst = chr
- if (!isa<IntegerType>(CI->getOperand(3)->getType())) return 0;
- EmitFPutC(CI->getOperand(3), CI->getOperand(1), B);
- return ConstantInt::get(CI->getType(), 1);
- }
-
- if (FormatStr[1] == 's') {
- // fprintf(F, "%s", str) -> fputs(str, F)
- if (!isa<PointerType>(CI->getOperand(3)->getType()) || !CI->use_empty())
- return 0;
- EmitFPutS(CI->getOperand(3), CI->getOperand(1), B);
- return CI;
- }
- return 0;
- }
-};
-
-} // end anonymous namespace.
-
-//===----------------------------------------------------------------------===//
-// SimplifyLibCalls Pass Implementation
-//===----------------------------------------------------------------------===//
-
-namespace {
- /// This pass optimizes well known library functions from libc and libm.
- ///
- class VISIBILITY_HIDDEN SimplifyLibCalls : public FunctionPass {
- StringMap<LibCallOptimization*> Optimizations;
- // Miscellaneous LibCall Optimizations
- ExitOpt Exit;
- // String and Memory LibCall Optimizations
- StrCatOpt StrCat; StrChrOpt StrChr; StrCmpOpt StrCmp; StrNCmpOpt StrNCmp;
- StrCpyOpt StrCpy; StrLenOpt StrLen; MemCmpOpt MemCmp; MemCpyOpt MemCpy;
- // Math Library Optimizations
- PowOpt Pow; Exp2Opt Exp2; UnaryDoubleFPOpt UnaryDoubleFP;
- // Integer Optimizations
- FFSOpt FFS; IsDigitOpt IsDigit; IsAsciiOpt IsAscii; ToAsciiOpt ToAscii;
- // Formatting and IO Optimizations
- SPrintFOpt SPrintF; PrintFOpt PrintF;
- FWriteOpt FWrite; FPutsOpt FPuts; FPrintFOpt FPrintF;
- public:
- static char ID; // Pass identification
- SimplifyLibCalls() : FunctionPass((intptr_t)&ID) {}
-
- void InitOptimizations();
- bool runOnFunction(Function &F);
-
- virtual void getAnalysisUsage(AnalysisUsage &AU) const {
- AU.addRequired<TargetData>();
- }
- };
- char SimplifyLibCalls::ID = 0;
-} // end anonymous namespace.
-
-static RegisterPass<SimplifyLibCalls>
-X("simplify-libcalls", "Simplify well-known library calls");
-
-// Public interface to the Simplify LibCalls pass.
-FunctionPass *llvm::createSimplifyLibCallsPass() {
- return new SimplifyLibCalls();
-}
-
-/// Optimizations - Populate the Optimizations map with all the optimizations
-/// we know.
-void SimplifyLibCalls::InitOptimizations() {
- // Miscellaneous LibCall Optimizations
- Optimizations["exit"] = &Exit;
-
- // String and Memory LibCall Optimizations
- Optimizations["strcat"] = &StrCat;
- Optimizations["strchr"] = &StrChr;
- Optimizations["strcmp"] = &StrCmp;
- Optimizations["strncmp"] = &StrNCmp;
- Optimizations["strcpy"] = &StrCpy;
- Optimizations["strlen"] = &StrLen;
- Optimizations["memcmp"] = &MemCmp;
- Optimizations["memcpy"] = &MemCpy;
-
- // Math Library Optimizations
- Optimizations["powf"] = &Pow;
- Optimizations["pow"] = &Pow;
- Optimizations["powl"] = &Pow;
- Optimizations["exp2l"] = &Exp2;
- Optimizations["exp2"] = &Exp2;
- Optimizations["exp2f"] = &Exp2;
-
-#ifdef HAVE_FLOORF
- Optimizations["floor"] = &UnaryDoubleFP;
-#endif
-#ifdef HAVE_CEILF
- Optimizations["ceil"] = &UnaryDoubleFP;
-#endif
-#ifdef HAVE_ROUNDF
- Optimizations["round"] = &UnaryDoubleFP;
-#endif
-#ifdef HAVE_RINTF
- Optimizations["rint"] = &UnaryDoubleFP;
-#endif
-#ifdef HAVE_NEARBYINTF
- Optimizations["nearbyint"] = &UnaryDoubleFP;
-#endif
-
- // Integer Optimizations
- Optimizations["ffs"] = &FFS;
- Optimizations["ffsl"] = &FFS;
- Optimizations["ffsll"] = &FFS;
- Optimizations["isdigit"] = &IsDigit;
- Optimizations["isascii"] = &IsAscii;
- Optimizations["toascii"] = &ToAscii;
-
- // Formatting and IO Optimizations
- Optimizations["sprintf"] = &SPrintF;
- Optimizations["printf"] = &PrintF;
- Optimizations["fwrite"] = &FWrite;
- Optimizations["fputs"] = &FPuts;
- Optimizations["fprintf"] = &FPrintF;
-}
-
-
-/// runOnFunction - Top level algorithm.
-///
-bool SimplifyLibCalls::runOnFunction(Function &F) {
- if (Optimizations.empty())
- InitOptimizations();
-
- const TargetData &TD = getAnalysis<TargetData>();
-
- IRBuilder Builder;
-
- bool Changed = false;
- for (Function::iterator BB = F.begin(), E = F.end(); BB != E; ++BB) {
- for (BasicBlock::iterator I = BB->begin(), E = BB->end(); I != E; ) {
- // Ignore non-calls.
- CallInst *CI = dyn_cast<CallInst>(I++);
- if (!CI) continue;
-
- // Ignore indirect calls and calls to non-external functions.
- Function *Callee = CI->getCalledFunction();
- if (Callee == 0 || !Callee->isDeclaration() ||
- !(Callee->hasExternalLinkage() || Callee->hasDLLImportLinkage()))
- continue;
-
- // Ignore unknown calls.
- const char *CalleeName = Callee->getNameStart();
- StringMap<LibCallOptimization*>::iterator OMI =
- Optimizations.find(CalleeName, CalleeName+Callee->getNameLen());
- if (OMI == Optimizations.end()) continue;
-
- // Set the builder to the instruction after the call.
- Builder.SetInsertPoint(BB, I);
-
- // Try to optimize this call.
- Value *Result = OMI->second->OptimizeCall(CI, TD, Builder);
- if (Result == 0) continue;
-
- DEBUG(DOUT << "SimplifyLibCalls simplified: " << *CI;
- DOUT << " into: " << *Result << "\n");
-
- // Something changed!
- Changed = true;
- ++NumSimplified;
-
- // Inspect the instruction after the call (which was potentially just
- // added) next.
- I = CI; ++I;
-
- if (CI != Result && !CI->use_empty()) {
- CI->replaceAllUsesWith(Result);
- if (!Result->hasName())
- Result->takeName(CI);
- }
- CI->eraseFromParent();
- }
- }
- return Changed;
-}
-
-
-// TODO:
-// Additional cases that we need to add to this file:
-//
-// cbrt:
-// * cbrt(expN(X)) -> expN(x/3)
-// * cbrt(sqrt(x)) -> pow(x,1/6)
-// * cbrt(sqrt(x)) -> pow(x,1/9)
-//
-// cos, cosf, cosl:
-// * cos(-x) -> cos(x)
-//
-// exp, expf, expl:
-// * exp(log(x)) -> x
-//
-// log, logf, logl:
-// * log(exp(x)) -> x
-// * log(x**y) -> y*log(x)
-// * log(exp(y)) -> y*log(e)
-// * log(exp2(y)) -> y*log(2)
-// * log(exp10(y)) -> y*log(10)
-// * log(sqrt(x)) -> 0.5*log(x)
-// * log(pow(x,y)) -> y*log(x)
-//
-// lround, lroundf, lroundl:
-// * lround(cnst) -> cnst'
-//
-// memcmp:
-// * memcmp(x,y,l) -> cnst
-// (if all arguments are constant and strlen(x) <= l and strlen(y) <= l)
-//
-// memmove:
-// * memmove(d,s,l,a) -> memcpy(d,s,l,a)
-// (if s is a global constant array)
-//
-// pow, powf, powl:
-// * pow(exp(x),y) -> exp(x*y)
-// * pow(sqrt(x),y) -> pow(x,y*0.5)
-// * pow(pow(x,y),z)-> pow(x,y*z)
-//
-// puts:
-// * puts("") -> putchar("\n")
-//
-// round, roundf, roundl:
-// * round(cnst) -> cnst'
-//
-// signbit:
-// * signbit(cnst) -> cnst'
-// * signbit(nncst) -> 0 (if pstv is a non-negative constant)
-//
-// sqrt, sqrtf, sqrtl:
-// * sqrt(expN(x)) -> expN(x*0.5)
-// * sqrt(Nroot(x)) -> pow(x,1/(2*N))
-// * sqrt(pow(x,y)) -> pow(|x|,y*0.5)
-//
-// stpcpy:
-// * stpcpy(str, "literal") ->
-// llvm.memcpy(str,"literal",strlen("literal")+1,1)
-// strrchr:
-// * strrchr(s,c) -> reverse_offset_of_in(c,s)
-// (if c is a constant integer and s is a constant string)
-// * strrchr(s1,0) -> strchr(s1,0)
-//
-// strncat:
-// * strncat(x,y,0) -> x
-// * strncat(x,y,0) -> x (if strlen(y) = 0)
-// * strncat(x,y,l) -> strcat(x,y) (if y and l are constants an l > strlen(y))
-//
-// strncpy:
-// * strncpy(d,s,0) -> d
-// * strncpy(d,s,l) -> memcpy(d,s,l,1)
-// (if s and l are constants)
-//
-// strpbrk:
-// * strpbrk(s,a) -> offset_in_for(s,a)
-// (if s and a are both constant strings)
-// * strpbrk(s,"") -> 0
-// * strpbrk(s,a) -> strchr(s,a[0]) (if a is constant string of length 1)
-//
-// strspn, strcspn:
-// * strspn(s,a) -> const_int (if both args are constant)
-// * strspn("",a) -> 0
-// * strspn(s,"") -> 0
-// * strcspn(s,a) -> const_int (if both args are constant)
-// * strcspn("",a) -> 0
-// * strcspn(s,"") -> strlen(a)
-//
-// strstr:
-// * strstr(x,x) -> x
-// * strstr(s1,s2) -> offset_of_s2_in(s1)
-// (if s1 and s2 are constant strings)
-//
-// tan, tanf, tanl:
-// * tan(atan(x)) -> x
-//
-// trunc, truncf, truncl:
-// * trunc(cnst) -> cnst'
-//
-//
diff --git a/release_23/lib/Transforms/Scalar/TailDuplication.cpp b/release_23/lib/Transforms/Scalar/TailDuplication.cpp
deleted file mode 100644
index f9b8ace11f39..000000000000
--- a/release_23/lib/Transforms/Scalar/TailDuplication.cpp
+++ /dev/null
@@ -1,340 +0,0 @@
-//===- TailDuplication.cpp - Simplify CFG through tail duplication --------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This pass performs a limited form of tail duplication, intended to simplify
-// CFGs by removing some unconditional branches. This pass is necessary to
-// straighten out loops created by the C front-end, but also is capable of
-// making other code nicer. After this pass is run, the CFG simplify pass
-// should be run to clean up the mess.
-//
-// This pass could be enhanced in the future to use profile information to be
-// more aggressive.
-//
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "tailduplicate"
-#include "llvm/Transforms/Scalar.h"
-#include "llvm/Constant.h"
-#include "llvm/Function.h"
-#include "llvm/Instructions.h"
-#include "llvm/IntrinsicInst.h"
-#include "llvm/Pass.h"
-#include "llvm/Type.h"
-#include "llvm/Support/CFG.h"
-#include "llvm/Transforms/Utils/Local.h"
-#include "llvm/Support/CommandLine.h"
-#include "llvm/Support/Compiler.h"
-#include "llvm/Support/Debug.h"
-#include "llvm/ADT/Statistic.h"
-#include <map>
-using namespace llvm;
-
-STATISTIC(NumEliminated, "Number of unconditional branches eliminated");
-
-namespace {
- cl::opt<unsigned>
- Threshold("taildup-threshold", cl::desc("Max block size to tail duplicate"),
- cl::init(6), cl::Hidden);
- class VISIBILITY_HIDDEN TailDup : public FunctionPass {
- bool runOnFunction(Function &F);
- public:
- static char ID; // Pass identification, replacement for typeid
- TailDup() : FunctionPass((intptr_t)&ID) {}
-
- private:
- inline bool shouldEliminateUnconditionalBranch(TerminatorInst *TI);
- inline void eliminateUnconditionalBranch(BranchInst *BI);
- };
- char TailDup::ID = 0;
- RegisterPass<TailDup> X("tailduplicate", "Tail Duplication");
-}
-
-// Public interface to the Tail Duplication pass
-FunctionPass *llvm::createTailDuplicationPass() { return new TailDup(); }
-
-/// runOnFunction - Top level algorithm - Loop over each unconditional branch in
-/// the function, eliminating it if it looks attractive enough.
-///
-bool TailDup::runOnFunction(Function &F) {
- bool Changed = false;
- for (Function::iterator I = F.begin(), E = F.end(); I != E; )
- if (shouldEliminateUnconditionalBranch(I->getTerminator())) {
- eliminateUnconditionalBranch(cast<BranchInst>(I->getTerminator()));
- Changed = true;
- } else {
- ++I;
- }
- return Changed;
-}
-
-/// shouldEliminateUnconditionalBranch - Return true if this branch looks
-/// attractive to eliminate. We eliminate the branch if the destination basic
-/// block has <= 5 instructions in it, not counting PHI nodes. In practice,
-/// since one of these is a terminator instruction, this means that we will add
-/// up to 4 instructions to the new block.
-///
-/// We don't count PHI nodes in the count since they will be removed when the
-/// contents of the block are copied over.
-///
-bool TailDup::shouldEliminateUnconditionalBranch(TerminatorInst *TI) {
- BranchInst *BI = dyn_cast<BranchInst>(TI);
- if (!BI || !BI->isUnconditional()) return false; // Not an uncond branch!
-
- BasicBlock *Dest = BI->getSuccessor(0);
- if (Dest == BI->getParent()) return false; // Do not loop infinitely!
-
- // Do not inline a block if we will just get another branch to the same block!
- TerminatorInst *DTI = Dest->getTerminator();
- if (BranchInst *DBI = dyn_cast<BranchInst>(DTI))
- if (DBI->isUnconditional() && DBI->getSuccessor(0) == Dest)
- return false; // Do not loop infinitely!
-
- // FIXME: DemoteRegToStack cannot yet demote invoke instructions to the stack,
- // because doing so would require breaking critical edges. This should be
- // fixed eventually.
- if (!DTI->use_empty())
- return false;
-
- // Do not bother working on dead blocks...
- pred_iterator PI = pred_begin(Dest), PE = pred_end(Dest);
- if (PI == PE && Dest != Dest->getParent()->begin())
- return false; // It's just a dead block, ignore it...
-
- // Also, do not bother with blocks with only a single predecessor: simplify
- // CFG will fold these two blocks together!
- ++PI;
- if (PI == PE) return false; // Exactly one predecessor!
-
- BasicBlock::iterator I = Dest->begin();
- while (isa<PHINode>(*I)) ++I;
-
- for (unsigned Size = 0; I != Dest->end(); ++I) {
- if (Size == Threshold) return false; // The block is too large.
-
- // Don't tail duplicate call instructions. They are very large compared to
- // other instructions.
- if (isa<CallInst>(I) || isa<InvokeInst>(I)) return false;
-
- // Only count instructions that are not debugger intrinsics.
- if (!isa<DbgInfoIntrinsic>(I)) ++Size;
- }
-
- // Do not tail duplicate a block that has thousands of successors into a block
- // with a single successor if the block has many other predecessors. This can
- // cause an N^2 explosion in CFG edges (and PHI node entries), as seen in
- // cases that have a large number of indirect gotos.
- unsigned NumSuccs = DTI->getNumSuccessors();
- if (NumSuccs > 8) {
- unsigned TooMany = 128;
- if (NumSuccs >= TooMany) return false;
- TooMany = TooMany/NumSuccs;
- for (; PI != PE; ++PI)
- if (TooMany-- == 0) return false;
- }
-
- // Finally, if this unconditional branch is a fall-through, be careful about
- // tail duplicating it. In particular, we don't want to taildup it if the
- // original block will still be there after taildup is completed: doing so
- // would eliminate the fall-through, requiring unconditional branches.
- Function::iterator DestI = Dest;
- if (&*--DestI == BI->getParent()) {
- // The uncond branch is a fall-through. Tail duplication of the block is
- // will eliminate the fall-through-ness and end up cloning the terminator
- // at the end of the Dest block. Since the original Dest block will
- // continue to exist, this means that one or the other will not be able to
- // fall through. One typical example that this helps with is code like:
- // if (a)
- // foo();
- // if (b)
- // foo();
- // Cloning the 'if b' block into the end of the first foo block is messy.
-
- // The messy case is when the fall-through block falls through to other
- // blocks. This is what we would be preventing if we cloned the block.
- DestI = Dest;
- if (++DestI != Dest->getParent()->end()) {
- BasicBlock *DestSucc = DestI;
- // If any of Dest's successors are fall-throughs, don't do this xform.
- for (succ_iterator SI = succ_begin(Dest), SE = succ_end(Dest);
- SI != SE; ++SI)
- if (*SI == DestSucc)
- return false;
- }
- }
-
- return true;
-}
-
-/// FindObviousSharedDomOf - We know there is a branch from SrcBlock to
-/// DestBlock, and that SrcBlock is not the only predecessor of DstBlock. If we
-/// can find a predecessor of SrcBlock that is a dominator of both SrcBlock and
-/// DstBlock, return it.
-static BasicBlock *FindObviousSharedDomOf(BasicBlock *SrcBlock,
- BasicBlock *DstBlock) {
- // SrcBlock must have a single predecessor.
- pred_iterator PI = pred_begin(SrcBlock), PE = pred_end(SrcBlock);
- if (PI == PE || ++PI != PE) return 0;
-
- BasicBlock *SrcPred = *pred_begin(SrcBlock);
-
- // Look at the predecessors of DstBlock. One of them will be SrcBlock. If
- // there is only one other pred, get it, otherwise we can't handle it.
- PI = pred_begin(DstBlock); PE = pred_end(DstBlock);
- BasicBlock *DstOtherPred = 0;
- if (*PI == SrcBlock) {
- if (++PI == PE) return 0;
- DstOtherPred = *PI;
- if (++PI != PE) return 0;
- } else {
- DstOtherPred = *PI;
- if (++PI == PE || *PI != SrcBlock || ++PI != PE) return 0;
- }
-
- // We can handle two situations here: "if then" and "if then else" blocks. An
- // 'if then' situation is just where DstOtherPred == SrcPred.
- if (DstOtherPred == SrcPred)
- return SrcPred;
-
- // Check to see if we have an "if then else" situation, which means that
- // DstOtherPred will have a single predecessor and it will be SrcPred.
- PI = pred_begin(DstOtherPred); PE = pred_end(DstOtherPred);
- if (PI != PE && *PI == SrcPred) {
- if (++PI != PE) return 0; // Not a single pred.
- return SrcPred; // Otherwise, it's an "if then" situation. Return the if.
- }
-
- // Otherwise, this is something we can't handle.
- return 0;
-}
-
-
-/// eliminateUnconditionalBranch - Clone the instructions from the destination
-/// block into the source block, eliminating the specified unconditional branch.
-/// If the destination block defines values used by successors of the dest
-/// block, we may need to insert PHI nodes.
-///
-void TailDup::eliminateUnconditionalBranch(BranchInst *Branch) {
- BasicBlock *SourceBlock = Branch->getParent();
- BasicBlock *DestBlock = Branch->getSuccessor(0);
- assert(SourceBlock != DestBlock && "Our predicate is broken!");
-
- DOUT << "TailDuplication[" << SourceBlock->getParent()->getName()
- << "]: Eliminating branch: " << *Branch;
-
- // See if we can avoid duplicating code by moving it up to a dominator of both
- // blocks.
- if (BasicBlock *DomBlock = FindObviousSharedDomOf(SourceBlock, DestBlock)) {
- DOUT << "Found shared dominator: " << DomBlock->getName() << "\n";
-
- // If there are non-phi instructions in DestBlock that have no operands
- // defined in DestBlock, and if the instruction has no side effects, we can
- // move the instruction to DomBlock instead of duplicating it.
- BasicBlock::iterator BBI = DestBlock->begin();
- while (isa<PHINode>(BBI)) ++BBI;
- while (!isa<TerminatorInst>(BBI)) {
- Instruction *I = BBI++;
-
- bool CanHoist = !I->isTrapping() && !I->mayWriteToMemory();
- if (CanHoist) {
- for (unsigned op = 0, e = I->getNumOperands(); op != e; ++op)
- if (Instruction *OpI = dyn_cast<Instruction>(I->getOperand(op)))
- if (OpI->getParent() == DestBlock ||
- (isa<InvokeInst>(OpI) && OpI->getParent() == DomBlock)) {
- CanHoist = false;
- break;
- }
- if (CanHoist) {
- // Remove from DestBlock, move right before the term in DomBlock.
- DestBlock->getInstList().remove(I);
- DomBlock->getInstList().insert(DomBlock->getTerminator(), I);
- DOUT << "Hoisted: " << *I;
- }
- }
- }
- }
-
- // Tail duplication can not update SSA properties correctly if the values
- // defined in the duplicated tail are used outside of the tail itself. For
- // this reason, we spill all values that are used outside of the tail to the
- // stack.
- for (BasicBlock::iterator I = DestBlock->begin(); I != DestBlock->end(); ++I)
- if (I->isUsedOutsideOfBlock(DestBlock)) {
- // We found a use outside of the tail. Create a new stack slot to
- // break this inter-block usage pattern.
- DemoteRegToStack(*I);
- }
-
- // We are going to have to map operands from the original block B to the new
- // copy of the block B'. If there are PHI nodes in the DestBlock, these PHI
- // nodes also define part of this mapping. Loop over these PHI nodes, adding
- // them to our mapping.
- //
- std::map<Value*, Value*> ValueMapping;
-
- BasicBlock::iterator BI = DestBlock->begin();
- bool HadPHINodes = isa<PHINode>(BI);
- for (; PHINode *PN = dyn_cast<PHINode>(BI); ++BI)
- ValueMapping[PN] = PN->getIncomingValueForBlock(SourceBlock);
-
- // Clone the non-phi instructions of the dest block into the source block,
- // keeping track of the mapping...
- //
- for (; BI != DestBlock->end(); ++BI) {
- Instruction *New = BI->clone();
- New->setName(BI->getName());
- SourceBlock->getInstList().push_back(New);
- ValueMapping[BI] = New;
- }
-
- // Now that we have built the mapping information and cloned all of the
- // instructions (giving us a new terminator, among other things), walk the new
- // instructions, rewriting references of old instructions to use new
- // instructions.
- //
- BI = Branch; ++BI; // Get an iterator to the first new instruction
- for (; BI != SourceBlock->end(); ++BI)
- for (unsigned i = 0, e = BI->getNumOperands(); i != e; ++i)
- if (Value *Remapped = ValueMapping[BI->getOperand(i)])
- BI->setOperand(i, Remapped);
-
- // Next we check to see if any of the successors of DestBlock had PHI nodes.
- // If so, we need to add entries to the PHI nodes for SourceBlock now.
- for (succ_iterator SI = succ_begin(DestBlock), SE = succ_end(DestBlock);
- SI != SE; ++SI) {
- BasicBlock *Succ = *SI;
- for (BasicBlock::iterator PNI = Succ->begin(); isa<PHINode>(PNI); ++PNI) {
- PHINode *PN = cast<PHINode>(PNI);
- // Ok, we have a PHI node. Figure out what the incoming value was for the
- // DestBlock.
- Value *IV = PN->getIncomingValueForBlock(DestBlock);
-
- // Remap the value if necessary...
- if (Value *MappedIV = ValueMapping[IV])
- IV = MappedIV;
- PN->addIncoming(IV, SourceBlock);
- }
- }
-
- // Next, remove the old branch instruction, and any PHI node entries that we
- // had.
- BI = Branch; ++BI; // Get an iterator to the first new instruction
- DestBlock->removePredecessor(SourceBlock); // Remove entries in PHI nodes...
- SourceBlock->getInstList().erase(Branch); // Destroy the uncond branch...
-
- // Final step: now that we have finished everything up, walk the cloned
- // instructions one last time, constant propagating and DCE'ing them, because
- // they may not be needed anymore.
- //
- if (HadPHINodes)
- while (BI != SourceBlock->end())
- if (!dceInstruction(BI) && !doConstantPropagation(BI))
- ++BI;
-
- ++NumEliminated; // We just killed a branch!
-}
diff --git a/release_23/lib/Transforms/Scalar/TailRecursionElimination.cpp b/release_23/lib/Transforms/Scalar/TailRecursionElimination.cpp
deleted file mode 100644
index 78b088a6444f..000000000000
--- a/release_23/lib/Transforms/Scalar/TailRecursionElimination.cpp
+++ /dev/null
@@ -1,475 +0,0 @@
-//===- TailRecursionElimination.cpp - Eliminate Tail Calls ----------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file transforms calls of the current function (self recursion) followed
-// by a return instruction with a branch to the entry of the function, creating
-// a loop. This pass also implements the following extensions to the basic
-// algorithm:
-//
-// 1. Trivial instructions between the call and return do not prevent the
-// transformation from taking place, though currently the analysis cannot
-// support moving any really useful instructions (only dead ones).
-// 2. This pass transforms functions that are prevented from being tail
-// recursive by an associative expression to use an accumulator variable,
-// thus compiling the typical naive factorial or 'fib' implementation into
-// efficient code.
-// 3. TRE is performed if the function returns void, if the return
-// returns the result returned by the call, or if the function returns a
-// run-time constant on all exits from the function. It is possible, though
-// unlikely, that the return returns something else (like constant 0), and
-// can still be TRE'd. It can be TRE'd if ALL OTHER return instructions in
-// the function return the exact same value.
-// 4. If it can prove that callees do not access theier caller stack frame,
-// they are marked as eligible for tail call elimination (by the code
-// generator).
-//
-// There are several improvements that could be made:
-//
-// 1. If the function has any alloca instructions, these instructions will be
-// moved out of the entry block of the function, causing them to be
-// evaluated each time through the tail recursion. Safely keeping allocas
-// in the entry block requires analysis to proves that the tail-called
-// function does not read or write the stack object.
-// 2. Tail recursion is only performed if the call immediately preceeds the
-// return instruction. It's possible that there could be a jump between
-// the call and the return.
-// 3. There can be intervening operations between the call and the return that
-// prevent the TRE from occurring. For example, there could be GEP's and
-// stores to memory that will not be read or written by the call. This
-// requires some substantial analysis (such as with DSA) to prove safe to
-// move ahead of the call, but doing so could allow many more TREs to be
-// performed, for example in TreeAdd/TreeAlloc from the treeadd benchmark.
-// 4. The algorithm we use to detect if callees access their caller stack
-// frames is very primitive.
-//
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "tailcallelim"
-#include "llvm/Transforms/Scalar.h"
-#include "llvm/Constants.h"
-#include "llvm/DerivedTypes.h"
-#include "llvm/Function.h"
-#include "llvm/Instructions.h"
-#include "llvm/Pass.h"
-#include "llvm/Support/CFG.h"
-#include "llvm/ADT/Statistic.h"
-#include "llvm/Support/Compiler.h"
-using namespace llvm;
-
-STATISTIC(NumEliminated, "Number of tail calls removed");
-STATISTIC(NumAccumAdded, "Number of accumulators introduced");
-
-namespace {
- struct VISIBILITY_HIDDEN TailCallElim : public FunctionPass {
- static char ID; // Pass identification, replacement for typeid
- TailCallElim() : FunctionPass((intptr_t)&ID) {}
-
- virtual bool runOnFunction(Function &F);
-
- private:
- bool ProcessReturningBlock(ReturnInst *RI, BasicBlock *&OldEntry,
- bool &TailCallsAreMarkedTail,
- std::vector<PHINode*> &ArgumentPHIs,
- bool CannotTailCallElimCallsMarkedTail);
- bool CanMoveAboveCall(Instruction *I, CallInst *CI);
- Value *CanTransformAccumulatorRecursion(Instruction *I, CallInst *CI);
- };
- char TailCallElim::ID = 0;
- RegisterPass<TailCallElim> X("tailcallelim", "Tail Call Elimination");
-}
-
-// Public interface to the TailCallElimination pass
-FunctionPass *llvm::createTailCallEliminationPass() {
- return new TailCallElim();
-}
-
-
-/// AllocaMightEscapeToCalls - Return true if this alloca may be accessed by
-/// callees of this function. We only do very simple analysis right now, this
-/// could be expanded in the future to use mod/ref information for particular
-/// call sites if desired.
-static bool AllocaMightEscapeToCalls(AllocaInst *AI) {
- // FIXME: do simple 'address taken' analysis.
- return true;
-}
-
-/// FunctionContainsAllocas - Scan the specified basic block for alloca
-/// instructions. If it contains any that might be accessed by calls, return
-/// true.
-static bool CheckForEscapingAllocas(BasicBlock *BB,
- bool &CannotTCETailMarkedCall) {
- bool RetVal = false;
- for (BasicBlock::iterator I = BB->begin(), E = BB->end(); I != E; ++I)
- if (AllocaInst *AI = dyn_cast<AllocaInst>(I)) {
- RetVal |= AllocaMightEscapeToCalls(AI);
-
- // If this alloca is in the body of the function, or if it is a variable
- // sized allocation, we cannot tail call eliminate calls marked 'tail'
- // with this mechanism.
- if (BB != &BB->getParent()->getEntryBlock() ||
- !isa<ConstantInt>(AI->getArraySize()))
- CannotTCETailMarkedCall = true;
- }
- return RetVal;
-}
-
-bool TailCallElim::runOnFunction(Function &F) {
- // If this function is a varargs function, we won't be able to PHI the args
- // right, so don't even try to convert it...
- if (F.getFunctionType()->isVarArg()) return false;
-
- BasicBlock *OldEntry = 0;
- bool TailCallsAreMarkedTail = false;
- std::vector<PHINode*> ArgumentPHIs;
- bool MadeChange = false;
-
- bool FunctionContainsEscapingAllocas = false;
-
- // CannotTCETailMarkedCall - If true, we cannot perform TCE on tail calls
- // marked with the 'tail' attribute, because doing so would cause the stack
- // size to increase (real TCE would deallocate variable sized allocas, TCE
- // doesn't).
- bool CannotTCETailMarkedCall = false;
-
- // Loop over the function, looking for any returning blocks, and keeping track
- // of whether this function has any non-trivially used allocas.
- for (Function::iterator BB = F.begin(), E = F.end(); BB != E; ++BB) {
- if (FunctionContainsEscapingAllocas && CannotTCETailMarkedCall)
- break;
-
- FunctionContainsEscapingAllocas |=
- CheckForEscapingAllocas(BB, CannotTCETailMarkedCall);
- }
-
- /// FIXME: The code generator produces really bad code when an 'escaping
- /// alloca' is changed from being a static alloca to being a dynamic alloca.
- /// Until this is resolved, disable this transformation if that would ever
- /// happen. This bug is PR962.
- if (FunctionContainsEscapingAllocas)
- return false;
-
-
- // Second pass, change any tail calls to loops.
- for (Function::iterator BB = F.begin(), E = F.end(); BB != E; ++BB)
- if (ReturnInst *Ret = dyn_cast<ReturnInst>(BB->getTerminator()))
- MadeChange |= ProcessReturningBlock(Ret, OldEntry, TailCallsAreMarkedTail,
- ArgumentPHIs,CannotTCETailMarkedCall);
-
- // If we eliminated any tail recursions, it's possible that we inserted some
- // silly PHI nodes which just merge an initial value (the incoming operand)
- // with themselves. Check to see if we did and clean up our mess if so. This
- // occurs when a function passes an argument straight through to its tail
- // call.
- if (!ArgumentPHIs.empty()) {
- for (unsigned i = 0, e = ArgumentPHIs.size(); i != e; ++i) {
- PHINode *PN = ArgumentPHIs[i];
-
- // If the PHI Node is a dynamic constant, replace it with the value it is.
- if (Value *PNV = PN->hasConstantValue()) {
- PN->replaceAllUsesWith(PNV);
- PN->eraseFromParent();
- }
- }
- }
-
- // Finally, if this function contains no non-escaping allocas, mark all calls
- // in the function as eligible for tail calls (there is no stack memory for
- // them to access).
- if (!FunctionContainsEscapingAllocas)
- for (Function::iterator BB = F.begin(), E = F.end(); BB != E; ++BB)
- for (BasicBlock::iterator I = BB->begin(), E = BB->end(); I != E; ++I)
- if (CallInst *CI = dyn_cast<CallInst>(I))
- CI->setTailCall();
-
- return MadeChange;
-}
-
-
-/// CanMoveAboveCall - Return true if it is safe to move the specified
-/// instruction from after the call to before the call, assuming that all
-/// instructions between the call and this instruction are movable.
-///
-bool TailCallElim::CanMoveAboveCall(Instruction *I, CallInst *CI) {
- // FIXME: We can move load/store/call/free instructions above the call if the
- // call does not mod/ref the memory location being processed.
- if (I->mayWriteToMemory() || isa<LoadInst>(I))
- return false;
-
- // Otherwise, if this is a side-effect free instruction, check to make sure
- // that it does not use the return value of the call. If it doesn't use the
- // return value of the call, it must only use things that are defined before
- // the call, or movable instructions between the call and the instruction
- // itself.
- for (unsigned i = 0, e = I->getNumOperands(); i != e; ++i)
- if (I->getOperand(i) == CI)
- return false;
- return true;
-}
-
-// isDynamicConstant - Return true if the specified value is the same when the
-// return would exit as it was when the initial iteration of the recursive
-// function was executed.
-//
-// We currently handle static constants and arguments that are not modified as
-// part of the recursion.
-//
-static bool isDynamicConstant(Value *V, CallInst *CI) {
- if (isa<Constant>(V)) return true; // Static constants are always dyn consts
-
- // Check to see if this is an immutable argument, if so, the value
- // will be available to initialize the accumulator.
- if (Argument *Arg = dyn_cast<Argument>(V)) {
- // Figure out which argument number this is...
- unsigned ArgNo = 0;
- Function *F = CI->getParent()->getParent();
- for (Function::arg_iterator AI = F->arg_begin(); &*AI != Arg; ++AI)
- ++ArgNo;
-
- // If we are passing this argument into call as the corresponding
- // argument operand, then the argument is dynamically constant.
- // Otherwise, we cannot transform this function safely.
- if (CI->getOperand(ArgNo+1) == Arg)
- return true;
- }
- // Not a constant or immutable argument, we can't safely transform.
- return false;
-}
-
-// getCommonReturnValue - Check to see if the function containing the specified
-// return instruction and tail call consistently returns the same
-// runtime-constant value at all exit points. If so, return the returned value.
-//
-static Value *getCommonReturnValue(ReturnInst *TheRI, CallInst *CI) {
- Function *F = TheRI->getParent()->getParent();
- Value *ReturnedValue = 0;
-
- // TODO: Handle multiple value ret instructions;
- if (isa<StructType>(F->getReturnType()))
- return 0;
-
- for (Function::iterator BBI = F->begin(), E = F->end(); BBI != E; ++BBI)
- if (ReturnInst *RI = dyn_cast<ReturnInst>(BBI->getTerminator()))
- if (RI != TheRI) {
- Value *RetOp = RI->getOperand(0);
-
- // We can only perform this transformation if the value returned is
- // evaluatable at the start of the initial invocation of the function,
- // instead of at the end of the evaluation.
- //
- if (!isDynamicConstant(RetOp, CI))
- return 0;
-
- if (ReturnedValue && RetOp != ReturnedValue)
- return 0; // Cannot transform if differing values are returned.
- ReturnedValue = RetOp;
- }
- return ReturnedValue;
-}
-
-/// CanTransformAccumulatorRecursion - If the specified instruction can be
-/// transformed using accumulator recursion elimination, return the constant
-/// which is the start of the accumulator value. Otherwise return null.
-///
-Value *TailCallElim::CanTransformAccumulatorRecursion(Instruction *I,
- CallInst *CI) {
- if (!I->isAssociative()) return 0;
- assert(I->getNumOperands() == 2 &&
- "Associative operations should have 2 args!");
-
- // Exactly one operand should be the result of the call instruction...
- if ((I->getOperand(0) == CI && I->getOperand(1) == CI) ||
- (I->getOperand(0) != CI && I->getOperand(1) != CI))
- return 0;
-
- // The only user of this instruction we allow is a single return instruction.
- if (!I->hasOneUse() || !isa<ReturnInst>(I->use_back()))
- return 0;
-
- // Ok, now we have to check all of the other return instructions in this
- // function. If they return non-constants or differing values, then we cannot
- // transform the function safely.
- return getCommonReturnValue(cast<ReturnInst>(I->use_back()), CI);
-}
-
-bool TailCallElim::ProcessReturningBlock(ReturnInst *Ret, BasicBlock *&OldEntry,
- bool &TailCallsAreMarkedTail,
- std::vector<PHINode*> &ArgumentPHIs,
- bool CannotTailCallElimCallsMarkedTail) {
- BasicBlock *BB = Ret->getParent();
- Function *F = BB->getParent();
-
- if (&BB->front() == Ret) // Make sure there is something before the ret...
- return false;
-
- // If the return is in the entry block, then making this transformation would
- // turn infinite recursion into an infinite loop. This transformation is ok
- // in theory, but breaks some code like:
- // double fabs(double f) { return __builtin_fabs(f); } // a 'fabs' call
- // disable this xform in this case, because the code generator will lower the
- // call to fabs into inline code.
- if (BB == &F->getEntryBlock())
- return false;
-
- // Scan backwards from the return, checking to see if there is a tail call in
- // this block. If so, set CI to it.
- CallInst *CI;
- BasicBlock::iterator BBI = Ret;
- while (1) {
- CI = dyn_cast<CallInst>(BBI);
- if (CI && CI->getCalledFunction() == F)
- break;
-
- if (BBI == BB->begin())
- return false; // Didn't find a potential tail call.
- --BBI;
- }
-
- // If this call is marked as a tail call, and if there are dynamic allocas in
- // the function, we cannot perform this optimization.
- if (CI->isTailCall() && CannotTailCallElimCallsMarkedTail)
- return false;
-
- // If we are introducing accumulator recursion to eliminate associative
- // operations after the call instruction, this variable contains the initial
- // value for the accumulator. If this value is set, we actually perform
- // accumulator recursion elimination instead of simple tail recursion
- // elimination.
- Value *AccumulatorRecursionEliminationInitVal = 0;
- Instruction *AccumulatorRecursionInstr = 0;
-
- // Ok, we found a potential tail call. We can currently only transform the
- // tail call if all of the instructions between the call and the return are
- // movable to above the call itself, leaving the call next to the return.
- // Check that this is the case now.
- for (BBI = CI, ++BBI; &*BBI != Ret; ++BBI)
- if (!CanMoveAboveCall(BBI, CI)) {
- // If we can't move the instruction above the call, it might be because it
- // is an associative operation that could be tranformed using accumulator
- // recursion elimination. Check to see if this is the case, and if so,
- // remember the initial accumulator value for later.
- if ((AccumulatorRecursionEliminationInitVal =
- CanTransformAccumulatorRecursion(BBI, CI))) {
- // Yes, this is accumulator recursion. Remember which instruction
- // accumulates.
- AccumulatorRecursionInstr = BBI;
- } else {
- return false; // Otherwise, we cannot eliminate the tail recursion!
- }
- }
-
- // We can only transform call/return pairs that either ignore the return value
- // of the call and return void, ignore the value of the call and return a
- // constant, return the value returned by the tail call, or that are being
- // accumulator recursion variable eliminated.
- if (Ret->getNumOperands() == 1 && Ret->getReturnValue() != CI &&
- !isa<UndefValue>(Ret->getReturnValue()) &&
- AccumulatorRecursionEliminationInitVal == 0 &&
- !getCommonReturnValue(Ret, CI))
- return false;
-
- // OK! We can transform this tail call. If this is the first one found,
- // create the new entry block, allowing us to branch back to the old entry.
- if (OldEntry == 0) {
- OldEntry = &F->getEntryBlock();
- BasicBlock *NewEntry = BasicBlock::Create("", F, OldEntry);
- NewEntry->takeName(OldEntry);
- OldEntry->setName("tailrecurse");
- BranchInst::Create(OldEntry, NewEntry);
-
- // If this tail call is marked 'tail' and if there are any allocas in the
- // entry block, move them up to the new entry block.
- TailCallsAreMarkedTail = CI->isTailCall();
- if (TailCallsAreMarkedTail)
- // Move all fixed sized allocas from OldEntry to NewEntry.
- for (BasicBlock::iterator OEBI = OldEntry->begin(), E = OldEntry->end(),
- NEBI = NewEntry->begin(); OEBI != E; )
- if (AllocaInst *AI = dyn_cast<AllocaInst>(OEBI++))
- if (isa<ConstantInt>(AI->getArraySize()))
- AI->moveBefore(NEBI);
-
- // Now that we have created a new block, which jumps to the entry
- // block, insert a PHI node for each argument of the function.
- // For now, we initialize each PHI to only have the real arguments
- // which are passed in.
- Instruction *InsertPos = OldEntry->begin();
- for (Function::arg_iterator I = F->arg_begin(), E = F->arg_end();
- I != E; ++I) {
- PHINode *PN = PHINode::Create(I->getType(), I->getName()+".tr", InsertPos);
- I->replaceAllUsesWith(PN); // Everyone use the PHI node now!
- PN->addIncoming(I, NewEntry);
- ArgumentPHIs.push_back(PN);
- }
- }
-
- // If this function has self recursive calls in the tail position where some
- // are marked tail and some are not, only transform one flavor or another. We
- // have to choose whether we move allocas in the entry block to the new entry
- // block or not, so we can't make a good choice for both. NOTE: We could do
- // slightly better here in the case that the function has no entry block
- // allocas.
- if (TailCallsAreMarkedTail && !CI->isTailCall())
- return false;
-
- // Ok, now that we know we have a pseudo-entry block WITH all of the
- // required PHI nodes, add entries into the PHI node for the actual
- // parameters passed into the tail-recursive call.
- for (unsigned i = 0, e = CI->getNumOperands()-1; i != e; ++i)
- ArgumentPHIs[i]->addIncoming(CI->getOperand(i+1), BB);
-
- // If we are introducing an accumulator variable to eliminate the recursion,
- // do so now. Note that we _know_ that no subsequent tail recursion
- // eliminations will happen on this function because of the way the
- // accumulator recursion predicate is set up.
- //
- if (AccumulatorRecursionEliminationInitVal) {
- Instruction *AccRecInstr = AccumulatorRecursionInstr;
- // Start by inserting a new PHI node for the accumulator.
- PHINode *AccPN = PHINode::Create(AccRecInstr->getType(), "accumulator.tr",
- OldEntry->begin());
-
- // Loop over all of the predecessors of the tail recursion block. For the
- // real entry into the function we seed the PHI with the initial value,
- // computed earlier. For any other existing branches to this block (due to
- // other tail recursions eliminated) the accumulator is not modified.
- // Because we haven't added the branch in the current block to OldEntry yet,
- // it will not show up as a predecessor.
- for (pred_iterator PI = pred_begin(OldEntry), PE = pred_end(OldEntry);
- PI != PE; ++PI) {
- if (*PI == &F->getEntryBlock())
- AccPN->addIncoming(AccumulatorRecursionEliminationInitVal, *PI);
- else
- AccPN->addIncoming(AccPN, *PI);
- }
-
- // Add an incoming argument for the current block, which is computed by our
- // associative accumulator instruction.
- AccPN->addIncoming(AccRecInstr, BB);
-
- // Next, rewrite the accumulator recursion instruction so that it does not
- // use the result of the call anymore, instead, use the PHI node we just
- // inserted.
- AccRecInstr->setOperand(AccRecInstr->getOperand(0) != CI, AccPN);
-
- // Finally, rewrite any return instructions in the program to return the PHI
- // node instead of the "initval" that they do currently. This loop will
- // actually rewrite the return value we are destroying, but that's ok.
- for (Function::iterator BBI = F->begin(), E = F->end(); BBI != E; ++BBI)
- if (ReturnInst *RI = dyn_cast<ReturnInst>(BBI->getTerminator()))
- RI->setOperand(0, AccPN);
- ++NumAccumAdded;
- }
-
- // Now that all of the PHI nodes are in place, remove the call and
- // ret instructions, replacing them with an unconditional branch.
- BranchInst::Create(OldEntry, Ret);
- BB->getInstList().erase(Ret); // Remove return.
- BB->getInstList().erase(CI); // Remove call.
- ++NumEliminated;
- return true;
-}
diff --git a/release_23/lib/Transforms/Utils/BasicBlockUtils.cpp b/release_23/lib/Transforms/Utils/BasicBlockUtils.cpp
deleted file mode 100644
index 93a8c8e59343..000000000000
--- a/release_23/lib/Transforms/Utils/BasicBlockUtils.cpp
+++ /dev/null
@@ -1,285 +0,0 @@
-//===-- BasicBlockUtils.cpp - BasicBlock Utilities -------------------------==//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This family of functions perform manipulations on basic blocks, and
-// instructions contained within basic blocks.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Transforms/Utils/BasicBlockUtils.h"
-#include "llvm/Function.h"
-#include "llvm/Instructions.h"
-#include "llvm/Constant.h"
-#include "llvm/Type.h"
-#include "llvm/Analysis/AliasAnalysis.h"
-#include "llvm/Analysis/LoopInfo.h"
-#include "llvm/Analysis/Dominators.h"
-#include <algorithm>
-using namespace llvm;
-
-/// ReplaceInstWithValue - Replace all uses of an instruction (specified by BI)
-/// with a value, then remove and delete the original instruction.
-///
-void llvm::ReplaceInstWithValue(BasicBlock::InstListType &BIL,
- BasicBlock::iterator &BI, Value *V) {
- Instruction &I = *BI;
- // Replaces all of the uses of the instruction with uses of the value
- I.replaceAllUsesWith(V);
-
- // Make sure to propagate a name if there is one already.
- if (I.hasName() && !V->hasName())
- V->takeName(&I);
-
- // Delete the unnecessary instruction now...
- BI = BIL.erase(BI);
-}
-
-
-/// ReplaceInstWithInst - Replace the instruction specified by BI with the
-/// instruction specified by I. The original instruction is deleted and BI is
-/// updated to point to the new instruction.
-///
-void llvm::ReplaceInstWithInst(BasicBlock::InstListType &BIL,
- BasicBlock::iterator &BI, Instruction *I) {
- assert(I->getParent() == 0 &&
- "ReplaceInstWithInst: Instruction already inserted into basic block!");
-
- // Insert the new instruction into the basic block...
- BasicBlock::iterator New = BIL.insert(BI, I);
-
- // Replace all uses of the old instruction, and delete it.
- ReplaceInstWithValue(BIL, BI, I);
-
- // Move BI back to point to the newly inserted instruction
- BI = New;
-}
-
-/// ReplaceInstWithInst - Replace the instruction specified by From with the
-/// instruction specified by To.
-///
-void llvm::ReplaceInstWithInst(Instruction *From, Instruction *To) {
- BasicBlock::iterator BI(From);
- ReplaceInstWithInst(From->getParent()->getInstList(), BI, To);
-}
-
-/// RemoveSuccessor - Change the specified terminator instruction such that its
-/// successor SuccNum no longer exists. Because this reduces the outgoing
-/// degree of the current basic block, the actual terminator instruction itself
-/// may have to be changed. In the case where the last successor of the block
-/// is deleted, a return instruction is inserted in its place which can cause a
-/// surprising change in program behavior if it is not expected.
-///
-void llvm::RemoveSuccessor(TerminatorInst *TI, unsigned SuccNum) {
- assert(SuccNum < TI->getNumSuccessors() &&
- "Trying to remove a nonexistant successor!");
-
- // If our old successor block contains any PHI nodes, remove the entry in the
- // PHI nodes that comes from this branch...
- //
- BasicBlock *BB = TI->getParent();
- TI->getSuccessor(SuccNum)->removePredecessor(BB);
-
- TerminatorInst *NewTI = 0;
- switch (TI->getOpcode()) {
- case Instruction::Br:
- // If this is a conditional branch... convert to unconditional branch.
- if (TI->getNumSuccessors() == 2) {
- cast<BranchInst>(TI)->setUnconditionalDest(TI->getSuccessor(1-SuccNum));
- } else { // Otherwise convert to a return instruction...
- Value *RetVal = 0;
-
- // Create a value to return... if the function doesn't return null...
- if (BB->getParent()->getReturnType() != Type::VoidTy)
- RetVal = Constant::getNullValue(BB->getParent()->getReturnType());
-
- // Create the return...
- NewTI = ReturnInst::Create(RetVal);
- }
- break;
-
- case Instruction::Invoke: // Should convert to call
- case Instruction::Switch: // Should remove entry
- default:
- case Instruction::Ret: // Cannot happen, has no successors!
- assert(0 && "Unhandled terminator instruction type in RemoveSuccessor!");
- abort();
- }
-
- if (NewTI) // If it's a different instruction, replace.
- ReplaceInstWithInst(TI, NewTI);
-}
-
-/// SplitEdge - Split the edge connecting specified block. Pass P must
-/// not be NULL.
-BasicBlock *llvm::SplitEdge(BasicBlock *BB, BasicBlock *Succ, Pass *P) {
- TerminatorInst *LatchTerm = BB->getTerminator();
- unsigned SuccNum = 0;
- for (unsigned i = 0, e = LatchTerm->getNumSuccessors(); ; ++i) {
- assert(i != e && "Didn't find edge?");
- if (LatchTerm->getSuccessor(i) == Succ) {
- SuccNum = i;
- break;
- }
- }
-
- // If this is a critical edge, let SplitCriticalEdge do it.
- if (SplitCriticalEdge(BB->getTerminator(), SuccNum, P))
- return LatchTerm->getSuccessor(SuccNum);
-
- // If the edge isn't critical, then BB has a single successor or Succ has a
- // single pred. Split the block.
- BasicBlock::iterator SplitPoint;
- if (BasicBlock *SP = Succ->getSinglePredecessor()) {
- // If the successor only has a single pred, split the top of the successor
- // block.
- assert(SP == BB && "CFG broken");
- return SplitBlock(Succ, Succ->begin(), P);
- } else {
- // Otherwise, if BB has a single successor, split it at the bottom of the
- // block.
- assert(BB->getTerminator()->getNumSuccessors() == 1 &&
- "Should have a single succ!");
- return SplitBlock(BB, BB->getTerminator(), P);
- }
-}
-
-/// SplitBlock - Split the specified block at the specified instruction - every
-/// thing before SplitPt stays in Old and everything starting with SplitPt moves
-/// to a new block. The two blocks are joined by an unconditional branch and
-/// the loop info is updated.
-///
-BasicBlock *llvm::SplitBlock(BasicBlock *Old, Instruction *SplitPt, Pass *P) {
-
- LoopInfo &LI = P->getAnalysis<LoopInfo>();
- BasicBlock::iterator SplitIt = SplitPt;
- while (isa<PHINode>(SplitIt))
- ++SplitIt;
- BasicBlock *New = Old->splitBasicBlock(SplitIt, Old->getName()+".split");
-
- // The new block lives in whichever loop the old one did.
- if (Loop *L = LI.getLoopFor(Old))
- L->addBasicBlockToLoop(New, LI.getBase());
-
- if (DominatorTree *DT = P->getAnalysisToUpdate<DominatorTree>())
- {
- // Old dominates New. New node domiantes all other nodes dominated by Old.
- DomTreeNode *OldNode = DT->getNode(Old);
- std::vector<DomTreeNode *> Children;
- for (DomTreeNode::iterator I = OldNode->begin(), E = OldNode->end();
- I != E; ++I)
- Children.push_back(*I);
-
- DomTreeNode *NewNode = DT->addNewBlock(New,Old);
-
- for (std::vector<DomTreeNode *>::iterator I = Children.begin(),
- E = Children.end(); I != E; ++I)
- DT->changeImmediateDominator(*I, NewNode);
- }
-
- if (DominanceFrontier *DF = P->getAnalysisToUpdate<DominanceFrontier>())
- DF->splitBlock(Old);
-
- return New;
-}
-
-
-/// SplitBlockPredecessors - This method transforms BB by introducing a new
-/// basic block into the function, and moving some of the predecessors of BB to
-/// be predecessors of the new block. The new predecessors are indicated by the
-/// Preds array, which has NumPreds elements in it. The new block is given a
-/// suffix of 'Suffix'.
-///
-/// This currently updates the LLVM IR, AliasAnalysis, DominatorTree and
-/// DominanceFrontier, but no other analyses.
-BasicBlock *llvm::SplitBlockPredecessors(BasicBlock *BB,
- BasicBlock *const *Preds,
- unsigned NumPreds, const char *Suffix,
- Pass *P) {
- // Create new basic block, insert right before the original block.
- BasicBlock *NewBB =
- BasicBlock::Create(BB->getName()+Suffix, BB->getParent(), BB);
-
- // The new block unconditionally branches to the old block.
- BranchInst *BI = BranchInst::Create(BB, NewBB);
-
- // Move the edges from Preds to point to NewBB instead of BB.
- for (unsigned i = 0; i != NumPreds; ++i)
- Preds[i]->getTerminator()->replaceUsesOfWith(BB, NewBB);
-
- // Update dominator tree and dominator frontier if available.
- DominatorTree *DT = P ? P->getAnalysisToUpdate<DominatorTree>() : 0;
- if (DT)
- DT->splitBlock(NewBB);
- if (DominanceFrontier *DF = P ? P->getAnalysisToUpdate<DominanceFrontier>():0)
- DF->splitBlock(NewBB);
- AliasAnalysis *AA = P ? P->getAnalysisToUpdate<AliasAnalysis>() : 0;
-
-
- // Insert a new PHI node into NewBB for every PHI node in BB and that new PHI
- // node becomes an incoming value for BB's phi node. However, if the Preds
- // list is empty, we need to insert dummy entries into the PHI nodes in BB to
- // account for the newly created predecessor.
- if (NumPreds == 0) {
- // Insert dummy values as the incoming value.
- for (BasicBlock::iterator I = BB->begin(); isa<PHINode>(I); ++I)
- cast<PHINode>(I)->addIncoming(UndefValue::get(I->getType()), NewBB);
- return NewBB;
- }
-
- // Otherwise, create a new PHI node in NewBB for each PHI node in BB.
- for (BasicBlock::iterator I = BB->begin(); isa<PHINode>(I); ) {
- PHINode *PN = cast<PHINode>(I++);
-
- // Check to see if all of the values coming in are the same. If so, we
- // don't need to create a new PHI node.
- Value *InVal = PN->getIncomingValueForBlock(Preds[0]);
- for (unsigned i = 1; i != NumPreds; ++i)
- if (InVal != PN->getIncomingValueForBlock(Preds[i])) {
- InVal = 0;
- break;
- }
-
- if (InVal) {
- // If all incoming values for the new PHI would be the same, just don't
- // make a new PHI. Instead, just remove the incoming values from the old
- // PHI.
- for (unsigned i = 0; i != NumPreds; ++i)
- PN->removeIncomingValue(Preds[i], false);
- } else {
- // If the values coming into the block are not the same, we need a PHI.
- // Create the new PHI node, insert it into NewBB at the end of the block
- PHINode *NewPHI =
- PHINode::Create(PN->getType(), PN->getName()+".ph", BI);
- if (AA) AA->copyValue(PN, NewPHI);
-
- // Move all of the PHI values for 'Preds' to the new PHI.
- for (unsigned i = 0; i != NumPreds; ++i) {
- Value *V = PN->removeIncomingValue(Preds[i], false);
- NewPHI->addIncoming(V, Preds[i]);
- }
- InVal = NewPHI;
- }
-
- // Add an incoming value to the PHI node in the loop for the preheader
- // edge.
- PN->addIncoming(InVal, NewBB);
-
- // Check to see if we can eliminate this phi node.
- if (Value *V = PN->hasConstantValue(DT != 0)) {
- Instruction *I = dyn_cast<Instruction>(V);
- if (!I || DT == 0 || DT->dominates(I, PN)) {
- PN->replaceAllUsesWith(V);
- if (AA) AA->deleteValue(PN);
- PN->eraseFromParent();
- }
- }
- }
-
- return NewBB;
-}
diff --git a/release_23/lib/Transforms/Utils/BasicInliner.cpp b/release_23/lib/Transforms/Utils/BasicInliner.cpp
deleted file mode 100644
index a3f294d34212..000000000000
--- a/release_23/lib/Transforms/Utils/BasicInliner.cpp
+++ /dev/null
@@ -1,170 +0,0 @@
-//===- BasicInliner.cpp - Basic function level inliner --------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines a simple function based inliner that does not use
-// call graph information.
-//
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "basicinliner"
-
-#include "llvm/Module.h"
-#include "llvm/Function.h"
-#include "llvm/Transforms/Utils/BasicInliner.h"
-#include "llvm/Transforms/Utils/Cloning.h"
-#include "llvm/Support/CallSite.h"
-#include "llvm/Support/CommandLine.h"
-#include "llvm/Support/Debug.h"
-#include "llvm/ADT/SmallPtrSet.h"
-#include <vector>
-
-using namespace llvm;
-
-namespace {
- static cl::opt<unsigned>
- BasicInlineThreshold("inline-threshold", cl::Hidden, cl::init(200),
- cl::desc("Control the amount of basic inlining to perform (default = 200)"));
-}
-
-namespace llvm {
-
- /// BasicInlinerImpl - BasicInliner implemantation class. This hides
- /// container info, used by basic inliner, from public interface.
- struct VISIBILITY_HIDDEN BasicInlinerImpl {
-
- BasicInlinerImpl(const BasicInlinerImpl&); // DO NOT IMPLEMENT
- void operator=(const BasicInlinerImpl&); // DO NO IMPLEMENT
- public:
- BasicInlinerImpl(TargetData *T) : TD(T) {}
-
- /// addFunction - Add function into the list of functions to process.
- /// All functions must be inserted using this interface before invoking
- /// inlineFunctions().
- void addFunction(Function *F) {
- Functions.push_back(F);
- }
-
- /// neverInlineFunction - Sometimes a function is never to be inlined
- /// because of one or other reason.
- void neverInlineFunction(Function *F) {
- NeverInline.insert(F);
- }
-
- /// inlineFuctions - Walk all call sites in all functions supplied by
- /// client. Inline as many call sites as possible. Delete completely
- /// inlined functions.
- void inlineFunctions();
-
- private:
- TargetData *TD;
- std::vector<Function *> Functions;
- SmallPtrSet<const Function *, 16> NeverInline;
- SmallPtrSet<Function *, 8> DeadFunctions;
- InlineCostAnalyzer CA;
- };
-
-/// inlineFuctions - Walk all call sites in all functions supplied by
-/// client. Inline as many call sites as possible. Delete completely
-/// inlined functions.
-void BasicInlinerImpl::inlineFunctions() {
-
- // Scan through and identify all call sites ahead of time so that we only
- // inline call sites in the original functions, not call sites that result
- // from inlining other functions.
- std::vector<CallSite> CallSites;
-
- for (std::vector<Function *>::iterator FI = Functions.begin(),
- FE = Functions.end(); FI != FE; ++FI) {
- Function *F = *FI;
- for (Function::iterator BB = F->begin(), E = F->end(); BB != E; ++BB)
- for (BasicBlock::iterator I = BB->begin(); I != BB->end(); ++I) {
- CallSite CS = CallSite::get(I);
- if (CS.getInstruction() && CS.getCalledFunction()
- && !CS.getCalledFunction()->isDeclaration())
- CallSites.push_back(CS);
- }
- }
-
- DOUT << ": " << CallSites.size() << " call sites.\n";
-
- // Inline call sites.
- bool Changed = false;
- do {
- Changed = false;
- for (unsigned index = 0; index != CallSites.size() && !CallSites.empty(); ++index) {
- CallSite CS = CallSites[index];
- if (Function *Callee = CS.getCalledFunction()) {
-
- // Eliminate calls taht are never inlinable.
- if (Callee->isDeclaration() ||
- CS.getInstruction()->getParent()->getParent() == Callee) {
- CallSites.erase(CallSites.begin() + index);
- --index;
- continue;
- }
- int InlineCost = CA.getInlineCost(CS, NeverInline);
- if (InlineCost >= (int) BasicInlineThreshold) {
- DOUT << " NOT Inlining: cost = " << InlineCost
- << ", call: " << *CS.getInstruction();
- continue;
- }
-
- DOUT << " Inlining: cost=" << InlineCost
- <<", call: " << *CS.getInstruction();
-
- // Inline
- if (InlineFunction(CS, NULL, TD)) {
- if (Callee->use_empty() && Callee->hasInternalLinkage())
- DeadFunctions.insert(Callee);
- Changed = true;
- CallSites.erase(CallSites.begin() + index);
- --index;
- }
- }
- }
- } while (Changed);
-
- // Remove completely inlined functions from module.
- for(SmallPtrSet<Function *, 8>::iterator I = DeadFunctions.begin(),
- E = DeadFunctions.end(); I != E; ++I) {
- Function *D = *I;
- Module *M = D->getParent();
- M->getFunctionList().remove(D);
- }
-}
-
-BasicInliner::BasicInliner(TargetData *TD) {
- Impl = new BasicInlinerImpl(TD);
-}
-
-BasicInliner::~BasicInliner() {
- delete Impl;
-}
-
-/// addFunction - Add function into the list of functions to process.
-/// All functions must be inserted using this interface before invoking
-/// inlineFunctions().
-void BasicInliner::addFunction(Function *F) {
- Impl->addFunction(F);
-}
-
-/// neverInlineFunction - Sometimes a function is never to be inlined because
-/// of one or other reason.
-void BasicInliner::neverInlineFunction(Function *F) {
- Impl->neverInlineFunction(F);
-}
-
-/// inlineFuctions - Walk all call sites in all functions supplied by
-/// client. Inline as many call sites as possible. Delete completely
-/// inlined functions.
-void BasicInliner::inlineFunctions() {
- Impl->inlineFunctions();
-}
-
-}
diff --git a/release_23/lib/Transforms/Utils/BreakCriticalEdges.cpp b/release_23/lib/Transforms/Utils/BreakCriticalEdges.cpp
deleted file mode 100644
index e230ca683040..000000000000
--- a/release_23/lib/Transforms/Utils/BreakCriticalEdges.cpp
+++ /dev/null
@@ -1,279 +0,0 @@
-//===- BreakCriticalEdges.cpp - Critical Edge Elimination Pass ------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// BreakCriticalEdges pass - Break all of the critical edges in the CFG by
-// inserting a dummy basic block. This pass may be "required" by passes that
-// cannot deal with critical edges. For this usage, the structure type is
-// forward declared. This pass obviously invalidates the CFG, but can update
-// forward dominator (set, immediate dominators, tree, and frontier)
-// information.
-//
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "break-crit-edges"
-#include "llvm/Transforms/Scalar.h"
-#include "llvm/Transforms/Utils/BasicBlockUtils.h"
-#include "llvm/Analysis/Dominators.h"
-#include "llvm/Analysis/LoopInfo.h"
-#include "llvm/Function.h"
-#include "llvm/Instructions.h"
-#include "llvm/Type.h"
-#include "llvm/Support/CFG.h"
-#include "llvm/Support/Compiler.h"
-#include "llvm/ADT/SmallVector.h"
-#include "llvm/ADT/Statistic.h"
-using namespace llvm;
-
-STATISTIC(NumBroken, "Number of blocks inserted");
-
-namespace {
- struct VISIBILITY_HIDDEN BreakCriticalEdges : public FunctionPass {
- static char ID; // Pass identification, replacement for typeid
- BreakCriticalEdges() : FunctionPass((intptr_t)&ID) {}
-
- virtual bool runOnFunction(Function &F);
-
- virtual void getAnalysisUsage(AnalysisUsage &AU) const {
- AU.addPreserved<DominatorTree>();
- AU.addPreserved<DominanceFrontier>();
- AU.addPreserved<LoopInfo>();
-
- // No loop canonicalization guarantees are broken by this pass.
- AU.addPreservedID(LoopSimplifyID);
- }
- };
-
- char BreakCriticalEdges::ID = 0;
- RegisterPass<BreakCriticalEdges> X("break-crit-edges",
- "Break critical edges in CFG");
-}
-
-// Publically exposed interface to pass...
-const PassInfo *llvm::BreakCriticalEdgesID = X.getPassInfo();
-FunctionPass *llvm::createBreakCriticalEdgesPass() {
- return new BreakCriticalEdges();
-}
-
-// runOnFunction - Loop over all of the edges in the CFG, breaking critical
-// edges as they are found.
-//
-bool BreakCriticalEdges::runOnFunction(Function &F) {
- bool Changed = false;
- for (Function::iterator I = F.begin(), E = F.end(); I != E; ++I) {
- TerminatorInst *TI = I->getTerminator();
- if (TI->getNumSuccessors() > 1)
- for (unsigned i = 0, e = TI->getNumSuccessors(); i != e; ++i)
- if (SplitCriticalEdge(TI, i, this)) {
- ++NumBroken;
- Changed = true;
- }
- }
-
- return Changed;
-}
-
-//===----------------------------------------------------------------------===//
-// Implementation of the external critical edge manipulation functions
-//===----------------------------------------------------------------------===//
-
-// isCriticalEdge - Return true if the specified edge is a critical edge.
-// Critical edges are edges from a block with multiple successors to a block
-// with multiple predecessors.
-//
-bool llvm::isCriticalEdge(const TerminatorInst *TI, unsigned SuccNum,
- bool AllowIdenticalEdges) {
- assert(SuccNum < TI->getNumSuccessors() && "Illegal edge specification!");
- if (TI->getNumSuccessors() == 1) return false;
-
- const BasicBlock *Dest = TI->getSuccessor(SuccNum);
- pred_const_iterator I = pred_begin(Dest), E = pred_end(Dest);
-
- // If there is more than one predecessor, this is a critical edge...
- assert(I != E && "No preds, but we have an edge to the block?");
- const BasicBlock *FirstPred = *I;
- ++I; // Skip one edge due to the incoming arc from TI.
- if (!AllowIdenticalEdges)
- return I != E;
-
- // If AllowIdenticalEdges is true, then we allow this edge to be considered
- // non-critical iff all preds come from TI's block.
- while (I != E) {
- if (*I != FirstPred)
- return true;
- // Note: leave this as is until no one ever compiles with either gcc 4.0.1
- // or Xcode 2. This seems to work around the pred_iterator assert in PR 2207
- E = pred_end(*I);
- ++I;
- }
- return false;
-}
-
-/// SplitCriticalEdge - If this edge is a critical edge, insert a new node to
-/// split the critical edge. This will update DominatorTree and
-/// DominatorFrontier information if it is available, thus calling this pass
-/// will not invalidate any of them. This returns true if the edge was split,
-/// false otherwise. This ensures that all edges to that dest go to one block
-/// instead of each going to a different block.
-//
-bool llvm::SplitCriticalEdge(TerminatorInst *TI, unsigned SuccNum, Pass *P,
- bool MergeIdenticalEdges) {
- if (!isCriticalEdge(TI, SuccNum, MergeIdenticalEdges)) return false;
- BasicBlock *TIBB = TI->getParent();
- BasicBlock *DestBB = TI->getSuccessor(SuccNum);
-
- // Create a new basic block, linking it into the CFG.
- BasicBlock *NewBB = BasicBlock::Create(TIBB->getName() + "." +
- DestBB->getName() + "_crit_edge");
- // Create our unconditional branch...
- BranchInst::Create(DestBB, NewBB);
-
- // Branch to the new block, breaking the edge.
- TI->setSuccessor(SuccNum, NewBB);
-
- // Insert the block into the function... right after the block TI lives in.
- Function &F = *TIBB->getParent();
- Function::iterator FBBI = TIBB;
- F.getBasicBlockList().insert(++FBBI, NewBB);
-
- // If there are any PHI nodes in DestBB, we need to update them so that they
- // merge incoming values from NewBB instead of from TIBB.
- //
- for (BasicBlock::iterator I = DestBB->begin(); isa<PHINode>(I); ++I) {
- PHINode *PN = cast<PHINode>(I);
- // We no longer enter through TIBB, now we come in through NewBB. Revector
- // exactly one entry in the PHI node that used to come from TIBB to come
- // from NewBB.
- int BBIdx = PN->getBasicBlockIndex(TIBB);
- PN->setIncomingBlock(BBIdx, NewBB);
- }
-
- // If there are any other edges from TIBB to DestBB, update those to go
- // through the split block, making those edges non-critical as well (and
- // reducing the number of phi entries in the DestBB if relevant).
- if (MergeIdenticalEdges) {
- for (unsigned i = SuccNum+1, e = TI->getNumSuccessors(); i != e; ++i) {
- if (TI->getSuccessor(i) != DestBB) continue;
-
- // Remove an entry for TIBB from DestBB phi nodes.
- DestBB->removePredecessor(TIBB);
-
- // We found another edge to DestBB, go to NewBB instead.
- TI->setSuccessor(i, NewBB);
- }
- }
-
-
-
- // If we don't have a pass object, we can't update anything...
- if (P == 0) return true;
-
- // Now update analysis information. Since the only predecessor of NewBB is
- // the TIBB, TIBB clearly dominates NewBB. TIBB usually doesn't dominate
- // anything, as there are other successors of DestBB. However, if all other
- // predecessors of DestBB are already dominated by DestBB (e.g. DestBB is a
- // loop header) then NewBB dominates DestBB.
- SmallVector<BasicBlock*, 8> OtherPreds;
-
- for (pred_iterator I = pred_begin(DestBB), E = pred_end(DestBB); I != E; ++I)
- if (*I != NewBB)
- OtherPreds.push_back(*I);
-
- bool NewBBDominatesDestBB = true;
-
- // Should we update DominatorTree information?
- if (DominatorTree *DT = P->getAnalysisToUpdate<DominatorTree>()) {
- DomTreeNode *TINode = DT->getNode(TIBB);
-
- // The new block is not the immediate dominator for any other nodes, but
- // TINode is the immediate dominator for the new node.
- //
- if (TINode) { // Don't break unreachable code!
- DomTreeNode *NewBBNode = DT->addNewBlock(NewBB, TIBB);
- DomTreeNode *DestBBNode = 0;
-
- // If NewBBDominatesDestBB hasn't been computed yet, do so with DT.
- if (!OtherPreds.empty()) {
- DestBBNode = DT->getNode(DestBB);
- while (!OtherPreds.empty() && NewBBDominatesDestBB) {
- if (DomTreeNode *OPNode = DT->getNode(OtherPreds.back()))
- NewBBDominatesDestBB = DT->dominates(DestBBNode, OPNode);
- OtherPreds.pop_back();
- }
- OtherPreds.clear();
- }
-
- // If NewBBDominatesDestBB, then NewBB dominates DestBB, otherwise it
- // doesn't dominate anything.
- if (NewBBDominatesDestBB) {
- if (!DestBBNode) DestBBNode = DT->getNode(DestBB);
- DT->changeImmediateDominator(DestBBNode, NewBBNode);
- }
- }
- }
-
- // Should we update DominanceFrontier information?
- if (DominanceFrontier *DF = P->getAnalysisToUpdate<DominanceFrontier>()) {
- // If NewBBDominatesDestBB hasn't been computed yet, do so with DF.
- if (!OtherPreds.empty()) {
- // FIXME: IMPLEMENT THIS!
- assert(0 && "Requiring domfrontiers but not idom/domtree/domset."
- " not implemented yet!");
- }
-
- // Since the new block is dominated by its only predecessor TIBB,
- // it cannot be in any block's dominance frontier. If NewBB dominates
- // DestBB, its dominance frontier is the same as DestBB's, otherwise it is
- // just {DestBB}.
- DominanceFrontier::DomSetType NewDFSet;
- if (NewBBDominatesDestBB) {
- DominanceFrontier::iterator I = DF->find(DestBB);
- if (I != DF->end()) {
- DF->addBasicBlock(NewBB, I->second);
- // However NewBB's frontier does not include DestBB.
- DominanceFrontier::iterator NF = DF->find(NewBB);
- DF->removeFromFrontier(NF, DestBB);
- }
- else
- DF->addBasicBlock(NewBB, DominanceFrontier::DomSetType());
- } else {
- DominanceFrontier::DomSetType NewDFSet;
- NewDFSet.insert(DestBB);
- DF->addBasicBlock(NewBB, NewDFSet);
- }
- }
-
- // Update LoopInfo if it is around.
- if (LoopInfo *LI = P->getAnalysisToUpdate<LoopInfo>()) {
- // If one or the other blocks were not in a loop, the new block is not
- // either, and thus LI doesn't need to be updated.
- if (Loop *TIL = LI->getLoopFor(TIBB))
- if (Loop *DestLoop = LI->getLoopFor(DestBB)) {
- if (TIL == DestLoop) {
- // Both in the same loop, the NewBB joins loop.
- DestLoop->addBasicBlockToLoop(NewBB, LI->getBase());
- } else if (TIL->contains(DestLoop->getHeader())) {
- // Edge from an outer loop to an inner loop. Add to the outer loop.
- TIL->addBasicBlockToLoop(NewBB, LI->getBase());
- } else if (DestLoop->contains(TIL->getHeader())) {
- // Edge from an inner loop to an outer loop. Add to the outer loop.
- DestLoop->addBasicBlockToLoop(NewBB, LI->getBase());
- } else {
- // Edge from two loops with no containment relation. Because these
- // are natural loops, we know that the destination block must be the
- // header of its loop (adding a branch into a loop elsewhere would
- // create an irreducible loop).
- assert(DestLoop->getHeader() == DestBB &&
- "Should not create irreducible loops!");
- if (Loop *P = DestLoop->getParentLoop())
- P->addBasicBlockToLoop(NewBB, LI->getBase());
- }
- }
- }
- return true;
-}
diff --git a/release_23/lib/Transforms/Utils/CloneFunction.cpp b/release_23/lib/Transforms/Utils/CloneFunction.cpp
deleted file mode 100644
index 57369143b451..000000000000
--- a/release_23/lib/Transforms/Utils/CloneFunction.cpp
+++ /dev/null
@@ -1,505 +0,0 @@
-//===- CloneFunction.cpp - Clone a function into another function ---------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the CloneFunctionInto interface, which is used as the
-// low-level function cloner. This is used by the CloneFunction and function
-// inliner to do the dirty work of copying the body of a function around.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Transforms/Utils/Cloning.h"
-#include "llvm/Constants.h"
-#include "llvm/DerivedTypes.h"
-#include "llvm/Instructions.h"
-#include "llvm/GlobalVariable.h"
-#include "llvm/Function.h"
-#include "llvm/Support/CFG.h"
-#include "llvm/Support/Compiler.h"
-#include "llvm/Transforms/Utils/ValueMapper.h"
-#include "llvm/Analysis/ConstantFolding.h"
-#include "llvm/ADT/SmallVector.h"
-#include <map>
-using namespace llvm;
-
-// CloneBasicBlock - See comments in Cloning.h
-BasicBlock *llvm::CloneBasicBlock(const BasicBlock *BB,
- DenseMap<const Value*, Value*> &ValueMap,
- const char *NameSuffix, Function *F,
- ClonedCodeInfo *CodeInfo) {
- BasicBlock *NewBB = BasicBlock::Create("", F);
- if (BB->hasName()) NewBB->setName(BB->getName()+NameSuffix);
-
- bool hasCalls = false, hasDynamicAllocas = false, hasStaticAllocas = false;
-
- // Loop over all instructions, and copy them over.
- for (BasicBlock::const_iterator II = BB->begin(), IE = BB->end();
- II != IE; ++II) {
- Instruction *NewInst = II->clone();
- if (II->hasName())
- NewInst->setName(II->getName()+NameSuffix);
- NewBB->getInstList().push_back(NewInst);
- ValueMap[II] = NewInst; // Add instruction map to value.
-
- hasCalls |= isa<CallInst>(II);
- if (const AllocaInst *AI = dyn_cast<AllocaInst>(II)) {
- if (isa<ConstantInt>(AI->getArraySize()))
- hasStaticAllocas = true;
- else
- hasDynamicAllocas = true;
- }
- }
-
- if (CodeInfo) {
- CodeInfo->ContainsCalls |= hasCalls;
- CodeInfo->ContainsUnwinds |= isa<UnwindInst>(BB->getTerminator());
- CodeInfo->ContainsDynamicAllocas |= hasDynamicAllocas;
- CodeInfo->ContainsDynamicAllocas |= hasStaticAllocas &&
- BB != &BB->getParent()->getEntryBlock();
- }
- return NewBB;
-}
-
-// Clone OldFunc into NewFunc, transforming the old arguments into references to
-// ArgMap values.
-//
-void llvm::CloneFunctionInto(Function *NewFunc, const Function *OldFunc,
- DenseMap<const Value*, Value*> &ValueMap,
- std::vector<ReturnInst*> &Returns,
- const char *NameSuffix, ClonedCodeInfo *CodeInfo) {
- assert(NameSuffix && "NameSuffix cannot be null!");
-
-#ifndef NDEBUG
- for (Function::const_arg_iterator I = OldFunc->arg_begin(),
- E = OldFunc->arg_end(); I != E; ++I)
- assert(ValueMap.count(I) && "No mapping from source argument specified!");
-#endif
-
- // Clone the parameter attributes
- NewFunc->setParamAttrs(OldFunc->getParamAttrs());
-
- // Clone the calling convention
- NewFunc->setCallingConv(OldFunc->getCallingConv());
-
- // Loop over all of the basic blocks in the function, cloning them as
- // appropriate. Note that we save BE this way in order to handle cloning of
- // recursive functions into themselves.
- //
- for (Function::const_iterator BI = OldFunc->begin(), BE = OldFunc->end();
- BI != BE; ++BI) {
- const BasicBlock &BB = *BI;
-
- // Create a new basic block and copy instructions into it!
- BasicBlock *CBB = CloneBasicBlock(&BB, ValueMap, NameSuffix, NewFunc,
- CodeInfo);
- ValueMap[&BB] = CBB; // Add basic block mapping.
-
- if (ReturnInst *RI = dyn_cast<ReturnInst>(CBB->getTerminator()))
- Returns.push_back(RI);
- }
-
- // Loop over all of the instructions in the function, fixing up operand
- // references as we go. This uses ValueMap to do all the hard work.
- //
- for (Function::iterator BB = cast<BasicBlock>(ValueMap[OldFunc->begin()]),
- BE = NewFunc->end(); BB != BE; ++BB)
- // Loop over all instructions, fixing each one as we find it...
- for (BasicBlock::iterator II = BB->begin(); II != BB->end(); ++II)
- RemapInstruction(II, ValueMap);
-}
-
-/// CloneFunction - Return a copy of the specified function, but without
-/// embedding the function into another module. Also, any references specified
-/// in the ValueMap are changed to refer to their mapped value instead of the
-/// original one. If any of the arguments to the function are in the ValueMap,
-/// the arguments are deleted from the resultant function. The ValueMap is
-/// updated to include mappings from all of the instructions and basicblocks in
-/// the function from their old to new values.
-///
-Function *llvm::CloneFunction(const Function *F,
- DenseMap<const Value*, Value*> &ValueMap,
- ClonedCodeInfo *CodeInfo) {
- std::vector<const Type*> ArgTypes;
-
- // The user might be deleting arguments to the function by specifying them in
- // the ValueMap. If so, we need to not add the arguments to the arg ty vector
- //
- for (Function::const_arg_iterator I = F->arg_begin(), E = F->arg_end();
- I != E; ++I)
- if (ValueMap.count(I) == 0) // Haven't mapped the argument to anything yet?
- ArgTypes.push_back(I->getType());
-
- // Create a new function type...
- FunctionType *FTy = FunctionType::get(F->getFunctionType()->getReturnType(),
- ArgTypes, F->getFunctionType()->isVarArg());
-
- // Create the new function...
- Function *NewF = Function::Create(FTy, F->getLinkage(), F->getName());
-
- // Loop over the arguments, copying the names of the mapped arguments over...
- Function::arg_iterator DestI = NewF->arg_begin();
- for (Function::const_arg_iterator I = F->arg_begin(), E = F->arg_end();
- I != E; ++I)
- if (ValueMap.count(I) == 0) { // Is this argument preserved?
- DestI->setName(I->getName()); // Copy the name over...
- ValueMap[I] = DestI++; // Add mapping to ValueMap
- }
-
- std::vector<ReturnInst*> Returns; // Ignore returns cloned...
- CloneFunctionInto(NewF, F, ValueMap, Returns, "", CodeInfo);
- return NewF;
-}
-
-
-
-namespace {
- /// PruningFunctionCloner - This class is a private class used to implement
- /// the CloneAndPruneFunctionInto method.
- struct VISIBILITY_HIDDEN PruningFunctionCloner {
- Function *NewFunc;
- const Function *OldFunc;
- DenseMap<const Value*, Value*> &ValueMap;
- std::vector<ReturnInst*> &Returns;
- const char *NameSuffix;
- ClonedCodeInfo *CodeInfo;
- const TargetData *TD;
-
- public:
- PruningFunctionCloner(Function *newFunc, const Function *oldFunc,
- DenseMap<const Value*, Value*> &valueMap,
- std::vector<ReturnInst*> &returns,
- const char *nameSuffix,
- ClonedCodeInfo *codeInfo,
- const TargetData *td)
- : NewFunc(newFunc), OldFunc(oldFunc), ValueMap(valueMap), Returns(returns),
- NameSuffix(nameSuffix), CodeInfo(codeInfo), TD(td) {
- }
-
- /// CloneBlock - The specified block is found to be reachable, clone it and
- /// anything that it can reach.
- void CloneBlock(const BasicBlock *BB,
- std::vector<const BasicBlock*> &ToClone);
-
- public:
- /// ConstantFoldMappedInstruction - Constant fold the specified instruction,
- /// mapping its operands through ValueMap if they are available.
- Constant *ConstantFoldMappedInstruction(const Instruction *I);
- };
-}
-
-/// CloneBlock - The specified block is found to be reachable, clone it and
-/// anything that it can reach.
-void PruningFunctionCloner::CloneBlock(const BasicBlock *BB,
- std::vector<const BasicBlock*> &ToClone){
- Value *&BBEntry = ValueMap[BB];
-
- // Have we already cloned this block?
- if (BBEntry) return;
-
- // Nope, clone it now.
- BasicBlock *NewBB;
- BBEntry = NewBB = BasicBlock::Create();
- if (BB->hasName()) NewBB->setName(BB->getName()+NameSuffix);
-
- bool hasCalls = false, hasDynamicAllocas = false, hasStaticAllocas = false;
-
- // Loop over all instructions, and copy them over, DCE'ing as we go. This
- // loop doesn't include the terminator.
- for (BasicBlock::const_iterator II = BB->begin(), IE = --BB->end();
- II != IE; ++II) {
- // If this instruction constant folds, don't bother cloning the instruction,
- // instead, just add the constant to the value map.
- if (Constant *C = ConstantFoldMappedInstruction(II)) {
- ValueMap[II] = C;
- continue;
- }
-
- Instruction *NewInst = II->clone();
- if (II->hasName())
- NewInst->setName(II->getName()+NameSuffix);
- NewBB->getInstList().push_back(NewInst);
- ValueMap[II] = NewInst; // Add instruction map to value.
-
- hasCalls |= isa<CallInst>(II);
- if (const AllocaInst *AI = dyn_cast<AllocaInst>(II)) {
- if (isa<ConstantInt>(AI->getArraySize()))
- hasStaticAllocas = true;
- else
- hasDynamicAllocas = true;
- }
- }
-
- // Finally, clone over the terminator.
- const TerminatorInst *OldTI = BB->getTerminator();
- bool TerminatorDone = false;
- if (const BranchInst *BI = dyn_cast<BranchInst>(OldTI)) {
- if (BI->isConditional()) {
- // If the condition was a known constant in the callee...
- ConstantInt *Cond = dyn_cast<ConstantInt>(BI->getCondition());
- // Or is a known constant in the caller...
- if (Cond == 0)
- Cond = dyn_cast_or_null<ConstantInt>(ValueMap[BI->getCondition()]);
-
- // Constant fold to uncond branch!
- if (Cond) {
- BasicBlock *Dest = BI->getSuccessor(!Cond->getZExtValue());
- ValueMap[OldTI] = BranchInst::Create(Dest, NewBB);
- ToClone.push_back(Dest);
- TerminatorDone = true;
- }
- }
- } else if (const SwitchInst *SI = dyn_cast<SwitchInst>(OldTI)) {
- // If switching on a value known constant in the caller.
- ConstantInt *Cond = dyn_cast<ConstantInt>(SI->getCondition());
- if (Cond == 0) // Or known constant after constant prop in the callee...
- Cond = dyn_cast_or_null<ConstantInt>(ValueMap[SI->getCondition()]);
- if (Cond) { // Constant fold to uncond branch!
- BasicBlock *Dest = SI->getSuccessor(SI->findCaseValue(Cond));
- ValueMap[OldTI] = BranchInst::Create(Dest, NewBB);
- ToClone.push_back(Dest);
- TerminatorDone = true;
- }
- }
-
- if (!TerminatorDone) {
- Instruction *NewInst = OldTI->clone();
- if (OldTI->hasName())
- NewInst->setName(OldTI->getName()+NameSuffix);
- NewBB->getInstList().push_back(NewInst);
- ValueMap[OldTI] = NewInst; // Add instruction map to value.
-
- // Recursively clone any reachable successor blocks.
- const TerminatorInst *TI = BB->getTerminator();
- for (unsigned i = 0, e = TI->getNumSuccessors(); i != e; ++i)
- ToClone.push_back(TI->getSuccessor(i));
- }
-
- if (CodeInfo) {
- CodeInfo->ContainsCalls |= hasCalls;
- CodeInfo->ContainsUnwinds |= isa<UnwindInst>(OldTI);
- CodeInfo->ContainsDynamicAllocas |= hasDynamicAllocas;
- CodeInfo->ContainsDynamicAllocas |= hasStaticAllocas &&
- BB != &BB->getParent()->front();
- }
-
- if (ReturnInst *RI = dyn_cast<ReturnInst>(NewBB->getTerminator()))
- Returns.push_back(RI);
-}
-
-/// ConstantFoldMappedInstruction - Constant fold the specified instruction,
-/// mapping its operands through ValueMap if they are available.
-Constant *PruningFunctionCloner::
-ConstantFoldMappedInstruction(const Instruction *I) {
- SmallVector<Constant*, 8> Ops;
- for (unsigned i = 0, e = I->getNumOperands(); i != e; ++i)
- if (Constant *Op = dyn_cast_or_null<Constant>(MapValue(I->getOperand(i),
- ValueMap)))
- Ops.push_back(Op);
- else
- return 0; // All operands not constant!
-
- if (const CmpInst *CI = dyn_cast<CmpInst>(I))
- return ConstantFoldCompareInstOperands(CI->getPredicate(),
- &Ops[0], Ops.size(), TD);
-
- if (const LoadInst *LI = dyn_cast<LoadInst>(I))
- if (ConstantExpr *CE = dyn_cast<ConstantExpr>(Ops[0]))
- if (!LI->isVolatile() && CE->getOpcode() == Instruction::GetElementPtr)
- if (GlobalVariable *GV = dyn_cast<GlobalVariable>(CE->getOperand(0)))
- if (GV->isConstant() && !GV->isDeclaration())
- return ConstantFoldLoadThroughGEPConstantExpr(GV->getInitializer(),
- CE);
-
- return ConstantFoldInstOperands(I->getOpcode(), I->getType(), &Ops[0],
- Ops.size(), TD);
-}
-
-/// CloneAndPruneFunctionInto - This works exactly like CloneFunctionInto,
-/// except that it does some simple constant prop and DCE on the fly. The
-/// effect of this is to copy significantly less code in cases where (for
-/// example) a function call with constant arguments is inlined, and those
-/// constant arguments cause a significant amount of code in the callee to be
-/// dead. Since this doesn't produce an exact copy of the input, it can't be
-/// used for things like CloneFunction or CloneModule.
-void llvm::CloneAndPruneFunctionInto(Function *NewFunc, const Function *OldFunc,
- DenseMap<const Value*, Value*> &ValueMap,
- std::vector<ReturnInst*> &Returns,
- const char *NameSuffix,
- ClonedCodeInfo *CodeInfo,
- const TargetData *TD) {
- assert(NameSuffix && "NameSuffix cannot be null!");
-
-#ifndef NDEBUG
- for (Function::const_arg_iterator II = OldFunc->arg_begin(),
- E = OldFunc->arg_end(); II != E; ++II)
- assert(ValueMap.count(II) && "No mapping from source argument specified!");
-#endif
-
- PruningFunctionCloner PFC(NewFunc, OldFunc, ValueMap, Returns,
- NameSuffix, CodeInfo, TD);
-
- // Clone the entry block, and anything recursively reachable from it.
- std::vector<const BasicBlock*> CloneWorklist;
- CloneWorklist.push_back(&OldFunc->getEntryBlock());
- while (!CloneWorklist.empty()) {
- const BasicBlock *BB = CloneWorklist.back();
- CloneWorklist.pop_back();
- PFC.CloneBlock(BB, CloneWorklist);
- }
-
- // Loop over all of the basic blocks in the old function. If the block was
- // reachable, we have cloned it and the old block is now in the value map:
- // insert it into the new function in the right order. If not, ignore it.
- //
- // Defer PHI resolution until rest of function is resolved.
- std::vector<const PHINode*> PHIToResolve;
- for (Function::const_iterator BI = OldFunc->begin(), BE = OldFunc->end();
- BI != BE; ++BI) {
- BasicBlock *NewBB = cast_or_null<BasicBlock>(ValueMap[BI]);
- if (NewBB == 0) continue; // Dead block.
-
- // Add the new block to the new function.
- NewFunc->getBasicBlockList().push_back(NewBB);
-
- // Loop over all of the instructions in the block, fixing up operand
- // references as we go. This uses ValueMap to do all the hard work.
- //
- BasicBlock::iterator I = NewBB->begin();
-
- // Handle PHI nodes specially, as we have to remove references to dead
- // blocks.
- if (PHINode *PN = dyn_cast<PHINode>(I)) {
- // Skip over all PHI nodes, remembering them for later.
- BasicBlock::const_iterator OldI = BI->begin();
- for (; (PN = dyn_cast<PHINode>(I)); ++I, ++OldI)
- PHIToResolve.push_back(cast<PHINode>(OldI));
- }
-
- // Otherwise, remap the rest of the instructions normally.
- for (; I != NewBB->end(); ++I)
- RemapInstruction(I, ValueMap);
- }
-
- // Defer PHI resolution until rest of function is resolved, PHI resolution
- // requires the CFG to be up-to-date.
- for (unsigned phino = 0, e = PHIToResolve.size(); phino != e; ) {
- const PHINode *OPN = PHIToResolve[phino];
- unsigned NumPreds = OPN->getNumIncomingValues();
- const BasicBlock *OldBB = OPN->getParent();
- BasicBlock *NewBB = cast<BasicBlock>(ValueMap[OldBB]);
-
- // Map operands for blocks that are live and remove operands for blocks
- // that are dead.
- for (; phino != PHIToResolve.size() &&
- PHIToResolve[phino]->getParent() == OldBB; ++phino) {
- OPN = PHIToResolve[phino];
- PHINode *PN = cast<PHINode>(ValueMap[OPN]);
- for (unsigned pred = 0, e = NumPreds; pred != e; ++pred) {
- if (BasicBlock *MappedBlock =
- cast_or_null<BasicBlock>(ValueMap[PN->getIncomingBlock(pred)])) {
- Value *InVal = MapValue(PN->getIncomingValue(pred), ValueMap);
- assert(InVal && "Unknown input value?");
- PN->setIncomingValue(pred, InVal);
- PN->setIncomingBlock(pred, MappedBlock);
- } else {
- PN->removeIncomingValue(pred, false);
- --pred, --e; // Revisit the next entry.
- }
- }
- }
-
- // The loop above has removed PHI entries for those blocks that are dead
- // and has updated others. However, if a block is live (i.e. copied over)
- // but its terminator has been changed to not go to this block, then our
- // phi nodes will have invalid entries. Update the PHI nodes in this
- // case.
- PHINode *PN = cast<PHINode>(NewBB->begin());
- NumPreds = std::distance(pred_begin(NewBB), pred_end(NewBB));
- if (NumPreds != PN->getNumIncomingValues()) {
- assert(NumPreds < PN->getNumIncomingValues());
- // Count how many times each predecessor comes to this block.
- std::map<BasicBlock*, unsigned> PredCount;
- for (pred_iterator PI = pred_begin(NewBB), E = pred_end(NewBB);
- PI != E; ++PI)
- --PredCount[*PI];
-
- // Figure out how many entries to remove from each PHI.
- for (unsigned i = 0, e = PN->getNumIncomingValues(); i != e; ++i)
- ++PredCount[PN->getIncomingBlock(i)];
-
- // At this point, the excess predecessor entries are positive in the
- // map. Loop over all of the PHIs and remove excess predecessor
- // entries.
- BasicBlock::iterator I = NewBB->begin();
- for (; (PN = dyn_cast<PHINode>(I)); ++I) {
- for (std::map<BasicBlock*, unsigned>::iterator PCI =PredCount.begin(),
- E = PredCount.end(); PCI != E; ++PCI) {
- BasicBlock *Pred = PCI->first;
- for (unsigned NumToRemove = PCI->second; NumToRemove; --NumToRemove)
- PN->removeIncomingValue(Pred, false);
- }
- }
- }
-
- // If the loops above have made these phi nodes have 0 or 1 operand,
- // replace them with undef or the input value. We must do this for
- // correctness, because 0-operand phis are not valid.
- PN = cast<PHINode>(NewBB->begin());
- if (PN->getNumIncomingValues() == 0) {
- BasicBlock::iterator I = NewBB->begin();
- BasicBlock::const_iterator OldI = OldBB->begin();
- while ((PN = dyn_cast<PHINode>(I++))) {
- Value *NV = UndefValue::get(PN->getType());
- PN->replaceAllUsesWith(NV);
- assert(ValueMap[OldI] == PN && "ValueMap mismatch");
- ValueMap[OldI] = NV;
- PN->eraseFromParent();
- ++OldI;
- }
- }
- // NOTE: We cannot eliminate single entry phi nodes here, because of
- // ValueMap. Single entry phi nodes can have multiple ValueMap entries
- // pointing at them. Thus, deleting one would require scanning the ValueMap
- // to update any entries in it that would require that. This would be
- // really slow.
- }
-
- // Now that the inlined function body has been fully constructed, go through
- // and zap unconditional fall-through branches. This happen all the time when
- // specializing code: code specialization turns conditional branches into
- // uncond branches, and this code folds them.
- Function::iterator I = cast<BasicBlock>(ValueMap[&OldFunc->getEntryBlock()]);
- while (I != NewFunc->end()) {
- BranchInst *BI = dyn_cast<BranchInst>(I->getTerminator());
- if (!BI || BI->isConditional()) { ++I; continue; }
-
- // Note that we can't eliminate uncond branches if the destination has
- // single-entry PHI nodes. Eliminating the single-entry phi nodes would
- // require scanning the ValueMap to update any entries that point to the phi
- // node.
- BasicBlock *Dest = BI->getSuccessor(0);
- if (!Dest->getSinglePredecessor() || isa<PHINode>(Dest->begin())) {
- ++I; continue;
- }
-
- // We know all single-entry PHI nodes in the inlined function have been
- // removed, so we just need to splice the blocks.
- BI->eraseFromParent();
-
- // Move all the instructions in the succ to the pred.
- I->getInstList().splice(I->end(), Dest->getInstList());
-
- // Make all PHI nodes that referred to Dest now refer to I as their source.
- Dest->replaceAllUsesWith(I);
-
- // Remove the dest block.
- Dest->eraseFromParent();
-
- // Do not increment I, iteratively merge all things this block branches to.
- }
-}
diff --git a/release_23/lib/Transforms/Utils/CloneLoop.cpp b/release_23/lib/Transforms/Utils/CloneLoop.cpp
deleted file mode 100644
index d52d79598f05..000000000000
--- a/release_23/lib/Transforms/Utils/CloneLoop.cpp
+++ /dev/null
@@ -1,153 +0,0 @@
-//===- CloneLoop.cpp - Clone loop nest ------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the CloneLoop interface which makes a copy of a loop.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Transforms/Utils/Cloning.h"
-#include "llvm/BasicBlock.h"
-#include "llvm/Analysis/LoopPass.h"
-#include "llvm/Analysis/Dominators.h"
-#include "llvm/ADT/DenseMap.h"
-
-
-using namespace llvm;
-
-/// CloneDominatorInfo - Clone basicblock's dominator tree and, if available,
-/// dominance info. It is expected that basic block is already cloned.
-static void CloneDominatorInfo(BasicBlock *BB,
- DenseMap<const Value *, Value *> &ValueMap,
- DominatorTree *DT,
- DominanceFrontier *DF) {
-
- assert (DT && "DominatorTree is not available");
- DenseMap<const Value *, Value*>::iterator BI = ValueMap.find(BB);
- assert (BI != ValueMap.end() && "BasicBlock clone is missing");
- BasicBlock *NewBB = cast<BasicBlock>(BI->second);
-
- // NewBB already got dominator info.
- if (DT->getNode(NewBB))
- return;
-
- assert (DT->getNode(BB) && "BasicBlock does not have dominator info");
- // Entry block is not expected here. Infinite loops are not to cloned.
- assert (DT->getNode(BB)->getIDom() && "BasicBlock does not have immediate dominator");
- BasicBlock *BBDom = DT->getNode(BB)->getIDom()->getBlock();
-
- // NewBB's dominator is either BB's dominator or BB's dominator's clone.
- BasicBlock *NewBBDom = BBDom;
- DenseMap<const Value *, Value*>::iterator BBDomI = ValueMap.find(BBDom);
- if (BBDomI != ValueMap.end()) {
- NewBBDom = cast<BasicBlock>(BBDomI->second);
- if (!DT->getNode(NewBBDom))
- CloneDominatorInfo(BBDom, ValueMap, DT, DF);
- }
- DT->addNewBlock(NewBB, NewBBDom);
-
- // Copy cloned dominance frontiner set
- if (DF) {
- DominanceFrontier::DomSetType NewDFSet;
- DominanceFrontier::iterator DFI = DF->find(BB);
- if ( DFI != DF->end()) {
- DominanceFrontier::DomSetType S = DFI->second;
- for (DominanceFrontier::DomSetType::iterator I = S.begin(), E = S.end();
- I != E; ++I) {
- BasicBlock *DB = *I;
- DenseMap<const Value*, Value*>::iterator IDM = ValueMap.find(DB);
- if (IDM != ValueMap.end())
- NewDFSet.insert(cast<BasicBlock>(IDM->second));
- else
- NewDFSet.insert(DB);
- }
- }
- DF->addBasicBlock(NewBB, NewDFSet);
- }
-}
-
-/// CloneLoop - Clone Loop. Clone dominator info. Populate ValueMap
-/// using old blocks to new blocks mapping.
-Loop *llvm::CloneLoop(Loop *OrigL, LPPassManager *LPM, LoopInfo *LI,
- DenseMap<const Value *, Value *> &ValueMap, Pass *P) {
-
- DominatorTree *DT = NULL;
- DominanceFrontier *DF = NULL;
- if (P) {
- DT = P->getAnalysisToUpdate<DominatorTree>();
- DF = P->getAnalysisToUpdate<DominanceFrontier>();
- }
-
- SmallVector<BasicBlock *, 16> NewBlocks;
-
- // Populate loop nest.
- SmallVector<Loop *, 8> LoopNest;
- LoopNest.push_back(OrigL);
-
-
- Loop *NewParentLoop = NULL;
- while (!LoopNest.empty()) {
- Loop *L = LoopNest.back();
- LoopNest.pop_back();
- Loop *NewLoop = new Loop();
-
- if (!NewParentLoop)
- NewParentLoop = NewLoop;
-
- LPM->insertLoop(NewLoop, L->getParentLoop());
-
- // Clone Basic Blocks.
- for (Loop::block_iterator I = L->block_begin(), E = L->block_end();
- I != E; ++I) {
- BasicBlock *BB = *I;
- BasicBlock *NewBB = CloneBasicBlock(BB, ValueMap, ".clone");
- ValueMap[BB] = NewBB;
- if (P)
- LPM->cloneBasicBlockSimpleAnalysis(BB, NewBB, L);
- NewLoop->addBasicBlockToLoop(NewBB, LI->getBase());
- NewBlocks.push_back(NewBB);
- }
-
- // Clone dominator info.
- if (DT)
- for (Loop::block_iterator I = L->block_begin(), E = L->block_end();
- I != E; ++I) {
- BasicBlock *BB = *I;
- CloneDominatorInfo(BB, ValueMap, DT, DF);
- }
-
- // Process sub loops
- for (Loop::iterator I = L->begin(), E = L->end(); I != E; ++I)
- LoopNest.push_back(*I);
- }
-
- // Remap instructions to reference operands from ValueMap.
- for(SmallVector<BasicBlock *, 16>::iterator NBItr = NewBlocks.begin(),
- NBE = NewBlocks.end(); NBItr != NBE; ++NBItr) {
- BasicBlock *NB = *NBItr;
- for(BasicBlock::iterator BI = NB->begin(), BE = NB->end();
- BI != BE; ++BI) {
- Instruction *Insn = BI;
- for (unsigned index = 0, num_ops = Insn->getNumOperands();
- index != num_ops; ++index) {
- Value *Op = Insn->getOperand(index);
- DenseMap<const Value *, Value *>::iterator OpItr = ValueMap.find(Op);
- if (OpItr != ValueMap.end())
- Insn->setOperand(index, OpItr->second);
- }
- }
- }
-
- BasicBlock *Latch = OrigL->getLoopLatch();
- Function *F = Latch->getParent();
- F->getBasicBlockList().insert(OrigL->getHeader(),
- NewBlocks.begin(), NewBlocks.end());
-
-
- return NewParentLoop;
-}
diff --git a/release_23/lib/Transforms/Utils/CloneModule.cpp b/release_23/lib/Transforms/Utils/CloneModule.cpp
deleted file mode 100644
index e75f915cb9ef..000000000000
--- a/release_23/lib/Transforms/Utils/CloneModule.cpp
+++ /dev/null
@@ -1,125 +0,0 @@
-//===- CloneModule.cpp - Clone an entire module ---------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the CloneModule interface which makes a copy of an
-// entire module.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Transforms/Utils/Cloning.h"
-#include "llvm/Module.h"
-#include "llvm/DerivedTypes.h"
-#include "llvm/TypeSymbolTable.h"
-#include "llvm/Constant.h"
-#include "llvm/Transforms/Utils/ValueMapper.h"
-using namespace llvm;
-
-/// CloneModule - Return an exact copy of the specified module. This is not as
-/// easy as it might seem because we have to worry about making copies of global
-/// variables and functions, and making their (initializers and references,
-/// respectively) refer to the right globals.
-///
-Module *llvm::CloneModule(const Module *M) {
- // Create the value map that maps things from the old module over to the new
- // module.
- DenseMap<const Value*, Value*> ValueMap;
- return CloneModule(M, ValueMap);
-}
-
-Module *llvm::CloneModule(const Module *M,
- DenseMap<const Value*, Value*> &ValueMap) {
- // First off, we need to create the new module...
- Module *New = new Module(M->getModuleIdentifier());
- New->setDataLayout(M->getDataLayout());
- New->setTargetTriple(M->getTargetTriple());
- New->setModuleInlineAsm(M->getModuleInlineAsm());
-
- // Copy all of the type symbol table entries over.
- const TypeSymbolTable &TST = M->getTypeSymbolTable();
- for (TypeSymbolTable::const_iterator TI = TST.begin(), TE = TST.end();
- TI != TE; ++TI)
- New->addTypeName(TI->first, TI->second);
-
- // Copy all of the dependent libraries over.
- for (Module::lib_iterator I = M->lib_begin(), E = M->lib_end(); I != E; ++I)
- New->addLibrary(*I);
-
- // Loop over all of the global variables, making corresponding globals in the
- // new module. Here we add them to the ValueMap and to the new Module. We
- // don't worry about attributes or initializers, they will come later.
- //
- for (Module::const_global_iterator I = M->global_begin(), E = M->global_end();
- I != E; ++I)
- ValueMap[I] = new GlobalVariable(I->getType()->getElementType(), false,
- GlobalValue::ExternalLinkage, 0,
- I->getName(), New);
-
- // Loop over the functions in the module, making external functions as before
- for (Module::const_iterator I = M->begin(), E = M->end(); I != E; ++I) {
- Function *NF =
- Function::Create(cast<FunctionType>(I->getType()->getElementType()),
- GlobalValue::ExternalLinkage, I->getName(), New);
- NF->setCallingConv(I->getCallingConv());
- NF->setParamAttrs(I->getParamAttrs());
- if (I->hasCollector())
- NF->setCollector(I->getCollector());
- ValueMap[I]= NF;
- }
-
- // Loop over the aliases in the module
- for (Module::const_alias_iterator I = M->alias_begin(), E = M->alias_end();
- I != E; ++I)
- ValueMap[I] = new GlobalAlias(I->getType(), GlobalAlias::ExternalLinkage,
- I->getName(), NULL, New);
-
- // Now that all of the things that global variable initializer can refer to
- // have been created, loop through and copy the global variable referrers
- // over... We also set the attributes on the global now.
- //
- for (Module::const_global_iterator I = M->global_begin(), E = M->global_end();
- I != E; ++I) {
- GlobalVariable *GV = cast<GlobalVariable>(ValueMap[I]);
- if (I->hasInitializer())
- GV->setInitializer(cast<Constant>(MapValue(I->getInitializer(),
- ValueMap)));
- GV->setLinkage(I->getLinkage());
- GV->setThreadLocal(I->isThreadLocal());
- GV->setConstant(I->isConstant());
- }
-
- // Similarly, copy over function bodies now...
- //
- for (Module::const_iterator I = M->begin(), E = M->end(); I != E; ++I) {
- Function *F = cast<Function>(ValueMap[I]);
- if (!I->isDeclaration()) {
- Function::arg_iterator DestI = F->arg_begin();
- for (Function::const_arg_iterator J = I->arg_begin(); J != I->arg_end();
- ++J) {
- DestI->setName(J->getName());
- ValueMap[J] = DestI++;
- }
-
- std::vector<ReturnInst*> Returns; // Ignore returns cloned...
- CloneFunctionInto(F, I, ValueMap, Returns);
- }
-
- F->setLinkage(I->getLinkage());
- }
-
- // And aliases
- for (Module::const_alias_iterator I = M->alias_begin(), E = M->alias_end();
- I != E; ++I) {
- GlobalAlias *GA = cast<GlobalAlias>(ValueMap[I]);
- GA->setLinkage(I->getLinkage());
- if (const Constant* C = I->getAliasee())
- GA->setAliasee(cast<Constant>(MapValue(C, ValueMap)));
- }
-
- return New;
-}
diff --git a/release_23/lib/Transforms/Utils/CloneTrace.cpp b/release_23/lib/Transforms/Utils/CloneTrace.cpp
deleted file mode 100644
index 07111393e275..000000000000
--- a/release_23/lib/Transforms/Utils/CloneTrace.cpp
+++ /dev/null
@@ -1,119 +0,0 @@
-//===- CloneTrace.cpp - Clone a trace -------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the CloneTrace interface, which is used when writing
-// runtime optimizations. It takes a vector of basic blocks clones the basic
-// blocks, removes internal phi nodes, adds it to the same function as the
-// original (although there is no jump to it) and returns the new vector of
-// basic blocks.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Analysis/Trace.h"
-#include "llvm/Transforms/Utils/Cloning.h"
-#include "llvm/Instructions.h"
-#include "llvm/Function.h"
-#include "llvm/Transforms/Utils/ValueMapper.h"
-using namespace llvm;
-
-//Clones the trace (a vector of basic blocks)
-std::vector<BasicBlock *>
-llvm::CloneTrace(const std::vector<BasicBlock*> &origTrace) {
- std::vector<BasicBlock *> clonedTrace;
- DenseMap<const Value*, Value*> ValueMap;
-
- //First, loop over all the Basic Blocks in the trace and copy
- //them using CloneBasicBlock. Also fix the phi nodes during
- //this loop. To fix the phi nodes, we delete incoming branches
- //that are not in the trace.
- for (std::vector<BasicBlock *>::const_iterator T = origTrace.begin(),
- End = origTrace.end(); T != End; ++T) {
-
- //Clone Basic Block
- BasicBlock *clonedBlock =
- CloneBasicBlock(*T, ValueMap, ".tr", (*T)->getParent());
-
- //Add it to our new trace
- clonedTrace.push_back(clonedBlock);
-
- //Add this new mapping to our Value Map
- ValueMap[*T] = clonedBlock;
-
- //Loop over the phi instructions and delete operands
- //that are from blocks not in the trace
- //only do this if we are NOT the first block
- if (T != origTrace.begin()) {
- for (BasicBlock::iterator I = clonedBlock->begin();
- isa<PHINode>(I); ++I) {
- PHINode *PN = cast<PHINode>(I);
- //get incoming value for the previous BB
- Value *V = PN->getIncomingValueForBlock(*(T-1));
- assert(V && "No incoming value from a BasicBlock in our trace!");
-
- //remap our phi node to point to incoming value
- ValueMap[*&I] = V;
-
- //remove phi node
- clonedBlock->getInstList().erase(PN);
- }
- }
- }
-
- //Second loop to do the remapping
- for (std::vector<BasicBlock *>::const_iterator BB = clonedTrace.begin(),
- BE = clonedTrace.end(); BB != BE; ++BB) {
- for (BasicBlock::iterator I = (*BB)->begin(); I != (*BB)->end(); ++I) {
- //Loop over all the operands of the instruction
- for (unsigned op=0, E = I->getNumOperands(); op != E; ++op) {
- const Value *Op = I->getOperand(op);
-
- //Get it out of the value map
- Value *V = ValueMap[Op];
-
- //If not in the value map, then its outside our trace so ignore
- if (V != 0)
- I->setOperand(op,V);
- }
- }
- }
-
- //return new vector of basic blocks
- return clonedTrace;
-}
-
-/// CloneTraceInto - Clone T into NewFunc. Original<->clone mapping is
-/// saved in ValueMap.
-///
-void llvm::CloneTraceInto(Function *NewFunc, Trace &T,
- DenseMap<const Value*, Value*> &ValueMap,
- const char *NameSuffix) {
- assert(NameSuffix && "NameSuffix cannot be null!");
-
- // Loop over all of the basic blocks in the trace, cloning them as
- // appropriate.
- //
- for (Trace::const_iterator BI = T.begin(), BE = T.end(); BI != BE; ++BI) {
- const BasicBlock *BB = *BI;
-
- // Create a new basic block and copy instructions into it!
- BasicBlock *CBB = CloneBasicBlock(BB, ValueMap, NameSuffix, NewFunc);
- ValueMap[BB] = CBB; // Add basic block mapping.
- }
-
- // Loop over all of the instructions in the new function, fixing up operand
- // references as we go. This uses ValueMap to do all the hard work.
- //
- for (Function::iterator BB =
- cast<BasicBlock>(ValueMap[T.getEntryBasicBlock()]),
- BE = NewFunc->end(); BB != BE; ++BB)
- // Loop over all instructions, fixing each one as we find it...
- for (BasicBlock::iterator II = BB->begin(); II != BB->end(); ++II)
- RemapInstruction(II, ValueMap);
-}
-
diff --git a/release_23/lib/Transforms/Utils/CodeExtractor.cpp b/release_23/lib/Transforms/Utils/CodeExtractor.cpp
deleted file mode 100644
index 54341196fb58..000000000000
--- a/release_23/lib/Transforms/Utils/CodeExtractor.cpp
+++ /dev/null
@@ -1,742 +0,0 @@
-//===- CodeExtractor.cpp - Pull code region into a new function -----------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the interface to tear out a code region, such as an
-// individual loop or a parallel section, into a new function, replacing it with
-// a call to the new function.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Transforms/Utils/FunctionUtils.h"
-#include "llvm/Constants.h"
-#include "llvm/DerivedTypes.h"
-#include "llvm/Instructions.h"
-#include "llvm/Intrinsics.h"
-#include "llvm/Module.h"
-#include "llvm/Pass.h"
-#include "llvm/Analysis/Dominators.h"
-#include "llvm/Analysis/LoopInfo.h"
-#include "llvm/Analysis/Verifier.h"
-#include "llvm/Transforms/Utils/BasicBlockUtils.h"
-#include "llvm/Support/CommandLine.h"
-#include "llvm/Support/Compiler.h"
-#include "llvm/Support/Debug.h"
-#include "llvm/ADT/StringExtras.h"
-#include <algorithm>
-#include <set>
-using namespace llvm;
-
-// Provide a command-line option to aggregate function arguments into a struct
-// for functions produced by the code extrator. This is useful when converting
-// extracted functions to pthread-based code, as only one argument (void*) can
-// be passed in to pthread_create().
-static cl::opt<bool>
-AggregateArgsOpt("aggregate-extracted-args", cl::Hidden,
- cl::desc("Aggregate arguments to code-extracted functions"));
-
-namespace {
- class VISIBILITY_HIDDEN CodeExtractor {
- typedef std::vector<Value*> Values;
- std::set<BasicBlock*> BlocksToExtract;
- DominatorTree* DT;
- bool AggregateArgs;
- unsigned NumExitBlocks;
- const Type *RetTy;
- public:
- CodeExtractor(DominatorTree* dt = 0, bool AggArgs = false)
- : DT(dt), AggregateArgs(AggArgs||AggregateArgsOpt), NumExitBlocks(~0U) {}
-
- Function *ExtractCodeRegion(const std::vector<BasicBlock*> &code);
-
- bool isEligible(const std::vector<BasicBlock*> &code);
-
- private:
- /// definedInRegion - Return true if the specified value is defined in the
- /// extracted region.
- bool definedInRegion(Value *V) const {
- if (Instruction *I = dyn_cast<Instruction>(V))
- if (BlocksToExtract.count(I->getParent()))
- return true;
- return false;
- }
-
- /// definedInCaller - Return true if the specified value is defined in the
- /// function being code extracted, but not in the region being extracted.
- /// These values must be passed in as live-ins to the function.
- bool definedInCaller(Value *V) const {
- if (isa<Argument>(V)) return true;
- if (Instruction *I = dyn_cast<Instruction>(V))
- if (!BlocksToExtract.count(I->getParent()))
- return true;
- return false;
- }
-
- void severSplitPHINodes(BasicBlock *&Header);
- void splitReturnBlocks();
- void findInputsOutputs(Values &inputs, Values &outputs);
-
- Function *constructFunction(const Values &inputs,
- const Values &outputs,
- BasicBlock *header,
- BasicBlock *newRootNode, BasicBlock *newHeader,
- Function *oldFunction, Module *M);
-
- void moveCodeToFunction(Function *newFunction);
-
- void emitCallAndSwitchStatement(Function *newFunction,
- BasicBlock *newHeader,
- Values &inputs,
- Values &outputs);
-
- };
-}
-
-/// severSplitPHINodes - If a PHI node has multiple inputs from outside of the
-/// region, we need to split the entry block of the region so that the PHI node
-/// is easier to deal with.
-void CodeExtractor::severSplitPHINodes(BasicBlock *&Header) {
- bool HasPredsFromRegion = false;
- unsigned NumPredsOutsideRegion = 0;
-
- if (Header != &Header->getParent()->getEntryBlock()) {
- PHINode *PN = dyn_cast<PHINode>(Header->begin());
- if (!PN) return; // No PHI nodes.
-
- // If the header node contains any PHI nodes, check to see if there is more
- // than one entry from outside the region. If so, we need to sever the
- // header block into two.
- for (unsigned i = 0, e = PN->getNumIncomingValues(); i != e; ++i)
- if (BlocksToExtract.count(PN->getIncomingBlock(i)))
- HasPredsFromRegion = true;
- else
- ++NumPredsOutsideRegion;
-
- // If there is one (or fewer) predecessor from outside the region, we don't
- // need to do anything special.
- if (NumPredsOutsideRegion <= 1) return;
- }
-
- // Otherwise, we need to split the header block into two pieces: one
- // containing PHI nodes merging values from outside of the region, and a
- // second that contains all of the code for the block and merges back any
- // incoming values from inside of the region.
- BasicBlock::iterator AfterPHIs = Header->begin();
- while (isa<PHINode>(AfterPHIs)) ++AfterPHIs;
- BasicBlock *NewBB = Header->splitBasicBlock(AfterPHIs,
- Header->getName()+".ce");
-
- // We only want to code extract the second block now, and it becomes the new
- // header of the region.
- BasicBlock *OldPred = Header;
- BlocksToExtract.erase(OldPred);
- BlocksToExtract.insert(NewBB);
- Header = NewBB;
-
- // Okay, update dominator sets. The blocks that dominate the new one are the
- // blocks that dominate TIBB plus the new block itself.
- if (DT)
- DT->splitBlock(NewBB);
-
- // Okay, now we need to adjust the PHI nodes and any branches from within the
- // region to go to the new header block instead of the old header block.
- if (HasPredsFromRegion) {
- PHINode *PN = cast<PHINode>(OldPred->begin());
- // Loop over all of the predecessors of OldPred that are in the region,
- // changing them to branch to NewBB instead.
- for (unsigned i = 0, e = PN->getNumIncomingValues(); i != e; ++i)
- if (BlocksToExtract.count(PN->getIncomingBlock(i))) {
- TerminatorInst *TI = PN->getIncomingBlock(i)->getTerminator();
- TI->replaceUsesOfWith(OldPred, NewBB);
- }
-
- // Okay, everthing within the region is now branching to the right block, we
- // just have to update the PHI nodes now, inserting PHI nodes into NewBB.
- for (AfterPHIs = OldPred->begin(); isa<PHINode>(AfterPHIs); ++AfterPHIs) {
- PHINode *PN = cast<PHINode>(AfterPHIs);
- // Create a new PHI node in the new region, which has an incoming value
- // from OldPred of PN.
- PHINode *NewPN = PHINode::Create(PN->getType(), PN->getName()+".ce",
- NewBB->begin());
- NewPN->addIncoming(PN, OldPred);
-
- // Loop over all of the incoming value in PN, moving them to NewPN if they
- // are from the extracted region.
- for (unsigned i = 0; i != PN->getNumIncomingValues(); ++i) {
- if (BlocksToExtract.count(PN->getIncomingBlock(i))) {
- NewPN->addIncoming(PN->getIncomingValue(i), PN->getIncomingBlock(i));
- PN->removeIncomingValue(i);
- --i;
- }
- }
- }
- }
-}
-
-void CodeExtractor::splitReturnBlocks() {
- for (std::set<BasicBlock*>::iterator I = BlocksToExtract.begin(),
- E = BlocksToExtract.end(); I != E; ++I)
- if (ReturnInst *RI = dyn_cast<ReturnInst>((*I)->getTerminator()))
- (*I)->splitBasicBlock(RI, (*I)->getName()+".ret");
-}
-
-// findInputsOutputs - Find inputs to, outputs from the code region.
-//
-void CodeExtractor::findInputsOutputs(Values &inputs, Values &outputs) {
- std::set<BasicBlock*> ExitBlocks;
- for (std::set<BasicBlock*>::const_iterator ci = BlocksToExtract.begin(),
- ce = BlocksToExtract.end(); ci != ce; ++ci) {
- BasicBlock *BB = *ci;
-
- for (BasicBlock::iterator I = BB->begin(), E = BB->end(); I != E; ++I) {
- // If a used value is defined outside the region, it's an input. If an
- // instruction is used outside the region, it's an output.
- for (User::op_iterator O = I->op_begin(), E = I->op_end(); O != E; ++O)
- if (definedInCaller(*O))
- inputs.push_back(*O);
-
- // Consider uses of this instruction (outputs).
- for (Value::use_iterator UI = I->use_begin(), E = I->use_end();
- UI != E; ++UI)
- if (!definedInRegion(*UI)) {
- outputs.push_back(I);
- break;
- }
- } // for: insts
-
- // Keep track of the exit blocks from the region.
- TerminatorInst *TI = BB->getTerminator();
- for (unsigned i = 0, e = TI->getNumSuccessors(); i != e; ++i)
- if (!BlocksToExtract.count(TI->getSuccessor(i)))
- ExitBlocks.insert(TI->getSuccessor(i));
- } // for: basic blocks
-
- NumExitBlocks = ExitBlocks.size();
-
- // Eliminate duplicates.
- std::sort(inputs.begin(), inputs.end());
- inputs.erase(std::unique(inputs.begin(), inputs.end()), inputs.end());
- std::sort(outputs.begin(), outputs.end());
- outputs.erase(std::unique(outputs.begin(), outputs.end()), outputs.end());
-}
-
-/// constructFunction - make a function based on inputs and outputs, as follows:
-/// f(in0, ..., inN, out0, ..., outN)
-///
-Function *CodeExtractor::constructFunction(const Values &inputs,
- const Values &outputs,
- BasicBlock *header,
- BasicBlock *newRootNode,
- BasicBlock *newHeader,
- Function *oldFunction,
- Module *M) {
- DOUT << "inputs: " << inputs.size() << "\n";
- DOUT << "outputs: " << outputs.size() << "\n";
-
- // This function returns unsigned, outputs will go back by reference.
- switch (NumExitBlocks) {
- case 0:
- case 1: RetTy = Type::VoidTy; break;
- case 2: RetTy = Type::Int1Ty; break;
- default: RetTy = Type::Int16Ty; break;
- }
-
- std::vector<const Type*> paramTy;
-
- // Add the types of the input values to the function's argument list
- for (Values::const_iterator i = inputs.begin(),
- e = inputs.end(); i != e; ++i) {
- const Value *value = *i;
- DOUT << "value used in func: " << *value << "\n";
- paramTy.push_back(value->getType());
- }
-
- // Add the types of the output values to the function's argument list.
- for (Values::const_iterator I = outputs.begin(), E = outputs.end();
- I != E; ++I) {
- DOUT << "instr used in func: " << **I << "\n";
- if (AggregateArgs)
- paramTy.push_back((*I)->getType());
- else
- paramTy.push_back(PointerType::getUnqual((*I)->getType()));
- }
-
- DOUT << "Function type: " << *RetTy << " f(";
- for (std::vector<const Type*>::iterator i = paramTy.begin(),
- e = paramTy.end(); i != e; ++i)
- DOUT << **i << ", ";
- DOUT << ")\n";
-
- if (AggregateArgs && (inputs.size() + outputs.size() > 0)) {
- PointerType *StructPtr = PointerType::getUnqual(StructType::get(paramTy));
- paramTy.clear();
- paramTy.push_back(StructPtr);
- }
- const FunctionType *funcType = FunctionType::get(RetTy, paramTy, false);
-
- // Create the new function
- Function *newFunction = Function::Create(funcType,
- GlobalValue::InternalLinkage,
- oldFunction->getName() + "_" +
- header->getName(), M);
- newFunction->getBasicBlockList().push_back(newRootNode);
-
- // Create an iterator to name all of the arguments we inserted.
- Function::arg_iterator AI = newFunction->arg_begin();
-
- // Rewrite all users of the inputs in the extracted region to use the
- // arguments (or appropriate addressing into struct) instead.
- for (unsigned i = 0, e = inputs.size(); i != e; ++i) {
- Value *RewriteVal;
- if (AggregateArgs) {
- Value *Idx[2];
- Idx[0] = Constant::getNullValue(Type::Int32Ty);
- Idx[1] = ConstantInt::get(Type::Int32Ty, i);
- std::string GEPname = "gep_" + inputs[i]->getName();
- TerminatorInst *TI = newFunction->begin()->getTerminator();
- GetElementPtrInst *GEP = GetElementPtrInst::Create(AI, Idx, Idx+2,
- GEPname, TI);
- RewriteVal = new LoadInst(GEP, "load" + GEPname, TI);
- } else
- RewriteVal = AI++;
-
- std::vector<User*> Users(inputs[i]->use_begin(), inputs[i]->use_end());
- for (std::vector<User*>::iterator use = Users.begin(), useE = Users.end();
- use != useE; ++use)
- if (Instruction* inst = dyn_cast<Instruction>(*use))
- if (BlocksToExtract.count(inst->getParent()))
- inst->replaceUsesOfWith(inputs[i], RewriteVal);
- }
-
- // Set names for input and output arguments.
- if (!AggregateArgs) {
- AI = newFunction->arg_begin();
- for (unsigned i = 0, e = inputs.size(); i != e; ++i, ++AI)
- AI->setName(inputs[i]->getName());
- for (unsigned i = 0, e = outputs.size(); i != e; ++i, ++AI)
- AI->setName(outputs[i]->getName()+".out");
- }
-
- // Rewrite branches to basic blocks outside of the loop to new dummy blocks
- // within the new function. This must be done before we lose track of which
- // blocks were originally in the code region.
- std::vector<User*> Users(header->use_begin(), header->use_end());
- for (unsigned i = 0, e = Users.size(); i != e; ++i)
- // The BasicBlock which contains the branch is not in the region
- // modify the branch target to a new block
- if (TerminatorInst *TI = dyn_cast<TerminatorInst>(Users[i]))
- if (!BlocksToExtract.count(TI->getParent()) &&
- TI->getParent()->getParent() == oldFunction)
- TI->replaceUsesOfWith(header, newHeader);
-
- return newFunction;
-}
-
-/// emitCallAndSwitchStatement - This method sets up the caller side by adding
-/// the call instruction, splitting any PHI nodes in the header block as
-/// necessary.
-void CodeExtractor::
-emitCallAndSwitchStatement(Function *newFunction, BasicBlock *codeReplacer,
- Values &inputs, Values &outputs) {
- // Emit a call to the new function, passing in: *pointer to struct (if
- // aggregating parameters), or plan inputs and allocated memory for outputs
- std::vector<Value*> params, StructValues, ReloadOutputs;
-
- // Add inputs as params, or to be filled into the struct
- for (Values::iterator i = inputs.begin(), e = inputs.end(); i != e; ++i)
- if (AggregateArgs)
- StructValues.push_back(*i);
- else
- params.push_back(*i);
-
- // Create allocas for the outputs
- for (Values::iterator i = outputs.begin(), e = outputs.end(); i != e; ++i) {
- if (AggregateArgs) {
- StructValues.push_back(*i);
- } else {
- AllocaInst *alloca =
- new AllocaInst((*i)->getType(), 0, (*i)->getName()+".loc",
- codeReplacer->getParent()->begin()->begin());
- ReloadOutputs.push_back(alloca);
- params.push_back(alloca);
- }
- }
-
- AllocaInst *Struct = 0;
- if (AggregateArgs && (inputs.size() + outputs.size() > 0)) {
- std::vector<const Type*> ArgTypes;
- for (Values::iterator v = StructValues.begin(),
- ve = StructValues.end(); v != ve; ++v)
- ArgTypes.push_back((*v)->getType());
-
- // Allocate a struct at the beginning of this function
- Type *StructArgTy = StructType::get(ArgTypes);
- Struct =
- new AllocaInst(StructArgTy, 0, "structArg",
- codeReplacer->getParent()->begin()->begin());
- params.push_back(Struct);
-
- for (unsigned i = 0, e = inputs.size(); i != e; ++i) {
- Value *Idx[2];
- Idx[0] = Constant::getNullValue(Type::Int32Ty);
- Idx[1] = ConstantInt::get(Type::Int32Ty, i);
- GetElementPtrInst *GEP =
- GetElementPtrInst::Create(Struct, Idx, Idx + 2,
- "gep_" + StructValues[i]->getName());
- codeReplacer->getInstList().push_back(GEP);
- StoreInst *SI = new StoreInst(StructValues[i], GEP);
- codeReplacer->getInstList().push_back(SI);
- }
- }
-
- // Emit the call to the function
- CallInst *call = CallInst::Create(newFunction, params.begin(), params.end(),
- NumExitBlocks > 1 ? "targetBlock" : "");
- codeReplacer->getInstList().push_back(call);
-
- Function::arg_iterator OutputArgBegin = newFunction->arg_begin();
- unsigned FirstOut = inputs.size();
- if (!AggregateArgs)
- std::advance(OutputArgBegin, inputs.size());
-
- // Reload the outputs passed in by reference
- for (unsigned i = 0, e = outputs.size(); i != e; ++i) {
- Value *Output = 0;
- if (AggregateArgs) {
- Value *Idx[2];
- Idx[0] = Constant::getNullValue(Type::Int32Ty);
- Idx[1] = ConstantInt::get(Type::Int32Ty, FirstOut + i);
- GetElementPtrInst *GEP
- = GetElementPtrInst::Create(Struct, Idx, Idx + 2,
- "gep_reload_" + outputs[i]->getName());
- codeReplacer->getInstList().push_back(GEP);
- Output = GEP;
- } else {
- Output = ReloadOutputs[i];
- }
- LoadInst *load = new LoadInst(Output, outputs[i]->getName()+".reload");
- codeReplacer->getInstList().push_back(load);
- std::vector<User*> Users(outputs[i]->use_begin(), outputs[i]->use_end());
- for (unsigned u = 0, e = Users.size(); u != e; ++u) {
- Instruction *inst = cast<Instruction>(Users[u]);
- if (!BlocksToExtract.count(inst->getParent()))
- inst->replaceUsesOfWith(outputs[i], load);
- }
- }
-
- // Now we can emit a switch statement using the call as a value.
- SwitchInst *TheSwitch =
- SwitchInst::Create(ConstantInt::getNullValue(Type::Int16Ty),
- codeReplacer, 0, codeReplacer);
-
- // Since there may be multiple exits from the original region, make the new
- // function return an unsigned, switch on that number. This loop iterates
- // over all of the blocks in the extracted region, updating any terminator
- // instructions in the to-be-extracted region that branch to blocks that are
- // not in the region to be extracted.
- std::map<BasicBlock*, BasicBlock*> ExitBlockMap;
-
- unsigned switchVal = 0;
- for (std::set<BasicBlock*>::const_iterator i = BlocksToExtract.begin(),
- e = BlocksToExtract.end(); i != e; ++i) {
- TerminatorInst *TI = (*i)->getTerminator();
- for (unsigned i = 0, e = TI->getNumSuccessors(); i != e; ++i)
- if (!BlocksToExtract.count(TI->getSuccessor(i))) {
- BasicBlock *OldTarget = TI->getSuccessor(i);
- // add a new basic block which returns the appropriate value
- BasicBlock *&NewTarget = ExitBlockMap[OldTarget];
- if (!NewTarget) {
- // If we don't already have an exit stub for this non-extracted
- // destination, create one now!
- NewTarget = BasicBlock::Create(OldTarget->getName() + ".exitStub",
- newFunction);
- unsigned SuccNum = switchVal++;
-
- Value *brVal = 0;
- switch (NumExitBlocks) {
- case 0:
- case 1: break; // No value needed.
- case 2: // Conditional branch, return a bool
- brVal = ConstantInt::get(Type::Int1Ty, !SuccNum);
- break;
- default:
- brVal = ConstantInt::get(Type::Int16Ty, SuccNum);
- break;
- }
-
- ReturnInst *NTRet = ReturnInst::Create(brVal, NewTarget);
-
- // Update the switch instruction.
- TheSwitch->addCase(ConstantInt::get(Type::Int16Ty, SuccNum),
- OldTarget);
-
- // Restore values just before we exit
- Function::arg_iterator OAI = OutputArgBegin;
- for (unsigned out = 0, e = outputs.size(); out != e; ++out) {
- // For an invoke, the normal destination is the only one that is
- // dominated by the result of the invocation
- BasicBlock *DefBlock = cast<Instruction>(outputs[out])->getParent();
-
- bool DominatesDef = true;
-
- if (InvokeInst *Invoke = dyn_cast<InvokeInst>(outputs[out])) {
- DefBlock = Invoke->getNormalDest();
-
- // Make sure we are looking at the original successor block, not
- // at a newly inserted exit block, which won't be in the dominator
- // info.
- for (std::map<BasicBlock*, BasicBlock*>::iterator I =
- ExitBlockMap.begin(), E = ExitBlockMap.end(); I != E; ++I)
- if (DefBlock == I->second) {
- DefBlock = I->first;
- break;
- }
-
- // In the extract block case, if the block we are extracting ends
- // with an invoke instruction, make sure that we don't emit a
- // store of the invoke value for the unwind block.
- if (!DT && DefBlock != OldTarget)
- DominatesDef = false;
- }
-
- if (DT)
- DominatesDef = DT->dominates(DefBlock, OldTarget);
-
- if (DominatesDef) {
- if (AggregateArgs) {
- Value *Idx[2];
- Idx[0] = Constant::getNullValue(Type::Int32Ty);
- Idx[1] = ConstantInt::get(Type::Int32Ty,FirstOut+out);
- GetElementPtrInst *GEP =
- GetElementPtrInst::Create(OAI, Idx, Idx + 2,
- "gep_" + outputs[out]->getName(),
- NTRet);
- new StoreInst(outputs[out], GEP, NTRet);
- } else {
- new StoreInst(outputs[out], OAI, NTRet);
- }
- }
- // Advance output iterator even if we don't emit a store
- if (!AggregateArgs) ++OAI;
- }
- }
-
- // rewrite the original branch instruction with this new target
- TI->setSuccessor(i, NewTarget);
- }
- }
-
- // Now that we've done the deed, simplify the switch instruction.
- const Type *OldFnRetTy = TheSwitch->getParent()->getParent()->getReturnType();
- switch (NumExitBlocks) {
- case 0:
- // There are no successors (the block containing the switch itself), which
- // means that previously this was the last part of the function, and hence
- // this should be rewritten as a `ret'
-
- // Check if the function should return a value
- if (OldFnRetTy == Type::VoidTy) {
- ReturnInst::Create(0, TheSwitch); // Return void
- } else if (OldFnRetTy == TheSwitch->getCondition()->getType()) {
- // return what we have
- ReturnInst::Create(TheSwitch->getCondition(), TheSwitch);
- } else {
- // Otherwise we must have code extracted an unwind or something, just
- // return whatever we want.
- ReturnInst::Create(Constant::getNullValue(OldFnRetTy), TheSwitch);
- }
-
- TheSwitch->getParent()->getInstList().erase(TheSwitch);
- break;
- case 1:
- // Only a single destination, change the switch into an unconditional
- // branch.
- BranchInst::Create(TheSwitch->getSuccessor(1), TheSwitch);
- TheSwitch->getParent()->getInstList().erase(TheSwitch);
- break;
- case 2:
- BranchInst::Create(TheSwitch->getSuccessor(1), TheSwitch->getSuccessor(2),
- call, TheSwitch);
- TheSwitch->getParent()->getInstList().erase(TheSwitch);
- break;
- default:
- // Otherwise, make the default destination of the switch instruction be one
- // of the other successors.
- TheSwitch->setOperand(0, call);
- TheSwitch->setSuccessor(0, TheSwitch->getSuccessor(NumExitBlocks));
- TheSwitch->removeCase(NumExitBlocks); // Remove redundant case
- break;
- }
-}
-
-void CodeExtractor::moveCodeToFunction(Function *newFunction) {
- Function *oldFunc = (*BlocksToExtract.begin())->getParent();
- Function::BasicBlockListType &oldBlocks = oldFunc->getBasicBlockList();
- Function::BasicBlockListType &newBlocks = newFunction->getBasicBlockList();
-
- for (std::set<BasicBlock*>::const_iterator i = BlocksToExtract.begin(),
- e = BlocksToExtract.end(); i != e; ++i) {
- // Delete the basic block from the old function, and the list of blocks
- oldBlocks.remove(*i);
-
- // Insert this basic block into the new function
- newBlocks.push_back(*i);
- }
-}
-
-/// ExtractRegion - Removes a loop from a function, replaces it with a call to
-/// new function. Returns pointer to the new function.
-///
-/// algorithm:
-///
-/// find inputs and outputs for the region
-///
-/// for inputs: add to function as args, map input instr* to arg#
-/// for outputs: add allocas for scalars,
-/// add to func as args, map output instr* to arg#
-///
-/// rewrite func to use argument #s instead of instr*
-///
-/// for each scalar output in the function: at every exit, store intermediate
-/// computed result back into memory.
-///
-Function *CodeExtractor::
-ExtractCodeRegion(const std::vector<BasicBlock*> &code) {
- if (!isEligible(code))
- return 0;
-
- // 1) Find inputs, outputs
- // 2) Construct new function
- // * Add allocas for defs, pass as args by reference
- // * Pass in uses as args
- // 3) Move code region, add call instr to func
- //
- BlocksToExtract.insert(code.begin(), code.end());
-
- Values inputs, outputs;
-
- // Assumption: this is a single-entry code region, and the header is the first
- // block in the region.
- BasicBlock *header = code[0];
-
- for (unsigned i = 1, e = code.size(); i != e; ++i)
- for (pred_iterator PI = pred_begin(code[i]), E = pred_end(code[i]);
- PI != E; ++PI)
- assert(BlocksToExtract.count(*PI) &&
- "No blocks in this region may have entries from outside the region"
- " except for the first block!");
-
- // If we have to split PHI nodes or the entry block, do so now.
- severSplitPHINodes(header);
-
- // If we have any return instructions in the region, split those blocks so
- // that the return is not in the region.
- splitReturnBlocks();
-
- Function *oldFunction = header->getParent();
-
- // This takes place of the original loop
- BasicBlock *codeReplacer = BasicBlock::Create("codeRepl", oldFunction, header);
-
- // The new function needs a root node because other nodes can branch to the
- // head of the region, but the entry node of a function cannot have preds.
- BasicBlock *newFuncRoot = BasicBlock::Create("newFuncRoot");
- newFuncRoot->getInstList().push_back(BranchInst::Create(header));
-
- // Find inputs to, outputs from the code region.
- findInputsOutputs(inputs, outputs);
-
- // Construct new function based on inputs/outputs & add allocas for all defs.
- Function *newFunction = constructFunction(inputs, outputs, header,
- newFuncRoot,
- codeReplacer, oldFunction,
- oldFunction->getParent());
-
- emitCallAndSwitchStatement(newFunction, codeReplacer, inputs, outputs);
-
- moveCodeToFunction(newFunction);
-
- // Loop over all of the PHI nodes in the header block, and change any
- // references to the old incoming edge to be the new incoming edge.
- for (BasicBlock::iterator I = header->begin(); isa<PHINode>(I); ++I) {
- PHINode *PN = cast<PHINode>(I);
- for (unsigned i = 0, e = PN->getNumIncomingValues(); i != e; ++i)
- if (!BlocksToExtract.count(PN->getIncomingBlock(i)))
- PN->setIncomingBlock(i, newFuncRoot);
- }
-
- // Look at all successors of the codeReplacer block. If any of these blocks
- // had PHI nodes in them, we need to update the "from" block to be the code
- // replacer, not the original block in the extracted region.
- std::vector<BasicBlock*> Succs(succ_begin(codeReplacer),
- succ_end(codeReplacer));
- for (unsigned i = 0, e = Succs.size(); i != e; ++i)
- for (BasicBlock::iterator I = Succs[i]->begin(); isa<PHINode>(I); ++I) {
- PHINode *PN = cast<PHINode>(I);
- std::set<BasicBlock*> ProcessedPreds;
- for (unsigned i = 0, e = PN->getNumIncomingValues(); i != e; ++i)
- if (BlocksToExtract.count(PN->getIncomingBlock(i))) {
- if (ProcessedPreds.insert(PN->getIncomingBlock(i)).second)
- PN->setIncomingBlock(i, codeReplacer);
- else {
- // There were multiple entries in the PHI for this block, now there
- // is only one, so remove the duplicated entries.
- PN->removeIncomingValue(i, false);
- --i; --e;
- }
- }
- }
-
- //cerr << "NEW FUNCTION: " << *newFunction;
- // verifyFunction(*newFunction);
-
- // cerr << "OLD FUNCTION: " << *oldFunction;
- // verifyFunction(*oldFunction);
-
- DEBUG(if (verifyFunction(*newFunction)) abort());
- return newFunction;
-}
-
-bool CodeExtractor::isEligible(const std::vector<BasicBlock*> &code) {
- // Deny code region if it contains allocas or vastarts.
- for (std::vector<BasicBlock*>::const_iterator BB = code.begin(), e=code.end();
- BB != e; ++BB)
- for (BasicBlock::const_iterator I = (*BB)->begin(), Ie = (*BB)->end();
- I != Ie; ++I)
- if (isa<AllocaInst>(*I))
- return false;
- else if (const CallInst *CI = dyn_cast<CallInst>(I))
- if (const Function *F = CI->getCalledFunction())
- if (F->getIntrinsicID() == Intrinsic::vastart)
- return false;
- return true;
-}
-
-
-/// ExtractCodeRegion - slurp a sequence of basic blocks into a brand new
-/// function
-///
-Function* llvm::ExtractCodeRegion(DominatorTree &DT,
- const std::vector<BasicBlock*> &code,
- bool AggregateArgs) {
- return CodeExtractor(&DT, AggregateArgs).ExtractCodeRegion(code);
-}
-
-/// ExtractBasicBlock - slurp a natural loop into a brand new function
-///
-Function* llvm::ExtractLoop(DominatorTree &DT, Loop *L, bool AggregateArgs) {
- return CodeExtractor(&DT, AggregateArgs).ExtractCodeRegion(L->getBlocks());
-}
-
-/// ExtractBasicBlock - slurp a basic block into a brand new function
-///
-Function* llvm::ExtractBasicBlock(BasicBlock *BB, bool AggregateArgs) {
- std::vector<BasicBlock*> Blocks;
- Blocks.push_back(BB);
- return CodeExtractor(0, AggregateArgs).ExtractCodeRegion(Blocks);
-}
diff --git a/release_23/lib/Transforms/Utils/DemoteRegToStack.cpp b/release_23/lib/Transforms/Utils/DemoteRegToStack.cpp
deleted file mode 100644
index bbe804fc5518..000000000000
--- a/release_23/lib/Transforms/Utils/DemoteRegToStack.cpp
+++ /dev/null
@@ -1,148 +0,0 @@
-//===- DemoteRegToStack.cpp - Move a virtual register to the stack --------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file provide the function DemoteRegToStack(). This function takes a
-// virtual register computed by an Instruction and replaces it with a slot in
-// the stack frame, allocated via alloca. It returns the pointer to the
-// AllocaInst inserted. After this function is called on an instruction, we are
-// guaranteed that the only user of the instruction is a store that is
-// immediately after it.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Transforms/Utils/Local.h"
-#include "llvm/Function.h"
-#include "llvm/Instructions.h"
-#include "llvm/Type.h"
-#include <map>
-using namespace llvm;
-
-/// DemoteRegToStack - This function takes a virtual register computed by an
-/// Instruction and replaces it with a slot in the stack frame, allocated via
-/// alloca. This allows the CFG to be changed around without fear of
-/// invalidating the SSA information for the value. It returns the pointer to
-/// the alloca inserted to create a stack slot for I.
-///
-AllocaInst* llvm::DemoteRegToStack(Instruction &I, bool VolatileLoads,
- Instruction *AllocaPoint) {
- if (I.use_empty()) {
- I.eraseFromParent();
- return 0;
- }
-
- // Create a stack slot to hold the value.
- AllocaInst *Slot;
- if (AllocaPoint) {
- Slot = new AllocaInst(I.getType(), 0, I.getName()+".reg2mem", AllocaPoint);
- } else {
- Function *F = I.getParent()->getParent();
- Slot = new AllocaInst(I.getType(), 0, I.getName()+".reg2mem",
- F->getEntryBlock().begin());
- }
-
- // Change all of the users of the instruction to read from the stack slot
- // instead.
- while (!I.use_empty()) {
- Instruction *U = cast<Instruction>(I.use_back());
- if (PHINode *PN = dyn_cast<PHINode>(U)) {
- // If this is a PHI node, we can't insert a load of the value before the
- // use. Instead, insert the load in the predecessor block corresponding
- // to the incoming value.
- //
- // Note that if there are multiple edges from a basic block to this PHI
- // node that we cannot multiple loads. The problem is that the resultant
- // PHI node will have multiple values (from each load) coming in from the
- // same block, which is illegal SSA form. For this reason, we keep track
- // and reuse loads we insert.
- std::map<BasicBlock*, Value*> Loads;
- for (unsigned i = 0, e = PN->getNumIncomingValues(); i != e; ++i)
- if (PN->getIncomingValue(i) == &I) {
- Value *&V = Loads[PN->getIncomingBlock(i)];
- if (V == 0) {
- // Insert the load into the predecessor block
- V = new LoadInst(Slot, I.getName()+".reload", VolatileLoads,
- PN->getIncomingBlock(i)->getTerminator());
- }
- PN->setIncomingValue(i, V);
- }
-
- } else {
- // If this is a normal instruction, just insert a load.
- Value *V = new LoadInst(Slot, I.getName()+".reload", VolatileLoads, U);
- U->replaceUsesOfWith(&I, V);
- }
- }
-
-
- // Insert stores of the computed value into the stack slot. We have to be
- // careful is I is an invoke instruction though, because we can't insert the
- // store AFTER the terminator instruction.
- BasicBlock::iterator InsertPt;
- if (!isa<TerminatorInst>(I)) {
- InsertPt = &I;
- ++InsertPt;
- } else {
- // We cannot demote invoke instructions to the stack if their normal edge
- // is critical.
- InvokeInst &II = cast<InvokeInst>(I);
- assert(II.getNormalDest()->getSinglePredecessor() &&
- "Cannot demote invoke with a critical successor!");
- InsertPt = II.getNormalDest()->begin();
- }
-
- for (; isa<PHINode>(InsertPt); ++InsertPt)
- /* empty */; // Don't insert before any PHI nodes.
- new StoreInst(&I, Slot, InsertPt);
-
- return Slot;
-}
-
-
-/// DemotePHIToStack - This function takes a virtual register computed by a phi
-/// node and replaces it with a slot in the stack frame, allocated via alloca.
-/// The phi node is deleted and it returns the pointer to the alloca inserted.
-AllocaInst* llvm::DemotePHIToStack(PHINode *P, Instruction *AllocaPoint) {
- if (P->use_empty()) {
- P->eraseFromParent();
- return 0;
- }
-
- // Create a stack slot to hold the value.
- AllocaInst *Slot;
- if (AllocaPoint) {
- Slot = new AllocaInst(P->getType(), 0, P->getName()+".reg2mem", AllocaPoint);
- } else {
- Function *F = P->getParent()->getParent();
- Slot = new AllocaInst(P->getType(), 0, P->getName()+".reg2mem",
- F->getEntryBlock().begin());
- }
-
- // Iterate over each operand, insert store in each predecessor.
- for (unsigned i = 0, e = P->getNumIncomingValues(); i < e; ++i) {
- if (InvokeInst *II = dyn_cast<InvokeInst>(P->getIncomingValue(i))) {
- assert(II->getParent() != P->getIncomingBlock(i) &&
- "Invoke edge not supported yet");
- }
- new StoreInst(P->getIncomingValue(i), Slot,
- P->getIncomingBlock(i)->getTerminator());
- }
-
- // Insert load in place of the phi and replace all uses.
- BasicBlock::iterator InsertPt;
- for (InsertPt = P->getParent()->getInstList().begin();
- isa<PHINode>(InsertPt); ++InsertPt)
- ; /*noop */
- Value *V = new LoadInst(Slot, P->getName()+".reload", P);
- P->replaceAllUsesWith(V);
-
- // Delete phi.
- P->eraseFromParent();
-
- return Slot;
-}
diff --git a/release_23/lib/Transforms/Utils/InlineCost.cpp b/release_23/lib/Transforms/Utils/InlineCost.cpp
deleted file mode 100644
index c87e4b80f0f6..000000000000
--- a/release_23/lib/Transforms/Utils/InlineCost.cpp
+++ /dev/null
@@ -1,271 +0,0 @@
-//===- InlineCoast.cpp - Cost analysis for inliner ------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements inline cost analysis.
-//
-//===----------------------------------------------------------------------===//
-
-
-#include "llvm/Transforms/Utils/InlineCost.h"
-#include "llvm/Support/CallSite.h"
-#include "llvm/CallingConv.h"
-#include "llvm/IntrinsicInst.h"
-
-using namespace llvm;
-
-// CountCodeReductionForConstant - Figure out an approximation for how many
-// instructions will be constant folded if the specified value is constant.
-//
-unsigned InlineCostAnalyzer::FunctionInfo::
- CountCodeReductionForConstant(Value *V) {
- unsigned Reduction = 0;
- for (Value::use_iterator UI = V->use_begin(), E = V->use_end(); UI != E; ++UI)
- if (isa<BranchInst>(*UI))
- Reduction += 40; // Eliminating a conditional branch is a big win
- else if (SwitchInst *SI = dyn_cast<SwitchInst>(*UI))
- // Eliminating a switch is a big win, proportional to the number of edges
- // deleted.
- Reduction += (SI->getNumSuccessors()-1) * 40;
- else if (CallInst *CI = dyn_cast<CallInst>(*UI)) {
- // Turning an indirect call into a direct call is a BIG win
- Reduction += CI->getCalledValue() == V ? 500 : 0;
- } else if (InvokeInst *II = dyn_cast<InvokeInst>(*UI)) {
- // Turning an indirect call into a direct call is a BIG win
- Reduction += II->getCalledValue() == V ? 500 : 0;
- } else {
- // Figure out if this instruction will be removed due to simple constant
- // propagation.
- Instruction &Inst = cast<Instruction>(**UI);
- bool AllOperandsConstant = true;
- for (unsigned i = 0, e = Inst.getNumOperands(); i != e; ++i)
- if (!isa<Constant>(Inst.getOperand(i)) && Inst.getOperand(i) != V) {
- AllOperandsConstant = false;
- break;
- }
-
- if (AllOperandsConstant) {
- // We will get to remove this instruction...
- Reduction += 7;
-
- // And any other instructions that use it which become constants
- // themselves.
- Reduction += CountCodeReductionForConstant(&Inst);
- }
- }
-
- return Reduction;
-}
-
-// CountCodeReductionForAlloca - Figure out an approximation of how much smaller
-// the function will be if it is inlined into a context where an argument
-// becomes an alloca.
-//
-unsigned InlineCostAnalyzer::FunctionInfo::
- CountCodeReductionForAlloca(Value *V) {
- if (!isa<PointerType>(V->getType())) return 0; // Not a pointer
- unsigned Reduction = 0;
- for (Value::use_iterator UI = V->use_begin(), E = V->use_end(); UI != E;++UI){
- Instruction *I = cast<Instruction>(*UI);
- if (isa<LoadInst>(I) || isa<StoreInst>(I))
- Reduction += 10;
- else if (GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(I)) {
- // If the GEP has variable indices, we won't be able to do much with it.
- for (Instruction::op_iterator I = GEP->op_begin()+1, E = GEP->op_end();
- I != E; ++I)
- if (!isa<Constant>(*I)) return 0;
- Reduction += CountCodeReductionForAlloca(GEP)+15;
- } else {
- // If there is some other strange instruction, we're not going to be able
- // to do much if we inline this.
- return 0;
- }
- }
-
- return Reduction;
-}
-
-/// analyzeFunction - Fill in the current structure with information gleaned
-/// from the specified function.
-void InlineCostAnalyzer::FunctionInfo::analyzeFunction(Function *F) {
- unsigned NumInsts = 0, NumBlocks = 0, NumVectorInsts = 0;
-
- // Look at the size of the callee. Each basic block counts as 20 units, and
- // each instruction counts as 5.
- for (Function::const_iterator BB = F->begin(), E = F->end(); BB != E; ++BB) {
- for (BasicBlock::const_iterator II = BB->begin(), E = BB->end();
- II != E; ++II) {
- if (isa<DbgInfoIntrinsic>(II)) continue; // Debug intrinsics don't count.
- if (isa<PHINode>(II)) continue; // PHI nodes don't count.
-
- if (isa<InsertElementInst>(II) || isa<ExtractElementInst>(II) ||
- isa<ShuffleVectorInst>(II) || isa<VectorType>(II->getType()))
- ++NumVectorInsts;
-
- // Noop casts, including ptr <-> int, don't count.
- if (const CastInst *CI = dyn_cast<CastInst>(II)) {
- if (CI->isLosslessCast() || isa<IntToPtrInst>(CI) ||
- isa<PtrToIntInst>(CI))
- continue;
- } else if (const GetElementPtrInst *GEPI =
- dyn_cast<GetElementPtrInst>(II)) {
- // If a GEP has all constant indices, it will probably be folded with
- // a load/store.
- bool AllConstant = true;
- for (unsigned i = 1, e = GEPI->getNumOperands(); i != e; ++i)
- if (!isa<ConstantInt>(GEPI->getOperand(i))) {
- AllConstant = false;
- break;
- }
- if (AllConstant) continue;
- }
-
- ++NumInsts;
- }
-
- ++NumBlocks;
- }
-
- this->NumBlocks = NumBlocks;
- this->NumInsts = NumInsts;
- this->NumVectorInsts = NumVectorInsts;
-
- // Check out all of the arguments to the function, figuring out how much
- // code can be eliminated if one of the arguments is a constant.
- for (Function::arg_iterator I = F->arg_begin(), E = F->arg_end(); I != E; ++I)
- ArgumentWeights.push_back(ArgInfo(CountCodeReductionForConstant(I),
- CountCodeReductionForAlloca(I)));
-}
-
-
-
-// getInlineCost - The heuristic used to determine if we should inline the
-// function call or not.
-//
-int InlineCostAnalyzer::getInlineCost(CallSite CS,
- SmallPtrSet<const Function *, 16> &NeverInline) {
- Instruction *TheCall = CS.getInstruction();
- Function *Callee = CS.getCalledFunction();
- const Function *Caller = TheCall->getParent()->getParent();
-
- // Don't inline a directly recursive call.
- if (Caller == Callee ||
- // Don't inline functions which can be redefined at link-time to mean
- // something else. link-once linkage is ok though.
- Callee->hasWeakLinkage() ||
-
- // Don't inline functions marked noinline.
- NeverInline.count(Callee))
- return 2000000000;
-
- // InlineCost - This value measures how good of an inline candidate this call
- // site is to inline. A lower inline cost make is more likely for the call to
- // be inlined. This value may go negative.
- //
- int InlineCost = 0;
-
- // If there is only one call of the function, and it has internal linkage,
- // make it almost guaranteed to be inlined.
- //
- if (Callee->hasInternalLinkage() && Callee->hasOneUse())
- InlineCost -= 15000;
-
- // If this function uses the coldcc calling convention, prefer not to inline
- // it.
- if (Callee->getCallingConv() == CallingConv::Cold)
- InlineCost += 2000;
-
- // If the instruction after the call, or if the normal destination of the
- // invoke is an unreachable instruction, the function is noreturn. As such,
- // there is little point in inlining this.
- if (InvokeInst *II = dyn_cast<InvokeInst>(TheCall)) {
- if (isa<UnreachableInst>(II->getNormalDest()->begin()))
- InlineCost += 10000;
- } else if (isa<UnreachableInst>(++BasicBlock::iterator(TheCall)))
- InlineCost += 10000;
-
- // Get information about the callee...
- FunctionInfo &CalleeFI = CachedFunctionInfo[Callee];
-
- // If we haven't calculated this information yet, do so now.
- if (CalleeFI.NumBlocks == 0)
- CalleeFI.analyzeFunction(Callee);
-
- // Add to the inline quality for properties that make the call valuable to
- // inline. This includes factors that indicate that the result of inlining
- // the function will be optimizable. Currently this just looks at arguments
- // passed into the function.
- //
- unsigned ArgNo = 0;
- for (CallSite::arg_iterator I = CS.arg_begin(), E = CS.arg_end();
- I != E; ++I, ++ArgNo) {
- // Each argument passed in has a cost at both the caller and the callee
- // sides. This favors functions that take many arguments over functions
- // that take few arguments.
- InlineCost -= 20;
-
- // If this is a function being passed in, it is very likely that we will be
- // able to turn an indirect function call into a direct function call.
- if (isa<Function>(I))
- InlineCost -= 100;
-
- // If an alloca is passed in, inlining this function is likely to allow
- // significant future optimization possibilities (like scalar promotion, and
- // scalarization), so encourage the inlining of the function.
- //
- else if (isa<AllocaInst>(I)) {
- if (ArgNo < CalleeFI.ArgumentWeights.size())
- InlineCost -= CalleeFI.ArgumentWeights[ArgNo].AllocaWeight;
-
- // If this is a constant being passed into the function, use the argument
- // weights calculated for the callee to determine how much will be folded
- // away with this information.
- } else if (isa<Constant>(I)) {
- if (ArgNo < CalleeFI.ArgumentWeights.size())
- InlineCost -= CalleeFI.ArgumentWeights[ArgNo].ConstantWeight;
- }
- }
-
- // Now that we have considered all of the factors that make the call site more
- // likely to be inlined, look at factors that make us not want to inline it.
-
- // Don't inline into something too big, which would make it bigger.
- //
- InlineCost += Caller->size()/15;
-
- // Look at the size of the callee. Each instruction counts as 5.
- InlineCost += CalleeFI.NumInsts*5;
-
- return InlineCost;
-}
-
-// getInlineFudgeFactor - Return a > 1.0 factor if the inliner should use a
-// higher threshold to determine if the function call should be inlined.
-float InlineCostAnalyzer::getInlineFudgeFactor(CallSite CS) {
- Function *Callee = CS.getCalledFunction();
-
- // Get information about the callee...
- FunctionInfo &CalleeFI = CachedFunctionInfo[Callee];
-
- // If we haven't calculated this information yet, do so now.
- if (CalleeFI.NumBlocks == 0)
- CalleeFI.analyzeFunction(Callee);
-
- float Factor = 1.0f;
- // Single BB functions are often written to be inlined.
- if (CalleeFI.NumBlocks == 1)
- Factor += 0.5f;
-
- // Be more aggressive if the function contains a good chunk (if it mades up
- // at least 10% of the instructions) of vector instructions.
- if (CalleeFI.NumVectorInsts > CalleeFI.NumInsts/2)
- Factor += 2.0f;
- else if (CalleeFI.NumVectorInsts > CalleeFI.NumInsts/10)
- Factor += 1.5f;
- return Factor;
-}
diff --git a/release_23/lib/Transforms/Utils/InlineFunction.cpp b/release_23/lib/Transforms/Utils/InlineFunction.cpp
deleted file mode 100644
index 6c96785aa10b..000000000000
--- a/release_23/lib/Transforms/Utils/InlineFunction.cpp
+++ /dev/null
@@ -1,613 +0,0 @@
-//===- InlineFunction.cpp - Code to perform function inlining -------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements inlining of a function into a call site, resolving
-// parameters and the return value as appropriate.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Transforms/Utils/Cloning.h"
-#include "llvm/Constants.h"
-#include "llvm/DerivedTypes.h"
-#include "llvm/Module.h"
-#include "llvm/Instructions.h"
-#include "llvm/Intrinsics.h"
-#include "llvm/ParameterAttributes.h"
-#include "llvm/Analysis/CallGraph.h"
-#include "llvm/Target/TargetData.h"
-#include "llvm/ADT/SmallVector.h"
-#include "llvm/ADT/StringExtras.h"
-#include "llvm/Support/CallSite.h"
-using namespace llvm;
-
-bool llvm::InlineFunction(CallInst *CI, CallGraph *CG, const TargetData *TD) {
- return InlineFunction(CallSite(CI), CG, TD);
-}
-bool llvm::InlineFunction(InvokeInst *II, CallGraph *CG, const TargetData *TD) {
- return InlineFunction(CallSite(II), CG, TD);
-}
-
-/// HandleInlinedInvoke - If we inlined an invoke site, we need to convert calls
-/// in the body of the inlined function into invokes and turn unwind
-/// instructions into branches to the invoke unwind dest.
-///
-/// II is the invoke instruction begin inlined. FirstNewBlock is the first
-/// block of the inlined code (the last block is the end of the function),
-/// and InlineCodeInfo is information about the code that got inlined.
-static void HandleInlinedInvoke(InvokeInst *II, BasicBlock *FirstNewBlock,
- ClonedCodeInfo &InlinedCodeInfo) {
- BasicBlock *InvokeDest = II->getUnwindDest();
- std::vector<Value*> InvokeDestPHIValues;
-
- // If there are PHI nodes in the unwind destination block, we need to
- // keep track of which values came into them from this invoke, then remove
- // the entry for this block.
- BasicBlock *InvokeBlock = II->getParent();
- for (BasicBlock::iterator I = InvokeDest->begin(); isa<PHINode>(I); ++I) {
- PHINode *PN = cast<PHINode>(I);
- // Save the value to use for this edge.
- InvokeDestPHIValues.push_back(PN->getIncomingValueForBlock(InvokeBlock));
- }
-
- Function *Caller = FirstNewBlock->getParent();
-
- // The inlined code is currently at the end of the function, scan from the
- // start of the inlined code to its end, checking for stuff we need to
- // rewrite.
- if (InlinedCodeInfo.ContainsCalls || InlinedCodeInfo.ContainsUnwinds) {
- for (Function::iterator BB = FirstNewBlock, E = Caller->end();
- BB != E; ++BB) {
- if (InlinedCodeInfo.ContainsCalls) {
- for (BasicBlock::iterator BBI = BB->begin(), E = BB->end(); BBI != E; ){
- Instruction *I = BBI++;
-
- // We only need to check for function calls: inlined invoke
- // instructions require no special handling.
- if (!isa<CallInst>(I)) continue;
- CallInst *CI = cast<CallInst>(I);
-
- // If this call cannot unwind, don't convert it to an invoke.
- if (CI->doesNotThrow())
- continue;
-
- // Convert this function call into an invoke instruction.
- // First, split the basic block.
- BasicBlock *Split = BB->splitBasicBlock(CI, CI->getName()+".noexc");
-
- // Next, create the new invoke instruction, inserting it at the end
- // of the old basic block.
- SmallVector<Value*, 8> InvokeArgs(CI->op_begin()+1, CI->op_end());
- InvokeInst *II =
- InvokeInst::Create(CI->getCalledValue(), Split, InvokeDest,
- InvokeArgs.begin(), InvokeArgs.end(),
- CI->getName(), BB->getTerminator());
- II->setCallingConv(CI->getCallingConv());
- II->setParamAttrs(CI->getParamAttrs());
-
- // Make sure that anything using the call now uses the invoke!
- CI->replaceAllUsesWith(II);
-
- // Delete the unconditional branch inserted by splitBasicBlock
- BB->getInstList().pop_back();
- Split->getInstList().pop_front(); // Delete the original call
-
- // Update any PHI nodes in the exceptional block to indicate that
- // there is now a new entry in them.
- unsigned i = 0;
- for (BasicBlock::iterator I = InvokeDest->begin();
- isa<PHINode>(I); ++I, ++i) {
- PHINode *PN = cast<PHINode>(I);
- PN->addIncoming(InvokeDestPHIValues[i], BB);
- }
-
- // This basic block is now complete, start scanning the next one.
- break;
- }
- }
-
- if (UnwindInst *UI = dyn_cast<UnwindInst>(BB->getTerminator())) {
- // An UnwindInst requires special handling when it gets inlined into an
- // invoke site. Once this happens, we know that the unwind would cause
- // a control transfer to the invoke exception destination, so we can
- // transform it into a direct branch to the exception destination.
- BranchInst::Create(InvokeDest, UI);
-
- // Delete the unwind instruction!
- UI->getParent()->getInstList().pop_back();
-
- // Update any PHI nodes in the exceptional block to indicate that
- // there is now a new entry in them.
- unsigned i = 0;
- for (BasicBlock::iterator I = InvokeDest->begin();
- isa<PHINode>(I); ++I, ++i) {
- PHINode *PN = cast<PHINode>(I);
- PN->addIncoming(InvokeDestPHIValues[i], BB);
- }
- }
- }
- }
-
- // Now that everything is happy, we have one final detail. The PHI nodes in
- // the exception destination block still have entries due to the original
- // invoke instruction. Eliminate these entries (which might even delete the
- // PHI node) now.
- InvokeDest->removePredecessor(II->getParent());
-}
-
-/// UpdateCallGraphAfterInlining - Once we have cloned code over from a callee
-/// into the caller, update the specified callgraph to reflect the changes we
-/// made. Note that it's possible that not all code was copied over, so only
-/// some edges of the callgraph will be remain.
-static void UpdateCallGraphAfterInlining(const Function *Caller,
- const Function *Callee,
- Function::iterator FirstNewBlock,
- DenseMap<const Value*, Value*> &ValueMap,
- CallGraph &CG) {
- // Update the call graph by deleting the edge from Callee to Caller
- CallGraphNode *CalleeNode = CG[Callee];
- CallGraphNode *CallerNode = CG[Caller];
- CallerNode->removeCallEdgeTo(CalleeNode);
-
- // Since we inlined some uninlined call sites in the callee into the caller,
- // add edges from the caller to all of the callees of the callee.
- for (CallGraphNode::iterator I = CalleeNode->begin(),
- E = CalleeNode->end(); I != E; ++I) {
- const Instruction *OrigCall = I->first.getInstruction();
-
- DenseMap<const Value*, Value*>::iterator VMI = ValueMap.find(OrigCall);
- // Only copy the edge if the call was inlined!
- if (VMI != ValueMap.end() && VMI->second) {
- // If the call was inlined, but then constant folded, there is no edge to
- // add. Check for this case.
- if (Instruction *NewCall = dyn_cast<Instruction>(VMI->second))
- CallerNode->addCalledFunction(CallSite::get(NewCall), I->second);
- }
- }
-}
-
-
-// InlineFunction - This function inlines the called function into the basic
-// block of the caller. This returns false if it is not possible to inline this
-// call. The program is still in a well defined state if this occurs though.
-//
-// Note that this only does one level of inlining. For example, if the
-// instruction 'call B' is inlined, and 'B' calls 'C', then the call to 'C' now
-// exists in the instruction stream. Similiarly this will inline a recursive
-// function by one level.
-//
-bool llvm::InlineFunction(CallSite CS, CallGraph *CG, const TargetData *TD) {
- Instruction *TheCall = CS.getInstruction();
- assert(TheCall->getParent() && TheCall->getParent()->getParent() &&
- "Instruction not in function!");
-
- const Function *CalledFunc = CS.getCalledFunction();
- if (CalledFunc == 0 || // Can't inline external function or indirect
- CalledFunc->isDeclaration() || // call, or call to a vararg function!
- CalledFunc->getFunctionType()->isVarArg()) return false;
-
-
- // If the call to the callee is a non-tail call, we must clear the 'tail'
- // flags on any calls that we inline.
- bool MustClearTailCallFlags =
- isa<CallInst>(TheCall) && !cast<CallInst>(TheCall)->isTailCall();
-
- // If the call to the callee cannot throw, set the 'nounwind' flag on any
- // calls that we inline.
- bool MarkNoUnwind = CS.doesNotThrow();
-
- BasicBlock *OrigBB = TheCall->getParent();
- Function *Caller = OrigBB->getParent();
-
- // GC poses two hazards to inlining, which only occur when the callee has GC:
- // 1. If the caller has no GC, then the callee's GC must be propagated to the
- // caller.
- // 2. If the caller has a differing GC, it is invalid to inline.
- if (CalledFunc->hasCollector()) {
- if (!Caller->hasCollector())
- Caller->setCollector(CalledFunc->getCollector());
- else if (CalledFunc->getCollector() != Caller->getCollector())
- return false;
- }
-
- // Get an iterator to the last basic block in the function, which will have
- // the new function inlined after it.
- //
- Function::iterator LastBlock = &Caller->back();
-
- // Make sure to capture all of the return instructions from the cloned
- // function.
- std::vector<ReturnInst*> Returns;
- ClonedCodeInfo InlinedFunctionInfo;
- Function::iterator FirstNewBlock;
-
- { // Scope to destroy ValueMap after cloning.
- DenseMap<const Value*, Value*> ValueMap;
-
- assert(std::distance(CalledFunc->arg_begin(), CalledFunc->arg_end()) ==
- std::distance(CS.arg_begin(), CS.arg_end()) &&
- "No varargs calls can be inlined!");
-
- // Calculate the vector of arguments to pass into the function cloner, which
- // matches up the formal to the actual argument values.
- CallSite::arg_iterator AI = CS.arg_begin();
- unsigned ArgNo = 0;
- for (Function::const_arg_iterator I = CalledFunc->arg_begin(),
- E = CalledFunc->arg_end(); I != E; ++I, ++AI, ++ArgNo) {
- Value *ActualArg = *AI;
-
- // When byval arguments actually inlined, we need to make the copy implied
- // by them explicit. However, we don't do this if the callee is readonly
- // or readnone, because the copy would be unneeded: the callee doesn't
- // modify the struct.
- if (CalledFunc->paramHasAttr(ArgNo+1, ParamAttr::ByVal) &&
- !CalledFunc->onlyReadsMemory()) {
- const Type *AggTy = cast<PointerType>(I->getType())->getElementType();
- const Type *VoidPtrTy = PointerType::getUnqual(Type::Int8Ty);
-
- // Create the alloca. If we have TargetData, use nice alignment.
- unsigned Align = 1;
- if (TD) Align = TD->getPrefTypeAlignment(AggTy);
- Value *NewAlloca = new AllocaInst(AggTy, 0, Align, I->getName(),
- Caller->begin()->begin());
- // Emit a memcpy.
- Function *MemCpyFn = Intrinsic::getDeclaration(Caller->getParent(),
- Intrinsic::memcpy_i64);
- Value *DestCast = new BitCastInst(NewAlloca, VoidPtrTy, "tmp", TheCall);
- Value *SrcCast = new BitCastInst(*AI, VoidPtrTy, "tmp", TheCall);
-
- Value *Size;
- if (TD == 0)
- Size = ConstantExpr::getSizeOf(AggTy);
- else
- Size = ConstantInt::get(Type::Int64Ty, TD->getTypeStoreSize(AggTy));
-
- // Always generate a memcpy of alignment 1 here because we don't know
- // the alignment of the src pointer. Other optimizations can infer
- // better alignment.
- Value *CallArgs[] = {
- DestCast, SrcCast, Size, ConstantInt::get(Type::Int32Ty, 1)
- };
- CallInst *TheMemCpy =
- CallInst::Create(MemCpyFn, CallArgs, CallArgs+4, "", TheCall);
-
- // If we have a call graph, update it.
- if (CG) {
- CallGraphNode *MemCpyCGN = CG->getOrInsertFunction(MemCpyFn);
- CallGraphNode *CallerNode = (*CG)[Caller];
- CallerNode->addCalledFunction(TheMemCpy, MemCpyCGN);
- }
-
- // Uses of the argument in the function should use our new alloca
- // instead.
- ActualArg = NewAlloca;
- }
-
- ValueMap[I] = ActualArg;
- }
-
- // We want the inliner to prune the code as it copies. We would LOVE to
- // have no dead or constant instructions leftover after inlining occurs
- // (which can happen, e.g., because an argument was constant), but we'll be
- // happy with whatever the cloner can do.
- CloneAndPruneFunctionInto(Caller, CalledFunc, ValueMap, Returns, ".i",
- &InlinedFunctionInfo, TD);
-
- // Remember the first block that is newly cloned over.
- FirstNewBlock = LastBlock; ++FirstNewBlock;
-
- // Update the callgraph if requested.
- if (CG)
- UpdateCallGraphAfterInlining(Caller, CalledFunc, FirstNewBlock, ValueMap,
- *CG);
- }
-
- // If there are any alloca instructions in the block that used to be the entry
- // block for the callee, move them to the entry block of the caller. First
- // calculate which instruction they should be inserted before. We insert the
- // instructions at the end of the current alloca list.
- //
- {
- BasicBlock::iterator InsertPoint = Caller->begin()->begin();
- for (BasicBlock::iterator I = FirstNewBlock->begin(),
- E = FirstNewBlock->end(); I != E; )
- if (AllocaInst *AI = dyn_cast<AllocaInst>(I++)) {
- // If the alloca is now dead, remove it. This often occurs due to code
- // specialization.
- if (AI->use_empty()) {
- AI->eraseFromParent();
- continue;
- }
-
- if (isa<Constant>(AI->getArraySize())) {
- // Scan for the block of allocas that we can move over, and move them
- // all at once.
- while (isa<AllocaInst>(I) &&
- isa<Constant>(cast<AllocaInst>(I)->getArraySize()))
- ++I;
-
- // Transfer all of the allocas over in a block. Using splice means
- // that the instructions aren't removed from the symbol table, then
- // reinserted.
- Caller->getEntryBlock().getInstList().splice(
- InsertPoint,
- FirstNewBlock->getInstList(),
- AI, I);
- }
- }
- }
-
- // If the inlined code contained dynamic alloca instructions, wrap the inlined
- // code with llvm.stacksave/llvm.stackrestore intrinsics.
- if (InlinedFunctionInfo.ContainsDynamicAllocas) {
- Module *M = Caller->getParent();
- // Get the two intrinsics we care about.
- Constant *StackSave, *StackRestore;
- StackSave = Intrinsic::getDeclaration(M, Intrinsic::stacksave);
- StackRestore = Intrinsic::getDeclaration(M, Intrinsic::stackrestore);
-
- // If we are preserving the callgraph, add edges to the stacksave/restore
- // functions for the calls we insert.
- CallGraphNode *StackSaveCGN = 0, *StackRestoreCGN = 0, *CallerNode = 0;
- if (CG) {
- // We know that StackSave/StackRestore are Function*'s, because they are
- // intrinsics which must have the right types.
- StackSaveCGN = CG->getOrInsertFunction(cast<Function>(StackSave));
- StackRestoreCGN = CG->getOrInsertFunction(cast<Function>(StackRestore));
- CallerNode = (*CG)[Caller];
- }
-
- // Insert the llvm.stacksave.
- CallInst *SavedPtr = CallInst::Create(StackSave, "savedstack",
- FirstNewBlock->begin());
- if (CG) CallerNode->addCalledFunction(SavedPtr, StackSaveCGN);
-
- // Insert a call to llvm.stackrestore before any return instructions in the
- // inlined function.
- for (unsigned i = 0, e = Returns.size(); i != e; ++i) {
- CallInst *CI = CallInst::Create(StackRestore, SavedPtr, "", Returns[i]);
- if (CG) CallerNode->addCalledFunction(CI, StackRestoreCGN);
- }
-
- // Count the number of StackRestore calls we insert.
- unsigned NumStackRestores = Returns.size();
-
- // If we are inlining an invoke instruction, insert restores before each
- // unwind. These unwinds will be rewritten into branches later.
- if (InlinedFunctionInfo.ContainsUnwinds && isa<InvokeInst>(TheCall)) {
- for (Function::iterator BB = FirstNewBlock, E = Caller->end();
- BB != E; ++BB)
- if (UnwindInst *UI = dyn_cast<UnwindInst>(BB->getTerminator())) {
- CallInst::Create(StackRestore, SavedPtr, "", UI);
- ++NumStackRestores;
- }
- }
- }
-
- // If we are inlining tail call instruction through a call site that isn't
- // marked 'tail', we must remove the tail marker for any calls in the inlined
- // code. Also, calls inlined through a 'nounwind' call site should be marked
- // 'nounwind'.
- if (InlinedFunctionInfo.ContainsCalls &&
- (MustClearTailCallFlags || MarkNoUnwind)) {
- for (Function::iterator BB = FirstNewBlock, E = Caller->end();
- BB != E; ++BB)
- for (BasicBlock::iterator I = BB->begin(), E = BB->end(); I != E; ++I)
- if (CallInst *CI = dyn_cast<CallInst>(I)) {
- if (MustClearTailCallFlags)
- CI->setTailCall(false);
- if (MarkNoUnwind)
- CI->setDoesNotThrow();
- }
- }
-
- // If we are inlining through a 'nounwind' call site then any inlined 'unwind'
- // instructions are unreachable.
- if (InlinedFunctionInfo.ContainsUnwinds && MarkNoUnwind)
- for (Function::iterator BB = FirstNewBlock, E = Caller->end();
- BB != E; ++BB) {
- TerminatorInst *Term = BB->getTerminator();
- if (isa<UnwindInst>(Term)) {
- new UnreachableInst(Term);
- BB->getInstList().erase(Term);
- }
- }
-
- // If we are inlining for an invoke instruction, we must make sure to rewrite
- // any inlined 'unwind' instructions into branches to the invoke exception
- // destination, and call instructions into invoke instructions.
- if (InvokeInst *II = dyn_cast<InvokeInst>(TheCall))
- HandleInlinedInvoke(II, FirstNewBlock, InlinedFunctionInfo);
-
- // If we cloned in _exactly one_ basic block, and if that block ends in a
- // return instruction, we splice the body of the inlined callee directly into
- // the calling basic block.
- if (Returns.size() == 1 && std::distance(FirstNewBlock, Caller->end()) == 1) {
- // Move all of the instructions right before the call.
- OrigBB->getInstList().splice(TheCall, FirstNewBlock->getInstList(),
- FirstNewBlock->begin(), FirstNewBlock->end());
- // Remove the cloned basic block.
- Caller->getBasicBlockList().pop_back();
-
- // If the call site was an invoke instruction, add a branch to the normal
- // destination.
- if (InvokeInst *II = dyn_cast<InvokeInst>(TheCall))
- BranchInst::Create(II->getNormalDest(), TheCall);
-
- // If the return instruction returned a value, replace uses of the call with
- // uses of the returned value.
- if (!TheCall->use_empty()) {
- ReturnInst *R = Returns[0];
- if (isa<StructType>(TheCall->getType())) {
- // Multiple return values.
- while (!TheCall->use_empty()) {
- GetResultInst *GR = cast<GetResultInst>(TheCall->use_back());
- Value *RV = R->getOperand(GR->getIndex());
- GR->replaceAllUsesWith(RV);
- GR->eraseFromParent();
- }
- } else
- TheCall->replaceAllUsesWith(R->getReturnValue());
- }
- // Since we are now done with the Call/Invoke, we can delete it.
- TheCall->getParent()->getInstList().erase(TheCall);
-
- // Since we are now done with the return instruction, delete it also.
- Returns[0]->getParent()->getInstList().erase(Returns[0]);
-
- // We are now done with the inlining.
- return true;
- }
-
- // Otherwise, we have the normal case, of more than one block to inline or
- // multiple return sites.
-
- // We want to clone the entire callee function into the hole between the
- // "starter" and "ender" blocks. How we accomplish this depends on whether
- // this is an invoke instruction or a call instruction.
- BasicBlock *AfterCallBB;
- if (InvokeInst *II = dyn_cast<InvokeInst>(TheCall)) {
-
- // Add an unconditional branch to make this look like the CallInst case...
- BranchInst *NewBr = BranchInst::Create(II->getNormalDest(), TheCall);
-
- // Split the basic block. This guarantees that no PHI nodes will have to be
- // updated due to new incoming edges, and make the invoke case more
- // symmetric to the call case.
- AfterCallBB = OrigBB->splitBasicBlock(NewBr,
- CalledFunc->getName()+".exit");
-
- } else { // It's a call
- // If this is a call instruction, we need to split the basic block that
- // the call lives in.
- //
- AfterCallBB = OrigBB->splitBasicBlock(TheCall,
- CalledFunc->getName()+".exit");
- }
-
- // Change the branch that used to go to AfterCallBB to branch to the first
- // basic block of the inlined function.
- //
- TerminatorInst *Br = OrigBB->getTerminator();
- assert(Br && Br->getOpcode() == Instruction::Br &&
- "splitBasicBlock broken!");
- Br->setOperand(0, FirstNewBlock);
-
-
- // Now that the function is correct, make it a little bit nicer. In
- // particular, move the basic blocks inserted from the end of the function
- // into the space made by splitting the source basic block.
- Caller->getBasicBlockList().splice(AfterCallBB, Caller->getBasicBlockList(),
- FirstNewBlock, Caller->end());
-
- // Handle all of the return instructions that we just cloned in, and eliminate
- // any users of the original call/invoke instruction.
- const Type *RTy = CalledFunc->getReturnType();
- const StructType *STy = dyn_cast<StructType>(RTy);
- if (Returns.size() > 1 || STy) {
- // The PHI node should go at the front of the new basic block to merge all
- // possible incoming values.
- SmallVector<PHINode *, 4> PHIs;
- if (!TheCall->use_empty()) {
- if (STy) {
- unsigned NumRetVals = STy->getNumElements();
- // Create new phi nodes such that phi node number in the PHIs vector
- // match corresponding return value operand number.
- Instruction *InsertPt = AfterCallBB->begin();
- for (unsigned i = 0; i < NumRetVals; ++i) {
- PHINode *PHI = PHINode::Create(STy->getElementType(i),
- TheCall->getName() + "." + utostr(i),
- InsertPt);
- PHIs.push_back(PHI);
- }
- // TheCall results are used by GetResult instructions.
- while (!TheCall->use_empty()) {
- GetResultInst *GR = cast<GetResultInst>(TheCall->use_back());
- GR->replaceAllUsesWith(PHIs[GR->getIndex()]);
- GR->eraseFromParent();
- }
- } else {
- PHINode *PHI = PHINode::Create(RTy, TheCall->getName(), AfterCallBB->begin());
- PHIs.push_back(PHI);
- // Anything that used the result of the function call should now use the
- // PHI node as their operand.
- TheCall->replaceAllUsesWith(PHI);
- }
- }
-
- // Loop over all of the return instructions adding entries to the PHI node as
- // appropriate.
- if (!PHIs.empty()) {
- // There is atleast one return value.
- unsigned NumRetVals = 1;
- if (STy)
- NumRetVals = STy->getNumElements();
- for (unsigned j = 0; j < NumRetVals; ++j) {
- PHINode *PHI = PHIs[j];
- // Each PHI node will receive one value from each return instruction.
- for(unsigned i = 0, e = Returns.size(); i != e; ++i) {
- ReturnInst *RI = Returns[i];
- assert(RI->getReturnValue(j)->getType() == PHI->getType() &&
- "Ret value not consistent in function!");
- PHI->addIncoming(RI->getReturnValue(j /*PHI number matches operand number*/),
- RI->getParent());
- }
- }
- }
-
- // Add a branch to the merge points and remove retrun instructions.
- for (unsigned i = 0, e = Returns.size(); i != e; ++i) {
- ReturnInst *RI = Returns[i];
- BranchInst::Create(AfterCallBB, RI);
- RI->eraseFromParent();
- }
- } else if (!Returns.empty()) {
- // Otherwise, if there is exactly one return value, just replace anything
- // using the return value of the call with the computed value.
- if (!TheCall->use_empty())
- TheCall->replaceAllUsesWith(Returns[0]->getReturnValue());
-
- // Splice the code from the return block into the block that it will return
- // to, which contains the code that was after the call.
- BasicBlock *ReturnBB = Returns[0]->getParent();
- AfterCallBB->getInstList().splice(AfterCallBB->begin(),
- ReturnBB->getInstList());
-
- // Update PHI nodes that use the ReturnBB to use the AfterCallBB.
- ReturnBB->replaceAllUsesWith(AfterCallBB);
-
- // Delete the return instruction now and empty ReturnBB now.
- Returns[0]->eraseFromParent();
- ReturnBB->eraseFromParent();
- } else if (!TheCall->use_empty()) {
- // No returns, but something is using the return value of the call. Just
- // nuke the result.
- TheCall->replaceAllUsesWith(UndefValue::get(TheCall->getType()));
- }
-
- // Since we are now done with the Call/Invoke, we can delete it.
- TheCall->eraseFromParent();
-
- // We should always be able to fold the entry block of the function into the
- // single predecessor of the block...
- assert(cast<BranchInst>(Br)->isUnconditional() && "splitBasicBlock broken!");
- BasicBlock *CalleeEntry = cast<BranchInst>(Br)->getSuccessor(0);
-
- // Splice the code entry block into calling block, right before the
- // unconditional branch.
- OrigBB->getInstList().splice(Br, CalleeEntry->getInstList());
- CalleeEntry->replaceAllUsesWith(OrigBB); // Update PHI nodes
-
- // Remove the unconditional branch.
- OrigBB->getInstList().erase(Br);
-
- // Now we can remove the CalleeEntry block, which is now empty.
- Caller->getBasicBlockList().erase(CalleeEntry);
-
- return true;
-}
diff --git a/release_23/lib/Transforms/Utils/LCSSA.cpp b/release_23/lib/Transforms/Utils/LCSSA.cpp
deleted file mode 100644
index 39314678bd4d..000000000000
--- a/release_23/lib/Transforms/Utils/LCSSA.cpp
+++ /dev/null
@@ -1,294 +0,0 @@
-//===-- LCSSA.cpp - Convert loops into loop-closed SSA form ---------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This pass transforms loops by placing phi nodes at the end of the loops for
-// all values that are live across the loop boundary. For example, it turns
-// the left into the right code:
-//
-// for (...) for (...)
-// if (c) if (c)
-// X1 = ... X1 = ...
-// else else
-// X2 = ... X2 = ...
-// X3 = phi(X1, X2) X3 = phi(X1, X2)
-// ... = X3 + 4 X4 = phi(X3)
-// ... = X4 + 4
-//
-// This is still valid LLVM; the extra phi nodes are purely redundant, and will
-// be trivially eliminated by InstCombine. The major benefit of this
-// transformation is that it makes many other loop optimizations, such as
-// LoopUnswitching, simpler.
-//
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "lcssa"
-#include "llvm/Transforms/Scalar.h"
-#include "llvm/Constants.h"
-#include "llvm/Pass.h"
-#include "llvm/Function.h"
-#include "llvm/Instructions.h"
-#include "llvm/ADT/SetVector.h"
-#include "llvm/ADT/Statistic.h"
-#include "llvm/Analysis/Dominators.h"
-#include "llvm/Analysis/LoopPass.h"
-#include "llvm/Analysis/ScalarEvolution.h"
-#include "llvm/Support/CFG.h"
-#include "llvm/Support/Compiler.h"
-#include <algorithm>
-#include <map>
-using namespace llvm;
-
-STATISTIC(NumLCSSA, "Number of live out of a loop variables");
-
-namespace {
- struct VISIBILITY_HIDDEN LCSSA : public LoopPass {
- static char ID; // Pass identification, replacement for typeid
- LCSSA() : LoopPass((intptr_t)&ID) {}
-
- // Cached analysis information for the current function.
- LoopInfo *LI;
- DominatorTree *DT;
- std::vector<BasicBlock*> LoopBlocks;
-
- virtual bool runOnLoop(Loop *L, LPPassManager &LPM);
-
- void ProcessInstruction(Instruction* Instr,
- const SmallVector<BasicBlock*, 8>& exitBlocks);
-
- /// This transformation requires natural loop information & requires that
- /// loop preheaders be inserted into the CFG. It maintains both of these,
- /// as well as the CFG. It also requires dominator information.
- ///
- virtual void getAnalysisUsage(AnalysisUsage &AU) const {
- AU.setPreservesCFG();
- AU.addRequiredID(LoopSimplifyID);
- AU.addPreservedID(LoopSimplifyID);
- AU.addRequired<LoopInfo>();
- AU.addPreserved<LoopInfo>();
- AU.addRequired<DominatorTree>();
- AU.addPreserved<ScalarEvolution>();
- AU.addPreserved<DominatorTree>();
-
- // Request DominanceFrontier now, even though LCSSA does
- // not use it. This allows Pass Manager to schedule Dominance
- // Frontier early enough such that one LPPassManager can handle
- // multiple loop transformation passes.
- AU.addRequired<DominanceFrontier>();
- AU.addPreserved<DominanceFrontier>();
- }
- private:
- void getLoopValuesUsedOutsideLoop(Loop *L,
- SetVector<Instruction*> &AffectedValues);
-
- Value *GetValueForBlock(DomTreeNode *BB, Instruction *OrigInst,
- std::map<DomTreeNode*, Value*> &Phis);
-
- /// inLoop - returns true if the given block is within the current loop
- bool inLoop(BasicBlock* B) {
- return std::binary_search(LoopBlocks.begin(), LoopBlocks.end(), B);
- }
- };
-
- char LCSSA::ID = 0;
- RegisterPass<LCSSA> X("lcssa", "Loop-Closed SSA Form Pass");
-}
-
-LoopPass *llvm::createLCSSAPass() { return new LCSSA(); }
-const PassInfo *llvm::LCSSAID = X.getPassInfo();
-
-/// runOnFunction - Process all loops in the function, inner-most out.
-bool LCSSA::runOnLoop(Loop *L, LPPassManager &LPM) {
-
- LI = &LPM.getAnalysis<LoopInfo>();
- DT = &getAnalysis<DominatorTree>();
-
- // Speed up queries by creating a sorted list of blocks
- LoopBlocks.clear();
- LoopBlocks.insert(LoopBlocks.end(), L->block_begin(), L->block_end());
- std::sort(LoopBlocks.begin(), LoopBlocks.end());
-
- SetVector<Instruction*> AffectedValues;
- getLoopValuesUsedOutsideLoop(L, AffectedValues);
-
- // If no values are affected, we can save a lot of work, since we know that
- // nothing will be changed.
- if (AffectedValues.empty())
- return false;
-
- SmallVector<BasicBlock*, 8> exitBlocks;
- L->getExitBlocks(exitBlocks);
-
- // Iterate over all affected values for this loop and insert Phi nodes
- // for them in the appropriate exit blocks
-
- for (SetVector<Instruction*>::iterator I = AffectedValues.begin(),
- E = AffectedValues.end(); I != E; ++I)
- ProcessInstruction(*I, exitBlocks);
-
- assert(L->isLCSSAForm());
-
- return true;
-}
-
-/// processInstruction - Given a live-out instruction, insert LCSSA Phi nodes,
-/// eliminate all out-of-loop uses.
-void LCSSA::ProcessInstruction(Instruction *Instr,
- const SmallVector<BasicBlock*, 8>& exitBlocks) {
- ++NumLCSSA; // We are applying the transformation
-
- // Keep track of the blocks that have the value available already.
- std::map<DomTreeNode*, Value*> Phis;
-
- DomTreeNode *InstrNode = DT->getNode(Instr->getParent());
-
- // Insert the LCSSA phi's into the exit blocks (dominated by the value), and
- // add them to the Phi's map.
- for (SmallVector<BasicBlock*, 8>::const_iterator BBI = exitBlocks.begin(),
- BBE = exitBlocks.end(); BBI != BBE; ++BBI) {
- BasicBlock *BB = *BBI;
- DomTreeNode *ExitBBNode = DT->getNode(BB);
- Value *&Phi = Phis[ExitBBNode];
- if (!Phi && DT->dominates(InstrNode, ExitBBNode)) {
- PHINode *PN = PHINode::Create(Instr->getType(), Instr->getName()+".lcssa",
- BB->begin());
- PN->reserveOperandSpace(std::distance(pred_begin(BB), pred_end(BB)));
-
- // Remember that this phi makes the value alive in this block.
- Phi = PN;
-
- // Add inputs from inside the loop for this PHI.
- for (pred_iterator PI = pred_begin(BB), E = pred_end(BB); PI != E; ++PI)
- PN->addIncoming(Instr, *PI);
- }
- }
-
-
- // Record all uses of Instr outside the loop. We need to rewrite these. The
- // LCSSA phis won't be included because they use the value in the loop.
- for (Value::use_iterator UI = Instr->use_begin(), E = Instr->use_end();
- UI != E;) {
- BasicBlock *UserBB = cast<Instruction>(*UI)->getParent();
- if (PHINode *P = dyn_cast<PHINode>(*UI)) {
- unsigned OperandNo = UI.getOperandNo();
- UserBB = P->getIncomingBlock(OperandNo/2);
- }
-
- // If the user is in the loop, don't rewrite it!
- if (UserBB == Instr->getParent() || inLoop(UserBB)) {
- ++UI;
- continue;
- }
-
- // Otherwise, patch up uses of the value with the appropriate LCSSA Phi,
- // inserting PHI nodes into join points where needed.
- Value *Val = GetValueForBlock(DT->getNode(UserBB), Instr, Phis);
-
- // Preincrement the iterator to avoid invalidating it when we change the
- // value.
- Use &U = UI.getUse();
- ++UI;
- U.set(Val);
- }
-}
-
-/// getLoopValuesUsedOutsideLoop - Return any values defined in the loop that
-/// are used by instructions outside of it.
-void LCSSA::getLoopValuesUsedOutsideLoop(Loop *L,
- SetVector<Instruction*> &AffectedValues) {
- // FIXME: For large loops, we may be able to avoid a lot of use-scanning
- // by using dominance information. In particular, if a block does not
- // dominate any of the loop exits, then none of the values defined in the
- // block could be used outside the loop.
- for (Loop::block_iterator BB = L->block_begin(), E = L->block_end();
- BB != E; ++BB) {
- for (BasicBlock::iterator I = (*BB)->begin(), E = (*BB)->end(); I != E; ++I)
- for (Value::use_iterator UI = I->use_begin(), E = I->use_end(); UI != E;
- ++UI) {
- BasicBlock *UserBB = cast<Instruction>(*UI)->getParent();
- if (PHINode* p = dyn_cast<PHINode>(*UI)) {
- unsigned OperandNo = UI.getOperandNo();
- UserBB = p->getIncomingBlock(OperandNo/2);
- }
-
- if (*BB != UserBB && !inLoop(UserBB)) {
- const StructType *STy = dyn_cast<StructType>(I->getType());
- if (STy) {
- // I is a call or an invoke that returns multiple values.
- // These values are accessible through getresult only.
- // If the getresult value is not in the BB then move it
- // immediately here. It will be processed in next iteration.
- BasicBlock::iterator InsertPoint;
- if (InvokeInst *II = dyn_cast<InvokeInst>(I)) {
- InsertPoint = II->getNormalDest()->begin();
- while (isa<PHINode>(InsertPoint))
- ++InsertPoint;
- } else {
- InsertPoint = I;
- InsertPoint++;
- }
- for (Value::use_iterator TmpI = I->use_begin(),
- TmpE = I->use_end(); TmpI != TmpE; ++TmpI) {
- GetResultInst *GR = cast<GetResultInst>(TmpI);
- if (GR->getParent() != *BB)
- GR->moveBefore(InsertPoint);
- }
- } else
- AffectedValues.insert(I);
- break;
- }
- }
- }
-}
-
-/// GetValueForBlock - Get the value to use within the specified basic block.
-/// available values are in Phis.
-Value *LCSSA::GetValueForBlock(DomTreeNode *BB, Instruction *OrigInst,
- std::map<DomTreeNode*, Value*> &Phis) {
- // If there is no dominator info for this BB, it is unreachable.
- if (BB == 0)
- return UndefValue::get(OrigInst->getType());
-
- // If we have already computed this value, return the previously computed val.
- Value *&V = Phis[BB];
- if (V) return V;
-
- DomTreeNode *IDom = BB->getIDom();
-
- // Otherwise, there are two cases: we either have to insert a PHI node or we
- // don't. We need to insert a PHI node if this block is not dominated by one
- // of the exit nodes from the loop (the loop could have multiple exits, and
- // though the value defined *inside* the loop dominated all its uses, each
- // exit by itself may not dominate all the uses).
- //
- // The simplest way to check for this condition is by checking to see if the
- // idom is in the loop. If so, we *know* that none of the exit blocks
- // dominate this block. Note that we *know* that the block defining the
- // original instruction is in the idom chain, because if it weren't, then the
- // original value didn't dominate this use.
- if (!inLoop(IDom->getBlock())) {
- // Idom is not in the loop, we must still be "below" the exit block and must
- // be fully dominated by the value live in the idom.
- return V = GetValueForBlock(IDom, OrigInst, Phis);
- }
-
- BasicBlock *BBN = BB->getBlock();
-
- // Otherwise, the idom is the loop, so we need to insert a PHI node. Do so
- // now, then get values to fill in the incoming values for the PHI.
- PHINode *PN = PHINode::Create(OrigInst->getType(), OrigInst->getName()+".lcssa",
- BBN->begin());
- PN->reserveOperandSpace(std::distance(pred_begin(BBN), pred_end(BBN)));
- V = PN;
-
- // Fill in the incoming values for the block.
- for (pred_iterator PI = pred_begin(BBN), E = pred_end(BBN); PI != E; ++PI)
- PN->addIncoming(GetValueForBlock(DT->getNode(*PI), OrigInst, Phis), *PI);
- return PN;
-}
-
diff --git a/release_23/lib/Transforms/Utils/Local.cpp b/release_23/lib/Transforms/Utils/Local.cpp
deleted file mode 100644
index 0f7d02c8886e..000000000000
--- a/release_23/lib/Transforms/Utils/Local.cpp
+++ /dev/null
@@ -1,202 +0,0 @@
-//===-- Local.cpp - Functions to perform local transformations ------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This family of functions perform various local transformations to the
-// program.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Transforms/Utils/Local.h"
-#include "llvm/Constants.h"
-#include "llvm/DerivedTypes.h"
-#include "llvm/Instructions.h"
-#include "llvm/Intrinsics.h"
-#include "llvm/IntrinsicInst.h"
-#include "llvm/Analysis/ConstantFolding.h"
-#include "llvm/Target/TargetData.h"
-#include "llvm/Support/GetElementPtrTypeIterator.h"
-#include "llvm/Support/MathExtras.h"
-#include <cerrno>
-using namespace llvm;
-
-//===----------------------------------------------------------------------===//
-// Local constant propagation...
-//
-
-/// doConstantPropagation - If an instruction references constants, try to fold
-/// them together...
-///
-bool llvm::doConstantPropagation(BasicBlock::iterator &II,
- const TargetData *TD) {
- if (Constant *C = ConstantFoldInstruction(II, TD)) {
- // Replaces all of the uses of a variable with uses of the constant.
- II->replaceAllUsesWith(C);
-
- // Remove the instruction from the basic block...
- II = II->getParent()->getInstList().erase(II);
- return true;
- }
-
- return false;
-}
-
-// ConstantFoldTerminator - If a terminator instruction is predicated on a
-// constant value, convert it into an unconditional branch to the constant
-// destination.
-//
-bool llvm::ConstantFoldTerminator(BasicBlock *BB) {
- TerminatorInst *T = BB->getTerminator();
-
- // Branch - See if we are conditional jumping on constant
- if (BranchInst *BI = dyn_cast<BranchInst>(T)) {
- if (BI->isUnconditional()) return false; // Can't optimize uncond branch
- BasicBlock *Dest1 = cast<BasicBlock>(BI->getOperand(0));
- BasicBlock *Dest2 = cast<BasicBlock>(BI->getOperand(1));
-
- if (ConstantInt *Cond = dyn_cast<ConstantInt>(BI->getCondition())) {
- // Are we branching on constant?
- // YES. Change to unconditional branch...
- BasicBlock *Destination = Cond->getZExtValue() ? Dest1 : Dest2;
- BasicBlock *OldDest = Cond->getZExtValue() ? Dest2 : Dest1;
-
- //cerr << "Function: " << T->getParent()->getParent()
- // << "\nRemoving branch from " << T->getParent()
- // << "\n\nTo: " << OldDest << endl;
-
- // Let the basic block know that we are letting go of it. Based on this,
- // it will adjust it's PHI nodes.
- assert(BI->getParent() && "Terminator not inserted in block!");
- OldDest->removePredecessor(BI->getParent());
-
- // Set the unconditional destination, and change the insn to be an
- // unconditional branch.
- BI->setUnconditionalDest(Destination);
- return true;
- } else if (Dest2 == Dest1) { // Conditional branch to same location?
- // This branch matches something like this:
- // br bool %cond, label %Dest, label %Dest
- // and changes it into: br label %Dest
-
- // Let the basic block know that we are letting go of one copy of it.
- assert(BI->getParent() && "Terminator not inserted in block!");
- Dest1->removePredecessor(BI->getParent());
-
- // Change a conditional branch to unconditional.
- BI->setUnconditionalDest(Dest1);
- return true;
- }
- } else if (SwitchInst *SI = dyn_cast<SwitchInst>(T)) {
- // If we are switching on a constant, we can convert the switch into a
- // single branch instruction!
- ConstantInt *CI = dyn_cast<ConstantInt>(SI->getCondition());
- BasicBlock *TheOnlyDest = SI->getSuccessor(0); // The default dest
- BasicBlock *DefaultDest = TheOnlyDest;
- assert(TheOnlyDest == SI->getDefaultDest() &&
- "Default destination is not successor #0?");
-
- // Figure out which case it goes to...
- for (unsigned i = 1, e = SI->getNumSuccessors(); i != e; ++i) {
- // Found case matching a constant operand?
- if (SI->getSuccessorValue(i) == CI) {
- TheOnlyDest = SI->getSuccessor(i);
- break;
- }
-
- // Check to see if this branch is going to the same place as the default
- // dest. If so, eliminate it as an explicit compare.
- if (SI->getSuccessor(i) == DefaultDest) {
- // Remove this entry...
- DefaultDest->removePredecessor(SI->getParent());
- SI->removeCase(i);
- --i; --e; // Don't skip an entry...
- continue;
- }
-
- // Otherwise, check to see if the switch only branches to one destination.
- // We do this by reseting "TheOnlyDest" to null when we find two non-equal
- // destinations.
- if (SI->getSuccessor(i) != TheOnlyDest) TheOnlyDest = 0;
- }
-
- if (CI && !TheOnlyDest) {
- // Branching on a constant, but not any of the cases, go to the default
- // successor.
- TheOnlyDest = SI->getDefaultDest();
- }
-
- // If we found a single destination that we can fold the switch into, do so
- // now.
- if (TheOnlyDest) {
- // Insert the new branch..
- BranchInst::Create(TheOnlyDest, SI);
- BasicBlock *BB = SI->getParent();
-
- // Remove entries from PHI nodes which we no longer branch to...
- for (unsigned i = 0, e = SI->getNumSuccessors(); i != e; ++i) {
- // Found case matching a constant operand?
- BasicBlock *Succ = SI->getSuccessor(i);
- if (Succ == TheOnlyDest)
- TheOnlyDest = 0; // Don't modify the first branch to TheOnlyDest
- else
- Succ->removePredecessor(BB);
- }
-
- // Delete the old switch...
- BB->getInstList().erase(SI);
- return true;
- } else if (SI->getNumSuccessors() == 2) {
- // Otherwise, we can fold this switch into a conditional branch
- // instruction if it has only one non-default destination.
- Value *Cond = new ICmpInst(ICmpInst::ICMP_EQ, SI->getCondition(),
- SI->getSuccessorValue(1), "cond", SI);
- // Insert the new branch...
- BranchInst::Create(SI->getSuccessor(1), SI->getSuccessor(0), Cond, SI);
-
- // Delete the old switch...
- SI->getParent()->getInstList().erase(SI);
- return true;
- }
- }
- return false;
-}
-
-
-//===----------------------------------------------------------------------===//
-// Local dead code elimination...
-//
-
-bool llvm::isInstructionTriviallyDead(Instruction *I) {
- if (!I->use_empty() || isa<TerminatorInst>(I)) return false;
-
- if (!I->mayWriteToMemory())
- return true;
-
- // Special case intrinsics that "may write to memory" but can be deleted when
- // dead.
- if (IntrinsicInst *II = dyn_cast<IntrinsicInst>(I))
- // Safe to delete llvm.stacksave if dead.
- if (II->getIntrinsicID() == Intrinsic::stacksave)
- return true;
-
- return false;
-}
-
-// dceInstruction - Inspect the instruction at *BBI and figure out if it's
-// [trivially] dead. If so, remove the instruction and update the iterator
-// to point to the instruction that immediately succeeded the original
-// instruction.
-//
-bool llvm::dceInstruction(BasicBlock::iterator &BBI) {
- // Look for un"used" definitions...
- if (isInstructionTriviallyDead(BBI)) {
- BBI = BBI->getParent()->getInstList().erase(BBI); // Bye bye
- return true;
- }
- return false;
-}
diff --git a/release_23/lib/Transforms/Utils/LoopSimplify.cpp b/release_23/lib/Transforms/Utils/LoopSimplify.cpp
deleted file mode 100644
index 8e30e0428629..000000000000
--- a/release_23/lib/Transforms/Utils/LoopSimplify.cpp
+++ /dev/null
@@ -1,597 +0,0 @@
-//===- LoopSimplify.cpp - Loop Canonicalization Pass ----------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This pass performs several transformations to transform natural loops into a
-// simpler form, which makes subsequent analyses and transformations simpler and
-// more effective.
-//
-// Loop pre-header insertion guarantees that there is a single, non-critical
-// entry edge from outside of the loop to the loop header. This simplifies a
-// number of analyses and transformations, such as LICM.
-//
-// Loop exit-block insertion guarantees that all exit blocks from the loop
-// (blocks which are outside of the loop that have predecessors inside of the
-// loop) only have predecessors from inside of the loop (and are thus dominated
-// by the loop header). This simplifies transformations such as store-sinking
-// that are built into LICM.
-//
-// This pass also guarantees that loops will have exactly one backedge.
-//
-// Note that the simplifycfg pass will clean up blocks which are split out but
-// end up being unnecessary, so usage of this pass should not pessimize
-// generated code.
-//
-// This pass obviously modifies the CFG, but updates loop information and
-// dominator information.
-//
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "loopsimplify"
-#include "llvm/Transforms/Scalar.h"
-#include "llvm/Constants.h"
-#include "llvm/Instructions.h"
-#include "llvm/Function.h"
-#include "llvm/Type.h"
-#include "llvm/Analysis/AliasAnalysis.h"
-#include "llvm/Analysis/Dominators.h"
-#include "llvm/Analysis/LoopInfo.h"
-#include "llvm/Transforms/Utils/BasicBlockUtils.h"
-#include "llvm/Support/CFG.h"
-#include "llvm/Support/Compiler.h"
-#include "llvm/ADT/SetOperations.h"
-#include "llvm/ADT/SetVector.h"
-#include "llvm/ADT/Statistic.h"
-#include "llvm/ADT/DepthFirstIterator.h"
-using namespace llvm;
-
-STATISTIC(NumInserted, "Number of pre-header or exit blocks inserted");
-STATISTIC(NumNested , "Number of nested loops split out");
-
-namespace {
- struct VISIBILITY_HIDDEN LoopSimplify : public FunctionPass {
- static char ID; // Pass identification, replacement for typeid
- LoopSimplify() : FunctionPass((intptr_t)&ID) {}
-
- // AA - If we have an alias analysis object to update, this is it, otherwise
- // this is null.
- AliasAnalysis *AA;
- LoopInfo *LI;
- DominatorTree *DT;
- virtual bool runOnFunction(Function &F);
-
- virtual void getAnalysisUsage(AnalysisUsage &AU) const {
- // We need loop information to identify the loops...
- AU.addRequired<LoopInfo>();
- AU.addRequired<DominatorTree>();
-
- AU.addPreserved<LoopInfo>();
- AU.addPreserved<DominatorTree>();
- AU.addPreserved<DominanceFrontier>();
- AU.addPreservedID(BreakCriticalEdgesID); // No critical edges added.
- }
-
- /// verifyAnalysis() - Verify loop nest.
- void verifyAnalysis() const {
-#ifndef NDEBUG
- LoopInfo *NLI = &getAnalysis<LoopInfo>();
- for (LoopInfo::iterator I = NLI->begin(), E = NLI->end(); I != E; ++I)
- (*I)->verifyLoop();
-#endif
- }
-
- private:
- bool ProcessLoop(Loop *L);
- BasicBlock *RewriteLoopExitBlock(Loop *L, BasicBlock *Exit);
- void InsertPreheaderForLoop(Loop *L);
- Loop *SeparateNestedLoop(Loop *L);
- void InsertUniqueBackedgeBlock(Loop *L);
- void PlaceSplitBlockCarefully(BasicBlock *NewBB,
- SmallVectorImpl<BasicBlock*> &SplitPreds,
- Loop *L);
- };
-
- char LoopSimplify::ID = 0;
- RegisterPass<LoopSimplify>
- X("loopsimplify", "Canonicalize natural loops", true);
-}
-
-// Publically exposed interface to pass...
-const PassInfo *llvm::LoopSimplifyID = X.getPassInfo();
-FunctionPass *llvm::createLoopSimplifyPass() { return new LoopSimplify(); }
-
-/// runOnFunction - Run down all loops in the CFG (recursively, but we could do
-/// it in any convenient order) inserting preheaders...
-///
-bool LoopSimplify::runOnFunction(Function &F) {
- bool Changed = false;
- LI = &getAnalysis<LoopInfo>();
- AA = getAnalysisToUpdate<AliasAnalysis>();
- DT = &getAnalysis<DominatorTree>();
-
- // Check to see that no blocks (other than the header) in loops have
- // predecessors that are not in loops. This is not valid for natural loops,
- // but can occur if the blocks are unreachable. Since they are unreachable we
- // can just shamelessly destroy their terminators to make them not branch into
- // the loop!
- for (Function::iterator BB = F.begin(), E = F.end(); BB != E; ++BB) {
- // This case can only occur for unreachable blocks. Blocks that are
- // unreachable can't be in loops, so filter those blocks out.
- if (LI->getLoopFor(BB)) continue;
-
- bool BlockUnreachable = false;
- TerminatorInst *TI = BB->getTerminator();
-
- // Check to see if any successors of this block are non-loop-header loops
- // that are not the header.
- for (unsigned i = 0, e = TI->getNumSuccessors(); i != e; ++i) {
- // If this successor is not in a loop, BB is clearly ok.
- Loop *L = LI->getLoopFor(TI->getSuccessor(i));
- if (!L) continue;
-
- // If the succ is the loop header, and if L is a top-level loop, then this
- // is an entrance into a loop through the header, which is also ok.
- if (L->getHeader() == TI->getSuccessor(i) && L->getParentLoop() == 0)
- continue;
-
- // Otherwise, this is an entrance into a loop from some place invalid.
- // Either the loop structure is invalid and this is not a natural loop (in
- // which case the compiler is buggy somewhere else) or BB is unreachable.
- BlockUnreachable = true;
- break;
- }
-
- // If this block is ok, check the next one.
- if (!BlockUnreachable) continue;
-
- // Otherwise, this block is dead. To clean up the CFG and to allow later
- // loop transformations to ignore this case, we delete the edges into the
- // loop by replacing the terminator.
-
- // Remove PHI entries from the successors.
- for (unsigned i = 0, e = TI->getNumSuccessors(); i != e; ++i)
- TI->getSuccessor(i)->removePredecessor(BB);
-
- // Add a new unreachable instruction before the old terminator.
- new UnreachableInst(TI);
-
- // Delete the dead terminator.
- if (AA) AA->deleteValue(TI);
- if (!TI->use_empty())
- TI->replaceAllUsesWith(UndefValue::get(TI->getType()));
- TI->eraseFromParent();
- Changed |= true;
- }
-
- for (LoopInfo::iterator I = LI->begin(), E = LI->end(); I != E; ++I)
- Changed |= ProcessLoop(*I);
-
- return Changed;
-}
-
-/// ProcessLoop - Walk the loop structure in depth first order, ensuring that
-/// all loops have preheaders.
-///
-bool LoopSimplify::ProcessLoop(Loop *L) {
- bool Changed = false;
-ReprocessLoop:
-
- // Canonicalize inner loops before outer loops. Inner loop canonicalization
- // can provide work for the outer loop to canonicalize.
- for (Loop::iterator I = L->begin(), E = L->end(); I != E; ++I)
- Changed |= ProcessLoop(*I);
-
- assert(L->getBlocks()[0] == L->getHeader() &&
- "Header isn't first block in loop?");
-
- // Does the loop already have a preheader? If so, don't insert one.
- if (L->getLoopPreheader() == 0) {
- InsertPreheaderForLoop(L);
- NumInserted++;
- Changed = true;
- }
-
- // Next, check to make sure that all exit nodes of the loop only have
- // predecessors that are inside of the loop. This check guarantees that the
- // loop preheader/header will dominate the exit blocks. If the exit block has
- // predecessors from outside of the loop, split the edge now.
- SmallVector<BasicBlock*, 8> ExitBlocks;
- L->getExitBlocks(ExitBlocks);
-
- SetVector<BasicBlock*> ExitBlockSet(ExitBlocks.begin(), ExitBlocks.end());
- for (SetVector<BasicBlock*>::iterator I = ExitBlockSet.begin(),
- E = ExitBlockSet.end(); I != E; ++I) {
- BasicBlock *ExitBlock = *I;
- for (pred_iterator PI = pred_begin(ExitBlock), PE = pred_end(ExitBlock);
- PI != PE; ++PI)
- // Must be exactly this loop: no subloops, parent loops, or non-loop preds
- // allowed.
- if (!L->contains(*PI)) {
- RewriteLoopExitBlock(L, ExitBlock);
- NumInserted++;
- Changed = true;
- break;
- }
- }
-
- // If the header has more than two predecessors at this point (from the
- // preheader and from multiple backedges), we must adjust the loop.
- unsigned NumBackedges = L->getNumBackEdges();
- if (NumBackedges != 1) {
- // If this is really a nested loop, rip it out into a child loop. Don't do
- // this for loops with a giant number of backedges, just factor them into a
- // common backedge instead.
- if (NumBackedges < 8) {
- if (Loop *NL = SeparateNestedLoop(L)) {
- ++NumNested;
- // This is a big restructuring change, reprocess the whole loop.
- ProcessLoop(NL);
- Changed = true;
- // GCC doesn't tail recursion eliminate this.
- goto ReprocessLoop;
- }
- }
-
- // If we either couldn't, or didn't want to, identify nesting of the loops,
- // insert a new block that all backedges target, then make it jump to the
- // loop header.
- InsertUniqueBackedgeBlock(L);
- NumInserted++;
- Changed = true;
- }
-
- // Scan over the PHI nodes in the loop header. Since they now have only two
- // incoming values (the loop is canonicalized), we may have simplified the PHI
- // down to 'X = phi [X, Y]', which should be replaced with 'Y'.
- PHINode *PN;
- for (BasicBlock::iterator I = L->getHeader()->begin();
- (PN = dyn_cast<PHINode>(I++)); )
- if (Value *V = PN->hasConstantValue()) {
- PN->replaceAllUsesWith(V);
- PN->eraseFromParent();
- }
-
- return Changed;
-}
-
-/// InsertPreheaderForLoop - Once we discover that a loop doesn't have a
-/// preheader, this method is called to insert one. This method has two phases:
-/// preheader insertion and analysis updating.
-///
-void LoopSimplify::InsertPreheaderForLoop(Loop *L) {
- BasicBlock *Header = L->getHeader();
-
- // Compute the set of predecessors of the loop that are not in the loop.
- SmallVector<BasicBlock*, 8> OutsideBlocks;
- for (pred_iterator PI = pred_begin(Header), PE = pred_end(Header);
- PI != PE; ++PI)
- if (!L->contains(*PI)) // Coming in from outside the loop?
- OutsideBlocks.push_back(*PI); // Keep track of it...
-
- // Split out the loop pre-header.
- BasicBlock *NewBB =
- SplitBlockPredecessors(Header, &OutsideBlocks[0], OutsideBlocks.size(),
- ".preheader", this);
-
-
- //===--------------------------------------------------------------------===//
- // Update analysis results now that we have performed the transformation
- //
-
- // We know that we have loop information to update... update it now.
- if (Loop *Parent = L->getParentLoop())
- Parent->addBasicBlockToLoop(NewBB, LI->getBase());
-
- // Make sure that NewBB is put someplace intelligent, which doesn't mess up
- // code layout too horribly.
- PlaceSplitBlockCarefully(NewBB, OutsideBlocks, L);
-}
-
-/// RewriteLoopExitBlock - Ensure that the loop preheader dominates all exit
-/// blocks. This method is used to split exit blocks that have predecessors
-/// outside of the loop.
-BasicBlock *LoopSimplify::RewriteLoopExitBlock(Loop *L, BasicBlock *Exit) {
- SmallVector<BasicBlock*, 8> LoopBlocks;
- for (pred_iterator I = pred_begin(Exit), E = pred_end(Exit); I != E; ++I)
- if (L->contains(*I))
- LoopBlocks.push_back(*I);
-
- assert(!LoopBlocks.empty() && "No edges coming in from outside the loop?");
- BasicBlock *NewBB = SplitBlockPredecessors(Exit, &LoopBlocks[0],
- LoopBlocks.size(), ".loopexit",
- this);
-
- // Update Loop Information - we know that the new block will be in whichever
- // loop the Exit block is in. Note that it may not be in that immediate loop,
- // if the successor is some other loop header. In that case, we continue
- // walking up the loop tree to find a loop that contains both the successor
- // block and the predecessor block.
- Loop *SuccLoop = LI->getLoopFor(Exit);
- while (SuccLoop && !SuccLoop->contains(L->getHeader()))
- SuccLoop = SuccLoop->getParentLoop();
- if (SuccLoop)
- SuccLoop->addBasicBlockToLoop(NewBB, LI->getBase());
-
- return NewBB;
-}
-
-/// AddBlockAndPredsToSet - Add the specified block, and all of its
-/// predecessors, to the specified set, if it's not already in there. Stop
-/// predecessor traversal when we reach StopBlock.
-static void AddBlockAndPredsToSet(BasicBlock *InputBB, BasicBlock *StopBlock,
- std::set<BasicBlock*> &Blocks) {
- std::vector<BasicBlock *> WorkList;
- WorkList.push_back(InputBB);
- do {
- BasicBlock *BB = WorkList.back(); WorkList.pop_back();
- if (Blocks.insert(BB).second && BB != StopBlock)
- // If BB is not already processed and it is not a stop block then
- // insert its predecessor in the work list
- for (pred_iterator I = pred_begin(BB), E = pred_end(BB); I != E; ++I) {
- BasicBlock *WBB = *I;
- WorkList.push_back(WBB);
- }
- } while(!WorkList.empty());
-}
-
-/// FindPHIToPartitionLoops - The first part of loop-nestification is to find a
-/// PHI node that tells us how to partition the loops.
-static PHINode *FindPHIToPartitionLoops(Loop *L, DominatorTree *DT,
- AliasAnalysis *AA) {
- for (BasicBlock::iterator I = L->getHeader()->begin(); isa<PHINode>(I); ) {
- PHINode *PN = cast<PHINode>(I);
- ++I;
- if (Value *V = PN->hasConstantValue())
- if (!isa<Instruction>(V) || DT->dominates(cast<Instruction>(V), PN)) {
- // This is a degenerate PHI already, don't modify it!
- PN->replaceAllUsesWith(V);
- if (AA) AA->deleteValue(PN);
- PN->eraseFromParent();
- continue;
- }
-
- // Scan this PHI node looking for a use of the PHI node by itself.
- for (unsigned i = 0, e = PN->getNumIncomingValues(); i != e; ++i)
- if (PN->getIncomingValue(i) == PN &&
- L->contains(PN->getIncomingBlock(i)))
- // We found something tasty to remove.
- return PN;
- }
- return 0;
-}
-
-// PlaceSplitBlockCarefully - If the block isn't already, move the new block to
-// right after some 'outside block' block. This prevents the preheader from
-// being placed inside the loop body, e.g. when the loop hasn't been rotated.
-void LoopSimplify::PlaceSplitBlockCarefully(BasicBlock *NewBB,
- SmallVectorImpl<BasicBlock*> &SplitPreds,
- Loop *L) {
- // Check to see if NewBB is already well placed.
- Function::iterator BBI = NewBB; --BBI;
- for (unsigned i = 0, e = SplitPreds.size(); i != e; ++i) {
- if (&*BBI == SplitPreds[i])
- return;
- }
-
- // If it isn't already after an outside block, move it after one. This is
- // always good as it makes the uncond branch from the outside block into a
- // fall-through.
-
- // Figure out *which* outside block to put this after. Prefer an outside
- // block that neighbors a BB actually in the loop.
- BasicBlock *FoundBB = 0;
- for (unsigned i = 0, e = SplitPreds.size(); i != e; ++i) {
- Function::iterator BBI = SplitPreds[i];
- if (++BBI != NewBB->getParent()->end() &&
- L->contains(BBI)) {
- FoundBB = SplitPreds[i];
- break;
- }
- }
-
- // If our heuristic for a *good* bb to place this after doesn't find
- // anything, just pick something. It's likely better than leaving it within
- // the loop.
- if (!FoundBB)
- FoundBB = SplitPreds[0];
- NewBB->moveAfter(FoundBB);
-}
-
-
-/// SeparateNestedLoop - If this loop has multiple backedges, try to pull one of
-/// them out into a nested loop. This is important for code that looks like
-/// this:
-///
-/// Loop:
-/// ...
-/// br cond, Loop, Next
-/// ...
-/// br cond2, Loop, Out
-///
-/// To identify this common case, we look at the PHI nodes in the header of the
-/// loop. PHI nodes with unchanging values on one backedge correspond to values
-/// that change in the "outer" loop, but not in the "inner" loop.
-///
-/// If we are able to separate out a loop, return the new outer loop that was
-/// created.
-///
-Loop *LoopSimplify::SeparateNestedLoop(Loop *L) {
- PHINode *PN = FindPHIToPartitionLoops(L, DT, AA);
- if (PN == 0) return 0; // No known way to partition.
-
- // Pull out all predecessors that have varying values in the loop. This
- // handles the case when a PHI node has multiple instances of itself as
- // arguments.
- SmallVector<BasicBlock*, 8> OuterLoopPreds;
- for (unsigned i = 0, e = PN->getNumIncomingValues(); i != e; ++i)
- if (PN->getIncomingValue(i) != PN ||
- !L->contains(PN->getIncomingBlock(i)))
- OuterLoopPreds.push_back(PN->getIncomingBlock(i));
-
- BasicBlock *Header = L->getHeader();
- BasicBlock *NewBB = SplitBlockPredecessors(Header, &OuterLoopPreds[0],
- OuterLoopPreds.size(),
- ".outer", this);
-
- // Make sure that NewBB is put someplace intelligent, which doesn't mess up
- // code layout too horribly.
- PlaceSplitBlockCarefully(NewBB, OuterLoopPreds, L);
-
- // Create the new outer loop.
- Loop *NewOuter = new Loop();
-
- // Change the parent loop to use the outer loop as its child now.
- if (Loop *Parent = L->getParentLoop())
- Parent->replaceChildLoopWith(L, NewOuter);
- else
- LI->changeTopLevelLoop(L, NewOuter);
-
- // This block is going to be our new header block: add it to this loop and all
- // parent loops.
- NewOuter->addBasicBlockToLoop(NewBB, LI->getBase());
-
- // L is now a subloop of our outer loop.
- NewOuter->addChildLoop(L);
-
- for (unsigned i = 0, e = L->getBlocks().size(); i != e; ++i)
- NewOuter->addBlockEntry(L->getBlocks()[i]);
-
- // Determine which blocks should stay in L and which should be moved out to
- // the Outer loop now.
- std::set<BasicBlock*> BlocksInL;
- for (pred_iterator PI = pred_begin(Header), E = pred_end(Header); PI!=E; ++PI)
- if (DT->dominates(Header, *PI))
- AddBlockAndPredsToSet(*PI, Header, BlocksInL);
-
-
- // Scan all of the loop children of L, moving them to OuterLoop if they are
- // not part of the inner loop.
- const std::vector<Loop*> &SubLoops = L->getSubLoops();
- for (size_t I = 0; I != SubLoops.size(); )
- if (BlocksInL.count(SubLoops[I]->getHeader()))
- ++I; // Loop remains in L
- else
- NewOuter->addChildLoop(L->removeChildLoop(SubLoops.begin() + I));
-
- // Now that we know which blocks are in L and which need to be moved to
- // OuterLoop, move any blocks that need it.
- for (unsigned i = 0; i != L->getBlocks().size(); ++i) {
- BasicBlock *BB = L->getBlocks()[i];
- if (!BlocksInL.count(BB)) {
- // Move this block to the parent, updating the exit blocks sets
- L->removeBlockFromLoop(BB);
- if ((*LI)[BB] == L)
- LI->changeLoopFor(BB, NewOuter);
- --i;
- }
- }
-
- return NewOuter;
-}
-
-
-
-/// InsertUniqueBackedgeBlock - This method is called when the specified loop
-/// has more than one backedge in it. If this occurs, revector all of these
-/// backedges to target a new basic block and have that block branch to the loop
-/// header. This ensures that loops have exactly one backedge.
-///
-void LoopSimplify::InsertUniqueBackedgeBlock(Loop *L) {
- assert(L->getNumBackEdges() > 1 && "Must have > 1 backedge!");
-
- // Get information about the loop
- BasicBlock *Preheader = L->getLoopPreheader();
- BasicBlock *Header = L->getHeader();
- Function *F = Header->getParent();
-
- // Figure out which basic blocks contain back-edges to the loop header.
- std::vector<BasicBlock*> BackedgeBlocks;
- for (pred_iterator I = pred_begin(Header), E = pred_end(Header); I != E; ++I)
- if (*I != Preheader) BackedgeBlocks.push_back(*I);
-
- // Create and insert the new backedge block...
- BasicBlock *BEBlock = BasicBlock::Create(Header->getName()+".backedge", F);
- BranchInst *BETerminator = BranchInst::Create(Header, BEBlock);
-
- // Move the new backedge block to right after the last backedge block.
- Function::iterator InsertPos = BackedgeBlocks.back(); ++InsertPos;
- F->getBasicBlockList().splice(InsertPos, F->getBasicBlockList(), BEBlock);
-
- // Now that the block has been inserted into the function, create PHI nodes in
- // the backedge block which correspond to any PHI nodes in the header block.
- for (BasicBlock::iterator I = Header->begin(); isa<PHINode>(I); ++I) {
- PHINode *PN = cast<PHINode>(I);
- PHINode *NewPN = PHINode::Create(PN->getType(), PN->getName()+".be",
- BETerminator);
- NewPN->reserveOperandSpace(BackedgeBlocks.size());
- if (AA) AA->copyValue(PN, NewPN);
-
- // Loop over the PHI node, moving all entries except the one for the
- // preheader over to the new PHI node.
- unsigned PreheaderIdx = ~0U;
- bool HasUniqueIncomingValue = true;
- Value *UniqueValue = 0;
- for (unsigned i = 0, e = PN->getNumIncomingValues(); i != e; ++i) {
- BasicBlock *IBB = PN->getIncomingBlock(i);
- Value *IV = PN->getIncomingValue(i);
- if (IBB == Preheader) {
- PreheaderIdx = i;
- } else {
- NewPN->addIncoming(IV, IBB);
- if (HasUniqueIncomingValue) {
- if (UniqueValue == 0)
- UniqueValue = IV;
- else if (UniqueValue != IV)
- HasUniqueIncomingValue = false;
- }
- }
- }
-
- // Delete all of the incoming values from the old PN except the preheader's
- assert(PreheaderIdx != ~0U && "PHI has no preheader entry??");
- if (PreheaderIdx != 0) {
- PN->setIncomingValue(0, PN->getIncomingValue(PreheaderIdx));
- PN->setIncomingBlock(0, PN->getIncomingBlock(PreheaderIdx));
- }
- // Nuke all entries except the zero'th.
- for (unsigned i = 0, e = PN->getNumIncomingValues()-1; i != e; ++i)
- PN->removeIncomingValue(e-i, false);
-
- // Finally, add the newly constructed PHI node as the entry for the BEBlock.
- PN->addIncoming(NewPN, BEBlock);
-
- // As an optimization, if all incoming values in the new PhiNode (which is a
- // subset of the incoming values of the old PHI node) have the same value,
- // eliminate the PHI Node.
- if (HasUniqueIncomingValue) {
- NewPN->replaceAllUsesWith(UniqueValue);
- if (AA) AA->deleteValue(NewPN);
- BEBlock->getInstList().erase(NewPN);
- }
- }
-
- // Now that all of the PHI nodes have been inserted and adjusted, modify the
- // backedge blocks to just to the BEBlock instead of the header.
- for (unsigned i = 0, e = BackedgeBlocks.size(); i != e; ++i) {
- TerminatorInst *TI = BackedgeBlocks[i]->getTerminator();
- for (unsigned Op = 0, e = TI->getNumSuccessors(); Op != e; ++Op)
- if (TI->getSuccessor(Op) == Header)
- TI->setSuccessor(Op, BEBlock);
- }
-
- //===--- Update all analyses which we must preserve now -----------------===//
-
- // Update Loop Information - we know that this block is now in the current
- // loop and all parent loops.
- L->addBasicBlockToLoop(BEBlock, LI->getBase());
-
- // Update dominator information
- DT->splitBlock(BEBlock);
- if (DominanceFrontier *DF = getAnalysisToUpdate<DominanceFrontier>())
- DF->splitBlock(BEBlock);
-}
diff --git a/release_23/lib/Transforms/Utils/LowerAllocations.cpp b/release_23/lib/Transforms/Utils/LowerAllocations.cpp
deleted file mode 100644
index 8708f994fee2..000000000000
--- a/release_23/lib/Transforms/Utils/LowerAllocations.cpp
+++ /dev/null
@@ -1,176 +0,0 @@
-//===- LowerAllocations.cpp - Reduce malloc & free insts to calls ---------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// The LowerAllocations transformation is a target-dependent tranformation
-// because it depends on the size of data types and alignment constraints.
-//
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "lowerallocs"
-#include "llvm/Transforms/Scalar.h"
-#include "llvm/Transforms/Utils/UnifyFunctionExitNodes.h"
-#include "llvm/Module.h"
-#include "llvm/DerivedTypes.h"
-#include "llvm/Instructions.h"
-#include "llvm/Constants.h"
-#include "llvm/Pass.h"
-#include "llvm/ADT/Statistic.h"
-#include "llvm/Target/TargetData.h"
-#include "llvm/Support/Compiler.h"
-using namespace llvm;
-
-STATISTIC(NumLowered, "Number of allocations lowered");
-
-namespace {
- /// LowerAllocations - Turn malloc and free instructions into %malloc and
- /// %free calls.
- ///
- class VISIBILITY_HIDDEN LowerAllocations : public BasicBlockPass {
- Constant *MallocFunc; // Functions in the module we are processing
- Constant *FreeFunc; // Initialized by doInitialization
- bool LowerMallocArgToInteger;
- public:
- static char ID; // Pass ID, replacement for typeid
- explicit LowerAllocations(bool LowerToInt = false)
- : BasicBlockPass((intptr_t)&ID), MallocFunc(0), FreeFunc(0),
- LowerMallocArgToInteger(LowerToInt) {}
-
- virtual void getAnalysisUsage(AnalysisUsage &AU) const {
- AU.addRequired<TargetData>();
- AU.setPreservesCFG();
-
- // This is a cluster of orthogonal Transforms:
- AU.addPreserved<UnifyFunctionExitNodes>();
- AU.addPreservedID(PromoteMemoryToRegisterID);
- AU.addPreservedID(LowerSwitchID);
- AU.addPreservedID(LowerInvokePassID);
- }
-
- /// doPassInitialization - For the lower allocations pass, this ensures that
- /// a module contains a declaration for a malloc and a free function.
- ///
- bool doInitialization(Module &M);
-
- virtual bool doInitialization(Function &F) {
- return BasicBlockPass::doInitialization(F);
- }
-
- /// runOnBasicBlock - This method does the actual work of converting
- /// instructions over, assuming that the pass has already been initialized.
- ///
- bool runOnBasicBlock(BasicBlock &BB);
- };
-
- char LowerAllocations::ID = 0;
- RegisterPass<LowerAllocations>
- X("lowerallocs", "Lower allocations from instructions to calls");
-}
-
-// Publically exposed interface to pass...
-const PassInfo *llvm::LowerAllocationsID = X.getPassInfo();
-// createLowerAllocationsPass - Interface to this file...
-Pass *llvm::createLowerAllocationsPass(bool LowerMallocArgToInteger) {
- return new LowerAllocations(LowerMallocArgToInteger);
-}
-
-
-// doInitialization - For the lower allocations pass, this ensures that a
-// module contains a declaration for a malloc and a free function.
-//
-// This function is always successful.
-//
-bool LowerAllocations::doInitialization(Module &M) {
- const Type *BPTy = PointerType::getUnqual(Type::Int8Ty);
- // Prototype malloc as "char* malloc(...)", because we don't know in
- // doInitialization whether size_t is int or long.
- FunctionType *FT = FunctionType::get(BPTy, std::vector<const Type*>(), true);
- MallocFunc = M.getOrInsertFunction("malloc", FT);
- FreeFunc = M.getOrInsertFunction("free" , Type::VoidTy, BPTy, (Type *)0);
- return true;
-}
-
-// runOnBasicBlock - This method does the actual work of converting
-// instructions over, assuming that the pass has already been initialized.
-//
-bool LowerAllocations::runOnBasicBlock(BasicBlock &BB) {
- bool Changed = false;
- assert(MallocFunc && FreeFunc && "Pass not initialized!");
-
- BasicBlock::InstListType &BBIL = BB.getInstList();
-
- const TargetData &TD = getAnalysis<TargetData>();
- const Type *IntPtrTy = TD.getIntPtrType();
-
- // Loop over all of the instructions, looking for malloc or free instructions
- for (BasicBlock::iterator I = BB.begin(), E = BB.end(); I != E; ++I) {
- if (MallocInst *MI = dyn_cast<MallocInst>(I)) {
- const Type *AllocTy = MI->getType()->getElementType();
-
- // malloc(type) becomes sbyte *malloc(size)
- Value *MallocArg;
- if (LowerMallocArgToInteger)
- MallocArg = ConstantInt::get(Type::Int64Ty, TD.getABITypeSize(AllocTy));
- else
- MallocArg = ConstantExpr::getSizeOf(AllocTy);
- MallocArg = ConstantExpr::getTruncOrBitCast(cast<Constant>(MallocArg),
- IntPtrTy);
-
- if (MI->isArrayAllocation()) {
- if (isa<ConstantInt>(MallocArg) &&
- cast<ConstantInt>(MallocArg)->isOne()) {
- MallocArg = MI->getOperand(0); // Operand * 1 = Operand
- } else if (Constant *CO = dyn_cast<Constant>(MI->getOperand(0))) {
- CO = ConstantExpr::getIntegerCast(CO, IntPtrTy, false /*ZExt*/);
- MallocArg = ConstantExpr::getMul(CO, cast<Constant>(MallocArg));
- } else {
- Value *Scale = MI->getOperand(0);
- if (Scale->getType() != IntPtrTy)
- Scale = CastInst::createIntegerCast(Scale, IntPtrTy, false /*ZExt*/,
- "", I);
-
- // Multiply it by the array size if necessary...
- MallocArg = BinaryOperator::create(Instruction::Mul, Scale,
- MallocArg, "", I);
- }
- }
-
- // Create the call to Malloc.
- CallInst *MCall = CallInst::Create(MallocFunc, MallocArg, "", I);
- MCall->setTailCall();
-
- // Create a cast instruction to convert to the right type...
- Value *MCast;
- if (MCall->getType() != Type::VoidTy)
- MCast = new BitCastInst(MCall, MI->getType(), "", I);
- else
- MCast = Constant::getNullValue(MI->getType());
-
- // Replace all uses of the old malloc inst with the cast inst
- MI->replaceAllUsesWith(MCast);
- I = --BBIL.erase(I); // remove and delete the malloc instr...
- Changed = true;
- ++NumLowered;
- } else if (FreeInst *FI = dyn_cast<FreeInst>(I)) {
- Value *PtrCast =
- new BitCastInst(FI->getOperand(0),
- PointerType::getUnqual(Type::Int8Ty), "", I);
-
- // Insert a call to the free function...
- CallInst::Create(FreeFunc, PtrCast, "", I)->setTailCall();
-
- // Delete the old free instruction
- I = --BBIL.erase(I);
- Changed = true;
- ++NumLowered;
- }
- }
-
- return Changed;
-}
-
diff --git a/release_23/lib/Transforms/Utils/LowerInvoke.cpp b/release_23/lib/Transforms/Utils/LowerInvoke.cpp
deleted file mode 100644
index 3d356b78aeea..000000000000
--- a/release_23/lib/Transforms/Utils/LowerInvoke.cpp
+++ /dev/null
@@ -1,615 +0,0 @@
-//===- LowerInvoke.cpp - Eliminate Invoke & Unwind instructions -----------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This transformation is designed for use by code generators which do not yet
-// support stack unwinding. This pass supports two models of exception handling
-// lowering, the 'cheap' support and the 'expensive' support.
-//
-// 'Cheap' exception handling support gives the program the ability to execute
-// any program which does not "throw an exception", by turning 'invoke'
-// instructions into calls and by turning 'unwind' instructions into calls to
-// abort(). If the program does dynamically use the unwind instruction, the
-// program will print a message then abort.
-//
-// 'Expensive' exception handling support gives the full exception handling
-// support to the program at the cost of making the 'invoke' instruction
-// really expensive. It basically inserts setjmp/longjmp calls to emulate the
-// exception handling as necessary.
-//
-// Because the 'expensive' support slows down programs a lot, and EH is only
-// used for a subset of the programs, it must be specifically enabled by an
-// option.
-//
-// Note that after this pass runs the CFG is not entirely accurate (exceptional
-// control flow edges are not correct anymore) so only very simple things should
-// be done after the lowerinvoke pass has run (like generation of native code).
-// This should not be used as a general purpose "my LLVM-to-LLVM pass doesn't
-// support the invoke instruction yet" lowering pass.
-//
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "lowerinvoke"
-#include "llvm/Transforms/Scalar.h"
-#include "llvm/Constants.h"
-#include "llvm/DerivedTypes.h"
-#include "llvm/Instructions.h"
-#include "llvm/Intrinsics.h"
-#include "llvm/Module.h"
-#include "llvm/Pass.h"
-#include "llvm/Transforms/Utils/BasicBlockUtils.h"
-#include "llvm/Transforms/Utils/Local.h"
-#include "llvm/ADT/Statistic.h"
-#include "llvm/Support/CommandLine.h"
-#include "llvm/Support/Compiler.h"
-#include "llvm/Target/TargetLowering.h"
-#include <csetjmp>
-#include <set>
-using namespace llvm;
-
-STATISTIC(NumInvokes, "Number of invokes replaced");
-STATISTIC(NumUnwinds, "Number of unwinds replaced");
-STATISTIC(NumSpilled, "Number of registers live across unwind edges");
-
-static cl::opt<bool> ExpensiveEHSupport("enable-correct-eh-support",
- cl::desc("Make the -lowerinvoke pass insert expensive, but correct, EH code"));
-
-namespace {
- class VISIBILITY_HIDDEN LowerInvoke : public FunctionPass {
- // Used for both models.
- Constant *WriteFn;
- Constant *AbortFn;
- Value *AbortMessage;
- unsigned AbortMessageLength;
-
- // Used for expensive EH support.
- const Type *JBLinkTy;
- GlobalVariable *JBListHead;
- Constant *SetJmpFn, *LongJmpFn;
-
- // We peek in TLI to grab the target's jmp_buf size and alignment
- const TargetLowering *TLI;
-
- public:
- static char ID; // Pass identification, replacement for typeid
- explicit LowerInvoke(const TargetLowering *tli = NULL)
- : FunctionPass((intptr_t)&ID), TLI(tli) { }
- bool doInitialization(Module &M);
- bool runOnFunction(Function &F);
-
- virtual void getAnalysisUsage(AnalysisUsage &AU) const {
- // This is a cluster of orthogonal Transforms
- AU.addPreservedID(PromoteMemoryToRegisterID);
- AU.addPreservedID(LowerSwitchID);
- AU.addPreservedID(LowerAllocationsID);
- }
-
- private:
- void createAbortMessage(Module *M);
- void writeAbortMessage(Instruction *IB);
- bool insertCheapEHSupport(Function &F);
- void splitLiveRangesLiveAcrossInvokes(std::vector<InvokeInst*> &Invokes);
- void rewriteExpensiveInvoke(InvokeInst *II, unsigned InvokeNo,
- AllocaInst *InvokeNum, SwitchInst *CatchSwitch);
- bool insertExpensiveEHSupport(Function &F);
- };
-
- char LowerInvoke::ID = 0;
- RegisterPass<LowerInvoke>
- X("lowerinvoke", "Lower invoke and unwind, for unwindless code generators");
-}
-
-const PassInfo *llvm::LowerInvokePassID = X.getPassInfo();
-
-// Public Interface To the LowerInvoke pass.
-FunctionPass *llvm::createLowerInvokePass(const TargetLowering *TLI) {
- return new LowerInvoke(TLI);
-}
-
-// doInitialization - Make sure that there is a prototype for abort in the
-// current module.
-bool LowerInvoke::doInitialization(Module &M) {
- const Type *VoidPtrTy = PointerType::getUnqual(Type::Int8Ty);
- AbortMessage = 0;
- if (ExpensiveEHSupport) {
- // Insert a type for the linked list of jump buffers.
- unsigned JBSize = TLI ? TLI->getJumpBufSize() : 0;
- JBSize = JBSize ? JBSize : 200;
- const Type *JmpBufTy = ArrayType::get(VoidPtrTy, JBSize);
-
- { // The type is recursive, so use a type holder.
- std::vector<const Type*> Elements;
- Elements.push_back(JmpBufTy);
- OpaqueType *OT = OpaqueType::get();
- Elements.push_back(PointerType::getUnqual(OT));
- PATypeHolder JBLType(StructType::get(Elements));
- OT->refineAbstractTypeTo(JBLType.get()); // Complete the cycle.
- JBLinkTy = JBLType.get();
- M.addTypeName("llvm.sjljeh.jmpbufty", JBLinkTy);
- }
-
- const Type *PtrJBList = PointerType::getUnqual(JBLinkTy);
-
- // Now that we've done that, insert the jmpbuf list head global, unless it
- // already exists.
- if (!(JBListHead = M.getGlobalVariable("llvm.sjljeh.jblist", PtrJBList))) {
- JBListHead = new GlobalVariable(PtrJBList, false,
- GlobalValue::LinkOnceLinkage,
- Constant::getNullValue(PtrJBList),
- "llvm.sjljeh.jblist", &M);
- }
-
-// VisualStudio defines setjmp as _setjmp via #include <csetjmp> / <setjmp.h>,
-// so it looks like Intrinsic::_setjmp
-#if defined(_MSC_VER) && defined(setjmp)
-#define setjmp_undefined_for_visual_studio
-#undef setjmp
-#endif
-
- SetJmpFn = Intrinsic::getDeclaration(&M, Intrinsic::setjmp);
-
-#if defined(_MSC_VER) && defined(setjmp_undefined_for_visual_studio)
-// let's return it to _setjmp state in case anyone ever needs it after this
-// point under VisualStudio
-#define setjmp _setjmp
-#endif
-
- LongJmpFn = Intrinsic::getDeclaration(&M, Intrinsic::longjmp);
- }
-
- // We need the 'write' and 'abort' functions for both models.
- AbortFn = M.getOrInsertFunction("abort", Type::VoidTy, (Type *)0);
-#if 0 // "write" is Unix-specific.. code is going away soon anyway.
- WriteFn = M.getOrInsertFunction("write", Type::VoidTy, Type::Int32Ty,
- VoidPtrTy, Type::Int32Ty, (Type *)0);
-#else
- WriteFn = 0;
-#endif
- return true;
-}
-
-void LowerInvoke::createAbortMessage(Module *M) {
- if (ExpensiveEHSupport) {
- // The abort message for expensive EH support tells the user that the
- // program 'unwound' without an 'invoke' instruction.
- Constant *Msg =
- ConstantArray::get("ERROR: Exception thrown, but not caught!\n");
- AbortMessageLength = Msg->getNumOperands()-1; // don't include \0
-
- GlobalVariable *MsgGV = new GlobalVariable(Msg->getType(), true,
- GlobalValue::InternalLinkage,
- Msg, "abortmsg", M);
- std::vector<Constant*> GEPIdx(2, Constant::getNullValue(Type::Int32Ty));
- AbortMessage = ConstantExpr::getGetElementPtr(MsgGV, &GEPIdx[0], 2);
- } else {
- // The abort message for cheap EH support tells the user that EH is not
- // enabled.
- Constant *Msg =
- ConstantArray::get("Exception handler needed, but not enabled. Recompile"
- " program with -enable-correct-eh-support.\n");
- AbortMessageLength = Msg->getNumOperands()-1; // don't include \0
-
- GlobalVariable *MsgGV = new GlobalVariable(Msg->getType(), true,
- GlobalValue::InternalLinkage,
- Msg, "abortmsg", M);
- std::vector<Constant*> GEPIdx(2, Constant::getNullValue(Type::Int32Ty));
- AbortMessage = ConstantExpr::getGetElementPtr(MsgGV, &GEPIdx[0], 2);
- }
-}
-
-
-void LowerInvoke::writeAbortMessage(Instruction *IB) {
-#if 0
- if (AbortMessage == 0)
- createAbortMessage(IB->getParent()->getParent()->getParent());
-
- // These are the arguments we WANT...
- Value* Args[3];
- Args[0] = ConstantInt::get(Type::Int32Ty, 2);
- Args[1] = AbortMessage;
- Args[2] = ConstantInt::get(Type::Int32Ty, AbortMessageLength);
- (new CallInst(WriteFn, Args, 3, "", IB))->setTailCall();
-#endif
-}
-
-bool LowerInvoke::insertCheapEHSupport(Function &F) {
- bool Changed = false;
- for (Function::iterator BB = F.begin(), E = F.end(); BB != E; ++BB)
- if (InvokeInst *II = dyn_cast<InvokeInst>(BB->getTerminator())) {
- std::vector<Value*> CallArgs(II->op_begin()+3, II->op_end());
- // Insert a normal call instruction...
- CallInst *NewCall = CallInst::Create(II->getCalledValue(),
- CallArgs.begin(), CallArgs.end(), "",II);
- NewCall->takeName(II);
- NewCall->setCallingConv(II->getCallingConv());
- NewCall->setParamAttrs(II->getParamAttrs());
- II->replaceAllUsesWith(NewCall);
-
- // Insert an unconditional branch to the normal destination.
- BranchInst::Create(II->getNormalDest(), II);
-
- // Remove any PHI node entries from the exception destination.
- II->getUnwindDest()->removePredecessor(BB);
-
- // Remove the invoke instruction now.
- BB->getInstList().erase(II);
-
- ++NumInvokes; Changed = true;
- } else if (UnwindInst *UI = dyn_cast<UnwindInst>(BB->getTerminator())) {
- // Insert a new call to write(2, AbortMessage, AbortMessageLength);
- writeAbortMessage(UI);
-
- // Insert a call to abort()
- CallInst::Create(AbortFn, "", UI)->setTailCall();
-
- // Insert a return instruction. This really should be a "barrier", as it
- // is unreachable.
- ReturnInst::Create(F.getReturnType() == Type::VoidTy ? 0 :
- Constant::getNullValue(F.getReturnType()), UI);
-
- // Remove the unwind instruction now.
- BB->getInstList().erase(UI);
-
- ++NumUnwinds; Changed = true;
- }
- return Changed;
-}
-
-/// rewriteExpensiveInvoke - Insert code and hack the function to replace the
-/// specified invoke instruction with a call.
-void LowerInvoke::rewriteExpensiveInvoke(InvokeInst *II, unsigned InvokeNo,
- AllocaInst *InvokeNum,
- SwitchInst *CatchSwitch) {
- ConstantInt *InvokeNoC = ConstantInt::get(Type::Int32Ty, InvokeNo);
-
- // If the unwind edge has phi nodes, split the edge.
- if (isa<PHINode>(II->getUnwindDest()->begin())) {
- SplitCriticalEdge(II, 1, this);
-
- // If there are any phi nodes left, they must have a single predecessor.
- while (PHINode *PN = dyn_cast<PHINode>(II->getUnwindDest()->begin())) {
- PN->replaceAllUsesWith(PN->getIncomingValue(0));
- PN->eraseFromParent();
- }
- }
-
- // Insert a store of the invoke num before the invoke and store zero into the
- // location afterward.
- new StoreInst(InvokeNoC, InvokeNum, true, II); // volatile
-
- BasicBlock::iterator NI = II->getNormalDest()->begin();
- while (isa<PHINode>(NI)) ++NI;
- // nonvolatile.
- new StoreInst(Constant::getNullValue(Type::Int32Ty), InvokeNum, false, NI);
-
- // Add a switch case to our unwind block.
- CatchSwitch->addCase(InvokeNoC, II->getUnwindDest());
-
- // Insert a normal call instruction.
- std::vector<Value*> CallArgs(II->op_begin()+3, II->op_end());
- CallInst *NewCall = CallInst::Create(II->getCalledValue(),
- CallArgs.begin(), CallArgs.end(), "",
- II);
- NewCall->takeName(II);
- NewCall->setCallingConv(II->getCallingConv());
- NewCall->setParamAttrs(II->getParamAttrs());
- II->replaceAllUsesWith(NewCall);
-
- // Replace the invoke with an uncond branch.
- BranchInst::Create(II->getNormalDest(), NewCall->getParent());
- II->eraseFromParent();
-}
-
-/// MarkBlocksLiveIn - Insert BB and all of its predescessors into LiveBBs until
-/// we reach blocks we've already seen.
-static void MarkBlocksLiveIn(BasicBlock *BB, std::set<BasicBlock*> &LiveBBs) {
- if (!LiveBBs.insert(BB).second) return; // already been here.
-
- for (pred_iterator PI = pred_begin(BB), E = pred_end(BB); PI != E; ++PI)
- MarkBlocksLiveIn(*PI, LiveBBs);
-}
-
-// First thing we need to do is scan the whole function for values that are
-// live across unwind edges. Each value that is live across an unwind edge
-// we spill into a stack location, guaranteeing that there is nothing live
-// across the unwind edge. This process also splits all critical edges
-// coming out of invoke's.
-void LowerInvoke::
-splitLiveRangesLiveAcrossInvokes(std::vector<InvokeInst*> &Invokes) {
- // First step, split all critical edges from invoke instructions.
- for (unsigned i = 0, e = Invokes.size(); i != e; ++i) {
- InvokeInst *II = Invokes[i];
- SplitCriticalEdge(II, 0, this);
- SplitCriticalEdge(II, 1, this);
- assert(!isa<PHINode>(II->getNormalDest()) &&
- !isa<PHINode>(II->getUnwindDest()) &&
- "critical edge splitting left single entry phi nodes?");
- }
-
- Function *F = Invokes.back()->getParent()->getParent();
-
- // To avoid having to handle incoming arguments specially, we lower each arg
- // to a copy instruction in the entry block. This ensures that the argument
- // value itself cannot be live across the entry block.
- BasicBlock::iterator AfterAllocaInsertPt = F->begin()->begin();
- while (isa<AllocaInst>(AfterAllocaInsertPt) &&
- isa<ConstantInt>(cast<AllocaInst>(AfterAllocaInsertPt)->getArraySize()))
- ++AfterAllocaInsertPt;
- for (Function::arg_iterator AI = F->arg_begin(), E = F->arg_end();
- AI != E; ++AI) {
- // This is always a no-op cast because we're casting AI to AI->getType() so
- // src and destination types are identical. BitCast is the only possibility.
- CastInst *NC = new BitCastInst(
- AI, AI->getType(), AI->getName()+".tmp", AfterAllocaInsertPt);
- AI->replaceAllUsesWith(NC);
- // Normally its is forbidden to replace a CastInst's operand because it
- // could cause the opcode to reflect an illegal conversion. However, we're
- // replacing it here with the same value it was constructed with to simply
- // make NC its user.
- NC->setOperand(0, AI);
- }
-
- // Finally, scan the code looking for instructions with bad live ranges.
- for (Function::iterator BB = F->begin(), E = F->end(); BB != E; ++BB)
- for (BasicBlock::iterator II = BB->begin(), E = BB->end(); II != E; ++II) {
- // Ignore obvious cases we don't have to handle. In particular, most
- // instructions either have no uses or only have a single use inside the
- // current block. Ignore them quickly.
- Instruction *Inst = II;
- if (Inst->use_empty()) continue;
- if (Inst->hasOneUse() &&
- cast<Instruction>(Inst->use_back())->getParent() == BB &&
- !isa<PHINode>(Inst->use_back())) continue;
-
- // If this is an alloca in the entry block, it's not a real register
- // value.
- if (AllocaInst *AI = dyn_cast<AllocaInst>(Inst))
- if (isa<ConstantInt>(AI->getArraySize()) && BB == F->begin())
- continue;
-
- // Avoid iterator invalidation by copying users to a temporary vector.
- std::vector<Instruction*> Users;
- for (Value::use_iterator UI = Inst->use_begin(), E = Inst->use_end();
- UI != E; ++UI) {
- Instruction *User = cast<Instruction>(*UI);
- if (User->getParent() != BB || isa<PHINode>(User))
- Users.push_back(User);
- }
-
- // Scan all of the uses and see if the live range is live across an unwind
- // edge. If we find a use live across an invoke edge, create an alloca
- // and spill the value.
- std::set<InvokeInst*> InvokesWithStoreInserted;
-
- // Find all of the blocks that this value is live in.
- std::set<BasicBlock*> LiveBBs;
- LiveBBs.insert(Inst->getParent());
- while (!Users.empty()) {
- Instruction *U = Users.back();
- Users.pop_back();
-
- if (!isa<PHINode>(U)) {
- MarkBlocksLiveIn(U->getParent(), LiveBBs);
- } else {
- // Uses for a PHI node occur in their predecessor block.
- PHINode *PN = cast<PHINode>(U);
- for (unsigned i = 0, e = PN->getNumIncomingValues(); i != e; ++i)
- if (PN->getIncomingValue(i) == Inst)
- MarkBlocksLiveIn(PN->getIncomingBlock(i), LiveBBs);
- }
- }
-
- // Now that we know all of the blocks that this thing is live in, see if
- // it includes any of the unwind locations.
- bool NeedsSpill = false;
- for (unsigned i = 0, e = Invokes.size(); i != e; ++i) {
- BasicBlock *UnwindBlock = Invokes[i]->getUnwindDest();
- if (UnwindBlock != BB && LiveBBs.count(UnwindBlock)) {
- NeedsSpill = true;
- }
- }
-
- // If we decided we need a spill, do it.
- if (NeedsSpill) {
- ++NumSpilled;
- DemoteRegToStack(*Inst, true);
- }
- }
-}
-
-bool LowerInvoke::insertExpensiveEHSupport(Function &F) {
- std::vector<ReturnInst*> Returns;
- std::vector<UnwindInst*> Unwinds;
- std::vector<InvokeInst*> Invokes;
-
- for (Function::iterator BB = F.begin(), E = F.end(); BB != E; ++BB)
- if (ReturnInst *RI = dyn_cast<ReturnInst>(BB->getTerminator())) {
- // Remember all return instructions in case we insert an invoke into this
- // function.
- Returns.push_back(RI);
- } else if (InvokeInst *II = dyn_cast<InvokeInst>(BB->getTerminator())) {
- Invokes.push_back(II);
- } else if (UnwindInst *UI = dyn_cast<UnwindInst>(BB->getTerminator())) {
- Unwinds.push_back(UI);
- }
-
- if (Unwinds.empty() && Invokes.empty()) return false;
-
- NumInvokes += Invokes.size();
- NumUnwinds += Unwinds.size();
-
- // TODO: This is not an optimal way to do this. In particular, this always
- // inserts setjmp calls into the entries of functions with invoke instructions
- // even though there are possibly paths through the function that do not
- // execute any invokes. In particular, for functions with early exits, e.g.
- // the 'addMove' method in hexxagon, it would be nice to not have to do the
- // setjmp stuff on the early exit path. This requires a bit of dataflow, but
- // would not be too hard to do.
-
- // If we have an invoke instruction, insert a setjmp that dominates all
- // invokes. After the setjmp, use a cond branch that goes to the original
- // code path on zero, and to a designated 'catch' block of nonzero.
- Value *OldJmpBufPtr = 0;
- if (!Invokes.empty()) {
- // First thing we need to do is scan the whole function for values that are
- // live across unwind edges. Each value that is live across an unwind edge
- // we spill into a stack location, guaranteeing that there is nothing live
- // across the unwind edge. This process also splits all critical edges
- // coming out of invoke's.
- splitLiveRangesLiveAcrossInvokes(Invokes);
-
- BasicBlock *EntryBB = F.begin();
-
- // Create an alloca for the incoming jump buffer ptr and the new jump buffer
- // that needs to be restored on all exits from the function. This is an
- // alloca because the value needs to be live across invokes.
- unsigned Align = TLI ? TLI->getJumpBufAlignment() : 0;
- AllocaInst *JmpBuf =
- new AllocaInst(JBLinkTy, 0, Align, "jblink", F.begin()->begin());
-
- std::vector<Value*> Idx;
- Idx.push_back(Constant::getNullValue(Type::Int32Ty));
- Idx.push_back(ConstantInt::get(Type::Int32Ty, 1));
- OldJmpBufPtr = GetElementPtrInst::Create(JmpBuf, Idx.begin(), Idx.end(),
- "OldBuf", EntryBB->getTerminator());
-
- // Copy the JBListHead to the alloca.
- Value *OldBuf = new LoadInst(JBListHead, "oldjmpbufptr", true,
- EntryBB->getTerminator());
- new StoreInst(OldBuf, OldJmpBufPtr, true, EntryBB->getTerminator());
-
- // Add the new jumpbuf to the list.
- new StoreInst(JmpBuf, JBListHead, true, EntryBB->getTerminator());
-
- // Create the catch block. The catch block is basically a big switch
- // statement that goes to all of the invoke catch blocks.
- BasicBlock *CatchBB = BasicBlock::Create("setjmp.catch", &F);
-
- // Create an alloca which keeps track of which invoke is currently
- // executing. For normal calls it contains zero.
- AllocaInst *InvokeNum = new AllocaInst(Type::Int32Ty, 0, "invokenum",
- EntryBB->begin());
- new StoreInst(ConstantInt::get(Type::Int32Ty, 0), InvokeNum, true,
- EntryBB->getTerminator());
-
- // Insert a load in the Catch block, and a switch on its value. By default,
- // we go to a block that just does an unwind (which is the correct action
- // for a standard call).
- BasicBlock *UnwindBB = BasicBlock::Create("unwindbb", &F);
- Unwinds.push_back(new UnwindInst(UnwindBB));
-
- Value *CatchLoad = new LoadInst(InvokeNum, "invoke.num", true, CatchBB);
- SwitchInst *CatchSwitch =
- SwitchInst::Create(CatchLoad, UnwindBB, Invokes.size(), CatchBB);
-
- // Now that things are set up, insert the setjmp call itself.
-
- // Split the entry block to insert the conditional branch for the setjmp.
- BasicBlock *ContBlock = EntryBB->splitBasicBlock(EntryBB->getTerminator(),
- "setjmp.cont");
-
- Idx[1] = ConstantInt::get(Type::Int32Ty, 0);
- Value *JmpBufPtr = GetElementPtrInst::Create(JmpBuf, Idx.begin(), Idx.end(),
- "TheJmpBuf",
- EntryBB->getTerminator());
- JmpBufPtr = new BitCastInst(JmpBufPtr, PointerType::getUnqual(Type::Int8Ty),
- "tmp", EntryBB->getTerminator());
- Value *SJRet = CallInst::Create(SetJmpFn, JmpBufPtr, "sjret",
- EntryBB->getTerminator());
-
- // Compare the return value to zero.
- Value *IsNormal = new ICmpInst(ICmpInst::ICMP_EQ, SJRet,
- Constant::getNullValue(SJRet->getType()),
- "notunwind", EntryBB->getTerminator());
- // Nuke the uncond branch.
- EntryBB->getTerminator()->eraseFromParent();
-
- // Put in a new condbranch in its place.
- BranchInst::Create(ContBlock, CatchBB, IsNormal, EntryBB);
-
- // At this point, we are all set up, rewrite each invoke instruction.
- for (unsigned i = 0, e = Invokes.size(); i != e; ++i)
- rewriteExpensiveInvoke(Invokes[i], i+1, InvokeNum, CatchSwitch);
- }
-
- // We know that there is at least one unwind.
-
- // Create three new blocks, the block to load the jmpbuf ptr and compare
- // against null, the block to do the longjmp, and the error block for if it
- // is null. Add them at the end of the function because they are not hot.
- BasicBlock *UnwindHandler = BasicBlock::Create("dounwind", &F);
- BasicBlock *UnwindBlock = BasicBlock::Create("unwind", &F);
- BasicBlock *TermBlock = BasicBlock::Create("unwinderror", &F);
-
- // If this function contains an invoke, restore the old jumpbuf ptr.
- Value *BufPtr;
- if (OldJmpBufPtr) {
- // Before the return, insert a copy from the saved value to the new value.
- BufPtr = new LoadInst(OldJmpBufPtr, "oldjmpbufptr", UnwindHandler);
- new StoreInst(BufPtr, JBListHead, UnwindHandler);
- } else {
- BufPtr = new LoadInst(JBListHead, "ehlist", UnwindHandler);
- }
-
- // Load the JBList, if it's null, then there was no catch!
- Value *NotNull = new ICmpInst(ICmpInst::ICMP_NE, BufPtr,
- Constant::getNullValue(BufPtr->getType()),
- "notnull", UnwindHandler);
- BranchInst::Create(UnwindBlock, TermBlock, NotNull, UnwindHandler);
-
- // Create the block to do the longjmp.
- // Get a pointer to the jmpbuf and longjmp.
- std::vector<Value*> Idx;
- Idx.push_back(Constant::getNullValue(Type::Int32Ty));
- Idx.push_back(ConstantInt::get(Type::Int32Ty, 0));
- Idx[0] = GetElementPtrInst::Create(BufPtr, Idx.begin(), Idx.end(), "JmpBuf",
- UnwindBlock);
- Idx[0] = new BitCastInst(Idx[0], PointerType::getUnqual(Type::Int8Ty),
- "tmp", UnwindBlock);
- Idx[1] = ConstantInt::get(Type::Int32Ty, 1);
- CallInst::Create(LongJmpFn, Idx.begin(), Idx.end(), "", UnwindBlock);
- new UnreachableInst(UnwindBlock);
-
- // Set up the term block ("throw without a catch").
- new UnreachableInst(TermBlock);
-
- // Insert a new call to write(2, AbortMessage, AbortMessageLength);
- writeAbortMessage(TermBlock->getTerminator());
-
- // Insert a call to abort()
- CallInst::Create(AbortFn, "",
- TermBlock->getTerminator())->setTailCall();
-
-
- // Replace all unwinds with a branch to the unwind handler.
- for (unsigned i = 0, e = Unwinds.size(); i != e; ++i) {
- BranchInst::Create(UnwindHandler, Unwinds[i]);
- Unwinds[i]->eraseFromParent();
- }
-
- // Finally, for any returns from this function, if this function contains an
- // invoke, restore the old jmpbuf pointer to its input value.
- if (OldJmpBufPtr) {
- for (unsigned i = 0, e = Returns.size(); i != e; ++i) {
- ReturnInst *R = Returns[i];
-
- // Before the return, insert a copy from the saved value to the new value.
- Value *OldBuf = new LoadInst(OldJmpBufPtr, "oldjmpbufptr", true, R);
- new StoreInst(OldBuf, JBListHead, true, R);
- }
- }
-
- return true;
-}
-
-bool LowerInvoke::runOnFunction(Function &F) {
- if (ExpensiveEHSupport)
- return insertExpensiveEHSupport(F);
- else
- return insertCheapEHSupport(F);
-}
diff --git a/release_23/lib/Transforms/Utils/LowerSwitch.cpp b/release_23/lib/Transforms/Utils/LowerSwitch.cpp
deleted file mode 100644
index d75880f585c3..000000000000
--- a/release_23/lib/Transforms/Utils/LowerSwitch.cpp
+++ /dev/null
@@ -1,324 +0,0 @@
-//===- LowerSwitch.cpp - Eliminate Switch instructions --------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// The LowerSwitch transformation rewrites switch instructions with a sequence
-// of branches, which allows targets to get away with not implementing the
-// switch instruction until it is convenient.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Transforms/Scalar.h"
-#include "llvm/Transforms/Utils/UnifyFunctionExitNodes.h"
-#include "llvm/Constants.h"
-#include "llvm/Function.h"
-#include "llvm/Instructions.h"
-#include "llvm/Pass.h"
-#include "llvm/ADT/STLExtras.h"
-#include "llvm/Support/Debug.h"
-#include "llvm/Support/Compiler.h"
-#include <algorithm>
-using namespace llvm;
-
-namespace {
- /// LowerSwitch Pass - Replace all SwitchInst instructions with chained branch
- /// instructions. Note that this cannot be a BasicBlock pass because it
- /// modifies the CFG!
- class VISIBILITY_HIDDEN LowerSwitch : public FunctionPass {
- public:
- static char ID; // Pass identification, replacement for typeid
- LowerSwitch() : FunctionPass((intptr_t) &ID) {}
-
- virtual bool runOnFunction(Function &F);
-
- virtual void getAnalysisUsage(AnalysisUsage &AU) const {
- // This is a cluster of orthogonal Transforms
- AU.addPreserved<UnifyFunctionExitNodes>();
- AU.addPreservedID(PromoteMemoryToRegisterID);
- AU.addPreservedID(LowerInvokePassID);
- AU.addPreservedID(LowerAllocationsID);
- }
-
- struct CaseRange {
- Constant* Low;
- Constant* High;
- BasicBlock* BB;
-
- CaseRange() : Low(0), High(0), BB(0) { }
- CaseRange(Constant* low, Constant* high, BasicBlock* bb) :
- Low(low), High(high), BB(bb) { }
- };
-
- typedef std::vector<CaseRange> CaseVector;
- typedef std::vector<CaseRange>::iterator CaseItr;
- private:
- void processSwitchInst(SwitchInst *SI);
-
- BasicBlock* switchConvert(CaseItr Begin, CaseItr End, Value* Val,
- BasicBlock* OrigBlock, BasicBlock* Default);
- BasicBlock* newLeafBlock(CaseRange& Leaf, Value* Val,
- BasicBlock* OrigBlock, BasicBlock* Default);
- unsigned Clusterify(CaseVector& Cases, SwitchInst *SI);
- };
-
- /// The comparison function for sorting the switch case values in the vector.
- /// WARNING: Case ranges should be disjoint!
- struct CaseCmp {
- bool operator () (const LowerSwitch::CaseRange& C1,
- const LowerSwitch::CaseRange& C2) {
-
- const ConstantInt* CI1 = cast<const ConstantInt>(C1.Low);
- const ConstantInt* CI2 = cast<const ConstantInt>(C2.High);
- return CI1->getValue().slt(CI2->getValue());
- }
- };
-
- char LowerSwitch::ID = 0;
- RegisterPass<LowerSwitch>
- X("lowerswitch", "Lower SwitchInst's to branches");
-}
-
-// Publically exposed interface to pass...
-const PassInfo *llvm::LowerSwitchID = X.getPassInfo();
-// createLowerSwitchPass - Interface to this file...
-FunctionPass *llvm::createLowerSwitchPass() {
- return new LowerSwitch();
-}
-
-bool LowerSwitch::runOnFunction(Function &F) {
- bool Changed = false;
-
- for (Function::iterator I = F.begin(), E = F.end(); I != E; ) {
- BasicBlock *Cur = I++; // Advance over block so we don't traverse new blocks
-
- if (SwitchInst *SI = dyn_cast<SwitchInst>(Cur->getTerminator())) {
- Changed = true;
- processSwitchInst(SI);
- }
- }
-
- return Changed;
-}
-
-// operator<< - Used for debugging purposes.
-//
-static std::ostream& operator<<(std::ostream &O,
- const LowerSwitch::CaseVector &C) {
- O << "[";
-
- for (LowerSwitch::CaseVector::const_iterator B = C.begin(),
- E = C.end(); B != E; ) {
- O << *B->Low << " -" << *B->High;
- if (++B != E) O << ", ";
- }
-
- return O << "]";
-}
-
-static OStream& operator<<(OStream &O, const LowerSwitch::CaseVector &C) {
- if (O.stream()) *O.stream() << C;
- return O;
-}
-
-// switchConvert - Convert the switch statement into a binary lookup of
-// the case values. The function recursively builds this tree.
-//
-BasicBlock* LowerSwitch::switchConvert(CaseItr Begin, CaseItr End,
- Value* Val, BasicBlock* OrigBlock,
- BasicBlock* Default)
-{
- unsigned Size = End - Begin;
-
- if (Size == 1)
- return newLeafBlock(*Begin, Val, OrigBlock, Default);
-
- unsigned Mid = Size / 2;
- std::vector<CaseRange> LHS(Begin, Begin + Mid);
- DOUT << "LHS: " << LHS << "\n";
- std::vector<CaseRange> RHS(Begin + Mid, End);
- DOUT << "RHS: " << RHS << "\n";
-
- CaseRange& Pivot = *(Begin + Mid);
- DEBUG( DOUT << "Pivot ==> "
- << cast<ConstantInt>(Pivot.Low)->getValue().toStringSigned(10)
- << " -"
- << cast<ConstantInt>(Pivot.High)->getValue().toStringSigned(10)
- << "\n");
-
- BasicBlock* LBranch = switchConvert(LHS.begin(), LHS.end(), Val,
- OrigBlock, Default);
- BasicBlock* RBranch = switchConvert(RHS.begin(), RHS.end(), Val,
- OrigBlock, Default);
-
- // Create a new node that checks if the value is < pivot. Go to the
- // left branch if it is and right branch if not.
- Function* F = OrigBlock->getParent();
- BasicBlock* NewNode = BasicBlock::Create("NodeBlock");
- Function::iterator FI = OrigBlock;
- F->getBasicBlockList().insert(++FI, NewNode);
-
- ICmpInst* Comp = new ICmpInst(ICmpInst::ICMP_SLT, Val, Pivot.Low, "Pivot");
- NewNode->getInstList().push_back(Comp);
- BranchInst::Create(LBranch, RBranch, Comp, NewNode);
- return NewNode;
-}
-
-// newLeafBlock - Create a new leaf block for the binary lookup tree. It
-// checks if the switch's value == the case's value. If not, then it
-// jumps to the default branch. At this point in the tree, the value
-// can't be another valid case value, so the jump to the "default" branch
-// is warranted.
-//
-BasicBlock* LowerSwitch::newLeafBlock(CaseRange& Leaf, Value* Val,
- BasicBlock* OrigBlock,
- BasicBlock* Default)
-{
- Function* F = OrigBlock->getParent();
- BasicBlock* NewLeaf = BasicBlock::Create("LeafBlock");
- Function::iterator FI = OrigBlock;
- F->getBasicBlockList().insert(++FI, NewLeaf);
-
- // Emit comparison
- ICmpInst* Comp = NULL;
- if (Leaf.Low == Leaf.High) {
- // Make the seteq instruction...
- Comp = new ICmpInst(ICmpInst::ICMP_EQ, Val, Leaf.Low,
- "SwitchLeaf", NewLeaf);
- } else {
- // Make range comparison
- if (cast<ConstantInt>(Leaf.Low)->isMinValue(true /*isSigned*/)) {
- // Val >= Min && Val <= Hi --> Val <= Hi
- Comp = new ICmpInst(ICmpInst::ICMP_SLE, Val, Leaf.High,
- "SwitchLeaf", NewLeaf);
- } else if (cast<ConstantInt>(Leaf.Low)->isZero()) {
- // Val >= 0 && Val <= Hi --> Val <=u Hi
- Comp = new ICmpInst(ICmpInst::ICMP_ULE, Val, Leaf.High,
- "SwitchLeaf", NewLeaf);
- } else {
- // Emit V-Lo <=u Hi-Lo
- Constant* NegLo = ConstantExpr::getNeg(Leaf.Low);
- Instruction* Add = BinaryOperator::createAdd(Val, NegLo,
- Val->getName()+".off",
- NewLeaf);
- Constant *UpperBound = ConstantExpr::getAdd(NegLo, Leaf.High);
- Comp = new ICmpInst(ICmpInst::ICMP_ULE, Add, UpperBound,
- "SwitchLeaf", NewLeaf);
- }
- }
-
- // Make the conditional branch...
- BasicBlock* Succ = Leaf.BB;
- BranchInst::Create(Succ, Default, Comp, NewLeaf);
-
- // If there were any PHI nodes in this successor, rewrite one entry
- // from OrigBlock to come from NewLeaf.
- for (BasicBlock::iterator I = Succ->begin(); isa<PHINode>(I); ++I) {
- PHINode* PN = cast<PHINode>(I);
- // Remove all but one incoming entries from the cluster
- uint64_t Range = cast<ConstantInt>(Leaf.High)->getSExtValue() -
- cast<ConstantInt>(Leaf.Low)->getSExtValue();
- for (uint64_t j = 0; j < Range; ++j) {
- PN->removeIncomingValue(OrigBlock);
- }
-
- int BlockIdx = PN->getBasicBlockIndex(OrigBlock);
- assert(BlockIdx != -1 && "Switch didn't go to this successor??");
- PN->setIncomingBlock((unsigned)BlockIdx, NewLeaf);
- }
-
- return NewLeaf;
-}
-
-// Clusterify - Transform simple list of Cases into list of CaseRange's
-unsigned LowerSwitch::Clusterify(CaseVector& Cases, SwitchInst *SI) {
- unsigned numCmps = 0;
-
- // Start with "simple" cases
- for (unsigned i = 1; i < SI->getNumSuccessors(); ++i)
- Cases.push_back(CaseRange(SI->getSuccessorValue(i),
- SI->getSuccessorValue(i),
- SI->getSuccessor(i)));
- std::sort(Cases.begin(), Cases.end(), CaseCmp());
-
- // Merge case into clusters
- if (Cases.size()>=2)
- for (CaseItr I=Cases.begin(), J=next(Cases.begin()); J!=Cases.end(); ) {
- int64_t nextValue = cast<ConstantInt>(J->Low)->getSExtValue();
- int64_t currentValue = cast<ConstantInt>(I->High)->getSExtValue();
- BasicBlock* nextBB = J->BB;
- BasicBlock* currentBB = I->BB;
-
- // If the two neighboring cases go to the same destination, merge them
- // into a single case.
- if ((nextValue-currentValue==1) && (currentBB == nextBB)) {
- I->High = J->High;
- J = Cases.erase(J);
- } else {
- I = J++;
- }
- }
-
- for (CaseItr I=Cases.begin(), E=Cases.end(); I!=E; ++I, ++numCmps) {
- if (I->Low != I->High)
- // A range counts double, since it requires two compares.
- ++numCmps;
- }
-
- return numCmps;
-}
-
-// processSwitchInst - Replace the specified switch instruction with a sequence
-// of chained if-then insts in a balanced binary search.
-//
-void LowerSwitch::processSwitchInst(SwitchInst *SI) {
- BasicBlock *CurBlock = SI->getParent();
- BasicBlock *OrigBlock = CurBlock;
- Function *F = CurBlock->getParent();
- Value *Val = SI->getOperand(0); // The value we are switching on...
- BasicBlock* Default = SI->getDefaultDest();
-
- // If there is only the default destination, don't bother with the code below.
- if (SI->getNumOperands() == 2) {
- BranchInst::Create(SI->getDefaultDest(), CurBlock);
- CurBlock->getInstList().erase(SI);
- return;
- }
-
- // Create a new, empty default block so that the new hierarchy of
- // if-then statements go to this and the PHI nodes are happy.
- BasicBlock* NewDefault = BasicBlock::Create("NewDefault");
- F->getBasicBlockList().insert(Default, NewDefault);
-
- BranchInst::Create(Default, NewDefault);
-
- // If there is an entry in any PHI nodes for the default edge, make sure
- // to update them as well.
- for (BasicBlock::iterator I = Default->begin(); isa<PHINode>(I); ++I) {
- PHINode *PN = cast<PHINode>(I);
- int BlockIdx = PN->getBasicBlockIndex(OrigBlock);
- assert(BlockIdx != -1 && "Switch didn't go to this successor??");
- PN->setIncomingBlock((unsigned)BlockIdx, NewDefault);
- }
-
- // Prepare cases vector.
- CaseVector Cases;
- unsigned numCmps = Clusterify(Cases, SI);
-
- DOUT << "Clusterify finished. Total clusters: " << Cases.size()
- << ". Total compares: " << numCmps << "\n";
- DOUT << "Cases: " << Cases << "\n";
-
- BasicBlock* SwitchBlock = switchConvert(Cases.begin(), Cases.end(), Val,
- OrigBlock, NewDefault);
-
- // Branch to our shiny new if-then stuff...
- BranchInst::Create(SwitchBlock, OrigBlock);
-
- // We are now done with the switch instruction, delete it.
- CurBlock->getInstList().erase(SI);
-}
diff --git a/release_23/lib/Transforms/Utils/Makefile b/release_23/lib/Transforms/Utils/Makefile
deleted file mode 100644
index 09ff745a1b52..000000000000
--- a/release_23/lib/Transforms/Utils/Makefile
+++ /dev/null
@@ -1,15 +0,0 @@
-##===- lib/Transforms/Utils/Makefile -----------------------*- Makefile -*-===##
-#
-# The LLVM Compiler Infrastructure
-#
-# This file is distributed under the University of Illinois Open Source
-# License. See LICENSE.TXT for details.
-#
-##===----------------------------------------------------------------------===##
-
-LEVEL = ../../..
-LIBRARYNAME = LLVMTransformUtils
-BUILD_ARCHIVE = 1
-
-include $(LEVEL)/Makefile.common
-
diff --git a/release_23/lib/Transforms/Utils/Mem2Reg.cpp b/release_23/lib/Transforms/Utils/Mem2Reg.cpp
deleted file mode 100644
index f9b1d8d4994a..000000000000
--- a/release_23/lib/Transforms/Utils/Mem2Reg.cpp
+++ /dev/null
@@ -1,92 +0,0 @@
-//===- Mem2Reg.cpp - The -mem2reg pass, a wrapper around the Utils lib ----===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This pass is a simple pass wrapper around the PromoteMemToReg function call
-// exposed by the Utils library.
-//
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "mem2reg"
-#include "llvm/Transforms/Scalar.h"
-#include "llvm/Transforms/Utils/PromoteMemToReg.h"
-#include "llvm/Transforms/Utils/UnifyFunctionExitNodes.h"
-#include "llvm/Analysis/Dominators.h"
-#include "llvm/Instructions.h"
-#include "llvm/Function.h"
-#include "llvm/ADT/Statistic.h"
-#include "llvm/Support/Compiler.h"
-using namespace llvm;
-
-STATISTIC(NumPromoted, "Number of alloca's promoted");
-
-namespace {
- struct VISIBILITY_HIDDEN PromotePass : public FunctionPass {
- static char ID; // Pass identification, replacement for typeid
- PromotePass() : FunctionPass((intptr_t)&ID) {}
-
- // runOnFunction - To run this pass, first we calculate the alloca
- // instructions that are safe for promotion, then we promote each one.
- //
- virtual bool runOnFunction(Function &F);
-
- // getAnalysisUsage - We need dominance frontiers
- //
- virtual void getAnalysisUsage(AnalysisUsage &AU) const {
- AU.addRequired<DominatorTree>();
- AU.addRequired<DominanceFrontier>();
- AU.setPreservesCFG();
- // This is a cluster of orthogonal Transforms
- AU.addPreserved<UnifyFunctionExitNodes>();
- AU.addPreservedID(LowerSwitchID);
- AU.addPreservedID(LowerInvokePassID);
- AU.addPreservedID(LowerAllocationsID);
- }
- };
-
- char PromotePass::ID = 0;
- RegisterPass<PromotePass> X("mem2reg", "Promote Memory to Register");
-} // end of anonymous namespace
-
-bool PromotePass::runOnFunction(Function &F) {
- std::vector<AllocaInst*> Allocas;
-
- BasicBlock &BB = F.getEntryBlock(); // Get the entry node for the function
-
- bool Changed = false;
-
- DominatorTree &DT = getAnalysis<DominatorTree>();
- DominanceFrontier &DF = getAnalysis<DominanceFrontier>();
-
- while (1) {
- Allocas.clear();
-
- // Find allocas that are safe to promote, by looking at all instructions in
- // the entry node
- for (BasicBlock::iterator I = BB.begin(), E = --BB.end(); I != E; ++I)
- if (AllocaInst *AI = dyn_cast<AllocaInst>(I)) // Is it an alloca?
- if (isAllocaPromotable(AI))
- Allocas.push_back(AI);
-
- if (Allocas.empty()) break;
-
- PromoteMemToReg(Allocas, DT, DF);
- NumPromoted += Allocas.size();
- Changed = true;
- }
-
- return Changed;
-}
-
-// Publically exposed interface to pass...
-const PassInfo *llvm::PromoteMemoryToRegisterID = X.getPassInfo();
-// createPromoteMemoryToRegister - Provide an entry point to create this pass.
-//
-FunctionPass *llvm::createPromoteMemoryToRegisterPass() {
- return new PromotePass();
-}
diff --git a/release_23/lib/Transforms/Utils/PromoteMemoryToRegister.cpp b/release_23/lib/Transforms/Utils/PromoteMemoryToRegister.cpp
deleted file mode 100644
index ebd68ddcbebf..000000000000
--- a/release_23/lib/Transforms/Utils/PromoteMemoryToRegister.cpp
+++ /dev/null
@@ -1,1003 +0,0 @@
-//===- PromoteMemoryToRegister.cpp - Convert allocas to registers ---------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file promotes memory references to be register references. It promotes
-// alloca instructions which only have loads and stores as uses. An alloca is
-// transformed by using dominator frontiers to place PHI nodes, then traversing
-// the function in depth-first order to rewrite loads and stores as appropriate.
-// This is just the standard SSA construction algorithm to construct "pruned"
-// SSA form.
-//
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "mem2reg"
-#include "llvm/Transforms/Utils/PromoteMemToReg.h"
-#include "llvm/Constants.h"
-#include "llvm/DerivedTypes.h"
-#include "llvm/Function.h"
-#include "llvm/Instructions.h"
-#include "llvm/Analysis/Dominators.h"
-#include "llvm/Analysis/AliasSetTracker.h"
-#include "llvm/ADT/DenseMap.h"
-#include "llvm/ADT/SmallPtrSet.h"
-#include "llvm/ADT/SmallVector.h"
-#include "llvm/ADT/Statistic.h"
-#include "llvm/ADT/StringExtras.h"
-#include "llvm/Support/CFG.h"
-#include "llvm/Support/Compiler.h"
-#include <algorithm>
-using namespace llvm;
-
-STATISTIC(NumLocalPromoted, "Number of alloca's promoted within one block");
-STATISTIC(NumSingleStore, "Number of alloca's promoted with a single store");
-STATISTIC(NumDeadAlloca, "Number of dead alloca's removed");
-STATISTIC(NumPHIInsert, "Number of PHI nodes inserted");
-
-// Provide DenseMapInfo for all pointers.
-namespace llvm {
-template<>
-struct DenseMapInfo<std::pair<BasicBlock*, unsigned> > {
- typedef std::pair<BasicBlock*, unsigned> EltTy;
- static inline EltTy getEmptyKey() {
- return EltTy(reinterpret_cast<BasicBlock*>(-1), ~0U);
- }
- static inline EltTy getTombstoneKey() {
- return EltTy(reinterpret_cast<BasicBlock*>(-2), 0U);
- }
- static unsigned getHashValue(const std::pair<BasicBlock*, unsigned> &Val) {
- return DenseMapInfo<void*>::getHashValue(Val.first) + Val.second*2;
- }
- static bool isEqual(const EltTy &LHS, const EltTy &RHS) {
- return LHS == RHS;
- }
- static bool isPod() { return true; }
-};
-}
-
-/// isAllocaPromotable - Return true if this alloca is legal for promotion.
-/// This is true if there are only loads and stores to the alloca.
-///
-bool llvm::isAllocaPromotable(const AllocaInst *AI) {
- // FIXME: If the memory unit is of pointer or integer type, we can permit
- // assignments to subsections of the memory unit.
-
- // Only allow direct and non-volatile loads and stores...
- for (Value::use_const_iterator UI = AI->use_begin(), UE = AI->use_end();
- UI != UE; ++UI) // Loop over all of the uses of the alloca
- if (const LoadInst *LI = dyn_cast<LoadInst>(*UI)) {
- if (LI->isVolatile())
- return false;
- } else if (const StoreInst *SI = dyn_cast<StoreInst>(*UI)) {
- if (SI->getOperand(0) == AI)
- return false; // Don't allow a store OF the AI, only INTO the AI.
- if (SI->isVolatile())
- return false;
- } else {
- return false; // Not a load or store.
- }
-
- return true;
-}
-
-namespace {
- struct AllocaInfo;
-
- // Data package used by RenamePass()
- class VISIBILITY_HIDDEN RenamePassData {
- public:
- typedef std::vector<Value *> ValVector;
-
- RenamePassData() {}
- RenamePassData(BasicBlock *B, BasicBlock *P,
- const ValVector &V) : BB(B), Pred(P), Values(V) {}
- BasicBlock *BB;
- BasicBlock *Pred;
- ValVector Values;
-
- void swap(RenamePassData &RHS) {
- std::swap(BB, RHS.BB);
- std::swap(Pred, RHS.Pred);
- Values.swap(RHS.Values);
- }
- };
-
- struct VISIBILITY_HIDDEN PromoteMem2Reg {
- /// Allocas - The alloca instructions being promoted.
- ///
- std::vector<AllocaInst*> Allocas;
- SmallVector<AllocaInst*, 16> &RetryList;
- DominatorTree &DT;
- DominanceFrontier &DF;
-
- /// AST - An AliasSetTracker object to update. If null, don't update it.
- ///
- AliasSetTracker *AST;
-
- /// AllocaLookup - Reverse mapping of Allocas.
- ///
- std::map<AllocaInst*, unsigned> AllocaLookup;
-
- /// NewPhiNodes - The PhiNodes we're adding.
- ///
- DenseMap<std::pair<BasicBlock*, unsigned>, PHINode*> NewPhiNodes;
-
- /// PhiToAllocaMap - For each PHI node, keep track of which entry in Allocas
- /// it corresponds to.
- DenseMap<PHINode*, unsigned> PhiToAllocaMap;
-
- /// PointerAllocaValues - If we are updating an AliasSetTracker, then for
- /// each alloca that is of pointer type, we keep track of what to copyValue
- /// to the inserted PHI nodes here.
- ///
- std::vector<Value*> PointerAllocaValues;
-
- /// Visited - The set of basic blocks the renamer has already visited.
- ///
- SmallPtrSet<BasicBlock*, 16> Visited;
-
- /// BBNumbers - Contains a stable numbering of basic blocks to avoid
- /// non-determinstic behavior.
- DenseMap<BasicBlock*, unsigned> BBNumbers;
-
- /// BBNumPreds - Lazily compute the number of predecessors a block has.
- DenseMap<const BasicBlock*, unsigned> BBNumPreds;
- public:
- PromoteMem2Reg(const std::vector<AllocaInst*> &A,
- SmallVector<AllocaInst*, 16> &Retry, DominatorTree &dt,
- DominanceFrontier &df, AliasSetTracker *ast)
- : Allocas(A), RetryList(Retry), DT(dt), DF(df), AST(ast) {}
-
- void run();
-
- /// properlyDominates - Return true if I1 properly dominates I2.
- ///
- bool properlyDominates(Instruction *I1, Instruction *I2) const {
- if (InvokeInst *II = dyn_cast<InvokeInst>(I1))
- I1 = II->getNormalDest()->begin();
- return DT.properlyDominates(I1->getParent(), I2->getParent());
- }
-
- /// dominates - Return true if BB1 dominates BB2 using the DominatorTree.
- ///
- bool dominates(BasicBlock *BB1, BasicBlock *BB2) const {
- return DT.dominates(BB1, BB2);
- }
-
- private:
- void RemoveFromAllocasList(unsigned &AllocaIdx) {
- Allocas[AllocaIdx] = Allocas.back();
- Allocas.pop_back();
- --AllocaIdx;
- }
-
- unsigned getNumPreds(const BasicBlock *BB) {
- unsigned &NP = BBNumPreds[BB];
- if (NP == 0)
- NP = std::distance(pred_begin(BB), pred_end(BB))+1;
- return NP-1;
- }
-
- void DetermineInsertionPoint(AllocaInst *AI, unsigned AllocaNum,
- AllocaInfo &Info);
- void ComputeLiveInBlocks(AllocaInst *AI, AllocaInfo &Info,
- const SmallPtrSet<BasicBlock*, 32> &DefBlocks,
- SmallPtrSet<BasicBlock*, 32> &LiveInBlocks);
-
- void RewriteSingleStoreAlloca(AllocaInst *AI, AllocaInfo &Info);
-
- bool PromoteLocallyUsedAlloca(BasicBlock *BB, AllocaInst *AI);
- void PromoteLocallyUsedAllocas(BasicBlock *BB,
- const std::vector<AllocaInst*> &AIs);
-
- void RenamePass(BasicBlock *BB, BasicBlock *Pred,
- RenamePassData::ValVector &IncVals,
- std::vector<RenamePassData> &Worklist);
- bool QueuePhiNode(BasicBlock *BB, unsigned AllocaIdx, unsigned &Version,
- SmallPtrSet<PHINode*, 16> &InsertedPHINodes);
- };
-
- struct AllocaInfo {
- std::vector<BasicBlock*> DefiningBlocks;
- std::vector<BasicBlock*> UsingBlocks;
-
- StoreInst *OnlyStore;
- BasicBlock *OnlyBlock;
- bool OnlyUsedInOneBlock;
-
- Value *AllocaPointerVal;
-
- void clear() {
- DefiningBlocks.clear();
- UsingBlocks.clear();
- OnlyStore = 0;
- OnlyBlock = 0;
- OnlyUsedInOneBlock = true;
- AllocaPointerVal = 0;
- }
-
- /// AnalyzeAlloca - Scan the uses of the specified alloca, filling in our
- /// ivars.
- void AnalyzeAlloca(AllocaInst *AI) {
- clear();
-
- // As we scan the uses of the alloca instruction, keep track of stores,
- // and decide whether all of the loads and stores to the alloca are within
- // the same basic block.
- for (Value::use_iterator U = AI->use_begin(), E = AI->use_end();
- U != E; ++U) {
- Instruction *User = cast<Instruction>(*U);
- if (StoreInst *SI = dyn_cast<StoreInst>(User)) {
- // Remember the basic blocks which define new values for the alloca
- DefiningBlocks.push_back(SI->getParent());
- AllocaPointerVal = SI->getOperand(0);
- OnlyStore = SI;
- } else {
- LoadInst *LI = cast<LoadInst>(User);
- // Otherwise it must be a load instruction, keep track of variable
- // reads.
- UsingBlocks.push_back(LI->getParent());
- AllocaPointerVal = LI;
- }
-
- if (OnlyUsedInOneBlock) {
- if (OnlyBlock == 0)
- OnlyBlock = User->getParent();
- else if (OnlyBlock != User->getParent())
- OnlyUsedInOneBlock = false;
- }
- }
- }
- };
-
-} // end of anonymous namespace
-
-
-void PromoteMem2Reg::run() {
- Function &F = *DF.getRoot()->getParent();
-
- // LocallyUsedAllocas - Keep track of all of the alloca instructions which are
- // only used in a single basic block. These instructions can be efficiently
- // promoted by performing a single linear scan over that one block. Since
- // individual basic blocks are sometimes large, we group together all allocas
- // that are live in a single basic block by the basic block they are live in.
- std::map<BasicBlock*, std::vector<AllocaInst*> > LocallyUsedAllocas;
-
- if (AST) PointerAllocaValues.resize(Allocas.size());
-
- AllocaInfo Info;
-
- for (unsigned AllocaNum = 0; AllocaNum != Allocas.size(); ++AllocaNum) {
- AllocaInst *AI = Allocas[AllocaNum];
-
- assert(isAllocaPromotable(AI) &&
- "Cannot promote non-promotable alloca!");
- assert(AI->getParent()->getParent() == &F &&
- "All allocas should be in the same function, which is same as DF!");
-
- if (AI->use_empty()) {
- // If there are no uses of the alloca, just delete it now.
- if (AST) AST->deleteValue(AI);
- AI->eraseFromParent();
-
- // Remove the alloca from the Allocas list, since it has been processed
- RemoveFromAllocasList(AllocaNum);
- ++NumDeadAlloca;
- continue;
- }
-
- // Calculate the set of read and write-locations for each alloca. This is
- // analogous to finding the 'uses' and 'definitions' of each variable.
- Info.AnalyzeAlloca(AI);
-
- // If there is only a single store to this value, replace any loads of
- // it that are directly dominated by the definition with the value stored.
- if (Info.DefiningBlocks.size() == 1) {
- RewriteSingleStoreAlloca(AI, Info);
-
- // Finally, after the scan, check to see if the store is all that is left.
- if (Info.UsingBlocks.empty()) {
- // Remove the (now dead) store and alloca.
- Info.OnlyStore->eraseFromParent();
- if (AST) AST->deleteValue(AI);
- AI->eraseFromParent();
-
- // The alloca has been processed, move on.
- RemoveFromAllocasList(AllocaNum);
-
- ++NumSingleStore;
- continue;
- }
- }
-
- // If the alloca is only read and written in one basic block, just perform a
- // linear sweep over the block to eliminate it.
- if (Info.OnlyUsedInOneBlock) {
- LocallyUsedAllocas[Info.OnlyBlock].push_back(AI);
-
- // Remove the alloca from the Allocas list, since it will be processed.
- RemoveFromAllocasList(AllocaNum);
- continue;
- }
-
- // If we haven't computed a numbering for the BB's in the function, do so
- // now.
- if (BBNumbers.empty()) {
- unsigned ID = 0;
- for (Function::iterator I = F.begin(), E = F.end(); I != E; ++I)
- BBNumbers[I] = ID++;
- }
-
- // If we have an AST to keep updated, remember some pointer value that is
- // stored into the alloca.
- if (AST)
- PointerAllocaValues[AllocaNum] = Info.AllocaPointerVal;
-
- // Keep the reverse mapping of the 'Allocas' array for the rename pass.
- AllocaLookup[Allocas[AllocaNum]] = AllocaNum;
-
- // At this point, we're committed to promoting the alloca using IDF's, and
- // the standard SSA construction algorithm. Determine which blocks need phi
- // nodes and see if we can optimize out some work by avoiding insertion of
- // dead phi nodes.
- DetermineInsertionPoint(AI, AllocaNum, Info);
- }
-
- // Process all allocas which are only used in a single basic block.
- for (std::map<BasicBlock*, std::vector<AllocaInst*> >::iterator I =
- LocallyUsedAllocas.begin(), E = LocallyUsedAllocas.end(); I != E; ++I){
- const std::vector<AllocaInst*> &LocAllocas = I->second;
- assert(!LocAllocas.empty() && "empty alloca list??");
-
- // It's common for there to only be one alloca in the list. Handle it
- // efficiently.
- if (LocAllocas.size() == 1) {
- // If we can do the quick promotion pass, do so now.
- if (PromoteLocallyUsedAlloca(I->first, LocAllocas[0]))
- RetryList.push_back(LocAllocas[0]); // Failed, retry later.
- } else {
- // Locally promote anything possible. Note that if this is unable to
- // promote a particular alloca, it puts the alloca onto the Allocas vector
- // for global processing.
- PromoteLocallyUsedAllocas(I->first, LocAllocas);
- }
- }
-
- if (Allocas.empty())
- return; // All of the allocas must have been trivial!
-
- // Set the incoming values for the basic block to be null values for all of
- // the alloca's. We do this in case there is a load of a value that has not
- // been stored yet. In this case, it will get this null value.
- //
- RenamePassData::ValVector Values(Allocas.size());
- for (unsigned i = 0, e = Allocas.size(); i != e; ++i)
- Values[i] = UndefValue::get(Allocas[i]->getAllocatedType());
-
- // Walks all basic blocks in the function performing the SSA rename algorithm
- // and inserting the phi nodes we marked as necessary
- //
- std::vector<RenamePassData> RenamePassWorkList;
- RenamePassWorkList.push_back(RenamePassData(F.begin(), 0, Values));
- while (!RenamePassWorkList.empty()) {
- RenamePassData RPD;
- RPD.swap(RenamePassWorkList.back());
- RenamePassWorkList.pop_back();
- // RenamePass may add new worklist entries.
- RenamePass(RPD.BB, RPD.Pred, RPD.Values, RenamePassWorkList);
- }
-
- // The renamer uses the Visited set to avoid infinite loops. Clear it now.
- Visited.clear();
-
- // Remove the allocas themselves from the function.
- for (unsigned i = 0, e = Allocas.size(); i != e; ++i) {
- Instruction *A = Allocas[i];
-
- // If there are any uses of the alloca instructions left, they must be in
- // sections of dead code that were not processed on the dominance frontier.
- // Just delete the users now.
- //
- if (!A->use_empty())
- A->replaceAllUsesWith(UndefValue::get(A->getType()));
- if (AST) AST->deleteValue(A);
- A->eraseFromParent();
- }
-
-
- // Loop over all of the PHI nodes and see if there are any that we can get
- // rid of because they merge all of the same incoming values. This can
- // happen due to undef values coming into the PHI nodes. This process is
- // iterative, because eliminating one PHI node can cause others to be removed.
- bool EliminatedAPHI = true;
- while (EliminatedAPHI) {
- EliminatedAPHI = false;
-
- for (DenseMap<std::pair<BasicBlock*, unsigned>, PHINode*>::iterator I =
- NewPhiNodes.begin(), E = NewPhiNodes.end(); I != E;) {
- PHINode *PN = I->second;
-
- // If this PHI node merges one value and/or undefs, get the value.
- if (Value *V = PN->hasConstantValue(true)) {
- if (!isa<Instruction>(V) ||
- properlyDominates(cast<Instruction>(V), PN)) {
- if (AST && isa<PointerType>(PN->getType()))
- AST->deleteValue(PN);
- PN->replaceAllUsesWith(V);
- PN->eraseFromParent();
- NewPhiNodes.erase(I++);
- EliminatedAPHI = true;
- continue;
- }
- }
- ++I;
- }
- }
-
- // At this point, the renamer has added entries to PHI nodes for all reachable
- // code. Unfortunately, there may be unreachable blocks which the renamer
- // hasn't traversed. If this is the case, the PHI nodes may not
- // have incoming values for all predecessors. Loop over all PHI nodes we have
- // created, inserting undef values if they are missing any incoming values.
- //
- for (DenseMap<std::pair<BasicBlock*, unsigned>, PHINode*>::iterator I =
- NewPhiNodes.begin(), E = NewPhiNodes.end(); I != E; ++I) {
- // We want to do this once per basic block. As such, only process a block
- // when we find the PHI that is the first entry in the block.
- PHINode *SomePHI = I->second;
- BasicBlock *BB = SomePHI->getParent();
- if (&BB->front() != SomePHI)
- continue;
-
- // Only do work here if there the PHI nodes are missing incoming values. We
- // know that all PHI nodes that were inserted in a block will have the same
- // number of incoming values, so we can just check any of them.
- if (SomePHI->getNumIncomingValues() == getNumPreds(BB))
- continue;
-
- // Get the preds for BB.
- SmallVector<BasicBlock*, 16> Preds(pred_begin(BB), pred_end(BB));
-
- // Ok, now we know that all of the PHI nodes are missing entries for some
- // basic blocks. Start by sorting the incoming predecessors for efficient
- // access.
- std::sort(Preds.begin(), Preds.end());
-
- // Now we loop through all BB's which have entries in SomePHI and remove
- // them from the Preds list.
- for (unsigned i = 0, e = SomePHI->getNumIncomingValues(); i != e; ++i) {
- // Do a log(n) search of the Preds list for the entry we want.
- SmallVector<BasicBlock*, 16>::iterator EntIt =
- std::lower_bound(Preds.begin(), Preds.end(),
- SomePHI->getIncomingBlock(i));
- assert(EntIt != Preds.end() && *EntIt == SomePHI->getIncomingBlock(i)&&
- "PHI node has entry for a block which is not a predecessor!");
-
- // Remove the entry
- Preds.erase(EntIt);
- }
-
- // At this point, the blocks left in the preds list must have dummy
- // entries inserted into every PHI nodes for the block. Update all the phi
- // nodes in this block that we are inserting (there could be phis before
- // mem2reg runs).
- unsigned NumBadPreds = SomePHI->getNumIncomingValues();
- BasicBlock::iterator BBI = BB->begin();
- while ((SomePHI = dyn_cast<PHINode>(BBI++)) &&
- SomePHI->getNumIncomingValues() == NumBadPreds) {
- Value *UndefVal = UndefValue::get(SomePHI->getType());
- for (unsigned pred = 0, e = Preds.size(); pred != e; ++pred)
- SomePHI->addIncoming(UndefVal, Preds[pred]);
- }
- }
-
- NewPhiNodes.clear();
-}
-
-
-/// ComputeLiveInBlocks - Determine which blocks the value is live in. These
-/// are blocks which lead to uses. Knowing this allows us to avoid inserting
-/// PHI nodes into blocks which don't lead to uses (thus, the inserted phi nodes
-/// would be dead).
-void PromoteMem2Reg::
-ComputeLiveInBlocks(AllocaInst *AI, AllocaInfo &Info,
- const SmallPtrSet<BasicBlock*, 32> &DefBlocks,
- SmallPtrSet<BasicBlock*, 32> &LiveInBlocks) {
-
- // To determine liveness, we must iterate through the predecessors of blocks
- // where the def is live. Blocks are added to the worklist if we need to
- // check their predecessors. Start with all the using blocks.
- SmallVector<BasicBlock*, 64> LiveInBlockWorklist;
- LiveInBlockWorklist.insert(LiveInBlockWorklist.end(),
- Info.UsingBlocks.begin(), Info.UsingBlocks.end());
-
- // If any of the using blocks is also a definition block, check to see if the
- // definition occurs before or after the use. If it happens before the use,
- // the value isn't really live-in.
- for (unsigned i = 0, e = LiveInBlockWorklist.size(); i != e; ++i) {
- BasicBlock *BB = LiveInBlockWorklist[i];
- if (!DefBlocks.count(BB)) continue;
-
- // Okay, this is a block that both uses and defines the value. If the first
- // reference to the alloca is a def (store), then we know it isn't live-in.
- for (BasicBlock::iterator I = BB->begin(); ; ++I) {
- if (StoreInst *SI = dyn_cast<StoreInst>(I)) {
- if (SI->getOperand(1) != AI) continue;
-
- // We found a store to the alloca before a load. The alloca is not
- // actually live-in here.
- LiveInBlockWorklist[i] = LiveInBlockWorklist.back();
- LiveInBlockWorklist.pop_back();
- --i, --e;
- break;
- } else if (LoadInst *LI = dyn_cast<LoadInst>(I)) {
- if (LI->getOperand(0) != AI) continue;
-
- // Okay, we found a load before a store to the alloca. It is actually
- // live into this block.
- break;
- }
- }
- }
-
- // Now that we have a set of blocks where the phi is live-in, recursively add
- // their predecessors until we find the full region the value is live.
- while (!LiveInBlockWorklist.empty()) {
- BasicBlock *BB = LiveInBlockWorklist.back();
- LiveInBlockWorklist.pop_back();
-
- // The block really is live in here, insert it into the set. If already in
- // the set, then it has already been processed.
- if (!LiveInBlocks.insert(BB))
- continue;
-
- // Since the value is live into BB, it is either defined in a predecessor or
- // live into it to. Add the preds to the worklist unless they are a
- // defining block.
- for (pred_iterator PI = pred_begin(BB), E = pred_end(BB); PI != E; ++PI) {
- BasicBlock *P = *PI;
-
- // The value is not live into a predecessor if it defines the value.
- if (DefBlocks.count(P))
- continue;
-
- // Otherwise it is, add to the worklist.
- LiveInBlockWorklist.push_back(P);
- }
- }
-}
-
-/// DetermineInsertionPoint - At this point, we're committed to promoting the
-/// alloca using IDF's, and the standard SSA construction algorithm. Determine
-/// which blocks need phi nodes and see if we can optimize out some work by
-/// avoiding insertion of dead phi nodes.
-void PromoteMem2Reg::DetermineInsertionPoint(AllocaInst *AI, unsigned AllocaNum,
- AllocaInfo &Info) {
-
- // Unique the set of defining blocks for efficient lookup.
- SmallPtrSet<BasicBlock*, 32> DefBlocks;
- DefBlocks.insert(Info.DefiningBlocks.begin(), Info.DefiningBlocks.end());
-
- // Determine which blocks the value is live in. These are blocks which lead
- // to uses.
- SmallPtrSet<BasicBlock*, 32> LiveInBlocks;
- ComputeLiveInBlocks(AI, Info, DefBlocks, LiveInBlocks);
-
- // Compute the locations where PhiNodes need to be inserted. Look at the
- // dominance frontier of EACH basic-block we have a write in.
- unsigned CurrentVersion = 0;
- SmallPtrSet<PHINode*, 16> InsertedPHINodes;
- std::vector<std::pair<unsigned, BasicBlock*> > DFBlocks;
- while (!Info.DefiningBlocks.empty()) {
- BasicBlock *BB = Info.DefiningBlocks.back();
- Info.DefiningBlocks.pop_back();
-
- // Look up the DF for this write, add it to defining blocks.
- DominanceFrontier::const_iterator it = DF.find(BB);
- if (it == DF.end()) continue;
-
- const DominanceFrontier::DomSetType &S = it->second;
-
- // In theory we don't need the indirection through the DFBlocks vector.
- // In practice, the order of calling QueuePhiNode would depend on the
- // (unspecified) ordering of basic blocks in the dominance frontier,
- // which would give PHI nodes non-determinstic subscripts. Fix this by
- // processing blocks in order of the occurance in the function.
- for (DominanceFrontier::DomSetType::const_iterator P = S.begin(),
- PE = S.end(); P != PE; ++P) {
- // If the frontier block is not in the live-in set for the alloca, don't
- // bother processing it.
- if (!LiveInBlocks.count(*P))
- continue;
-
- DFBlocks.push_back(std::make_pair(BBNumbers[*P], *P));
- }
-
- // Sort by which the block ordering in the function.
- if (DFBlocks.size() > 1)
- std::sort(DFBlocks.begin(), DFBlocks.end());
-
- for (unsigned i = 0, e = DFBlocks.size(); i != e; ++i) {
- BasicBlock *BB = DFBlocks[i].second;
- if (QueuePhiNode(BB, AllocaNum, CurrentVersion, InsertedPHINodes))
- Info.DefiningBlocks.push_back(BB);
- }
- DFBlocks.clear();
- }
-}
-
-
-/// RewriteSingleStoreAlloca - If there is only a single store to this value,
-/// replace any loads of it that are directly dominated by the definition with
-/// the value stored.
-void PromoteMem2Reg::RewriteSingleStoreAlloca(AllocaInst *AI,
- AllocaInfo &Info) {
- StoreInst *OnlyStore = Info.OnlyStore;
- bool StoringGlobalVal = !isa<Instruction>(OnlyStore->getOperand(0));
-
- // Be aware of loads before the store.
- SmallPtrSet<BasicBlock*, 32> ProcessedBlocks;
- for (unsigned i = 0, e = Info.UsingBlocks.size(); i != e; ++i) {
- BasicBlock *UseBlock = Info.UsingBlocks[i];
-
- // If we already processed this block, don't reprocess it.
- if (!ProcessedBlocks.insert(UseBlock)) {
- Info.UsingBlocks[i] = Info.UsingBlocks.back();
- Info.UsingBlocks.pop_back();
- --i; --e;
- continue;
- }
-
- // If the store dominates the block and if we haven't processed it yet,
- // do so now. We can't handle the case where the store doesn't dominate a
- // block because there may be a path between the store and the use, but we
- // may need to insert phi nodes to handle dominance properly.
- if (!StoringGlobalVal && !dominates(OnlyStore->getParent(), UseBlock))
- continue;
-
- // If the use and store are in the same block, do a quick scan to
- // verify that there are no uses before the store.
- if (UseBlock == OnlyStore->getParent()) {
- BasicBlock::iterator I = UseBlock->begin();
- for (; &*I != OnlyStore; ++I) { // scan block for store.
- if (isa<LoadInst>(I) && I->getOperand(0) == AI)
- break;
- }
- if (&*I != OnlyStore)
- continue; // Do not promote the uses of this in this block.
- }
-
- // Otherwise, if this is a different block or if all uses happen
- // after the store, do a simple linear scan to replace loads with
- // the stored value.
- for (BasicBlock::iterator I = UseBlock->begin(), E = UseBlock->end();
- I != E; ) {
- if (LoadInst *LI = dyn_cast<LoadInst>(I++)) {
- if (LI->getOperand(0) == AI) {
- LI->replaceAllUsesWith(OnlyStore->getOperand(0));
- if (AST && isa<PointerType>(LI->getType()))
- AST->deleteValue(LI);
- LI->eraseFromParent();
- }
- }
- }
-
- // Finally, remove this block from the UsingBlock set.
- Info.UsingBlocks[i] = Info.UsingBlocks.back();
- Info.UsingBlocks.pop_back();
- --i; --e;
- }
-}
-
-
-/// PromoteLocallyUsedAlloca - Many allocas are only used within a single basic
-/// block. If this is the case, avoid traversing the CFG and inserting a lot of
-/// potentially useless PHI nodes by just performing a single linear pass over
-/// the basic block using the Alloca.
-///
-/// If we cannot promote this alloca (because it is read before it is written),
-/// return true. This is necessary in cases where, due to control flow, the
-/// alloca is potentially undefined on some control flow paths. e.g. code like
-/// this is potentially correct:
-///
-/// for (...) { if (c) { A = undef; undef = B; } }
-///
-/// ... so long as A is not used before undef is set.
-///
-bool PromoteMem2Reg::PromoteLocallyUsedAlloca(BasicBlock *BB, AllocaInst *AI) {
- assert(!AI->use_empty() && "There are no uses of the alloca!");
-
- // Handle degenerate cases quickly.
- if (AI->hasOneUse()) {
- Instruction *U = cast<Instruction>(AI->use_back());
- if (LoadInst *LI = dyn_cast<LoadInst>(U)) {
- // Must be a load of uninitialized value.
- LI->replaceAllUsesWith(UndefValue::get(AI->getAllocatedType()));
- if (AST && isa<PointerType>(LI->getType()))
- AST->deleteValue(LI);
- } else {
- // Otherwise it must be a store which is never read.
- assert(isa<StoreInst>(U));
- }
- BB->getInstList().erase(U);
- } else {
- // Uses of the uninitialized memory location shall get undef.
- Value *CurVal = 0;
-
- for (BasicBlock::iterator I = BB->begin(), E = BB->end(); I != E; ) {
- Instruction *Inst = I++;
- if (LoadInst *LI = dyn_cast<LoadInst>(Inst)) {
- if (LI->getOperand(0) == AI) {
- if (!CurVal) return true; // Could not locally promote!
-
- // Loads just returns the "current value"...
- LI->replaceAllUsesWith(CurVal);
- if (AST && isa<PointerType>(LI->getType()))
- AST->deleteValue(LI);
- BB->getInstList().erase(LI);
- }
- } else if (StoreInst *SI = dyn_cast<StoreInst>(Inst)) {
- if (SI->getOperand(1) == AI) {
- // Store updates the "current value"...
- CurVal = SI->getOperand(0);
- BB->getInstList().erase(SI);
- }
- }
- }
- }
-
- // After traversing the basic block, there should be no more uses of the
- // alloca: remove it now.
- assert(AI->use_empty() && "Uses of alloca from more than one BB??");
- if (AST) AST->deleteValue(AI);
- AI->eraseFromParent();
-
- ++NumLocalPromoted;
- return false;
-}
-
-/// PromoteLocallyUsedAllocas - This method is just like
-/// PromoteLocallyUsedAlloca, except that it processes multiple alloca
-/// instructions in parallel. This is important in cases where we have large
-/// basic blocks, as we don't want to rescan the entire basic block for each
-/// alloca which is locally used in it (which might be a lot).
-void PromoteMem2Reg::
-PromoteLocallyUsedAllocas(BasicBlock *BB, const std::vector<AllocaInst*> &AIs) {
- DenseMap<AllocaInst*, Value*> CurValues;
- for (unsigned i = 0, e = AIs.size(); i != e; ++i)
- CurValues[AIs[i]] = 0; // Insert with null value
-
- for (BasicBlock::iterator I = BB->begin(), E = BB->end(); I != E; ) {
- Instruction *Inst = I++;
- if (LoadInst *LI = dyn_cast<LoadInst>(Inst)) {
- // Is this a load of an alloca we are tracking?
- if (AllocaInst *AI = dyn_cast<AllocaInst>(LI->getOperand(0))) {
- DenseMap<AllocaInst*, Value*>::iterator AIt = CurValues.find(AI);
- if (AIt != CurValues.end()) {
- // If loading an uninitialized value, allow the inter-block case to
- // handle it. Due to control flow, this might actually be ok.
- if (AIt->second == 0) { // Use of locally uninitialized value??
- RetryList.push_back(AI); // Retry elsewhere.
- CurValues.erase(AIt); // Stop tracking this here.
- if (CurValues.empty()) return;
- } else {
- // Loads just returns the "current value"...
- LI->replaceAllUsesWith(AIt->second);
- if (AST && isa<PointerType>(LI->getType()))
- AST->deleteValue(LI);
- BB->getInstList().erase(LI);
- }
- }
- }
- } else if (StoreInst *SI = dyn_cast<StoreInst>(Inst)) {
- if (AllocaInst *AI = dyn_cast<AllocaInst>(SI->getOperand(1))) {
- DenseMap<AllocaInst*, Value*>::iterator AIt = CurValues.find(AI);
- if (AIt != CurValues.end()) {
- // Store updates the "current value"...
- AIt->second = SI->getOperand(0);
- SI->eraseFromParent();
- }
- }
- }
- }
-
- // At the end of the block scan, all allocas in CurValues are dead.
- for (DenseMap<AllocaInst*, Value*>::iterator I = CurValues.begin(),
- E = CurValues.end(); I != E; ++I) {
- AllocaInst *AI = I->first;
- assert(AI->use_empty() && "Uses of alloca from more than one BB??");
- if (AST) AST->deleteValue(AI);
- AI->eraseFromParent();
- }
-
- NumLocalPromoted += CurValues.size();
-}
-
-
-
-// QueuePhiNode - queues a phi-node to be added to a basic-block for a specific
-// Alloca returns true if there wasn't already a phi-node for that variable
-//
-bool PromoteMem2Reg::QueuePhiNode(BasicBlock *BB, unsigned AllocaNo,
- unsigned &Version,
- SmallPtrSet<PHINode*, 16> &InsertedPHINodes) {
- // Look up the basic-block in question.
- PHINode *&PN = NewPhiNodes[std::make_pair(BB, AllocaNo)];
-
- // If the BB already has a phi node added for the i'th alloca then we're done!
- if (PN) return false;
-
- // Create a PhiNode using the dereferenced type... and add the phi-node to the
- // BasicBlock.
- PN = PHINode::Create(Allocas[AllocaNo]->getAllocatedType(),
- Allocas[AllocaNo]->getName() + "." +
- utostr(Version++), BB->begin());
- ++NumPHIInsert;
- PhiToAllocaMap[PN] = AllocaNo;
- PN->reserveOperandSpace(getNumPreds(BB));
-
- InsertedPHINodes.insert(PN);
-
- if (AST && isa<PointerType>(PN->getType()))
- AST->copyValue(PointerAllocaValues[AllocaNo], PN);
-
- return true;
-}
-
-// RenamePass - Recursively traverse the CFG of the function, renaming loads and
-// stores to the allocas which we are promoting. IncomingVals indicates what
-// value each Alloca contains on exit from the predecessor block Pred.
-//
-void PromoteMem2Reg::RenamePass(BasicBlock *BB, BasicBlock *Pred,
- RenamePassData::ValVector &IncomingVals,
- std::vector<RenamePassData> &Worklist) {
-NextIteration:
- // If we are inserting any phi nodes into this BB, they will already be in the
- // block.
- if (PHINode *APN = dyn_cast<PHINode>(BB->begin())) {
- // Pred may have multiple edges to BB. If so, we want to add N incoming
- // values to each PHI we are inserting on the first time we see the edge.
- // Check to see if APN already has incoming values from Pred. This also
- // prevents us from modifying PHI nodes that are not currently being
- // inserted.
- bool HasPredEntries = false;
- for (unsigned i = 0, e = APN->getNumIncomingValues(); i != e; ++i) {
- if (APN->getIncomingBlock(i) == Pred) {
- HasPredEntries = true;
- break;
- }
- }
-
- // If we have PHI nodes to update, compute the number of edges from Pred to
- // BB.
- if (!HasPredEntries) {
- // We want to be able to distinguish between PHI nodes being inserted by
- // this invocation of mem2reg from those phi nodes that already existed in
- // the IR before mem2reg was run. We determine that APN is being inserted
- // because it is missing incoming edges. All other PHI nodes being
- // inserted by this pass of mem2reg will have the same number of incoming
- // operands so far. Remember this count.
- unsigned NewPHINumOperands = APN->getNumOperands();
-
- unsigned NumEdges = 0;
- for (succ_iterator I = succ_begin(Pred), E = succ_end(Pred); I != E; ++I)
- if (*I == BB)
- ++NumEdges;
- assert(NumEdges && "Must be at least one edge from Pred to BB!");
-
- // Add entries for all the phis.
- BasicBlock::iterator PNI = BB->begin();
- do {
- unsigned AllocaNo = PhiToAllocaMap[APN];
-
- // Add N incoming values to the PHI node.
- for (unsigned i = 0; i != NumEdges; ++i)
- APN->addIncoming(IncomingVals[AllocaNo], Pred);
-
- // The currently active variable for this block is now the PHI.
- IncomingVals[AllocaNo] = APN;
-
- // Get the next phi node.
- ++PNI;
- APN = dyn_cast<PHINode>(PNI);
- if (APN == 0) break;
-
- // Verify that it is missing entries. If not, it is not being inserted
- // by this mem2reg invocation so we want to ignore it.
- } while (APN->getNumOperands() == NewPHINumOperands);
- }
- }
-
- // Don't revisit blocks.
- if (!Visited.insert(BB)) return;
-
- for (BasicBlock::iterator II = BB->begin(); !isa<TerminatorInst>(II); ) {
- Instruction *I = II++; // get the instruction, increment iterator
-
- if (LoadInst *LI = dyn_cast<LoadInst>(I)) {
- AllocaInst *Src = dyn_cast<AllocaInst>(LI->getPointerOperand());
- if (!Src) continue;
-
- std::map<AllocaInst*, unsigned>::iterator AI = AllocaLookup.find(Src);
- if (AI == AllocaLookup.end()) continue;
-
- Value *V = IncomingVals[AI->second];
-
- // Anything using the load now uses the current value.
- LI->replaceAllUsesWith(V);
- if (AST && isa<PointerType>(LI->getType()))
- AST->deleteValue(LI);
- BB->getInstList().erase(LI);
- } else if (StoreInst *SI = dyn_cast<StoreInst>(I)) {
- // Delete this instruction and mark the name as the current holder of the
- // value
- AllocaInst *Dest = dyn_cast<AllocaInst>(SI->getPointerOperand());
- if (!Dest) continue;
-
- std::map<AllocaInst *, unsigned>::iterator ai = AllocaLookup.find(Dest);
- if (ai == AllocaLookup.end())
- continue;
-
- // what value were we writing?
- IncomingVals[ai->second] = SI->getOperand(0);
- BB->getInstList().erase(SI);
- }
- }
-
- // 'Recurse' to our successors.
- succ_iterator I = succ_begin(BB), E = succ_end(BB);
- if (I == E) return;
-
- // Handle the last successor without using the worklist. This allows us to
- // handle unconditional branches directly, for example.
- --E;
- for (; I != E; ++I)
- Worklist.push_back(RenamePassData(*I, BB, IncomingVals));
-
- Pred = BB;
- BB = *I;
- goto NextIteration;
-}
-
-/// PromoteMemToReg - Promote the specified list of alloca instructions into
-/// scalar registers, inserting PHI nodes as appropriate. This function makes
-/// use of DominanceFrontier information. This function does not modify the CFG
-/// of the function at all. All allocas must be from the same function.
-///
-/// If AST is specified, the specified tracker is updated to reflect changes
-/// made to the IR.
-///
-void llvm::PromoteMemToReg(const std::vector<AllocaInst*> &Allocas,
- DominatorTree &DT, DominanceFrontier &DF,
- AliasSetTracker *AST) {
- // If there is nothing to do, bail out...
- if (Allocas.empty()) return;
-
- SmallVector<AllocaInst*, 16> RetryList;
- PromoteMem2Reg(Allocas, RetryList, DT, DF, AST).run();
-
- // PromoteMem2Reg may not have been able to promote all of the allocas in one
- // pass, run it again if needed.
- std::vector<AllocaInst*> NewAllocas;
- while (!RetryList.empty()) {
- // If we need to retry some allocas, this is due to there being no store
- // before a read in a local block. To counteract this, insert a store of
- // undef into the alloca right after the alloca itself.
- for (unsigned i = 0, e = RetryList.size(); i != e; ++i) {
- BasicBlock::iterator BBI = RetryList[i];
-
- new StoreInst(UndefValue::get(RetryList[i]->getAllocatedType()),
- RetryList[i], ++BBI);
- }
-
- NewAllocas.assign(RetryList.begin(), RetryList.end());
- RetryList.clear();
- PromoteMem2Reg(NewAllocas, RetryList, DT, DF, AST).run();
- NewAllocas.clear();
- }
-}
diff --git a/release_23/lib/Transforms/Utils/SimplifyCFG.cpp b/release_23/lib/Transforms/Utils/SimplifyCFG.cpp
deleted file mode 100644
index b584e13876e9..000000000000
--- a/release_23/lib/Transforms/Utils/SimplifyCFG.cpp
+++ /dev/null
@@ -1,1950 +0,0 @@
-//===- SimplifyCFG.cpp - Code to perform CFG simplification ---------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// Peephole optimize the CFG.
-//
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "simplifycfg"
-#include "llvm/Transforms/Utils/Local.h"
-#include "llvm/Constants.h"
-#include "llvm/Instructions.h"
-#include "llvm/Type.h"
-#include "llvm/DerivedTypes.h"
-#include "llvm/Support/CFG.h"
-#include "llvm/Support/Debug.h"
-#include "llvm/Analysis/ConstantFolding.h"
-#include "llvm/Transforms/Utils/BasicBlockUtils.h"
-#include "llvm/ADT/SmallVector.h"
-#include "llvm/ADT/SmallPtrSet.h"
-#include <algorithm>
-#include <functional>
-#include <set>
-#include <map>
-using namespace llvm;
-
-/// SafeToMergeTerminators - Return true if it is safe to merge these two
-/// terminator instructions together.
-///
-static bool SafeToMergeTerminators(TerminatorInst *SI1, TerminatorInst *SI2) {
- if (SI1 == SI2) return false; // Can't merge with self!
-
- // It is not safe to merge these two switch instructions if they have a common
- // successor, and if that successor has a PHI node, and if *that* PHI node has
- // conflicting incoming values from the two switch blocks.
- BasicBlock *SI1BB = SI1->getParent();
- BasicBlock *SI2BB = SI2->getParent();
- SmallPtrSet<BasicBlock*, 16> SI1Succs(succ_begin(SI1BB), succ_end(SI1BB));
-
- for (succ_iterator I = succ_begin(SI2BB), E = succ_end(SI2BB); I != E; ++I)
- if (SI1Succs.count(*I))
- for (BasicBlock::iterator BBI = (*I)->begin();
- isa<PHINode>(BBI); ++BBI) {
- PHINode *PN = cast<PHINode>(BBI);
- if (PN->getIncomingValueForBlock(SI1BB) !=
- PN->getIncomingValueForBlock(SI2BB))
- return false;
- }
-
- return true;
-}
-
-/// AddPredecessorToBlock - Update PHI nodes in Succ to indicate that there will
-/// now be entries in it from the 'NewPred' block. The values that will be
-/// flowing into the PHI nodes will be the same as those coming in from
-/// ExistPred, an existing predecessor of Succ.
-static void AddPredecessorToBlock(BasicBlock *Succ, BasicBlock *NewPred,
- BasicBlock *ExistPred) {
- assert(std::find(succ_begin(ExistPred), succ_end(ExistPred), Succ) !=
- succ_end(ExistPred) && "ExistPred is not a predecessor of Succ!");
- if (!isa<PHINode>(Succ->begin())) return; // Quick exit if nothing to do
-
- for (BasicBlock::iterator I = Succ->begin(); isa<PHINode>(I); ++I) {
- PHINode *PN = cast<PHINode>(I);
- Value *V = PN->getIncomingValueForBlock(ExistPred);
- PN->addIncoming(V, NewPred);
- }
-}
-
-// CanPropagatePredecessorsForPHIs - Return true if we can fold BB, an
-// almost-empty BB ending in an unconditional branch to Succ, into succ.
-//
-// Assumption: Succ is the single successor for BB.
-//
-static bool CanPropagatePredecessorsForPHIs(BasicBlock *BB, BasicBlock *Succ) {
- assert(*succ_begin(BB) == Succ && "Succ is not successor of BB!");
-
- // Check to see if one of the predecessors of BB is already a predecessor of
- // Succ. If so, we cannot do the transformation if there are any PHI nodes
- // with incompatible values coming in from the two edges!
- //
- if (isa<PHINode>(Succ->front())) {
- SmallPtrSet<BasicBlock*, 16> BBPreds(pred_begin(BB), pred_end(BB));
- for (pred_iterator PI = pred_begin(Succ), PE = pred_end(Succ);
- PI != PE; ++PI)
- if (BBPreds.count(*PI)) {
- // Loop over all of the PHI nodes checking to see if there are
- // incompatible values coming in.
- for (BasicBlock::iterator I = Succ->begin(); isa<PHINode>(I); ++I) {
- PHINode *PN = cast<PHINode>(I);
- // Loop up the entries in the PHI node for BB and for *PI if the
- // values coming in are non-equal, we cannot merge these two blocks
- // (instead we should insert a conditional move or something, then
- // merge the blocks).
- if (PN->getIncomingValueForBlock(BB) !=
- PN->getIncomingValueForBlock(*PI))
- return false; // Values are not equal...
- }
- }
- }
-
- // Finally, if BB has PHI nodes that are used by things other than the PHIs in
- // Succ and Succ has predecessors that are not Succ and not Pred, we cannot
- // fold these blocks, as we don't know whether BB dominates Succ or not to
- // update the PHI nodes correctly.
- if (!isa<PHINode>(BB->begin()) || Succ->getSinglePredecessor()) return true;
-
- // If the predecessors of Succ are only BB, handle it.
- bool IsSafe = true;
- for (pred_iterator PI = pred_begin(Succ), E = pred_end(Succ); PI != E; ++PI)
- if (*PI != BB) {
- IsSafe = false;
- break;
- }
- if (IsSafe) return true;
-
- // If the PHI nodes in BB are only used by instructions in Succ, we are ok if
- // BB and Succ have no common predecessors.
- for (BasicBlock::iterator I = BB->begin(); isa<PHINode>(I); ++I) {
- PHINode *PN = cast<PHINode>(I);
- for (Value::use_iterator UI = PN->use_begin(), E = PN->use_end(); UI != E;
- ++UI)
- if (cast<Instruction>(*UI)->getParent() != Succ)
- return false;
- }
-
- // Scan the predecessor sets of BB and Succ, making sure there are no common
- // predecessors. Common predecessors would cause us to build a phi node with
- // differing incoming values, which is not legal.
- SmallPtrSet<BasicBlock*, 16> BBPreds(pred_begin(BB), pred_end(BB));
- for (pred_iterator PI = pred_begin(Succ), E = pred_end(Succ); PI != E; ++PI)
- if (BBPreds.count(*PI))
- return false;
-
- return true;
-}
-
-/// TryToSimplifyUncondBranchFromEmptyBlock - BB contains an unconditional
-/// branch to Succ, and contains no instructions other than PHI nodes and the
-/// branch. If possible, eliminate BB.
-static bool TryToSimplifyUncondBranchFromEmptyBlock(BasicBlock *BB,
- BasicBlock *Succ) {
- // If our successor has PHI nodes, then we need to update them to include
- // entries for BB's predecessors, not for BB itself. Be careful though,
- // if this transformation fails (returns true) then we cannot do this
- // transformation!
- //
- if (!CanPropagatePredecessorsForPHIs(BB, Succ)) return false;
-
- DOUT << "Killing Trivial BB: \n" << *BB;
-
- if (isa<PHINode>(Succ->begin())) {
- // If there is more than one pred of succ, and there are PHI nodes in
- // the successor, then we need to add incoming edges for the PHI nodes
- //
- const SmallVector<BasicBlock*, 16> BBPreds(pred_begin(BB), pred_end(BB));
-
- // Loop over all of the PHI nodes in the successor of BB.
- for (BasicBlock::iterator I = Succ->begin(); isa<PHINode>(I); ++I) {
- PHINode *PN = cast<PHINode>(I);
- Value *OldVal = PN->removeIncomingValue(BB, false);
- assert(OldVal && "No entry in PHI for Pred BB!");
-
- // If this incoming value is one of the PHI nodes in BB, the new entries
- // in the PHI node are the entries from the old PHI.
- if (isa<PHINode>(OldVal) && cast<PHINode>(OldVal)->getParent() == BB) {
- PHINode *OldValPN = cast<PHINode>(OldVal);
- for (unsigned i = 0, e = OldValPN->getNumIncomingValues(); i != e; ++i)
- PN->addIncoming(OldValPN->getIncomingValue(i),
- OldValPN->getIncomingBlock(i));
- } else {
- // Add an incoming value for each of the new incoming values.
- for (unsigned i = 0, e = BBPreds.size(); i != e; ++i)
- PN->addIncoming(OldVal, BBPreds[i]);
- }
- }
- }
-
- if (isa<PHINode>(&BB->front())) {
- SmallVector<BasicBlock*, 16>
- OldSuccPreds(pred_begin(Succ), pred_end(Succ));
-
- // Move all PHI nodes in BB to Succ if they are alive, otherwise
- // delete them.
- while (PHINode *PN = dyn_cast<PHINode>(&BB->front()))
- if (PN->use_empty()) {
- // Just remove the dead phi. This happens if Succ's PHIs were the only
- // users of the PHI nodes.
- PN->eraseFromParent();
- } else {
- // The instruction is alive, so this means that Succ must have
- // *ONLY* had BB as a predecessor, and the PHI node is still valid
- // now. Simply move it into Succ, because we know that BB
- // strictly dominated Succ.
- Succ->getInstList().splice(Succ->begin(),
- BB->getInstList(), BB->begin());
-
- // We need to add new entries for the PHI node to account for
- // predecessors of Succ that the PHI node does not take into
- // account. At this point, since we know that BB dominated succ,
- // this means that we should any newly added incoming edges should
- // use the PHI node as the value for these edges, because they are
- // loop back edges.
- for (unsigned i = 0, e = OldSuccPreds.size(); i != e; ++i)
- if (OldSuccPreds[i] != BB)
- PN->addIncoming(PN, OldSuccPreds[i]);
- }
- }
-
- // Everything that jumped to BB now goes to Succ.
- BB->replaceAllUsesWith(Succ);
- if (!Succ->hasName()) Succ->takeName(BB);
- BB->eraseFromParent(); // Delete the old basic block.
- return true;
-}
-
-/// GetIfCondition - Given a basic block (BB) with two predecessors (and
-/// presumably PHI nodes in it), check to see if the merge at this block is due
-/// to an "if condition". If so, return the boolean condition that determines
-/// which entry into BB will be taken. Also, return by references the block
-/// that will be entered from if the condition is true, and the block that will
-/// be entered if the condition is false.
-///
-///
-static Value *GetIfCondition(BasicBlock *BB,
- BasicBlock *&IfTrue, BasicBlock *&IfFalse) {
- assert(std::distance(pred_begin(BB), pred_end(BB)) == 2 &&
- "Function can only handle blocks with 2 predecessors!");
- BasicBlock *Pred1 = *pred_begin(BB);
- BasicBlock *Pred2 = *++pred_begin(BB);
-
- // We can only handle branches. Other control flow will be lowered to
- // branches if possible anyway.
- if (!isa<BranchInst>(Pred1->getTerminator()) ||
- !isa<BranchInst>(Pred2->getTerminator()))
- return 0;
- BranchInst *Pred1Br = cast<BranchInst>(Pred1->getTerminator());
- BranchInst *Pred2Br = cast<BranchInst>(Pred2->getTerminator());
-
- // Eliminate code duplication by ensuring that Pred1Br is conditional if
- // either are.
- if (Pred2Br->isConditional()) {
- // If both branches are conditional, we don't have an "if statement". In
- // reality, we could transform this case, but since the condition will be
- // required anyway, we stand no chance of eliminating it, so the xform is
- // probably not profitable.
- if (Pred1Br->isConditional())
- return 0;
-
- std::swap(Pred1, Pred2);
- std::swap(Pred1Br, Pred2Br);
- }
-
- if (Pred1Br->isConditional()) {
- // If we found a conditional branch predecessor, make sure that it branches
- // to BB and Pred2Br. If it doesn't, this isn't an "if statement".
- if (Pred1Br->getSuccessor(0) == BB &&
- Pred1Br->getSuccessor(1) == Pred2) {
- IfTrue = Pred1;
- IfFalse = Pred2;
- } else if (Pred1Br->getSuccessor(0) == Pred2 &&
- Pred1Br->getSuccessor(1) == BB) {
- IfTrue = Pred2;
- IfFalse = Pred1;
- } else {
- // We know that one arm of the conditional goes to BB, so the other must
- // go somewhere unrelated, and this must not be an "if statement".
- return 0;
- }
-
- // The only thing we have to watch out for here is to make sure that Pred2
- // doesn't have incoming edges from other blocks. If it does, the condition
- // doesn't dominate BB.
- if (++pred_begin(Pred2) != pred_end(Pred2))
- return 0;
-
- return Pred1Br->getCondition();
- }
-
- // Ok, if we got here, both predecessors end with an unconditional branch to
- // BB. Don't panic! If both blocks only have a single (identical)
- // predecessor, and THAT is a conditional branch, then we're all ok!
- if (pred_begin(Pred1) == pred_end(Pred1) ||
- ++pred_begin(Pred1) != pred_end(Pred1) ||
- pred_begin(Pred2) == pred_end(Pred2) ||
- ++pred_begin(Pred2) != pred_end(Pred2) ||
- *pred_begin(Pred1) != *pred_begin(Pred2))
- return 0;
-
- // Otherwise, if this is a conditional branch, then we can use it!
- BasicBlock *CommonPred = *pred_begin(Pred1);
- if (BranchInst *BI = dyn_cast<BranchInst>(CommonPred->getTerminator())) {
- assert(BI->isConditional() && "Two successors but not conditional?");
- if (BI->getSuccessor(0) == Pred1) {
- IfTrue = Pred1;
- IfFalse = Pred2;
- } else {
- IfTrue = Pred2;
- IfFalse = Pred1;
- }
- return BI->getCondition();
- }
- return 0;
-}
-
-
-// If we have a merge point of an "if condition" as accepted above, return true
-// if the specified value dominates the block. We don't handle the true
-// generality of domination here, just a special case which works well enough
-// for us.
-//
-// If AggressiveInsts is non-null, and if V does not dominate BB, we check to
-// see if V (which must be an instruction) is cheap to compute and is
-// non-trapping. If both are true, the instruction is inserted into the set and
-// true is returned.
-static bool DominatesMergePoint(Value *V, BasicBlock *BB,
- std::set<Instruction*> *AggressiveInsts) {
- Instruction *I = dyn_cast<Instruction>(V);
- if (!I) {
- // Non-instructions all dominate instructions, but not all constantexprs
- // can be executed unconditionally.
- if (ConstantExpr *C = dyn_cast<ConstantExpr>(V))
- if (C->canTrap())
- return false;
- return true;
- }
- BasicBlock *PBB = I->getParent();
-
- // We don't want to allow weird loops that might have the "if condition" in
- // the bottom of this block.
- if (PBB == BB) return false;
-
- // If this instruction is defined in a block that contains an unconditional
- // branch to BB, then it must be in the 'conditional' part of the "if
- // statement".
- if (BranchInst *BI = dyn_cast<BranchInst>(PBB->getTerminator()))
- if (BI->isUnconditional() && BI->getSuccessor(0) == BB) {
- if (!AggressiveInsts) return false;
- // Okay, it looks like the instruction IS in the "condition". Check to
- // see if its a cheap instruction to unconditionally compute, and if it
- // only uses stuff defined outside of the condition. If so, hoist it out.
- switch (I->getOpcode()) {
- default: return false; // Cannot hoist this out safely.
- case Instruction::Load:
- // We can hoist loads that are non-volatile and obviously cannot trap.
- if (cast<LoadInst>(I)->isVolatile())
- return false;
- if (!isa<AllocaInst>(I->getOperand(0)) &&
- !isa<Constant>(I->getOperand(0)))
- return false;
-
- // Finally, we have to check to make sure there are no instructions
- // before the load in its basic block, as we are going to hoist the loop
- // out to its predecessor.
- if (PBB->begin() != BasicBlock::iterator(I))
- return false;
- break;
- case Instruction::Add:
- case Instruction::Sub:
- case Instruction::And:
- case Instruction::Or:
- case Instruction::Xor:
- case Instruction::Shl:
- case Instruction::LShr:
- case Instruction::AShr:
- case Instruction::ICmp:
- case Instruction::FCmp:
- if (I->getOperand(0)->getType()->isFPOrFPVector())
- return false; // FP arithmetic might trap.
- break; // These are all cheap and non-trapping instructions.
- }
-
- // Okay, we can only really hoist these out if their operands are not
- // defined in the conditional region.
- for (unsigned i = 0, e = I->getNumOperands(); i != e; ++i)
- if (!DominatesMergePoint(I->getOperand(i), BB, 0))
- return false;
- // Okay, it's safe to do this! Remember this instruction.
- AggressiveInsts->insert(I);
- }
-
- return true;
-}
-
-// GatherConstantSetEQs - Given a potentially 'or'd together collection of
-// icmp_eq instructions that compare a value against a constant, return the
-// value being compared, and stick the constant into the Values vector.
-static Value *GatherConstantSetEQs(Value *V, std::vector<ConstantInt*> &Values){
- if (Instruction *Inst = dyn_cast<Instruction>(V)) {
- if (Inst->getOpcode() == Instruction::ICmp &&
- cast<ICmpInst>(Inst)->getPredicate() == ICmpInst::ICMP_EQ) {
- if (ConstantInt *C = dyn_cast<ConstantInt>(Inst->getOperand(1))) {
- Values.push_back(C);
- return Inst->getOperand(0);
- } else if (ConstantInt *C = dyn_cast<ConstantInt>(Inst->getOperand(0))) {
- Values.push_back(C);
- return Inst->getOperand(1);
- }
- } else if (Inst->getOpcode() == Instruction::Or) {
- if (Value *LHS = GatherConstantSetEQs(Inst->getOperand(0), Values))
- if (Value *RHS = GatherConstantSetEQs(Inst->getOperand(1), Values))
- if (LHS == RHS)
- return LHS;
- }
- }
- return 0;
-}
-
-// GatherConstantSetNEs - Given a potentially 'and'd together collection of
-// setne instructions that compare a value against a constant, return the value
-// being compared, and stick the constant into the Values vector.
-static Value *GatherConstantSetNEs(Value *V, std::vector<ConstantInt*> &Values){
- if (Instruction *Inst = dyn_cast<Instruction>(V)) {
- if (Inst->getOpcode() == Instruction::ICmp &&
- cast<ICmpInst>(Inst)->getPredicate() == ICmpInst::ICMP_NE) {
- if (ConstantInt *C = dyn_cast<ConstantInt>(Inst->getOperand(1))) {
- Values.push_back(C);
- return Inst->getOperand(0);
- } else if (ConstantInt *C = dyn_cast<ConstantInt>(Inst->getOperand(0))) {
- Values.push_back(C);
- return Inst->getOperand(1);
- }
- } else if (Inst->getOpcode() == Instruction::And) {
- if (Value *LHS = GatherConstantSetNEs(Inst->getOperand(0), Values))
- if (Value *RHS = GatherConstantSetNEs(Inst->getOperand(1), Values))
- if (LHS == RHS)
- return LHS;
- }
- }
- return 0;
-}
-
-
-
-/// GatherValueComparisons - If the specified Cond is an 'and' or 'or' of a
-/// bunch of comparisons of one value against constants, return the value and
-/// the constants being compared.
-static bool GatherValueComparisons(Instruction *Cond, Value *&CompVal,
- std::vector<ConstantInt*> &Values) {
- if (Cond->getOpcode() == Instruction::Or) {
- CompVal = GatherConstantSetEQs(Cond, Values);
-
- // Return true to indicate that the condition is true if the CompVal is
- // equal to one of the constants.
- return true;
- } else if (Cond->getOpcode() == Instruction::And) {
- CompVal = GatherConstantSetNEs(Cond, Values);
-
- // Return false to indicate that the condition is false if the CompVal is
- // equal to one of the constants.
- return false;
- }
- return false;
-}
-
-/// ErasePossiblyDeadInstructionTree - If the specified instruction is dead and
-/// has no side effects, nuke it. If it uses any instructions that become dead
-/// because the instruction is now gone, nuke them too.
-static void ErasePossiblyDeadInstructionTree(Instruction *I) {
- if (!isInstructionTriviallyDead(I)) return;
-
- SmallVector<Instruction*, 16> InstrsToInspect;
- InstrsToInspect.push_back(I);
-
- while (!InstrsToInspect.empty()) {
- I = InstrsToInspect.back();
- InstrsToInspect.pop_back();
-
- if (!isInstructionTriviallyDead(I)) continue;
-
- // If I is in the work list multiple times, remove previous instances.
- for (unsigned i = 0, e = InstrsToInspect.size(); i != e; ++i)
- if (InstrsToInspect[i] == I) {
- InstrsToInspect.erase(InstrsToInspect.begin()+i);
- --i, --e;
- }
-
- // Add operands of dead instruction to worklist.
- for (unsigned i = 0, e = I->getNumOperands(); i != e; ++i)
- if (Instruction *OpI = dyn_cast<Instruction>(I->getOperand(i)))
- InstrsToInspect.push_back(OpI);
-
- // Remove dead instruction.
- I->eraseFromParent();
- }
-}
-
-// isValueEqualityComparison - Return true if the specified terminator checks to
-// see if a value is equal to constant integer value.
-static Value *isValueEqualityComparison(TerminatorInst *TI) {
- if (SwitchInst *SI = dyn_cast<SwitchInst>(TI)) {
- // Do not permit merging of large switch instructions into their
- // predecessors unless there is only one predecessor.
- if (SI->getNumSuccessors() * std::distance(pred_begin(SI->getParent()),
- pred_end(SI->getParent())) > 128)
- return 0;
-
- return SI->getCondition();
- }
- if (BranchInst *BI = dyn_cast<BranchInst>(TI))
- if (BI->isConditional() && BI->getCondition()->hasOneUse())
- if (ICmpInst *ICI = dyn_cast<ICmpInst>(BI->getCondition()))
- if ((ICI->getPredicate() == ICmpInst::ICMP_EQ ||
- ICI->getPredicate() == ICmpInst::ICMP_NE) &&
- isa<ConstantInt>(ICI->getOperand(1)))
- return ICI->getOperand(0);
- return 0;
-}
-
-// Given a value comparison instruction, decode all of the 'cases' that it
-// represents and return the 'default' block.
-static BasicBlock *
-GetValueEqualityComparisonCases(TerminatorInst *TI,
- std::vector<std::pair<ConstantInt*,
- BasicBlock*> > &Cases) {
- if (SwitchInst *SI = dyn_cast<SwitchInst>(TI)) {
- Cases.reserve(SI->getNumCases());
- for (unsigned i = 1, e = SI->getNumCases(); i != e; ++i)
- Cases.push_back(std::make_pair(SI->getCaseValue(i), SI->getSuccessor(i)));
- return SI->getDefaultDest();
- }
-
- BranchInst *BI = cast<BranchInst>(TI);
- ICmpInst *ICI = cast<ICmpInst>(BI->getCondition());
- Cases.push_back(std::make_pair(cast<ConstantInt>(ICI->getOperand(1)),
- BI->getSuccessor(ICI->getPredicate() ==
- ICmpInst::ICMP_NE)));
- return BI->getSuccessor(ICI->getPredicate() == ICmpInst::ICMP_EQ);
-}
-
-
-// EliminateBlockCases - Given a vector of bb/value pairs, remove any entries
-// in the list that match the specified block.
-static void EliminateBlockCases(BasicBlock *BB,
- std::vector<std::pair<ConstantInt*, BasicBlock*> > &Cases) {
- for (unsigned i = 0, e = Cases.size(); i != e; ++i)
- if (Cases[i].second == BB) {
- Cases.erase(Cases.begin()+i);
- --i; --e;
- }
-}
-
-// ValuesOverlap - Return true if there are any keys in C1 that exist in C2 as
-// well.
-static bool
-ValuesOverlap(std::vector<std::pair<ConstantInt*, BasicBlock*> > &C1,
- std::vector<std::pair<ConstantInt*, BasicBlock*> > &C2) {
- std::vector<std::pair<ConstantInt*, BasicBlock*> > *V1 = &C1, *V2 = &C2;
-
- // Make V1 be smaller than V2.
- if (V1->size() > V2->size())
- std::swap(V1, V2);
-
- if (V1->size() == 0) return false;
- if (V1->size() == 1) {
- // Just scan V2.
- ConstantInt *TheVal = (*V1)[0].first;
- for (unsigned i = 0, e = V2->size(); i != e; ++i)
- if (TheVal == (*V2)[i].first)
- return true;
- }
-
- // Otherwise, just sort both lists and compare element by element.
- std::sort(V1->begin(), V1->end());
- std::sort(V2->begin(), V2->end());
- unsigned i1 = 0, i2 = 0, e1 = V1->size(), e2 = V2->size();
- while (i1 != e1 && i2 != e2) {
- if ((*V1)[i1].first == (*V2)[i2].first)
- return true;
- if ((*V1)[i1].first < (*V2)[i2].first)
- ++i1;
- else
- ++i2;
- }
- return false;
-}
-
-// SimplifyEqualityComparisonWithOnlyPredecessor - If TI is known to be a
-// terminator instruction and its block is known to only have a single
-// predecessor block, check to see if that predecessor is also a value
-// comparison with the same value, and if that comparison determines the outcome
-// of this comparison. If so, simplify TI. This does a very limited form of
-// jump threading.
-static bool SimplifyEqualityComparisonWithOnlyPredecessor(TerminatorInst *TI,
- BasicBlock *Pred) {
- Value *PredVal = isValueEqualityComparison(Pred->getTerminator());
- if (!PredVal) return false; // Not a value comparison in predecessor.
-
- Value *ThisVal = isValueEqualityComparison(TI);
- assert(ThisVal && "This isn't a value comparison!!");
- if (ThisVal != PredVal) return false; // Different predicates.
-
- // Find out information about when control will move from Pred to TI's block.
- std::vector<std::pair<ConstantInt*, BasicBlock*> > PredCases;
- BasicBlock *PredDef = GetValueEqualityComparisonCases(Pred->getTerminator(),
- PredCases);
- EliminateBlockCases(PredDef, PredCases); // Remove default from cases.
-
- // Find information about how control leaves this block.
- std::vector<std::pair<ConstantInt*, BasicBlock*> > ThisCases;
- BasicBlock *ThisDef = GetValueEqualityComparisonCases(TI, ThisCases);
- EliminateBlockCases(ThisDef, ThisCases); // Remove default from cases.
-
- // If TI's block is the default block from Pred's comparison, potentially
- // simplify TI based on this knowledge.
- if (PredDef == TI->getParent()) {
- // If we are here, we know that the value is none of those cases listed in
- // PredCases. If there are any cases in ThisCases that are in PredCases, we
- // can simplify TI.
- if (ValuesOverlap(PredCases, ThisCases)) {
- if (BranchInst *BTI = dyn_cast<BranchInst>(TI)) {
- // Okay, one of the successors of this condbr is dead. Convert it to a
- // uncond br.
- assert(ThisCases.size() == 1 && "Branch can only have one case!");
- Value *Cond = BTI->getCondition();
- // Insert the new branch.
- Instruction *NI = BranchInst::Create(ThisDef, TI);
-
- // Remove PHI node entries for the dead edge.
- ThisCases[0].second->removePredecessor(TI->getParent());
-
- DOUT << "Threading pred instr: " << *Pred->getTerminator()
- << "Through successor TI: " << *TI << "Leaving: " << *NI << "\n";
-
- TI->eraseFromParent(); // Nuke the old one.
- // If condition is now dead, nuke it.
- if (Instruction *CondI = dyn_cast<Instruction>(Cond))
- ErasePossiblyDeadInstructionTree(CondI);
- return true;
-
- } else {
- SwitchInst *SI = cast<SwitchInst>(TI);
- // Okay, TI has cases that are statically dead, prune them away.
- SmallPtrSet<Constant*, 16> DeadCases;
- for (unsigned i = 0, e = PredCases.size(); i != e; ++i)
- DeadCases.insert(PredCases[i].first);
-
- DOUT << "Threading pred instr: " << *Pred->getTerminator()
- << "Through successor TI: " << *TI;
-
- for (unsigned i = SI->getNumCases()-1; i != 0; --i)
- if (DeadCases.count(SI->getCaseValue(i))) {
- SI->getSuccessor(i)->removePredecessor(TI->getParent());
- SI->removeCase(i);
- }
-
- DOUT << "Leaving: " << *TI << "\n";
- return true;
- }
- }
-
- } else {
- // Otherwise, TI's block must correspond to some matched value. Find out
- // which value (or set of values) this is.
- ConstantInt *TIV = 0;
- BasicBlock *TIBB = TI->getParent();
- for (unsigned i = 0, e = PredCases.size(); i != e; ++i)
- if (PredCases[i].second == TIBB) {
- if (TIV == 0)
- TIV = PredCases[i].first;
- else
- return false; // Cannot handle multiple values coming to this block.
- }
- assert(TIV && "No edge from pred to succ?");
-
- // Okay, we found the one constant that our value can be if we get into TI's
- // BB. Find out which successor will unconditionally be branched to.
- BasicBlock *TheRealDest = 0;
- for (unsigned i = 0, e = ThisCases.size(); i != e; ++i)
- if (ThisCases[i].first == TIV) {
- TheRealDest = ThisCases[i].second;
- break;
- }
-
- // If not handled by any explicit cases, it is handled by the default case.
- if (TheRealDest == 0) TheRealDest = ThisDef;
-
- // Remove PHI node entries for dead edges.
- BasicBlock *CheckEdge = TheRealDest;
- for (succ_iterator SI = succ_begin(TIBB), e = succ_end(TIBB); SI != e; ++SI)
- if (*SI != CheckEdge)
- (*SI)->removePredecessor(TIBB);
- else
- CheckEdge = 0;
-
- // Insert the new branch.
- Instruction *NI = BranchInst::Create(TheRealDest, TI);
-
- DOUT << "Threading pred instr: " << *Pred->getTerminator()
- << "Through successor TI: " << *TI << "Leaving: " << *NI << "\n";
- Instruction *Cond = 0;
- if (BranchInst *BI = dyn_cast<BranchInst>(TI))
- Cond = dyn_cast<Instruction>(BI->getCondition());
- TI->eraseFromParent(); // Nuke the old one.
-
- if (Cond) ErasePossiblyDeadInstructionTree(Cond);
- return true;
- }
- return false;
-}
-
-// FoldValueComparisonIntoPredecessors - The specified terminator is a value
-// equality comparison instruction (either a switch or a branch on "X == c").
-// See if any of the predecessors of the terminator block are value comparisons
-// on the same value. If so, and if safe to do so, fold them together.
-static bool FoldValueComparisonIntoPredecessors(TerminatorInst *TI) {
- BasicBlock *BB = TI->getParent();
- Value *CV = isValueEqualityComparison(TI); // CondVal
- assert(CV && "Not a comparison?");
- bool Changed = false;
-
- SmallVector<BasicBlock*, 16> Preds(pred_begin(BB), pred_end(BB));
- while (!Preds.empty()) {
- BasicBlock *Pred = Preds.back();
- Preds.pop_back();
-
- // See if the predecessor is a comparison with the same value.
- TerminatorInst *PTI = Pred->getTerminator();
- Value *PCV = isValueEqualityComparison(PTI); // PredCondVal
-
- if (PCV == CV && SafeToMergeTerminators(TI, PTI)) {
- // Figure out which 'cases' to copy from SI to PSI.
- std::vector<std::pair<ConstantInt*, BasicBlock*> > BBCases;
- BasicBlock *BBDefault = GetValueEqualityComparisonCases(TI, BBCases);
-
- std::vector<std::pair<ConstantInt*, BasicBlock*> > PredCases;
- BasicBlock *PredDefault = GetValueEqualityComparisonCases(PTI, PredCases);
-
- // Based on whether the default edge from PTI goes to BB or not, fill in
- // PredCases and PredDefault with the new switch cases we would like to
- // build.
- SmallVector<BasicBlock*, 8> NewSuccessors;
-
- if (PredDefault == BB) {
- // If this is the default destination from PTI, only the edges in TI
- // that don't occur in PTI, or that branch to BB will be activated.
- std::set<ConstantInt*> PTIHandled;
- for (unsigned i = 0, e = PredCases.size(); i != e; ++i)
- if (PredCases[i].second != BB)
- PTIHandled.insert(PredCases[i].first);
- else {
- // The default destination is BB, we don't need explicit targets.
- std::swap(PredCases[i], PredCases.back());
- PredCases.pop_back();
- --i; --e;
- }
-
- // Reconstruct the new switch statement we will be building.
- if (PredDefault != BBDefault) {
- PredDefault->removePredecessor(Pred);
- PredDefault = BBDefault;
- NewSuccessors.push_back(BBDefault);
- }
- for (unsigned i = 0, e = BBCases.size(); i != e; ++i)
- if (!PTIHandled.count(BBCases[i].first) &&
- BBCases[i].second != BBDefault) {
- PredCases.push_back(BBCases[i]);
- NewSuccessors.push_back(BBCases[i].second);
- }
-
- } else {
- // If this is not the default destination from PSI, only the edges
- // in SI that occur in PSI with a destination of BB will be
- // activated.
- std::set<ConstantInt*> PTIHandled;
- for (unsigned i = 0, e = PredCases.size(); i != e; ++i)
- if (PredCases[i].second == BB) {
- PTIHandled.insert(PredCases[i].first);
- std::swap(PredCases[i], PredCases.back());
- PredCases.pop_back();
- --i; --e;
- }
-
- // Okay, now we know which constants were sent to BB from the
- // predecessor. Figure out where they will all go now.
- for (unsigned i = 0, e = BBCases.size(); i != e; ++i)
- if (PTIHandled.count(BBCases[i].first)) {
- // If this is one we are capable of getting...
- PredCases.push_back(BBCases[i]);
- NewSuccessors.push_back(BBCases[i].second);
- PTIHandled.erase(BBCases[i].first);// This constant is taken care of
- }
-
- // If there are any constants vectored to BB that TI doesn't handle,
- // they must go to the default destination of TI.
- for (std::set<ConstantInt*>::iterator I = PTIHandled.begin(),
- E = PTIHandled.end(); I != E; ++I) {
- PredCases.push_back(std::make_pair(*I, BBDefault));
- NewSuccessors.push_back(BBDefault);
- }
- }
-
- // Okay, at this point, we know which new successor Pred will get. Make
- // sure we update the number of entries in the PHI nodes for these
- // successors.
- for (unsigned i = 0, e = NewSuccessors.size(); i != e; ++i)
- AddPredecessorToBlock(NewSuccessors[i], Pred, BB);
-
- // Now that the successors are updated, create the new Switch instruction.
- SwitchInst *NewSI = SwitchInst::Create(CV, PredDefault, PredCases.size(), PTI);
- for (unsigned i = 0, e = PredCases.size(); i != e; ++i)
- NewSI->addCase(PredCases[i].first, PredCases[i].second);
-
- Instruction *DeadCond = 0;
- if (BranchInst *BI = dyn_cast<BranchInst>(PTI))
- // If PTI is a branch, remember the condition.
- DeadCond = dyn_cast<Instruction>(BI->getCondition());
- Pred->getInstList().erase(PTI);
-
- // If the condition is dead now, remove the instruction tree.
- if (DeadCond) ErasePossiblyDeadInstructionTree(DeadCond);
-
- // Okay, last check. If BB is still a successor of PSI, then we must
- // have an infinite loop case. If so, add an infinitely looping block
- // to handle the case to preserve the behavior of the code.
- BasicBlock *InfLoopBlock = 0;
- for (unsigned i = 0, e = NewSI->getNumSuccessors(); i != e; ++i)
- if (NewSI->getSuccessor(i) == BB) {
- if (InfLoopBlock == 0) {
- // Insert it at the end of the loop, because it's either code,
- // or it won't matter if it's hot. :)
- InfLoopBlock = BasicBlock::Create("infloop", BB->getParent());
- BranchInst::Create(InfLoopBlock, InfLoopBlock);
- }
- NewSI->setSuccessor(i, InfLoopBlock);
- }
-
- Changed = true;
- }
- }
- return Changed;
-}
-
-/// HoistThenElseCodeToIf - Given a conditional branch that goes to BB1 and
-/// BB2, hoist any common code in the two blocks up into the branch block. The
-/// caller of this function guarantees that BI's block dominates BB1 and BB2.
-static bool HoistThenElseCodeToIf(BranchInst *BI) {
- // This does very trivial matching, with limited scanning, to find identical
- // instructions in the two blocks. In particular, we don't want to get into
- // O(M*N) situations here where M and N are the sizes of BB1 and BB2. As
- // such, we currently just scan for obviously identical instructions in an
- // identical order.
- BasicBlock *BB1 = BI->getSuccessor(0); // The true destination.
- BasicBlock *BB2 = BI->getSuccessor(1); // The false destination
-
- Instruction *I1 = BB1->begin(), *I2 = BB2->begin();
- if (I1->getOpcode() != I2->getOpcode() || isa<PHINode>(I1) ||
- isa<InvokeInst>(I1) || !I1->isIdenticalTo(I2))
- return false;
-
- // If we get here, we can hoist at least one instruction.
- BasicBlock *BIParent = BI->getParent();
-
- do {
- // If we are hoisting the terminator instruction, don't move one (making a
- // broken BB), instead clone it, and remove BI.
- if (isa<TerminatorInst>(I1))
- goto HoistTerminator;
-
- // For a normal instruction, we just move one to right before the branch,
- // then replace all uses of the other with the first. Finally, we remove
- // the now redundant second instruction.
- BIParent->getInstList().splice(BI, BB1->getInstList(), I1);
- if (!I2->use_empty())
- I2->replaceAllUsesWith(I1);
- BB2->getInstList().erase(I2);
-
- I1 = BB1->begin();
- I2 = BB2->begin();
- } while (I1->getOpcode() == I2->getOpcode() && I1->isIdenticalTo(I2));
-
- return true;
-
-HoistTerminator:
- // Okay, it is safe to hoist the terminator.
- Instruction *NT = I1->clone();
- BIParent->getInstList().insert(BI, NT);
- if (NT->getType() != Type::VoidTy) {
- I1->replaceAllUsesWith(NT);
- I2->replaceAllUsesWith(NT);
- NT->takeName(I1);
- }
-
- // Hoisting one of the terminators from our successor is a great thing.
- // Unfortunately, the successors of the if/else blocks may have PHI nodes in
- // them. If they do, all PHI entries for BB1/BB2 must agree for all PHI
- // nodes, so we insert select instruction to compute the final result.
- std::map<std::pair<Value*,Value*>, SelectInst*> InsertedSelects;
- for (succ_iterator SI = succ_begin(BB1), E = succ_end(BB1); SI != E; ++SI) {
- PHINode *PN;
- for (BasicBlock::iterator BBI = SI->begin();
- (PN = dyn_cast<PHINode>(BBI)); ++BBI) {
- Value *BB1V = PN->getIncomingValueForBlock(BB1);
- Value *BB2V = PN->getIncomingValueForBlock(BB2);
- if (BB1V != BB2V) {
- // These values do not agree. Insert a select instruction before NT
- // that determines the right value.
- SelectInst *&SI = InsertedSelects[std::make_pair(BB1V, BB2V)];
- if (SI == 0)
- SI = SelectInst::Create(BI->getCondition(), BB1V, BB2V,
- BB1V->getName()+"."+BB2V->getName(), NT);
- // Make the PHI node use the select for all incoming values for BB1/BB2
- for (unsigned i = 0, e = PN->getNumIncomingValues(); i != e; ++i)
- if (PN->getIncomingBlock(i) == BB1 || PN->getIncomingBlock(i) == BB2)
- PN->setIncomingValue(i, SI);
- }
- }
- }
-
- // Update any PHI nodes in our new successors.
- for (succ_iterator SI = succ_begin(BB1), E = succ_end(BB1); SI != E; ++SI)
- AddPredecessorToBlock(*SI, BIParent, BB1);
-
- BI->eraseFromParent();
- return true;
-}
-
-/// BlockIsSimpleEnoughToThreadThrough - Return true if we can thread a branch
-/// across this block.
-static bool BlockIsSimpleEnoughToThreadThrough(BasicBlock *BB) {
- BranchInst *BI = cast<BranchInst>(BB->getTerminator());
- unsigned Size = 0;
-
- // If this basic block contains anything other than a PHI (which controls the
- // branch) and branch itself, bail out. FIXME: improve this in the future.
- for (BasicBlock::iterator BBI = BB->begin(); &*BBI != BI; ++BBI, ++Size) {
- if (Size > 10) return false; // Don't clone large BB's.
-
- // We can only support instructions that are do not define values that are
- // live outside of the current basic block.
- for (Value::use_iterator UI = BBI->use_begin(), E = BBI->use_end();
- UI != E; ++UI) {
- Instruction *U = cast<Instruction>(*UI);
- if (U->getParent() != BB || isa<PHINode>(U)) return false;
- }
-
- // Looks ok, continue checking.
- }
-
- return true;
-}
-
-/// FoldCondBranchOnPHI - If we have a conditional branch on a PHI node value
-/// that is defined in the same block as the branch and if any PHI entries are
-/// constants, thread edges corresponding to that entry to be branches to their
-/// ultimate destination.
-static bool FoldCondBranchOnPHI(BranchInst *BI) {
- BasicBlock *BB = BI->getParent();
- PHINode *PN = dyn_cast<PHINode>(BI->getCondition());
- // NOTE: we currently cannot transform this case if the PHI node is used
- // outside of the block.
- if (!PN || PN->getParent() != BB || !PN->hasOneUse())
- return false;
-
- // Degenerate case of a single entry PHI.
- if (PN->getNumIncomingValues() == 1) {
- if (PN->getIncomingValue(0) != PN)
- PN->replaceAllUsesWith(PN->getIncomingValue(0));
- else
- PN->replaceAllUsesWith(UndefValue::get(PN->getType()));
- PN->eraseFromParent();
- return true;
- }
-
- // Now we know that this block has multiple preds and two succs.
- if (!BlockIsSimpleEnoughToThreadThrough(BB)) return false;
-
- // Okay, this is a simple enough basic block. See if any phi values are
- // constants.
- for (unsigned i = 0, e = PN->getNumIncomingValues(); i != e; ++i) {
- ConstantInt *CB;
- if ((CB = dyn_cast<ConstantInt>(PN->getIncomingValue(i))) &&
- CB->getType() == Type::Int1Ty) {
- // Okay, we now know that all edges from PredBB should be revectored to
- // branch to RealDest.
- BasicBlock *PredBB = PN->getIncomingBlock(i);
- BasicBlock *RealDest = BI->getSuccessor(!CB->getZExtValue());
-
- if (RealDest == BB) continue; // Skip self loops.
-
- // The dest block might have PHI nodes, other predecessors and other
- // difficult cases. Instead of being smart about this, just insert a new
- // block that jumps to the destination block, effectively splitting
- // the edge we are about to create.
- BasicBlock *EdgeBB = BasicBlock::Create(RealDest->getName()+".critedge",
- RealDest->getParent(), RealDest);
- BranchInst::Create(RealDest, EdgeBB);
- PHINode *PN;
- for (BasicBlock::iterator BBI = RealDest->begin();
- (PN = dyn_cast<PHINode>(BBI)); ++BBI) {
- Value *V = PN->getIncomingValueForBlock(BB);
- PN->addIncoming(V, EdgeBB);
- }
-
- // BB may have instructions that are being threaded over. Clone these
- // instructions into EdgeBB. We know that there will be no uses of the
- // cloned instructions outside of EdgeBB.
- BasicBlock::iterator InsertPt = EdgeBB->begin();
- std::map<Value*, Value*> TranslateMap; // Track translated values.
- for (BasicBlock::iterator BBI = BB->begin(); &*BBI != BI; ++BBI) {
- if (PHINode *PN = dyn_cast<PHINode>(BBI)) {
- TranslateMap[PN] = PN->getIncomingValueForBlock(PredBB);
- } else {
- // Clone the instruction.
- Instruction *N = BBI->clone();
- if (BBI->hasName()) N->setName(BBI->getName()+".c");
-
- // Update operands due to translation.
- for (unsigned i = 0, e = N->getNumOperands(); i != e; ++i) {
- std::map<Value*, Value*>::iterator PI =
- TranslateMap.find(N->getOperand(i));
- if (PI != TranslateMap.end())
- N->setOperand(i, PI->second);
- }
-
- // Check for trivial simplification.
- if (Constant *C = ConstantFoldInstruction(N)) {
- TranslateMap[BBI] = C;
- delete N; // Constant folded away, don't need actual inst
- } else {
- // Insert the new instruction into its new home.
- EdgeBB->getInstList().insert(InsertPt, N);
- if (!BBI->use_empty())
- TranslateMap[BBI] = N;
- }
- }
- }
-
- // Loop over all of the edges from PredBB to BB, changing them to branch
- // to EdgeBB instead.
- TerminatorInst *PredBBTI = PredBB->getTerminator();
- for (unsigned i = 0, e = PredBBTI->getNumSuccessors(); i != e; ++i)
- if (PredBBTI->getSuccessor(i) == BB) {
- BB->removePredecessor(PredBB);
- PredBBTI->setSuccessor(i, EdgeBB);
- }
-
- // Recurse, simplifying any other constants.
- return FoldCondBranchOnPHI(BI) | true;
- }
- }
-
- return false;
-}
-
-/// FoldTwoEntryPHINode - Given a BB that starts with the specified two-entry
-/// PHI node, see if we can eliminate it.
-static bool FoldTwoEntryPHINode(PHINode *PN) {
- // Ok, this is a two entry PHI node. Check to see if this is a simple "if
- // statement", which has a very simple dominance structure. Basically, we
- // are trying to find the condition that is being branched on, which
- // subsequently causes this merge to happen. We really want control
- // dependence information for this check, but simplifycfg can't keep it up
- // to date, and this catches most of the cases we care about anyway.
- //
- BasicBlock *BB = PN->getParent();
- BasicBlock *IfTrue, *IfFalse;
- Value *IfCond = GetIfCondition(BB, IfTrue, IfFalse);
- if (!IfCond) return false;
-
- // Okay, we found that we can merge this two-entry phi node into a select.
- // Doing so would require us to fold *all* two entry phi nodes in this block.
- // At some point this becomes non-profitable (particularly if the target
- // doesn't support cmov's). Only do this transformation if there are two or
- // fewer PHI nodes in this block.
- unsigned NumPhis = 0;
- for (BasicBlock::iterator I = BB->begin(); isa<PHINode>(I); ++NumPhis, ++I)
- if (NumPhis > 2)
- return false;
-
- DOUT << "FOUND IF CONDITION! " << *IfCond << " T: "
- << IfTrue->getName() << " F: " << IfFalse->getName() << "\n";
-
- // Loop over the PHI's seeing if we can promote them all to select
- // instructions. While we are at it, keep track of the instructions
- // that need to be moved to the dominating block.
- std::set<Instruction*> AggressiveInsts;
-
- BasicBlock::iterator AfterPHIIt = BB->begin();
- while (isa<PHINode>(AfterPHIIt)) {
- PHINode *PN = cast<PHINode>(AfterPHIIt++);
- if (PN->getIncomingValue(0) == PN->getIncomingValue(1)) {
- if (PN->getIncomingValue(0) != PN)
- PN->replaceAllUsesWith(PN->getIncomingValue(0));
- else
- PN->replaceAllUsesWith(UndefValue::get(PN->getType()));
- } else if (!DominatesMergePoint(PN->getIncomingValue(0), BB,
- &AggressiveInsts) ||
- !DominatesMergePoint(PN->getIncomingValue(1), BB,
- &AggressiveInsts)) {
- return false;
- }
- }
-
- // If we all PHI nodes are promotable, check to make sure that all
- // instructions in the predecessor blocks can be promoted as well. If
- // not, we won't be able to get rid of the control flow, so it's not
- // worth promoting to select instructions.
- BasicBlock *DomBlock = 0, *IfBlock1 = 0, *IfBlock2 = 0;
- PN = cast<PHINode>(BB->begin());
- BasicBlock *Pred = PN->getIncomingBlock(0);
- if (cast<BranchInst>(Pred->getTerminator())->isUnconditional()) {
- IfBlock1 = Pred;
- DomBlock = *pred_begin(Pred);
- for (BasicBlock::iterator I = Pred->begin();
- !isa<TerminatorInst>(I); ++I)
- if (!AggressiveInsts.count(I)) {
- // This is not an aggressive instruction that we can promote.
- // Because of this, we won't be able to get rid of the control
- // flow, so the xform is not worth it.
- return false;
- }
- }
-
- Pred = PN->getIncomingBlock(1);
- if (cast<BranchInst>(Pred->getTerminator())->isUnconditional()) {
- IfBlock2 = Pred;
- DomBlock = *pred_begin(Pred);
- for (BasicBlock::iterator I = Pred->begin();
- !isa<TerminatorInst>(I); ++I)
- if (!AggressiveInsts.count(I)) {
- // This is not an aggressive instruction that we can promote.
- // Because of this, we won't be able to get rid of the control
- // flow, so the xform is not worth it.
- return false;
- }
- }
-
- // If we can still promote the PHI nodes after this gauntlet of tests,
- // do all of the PHI's now.
-
- // Move all 'aggressive' instructions, which are defined in the
- // conditional parts of the if's up to the dominating block.
- if (IfBlock1) {
- DomBlock->getInstList().splice(DomBlock->getTerminator(),
- IfBlock1->getInstList(),
- IfBlock1->begin(),
- IfBlock1->getTerminator());
- }
- if (IfBlock2) {
- DomBlock->getInstList().splice(DomBlock->getTerminator(),
- IfBlock2->getInstList(),
- IfBlock2->begin(),
- IfBlock2->getTerminator());
- }
-
- while (PHINode *PN = dyn_cast<PHINode>(BB->begin())) {
- // Change the PHI node into a select instruction.
- Value *TrueVal =
- PN->getIncomingValue(PN->getIncomingBlock(0) == IfFalse);
- Value *FalseVal =
- PN->getIncomingValue(PN->getIncomingBlock(0) == IfTrue);
-
- Value *NV = SelectInst::Create(IfCond, TrueVal, FalseVal, "", AfterPHIIt);
- PN->replaceAllUsesWith(NV);
- NV->takeName(PN);
-
- BB->getInstList().erase(PN);
- }
- return true;
-}
-
-/// SimplifyCondBranchToTwoReturns - If we found a conditional branch that goes
-/// to two returning blocks, try to merge them together into one return,
-/// introducing a select if the return values disagree.
-static bool SimplifyCondBranchToTwoReturns(BranchInst *BI) {
- assert(BI->isConditional() && "Must be a conditional branch");
- BasicBlock *TrueSucc = BI->getSuccessor(0);
- BasicBlock *FalseSucc = BI->getSuccessor(1);
- ReturnInst *TrueRet = cast<ReturnInst>(TrueSucc->getTerminator());
- ReturnInst *FalseRet = cast<ReturnInst>(FalseSucc->getTerminator());
-
- // Check to ensure both blocks are empty (just a return) or optionally empty
- // with PHI nodes. If there are other instructions, merging would cause extra
- // computation on one path or the other.
- BasicBlock::iterator BBI = TrueRet;
- if (BBI != TrueSucc->begin() && !isa<PHINode>(--BBI))
- return false; // Not empty with optional phi nodes.
- BBI = FalseRet;
- if (BBI != FalseSucc->begin() && !isa<PHINode>(--BBI))
- return false; // Not empty with optional phi nodes.
-
- // Okay, we found a branch that is going to two return nodes. If
- // there is no return value for this function, just change the
- // branch into a return.
- if (FalseRet->getNumOperands() == 0) {
- TrueSucc->removePredecessor(BI->getParent());
- FalseSucc->removePredecessor(BI->getParent());
- ReturnInst::Create(0, BI);
- BI->eraseFromParent();
- return true;
- }
-
- // Otherwise, build up the result values for the new return.
- SmallVector<Value*, 4> TrueResult;
- SmallVector<Value*, 4> FalseResult;
-
- for (unsigned i = 0, e = TrueRet->getNumOperands(); i != e; ++i) {
- // Otherwise, figure out what the true and false return values are
- // so we can insert a new select instruction.
- Value *TrueValue = TrueRet->getOperand(i);
- Value *FalseValue = FalseRet->getOperand(i);
-
- // Unwrap any PHI nodes in the return blocks.
- if (PHINode *TVPN = dyn_cast<PHINode>(TrueValue))
- if (TVPN->getParent() == TrueSucc)
- TrueValue = TVPN->getIncomingValueForBlock(BI->getParent());
- if (PHINode *FVPN = dyn_cast<PHINode>(FalseValue))
- if (FVPN->getParent() == FalseSucc)
- FalseValue = FVPN->getIncomingValueForBlock(BI->getParent());
-
- // In order for this transformation to be safe, we must be able to
- // unconditionally execute both operands to the return. This is
- // normally the case, but we could have a potentially-trapping
- // constant expression that prevents this transformation from being
- // safe.
- if (ConstantExpr *TCV = dyn_cast<ConstantExpr>(TrueValue))
- if (TCV->canTrap())
- return false;
- if (ConstantExpr *FCV = dyn_cast<ConstantExpr>(FalseValue))
- if (FCV->canTrap())
- return false;
-
- TrueResult.push_back(TrueValue);
- FalseResult.push_back(FalseValue);
- }
-
- // Okay, we collected all the mapped values and checked them for sanity, and
- // defined to really do this transformation. First, update the CFG.
- TrueSucc->removePredecessor(BI->getParent());
- FalseSucc->removePredecessor(BI->getParent());
-
- // Insert select instructions where needed.
- Value *BrCond = BI->getCondition();
- for (unsigned i = 0, e = TrueRet->getNumOperands(); i != e; ++i) {
- // Insert a select if the results differ.
- if (TrueResult[i] == FalseResult[i] || isa<UndefValue>(FalseResult[i]))
- continue;
- if (isa<UndefValue>(TrueResult[i])) {
- TrueResult[i] = FalseResult[i];
- continue;
- }
-
- TrueResult[i] = SelectInst::Create(BrCond, TrueResult[i],
- FalseResult[i], "retval", BI);
- }
-
- Value *RI = ReturnInst::Create(&TrueResult[0], TrueResult.size(), BI);
-
- DOUT << "\nCHANGING BRANCH TO TWO RETURNS INTO SELECT:"
- << "\n " << *BI << "NewRet = " << *RI
- << "TRUEBLOCK: " << *TrueSucc << "FALSEBLOCK: "<< *FalseSucc;
-
- BI->eraseFromParent();
-
- if (Instruction *BrCondI = dyn_cast<Instruction>(BrCond))
- ErasePossiblyDeadInstructionTree(BrCondI);
- return true;
-}
-
-
-namespace {
- /// ConstantIntOrdering - This class implements a stable ordering of constant
- /// integers that does not depend on their address. This is important for
- /// applications that sort ConstantInt's to ensure uniqueness.
- struct ConstantIntOrdering {
- bool operator()(const ConstantInt *LHS, const ConstantInt *RHS) const {
- return LHS->getValue().ult(RHS->getValue());
- }
- };
-}
-
-// SimplifyCFG - This function is used to do simplification of a CFG. For
-// example, it adjusts branches to branches to eliminate the extra hop, it
-// eliminates unreachable basic blocks, and does other "peephole" optimization
-// of the CFG. It returns true if a modification was made.
-//
-// WARNING: The entry node of a function may not be simplified.
-//
-bool llvm::SimplifyCFG(BasicBlock *BB) {
- bool Changed = false;
- Function *M = BB->getParent();
-
- assert(BB && BB->getParent() && "Block not embedded in function!");
- assert(BB->getTerminator() && "Degenerate basic block encountered!");
- assert(&BB->getParent()->getEntryBlock() != BB &&
- "Can't Simplify entry block!");
-
- // Remove basic blocks that have no predecessors... which are unreachable.
- if ((pred_begin(BB) == pred_end(BB)) ||
- (*pred_begin(BB) == BB && ++pred_begin(BB) == pred_end(BB))) {
- DOUT << "Removing BB: \n" << *BB;
-
- // Loop through all of our successors and make sure they know that one
- // of their predecessors is going away.
- for (succ_iterator SI = succ_begin(BB), E = succ_end(BB); SI != E; ++SI)
- SI->removePredecessor(BB);
-
- while (!BB->empty()) {
- Instruction &I = BB->back();
- // If this instruction is used, replace uses with an arbitrary
- // value. Because control flow can't get here, we don't care
- // what we replace the value with. Note that since this block is
- // unreachable, and all values contained within it must dominate their
- // uses, that all uses will eventually be removed.
- if (!I.use_empty())
- // Make all users of this instruction use undef instead
- I.replaceAllUsesWith(UndefValue::get(I.getType()));
-
- // Remove the instruction from the basic block
- BB->getInstList().pop_back();
- }
- M->getBasicBlockList().erase(BB);
- return true;
- }
-
- // Check to see if we can constant propagate this terminator instruction
- // away...
- Changed |= ConstantFoldTerminator(BB);
-
- // If there is a trivial two-entry PHI node in this basic block, and we can
- // eliminate it, do so now.
- if (PHINode *PN = dyn_cast<PHINode>(BB->begin()))
- if (PN->getNumIncomingValues() == 2)
- Changed |= FoldTwoEntryPHINode(PN);
-
- // If this is a returning block with only PHI nodes in it, fold the return
- // instruction into any unconditional branch predecessors.
- //
- // If any predecessor is a conditional branch that just selects among
- // different return values, fold the replace the branch/return with a select
- // and return.
- if (ReturnInst *RI = dyn_cast<ReturnInst>(BB->getTerminator())) {
- BasicBlock::iterator BBI = BB->getTerminator();
- if (BBI == BB->begin() || isa<PHINode>(--BBI)) {
- // Find predecessors that end with branches.
- SmallVector<BasicBlock*, 8> UncondBranchPreds;
- SmallVector<BranchInst*, 8> CondBranchPreds;
- for (pred_iterator PI = pred_begin(BB), E = pred_end(BB); PI != E; ++PI) {
- TerminatorInst *PTI = (*PI)->getTerminator();
- if (BranchInst *BI = dyn_cast<BranchInst>(PTI)) {
- if (BI->isUnconditional())
- UncondBranchPreds.push_back(*PI);
- else
- CondBranchPreds.push_back(BI);
- }
- }
-
- // If we found some, do the transformation!
- if (!UncondBranchPreds.empty()) {
- while (!UncondBranchPreds.empty()) {
- BasicBlock *Pred = UncondBranchPreds.back();
- DOUT << "FOLDING: " << *BB
- << "INTO UNCOND BRANCH PRED: " << *Pred;
- UncondBranchPreds.pop_back();
- Instruction *UncondBranch = Pred->getTerminator();
- // Clone the return and add it to the end of the predecessor.
- Instruction *NewRet = RI->clone();
- Pred->getInstList().push_back(NewRet);
-
- // If the return instruction returns a value, and if the value was a
- // PHI node in "BB", propagate the right value into the return.
- for (unsigned i = 0, e = NewRet->getNumOperands(); i != e; ++i)
- if (PHINode *PN = dyn_cast<PHINode>(NewRet->getOperand(i)))
- if (PN->getParent() == BB)
- NewRet->setOperand(i, PN->getIncomingValueForBlock(Pred));
-
- // Update any PHI nodes in the returning block to realize that we no
- // longer branch to them.
- BB->removePredecessor(Pred);
- Pred->getInstList().erase(UncondBranch);
- }
-
- // If we eliminated all predecessors of the block, delete the block now.
- if (pred_begin(BB) == pred_end(BB))
- // We know there are no successors, so just nuke the block.
- M->getBasicBlockList().erase(BB);
-
- return true;
- }
-
- // Check out all of the conditional branches going to this return
- // instruction. If any of them just select between returns, change the
- // branch itself into a select/return pair.
- while (!CondBranchPreds.empty()) {
- BranchInst *BI = CondBranchPreds.back();
- CondBranchPreds.pop_back();
-
- // Check to see if the non-BB successor is also a return block.
- if (isa<ReturnInst>(BI->getSuccessor(0)->getTerminator()) &&
- isa<ReturnInst>(BI->getSuccessor(1)->getTerminator()) &&
- SimplifyCondBranchToTwoReturns(BI))
- return true;
- }
- }
- } else if (isa<UnwindInst>(BB->begin())) {
- // Check to see if the first instruction in this block is just an unwind.
- // If so, replace any invoke instructions which use this as an exception
- // destination with call instructions, and any unconditional branch
- // predecessor with an unwind.
- //
- SmallVector<BasicBlock*, 8> Preds(pred_begin(BB), pred_end(BB));
- while (!Preds.empty()) {
- BasicBlock *Pred = Preds.back();
- if (BranchInst *BI = dyn_cast<BranchInst>(Pred->getTerminator())) {
- if (BI->isUnconditional()) {
- Pred->getInstList().pop_back(); // nuke uncond branch
- new UnwindInst(Pred); // Use unwind.
- Changed = true;
- }
- } else if (InvokeInst *II = dyn_cast<InvokeInst>(Pred->getTerminator()))
- if (II->getUnwindDest() == BB) {
- // Insert a new branch instruction before the invoke, because this
- // is now a fall through...
- BranchInst *BI = BranchInst::Create(II->getNormalDest(), II);
- Pred->getInstList().remove(II); // Take out of symbol table
-
- // Insert the call now...
- SmallVector<Value*,8> Args(II->op_begin()+3, II->op_end());
- CallInst *CI = CallInst::Create(II->getCalledValue(),
- Args.begin(), Args.end(), II->getName(), BI);
- CI->setCallingConv(II->getCallingConv());
- CI->setParamAttrs(II->getParamAttrs());
- // If the invoke produced a value, the Call now does instead
- II->replaceAllUsesWith(CI);
- delete II;
- Changed = true;
- }
-
- Preds.pop_back();
- }
-
- // If this block is now dead, remove it.
- if (pred_begin(BB) == pred_end(BB)) {
- // We know there are no successors, so just nuke the block.
- M->getBasicBlockList().erase(BB);
- return true;
- }
-
- } else if (SwitchInst *SI = dyn_cast<SwitchInst>(BB->getTerminator())) {
- if (isValueEqualityComparison(SI)) {
- // If we only have one predecessor, and if it is a branch on this value,
- // see if that predecessor totally determines the outcome of this switch.
- if (BasicBlock *OnlyPred = BB->getSinglePredecessor())
- if (SimplifyEqualityComparisonWithOnlyPredecessor(SI, OnlyPred))
- return SimplifyCFG(BB) || 1;
-
- // If the block only contains the switch, see if we can fold the block
- // away into any preds.
- if (SI == &BB->front())
- if (FoldValueComparisonIntoPredecessors(SI))
- return SimplifyCFG(BB) || 1;
- }
- } else if (BranchInst *BI = dyn_cast<BranchInst>(BB->getTerminator())) {
- if (BI->isUnconditional()) {
- BasicBlock::iterator BBI = BB->begin(); // Skip over phi nodes...
- while (isa<PHINode>(*BBI)) ++BBI;
-
- BasicBlock *Succ = BI->getSuccessor(0);
- if (BBI->isTerminator() && // Terminator is the only non-phi instruction!
- Succ != BB) // Don't hurt infinite loops!
- if (TryToSimplifyUncondBranchFromEmptyBlock(BB, Succ))
- return 1;
-
- } else { // Conditional branch
- if (isValueEqualityComparison(BI)) {
- // If we only have one predecessor, and if it is a branch on this value,
- // see if that predecessor totally determines the outcome of this
- // switch.
- if (BasicBlock *OnlyPred = BB->getSinglePredecessor())
- if (SimplifyEqualityComparisonWithOnlyPredecessor(BI, OnlyPred))
- return SimplifyCFG(BB) || 1;
-
- // This block must be empty, except for the setcond inst, if it exists.
- BasicBlock::iterator I = BB->begin();
- if (&*I == BI ||
- (&*I == cast<Instruction>(BI->getCondition()) &&
- &*++I == BI))
- if (FoldValueComparisonIntoPredecessors(BI))
- return SimplifyCFG(BB) | true;
- }
-
- // If this is a branch on a phi node in the current block, thread control
- // through this block if any PHI node entries are constants.
- if (PHINode *PN = dyn_cast<PHINode>(BI->getCondition()))
- if (PN->getParent() == BI->getParent())
- if (FoldCondBranchOnPHI(BI))
- return SimplifyCFG(BB) | true;
-
- // If this basic block is ONLY a setcc and a branch, and if a predecessor
- // branches to us and one of our successors, fold the setcc into the
- // predecessor and use logical operations to pick the right destination.
- BasicBlock *TrueDest = BI->getSuccessor(0);
- BasicBlock *FalseDest = BI->getSuccessor(1);
- if (Instruction *Cond = dyn_cast<Instruction>(BI->getCondition())) {
- BasicBlock::iterator CondIt = Cond;
- if ((isa<CmpInst>(Cond) || isa<BinaryOperator>(Cond)) &&
- Cond->getParent() == BB && &BB->front() == Cond &&
- &*++CondIt == BI && Cond->hasOneUse() &&
- TrueDest != BB && FalseDest != BB)
- for (pred_iterator PI = pred_begin(BB), E = pred_end(BB); PI!=E; ++PI)
- if (BranchInst *PBI = dyn_cast<BranchInst>((*PI)->getTerminator()))
- if (PBI->isConditional() && SafeToMergeTerminators(BI, PBI)) {
- BasicBlock *PredBlock = *PI;
- if (PBI->getSuccessor(0) == FalseDest ||
- PBI->getSuccessor(1) == TrueDest) {
- // Invert the predecessors condition test (xor it with true),
- // which allows us to write this code once.
- Value *NewCond =
- BinaryOperator::createNot(PBI->getCondition(),
- PBI->getCondition()->getName()+".not", PBI);
- PBI->setCondition(NewCond);
- BasicBlock *OldTrue = PBI->getSuccessor(0);
- BasicBlock *OldFalse = PBI->getSuccessor(1);
- PBI->setSuccessor(0, OldFalse);
- PBI->setSuccessor(1, OldTrue);
- }
-
- if ((PBI->getSuccessor(0) == TrueDest && FalseDest != BB) ||
- (PBI->getSuccessor(1) == FalseDest && TrueDest != BB)) {
- // Clone Cond into the predecessor basic block, and or/and the
- // two conditions together.
- Instruction *New = Cond->clone();
- PredBlock->getInstList().insert(PBI, New);
- New->takeName(Cond);
- Cond->setName(New->getName()+".old");
- Instruction::BinaryOps Opcode =
- PBI->getSuccessor(0) == TrueDest ?
- Instruction::Or : Instruction::And;
- Value *NewCond =
- BinaryOperator::create(Opcode, PBI->getCondition(),
- New, "bothcond", PBI);
- PBI->setCondition(NewCond);
- if (PBI->getSuccessor(0) == BB) {
- AddPredecessorToBlock(TrueDest, PredBlock, BB);
- PBI->setSuccessor(0, TrueDest);
- }
- if (PBI->getSuccessor(1) == BB) {
- AddPredecessorToBlock(FalseDest, PredBlock, BB);
- PBI->setSuccessor(1, FalseDest);
- }
- return SimplifyCFG(BB) | 1;
- }
- }
- }
-
- // Scan predessor blocks for conditional branches.
- for (pred_iterator PI = pred_begin(BB), E = pred_end(BB); PI != E; ++PI)
- if (BranchInst *PBI = dyn_cast<BranchInst>((*PI)->getTerminator()))
- if (PBI != BI && PBI->isConditional()) {
-
- // If this block ends with a branch instruction, and if there is a
- // predecessor that ends on a branch of the same condition, make
- // this conditional branch redundant.
- if (PBI->getCondition() == BI->getCondition() &&
- PBI->getSuccessor(0) != PBI->getSuccessor(1)) {
- // Okay, the outcome of this conditional branch is statically
- // knowable. If this block had a single pred, handle specially.
- if (BB->getSinglePredecessor()) {
- // Turn this into a branch on constant.
- bool CondIsTrue = PBI->getSuccessor(0) == BB;
- BI->setCondition(ConstantInt::get(Type::Int1Ty, CondIsTrue));
- return SimplifyCFG(BB); // Nuke the branch on constant.
- }
-
- // Otherwise, if there are multiple predecessors, insert a PHI
- // that merges in the constant and simplify the block result.
- if (BlockIsSimpleEnoughToThreadThrough(BB)) {
- PHINode *NewPN = PHINode::Create(Type::Int1Ty,
- BI->getCondition()->getName()+".pr",
- BB->begin());
- for (PI = pred_begin(BB), E = pred_end(BB); PI != E; ++PI)
- if ((PBI = dyn_cast<BranchInst>((*PI)->getTerminator())) &&
- PBI != BI && PBI->isConditional() &&
- PBI->getCondition() == BI->getCondition() &&
- PBI->getSuccessor(0) != PBI->getSuccessor(1)) {
- bool CondIsTrue = PBI->getSuccessor(0) == BB;
- NewPN->addIncoming(ConstantInt::get(Type::Int1Ty,
- CondIsTrue), *PI);
- } else {
- NewPN->addIncoming(BI->getCondition(), *PI);
- }
-
- BI->setCondition(NewPN);
- // This will thread the branch.
- return SimplifyCFG(BB) | true;
- }
- }
-
- // If this is a conditional branch in an empty block, and if any
- // predecessors is a conditional branch to one of our destinations,
- // fold the conditions into logical ops and one cond br.
- if (&BB->front() == BI) {
- int PBIOp, BIOp;
- if (PBI->getSuccessor(0) == BI->getSuccessor(0)) {
- PBIOp = BIOp = 0;
- } else if (PBI->getSuccessor(0) == BI->getSuccessor(1)) {
- PBIOp = 0; BIOp = 1;
- } else if (PBI->getSuccessor(1) == BI->getSuccessor(0)) {
- PBIOp = 1; BIOp = 0;
- } else if (PBI->getSuccessor(1) == BI->getSuccessor(1)) {
- PBIOp = BIOp = 1;
- } else {
- PBIOp = BIOp = -1;
- }
-
- // Check to make sure that the other destination of this branch
- // isn't BB itself. If so, this is an infinite loop that will
- // keep getting unwound.
- if (PBIOp != -1 && PBI->getSuccessor(PBIOp) == BB)
- PBIOp = BIOp = -1;
-
- // Do not perform this transformation if it would require
- // insertion of a large number of select instructions. For targets
- // without predication/cmovs, this is a big pessimization.
- if (PBIOp != -1) {
- BasicBlock *CommonDest = PBI->getSuccessor(PBIOp);
-
- unsigned NumPhis = 0;
- for (BasicBlock::iterator II = CommonDest->begin();
- isa<PHINode>(II); ++II, ++NumPhis) {
- if (NumPhis > 2) {
- // Disable this xform.
- PBIOp = -1;
- break;
- }
- }
- }
-
- // Finally, if everything is ok, fold the branches to logical ops.
- if (PBIOp != -1) {
- BasicBlock *CommonDest = PBI->getSuccessor(PBIOp);
- BasicBlock *OtherDest = BI->getSuccessor(BIOp ^ 1);
-
- // If OtherDest *is* BB, then this is a basic block with just
- // a conditional branch in it, where one edge (OtherDesg) goes
- // back to the block. We know that the program doesn't get
- // stuck in the infinite loop, so the condition must be such
- // that OtherDest isn't branched through. Forward to CommonDest,
- // and avoid an infinite loop at optimizer time.
- if (OtherDest == BB)
- OtherDest = CommonDest;
-
- DOUT << "FOLDING BRs:" << *PBI->getParent()
- << "AND: " << *BI->getParent();
-
- // BI may have other predecessors. Because of this, we leave
- // it alone, but modify PBI.
-
- // Make sure we get to CommonDest on True&True directions.
- Value *PBICond = PBI->getCondition();
- if (PBIOp)
- PBICond = BinaryOperator::createNot(PBICond,
- PBICond->getName()+".not",
- PBI);
- Value *BICond = BI->getCondition();
- if (BIOp)
- BICond = BinaryOperator::createNot(BICond,
- BICond->getName()+".not",
- PBI);
- // Merge the conditions.
- Value *Cond =
- BinaryOperator::createOr(PBICond, BICond, "brmerge", PBI);
-
- // Modify PBI to branch on the new condition to the new dests.
- PBI->setCondition(Cond);
- PBI->setSuccessor(0, CommonDest);
- PBI->setSuccessor(1, OtherDest);
-
- // OtherDest may have phi nodes. If so, add an entry from PBI's
- // block that are identical to the entries for BI's block.
- PHINode *PN;
- for (BasicBlock::iterator II = OtherDest->begin();
- (PN = dyn_cast<PHINode>(II)); ++II) {
- Value *V = PN->getIncomingValueForBlock(BB);
- PN->addIncoming(V, PBI->getParent());
- }
-
- // We know that the CommonDest already had an edge from PBI to
- // it. If it has PHIs though, the PHIs may have different
- // entries for BB and PBI's BB. If so, insert a select to make
- // them agree.
- for (BasicBlock::iterator II = CommonDest->begin();
- (PN = dyn_cast<PHINode>(II)); ++II) {
- Value * BIV = PN->getIncomingValueForBlock(BB);
- unsigned PBBIdx = PN->getBasicBlockIndex(PBI->getParent());
- Value *PBIV = PN->getIncomingValue(PBBIdx);
- if (BIV != PBIV) {
- // Insert a select in PBI to pick the right value.
- Value *NV = SelectInst::Create(PBICond, PBIV, BIV,
- PBIV->getName()+".mux", PBI);
- PN->setIncomingValue(PBBIdx, NV);
- }
- }
-
- DOUT << "INTO: " << *PBI->getParent();
-
- // This basic block is probably dead. We know it has at least
- // one fewer predecessor.
- return SimplifyCFG(BB) | true;
- }
- }
- }
- }
- } else if (isa<UnreachableInst>(BB->getTerminator())) {
- // If there are any instructions immediately before the unreachable that can
- // be removed, do so.
- Instruction *Unreachable = BB->getTerminator();
- while (Unreachable != BB->begin()) {
- BasicBlock::iterator BBI = Unreachable;
- --BBI;
- if (isa<CallInst>(BBI)) break;
- // Delete this instruction
- BB->getInstList().erase(BBI);
- Changed = true;
- }
-
- // If the unreachable instruction is the first in the block, take a gander
- // at all of the predecessors of this instruction, and simplify them.
- if (&BB->front() == Unreachable) {
- SmallVector<BasicBlock*, 8> Preds(pred_begin(BB), pred_end(BB));
- for (unsigned i = 0, e = Preds.size(); i != e; ++i) {
- TerminatorInst *TI = Preds[i]->getTerminator();
-
- if (BranchInst *BI = dyn_cast<BranchInst>(TI)) {
- if (BI->isUnconditional()) {
- if (BI->getSuccessor(0) == BB) {
- new UnreachableInst(TI);
- TI->eraseFromParent();
- Changed = true;
- }
- } else {
- if (BI->getSuccessor(0) == BB) {
- BranchInst::Create(BI->getSuccessor(1), BI);
- BI->eraseFromParent();
- } else if (BI->getSuccessor(1) == BB) {
- BranchInst::Create(BI->getSuccessor(0), BI);
- BI->eraseFromParent();
- Changed = true;
- }
- }
- } else if (SwitchInst *SI = dyn_cast<SwitchInst>(TI)) {
- for (unsigned i = 1, e = SI->getNumCases(); i != e; ++i)
- if (SI->getSuccessor(i) == BB) {
- BB->removePredecessor(SI->getParent());
- SI->removeCase(i);
- --i; --e;
- Changed = true;
- }
- // If the default value is unreachable, figure out the most popular
- // destination and make it the default.
- if (SI->getSuccessor(0) == BB) {
- std::map<BasicBlock*, unsigned> Popularity;
- for (unsigned i = 1, e = SI->getNumCases(); i != e; ++i)
- Popularity[SI->getSuccessor(i)]++;
-
- // Find the most popular block.
- unsigned MaxPop = 0;
- BasicBlock *MaxBlock = 0;
- for (std::map<BasicBlock*, unsigned>::iterator
- I = Popularity.begin(), E = Popularity.end(); I != E; ++I) {
- if (I->second > MaxPop) {
- MaxPop = I->second;
- MaxBlock = I->first;
- }
- }
- if (MaxBlock) {
- // Make this the new default, allowing us to delete any explicit
- // edges to it.
- SI->setSuccessor(0, MaxBlock);
- Changed = true;
-
- // If MaxBlock has phinodes in it, remove MaxPop-1 entries from
- // it.
- if (isa<PHINode>(MaxBlock->begin()))
- for (unsigned i = 0; i != MaxPop-1; ++i)
- MaxBlock->removePredecessor(SI->getParent());
-
- for (unsigned i = 1, e = SI->getNumCases(); i != e; ++i)
- if (SI->getSuccessor(i) == MaxBlock) {
- SI->removeCase(i);
- --i; --e;
- }
- }
- }
- } else if (InvokeInst *II = dyn_cast<InvokeInst>(TI)) {
- if (II->getUnwindDest() == BB) {
- // Convert the invoke to a call instruction. This would be a good
- // place to note that the call does not throw though.
- BranchInst *BI = BranchInst::Create(II->getNormalDest(), II);
- II->removeFromParent(); // Take out of symbol table
-
- // Insert the call now...
- SmallVector<Value*, 8> Args(II->op_begin()+3, II->op_end());
- CallInst *CI = CallInst::Create(II->getCalledValue(),
- Args.begin(), Args.end(),
- II->getName(), BI);
- CI->setCallingConv(II->getCallingConv());
- CI->setParamAttrs(II->getParamAttrs());
- // If the invoke produced a value, the Call does now instead.
- II->replaceAllUsesWith(CI);
- delete II;
- Changed = true;
- }
- }
- }
-
- // If this block is now dead, remove it.
- if (pred_begin(BB) == pred_end(BB)) {
- // We know there are no successors, so just nuke the block.
- M->getBasicBlockList().erase(BB);
- return true;
- }
- }
- }
-
- // Merge basic blocks into their predecessor if there is only one distinct
- // pred, and if there is only one distinct successor of the predecessor, and
- // if there are no PHI nodes.
- //
- pred_iterator PI(pred_begin(BB)), PE(pred_end(BB));
- BasicBlock *OnlyPred = *PI++;
- for (; PI != PE; ++PI) // Search all predecessors, see if they are all same
- if (*PI != OnlyPred) {
- OnlyPred = 0; // There are multiple different predecessors...
- break;
- }
-
- BasicBlock *OnlySucc = 0;
- if (OnlyPred && OnlyPred != BB && // Don't break self loops
- OnlyPred->getTerminator()->getOpcode() != Instruction::Invoke) {
- // Check to see if there is only one distinct successor...
- succ_iterator SI(succ_begin(OnlyPred)), SE(succ_end(OnlyPred));
- OnlySucc = BB;
- for (; SI != SE; ++SI)
- if (*SI != OnlySucc) {
- OnlySucc = 0; // There are multiple distinct successors!
- break;
- }
- }
-
- if (OnlySucc) {
- DOUT << "Merging: " << *BB << "into: " << *OnlyPred;
-
- // Resolve any PHI nodes at the start of the block. They are all
- // guaranteed to have exactly one entry if they exist, unless there are
- // multiple duplicate (but guaranteed to be equal) entries for the
- // incoming edges. This occurs when there are multiple edges from
- // OnlyPred to OnlySucc.
- //
- while (PHINode *PN = dyn_cast<PHINode>(&BB->front())) {
- PN->replaceAllUsesWith(PN->getIncomingValue(0));
- BB->getInstList().pop_front(); // Delete the phi node.
- }
-
- // Delete the unconditional branch from the predecessor.
- OnlyPred->getInstList().pop_back();
-
- // Move all definitions in the successor to the predecessor.
- OnlyPred->getInstList().splice(OnlyPred->end(), BB->getInstList());
-
- // Make all PHI nodes that referred to BB now refer to Pred as their
- // source.
- BB->replaceAllUsesWith(OnlyPred);
-
- // Inherit predecessors name if it exists.
- if (!OnlyPred->hasName())
- OnlyPred->takeName(BB);
-
- // Erase basic block from the function.
- M->getBasicBlockList().erase(BB);
-
- return true;
- }
-
- // Otherwise, if this block only has a single predecessor, and if that block
- // is a conditional branch, see if we can hoist any code from this block up
- // into our predecessor.
- if (OnlyPred)
- if (BranchInst *BI = dyn_cast<BranchInst>(OnlyPred->getTerminator()))
- if (BI->isConditional()) {
- // Get the other block.
- BasicBlock *OtherBB = BI->getSuccessor(BI->getSuccessor(0) == BB);
- PI = pred_begin(OtherBB);
- ++PI;
- if (PI == pred_end(OtherBB)) {
- // We have a conditional branch to two blocks that are only reachable
- // from the condbr. We know that the condbr dominates the two blocks,
- // so see if there is any identical code in the "then" and "else"
- // blocks. If so, we can hoist it up to the branching block.
- Changed |= HoistThenElseCodeToIf(BI);
- }
- }
-
- for (pred_iterator PI = pred_begin(BB), E = pred_end(BB); PI != E; ++PI)
- if (BranchInst *BI = dyn_cast<BranchInst>((*PI)->getTerminator()))
- // Change br (X == 0 | X == 1), T, F into a switch instruction.
- if (BI->isConditional() && isa<Instruction>(BI->getCondition())) {
- Instruction *Cond = cast<Instruction>(BI->getCondition());
- // If this is a bunch of seteq's or'd together, or if it's a bunch of
- // 'setne's and'ed together, collect them.
- Value *CompVal = 0;
- std::vector<ConstantInt*> Values;
- bool TrueWhenEqual = GatherValueComparisons(Cond, CompVal, Values);
- if (CompVal && CompVal->getType()->isInteger()) {
- // There might be duplicate constants in the list, which the switch
- // instruction can't handle, remove them now.
- std::sort(Values.begin(), Values.end(), ConstantIntOrdering());
- Values.erase(std::unique(Values.begin(), Values.end()), Values.end());
-
- // Figure out which block is which destination.
- BasicBlock *DefaultBB = BI->getSuccessor(1);
- BasicBlock *EdgeBB = BI->getSuccessor(0);
- if (!TrueWhenEqual) std::swap(DefaultBB, EdgeBB);
-
- // Create the new switch instruction now.
- SwitchInst *New = SwitchInst::Create(CompVal, DefaultBB,Values.size(),BI);
-
- // Add all of the 'cases' to the switch instruction.
- for (unsigned i = 0, e = Values.size(); i != e; ++i)
- New->addCase(Values[i], EdgeBB);
-
- // We added edges from PI to the EdgeBB. As such, if there were any
- // PHI nodes in EdgeBB, they need entries to be added corresponding to
- // the number of edges added.
- for (BasicBlock::iterator BBI = EdgeBB->begin();
- isa<PHINode>(BBI); ++BBI) {
- PHINode *PN = cast<PHINode>(BBI);
- Value *InVal = PN->getIncomingValueForBlock(*PI);
- for (unsigned i = 0, e = Values.size()-1; i != e; ++i)
- PN->addIncoming(InVal, *PI);
- }
-
- // Erase the old branch instruction.
- (*PI)->getInstList().erase(BI);
-
- // Erase the potentially condition tree that was used to computed the
- // branch condition.
- ErasePossiblyDeadInstructionTree(Cond);
- return true;
- }
- }
-
- return Changed;
-}
diff --git a/release_23/lib/Transforms/Utils/UnifyFunctionExitNodes.cpp b/release_23/lib/Transforms/Utils/UnifyFunctionExitNodes.cpp
deleted file mode 100644
index c024d32374eb..000000000000
--- a/release_23/lib/Transforms/Utils/UnifyFunctionExitNodes.cpp
+++ /dev/null
@@ -1,162 +0,0 @@
-//===- UnifyFunctionExitNodes.cpp - Make all functions have a single exit -===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This pass is used to ensure that functions have at most one return
-// instruction in them. Additionally, it keeps track of which node is the new
-// exit node of the CFG. If there are no exit nodes in the CFG, the getExitNode
-// method will return a null pointer.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Transforms/Utils/UnifyFunctionExitNodes.h"
-#include "llvm/Transforms/Scalar.h"
-#include "llvm/BasicBlock.h"
-#include "llvm/Function.h"
-#include "llvm/Instructions.h"
-#include "llvm/Type.h"
-#include "llvm/ADT/SmallVector.h"
-#include "llvm/ADT/StringExtras.h"
-using namespace llvm;
-
-char UnifyFunctionExitNodes::ID = 0;
-static RegisterPass<UnifyFunctionExitNodes>
-X("mergereturn", "Unify function exit nodes");
-
-Pass *llvm::createUnifyFunctionExitNodesPass() {
- return new UnifyFunctionExitNodes();
-}
-
-void UnifyFunctionExitNodes::getAnalysisUsage(AnalysisUsage &AU) const{
- // We preserve the non-critical-edgeness property
- AU.addPreservedID(BreakCriticalEdgesID);
- // This is a cluster of orthogonal Transforms
- AU.addPreservedID(PromoteMemoryToRegisterID);
- AU.addPreservedID(LowerSwitchID);
-}
-
-// UnifyAllExitNodes - Unify all exit nodes of the CFG by creating a new
-// BasicBlock, and converting all returns to unconditional branches to this
-// new basic block. The singular exit node is returned.
-//
-// If there are no return stmts in the Function, a null pointer is returned.
-//
-bool UnifyFunctionExitNodes::runOnFunction(Function &F) {
- // Loop over all of the blocks in a function, tracking all of the blocks that
- // return.
- //
- std::vector<BasicBlock*> ReturningBlocks;
- std::vector<BasicBlock*> UnwindingBlocks;
- std::vector<BasicBlock*> UnreachableBlocks;
- for(Function::iterator I = F.begin(), E = F.end(); I != E; ++I)
- if (isa<ReturnInst>(I->getTerminator()))
- ReturningBlocks.push_back(I);
- else if (isa<UnwindInst>(I->getTerminator()))
- UnwindingBlocks.push_back(I);
- else if (isa<UnreachableInst>(I->getTerminator()))
- UnreachableBlocks.push_back(I);
-
- // Handle unwinding blocks first.
- if (UnwindingBlocks.empty()) {
- UnwindBlock = 0;
- } else if (UnwindingBlocks.size() == 1) {
- UnwindBlock = UnwindingBlocks.front();
- } else {
- UnwindBlock = BasicBlock::Create("UnifiedUnwindBlock", &F);
- new UnwindInst(UnwindBlock);
-
- for (std::vector<BasicBlock*>::iterator I = UnwindingBlocks.begin(),
- E = UnwindingBlocks.end(); I != E; ++I) {
- BasicBlock *BB = *I;
- BB->getInstList().pop_back(); // Remove the unwind insn
- BranchInst::Create(UnwindBlock, BB);
- }
- }
-
- // Then unreachable blocks.
- if (UnreachableBlocks.empty()) {
- UnreachableBlock = 0;
- } else if (UnreachableBlocks.size() == 1) {
- UnreachableBlock = UnreachableBlocks.front();
- } else {
- UnreachableBlock = BasicBlock::Create("UnifiedUnreachableBlock", &F);
- new UnreachableInst(UnreachableBlock);
-
- for (std::vector<BasicBlock*>::iterator I = UnreachableBlocks.begin(),
- E = UnreachableBlocks.end(); I != E; ++I) {
- BasicBlock *BB = *I;
- BB->getInstList().pop_back(); // Remove the unreachable inst.
- BranchInst::Create(UnreachableBlock, BB);
- }
- }
-
- // Now handle return blocks.
- if (ReturningBlocks.empty()) {
- ReturnBlock = 0;
- return false; // No blocks return
- } else if (ReturningBlocks.size() == 1) {
- ReturnBlock = ReturningBlocks.front(); // Already has a single return block
- return false;
- }
-
- // Otherwise, we need to insert a new basic block into the function, add a PHI
- // nodes (if the function returns values), and convert all of the return
- // instructions into unconditional branches.
- //
- BasicBlock *NewRetBlock = BasicBlock::Create("UnifiedReturnBlock", &F);
-
- SmallVector<Value *, 4> Phis;
- unsigned NumRetVals = ReturningBlocks[0]->getTerminator()->getNumOperands();
- if (NumRetVals == 0)
- ReturnInst::Create(NULL, NewRetBlock);
- else if (const StructType *STy = dyn_cast<StructType>(F.getReturnType())) {
- Instruction *InsertPt = NULL;
- if (NumRetVals == 0)
- InsertPt = NewRetBlock->getFirstNonPHI();
- PHINode *PN = NULL;
- for (unsigned i = 0; i < NumRetVals; ++i) {
- if (InsertPt)
- PN = PHINode::Create(STy->getElementType(i), "UnifiedRetVal."
- + utostr(i), InsertPt);
- else
- PN = PHINode::Create(STy->getElementType(i), "UnifiedRetVal."
- + utostr(i), NewRetBlock);
- Phis.push_back(PN);
- InsertPt = PN;
- }
- ReturnInst::Create(&Phis[0], NumRetVals, NewRetBlock);
- }
- else {
- // If the function doesn't return void... add a PHI node to the block...
- PHINode *PN = PHINode::Create(F.getReturnType(), "UnifiedRetVal");
- NewRetBlock->getInstList().push_back(PN);
- Phis.push_back(PN);
- ReturnInst::Create(PN, NewRetBlock);
- }
-
- // Loop over all of the blocks, replacing the return instruction with an
- // unconditional branch.
- //
- for (std::vector<BasicBlock*>::iterator I = ReturningBlocks.begin(),
- E = ReturningBlocks.end(); I != E; ++I) {
- BasicBlock *BB = *I;
-
- // Add an incoming element to the PHI node for every return instruction that
- // is merging into this new block...
- if (!Phis.empty()) {
- for (unsigned i = 0; i < NumRetVals; ++i)
- cast<PHINode>(Phis[i])->addIncoming(BB->getTerminator()->getOperand(i),
- BB);
- }
-
- BB->getInstList().pop_back(); // Remove the return insn
- BranchInst::Create(NewRetBlock, BB);
- }
- ReturnBlock = NewRetBlock;
- return true;
-}
diff --git a/release_23/lib/Transforms/Utils/ValueMapper.cpp b/release_23/lib/Transforms/Utils/ValueMapper.cpp
deleted file mode 100644
index 5d5ca1309eec..000000000000
--- a/release_23/lib/Transforms/Utils/ValueMapper.cpp
+++ /dev/null
@@ -1,118 +0,0 @@
-//===- ValueMapper.cpp - Interface shared by lib/Transforms/Utils ---------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines the MapValue function, which is shared by various parts of
-// the lib/Transforms/Utils library.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Transforms/Utils/ValueMapper.h"
-#include "llvm/Constants.h"
-#include "llvm/GlobalValue.h"
-#include "llvm/Instruction.h"
-using namespace llvm;
-
-Value *llvm::MapValue(const Value *V, ValueMapTy &VM) {
- Value *&VMSlot = VM[V];
- if (VMSlot) return VMSlot; // Does it exist in the map yet?
-
- // NOTE: VMSlot can be invalidated by any reference to VM, which can grow the
- // DenseMap. This includes any recursive calls to MapValue.
-
- // Global values do not need to be seeded into the ValueMap if they are using
- // the identity mapping.
- if (isa<GlobalValue>(V) || isa<InlineAsm>(V))
- return VMSlot = const_cast<Value*>(V);
-
- if (Constant *C = const_cast<Constant*>(dyn_cast<Constant>(V))) {
- if (isa<ConstantInt>(C) || isa<ConstantFP>(C) ||
- isa<ConstantPointerNull>(C) || isa<ConstantAggregateZero>(C) ||
- isa<UndefValue>(C))
- return VMSlot = C; // Primitive constants map directly
- else if (ConstantArray *CA = dyn_cast<ConstantArray>(C)) {
- for (unsigned i = 0, e = CA->getNumOperands(); i != e; ++i) {
- Value *MV = MapValue(CA->getOperand(i), VM);
- if (MV != CA->getOperand(i)) {
- // This array must contain a reference to a global, make a new array
- // and return it.
- //
- std::vector<Constant*> Values;
- Values.reserve(CA->getNumOperands());
- for (unsigned j = 0; j != i; ++j)
- Values.push_back(CA->getOperand(j));
- Values.push_back(cast<Constant>(MV));
- for (++i; i != e; ++i)
- Values.push_back(cast<Constant>(MapValue(CA->getOperand(i), VM)));
- return VM[V] = ConstantArray::get(CA->getType(), Values);
- }
- }
- return VM[V] = C;
-
- } else if (ConstantStruct *CS = dyn_cast<ConstantStruct>(C)) {
- for (unsigned i = 0, e = CS->getNumOperands(); i != e; ++i) {
- Value *MV = MapValue(CS->getOperand(i), VM);
- if (MV != CS->getOperand(i)) {
- // This struct must contain a reference to a global, make a new struct
- // and return it.
- //
- std::vector<Constant*> Values;
- Values.reserve(CS->getNumOperands());
- for (unsigned j = 0; j != i; ++j)
- Values.push_back(CS->getOperand(j));
- Values.push_back(cast<Constant>(MV));
- for (++i; i != e; ++i)
- Values.push_back(cast<Constant>(MapValue(CS->getOperand(i), VM)));
- return VM[V] = ConstantStruct::get(CS->getType(), Values);
- }
- }
- return VM[V] = C;
-
- } else if (ConstantExpr *CE = dyn_cast<ConstantExpr>(C)) {
- std::vector<Constant*> Ops;
- for (unsigned i = 0, e = CE->getNumOperands(); i != e; ++i)
- Ops.push_back(cast<Constant>(MapValue(CE->getOperand(i), VM)));
- return VM[V] = CE->getWithOperands(Ops);
- } else if (ConstantVector *CP = dyn_cast<ConstantVector>(C)) {
- for (unsigned i = 0, e = CP->getNumOperands(); i != e; ++i) {
- Value *MV = MapValue(CP->getOperand(i), VM);
- if (MV != CP->getOperand(i)) {
- // This vector value must contain a reference to a global, make a new
- // vector constant and return it.
- //
- std::vector<Constant*> Values;
- Values.reserve(CP->getNumOperands());
- for (unsigned j = 0; j != i; ++j)
- Values.push_back(CP->getOperand(j));
- Values.push_back(cast<Constant>(MV));
- for (++i; i != e; ++i)
- Values.push_back(cast<Constant>(MapValue(CP->getOperand(i), VM)));
- return VM[V] = ConstantVector::get(Values);
- }
- }
- return VM[V] = C;
-
- } else {
- assert(0 && "Unknown type of constant!");
- }
- }
-
- return 0;
-}
-
-/// RemapInstruction - Convert the instruction operands from referencing the
-/// current values into those specified by ValueMap.
-///
-void llvm::RemapInstruction(Instruction *I, ValueMapTy &ValueMap) {
- for (unsigned op = 0, E = I->getNumOperands(); op != E; ++op) {
- const Value *Op = I->getOperand(op);
- Value *V = MapValue(Op, ValueMap);
- assert(V && "Referenced value not in value map!");
- I->setOperand(op, V);
- }
-}
diff --git a/release_23/lib/VMCore/AsmWriter.cpp b/release_23/lib/VMCore/AsmWriter.cpp
deleted file mode 100644
index 7af26d0e8a73..000000000000
--- a/release_23/lib/VMCore/AsmWriter.cpp
+++ /dev/null
@@ -1,1673 +0,0 @@
-//===-- AsmWriter.cpp - Printing LLVM as an assembly file -----------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This library implements the functionality defined in llvm/Assembly/Writer.h
-//
-// Note that these routines must be extremely tolerant of various errors in the
-// LLVM code, because it can be used for debugging transformations.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Assembly/Writer.h"
-#include "llvm/Assembly/PrintModulePass.h"
-#include "llvm/Assembly/AsmAnnotationWriter.h"
-#include "llvm/CallingConv.h"
-#include "llvm/Constants.h"
-#include "llvm/DerivedTypes.h"
-#include "llvm/InlineAsm.h"
-#include "llvm/Instruction.h"
-#include "llvm/Instructions.h"
-#include "llvm/Module.h"
-#include "llvm/ValueSymbolTable.h"
-#include "llvm/TypeSymbolTable.h"
-#include "llvm/ADT/StringExtras.h"
-#include "llvm/ADT/STLExtras.h"
-#include "llvm/Support/CFG.h"
-#include "llvm/Support/MathExtras.h"
-#include "llvm/Support/Streams.h"
-#include <algorithm>
-#include <cctype>
-using namespace llvm;
-
-namespace llvm {
-
-// Make virtual table appear in this compilation unit.
-AssemblyAnnotationWriter::~AssemblyAnnotationWriter() {}
-
-/// This class provides computation of slot numbers for LLVM Assembly writing.
-/// @brief LLVM Assembly Writing Slot Computation.
-class SlotMachine {
-
-/// @name Types
-/// @{
-public:
-
- /// @brief A mapping of Values to slot numbers
- typedef std::map<const Value*,unsigned> ValueMap;
-
-/// @}
-/// @name Constructors
-/// @{
-public:
- /// @brief Construct from a module
- explicit SlotMachine(const Module *M);
-
- /// @brief Construct from a function, starting out in incorp state.
- explicit SlotMachine(const Function *F);
-
-/// @}
-/// @name Accessors
-/// @{
-public:
- /// Return the slot number of the specified value in it's type
- /// plane. If something is not in the SlotMachine, return -1.
- int getLocalSlot(const Value *V);
- int getGlobalSlot(const GlobalValue *V);
-
-/// @}
-/// @name Mutators
-/// @{
-public:
- /// If you'd like to deal with a function instead of just a module, use
- /// this method to get its data into the SlotMachine.
- void incorporateFunction(const Function *F) {
- TheFunction = F;
- FunctionProcessed = false;
- }
-
- /// After calling incorporateFunction, use this method to remove the
- /// most recently incorporated function from the SlotMachine. This
- /// will reset the state of the machine back to just the module contents.
- void purgeFunction();
-
-/// @}
-/// @name Implementation Details
-/// @{
-private:
- /// This function does the actual initialization.
- inline void initialize();
-
- /// CreateModuleSlot - Insert the specified GlobalValue* into the slot table.
- void CreateModuleSlot(const GlobalValue *V);
-
- /// CreateFunctionSlot - Insert the specified Value* into the slot table.
- void CreateFunctionSlot(const Value *V);
-
- /// Add all of the module level global variables (and their initializers)
- /// and function declarations, but not the contents of those functions.
- void processModule();
-
- /// Add all of the functions arguments, basic blocks, and instructions
- void processFunction();
-
- SlotMachine(const SlotMachine &); // DO NOT IMPLEMENT
- void operator=(const SlotMachine &); // DO NOT IMPLEMENT
-
-/// @}
-/// @name Data
-/// @{
-public:
-
- /// @brief The module for which we are holding slot numbers
- const Module* TheModule;
-
- /// @brief The function for which we are holding slot numbers
- const Function* TheFunction;
- bool FunctionProcessed;
-
- /// @brief The TypePlanes map for the module level data
- ValueMap mMap;
- unsigned mNext;
-
- /// @brief The TypePlanes map for the function level data
- ValueMap fMap;
- unsigned fNext;
-
-/// @}
-
-};
-
-} // end namespace llvm
-
-char PrintModulePass::ID = 0;
-static RegisterPass<PrintModulePass>
-X("printm", "Print module to stderr");
-char PrintFunctionPass::ID = 0;
-static RegisterPass<PrintFunctionPass>
-Y("print","Print function to stderr");
-
-static void WriteAsOperandInternal(std::ostream &Out, const Value *V,
- std::map<const Type *, std::string> &TypeTable,
- SlotMachine *Machine);
-
-static const Module *getModuleFromVal(const Value *V) {
- if (const Argument *MA = dyn_cast<Argument>(V))
- return MA->getParent() ? MA->getParent()->getParent() : 0;
- else if (const BasicBlock *BB = dyn_cast<BasicBlock>(V))
- return BB->getParent() ? BB->getParent()->getParent() : 0;
- else if (const Instruction *I = dyn_cast<Instruction>(V)) {
- const Function *M = I->getParent() ? I->getParent()->getParent() : 0;
- return M ? M->getParent() : 0;
- } else if (const GlobalValue *GV = dyn_cast<GlobalValue>(V))
- return GV->getParent();
- return 0;
-}
-
-static SlotMachine *createSlotMachine(const Value *V) {
- if (const Argument *FA = dyn_cast<Argument>(V)) {
- return new SlotMachine(FA->getParent());
- } else if (const Instruction *I = dyn_cast<Instruction>(V)) {
- return new SlotMachine(I->getParent()->getParent());
- } else if (const BasicBlock *BB = dyn_cast<BasicBlock>(V)) {
- return new SlotMachine(BB->getParent());
- } else if (const GlobalVariable *GV = dyn_cast<GlobalVariable>(V)){
- return new SlotMachine(GV->getParent());
- } else if (const GlobalAlias *GA = dyn_cast<GlobalAlias>(V)){
- return new SlotMachine(GA->getParent());
- } else if (const Function *Func = dyn_cast<Function>(V)) {
- return new SlotMachine(Func);
- }
- return 0;
-}
-
-/// NameNeedsQuotes - Return true if the specified llvm name should be wrapped
-/// with ""'s.
-static std::string QuoteNameIfNeeded(const std::string &Name) {
- std::string result;
- bool needsQuotes = Name[0] >= '0' && Name[0] <= '9';
- // Scan the name to see if it needs quotes and to replace funky chars with
- // their octal equivalent.
- for (unsigned i = 0, e = Name.size(); i != e; ++i) {
- char C = Name[i];
- assert(C != '"' && "Illegal character in LLVM value name!");
- if (isalnum(C) || C == '-' || C == '.' || C == '_')
- result += C;
- else if (C == '\\') {
- needsQuotes = true;
- result += "\\\\";
- } else if (isprint(C)) {
- needsQuotes = true;
- result += C;
- } else {
- needsQuotes = true;
- result += "\\";
- char hex1 = (C >> 4) & 0x0F;
- if (hex1 < 10)
- result += hex1 + '0';
- else
- result += hex1 - 10 + 'A';
- char hex2 = C & 0x0F;
- if (hex2 < 10)
- result += hex2 + '0';
- else
- result += hex2 - 10 + 'A';
- }
- }
- if (needsQuotes) {
- result.insert(0,"\"");
- result += '"';
- }
- return result;
-}
-
-enum PrefixType {
- GlobalPrefix,
- LabelPrefix,
- LocalPrefix
-};
-
-/// getLLVMName - Turn the specified string into an 'LLVM name', which is either
-/// prefixed with % (if the string only contains simple characters) or is
-/// surrounded with ""'s (if it has special chars in it).
-static std::string getLLVMName(const std::string &Name, PrefixType Prefix) {
- assert(!Name.empty() && "Cannot get empty name!");
- switch (Prefix) {
- default: assert(0 && "Bad prefix!");
- case GlobalPrefix: return '@' + QuoteNameIfNeeded(Name);
- case LabelPrefix: return QuoteNameIfNeeded(Name);
- case LocalPrefix: return '%' + QuoteNameIfNeeded(Name);
- }
-}
-
-
-/// fillTypeNameTable - If the module has a symbol table, take all global types
-/// and stuff their names into the TypeNames map.
-///
-static void fillTypeNameTable(const Module *M,
- std::map<const Type *, std::string> &TypeNames) {
- if (!M) return;
- const TypeSymbolTable &ST = M->getTypeSymbolTable();
- TypeSymbolTable::const_iterator TI = ST.begin();
- for (; TI != ST.end(); ++TI) {
- // As a heuristic, don't insert pointer to primitive types, because
- // they are used too often to have a single useful name.
- //
- const Type *Ty = cast<Type>(TI->second);
- if (!isa<PointerType>(Ty) ||
- !cast<PointerType>(Ty)->getElementType()->isPrimitiveType() ||
- !cast<PointerType>(Ty)->getElementType()->isInteger() ||
- isa<OpaqueType>(cast<PointerType>(Ty)->getElementType()))
- TypeNames.insert(std::make_pair(Ty, getLLVMName(TI->first, LocalPrefix)));
- }
-}
-
-
-
-static void calcTypeName(const Type *Ty,
- std::vector<const Type *> &TypeStack,
- std::map<const Type *, std::string> &TypeNames,
- std::string & Result){
- if (Ty->isInteger() || (Ty->isPrimitiveType() && !isa<OpaqueType>(Ty))) {
- Result += Ty->getDescription(); // Base case
- return;
- }
-
- // Check to see if the type is named.
- std::map<const Type *, std::string>::iterator I = TypeNames.find(Ty);
- if (I != TypeNames.end()) {
- Result += I->second;
- return;
- }
-
- if (isa<OpaqueType>(Ty)) {
- Result += "opaque";
- return;
- }
-
- // Check to see if the Type is already on the stack...
- unsigned Slot = 0, CurSize = TypeStack.size();
- while (Slot < CurSize && TypeStack[Slot] != Ty) ++Slot; // Scan for type
-
- // This is another base case for the recursion. In this case, we know
- // that we have looped back to a type that we have previously visited.
- // Generate the appropriate upreference to handle this.
- if (Slot < CurSize) {
- Result += "\\" + utostr(CurSize-Slot); // Here's the upreference
- return;
- }
-
- TypeStack.push_back(Ty); // Recursive case: Add us to the stack..
-
- switch (Ty->getTypeID()) {
- case Type::IntegerTyID: {
- unsigned BitWidth = cast<IntegerType>(Ty)->getBitWidth();
- Result += "i" + utostr(BitWidth);
- break;
- }
- case Type::FunctionTyID: {
- const FunctionType *FTy = cast<FunctionType>(Ty);
- calcTypeName(FTy->getReturnType(), TypeStack, TypeNames, Result);
- Result += " (";
- for (FunctionType::param_iterator I = FTy->param_begin(),
- E = FTy->param_end(); I != E; ++I) {
- if (I != FTy->param_begin())
- Result += ", ";
- calcTypeName(*I, TypeStack, TypeNames, Result);
- }
- if (FTy->isVarArg()) {
- if (FTy->getNumParams()) Result += ", ";
- Result += "...";
- }
- Result += ")";
- break;
- }
- case Type::StructTyID: {
- const StructType *STy = cast<StructType>(Ty);
- if (STy->isPacked())
- Result += '<';
- Result += "{ ";
- for (StructType::element_iterator I = STy->element_begin(),
- E = STy->element_end(); I != E; ++I) {
- if (I != STy->element_begin())
- Result += ", ";
- calcTypeName(*I, TypeStack, TypeNames, Result);
- }
- Result += " }";
- if (STy->isPacked())
- Result += '>';
- break;
- }
- case Type::PointerTyID: {
- const PointerType *PTy = cast<PointerType>(Ty);
- calcTypeName(PTy->getElementType(),
- TypeStack, TypeNames, Result);
- if (unsigned AddressSpace = PTy->getAddressSpace())
- Result += " addrspace(" + utostr(AddressSpace) + ")";
- Result += "*";
- break;
- }
- case Type::ArrayTyID: {
- const ArrayType *ATy = cast<ArrayType>(Ty);
- Result += "[" + utostr(ATy->getNumElements()) + " x ";
- calcTypeName(ATy->getElementType(), TypeStack, TypeNames, Result);
- Result += "]";
- break;
- }
- case Type::VectorTyID: {
- const VectorType *PTy = cast<VectorType>(Ty);
- Result += "<" + utostr(PTy->getNumElements()) + " x ";
- calcTypeName(PTy->getElementType(), TypeStack, TypeNames, Result);
- Result += ">";
- break;
- }
- case Type::OpaqueTyID:
- Result += "opaque";
- break;
- default:
- Result += "<unrecognized-type>";
- break;
- }
-
- TypeStack.pop_back(); // Remove self from stack...
-}
-
-
-/// printTypeInt - The internal guts of printing out a type that has a
-/// potentially named portion.
-///
-static std::ostream &printTypeInt(std::ostream &Out, const Type *Ty,
- std::map<const Type *, std::string> &TypeNames) {
- // Primitive types always print out their description, regardless of whether
- // they have been named or not.
- //
- if (Ty->isInteger() || (Ty->isPrimitiveType() && !isa<OpaqueType>(Ty)))
- return Out << Ty->getDescription();
-
- // Check to see if the type is named.
- std::map<const Type *, std::string>::iterator I = TypeNames.find(Ty);
- if (I != TypeNames.end()) return Out << I->second;
-
- // Otherwise we have a type that has not been named but is a derived type.
- // Carefully recurse the type hierarchy to print out any contained symbolic
- // names.
- //
- std::vector<const Type *> TypeStack;
- std::string TypeName;
- calcTypeName(Ty, TypeStack, TypeNames, TypeName);
- TypeNames.insert(std::make_pair(Ty, TypeName));//Cache type name for later use
- return (Out << TypeName);
-}
-
-
-/// WriteTypeSymbolic - This attempts to write the specified type as a symbolic
-/// type, iff there is an entry in the modules symbol table for the specified
-/// type or one of it's component types. This is slower than a simple x << Type
-///
-std::ostream &llvm::WriteTypeSymbolic(std::ostream &Out, const Type *Ty,
- const Module *M) {
- Out << ' ';
-
- // If they want us to print out a type, but there is no context, we can't
- // print it symbolically.
- if (!M)
- return Out << Ty->getDescription();
-
- std::map<const Type *, std::string> TypeNames;
- fillTypeNameTable(M, TypeNames);
- return printTypeInt(Out, Ty, TypeNames);
-}
-
-// PrintEscapedString - Print each character of the specified string, escaping
-// it if it is not printable or if it is an escape char.
-static void PrintEscapedString(const std::string &Str, std::ostream &Out) {
- for (unsigned i = 0, e = Str.size(); i != e; ++i) {
- unsigned char C = Str[i];
- if (isprint(C) && C != '"' && C != '\\') {
- Out << C;
- } else {
- Out << '\\'
- << (char) ((C/16 < 10) ? ( C/16 +'0') : ( C/16 -10+'A'))
- << (char)(((C&15) < 10) ? ((C&15)+'0') : ((C&15)-10+'A'));
- }
- }
-}
-
-static const char *getPredicateText(unsigned predicate) {
- const char * pred = "unknown";
- switch (predicate) {
- case FCmpInst::FCMP_FALSE: pred = "false"; break;
- case FCmpInst::FCMP_OEQ: pred = "oeq"; break;
- case FCmpInst::FCMP_OGT: pred = "ogt"; break;
- case FCmpInst::FCMP_OGE: pred = "oge"; break;
- case FCmpInst::FCMP_OLT: pred = "olt"; break;
- case FCmpInst::FCMP_OLE: pred = "ole"; break;
- case FCmpInst::FCMP_ONE: pred = "one"; break;
- case FCmpInst::FCMP_ORD: pred = "ord"; break;
- case FCmpInst::FCMP_UNO: pred = "uno"; break;
- case FCmpInst::FCMP_UEQ: pred = "ueq"; break;
- case FCmpInst::FCMP_UGT: pred = "ugt"; break;
- case FCmpInst::FCMP_UGE: pred = "uge"; break;
- case FCmpInst::FCMP_ULT: pred = "ult"; break;
- case FCmpInst::FCMP_ULE: pred = "ule"; break;
- case FCmpInst::FCMP_UNE: pred = "une"; break;
- case FCmpInst::FCMP_TRUE: pred = "true"; break;
- case ICmpInst::ICMP_EQ: pred = "eq"; break;
- case ICmpInst::ICMP_NE: pred = "ne"; break;
- case ICmpInst::ICMP_SGT: pred = "sgt"; break;
- case ICmpInst::ICMP_SGE: pred = "sge"; break;
- case ICmpInst::ICMP_SLT: pred = "slt"; break;
- case ICmpInst::ICMP_SLE: pred = "sle"; break;
- case ICmpInst::ICMP_UGT: pred = "ugt"; break;
- case ICmpInst::ICMP_UGE: pred = "uge"; break;
- case ICmpInst::ICMP_ULT: pred = "ult"; break;
- case ICmpInst::ICMP_ULE: pred = "ule"; break;
- }
- return pred;
-}
-
-/// @brief Internal constant writer.
-static void WriteConstantInt(std::ostream &Out, const Constant *CV,
- std::map<const Type *, std::string> &TypeTable,
- SlotMachine *Machine) {
- const int IndentSize = 4;
- static std::string Indent = "\n";
- if (const ConstantInt *CI = dyn_cast<ConstantInt>(CV)) {
- if (CI->getType() == Type::Int1Ty)
- Out << (CI->getZExtValue() ? "true" : "false");
- else
- Out << CI->getValue().toStringSigned(10);
- } else if (const ConstantFP *CFP = dyn_cast<ConstantFP>(CV)) {
- if (&CFP->getValueAPF().getSemantics() == &APFloat::IEEEdouble ||
- &CFP->getValueAPF().getSemantics() == &APFloat::IEEEsingle) {
- // We would like to output the FP constant value in exponential notation,
- // but we cannot do this if doing so will lose precision. Check here to
- // make sure that we only output it in exponential format if we can parse
- // the value back and get the same value.
- //
- bool isDouble = &CFP->getValueAPF().getSemantics()==&APFloat::IEEEdouble;
- double Val = (isDouble) ? CFP->getValueAPF().convertToDouble() :
- CFP->getValueAPF().convertToFloat();
- std::string StrVal = ftostr(CFP->getValueAPF());
-
- // Check to make sure that the stringized number is not some string like
- // "Inf" or NaN, that atof will accept, but the lexer will not. Check
- // that the string matches the "[-+]?[0-9]" regex.
- //
- if ((StrVal[0] >= '0' && StrVal[0] <= '9') ||
- ((StrVal[0] == '-' || StrVal[0] == '+') &&
- (StrVal[1] >= '0' && StrVal[1] <= '9'))) {
- // Reparse stringized version!
- if (atof(StrVal.c_str()) == Val) {
- Out << StrVal;
- return;
- }
- }
- // Otherwise we could not reparse it to exactly the same value, so we must
- // output the string in hexadecimal format!
- assert(sizeof(double) == sizeof(uint64_t) &&
- "assuming that double is 64 bits!");
- Out << "0x" << utohexstr(DoubleToBits(Val));
- } else {
- // Some form of long double. These appear as a magic letter identifying
- // the type, then a fixed number of hex digits.
- Out << "0x";
- if (&CFP->getValueAPF().getSemantics() == &APFloat::x87DoubleExtended)
- Out << 'K';
- else if (&CFP->getValueAPF().getSemantics() == &APFloat::IEEEquad)
- Out << 'L';
- else if (&CFP->getValueAPF().getSemantics() == &APFloat::PPCDoubleDouble)
- Out << 'M';
- else
- assert(0 && "Unsupported floating point type");
- // api needed to prevent premature destruction
- APInt api = CFP->getValueAPF().convertToAPInt();
- const uint64_t* p = api.getRawData();
- uint64_t word = *p;
- int shiftcount=60;
- int width = api.getBitWidth();
- for (int j=0; j<width; j+=4, shiftcount-=4) {
- unsigned int nibble = (word>>shiftcount) & 15;
- if (nibble < 10)
- Out << (unsigned char)(nibble + '0');
- else
- Out << (unsigned char)(nibble - 10 + 'A');
- if (shiftcount == 0 && j+4 < width) {
- word = *(++p);
- shiftcount = 64;
- if (width-j-4 < 64)
- shiftcount = width-j-4;
- }
- }
- }
- } else if (isa<ConstantAggregateZero>(CV)) {
- Out << "zeroinitializer";
- } else if (const ConstantArray *CA = dyn_cast<ConstantArray>(CV)) {
- // As a special case, print the array as a string if it is an array of
- // ubytes or an array of sbytes with positive values.
- //
- const Type *ETy = CA->getType()->getElementType();
- if (CA->isString()) {
- Out << "c\"";
- PrintEscapedString(CA->getAsString(), Out);
- Out << "\"";
-
- } else { // Cannot output in string format...
- Out << '[';
- if (CA->getNumOperands()) {
- Out << ' ';
- printTypeInt(Out, ETy, TypeTable);
- WriteAsOperandInternal(Out, CA->getOperand(0),
- TypeTable, Machine);
- for (unsigned i = 1, e = CA->getNumOperands(); i != e; ++i) {
- Out << ", ";
- printTypeInt(Out, ETy, TypeTable);
- WriteAsOperandInternal(Out, CA->getOperand(i), TypeTable, Machine);
- }
- }
- Out << " ]";
- }
- } else if (const ConstantStruct *CS = dyn_cast<ConstantStruct>(CV)) {
- if (CS->getType()->isPacked())
- Out << '<';
- Out << '{';
- unsigned N = CS->getNumOperands();
- if (N) {
- if (N > 2) {
- Indent += std::string(IndentSize, ' ');
- Out << Indent;
- } else {
- Out << ' ';
- }
- printTypeInt(Out, CS->getOperand(0)->getType(), TypeTable);
-
- WriteAsOperandInternal(Out, CS->getOperand(0), TypeTable, Machine);
-
- for (unsigned i = 1; i < N; i++) {
- Out << ", ";
- if (N > 2) Out << Indent;
- printTypeInt(Out, CS->getOperand(i)->getType(), TypeTable);
-
- WriteAsOperandInternal(Out, CS->getOperand(i), TypeTable, Machine);
- }
- if (N > 2) Indent.resize(Indent.size() - IndentSize);
- }
-
- Out << " }";
- if (CS->getType()->isPacked())
- Out << '>';
- } else if (const ConstantVector *CP = dyn_cast<ConstantVector>(CV)) {
- const Type *ETy = CP->getType()->getElementType();
- assert(CP->getNumOperands() > 0 &&
- "Number of operands for a PackedConst must be > 0");
- Out << '<';
- Out << ' ';
- printTypeInt(Out, ETy, TypeTable);
- WriteAsOperandInternal(Out, CP->getOperand(0), TypeTable, Machine);
- for (unsigned i = 1, e = CP->getNumOperands(); i != e; ++i) {
- Out << ", ";
- printTypeInt(Out, ETy, TypeTable);
- WriteAsOperandInternal(Out, CP->getOperand(i), TypeTable, Machine);
- }
- Out << " >";
- } else if (isa<ConstantPointerNull>(CV)) {
- Out << "null";
-
- } else if (isa<UndefValue>(CV)) {
- Out << "undef";
-
- } else if (const ConstantExpr *CE = dyn_cast<ConstantExpr>(CV)) {
- Out << CE->getOpcodeName();
- if (CE->isCompare())
- Out << " " << getPredicateText(CE->getPredicate());
- Out << " (";
-
- for (User::const_op_iterator OI=CE->op_begin(); OI != CE->op_end(); ++OI) {
- printTypeInt(Out, (*OI)->getType(), TypeTable);
- WriteAsOperandInternal(Out, *OI, TypeTable, Machine);
- if (OI+1 != CE->op_end())
- Out << ", ";
- }
-
- if (CE->isCast()) {
- Out << " to ";
- printTypeInt(Out, CE->getType(), TypeTable);
- }
-
- Out << ')';
-
- } else {
- Out << "<placeholder or erroneous Constant>";
- }
-}
-
-
-/// WriteAsOperand - Write the name of the specified value out to the specified
-/// ostream. This can be useful when you just want to print int %reg126, not
-/// the whole instruction that generated it.
-///
-static void WriteAsOperandInternal(std::ostream &Out, const Value *V,
- std::map<const Type*, std::string> &TypeTable,
- SlotMachine *Machine) {
- Out << ' ';
- if (V->hasName())
- Out << getLLVMName(V->getName(),
- isa<GlobalValue>(V) ? GlobalPrefix : LocalPrefix);
- else {
- const Constant *CV = dyn_cast<Constant>(V);
- if (CV && !isa<GlobalValue>(CV)) {
- WriteConstantInt(Out, CV, TypeTable, Machine);
- } else if (const InlineAsm *IA = dyn_cast<InlineAsm>(V)) {
- Out << "asm ";
- if (IA->hasSideEffects())
- Out << "sideeffect ";
- Out << '"';
- PrintEscapedString(IA->getAsmString(), Out);
- Out << "\", \"";
- PrintEscapedString(IA->getConstraintString(), Out);
- Out << '"';
- } else {
- char Prefix = '%';
- int Slot;
- if (Machine) {
- if (const GlobalValue *GV = dyn_cast<GlobalValue>(V)) {
- Slot = Machine->getGlobalSlot(GV);
- Prefix = '@';
- } else {
- Slot = Machine->getLocalSlot(V);
- }
- } else {
- Machine = createSlotMachine(V);
- if (Machine) {
- if (const GlobalValue *GV = dyn_cast<GlobalValue>(V)) {
- Slot = Machine->getGlobalSlot(GV);
- Prefix = '@';
- } else {
- Slot = Machine->getLocalSlot(V);
- }
- } else {
- Slot = -1;
- }
- delete Machine;
- }
- if (Slot != -1)
- Out << Prefix << Slot;
- else
- Out << "<badref>";
- }
- }
-}
-
-/// WriteAsOperand - Write the name of the specified value out to the specified
-/// ostream. This can be useful when you just want to print int %reg126, not
-/// the whole instruction that generated it.
-///
-std::ostream &llvm::WriteAsOperand(std::ostream &Out, const Value *V,
- bool PrintType, const Module *Context) {
- std::map<const Type *, std::string> TypeNames;
- if (Context == 0) Context = getModuleFromVal(V);
-
- if (Context)
- fillTypeNameTable(Context, TypeNames);
-
- if (PrintType)
- printTypeInt(Out, V->getType(), TypeNames);
-
- WriteAsOperandInternal(Out, V, TypeNames, 0);
- return Out;
-}
-
-
-namespace llvm {
-
-class AssemblyWriter {
- std::ostream &Out;
- SlotMachine &Machine;
- const Module *TheModule;
- std::map<const Type *, std::string> TypeNames;
- AssemblyAnnotationWriter *AnnotationWriter;
-public:
- inline AssemblyWriter(std::ostream &o, SlotMachine &Mac, const Module *M,
- AssemblyAnnotationWriter *AAW)
- : Out(o), Machine(Mac), TheModule(M), AnnotationWriter(AAW) {
-
- // If the module has a symbol table, take all global types and stuff their
- // names into the TypeNames map.
- //
- fillTypeNameTable(M, TypeNames);
- }
-
- inline void write(const Module *M) { printModule(M); }
- inline void write(const GlobalVariable *G) { printGlobal(G); }
- inline void write(const GlobalAlias *G) { printAlias(G); }
- inline void write(const Function *F) { printFunction(F); }
- inline void write(const BasicBlock *BB) { printBasicBlock(BB); }
- inline void write(const Instruction *I) { printInstruction(*I); }
- inline void write(const Type *Ty) { printType(Ty); }
-
- void writeOperand(const Value *Op, bool PrintType);
- void writeParamOperand(const Value *Operand, ParameterAttributes Attrs);
-
- const Module* getModule() { return TheModule; }
-
-private:
- void printModule(const Module *M);
- void printTypeSymbolTable(const TypeSymbolTable &ST);
- void printGlobal(const GlobalVariable *GV);
- void printAlias(const GlobalAlias *GV);
- void printFunction(const Function *F);
- void printArgument(const Argument *FA, ParameterAttributes Attrs);
- void printBasicBlock(const BasicBlock *BB);
- void printInstruction(const Instruction &I);
-
- // printType - Go to extreme measures to attempt to print out a short,
- // symbolic version of a type name.
- //
- std::ostream &printType(const Type *Ty) {
- return printTypeInt(Out, Ty, TypeNames);
- }
-
- // printTypeAtLeastOneLevel - Print out one level of the possibly complex type
- // without considering any symbolic types that we may have equal to it.
- //
- std::ostream &printTypeAtLeastOneLevel(const Type *Ty);
-
- // printInfoComment - Print a little comment after the instruction indicating
- // which slot it occupies.
- void printInfoComment(const Value &V);
-};
-} // end of llvm namespace
-
-/// printTypeAtLeastOneLevel - Print out one level of the possibly complex type
-/// without considering any symbolic types that we may have equal to it.
-///
-std::ostream &AssemblyWriter::printTypeAtLeastOneLevel(const Type *Ty) {
- if (const IntegerType *ITy = dyn_cast<IntegerType>(Ty))
- Out << "i" << utostr(ITy->getBitWidth());
- else if (const FunctionType *FTy = dyn_cast<FunctionType>(Ty)) {
- printType(FTy->getReturnType());
- Out << " (";
- for (FunctionType::param_iterator I = FTy->param_begin(),
- E = FTy->param_end(); I != E; ++I) {
- if (I != FTy->param_begin())
- Out << ", ";
- printType(*I);
- }
- if (FTy->isVarArg()) {
- if (FTy->getNumParams()) Out << ", ";
- Out << "...";
- }
- Out << ')';
- } else if (const StructType *STy = dyn_cast<StructType>(Ty)) {
- if (STy->isPacked())
- Out << '<';
- Out << "{ ";
- for (StructType::element_iterator I = STy->element_begin(),
- E = STy->element_end(); I != E; ++I) {
- if (I != STy->element_begin())
- Out << ", ";
- printType(*I);
- }
- Out << " }";
- if (STy->isPacked())
- Out << '>';
- } else if (const PointerType *PTy = dyn_cast<PointerType>(Ty)) {
- printType(PTy->getElementType());
- if (unsigned AddressSpace = PTy->getAddressSpace())
- Out << " addrspace(" << AddressSpace << ")";
- Out << '*';
- } else if (const ArrayType *ATy = dyn_cast<ArrayType>(Ty)) {
- Out << '[' << ATy->getNumElements() << " x ";
- printType(ATy->getElementType()) << ']';
- } else if (const VectorType *PTy = dyn_cast<VectorType>(Ty)) {
- Out << '<' << PTy->getNumElements() << " x ";
- printType(PTy->getElementType()) << '>';
- }
- else if (isa<OpaqueType>(Ty)) {
- Out << "opaque";
- } else {
- if (!Ty->isPrimitiveType())
- Out << "<unknown derived type>";
- printType(Ty);
- }
- return Out;
-}
-
-
-void AssemblyWriter::writeOperand(const Value *Operand, bool PrintType) {
- if (Operand == 0) {
- Out << "<null operand!>";
- } else {
- if (PrintType) { Out << ' '; printType(Operand->getType()); }
- WriteAsOperandInternal(Out, Operand, TypeNames, &Machine);
- }
-}
-
-void AssemblyWriter::writeParamOperand(const Value *Operand,
- ParameterAttributes Attrs) {
- if (Operand == 0) {
- Out << "<null operand!>";
- } else {
- Out << ' ';
- // Print the type
- printType(Operand->getType());
- // Print parameter attributes list
- if (Attrs != ParamAttr::None)
- Out << ' ' << ParamAttr::getAsString(Attrs);
- // Print the operand
- WriteAsOperandInternal(Out, Operand, TypeNames, &Machine);
- }
-}
-
-void AssemblyWriter::printModule(const Module *M) {
- if (!M->getModuleIdentifier().empty() &&
- // Don't print the ID if it will start a new line (which would
- // require a comment char before it).
- M->getModuleIdentifier().find('\n') == std::string::npos)
- Out << "; ModuleID = '" << M->getModuleIdentifier() << "'\n";
-
- if (!M->getDataLayout().empty())
- Out << "target datalayout = \"" << M->getDataLayout() << "\"\n";
- if (!M->getTargetTriple().empty())
- Out << "target triple = \"" << M->getTargetTriple() << "\"\n";
-
- if (!M->getModuleInlineAsm().empty()) {
- // Split the string into lines, to make it easier to read the .ll file.
- std::string Asm = M->getModuleInlineAsm();
- size_t CurPos = 0;
- size_t NewLine = Asm.find_first_of('\n', CurPos);
- while (NewLine != std::string::npos) {
- // We found a newline, print the portion of the asm string from the
- // last newline up to this newline.
- Out << "module asm \"";
- PrintEscapedString(std::string(Asm.begin()+CurPos, Asm.begin()+NewLine),
- Out);
- Out << "\"\n";
- CurPos = NewLine+1;
- NewLine = Asm.find_first_of('\n', CurPos);
- }
- Out << "module asm \"";
- PrintEscapedString(std::string(Asm.begin()+CurPos, Asm.end()), Out);
- Out << "\"\n";
- }
-
- // Loop over the dependent libraries and emit them.
- Module::lib_iterator LI = M->lib_begin();
- Module::lib_iterator LE = M->lib_end();
- if (LI != LE) {
- Out << "deplibs = [ ";
- while (LI != LE) {
- Out << '"' << *LI << '"';
- ++LI;
- if (LI != LE)
- Out << ", ";
- }
- Out << " ]\n";
- }
-
- // Loop over the symbol table, emitting all named constants.
- printTypeSymbolTable(M->getTypeSymbolTable());
-
- for (Module::const_global_iterator I = M->global_begin(), E = M->global_end();
- I != E; ++I)
- printGlobal(I);
-
- // Output all aliases.
- if (!M->alias_empty()) Out << "\n";
- for (Module::const_alias_iterator I = M->alias_begin(), E = M->alias_end();
- I != E; ++I)
- printAlias(I);
-
- // Output all of the functions.
- for (Module::const_iterator I = M->begin(), E = M->end(); I != E; ++I)
- printFunction(I);
-}
-
-void AssemblyWriter::printGlobal(const GlobalVariable *GV) {
- if (GV->hasName()) Out << getLLVMName(GV->getName(), GlobalPrefix) << " = ";
-
- if (!GV->hasInitializer()) {
- switch (GV->getLinkage()) {
- case GlobalValue::DLLImportLinkage: Out << "dllimport "; break;
- case GlobalValue::ExternalWeakLinkage: Out << "extern_weak "; break;
- default: Out << "external "; break;
- }
- } else {
- switch (GV->getLinkage()) {
- case GlobalValue::InternalLinkage: Out << "internal "; break;
- case GlobalValue::LinkOnceLinkage: Out << "linkonce "; break;
- case GlobalValue::WeakLinkage: Out << "weak "; break;
- case GlobalValue::AppendingLinkage: Out << "appending "; break;
- case GlobalValue::DLLImportLinkage: Out << "dllimport "; break;
- case GlobalValue::DLLExportLinkage: Out << "dllexport "; break;
- case GlobalValue::ExternalWeakLinkage: Out << "extern_weak "; break;
- case GlobalValue::ExternalLinkage: break;
- case GlobalValue::GhostLinkage:
- cerr << "GhostLinkage not allowed in AsmWriter!\n";
- abort();
- }
- switch (GV->getVisibility()) {
- default: assert(0 && "Invalid visibility style!");
- case GlobalValue::DefaultVisibility: break;
- case GlobalValue::HiddenVisibility: Out << "hidden "; break;
- case GlobalValue::ProtectedVisibility: Out << "protected "; break;
- }
- }
-
- if (GV->isThreadLocal()) Out << "thread_local ";
- Out << (GV->isConstant() ? "constant " : "global ");
- printType(GV->getType()->getElementType());
-
- if (GV->hasInitializer()) {
- Constant* C = cast<Constant>(GV->getInitializer());
- assert(C && "GlobalVar initializer isn't constant?");
- writeOperand(GV->getInitializer(), false);
- }
-
- if (unsigned AddressSpace = GV->getType()->getAddressSpace())
- Out << " addrspace(" << AddressSpace << ") ";
-
- if (GV->hasSection())
- Out << ", section \"" << GV->getSection() << '"';
- if (GV->getAlignment())
- Out << ", align " << GV->getAlignment();
-
- printInfoComment(*GV);
- Out << "\n";
-}
-
-void AssemblyWriter::printAlias(const GlobalAlias *GA) {
- Out << getLLVMName(GA->getName(), GlobalPrefix) << " = ";
- switch (GA->getVisibility()) {
- default: assert(0 && "Invalid visibility style!");
- case GlobalValue::DefaultVisibility: break;
- case GlobalValue::HiddenVisibility: Out << "hidden "; break;
- case GlobalValue::ProtectedVisibility: Out << "protected "; break;
- }
-
- Out << "alias ";
-
- switch (GA->getLinkage()) {
- case GlobalValue::WeakLinkage: Out << "weak "; break;
- case GlobalValue::InternalLinkage: Out << "internal "; break;
- case GlobalValue::ExternalLinkage: break;
- default:
- assert(0 && "Invalid alias linkage");
- }
-
- const Constant *Aliasee = GA->getAliasee();
-
- if (const GlobalVariable *GV = dyn_cast<GlobalVariable>(Aliasee)) {
- printType(GV->getType());
- Out << " " << getLLVMName(GV->getName(), GlobalPrefix);
- } else if (const Function *F = dyn_cast<Function>(Aliasee)) {
- printType(F->getFunctionType());
- Out << "* ";
-
- if (!F->getName().empty())
- Out << getLLVMName(F->getName(), GlobalPrefix);
- else
- Out << "@\"\"";
- } else if (const GlobalAlias *GA = dyn_cast<GlobalAlias>(Aliasee)) {
- printType(GA->getType());
- Out << " " << getLLVMName(GA->getName(), GlobalPrefix);
- } else {
- const ConstantExpr *CE = 0;
- if ((CE = dyn_cast<ConstantExpr>(Aliasee)) &&
- (CE->getOpcode() == Instruction::BitCast)) {
- writeOperand(CE, false);
- } else
- assert(0 && "Unsupported aliasee");
- }
-
- printInfoComment(*GA);
- Out << "\n";
-}
-
-void AssemblyWriter::printTypeSymbolTable(const TypeSymbolTable &ST) {
- // Print the types.
- for (TypeSymbolTable::const_iterator TI = ST.begin(), TE = ST.end();
- TI != TE; ++TI) {
- Out << "\t" << getLLVMName(TI->first, LocalPrefix) << " = type ";
-
- // Make sure we print out at least one level of the type structure, so
- // that we do not get %FILE = type %FILE
- //
- printTypeAtLeastOneLevel(TI->second) << "\n";
- }
-}
-
-/// printFunction - Print all aspects of a function.
-///
-void AssemblyWriter::printFunction(const Function *F) {
- // Print out the return type and name...
- Out << "\n";
-
- if (AnnotationWriter) AnnotationWriter->emitFunctionAnnot(F, Out);
-
- if (F->isDeclaration())
- Out << "declare ";
- else
- Out << "define ";
-
- switch (F->getLinkage()) {
- case GlobalValue::InternalLinkage: Out << "internal "; break;
- case GlobalValue::LinkOnceLinkage: Out << "linkonce "; break;
- case GlobalValue::WeakLinkage: Out << "weak "; break;
- case GlobalValue::AppendingLinkage: Out << "appending "; break;
- case GlobalValue::DLLImportLinkage: Out << "dllimport "; break;
- case GlobalValue::DLLExportLinkage: Out << "dllexport "; break;
- case GlobalValue::ExternalWeakLinkage: Out << "extern_weak "; break;
- case GlobalValue::ExternalLinkage: break;
- case GlobalValue::GhostLinkage:
- cerr << "GhostLinkage not allowed in AsmWriter!\n";
- abort();
- }
- switch (F->getVisibility()) {
- default: assert(0 && "Invalid visibility style!");
- case GlobalValue::DefaultVisibility: break;
- case GlobalValue::HiddenVisibility: Out << "hidden "; break;
- case GlobalValue::ProtectedVisibility: Out << "protected "; break;
- }
-
- // Print the calling convention.
- switch (F->getCallingConv()) {
- case CallingConv::C: break; // default
- case CallingConv::Fast: Out << "fastcc "; break;
- case CallingConv::Cold: Out << "coldcc "; break;
- case CallingConv::X86_StdCall: Out << "x86_stdcallcc "; break;
- case CallingConv::X86_FastCall: Out << "x86_fastcallcc "; break;
- default: Out << "cc" << F->getCallingConv() << " "; break;
- }
-
- const FunctionType *FT = F->getFunctionType();
- const PAListPtr &Attrs = F->getParamAttrs();
- printType(F->getReturnType()) << ' ';
- if (!F->getName().empty())
- Out << getLLVMName(F->getName(), GlobalPrefix);
- else
- Out << "@\"\"";
- Out << '(';
- Machine.incorporateFunction(F);
-
- // Loop over the arguments, printing them...
-
- unsigned Idx = 1;
- if (!F->isDeclaration()) {
- // If this isn't a declaration, print the argument names as well.
- for (Function::const_arg_iterator I = F->arg_begin(), E = F->arg_end();
- I != E; ++I) {
- // Insert commas as we go... the first arg doesn't get a comma
- if (I != F->arg_begin()) Out << ", ";
- printArgument(I, Attrs.getParamAttrs(Idx));
- Idx++;
- }
- } else {
- // Otherwise, print the types from the function type.
- for (unsigned i = 0, e = FT->getNumParams(); i != e; ++i) {
- // Insert commas as we go... the first arg doesn't get a comma
- if (i) Out << ", ";
-
- // Output type...
- printType(FT->getParamType(i));
-
- ParameterAttributes ArgAttrs = Attrs.getParamAttrs(i+1);
- if (ArgAttrs != ParamAttr::None)
- Out << ' ' << ParamAttr::getAsString(ArgAttrs);
- }
- }
-
- // Finish printing arguments...
- if (FT->isVarArg()) {
- if (FT->getNumParams()) Out << ", ";
- Out << "..."; // Output varargs portion of signature!
- }
- Out << ')';
- ParameterAttributes RetAttrs = Attrs.getParamAttrs(0);
- if (RetAttrs != ParamAttr::None)
- Out << ' ' << ParamAttr::getAsString(Attrs.getParamAttrs(0));
- if (F->hasSection())
- Out << " section \"" << F->getSection() << '"';
- if (F->getAlignment())
- Out << " align " << F->getAlignment();
- if (F->hasCollector())
- Out << " gc \"" << F->getCollector() << '"';
-
- if (F->isDeclaration()) {
- Out << "\n";
- } else {
- Out << " {";
-
- // Output all of its basic blocks... for the function
- for (Function::const_iterator I = F->begin(), E = F->end(); I != E; ++I)
- printBasicBlock(I);
-
- Out << "}\n";
- }
-
- Machine.purgeFunction();
-}
-
-/// printArgument - This member is called for every argument that is passed into
-/// the function. Simply print it out
-///
-void AssemblyWriter::printArgument(const Argument *Arg,
- ParameterAttributes Attrs) {
- // Output type...
- printType(Arg->getType());
-
- // Output parameter attributes list
- if (Attrs != ParamAttr::None)
- Out << ' ' << ParamAttr::getAsString(Attrs);
-
- // Output name, if available...
- if (Arg->hasName())
- Out << ' ' << getLLVMName(Arg->getName(), LocalPrefix);
-}
-
-/// printBasicBlock - This member is called for each basic block in a method.
-///
-void AssemblyWriter::printBasicBlock(const BasicBlock *BB) {
- if (BB->hasName()) { // Print out the label if it exists...
- Out << "\n" << getLLVMName(BB->getName(), LabelPrefix) << ':';
- } else if (!BB->use_empty()) { // Don't print block # of no uses...
- Out << "\n; <label>:";
- int Slot = Machine.getLocalSlot(BB);
- if (Slot != -1)
- Out << Slot;
- else
- Out << "<badref>";
- }
-
- if (BB->getParent() == 0)
- Out << "\t\t; Error: Block without parent!";
- else if (BB != &BB->getParent()->getEntryBlock()) { // Not the entry block?
- // Output predecessors for the block...
- Out << "\t\t;";
- pred_const_iterator PI = pred_begin(BB), PE = pred_end(BB);
-
- if (PI == PE) {
- Out << " No predecessors!";
- } else {
- Out << " preds =";
- writeOperand(*PI, false);
- for (++PI; PI != PE; ++PI) {
- Out << ',';
- writeOperand(*PI, false);
- }
- }
- }
-
- Out << "\n";
-
- if (AnnotationWriter) AnnotationWriter->emitBasicBlockStartAnnot(BB, Out);
-
- // Output all of the instructions in the basic block...
- for (BasicBlock::const_iterator I = BB->begin(), E = BB->end(); I != E; ++I)
- printInstruction(*I);
-
- if (AnnotationWriter) AnnotationWriter->emitBasicBlockEndAnnot(BB, Out);
-}
-
-
-/// printInfoComment - Print a little comment after the instruction indicating
-/// which slot it occupies.
-///
-void AssemblyWriter::printInfoComment(const Value &V) {
- if (V.getType() != Type::VoidTy) {
- Out << "\t\t; <";
- printType(V.getType()) << '>';
-
- if (!V.hasName()) {
- int SlotNum;
- if (const GlobalValue *GV = dyn_cast<GlobalValue>(&V))
- SlotNum = Machine.getGlobalSlot(GV);
- else
- SlotNum = Machine.getLocalSlot(&V);
- if (SlotNum == -1)
- Out << ":<badref>";
- else
- Out << ':' << SlotNum; // Print out the def slot taken.
- }
- Out << " [#uses=" << V.getNumUses() << ']'; // Output # uses
- }
-}
-
-// This member is called for each Instruction in a function..
-void AssemblyWriter::printInstruction(const Instruction &I) {
- if (AnnotationWriter) AnnotationWriter->emitInstructionAnnot(&I, Out);
-
- Out << "\t";
-
- // Print out name if it exists...
- if (I.hasName())
- Out << getLLVMName(I.getName(), LocalPrefix) << " = ";
-
- // If this is a volatile load or store, print out the volatile marker.
- if ((isa<LoadInst>(I) && cast<LoadInst>(I).isVolatile()) ||
- (isa<StoreInst>(I) && cast<StoreInst>(I).isVolatile())) {
- Out << "volatile ";
- } else if (isa<CallInst>(I) && cast<CallInst>(I).isTailCall()) {
- // If this is a call, check if it's a tail call.
- Out << "tail ";
- }
-
- // Print out the opcode...
- Out << I.getOpcodeName();
-
- // Print out the compare instruction predicates
- if (const FCmpInst *FCI = dyn_cast<FCmpInst>(&I)) {
- Out << " " << getPredicateText(FCI->getPredicate());
- } else if (const ICmpInst *ICI = dyn_cast<ICmpInst>(&I)) {
- Out << " " << getPredicateText(ICI->getPredicate());
- }
-
- // Print out the type of the operands...
- const Value *Operand = I.getNumOperands() ? I.getOperand(0) : 0;
-
- // Special case conditional branches to swizzle the condition out to the front
- if (isa<BranchInst>(I) && I.getNumOperands() > 1) {
- writeOperand(I.getOperand(2), true);
- Out << ',';
- writeOperand(Operand, true);
- Out << ',';
- writeOperand(I.getOperand(1), true);
-
- } else if (isa<SwitchInst>(I)) {
- // Special case switch statement to get formatting nice and correct...
- writeOperand(Operand , true); Out << ',';
- writeOperand(I.getOperand(1), true); Out << " [";
-
- for (unsigned op = 2, Eop = I.getNumOperands(); op < Eop; op += 2) {
- Out << "\n\t\t";
- writeOperand(I.getOperand(op ), true); Out << ',';
- writeOperand(I.getOperand(op+1), true);
- }
- Out << "\n\t]";
- } else if (isa<PHINode>(I)) {
- Out << ' ';
- printType(I.getType());
- Out << ' ';
-
- for (unsigned op = 0, Eop = I.getNumOperands(); op < Eop; op += 2) {
- if (op) Out << ", ";
- Out << '[';
- writeOperand(I.getOperand(op ), false); Out << ',';
- writeOperand(I.getOperand(op+1), false); Out << " ]";
- }
- } else if (const GetResultInst *GRI = dyn_cast<GetResultInst>(&I)) {
- writeOperand(I.getOperand(0), true);
- Out << ", " << GRI->getIndex();
- } else if (isa<ReturnInst>(I) && !Operand) {
- Out << " void";
- } else if (const CallInst *CI = dyn_cast<CallInst>(&I)) {
- // Print the calling convention being used.
- switch (CI->getCallingConv()) {
- case CallingConv::C: break; // default
- case CallingConv::Fast: Out << " fastcc"; break;
- case CallingConv::Cold: Out << " coldcc"; break;
- case CallingConv::X86_StdCall: Out << " x86_stdcallcc"; break;
- case CallingConv::X86_FastCall: Out << " x86_fastcallcc"; break;
- default: Out << " cc" << CI->getCallingConv(); break;
- }
-
- const PointerType *PTy = cast<PointerType>(Operand->getType());
- const FunctionType *FTy = cast<FunctionType>(PTy->getElementType());
- const Type *RetTy = FTy->getReturnType();
- const PAListPtr &PAL = CI->getParamAttrs();
-
- // If possible, print out the short form of the call instruction. We can
- // only do this if the first argument is a pointer to a nonvararg function,
- // and if the return type is not a pointer to a function.
- //
- if (!FTy->isVarArg() &&
- (!isa<PointerType>(RetTy) ||
- !isa<FunctionType>(cast<PointerType>(RetTy)->getElementType()))) {
- Out << ' '; printType(RetTy);
- writeOperand(Operand, false);
- } else {
- writeOperand(Operand, true);
- }
- Out << '(';
- for (unsigned op = 1, Eop = I.getNumOperands(); op < Eop; ++op) {
- if (op > 1)
- Out << ',';
- writeParamOperand(I.getOperand(op), PAL.getParamAttrs(op));
- }
- Out << " )";
- if (PAL.getParamAttrs(0) != ParamAttr::None)
- Out << ' ' << ParamAttr::getAsString(PAL.getParamAttrs(0));
- } else if (const InvokeInst *II = dyn_cast<InvokeInst>(&I)) {
- const PointerType *PTy = cast<PointerType>(Operand->getType());
- const FunctionType *FTy = cast<FunctionType>(PTy->getElementType());
- const Type *RetTy = FTy->getReturnType();
- const PAListPtr &PAL = II->getParamAttrs();
-
- // Print the calling convention being used.
- switch (II->getCallingConv()) {
- case CallingConv::C: break; // default
- case CallingConv::Fast: Out << " fastcc"; break;
- case CallingConv::Cold: Out << " coldcc"; break;
- case CallingConv::X86_StdCall: Out << "x86_stdcallcc "; break;
- case CallingConv::X86_FastCall: Out << "x86_fastcallcc "; break;
- default: Out << " cc" << II->getCallingConv(); break;
- }
-
- // If possible, print out the short form of the invoke instruction. We can
- // only do this if the first argument is a pointer to a nonvararg function,
- // and if the return type is not a pointer to a function.
- //
- if (!FTy->isVarArg() &&
- (!isa<PointerType>(RetTy) ||
- !isa<FunctionType>(cast<PointerType>(RetTy)->getElementType()))) {
- Out << ' '; printType(RetTy);
- writeOperand(Operand, false);
- } else {
- writeOperand(Operand, true);
- }
-
- Out << '(';
- for (unsigned op = 3, Eop = I.getNumOperands(); op < Eop; ++op) {
- if (op > 3)
- Out << ',';
- writeParamOperand(I.getOperand(op), PAL.getParamAttrs(op-2));
- }
-
- Out << " )";
- if (PAL.getParamAttrs(0) != ParamAttr::None)
- Out << " " << ParamAttr::getAsString(PAL.getParamAttrs(0));
- Out << "\n\t\t\tto";
- writeOperand(II->getNormalDest(), true);
- Out << " unwind";
- writeOperand(II->getUnwindDest(), true);
-
- } else if (const AllocationInst *AI = dyn_cast<AllocationInst>(&I)) {
- Out << ' ';
- printType(AI->getType()->getElementType());
- if (AI->isArrayAllocation()) {
- Out << ',';
- writeOperand(AI->getArraySize(), true);
- }
- if (AI->getAlignment()) {
- Out << ", align " << AI->getAlignment();
- }
- } else if (isa<CastInst>(I)) {
- if (Operand) writeOperand(Operand, true); // Work with broken code
- Out << " to ";
- printType(I.getType());
- } else if (isa<VAArgInst>(I)) {
- if (Operand) writeOperand(Operand, true); // Work with broken code
- Out << ", ";
- printType(I.getType());
- } else if (Operand) { // Print the normal way...
-
- // PrintAllTypes - Instructions who have operands of all the same type
- // omit the type from all but the first operand. If the instruction has
- // different type operands (for example br), then they are all printed.
- bool PrintAllTypes = false;
- const Type *TheType = Operand->getType();
-
- // Select, Store and ShuffleVector always print all types.
- if (isa<SelectInst>(I) || isa<StoreInst>(I) || isa<ShuffleVectorInst>(I)
- || isa<ReturnInst>(I)) {
- PrintAllTypes = true;
- } else {
- for (unsigned i = 1, E = I.getNumOperands(); i != E; ++i) {
- Operand = I.getOperand(i);
- if (Operand->getType() != TheType) {
- PrintAllTypes = true; // We have differing types! Print them all!
- break;
- }
- }
- }
-
- if (!PrintAllTypes) {
- Out << ' ';
- printType(TheType);
- }
-
- for (unsigned i = 0, E = I.getNumOperands(); i != E; ++i) {
- if (i) Out << ',';
- writeOperand(I.getOperand(i), PrintAllTypes);
- }
- }
-
- // Print post operand alignment for load/store
- if (isa<LoadInst>(I) && cast<LoadInst>(I).getAlignment()) {
- Out << ", align " << cast<LoadInst>(I).getAlignment();
- } else if (isa<StoreInst>(I) && cast<StoreInst>(I).getAlignment()) {
- Out << ", align " << cast<StoreInst>(I).getAlignment();
- }
-
- printInfoComment(I);
- Out << "\n";
-}
-
-
-//===----------------------------------------------------------------------===//
-// External Interface declarations
-//===----------------------------------------------------------------------===//
-
-void Module::print(std::ostream &o, AssemblyAnnotationWriter *AAW) const {
- SlotMachine SlotTable(this);
- AssemblyWriter W(o, SlotTable, this, AAW);
- W.write(this);
-}
-
-void GlobalVariable::print(std::ostream &o) const {
- SlotMachine SlotTable(getParent());
- AssemblyWriter W(o, SlotTable, getParent(), 0);
- W.write(this);
-}
-
-void GlobalAlias::print(std::ostream &o) const {
- SlotMachine SlotTable(getParent());
- AssemblyWriter W(o, SlotTable, getParent(), 0);
- W.write(this);
-}
-
-void Function::print(std::ostream &o, AssemblyAnnotationWriter *AAW) const {
- SlotMachine SlotTable(getParent());
- AssemblyWriter W(o, SlotTable, getParent(), AAW);
-
- W.write(this);
-}
-
-void InlineAsm::print(std::ostream &o, AssemblyAnnotationWriter *AAW) const {
- WriteAsOperand(o, this, true, 0);
-}
-
-void BasicBlock::print(std::ostream &o, AssemblyAnnotationWriter *AAW) const {
- SlotMachine SlotTable(getParent());
- AssemblyWriter W(o, SlotTable,
- getParent() ? getParent()->getParent() : 0, AAW);
- W.write(this);
-}
-
-void Instruction::print(std::ostream &o, AssemblyAnnotationWriter *AAW) const {
- const Function *F = getParent() ? getParent()->getParent() : 0;
- SlotMachine SlotTable(F);
- AssemblyWriter W(o, SlotTable, F ? F->getParent() : 0, AAW);
-
- W.write(this);
-}
-
-void Constant::print(std::ostream &o) const {
- if (this == 0) { o << "<null> constant value\n"; return; }
-
- o << ' ' << getType()->getDescription() << ' ';
-
- std::map<const Type *, std::string> TypeTable;
- WriteConstantInt(o, this, TypeTable, 0);
-}
-
-void Type::print(std::ostream &o) const {
- if (this == 0)
- o << "<null Type>";
- else
- o << getDescription();
-}
-
-void Argument::print(std::ostream &o) const {
- WriteAsOperand(o, this, true, getParent() ? getParent()->getParent() : 0);
-}
-
-// Value::dump - allow easy printing of Values from the debugger.
-// Located here because so much of the needed functionality is here.
-void Value::dump() const { print(*cerr.stream()); cerr << '\n'; }
-
-// Type::dump - allow easy printing of Values from the debugger.
-// Located here because so much of the needed functionality is here.
-void Type::dump() const { print(*cerr.stream()); cerr << '\n'; }
-
-//===----------------------------------------------------------------------===//
-// SlotMachine Implementation
-//===----------------------------------------------------------------------===//
-
-#if 0
-#define SC_DEBUG(X) cerr << X
-#else
-#define SC_DEBUG(X)
-#endif
-
-// Module level constructor. Causes the contents of the Module (sans functions)
-// to be added to the slot table.
-SlotMachine::SlotMachine(const Module *M)
- : TheModule(M) ///< Saved for lazy initialization.
- , TheFunction(0)
- , FunctionProcessed(false)
- , mMap(), mNext(0), fMap(), fNext(0)
-{
-}
-
-// Function level constructor. Causes the contents of the Module and the one
-// function provided to be added to the slot table.
-SlotMachine::SlotMachine(const Function *F)
- : TheModule(F ? F->getParent() : 0) ///< Saved for lazy initialization
- , TheFunction(F) ///< Saved for lazy initialization
- , FunctionProcessed(false)
- , mMap(), mNext(0), fMap(), fNext(0)
-{
-}
-
-inline void SlotMachine::initialize() {
- if (TheModule) {
- processModule();
- TheModule = 0; ///< Prevent re-processing next time we're called.
- }
- if (TheFunction && !FunctionProcessed)
- processFunction();
-}
-
-// Iterate through all the global variables, functions, and global
-// variable initializers and create slots for them.
-void SlotMachine::processModule() {
- SC_DEBUG("begin processModule!\n");
-
- // Add all of the unnamed global variables to the value table.
- for (Module::const_global_iterator I = TheModule->global_begin(),
- E = TheModule->global_end(); I != E; ++I)
- if (!I->hasName())
- CreateModuleSlot(I);
-
- // Add all the unnamed functions to the table.
- for (Module::const_iterator I = TheModule->begin(), E = TheModule->end();
- I != E; ++I)
- if (!I->hasName())
- CreateModuleSlot(I);
-
- SC_DEBUG("end processModule!\n");
-}
-
-
-// Process the arguments, basic blocks, and instructions of a function.
-void SlotMachine::processFunction() {
- SC_DEBUG("begin processFunction!\n");
- fNext = 0;
-
- // Add all the function arguments with no names.
- for(Function::const_arg_iterator AI = TheFunction->arg_begin(),
- AE = TheFunction->arg_end(); AI != AE; ++AI)
- if (!AI->hasName())
- CreateFunctionSlot(AI);
-
- SC_DEBUG("Inserting Instructions:\n");
-
- // Add all of the basic blocks and instructions with no names.
- for (Function::const_iterator BB = TheFunction->begin(),
- E = TheFunction->end(); BB != E; ++BB) {
- if (!BB->hasName())
- CreateFunctionSlot(BB);
- for (BasicBlock::const_iterator I = BB->begin(), E = BB->end(); I != E; ++I)
- if (I->getType() != Type::VoidTy && !I->hasName())
- CreateFunctionSlot(I);
- }
-
- FunctionProcessed = true;
-
- SC_DEBUG("end processFunction!\n");
-}
-
-/// Clean up after incorporating a function. This is the only way to get out of
-/// the function incorporation state that affects get*Slot/Create*Slot. Function
-/// incorporation state is indicated by TheFunction != 0.
-void SlotMachine::purgeFunction() {
- SC_DEBUG("begin purgeFunction!\n");
- fMap.clear(); // Simply discard the function level map
- TheFunction = 0;
- FunctionProcessed = false;
- SC_DEBUG("end purgeFunction!\n");
-}
-
-/// getGlobalSlot - Get the slot number of a global value.
-int SlotMachine::getGlobalSlot(const GlobalValue *V) {
- // Check for uninitialized state and do lazy initialization.
- initialize();
-
- // Find the type plane in the module map
- ValueMap::const_iterator MI = mMap.find(V);
- if (MI == mMap.end()) return -1;
-
- return MI->second;
-}
-
-
-/// getLocalSlot - Get the slot number for a value that is local to a function.
-int SlotMachine::getLocalSlot(const Value *V) {
- assert(!isa<Constant>(V) && "Can't get a constant or global slot with this!");
-
- // Check for uninitialized state and do lazy initialization.
- initialize();
-
- ValueMap::const_iterator FI = fMap.find(V);
- if (FI == fMap.end()) return -1;
-
- return FI->second;
-}
-
-
-/// CreateModuleSlot - Insert the specified GlobalValue* into the slot table.
-void SlotMachine::CreateModuleSlot(const GlobalValue *V) {
- assert(V && "Can't insert a null Value into SlotMachine!");
- assert(V->getType() != Type::VoidTy && "Doesn't need a slot!");
- assert(!V->hasName() && "Doesn't need a slot!");
-
- unsigned DestSlot = mNext++;
- mMap[V] = DestSlot;
-
- SC_DEBUG(" Inserting value [" << V->getType() << "] = " << V << " slot=" <<
- DestSlot << " [");
- // G = Global, F = Function, A = Alias, o = other
- SC_DEBUG((isa<GlobalVariable>(V) ? 'G' :
- (isa<Function> ? 'F' :
- (isa<GlobalAlias> ? 'A' : 'o'))) << "]\n");
-}
-
-
-/// CreateSlot - Create a new slot for the specified value if it has no name.
-void SlotMachine::CreateFunctionSlot(const Value *V) {
- const Type *VTy = V->getType();
- assert(VTy != Type::VoidTy && !V->hasName() && "Doesn't need a slot!");
-
- unsigned DestSlot = fNext++;
- fMap[V] = DestSlot;
-
- // G = Global, F = Function, o = other
- SC_DEBUG(" Inserting value [" << VTy << "] = " << V << " slot=" <<
- DestSlot << " [o]\n");
-}
diff --git a/release_23/lib/VMCore/AutoUpgrade.cpp b/release_23/lib/VMCore/AutoUpgrade.cpp
deleted file mode 100644
index 7faff565096c..000000000000
--- a/release_23/lib/VMCore/AutoUpgrade.cpp
+++ /dev/null
@@ -1,316 +0,0 @@
-//===-- AutoUpgrade.cpp - Implement auto-upgrade helper functions ---------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the auto-upgrade helper functions
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/AutoUpgrade.h"
-#include "llvm/Constants.h"
-#include "llvm/Function.h"
-#include "llvm/Module.h"
-#include "llvm/Instructions.h"
-#include "llvm/Intrinsics.h"
-#include "llvm/ADT/SmallVector.h"
-#include <cstring>
-using namespace llvm;
-
-
-static bool UpgradeIntrinsicFunction1(Function *F, Function *&NewFn) {
- assert(F && "Illegal to upgrade a non-existent Function.");
-
- // Get the Function's name.
- const std::string& Name = F->getName();
-
- // Convenience
- const FunctionType *FTy = F->getFunctionType();
-
- // Quickly eliminate it, if it's not a candidate.
- if (Name.length() <= 8 || Name[0] != 'l' || Name[1] != 'l' ||
- Name[2] != 'v' || Name[3] != 'm' || Name[4] != '.')
- return false;
-
- Module *M = F->getParent();
- switch (Name[5]) {
- default: break;
- case 'b':
- // This upgrades the name of the llvm.bswap intrinsic function to only use
- // a single type name for overloading. We only care about the old format
- // 'llvm.bswap.i*.i*', so check for 'bswap.' and then for there being
- // a '.' after 'bswap.'
- if (Name.compare(5,6,"bswap.",6) == 0) {
- std::string::size_type delim = Name.find('.',11);
-
- if (delim != std::string::npos) {
- // Construct the new name as 'llvm.bswap' + '.i*'
- F->setName(Name.substr(0,10)+Name.substr(delim));
- NewFn = F;
- return true;
- }
- }
- break;
-
- case 'c':
- // We only want to fix the 'llvm.ct*' intrinsics which do not have the
- // correct return type, so we check for the name, and then check if the
- // return type does not match the parameter type.
- if ( (Name.compare(5,5,"ctpop",5) == 0 ||
- Name.compare(5,4,"ctlz",4) == 0 ||
- Name.compare(5,4,"cttz",4) == 0) &&
- FTy->getReturnType() != FTy->getParamType(0)) {
- // We first need to change the name of the old (bad) intrinsic, because
- // its type is incorrect, but we cannot overload that name. We
- // arbitrarily unique it here allowing us to construct a correctly named
- // and typed function below.
- F->setName("");
-
- // Now construct the new intrinsic with the correct name and type. We
- // leave the old function around in order to query its type, whatever it
- // may be, and correctly convert up to the new type.
- NewFn = cast<Function>(M->getOrInsertFunction(Name,
- FTy->getParamType(0),
- FTy->getParamType(0),
- (Type *)0));
- return true;
- }
- break;
-
- case 'p':
- // This upgrades the llvm.part.select overloaded intrinsic names to only
- // use one type specifier in the name. We only care about the old format
- // 'llvm.part.select.i*.i*', and solve as above with bswap.
- if (Name.compare(5,12,"part.select.",12) == 0) {
- std::string::size_type delim = Name.find('.',17);
-
- if (delim != std::string::npos) {
- // Construct a new name as 'llvm.part.select' + '.i*'
- F->setName(Name.substr(0,16)+Name.substr(delim));
- NewFn = F;
- return true;
- }
- break;
- }
-
- // This upgrades the llvm.part.set intrinsics similarly as above, however
- // we care about 'llvm.part.set.i*.i*.i*', but only the first two types
- // must match. There is an additional type specifier after these two
- // matching types that we must retain when upgrading. Thus, we require
- // finding 2 periods, not just one, after the intrinsic name.
- if (Name.compare(5,9,"part.set.",9) == 0) {
- std::string::size_type delim = Name.find('.',14);
-
- if (delim != std::string::npos &&
- Name.find('.',delim+1) != std::string::npos) {
- // Construct a new name as 'llvm.part.select' + '.i*.i*'
- F->setName(Name.substr(0,13)+Name.substr(delim));
- NewFn = F;
- return true;
- }
- break;
- }
-
- break;
- case 'x':
- // This fixes all MMX shift intrinsic instructions to take a
- // v1i64 instead of a v2i32 as the second parameter.
- if (Name.compare(5,10,"x86.mmx.ps",10) == 0 &&
- (Name.compare(13,4,"psll", 4) == 0 ||
- Name.compare(13,4,"psra", 4) == 0 ||
- Name.compare(13,4,"psrl", 4) == 0) && Name[17] != 'i') {
-
- const llvm::Type *VT = VectorType::get(IntegerType::get(64), 1);
-
- // We don't have to do anything if the parameter already has
- // the correct type.
- if (FTy->getParamType(1) == VT)
- break;
-
- // We first need to change the name of the old (bad) intrinsic, because
- // its type is incorrect, but we cannot overload that name. We
- // arbitrarily unique it here allowing us to construct a correctly named
- // and typed function below.
- F->setName("");
-
- assert(FTy->getNumParams() == 2 && "MMX shift intrinsics take 2 args!");
-
- // Now construct the new intrinsic with the correct name and type. We
- // leave the old function around in order to query its type, whatever it
- // may be, and correctly convert up to the new type.
- NewFn = cast<Function>(M->getOrInsertFunction(Name,
- FTy->getReturnType(),
- FTy->getParamType(0),
- VT,
- (Type *)0));
- return true;
- } else if (Name.compare(5,16,"x86.sse2.movl.dq",16) == 0) {
- // Calls to this intrinsic are transformed into ShuffleVector's.
- NewFn = 0;
- return true;
- }
-
- break;
- }
-
- // This may not belong here. This function is effectively being overloaded
- // to both detect an intrinsic which needs upgrading, and to provide the
- // upgraded form of the intrinsic. We should perhaps have two separate
- // functions for this.
- return false;
-}
-
-bool llvm::UpgradeIntrinsicFunction(Function *F, Function *&NewFn) {
- NewFn = 0;
- bool Upgraded = UpgradeIntrinsicFunction1(F, NewFn);
-
- // Upgrade intrinsic attributes. This does not change the function.
- if (NewFn)
- F = NewFn;
- if (unsigned id = F->getIntrinsicID(true))
- F->setParamAttrs(Intrinsic::getParamAttrs((Intrinsic::ID)id));
- return Upgraded;
-}
-
-// UpgradeIntrinsicCall - Upgrade a call to an old intrinsic to be a call the
-// upgraded intrinsic. All argument and return casting must be provided in
-// order to seamlessly integrate with existing context.
-void llvm::UpgradeIntrinsicCall(CallInst *CI, Function *NewFn) {
- Function *F = CI->getCalledFunction();
- assert(F && "CallInst has no function associated with it.");
-
- if (!NewFn) {
- if (strcmp(F->getNameStart(), "llvm.x86.sse2.movl.dq") == 0) {
- std::vector<Constant*> Idxs;
- Constant *Zero = ConstantInt::get(Type::Int32Ty, 0);
- Idxs.push_back(Zero);
- Idxs.push_back(Zero);
- Idxs.push_back(Zero);
- Idxs.push_back(Zero);
- Value *ZeroV = ConstantVector::get(Idxs);
-
- Idxs.clear();
- Idxs.push_back(ConstantInt::get(Type::Int32Ty, 4));
- Idxs.push_back(ConstantInt::get(Type::Int32Ty, 5));
- Idxs.push_back(ConstantInt::get(Type::Int32Ty, 2));
- Idxs.push_back(ConstantInt::get(Type::Int32Ty, 3));
- Value *Mask = ConstantVector::get(Idxs);
- ShuffleVectorInst *SI = new ShuffleVectorInst(ZeroV, CI->getOperand(1),
- Mask, "upgraded", CI);
-
- // Handle any uses of the old CallInst.
- if (!CI->use_empty())
- // Replace all uses of the old call with the new cast which has the
- // correct type.
- CI->replaceAllUsesWith(SI);
-
- // Clean up the old call now that it has been completely upgraded.
- CI->eraseFromParent();
- } else {
- assert(0 && "Unknown function for CallInst upgrade.");
- }
- return;
- }
-
- switch (NewFn->getIntrinsicID()) {
- default: assert(0 && "Unknown function for CallInst upgrade.");
- case Intrinsic::x86_mmx_psll_d:
- case Intrinsic::x86_mmx_psll_q:
- case Intrinsic::x86_mmx_psll_w:
- case Intrinsic::x86_mmx_psra_d:
- case Intrinsic::x86_mmx_psra_w:
- case Intrinsic::x86_mmx_psrl_d:
- case Intrinsic::x86_mmx_psrl_q:
- case Intrinsic::x86_mmx_psrl_w: {
- Value *Operands[2];
-
- Operands[0] = CI->getOperand(1);
-
- // Cast the second parameter to the correct type.
- BitCastInst *BC = new BitCastInst(CI->getOperand(2),
- NewFn->getFunctionType()->getParamType(1),
- "upgraded", CI);
- Operands[1] = BC;
-
- // Construct a new CallInst
- CallInst *NewCI = CallInst::Create(NewFn, Operands, Operands+2,
- "upgraded."+CI->getName(), CI);
- NewCI->setTailCall(CI->isTailCall());
- NewCI->setCallingConv(CI->getCallingConv());
-
- // Handle any uses of the old CallInst.
- if (!CI->use_empty())
- // Replace all uses of the old call with the new cast which has the
- // correct type.
- CI->replaceAllUsesWith(NewCI);
-
- // Clean up the old call now that it has been completely upgraded.
- CI->eraseFromParent();
- break;
- }
- case Intrinsic::ctlz:
- case Intrinsic::ctpop:
- case Intrinsic::cttz: {
- // Build a small vector of the 1..(N-1) operands, which are the
- // parameters.
- SmallVector<Value*, 8> Operands(CI->op_begin()+1, CI->op_end());
-
- // Construct a new CallInst
- CallInst *NewCI = CallInst::Create(NewFn, Operands.begin(), Operands.end(),
- "upgraded."+CI->getName(), CI);
- NewCI->setTailCall(CI->isTailCall());
- NewCI->setCallingConv(CI->getCallingConv());
-
- // Handle any uses of the old CallInst.
- if (!CI->use_empty()) {
- // Check for sign extend parameter attributes on the return values.
- bool SrcSExt = NewFn->getParamAttrs().paramHasAttr(0, ParamAttr::SExt);
- bool DestSExt = F->getParamAttrs().paramHasAttr(0, ParamAttr::SExt);
-
- // Construct an appropriate cast from the new return type to the old.
- CastInst *RetCast = CastInst::create(
- CastInst::getCastOpcode(NewCI, SrcSExt,
- F->getReturnType(),
- DestSExt),
- NewCI, F->getReturnType(),
- NewCI->getName(), CI);
- NewCI->moveBefore(RetCast);
-
- // Replace all uses of the old call with the new cast which has the
- // correct type.
- CI->replaceAllUsesWith(RetCast);
- }
-
- // Clean up the old call now that it has been completely upgraded.
- CI->eraseFromParent();
- }
- break;
- }
-}
-
-// This tests each Function to determine if it needs upgrading. When we find
-// one we are interested in, we then upgrade all calls to reflect the new
-// function.
-void llvm::UpgradeCallsToIntrinsic(Function* F) {
- assert(F && "Illegal attempt to upgrade a non-existent intrinsic.");
-
- // Upgrade the function and check if it is a totaly new function.
- Function* NewFn;
- if (UpgradeIntrinsicFunction(F, NewFn)) {
- if (NewFn != F) {
- // Replace all uses to the old function with the new one if necessary.
- for (Value::use_iterator UI = F->use_begin(), UE = F->use_end();
- UI != UE; ) {
- if (CallInst* CI = dyn_cast<CallInst>(*UI++))
- UpgradeIntrinsicCall(CI, NewFn);
- }
- // Remove old function, no longer used, from the module.
- F->eraseFromParent();
- }
- }
-}
-
diff --git a/release_23/lib/VMCore/BasicBlock.cpp b/release_23/lib/VMCore/BasicBlock.cpp
deleted file mode 100644
index 17469d6bdb2f..000000000000
--- a/release_23/lib/VMCore/BasicBlock.cpp
+++ /dev/null
@@ -1,293 +0,0 @@
-//===-- BasicBlock.cpp - Implement BasicBlock related methods -------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the BasicBlock class for the VMCore library.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/BasicBlock.h"
-#include "llvm/Constants.h"
-#include "llvm/Instructions.h"
-#include "llvm/Type.h"
-#include "llvm/Support/CFG.h"
-#include "llvm/Support/LeakDetector.h"
-#include "llvm/Support/Compiler.h"
-#include "SymbolTableListTraitsImpl.h"
-#include <algorithm>
-using namespace llvm;
-
-inline ValueSymbolTable *
-ilist_traits<Instruction>::getSymTab(BasicBlock *BB) {
- if (BB)
- if (Function *F = BB->getParent())
- return &F->getValueSymbolTable();
- return 0;
-}
-
-
-namespace {
- /// DummyInst - An instance of this class is used to mark the end of the
- /// instruction list. This is not a real instruction.
- struct VISIBILITY_HIDDEN DummyInst : public Instruction {
- // allocate space for exactly zero operands
- void *operator new(size_t s) {
- return User::operator new(s, 0);
- }
- DummyInst() : Instruction(Type::VoidTy, OtherOpsEnd, 0, 0) {
- // This should not be garbage monitored.
- LeakDetector::removeGarbageObject(this);
- }
-
- Instruction *clone() const {
- assert(0 && "Cannot clone EOL");abort();
- return 0;
- }
- const char *getOpcodeName() const { return "*end-of-list-inst*"; }
-
- // Methods for support type inquiry through isa, cast, and dyn_cast...
- static inline bool classof(const DummyInst *) { return true; }
- static inline bool classof(const Instruction *I) {
- return I->getOpcode() == OtherOpsEnd;
- }
- static inline bool classof(const Value *V) {
- return isa<Instruction>(V) && classof(cast<Instruction>(V));
- }
- };
-}
-
-Instruction *ilist_traits<Instruction>::createSentinel() {
- return new DummyInst();
-}
-iplist<Instruction> &ilist_traits<Instruction>::getList(BasicBlock *BB) {
- return BB->getInstList();
-}
-
-// Explicit instantiation of SymbolTableListTraits since some of the methods
-// are not in the public header file...
-template class SymbolTableListTraits<Instruction, BasicBlock>;
-
-
-BasicBlock::BasicBlock(const std::string &Name, Function *NewParent,
- BasicBlock *InsertBefore)
- : Value(Type::LabelTy, Value::BasicBlockVal), Parent(0) {
-
- // Make sure that we get added to a function
- LeakDetector::addGarbageObject(this);
-
- if (InsertBefore) {
- assert(NewParent &&
- "Cannot insert block before another block with no function!");
- NewParent->getBasicBlockList().insert(InsertBefore, this);
- } else if (NewParent) {
- NewParent->getBasicBlockList().push_back(this);
- }
-
- setName(Name);
-}
-
-
-BasicBlock::~BasicBlock() {
- assert(getParent() == 0 && "BasicBlock still linked into the program!");
- dropAllReferences();
- InstList.clear();
-}
-
-void BasicBlock::setParent(Function *parent) {
- if (getParent())
- LeakDetector::addGarbageObject(this);
-
- // Set Parent=parent, updating instruction symtab entries as appropriate.
- InstList.setSymTabObject(&Parent, parent);
-
- if (getParent())
- LeakDetector::removeGarbageObject(this);
-}
-
-void BasicBlock::removeFromParent() {
- getParent()->getBasicBlockList().remove(this);
-}
-
-void BasicBlock::eraseFromParent() {
- getParent()->getBasicBlockList().erase(this);
-}
-
-/// moveBefore - Unlink this basic block from its current function and
-/// insert it into the function that MovePos lives in, right before MovePos.
-void BasicBlock::moveBefore(BasicBlock *MovePos) {
- MovePos->getParent()->getBasicBlockList().splice(MovePos,
- getParent()->getBasicBlockList(), this);
-}
-
-/// moveAfter - Unlink this basic block from its current function and
-/// insert it into the function that MovePos lives in, right after MovePos.
-void BasicBlock::moveAfter(BasicBlock *MovePos) {
- Function::iterator I = MovePos;
- MovePos->getParent()->getBasicBlockList().splice(++I,
- getParent()->getBasicBlockList(), this);
-}
-
-
-TerminatorInst *BasicBlock::getTerminator() {
- if (InstList.empty()) return 0;
- return dyn_cast<TerminatorInst>(&InstList.back());
-}
-
-const TerminatorInst *BasicBlock::getTerminator() const {
- if (InstList.empty()) return 0;
- return dyn_cast<TerminatorInst>(&InstList.back());
-}
-
-Instruction* BasicBlock::getFirstNonPHI()
-{
- BasicBlock::iterator i = begin();
- // All valid basic blocks should have a terminator,
- // which is not a PHINode. If we have invalid basic
- // block we'll get assert when dereferencing past-the-end
- // iterator.
- while (isa<PHINode>(i)) ++i;
- return &*i;
-}
-
-void BasicBlock::dropAllReferences() {
- for(iterator I = begin(), E = end(); I != E; ++I)
- I->dropAllReferences();
-}
-
-/// getSinglePredecessor - If this basic block has a single predecessor block,
-/// return the block, otherwise return a null pointer.
-BasicBlock *BasicBlock::getSinglePredecessor() {
- pred_iterator PI = pred_begin(this), E = pred_end(this);
- if (PI == E) return 0; // No preds.
- BasicBlock *ThePred = *PI;
- ++PI;
- return (PI == E) ? ThePred : 0 /*multiple preds*/;
-}
-
-/// removePredecessor - This method is used to notify a BasicBlock that the
-/// specified Predecessor of the block is no longer able to reach it. This is
-/// actually not used to update the Predecessor list, but is actually used to
-/// update the PHI nodes that reside in the block. Note that this should be
-/// called while the predecessor still refers to this block.
-///
-void BasicBlock::removePredecessor(BasicBlock *Pred,
- bool DontDeleteUselessPHIs) {
- assert((hasNUsesOrMore(16)||// Reduce cost of this assertion for complex CFGs.
- find(pred_begin(this), pred_end(this), Pred) != pred_end(this)) &&
- "removePredecessor: BB is not a predecessor!");
-
- if (InstList.empty()) return;
- PHINode *APN = dyn_cast<PHINode>(&front());
- if (!APN) return; // Quick exit.
-
- // If there are exactly two predecessors, then we want to nuke the PHI nodes
- // altogether. However, we cannot do this, if this in this case:
- //
- // Loop:
- // %x = phi [X, Loop]
- // %x2 = add %x, 1 ;; This would become %x2 = add %x2, 1
- // br Loop ;; %x2 does not dominate all uses
- //
- // This is because the PHI node input is actually taken from the predecessor
- // basic block. The only case this can happen is with a self loop, so we
- // check for this case explicitly now.
- //
- unsigned max_idx = APN->getNumIncomingValues();
- assert(max_idx != 0 && "PHI Node in block with 0 predecessors!?!?!");
- if (max_idx == 2) {
- BasicBlock *Other = APN->getIncomingBlock(APN->getIncomingBlock(0) == Pred);
-
- // Disable PHI elimination!
- if (this == Other) max_idx = 3;
- }
-
- // <= Two predecessors BEFORE I remove one?
- if (max_idx <= 2 && !DontDeleteUselessPHIs) {
- // Yup, loop through and nuke the PHI nodes
- while (PHINode *PN = dyn_cast<PHINode>(&front())) {
- // Remove the predecessor first.
- PN->removeIncomingValue(Pred, !DontDeleteUselessPHIs);
-
- // If the PHI _HAD_ two uses, replace PHI node with its now *single* value
- if (max_idx == 2) {
- if (PN->getOperand(0) != PN)
- PN->replaceAllUsesWith(PN->getOperand(0));
- else
- // We are left with an infinite loop with no entries: kill the PHI.
- PN->replaceAllUsesWith(UndefValue::get(PN->getType()));
- getInstList().pop_front(); // Remove the PHI node
- }
-
- // If the PHI node already only had one entry, it got deleted by
- // removeIncomingValue.
- }
- } else {
- // Okay, now we know that we need to remove predecessor #pred_idx from all
- // PHI nodes. Iterate over each PHI node fixing them up
- PHINode *PN;
- for (iterator II = begin(); (PN = dyn_cast<PHINode>(II)); ) {
- ++II;
- PN->removeIncomingValue(Pred, false);
- // If all incoming values to the Phi are the same, we can replace the Phi
- // with that value.
- Value* PNV = 0;
- if (!DontDeleteUselessPHIs && (PNV = PN->hasConstantValue())) {
- PN->replaceAllUsesWith(PNV);
- PN->eraseFromParent();
- }
- }
- }
-}
-
-
-/// splitBasicBlock - This splits a basic block into two at the specified
-/// instruction. Note that all instructions BEFORE the specified iterator stay
-/// as part of the original basic block, an unconditional branch is added to
-/// the new BB, and the rest of the instructions in the BB are moved to the new
-/// BB, including the old terminator. This invalidates the iterator.
-///
-/// Note that this only works on well formed basic blocks (must have a
-/// terminator), and 'I' must not be the end of instruction list (which would
-/// cause a degenerate basic block to be formed, having a terminator inside of
-/// the basic block).
-///
-BasicBlock *BasicBlock::splitBasicBlock(iterator I, const std::string &BBName) {
- assert(getTerminator() && "Can't use splitBasicBlock on degenerate BB!");
- assert(I != InstList.end() &&
- "Trying to get me to create degenerate basic block!");
-
- BasicBlock *New = BasicBlock::Create(BBName, getParent(), getNext());
-
- // Move all of the specified instructions from the original basic block into
- // the new basic block.
- New->getInstList().splice(New->end(), this->getInstList(), I, end());
-
- // Add a branch instruction to the newly formed basic block.
- BranchInst::Create(New, this);
-
- // Now we must loop through all of the successors of the New block (which
- // _were_ the successors of the 'this' block), and update any PHI nodes in
- // successors. If there were PHI nodes in the successors, then they need to
- // know that incoming branches will be from New, not from Old.
- //
- for (succ_iterator I = succ_begin(New), E = succ_end(New); I != E; ++I) {
- // Loop over any phi nodes in the basic block, updating the BB field of
- // incoming values...
- BasicBlock *Successor = *I;
- PHINode *PN;
- for (BasicBlock::iterator II = Successor->begin();
- (PN = dyn_cast<PHINode>(II)); ++II) {
- int IDX = PN->getBasicBlockIndex(this);
- while (IDX != -1) {
- PN->setIncomingBlock((unsigned)IDX, New);
- IDX = PN->getBasicBlockIndex(this);
- }
- }
- }
- return New;
-}
diff --git a/release_23/lib/VMCore/ConstantFold.cpp b/release_23/lib/VMCore/ConstantFold.cpp
deleted file mode 100644
index 9f31bcdb75f3..000000000000
--- a/release_23/lib/VMCore/ConstantFold.cpp
+++ /dev/null
@@ -1,1517 +0,0 @@
-//===- ConstantFold.cpp - LLVM constant folder ----------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements folding of constants for LLVM. This implements the
-// (internal) ConstantFold.h interface, which is used by the
-// ConstantExpr::get* methods to automatically fold constants when possible.
-//
-// The current constant folding implementation is implemented in two pieces: the
-// template-based folder for simple primitive constants like ConstantInt, and
-// the special case hackery that we use to symbolically evaluate expressions
-// that use ConstantExprs.
-//
-//===----------------------------------------------------------------------===//
-
-#include "ConstantFold.h"
-#include "llvm/Constants.h"
-#include "llvm/Instructions.h"
-#include "llvm/DerivedTypes.h"
-#include "llvm/Function.h"
-#include "llvm/GlobalAlias.h"
-#include "llvm/ADT/SmallVector.h"
-#include "llvm/Support/Compiler.h"
-#include "llvm/Support/GetElementPtrTypeIterator.h"
-#include "llvm/Support/ManagedStatic.h"
-#include "llvm/Support/MathExtras.h"
-#include <limits>
-using namespace llvm;
-
-//===----------------------------------------------------------------------===//
-// ConstantFold*Instruction Implementations
-//===----------------------------------------------------------------------===//
-
-/// BitCastConstantVector - Convert the specified ConstantVector node to the
-/// specified vector type. At this point, we know that the elements of the
-/// input vector constant are all simple integer or FP values.
-static Constant *BitCastConstantVector(ConstantVector *CV,
- const VectorType *DstTy) {
- // If this cast changes element count then we can't handle it here:
- // doing so requires endianness information. This should be handled by
- // Analysis/ConstantFolding.cpp
- unsigned NumElts = DstTy->getNumElements();
- if (NumElts != CV->getNumOperands())
- return 0;
-
- // Check to verify that all elements of the input are simple.
- for (unsigned i = 0; i != NumElts; ++i) {
- if (!isa<ConstantInt>(CV->getOperand(i)) &&
- !isa<ConstantFP>(CV->getOperand(i)))
- return 0;
- }
-
- // Bitcast each element now.
- std::vector<Constant*> Result;
- const Type *DstEltTy = DstTy->getElementType();
- for (unsigned i = 0; i != NumElts; ++i)
- Result.push_back(ConstantExpr::getBitCast(CV->getOperand(i), DstEltTy));
- return ConstantVector::get(Result);
-}
-
-/// This function determines which opcode to use to fold two constant cast
-/// expressions together. It uses CastInst::isEliminableCastPair to determine
-/// the opcode. Consequently its just a wrapper around that function.
-/// @brief Determine if it is valid to fold a cast of a cast
-static unsigned
-foldConstantCastPair(
- unsigned opc, ///< opcode of the second cast constant expression
- const ConstantExpr*Op, ///< the first cast constant expression
- const Type *DstTy ///< desintation type of the first cast
-) {
- assert(Op && Op->isCast() && "Can't fold cast of cast without a cast!");
- assert(DstTy && DstTy->isFirstClassType() && "Invalid cast destination type");
- assert(CastInst::isCast(opc) && "Invalid cast opcode");
-
- // The the types and opcodes for the two Cast constant expressions
- const Type *SrcTy = Op->getOperand(0)->getType();
- const Type *MidTy = Op->getType();
- Instruction::CastOps firstOp = Instruction::CastOps(Op->getOpcode());
- Instruction::CastOps secondOp = Instruction::CastOps(opc);
-
- // Let CastInst::isEliminableCastPair do the heavy lifting.
- return CastInst::isEliminableCastPair(firstOp, secondOp, SrcTy, MidTy, DstTy,
- Type::Int64Ty);
-}
-
-static Constant *FoldBitCast(Constant *V, const Type *DestTy) {
- const Type *SrcTy = V->getType();
- if (SrcTy == DestTy)
- return V; // no-op cast
-
- // Check to see if we are casting a pointer to an aggregate to a pointer to
- // the first element. If so, return the appropriate GEP instruction.
- if (const PointerType *PTy = dyn_cast<PointerType>(V->getType()))
- if (const PointerType *DPTy = dyn_cast<PointerType>(DestTy))
- if (PTy->getAddressSpace() == DPTy->getAddressSpace()) {
- SmallVector<Value*, 8> IdxList;
- IdxList.push_back(Constant::getNullValue(Type::Int32Ty));
- const Type *ElTy = PTy->getElementType();
- while (ElTy != DPTy->getElementType()) {
- if (const StructType *STy = dyn_cast<StructType>(ElTy)) {
- if (STy->getNumElements() == 0) break;
- ElTy = STy->getElementType(0);
- IdxList.push_back(Constant::getNullValue(Type::Int32Ty));
- } else if (const SequentialType *STy =
- dyn_cast<SequentialType>(ElTy)) {
- if (isa<PointerType>(ElTy)) break; // Can't index into pointers!
- ElTy = STy->getElementType();
- IdxList.push_back(IdxList[0]);
- } else {
- break;
- }
- }
-
- if (ElTy == DPTy->getElementType())
- return ConstantExpr::getGetElementPtr(V, &IdxList[0], IdxList.size());
- }
-
- // Handle casts from one vector constant to another. We know that the src
- // and dest type have the same size (otherwise its an illegal cast).
- if (const VectorType *DestPTy = dyn_cast<VectorType>(DestTy)) {
- if (const VectorType *SrcTy = dyn_cast<VectorType>(V->getType())) {
- assert(DestPTy->getBitWidth() == SrcTy->getBitWidth() &&
- "Not cast between same sized vectors!");
- // First, check for null. Undef is already handled.
- if (isa<ConstantAggregateZero>(V))
- return Constant::getNullValue(DestTy);
-
- if (ConstantVector *CV = dyn_cast<ConstantVector>(V))
- return BitCastConstantVector(CV, DestPTy);
- }
- }
-
- // Finally, implement bitcast folding now. The code below doesn't handle
- // bitcast right.
- if (isa<ConstantPointerNull>(V)) // ptr->ptr cast.
- return ConstantPointerNull::get(cast<PointerType>(DestTy));
-
- // Handle integral constant input.
- if (const ConstantInt *CI = dyn_cast<ConstantInt>(V)) {
- if (DestTy->isInteger())
- // Integral -> Integral. This is a no-op because the bit widths must
- // be the same. Consequently, we just fold to V.
- return V;
-
- if (DestTy->isFloatingPoint()) {
- assert((DestTy == Type::DoubleTy || DestTy == Type::FloatTy) &&
- "Unknown FP type!");
- return ConstantFP::get(APFloat(CI->getValue()));
- }
- // Otherwise, can't fold this (vector?)
- return 0;
- }
-
- // Handle ConstantFP input.
- if (const ConstantFP *FP = dyn_cast<ConstantFP>(V)) {
- // FP -> Integral.
- if (DestTy == Type::Int32Ty) {
- return ConstantInt::get(FP->getValueAPF().convertToAPInt());
- } else {
- assert(DestTy == Type::Int64Ty && "only support f32/f64 for now!");
- return ConstantInt::get(FP->getValueAPF().convertToAPInt());
- }
- }
- return 0;
-}
-
-
-Constant *llvm::ConstantFoldCastInstruction(unsigned opc, const Constant *V,
- const Type *DestTy) {
- if (isa<UndefValue>(V)) {
- // zext(undef) = 0, because the top bits will be zero.
- // sext(undef) = 0, because the top bits will all be the same.
- // [us]itofp(undef) = 0, because the result value is bounded.
- if (opc == Instruction::ZExt || opc == Instruction::SExt ||
- opc == Instruction::UIToFP || opc == Instruction::SIToFP)
- return Constant::getNullValue(DestTy);
- return UndefValue::get(DestTy);
- }
- // No compile-time operations on this type yet.
- if (V->getType() == Type::PPC_FP128Ty || DestTy == Type::PPC_FP128Ty)
- return 0;
-
- // If the cast operand is a constant expression, there's a few things we can
- // do to try to simplify it.
- if (const ConstantExpr *CE = dyn_cast<ConstantExpr>(V)) {
- if (CE->isCast()) {
- // Try hard to fold cast of cast because they are often eliminable.
- if (unsigned newOpc = foldConstantCastPair(opc, CE, DestTy))
- return ConstantExpr::getCast(newOpc, CE->getOperand(0), DestTy);
- } else if (CE->getOpcode() == Instruction::GetElementPtr) {
- // If all of the indexes in the GEP are null values, there is no pointer
- // adjustment going on. We might as well cast the source pointer.
- bool isAllNull = true;
- for (unsigned i = 1, e = CE->getNumOperands(); i != e; ++i)
- if (!CE->getOperand(i)->isNullValue()) {
- isAllNull = false;
- break;
- }
- if (isAllNull)
- // This is casting one pointer type to another, always BitCast
- return ConstantExpr::getPointerCast(CE->getOperand(0), DestTy);
- }
- }
-
- // We actually have to do a cast now. Perform the cast according to the
- // opcode specified.
- switch (opc) {
- case Instruction::FPTrunc:
- case Instruction::FPExt:
- if (const ConstantFP *FPC = dyn_cast<ConstantFP>(V)) {
- APFloat Val = FPC->getValueAPF();
- Val.convert(DestTy == Type::FloatTy ? APFloat::IEEEsingle :
- DestTy == Type::DoubleTy ? APFloat::IEEEdouble :
- DestTy == Type::X86_FP80Ty ? APFloat::x87DoubleExtended :
- DestTy == Type::FP128Ty ? APFloat::IEEEquad :
- APFloat::Bogus,
- APFloat::rmNearestTiesToEven);
- return ConstantFP::get(Val);
- }
- return 0; // Can't fold.
- case Instruction::FPToUI:
- case Instruction::FPToSI:
- if (const ConstantFP *FPC = dyn_cast<ConstantFP>(V)) {
- const APFloat &V = FPC->getValueAPF();
- uint64_t x[2];
- uint32_t DestBitWidth = cast<IntegerType>(DestTy)->getBitWidth();
- (void) V.convertToInteger(x, DestBitWidth, opc==Instruction::FPToSI,
- APFloat::rmTowardZero);
- APInt Val(DestBitWidth, 2, x);
- return ConstantInt::get(Val);
- }
- if (const ConstantVector *CV = dyn_cast<ConstantVector>(V)) {
- std::vector<Constant*> res;
- const VectorType *DestVecTy = cast<VectorType>(DestTy);
- const Type *DstEltTy = DestVecTy->getElementType();
- for (unsigned i = 0, e = CV->getType()->getNumElements(); i != e; ++i)
- res.push_back(ConstantFoldCastInstruction(opc, V->getOperand(i),
- DstEltTy));
- return ConstantVector::get(DestVecTy, res);
- }
- return 0; // Can't fold.
- case Instruction::IntToPtr: //always treated as unsigned
- if (V->isNullValue()) // Is it an integral null value?
- return ConstantPointerNull::get(cast<PointerType>(DestTy));
- return 0; // Other pointer types cannot be casted
- case Instruction::PtrToInt: // always treated as unsigned
- if (V->isNullValue()) // is it a null pointer value?
- return ConstantInt::get(DestTy, 0);
- return 0; // Other pointer types cannot be casted
- case Instruction::UIToFP:
- case Instruction::SIToFP:
- if (const ConstantInt *CI = dyn_cast<ConstantInt>(V)) {
- APInt api = CI->getValue();
- const uint64_t zero[] = {0, 0};
- APFloat apf = APFloat(APInt(DestTy->getPrimitiveSizeInBits(),
- 2, zero));
- (void)apf.convertFromAPInt(api,
- opc==Instruction::SIToFP,
- APFloat::rmNearestTiesToEven);
- return ConstantFP::get(apf);
- }
- if (const ConstantVector *CV = dyn_cast<ConstantVector>(V)) {
- std::vector<Constant*> res;
- const VectorType *DestVecTy = cast<VectorType>(DestTy);
- const Type *DstEltTy = DestVecTy->getElementType();
- for (unsigned i = 0, e = CV->getType()->getNumElements(); i != e; ++i)
- res.push_back(ConstantFoldCastInstruction(opc, V->getOperand(i),
- DstEltTy));
- return ConstantVector::get(DestVecTy, res);
- }
- return 0;
- case Instruction::ZExt:
- if (const ConstantInt *CI = dyn_cast<ConstantInt>(V)) {
- uint32_t BitWidth = cast<IntegerType>(DestTy)->getBitWidth();
- APInt Result(CI->getValue());
- Result.zext(BitWidth);
- return ConstantInt::get(Result);
- }
- return 0;
- case Instruction::SExt:
- if (const ConstantInt *CI = dyn_cast<ConstantInt>(V)) {
- uint32_t BitWidth = cast<IntegerType>(DestTy)->getBitWidth();
- APInt Result(CI->getValue());
- Result.sext(BitWidth);
- return ConstantInt::get(Result);
- }
- return 0;
- case Instruction::Trunc:
- if (const ConstantInt *CI = dyn_cast<ConstantInt>(V)) {
- uint32_t BitWidth = cast<IntegerType>(DestTy)->getBitWidth();
- APInt Result(CI->getValue());
- Result.trunc(BitWidth);
- return ConstantInt::get(Result);
- }
- return 0;
- case Instruction::BitCast:
- return FoldBitCast(const_cast<Constant*>(V), DestTy);
- default:
- assert(!"Invalid CE CastInst opcode");
- break;
- }
-
- assert(0 && "Failed to cast constant expression");
- return 0;
-}
-
-Constant *llvm::ConstantFoldSelectInstruction(const Constant *Cond,
- const Constant *V1,
- const Constant *V2) {
- if (const ConstantInt *CB = dyn_cast<ConstantInt>(Cond))
- return const_cast<Constant*>(CB->getZExtValue() ? V1 : V2);
-
- if (isa<UndefValue>(V1)) return const_cast<Constant*>(V2);
- if (isa<UndefValue>(V2)) return const_cast<Constant*>(V1);
- if (isa<UndefValue>(Cond)) return const_cast<Constant*>(V1);
- if (V1 == V2) return const_cast<Constant*>(V1);
- return 0;
-}
-
-Constant *llvm::ConstantFoldExtractElementInstruction(const Constant *Val,
- const Constant *Idx) {
- if (isa<UndefValue>(Val)) // ee(undef, x) -> undef
- return UndefValue::get(cast<VectorType>(Val->getType())->getElementType());
- if (Val->isNullValue()) // ee(zero, x) -> zero
- return Constant::getNullValue(
- cast<VectorType>(Val->getType())->getElementType());
-
- if (const ConstantVector *CVal = dyn_cast<ConstantVector>(Val)) {
- if (const ConstantInt *CIdx = dyn_cast<ConstantInt>(Idx)) {
- return const_cast<Constant*>(CVal->getOperand(CIdx->getZExtValue()));
- } else if (isa<UndefValue>(Idx)) {
- // ee({w,x,y,z}, undef) -> w (an arbitrary value).
- return const_cast<Constant*>(CVal->getOperand(0));
- }
- }
- return 0;
-}
-
-Constant *llvm::ConstantFoldInsertElementInstruction(const Constant *Val,
- const Constant *Elt,
- const Constant *Idx) {
- const ConstantInt *CIdx = dyn_cast<ConstantInt>(Idx);
- if (!CIdx) return 0;
- APInt idxVal = CIdx->getValue();
- if (isa<UndefValue>(Val)) {
- // Insertion of scalar constant into vector undef
- // Optimize away insertion of undef
- if (isa<UndefValue>(Elt))
- return const_cast<Constant*>(Val);
- // Otherwise break the aggregate undef into multiple undefs and do
- // the insertion
- unsigned numOps =
- cast<VectorType>(Val->getType())->getNumElements();
- std::vector<Constant*> Ops;
- Ops.reserve(numOps);
- for (unsigned i = 0; i < numOps; ++i) {
- const Constant *Op =
- (idxVal == i) ? Elt : UndefValue::get(Elt->getType());
- Ops.push_back(const_cast<Constant*>(Op));
- }
- return ConstantVector::get(Ops);
- }
- if (isa<ConstantAggregateZero>(Val)) {
- // Insertion of scalar constant into vector aggregate zero
- // Optimize away insertion of zero
- if (Elt->isNullValue())
- return const_cast<Constant*>(Val);
- // Otherwise break the aggregate zero into multiple zeros and do
- // the insertion
- unsigned numOps =
- cast<VectorType>(Val->getType())->getNumElements();
- std::vector<Constant*> Ops;
- Ops.reserve(numOps);
- for (unsigned i = 0; i < numOps; ++i) {
- const Constant *Op =
- (idxVal == i) ? Elt : Constant::getNullValue(Elt->getType());
- Ops.push_back(const_cast<Constant*>(Op));
- }
- return ConstantVector::get(Ops);
- }
- if (const ConstantVector *CVal = dyn_cast<ConstantVector>(Val)) {
- // Insertion of scalar constant into vector constant
- std::vector<Constant*> Ops;
- Ops.reserve(CVal->getNumOperands());
- for (unsigned i = 0; i < CVal->getNumOperands(); ++i) {
- const Constant *Op =
- (idxVal == i) ? Elt : cast<Constant>(CVal->getOperand(i));
- Ops.push_back(const_cast<Constant*>(Op));
- }
- return ConstantVector::get(Ops);
- }
- return 0;
-}
-
-/// GetVectorElement - If C is a ConstantVector, ConstantAggregateZero or Undef
-/// return the specified element value. Otherwise return null.
-static Constant *GetVectorElement(const Constant *C, unsigned EltNo) {
- if (const ConstantVector *CV = dyn_cast<ConstantVector>(C))
- return const_cast<Constant*>(CV->getOperand(EltNo));
-
- const Type *EltTy = cast<VectorType>(C->getType())->getElementType();
- if (isa<ConstantAggregateZero>(C))
- return Constant::getNullValue(EltTy);
- if (isa<UndefValue>(C))
- return UndefValue::get(EltTy);
- return 0;
-}
-
-Constant *llvm::ConstantFoldShuffleVectorInstruction(const Constant *V1,
- const Constant *V2,
- const Constant *Mask) {
- // Undefined shuffle mask -> undefined value.
- if (isa<UndefValue>(Mask)) return UndefValue::get(V1->getType());
-
- unsigned NumElts = cast<VectorType>(V1->getType())->getNumElements();
- const Type *EltTy = cast<VectorType>(V1->getType())->getElementType();
-
- // Loop over the shuffle mask, evaluating each element.
- SmallVector<Constant*, 32> Result;
- for (unsigned i = 0; i != NumElts; ++i) {
- Constant *InElt = GetVectorElement(Mask, i);
- if (InElt == 0) return 0;
-
- if (isa<UndefValue>(InElt))
- InElt = UndefValue::get(EltTy);
- else if (ConstantInt *CI = dyn_cast<ConstantInt>(InElt)) {
- unsigned Elt = CI->getZExtValue();
- if (Elt >= NumElts*2)
- InElt = UndefValue::get(EltTy);
- else if (Elt >= NumElts)
- InElt = GetVectorElement(V2, Elt-NumElts);
- else
- InElt = GetVectorElement(V1, Elt);
- if (InElt == 0) return 0;
- } else {
- // Unknown value.
- return 0;
- }
- Result.push_back(InElt);
- }
-
- return ConstantVector::get(&Result[0], Result.size());
-}
-
-/// EvalVectorOp - Given two vector constants and a function pointer, apply the
-/// function pointer to each element pair, producing a new ConstantVector
-/// constant. Either or both of V1 and V2 may be NULL, meaning a
-/// ConstantAggregateZero operand.
-static Constant *EvalVectorOp(const ConstantVector *V1,
- const ConstantVector *V2,
- const VectorType *VTy,
- Constant *(*FP)(Constant*, Constant*)) {
- std::vector<Constant*> Res;
- const Type *EltTy = VTy->getElementType();
- for (unsigned i = 0, e = VTy->getNumElements(); i != e; ++i) {
- const Constant *C1 = V1 ? V1->getOperand(i) : Constant::getNullValue(EltTy);
- const Constant *C2 = V2 ? V2->getOperand(i) : Constant::getNullValue(EltTy);
- Res.push_back(FP(const_cast<Constant*>(C1),
- const_cast<Constant*>(C2)));
- }
- return ConstantVector::get(Res);
-}
-
-Constant *llvm::ConstantFoldBinaryInstruction(unsigned Opcode,
- const Constant *C1,
- const Constant *C2) {
- // No compile-time operations on this type yet.
- if (C1->getType() == Type::PPC_FP128Ty)
- return 0;
-
- // Handle UndefValue up front
- if (isa<UndefValue>(C1) || isa<UndefValue>(C2)) {
- switch (Opcode) {
- case Instruction::Xor:
- if (isa<UndefValue>(C1) && isa<UndefValue>(C2))
- // Handle undef ^ undef -> 0 special case. This is a common
- // idiom (misuse).
- return Constant::getNullValue(C1->getType());
- // Fallthrough
- case Instruction::Add:
- case Instruction::Sub:
- return UndefValue::get(C1->getType());
- case Instruction::Mul:
- case Instruction::And:
- return Constant::getNullValue(C1->getType());
- case Instruction::UDiv:
- case Instruction::SDiv:
- case Instruction::FDiv:
- case Instruction::URem:
- case Instruction::SRem:
- case Instruction::FRem:
- if (!isa<UndefValue>(C2)) // undef / X -> 0
- return Constant::getNullValue(C1->getType());
- return const_cast<Constant*>(C2); // X / undef -> undef
- case Instruction::Or: // X | undef -> -1
- if (const VectorType *PTy = dyn_cast<VectorType>(C1->getType()))
- return ConstantVector::getAllOnesValue(PTy);
- return ConstantInt::getAllOnesValue(C1->getType());
- case Instruction::LShr:
- if (isa<UndefValue>(C2) && isa<UndefValue>(C1))
- return const_cast<Constant*>(C1); // undef lshr undef -> undef
- return Constant::getNullValue(C1->getType()); // X lshr undef -> 0
- // undef lshr X -> 0
- case Instruction::AShr:
- if (!isa<UndefValue>(C2))
- return const_cast<Constant*>(C1); // undef ashr X --> undef
- else if (isa<UndefValue>(C1))
- return const_cast<Constant*>(C1); // undef ashr undef -> undef
- else
- return const_cast<Constant*>(C1); // X ashr undef --> X
- case Instruction::Shl:
- // undef << X -> 0 or X << undef -> 0
- return Constant::getNullValue(C1->getType());
- }
- }
-
- // Handle simplifications of the RHS when a constant int.
- if (const ConstantInt *CI2 = dyn_cast<ConstantInt>(C2)) {
- switch (Opcode) {
- case Instruction::Add:
- if (CI2->equalsInt(0)) return const_cast<Constant*>(C1); // X + 0 == X
- break;
- case Instruction::Sub:
- if (CI2->equalsInt(0)) return const_cast<Constant*>(C1); // X - 0 == X
- break;
- case Instruction::Mul:
- if (CI2->equalsInt(0)) return const_cast<Constant*>(C2); // X * 0 == 0
- if (CI2->equalsInt(1))
- return const_cast<Constant*>(C1); // X * 1 == X
- break;
- case Instruction::UDiv:
- case Instruction::SDiv:
- if (CI2->equalsInt(1))
- return const_cast<Constant*>(C1); // X / 1 == X
- break;
- case Instruction::URem:
- case Instruction::SRem:
- if (CI2->equalsInt(1))
- return Constant::getNullValue(CI2->getType()); // X % 1 == 0
- break;
- case Instruction::And:
- if (CI2->isZero()) return const_cast<Constant*>(C2); // X & 0 == 0
- if (CI2->isAllOnesValue())
- return const_cast<Constant*>(C1); // X & -1 == X
-
- if (const ConstantExpr *CE1 = dyn_cast<ConstantExpr>(C1)) {
- // (zext i32 to i64) & 4294967295 -> (zext i32 to i64)
- if (CE1->getOpcode() == Instruction::ZExt) {
- unsigned DstWidth = CI2->getType()->getBitWidth();
- unsigned SrcWidth =
- CE1->getOperand(0)->getType()->getPrimitiveSizeInBits();
- APInt PossiblySetBits(APInt::getLowBitsSet(DstWidth, SrcWidth));
- if ((PossiblySetBits & CI2->getValue()) == PossiblySetBits)
- return const_cast<Constant*>(C1);
- }
-
- // If and'ing the address of a global with a constant, fold it.
- if (CE1->getOpcode() == Instruction::PtrToInt &&
- isa<GlobalValue>(CE1->getOperand(0))) {
- GlobalValue *GV = cast<GlobalValue>(CE1->getOperand(0));
-
- // Functions are at least 4-byte aligned.
- unsigned GVAlign = GV->getAlignment();
- if (isa<Function>(GV))
- GVAlign = std::max(GVAlign, 4U);
-
- if (GVAlign > 1) {
- unsigned DstWidth = CI2->getType()->getBitWidth();
- unsigned SrcWidth = std::min(DstWidth, Log2_32(GVAlign));
- APInt BitsNotSet(APInt::getLowBitsSet(DstWidth, SrcWidth));
-
- // If checking bits we know are clear, return zero.
- if ((CI2->getValue() & BitsNotSet) == CI2->getValue())
- return Constant::getNullValue(CI2->getType());
- }
- }
- }
- break;
- case Instruction::Or:
- if (CI2->equalsInt(0)) return const_cast<Constant*>(C1); // X | 0 == X
- if (CI2->isAllOnesValue())
- return const_cast<Constant*>(C2); // X | -1 == -1
- break;
- case Instruction::Xor:
- if (CI2->equalsInt(0)) return const_cast<Constant*>(C1); // X ^ 0 == X
- break;
- case Instruction::AShr:
- // ashr (zext C to Ty), C2 -> lshr (zext C, CSA), C2
- if (const ConstantExpr *CE1 = dyn_cast<ConstantExpr>(C1))
- if (CE1->getOpcode() == Instruction::ZExt) // Top bits known zero.
- return ConstantExpr::getLShr(const_cast<Constant*>(C1),
- const_cast<Constant*>(C2));
- break;
- }
- }
-
- // At this point we know neither constant is an UndefValue.
- if (const ConstantInt *CI1 = dyn_cast<ConstantInt>(C1)) {
- if (const ConstantInt *CI2 = dyn_cast<ConstantInt>(C2)) {
- using namespace APIntOps;
- const APInt &C1V = CI1->getValue();
- const APInt &C2V = CI2->getValue();
- switch (Opcode) {
- default:
- break;
- case Instruction::Add:
- return ConstantInt::get(C1V + C2V);
- case Instruction::Sub:
- return ConstantInt::get(C1V - C2V);
- case Instruction::Mul:
- return ConstantInt::get(C1V * C2V);
- case Instruction::UDiv:
- if (CI2->isNullValue())
- return 0; // X / 0 -> can't fold
- return ConstantInt::get(C1V.udiv(C2V));
- case Instruction::SDiv:
- if (CI2->isNullValue())
- return 0; // X / 0 -> can't fold
- if (C2V.isAllOnesValue() && C1V.isMinSignedValue())
- return 0; // MIN_INT / -1 -> overflow
- return ConstantInt::get(C1V.sdiv(C2V));
- case Instruction::URem:
- if (C2->isNullValue())
- return 0; // X / 0 -> can't fold
- return ConstantInt::get(C1V.urem(C2V));
- case Instruction::SRem:
- if (CI2->isNullValue())
- return 0; // X % 0 -> can't fold
- if (C2V.isAllOnesValue() && C1V.isMinSignedValue())
- return 0; // MIN_INT % -1 -> overflow
- return ConstantInt::get(C1V.srem(C2V));
- case Instruction::And:
- return ConstantInt::get(C1V & C2V);
- case Instruction::Or:
- return ConstantInt::get(C1V | C2V);
- case Instruction::Xor:
- return ConstantInt::get(C1V ^ C2V);
- case Instruction::Shl: {
- uint32_t shiftAmt = C2V.getZExtValue();
- if (shiftAmt < C1V.getBitWidth())
- return ConstantInt::get(C1V.shl(shiftAmt));
- else
- return UndefValue::get(C1->getType()); // too big shift is undef
- }
- case Instruction::LShr: {
- uint32_t shiftAmt = C2V.getZExtValue();
- if (shiftAmt < C1V.getBitWidth())
- return ConstantInt::get(C1V.lshr(shiftAmt));
- else
- return UndefValue::get(C1->getType()); // too big shift is undef
- }
- case Instruction::AShr: {
- uint32_t shiftAmt = C2V.getZExtValue();
- if (shiftAmt < C1V.getBitWidth())
- return ConstantInt::get(C1V.ashr(shiftAmt));
- else
- return UndefValue::get(C1->getType()); // too big shift is undef
- }
- }
- }
- } else if (const ConstantFP *CFP1 = dyn_cast<ConstantFP>(C1)) {
- if (const ConstantFP *CFP2 = dyn_cast<ConstantFP>(C2)) {
- APFloat C1V = CFP1->getValueAPF();
- APFloat C2V = CFP2->getValueAPF();
- APFloat C3V = C1V; // copy for modification
- switch (Opcode) {
- default:
- break;
- case Instruction::Add:
- (void)C3V.add(C2V, APFloat::rmNearestTiesToEven);
- return ConstantFP::get(C3V);
- case Instruction::Sub:
- (void)C3V.subtract(C2V, APFloat::rmNearestTiesToEven);
- return ConstantFP::get(C3V);
- case Instruction::Mul:
- (void)C3V.multiply(C2V, APFloat::rmNearestTiesToEven);
- return ConstantFP::get(C3V);
- case Instruction::FDiv:
- (void)C3V.divide(C2V, APFloat::rmNearestTiesToEven);
- return ConstantFP::get(C3V);
- case Instruction::FRem:
- if (C2V.isZero()) {
- // IEEE 754, Section 7.1, #5
- if (CFP1->getType() == Type::DoubleTy)
- return ConstantFP::get(APFloat(std::numeric_limits<double>::
- quiet_NaN()));
- if (CFP1->getType() == Type::FloatTy)
- return ConstantFP::get(APFloat(std::numeric_limits<float>::
- quiet_NaN()));
- break;
- }
- (void)C3V.mod(C2V, APFloat::rmNearestTiesToEven);
- return ConstantFP::get(C3V);
- }
- }
- } else if (const VectorType *VTy = dyn_cast<VectorType>(C1->getType())) {
- const ConstantVector *CP1 = dyn_cast<ConstantVector>(C1);
- const ConstantVector *CP2 = dyn_cast<ConstantVector>(C2);
- if ((CP1 != NULL || isa<ConstantAggregateZero>(C1)) &&
- (CP2 != NULL || isa<ConstantAggregateZero>(C2))) {
- switch (Opcode) {
- default:
- break;
- case Instruction::Add:
- return EvalVectorOp(CP1, CP2, VTy, ConstantExpr::getAdd);
- case Instruction::Sub:
- return EvalVectorOp(CP1, CP2, VTy, ConstantExpr::getSub);
- case Instruction::Mul:
- return EvalVectorOp(CP1, CP2, VTy, ConstantExpr::getMul);
- case Instruction::UDiv:
- return EvalVectorOp(CP1, CP2, VTy, ConstantExpr::getUDiv);
- case Instruction::SDiv:
- return EvalVectorOp(CP1, CP2, VTy, ConstantExpr::getSDiv);
- case Instruction::FDiv:
- return EvalVectorOp(CP1, CP2, VTy, ConstantExpr::getFDiv);
- case Instruction::URem:
- return EvalVectorOp(CP1, CP2, VTy, ConstantExpr::getURem);
- case Instruction::SRem:
- return EvalVectorOp(CP1, CP2, VTy, ConstantExpr::getSRem);
- case Instruction::FRem:
- return EvalVectorOp(CP1, CP2, VTy, ConstantExpr::getFRem);
- case Instruction::And:
- return EvalVectorOp(CP1, CP2, VTy, ConstantExpr::getAnd);
- case Instruction::Or:
- return EvalVectorOp(CP1, CP2, VTy, ConstantExpr::getOr);
- case Instruction::Xor:
- return EvalVectorOp(CP1, CP2, VTy, ConstantExpr::getXor);
- }
- }
- }
-
- if (isa<ConstantExpr>(C1)) {
- // There are many possible foldings we could do here. We should probably
- // at least fold add of a pointer with an integer into the appropriate
- // getelementptr. This will improve alias analysis a bit.
- } else if (isa<ConstantExpr>(C2)) {
- // If C2 is a constant expr and C1 isn't, flop them around and fold the
- // other way if possible.
- switch (Opcode) {
- case Instruction::Add:
- case Instruction::Mul:
- case Instruction::And:
- case Instruction::Or:
- case Instruction::Xor:
- // No change of opcode required.
- return ConstantFoldBinaryInstruction(Opcode, C2, C1);
-
- case Instruction::Shl:
- case Instruction::LShr:
- case Instruction::AShr:
- case Instruction::Sub:
- case Instruction::SDiv:
- case Instruction::UDiv:
- case Instruction::FDiv:
- case Instruction::URem:
- case Instruction::SRem:
- case Instruction::FRem:
- default: // These instructions cannot be flopped around.
- break;
- }
- }
-
- // We don't know how to fold this.
- return 0;
-}
-
-/// isZeroSizedType - This type is zero sized if its an array or structure of
-/// zero sized types. The only leaf zero sized type is an empty structure.
-static bool isMaybeZeroSizedType(const Type *Ty) {
- if (isa<OpaqueType>(Ty)) return true; // Can't say.
- if (const StructType *STy = dyn_cast<StructType>(Ty)) {
-
- // If all of elements have zero size, this does too.
- for (unsigned i = 0, e = STy->getNumElements(); i != e; ++i)
- if (!isMaybeZeroSizedType(STy->getElementType(i))) return false;
- return true;
-
- } else if (const ArrayType *ATy = dyn_cast<ArrayType>(Ty)) {
- return isMaybeZeroSizedType(ATy->getElementType());
- }
- return false;
-}
-
-/// IdxCompare - Compare the two constants as though they were getelementptr
-/// indices. This allows coersion of the types to be the same thing.
-///
-/// If the two constants are the "same" (after coersion), return 0. If the
-/// first is less than the second, return -1, if the second is less than the
-/// first, return 1. If the constants are not integral, return -2.
-///
-static int IdxCompare(Constant *C1, Constant *C2, const Type *ElTy) {
- if (C1 == C2) return 0;
-
- // Ok, we found a different index. If they are not ConstantInt, we can't do
- // anything with them.
- if (!isa<ConstantInt>(C1) || !isa<ConstantInt>(C2))
- return -2; // don't know!
-
- // Ok, we have two differing integer indices. Sign extend them to be the same
- // type. Long is always big enough, so we use it.
- if (C1->getType() != Type::Int64Ty)
- C1 = ConstantExpr::getSExt(C1, Type::Int64Ty);
-
- if (C2->getType() != Type::Int64Ty)
- C2 = ConstantExpr::getSExt(C2, Type::Int64Ty);
-
- if (C1 == C2) return 0; // They are equal
-
- // If the type being indexed over is really just a zero sized type, there is
- // no pointer difference being made here.
- if (isMaybeZeroSizedType(ElTy))
- return -2; // dunno.
-
- // If they are really different, now that they are the same type, then we
- // found a difference!
- if (cast<ConstantInt>(C1)->getSExtValue() <
- cast<ConstantInt>(C2)->getSExtValue())
- return -1;
- else
- return 1;
-}
-
-/// evaluateFCmpRelation - This function determines if there is anything we can
-/// decide about the two constants provided. This doesn't need to handle simple
-/// things like ConstantFP comparisons, but should instead handle ConstantExprs.
-/// If we can determine that the two constants have a particular relation to
-/// each other, we should return the corresponding FCmpInst predicate,
-/// otherwise return FCmpInst::BAD_FCMP_PREDICATE. This is used below in
-/// ConstantFoldCompareInstruction.
-///
-/// To simplify this code we canonicalize the relation so that the first
-/// operand is always the most "complex" of the two. We consider ConstantFP
-/// to be the simplest, and ConstantExprs to be the most complex.
-static FCmpInst::Predicate evaluateFCmpRelation(const Constant *V1,
- const Constant *V2) {
- assert(V1->getType() == V2->getType() &&
- "Cannot compare values of different types!");
-
- // No compile-time operations on this type yet.
- if (V1->getType() == Type::PPC_FP128Ty)
- return FCmpInst::BAD_FCMP_PREDICATE;
-
- // Handle degenerate case quickly
- if (V1 == V2) return FCmpInst::FCMP_OEQ;
-
- if (!isa<ConstantExpr>(V1)) {
- if (!isa<ConstantExpr>(V2)) {
- // We distilled thisUse the standard constant folder for a few cases
- ConstantInt *R = 0;
- Constant *C1 = const_cast<Constant*>(V1);
- Constant *C2 = const_cast<Constant*>(V2);
- R = dyn_cast<ConstantInt>(
- ConstantExpr::getFCmp(FCmpInst::FCMP_OEQ, C1, C2));
- if (R && !R->isZero())
- return FCmpInst::FCMP_OEQ;
- R = dyn_cast<ConstantInt>(
- ConstantExpr::getFCmp(FCmpInst::FCMP_OLT, C1, C2));
- if (R && !R->isZero())
- return FCmpInst::FCMP_OLT;
- R = dyn_cast<ConstantInt>(
- ConstantExpr::getFCmp(FCmpInst::FCMP_OGT, C1, C2));
- if (R && !R->isZero())
- return FCmpInst::FCMP_OGT;
-
- // Nothing more we can do
- return FCmpInst::BAD_FCMP_PREDICATE;
- }
-
- // If the first operand is simple and second is ConstantExpr, swap operands.
- FCmpInst::Predicate SwappedRelation = evaluateFCmpRelation(V2, V1);
- if (SwappedRelation != FCmpInst::BAD_FCMP_PREDICATE)
- return FCmpInst::getSwappedPredicate(SwappedRelation);
- } else {
- // Ok, the LHS is known to be a constantexpr. The RHS can be any of a
- // constantexpr or a simple constant.
- const ConstantExpr *CE1 = cast<ConstantExpr>(V1);
- switch (CE1->getOpcode()) {
- case Instruction::FPTrunc:
- case Instruction::FPExt:
- case Instruction::UIToFP:
- case Instruction::SIToFP:
- // We might be able to do something with these but we don't right now.
- break;
- default:
- break;
- }
- }
- // There are MANY other foldings that we could perform here. They will
- // probably be added on demand, as they seem needed.
- return FCmpInst::BAD_FCMP_PREDICATE;
-}
-
-/// evaluateICmpRelation - This function determines if there is anything we can
-/// decide about the two constants provided. This doesn't need to handle simple
-/// things like integer comparisons, but should instead handle ConstantExprs
-/// and GlobalValues. If we can determine that the two constants have a
-/// particular relation to each other, we should return the corresponding ICmp
-/// predicate, otherwise return ICmpInst::BAD_ICMP_PREDICATE.
-///
-/// To simplify this code we canonicalize the relation so that the first
-/// operand is always the most "complex" of the two. We consider simple
-/// constants (like ConstantInt) to be the simplest, followed by
-/// GlobalValues, followed by ConstantExpr's (the most complex).
-///
-static ICmpInst::Predicate evaluateICmpRelation(const Constant *V1,
- const Constant *V2,
- bool isSigned) {
- assert(V1->getType() == V2->getType() &&
- "Cannot compare different types of values!");
- if (V1 == V2) return ICmpInst::ICMP_EQ;
-
- if (!isa<ConstantExpr>(V1) && !isa<GlobalValue>(V1)) {
- if (!isa<GlobalValue>(V2) && !isa<ConstantExpr>(V2)) {
- // We distilled this down to a simple case, use the standard constant
- // folder.
- ConstantInt *R = 0;
- Constant *C1 = const_cast<Constant*>(V1);
- Constant *C2 = const_cast<Constant*>(V2);
- ICmpInst::Predicate pred = ICmpInst::ICMP_EQ;
- R = dyn_cast<ConstantInt>(ConstantExpr::getICmp(pred, C1, C2));
- if (R && !R->isZero())
- return pred;
- pred = isSigned ? ICmpInst::ICMP_SLT : ICmpInst::ICMP_ULT;
- R = dyn_cast<ConstantInt>(ConstantExpr::getICmp(pred, C1, C2));
- if (R && !R->isZero())
- return pred;
- pred = isSigned ? ICmpInst::ICMP_SGT : ICmpInst::ICMP_UGT;
- R = dyn_cast<ConstantInt>(ConstantExpr::getICmp(pred, C1, C2));
- if (R && !R->isZero())
- return pred;
-
- // If we couldn't figure it out, bail.
- return ICmpInst::BAD_ICMP_PREDICATE;
- }
-
- // If the first operand is simple, swap operands.
- ICmpInst::Predicate SwappedRelation =
- evaluateICmpRelation(V2, V1, isSigned);
- if (SwappedRelation != ICmpInst::BAD_ICMP_PREDICATE)
- return ICmpInst::getSwappedPredicate(SwappedRelation);
-
- } else if (const GlobalValue *CPR1 = dyn_cast<GlobalValue>(V1)) {
- if (isa<ConstantExpr>(V2)) { // Swap as necessary.
- ICmpInst::Predicate SwappedRelation =
- evaluateICmpRelation(V2, V1, isSigned);
- if (SwappedRelation != ICmpInst::BAD_ICMP_PREDICATE)
- return ICmpInst::getSwappedPredicate(SwappedRelation);
- else
- return ICmpInst::BAD_ICMP_PREDICATE;
- }
-
- // Now we know that the RHS is a GlobalValue or simple constant,
- // which (since the types must match) means that it's a ConstantPointerNull.
- if (const GlobalValue *CPR2 = dyn_cast<GlobalValue>(V2)) {
- // Don't try to decide equality of aliases.
- if (!isa<GlobalAlias>(CPR1) && !isa<GlobalAlias>(CPR2))
- if (!CPR1->hasExternalWeakLinkage() || !CPR2->hasExternalWeakLinkage())
- return ICmpInst::ICMP_NE;
- } else {
- assert(isa<ConstantPointerNull>(V2) && "Canonicalization guarantee!");
- // GlobalVals can never be null. Don't try to evaluate aliases.
- if (!CPR1->hasExternalWeakLinkage() && !isa<GlobalAlias>(CPR1))
- return ICmpInst::ICMP_NE;
- }
- } else {
- // Ok, the LHS is known to be a constantexpr. The RHS can be any of a
- // constantexpr, a CPR, or a simple constant.
- const ConstantExpr *CE1 = cast<ConstantExpr>(V1);
- const Constant *CE1Op0 = CE1->getOperand(0);
-
- switch (CE1->getOpcode()) {
- case Instruction::Trunc:
- case Instruction::FPTrunc:
- case Instruction::FPExt:
- case Instruction::FPToUI:
- case Instruction::FPToSI:
- break; // We can't evaluate floating point casts or truncations.
-
- case Instruction::UIToFP:
- case Instruction::SIToFP:
- case Instruction::BitCast:
- case Instruction::ZExt:
- case Instruction::SExt:
- // If the cast is not actually changing bits, and the second operand is a
- // null pointer, do the comparison with the pre-casted value.
- if (V2->isNullValue() &&
- (isa<PointerType>(CE1->getType()) || CE1->getType()->isInteger())) {
- bool sgnd = isSigned;
- if (CE1->getOpcode() == Instruction::ZExt) isSigned = false;
- if (CE1->getOpcode() == Instruction::SExt) isSigned = true;
- return evaluateICmpRelation(CE1Op0,
- Constant::getNullValue(CE1Op0->getType()),
- sgnd);
- }
-
- // If the dest type is a pointer type, and the RHS is a constantexpr cast
- // from the same type as the src of the LHS, evaluate the inputs. This is
- // important for things like "icmp eq (cast 4 to int*), (cast 5 to int*)",
- // which happens a lot in compilers with tagged integers.
- if (const ConstantExpr *CE2 = dyn_cast<ConstantExpr>(V2))
- if (CE2->isCast() && isa<PointerType>(CE1->getType()) &&
- CE1->getOperand(0)->getType() == CE2->getOperand(0)->getType() &&
- CE1->getOperand(0)->getType()->isInteger()) {
- bool sgnd = isSigned;
- if (CE1->getOpcode() == Instruction::ZExt) isSigned = false;
- if (CE1->getOpcode() == Instruction::SExt) isSigned = true;
- return evaluateICmpRelation(CE1->getOperand(0), CE2->getOperand(0),
- sgnd);
- }
- break;
-
- case Instruction::GetElementPtr:
- // Ok, since this is a getelementptr, we know that the constant has a
- // pointer type. Check the various cases.
- if (isa<ConstantPointerNull>(V2)) {
- // If we are comparing a GEP to a null pointer, check to see if the base
- // of the GEP equals the null pointer.
- if (const GlobalValue *GV = dyn_cast<GlobalValue>(CE1Op0)) {
- if (GV->hasExternalWeakLinkage())
- // Weak linkage GVals could be zero or not. We're comparing that
- // to null pointer so its greater-or-equal
- return isSigned ? ICmpInst::ICMP_SGE : ICmpInst::ICMP_UGE;
- else
- // If its not weak linkage, the GVal must have a non-zero address
- // so the result is greater-than
- return isSigned ? ICmpInst::ICMP_SGT : ICmpInst::ICMP_UGT;
- } else if (isa<ConstantPointerNull>(CE1Op0)) {
- // If we are indexing from a null pointer, check to see if we have any
- // non-zero indices.
- for (unsigned i = 1, e = CE1->getNumOperands(); i != e; ++i)
- if (!CE1->getOperand(i)->isNullValue())
- // Offsetting from null, must not be equal.
- return isSigned ? ICmpInst::ICMP_SGT : ICmpInst::ICMP_UGT;
- // Only zero indexes from null, must still be zero.
- return ICmpInst::ICMP_EQ;
- }
- // Otherwise, we can't really say if the first operand is null or not.
- } else if (const GlobalValue *CPR2 = dyn_cast<GlobalValue>(V2)) {
- if (isa<ConstantPointerNull>(CE1Op0)) {
- if (CPR2->hasExternalWeakLinkage())
- // Weak linkage GVals could be zero or not. We're comparing it to
- // a null pointer, so its less-or-equal
- return isSigned ? ICmpInst::ICMP_SLE : ICmpInst::ICMP_ULE;
- else
- // If its not weak linkage, the GVal must have a non-zero address
- // so the result is less-than
- return isSigned ? ICmpInst::ICMP_SLT : ICmpInst::ICMP_ULT;
- } else if (const GlobalValue *CPR1 = dyn_cast<GlobalValue>(CE1Op0)) {
- if (CPR1 == CPR2) {
- // If this is a getelementptr of the same global, then it must be
- // different. Because the types must match, the getelementptr could
- // only have at most one index, and because we fold getelementptr's
- // with a single zero index, it must be nonzero.
- assert(CE1->getNumOperands() == 2 &&
- !CE1->getOperand(1)->isNullValue() &&
- "Suprising getelementptr!");
- return isSigned ? ICmpInst::ICMP_SGT : ICmpInst::ICMP_UGT;
- } else {
- // If they are different globals, we don't know what the value is,
- // but they can't be equal.
- return ICmpInst::ICMP_NE;
- }
- }
- } else {
- const ConstantExpr *CE2 = cast<ConstantExpr>(V2);
- const Constant *CE2Op0 = CE2->getOperand(0);
-
- // There are MANY other foldings that we could perform here. They will
- // probably be added on demand, as they seem needed.
- switch (CE2->getOpcode()) {
- default: break;
- case Instruction::GetElementPtr:
- // By far the most common case to handle is when the base pointers are
- // obviously to the same or different globals.
- if (isa<GlobalValue>(CE1Op0) && isa<GlobalValue>(CE2Op0)) {
- if (CE1Op0 != CE2Op0) // Don't know relative ordering, but not equal
- return ICmpInst::ICMP_NE;
- // Ok, we know that both getelementptr instructions are based on the
- // same global. From this, we can precisely determine the relative
- // ordering of the resultant pointers.
- unsigned i = 1;
-
- // Compare all of the operands the GEP's have in common.
- gep_type_iterator GTI = gep_type_begin(CE1);
- for (;i != CE1->getNumOperands() && i != CE2->getNumOperands();
- ++i, ++GTI)
- switch (IdxCompare(CE1->getOperand(i), CE2->getOperand(i),
- GTI.getIndexedType())) {
- case -1: return isSigned ? ICmpInst::ICMP_SLT:ICmpInst::ICMP_ULT;
- case 1: return isSigned ? ICmpInst::ICMP_SGT:ICmpInst::ICMP_UGT;
- case -2: return ICmpInst::BAD_ICMP_PREDICATE;
- }
-
- // Ok, we ran out of things they have in common. If any leftovers
- // are non-zero then we have a difference, otherwise we are equal.
- for (; i < CE1->getNumOperands(); ++i)
- if (!CE1->getOperand(i)->isNullValue()) {
- if (isa<ConstantInt>(CE1->getOperand(i)))
- return isSigned ? ICmpInst::ICMP_SGT : ICmpInst::ICMP_UGT;
- else
- return ICmpInst::BAD_ICMP_PREDICATE; // Might be equal.
- }
-
- for (; i < CE2->getNumOperands(); ++i)
- if (!CE2->getOperand(i)->isNullValue()) {
- if (isa<ConstantInt>(CE2->getOperand(i)))
- return isSigned ? ICmpInst::ICMP_SLT : ICmpInst::ICMP_ULT;
- else
- return ICmpInst::BAD_ICMP_PREDICATE; // Might be equal.
- }
- return ICmpInst::ICMP_EQ;
- }
- }
- }
- default:
- break;
- }
- }
-
- return ICmpInst::BAD_ICMP_PREDICATE;
-}
-
-Constant *llvm::ConstantFoldCompareInstruction(unsigned short pred,
- const Constant *C1,
- const Constant *C2) {
-
- // Handle some degenerate cases first
- if (isa<UndefValue>(C1) || isa<UndefValue>(C2))
- return UndefValue::get(Type::Int1Ty);
-
- // No compile-time operations on this type yet.
- if (C1->getType() == Type::PPC_FP128Ty)
- return 0;
-
- // icmp eq/ne(null,GV) -> false/true
- if (C1->isNullValue()) {
- if (const GlobalValue *GV = dyn_cast<GlobalValue>(C2))
- // Don't try to evaluate aliases. External weak GV can be null.
- if (!isa<GlobalAlias>(GV) && !GV->hasExternalWeakLinkage()) {
- if (pred == ICmpInst::ICMP_EQ)
- return ConstantInt::getFalse();
- else if (pred == ICmpInst::ICMP_NE)
- return ConstantInt::getTrue();
- }
- // icmp eq/ne(GV,null) -> false/true
- } else if (C2->isNullValue()) {
- if (const GlobalValue *GV = dyn_cast<GlobalValue>(C1))
- // Don't try to evaluate aliases. External weak GV can be null.
- if (!isa<GlobalAlias>(GV) && !GV->hasExternalWeakLinkage()) {
- if (pred == ICmpInst::ICMP_EQ)
- return ConstantInt::getFalse();
- else if (pred == ICmpInst::ICMP_NE)
- return ConstantInt::getTrue();
- }
- }
-
- if (isa<ConstantInt>(C1) && isa<ConstantInt>(C2)) {
- APInt V1 = cast<ConstantInt>(C1)->getValue();
- APInt V2 = cast<ConstantInt>(C2)->getValue();
- switch (pred) {
- default: assert(0 && "Invalid ICmp Predicate"); return 0;
- case ICmpInst::ICMP_EQ: return ConstantInt::get(Type::Int1Ty, V1 == V2);
- case ICmpInst::ICMP_NE: return ConstantInt::get(Type::Int1Ty, V1 != V2);
- case ICmpInst::ICMP_SLT:return ConstantInt::get(Type::Int1Ty, V1.slt(V2));
- case ICmpInst::ICMP_SGT:return ConstantInt::get(Type::Int1Ty, V1.sgt(V2));
- case ICmpInst::ICMP_SLE:return ConstantInt::get(Type::Int1Ty, V1.sle(V2));
- case ICmpInst::ICMP_SGE:return ConstantInt::get(Type::Int1Ty, V1.sge(V2));
- case ICmpInst::ICMP_ULT:return ConstantInt::get(Type::Int1Ty, V1.ult(V2));
- case ICmpInst::ICMP_UGT:return ConstantInt::get(Type::Int1Ty, V1.ugt(V2));
- case ICmpInst::ICMP_ULE:return ConstantInt::get(Type::Int1Ty, V1.ule(V2));
- case ICmpInst::ICMP_UGE:return ConstantInt::get(Type::Int1Ty, V1.uge(V2));
- }
- } else if (isa<ConstantFP>(C1) && isa<ConstantFP>(C2)) {
- APFloat C1V = cast<ConstantFP>(C1)->getValueAPF();
- APFloat C2V = cast<ConstantFP>(C2)->getValueAPF();
- APFloat::cmpResult R = C1V.compare(C2V);
- switch (pred) {
- default: assert(0 && "Invalid FCmp Predicate"); return 0;
- case FCmpInst::FCMP_FALSE: return ConstantInt::getFalse();
- case FCmpInst::FCMP_TRUE: return ConstantInt::getTrue();
- case FCmpInst::FCMP_UNO:
- return ConstantInt::get(Type::Int1Ty, R==APFloat::cmpUnordered);
- case FCmpInst::FCMP_ORD:
- return ConstantInt::get(Type::Int1Ty, R!=APFloat::cmpUnordered);
- case FCmpInst::FCMP_UEQ:
- return ConstantInt::get(Type::Int1Ty, R==APFloat::cmpUnordered ||
- R==APFloat::cmpEqual);
- case FCmpInst::FCMP_OEQ:
- return ConstantInt::get(Type::Int1Ty, R==APFloat::cmpEqual);
- case FCmpInst::FCMP_UNE:
- return ConstantInt::get(Type::Int1Ty, R!=APFloat::cmpEqual);
- case FCmpInst::FCMP_ONE:
- return ConstantInt::get(Type::Int1Ty, R==APFloat::cmpLessThan ||
- R==APFloat::cmpGreaterThan);
- case FCmpInst::FCMP_ULT:
- return ConstantInt::get(Type::Int1Ty, R==APFloat::cmpUnordered ||
- R==APFloat::cmpLessThan);
- case FCmpInst::FCMP_OLT:
- return ConstantInt::get(Type::Int1Ty, R==APFloat::cmpLessThan);
- case FCmpInst::FCMP_UGT:
- return ConstantInt::get(Type::Int1Ty, R==APFloat::cmpUnordered ||
- R==APFloat::cmpGreaterThan);
- case FCmpInst::FCMP_OGT:
- return ConstantInt::get(Type::Int1Ty, R==APFloat::cmpGreaterThan);
- case FCmpInst::FCMP_ULE:
- return ConstantInt::get(Type::Int1Ty, R!=APFloat::cmpGreaterThan);
- case FCmpInst::FCMP_OLE:
- return ConstantInt::get(Type::Int1Ty, R==APFloat::cmpLessThan ||
- R==APFloat::cmpEqual);
- case FCmpInst::FCMP_UGE:
- return ConstantInt::get(Type::Int1Ty, R!=APFloat::cmpLessThan);
- case FCmpInst::FCMP_OGE:
- return ConstantInt::get(Type::Int1Ty, R==APFloat::cmpGreaterThan ||
- R==APFloat::cmpEqual);
- }
- } else if (const ConstantVector *CP1 = dyn_cast<ConstantVector>(C1)) {
- if (const ConstantVector *CP2 = dyn_cast<ConstantVector>(C2)) {
- if (pred == FCmpInst::FCMP_OEQ || pred == FCmpInst::FCMP_UEQ) {
- for (unsigned i = 0, e = CP1->getNumOperands(); i != e; ++i) {
- Constant *C= ConstantExpr::getFCmp(FCmpInst::FCMP_OEQ,
- const_cast<Constant*>(CP1->getOperand(i)),
- const_cast<Constant*>(CP2->getOperand(i)));
- if (ConstantInt *CB = dyn_cast<ConstantInt>(C))
- return CB;
- }
- // Otherwise, could not decide from any element pairs.
- return 0;
- } else if (pred == ICmpInst::ICMP_EQ) {
- for (unsigned i = 0, e = CP1->getNumOperands(); i != e; ++i) {
- Constant *C = ConstantExpr::getICmp(ICmpInst::ICMP_EQ,
- const_cast<Constant*>(CP1->getOperand(i)),
- const_cast<Constant*>(CP2->getOperand(i)));
- if (ConstantInt *CB = dyn_cast<ConstantInt>(C))
- return CB;
- }
- // Otherwise, could not decide from any element pairs.
- return 0;
- }
- }
- }
-
- if (C1->getType()->isFloatingPoint()) {
- switch (evaluateFCmpRelation(C1, C2)) {
- default: assert(0 && "Unknown relation!");
- case FCmpInst::FCMP_UNO:
- case FCmpInst::FCMP_ORD:
- case FCmpInst::FCMP_UEQ:
- case FCmpInst::FCMP_UNE:
- case FCmpInst::FCMP_ULT:
- case FCmpInst::FCMP_UGT:
- case FCmpInst::FCMP_ULE:
- case FCmpInst::FCMP_UGE:
- case FCmpInst::FCMP_TRUE:
- case FCmpInst::FCMP_FALSE:
- case FCmpInst::BAD_FCMP_PREDICATE:
- break; // Couldn't determine anything about these constants.
- case FCmpInst::FCMP_OEQ: // We know that C1 == C2
- return ConstantInt::get(Type::Int1Ty,
- pred == FCmpInst::FCMP_UEQ || pred == FCmpInst::FCMP_OEQ ||
- pred == FCmpInst::FCMP_ULE || pred == FCmpInst::FCMP_OLE ||
- pred == FCmpInst::FCMP_UGE || pred == FCmpInst::FCMP_OGE);
- case FCmpInst::FCMP_OLT: // We know that C1 < C2
- return ConstantInt::get(Type::Int1Ty,
- pred == FCmpInst::FCMP_UNE || pred == FCmpInst::FCMP_ONE ||
- pred == FCmpInst::FCMP_ULT || pred == FCmpInst::FCMP_OLT ||
- pred == FCmpInst::FCMP_ULE || pred == FCmpInst::FCMP_OLE);
- case FCmpInst::FCMP_OGT: // We know that C1 > C2
- return ConstantInt::get(Type::Int1Ty,
- pred == FCmpInst::FCMP_UNE || pred == FCmpInst::FCMP_ONE ||
- pred == FCmpInst::FCMP_UGT || pred == FCmpInst::FCMP_OGT ||
- pred == FCmpInst::FCMP_UGE || pred == FCmpInst::FCMP_OGE);
- case FCmpInst::FCMP_OLE: // We know that C1 <= C2
- // We can only partially decide this relation.
- if (pred == FCmpInst::FCMP_UGT || pred == FCmpInst::FCMP_OGT)
- return ConstantInt::getFalse();
- if (pred == FCmpInst::FCMP_ULT || pred == FCmpInst::FCMP_OLT)
- return ConstantInt::getTrue();
- break;
- case FCmpInst::FCMP_OGE: // We known that C1 >= C2
- // We can only partially decide this relation.
- if (pred == FCmpInst::FCMP_ULT || pred == FCmpInst::FCMP_OLT)
- return ConstantInt::getFalse();
- if (pred == FCmpInst::FCMP_UGT || pred == FCmpInst::FCMP_OGT)
- return ConstantInt::getTrue();
- break;
- case ICmpInst::ICMP_NE: // We know that C1 != C2
- // We can only partially decide this relation.
- if (pred == FCmpInst::FCMP_OEQ || pred == FCmpInst::FCMP_UEQ)
- return ConstantInt::getFalse();
- if (pred == FCmpInst::FCMP_ONE || pred == FCmpInst::FCMP_UNE)
- return ConstantInt::getTrue();
- break;
- }
- } else {
- // Evaluate the relation between the two constants, per the predicate.
- switch (evaluateICmpRelation(C1, C2, CmpInst::isSigned(pred))) {
- default: assert(0 && "Unknown relational!");
- case ICmpInst::BAD_ICMP_PREDICATE:
- break; // Couldn't determine anything about these constants.
- case ICmpInst::ICMP_EQ: // We know the constants are equal!
- // If we know the constants are equal, we can decide the result of this
- // computation precisely.
- return ConstantInt::get(Type::Int1Ty,
- pred == ICmpInst::ICMP_EQ ||
- pred == ICmpInst::ICMP_ULE ||
- pred == ICmpInst::ICMP_SLE ||
- pred == ICmpInst::ICMP_UGE ||
- pred == ICmpInst::ICMP_SGE);
- case ICmpInst::ICMP_ULT:
- // If we know that C1 < C2, we can decide the result of this computation
- // precisely.
- return ConstantInt::get(Type::Int1Ty,
- pred == ICmpInst::ICMP_ULT ||
- pred == ICmpInst::ICMP_NE ||
- pred == ICmpInst::ICMP_ULE);
- case ICmpInst::ICMP_SLT:
- // If we know that C1 < C2, we can decide the result of this computation
- // precisely.
- return ConstantInt::get(Type::Int1Ty,
- pred == ICmpInst::ICMP_SLT ||
- pred == ICmpInst::ICMP_NE ||
- pred == ICmpInst::ICMP_SLE);
- case ICmpInst::ICMP_UGT:
- // If we know that C1 > C2, we can decide the result of this computation
- // precisely.
- return ConstantInt::get(Type::Int1Ty,
- pred == ICmpInst::ICMP_UGT ||
- pred == ICmpInst::ICMP_NE ||
- pred == ICmpInst::ICMP_UGE);
- case ICmpInst::ICMP_SGT:
- // If we know that C1 > C2, we can decide the result of this computation
- // precisely.
- return ConstantInt::get(Type::Int1Ty,
- pred == ICmpInst::ICMP_SGT ||
- pred == ICmpInst::ICMP_NE ||
- pred == ICmpInst::ICMP_SGE);
- case ICmpInst::ICMP_ULE:
- // If we know that C1 <= C2, we can only partially decide this relation.
- if (pred == ICmpInst::ICMP_UGT) return ConstantInt::getFalse();
- if (pred == ICmpInst::ICMP_ULT) return ConstantInt::getTrue();
- break;
- case ICmpInst::ICMP_SLE:
- // If we know that C1 <= C2, we can only partially decide this relation.
- if (pred == ICmpInst::ICMP_SGT) return ConstantInt::getFalse();
- if (pred == ICmpInst::ICMP_SLT) return ConstantInt::getTrue();
- break;
-
- case ICmpInst::ICMP_UGE:
- // If we know that C1 >= C2, we can only partially decide this relation.
- if (pred == ICmpInst::ICMP_ULT) return ConstantInt::getFalse();
- if (pred == ICmpInst::ICMP_UGT) return ConstantInt::getTrue();
- break;
- case ICmpInst::ICMP_SGE:
- // If we know that C1 >= C2, we can only partially decide this relation.
- if (pred == ICmpInst::ICMP_SLT) return ConstantInt::getFalse();
- if (pred == ICmpInst::ICMP_SGT) return ConstantInt::getTrue();
- break;
-
- case ICmpInst::ICMP_NE:
- // If we know that C1 != C2, we can only partially decide this relation.
- if (pred == ICmpInst::ICMP_EQ) return ConstantInt::getFalse();
- if (pred == ICmpInst::ICMP_NE) return ConstantInt::getTrue();
- break;
- }
-
- if (!isa<ConstantExpr>(C1) && isa<ConstantExpr>(C2)) {
- // If C2 is a constant expr and C1 isn't, flop them around and fold the
- // other way if possible.
- switch (pred) {
- case ICmpInst::ICMP_EQ:
- case ICmpInst::ICMP_NE:
- // No change of predicate required.
- return ConstantFoldCompareInstruction(pred, C2, C1);
-
- case ICmpInst::ICMP_ULT:
- case ICmpInst::ICMP_SLT:
- case ICmpInst::ICMP_UGT:
- case ICmpInst::ICMP_SGT:
- case ICmpInst::ICMP_ULE:
- case ICmpInst::ICMP_SLE:
- case ICmpInst::ICMP_UGE:
- case ICmpInst::ICMP_SGE:
- // Change the predicate as necessary to swap the operands.
- pred = ICmpInst::getSwappedPredicate((ICmpInst::Predicate)pred);
- return ConstantFoldCompareInstruction(pred, C2, C1);
-
- default: // These predicates cannot be flopped around.
- break;
- }
- }
- }
- return 0;
-}
-
-Constant *llvm::ConstantFoldGetElementPtr(const Constant *C,
- Constant* const *Idxs,
- unsigned NumIdx) {
- if (NumIdx == 0 ||
- (NumIdx == 1 && Idxs[0]->isNullValue()))
- return const_cast<Constant*>(C);
-
- if (isa<UndefValue>(C)) {
- const PointerType *Ptr = cast<PointerType>(C->getType());
- const Type *Ty = GetElementPtrInst::getIndexedType(Ptr,
- (Value **)Idxs,
- (Value **)Idxs+NumIdx,
- true);
- assert(Ty != 0 && "Invalid indices for GEP!");
- return UndefValue::get(PointerType::get(Ty, Ptr->getAddressSpace()));
- }
-
- Constant *Idx0 = Idxs[0];
- if (C->isNullValue()) {
- bool isNull = true;
- for (unsigned i = 0, e = NumIdx; i != e; ++i)
- if (!Idxs[i]->isNullValue()) {
- isNull = false;
- break;
- }
- if (isNull) {
- const PointerType *Ptr = cast<PointerType>(C->getType());
- const Type *Ty = GetElementPtrInst::getIndexedType(Ptr,
- (Value**)Idxs,
- (Value**)Idxs+NumIdx,
- true);
- assert(Ty != 0 && "Invalid indices for GEP!");
- return
- ConstantPointerNull::get(PointerType::get(Ty,Ptr->getAddressSpace()));
- }
- }
-
- if (ConstantExpr *CE = dyn_cast<ConstantExpr>(const_cast<Constant*>(C))) {
- // Combine Indices - If the source pointer to this getelementptr instruction
- // is a getelementptr instruction, combine the indices of the two
- // getelementptr instructions into a single instruction.
- //
- if (CE->getOpcode() == Instruction::GetElementPtr) {
- const Type *LastTy = 0;
- for (gep_type_iterator I = gep_type_begin(CE), E = gep_type_end(CE);
- I != E; ++I)
- LastTy = *I;
-
- if ((LastTy && isa<ArrayType>(LastTy)) || Idx0->isNullValue()) {
- SmallVector<Value*, 16> NewIndices;
- NewIndices.reserve(NumIdx + CE->getNumOperands());
- for (unsigned i = 1, e = CE->getNumOperands()-1; i != e; ++i)
- NewIndices.push_back(CE->getOperand(i));
-
- // Add the last index of the source with the first index of the new GEP.
- // Make sure to handle the case when they are actually different types.
- Constant *Combined = CE->getOperand(CE->getNumOperands()-1);
- // Otherwise it must be an array.
- if (!Idx0->isNullValue()) {
- const Type *IdxTy = Combined->getType();
- if (IdxTy != Idx0->getType()) {
- Constant *C1 = ConstantExpr::getSExtOrBitCast(Idx0, Type::Int64Ty);
- Constant *C2 = ConstantExpr::getSExtOrBitCast(Combined,
- Type::Int64Ty);
- Combined = ConstantExpr::get(Instruction::Add, C1, C2);
- } else {
- Combined =
- ConstantExpr::get(Instruction::Add, Idx0, Combined);
- }
- }
-
- NewIndices.push_back(Combined);
- NewIndices.insert(NewIndices.end(), Idxs+1, Idxs+NumIdx);
- return ConstantExpr::getGetElementPtr(CE->getOperand(0), &NewIndices[0],
- NewIndices.size());
- }
- }
-
- // Implement folding of:
- // int* getelementptr ([2 x int]* cast ([3 x int]* %X to [2 x int]*),
- // long 0, long 0)
- // To: int* getelementptr ([3 x int]* %X, long 0, long 0)
- //
- if (CE->isCast() && NumIdx > 1 && Idx0->isNullValue()) {
- if (const PointerType *SPT =
- dyn_cast<PointerType>(CE->getOperand(0)->getType()))
- if (const ArrayType *SAT = dyn_cast<ArrayType>(SPT->getElementType()))
- if (const ArrayType *CAT =
- dyn_cast<ArrayType>(cast<PointerType>(C->getType())->getElementType()))
- if (CAT->getElementType() == SAT->getElementType())
- return ConstantExpr::getGetElementPtr(
- (Constant*)CE->getOperand(0), Idxs, NumIdx);
- }
-
- // Fold: getelementptr (i8* inttoptr (i64 1 to i8*), i32 -1)
- // Into: inttoptr (i64 0 to i8*)
- // This happens with pointers to member functions in C++.
- if (CE->getOpcode() == Instruction::IntToPtr && NumIdx == 1 &&
- isa<ConstantInt>(CE->getOperand(0)) && isa<ConstantInt>(Idxs[0]) &&
- cast<PointerType>(CE->getType())->getElementType() == Type::Int8Ty) {
- Constant *Base = CE->getOperand(0);
- Constant *Offset = Idxs[0];
-
- // Convert the smaller integer to the larger type.
- if (Offset->getType()->getPrimitiveSizeInBits() <
- Base->getType()->getPrimitiveSizeInBits())
- Offset = ConstantExpr::getSExt(Offset, Base->getType());
- else if (Base->getType()->getPrimitiveSizeInBits() <
- Offset->getType()->getPrimitiveSizeInBits())
- Base = ConstantExpr::getZExt(Base, Base->getType());
-
- Base = ConstantExpr::getAdd(Base, Offset);
- return ConstantExpr::getIntToPtr(Base, CE->getType());
- }
- }
- return 0;
-}
-
diff --git a/release_23/lib/VMCore/ConstantFold.h b/release_23/lib/VMCore/ConstantFold.h
deleted file mode 100644
index 1c1e6e5d0c29..000000000000
--- a/release_23/lib/VMCore/ConstantFold.h
+++ /dev/null
@@ -1,53 +0,0 @@
-//===-- ConstantFolding.h - Internal Constant Folding Interface -*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines the (internal) constant folding interfaces for LLVM. These
-// interfaces are used by the ConstantExpr::get* methods to automatically fold
-// constants when possible.
-//
-// These operators may return a null object if I don't know how to perform the
-// specified operation on the specified constant types.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef CONSTANTFOLDING_H
-#define CONSTANTFOLDING_H
-
-namespace llvm {
- class Value;
- class Constant;
- class Type;
-
- // Constant fold various types of instruction...
- Constant *ConstantFoldCastInstruction(
- unsigned opcode, ///< The opcode of the cast
- const Constant *V, ///< The source constant
- const Type *DestTy ///< The destination type
- );
- Constant *ConstantFoldSelectInstruction(const Constant *Cond,
- const Constant *V1,
- const Constant *V2);
- Constant *ConstantFoldExtractElementInstruction(const Constant *Val,
- const Constant *Idx);
- Constant *ConstantFoldInsertElementInstruction(const Constant *Val,
- const Constant *Elt,
- const Constant *Idx);
- Constant *ConstantFoldShuffleVectorInstruction(const Constant *V1,
- const Constant *V2,
- const Constant *Mask);
- Constant *ConstantFoldBinaryInstruction(unsigned Opcode, const Constant *V1,
- const Constant *V2);
- Constant *ConstantFoldCompareInstruction(unsigned short predicate,
- const Constant *C1,
- const Constant *C2);
- Constant *ConstantFoldGetElementPtr(const Constant *C,
- Constant* const *Idxs, unsigned NumIdx);
-} // End llvm namespace
-
-#endif
diff --git a/release_23/lib/VMCore/Constants.cpp b/release_23/lib/VMCore/Constants.cpp
deleted file mode 100644
index 0b8fcc43258c..000000000000
--- a/release_23/lib/VMCore/Constants.cpp
+++ /dev/null
@@ -1,2350 +0,0 @@
-//===-- Constants.cpp - Implement Constant nodes --------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the Constant* classes...
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Constants.h"
-#include "ConstantFold.h"
-#include "llvm/DerivedTypes.h"
-#include "llvm/GlobalValue.h"
-#include "llvm/Instructions.h"
-#include "llvm/Module.h"
-#include "llvm/ADT/StringExtras.h"
-#include "llvm/Support/Compiler.h"
-#include "llvm/Support/Debug.h"
-#include "llvm/Support/ManagedStatic.h"
-#include "llvm/Support/MathExtras.h"
-#include "llvm/ADT/DenseMap.h"
-#include "llvm/ADT/SmallVector.h"
-#include <algorithm>
-#include <map>
-using namespace llvm;
-
-//===----------------------------------------------------------------------===//
-// Constant Class
-//===----------------------------------------------------------------------===//
-
-void Constant::destroyConstantImpl() {
- // When a Constant is destroyed, there may be lingering
- // references to the constant by other constants in the constant pool. These
- // constants are implicitly dependent on the module that is being deleted,
- // but they don't know that. Because we only find out when the CPV is
- // deleted, we must now notify all of our users (that should only be
- // Constants) that they are, in fact, invalid now and should be deleted.
- //
- while (!use_empty()) {
- Value *V = use_back();
-#ifndef NDEBUG // Only in -g mode...
- if (!isa<Constant>(V))
- DOUT << "While deleting: " << *this
- << "\n\nUse still stuck around after Def is destroyed: "
- << *V << "\n\n";
-#endif
- assert(isa<Constant>(V) && "References remain to Constant being destroyed");
- Constant *CV = cast<Constant>(V);
- CV->destroyConstant();
-
- // The constant should remove itself from our use list...
- assert((use_empty() || use_back() != V) && "Constant not removed!");
- }
-
- // Value has no outstanding references it is safe to delete it now...
- delete this;
-}
-
-/// canTrap - Return true if evaluation of this constant could trap. This is
-/// true for things like constant expressions that could divide by zero.
-bool Constant::canTrap() const {
- assert(getType()->isFirstClassType() && "Cannot evaluate aggregate vals!");
- // The only thing that could possibly trap are constant exprs.
- const ConstantExpr *CE = dyn_cast<ConstantExpr>(this);
- if (!CE) return false;
-
- // ConstantExpr traps if any operands can trap.
- for (unsigned i = 0, e = getNumOperands(); i != e; ++i)
- if (getOperand(i)->canTrap())
- return true;
-
- // Otherwise, only specific operations can trap.
- switch (CE->getOpcode()) {
- default:
- return false;
- case Instruction::UDiv:
- case Instruction::SDiv:
- case Instruction::FDiv:
- case Instruction::URem:
- case Instruction::SRem:
- case Instruction::FRem:
- // Div and rem can trap if the RHS is not known to be non-zero.
- if (!isa<ConstantInt>(getOperand(1)) || getOperand(1)->isNullValue())
- return true;
- return false;
- }
-}
-
-/// ContaintsRelocations - Return true if the constant value contains
-/// relocations which cannot be resolved at compile time.
-bool Constant::ContainsRelocations() const {
- if (isa<GlobalValue>(this))
- return true;
- for (unsigned i = 0, e = getNumOperands(); i != e; ++i)
- if (getOperand(i)->ContainsRelocations())
- return true;
- return false;
-}
-
-// Static constructor to create a '0' constant of arbitrary type...
-Constant *Constant::getNullValue(const Type *Ty) {
- static uint64_t zero[2] = {0, 0};
- switch (Ty->getTypeID()) {
- case Type::IntegerTyID:
- return ConstantInt::get(Ty, 0);
- case Type::FloatTyID:
- return ConstantFP::get(APFloat(APInt(32, 0)));
- case Type::DoubleTyID:
- return ConstantFP::get(APFloat(APInt(64, 0)));
- case Type::X86_FP80TyID:
- return ConstantFP::get(APFloat(APInt(80, 2, zero)));
- case Type::FP128TyID:
- return ConstantFP::get(APFloat(APInt(128, 2, zero), true));
- case Type::PPC_FP128TyID:
- return ConstantFP::get(APFloat(APInt(128, 2, zero)));
- case Type::PointerTyID:
- return ConstantPointerNull::get(cast<PointerType>(Ty));
- case Type::StructTyID:
- case Type::ArrayTyID:
- case Type::VectorTyID:
- return ConstantAggregateZero::get(Ty);
- default:
- // Function, Label, or Opaque type?
- assert(!"Cannot create a null constant of that type!");
- return 0;
- }
-}
-
-Constant *Constant::getAllOnesValue(const Type *Ty) {
- if (const IntegerType* ITy = dyn_cast<IntegerType>(Ty))
- return ConstantInt::get(APInt::getAllOnesValue(ITy->getBitWidth()));
- return ConstantVector::getAllOnesValue(cast<VectorType>(Ty));
-}
-
-// Static constructor to create an integral constant with all bits set
-ConstantInt *ConstantInt::getAllOnesValue(const Type *Ty) {
- if (const IntegerType* ITy = dyn_cast<IntegerType>(Ty))
- return ConstantInt::get(APInt::getAllOnesValue(ITy->getBitWidth()));
- return 0;
-}
-
-/// @returns the value for a vector integer constant of the given type that
-/// has all its bits set to true.
-/// @brief Get the all ones value
-ConstantVector *ConstantVector::getAllOnesValue(const VectorType *Ty) {
- std::vector<Constant*> Elts;
- Elts.resize(Ty->getNumElements(),
- ConstantInt::getAllOnesValue(Ty->getElementType()));
- assert(Elts[0] && "Not a vector integer type!");
- return cast<ConstantVector>(ConstantVector::get(Elts));
-}
-
-
-//===----------------------------------------------------------------------===//
-// ConstantInt
-//===----------------------------------------------------------------------===//
-
-ConstantInt::ConstantInt(const IntegerType *Ty, const APInt& V)
- : Constant(Ty, ConstantIntVal, 0, 0), Val(V) {
- assert(V.getBitWidth() == Ty->getBitWidth() && "Invalid constant for type");
-}
-
-ConstantInt *ConstantInt::TheTrueVal = 0;
-ConstantInt *ConstantInt::TheFalseVal = 0;
-
-namespace llvm {
- void CleanupTrueFalse(void *) {
- ConstantInt::ResetTrueFalse();
- }
-}
-
-static ManagedCleanup<llvm::CleanupTrueFalse> TrueFalseCleanup;
-
-ConstantInt *ConstantInt::CreateTrueFalseVals(bool WhichOne) {
- assert(TheTrueVal == 0 && TheFalseVal == 0);
- TheTrueVal = get(Type::Int1Ty, 1);
- TheFalseVal = get(Type::Int1Ty, 0);
-
- // Ensure that llvm_shutdown nulls out TheTrueVal/TheFalseVal.
- TrueFalseCleanup.Register();
-
- return WhichOne ? TheTrueVal : TheFalseVal;
-}
-
-
-namespace {
- struct DenseMapAPIntKeyInfo {
- struct KeyTy {
- APInt val;
- const Type* type;
- KeyTy(const APInt& V, const Type* Ty) : val(V), type(Ty) {}
- KeyTy(const KeyTy& that) : val(that.val), type(that.type) {}
- bool operator==(const KeyTy& that) const {
- return type == that.type && this->val == that.val;
- }
- bool operator!=(const KeyTy& that) const {
- return !this->operator==(that);
- }
- };
- static inline KeyTy getEmptyKey() { return KeyTy(APInt(1,0), 0); }
- static inline KeyTy getTombstoneKey() { return KeyTy(APInt(1,1), 0); }
- static unsigned getHashValue(const KeyTy &Key) {
- return DenseMapInfo<void*>::getHashValue(Key.type) ^
- Key.val.getHashValue();
- }
- static bool isEqual(const KeyTy &LHS, const KeyTy &RHS) {
- return LHS == RHS;
- }
- static bool isPod() { return false; }
- };
-}
-
-
-typedef DenseMap<DenseMapAPIntKeyInfo::KeyTy, ConstantInt*,
- DenseMapAPIntKeyInfo> IntMapTy;
-static ManagedStatic<IntMapTy> IntConstants;
-
-ConstantInt *ConstantInt::get(const Type *Ty, uint64_t V, bool isSigned) {
- const IntegerType *ITy = cast<IntegerType>(Ty);
- return get(APInt(ITy->getBitWidth(), V, isSigned));
-}
-
-// Get a ConstantInt from an APInt. Note that the value stored in the DenseMap
-// as the key, is a DenseMapAPIntKeyInfo::KeyTy which has provided the
-// operator== and operator!= to ensure that the DenseMap doesn't attempt to
-// compare APInt's of different widths, which would violate an APInt class
-// invariant which generates an assertion.
-ConstantInt *ConstantInt::get(const APInt& V) {
- // Get the corresponding integer type for the bit width of the value.
- const IntegerType *ITy = IntegerType::get(V.getBitWidth());
- // get an existing value or the insertion position
- DenseMapAPIntKeyInfo::KeyTy Key(V, ITy);
- ConstantInt *&Slot = (*IntConstants)[Key];
- // if it exists, return it.
- if (Slot)
- return Slot;
- // otherwise create a new one, insert it, and return it.
- return Slot = new ConstantInt(ITy, V);
-}
-
-//===----------------------------------------------------------------------===//
-// ConstantFP
-//===----------------------------------------------------------------------===//
-
-static const fltSemantics *TypeToFloatSemantics(const Type *Ty) {
- if (Ty == Type::FloatTy)
- return &APFloat::IEEEsingle;
- if (Ty == Type::DoubleTy)
- return &APFloat::IEEEdouble;
- if (Ty == Type::X86_FP80Ty)
- return &APFloat::x87DoubleExtended;
- else if (Ty == Type::FP128Ty)
- return &APFloat::IEEEquad;
-
- assert(Ty == Type::PPC_FP128Ty && "Unknown FP format");
- return &APFloat::PPCDoubleDouble;
-}
-
-ConstantFP::ConstantFP(const Type *Ty, const APFloat& V)
- : Constant(Ty, ConstantFPVal, 0, 0), Val(V) {
- assert(&V.getSemantics() == TypeToFloatSemantics(Ty) &&
- "FP type Mismatch");
-}
-
-bool ConstantFP::isNullValue() const {
- return Val.isZero() && !Val.isNegative();
-}
-
-ConstantFP *ConstantFP::getNegativeZero(const Type *Ty) {
- APFloat apf = cast <ConstantFP>(Constant::getNullValue(Ty))->getValueAPF();
- apf.changeSign();
- return ConstantFP::get(apf);
-}
-
-bool ConstantFP::isExactlyValue(const APFloat& V) const {
- return Val.bitwiseIsEqual(V);
-}
-
-namespace {
- struct DenseMapAPFloatKeyInfo {
- struct KeyTy {
- APFloat val;
- KeyTy(const APFloat& V) : val(V){}
- KeyTy(const KeyTy& that) : val(that.val) {}
- bool operator==(const KeyTy& that) const {
- return this->val.bitwiseIsEqual(that.val);
- }
- bool operator!=(const KeyTy& that) const {
- return !this->operator==(that);
- }
- };
- static inline KeyTy getEmptyKey() {
- return KeyTy(APFloat(APFloat::Bogus,1));
- }
- static inline KeyTy getTombstoneKey() {
- return KeyTy(APFloat(APFloat::Bogus,2));
- }
- static unsigned getHashValue(const KeyTy &Key) {
- return Key.val.getHashValue();
- }
- static bool isEqual(const KeyTy &LHS, const KeyTy &RHS) {
- return LHS == RHS;
- }
- static bool isPod() { return false; }
- };
-}
-
-//---- ConstantFP::get() implementation...
-//
-typedef DenseMap<DenseMapAPFloatKeyInfo::KeyTy, ConstantFP*,
- DenseMapAPFloatKeyInfo> FPMapTy;
-
-static ManagedStatic<FPMapTy> FPConstants;
-
-ConstantFP *ConstantFP::get(const APFloat &V) {
- DenseMapAPFloatKeyInfo::KeyTy Key(V);
- ConstantFP *&Slot = (*FPConstants)[Key];
- if (Slot) return Slot;
-
- const Type *Ty;
- if (&V.getSemantics() == &APFloat::IEEEsingle)
- Ty = Type::FloatTy;
- else if (&V.getSemantics() == &APFloat::IEEEdouble)
- Ty = Type::DoubleTy;
- else if (&V.getSemantics() == &APFloat::x87DoubleExtended)
- Ty = Type::X86_FP80Ty;
- else if (&V.getSemantics() == &APFloat::IEEEquad)
- Ty = Type::FP128Ty;
- else {
- assert(&V.getSemantics() == &APFloat::PPCDoubleDouble&&"Unknown FP format");
- Ty = Type::PPC_FP128Ty;
- }
-
- return Slot = new ConstantFP(Ty, V);
-}
-
-/// get() - This returns a constant fp for the specified value in the
-/// specified type. This should only be used for simple constant values like
-/// 2.0/1.0 etc, that are known-valid both as double and as the target format.
-ConstantFP *ConstantFP::get(const Type *Ty, double V) {
- APFloat FV(V);
- FV.convert(*TypeToFloatSemantics(Ty), APFloat::rmNearestTiesToEven);
- return get(FV);
-}
-
-//===----------------------------------------------------------------------===//
-// ConstantXXX Classes
-//===----------------------------------------------------------------------===//
-
-
-ConstantArray::ConstantArray(const ArrayType *T,
- const std::vector<Constant*> &V)
- : Constant(T, ConstantArrayVal, new Use[V.size()], V.size()) {
- assert(V.size() == T->getNumElements() &&
- "Invalid initializer vector for constant array");
- Use *OL = OperandList;
- for (std::vector<Constant*>::const_iterator I = V.begin(), E = V.end();
- I != E; ++I, ++OL) {
- Constant *C = *I;
- assert((C->getType() == T->getElementType() ||
- (T->isAbstract() &&
- C->getType()->getTypeID() == T->getElementType()->getTypeID())) &&
- "Initializer for array element doesn't match array element type!");
- OL->init(C, this);
- }
-}
-
-ConstantArray::~ConstantArray() {
- delete [] OperandList;
-}
-
-ConstantStruct::ConstantStruct(const StructType *T,
- const std::vector<Constant*> &V)
- : Constant(T, ConstantStructVal, new Use[V.size()], V.size()) {
- assert(V.size() == T->getNumElements() &&
- "Invalid initializer vector for constant structure");
- Use *OL = OperandList;
- for (std::vector<Constant*>::const_iterator I = V.begin(), E = V.end();
- I != E; ++I, ++OL) {
- Constant *C = *I;
- assert((C->getType() == T->getElementType(I-V.begin()) ||
- ((T->getElementType(I-V.begin())->isAbstract() ||
- C->getType()->isAbstract()) &&
- T->getElementType(I-V.begin())->getTypeID() ==
- C->getType()->getTypeID())) &&
- "Initializer for struct element doesn't match struct element type!");
- OL->init(C, this);
- }
-}
-
-ConstantStruct::~ConstantStruct() {
- delete [] OperandList;
-}
-
-
-ConstantVector::ConstantVector(const VectorType *T,
- const std::vector<Constant*> &V)
- : Constant(T, ConstantVectorVal, new Use[V.size()], V.size()) {
- Use *OL = OperandList;
- for (std::vector<Constant*>::const_iterator I = V.begin(), E = V.end();
- I != E; ++I, ++OL) {
- Constant *C = *I;
- assert((C->getType() == T->getElementType() ||
- (T->isAbstract() &&
- C->getType()->getTypeID() == T->getElementType()->getTypeID())) &&
- "Initializer for vector element doesn't match vector element type!");
- OL->init(C, this);
- }
-}
-
-ConstantVector::~ConstantVector() {
- delete [] OperandList;
-}
-
-// We declare several classes private to this file, so use an anonymous
-// namespace
-namespace {
-
-/// UnaryConstantExpr - This class is private to Constants.cpp, and is used
-/// behind the scenes to implement unary constant exprs.
-class VISIBILITY_HIDDEN UnaryConstantExpr : public ConstantExpr {
- void *operator new(size_t, unsigned); // DO NOT IMPLEMENT
- Use Op;
-public:
- // allocate space for exactly one operand
- void *operator new(size_t s) {
- return User::operator new(s, 1);
- }
- UnaryConstantExpr(unsigned Opcode, Constant *C, const Type *Ty)
- : ConstantExpr(Ty, Opcode, &Op, 1), Op(C, this) {}
-};
-
-/// BinaryConstantExpr - This class is private to Constants.cpp, and is used
-/// behind the scenes to implement binary constant exprs.
-class VISIBILITY_HIDDEN BinaryConstantExpr : public ConstantExpr {
- void *operator new(size_t, unsigned); // DO NOT IMPLEMENT
- Use Ops[2];
-public:
- // allocate space for exactly two operands
- void *operator new(size_t s) {
- return User::operator new(s, 2);
- }
- BinaryConstantExpr(unsigned Opcode, Constant *C1, Constant *C2)
- : ConstantExpr(C1->getType(), Opcode, Ops, 2) {
- Ops[0].init(C1, this);
- Ops[1].init(C2, this);
- }
-};
-
-/// SelectConstantExpr - This class is private to Constants.cpp, and is used
-/// behind the scenes to implement select constant exprs.
-class VISIBILITY_HIDDEN SelectConstantExpr : public ConstantExpr {
- void *operator new(size_t, unsigned); // DO NOT IMPLEMENT
- Use Ops[3];
-public:
- // allocate space for exactly three operands
- void *operator new(size_t s) {
- return User::operator new(s, 3);
- }
- SelectConstantExpr(Constant *C1, Constant *C2, Constant *C3)
- : ConstantExpr(C2->getType(), Instruction::Select, Ops, 3) {
- Ops[0].init(C1, this);
- Ops[1].init(C2, this);
- Ops[2].init(C3, this);
- }
-};
-
-/// ExtractElementConstantExpr - This class is private to
-/// Constants.cpp, and is used behind the scenes to implement
-/// extractelement constant exprs.
-class VISIBILITY_HIDDEN ExtractElementConstantExpr : public ConstantExpr {
- void *operator new(size_t, unsigned); // DO NOT IMPLEMENT
- Use Ops[2];
-public:
- // allocate space for exactly two operands
- void *operator new(size_t s) {
- return User::operator new(s, 2);
- }
- ExtractElementConstantExpr(Constant *C1, Constant *C2)
- : ConstantExpr(cast<VectorType>(C1->getType())->getElementType(),
- Instruction::ExtractElement, Ops, 2) {
- Ops[0].init(C1, this);
- Ops[1].init(C2, this);
- }
-};
-
-/// InsertElementConstantExpr - This class is private to
-/// Constants.cpp, and is used behind the scenes to implement
-/// insertelement constant exprs.
-class VISIBILITY_HIDDEN InsertElementConstantExpr : public ConstantExpr {
- void *operator new(size_t, unsigned); // DO NOT IMPLEMENT
- Use Ops[3];
-public:
- // allocate space for exactly three operands
- void *operator new(size_t s) {
- return User::operator new(s, 3);
- }
- InsertElementConstantExpr(Constant *C1, Constant *C2, Constant *C3)
- : ConstantExpr(C1->getType(), Instruction::InsertElement,
- Ops, 3) {
- Ops[0].init(C1, this);
- Ops[1].init(C2, this);
- Ops[2].init(C3, this);
- }
-};
-
-/// ShuffleVectorConstantExpr - This class is private to
-/// Constants.cpp, and is used behind the scenes to implement
-/// shufflevector constant exprs.
-class VISIBILITY_HIDDEN ShuffleVectorConstantExpr : public ConstantExpr {
- void *operator new(size_t, unsigned); // DO NOT IMPLEMENT
- Use Ops[3];
-public:
- // allocate space for exactly three operands
- void *operator new(size_t s) {
- return User::operator new(s, 3);
- }
- ShuffleVectorConstantExpr(Constant *C1, Constant *C2, Constant *C3)
- : ConstantExpr(C1->getType(), Instruction::ShuffleVector,
- Ops, 3) {
- Ops[0].init(C1, this);
- Ops[1].init(C2, this);
- Ops[2].init(C3, this);
- }
-};
-
-/// GetElementPtrConstantExpr - This class is private to Constants.cpp, and is
-/// used behind the scenes to implement getelementpr constant exprs.
-class VISIBILITY_HIDDEN GetElementPtrConstantExpr : public ConstantExpr {
- GetElementPtrConstantExpr(Constant *C, const std::vector<Constant*> &IdxList,
- const Type *DestTy)
- : ConstantExpr(DestTy, Instruction::GetElementPtr,
- new Use[IdxList.size()+1], IdxList.size()+1) {
- OperandList[0].init(C, this);
- for (unsigned i = 0, E = IdxList.size(); i != E; ++i)
- OperandList[i+1].init(IdxList[i], this);
- }
-public:
- static GetElementPtrConstantExpr *Create(Constant *C, const std::vector<Constant*> &IdxList,
- const Type *DestTy) {
- return new(IdxList.size() + 1/*FIXME*/) GetElementPtrConstantExpr(C, IdxList, DestTy);
- }
- ~GetElementPtrConstantExpr() {
- delete [] OperandList;
- }
-};
-
-// CompareConstantExpr - This class is private to Constants.cpp, and is used
-// behind the scenes to implement ICmp and FCmp constant expressions. This is
-// needed in order to store the predicate value for these instructions.
-struct VISIBILITY_HIDDEN CompareConstantExpr : public ConstantExpr {
- void *operator new(size_t, unsigned); // DO NOT IMPLEMENT
- // allocate space for exactly two operands
- void *operator new(size_t s) {
- return User::operator new(s, 2);
- }
- unsigned short predicate;
- Use Ops[2];
- CompareConstantExpr(Instruction::OtherOps opc, unsigned short pred,
- Constant* LHS, Constant* RHS)
- : ConstantExpr(Type::Int1Ty, opc, Ops, 2), predicate(pred) {
- OperandList[0].init(LHS, this);
- OperandList[1].init(RHS, this);
- }
-};
-
-} // end anonymous namespace
-
-
-// Utility function for determining if a ConstantExpr is a CastOp or not. This
-// can't be inline because we don't want to #include Instruction.h into
-// Constant.h
-bool ConstantExpr::isCast() const {
- return Instruction::isCast(getOpcode());
-}
-
-bool ConstantExpr::isCompare() const {
- return getOpcode() == Instruction::ICmp || getOpcode() == Instruction::FCmp;
-}
-
-/// ConstantExpr::get* - Return some common constants without having to
-/// specify the full Instruction::OPCODE identifier.
-///
-Constant *ConstantExpr::getNeg(Constant *C) {
- return get(Instruction::Sub,
- ConstantExpr::getZeroValueForNegationExpr(C->getType()),
- C);
-}
-Constant *ConstantExpr::getNot(Constant *C) {
- assert(isa<IntegerType>(C->getType()) && "Cannot NOT a nonintegral value!");
- return get(Instruction::Xor, C,
- ConstantInt::getAllOnesValue(C->getType()));
-}
-Constant *ConstantExpr::getAdd(Constant *C1, Constant *C2) {
- return get(Instruction::Add, C1, C2);
-}
-Constant *ConstantExpr::getSub(Constant *C1, Constant *C2) {
- return get(Instruction::Sub, C1, C2);
-}
-Constant *ConstantExpr::getMul(Constant *C1, Constant *C2) {
- return get(Instruction::Mul, C1, C2);
-}
-Constant *ConstantExpr::getUDiv(Constant *C1, Constant *C2) {
- return get(Instruction::UDiv, C1, C2);
-}
-Constant *ConstantExpr::getSDiv(Constant *C1, Constant *C2) {
- return get(Instruction::SDiv, C1, C2);
-}
-Constant *ConstantExpr::getFDiv(Constant *C1, Constant *C2) {
- return get(Instruction::FDiv, C1, C2);
-}
-Constant *ConstantExpr::getURem(Constant *C1, Constant *C2) {
- return get(Instruction::URem, C1, C2);
-}
-Constant *ConstantExpr::getSRem(Constant *C1, Constant *C2) {
- return get(Instruction::SRem, C1, C2);
-}
-Constant *ConstantExpr::getFRem(Constant *C1, Constant *C2) {
- return get(Instruction::FRem, C1, C2);
-}
-Constant *ConstantExpr::getAnd(Constant *C1, Constant *C2) {
- return get(Instruction::And, C1, C2);
-}
-Constant *ConstantExpr::getOr(Constant *C1, Constant *C2) {
- return get(Instruction::Or, C1, C2);
-}
-Constant *ConstantExpr::getXor(Constant *C1, Constant *C2) {
- return get(Instruction::Xor, C1, C2);
-}
-unsigned ConstantExpr::getPredicate() const {
- assert(getOpcode() == Instruction::FCmp || getOpcode() == Instruction::ICmp);
- return ((const CompareConstantExpr*)this)->predicate;
-}
-Constant *ConstantExpr::getShl(Constant *C1, Constant *C2) {
- return get(Instruction::Shl, C1, C2);
-}
-Constant *ConstantExpr::getLShr(Constant *C1, Constant *C2) {
- return get(Instruction::LShr, C1, C2);
-}
-Constant *ConstantExpr::getAShr(Constant *C1, Constant *C2) {
- return get(Instruction::AShr, C1, C2);
-}
-
-/// getWithOperandReplaced - Return a constant expression identical to this
-/// one, but with the specified operand set to the specified value.
-Constant *
-ConstantExpr::getWithOperandReplaced(unsigned OpNo, Constant *Op) const {
- assert(OpNo < getNumOperands() && "Operand num is out of range!");
- assert(Op->getType() == getOperand(OpNo)->getType() &&
- "Replacing operand with value of different type!");
- if (getOperand(OpNo) == Op)
- return const_cast<ConstantExpr*>(this);
-
- Constant *Op0, *Op1, *Op2;
- switch (getOpcode()) {
- case Instruction::Trunc:
- case Instruction::ZExt:
- case Instruction::SExt:
- case Instruction::FPTrunc:
- case Instruction::FPExt:
- case Instruction::UIToFP:
- case Instruction::SIToFP:
- case Instruction::FPToUI:
- case Instruction::FPToSI:
- case Instruction::PtrToInt:
- case Instruction::IntToPtr:
- case Instruction::BitCast:
- return ConstantExpr::getCast(getOpcode(), Op, getType());
- case Instruction::Select:
- Op0 = (OpNo == 0) ? Op : getOperand(0);
- Op1 = (OpNo == 1) ? Op : getOperand(1);
- Op2 = (OpNo == 2) ? Op : getOperand(2);
- return ConstantExpr::getSelect(Op0, Op1, Op2);
- case Instruction::InsertElement:
- Op0 = (OpNo == 0) ? Op : getOperand(0);
- Op1 = (OpNo == 1) ? Op : getOperand(1);
- Op2 = (OpNo == 2) ? Op : getOperand(2);
- return ConstantExpr::getInsertElement(Op0, Op1, Op2);
- case Instruction::ExtractElement:
- Op0 = (OpNo == 0) ? Op : getOperand(0);
- Op1 = (OpNo == 1) ? Op : getOperand(1);
- return ConstantExpr::getExtractElement(Op0, Op1);
- case Instruction::ShuffleVector:
- Op0 = (OpNo == 0) ? Op : getOperand(0);
- Op1 = (OpNo == 1) ? Op : getOperand(1);
- Op2 = (OpNo == 2) ? Op : getOperand(2);
- return ConstantExpr::getShuffleVector(Op0, Op1, Op2);
- case Instruction::GetElementPtr: {
- SmallVector<Constant*, 8> Ops;
- Ops.resize(getNumOperands());
- for (unsigned i = 1, e = getNumOperands(); i != e; ++i)
- Ops[i] = getOperand(i);
- if (OpNo == 0)
- return ConstantExpr::getGetElementPtr(Op, &Ops[0], Ops.size());
- Ops[OpNo-1] = Op;
- return ConstantExpr::getGetElementPtr(getOperand(0), &Ops[0], Ops.size());
- }
- default:
- assert(getNumOperands() == 2 && "Must be binary operator?");
- Op0 = (OpNo == 0) ? Op : getOperand(0);
- Op1 = (OpNo == 1) ? Op : getOperand(1);
- return ConstantExpr::get(getOpcode(), Op0, Op1);
- }
-}
-
-/// getWithOperands - This returns the current constant expression with the
-/// operands replaced with the specified values. The specified operands must
-/// match count and type with the existing ones.
-Constant *ConstantExpr::
-getWithOperands(const std::vector<Constant*> &Ops) const {
- assert(Ops.size() == getNumOperands() && "Operand count mismatch!");
- bool AnyChange = false;
- for (unsigned i = 0, e = Ops.size(); i != e; ++i) {
- assert(Ops[i]->getType() == getOperand(i)->getType() &&
- "Operand type mismatch!");
- AnyChange |= Ops[i] != getOperand(i);
- }
- if (!AnyChange) // No operands changed, return self.
- return const_cast<ConstantExpr*>(this);
-
- switch (getOpcode()) {
- case Instruction::Trunc:
- case Instruction::ZExt:
- case Instruction::SExt:
- case Instruction::FPTrunc:
- case Instruction::FPExt:
- case Instruction::UIToFP:
- case Instruction::SIToFP:
- case Instruction::FPToUI:
- case Instruction::FPToSI:
- case Instruction::PtrToInt:
- case Instruction::IntToPtr:
- case Instruction::BitCast:
- return ConstantExpr::getCast(getOpcode(), Ops[0], getType());
- case Instruction::Select:
- return ConstantExpr::getSelect(Ops[0], Ops[1], Ops[2]);
- case Instruction::InsertElement:
- return ConstantExpr::getInsertElement(Ops[0], Ops[1], Ops[2]);
- case Instruction::ExtractElement:
- return ConstantExpr::getExtractElement(Ops[0], Ops[1]);
- case Instruction::ShuffleVector:
- return ConstantExpr::getShuffleVector(Ops[0], Ops[1], Ops[2]);
- case Instruction::GetElementPtr:
- return ConstantExpr::getGetElementPtr(Ops[0], &Ops[1], Ops.size()-1);
- case Instruction::ICmp:
- case Instruction::FCmp:
- return ConstantExpr::getCompare(getPredicate(), Ops[0], Ops[1]);
- default:
- assert(getNumOperands() == 2 && "Must be binary operator?");
- return ConstantExpr::get(getOpcode(), Ops[0], Ops[1]);
- }
-}
-
-
-//===----------------------------------------------------------------------===//
-// isValueValidForType implementations
-
-bool ConstantInt::isValueValidForType(const Type *Ty, uint64_t Val) {
- unsigned NumBits = cast<IntegerType>(Ty)->getBitWidth(); // assert okay
- if (Ty == Type::Int1Ty)
- return Val == 0 || Val == 1;
- if (NumBits >= 64)
- return true; // always true, has to fit in largest type
- uint64_t Max = (1ll << NumBits) - 1;
- return Val <= Max;
-}
-
-bool ConstantInt::isValueValidForType(const Type *Ty, int64_t Val) {
- unsigned NumBits = cast<IntegerType>(Ty)->getBitWidth(); // assert okay
- if (Ty == Type::Int1Ty)
- return Val == 0 || Val == 1 || Val == -1;
- if (NumBits >= 64)
- return true; // always true, has to fit in largest type
- int64_t Min = -(1ll << (NumBits-1));
- int64_t Max = (1ll << (NumBits-1)) - 1;
- return (Val >= Min && Val <= Max);
-}
-
-bool ConstantFP::isValueValidForType(const Type *Ty, const APFloat& Val) {
- // convert modifies in place, so make a copy.
- APFloat Val2 = APFloat(Val);
- switch (Ty->getTypeID()) {
- default:
- return false; // These can't be represented as floating point!
-
- // FIXME rounding mode needs to be more flexible
- case Type::FloatTyID:
- return &Val2.getSemantics() == &APFloat::IEEEsingle ||
- Val2.convert(APFloat::IEEEsingle, APFloat::rmNearestTiesToEven) ==
- APFloat::opOK;
- case Type::DoubleTyID:
- return &Val2.getSemantics() == &APFloat::IEEEsingle ||
- &Val2.getSemantics() == &APFloat::IEEEdouble ||
- Val2.convert(APFloat::IEEEdouble, APFloat::rmNearestTiesToEven) ==
- APFloat::opOK;
- case Type::X86_FP80TyID:
- return &Val2.getSemantics() == &APFloat::IEEEsingle ||
- &Val2.getSemantics() == &APFloat::IEEEdouble ||
- &Val2.getSemantics() == &APFloat::x87DoubleExtended;
- case Type::FP128TyID:
- return &Val2.getSemantics() == &APFloat::IEEEsingle ||
- &Val2.getSemantics() == &APFloat::IEEEdouble ||
- &Val2.getSemantics() == &APFloat::IEEEquad;
- case Type::PPC_FP128TyID:
- return &Val2.getSemantics() == &APFloat::IEEEsingle ||
- &Val2.getSemantics() == &APFloat::IEEEdouble ||
- &Val2.getSemantics() == &APFloat::PPCDoubleDouble;
- }
-}
-
-//===----------------------------------------------------------------------===//
-// Factory Function Implementation
-
-// ConstantCreator - A class that is used to create constants by
-// ValueMap*. This class should be partially specialized if there is
-// something strange that needs to be done to interface to the ctor for the
-// constant.
-//
-namespace llvm {
- template<class ConstantClass, class TypeClass, class ValType>
- struct VISIBILITY_HIDDEN ConstantCreator {
- static ConstantClass *create(const TypeClass *Ty, const ValType &V) {
- unsigned FIXME = 0; // = traits<ValType>::uses(V)
- return new(FIXME) ConstantClass(Ty, V);
- }
- };
-
- template<class ConstantClass, class TypeClass>
- struct VISIBILITY_HIDDEN ConvertConstantType {
- static void convert(ConstantClass *OldC, const TypeClass *NewTy) {
- assert(0 && "This type cannot be converted!\n");
- abort();
- }
- };
-
- template<class ValType, class TypeClass, class ConstantClass,
- bool HasLargeKey = false /*true for arrays and structs*/ >
- class VISIBILITY_HIDDEN ValueMap : public AbstractTypeUser {
- public:
- typedef std::pair<const Type*, ValType> MapKey;
- typedef std::map<MapKey, Constant *> MapTy;
- typedef std::map<Constant*, typename MapTy::iterator> InverseMapTy;
- typedef std::map<const Type*, typename MapTy::iterator> AbstractTypeMapTy;
- private:
- /// Map - This is the main map from the element descriptor to the Constants.
- /// This is the primary way we avoid creating two of the same shape
- /// constant.
- MapTy Map;
-
- /// InverseMap - If "HasLargeKey" is true, this contains an inverse mapping
- /// from the constants to their element in Map. This is important for
- /// removal of constants from the array, which would otherwise have to scan
- /// through the map with very large keys.
- InverseMapTy InverseMap;
-
- /// AbstractTypeMap - Map for abstract type constants.
- ///
- AbstractTypeMapTy AbstractTypeMap;
-
- public:
- typename MapTy::iterator map_end() { return Map.end(); }
-
- /// InsertOrGetItem - Return an iterator for the specified element.
- /// If the element exists in the map, the returned iterator points to the
- /// entry and Exists=true. If not, the iterator points to the newly
- /// inserted entry and returns Exists=false. Newly inserted entries have
- /// I->second == 0, and should be filled in.
- typename MapTy::iterator InsertOrGetItem(std::pair<MapKey, Constant *>
- &InsertVal,
- bool &Exists) {
- std::pair<typename MapTy::iterator, bool> IP = Map.insert(InsertVal);
- Exists = !IP.second;
- return IP.first;
- }
-
-private:
- typename MapTy::iterator FindExistingElement(ConstantClass *CP) {
- if (HasLargeKey) {
- typename InverseMapTy::iterator IMI = InverseMap.find(CP);
- assert(IMI != InverseMap.end() && IMI->second != Map.end() &&
- IMI->second->second == CP &&
- "InverseMap corrupt!");
- return IMI->second;
- }
-
- typename MapTy::iterator I =
- Map.find(MapKey((TypeClass*)CP->getRawType(), getValType(CP)));
- if (I == Map.end() || I->second != CP) {
- // FIXME: This should not use a linear scan. If this gets to be a
- // performance problem, someone should look at this.
- for (I = Map.begin(); I != Map.end() && I->second != CP; ++I)
- /* empty */;
- }
- return I;
- }
-public:
-
- /// getOrCreate - Return the specified constant from the map, creating it if
- /// necessary.
- ConstantClass *getOrCreate(const TypeClass *Ty, const ValType &V) {
- MapKey Lookup(Ty, V);
- typename MapTy::iterator I = Map.lower_bound(Lookup);
- // Is it in the map?
- if (I != Map.end() && I->first == Lookup)
- return static_cast<ConstantClass *>(I->second);
-
- // If no preexisting value, create one now...
- ConstantClass *Result =
- ConstantCreator<ConstantClass,TypeClass,ValType>::create(Ty, V);
-
- /// FIXME: why does this assert fail when loading 176.gcc?
- //assert(Result->getType() == Ty && "Type specified is not correct!");
- I = Map.insert(I, std::make_pair(MapKey(Ty, V), Result));
-
- if (HasLargeKey) // Remember the reverse mapping if needed.
- InverseMap.insert(std::make_pair(Result, I));
-
- // If the type of the constant is abstract, make sure that an entry exists
- // for it in the AbstractTypeMap.
- if (Ty->isAbstract()) {
- typename AbstractTypeMapTy::iterator TI =
- AbstractTypeMap.lower_bound(Ty);
-
- if (TI == AbstractTypeMap.end() || TI->first != Ty) {
- // Add ourselves to the ATU list of the type.
- cast<DerivedType>(Ty)->addAbstractTypeUser(this);
-
- AbstractTypeMap.insert(TI, std::make_pair(Ty, I));
- }
- }
- return Result;
- }
-
- void remove(ConstantClass *CP) {
- typename MapTy::iterator I = FindExistingElement(CP);
- assert(I != Map.end() && "Constant not found in constant table!");
- assert(I->second == CP && "Didn't find correct element?");
-
- if (HasLargeKey) // Remember the reverse mapping if needed.
- InverseMap.erase(CP);
-
- // Now that we found the entry, make sure this isn't the entry that
- // the AbstractTypeMap points to.
- const TypeClass *Ty = static_cast<const TypeClass *>(I->first.first);
- if (Ty->isAbstract()) {
- assert(AbstractTypeMap.count(Ty) &&
- "Abstract type not in AbstractTypeMap?");
- typename MapTy::iterator &ATMEntryIt = AbstractTypeMap[Ty];
- if (ATMEntryIt == I) {
- // Yes, we are removing the representative entry for this type.
- // See if there are any other entries of the same type.
- typename MapTy::iterator TmpIt = ATMEntryIt;
-
- // First check the entry before this one...
- if (TmpIt != Map.begin()) {
- --TmpIt;
- if (TmpIt->first.first != Ty) // Not the same type, move back...
- ++TmpIt;
- }
-
- // If we didn't find the same type, try to move forward...
- if (TmpIt == ATMEntryIt) {
- ++TmpIt;
- if (TmpIt == Map.end() || TmpIt->first.first != Ty)
- --TmpIt; // No entry afterwards with the same type
- }
-
- // If there is another entry in the map of the same abstract type,
- // update the AbstractTypeMap entry now.
- if (TmpIt != ATMEntryIt) {
- ATMEntryIt = TmpIt;
- } else {
- // Otherwise, we are removing the last instance of this type
- // from the table. Remove from the ATM, and from user list.
- cast<DerivedType>(Ty)->removeAbstractTypeUser(this);
- AbstractTypeMap.erase(Ty);
- }
- }
- }
-
- Map.erase(I);
- }
-
-
- /// MoveConstantToNewSlot - If we are about to change C to be the element
- /// specified by I, update our internal data structures to reflect this
- /// fact.
- void MoveConstantToNewSlot(ConstantClass *C, typename MapTy::iterator I) {
- // First, remove the old location of the specified constant in the map.
- typename MapTy::iterator OldI = FindExistingElement(C);
- assert(OldI != Map.end() && "Constant not found in constant table!");
- assert(OldI->second == C && "Didn't find correct element?");
-
- // If this constant is the representative element for its abstract type,
- // update the AbstractTypeMap so that the representative element is I.
- if (C->getType()->isAbstract()) {
- typename AbstractTypeMapTy::iterator ATI =
- AbstractTypeMap.find(C->getType());
- assert(ATI != AbstractTypeMap.end() &&
- "Abstract type not in AbstractTypeMap?");
- if (ATI->second == OldI)
- ATI->second = I;
- }
-
- // Remove the old entry from the map.
- Map.erase(OldI);
-
- // Update the inverse map so that we know that this constant is now
- // located at descriptor I.
- if (HasLargeKey) {
- assert(I->second == C && "Bad inversemap entry!");
- InverseMap[C] = I;
- }
- }
-
- void refineAbstractType(const DerivedType *OldTy, const Type *NewTy) {
- typename AbstractTypeMapTy::iterator I =
- AbstractTypeMap.find(cast<Type>(OldTy));
-
- assert(I != AbstractTypeMap.end() &&
- "Abstract type not in AbstractTypeMap?");
-
- // Convert a constant at a time until the last one is gone. The last one
- // leaving will remove() itself, causing the AbstractTypeMapEntry to be
- // eliminated eventually.
- do {
- ConvertConstantType<ConstantClass,
- TypeClass>::convert(
- static_cast<ConstantClass *>(I->second->second),
- cast<TypeClass>(NewTy));
-
- I = AbstractTypeMap.find(cast<Type>(OldTy));
- } while (I != AbstractTypeMap.end());
- }
-
- // If the type became concrete without being refined to any other existing
- // type, we just remove ourselves from the ATU list.
- void typeBecameConcrete(const DerivedType *AbsTy) {
- AbsTy->removeAbstractTypeUser(this);
- }
-
- void dump() const {
- DOUT << "Constant.cpp: ValueMap\n";
- }
- };
-}
-
-
-
-//---- ConstantAggregateZero::get() implementation...
-//
-namespace llvm {
- // ConstantAggregateZero does not take extra "value" argument...
- template<class ValType>
- struct ConstantCreator<ConstantAggregateZero, Type, ValType> {
- static ConstantAggregateZero *create(const Type *Ty, const ValType &V){
- return new ConstantAggregateZero(Ty);
- }
- };
-
- template<>
- struct ConvertConstantType<ConstantAggregateZero, Type> {
- static void convert(ConstantAggregateZero *OldC, const Type *NewTy) {
- // Make everyone now use a constant of the new type...
- Constant *New = ConstantAggregateZero::get(NewTy);
- assert(New != OldC && "Didn't replace constant??");
- OldC->uncheckedReplaceAllUsesWith(New);
- OldC->destroyConstant(); // This constant is now dead, destroy it.
- }
- };
-}
-
-static ManagedStatic<ValueMap<char, Type,
- ConstantAggregateZero> > AggZeroConstants;
-
-static char getValType(ConstantAggregateZero *CPZ) { return 0; }
-
-Constant *ConstantAggregateZero::get(const Type *Ty) {
- assert((isa<StructType>(Ty) || isa<ArrayType>(Ty) || isa<VectorType>(Ty)) &&
- "Cannot create an aggregate zero of non-aggregate type!");
- return AggZeroConstants->getOrCreate(Ty, 0);
-}
-
-// destroyConstant - Remove the constant from the constant table...
-//
-void ConstantAggregateZero::destroyConstant() {
- AggZeroConstants->remove(this);
- destroyConstantImpl();
-}
-
-//---- ConstantArray::get() implementation...
-//
-namespace llvm {
- template<>
- struct ConvertConstantType<ConstantArray, ArrayType> {
- static void convert(ConstantArray *OldC, const ArrayType *NewTy) {
- // Make everyone now use a constant of the new type...
- std::vector<Constant*> C;
- for (unsigned i = 0, e = OldC->getNumOperands(); i != e; ++i)
- C.push_back(cast<Constant>(OldC->getOperand(i)));
- Constant *New = ConstantArray::get(NewTy, C);
- assert(New != OldC && "Didn't replace constant??");
- OldC->uncheckedReplaceAllUsesWith(New);
- OldC->destroyConstant(); // This constant is now dead, destroy it.
- }
- };
-}
-
-static std::vector<Constant*> getValType(ConstantArray *CA) {
- std::vector<Constant*> Elements;
- Elements.reserve(CA->getNumOperands());
- for (unsigned i = 0, e = CA->getNumOperands(); i != e; ++i)
- Elements.push_back(cast<Constant>(CA->getOperand(i)));
- return Elements;
-}
-
-typedef ValueMap<std::vector<Constant*>, ArrayType,
- ConstantArray, true /*largekey*/> ArrayConstantsTy;
-static ManagedStatic<ArrayConstantsTy> ArrayConstants;
-
-Constant *ConstantArray::get(const ArrayType *Ty,
- const std::vector<Constant*> &V) {
- // If this is an all-zero array, return a ConstantAggregateZero object
- if (!V.empty()) {
- Constant *C = V[0];
- if (!C->isNullValue())
- return ArrayConstants->getOrCreate(Ty, V);
- for (unsigned i = 1, e = V.size(); i != e; ++i)
- if (V[i] != C)
- return ArrayConstants->getOrCreate(Ty, V);
- }
- return ConstantAggregateZero::get(Ty);
-}
-
-// destroyConstant - Remove the constant from the constant table...
-//
-void ConstantArray::destroyConstant() {
- ArrayConstants->remove(this);
- destroyConstantImpl();
-}
-
-/// ConstantArray::get(const string&) - Return an array that is initialized to
-/// contain the specified string. If length is zero then a null terminator is
-/// added to the specified string so that it may be used in a natural way.
-/// Otherwise, the length parameter specifies how much of the string to use
-/// and it won't be null terminated.
-///
-Constant *ConstantArray::get(const std::string &Str, bool AddNull) {
- std::vector<Constant*> ElementVals;
- for (unsigned i = 0; i < Str.length(); ++i)
- ElementVals.push_back(ConstantInt::get(Type::Int8Ty, Str[i]));
-
- // Add a null terminator to the string...
- if (AddNull) {
- ElementVals.push_back(ConstantInt::get(Type::Int8Ty, 0));
- }
-
- ArrayType *ATy = ArrayType::get(Type::Int8Ty, ElementVals.size());
- return ConstantArray::get(ATy, ElementVals);
-}
-
-/// isString - This method returns true if the array is an array of i8, and
-/// if the elements of the array are all ConstantInt's.
-bool ConstantArray::isString() const {
- // Check the element type for i8...
- if (getType()->getElementType() != Type::Int8Ty)
- return false;
- // Check the elements to make sure they are all integers, not constant
- // expressions.
- for (unsigned i = 0, e = getNumOperands(); i != e; ++i)
- if (!isa<ConstantInt>(getOperand(i)))
- return false;
- return true;
-}
-
-/// isCString - This method returns true if the array is a string (see
-/// isString) and it ends in a null byte \0 and does not contains any other
-/// null bytes except its terminator.
-bool ConstantArray::isCString() const {
- // Check the element type for i8...
- if (getType()->getElementType() != Type::Int8Ty)
- return false;
- Constant *Zero = Constant::getNullValue(getOperand(0)->getType());
- // Last element must be a null.
- if (getOperand(getNumOperands()-1) != Zero)
- return false;
- // Other elements must be non-null integers.
- for (unsigned i = 0, e = getNumOperands()-1; i != e; ++i) {
- if (!isa<ConstantInt>(getOperand(i)))
- return false;
- if (getOperand(i) == Zero)
- return false;
- }
- return true;
-}
-
-
-// getAsString - If the sub-element type of this array is i8
-// then this method converts the array to an std::string and returns it.
-// Otherwise, it asserts out.
-//
-std::string ConstantArray::getAsString() const {
- assert(isString() && "Not a string!");
- std::string Result;
- for (unsigned i = 0, e = getNumOperands(); i != e; ++i)
- Result += (char)cast<ConstantInt>(getOperand(i))->getZExtValue();
- return Result;
-}
-
-
-//---- ConstantStruct::get() implementation...
-//
-
-namespace llvm {
- template<>
- struct ConvertConstantType<ConstantStruct, StructType> {
- static void convert(ConstantStruct *OldC, const StructType *NewTy) {
- // Make everyone now use a constant of the new type...
- std::vector<Constant*> C;
- for (unsigned i = 0, e = OldC->getNumOperands(); i != e; ++i)
- C.push_back(cast<Constant>(OldC->getOperand(i)));
- Constant *New = ConstantStruct::get(NewTy, C);
- assert(New != OldC && "Didn't replace constant??");
-
- OldC->uncheckedReplaceAllUsesWith(New);
- OldC->destroyConstant(); // This constant is now dead, destroy it.
- }
- };
-}
-
-typedef ValueMap<std::vector<Constant*>, StructType,
- ConstantStruct, true /*largekey*/> StructConstantsTy;
-static ManagedStatic<StructConstantsTy> StructConstants;
-
-static std::vector<Constant*> getValType(ConstantStruct *CS) {
- std::vector<Constant*> Elements;
- Elements.reserve(CS->getNumOperands());
- for (unsigned i = 0, e = CS->getNumOperands(); i != e; ++i)
- Elements.push_back(cast<Constant>(CS->getOperand(i)));
- return Elements;
-}
-
-Constant *ConstantStruct::get(const StructType *Ty,
- const std::vector<Constant*> &V) {
- // Create a ConstantAggregateZero value if all elements are zeros...
- for (unsigned i = 0, e = V.size(); i != e; ++i)
- if (!V[i]->isNullValue())
- return StructConstants->getOrCreate(Ty, V);
-
- return ConstantAggregateZero::get(Ty);
-}
-
-Constant *ConstantStruct::get(const std::vector<Constant*> &V, bool packed) {
- std::vector<const Type*> StructEls;
- StructEls.reserve(V.size());
- for (unsigned i = 0, e = V.size(); i != e; ++i)
- StructEls.push_back(V[i]->getType());
- return get(StructType::get(StructEls, packed), V);
-}
-
-// destroyConstant - Remove the constant from the constant table...
-//
-void ConstantStruct::destroyConstant() {
- StructConstants->remove(this);
- destroyConstantImpl();
-}
-
-//---- ConstantVector::get() implementation...
-//
-namespace llvm {
- template<>
- struct ConvertConstantType<ConstantVector, VectorType> {
- static void convert(ConstantVector *OldC, const VectorType *NewTy) {
- // Make everyone now use a constant of the new type...
- std::vector<Constant*> C;
- for (unsigned i = 0, e = OldC->getNumOperands(); i != e; ++i)
- C.push_back(cast<Constant>(OldC->getOperand(i)));
- Constant *New = ConstantVector::get(NewTy, C);
- assert(New != OldC && "Didn't replace constant??");
- OldC->uncheckedReplaceAllUsesWith(New);
- OldC->destroyConstant(); // This constant is now dead, destroy it.
- }
- };
-}
-
-static std::vector<Constant*> getValType(ConstantVector *CP) {
- std::vector<Constant*> Elements;
- Elements.reserve(CP->getNumOperands());
- for (unsigned i = 0, e = CP->getNumOperands(); i != e; ++i)
- Elements.push_back(CP->getOperand(i));
- return Elements;
-}
-
-static ManagedStatic<ValueMap<std::vector<Constant*>, VectorType,
- ConstantVector> > VectorConstants;
-
-Constant *ConstantVector::get(const VectorType *Ty,
- const std::vector<Constant*> &V) {
- // If this is an all-zero vector, return a ConstantAggregateZero object
- if (!V.empty()) {
- Constant *C = V[0];
- if (!C->isNullValue())
- return VectorConstants->getOrCreate(Ty, V);
- for (unsigned i = 1, e = V.size(); i != e; ++i)
- if (V[i] != C)
- return VectorConstants->getOrCreate(Ty, V);
- }
- return ConstantAggregateZero::get(Ty);
-}
-
-Constant *ConstantVector::get(const std::vector<Constant*> &V) {
- assert(!V.empty() && "Cannot infer type if V is empty");
- return get(VectorType::get(V.front()->getType(),V.size()), V);
-}
-
-// destroyConstant - Remove the constant from the constant table...
-//
-void ConstantVector::destroyConstant() {
- VectorConstants->remove(this);
- destroyConstantImpl();
-}
-
-/// This function will return true iff every element in this vector constant
-/// is set to all ones.
-/// @returns true iff this constant's emements are all set to all ones.
-/// @brief Determine if the value is all ones.
-bool ConstantVector::isAllOnesValue() const {
- // Check out first element.
- const Constant *Elt = getOperand(0);
- const ConstantInt *CI = dyn_cast<ConstantInt>(Elt);
- if (!CI || !CI->isAllOnesValue()) return false;
- // Then make sure all remaining elements point to the same value.
- for (unsigned I = 1, E = getNumOperands(); I < E; ++I) {
- if (getOperand(I) != Elt) return false;
- }
- return true;
-}
-
-/// getSplatValue - If this is a splat constant, where all of the
-/// elements have the same value, return that value. Otherwise return null.
-Constant *ConstantVector::getSplatValue() {
- // Check out first element.
- Constant *Elt = getOperand(0);
- // Then make sure all remaining elements point to the same value.
- for (unsigned I = 1, E = getNumOperands(); I < E; ++I)
- if (getOperand(I) != Elt) return 0;
- return Elt;
-}
-
-//---- ConstantPointerNull::get() implementation...
-//
-
-namespace llvm {
- // ConstantPointerNull does not take extra "value" argument...
- template<class ValType>
- struct ConstantCreator<ConstantPointerNull, PointerType, ValType> {
- static ConstantPointerNull *create(const PointerType *Ty, const ValType &V){
- return new ConstantPointerNull(Ty);
- }
- };
-
- template<>
- struct ConvertConstantType<ConstantPointerNull, PointerType> {
- static void convert(ConstantPointerNull *OldC, const PointerType *NewTy) {
- // Make everyone now use a constant of the new type...
- Constant *New = ConstantPointerNull::get(NewTy);
- assert(New != OldC && "Didn't replace constant??");
- OldC->uncheckedReplaceAllUsesWith(New);
- OldC->destroyConstant(); // This constant is now dead, destroy it.
- }
- };
-}
-
-static ManagedStatic<ValueMap<char, PointerType,
- ConstantPointerNull> > NullPtrConstants;
-
-static char getValType(ConstantPointerNull *) {
- return 0;
-}
-
-
-ConstantPointerNull *ConstantPointerNull::get(const PointerType *Ty) {
- return NullPtrConstants->getOrCreate(Ty, 0);
-}
-
-// destroyConstant - Remove the constant from the constant table...
-//
-void ConstantPointerNull::destroyConstant() {
- NullPtrConstants->remove(this);
- destroyConstantImpl();
-}
-
-
-//---- UndefValue::get() implementation...
-//
-
-namespace llvm {
- // UndefValue does not take extra "value" argument...
- template<class ValType>
- struct ConstantCreator<UndefValue, Type, ValType> {
- static UndefValue *create(const Type *Ty, const ValType &V) {
- return new UndefValue(Ty);
- }
- };
-
- template<>
- struct ConvertConstantType<UndefValue, Type> {
- static void convert(UndefValue *OldC, const Type *NewTy) {
- // Make everyone now use a constant of the new type.
- Constant *New = UndefValue::get(NewTy);
- assert(New != OldC && "Didn't replace constant??");
- OldC->uncheckedReplaceAllUsesWith(New);
- OldC->destroyConstant(); // This constant is now dead, destroy it.
- }
- };
-}
-
-static ManagedStatic<ValueMap<char, Type, UndefValue> > UndefValueConstants;
-
-static char getValType(UndefValue *) {
- return 0;
-}
-
-
-UndefValue *UndefValue::get(const Type *Ty) {
- return UndefValueConstants->getOrCreate(Ty, 0);
-}
-
-// destroyConstant - Remove the constant from the constant table.
-//
-void UndefValue::destroyConstant() {
- UndefValueConstants->remove(this);
- destroyConstantImpl();
-}
-
-
-//---- ConstantExpr::get() implementations...
-//
-
-struct ExprMapKeyType {
- explicit ExprMapKeyType(unsigned opc, std::vector<Constant*> ops,
- unsigned short pred = 0) : opcode(opc), predicate(pred), operands(ops) { }
- uint16_t opcode;
- uint16_t predicate;
- std::vector<Constant*> operands;
- bool operator==(const ExprMapKeyType& that) const {
- return this->opcode == that.opcode &&
- this->predicate == that.predicate &&
- this->operands == that.operands;
- }
- bool operator<(const ExprMapKeyType & that) const {
- return this->opcode < that.opcode ||
- (this->opcode == that.opcode && this->predicate < that.predicate) ||
- (this->opcode == that.opcode && this->predicate == that.predicate &&
- this->operands < that.operands);
- }
-
- bool operator!=(const ExprMapKeyType& that) const {
- return !(*this == that);
- }
-};
-
-namespace llvm {
- template<>
- struct ConstantCreator<ConstantExpr, Type, ExprMapKeyType> {
- static ConstantExpr *create(const Type *Ty, const ExprMapKeyType &V,
- unsigned short pred = 0) {
- if (Instruction::isCast(V.opcode))
- return new UnaryConstantExpr(V.opcode, V.operands[0], Ty);
- if ((V.opcode >= Instruction::BinaryOpsBegin &&
- V.opcode < Instruction::BinaryOpsEnd))
- return new BinaryConstantExpr(V.opcode, V.operands[0], V.operands[1]);
- if (V.opcode == Instruction::Select)
- return new SelectConstantExpr(V.operands[0], V.operands[1],
- V.operands[2]);
- if (V.opcode == Instruction::ExtractElement)
- return new ExtractElementConstantExpr(V.operands[0], V.operands[1]);
- if (V.opcode == Instruction::InsertElement)
- return new InsertElementConstantExpr(V.operands[0], V.operands[1],
- V.operands[2]);
- if (V.opcode == Instruction::ShuffleVector)
- return new ShuffleVectorConstantExpr(V.operands[0], V.operands[1],
- V.operands[2]);
- if (V.opcode == Instruction::GetElementPtr) {
- std::vector<Constant*> IdxList(V.operands.begin()+1, V.operands.end());
- return GetElementPtrConstantExpr::Create(V.operands[0], IdxList, Ty);
- }
-
- // The compare instructions are weird. We have to encode the predicate
- // value and it is combined with the instruction opcode by multiplying
- // the opcode by one hundred. We must decode this to get the predicate.
- if (V.opcode == Instruction::ICmp)
- return new CompareConstantExpr(Instruction::ICmp, V.predicate,
- V.operands[0], V.operands[1]);
- if (V.opcode == Instruction::FCmp)
- return new CompareConstantExpr(Instruction::FCmp, V.predicate,
- V.operands[0], V.operands[1]);
- assert(0 && "Invalid ConstantExpr!");
- return 0;
- }
- };
-
- template<>
- struct ConvertConstantType<ConstantExpr, Type> {
- static void convert(ConstantExpr *OldC, const Type *NewTy) {
- Constant *New;
- switch (OldC->getOpcode()) {
- case Instruction::Trunc:
- case Instruction::ZExt:
- case Instruction::SExt:
- case Instruction::FPTrunc:
- case Instruction::FPExt:
- case Instruction::UIToFP:
- case Instruction::SIToFP:
- case Instruction::FPToUI:
- case Instruction::FPToSI:
- case Instruction::PtrToInt:
- case Instruction::IntToPtr:
- case Instruction::BitCast:
- New = ConstantExpr::getCast(OldC->getOpcode(), OldC->getOperand(0),
- NewTy);
- break;
- case Instruction::Select:
- New = ConstantExpr::getSelectTy(NewTy, OldC->getOperand(0),
- OldC->getOperand(1),
- OldC->getOperand(2));
- break;
- default:
- assert(OldC->getOpcode() >= Instruction::BinaryOpsBegin &&
- OldC->getOpcode() < Instruction::BinaryOpsEnd);
- New = ConstantExpr::getTy(NewTy, OldC->getOpcode(), OldC->getOperand(0),
- OldC->getOperand(1));
- break;
- case Instruction::GetElementPtr:
- // Make everyone now use a constant of the new type...
- std::vector<Value*> Idx(OldC->op_begin()+1, OldC->op_end());
- New = ConstantExpr::getGetElementPtrTy(NewTy, OldC->getOperand(0),
- &Idx[0], Idx.size());
- break;
- }
-
- assert(New != OldC && "Didn't replace constant??");
- OldC->uncheckedReplaceAllUsesWith(New);
- OldC->destroyConstant(); // This constant is now dead, destroy it.
- }
- };
-} // end namespace llvm
-
-
-static ExprMapKeyType getValType(ConstantExpr *CE) {
- std::vector<Constant*> Operands;
- Operands.reserve(CE->getNumOperands());
- for (unsigned i = 0, e = CE->getNumOperands(); i != e; ++i)
- Operands.push_back(cast<Constant>(CE->getOperand(i)));
- return ExprMapKeyType(CE->getOpcode(), Operands,
- CE->isCompare() ? CE->getPredicate() : 0);
-}
-
-static ManagedStatic<ValueMap<ExprMapKeyType, Type,
- ConstantExpr> > ExprConstants;
-
-/// This is a utility function to handle folding of casts and lookup of the
-/// cast in the ExprConstants map. It is used by the various get* methods below.
-static inline Constant *getFoldedCast(
- Instruction::CastOps opc, Constant *C, const Type *Ty) {
- assert(Ty->isFirstClassType() && "Cannot cast to an aggregate type!");
- // Fold a few common cases
- if (Constant *FC = ConstantFoldCastInstruction(opc, C, Ty))
- return FC;
-
- // Look up the constant in the table first to ensure uniqueness
- std::vector<Constant*> argVec(1, C);
- ExprMapKeyType Key(opc, argVec);
- return ExprConstants->getOrCreate(Ty, Key);
-}
-
-Constant *ConstantExpr::getCast(unsigned oc, Constant *C, const Type *Ty) {
- Instruction::CastOps opc = Instruction::CastOps(oc);
- assert(Instruction::isCast(opc) && "opcode out of range");
- assert(C && Ty && "Null arguments to getCast");
- assert(Ty->isFirstClassType() && "Cannot cast to an aggregate type!");
-
- switch (opc) {
- default:
- assert(0 && "Invalid cast opcode");
- break;
- case Instruction::Trunc: return getTrunc(C, Ty);
- case Instruction::ZExt: return getZExt(C, Ty);
- case Instruction::SExt: return getSExt(C, Ty);
- case Instruction::FPTrunc: return getFPTrunc(C, Ty);
- case Instruction::FPExt: return getFPExtend(C, Ty);
- case Instruction::UIToFP: return getUIToFP(C, Ty);
- case Instruction::SIToFP: return getSIToFP(C, Ty);
- case Instruction::FPToUI: return getFPToUI(C, Ty);
- case Instruction::FPToSI: return getFPToSI(C, Ty);
- case Instruction::PtrToInt: return getPtrToInt(C, Ty);
- case Instruction::IntToPtr: return getIntToPtr(C, Ty);
- case Instruction::BitCast: return getBitCast(C, Ty);
- }
- return 0;
-}
-
-Constant *ConstantExpr::getZExtOrBitCast(Constant *C, const Type *Ty) {
- if (C->getType()->getPrimitiveSizeInBits() == Ty->getPrimitiveSizeInBits())
- return getCast(Instruction::BitCast, C, Ty);
- return getCast(Instruction::ZExt, C, Ty);
-}
-
-Constant *ConstantExpr::getSExtOrBitCast(Constant *C, const Type *Ty) {
- if (C->getType()->getPrimitiveSizeInBits() == Ty->getPrimitiveSizeInBits())
- return getCast(Instruction::BitCast, C, Ty);
- return getCast(Instruction::SExt, C, Ty);
-}
-
-Constant *ConstantExpr::getTruncOrBitCast(Constant *C, const Type *Ty) {
- if (C->getType()->getPrimitiveSizeInBits() == Ty->getPrimitiveSizeInBits())
- return getCast(Instruction::BitCast, C, Ty);
- return getCast(Instruction::Trunc, C, Ty);
-}
-
-Constant *ConstantExpr::getPointerCast(Constant *S, const Type *Ty) {
- assert(isa<PointerType>(S->getType()) && "Invalid cast");
- assert((Ty->isInteger() || isa<PointerType>(Ty)) && "Invalid cast");
-
- if (Ty->isInteger())
- return getCast(Instruction::PtrToInt, S, Ty);
- return getCast(Instruction::BitCast, S, Ty);
-}
-
-Constant *ConstantExpr::getIntegerCast(Constant *C, const Type *Ty,
- bool isSigned) {
- assert(C->getType()->isInteger() && Ty->isInteger() && "Invalid cast");
- unsigned SrcBits = C->getType()->getPrimitiveSizeInBits();
- unsigned DstBits = Ty->getPrimitiveSizeInBits();
- Instruction::CastOps opcode =
- (SrcBits == DstBits ? Instruction::BitCast :
- (SrcBits > DstBits ? Instruction::Trunc :
- (isSigned ? Instruction::SExt : Instruction::ZExt)));
- return getCast(opcode, C, Ty);
-}
-
-Constant *ConstantExpr::getFPCast(Constant *C, const Type *Ty) {
- assert(C->getType()->isFloatingPoint() && Ty->isFloatingPoint() &&
- "Invalid cast");
- unsigned SrcBits = C->getType()->getPrimitiveSizeInBits();
- unsigned DstBits = Ty->getPrimitiveSizeInBits();
- if (SrcBits == DstBits)
- return C; // Avoid a useless cast
- Instruction::CastOps opcode =
- (SrcBits > DstBits ? Instruction::FPTrunc : Instruction::FPExt);
- return getCast(opcode, C, Ty);
-}
-
-Constant *ConstantExpr::getTrunc(Constant *C, const Type *Ty) {
- assert(C->getType()->isInteger() && "Trunc operand must be integer");
- assert(Ty->isInteger() && "Trunc produces only integral");
- assert(C->getType()->getPrimitiveSizeInBits() > Ty->getPrimitiveSizeInBits()&&
- "SrcTy must be larger than DestTy for Trunc!");
-
- return getFoldedCast(Instruction::Trunc, C, Ty);
-}
-
-Constant *ConstantExpr::getSExt(Constant *C, const Type *Ty) {
- assert(C->getType()->isInteger() && "SEXt operand must be integral");
- assert(Ty->isInteger() && "SExt produces only integer");
- assert(C->getType()->getPrimitiveSizeInBits() < Ty->getPrimitiveSizeInBits()&&
- "SrcTy must be smaller than DestTy for SExt!");
-
- return getFoldedCast(Instruction::SExt, C, Ty);
-}
-
-Constant *ConstantExpr::getZExt(Constant *C, const Type *Ty) {
- assert(C->getType()->isInteger() && "ZEXt operand must be integral");
- assert(Ty->isInteger() && "ZExt produces only integer");
- assert(C->getType()->getPrimitiveSizeInBits() < Ty->getPrimitiveSizeInBits()&&
- "SrcTy must be smaller than DestTy for ZExt!");
-
- return getFoldedCast(Instruction::ZExt, C, Ty);
-}
-
-Constant *ConstantExpr::getFPTrunc(Constant *C, const Type *Ty) {
- assert(C->getType()->isFloatingPoint() && Ty->isFloatingPoint() &&
- C->getType()->getPrimitiveSizeInBits() > Ty->getPrimitiveSizeInBits()&&
- "This is an illegal floating point truncation!");
- return getFoldedCast(Instruction::FPTrunc, C, Ty);
-}
-
-Constant *ConstantExpr::getFPExtend(Constant *C, const Type *Ty) {
- assert(C->getType()->isFloatingPoint() && Ty->isFloatingPoint() &&
- C->getType()->getPrimitiveSizeInBits() < Ty->getPrimitiveSizeInBits()&&
- "This is an illegal floating point extension!");
- return getFoldedCast(Instruction::FPExt, C, Ty);
-}
-
-Constant *ConstantExpr::getUIToFP(Constant *C, const Type *Ty) {
- bool fromVec = C->getType()->getTypeID() == Type::VectorTyID;
- bool toVec = Ty->getTypeID() == Type::VectorTyID;
- assert((fromVec == toVec) && "Cannot convert from scalar to/from vector");
- assert(C->getType()->isIntOrIntVector() && Ty->isFPOrFPVector() &&
- "This is an illegal uint to floating point cast!");
- return getFoldedCast(Instruction::UIToFP, C, Ty);
-}
-
-Constant *ConstantExpr::getSIToFP(Constant *C, const Type *Ty) {
- bool fromVec = C->getType()->getTypeID() == Type::VectorTyID;
- bool toVec = Ty->getTypeID() == Type::VectorTyID;
- assert((fromVec == toVec) && "Cannot convert from scalar to/from vector");
- assert(C->getType()->isIntOrIntVector() && Ty->isFPOrFPVector() &&
- "This is an illegal sint to floating point cast!");
- return getFoldedCast(Instruction::SIToFP, C, Ty);
-}
-
-Constant *ConstantExpr::getFPToUI(Constant *C, const Type *Ty) {
- bool fromVec = C->getType()->getTypeID() == Type::VectorTyID;
- bool toVec = Ty->getTypeID() == Type::VectorTyID;
- assert((fromVec == toVec) && "Cannot convert from scalar to/from vector");
- assert(C->getType()->isFPOrFPVector() && Ty->isIntOrIntVector() &&
- "This is an illegal floating point to uint cast!");
- return getFoldedCast(Instruction::FPToUI, C, Ty);
-}
-
-Constant *ConstantExpr::getFPToSI(Constant *C, const Type *Ty) {
- bool fromVec = C->getType()->getTypeID() == Type::VectorTyID;
- bool toVec = Ty->getTypeID() == Type::VectorTyID;
- assert((fromVec == toVec) && "Cannot convert from scalar to/from vector");
- assert(C->getType()->isFPOrFPVector() && Ty->isIntOrIntVector() &&
- "This is an illegal floating point to sint cast!");
- return getFoldedCast(Instruction::FPToSI, C, Ty);
-}
-
-Constant *ConstantExpr::getPtrToInt(Constant *C, const Type *DstTy) {
- assert(isa<PointerType>(C->getType()) && "PtrToInt source must be pointer");
- assert(DstTy->isInteger() && "PtrToInt destination must be integral");
- return getFoldedCast(Instruction::PtrToInt, C, DstTy);
-}
-
-Constant *ConstantExpr::getIntToPtr(Constant *C, const Type *DstTy) {
- assert(C->getType()->isInteger() && "IntToPtr source must be integral");
- assert(isa<PointerType>(DstTy) && "IntToPtr destination must be a pointer");
- return getFoldedCast(Instruction::IntToPtr, C, DstTy);
-}
-
-Constant *ConstantExpr::getBitCast(Constant *C, const Type *DstTy) {
- // BitCast implies a no-op cast of type only. No bits change. However, you
- // can't cast pointers to anything but pointers.
- const Type *SrcTy = C->getType();
- assert((isa<PointerType>(SrcTy) == isa<PointerType>(DstTy)) &&
- "BitCast cannot cast pointer to non-pointer and vice versa");
-
- // Now we know we're not dealing with mismatched pointer casts (ptr->nonptr
- // or nonptr->ptr). For all the other types, the cast is okay if source and
- // destination bit widths are identical.
- unsigned SrcBitSize = SrcTy->getPrimitiveSizeInBits();
- unsigned DstBitSize = DstTy->getPrimitiveSizeInBits();
- assert(SrcBitSize == DstBitSize && "BitCast requies types of same width");
- return getFoldedCast(Instruction::BitCast, C, DstTy);
-}
-
-Constant *ConstantExpr::getSizeOf(const Type *Ty) {
- // sizeof is implemented as: (i64) gep (Ty*)null, 1
- Constant *GEPIdx = ConstantInt::get(Type::Int32Ty, 1);
- Constant *GEP =
- getGetElementPtr(getNullValue(PointerType::getUnqual(Ty)), &GEPIdx, 1);
- return getCast(Instruction::PtrToInt, GEP, Type::Int64Ty);
-}
-
-Constant *ConstantExpr::getTy(const Type *ReqTy, unsigned Opcode,
- Constant *C1, Constant *C2) {
- // Check the operands for consistency first
- assert(Opcode >= Instruction::BinaryOpsBegin &&
- Opcode < Instruction::BinaryOpsEnd &&
- "Invalid opcode in binary constant expression");
- assert(C1->getType() == C2->getType() &&
- "Operand types in binary constant expression should match");
-
- if (ReqTy == C1->getType() || ReqTy == Type::Int1Ty)
- if (Constant *FC = ConstantFoldBinaryInstruction(Opcode, C1, C2))
- return FC; // Fold a few common cases...
-
- std::vector<Constant*> argVec(1, C1); argVec.push_back(C2);
- ExprMapKeyType Key(Opcode, argVec);
- return ExprConstants->getOrCreate(ReqTy, Key);
-}
-
-Constant *ConstantExpr::getCompareTy(unsigned short predicate,
- Constant *C1, Constant *C2) {
- switch (predicate) {
- default: assert(0 && "Invalid CmpInst predicate");
- case FCmpInst::FCMP_FALSE: case FCmpInst::FCMP_OEQ: case FCmpInst::FCMP_OGT:
- case FCmpInst::FCMP_OGE: case FCmpInst::FCMP_OLT: case FCmpInst::FCMP_OLE:
- case FCmpInst::FCMP_ONE: case FCmpInst::FCMP_ORD: case FCmpInst::FCMP_UNO:
- case FCmpInst::FCMP_UEQ: case FCmpInst::FCMP_UGT: case FCmpInst::FCMP_UGE:
- case FCmpInst::FCMP_ULT: case FCmpInst::FCMP_ULE: case FCmpInst::FCMP_UNE:
- case FCmpInst::FCMP_TRUE:
- return getFCmp(predicate, C1, C2);
- case ICmpInst::ICMP_EQ: case ICmpInst::ICMP_NE: case ICmpInst::ICMP_UGT:
- case ICmpInst::ICMP_UGE: case ICmpInst::ICMP_ULT: case ICmpInst::ICMP_ULE:
- case ICmpInst::ICMP_SGT: case ICmpInst::ICMP_SGE: case ICmpInst::ICMP_SLT:
- case ICmpInst::ICMP_SLE:
- return getICmp(predicate, C1, C2);
- }
-}
-
-Constant *ConstantExpr::get(unsigned Opcode, Constant *C1, Constant *C2) {
-#ifndef NDEBUG
- switch (Opcode) {
- case Instruction::Add:
- case Instruction::Sub:
- case Instruction::Mul:
- assert(C1->getType() == C2->getType() && "Op types should be identical!");
- assert((C1->getType()->isInteger() || C1->getType()->isFloatingPoint() ||
- isa<VectorType>(C1->getType())) &&
- "Tried to create an arithmetic operation on a non-arithmetic type!");
- break;
- case Instruction::UDiv:
- case Instruction::SDiv:
- assert(C1->getType() == C2->getType() && "Op types should be identical!");
- assert((C1->getType()->isInteger() || (isa<VectorType>(C1->getType()) &&
- cast<VectorType>(C1->getType())->getElementType()->isInteger())) &&
- "Tried to create an arithmetic operation on a non-arithmetic type!");
- break;
- case Instruction::FDiv:
- assert(C1->getType() == C2->getType() && "Op types should be identical!");
- assert((C1->getType()->isFloatingPoint() || (isa<VectorType>(C1->getType())
- && cast<VectorType>(C1->getType())->getElementType()->isFloatingPoint()))
- && "Tried to create an arithmetic operation on a non-arithmetic type!");
- break;
- case Instruction::URem:
- case Instruction::SRem:
- assert(C1->getType() == C2->getType() && "Op types should be identical!");
- assert((C1->getType()->isInteger() || (isa<VectorType>(C1->getType()) &&
- cast<VectorType>(C1->getType())->getElementType()->isInteger())) &&
- "Tried to create an arithmetic operation on a non-arithmetic type!");
- break;
- case Instruction::FRem:
- assert(C1->getType() == C2->getType() && "Op types should be identical!");
- assert((C1->getType()->isFloatingPoint() || (isa<VectorType>(C1->getType())
- && cast<VectorType>(C1->getType())->getElementType()->isFloatingPoint()))
- && "Tried to create an arithmetic operation on a non-arithmetic type!");
- break;
- case Instruction::And:
- case Instruction::Or:
- case Instruction::Xor:
- assert(C1->getType() == C2->getType() && "Op types should be identical!");
- assert((C1->getType()->isInteger() || isa<VectorType>(C1->getType())) &&
- "Tried to create a logical operation on a non-integral type!");
- break;
- case Instruction::Shl:
- case Instruction::LShr:
- case Instruction::AShr:
- assert(C1->getType() == C2->getType() && "Op types should be identical!");
- assert(C1->getType()->isInteger() &&
- "Tried to create a shift operation on a non-integer type!");
- break;
- default:
- break;
- }
-#endif
-
- return getTy(C1->getType(), Opcode, C1, C2);
-}
-
-Constant *ConstantExpr::getCompare(unsigned short pred,
- Constant *C1, Constant *C2) {
- assert(C1->getType() == C2->getType() && "Op types should be identical!");
- return getCompareTy(pred, C1, C2);
-}
-
-Constant *ConstantExpr::getSelectTy(const Type *ReqTy, Constant *C,
- Constant *V1, Constant *V2) {
- assert(C->getType() == Type::Int1Ty && "Select condition must be i1!");
- assert(V1->getType() == V2->getType() && "Select value types must match!");
- assert(V1->getType()->isFirstClassType() && "Cannot select aggregate type!");
-
- if (ReqTy == V1->getType())
- if (Constant *SC = ConstantFoldSelectInstruction(C, V1, V2))
- return SC; // Fold common cases
-
- std::vector<Constant*> argVec(3, C);
- argVec[1] = V1;
- argVec[2] = V2;
- ExprMapKeyType Key(Instruction::Select, argVec);
- return ExprConstants->getOrCreate(ReqTy, Key);
-}
-
-Constant *ConstantExpr::getGetElementPtrTy(const Type *ReqTy, Constant *C,
- Value* const *Idxs,
- unsigned NumIdx) {
- assert(GetElementPtrInst::getIndexedType(C->getType(), Idxs, Idxs+NumIdx, true) &&
- "GEP indices invalid!");
-
- if (Constant *FC = ConstantFoldGetElementPtr(C, (Constant**)Idxs, NumIdx))
- return FC; // Fold a few common cases...
-
- assert(isa<PointerType>(C->getType()) &&
- "Non-pointer type for constant GetElementPtr expression");
- // Look up the constant in the table first to ensure uniqueness
- std::vector<Constant*> ArgVec;
- ArgVec.reserve(NumIdx+1);
- ArgVec.push_back(C);
- for (unsigned i = 0; i != NumIdx; ++i)
- ArgVec.push_back(cast<Constant>(Idxs[i]));
- const ExprMapKeyType Key(Instruction::GetElementPtr, ArgVec);
- return ExprConstants->getOrCreate(ReqTy, Key);
-}
-
-Constant *ConstantExpr::getGetElementPtr(Constant *C, Value* const *Idxs,
- unsigned NumIdx) {
- // Get the result type of the getelementptr!
- const Type *Ty =
- GetElementPtrInst::getIndexedType(C->getType(), Idxs, Idxs+NumIdx, true);
- assert(Ty && "GEP indices invalid!");
- unsigned As = cast<PointerType>(C->getType())->getAddressSpace();
- return getGetElementPtrTy(PointerType::get(Ty, As), C, Idxs, NumIdx);
-}
-
-Constant *ConstantExpr::getGetElementPtr(Constant *C, Constant* const *Idxs,
- unsigned NumIdx) {
- return getGetElementPtr(C, (Value* const *)Idxs, NumIdx);
-}
-
-
-Constant *
-ConstantExpr::getICmp(unsigned short pred, Constant* LHS, Constant* RHS) {
- assert(LHS->getType() == RHS->getType());
- assert(pred >= ICmpInst::FIRST_ICMP_PREDICATE &&
- pred <= ICmpInst::LAST_ICMP_PREDICATE && "Invalid ICmp Predicate");
-
- if (Constant *FC = ConstantFoldCompareInstruction(pred, LHS, RHS))
- return FC; // Fold a few common cases...
-
- // Look up the constant in the table first to ensure uniqueness
- std::vector<Constant*> ArgVec;
- ArgVec.push_back(LHS);
- ArgVec.push_back(RHS);
- // Get the key type with both the opcode and predicate
- const ExprMapKeyType Key(Instruction::ICmp, ArgVec, pred);
- return ExprConstants->getOrCreate(Type::Int1Ty, Key);
-}
-
-Constant *
-ConstantExpr::getFCmp(unsigned short pred, Constant* LHS, Constant* RHS) {
- assert(LHS->getType() == RHS->getType());
- assert(pred <= FCmpInst::LAST_FCMP_PREDICATE && "Invalid FCmp Predicate");
-
- if (Constant *FC = ConstantFoldCompareInstruction(pred, LHS, RHS))
- return FC; // Fold a few common cases...
-
- // Look up the constant in the table first to ensure uniqueness
- std::vector<Constant*> ArgVec;
- ArgVec.push_back(LHS);
- ArgVec.push_back(RHS);
- // Get the key type with both the opcode and predicate
- const ExprMapKeyType Key(Instruction::FCmp, ArgVec, pred);
- return ExprConstants->getOrCreate(Type::Int1Ty, Key);
-}
-
-Constant *ConstantExpr::getExtractElementTy(const Type *ReqTy, Constant *Val,
- Constant *Idx) {
- if (Constant *FC = ConstantFoldExtractElementInstruction(Val, Idx))
- return FC; // Fold a few common cases...
- // Look up the constant in the table first to ensure uniqueness
- std::vector<Constant*> ArgVec(1, Val);
- ArgVec.push_back(Idx);
- const ExprMapKeyType Key(Instruction::ExtractElement,ArgVec);
- return ExprConstants->getOrCreate(ReqTy, Key);
-}
-
-Constant *ConstantExpr::getExtractElement(Constant *Val, Constant *Idx) {
- assert(isa<VectorType>(Val->getType()) &&
- "Tried to create extractelement operation on non-vector type!");
- assert(Idx->getType() == Type::Int32Ty &&
- "Extractelement index must be i32 type!");
- return getExtractElementTy(cast<VectorType>(Val->getType())->getElementType(),
- Val, Idx);
-}
-
-Constant *ConstantExpr::getInsertElementTy(const Type *ReqTy, Constant *Val,
- Constant *Elt, Constant *Idx) {
- if (Constant *FC = ConstantFoldInsertElementInstruction(Val, Elt, Idx))
- return FC; // Fold a few common cases...
- // Look up the constant in the table first to ensure uniqueness
- std::vector<Constant*> ArgVec(1, Val);
- ArgVec.push_back(Elt);
- ArgVec.push_back(Idx);
- const ExprMapKeyType Key(Instruction::InsertElement,ArgVec);
- return ExprConstants->getOrCreate(ReqTy, Key);
-}
-
-Constant *ConstantExpr::getInsertElement(Constant *Val, Constant *Elt,
- Constant *Idx) {
- assert(isa<VectorType>(Val->getType()) &&
- "Tried to create insertelement operation on non-vector type!");
- assert(Elt->getType() == cast<VectorType>(Val->getType())->getElementType()
- && "Insertelement types must match!");
- assert(Idx->getType() == Type::Int32Ty &&
- "Insertelement index must be i32 type!");
- return getInsertElementTy(cast<VectorType>(Val->getType())->getElementType(),
- Val, Elt, Idx);
-}
-
-Constant *ConstantExpr::getShuffleVectorTy(const Type *ReqTy, Constant *V1,
- Constant *V2, Constant *Mask) {
- if (Constant *FC = ConstantFoldShuffleVectorInstruction(V1, V2, Mask))
- return FC; // Fold a few common cases...
- // Look up the constant in the table first to ensure uniqueness
- std::vector<Constant*> ArgVec(1, V1);
- ArgVec.push_back(V2);
- ArgVec.push_back(Mask);
- const ExprMapKeyType Key(Instruction::ShuffleVector,ArgVec);
- return ExprConstants->getOrCreate(ReqTy, Key);
-}
-
-Constant *ConstantExpr::getShuffleVector(Constant *V1, Constant *V2,
- Constant *Mask) {
- assert(ShuffleVectorInst::isValidOperands(V1, V2, Mask) &&
- "Invalid shuffle vector constant expr operands!");
- return getShuffleVectorTy(V1->getType(), V1, V2, Mask);
-}
-
-Constant *ConstantExpr::getZeroValueForNegationExpr(const Type *Ty) {
- if (const VectorType *PTy = dyn_cast<VectorType>(Ty))
- if (PTy->getElementType()->isFloatingPoint()) {
- std::vector<Constant*> zeros(PTy->getNumElements(),
- ConstantFP::getNegativeZero(PTy->getElementType()));
- return ConstantVector::get(PTy, zeros);
- }
-
- if (Ty->isFloatingPoint())
- return ConstantFP::getNegativeZero(Ty);
-
- return Constant::getNullValue(Ty);
-}
-
-// destroyConstant - Remove the constant from the constant table...
-//
-void ConstantExpr::destroyConstant() {
- ExprConstants->remove(this);
- destroyConstantImpl();
-}
-
-const char *ConstantExpr::getOpcodeName() const {
- return Instruction::getOpcodeName(getOpcode());
-}
-
-//===----------------------------------------------------------------------===//
-// replaceUsesOfWithOnConstant implementations
-
-/// replaceUsesOfWithOnConstant - Update this constant array to change uses of
-/// 'From' to be uses of 'To'. This must update the uniquing data structures
-/// etc.
-///
-/// Note that we intentionally replace all uses of From with To here. Consider
-/// a large array that uses 'From' 1000 times. By handling this case all here,
-/// ConstantArray::replaceUsesOfWithOnConstant is only invoked once, and that
-/// single invocation handles all 1000 uses. Handling them one at a time would
-/// work, but would be really slow because it would have to unique each updated
-/// array instance.
-void ConstantArray::replaceUsesOfWithOnConstant(Value *From, Value *To,
- Use *U) {
- assert(isa<Constant>(To) && "Cannot make Constant refer to non-constant!");
- Constant *ToC = cast<Constant>(To);
-
- std::pair<ArrayConstantsTy::MapKey, Constant*> Lookup;
- Lookup.first.first = getType();
- Lookup.second = this;
-
- std::vector<Constant*> &Values = Lookup.first.second;
- Values.reserve(getNumOperands()); // Build replacement array.
-
- // Fill values with the modified operands of the constant array. Also,
- // compute whether this turns into an all-zeros array.
- bool isAllZeros = false;
- unsigned NumUpdated = 0;
- if (!ToC->isNullValue()) {
- for (Use *O = OperandList, *E = OperandList+getNumOperands(); O != E; ++O) {
- Constant *Val = cast<Constant>(O->get());
- if (Val == From) {
- Val = ToC;
- ++NumUpdated;
- }
- Values.push_back(Val);
- }
- } else {
- isAllZeros = true;
- for (Use *O = OperandList, *E = OperandList+getNumOperands(); O != E; ++O) {
- Constant *Val = cast<Constant>(O->get());
- if (Val == From) {
- Val = ToC;
- ++NumUpdated;
- }
- Values.push_back(Val);
- if (isAllZeros) isAllZeros = Val->isNullValue();
- }
- }
-
- Constant *Replacement = 0;
- if (isAllZeros) {
- Replacement = ConstantAggregateZero::get(getType());
- } else {
- // Check to see if we have this array type already.
- bool Exists;
- ArrayConstantsTy::MapTy::iterator I =
- ArrayConstants->InsertOrGetItem(Lookup, Exists);
-
- if (Exists) {
- Replacement = I->second;
- } else {
- // Okay, the new shape doesn't exist in the system yet. Instead of
- // creating a new constant array, inserting it, replaceallusesof'ing the
- // old with the new, then deleting the old... just update the current one
- // in place!
- ArrayConstants->MoveConstantToNewSlot(this, I);
-
- // Update to the new value. Optimize for the case when we have a single
- // operand that we're changing, but handle bulk updates efficiently.
- if (NumUpdated == 1) {
- unsigned OperandToUpdate = U-OperandList;
- assert(getOperand(OperandToUpdate) == From &&
- "ReplaceAllUsesWith broken!");
- setOperand(OperandToUpdate, ToC);
- } else {
- for (unsigned i = 0, e = getNumOperands(); i != e; ++i)
- if (getOperand(i) == From)
- setOperand(i, ToC);
- }
- return;
- }
- }
-
- // Otherwise, I do need to replace this with an existing value.
- assert(Replacement != this && "I didn't contain From!");
-
- // Everyone using this now uses the replacement.
- uncheckedReplaceAllUsesWith(Replacement);
-
- // Delete the old constant!
- destroyConstant();
-}
-
-void ConstantStruct::replaceUsesOfWithOnConstant(Value *From, Value *To,
- Use *U) {
- assert(isa<Constant>(To) && "Cannot make Constant refer to non-constant!");
- Constant *ToC = cast<Constant>(To);
-
- unsigned OperandToUpdate = U-OperandList;
- assert(getOperand(OperandToUpdate) == From && "ReplaceAllUsesWith broken!");
-
- std::pair<StructConstantsTy::MapKey, Constant*> Lookup;
- Lookup.first.first = getType();
- Lookup.second = this;
- std::vector<Constant*> &Values = Lookup.first.second;
- Values.reserve(getNumOperands()); // Build replacement struct.
-
-
- // Fill values with the modified operands of the constant struct. Also,
- // compute whether this turns into an all-zeros struct.
- bool isAllZeros = false;
- if (!ToC->isNullValue()) {
- for (Use *O = OperandList, *E = OperandList+getNumOperands(); O != E; ++O)
- Values.push_back(cast<Constant>(O->get()));
- } else {
- isAllZeros = true;
- for (Use *O = OperandList, *E = OperandList+getNumOperands(); O != E; ++O) {
- Constant *Val = cast<Constant>(O->get());
- Values.push_back(Val);
- if (isAllZeros) isAllZeros = Val->isNullValue();
- }
- }
- Values[OperandToUpdate] = ToC;
-
- Constant *Replacement = 0;
- if (isAllZeros) {
- Replacement = ConstantAggregateZero::get(getType());
- } else {
- // Check to see if we have this array type already.
- bool Exists;
- StructConstantsTy::MapTy::iterator I =
- StructConstants->InsertOrGetItem(Lookup, Exists);
-
- if (Exists) {
- Replacement = I->second;
- } else {
- // Okay, the new shape doesn't exist in the system yet. Instead of
- // creating a new constant struct, inserting it, replaceallusesof'ing the
- // old with the new, then deleting the old... just update the current one
- // in place!
- StructConstants->MoveConstantToNewSlot(this, I);
-
- // Update to the new value.
- setOperand(OperandToUpdate, ToC);
- return;
- }
- }
-
- assert(Replacement != this && "I didn't contain From!");
-
- // Everyone using this now uses the replacement.
- uncheckedReplaceAllUsesWith(Replacement);
-
- // Delete the old constant!
- destroyConstant();
-}
-
-void ConstantVector::replaceUsesOfWithOnConstant(Value *From, Value *To,
- Use *U) {
- assert(isa<Constant>(To) && "Cannot make Constant refer to non-constant!");
-
- std::vector<Constant*> Values;
- Values.reserve(getNumOperands()); // Build replacement array...
- for (unsigned i = 0, e = getNumOperands(); i != e; ++i) {
- Constant *Val = getOperand(i);
- if (Val == From) Val = cast<Constant>(To);
- Values.push_back(Val);
- }
-
- Constant *Replacement = ConstantVector::get(getType(), Values);
- assert(Replacement != this && "I didn't contain From!");
-
- // Everyone using this now uses the replacement.
- uncheckedReplaceAllUsesWith(Replacement);
-
- // Delete the old constant!
- destroyConstant();
-}
-
-void ConstantExpr::replaceUsesOfWithOnConstant(Value *From, Value *ToV,
- Use *U) {
- assert(isa<Constant>(ToV) && "Cannot make Constant refer to non-constant!");
- Constant *To = cast<Constant>(ToV);
-
- Constant *Replacement = 0;
- if (getOpcode() == Instruction::GetElementPtr) {
- SmallVector<Constant*, 8> Indices;
- Constant *Pointer = getOperand(0);
- Indices.reserve(getNumOperands()-1);
- if (Pointer == From) Pointer = To;
-
- for (unsigned i = 1, e = getNumOperands(); i != e; ++i) {
- Constant *Val = getOperand(i);
- if (Val == From) Val = To;
- Indices.push_back(Val);
- }
- Replacement = ConstantExpr::getGetElementPtr(Pointer,
- &Indices[0], Indices.size());
- } else if (isCast()) {
- assert(getOperand(0) == From && "Cast only has one use!");
- Replacement = ConstantExpr::getCast(getOpcode(), To, getType());
- } else if (getOpcode() == Instruction::Select) {
- Constant *C1 = getOperand(0);
- Constant *C2 = getOperand(1);
- Constant *C3 = getOperand(2);
- if (C1 == From) C1 = To;
- if (C2 == From) C2 = To;
- if (C3 == From) C3 = To;
- Replacement = ConstantExpr::getSelect(C1, C2, C3);
- } else if (getOpcode() == Instruction::ExtractElement) {
- Constant *C1 = getOperand(0);
- Constant *C2 = getOperand(1);
- if (C1 == From) C1 = To;
- if (C2 == From) C2 = To;
- Replacement = ConstantExpr::getExtractElement(C1, C2);
- } else if (getOpcode() == Instruction::InsertElement) {
- Constant *C1 = getOperand(0);
- Constant *C2 = getOperand(1);
- Constant *C3 = getOperand(1);
- if (C1 == From) C1 = To;
- if (C2 == From) C2 = To;
- if (C3 == From) C3 = To;
- Replacement = ConstantExpr::getInsertElement(C1, C2, C3);
- } else if (getOpcode() == Instruction::ShuffleVector) {
- Constant *C1 = getOperand(0);
- Constant *C2 = getOperand(1);
- Constant *C3 = getOperand(2);
- if (C1 == From) C1 = To;
- if (C2 == From) C2 = To;
- if (C3 == From) C3 = To;
- Replacement = ConstantExpr::getShuffleVector(C1, C2, C3);
- } else if (isCompare()) {
- Constant *C1 = getOperand(0);
- Constant *C2 = getOperand(1);
- if (C1 == From) C1 = To;
- if (C2 == From) C2 = To;
- if (getOpcode() == Instruction::ICmp)
- Replacement = ConstantExpr::getICmp(getPredicate(), C1, C2);
- else
- Replacement = ConstantExpr::getFCmp(getPredicate(), C1, C2);
- } else if (getNumOperands() == 2) {
- Constant *C1 = getOperand(0);
- Constant *C2 = getOperand(1);
- if (C1 == From) C1 = To;
- if (C2 == From) C2 = To;
- Replacement = ConstantExpr::get(getOpcode(), C1, C2);
- } else {
- assert(0 && "Unknown ConstantExpr type!");
- return;
- }
-
- assert(Replacement != this && "I didn't contain From!");
-
- // Everyone using this now uses the replacement.
- uncheckedReplaceAllUsesWith(Replacement);
-
- // Delete the old constant!
- destroyConstant();
-}
-
-
-/// getStringValue - Turn an LLVM constant pointer that eventually points to a
-/// global into a string value. Return an empty string if we can't do it.
-/// Parameter Chop determines if the result is chopped at the first null
-/// terminator.
-///
-std::string Constant::getStringValue(bool Chop, unsigned Offset) {
- if (GlobalVariable *GV = dyn_cast<GlobalVariable>(this)) {
- if (GV->hasInitializer() && isa<ConstantArray>(GV->getInitializer())) {
- ConstantArray *Init = cast<ConstantArray>(GV->getInitializer());
- if (Init->isString()) {
- std::string Result = Init->getAsString();
- if (Offset < Result.size()) {
- // If we are pointing INTO The string, erase the beginning...
- Result.erase(Result.begin(), Result.begin()+Offset);
-
- // Take off the null terminator, and any string fragments after it.
- if (Chop) {
- std::string::size_type NullPos = Result.find_first_of((char)0);
- if (NullPos != std::string::npos)
- Result.erase(Result.begin()+NullPos, Result.end());
- }
- return Result;
- }
- }
- }
- } else if (ConstantExpr *CE = dyn_cast<ConstantExpr>(this)) {
- if (CE->getOpcode() == Instruction::GetElementPtr) {
- // Turn a gep into the specified offset.
- if (CE->getNumOperands() == 3 &&
- cast<Constant>(CE->getOperand(1))->isNullValue() &&
- isa<ConstantInt>(CE->getOperand(2))) {
- Offset += cast<ConstantInt>(CE->getOperand(2))->getZExtValue();
- return CE->getOperand(0)->getStringValue(Chop, Offset);
- }
- }
- }
- return "";
-}
diff --git a/release_23/lib/VMCore/Core.cpp b/release_23/lib/VMCore/Core.cpp
deleted file mode 100644
index 22c77f2c4de9..000000000000
--- a/release_23/lib/VMCore/Core.cpp
+++ /dev/null
@@ -1,1367 +0,0 @@
-//===-- Core.cpp ----------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the C bindings for libLLVMCore.a, which implements
-// the LLVM intermediate representation.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm-c/Core.h"
-#include "llvm/Bitcode/ReaderWriter.h"
-#include "llvm/Constants.h"
-#include "llvm/DerivedTypes.h"
-#include "llvm/GlobalVariable.h"
-#include "llvm/TypeSymbolTable.h"
-#include "llvm/ModuleProvider.h"
-#include "llvm/Support/MemoryBuffer.h"
-#include "llvm/Support/CallSite.h"
-#include <cassert>
-#include <cstdlib>
-#include <cstring>
-
-using namespace llvm;
-
-
-/*===-- Error handling ----------------------------------------------------===*/
-
-void LLVMDisposeMessage(char *Message) {
- free(Message);
-}
-
-
-/*===-- Operations on modules ---------------------------------------------===*/
-
-LLVMModuleRef LLVMModuleCreateWithName(const char *ModuleID) {
- return wrap(new Module(ModuleID));
-}
-
-void LLVMDisposeModule(LLVMModuleRef M) {
- delete unwrap(M);
-}
-
-/*--.. Data layout .........................................................--*/
-const char * LLVMGetDataLayout(LLVMModuleRef M) {
- return unwrap(M)->getDataLayout().c_str();
-}
-
-void LLVMSetDataLayout(LLVMModuleRef M, const char *Triple) {
- unwrap(M)->setDataLayout(Triple);
-}
-
-/*--.. Target triple .......................................................--*/
-const char * LLVMGetTarget(LLVMModuleRef M) {
- return unwrap(M)->getTargetTriple().c_str();
-}
-
-void LLVMSetTarget(LLVMModuleRef M, const char *Triple) {
- unwrap(M)->setTargetTriple(Triple);
-}
-
-/*--.. Type names ..........................................................--*/
-int LLVMAddTypeName(LLVMModuleRef M, const char *Name, LLVMTypeRef Ty) {
- return unwrap(M)->addTypeName(Name, unwrap(Ty));
-}
-
-void LLVMDeleteTypeName(LLVMModuleRef M, const char *Name) {
- std::string N(Name);
-
- TypeSymbolTable &TST = unwrap(M)->getTypeSymbolTable();
- for (TypeSymbolTable::iterator I = TST.begin(), E = TST.end(); I != E; ++I)
- if (I->first == N)
- TST.remove(I);
-}
-
-void LLVMDumpModule(LLVMModuleRef M) {
- unwrap(M)->dump();
-}
-
-
-/*===-- Operations on types -----------------------------------------------===*/
-
-/*--.. Operations on all types (mostly) ....................................--*/
-
-LLVMTypeKind LLVMGetTypeKind(LLVMTypeRef Ty) {
- return static_cast<LLVMTypeKind>(unwrap(Ty)->getTypeID());
-}
-
-void LLVMRefineAbstractType(LLVMTypeRef AbstractType, LLVMTypeRef ConcreteType){
- DerivedType *Ty = unwrap<DerivedType>(AbstractType);
- Ty->refineAbstractTypeTo(unwrap(ConcreteType));
-}
-
-/*--.. Operations on integer types .........................................--*/
-
-LLVMTypeRef LLVMInt1Type(void) { return (LLVMTypeRef) Type::Int1Ty; }
-LLVMTypeRef LLVMInt8Type(void) { return (LLVMTypeRef) Type::Int8Ty; }
-LLVMTypeRef LLVMInt16Type(void) { return (LLVMTypeRef) Type::Int16Ty; }
-LLVMTypeRef LLVMInt32Type(void) { return (LLVMTypeRef) Type::Int32Ty; }
-LLVMTypeRef LLVMInt64Type(void) { return (LLVMTypeRef) Type::Int64Ty; }
-
-LLVMTypeRef LLVMIntType(unsigned NumBits) {
- return wrap(IntegerType::get(NumBits));
-}
-
-unsigned LLVMGetIntTypeWidth(LLVMTypeRef IntegerTy) {
- return unwrap<IntegerType>(IntegerTy)->getBitWidth();
-}
-
-/*--.. Operations on real types ............................................--*/
-
-LLVMTypeRef LLVMFloatType(void) { return (LLVMTypeRef) Type::FloatTy; }
-LLVMTypeRef LLVMDoubleType(void) { return (LLVMTypeRef) Type::DoubleTy; }
-LLVMTypeRef LLVMX86FP80Type(void) { return (LLVMTypeRef) Type::X86_FP80Ty; }
-LLVMTypeRef LLVMFP128Type(void) { return (LLVMTypeRef) Type::FP128Ty; }
-LLVMTypeRef LLVMPPCFP128Type(void) { return (LLVMTypeRef) Type::PPC_FP128Ty; }
-
-/*--.. Operations on function types ........................................--*/
-
-LLVMTypeRef LLVMFunctionType(LLVMTypeRef ReturnType,
- LLVMTypeRef *ParamTypes, unsigned ParamCount,
- int IsVarArg) {
- std::vector<const Type*> Tys;
- for (LLVMTypeRef *I = ParamTypes, *E = ParamTypes + ParamCount; I != E; ++I)
- Tys.push_back(unwrap(*I));
-
- return wrap(FunctionType::get(unwrap(ReturnType), Tys, IsVarArg != 0));
-}
-
-int LLVMIsFunctionVarArg(LLVMTypeRef FunctionTy) {
- return unwrap<FunctionType>(FunctionTy)->isVarArg();
-}
-
-LLVMTypeRef LLVMGetReturnType(LLVMTypeRef FunctionTy) {
- return wrap(unwrap<FunctionType>(FunctionTy)->getReturnType());
-}
-
-unsigned LLVMCountParamTypes(LLVMTypeRef FunctionTy) {
- return unwrap<FunctionType>(FunctionTy)->getNumParams();
-}
-
-void LLVMGetParamTypes(LLVMTypeRef FunctionTy, LLVMTypeRef *Dest) {
- FunctionType *Ty = unwrap<FunctionType>(FunctionTy);
- for (FunctionType::param_iterator I = Ty->param_begin(),
- E = Ty->param_end(); I != E; ++I)
- *Dest++ = wrap(*I);
-}
-
-/*--.. Operations on struct types ..........................................--*/
-
-LLVMTypeRef LLVMStructType(LLVMTypeRef *ElementTypes,
- unsigned ElementCount, int Packed) {
- std::vector<const Type*> Tys;
- for (LLVMTypeRef *I = ElementTypes,
- *E = ElementTypes + ElementCount; I != E; ++I)
- Tys.push_back(unwrap(*I));
-
- return wrap(StructType::get(Tys, Packed != 0));
-}
-
-unsigned LLVMCountStructElementTypes(LLVMTypeRef StructTy) {
- return unwrap<StructType>(StructTy)->getNumElements();
-}
-
-void LLVMGetStructElementTypes(LLVMTypeRef StructTy, LLVMTypeRef *Dest) {
- StructType *Ty = unwrap<StructType>(StructTy);
- for (FunctionType::param_iterator I = Ty->element_begin(),
- E = Ty->element_end(); I != E; ++I)
- *Dest++ = wrap(*I);
-}
-
-int LLVMIsPackedStruct(LLVMTypeRef StructTy) {
- return unwrap<StructType>(StructTy)->isPacked();
-}
-
-/*--.. Operations on array, pointer, and vector types (sequence types) .....--*/
-
-LLVMTypeRef LLVMArrayType(LLVMTypeRef ElementType, unsigned ElementCount) {
- return wrap(ArrayType::get(unwrap(ElementType), ElementCount));
-}
-
-LLVMTypeRef LLVMPointerType(LLVMTypeRef ElementType, unsigned AddressSpace) {
- return wrap(PointerType::get(unwrap(ElementType), AddressSpace));
-}
-
-LLVMTypeRef LLVMVectorType(LLVMTypeRef ElementType, unsigned ElementCount) {
- return wrap(VectorType::get(unwrap(ElementType), ElementCount));
-}
-
-LLVMTypeRef LLVMGetElementType(LLVMTypeRef Ty) {
- return wrap(unwrap<SequentialType>(Ty)->getElementType());
-}
-
-unsigned LLVMGetArrayLength(LLVMTypeRef ArrayTy) {
- return unwrap<ArrayType>(ArrayTy)->getNumElements();
-}
-
-unsigned LLVMGetPointerAddressSpace(LLVMTypeRef PointerTy) {
- return unwrap<PointerType>(PointerTy)->getAddressSpace();
-}
-
-unsigned LLVMGetVectorSize(LLVMTypeRef VectorTy) {
- return unwrap<VectorType>(VectorTy)->getNumElements();
-}
-
-/*--.. Operations on other types ...........................................--*/
-
-LLVMTypeRef LLVMVoidType(void) { return (LLVMTypeRef) Type::VoidTy; }
-LLVMTypeRef LLVMLabelType(void) { return (LLVMTypeRef) Type::LabelTy; }
-
-LLVMTypeRef LLVMOpaqueType(void) {
- return wrap(llvm::OpaqueType::get());
-}
-
-/*--.. Operations on type handles ..........................................--*/
-
-LLVMTypeHandleRef LLVMCreateTypeHandle(LLVMTypeRef PotentiallyAbstractTy) {
- return wrap(new PATypeHolder(unwrap(PotentiallyAbstractTy)));
-}
-
-void LLVMDisposeTypeHandle(LLVMTypeHandleRef TypeHandle) {
- delete unwrap(TypeHandle);
-}
-
-LLVMTypeRef LLVMResolveTypeHandle(LLVMTypeHandleRef TypeHandle) {
- return wrap(unwrap(TypeHandle)->get());
-}
-
-void LLVMRefineType(LLVMTypeRef AbstractTy, LLVMTypeRef ConcreteTy) {
- unwrap<DerivedType>(AbstractTy)->refineAbstractTypeTo(unwrap(ConcreteTy));
-}
-
-
-/*===-- Operations on values ----------------------------------------------===*/
-
-/*--.. Operations on all values ............................................--*/
-
-LLVMTypeRef LLVMTypeOf(LLVMValueRef Val) {
- return wrap(unwrap(Val)->getType());
-}
-
-const char *LLVMGetValueName(LLVMValueRef Val) {
- return unwrap(Val)->getNameStart();
-}
-
-void LLVMSetValueName(LLVMValueRef Val, const char *Name) {
- unwrap(Val)->setName(Name);
-}
-
-void LLVMDumpValue(LLVMValueRef Val) {
- unwrap(Val)->dump();
-}
-
-/*--.. Operations on constants of any type .................................--*/
-
-LLVMValueRef LLVMConstNull(LLVMTypeRef Ty) {
- return wrap(Constant::getNullValue(unwrap(Ty)));
-}
-
-LLVMValueRef LLVMConstAllOnes(LLVMTypeRef Ty) {
- return wrap(Constant::getAllOnesValue(unwrap(Ty)));
-}
-
-LLVMValueRef LLVMGetUndef(LLVMTypeRef Ty) {
- return wrap(UndefValue::get(unwrap(Ty)));
-}
-
-int LLVMIsConstant(LLVMValueRef Ty) {
- return isa<Constant>(unwrap(Ty));
-}
-
-int LLVMIsNull(LLVMValueRef Val) {
- if (Constant *C = dyn_cast<Constant>(unwrap(Val)))
- return C->isNullValue();
- return false;
-}
-
-int LLVMIsUndef(LLVMValueRef Val) {
- return isa<UndefValue>(unwrap(Val));
-}
-
-/*--.. Operations on scalar constants ......................................--*/
-
-LLVMValueRef LLVMConstInt(LLVMTypeRef IntTy, unsigned long long N,
- int SignExtend) {
- return wrap(ConstantInt::get(unwrap<IntegerType>(IntTy), N, SignExtend != 0));
-}
-
-static const fltSemantics &SemanticsForType(Type *Ty) {
- assert(Ty->isFloatingPoint() && "Type is not floating point!");
- if (Ty == Type::FloatTy)
- return APFloat::IEEEsingle;
- if (Ty == Type::DoubleTy)
- return APFloat::IEEEdouble;
- if (Ty == Type::X86_FP80Ty)
- return APFloat::x87DoubleExtended;
- if (Ty == Type::FP128Ty)
- return APFloat::IEEEquad;
- if (Ty == Type::PPC_FP128Ty)
- return APFloat::PPCDoubleDouble;
- return APFloat::Bogus;
-}
-
-LLVMValueRef LLVMConstReal(LLVMTypeRef RealTy, double N) {
- APFloat APN(N);
- APN.convert(SemanticsForType(unwrap(RealTy)), APFloat::rmNearestTiesToEven);
- return wrap(ConstantFP::get(APN));
-}
-
-LLVMValueRef LLVMConstRealOfString(LLVMTypeRef RealTy, const char *Text) {
- return wrap(ConstantFP::get(APFloat(SemanticsForType(unwrap(RealTy)), Text)));
-}
-
-/*--.. Operations on composite constants ...................................--*/
-
-LLVMValueRef LLVMConstString(const char *Str, unsigned Length,
- int DontNullTerminate) {
- /* Inverted the sense of AddNull because ', 0)' is a
- better mnemonic for null termination than ', 1)'. */
- return wrap(ConstantArray::get(std::string(Str, Length),
- DontNullTerminate == 0));
-}
-
-LLVMValueRef LLVMConstArray(LLVMTypeRef ElementTy,
- LLVMValueRef *ConstantVals, unsigned Length) {
- return wrap(ConstantArray::get(ArrayType::get(unwrap(ElementTy), Length),
- unwrap<Constant>(ConstantVals, Length),
- Length));
-}
-
-LLVMValueRef LLVMConstStruct(LLVMValueRef *ConstantVals, unsigned Count,
- int Packed) {
- return wrap(ConstantStruct::get(unwrap<Constant>(ConstantVals, Count),
- Count, Packed != 0));
-}
-
-LLVMValueRef LLVMConstVector(LLVMValueRef *ScalarConstantVals, unsigned Size) {
- return wrap(ConstantVector::get(unwrap<Constant>(ScalarConstantVals, Size),
- Size));
-}
-
-/*--.. Constant expressions ................................................--*/
-
-LLVMValueRef LLVMSizeOf(LLVMTypeRef Ty) {
- return wrap(ConstantExpr::getSizeOf(unwrap(Ty)));
-}
-
-LLVMValueRef LLVMConstNeg(LLVMValueRef ConstantVal) {
- return wrap(ConstantExpr::getNeg(unwrap<Constant>(ConstantVal)));
-}
-
-LLVMValueRef LLVMConstNot(LLVMValueRef ConstantVal) {
- return wrap(ConstantExpr::getNot(unwrap<Constant>(ConstantVal)));
-}
-
-LLVMValueRef LLVMConstAdd(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant) {
- return wrap(ConstantExpr::getAdd(unwrap<Constant>(LHSConstant),
- unwrap<Constant>(RHSConstant)));
-}
-
-LLVMValueRef LLVMConstSub(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant) {
- return wrap(ConstantExpr::getSub(unwrap<Constant>(LHSConstant),
- unwrap<Constant>(RHSConstant)));
-}
-
-LLVMValueRef LLVMConstMul(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant) {
- return wrap(ConstantExpr::getMul(unwrap<Constant>(LHSConstant),
- unwrap<Constant>(RHSConstant)));
-}
-
-LLVMValueRef LLVMConstUDiv(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant) {
- return wrap(ConstantExpr::getUDiv(unwrap<Constant>(LHSConstant),
- unwrap<Constant>(RHSConstant)));
-}
-
-LLVMValueRef LLVMConstSDiv(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant) {
- return wrap(ConstantExpr::getSDiv(unwrap<Constant>(LHSConstant),
- unwrap<Constant>(RHSConstant)));
-}
-
-LLVMValueRef LLVMConstFDiv(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant) {
- return wrap(ConstantExpr::getFDiv(unwrap<Constant>(LHSConstant),
- unwrap<Constant>(RHSConstant)));
-}
-
-LLVMValueRef LLVMConstURem(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant) {
- return wrap(ConstantExpr::getURem(unwrap<Constant>(LHSConstant),
- unwrap<Constant>(RHSConstant)));
-}
-
-LLVMValueRef LLVMConstSRem(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant) {
- return wrap(ConstantExpr::getSRem(unwrap<Constant>(LHSConstant),
- unwrap<Constant>(RHSConstant)));
-}
-
-LLVMValueRef LLVMConstFRem(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant) {
- return wrap(ConstantExpr::getFRem(unwrap<Constant>(LHSConstant),
- unwrap<Constant>(RHSConstant)));
-}
-
-LLVMValueRef LLVMConstAnd(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant) {
- return wrap(ConstantExpr::getAnd(unwrap<Constant>(LHSConstant),
- unwrap<Constant>(RHSConstant)));
-}
-
-LLVMValueRef LLVMConstOr(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant) {
- return wrap(ConstantExpr::getOr(unwrap<Constant>(LHSConstant),
- unwrap<Constant>(RHSConstant)));
-}
-
-LLVMValueRef LLVMConstXor(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant) {
- return wrap(ConstantExpr::getXor(unwrap<Constant>(LHSConstant),
- unwrap<Constant>(RHSConstant)));
-}
-
-LLVMValueRef LLVMConstICmp(LLVMIntPredicate Predicate,
- LLVMValueRef LHSConstant, LLVMValueRef RHSConstant) {
- return wrap(ConstantExpr::getICmp(Predicate,
- unwrap<Constant>(LHSConstant),
- unwrap<Constant>(RHSConstant)));
-}
-
-LLVMValueRef LLVMConstFCmp(LLVMRealPredicate Predicate,
- LLVMValueRef LHSConstant, LLVMValueRef RHSConstant) {
- return wrap(ConstantExpr::getFCmp(Predicate,
- unwrap<Constant>(LHSConstant),
- unwrap<Constant>(RHSConstant)));
-}
-
-LLVMValueRef LLVMConstShl(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant) {
- return wrap(ConstantExpr::getShl(unwrap<Constant>(LHSConstant),
- unwrap<Constant>(RHSConstant)));
-}
-
-LLVMValueRef LLVMConstLShr(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant) {
- return wrap(ConstantExpr::getLShr(unwrap<Constant>(LHSConstant),
- unwrap<Constant>(RHSConstant)));
-}
-
-LLVMValueRef LLVMConstAShr(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant) {
- return wrap(ConstantExpr::getAShr(unwrap<Constant>(LHSConstant),
- unwrap<Constant>(RHSConstant)));
-}
-
-LLVMValueRef LLVMConstGEP(LLVMValueRef ConstantVal,
- LLVMValueRef *ConstantIndices, unsigned NumIndices) {
- return wrap(ConstantExpr::getGetElementPtr(unwrap<Constant>(ConstantVal),
- unwrap<Constant>(ConstantIndices,
- NumIndices),
- NumIndices));
-}
-
-LLVMValueRef LLVMConstTrunc(LLVMValueRef ConstantVal, LLVMTypeRef ToType) {
- return wrap(ConstantExpr::getTrunc(unwrap<Constant>(ConstantVal),
- unwrap(ToType)));
-}
-
-LLVMValueRef LLVMConstSExt(LLVMValueRef ConstantVal, LLVMTypeRef ToType) {
- return wrap(ConstantExpr::getSExt(unwrap<Constant>(ConstantVal),
- unwrap(ToType)));
-}
-
-LLVMValueRef LLVMConstZExt(LLVMValueRef ConstantVal, LLVMTypeRef ToType) {
- return wrap(ConstantExpr::getZExt(unwrap<Constant>(ConstantVal),
- unwrap(ToType)));
-}
-
-LLVMValueRef LLVMConstFPTrunc(LLVMValueRef ConstantVal, LLVMTypeRef ToType) {
- return wrap(ConstantExpr::getFPTrunc(unwrap<Constant>(ConstantVal),
- unwrap(ToType)));
-}
-
-LLVMValueRef LLVMConstFPExt(LLVMValueRef ConstantVal, LLVMTypeRef ToType) {
- return wrap(ConstantExpr::getFPExtend(unwrap<Constant>(ConstantVal),
- unwrap(ToType)));
-}
-
-LLVMValueRef LLVMConstUIToFP(LLVMValueRef ConstantVal, LLVMTypeRef ToType) {
- return wrap(ConstantExpr::getUIToFP(unwrap<Constant>(ConstantVal),
- unwrap(ToType)));
-}
-
-LLVMValueRef LLVMConstSIToFP(LLVMValueRef ConstantVal, LLVMTypeRef ToType) {
- return wrap(ConstantExpr::getSIToFP(unwrap<Constant>(ConstantVal),
- unwrap(ToType)));
-}
-
-LLVMValueRef LLVMConstFPToUI(LLVMValueRef ConstantVal, LLVMTypeRef ToType) {
- return wrap(ConstantExpr::getFPToUI(unwrap<Constant>(ConstantVal),
- unwrap(ToType)));
-}
-
-LLVMValueRef LLVMConstFPToSI(LLVMValueRef ConstantVal, LLVMTypeRef ToType) {
- return wrap(ConstantExpr::getFPToSI(unwrap<Constant>(ConstantVal),
- unwrap(ToType)));
-}
-
-LLVMValueRef LLVMConstPtrToInt(LLVMValueRef ConstantVal, LLVMTypeRef ToType) {
- return wrap(ConstantExpr::getPtrToInt(unwrap<Constant>(ConstantVal),
- unwrap(ToType)));
-}
-
-LLVMValueRef LLVMConstIntToPtr(LLVMValueRef ConstantVal, LLVMTypeRef ToType) {
- return wrap(ConstantExpr::getIntToPtr(unwrap<Constant>(ConstantVal),
- unwrap(ToType)));
-}
-
-LLVMValueRef LLVMConstBitCast(LLVMValueRef ConstantVal, LLVMTypeRef ToType) {
- return wrap(ConstantExpr::getBitCast(unwrap<Constant>(ConstantVal),
- unwrap(ToType)));
-}
-
-LLVMValueRef LLVMConstSelect(LLVMValueRef ConstantCondition,
- LLVMValueRef ConstantIfTrue,
- LLVMValueRef ConstantIfFalse) {
- return wrap(ConstantExpr::getSelect(unwrap<Constant>(ConstantCondition),
- unwrap<Constant>(ConstantIfTrue),
- unwrap<Constant>(ConstantIfFalse)));
-}
-
-LLVMValueRef LLVMConstExtractElement(LLVMValueRef VectorConstant,
- LLVMValueRef IndexConstant) {
- return wrap(ConstantExpr::getExtractElement(unwrap<Constant>(VectorConstant),
- unwrap<Constant>(IndexConstant)));
-}
-
-LLVMValueRef LLVMConstInsertElement(LLVMValueRef VectorConstant,
- LLVMValueRef ElementValueConstant,
- LLVMValueRef IndexConstant) {
- return wrap(ConstantExpr::getInsertElement(unwrap<Constant>(VectorConstant),
- unwrap<Constant>(ElementValueConstant),
- unwrap<Constant>(IndexConstant)));
-}
-
-LLVMValueRef LLVMConstShuffleVector(LLVMValueRef VectorAConstant,
- LLVMValueRef VectorBConstant,
- LLVMValueRef MaskConstant) {
- return wrap(ConstantExpr::getShuffleVector(unwrap<Constant>(VectorAConstant),
- unwrap<Constant>(VectorBConstant),
- unwrap<Constant>(MaskConstant)));
-}
-
-/*--.. Operations on global variables, functions, and aliases (globals) ....--*/
-
-LLVMModuleRef LLVMGetGlobalParent(LLVMValueRef Global) {
- return wrap(unwrap<GlobalValue>(Global)->getParent());
-}
-
-int LLVMIsDeclaration(LLVMValueRef Global) {
- return unwrap<GlobalValue>(Global)->isDeclaration();
-}
-
-LLVMLinkage LLVMGetLinkage(LLVMValueRef Global) {
- return static_cast<LLVMLinkage>(unwrap<GlobalValue>(Global)->getLinkage());
-}
-
-void LLVMSetLinkage(LLVMValueRef Global, LLVMLinkage Linkage) {
- unwrap<GlobalValue>(Global)
- ->setLinkage(static_cast<GlobalValue::LinkageTypes>(Linkage));
-}
-
-const char *LLVMGetSection(LLVMValueRef Global) {
- return unwrap<GlobalValue>(Global)->getSection().c_str();
-}
-
-void LLVMSetSection(LLVMValueRef Global, const char *Section) {
- unwrap<GlobalValue>(Global)->setSection(Section);
-}
-
-LLVMVisibility LLVMGetVisibility(LLVMValueRef Global) {
- return static_cast<LLVMVisibility>(
- unwrap<GlobalValue>(Global)->getVisibility());
-}
-
-void LLVMSetVisibility(LLVMValueRef Global, LLVMVisibility Viz) {
- unwrap<GlobalValue>(Global)
- ->setVisibility(static_cast<GlobalValue::VisibilityTypes>(Viz));
-}
-
-unsigned LLVMGetAlignment(LLVMValueRef Global) {
- return unwrap<GlobalValue>(Global)->getAlignment();
-}
-
-void LLVMSetAlignment(LLVMValueRef Global, unsigned Bytes) {
- unwrap<GlobalValue>(Global)->setAlignment(Bytes);
-}
-
-/*--.. Operations on global variables ......................................--*/
-
-LLVMValueRef LLVMAddGlobal(LLVMModuleRef M, LLVMTypeRef Ty, const char *Name) {
- return wrap(new GlobalVariable(unwrap(Ty), false,
- GlobalValue::ExternalLinkage, 0, Name,
- unwrap(M)));
-}
-
-LLVMValueRef LLVMGetNamedGlobal(LLVMModuleRef M, const char *Name) {
- return wrap(unwrap(M)->getNamedGlobal(Name));
-}
-
-LLVMValueRef LLVMGetFirstGlobal(LLVMModuleRef M) {
- Module *Mod = unwrap(M);
- Module::global_iterator I = Mod->global_begin();
- if (I == Mod->global_end())
- return 0;
- return wrap(I);
-}
-
-LLVMValueRef LLVMGetLastGlobal(LLVMModuleRef M) {
- Module *Mod = unwrap(M);
- Module::global_iterator I = Mod->global_end();
- if (I == Mod->global_begin())
- return 0;
- return wrap(--I);
-}
-
-LLVMValueRef LLVMGetNextGlobal(LLVMValueRef GlobalVar) {
- GlobalVariable *GV = unwrap<GlobalVariable>(GlobalVar);
- Module::global_iterator I = GV;
- if (++I == GV->getParent()->global_end())
- return 0;
- return wrap(I);
-}
-
-LLVMValueRef LLVMGetPreviousGlobal(LLVMValueRef GlobalVar) {
- GlobalVariable *GV = unwrap<GlobalVariable>(GlobalVar);
- Module::global_iterator I = GV;
- if (I == GV->getParent()->global_begin())
- return 0;
- return wrap(--I);
-}
-
-void LLVMDeleteGlobal(LLVMValueRef GlobalVar) {
- unwrap<GlobalVariable>(GlobalVar)->eraseFromParent();
-}
-
-int LLVMHasInitializer(LLVMValueRef GlobalVar) {
- return unwrap<GlobalVariable>(GlobalVar)->hasInitializer();
-}
-
-LLVMValueRef LLVMGetInitializer(LLVMValueRef GlobalVar) {
- return wrap(unwrap<GlobalVariable>(GlobalVar)->getInitializer());
-}
-
-void LLVMSetInitializer(LLVMValueRef GlobalVar, LLVMValueRef ConstantVal) {
- unwrap<GlobalVariable>(GlobalVar)
- ->setInitializer(unwrap<Constant>(ConstantVal));
-}
-
-int LLVMIsThreadLocal(LLVMValueRef GlobalVar) {
- return unwrap<GlobalVariable>(GlobalVar)->isThreadLocal();
-}
-
-void LLVMSetThreadLocal(LLVMValueRef GlobalVar, int IsThreadLocal) {
- unwrap<GlobalVariable>(GlobalVar)->setThreadLocal(IsThreadLocal != 0);
-}
-
-int LLVMIsGlobalConstant(LLVMValueRef GlobalVar) {
- return unwrap<GlobalVariable>(GlobalVar)->isConstant();
-}
-
-void LLVMSetGlobalConstant(LLVMValueRef GlobalVar, int IsConstant) {
- unwrap<GlobalVariable>(GlobalVar)->setConstant(IsConstant != 0);
-}
-
-/*--.. Operations on functions .............................................--*/
-
-LLVMValueRef LLVMAddFunction(LLVMModuleRef M, const char *Name,
- LLVMTypeRef FunctionTy) {
- return wrap(Function::Create(unwrap<FunctionType>(FunctionTy),
- GlobalValue::ExternalLinkage, Name, unwrap(M)));
-}
-
-LLVMValueRef LLVMGetNamedFunction(LLVMModuleRef M, const char *Name) {
- return wrap(unwrap(M)->getFunction(Name));
-}
-
-LLVMValueRef LLVMGetFirstFunction(LLVMModuleRef M) {
- Module *Mod = unwrap(M);
- Module::iterator I = Mod->begin();
- if (I == Mod->end())
- return 0;
- return wrap(I);
-}
-
-LLVMValueRef LLVMGetLastFunction(LLVMModuleRef M) {
- Module *Mod = unwrap(M);
- Module::iterator I = Mod->end();
- if (I == Mod->begin())
- return 0;
- return wrap(--I);
-}
-
-LLVMValueRef LLVMGetNextFunction(LLVMValueRef Fn) {
- Function *Func = unwrap<Function>(Fn);
- Module::iterator I = Func;
- if (++I == Func->getParent()->end())
- return 0;
- return wrap(I);
-}
-
-LLVMValueRef LLVMGetPreviousFunction(LLVMValueRef Fn) {
- Function *Func = unwrap<Function>(Fn);
- Module::iterator I = Func;
- if (I == Func->getParent()->begin())
- return 0;
- return wrap(--I);
-}
-
-void LLVMDeleteFunction(LLVMValueRef Fn) {
- unwrap<Function>(Fn)->eraseFromParent();
-}
-
-unsigned LLVMGetIntrinsicID(LLVMValueRef Fn) {
- if (Function *F = dyn_cast<Function>(unwrap(Fn)))
- return F->getIntrinsicID();
- return 0;
-}
-
-unsigned LLVMGetFunctionCallConv(LLVMValueRef Fn) {
- return unwrap<Function>(Fn)->getCallingConv();
-}
-
-void LLVMSetFunctionCallConv(LLVMValueRef Fn, unsigned CC) {
- return unwrap<Function>(Fn)->setCallingConv(CC);
-}
-
-const char *LLVMGetCollector(LLVMValueRef Fn) {
- Function *F = unwrap<Function>(Fn);
- return F->hasCollector()? F->getCollector() : 0;
-}
-
-void LLVMSetCollector(LLVMValueRef Fn, const char *Coll) {
- Function *F = unwrap<Function>(Fn);
- if (Coll)
- F->setCollector(Coll);
- else
- F->clearCollector();
-}
-
-/*--.. Operations on parameters ............................................--*/
-
-unsigned LLVMCountParams(LLVMValueRef FnRef) {
- // This function is strictly redundant to
- // LLVMCountParamTypes(LLVMGetElementType(LLVMTypeOf(FnRef)))
- return unwrap<Function>(FnRef)->getArgumentList().size();
-}
-
-void LLVMGetParams(LLVMValueRef FnRef, LLVMValueRef *ParamRefs) {
- Function *Fn = unwrap<Function>(FnRef);
- for (Function::arg_iterator I = Fn->arg_begin(),
- E = Fn->arg_end(); I != E; I++)
- *ParamRefs++ = wrap(I);
-}
-
-LLVMValueRef LLVMGetParam(LLVMValueRef FnRef, unsigned index) {
- Function::arg_iterator AI = unwrap<Function>(FnRef)->arg_begin();
- while (index --> 0)
- AI++;
- return wrap(AI);
-}
-
-LLVMValueRef LLVMGetParamParent(LLVMValueRef V) {
- return wrap(unwrap<Argument>(V)->getParent());
-}
-
-LLVMValueRef LLVMGetFirstParam(LLVMValueRef Fn) {
- Function *Func = unwrap<Function>(Fn);
- Function::arg_iterator I = Func->arg_begin();
- if (I == Func->arg_end())
- return 0;
- return wrap(I);
-}
-
-LLVMValueRef LLVMGetLastParam(LLVMValueRef Fn) {
- Function *Func = unwrap<Function>(Fn);
- Function::arg_iterator I = Func->arg_end();
- if (I == Func->arg_begin())
- return 0;
- return wrap(--I);
-}
-
-LLVMValueRef LLVMGetNextParam(LLVMValueRef Arg) {
- Argument *A = unwrap<Argument>(Arg);
- Function::arg_iterator I = A;
- if (++I == A->getParent()->arg_end())
- return 0;
- return wrap(I);
-}
-
-LLVMValueRef LLVMGetPreviousParam(LLVMValueRef Arg) {
- Argument *A = unwrap<Argument>(Arg);
- Function::arg_iterator I = A;
- if (I == A->getParent()->arg_begin())
- return 0;
- return wrap(--I);
-}
-
-void LLVMAddParamAttr(LLVMValueRef Arg, LLVMParamAttr PA) {
- unwrap<Argument>(Arg)->addAttr(PA);
-}
-
-void LLVMRemoveParamAttr(LLVMValueRef Arg, LLVMParamAttr PA) {
- unwrap<Argument>(Arg)->removeAttr(PA);
-}
-
-void LLVMSetParamAlignment(LLVMValueRef Arg, unsigned align) {
- unwrap<Argument>(Arg)->addAttr(
- ParamAttr::constructAlignmentFromInt(align));
-}
-
-/*--.. Operations on basic blocks ..........................................--*/
-
-LLVMValueRef LLVMBasicBlockAsValue(LLVMBasicBlockRef BB) {
- return wrap(static_cast<Value*>(unwrap(BB)));
-}
-
-int LLVMValueIsBasicBlock(LLVMValueRef Val) {
- return isa<BasicBlock>(unwrap(Val));
-}
-
-LLVMBasicBlockRef LLVMValueAsBasicBlock(LLVMValueRef Val) {
- return wrap(unwrap<BasicBlock>(Val));
-}
-
-LLVMValueRef LLVMGetBasicBlockParent(LLVMBasicBlockRef BB) {
- return wrap(unwrap(BB)->getParent());
-}
-
-unsigned LLVMCountBasicBlocks(LLVMValueRef FnRef) {
- return unwrap<Function>(FnRef)->getBasicBlockList().size();
-}
-
-void LLVMGetBasicBlocks(LLVMValueRef FnRef, LLVMBasicBlockRef *BasicBlocksRefs){
- Function *Fn = unwrap<Function>(FnRef);
- for (Function::iterator I = Fn->begin(), E = Fn->end(); I != E; I++)
- *BasicBlocksRefs++ = wrap(I);
-}
-
-LLVMBasicBlockRef LLVMGetEntryBasicBlock(LLVMValueRef Fn) {
- return wrap(&unwrap<Function>(Fn)->getEntryBlock());
-}
-
-LLVMBasicBlockRef LLVMGetFirstBasicBlock(LLVMValueRef Fn) {
- Function *Func = unwrap<Function>(Fn);
- Function::iterator I = Func->begin();
- if (I == Func->end())
- return 0;
- return wrap(I);
-}
-
-LLVMBasicBlockRef LLVMGetLastBasicBlock(LLVMValueRef Fn) {
- Function *Func = unwrap<Function>(Fn);
- Function::iterator I = Func->end();
- if (I == Func->begin())
- return 0;
- return wrap(--I);
-}
-
-LLVMBasicBlockRef LLVMGetNextBasicBlock(LLVMBasicBlockRef BB) {
- BasicBlock *Block = unwrap(BB);
- Function::iterator I = Block;
- if (++I == Block->getParent()->end())
- return 0;
- return wrap(I);
-}
-
-LLVMBasicBlockRef LLVMGetPreviousBasicBlock(LLVMBasicBlockRef BB) {
- BasicBlock *Block = unwrap(BB);
- Function::iterator I = Block;
- if (I == Block->getParent()->begin())
- return 0;
- return wrap(--I);
-}
-
-LLVMBasicBlockRef LLVMAppendBasicBlock(LLVMValueRef FnRef, const char *Name) {
- return wrap(BasicBlock::Create(Name, unwrap<Function>(FnRef)));
-}
-
-LLVMBasicBlockRef LLVMInsertBasicBlock(LLVMBasicBlockRef InsertBeforeBBRef,
- const char *Name) {
- BasicBlock *InsertBeforeBB = unwrap(InsertBeforeBBRef);
- return wrap(BasicBlock::Create(Name, InsertBeforeBB->getParent(),
- InsertBeforeBB));
-}
-
-void LLVMDeleteBasicBlock(LLVMBasicBlockRef BBRef) {
- unwrap(BBRef)->eraseFromParent();
-}
-
-/*--.. Operations on instructions ..........................................--*/
-
-LLVMBasicBlockRef LLVMGetInstructionParent(LLVMValueRef Inst) {
- return wrap(unwrap<Instruction>(Inst)->getParent());
-}
-
-LLVMValueRef LLVMGetFirstInstruction(LLVMBasicBlockRef BB) {
- BasicBlock *Block = unwrap(BB);
- BasicBlock::iterator I = Block->begin();
- if (I == Block->end())
- return 0;
- return wrap(I);
-}
-
-LLVMValueRef LLVMGetLastInstruction(LLVMBasicBlockRef BB) {
- BasicBlock *Block = unwrap(BB);
- BasicBlock::iterator I = Block->end();
- if (I == Block->begin())
- return 0;
- return wrap(--I);
-}
-
-LLVMValueRef LLVMGetNextInstruction(LLVMValueRef Inst) {
- Instruction *Instr = unwrap<Instruction>(Inst);
- BasicBlock::iterator I = Instr;
- if (++I == Instr->getParent()->end())
- return 0;
- return wrap(I);
-}
-
-LLVMValueRef LLVMGetPreviousInstruction(LLVMValueRef Inst) {
- Instruction *Instr = unwrap<Instruction>(Inst);
- BasicBlock::iterator I = Instr;
- if (I == Instr->getParent()->begin())
- return 0;
- return wrap(--I);
-}
-
-/*--.. Call and invoke instructions ........................................--*/
-
-unsigned LLVMGetInstructionCallConv(LLVMValueRef Instr) {
- Value *V = unwrap(Instr);
- if (CallInst *CI = dyn_cast<CallInst>(V))
- return CI->getCallingConv();
- else if (InvokeInst *II = dyn_cast<InvokeInst>(V))
- return II->getCallingConv();
- assert(0 && "LLVMGetInstructionCallConv applies only to call and invoke!");
- return 0;
-}
-
-void LLVMSetInstructionCallConv(LLVMValueRef Instr, unsigned CC) {
- Value *V = unwrap(Instr);
- if (CallInst *CI = dyn_cast<CallInst>(V))
- return CI->setCallingConv(CC);
- else if (InvokeInst *II = dyn_cast<InvokeInst>(V))
- return II->setCallingConv(CC);
- assert(0 && "LLVMSetInstructionCallConv applies only to call and invoke!");
-}
-
-void LLVMAddInstrParamAttr(LLVMValueRef Instr, unsigned index,
- LLVMParamAttr PA) {
- CallSite Call = CallSite(unwrap<Instruction>(Instr));
- Call.setParamAttrs(
- Call.getParamAttrs().addAttr(index, PA));
-}
-
-void LLVMRemoveInstrParamAttr(LLVMValueRef Instr, unsigned index,
- LLVMParamAttr PA) {
- CallSite Call = CallSite(unwrap<Instruction>(Instr));
- Call.setParamAttrs(
- Call.getParamAttrs().removeAttr(index, PA));
-}
-
-void LLVMSetInstrParamAlignment(LLVMValueRef Instr, unsigned index,
- unsigned align) {
- CallSite Call = CallSite(unwrap<Instruction>(Instr));
- Call.setParamAttrs(
- Call.getParamAttrs().addAttr(index,
- ParamAttr::constructAlignmentFromInt(align)));
-}
-
-/*--.. Operations on phi nodes .............................................--*/
-
-void LLVMAddIncoming(LLVMValueRef PhiNode, LLVMValueRef *IncomingValues,
- LLVMBasicBlockRef *IncomingBlocks, unsigned Count) {
- PHINode *PhiVal = unwrap<PHINode>(PhiNode);
- for (unsigned I = 0; I != Count; ++I)
- PhiVal->addIncoming(unwrap(IncomingValues[I]), unwrap(IncomingBlocks[I]));
-}
-
-unsigned LLVMCountIncoming(LLVMValueRef PhiNode) {
- return unwrap<PHINode>(PhiNode)->getNumIncomingValues();
-}
-
-LLVMValueRef LLVMGetIncomingValue(LLVMValueRef PhiNode, unsigned Index) {
- return wrap(unwrap<PHINode>(PhiNode)->getIncomingValue(Index));
-}
-
-LLVMBasicBlockRef LLVMGetIncomingBlock(LLVMValueRef PhiNode, unsigned Index) {
- return wrap(unwrap<PHINode>(PhiNode)->getIncomingBlock(Index));
-}
-
-
-/*===-- Instruction builders ----------------------------------------------===*/
-
-LLVMBuilderRef LLVMCreateBuilder(void) {
- return wrap(new IRBuilder());
-}
-
-void LLVMPositionBuilder(LLVMBuilderRef Builder, LLVMBasicBlockRef Block,
- LLVMValueRef Instr) {
- BasicBlock *BB = unwrap(Block);
- Instruction *I = Instr? unwrap<Instruction>(Instr) : (Instruction*) BB->end();
- unwrap(Builder)->SetInsertPoint(BB, I);
-}
-
-void LLVMPositionBuilderBefore(LLVMBuilderRef Builder, LLVMValueRef Instr) {
- Instruction *I = unwrap<Instruction>(Instr);
- unwrap(Builder)->SetInsertPoint(I->getParent(), I);
-}
-
-void LLVMPositionBuilderAtEnd(LLVMBuilderRef Builder, LLVMBasicBlockRef Block) {
- BasicBlock *BB = unwrap(Block);
- unwrap(Builder)->SetInsertPoint(BB);
-}
-
-LLVMBasicBlockRef LLVMGetInsertBlock(LLVMBuilderRef Builder) {
- return wrap(unwrap(Builder)->GetInsertBlock());
-}
-
-void LLVMDisposeBuilder(LLVMBuilderRef Builder) {
- delete unwrap(Builder);
-}
-
-/*--.. Instruction builders ................................................--*/
-
-LLVMValueRef LLVMBuildRetVoid(LLVMBuilderRef B) {
- return wrap(unwrap(B)->CreateRetVoid());
-}
-
-LLVMValueRef LLVMBuildRet(LLVMBuilderRef B, LLVMValueRef V) {
- return wrap(unwrap(B)->CreateRet(unwrap(V)));
-}
-
-LLVMValueRef LLVMBuildBr(LLVMBuilderRef B, LLVMBasicBlockRef Dest) {
- return wrap(unwrap(B)->CreateBr(unwrap(Dest)));
-}
-
-LLVMValueRef LLVMBuildCondBr(LLVMBuilderRef B, LLVMValueRef If,
- LLVMBasicBlockRef Then, LLVMBasicBlockRef Else) {
- return wrap(unwrap(B)->CreateCondBr(unwrap(If), unwrap(Then), unwrap(Else)));
-}
-
-LLVMValueRef LLVMBuildSwitch(LLVMBuilderRef B, LLVMValueRef V,
- LLVMBasicBlockRef Else, unsigned NumCases) {
- return wrap(unwrap(B)->CreateSwitch(unwrap(V), unwrap(Else), NumCases));
-}
-
-LLVMValueRef LLVMBuildInvoke(LLVMBuilderRef B, LLVMValueRef Fn,
- LLVMValueRef *Args, unsigned NumArgs,
- LLVMBasicBlockRef Then, LLVMBasicBlockRef Catch,
- const char *Name) {
- return wrap(unwrap(B)->CreateInvoke(unwrap(Fn), unwrap(Then), unwrap(Catch),
- unwrap(Args), unwrap(Args) + NumArgs,
- Name));
-}
-
-LLVMValueRef LLVMBuildUnwind(LLVMBuilderRef B) {
- return wrap(unwrap(B)->CreateUnwind());
-}
-
-LLVMValueRef LLVMBuildUnreachable(LLVMBuilderRef B) {
- return wrap(unwrap(B)->CreateUnreachable());
-}
-
-void LLVMAddCase(LLVMValueRef Switch, LLVMValueRef OnVal,
- LLVMBasicBlockRef Dest) {
- unwrap<SwitchInst>(Switch)->addCase(unwrap<ConstantInt>(OnVal), unwrap(Dest));
-}
-
-/*--.. Arithmetic ..........................................................--*/
-
-LLVMValueRef LLVMBuildAdd(LLVMBuilderRef B, LLVMValueRef LHS, LLVMValueRef RHS,
- const char *Name) {
- return wrap(unwrap(B)->CreateAdd(unwrap(LHS), unwrap(RHS), Name));
-}
-
-LLVMValueRef LLVMBuildSub(LLVMBuilderRef B, LLVMValueRef LHS, LLVMValueRef RHS,
- const char *Name) {
- return wrap(unwrap(B)->CreateSub(unwrap(LHS), unwrap(RHS), Name));
-}
-
-LLVMValueRef LLVMBuildMul(LLVMBuilderRef B, LLVMValueRef LHS, LLVMValueRef RHS,
- const char *Name) {
- return wrap(unwrap(B)->CreateMul(unwrap(LHS), unwrap(RHS), Name));
-}
-
-LLVMValueRef LLVMBuildUDiv(LLVMBuilderRef B, LLVMValueRef LHS, LLVMValueRef RHS,
- const char *Name) {
- return wrap(unwrap(B)->CreateUDiv(unwrap(LHS), unwrap(RHS), Name));
-}
-
-LLVMValueRef LLVMBuildSDiv(LLVMBuilderRef B, LLVMValueRef LHS, LLVMValueRef RHS,
- const char *Name) {
- return wrap(unwrap(B)->CreateSDiv(unwrap(LHS), unwrap(RHS), Name));
-}
-
-LLVMValueRef LLVMBuildFDiv(LLVMBuilderRef B, LLVMValueRef LHS, LLVMValueRef RHS,
- const char *Name) {
- return wrap(unwrap(B)->CreateFDiv(unwrap(LHS), unwrap(RHS), Name));
-}
-
-LLVMValueRef LLVMBuildURem(LLVMBuilderRef B, LLVMValueRef LHS, LLVMValueRef RHS,
- const char *Name) {
- return wrap(unwrap(B)->CreateURem(unwrap(LHS), unwrap(RHS), Name));
-}
-
-LLVMValueRef LLVMBuildSRem(LLVMBuilderRef B, LLVMValueRef LHS, LLVMValueRef RHS,
- const char *Name) {
- return wrap(unwrap(B)->CreateSRem(unwrap(LHS), unwrap(RHS), Name));
-}
-
-LLVMValueRef LLVMBuildFRem(LLVMBuilderRef B, LLVMValueRef LHS, LLVMValueRef RHS,
- const char *Name) {
- return wrap(unwrap(B)->CreateFRem(unwrap(LHS), unwrap(RHS), Name));
-}
-
-LLVMValueRef LLVMBuildShl(LLVMBuilderRef B, LLVMValueRef LHS, LLVMValueRef RHS,
- const char *Name) {
- return wrap(unwrap(B)->CreateShl(unwrap(LHS), unwrap(RHS), Name));
-}
-
-LLVMValueRef LLVMBuildLShr(LLVMBuilderRef B, LLVMValueRef LHS, LLVMValueRef RHS,
- const char *Name) {
- return wrap(unwrap(B)->CreateLShr(unwrap(LHS), unwrap(RHS), Name));
-}
-
-LLVMValueRef LLVMBuildAShr(LLVMBuilderRef B, LLVMValueRef LHS, LLVMValueRef RHS,
- const char *Name) {
- return wrap(unwrap(B)->CreateAShr(unwrap(LHS), unwrap(RHS), Name));
-}
-
-LLVMValueRef LLVMBuildAnd(LLVMBuilderRef B, LLVMValueRef LHS, LLVMValueRef RHS,
- const char *Name) {
- return wrap(unwrap(B)->CreateAnd(unwrap(LHS), unwrap(RHS), Name));
-}
-
-LLVMValueRef LLVMBuildOr(LLVMBuilderRef B, LLVMValueRef LHS, LLVMValueRef RHS,
- const char *Name) {
- return wrap(unwrap(B)->CreateOr(unwrap(LHS), unwrap(RHS), Name));
-}
-
-LLVMValueRef LLVMBuildXor(LLVMBuilderRef B, LLVMValueRef LHS, LLVMValueRef RHS,
- const char *Name) {
- return wrap(unwrap(B)->CreateXor(unwrap(LHS), unwrap(RHS), Name));
-}
-
-LLVMValueRef LLVMBuildNeg(LLVMBuilderRef B, LLVMValueRef V, const char *Name) {
- return wrap(unwrap(B)->CreateNeg(unwrap(V), Name));
-}
-
-LLVMValueRef LLVMBuildNot(LLVMBuilderRef B, LLVMValueRef V, const char *Name) {
- return wrap(unwrap(B)->CreateNot(unwrap(V), Name));
-}
-
-/*--.. Memory ..............................................................--*/
-
-LLVMValueRef LLVMBuildMalloc(LLVMBuilderRef B, LLVMTypeRef Ty,
- const char *Name) {
- return wrap(unwrap(B)->CreateMalloc(unwrap(Ty), 0, Name));
-}
-
-LLVMValueRef LLVMBuildArrayMalloc(LLVMBuilderRef B, LLVMTypeRef Ty,
- LLVMValueRef Val, const char *Name) {
- return wrap(unwrap(B)->CreateMalloc(unwrap(Ty), unwrap(Val), Name));
-}
-
-LLVMValueRef LLVMBuildAlloca(LLVMBuilderRef B, LLVMTypeRef Ty,
- const char *Name) {
- return wrap(unwrap(B)->CreateAlloca(unwrap(Ty), 0, Name));
-}
-
-LLVMValueRef LLVMBuildArrayAlloca(LLVMBuilderRef B, LLVMTypeRef Ty,
- LLVMValueRef Val, const char *Name) {
- return wrap(unwrap(B)->CreateAlloca(unwrap(Ty), unwrap(Val), Name));
-}
-
-LLVMValueRef LLVMBuildFree(LLVMBuilderRef B, LLVMValueRef PointerVal) {
- return wrap(unwrap(B)->CreateFree(unwrap(PointerVal)));
-}
-
-
-LLVMValueRef LLVMBuildLoad(LLVMBuilderRef B, LLVMValueRef PointerVal,
- const char *Name) {
- return wrap(unwrap(B)->CreateLoad(unwrap(PointerVal), Name));
-}
-
-LLVMValueRef LLVMBuildStore(LLVMBuilderRef B, LLVMValueRef Val,
- LLVMValueRef PointerVal) {
- return wrap(unwrap(B)->CreateStore(unwrap(Val), unwrap(PointerVal)));
-}
-
-LLVMValueRef LLVMBuildGEP(LLVMBuilderRef B, LLVMValueRef Pointer,
- LLVMValueRef *Indices, unsigned NumIndices,
- const char *Name) {
- return wrap(unwrap(B)->CreateGEP(unwrap(Pointer), unwrap(Indices),
- unwrap(Indices) + NumIndices, Name));
-}
-
-/*--.. Casts ...............................................................--*/
-
-LLVMValueRef LLVMBuildTrunc(LLVMBuilderRef B, LLVMValueRef Val,
- LLVMTypeRef DestTy, const char *Name) {
- return wrap(unwrap(B)->CreateTrunc(unwrap(Val), unwrap(DestTy), Name));
-}
-
-LLVMValueRef LLVMBuildZExt(LLVMBuilderRef B, LLVMValueRef Val,
- LLVMTypeRef DestTy, const char *Name) {
- return wrap(unwrap(B)->CreateZExt(unwrap(Val), unwrap(DestTy), Name));
-}
-
-LLVMValueRef LLVMBuildSExt(LLVMBuilderRef B, LLVMValueRef Val,
- LLVMTypeRef DestTy, const char *Name) {
- return wrap(unwrap(B)->CreateSExt(unwrap(Val), unwrap(DestTy), Name));
-}
-
-LLVMValueRef LLVMBuildFPToUI(LLVMBuilderRef B, LLVMValueRef Val,
- LLVMTypeRef DestTy, const char *Name) {
- return wrap(unwrap(B)->CreateFPToUI(unwrap(Val), unwrap(DestTy), Name));
-}
-
-LLVMValueRef LLVMBuildFPToSI(LLVMBuilderRef B, LLVMValueRef Val,
- LLVMTypeRef DestTy, const char *Name) {
- return wrap(unwrap(B)->CreateFPToSI(unwrap(Val), unwrap(DestTy), Name));
-}
-
-LLVMValueRef LLVMBuildUIToFP(LLVMBuilderRef B, LLVMValueRef Val,
- LLVMTypeRef DestTy, const char *Name) {
- return wrap(unwrap(B)->CreateUIToFP(unwrap(Val), unwrap(DestTy), Name));
-}
-
-LLVMValueRef LLVMBuildSIToFP(LLVMBuilderRef B, LLVMValueRef Val,
- LLVMTypeRef DestTy, const char *Name) {
- return wrap(unwrap(B)->CreateSIToFP(unwrap(Val), unwrap(DestTy), Name));
-}
-
-LLVMValueRef LLVMBuildFPTrunc(LLVMBuilderRef B, LLVMValueRef Val,
- LLVMTypeRef DestTy, const char *Name) {
- return wrap(unwrap(B)->CreateFPTrunc(unwrap(Val), unwrap(DestTy), Name));
-}
-
-LLVMValueRef LLVMBuildFPExt(LLVMBuilderRef B, LLVMValueRef Val,
- LLVMTypeRef DestTy, const char *Name) {
- return wrap(unwrap(B)->CreateFPExt(unwrap(Val), unwrap(DestTy), Name));
-}
-
-LLVMValueRef LLVMBuildPtrToInt(LLVMBuilderRef B, LLVMValueRef Val,
- LLVMTypeRef DestTy, const char *Name) {
- return wrap(unwrap(B)->CreatePtrToInt(unwrap(Val), unwrap(DestTy), Name));
-}
-
-LLVMValueRef LLVMBuildIntToPtr(LLVMBuilderRef B, LLVMValueRef Val,
- LLVMTypeRef DestTy, const char *Name) {
- return wrap(unwrap(B)->CreateIntToPtr(unwrap(Val), unwrap(DestTy), Name));
-}
-
-LLVMValueRef LLVMBuildBitCast(LLVMBuilderRef B, LLVMValueRef Val,
- LLVMTypeRef DestTy, const char *Name) {
- return wrap(unwrap(B)->CreateBitCast(unwrap(Val), unwrap(DestTy), Name));
-}
-
-/*--.. Comparisons .........................................................--*/
-
-LLVMValueRef LLVMBuildICmp(LLVMBuilderRef B, LLVMIntPredicate Op,
- LLVMValueRef LHS, LLVMValueRef RHS,
- const char *Name) {
- return wrap(unwrap(B)->CreateICmp(static_cast<ICmpInst::Predicate>(Op),
- unwrap(LHS), unwrap(RHS), Name));
-}
-
-LLVMValueRef LLVMBuildFCmp(LLVMBuilderRef B, LLVMRealPredicate Op,
- LLVMValueRef LHS, LLVMValueRef RHS,
- const char *Name) {
- return wrap(unwrap(B)->CreateFCmp(static_cast<FCmpInst::Predicate>(Op),
- unwrap(LHS), unwrap(RHS), Name));
-}
-
-/*--.. Miscellaneous instructions ..........................................--*/
-
-LLVMValueRef LLVMBuildPhi(LLVMBuilderRef B, LLVMTypeRef Ty, const char *Name) {
- return wrap(unwrap(B)->CreatePHI(unwrap(Ty), Name));
-}
-
-LLVMValueRef LLVMBuildCall(LLVMBuilderRef B, LLVMValueRef Fn,
- LLVMValueRef *Args, unsigned NumArgs,
- const char *Name) {
- return wrap(unwrap(B)->CreateCall(unwrap(Fn), unwrap(Args),
- unwrap(Args) + NumArgs, Name));
-}
-
-LLVMValueRef LLVMBuildSelect(LLVMBuilderRef B, LLVMValueRef If,
- LLVMValueRef Then, LLVMValueRef Else,
- const char *Name) {
- return wrap(unwrap(B)->CreateSelect(unwrap(If), unwrap(Then), unwrap(Else),
- Name));
-}
-
-LLVMValueRef LLVMBuildVAArg(LLVMBuilderRef B, LLVMValueRef List,
- LLVMTypeRef Ty, const char *Name) {
- return wrap(unwrap(B)->CreateVAArg(unwrap(List), unwrap(Ty), Name));
-}
-
-LLVMValueRef LLVMBuildExtractElement(LLVMBuilderRef B, LLVMValueRef VecVal,
- LLVMValueRef Index, const char *Name) {
- return wrap(unwrap(B)->CreateExtractElement(unwrap(VecVal), unwrap(Index),
- Name));
-}
-
-LLVMValueRef LLVMBuildInsertElement(LLVMBuilderRef B, LLVMValueRef VecVal,
- LLVMValueRef EltVal, LLVMValueRef Index,
- const char *Name) {
- return wrap(unwrap(B)->CreateInsertElement(unwrap(VecVal), unwrap(EltVal),
- unwrap(Index), Name));
-}
-
-LLVMValueRef LLVMBuildShuffleVector(LLVMBuilderRef B, LLVMValueRef V1,
- LLVMValueRef V2, LLVMValueRef Mask,
- const char *Name) {
- return wrap(unwrap(B)->CreateShuffleVector(unwrap(V1), unwrap(V2),
- unwrap(Mask), Name));
-}
-
-
-/*===-- Module providers --------------------------------------------------===*/
-
-LLVMModuleProviderRef
-LLVMCreateModuleProviderForExistingModule(LLVMModuleRef M) {
- return wrap(new ExistingModuleProvider(unwrap(M)));
-}
-
-void LLVMDisposeModuleProvider(LLVMModuleProviderRef MP) {
- delete unwrap(MP);
-}
-
-
-/*===-- Memory buffers ----------------------------------------------------===*/
-
-int LLVMCreateMemoryBufferWithContentsOfFile(const char *Path,
- LLVMMemoryBufferRef *OutMemBuf,
- char **OutMessage) {
- std::string Error;
- if (MemoryBuffer *MB = MemoryBuffer::getFile(Path, &Error)) {
- *OutMemBuf = wrap(MB);
- return 0;
- }
-
- *OutMessage = strdup(Error.c_str());
- return 1;
-}
-
-int LLVMCreateMemoryBufferWithSTDIN(LLVMMemoryBufferRef *OutMemBuf,
- char **OutMessage) {
- if (MemoryBuffer *MB = MemoryBuffer::getSTDIN()) {
- *OutMemBuf = wrap(MB);
- return 0;
- }
-
- *OutMessage = strdup("stdin is empty.");
- return 1;
-}
-
-void LLVMDisposeMemoryBuffer(LLVMMemoryBufferRef MemBuf) {
- delete unwrap(MemBuf);
-}
diff --git a/release_23/lib/VMCore/Dominators.cpp b/release_23/lib/VMCore/Dominators.cpp
deleted file mode 100644
index 5aa3f34e876e..000000000000
--- a/release_23/lib/VMCore/Dominators.cpp
+++ /dev/null
@@ -1,288 +0,0 @@
-//===- Dominators.cpp - Dominator Calculation -----------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements simple dominator construction algorithms for finding
-// forward dominators. Postdominators are available in libanalysis, but are not
-// included in libvmcore, because it's not needed. Forward dominators are
-// needed to support the Verifier pass.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Analysis/Dominators.h"
-#include "llvm/Support/CFG.h"
-#include "llvm/Support/Compiler.h"
-#include "llvm/ADT/DepthFirstIterator.h"
-#include "llvm/ADT/SetOperations.h"
-#include "llvm/ADT/SmallPtrSet.h"
-#include "llvm/ADT/SmallVector.h"
-#include "llvm/Analysis/DominatorInternals.h"
-#include "llvm/Instructions.h"
-#include "llvm/Support/Streams.h"
-#include <algorithm>
-using namespace llvm;
-
-namespace llvm {
-static std::ostream &operator<<(std::ostream &o,
- const std::set<BasicBlock*> &BBs) {
- for (std::set<BasicBlock*>::const_iterator I = BBs.begin(), E = BBs.end();
- I != E; ++I)
- if (*I)
- WriteAsOperand(o, *I, false);
- else
- o << " <<exit node>>";
- return o;
-}
-}
-
-//===----------------------------------------------------------------------===//
-// DominatorTree Implementation
-//===----------------------------------------------------------------------===//
-//
-// Provide public access to DominatorTree information. Implementation details
-// can be found in DominatorCalculation.h.
-//
-//===----------------------------------------------------------------------===//
-
-TEMPLATE_INSTANTIATION(class DomTreeNodeBase<BasicBlock>);
-TEMPLATE_INSTANTIATION(class DominatorTreeBase<BasicBlock>);
-
-char DominatorTree::ID = 0;
-static RegisterPass<DominatorTree>
-E("domtree", "Dominator Tree Construction", true, true);
-
-bool DominatorTree::runOnFunction(Function &F) {
- DT->recalculate(F);
- return false;
-}
-
-//===----------------------------------------------------------------------===//
-// DominanceFrontier Implementation
-//===----------------------------------------------------------------------===//
-
-char DominanceFrontier::ID = 0;
-static RegisterPass<DominanceFrontier>
-G("domfrontier", "Dominance Frontier Construction", false, true);
-
-// NewBB is split and now it has one successor. Update dominace frontier to
-// reflect this change.
-void DominanceFrontier::splitBlock(BasicBlock *NewBB) {
- assert(NewBB->getTerminator()->getNumSuccessors() == 1
- && "NewBB should have a single successor!");
- BasicBlock *NewBBSucc = NewBB->getTerminator()->getSuccessor(0);
-
- std::vector<BasicBlock*> PredBlocks;
- for (pred_iterator PI = pred_begin(NewBB), PE = pred_end(NewBB);
- PI != PE; ++PI)
- PredBlocks.push_back(*PI);
-
- if (PredBlocks.empty())
- // If NewBB does not have any predecessors then it is a entry block.
- // In this case, NewBB and its successor NewBBSucc dominates all
- // other blocks.
- return;
-
- // NewBBSucc inherits original NewBB frontier.
- DominanceFrontier::iterator NewBBI = find(NewBB);
- if (NewBBI != end()) {
- DominanceFrontier::DomSetType NewBBSet = NewBBI->second;
- DominanceFrontier::DomSetType NewBBSuccSet;
- NewBBSuccSet.insert(NewBBSet.begin(), NewBBSet.end());
- addBasicBlock(NewBBSucc, NewBBSuccSet);
- }
-
- // If NewBB dominates NewBBSucc, then DF(NewBB) is now going to be the
- // DF(PredBlocks[0]) without the stuff that the new block does not dominate
- // a predecessor of.
- DominatorTree &DT = getAnalysis<DominatorTree>();
- if (DT.dominates(NewBB, NewBBSucc)) {
- DominanceFrontier::iterator DFI = find(PredBlocks[0]);
- if (DFI != end()) {
- DominanceFrontier::DomSetType Set = DFI->second;
- // Filter out stuff in Set that we do not dominate a predecessor of.
- for (DominanceFrontier::DomSetType::iterator SetI = Set.begin(),
- E = Set.end(); SetI != E;) {
- bool DominatesPred = false;
- for (pred_iterator PI = pred_begin(*SetI), E = pred_end(*SetI);
- PI != E; ++PI)
- if (DT.dominates(NewBB, *PI))
- DominatesPred = true;
- if (!DominatesPred)
- Set.erase(SetI++);
- else
- ++SetI;
- }
-
- if (NewBBI != end()) {
- for (DominanceFrontier::DomSetType::iterator SetI = Set.begin(),
- E = Set.end(); SetI != E; ++SetI) {
- BasicBlock *SB = *SetI;
- addToFrontier(NewBBI, SB);
- }
- } else
- addBasicBlock(NewBB, Set);
- }
-
- } else {
- // DF(NewBB) is {NewBBSucc} because NewBB does not strictly dominate
- // NewBBSucc, but it does dominate itself (and there is an edge (NewBB ->
- // NewBBSucc)). NewBBSucc is the single successor of NewBB.
- DominanceFrontier::DomSetType NewDFSet;
- NewDFSet.insert(NewBBSucc);
- addBasicBlock(NewBB, NewDFSet);
- }
-
- // Now we must loop over all of the dominance frontiers in the function,
- // replacing occurrences of NewBBSucc with NewBB in some cases. All
- // blocks that dominate a block in PredBlocks and contained NewBBSucc in
- // their dominance frontier must be updated to contain NewBB instead.
- //
- for (Function::iterator FI = NewBB->getParent()->begin(),
- FE = NewBB->getParent()->end(); FI != FE; ++FI) {
- DominanceFrontier::iterator DFI = find(FI);
- if (DFI == end()) continue; // unreachable block.
-
- // Only consider nodes that have NewBBSucc in their dominator frontier.
- if (!DFI->second.count(NewBBSucc)) continue;
-
- // Verify whether this block dominates a block in predblocks. If not, do
- // not update it.
- bool BlockDominatesAny = false;
- for (std::vector<BasicBlock*>::const_iterator BI = PredBlocks.begin(),
- BE = PredBlocks.end(); BI != BE; ++BI) {
- if (DT.dominates(FI, *BI)) {
- BlockDominatesAny = true;
- break;
- }
- }
-
- if (!BlockDominatesAny)
- continue;
-
- // If NewBBSucc should not stay in our dominator frontier, remove it.
- // We remove it unless there is a predecessor of NewBBSucc that we
- // dominate, but we don't strictly dominate NewBBSucc.
- bool ShouldRemove = true;
- if ((BasicBlock*)FI == NewBBSucc || !DT.dominates(FI, NewBBSucc)) {
- // Okay, we know that PredDom does not strictly dominate NewBBSucc.
- // Check to see if it dominates any predecessors of NewBBSucc.
- for (pred_iterator PI = pred_begin(NewBBSucc),
- E = pred_end(NewBBSucc); PI != E; ++PI)
- if (DT.dominates(FI, *PI)) {
- ShouldRemove = false;
- break;
- }
- }
-
- if (ShouldRemove)
- removeFromFrontier(DFI, NewBBSucc);
- addToFrontier(DFI, NewBB);
- }
-}
-
-namespace {
- class DFCalculateWorkObject {
- public:
- DFCalculateWorkObject(BasicBlock *B, BasicBlock *P,
- const DomTreeNode *N,
- const DomTreeNode *PN)
- : currentBB(B), parentBB(P), Node(N), parentNode(PN) {}
- BasicBlock *currentBB;
- BasicBlock *parentBB;
- const DomTreeNode *Node;
- const DomTreeNode *parentNode;
- };
-}
-
-const DominanceFrontier::DomSetType &
-DominanceFrontier::calculate(const DominatorTree &DT,
- const DomTreeNode *Node) {
- BasicBlock *BB = Node->getBlock();
- DomSetType *Result = NULL;
-
- std::vector<DFCalculateWorkObject> workList;
- SmallPtrSet<BasicBlock *, 32> visited;
-
- workList.push_back(DFCalculateWorkObject(BB, NULL, Node, NULL));
- do {
- DFCalculateWorkObject *currentW = &workList.back();
- assert (currentW && "Missing work object.");
-
- BasicBlock *currentBB = currentW->currentBB;
- BasicBlock *parentBB = currentW->parentBB;
- const DomTreeNode *currentNode = currentW->Node;
- const DomTreeNode *parentNode = currentW->parentNode;
- assert (currentBB && "Invalid work object. Missing current Basic Block");
- assert (currentNode && "Invalid work object. Missing current Node");
- DomSetType &S = Frontiers[currentBB];
-
- // Visit each block only once.
- if (visited.count(currentBB) == 0) {
- visited.insert(currentBB);
-
- // Loop over CFG successors to calculate DFlocal[currentNode]
- for (succ_iterator SI = succ_begin(currentBB), SE = succ_end(currentBB);
- SI != SE; ++SI) {
- // Does Node immediately dominate this successor?
- if (DT[*SI]->getIDom() != currentNode)
- S.insert(*SI);
- }
- }
-
- // At this point, S is DFlocal. Now we union in DFup's of our children...
- // Loop through and visit the nodes that Node immediately dominates (Node's
- // children in the IDomTree)
- bool visitChild = false;
- for (DomTreeNode::const_iterator NI = currentNode->begin(),
- NE = currentNode->end(); NI != NE; ++NI) {
- DomTreeNode *IDominee = *NI;
- BasicBlock *childBB = IDominee->getBlock();
- if (visited.count(childBB) == 0) {
- workList.push_back(DFCalculateWorkObject(childBB, currentBB,
- IDominee, currentNode));
- visitChild = true;
- }
- }
-
- // If all children are visited or there is any child then pop this block
- // from the workList.
- if (!visitChild) {
-
- if (!parentBB) {
- Result = &S;
- break;
- }
-
- DomSetType::const_iterator CDFI = S.begin(), CDFE = S.end();
- DomSetType &parentSet = Frontiers[parentBB];
- for (; CDFI != CDFE; ++CDFI) {
- if (!DT.properlyDominates(parentNode, DT[*CDFI]))
- parentSet.insert(*CDFI);
- }
- workList.pop_back();
- }
-
- } while (!workList.empty());
-
- return *Result;
-}
-
-void DominanceFrontierBase::print(std::ostream &o, const Module* ) const {
- for (const_iterator I = begin(), E = end(); I != E; ++I) {
- o << " DomFrontier for BB";
- if (I->first)
- WriteAsOperand(o, I->first, false);
- else
- o << " <<exit node>>";
- o << " is:\t" << I->second << "\n";
- }
-}
-
-void DominanceFrontierBase::dump() {
- print (llvm::cerr);
-}
diff --git a/release_23/lib/VMCore/Function.cpp b/release_23/lib/VMCore/Function.cpp
deleted file mode 100644
index 546cadb0f3b1..000000000000
--- a/release_23/lib/VMCore/Function.cpp
+++ /dev/null
@@ -1,360 +0,0 @@
-//===-- Function.cpp - Implement the Global object classes ----------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the Function class for the VMCore library.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Module.h"
-#include "llvm/DerivedTypes.h"
-#include "llvm/IntrinsicInst.h"
-#include "llvm/CodeGen/ValueTypes.h"
-#include "llvm/Support/LeakDetector.h"
-#include "llvm/Support/StringPool.h"
-#include "SymbolTableListTraitsImpl.h"
-#include "llvm/ADT/BitVector.h"
-#include "llvm/ADT/DenseMap.h"
-#include "llvm/ADT/StringExtras.h"
-using namespace llvm;
-
-BasicBlock *ilist_traits<BasicBlock>::createSentinel() {
- BasicBlock *Ret = BasicBlock::Create();
- // This should not be garbage monitored.
- LeakDetector::removeGarbageObject(Ret);
- return Ret;
-}
-
-iplist<BasicBlock> &ilist_traits<BasicBlock>::getList(Function *F) {
- return F->getBasicBlockList();
-}
-
-Argument *ilist_traits<Argument>::createSentinel() {
- Argument *Ret = new Argument(Type::Int32Ty);
- // This should not be garbage monitored.
- LeakDetector::removeGarbageObject(Ret);
- return Ret;
-}
-
-iplist<Argument> &ilist_traits<Argument>::getList(Function *F) {
- return F->getArgumentList();
-}
-
-// Explicit instantiations of SymbolTableListTraits since some of the methods
-// are not in the public header file...
-template class SymbolTableListTraits<Argument, Function>;
-template class SymbolTableListTraits<BasicBlock, Function>;
-
-//===----------------------------------------------------------------------===//
-// Argument Implementation
-//===----------------------------------------------------------------------===//
-
-Argument::Argument(const Type *Ty, const std::string &Name, Function *Par)
- : Value(Ty, Value::ArgumentVal) {
- Parent = 0;
-
- // Make sure that we get added to a function
- LeakDetector::addGarbageObject(this);
-
- if (Par)
- Par->getArgumentList().push_back(this);
- setName(Name);
-}
-
-void Argument::setParent(Function *parent) {
- if (getParent())
- LeakDetector::addGarbageObject(this);
- Parent = parent;
- if (getParent())
- LeakDetector::removeGarbageObject(this);
-}
-
-/// getArgNo - Return the index of this formal argument in its containing
-/// function. For example in "void foo(int a, float b)" a is 0 and b is 1.
-unsigned Argument::getArgNo() const {
- const Function *F = getParent();
- assert(F && "Argument is not in a function");
-
- Function::const_arg_iterator AI = F->arg_begin();
- unsigned ArgIdx = 0;
- for (; &*AI != this; ++AI)
- ++ArgIdx;
-
- return ArgIdx;
-}
-
-/// hasByValAttr - Return true if this argument has the byval attribute on it
-/// in its containing function.
-bool Argument::hasByValAttr() const {
- if (!isa<PointerType>(getType())) return false;
- return getParent()->paramHasAttr(getArgNo()+1, ParamAttr::ByVal);
-}
-
-/// hasNoAliasAttr - Return true if this argument has the noalias attribute on
-/// it in its containing function.
-bool Argument::hasNoAliasAttr() const {
- if (!isa<PointerType>(getType())) return false;
- return getParent()->paramHasAttr(getArgNo()+1, ParamAttr::NoAlias);
-}
-
-/// hasSRetAttr - Return true if this argument has the sret attribute on
-/// it in its containing function.
-bool Argument::hasStructRetAttr() const {
- if (!isa<PointerType>(getType())) return false;
- if (this != getParent()->arg_begin()) return false; // StructRet param must be first param
- return getParent()->paramHasAttr(1, ParamAttr::StructRet);
-}
-
-/// addAttr - Add a ParamAttr to an argument
-void Argument::addAttr(ParameterAttributes attr) {
- getParent()->setParamAttrs(
- getParent()->getParamAttrs().addAttr(getArgNo() + 1, attr));
-}
-
-/// removeAttr - Remove a ParamAttr from an argument
-void Argument::removeAttr(ParameterAttributes attr) {
- getParent()->setParamAttrs(
- getParent()->getParamAttrs().removeAttr(getArgNo() + 1, attr));
-}
-
-
-
-//===----------------------------------------------------------------------===//
-// Helper Methods in Function
-//===----------------------------------------------------------------------===//
-
-const FunctionType *Function::getFunctionType() const {
- return cast<FunctionType>(getType()->getElementType());
-}
-
-bool Function::isVarArg() const {
- return getFunctionType()->isVarArg();
-}
-
-const Type *Function::getReturnType() const {
- return getFunctionType()->getReturnType();
-}
-
-void Function::removeFromParent() {
- getParent()->getFunctionList().remove(this);
-}
-
-void Function::eraseFromParent() {
- getParent()->getFunctionList().erase(this);
-}
-
-//===----------------------------------------------------------------------===//
-// Function Implementation
-//===----------------------------------------------------------------------===//
-
-Function::Function(const FunctionType *Ty, LinkageTypes Linkage,
- const std::string &name, Module *ParentModule)
- : GlobalValue(PointerType::getUnqual(Ty),
- Value::FunctionVal, 0, 0, Linkage, name) {
- SymTab = new ValueSymbolTable();
-
- assert((getReturnType()->isFirstClassType() ||getReturnType() == Type::VoidTy
- || isa<StructType>(getReturnType()))
- && "LLVM functions cannot return aggregate values!");
-
- // If the function has arguments, mark them as lazily built.
- if (Ty->getNumParams())
- SubclassData = 1; // Set the "has lazy arguments" bit.
-
- // Make sure that we get added to a function
- LeakDetector::addGarbageObject(this);
-
- if (ParentModule)
- ParentModule->getFunctionList().push_back(this);
-
- // Ensure intrinsics have the right parameter attributes.
- if (unsigned IID = getIntrinsicID(true))
- setParamAttrs(Intrinsic::getParamAttrs(Intrinsic::ID(IID)));
-}
-
-Function::~Function() {
- dropAllReferences(); // After this it is safe to delete instructions.
-
- // Delete all of the method arguments and unlink from symbol table...
- ArgumentList.clear();
- delete SymTab;
-
- // Remove the function from the on-the-side collector table.
- clearCollector();
-}
-
-void Function::BuildLazyArguments() const {
- // Create the arguments vector, all arguments start out unnamed.
- const FunctionType *FT = getFunctionType();
- for (unsigned i = 0, e = FT->getNumParams(); i != e; ++i) {
- assert(FT->getParamType(i) != Type::VoidTy &&
- "Cannot have void typed arguments!");
- ArgumentList.push_back(new Argument(FT->getParamType(i)));
- }
-
- // Clear the lazy arguments bit.
- const_cast<Function*>(this)->SubclassData &= ~1;
-}
-
-size_t Function::arg_size() const {
- return getFunctionType()->getNumParams();
-}
-bool Function::arg_empty() const {
- return getFunctionType()->getNumParams() == 0;
-}
-
-void Function::setParent(Module *parent) {
- if (getParent())
- LeakDetector::addGarbageObject(this);
- Parent = parent;
- if (getParent())
- LeakDetector::removeGarbageObject(this);
-}
-
-// dropAllReferences() - This function causes all the subinstructions to "let
-// go" of all references that they are maintaining. This allows one to
-// 'delete' a whole class at a time, even though there may be circular
-// references... first all references are dropped, and all use counts go to
-// zero. Then everything is deleted for real. Note that no operations are
-// valid on an object that has "dropped all references", except operator
-// delete.
-//
-void Function::dropAllReferences() {
- for (iterator I = begin(), E = end(); I != E; ++I)
- I->dropAllReferences();
- BasicBlocks.clear(); // Delete all basic blocks...
-}
-
-void Function::setDoesNotThrow(bool doesNotThrow) {
- PAListPtr PAL = getParamAttrs();
- if (doesNotThrow)
- PAL = PAL.addAttr(0, ParamAttr::NoUnwind);
- else
- PAL = PAL.removeAttr(0, ParamAttr::NoUnwind);
- setParamAttrs(PAL);
-}
-
-// Maintain the collector name for each function in an on-the-side table. This
-// saves allocating an additional word in Function for programs which do not use
-// GC (i.e., most programs) at the cost of increased overhead for clients which
-// do use GC.
-static DenseMap<const Function*,PooledStringPtr> *CollectorNames;
-static StringPool *CollectorNamePool;
-
-bool Function::hasCollector() const {
- return CollectorNames && CollectorNames->count(this);
-}
-
-const char *Function::getCollector() const {
- assert(hasCollector() && "Function has no collector");
- return *(*CollectorNames)[this];
-}
-
-void Function::setCollector(const char *Str) {
- if (!CollectorNamePool)
- CollectorNamePool = new StringPool();
- if (!CollectorNames)
- CollectorNames = new DenseMap<const Function*,PooledStringPtr>();
- (*CollectorNames)[this] = CollectorNamePool->intern(Str);
-}
-
-void Function::clearCollector() {
- if (CollectorNames) {
- CollectorNames->erase(this);
- if (CollectorNames->empty()) {
- delete CollectorNames;
- CollectorNames = 0;
- if (CollectorNamePool->empty()) {
- delete CollectorNamePool;
- CollectorNamePool = 0;
- }
- }
- }
-}
-
-/// getIntrinsicID - This method returns the ID number of the specified
-/// function, or Intrinsic::not_intrinsic if the function is not an
-/// intrinsic, or if the pointer is null. This value is always defined to be
-/// zero to allow easy checking for whether a function is intrinsic or not. The
-/// particular intrinsic functions which correspond to this value are defined in
-/// llvm/Intrinsics.h.
-///
-unsigned Function::getIntrinsicID(bool noAssert) const {
- const ValueName *ValName = this->getValueName();
- if (!ValName)
- return 0;
- unsigned Len = ValName->getKeyLength();
- const char *Name = ValName->getKeyData();
-
- if (Len < 5 || Name[4] != '.' || Name[0] != 'l' || Name[1] != 'l'
- || Name[2] != 'v' || Name[3] != 'm')
- return 0; // All intrinsics start with 'llvm.'
-
- assert((Len != 5 || noAssert) && "'llvm.' is an invalid intrinsic name!");
-
-#define GET_FUNCTION_RECOGNIZER
-#include "llvm/Intrinsics.gen"
-#undef GET_FUNCTION_RECOGNIZER
- assert(noAssert && "Invalid LLVM intrinsic name");
- return 0;
-}
-
-std::string Intrinsic::getName(ID id, const Type **Tys, unsigned numTys) {
- assert(id < num_intrinsics && "Invalid intrinsic ID!");
- const char * const Table[] = {
- "not_intrinsic",
-#define GET_INTRINSIC_NAME_TABLE
-#include "llvm/Intrinsics.gen"
-#undef GET_INTRINSIC_NAME_TABLE
- };
- if (numTys == 0)
- return Table[id];
- std::string Result(Table[id]);
- for (unsigned i = 0; i < numTys; ++i)
- if (Tys[i])
- Result += "." + MVT::getValueTypeString(MVT::getValueType(Tys[i]));
- return Result;
-}
-
-const FunctionType *Intrinsic::getType(ID id, const Type **Tys,
- unsigned numTys) {
- const Type *ResultTy = NULL;
- std::vector<const Type*> ArgTys;
- bool IsVarArg = false;
-
-#define GET_INTRINSIC_GENERATOR
-#include "llvm/Intrinsics.gen"
-#undef GET_INTRINSIC_GENERATOR
-
- return FunctionType::get(ResultTy, ArgTys, IsVarArg);
-}
-
-PAListPtr Intrinsic::getParamAttrs(ID id) {
- ParameterAttributes Attr = ParamAttr::None;
-
-#define GET_INTRINSIC_ATTRIBUTES
-#include "llvm/Intrinsics.gen"
-#undef GET_INTRINSIC_ATTRIBUTES
-
- // Intrinsics cannot throw exceptions.
- Attr |= ParamAttr::NoUnwind;
-
- ParamAttrsWithIndex PAWI = ParamAttrsWithIndex::get(0, Attr);
- return PAListPtr::get(&PAWI, 1);
-}
-
-Function *Intrinsic::getDeclaration(Module *M, ID id, const Type **Tys,
- unsigned numTys) {
- // There can never be multiple globals with the same name of different types,
- // because intrinsics must be a specific type.
- return
- cast<Function>(M->getOrInsertFunction(getName(id, Tys, numTys),
- getType(id, Tys, numTys)));
-}
-
-// vim: sw=2 ai
diff --git a/release_23/lib/VMCore/Globals.cpp b/release_23/lib/VMCore/Globals.cpp
deleted file mode 100644
index e75b1867a99a..000000000000
--- a/release_23/lib/VMCore/Globals.cpp
+++ /dev/null
@@ -1,248 +0,0 @@
-//===-- Globals.cpp - Implement the GlobalValue & GlobalVariable class ----===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the GlobalValue & GlobalVariable classes for the VMCore
-// library.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Constants.h"
-#include "llvm/GlobalVariable.h"
-#include "llvm/GlobalAlias.h"
-#include "llvm/DerivedTypes.h"
-#include "llvm/Module.h"
-#include "llvm/ADT/SmallPtrSet.h"
-#include "llvm/Support/LeakDetector.h"
-using namespace llvm;
-
-//===----------------------------------------------------------------------===//
-// GlobalValue Class
-//===----------------------------------------------------------------------===//
-
-/// removeDeadUsersOfConstant - If the specified constantexpr is dead, remove
-/// it. This involves recursively eliminating any dead users of the
-/// constantexpr.
-static bool removeDeadUsersOfConstant(Constant *C) {
- if (isa<GlobalValue>(C)) return false; // Cannot remove this
-
- while (!C->use_empty()) {
- Constant *User = dyn_cast<Constant>(C->use_back());
- if (!User) return false; // Non-constant usage;
- if (!removeDeadUsersOfConstant(User))
- return false; // Constant wasn't dead
- }
-
- C->destroyConstant();
- return true;
-}
-
-/// removeDeadConstantUsers - If there are any dead constant users dangling
-/// off of this global value, remove them. This method is useful for clients
-/// that want to check to see if a global is unused, but don't want to deal
-/// with potentially dead constants hanging off of the globals.
-void GlobalValue::removeDeadConstantUsers() {
- Value::use_iterator I = use_begin(), E = use_end();
- Value::use_iterator LastNonDeadUser = E;
- while (I != E) {
- if (Constant *User = dyn_cast<Constant>(*I)) {
- if (!removeDeadUsersOfConstant(User)) {
- // If the constant wasn't dead, remember that this was the last live use
- // and move on to the next constant.
- LastNonDeadUser = I;
- ++I;
- } else {
- // If the constant was dead, then the iterator is invalidated.
- if (LastNonDeadUser == E) {
- I = use_begin();
- if (I == E) break;
- } else {
- I = LastNonDeadUser;
- ++I;
- }
- }
- } else {
- LastNonDeadUser = I;
- ++I;
- }
- }
-}
-
-/// Override destroyConstant to make sure it doesn't get called on
-/// GlobalValue's because they shouldn't be treated like other constants.
-void GlobalValue::destroyConstant() {
- assert(0 && "You can't GV->destroyConstant()!");
- abort();
-}
-
-//===----------------------------------------------------------------------===//
-// GlobalVariable Implementation
-//===----------------------------------------------------------------------===//
-
-GlobalVariable::GlobalVariable(const Type *Ty, bool constant, LinkageTypes Link,
- Constant *InitVal, const std::string &Name,
- Module *ParentModule, bool ThreadLocal,
- unsigned AddressSpace)
- : GlobalValue(PointerType::get(Ty, AddressSpace), Value::GlobalVariableVal,
- &Initializer, InitVal != 0, Link, Name),
- isConstantGlobal(constant), isThreadLocalSymbol(ThreadLocal) {
- if (InitVal) {
- assert(InitVal->getType() == Ty &&
- "Initializer should be the same type as the GlobalVariable!");
- Initializer.init(InitVal, this);
- } else {
- Initializer.init(0, this);
- }
-
- LeakDetector::addGarbageObject(this);
-
- if (ParentModule)
- ParentModule->getGlobalList().push_back(this);
-}
-
-GlobalVariable::GlobalVariable(const Type *Ty, bool constant, LinkageTypes Link,
- Constant *InitVal, const std::string &Name,
- GlobalVariable *Before, bool ThreadLocal,
- unsigned AddressSpace)
- : GlobalValue(PointerType::get(Ty, AddressSpace), Value::GlobalVariableVal,
- &Initializer, InitVal != 0, Link, Name),
- isConstantGlobal(constant), isThreadLocalSymbol(ThreadLocal) {
- if (InitVal) {
- assert(InitVal->getType() == Ty &&
- "Initializer should be the same type as the GlobalVariable!");
- Initializer.init(InitVal, this);
- } else {
- Initializer.init(0, this);
- }
-
- LeakDetector::addGarbageObject(this);
-
- if (Before)
- Before->getParent()->getGlobalList().insert(Before, this);
-}
-
-void GlobalVariable::setParent(Module *parent) {
- if (getParent())
- LeakDetector::addGarbageObject(this);
- Parent = parent;
- if (getParent())
- LeakDetector::removeGarbageObject(this);
-}
-
-void GlobalVariable::removeFromParent() {
- getParent()->getGlobalList().remove(this);
-}
-
-void GlobalVariable::eraseFromParent() {
- getParent()->getGlobalList().erase(this);
-}
-
-void GlobalVariable::replaceUsesOfWithOnConstant(Value *From, Value *To,
- Use *U) {
- // If you call this, then you better know this GVar has a constant
- // initializer worth replacing. Enforce that here.
- assert(getNumOperands() == 1 &&
- "Attempt to replace uses of Constants on a GVar with no initializer");
-
- // And, since you know it has an initializer, the From value better be
- // the initializer :)
- assert(getOperand(0) == From &&
- "Attempt to replace wrong constant initializer in GVar");
-
- // And, you better have a constant for the replacement value
- assert(isa<Constant>(To) &&
- "Attempt to replace GVar initializer with non-constant");
-
- // Okay, preconditions out of the way, replace the constant initializer.
- this->setOperand(0, cast<Constant>(To));
-}
-
-//===----------------------------------------------------------------------===//
-// GlobalAlias Implementation
-//===----------------------------------------------------------------------===//
-
-GlobalAlias::GlobalAlias(const Type *Ty, LinkageTypes Link,
- const std::string &Name, Constant* aliasee,
- Module *ParentModule)
- : GlobalValue(Ty, Value::GlobalAliasVal, &Aliasee, 1, Link, Name) {
- LeakDetector::addGarbageObject(this);
-
- if (aliasee)
- assert(aliasee->getType() == Ty && "Alias and aliasee types should match!");
- Aliasee.init(aliasee, this);
-
- if (ParentModule)
- ParentModule->getAliasList().push_back(this);
-}
-
-void GlobalAlias::setParent(Module *parent) {
- if (getParent())
- LeakDetector::addGarbageObject(this);
- Parent = parent;
- if (getParent())
- LeakDetector::removeGarbageObject(this);
-}
-
-void GlobalAlias::removeFromParent() {
- getParent()->getAliasList().remove(this);
-}
-
-void GlobalAlias::eraseFromParent() {
- getParent()->getAliasList().erase(this);
-}
-
-bool GlobalAlias::isDeclaration() const {
- const GlobalValue* AV = getAliasedGlobal();
- if (AV)
- return AV->isDeclaration();
- else
- return false;
-}
-
-void GlobalAlias::setAliasee(Constant *Aliasee)
-{
- if (Aliasee)
- assert(Aliasee->getType() == getType() &&
- "Alias and aliasee types should match!");
-
- setOperand(0, Aliasee);
-}
-
-const GlobalValue *GlobalAlias::getAliasedGlobal() const {
- const Constant *C = getAliasee();
- if (C) {
- if (const GlobalValue *GV = dyn_cast<GlobalValue>(C))
- return GV;
- else {
- const ConstantExpr *CE = 0;
- if ((CE = dyn_cast<ConstantExpr>(C)) &&
- (CE->getOpcode() == Instruction::BitCast ||
- CE->getOpcode() == Instruction::GetElementPtr))
- return dyn_cast<GlobalValue>(CE->getOperand(0));
- else
- assert(0 && "Unsupported aliasee");
- }
- }
- return 0;
-}
-
-const GlobalValue *GlobalAlias::resolveAliasedGlobal() const {
- SmallPtrSet<const GlobalValue*, 3> Visited;
-
- const GlobalValue *GV = getAliasedGlobal();
- Visited.insert(GV);
-
- while (const GlobalAlias *GA = dyn_cast<GlobalAlias>(GV)) {
- GV = GA->getAliasedGlobal();
-
- if (!Visited.insert(GV))
- return NULL;
- }
-
- return GV;
-}
diff --git a/release_23/lib/VMCore/InlineAsm.cpp b/release_23/lib/VMCore/InlineAsm.cpp
deleted file mode 100644
index 5eefc8842baf..000000000000
--- a/release_23/lib/VMCore/InlineAsm.cpp
+++ /dev/null
@@ -1,226 +0,0 @@
-//===-- InlineAsm.cpp - Implement the InlineAsm class ---------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the InlineAsm class.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/InlineAsm.h"
-#include "llvm/DerivedTypes.h"
-#include <algorithm>
-#include <cctype>
-using namespace llvm;
-
-// Implement the first virtual method in this class in this file so the
-// InlineAsm vtable is emitted here.
-InlineAsm::~InlineAsm() {
-}
-
-
-// NOTE: when memoizing the function type, we have to be careful to handle the
-// case when the type gets refined.
-
-InlineAsm *InlineAsm::get(const FunctionType *Ty, const std::string &AsmString,
- const std::string &Constraints, bool hasSideEffects) {
- // FIXME: memoize!
- return new InlineAsm(Ty, AsmString, Constraints, hasSideEffects);
-}
-
-InlineAsm::InlineAsm(const FunctionType *Ty, const std::string &asmString,
- const std::string &constraints, bool hasSideEffects)
- : Value(PointerType::getUnqual(Ty),
- Value::InlineAsmVal),
- AsmString(asmString),
- Constraints(constraints), HasSideEffects(hasSideEffects) {
-
- // Do various checks on the constraint string and type.
- assert(Verify(Ty, constraints) && "Function type not legal for constraints!");
-}
-
-const FunctionType *InlineAsm::getFunctionType() const {
- return cast<FunctionType>(getType()->getElementType());
-}
-
-/// Parse - Analyze the specified string (e.g. "==&{eax}") and fill in the
-/// fields in this structure. If the constraint string is not understood,
-/// return true, otherwise return false.
-bool InlineAsm::ConstraintInfo::Parse(const std::string &Str,
- std::vector<InlineAsm::ConstraintInfo> &ConstraintsSoFar) {
- std::string::const_iterator I = Str.begin(), E = Str.end();
-
- // Initialize
- Type = isInput;
- isEarlyClobber = false;
- hasMatchingInput = false;
- isCommutative = false;
- isIndirect = false;
-
- // Parse prefixes.
- if (*I == '~') {
- Type = isClobber;
- ++I;
- } else if (*I == '=') {
- ++I;
- Type = isOutput;
- }
-
- if (*I == '*') {
- isIndirect = true;
- ++I;
- }
-
- if (I == E) return true; // Just a prefix, like "==" or "~".
-
- // Parse the modifiers.
- bool DoneWithModifiers = false;
- while (!DoneWithModifiers) {
- switch (*I) {
- default:
- DoneWithModifiers = true;
- break;
- case '&': // Early clobber.
- if (Type != isOutput || // Cannot early clobber anything but output.
- isEarlyClobber) // Reject &&&&&&
- return true;
- isEarlyClobber = true;
- break;
- case '%': // Commutative.
- if (Type == isClobber || // Cannot commute clobbers.
- isCommutative) // Reject %%%%%
- return true;
- isCommutative = true;
- break;
- case '#': // Comment.
- case '*': // Register preferencing.
- return true; // Not supported.
- }
-
- if (!DoneWithModifiers) {
- ++I;
- if (I == E) return true; // Just prefixes and modifiers!
- }
- }
-
- // Parse the various constraints.
- while (I != E) {
- if (*I == '{') { // Physical register reference.
- // Find the end of the register name.
- std::string::const_iterator ConstraintEnd = std::find(I+1, E, '}');
- if (ConstraintEnd == E) return true; // "{foo"
- Codes.push_back(std::string(I, ConstraintEnd+1));
- I = ConstraintEnd+1;
- } else if (isdigit(*I)) { // Matching Constraint
- // Maximal munch numbers.
- std::string::const_iterator NumStart = I;
- while (I != E && isdigit(*I))
- ++I;
- Codes.push_back(std::string(NumStart, I));
- unsigned N = atoi(Codes.back().c_str());
- // Check that this is a valid matching constraint!
- if (N >= ConstraintsSoFar.size() || ConstraintsSoFar[N].Type != isOutput||
- Type != isInput)
- return true; // Invalid constraint number.
-
- // Note that operand #n has a matching input.
- ConstraintsSoFar[N].hasMatchingInput = true;
- } else {
- // Single letter constraint.
- Codes.push_back(std::string(I, I+1));
- ++I;
- }
- }
-
- return false;
-}
-
-std::vector<InlineAsm::ConstraintInfo>
-InlineAsm::ParseConstraints(const std::string &Constraints) {
- std::vector<ConstraintInfo> Result;
-
- // Scan the constraints string.
- for (std::string::const_iterator I = Constraints.begin(),
- E = Constraints.end(); I != E; ) {
- ConstraintInfo Info;
-
- // Find the end of this constraint.
- std::string::const_iterator ConstraintEnd = std::find(I, E, ',');
-
- if (ConstraintEnd == I || // Empty constraint like ",,"
- Info.Parse(std::string(I, ConstraintEnd), Result)) {
- Result.clear(); // Erroneous constraint?
- break;
- }
-
- Result.push_back(Info);
-
- // ConstraintEnd may be either the next comma or the end of the string. In
- // the former case, we skip the comma.
- I = ConstraintEnd;
- if (I != E) {
- ++I;
- if (I == E) { Result.clear(); break; } // don't allow "xyz,"
- }
- }
-
- return Result;
-}
-
-
-/// Verify - Verify that the specified constraint string is reasonable for the
-/// specified function type, and otherwise validate the constraint string.
-bool InlineAsm::Verify(const FunctionType *Ty, const std::string &ConstStr) {
- if (Ty->isVarArg()) return false;
-
- std::vector<ConstraintInfo> Constraints = ParseConstraints(ConstStr);
-
- // Error parsing constraints.
- if (Constraints.empty() && !ConstStr.empty()) return false;
-
- unsigned NumOutputs = 0, NumInputs = 0, NumClobbers = 0;
- unsigned NumIndirect = 0;
-
- for (unsigned i = 0, e = Constraints.size(); i != e; ++i) {
- switch (Constraints[i].Type) {
- case InlineAsm::isOutput:
- if ((NumInputs-NumIndirect) != 0 || NumClobbers != 0)
- return false; // outputs before inputs and clobbers.
- if (!Constraints[i].isIndirect) {
- ++NumOutputs;
- break;
- }
- ++NumIndirect;
- // FALLTHROUGH for Indirect Outputs.
- case InlineAsm::isInput:
- if (NumClobbers) return false; // inputs before clobbers.
- ++NumInputs;
- break;
- case InlineAsm::isClobber:
- ++NumClobbers;
- break;
- }
- }
-
- switch (NumOutputs) {
- case 0:
- if (Ty->getReturnType() != Type::VoidTy) return false;
- break;
- case 1:
- if (isa<StructType>(Ty->getReturnType())) return false;
- break;
- default:
- const StructType *STy = dyn_cast<StructType>(Ty->getReturnType());
- if (STy == 0 || STy->getNumElements() != NumOutputs)
- return false;
- break;
- }
-
- if (Ty->getNumParams() != NumInputs) return false;
- return true;
-}
-
diff --git a/release_23/lib/VMCore/Instruction.cpp b/release_23/lib/VMCore/Instruction.cpp
deleted file mode 100644
index 2316b4868982..000000000000
--- a/release_23/lib/VMCore/Instruction.cpp
+++ /dev/null
@@ -1,314 +0,0 @@
-//===-- Instruction.cpp - Implement the Instruction class -----------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the Instruction class for the VMCore library.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Type.h"
-#include "llvm/Instructions.h"
-#include "llvm/Function.h"
-#include "llvm/Support/CallSite.h"
-#include "llvm/Support/LeakDetector.h"
-using namespace llvm;
-
-Instruction::Instruction(const Type *ty, unsigned it, Use *Ops, unsigned NumOps,
- Instruction *InsertBefore)
- : User(ty, Value::InstructionVal + it, Ops, NumOps), Parent(0) {
- // Make sure that we get added to a basicblock
- LeakDetector::addGarbageObject(this);
-
- // If requested, insert this instruction into a basic block...
- if (InsertBefore) {
- assert(InsertBefore->getParent() &&
- "Instruction to insert before is not in a basic block!");
- InsertBefore->getParent()->getInstList().insert(InsertBefore, this);
- }
-}
-
-Instruction::Instruction(const Type *ty, unsigned it, Use *Ops, unsigned NumOps,
- BasicBlock *InsertAtEnd)
- : User(ty, Value::InstructionVal + it, Ops, NumOps), Parent(0) {
- // Make sure that we get added to a basicblock
- LeakDetector::addGarbageObject(this);
-
- // append this instruction into the basic block
- assert(InsertAtEnd && "Basic block to append to may not be NULL!");
- InsertAtEnd->getInstList().push_back(this);
-}
-
-
-// Out of line virtual method, so the vtable, etc has a home.
-Instruction::~Instruction() {
- assert(Parent == 0 && "Instruction still linked in the program!");
-}
-
-
-void Instruction::setParent(BasicBlock *P) {
- if (getParent()) {
- if (!P) LeakDetector::addGarbageObject(this);
- } else {
- if (P) LeakDetector::removeGarbageObject(this);
- }
-
- Parent = P;
-}
-
-void Instruction::removeFromParent() {
- getParent()->getInstList().remove(this);
-}
-
-void Instruction::eraseFromParent() {
- getParent()->getInstList().erase(this);
-}
-
-/// moveBefore - Unlink this instruction from its current basic block and
-/// insert it into the basic block that MovePos lives in, right before
-/// MovePos.
-void Instruction::moveBefore(Instruction *MovePos) {
- MovePos->getParent()->getInstList().splice(MovePos,getParent()->getInstList(),
- this);
-}
-
-
-const char *Instruction::getOpcodeName(unsigned OpCode) {
- switch (OpCode) {
- // Terminators
- case Ret: return "ret";
- case Br: return "br";
- case Switch: return "switch";
- case Invoke: return "invoke";
- case Unwind: return "unwind";
- case Unreachable: return "unreachable";
-
- // Standard binary operators...
- case Add: return "add";
- case Sub: return "sub";
- case Mul: return "mul";
- case UDiv: return "udiv";
- case SDiv: return "sdiv";
- case FDiv: return "fdiv";
- case URem: return "urem";
- case SRem: return "srem";
- case FRem: return "frem";
-
- // Logical operators...
- case And: return "and";
- case Or : return "or";
- case Xor: return "xor";
-
- // Memory instructions...
- case Malloc: return "malloc";
- case Free: return "free";
- case Alloca: return "alloca";
- case Load: return "load";
- case Store: return "store";
- case GetElementPtr: return "getelementptr";
-
- // Convert instructions...
- case Trunc: return "trunc";
- case ZExt: return "zext";
- case SExt: return "sext";
- case FPTrunc: return "fptrunc";
- case FPExt: return "fpext";
- case FPToUI: return "fptoui";
- case FPToSI: return "fptosi";
- case UIToFP: return "uitofp";
- case SIToFP: return "sitofp";
- case IntToPtr: return "inttoptr";
- case PtrToInt: return "ptrtoint";
- case BitCast: return "bitcast";
-
- // Other instructions...
- case ICmp: return "icmp";
- case FCmp: return "fcmp";
- case PHI: return "phi";
- case Select: return "select";
- case Call: return "call";
- case Shl: return "shl";
- case LShr: return "lshr";
- case AShr: return "ashr";
- case VAArg: return "va_arg";
- case ExtractElement: return "extractelement";
- case InsertElement: return "insertelement";
- case ShuffleVector: return "shufflevector";
- case GetResult: return "getresult";
-
- default: return "<Invalid operator> ";
- }
-
- return 0;
-}
-
-/// isIdenticalTo - Return true if the specified instruction is exactly
-/// identical to the current one. This means that all operands match and any
-/// extra information (e.g. load is volatile) agree.
-bool Instruction::isIdenticalTo(Instruction *I) const {
- if (getOpcode() != I->getOpcode() ||
- getNumOperands() != I->getNumOperands() ||
- getType() != I->getType())
- return false;
-
- // We have two instructions of identical opcode and #operands. Check to see
- // if all operands are the same.
- for (unsigned i = 0, e = getNumOperands(); i != e; ++i)
- if (getOperand(i) != I->getOperand(i))
- return false;
-
- // Check special state that is a part of some instructions.
- if (const LoadInst *LI = dyn_cast<LoadInst>(this))
- return LI->isVolatile() == cast<LoadInst>(I)->isVolatile();
- if (const StoreInst *SI = dyn_cast<StoreInst>(this))
- return SI->isVolatile() == cast<StoreInst>(I)->isVolatile();
- if (const CmpInst *CI = dyn_cast<CmpInst>(this))
- return CI->getPredicate() == cast<CmpInst>(I)->getPredicate();
- if (const CallInst *CI = dyn_cast<CallInst>(this))
- return CI->isTailCall() == cast<CallInst>(I)->isTailCall();
- return true;
-}
-
-// isSameOperationAs
-bool Instruction::isSameOperationAs(Instruction *I) const {
- if (getOpcode() != I->getOpcode() || getType() != I->getType() ||
- getNumOperands() != I->getNumOperands())
- return false;
-
- // We have two instructions of identical opcode and #operands. Check to see
- // if all operands are the same type
- for (unsigned i = 0, e = getNumOperands(); i != e; ++i)
- if (getOperand(i)->getType() != I->getOperand(i)->getType())
- return false;
-
- // Check special state that is a part of some instructions.
- if (const LoadInst *LI = dyn_cast<LoadInst>(this))
- return LI->isVolatile() == cast<LoadInst>(I)->isVolatile();
- if (const StoreInst *SI = dyn_cast<StoreInst>(this))
- return SI->isVolatile() == cast<StoreInst>(I)->isVolatile();
- if (const CmpInst *CI = dyn_cast<CmpInst>(this))
- return CI->getPredicate() == cast<CmpInst>(I)->getPredicate();
- if (const CallInst *CI = dyn_cast<CallInst>(this))
- return CI->isTailCall() == cast<CallInst>(I)->isTailCall();
-
- return true;
-}
-
-/// isUsedOutsideOfBlock - Return true if there are any uses of I outside of the
-/// specified block. Note that PHI nodes are considered to evaluate their
-/// operands in the corresponding predecessor block.
-bool Instruction::isUsedOutsideOfBlock(const BasicBlock *BB) const {
- for (use_const_iterator UI = use_begin(), E = use_end(); UI != E; ++UI) {
- // PHI nodes uses values in the corresponding predecessor block. For other
- // instructions, just check to see whether the parent of the use matches up.
- const PHINode *PN = dyn_cast<PHINode>(*UI);
- if (PN == 0) {
- if (cast<Instruction>(*UI)->getParent() != BB)
- return true;
- continue;
- }
-
- unsigned UseOperand = UI.getOperandNo();
- if (PN->getIncomingBlock(UseOperand/2) != BB)
- return true;
- }
- return false;
-}
-
-/// mayReadFromMemory - Return true if this instruction may read memory.
-///
-bool Instruction::mayReadFromMemory() const {
- switch (getOpcode()) {
- default: return false;
- case Instruction::Free:
- case Instruction::VAArg:
- case Instruction::Load:
- return true;
- case Instruction::Call:
- return !cast<CallInst>(this)->doesNotAccessMemory();
- case Instruction::Invoke:
- return !cast<InvokeInst>(this)->doesNotAccessMemory();
- case Instruction::Store:
- return cast<StoreInst>(this)->isVolatile();
- }
-}
-
-/// mayWriteToMemory - Return true if this instruction may modify memory.
-///
-bool Instruction::mayWriteToMemory() const {
- switch (getOpcode()) {
- default: return false;
- case Instruction::Free:
- case Instruction::Store:
- case Instruction::VAArg:
- return true;
- case Instruction::Call:
- return !cast<CallInst>(this)->onlyReadsMemory();
- case Instruction::Invoke:
- return !cast<InvokeInst>(this)->onlyReadsMemory();
- case Instruction::Load:
- return cast<LoadInst>(this)->isVolatile();
- }
-}
-
-/// isAssociative - Return true if the instruction is associative:
-///
-/// Associative operators satisfy: x op (y op z) === (x op y) op z)
-///
-/// In LLVM, the Add, Mul, And, Or, and Xor operators are associative, when not
-/// applied to floating point types.
-///
-bool Instruction::isAssociative(unsigned Opcode, const Type *Ty) {
- if (Opcode == And || Opcode == Or || Opcode == Xor)
- return true;
-
- // Add/Mul reassociate unless they are FP or FP vectors.
- if (Opcode == Add || Opcode == Mul)
- return !Ty->isFPOrFPVector();
- return 0;
-}
-
-/// isCommutative - Return true if the instruction is commutative:
-///
-/// Commutative operators satisfy: (x op y) === (y op x)
-///
-/// In LLVM, these are the associative operators, plus SetEQ and SetNE, when
-/// applied to any type.
-///
-bool Instruction::isCommutative(unsigned op) {
- switch (op) {
- case Add:
- case Mul:
- case And:
- case Or:
- case Xor:
- return true;
- default:
- return false;
- }
-}
-
-/// isTrappingInstruction - Return true if the instruction may trap.
-///
-bool Instruction::isTrapping(unsigned op) {
- switch(op) {
- case UDiv:
- case SDiv:
- case FDiv:
- case URem:
- case SRem:
- case FRem:
- case Load:
- case Store:
- case Call:
- case Invoke:
- case VAArg:
- return true;
- default:
- return false;
- }
-}
diff --git a/release_23/lib/VMCore/Instructions.cpp b/release_23/lib/VMCore/Instructions.cpp
deleted file mode 100644
index 56bc8167c3c5..000000000000
--- a/release_23/lib/VMCore/Instructions.cpp
+++ /dev/null
@@ -1,2764 +0,0 @@
-//===-- Instructions.cpp - Implement the LLVM instructions ----------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements all of the non-inline methods for the LLVM instruction
-// classes.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/BasicBlock.h"
-#include "llvm/Constants.h"
-#include "llvm/DerivedTypes.h"
-#include "llvm/Function.h"
-#include "llvm/Instructions.h"
-#include "llvm/Support/CallSite.h"
-#include "llvm/Support/ConstantRange.h"
-#include "llvm/Support/MathExtras.h"
-using namespace llvm;
-
-//===----------------------------------------------------------------------===//
-// CallSite Class
-//===----------------------------------------------------------------------===//
-
-CallSite::CallSite(Instruction *C) {
- assert((isa<CallInst>(C) || isa<InvokeInst>(C)) && "Not a call!");
- I = C;
-}
-unsigned CallSite::getCallingConv() const {
- if (CallInst *CI = dyn_cast<CallInst>(I))
- return CI->getCallingConv();
- else
- return cast<InvokeInst>(I)->getCallingConv();
-}
-void CallSite::setCallingConv(unsigned CC) {
- if (CallInst *CI = dyn_cast<CallInst>(I))
- CI->setCallingConv(CC);
- else
- cast<InvokeInst>(I)->setCallingConv(CC);
-}
-const PAListPtr &CallSite::getParamAttrs() const {
- if (CallInst *CI = dyn_cast<CallInst>(I))
- return CI->getParamAttrs();
- else
- return cast<InvokeInst>(I)->getParamAttrs();
-}
-void CallSite::setParamAttrs(const PAListPtr &PAL) {
- if (CallInst *CI = dyn_cast<CallInst>(I))
- CI->setParamAttrs(PAL);
- else
- cast<InvokeInst>(I)->setParamAttrs(PAL);
-}
-bool CallSite::paramHasAttr(uint16_t i, ParameterAttributes attr) const {
- if (CallInst *CI = dyn_cast<CallInst>(I))
- return CI->paramHasAttr(i, attr);
- else
- return cast<InvokeInst>(I)->paramHasAttr(i, attr);
-}
-uint16_t CallSite::getParamAlignment(uint16_t i) const {
- if (CallInst *CI = dyn_cast<CallInst>(I))
- return CI->getParamAlignment(i);
- else
- return cast<InvokeInst>(I)->getParamAlignment(i);
-}
-
-bool CallSite::doesNotAccessMemory() const {
- if (CallInst *CI = dyn_cast<CallInst>(I))
- return CI->doesNotAccessMemory();
- else
- return cast<InvokeInst>(I)->doesNotAccessMemory();
-}
-bool CallSite::onlyReadsMemory() const {
- if (CallInst *CI = dyn_cast<CallInst>(I))
- return CI->onlyReadsMemory();
- else
- return cast<InvokeInst>(I)->onlyReadsMemory();
-}
-bool CallSite::doesNotThrow() const {
- if (CallInst *CI = dyn_cast<CallInst>(I))
- return CI->doesNotThrow();
- else
- return cast<InvokeInst>(I)->doesNotThrow();
-}
-void CallSite::setDoesNotThrow(bool doesNotThrow) {
- if (CallInst *CI = dyn_cast<CallInst>(I))
- CI->setDoesNotThrow(doesNotThrow);
- else
- cast<InvokeInst>(I)->setDoesNotThrow(doesNotThrow);
-}
-
-//===----------------------------------------------------------------------===//
-// TerminatorInst Class
-//===----------------------------------------------------------------------===//
-
-// Out of line virtual method, so the vtable, etc has a home.
-TerminatorInst::~TerminatorInst() {
-}
-
-// Out of line virtual method, so the vtable, etc has a home.
-UnaryInstruction::~UnaryInstruction() {
-}
-
-
-//===----------------------------------------------------------------------===//
-// PHINode Class
-//===----------------------------------------------------------------------===//
-
-PHINode::PHINode(const PHINode &PN)
- : Instruction(PN.getType(), Instruction::PHI,
- new Use[PN.getNumOperands()], PN.getNumOperands()),
- ReservedSpace(PN.getNumOperands()) {
- Use *OL = OperandList;
- for (unsigned i = 0, e = PN.getNumOperands(); i != e; i+=2) {
- OL[i].init(PN.getOperand(i), this);
- OL[i+1].init(PN.getOperand(i+1), this);
- }
-}
-
-PHINode::~PHINode() {
- delete [] OperandList;
-}
-
-// removeIncomingValue - Remove an incoming value. This is useful if a
-// predecessor basic block is deleted.
-Value *PHINode::removeIncomingValue(unsigned Idx, bool DeletePHIIfEmpty) {
- unsigned NumOps = getNumOperands();
- Use *OL = OperandList;
- assert(Idx*2 < NumOps && "BB not in PHI node!");
- Value *Removed = OL[Idx*2];
-
- // Move everything after this operand down.
- //
- // FIXME: we could just swap with the end of the list, then erase. However,
- // client might not expect this to happen. The code as it is thrashes the
- // use/def lists, which is kinda lame.
- for (unsigned i = (Idx+1)*2; i != NumOps; i += 2) {
- OL[i-2] = OL[i];
- OL[i-2+1] = OL[i+1];
- }
-
- // Nuke the last value.
- OL[NumOps-2].set(0);
- OL[NumOps-2+1].set(0);
- NumOperands = NumOps-2;
-
- // If the PHI node is dead, because it has zero entries, nuke it now.
- if (NumOps == 2 && DeletePHIIfEmpty) {
- // If anyone is using this PHI, make them use a dummy value instead...
- replaceAllUsesWith(UndefValue::get(getType()));
- eraseFromParent();
- }
- return Removed;
-}
-
-/// resizeOperands - resize operands - This adjusts the length of the operands
-/// list according to the following behavior:
-/// 1. If NumOps == 0, grow the operand list in response to a push_back style
-/// of operation. This grows the number of ops by 1.5 times.
-/// 2. If NumOps > NumOperands, reserve space for NumOps operands.
-/// 3. If NumOps == NumOperands, trim the reserved space.
-///
-void PHINode::resizeOperands(unsigned NumOps) {
- if (NumOps == 0) {
- NumOps = (getNumOperands())*3/2;
- if (NumOps < 4) NumOps = 4; // 4 op PHI nodes are VERY common.
- } else if (NumOps*2 > NumOperands) {
- // No resize needed.
- if (ReservedSpace >= NumOps) return;
- } else if (NumOps == NumOperands) {
- if (ReservedSpace == NumOps) return;
- } else {
- return;
- }
-
- ReservedSpace = NumOps;
- Use *NewOps = new Use[NumOps];
- Use *OldOps = OperandList;
- for (unsigned i = 0, e = getNumOperands(); i != e; ++i) {
- NewOps[i].init(OldOps[i], this);
- OldOps[i].set(0);
- }
- delete [] OldOps;
- OperandList = NewOps;
-}
-
-/// hasConstantValue - If the specified PHI node always merges together the same
-/// value, return the value, otherwise return null.
-///
-Value *PHINode::hasConstantValue(bool AllowNonDominatingInstruction) const {
- // If the PHI node only has one incoming value, eliminate the PHI node...
- if (getNumIncomingValues() == 1) {
- if (getIncomingValue(0) != this) // not X = phi X
- return getIncomingValue(0);
- else
- return UndefValue::get(getType()); // Self cycle is dead.
- }
-
- // Otherwise if all of the incoming values are the same for the PHI, replace
- // the PHI node with the incoming value.
- //
- Value *InVal = 0;
- bool HasUndefInput = false;
- for (unsigned i = 0, e = getNumIncomingValues(); i != e; ++i)
- if (isa<UndefValue>(getIncomingValue(i))) {
- HasUndefInput = true;
- } else if (getIncomingValue(i) != this) { // Not the PHI node itself...
- if (InVal && getIncomingValue(i) != InVal)
- return 0; // Not the same, bail out.
- else
- InVal = getIncomingValue(i);
- }
-
- // The only case that could cause InVal to be null is if we have a PHI node
- // that only has entries for itself. In this case, there is no entry into the
- // loop, so kill the PHI.
- //
- if (InVal == 0) InVal = UndefValue::get(getType());
-
- // If we have a PHI node like phi(X, undef, X), where X is defined by some
- // instruction, we cannot always return X as the result of the PHI node. Only
- // do this if X is not an instruction (thus it must dominate the PHI block),
- // or if the client is prepared to deal with this possibility.
- if (HasUndefInput && !AllowNonDominatingInstruction)
- if (Instruction *IV = dyn_cast<Instruction>(InVal))
- // If it's in the entry block, it dominates everything.
- if (IV->getParent() != &IV->getParent()->getParent()->getEntryBlock() ||
- isa<InvokeInst>(IV))
- return 0; // Cannot guarantee that InVal dominates this PHINode.
-
- // All of the incoming values are the same, return the value now.
- return InVal;
-}
-
-
-//===----------------------------------------------------------------------===//
-// CallInst Implementation
-//===----------------------------------------------------------------------===//
-
-CallInst::~CallInst() {
- delete [] OperandList;
-}
-
-void CallInst::init(Value *Func, Value* const *Params, unsigned NumParams) {
- NumOperands = NumParams+1;
- Use *OL = OperandList = new Use[NumParams+1];
- OL[0].init(Func, this);
-
- const FunctionType *FTy =
- cast<FunctionType>(cast<PointerType>(Func->getType())->getElementType());
- FTy = FTy; // silence warning.
-
- assert((NumParams == FTy->getNumParams() ||
- (FTy->isVarArg() && NumParams > FTy->getNumParams())) &&
- "Calling a function with bad signature!");
- for (unsigned i = 0; i != NumParams; ++i) {
- assert((i >= FTy->getNumParams() ||
- FTy->getParamType(i) == Params[i]->getType()) &&
- "Calling a function with a bad signature!");
- OL[i+1].init(Params[i], this);
- }
-}
-
-void CallInst::init(Value *Func, Value *Actual1, Value *Actual2) {
- NumOperands = 3;
- Use *OL = OperandList = new Use[3];
- OL[0].init(Func, this);
- OL[1].init(Actual1, this);
- OL[2].init(Actual2, this);
-
- const FunctionType *FTy =
- cast<FunctionType>(cast<PointerType>(Func->getType())->getElementType());
- FTy = FTy; // silence warning.
-
- assert((FTy->getNumParams() == 2 ||
- (FTy->isVarArg() && FTy->getNumParams() < 2)) &&
- "Calling a function with bad signature");
- assert((0 >= FTy->getNumParams() ||
- FTy->getParamType(0) == Actual1->getType()) &&
- "Calling a function with a bad signature!");
- assert((1 >= FTy->getNumParams() ||
- FTy->getParamType(1) == Actual2->getType()) &&
- "Calling a function with a bad signature!");
-}
-
-void CallInst::init(Value *Func, Value *Actual) {
- NumOperands = 2;
- Use *OL = OperandList = new Use[2];
- OL[0].init(Func, this);
- OL[1].init(Actual, this);
-
- const FunctionType *FTy =
- cast<FunctionType>(cast<PointerType>(Func->getType())->getElementType());
- FTy = FTy; // silence warning.
-
- assert((FTy->getNumParams() == 1 ||
- (FTy->isVarArg() && FTy->getNumParams() == 0)) &&
- "Calling a function with bad signature");
- assert((0 == FTy->getNumParams() ||
- FTy->getParamType(0) == Actual->getType()) &&
- "Calling a function with a bad signature!");
-}
-
-void CallInst::init(Value *Func) {
- NumOperands = 1;
- Use *OL = OperandList = new Use[1];
- OL[0].init(Func, this);
-
- const FunctionType *FTy =
- cast<FunctionType>(cast<PointerType>(Func->getType())->getElementType());
- FTy = FTy; // silence warning.
-
- assert(FTy->getNumParams() == 0 && "Calling a function with bad signature");
-}
-
-CallInst::CallInst(Value *Func, Value* Actual, const std::string &Name,
- Instruction *InsertBefore)
- : Instruction(cast<FunctionType>(cast<PointerType>(Func->getType())
- ->getElementType())->getReturnType(),
- Instruction::Call, 0, 0, InsertBefore) {
- init(Func, Actual);
- setName(Name);
-}
-
-CallInst::CallInst(Value *Func, Value* Actual, const std::string &Name,
- BasicBlock *InsertAtEnd)
- : Instruction(cast<FunctionType>(cast<PointerType>(Func->getType())
- ->getElementType())->getReturnType(),
- Instruction::Call, 0, 0, InsertAtEnd) {
- init(Func, Actual);
- setName(Name);
-}
-CallInst::CallInst(Value *Func, const std::string &Name,
- Instruction *InsertBefore)
- : Instruction(cast<FunctionType>(cast<PointerType>(Func->getType())
- ->getElementType())->getReturnType(),
- Instruction::Call, 0, 0, InsertBefore) {
- init(Func);
- setName(Name);
-}
-
-CallInst::CallInst(Value *Func, const std::string &Name,
- BasicBlock *InsertAtEnd)
- : Instruction(cast<FunctionType>(cast<PointerType>(Func->getType())
- ->getElementType())->getReturnType(),
- Instruction::Call, 0, 0, InsertAtEnd) {
- init(Func);
- setName(Name);
-}
-
-CallInst::CallInst(const CallInst &CI)
- : Instruction(CI.getType(), Instruction::Call, new Use[CI.getNumOperands()],
- CI.getNumOperands()) {
- setParamAttrs(CI.getParamAttrs());
- SubclassData = CI.SubclassData;
- Use *OL = OperandList;
- Use *InOL = CI.OperandList;
- for (unsigned i = 0, e = CI.getNumOperands(); i != e; ++i)
- OL[i].init(InOL[i], this);
-}
-
-bool CallInst::paramHasAttr(unsigned i, ParameterAttributes attr) const {
- if (ParamAttrs.paramHasAttr(i, attr))
- return true;
- if (const Function *F = getCalledFunction())
- return F->paramHasAttr(i, attr);
- return false;
-}
-
-void CallInst::setDoesNotThrow(bool doesNotThrow) {
- PAListPtr PAL = getParamAttrs();
- if (doesNotThrow)
- PAL = PAL.addAttr(0, ParamAttr::NoUnwind);
- else
- PAL = PAL.removeAttr(0, ParamAttr::NoUnwind);
- setParamAttrs(PAL);
-}
-
-
-//===----------------------------------------------------------------------===//
-// InvokeInst Implementation
-//===----------------------------------------------------------------------===//
-
-InvokeInst::~InvokeInst() {
- delete [] OperandList;
-}
-
-void InvokeInst::init(Value *Fn, BasicBlock *IfNormal, BasicBlock *IfException,
- Value* const *Args, unsigned NumArgs) {
- NumOperands = 3+NumArgs;
- Use *OL = OperandList = new Use[3+NumArgs];
- OL[0].init(Fn, this);
- OL[1].init(IfNormal, this);
- OL[2].init(IfException, this);
- const FunctionType *FTy =
- cast<FunctionType>(cast<PointerType>(Fn->getType())->getElementType());
- FTy = FTy; // silence warning.
-
- assert(((NumArgs == FTy->getNumParams()) ||
- (FTy->isVarArg() && NumArgs > FTy->getNumParams())) &&
- "Calling a function with bad signature");
-
- for (unsigned i = 0, e = NumArgs; i != e; i++) {
- assert((i >= FTy->getNumParams() ||
- FTy->getParamType(i) == Args[i]->getType()) &&
- "Invoking a function with a bad signature!");
-
- OL[i+3].init(Args[i], this);
- }
-}
-
-InvokeInst::InvokeInst(const InvokeInst &II)
- : TerminatorInst(II.getType(), Instruction::Invoke,
- new Use[II.getNumOperands()], II.getNumOperands()) {
- setParamAttrs(II.getParamAttrs());
- SubclassData = II.SubclassData;
- Use *OL = OperandList, *InOL = II.OperandList;
- for (unsigned i = 0, e = II.getNumOperands(); i != e; ++i)
- OL[i].init(InOL[i], this);
-}
-
-BasicBlock *InvokeInst::getSuccessorV(unsigned idx) const {
- return getSuccessor(idx);
-}
-unsigned InvokeInst::getNumSuccessorsV() const {
- return getNumSuccessors();
-}
-void InvokeInst::setSuccessorV(unsigned idx, BasicBlock *B) {
- return setSuccessor(idx, B);
-}
-
-bool InvokeInst::paramHasAttr(unsigned i, ParameterAttributes attr) const {
- if (ParamAttrs.paramHasAttr(i, attr))
- return true;
- if (const Function *F = getCalledFunction())
- return F->paramHasAttr(i, attr);
- return false;
-}
-
-void InvokeInst::setDoesNotThrow(bool doesNotThrow) {
- PAListPtr PAL = getParamAttrs();
- if (doesNotThrow)
- PAL = PAL.addAttr(0, ParamAttr::NoUnwind);
- else
- PAL = PAL.removeAttr(0, ParamAttr::NoUnwind);
- setParamAttrs(PAL);
-}
-
-
-//===----------------------------------------------------------------------===//
-// ReturnInst Implementation
-//===----------------------------------------------------------------------===//
-
-ReturnInst::ReturnInst(const ReturnInst &RI)
- : TerminatorInst(Type::VoidTy, Instruction::Ret,
- &RetVal, RI.getNumOperands()) {
- unsigned N = RI.getNumOperands();
- if (N == 1)
- RetVal.init(RI.RetVal, this);
- else if (N) {
- Use *OL = OperandList = new Use[N];
- for (unsigned i = 0; i < N; ++i)
- OL[i].init(RI.getOperand(i), this);
- }
-}
-
-ReturnInst::ReturnInst(Value *retVal, Instruction *InsertBefore)
- : TerminatorInst(Type::VoidTy, Instruction::Ret, &RetVal, 0, InsertBefore) {
- if (retVal)
- init(&retVal, 1);
-}
-ReturnInst::ReturnInst(Value *retVal, BasicBlock *InsertAtEnd)
- : TerminatorInst(Type::VoidTy, Instruction::Ret, &RetVal, 0, InsertAtEnd) {
- if (retVal)
- init(&retVal, 1);
-}
-ReturnInst::ReturnInst(BasicBlock *InsertAtEnd)
- : TerminatorInst(Type::VoidTy, Instruction::Ret, &RetVal, 0, InsertAtEnd) {
-}
-
-ReturnInst::ReturnInst(Value * const* retVals, unsigned N,
- Instruction *InsertBefore)
- : TerminatorInst(Type::VoidTy, Instruction::Ret, &RetVal, N, InsertBefore) {
- if (N != 0)
- init(retVals, N);
-}
-ReturnInst::ReturnInst(Value * const* retVals, unsigned N,
- BasicBlock *InsertAtEnd)
- : TerminatorInst(Type::VoidTy, Instruction::Ret, &RetVal, N, InsertAtEnd) {
- if (N != 0)
- init(retVals, N);
-}
-ReturnInst::ReturnInst(Value * const* retVals, unsigned N)
- : TerminatorInst(Type::VoidTy, Instruction::Ret, &RetVal, N) {
- if (N != 0)
- init(retVals, N);
-}
-
-void ReturnInst::init(Value * const* retVals, unsigned N) {
- assert (N > 0 && "Invalid operands numbers in ReturnInst init");
-
- NumOperands = N;
- if (NumOperands == 1) {
- Value *V = *retVals;
- if (V->getType() == Type::VoidTy)
- return;
- RetVal.init(V, this);
- return;
- }
-
- Use *OL = OperandList = new Use[NumOperands];
- for (unsigned i = 0; i < NumOperands; ++i) {
- Value *V = *retVals++;
- assert(!isa<BasicBlock>(V) &&
- "Cannot return basic block. Probably using the incorrect ctor");
- OL[i].init(V, this);
- }
-}
-
-unsigned ReturnInst::getNumSuccessorsV() const {
- return getNumSuccessors();
-}
-
-/// Out-of-line ReturnInst method, put here so the C++ compiler can choose to
-/// emit the vtable for the class in this translation unit.
-void ReturnInst::setSuccessorV(unsigned idx, BasicBlock *NewSucc) {
- assert(0 && "ReturnInst has no successors!");
-}
-
-BasicBlock *ReturnInst::getSuccessorV(unsigned idx) const {
- assert(0 && "ReturnInst has no successors!");
- abort();
- return 0;
-}
-
-ReturnInst::~ReturnInst() {
- if (NumOperands > 1)
- delete [] OperandList;
-}
-
-//===----------------------------------------------------------------------===//
-// UnwindInst Implementation
-//===----------------------------------------------------------------------===//
-
-UnwindInst::UnwindInst(Instruction *InsertBefore)
- : TerminatorInst(Type::VoidTy, Instruction::Unwind, 0, 0, InsertBefore) {
-}
-UnwindInst::UnwindInst(BasicBlock *InsertAtEnd)
- : TerminatorInst(Type::VoidTy, Instruction::Unwind, 0, 0, InsertAtEnd) {
-}
-
-
-unsigned UnwindInst::getNumSuccessorsV() const {
- return getNumSuccessors();
-}
-
-void UnwindInst::setSuccessorV(unsigned idx, BasicBlock *NewSucc) {
- assert(0 && "UnwindInst has no successors!");
-}
-
-BasicBlock *UnwindInst::getSuccessorV(unsigned idx) const {
- assert(0 && "UnwindInst has no successors!");
- abort();
- return 0;
-}
-
-//===----------------------------------------------------------------------===//
-// UnreachableInst Implementation
-//===----------------------------------------------------------------------===//
-
-UnreachableInst::UnreachableInst(Instruction *InsertBefore)
- : TerminatorInst(Type::VoidTy, Instruction::Unreachable, 0, 0, InsertBefore) {
-}
-UnreachableInst::UnreachableInst(BasicBlock *InsertAtEnd)
- : TerminatorInst(Type::VoidTy, Instruction::Unreachable, 0, 0, InsertAtEnd) {
-}
-
-unsigned UnreachableInst::getNumSuccessorsV() const {
- return getNumSuccessors();
-}
-
-void UnreachableInst::setSuccessorV(unsigned idx, BasicBlock *NewSucc) {
- assert(0 && "UnwindInst has no successors!");
-}
-
-BasicBlock *UnreachableInst::getSuccessorV(unsigned idx) const {
- assert(0 && "UnwindInst has no successors!");
- abort();
- return 0;
-}
-
-//===----------------------------------------------------------------------===//
-// BranchInst Implementation
-//===----------------------------------------------------------------------===//
-
-void BranchInst::AssertOK() {
- if (isConditional())
- assert(getCondition()->getType() == Type::Int1Ty &&
- "May only branch on boolean predicates!");
-}
-
-BranchInst::BranchInst(BasicBlock *IfTrue, Instruction *InsertBefore)
- : TerminatorInst(Type::VoidTy, Instruction::Br, Ops, 1, InsertBefore) {
- assert(IfTrue != 0 && "Branch destination may not be null!");
- Ops[0].init(reinterpret_cast<Value*>(IfTrue), this);
-}
-BranchInst::BranchInst(BasicBlock *IfTrue, BasicBlock *IfFalse, Value *Cond,
- Instruction *InsertBefore)
-: TerminatorInst(Type::VoidTy, Instruction::Br, Ops, 3, InsertBefore) {
- Ops[0].init(reinterpret_cast<Value*>(IfTrue), this);
- Ops[1].init(reinterpret_cast<Value*>(IfFalse), this);
- Ops[2].init(Cond, this);
-#ifndef NDEBUG
- AssertOK();
-#endif
-}
-
-BranchInst::BranchInst(BasicBlock *IfTrue, BasicBlock *InsertAtEnd)
- : TerminatorInst(Type::VoidTy, Instruction::Br, Ops, 1, InsertAtEnd) {
- assert(IfTrue != 0 && "Branch destination may not be null!");
- Ops[0].init(reinterpret_cast<Value*>(IfTrue), this);
-}
-
-BranchInst::BranchInst(BasicBlock *IfTrue, BasicBlock *IfFalse, Value *Cond,
- BasicBlock *InsertAtEnd)
- : TerminatorInst(Type::VoidTy, Instruction::Br, Ops, 3, InsertAtEnd) {
- Ops[0].init(reinterpret_cast<Value*>(IfTrue), this);
- Ops[1].init(reinterpret_cast<Value*>(IfFalse), this);
- Ops[2].init(Cond, this);
-#ifndef NDEBUG
- AssertOK();
-#endif
-}
-
-
-BranchInst::BranchInst(const BranchInst &BI) :
- TerminatorInst(Type::VoidTy, Instruction::Br, Ops, BI.getNumOperands()) {
- OperandList[0].init(BI.getOperand(0), this);
- if (BI.getNumOperands() != 1) {
- assert(BI.getNumOperands() == 3 && "BR can have 1 or 3 operands!");
- OperandList[1].init(BI.getOperand(1), this);
- OperandList[2].init(BI.getOperand(2), this);
- }
-}
-
-BasicBlock *BranchInst::getSuccessorV(unsigned idx) const {
- return getSuccessor(idx);
-}
-unsigned BranchInst::getNumSuccessorsV() const {
- return getNumSuccessors();
-}
-void BranchInst::setSuccessorV(unsigned idx, BasicBlock *B) {
- setSuccessor(idx, B);
-}
-
-
-//===----------------------------------------------------------------------===//
-// AllocationInst Implementation
-//===----------------------------------------------------------------------===//
-
-static Value *getAISize(Value *Amt) {
- if (!Amt)
- Amt = ConstantInt::get(Type::Int32Ty, 1);
- else {
- assert(!isa<BasicBlock>(Amt) &&
- "Passed basic block into allocation size parameter! Use other ctor");
- assert(Amt->getType() == Type::Int32Ty &&
- "Malloc/Allocation array size is not a 32-bit integer!");
- }
- return Amt;
-}
-
-AllocationInst::AllocationInst(const Type *Ty, Value *ArraySize, unsigned iTy,
- unsigned Align, const std::string &Name,
- Instruction *InsertBefore)
- : UnaryInstruction(PointerType::getUnqual(Ty), iTy, getAISize(ArraySize),
- InsertBefore) {
- setAlignment(Align);
- assert(Ty != Type::VoidTy && "Cannot allocate void!");
- setName(Name);
-}
-
-AllocationInst::AllocationInst(const Type *Ty, Value *ArraySize, unsigned iTy,
- unsigned Align, const std::string &Name,
- BasicBlock *InsertAtEnd)
- : UnaryInstruction(PointerType::getUnqual(Ty), iTy, getAISize(ArraySize),
- InsertAtEnd) {
- setAlignment(Align);
- assert(Ty != Type::VoidTy && "Cannot allocate void!");
- setName(Name);
-}
-
-// Out of line virtual method, so the vtable, etc has a home.
-AllocationInst::~AllocationInst() {
-}
-
-void AllocationInst::setAlignment(unsigned Align) {
- assert((Align & (Align-1)) == 0 && "Alignment is not a power of 2!");
- SubclassData = Log2_32(Align) + 1;
- assert(getAlignment() == Align && "Alignment representation error!");
-}
-
-bool AllocationInst::isArrayAllocation() const {
- if (ConstantInt *CI = dyn_cast<ConstantInt>(getOperand(0)))
- return CI->getZExtValue() != 1;
- return true;
-}
-
-const Type *AllocationInst::getAllocatedType() const {
- return getType()->getElementType();
-}
-
-AllocaInst::AllocaInst(const AllocaInst &AI)
- : AllocationInst(AI.getType()->getElementType(), (Value*)AI.getOperand(0),
- Instruction::Alloca, AI.getAlignment()) {
-}
-
-MallocInst::MallocInst(const MallocInst &MI)
- : AllocationInst(MI.getType()->getElementType(), (Value*)MI.getOperand(0),
- Instruction::Malloc, MI.getAlignment()) {
-}
-
-//===----------------------------------------------------------------------===//
-// FreeInst Implementation
-//===----------------------------------------------------------------------===//
-
-void FreeInst::AssertOK() {
- assert(isa<PointerType>(getOperand(0)->getType()) &&
- "Can not free something of nonpointer type!");
-}
-
-FreeInst::FreeInst(Value *Ptr, Instruction *InsertBefore)
- : UnaryInstruction(Type::VoidTy, Free, Ptr, InsertBefore) {
- AssertOK();
-}
-
-FreeInst::FreeInst(Value *Ptr, BasicBlock *InsertAtEnd)
- : UnaryInstruction(Type::VoidTy, Free, Ptr, InsertAtEnd) {
- AssertOK();
-}
-
-
-//===----------------------------------------------------------------------===//
-// LoadInst Implementation
-//===----------------------------------------------------------------------===//
-
-void LoadInst::AssertOK() {
- assert(isa<PointerType>(getOperand(0)->getType()) &&
- "Ptr must have pointer type.");
-}
-
-LoadInst::LoadInst(Value *Ptr, const std::string &Name, Instruction *InsertBef)
- : UnaryInstruction(cast<PointerType>(Ptr->getType())->getElementType(),
- Load, Ptr, InsertBef) {
- setVolatile(false);
- setAlignment(0);
- AssertOK();
- setName(Name);
-}
-
-LoadInst::LoadInst(Value *Ptr, const std::string &Name, BasicBlock *InsertAE)
- : UnaryInstruction(cast<PointerType>(Ptr->getType())->getElementType(),
- Load, Ptr, InsertAE) {
- setVolatile(false);
- setAlignment(0);
- AssertOK();
- setName(Name);
-}
-
-LoadInst::LoadInst(Value *Ptr, const std::string &Name, bool isVolatile,
- Instruction *InsertBef)
- : UnaryInstruction(cast<PointerType>(Ptr->getType())->getElementType(),
- Load, Ptr, InsertBef) {
- setVolatile(isVolatile);
- setAlignment(0);
- AssertOK();
- setName(Name);
-}
-
-LoadInst::LoadInst(Value *Ptr, const std::string &Name, bool isVolatile,
- unsigned Align, Instruction *InsertBef)
- : UnaryInstruction(cast<PointerType>(Ptr->getType())->getElementType(),
- Load, Ptr, InsertBef) {
- setVolatile(isVolatile);
- setAlignment(Align);
- AssertOK();
- setName(Name);
-}
-
-LoadInst::LoadInst(Value *Ptr, const std::string &Name, bool isVolatile,
- unsigned Align, BasicBlock *InsertAE)
- : UnaryInstruction(cast<PointerType>(Ptr->getType())->getElementType(),
- Load, Ptr, InsertAE) {
- setVolatile(isVolatile);
- setAlignment(Align);
- AssertOK();
- setName(Name);
-}
-
-LoadInst::LoadInst(Value *Ptr, const std::string &Name, bool isVolatile,
- BasicBlock *InsertAE)
- : UnaryInstruction(cast<PointerType>(Ptr->getType())->getElementType(),
- Load, Ptr, InsertAE) {
- setVolatile(isVolatile);
- setAlignment(0);
- AssertOK();
- setName(Name);
-}
-
-
-
-LoadInst::LoadInst(Value *Ptr, const char *Name, Instruction *InsertBef)
- : UnaryInstruction(cast<PointerType>(Ptr->getType())->getElementType(),
- Load, Ptr, InsertBef) {
- setVolatile(false);
- setAlignment(0);
- AssertOK();
- if (Name && Name[0]) setName(Name);
-}
-
-LoadInst::LoadInst(Value *Ptr, const char *Name, BasicBlock *InsertAE)
- : UnaryInstruction(cast<PointerType>(Ptr->getType())->getElementType(),
- Load, Ptr, InsertAE) {
- setVolatile(false);
- setAlignment(0);
- AssertOK();
- if (Name && Name[0]) setName(Name);
-}
-
-LoadInst::LoadInst(Value *Ptr, const char *Name, bool isVolatile,
- Instruction *InsertBef)
-: UnaryInstruction(cast<PointerType>(Ptr->getType())->getElementType(),
- Load, Ptr, InsertBef) {
- setVolatile(isVolatile);
- setAlignment(0);
- AssertOK();
- if (Name && Name[0]) setName(Name);
-}
-
-LoadInst::LoadInst(Value *Ptr, const char *Name, bool isVolatile,
- BasicBlock *InsertAE)
- : UnaryInstruction(cast<PointerType>(Ptr->getType())->getElementType(),
- Load, Ptr, InsertAE) {
- setVolatile(isVolatile);
- setAlignment(0);
- AssertOK();
- if (Name && Name[0]) setName(Name);
-}
-
-void LoadInst::setAlignment(unsigned Align) {
- assert((Align & (Align-1)) == 0 && "Alignment is not a power of 2!");
- SubclassData = (SubclassData & 1) | ((Log2_32(Align)+1)<<1);
-}
-
-//===----------------------------------------------------------------------===//
-// StoreInst Implementation
-//===----------------------------------------------------------------------===//
-
-void StoreInst::AssertOK() {
- assert(isa<PointerType>(getOperand(1)->getType()) &&
- "Ptr must have pointer type!");
- assert(getOperand(0)->getType() ==
- cast<PointerType>(getOperand(1)->getType())->getElementType()
- && "Ptr must be a pointer to Val type!");
-}
-
-
-StoreInst::StoreInst(Value *val, Value *addr, Instruction *InsertBefore)
- : Instruction(Type::VoidTy, Store, Ops, 2, InsertBefore) {
- Ops[0].init(val, this);
- Ops[1].init(addr, this);
- setVolatile(false);
- setAlignment(0);
- AssertOK();
-}
-
-StoreInst::StoreInst(Value *val, Value *addr, BasicBlock *InsertAtEnd)
- : Instruction(Type::VoidTy, Store, Ops, 2, InsertAtEnd) {
- Ops[0].init(val, this);
- Ops[1].init(addr, this);
- setVolatile(false);
- setAlignment(0);
- AssertOK();
-}
-
-StoreInst::StoreInst(Value *val, Value *addr, bool isVolatile,
- Instruction *InsertBefore)
- : Instruction(Type::VoidTy, Store, Ops, 2, InsertBefore) {
- Ops[0].init(val, this);
- Ops[1].init(addr, this);
- setVolatile(isVolatile);
- setAlignment(0);
- AssertOK();
-}
-
-StoreInst::StoreInst(Value *val, Value *addr, bool isVolatile,
- unsigned Align, Instruction *InsertBefore)
- : Instruction(Type::VoidTy, Store, Ops, 2, InsertBefore) {
- Ops[0].init(val, this);
- Ops[1].init(addr, this);
- setVolatile(isVolatile);
- setAlignment(Align);
- AssertOK();
-}
-
-StoreInst::StoreInst(Value *val, Value *addr, bool isVolatile,
- unsigned Align, BasicBlock *InsertAtEnd)
- : Instruction(Type::VoidTy, Store, Ops, 2, InsertAtEnd) {
- Ops[0].init(val, this);
- Ops[1].init(addr, this);
- setVolatile(isVolatile);
- setAlignment(Align);
- AssertOK();
-}
-
-StoreInst::StoreInst(Value *val, Value *addr, bool isVolatile,
- BasicBlock *InsertAtEnd)
- : Instruction(Type::VoidTy, Store, Ops, 2, InsertAtEnd) {
- Ops[0].init(val, this);
- Ops[1].init(addr, this);
- setVolatile(isVolatile);
- setAlignment(0);
- AssertOK();
-}
-
-void StoreInst::setAlignment(unsigned Align) {
- assert((Align & (Align-1)) == 0 && "Alignment is not a power of 2!");
- SubclassData = (SubclassData & 1) | ((Log2_32(Align)+1)<<1);
-}
-
-//===----------------------------------------------------------------------===//
-// GetElementPtrInst Implementation
-//===----------------------------------------------------------------------===//
-
-static unsigned retrieveAddrSpace(const Value *Val) {
- return cast<PointerType>(Val->getType())->getAddressSpace();
-}
-
-void GetElementPtrInst::init(Value *Ptr, Value* const *Idx, unsigned NumIdx) {
- NumOperands = 1+NumIdx;
- Use *OL = OperandList = new Use[NumOperands];
- OL[0].init(Ptr, this);
-
- for (unsigned i = 0; i != NumIdx; ++i)
- OL[i+1].init(Idx[i], this);
-}
-
-void GetElementPtrInst::init(Value *Ptr, Value *Idx) {
- NumOperands = 2;
- Use *OL = OperandList = new Use[2];
- OL[0].init(Ptr, this);
- OL[1].init(Idx, this);
-}
-
-GetElementPtrInst::GetElementPtrInst(Value *Ptr, Value *Idx,
- const std::string &Name, Instruction *InBe)
- : Instruction(PointerType::get(checkType(getIndexedType(Ptr->getType(),Idx)),
- retrieveAddrSpace(Ptr)),
- GetElementPtr, 0, 0, InBe) {
- init(Ptr, Idx);
- setName(Name);
-}
-
-GetElementPtrInst::GetElementPtrInst(Value *Ptr, Value *Idx,
- const std::string &Name, BasicBlock *IAE)
- : Instruction(PointerType::get(checkType(getIndexedType(Ptr->getType(),Idx)),
- retrieveAddrSpace(Ptr)),
- GetElementPtr, 0, 0, IAE) {
- init(Ptr, Idx);
- setName(Name);
-}
-
-GetElementPtrInst::~GetElementPtrInst() {
- delete[] OperandList;
-}
-
-// getIndexedType - Returns the type of the element that would be loaded with
-// a load instruction with the specified parameters.
-//
-// A null type is returned if the indices are invalid for the specified
-// pointer type.
-//
-const Type* GetElementPtrInst::getIndexedType(const Type *Ptr,
- Value* const *Idxs,
- unsigned NumIdx,
- bool AllowCompositeLeaf) {
- if (!isa<PointerType>(Ptr)) return 0; // Type isn't a pointer type!
-
- // Handle the special case of the empty set index set...
- if (NumIdx == 0) {
- if (AllowCompositeLeaf ||
- cast<PointerType>(Ptr)->getElementType()->isFirstClassType())
- return cast<PointerType>(Ptr)->getElementType();
- else
- return 0;
- }
-
- unsigned CurIdx = 0;
- while (const CompositeType *CT = dyn_cast<CompositeType>(Ptr)) {
- if (NumIdx == CurIdx) {
- if (AllowCompositeLeaf || CT->isFirstClassType()) return Ptr;
- return 0; // Can't load a whole structure or array!?!?
- }
-
- Value *Index = Idxs[CurIdx++];
- if (isa<PointerType>(CT) && CurIdx != 1)
- return 0; // Can only index into pointer types at the first index!
- if (!CT->indexValid(Index)) return 0;
- Ptr = CT->getTypeAtIndex(Index);
-
- // If the new type forwards to another type, then it is in the middle
- // of being refined to another type (and hence, may have dropped all
- // references to what it was using before). So, use the new forwarded
- // type.
- if (const Type * Ty = Ptr->getForwardedType()) {
- Ptr = Ty;
- }
- }
- return CurIdx == NumIdx ? Ptr : 0;
-}
-
-const Type* GetElementPtrInst::getIndexedType(const Type *Ptr, Value *Idx) {
- const PointerType *PTy = dyn_cast<PointerType>(Ptr);
- if (!PTy) return 0; // Type isn't a pointer type!
-
- // Check the pointer index.
- if (!PTy->indexValid(Idx)) return 0;
-
- return PTy->getElementType();
-}
-
-
-/// hasAllZeroIndices - Return true if all of the indices of this GEP are
-/// zeros. If so, the result pointer and the first operand have the same
-/// value, just potentially different types.
-bool GetElementPtrInst::hasAllZeroIndices() const {
- for (unsigned i = 1, e = getNumOperands(); i != e; ++i) {
- if (ConstantInt *CI = dyn_cast<ConstantInt>(getOperand(i))) {
- if (!CI->isZero()) return false;
- } else {
- return false;
- }
- }
- return true;
-}
-
-/// hasAllConstantIndices - Return true if all of the indices of this GEP are
-/// constant integers. If so, the result pointer and the first operand have
-/// a constant offset between them.
-bool GetElementPtrInst::hasAllConstantIndices() const {
- for (unsigned i = 1, e = getNumOperands(); i != e; ++i) {
- if (!isa<ConstantInt>(getOperand(i)))
- return false;
- }
- return true;
-}
-
-
-//===----------------------------------------------------------------------===//
-// ExtractElementInst Implementation
-//===----------------------------------------------------------------------===//
-
-ExtractElementInst::ExtractElementInst(Value *Val, Value *Index,
- const std::string &Name,
- Instruction *InsertBef)
- : Instruction(cast<VectorType>(Val->getType())->getElementType(),
- ExtractElement, Ops, 2, InsertBef) {
- assert(isValidOperands(Val, Index) &&
- "Invalid extractelement instruction operands!");
- Ops[0].init(Val, this);
- Ops[1].init(Index, this);
- setName(Name);
-}
-
-ExtractElementInst::ExtractElementInst(Value *Val, unsigned IndexV,
- const std::string &Name,
- Instruction *InsertBef)
- : Instruction(cast<VectorType>(Val->getType())->getElementType(),
- ExtractElement, Ops, 2, InsertBef) {
- Constant *Index = ConstantInt::get(Type::Int32Ty, IndexV);
- assert(isValidOperands(Val, Index) &&
- "Invalid extractelement instruction operands!");
- Ops[0].init(Val, this);
- Ops[1].init(Index, this);
- setName(Name);
-}
-
-
-ExtractElementInst::ExtractElementInst(Value *Val, Value *Index,
- const std::string &Name,
- BasicBlock *InsertAE)
- : Instruction(cast<VectorType>(Val->getType())->getElementType(),
- ExtractElement, Ops, 2, InsertAE) {
- assert(isValidOperands(Val, Index) &&
- "Invalid extractelement instruction operands!");
-
- Ops[0].init(Val, this);
- Ops[1].init(Index, this);
- setName(Name);
-}
-
-ExtractElementInst::ExtractElementInst(Value *Val, unsigned IndexV,
- const std::string &Name,
- BasicBlock *InsertAE)
- : Instruction(cast<VectorType>(Val->getType())->getElementType(),
- ExtractElement, Ops, 2, InsertAE) {
- Constant *Index = ConstantInt::get(Type::Int32Ty, IndexV);
- assert(isValidOperands(Val, Index) &&
- "Invalid extractelement instruction operands!");
-
- Ops[0].init(Val, this);
- Ops[1].init(Index, this);
- setName(Name);
-}
-
-
-bool ExtractElementInst::isValidOperands(const Value *Val, const Value *Index) {
- if (!isa<VectorType>(Val->getType()) || Index->getType() != Type::Int32Ty)
- return false;
- return true;
-}
-
-
-//===----------------------------------------------------------------------===//
-// InsertElementInst Implementation
-//===----------------------------------------------------------------------===//
-
-InsertElementInst::InsertElementInst(const InsertElementInst &IE)
- : Instruction(IE.getType(), InsertElement, Ops, 3) {
- Ops[0].init(IE.Ops[0], this);
- Ops[1].init(IE.Ops[1], this);
- Ops[2].init(IE.Ops[2], this);
-}
-InsertElementInst::InsertElementInst(Value *Vec, Value *Elt, Value *Index,
- const std::string &Name,
- Instruction *InsertBef)
- : Instruction(Vec->getType(), InsertElement, Ops, 3, InsertBef) {
- assert(isValidOperands(Vec, Elt, Index) &&
- "Invalid insertelement instruction operands!");
- Ops[0].init(Vec, this);
- Ops[1].init(Elt, this);
- Ops[2].init(Index, this);
- setName(Name);
-}
-
-InsertElementInst::InsertElementInst(Value *Vec, Value *Elt, unsigned IndexV,
- const std::string &Name,
- Instruction *InsertBef)
- : Instruction(Vec->getType(), InsertElement, Ops, 3, InsertBef) {
- Constant *Index = ConstantInt::get(Type::Int32Ty, IndexV);
- assert(isValidOperands(Vec, Elt, Index) &&
- "Invalid insertelement instruction operands!");
- Ops[0].init(Vec, this);
- Ops[1].init(Elt, this);
- Ops[2].init(Index, this);
- setName(Name);
-}
-
-
-InsertElementInst::InsertElementInst(Value *Vec, Value *Elt, Value *Index,
- const std::string &Name,
- BasicBlock *InsertAE)
- : Instruction(Vec->getType(), InsertElement, Ops, 3, InsertAE) {
- assert(isValidOperands(Vec, Elt, Index) &&
- "Invalid insertelement instruction operands!");
-
- Ops[0].init(Vec, this);
- Ops[1].init(Elt, this);
- Ops[2].init(Index, this);
- setName(Name);
-}
-
-InsertElementInst::InsertElementInst(Value *Vec, Value *Elt, unsigned IndexV,
- const std::string &Name,
- BasicBlock *InsertAE)
-: Instruction(Vec->getType(), InsertElement, Ops, 3, InsertAE) {
- Constant *Index = ConstantInt::get(Type::Int32Ty, IndexV);
- assert(isValidOperands(Vec, Elt, Index) &&
- "Invalid insertelement instruction operands!");
-
- Ops[0].init(Vec, this);
- Ops[1].init(Elt, this);
- Ops[2].init(Index, this);
- setName(Name);
-}
-
-bool InsertElementInst::isValidOperands(const Value *Vec, const Value *Elt,
- const Value *Index) {
- if (!isa<VectorType>(Vec->getType()))
- return false; // First operand of insertelement must be vector type.
-
- if (Elt->getType() != cast<VectorType>(Vec->getType())->getElementType())
- return false;// Second operand of insertelement must be vector element type.
-
- if (Index->getType() != Type::Int32Ty)
- return false; // Third operand of insertelement must be uint.
- return true;
-}
-
-
-//===----------------------------------------------------------------------===//
-// ShuffleVectorInst Implementation
-//===----------------------------------------------------------------------===//
-
-ShuffleVectorInst::ShuffleVectorInst(const ShuffleVectorInst &SV)
- : Instruction(SV.getType(), ShuffleVector, Ops, 3) {
- Ops[0].init(SV.Ops[0], this);
- Ops[1].init(SV.Ops[1], this);
- Ops[2].init(SV.Ops[2], this);
-}
-
-ShuffleVectorInst::ShuffleVectorInst(Value *V1, Value *V2, Value *Mask,
- const std::string &Name,
- Instruction *InsertBefore)
- : Instruction(V1->getType(), ShuffleVector, Ops, 3, InsertBefore) {
- assert(isValidOperands(V1, V2, Mask) &&
- "Invalid shuffle vector instruction operands!");
- Ops[0].init(V1, this);
- Ops[1].init(V2, this);
- Ops[2].init(Mask, this);
- setName(Name);
-}
-
-ShuffleVectorInst::ShuffleVectorInst(Value *V1, Value *V2, Value *Mask,
- const std::string &Name,
- BasicBlock *InsertAtEnd)
- : Instruction(V1->getType(), ShuffleVector, Ops, 3, InsertAtEnd) {
- assert(isValidOperands(V1, V2, Mask) &&
- "Invalid shuffle vector instruction operands!");
-
- Ops[0].init(V1, this);
- Ops[1].init(V2, this);
- Ops[2].init(Mask, this);
- setName(Name);
-}
-
-bool ShuffleVectorInst::isValidOperands(const Value *V1, const Value *V2,
- const Value *Mask) {
- if (!isa<VectorType>(V1->getType()) ||
- V1->getType() != V2->getType())
- return false;
-
- const VectorType *MaskTy = dyn_cast<VectorType>(Mask->getType());
- if (!isa<Constant>(Mask) || MaskTy == 0 ||
- MaskTy->getElementType() != Type::Int32Ty ||
- MaskTy->getNumElements() !=
- cast<VectorType>(V1->getType())->getNumElements())
- return false;
- return true;
-}
-
-/// getMaskValue - Return the index from the shuffle mask for the specified
-/// output result. This is either -1 if the element is undef or a number less
-/// than 2*numelements.
-int ShuffleVectorInst::getMaskValue(unsigned i) const {
- const Constant *Mask = cast<Constant>(getOperand(2));
- if (isa<UndefValue>(Mask)) return -1;
- if (isa<ConstantAggregateZero>(Mask)) return 0;
- const ConstantVector *MaskCV = cast<ConstantVector>(Mask);
- assert(i < MaskCV->getNumOperands() && "Index out of range");
-
- if (isa<UndefValue>(MaskCV->getOperand(i)))
- return -1;
- return cast<ConstantInt>(MaskCV->getOperand(i))->getZExtValue();
-}
-
-
-//===----------------------------------------------------------------------===//
-// BinaryOperator Class
-//===----------------------------------------------------------------------===//
-
-BinaryOperator::BinaryOperator(BinaryOps iType, Value *S1, Value *S2,
- const Type *Ty, const std::string &Name,
- Instruction *InsertBefore)
- : Instruction(Ty, iType, Ops, 2, InsertBefore) {
- Ops[0].init(S1, this);
- Ops[1].init(S2, this);
- init(iType);
- setName(Name);
-}
-
-BinaryOperator::BinaryOperator(BinaryOps iType, Value *S1, Value *S2,
- const Type *Ty, const std::string &Name,
- BasicBlock *InsertAtEnd)
- : Instruction(Ty, iType, Ops, 2, InsertAtEnd) {
- Ops[0].init(S1, this);
- Ops[1].init(S2, this);
- init(iType);
- setName(Name);
-}
-
-
-void BinaryOperator::init(BinaryOps iType) {
- Value *LHS = getOperand(0), *RHS = getOperand(1);
- LHS = LHS; RHS = RHS; // Silence warnings.
- assert(LHS->getType() == RHS->getType() &&
- "Binary operator operand types must match!");
-#ifndef NDEBUG
- switch (iType) {
- case Add: case Sub:
- case Mul:
- assert(getType() == LHS->getType() &&
- "Arithmetic operation should return same type as operands!");
- assert((getType()->isInteger() || getType()->isFloatingPoint() ||
- isa<VectorType>(getType())) &&
- "Tried to create an arithmetic operation on a non-arithmetic type!");
- break;
- case UDiv:
- case SDiv:
- assert(getType() == LHS->getType() &&
- "Arithmetic operation should return same type as operands!");
- assert((getType()->isInteger() || (isa<VectorType>(getType()) &&
- cast<VectorType>(getType())->getElementType()->isInteger())) &&
- "Incorrect operand type (not integer) for S/UDIV");
- break;
- case FDiv:
- assert(getType() == LHS->getType() &&
- "Arithmetic operation should return same type as operands!");
- assert((getType()->isFloatingPoint() || (isa<VectorType>(getType()) &&
- cast<VectorType>(getType())->getElementType()->isFloatingPoint()))
- && "Incorrect operand type (not floating point) for FDIV");
- break;
- case URem:
- case SRem:
- assert(getType() == LHS->getType() &&
- "Arithmetic operation should return same type as operands!");
- assert((getType()->isInteger() || (isa<VectorType>(getType()) &&
- cast<VectorType>(getType())->getElementType()->isInteger())) &&
- "Incorrect operand type (not integer) for S/UREM");
- break;
- case FRem:
- assert(getType() == LHS->getType() &&
- "Arithmetic operation should return same type as operands!");
- assert((getType()->isFloatingPoint() || (isa<VectorType>(getType()) &&
- cast<VectorType>(getType())->getElementType()->isFloatingPoint()))
- && "Incorrect operand type (not floating point) for FREM");
- break;
- case Shl:
- case LShr:
- case AShr:
- assert(getType() == LHS->getType() &&
- "Shift operation should return same type as operands!");
- assert(getType()->isInteger() &&
- "Shift operation requires integer operands");
- break;
- case And: case Or:
- case Xor:
- assert(getType() == LHS->getType() &&
- "Logical operation should return same type as operands!");
- assert((getType()->isInteger() ||
- (isa<VectorType>(getType()) &&
- cast<VectorType>(getType())->getElementType()->isInteger())) &&
- "Tried to create a logical operation on a non-integral type!");
- break;
- default:
- break;
- }
-#endif
-}
-
-BinaryOperator *BinaryOperator::create(BinaryOps Op, Value *S1, Value *S2,
- const std::string &Name,
- Instruction *InsertBefore) {
- assert(S1->getType() == S2->getType() &&
- "Cannot create binary operator with two operands of differing type!");
- return new BinaryOperator(Op, S1, S2, S1->getType(), Name, InsertBefore);
-}
-
-BinaryOperator *BinaryOperator::create(BinaryOps Op, Value *S1, Value *S2,
- const std::string &Name,
- BasicBlock *InsertAtEnd) {
- BinaryOperator *Res = create(Op, S1, S2, Name);
- InsertAtEnd->getInstList().push_back(Res);
- return Res;
-}
-
-BinaryOperator *BinaryOperator::createNeg(Value *Op, const std::string &Name,
- Instruction *InsertBefore) {
- Value *zero = ConstantExpr::getZeroValueForNegationExpr(Op->getType());
- return new BinaryOperator(Instruction::Sub,
- zero, Op,
- Op->getType(), Name, InsertBefore);
-}
-
-BinaryOperator *BinaryOperator::createNeg(Value *Op, const std::string &Name,
- BasicBlock *InsertAtEnd) {
- Value *zero = ConstantExpr::getZeroValueForNegationExpr(Op->getType());
- return new BinaryOperator(Instruction::Sub,
- zero, Op,
- Op->getType(), Name, InsertAtEnd);
-}
-
-BinaryOperator *BinaryOperator::createNot(Value *Op, const std::string &Name,
- Instruction *InsertBefore) {
- Constant *C;
- if (const VectorType *PTy = dyn_cast<VectorType>(Op->getType())) {
- C = ConstantInt::getAllOnesValue(PTy->getElementType());
- C = ConstantVector::get(std::vector<Constant*>(PTy->getNumElements(), C));
- } else {
- C = ConstantInt::getAllOnesValue(Op->getType());
- }
-
- return new BinaryOperator(Instruction::Xor, Op, C,
- Op->getType(), Name, InsertBefore);
-}
-
-BinaryOperator *BinaryOperator::createNot(Value *Op, const std::string &Name,
- BasicBlock *InsertAtEnd) {
- Constant *AllOnes;
- if (const VectorType *PTy = dyn_cast<VectorType>(Op->getType())) {
- // Create a vector of all ones values.
- Constant *Elt = ConstantInt::getAllOnesValue(PTy->getElementType());
- AllOnes =
- ConstantVector::get(std::vector<Constant*>(PTy->getNumElements(), Elt));
- } else {
- AllOnes = ConstantInt::getAllOnesValue(Op->getType());
- }
-
- return new BinaryOperator(Instruction::Xor, Op, AllOnes,
- Op->getType(), Name, InsertAtEnd);
-}
-
-
-// isConstantAllOnes - Helper function for several functions below
-static inline bool isConstantAllOnes(const Value *V) {
- if (const ConstantInt *CI = dyn_cast<ConstantInt>(V))
- return CI->isAllOnesValue();
- if (const ConstantVector *CV = dyn_cast<ConstantVector>(V))
- return CV->isAllOnesValue();
- return false;
-}
-
-bool BinaryOperator::isNeg(const Value *V) {
- if (const BinaryOperator *Bop = dyn_cast<BinaryOperator>(V))
- if (Bop->getOpcode() == Instruction::Sub)
- return Bop->getOperand(0) ==
- ConstantExpr::getZeroValueForNegationExpr(Bop->getType());
- return false;
-}
-
-bool BinaryOperator::isNot(const Value *V) {
- if (const BinaryOperator *Bop = dyn_cast<BinaryOperator>(V))
- return (Bop->getOpcode() == Instruction::Xor &&
- (isConstantAllOnes(Bop->getOperand(1)) ||
- isConstantAllOnes(Bop->getOperand(0))));
- return false;
-}
-
-Value *BinaryOperator::getNegArgument(Value *BinOp) {
- assert(isNeg(BinOp) && "getNegArgument from non-'neg' instruction!");
- return cast<BinaryOperator>(BinOp)->getOperand(1);
-}
-
-const Value *BinaryOperator::getNegArgument(const Value *BinOp) {
- return getNegArgument(const_cast<Value*>(BinOp));
-}
-
-Value *BinaryOperator::getNotArgument(Value *BinOp) {
- assert(isNot(BinOp) && "getNotArgument on non-'not' instruction!");
- BinaryOperator *BO = cast<BinaryOperator>(BinOp);
- Value *Op0 = BO->getOperand(0);
- Value *Op1 = BO->getOperand(1);
- if (isConstantAllOnes(Op0)) return Op1;
-
- assert(isConstantAllOnes(Op1));
- return Op0;
-}
-
-const Value *BinaryOperator::getNotArgument(const Value *BinOp) {
- return getNotArgument(const_cast<Value*>(BinOp));
-}
-
-
-// swapOperands - Exchange the two operands to this instruction. This
-// instruction is safe to use on any binary instruction and does not
-// modify the semantics of the instruction. If the instruction is
-// order dependent (SetLT f.e.) the opcode is changed.
-//
-bool BinaryOperator::swapOperands() {
- if (!isCommutative())
- return true; // Can't commute operands
- std::swap(Ops[0], Ops[1]);
- return false;
-}
-
-//===----------------------------------------------------------------------===//
-// CastInst Class
-//===----------------------------------------------------------------------===//
-
-// Just determine if this cast only deals with integral->integral conversion.
-bool CastInst::isIntegerCast() const {
- switch (getOpcode()) {
- default: return false;
- case Instruction::ZExt:
- case Instruction::SExt:
- case Instruction::Trunc:
- return true;
- case Instruction::BitCast:
- return getOperand(0)->getType()->isInteger() && getType()->isInteger();
- }
-}
-
-bool CastInst::isLosslessCast() const {
- // Only BitCast can be lossless, exit fast if we're not BitCast
- if (getOpcode() != Instruction::BitCast)
- return false;
-
- // Identity cast is always lossless
- const Type* SrcTy = getOperand(0)->getType();
- const Type* DstTy = getType();
- if (SrcTy == DstTy)
- return true;
-
- // Pointer to pointer is always lossless.
- if (isa<PointerType>(SrcTy))
- return isa<PointerType>(DstTy);
- return false; // Other types have no identity values
-}
-
-/// This function determines if the CastInst does not require any bits to be
-/// changed in order to effect the cast. Essentially, it identifies cases where
-/// no code gen is necessary for the cast, hence the name no-op cast. For
-/// example, the following are all no-op casts:
-/// # bitcast uint %X, int
-/// # bitcast uint* %x, sbyte*
-/// # bitcast vector< 2 x int > %x, vector< 4 x short>
-/// # ptrtoint uint* %x, uint ; on 32-bit plaforms only
-/// @brief Determine if a cast is a no-op.
-bool CastInst::isNoopCast(const Type *IntPtrTy) const {
- switch (getOpcode()) {
- default:
- assert(!"Invalid CastOp");
- case Instruction::Trunc:
- case Instruction::ZExt:
- case Instruction::SExt:
- case Instruction::FPTrunc:
- case Instruction::FPExt:
- case Instruction::UIToFP:
- case Instruction::SIToFP:
- case Instruction::FPToUI:
- case Instruction::FPToSI:
- return false; // These always modify bits
- case Instruction::BitCast:
- return true; // BitCast never modifies bits.
- case Instruction::PtrToInt:
- return IntPtrTy->getPrimitiveSizeInBits() ==
- getType()->getPrimitiveSizeInBits();
- case Instruction::IntToPtr:
- return IntPtrTy->getPrimitiveSizeInBits() ==
- getOperand(0)->getType()->getPrimitiveSizeInBits();
- }
-}
-
-/// This function determines if a pair of casts can be eliminated and what
-/// opcode should be used in the elimination. This assumes that there are two
-/// instructions like this:
-/// * %F = firstOpcode SrcTy %x to MidTy
-/// * %S = secondOpcode MidTy %F to DstTy
-/// The function returns a resultOpcode so these two casts can be replaced with:
-/// * %Replacement = resultOpcode %SrcTy %x to DstTy
-/// If no such cast is permited, the function returns 0.
-unsigned CastInst::isEliminableCastPair(
- Instruction::CastOps firstOp, Instruction::CastOps secondOp,
- const Type *SrcTy, const Type *MidTy, const Type *DstTy, const Type *IntPtrTy)
-{
- // Define the 144 possibilities for these two cast instructions. The values
- // in this matrix determine what to do in a given situation and select the
- // case in the switch below. The rows correspond to firstOp, the columns
- // correspond to secondOp. In looking at the table below, keep in mind
- // the following cast properties:
- //
- // Size Compare Source Destination
- // Operator Src ? Size Type Sign Type Sign
- // -------- ------------ ------------------- ---------------------
- // TRUNC > Integer Any Integral Any
- // ZEXT < Integral Unsigned Integer Any
- // SEXT < Integral Signed Integer Any
- // FPTOUI n/a FloatPt n/a Integral Unsigned
- // FPTOSI n/a FloatPt n/a Integral Signed
- // UITOFP n/a Integral Unsigned FloatPt n/a
- // SITOFP n/a Integral Signed FloatPt n/a
- // FPTRUNC > FloatPt n/a FloatPt n/a
- // FPEXT < FloatPt n/a FloatPt n/a
- // PTRTOINT n/a Pointer n/a Integral Unsigned
- // INTTOPTR n/a Integral Unsigned Pointer n/a
- // BITCONVERT = FirstClass n/a FirstClass n/a
- //
- // NOTE: some transforms are safe, but we consider them to be non-profitable.
- // For example, we could merge "fptoui double to uint" + "zext uint to ulong",
- // into "fptoui double to ulong", but this loses information about the range
- // of the produced value (we no longer know the top-part is all zeros).
- // Further this conversion is often much more expensive for typical hardware,
- // and causes issues when building libgcc. We disallow fptosi+sext for the
- // same reason.
- const unsigned numCastOps =
- Instruction::CastOpsEnd - Instruction::CastOpsBegin;
- static const uint8_t CastResults[numCastOps][numCastOps] = {
- // T F F U S F F P I B -+
- // R Z S P P I I T P 2 N T |
- // U E E 2 2 2 2 R E I T C +- secondOp
- // N X X U S F F N X N 2 V |
- // C T T I I P P C T T P T -+
- { 1, 0, 0,99,99, 0, 0,99,99,99, 0, 3 }, // Trunc -+
- { 8, 1, 9,99,99, 2, 0,99,99,99, 2, 3 }, // ZExt |
- { 8, 0, 1,99,99, 0, 2,99,99,99, 0, 3 }, // SExt |
- { 0, 0, 0,99,99, 0, 0,99,99,99, 0, 3 }, // FPToUI |
- { 0, 0, 0,99,99, 0, 0,99,99,99, 0, 3 }, // FPToSI |
- { 99,99,99, 0, 0,99,99, 0, 0,99,99, 4 }, // UIToFP +- firstOp
- { 99,99,99, 0, 0,99,99, 0, 0,99,99, 4 }, // SIToFP |
- { 99,99,99, 0, 0,99,99, 1, 0,99,99, 4 }, // FPTrunc |
- { 99,99,99, 2, 2,99,99,10, 2,99,99, 4 }, // FPExt |
- { 1, 0, 0,99,99, 0, 0,99,99,99, 7, 3 }, // PtrToInt |
- { 99,99,99,99,99,99,99,99,99,13,99,12 }, // IntToPtr |
- { 5, 5, 5, 6, 6, 5, 5, 6, 6,11, 5, 1 }, // BitCast -+
- };
-
- int ElimCase = CastResults[firstOp-Instruction::CastOpsBegin]
- [secondOp-Instruction::CastOpsBegin];
- switch (ElimCase) {
- case 0:
- // categorically disallowed
- return 0;
- case 1:
- // allowed, use first cast's opcode
- return firstOp;
- case 2:
- // allowed, use second cast's opcode
- return secondOp;
- case 3:
- // no-op cast in second op implies firstOp as long as the DestTy
- // is integer
- if (DstTy->isInteger())
- return firstOp;
- return 0;
- case 4:
- // no-op cast in second op implies firstOp as long as the DestTy
- // is floating point
- if (DstTy->isFloatingPoint())
- return firstOp;
- return 0;
- case 5:
- // no-op cast in first op implies secondOp as long as the SrcTy
- // is an integer
- if (SrcTy->isInteger())
- return secondOp;
- return 0;
- case 6:
- // no-op cast in first op implies secondOp as long as the SrcTy
- // is a floating point
- if (SrcTy->isFloatingPoint())
- return secondOp;
- return 0;
- case 7: {
- // ptrtoint, inttoptr -> bitcast (ptr -> ptr) if int size is >= ptr size
- unsigned PtrSize = IntPtrTy->getPrimitiveSizeInBits();
- unsigned MidSize = MidTy->getPrimitiveSizeInBits();
- if (MidSize >= PtrSize)
- return Instruction::BitCast;
- return 0;
- }
- case 8: {
- // ext, trunc -> bitcast, if the SrcTy and DstTy are same size
- // ext, trunc -> ext, if sizeof(SrcTy) < sizeof(DstTy)
- // ext, trunc -> trunc, if sizeof(SrcTy) > sizeof(DstTy)
- unsigned SrcSize = SrcTy->getPrimitiveSizeInBits();
- unsigned DstSize = DstTy->getPrimitiveSizeInBits();
- if (SrcSize == DstSize)
- return Instruction::BitCast;
- else if (SrcSize < DstSize)
- return firstOp;
- return secondOp;
- }
- case 9: // zext, sext -> zext, because sext can't sign extend after zext
- return Instruction::ZExt;
- case 10:
- // fpext followed by ftrunc is allowed if the bit size returned to is
- // the same as the original, in which case its just a bitcast
- if (SrcTy == DstTy)
- return Instruction::BitCast;
- return 0; // If the types are not the same we can't eliminate it.
- case 11:
- // bitcast followed by ptrtoint is allowed as long as the bitcast
- // is a pointer to pointer cast.
- if (isa<PointerType>(SrcTy) && isa<PointerType>(MidTy))
- return secondOp;
- return 0;
- case 12:
- // inttoptr, bitcast -> intptr if bitcast is a ptr to ptr cast
- if (isa<PointerType>(MidTy) && isa<PointerType>(DstTy))
- return firstOp;
- return 0;
- case 13: {
- // inttoptr, ptrtoint -> bitcast if SrcSize<=PtrSize and SrcSize==DstSize
- unsigned PtrSize = IntPtrTy->getPrimitiveSizeInBits();
- unsigned SrcSize = SrcTy->getPrimitiveSizeInBits();
- unsigned DstSize = DstTy->getPrimitiveSizeInBits();
- if (SrcSize <= PtrSize && SrcSize == DstSize)
- return Instruction::BitCast;
- return 0;
- }
- case 99:
- // cast combination can't happen (error in input). This is for all cases
- // where the MidTy is not the same for the two cast instructions.
- assert(!"Invalid Cast Combination");
- return 0;
- default:
- assert(!"Error in CastResults table!!!");
- return 0;
- }
- return 0;
-}
-
-CastInst *CastInst::create(Instruction::CastOps op, Value *S, const Type *Ty,
- const std::string &Name, Instruction *InsertBefore) {
- // Construct and return the appropriate CastInst subclass
- switch (op) {
- case Trunc: return new TruncInst (S, Ty, Name, InsertBefore);
- case ZExt: return new ZExtInst (S, Ty, Name, InsertBefore);
- case SExt: return new SExtInst (S, Ty, Name, InsertBefore);
- case FPTrunc: return new FPTruncInst (S, Ty, Name, InsertBefore);
- case FPExt: return new FPExtInst (S, Ty, Name, InsertBefore);
- case UIToFP: return new UIToFPInst (S, Ty, Name, InsertBefore);
- case SIToFP: return new SIToFPInst (S, Ty, Name, InsertBefore);
- case FPToUI: return new FPToUIInst (S, Ty, Name, InsertBefore);
- case FPToSI: return new FPToSIInst (S, Ty, Name, InsertBefore);
- case PtrToInt: return new PtrToIntInst (S, Ty, Name, InsertBefore);
- case IntToPtr: return new IntToPtrInst (S, Ty, Name, InsertBefore);
- case BitCast: return new BitCastInst (S, Ty, Name, InsertBefore);
- default:
- assert(!"Invalid opcode provided");
- }
- return 0;
-}
-
-CastInst *CastInst::create(Instruction::CastOps op, Value *S, const Type *Ty,
- const std::string &Name, BasicBlock *InsertAtEnd) {
- // Construct and return the appropriate CastInst subclass
- switch (op) {
- case Trunc: return new TruncInst (S, Ty, Name, InsertAtEnd);
- case ZExt: return new ZExtInst (S, Ty, Name, InsertAtEnd);
- case SExt: return new SExtInst (S, Ty, Name, InsertAtEnd);
- case FPTrunc: return new FPTruncInst (S, Ty, Name, InsertAtEnd);
- case FPExt: return new FPExtInst (S, Ty, Name, InsertAtEnd);
- case UIToFP: return new UIToFPInst (S, Ty, Name, InsertAtEnd);
- case SIToFP: return new SIToFPInst (S, Ty, Name, InsertAtEnd);
- case FPToUI: return new FPToUIInst (S, Ty, Name, InsertAtEnd);
- case FPToSI: return new FPToSIInst (S, Ty, Name, InsertAtEnd);
- case PtrToInt: return new PtrToIntInst (S, Ty, Name, InsertAtEnd);
- case IntToPtr: return new IntToPtrInst (S, Ty, Name, InsertAtEnd);
- case BitCast: return new BitCastInst (S, Ty, Name, InsertAtEnd);
- default:
- assert(!"Invalid opcode provided");
- }
- return 0;
-}
-
-CastInst *CastInst::createZExtOrBitCast(Value *S, const Type *Ty,
- const std::string &Name,
- Instruction *InsertBefore) {
- if (S->getType()->getPrimitiveSizeInBits() == Ty->getPrimitiveSizeInBits())
- return create(Instruction::BitCast, S, Ty, Name, InsertBefore);
- return create(Instruction::ZExt, S, Ty, Name, InsertBefore);
-}
-
-CastInst *CastInst::createZExtOrBitCast(Value *S, const Type *Ty,
- const std::string &Name,
- BasicBlock *InsertAtEnd) {
- if (S->getType()->getPrimitiveSizeInBits() == Ty->getPrimitiveSizeInBits())
- return create(Instruction::BitCast, S, Ty, Name, InsertAtEnd);
- return create(Instruction::ZExt, S, Ty, Name, InsertAtEnd);
-}
-
-CastInst *CastInst::createSExtOrBitCast(Value *S, const Type *Ty,
- const std::string &Name,
- Instruction *InsertBefore) {
- if (S->getType()->getPrimitiveSizeInBits() == Ty->getPrimitiveSizeInBits())
- return create(Instruction::BitCast, S, Ty, Name, InsertBefore);
- return create(Instruction::SExt, S, Ty, Name, InsertBefore);
-}
-
-CastInst *CastInst::createSExtOrBitCast(Value *S, const Type *Ty,
- const std::string &Name,
- BasicBlock *InsertAtEnd) {
- if (S->getType()->getPrimitiveSizeInBits() == Ty->getPrimitiveSizeInBits())
- return create(Instruction::BitCast, S, Ty, Name, InsertAtEnd);
- return create(Instruction::SExt, S, Ty, Name, InsertAtEnd);
-}
-
-CastInst *CastInst::createTruncOrBitCast(Value *S, const Type *Ty,
- const std::string &Name,
- Instruction *InsertBefore) {
- if (S->getType()->getPrimitiveSizeInBits() == Ty->getPrimitiveSizeInBits())
- return create(Instruction::BitCast, S, Ty, Name, InsertBefore);
- return create(Instruction::Trunc, S, Ty, Name, InsertBefore);
-}
-
-CastInst *CastInst::createTruncOrBitCast(Value *S, const Type *Ty,
- const std::string &Name,
- BasicBlock *InsertAtEnd) {
- if (S->getType()->getPrimitiveSizeInBits() == Ty->getPrimitiveSizeInBits())
- return create(Instruction::BitCast, S, Ty, Name, InsertAtEnd);
- return create(Instruction::Trunc, S, Ty, Name, InsertAtEnd);
-}
-
-CastInst *CastInst::createPointerCast(Value *S, const Type *Ty,
- const std::string &Name,
- BasicBlock *InsertAtEnd) {
- assert(isa<PointerType>(S->getType()) && "Invalid cast");
- assert((Ty->isInteger() || isa<PointerType>(Ty)) &&
- "Invalid cast");
-
- if (Ty->isInteger())
- return create(Instruction::PtrToInt, S, Ty, Name, InsertAtEnd);
- return create(Instruction::BitCast, S, Ty, Name, InsertAtEnd);
-}
-
-/// @brief Create a BitCast or a PtrToInt cast instruction
-CastInst *CastInst::createPointerCast(Value *S, const Type *Ty,
- const std::string &Name,
- Instruction *InsertBefore) {
- assert(isa<PointerType>(S->getType()) && "Invalid cast");
- assert((Ty->isInteger() || isa<PointerType>(Ty)) &&
- "Invalid cast");
-
- if (Ty->isInteger())
- return create(Instruction::PtrToInt, S, Ty, Name, InsertBefore);
- return create(Instruction::BitCast, S, Ty, Name, InsertBefore);
-}
-
-CastInst *CastInst::createIntegerCast(Value *C, const Type *Ty,
- bool isSigned, const std::string &Name,
- Instruction *InsertBefore) {
- assert(C->getType()->isInteger() && Ty->isInteger() && "Invalid cast");
- unsigned SrcBits = C->getType()->getPrimitiveSizeInBits();
- unsigned DstBits = Ty->getPrimitiveSizeInBits();
- Instruction::CastOps opcode =
- (SrcBits == DstBits ? Instruction::BitCast :
- (SrcBits > DstBits ? Instruction::Trunc :
- (isSigned ? Instruction::SExt : Instruction::ZExt)));
- return create(opcode, C, Ty, Name, InsertBefore);
-}
-
-CastInst *CastInst::createIntegerCast(Value *C, const Type *Ty,
- bool isSigned, const std::string &Name,
- BasicBlock *InsertAtEnd) {
- assert(C->getType()->isInteger() && Ty->isInteger() && "Invalid cast");
- unsigned SrcBits = C->getType()->getPrimitiveSizeInBits();
- unsigned DstBits = Ty->getPrimitiveSizeInBits();
- Instruction::CastOps opcode =
- (SrcBits == DstBits ? Instruction::BitCast :
- (SrcBits > DstBits ? Instruction::Trunc :
- (isSigned ? Instruction::SExt : Instruction::ZExt)));
- return create(opcode, C, Ty, Name, InsertAtEnd);
-}
-
-CastInst *CastInst::createFPCast(Value *C, const Type *Ty,
- const std::string &Name,
- Instruction *InsertBefore) {
- assert(C->getType()->isFloatingPoint() && Ty->isFloatingPoint() &&
- "Invalid cast");
- unsigned SrcBits = C->getType()->getPrimitiveSizeInBits();
- unsigned DstBits = Ty->getPrimitiveSizeInBits();
- Instruction::CastOps opcode =
- (SrcBits == DstBits ? Instruction::BitCast :
- (SrcBits > DstBits ? Instruction::FPTrunc : Instruction::FPExt));
- return create(opcode, C, Ty, Name, InsertBefore);
-}
-
-CastInst *CastInst::createFPCast(Value *C, const Type *Ty,
- const std::string &Name,
- BasicBlock *InsertAtEnd) {
- assert(C->getType()->isFloatingPoint() && Ty->isFloatingPoint() &&
- "Invalid cast");
- unsigned SrcBits = C->getType()->getPrimitiveSizeInBits();
- unsigned DstBits = Ty->getPrimitiveSizeInBits();
- Instruction::CastOps opcode =
- (SrcBits == DstBits ? Instruction::BitCast :
- (SrcBits > DstBits ? Instruction::FPTrunc : Instruction::FPExt));
- return create(opcode, C, Ty, Name, InsertAtEnd);
-}
-
-// Check whether it is valid to call getCastOpcode for these types.
-// This routine must be kept in sync with getCastOpcode.
-bool CastInst::isCastable(const Type *SrcTy, const Type *DestTy) {
- if (!SrcTy->isFirstClassType() || !DestTy->isFirstClassType())
- return false;
-
- if (SrcTy == DestTy)
- return true;
-
- // Get the bit sizes, we'll need these
- unsigned SrcBits = SrcTy->getPrimitiveSizeInBits(); // 0 for ptr/vector
- unsigned DestBits = DestTy->getPrimitiveSizeInBits(); // 0 for ptr/vector
-
- // Run through the possibilities ...
- if (DestTy->isInteger()) { // Casting to integral
- if (SrcTy->isInteger()) { // Casting from integral
- return true;
- } else if (SrcTy->isFloatingPoint()) { // Casting from floating pt
- return true;
- } else if (const VectorType *PTy = dyn_cast<VectorType>(SrcTy)) {
- // Casting from vector
- return DestBits == PTy->getBitWidth();
- } else { // Casting from something else
- return isa<PointerType>(SrcTy);
- }
- } else if (DestTy->isFloatingPoint()) { // Casting to floating pt
- if (SrcTy->isInteger()) { // Casting from integral
- return true;
- } else if (SrcTy->isFloatingPoint()) { // Casting from floating pt
- return true;
- } else if (const VectorType *PTy = dyn_cast<VectorType>(SrcTy)) {
- // Casting from vector
- return DestBits == PTy->getBitWidth();
- } else { // Casting from something else
- return false;
- }
- } else if (const VectorType *DestPTy = dyn_cast<VectorType>(DestTy)) {
- // Casting to vector
- if (const VectorType *SrcPTy = dyn_cast<VectorType>(SrcTy)) {
- // Casting from vector
- return DestPTy->getBitWidth() == SrcPTy->getBitWidth();
- } else { // Casting from something else
- return DestPTy->getBitWidth() == SrcBits;
- }
- } else if (isa<PointerType>(DestTy)) { // Casting to pointer
- if (isa<PointerType>(SrcTy)) { // Casting from pointer
- return true;
- } else if (SrcTy->isInteger()) { // Casting from integral
- return true;
- } else { // Casting from something else
- return false;
- }
- } else { // Casting to something else
- return false;
- }
-}
-
-// Provide a way to get a "cast" where the cast opcode is inferred from the
-// types and size of the operand. This, basically, is a parallel of the
-// logic in the castIsValid function below. This axiom should hold:
-// castIsValid( getCastOpcode(Val, Ty), Val, Ty)
-// should not assert in castIsValid. In other words, this produces a "correct"
-// casting opcode for the arguments passed to it.
-// This routine must be kept in sync with isCastable.
-Instruction::CastOps
-CastInst::getCastOpcode(
- const Value *Src, bool SrcIsSigned, const Type *DestTy, bool DestIsSigned) {
- // Get the bit sizes, we'll need these
- const Type *SrcTy = Src->getType();
- unsigned SrcBits = SrcTy->getPrimitiveSizeInBits(); // 0 for ptr/vector
- unsigned DestBits = DestTy->getPrimitiveSizeInBits(); // 0 for ptr/vector
-
- assert(SrcTy->isFirstClassType() && DestTy->isFirstClassType() &&
- "Only first class types are castable!");
-
- // Run through the possibilities ...
- if (DestTy->isInteger()) { // Casting to integral
- if (SrcTy->isInteger()) { // Casting from integral
- if (DestBits < SrcBits)
- return Trunc; // int -> smaller int
- else if (DestBits > SrcBits) { // its an extension
- if (SrcIsSigned)
- return SExt; // signed -> SEXT
- else
- return ZExt; // unsigned -> ZEXT
- } else {
- return BitCast; // Same size, No-op cast
- }
- } else if (SrcTy->isFloatingPoint()) { // Casting from floating pt
- if (DestIsSigned)
- return FPToSI; // FP -> sint
- else
- return FPToUI; // FP -> uint
- } else if (const VectorType *PTy = dyn_cast<VectorType>(SrcTy)) {
- assert(DestBits == PTy->getBitWidth() &&
- "Casting vector to integer of different width");
- return BitCast; // Same size, no-op cast
- } else {
- assert(isa<PointerType>(SrcTy) &&
- "Casting from a value that is not first-class type");
- return PtrToInt; // ptr -> int
- }
- } else if (DestTy->isFloatingPoint()) { // Casting to floating pt
- if (SrcTy->isInteger()) { // Casting from integral
- if (SrcIsSigned)
- return SIToFP; // sint -> FP
- else
- return UIToFP; // uint -> FP
- } else if (SrcTy->isFloatingPoint()) { // Casting from floating pt
- if (DestBits < SrcBits) {
- return FPTrunc; // FP -> smaller FP
- } else if (DestBits > SrcBits) {
- return FPExt; // FP -> larger FP
- } else {
- return BitCast; // same size, no-op cast
- }
- } else if (const VectorType *PTy = dyn_cast<VectorType>(SrcTy)) {
- assert(DestBits == PTy->getBitWidth() &&
- "Casting vector to floating point of different width");
- return BitCast; // same size, no-op cast
- } else {
- assert(0 && "Casting pointer or non-first class to float");
- }
- } else if (const VectorType *DestPTy = dyn_cast<VectorType>(DestTy)) {
- if (const VectorType *SrcPTy = dyn_cast<VectorType>(SrcTy)) {
- assert(DestPTy->getBitWidth() == SrcPTy->getBitWidth() &&
- "Casting vector to vector of different widths");
- return BitCast; // vector -> vector
- } else if (DestPTy->getBitWidth() == SrcBits) {
- return BitCast; // float/int -> vector
- } else {
- assert(!"Illegal cast to vector (wrong type or size)");
- }
- } else if (isa<PointerType>(DestTy)) {
- if (isa<PointerType>(SrcTy)) {
- return BitCast; // ptr -> ptr
- } else if (SrcTy->isInteger()) {
- return IntToPtr; // int -> ptr
- } else {
- assert(!"Casting pointer to other than pointer or int");
- }
- } else {
- assert(!"Casting to type that is not first-class");
- }
-
- // If we fall through to here we probably hit an assertion cast above
- // and assertions are not turned on. Anything we return is an error, so
- // BitCast is as good a choice as any.
- return BitCast;
-}
-
-//===----------------------------------------------------------------------===//
-// CastInst SubClass Constructors
-//===----------------------------------------------------------------------===//
-
-/// Check that the construction parameters for a CastInst are correct. This
-/// could be broken out into the separate constructors but it is useful to have
-/// it in one place and to eliminate the redundant code for getting the sizes
-/// of the types involved.
-bool
-CastInst::castIsValid(Instruction::CastOps op, Value *S, const Type *DstTy) {
-
- // Check for type sanity on the arguments
- const Type *SrcTy = S->getType();
- if (!SrcTy->isFirstClassType() || !DstTy->isFirstClassType())
- return false;
-
- // Get the size of the types in bits, we'll need this later
- unsigned SrcBitSize = SrcTy->getPrimitiveSizeInBits();
- unsigned DstBitSize = DstTy->getPrimitiveSizeInBits();
-
- // Switch on the opcode provided
- switch (op) {
- default: return false; // This is an input error
- case Instruction::Trunc:
- return SrcTy->isInteger() && DstTy->isInteger()&& SrcBitSize > DstBitSize;
- case Instruction::ZExt:
- return SrcTy->isInteger() && DstTy->isInteger()&& SrcBitSize < DstBitSize;
- case Instruction::SExt:
- return SrcTy->isInteger() && DstTy->isInteger()&& SrcBitSize < DstBitSize;
- case Instruction::FPTrunc:
- return SrcTy->isFloatingPoint() && DstTy->isFloatingPoint() &&
- SrcBitSize > DstBitSize;
- case Instruction::FPExt:
- return SrcTy->isFloatingPoint() && DstTy->isFloatingPoint() &&
- SrcBitSize < DstBitSize;
- case Instruction::UIToFP:
- case Instruction::SIToFP:
- if (const VectorType *SVTy = dyn_cast<VectorType>(SrcTy)) {
- if (const VectorType *DVTy = dyn_cast<VectorType>(DstTy)) {
- return SVTy->getElementType()->isInteger() &&
- DVTy->getElementType()->isFloatingPoint() &&
- SVTy->getNumElements() == DVTy->getNumElements();
- }
- }
- return SrcTy->isInteger() && DstTy->isFloatingPoint();
- case Instruction::FPToUI:
- case Instruction::FPToSI:
- if (const VectorType *SVTy = dyn_cast<VectorType>(SrcTy)) {
- if (const VectorType *DVTy = dyn_cast<VectorType>(DstTy)) {
- return SVTy->getElementType()->isFloatingPoint() &&
- DVTy->getElementType()->isInteger() &&
- SVTy->getNumElements() == DVTy->getNumElements();
- }
- }
- return SrcTy->isFloatingPoint() && DstTy->isInteger();
- case Instruction::PtrToInt:
- return isa<PointerType>(SrcTy) && DstTy->isInteger();
- case Instruction::IntToPtr:
- return SrcTy->isInteger() && isa<PointerType>(DstTy);
- case Instruction::BitCast:
- // BitCast implies a no-op cast of type only. No bits change.
- // However, you can't cast pointers to anything but pointers.
- if (isa<PointerType>(SrcTy) != isa<PointerType>(DstTy))
- return false;
-
- // Now we know we're not dealing with a pointer/non-pointer mismatch. In all
- // these cases, the cast is okay if the source and destination bit widths
- // are identical.
- return SrcBitSize == DstBitSize;
- }
-}
-
-TruncInst::TruncInst(
- Value *S, const Type *Ty, const std::string &Name, Instruction *InsertBefore
-) : CastInst(Ty, Trunc, S, Name, InsertBefore) {
- assert(castIsValid(getOpcode(), S, Ty) && "Illegal Trunc");
-}
-
-TruncInst::TruncInst(
- Value *S, const Type *Ty, const std::string &Name, BasicBlock *InsertAtEnd
-) : CastInst(Ty, Trunc, S, Name, InsertAtEnd) {
- assert(castIsValid(getOpcode(), S, Ty) && "Illegal Trunc");
-}
-
-ZExtInst::ZExtInst(
- Value *S, const Type *Ty, const std::string &Name, Instruction *InsertBefore
-) : CastInst(Ty, ZExt, S, Name, InsertBefore) {
- assert(castIsValid(getOpcode(), S, Ty) && "Illegal ZExt");
-}
-
-ZExtInst::ZExtInst(
- Value *S, const Type *Ty, const std::string &Name, BasicBlock *InsertAtEnd
-) : CastInst(Ty, ZExt, S, Name, InsertAtEnd) {
- assert(castIsValid(getOpcode(), S, Ty) && "Illegal ZExt");
-}
-SExtInst::SExtInst(
- Value *S, const Type *Ty, const std::string &Name, Instruction *InsertBefore
-) : CastInst(Ty, SExt, S, Name, InsertBefore) {
- assert(castIsValid(getOpcode(), S, Ty) && "Illegal SExt");
-}
-
-SExtInst::SExtInst(
- Value *S, const Type *Ty, const std::string &Name, BasicBlock *InsertAtEnd
-) : CastInst(Ty, SExt, S, Name, InsertAtEnd) {
- assert(castIsValid(getOpcode(), S, Ty) && "Illegal SExt");
-}
-
-FPTruncInst::FPTruncInst(
- Value *S, const Type *Ty, const std::string &Name, Instruction *InsertBefore
-) : CastInst(Ty, FPTrunc, S, Name, InsertBefore) {
- assert(castIsValid(getOpcode(), S, Ty) && "Illegal FPTrunc");
-}
-
-FPTruncInst::FPTruncInst(
- Value *S, const Type *Ty, const std::string &Name, BasicBlock *InsertAtEnd
-) : CastInst(Ty, FPTrunc, S, Name, InsertAtEnd) {
- assert(castIsValid(getOpcode(), S, Ty) && "Illegal FPTrunc");
-}
-
-FPExtInst::FPExtInst(
- Value *S, const Type *Ty, const std::string &Name, Instruction *InsertBefore
-) : CastInst(Ty, FPExt, S, Name, InsertBefore) {
- assert(castIsValid(getOpcode(), S, Ty) && "Illegal FPExt");
-}
-
-FPExtInst::FPExtInst(
- Value *S, const Type *Ty, const std::string &Name, BasicBlock *InsertAtEnd
-) : CastInst(Ty, FPExt, S, Name, InsertAtEnd) {
- assert(castIsValid(getOpcode(), S, Ty) && "Illegal FPExt");
-}
-
-UIToFPInst::UIToFPInst(
- Value *S, const Type *Ty, const std::string &Name, Instruction *InsertBefore
-) : CastInst(Ty, UIToFP, S, Name, InsertBefore) {
- assert(castIsValid(getOpcode(), S, Ty) && "Illegal UIToFP");
-}
-
-UIToFPInst::UIToFPInst(
- Value *S, const Type *Ty, const std::string &Name, BasicBlock *InsertAtEnd
-) : CastInst(Ty, UIToFP, S, Name, InsertAtEnd) {
- assert(castIsValid(getOpcode(), S, Ty) && "Illegal UIToFP");
-}
-
-SIToFPInst::SIToFPInst(
- Value *S, const Type *Ty, const std::string &Name, Instruction *InsertBefore
-) : CastInst(Ty, SIToFP, S, Name, InsertBefore) {
- assert(castIsValid(getOpcode(), S, Ty) && "Illegal SIToFP");
-}
-
-SIToFPInst::SIToFPInst(
- Value *S, const Type *Ty, const std::string &Name, BasicBlock *InsertAtEnd
-) : CastInst(Ty, SIToFP, S, Name, InsertAtEnd) {
- assert(castIsValid(getOpcode(), S, Ty) && "Illegal SIToFP");
-}
-
-FPToUIInst::FPToUIInst(
- Value *S, const Type *Ty, const std::string &Name, Instruction *InsertBefore
-) : CastInst(Ty, FPToUI, S, Name, InsertBefore) {
- assert(castIsValid(getOpcode(), S, Ty) && "Illegal FPToUI");
-}
-
-FPToUIInst::FPToUIInst(
- Value *S, const Type *Ty, const std::string &Name, BasicBlock *InsertAtEnd
-) : CastInst(Ty, FPToUI, S, Name, InsertAtEnd) {
- assert(castIsValid(getOpcode(), S, Ty) && "Illegal FPToUI");
-}
-
-FPToSIInst::FPToSIInst(
- Value *S, const Type *Ty, const std::string &Name, Instruction *InsertBefore
-) : CastInst(Ty, FPToSI, S, Name, InsertBefore) {
- assert(castIsValid(getOpcode(), S, Ty) && "Illegal FPToSI");
-}
-
-FPToSIInst::FPToSIInst(
- Value *S, const Type *Ty, const std::string &Name, BasicBlock *InsertAtEnd
-) : CastInst(Ty, FPToSI, S, Name, InsertAtEnd) {
- assert(castIsValid(getOpcode(), S, Ty) && "Illegal FPToSI");
-}
-
-PtrToIntInst::PtrToIntInst(
- Value *S, const Type *Ty, const std::string &Name, Instruction *InsertBefore
-) : CastInst(Ty, PtrToInt, S, Name, InsertBefore) {
- assert(castIsValid(getOpcode(), S, Ty) && "Illegal PtrToInt");
-}
-
-PtrToIntInst::PtrToIntInst(
- Value *S, const Type *Ty, const std::string &Name, BasicBlock *InsertAtEnd
-) : CastInst(Ty, PtrToInt, S, Name, InsertAtEnd) {
- assert(castIsValid(getOpcode(), S, Ty) && "Illegal PtrToInt");
-}
-
-IntToPtrInst::IntToPtrInst(
- Value *S, const Type *Ty, const std::string &Name, Instruction *InsertBefore
-) : CastInst(Ty, IntToPtr, S, Name, InsertBefore) {
- assert(castIsValid(getOpcode(), S, Ty) && "Illegal IntToPtr");
-}
-
-IntToPtrInst::IntToPtrInst(
- Value *S, const Type *Ty, const std::string &Name, BasicBlock *InsertAtEnd
-) : CastInst(Ty, IntToPtr, S, Name, InsertAtEnd) {
- assert(castIsValid(getOpcode(), S, Ty) && "Illegal IntToPtr");
-}
-
-BitCastInst::BitCastInst(
- Value *S, const Type *Ty, const std::string &Name, Instruction *InsertBefore
-) : CastInst(Ty, BitCast, S, Name, InsertBefore) {
- assert(castIsValid(getOpcode(), S, Ty) && "Illegal BitCast");
-}
-
-BitCastInst::BitCastInst(
- Value *S, const Type *Ty, const std::string &Name, BasicBlock *InsertAtEnd
-) : CastInst(Ty, BitCast, S, Name, InsertAtEnd) {
- assert(castIsValid(getOpcode(), S, Ty) && "Illegal BitCast");
-}
-
-//===----------------------------------------------------------------------===//
-// CmpInst Classes
-//===----------------------------------------------------------------------===//
-
-CmpInst::CmpInst(OtherOps op, unsigned short predicate, Value *LHS, Value *RHS,
- const std::string &Name, Instruction *InsertBefore)
- : Instruction(Type::Int1Ty, op, Ops, 2, InsertBefore) {
- Ops[0].init(LHS, this);
- Ops[1].init(RHS, this);
- SubclassData = predicate;
- setName(Name);
- if (op == Instruction::ICmp) {
- assert(predicate >= ICmpInst::FIRST_ICMP_PREDICATE &&
- predicate <= ICmpInst::LAST_ICMP_PREDICATE &&
- "Invalid ICmp predicate value");
- const Type* Op0Ty = getOperand(0)->getType();
- const Type* Op1Ty = getOperand(1)->getType();
- assert(Op0Ty == Op1Ty &&
- "Both operands to ICmp instruction are not of the same type!");
- // Check that the operands are the right type
- assert((Op0Ty->isInteger() || isa<PointerType>(Op0Ty)) &&
- "Invalid operand types for ICmp instruction");
- return;
- }
- assert(op == Instruction::FCmp && "Invalid CmpInst opcode");
- assert(predicate <= FCmpInst::LAST_FCMP_PREDICATE &&
- "Invalid FCmp predicate value");
- const Type* Op0Ty = getOperand(0)->getType();
- const Type* Op1Ty = getOperand(1)->getType();
- assert(Op0Ty == Op1Ty &&
- "Both operands to FCmp instruction are not of the same type!");
- // Check that the operands are the right type
- assert(Op0Ty->isFloatingPoint() &&
- "Invalid operand types for FCmp instruction");
-}
-
-CmpInst::CmpInst(OtherOps op, unsigned short predicate, Value *LHS, Value *RHS,
- const std::string &Name, BasicBlock *InsertAtEnd)
- : Instruction(Type::Int1Ty, op, Ops, 2, InsertAtEnd) {
- Ops[0].init(LHS, this);
- Ops[1].init(RHS, this);
- SubclassData = predicate;
- setName(Name);
- if (op == Instruction::ICmp) {
- assert(predicate >= ICmpInst::FIRST_ICMP_PREDICATE &&
- predicate <= ICmpInst::LAST_ICMP_PREDICATE &&
- "Invalid ICmp predicate value");
-
- const Type* Op0Ty = getOperand(0)->getType();
- const Type* Op1Ty = getOperand(1)->getType();
- assert(Op0Ty == Op1Ty &&
- "Both operands to ICmp instruction are not of the same type!");
- // Check that the operands are the right type
- assert((Op0Ty->isInteger() || isa<PointerType>(Op0Ty)) &&
- "Invalid operand types for ICmp instruction");
- return;
- }
- assert(op == Instruction::FCmp && "Invalid CmpInst opcode");
- assert(predicate <= FCmpInst::LAST_FCMP_PREDICATE &&
- "Invalid FCmp predicate value");
- const Type* Op0Ty = getOperand(0)->getType();
- const Type* Op1Ty = getOperand(1)->getType();
- assert(Op0Ty == Op1Ty &&
- "Both operands to FCmp instruction are not of the same type!");
- // Check that the operands are the right type
- assert(Op0Ty->isFloatingPoint() &&
- "Invalid operand types for FCmp instruction");
-}
-
-CmpInst *
-CmpInst::create(OtherOps Op, unsigned short predicate, Value *S1, Value *S2,
- const std::string &Name, Instruction *InsertBefore) {
- if (Op == Instruction::ICmp) {
- return new ICmpInst(ICmpInst::Predicate(predicate), S1, S2, Name,
- InsertBefore);
- }
- return new FCmpInst(FCmpInst::Predicate(predicate), S1, S2, Name,
- InsertBefore);
-}
-
-CmpInst *
-CmpInst::create(OtherOps Op, unsigned short predicate, Value *S1, Value *S2,
- const std::string &Name, BasicBlock *InsertAtEnd) {
- if (Op == Instruction::ICmp) {
- return new ICmpInst(ICmpInst::Predicate(predicate), S1, S2, Name,
- InsertAtEnd);
- }
- return new FCmpInst(FCmpInst::Predicate(predicate), S1, S2, Name,
- InsertAtEnd);
-}
-
-void CmpInst::swapOperands() {
- if (ICmpInst *IC = dyn_cast<ICmpInst>(this))
- IC->swapOperands();
- else
- cast<FCmpInst>(this)->swapOperands();
-}
-
-bool CmpInst::isCommutative() {
- if (ICmpInst *IC = dyn_cast<ICmpInst>(this))
- return IC->isCommutative();
- return cast<FCmpInst>(this)->isCommutative();
-}
-
-bool CmpInst::isEquality() {
- if (ICmpInst *IC = dyn_cast<ICmpInst>(this))
- return IC->isEquality();
- return cast<FCmpInst>(this)->isEquality();
-}
-
-
-ICmpInst::Predicate ICmpInst::getInversePredicate(Predicate pred) {
- switch (pred) {
- default:
- assert(!"Unknown icmp predicate!");
- case ICMP_EQ: return ICMP_NE;
- case ICMP_NE: return ICMP_EQ;
- case ICMP_UGT: return ICMP_ULE;
- case ICMP_ULT: return ICMP_UGE;
- case ICMP_UGE: return ICMP_ULT;
- case ICMP_ULE: return ICMP_UGT;
- case ICMP_SGT: return ICMP_SLE;
- case ICMP_SLT: return ICMP_SGE;
- case ICMP_SGE: return ICMP_SLT;
- case ICMP_SLE: return ICMP_SGT;
- }
-}
-
-ICmpInst::Predicate ICmpInst::getSwappedPredicate(Predicate pred) {
- switch (pred) {
- default: assert(! "Unknown icmp predicate!");
- case ICMP_EQ: case ICMP_NE:
- return pred;
- case ICMP_SGT: return ICMP_SLT;
- case ICMP_SLT: return ICMP_SGT;
- case ICMP_SGE: return ICMP_SLE;
- case ICMP_SLE: return ICMP_SGE;
- case ICMP_UGT: return ICMP_ULT;
- case ICMP_ULT: return ICMP_UGT;
- case ICMP_UGE: return ICMP_ULE;
- case ICMP_ULE: return ICMP_UGE;
- }
-}
-
-ICmpInst::Predicate ICmpInst::getSignedPredicate(Predicate pred) {
- switch (pred) {
- default: assert(! "Unknown icmp predicate!");
- case ICMP_EQ: case ICMP_NE:
- case ICMP_SGT: case ICMP_SLT: case ICMP_SGE: case ICMP_SLE:
- return pred;
- case ICMP_UGT: return ICMP_SGT;
- case ICMP_ULT: return ICMP_SLT;
- case ICMP_UGE: return ICMP_SGE;
- case ICMP_ULE: return ICMP_SLE;
- }
-}
-
-ICmpInst::Predicate ICmpInst::getUnsignedPredicate(Predicate pred) {
- switch (pred) {
- default: assert(! "Unknown icmp predicate!");
- case ICMP_EQ: case ICMP_NE:
- case ICMP_UGT: case ICMP_ULT: case ICMP_UGE: case ICMP_ULE:
- return pred;
- case ICMP_SGT: return ICMP_UGT;
- case ICMP_SLT: return ICMP_ULT;
- case ICMP_SGE: return ICMP_UGE;
- case ICMP_SLE: return ICMP_ULE;
- }
-}
-
-bool ICmpInst::isSignedPredicate(Predicate pred) {
- switch (pred) {
- default: assert(! "Unknown icmp predicate!");
- case ICMP_SGT: case ICMP_SLT: case ICMP_SGE: case ICMP_SLE:
- return true;
- case ICMP_EQ: case ICMP_NE: case ICMP_UGT: case ICMP_ULT:
- case ICMP_UGE: case ICMP_ULE:
- return false;
- }
-}
-
-/// Initialize a set of values that all satisfy the condition with C.
-///
-ConstantRange
-ICmpInst::makeConstantRange(Predicate pred, const APInt &C) {
- APInt Lower(C);
- APInt Upper(C);
- uint32_t BitWidth = C.getBitWidth();
- switch (pred) {
- default: assert(0 && "Invalid ICmp opcode to ConstantRange ctor!");
- case ICmpInst::ICMP_EQ: Upper++; break;
- case ICmpInst::ICMP_NE: Lower++; break;
- case ICmpInst::ICMP_ULT: Lower = APInt::getMinValue(BitWidth); break;
- case ICmpInst::ICMP_SLT: Lower = APInt::getSignedMinValue(BitWidth); break;
- case ICmpInst::ICMP_UGT:
- Lower++; Upper = APInt::getMinValue(BitWidth); // Min = Next(Max)
- break;
- case ICmpInst::ICMP_SGT:
- Lower++; Upper = APInt::getSignedMinValue(BitWidth); // Min = Next(Max)
- break;
- case ICmpInst::ICMP_ULE:
- Lower = APInt::getMinValue(BitWidth); Upper++;
- break;
- case ICmpInst::ICMP_SLE:
- Lower = APInt::getSignedMinValue(BitWidth); Upper++;
- break;
- case ICmpInst::ICMP_UGE:
- Upper = APInt::getMinValue(BitWidth); // Min = Next(Max)
- break;
- case ICmpInst::ICMP_SGE:
- Upper = APInt::getSignedMinValue(BitWidth); // Min = Next(Max)
- break;
- }
- return ConstantRange(Lower, Upper);
-}
-
-FCmpInst::Predicate FCmpInst::getInversePredicate(Predicate pred) {
- switch (pred) {
- default:
- assert(!"Unknown icmp predicate!");
- case FCMP_OEQ: return FCMP_UNE;
- case FCMP_ONE: return FCMP_UEQ;
- case FCMP_OGT: return FCMP_ULE;
- case FCMP_OLT: return FCMP_UGE;
- case FCMP_OGE: return FCMP_ULT;
- case FCMP_OLE: return FCMP_UGT;
- case FCMP_UEQ: return FCMP_ONE;
- case FCMP_UNE: return FCMP_OEQ;
- case FCMP_UGT: return FCMP_OLE;
- case FCMP_ULT: return FCMP_OGE;
- case FCMP_UGE: return FCMP_OLT;
- case FCMP_ULE: return FCMP_OGT;
- case FCMP_ORD: return FCMP_UNO;
- case FCMP_UNO: return FCMP_ORD;
- case FCMP_TRUE: return FCMP_FALSE;
- case FCMP_FALSE: return FCMP_TRUE;
- }
-}
-
-FCmpInst::Predicate FCmpInst::getSwappedPredicate(Predicate pred) {
- switch (pred) {
- default: assert(!"Unknown fcmp predicate!");
- case FCMP_FALSE: case FCMP_TRUE:
- case FCMP_OEQ: case FCMP_ONE:
- case FCMP_UEQ: case FCMP_UNE:
- case FCMP_ORD: case FCMP_UNO:
- return pred;
- case FCMP_OGT: return FCMP_OLT;
- case FCMP_OLT: return FCMP_OGT;
- case FCMP_OGE: return FCMP_OLE;
- case FCMP_OLE: return FCMP_OGE;
- case FCMP_UGT: return FCMP_ULT;
- case FCMP_ULT: return FCMP_UGT;
- case FCMP_UGE: return FCMP_ULE;
- case FCMP_ULE: return FCMP_UGE;
- }
-}
-
-bool CmpInst::isUnsigned(unsigned short predicate) {
- switch (predicate) {
- default: return false;
- case ICmpInst::ICMP_ULT: case ICmpInst::ICMP_ULE: case ICmpInst::ICMP_UGT:
- case ICmpInst::ICMP_UGE: return true;
- }
-}
-
-bool CmpInst::isSigned(unsigned short predicate){
- switch (predicate) {
- default: return false;
- case ICmpInst::ICMP_SLT: case ICmpInst::ICMP_SLE: case ICmpInst::ICMP_SGT:
- case ICmpInst::ICMP_SGE: return true;
- }
-}
-
-bool CmpInst::isOrdered(unsigned short predicate) {
- switch (predicate) {
- default: return false;
- case FCmpInst::FCMP_OEQ: case FCmpInst::FCMP_ONE: case FCmpInst::FCMP_OGT:
- case FCmpInst::FCMP_OLT: case FCmpInst::FCMP_OGE: case FCmpInst::FCMP_OLE:
- case FCmpInst::FCMP_ORD: return true;
- }
-}
-
-bool CmpInst::isUnordered(unsigned short predicate) {
- switch (predicate) {
- default: return false;
- case FCmpInst::FCMP_UEQ: case FCmpInst::FCMP_UNE: case FCmpInst::FCMP_UGT:
- case FCmpInst::FCMP_ULT: case FCmpInst::FCMP_UGE: case FCmpInst::FCMP_ULE:
- case FCmpInst::FCMP_UNO: return true;
- }
-}
-
-//===----------------------------------------------------------------------===//
-// SwitchInst Implementation
-//===----------------------------------------------------------------------===//
-
-void SwitchInst::init(Value *Value, BasicBlock *Default, unsigned NumCases) {
- assert(Value && Default);
- ReservedSpace = 2+NumCases*2;
- NumOperands = 2;
- OperandList = new Use[ReservedSpace];
-
- OperandList[0].init(Value, this);
- OperandList[1].init(Default, this);
-}
-
-/// SwitchInst ctor - Create a new switch instruction, specifying a value to
-/// switch on and a default destination. The number of additional cases can
-/// be specified here to make memory allocation more efficient. This
-/// constructor can also autoinsert before another instruction.
-SwitchInst::SwitchInst(Value *Value, BasicBlock *Default, unsigned NumCases,
- Instruction *InsertBefore)
- : TerminatorInst(Type::VoidTy, Instruction::Switch, 0, 0, InsertBefore) {
- init(Value, Default, NumCases);
-}
-
-/// SwitchInst ctor - Create a new switch instruction, specifying a value to
-/// switch on and a default destination. The number of additional cases can
-/// be specified here to make memory allocation more efficient. This
-/// constructor also autoinserts at the end of the specified BasicBlock.
-SwitchInst::SwitchInst(Value *Value, BasicBlock *Default, unsigned NumCases,
- BasicBlock *InsertAtEnd)
- : TerminatorInst(Type::VoidTy, Instruction::Switch, 0, 0, InsertAtEnd) {
- init(Value, Default, NumCases);
-}
-
-SwitchInst::SwitchInst(const SwitchInst &SI)
- : TerminatorInst(Type::VoidTy, Instruction::Switch,
- new Use[SI.getNumOperands()], SI.getNumOperands()) {
- Use *OL = OperandList, *InOL = SI.OperandList;
- for (unsigned i = 0, E = SI.getNumOperands(); i != E; i+=2) {
- OL[i].init(InOL[i], this);
- OL[i+1].init(InOL[i+1], this);
- }
-}
-
-SwitchInst::~SwitchInst() {
- delete [] OperandList;
-}
-
-
-/// addCase - Add an entry to the switch instruction...
-///
-void SwitchInst::addCase(ConstantInt *OnVal, BasicBlock *Dest) {
- unsigned OpNo = NumOperands;
- if (OpNo+2 > ReservedSpace)
- resizeOperands(0); // Get more space!
- // Initialize some new operands.
- assert(OpNo+1 < ReservedSpace && "Growing didn't work!");
- NumOperands = OpNo+2;
- OperandList[OpNo].init(OnVal, this);
- OperandList[OpNo+1].init(Dest, this);
-}
-
-/// removeCase - This method removes the specified successor from the switch
-/// instruction. Note that this cannot be used to remove the default
-/// destination (successor #0).
-///
-void SwitchInst::removeCase(unsigned idx) {
- assert(idx != 0 && "Cannot remove the default case!");
- assert(idx*2 < getNumOperands() && "Successor index out of range!!!");
-
- unsigned NumOps = getNumOperands();
- Use *OL = OperandList;
-
- // Move everything after this operand down.
- //
- // FIXME: we could just swap with the end of the list, then erase. However,
- // client might not expect this to happen. The code as it is thrashes the
- // use/def lists, which is kinda lame.
- for (unsigned i = (idx+1)*2; i != NumOps; i += 2) {
- OL[i-2] = OL[i];
- OL[i-2+1] = OL[i+1];
- }
-
- // Nuke the last value.
- OL[NumOps-2].set(0);
- OL[NumOps-2+1].set(0);
- NumOperands = NumOps-2;
-}
-
-/// resizeOperands - resize operands - This adjusts the length of the operands
-/// list according to the following behavior:
-/// 1. If NumOps == 0, grow the operand list in response to a push_back style
-/// of operation. This grows the number of ops by 1.5 times.
-/// 2. If NumOps > NumOperands, reserve space for NumOps operands.
-/// 3. If NumOps == NumOperands, trim the reserved space.
-///
-void SwitchInst::resizeOperands(unsigned NumOps) {
- if (NumOps == 0) {
- NumOps = getNumOperands()/2*6;
- } else if (NumOps*2 > NumOperands) {
- // No resize needed.
- if (ReservedSpace >= NumOps) return;
- } else if (NumOps == NumOperands) {
- if (ReservedSpace == NumOps) return;
- } else {
- return;
- }
-
- ReservedSpace = NumOps;
- Use *NewOps = new Use[NumOps];
- Use *OldOps = OperandList;
- for (unsigned i = 0, e = getNumOperands(); i != e; ++i) {
- NewOps[i].init(OldOps[i], this);
- OldOps[i].set(0);
- }
- delete [] OldOps;
- OperandList = NewOps;
-}
-
-
-BasicBlock *SwitchInst::getSuccessorV(unsigned idx) const {
- return getSuccessor(idx);
-}
-unsigned SwitchInst::getNumSuccessorsV() const {
- return getNumSuccessors();
-}
-void SwitchInst::setSuccessorV(unsigned idx, BasicBlock *B) {
- setSuccessor(idx, B);
-}
-
-//===----------------------------------------------------------------------===//
-// GetResultInst Implementation
-//===----------------------------------------------------------------------===//
-
-GetResultInst::GetResultInst(Value *Aggregate, unsigned Index,
- const std::string &Name,
- Instruction *InsertBef)
- : Instruction(cast<StructType>(Aggregate->getType())->getElementType(Index),
- GetResult, &Aggr, 1, InsertBef) {
- assert(isValidOperands(Aggregate, Index) && "Invalid GetResultInst operands!");
- Aggr.init(Aggregate, this);
- Idx = Index;
- setName(Name);
-}
-
-bool GetResultInst::isValidOperands(const Value *Aggregate, unsigned Index) {
- if (!Aggregate)
- return false;
-
- if (const StructType *STy = dyn_cast<StructType>(Aggregate->getType())) {
- unsigned NumElements = STy->getNumElements();
- if (Index >= NumElements || NumElements == 0)
- return false;
-
- // getresult aggregate value's element types are restricted to
- // avoid nested aggregates.
- for (unsigned i = 0; i < NumElements; ++i)
- if (!STy->getElementType(i)->isFirstClassType())
- return false;
-
- // Otherwise, Aggregate is valid.
- return true;
- }
- return false;
-}
-
-// Define these methods here so vtables don't get emitted into every translation
-// unit that uses these classes.
-
-GetElementPtrInst *GetElementPtrInst::clone() const {
- return new(getNumOperands()) GetElementPtrInst(*this);
-}
-
-BinaryOperator *BinaryOperator::clone() const {
- return create(getOpcode(), Ops[0], Ops[1]);
-}
-
-FCmpInst* FCmpInst::clone() const {
- return new FCmpInst(getPredicate(), Ops[0], Ops[1]);
-}
-ICmpInst* ICmpInst::clone() const {
- return new ICmpInst(getPredicate(), Ops[0], Ops[1]);
-}
-
-MallocInst *MallocInst::clone() const { return new MallocInst(*this); }
-AllocaInst *AllocaInst::clone() const { return new AllocaInst(*this); }
-FreeInst *FreeInst::clone() const { return new FreeInst(getOperand(0)); }
-LoadInst *LoadInst::clone() const { return new LoadInst(*this); }
-StoreInst *StoreInst::clone() const { return new StoreInst(*this); }
-CastInst *TruncInst::clone() const { return new TruncInst(*this); }
-CastInst *ZExtInst::clone() const { return new ZExtInst(*this); }
-CastInst *SExtInst::clone() const { return new SExtInst(*this); }
-CastInst *FPTruncInst::clone() const { return new FPTruncInst(*this); }
-CastInst *FPExtInst::clone() const { return new FPExtInst(*this); }
-CastInst *UIToFPInst::clone() const { return new UIToFPInst(*this); }
-CastInst *SIToFPInst::clone() const { return new SIToFPInst(*this); }
-CastInst *FPToUIInst::clone() const { return new FPToUIInst(*this); }
-CastInst *FPToSIInst::clone() const { return new FPToSIInst(*this); }
-CastInst *PtrToIntInst::clone() const { return new PtrToIntInst(*this); }
-CastInst *IntToPtrInst::clone() const { return new IntToPtrInst(*this); }
-CastInst *BitCastInst::clone() const { return new BitCastInst(*this); }
-CallInst *CallInst::clone() const { return new(getNumOperands()) CallInst(*this); }
-SelectInst *SelectInst::clone() const { return new(getNumOperands()) SelectInst(*this); }
-VAArgInst *VAArgInst::clone() const { return new VAArgInst(*this); }
-
-ExtractElementInst *ExtractElementInst::clone() const {
- return new ExtractElementInst(*this);
-}
-InsertElementInst *InsertElementInst::clone() const {
- return InsertElementInst::Create(*this);
-}
-ShuffleVectorInst *ShuffleVectorInst::clone() const {
- return new ShuffleVectorInst(*this);
-}
-PHINode *PHINode::clone() const { return new PHINode(*this); }
-ReturnInst *ReturnInst::clone() const { return new(getNumOperands()) ReturnInst(*this); }
-BranchInst *BranchInst::clone() const { return new(getNumOperands()) BranchInst(*this); }
-SwitchInst *SwitchInst::clone() const { return new(getNumOperands()) SwitchInst(*this); }
-InvokeInst *InvokeInst::clone() const { return new(getNumOperands()) InvokeInst(*this); }
-UnwindInst *UnwindInst::clone() const { return new UnwindInst(); }
-UnreachableInst *UnreachableInst::clone() const { return new UnreachableInst();}
-GetResultInst *GetResultInst::clone() const { return new GetResultInst(*this); }
diff --git a/release_23/lib/VMCore/IntrinsicInst.cpp b/release_23/lib/VMCore/IntrinsicInst.cpp
deleted file mode 100644
index 94f582911e13..000000000000
--- a/release_23/lib/VMCore/IntrinsicInst.cpp
+++ /dev/null
@@ -1,76 +0,0 @@
-//===-- InstrinsicInst.cpp - Intrinsic Instruction Wrappers -----*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements methods that make it really easy to deal with intrinsic
-// functions with the isa/dyncast family of functions. In particular, this
-// allows you to do things like:
-//
-// if (DbgStopPointInst *SPI = dyn_cast<DbgStopPointInst>(Inst))
-// ... SPI->getFileName() ... SPI->getDirectory() ...
-//
-// All intrinsic function calls are instances of the call instruction, so these
-// are all subclasses of the CallInst class. Note that none of these classes
-// has state or virtual methods, which is an important part of this gross/neat
-// hack working.
-//
-// In some cases, arguments to intrinsics need to be generic and are defined as
-// type pointer to empty struct { }*. To access the real item of interest the
-// cast instruction needs to be stripped away.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/IntrinsicInst.h"
-#include "llvm/Constants.h"
-#include "llvm/GlobalVariable.h"
-#include "llvm/CodeGen/MachineModuleInfo.h"
-using namespace llvm;
-
-//===----------------------------------------------------------------------===//
-/// DbgInfoIntrinsic - This is the common base class for debug info intrinsics
-///
-
-static Value *CastOperand(Value *C) {
- if (ConstantExpr *CE = dyn_cast<ConstantExpr>(C))
- if (CE->isCast())
- return CE->getOperand(0);
- return NULL;
-}
-
-Value *DbgInfoIntrinsic::StripCast(Value *C) {
- if (Value *CO = CastOperand(C)) {
- C = StripCast(CO);
- } else if (GlobalVariable *GV = dyn_cast<GlobalVariable>(C)) {
- if (GV->hasInitializer())
- if (Value *CO = CastOperand(GV->getInitializer()))
- C = StripCast(CO);
- }
- return dyn_cast<GlobalVariable>(C);
-}
-
-//===----------------------------------------------------------------------===//
-/// DbgStopPointInst - This represents the llvm.dbg.stoppoint instruction.
-///
-
-std::string DbgStopPointInst::getFileName() const {
- // Once the operand indices are verified, update this assert
- assert(LLVMDebugVersion == (6 << 16) && "Verify operand indices");
- GlobalVariable *GV = cast<GlobalVariable>(getContext());
- if (!GV->hasInitializer()) return "";
- ConstantStruct *CS = cast<ConstantStruct>(GV->getInitializer());
- return CS->getOperand(3)->getStringValue();
-}
-
-std::string DbgStopPointInst::getDirectory() const {
- // Once the operand indices are verified, update this assert
- assert(LLVMDebugVersion == (6 << 16) && "Verify operand indices");
- GlobalVariable *GV = cast<GlobalVariable>(getContext());
- if (!GV->hasInitializer()) return "";
- ConstantStruct *CS = cast<ConstantStruct>(GV->getInitializer());
- return CS->getOperand(4)->getStringValue();
-}
diff --git a/release_23/lib/VMCore/LeakDetector.cpp b/release_23/lib/VMCore/LeakDetector.cpp
deleted file mode 100644
index 9f3584e25a22..000000000000
--- a/release_23/lib/VMCore/LeakDetector.cpp
+++ /dev/null
@@ -1,131 +0,0 @@
-//===-- LeakDetector.cpp - Implement LeakDetector interface ---------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the LeakDetector class.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Support/LeakDetector.h"
-#include "llvm/Support/Compiler.h"
-#include "llvm/Support/Streams.h"
-#include "llvm/Value.h"
-#include <set>
-using namespace llvm;
-
-namespace {
- template <class T>
- struct VISIBILITY_HIDDEN PrinterTrait {
- static void print(const T* P) { cerr << P; }
- };
-
- template<>
- struct VISIBILITY_HIDDEN PrinterTrait<Value> {
- static void print(const Value* P) { cerr << *P; }
- };
-
- template <typename T>
- struct VISIBILITY_HIDDEN LeakDetectorImpl {
- LeakDetectorImpl(const char* const name) : Cache(0), Name(name) { }
-
- // Because the most common usage pattern, by far, is to add a
- // garbage object, then remove it immediately, we optimize this
- // case. When an object is added, it is not added to the set
- // immediately, it is added to the CachedValue Value. If it is
- // immediately removed, no set search need be performed.
- void addGarbage(const T* o) {
- if (Cache) {
- assert(Ts.count(Cache) == 0 && "Object already in set!");
- Ts.insert(Cache);
- }
- Cache = o;
- }
-
- void removeGarbage(const T* o) {
- if (o == Cache)
- Cache = 0; // Cache hit
- else
- Ts.erase(o);
- }
-
- bool hasGarbage(const std::string& Message) {
- addGarbage(0); // Flush the Cache
-
- assert(Cache == 0 && "No value should be cached anymore!");
-
- if (!Ts.empty()) {
- cerr << "Leaked " << Name << " objects found: " << Message << ":\n";
- for (typename std::set<const T*>::iterator I = Ts.begin(),
- E = Ts.end(); I != E; ++I) {
- cerr << "\t";
- PrinterTrait<T>::print(*I);
- cerr << "\n";
- }
- cerr << '\n';
-
- return true;
- }
- return false;
- }
-
- private:
- std::set<const T*> Ts;
- const T* Cache;
- const char* const Name;
- };
-
- static LeakDetectorImpl<void> *Objects;
- static LeakDetectorImpl<Value> *LLVMObjects;
-
- static LeakDetectorImpl<void> &getObjects() {
- if (Objects == 0)
- Objects = new LeakDetectorImpl<void>("GENERIC");
- return *Objects;
- }
-
- static LeakDetectorImpl<Value> &getLLVMObjects() {
- if (LLVMObjects == 0)
- LLVMObjects = new LeakDetectorImpl<Value>("LLVM");
- return *LLVMObjects;
- }
-
- static void clearGarbage() {
- delete Objects;
- delete LLVMObjects;
- Objects = 0;
- LLVMObjects = 0;
- }
-}
-
-void LeakDetector::addGarbageObjectImpl(void *Object) {
- getObjects().addGarbage(Object);
-}
-
-void LeakDetector::addGarbageObjectImpl(const Value *Object) {
- getLLVMObjects().addGarbage(Object);
-}
-
-void LeakDetector::removeGarbageObjectImpl(void *Object) {
- getObjects().removeGarbage(Object);
-}
-
-void LeakDetector::removeGarbageObjectImpl(const Value *Object) {
- getLLVMObjects().removeGarbage(Object);
-}
-
-void LeakDetector::checkForGarbageImpl(const std::string &Message) {
- // use non-short-circuit version so that both checks are performed
- if (getObjects().hasGarbage(Message) |
- getLLVMObjects().hasGarbage(Message))
- cerr << "\nThis is probably because you removed an object, but didn't "
- << "delete it. Please check your code for memory leaks.\n";
-
- // Clear out results so we don't get duplicate warnings on
- // next call...
- clearGarbage();
-}
diff --git a/release_23/lib/VMCore/Makefile b/release_23/lib/VMCore/Makefile
deleted file mode 100644
index 59062a18038b..000000000000
--- a/release_23/lib/VMCore/Makefile
+++ /dev/null
@@ -1,33 +0,0 @@
-##===- lib/VMCore/Makefile ------------------------------*- Makefile -*-===##
-#
-# The LLVM Compiler Infrastructure
-#
-# This file is distributed under the University of Illinois Open Source
-# License. See LICENSE.TXT for details.
-#
-##===----------------------------------------------------------------------===##
-LEVEL = ../..
-LIBRARYNAME = LLVMCore
-BUILD_ARCHIVE = 1
-
-BUILT_SOURCES = $(PROJ_OBJ_ROOT)/include/llvm/Intrinsics.gen
-
-include $(LEVEL)/Makefile.common
-
-GENFILE:=$(PROJ_OBJ_ROOT)/include/llvm/Intrinsics.gen
-
-INTRINSICTD := $(PROJ_SRC_ROOT)/include/llvm/Intrinsics.td
-INTRINSICTDS := $(wildcard $(PROJ_SRC_ROOT)/include/llvm/Intrinsics*.td)
-
-$(ObjDir)/Intrinsics.gen.tmp: $(ObjDir)/.dir $(INTRINSICTDS) $(TBLGEN)
- $(Echo) Building Intrinsics.gen.tmp from Intrinsics.td
- $(Verb) $(TableGen) $(call SYSPATH, $(INTRINSICTD)) -o $(call SYSPATH, $@) -gen-intrinsic
-
-$(GENFILE): $(ObjDir)/Intrinsics.gen.tmp
- $(Verb) $(CMP) -s $@ $< || ( $(CP) $< $@ && \
- $(EchoCmd) Updated Intrinsics.gen because Intrinsics.gen.tmp \
- changed significantly. )
-
-install-local:: $(GENFILE)
- $(Echo) Installing $(PROJ_includedir)/llvm/Intrinsics.gen
- $(Verb) $(DataInstall) $(GENFILE) $(PROJ_includedir)/llvm/Intrinsics.gen
diff --git a/release_23/lib/VMCore/Mangler.cpp b/release_23/lib/VMCore/Mangler.cpp
deleted file mode 100644
index 0437508f3942..000000000000
--- a/release_23/lib/VMCore/Mangler.cpp
+++ /dev/null
@@ -1,213 +0,0 @@
-//===-- Mangler.cpp - Self-contained c/asm llvm name mangler --------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// Unified name mangler for CWriter and assembly backends.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Support/Mangler.h"
-#include "llvm/DerivedTypes.h"
-#include "llvm/Module.h"
-#include "llvm/ADT/STLExtras.h"
-#include "llvm/ADT/StringExtras.h"
-using namespace llvm;
-
-static char HexDigit(int V) {
- return V < 10 ? V+'0' : V+'A'-10;
-}
-
-static std::string MangleLetter(unsigned char C) {
- char Result[] = { '_', HexDigit(C >> 4), HexDigit(C & 15), '_', 0 };
- return Result;
-}
-
-/// makeNameProper - We don't want identifier names non-C-identifier characters
-/// in them, so mangle them as appropriate.
-///
-std::string Mangler::makeNameProper(const std::string &X, const char *Prefix) {
- std::string Result;
- if (X.empty()) return X; // Empty names are uniqued by the caller.
-
- // If PreserveAsmNames is set, names with asm identifiers are not modified.
- if (PreserveAsmNames && X[0] == 1)
- return X;
-
- if (!UseQuotes) {
- // If X does not start with (char)1, add the prefix.
- std::string::const_iterator I = X.begin();
- if (*I != 1)
- Result = Prefix;
- else
- ++I; // Skip over the marker.
-
- // Mangle the first letter specially, don't allow numbers.
- if (*I >= '0' && *I <= '9')
- Result += MangleLetter(*I++);
-
- for (std::string::const_iterator E = X.end(); I != E; ++I) {
- if (!isCharAcceptable(*I))
- Result += MangleLetter(*I);
- else
- Result += *I;
- }
- } else {
- bool NeedsQuotes = false;
-
- std::string::const_iterator I = X.begin();
- if (*I == 1)
- ++I; // Skip over the marker.
-
- // If the first character is a number, we need quotes.
- if (*I >= '0' && *I <= '9')
- NeedsQuotes = true;
-
- // Do an initial scan of the string, checking to see if we need quotes or
- // to escape a '"' or not.
- if (!NeedsQuotes)
- for (std::string::const_iterator E = X.end(); I != E; ++I)
- if (!isCharAcceptable(*I)) {
- NeedsQuotes = true;
- break;
- }
-
- // In the common case, we don't need quotes. Handle this quickly.
- if (!NeedsQuotes) {
- if (*X.begin() != 1)
- return Prefix+X;
- else
- return X.substr(1);
- }
-
- // Otherwise, construct the string the expensive way.
- I = X.begin();
-
- // If X does not start with (char)1, add the prefix.
- if (*I != 1)
- Result = Prefix;
- else
- ++I; // Skip the marker if present.
-
- for (std::string::const_iterator E = X.end(); I != E; ++I) {
- if (*I == '"')
- Result += "_QQ_";
- else if (*I == '\n')
- Result += "_NL_";
- else
- Result += *I;
- }
- Result = '"' + Result + '"';
- }
- return Result;
-}
-
-/// getTypeID - Return a unique ID for the specified LLVM type.
-///
-unsigned Mangler::getTypeID(const Type *Ty) {
- unsigned &E = TypeMap[Ty];
- if (E == 0) E = ++TypeCounter;
- return E;
-}
-
-std::string Mangler::getValueName(const Value *V) {
- if (const GlobalValue *GV = dyn_cast<GlobalValue>(V))
- return getValueName(GV);
-
- std::string &Name = Memo[V];
- if (!Name.empty())
- return Name; // Return the already-computed name for V.
-
- // Always mangle local names.
- Name = "ltmp_" + utostr(Count++) + "_" + utostr(getTypeID(V->getType()));
- return Name;
-}
-
-
-std::string Mangler::getValueName(const GlobalValue *GV, const char * Suffix) {
- // Check to see whether we've already named V.
- std::string &Name = Memo[GV];
- if (!Name.empty())
- return Name; // Return the already-computed name for V.
-
- // Name mangling occurs as follows:
- // - If V is an intrinsic function, do not change name at all
- // - Otherwise, mangling occurs if global collides with existing name.
- if (isa<Function>(GV) && cast<Function>(GV)->isIntrinsic()) {
- Name = GV->getName(); // Is an intrinsic function
- } else if (!GV->hasName()) {
- // Must mangle the global into a unique ID.
- unsigned TypeUniqueID = getTypeID(GV->getType());
- static unsigned GlobalID = 0;
- Name = "__unnamed_" + utostr(TypeUniqueID) + "_" + utostr(GlobalID++);
- } else if (!MangledGlobals.count(GV)) {
- Name = makeNameProper(GV->getName() + Suffix, Prefix);
- } else {
- unsigned TypeUniqueID = getTypeID(GV->getType());
- Name = "l" + utostr(TypeUniqueID) + "_" + makeNameProper(GV->getName());
- }
-
- return Name;
-}
-
-void Mangler::InsertName(GlobalValue *GV,
- std::map<std::string, GlobalValue*> &Names) {
- if (!GV->hasName()) // We must mangle unnamed globals.
- return;
-
- // Figure out if this is already used.
- GlobalValue *&ExistingValue = Names[GV->getName()];
- if (!ExistingValue) {
- ExistingValue = GV;
- } else {
- // If GV is external but the existing one is static, mangle the existing one
- if ((GV->hasExternalLinkage() || GV->hasDLLImportLinkage()) &&
- !(ExistingValue->hasExternalLinkage() || ExistingValue->hasDLLImportLinkage())) {
- MangledGlobals.insert(ExistingValue);
- ExistingValue = GV;
- } else if ((GV->hasExternalLinkage() ||
- GV->hasDLLImportLinkage()) &&
- (ExistingValue->hasExternalLinkage() ||
- ExistingValue->hasDLLImportLinkage()) &&
- GV->isDeclaration() &&
- ExistingValue->isDeclaration()) {
- // If the two globals both have external inkage, and are both external,
- // don't mangle either of them, we just have some silly type mismatch.
- } else {
- // Otherwise, mangle GV
- MangledGlobals.insert(GV);
- }
- }
-}
-
-
-Mangler::Mangler(Module &M, const char *prefix)
- : Prefix(prefix), UseQuotes(false), PreserveAsmNames(false),
- Count(0), TypeCounter(0) {
- std::fill(AcceptableChars, array_endof(AcceptableChars), 0);
-
- // Letters and numbers are acceptable.
- for (unsigned char X = 'a'; X <= 'z'; ++X)
- markCharAcceptable(X);
- for (unsigned char X = 'A'; X <= 'Z'; ++X)
- markCharAcceptable(X);
- for (unsigned char X = '0'; X <= '9'; ++X)
- markCharAcceptable(X);
-
- // These chars are acceptable.
- markCharAcceptable('_');
- markCharAcceptable('$');
- markCharAcceptable('.');
-
- // Calculate which global values have names that will collide when we throw
- // away type information.
- std::map<std::string, GlobalValue*> Names;
- for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I)
- InsertName(I, Names);
- for (Module::global_iterator I = M.global_begin(), E = M.global_end(); I != E; ++I)
- InsertName(I, Names);
-}
diff --git a/release_23/lib/VMCore/Module.cpp b/release_23/lib/VMCore/Module.cpp
deleted file mode 100644
index 429cf1a4c695..000000000000
--- a/release_23/lib/VMCore/Module.cpp
+++ /dev/null
@@ -1,322 +0,0 @@
-//===-- Module.cpp - Implement the Module class ---------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the Module class for the VMCore library.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Module.h"
-#include "llvm/InstrTypes.h"
-#include "llvm/Constants.h"
-#include "llvm/DerivedTypes.h"
-#include "llvm/ADT/STLExtras.h"
-#include "llvm/ADT/StringExtras.h"
-#include "llvm/Support/LeakDetector.h"
-#include "SymbolTableListTraitsImpl.h"
-#include "llvm/TypeSymbolTable.h"
-#include <algorithm>
-#include <cstdarg>
-#include <cstdlib>
-using namespace llvm;
-
-//===----------------------------------------------------------------------===//
-// Methods to implement the globals and functions lists.
-//
-
-Function *ilist_traits<Function>::createSentinel() {
- FunctionType *FTy =
- FunctionType::get(Type::VoidTy, std::vector<const Type*>(), false);
- Function *Ret = Function::Create(FTy, GlobalValue::ExternalLinkage);
- // This should not be garbage monitored.
- LeakDetector::removeGarbageObject(Ret);
- return Ret;
-}
-GlobalVariable *ilist_traits<GlobalVariable>::createSentinel() {
- GlobalVariable *Ret = new GlobalVariable(Type::Int32Ty, false,
- GlobalValue::ExternalLinkage);
- // This should not be garbage monitored.
- LeakDetector::removeGarbageObject(Ret);
- return Ret;
-}
-GlobalAlias *ilist_traits<GlobalAlias>::createSentinel() {
- GlobalAlias *Ret = new GlobalAlias(Type::Int32Ty,
- GlobalValue::ExternalLinkage);
- // This should not be garbage monitored.
- LeakDetector::removeGarbageObject(Ret);
- return Ret;
-}
-
-iplist<Function> &ilist_traits<Function>::getList(Module *M) {
- return M->getFunctionList();
-}
-iplist<GlobalVariable> &ilist_traits<GlobalVariable>::getList(Module *M) {
- return M->getGlobalList();
-}
-iplist<GlobalAlias> &ilist_traits<GlobalAlias>::getList(Module *M) {
- return M->getAliasList();
-}
-
-// Explicit instantiations of SymbolTableListTraits since some of the methods
-// are not in the public header file.
-template class SymbolTableListTraits<GlobalVariable, Module>;
-template class SymbolTableListTraits<Function, Module>;
-template class SymbolTableListTraits<GlobalAlias, Module>;
-
-//===----------------------------------------------------------------------===//
-// Primitive Module methods.
-//
-
-Module::Module(const std::string &MID)
- : ModuleID(MID), DataLayout("") {
- ValSymTab = new ValueSymbolTable();
- TypeSymTab = new TypeSymbolTable();
-}
-
-Module::~Module() {
- dropAllReferences();
- GlobalList.clear();
- FunctionList.clear();
- AliasList.clear();
- LibraryList.clear();
- delete ValSymTab;
- delete TypeSymTab;
-}
-
-// Module::dump() - Allow printing from debugger
-void Module::dump() const {
- print(*cerr.stream());
-}
-
-/// Target endian information...
-Module::Endianness Module::getEndianness() const {
- std::string temp = DataLayout;
- Module::Endianness ret = AnyEndianness;
-
- while (!temp.empty()) {
- std::string token = getToken(temp, "-");
-
- if (token[0] == 'e') {
- ret = LittleEndian;
- } else if (token[0] == 'E') {
- ret = BigEndian;
- }
- }
-
- return ret;
-}
-
-/// Target Pointer Size information...
-Module::PointerSize Module::getPointerSize() const {
- std::string temp = DataLayout;
- Module::PointerSize ret = AnyPointerSize;
-
- while (!temp.empty()) {
- std::string token = getToken(temp, "-");
- char signal = getToken(token, ":")[0];
-
- if (signal == 'p') {
- int size = atoi(getToken(token, ":").c_str());
- if (size == 32)
- ret = Pointer32;
- else if (size == 64)
- ret = Pointer64;
- }
- }
-
- return ret;
-}
-
-//===----------------------------------------------------------------------===//
-// Methods for easy access to the functions in the module.
-//
-
-// getOrInsertFunction - Look up the specified function in the module symbol
-// table. If it does not exist, add a prototype for the function and return
-// it. This is nice because it allows most passes to get away with not handling
-// the symbol table directly for this common task.
-//
-Constant *Module::getOrInsertFunction(const std::string &Name,
- const FunctionType *Ty) {
- ValueSymbolTable &SymTab = getValueSymbolTable();
-
- // See if we have a definition for the specified function already.
- GlobalValue *F = dyn_cast_or_null<GlobalValue>(SymTab.lookup(Name));
- if (F == 0) {
- // Nope, add it
- Function *New = Function::Create(Ty, GlobalVariable::ExternalLinkage, Name);
- FunctionList.push_back(New);
- return New; // Return the new prototype.
- }
-
- // Okay, the function exists. Does it have externally visible linkage?
- if (F->hasInternalLinkage()) {
- // Rename the function.
- F->setName(SymTab.getUniqueName(F->getName()));
- // Retry, now there won't be a conflict.
- return getOrInsertFunction(Name, Ty);
- }
-
- // If the function exists but has the wrong type, return a bitcast to the
- // right type.
- if (F->getType() != PointerType::getUnqual(Ty))
- return ConstantExpr::getBitCast(F, PointerType::getUnqual(Ty));
-
- // Otherwise, we just found the existing function or a prototype.
- return F;
-}
-
-// getOrInsertFunction - Look up the specified function in the module symbol
-// table. If it does not exist, add a prototype for the function and return it.
-// This version of the method takes a null terminated list of function
-// arguments, which makes it easier for clients to use.
-//
-Constant *Module::getOrInsertFunction(const std::string &Name,
- const Type *RetTy, ...) {
- va_list Args;
- va_start(Args, RetTy);
-
- // Build the list of argument types...
- std::vector<const Type*> ArgTys;
- while (const Type *ArgTy = va_arg(Args, const Type*))
- ArgTys.push_back(ArgTy);
-
- va_end(Args);
-
- // Build the function type and chain to the other getOrInsertFunction...
- return getOrInsertFunction(Name, FunctionType::get(RetTy, ArgTys, false));
-}
-
-
-// getFunction - Look up the specified function in the module symbol table.
-// If it does not exist, return null.
-//
-Function *Module::getFunction(const std::string &Name) const {
- const ValueSymbolTable &SymTab = getValueSymbolTable();
- return dyn_cast_or_null<Function>(SymTab.lookup(Name));
-}
-
-//===----------------------------------------------------------------------===//
-// Methods for easy access to the global variables in the module.
-//
-
-/// getGlobalVariable - Look up the specified global variable in the module
-/// symbol table. If it does not exist, return null. The type argument
-/// should be the underlying type of the global, i.e., it should not have
-/// the top-level PointerType, which represents the address of the global.
-/// If AllowInternal is set to true, this function will return types that
-/// have InternalLinkage. By default, these types are not returned.
-///
-GlobalVariable *Module::getGlobalVariable(const std::string &Name,
- bool AllowInternal) const {
- if (Value *V = ValSymTab->lookup(Name)) {
- GlobalVariable *Result = dyn_cast<GlobalVariable>(V);
- if (Result && (AllowInternal || !Result->hasInternalLinkage()))
- return Result;
- }
- return 0;
-}
-
-//===----------------------------------------------------------------------===//
-// Methods for easy access to the global variables in the module.
-//
-
-// getNamedAlias - Look up the specified global in the module symbol table.
-// If it does not exist, return null.
-//
-GlobalAlias *Module::getNamedAlias(const std::string &Name) const {
- const ValueSymbolTable &SymTab = getValueSymbolTable();
- return dyn_cast_or_null<GlobalAlias>(SymTab.lookup(Name));
-}
-
-//===----------------------------------------------------------------------===//
-// Methods for easy access to the types in the module.
-//
-
-
-// addTypeName - Insert an entry in the symbol table mapping Str to Type. If
-// there is already an entry for this name, true is returned and the symbol
-// table is not modified.
-//
-bool Module::addTypeName(const std::string &Name, const Type *Ty) {
- TypeSymbolTable &ST = getTypeSymbolTable();
-
- if (ST.lookup(Name)) return true; // Already in symtab...
-
- // Not in symbol table? Set the name with the Symtab as an argument so the
- // type knows what to update...
- ST.insert(Name, Ty);
-
- return false;
-}
-
-/// getTypeByName - Return the type with the specified name in this module, or
-/// null if there is none by that name.
-const Type *Module::getTypeByName(const std::string &Name) const {
- const TypeSymbolTable &ST = getTypeSymbolTable();
- return cast_or_null<Type>(ST.lookup(Name));
-}
-
-// getTypeName - If there is at least one entry in the symbol table for the
-// specified type, return it.
-//
-std::string Module::getTypeName(const Type *Ty) const {
- const TypeSymbolTable &ST = getTypeSymbolTable();
-
- TypeSymbolTable::const_iterator TI = ST.begin();
- TypeSymbolTable::const_iterator TE = ST.end();
- if ( TI == TE ) return ""; // No names for types
-
- while (TI != TE && TI->second != Ty)
- ++TI;
-
- if (TI != TE) // Must have found an entry!
- return TI->first;
- return ""; // Must not have found anything...
-}
-
-//===----------------------------------------------------------------------===//
-// Other module related stuff.
-//
-
-
-// dropAllReferences() - This function causes all the subelementss to "let go"
-// of all references that they are maintaining. This allows one to 'delete' a
-// whole module at a time, even though there may be circular references... first
-// all references are dropped, and all use counts go to zero. Then everything
-// is deleted for real. Note that no operations are valid on an object that
-// has "dropped all references", except operator delete.
-//
-void Module::dropAllReferences() {
- for(Module::iterator I = begin(), E = end(); I != E; ++I)
- I->dropAllReferences();
-
- for(Module::global_iterator I = global_begin(), E = global_end(); I != E; ++I)
- I->dropAllReferences();
-
- for(Module::alias_iterator I = alias_begin(), E = alias_end(); I != E; ++I)
- I->dropAllReferences();
-}
-
-void Module::addLibrary(const std::string& Lib) {
- for (Module::lib_iterator I = lib_begin(), E = lib_end(); I != E; ++I)
- if (*I == Lib)
- return;
- LibraryList.push_back(Lib);
-}
-
-void Module::removeLibrary(const std::string& Lib) {
- LibraryListType::iterator I = LibraryList.begin();
- LibraryListType::iterator E = LibraryList.end();
- for (;I != E; ++I)
- if (*I == Lib) {
- LibraryList.erase(I);
- return;
- }
-}
-
diff --git a/release_23/lib/VMCore/ModuleProvider.cpp b/release_23/lib/VMCore/ModuleProvider.cpp
deleted file mode 100644
index cfff97c237f9..000000000000
--- a/release_23/lib/VMCore/ModuleProvider.cpp
+++ /dev/null
@@ -1,26 +0,0 @@
-//===-- ModuleProvider.cpp - Base implementation for module providers -----===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// Minimal implementation of the abstract interface for providing a module.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/ModuleProvider.h"
-#include "llvm/Module.h"
-using namespace llvm;
-
-/// ctor - always have a valid Module
-///
-ModuleProvider::ModuleProvider() : TheModule(0) { }
-
-/// dtor - when we leave, we take our Module with us
-///
-ModuleProvider::~ModuleProvider() {
- delete TheModule;
-}
diff --git a/release_23/lib/VMCore/ParameterAttributes.cpp b/release_23/lib/VMCore/ParameterAttributes.cpp
deleted file mode 100644
index b5fb832fde63..000000000000
--- a/release_23/lib/VMCore/ParameterAttributes.cpp
+++ /dev/null
@@ -1,294 +0,0 @@
-//===-- ParameterAttributes.cpp - Implement ParamAttrsList ----------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the ParamAttrsList class and ParamAttr utilities.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/ParameterAttributes.h"
-#include "llvm/Type.h"
-#include "llvm/ADT/StringExtras.h"
-#include "llvm/ADT/FoldingSet.h"
-#include "llvm/Support/Streams.h"
-#include "llvm/Support/ManagedStatic.h"
-using namespace llvm;
-
-//===----------------------------------------------------------------------===//
-// ParamAttr Function Definitions
-//===----------------------------------------------------------------------===//
-
-std::string ParamAttr::getAsString(ParameterAttributes Attrs) {
- std::string Result;
- if (Attrs & ParamAttr::ZExt)
- Result += "zeroext ";
- if (Attrs & ParamAttr::SExt)
- Result += "signext ";
- if (Attrs & ParamAttr::NoReturn)
- Result += "noreturn ";
- if (Attrs & ParamAttr::NoUnwind)
- Result += "nounwind ";
- if (Attrs & ParamAttr::InReg)
- Result += "inreg ";
- if (Attrs & ParamAttr::NoAlias)
- Result += "noalias ";
- if (Attrs & ParamAttr::StructRet)
- Result += "sret ";
- if (Attrs & ParamAttr::ByVal)
- Result += "byval ";
- if (Attrs & ParamAttr::Nest)
- Result += "nest ";
- if (Attrs & ParamAttr::ReadNone)
- Result += "readnone ";
- if (Attrs & ParamAttr::ReadOnly)
- Result += "readonly ";
- if (Attrs & ParamAttr::Alignment) {
- Result += "align ";
- Result += utostr((Attrs & ParamAttr::Alignment) >> 16);
- Result += " ";
- }
- return Result;
-}
-
-ParameterAttributes ParamAttr::typeIncompatible(const Type *Ty) {
- ParameterAttributes Incompatible = None;
-
- if (!Ty->isInteger())
- // Attributes that only apply to integers.
- Incompatible |= SExt | ZExt;
-
- if (!isa<PointerType>(Ty))
- // Attributes that only apply to pointers.
- Incompatible |= ByVal | Nest | NoAlias | StructRet;
-
- return Incompatible;
-}
-
-//===----------------------------------------------------------------------===//
-// ParamAttributeListImpl Definition
-//===----------------------------------------------------------------------===//
-
-namespace llvm {
-class ParamAttributeListImpl : public FoldingSetNode {
- unsigned RefCount;
-
- // ParamAttrsList is uniqued, these should not be publicly available.
- void operator=(const ParamAttributeListImpl &); // Do not implement
- ParamAttributeListImpl(const ParamAttributeListImpl &); // Do not implement
- ~ParamAttributeListImpl(); // Private implementation
-public:
- SmallVector<ParamAttrsWithIndex, 4> Attrs;
-
- ParamAttributeListImpl(const ParamAttrsWithIndex *Attr, unsigned NumAttrs)
- : Attrs(Attr, Attr+NumAttrs) {
- RefCount = 0;
- }
-
- void AddRef() { ++RefCount; }
- void DropRef() { if (--RefCount == 0) delete this; }
-
- void Profile(FoldingSetNodeID &ID) const {
- Profile(ID, &Attrs[0], Attrs.size());
- }
- static void Profile(FoldingSetNodeID &ID, const ParamAttrsWithIndex *Attr,
- unsigned NumAttrs) {
- for (unsigned i = 0; i != NumAttrs; ++i)
- ID.AddInteger(uint64_t(Attr[i].Attrs) << 32 | unsigned(Attr[i].Index));
- }
-};
-}
-
-static ManagedStatic<FoldingSet<ParamAttributeListImpl> > ParamAttrsLists;
-
-ParamAttributeListImpl::~ParamAttributeListImpl() {
- ParamAttrsLists->RemoveNode(this);
-}
-
-
-PAListPtr PAListPtr::get(const ParamAttrsWithIndex *Attrs, unsigned NumAttrs) {
- // If there are no attributes then return a null ParamAttrsList pointer.
- if (NumAttrs == 0)
- return PAListPtr();
-
-#ifndef NDEBUG
- for (unsigned i = 0; i != NumAttrs; ++i) {
- assert(Attrs[i].Attrs != ParamAttr::None &&
- "Pointless parameter attribute!");
- assert((!i || Attrs[i-1].Index < Attrs[i].Index) &&
- "Misordered ParamAttrsList!");
- }
-#endif
-
- // Otherwise, build a key to look up the existing attributes.
- FoldingSetNodeID ID;
- ParamAttributeListImpl::Profile(ID, Attrs, NumAttrs);
- void *InsertPos;
- ParamAttributeListImpl *PAL =
- ParamAttrsLists->FindNodeOrInsertPos(ID, InsertPos);
-
- // If we didn't find any existing attributes of the same shape then
- // create a new one and insert it.
- if (!PAL) {
- PAL = new ParamAttributeListImpl(Attrs, NumAttrs);
- ParamAttrsLists->InsertNode(PAL, InsertPos);
- }
-
- // Return the ParamAttrsList that we found or created.
- return PAListPtr(PAL);
-}
-
-
-//===----------------------------------------------------------------------===//
-// PAListPtr Method Implementations
-//===----------------------------------------------------------------------===//
-
-PAListPtr::PAListPtr(ParamAttributeListImpl *LI) : PAList(LI) {
- if (LI) LI->AddRef();
-}
-
-PAListPtr::PAListPtr(const PAListPtr &P) : PAList(P.PAList) {
- if (PAList) PAList->AddRef();
-}
-
-const PAListPtr &PAListPtr::operator=(const PAListPtr &RHS) {
- if (PAList == RHS.PAList) return *this;
- if (PAList) PAList->DropRef();
- PAList = RHS.PAList;
- if (PAList) PAList->AddRef();
- return *this;
-}
-
-PAListPtr::~PAListPtr() {
- if (PAList) PAList->DropRef();
-}
-
-/// getNumSlots - Return the number of slots used in this attribute list.
-/// This is the number of arguments that have an attribute set on them
-/// (including the function itself).
-unsigned PAListPtr::getNumSlots() const {
- return PAList ? PAList->Attrs.size() : 0;
-}
-
-/// getSlot - Return the ParamAttrsWithIndex at the specified slot. This
-/// holds a parameter number plus a set of attributes.
-const ParamAttrsWithIndex &PAListPtr::getSlot(unsigned Slot) const {
- assert(PAList && Slot < PAList->Attrs.size() && "Slot # out of range!");
- return PAList->Attrs[Slot];
-}
-
-
-/// getParamAttrs - The parameter attributes for the specified parameter are
-/// returned. Parameters for the result are denoted with Idx = 0.
-ParameterAttributes PAListPtr::getParamAttrs(unsigned Idx) const {
- if (PAList == 0) return ParamAttr::None;
-
- const SmallVector<ParamAttrsWithIndex, 4> &Attrs = PAList->Attrs;
- for (unsigned i = 0, e = Attrs.size(); i != e && Attrs[i].Index <= Idx; ++i)
- if (Attrs[i].Index == Idx)
- return Attrs[i].Attrs;
- return ParamAttr::None;
-}
-
-/// hasAttrSomewhere - Return true if the specified attribute is set for at
-/// least one parameter or for the return value.
-bool PAListPtr::hasAttrSomewhere(ParameterAttributes Attr) const {
- if (PAList == 0) return false;
-
- const SmallVector<ParamAttrsWithIndex, 4> &Attrs = PAList->Attrs;
- for (unsigned i = 0, e = Attrs.size(); i != e; ++i)
- if (Attrs[i].Attrs & Attr)
- return true;
- return false;
-}
-
-
-PAListPtr PAListPtr::addAttr(unsigned Idx, ParameterAttributes Attrs) const {
- ParameterAttributes OldAttrs = getParamAttrs(Idx);
-#ifndef NDEBUG
- // FIXME it is not obvious how this should work for alignment.
- // For now, say we can't change a known alignment.
- ParameterAttributes OldAlign = OldAttrs & ParamAttr::Alignment;
- ParameterAttributes NewAlign = Attrs & ParamAttr::Alignment;
- assert((!OldAlign || !NewAlign || OldAlign == NewAlign) &&
- "Attempt to change alignment!");
-#endif
-
- ParameterAttributes NewAttrs = OldAttrs | Attrs;
- if (NewAttrs == OldAttrs)
- return *this;
-
- SmallVector<ParamAttrsWithIndex, 8> NewAttrList;
- if (PAList == 0)
- NewAttrList.push_back(ParamAttrsWithIndex::get(Idx, Attrs));
- else {
- const SmallVector<ParamAttrsWithIndex, 4> &OldAttrList = PAList->Attrs;
- unsigned i = 0, e = OldAttrList.size();
- // Copy attributes for arguments before this one.
- for (; i != e && OldAttrList[i].Index < Idx; ++i)
- NewAttrList.push_back(OldAttrList[i]);
-
- // If there are attributes already at this index, merge them in.
- if (i != e && OldAttrList[i].Index == Idx) {
- Attrs |= OldAttrList[i].Attrs;
- ++i;
- }
-
- NewAttrList.push_back(ParamAttrsWithIndex::get(Idx, Attrs));
-
- // Copy attributes for arguments after this one.
- NewAttrList.insert(NewAttrList.end(),
- OldAttrList.begin()+i, OldAttrList.end());
- }
-
- return get(&NewAttrList[0], NewAttrList.size());
-}
-
-PAListPtr PAListPtr::removeAttr(unsigned Idx, ParameterAttributes Attrs) const {
-#ifndef NDEBUG
- // FIXME it is not obvious how this should work for alignment.
- // For now, say we can't pass in alignment, which no current use does.
- assert(!(Attrs & ParamAttr::Alignment) && "Attempt to exclude alignment!");
-#endif
- if (PAList == 0) return PAListPtr();
-
- ParameterAttributes OldAttrs = getParamAttrs(Idx);
- ParameterAttributes NewAttrs = OldAttrs & ~Attrs;
- if (NewAttrs == OldAttrs)
- return *this;
-
- SmallVector<ParamAttrsWithIndex, 8> NewAttrList;
- const SmallVector<ParamAttrsWithIndex, 4> &OldAttrList = PAList->Attrs;
- unsigned i = 0, e = OldAttrList.size();
-
- // Copy attributes for arguments before this one.
- for (; i != e && OldAttrList[i].Index < Idx; ++i)
- NewAttrList.push_back(OldAttrList[i]);
-
- // If there are attributes already at this index, merge them in.
- assert(OldAttrList[i].Index == Idx && "Attribute isn't set?");
- Attrs = OldAttrList[i].Attrs & ~Attrs;
- ++i;
- if (Attrs) // If any attributes left for this parameter, add them.
- NewAttrList.push_back(ParamAttrsWithIndex::get(Idx, Attrs));
-
- // Copy attributes for arguments after this one.
- NewAttrList.insert(NewAttrList.end(),
- OldAttrList.begin()+i, OldAttrList.end());
-
- return get(&NewAttrList[0], NewAttrList.size());
-}
-
-void PAListPtr::dump() const {
- cerr << "PAL[ ";
- for (unsigned i = 0; i < getNumSlots(); ++i) {
- const ParamAttrsWithIndex &PAWI = getSlot(i);
- cerr << "{" << PAWI.Index << "," << PAWI.Attrs << "} ";
- }
-
- cerr << "]\n";
-}
diff --git a/release_23/lib/VMCore/Pass.cpp b/release_23/lib/VMCore/Pass.cpp
deleted file mode 100644
index bd34883493ce..000000000000
--- a/release_23/lib/VMCore/Pass.cpp
+++ /dev/null
@@ -1,326 +0,0 @@
-//===- Pass.cpp - LLVM Pass Infrastructure Implementation -----------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the LLVM Pass infrastructure. It is primarily
-// responsible with ensuring that passes are executed and batched together
-// optimally.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/PassManager.h"
-#include "llvm/Module.h"
-#include "llvm/ModuleProvider.h"
-#include "llvm/ADT/STLExtras.h"
-#include "llvm/Support/ManagedStatic.h"
-#include <algorithm>
-#include <map>
-#include <set>
-using namespace llvm;
-
-//===----------------------------------------------------------------------===//
-// Pass Implementation
-//
-
-// Force out-of-line virtual method.
-Pass::~Pass() {
- delete Resolver;
-}
-
-// Force out-of-line virtual method.
-ModulePass::~ModulePass() { }
-
-bool Pass::mustPreserveAnalysisID(const PassInfo *AnalysisID) const {
- return Resolver->getAnalysisToUpdate(AnalysisID, true) != 0;
-}
-
-// dumpPassStructure - Implement the -debug-passes=Structure option
-void Pass::dumpPassStructure(unsigned Offset) {
- cerr << std::string(Offset*2, ' ') << getPassName() << "\n";
-}
-
-/// getPassName - Return a nice clean name for a pass. This usually
-/// implemented in terms of the name that is registered by one of the
-/// Registration templates, but can be overloaded directly.
-///
-const char *Pass::getPassName() const {
- if (const PassInfo *PI = getPassInfo())
- return PI->getPassName();
- return "Unnamed pass: implement Pass::getPassName()";
-}
-
-// print - Print out the internal state of the pass. This is called by Analyze
-// to print out the contents of an analysis. Otherwise it is not necessary to
-// implement this method.
-//
-void Pass::print(std::ostream &O,const Module*) const {
- O << "Pass::print not implemented for pass: '" << getPassName() << "'!\n";
-}
-
-// dump - call print(cerr);
-void Pass::dump() const {
- print(*cerr.stream(), 0);
-}
-
-//===----------------------------------------------------------------------===//
-// ImmutablePass Implementation
-//
-// Force out-of-line virtual method.
-ImmutablePass::~ImmutablePass() { }
-
-//===----------------------------------------------------------------------===//
-// FunctionPass Implementation
-//
-
-// run - On a module, we run this pass by initializing, runOnFunction'ing once
-// for every function in the module, then by finalizing.
-//
-bool FunctionPass::runOnModule(Module &M) {
- bool Changed = doInitialization(M);
-
- for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I)
- if (!I->isDeclaration()) // Passes are not run on external functions!
- Changed |= runOnFunction(*I);
-
- return Changed | doFinalization(M);
-}
-
-// run - On a function, we simply initialize, run the function, then finalize.
-//
-bool FunctionPass::run(Function &F) {
- // Passes are not run on external functions!
- if (F.isDeclaration()) return false;
-
- bool Changed = doInitialization(*F.getParent());
- Changed |= runOnFunction(F);
- return Changed | doFinalization(*F.getParent());
-}
-
-//===----------------------------------------------------------------------===//
-// BasicBlockPass Implementation
-//
-
-// To run this pass on a function, we simply call runOnBasicBlock once for each
-// function.
-//
-bool BasicBlockPass::runOnFunction(Function &F) {
- bool Changed = doInitialization(F);
- for (Function::iterator I = F.begin(), E = F.end(); I != E; ++I)
- Changed |= runOnBasicBlock(*I);
- return Changed | doFinalization(F);
-}
-
-//===----------------------------------------------------------------------===//
-// Pass Registration mechanism
-//
-namespace {
-class PassRegistrar {
- /// PassInfoMap - Keep track of the passinfo object for each registered llvm
- /// pass.
- std::map<intptr_t, PassInfo*> PassInfoMap;
-
- /// AnalysisGroupInfo - Keep track of information for each analysis group.
- struct AnalysisGroupInfo {
- const PassInfo *DefaultImpl;
- std::set<const PassInfo *> Implementations;
- AnalysisGroupInfo() : DefaultImpl(0) {}
- };
-
- /// AnalysisGroupInfoMap - Information for each analysis group.
- std::map<const PassInfo *, AnalysisGroupInfo> AnalysisGroupInfoMap;
-
-public:
-
- const PassInfo *GetPassInfo(intptr_t TI) const {
- std::map<intptr_t, PassInfo*>::const_iterator I = PassInfoMap.find(TI);
- return I != PassInfoMap.end() ? I->second : 0;
- }
-
- void RegisterPass(PassInfo &PI) {
- bool Inserted =
- PassInfoMap.insert(std::make_pair(PI.getTypeInfo(),&PI)).second;
- assert(Inserted && "Pass registered multiple times!");
- }
-
- void UnregisterPass(PassInfo &PI) {
- std::map<intptr_t, PassInfo*>::iterator I =
- PassInfoMap.find(PI.getTypeInfo());
- assert(I != PassInfoMap.end() && "Pass registered but not in map!");
-
- // Remove pass from the map.
- PassInfoMap.erase(I);
- }
-
- void EnumerateWith(PassRegistrationListener *L) {
- for (std::map<intptr_t, PassInfo*>::const_iterator I = PassInfoMap.begin(),
- E = PassInfoMap.end(); I != E; ++I)
- L->passEnumerate(I->second);
- }
-
-
- /// Analysis Group Mechanisms.
- void RegisterAnalysisGroup(PassInfo *InterfaceInfo,
- const PassInfo *ImplementationInfo,
- bool isDefault) {
- AnalysisGroupInfo &AGI = AnalysisGroupInfoMap[InterfaceInfo];
- assert(AGI.Implementations.count(ImplementationInfo) == 0 &&
- "Cannot add a pass to the same analysis group more than once!");
- AGI.Implementations.insert(ImplementationInfo);
- if (isDefault) {
- assert(AGI.DefaultImpl == 0 && InterfaceInfo->getNormalCtor() == 0 &&
- "Default implementation for analysis group already specified!");
- assert(ImplementationInfo->getNormalCtor() &&
- "Cannot specify pass as default if it does not have a default ctor");
- AGI.DefaultImpl = ImplementationInfo;
- InterfaceInfo->setNormalCtor(ImplementationInfo->getNormalCtor());
- }
- }
-};
-}
-
-static std::vector<PassRegistrationListener*> *Listeners = 0;
-
-// FIXME: This should use ManagedStatic to manage the pass registrar.
-// Unfortunately, we can't do this, because passes are registered with static
-// ctors, and having llvm_shutdown clear this map prevents successful
-// ressurection after llvm_shutdown is run.
-static PassRegistrar *getPassRegistrar() {
- static PassRegistrar *PassRegistrarObj = 0;
- if (!PassRegistrarObj)
- PassRegistrarObj = new PassRegistrar();
- return PassRegistrarObj;
-}
-
-// getPassInfo - Return the PassInfo data structure that corresponds to this
-// pass...
-const PassInfo *Pass::getPassInfo() const {
- return lookupPassInfo(PassID);
-}
-
-const PassInfo *Pass::lookupPassInfo(intptr_t TI) {
- return getPassRegistrar()->GetPassInfo(TI);
-}
-
-void RegisterPassBase::registerPass() {
- getPassRegistrar()->RegisterPass(PIObj);
-
- // Notify any listeners.
- if (Listeners)
- for (std::vector<PassRegistrationListener*>::iterator
- I = Listeners->begin(), E = Listeners->end(); I != E; ++I)
- (*I)->passRegistered(&PIObj);
-}
-
-void RegisterPassBase::unregisterPass() {
- getPassRegistrar()->UnregisterPass(PIObj);
-}
-
-//===----------------------------------------------------------------------===//
-// Analysis Group Implementation Code
-//===----------------------------------------------------------------------===//
-
-// RegisterAGBase implementation
-//
-RegisterAGBase::RegisterAGBase(intptr_t InterfaceID,
- intptr_t PassID, bool isDefault)
- : RegisterPassBase(InterfaceID),
- ImplementationInfo(0), isDefaultImplementation(isDefault) {
-
- InterfaceInfo = const_cast<PassInfo*>(Pass::lookupPassInfo(InterfaceID));
- if (InterfaceInfo == 0) {
- // First reference to Interface, register it now.
- registerPass();
- InterfaceInfo = &PIObj;
- }
- assert(PIObj.isAnalysisGroup() &&
- "Trying to join an analysis group that is a normal pass!");
-
- if (PassID) {
- ImplementationInfo = Pass::lookupPassInfo(PassID);
- assert(ImplementationInfo &&
- "Must register pass before adding to AnalysisGroup!");
-
- // Make sure we keep track of the fact that the implementation implements
- // the interface.
- PassInfo *IIPI = const_cast<PassInfo*>(ImplementationInfo);
- IIPI->addInterfaceImplemented(InterfaceInfo);
-
- getPassRegistrar()->RegisterAnalysisGroup(InterfaceInfo, IIPI, isDefault);
- }
-}
-
-void RegisterAGBase::setGroupName(const char *Name) {
- assert(InterfaceInfo->getPassName()[0] == 0 && "Interface Name already set!");
- InterfaceInfo->setPassName(Name);
-}
-
-
-//===----------------------------------------------------------------------===//
-// PassRegistrationListener implementation
-//
-
-// PassRegistrationListener ctor - Add the current object to the list of
-// PassRegistrationListeners...
-PassRegistrationListener::PassRegistrationListener() {
- if (!Listeners) Listeners = new std::vector<PassRegistrationListener*>();
- Listeners->push_back(this);
-}
-
-// dtor - Remove object from list of listeners...
-PassRegistrationListener::~PassRegistrationListener() {
- std::vector<PassRegistrationListener*>::iterator I =
- std::find(Listeners->begin(), Listeners->end(), this);
- assert(Listeners && I != Listeners->end() &&
- "PassRegistrationListener not registered!");
- Listeners->erase(I);
-
- if (Listeners->empty()) {
- delete Listeners;
- Listeners = 0;
- }
-}
-
-// enumeratePasses - Iterate over the registered passes, calling the
-// passEnumerate callback on each PassInfo object.
-//
-void PassRegistrationListener::enumeratePasses() {
- getPassRegistrar()->EnumerateWith(this);
-}
-
-//===----------------------------------------------------------------------===//
-// AnalysisUsage Class Implementation
-//
-
-namespace {
- struct GetCFGOnlyPasses : public PassRegistrationListener {
- std::vector<AnalysisID> &CFGOnlyList;
- GetCFGOnlyPasses(std::vector<AnalysisID> &L) : CFGOnlyList(L) {}
-
- void passEnumerate(const PassInfo *P) {
- if (P->isCFGOnlyPass())
- CFGOnlyList.push_back(P);
- }
- };
-}
-
-// setPreservesCFG - This function should be called to by the pass, iff they do
-// not:
-//
-// 1. Add or remove basic blocks from the function
-// 2. Modify terminator instructions in any way.
-//
-// This function annotates the AnalysisUsage info object to say that analyses
-// that only depend on the CFG are preserved by this pass.
-//
-void AnalysisUsage::setPreservesCFG() {
- // Since this transformation doesn't modify the CFG, it preserves all analyses
- // that only depend on the CFG (like dominators, loop info, etc...)
- GetCFGOnlyPasses(Preserved).enumeratePasses();
-}
-
-
diff --git a/release_23/lib/VMCore/PassManager.cpp b/release_23/lib/VMCore/PassManager.cpp
deleted file mode 100644
index 312379479d6a..000000000000
--- a/release_23/lib/VMCore/PassManager.cpp
+++ /dev/null
@@ -1,1570 +0,0 @@
-//===- PassManager.cpp - LLVM Pass Infrastructure Implementation ----------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the LLVM Pass Manager infrastructure.
-//
-//===----------------------------------------------------------------------===//
-
-
-#include "llvm/PassManagers.h"
-#include "llvm/Support/CommandLine.h"
-#include "llvm/Support/Timer.h"
-#include "llvm/Module.h"
-#include "llvm/ModuleProvider.h"
-#include "llvm/Support/Streams.h"
-#include "llvm/Support/ManagedStatic.h"
-#include "llvm-c/Core.h"
-#include <algorithm>
-#include <vector>
-#include <map>
-using namespace llvm;
-
-// See PassManagers.h for Pass Manager infrastructure overview.
-
-namespace llvm {
-
-//===----------------------------------------------------------------------===//
-// Pass debugging information. Often it is useful to find out what pass is
-// running when a crash occurs in a utility. When this library is compiled with
-// debugging on, a command line option (--debug-pass) is enabled that causes the
-// pass name to be printed before it executes.
-//
-
-// Different debug levels that can be enabled...
-enum PassDebugLevel {
- None, Arguments, Structure, Executions, Details
-};
-
-static cl::opt<enum PassDebugLevel>
-PassDebugging("debug-pass", cl::Hidden,
- cl::desc("Print PassManager debugging information"),
- cl::values(
- clEnumVal(None , "disable debug output"),
- clEnumVal(Arguments , "print pass arguments to pass to 'opt'"),
- clEnumVal(Structure , "print pass structure before run()"),
- clEnumVal(Executions, "print pass name before it is executed"),
- clEnumVal(Details , "print pass details when it is executed"),
- clEnumValEnd));
-} // End of llvm namespace
-
-namespace {
-
-//===----------------------------------------------------------------------===//
-// BBPassManager
-//
-/// BBPassManager manages BasicBlockPass. It batches all the
-/// pass together and sequence them to process one basic block before
-/// processing next basic block.
-class VISIBILITY_HIDDEN BBPassManager : public PMDataManager,
- public FunctionPass {
-
-public:
- static char ID;
- explicit BBPassManager(int Depth)
- : PMDataManager(Depth), FunctionPass((intptr_t)&ID) {}
-
- /// Execute all of the passes scheduled for execution. Keep track of
- /// whether any of the passes modifies the function, and if so, return true.
- bool runOnFunction(Function &F);
-
- /// Pass Manager itself does not invalidate any analysis info.
- void getAnalysisUsage(AnalysisUsage &Info) const {
- Info.setPreservesAll();
- }
-
- bool doInitialization(Module &M);
- bool doInitialization(Function &F);
- bool doFinalization(Module &M);
- bool doFinalization(Function &F);
-
- virtual const char *getPassName() const {
- return "BasicBlock Pass Manager";
- }
-
- // Print passes managed by this manager
- void dumpPassStructure(unsigned Offset) {
- llvm::cerr << std::string(Offset*2, ' ') << "BasicBlockPass Manager\n";
- for (unsigned Index = 0; Index < getNumContainedPasses(); ++Index) {
- BasicBlockPass *BP = getContainedPass(Index);
- BP->dumpPassStructure(Offset + 1);
- dumpLastUses(BP, Offset+1);
- }
- }
-
- BasicBlockPass *getContainedPass(unsigned N) {
- assert ( N < PassVector.size() && "Pass number out of range!");
- BasicBlockPass *BP = static_cast<BasicBlockPass *>(PassVector[N]);
- return BP;
- }
-
- virtual PassManagerType getPassManagerType() const {
- return PMT_BasicBlockPassManager;
- }
-};
-
-char BBPassManager::ID = 0;
-}
-
-namespace llvm {
-
-//===----------------------------------------------------------------------===//
-// FunctionPassManagerImpl
-//
-/// FunctionPassManagerImpl manages FPPassManagers
-class FunctionPassManagerImpl : public Pass,
- public PMDataManager,
- public PMTopLevelManager {
-public:
- static char ID;
- explicit FunctionPassManagerImpl(int Depth) :
- Pass((intptr_t)&ID), PMDataManager(Depth),
- PMTopLevelManager(TLM_Function) { }
-
- /// add - Add a pass to the queue of passes to run. This passes ownership of
- /// the Pass to the PassManager. When the PassManager is destroyed, the pass
- /// will be destroyed as well, so there is no need to delete the pass. This
- /// implies that all passes MUST be allocated with 'new'.
- void add(Pass *P) {
- schedulePass(P);
- }
-
- /// run - Execute all of the passes scheduled for execution. Keep track of
- /// whether any of the passes modifies the module, and if so, return true.
- bool run(Function &F);
-
- /// doInitialization - Run all of the initializers for the function passes.
- ///
- bool doInitialization(Module &M);
-
- /// doFinalization - Run all of the finalizers for the function passes.
- ///
- bool doFinalization(Module &M);
-
- /// Pass Manager itself does not invalidate any analysis info.
- void getAnalysisUsage(AnalysisUsage &Info) const {
- Info.setPreservesAll();
- }
-
- inline void addTopLevelPass(Pass *P) {
-
- if (ImmutablePass *IP = dynamic_cast<ImmutablePass *> (P)) {
-
- // P is a immutable pass and it will be managed by this
- // top level manager. Set up analysis resolver to connect them.
- AnalysisResolver *AR = new AnalysisResolver(*this);
- P->setResolver(AR);
- initializeAnalysisImpl(P);
- addImmutablePass(IP);
- recordAvailableAnalysis(IP);
- } else {
- P->assignPassManager(activeStack);
- }
-
- }
-
- FPPassManager *getContainedManager(unsigned N) {
- assert ( N < PassManagers.size() && "Pass number out of range!");
- FPPassManager *FP = static_cast<FPPassManager *>(PassManagers[N]);
- return FP;
- }
-};
-
-char FunctionPassManagerImpl::ID = 0;
-//===----------------------------------------------------------------------===//
-// MPPassManager
-//
-/// MPPassManager manages ModulePasses and function pass managers.
-/// It batches all Module passes and function pass managers together and
-/// sequences them to process one module.
-class MPPassManager : public Pass, public PMDataManager {
-
-public:
- static char ID;
- explicit MPPassManager(int Depth) :
- Pass((intptr_t)&ID), PMDataManager(Depth) { }
-
- // Delete on the fly managers.
- virtual ~MPPassManager() {
- for (std::map<Pass *, FunctionPassManagerImpl *>::iterator
- I = OnTheFlyManagers.begin(), E = OnTheFlyManagers.end();
- I != E; ++I) {
- FunctionPassManagerImpl *FPP = I->second;
- delete FPP;
- }
- }
-
- /// run - Execute all of the passes scheduled for execution. Keep track of
- /// whether any of the passes modifies the module, and if so, return true.
- bool runOnModule(Module &M);
-
- /// Pass Manager itself does not invalidate any analysis info.
- void getAnalysisUsage(AnalysisUsage &Info) const {
- Info.setPreservesAll();
- }
-
- /// Add RequiredPass into list of lower level passes required by pass P.
- /// RequiredPass is run on the fly by Pass Manager when P requests it
- /// through getAnalysis interface.
- virtual void addLowerLevelRequiredPass(Pass *P, Pass *RequiredPass);
-
- /// Return function pass corresponding to PassInfo PI, that is
- /// required by module pass MP. Instantiate analysis pass, by using
- /// its runOnFunction() for function F.
- virtual Pass* getOnTheFlyPass(Pass *MP, const PassInfo *PI, Function &F);
-
- virtual const char *getPassName() const {
- return "Module Pass Manager";
- }
-
- // Print passes managed by this manager
- void dumpPassStructure(unsigned Offset) {
- llvm::cerr << std::string(Offset*2, ' ') << "ModulePass Manager\n";
- for (unsigned Index = 0; Index < getNumContainedPasses(); ++Index) {
- ModulePass *MP = getContainedPass(Index);
- MP->dumpPassStructure(Offset + 1);
- if (FunctionPassManagerImpl *FPP = OnTheFlyManagers[MP])
- FPP->dumpPassStructure(Offset + 2);
- dumpLastUses(MP, Offset+1);
- }
- }
-
- ModulePass *getContainedPass(unsigned N) {
- assert ( N < PassVector.size() && "Pass number out of range!");
- ModulePass *MP = static_cast<ModulePass *>(PassVector[N]);
- return MP;
- }
-
- virtual PassManagerType getPassManagerType() const {
- return PMT_ModulePassManager;
- }
-
- private:
- /// Collection of on the fly FPPassManagers. These managers manage
- /// function passes that are required by module passes.
- std::map<Pass *, FunctionPassManagerImpl *> OnTheFlyManagers;
-};
-
-char MPPassManager::ID = 0;
-//===----------------------------------------------------------------------===//
-// PassManagerImpl
-//
-
-/// PassManagerImpl manages MPPassManagers
-class PassManagerImpl : public Pass,
- public PMDataManager,
- public PMTopLevelManager {
-
-public:
- static char ID;
- explicit PassManagerImpl(int Depth) :
- Pass((intptr_t)&ID), PMDataManager(Depth),
- PMTopLevelManager(TLM_Pass) { }
-
- /// add - Add a pass to the queue of passes to run. This passes ownership of
- /// the Pass to the PassManager. When the PassManager is destroyed, the pass
- /// will be destroyed as well, so there is no need to delete the pass. This
- /// implies that all passes MUST be allocated with 'new'.
- void add(Pass *P) {
- schedulePass(P);
- }
-
- /// run - Execute all of the passes scheduled for execution. Keep track of
- /// whether any of the passes modifies the module, and if so, return true.
- bool run(Module &M);
-
- /// Pass Manager itself does not invalidate any analysis info.
- void getAnalysisUsage(AnalysisUsage &Info) const {
- Info.setPreservesAll();
- }
-
- inline void addTopLevelPass(Pass *P) {
-
- if (ImmutablePass *IP = dynamic_cast<ImmutablePass *> (P)) {
-
- // P is a immutable pass and it will be managed by this
- // top level manager. Set up analysis resolver to connect them.
- AnalysisResolver *AR = new AnalysisResolver(*this);
- P->setResolver(AR);
- initializeAnalysisImpl(P);
- addImmutablePass(IP);
- recordAvailableAnalysis(IP);
- } else {
- P->assignPassManager(activeStack);
- }
-
- }
-
- MPPassManager *getContainedManager(unsigned N) {
- assert ( N < PassManagers.size() && "Pass number out of range!");
- MPPassManager *MP = static_cast<MPPassManager *>(PassManagers[N]);
- return MP;
- }
-
-};
-
-char PassManagerImpl::ID = 0;
-} // End of llvm namespace
-
-namespace {
-
-//===----------------------------------------------------------------------===//
-// TimingInfo Class - This class is used to calculate information about the
-// amount of time each pass takes to execute. This only happens when
-// -time-passes is enabled on the command line.
-//
-
-class VISIBILITY_HIDDEN TimingInfo {
- std::map<Pass*, Timer> TimingData;
- TimerGroup TG;
-
-public:
- // Use 'create' member to get this.
- TimingInfo() : TG("... Pass execution timing report ...") {}
-
- // TimingDtor - Print out information about timing information
- ~TimingInfo() {
- // Delete all of the timers...
- TimingData.clear();
- // TimerGroup is deleted next, printing the report.
- }
-
- // createTheTimeInfo - This method either initializes the TheTimeInfo pointer
- // to a non null value (if the -time-passes option is enabled) or it leaves it
- // null. It may be called multiple times.
- static void createTheTimeInfo();
-
- void passStarted(Pass *P) {
-
- if (dynamic_cast<PMDataManager *>(P))
- return;
-
- std::map<Pass*, Timer>::iterator I = TimingData.find(P);
- if (I == TimingData.end())
- I=TimingData.insert(std::make_pair(P, Timer(P->getPassName(), TG))).first;
- I->second.startTimer();
- }
- void passEnded(Pass *P) {
-
- if (dynamic_cast<PMDataManager *>(P))
- return;
-
- std::map<Pass*, Timer>::iterator I = TimingData.find(P);
- assert (I != TimingData.end() && "passStarted/passEnded not nested right!");
- I->second.stopTimer();
- }
-};
-
-static TimingInfo *TheTimeInfo;
-
-} // End of anon namespace
-
-//===----------------------------------------------------------------------===//
-// PMTopLevelManager implementation
-
-/// Initialize top level manager. Create first pass manager.
-PMTopLevelManager::PMTopLevelManager (enum TopLevelManagerType t) {
-
- if (t == TLM_Pass) {
- MPPassManager *MPP = new MPPassManager(1);
- MPP->setTopLevelManager(this);
- addPassManager(MPP);
- activeStack.push(MPP);
- }
- else if (t == TLM_Function) {
- FPPassManager *FPP = new FPPassManager(1);
- FPP->setTopLevelManager(this);
- addPassManager(FPP);
- activeStack.push(FPP);
- }
-}
-
-/// Set pass P as the last user of the given analysis passes.
-void PMTopLevelManager::setLastUser(SmallVector<Pass *, 12> &AnalysisPasses,
- Pass *P) {
-
- for (SmallVector<Pass *, 12>::iterator I = AnalysisPasses.begin(),
- E = AnalysisPasses.end(); I != E; ++I) {
- Pass *AP = *I;
- LastUser[AP] = P;
-
- if (P == AP)
- continue;
-
- // If AP is the last user of other passes then make P last user of
- // such passes.
- for (std::map<Pass *, Pass *>::iterator LUI = LastUser.begin(),
- LUE = LastUser.end(); LUI != LUE; ++LUI) {
- if (LUI->second == AP)
- LastUser[LUI->first] = P;
- }
- }
-}
-
-/// Collect passes whose last user is P
-void PMTopLevelManager::collectLastUses(SmallVector<Pass *, 12> &LastUses,
- Pass *P) {
- for (std::map<Pass *, Pass *>::iterator LUI = LastUser.begin(),
- LUE = LastUser.end(); LUI != LUE; ++LUI)
- if (LUI->second == P)
- LastUses.push_back(LUI->first);
-}
-
-/// Schedule pass P for execution. Make sure that passes required by
-/// P are run before P is run. Update analysis info maintained by
-/// the manager. Remove dead passes. This is a recursive function.
-void PMTopLevelManager::schedulePass(Pass *P) {
-
- // TODO : Allocate function manager for this pass, other wise required set
- // may be inserted into previous function manager
-
- // Give pass a chance to prepare the stage.
- P->preparePassManager(activeStack);
-
- // If P is an analysis pass and it is available then do not
- // generate the analysis again. Stale analysis info should not be
- // available at this point.
- if (P->getPassInfo() &&
- P->getPassInfo()->isAnalysis() && findAnalysisPass(P->getPassInfo()))
- return;
-
- AnalysisUsage AnUsage;
- P->getAnalysisUsage(AnUsage);
- const std::vector<AnalysisID> &RequiredSet = AnUsage.getRequiredSet();
- for (std::vector<AnalysisID>::const_iterator I = RequiredSet.begin(),
- E = RequiredSet.end(); I != E; ++I) {
-
- Pass *AnalysisPass = findAnalysisPass(*I);
- if (!AnalysisPass) {
- AnalysisPass = (*I)->createPass();
- // Schedule this analysis run first only if it is not a lower level
- // analysis pass. Lower level analsyis passes are run on the fly.
- if (P->getPotentialPassManagerType () >=
- AnalysisPass->getPotentialPassManagerType())
- schedulePass(AnalysisPass);
- else
- delete AnalysisPass;
- }
- }
-
- // Now all required passes are available.
- addTopLevelPass(P);
-}
-
-/// Find the pass that implements Analysis AID. Search immutable
-/// passes and all pass managers. If desired pass is not found
-/// then return NULL.
-Pass *PMTopLevelManager::findAnalysisPass(AnalysisID AID) {
-
- Pass *P = NULL;
- // Check pass managers
- for (std::vector<PMDataManager *>::iterator I = PassManagers.begin(),
- E = PassManagers.end(); P == NULL && I != E; ++I) {
- PMDataManager *PMD = *I;
- P = PMD->findAnalysisPass(AID, false);
- }
-
- // Check other pass managers
- for (std::vector<PMDataManager *>::iterator I = IndirectPassManagers.begin(),
- E = IndirectPassManagers.end(); P == NULL && I != E; ++I)
- P = (*I)->findAnalysisPass(AID, false);
-
- for (std::vector<ImmutablePass *>::iterator I = ImmutablePasses.begin(),
- E = ImmutablePasses.end(); P == NULL && I != E; ++I) {
- const PassInfo *PI = (*I)->getPassInfo();
- if (PI == AID)
- P = *I;
-
- // If Pass not found then check the interfaces implemented by Immutable Pass
- if (!P) {
- const std::vector<const PassInfo*> &ImmPI =
- PI->getInterfacesImplemented();
- if (std::find(ImmPI.begin(), ImmPI.end(), AID) != ImmPI.end())
- P = *I;
- }
- }
-
- return P;
-}
-
-// Print passes managed by this top level manager.
-void PMTopLevelManager::dumpPasses() const {
-
- if (PassDebugging < Structure)
- return;
-
- // Print out the immutable passes
- for (unsigned i = 0, e = ImmutablePasses.size(); i != e; ++i) {
- ImmutablePasses[i]->dumpPassStructure(0);
- }
-
- // Every class that derives from PMDataManager also derives from Pass
- // (sometimes indirectly), but there's no inheritance relationship
- // between PMDataManager and Pass, so we have to dynamic_cast to get
- // from a PMDataManager* to a Pass*.
- for (std::vector<PMDataManager *>::const_iterator I = PassManagers.begin(),
- E = PassManagers.end(); I != E; ++I)
- dynamic_cast<Pass *>(*I)->dumpPassStructure(1);
-}
-
-void PMTopLevelManager::dumpArguments() const {
-
- if (PassDebugging < Arguments)
- return;
-
- cerr << "Pass Arguments: ";
- for (std::vector<PMDataManager *>::const_iterator I = PassManagers.begin(),
- E = PassManagers.end(); I != E; ++I) {
- PMDataManager *PMD = *I;
- PMD->dumpPassArguments();
- }
- cerr << "\n";
-}
-
-void PMTopLevelManager::initializeAllAnalysisInfo() {
-
- for (std::vector<PMDataManager *>::iterator I = PassManagers.begin(),
- E = PassManagers.end(); I != E; ++I) {
- PMDataManager *PMD = *I;
- PMD->initializeAnalysisInfo();
- }
-
- // Initailize other pass managers
- for (std::vector<PMDataManager *>::iterator I = IndirectPassManagers.begin(),
- E = IndirectPassManagers.end(); I != E; ++I)
- (*I)->initializeAnalysisInfo();
-}
-
-/// Destructor
-PMTopLevelManager::~PMTopLevelManager() {
- for (std::vector<PMDataManager *>::iterator I = PassManagers.begin(),
- E = PassManagers.end(); I != E; ++I)
- delete *I;
-
- for (std::vector<ImmutablePass *>::iterator
- I = ImmutablePasses.begin(), E = ImmutablePasses.end(); I != E; ++I)
- delete *I;
-}
-
-//===----------------------------------------------------------------------===//
-// PMDataManager implementation
-
-/// Augement AvailableAnalysis by adding analysis made available by pass P.
-void PMDataManager::recordAvailableAnalysis(Pass *P) {
-
- if (const PassInfo *PI = P->getPassInfo()) {
- AvailableAnalysis[PI] = P;
-
- //This pass is the current implementation of all of the interfaces it
- //implements as well.
- const std::vector<const PassInfo*> &II = PI->getInterfacesImplemented();
- for (unsigned i = 0, e = II.size(); i != e; ++i)
- AvailableAnalysis[II[i]] = P;
- }
-}
-
-// Return true if P preserves high level analysis used by other
-// passes managed by this manager
-bool PMDataManager::preserveHigherLevelAnalysis(Pass *P) {
-
- AnalysisUsage AnUsage;
- P->getAnalysisUsage(AnUsage);
-
- if (AnUsage.getPreservesAll())
- return true;
-
- const std::vector<AnalysisID> &PreservedSet = AnUsage.getPreservedSet();
- for (std::vector<Pass *>::iterator I = HigherLevelAnalysis.begin(),
- E = HigherLevelAnalysis.end(); I != E; ++I) {
- Pass *P1 = *I;
- if (!dynamic_cast<ImmutablePass*>(P1) &&
- std::find(PreservedSet.begin(), PreservedSet.end(),
- P1->getPassInfo()) ==
- PreservedSet.end())
- return false;
- }
-
- return true;
-}
-
-/// verifyPreservedAnalysis -- Verify analysis presreved by pass P.
-void PMDataManager::verifyPreservedAnalysis(Pass *P) {
- AnalysisUsage AnUsage;
- P->getAnalysisUsage(AnUsage);
- const std::vector<AnalysisID> &PreservedSet = AnUsage.getPreservedSet();
-
- // Verify preserved analysis
- for (std::vector<AnalysisID>::const_iterator I = PreservedSet.begin(),
- E = PreservedSet.end(); I != E; ++I) {
- AnalysisID AID = *I;
- Pass *AP = findAnalysisPass(AID, true);
- if (AP)
- AP->verifyAnalysis();
- }
-}
-
-/// Remove Analyss not preserved by Pass P
-void PMDataManager::removeNotPreservedAnalysis(Pass *P) {
- AnalysisUsage AnUsage;
- P->getAnalysisUsage(AnUsage);
- if (AnUsage.getPreservesAll())
- return;
-
- const std::vector<AnalysisID> &PreservedSet = AnUsage.getPreservedSet();
- for (std::map<AnalysisID, Pass*>::iterator I = AvailableAnalysis.begin(),
- E = AvailableAnalysis.end(); I != E; ) {
- std::map<AnalysisID, Pass*>::iterator Info = I++;
- if (!dynamic_cast<ImmutablePass*>(Info->second)
- && std::find(PreservedSet.begin(), PreservedSet.end(), Info->first) ==
- PreservedSet.end())
- // Remove this analysis
- AvailableAnalysis.erase(Info);
- }
-
- // Check inherited analysis also. If P is not preserving analysis
- // provided by parent manager then remove it here.
- for (unsigned Index = 0; Index < PMT_Last; ++Index) {
-
- if (!InheritedAnalysis[Index])
- continue;
-
- for (std::map<AnalysisID, Pass*>::iterator
- I = InheritedAnalysis[Index]->begin(),
- E = InheritedAnalysis[Index]->end(); I != E; ) {
- std::map<AnalysisID, Pass *>::iterator Info = I++;
- if (!dynamic_cast<ImmutablePass*>(Info->second) &&
- std::find(PreservedSet.begin(), PreservedSet.end(), Info->first) ==
- PreservedSet.end())
- // Remove this analysis
- InheritedAnalysis[Index]->erase(Info);
- }
- }
-
-}
-
-/// Remove analysis passes that are not used any longer
-void PMDataManager::removeDeadPasses(Pass *P, const char *Msg,
- enum PassDebuggingString DBG_STR) {
-
- SmallVector<Pass *, 12> DeadPasses;
-
- // If this is a on the fly manager then it does not have TPM.
- if (!TPM)
- return;
-
- TPM->collectLastUses(DeadPasses, P);
-
- for (SmallVector<Pass *, 12>::iterator I = DeadPasses.begin(),
- E = DeadPasses.end(); I != E; ++I) {
-
- dumpPassInfo(*I, FREEING_MSG, DBG_STR, Msg);
-
- if (TheTimeInfo) TheTimeInfo->passStarted(*I);
- (*I)->releaseMemory();
- if (TheTimeInfo) TheTimeInfo->passEnded(*I);
-
- std::map<AnalysisID, Pass*>::iterator Pos =
- AvailableAnalysis.find((*I)->getPassInfo());
-
- // It is possible that pass is already removed from the AvailableAnalysis
- if (Pos != AvailableAnalysis.end())
- AvailableAnalysis.erase(Pos);
- }
-}
-
-/// Add pass P into the PassVector. Update
-/// AvailableAnalysis appropriately if ProcessAnalysis is true.
-void PMDataManager::add(Pass *P,
- bool ProcessAnalysis) {
-
- // This manager is going to manage pass P. Set up analysis resolver
- // to connect them.
- AnalysisResolver *AR = new AnalysisResolver(*this);
- P->setResolver(AR);
-
- // If a FunctionPass F is the last user of ModulePass info M
- // then the F's manager, not F, records itself as a last user of M.
- SmallVector<Pass *, 12> TransferLastUses;
-
- if (ProcessAnalysis) {
-
- // At the moment, this pass is the last user of all required passes.
- SmallVector<Pass *, 12> LastUses;
- SmallVector<Pass *, 8> RequiredPasses;
- SmallVector<AnalysisID, 8> ReqAnalysisNotAvailable;
-
- unsigned PDepth = this->getDepth();
-
- collectRequiredAnalysis(RequiredPasses,
- ReqAnalysisNotAvailable, P);
- for (SmallVector<Pass *, 8>::iterator I = RequiredPasses.begin(),
- E = RequiredPasses.end(); I != E; ++I) {
- Pass *PRequired = *I;
- unsigned RDepth = 0;
-
- PMDataManager &DM = PRequired->getResolver()->getPMDataManager();
- RDepth = DM.getDepth();
-
- if (PDepth == RDepth)
- LastUses.push_back(PRequired);
- else if (PDepth > RDepth) {
- // Let the parent claim responsibility of last use
- TransferLastUses.push_back(PRequired);
- // Keep track of higher level analysis used by this manager.
- HigherLevelAnalysis.push_back(PRequired);
- } else
- assert (0 && "Unable to accomodate Required Pass");
- }
-
- // Set P as P's last user until someone starts using P.
- // However, if P is a Pass Manager then it does not need
- // to record its last user.
- if (!dynamic_cast<PMDataManager *>(P))
- LastUses.push_back(P);
- TPM->setLastUser(LastUses, P);
-
- if (!TransferLastUses.empty()) {
- Pass *My_PM = dynamic_cast<Pass *>(this);
- TPM->setLastUser(TransferLastUses, My_PM);
- TransferLastUses.clear();
- }
-
- // Now, take care of required analysises that are not available.
- for (SmallVector<AnalysisID, 8>::iterator
- I = ReqAnalysisNotAvailable.begin(),
- E = ReqAnalysisNotAvailable.end() ;I != E; ++I) {
- Pass *AnalysisPass = (*I)->createPass();
- this->addLowerLevelRequiredPass(P, AnalysisPass);
- }
-
- // Take a note of analysis required and made available by this pass.
- // Remove the analysis not preserved by this pass
- removeNotPreservedAnalysis(P);
- recordAvailableAnalysis(P);
- }
-
- // Add pass
- PassVector.push_back(P);
-}
-
-
-/// Populate RP with analysis pass that are required by
-/// pass P and are available. Populate RP_NotAvail with analysis
-/// pass that are required by pass P but are not available.
-void PMDataManager::collectRequiredAnalysis(SmallVector<Pass *, 8>&RP,
- SmallVector<AnalysisID, 8> &RP_NotAvail,
- Pass *P) {
- AnalysisUsage AnUsage;
- P->getAnalysisUsage(AnUsage);
- const std::vector<AnalysisID> &RequiredSet = AnUsage.getRequiredSet();
- for (std::vector<AnalysisID>::const_iterator
- I = RequiredSet.begin(), E = RequiredSet.end();
- I != E; ++I) {
- AnalysisID AID = *I;
- if (Pass *AnalysisPass = findAnalysisPass(*I, true))
- RP.push_back(AnalysisPass);
- else
- RP_NotAvail.push_back(AID);
- }
-
- const std::vector<AnalysisID> &IDs = AnUsage.getRequiredTransitiveSet();
- for (std::vector<AnalysisID>::const_iterator I = IDs.begin(),
- E = IDs.end(); I != E; ++I) {
- AnalysisID AID = *I;
- if (Pass *AnalysisPass = findAnalysisPass(*I, true))
- RP.push_back(AnalysisPass);
- else
- RP_NotAvail.push_back(AID);
- }
-}
-
-// All Required analyses should be available to the pass as it runs! Here
-// we fill in the AnalysisImpls member of the pass so that it can
-// successfully use the getAnalysis() method to retrieve the
-// implementations it needs.
-//
-void PMDataManager::initializeAnalysisImpl(Pass *P) {
- AnalysisUsage AnUsage;
- P->getAnalysisUsage(AnUsage);
-
- for (std::vector<const PassInfo *>::const_iterator
- I = AnUsage.getRequiredSet().begin(),
- E = AnUsage.getRequiredSet().end(); I != E; ++I) {
- Pass *Impl = findAnalysisPass(*I, true);
- if (Impl == 0)
- // This may be analysis pass that is initialized on the fly.
- // If that is not the case then it will raise an assert when it is used.
- continue;
- AnalysisResolver *AR = P->getResolver();
- AR->addAnalysisImplsPair(*I, Impl);
- }
-}
-
-/// Find the pass that implements Analysis AID. If desired pass is not found
-/// then return NULL.
-Pass *PMDataManager::findAnalysisPass(AnalysisID AID, bool SearchParent) {
-
- // Check if AvailableAnalysis map has one entry.
- std::map<AnalysisID, Pass*>::const_iterator I = AvailableAnalysis.find(AID);
-
- if (I != AvailableAnalysis.end())
- return I->second;
-
- // Search Parents through TopLevelManager
- if (SearchParent)
- return TPM->findAnalysisPass(AID);
-
- return NULL;
-}
-
-// Print list of passes that are last used by P.
-void PMDataManager::dumpLastUses(Pass *P, unsigned Offset) const{
-
- SmallVector<Pass *, 12> LUses;
-
- // If this is a on the fly manager then it does not have TPM.
- if (!TPM)
- return;
-
- TPM->collectLastUses(LUses, P);
-
- for (SmallVector<Pass *, 12>::iterator I = LUses.begin(),
- E = LUses.end(); I != E; ++I) {
- llvm::cerr << "--" << std::string(Offset*2, ' ');
- (*I)->dumpPassStructure(0);
- }
-}
-
-void PMDataManager::dumpPassArguments() const {
- for(std::vector<Pass *>::const_iterator I = PassVector.begin(),
- E = PassVector.end(); I != E; ++I) {
- if (PMDataManager *PMD = dynamic_cast<PMDataManager *>(*I))
- PMD->dumpPassArguments();
- else
- if (const PassInfo *PI = (*I)->getPassInfo())
- if (!PI->isAnalysisGroup())
- cerr << " -" << PI->getPassArgument();
- }
-}
-
-void PMDataManager::dumpPassInfo(Pass *P, enum PassDebuggingString S1,
- enum PassDebuggingString S2,
- const char *Msg) {
- if (PassDebugging < Executions)
- return;
- cerr << (void*)this << std::string(getDepth()*2+1, ' ');
- switch (S1) {
- case EXECUTION_MSG:
- cerr << "Executing Pass '" << P->getPassName();
- break;
- case MODIFICATION_MSG:
- cerr << "Made Modification '" << P->getPassName();
- break;
- case FREEING_MSG:
- cerr << " Freeing Pass '" << P->getPassName();
- break;
- default:
- break;
- }
- switch (S2) {
- case ON_BASICBLOCK_MSG:
- cerr << "' on BasicBlock '" << Msg << "'...\n";
- break;
- case ON_FUNCTION_MSG:
- cerr << "' on Function '" << Msg << "'...\n";
- break;
- case ON_MODULE_MSG:
- cerr << "' on Module '" << Msg << "'...\n";
- break;
- case ON_LOOP_MSG:
- cerr << "' on Loop " << Msg << "'...\n";
- break;
- case ON_CG_MSG:
- cerr << "' on Call Graph " << Msg << "'...\n";
- break;
- default:
- break;
- }
-}
-
-void PMDataManager::dumpAnalysisSetInfo(const char *Msg, Pass *P,
- const std::vector<AnalysisID> &Set)
- const {
- if (PassDebugging >= Details && !Set.empty()) {
- cerr << (void*)P << std::string(getDepth()*2+3, ' ') << Msg << " Analyses:";
- for (unsigned i = 0; i != Set.size(); ++i) {
- if (i) cerr << ",";
- cerr << " " << Set[i]->getPassName();
- }
- cerr << "\n";
- }
-}
-
-/// Add RequiredPass into list of lower level passes required by pass P.
-/// RequiredPass is run on the fly by Pass Manager when P requests it
-/// through getAnalysis interface.
-/// This should be handled by specific pass manager.
-void PMDataManager::addLowerLevelRequiredPass(Pass *P, Pass *RequiredPass) {
- if (TPM) {
- TPM->dumpArguments();
- TPM->dumpPasses();
- }
-
- // Module Level pass may required Function Level analysis info
- // (e.g. dominator info). Pass manager uses on the fly function pass manager
- // to provide this on demand. In that case, in Pass manager terminology,
- // module level pass is requiring lower level analysis info managed by
- // lower level pass manager.
-
- // When Pass manager is not able to order required analysis info, Pass manager
- // checks whether any lower level manager will be able to provide this
- // analysis info on demand or not.
- assert (0 && "Unable to handle Pass that requires lower level Analysis pass");
-}
-
-// Destructor
-PMDataManager::~PMDataManager() {
-
- for (std::vector<Pass *>::iterator I = PassVector.begin(),
- E = PassVector.end(); I != E; ++I)
- delete *I;
-
-}
-
-//===----------------------------------------------------------------------===//
-// NOTE: Is this the right place to define this method ?
-// getAnalysisToUpdate - Return an analysis result or null if it doesn't exist
-Pass *AnalysisResolver::getAnalysisToUpdate(AnalysisID ID, bool dir) const {
- return PM.findAnalysisPass(ID, dir);
-}
-
-Pass *AnalysisResolver::findImplPass(Pass *P, const PassInfo *AnalysisPI,
- Function &F) {
- return PM.getOnTheFlyPass(P, AnalysisPI, F);
-}
-
-//===----------------------------------------------------------------------===//
-// BBPassManager implementation
-
-/// Execute all of the passes scheduled for execution by invoking
-/// runOnBasicBlock method. Keep track of whether any of the passes modifies
-/// the function, and if so, return true.
-bool
-BBPassManager::runOnFunction(Function &F) {
-
- if (F.isDeclaration())
- return false;
-
- bool Changed = doInitialization(F);
-
- for (Function::iterator I = F.begin(), E = F.end(); I != E; ++I)
- for (unsigned Index = 0; Index < getNumContainedPasses(); ++Index) {
- BasicBlockPass *BP = getContainedPass(Index);
- AnalysisUsage AnUsage;
- BP->getAnalysisUsage(AnUsage);
-
- dumpPassInfo(BP, EXECUTION_MSG, ON_BASICBLOCK_MSG, I->getNameStart());
- dumpAnalysisSetInfo("Required", BP, AnUsage.getRequiredSet());
-
- initializeAnalysisImpl(BP);
-
- if (TheTimeInfo) TheTimeInfo->passStarted(BP);
- Changed |= BP->runOnBasicBlock(*I);
- if (TheTimeInfo) TheTimeInfo->passEnded(BP);
-
- if (Changed)
- dumpPassInfo(BP, MODIFICATION_MSG, ON_BASICBLOCK_MSG,
- I->getNameStart());
- dumpAnalysisSetInfo("Preserved", BP, AnUsage.getPreservedSet());
-
- verifyPreservedAnalysis(BP);
- removeNotPreservedAnalysis(BP);
- recordAvailableAnalysis(BP);
- removeDeadPasses(BP, I->getNameStart(), ON_BASICBLOCK_MSG);
- }
-
- return Changed |= doFinalization(F);
-}
-
-// Implement doInitialization and doFinalization
-inline bool BBPassManager::doInitialization(Module &M) {
- bool Changed = false;
-
- for (unsigned Index = 0; Index < getNumContainedPasses(); ++Index) {
- BasicBlockPass *BP = getContainedPass(Index);
- Changed |= BP->doInitialization(M);
- }
-
- return Changed;
-}
-
-inline bool BBPassManager::doFinalization(Module &M) {
- bool Changed = false;
-
- for (unsigned Index = 0; Index < getNumContainedPasses(); ++Index) {
- BasicBlockPass *BP = getContainedPass(Index);
- Changed |= BP->doFinalization(M);
- }
-
- return Changed;
-}
-
-inline bool BBPassManager::doInitialization(Function &F) {
- bool Changed = false;
-
- for (unsigned Index = 0; Index < getNumContainedPasses(); ++Index) {
- BasicBlockPass *BP = getContainedPass(Index);
- Changed |= BP->doInitialization(F);
- }
-
- return Changed;
-}
-
-inline bool BBPassManager::doFinalization(Function &F) {
- bool Changed = false;
-
- for (unsigned Index = 0; Index < getNumContainedPasses(); ++Index) {
- BasicBlockPass *BP = getContainedPass(Index);
- Changed |= BP->doFinalization(F);
- }
-
- return Changed;
-}
-
-
-//===----------------------------------------------------------------------===//
-// FunctionPassManager implementation
-
-/// Create new Function pass manager
-FunctionPassManager::FunctionPassManager(ModuleProvider *P) {
- FPM = new FunctionPassManagerImpl(0);
- // FPM is the top level manager.
- FPM->setTopLevelManager(FPM);
-
- AnalysisResolver *AR = new AnalysisResolver(*FPM);
- FPM->setResolver(AR);
-
- MP = P;
-}
-
-FunctionPassManager::~FunctionPassManager() {
- delete FPM;
-}
-
-/// add - Add a pass to the queue of passes to run. This passes
-/// ownership of the Pass to the PassManager. When the
-/// PassManager_X is destroyed, the pass will be destroyed as well, so
-/// there is no need to delete the pass. (TODO delete passes.)
-/// This implies that all passes MUST be allocated with 'new'.
-void FunctionPassManager::add(Pass *P) {
- FPM->add(P);
-}
-
-/// run - Execute all of the passes scheduled for execution. Keep
-/// track of whether any of the passes modifies the function, and if
-/// so, return true.
-///
-bool FunctionPassManager::run(Function &F) {
- std::string errstr;
- if (MP->materializeFunction(&F, &errstr)) {
- cerr << "Error reading bitcode file: " << errstr << "\n";
- abort();
- }
- return FPM->run(F);
-}
-
-
-/// doInitialization - Run all of the initializers for the function passes.
-///
-bool FunctionPassManager::doInitialization() {
- return FPM->doInitialization(*MP->getModule());
-}
-
-/// doFinalization - Run all of the finalizers for the function passes.
-///
-bool FunctionPassManager::doFinalization() {
- return FPM->doFinalization(*MP->getModule());
-}
-
-//===----------------------------------------------------------------------===//
-// FunctionPassManagerImpl implementation
-//
-inline bool FunctionPassManagerImpl::doInitialization(Module &M) {
- bool Changed = false;
-
- for (unsigned Index = 0; Index < getNumContainedManagers(); ++Index) {
- FPPassManager *FP = getContainedManager(Index);
- Changed |= FP->doInitialization(M);
- }
-
- return Changed;
-}
-
-inline bool FunctionPassManagerImpl::doFinalization(Module &M) {
- bool Changed = false;
-
- for (unsigned Index = 0; Index < getNumContainedManagers(); ++Index) {
- FPPassManager *FP = getContainedManager(Index);
- Changed |= FP->doFinalization(M);
- }
-
- return Changed;
-}
-
-// Execute all the passes managed by this top level manager.
-// Return true if any function is modified by a pass.
-bool FunctionPassManagerImpl::run(Function &F) {
-
- bool Changed = false;
-
- TimingInfo::createTheTimeInfo();
-
- dumpArguments();
- dumpPasses();
-
- initializeAllAnalysisInfo();
- for (unsigned Index = 0; Index < getNumContainedManagers(); ++Index) {
- FPPassManager *FP = getContainedManager(Index);
- Changed |= FP->runOnFunction(F);
- }
- return Changed;
-}
-
-//===----------------------------------------------------------------------===//
-// FPPassManager implementation
-
-char FPPassManager::ID = 0;
-/// Print passes managed by this manager
-void FPPassManager::dumpPassStructure(unsigned Offset) {
- llvm::cerr << std::string(Offset*2, ' ') << "FunctionPass Manager\n";
- for (unsigned Index = 0; Index < getNumContainedPasses(); ++Index) {
- FunctionPass *FP = getContainedPass(Index);
- FP->dumpPassStructure(Offset + 1);
- dumpLastUses(FP, Offset+1);
- }
-}
-
-
-/// Execute all of the passes scheduled for execution by invoking
-/// runOnFunction method. Keep track of whether any of the passes modifies
-/// the function, and if so, return true.
-bool FPPassManager::runOnFunction(Function &F) {
-
- bool Changed = false;
-
- if (F.isDeclaration())
- return false;
-
- // Collect inherited analysis from Module level pass manager.
- populateInheritedAnalysis(TPM->activeStack);
-
- for (unsigned Index = 0; Index < getNumContainedPasses(); ++Index) {
- FunctionPass *FP = getContainedPass(Index);
-
- AnalysisUsage AnUsage;
- FP->getAnalysisUsage(AnUsage);
-
- dumpPassInfo(FP, EXECUTION_MSG, ON_FUNCTION_MSG, F.getNameStart());
- dumpAnalysisSetInfo("Required", FP, AnUsage.getRequiredSet());
-
- initializeAnalysisImpl(FP);
-
- if (TheTimeInfo) TheTimeInfo->passStarted(FP);
- Changed |= FP->runOnFunction(F);
- if (TheTimeInfo) TheTimeInfo->passEnded(FP);
-
- if (Changed)
- dumpPassInfo(FP, MODIFICATION_MSG, ON_FUNCTION_MSG, F.getNameStart());
- dumpAnalysisSetInfo("Preserved", FP, AnUsage.getPreservedSet());
-
- verifyPreservedAnalysis(FP);
- removeNotPreservedAnalysis(FP);
- recordAvailableAnalysis(FP);
- removeDeadPasses(FP, F.getNameStart(), ON_FUNCTION_MSG);
- }
- return Changed;
-}
-
-bool FPPassManager::runOnModule(Module &M) {
-
- bool Changed = doInitialization(M);
-
- for(Module::iterator I = M.begin(), E = M.end(); I != E; ++I)
- this->runOnFunction(*I);
-
- return Changed |= doFinalization(M);
-}
-
-inline bool FPPassManager::doInitialization(Module &M) {
- bool Changed = false;
-
- for (unsigned Index = 0; Index < getNumContainedPasses(); ++Index) {
- FunctionPass *FP = getContainedPass(Index);
- Changed |= FP->doInitialization(M);
- }
-
- return Changed;
-}
-
-inline bool FPPassManager::doFinalization(Module &M) {
- bool Changed = false;
-
- for (unsigned Index = 0; Index < getNumContainedPasses(); ++Index) {
- FunctionPass *FP = getContainedPass(Index);
- Changed |= FP->doFinalization(M);
- }
-
- return Changed;
-}
-
-//===----------------------------------------------------------------------===//
-// MPPassManager implementation
-
-/// Execute all of the passes scheduled for execution by invoking
-/// runOnModule method. Keep track of whether any of the passes modifies
-/// the module, and if so, return true.
-bool
-MPPassManager::runOnModule(Module &M) {
- bool Changed = false;
-
- for (unsigned Index = 0; Index < getNumContainedPasses(); ++Index) {
- ModulePass *MP = getContainedPass(Index);
-
- AnalysisUsage AnUsage;
- MP->getAnalysisUsage(AnUsage);
-
- dumpPassInfo(MP, EXECUTION_MSG, ON_MODULE_MSG,
- M.getModuleIdentifier().c_str());
- dumpAnalysisSetInfo("Required", MP, AnUsage.getRequiredSet());
-
- initializeAnalysisImpl(MP);
-
- if (TheTimeInfo) TheTimeInfo->passStarted(MP);
- Changed |= MP->runOnModule(M);
- if (TheTimeInfo) TheTimeInfo->passEnded(MP);
-
- if (Changed)
- dumpPassInfo(MP, MODIFICATION_MSG, ON_MODULE_MSG,
- M.getModuleIdentifier().c_str());
- dumpAnalysisSetInfo("Preserved", MP, AnUsage.getPreservedSet());
-
- verifyPreservedAnalysis(MP);
- removeNotPreservedAnalysis(MP);
- recordAvailableAnalysis(MP);
- removeDeadPasses(MP, M.getModuleIdentifier().c_str(), ON_MODULE_MSG);
- }
- return Changed;
-}
-
-/// Add RequiredPass into list of lower level passes required by pass P.
-/// RequiredPass is run on the fly by Pass Manager when P requests it
-/// through getAnalysis interface.
-void MPPassManager::addLowerLevelRequiredPass(Pass *P, Pass *RequiredPass) {
-
- assert (P->getPotentialPassManagerType() == PMT_ModulePassManager
- && "Unable to handle Pass that requires lower level Analysis pass");
- assert ((P->getPotentialPassManagerType() <
- RequiredPass->getPotentialPassManagerType())
- && "Unable to handle Pass that requires lower level Analysis pass");
-
- FunctionPassManagerImpl *FPP = OnTheFlyManagers[P];
- if (!FPP) {
- FPP = new FunctionPassManagerImpl(0);
- // FPP is the top level manager.
- FPP->setTopLevelManager(FPP);
-
- OnTheFlyManagers[P] = FPP;
- }
- FPP->add(RequiredPass);
-
- // Register P as the last user of RequiredPass.
- SmallVector<Pass *, 12> LU;
- LU.push_back(RequiredPass);
- FPP->setLastUser(LU, P);
-}
-
-/// Return function pass corresponding to PassInfo PI, that is
-/// required by module pass MP. Instantiate analysis pass, by using
-/// its runOnFunction() for function F.
-Pass* MPPassManager::getOnTheFlyPass(Pass *MP, const PassInfo *PI,
- Function &F) {
- AnalysisID AID = PI;
- FunctionPassManagerImpl *FPP = OnTheFlyManagers[MP];
- assert (FPP && "Unable to find on the fly pass");
-
- FPP->run(F);
- return (dynamic_cast<PMTopLevelManager *>(FPP))->findAnalysisPass(AID);
-}
-
-
-//===----------------------------------------------------------------------===//
-// PassManagerImpl implementation
-//
-/// run - Execute all of the passes scheduled for execution. Keep track of
-/// whether any of the passes modifies the module, and if so, return true.
-bool PassManagerImpl::run(Module &M) {
-
- bool Changed = false;
-
- TimingInfo::createTheTimeInfo();
-
- dumpArguments();
- dumpPasses();
-
- initializeAllAnalysisInfo();
- for (unsigned Index = 0; Index < getNumContainedManagers(); ++Index) {
- MPPassManager *MP = getContainedManager(Index);
- Changed |= MP->runOnModule(M);
- }
- return Changed;
-}
-
-//===----------------------------------------------------------------------===//
-// PassManager implementation
-
-/// Create new pass manager
-PassManager::PassManager() {
- PM = new PassManagerImpl(0);
- // PM is the top level manager
- PM->setTopLevelManager(PM);
-}
-
-PassManager::~PassManager() {
- delete PM;
-}
-
-/// add - Add a pass to the queue of passes to run. This passes ownership of
-/// the Pass to the PassManager. When the PassManager is destroyed, the pass
-/// will be destroyed as well, so there is no need to delete the pass. This
-/// implies that all passes MUST be allocated with 'new'.
-void
-PassManager::add(Pass *P) {
- PM->add(P);
-}
-
-/// run - Execute all of the passes scheduled for execution. Keep track of
-/// whether any of the passes modifies the module, and if so, return true.
-bool
-PassManager::run(Module &M) {
- return PM->run(M);
-}
-
-//===----------------------------------------------------------------------===//
-// TimingInfo Class - This class is used to calculate information about the
-// amount of time each pass takes to execute. This only happens with
-// -time-passes is enabled on the command line.
-//
-bool llvm::TimePassesIsEnabled = false;
-static cl::opt<bool,true>
-EnableTiming("time-passes", cl::location(TimePassesIsEnabled),
- cl::desc("Time each pass, printing elapsed time for each on exit"));
-
-// createTheTimeInfo - This method either initializes the TheTimeInfo pointer to
-// a non null value (if the -time-passes option is enabled) or it leaves it
-// null. It may be called multiple times.
-void TimingInfo::createTheTimeInfo() {
- if (!TimePassesIsEnabled || TheTimeInfo) return;
-
- // Constructed the first time this is called, iff -time-passes is enabled.
- // This guarantees that the object will be constructed before static globals,
- // thus it will be destroyed before them.
- static ManagedStatic<TimingInfo> TTI;
- TheTimeInfo = &*TTI;
-}
-
-/// If TimingInfo is enabled then start pass timer.
-void StartPassTimer(Pass *P) {
- if (TheTimeInfo)
- TheTimeInfo->passStarted(P);
-}
-
-/// If TimingInfo is enabled then stop pass timer.
-void StopPassTimer(Pass *P) {
- if (TheTimeInfo)
- TheTimeInfo->passEnded(P);
-}
-
-//===----------------------------------------------------------------------===//
-// PMStack implementation
-//
-
-// Pop Pass Manager from the stack and clear its analysis info.
-void PMStack::pop() {
-
- PMDataManager *Top = this->top();
- Top->initializeAnalysisInfo();
-
- S.pop_back();
-}
-
-// Push PM on the stack and set its top level manager.
-void PMStack::push(PMDataManager *PM) {
-
- PMDataManager *Top = NULL;
- assert (PM && "Unable to push. Pass Manager expected");
-
- if (this->empty()) {
- Top = PM;
- }
- else {
- Top = this->top();
- PMTopLevelManager *TPM = Top->getTopLevelManager();
-
- assert (TPM && "Unable to find top level manager");
- TPM->addIndirectPassManager(PM);
- PM->setTopLevelManager(TPM);
- }
-
- S.push_back(PM);
-}
-
-// Dump content of the pass manager stack.
-void PMStack::dump() {
- for(std::deque<PMDataManager *>::iterator I = S.begin(),
- E = S.end(); I != E; ++I) {
- Pass *P = dynamic_cast<Pass *>(*I);
- printf("%s ", P->getPassName());
- }
- if (!S.empty())
- printf("\n");
-}
-
-/// Find appropriate Module Pass Manager in the PM Stack and
-/// add self into that manager.
-void ModulePass::assignPassManager(PMStack &PMS,
- PassManagerType PreferredType) {
-
- // Find Module Pass Manager
- while(!PMS.empty()) {
- PassManagerType TopPMType = PMS.top()->getPassManagerType();
- if (TopPMType == PreferredType)
- break; // We found desired pass manager
- else if (TopPMType > PMT_ModulePassManager)
- PMS.pop(); // Pop children pass managers
- else
- break;
- }
-
- PMS.top()->add(this);
-}
-
-/// Find appropriate Function Pass Manager or Call Graph Pass Manager
-/// in the PM Stack and add self into that manager.
-void FunctionPass::assignPassManager(PMStack &PMS,
- PassManagerType PreferredType) {
-
- // Find Module Pass Manager (TODO : Or Call Graph Pass Manager)
- while(!PMS.empty()) {
- if (PMS.top()->getPassManagerType() > PMT_FunctionPassManager)
- PMS.pop();
- else
- break;
- }
- FPPassManager *FPP = dynamic_cast<FPPassManager *>(PMS.top());
-
- // Create new Function Pass Manager
- if (!FPP) {
- assert(!PMS.empty() && "Unable to create Function Pass Manager");
- PMDataManager *PMD = PMS.top();
-
- // [1] Create new Function Pass Manager
- FPP = new FPPassManager(PMD->getDepth() + 1);
- FPP->populateInheritedAnalysis(PMS);
-
- // [2] Set up new manager's top level manager
- PMTopLevelManager *TPM = PMD->getTopLevelManager();
- TPM->addIndirectPassManager(FPP);
-
- // [3] Assign manager to manage this new manager. This may create
- // and push new managers into PMS
-
- // If Call Graph Pass Manager is active then use it to manage
- // this new Function Pass manager.
- if (PMD->getPassManagerType() == PMT_CallGraphPassManager)
- FPP->assignPassManager(PMS, PMT_CallGraphPassManager);
- else
- FPP->assignPassManager(PMS);
-
- // [4] Push new manager into PMS
- PMS.push(FPP);
- }
-
- // Assign FPP as the manager of this pass.
- FPP->add(this);
-}
-
-/// Find appropriate Basic Pass Manager or Call Graph Pass Manager
-/// in the PM Stack and add self into that manager.
-void BasicBlockPass::assignPassManager(PMStack &PMS,
- PassManagerType PreferredType) {
-
- BBPassManager *BBP = NULL;
-
- // Basic Pass Manager is a leaf pass manager. It does not handle
- // any other pass manager.
- if (!PMS.empty())
- BBP = dynamic_cast<BBPassManager *>(PMS.top());
-
- // If leaf manager is not Basic Block Pass manager then create new
- // basic Block Pass manager.
-
- if (!BBP) {
- assert(!PMS.empty() && "Unable to create BasicBlock Pass Manager");
- PMDataManager *PMD = PMS.top();
-
- // [1] Create new Basic Block Manager
- BBP = new BBPassManager(PMD->getDepth() + 1);
-
- // [2] Set up new manager's top level manager
- // Basic Block Pass Manager does not live by itself
- PMTopLevelManager *TPM = PMD->getTopLevelManager();
- TPM->addIndirectPassManager(BBP);
-
- // [3] Assign manager to manage this new manager. This may create
- // and push new managers into PMS
- BBP->assignPassManager(PMS);
-
- // [4] Push new manager into PMS
- PMS.push(BBP);
- }
-
- // Assign BBP as the manager of this pass.
- BBP->add(this);
-}
-
-PassManagerBase::~PassManagerBase() {}
-
-/*===-- C Bindings --------------------------------------------------------===*/
-
-LLVMPassManagerRef LLVMCreatePassManager() {
- return wrap(new PassManager());
-}
-
-LLVMPassManagerRef LLVMCreateFunctionPassManager(LLVMModuleProviderRef P) {
- return wrap(new FunctionPassManager(unwrap(P)));
-}
-
-int LLVMRunPassManager(LLVMPassManagerRef PM, LLVMModuleRef M) {
- return unwrap<PassManager>(PM)->run(*unwrap(M));
-}
-
-int LLVMInitializeFunctionPassManager(LLVMPassManagerRef FPM) {
- return unwrap<FunctionPassManager>(FPM)->doInitialization();
-}
-
-int LLVMRunFunctionPassManager(LLVMPassManagerRef FPM, LLVMValueRef F) {
- return unwrap<FunctionPassManager>(FPM)->run(*unwrap<Function>(F));
-}
-
-int LLVMFinalizeFunctionPassManager(LLVMPassManagerRef FPM) {
- return unwrap<FunctionPassManager>(FPM)->doFinalization();
-}
-
-void LLVMDisposePassManager(LLVMPassManagerRef PM) {
- delete unwrap(PM);
-}
diff --git a/release_23/lib/VMCore/SymbolTableListTraitsImpl.h b/release_23/lib/VMCore/SymbolTableListTraitsImpl.h
deleted file mode 100644
index 2a3b3d835d13..000000000000
--- a/release_23/lib/VMCore/SymbolTableListTraitsImpl.h
+++ /dev/null
@@ -1,118 +0,0 @@
-//===-- llvm/SymbolTableListTraitsImpl.h - Implementation ------*- C++ -*--===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the stickier parts of the SymbolTableListTraits class,
-// and is explicitly instantiated where needed to avoid defining all this code
-// in a widely used header.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_SYMBOLTABLELISTTRAITS_IMPL_H
-#define LLVM_SYMBOLTABLELISTTRAITS_IMPL_H
-
-#include "llvm/SymbolTableListTraits.h"
-#include "llvm/ValueSymbolTable.h"
-
-namespace llvm {
-
-/// setSymTabObject - This is called when (f.e.) the parent of a basic block
-/// changes. This requires us to remove all the instruction symtab entries from
-/// the current function and reinsert them into the new function.
-template<typename ValueSubClass, typename ItemParentClass>
-template<typename TPtr>
-void SymbolTableListTraits<ValueSubClass,ItemParentClass>
-::setSymTabObject(TPtr *Dest, TPtr Src) {
- // Get the old symtab and value list before doing the assignment.
- ValueSymbolTable *OldST = TraitsClass::getSymTab(getListOwner());
-
- // Do it.
- *Dest = Src;
-
- // Get the new SymTab object.
- ValueSymbolTable *NewST = TraitsClass::getSymTab(getListOwner());
-
- // If there is nothing to do, quick exit.
- if (OldST == NewST) return;
-
- // Move all the elements from the old symtab to the new one.
- iplist<ValueSubClass> &ItemList = TraitsClass::getList(getListOwner());
- if (ItemList.empty()) return;
-
- if (OldST) {
- // Remove all entries from the previous symtab.
- for (typename iplist<ValueSubClass>::iterator I = ItemList.begin();
- I != ItemList.end(); ++I)
- if (I->hasName())
- OldST->removeValueName(I->getValueName());
- }
-
- if (NewST) {
- // Add all of the items to the new symtab.
- for (typename iplist<ValueSubClass>::iterator I = ItemList.begin();
- I != ItemList.end(); ++I)
- if (I->hasName())
- NewST->reinsertValue(I);
- }
-
-}
-
-template<typename ValueSubClass, typename ItemParentClass>
-void SymbolTableListTraits<ValueSubClass,ItemParentClass>
-::addNodeToList(ValueSubClass *V) {
- assert(V->getParent() == 0 && "Value already in a container!!");
- ItemParentClass *Owner = getListOwner();
- V->setParent(Owner);
- if (V->hasName())
- if (ValueSymbolTable *ST = TraitsClass::getSymTab(Owner))
- ST->reinsertValue(V);
-}
-
-template<typename ValueSubClass, typename ItemParentClass>
-void SymbolTableListTraits<ValueSubClass,ItemParentClass>
-::removeNodeFromList(ValueSubClass *V) {
- V->setParent(0);
- if (V->hasName())
- if (ValueSymbolTable *ST = TraitsClass::getSymTab(getListOwner()))
- ST->removeValueName(V->getValueName());
-}
-
-template<typename ValueSubClass, typename ItemParentClass>
-void SymbolTableListTraits<ValueSubClass,ItemParentClass>
-::transferNodesFromList(iplist<ValueSubClass, ilist_traits<ValueSubClass> > &L2,
- ilist_iterator<ValueSubClass> first,
- ilist_iterator<ValueSubClass> last) {
- // We only have to do work here if transferring instructions between BBs
- ItemParentClass *NewIP = getListOwner(), *OldIP = L2.getListOwner();
- if (NewIP == OldIP) return; // No work to do at all...
-
- // We only have to update symbol table entries if we are transferring the
- // instructions to a different symtab object...
- ValueSymbolTable *NewST = TraitsClass::getSymTab(NewIP);
- ValueSymbolTable *OldST = TraitsClass::getSymTab(OldIP);
- if (NewST != OldST) {
- for (; first != last; ++first) {
- ValueSubClass &V = *first;
- bool HasName = V.hasName();
- if (OldST && HasName)
- OldST->removeValueName(V.getValueName());
- V.setParent(NewIP);
- if (NewST && HasName)
- NewST->reinsertValue(&V);
- }
- } else {
- // Just transferring between blocks in the same function, simply update the
- // parent fields in the instructions...
- for (; first != last; ++first)
- first->setParent(NewIP);
- }
-}
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/lib/VMCore/Type.cpp b/release_23/lib/VMCore/Type.cpp
deleted file mode 100644
index 633991299b2c..000000000000
--- a/release_23/lib/VMCore/Type.cpp
+++ /dev/null
@@ -1,1540 +0,0 @@
-//===-- Type.cpp - Implement the Type class -------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the Type class for the VMCore library.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/DerivedTypes.h"
-#include "llvm/Constants.h"
-#include "llvm/ADT/DepthFirstIterator.h"
-#include "llvm/ADT/StringExtras.h"
-#include "llvm/ADT/SCCIterator.h"
-#include "llvm/ADT/STLExtras.h"
-#include "llvm/Support/MathExtras.h"
-#include "llvm/Support/Compiler.h"
-#include "llvm/Support/ManagedStatic.h"
-#include "llvm/Support/Debug.h"
-#include <algorithm>
-#include <cstdarg>
-using namespace llvm;
-
-// DEBUG_MERGE_TYPES - Enable this #define to see how and when derived types are
-// created and later destroyed, all in an effort to make sure that there is only
-// a single canonical version of a type.
-//
-// #define DEBUG_MERGE_TYPES 1
-
-AbstractTypeUser::~AbstractTypeUser() {}
-
-
-//===----------------------------------------------------------------------===//
-// Type PATypeHolder Implementation
-//===----------------------------------------------------------------------===//
-
-/// get - This implements the forwarding part of the union-find algorithm for
-/// abstract types. Before every access to the Type*, we check to see if the
-/// type we are pointing to is forwarding to a new type. If so, we drop our
-/// reference to the type.
-///
-Type* PATypeHolder::get() const {
- const Type *NewTy = Ty->getForwardedType();
- if (!NewTy) return const_cast<Type*>(Ty);
- return *const_cast<PATypeHolder*>(this) = NewTy;
-}
-
-//===----------------------------------------------------------------------===//
-// Type Class Implementation
-//===----------------------------------------------------------------------===//
-
-// Concrete/Abstract TypeDescriptions - We lazily calculate type descriptions
-// for types as they are needed. Because resolution of types must invalidate
-// all of the abstract type descriptions, we keep them in a seperate map to make
-// this easy.
-static ManagedStatic<std::map<const Type*,
- std::string> > ConcreteTypeDescriptions;
-static ManagedStatic<std::map<const Type*,
- std::string> > AbstractTypeDescriptions;
-
-/// Because of the way Type subclasses are allocated, this function is necessary
-/// to use the correct kind of "delete" operator to deallocate the Type object.
-/// Some type objects (FunctionTy, StructTy) allocate additional space after
-/// the space for their derived type to hold the contained types array of
-/// PATypeHandles. Using this allocation scheme means all the PATypeHandles are
-/// allocated with the type object, decreasing allocations and eliminating the
-/// need for a std::vector to be used in the Type class itself.
-/// @brief Type destruction function
-void Type::destroy() const {
-
- // Structures and Functions allocate their contained types past the end of
- // the type object itself. These need to be destroyed differently than the
- // other types.
- if (isa<FunctionType>(this) || isa<StructType>(this)) {
- // First, make sure we destruct any PATypeHandles allocated by these
- // subclasses. They must be manually destructed.
- for (unsigned i = 0; i < NumContainedTys; ++i)
- ContainedTys[i].PATypeHandle::~PATypeHandle();
-
- // Now call the destructor for the subclass directly because we're going
- // to delete this as an array of char.
- if (isa<FunctionType>(this))
- ((FunctionType*)this)->FunctionType::~FunctionType();
- else
- ((StructType*)this)->StructType::~StructType();
-
- // Finally, remove the memory as an array deallocation of the chars it was
- // constructed from.
- delete [] reinterpret_cast<const char*>(this);
-
- return;
- }
-
- // For all the other type subclasses, there is either no contained types or
- // just one (all Sequentials). For Sequentials, the PATypeHandle is not
- // allocated past the type object, its included directly in the SequentialType
- // class. This means we can safely just do "normal" delete of this object and
- // all the destructors that need to run will be run.
- delete this;
-}
-
-const Type *Type::getPrimitiveType(TypeID IDNumber) {
- switch (IDNumber) {
- case VoidTyID : return VoidTy;
- case FloatTyID : return FloatTy;
- case DoubleTyID : return DoubleTy;
- case X86_FP80TyID : return X86_FP80Ty;
- case FP128TyID : return FP128Ty;
- case PPC_FP128TyID : return PPC_FP128Ty;
- case LabelTyID : return LabelTy;
- default:
- return 0;
- }
-}
-
-const Type *Type::getVAArgsPromotedType() const {
- if (ID == IntegerTyID && getSubclassData() < 32)
- return Type::Int32Ty;
- else if (ID == FloatTyID)
- return Type::DoubleTy;
- else
- return this;
-}
-
-/// isIntOrIntVector - Return true if this is an integer type or a vector of
-/// integer types.
-///
-bool Type::isIntOrIntVector() const {
- if (isInteger())
- return true;
- if (ID != Type::VectorTyID) return false;
-
- return cast<VectorType>(this)->getElementType()->isInteger();
-}
-
-/// isFPOrFPVector - Return true if this is a FP type or a vector of FP types.
-///
-bool Type::isFPOrFPVector() const {
- if (ID == Type::FloatTyID || ID == Type::DoubleTyID ||
- ID == Type::FP128TyID || ID == Type::X86_FP80TyID ||
- ID == Type::PPC_FP128TyID)
- return true;
- if (ID != Type::VectorTyID) return false;
-
- return cast<VectorType>(this)->getElementType()->isFloatingPoint();
-}
-
-// canLosslesllyBitCastTo - Return true if this type can be converted to
-// 'Ty' without any reinterpretation of bits. For example, uint to int.
-//
-bool Type::canLosslesslyBitCastTo(const Type *Ty) const {
- // Identity cast means no change so return true
- if (this == Ty)
- return true;
-
- // They are not convertible unless they are at least first class types
- if (!this->isFirstClassType() || !Ty->isFirstClassType())
- return false;
-
- // Vector -> Vector conversions are always lossless if the two vector types
- // have the same size, otherwise not.
- if (const VectorType *thisPTy = dyn_cast<VectorType>(this))
- if (const VectorType *thatPTy = dyn_cast<VectorType>(Ty))
- return thisPTy->getBitWidth() == thatPTy->getBitWidth();
-
- // At this point we have only various mismatches of the first class types
- // remaining and ptr->ptr. Just select the lossless conversions. Everything
- // else is not lossless.
- if (isa<PointerType>(this))
- return isa<PointerType>(Ty);
- return false; // Other types have no identity values
-}
-
-unsigned Type::getPrimitiveSizeInBits() const {
- switch (getTypeID()) {
- case Type::FloatTyID: return 32;
- case Type::DoubleTyID: return 64;
- case Type::X86_FP80TyID: return 80;
- case Type::FP128TyID: return 128;
- case Type::PPC_FP128TyID: return 128;
- case Type::IntegerTyID: return cast<IntegerType>(this)->getBitWidth();
- case Type::VectorTyID: return cast<VectorType>(this)->getBitWidth();
- default: return 0;
- }
-}
-
-/// isSizedDerivedType - Derived types like structures and arrays are sized
-/// iff all of the members of the type are sized as well. Since asking for
-/// their size is relatively uncommon, move this operation out of line.
-bool Type::isSizedDerivedType() const {
- if (isa<IntegerType>(this))
- return true;
-
- if (const ArrayType *ATy = dyn_cast<ArrayType>(this))
- return ATy->getElementType()->isSized();
-
- if (const VectorType *PTy = dyn_cast<VectorType>(this))
- return PTy->getElementType()->isSized();
-
- if (!isa<StructType>(this))
- return false;
-
- // Okay, our struct is sized if all of the elements are...
- for (subtype_iterator I = subtype_begin(), E = subtype_end(); I != E; ++I)
- if (!(*I)->isSized())
- return false;
-
- return true;
-}
-
-/// getForwardedTypeInternal - This method is used to implement the union-find
-/// algorithm for when a type is being forwarded to another type.
-const Type *Type::getForwardedTypeInternal() const {
- assert(ForwardType && "This type is not being forwarded to another type!");
-
- // Check to see if the forwarded type has been forwarded on. If so, collapse
- // the forwarding links.
- const Type *RealForwardedType = ForwardType->getForwardedType();
- if (!RealForwardedType)
- return ForwardType; // No it's not forwarded again
-
- // Yes, it is forwarded again. First thing, add the reference to the new
- // forward type.
- if (RealForwardedType->isAbstract())
- cast<DerivedType>(RealForwardedType)->addRef();
-
- // Now drop the old reference. This could cause ForwardType to get deleted.
- cast<DerivedType>(ForwardType)->dropRef();
-
- // Return the updated type.
- ForwardType = RealForwardedType;
- return ForwardType;
-}
-
-void Type::refineAbstractType(const DerivedType *OldTy, const Type *NewTy) {
- abort();
-}
-void Type::typeBecameConcrete(const DerivedType *AbsTy) {
- abort();
-}
-
-
-// getTypeDescription - This is a recursive function that walks a type hierarchy
-// calculating the description for a type.
-//
-static std::string getTypeDescription(const Type *Ty,
- std::vector<const Type *> &TypeStack) {
- if (isa<OpaqueType>(Ty)) { // Base case for the recursion
- std::map<const Type*, std::string>::iterator I =
- AbstractTypeDescriptions->lower_bound(Ty);
- if (I != AbstractTypeDescriptions->end() && I->first == Ty)
- return I->second;
- std::string Desc = "opaque";
- AbstractTypeDescriptions->insert(std::make_pair(Ty, Desc));
- return Desc;
- }
-
- if (!Ty->isAbstract()) { // Base case for the recursion
- std::map<const Type*, std::string>::iterator I =
- ConcreteTypeDescriptions->find(Ty);
- if (I != ConcreteTypeDescriptions->end())
- return I->second;
-
- if (Ty->isPrimitiveType()) {
- switch (Ty->getTypeID()) {
- default: assert(0 && "Unknown prim type!");
- case Type::VoidTyID: return (*ConcreteTypeDescriptions)[Ty] = "void";
- case Type::FloatTyID: return (*ConcreteTypeDescriptions)[Ty] = "float";
- case Type::DoubleTyID: return (*ConcreteTypeDescriptions)[Ty] = "double";
- case Type::X86_FP80TyID:
- return (*ConcreteTypeDescriptions)[Ty] = "x86_fp80";
- case Type::FP128TyID: return (*ConcreteTypeDescriptions)[Ty] = "fp128";
- case Type::PPC_FP128TyID:
- return (*ConcreteTypeDescriptions)[Ty] = "ppc_fp128";
- case Type::LabelTyID: return (*ConcreteTypeDescriptions)[Ty] = "label";
- }
- }
- }
-
- // Check to see if the Type is already on the stack...
- unsigned Slot = 0, CurSize = TypeStack.size();
- while (Slot < CurSize && TypeStack[Slot] != Ty) ++Slot; // Scan for type
-
- // This is another base case for the recursion. In this case, we know
- // that we have looped back to a type that we have previously visited.
- // Generate the appropriate upreference to handle this.
- //
- if (Slot < CurSize)
- return "\\" + utostr(CurSize-Slot); // Here's the upreference
-
- // Recursive case: derived types...
- std::string Result;
- TypeStack.push_back(Ty); // Add us to the stack..
-
- switch (Ty->getTypeID()) {
- case Type::IntegerTyID: {
- const IntegerType *ITy = cast<IntegerType>(Ty);
- Result = "i" + utostr(ITy->getBitWidth());
- break;
- }
- case Type::FunctionTyID: {
- const FunctionType *FTy = cast<FunctionType>(Ty);
- if (!Result.empty())
- Result += " ";
- Result += getTypeDescription(FTy->getReturnType(), TypeStack) + " (";
- for (FunctionType::param_iterator I = FTy->param_begin(),
- E = FTy->param_end(); I != E; ++I) {
- if (I != FTy->param_begin())
- Result += ", ";
- Result += getTypeDescription(*I, TypeStack);
- }
- if (FTy->isVarArg()) {
- if (FTy->getNumParams()) Result += ", ";
- Result += "...";
- }
- Result += ")";
- break;
- }
- case Type::StructTyID: {
- const StructType *STy = cast<StructType>(Ty);
- if (STy->isPacked())
- Result = "<{ ";
- else
- Result = "{ ";
- for (StructType::element_iterator I = STy->element_begin(),
- E = STy->element_end(); I != E; ++I) {
- if (I != STy->element_begin())
- Result += ", ";
- Result += getTypeDescription(*I, TypeStack);
- }
- Result += " }";
- if (STy->isPacked())
- Result += ">";
- break;
- }
- case Type::PointerTyID: {
- const PointerType *PTy = cast<PointerType>(Ty);
- Result = getTypeDescription(PTy->getElementType(), TypeStack);
- if (unsigned AddressSpace = PTy->getAddressSpace())
- Result += " addrspace(" + utostr(AddressSpace) + ")";
- Result += " *";
- break;
- }
- case Type::ArrayTyID: {
- const ArrayType *ATy = cast<ArrayType>(Ty);
- unsigned NumElements = ATy->getNumElements();
- Result = "[";
- Result += utostr(NumElements) + " x ";
- Result += getTypeDescription(ATy->getElementType(), TypeStack) + "]";
- break;
- }
- case Type::VectorTyID: {
- const VectorType *PTy = cast<VectorType>(Ty);
- unsigned NumElements = PTy->getNumElements();
- Result = "<";
- Result += utostr(NumElements) + " x ";
- Result += getTypeDescription(PTy->getElementType(), TypeStack) + ">";
- break;
- }
- default:
- Result = "<error>";
- assert(0 && "Unhandled type in getTypeDescription!");
- }
-
- TypeStack.pop_back(); // Remove self from stack...
-
- return Result;
-}
-
-
-
-static const std::string &getOrCreateDesc(std::map<const Type*,std::string>&Map,
- const Type *Ty) {
- std::map<const Type*, std::string>::iterator I = Map.find(Ty);
- if (I != Map.end()) return I->second;
-
- std::vector<const Type *> TypeStack;
- std::string Result = getTypeDescription(Ty, TypeStack);
- return Map[Ty] = Result;
-}
-
-
-const std::string &Type::getDescription() const {
- if (isAbstract())
- return getOrCreateDesc(*AbstractTypeDescriptions, this);
- else
- return getOrCreateDesc(*ConcreteTypeDescriptions, this);
-}
-
-
-bool StructType::indexValid(const Value *V) const {
- // Structure indexes require 32-bit integer constants.
- if (V->getType() == Type::Int32Ty)
- if (const ConstantInt *CU = dyn_cast<ConstantInt>(V))
- return CU->getZExtValue() < NumContainedTys;
- return false;
-}
-
-// getTypeAtIndex - Given an index value into the type, return the type of the
-// element. For a structure type, this must be a constant value...
-//
-const Type *StructType::getTypeAtIndex(const Value *V) const {
- assert(indexValid(V) && "Invalid structure index!");
- unsigned Idx = (unsigned)cast<ConstantInt>(V)->getZExtValue();
- return ContainedTys[Idx];
-}
-
-//===----------------------------------------------------------------------===//
-// Primitive 'Type' data
-//===----------------------------------------------------------------------===//
-
-const Type *Type::VoidTy = new Type(Type::VoidTyID);
-const Type *Type::FloatTy = new Type(Type::FloatTyID);
-const Type *Type::DoubleTy = new Type(Type::DoubleTyID);
-const Type *Type::X86_FP80Ty = new Type(Type::X86_FP80TyID);
-const Type *Type::FP128Ty = new Type(Type::FP128TyID);
-const Type *Type::PPC_FP128Ty = new Type(Type::PPC_FP128TyID);
-const Type *Type::LabelTy = new Type(Type::LabelTyID);
-
-namespace {
- struct BuiltinIntegerType : public IntegerType {
- BuiltinIntegerType(unsigned W) : IntegerType(W) {}
- };
-}
-const IntegerType *Type::Int1Ty = new BuiltinIntegerType(1);
-const IntegerType *Type::Int8Ty = new BuiltinIntegerType(8);
-const IntegerType *Type::Int16Ty = new BuiltinIntegerType(16);
-const IntegerType *Type::Int32Ty = new BuiltinIntegerType(32);
-const IntegerType *Type::Int64Ty = new BuiltinIntegerType(64);
-
-
-//===----------------------------------------------------------------------===//
-// Derived Type Constructors
-//===----------------------------------------------------------------------===//
-
-/// isValidReturnType - Return true if the specified type is valid as a return
-/// type.
-bool FunctionType::isValidReturnType(const Type *RetTy) {
- if (RetTy->isFirstClassType())
- return true;
- if (RetTy == Type::VoidTy || isa<OpaqueType>(RetTy))
- return true;
-
- // If this is a multiple return case, verify that each return is a first class
- // value and that there is at least one value.
- const StructType *SRetTy = dyn_cast<StructType>(RetTy);
- if (SRetTy == 0 || SRetTy->getNumElements() == 0)
- return false;
-
- for (unsigned i = 0, e = SRetTy->getNumElements(); i != e; ++i)
- if (!SRetTy->getElementType(i)->isFirstClassType())
- return false;
- return true;
-}
-
-FunctionType::FunctionType(const Type *Result,
- const std::vector<const Type*> &Params,
- bool IsVarArgs)
- : DerivedType(FunctionTyID), isVarArgs(IsVarArgs) {
- ContainedTys = reinterpret_cast<PATypeHandle*>(this+1);
- NumContainedTys = Params.size() + 1; // + 1 for result type
- assert(isValidReturnType(Result) && "invalid return type for function");
-
-
- bool isAbstract = Result->isAbstract();
- new (&ContainedTys[0]) PATypeHandle(Result, this);
-
- for (unsigned i = 0; i != Params.size(); ++i) {
- assert((Params[i]->isFirstClassType() || isa<OpaqueType>(Params[i])) &&
- "Function arguments must be value types!");
- new (&ContainedTys[i+1]) PATypeHandle(Params[i],this);
- isAbstract |= Params[i]->isAbstract();
- }
-
- // Calculate whether or not this type is abstract
- setAbstract(isAbstract);
-}
-
-StructType::StructType(const std::vector<const Type*> &Types, bool isPacked)
- : CompositeType(StructTyID) {
- ContainedTys = reinterpret_cast<PATypeHandle*>(this + 1);
- NumContainedTys = Types.size();
- setSubclassData(isPacked);
- bool isAbstract = false;
- for (unsigned i = 0; i < Types.size(); ++i) {
- assert(Types[i] != Type::VoidTy && "Void type for structure field!!");
- new (&ContainedTys[i]) PATypeHandle(Types[i], this);
- isAbstract |= Types[i]->isAbstract();
- }
-
- // Calculate whether or not this type is abstract
- setAbstract(isAbstract);
-}
-
-ArrayType::ArrayType(const Type *ElType, uint64_t NumEl)
- : SequentialType(ArrayTyID, ElType) {
- NumElements = NumEl;
-
- // Calculate whether or not this type is abstract
- setAbstract(ElType->isAbstract());
-}
-
-VectorType::VectorType(const Type *ElType, unsigned NumEl)
- : SequentialType(VectorTyID, ElType) {
- NumElements = NumEl;
- setAbstract(ElType->isAbstract());
- assert(NumEl > 0 && "NumEl of a VectorType must be greater than 0");
- assert((ElType->isInteger() || ElType->isFloatingPoint() ||
- isa<OpaqueType>(ElType)) &&
- "Elements of a VectorType must be a primitive type");
-
-}
-
-
-PointerType::PointerType(const Type *E, unsigned AddrSpace)
- : SequentialType(PointerTyID, E) {
- AddressSpace = AddrSpace;
- // Calculate whether or not this type is abstract
- setAbstract(E->isAbstract());
-}
-
-OpaqueType::OpaqueType() : DerivedType(OpaqueTyID) {
- setAbstract(true);
-#ifdef DEBUG_MERGE_TYPES
- DOUT << "Derived new type: " << *this << "\n";
-#endif
-}
-
-// dropAllTypeUses - When this (abstract) type is resolved to be equal to
-// another (more concrete) type, we must eliminate all references to other
-// types, to avoid some circular reference problems.
-void DerivedType::dropAllTypeUses() {
- if (NumContainedTys != 0) {
- // The type must stay abstract. To do this, we insert a pointer to a type
- // that will never get resolved, thus will always be abstract.
- static Type *AlwaysOpaqueTy = OpaqueType::get();
- static PATypeHolder Holder(AlwaysOpaqueTy);
- ContainedTys[0] = AlwaysOpaqueTy;
-
- // Change the rest of the types to be Int32Ty's. It doesn't matter what we
- // pick so long as it doesn't point back to this type. We choose something
- // concrete to avoid overhead for adding to AbstracTypeUser lists and stuff.
- for (unsigned i = 1, e = NumContainedTys; i != e; ++i)
- ContainedTys[i] = Type::Int32Ty;
- }
-}
-
-
-
-/// TypePromotionGraph and graph traits - this is designed to allow us to do
-/// efficient SCC processing of type graphs. This is the exact same as
-/// GraphTraits<Type*>, except that we pretend that concrete types have no
-/// children to avoid processing them.
-struct TypePromotionGraph {
- Type *Ty;
- TypePromotionGraph(Type *T) : Ty(T) {}
-};
-
-namespace llvm {
- template <> struct GraphTraits<TypePromotionGraph> {
- typedef Type NodeType;
- typedef Type::subtype_iterator ChildIteratorType;
-
- static inline NodeType *getEntryNode(TypePromotionGraph G) { return G.Ty; }
- static inline ChildIteratorType child_begin(NodeType *N) {
- if (N->isAbstract())
- return N->subtype_begin();
- else // No need to process children of concrete types.
- return N->subtype_end();
- }
- static inline ChildIteratorType child_end(NodeType *N) {
- return N->subtype_end();
- }
- };
-}
-
-
-// PromoteAbstractToConcrete - This is a recursive function that walks a type
-// graph calculating whether or not a type is abstract.
-//
-void Type::PromoteAbstractToConcrete() {
- if (!isAbstract()) return;
-
- scc_iterator<TypePromotionGraph> SI = scc_begin(TypePromotionGraph(this));
- scc_iterator<TypePromotionGraph> SE = scc_end (TypePromotionGraph(this));
-
- for (; SI != SE; ++SI) {
- std::vector<Type*> &SCC = *SI;
-
- // Concrete types are leaves in the tree. Since an SCC will either be all
- // abstract or all concrete, we only need to check one type.
- if (SCC[0]->isAbstract()) {
- if (isa<OpaqueType>(SCC[0]))
- return; // Not going to be concrete, sorry.
-
- // If all of the children of all of the types in this SCC are concrete,
- // then this SCC is now concrete as well. If not, neither this SCC, nor
- // any parent SCCs will be concrete, so we might as well just exit.
- for (unsigned i = 0, e = SCC.size(); i != e; ++i)
- for (Type::subtype_iterator CI = SCC[i]->subtype_begin(),
- E = SCC[i]->subtype_end(); CI != E; ++CI)
- if ((*CI)->isAbstract())
- // If the child type is in our SCC, it doesn't make the entire SCC
- // abstract unless there is a non-SCC abstract type.
- if (std::find(SCC.begin(), SCC.end(), *CI) == SCC.end())
- return; // Not going to be concrete, sorry.
-
- // Okay, we just discovered this whole SCC is now concrete, mark it as
- // such!
- for (unsigned i = 0, e = SCC.size(); i != e; ++i) {
- assert(SCC[i]->isAbstract() && "Why are we processing concrete types?");
-
- SCC[i]->setAbstract(false);
- }
-
- for (unsigned i = 0, e = SCC.size(); i != e; ++i) {
- assert(!SCC[i]->isAbstract() && "Concrete type became abstract?");
- // The type just became concrete, notify all users!
- cast<DerivedType>(SCC[i])->notifyUsesThatTypeBecameConcrete();
- }
- }
- }
-}
-
-
-//===----------------------------------------------------------------------===//
-// Type Structural Equality Testing
-//===----------------------------------------------------------------------===//
-
-// TypesEqual - Two types are considered structurally equal if they have the
-// same "shape": Every level and element of the types have identical primitive
-// ID's, and the graphs have the same edges/nodes in them. Nodes do not have to
-// be pointer equals to be equivalent though. This uses an optimistic algorithm
-// that assumes that two graphs are the same until proven otherwise.
-//
-static bool TypesEqual(const Type *Ty, const Type *Ty2,
- std::map<const Type *, const Type *> &EqTypes) {
- if (Ty == Ty2) return true;
- if (Ty->getTypeID() != Ty2->getTypeID()) return false;
- if (isa<OpaqueType>(Ty))
- return false; // Two unequal opaque types are never equal
-
- std::map<const Type*, const Type*>::iterator It = EqTypes.lower_bound(Ty);
- if (It != EqTypes.end() && It->first == Ty)
- return It->second == Ty2; // Looping back on a type, check for equality
-
- // Otherwise, add the mapping to the table to make sure we don't get
- // recursion on the types...
- EqTypes.insert(It, std::make_pair(Ty, Ty2));
-
- // Two really annoying special cases that breaks an otherwise nice simple
- // algorithm is the fact that arraytypes have sizes that differentiates types,
- // and that function types can be varargs or not. Consider this now.
- //
- if (const IntegerType *ITy = dyn_cast<IntegerType>(Ty)) {
- const IntegerType *ITy2 = cast<IntegerType>(Ty2);
- return ITy->getBitWidth() == ITy2->getBitWidth();
- } else if (const PointerType *PTy = dyn_cast<PointerType>(Ty)) {
- const PointerType *PTy2 = cast<PointerType>(Ty2);
- return PTy->getAddressSpace() == PTy2->getAddressSpace() &&
- TypesEqual(PTy->getElementType(), PTy2->getElementType(), EqTypes);
- } else if (const StructType *STy = dyn_cast<StructType>(Ty)) {
- const StructType *STy2 = cast<StructType>(Ty2);
- if (STy->getNumElements() != STy2->getNumElements()) return false;
- if (STy->isPacked() != STy2->isPacked()) return false;
- for (unsigned i = 0, e = STy2->getNumElements(); i != e; ++i)
- if (!TypesEqual(STy->getElementType(i), STy2->getElementType(i), EqTypes))
- return false;
- return true;
- } else if (const ArrayType *ATy = dyn_cast<ArrayType>(Ty)) {
- const ArrayType *ATy2 = cast<ArrayType>(Ty2);
- return ATy->getNumElements() == ATy2->getNumElements() &&
- TypesEqual(ATy->getElementType(), ATy2->getElementType(), EqTypes);
- } else if (const VectorType *PTy = dyn_cast<VectorType>(Ty)) {
- const VectorType *PTy2 = cast<VectorType>(Ty2);
- return PTy->getNumElements() == PTy2->getNumElements() &&
- TypesEqual(PTy->getElementType(), PTy2->getElementType(), EqTypes);
- } else if (const FunctionType *FTy = dyn_cast<FunctionType>(Ty)) {
- const FunctionType *FTy2 = cast<FunctionType>(Ty2);
- if (FTy->isVarArg() != FTy2->isVarArg() ||
- FTy->getNumParams() != FTy2->getNumParams() ||
- !TypesEqual(FTy->getReturnType(), FTy2->getReturnType(), EqTypes))
- return false;
- for (unsigned i = 0, e = FTy2->getNumParams(); i != e; ++i) {
- if (!TypesEqual(FTy->getParamType(i), FTy2->getParamType(i), EqTypes))
- return false;
- }
- return true;
- } else {
- assert(0 && "Unknown derived type!");
- return false;
- }
-}
-
-static bool TypesEqual(const Type *Ty, const Type *Ty2) {
- std::map<const Type *, const Type *> EqTypes;
- return TypesEqual(Ty, Ty2, EqTypes);
-}
-
-// AbstractTypeHasCycleThrough - Return true there is a path from CurTy to
-// TargetTy in the type graph. We know that Ty is an abstract type, so if we
-// ever reach a non-abstract type, we know that we don't need to search the
-// subgraph.
-static bool AbstractTypeHasCycleThrough(const Type *TargetTy, const Type *CurTy,
- std::set<const Type*> &VisitedTypes) {
- if (TargetTy == CurTy) return true;
- if (!CurTy->isAbstract()) return false;
-
- if (!VisitedTypes.insert(CurTy).second)
- return false; // Already been here.
-
- for (Type::subtype_iterator I = CurTy->subtype_begin(),
- E = CurTy->subtype_end(); I != E; ++I)
- if (AbstractTypeHasCycleThrough(TargetTy, *I, VisitedTypes))
- return true;
- return false;
-}
-
-static bool ConcreteTypeHasCycleThrough(const Type *TargetTy, const Type *CurTy,
- std::set<const Type*> &VisitedTypes) {
- if (TargetTy == CurTy) return true;
-
- if (!VisitedTypes.insert(CurTy).second)
- return false; // Already been here.
-
- for (Type::subtype_iterator I = CurTy->subtype_begin(),
- E = CurTy->subtype_end(); I != E; ++I)
- if (ConcreteTypeHasCycleThrough(TargetTy, *I, VisitedTypes))
- return true;
- return false;
-}
-
-/// TypeHasCycleThroughItself - Return true if the specified type has a cycle
-/// back to itself.
-static bool TypeHasCycleThroughItself(const Type *Ty) {
- std::set<const Type*> VisitedTypes;
-
- if (Ty->isAbstract()) { // Optimized case for abstract types.
- for (Type::subtype_iterator I = Ty->subtype_begin(), E = Ty->subtype_end();
- I != E; ++I)
- if (AbstractTypeHasCycleThrough(Ty, *I, VisitedTypes))
- return true;
- } else {
- for (Type::subtype_iterator I = Ty->subtype_begin(), E = Ty->subtype_end();
- I != E; ++I)
- if (ConcreteTypeHasCycleThrough(Ty, *I, VisitedTypes))
- return true;
- }
- return false;
-}
-
-/// getSubElementHash - Generate a hash value for all of the SubType's of this
-/// type. The hash value is guaranteed to be zero if any of the subtypes are
-/// an opaque type. Otherwise we try to mix them in as well as possible, but do
-/// not look at the subtype's subtype's.
-static unsigned getSubElementHash(const Type *Ty) {
- unsigned HashVal = 0;
- for (Type::subtype_iterator I = Ty->subtype_begin(), E = Ty->subtype_end();
- I != E; ++I) {
- HashVal *= 32;
- const Type *SubTy = I->get();
- HashVal += SubTy->getTypeID();
- switch (SubTy->getTypeID()) {
- default: break;
- case Type::OpaqueTyID: return 0; // Opaque -> hash = 0 no matter what.
- case Type::IntegerTyID:
- HashVal ^= (cast<IntegerType>(SubTy)->getBitWidth() << 3);
- break;
- case Type::FunctionTyID:
- HashVal ^= cast<FunctionType>(SubTy)->getNumParams()*2 +
- cast<FunctionType>(SubTy)->isVarArg();
- break;
- case Type::ArrayTyID:
- HashVal ^= cast<ArrayType>(SubTy)->getNumElements();
- break;
- case Type::VectorTyID:
- HashVal ^= cast<VectorType>(SubTy)->getNumElements();
- break;
- case Type::StructTyID:
- HashVal ^= cast<StructType>(SubTy)->getNumElements();
- break;
- case Type::PointerTyID:
- HashVal ^= cast<PointerType>(SubTy)->getAddressSpace();
- break;
- }
- }
- return HashVal ? HashVal : 1; // Do not return zero unless opaque subty.
-}
-
-//===----------------------------------------------------------------------===//
-// Derived Type Factory Functions
-//===----------------------------------------------------------------------===//
-
-namespace llvm {
-class TypeMapBase {
-protected:
- /// TypesByHash - Keep track of types by their structure hash value. Note
- /// that we only keep track of types that have cycles through themselves in
- /// this map.
- ///
- std::multimap<unsigned, PATypeHolder> TypesByHash;
-
-public:
- void RemoveFromTypesByHash(unsigned Hash, const Type *Ty) {
- std::multimap<unsigned, PATypeHolder>::iterator I =
- TypesByHash.lower_bound(Hash);
- for (; I != TypesByHash.end() && I->first == Hash; ++I) {
- if (I->second == Ty) {
- TypesByHash.erase(I);
- return;
- }
- }
-
- // This must be do to an opaque type that was resolved. Switch down to hash
- // code of zero.
- assert(Hash && "Didn't find type entry!");
- RemoveFromTypesByHash(0, Ty);
- }
-
- /// TypeBecameConcrete - When Ty gets a notification that TheType just became
- /// concrete, drop uses and make Ty non-abstract if we should.
- void TypeBecameConcrete(DerivedType *Ty, const DerivedType *TheType) {
- // If the element just became concrete, remove 'ty' from the abstract
- // type user list for the type. Do this for as many times as Ty uses
- // OldType.
- for (Type::subtype_iterator I = Ty->subtype_begin(), E = Ty->subtype_end();
- I != E; ++I)
- if (I->get() == TheType)
- TheType->removeAbstractTypeUser(Ty);
-
- // If the type is currently thought to be abstract, rescan all of our
- // subtypes to see if the type has just become concrete! Note that this
- // may send out notifications to AbstractTypeUsers that types become
- // concrete.
- if (Ty->isAbstract())
- Ty->PromoteAbstractToConcrete();
- }
-};
-}
-
-
-// TypeMap - Make sure that only one instance of a particular type may be
-// created on any given run of the compiler... note that this involves updating
-// our map if an abstract type gets refined somehow.
-//
-namespace llvm {
-template<class ValType, class TypeClass>
-class TypeMap : public TypeMapBase {
- std::map<ValType, PATypeHolder> Map;
-public:
- typedef typename std::map<ValType, PATypeHolder>::iterator iterator;
- ~TypeMap() { print("ON EXIT"); }
-
- inline TypeClass *get(const ValType &V) {
- iterator I = Map.find(V);
- return I != Map.end() ? cast<TypeClass>((Type*)I->second.get()) : 0;
- }
-
- inline void add(const ValType &V, TypeClass *Ty) {
- Map.insert(std::make_pair(V, Ty));
-
- // If this type has a cycle, remember it.
- TypesByHash.insert(std::make_pair(ValType::hashTypeStructure(Ty), Ty));
- print("add");
- }
-
- /// RefineAbstractType - This method is called after we have merged a type
- /// with another one. We must now either merge the type away with
- /// some other type or reinstall it in the map with it's new configuration.
- void RefineAbstractType(TypeClass *Ty, const DerivedType *OldType,
- const Type *NewType) {
-#ifdef DEBUG_MERGE_TYPES
- DOUT << "RefineAbstractType(" << (void*)OldType << "[" << *OldType
- << "], " << (void*)NewType << " [" << *NewType << "])\n";
-#endif
-
- // Otherwise, we are changing one subelement type into another. Clearly the
- // OldType must have been abstract, making us abstract.
- assert(Ty->isAbstract() && "Refining a non-abstract type!");
- assert(OldType != NewType);
-
- // Make a temporary type holder for the type so that it doesn't disappear on
- // us when we erase the entry from the map.
- PATypeHolder TyHolder = Ty;
-
- // The old record is now out-of-date, because one of the children has been
- // updated. Remove the obsolete entry from the map.
- unsigned NumErased = Map.erase(ValType::get(Ty));
- assert(NumErased && "Element not found!");
-
- // Remember the structural hash for the type before we start hacking on it,
- // in case we need it later.
- unsigned OldTypeHash = ValType::hashTypeStructure(Ty);
-
- // Find the type element we are refining... and change it now!
- for (unsigned i = 0, e = Ty->getNumContainedTypes(); i != e; ++i)
- if (Ty->ContainedTys[i] == OldType)
- Ty->ContainedTys[i] = NewType;
- unsigned NewTypeHash = ValType::hashTypeStructure(Ty);
-
- // If there are no cycles going through this node, we can do a simple,
- // efficient lookup in the map, instead of an inefficient nasty linear
- // lookup.
- if (!TypeHasCycleThroughItself(Ty)) {
- typename std::map<ValType, PATypeHolder>::iterator I;
- bool Inserted;
-
- tie(I, Inserted) = Map.insert(std::make_pair(ValType::get(Ty), Ty));
- if (!Inserted) {
- // Refined to a different type altogether?
- RemoveFromTypesByHash(OldTypeHash, Ty);
-
- // We already have this type in the table. Get rid of the newly refined
- // type.
- TypeClass *NewTy = cast<TypeClass>((Type*)I->second.get());
- Ty->refineAbstractTypeTo(NewTy);
- return;
- }
- } else {
- // Now we check to see if there is an existing entry in the table which is
- // structurally identical to the newly refined type. If so, this type
- // gets refined to the pre-existing type.
- //
- std::multimap<unsigned, PATypeHolder>::iterator I, E, Entry;
- tie(I, E) = TypesByHash.equal_range(NewTypeHash);
- Entry = E;
- for (; I != E; ++I) {
- if (I->second == Ty) {
- // Remember the position of the old type if we see it in our scan.
- Entry = I;
- } else {
- if (TypesEqual(Ty, I->second)) {
- TypeClass *NewTy = cast<TypeClass>((Type*)I->second.get());
-
- // Remove the old entry form TypesByHash. If the hash values differ
- // now, remove it from the old place. Otherwise, continue scanning
- // withing this hashcode to reduce work.
- if (NewTypeHash != OldTypeHash) {
- RemoveFromTypesByHash(OldTypeHash, Ty);
- } else {
- if (Entry == E) {
- // Find the location of Ty in the TypesByHash structure if we
- // haven't seen it already.
- while (I->second != Ty) {
- ++I;
- assert(I != E && "Structure doesn't contain type??");
- }
- Entry = I;
- }
- TypesByHash.erase(Entry);
- }
- Ty->refineAbstractTypeTo(NewTy);
- return;
- }
- }
- }
-
- // If there is no existing type of the same structure, we reinsert an
- // updated record into the map.
- Map.insert(std::make_pair(ValType::get(Ty), Ty));
- }
-
- // If the hash codes differ, update TypesByHash
- if (NewTypeHash != OldTypeHash) {
- RemoveFromTypesByHash(OldTypeHash, Ty);
- TypesByHash.insert(std::make_pair(NewTypeHash, Ty));
- }
-
- // If the type is currently thought to be abstract, rescan all of our
- // subtypes to see if the type has just become concrete! Note that this
- // may send out notifications to AbstractTypeUsers that types become
- // concrete.
- if (Ty->isAbstract())
- Ty->PromoteAbstractToConcrete();
- }
-
- void print(const char *Arg) const {
-#ifdef DEBUG_MERGE_TYPES
- DOUT << "TypeMap<>::" << Arg << " table contents:\n";
- unsigned i = 0;
- for (typename std::map<ValType, PATypeHolder>::const_iterator I
- = Map.begin(), E = Map.end(); I != E; ++I)
- DOUT << " " << (++i) << ". " << (void*)I->second.get() << " "
- << *I->second.get() << "\n";
-#endif
- }
-
- void dump() const { print("dump output"); }
-};
-}
-
-
-//===----------------------------------------------------------------------===//
-// Function Type Factory and Value Class...
-//
-
-//===----------------------------------------------------------------------===//
-// Integer Type Factory...
-//
-namespace llvm {
-class IntegerValType {
- uint32_t bits;
-public:
- IntegerValType(uint16_t numbits) : bits(numbits) {}
-
- static IntegerValType get(const IntegerType *Ty) {
- return IntegerValType(Ty->getBitWidth());
- }
-
- static unsigned hashTypeStructure(const IntegerType *Ty) {
- return (unsigned)Ty->getBitWidth();
- }
-
- inline bool operator<(const IntegerValType &IVT) const {
- return bits < IVT.bits;
- }
-};
-}
-
-static ManagedStatic<TypeMap<IntegerValType, IntegerType> > IntegerTypes;
-
-const IntegerType *IntegerType::get(unsigned NumBits) {
- assert(NumBits >= MIN_INT_BITS && "bitwidth too small");
- assert(NumBits <= MAX_INT_BITS && "bitwidth too large");
-
- // Check for the built-in integer types
- switch (NumBits) {
- case 1: return cast<IntegerType>(Type::Int1Ty);
- case 8: return cast<IntegerType>(Type::Int8Ty);
- case 16: return cast<IntegerType>(Type::Int16Ty);
- case 32: return cast<IntegerType>(Type::Int32Ty);
- case 64: return cast<IntegerType>(Type::Int64Ty);
- default:
- break;
- }
-
- IntegerValType IVT(NumBits);
- IntegerType *ITy = IntegerTypes->get(IVT);
- if (ITy) return ITy; // Found a match, return it!
-
- // Value not found. Derive a new type!
- ITy = new IntegerType(NumBits);
- IntegerTypes->add(IVT, ITy);
-
-#ifdef DEBUG_MERGE_TYPES
- DOUT << "Derived new type: " << *ITy << "\n";
-#endif
- return ITy;
-}
-
-bool IntegerType::isPowerOf2ByteWidth() const {
- unsigned BitWidth = getBitWidth();
- return (BitWidth > 7) && isPowerOf2_32(BitWidth);
-}
-
-APInt IntegerType::getMask() const {
- return APInt::getAllOnesValue(getBitWidth());
-}
-
-// FunctionValType - Define a class to hold the key that goes into the TypeMap
-//
-namespace llvm {
-class FunctionValType {
- const Type *RetTy;
- std::vector<const Type*> ArgTypes;
- bool isVarArg;
-public:
- FunctionValType(const Type *ret, const std::vector<const Type*> &args,
- bool isVA) : RetTy(ret), ArgTypes(args), isVarArg(isVA) {}
-
- static FunctionValType get(const FunctionType *FT);
-
- static unsigned hashTypeStructure(const FunctionType *FT) {
- unsigned Result = FT->getNumParams()*2 + FT->isVarArg();
- return Result;
- }
-
- inline bool operator<(const FunctionValType &MTV) const {
- if (RetTy < MTV.RetTy) return true;
- if (RetTy > MTV.RetTy) return false;
- if (isVarArg < MTV.isVarArg) return true;
- if (isVarArg > MTV.isVarArg) return false;
- if (ArgTypes < MTV.ArgTypes) return true;
- if (ArgTypes > MTV.ArgTypes) return false;
- return false;
- }
-};
-}
-
-// Define the actual map itself now...
-static ManagedStatic<TypeMap<FunctionValType, FunctionType> > FunctionTypes;
-
-FunctionValType FunctionValType::get(const FunctionType *FT) {
- // Build up a FunctionValType
- std::vector<const Type *> ParamTypes;
- ParamTypes.reserve(FT->getNumParams());
- for (unsigned i = 0, e = FT->getNumParams(); i != e; ++i)
- ParamTypes.push_back(FT->getParamType(i));
- return FunctionValType(FT->getReturnType(), ParamTypes, FT->isVarArg());
-}
-
-
-// FunctionType::get - The factory function for the FunctionType class...
-FunctionType *FunctionType::get(const Type *ReturnType,
- const std::vector<const Type*> &Params,
- bool isVarArg) {
- FunctionValType VT(ReturnType, Params, isVarArg);
- FunctionType *FT = FunctionTypes->get(VT);
- if (FT)
- return FT;
-
- FT = (FunctionType*) new char[sizeof(FunctionType) +
- sizeof(PATypeHandle)*(Params.size()+1)];
- new (FT) FunctionType(ReturnType, Params, isVarArg);
- FunctionTypes->add(VT, FT);
-
-#ifdef DEBUG_MERGE_TYPES
- DOUT << "Derived new type: " << FT << "\n";
-#endif
- return FT;
-}
-
-//===----------------------------------------------------------------------===//
-// Array Type Factory...
-//
-namespace llvm {
-class ArrayValType {
- const Type *ValTy;
- uint64_t Size;
-public:
- ArrayValType(const Type *val, uint64_t sz) : ValTy(val), Size(sz) {}
-
- static ArrayValType get(const ArrayType *AT) {
- return ArrayValType(AT->getElementType(), AT->getNumElements());
- }
-
- static unsigned hashTypeStructure(const ArrayType *AT) {
- return (unsigned)AT->getNumElements();
- }
-
- inline bool operator<(const ArrayValType &MTV) const {
- if (Size < MTV.Size) return true;
- return Size == MTV.Size && ValTy < MTV.ValTy;
- }
-};
-}
-static ManagedStatic<TypeMap<ArrayValType, ArrayType> > ArrayTypes;
-
-
-ArrayType *ArrayType::get(const Type *ElementType, uint64_t NumElements) {
- assert(ElementType && "Can't get array of null types!");
-
- ArrayValType AVT(ElementType, NumElements);
- ArrayType *AT = ArrayTypes->get(AVT);
- if (AT) return AT; // Found a match, return it!
-
- // Value not found. Derive a new type!
- ArrayTypes->add(AVT, AT = new ArrayType(ElementType, NumElements));
-
-#ifdef DEBUG_MERGE_TYPES
- DOUT << "Derived new type: " << *AT << "\n";
-#endif
- return AT;
-}
-
-
-//===----------------------------------------------------------------------===//
-// Vector Type Factory...
-//
-namespace llvm {
-class VectorValType {
- const Type *ValTy;
- unsigned Size;
-public:
- VectorValType(const Type *val, int sz) : ValTy(val), Size(sz) {}
-
- static VectorValType get(const VectorType *PT) {
- return VectorValType(PT->getElementType(), PT->getNumElements());
- }
-
- static unsigned hashTypeStructure(const VectorType *PT) {
- return PT->getNumElements();
- }
-
- inline bool operator<(const VectorValType &MTV) const {
- if (Size < MTV.Size) return true;
- return Size == MTV.Size && ValTy < MTV.ValTy;
- }
-};
-}
-static ManagedStatic<TypeMap<VectorValType, VectorType> > VectorTypes;
-
-
-VectorType *VectorType::get(const Type *ElementType, unsigned NumElements) {
- assert(ElementType && "Can't get vector of null types!");
-
- VectorValType PVT(ElementType, NumElements);
- VectorType *PT = VectorTypes->get(PVT);
- if (PT) return PT; // Found a match, return it!
-
- // Value not found. Derive a new type!
- VectorTypes->add(PVT, PT = new VectorType(ElementType, NumElements));
-
-#ifdef DEBUG_MERGE_TYPES
- DOUT << "Derived new type: " << *PT << "\n";
-#endif
- return PT;
-}
-
-//===----------------------------------------------------------------------===//
-// Struct Type Factory...
-//
-
-namespace llvm {
-// StructValType - Define a class to hold the key that goes into the TypeMap
-//
-class StructValType {
- std::vector<const Type*> ElTypes;
- bool packed;
-public:
- StructValType(const std::vector<const Type*> &args, bool isPacked)
- : ElTypes(args), packed(isPacked) {}
-
- static StructValType get(const StructType *ST) {
- std::vector<const Type *> ElTypes;
- ElTypes.reserve(ST->getNumElements());
- for (unsigned i = 0, e = ST->getNumElements(); i != e; ++i)
- ElTypes.push_back(ST->getElementType(i));
-
- return StructValType(ElTypes, ST->isPacked());
- }
-
- static unsigned hashTypeStructure(const StructType *ST) {
- return ST->getNumElements();
- }
-
- inline bool operator<(const StructValType &STV) const {
- if (ElTypes < STV.ElTypes) return true;
- else if (ElTypes > STV.ElTypes) return false;
- else return (int)packed < (int)STV.packed;
- }
-};
-}
-
-static ManagedStatic<TypeMap<StructValType, StructType> > StructTypes;
-
-StructType *StructType::get(const std::vector<const Type*> &ETypes,
- bool isPacked) {
- StructValType STV(ETypes, isPacked);
- StructType *ST = StructTypes->get(STV);
- if (ST) return ST;
-
- // Value not found. Derive a new type!
- ST = (StructType*) new char[sizeof(StructType) +
- sizeof(PATypeHandle) * ETypes.size()];
- new (ST) StructType(ETypes, isPacked);
- StructTypes->add(STV, ST);
-
-#ifdef DEBUG_MERGE_TYPES
- DOUT << "Derived new type: " << *ST << "\n";
-#endif
- return ST;
-}
-
-StructType *StructType::get(const Type *type, ...) {
- va_list ap;
- std::vector<const llvm::Type*> StructFields;
- va_start(ap, type);
- while (type) {
- StructFields.push_back(type);
- type = va_arg(ap, llvm::Type*);
- }
- return llvm::StructType::get(StructFields);
-}
-
-
-
-//===----------------------------------------------------------------------===//
-// Pointer Type Factory...
-//
-
-// PointerValType - Define a class to hold the key that goes into the TypeMap
-//
-namespace llvm {
-class PointerValType {
- const Type *ValTy;
- unsigned AddressSpace;
-public:
- PointerValType(const Type *val, unsigned as) : ValTy(val), AddressSpace(as) {}
-
- static PointerValType get(const PointerType *PT) {
- return PointerValType(PT->getElementType(), PT->getAddressSpace());
- }
-
- static unsigned hashTypeStructure(const PointerType *PT) {
- return getSubElementHash(PT);
- }
-
- bool operator<(const PointerValType &MTV) const {
- if (AddressSpace < MTV.AddressSpace) return true;
- return AddressSpace == MTV.AddressSpace && ValTy < MTV.ValTy;
- }
-};
-}
-
-static ManagedStatic<TypeMap<PointerValType, PointerType> > PointerTypes;
-
-PointerType *PointerType::get(const Type *ValueType, unsigned AddressSpace) {
- assert(ValueType && "Can't get a pointer to <null> type!");
- assert(ValueType != Type::VoidTy &&
- "Pointer to void is not valid, use sbyte* instead!");
- assert(ValueType != Type::LabelTy && "Pointer to label is not valid!");
- PointerValType PVT(ValueType, AddressSpace);
-
- PointerType *PT = PointerTypes->get(PVT);
- if (PT) return PT;
-
- // Value not found. Derive a new type!
- PointerTypes->add(PVT, PT = new PointerType(ValueType, AddressSpace));
-
-#ifdef DEBUG_MERGE_TYPES
- DOUT << "Derived new type: " << *PT << "\n";
-#endif
- return PT;
-}
-
-//===----------------------------------------------------------------------===//
-// Derived Type Refinement Functions
-//===----------------------------------------------------------------------===//
-
-// removeAbstractTypeUser - Notify an abstract type that a user of the class
-// no longer has a handle to the type. This function is called primarily by
-// the PATypeHandle class. When there are no users of the abstract type, it
-// is annihilated, because there is no way to get a reference to it ever again.
-//
-void Type::removeAbstractTypeUser(AbstractTypeUser *U) const {
- // Search from back to front because we will notify users from back to
- // front. Also, it is likely that there will be a stack like behavior to
- // users that register and unregister users.
- //
- unsigned i;
- for (i = AbstractTypeUsers.size(); AbstractTypeUsers[i-1] != U; --i)
- assert(i != 0 && "AbstractTypeUser not in user list!");
-
- --i; // Convert to be in range 0 <= i < size()
- assert(i < AbstractTypeUsers.size() && "Index out of range!"); // Wraparound?
-
- AbstractTypeUsers.erase(AbstractTypeUsers.begin()+i);
-
-#ifdef DEBUG_MERGE_TYPES
- DOUT << " remAbstractTypeUser[" << (void*)this << ", "
- << *this << "][" << i << "] User = " << U << "\n";
-#endif
-
- if (AbstractTypeUsers.empty() && getRefCount() == 0 && isAbstract()) {
-#ifdef DEBUG_MERGE_TYPES
- DOUT << "DELETEing unused abstract type: <" << *this
- << ">[" << (void*)this << "]" << "\n";
-#endif
- this->destroy();
- }
-}
-
-// refineAbstractTypeTo - This function is used when it is discovered that
-// the 'this' abstract type is actually equivalent to the NewType specified.
-// This causes all users of 'this' to switch to reference the more concrete type
-// NewType and for 'this' to be deleted.
-//
-void DerivedType::refineAbstractTypeTo(const Type *NewType) {
- assert(isAbstract() && "refineAbstractTypeTo: Current type is not abstract!");
- assert(this != NewType && "Can't refine to myself!");
- assert(ForwardType == 0 && "This type has already been refined!");
-
- // The descriptions may be out of date. Conservatively clear them all!
- AbstractTypeDescriptions->clear();
-
-#ifdef DEBUG_MERGE_TYPES
- DOUT << "REFINING abstract type [" << (void*)this << " "
- << *this << "] to [" << (void*)NewType << " "
- << *NewType << "]!\n";
-#endif
-
- // Make sure to put the type to be refined to into a holder so that if IT gets
- // refined, that we will not continue using a dead reference...
- //
- PATypeHolder NewTy(NewType);
-
- // Any PATypeHolders referring to this type will now automatically forward to
- // the type we are resolved to.
- ForwardType = NewType;
- if (NewType->isAbstract())
- cast<DerivedType>(NewType)->addRef();
-
- // Add a self use of the current type so that we don't delete ourself until
- // after the function exits.
- //
- PATypeHolder CurrentTy(this);
-
- // To make the situation simpler, we ask the subclass to remove this type from
- // the type map, and to replace any type uses with uses of non-abstract types.
- // This dramatically limits the amount of recursive type trouble we can find
- // ourselves in.
- dropAllTypeUses();
-
- // Iterate over all of the uses of this type, invoking callback. Each user
- // should remove itself from our use list automatically. We have to check to
- // make sure that NewTy doesn't _become_ 'this'. If it does, resolving types
- // will not cause users to drop off of the use list. If we resolve to ourself
- // we succeed!
- //
- while (!AbstractTypeUsers.empty() && NewTy != this) {
- AbstractTypeUser *User = AbstractTypeUsers.back();
-
- unsigned OldSize = AbstractTypeUsers.size();
-#ifdef DEBUG_MERGE_TYPES
- DOUT << " REFINING user " << OldSize-1 << "[" << (void*)User
- << "] of abstract type [" << (void*)this << " "
- << *this << "] to [" << (void*)NewTy.get() << " "
- << *NewTy << "]!\n";
-#endif
- User->refineAbstractType(this, NewTy);
-
- assert(AbstractTypeUsers.size() != OldSize &&
- "AbsTyUser did not remove self from user list!");
- }
-
- // If we were successful removing all users from the type, 'this' will be
- // deleted when the last PATypeHolder is destroyed or updated from this type.
- // This may occur on exit of this function, as the CurrentTy object is
- // destroyed.
-}
-
-// notifyUsesThatTypeBecameConcrete - Notify AbstractTypeUsers of this type that
-// the current type has transitioned from being abstract to being concrete.
-//
-void DerivedType::notifyUsesThatTypeBecameConcrete() {
-#ifdef DEBUG_MERGE_TYPES
- DOUT << "typeIsREFINED type: " << (void*)this << " " << *this << "\n";
-#endif
-
- unsigned OldSize = AbstractTypeUsers.size();
- while (!AbstractTypeUsers.empty()) {
- AbstractTypeUser *ATU = AbstractTypeUsers.back();
- ATU->typeBecameConcrete(this);
-
- assert(AbstractTypeUsers.size() < OldSize-- &&
- "AbstractTypeUser did not remove itself from the use list!");
- }
-}
-
-// refineAbstractType - Called when a contained type is found to be more
-// concrete - this could potentially change us from an abstract type to a
-// concrete type.
-//
-void FunctionType::refineAbstractType(const DerivedType *OldType,
- const Type *NewType) {
- FunctionTypes->RefineAbstractType(this, OldType, NewType);
-}
-
-void FunctionType::typeBecameConcrete(const DerivedType *AbsTy) {
- FunctionTypes->TypeBecameConcrete(this, AbsTy);
-}
-
-
-// refineAbstractType - Called when a contained type is found to be more
-// concrete - this could potentially change us from an abstract type to a
-// concrete type.
-//
-void ArrayType::refineAbstractType(const DerivedType *OldType,
- const Type *NewType) {
- ArrayTypes->RefineAbstractType(this, OldType, NewType);
-}
-
-void ArrayType::typeBecameConcrete(const DerivedType *AbsTy) {
- ArrayTypes->TypeBecameConcrete(this, AbsTy);
-}
-
-// refineAbstractType - Called when a contained type is found to be more
-// concrete - this could potentially change us from an abstract type to a
-// concrete type.
-//
-void VectorType::refineAbstractType(const DerivedType *OldType,
- const Type *NewType) {
- VectorTypes->RefineAbstractType(this, OldType, NewType);
-}
-
-void VectorType::typeBecameConcrete(const DerivedType *AbsTy) {
- VectorTypes->TypeBecameConcrete(this, AbsTy);
-}
-
-// refineAbstractType - Called when a contained type is found to be more
-// concrete - this could potentially change us from an abstract type to a
-// concrete type.
-//
-void StructType::refineAbstractType(const DerivedType *OldType,
- const Type *NewType) {
- StructTypes->RefineAbstractType(this, OldType, NewType);
-}
-
-void StructType::typeBecameConcrete(const DerivedType *AbsTy) {
- StructTypes->TypeBecameConcrete(this, AbsTy);
-}
-
-// refineAbstractType - Called when a contained type is found to be more
-// concrete - this could potentially change us from an abstract type to a
-// concrete type.
-//
-void PointerType::refineAbstractType(const DerivedType *OldType,
- const Type *NewType) {
- PointerTypes->RefineAbstractType(this, OldType, NewType);
-}
-
-void PointerType::typeBecameConcrete(const DerivedType *AbsTy) {
- PointerTypes->TypeBecameConcrete(this, AbsTy);
-}
-
-bool SequentialType::indexValid(const Value *V) const {
- if (const IntegerType *IT = dyn_cast<IntegerType>(V->getType()))
- return IT->getBitWidth() == 32 || IT->getBitWidth() == 64;
- return false;
-}
-
-namespace llvm {
-std::ostream &operator<<(std::ostream &OS, const Type *T) {
- if (T == 0)
- OS << "<null> value!\n";
- else
- T->print(OS);
- return OS;
-}
-
-std::ostream &operator<<(std::ostream &OS, const Type &T) {
- T.print(OS);
- return OS;
-}
-}
diff --git a/release_23/lib/VMCore/TypeSymbolTable.cpp b/release_23/lib/VMCore/TypeSymbolTable.cpp
deleted file mode 100644
index 91e4721c1b9c..000000000000
--- a/release_23/lib/VMCore/TypeSymbolTable.cpp
+++ /dev/null
@@ -1,163 +0,0 @@
-//===-- TypeSymbolTable.cpp - Implement the TypeSymbolTable class ---------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the TypeSymbolTable class for the VMCore library.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/TypeSymbolTable.h"
-#include "llvm/DerivedTypes.h"
-#include "llvm/ADT/StringExtras.h"
-#include "llvm/Support/Streams.h"
-#include <algorithm>
-using namespace llvm;
-
-#define DEBUG_SYMBOL_TABLE 0
-#define DEBUG_ABSTYPE 0
-
-TypeSymbolTable::~TypeSymbolTable() {
- // Drop all abstract type references in the type plane...
- for (iterator TI = tmap.begin(), TE = tmap.end(); TI != TE; ++TI) {
- if (TI->second->isAbstract()) // If abstract, drop the reference...
- cast<DerivedType>(TI->second)->removeAbstractTypeUser(this);
- }
-}
-
-std::string TypeSymbolTable::getUniqueName(const std::string &BaseName) const {
- std::string TryName = BaseName;
- const_iterator End = tmap.end();
-
- // See if the name exists
- while (tmap.find(TryName) != End) // Loop until we find a free
- TryName = BaseName + utostr(++LastUnique); // name in the symbol table
- return TryName;
-}
-
-// lookup a type by name - returns null on failure
-Type* TypeSymbolTable::lookup(const std::string& Name) const {
- const_iterator TI = tmap.find(Name);
- if (TI != tmap.end())
- return const_cast<Type*>(TI->second);
- return 0;
-}
-
-// remove - Remove a type from the symbol table...
-Type* TypeSymbolTable::remove(iterator Entry) {
- assert(Entry != tmap.end() && "Invalid entry to remove!");
-
- const Type* Result = Entry->second;
-
-#if DEBUG_SYMBOL_TABLE
- dump();
- cerr << " Removing Value: " << Result->getName() << "\n";
-#endif
-
- tmap.erase(Entry);
-
- // If we are removing an abstract type, remove the symbol table from it's use
- // list...
- if (Result->isAbstract()) {
-#if DEBUG_ABSTYPE
- cerr << "Removing abstract type from symtab" << Result->getDescription()<<"\n";
-#endif
- cast<DerivedType>(Result)->removeAbstractTypeUser(this);
- }
-
- return const_cast<Type*>(Result);
-}
-
-
-// insert - Insert a type into the symbol table with the specified name...
-void TypeSymbolTable::insert(const std::string& Name, const Type* T) {
- assert(T && "Can't insert null type into symbol table!");
-
- if (tmap.insert(make_pair(Name, T)).second) {
- // Type inserted fine with no conflict.
-
-#if DEBUG_SYMBOL_TABLE
- dump();
- cerr << " Inserted type: " << Name << ": " << T->getDescription() << "\n";
-#endif
- } else {
- // If there is a name conflict...
-
- // Check to see if there is a naming conflict. If so, rename this type!
- std::string UniqueName = Name;
- if (lookup(Name))
- UniqueName = getUniqueName(Name);
-
-#if DEBUG_SYMBOL_TABLE
- dump();
- cerr << " Inserting type: " << UniqueName << ": "
- << T->getDescription() << "\n";
-#endif
-
- // Insert the tmap entry
- tmap.insert(make_pair(UniqueName, T));
- }
-
- // If we are adding an abstract type, add the symbol table to it's use list.
- if (T->isAbstract()) {
- cast<DerivedType>(T)->addAbstractTypeUser(this);
-#if DEBUG_ABSTYPE
- cerr << "Added abstract type to ST: " << T->getDescription() << "\n";
-#endif
- }
-}
-
-// This function is called when one of the types in the type plane are refined
-void TypeSymbolTable::refineAbstractType(const DerivedType *OldType,
- const Type *NewType) {
-
- // Loop over all of the types in the symbol table, replacing any references
- // to OldType with references to NewType. Note that there may be multiple
- // occurrences, and although we only need to remove one at a time, it's
- // faster to remove them all in one pass.
- //
- for (iterator I = begin(), E = end(); I != E; ++I) {
- if (I->second == (Type*)OldType) { // FIXME when Types aren't const.
-#if DEBUG_ABSTYPE
- cerr << "Removing type " << OldType->getDescription() << "\n";
-#endif
- OldType->removeAbstractTypeUser(this);
-
- I->second = (Type*)NewType; // TODO FIXME when types aren't const
- if (NewType->isAbstract()) {
-#if DEBUG_ABSTYPE
- cerr << "Added type " << NewType->getDescription() << "\n";
-#endif
- cast<DerivedType>(NewType)->addAbstractTypeUser(this);
- }
- }
- }
-}
-
-
-// Handle situation where type becomes Concreate from Abstract
-void TypeSymbolTable::typeBecameConcrete(const DerivedType *AbsTy) {
- // Loop over all of the types in the symbol table, dropping any abstract
- // type user entries for AbsTy which occur because there are names for the
- // type.
- for (iterator TI = begin(), TE = end(); TI != TE; ++TI)
- if (TI->second == const_cast<Type*>(static_cast<const Type*>(AbsTy)))
- AbsTy->removeAbstractTypeUser(this);
-}
-
-static void DumpTypes(const std::pair<const std::string, const Type*>& T ) {
- cerr << " '" << T.first << "' = ";
- T.second->dump();
- cerr << "\n";
-}
-
-void TypeSymbolTable::dump() const {
- cerr << "TypeSymbolPlane: ";
- for_each(tmap.begin(), tmap.end(), DumpTypes);
-}
-
-// vim: sw=2 ai
diff --git a/release_23/lib/VMCore/Value.cpp b/release_23/lib/VMCore/Value.cpp
deleted file mode 100644
index ff056ba74ac8..000000000000
--- a/release_23/lib/VMCore/Value.cpp
+++ /dev/null
@@ -1,357 +0,0 @@
-//===-- Value.cpp - Implement the Value class -----------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the Value and User classes.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Constant.h"
-#include "llvm/Constants.h"
-#include "llvm/DerivedTypes.h"
-#include "llvm/InstrTypes.h"
-#include "llvm/Instructions.h"
-#include "llvm/Module.h"
-#include "llvm/ValueSymbolTable.h"
-#include "llvm/Support/Debug.h"
-#include "llvm/Support/LeakDetector.h"
-#include <algorithm>
-using namespace llvm;
-
-//===----------------------------------------------------------------------===//
-// Value Class
-//===----------------------------------------------------------------------===//
-
-static inline const Type *checkType(const Type *Ty) {
- assert(Ty && "Value defined with a null type: Error!");
- return Ty;
-}
-
-Value::Value(const Type *ty, unsigned scid)
- : SubclassID(scid), SubclassData(0), Ty(checkType(ty)),
- UseList(0), Name(0) {
- if (isa<CallInst>(this) || isa<InvokeInst>(this))
- assert((Ty->isFirstClassType() || Ty == Type::VoidTy ||
- isa<OpaqueType>(ty) || Ty->getTypeID() == Type::StructTyID) &&
- "invalid CallInst type!");
- else if (!isa<Constant>(this) && !isa<BasicBlock>(this))
- assert((Ty->isFirstClassType() || Ty == Type::VoidTy ||
- isa<OpaqueType>(ty)) &&
- "Cannot create non-first-class values except for constants!");
-}
-
-Value::~Value() {
-#ifndef NDEBUG // Only in -g mode...
- // Check to make sure that there are no uses of this value that are still
- // around when the value is destroyed. If there are, then we have a dangling
- // reference and something is wrong. This code is here to print out what is
- // still being referenced. The value in question should be printed as
- // a <badref>
- //
- if (!use_empty()) {
- DOUT << "While deleting: " << *Ty << " %" << getNameStr() << "\n";
- for (use_iterator I = use_begin(), E = use_end(); I != E; ++I)
- DOUT << "Use still stuck around after Def is destroyed:"
- << **I << "\n";
- }
-#endif
- assert(use_empty() && "Uses remain when a value is destroyed!");
-
- // If this value is named, destroy the name. This should not be in a symtab
- // at this point.
- if (Name)
- Name->Destroy();
-
- // There should be no uses of this object anymore, remove it.
- LeakDetector::removeGarbageObject(this);
-}
-
-/// hasNUses - Return true if this Value has exactly N users.
-///
-bool Value::hasNUses(unsigned N) const {
- use_const_iterator UI = use_begin(), E = use_end();
-
- for (; N; --N, ++UI)
- if (UI == E) return false; // Too few.
- return UI == E;
-}
-
-/// hasNUsesOrMore - Return true if this value has N users or more. This is
-/// logically equivalent to getNumUses() >= N.
-///
-bool Value::hasNUsesOrMore(unsigned N) const {
- use_const_iterator UI = use_begin(), E = use_end();
-
- for (; N; --N, ++UI)
- if (UI == E) return false; // Too few.
-
- return true;
-}
-
-
-/// getNumUses - This method computes the number of uses of this Value. This
-/// is a linear time operation. Use hasOneUse or hasNUses to check for specific
-/// values.
-unsigned Value::getNumUses() const {
- return (unsigned)std::distance(use_begin(), use_end());
-}
-
-static bool getSymTab(Value *V, ValueSymbolTable *&ST) {
- ST = 0;
- if (Instruction *I = dyn_cast<Instruction>(V)) {
- if (BasicBlock *P = I->getParent())
- if (Function *PP = P->getParent())
- ST = &PP->getValueSymbolTable();
- } else if (BasicBlock *BB = dyn_cast<BasicBlock>(V)) {
- if (Function *P = BB->getParent())
- ST = &P->getValueSymbolTable();
- } else if (GlobalValue *GV = dyn_cast<GlobalValue>(V)) {
- if (Module *P = GV->getParent())
- ST = &P->getValueSymbolTable();
- } else if (Argument *A = dyn_cast<Argument>(V)) {
- if (Function *P = A->getParent())
- ST = &P->getValueSymbolTable();
- } else {
- assert(isa<Constant>(V) && "Unknown value type!");
- return true; // no name is setable for this.
- }
- return false;
-}
-
-/// getNameStart - Return a pointer to a null terminated string for this name.
-/// Note that names can have null characters within the string as well as at
-/// their end. This always returns a non-null pointer.
-const char *Value::getNameStart() const {
- if (Name == 0) return "";
- return Name->getKeyData();
-}
-
-/// getNameLen - Return the length of the string, correctly handling nul
-/// characters embedded into them.
-unsigned Value::getNameLen() const {
- return Name ? Name->getKeyLength() : 0;
-}
-
-/// isName - Return true if this value has the name specified by the provided
-/// nul terminated string.
-bool Value::isName(const char *N) const {
- unsigned InLen = strlen(N);
- return InLen == getNameLen() && memcmp(getNameStart(), N, InLen) == 0;
-}
-
-
-std::string Value::getNameStr() const {
- if (Name == 0) return "";
- return std::string(Name->getKeyData(),
- Name->getKeyData()+Name->getKeyLength());
-}
-
-void Value::setName(const std::string &name) {
- setName(&name[0], name.size());
-}
-
-void Value::setName(const char *Name) {
- setName(Name, Name ? strlen(Name) : 0);
-}
-
-void Value::setName(const char *NameStr, unsigned NameLen) {
- if (NameLen == 0 && !hasName()) return;
- assert(getType() != Type::VoidTy && "Cannot assign a name to void values!");
-
- // Get the symbol table to update for this object.
- ValueSymbolTable *ST;
- if (getSymTab(this, ST))
- return; // Cannot set a name on this value (e.g. constant).
-
- if (!ST) { // No symbol table to update? Just do the change.
- if (NameLen == 0) {
- // Free the name for this value.
- Name->Destroy();
- Name = 0;
- return;
- }
-
- if (Name) {
- // Name isn't changing?
- if (NameLen == Name->getKeyLength() &&
- !memcmp(Name->getKeyData(), NameStr, NameLen))
- return;
- Name->Destroy();
- }
-
- // NOTE: Could optimize for the case the name is shrinking to not deallocate
- // then reallocated.
-
- // Create the new name.
- Name = ValueName::Create(NameStr, NameStr+NameLen);
- Name->setValue(this);
- return;
- }
-
- // NOTE: Could optimize for the case the name is shrinking to not deallocate
- // then reallocated.
- if (hasName()) {
- // Name isn't changing?
- if (NameLen == Name->getKeyLength() &&
- !memcmp(Name->getKeyData(), NameStr, NameLen))
- return;
-
- // Remove old name.
- ST->removeValueName(Name);
- Name->Destroy();
- Name = 0;
-
- if (NameLen == 0)
- return;
- }
-
- // Name is changing to something new.
- Name = ST->createValueName(NameStr, NameLen, this);
-}
-
-
-/// takeName - transfer the name from V to this value, setting V's name to
-/// empty. It is an error to call V->takeName(V).
-void Value::takeName(Value *V) {
- ValueSymbolTable *ST = 0;
- // If this value has a name, drop it.
- if (hasName()) {
- // Get the symtab this is in.
- if (getSymTab(this, ST)) {
- // We can't set a name on this value, but we need to clear V's name if
- // it has one.
- if (V->hasName()) V->setName(0, 0);
- return; // Cannot set a name on this value (e.g. constant).
- }
-
- // Remove old name.
- if (ST)
- ST->removeValueName(Name);
- Name->Destroy();
- Name = 0;
- }
-
- // Now we know that this has no name.
-
- // If V has no name either, we're done.
- if (!V->hasName()) return;
-
- // Get this's symtab if we didn't before.
- if (!ST) {
- if (getSymTab(this, ST)) {
- // Clear V's name.
- V->setName(0, 0);
- return; // Cannot set a name on this value (e.g. constant).
- }
- }
-
- // Get V's ST, this should always succed, because V has a name.
- ValueSymbolTable *VST;
- bool Failure = getSymTab(V, VST);
- assert(!Failure && "V has a name, so it should have a ST!");
-
- // If these values are both in the same symtab, we can do this very fast.
- // This works even if both values have no symtab yet.
- if (ST == VST) {
- // Take the name!
- Name = V->Name;
- V->Name = 0;
- Name->setValue(this);
- return;
- }
-
- // Otherwise, things are slightly more complex. Remove V's name from VST and
- // then reinsert it into ST.
-
- if (VST)
- VST->removeValueName(V->Name);
- Name = V->Name;
- V->Name = 0;
- Name->setValue(this);
-
- if (ST)
- ST->reinsertValue(this);
-}
-
-
-// uncheckedReplaceAllUsesWith - This is exactly the same as replaceAllUsesWith,
-// except that it doesn't have all of the asserts. The asserts fail because we
-// are half-way done resolving types, which causes some types to exist as two
-// different Type*'s at the same time. This is a sledgehammer to work around
-// this problem.
-//
-void Value::uncheckedReplaceAllUsesWith(Value *New) {
- while (!use_empty()) {
- Use &U = *UseList;
- // Must handle Constants specially, we cannot call replaceUsesOfWith on a
- // constant because they are uniqued.
- if (Constant *C = dyn_cast<Constant>(U.getUser())) {
- if (!isa<GlobalValue>(C)) {
- C->replaceUsesOfWithOnConstant(this, New, &U);
- continue;
- }
- }
-
- U.set(New);
- }
-}
-
-void Value::replaceAllUsesWith(Value *New) {
- assert(New && "Value::replaceAllUsesWith(<null>) is invalid!");
- assert(New != this && "this->replaceAllUsesWith(this) is NOT valid!");
- assert(New->getType() == getType() &&
- "replaceAllUses of value with new value of different type!");
-
- uncheckedReplaceAllUsesWith(New);
-}
-
-Value *Value::stripPointerCasts() {
- if (ConstantExpr *CE = dyn_cast<ConstantExpr>(this)) {
- if (CE->getOpcode() == Instruction::BitCast) {
- if (isa<PointerType>(CE->getOperand(0)->getType()))
- return CE->getOperand(0)->stripPointerCasts();
- } else if (CE->getOpcode() == Instruction::GetElementPtr) {
- for (unsigned i = 1, e = CE->getNumOperands(); i != e; ++i)
- if (!CE->getOperand(i)->isNullValue())
- return this;
- return CE->getOperand(0)->stripPointerCasts();
- }
- return this;
- }
-
- if (BitCastInst *CI = dyn_cast<BitCastInst>(this)) {
- if (isa<PointerType>(CI->getOperand(0)->getType()))
- return CI->getOperand(0)->stripPointerCasts();
- } else if (GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(this)) {
- if (GEP->hasAllZeroIndices())
- return GEP->getOperand(0)->stripPointerCasts();
- }
- return this;
-}
-
-//===----------------------------------------------------------------------===//
-// User Class
-//===----------------------------------------------------------------------===//
-
-// replaceUsesOfWith - Replaces all references to the "From" definition with
-// references to the "To" definition.
-//
-void User::replaceUsesOfWith(Value *From, Value *To) {
- if (From == To) return; // Duh what?
-
- assert((!isa<Constant>(this) || isa<GlobalValue>(this)) &&
- "Cannot call User::replaceUsesofWith on a constant!");
-
- for (unsigned i = 0, E = getNumOperands(); i != E; ++i)
- if (getOperand(i) == From) { // Is This operand is pointing to oldval?
- // The side effects of this setOperand call include linking to
- // "To", adding "this" to the uses list of To, and
- // most importantly, removing "this" from the use list of "From".
- setOperand(i, To); // Fix it now...
- }
-}
diff --git a/release_23/lib/VMCore/ValueSymbolTable.cpp b/release_23/lib/VMCore/ValueSymbolTable.cpp
deleted file mode 100644
index fb7c0d8509b9..000000000000
--- a/release_23/lib/VMCore/ValueSymbolTable.cpp
+++ /dev/null
@@ -1,142 +0,0 @@
-//===-- ValueSymbolTable.cpp - Implement the ValueSymbolTable class -------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the ValueSymbolTable class for the VMCore library.
-//
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "valuesymtab"
-#include "llvm/GlobalValue.h"
-#include "llvm/Type.h"
-#include "llvm/ValueSymbolTable.h"
-#include "llvm/ADT/StringExtras.h"
-#include "llvm/Support/Debug.h"
-using namespace llvm;
-
-// Class destructor
-ValueSymbolTable::~ValueSymbolTable() {
-#ifndef NDEBUG // Only do this in -g mode...
- for (iterator VI = vmap.begin(), VE = vmap.end(); VI != VE; ++VI)
- cerr << "Value still in symbol table! Type = '"
- << VI->getValue()->getType()->getDescription() << "' Name = '"
- << VI->getKeyData() << "'\n";
- assert(vmap.empty() && "Values remain in symbol table!");
-#endif
-}
-
-// getUniqueName - Given a base name, return a string that is either equal to
-// it (or derived from it) that does not already occur in the symbol table for
-// the specified type.
-//
-std::string ValueSymbolTable::getUniqueName(const std::string &BaseName) const {
- std::string TryName = BaseName;
-
- // See if the name exists
- while (vmap.find(&TryName[0], &TryName[TryName.size()]) != vmap.end())
- // Loop until we find a free name in the symbol table.
- TryName = BaseName + utostr(++LastUnique);
- return TryName;
-}
-
-
-// lookup a value - Returns null on failure...
-//
-Value *ValueSymbolTable::lookup(const std::string &Name) const {
- const_iterator VI = vmap.find(&Name[0], &Name[Name.size()]);
- if (VI != vmap.end()) // We found the symbol
- return VI->getValue();
- return 0;
-}
-
-// Insert a value into the symbol table with the specified name...
-//
-void ValueSymbolTable::reinsertValue(Value* V) {
- assert(V->hasName() && "Can't insert nameless Value into symbol table");
-
- // Try inserting the name, assuming it won't conflict.
- if (vmap.insert(V->Name)) {
- //DOUT << " Inserted value: " << V->Name << ": " << *V << "\n";
- return;
- }
-
- // FIXME: this could be much more efficient.
-
- // Otherwise, there is a naming conflict. Rename this value.
- std::string UniqueName = V->getName();
-
- V->Name->Destroy();
-
- unsigned BaseSize = UniqueName.size();
- while (1) {
- // Trim any suffix off.
- UniqueName.resize(BaseSize);
- UniqueName += utostr(++LastUnique);
- // Try insert the vmap entry with this suffix.
- ValueName &NewName = vmap.GetOrCreateValue(&UniqueName[0],
- &UniqueName[UniqueName.size()]);
- if (NewName.getValue() == 0) {
- // Newly inserted name. Success!
- NewName.setValue(V);
- V->Name = &NewName;
- //DEBUG(DOUT << " Inserted value: " << UniqueName << ": " << *V << "\n");
- return;
- }
- }
-}
-
-void ValueSymbolTable::removeValueName(ValueName *V) {
- //DEBUG(DOUT << " Removing Value: " << V->getKeyData() << "\n");
- // Remove the value from the plane.
- vmap.remove(V);
-}
-
-/// createValueName - This method attempts to create a value name and insert
-/// it into the symbol table with the specified name. If it conflicts, it
-/// auto-renames the name and returns that instead.
-ValueName *ValueSymbolTable::createValueName(const char *NameStart,
- unsigned NameLen, Value *V) {
- ValueName &Entry = vmap.GetOrCreateValue(NameStart, NameStart+NameLen);
- if (Entry.getValue() == 0) {
- Entry.setValue(V);
- //DEBUG(DOUT << " Inserted value: " << Entry.getKeyData() << ": "
- // << *V << "\n");
- return &Entry;
- }
-
- // FIXME: this could be much more efficient.
-
- // Otherwise, there is a naming conflict. Rename this value.
- std::string UniqueName(NameStart, NameStart+NameLen);
- while (1) {
- // Trim any suffix off.
- UniqueName.resize(NameLen);
- UniqueName += utostr(++LastUnique);
- // Try insert the vmap entry with this suffix.
- ValueName &NewName = vmap.GetOrCreateValue(&UniqueName[0],
- &UniqueName[UniqueName.size()]);
- if (NewName.getValue() == 0) {
- // Newly inserted name. Success!
- NewName.setValue(V);
- //DEBUG(DOUT << " Inserted value: " << UniqueName << ": " << *V << "\n");
- return &NewName;
- }
- }
-}
-
-
-// dump - print out the symbol table
-//
-void ValueSymbolTable::dump() const {
- //DOUT << "ValueSymbolTable:\n";
- for (const_iterator I = begin(), E = end(); I != E; ++I) {
- //DOUT << " '" << I->getKeyData() << "' = ";
- I->getValue()->dump();
- //DOUT << "\n";
- }
-}
diff --git a/release_23/lib/VMCore/ValueTypes.cpp b/release_23/lib/VMCore/ValueTypes.cpp
deleted file mode 100644
index 88add7c174c4..000000000000
--- a/release_23/lib/VMCore/ValueTypes.cpp
+++ /dev/null
@@ -1,125 +0,0 @@
-//===-- ValueTypes.cpp - Implementation of MVT::ValueType methods ---------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements methods in the CodeGen/ValueTypes.h header.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/ADT/StringExtras.h"
-#include "llvm/CodeGen/ValueTypes.h"
-#include "llvm/Type.h"
-#include "llvm/DerivedTypes.h"
-using namespace llvm;
-
-/// MVT::getValueTypeString - This function returns value type as a string,
-/// e.g. "i32".
-std::string MVT::getValueTypeString(MVT::ValueType VT) {
- switch (VT) {
- default:
- if (isVector(VT))
- return "v" + utostr(getVectorNumElements(VT)) +
- getValueTypeString(getVectorElementType(VT));
- if (isInteger(VT))
- return "i" + utostr(getSizeInBits(VT));
- assert(0 && "Invalid ValueType!");
- case MVT::i1: return "i1";
- case MVT::i8: return "i8";
- case MVT::i16: return "i16";
- case MVT::i32: return "i32";
- case MVT::i64: return "i64";
- case MVT::i128: return "i128";
- case MVT::f32: return "f32";
- case MVT::f64: return "f64";
- case MVT::f80: return "f80";
- case MVT::f128: return "f128";
- case MVT::ppcf128: return "ppcf128";
- case MVT::isVoid: return "isVoid";
- case MVT::Other: return "ch";
- case MVT::Flag: return "flag";
- case MVT::v8i8: return "v8i8";
- case MVT::v4i16: return "v4i16";
- case MVT::v2i32: return "v2i32";
- case MVT::v1i64: return "v1i64";
- case MVT::v16i8: return "v16i8";
- case MVT::v8i16: return "v8i16";
- case MVT::v4i32: return "v4i32";
- case MVT::v2i64: return "v2i64";
- case MVT::v2f32: return "v2f32";
- case MVT::v4f32: return "v4f32";
- case MVT::v2f64: return "v2f64";
- case MVT::v3i32: return "v3i32";
- case MVT::v3f32: return "v3f32";
- }
-}
-
-/// MVT::getTypeForValueType - This method returns an LLVM type corresponding
-/// to the specified ValueType. Note that this will abort for types that cannot
-/// be represented.
-const Type *MVT::getTypeForValueType(MVT::ValueType VT) {
- switch (VT) {
- default:
- if (isVector(VT))
- return VectorType::get(getTypeForValueType(getVectorElementType(VT)),
- getVectorNumElements(VT));
- if (isInteger(VT))
- return IntegerType::get(getSizeInBits(VT));
- assert(0 && "ValueType does not correspond to LLVM type!");
- case MVT::isVoid:return Type::VoidTy;
- case MVT::i1: return Type::Int1Ty;
- case MVT::i8: return Type::Int8Ty;
- case MVT::i16: return Type::Int16Ty;
- case MVT::i32: return Type::Int32Ty;
- case MVT::i64: return Type::Int64Ty;
- case MVT::i128: return IntegerType::get(128);
- case MVT::f32: return Type::FloatTy;
- case MVT::f64: return Type::DoubleTy;
- case MVT::f80: return Type::X86_FP80Ty;
- case MVT::f128: return Type::FP128Ty;
- case MVT::ppcf128: return Type::PPC_FP128Ty;
- case MVT::v8i8: return VectorType::get(Type::Int8Ty, 8);
- case MVT::v4i16: return VectorType::get(Type::Int16Ty, 4);
- case MVT::v2i32: return VectorType::get(Type::Int32Ty, 2);
- case MVT::v1i64: return VectorType::get(Type::Int64Ty, 1);
- case MVT::v16i8: return VectorType::get(Type::Int8Ty, 16);
- case MVT::v8i16: return VectorType::get(Type::Int16Ty, 8);
- case MVT::v4i32: return VectorType::get(Type::Int32Ty, 4);
- case MVT::v2i64: return VectorType::get(Type::Int64Ty, 2);
- case MVT::v2f32: return VectorType::get(Type::FloatTy, 2);
- case MVT::v4f32: return VectorType::get(Type::FloatTy, 4);
- case MVT::v2f64: return VectorType::get(Type::DoubleTy, 2);
- case MVT::v3i32: return VectorType::get(Type::Int32Ty, 3);
- case MVT::v3f32: return VectorType::get(Type::FloatTy, 3);
- }
-}
-
-/// MVT::getValueType - Return the value type corresponding to the specified
-/// type. This returns all pointers as MVT::iPTR. If HandleUnknown is true,
-/// unknown types are returned as Other, otherwise they are invalid.
-MVT::ValueType MVT::getValueType(const Type *Ty, bool HandleUnknown) {
- switch (Ty->getTypeID()) {
- default:
- if (HandleUnknown) return MVT::Other;
- assert(0 && "Unknown type!");
- case Type::VoidTyID:
- return MVT::isVoid;
- case Type::IntegerTyID:
- return getIntegerType(cast<IntegerType>(Ty)->getBitWidth());
- case Type::FloatTyID: return MVT::f32;
- case Type::DoubleTyID: return MVT::f64;
- case Type::X86_FP80TyID: return MVT::f80;
- case Type::FP128TyID: return MVT::f128;
- case Type::PPC_FP128TyID: return MVT::ppcf128;
- case Type::PointerTyID: return MVT::iPTR;
- case Type::VectorTyID: {
- const VectorType *VTy = cast<VectorType>(Ty);
- return getVectorType(getValueType(VTy->getElementType(), false),
- VTy->getNumElements());
- }
- }
-}
diff --git a/release_23/lib/VMCore/Verifier.cpp b/release_23/lib/VMCore/Verifier.cpp
deleted file mode 100644
index aec5974209b9..000000000000
--- a/release_23/lib/VMCore/Verifier.cpp
+++ /dev/null
@@ -1,1500 +0,0 @@
-//===-- Verifier.cpp - Implement the Module Verifier -------------*- C++ -*-==//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines the function verifier interface, that can be used for some
-// sanity checking of input to the system.
-//
-// Note that this does not provide full `Java style' security and verifications,
-// instead it just tries to ensure that code is well-formed.
-//
-// * Both of a binary operator's parameters are of the same type
-// * Verify that the indices of mem access instructions match other operands
-// * Verify that arithmetic and other things are only performed on first-class
-// types. Verify that shifts & logicals only happen on integrals f.e.
-// * All of the constants in a switch statement are of the correct type
-// * The code is in valid SSA form
-// * It should be illegal to put a label into any other type (like a structure)
-// or to return one. [except constant arrays!]
-// * Only phi nodes can be self referential: 'add i32 %0, %0 ; <int>:0' is bad
-// * PHI nodes must have an entry for each predecessor, with no extras.
-// * PHI nodes must be the first thing in a basic block, all grouped together
-// * PHI nodes must have at least one entry
-// * All basic blocks should only end with terminator insts, not contain them
-// * The entry node to a function must not have predecessors
-// * All Instructions must be embedded into a basic block
-// * Functions cannot take a void-typed parameter
-// * Verify that a function's argument list agrees with it's declared type.
-// * It is illegal to specify a name for a void value.
-// * It is illegal to have a internal global value with no initializer
-// * It is illegal to have a ret instruction that returns a value that does not
-// agree with the function return value type.
-// * Function call argument types match the function prototype
-// * All other things that are tested by asserts spread about the code...
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Analysis/Verifier.h"
-#include "llvm/CallingConv.h"
-#include "llvm/Constants.h"
-#include "llvm/DerivedTypes.h"
-#include "llvm/InlineAsm.h"
-#include "llvm/IntrinsicInst.h"
-#include "llvm/Module.h"
-#include "llvm/ModuleProvider.h"
-#include "llvm/Pass.h"
-#include "llvm/PassManager.h"
-#include "llvm/Analysis/Dominators.h"
-#include "llvm/Assembly/Writer.h"
-#include "llvm/CodeGen/ValueTypes.h"
-#include "llvm/Support/CallSite.h"
-#include "llvm/Support/CFG.h"
-#include "llvm/Support/InstVisitor.h"
-#include "llvm/Support/Streams.h"
-#include "llvm/ADT/SmallPtrSet.h"
-#include "llvm/ADT/SmallVector.h"
-#include "llvm/ADT/StringExtras.h"
-#include "llvm/ADT/STLExtras.h"
-#include "llvm/Support/Compiler.h"
-#include <algorithm>
-#include <sstream>
-#include <cstdarg>
-using namespace llvm;
-
-namespace { // Anonymous namespace for class
- struct VISIBILITY_HIDDEN PreVerifier : public FunctionPass {
- static char ID; // Pass ID, replacement for typeid
-
- PreVerifier() : FunctionPass((intptr_t)&ID) { }
-
- // Check that the prerequisites for successful DominatorTree construction
- // are satisfied.
- bool runOnFunction(Function &F) {
- bool Broken = false;
-
- for (Function::iterator I = F.begin(), E = F.end(); I != E; ++I) {
- if (I->empty() || !I->back().isTerminator()) {
- cerr << "Basic Block does not have terminator!\n";
- WriteAsOperand(*cerr, I, true);
- cerr << "\n";
- Broken = true;
- }
- }
-
- if (Broken)
- abort();
-
- return false;
- }
- };
-
- char PreVerifier::ID = 0;
- RegisterPass<PreVerifier> PreVer("preverify", "Preliminary module verification");
- const PassInfo *PreVerifyID = PreVer.getPassInfo();
-
- struct VISIBILITY_HIDDEN
- Verifier : public FunctionPass, InstVisitor<Verifier> {
- static char ID; // Pass ID, replacement for typeid
- bool Broken; // Is this module found to be broken?
- bool RealPass; // Are we not being run by a PassManager?
- VerifierFailureAction action;
- // What to do if verification fails.
- Module *Mod; // Module we are verifying right now
- DominatorTree *DT; // Dominator Tree, caution can be null!
- std::stringstream msgs; // A stringstream to collect messages
-
- /// InstInThisBlock - when verifying a basic block, keep track of all of the
- /// instructions we have seen so far. This allows us to do efficient
- /// dominance checks for the case when an instruction has an operand that is
- /// an instruction in the same block.
- SmallPtrSet<Instruction*, 16> InstsInThisBlock;
-
- Verifier()
- : FunctionPass((intptr_t)&ID),
- Broken(false), RealPass(true), action(AbortProcessAction),
- DT(0), msgs( std::ios::app | std::ios::out ) {}
- explicit Verifier(VerifierFailureAction ctn)
- : FunctionPass((intptr_t)&ID),
- Broken(false), RealPass(true), action(ctn), DT(0),
- msgs( std::ios::app | std::ios::out ) {}
- explicit Verifier(bool AB)
- : FunctionPass((intptr_t)&ID),
- Broken(false), RealPass(true),
- action( AB ? AbortProcessAction : PrintMessageAction), DT(0),
- msgs( std::ios::app | std::ios::out ) {}
- explicit Verifier(DominatorTree &dt)
- : FunctionPass((intptr_t)&ID),
- Broken(false), RealPass(false), action(PrintMessageAction),
- DT(&dt), msgs( std::ios::app | std::ios::out ) {}
-
-
- bool doInitialization(Module &M) {
- Mod = &M;
- verifyTypeSymbolTable(M.getTypeSymbolTable());
-
- // If this is a real pass, in a pass manager, we must abort before
- // returning back to the pass manager, or else the pass manager may try to
- // run other passes on the broken module.
- if (RealPass)
- return abortIfBroken();
- return false;
- }
-
- bool runOnFunction(Function &F) {
- // Get dominator information if we are being run by PassManager
- if (RealPass) DT = &getAnalysis<DominatorTree>();
-
- Mod = F.getParent();
-
- visit(F);
- InstsInThisBlock.clear();
-
- // If this is a real pass, in a pass manager, we must abort before
- // returning back to the pass manager, or else the pass manager may try to
- // run other passes on the broken module.
- if (RealPass)
- return abortIfBroken();
-
- return false;
- }
-
- bool doFinalization(Module &M) {
- // Scan through, checking all of the external function's linkage now...
- for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I) {
- visitGlobalValue(*I);
-
- // Check to make sure function prototypes are okay.
- if (I->isDeclaration()) visitFunction(*I);
- }
-
- for (Module::global_iterator I = M.global_begin(), E = M.global_end();
- I != E; ++I)
- visitGlobalVariable(*I);
-
- for (Module::alias_iterator I = M.alias_begin(), E = M.alias_end();
- I != E; ++I)
- visitGlobalAlias(*I);
-
- // If the module is broken, abort at this time.
- return abortIfBroken();
- }
-
- virtual void getAnalysisUsage(AnalysisUsage &AU) const {
- AU.setPreservesAll();
- AU.addRequiredID(PreVerifyID);
- if (RealPass)
- AU.addRequired<DominatorTree>();
- }
-
- /// abortIfBroken - If the module is broken and we are supposed to abort on
- /// this condition, do so.
- ///
- bool abortIfBroken() {
- if (Broken) {
- msgs << "Broken module found, ";
- switch (action) {
- case AbortProcessAction:
- msgs << "compilation aborted!\n";
- cerr << msgs.str();
- abort();
- case PrintMessageAction:
- msgs << "verification continues.\n";
- cerr << msgs.str();
- return false;
- case ReturnStatusAction:
- msgs << "compilation terminated.\n";
- return Broken;
- }
- }
- return false;
- }
-
-
- // Verification methods...
- void verifyTypeSymbolTable(TypeSymbolTable &ST);
- void visitGlobalValue(GlobalValue &GV);
- void visitGlobalVariable(GlobalVariable &GV);
- void visitGlobalAlias(GlobalAlias &GA);
- void visitFunction(Function &F);
- void visitBasicBlock(BasicBlock &BB);
- void visitTruncInst(TruncInst &I);
- void visitZExtInst(ZExtInst &I);
- void visitSExtInst(SExtInst &I);
- void visitFPTruncInst(FPTruncInst &I);
- void visitFPExtInst(FPExtInst &I);
- void visitFPToUIInst(FPToUIInst &I);
- void visitFPToSIInst(FPToSIInst &I);
- void visitUIToFPInst(UIToFPInst &I);
- void visitSIToFPInst(SIToFPInst &I);
- void visitIntToPtrInst(IntToPtrInst &I);
- void visitPtrToIntInst(PtrToIntInst &I);
- void visitBitCastInst(BitCastInst &I);
- void visitPHINode(PHINode &PN);
- void visitBinaryOperator(BinaryOperator &B);
- void visitICmpInst(ICmpInst &IC);
- void visitFCmpInst(FCmpInst &FC);
- void visitExtractElementInst(ExtractElementInst &EI);
- void visitInsertElementInst(InsertElementInst &EI);
- void visitShuffleVectorInst(ShuffleVectorInst &EI);
- void visitVAArgInst(VAArgInst &VAA) { visitInstruction(VAA); }
- void visitCallInst(CallInst &CI);
- void visitInvokeInst(InvokeInst &II);
- void visitGetElementPtrInst(GetElementPtrInst &GEP);
- void visitLoadInst(LoadInst &LI);
- void visitStoreInst(StoreInst &SI);
- void visitInstruction(Instruction &I);
- void visitTerminatorInst(TerminatorInst &I);
- void visitReturnInst(ReturnInst &RI);
- void visitSwitchInst(SwitchInst &SI);
- void visitSelectInst(SelectInst &SI);
- void visitUserOp1(Instruction &I);
- void visitUserOp2(Instruction &I) { visitUserOp1(I); }
- void visitIntrinsicFunctionCall(Intrinsic::ID ID, CallInst &CI);
- void visitAllocationInst(AllocationInst &AI);
- void visitGetResultInst(GetResultInst &GRI);
-
- void VerifyCallSite(CallSite CS);
- void VerifyIntrinsicPrototype(Intrinsic::ID ID, Function *F,
- unsigned Count, ...);
- void VerifyAttrs(ParameterAttributes Attrs, const Type *Ty,
- bool isReturnValue, const Value *V);
- void VerifyFunctionAttrs(const FunctionType *FT, const PAListPtr &Attrs,
- const Value *V);
-
- void WriteValue(const Value *V) {
- if (!V) return;
- if (isa<Instruction>(V)) {
- msgs << *V;
- } else {
- WriteAsOperand(msgs, V, true, Mod);
- msgs << "\n";
- }
- }
-
- void WriteType(const Type* T ) {
- if ( !T ) return;
- WriteTypeSymbolic(msgs, T, Mod );
- }
-
-
- // CheckFailed - A check failed, so print out the condition and the message
- // that failed. This provides a nice place to put a breakpoint if you want
- // to see why something is not correct.
- void CheckFailed(const std::string &Message,
- const Value *V1 = 0, const Value *V2 = 0,
- const Value *V3 = 0, const Value *V4 = 0) {
- msgs << Message << "\n";
- WriteValue(V1);
- WriteValue(V2);
- WriteValue(V3);
- WriteValue(V4);
- Broken = true;
- }
-
- void CheckFailed( const std::string& Message, const Value* V1,
- const Type* T2, const Value* V3 = 0 ) {
- msgs << Message << "\n";
- WriteValue(V1);
- WriteType(T2);
- WriteValue(V3);
- Broken = true;
- }
- };
-
- char Verifier::ID = 0;
- RegisterPass<Verifier> X("verify", "Module Verifier");
-} // End anonymous namespace
-
-
-// Assert - We know that cond should be true, if not print an error message.
-#define Assert(C, M) \
- do { if (!(C)) { CheckFailed(M); return; } } while (0)
-#define Assert1(C, M, V1) \
- do { if (!(C)) { CheckFailed(M, V1); return; } } while (0)
-#define Assert2(C, M, V1, V2) \
- do { if (!(C)) { CheckFailed(M, V1, V2); return; } } while (0)
-#define Assert3(C, M, V1, V2, V3) \
- do { if (!(C)) { CheckFailed(M, V1, V2, V3); return; } } while (0)
-#define Assert4(C, M, V1, V2, V3, V4) \
- do { if (!(C)) { CheckFailed(M, V1, V2, V3, V4); return; } } while (0)
-
-
-void Verifier::visitGlobalValue(GlobalValue &GV) {
- Assert1(!GV.isDeclaration() ||
- GV.hasExternalLinkage() ||
- GV.hasDLLImportLinkage() ||
- GV.hasExternalWeakLinkage() ||
- (isa<GlobalAlias>(GV) &&
- (GV.hasInternalLinkage() || GV.hasWeakLinkage())),
- "Global is external, but doesn't have external or dllimport or weak linkage!",
- &GV);
-
- Assert1(!GV.hasDLLImportLinkage() || GV.isDeclaration(),
- "Global is marked as dllimport, but not external", &GV);
-
- Assert1(!GV.hasAppendingLinkage() || isa<GlobalVariable>(GV),
- "Only global variables can have appending linkage!", &GV);
-
- if (GV.hasAppendingLinkage()) {
- GlobalVariable &GVar = cast<GlobalVariable>(GV);
- Assert1(isa<ArrayType>(GVar.getType()->getElementType()),
- "Only global arrays can have appending linkage!", &GV);
- }
-}
-
-void Verifier::visitGlobalVariable(GlobalVariable &GV) {
- if (GV.hasInitializer()) {
- Assert1(GV.getInitializer()->getType() == GV.getType()->getElementType(),
- "Global variable initializer type does not match global "
- "variable type!", &GV);
- } else {
- Assert1(GV.hasExternalLinkage() || GV.hasDLLImportLinkage() ||
- GV.hasExternalWeakLinkage(),
- "invalid linkage type for global declaration", &GV);
- }
-
- visitGlobalValue(GV);
-}
-
-void Verifier::visitGlobalAlias(GlobalAlias &GA) {
- Assert1(!GA.getName().empty(),
- "Alias name cannot be empty!", &GA);
- Assert1(GA.hasExternalLinkage() || GA.hasInternalLinkage() ||
- GA.hasWeakLinkage(),
- "Alias should have external or external weak linkage!", &GA);
- Assert1(GA.getAliasee(),
- "Aliasee cannot be NULL!", &GA);
- Assert1(GA.getType() == GA.getAliasee()->getType(),
- "Alias and aliasee types should match!", &GA);
-
- if (!isa<GlobalValue>(GA.getAliasee())) {
- const ConstantExpr *CE = dyn_cast<ConstantExpr>(GA.getAliasee());
- Assert1(CE && CE->getOpcode() == Instruction::BitCast &&
- isa<GlobalValue>(CE->getOperand(0)),
- "Aliasee should be either GlobalValue or bitcast of GlobalValue",
- &GA);
- }
-
- const GlobalValue* Aliasee = GA.resolveAliasedGlobal();
- Assert1(Aliasee,
- "Aliasing chain should end with function or global variable", &GA);
-
- visitGlobalValue(GA);
-}
-
-void Verifier::verifyTypeSymbolTable(TypeSymbolTable &ST) {
-}
-
-// VerifyAttrs - Check the given parameter attributes for an argument or return
-// value of the specified type. The value V is printed in error messages.
-void Verifier::VerifyAttrs(ParameterAttributes Attrs, const Type *Ty,
- bool isReturnValue, const Value *V) {
- if (Attrs == ParamAttr::None)
- return;
-
- if (isReturnValue) {
- ParameterAttributes RetI = Attrs & ParamAttr::ParameterOnly;
- Assert1(!RetI, "Attribute " + ParamAttr::getAsString(RetI) +
- "does not apply to return values!", V);
- } else {
- ParameterAttributes ParmI = Attrs & ParamAttr::ReturnOnly;
- Assert1(!ParmI, "Attribute " + ParamAttr::getAsString(ParmI) +
- "only applies to return values!", V);
- }
-
- for (unsigned i = 0;
- i < array_lengthof(ParamAttr::MutuallyIncompatible); ++i) {
- ParameterAttributes MutI = Attrs & ParamAttr::MutuallyIncompatible[i];
- Assert1(!(MutI & (MutI - 1)), "Attributes " +
- ParamAttr::getAsString(MutI) + "are incompatible!", V);
- }
-
- ParameterAttributes TypeI = Attrs & ParamAttr::typeIncompatible(Ty);
- Assert1(!TypeI, "Wrong type for attribute " +
- ParamAttr::getAsString(TypeI), V);
-}
-
-// VerifyFunctionAttrs - Check parameter attributes against a function type.
-// The value V is printed in error messages.
-void Verifier::VerifyFunctionAttrs(const FunctionType *FT,
- const PAListPtr &Attrs,
- const Value *V) {
- if (Attrs.isEmpty())
- return;
-
- bool SawNest = false;
-
- for (unsigned i = 0, e = Attrs.getNumSlots(); i != e; ++i) {
- const ParamAttrsWithIndex &Attr = Attrs.getSlot(i);
-
- const Type *Ty;
- if (Attr.Index == 0)
- Ty = FT->getReturnType();
- else if (Attr.Index-1 < FT->getNumParams())
- Ty = FT->getParamType(Attr.Index-1);
- else
- break; // VarArgs attributes, don't verify.
-
- VerifyAttrs(Attr.Attrs, Ty, Attr.Index == 0, V);
-
- if (Attr.Attrs & ParamAttr::Nest) {
- Assert1(!SawNest, "More than one parameter has attribute nest!", V);
- SawNest = true;
- }
-
- if (Attr.Attrs & ParamAttr::StructRet)
- Assert1(Attr.Index == 1, "Attribute sret not on first parameter!", V);
- }
-}
-
-// visitFunction - Verify that a function is ok.
-//
-void Verifier::visitFunction(Function &F) {
- // Check function arguments.
- const FunctionType *FT = F.getFunctionType();
- unsigned NumArgs = F.arg_size();
-
- Assert2(FT->getNumParams() == NumArgs,
- "# formal arguments must match # of arguments for function type!",
- &F, FT);
- Assert1(F.getReturnType()->isFirstClassType() ||
- F.getReturnType() == Type::VoidTy ||
- isa<StructType>(F.getReturnType()),
- "Functions cannot return aggregate values!", &F);
-
- Assert1(!F.hasStructRetAttr() || F.getReturnType() == Type::VoidTy,
- "Invalid struct return type!", &F);
-
- const PAListPtr &Attrs = F.getParamAttrs();
-
- Assert1(Attrs.isEmpty() ||
- Attrs.getSlot(Attrs.getNumSlots()-1).Index <= FT->getNumParams(),
- "Attributes after last parameter!", &F);
-
- // Check function attributes.
- VerifyFunctionAttrs(FT, Attrs, &F);
-
- // Check that this function meets the restrictions on this calling convention.
- switch (F.getCallingConv()) {
- default:
- break;
- case CallingConv::C:
- break;
- case CallingConv::Fast:
- case CallingConv::Cold:
- case CallingConv::X86_FastCall:
- Assert1(!F.isVarArg(),
- "Varargs functions must have C calling conventions!", &F);
- break;
- }
-
- // Check that the argument values match the function type for this function...
- unsigned i = 0;
- for (Function::arg_iterator I = F.arg_begin(), E = F.arg_end();
- I != E; ++I, ++i) {
- Assert2(I->getType() == FT->getParamType(i),
- "Argument value does not match function argument type!",
- I, FT->getParamType(i));
- // Make sure no aggregates are passed by value.
- Assert1(I->getType()->isFirstClassType(),
- "Functions cannot take aggregates as arguments by value!", I);
- }
-
- if (F.isDeclaration()) {
- Assert1(F.hasExternalLinkage() || F.hasDLLImportLinkage() ||
- F.hasExternalWeakLinkage(),
- "invalid linkage type for function declaration", &F);
- } else {
- // Verify that this function (which has a body) is not named "llvm.*". It
- // is not legal to define intrinsics.
- if (F.getName().size() >= 5)
- Assert1(F.getName().substr(0, 5) != "llvm.",
- "llvm intrinsics cannot be defined!", &F);
-
- // Check the entry node
- BasicBlock *Entry = &F.getEntryBlock();
- Assert1(pred_begin(Entry) == pred_end(Entry),
- "Entry block to function must not have predecessors!", Entry);
- }
-}
-
-
-// verifyBasicBlock - Verify that a basic block is well formed...
-//
-void Verifier::visitBasicBlock(BasicBlock &BB) {
- InstsInThisBlock.clear();
-
- // Ensure that basic blocks have terminators!
- Assert1(BB.getTerminator(), "Basic Block does not have terminator!", &BB);
-
- // Check constraints that this basic block imposes on all of the PHI nodes in
- // it.
- if (isa<PHINode>(BB.front())) {
- SmallVector<BasicBlock*, 8> Preds(pred_begin(&BB), pred_end(&BB));
- SmallVector<std::pair<BasicBlock*, Value*>, 8> Values;
- std::sort(Preds.begin(), Preds.end());
- PHINode *PN;
- for (BasicBlock::iterator I = BB.begin(); (PN = dyn_cast<PHINode>(I));++I) {
-
- // Ensure that PHI nodes have at least one entry!
- Assert1(PN->getNumIncomingValues() != 0,
- "PHI nodes must have at least one entry. If the block is dead, "
- "the PHI should be removed!", PN);
- Assert1(PN->getNumIncomingValues() == Preds.size(),
- "PHINode should have one entry for each predecessor of its "
- "parent basic block!", PN);
-
- // Get and sort all incoming values in the PHI node...
- Values.clear();
- Values.reserve(PN->getNumIncomingValues());
- for (unsigned i = 0, e = PN->getNumIncomingValues(); i != e; ++i)
- Values.push_back(std::make_pair(PN->getIncomingBlock(i),
- PN->getIncomingValue(i)));
- std::sort(Values.begin(), Values.end());
-
- for (unsigned i = 0, e = Values.size(); i != e; ++i) {
- // Check to make sure that if there is more than one entry for a
- // particular basic block in this PHI node, that the incoming values are
- // all identical.
- //
- Assert4(i == 0 || Values[i].first != Values[i-1].first ||
- Values[i].second == Values[i-1].second,
- "PHI node has multiple entries for the same basic block with "
- "different incoming values!", PN, Values[i].first,
- Values[i].second, Values[i-1].second);
-
- // Check to make sure that the predecessors and PHI node entries are
- // matched up.
- Assert3(Values[i].first == Preds[i],
- "PHI node entries do not match predecessors!", PN,
- Values[i].first, Preds[i]);
- }
- }
- }
-}
-
-void Verifier::visitTerminatorInst(TerminatorInst &I) {
- // Ensure that terminators only exist at the end of the basic block.
- Assert1(&I == I.getParent()->getTerminator(),
- "Terminator found in the middle of a basic block!", I.getParent());
- visitInstruction(I);
-}
-
-void Verifier::visitReturnInst(ReturnInst &RI) {
- Function *F = RI.getParent()->getParent();
- unsigned N = RI.getNumOperands();
- if (F->getReturnType() == Type::VoidTy)
- Assert2(N == 0,
- "Found return instr that returns void in Function of non-void "
- "return type!", &RI, F->getReturnType());
- else if (const StructType *STy = dyn_cast<StructType>(F->getReturnType())) {
- Assert2(STy->getNumElements() == N,
- "Incorrect number of return values in ret instruction!",
- &RI, F->getReturnType());
- for (unsigned i = 0; i != N; ++i)
- Assert2(STy->getElementType(i) == RI.getOperand(i)->getType(),
- "Function return type does not match operand "
- "type of return inst!", &RI, F->getReturnType());
- } else {
- Assert2(N == 1 && F->getReturnType() == RI.getOperand(0)->getType(),
- "Function return type does not match operand "
- "type of return inst!", &RI, F->getReturnType());
- }
-
- // Check to make sure that the return value has necessary properties for
- // terminators...
- visitTerminatorInst(RI);
-}
-
-void Verifier::visitSwitchInst(SwitchInst &SI) {
- // Check to make sure that all of the constants in the switch instruction
- // have the same type as the switched-on value.
- const Type *SwitchTy = SI.getCondition()->getType();
- for (unsigned i = 1, e = SI.getNumCases(); i != e; ++i)
- Assert1(SI.getCaseValue(i)->getType() == SwitchTy,
- "Switch constants must all be same type as switch value!", &SI);
-
- visitTerminatorInst(SI);
-}
-
-void Verifier::visitSelectInst(SelectInst &SI) {
- Assert1(SI.getCondition()->getType() == Type::Int1Ty,
- "Select condition type must be bool!", &SI);
- Assert1(SI.getTrueValue()->getType() == SI.getFalseValue()->getType(),
- "Select values must have identical types!", &SI);
- Assert1(SI.getTrueValue()->getType() == SI.getType(),
- "Select values must have same type as select instruction!", &SI);
- visitInstruction(SI);
-}
-
-
-/// visitUserOp1 - User defined operators shouldn't live beyond the lifetime of
-/// a pass, if any exist, it's an error.
-///
-void Verifier::visitUserOp1(Instruction &I) {
- Assert1(0, "User-defined operators should not live outside of a pass!", &I);
-}
-
-void Verifier::visitTruncInst(TruncInst &I) {
- // Get the source and destination types
- const Type *SrcTy = I.getOperand(0)->getType();
- const Type *DestTy = I.getType();
-
- // Get the size of the types in bits, we'll need this later
- unsigned SrcBitSize = SrcTy->getPrimitiveSizeInBits();
- unsigned DestBitSize = DestTy->getPrimitiveSizeInBits();
-
- Assert1(SrcTy->isInteger(), "Trunc only operates on integer", &I);
- Assert1(DestTy->isInteger(), "Trunc only produces integer", &I);
- Assert1(SrcBitSize > DestBitSize,"DestTy too big for Trunc", &I);
-
- visitInstruction(I);
-}
-
-void Verifier::visitZExtInst(ZExtInst &I) {
- // Get the source and destination types
- const Type *SrcTy = I.getOperand(0)->getType();
- const Type *DestTy = I.getType();
-
- // Get the size of the types in bits, we'll need this later
- Assert1(SrcTy->isInteger(), "ZExt only operates on integer", &I);
- Assert1(DestTy->isInteger(), "ZExt only produces an integer", &I);
- unsigned SrcBitSize = SrcTy->getPrimitiveSizeInBits();
- unsigned DestBitSize = DestTy->getPrimitiveSizeInBits();
-
- Assert1(SrcBitSize < DestBitSize,"Type too small for ZExt", &I);
-
- visitInstruction(I);
-}
-
-void Verifier::visitSExtInst(SExtInst &I) {
- // Get the source and destination types
- const Type *SrcTy = I.getOperand(0)->getType();
- const Type *DestTy = I.getType();
-
- // Get the size of the types in bits, we'll need this later
- unsigned SrcBitSize = SrcTy->getPrimitiveSizeInBits();
- unsigned DestBitSize = DestTy->getPrimitiveSizeInBits();
-
- Assert1(SrcTy->isInteger(), "SExt only operates on integer", &I);
- Assert1(DestTy->isInteger(), "SExt only produces an integer", &I);
- Assert1(SrcBitSize < DestBitSize,"Type too small for SExt", &I);
-
- visitInstruction(I);
-}
-
-void Verifier::visitFPTruncInst(FPTruncInst &I) {
- // Get the source and destination types
- const Type *SrcTy = I.getOperand(0)->getType();
- const Type *DestTy = I.getType();
- // Get the size of the types in bits, we'll need this later
- unsigned SrcBitSize = SrcTy->getPrimitiveSizeInBits();
- unsigned DestBitSize = DestTy->getPrimitiveSizeInBits();
-
- Assert1(SrcTy->isFloatingPoint(),"FPTrunc only operates on FP", &I);
- Assert1(DestTy->isFloatingPoint(),"FPTrunc only produces an FP", &I);
- Assert1(SrcBitSize > DestBitSize,"DestTy too big for FPTrunc", &I);
-
- visitInstruction(I);
-}
-
-void Verifier::visitFPExtInst(FPExtInst &I) {
- // Get the source and destination types
- const Type *SrcTy = I.getOperand(0)->getType();
- const Type *DestTy = I.getType();
-
- // Get the size of the types in bits, we'll need this later
- unsigned SrcBitSize = SrcTy->getPrimitiveSizeInBits();
- unsigned DestBitSize = DestTy->getPrimitiveSizeInBits();
-
- Assert1(SrcTy->isFloatingPoint(),"FPExt only operates on FP", &I);
- Assert1(DestTy->isFloatingPoint(),"FPExt only produces an FP", &I);
- Assert1(SrcBitSize < DestBitSize,"DestTy too small for FPExt", &I);
-
- visitInstruction(I);
-}
-
-void Verifier::visitUIToFPInst(UIToFPInst &I) {
- // Get the source and destination types
- const Type *SrcTy = I.getOperand(0)->getType();
- const Type *DestTy = I.getType();
-
- bool SrcVec = isa<VectorType>(SrcTy);
- bool DstVec = isa<VectorType>(DestTy);
-
- Assert1(SrcVec == DstVec,
- "UIToFP source and dest must both be vector or scalar", &I);
- Assert1(SrcTy->isIntOrIntVector(),
- "UIToFP source must be integer or integer vector", &I);
- Assert1(DestTy->isFPOrFPVector(),
- "UIToFP result must be FP or FP vector", &I);
-
- if (SrcVec && DstVec)
- Assert1(cast<VectorType>(SrcTy)->getNumElements() ==
- cast<VectorType>(DestTy)->getNumElements(),
- "UIToFP source and dest vector length mismatch", &I);
-
- visitInstruction(I);
-}
-
-void Verifier::visitSIToFPInst(SIToFPInst &I) {
- // Get the source and destination types
- const Type *SrcTy = I.getOperand(0)->getType();
- const Type *DestTy = I.getType();
-
- bool SrcVec = SrcTy->getTypeID() == Type::VectorTyID;
- bool DstVec = DestTy->getTypeID() == Type::VectorTyID;
-
- Assert1(SrcVec == DstVec,
- "SIToFP source and dest must both be vector or scalar", &I);
- Assert1(SrcTy->isIntOrIntVector(),
- "SIToFP source must be integer or integer vector", &I);
- Assert1(DestTy->isFPOrFPVector(),
- "SIToFP result must be FP or FP vector", &I);
-
- if (SrcVec && DstVec)
- Assert1(cast<VectorType>(SrcTy)->getNumElements() ==
- cast<VectorType>(DestTy)->getNumElements(),
- "SIToFP source and dest vector length mismatch", &I);
-
- visitInstruction(I);
-}
-
-void Verifier::visitFPToUIInst(FPToUIInst &I) {
- // Get the source and destination types
- const Type *SrcTy = I.getOperand(0)->getType();
- const Type *DestTy = I.getType();
-
- bool SrcVec = isa<VectorType>(SrcTy);
- bool DstVec = isa<VectorType>(DestTy);
-
- Assert1(SrcVec == DstVec,
- "FPToUI source and dest must both be vector or scalar", &I);
- Assert1(SrcTy->isFPOrFPVector(), "FPToUI source must be FP or FP vector", &I);
- Assert1(DestTy->isIntOrIntVector(),
- "FPToUI result must be integer or integer vector", &I);
-
- if (SrcVec && DstVec)
- Assert1(cast<VectorType>(SrcTy)->getNumElements() ==
- cast<VectorType>(DestTy)->getNumElements(),
- "FPToUI source and dest vector length mismatch", &I);
-
- visitInstruction(I);
-}
-
-void Verifier::visitFPToSIInst(FPToSIInst &I) {
- // Get the source and destination types
- const Type *SrcTy = I.getOperand(0)->getType();
- const Type *DestTy = I.getType();
-
- bool SrcVec = isa<VectorType>(SrcTy);
- bool DstVec = isa<VectorType>(DestTy);
-
- Assert1(SrcVec == DstVec,
- "FPToSI source and dest must both be vector or scalar", &I);
- Assert1(SrcTy->isFPOrFPVector(),
- "FPToSI source must be FP or FP vector", &I);
- Assert1(DestTy->isIntOrIntVector(),
- "FPToSI result must be integer or integer vector", &I);
-
- if (SrcVec && DstVec)
- Assert1(cast<VectorType>(SrcTy)->getNumElements() ==
- cast<VectorType>(DestTy)->getNumElements(),
- "FPToSI source and dest vector length mismatch", &I);
-
- visitInstruction(I);
-}
-
-void Verifier::visitPtrToIntInst(PtrToIntInst &I) {
- // Get the source and destination types
- const Type *SrcTy = I.getOperand(0)->getType();
- const Type *DestTy = I.getType();
-
- Assert1(isa<PointerType>(SrcTy), "PtrToInt source must be pointer", &I);
- Assert1(DestTy->isInteger(), "PtrToInt result must be integral", &I);
-
- visitInstruction(I);
-}
-
-void Verifier::visitIntToPtrInst(IntToPtrInst &I) {
- // Get the source and destination types
- const Type *SrcTy = I.getOperand(0)->getType();
- const Type *DestTy = I.getType();
-
- Assert1(SrcTy->isInteger(), "IntToPtr source must be an integral", &I);
- Assert1(isa<PointerType>(DestTy), "IntToPtr result must be a pointer",&I);
-
- visitInstruction(I);
-}
-
-void Verifier::visitBitCastInst(BitCastInst &I) {
- // Get the source and destination types
- const Type *SrcTy = I.getOperand(0)->getType();
- const Type *DestTy = I.getType();
-
- // Get the size of the types in bits, we'll need this later
- unsigned SrcBitSize = SrcTy->getPrimitiveSizeInBits();
- unsigned DestBitSize = DestTy->getPrimitiveSizeInBits();
-
- // BitCast implies a no-op cast of type only. No bits change.
- // However, you can't cast pointers to anything but pointers.
- Assert1(isa<PointerType>(DestTy) == isa<PointerType>(DestTy),
- "Bitcast requires both operands to be pointer or neither", &I);
- Assert1(SrcBitSize == DestBitSize, "Bitcast requies types of same width", &I);
-
- visitInstruction(I);
-}
-
-/// visitPHINode - Ensure that a PHI node is well formed.
-///
-void Verifier::visitPHINode(PHINode &PN) {
- // Ensure that the PHI nodes are all grouped together at the top of the block.
- // This can be tested by checking whether the instruction before this is
- // either nonexistent (because this is begin()) or is a PHI node. If not,
- // then there is some other instruction before a PHI.
- Assert2(&PN == &PN.getParent()->front() ||
- isa<PHINode>(--BasicBlock::iterator(&PN)),
- "PHI nodes not grouped at top of basic block!",
- &PN, PN.getParent());
-
- // Check that all of the operands of the PHI node have the same type as the
- // result.
- for (unsigned i = 0, e = PN.getNumIncomingValues(); i != e; ++i)
- Assert1(PN.getType() == PN.getIncomingValue(i)->getType(),
- "PHI node operands are not the same type as the result!", &PN);
-
- // All other PHI node constraints are checked in the visitBasicBlock method.
-
- visitInstruction(PN);
-}
-
-void Verifier::VerifyCallSite(CallSite CS) {
- Instruction *I = CS.getInstruction();
-
- Assert1(isa<PointerType>(CS.getCalledValue()->getType()),
- "Called function must be a pointer!", I);
- const PointerType *FPTy = cast<PointerType>(CS.getCalledValue()->getType());
- Assert1(isa<FunctionType>(FPTy->getElementType()),
- "Called function is not pointer to function type!", I);
-
- const FunctionType *FTy = cast<FunctionType>(FPTy->getElementType());
-
- // Verify that the correct number of arguments are being passed
- if (FTy->isVarArg())
- Assert1(CS.arg_size() >= FTy->getNumParams(),
- "Called function requires more parameters than were provided!",I);
- else
- Assert1(CS.arg_size() == FTy->getNumParams(),
- "Incorrect number of arguments passed to called function!", I);
-
- // Verify that all arguments to the call match the function type...
- for (unsigned i = 0, e = FTy->getNumParams(); i != e; ++i)
- Assert3(CS.getArgument(i)->getType() == FTy->getParamType(i),
- "Call parameter type does not match function signature!",
- CS.getArgument(i), FTy->getParamType(i), I);
-
- const PAListPtr &Attrs = CS.getParamAttrs();
-
- Assert1(Attrs.isEmpty() ||
- Attrs.getSlot(Attrs.getNumSlots()-1).Index <= CS.arg_size(),
- "Attributes after last parameter!", I);
-
- // Verify call attributes.
- VerifyFunctionAttrs(FTy, Attrs, I);
-
- if (FTy->isVarArg())
- // Check attributes on the varargs part.
- for (unsigned Idx = 1 + FTy->getNumParams(); Idx <= CS.arg_size(); ++Idx) {
- ParameterAttributes Attr = Attrs.getParamAttrs(Idx);
-
- VerifyAttrs(Attr, CS.getArgument(Idx-1)->getType(), false, I);
-
- ParameterAttributes VArgI = Attr & ParamAttr::VarArgsIncompatible;
- Assert1(!VArgI, "Attribute " + ParamAttr::getAsString(VArgI) +
- "cannot be used for vararg call arguments!", I);
- }
-
- visitInstruction(*I);
-}
-
-void Verifier::visitCallInst(CallInst &CI) {
- VerifyCallSite(&CI);
-
- if (Function *F = CI.getCalledFunction()) {
- if (Intrinsic::ID ID = (Intrinsic::ID)F->getIntrinsicID())
- visitIntrinsicFunctionCall(ID, CI);
- }
-}
-
-void Verifier::visitInvokeInst(InvokeInst &II) {
- VerifyCallSite(&II);
-}
-
-/// visitBinaryOperator - Check that both arguments to the binary operator are
-/// of the same type!
-///
-void Verifier::visitBinaryOperator(BinaryOperator &B) {
- Assert1(B.getOperand(0)->getType() == B.getOperand(1)->getType(),
- "Both operands to a binary operator are not of the same type!", &B);
-
- switch (B.getOpcode()) {
- // Check that logical operators are only used with integral operands.
- case Instruction::And:
- case Instruction::Or:
- case Instruction::Xor:
- Assert1(B.getType()->isInteger() ||
- (isa<VectorType>(B.getType()) &&
- cast<VectorType>(B.getType())->getElementType()->isInteger()),
- "Logical operators only work with integral types!", &B);
- Assert1(B.getType() == B.getOperand(0)->getType(),
- "Logical operators must have same type for operands and result!",
- &B);
- break;
- case Instruction::Shl:
- case Instruction::LShr:
- case Instruction::AShr:
- Assert1(B.getType()->isInteger(),
- "Shift must return an integer result!", &B);
- Assert1(B.getType() == B.getOperand(0)->getType(),
- "Shift return type must be same as operands!", &B);
- /* FALL THROUGH */
- default:
- // Arithmetic operators only work on integer or fp values
- Assert1(B.getType() == B.getOperand(0)->getType(),
- "Arithmetic operators must have same type for operands and result!",
- &B);
- Assert1(B.getType()->isInteger() || B.getType()->isFloatingPoint() ||
- isa<VectorType>(B.getType()),
- "Arithmetic operators must have integer, fp, or vector type!", &B);
- break;
- }
-
- visitInstruction(B);
-}
-
-void Verifier::visitICmpInst(ICmpInst& IC) {
- // Check that the operands are the same type
- const Type* Op0Ty = IC.getOperand(0)->getType();
- const Type* Op1Ty = IC.getOperand(1)->getType();
- Assert1(Op0Ty == Op1Ty,
- "Both operands to ICmp instruction are not of the same type!", &IC);
- // Check that the operands are the right type
- Assert1(Op0Ty->isInteger() || isa<PointerType>(Op0Ty),
- "Invalid operand types for ICmp instruction", &IC);
- visitInstruction(IC);
-}
-
-void Verifier::visitFCmpInst(FCmpInst& FC) {
- // Check that the operands are the same type
- const Type* Op0Ty = FC.getOperand(0)->getType();
- const Type* Op1Ty = FC.getOperand(1)->getType();
- Assert1(Op0Ty == Op1Ty,
- "Both operands to FCmp instruction are not of the same type!", &FC);
- // Check that the operands are the right type
- Assert1(Op0Ty->isFloatingPoint(),
- "Invalid operand types for FCmp instruction", &FC);
- visitInstruction(FC);
-}
-
-void Verifier::visitExtractElementInst(ExtractElementInst &EI) {
- Assert1(ExtractElementInst::isValidOperands(EI.getOperand(0),
- EI.getOperand(1)),
- "Invalid extractelement operands!", &EI);
- visitInstruction(EI);
-}
-
-void Verifier::visitInsertElementInst(InsertElementInst &IE) {
- Assert1(InsertElementInst::isValidOperands(IE.getOperand(0),
- IE.getOperand(1),
- IE.getOperand(2)),
- "Invalid insertelement operands!", &IE);
- visitInstruction(IE);
-}
-
-void Verifier::visitShuffleVectorInst(ShuffleVectorInst &SV) {
- Assert1(ShuffleVectorInst::isValidOperands(SV.getOperand(0), SV.getOperand(1),
- SV.getOperand(2)),
- "Invalid shufflevector operands!", &SV);
- Assert1(SV.getType() == SV.getOperand(0)->getType(),
- "Result of shufflevector must match first operand type!", &SV);
-
- // Check to see if Mask is valid.
- if (const ConstantVector *MV = dyn_cast<ConstantVector>(SV.getOperand(2))) {
- for (unsigned i = 0, e = MV->getNumOperands(); i != e; ++i) {
- Assert1(isa<ConstantInt>(MV->getOperand(i)) ||
- isa<UndefValue>(MV->getOperand(i)),
- "Invalid shufflevector shuffle mask!", &SV);
- }
- } else {
- Assert1(isa<UndefValue>(SV.getOperand(2)) ||
- isa<ConstantAggregateZero>(SV.getOperand(2)),
- "Invalid shufflevector shuffle mask!", &SV);
- }
-
- visitInstruction(SV);
-}
-
-void Verifier::visitGetElementPtrInst(GetElementPtrInst &GEP) {
- SmallVector<Value*, 16> Idxs(GEP.idx_begin(), GEP.idx_end());
- const Type *ElTy =
- GetElementPtrInst::getIndexedType(GEP.getOperand(0)->getType(),
- Idxs.begin(), Idxs.end(), true);
- Assert1(ElTy, "Invalid indices for GEP pointer type!", &GEP);
- Assert2(isa<PointerType>(GEP.getType()) &&
- cast<PointerType>(GEP.getType())->getElementType() == ElTy,
- "GEP is not of right type for indices!", &GEP, ElTy);
- visitInstruction(GEP);
-}
-
-void Verifier::visitLoadInst(LoadInst &LI) {
- const Type *ElTy =
- cast<PointerType>(LI.getOperand(0)->getType())->getElementType();
- Assert2(ElTy == LI.getType(),
- "Load result type does not match pointer operand type!", &LI, ElTy);
- visitInstruction(LI);
-}
-
-void Verifier::visitStoreInst(StoreInst &SI) {
- const Type *ElTy =
- cast<PointerType>(SI.getOperand(1)->getType())->getElementType();
- Assert2(ElTy == SI.getOperand(0)->getType(),
- "Stored value type does not match pointer operand type!", &SI, ElTy);
- visitInstruction(SI);
-}
-
-void Verifier::visitAllocationInst(AllocationInst &AI) {
- const PointerType *PTy = AI.getType();
- Assert1(PTy->getAddressSpace() == 0,
- "Allocation instruction pointer not in the generic address space!",
- &AI);
- Assert1(PTy->getElementType()->isSized(), "Cannot allocate unsized type",
- &AI);
- visitInstruction(AI);
-}
-
-void Verifier::visitGetResultInst(GetResultInst &GRI) {
- Assert1(GetResultInst::isValidOperands(GRI.getAggregateValue(),
- GRI.getIndex()),
- "Invalid GetResultInst operands!", &GRI);
- Assert1(isa<CallInst>(GRI.getAggregateValue()) ||
- isa<InvokeInst>(GRI.getAggregateValue()) ||
- isa<UndefValue>(GRI.getAggregateValue()),
- "GetResultInst operand must be a call/invoke/undef!", &GRI);
-
- visitInstruction(GRI);
-}
-
-
-/// verifyInstruction - Verify that an instruction is well formed.
-///
-void Verifier::visitInstruction(Instruction &I) {
- BasicBlock *BB = I.getParent();
- Assert1(BB, "Instruction not embedded in basic block!", &I);
-
- if (!isa<PHINode>(I)) { // Check that non-phi nodes are not self referential
- for (Value::use_iterator UI = I.use_begin(), UE = I.use_end();
- UI != UE; ++UI)
- Assert1(*UI != (User*)&I ||
- !DT->dominates(&BB->getParent()->getEntryBlock(), BB),
- "Only PHI nodes may reference their own value!", &I);
- }
-
- // Verify that if this is a terminator that it is at the end of the block.
- if (isa<TerminatorInst>(I))
- Assert1(BB->getTerminator() == &I, "Terminator not at end of block!", &I);
-
-
- // Check that void typed values don't have names
- Assert1(I.getType() != Type::VoidTy || !I.hasName(),
- "Instruction has a name, but provides a void value!", &I);
-
- // Check that the return value of the instruction is either void or a legal
- // value type.
- Assert1(I.getType() == Type::VoidTy || I.getType()->isFirstClassType()
- || ((isa<CallInst>(I) || isa<InvokeInst>(I))
- && isa<StructType>(I.getType())),
- "Instruction returns a non-scalar type!", &I);
-
- // Check that all uses of the instruction, if they are instructions
- // themselves, actually have parent basic blocks. If the use is not an
- // instruction, it is an error!
- for (User::use_iterator UI = I.use_begin(), UE = I.use_end();
- UI != UE; ++UI) {
- Assert1(isa<Instruction>(*UI), "Use of instruction is not an instruction!",
- *UI);
- Instruction *Used = cast<Instruction>(*UI);
- Assert2(Used->getParent() != 0, "Instruction referencing instruction not"
- " embeded in a basic block!", &I, Used);
- }
-
- for (unsigned i = 0, e = I.getNumOperands(); i != e; ++i) {
- Assert1(I.getOperand(i) != 0, "Instruction has null operand!", &I);
-
- // Check to make sure that only first-class-values are operands to
- // instructions.
- if (!I.getOperand(i)->getType()->isFirstClassType()) {
- if (isa<ReturnInst>(I) || isa<GetResultInst>(I))
- Assert1(isa<StructType>(I.getOperand(i)->getType()),
- "Invalid ReturnInst operands!", &I);
- else if (isa<CallInst>(I) || isa<InvokeInst>(I)) {
- if (const PointerType *PT = dyn_cast<PointerType>
- (I.getOperand(i)->getType())) {
- const Type *ETy = PT->getElementType();
- Assert1(isa<StructType>(ETy), "Invalid CallInst operands!", &I);
- }
- else
- Assert1(0, "Invalid CallInst operands!", &I);
- }
- else
- Assert1(0, "Instruction operands must be first-class values!", &I);
- }
-
- if (Function *F = dyn_cast<Function>(I.getOperand(i))) {
- // Check to make sure that the "address of" an intrinsic function is never
- // taken.
- Assert1(!F->isIntrinsic() || (i == 0 && isa<CallInst>(I)),
- "Cannot take the address of an intrinsic!", &I);
- Assert1(F->getParent() == Mod, "Referencing function in another module!",
- &I);
- } else if (BasicBlock *OpBB = dyn_cast<BasicBlock>(I.getOperand(i))) {
- Assert1(OpBB->getParent() == BB->getParent(),
- "Referring to a basic block in another function!", &I);
- } else if (Argument *OpArg = dyn_cast<Argument>(I.getOperand(i))) {
- Assert1(OpArg->getParent() == BB->getParent(),
- "Referring to an argument in another function!", &I);
- } else if (GlobalValue *GV = dyn_cast<GlobalValue>(I.getOperand(i))) {
- Assert1(GV->getParent() == Mod, "Referencing global in another module!",
- &I);
- } else if (Instruction *Op = dyn_cast<Instruction>(I.getOperand(i))) {
- BasicBlock *OpBlock = Op->getParent();
-
- // Check that a definition dominates all of its uses.
- if (!isa<PHINode>(I)) {
- // Invoke results are only usable in the normal destination, not in the
- // exceptional destination.
- if (InvokeInst *II = dyn_cast<InvokeInst>(Op)) {
- OpBlock = II->getNormalDest();
-
- Assert2(OpBlock != II->getUnwindDest(),
- "No uses of invoke possible due to dominance structure!",
- Op, II);
-
- // If the normal successor of an invoke instruction has multiple
- // predecessors, then the normal edge from the invoke is critical, so
- // the invoke value can only be live if the destination block
- // dominates all of it's predecessors (other than the invoke) or if
- // the invoke value is only used by a phi in the successor.
- if (!OpBlock->getSinglePredecessor() &&
- DT->dominates(&BB->getParent()->getEntryBlock(), BB)) {
- // The first case we allow is if the use is a PHI operand in the
- // normal block, and if that PHI operand corresponds to the invoke's
- // block.
- bool Bad = true;
- if (PHINode *PN = dyn_cast<PHINode>(&I))
- if (PN->getParent() == OpBlock &&
- PN->getIncomingBlock(i/2) == Op->getParent())
- Bad = false;
-
- // If it is used by something non-phi, then the other case is that
- // 'OpBlock' dominates all of its predecessors other than the
- // invoke. In this case, the invoke value can still be used.
- if (Bad) {
- Bad = false;
- for (pred_iterator PI = pred_begin(OpBlock),
- E = pred_end(OpBlock); PI != E; ++PI) {
- if (*PI != II->getParent() && !DT->dominates(OpBlock, *PI)) {
- Bad = true;
- break;
- }
- }
- }
- Assert2(!Bad,
- "Invoke value defined on critical edge but not dead!", &I,
- Op);
- }
- } else if (OpBlock == BB) {
- // If they are in the same basic block, make sure that the definition
- // comes before the use.
- Assert2(InstsInThisBlock.count(Op) ||
- !DT->dominates(&BB->getParent()->getEntryBlock(), BB),
- "Instruction does not dominate all uses!", Op, &I);
- }
-
- // Definition must dominate use unless use is unreachable!
- Assert2(DT->dominates(Op, &I) ||
- !DT->dominates(&BB->getParent()->getEntryBlock(), BB),
- "Instruction does not dominate all uses!", Op, &I);
- } else {
- // PHI nodes are more difficult than other nodes because they actually
- // "use" the value in the predecessor basic blocks they correspond to.
- BasicBlock *PredBB = cast<BasicBlock>(I.getOperand(i+1));
- Assert2(DT->dominates(OpBlock, PredBB) ||
- !DT->dominates(&BB->getParent()->getEntryBlock(), PredBB),
- "Instruction does not dominate all uses!", Op, &I);
- }
- } else if (isa<InlineAsm>(I.getOperand(i))) {
- Assert1(i == 0 && (isa<CallInst>(I) || isa<InvokeInst>(I)),
- "Cannot take the address of an inline asm!", &I);
- }
- }
- InstsInThisBlock.insert(&I);
-}
-
-/// visitIntrinsicFunction - Allow intrinsics to be verified in different ways.
-///
-void Verifier::visitIntrinsicFunctionCall(Intrinsic::ID ID, CallInst &CI) {
- Function *IF = CI.getCalledFunction();
- Assert1(IF->isDeclaration(), "Intrinsic functions should never be defined!",
- IF);
-
-#define GET_INTRINSIC_VERIFIER
-#include "llvm/Intrinsics.gen"
-#undef GET_INTRINSIC_VERIFIER
-
- switch (ID) {
- default:
- break;
- case Intrinsic::gcroot:
- case Intrinsic::gcwrite:
- case Intrinsic::gcread: {
- Type *PtrTy = PointerType::getUnqual(Type::Int8Ty),
- *PtrPtrTy = PointerType::getUnqual(PtrTy);
-
- switch (ID) {
- default:
- break;
- case Intrinsic::gcroot:
- Assert1(CI.getOperand(1)->getType() == PtrPtrTy,
- "Intrinsic parameter #1 is not i8**.", &CI);
- Assert1(CI.getOperand(2)->getType() == PtrTy,
- "Intrinsic parameter #2 is not i8*.", &CI);
- Assert1(isa<AllocaInst>(CI.getOperand(1)->stripPointerCasts()),
- "llvm.gcroot parameter #1 must be an alloca.", &CI);
- Assert1(isa<Constant>(CI.getOperand(2)),
- "llvm.gcroot parameter #2 must be a constant.", &CI);
- break;
- case Intrinsic::gcwrite:
- Assert1(CI.getOperand(1)->getType() == PtrTy,
- "Intrinsic parameter #1 is not a i8*.", &CI);
- Assert1(CI.getOperand(2)->getType() == PtrTy,
- "Intrinsic parameter #2 is not a i8*.", &CI);
- Assert1(CI.getOperand(3)->getType() == PtrPtrTy,
- "Intrinsic parameter #3 is not a i8**.", &CI);
- break;
- case Intrinsic::gcread:
- Assert1(CI.getOperand(1)->getType() == PtrTy,
- "Intrinsic parameter #1 is not a i8*.", &CI);
- Assert1(CI.getOperand(2)->getType() == PtrPtrTy,
- "Intrinsic parameter #2 is not a i8**.", &CI);
- break;
- }
-
- Assert1(CI.getParent()->getParent()->hasCollector(),
- "Enclosing function does not specify a collector algorithm.",
- &CI);
- } break;
- case Intrinsic::init_trampoline:
- Assert1(isa<Function>(CI.getOperand(2)->stripPointerCasts()),
- "llvm.init_trampoline parameter #2 must resolve to a function.",
- &CI);
- break;
- }
-}
-
-/// VerifyIntrinsicPrototype - TableGen emits calls to this function into
-/// Intrinsics.gen. This implements a little state machine that verifies the
-/// prototype of intrinsics.
-void Verifier::VerifyIntrinsicPrototype(Intrinsic::ID ID,
- Function *F,
- unsigned Count, ...) {
- va_list VA;
- va_start(VA, Count);
-
- const FunctionType *FTy = F->getFunctionType();
-
- // For overloaded intrinsics, the Suffix of the function name must match the
- // types of the arguments. This variable keeps track of the expected
- // suffix, to be checked at the end.
- std::string Suffix;
-
- if (FTy->getNumParams() + FTy->isVarArg() != Count - 1) {
- CheckFailed("Intrinsic prototype has incorrect number of arguments!", F);
- return;
- }
-
- // Note that "arg#0" is the return type.
- for (unsigned ArgNo = 0; ArgNo < Count; ++ArgNo) {
- MVT::ValueType VT = va_arg(VA, MVT::ValueType);
-
- if (VT == MVT::isVoid && ArgNo > 0) {
- if (!FTy->isVarArg())
- CheckFailed("Intrinsic prototype has no '...'!", F);
- break;
- }
-
- const Type *Ty;
- if (ArgNo == 0)
- Ty = FTy->getReturnType();
- else
- Ty = FTy->getParamType(ArgNo-1);
-
- unsigned NumElts = 0;
- const Type *EltTy = Ty;
- if (const VectorType *VTy = dyn_cast<VectorType>(Ty)) {
- EltTy = VTy->getElementType();
- NumElts = VTy->getNumElements();
- }
-
- if ((int)VT < 0) {
- int Match = ~VT;
- if (Match == 0) {
- if (Ty != FTy->getReturnType()) {
- CheckFailed("Intrinsic parameter #" + utostr(ArgNo-1) + " does not "
- "match return type.", F);
- break;
- }
- } else {
- if (Ty != FTy->getParamType(Match-1)) {
- CheckFailed("Intrinsic parameter #" + utostr(ArgNo-1) + " does not "
- "match parameter %" + utostr(Match-1) + ".", F);
- break;
- }
- }
- } else if (VT == MVT::iAny) {
- if (!EltTy->isInteger()) {
- if (ArgNo == 0)
- CheckFailed("Intrinsic result type is not "
- "an integer type.", F);
- else
- CheckFailed("Intrinsic parameter #" + utostr(ArgNo-1) + " is not "
- "an integer type.", F);
- break;
- }
- unsigned GotBits = cast<IntegerType>(EltTy)->getBitWidth();
- Suffix += ".";
- if (EltTy != Ty)
- Suffix += "v" + utostr(NumElts);
- Suffix += "i" + utostr(GotBits);;
- // Check some constraints on various intrinsics.
- switch (ID) {
- default: break; // Not everything needs to be checked.
- case Intrinsic::bswap:
- if (GotBits < 16 || GotBits % 16 != 0)
- CheckFailed("Intrinsic requires even byte width argument", F);
- break;
- }
- } else if (VT == MVT::fAny) {
- if (!EltTy->isFloatingPoint()) {
- if (ArgNo == 0)
- CheckFailed("Intrinsic result type is not "
- "a floating-point type.", F);
- else
- CheckFailed("Intrinsic parameter #" + utostr(ArgNo-1) + " is not "
- "a floating-point type.", F);
- break;
- }
- Suffix += ".";
- if (EltTy != Ty)
- Suffix += "v" + utostr(NumElts);
- Suffix += MVT::getValueTypeString(MVT::getValueType(EltTy));
- } else if (VT == MVT::iPTR) {
- if (!isa<PointerType>(Ty)) {
- if (ArgNo == 0)
- CheckFailed("Intrinsic result type is not a "
- "pointer and a pointer is required.", F);
- else
- CheckFailed("Intrinsic parameter #" + utostr(ArgNo-1) + " is not a "
- "pointer and a pointer is required.", F);
- break;
- }
- } else if (MVT::isVector(VT)) {
- // If this is a vector argument, verify the number and type of elements.
- if (MVT::getVectorElementType(VT) != MVT::getValueType(EltTy)) {
- CheckFailed("Intrinsic prototype has incorrect vector element type!",
- F);
- break;
- }
- if (MVT::getVectorNumElements(VT) != NumElts) {
- CheckFailed("Intrinsic prototype has incorrect number of "
- "vector elements!",F);
- break;
- }
- } else if (MVT::getTypeForValueType(VT) != EltTy) {
- if (ArgNo == 0)
- CheckFailed("Intrinsic prototype has incorrect result type!", F);
- else
- CheckFailed("Intrinsic parameter #" + utostr(ArgNo-1) + " is wrong!",F);
- break;
- } else if (EltTy != Ty) {
- if (ArgNo == 0)
- CheckFailed("Intrinsic result type is vector "
- "and a scalar is required.", F);
- else
- CheckFailed("Intrinsic parameter #" + utostr(ArgNo-1) + " is vector "
- "and a scalar is required.", F);
- }
- }
-
- va_end(VA);
-
- // If we computed a Suffix then the intrinsic is overloaded and we need to
- // make sure that the name of the function is correct. We add the suffix to
- // the name of the intrinsic and compare against the given function name. If
- // they are not the same, the function name is invalid. This ensures that
- // overloading of intrinsics uses a sane and consistent naming convention.
- if (!Suffix.empty()) {
- std::string Name(Intrinsic::getName(ID));
- if (Name + Suffix != F->getName())
- CheckFailed("Overloaded intrinsic has incorrect suffix: '" +
- F->getName().substr(Name.length()) + "'. It should be '" +
- Suffix + "'", F);
- }
-
- // Check parameter attributes.
- Assert1(F->getParamAttrs() == Intrinsic::getParamAttrs(ID),
- "Intrinsic has wrong parameter attributes!", F);
-}
-
-
-//===----------------------------------------------------------------------===//
-// Implement the public interfaces to this file...
-//===----------------------------------------------------------------------===//
-
-FunctionPass *llvm::createVerifierPass(VerifierFailureAction action) {
- return new Verifier(action);
-}
-
-
-// verifyFunction - Create
-bool llvm::verifyFunction(const Function &f, VerifierFailureAction action) {
- Function &F = const_cast<Function&>(f);
- assert(!F.isDeclaration() && "Cannot verify external functions");
-
- FunctionPassManager FPM(new ExistingModuleProvider(F.getParent()));
- Verifier *V = new Verifier(action);
- FPM.add(V);
- FPM.run(F);
- return V->Broken;
-}
-
-/// verifyModule - Check a module for errors, printing messages on stderr.
-/// Return true if the module is corrupt.
-///
-bool llvm::verifyModule(const Module &M, VerifierFailureAction action,
- std::string *ErrorInfo) {
- PassManager PM;
- Verifier *V = new Verifier(action);
- PM.add(V);
- PM.run((Module&)M);
-
- if (ErrorInfo && V->Broken)
- *ErrorInfo = V->msgs.str();
- return V->Broken;
-}
-
-// vim: sw=2
diff --git a/release_23/llvm.spec.in b/release_23/llvm.spec.in
deleted file mode 100644
index 9284d65d0077..000000000000
--- a/release_23/llvm.spec.in
+++ /dev/null
@@ -1,67 +0,0 @@
-Name: @PACKAGE_NAME@
-Version: @PACKAGE_VERSION@
-Release: 0
-Summary: The Low Level Virtual Machine (An Optimizing Compiler Infrastructure)
-License: University of Illinois/NCSA Open Source License
-Vendor: None (open source)
-Group: Development/Compilers
-URL: http://llvm..org/
-Source: http://llvm.org/releases/@PACKAGE_VERSION@/@PACKAGE_NAME@-@PACKAGE_VERSION@.tar.gz
-BuildRoot: %{_tmppath}/%{name}-root
-Requires: /sbin/ldconfig
-BuildRequires: gcc >= 3.4
-
-%description
-LLVM is a compiler infrastructure designed for compile-time, link-time, runtime,
-and idle-time optimization of programs from arbitrary programming languages.
-LLVM is written in C++ and has been developed since 2000 at the University of
-Illinois and Apple. It currently supports compilation of C and C++ programs,
-using front-ends derived from GCC 4.0.1. A new front-end for the C family of
-languages is in development. The compiler infrastructure
-includes mirror sets of programming tools as well as libraries with equivalent
-functionality.
-
-%prep
-%setup -q -n @PACKAGE_NAME@-@PACKAGE_VERSION@
-
-%build
-./configure \
---prefix=%{_prefix} \
---bindir=%{_bindir} \
---datadir=%{_datadir} \
---includedir=%{_includedir} \
---libdir=%{_libdir} \
---enable-optimized \
---enable-assertions
-make tools-only
-
-%install
-rm -rf %{buildroot}
-make install DESTDIR=%{buildroot}
-
-%clean
-rm -rf %{buildroot}
-
-%post -p /sbin/ldconfig
-
-%postun -p /sbin/ldconfig
-
-%files
-%defattr(-, root, root)
-%doc CREDITS.TXT LICENSE.TXT README.txt docs/*.{html,css,gif,jpg} docs/CommandGuide
-%{_bindir}/*
-%{_libdir}/*.o
-%{_libdir}/*.a
-%{_libdir}/*.so
-%{_includedir}/llvm
-
-%changelog
-* Fri Aug 04 2006 Reid Spencer
-- Updates for release 1.8
-* Fri Apr 07 2006 Reid Spencer
-- Make the build be optimized+assertions
-* Fri May 13 2005 Reid Spencer
-- Minor adjustments for the 1.5 release
-* Mon Feb 09 2003 Brian R. Gaeke
-- Initial working version of RPM spec file.
-
diff --git a/release_23/projects/Makefile b/release_23/projects/Makefile
deleted file mode 100644
index b6228b87f912..000000000000
--- a/release_23/projects/Makefile
+++ /dev/null
@@ -1,20 +0,0 @@
-##===- projects/Makefile ------------------------------*- Makefile -*-===##
-#
-# The LLVM Compiler Infrastructure
-#
-# This file is distributed under the University of Illinois Open Source
-# License. See LICENSE.TXT for details.
-#
-##===----------------------------------------------------------------------===##
-LEVEL=..
-
-include $(LEVEL)/Makefile.config
-
-DIRS:= $(filter-out llvm-test,$(patsubst $(PROJ_SRC_DIR)/%/Makefile,%,$(wildcard $(PROJ_SRC_DIR)/*/Makefile)))
-
-# Sparc cannot link shared libraries (libtool problem?)
-ifeq ($(ARCH), Sparc)
-DIRS := $(filter-out sample, $(DIRS))
-endif
-
-include $(PROJ_SRC_ROOT)/Makefile.rules
diff --git a/release_23/projects/sample/Makefile b/release_23/projects/sample/Makefile
deleted file mode 100644
index f96f1aba2ed3..000000000000
--- a/release_23/projects/sample/Makefile
+++ /dev/null
@@ -1,18 +0,0 @@
-##===- projects/sample/Makefile ----------------------------*- Makefile -*-===##
-#
-# This is a sample Makefile for a project that uses LLVM.
-#
-##===----------------------------------------------------------------------===##
-
-#
-# Indicates our relative path to the top of the project's root directory.
-#
-LEVEL = .
-DIRS = lib tools
-EXTRA_DIST = include
-
-#
-# Include the Master Makefile that knows how to build all.
-#
-include $(LEVEL)/Makefile.common
-
diff --git a/release_23/projects/sample/Makefile.common.in b/release_23/projects/sample/Makefile.common.in
deleted file mode 100644
index 2b3025bd011e..000000000000
--- a/release_23/projects/sample/Makefile.common.in
+++ /dev/null
@@ -1,22 +0,0 @@
-# Set the name of the project here
-PROJECT_NAME := sample
-PROJ_VERSION := 0.9
-
-# Set this variable to the top of the LLVM source tree.
-LLVM_SRC_ROOT = @LLVM_SRC@
-
-# Set this variable to the top level directory where LLVM was built
-# (this is *not* the same as OBJ_ROOT as defined in LLVM's Makefile.config).
-LLVM_OBJ_ROOT = @LLVM_OBJ@
-
-# Set the directory root of this project's source files
-PROJ_SRC_ROOT := $(subst //,/,@abs_top_srcdir@)
-
-# Set the root directory of this project's object files
-PROJ_OBJ_ROOT := $(subst //,/,@abs_top_objdir@)
-
-# Set the root directory of this project's install prefix
-PROJ_INSTALL_ROOT := @prefix@
-
-# Include LLVM's Master Makefile.
-include $(LLVM_OBJ_ROOT)/Makefile.common
diff --git a/release_23/projects/sample/autoconf/AutoRegen.sh b/release_23/projects/sample/autoconf/AutoRegen.sh
deleted file mode 100755
index c9cc905cd09e..000000000000
--- a/release_23/projects/sample/autoconf/AutoRegen.sh
+++ /dev/null
@@ -1,52 +0,0 @@
-#!/bin/sh
-die () {
- echo "$@" 1>&2
- exit 1
-}
-test -d autoconf && test -f autoconf/configure.ac && cd autoconf
-test -f configure.ac || die "Can't find 'autoconf' dir; please cd into it first"
-autoconf --version | egrep '2\.5[0-9]' > /dev/null
-if test $? -ne 0 ; then
- die "Your autoconf was not detected as being 2.5x"
-fi
-cwd=`pwd`
-if test -d ../../../autoconf/m4 ; then
- cd ../../../autoconf/m4
- llvm_m4=`pwd`
- llvm_src_root=../../..
- llvm_obj_root=../../..
- cd $cwd
-elif test -d ../../llvm/autoconf/m4 ; then
- cd ../../llvm/autoconf/m4
- llvm_m4=`pwd`
- llvm_src_root=../..
- llvm_obj_root=../..
- cd $cwd
-else
- while true ; do
- echo "LLVM source root not found."
- read -p "Enter full path to LLVM source:"
- if test -d "$REPLY/autoconf/m4" ; then
- llvm_src_root="$REPLY"
- llvm_m4="$REPLY/autoconf/m4"
- read -p "Enter full path to LLVM objects (empty for same as source):"
- if test -d "$REPLY" ; then
- llvm_obj_root="$REPLY"
- else
- llvm_obj_root="$llvm_src_root"
- fi
- break
- fi
- done
-fi
-# Patch the LLVM_ROOT in configure.ac, if it needs it
-cp configure.ac configure.bak
-sed -e "s#^LLVM_SRC_ROOT=.*#LLVM_SRC_ROOT=\"$llvm_src_root\"#" \
- -e "s#^LLVM_OBJ_ROOT=.*#LLVM_OBJ_ROOT=\"$llvm_obj_root\"#" configure.bak > configure.ac
-echo "Regenerating aclocal.m4 with aclocal"
-rm -f aclocal.m4
-aclocal -I $llvm_m4 -I "$llvm_m4/.." || die "aclocal failed"
-echo "Regenerating configure with autoconf 2.5x"
-autoconf --warnings=all -o ../configure configure.ac || die "autoconf failed"
-cd ..
-exit 0
diff --git a/release_23/projects/sample/autoconf/LICENSE.TXT b/release_23/projects/sample/autoconf/LICENSE.TXT
deleted file mode 100644
index 72fdd39edcc8..000000000000
--- a/release_23/projects/sample/autoconf/LICENSE.TXT
+++ /dev/null
@@ -1,24 +0,0 @@
-------------------------------------------------------------------------------
-Autoconf Files
-------------------------------------------------------------------------------
-All autoconf files are licensed under the LLVM license with the following
-additions:
-
-llvm/autoconf/install-sh:
- This script is licensed under the LLVM license, with the following
- additional copyrights and restrictions:
-
- Copyright 1991 by the Massachusetts Institute of Technology
-
- Permission to use, copy, modify, distribute, and sell this software and its
- documentation for any purpose is hereby granted without fee, provided that
- the above copyright notice appear in all copies and that both that
- copyright notice and this permission notice appear in supporting
- documentation, and that the name of M.I.T. not be used in advertising or
- publicity pertaining to distribution of the software without specific,
- written prior permission. M.I.T. makes no representations about the
- suitability of this software for any purpose. It is provided "as is"
- without express or implied warranty.
-
-Please see the source files for additional copyrights.
-
diff --git a/release_23/projects/sample/autoconf/config.guess b/release_23/projects/sample/autoconf/config.guess
deleted file mode 100755
index cc726cd15a93..000000000000
--- a/release_23/projects/sample/autoconf/config.guess
+++ /dev/null
@@ -1,1388 +0,0 @@
-#! /bin/sh
-# Attempt to guess a canonical system name.
-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-# 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
-
-timestamp='2003-02-22'
-
-# This file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-# Originally written by Per Bothner <per@bothner.com>.
-# Please send patches to <config-patches@gnu.org>. Submit a context
-# diff and a properly formatted ChangeLog entry.
-#
-# This script attempts to guess a canonical system name similar to
-# config.sub. If it succeeds, it prints the system name on stdout, and
-# exits with 0. Otherwise, it exits with 1.
-#
-# The plan is that this can be called by configure scripts if you
-# don't specify an explicit build system type.
-
-me=`echo "$0" | sed -e 's,.*/,,'`
-
-usage="\
-Usage: $0 [OPTION]
-
-Output the configuration name of the system \`$me' is run on.
-
-Operation modes:
- -h, --help print this help, then exit
- -t, --time-stamp print date of last modification, then exit
- -v, --version print version number, then exit
-
-Report bugs and patches to <config-patches@gnu.org>."
-
-version="\
-GNU config.guess ($timestamp)
-
-Originally written by Per Bothner.
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
-Free Software Foundation, Inc.
-
-This is free software; see the source for copying conditions. There is NO
-warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
-
-help="
-Try \`$me --help' for more information."
-
-# Parse command line
-while test $# -gt 0 ; do
- case $1 in
- --time-stamp | --time* | -t )
- echo "$timestamp" ; exit 0 ;;
- --version | -v )
- echo "$version" ; exit 0 ;;
- --help | --h* | -h )
- echo "$usage"; exit 0 ;;
- -- ) # Stop option processing
- shift; break ;;
- - ) # Use stdin as input.
- break ;;
- -* )
- echo "$me: invalid option $1$help" >&2
- exit 1 ;;
- * )
- break ;;
- esac
-done
-
-if test $# != 0; then
- echo "$me: too many arguments$help" >&2
- exit 1
-fi
-
-trap 'exit 1' 1 2 15
-
-# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
-# compiler to aid in system detection is discouraged as it requires
-# temporary files to be created and, as you can see below, it is a
-# headache to deal with in a portable fashion.
-
-# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
-# use `HOST_CC' if defined, but it is deprecated.
-
-# Portable tmp directory creation inspired by the Autoconf team.
-
-set_cc_for_build='
-trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
-trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
-: ${TMPDIR=/tmp} ;
- { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
- { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
- { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
-dummy=$tmp/dummy ;
-tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
-case $CC_FOR_BUILD,$HOST_CC,$CC in
- ,,) echo "int x;" > $dummy.c ;
- for c in cc gcc c89 c99 ; do
- if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
- CC_FOR_BUILD="$c"; break ;
- fi ;
- done ;
- if test x"$CC_FOR_BUILD" = x ; then
- CC_FOR_BUILD=no_compiler_found ;
- fi
- ;;
- ,,*) CC_FOR_BUILD=$CC ;;
- ,*,*) CC_FOR_BUILD=$HOST_CC ;;
-esac ;'
-
-# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
-# (ghazi@noc.rutgers.edu 1994-08-24)
-if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
- PATH=$PATH:/.attbin ; export PATH
-fi
-
-UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
-UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
-UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
-UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
-
-# Note: order is significant - the case branches are not exclusive.
-
-case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
- *:NetBSD:*:*)
- # NetBSD (nbsd) targets should (where applicable) match one or
- # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
- # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
- # switched to ELF, *-*-netbsd* would select the old
- # object file format. This provides both forward
- # compatibility and a consistent mechanism for selecting the
- # object file format.
- #
- # Note: NetBSD doesn't particularly care about the vendor
- # portion of the name. We always set it to "unknown".
- sysctl="sysctl -n hw.machine_arch"
- UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
- /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
- case "${UNAME_MACHINE_ARCH}" in
- armeb) machine=armeb-unknown ;;
- arm*) machine=arm-unknown ;;
- sh3el) machine=shl-unknown ;;
- sh3eb) machine=sh-unknown ;;
- *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
- esac
- # The Operating System including object format, if it has switched
- # to ELF recently, or will in the future.
- case "${UNAME_MACHINE_ARCH}" in
- arm*|i386|m68k|ns32k|sh3*|sparc|vax)
- eval $set_cc_for_build
- if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
- | grep __ELF__ >/dev/null
- then
- # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
- # Return netbsd for either. FIX?
- os=netbsd
- else
- os=netbsdelf
- fi
- ;;
- *)
- os=netbsd
- ;;
- esac
- # The OS release
- # Debian GNU/NetBSD machines have a different userland, and
- # thus, need a distinct triplet. However, they do not need
- # kernel version information, so it can be replaced with a
- # suitable tag, in the style of linux-gnu.
- case "${UNAME_VERSION}" in
- Debian*)
- release='-gnu'
- ;;
- *)
- release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
- ;;
- esac
- # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
- # contains redundant information, the shorter form:
- # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
- echo "${machine}-${os}${release}"
- exit 0 ;;
- amiga:OpenBSD:*:*)
- echo m68k-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- arc:OpenBSD:*:*)
- echo mipsel-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- hp300:OpenBSD:*:*)
- echo m68k-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- mac68k:OpenBSD:*:*)
- echo m68k-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- macppc:OpenBSD:*:*)
- echo powerpc-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- mvme68k:OpenBSD:*:*)
- echo m68k-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- mvme88k:OpenBSD:*:*)
- echo m88k-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- mvmeppc:OpenBSD:*:*)
- echo powerpc-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- pmax:OpenBSD:*:*)
- echo mipsel-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- sgi:OpenBSD:*:*)
- echo mipseb-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- sun3:OpenBSD:*:*)
- echo m68k-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- wgrisc:OpenBSD:*:*)
- echo mipsel-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- *:OpenBSD:*:*)
- echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- alpha:OSF1:*:*)
- if test $UNAME_RELEASE = "V4.0"; then
- UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
- fi
- # According to Compaq, /usr/sbin/psrinfo has been available on
- # OSF/1 and Tru64 systems produced since 1995. I hope that
- # covers most systems running today. This code pipes the CPU
- # types through head -n 1, so we only detect the type of CPU 0.
- ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1`
- case "$ALPHA_CPU_TYPE" in
- "EV4 (21064)")
- UNAME_MACHINE="alpha" ;;
- "EV4.5 (21064)")
- UNAME_MACHINE="alpha" ;;
- "LCA4 (21066/21068)")
- UNAME_MACHINE="alpha" ;;
- "EV5 (21164)")
- UNAME_MACHINE="alphaev5" ;;
- "EV5.6 (21164A)")
- UNAME_MACHINE="alphaev56" ;;
- "EV5.6 (21164PC)")
- UNAME_MACHINE="alphapca56" ;;
- "EV5.7 (21164PC)")
- UNAME_MACHINE="alphapca57" ;;
- "EV6 (21264)")
- UNAME_MACHINE="alphaev6" ;;
- "EV6.7 (21264A)")
- UNAME_MACHINE="alphaev67" ;;
- "EV6.8CB (21264C)")
- UNAME_MACHINE="alphaev68" ;;
- "EV6.8AL (21264B)")
- UNAME_MACHINE="alphaev68" ;;
- "EV6.8CX (21264D)")
- UNAME_MACHINE="alphaev68" ;;
- "EV6.9A (21264/EV69A)")
- UNAME_MACHINE="alphaev69" ;;
- "EV7 (21364)")
- UNAME_MACHINE="alphaev7" ;;
- "EV7.9 (21364A)")
- UNAME_MACHINE="alphaev79" ;;
- esac
- # A Vn.n version is a released version.
- # A Tn.n version is a released field test version.
- # A Xn.n version is an unreleased experimental baselevel.
- # 1.2 uses "1.2" for uname -r.
- echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
- exit 0 ;;
- Alpha\ *:Windows_NT*:*)
- # How do we know it's Interix rather than the generic POSIX subsystem?
- # Should we change UNAME_MACHINE based on the output of uname instead
- # of the specific Alpha model?
- echo alpha-pc-interix
- exit 0 ;;
- 21064:Windows_NT:50:3)
- echo alpha-dec-winnt3.5
- exit 0 ;;
- Amiga*:UNIX_System_V:4.0:*)
- echo m68k-unknown-sysv4
- exit 0;;
- *:[Aa]miga[Oo][Ss]:*:*)
- echo ${UNAME_MACHINE}-unknown-amigaos
- exit 0 ;;
- *:[Mm]orph[Oo][Ss]:*:*)
- echo ${UNAME_MACHINE}-unknown-morphos
- exit 0 ;;
- *:OS/390:*:*)
- echo i370-ibm-openedition
- exit 0 ;;
- arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
- echo arm-acorn-riscix${UNAME_RELEASE}
- exit 0;;
- SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
- echo hppa1.1-hitachi-hiuxmpp
- exit 0;;
- Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
- # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
- if test "`(/bin/universe) 2>/dev/null`" = att ; then
- echo pyramid-pyramid-sysv3
- else
- echo pyramid-pyramid-bsd
- fi
- exit 0 ;;
- NILE*:*:*:dcosx)
- echo pyramid-pyramid-svr4
- exit 0 ;;
- DRS?6000:UNIX_SV:4.2*:7*)
- case `/usr/bin/uname -p` in
- sparc) echo sparc-icl-nx7 && exit 0 ;;
- esac ;;
- sun4H:SunOS:5.*:*)
- echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit 0 ;;
- sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
- echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit 0 ;;
- i86pc:SunOS:5.*:*)
- echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit 0 ;;
- sun4*:SunOS:6*:*)
- # According to config.sub, this is the proper way to canonicalize
- # SunOS6. Hard to guess exactly what SunOS6 will be like, but
- # it's likely to be more like Solaris than SunOS4.
- echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit 0 ;;
- sun4*:SunOS:*:*)
- case "`/usr/bin/arch -k`" in
- Series*|S4*)
- UNAME_RELEASE=`uname -v`
- ;;
- esac
- # Japanese Language versions have a version number like `4.1.3-JL'.
- echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
- exit 0 ;;
- sun3*:SunOS:*:*)
- echo m68k-sun-sunos${UNAME_RELEASE}
- exit 0 ;;
- sun*:*:4.2BSD:*)
- UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
- test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
- case "`/bin/arch`" in
- sun3)
- echo m68k-sun-sunos${UNAME_RELEASE}
- ;;
- sun4)
- echo sparc-sun-sunos${UNAME_RELEASE}
- ;;
- esac
- exit 0 ;;
- aushp:SunOS:*:*)
- echo sparc-auspex-sunos${UNAME_RELEASE}
- exit 0 ;;
- # The situation for MiNT is a little confusing. The machine name
- # can be virtually everything (everything which is not
- # "atarist" or "atariste" at least should have a processor
- # > m68000). The system name ranges from "MiNT" over "FreeMiNT"
- # to the lowercase version "mint" (or "freemint"). Finally
- # the system name "TOS" denotes a system which is actually not
- # MiNT. But MiNT is downward compatible to TOS, so this should
- # be no problem.
- atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
- echo m68k-atari-mint${UNAME_RELEASE}
- exit 0 ;;
- atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
- echo m68k-atari-mint${UNAME_RELEASE}
- exit 0 ;;
- *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
- echo m68k-atari-mint${UNAME_RELEASE}
- exit 0 ;;
- milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
- echo m68k-milan-mint${UNAME_RELEASE}
- exit 0 ;;
- hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
- echo m68k-hades-mint${UNAME_RELEASE}
- exit 0 ;;
- *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
- echo m68k-unknown-mint${UNAME_RELEASE}
- exit 0 ;;
- powerpc:machten:*:*)
- echo powerpc-apple-machten${UNAME_RELEASE}
- exit 0 ;;
- RISC*:Mach:*:*)
- echo mips-dec-mach_bsd4.3
- exit 0 ;;
- RISC*:ULTRIX:*:*)
- echo mips-dec-ultrix${UNAME_RELEASE}
- exit 0 ;;
- VAX*:ULTRIX*:*:*)
- echo vax-dec-ultrix${UNAME_RELEASE}
- exit 0 ;;
- 2020:CLIX:*:* | 2430:CLIX:*:*)
- echo clipper-intergraph-clix${UNAME_RELEASE}
- exit 0 ;;
- mips:*:*:UMIPS | mips:*:*:RISCos)
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
-#ifdef __cplusplus
-#include <stdio.h> /* for printf() prototype */
- int main (int argc, char *argv[]) {
-#else
- int main (argc, argv) int argc; char *argv[]; {
-#endif
- #if defined (host_mips) && defined (MIPSEB)
- #if defined (SYSTYPE_SYSV)
- printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
- #endif
- #if defined (SYSTYPE_SVR4)
- printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
- #endif
- #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
- printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
- #endif
- #endif
- exit (-1);
- }
-EOF
- $CC_FOR_BUILD -o $dummy $dummy.c \
- && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
- && exit 0
- echo mips-mips-riscos${UNAME_RELEASE}
- exit 0 ;;
- Motorola:PowerMAX_OS:*:*)
- echo powerpc-motorola-powermax
- exit 0 ;;
- Motorola:*:4.3:PL8-*)
- echo powerpc-harris-powermax
- exit 0 ;;
- Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
- echo powerpc-harris-powermax
- exit 0 ;;
- Night_Hawk:Power_UNIX:*:*)
- echo powerpc-harris-powerunix
- exit 0 ;;
- m88k:CX/UX:7*:*)
- echo m88k-harris-cxux7
- exit 0 ;;
- m88k:*:4*:R4*)
- echo m88k-motorola-sysv4
- exit 0 ;;
- m88k:*:3*:R3*)
- echo m88k-motorola-sysv3
- exit 0 ;;
- AViiON:dgux:*:*)
- # DG/UX returns AViiON for all architectures
- UNAME_PROCESSOR=`/usr/bin/uname -p`
- if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
- then
- if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
- [ ${TARGET_BINARY_INTERFACE}x = x ]
- then
- echo m88k-dg-dgux${UNAME_RELEASE}
- else
- echo m88k-dg-dguxbcs${UNAME_RELEASE}
- fi
- else
- echo i586-dg-dgux${UNAME_RELEASE}
- fi
- exit 0 ;;
- M88*:DolphinOS:*:*) # DolphinOS (SVR3)
- echo m88k-dolphin-sysv3
- exit 0 ;;
- M88*:*:R3*:*)
- # Delta 88k system running SVR3
- echo m88k-motorola-sysv3
- exit 0 ;;
- XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
- echo m88k-tektronix-sysv3
- exit 0 ;;
- Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
- echo m68k-tektronix-bsd
- exit 0 ;;
- *:IRIX*:*:*)
- echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
- exit 0 ;;
- ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
- echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
- exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX '
- i*86:AIX:*:*)
- echo i386-ibm-aix
- exit 0 ;;
- ia64:AIX:*:*)
- if [ -x /usr/bin/oslevel ] ; then
- IBM_REV=`/usr/bin/oslevel`
- else
- IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
- fi
- echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
- exit 0 ;;
- *:AIX:2:3)
- if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
- #include <sys/systemcfg.h>
-
- main()
- {
- if (!__power_pc())
- exit(1);
- puts("powerpc-ibm-aix3.2.5");
- exit(0);
- }
-EOF
- $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
- echo rs6000-ibm-aix3.2.5
- elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
- echo rs6000-ibm-aix3.2.4
- else
- echo rs6000-ibm-aix3.2
- fi
- exit 0 ;;
- *:AIX:*:[45])
- IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
- if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
- IBM_ARCH=rs6000
- else
- IBM_ARCH=powerpc
- fi
- if [ -x /usr/bin/oslevel ] ; then
- IBM_REV=`/usr/bin/oslevel`
- else
- IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
- fi
- echo ${IBM_ARCH}-ibm-aix${IBM_REV}
- exit 0 ;;
- *:AIX:*:*)
- echo rs6000-ibm-aix
- exit 0 ;;
- ibmrt:4.4BSD:*|romp-ibm:BSD:*)
- echo romp-ibm-bsd4.4
- exit 0 ;;
- ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
- echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
- exit 0 ;; # report: romp-ibm BSD 4.3
- *:BOSX:*:*)
- echo rs6000-bull-bosx
- exit 0 ;;
- DPX/2?00:B.O.S.:*:*)
- echo m68k-bull-sysv3
- exit 0 ;;
- 9000/[34]??:4.3bsd:1.*:*)
- echo m68k-hp-bsd
- exit 0 ;;
- hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
- echo m68k-hp-bsd4.4
- exit 0 ;;
- 9000/[34678]??:HP-UX:*:*)
- HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
- case "${UNAME_MACHINE}" in
- 9000/31? ) HP_ARCH=m68000 ;;
- 9000/[34]?? ) HP_ARCH=m68k ;;
- 9000/[678][0-9][0-9])
- if [ -x /usr/bin/getconf ]; then
- sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
- sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
- case "${sc_cpu_version}" in
- 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
- 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
- 532) # CPU_PA_RISC2_0
- case "${sc_kernel_bits}" in
- 32) HP_ARCH="hppa2.0n" ;;
- 64) HP_ARCH="hppa2.0w" ;;
- '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20
- esac ;;
- esac
- fi
- if [ "${HP_ARCH}" = "" ]; then
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
-
- #define _HPUX_SOURCE
- #include <stdlib.h>
- #include <unistd.h>
-
- int main ()
- {
- #if defined(_SC_KERNEL_BITS)
- long bits = sysconf(_SC_KERNEL_BITS);
- #endif
- long cpu = sysconf (_SC_CPU_VERSION);
-
- switch (cpu)
- {
- case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
- case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
- case CPU_PA_RISC2_0:
- #if defined(_SC_KERNEL_BITS)
- switch (bits)
- {
- case 64: puts ("hppa2.0w"); break;
- case 32: puts ("hppa2.0n"); break;
- default: puts ("hppa2.0"); break;
- } break;
- #else /* !defined(_SC_KERNEL_BITS) */
- puts ("hppa2.0"); break;
- #endif
- default: puts ("hppa1.0"); break;
- }
- exit (0);
- }
-EOF
- (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
- test -z "$HP_ARCH" && HP_ARCH=hppa
- fi ;;
- esac
- if [ ${HP_ARCH} = "hppa2.0w" ]
- then
- # avoid double evaluation of $set_cc_for_build
- test -n "$CC_FOR_BUILD" || eval $set_cc_for_build
- if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__ >/dev/null
- then
- HP_ARCH="hppa2.0w"
- else
- HP_ARCH="hppa64"
- fi
- fi
- echo ${HP_ARCH}-hp-hpux${HPUX_REV}
- exit 0 ;;
- ia64:HP-UX:*:*)
- HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
- echo ia64-hp-hpux${HPUX_REV}
- exit 0 ;;
- 3050*:HI-UX:*:*)
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
- #include <unistd.h>
- int
- main ()
- {
- long cpu = sysconf (_SC_CPU_VERSION);
- /* The order matters, because CPU_IS_HP_MC68K erroneously returns
- true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct
- results, however. */
- if (CPU_IS_PA_RISC (cpu))
- {
- switch (cpu)
- {
- case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
- case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
- case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
- default: puts ("hppa-hitachi-hiuxwe2"); break;
- }
- }
- else if (CPU_IS_HP_MC68K (cpu))
- puts ("m68k-hitachi-hiuxwe2");
- else puts ("unknown-hitachi-hiuxwe2");
- exit (0);
- }
-EOF
- $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
- echo unknown-hitachi-hiuxwe2
- exit 0 ;;
- 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
- echo hppa1.1-hp-bsd
- exit 0 ;;
- 9000/8??:4.3bsd:*:*)
- echo hppa1.0-hp-bsd
- exit 0 ;;
- *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
- echo hppa1.0-hp-mpeix
- exit 0 ;;
- hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
- echo hppa1.1-hp-osf
- exit 0 ;;
- hp8??:OSF1:*:*)
- echo hppa1.0-hp-osf
- exit 0 ;;
- i*86:OSF1:*:*)
- if [ -x /usr/sbin/sysversion ] ; then
- echo ${UNAME_MACHINE}-unknown-osf1mk
- else
- echo ${UNAME_MACHINE}-unknown-osf1
- fi
- exit 0 ;;
- parisc*:Lites*:*:*)
- echo hppa1.1-hp-lites
- exit 0 ;;
- C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
- echo c1-convex-bsd
- exit 0 ;;
- C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
- if getsysinfo -f scalar_acc
- then echo c32-convex-bsd
- else echo c2-convex-bsd
- fi
- exit 0 ;;
- C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
- echo c34-convex-bsd
- exit 0 ;;
- C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
- echo c38-convex-bsd
- exit 0 ;;
- C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
- echo c4-convex-bsd
- exit 0 ;;
- CRAY*Y-MP:*:*:*)
- echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit 0 ;;
- CRAY*[A-Z]90:*:*:*)
- echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
- | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
- -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
- -e 's/\.[^.]*$/.X/'
- exit 0 ;;
- CRAY*TS:*:*:*)
- echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit 0 ;;
- CRAY*T3E:*:*:*)
- echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit 0 ;;
- CRAY*SV1:*:*:*)
- echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit 0 ;;
- *:UNICOS/mp:*:*)
- echo nv1-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit 0 ;;
- F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
- FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
- FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
- FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
- echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
- exit 0 ;;
- i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
- echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
- exit 0 ;;
- sparc*:BSD/OS:*:*)
- echo sparc-unknown-bsdi${UNAME_RELEASE}
- exit 0 ;;
- *:BSD/OS:*:*)
- echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
- exit 0 ;;
- *:FreeBSD:*:*)
- # Determine whether the default compiler uses glibc.
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
- #include <features.h>
- #if __GLIBC__ >= 2
- LIBC=gnu
- #else
- LIBC=
- #endif
-EOF
- eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
- echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC}
- exit 0 ;;
- i*:CYGWIN*:*)
- echo ${UNAME_MACHINE}-pc-cygwin
- exit 0 ;;
- i*:MINGW*:*)
- echo ${UNAME_MACHINE}-pc-mingw32
- exit 0 ;;
- i*:PW*:*)
- echo ${UNAME_MACHINE}-pc-pw32
- exit 0 ;;
- x86:Interix*:3*)
- echo i586-pc-interix3
- exit 0 ;;
- [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
- echo i${UNAME_MACHINE}-pc-mks
- exit 0 ;;
- i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
- # How do we know it's Interix rather than the generic POSIX subsystem?
- # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
- # UNAME_MACHINE based on the output of uname instead of i386?
- echo i586-pc-interix
- exit 0 ;;
- i*:UWIN*:*)
- echo ${UNAME_MACHINE}-pc-uwin
- exit 0 ;;
- p*:CYGWIN*:*)
- echo powerpcle-unknown-cygwin
- exit 0 ;;
- prep*:SunOS:5.*:*)
- echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit 0 ;;
- *:GNU:*:*)
- echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
- exit 0 ;;
- i*86:Minix:*:*)
- echo ${UNAME_MACHINE}-pc-minix
- exit 0 ;;
- arm*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit 0 ;;
- ia64:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit 0 ;;
- m68*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit 0 ;;
- mips:Linux:*:*)
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
- #undef CPU
- #undef mips
- #undef mipsel
- #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
- CPU=mipsel
- #else
- #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
- CPU=mips
- #else
- CPU=
- #endif
- #endif
-EOF
- eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
- test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0
- ;;
- mips64:Linux:*:*)
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
- #undef CPU
- #undef mips64
- #undef mips64el
- #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
- CPU=mips64el
- #else
- #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
- CPU=mips64
- #else
- CPU=
- #endif
- #endif
-EOF
- eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
- test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0
- ;;
- ppc:Linux:*:*)
- echo powerpc-unknown-linux-gnu
- exit 0 ;;
- ppc64:Linux:*:*)
- echo powerpc64-unknown-linux-gnu
- exit 0 ;;
- alpha:Linux:*:*)
- case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
- EV5) UNAME_MACHINE=alphaev5 ;;
- EV56) UNAME_MACHINE=alphaev56 ;;
- PCA56) UNAME_MACHINE=alphapca56 ;;
- PCA57) UNAME_MACHINE=alphapca56 ;;
- EV6) UNAME_MACHINE=alphaev6 ;;
- EV67) UNAME_MACHINE=alphaev67 ;;
- EV68*) UNAME_MACHINE=alphaev68 ;;
- esac
- objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
- if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
- echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
- exit 0 ;;
- parisc:Linux:*:* | hppa:Linux:*:*)
- # Look for CPU level
- case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
- PA7*) echo hppa1.1-unknown-linux-gnu ;;
- PA8*) echo hppa2.0-unknown-linux-gnu ;;
- *) echo hppa-unknown-linux-gnu ;;
- esac
- exit 0 ;;
- parisc64:Linux:*:* | hppa64:Linux:*:*)
- echo hppa64-unknown-linux-gnu
- exit 0 ;;
- s390:Linux:*:* | s390x:Linux:*:*)
- echo ${UNAME_MACHINE}-ibm-linux
- exit 0 ;;
- sh*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit 0 ;;
- sparc:Linux:*:* | sparc64:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit 0 ;;
- x86_64:Linux:*:*)
- echo x86_64-unknown-linux-gnu
- exit 0 ;;
- i*86:Linux:*:*)
- # The BFD linker knows what the default object file format is, so
- # first see if it will tell us. cd to the root directory to prevent
- # problems with other programs or directories called `ld' in the path.
- # Set LC_ALL=C to ensure ld outputs messages in English.
- ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
- | sed -ne '/supported targets:/!d
- s/[ ][ ]*/ /g
- s/.*supported targets: *//
- s/ .*//
- p'`
- case "$ld_supported_targets" in
- elf32-i386)
- TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
- ;;
- a.out-i386-linux)
- echo "${UNAME_MACHINE}-pc-linux-gnuaout"
- exit 0 ;;
- coff-i386)
- echo "${UNAME_MACHINE}-pc-linux-gnucoff"
- exit 0 ;;
- "")
- # Either a pre-BFD a.out linker (linux-gnuoldld) or
- # one that does not give us useful --help.
- echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
- exit 0 ;;
- esac
- # Determine whether the default compiler is a.out or elf
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
- #include <features.h>
- #ifdef __ELF__
- # ifdef __GLIBC__
- # if __GLIBC__ >= 2
- LIBC=gnu
- # else
- LIBC=gnulibc1
- # endif
- # else
- LIBC=gnulibc1
- # endif
- #else
- #ifdef __INTEL_COMPILER
- LIBC=gnu
- #else
- LIBC=gnuaout
- #endif
- #endif
-EOF
- eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
- test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0
- test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0
- ;;
- i*86:DYNIX/ptx:4*:*)
- # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
- # earlier versions are messed up and put the nodename in both
- # sysname and nodename.
- echo i386-sequent-sysv4
- exit 0 ;;
- i*86:UNIX_SV:4.2MP:2.*)
- # Unixware is an offshoot of SVR4, but it has its own version
- # number series starting with 2...
- # I am not positive that other SVR4 systems won't match this,
- # I just have to hope. -- rms.
- # Use sysv4.2uw... so that sysv4* matches it.
- echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
- exit 0 ;;
- i*86:OS/2:*:*)
- # If we were able to find `uname', then EMX Unix compatibility
- # is probably installed.
- echo ${UNAME_MACHINE}-pc-os2-emx
- exit 0 ;;
- i*86:XTS-300:*:STOP)
- echo ${UNAME_MACHINE}-unknown-stop
- exit 0 ;;
- i*86:atheos:*:*)
- echo ${UNAME_MACHINE}-unknown-atheos
- exit 0 ;;
- i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
- echo i386-unknown-lynxos${UNAME_RELEASE}
- exit 0 ;;
- i*86:*DOS:*:*)
- echo ${UNAME_MACHINE}-pc-msdosdjgpp
- exit 0 ;;
- i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
- UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
- if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
- echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
- else
- echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
- fi
- exit 0 ;;
- i*86:*:5:[78]*)
- case `/bin/uname -X | grep "^Machine"` in
- *486*) UNAME_MACHINE=i486 ;;
- *Pentium) UNAME_MACHINE=i586 ;;
- *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
- esac
- echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
- exit 0 ;;
- i*86:*:3.2:*)
- if test -f /usr/options/cb.name; then
- UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
- echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
- elif /bin/uname -X 2>/dev/null >/dev/null ; then
- UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
- (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
- (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
- && UNAME_MACHINE=i586
- (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
- && UNAME_MACHINE=i686
- (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
- && UNAME_MACHINE=i686
- echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
- else
- echo ${UNAME_MACHINE}-pc-sysv32
- fi
- exit 0 ;;
- pc:*:*:*)
- # Left here for compatibility:
- # uname -m prints for DJGPP always 'pc', but it prints nothing about
- # the processor, so we play safe by assuming i386.
- echo i386-pc-msdosdjgpp
- exit 0 ;;
- Intel:Mach:3*:*)
- echo i386-pc-mach3
- exit 0 ;;
- paragon:*:*:*)
- echo i860-intel-osf1
- exit 0 ;;
- i860:*:4.*:*) # i860-SVR4
- if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
- echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
- else # Add other i860-SVR4 vendors below as they are discovered.
- echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
- fi
- exit 0 ;;
- mini*:CTIX:SYS*5:*)
- # "miniframe"
- echo m68010-convergent-sysv
- exit 0 ;;
- mc68k:UNIX:SYSTEM5:3.51m)
- echo m68k-convergent-sysv
- exit 0 ;;
- M680?0:D-NIX:5.3:*)
- echo m68k-diab-dnix
- exit 0 ;;
- M68*:*:R3V[567]*:*)
- test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
- 3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0)
- OS_REL=''
- test -r /etc/.relid \
- && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
- /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
- && echo i486-ncr-sysv4.3${OS_REL} && exit 0
- /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
- && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;;
- 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
- /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
- && echo i486-ncr-sysv4 && exit 0 ;;
- m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
- echo m68k-unknown-lynxos${UNAME_RELEASE}
- exit 0 ;;
- mc68030:UNIX_System_V:4.*:*)
- echo m68k-atari-sysv4
- exit 0 ;;
- TSUNAMI:LynxOS:2.*:*)
- echo sparc-unknown-lynxos${UNAME_RELEASE}
- exit 0 ;;
- rs6000:LynxOS:2.*:*)
- echo rs6000-unknown-lynxos${UNAME_RELEASE}
- exit 0 ;;
- PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
- echo powerpc-unknown-lynxos${UNAME_RELEASE}
- exit 0 ;;
- SM[BE]S:UNIX_SV:*:*)
- echo mips-dde-sysv${UNAME_RELEASE}
- exit 0 ;;
- RM*:ReliantUNIX-*:*:*)
- echo mips-sni-sysv4
- exit 0 ;;
- RM*:SINIX-*:*:*)
- echo mips-sni-sysv4
- exit 0 ;;
- *:SINIX-*:*:*)
- if uname -p 2>/dev/null >/dev/null ; then
- UNAME_MACHINE=`(uname -p) 2>/dev/null`
- echo ${UNAME_MACHINE}-sni-sysv4
- else
- echo ns32k-sni-sysv
- fi
- exit 0 ;;
- PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
- # says <Richard.M.Bartel@ccMail.Census.GOV>
- echo i586-unisys-sysv4
- exit 0 ;;
- *:UNIX_System_V:4*:FTX*)
- # From Gerald Hewes <hewes@openmarket.com>.
- # How about differentiating between stratus architectures? -djm
- echo hppa1.1-stratus-sysv4
- exit 0 ;;
- *:*:*:FTX*)
- # From seanf@swdc.stratus.com.
- echo i860-stratus-sysv4
- exit 0 ;;
- *:VOS:*:*)
- # From Paul.Green@stratus.com.
- echo hppa1.1-stratus-vos
- exit 0 ;;
- mc68*:A/UX:*:*)
- echo m68k-apple-aux${UNAME_RELEASE}
- exit 0 ;;
- news*:NEWS-OS:6*:*)
- echo mips-sony-newsos6
- exit 0 ;;
- R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
- if [ -d /usr/nec ]; then
- echo mips-nec-sysv${UNAME_RELEASE}
- else
- echo mips-unknown-sysv${UNAME_RELEASE}
- fi
- exit 0 ;;
- BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
- echo powerpc-be-beos
- exit 0 ;;
- BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
- echo powerpc-apple-beos
- exit 0 ;;
- BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
- echo i586-pc-beos
- exit 0 ;;
- SX-4:SUPER-UX:*:*)
- echo sx4-nec-superux${UNAME_RELEASE}
- exit 0 ;;
- SX-5:SUPER-UX:*:*)
- echo sx5-nec-superux${UNAME_RELEASE}
- exit 0 ;;
- SX-6:SUPER-UX:*:*)
- echo sx6-nec-superux${UNAME_RELEASE}
- exit 0 ;;
- Power*:Rhapsody:*:*)
- echo powerpc-apple-rhapsody${UNAME_RELEASE}
- exit 0 ;;
- *:Rhapsody:*:*)
- echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
- exit 0 ;;
- *:Darwin:*:*)
- case `uname -p` in
- *86) UNAME_PROCESSOR=i686 ;;
- powerpc) UNAME_PROCESSOR=powerpc ;;
- esac
- echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
- exit 0 ;;
- *:procnto*:*:* | *:QNX:[0123456789]*:*)
- UNAME_PROCESSOR=`uname -p`
- if test "$UNAME_PROCESSOR" = "x86"; then
- UNAME_PROCESSOR=i386
- UNAME_MACHINE=pc
- fi
- echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
- exit 0 ;;
- *:QNX:*:4*)
- echo i386-pc-qnx
- exit 0 ;;
- NSR-[DGKLNPTVW]:NONSTOP_KERNEL:*:*)
- echo nsr-tandem-nsk${UNAME_RELEASE}
- exit 0 ;;
- *:NonStop-UX:*:*)
- echo mips-compaq-nonstopux
- exit 0 ;;
- BS2000:POSIX*:*:*)
- echo bs2000-siemens-sysv
- exit 0 ;;
- DS/*:UNIX_System_V:*:*)
- echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
- exit 0 ;;
- *:Plan9:*:*)
- # "uname -m" is not consistent, so use $cputype instead. 386
- # is converted to i386 for consistency with other x86
- # operating systems.
- if test "$cputype" = "386"; then
- UNAME_MACHINE=i386
- else
- UNAME_MACHINE="$cputype"
- fi
- echo ${UNAME_MACHINE}-unknown-plan9
- exit 0 ;;
- *:TOPS-10:*:*)
- echo pdp10-unknown-tops10
- exit 0 ;;
- *:TENEX:*:*)
- echo pdp10-unknown-tenex
- exit 0 ;;
- KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
- echo pdp10-dec-tops20
- exit 0 ;;
- XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
- echo pdp10-xkl-tops20
- exit 0 ;;
- *:TOPS-20:*:*)
- echo pdp10-unknown-tops20
- exit 0 ;;
- *:ITS:*:*)
- echo pdp10-unknown-its
- exit 0 ;;
-esac
-
-#echo '(No uname command or uname output not recognized.)' 1>&2
-#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
-
-eval $set_cc_for_build
-cat >$dummy.c <<EOF
-#ifdef _SEQUENT_
-# include <sys/types.h>
-# include <sys/utsname.h>
-#endif
-main ()
-{
-#if defined (sony)
-#if defined (MIPSEB)
- /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed,
- I don't know.... */
- printf ("mips-sony-bsd\n"); exit (0);
-#else
-#include <sys/param.h>
- printf ("m68k-sony-newsos%s\n",
-#ifdef NEWSOS4
- "4"
-#else
- ""
-#endif
- ); exit (0);
-#endif
-#endif
-
-#if defined (__arm) && defined (__acorn) && defined (__unix)
- printf ("arm-acorn-riscix"); exit (0);
-#endif
-
-#if defined (hp300) && !defined (hpux)
- printf ("m68k-hp-bsd\n"); exit (0);
-#endif
-
-#if defined (NeXT)
-#if !defined (__ARCHITECTURE__)
-#define __ARCHITECTURE__ "m68k"
-#endif
- int version;
- version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
- if (version < 4)
- printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
- else
- printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
- exit (0);
-#endif
-
-#if defined (MULTIMAX) || defined (n16)
-#if defined (UMAXV)
- printf ("ns32k-encore-sysv\n"); exit (0);
-#else
-#if defined (CMU)
- printf ("ns32k-encore-mach\n"); exit (0);
-#else
- printf ("ns32k-encore-bsd\n"); exit (0);
-#endif
-#endif
-#endif
-
-#if defined (__386BSD__)
- printf ("i386-pc-bsd\n"); exit (0);
-#endif
-
-#if defined (sequent)
-#if defined (i386)
- printf ("i386-sequent-dynix\n"); exit (0);
-#endif
-#if defined (ns32000)
- printf ("ns32k-sequent-dynix\n"); exit (0);
-#endif
-#endif
-
-#if defined (_SEQUENT_)
- struct utsname un;
-
- uname(&un);
-
- if (strncmp(un.version, "V2", 2) == 0) {
- printf ("i386-sequent-ptx2\n"); exit (0);
- }
- if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
- printf ("i386-sequent-ptx1\n"); exit (0);
- }
- printf ("i386-sequent-ptx\n"); exit (0);
-
-#endif
-
-#if defined (vax)
-# if !defined (ultrix)
-# include <sys/param.h>
-# if defined (BSD)
-# if BSD == 43
- printf ("vax-dec-bsd4.3\n"); exit (0);
-# else
-# if BSD == 199006
- printf ("vax-dec-bsd4.3reno\n"); exit (0);
-# else
- printf ("vax-dec-bsd\n"); exit (0);
-# endif
-# endif
-# else
- printf ("vax-dec-bsd\n"); exit (0);
-# endif
-# else
- printf ("vax-dec-ultrix\n"); exit (0);
-# endif
-#endif
-
-#if defined (alliant) && defined (i860)
- printf ("i860-alliant-bsd\n"); exit (0);
-#endif
-
- exit (1);
-}
-EOF
-
-$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && exit 0
-
-# Apollos put the system type in the environment.
-
-test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; }
-
-# Convex versions that predate uname can use getsysinfo(1)
-
-if [ -x /usr/convex/getsysinfo ]
-then
- case `getsysinfo -f cpu_type` in
- c1*)
- echo c1-convex-bsd
- exit 0 ;;
- c2*)
- if getsysinfo -f scalar_acc
- then echo c32-convex-bsd
- else echo c2-convex-bsd
- fi
- exit 0 ;;
- c34*)
- echo c34-convex-bsd
- exit 0 ;;
- c38*)
- echo c38-convex-bsd
- exit 0 ;;
- c4*)
- echo c4-convex-bsd
- exit 0 ;;
- esac
-fi
-
-cat >&2 <<EOF
-$0: unable to guess system type
-
-This script, last modified $timestamp, has failed to recognize
-the operating system you are using. It is advised that you
-download the most up to date version of the config scripts from
-
- ftp://ftp.gnu.org/pub/gnu/config/
-
-If the version you run ($0) is already up to date, please
-send the following data and any information you think might be
-pertinent to <config-patches@gnu.org> in order to provide the needed
-information to handle your system.
-
-config.guess timestamp = $timestamp
-
-uname -m = `(uname -m) 2>/dev/null || echo unknown`
-uname -r = `(uname -r) 2>/dev/null || echo unknown`
-uname -s = `(uname -s) 2>/dev/null || echo unknown`
-uname -v = `(uname -v) 2>/dev/null || echo unknown`
-
-/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
-/bin/uname -X = `(/bin/uname -X) 2>/dev/null`
-
-hostinfo = `(hostinfo) 2>/dev/null`
-/bin/universe = `(/bin/universe) 2>/dev/null`
-/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null`
-/bin/arch = `(/bin/arch) 2>/dev/null`
-/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null`
-/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
-
-UNAME_MACHINE = ${UNAME_MACHINE}
-UNAME_RELEASE = ${UNAME_RELEASE}
-UNAME_SYSTEM = ${UNAME_SYSTEM}
-UNAME_VERSION = ${UNAME_VERSION}
-EOF
-
-exit 1
-
-# Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
-# time-stamp-start: "timestamp='"
-# time-stamp-format: "%:y-%02m-%02d"
-# time-stamp-end: "'"
-# End:
diff --git a/release_23/projects/sample/autoconf/config.sub b/release_23/projects/sample/autoconf/config.sub
deleted file mode 100755
index 9772e87d2418..000000000000
--- a/release_23/projects/sample/autoconf/config.sub
+++ /dev/null
@@ -1,1489 +0,0 @@
-#! /bin/sh
-# Configuration validation subroutine script.
-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-# 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
-
-timestamp='2003-02-22'
-
-# This file is (in principle) common to ALL GNU software.
-# The presence of a machine in this file suggests that SOME GNU software
-# can handle that machine. It does not imply ALL GNU software can.
-#
-# This file is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330,
-# Boston, MA 02111-1307, USA.
-
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-# Please send patches to <config-patches@gnu.org>. Submit a context
-# diff and a properly formatted ChangeLog entry.
-#
-# Configuration subroutine to validate and canonicalize a configuration type.
-# Supply the specified configuration type as an argument.
-# If it is invalid, we print an error message on stderr and exit with code 1.
-# Otherwise, we print the canonical config type on stdout and succeed.
-
-# This file is supposed to be the same for all GNU packages
-# and recognize all the CPU types, system types and aliases
-# that are meaningful with *any* GNU software.
-# Each package is responsible for reporting which valid configurations
-# it does not support. The user should be able to distinguish
-# a failure to support a valid configuration from a meaningless
-# configuration.
-
-# The goal of this file is to map all the various variations of a given
-# machine specification into a single specification in the form:
-# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
-# or in some cases, the newer four-part form:
-# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
-# It is wrong to echo any other type of specification.
-
-me=`echo "$0" | sed -e 's,.*/,,'`
-
-usage="\
-Usage: $0 [OPTION] CPU-MFR-OPSYS
- $0 [OPTION] ALIAS
-
-Canonicalize a configuration name.
-
-Operation modes:
- -h, --help print this help, then exit
- -t, --time-stamp print date of last modification, then exit
- -v, --version print version number, then exit
-
-Report bugs and patches to <config-patches@gnu.org>."
-
-version="\
-GNU config.sub ($timestamp)
-
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
-Free Software Foundation, Inc.
-
-This is free software; see the source for copying conditions. There is NO
-warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
-
-help="
-Try \`$me --help' for more information."
-
-# Parse command line
-while test $# -gt 0 ; do
- case $1 in
- --time-stamp | --time* | -t )
- echo "$timestamp" ; exit 0 ;;
- --version | -v )
- echo "$version" ; exit 0 ;;
- --help | --h* | -h )
- echo "$usage"; exit 0 ;;
- -- ) # Stop option processing
- shift; break ;;
- - ) # Use stdin as input.
- break ;;
- -* )
- echo "$me: invalid option $1$help"
- exit 1 ;;
-
- *local*)
- # First pass through any local machine types.
- echo $1
- exit 0;;
-
- * )
- break ;;
- esac
-done
-
-case $# in
- 0) echo "$me: missing argument$help" >&2
- exit 1;;
- 1) ;;
- *) echo "$me: too many arguments$help" >&2
- exit 1;;
-esac
-
-# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
-# Here we must recognize all the valid KERNEL-OS combinations.
-maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
-case $maybe_os in
- nto-qnx* | linux-gnu* | freebsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*)
- os=-$maybe_os
- basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
- ;;
- *)
- basic_machine=`echo $1 | sed 's/-[^-]*$//'`
- if [ $basic_machine != $1 ]
- then os=`echo $1 | sed 's/.*-/-/'`
- else os=; fi
- ;;
-esac
-
-### Let's recognize common machines as not being operating systems so
-### that things like config.sub decstation-3100 work. We also
-### recognize some manufacturers as not being operating systems, so we
-### can provide default operating systems below.
-case $os in
- -sun*os*)
- # Prevent following clause from handling this invalid input.
- ;;
- -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
- -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
- -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
- -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
- -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
- -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
- -apple | -axis)
- os=
- basic_machine=$1
- ;;
- -sim | -cisco | -oki | -wec | -winbond)
- os=
- basic_machine=$1
- ;;
- -scout)
- ;;
- -wrs)
- os=-vxworks
- basic_machine=$1
- ;;
- -chorusos*)
- os=-chorusos
- basic_machine=$1
- ;;
- -chorusrdb)
- os=-chorusrdb
- basic_machine=$1
- ;;
- -hiux*)
- os=-hiuxwe2
- ;;
- -sco5)
- os=-sco3.2v5
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco4)
- os=-sco3.2v4
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco3.2.[4-9]*)
- os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco3.2v[4-9]*)
- # Don't forget version if it is 3.2v4 or newer.
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco*)
- os=-sco3.2v2
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -udk*)
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -isc)
- os=-isc2.2
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -clix*)
- basic_machine=clipper-intergraph
- ;;
- -isc*)
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -lynx*)
- os=-lynxos
- ;;
- -ptx*)
- basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
- ;;
- -windowsnt*)
- os=`echo $os | sed -e 's/windowsnt/winnt/'`
- ;;
- -psos*)
- os=-psos
- ;;
- -mint | -mint[0-9]*)
- basic_machine=m68k-atari
- os=-mint
- ;;
-esac
-
-# Decode aliases for certain CPU-COMPANY combinations.
-case $basic_machine in
- # Recognize the basic CPU types without company name.
- # Some are omitted here because they have special meanings below.
- 1750a | 580 \
- | a29k \
- | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
- | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
- | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \
- | clipper \
- | d10v | d30v | dlx | dsp16xx \
- | fr30 | frv \
- | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
- | i370 | i860 | i960 | ia64 \
- | ip2k \
- | m32r | m68000 | m68k | m88k | mcore \
- | mips | mipsbe | mipseb | mipsel | mipsle \
- | mips16 \
- | mips64 | mips64el \
- | mips64vr | mips64vrel \
- | mips64orion | mips64orionel \
- | mips64vr4100 | mips64vr4100el \
- | mips64vr4300 | mips64vr4300el \
- | mips64vr5000 | mips64vr5000el \
- | mipsisa32 | mipsisa32el \
- | mipsisa32r2 | mipsisa32r2el \
- | mipsisa64 | mipsisa64el \
- | mipsisa64sb1 | mipsisa64sb1el \
- | mipsisa64sr71k | mipsisa64sr71kel \
- | mipstx39 | mipstx39el \
- | mn10200 | mn10300 \
- | msp430 \
- | ns16k | ns32k \
- | openrisc | or32 \
- | pdp10 | pdp11 | pj | pjl \
- | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
- | pyramid \
- | sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \
- | sh64 | sh64le \
- | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv9 | sparcv9b \
- | strongarm \
- | tahoe | thumb | tic80 | tron \
- | v850 | v850e \
- | we32k \
- | x86 | xscale | xstormy16 | xtensa \
- | z8k)
- basic_machine=$basic_machine-unknown
- ;;
- m6811 | m68hc11 | m6812 | m68hc12)
- # Motorola 68HC11/12.
- basic_machine=$basic_machine-unknown
- os=-none
- ;;
- m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
- ;;
-
- # We use `pc' rather than `unknown'
- # because (1) that's what they normally are, and
- # (2) the word "unknown" tends to confuse beginning users.
- i*86 | x86_64)
- basic_machine=$basic_machine-pc
- ;;
- # Object if more than one company name word.
- *-*-*)
- echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
- exit 1
- ;;
- # Recognize the basic CPU types with company name.
- 580-* \
- | a29k-* \
- | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
- | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
- | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
- | arm-* | armbe-* | armle-* | armeb-* | armv*-* \
- | avr-* \
- | bs2000-* \
- | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
- | clipper-* | cydra-* \
- | d10v-* | d30v-* | dlx-* \
- | elxsi-* \
- | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \
- | h8300-* | h8500-* \
- | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
- | i*86-* | i860-* | i960-* | ia64-* \
- | ip2k-* \
- | m32r-* \
- | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
- | m88110-* | m88k-* | mcore-* \
- | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
- | mips16-* \
- | mips64-* | mips64el-* \
- | mips64vr-* | mips64vrel-* \
- | mips64orion-* | mips64orionel-* \
- | mips64vr4100-* | mips64vr4100el-* \
- | mips64vr4300-* | mips64vr4300el-* \
- | mips64vr5000-* | mips64vr5000el-* \
- | mipsisa32-* | mipsisa32el-* \
- | mipsisa32r2-* | mipsisa32r2el-* \
- | mipsisa64-* | mipsisa64el-* \
- | mipsisa64sb1-* | mipsisa64sb1el-* \
- | mipsisa64sr71k-* | mipsisa64sr71kel-* \
- | mipstx39-* | mipstx39el-* \
- | msp430-* \
- | none-* | np1-* | nv1-* | ns16k-* | ns32k-* \
- | orion-* \
- | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
- | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
- | pyramid-* \
- | romp-* | rs6000-* \
- | sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \
- | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
- | sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \
- | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \
- | tahoe-* | thumb-* \
- | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
- | tron-* \
- | v850-* | v850e-* | vax-* \
- | we32k-* \
- | x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \
- | xtensa-* \
- | ymp-* \
- | z8k-*)
- ;;
- # Recognize the various machine names and aliases which stand
- # for a CPU type and a company and sometimes even an OS.
- 386bsd)
- basic_machine=i386-unknown
- os=-bsd
- ;;
- 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
- basic_machine=m68000-att
- ;;
- 3b*)
- basic_machine=we32k-att
- ;;
- a29khif)
- basic_machine=a29k-amd
- os=-udi
- ;;
- adobe68k)
- basic_machine=m68010-adobe
- os=-scout
- ;;
- alliant | fx80)
- basic_machine=fx80-alliant
- ;;
- altos | altos3068)
- basic_machine=m68k-altos
- ;;
- am29k)
- basic_machine=a29k-none
- os=-bsd
- ;;
- amdahl)
- basic_machine=580-amdahl
- os=-sysv
- ;;
- amiga | amiga-*)
- basic_machine=m68k-unknown
- ;;
- amigaos | amigados)
- basic_machine=m68k-unknown
- os=-amigaos
- ;;
- amigaunix | amix)
- basic_machine=m68k-unknown
- os=-sysv4
- ;;
- apollo68)
- basic_machine=m68k-apollo
- os=-sysv
- ;;
- apollo68bsd)
- basic_machine=m68k-apollo
- os=-bsd
- ;;
- aux)
- basic_machine=m68k-apple
- os=-aux
- ;;
- balance)
- basic_machine=ns32k-sequent
- os=-dynix
- ;;
- c90)
- basic_machine=c90-cray
- os=-unicos
- ;;
- convex-c1)
- basic_machine=c1-convex
- os=-bsd
- ;;
- convex-c2)
- basic_machine=c2-convex
- os=-bsd
- ;;
- convex-c32)
- basic_machine=c32-convex
- os=-bsd
- ;;
- convex-c34)
- basic_machine=c34-convex
- os=-bsd
- ;;
- convex-c38)
- basic_machine=c38-convex
- os=-bsd
- ;;
- cray | j90)
- basic_machine=j90-cray
- os=-unicos
- ;;
- crds | unos)
- basic_machine=m68k-crds
- ;;
- cris | cris-* | etrax*)
- basic_machine=cris-axis
- ;;
- da30 | da30-*)
- basic_machine=m68k-da30
- ;;
- decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
- basic_machine=mips-dec
- ;;
- decsystem10* | dec10*)
- basic_machine=pdp10-dec
- os=-tops10
- ;;
- decsystem20* | dec20*)
- basic_machine=pdp10-dec
- os=-tops20
- ;;
- delta | 3300 | motorola-3300 | motorola-delta \
- | 3300-motorola | delta-motorola)
- basic_machine=m68k-motorola
- ;;
- delta88)
- basic_machine=m88k-motorola
- os=-sysv3
- ;;
- dpx20 | dpx20-*)
- basic_machine=rs6000-bull
- os=-bosx
- ;;
- dpx2* | dpx2*-bull)
- basic_machine=m68k-bull
- os=-sysv3
- ;;
- ebmon29k)
- basic_machine=a29k-amd
- os=-ebmon
- ;;
- elxsi)
- basic_machine=elxsi-elxsi
- os=-bsd
- ;;
- encore | umax | mmax)
- basic_machine=ns32k-encore
- ;;
- es1800 | OSE68k | ose68k | ose | OSE)
- basic_machine=m68k-ericsson
- os=-ose
- ;;
- fx2800)
- basic_machine=i860-alliant
- ;;
- genix)
- basic_machine=ns32k-ns
- ;;
- gmicro)
- basic_machine=tron-gmicro
- os=-sysv
- ;;
- go32)
- basic_machine=i386-pc
- os=-go32
- ;;
- h3050r* | hiux*)
- basic_machine=hppa1.1-hitachi
- os=-hiuxwe2
- ;;
- h8300hms)
- basic_machine=h8300-hitachi
- os=-hms
- ;;
- h8300xray)
- basic_machine=h8300-hitachi
- os=-xray
- ;;
- h8500hms)
- basic_machine=h8500-hitachi
- os=-hms
- ;;
- harris)
- basic_machine=m88k-harris
- os=-sysv3
- ;;
- hp300-*)
- basic_machine=m68k-hp
- ;;
- hp300bsd)
- basic_machine=m68k-hp
- os=-bsd
- ;;
- hp300hpux)
- basic_machine=m68k-hp
- os=-hpux
- ;;
- hp3k9[0-9][0-9] | hp9[0-9][0-9])
- basic_machine=hppa1.0-hp
- ;;
- hp9k2[0-9][0-9] | hp9k31[0-9])
- basic_machine=m68000-hp
- ;;
- hp9k3[2-9][0-9])
- basic_machine=m68k-hp
- ;;
- hp9k6[0-9][0-9] | hp6[0-9][0-9])
- basic_machine=hppa1.0-hp
- ;;
- hp9k7[0-79][0-9] | hp7[0-79][0-9])
- basic_machine=hppa1.1-hp
- ;;
- hp9k78[0-9] | hp78[0-9])
- # FIXME: really hppa2.0-hp
- basic_machine=hppa1.1-hp
- ;;
- hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
- # FIXME: really hppa2.0-hp
- basic_machine=hppa1.1-hp
- ;;
- hp9k8[0-9][13679] | hp8[0-9][13679])
- basic_machine=hppa1.1-hp
- ;;
- hp9k8[0-9][0-9] | hp8[0-9][0-9])
- basic_machine=hppa1.0-hp
- ;;
- hppa-next)
- os=-nextstep3
- ;;
- hppaosf)
- basic_machine=hppa1.1-hp
- os=-osf
- ;;
- hppro)
- basic_machine=hppa1.1-hp
- os=-proelf
- ;;
- i370-ibm* | ibm*)
- basic_machine=i370-ibm
- ;;
-# I'm not sure what "Sysv32" means. Should this be sysv3.2?
- i*86v32)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
- os=-sysv32
- ;;
- i*86v4*)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
- os=-sysv4
- ;;
- i*86v)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
- os=-sysv
- ;;
- i*86sol2)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
- os=-solaris2
- ;;
- i386mach)
- basic_machine=i386-mach
- os=-mach
- ;;
- i386-vsta | vsta)
- basic_machine=i386-unknown
- os=-vsta
- ;;
- iris | iris4d)
- basic_machine=mips-sgi
- case $os in
- -irix*)
- ;;
- *)
- os=-irix4
- ;;
- esac
- ;;
- isi68 | isi)
- basic_machine=m68k-isi
- os=-sysv
- ;;
- m88k-omron*)
- basic_machine=m88k-omron
- ;;
- magnum | m3230)
- basic_machine=mips-mips
- os=-sysv
- ;;
- merlin)
- basic_machine=ns32k-utek
- os=-sysv
- ;;
- mingw32)
- basic_machine=i386-pc
- os=-mingw32
- ;;
- miniframe)
- basic_machine=m68000-convergent
- ;;
- *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
- basic_machine=m68k-atari
- os=-mint
- ;;
- mips3*-*)
- basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
- ;;
- mips3*)
- basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
- ;;
- mmix*)
- basic_machine=mmix-knuth
- os=-mmixware
- ;;
- monitor)
- basic_machine=m68k-rom68k
- os=-coff
- ;;
- morphos)
- basic_machine=powerpc-unknown
- os=-morphos
- ;;
- msdos)
- basic_machine=i386-pc
- os=-msdos
- ;;
- mvs)
- basic_machine=i370-ibm
- os=-mvs
- ;;
- ncr3000)
- basic_machine=i486-ncr
- os=-sysv4
- ;;
- netbsd386)
- basic_machine=i386-unknown
- os=-netbsd
- ;;
- netwinder)
- basic_machine=armv4l-rebel
- os=-linux
- ;;
- news | news700 | news800 | news900)
- basic_machine=m68k-sony
- os=-newsos
- ;;
- news1000)
- basic_machine=m68030-sony
- os=-newsos
- ;;
- news-3600 | risc-news)
- basic_machine=mips-sony
- os=-newsos
- ;;
- necv70)
- basic_machine=v70-nec
- os=-sysv
- ;;
- next | m*-next )
- basic_machine=m68k-next
- case $os in
- -nextstep* )
- ;;
- -ns2*)
- os=-nextstep2
- ;;
- *)
- os=-nextstep3
- ;;
- esac
- ;;
- nh3000)
- basic_machine=m68k-harris
- os=-cxux
- ;;
- nh[45]000)
- basic_machine=m88k-harris
- os=-cxux
- ;;
- nindy960)
- basic_machine=i960-intel
- os=-nindy
- ;;
- mon960)
- basic_machine=i960-intel
- os=-mon960
- ;;
- nonstopux)
- basic_machine=mips-compaq
- os=-nonstopux
- ;;
- np1)
- basic_machine=np1-gould
- ;;
- nv1)
- basic_machine=nv1-cray
- os=-unicosmp
- ;;
- nsr-tandem)
- basic_machine=nsr-tandem
- ;;
- op50n-* | op60c-*)
- basic_machine=hppa1.1-oki
- os=-proelf
- ;;
- or32 | or32-*)
- basic_machine=or32-unknown
- os=-coff
- ;;
- OSE68000 | ose68000)
- basic_machine=m68000-ericsson
- os=-ose
- ;;
- os68k)
- basic_machine=m68k-none
- os=-os68k
- ;;
- pa-hitachi)
- basic_machine=hppa1.1-hitachi
- os=-hiuxwe2
- ;;
- paragon)
- basic_machine=i860-intel
- os=-osf
- ;;
- pbd)
- basic_machine=sparc-tti
- ;;
- pbb)
- basic_machine=m68k-tti
- ;;
- pc532 | pc532-*)
- basic_machine=ns32k-pc532
- ;;
- pentium | p5 | k5 | k6 | nexgen | viac3)
- basic_machine=i586-pc
- ;;
- pentiumpro | p6 | 6x86 | athlon | athlon_*)
- basic_machine=i686-pc
- ;;
- pentiumii | pentium2)
- basic_machine=i686-pc
- ;;
- pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
- basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- pentiumpro-* | p6-* | 6x86-* | athlon-*)
- basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- pentiumii-* | pentium2-*)
- basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- pn)
- basic_machine=pn-gould
- ;;
- power) basic_machine=power-ibm
- ;;
- ppc) basic_machine=powerpc-unknown
- ;;
- ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- ppcle | powerpclittle | ppc-le | powerpc-little)
- basic_machine=powerpcle-unknown
- ;;
- ppcle-* | powerpclittle-*)
- basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- ppc64) basic_machine=powerpc64-unknown
- ;;
- ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- ppc64le | powerpc64little | ppc64-le | powerpc64-little)
- basic_machine=powerpc64le-unknown
- ;;
- ppc64le-* | powerpc64little-*)
- basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- ps2)
- basic_machine=i386-ibm
- ;;
- pw32)
- basic_machine=i586-unknown
- os=-pw32
- ;;
- rom68k)
- basic_machine=m68k-rom68k
- os=-coff
- ;;
- rm[46]00)
- basic_machine=mips-siemens
- ;;
- rtpc | rtpc-*)
- basic_machine=romp-ibm
- ;;
- s390 | s390-*)
- basic_machine=s390-ibm
- ;;
- s390x | s390x-*)
- basic_machine=s390x-ibm
- ;;
- sa29200)
- basic_machine=a29k-amd
- os=-udi
- ;;
- sb1)
- basic_machine=mipsisa64sb1-unknown
- ;;
- sb1el)
- basic_machine=mipsisa64sb1el-unknown
- ;;
- sequent)
- basic_machine=i386-sequent
- ;;
- sh)
- basic_machine=sh-hitachi
- os=-hms
- ;;
- sparclite-wrs | simso-wrs)
- basic_machine=sparclite-wrs
- os=-vxworks
- ;;
- sps7)
- basic_machine=m68k-bull
- os=-sysv2
- ;;
- spur)
- basic_machine=spur-unknown
- ;;
- st2000)
- basic_machine=m68k-tandem
- ;;
- stratus)
- basic_machine=i860-stratus
- os=-sysv4
- ;;
- sun2)
- basic_machine=m68000-sun
- ;;
- sun2os3)
- basic_machine=m68000-sun
- os=-sunos3
- ;;
- sun2os4)
- basic_machine=m68000-sun
- os=-sunos4
- ;;
- sun3os3)
- basic_machine=m68k-sun
- os=-sunos3
- ;;
- sun3os4)
- basic_machine=m68k-sun
- os=-sunos4
- ;;
- sun4os3)
- basic_machine=sparc-sun
- os=-sunos3
- ;;
- sun4os4)
- basic_machine=sparc-sun
- os=-sunos4
- ;;
- sun4sol2)
- basic_machine=sparc-sun
- os=-solaris2
- ;;
- sun3 | sun3-*)
- basic_machine=m68k-sun
- ;;
- sun4)
- basic_machine=sparc-sun
- ;;
- sun386 | sun386i | roadrunner)
- basic_machine=i386-sun
- ;;
- sv1)
- basic_machine=sv1-cray
- os=-unicos
- ;;
- symmetry)
- basic_machine=i386-sequent
- os=-dynix
- ;;
- t3e)
- basic_machine=alphaev5-cray
- os=-unicos
- ;;
- t90)
- basic_machine=t90-cray
- os=-unicos
- ;;
- tic4x | c4x*)
- basic_machine=tic4x-unknown
- os=-coff
- ;;
- tic54x | c54x*)
- basic_machine=tic54x-unknown
- os=-coff
- ;;
- tic55x | c55x*)
- basic_machine=tic55x-unknown
- os=-coff
- ;;
- tic6x | c6x*)
- basic_machine=tic6x-unknown
- os=-coff
- ;;
- tx39)
- basic_machine=mipstx39-unknown
- ;;
- tx39el)
- basic_machine=mipstx39el-unknown
- ;;
- toad1)
- basic_machine=pdp10-xkl
- os=-tops20
- ;;
- tower | tower-32)
- basic_machine=m68k-ncr
- ;;
- udi29k)
- basic_machine=a29k-amd
- os=-udi
- ;;
- ultra3)
- basic_machine=a29k-nyu
- os=-sym1
- ;;
- v810 | necv810)
- basic_machine=v810-nec
- os=-none
- ;;
- vaxv)
- basic_machine=vax-dec
- os=-sysv
- ;;
- vms)
- basic_machine=vax-dec
- os=-vms
- ;;
- vpp*|vx|vx-*)
- basic_machine=f301-fujitsu
- ;;
- vxworks960)
- basic_machine=i960-wrs
- os=-vxworks
- ;;
- vxworks68)
- basic_machine=m68k-wrs
- os=-vxworks
- ;;
- vxworks29k)
- basic_machine=a29k-wrs
- os=-vxworks
- ;;
- w65*)
- basic_machine=w65-wdc
- os=-none
- ;;
- w89k-*)
- basic_machine=hppa1.1-winbond
- os=-proelf
- ;;
- xps | xps100)
- basic_machine=xps100-honeywell
- ;;
- ymp)
- basic_machine=ymp-cray
- os=-unicos
- ;;
- z8k-*-coff)
- basic_machine=z8k-unknown
- os=-sim
- ;;
- none)
- basic_machine=none-none
- os=-none
- ;;
-
-# Here we handle the default manufacturer of certain CPU types. It is in
-# some cases the only manufacturer, in others, it is the most popular.
- w89k)
- basic_machine=hppa1.1-winbond
- ;;
- op50n)
- basic_machine=hppa1.1-oki
- ;;
- op60c)
- basic_machine=hppa1.1-oki
- ;;
- romp)
- basic_machine=romp-ibm
- ;;
- rs6000)
- basic_machine=rs6000-ibm
- ;;
- vax)
- basic_machine=vax-dec
- ;;
- pdp10)
- # there are many clones, so DEC is not a safe bet
- basic_machine=pdp10-unknown
- ;;
- pdp11)
- basic_machine=pdp11-dec
- ;;
- we32k)
- basic_machine=we32k-att
- ;;
- sh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele)
- basic_machine=sh-unknown
- ;;
- sh64)
- basic_machine=sh64-unknown
- ;;
- sparc | sparcv9 | sparcv9b)
- basic_machine=sparc-sun
- ;;
- cydra)
- basic_machine=cydra-cydrome
- ;;
- orion)
- basic_machine=orion-highlevel
- ;;
- orion105)
- basic_machine=clipper-highlevel
- ;;
- mac | mpw | mac-mpw)
- basic_machine=m68k-apple
- ;;
- pmac | pmac-mpw)
- basic_machine=powerpc-apple
- ;;
- *-unknown)
- # Make sure to match an already-canonicalized machine name.
- ;;
- *)
- echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
- exit 1
- ;;
-esac
-
-# Here we canonicalize certain aliases for manufacturers.
-case $basic_machine in
- *-digital*)
- basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
- ;;
- *-commodore*)
- basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
- ;;
- *)
- ;;
-esac
-
-# Decode manufacturer-specific aliases for certain operating systems.
-
-if [ x"$os" != x"" ]
-then
-case $os in
- # First match some system type aliases
- # that might get confused with valid system types.
- # -solaris* is a basic system type, with this one exception.
- -solaris1 | -solaris1.*)
- os=`echo $os | sed -e 's|solaris1|sunos4|'`
- ;;
- -solaris)
- os=-solaris2
- ;;
- -svr4*)
- os=-sysv4
- ;;
- -unixware*)
- os=-sysv4.2uw
- ;;
- -gnu/linux*)
- os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
- ;;
- # First accept the basic system types.
- # The portable systems comes first.
- # Each alternative MUST END IN A *, to match a version number.
- # -sysv* is not here because it comes later, after sysvr4.
- -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
- | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
- | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
- | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
- | -aos* \
- | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
- | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
- | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \
- | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
- | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
- | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
- | -chorusos* | -chorusrdb* \
- | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
- | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
- | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
- | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
- | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
- | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
- | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
- | -powermax* | -dnix*)
- # Remember, each alternative MUST END IN *, to match a version number.
- ;;
- -qnx*)
- case $basic_machine in
- x86-* | i*86-*)
- ;;
- *)
- os=-nto$os
- ;;
- esac
- ;;
- -nto-qnx*)
- ;;
- -nto*)
- os=`echo $os | sed -e 's|nto|nto-qnx|'`
- ;;
- -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
- | -windows* | -osx | -abug | -netware* | -os9* | -beos* \
- | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
- ;;
- -mac*)
- os=`echo $os | sed -e 's|mac|macos|'`
- ;;
- -linux*)
- os=`echo $os | sed -e 's|linux|linux-gnu|'`
- ;;
- -sunos5*)
- os=`echo $os | sed -e 's|sunos5|solaris2|'`
- ;;
- -sunos6*)
- os=`echo $os | sed -e 's|sunos6|solaris3|'`
- ;;
- -opened*)
- os=-openedition
- ;;
- -wince*)
- os=-wince
- ;;
- -osfrose*)
- os=-osfrose
- ;;
- -osf*)
- os=-osf
- ;;
- -utek*)
- os=-bsd
- ;;
- -dynix*)
- os=-bsd
- ;;
- -acis*)
- os=-aos
- ;;
- -atheos*)
- os=-atheos
- ;;
- -386bsd)
- os=-bsd
- ;;
- -ctix* | -uts*)
- os=-sysv
- ;;
- -nova*)
- os=-rtmk-nova
- ;;
- -ns2 )
- os=-nextstep2
- ;;
- -nsk*)
- os=-nsk
- ;;
- # Preserve the version number of sinix5.
- -sinix5.*)
- os=`echo $os | sed -e 's|sinix|sysv|'`
- ;;
- -sinix*)
- os=-sysv4
- ;;
- -triton*)
- os=-sysv3
- ;;
- -oss*)
- os=-sysv3
- ;;
- -svr4)
- os=-sysv4
- ;;
- -svr3)
- os=-sysv3
- ;;
- -sysvr4)
- os=-sysv4
- ;;
- # This must come after -sysvr4.
- -sysv*)
- ;;
- -ose*)
- os=-ose
- ;;
- -es1800*)
- os=-ose
- ;;
- -xenix)
- os=-xenix
- ;;
- -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
- os=-mint
- ;;
- -aros*)
- os=-aros
- ;;
- -kaos*)
- os=-kaos
- ;;
- -none)
- ;;
- *)
- # Get rid of the `-' at the beginning of $os.
- os=`echo $os | sed 's/[^-]*-//'`
- echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
- exit 1
- ;;
-esac
-else
-
-# Here we handle the default operating systems that come with various machines.
-# The value should be what the vendor currently ships out the door with their
-# machine or put another way, the most popular os provided with the machine.
-
-# Note that if you're going to try to match "-MANUFACTURER" here (say,
-# "-sun"), then you have to tell the case statement up towards the top
-# that MANUFACTURER isn't an operating system. Otherwise, code above
-# will signal an error saying that MANUFACTURER isn't an operating
-# system, and we'll never get to this point.
-
-case $basic_machine in
- *-acorn)
- os=-riscix1.2
- ;;
- arm*-rebel)
- os=-linux
- ;;
- arm*-semi)
- os=-aout
- ;;
- # This must come before the *-dec entry.
- pdp10-*)
- os=-tops20
- ;;
- pdp11-*)
- os=-none
- ;;
- *-dec | vax-*)
- os=-ultrix4.2
- ;;
- m68*-apollo)
- os=-domain
- ;;
- i386-sun)
- os=-sunos4.0.2
- ;;
- m68000-sun)
- os=-sunos3
- # This also exists in the configure program, but was not the
- # default.
- # os=-sunos4
- ;;
- m68*-cisco)
- os=-aout
- ;;
- mips*-cisco)
- os=-elf
- ;;
- mips*-*)
- os=-elf
- ;;
- or32-*)
- os=-coff
- ;;
- *-tti) # must be before sparc entry or we get the wrong os.
- os=-sysv3
- ;;
- sparc-* | *-sun)
- os=-sunos4.1.1
- ;;
- *-be)
- os=-beos
- ;;
- *-ibm)
- os=-aix
- ;;
- *-wec)
- os=-proelf
- ;;
- *-winbond)
- os=-proelf
- ;;
- *-oki)
- os=-proelf
- ;;
- *-hp)
- os=-hpux
- ;;
- *-hitachi)
- os=-hiux
- ;;
- i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
- os=-sysv
- ;;
- *-cbm)
- os=-amigaos
- ;;
- *-dg)
- os=-dgux
- ;;
- *-dolphin)
- os=-sysv3
- ;;
- m68k-ccur)
- os=-rtu
- ;;
- m88k-omron*)
- os=-luna
- ;;
- *-next )
- os=-nextstep
- ;;
- *-sequent)
- os=-ptx
- ;;
- *-crds)
- os=-unos
- ;;
- *-ns)
- os=-genix
- ;;
- i370-*)
- os=-mvs
- ;;
- *-next)
- os=-nextstep3
- ;;
- *-gould)
- os=-sysv
- ;;
- *-highlevel)
- os=-bsd
- ;;
- *-encore)
- os=-bsd
- ;;
- *-sgi)
- os=-irix
- ;;
- *-siemens)
- os=-sysv4
- ;;
- *-masscomp)
- os=-rtu
- ;;
- f30[01]-fujitsu | f700-fujitsu)
- os=-uxpv
- ;;
- *-rom68k)
- os=-coff
- ;;
- *-*bug)
- os=-coff
- ;;
- *-apple)
- os=-macos
- ;;
- *-atari*)
- os=-mint
- ;;
- *)
- os=-none
- ;;
-esac
-fi
-
-# Here we handle the case where we know the os, and the CPU type, but not the
-# manufacturer. We pick the logical manufacturer.
-vendor=unknown
-case $basic_machine in
- *-unknown)
- case $os in
- -riscix*)
- vendor=acorn
- ;;
- -sunos*)
- vendor=sun
- ;;
- -aix*)
- vendor=ibm
- ;;
- -beos*)
- vendor=be
- ;;
- -hpux*)
- vendor=hp
- ;;
- -mpeix*)
- vendor=hp
- ;;
- -hiux*)
- vendor=hitachi
- ;;
- -unos*)
- vendor=crds
- ;;
- -dgux*)
- vendor=dg
- ;;
- -luna*)
- vendor=omron
- ;;
- -genix*)
- vendor=ns
- ;;
- -mvs* | -opened*)
- vendor=ibm
- ;;
- -ptx*)
- vendor=sequent
- ;;
- -vxsim* | -vxworks* | -windiss*)
- vendor=wrs
- ;;
- -aux*)
- vendor=apple
- ;;
- -hms*)
- vendor=hitachi
- ;;
- -mpw* | -macos*)
- vendor=apple
- ;;
- -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
- vendor=atari
- ;;
- -vos*)
- vendor=stratus
- ;;
- esac
- basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
- ;;
-esac
-
-echo $basic_machine$os
-exit 0
-
-# Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
-# time-stamp-start: "timestamp='"
-# time-stamp-format: "%:y-%02m-%02d"
-# time-stamp-end: "'"
-# End:
diff --git a/release_23/projects/sample/autoconf/configure.ac b/release_23/projects/sample/autoconf/configure.ac
deleted file mode 100644
index 37c93a8f5152..000000000000
--- a/release_23/projects/sample/autoconf/configure.ac
+++ /dev/null
@@ -1,68 +0,0 @@
-dnl **************************************************************************
-dnl * Initialize
-dnl **************************************************************************
-AC_INIT([[[SAMPLE]]],[[[x.xx]]],[bugs@yourdomain])
-
-dnl Identify where LLVM source tree is
-LLVM_SRC_ROOT="../../"
-LLVM_OBJ_ROOT="../../"
-dnl Tell autoconf that the auxilliary files are actually located in
-dnl the LLVM autoconf directory, not here.
-AC_CONFIG_AUX_DIR($LLVM_SRC_ROOT/autoconf)
-
-dnl Tell autoconf that this is an LLVM project being configured
-dnl This provides the --with-llvmsrc and --with-llvmobj options
-LLVM_CONFIG_PROJECT($LLVM_SRC_ROOT,$LLVM_OBJ_ROOT)
-
-dnl Verify that the source directory is valid
-AC_CONFIG_SRCDIR(["Makefile.common.in"])
-
-dnl Configure a common Makefile
-AC_CONFIG_FILES(Makefile.common)
-
-dnl Configure project makefiles
-dnl List every Makefile that exists within your source tree
-AC_CONFIG_MAKEFILE(Makefile)
-AC_CONFIG_MAKEFILE(lib/Makefile)
-AC_CONFIG_MAKEFILE(lib/sample/Makefile)
-AC_CONFIG_MAKEFILE(tools/Makefile)
-AC_CONFIG_MAKEFILE(tools/sample/Makefile)
-
-dnl **************************************************************************
-dnl * Determine which system we are building on
-dnl **************************************************************************
-
-dnl **************************************************************************
-dnl * Check for programs.
-dnl **************************************************************************
-
-dnl **************************************************************************
-dnl * Check for libraries.
-dnl **************************************************************************
-
-dnl **************************************************************************
-dnl * Checks for header files.
-dnl **************************************************************************
-
-dnl **************************************************************************
-dnl * Checks for typedefs, structures, and compiler characteristics.
-dnl **************************************************************************
-
-dnl **************************************************************************
-dnl * Checks for library functions.
-dnl **************************************************************************
-
-dnl **************************************************************************
-dnl * Enable various compile-time options
-dnl **************************************************************************
-
-dnl **************************************************************************
-dnl * Set the location of various third-party software packages
-dnl **************************************************************************
-
-dnl **************************************************************************
-dnl * Create the output files
-dnl **************************************************************************
-
-dnl This must be last
-AC_OUTPUT
diff --git a/release_23/projects/sample/configure b/release_23/projects/sample/configure
deleted file mode 100755
index 2efb85397b7c..000000000000
--- a/release_23/projects/sample/configure
+++ /dev/null
@@ -1,2364 +0,0 @@
-#! /bin/sh
-# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.59 for [SAMPLE] [x.xx].
-#
-# Report bugs to <bugs@yourdomain>.
-#
-# Copyright (C) 2003 Free Software Foundation, Inc.
-# This configure script is free software; the Free Software Foundation
-# gives unlimited permission to copy, distribute and modify it.
-## --------------------- ##
-## M4sh Initialization. ##
-## --------------------- ##
-
-# Be Bourne compatible
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
- emulate sh
- NULLCMD=:
- # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
- # is contrary to our usage. Disable this feature.
- alias -g '${1+"$@"}'='"$@"'
-elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
- set -o posix
-fi
-DUALCASE=1; export DUALCASE # for MKS sh
-
-# Support unset when possible.
-if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
- as_unset=unset
-else
- as_unset=false
-fi
-
-
-# Work around bugs in pre-3.0 UWIN ksh.
-$as_unset ENV MAIL MAILPATH
-PS1='$ '
-PS2='> '
-PS4='+ '
-
-# NLS nuisances.
-for as_var in \
- LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
- LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
- LC_TELEPHONE LC_TIME
-do
- if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
- eval $as_var=C; export $as_var
- else
- $as_unset $as_var
- fi
-done
-
-# Required to use basename.
-if expr a : '\(a\)' >/dev/null 2>&1; then
- as_expr=expr
-else
- as_expr=false
-fi
-
-if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
- as_basename=basename
-else
- as_basename=false
-fi
-
-
-# Name of the executable.
-as_me=`$as_basename "$0" ||
-$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
- X"$0" : 'X\(//\)$' \| \
- X"$0" : 'X\(/\)$' \| \
- . : '\(.\)' 2>/dev/null ||
-echo X/"$0" |
- sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
- /^X\/\(\/\/\)$/{ s//\1/; q; }
- /^X\/\(\/\).*/{ s//\1/; q; }
- s/.*/./; q'`
-
-
-# PATH needs CR, and LINENO needs CR and PATH.
-# Avoid depending upon Character Ranges.
-as_cr_letters='abcdefghijklmnopqrstuvwxyz'
-as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
-as_cr_Letters=$as_cr_letters$as_cr_LETTERS
-as_cr_digits='0123456789'
-as_cr_alnum=$as_cr_Letters$as_cr_digits
-
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
- echo "#! /bin/sh" >conf$$.sh
- echo "exit 0" >>conf$$.sh
- chmod +x conf$$.sh
- if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
- PATH_SEPARATOR=';'
- else
- PATH_SEPARATOR=:
- fi
- rm -f conf$$.sh
-fi
-
-
- as_lineno_1=$LINENO
- as_lineno_2=$LINENO
- as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
- test "x$as_lineno_1" != "x$as_lineno_2" &&
- test "x$as_lineno_3" = "x$as_lineno_2" || {
- # Find who we are. Look in the path if we contain no path at all
- # relative or not.
- case $0 in
- *[\\/]* ) as_myself=$0 ;;
- *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
-done
-
- ;;
- esac
- # We did not find ourselves, most probably we were run as `sh COMMAND'
- # in which case we are not to be found in the path.
- if test "x$as_myself" = x; then
- as_myself=$0
- fi
- if test ! -f "$as_myself"; then
- { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2
- { (exit 1); exit 1; }; }
- fi
- case $CONFIG_SHELL in
- '')
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for as_base in sh bash ksh sh5; do
- case $as_dir in
- /*)
- if ("$as_dir/$as_base" -c '
- as_lineno_1=$LINENO
- as_lineno_2=$LINENO
- as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
- test "x$as_lineno_1" != "x$as_lineno_2" &&
- test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then
- $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
- $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
- CONFIG_SHELL=$as_dir/$as_base
- export CONFIG_SHELL
- exec "$CONFIG_SHELL" "$0" ${1+"$@"}
- fi;;
- esac
- done
-done
-;;
- esac
-
- # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
- # uniformly replaced by the line number. The first 'sed' inserts a
- # line-number line before each line; the second 'sed' does the real
- # work. The second script uses 'N' to pair each line-number line
- # with the numbered line, and appends trailing '-' during
- # substitution so that $LINENO is not a special case at line end.
- # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
- # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-)
- sed '=' <$as_myself |
- sed '
- N
- s,$,-,
- : loop
- s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
- t loop
- s,-$,,
- s,^['$as_cr_digits']*\n,,
- ' >$as_me.lineno &&
- chmod +x $as_me.lineno ||
- { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
- { (exit 1); exit 1; }; }
-
- # Don't try to exec as it changes $[0], causing all sort of problems
- # (the dirname of $[0] is not the place where we might find the
- # original and so on. Autoconf is especially sensible to this).
- . ./$as_me.lineno
- # Exit status is that of the last command.
- exit
-}
-
-
-case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
- *c*,-n*) ECHO_N= ECHO_C='
-' ECHO_T=' ' ;;
- *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;;
- *) ECHO_N= ECHO_C='\c' ECHO_T= ;;
-esac
-
-if expr a : '\(a\)' >/dev/null 2>&1; then
- as_expr=expr
-else
- as_expr=false
-fi
-
-rm -f conf$$ conf$$.exe conf$$.file
-echo >conf$$.file
-if ln -s conf$$.file conf$$ 2>/dev/null; then
- # We could just check for DJGPP; but this test a) works b) is more generic
- # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
- if test -f conf$$.exe; then
- # Don't use ln at all; we don't have any links
- as_ln_s='cp -p'
- else
- as_ln_s='ln -s'
- fi
-elif ln conf$$.file conf$$ 2>/dev/null; then
- as_ln_s=ln
-else
- as_ln_s='cp -p'
-fi
-rm -f conf$$ conf$$.exe conf$$.file
-
-if mkdir -p . 2>/dev/null; then
- as_mkdir_p=:
-else
- test -d ./-p && rmdir ./-p
- as_mkdir_p=false
-fi
-
-as_executable_p="test -f"
-
-# Sed expression to map a string onto a valid CPP name.
-as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
-
-# Sed expression to map a string onto a valid variable name.
-as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
-
-
-# IFS
-# We need space, tab and new line, in precisely that order.
-as_nl='
-'
-IFS=" $as_nl"
-
-# CDPATH.
-$as_unset CDPATH
-
-
-# Name of the host.
-# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
-# so uname gets run too.
-ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
-
-exec 6>&1
-
-#
-# Initializations.
-#
-ac_default_prefix=/usr/local
-ac_config_libobj_dir=.
-cross_compiling=no
-subdirs=
-MFLAGS=
-MAKEFLAGS=
-SHELL=${CONFIG_SHELL-/bin/sh}
-
-# Maximum number of lines to put in a shell here document.
-# This variable seems obsolete. It should probably be removed, and
-# only ac_max_sed_lines should be used.
-: ${ac_max_here_lines=38}
-
-# Identity of this package.
-PACKAGE_NAME='[SAMPLE]'
-PACKAGE_TARNAME='--sample--'
-PACKAGE_VERSION='[x.xx]'
-PACKAGE_STRING='[SAMPLE] [x.xx]'
-PACKAGE_BUGREPORT='bugs@yourdomain'
-
-ac_unique_file=""Makefile.common.in""
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS LLVM_SRC LLVM_OBJ LIBOBJS LTLIBOBJS'
-ac_subst_files=''
-
-# Initialize some variables set by options.
-ac_init_help=
-ac_init_version=false
-# The variables have the same names as the options, with
-# dashes changed to underlines.
-cache_file=/dev/null
-exec_prefix=NONE
-no_create=
-no_recursion=
-prefix=NONE
-program_prefix=NONE
-program_suffix=NONE
-program_transform_name=s,x,x,
-silent=
-site=
-srcdir=
-verbose=
-x_includes=NONE
-x_libraries=NONE
-
-# Installation directory options.
-# These are left unexpanded so users can "make install exec_prefix=/foo"
-# and all the variables that are supposed to be based on exec_prefix
-# by default will actually change.
-# Use braces instead of parens because sh, perl, etc. also accept them.
-bindir='${exec_prefix}/bin'
-sbindir='${exec_prefix}/sbin'
-libexecdir='${exec_prefix}/libexec'
-datadir='${prefix}/share'
-sysconfdir='${prefix}/etc'
-sharedstatedir='${prefix}/com'
-localstatedir='${prefix}/var'
-libdir='${exec_prefix}/lib'
-includedir='${prefix}/include'
-oldincludedir='/usr/include'
-infodir='${prefix}/info'
-mandir='${prefix}/man'
-
-ac_prev=
-for ac_option
-do
- # If the previous option needs an argument, assign it.
- if test -n "$ac_prev"; then
- eval "$ac_prev=\$ac_option"
- ac_prev=
- continue
- fi
-
- ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
-
- # Accept the important Cygnus configure options, so we can diagnose typos.
-
- case $ac_option in
-
- -bindir | --bindir | --bindi | --bind | --bin | --bi)
- ac_prev=bindir ;;
- -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
- bindir=$ac_optarg ;;
-
- -build | --build | --buil | --bui | --bu)
- ac_prev=build_alias ;;
- -build=* | --build=* | --buil=* | --bui=* | --bu=*)
- build_alias=$ac_optarg ;;
-
- -cache-file | --cache-file | --cache-fil | --cache-fi \
- | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
- ac_prev=cache_file ;;
- -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
- | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
- cache_file=$ac_optarg ;;
-
- --config-cache | -C)
- cache_file=config.cache ;;
-
- -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
- ac_prev=datadir ;;
- -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
- | --da=*)
- datadir=$ac_optarg ;;
-
- -disable-* | --disable-*)
- ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
- # Reject names that are not valid shell variable names.
- expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
- { echo "$as_me: error: invalid feature name: $ac_feature" >&2
- { (exit 1); exit 1; }; }
- ac_feature=`echo $ac_feature | sed 's/-/_/g'`
- eval "enable_$ac_feature=no" ;;
-
- -enable-* | --enable-*)
- ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
- # Reject names that are not valid shell variable names.
- expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
- { echo "$as_me: error: invalid feature name: $ac_feature" >&2
- { (exit 1); exit 1; }; }
- ac_feature=`echo $ac_feature | sed 's/-/_/g'`
- case $ac_option in
- *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
- *) ac_optarg=yes ;;
- esac
- eval "enable_$ac_feature='$ac_optarg'" ;;
-
- -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
- | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
- | --exec | --exe | --ex)
- ac_prev=exec_prefix ;;
- -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
- | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
- | --exec=* | --exe=* | --ex=*)
- exec_prefix=$ac_optarg ;;
-
- -gas | --gas | --ga | --g)
- # Obsolete; use --with-gas.
- with_gas=yes ;;
-
- -help | --help | --hel | --he | -h)
- ac_init_help=long ;;
- -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
- ac_init_help=recursive ;;
- -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
- ac_init_help=short ;;
-
- -host | --host | --hos | --ho)
- ac_prev=host_alias ;;
- -host=* | --host=* | --hos=* | --ho=*)
- host_alias=$ac_optarg ;;
-
- -includedir | --includedir | --includedi | --included | --include \
- | --includ | --inclu | --incl | --inc)
- ac_prev=includedir ;;
- -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
- | --includ=* | --inclu=* | --incl=* | --inc=*)
- includedir=$ac_optarg ;;
-
- -infodir | --infodir | --infodi | --infod | --info | --inf)
- ac_prev=infodir ;;
- -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
- infodir=$ac_optarg ;;
-
- -libdir | --libdir | --libdi | --libd)
- ac_prev=libdir ;;
- -libdir=* | --libdir=* | --libdi=* | --libd=*)
- libdir=$ac_optarg ;;
-
- -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
- | --libexe | --libex | --libe)
- ac_prev=libexecdir ;;
- -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
- | --libexe=* | --libex=* | --libe=*)
- libexecdir=$ac_optarg ;;
-
- -localstatedir | --localstatedir | --localstatedi | --localstated \
- | --localstate | --localstat | --localsta | --localst \
- | --locals | --local | --loca | --loc | --lo)
- ac_prev=localstatedir ;;
- -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
- | --localstate=* | --localstat=* | --localsta=* | --localst=* \
- | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
- localstatedir=$ac_optarg ;;
-
- -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
- ac_prev=mandir ;;
- -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
- mandir=$ac_optarg ;;
-
- -nfp | --nfp | --nf)
- # Obsolete; use --without-fp.
- with_fp=no ;;
-
- -no-create | --no-create | --no-creat | --no-crea | --no-cre \
- | --no-cr | --no-c | -n)
- no_create=yes ;;
-
- -no-recursion | --no-recursion | --no-recursio | --no-recursi \
- | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
- no_recursion=yes ;;
-
- -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
- | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
- | --oldin | --oldi | --old | --ol | --o)
- ac_prev=oldincludedir ;;
- -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
- | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
- | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
- oldincludedir=$ac_optarg ;;
-
- -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
- ac_prev=prefix ;;
- -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
- prefix=$ac_optarg ;;
-
- -program-prefix | --program-prefix | --program-prefi | --program-pref \
- | --program-pre | --program-pr | --program-p)
- ac_prev=program_prefix ;;
- -program-prefix=* | --program-prefix=* | --program-prefi=* \
- | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
- program_prefix=$ac_optarg ;;
-
- -program-suffix | --program-suffix | --program-suffi | --program-suff \
- | --program-suf | --program-su | --program-s)
- ac_prev=program_suffix ;;
- -program-suffix=* | --program-suffix=* | --program-suffi=* \
- | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
- program_suffix=$ac_optarg ;;
-
- -program-transform-name | --program-transform-name \
- | --program-transform-nam | --program-transform-na \
- | --program-transform-n | --program-transform- \
- | --program-transform | --program-transfor \
- | --program-transfo | --program-transf \
- | --program-trans | --program-tran \
- | --progr-tra | --program-tr | --program-t)
- ac_prev=program_transform_name ;;
- -program-transform-name=* | --program-transform-name=* \
- | --program-transform-nam=* | --program-transform-na=* \
- | --program-transform-n=* | --program-transform-=* \
- | --program-transform=* | --program-transfor=* \
- | --program-transfo=* | --program-transf=* \
- | --program-trans=* | --program-tran=* \
- | --progr-tra=* | --program-tr=* | --program-t=*)
- program_transform_name=$ac_optarg ;;
-
- -q | -quiet | --quiet | --quie | --qui | --qu | --q \
- | -silent | --silent | --silen | --sile | --sil)
- silent=yes ;;
-
- -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
- ac_prev=sbindir ;;
- -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
- | --sbi=* | --sb=*)
- sbindir=$ac_optarg ;;
-
- -sharedstatedir | --sharedstatedir | --sharedstatedi \
- | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
- | --sharedst | --shareds | --shared | --share | --shar \
- | --sha | --sh)
- ac_prev=sharedstatedir ;;
- -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
- | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
- | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
- | --sha=* | --sh=*)
- sharedstatedir=$ac_optarg ;;
-
- -site | --site | --sit)
- ac_prev=site ;;
- -site=* | --site=* | --sit=*)
- site=$ac_optarg ;;
-
- -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
- ac_prev=srcdir ;;
- -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
- srcdir=$ac_optarg ;;
-
- -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
- | --syscon | --sysco | --sysc | --sys | --sy)
- ac_prev=sysconfdir ;;
- -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
- | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
- sysconfdir=$ac_optarg ;;
-
- -target | --target | --targe | --targ | --tar | --ta | --t)
- ac_prev=target_alias ;;
- -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
- target_alias=$ac_optarg ;;
-
- -v | -verbose | --verbose | --verbos | --verbo | --verb)
- verbose=yes ;;
-
- -version | --version | --versio | --versi | --vers | -V)
- ac_init_version=: ;;
-
- -with-* | --with-*)
- ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
- # Reject names that are not valid shell variable names.
- expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
- { echo "$as_me: error: invalid package name: $ac_package" >&2
- { (exit 1); exit 1; }; }
- ac_package=`echo $ac_package| sed 's/-/_/g'`
- case $ac_option in
- *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
- *) ac_optarg=yes ;;
- esac
- eval "with_$ac_package='$ac_optarg'" ;;
-
- -without-* | --without-*)
- ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
- # Reject names that are not valid shell variable names.
- expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
- { echo "$as_me: error: invalid package name: $ac_package" >&2
- { (exit 1); exit 1; }; }
- ac_package=`echo $ac_package | sed 's/-/_/g'`
- eval "with_$ac_package=no" ;;
-
- --x)
- # Obsolete; use --with-x.
- with_x=yes ;;
-
- -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
- | --x-incl | --x-inc | --x-in | --x-i)
- ac_prev=x_includes ;;
- -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
- | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
- x_includes=$ac_optarg ;;
-
- -x-libraries | --x-libraries | --x-librarie | --x-librari \
- | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
- ac_prev=x_libraries ;;
- -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
- | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
- x_libraries=$ac_optarg ;;
-
- -*) { echo "$as_me: error: unrecognized option: $ac_option
-Try \`$0 --help' for more information." >&2
- { (exit 1); exit 1; }; }
- ;;
-
- *=*)
- ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
- # Reject names that are not valid shell variable names.
- expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
- { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
- { (exit 1); exit 1; }; }
- ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
- eval "$ac_envvar='$ac_optarg'"
- export $ac_envvar ;;
-
- *)
- # FIXME: should be removed in autoconf 3.0.
- echo "$as_me: WARNING: you should use --build, --host, --target" >&2
- expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
- echo "$as_me: WARNING: invalid host type: $ac_option" >&2
- : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
- ;;
-
- esac
-done
-
-if test -n "$ac_prev"; then
- ac_option=--`echo $ac_prev | sed 's/_/-/g'`
- { echo "$as_me: error: missing argument to $ac_option" >&2
- { (exit 1); exit 1; }; }
-fi
-
-# Be sure to have absolute paths.
-for ac_var in exec_prefix prefix
-do
- eval ac_val=$`echo $ac_var`
- case $ac_val in
- [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
- *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
- { (exit 1); exit 1; }; };;
- esac
-done
-
-# Be sure to have absolute paths.
-for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \
- localstatedir libdir includedir oldincludedir infodir mandir
-do
- eval ac_val=$`echo $ac_var`
- case $ac_val in
- [\\/$]* | ?:[\\/]* ) ;;
- *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
- { (exit 1); exit 1; }; };;
- esac
-done
-
-# There might be people who depend on the old broken behavior: `$host'
-# used to hold the argument of --host etc.
-# FIXME: To remove some day.
-build=$build_alias
-host=$host_alias
-target=$target_alias
-
-# FIXME: To remove some day.
-if test "x$host_alias" != x; then
- if test "x$build_alias" = x; then
- cross_compiling=maybe
- echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
- If a cross compiler is detected then cross compile mode will be used." >&2
- elif test "x$build_alias" != "x$host_alias"; then
- cross_compiling=yes
- fi
-fi
-
-ac_tool_prefix=
-test -n "$host_alias" && ac_tool_prefix=$host_alias-
-
-test "$silent" = yes && exec 6>/dev/null
-
-
-# Find the source files, if location was not specified.
-if test -z "$srcdir"; then
- ac_srcdir_defaulted=yes
- # Try the directory containing this script, then its parent.
- ac_confdir=`(dirname "$0") 2>/dev/null ||
-$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$0" : 'X\(//\)[^/]' \| \
- X"$0" : 'X\(//\)$' \| \
- X"$0" : 'X\(/\)' \| \
- . : '\(.\)' 2>/dev/null ||
-echo X"$0" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
- /^X\(\/\/\)[^/].*/{ s//\1/; q; }
- /^X\(\/\/\)$/{ s//\1/; q; }
- /^X\(\/\).*/{ s//\1/; q; }
- s/.*/./; q'`
- srcdir=$ac_confdir
- if test ! -r $srcdir/$ac_unique_file; then
- srcdir=..
- fi
-else
- ac_srcdir_defaulted=no
-fi
-if test ! -r $srcdir/$ac_unique_file; then
- if test "$ac_srcdir_defaulted" = yes; then
- { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2
- { (exit 1); exit 1; }; }
- else
- { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
- { (exit 1); exit 1; }; }
- fi
-fi
-(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null ||
- { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2
- { (exit 1); exit 1; }; }
-srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
-ac_env_build_alias_set=${build_alias+set}
-ac_env_build_alias_value=$build_alias
-ac_cv_env_build_alias_set=${build_alias+set}
-ac_cv_env_build_alias_value=$build_alias
-ac_env_host_alias_set=${host_alias+set}
-ac_env_host_alias_value=$host_alias
-ac_cv_env_host_alias_set=${host_alias+set}
-ac_cv_env_host_alias_value=$host_alias
-ac_env_target_alias_set=${target_alias+set}
-ac_env_target_alias_value=$target_alias
-ac_cv_env_target_alias_set=${target_alias+set}
-ac_cv_env_target_alias_value=$target_alias
-
-#
-# Report the --help message.
-#
-if test "$ac_init_help" = "long"; then
- # Omit some internal or obsolete options to make the list less imposing.
- # This message is too long to be a string in the A/UX 3.1 sh.
- cat <<_ACEOF
-\`configure' configures [SAMPLE] [x.xx] to adapt to many kinds of systems.
-
-Usage: $0 [OPTION]... [VAR=VALUE]...
-
-To assign environment variables (e.g., CC, CFLAGS...), specify them as
-VAR=VALUE. See below for descriptions of some of the useful variables.
-
-Defaults for the options are specified in brackets.
-
-Configuration:
- -h, --help display this help and exit
- --help=short display options specific to this package
- --help=recursive display the short help of all the included packages
- -V, --version display version information and exit
- -q, --quiet, --silent do not print \`checking...' messages
- --cache-file=FILE cache test results in FILE [disabled]
- -C, --config-cache alias for \`--cache-file=config.cache'
- -n, --no-create do not create output files
- --srcdir=DIR find the sources in DIR [configure dir or \`..']
-
-_ACEOF
-
- cat <<_ACEOF
-Installation directories:
- --prefix=PREFIX install architecture-independent files in PREFIX
- [$ac_default_prefix]
- --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
- [PREFIX]
-
-By default, \`make install' will install all the files in
-\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify
-an installation prefix other than \`$ac_default_prefix' using \`--prefix',
-for instance \`--prefix=\$HOME'.
-
-For better control, use the options below.
-
-Fine tuning of the installation directories:
- --bindir=DIR user executables [EPREFIX/bin]
- --sbindir=DIR system admin executables [EPREFIX/sbin]
- --libexecdir=DIR program executables [EPREFIX/libexec]
- --datadir=DIR read-only architecture-independent data [PREFIX/share]
- --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
- --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
- --localstatedir=DIR modifiable single-machine data [PREFIX/var]
- --libdir=DIR object code libraries [EPREFIX/lib]
- --includedir=DIR C header files [PREFIX/include]
- --oldincludedir=DIR C header files for non-gcc [/usr/include]
- --infodir=DIR info documentation [PREFIX/info]
- --mandir=DIR man documentation [PREFIX/man]
-_ACEOF
-
- cat <<\_ACEOF
-_ACEOF
-fi
-
-if test -n "$ac_init_help"; then
- case $ac_init_help in
- short | recursive ) echo "Configuration of [SAMPLE] [x.xx]:";;
- esac
- cat <<\_ACEOF
-
-Optional Packages:
- --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
- --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
- --with-llvmsrc Location of LLVM Source Code
- --with-llvmobj Location of LLVM Object Code
-
-Report bugs to <bugs@yourdomain>.
-_ACEOF
-fi
-
-if test "$ac_init_help" = "recursive"; then
- # If there are subdirs, report their specific --help.
- ac_popdir=`pwd`
- for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
- test -d $ac_dir || continue
- ac_builddir=.
-
-if test "$ac_dir" != .; then
- ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
- # A "../" for each directory in $ac_dir_suffix.
- ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
-else
- ac_dir_suffix= ac_top_builddir=
-fi
-
-case $srcdir in
- .) # No --srcdir option. We are building in place.
- ac_srcdir=.
- if test -z "$ac_top_builddir"; then
- ac_top_srcdir=.
- else
- ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
- fi ;;
- [\\/]* | ?:[\\/]* ) # Absolute path.
- ac_srcdir=$srcdir$ac_dir_suffix;
- ac_top_srcdir=$srcdir ;;
- *) # Relative path.
- ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
- ac_top_srcdir=$ac_top_builddir$srcdir ;;
-esac
-
-# Do not use `cd foo && pwd` to compute absolute paths, because
-# the directories may not exist.
-case `pwd` in
-.) ac_abs_builddir="$ac_dir";;
-*)
- case "$ac_dir" in
- .) ac_abs_builddir=`pwd`;;
- [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
- *) ac_abs_builddir=`pwd`/"$ac_dir";;
- esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_top_builddir=${ac_top_builddir}.;;
-*)
- case ${ac_top_builddir}. in
- .) ac_abs_top_builddir=$ac_abs_builddir;;
- [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
- *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
- esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_srcdir=$ac_srcdir;;
-*)
- case $ac_srcdir in
- .) ac_abs_srcdir=$ac_abs_builddir;;
- [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
- *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
- esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_top_srcdir=$ac_top_srcdir;;
-*)
- case $ac_top_srcdir in
- .) ac_abs_top_srcdir=$ac_abs_builddir;;
- [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
- *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
- esac;;
-esac
-
- cd $ac_dir
- # Check for guested configure; otherwise get Cygnus style configure.
- if test -f $ac_srcdir/configure.gnu; then
- echo
- $SHELL $ac_srcdir/configure.gnu --help=recursive
- elif test -f $ac_srcdir/configure; then
- echo
- $SHELL $ac_srcdir/configure --help=recursive
- elif test -f $ac_srcdir/configure.ac ||
- test -f $ac_srcdir/configure.in; then
- echo
- $ac_configure --help
- else
- echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
- fi
- cd $ac_popdir
- done
-fi
-
-test -n "$ac_init_help" && exit 0
-if $ac_init_version; then
- cat <<\_ACEOF
-[SAMPLE] configure [x.xx]
-generated by GNU Autoconf 2.59
-
-Copyright (C) 2003 Free Software Foundation, Inc.
-This configure script is free software; the Free Software Foundation
-gives unlimited permission to copy, distribute and modify it.
-_ACEOF
- exit 0
-fi
-exec 5>config.log
-cat >&5 <<_ACEOF
-This file contains any messages produced by compilers while
-running configure, to aid debugging if configure makes a mistake.
-
-It was created by [SAMPLE] $as_me [x.xx], which was
-generated by GNU Autoconf 2.59. Invocation command line was
-
- $ $0 $@
-
-_ACEOF
-{
-cat <<_ASUNAME
-## --------- ##
-## Platform. ##
-## --------- ##
-
-hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
-uname -m = `(uname -m) 2>/dev/null || echo unknown`
-uname -r = `(uname -r) 2>/dev/null || echo unknown`
-uname -s = `(uname -s) 2>/dev/null || echo unknown`
-uname -v = `(uname -v) 2>/dev/null || echo unknown`
-
-/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
-/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown`
-
-/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown`
-/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown`
-/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
-hostinfo = `(hostinfo) 2>/dev/null || echo unknown`
-/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown`
-/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown`
-/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown`
-
-_ASUNAME
-
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- echo "PATH: $as_dir"
-done
-
-} >&5
-
-cat >&5 <<_ACEOF
-
-
-## ----------- ##
-## Core tests. ##
-## ----------- ##
-
-_ACEOF
-
-
-# Keep a trace of the command line.
-# Strip out --no-create and --no-recursion so they do not pile up.
-# Strip out --silent because we don't want to record it for future runs.
-# Also quote any args containing shell meta-characters.
-# Make two passes to allow for proper duplicate-argument suppression.
-ac_configure_args=
-ac_configure_args0=
-ac_configure_args1=
-ac_sep=
-ac_must_keep_next=false
-for ac_pass in 1 2
-do
- for ac_arg
- do
- case $ac_arg in
- -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
- -q | -quiet | --quiet | --quie | --qui | --qu | --q \
- | -silent | --silent | --silen | --sile | --sil)
- continue ;;
- *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
- ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
- esac
- case $ac_pass in
- 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;;
- 2)
- ac_configure_args1="$ac_configure_args1 '$ac_arg'"
- if test $ac_must_keep_next = true; then
- ac_must_keep_next=false # Got value, back to normal.
- else
- case $ac_arg in
- *=* | --config-cache | -C | -disable-* | --disable-* \
- | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
- | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
- | -with-* | --with-* | -without-* | --without-* | --x)
- case "$ac_configure_args0 " in
- "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
- esac
- ;;
- -* ) ac_must_keep_next=true ;;
- esac
- fi
- ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
- # Get rid of the leading space.
- ac_sep=" "
- ;;
- esac
- done
-done
-$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; }
-$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; }
-
-# When interrupted or exit'd, cleanup temporary files, and complete
-# config.log. We remove comments because anyway the quotes in there
-# would cause problems or look ugly.
-# WARNING: Be sure not to use single quotes in there, as some shells,
-# such as our DU 5.0 friend, will then `close' the trap.
-trap 'exit_status=$?
- # Save into config.log some information that might help in debugging.
- {
- echo
-
- cat <<\_ASBOX
-## ---------------- ##
-## Cache variables. ##
-## ---------------- ##
-_ASBOX
- echo
- # The following way of writing the cache mishandles newlines in values,
-{
- (set) 2>&1 |
- case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
- *ac_space=\ *)
- sed -n \
- "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
- s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
- ;;
- *)
- sed -n \
- "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
- ;;
- esac;
-}
- echo
-
- cat <<\_ASBOX
-## ----------------- ##
-## Output variables. ##
-## ----------------- ##
-_ASBOX
- echo
- for ac_var in $ac_subst_vars
- do
- eval ac_val=$`echo $ac_var`
- echo "$ac_var='"'"'$ac_val'"'"'"
- done | sort
- echo
-
- if test -n "$ac_subst_files"; then
- cat <<\_ASBOX
-## ------------- ##
-## Output files. ##
-## ------------- ##
-_ASBOX
- echo
- for ac_var in $ac_subst_files
- do
- eval ac_val=$`echo $ac_var`
- echo "$ac_var='"'"'$ac_val'"'"'"
- done | sort
- echo
- fi
-
- if test -s confdefs.h; then
- cat <<\_ASBOX
-## ----------- ##
-## confdefs.h. ##
-## ----------- ##
-_ASBOX
- echo
- sed "/^$/d" confdefs.h | sort
- echo
- fi
- test "$ac_signal" != 0 &&
- echo "$as_me: caught signal $ac_signal"
- echo "$as_me: exit $exit_status"
- } >&5
- rm -f core *.core &&
- rm -rf conftest* confdefs* conf$$* $ac_clean_files &&
- exit $exit_status
- ' 0
-for ac_signal in 1 2 13 15; do
- trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
-done
-ac_signal=0
-
-# confdefs.h avoids OS command line length limits that DEFS can exceed.
-rm -rf conftest* confdefs.h
-# AIX cpp loses on an empty file, so make sure it contains at least a newline.
-echo >confdefs.h
-
-# Predefined preprocessor variables.
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_NAME "$PACKAGE_NAME"
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_VERSION "$PACKAGE_VERSION"
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_STRING "$PACKAGE_STRING"
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
-_ACEOF
-
-
-# Let the site file select an alternate cache file if it wants to.
-# Prefer explicitly selected file to automatically selected ones.
-if test -z "$CONFIG_SITE"; then
- if test "x$prefix" != xNONE; then
- CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
- else
- CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
- fi
-fi
-for ac_site_file in $CONFIG_SITE; do
- if test -r "$ac_site_file"; then
- { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
-echo "$as_me: loading site script $ac_site_file" >&6;}
- sed 's/^/| /' "$ac_site_file" >&5
- . "$ac_site_file"
- fi
-done
-
-if test -r "$cache_file"; then
- # Some versions of bash will fail to source /dev/null (special
- # files actually), so we avoid doing that.
- if test -f "$cache_file"; then
- { echo "$as_me:$LINENO: loading cache $cache_file" >&5
-echo "$as_me: loading cache $cache_file" >&6;}
- case $cache_file in
- [\\/]* | ?:[\\/]* ) . $cache_file;;
- *) . ./$cache_file;;
- esac
- fi
-else
- { echo "$as_me:$LINENO: creating cache $cache_file" >&5
-echo "$as_me: creating cache $cache_file" >&6;}
- >$cache_file
-fi
-
-# Check that the precious variables saved in the cache have kept the same
-# value.
-ac_cache_corrupted=false
-for ac_var in `(set) 2>&1 |
- sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
- eval ac_old_set=\$ac_cv_env_${ac_var}_set
- eval ac_new_set=\$ac_env_${ac_var}_set
- eval ac_old_val="\$ac_cv_env_${ac_var}_value"
- eval ac_new_val="\$ac_env_${ac_var}_value"
- case $ac_old_set,$ac_new_set in
- set,)
- { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
-echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
- ac_cache_corrupted=: ;;
- ,set)
- { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
-echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
- ac_cache_corrupted=: ;;
- ,);;
- *)
- if test "x$ac_old_val" != "x$ac_new_val"; then
- { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
-echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
- { echo "$as_me:$LINENO: former value: $ac_old_val" >&5
-echo "$as_me: former value: $ac_old_val" >&2;}
- { echo "$as_me:$LINENO: current value: $ac_new_val" >&5
-echo "$as_me: current value: $ac_new_val" >&2;}
- ac_cache_corrupted=:
- fi;;
- esac
- # Pass precious variables to config.status.
- if test "$ac_new_set" = set; then
- case $ac_new_val in
- *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
- ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
- *) ac_arg=$ac_var=$ac_new_val ;;
- esac
- case " $ac_configure_args " in
- *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy.
- *) ac_configure_args="$ac_configure_args '$ac_arg'" ;;
- esac
- fi
-done
-if $ac_cache_corrupted; then
- { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
-echo "$as_me: error: changes in the environment can compromise the build" >&2;}
- { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
-echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
- { (exit 1); exit 1; }; }
-fi
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-ac_aux_dir=
-for ac_dir in ../../autoconf $srcdir/../../autoconf; do
- if test -f $ac_dir/install-sh; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/install-sh -c"
- break
- elif test -f $ac_dir/install.sh; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/install.sh -c"
- break
- elif test -f $ac_dir/shtool; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/shtool install -c"
- break
- fi
-done
-if test -z "$ac_aux_dir"; then
- { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in ../../autoconf $srcdir/../../autoconf" >&5
-echo "$as_me: error: cannot find install-sh or install.sh in ../../autoconf $srcdir/../../autoconf" >&2;}
- { (exit 1); exit 1; }; }
-fi
-ac_config_guess="$SHELL $ac_aux_dir/config.guess"
-ac_config_sub="$SHELL $ac_aux_dir/config.sub"
-ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
-
-
-
-# Check whether --with-llvmsrc or --without-llvmsrc was given.
-if test "${with_llvmsrc+set}" = set; then
- withval="$with_llvmsrc"
- llvm_src="$withval"
-else
- llvm_src=`cd ${srcdir}/../..; pwd`
-fi;
- LLVM_SRC=$llvm_src
-
-
-# Check whether --with-llvmobj or --without-llvmobj was given.
-if test "${with_llvmobj+set}" = set; then
- withval="$with_llvmobj"
- llvm_obj="$withval"
-else
- llvm_obj=`cd ../..; pwd`
-fi;
- LLVM_OBJ=$llvm_obj
-
- ac_config_commands="$ac_config_commands setup"
-
-
-
-
-
- ac_config_files="$ac_config_files Makefile.common"
-
-
- ac_config_commands="$ac_config_commands Makefile"
-
-
- ac_config_commands="$ac_config_commands lib/Makefile"
-
-
- ac_config_commands="$ac_config_commands lib/sample/Makefile"
-
-
- ac_config_commands="$ac_config_commands tools/Makefile"
-
-
- ac_config_commands="$ac_config_commands tools/sample/Makefile"
-
-
-
-
-
-
-
-
-
-
-
-
-cat >confcache <<\_ACEOF
-# This file is a shell script that caches the results of configure
-# tests run on this system so they can be shared between configure
-# scripts and configure runs, see configure's option --config-cache.
-# It is not useful on other systems. If it contains results you don't
-# want to keep, you may remove or edit it.
-#
-# config.status only pays attention to the cache file if you give it
-# the --recheck option to rerun configure.
-#
-# `ac_cv_env_foo' variables (set or unset) will be overridden when
-# loading this file, other *unset* `ac_cv_foo' will be assigned the
-# following values.
-
-_ACEOF
-
-# The following way of writing the cache mishandles newlines in values,
-# but we know of no workaround that is simple, portable, and efficient.
-# So, don't put newlines in cache variables' values.
-# Ultrix sh set writes to stderr and can't be redirected directly,
-# and sets the high bit in the cache file unless we assign to the vars.
-{
- (set) 2>&1 |
- case `(ac_space=' '; set | grep ac_space) 2>&1` in
- *ac_space=\ *)
- # `set' does not quote correctly, so add quotes (double-quote
- # substitution turns \\\\ into \\, and sed turns \\ into \).
- sed -n \
- "s/'/'\\\\''/g;
- s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
- ;;
- *)
- # `set' quotes correctly as required by POSIX, so do not add quotes.
- sed -n \
- "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
- ;;
- esac;
-} |
- sed '
- t clear
- : clear
- s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
- t end
- /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
- : end' >>confcache
-if diff $cache_file confcache >/dev/null 2>&1; then :; else
- if test -w $cache_file; then
- test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
- cat confcache >$cache_file
- else
- echo "not updating unwritable cache $cache_file"
- fi
-fi
-rm -f confcache
-
-test "x$prefix" = xNONE && prefix=$ac_default_prefix
-# Let make expand exec_prefix.
-test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
-
-# VPATH may cause trouble with some makes, so we remove $(srcdir),
-# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
-# trailing colons and then remove the whole line if VPATH becomes empty
-# (actually we leave an empty line to preserve line numbers).
-if test "x$srcdir" = x.; then
- ac_vpsub='/^[ ]*VPATH[ ]*=/{
-s/:*\$(srcdir):*/:/;
-s/:*\${srcdir}:*/:/;
-s/:*@srcdir@:*/:/;
-s/^\([^=]*=[ ]*\):*/\1/;
-s/:*$//;
-s/^[^=]*=[ ]*$//;
-}'
-fi
-
-# Transform confdefs.h into DEFS.
-# Protect against shell expansion while executing Makefile rules.
-# Protect against Makefile macro expansion.
-#
-# If the first sed substitution is executed (which looks for macros that
-# take arguments), then we branch to the quote section. Otherwise,
-# look for a macro that doesn't take arguments.
-cat >confdef2opt.sed <<\_ACEOF
-t clear
-: clear
-s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\),-D\1=\2,g
-t quote
-s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\),-D\1=\2,g
-t quote
-d
-: quote
-s,[ `~#$^&*(){}\\|;'"<>?],\\&,g
-s,\[,\\&,g
-s,\],\\&,g
-s,\$,$$,g
-p
-_ACEOF
-# We use echo to avoid assuming a particular line-breaking character.
-# The extra dot is to prevent the shell from consuming trailing
-# line-breaks from the sub-command output. A line-break within
-# single-quotes doesn't work because, if this script is created in a
-# platform that uses two characters for line-breaks (e.g., DOS), tr
-# would break.
-ac_LF_and_DOT=`echo; echo .`
-DEFS=`sed -n -f confdef2opt.sed confdefs.h | tr "$ac_LF_and_DOT" ' .'`
-rm -f confdef2opt.sed
-
-
-ac_libobjs=
-ac_ltlibobjs=
-for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
- # 1. Remove the extension, and $U if already installed.
- ac_i=`echo "$ac_i" |
- sed 's/\$U\././;s/\.o$//;s/\.obj$//'`
- # 2. Add them.
- ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext"
- ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo'
-done
-LIBOBJS=$ac_libobjs
-
-LTLIBOBJS=$ac_ltlibobjs
-
-
-
-: ${CONFIG_STATUS=./config.status}
-ac_clean_files_save=$ac_clean_files
-ac_clean_files="$ac_clean_files $CONFIG_STATUS"
-{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
-echo "$as_me: creating $CONFIG_STATUS" >&6;}
-cat >$CONFIG_STATUS <<_ACEOF
-#! $SHELL
-# Generated by $as_me.
-# Run this file to recreate the current configuration.
-# Compiler output produced by configure, useful for debugging
-# configure, is in config.log if it exists.
-
-debug=false
-ac_cs_recheck=false
-ac_cs_silent=false
-SHELL=\${CONFIG_SHELL-$SHELL}
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF
-## --------------------- ##
-## M4sh Initialization. ##
-## --------------------- ##
-
-# Be Bourne compatible
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
- emulate sh
- NULLCMD=:
- # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
- # is contrary to our usage. Disable this feature.
- alias -g '${1+"$@"}'='"$@"'
-elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
- set -o posix
-fi
-DUALCASE=1; export DUALCASE # for MKS sh
-
-# Support unset when possible.
-if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
- as_unset=unset
-else
- as_unset=false
-fi
-
-
-# Work around bugs in pre-3.0 UWIN ksh.
-$as_unset ENV MAIL MAILPATH
-PS1='$ '
-PS2='> '
-PS4='+ '
-
-# NLS nuisances.
-for as_var in \
- LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
- LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
- LC_TELEPHONE LC_TIME
-do
- if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
- eval $as_var=C; export $as_var
- else
- $as_unset $as_var
- fi
-done
-
-# Required to use basename.
-if expr a : '\(a\)' >/dev/null 2>&1; then
- as_expr=expr
-else
- as_expr=false
-fi
-
-if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
- as_basename=basename
-else
- as_basename=false
-fi
-
-
-# Name of the executable.
-as_me=`$as_basename "$0" ||
-$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
- X"$0" : 'X\(//\)$' \| \
- X"$0" : 'X\(/\)$' \| \
- . : '\(.\)' 2>/dev/null ||
-echo X/"$0" |
- sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
- /^X\/\(\/\/\)$/{ s//\1/; q; }
- /^X\/\(\/\).*/{ s//\1/; q; }
- s/.*/./; q'`
-
-
-# PATH needs CR, and LINENO needs CR and PATH.
-# Avoid depending upon Character Ranges.
-as_cr_letters='abcdefghijklmnopqrstuvwxyz'
-as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
-as_cr_Letters=$as_cr_letters$as_cr_LETTERS
-as_cr_digits='0123456789'
-as_cr_alnum=$as_cr_Letters$as_cr_digits
-
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
- echo "#! /bin/sh" >conf$$.sh
- echo "exit 0" >>conf$$.sh
- chmod +x conf$$.sh
- if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
- PATH_SEPARATOR=';'
- else
- PATH_SEPARATOR=:
- fi
- rm -f conf$$.sh
-fi
-
-
- as_lineno_1=$LINENO
- as_lineno_2=$LINENO
- as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
- test "x$as_lineno_1" != "x$as_lineno_2" &&
- test "x$as_lineno_3" = "x$as_lineno_2" || {
- # Find who we are. Look in the path if we contain no path at all
- # relative or not.
- case $0 in
- *[\\/]* ) as_myself=$0 ;;
- *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
-done
-
- ;;
- esac
- # We did not find ourselves, most probably we were run as `sh COMMAND'
- # in which case we are not to be found in the path.
- if test "x$as_myself" = x; then
- as_myself=$0
- fi
- if test ! -f "$as_myself"; then
- { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5
-echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;}
- { (exit 1); exit 1; }; }
- fi
- case $CONFIG_SHELL in
- '')
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for as_base in sh bash ksh sh5; do
- case $as_dir in
- /*)
- if ("$as_dir/$as_base" -c '
- as_lineno_1=$LINENO
- as_lineno_2=$LINENO
- as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
- test "x$as_lineno_1" != "x$as_lineno_2" &&
- test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then
- $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
- $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
- CONFIG_SHELL=$as_dir/$as_base
- export CONFIG_SHELL
- exec "$CONFIG_SHELL" "$0" ${1+"$@"}
- fi;;
- esac
- done
-done
-;;
- esac
-
- # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
- # uniformly replaced by the line number. The first 'sed' inserts a
- # line-number line before each line; the second 'sed' does the real
- # work. The second script uses 'N' to pair each line-number line
- # with the numbered line, and appends trailing '-' during
- # substitution so that $LINENO is not a special case at line end.
- # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
- # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-)
- sed '=' <$as_myself |
- sed '
- N
- s,$,-,
- : loop
- s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
- t loop
- s,-$,,
- s,^['$as_cr_digits']*\n,,
- ' >$as_me.lineno &&
- chmod +x $as_me.lineno ||
- { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5
-echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;}
- { (exit 1); exit 1; }; }
-
- # Don't try to exec as it changes $[0], causing all sort of problems
- # (the dirname of $[0] is not the place where we might find the
- # original and so on. Autoconf is especially sensible to this).
- . ./$as_me.lineno
- # Exit status is that of the last command.
- exit
-}
-
-
-case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
- *c*,-n*) ECHO_N= ECHO_C='
-' ECHO_T=' ' ;;
- *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;;
- *) ECHO_N= ECHO_C='\c' ECHO_T= ;;
-esac
-
-if expr a : '\(a\)' >/dev/null 2>&1; then
- as_expr=expr
-else
- as_expr=false
-fi
-
-rm -f conf$$ conf$$.exe conf$$.file
-echo >conf$$.file
-if ln -s conf$$.file conf$$ 2>/dev/null; then
- # We could just check for DJGPP; but this test a) works b) is more generic
- # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
- if test -f conf$$.exe; then
- # Don't use ln at all; we don't have any links
- as_ln_s='cp -p'
- else
- as_ln_s='ln -s'
- fi
-elif ln conf$$.file conf$$ 2>/dev/null; then
- as_ln_s=ln
-else
- as_ln_s='cp -p'
-fi
-rm -f conf$$ conf$$.exe conf$$.file
-
-if mkdir -p . 2>/dev/null; then
- as_mkdir_p=:
-else
- test -d ./-p && rmdir ./-p
- as_mkdir_p=false
-fi
-
-as_executable_p="test -f"
-
-# Sed expression to map a string onto a valid CPP name.
-as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
-
-# Sed expression to map a string onto a valid variable name.
-as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
-
-
-# IFS
-# We need space, tab and new line, in precisely that order.
-as_nl='
-'
-IFS=" $as_nl"
-
-# CDPATH.
-$as_unset CDPATH
-
-exec 6>&1
-
-# Open the log real soon, to keep \$[0] and so on meaningful, and to
-# report actual input values of CONFIG_FILES etc. instead of their
-# values after options handling. Logging --version etc. is OK.
-exec 5>>config.log
-{
- echo
- sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
-## Running $as_me. ##
-_ASBOX
-} >&5
-cat >&5 <<_CSEOF
-
-This file was extended by [SAMPLE] $as_me [x.xx], which was
-generated by GNU Autoconf 2.59. Invocation command line was
-
- CONFIG_FILES = $CONFIG_FILES
- CONFIG_HEADERS = $CONFIG_HEADERS
- CONFIG_LINKS = $CONFIG_LINKS
- CONFIG_COMMANDS = $CONFIG_COMMANDS
- $ $0 $@
-
-_CSEOF
-echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5
-echo >&5
-_ACEOF
-
-# Files that config.status was made for.
-if test -n "$ac_config_files"; then
- echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
-fi
-
-if test -n "$ac_config_headers"; then
- echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
-fi
-
-if test -n "$ac_config_links"; then
- echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
-fi
-
-if test -n "$ac_config_commands"; then
- echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
-fi
-
-cat >>$CONFIG_STATUS <<\_ACEOF
-
-ac_cs_usage="\
-\`$as_me' instantiates files from templates according to the
-current configuration.
-
-Usage: $0 [OPTIONS] [FILE]...
-
- -h, --help print this help, then exit
- -V, --version print version number, then exit
- -q, --quiet do not print progress messages
- -d, --debug don't remove temporary files
- --recheck update $as_me by reconfiguring in the same conditions
- --file=FILE[:TEMPLATE]
- instantiate the configuration file FILE
-
-Configuration files:
-$config_files
-
-Configuration commands:
-$config_commands
-
-Report bugs to <bug-autoconf@gnu.org>."
-_ACEOF
-
-cat >>$CONFIG_STATUS <<_ACEOF
-ac_cs_version="\\
-[SAMPLE] config.status [x.xx]
-configured by $0, generated by GNU Autoconf 2.59,
- with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
-
-Copyright (C) 2003 Free Software Foundation, Inc.
-This config.status script is free software; the Free Software Foundation
-gives unlimited permission to copy, distribute and modify it."
-srcdir=$srcdir
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF
-# If no file are specified by the user, then we need to provide default
-# value. By we need to know if files were specified by the user.
-ac_need_defaults=:
-while test $# != 0
-do
- case $1 in
- --*=*)
- ac_option=`expr "x$1" : 'x\([^=]*\)='`
- ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
- ac_shift=:
- ;;
- -*)
- ac_option=$1
- ac_optarg=$2
- ac_shift=shift
- ;;
- *) # This is not an option, so the user has probably given explicit
- # arguments.
- ac_option=$1
- ac_need_defaults=false;;
- esac
-
- case $ac_option in
- # Handling of the options.
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
- -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
- ac_cs_recheck=: ;;
- --version | --vers* | -V )
- echo "$ac_cs_version"; exit 0 ;;
- --he | --h)
- # Conflict between --help and --header
- { { echo "$as_me:$LINENO: error: ambiguous option: $1
-Try \`$0 --help' for more information." >&5
-echo "$as_me: error: ambiguous option: $1
-Try \`$0 --help' for more information." >&2;}
- { (exit 1); exit 1; }; };;
- --help | --hel | -h )
- echo "$ac_cs_usage"; exit 0 ;;
- --debug | --d* | -d )
- debug=: ;;
- --file | --fil | --fi | --f )
- $ac_shift
- CONFIG_FILES="$CONFIG_FILES $ac_optarg"
- ac_need_defaults=false;;
- --header | --heade | --head | --hea )
- $ac_shift
- CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg"
- ac_need_defaults=false;;
- -q | -quiet | --quiet | --quie | --qui | --qu | --q \
- | -silent | --silent | --silen | --sile | --sil | --si | --s)
- ac_cs_silent=: ;;
-
- # This is an error.
- -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1
-Try \`$0 --help' for more information." >&5
-echo "$as_me: error: unrecognized option: $1
-Try \`$0 --help' for more information." >&2;}
- { (exit 1); exit 1; }; } ;;
-
- *) ac_config_targets="$ac_config_targets $1" ;;
-
- esac
- shift
-done
-
-ac_configure_extra_args=
-
-if $ac_cs_silent; then
- exec 6>/dev/null
- ac_configure_extra_args="$ac_configure_extra_args --silent"
-fi
-
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF
-if \$ac_cs_recheck; then
- echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6
- exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
-fi
-
-_ACEOF
-
-cat >>$CONFIG_STATUS <<_ACEOF
-#
-# INIT-COMMANDS section.
-#
-
-llvm_src="${LLVM_SRC}"
-
-_ACEOF
-
-
-
-cat >>$CONFIG_STATUS <<\_ACEOF
-for ac_config_target in $ac_config_targets
-do
- case "$ac_config_target" in
- # Handling of arguments.
- "Makefile.common" ) CONFIG_FILES="$CONFIG_FILES Makefile.common" ;;
- "setup" ) CONFIG_COMMANDS="$CONFIG_COMMANDS setup" ;;
- "Makefile" ) CONFIG_COMMANDS="$CONFIG_COMMANDS Makefile" ;;
- "lib/Makefile" ) CONFIG_COMMANDS="$CONFIG_COMMANDS lib/Makefile" ;;
- "lib/sample/Makefile" ) CONFIG_COMMANDS="$CONFIG_COMMANDS lib/sample/Makefile" ;;
- "tools/Makefile" ) CONFIG_COMMANDS="$CONFIG_COMMANDS tools/Makefile" ;;
- "tools/sample/Makefile" ) CONFIG_COMMANDS="$CONFIG_COMMANDS tools/sample/Makefile" ;;
- *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
-echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
- { (exit 1); exit 1; }; };;
- esac
-done
-
-# If the user did not use the arguments to specify the items to instantiate,
-# then the envvar interface is used. Set only those that are not.
-# We use the long form for the default assignment because of an extremely
-# bizarre bug on SunOS 4.1.3.
-if $ac_need_defaults; then
- test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
- test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
-fi
-
-# Have a temporary directory for convenience. Make it in the build tree
-# simply because there is no reason to put it here, and in addition,
-# creating and moving files from /tmp can sometimes cause problems.
-# Create a temporary directory, and hook for its removal unless debugging.
-$debug ||
-{
- trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
- trap '{ (exit 1); exit 1; }' 1 2 13 15
-}
-
-# Create a (secure) tmp directory for tmp files.
-
-{
- tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` &&
- test -n "$tmp" && test -d "$tmp"
-} ||
-{
- tmp=./confstat$$-$RANDOM
- (umask 077 && mkdir $tmp)
-} ||
-{
- echo "$me: cannot create a temporary directory in ." >&2
- { (exit 1); exit 1; }
-}
-
-_ACEOF
-
-cat >>$CONFIG_STATUS <<_ACEOF
-
-#
-# CONFIG_FILES section.
-#
-
-# No need to generate the scripts if there are no CONFIG_FILES.
-# This happens for instance when ./config.status config.h
-if test -n "\$CONFIG_FILES"; then
- # Protect against being on the right side of a sed subst in config.status.
- sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
- s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
-s,@SHELL@,$SHELL,;t t
-s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
-s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
-s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
-s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
-s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
-s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
-s,@exec_prefix@,$exec_prefix,;t t
-s,@prefix@,$prefix,;t t
-s,@program_transform_name@,$program_transform_name,;t t
-s,@bindir@,$bindir,;t t
-s,@sbindir@,$sbindir,;t t
-s,@libexecdir@,$libexecdir,;t t
-s,@datadir@,$datadir,;t t
-s,@sysconfdir@,$sysconfdir,;t t
-s,@sharedstatedir@,$sharedstatedir,;t t
-s,@localstatedir@,$localstatedir,;t t
-s,@libdir@,$libdir,;t t
-s,@includedir@,$includedir,;t t
-s,@oldincludedir@,$oldincludedir,;t t
-s,@infodir@,$infodir,;t t
-s,@mandir@,$mandir,;t t
-s,@build_alias@,$build_alias,;t t
-s,@host_alias@,$host_alias,;t t
-s,@target_alias@,$target_alias,;t t
-s,@DEFS@,$DEFS,;t t
-s,@ECHO_C@,$ECHO_C,;t t
-s,@ECHO_N@,$ECHO_N,;t t
-s,@ECHO_T@,$ECHO_T,;t t
-s,@LIBS@,$LIBS,;t t
-s,@LLVM_SRC@,$LLVM_SRC,;t t
-s,@LLVM_OBJ@,$LLVM_OBJ,;t t
-s,@LIBOBJS@,$LIBOBJS,;t t
-s,@LTLIBOBJS@,$LTLIBOBJS,;t t
-CEOF
-
-_ACEOF
-
- cat >>$CONFIG_STATUS <<\_ACEOF
- # Split the substitutions into bite-sized pieces for seds with
- # small command number limits, like on Digital OSF/1 and HP-UX.
- ac_max_sed_lines=48
- ac_sed_frag=1 # Number of current file.
- ac_beg=1 # First line for current file.
- ac_end=$ac_max_sed_lines # Line after last line for current file.
- ac_more_lines=:
- ac_sed_cmds=
- while $ac_more_lines; do
- if test $ac_beg -gt 1; then
- sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
- else
- sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
- fi
- if test ! -s $tmp/subs.frag; then
- ac_more_lines=false
- else
- # The purpose of the label and of the branching condition is to
- # speed up the sed processing (if there are no `@' at all, there
- # is no need to browse any of the substitutions).
- # These are the two extra sed commands mentioned above.
- (echo ':t
- /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
- if test -z "$ac_sed_cmds"; then
- ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
- else
- ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
- fi
- ac_sed_frag=`expr $ac_sed_frag + 1`
- ac_beg=$ac_end
- ac_end=`expr $ac_end + $ac_max_sed_lines`
- fi
- done
- if test -z "$ac_sed_cmds"; then
- ac_sed_cmds=cat
- fi
-fi # test -n "$CONFIG_FILES"
-
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
-for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
- # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
- case $ac_file in
- - | *:- | *:-:* ) # input from stdin
- cat >$tmp/stdin
- ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
- ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
- *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
- ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
- * ) ac_file_in=$ac_file.in ;;
- esac
-
- # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
- ac_dir=`(dirname "$ac_file") 2>/dev/null ||
-$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$ac_file" : 'X\(//\)[^/]' \| \
- X"$ac_file" : 'X\(//\)$' \| \
- X"$ac_file" : 'X\(/\)' \| \
- . : '\(.\)' 2>/dev/null ||
-echo X"$ac_file" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
- /^X\(\/\/\)[^/].*/{ s//\1/; q; }
- /^X\(\/\/\)$/{ s//\1/; q; }
- /^X\(\/\).*/{ s//\1/; q; }
- s/.*/./; q'`
- { if $as_mkdir_p; then
- mkdir -p "$ac_dir"
- else
- as_dir="$ac_dir"
- as_dirs=
- while test ! -d "$as_dir"; do
- as_dirs="$as_dir $as_dirs"
- as_dir=`(dirname "$as_dir") 2>/dev/null ||
-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$as_dir" : 'X\(//\)[^/]' \| \
- X"$as_dir" : 'X\(//\)$' \| \
- X"$as_dir" : 'X\(/\)' \| \
- . : '\(.\)' 2>/dev/null ||
-echo X"$as_dir" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
- /^X\(\/\/\)[^/].*/{ s//\1/; q; }
- /^X\(\/\/\)$/{ s//\1/; q; }
- /^X\(\/\).*/{ s//\1/; q; }
- s/.*/./; q'`
- done
- test ! -n "$as_dirs" || mkdir $as_dirs
- fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
-echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
- { (exit 1); exit 1; }; }; }
-
- ac_builddir=.
-
-if test "$ac_dir" != .; then
- ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
- # A "../" for each directory in $ac_dir_suffix.
- ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
-else
- ac_dir_suffix= ac_top_builddir=
-fi
-
-case $srcdir in
- .) # No --srcdir option. We are building in place.
- ac_srcdir=.
- if test -z "$ac_top_builddir"; then
- ac_top_srcdir=.
- else
- ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
- fi ;;
- [\\/]* | ?:[\\/]* ) # Absolute path.
- ac_srcdir=$srcdir$ac_dir_suffix;
- ac_top_srcdir=$srcdir ;;
- *) # Relative path.
- ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
- ac_top_srcdir=$ac_top_builddir$srcdir ;;
-esac
-
-# Do not use `cd foo && pwd` to compute absolute paths, because
-# the directories may not exist.
-case `pwd` in
-.) ac_abs_builddir="$ac_dir";;
-*)
- case "$ac_dir" in
- .) ac_abs_builddir=`pwd`;;
- [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
- *) ac_abs_builddir=`pwd`/"$ac_dir";;
- esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_top_builddir=${ac_top_builddir}.;;
-*)
- case ${ac_top_builddir}. in
- .) ac_abs_top_builddir=$ac_abs_builddir;;
- [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
- *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
- esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_srcdir=$ac_srcdir;;
-*)
- case $ac_srcdir in
- .) ac_abs_srcdir=$ac_abs_builddir;;
- [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
- *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
- esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_top_srcdir=$ac_top_srcdir;;
-*)
- case $ac_top_srcdir in
- .) ac_abs_top_srcdir=$ac_abs_builddir;;
- [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
- *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
- esac;;
-esac
-
-
-
- if test x"$ac_file" != x-; then
- { echo "$as_me:$LINENO: creating $ac_file" >&5
-echo "$as_me: creating $ac_file" >&6;}
- rm -f "$ac_file"
- fi
- # Let's still pretend it is `configure' which instantiates (i.e., don't
- # use $as_me), people would be surprised to read:
- # /* config.h. Generated by config.status. */
- if test x"$ac_file" = x-; then
- configure_input=
- else
- configure_input="$ac_file. "
- fi
- configure_input=$configure_input"Generated from `echo $ac_file_in |
- sed 's,.*/,,'` by configure."
-
- # First look for the input files in the build tree, otherwise in the
- # src tree.
- ac_file_inputs=`IFS=:
- for f in $ac_file_in; do
- case $f in
- -) echo $tmp/stdin ;;
- [\\/$]*)
- # Absolute (can't be DOS-style, as IFS=:)
- test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
-echo "$as_me: error: cannot find input file: $f" >&2;}
- { (exit 1); exit 1; }; }
- echo "$f";;
- *) # Relative
- if test -f "$f"; then
- # Build tree
- echo "$f"
- elif test -f "$srcdir/$f"; then
- # Source tree
- echo "$srcdir/$f"
- else
- # /dev/null tree
- { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
-echo "$as_me: error: cannot find input file: $f" >&2;}
- { (exit 1); exit 1; }; }
- fi;;
- esac
- done` || { (exit 1); exit 1; }
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF
- sed "$ac_vpsub
-$extrasub
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
-:t
-/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
-s,@configure_input@,$configure_input,;t t
-s,@srcdir@,$ac_srcdir,;t t
-s,@abs_srcdir@,$ac_abs_srcdir,;t t
-s,@top_srcdir@,$ac_top_srcdir,;t t
-s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t
-s,@builddir@,$ac_builddir,;t t
-s,@abs_builddir@,$ac_abs_builddir,;t t
-s,@top_builddir@,$ac_top_builddir,;t t
-s,@abs_top_builddir@,$ac_abs_top_builddir,;t t
-" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
- rm -f $tmp/stdin
- if test x"$ac_file" != x-; then
- mv $tmp/out $ac_file
- else
- cat $tmp/out
- rm -f $tmp/out
- fi
-
-done
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
-
-#
-# CONFIG_COMMANDS section.
-#
-for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
- ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
- ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
- ac_dir=`(dirname "$ac_dest") 2>/dev/null ||
-$as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$ac_dest" : 'X\(//\)[^/]' \| \
- X"$ac_dest" : 'X\(//\)$' \| \
- X"$ac_dest" : 'X\(/\)' \| \
- . : '\(.\)' 2>/dev/null ||
-echo X"$ac_dest" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
- /^X\(\/\/\)[^/].*/{ s//\1/; q; }
- /^X\(\/\/\)$/{ s//\1/; q; }
- /^X\(\/\).*/{ s//\1/; q; }
- s/.*/./; q'`
- { if $as_mkdir_p; then
- mkdir -p "$ac_dir"
- else
- as_dir="$ac_dir"
- as_dirs=
- while test ! -d "$as_dir"; do
- as_dirs="$as_dir $as_dirs"
- as_dir=`(dirname "$as_dir") 2>/dev/null ||
-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$as_dir" : 'X\(//\)[^/]' \| \
- X"$as_dir" : 'X\(//\)$' \| \
- X"$as_dir" : 'X\(/\)' \| \
- . : '\(.\)' 2>/dev/null ||
-echo X"$as_dir" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
- /^X\(\/\/\)[^/].*/{ s//\1/; q; }
- /^X\(\/\/\)$/{ s//\1/; q; }
- /^X\(\/\).*/{ s//\1/; q; }
- s/.*/./; q'`
- done
- test ! -n "$as_dirs" || mkdir $as_dirs
- fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
-echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
- { (exit 1); exit 1; }; }; }
-
- ac_builddir=.
-
-if test "$ac_dir" != .; then
- ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
- # A "../" for each directory in $ac_dir_suffix.
- ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
-else
- ac_dir_suffix= ac_top_builddir=
-fi
-
-case $srcdir in
- .) # No --srcdir option. We are building in place.
- ac_srcdir=.
- if test -z "$ac_top_builddir"; then
- ac_top_srcdir=.
- else
- ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
- fi ;;
- [\\/]* | ?:[\\/]* ) # Absolute path.
- ac_srcdir=$srcdir$ac_dir_suffix;
- ac_top_srcdir=$srcdir ;;
- *) # Relative path.
- ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
- ac_top_srcdir=$ac_top_builddir$srcdir ;;
-esac
-
-# Do not use `cd foo && pwd` to compute absolute paths, because
-# the directories may not exist.
-case `pwd` in
-.) ac_abs_builddir="$ac_dir";;
-*)
- case "$ac_dir" in
- .) ac_abs_builddir=`pwd`;;
- [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
- *) ac_abs_builddir=`pwd`/"$ac_dir";;
- esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_top_builddir=${ac_top_builddir}.;;
-*)
- case ${ac_top_builddir}. in
- .) ac_abs_top_builddir=$ac_abs_builddir;;
- [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
- *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
- esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_srcdir=$ac_srcdir;;
-*)
- case $ac_srcdir in
- .) ac_abs_srcdir=$ac_abs_builddir;;
- [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
- *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
- esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_top_srcdir=$ac_top_srcdir;;
-*)
- case $ac_top_srcdir in
- .) ac_abs_top_srcdir=$ac_abs_builddir;;
- [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
- *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
- esac;;
-esac
-
-
- { echo "$as_me:$LINENO: executing $ac_dest commands" >&5
-echo "$as_me: executing $ac_dest commands" >&6;}
- case $ac_dest in
- Makefile ) ${llvm_src}/autoconf/mkinstalldirs `dirname Makefile`
- ${SHELL} ${llvm_src}/autoconf/install-sh -c ${srcdir}/Makefile Makefile ;;
- lib/Makefile ) ${llvm_src}/autoconf/mkinstalldirs `dirname lib/Makefile`
- ${SHELL} ${llvm_src}/autoconf/install-sh -c ${srcdir}/lib/Makefile lib/Makefile ;;
- lib/sample/Makefile ) ${llvm_src}/autoconf/mkinstalldirs `dirname lib/sample/Makefile`
- ${SHELL} ${llvm_src}/autoconf/install-sh -c ${srcdir}/lib/sample/Makefile lib/sample/Makefile ;;
- tools/Makefile ) ${llvm_src}/autoconf/mkinstalldirs `dirname tools/Makefile`
- ${SHELL} ${llvm_src}/autoconf/install-sh -c ${srcdir}/tools/Makefile tools/Makefile ;;
- tools/sample/Makefile ) ${llvm_src}/autoconf/mkinstalldirs `dirname tools/sample/Makefile`
- ${SHELL} ${llvm_src}/autoconf/install-sh -c ${srcdir}/tools/sample/Makefile tools/sample/Makefile ;;
- esac
-done
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF
-
-{ (exit 0); exit 0; }
-_ACEOF
-chmod +x $CONFIG_STATUS
-ac_clean_files=$ac_clean_files_save
-
-
-# configure is writing to config.log, and then calls config.status.
-# config.status does its own redirection, appending to config.log.
-# Unfortunately, on DOS this fails, as config.log is still kept open
-# by configure, so config.status won't be able to write to it; its
-# output is simply discarded. So we exec the FD to /dev/null,
-# effectively closing config.log, so it can be properly (re)opened and
-# appended to by config.status. When coming back to configure, we
-# need to make the FD available again.
-if test "$no_create" != yes; then
- ac_cs_success=:
- ac_config_status_args=
- test "$silent" = yes &&
- ac_config_status_args="$ac_config_status_args --quiet"
- exec 5>/dev/null
- $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
- exec 5>>config.log
- # Use ||, not &&, to avoid exiting from the if with $? = 1, which
- # would make configure fail if this is the last instruction.
- $ac_cs_success || { (exit 1); exit 1; }
-fi
-
diff --git a/release_23/projects/sample/include/sample.h b/release_23/projects/sample/include/sample.h
deleted file mode 100644
index b3ce9ce29282..000000000000
--- a/release_23/projects/sample/include/sample.h
+++ /dev/null
@@ -1,8 +0,0 @@
-/*
- * File: sample.h
- *
- * This is a sample header file that is global to the entire project.
- * It is located here so that everyone will find it.
- */
-extern int compute_sample (int a);
-
diff --git a/release_23/projects/sample/lib/Makefile b/release_23/projects/sample/lib/Makefile
deleted file mode 100644
index 959038b7f9b4..000000000000
--- a/release_23/projects/sample/lib/Makefile
+++ /dev/null
@@ -1,13 +0,0 @@
-##===- projects/sample/lib/Makefile ------------------------*- Makefile -*-===##
-
-#
-# Relative path to the top of the source tree.
-#
-LEVEL=..
-
-#
-# List all of the subdirectories that we will compile.
-#
-DIRS=sample
-
-include $(LEVEL)/Makefile.common
diff --git a/release_23/projects/sample/lib/sample/Makefile b/release_23/projects/sample/lib/sample/Makefile
deleted file mode 100644
index 05bca6141b06..000000000000
--- a/release_23/projects/sample/lib/sample/Makefile
+++ /dev/null
@@ -1,18 +0,0 @@
-##===- projects/sample/lib/sample/Makefile -----------------*- Makefile -*-===##
-
-#
-# Indicate where we are relative to the top of the source tree.
-#
-LEVEL=../..
-
-#
-# Give the name of a library. This will build a dynamic version.
-#
-LIBRARYNAME=sample
-DONT_BUILD_RELINKED=1
-BUILD_ARCHIVE=1
-
-#
-# Include Makefile.common so we know what to do.
-#
-include $(LEVEL)/Makefile.common
diff --git a/release_23/projects/sample/lib/sample/sample.c b/release_23/projects/sample/lib/sample/sample.c
deleted file mode 100644
index a5ae28091bc4..000000000000
--- a/release_23/projects/sample/lib/sample/sample.c
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * File: sample.c
- *
- * Description:
- * This is a sample source file for a library. It helps to demonstrate
- * how to setup a project that uses the LLVM build system, header files,
- * and libraries.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-
-/* LLVM Header File
-#include "llvm/Support/DataTypes.h"
-*/
-
-/* Header file global to this project */
-#include "sample.h"
-
-int
-compute_sample (int a)
-{
- return a;
-}
-
diff --git a/release_23/projects/sample/tools/Makefile b/release_23/projects/sample/tools/Makefile
deleted file mode 100644
index 00ff52b42cfa..000000000000
--- a/release_23/projects/sample/tools/Makefile
+++ /dev/null
@@ -1,13 +0,0 @@
-##===- projects/sample/tools/Makefile ----------------------*- Makefile -*-===##
-
-#
-# Relative path to the top of the source tree.
-#
-LEVEL=..
-
-#
-# List all of the subdirectories that we will compile.
-#
-DIRS=sample
-
-include $(LEVEL)/Makefile.common
diff --git a/release_23/projects/sample/tools/sample/Makefile b/release_23/projects/sample/tools/sample/Makefile
deleted file mode 100644
index 324030c56726..000000000000
--- a/release_23/projects/sample/tools/sample/Makefile
+++ /dev/null
@@ -1,23 +0,0 @@
-##===- projects/sample/tools/sample/Makefile ---------------*- Makefile -*-===##
-
-#
-# Indicate where we are relative to the top of the source tree.
-#
-LEVEL=../..
-
-#
-# Give the name of the tool.
-#
-TOOLNAME=Sample
-
-#
-# List libraries that we'll need
-# We use LIBS because sample is a dynamic library.
-#
-USEDLIBS = sample.a
-
-#
-# Include Makefile.common so we know what to do.
-#
-include $(LEVEL)/Makefile.common
-
diff --git a/release_23/projects/sample/tools/sample/main.c b/release_23/projects/sample/tools/sample/main.c
deleted file mode 100644
index 2880265f8450..000000000000
--- a/release_23/projects/sample/tools/sample/main.c
+++ /dev/null
@@ -1,14 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-
-#include <unistd.h>
-
-#include "sample.h"
-
-int
-main (int argc, char ** argv)
-{
- printf ("%d\n", compute_sample (5));
- exit (0);
-}
-
diff --git a/release_23/runtime/GC/GCInterface.h b/release_23/runtime/GC/GCInterface.h
deleted file mode 100644
index a62ac3c7146a..000000000000
--- a/release_23/runtime/GC/GCInterface.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/*===-- GCInterface.h - Public interface exposed by garbage collectors ----===*\
-|*
-|* The LLVM Compiler Infrastructure
-|*
-|* This file is distributed under the University of Illinois Open Source
-|* License. See LICENSE.TXT for details.
-|*
-|*===----------------------------------------------------------------------===*|
-|*
-|* This file defines the common public interface that must be exposed by all
-|* LLVM garbage collectors.
-|*
-\*===----------------------------------------------------------------------===*/
-
-#ifndef GCINTERFACE_H
-#define GCINTERFACE_H
-
-/* llvm_cg_walk_gcroots - This function is exposed by the LLVM code generator,
- * and allows us to traverse the roots on the stack.
- */
-void llvm_cg_walk_gcroots(void (*FP)(void **Root, void *Meta));
-
-
-/* llvm_gc_initialize - This function is called to initalize the garbage
- * collector.
- */
-void llvm_gc_initialize(unsigned InitialHeapSize);
-
-/* llvm_gc_allocate - This function allocates Size bytes from the heap and
- * returns a pointer to it.
- */
-void *llvm_gc_allocate(unsigned Size);
-
-/* llvm_gc_collect - This function forces a garbage collection cycle.
- */
-void llvm_gc_collect();
-
-/* llvm_gc_read - This function should be implemented to include any read
- * barrier code that is needed by the garbage collector.
- */
-void *llvm_gc_read(void *ObjPtr, void **FieldPtr);
-
-/* llvm_gc_write - This function should be implemented to include any write
- * barrier code that is needed by the garbage collector.
- */
-void llvm_gc_write(void *V, void *ObjPtr, void **FieldPtr);
-
-#endif
diff --git a/release_23/runtime/GC/Makefile b/release_23/runtime/GC/Makefile
deleted file mode 100644
index b053e252865b..000000000000
--- a/release_23/runtime/GC/Makefile
+++ /dev/null
@@ -1,19 +0,0 @@
-##===- runtime/GC/Makefile ---------------------------------*- Makefile -*-===##
-#
-# The LLVM Compiler Infrastructure
-#
-# This file is distributed under the University of Illinois Open Source
-# License. See LICENSE.TXT for details.
-#
-##===----------------------------------------------------------------------===##
-
-LEVEL = ../..
-PARALLEL_DIRS := SemiSpace
-EXTRA_DIST := gc_exported_symbols.lst
-include $(LEVEL)/Makefile.common
-
-# Install target for libraries: Copy into $LLVMGCCDIR/bytecode-libs
-#
-install::
-
-clean::
diff --git a/release_23/runtime/GC/SemiSpace/Makefile b/release_23/runtime/GC/SemiSpace/Makefile
deleted file mode 100644
index babcc8098025..000000000000
--- a/release_23/runtime/GC/SemiSpace/Makefile
+++ /dev/null
@@ -1,19 +0,0 @@
-##===- runtime/GC/SemiSpace/Makefile -----------------------*- Makefile -*-===##
-#
-# The LLVM Compiler Infrastructure
-#
-# This file is distributed under the University of Illinois Open Source
-# License. See LICENSE.TXT for details.
-#
-##===----------------------------------------------------------------------===##
-
-LEVEL = ../../..
-BYTECODE_LIBRARY = 1
-LIBRARYNAME = gcsemispace
-BYTECODE_DESTINATION = $(CFERuntimeLibDir)
-EXPORTED_SYMBOL_FILE = $(PROJ_SRC_DIR)/../gc_exported_symbols.lst
-
-include $(LEVEL)/Makefile.common
-
-CompileCommonOpts := $(filter-out -pedantic,$(CompileCommonOpts))
-CompileCommonOpts := $(filter-out -Wno-long-long,$(CompileCommonOpts))
diff --git a/release_23/runtime/GC/SemiSpace/README.txt b/release_23/runtime/GC/SemiSpace/README.txt
deleted file mode 100644
index 0ddf2e0426b0..000000000000
--- a/release_23/runtime/GC/SemiSpace/README.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-//===----------------------------------------------------------------------===//
-
-Possible enhancement: If a collection cycle happens and the heap is not
-compacted very much (say less than 25% of the allocated memory was freed), the
-memory regions should be doubled in size.
diff --git a/release_23/runtime/GC/SemiSpace/semispace.c b/release_23/runtime/GC/SemiSpace/semispace.c
deleted file mode 100644
index 0ae6e11bd2e8..000000000000
--- a/release_23/runtime/GC/SemiSpace/semispace.c
+++ /dev/null
@@ -1,127 +0,0 @@
-/*===-- semispace.c - Simple semi-space copying garbage collector ---------===*\
-|*
-|* The LLVM Compiler Infrastructure
-|*
-|* This file is distributed under the University of Illinois Open Source
-|* License. See LICENSE.TXT for details.
-|*
-|*===----------------------------------------------------------------------===*|
-|*
-|* This garbage collector is an extremely simple copying collector. It splits
-|* the managed region of memory into two pieces: the current space to allocate
-|* from, and the copying space. When the portion being allocated from fills up,
-|* a garbage collection cycle happens, which copies all live blocks to the other
-|* half of the managed space.
-|*
-\*===----------------------------------------------------------------------===*/
-
-#include "../GCInterface.h"
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-/* AllocPtr - This points to the next byte that is available for allocation.
- */
-static char *AllocPtr;
-
-/* AllocEnd - This points to the first byte not available for allocation. When
- * AllocPtr passes this, we have run out of space.
- */
-static char *AllocEnd;
-
-/* CurSpace/OtherSpace - These pointers point to the two regions of memory that
- * we switch between. The unallocated portion of the CurSpace is known to be
- * zero'd out, but the OtherSpace contains junk.
- */
-static void *CurSpace, *OtherSpace;
-
-/* SpaceSize - The size of each space. */
-static unsigned SpaceSize;
-
-/* llvm_gc_initialize - Allocate the two spaces that we plan to switch between.
- */
-void llvm_gc_initialize(unsigned InitialHeapSize) {
- SpaceSize = InitialHeapSize/2;
- CurSpace = AllocPtr = calloc(1, SpaceSize);
- OtherSpace = malloc(SpaceSize);
- AllocEnd = AllocPtr + SpaceSize;
-}
-
-/* We always want to inline the fast path, but never want to inline the slow
- * path.
- */
-void *llvm_gc_allocate(unsigned Size) __attribute__((always_inline));
-static void* llvm_gc_alloc_slow(unsigned Size) __attribute__((noinline));
-
-void *llvm_gc_allocate(unsigned Size) {
- char *OldAP = AllocPtr;
- char *NewEnd = OldAP+Size;
- if (NewEnd > AllocEnd)
- return llvm_gc_alloc_slow(Size);
- AllocPtr = NewEnd;
- return OldAP;
-}
-
-static void* llvm_gc_alloc_slow(unsigned Size) {
- llvm_gc_collect();
- if (AllocPtr+Size > AllocEnd) {
- fprintf(stderr, "Garbage collector ran out of memory "
- "allocating object of size: %d\n", Size);
- exit(1);
- }
-
- return llvm_gc_allocate(Size);
-}
-
-
-static void process_pointer(void **Root, void *Meta) {
- printf("process_root[0x%p] = 0x%p\n", (void*) Root, (void*) *Root);
-}
-
-void llvm_gc_collect() {
- // Clear out the space we will be copying into.
- // FIXME: This should do the copy, then clear out whatever space is left.
- memset(OtherSpace, 0, SpaceSize);
-
- printf("Garbage collecting!!\n");
- llvm_cg_walk_gcroots(process_pointer);
- abort();
-}
-
-/* We use no read/write barriers */
-void *llvm_gc_read(void *ObjPtr, void **FieldPtr) { return *FieldPtr; }
-void llvm_gc_write(void *V, void *ObjPtr, void **FieldPtr) { *FieldPtr = V; }
-
-
-/*===----------------------------------------------------------------------===**
- * FIXME: This should be in a code-generator specific library, but for now this
- * will work for all code generators.
- */
-typedef struct FrameMap FrameMap;
-struct FrameMap {
- int32_t NumRoots; // Number of roots in stack frame.
- int32_t NumMeta; // Number of metadata descriptors. May be < NumRoots.
- void *Meta[]; // May be absent for roots without metadata.
-};
-
-typedef struct StackEntry StackEntry;
-struct StackEntry {
- StackEntry *Next; // Caller's stack entry.
- const FrameMap *Map; // Pointer to constant FrameMap.
- void *Roots[]; // Stack roots (in-place array).
-};
-StackEntry *llvm_gc_root_chain;
-
-void llvm_cg_walk_gcroots(void (*FP)(void **Root, void *Meta)) {
- StackEntry *R;
- for (R = llvm_gc_root_chain; R; R = R->Next) {
- unsigned i, e;
- for (i = 0, e = R->Map->NumMeta; i != e; ++i)
- FP(&R->Roots[i], R->Map->Meta[i]);
- for (e = R->Map->NumRoots; i != e; ++i)
- FP(&R->Roots[i], NULL);
- }
-}
-/* END FIXME! */
-
-
diff --git a/release_23/runtime/GC/gc_exported_symbols.lst b/release_23/runtime/GC/gc_exported_symbols.lst
deleted file mode 100644
index 0ed60f57ee34..000000000000
--- a/release_23/runtime/GC/gc_exported_symbols.lst
+++ /dev/null
@@ -1,7 +0,0 @@
-llvm_gc_initialize
-llvm_gc_allocate
-llvm_gc_collect
-llvm_gc_write
-llvm_gc_read
-
-llvm_gc_root_chain \ No newline at end of file
diff --git a/release_23/runtime/Makefile b/release_23/runtime/Makefile
deleted file mode 100644
index 3883041d2ebe..000000000000
--- a/release_23/runtime/Makefile
+++ /dev/null
@@ -1,35 +0,0 @@
-##===- runtime/Makefile ------------------------------------*- Makefile -*-===##
-#
-# The LLVM Compiler Infrastructure
-#
-# This file is distributed under the University of Illinois Open Source
-# License. See LICENSE.TXT for details.
-#
-##===----------------------------------------------------------------------===##
-
-LEVEL = ..
-include $(LEVEL)/Makefile.config
-
-ifneq ($(wildcard $(LLVMGCC)),)
-PARALLEL_DIRS := libprofile GC
-else
-PARALLEL_DIRS :=
-install all ::
- @echo '********' Warning: Your LLVMGCCDIR is set incorrectly. Check
- @echo '********' Warning: llvm/Makefile.config to make sure it matches
- @echo '********' Warning: the directory where the C front-end is
- @echo '********' Warning: installed,and re-run configure if it does not.
-endif
-
-# Disable libprofile: a faulty libtool is generated by autoconf which breaks the
-# build on Sparc
-ifeq ($(ARCH), Sparc)
-PARALLEL_DIRS := $(filter-out libprofile, $(PARALLEL_DIRS))
-endif
-
-include $(LEVEL)/Makefile.common
-
-# Install target for libraries: Copy into $LLVMGCCDIR/bytecode-libs
-#
-install::
-
diff --git a/release_23/runtime/README.txt b/release_23/runtime/README.txt
deleted file mode 100644
index 2e2e547de316..000000000000
--- a/release_23/runtime/README.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-This directory contains the various runtime libraries used by components of
-the LLVM compiler. For example, the automatic pool allocation transformation
-inserts calls to an external pool allocator library. This runtime library is
-an example of the type of library that lives in these directories.
diff --git a/release_23/runtime/libprofile/BasicBlockTracing.c b/release_23/runtime/libprofile/BasicBlockTracing.c
deleted file mode 100644
index dbe81e3f6504..000000000000
--- a/release_23/runtime/libprofile/BasicBlockTracing.c
+++ /dev/null
@@ -1,67 +0,0 @@
-/*===-- BasicBlockTracing.c - Support library for basic block tracing -----===*\
-|*
-|* The LLVM Compiler Infrastructure
-|*
-|* This file is distributed under the University of Illinois Open Source
-|* License. See LICENSE.TXT for details.
-|*
-|*===----------------------------------------------------------------------===*|
-|*
-|* This file implements the call back routines for the basic block tracing
-|* instrumentation pass. This should be used with the -trace-basic-blocks
-|* LLVM pass.
-|*
-\*===----------------------------------------------------------------------===*/
-
-#include "Profiling.h"
-#include <stdlib.h>
-#include <stdio.h>
-
-static unsigned *ArrayStart, *ArrayEnd, *ArrayCursor;
-
-/* WriteAndFlushBBTraceData - write out the currently accumulated trace data
- * and reset the cursor to point to the beginning of the buffer.
- */
-static void WriteAndFlushBBTraceData () {
- write_profiling_data(BBTraceInfo, ArrayStart, (ArrayCursor - ArrayStart));
- ArrayCursor = ArrayStart;
-}
-
-/* BBTraceAtExitHandler - When the program exits, just write out any remaining
- * data and free the trace buffer.
- */
-static void BBTraceAtExitHandler() {
- WriteAndFlushBBTraceData ();
- free (ArrayStart);
-}
-
-/* llvm_trace_basic_block - called upon hitting a new basic block. */
-void llvm_trace_basic_block (unsigned BBNum) {
- *ArrayCursor++ = BBNum;
- if (ArrayCursor == ArrayEnd)
- WriteAndFlushBBTraceData ();
-}
-
-/* llvm_start_basic_block_tracing - This is the main entry point of the basic
- * block tracing library. It is responsible for setting up the atexit
- * handler and allocating the trace buffer.
- */
-int llvm_start_basic_block_tracing(int argc, const char **argv,
- unsigned *arrayStart, unsigned numElements) {
- int Ret;
- const unsigned BufferSize = 128 * 1024;
- unsigned ArraySize;
-
- Ret = save_arguments(argc, argv);
-
- /* Allocate a buffer to contain BB tracing data */
- ArraySize = BufferSize / sizeof (unsigned);
- ArrayStart = malloc (ArraySize * sizeof (unsigned));
- ArrayEnd = ArrayStart + ArraySize;
- ArrayCursor = ArrayStart;
-
- /* Set up the atexit handler. */
- atexit (BBTraceAtExitHandler);
-
- return Ret;
-}
diff --git a/release_23/runtime/libprofile/BlockProfiling.c b/release_23/runtime/libprofile/BlockProfiling.c
deleted file mode 100644
index db80bffe56d3..000000000000
--- a/release_23/runtime/libprofile/BlockProfiling.c
+++ /dev/null
@@ -1,45 +0,0 @@
-/*===-- BlockProfiling.c - Support library for block profiling ------------===*\
-|*
-|* The LLVM Compiler Infrastructure
-|*
-|* This file is distributed under the University of Illinois Open Source
-|* License. See LICENSE.TXT for details.
-|*
-|*===----------------------------------------------------------------------===*|
-|*
-|* This file implements the call back routines for the block profiling
-|* instrumentation pass. This should be used with the -insert-block-profiling
-|* LLVM pass.
-|*
-\*===----------------------------------------------------------------------===*/
-
-#include "Profiling.h"
-#include <stdlib.h>
-
-static unsigned *ArrayStart;
-static unsigned NumElements;
-
-/* BlockProfAtExitHandler - When the program exits, just write out the profiling
- * data.
- */
-static void BlockProfAtExitHandler() {
- /* Note that if this were doing something more intelligent with the
- * instrumentation, we could do some computation here to expand what we
- * collected into simple block profiles. (Or we could do it in llvm-prof.)
- * Regardless, we directly count each block, so no expansion is necessary.
- */
- write_profiling_data(BlockInfo, ArrayStart, NumElements);
-}
-
-
-/* llvm_start_block_profiling - This is the main entry point of the block
- * profiling library. It is responsible for setting up the atexit handler.
- */
-int llvm_start_block_profiling(int argc, const char **argv,
- unsigned *arrayStart, unsigned numElements) {
- int Ret = save_arguments(argc, argv);
- ArrayStart = arrayStart;
- NumElements = numElements;
- atexit(BlockProfAtExitHandler);
- return Ret;
-}
diff --git a/release_23/runtime/libprofile/CommonProfiling.c b/release_23/runtime/libprofile/CommonProfiling.c
deleted file mode 100644
index 8b27a2576974..000000000000
--- a/release_23/runtime/libprofile/CommonProfiling.c
+++ /dev/null
@@ -1,117 +0,0 @@
-/*===-- CommonProfiling.c - Profiling support library support -------------===*\
-|*
-|* The LLVM Compiler Infrastructure
-|*
-|* This file is distributed under the University of Illinois Open Source
-|* License. See LICENSE.TXT for details.
-|*
-|*===----------------------------------------------------------------------===*|
-|*
-|* This file implements functions used by the various different types of
-|* profiling implementations.
-|*
-\*===----------------------------------------------------------------------===*/
-
-#include "Profiling.h"
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <stdio.h>
-#include <string.h>
-#include <unistd.h>
-#include <stdlib.h>
-
-static char *SavedArgs = 0;
-static unsigned SavedArgsLength = 0;
-
-static const char *OutputFilename = "llvmprof.out";
-
-/* save_arguments - Save argc and argv as passed into the program for the file
- * we output.
- */
-int save_arguments(int argc, const char **argv) {
- unsigned Length, i;
- if (SavedArgs || !argv) return argc; /* This can be called multiple times */
-
- /* Check to see if there are any arguments passed into the program for the
- * profiler. If there are, strip them off and remember their settings.
- */
- while (argc > 1 && !strncmp(argv[1], "-llvmprof-", 10)) {
- /* Ok, we have an llvmprof argument. Remove it from the arg list and decide
- * what to do with it.
- */
- const char *Arg = argv[1];
- memmove(&argv[1], &argv[2], (argc-1)*sizeof(char*));
- --argc;
-
- if (!strcmp(Arg, "-llvmprof-output")) {
- if (argc == 1)
- puts("-llvmprof-output requires a filename argument!");
- else {
- OutputFilename = strdup(argv[1]);
- memmove(&argv[1], &argv[2], (argc-1)*sizeof(char*));
- --argc;
- }
- } else {
- printf("Unknown option to the profiler runtime: '%s' - ignored.\n", Arg);
- }
- }
-
- for (Length = 0, i = 0; i != (unsigned)argc; ++i)
- Length += strlen(argv[i])+1;
-
- SavedArgs = (char*)malloc(Length);
- for (Length = 0, i = 0; i != (unsigned)argc; ++i) {
- unsigned Len = strlen(argv[i]);
- memcpy(SavedArgs+Length, argv[i], Len);
- Length += Len;
- SavedArgs[Length++] = ' ';
- }
-
- SavedArgsLength = Length;
-
- return argc;
-}
-
-
-/* write_profiling_data - Write a raw block of profiling counters out to the
- * llvmprof.out file. Note that we allow programs to be instrumented with
- * multiple different kinds of instrumentation. For this reason, this function
- * may be called more than once.
- */
-void write_profiling_data(enum ProfilingType PT, unsigned *Start,
- unsigned NumElements) {
- static int OutFile = -1;
- int PTy;
-
- /* If this is the first time this function is called, open the output file for
- * appending, creating it if it does not already exist.
- */
- if (OutFile == -1) {
- OutFile = open(OutputFilename, O_CREAT | O_WRONLY | O_APPEND, 0666);
- if (OutFile == -1) {
- fprintf(stderr, "LLVM profiling runtime: while opening '%s': ",
- OutputFilename);
- perror("");
- return;
- }
-
- /* Output the command line arguments to the file. */
- {
- int PTy = ArgumentInfo;
- int Zeros = 0;
- write(OutFile, &PTy, sizeof(int));
- write(OutFile, &SavedArgsLength, sizeof(unsigned));
- write(OutFile, SavedArgs, SavedArgsLength);
- /* Pad out to a multiple of four bytes */
- if (SavedArgsLength & 3)
- write(OutFile, &Zeros, 4-(SavedArgsLength&3));
- }
- }
-
- /* Write out this record! */
- PTy = PT;
- write(OutFile, &PTy, sizeof(int));
- write(OutFile, &NumElements, sizeof(unsigned));
- write(OutFile, Start, NumElements*sizeof(unsigned));
-}
diff --git a/release_23/runtime/libprofile/EdgeProfiling.c b/release_23/runtime/libprofile/EdgeProfiling.c
deleted file mode 100644
index 4a68a086fbce..000000000000
--- a/release_23/runtime/libprofile/EdgeProfiling.c
+++ /dev/null
@@ -1,45 +0,0 @@
-/*===-- EdgeProfiling.c - Support library for edge profiling --------------===*\
-|*
-|* The LLVM Compiler Infrastructure
-|*
-|* This file is distributed under the University of Illinois Open Source
-|* License. See LICENSE.TXT for details.
-|*
-|*===----------------------------------------------------------------------===*|
-|*
-|* This file implements the call back routines for the edge profiling
-|* instrumentation pass. This should be used with the -insert-edge-profiling
-|* LLVM pass.
-|*
-\*===----------------------------------------------------------------------===*/
-
-#include "Profiling.h"
-#include <stdlib.h>
-
-static unsigned *ArrayStart;
-static unsigned NumElements;
-
-/* EdgeProfAtExitHandler - When the program exits, just write out the profiling
- * data.
- */
-static void EdgeProfAtExitHandler() {
- /* Note that if this were doing something more intelligent with the
- * instrumentation, we could do some computation here to expand what we
- * collected into simple edge profiles. Since we directly count each edge, we
- * just write out all of the counters directly.
- */
- write_profiling_data(EdgeInfo, ArrayStart, NumElements);
-}
-
-
-/* llvm_start_edge_profiling - This is the main entry point of the edge
- * profiling library. It is responsible for setting up the atexit handler.
- */
-int llvm_start_edge_profiling(int argc, const char **argv,
- unsigned *arrayStart, unsigned numElements) {
- int Ret = save_arguments(argc, argv);
- ArrayStart = arrayStart;
- NumElements = numElements;
- atexit(EdgeProfAtExitHandler);
- return Ret;
-}
diff --git a/release_23/runtime/libprofile/FunctionProfiling.c b/release_23/runtime/libprofile/FunctionProfiling.c
deleted file mode 100644
index 24aa2061307c..000000000000
--- a/release_23/runtime/libprofile/FunctionProfiling.c
+++ /dev/null
@@ -1,42 +0,0 @@
-/*===-- FunctionProfiling.c - Support library for function profiling ------===*\
-|*
-|* The LLVM Compiler Infrastructure
-|*
-|* This file is distributed under the University of Illinois Open Source
-|* License. See LICENSE.TXT for details.
-|*
-|*===----------------------------------------------------------------------===*|
-|*
-|* This file implements the call back routines for the function profiling
-|* instrumentation pass. This should be used with the
-|* -insert-function-profiling LLVM pass.
-|*
-\*===----------------------------------------------------------------------===*/
-
-#include "Profiling.h"
-#include <stdlib.h>
-
-static unsigned *ArrayStart;
-static unsigned NumElements;
-
-/* FuncProfAtExitHandler - When the program exits, just write out the profiling
- * data.
- */
-static void FuncProfAtExitHandler() {
- /* Just write out the data we collected.
- */
- write_profiling_data(FunctionInfo, ArrayStart, NumElements);
-}
-
-
-/* llvm_start_func_profiling - This is the main entry point of the function
- * profiling library. It is responsible for setting up the atexit handler.
- */
-int llvm_start_func_profiling(int argc, const char **argv,
- unsigned *arrayStart, unsigned numElements) {
- int Ret = save_arguments(argc, argv);
- ArrayStart = arrayStart;
- NumElements = numElements;
- atexit(FuncProfAtExitHandler);
- return Ret;
-}
diff --git a/release_23/runtime/libprofile/Makefile b/release_23/runtime/libprofile/Makefile
deleted file mode 100644
index 8ff46fabdd17..000000000000
--- a/release_23/runtime/libprofile/Makefile
+++ /dev/null
@@ -1,19 +0,0 @@
-##===- runtime/libprofile/Makefile -------------------------*- Makefile -*-===##
-#
-# The LLVM Compiler Infrastructure
-#
-# This file is distributed under the University of Illinois Open Source
-# License. See LICENSE.TXT for details.
-#
-##===----------------------------------------------------------------------===##
-
-LEVEL = ../..
-BYTECODE_LIBRARY = 1
-SHARED_LIBRARY = 1
-LOADABLE_MODULE = 1
-LIBRARYNAME = profile_rt
-EXTRA_DIST = exported_symbols.lst
-EXPORTED_SYMBOL_FILE = $(PROJ_SRC_DIR)/exported_symbols.lst
-BYTECODE_DESTINATION = $(CFERuntimeLibDir)
-
-include $(LEVEL)/Makefile.common
diff --git a/release_23/runtime/libprofile/Profiling.h b/release_23/runtime/libprofile/Profiling.h
deleted file mode 100644
index a7e3ccc72b6c..000000000000
--- a/release_23/runtime/libprofile/Profiling.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/*===-- Profiling.h - Profiling support library support routines --*- C -*-===*\
-|*
-|* The LLVM Compiler Infrastructure
-|*
-|* This file is distributed under the University of Illinois Open Source
-|* License. See LICENSE.TXT for details.
-|*
-|*===----------------------------------------------------------------------===*|
-|*
-|* This file defines functions shared by the various different profiling
-|* implementations.
-|*
-\*===----------------------------------------------------------------------===*/
-
-#ifndef PROFILING_H
-#define PROFILING_H
-
-#include "llvm/Analysis/ProfileInfoTypes.h" /* for enum ProfilingType */
-
-/* save_arguments - Save argc and argv as passed into the program for the file
- * we output.
- */
-int save_arguments(int argc, const char **argv);
-
-/* write_profiling_data - Write out a typed packet of profiling data to the
- * current output file.
- */
-void write_profiling_data(enum ProfilingType PT, unsigned *Start,
- unsigned NumElements);
-
-#endif
diff --git a/release_23/runtime/libprofile/exported_symbols.lst b/release_23/runtime/libprofile/exported_symbols.lst
deleted file mode 100644
index 6f6c3cc840c5..000000000000
--- a/release_23/runtime/libprofile/exported_symbols.lst
+++ /dev/null
@@ -1,5 +0,0 @@
-
-llvm_start_func_profiling
-llvm_start_block_profiling
-llvm_start_basic_block_tracing
-llvm_trace_basic_block
diff --git a/release_23/test/Analysis/Andersens/2007-11-19-InlineAsm.ll b/release_23/test/Analysis/Andersens/2007-11-19-InlineAsm.ll
deleted file mode 100644
index c1ab6c7b1a4f..000000000000
--- a/release_23/test/Analysis/Andersens/2007-11-19-InlineAsm.ll
+++ /dev/null
@@ -1,8 +0,0 @@
-; RUN: llvm-as < %s | opt -anders-aa -disable-output
-
-define void @x(i16 %Y) {
-entry:
- %tmp = call i16 asm "bswap $0", "=r,r"(i16 %Y)
- ret void
-}
-
diff --git a/release_23/test/Analysis/Andersens/2008-03-19-External.ll b/release_23/test/Analysis/Andersens/2008-03-19-External.ll
deleted file mode 100644
index c4f1ff083855..000000000000
--- a/release_23/test/Analysis/Andersens/2008-03-19-External.ll
+++ /dev/null
@@ -1,12 +0,0 @@
-; RUN: llvm-as < %s | opt -anders-aa -gvn | llvm-dis | not grep undef
-; PR2160
-
-declare void @f(i32*)
-
-define i32 @g() {
-entry:
- %tmp = alloca i32 ; <i32*> [#uses=2]
- call void @f( i32* %tmp )
- %tmp2 = load i32* %tmp ; <i32> [#uses=1]
- ret i32 %tmp2
-}
diff --git a/release_23/test/Analysis/Andersens/2008-04-07-Memcpy.ll b/release_23/test/Analysis/Andersens/2008-04-07-Memcpy.ll
deleted file mode 100644
index 935444991a38..000000000000
--- a/release_23/test/Analysis/Andersens/2008-04-07-Memcpy.ll
+++ /dev/null
@@ -1,14 +0,0 @@
-; RUN: llvm-as < %s | opt -anders-aa -gvn | llvm-dis | not grep undef
-; PR2169
-
-declare void @llvm.memcpy.i32(i8*, i8*, i32, i32) nounwind
-declare void @use(i8)
-
-define void @f(i8* %x) {
-entry:
- %copy = alloca i8 ; <i8*> [#uses=6]
- call void @llvm.memcpy.i32( i8* %copy, i8* %x, i32 1, i32 4 )
- %tmp = load i8* %copy ; <i8> [#uses=1]
- call void @use(i8 %tmp)
- ret void
-}
diff --git a/release_23/test/Analysis/Andersens/arg-must-alias.ll b/release_23/test/Analysis/Andersens/arg-must-alias.ll
deleted file mode 100644
index 9680bb5fa9d1..000000000000
--- a/release_23/test/Analysis/Andersens/arg-must-alias.ll
+++ /dev/null
@@ -1,15 +0,0 @@
-; RUN: llvm-as < %s | opt -anders-aa -load-vn -gcse -deadargelim | llvm-dis | not grep ARG
-
-@G = internal constant i32* null
-
-define internal i32 @internal(i32* %ARG) {
- ;; The 'Arg' argument must-aliases the null pointer, so it can be subsituted
- ;; directly here, making it dead.
- store i32* %ARG, i32** @G
- ret i32 0
-}
-
-define i32 @foo() {
- %V = call i32 @internal(i32* null)
- ret i32 %V
-}
diff --git a/release_23/test/Analysis/Andersens/basictest.ll b/release_23/test/Analysis/Andersens/basictest.ll
deleted file mode 100644
index d84c8feaaa23..000000000000
--- a/release_23/test/Analysis/Andersens/basictest.ll
+++ /dev/null
@@ -1,28 +0,0 @@
-; RUN: llvm-as < %s | opt -anders-aa -aa-eval
-
-define void @test1() {
- %X = malloc i32*
- %Y = malloc i32
- %Z = ptrtoint i32* %Y to i32
- %W = inttoptr i32 %Z to i32*
- store i32* %W, i32** %X
- ret void
-}
-
-define void @test2(i32* %P) {
- %X = malloc i32*
- %Y = malloc i32
- store i32* %P, i32** %X
- ret void
-}
-
-define internal i32 *@test3(i32* %P) {
- ret i32* %P
-}
-
-define void @test4() {
- %X = malloc i32
- %Y = call i32* @test3(i32* %X)
- %ZZ = getelementptr i32* null, i32 17
- ret void
-}
diff --git a/release_23/test/Analysis/Andersens/dg.exp b/release_23/test/Analysis/Andersens/dg.exp
deleted file mode 100644
index a40d51c84f83..000000000000
--- a/release_23/test/Analysis/Andersens/dg.exp
+++ /dev/null
@@ -1,4 +0,0 @@
-load_lib llvm.exp
-
-RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
-
diff --git a/release_23/test/Analysis/Andersens/external.ll b/release_23/test/Analysis/Andersens/external.ll
deleted file mode 100644
index 183319513e7e..000000000000
--- a/release_23/test/Analysis/Andersens/external.ll
+++ /dev/null
@@ -1,20 +0,0 @@
-; RUN: llvm-as < %s | opt -anders-aa -load-vn -gcse -deadargelim | llvm-dis | grep store | not grep null
-
-; Because the 'internal' function is passed to an external function, we don't
-; know what the incoming values will alias. As such, we cannot do the
-; optimization checked by the 'arg-must-alias.llx' test.
-
-declare void @external(i32(i32*)*)
-@G = internal constant i32* null
-
-define internal i32 @internal(i32* %ARG) {
- ;;; We *DON'T* know that ARG always points to null!
- store i32* %ARG, i32** @G
- ret i32 0
-}
-
-define i32 @foo() {
- call void @external(i32(i32*)* @internal)
- %V = call i32 @internal(i32* null)
- ret i32 %V
-}
diff --git a/release_23/test/Analysis/Andersens/modreftest.ll b/release_23/test/Analysis/Andersens/modreftest.ll
deleted file mode 100644
index b5c60cd79086..000000000000
--- a/release_23/test/Analysis/Andersens/modreftest.ll
+++ /dev/null
@@ -1,15 +0,0 @@
-; RUN: llvm-as < %s | opt -anders-aa -load-vn -gcse -instcombine | llvm-dis \
-; RUN: | grep {ret i1 true}
-
-@G = internal global i32* null
-declare i32 *@ext()
-
-define i1 @bar() {
- %V1 = load i32** @G
- %X2 = call i32 *@ext()
- %V2 = load i32** @G
- store i32* %X2, i32** @G
-
- %C = icmp eq i32* %V1, %V2
- ret i1 %C
-}
diff --git a/release_23/test/Analysis/Andersens/modreftest2.ll b/release_23/test/Analysis/Andersens/modreftest2.ll
deleted file mode 100644
index 2bb216736760..000000000000
--- a/release_23/test/Analysis/Andersens/modreftest2.ll
+++ /dev/null
@@ -1,14 +0,0 @@
-; RUN: llvm-as < %s | opt -anders-aa -gvn | llvm-dis \
-; RUN: | not grep {ret i32 undef}
-
-;; From PR 2160
-declare void @f(i32*)
-
-define i32 @g() {
-entry:
- %tmp = alloca i32 ; <i32*> [#uses=2]
- call void @f( i32* %tmp )
- %tmp2 = load i32* %tmp ; <i32> [#uses=1]
- ret i32 %tmp2
-}
-
diff --git a/release_23/test/Analysis/Andersens/trivialtest.ll b/release_23/test/Analysis/Andersens/trivialtest.ll
deleted file mode 100644
index ce37516b3684..000000000000
--- a/release_23/test/Analysis/Andersens/trivialtest.ll
+++ /dev/null
@@ -1,3 +0,0 @@
-; RUN: llvm-as < %s | opt -anders-aa -disable-output
-
-define void @foo() { ret void }
diff --git a/release_23/test/Analysis/BasicAA/2003-02-26-AccessSizeTest.ll b/release_23/test/Analysis/BasicAA/2003-02-26-AccessSizeTest.ll
deleted file mode 100644
index 4a3239fa56dc..000000000000
--- a/release_23/test/Analysis/BasicAA/2003-02-26-AccessSizeTest.ll
+++ /dev/null
@@ -1,18 +0,0 @@
-; This testcase makes sure that size is taken to account when alias analysis
-; is performed. It is not legal to delete the second load instruction because
-; the value computed by the first load instruction is changed by the store.
-
-; RUN: llvm-as < %s | opt -load-vn -gcse -instcombine | llvm-dis | grep DONOTREMOVE
-
-define i32 @test() {
- %A = alloca i32
- store i32 0, i32* %A
- %X = load i32* %A
- %B = bitcast i32* %A to i8*
- %C = getelementptr i8* %B, i64 1
- store i8 1, i8* %C ; Aliases %A
- %Y.DONOTREMOVE = load i32* %A
- %Z = sub i32 %X, %Y.DONOTREMOVE
- ret i32 %Z
-}
-
diff --git a/release_23/test/Analysis/BasicAA/2003-03-04-GEPCrash.ll b/release_23/test/Analysis/BasicAA/2003-03-04-GEPCrash.ll
deleted file mode 100644
index 8f2e22d5c33f..000000000000
--- a/release_23/test/Analysis/BasicAA/2003-03-04-GEPCrash.ll
+++ /dev/null
@@ -1,7 +0,0 @@
-; RUN: llvm-as < %s | opt -basicaa -aa-eval -disable-output
-; Test for a bug in BasicAA which caused a crash when querying equality of P1&P2
-define void @test({[2 x i32],[2 x i32]}* %A, i64 %X, i64 %Y) {
- %P1 = getelementptr {[2 x i32],[2 x i32]}* %A, i64 0, i32 0, i64 %X
- %P2 = getelementptr {[2 x i32],[2 x i32]}* %A, i64 0, i32 1, i64 %Y
- ret void
-}
diff --git a/release_23/test/Analysis/BasicAA/2003-04-22-GEPProblem.ll b/release_23/test/Analysis/BasicAA/2003-04-22-GEPProblem.ll
deleted file mode 100644
index 5902a4266ce6..000000000000
--- a/release_23/test/Analysis/BasicAA/2003-04-22-GEPProblem.ll
+++ /dev/null
@@ -1,15 +0,0 @@
-; RUN: llvm-as < %s | opt -load-vn -gcse -instcombine | llvm-dis | grep sub
-
-; BasicAA was incorrectly concluding that P1 and P2 didn't conflict!
-
-define i32 @test(i32 *%Ptr, i64 %V) {
- %P2 = getelementptr i32* %Ptr, i64 1
- %P1 = getelementptr i32* %Ptr, i64 %V
- %X = load i32* %P1
- store i32 5, i32* %P2
-
- %Y = load i32* %P1
-
- %Z = sub i32 %X, %Y
- ret i32 %Z
-}
diff --git a/release_23/test/Analysis/BasicAA/2003-04-25-GEPCrash.ll b/release_23/test/Analysis/BasicAA/2003-04-25-GEPCrash.ll
deleted file mode 100644
index 0d571d4a6a26..000000000000
--- a/release_23/test/Analysis/BasicAA/2003-04-25-GEPCrash.ll
+++ /dev/null
@@ -1,7 +0,0 @@
-; RUN: llvm-as < %s | opt -basicaa -aa-eval -disable-output
-; Test for a bug in BasicAA which caused a crash when querying equality of P1&P2
-define void @test([17 x i16]* %mask_bits) {
- %P1 = getelementptr [17 x i16]* %mask_bits, i64 0, i64 0
- %P2 = getelementptr [17 x i16]* %mask_bits, i64 252645134, i64 0
- ret void
-}
diff --git a/release_23/test/Analysis/BasicAA/2003-05-21-GEP-Problem.ll b/release_23/test/Analysis/BasicAA/2003-05-21-GEP-Problem.ll
deleted file mode 100644
index c9049c8cc439..000000000000
--- a/release_23/test/Analysis/BasicAA/2003-05-21-GEP-Problem.ll
+++ /dev/null
@@ -1,21 +0,0 @@
-; RUN: llvm-as < %s | opt -licm -disable-output
- %struct..apr_array_header_t = type { i32*, i32, i32, i32, i8* }
- %struct..apr_table_t = type { %struct..apr_array_header_t, i32, [32 x i32], [32 x i32] }
-
-define void @table_reindex(%struct..apr_table_t* %t.1) { ; No predecessors!
- br label %loopentry
-
-loopentry: ; preds = %0, %no_exit
- %tmp.101 = getelementptr %struct..apr_table_t* %t.1, i64 0, i32 0, i32 2
- %tmp.11 = load i32* %tmp.101 ; <i32> [#uses=0]
- br i1 false, label %no_exit, label %UnifiedExitNode
-
-no_exit: ; preds = %loopentry
- %tmp.25 = sext i32 0 to i64 ; <i64> [#uses=1]
- %tmp.261 = getelementptr %struct..apr_table_t* %t.1, i64 0, i32 3, i64 %tmp.25 ; <i32*> [#uses=1]
- store i32 0, i32* %tmp.261
- br label %loopentry
-
-UnifiedExitNode: ; preds = %loopentry
- ret void
-}
diff --git a/release_23/test/Analysis/BasicAA/2003-06-01-AliasCrash.ll b/release_23/test/Analysis/BasicAA/2003-06-01-AliasCrash.ll
deleted file mode 100644
index 1dd19b6e63a9..000000000000
--- a/release_23/test/Analysis/BasicAA/2003-06-01-AliasCrash.ll
+++ /dev/null
@@ -1,11 +0,0 @@
-; RUN: llvm-as < %s | opt -basicaa -aa-eval -disable-output
-
-define i32 @MTConcat([3 x i32]* %a.1) {
- %tmp.961 = getelementptr [3 x i32]* %a.1, i64 0, i64 4
- %tmp.97 = load i32* %tmp.961
- %tmp.119 = getelementptr [3 x i32]* %a.1, i64 1, i64 0
- %tmp.120 = load i32* %tmp.119
- %tmp.1541 = getelementptr [3 x i32]* %a.1, i64 0, i64 4
- %tmp.155 = load i32* %tmp.1541
- ret i32 0
-}
diff --git a/release_23/test/Analysis/BasicAA/2003-07-03-BasicAACrash.ll b/release_23/test/Analysis/BasicAA/2003-07-03-BasicAACrash.ll
deleted file mode 100644
index d3754cb89c72..000000000000
--- a/release_23/test/Analysis/BasicAA/2003-07-03-BasicAACrash.ll
+++ /dev/null
@@ -1,10 +0,0 @@
-; RUN: llvm-as < %s | opt -basicaa -aa-eval -disable-output
-
-%struct..RefPoint = type { i32, { i32, i8, i8 } }
-%struct..RefRect = type { %struct..RefPoint, %struct..RefPoint }
-
-define i32 @BMT_CommitPartDrawObj() {
- %tmp.19111 = getelementptr %struct..RefRect* null, i64 0, i32 0, i32 1, i32 2
- %tmp.20311 = getelementptr %struct..RefRect* null, i64 0, i32 1, i32 1, i32 2
- ret i32 0
-}
diff --git a/release_23/test/Analysis/BasicAA/2003-09-19-LocalArgument.ll b/release_23/test/Analysis/BasicAA/2003-09-19-LocalArgument.ll
deleted file mode 100644
index 9bcd4ea952ae..000000000000
--- a/release_23/test/Analysis/BasicAA/2003-09-19-LocalArgument.ll
+++ /dev/null
@@ -1,12 +0,0 @@
-; In this test, a local alloca cannot alias an incoming argument.
-
-; RUN: llvm-as < %s | opt -load-vn -gcse -instcombine | llvm-dis | not grep sub
-
-define i32 @test(i32* %P) {
- %X = alloca i32
- %V1 = load i32* %P
- store i32 0, i32* %X
- %V2 = load i32* %P
- %Diff = sub i32 %V1, %V2
- ret i32 %Diff
-}
diff --git a/release_23/test/Analysis/BasicAA/2003-11-04-SimpleCases.ll b/release_23/test/Analysis/BasicAA/2003-11-04-SimpleCases.ll
deleted file mode 100644
index 99eae1660de8..000000000000
--- a/release_23/test/Analysis/BasicAA/2003-11-04-SimpleCases.ll
+++ /dev/null
@@ -1,16 +0,0 @@
-; This testcase consists of alias relations which should be completely
-; resolvable by basicaa.
-
-; RUN: llvm-as < %s | opt -aa-eval -print-may-aliases -disable-output \
-; RUN: |& not grep May:
-
-%T = type { i32, [10 x i8] }
-
-define void @test(%T* %P) {
- %A = getelementptr %T* %P, i64 0
- %B = getelementptr %T* %P, i64 0, i32 0
- %C = getelementptr %T* %P, i64 0, i32 1
- %D = getelementptr %T* %P, i64 0, i32 1, i64 0
- %E = getelementptr %T* %P, i64 0, i32 1, i64 5
- ret void
-}
diff --git a/release_23/test/Analysis/BasicAA/2003-12-11-ConstExprGEP.ll b/release_23/test/Analysis/BasicAA/2003-12-11-ConstExprGEP.ll
deleted file mode 100644
index 639cb0a2f82c..000000000000
--- a/release_23/test/Analysis/BasicAA/2003-12-11-ConstExprGEP.ll
+++ /dev/null
@@ -1,18 +0,0 @@
-; This testcase consists of alias relations which should be completely
-; resolvable by basicaa, but require analysis of getelementptr constant exprs.
-
-; RUN: llvm-as < %s | opt -aa-eval -print-may-aliases -disable-output \
-; RUN: |& not grep May:
-
-%T = type { i32, [10 x i8] }
-
-@G = external global %T
-
-define void @test() {
- %D = getelementptr %T* @G, i64 0, i32 0
- %E = getelementptr %T* @G, i64 0, i32 1, i64 5
- %F = getelementptr i32* getelementptr (%T* @G, i64 0, i32 0), i64 0
- %X = getelementptr [10 x i8]* getelementptr (%T* @G, i64 0, i32 1), i64 0, i64 5
-
- ret void
-}
diff --git a/release_23/test/Analysis/BasicAA/2004-01-29-InvariantMemory.ll b/release_23/test/Analysis/BasicAA/2004-01-29-InvariantMemory.ll
deleted file mode 100644
index 692c6f8693ab..000000000000
--- a/release_23/test/Analysis/BasicAA/2004-01-29-InvariantMemory.ll
+++ /dev/null
@@ -1,13 +0,0 @@
-; RUN: llvm-as < %s | opt -load-vn -gcse -instcombine | \
-; RUN: llvm-dis | not grep load
-
-@X = constant [2 x i32] [i32 4, i32 5]
-
-define i32 @test(i32* %Y, i64 %idx) {
- %P = getelementptr [2 x i32]* @X, i64 0, i64 %idx
- %A = load i32* %P ; Load from invariant memory
- store i32 4, i32* %Y ; Store could not be to @X
- %B = load i32* %P
- %C = sub i32 %A, %B
- ret i32 %C
-}
diff --git a/release_23/test/Analysis/BasicAA/2004-07-28-MustAliasbug.ll b/release_23/test/Analysis/BasicAA/2004-07-28-MustAliasbug.ll
deleted file mode 100644
index 407932c9d6c5..000000000000
--- a/release_23/test/Analysis/BasicAA/2004-07-28-MustAliasbug.ll
+++ /dev/null
@@ -1,10 +0,0 @@
-; RUN: llvm-as < %s | opt -dse | llvm-dis | grep {store i32 0}
-
-define void @test({i32,i32 }* %P) {
- %Q = getelementptr {i32,i32}* %P, i32 1
- %X = getelementptr {i32,i32}* %Q, i32 0, i32 1
- %Y = getelementptr {i32,i32}* %Q, i32 1, i32 1
- store i32 0, i32* %X
- store i32 1, i32* %Y
- ret void
-}
diff --git a/release_23/test/Analysis/BasicAA/2004-12-08-BasicAACrash.ll b/release_23/test/Analysis/BasicAA/2004-12-08-BasicAACrash.ll
deleted file mode 100644
index 58d4da16e6e6..000000000000
--- a/release_23/test/Analysis/BasicAA/2004-12-08-BasicAACrash.ll
+++ /dev/null
@@ -1,22 +0,0 @@
-; RUN: llvm-as < %s | opt -licm
-
-%"java/lang/Object" = type { %struct.llvm_java_object_base }
-%"java/lang/StringBuffer" = type { "java/lang/Object", i32, { "java/lang/Object", i32, [0 x i8] }*, i1 }
-%struct.llvm_java_object_base = type opaque
-
-define void @"java/lang/StringBuffer/setLength(I)V"(%struct.llvm_java_object_base*) {
-bc0:
- br i1 false, label %bc40, label %bc65
-
-bc65: ; preds = %bc0, %bc40
- ret void
-
-bc40: ; preds = %bc0, %bc40
- %tmp75 = bitcast %struct.llvm_java_object_base* %0 to %"java/lang/StringBuffer"* ; <"java/lang/StringBuffer"*> [#uses=1]
- %tmp76 = getelementptr %"java/lang/StringBuffer"* %tmp75, i32 0, i32 1 ; <i32*> [#uses=1]
- store i32 0, i32* %tmp76
- %tmp381 = bitcast %struct.llvm_java_object_base* %0 to %"java/lang/StringBuffer"* ; <"java/lang/StringBuffer"*> [#uses=1]
- %tmp392 = getelementptr %"java/lang/StringBuffer"* %tmp381, i32 0, i32 1 ; <i32*> [#uses=1]
- %tmp403 = load i32* %tmp392 ; <i32> [#uses=0]
- br i1 false, label %bc40, label %bc65
-}
diff --git a/release_23/test/Analysis/BasicAA/2004-12-08-BasicAACrash2.ll b/release_23/test/Analysis/BasicAA/2004-12-08-BasicAACrash2.ll
deleted file mode 100644
index d96438fd43d2..000000000000
--- a/release_23/test/Analysis/BasicAA/2004-12-08-BasicAACrash2.ll
+++ /dev/null
@@ -1,20 +0,0 @@
-; RUN: llvm-as < %s | opt -dse
-
-%"java/lang/Object" = type { %struct.llvm_java_object_base }
-%"java/lang/StringBuffer" = type { "java/lang/Object", i32, { "java/lang/Object", i32, [0 x i8] }*, i1 }
-%struct.llvm_java_object_base = type opaque
-
-define void @"java/lang/StringBuffer/ensureCapacity_unsynchronized(I)V"() {
-bc0:
- %tmp = getelementptr %"java/lang/StringBuffer"* null, i32 0, i32 3 ; <i1*> [#uses=1]
- br i1 false, label %bc16, label %bc7
-
-bc16: ; preds = %bc0
- %tmp91 = getelementptr %"java/lang/StringBuffer"* null, i32 0, i32 2 ; <{ "java/lang/Object", i32, [0 x i8] }**> [#uses=1]
- store { %"java/lang/Object", i32, [0 x i8] }* null, { %"java/lang/Object", i32, [0 x i8] }** %tmp91
- store i1 false, i1* %tmp
- ret void
-
-bc7: ; preds = %bc0
- ret void
-}
diff --git a/release_23/test/Analysis/BasicAA/2005-03-09-BrokenBasicAA.ll b/release_23/test/Analysis/BasicAA/2005-03-09-BrokenBasicAA.ll
deleted file mode 100644
index e5515dde30fc..000000000000
--- a/release_23/test/Analysis/BasicAA/2005-03-09-BrokenBasicAA.ll
+++ /dev/null
@@ -1,15 +0,0 @@
-; RUN: llvm-as < %s | opt -basicaa -load-vn -gcse -instcombine |\
-; RUN: llvm-dis | grep {load i32\\* %A}
-
-declare double* @useit(i32*)
-
-define i32 @foo(i32 %Amt) {
- %A = malloc i32, i32 %Amt
- %P = call double* @useit(i32* %A)
-
- %X = load i32* %A
- store double 0.0, double* %P
- %Y = load i32* %A
- %Z = sub i32 %X, %Y
- ret i32 %Z
-}
diff --git a/release_23/test/Analysis/BasicAA/2006-03-03-BadArraySubscript.ll b/release_23/test/Analysis/BasicAA/2006-03-03-BadArraySubscript.ll
deleted file mode 100644
index b8e30198e371..000000000000
--- a/release_23/test/Analysis/BasicAA/2006-03-03-BadArraySubscript.ll
+++ /dev/null
@@ -1,30 +0,0 @@
-; RUN: llvm-as < %s | opt -aa-eval -disable-output |& grep {2 no alias respon}
-; TEST that A[1][0] may alias A[0][i].
-
-define void @test(i32 %N) {
-entry:
- %X = alloca [3 x [3 x i32]] ; <[3 x [3 x i32]]*> [#uses=4]
- %tmp.24 = icmp sgt i32 %N, 0 ; <i1> [#uses=1]
- br i1 %tmp.24, label %no_exit, label %loopexit
-
-no_exit: ; preds = %no_exit, %entry
- %i.0.0 = phi i32 [ 0, %entry ], [ %inc, %no_exit ] ; <i32> [#uses=2]
- %tmp.6 = getelementptr [3 x [3 x i32]]* %X, i32 0, i32 0, i32 %i.0.0 ; <i32*> [#uses=1]
- store i32 1, i32* %tmp.6
- %tmp.8 = getelementptr [3 x [3 x i32]]* %X, i32 0, i32 0, i32 0 ; <i32*> [#uses=1]
- %tmp.9 = load i32* %tmp.8 ; <i32> [#uses=1]
- %tmp.11 = getelementptr [3 x [3 x i32]]* %X, i32 0, i32 1, i32 0 ; <i32*> [#uses=1]
- %tmp.12 = load i32* %tmp.11 ; <i32> [#uses=1]
- %tmp.13 = add i32 %tmp.12, %tmp.9 ; <i32> [#uses=1]
- %inc = add i32 %i.0.0, 1 ; <i32> [#uses=2]
- %tmp.2 = icmp slt i32 %inc, %N ; <i1> [#uses=1]
- br i1 %tmp.2, label %no_exit, label %loopexit
-
-loopexit: ; preds = %no_exit, %entry
- %Y.0.1 = phi i32 [ 0, %entry ], [ %tmp.13, %no_exit ] ; <i32> [#uses=1]
- %tmp.4 = getelementptr [3 x [3 x i32]]* %X, i32 0, i32 0 ; <[3 x i32]*> [#uses=1]
- %tmp.15 = call i32 (...)* @foo( [3 x i32]* %tmp.4, i32 %Y.0.1 ) ; <i32> [#uses=0]
- ret void
-}
-
-declare i32 @foo(...)
diff --git a/release_23/test/Analysis/BasicAA/2006-11-03-BasicAAVectorCrash.ll b/release_23/test/Analysis/BasicAA/2006-11-03-BasicAAVectorCrash.ll
deleted file mode 100644
index cc10e4b81bfd..000000000000
--- a/release_23/test/Analysis/BasicAA/2006-11-03-BasicAAVectorCrash.ll
+++ /dev/null
@@ -1,48 +0,0 @@
-; RUN: llvm-as < %s | opt -licm -disable-output
-target datalayout = "E-p:32:32"
-target triple = "powerpc-apple-darwin8.7.0"
-
-define void @glgRunProcessor() {
-entry:
- br i1 false, label %bb2037.i, label %cond_true.i18
-
-cond_true.i18: ; preds = %entry
- ret void
-
-bb205.i: ; preds = %bb2037.i
- switch i32 0, label %bb1013.i [
- i32 14, label %bb239.i
- i32 15, label %bb917.i
- ]
-
-bb239.i: ; preds = %bb205.i
- br i1 false, label %cond_false277.i, label %cond_true264.i
-
-cond_true264.i: ; preds = %bb239.i
- ret void
-
-cond_false277.i: ; preds = %bb239.i
- %tmp1062.i = getelementptr [2 x <4 x i32>]* null, i32 0, i32 1 ; <<4 x i32>*> [#uses=1]
- store <4 x i32> zeroinitializer, <4 x i32>* %tmp1062.i
- br i1 false, label %cond_true1032.i, label %cond_false1063.i85
-
-bb917.i: ; preds = %bb205.i
- ret void
-
-bb1013.i: ; preds = %bb205.i
- ret void
-
-cond_true1032.i: ; preds = %cond_false277.i
- %tmp1187.i = getelementptr [2 x <4 x i32>]* null, i32 0, i32 0, i32 7 ; <i32*> [#uses=1]
- store i32 0, i32* %tmp1187.i
- br label %bb2037.i
-
-cond_false1063.i85: ; preds = %cond_false277.i
- ret void
-
-bb2037.i: ; preds = %cond_true1032.i, %entry
- br i1 false, label %bb205.i, label %cond_next2042.i
-
-cond_next2042.i: ; preds = %bb2037.i
- ret void
-}
diff --git a/release_23/test/Analysis/BasicAA/2007-01-13-BasePointerBadNoAlias.ll b/release_23/test/Analysis/BasicAA/2007-01-13-BasePointerBadNoAlias.ll
deleted file mode 100644
index 683e07db51ab..000000000000
--- a/release_23/test/Analysis/BasicAA/2007-01-13-BasePointerBadNoAlias.ll
+++ /dev/null
@@ -1,35 +0,0 @@
-; PR1109
-; RUN: llvm-as < %s | opt -basicaa -load-vn -gcse -instcombine | llvm-dis | \
-; RUN: grep {sub i32}
-; RUN: llvm-as < %s | opt -basicaa -load-vn -gcse -instcombine | llvm-dis | \
-; RUN: not grep {ret i32 0}
-; END.
-
-target datalayout = "e-p:32:32"
-target triple = "i686-apple-darwin8"
- %struct.CONSTRAINT = type { i32, i32, i32, i32 }
- %struct.FILE_POS = type { i8, i8, i16, i32 }
- %struct.FIRST_UNION = type { %struct.FILE_POS }
- %struct.FOURTH_UNION = type { %struct.CONSTRAINT }
- %struct.GAP = type { i8, i8, i16 }
- %struct.LIST = type { %struct.rec*, %struct.rec* }
- %struct.SECOND_UNION = type { { i16, i8, i8 } }
- %struct.STYLE = type { { %struct.GAP }, { %struct.GAP }, i16, i16, i16, i8, i8 }
- %struct.THIRD_UNION = type { { [2 x i32], [2 x i32] } }
- %struct.closure_type = type { [2 x %struct.LIST], %struct.FIRST_UNION, %struct.SECOND_UNION, %struct.THIRD_UNION, %struct.FOURTH_UNION, %struct.rec*, { %struct.rec* } }
- %struct.head_type = type { [2 x %struct.LIST], %struct.FIRST_UNION, %struct.SECOND_UNION, %struct.THIRD_UNION, %struct.FOURTH_UNION, %struct.rec*, { %struct.rec* }, %struct.rec*, %struct.rec*, %struct.rec*, %struct.rec*, %struct.rec*, %struct.rec*, %struct.rec*, %struct.rec*, i32 }
- %struct.rec = type { %struct.head_type }
-
-
-define i32 @test(%struct.closure_type* %tmp18169) {
- %tmp18174 = getelementptr %struct.closure_type* %tmp18169, i32 0, i32 4, i32 0, i32 0 ; <i32*> [#uses=2]
- %tmp18269 = bitcast i32* %tmp18174 to %struct.STYLE* ; <%struct.STYLE*> [#uses=1]
- %A = load i32* %tmp18174 ; <i32> [#uses=1]
-
- %tmp18272 = getelementptr %struct.STYLE* %tmp18269, i32 0, i32 0, i32 0, i32 2 ; <i16*> [#uses=1]
- store i16 123, i16* %tmp18272
-
- %Q = load i32* %tmp18174 ; <i32> [#uses=1]
- %Z = sub i32 %A, %Q ; <i32> [#uses=1]
- ret i32 %Z
-}
diff --git a/release_23/test/Analysis/BasicAA/2007-08-01-NoAliasAndCalls.ll b/release_23/test/Analysis/BasicAA/2007-08-01-NoAliasAndCalls.ll
deleted file mode 100644
index 3b6eb11b6ae4..000000000000
--- a/release_23/test/Analysis/BasicAA/2007-08-01-NoAliasAndCalls.ll
+++ /dev/null
@@ -1,10 +0,0 @@
-; RUN: llvm-as %s -o - | opt -basicaa -aa-eval -print-all-alias-modref-info -disable-output |& grep {MayAlias:.*i32\\* %., i32\\* %.} | grep {%x} | grep {%y}
-
-declare i32* @unclear(i32* %a)
-
-define void @foo(i32* noalias %x) {
- %y = call i32* @unclear(i32* %x)
- store i32 0, i32* %x
- store i32 0, i32* %y
- ret void
-}
diff --git a/release_23/test/Analysis/BasicAA/2007-08-01-NoAliasAndGEP.ll b/release_23/test/Analysis/BasicAA/2007-08-01-NoAliasAndGEP.ll
deleted file mode 100644
index 9936afb19560..000000000000
--- a/release_23/test/Analysis/BasicAA/2007-08-01-NoAliasAndGEP.ll
+++ /dev/null
@@ -1,17 +0,0 @@
-; RUN: llvm-as %s -o - | opt -basicaa -aa-eval -print-all-alias-modref-info -disable-output |& grep {9 no alias}
-; RUN: llvm-as %s -o - | opt -basicaa -aa-eval -print-all-alias-modref-info -disable-output |& grep {6 may alias}
-; RUN: llvm-as %s -o - | opt -basicaa -aa-eval -print-all-alias-modref-info -disable-output |& grep {MayAlias:.*i32\\* %Ipointer, i32\\* %Jpointer}
-
-define void @foo(i32* noalias %p, i32* noalias %q, i32 %i, i32 %j) {
- %Ipointer = getelementptr i32* %p, i32 %i
- %qi = getelementptr i32* %q, i32 %i
- %Jpointer = getelementptr i32* %p, i32 %j
- %qj = getelementptr i32* %q, i32 %j
- store i32 0, i32* %p
- store i32 0, i32* %Ipointer
- store i32 0, i32* %Jpointer
- store i32 0, i32* %q
- store i32 0, i32* %qi
- store i32 0, i32* %qj
- ret void
-}
diff --git a/release_23/test/Analysis/BasicAA/2007-08-05-GetOverloadedModRef.ll b/release_23/test/Analysis/BasicAA/2007-08-05-GetOverloadedModRef.ll
deleted file mode 100644
index c555f6333984..000000000000
--- a/release_23/test/Analysis/BasicAA/2007-08-05-GetOverloadedModRef.ll
+++ /dev/null
@@ -1,17 +0,0 @@
-; PR1600
-; RUN: llvm-as < %s | opt -basicaa -load-vn -gcse -instcombine | llvm-dis | \
-; RUN: grep {ret i32 0}
-; END.
-
-declare i16 @llvm.cttz.i16(i16)
-
-define i32 @test(i32* %P, i16* %Q) {
- %A = load i16* %Q ; <i16> [#uses=1]
- %x = load i32* %P ; <i32> [#uses=1]
- %B = call i16 @llvm.cttz.i16( i16 %A ) ; <i16> [#uses=1]
- %y = load i32* %P ; <i32> [#uses=1]
- store i16 %B, i16* %Q
- %z = sub i32 %x, %y ; <i32> [#uses=1]
- ret i32 %z
-}
-
diff --git a/release_23/test/Analysis/BasicAA/2007-10-24-ArgumentsGlobals.ll b/release_23/test/Analysis/BasicAA/2007-10-24-ArgumentsGlobals.ll
deleted file mode 100644
index 61ab80d5475a..000000000000
--- a/release_23/test/Analysis/BasicAA/2007-10-24-ArgumentsGlobals.ll
+++ /dev/null
@@ -1,14 +0,0 @@
-; RUN: llvm-as < %s | opt -basicaa -gvn -dce | llvm-dis | grep tmp7
-
- %struct.A = type { i32 }
- %struct.B = type { %struct.A }
-@a = global %struct.B zeroinitializer ; <%struct.B*> [#uses=2]
-
-define i32 @_Z3fooP1A(%struct.A* %b) {
-entry:
- store i32 1, i32* getelementptr (%struct.B* @a, i32 0, i32 0, i32 0), align 8
- %tmp4 = getelementptr %struct.A* %b, i32 0, i32 0 ;<i32*> [#uses=1]
- store i32 0, i32* %tmp4, align 4
- %tmp7 = load i32* getelementptr (%struct.B* @a, i32 0, i32 0, i32 0), align 8 ; <i32> [#uses=1]
- ret i32 %tmp7
-}
diff --git a/release_23/test/Analysis/BasicAA/2007-11-05-SizeCrash.ll b/release_23/test/Analysis/BasicAA/2007-11-05-SizeCrash.ll
deleted file mode 100644
index 5a938cfef05f..000000000000
--- a/release_23/test/Analysis/BasicAA/2007-11-05-SizeCrash.ll
+++ /dev/null
@@ -1,34 +0,0 @@
-; RUN: llvm-as < %s | opt -gvn -disable-output
-; PR1774
-
-target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128"
-target triple = "x86_64-unknown-linux-gnu"
- %struct.device = type { [20 x i8] }
- %struct.pci_device_id = type { i32, i32, i32, i32, i32, i32, i64 }
- %struct.usb_bus = type { %struct.device* }
- %struct.usb_hcd = type { %struct.usb_bus, i64, [0 x i64] }
-@uhci_pci_ids = external constant [1 x %struct.pci_device_id] ; <[1 x %struct.pci_device_id]*> [#uses=1]
-
-@__mod_pci_device_table = alias [1 x %struct.pci_device_id]* @uhci_pci_ids
- ; <[1 x %struct.pci_device_id]*> [#uses=0]
-
-define i32 @uhci_suspend(%struct.usb_hcd* %hcd) {
-entry:
- %tmp17 = getelementptr %struct.usb_hcd* %hcd, i32 0, i32 2, i64 1
- ; <i64*> [#uses=1]
- %tmp1718 = bitcast i64* %tmp17 to i32* ; <i32*> [#uses=1]
- %tmp19 = load i32* %tmp1718, align 4 ; <i32> [#uses=0]
- br i1 false, label %cond_true34, label %done_okay
-
-cond_true34: ; preds = %entry
- %tmp631 = getelementptr %struct.usb_hcd* %hcd, i32 0, i32 2, i64
-2305843009213693950 ; <i64*> [#uses=1]
- %tmp70 = bitcast i64* %tmp631 to %struct.device** ;
-
- %tmp71 = load %struct.device** %tmp70, align 8 ;
-
- ret i32 undef
-
-done_okay: ; preds = %entry
- ret i32 undef
-}
diff --git a/release_23/test/Analysis/BasicAA/2007-12-08-OutOfBoundsCrash.ll b/release_23/test/Analysis/BasicAA/2007-12-08-OutOfBoundsCrash.ll
deleted file mode 100644
index 2f0c769ee58d..000000000000
--- a/release_23/test/Analysis/BasicAA/2007-12-08-OutOfBoundsCrash.ll
+++ /dev/null
@@ -1,31 +0,0 @@
-; RUN: llvm-as < %s | opt -gvn -disable-output
-; PR1782
-
-target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128"
-target triple = "x86_64-unknown-linux-gnu"
- %struct.device = type { [20 x i8] }
- %struct.pci_device_id = type { i32, i32, i32, i32, i32, i32, i64 }
- %struct.usb_bus = type { %struct.device* }
- %struct.usb_hcd = type { %struct.usb_bus, [0 x i64] }
-@pci_ids = external constant [1 x %struct.pci_device_id] ; <[1 x %struct.pci_device_id]*> [#uses=1]
-
-@__mod_pci_device_table = alias [1 x %struct.pci_device_id]* @pci_ids ; <[1 x %struct.pci_device_id]*> [#uses=0]
-
-define i32 @ehci_pci_setup(%struct.usb_hcd* %hcd) {
-entry:
- %tmp14 = getelementptr %struct.usb_hcd* %hcd, i32 0, i32 0, i32 0 ; <%struct.device**> [#uses=1]
- %tmp15 = load %struct.device** %tmp14, align 8 ; <%struct.device*> [#uses=0]
- br i1 false, label %bb25, label %return
-
-bb25: ; preds = %entry
- br i1 false, label %cond_true, label %return
-
-cond_true: ; preds = %bb25
- %tmp601 = getelementptr %struct.usb_hcd* %hcd, i32 0, i32 1, i64 2305843009213693951 ; <i64*> [#uses=1]
- %tmp67 = bitcast i64* %tmp601 to %struct.device** ; <%struct.device**> [#uses=1]
- %tmp68 = load %struct.device** %tmp67, align 8 ; <%struct.device*> [#uses=0]
- ret i32 undef
-
-return: ; preds = %bb25, %entry
- ret i32 undef
-}
diff --git a/release_23/test/Analysis/BasicAA/2008-04-15-Byval.ll b/release_23/test/Analysis/BasicAA/2008-04-15-Byval.ll
deleted file mode 100644
index ee16909977d1..000000000000
--- a/release_23/test/Analysis/BasicAA/2008-04-15-Byval.ll
+++ /dev/null
@@ -1,18 +0,0 @@
-; RUN: llvm-as < %s | opt -std-compile-opts | llvm-dis | grep store
-; ModuleID = 'small2.c'
-target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
-target triple = "i386-apple-darwin8"
- %struct.x = type { [4 x i32] }
-
-define void @foo(%struct.x* byval align 4 %X) nounwind {
-entry:
- %tmp = getelementptr %struct.x* %X, i32 0, i32 0 ; <[4 x i32]*> [#uses=1]
- %tmp1 = getelementptr [4 x i32]* %tmp, i32 0, i32 3 ; <i32*> [#uses=1]
- store i32 2, i32* %tmp1, align 4
- %tmp2 = call i32 (...)* @bar( %struct.x* byval align 4 %X ) nounwind ; <i32> [#uses=0]
- br label %return
-return: ; preds = %entry
- ret void
-}
-
-declare i32 @bar(...)
diff --git a/release_23/test/Analysis/BasicAA/byval.ll b/release_23/test/Analysis/BasicAA/byval.ll
deleted file mode 100644
index f0644198b7db..000000000000
--- a/release_23/test/Analysis/BasicAA/byval.ll
+++ /dev/null
@@ -1,18 +0,0 @@
-; RUN: llvm-as < %s | opt -gvn | llvm-dis | grep {ret i32 1}
-target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
-target triple = "i686-apple-darwin8"
- %struct.x = type { i32, i32, i32, i32 }
-@g = weak global i32 0 ; <i32*> [#uses=1]
-
-define i32 @foo(%struct.x* byval %a) nounwind {
-entry:
- %tmp1 = tail call i32 (...)* @bar( %struct.x* %a ) nounwind ; <i32> [#uses=0]
- %tmp2 = getelementptr %struct.x* %a, i32 0, i32 0 ; <i32*> [#uses=2]
- store i32 1, i32* %tmp2, align 4
- store i32 2, i32* @g, align 4
- %tmp4 = load i32* %tmp2, align 4 ; <i32> [#uses=1]
- ret i32 %tmp4
-}
-
-declare i32 @bar(...)
-
diff --git a/release_23/test/Analysis/BasicAA/dg.exp b/release_23/test/Analysis/BasicAA/dg.exp
deleted file mode 100644
index 879685ca879d..000000000000
--- a/release_23/test/Analysis/BasicAA/dg.exp
+++ /dev/null
@@ -1,3 +0,0 @@
-load_lib llvm.exp
-
-RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
diff --git a/release_23/test/Analysis/BasicAA/featuretest.ll b/release_23/test/Analysis/BasicAA/featuretest.ll
deleted file mode 100644
index a9eeb5d3d2fc..000000000000
--- a/release_23/test/Analysis/BasicAA/featuretest.ll
+++ /dev/null
@@ -1,82 +0,0 @@
-; This testcase tests for various features the basicaa test should be able to
-; determine, as noted in the comments.
-
-; RUN: llvm-as < %s | opt -basicaa -load-vn -gcse -instcombine -dce | llvm-dis | not grep REMOVE
-
-@Global = external global { i32 }
-
-; Array test: Test that operations on one local array do not invalidate
-; operations on another array. Important for scientific codes.
-;
-define i32 @different_array_test(i64 %A, i64 %B) {
- %Array1 = alloca i32, i32 100
- %Array2 = alloca i32, i32 200
-
- %pointer = getelementptr i32* %Array1, i64 %A
- %val = load i32* %pointer
-
- %pointer2 = getelementptr i32* %Array2, i64 %B
- store i32 7, i32* %pointer2
-
- %REMOVE = load i32* %pointer ; redundant with above load
- %retval = sub i32 %REMOVE, %val
- ret i32 %retval
-}
-
-; Constant index test: Constant indexes into the same array should not
-; interfere with each other. Again, important for scientific codes.
-;
-define i32 @constant_array_index_test() {
- %Array = alloca i32, i32 100
- %P1 = getelementptr i32* %Array, i64 7
- %P2 = getelementptr i32* %Array, i64 6
-
- %A = load i32* %P1
- store i32 1, i32* %P2 ; Should not invalidate load
- %BREMOVE = load i32* %P1
- %Val = sub i32 %A, %BREMOVE
- ret i32 %Val
-}
-
-; Test that if two pointers are spaced out by a constant getelementptr, that
-; they cannot alias.
-define i32 @gep_distance_test(i32* %A) {
- %REMOVEu = load i32* %A
- %B = getelementptr i32* %A, i64 2 ; Cannot alias A
- store i32 7, i32* %B
- %REMOVEv = load i32* %A
- %r = sub i32 %REMOVEu, %REMOVEv
- ret i32 %r
-}
-
-; Test that if two pointers are spaced out by a constant offset, that they
-; cannot alias, even if there is a variable offset between them...
-define i32 @gep_distance_test2({i32,i32}* %A, i64 %distance) {
- %A1 = getelementptr {i32,i32}* %A, i64 0, i32 0
- %REMOVEu = load i32* %A1
- %B = getelementptr {i32,i32}* %A, i64 %distance, i32 1
- store i32 7, i32* %B ; B cannot alias A, it's at least 4 bytes away
- %REMOVEv = load i32* %A1
- %r = sub i32 %REMOVEu, %REMOVEv
- ret i32 %r
-}
-
-; Test that we can do funny pointer things and that distance calc will still
-; work.
-define i32 @gep_distance_test3(i32 * %A) {
- %X = load i32* %A
- %B = bitcast i32* %A to i8*
- %C = getelementptr i8* %B, i64 4
- %Y = load i8* %C
- ret i32 8
-}
-
-; Test that we can disambiguate globals reached through constantexpr geps
-define i32 @constexpr_test() {
- %X = alloca i32
- %Y = load i32* %X
- store i32 5, i32* getelementptr ({ i32 }* @Global, i64 0, i32 0)
- %REMOVE = load i32* %X
- %retval = sub i32 %Y, %REMOVE
- ret i32 %retval
-}
diff --git a/release_23/test/Analysis/BasicAA/gcsetest.ll b/release_23/test/Analysis/BasicAA/gcsetest.ll
deleted file mode 100644
index b7e2565f0b80..000000000000
--- a/release_23/test/Analysis/BasicAA/gcsetest.ll
+++ /dev/null
@@ -1,46 +0,0 @@
-; Test that GCSE uses basicaa to do alias analysis, which is capable of
-; disambiguating some obvious cases. All loads should be removable in
-; this testcase.
-
-; RUN: llvm-as < %s | opt -basicaa -load-vn -gcse -instcombine -dce \
-; RUN: | llvm-dis | not grep load
-
-@A = global i32 7
-@B = global i32 8
-
-define i32 @test() {
- %A1 = load i32* @A
-
- store i32 123, i32* @B ; Store cannot alias @A
-
- %A2 = load i32* @A
- %X = sub i32 %A1, %A2
- ret i32 %X
-}
-
-define i32 @test2() {
- %A1 = load i32* @A
- br label %Loop
-Loop:
- %AP = phi i32 [0, %0], [%X, %Loop]
- store i32 %AP, i32* @B ; Store cannot alias @A
-
- %A2 = load i32* @A
- %X = sub i32 %A1, %A2
- %c = icmp eq i32 %X, 0
- br i1 %c, label %out, label %Loop
-
-out:
- ret i32 %X
-}
-
-declare void @external()
-
-define i32 @test3() {
- %X = alloca i32
- store i32 7, i32* %X
- call void @external()
- %V = load i32* %X
- ret i32 %V
-}
-
diff --git a/release_23/test/Analysis/BasicAA/global-size.ll b/release_23/test/Analysis/BasicAA/global-size.ll
deleted file mode 100644
index 92a8bc5b4b15..000000000000
--- a/release_23/test/Analysis/BasicAA/global-size.ll
+++ /dev/null
@@ -1,15 +0,0 @@
-; A store or load cannot alias a global if the accessed amount is larger then
-; the global.
-
-; RUN: llvm-as < %s | opt -basicaa -load-vn -gcse -instcombine | llvm-dis | not grep load
-
-@B = global i16 8 ; <i16*> [#uses=2]
-
-define i16 @test(i32* %P) {
- %X = load i16* @B ; <i16> [#uses=1]
- store i32 7, i32* %P
- %Y = load i16* @B ; <i16> [#uses=1]
- %Z = sub i16 %Y, %X ; <i16> [#uses=1]
- ret i16 %Z
-}
-
diff --git a/release_23/test/Analysis/BasicAA/licmtest.ll b/release_23/test/Analysis/BasicAA/licmtest.ll
deleted file mode 100644
index e65a453d0f32..000000000000
--- a/release_23/test/Analysis/BasicAA/licmtest.ll
+++ /dev/null
@@ -1,42 +0,0 @@
-; Test that LICM uses basicaa to do alias analysis, which is capable of
-; disambiguating some obvious cases. If LICM is able to disambiguate the
-; two pointers, then the load should be hoisted, and the store sunk. Thus
-; the loop becomes empty and can be deleted by ADCE.
-
-; RUN: llvm-as < %s | opt -basicaa -licm --adce | llvm-dis | not grep Loop
-
-@A = global i32 7 ; <i32*> [#uses=3]
-@B = global i32 8 ; <i32*> [#uses=2]
-@C = global [2 x i32] [ i32 4, i32 8 ] ; <[2 x i32]*> [#uses=2]
-
-define i32 @test(i1 %c) {
- %Atmp = load i32* @A ; <i32> [#uses=2]
- br label %Loop
-
-Loop: ; preds = %Loop, %0
- %ToRemove = load i32* @A ; <i32> [#uses=1]
- store i32 %Atmp, i32* @B
- br i1 %c, label %Out, label %Loop
-
-Out: ; preds = %Loop
- %X = sub i32 %ToRemove, %Atmp ; <i32> [#uses=1]
- ret i32 %X
-}
-
-define i32 @test2(i1 %c) {
- br label %Loop
-
-Loop: ; preds = %Loop, %0
- %AVal = load i32* @A ; <i32> [#uses=2]
- %C0 = getelementptr [2 x i32]* @C, i64 0, i64 0 ; <i32*> [#uses=1]
- store i32 %AVal, i32* %C0
- %BVal = load i32* @B ; <i32> [#uses=2]
- %C1 = getelementptr [2 x i32]* @C, i64 0, i64 1 ; <i32*> [#uses=1]
- store i32 %BVal, i32* %C1
- br i1 %c, label %Out, label %Loop
-
-Out: ; preds = %Loop
- %X = sub i32 %AVal, %BVal ; <i32> [#uses=1]
- ret i32 %X
-}
-
diff --git a/release_23/test/Analysis/BasicAA/modref.ll b/release_23/test/Analysis/BasicAA/modref.ll
deleted file mode 100644
index 819f956eaa10..000000000000
--- a/release_23/test/Analysis/BasicAA/modref.ll
+++ /dev/null
@@ -1,15 +0,0 @@
-; A very rudimentary test on AliasAnalysis::getModRefInfo.
-; RUN: llvm-as < %s | opt -print-all-alias-modref-info -aa-eval -disable-output |& \
-; RUN: not grep NoModRef
-
-define i32 @callee() {
- %X = alloca { i32, i32 } ; <{ i32, i32 }*> [#uses=1]
- %Y = getelementptr { i32, i32 }* %X, i64 0, i32 0 ; <i32*> [#uses=1]
- %Z = load i32* %Y ; <i32> [#uses=1]
- ret i32 %Z
-}
-
-define i32 @caller() {
- %X = call i32 @callee( ) ; <i32> [#uses=1]
- ret i32 %X
-}
diff --git a/release_23/test/Analysis/BasicAA/pure-const-dce.ll b/release_23/test/Analysis/BasicAA/pure-const-dce.ll
deleted file mode 100644
index b01b5c5cb81c..000000000000
--- a/release_23/test/Analysis/BasicAA/pure-const-dce.ll
+++ /dev/null
@@ -1,33 +0,0 @@
-; RUN: llvm-as < %s | opt -basicaa -gvn | llvm-dis | grep TestConst | count 2
-; RUN: llvm-as < %s | opt -basicaa -gvn | llvm-dis | grep TestPure | count 3
-; RUN: llvm-as < %s | opt -basicaa -gvn | llvm-dis | grep TestNone | count 4
-@g = global i32 0 ; <i32*> [#uses=1]
-
-define i32 @test() {
-entry:
- %tmp0 = call i32 @TestConst( i32 5 ) readnone ; <i32> [#uses=1]
- %tmp1 = call i32 @TestPure( i32 6 ) readonly ; <i32> [#uses=1]
- %tmp2 = call i32 @TestNone( i32 7 ) ; <i32> [#uses=1]
- store i32 1, i32* @g
- %tmp3 = call i32 @TestConst( i32 5 ) readnone ; <i32> [#uses=1]
- %tmp4 = call i32 @TestConst( i32 5 ) readnone ; <i32> [#uses=1]
- %tmp5 = call i32 @TestPure( i32 6 ) readonly ; <i32> [#uses=1]
- %tmp6 = call i32 @TestPure( i32 6 ) readonly ; <i32> [#uses=1]
- %tmp7 = call i32 @TestNone( i32 7 ) ; <i32> [#uses=1]
- %tmp8 = call i32 @TestNone( i32 7 ) ; <i32> [#uses=1]
- %sum0 = add i32 %tmp0, %tmp1 ; <i32> [#uses=1]
- %sum1 = add i32 %sum0, %tmp2 ; <i32> [#uses=1]
- %sum2 = add i32 %sum1, %tmp3 ; <i32> [#uses=1]
- %sum3 = add i32 %sum2, %tmp4 ; <i32> [#uses=1]
- %sum4 = add i32 %sum3, %tmp5 ; <i32> [#uses=1]
- %sum5 = add i32 %sum4, %tmp6 ; <i32> [#uses=1]
- %sum6 = add i32 %sum5, %tmp7 ; <i32> [#uses=1]
- %sum7 = add i32 %sum6, %tmp8 ; <i32> [#uses=1]
- ret i32 %sum7
-}
-
-declare i32 @TestConst(i32) readnone
-
-declare i32 @TestPure(i32) readonly
-
-declare i32 @TestNone(i32)
diff --git a/release_23/test/Analysis/BasicAA/tailcall-modref.ll b/release_23/test/Analysis/BasicAA/tailcall-modref.ll
deleted file mode 100644
index d63bf2b5c1a4..000000000000
--- a/release_23/test/Analysis/BasicAA/tailcall-modref.ll
+++ /dev/null
@@ -1,16 +0,0 @@
-; RUN: llvm-as < %s | opt -basicaa -load-vn -gcse -instcombine |\
-; RUN: llvm-dis | grep {ret i32 0}
-
-declare void @foo(i32*)
-
-declare void @bar()
-
-define i32 @test() {
- %A = alloca i32 ; <i32*> [#uses=3]
- call void @foo( i32* %A )
- %X = load i32* %A ; <i32> [#uses=1]
- tail call void @bar( )
- %Y = load i32* %A ; <i32> [#uses=1]
- %Z = sub i32 %X, %Y ; <i32> [#uses=1]
- ret i32 %Z
-}
diff --git a/release_23/test/Analysis/Dominators/2006-09-26-PostDominanceFrontier.ll b/release_23/test/Analysis/Dominators/2006-09-26-PostDominanceFrontier.ll
deleted file mode 100644
index b272f92499e5..000000000000
--- a/release_23/test/Analysis/Dominators/2006-09-26-PostDominanceFrontier.ll
+++ /dev/null
@@ -1,97 +0,0 @@
-; RUN: llvm-as < %s | opt -analyze -postdomfrontier \
-; RUN: -disable-verify
-; ModuleID = '2006-09-26-PostDominanceFrontier.bc'
-target datalayout = "e-p:64:64"
-target triple = "alphaev67-unknown-linux-gnu"
- %struct.FILE = type { i32, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, %struct._IO_marker*, %struct.FILE*, i32, i32, i64, i16, i8, [1 x i8], i8*, i64, i8*, i8*, i32, [44 x i8] }
- %struct._IO_marker = type { %struct._IO_marker*, %struct.FILE*, i32 }
-@TOP = external global i64* ; <i64**> [#uses=1]
-@BOT = external global i64* ; <i64**> [#uses=1]
-@str = external global [2 x i8] ; <[2 x i8]*> [#uses=0]
-
-declare void @fopen()
-
-define void @main(i8** %argv) {
-entry:
- %netSelect.i507 = alloca i64, align 8 ; <i64*> [#uses=0]
- %topStart.i = alloca i64, align 8 ; <i64*> [#uses=0]
- %topEnd.i = alloca i64, align 8 ; <i64*> [#uses=0]
- %botStart.i = alloca i64, align 8 ; <i64*> [#uses=0]
- %botEnd.i = alloca i64, align 8 ; <i64*> [#uses=0]
- %c1.i154 = alloca i32, align 4 ; <i32*> [#uses=0]
- %b1.i155 = alloca i32, align 4 ; <i32*> [#uses=0]
- %t1.i156 = alloca i32, align 4 ; <i32*> [#uses=0]
- %c1.i = alloca i32, align 4 ; <i32*> [#uses=0]
- %b1.i = alloca i32, align 4 ; <i32*> [#uses=0]
- %t1.i = alloca i32, align 4 ; <i32*> [#uses=0]
- %netSelect.i5 = alloca i64, align 8 ; <i64*> [#uses=0]
- %netSelect.i = alloca i64, align 8 ; <i64*> [#uses=0]
- %tmp2.i = getelementptr i8** %argv, i32 1 ; <i8**> [#uses=1]
- %tmp3.i4 = load i8** %tmp2.i ; <i8*> [#uses=0]
- call void @fopen( )
- br i1 false, label %DimensionChannel.exit, label %bb.backedge.i
-
-bb.backedge.i: ; preds = %entry
- ret void
-
-DimensionChannel.exit: ; preds = %entry
- %tmp13.i137 = malloc i64, i32 0 ; <i64*> [#uses=1]
- %tmp610.i = malloc i64, i32 0 ; <i64*> [#uses=1]
- br label %cond_true.i143
-
-cond_true.i143: ; preds = %cond_true.i143, %DimensionChannel.exit
- %tmp9.i140 = getelementptr i64* %tmp13.i137, i64 0 ; <i64*> [#uses=0]
- %tmp12.i = getelementptr i64* %tmp610.i, i64 0 ; <i64*> [#uses=0]
- br i1 false, label %bb18.i144, label %cond_true.i143
-
-bb18.i144: ; preds = %cond_true.i143
- call void @fopen( )
- %tmp76.i105 = malloc i64, i32 0 ; <i64*> [#uses=3]
- %tmp674.i = malloc i64, i32 0 ; <i64*> [#uses=2]
- %tmp1072.i = malloc i64, i32 0 ; <i64*> [#uses=2]
- %tmp1470.i = malloc i64, i32 0 ; <i64*> [#uses=1]
- br label %cond_true.i114
-
-cond_true.i114: ; preds = %cond_true.i114, %bb18.i144
- %tmp17.i108 = getelementptr i64* %tmp76.i105, i64 0 ; <i64*> [#uses=0]
- %tmp20.i = getelementptr i64* %tmp674.i, i64 0 ; <i64*> [#uses=0]
- %tmp23.i111 = getelementptr i64* %tmp1470.i, i64 0 ; <i64*> [#uses=0]
- br i1 false, label %cond_true40.i, label %cond_true.i114
-
-cond_true40.i: ; preds = %cond_true40.i, %cond_true.i114
- %tmp33.i115 = getelementptr i64* %tmp1072.i, i64 0 ; <i64*> [#uses=0]
- br i1 false, label %bb142.i, label %cond_true40.i
-
-cond_next54.i: ; preds = %cond_true76.i
- %tmp57.i = getelementptr i64* %tmp55.i, i64 0 ; <i64*> [#uses=0]
- br i1 false, label %bb64.i, label %bb69.i
-
-bb64.i: ; preds = %cond_true76.i, %cond_next54.i
- %tmp67.i117 = getelementptr i64* %tmp76.i105, i64 0 ; <i64*> [#uses=0]
- br i1 false, label %bb114.i, label %cond_true111.i
-
-bb69.i: ; preds = %cond_next54.i
- br i1 false, label %bb79.i, label %cond_true76.i
-
-cond_true76.i: ; preds = %bb142.i, %bb69.i
- %tmp48.i = getelementptr i64* %tmp46.i, i64 0 ; <i64*> [#uses=0]
- br i1 false, label %bb64.i, label %cond_next54.i
-
-bb79.i: ; preds = %bb69.i
- br i1 false, label %bb114.i, label %cond_true111.i
-
-cond_true111.i: ; preds = %bb79.i, %bb64.i
- %tmp84.i127 = getelementptr i64* %tmp46.i, i64 0 ; <i64*> [#uses=0]
- ret void
-
-bb114.i: ; preds = %bb142.i, %bb79.i, %bb64.i
- %tmp117.i = getelementptr i64* %tmp76.i105, i64 0 ; <i64*> [#uses=0]
- %tmp132.i131 = getelementptr i64* %tmp674.i, i64 0 ; <i64*> [#uses=0]
- %tmp122.i = getelementptr i64* %tmp1072.i, i64 0 ; <i64*> [#uses=0]
- ret void
-
-bb142.i: ; preds = %cond_true40.i
- %tmp46.i = load i64** @BOT ; <i64*> [#uses=2]
- %tmp55.i = load i64** @TOP ; <i64*> [#uses=1]
- br i1 false, label %bb114.i, label %cond_true76.i
-}
diff --git a/release_23/test/Analysis/Dominators/2006-10-02-BreakCritEdges.ll b/release_23/test/Analysis/Dominators/2006-10-02-BreakCritEdges.ll
deleted file mode 100644
index 997ee2a8a0a6..000000000000
--- a/release_23/test/Analysis/Dominators/2006-10-02-BreakCritEdges.ll
+++ /dev/null
@@ -1,20 +0,0 @@
-; RUN: llvm-as < %s | opt -domtree -break-crit-edges -analyze \
-; RUN: -domtree | grep {3.*%brtrue }
-; PR932
-
-declare void @use1(i32)
-
-define void @f(i32 %i, i1 %c) {
-entry:
- %A = icmp eq i32 %i, 0 ; <i1> [#uses=1]
- br i1 %A, label %brtrue, label %brfalse
-
-brtrue: ; preds = %brtrue, %entry
- %B = phi i1 [ true, %brtrue ], [ false, %entry ] ; <i1> [#uses=1]
- call void @use1( i32 %i )
- br i1 %B, label %brtrue, label %brfalse
-
-brfalse: ; preds = %brtrue, %entry
- call void @use1( i32 %i )
- ret void
-}
diff --git a/release_23/test/Analysis/Dominators/2007-01-14-BreakCritEdges.ll b/release_23/test/Analysis/Dominators/2007-01-14-BreakCritEdges.ll
deleted file mode 100644
index 697dad25cce9..000000000000
--- a/release_23/test/Analysis/Dominators/2007-01-14-BreakCritEdges.ll
+++ /dev/null
@@ -1,187 +0,0 @@
-; RUN: llvm-as < %s | opt -domtree -break-crit-edges -domtree -disable-output
-; PR1110
-
- %struct.OggVorbis_File = type { i8*, i32, i64, i64, %struct.ogg_sync_state, i32, i64*, i64*, i32*, i64*, %struct.vorbis_info*, %struct.vorbis_comment*, i64, i32, i32, i32, double, double, %struct.ogg_stream_state, %struct.vorbis_dsp_state, %struct.vorbis_block, %struct.ov_callbacks }
- %struct.alloc_chain = type { i8*, %struct.alloc_chain* }
- %struct.ogg_stream_state = type { i8*, i32, i32, i32, i32*, i64*, i32, i32, i32, i32, [282 x i8], i32, i32, i32, i32, i32, i64, i64 }
- %struct.ogg_sync_state = type { i8*, i32, i32, i32, i32, i32, i32 }
- %struct.oggpack_buffer = type { i32, i32, i8*, i8*, i32 }
- %struct.ov_callbacks = type { i32 (i8*, i32, i32, i8*)*, i32 (i8*, i64, i32)*, i32 (i8*)*, i32 (i8*)* }
- %struct.vorbis_block = type { float**, %struct.oggpack_buffer, i32, i32, i32, i32, i32, i32, i64, i64, %struct.vorbis_dsp_state*, i8*, i32, i32, i32, %struct.alloc_chain*, i32, i32, i32, i32, i8* }
- %struct.vorbis_comment = type { i8**, i32*, i32, i8* }
- %struct.vorbis_dsp_state = type { i32, %struct.vorbis_info*, float**, float**, i32, i32, i32, i32, i32, i32, i32, i32, i32, i64, i64, i64, i64, i64, i64, i8* }
- %struct.vorbis_info = type { i32, i32, i32, i32, i32, i32, i32, i8* }
-
-
-define void @ov_read() {
-entry:
- br i1 false, label %bb, label %return
-
-bb: ; preds = %cond_next22, %entry
- br i1 false, label %cond_true8, label %cond_next15
-
-cond_true8: ; preds = %bb
- br i1 false, label %cond_next15, label %bb29
-
-cond_next15: ; preds = %cond_true8, %bb
- br i1 false, label %return, label %cond_next22
-
-cond_next22: ; preds = %cond_next15
- br i1 false, label %bb, label %return
-
-bb29: ; preds = %cond_true8
- br i1 false, label %cond_true32, label %return
-
-cond_true32: ; preds = %bb29
- br i1 false, label %cond_false37.i, label %cond_true.i11
-
-cond_true.i11: ; preds = %cond_true32
- br i1 false, label %cond_true8.i, label %ov_info.exit
-
-cond_true8.i: ; preds = %cond_true.i11
- br i1 false, label %cond_true44, label %cond_next48
-
-cond_false37.i: ; preds = %cond_true32
- br label %ov_info.exit
-
-ov_info.exit: ; preds = %cond_false37.i, %cond_true.i11
- br i1 false, label %cond_true44, label %cond_next48
-
-cond_true44: ; preds = %ov_info.exit, %cond_true8.i
- br label %cond_next48
-
-cond_next48: ; preds = %cond_true44, %ov_info.exit, %cond_true8.i
- br i1 false, label %cond_next53, label %return
-
-cond_next53: ; preds = %cond_next48
- br i1 false, label %cond_true56, label %cond_false97
-
-cond_true56: ; preds = %cond_next53
- br i1 false, label %bb85, label %cond_next304
-
-bb63: ; preds = %bb85
- br i1 false, label %cond_next78, label %cond_false73
-
-cond_false73: ; preds = %bb63
- br i1 false, label %cond_true76, label %cond_next78
-
-cond_true76: ; preds = %cond_false73
- br label %cond_next78
-
-cond_next78: ; preds = %cond_true76, %cond_false73, %bb63
- br label %bb85
-
-bb85: ; preds = %bb89, %cond_next78, %cond_true56
- br i1 false, label %bb63, label %bb89
-
-bb89: ; preds = %bb85
- br i1 false, label %bb85, label %cond_next304
-
-cond_false97: ; preds = %cond_next53
- br i1 false, label %cond_true108, label %bb248
-
-cond_true108: ; preds = %cond_false97
- br i1 false, label %bb196, label %bb149
-
-bb112: ; preds = %bb149, %bb146
- br i1 false, label %bb119, label %bb146
-
-bb119: ; preds = %cond_next134, %bb112
- br i1 false, label %cond_next134, label %cond_false129
-
-cond_false129: ; preds = %bb119
- br i1 false, label %cond_true132, label %cond_next134
-
-cond_true132: ; preds = %cond_false129
- br label %cond_next134
-
-cond_next134: ; preds = %cond_true132, %cond_false129, %bb119
- br i1 false, label %bb119, label %bb146
-
-bb146: ; preds = %cond_next134, %bb112
- br i1 false, label %bb112, label %cond_next304
-
-bb149: ; preds = %cond_true108
- br i1 false, label %bb112, label %cond_next304
-
-bb155: ; preds = %bb196, %bb193
- br i1 false, label %bb165, label %bb193
-
-bb165: ; preds = %cond_next180, %bb155
- br i1 false, label %cond_next180, label %cond_false175
-
-cond_false175: ; preds = %bb165
- br i1 false, label %cond_true178, label %cond_next180
-
-cond_true178: ; preds = %cond_false175
- br label %cond_next180
-
-cond_next180: ; preds = %cond_true178, %cond_false175, %bb165
- br i1 false, label %bb165, label %bb193
-
-bb193: ; preds = %cond_next180, %bb155
- br i1 false, label %bb155, label %cond_next304
-
-bb196: ; preds = %cond_true108
- br i1 false, label %bb155, label %cond_next304
-
-bb207: ; preds = %bb241
- br i1 false, label %cond_next225, label %cond_false220
-
-cond_false220: ; preds = %bb207
- br i1 false, label %cond_true223, label %cond_next225
-
-cond_true223: ; preds = %cond_false220
- br label %cond_next225
-
-cond_next225: ; preds = %cond_true223, %cond_false220, %bb207
- br label %bb241
-
-bb241: ; preds = %bb248, %bb245, %cond_next225
- br i1 false, label %bb207, label %bb245
-
-bb245: ; preds = %bb241
- br i1 false, label %bb241, label %cond_next304
-
-bb248: ; preds = %cond_false97
- br i1 false, label %bb241, label %cond_next304
-
-bb256: ; preds = %bb290
- br i1 false, label %cond_next274, label %cond_false269
-
-cond_false269: ; preds = %bb256
- br i1 false, label %cond_true272, label %cond_next274
-
-cond_true272: ; preds = %cond_false269
- br label %cond_next274
-
-cond_next274: ; preds = %cond_true272, %cond_false269, %bb256
- br label %bb290
-
-bb290: ; preds = %bb294, %cond_next274
- br i1 false, label %bb256, label %bb294
-
-bb294: ; preds = %bb290
- br i1 false, label %bb290, label %cond_next304
-
-cond_next304: ; preds = %bb294, %bb248, %bb245, %bb196, %bb193, %bb149, %bb146, %bb89, %cond_true56
- br i1 false, label %cond_next11.i, label %cond_true.i
-
-cond_true.i: ; preds = %cond_next304
- br i1 false, label %vorbis_synthesis_read.exit, label %cond_next11.i
-
-cond_next11.i: ; preds = %cond_true.i, %cond_next304
- br label %vorbis_synthesis_read.exit
-
-vorbis_synthesis_read.exit: ; preds = %cond_next11.i, %cond_true.i
- br i1 false, label %cond_next321, label %cond_true316
-
-cond_true316: ; preds = %vorbis_synthesis_read.exit
- ret void
-
-cond_next321: ; preds = %vorbis_synthesis_read.exit
- ret void
-
-return: ; preds = %cond_next48, %bb29, %cond_next22, %cond_next15, %entry
- ret void
-}
diff --git a/release_23/test/Analysis/Dominators/2007-04-17-PostDominanceFrontier.ll b/release_23/test/Analysis/Dominators/2007-04-17-PostDominanceFrontier.ll
deleted file mode 100644
index 51e4c2aeb553..000000000000
--- a/release_23/test/Analysis/Dominators/2007-04-17-PostDominanceFrontier.ll
+++ /dev/null
@@ -1,692 +0,0 @@
-; RUN: llvm-as < %s | opt -postdomfrontier -disable-output
-
-define void @SManager() {
-entry:
- br label %bb.outer
-
-bb.outer: ; preds = %bb193, %entry
- br label %bb.outer156
-
-bb.loopexit: ; preds = %bb442
- br label %bb.outer156
-
-bb.outer156: ; preds = %bb.loopexit, %bb.outer
- br label %bb
-
-bb: ; preds = %bb.backedge, %bb.outer156
- br i1 false, label %cond_true, label %bb.cond_next_crit_edge
-
-bb.cond_next_crit_edge: ; preds = %bb
- br label %cond_next
-
-cond_true: ; preds = %bb
- br label %cond_next
-
-cond_next: ; preds = %cond_true, %bb.cond_next_crit_edge
- br i1 false, label %cond_next.bb.backedge_crit_edge, label %cond_next107
-
-cond_next.bb.backedge_crit_edge: ; preds = %cond_next
- br label %bb.backedge
-
-bb.backedge: ; preds = %cond_true112.bb.backedge_crit_edge, %cond_next.bb.backedge_crit_edge
- br label %bb
-
-cond_next107: ; preds = %cond_next
- br i1 false, label %cond_true112, label %cond_next197
-
-cond_true112: ; preds = %cond_next107
- br i1 false, label %cond_true118, label %cond_true112.bb.backedge_crit_edge
-
-cond_true112.bb.backedge_crit_edge: ; preds = %cond_true112
- br label %bb.backedge
-
-cond_true118: ; preds = %cond_true112
- br i1 false, label %bb123.preheader, label %cond_true118.bb148_crit_edge
-
-cond_true118.bb148_crit_edge: ; preds = %cond_true118
- br label %bb148
-
-bb123.preheader: ; preds = %cond_true118
- br label %bb123
-
-bb123: ; preds = %bb142.bb123_crit_edge, %bb123.preheader
- br i1 false, label %bb123.bb142_crit_edge, label %cond_next.i57
-
-bb123.bb142_crit_edge: ; preds = %bb123
- br label %bb142
-
-cond_next.i57: ; preds = %bb123
- br i1 false, label %cond_true135, label %cond_next.i57.bb142_crit_edge
-
-cond_next.i57.bb142_crit_edge: ; preds = %cond_next.i57
- br label %bb142
-
-cond_true135: ; preds = %cond_next.i57
- br label %bb142
-
-bb142: ; preds = %cond_true135, %cond_next.i57.bb142_crit_edge, %bb123.bb142_crit_edge
- br i1 false, label %bb148.loopexit, label %bb142.bb123_crit_edge
-
-bb142.bb123_crit_edge: ; preds = %bb142
- br label %bb123
-
-bb148.loopexit: ; preds = %bb142
- br label %bb148
-
-bb148: ; preds = %bb148.loopexit, %cond_true118.bb148_crit_edge
- br i1 false, label %bb151.preheader, label %bb148.bb177_crit_edge
-
-bb148.bb177_crit_edge: ; preds = %bb148
- br label %bb177
-
-bb151.preheader: ; preds = %bb148
- br label %bb151
-
-bb151: ; preds = %bb171.bb151_crit_edge, %bb151.preheader
- br i1 false, label %bb151.bb171_crit_edge, label %cond_next.i49
-
-bb151.bb171_crit_edge: ; preds = %bb151
- br label %bb171
-
-cond_next.i49: ; preds = %bb151
- br i1 false, label %cond_true164, label %cond_next.i49.bb171_crit_edge
-
-cond_next.i49.bb171_crit_edge: ; preds = %cond_next.i49
- br label %bb171
-
-cond_true164: ; preds = %cond_next.i49
- br label %bb171
-
-bb171: ; preds = %cond_true164, %cond_next.i49.bb171_crit_edge, %bb151.bb171_crit_edge
- br i1 false, label %bb177.loopexit, label %bb171.bb151_crit_edge
-
-bb171.bb151_crit_edge: ; preds = %bb171
- br label %bb151
-
-bb177.loopexit: ; preds = %bb171
- br label %bb177
-
-bb177: ; preds = %bb177.loopexit, %bb148.bb177_crit_edge
- br i1 false, label %bb180.preheader, label %bb177.bb193_crit_edge
-
-bb177.bb193_crit_edge: ; preds = %bb177
- br label %bb193
-
-bb180.preheader: ; preds = %bb177
- br label %bb180
-
-bb180: ; preds = %bb180.bb180_crit_edge, %bb180.preheader
- br i1 false, label %bb193.loopexit, label %bb180.bb180_crit_edge
-
-bb180.bb180_crit_edge: ; preds = %bb180
- br label %bb180
-
-bb193.loopexit: ; preds = %bb180
- br label %bb193
-
-bb193: ; preds = %bb193.loopexit, %bb177.bb193_crit_edge
- br label %bb.outer
-
-cond_next197: ; preds = %cond_next107
- br i1 false, label %cond_next210, label %cond_true205
-
-cond_true205: ; preds = %cond_next197
- br i1 false, label %cond_true205.bb213_crit_edge, label %cond_true205.bb299_crit_edge
-
-cond_true205.bb299_crit_edge: ; preds = %cond_true205
- br label %bb299
-
-cond_true205.bb213_crit_edge: ; preds = %cond_true205
- br label %bb213
-
-cond_next210: ; preds = %cond_next197
- br label %bb293
-
-bb213: ; preds = %bb293.bb213_crit_edge, %cond_true205.bb213_crit_edge
- br i1 false, label %bb213.cond_next290_crit_edge, label %cond_true248
-
-bb213.cond_next290_crit_edge: ; preds = %bb213
- br label %cond_next290
-
-cond_true248: ; preds = %bb213
- br i1 false, label %cond_true248.cond_next290_crit_edge, label %cond_true255
-
-cond_true248.cond_next290_crit_edge: ; preds = %cond_true248
- br label %cond_next290
-
-cond_true255: ; preds = %cond_true248
- br i1 false, label %cond_true266, label %cond_true255.cond_next271_crit_edge
-
-cond_true255.cond_next271_crit_edge: ; preds = %cond_true255
- br label %cond_next271
-
-cond_true266: ; preds = %cond_true255
- br label %cond_next271
-
-cond_next271: ; preds = %cond_true266, %cond_true255.cond_next271_crit_edge
- br label %cond_next290
-
-cond_next290: ; preds = %cond_next271, %cond_true248.cond_next290_crit_edge, %bb213.cond_next290_crit_edge
- br label %bb293
-
-bb293: ; preds = %cond_next290, %cond_next210
- br i1 false, label %bb293.bb213_crit_edge, label %bb293.bb299_crit_edge
-
-bb293.bb299_crit_edge: ; preds = %bb293
- br label %bb299
-
-bb293.bb213_crit_edge: ; preds = %bb293
- br label %bb213
-
-bb299: ; preds = %bb293.bb299_crit_edge, %cond_true205.bb299_crit_edge
- br i1 false, label %bb302.preheader, label %bb299.bb390_crit_edge
-
-bb299.bb390_crit_edge: ; preds = %bb299
- br label %bb390
-
-bb302.preheader: ; preds = %bb299
- br label %bb302
-
-bb302: ; preds = %bb384.bb302_crit_edge, %bb302.preheader
- br i1 false, label %bb302.bb384_crit_edge, label %cond_true339
-
-bb302.bb384_crit_edge: ; preds = %bb302
- br label %bb384
-
-cond_true339: ; preds = %bb302
- br i1 false, label %cond_true339.bb384_crit_edge, label %cond_true346
-
-cond_true339.bb384_crit_edge: ; preds = %cond_true339
- br label %bb384
-
-cond_true346: ; preds = %cond_true339
- br i1 false, label %cond_true357, label %cond_true346.cond_next361_crit_edge
-
-cond_true346.cond_next361_crit_edge: ; preds = %cond_true346
- br label %cond_next361
-
-cond_true357: ; preds = %cond_true346
- br label %cond_next361
-
-cond_next361: ; preds = %cond_true357, %cond_true346.cond_next361_crit_edge
- br label %bb384
-
-bb384: ; preds = %cond_next361, %cond_true339.bb384_crit_edge, %bb302.bb384_crit_edge
- br i1 false, label %bb390.loopexit, label %bb384.bb302_crit_edge
-
-bb384.bb302_crit_edge: ; preds = %bb384
- br label %bb302
-
-bb390.loopexit: ; preds = %bb384
- br label %bb390
-
-bb390: ; preds = %bb390.loopexit, %bb299.bb390_crit_edge
- br i1 false, label %bb391.preheader, label %bb390.bb442.preheader_crit_edge
-
-bb390.bb442.preheader_crit_edge: ; preds = %bb390
- br label %bb442.preheader
-
-bb391.preheader: ; preds = %bb390
- br label %bb391
-
-bb391: ; preds = %bb413.bb391_crit_edge, %bb391.preheader
- br i1 false, label %bb391.bb413_crit_edge, label %cond_next404
-
-bb391.bb413_crit_edge: ; preds = %bb391
- br label %bb413
-
-cond_next404: ; preds = %bb391
- br i1 false, label %cond_next404.HWrite.exit_crit_edge, label %cond_next.i13
-
-cond_next404.HWrite.exit_crit_edge: ; preds = %cond_next404
- br label %HWrite.exit
-
-cond_next.i13: ; preds = %cond_next404
- br i1 false, label %cond_next.i13.cond_next13.i_crit_edge, label %cond_true12.i
-
-cond_next.i13.cond_next13.i_crit_edge: ; preds = %cond_next.i13
- br label %cond_next13.i
-
-cond_true12.i: ; preds = %cond_next.i13
- br label %cond_next13.i
-
-cond_next13.i: ; preds = %cond_true12.i, %cond_next.i13.cond_next13.i_crit_edge
- br i1 false, label %cond_next13.i.bb.i22_crit_edge, label %cond_next43.i
-
-cond_next13.i.bb.i22_crit_edge: ; preds = %cond_next13.i
- br label %bb.i22
-
-cond_next43.i: ; preds = %cond_next13.i
- br i1 false, label %cond_next43.i.bb.i22_crit_edge, label %bb60.i
-
-cond_next43.i.bb.i22_crit_edge: ; preds = %cond_next43.i
- br label %bb.i22
-
-bb.i22: ; preds = %cond_next43.i.bb.i22_crit_edge, %cond_next13.i.bb.i22_crit_edge
- br label %bb413
-
-bb60.i: ; preds = %cond_next43.i
- br i1 false, label %bb60.i.HWrite.exit_crit_edge, label %cond_true81.i
-
-bb60.i.HWrite.exit_crit_edge: ; preds = %bb60.i
- br label %HWrite.exit
-
-cond_true81.i: ; preds = %bb60.i
- br label %bb413
-
-HWrite.exit: ; preds = %bb60.i.HWrite.exit_crit_edge, %cond_next404.HWrite.exit_crit_edge
- br label %bb413
-
-bb413: ; preds = %HWrite.exit, %cond_true81.i, %bb.i22, %bb391.bb413_crit_edge
- br i1 false, label %bb442.preheader.loopexit, label %bb413.bb391_crit_edge
-
-bb413.bb391_crit_edge: ; preds = %bb413
- br label %bb391
-
-bb442.preheader.loopexit: ; preds = %bb413
- br label %bb442.preheader
-
-bb442.preheader: ; preds = %bb442.preheader.loopexit, %bb390.bb442.preheader_crit_edge
- br label %bb442.outer
-
-bb420: ; preds = %bb442
- br i1 false, label %bb439.loopexit, label %cond_next433
-
-cond_next433: ; preds = %bb420
- br i1 false, label %cond_next433.HRead.exit.loopexit_crit_edge, label %cond_next.i
-
-cond_next433.HRead.exit.loopexit_crit_edge: ; preds = %cond_next433
- br label %HRead.exit.loopexit
-
-cond_next.i: ; preds = %cond_next433
- br i1 false, label %cond_true9.i, label %cond_false223.i
-
-cond_true9.i: ; preds = %cond_next.i
- switch i32 0, label %cond_false.i [
- i32 1, label %cond_true9.i.cond_true15.i_crit_edge
- i32 5, label %cond_true9.i.cond_true15.i_crit_edge9
- ]
-
-cond_true9.i.cond_true15.i_crit_edge9: ; preds = %cond_true9.i
- br label %cond_true15.i
-
-cond_true9.i.cond_true15.i_crit_edge: ; preds = %cond_true9.i
- br label %cond_true15.i
-
-cond_true15.i: ; preds = %cond_true9.i.cond_true15.i_crit_edge, %cond_true9.i.cond_true15.i_crit_edge9
- br i1 false, label %cond_true15.i.cond_true44.i_crit_edge, label %cond_true15.i.cond_false49.i_crit_edge
-
-cond_true15.i.cond_false49.i_crit_edge: ; preds = %cond_true15.i
- br label %cond_false49.i
-
-cond_true15.i.cond_true44.i_crit_edge: ; preds = %cond_true15.i
- br label %cond_true44.i
-
-cond_false.i: ; preds = %cond_true9.i
- br i1 false, label %cond_false.i.cond_next39.i_crit_edge, label %cond_true30.i
-
-cond_false.i.cond_next39.i_crit_edge: ; preds = %cond_false.i
- br label %cond_next39.i
-
-cond_true30.i: ; preds = %cond_false.i
- br label %cond_next39.i
-
-cond_next39.i: ; preds = %cond_true30.i, %cond_false.i.cond_next39.i_crit_edge
- br i1 false, label %cond_next39.i.cond_true44.i_crit_edge, label %cond_next39.i.cond_false49.i_crit_edge
-
-cond_next39.i.cond_false49.i_crit_edge: ; preds = %cond_next39.i
- br label %cond_false49.i
-
-cond_next39.i.cond_true44.i_crit_edge: ; preds = %cond_next39.i
- br label %cond_true44.i
-
-cond_true44.i: ; preds = %cond_next39.i.cond_true44.i_crit_edge, %cond_true15.i.cond_true44.i_crit_edge
- br i1 false, label %cond_true44.i.cond_next70.i_crit_edge, label %cond_true44.i.cond_true61.i_crit_edge
-
-cond_true44.i.cond_true61.i_crit_edge: ; preds = %cond_true44.i
- br label %cond_true61.i
-
-cond_true44.i.cond_next70.i_crit_edge: ; preds = %cond_true44.i
- br label %cond_next70.i
-
-cond_false49.i: ; preds = %cond_next39.i.cond_false49.i_crit_edge, %cond_true15.i.cond_false49.i_crit_edge
- br i1 false, label %cond_false49.i.cond_next70.i_crit_edge, label %cond_false49.i.cond_true61.i_crit_edge
-
-cond_false49.i.cond_true61.i_crit_edge: ; preds = %cond_false49.i
- br label %cond_true61.i
-
-cond_false49.i.cond_next70.i_crit_edge: ; preds = %cond_false49.i
- br label %cond_next70.i
-
-cond_true61.i: ; preds = %cond_false49.i.cond_true61.i_crit_edge, %cond_true44.i.cond_true61.i_crit_edge
- br i1 false, label %cond_true61.i.cond_next70.i_crit_edge, label %cond_true67.i
-
-cond_true61.i.cond_next70.i_crit_edge: ; preds = %cond_true61.i
- br label %cond_next70.i
-
-cond_true67.i: ; preds = %cond_true61.i
- br label %cond_next70.i
-
-cond_next70.i: ; preds = %cond_true67.i, %cond_true61.i.cond_next70.i_crit_edge, %cond_false49.i.cond_next70.i_crit_edge, %cond_true44.i.cond_next70.i_crit_edge
- br i1 false, label %cond_true77.i, label %cond_next81.i
-
-cond_true77.i: ; preds = %cond_next70.i
- br label %bb442.outer.backedge
-
-cond_next81.i: ; preds = %cond_next70.i
- br i1 false, label %cond_true87.i, label %cond_false94.i
-
-cond_true87.i: ; preds = %cond_next81.i
- br i1 false, label %cond_true87.i.cond_true130.i_crit_edge, label %cond_true87.i.cond_next135.i_crit_edge
-
-cond_true87.i.cond_next135.i_crit_edge: ; preds = %cond_true87.i
- br label %cond_next135.i
-
-cond_true87.i.cond_true130.i_crit_edge: ; preds = %cond_true87.i
- br label %cond_true130.i
-
-cond_false94.i: ; preds = %cond_next81.i
- switch i32 0, label %cond_false94.i.cond_next125.i_crit_edge [
- i32 1, label %cond_false94.i.cond_true100.i_crit_edge
- i32 5, label %cond_false94.i.cond_true100.i_crit_edge10
- ]
-
-cond_false94.i.cond_true100.i_crit_edge10: ; preds = %cond_false94.i
- br label %cond_true100.i
-
-cond_false94.i.cond_true100.i_crit_edge: ; preds = %cond_false94.i
- br label %cond_true100.i
-
-cond_false94.i.cond_next125.i_crit_edge: ; preds = %cond_false94.i
- br label %cond_next125.i
-
-cond_true100.i: ; preds = %cond_false94.i.cond_true100.i_crit_edge, %cond_false94.i.cond_true100.i_crit_edge10
- br i1 false, label %cond_true107.i, label %cond_true100.i.cond_next109.i_crit_edge
-
-cond_true100.i.cond_next109.i_crit_edge: ; preds = %cond_true100.i
- br label %cond_next109.i
-
-cond_true107.i: ; preds = %cond_true100.i
- br label %cond_next109.i
-
-cond_next109.i: ; preds = %cond_true107.i, %cond_true100.i.cond_next109.i_crit_edge
- br i1 false, label %cond_next109.i.cond_next125.i_crit_edge, label %cond_true116.i
-
-cond_next109.i.cond_next125.i_crit_edge: ; preds = %cond_next109.i
- br label %cond_next125.i
-
-cond_true116.i: ; preds = %cond_next109.i
- br label %cond_next125.i
-
-cond_next125.i: ; preds = %cond_true116.i, %cond_next109.i.cond_next125.i_crit_edge, %cond_false94.i.cond_next125.i_crit_edge
- br i1 false, label %cond_next125.i.cond_true130.i_crit_edge, label %cond_next125.i.cond_next135.i_crit_edge
-
-cond_next125.i.cond_next135.i_crit_edge: ; preds = %cond_next125.i
- br label %cond_next135.i
-
-cond_next125.i.cond_true130.i_crit_edge: ; preds = %cond_next125.i
- br label %cond_true130.i
-
-cond_true130.i: ; preds = %cond_next125.i.cond_true130.i_crit_edge, %cond_true87.i.cond_true130.i_crit_edge
- br label %cond_next135.i
-
-cond_next135.i: ; preds = %cond_true130.i, %cond_next125.i.cond_next135.i_crit_edge, %cond_true87.i.cond_next135.i_crit_edge
- br i1 false, label %cond_true142.i, label %cond_next135.i.cond_next149.i_crit_edge
-
-cond_next135.i.cond_next149.i_crit_edge: ; preds = %cond_next135.i
- br label %cond_next149.i
-
-cond_true142.i: ; preds = %cond_next135.i
- br label %cond_next149.i
-
-cond_next149.i: ; preds = %cond_true142.i, %cond_next135.i.cond_next149.i_crit_edge
- br i1 false, label %cond_true156.i, label %cond_next149.i.cond_next163.i_crit_edge
-
-cond_next149.i.cond_next163.i_crit_edge: ; preds = %cond_next149.i
- br label %cond_next163.i
-
-cond_true156.i: ; preds = %cond_next149.i
- br label %cond_next163.i
-
-cond_next163.i: ; preds = %cond_true156.i, %cond_next149.i.cond_next163.i_crit_edge
- br i1 false, label %cond_true182.i, label %cond_next163.i.cond_next380.i_crit_edge
-
-cond_next163.i.cond_next380.i_crit_edge: ; preds = %cond_next163.i
- br label %cond_next380.i
-
-cond_true182.i: ; preds = %cond_next163.i
- br i1 false, label %cond_true182.i.cond_next380.i_crit_edge, label %cond_true196.i
-
-cond_true182.i.cond_next380.i_crit_edge: ; preds = %cond_true182.i
- br label %cond_next380.i
-
-cond_true196.i: ; preds = %cond_true182.i
- br i1 false, label %cond_true210.i, label %cond_true196.i.cond_next380.i_crit_edge
-
-cond_true196.i.cond_next380.i_crit_edge: ; preds = %cond_true196.i
- br label %cond_next380.i
-
-cond_true210.i: ; preds = %cond_true196.i
- br i1 false, label %cond_true216.i, label %cond_true210.i.cond_next380.i_crit_edge
-
-cond_true210.i.cond_next380.i_crit_edge: ; preds = %cond_true210.i
- br label %cond_next380.i
-
-cond_true216.i: ; preds = %cond_true210.i
- br label %cond_next380.i
-
-cond_false223.i: ; preds = %cond_next.i
- br i1 false, label %cond_true229.i, label %cond_false355.i
-
-cond_true229.i: ; preds = %cond_false223.i
- br i1 false, label %cond_true229.i.HRead.exit.loopexit_crit_edge, label %cond_next243.i
-
-cond_true229.i.HRead.exit.loopexit_crit_edge: ; preds = %cond_true229.i
- br label %HRead.exit.loopexit
-
-cond_next243.i: ; preds = %cond_true229.i
- br i1 false, label %cond_true248.i, label %cond_false255.i
-
-cond_true248.i: ; preds = %cond_next243.i
- br label %cond_next260.i
-
-cond_false255.i: ; preds = %cond_next243.i
- br label %cond_next260.i
-
-cond_next260.i: ; preds = %cond_false255.i, %cond_true248.i
- br i1 false, label %cond_true267.i, label %cond_next273.i
-
-cond_true267.i: ; preds = %cond_next260.i
- br label %bb442.backedge
-
-bb442.backedge: ; preds = %bb.i, %cond_true267.i
- br label %bb442
-
-cond_next273.i: ; preds = %cond_next260.i
- br i1 false, label %cond_true281.i, label %cond_next273.i.cond_next288.i_crit_edge
-
-cond_next273.i.cond_next288.i_crit_edge: ; preds = %cond_next273.i
- br label %cond_next288.i
-
-cond_true281.i: ; preds = %cond_next273.i
- br label %cond_next288.i
-
-cond_next288.i: ; preds = %cond_true281.i, %cond_next273.i.cond_next288.i_crit_edge
- br i1 false, label %cond_true295.i, label %cond_next288.i.cond_next302.i_crit_edge
-
-cond_next288.i.cond_next302.i_crit_edge: ; preds = %cond_next288.i
- br label %cond_next302.i
-
-cond_true295.i: ; preds = %cond_next288.i
- br label %cond_next302.i
-
-cond_next302.i: ; preds = %cond_true295.i, %cond_next288.i.cond_next302.i_crit_edge
- br i1 false, label %cond_next302.i.cond_next380.i_crit_edge, label %cond_true328.i
-
-cond_next302.i.cond_next380.i_crit_edge: ; preds = %cond_next302.i
- br label %cond_next380.i
-
-cond_true328.i: ; preds = %cond_next302.i
- br i1 false, label %cond_true343.i, label %cond_true328.i.cond_next380.i_crit_edge
-
-cond_true328.i.cond_next380.i_crit_edge: ; preds = %cond_true328.i
- br label %cond_next380.i
-
-cond_true343.i: ; preds = %cond_true328.i
- br i1 false, label %cond_true349.i, label %cond_true343.i.cond_next380.i_crit_edge
-
-cond_true343.i.cond_next380.i_crit_edge: ; preds = %cond_true343.i
- br label %cond_next380.i
-
-cond_true349.i: ; preds = %cond_true343.i
- br label %cond_next380.i
-
-cond_false355.i: ; preds = %cond_false223.i
- br i1 false, label %cond_false355.i.bb.i_crit_edge, label %cond_next363.i
-
-cond_false355.i.bb.i_crit_edge: ; preds = %cond_false355.i
- br label %bb.i
-
-cond_next363.i: ; preds = %cond_false355.i
- br i1 false, label %bb377.i, label %cond_next363.i.bb.i_crit_edge
-
-cond_next363.i.bb.i_crit_edge: ; preds = %cond_next363.i
- br label %bb.i
-
-bb.i: ; preds = %cond_next363.i.bb.i_crit_edge, %cond_false355.i.bb.i_crit_edge
- br label %bb442.backedge
-
-bb377.i: ; preds = %cond_next363.i
- br label %cond_next380.i
-
-cond_next380.i: ; preds = %bb377.i, %cond_true349.i, %cond_true343.i.cond_next380.i_crit_edge, %cond_true328.i.cond_next380.i_crit_edge, %cond_next302.i.cond_next380.i_crit_edge, %cond_true216.i, %cond_true210.i.cond_next380.i_crit_edge, %cond_true196.i.cond_next380.i_crit_edge, %cond_true182.i.cond_next380.i_crit_edge, %cond_next163.i.cond_next380.i_crit_edge
- br i1 false, label %cond_next380.i.HRead.exit_crit_edge, label %cond_true391.i
-
-cond_next380.i.HRead.exit_crit_edge: ; preds = %cond_next380.i
- br label %HRead.exit
-
-cond_true391.i: ; preds = %cond_next380.i
- br label %bb442.outer.backedge
-
-bb442.outer.backedge: ; preds = %bb439, %cond_true391.i, %cond_true77.i
- br label %bb442.outer
-
-HRead.exit.loopexit: ; preds = %cond_true229.i.HRead.exit.loopexit_crit_edge, %cond_next433.HRead.exit.loopexit_crit_edge
- br label %HRead.exit
-
-HRead.exit: ; preds = %HRead.exit.loopexit, %cond_next380.i.HRead.exit_crit_edge
- br label %bb439
-
-bb439.loopexit: ; preds = %bb420
- br label %bb439
-
-bb439: ; preds = %bb439.loopexit, %HRead.exit
- br label %bb442.outer.backedge
-
-bb442.outer: ; preds = %bb442.outer.backedge, %bb442.preheader
- br label %bb442
-
-bb442: ; preds = %bb442.outer, %bb442.backedge
- br i1 false, label %bb420, label %bb.loopexit
-}
-
-define void @Invalidate() {
-entry:
- br i1 false, label %cond_false, label %cond_true
-
-cond_true: ; preds = %entry
- br i1 false, label %cond_true40, label %cond_true.cond_next_crit_edge
-
-cond_true.cond_next_crit_edge: ; preds = %cond_true
- br label %cond_next
-
-cond_true40: ; preds = %cond_true
- br label %cond_next
-
-cond_next: ; preds = %cond_true40, %cond_true.cond_next_crit_edge
- br i1 false, label %cond_true68, label %cond_next.cond_next73_crit_edge
-
-cond_next.cond_next73_crit_edge: ; preds = %cond_next
- br label %cond_next73
-
-cond_true68: ; preds = %cond_next
- br label %cond_next73
-
-cond_next73: ; preds = %cond_true68, %cond_next.cond_next73_crit_edge
- br i1 false, label %cond_true91, label %cond_next73.cond_next96_crit_edge
-
-cond_next73.cond_next96_crit_edge: ; preds = %cond_next73
- br label %cond_next96
-
-cond_true91: ; preds = %cond_next73
- br label %cond_next96
-
-cond_next96: ; preds = %cond_true91, %cond_next73.cond_next96_crit_edge
- br i1 false, label %cond_next96.cond_next112_crit_edge, label %cond_true105
-
-cond_next96.cond_next112_crit_edge: ; preds = %cond_next96
- br label %cond_next112
-
-cond_true105: ; preds = %cond_next96
- br label %cond_next112
-
-cond_next112: ; preds = %cond_true105, %cond_next96.cond_next112_crit_edge
- br i1 false, label %cond_next112.cond_next127_crit_edge, label %cond_true119
-
-cond_next112.cond_next127_crit_edge: ; preds = %cond_next112
- br label %cond_next127
-
-cond_true119: ; preds = %cond_next112
- br label %cond_next127
-
-cond_next127: ; preds = %cond_true119, %cond_next112.cond_next127_crit_edge
- br i1 false, label %cond_next141, label %cond_true134
-
-cond_true134: ; preds = %cond_next127
- br i1 false, label %cond_true134.bb161_crit_edge, label %cond_true134.bb_crit_edge
-
-cond_true134.bb_crit_edge: ; preds = %cond_true134
- br label %bb
-
-cond_true134.bb161_crit_edge: ; preds = %cond_true134
- br label %bb161
-
-cond_next141: ; preds = %cond_next127
- br label %bb154
-
-bb: ; preds = %bb154.bb_crit_edge, %cond_true134.bb_crit_edge
- br label %bb154
-
-bb154: ; preds = %bb, %cond_next141
- br i1 false, label %bb154.bb161_crit_edge, label %bb154.bb_crit_edge
-
-bb154.bb_crit_edge: ; preds = %bb154
- br label %bb
-
-bb154.bb161_crit_edge: ; preds = %bb154
- br label %bb161
-
-bb161: ; preds = %bb154.bb161_crit_edge, %cond_true134.bb161_crit_edge
- br i1 false, label %bb161.cond_next201_crit_edge, label %cond_true198
-
-bb161.cond_next201_crit_edge: ; preds = %bb161
- br label %cond_next201
-
-cond_true198: ; preds = %bb161
- br label %cond_next201
-
-cond_next201: ; preds = %cond_true198, %bb161.cond_next201_crit_edge
- br i1 false, label %cond_next212, label %cond_true206
-
-cond_true206: ; preds = %cond_next201
- br label %UnifiedReturnBlock
-
-cond_false: ; preds = %entry
- br label %UnifiedReturnBlock
-
-cond_next212: ; preds = %cond_next201
- br label %UnifiedReturnBlock
-
-UnifiedReturnBlock: ; preds = %cond_next212, %cond_false, %cond_true206
- ret void
-}
diff --git a/release_23/test/Analysis/Dominators/2007-04-20-PostDom-Reset.ll b/release_23/test/Analysis/Dominators/2007-04-20-PostDom-Reset.ll
deleted file mode 100644
index 4deec98a9ee8..000000000000
--- a/release_23/test/Analysis/Dominators/2007-04-20-PostDom-Reset.ll
+++ /dev/null
@@ -1,28 +0,0 @@
-; RUN: llvm-as < %s | opt -postdomfrontier -disable-output
-
-define void @args_out_of_range() {
-entry:
- br label %bb
-
-bb: ; preds = %bb, %entry
- br label %bb
-}
-
-define void @args_out_of_range_3() {
-entry:
- br label %bb
-
-bb: ; preds = %bb, %entry
- br label %bb
-}
-
-define void @Feq() {
-entry:
- br i1 false, label %cond_true, label %cond_next
-
-cond_true: ; preds = %entry
- unreachable
-
-cond_next: ; preds = %entry
- unreachable
-}
diff --git a/release_23/test/Analysis/Dominators/2007-07-11-SplitBlock.ll b/release_23/test/Analysis/Dominators/2007-07-11-SplitBlock.ll
deleted file mode 100644
index 3dc6eda6de1d..000000000000
--- a/release_23/test/Analysis/Dominators/2007-07-11-SplitBlock.ll
+++ /dev/null
@@ -1,21 +0,0 @@
-; RUN: llvm-as < %s | opt -loop-rotate -loop-unswitch -disable-output
-
-define i32 @stringSearch_Clib(i32 %count) {
-entry:
- br i1 false, label %bb36, label %bb44
-
-cond_true20: ; preds = %bb36
- %tmp33 = add i32 0, 0 ; <i32> [#uses=1]
- br label %bb36
-
-bb36: ; preds = %cond_true20, %entry
- %c.2 = phi i32 [ %tmp33, %cond_true20 ], [ 0, %entry ] ; <i32> [#uses=1]
- br i1 false, label %cond_true20, label %bb41
-
-bb41: ; preds = %bb36
- %c.2.lcssa = phi i32 [ %c.2, %bb36 ] ; <i32> [#uses=0]
- ret i32 0
-
-bb44: ; preds = %entry
- ret i32 0
-}
diff --git a/release_23/test/Analysis/Dominators/2007-07-12-SplitBlock.ll b/release_23/test/Analysis/Dominators/2007-07-12-SplitBlock.ll
deleted file mode 100644
index 1748daf4f393..000000000000
--- a/release_23/test/Analysis/Dominators/2007-07-12-SplitBlock.ll
+++ /dev/null
@@ -1,13 +0,0 @@
-; RUN: llvm-as < %s | opt -loop-rotate -licm -loop-unswitch -disable-output
-
-define i32 @main(i32 %argc, i8** %argv) {
-entry:
- br label %bb7
-
-bb7: ; preds = %bb7, %entry
- %tmp54 = icmp slt i32 0, 2000000 ; <i1> [#uses=1]
- br i1 %tmp54, label %bb7, label %bb56
-
-bb56: ; preds = %bb7
- ret i32 0
-}
diff --git a/release_23/test/Analysis/Dominators/dg.exp b/release_23/test/Analysis/Dominators/dg.exp
deleted file mode 100644
index 879685ca879d..000000000000
--- a/release_23/test/Analysis/Dominators/dg.exp
+++ /dev/null
@@ -1,3 +0,0 @@
-load_lib llvm.exp
-
-RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
diff --git a/release_23/test/Analysis/GlobalsModRef/aliastest.ll b/release_23/test/Analysis/GlobalsModRef/aliastest.ll
deleted file mode 100644
index 13d0bdb1cd60..000000000000
--- a/release_23/test/Analysis/GlobalsModRef/aliastest.ll
+++ /dev/null
@@ -1,9 +0,0 @@
-; RUN: llvm-as < %s | opt -globalsmodref-aa -load-vn -gcse | llvm-dis | not grep load
-@X = internal global i32 4 ; <i32*> [#uses=1]
-
-define i32 @test(i32* %P) {
- store i32 7, i32* %P
- store i32 12, i32* @X
- %V = load i32* %P ; <i32> [#uses=1]
- ret i32 %V
-}
diff --git a/release_23/test/Analysis/GlobalsModRef/chaining-analysis.ll b/release_23/test/Analysis/GlobalsModRef/chaining-analysis.ll
deleted file mode 100644
index e521cc1350fb..000000000000
--- a/release_23/test/Analysis/GlobalsModRef/chaining-analysis.ll
+++ /dev/null
@@ -1,20 +0,0 @@
-; RUN: llvm-as < %s | opt -globalsmodref-aa -load-vn -gcse | llvm-dis | not grep load
-
-; This test requires the use of previous analyses to determine that
-; doesnotmodX does not modify X (because 'sin' doesn't).
-
-@X = internal global i32 4 ; <i32*> [#uses=2]
-
-declare double @sin(double) readnone
-
-define i32 @test(i32* %P) {
- store i32 12, i32* @X
- call double @doesnotmodX( double 1.000000e+00 ) ; <double>:1 [#uses=0]
- %V = load i32* @X ; <i32> [#uses=1]
- ret i32 %V
-}
-
-define double @doesnotmodX(double %V) {
- %V2 = call double @sin( double %V ) readnone ; <double> [#uses=1]
- ret double %V2
-}
diff --git a/release_23/test/Analysis/GlobalsModRef/dg.exp b/release_23/test/Analysis/GlobalsModRef/dg.exp
deleted file mode 100644
index 879685ca879d..000000000000
--- a/release_23/test/Analysis/GlobalsModRef/dg.exp
+++ /dev/null
@@ -1,3 +0,0 @@
-load_lib llvm.exp
-
-RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
diff --git a/release_23/test/Analysis/GlobalsModRef/indirect-global.ll b/release_23/test/Analysis/GlobalsModRef/indirect-global.ll
deleted file mode 100644
index 3f73782d0e75..000000000000
--- a/release_23/test/Analysis/GlobalsModRef/indirect-global.ll
+++ /dev/null
@@ -1,20 +0,0 @@
-; RUN: llvm-as < %s | opt -globalsmodref-aa -load-vn -gcse -instcombine | llvm-dis | \
-; RUN: grep {ret i32 0}
-
-@G = internal global i32* null ; <i32**> [#uses=3]
-
-define void @test() {
- %A = malloc i32 ; <i32*> [#uses=1]
- store i32* %A, i32** @G
- ret void
-}
-
-define i32 @test1(i32* %P) {
- %g1 = load i32** @G ; <i32*> [#uses=2]
- %h1 = load i32* %g1 ; <i32> [#uses=1]
- store i32 123, i32* %P
- %g2 = load i32** @G ; <i32*> [#uses=0]
- %h2 = load i32* %g1 ; <i32> [#uses=1]
- %X = sub i32 %h1, %h2 ; <i32> [#uses=1]
- ret i32 %X
-}
diff --git a/release_23/test/Analysis/GlobalsModRef/modreftest.ll b/release_23/test/Analysis/GlobalsModRef/modreftest.ll
deleted file mode 100644
index 9783664a34ac..000000000000
--- a/release_23/test/Analysis/GlobalsModRef/modreftest.ll
+++ /dev/null
@@ -1,13 +0,0 @@
-; RUN: llvm-as < %s | opt -globalsmodref-aa -load-vn -gcse | llvm-dis | not grep load
-@X = internal global i32 4 ; <i32*> [#uses=2]
-
-define i32 @test(i32* %P) {
- store i32 12, i32* @X
- call void @doesnotmodX( )
- %V = load i32* @X ; <i32> [#uses=1]
- ret i32 %V
-}
-
-define void @doesnotmodX() {
- ret void
-}
diff --git a/release_23/test/Analysis/GlobalsModRef/purecse.ll b/release_23/test/Analysis/GlobalsModRef/purecse.ll
deleted file mode 100644
index 1977f4750e91..000000000000
--- a/release_23/test/Analysis/GlobalsModRef/purecse.ll
+++ /dev/null
@@ -1,23 +0,0 @@
-; Test that pure functions are cse'd away
-; RUN: llvm-as < %s | opt -globalsmodref-aa -load-vn -gcse -instcombine | \
-; RUN: llvm-dis | not grep sub
-
-define i32 @pure(i32 %X) {
- %Y = add i32 %X, 1 ; <i32> [#uses=1]
- ret i32 %Y
-}
-
-define i32 @test1(i32 %X) {
- %A = call i32 @pure( i32 %X ) ; <i32> [#uses=1]
- %B = call i32 @pure( i32 %X ) ; <i32> [#uses=1]
- %C = sub i32 %A, %B ; <i32> [#uses=1]
- ret i32 %C
-}
-
-define i32 @test2(i32 %X, i32* %P) {
- %A = call i32 @pure( i32 %X ) ; <i32> [#uses=1]
- store i32 %X, i32* %P ;; Does not invalidate 'pure' call.
- %B = call i32 @pure( i32 %X ) ; <i32> [#uses=1]
- %C = sub i32 %A, %B ; <i32> [#uses=1]
- ret i32 %C
-}
diff --git a/release_23/test/Analysis/LoadVN/RLE-Eliminate.ll b/release_23/test/Analysis/LoadVN/RLE-Eliminate.ll
deleted file mode 100644
index ad9ba5e18e1f..000000000000
--- a/release_23/test/Analysis/LoadVN/RLE-Eliminate.ll
+++ /dev/null
@@ -1,25 +0,0 @@
-; This testcase ensures that redundant loads are eliminated when they should
-; be. All RL variables (redundant loads) should be eliminated.
-;
-; RUN: llvm-as < %s | opt -load-vn -gcse | llvm-dis | not grep %RL
-;
-
-define i32 @test1(i32* %P) {
- %A = load i32* %P ; <i32> [#uses=1]
- %RL = load i32* %P ; <i32> [#uses=1]
- %C = add i32 %A, %RL ; <i32> [#uses=1]
- ret i32 %C
-}
-
-define i32 @test2(i32* %P) {
- %A = load i32* %P ; <i32> [#uses=1]
- br label %BB2
-
-BB2: ; preds = %0
- br label %BB3
-
-BB3: ; preds = %BB2
- %RL = load i32* %P ; <i32> [#uses=1]
- %B = add i32 %A, %RL ; <i32> [#uses=1]
- ret i32 %B
-}
diff --git a/release_23/test/Analysis/LoadVN/RLE-Preserve-Volatile.ll b/release_23/test/Analysis/LoadVN/RLE-Preserve-Volatile.ll
deleted file mode 100644
index 52968ea2c476..000000000000
--- a/release_23/test/Analysis/LoadVN/RLE-Preserve-Volatile.ll
+++ /dev/null
@@ -1,8 +0,0 @@
-; RUN: llvm-as < %s | opt -load-vn -gcse -instcombine | llvm-dis | grep sub
-
-define i32 @test(i32* %P) {
- %X = volatile load i32* %P ; <i32> [#uses=1]
- %Y = volatile load i32* %P ; <i32> [#uses=1]
- %Z = sub i32 %X, %Y ; <i32> [#uses=1]
- ret i32 %Z
-}
diff --git a/release_23/test/Analysis/LoadVN/RLE-Preserve.ll b/release_23/test/Analysis/LoadVN/RLE-Preserve.ll
deleted file mode 100644
index f2c079488e96..000000000000
--- a/release_23/test/Analysis/LoadVN/RLE-Preserve.ll
+++ /dev/null
@@ -1,26 +0,0 @@
-; This testcase ensures that redundant loads are preserved when they are not
-; allowed to be eliminated.
-; RUN: llvm-as < %s | opt -load-vn -gcse | llvm-dis | grep sub
-;
-
-define i32 @test1(i32* %P) {
- %A = load i32* %P ; <i32> [#uses=1]
- store i32 1, i32* %P
- %B = load i32* %P ; <i32> [#uses=1]
- %C = sub i32 %A, %B ; <i32> [#uses=1]
- ret i32 %C
-}
-
-define i32 @test2(i32* %P) {
- %A = load i32* %P ; <i32> [#uses=1]
- br label %BB2
-
-BB2: ; preds = %0
- store i32 5, i32* %P
- br label %BB3
-
-BB3: ; preds = %BB2
- %B = load i32* %P ; <i32> [#uses=1]
- %C = sub i32 %A, %B ; <i32> [#uses=1]
- ret i32 %C
-}
diff --git a/release_23/test/Analysis/LoadVN/call_cse.ll b/release_23/test/Analysis/LoadVN/call_cse.ll
deleted file mode 100644
index b62300f5ab33..000000000000
--- a/release_23/test/Analysis/LoadVN/call_cse.ll
+++ /dev/null
@@ -1,12 +0,0 @@
-; RUN: llvm-as < %s | opt -basicaa -load-vn -gcse -instcombine | llvm-dis | not grep sub
-
-declare i32 @strlen(i8*) readonly
-
-define i32 @test(i8* %P) {
- %X = call i32 @strlen( i8* %P ) readonly ; <i32> [#uses=2]
- %A = add i32 %X, 14 ; <i32> [#uses=1]
- %Y = call i32 @strlen( i8* %P ) readonly ; <i32> [#uses=1]
- %Z = sub i32 %X, %Y ; <i32> [#uses=1]
- %B = add i32 %A, %Z ; <i32> [#uses=1]
- ret i32 %B
-}
diff --git a/release_23/test/Analysis/LoadVN/call_pure_function.ll b/release_23/test/Analysis/LoadVN/call_pure_function.ll
deleted file mode 100644
index 8055c5271f4a..000000000000
--- a/release_23/test/Analysis/LoadVN/call_pure_function.ll
+++ /dev/null
@@ -1,14 +0,0 @@
-; RUN: llvm-as < %s | opt -basicaa -load-vn -gcse -instcombine | llvm-dis | not grep sub
-
-declare i32 @strlen(i8*) readonly
-
-declare void @use(i32)
-
-define i8 @test(i8* %P, i8* %Q) {
- %A = load i8* %Q ; <i8> [#uses=1]
- %X = call i32 @strlen( i8* %P ) readonly ; <i32> [#uses=1]
- %B = load i8* %Q ; <i8> [#uses=1]
- call void @use( i32 %X )
- %C = sub i8 %A, %B ; <i8> [#uses=1]
- ret i8 %C
-}
diff --git a/release_23/test/Analysis/LoadVN/casts.ll b/release_23/test/Analysis/LoadVN/casts.ll
deleted file mode 100644
index 70e3fe56805c..000000000000
--- a/release_23/test/Analysis/LoadVN/casts.ll
+++ /dev/null
@@ -1,13 +0,0 @@
-; Check to make sure that Value Numbering doesn't merge casts of different
-; flavors.
-; RUN: llvm-as < %s | opt -load-vn -gcse | llvm-dis | \
-; RUN: grep {\[sz\]ext} | count 2
-
-declare void @external(i32)
-
-define i32 @test_casts(i16 %x) {
- %a = sext i16 %x to i32 ; <i32> [#uses=1]
- %b = zext i16 %x to i32 ; <i32> [#uses=1]
- call void @external( i32 %a )
- ret i32 %b
-}
diff --git a/release_23/test/Analysis/LoadVN/dependent_loads.ll b/release_23/test/Analysis/LoadVN/dependent_loads.ll
deleted file mode 100644
index 1338a495b5f8..000000000000
--- a/release_23/test/Analysis/LoadVN/dependent_loads.ll
+++ /dev/null
@@ -1,25 +0,0 @@
-; RUN: llvm-as < %s | opt -basicaa -load-vn -gcse -instcombine | \
-; RUN: llvm-dis | not grep sub
-
-%S = type { i32, i8 }
-
-define i8 @test(i8** %P) {
- %A = load i8** %P ; <i8*> [#uses=1]
- %B = load i8* %A ; <i8> [#uses=1]
- %X = load i8** %P ; <i8*> [#uses=1]
- %Y = load i8* %X ; <i8> [#uses=1]
- %R = sub i8 %B, %Y ; <i8> [#uses=1]
- ret i8 %R
-}
-
-define i8 @test1(%S** %P) {
- %A = load %S** %P ; <%S*> [#uses=1]
- %B = getelementptr %S* %A, i32 0, i32 1 ; <i8*> [#uses=1]
- %C = load i8* %B ; <i8> [#uses=1]
- %X = load %S** %P ; <%S*> [#uses=1]
- %Y = getelementptr %S* %X, i32 0, i32 1 ; <i8*> [#uses=1]
- %Z = load i8* %Y ; <i8> [#uses=1]
- %R = sub i8 %C, %Z ; <i8> [#uses=1]
- ret i8 %R
-}
-
diff --git a/release_23/test/Analysis/LoadVN/dg.exp b/release_23/test/Analysis/LoadVN/dg.exp
deleted file mode 100644
index 879685ca879d..000000000000
--- a/release_23/test/Analysis/LoadVN/dg.exp
+++ /dev/null
@@ -1,3 +0,0 @@
-load_lib llvm.exp
-
-RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
diff --git a/release_23/test/Analysis/LoadVN/undefined_load.ll b/release_23/test/Analysis/LoadVN/undefined_load.ll
deleted file mode 100644
index ba6049ee3104..000000000000
--- a/release_23/test/Analysis/LoadVN/undefined_load.ll
+++ /dev/null
@@ -1,14 +0,0 @@
-; RUN: llvm-as < %s | opt -load-vn -gcse | llvm-dis | not grep load
-; Test that loads of undefined memory are eliminated.
-
-define i32 @test1() {
- %X = malloc i32 ; <i32*> [#uses=1]
- %Y = load i32* %X ; <i32> [#uses=1]
- ret i32 %Y
-}
-
-define i32 @test2() {
- %X = alloca i32 ; <i32*> [#uses=1]
- %Y = load i32* %X ; <i32> [#uses=1]
- ret i32 %Y
-}
diff --git a/release_23/test/Analysis/LoopInfo/2003-05-15-NestingProblem.ll b/release_23/test/Analysis/LoopInfo/2003-05-15-NestingProblem.ll
deleted file mode 100644
index a3da5232bb88..000000000000
--- a/release_23/test/Analysis/LoopInfo/2003-05-15-NestingProblem.ll
+++ /dev/null
@@ -1,30 +0,0 @@
-; This testcase was incorrectly computing that the loopentry.7 loop was
-; not a child of the loopentry.6 loop.
-;
-; RUN: llvm-as < %s | opt -analyze -loops | \
-; RUN: grep {^ Loop Containing: %loopentry.7}
-
-define void @getAndMoveToFrontDecode() {
- br label %endif.2
-
-endif.2: ; preds = %loopexit.5, %0
- br i1 false, label %loopentry.5, label %UnifiedExitNode
-
-loopentry.5: ; preds = %loopexit.6, %endif.2
- br i1 false, label %loopentry.6, label %UnifiedExitNode
-
-loopentry.6: ; preds = %loopentry.7, %loopentry.5
- br i1 false, label %loopentry.7, label %loopexit.6
-
-loopentry.7: ; preds = %loopentry.7, %loopentry.6
- br i1 false, label %loopentry.7, label %loopentry.6
-
-loopexit.6: ; preds = %loopentry.6
- br i1 false, label %loopentry.5, label %loopexit.5
-
-loopexit.5: ; preds = %loopexit.6
- br i1 false, label %endif.2, label %UnifiedExitNode
-
-UnifiedExitNode: ; preds = %loopexit.5, %loopentry.5, %endif.2
- ret void
-}
diff --git a/release_23/test/Analysis/LoopInfo/dg.exp b/release_23/test/Analysis/LoopInfo/dg.exp
deleted file mode 100644
index 879685ca879d..000000000000
--- a/release_23/test/Analysis/LoopInfo/dg.exp
+++ /dev/null
@@ -1,3 +0,0 @@
-load_lib llvm.exp
-
-RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
diff --git a/release_23/test/Analysis/PostDominators/dg.exp b/release_23/test/Analysis/PostDominators/dg.exp
deleted file mode 100644
index 879685ca879d..000000000000
--- a/release_23/test/Analysis/PostDominators/dg.exp
+++ /dev/null
@@ -1,3 +0,0 @@
-load_lib llvm.exp
-
-RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
diff --git a/release_23/test/Analysis/PostDominators/pr1098.ll b/release_23/test/Analysis/PostDominators/pr1098.ll
deleted file mode 100644
index b54a9fe1c75b..000000000000
--- a/release_23/test/Analysis/PostDominators/pr1098.ll
+++ /dev/null
@@ -1,14 +0,0 @@
-; RUN: llvm-as < %s | opt -postdomtree -analyze | grep entry
-; PR932
-
-define void @foo(i1 %x) {
-entry:
- br i1 %x, label %bb1, label %bb0
-bb0: ; preds = %entry, bb0
- br label %bb0
-bb1: ; preds = %entry
- br label %bb2
-bb2: ; preds = %bb1
- ret void
-}
-
diff --git a/release_23/test/Analysis/ScalarEvolution/2007-07-15-NegativeStride.ll b/release_23/test/Analysis/ScalarEvolution/2007-07-15-NegativeStride.ll
deleted file mode 100644
index fca974f7c238..000000000000
--- a/release_23/test/Analysis/ScalarEvolution/2007-07-15-NegativeStride.ll
+++ /dev/null
@@ -1,20 +0,0 @@
-; RUN: llvm-as < %s | opt -analyze -scalar-evolution | grep {Loop bb: 100 iterations}
-; PR1533
-
-@array = weak global [101 x i32] zeroinitializer, align 32 ; <[100 x i32]*> [#uses=1]
-
-define void @loop(i32 %x) {
-entry:
- br label %bb
-
-bb: ; preds = %bb, %entry
- %i.01.0 = phi i32 [ 100, %entry ], [ %tmp4, %bb ] ; <i32> [#uses=2]
- %tmp1 = getelementptr [101 x i32]* @array, i32 0, i32 %i.01.0 ; <i32*> [#uses=1]
- store i32 %x, i32* %tmp1
- %tmp4 = add i32 %i.01.0, -1 ; <i32> [#uses=2]
- %tmp7 = icmp sgt i32 %tmp4, -1 ; <i1> [#uses=1]
- br i1 %tmp7, label %bb, label %return
-
-return: ; preds = %bb
- ret void
-}
diff --git a/release_23/test/Analysis/ScalarEvolution/2007-08-06-MisinterpretBranch.ll b/release_23/test/Analysis/ScalarEvolution/2007-08-06-MisinterpretBranch.ll
deleted file mode 100644
index e3393d5eed62..000000000000
--- a/release_23/test/Analysis/ScalarEvolution/2007-08-06-MisinterpretBranch.ll
+++ /dev/null
@@ -1,18 +0,0 @@
-; RUN: llvm-as < %s | opt -indvars -adce -simplifycfg | llvm-dis | grep "icmp s"
-; PR1598
-
-define i32 @f(i32 %a, i32 %b, i32 %x, i32 %y) {
-entry:
- %tmp3 = icmp eq i32 %a, %b ; <i1> [#uses=1]
- br i1 %tmp3, label %return, label %bb
-
-bb: ; preds = %bb, %entry
- %x_addr.0 = phi i32 [ %tmp6, %bb ], [ %x, %entry ] ; <i32> [#uses=1]
- %tmp6 = add i32 %x_addr.0, 1 ; <i32> [#uses=3]
- %tmp9 = icmp slt i32 %tmp6, %y ; <i1> [#uses=1]
- br i1 %tmp9, label %bb, label %return
-
-return: ; preds = %bb, %entry
- %x_addr.1 = phi i32 [ %x, %entry ], [ %tmp6, %bb ] ; <i32> [#uses=1]
- ret i32 %x_addr.1
-}
diff --git a/release_23/test/Analysis/ScalarEvolution/2007-08-06-Unsigned.ll b/release_23/test/Analysis/ScalarEvolution/2007-08-06-Unsigned.ll
deleted file mode 100644
index 23ffc650b0d5..000000000000
--- a/release_23/test/Analysis/ScalarEvolution/2007-08-06-Unsigned.ll
+++ /dev/null
@@ -1,30 +0,0 @@
-; RUN: llvm-as < %s | opt -scalar-evolution -analyze | grep {Loop bb: ( -1 + ( -1 \\* %x) + (( 1 + %x) umax %y)) iterations!}
-; PR1597
-
-define i32 @f(i32 %x, i32 %y) {
-entry:
- %tmp63 = icmp ult i32 %x, %y ; <i1> [#uses=1]
- br i1 %tmp63, label %bb.preheader, label %bb8
-
-bb.preheader: ; preds = %entry
- br label %bb
-
-bb: ; preds = %bb3, %bb.preheader
- %x_addr.0 = phi i32 [ %tmp2, %bb3 ], [ %x, %bb.preheader ] ; <i32> [#uses=1]
- %tmp2 = add i32 %x_addr.0, 1 ; <i32> [#uses=3]
- br label %bb3
-
-bb3: ; preds = %bb
- %tmp6 = icmp ult i32 %tmp2, %y ; <i1> [#uses=1]
- br i1 %tmp6, label %bb, label %bb8.loopexit
-
-bb8.loopexit: ; preds = %bb3
- br label %bb8
-
-bb8: ; preds = %bb8.loopexit, %entry
- %x_addr.1 = phi i32 [ %x, %entry ], [ %tmp2, %bb8.loopexit ] ; <i32> [#uses=1]
- br label %return
-
-return: ; preds = %bb8
- ret i32 %x_addr.1
-}
diff --git a/release_23/test/Analysis/ScalarEvolution/2007-09-27-LargeStepping.ll b/release_23/test/Analysis/ScalarEvolution/2007-09-27-LargeStepping.ll
deleted file mode 100644
index 9f9b6699a968..000000000000
--- a/release_23/test/Analysis/ScalarEvolution/2007-09-27-LargeStepping.ll
+++ /dev/null
@@ -1,21 +0,0 @@
-; RUN: llvm-as < %s | opt -analyze -scalar-evolution | grep {13 iterations}
-; PR1706
-
-define i32 @f() {
-entry:
- br label %bb5
-
-bb: ; preds = %bb5
- %tmp2 = shl i32 %j.0, 1 ; <i32> [#uses=1]
- %tmp4 = add i32 %i.0, 268435456 ; <i32> [#uses=1]
- br label %bb5
-
-bb5: ; preds = %bb, %entry
- %j.0 = phi i32 [ 1, %entry ], [ %tmp2, %bb ] ; <i32> [#uses=2]
- %i.0 = phi i32 [ -1879048192, %entry ], [ %tmp4, %bb ] ; <i32> [#uses=2]
- %tmp7 = icmp slt i32 %i.0, 1610612736 ; <i1> [#uses=1]
- br i1 %tmp7, label %bb, label %return
-
-return: ; preds = %bb5
- ret i32 %j.0
-}
diff --git a/release_23/test/Analysis/ScalarEvolution/2007-11-14-SignedAddRec.ll b/release_23/test/Analysis/ScalarEvolution/2007-11-14-SignedAddRec.ll
deleted file mode 100644
index 66ca7551c240..000000000000
--- a/release_23/test/Analysis/ScalarEvolution/2007-11-14-SignedAddRec.ll
+++ /dev/null
@@ -1,24 +0,0 @@
-; RUN: llvm-as < %s | opt -indvars | llvm-dis | grep printd | grep 1206807378
-; PR1798
-
-declare void @printd(i32)
-
-define i32 @test() {
-entry:
- br label %bb6
-
-bb: ; preds = %bb6
- %tmp3 = add i32 %x.0, %i.0 ; <i32> [#uses=1]
- %tmp5 = add i32 %i.0, 1 ; <i32> [#uses=1]
- br label %bb6
-
-bb6: ; preds = %bb, %entry
- %i.0 = phi i32 [ 0, %entry ], [ %tmp5, %bb ] ; <i32> [#uses=3]
- %x.0 = phi i32 [ 0, %entry ], [ %tmp3, %bb ] ; <i32> [#uses=3]
- %tmp8 = icmp slt i32 %i.0, 123456789 ; <i1> [#uses=1]
- br i1 %tmp8, label %bb, label %bb10
-
-bb10: ; preds = %bb6
- call void @printd(i32 %x.0)
- ret i32 0
-}
diff --git a/release_23/test/Analysis/ScalarEvolution/2007-11-18-OrInstruction.ll b/release_23/test/Analysis/ScalarEvolution/2007-11-18-OrInstruction.ll
deleted file mode 100644
index 82d6ee27b457..000000000000
--- a/release_23/test/Analysis/ScalarEvolution/2007-11-18-OrInstruction.ll
+++ /dev/null
@@ -1,18 +0,0 @@
-; RUN: llvm-as < %s | opt -analyze -scalar-evolution | grep -e {--> %b}
-; PR1810
-
-define void @fun() {
-entry:
- br label %header
-header:
- %i = phi i32 [ 1, %entry ], [ %i.next, %body ]
- %cond = icmp eq i32 %i, 10
- br i1 %cond, label %exit, label %body
-body:
- %a = mul i32 %i, 5
- %b = or i32 %a, 1
- %i.next = add i32 %i, 1
- br label %header
-exit:
- ret void
-}
diff --git a/release_23/test/Analysis/ScalarEvolution/2008-02-11-ReversedCondition.ll b/release_23/test/Analysis/ScalarEvolution/2008-02-11-ReversedCondition.ll
deleted file mode 100644
index 3f88b0130f95..000000000000
--- a/release_23/test/Analysis/ScalarEvolution/2008-02-11-ReversedCondition.ll
+++ /dev/null
@@ -1,16 +0,0 @@
-; RUN: llvm-as < %s | opt -scalar-evolution -analyze | grep {Loop header: ( 0 smax %n) iterations!}
-; XFAIL: *
-
-define void @foo(i32 %n) {
-entry:
- br label %header
-header:
- %i = phi i32 [ 0, %entry ], [ %i.inc, %next ]
- %cond = icmp sgt i32 %n, %i
- br i1 %cond, label %next, label %return
-next:
- %i.inc = add i32 %i, 1
- br label %header
-return:
- ret void
-}
diff --git a/release_23/test/Analysis/ScalarEvolution/2008-02-12-SMAXTripCount.ll b/release_23/test/Analysis/ScalarEvolution/2008-02-12-SMAXTripCount.ll
deleted file mode 100644
index 292ea99b6b5d..000000000000
--- a/release_23/test/Analysis/ScalarEvolution/2008-02-12-SMAXTripCount.ll
+++ /dev/null
@@ -1,16 +0,0 @@
-; RUN: llvm-as < %s | opt -scalar-evolution -analyze | grep {Loop loop: ( 100 + ( -100 smax %n)) iterations!}
-; PR2002
-
-define void @foo(i8 %n) {
-entry:
- br label %loop
-loop:
- %i = phi i8 [ -100, %entry ], [ %i.inc, %next ]
- %cond = icmp slt i8 %i, %n
- br i1 %cond, label %next, label %return
-next:
- %i.inc = add i8 %i, 1
- br label %loop
-return:
- ret void
-}
diff --git a/release_23/test/Analysis/ScalarEvolution/2008-02-15-UMax.ll b/release_23/test/Analysis/ScalarEvolution/2008-02-15-UMax.ll
deleted file mode 100644
index 0f977f804eb8..000000000000
--- a/release_23/test/Analysis/ScalarEvolution/2008-02-15-UMax.ll
+++ /dev/null
@@ -1,17 +0,0 @@
-; RUN: llvm-as < %s | opt -analyze -scalar-evolution | grep umax
-; PR2003
-
-define i32 @foo(i32 %n) {
-entry:
- br label %header
-header:
- %i = phi i32 [ 100, %entry ], [ %i.inc, %next ]
- %cond = icmp ult i32 %i, %n
- br i1 %cond, label %next, label %return
-next:
- %i.inc = add i32 %i, 1
- br label %header
-return:
- ret i32 %i
-}
-
diff --git a/release_23/test/Analysis/ScalarEvolution/SolveQuadraticEquation.ll b/release_23/test/Analysis/ScalarEvolution/SolveQuadraticEquation.ll
deleted file mode 100644
index d52f720b4863..000000000000
--- a/release_23/test/Analysis/ScalarEvolution/SolveQuadraticEquation.ll
+++ /dev/null
@@ -1,32 +0,0 @@
-; RUN: llvm-as < %s | opt -analyze -scalar-evolution | \
-; RUN: grep {100 iterations}
-; PR1101
-
-@A = weak global [1000 x i32] zeroinitializer, align 32
-
-
-define void @test(i32 %N) {
-entry:
- "alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
- br label %bb3
-
-bb: ; preds = %bb3
- %tmp = getelementptr [1000 x i32]* @A, i32 0, i32 %i.0 ; <i32*> [#uses=1]
- store i32 123, i32* %tmp
- %tmp2 = add i32 %i.0, 1 ; <i32> [#uses=1]
- br label %bb3
-
-bb3: ; preds = %bb, %entry
- %i.0 = phi i32 [ 2, %entry ], [ %tmp2, %bb ] ; <i32> [#uses=3]
- %SQ = mul i32 %i.0, %i.0
- %tmp4 = mul i32 %i.0, 2
- %tmp5 = sub i32 %SQ, %tmp4
- %tmp3 = icmp sle i32 %tmp5, 9999 ; <i1> [#uses=1]
- br i1 %tmp3, label %bb, label %bb5
-
-bb5: ; preds = %bb3
- br label %return
-
-return: ; preds = %bb5
- ret void
-}
diff --git a/release_23/test/Analysis/ScalarEvolution/dg.exp b/release_23/test/Analysis/ScalarEvolution/dg.exp
deleted file mode 100644
index b65a2503ac6f..000000000000
--- a/release_23/test/Analysis/ScalarEvolution/dg.exp
+++ /dev/null
@@ -1,3 +0,0 @@
-load_lib llvm.exp
-
-RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.ll]]
diff --git a/release_23/test/Analysis/ScalarEvolution/do-loop.ll b/release_23/test/Analysis/ScalarEvolution/do-loop.ll
deleted file mode 100644
index c6b3298638b1..000000000000
--- a/release_23/test/Analysis/ScalarEvolution/do-loop.ll
+++ /dev/null
@@ -1,18 +0,0 @@
-; RUN: llvm-as < %s | opt -analyze -scalar-evolution | grep smax
-; PR1614
-
-define i32 @f(i32 %x, i32 %y) {
-entry:
- br label %bb
-
-bb: ; preds = %bb, %entry
- %indvar = phi i32 [ 0, %entry ], [ %indvar.next, %bb ] ; <i32> [#uses=2]
- %x_addr.0 = add i32 %indvar, %x ; <i32> [#uses=1]
- %tmp2 = add i32 %x_addr.0, 1 ; <i32> [#uses=2]
- %tmp5 = icmp slt i32 %tmp2, %y ; <i1> [#uses=1]
- %indvar.next = add i32 %indvar, 1 ; <i32> [#uses=1]
- br i1 %tmp5, label %bb, label %bb7
-
-bb7: ; preds = %bb
- ret i32 %tmp2
-}
diff --git a/release_23/test/Analysis/ScalarEvolution/smax.ll b/release_23/test/Analysis/ScalarEvolution/smax.ll
deleted file mode 100644
index 157d54f3e63c..000000000000
--- a/release_23/test/Analysis/ScalarEvolution/smax.ll
+++ /dev/null
@@ -1,12 +0,0 @@
-; RUN: llvm-as < %s | opt -analyze -scalar-evolution | grep smax | count 2
-; RUN: llvm-as < %s | opt -analyze -scalar-evolution | grep \
-; RUN: "%. smax %. smax %."
-; PR1614
-
-define i32 @x(i32 %a, i32 %b, i32 %c) {
- %A = icmp sgt i32 %a, %b
- %B = select i1 %A, i32 %a, i32 %b
- %C = icmp sle i32 %c, %B
- %D = select i1 %C, i32 %B, i32 %c
- ret i32 %D
-}
diff --git a/release_23/test/Analysis/ScalarEvolution/trip-count.ll b/release_23/test/Analysis/ScalarEvolution/trip-count.ll
deleted file mode 100644
index c37f4199f3be..000000000000
--- a/release_23/test/Analysis/ScalarEvolution/trip-count.ll
+++ /dev/null
@@ -1,29 +0,0 @@
-; RUN: llvm-as < %s | opt -analyze -scalar-evolution | \
-; RUN: grep {10000 iterations}
-; PR1101
-
-@A = weak global [1000 x i32] zeroinitializer, align 32
-
-
-define void @test(i32 %N) {
-entry:
- "alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
- br label %bb3
-
-bb: ; preds = %bb3
- %tmp = getelementptr [1000 x i32]* @A, i32 0, i32 %i.0 ; <i32*> [#uses=1]
- store i32 123, i32* %tmp
- %tmp2 = add i32 %i.0, 1 ; <i32> [#uses=1]
- br label %bb3
-
-bb3: ; preds = %bb, %entry
- %i.0 = phi i32 [ 0, %entry ], [ %tmp2, %bb ] ; <i32> [#uses=3]
- %tmp3 = icmp sle i32 %i.0, 9999 ; <i1> [#uses=1]
- br i1 %tmp3, label %bb, label %bb5
-
-bb5: ; preds = %bb3
- br label %return
-
-return: ; preds = %bb5
- ret void
-}
diff --git a/release_23/test/Analysis/ScalarEvolution/trip-count2.ll b/release_23/test/Analysis/ScalarEvolution/trip-count2.ll
deleted file mode 100644
index 5ca58a24ce03..000000000000
--- a/release_23/test/Analysis/ScalarEvolution/trip-count2.ll
+++ /dev/null
@@ -1,35 +0,0 @@
-; RUN: llvm-as < %s | opt -analyze -scalar-evolution | \
-; RUN: grep {4 iterations}
-; PR1101
-
-@A = weak global [1000 x i32] zeroinitializer, align 32
-
-
-define void @test(i32 %N) {
-entry:
- "alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
- br label %bb3
-
-bb: ; preds = %bb3
- %tmp = getelementptr [1000 x i32]* @A, i32 0, i32 %i.0 ; <i32*> [#uses=1]
- store i32 123, i32* %tmp
- %tmp4 = mul i32 %i.0, 4 ; <i32> [#uses=1]
- %tmp5 = or i32 %tmp4, 1
- %tmp61 = xor i32 %tmp5, -2147483648
- %tmp6 = trunc i32 %tmp61 to i16
- %tmp71 = shl i16 %tmp6, 2
- %tmp7 = zext i16 %tmp71 to i32
- %tmp2 = add i32 %tmp7, %i.0
- br label %bb3
-
-bb3: ; preds = %bb, %entry
- %i.0 = phi i32 [ 0, %entry ], [ %tmp2, %bb ] ; <i32> [#uses=3]
- %tmp3 = icmp sle i32 %i.0, 9999 ; <i1> [#uses=1]
- br i1 %tmp3, label %bb, label %bb5
-
-bb5: ; preds = %bb3
- br label %return
-
-return: ; preds = %bb5
- ret void
-}
diff --git a/release_23/test/Archive/GNU.a b/release_23/test/Archive/GNU.a
deleted file mode 100644
index 4c09881eb39d..000000000000
--- a/release_23/test/Archive/GNU.a
+++ /dev/null
Binary files differ
diff --git a/release_23/test/Archive/GNU.toc b/release_23/test/Archive/GNU.toc
deleted file mode 100644
index d9934139136c..000000000000
--- a/release_23/test/Archive/GNU.toc
+++ /dev/null
@@ -1,4 +0,0 @@
-evenlen
-oddlen
-very_long_bytecode_file_name.bc
-IsNAN.o
diff --git a/release_23/test/Archive/IsNAN.o b/release_23/test/Archive/IsNAN.o
deleted file mode 100644
index 7b3a12a69d74..000000000000
--- a/release_23/test/Archive/IsNAN.o
+++ /dev/null
Binary files differ
diff --git a/release_23/test/Archive/MacOSX.a b/release_23/test/Archive/MacOSX.a
deleted file mode 100644
index 77f88a2a7c84..000000000000
--- a/release_23/test/Archive/MacOSX.a
+++ /dev/null
Binary files differ
diff --git a/release_23/test/Archive/MacOSX.toc b/release_23/test/Archive/MacOSX.toc
deleted file mode 100644
index 61cbd3b2a070..000000000000
--- a/release_23/test/Archive/MacOSX.toc
+++ /dev/null
Binary files differ
diff --git a/release_23/test/Archive/README.txt b/release_23/test/Archive/README.txt
deleted file mode 100644
index da6cfa4c9ed0..000000000000
--- a/release_23/test/Archive/README.txt
+++ /dev/null
@@ -1,24 +0,0 @@
-test/Regression/Archive
-=======================
-
-This directory contains various tests of llvm-ar and llvm-ranlib to ensure
-compatibility reading other ar(1) formats. It also provides a basic
-functionality test for these tools.
-
-There are four archives stored in CVS with these tests:
-
-GNU.a - constructed on Linux with GNU ar
-MacOSX.a - constructed on Mac OS X with its native BSD4.4 ar
-SVR4.a - constructed on Solaris with /usr/ccs/bin/ar
-xpg4.a - constructed on Solaris with /usr/xpg4/bin/ar
-
-Each type of test is run on each of these archive files. These archives each
-contain four members:
-
-oddlen - a member with an odd lengthed name and content
-evenlen - a member with an even lengthed name and content
-IsNAN.o - a Linux native binary
-very_long_bytecode_file_name.bc - LLVM bytecode file with really long name
-
-These files test different aspects of the archiver that should cause failures
-in llvm-ar if regressions are introduced.
diff --git a/release_23/test/Archive/SVR4.a b/release_23/test/Archive/SVR4.a
deleted file mode 100644
index 3947813ac60a..000000000000
--- a/release_23/test/Archive/SVR4.a
+++ /dev/null
Binary files differ
diff --git a/release_23/test/Archive/SVR4.toc b/release_23/test/Archive/SVR4.toc
deleted file mode 100644
index d9934139136c..000000000000
--- a/release_23/test/Archive/SVR4.toc
+++ /dev/null
@@ -1,4 +0,0 @@
-evenlen
-oddlen
-very_long_bytecode_file_name.bc
-IsNAN.o
diff --git a/release_23/test/Archive/dg.exp b/release_23/test/Archive/dg.exp
deleted file mode 100644
index 879685ca879d..000000000000
--- a/release_23/test/Archive/dg.exp
+++ /dev/null
@@ -1,3 +0,0 @@
-load_lib llvm.exp
-
-RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
diff --git a/release_23/test/Archive/evenlen b/release_23/test/Archive/evenlen
deleted file mode 100644
index 59ee8d552e37..000000000000
--- a/release_23/test/Archive/evenlen
+++ /dev/null
@@ -1 +0,0 @@
-evenlen
diff --git a/release_23/test/Archive/extract_GNU.ll b/release_23/test/Archive/extract_GNU.ll
deleted file mode 100644
index f19840a14e5f..000000000000
--- a/release_23/test/Archive/extract_GNU.ll
+++ /dev/null
@@ -1,5 +0,0 @@
-;This isn't really an assembly file, its just here to run the test.
-;This test just makes sure that llvm-ar can extract bytecode members
-;from GNU style archives
-;RUN: llvm-ar x %p/GNU.a very_long_bytecode_file_name.bc
-;RUN: diff %p/very_long_bytecode_file_name.bc very_long_bytecode_file_name.bc >/dev/null 2>/dev/null
diff --git a/release_23/test/Archive/extract_MacOSX.ll b/release_23/test/Archive/extract_MacOSX.ll
deleted file mode 100644
index c811a59b33a2..000000000000
--- a/release_23/test/Archive/extract_MacOSX.ll
+++ /dev/null
@@ -1,6 +0,0 @@
-;This isn't really an assembly file, its just here to run the test.
-;This test just makes sure that llvm-ar can extract bytecode members
-;from MacOSX style archives
-
-;RUN: llvm-ar x %p/MacOSX.a very_long_bytecode_file_name.bc
-;RUN: diff %p/very_long_bytecode_file_name.bc very_long_bytecode_file_name.bc > /dev/null 2>/dev/null
diff --git a/release_23/test/Archive/extract_SVR4.ll b/release_23/test/Archive/extract_SVR4.ll
deleted file mode 100644
index 446d52c211cd..000000000000
--- a/release_23/test/Archive/extract_SVR4.ll
+++ /dev/null
@@ -1,6 +0,0 @@
-;This isn't really an assembly file, its just here to run the test.
-;This test just makes sure that llvm-ar can extract bytecode members
-;from SVR4 style archives
-
-;RUN: llvm-ar x %p/SVR4.a very_long_bytecode_file_name.bc
-;RUN: diff %p/very_long_bytecode_file_name.bc very_long_bytecode_file_name.bc >/dev/null 2>/dev/null
diff --git a/release_23/test/Archive/extract_xpg4.ll b/release_23/test/Archive/extract_xpg4.ll
deleted file mode 100644
index c816d914d29e..000000000000
--- a/release_23/test/Archive/extract_xpg4.ll
+++ /dev/null
@@ -1,6 +0,0 @@
-;This isn't really an assembly file, its just here to run the test.
-;This test just makes sure that llvm-ar can extract bytecode members
-;from xpg4 style archives
-
-;RUN: llvm-ar x %p/xpg4.a very_long_bytecode_file_name.bc
-;RUN: diff %p/very_long_bytecode_file_name.bc very_long_bytecode_file_name.bc >/dev/null 2>/dev/null
diff --git a/release_23/test/Archive/oddlen b/release_23/test/Archive/oddlen
deleted file mode 100644
index 8cf5bd181b1b..000000000000
--- a/release_23/test/Archive/oddlen
+++ /dev/null
@@ -1 +0,0 @@
-oddlen
diff --git a/release_23/test/Archive/toc_GNU.ll b/release_23/test/Archive/toc_GNU.ll
deleted file mode 100644
index 136f603a831e..000000000000
--- a/release_23/test/Archive/toc_GNU.ll
+++ /dev/null
@@ -1,5 +0,0 @@
-;This isn't really an assembly file, its just here to run the test.
-;This test just makes sure that llvm-ar can generate a table of contents for
-;GNU style archives
-;RUN: llvm-ar t %p/GNU.a > %t1
-;RUN: diff %t1 %p/GNU.toc
diff --git a/release_23/test/Archive/toc_MacOSX.ll b/release_23/test/Archive/toc_MacOSX.ll
deleted file mode 100644
index fb0322324081..000000000000
--- a/release_23/test/Archive/toc_MacOSX.ll
+++ /dev/null
@@ -1,5 +0,0 @@
-;This isn't really an assembly file, its just here to run the test.
-;This test just makes sure that llvm-ar can generate a table of contents for
-;MacOSX style archives
-;RUN: llvm-ar t %p/MacOSX.a > %t1
-;RUN: diff %t1 %p/MacOSX.toc
diff --git a/release_23/test/Archive/toc_SVR4.ll b/release_23/test/Archive/toc_SVR4.ll
deleted file mode 100644
index 930a26fd353e..000000000000
--- a/release_23/test/Archive/toc_SVR4.ll
+++ /dev/null
@@ -1,5 +0,0 @@
-;This isn't really an assembly file, its just here to run the test.
-;This test just makes sure that llvm-ar can generate a table of contents for
-;SVR4 style archives
-;RUN: llvm-ar t %p/SVR4.a > %t1
-;RUN: diff %t1 %p/SVR4.toc
diff --git a/release_23/test/Archive/toc_xpg4.ll b/release_23/test/Archive/toc_xpg4.ll
deleted file mode 100644
index 441af036f3cf..000000000000
--- a/release_23/test/Archive/toc_xpg4.ll
+++ /dev/null
@@ -1,5 +0,0 @@
-;This isn't really an assembly file, its just here to run the test.
-;This test just makes sure that llvm-ar can generate a table of contents for
-;xpg4 style archives
-;RUN: llvm-ar t %p/xpg4.a > %t1
-;RUN: diff %t1 %p/xpg4.toc
diff --git a/release_23/test/Archive/very_long_bytecode_file_name.bc b/release_23/test/Archive/very_long_bytecode_file_name.bc
deleted file mode 100644
index f7fce249020a..000000000000
--- a/release_23/test/Archive/very_long_bytecode_file_name.bc
+++ /dev/null
Binary files differ
diff --git a/release_23/test/Archive/xpg4.a b/release_23/test/Archive/xpg4.a
deleted file mode 100644
index b2bdb51188fe..000000000000
--- a/release_23/test/Archive/xpg4.a
+++ /dev/null
Binary files differ
diff --git a/release_23/test/Archive/xpg4.toc b/release_23/test/Archive/xpg4.toc
deleted file mode 100644
index d9934139136c..000000000000
--- a/release_23/test/Archive/xpg4.toc
+++ /dev/null
@@ -1,4 +0,0 @@
-evenlen
-oddlen
-very_long_bytecode_file_name.bc
-IsNAN.o
diff --git a/release_23/test/Assembler/2002-01-24-BadSymbolTableAssert.ll b/release_23/test/Assembler/2002-01-24-BadSymbolTableAssert.ll
deleted file mode 100644
index 0a10d9db18e3..000000000000
--- a/release_23/test/Assembler/2002-01-24-BadSymbolTableAssert.ll
+++ /dev/null
@@ -1,11 +0,0 @@
-; RUN: llvm-as < %s -o /dev/null -f
-
-; This testcase failed due to a bad assertion in SymbolTable.cpp, removed in
-; the 1.20 revision. Basically the symbol table assumed that if there was an
-; abstract type in the symbol table, [in this case for the entry %foo of type
-; void(opaque)* ], that there should have also been named types by now. This
-; was obviously not the case here, and this is valid. Assertion disabled.
-
-%bb = type i32
-
-declare void @foo(i32)
diff --git a/release_23/test/Assembler/2002-01-24-ValueRefineAbsType.ll b/release_23/test/Assembler/2002-01-24-ValueRefineAbsType.ll
deleted file mode 100644
index 2561b05dd2bc..000000000000
--- a/release_23/test/Assembler/2002-01-24-ValueRefineAbsType.ll
+++ /dev/null
@@ -1,23 +0,0 @@
-; RUN: llvm-as < %s -o /dev/null -f
-
-; This testcase used to fail due to a lack of this diff in Value.cpp:
-; diff -r1.16 Value.cpp
-; 11c11
-; < #include "llvm/Type.h"
-; ---
-; > #include "llvm/DerivedTypes.h"
-; 74c74,76
-; < assert(Ty.get() == (const Type*)OldTy &&"Can't refine anything but my type!");
-; ---
-; > assert(Ty.get() == OldTy &&"Can't refine anything but my type!");
-; > if (OldTy == NewTy && !OldTy->isAbstract())
-; > Ty.removeUserFromConcrete();
-;
-; This was causing an assertion failure, due to the "foo" Method object never
-; releasing it's reference to the opaque %bb value.
-;
-
-%bb = type i32
-%exception_descriptor = type i32
-
-declare void @foo(i32)
diff --git a/release_23/test/Assembler/2002-02-19-TypeParsing.ll b/release_23/test/Assembler/2002-02-19-TypeParsing.ll
deleted file mode 100644
index b5ddb5f5fb7d..000000000000
--- a/release_23/test/Assembler/2002-02-19-TypeParsing.ll
+++ /dev/null
@@ -1,3 +0,0 @@
-; RUN: llvm-as < %s -o /dev/null -f
-
-%Hosp = type { i32, i32, i32, { \2*, { i32, i32, i32, { [4 x \3], \2, \5, %Hosp, i32, i32 }* }*, \2* }, { \2*, { i32, i32, i32, { [4 x \3], \2, \5, %Hosp, i32, i32 }* }*, \2* }, { \2*, { i32, i32, i32, { [4 x \3], \2, \5, %Hosp, i32, i32 }* }*, \2* }, { \2*, { i32, i32, i32, { [4 x \3], \2, \5, %Hosp, i32, i32 }* }*, \2* } }
diff --git a/release_23/test/Assembler/2002-03-08-NameCollision.ll b/release_23/test/Assembler/2002-03-08-NameCollision.ll
deleted file mode 100644
index e74332cbb274..000000000000
--- a/release_23/test/Assembler/2002-03-08-NameCollision.ll
+++ /dev/null
@@ -1,15 +0,0 @@
-; RUN: llvm-as < %s -o /dev/null -f
-
-; Method arguments were being checked for collisions at the global scope before
-; the method object was created by the parser. Because of this, false
-; collisions could occur that would cause the following error message to be
-; produced:
-;
-; Redefinition of value named 'X' in the 'int *' type plane!
-;
-; Fixed by delaying binding of variable names until _after_ the method symtab is
-; created.
-;
-@X = global i32 4 ; <i32*> [#uses=0]
-
-declare i32 @xxx(i32*)
diff --git a/release_23/test/Assembler/2002-03-08-NameCollision2.ll b/release_23/test/Assembler/2002-03-08-NameCollision2.ll
deleted file mode 100644
index f545376761ea..000000000000
--- a/release_23/test/Assembler/2002-03-08-NameCollision2.ll
+++ /dev/null
@@ -1,12 +0,0 @@
-; RUN: llvm-as < %s -o /dev/null -f
-
-; Another name collision problem. Here the problem was that if a forward
-; declaration for a method was found, that this would cause spurious conflicts
-; to be detected between locals and globals.
-;
-@Var = external global i32 ; <i32*> [#uses=0]
-
-define void @foo() {
- %Var = alloca i32 ; <i32*> [#uses=0]
- ret void
-}
diff --git a/release_23/test/Assembler/2002-04-04-PureVirtMethCall.ll b/release_23/test/Assembler/2002-04-04-PureVirtMethCall.ll
deleted file mode 100644
index 6831854c0f89..000000000000
--- a/release_23/test/Assembler/2002-04-04-PureVirtMethCall.ll
+++ /dev/null
@@ -1,6 +0,0 @@
-; RUN: llvm-as < %s -o /dev/null -f
-
- type { { \2 *, \4 ** },
- { \2 *, \4 ** }
- }
-
diff --git a/release_23/test/Assembler/2002-04-04-PureVirtMethCall2.ll b/release_23/test/Assembler/2002-04-04-PureVirtMethCall2.ll
deleted file mode 100644
index 9dd86ee7433c..000000000000
--- a/release_23/test/Assembler/2002-04-04-PureVirtMethCall2.ll
+++ /dev/null
@@ -1,5 +0,0 @@
-; RUN: llvm-as < %s -o /dev/null -f
-
-%t = type { { \2*, \2 },
- { \2*, \2 }
- }
diff --git a/release_23/test/Assembler/2002-04-05-TypeParsing.ll b/release_23/test/Assembler/2002-04-05-TypeParsing.ll
deleted file mode 100644
index 60e704fbed2a..000000000000
--- a/release_23/test/Assembler/2002-04-05-TypeParsing.ll
+++ /dev/null
@@ -1,3 +0,0 @@
-; RUN: llvm-as < %s -o /dev/null -f
-
- %Hosp = type { { \2*, { \2, %Hosp }* }, { \2*, { \2, %Hosp }* } }
diff --git a/release_23/test/Assembler/2002-04-07-HexFloatConstants.ll b/release_23/test/Assembler/2002-04-07-HexFloatConstants.ll
deleted file mode 100644
index b9860b3ac5a1..000000000000
--- a/release_23/test/Assembler/2002-04-07-HexFloatConstants.ll
+++ /dev/null
@@ -1,16 +0,0 @@
-; This testcase checks to make sure that the assembler can handle floating
-; point constants in IEEE hex format. This also checks that the disassembler,
-; when presented with a FP constant that cannot be represented exactly in
-; exponential form, outputs it correctly in hex format. This is a distillation
-; of the bug that was causing the Olden Health benchmark to output incorrect
-; results!
-;
-; RUN: llvm-as < %s | opt -constprop | llvm-dis > %t.1
-; RUN: llvm-as < %s | llvm-dis | llvm-as | opt -constprop | \
-; RUN: llvm-dis > %t.2
-; RUN: diff %t.1 %t.2
-
-define double @test() {
- %tmp = mul double 7.200000e+101, 0x427F4000 ; <double> [#uses=1]
- ret double %tmp
-}
diff --git a/release_23/test/Assembler/2002-04-07-InfConstant.ll b/release_23/test/Assembler/2002-04-07-InfConstant.ll
deleted file mode 100644
index 06e649e5c12c..000000000000
--- a/release_23/test/Assembler/2002-04-07-InfConstant.ll
+++ /dev/null
@@ -1,9 +0,0 @@
-; The output formater prints out 1.0e100 as Inf!
-;
-; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis
-
-define float @test() {
- %tmp = mul float 0x7FF0000000000000, 1.000000e+01 ; <float> [#uses=1]
- ret float %tmp
-}
-
diff --git a/release_23/test/Assembler/2002-04-29-NameBinding.ll b/release_23/test/Assembler/2002-04-29-NameBinding.ll
deleted file mode 100644
index 9665aef14323..000000000000
--- a/release_23/test/Assembler/2002-04-29-NameBinding.ll
+++ /dev/null
@@ -1,18 +0,0 @@
-; There should be NO references to the global v1. The local v1 should
-; have all of the references!
-;
-; Check by running globaldce, which will remove the constant if there are
-; no references to it!
-;
-; RUN: llvm-as < %s | opt -globaldce | llvm-dis | \
-; RUN: not grep constant
-;
-
-@v1 = internal constant i32 5
-
-define i32 @createtask() {
- %v1 = alloca i32 ;; Alloca should have one use!
- %reg112 = load i32* %v1 ;; This load should not use the global!
- ret i32 %reg112
-}
-
diff --git a/release_23/test/Assembler/2002-05-02-InvalidForwardRef.ll b/release_23/test/Assembler/2002-05-02-InvalidForwardRef.ll
deleted file mode 100644
index 8203365c1c46..000000000000
--- a/release_23/test/Assembler/2002-05-02-InvalidForwardRef.ll
+++ /dev/null
@@ -1,10 +0,0 @@
-; RUN: llvm-as < %s -o /dev/null -f
-; It looks like the assembler is not forward resolving the function declaraion
-; correctly.
-
-define void @test() {
- call void @foo( )
- ret void
-}
-
-declare void @foo()
diff --git a/release_23/test/Assembler/2002-05-02-ParseError.ll b/release_23/test/Assembler/2002-05-02-ParseError.ll
deleted file mode 100644
index b198edfd31f5..000000000000
--- a/release_23/test/Assembler/2002-05-02-ParseError.ll
+++ /dev/null
@@ -1,7 +0,0 @@
-; RUN: llvm-as %s -o /dev/null -f
-
-%T = type i32 *
-
-define %T @test() {
- ret %T null
-}
diff --git a/release_23/test/Assembler/2002-07-08-HugePerformanceProblem.ll b/release_23/test/Assembler/2002-07-08-HugePerformanceProblem.ll
deleted file mode 100644
index d961ce6fbad6..000000000000
--- a/release_23/test/Assembler/2002-07-08-HugePerformanceProblem.ll
+++ /dev/null
@@ -1,67 +0,0 @@
-; This file takes about 48 __MINUTES__ to assemble using as. This is WAY too
-; long. The type resolution code needs to be sped up a lot.
-; RUN: llvm-as < %s -o /dev/null -f
- %ALL_INTERSECTIONS_METHOD = type i32 (%OBJECT*, %RAY*, %ISTACK*)*
- %BBOX = type { %BBOX_VECT, %BBOX_VECT }
- %BBOX_TREE = type { i16, i16, %BBOX, %BBOX_TREE** }
- %BBOX_VECT = type [3 x float]
- %BLEND_MAP = type { i16, i16, i16, i32, %BLEND_MAP_ENTRY* }
- %BLEND_MAP_ENTRY = type { float, i8, { %COLOUR, %PIGMENT*, %TNORMAL*, %TEXTURE*, %UV_VECT } }
- %CAMERA = type { %VECTOR, %VECTOR, %VECTOR, %VECTOR, %VECTOR, %VECTOR, double, double, i32, double, double, i32, double, %TNORMAL* }
- %COLOUR = type [5 x float]
- %COPY_METHOD = type i8* (%OBJECT*)*
- %COUNTER = type { i32, i32 }
- %DENSITY_FILE = type { i32, %DENSITY_FILE_DATA* }
- %DENSITY_FILE_DATA = type { i32, i8*, i32, i32, i32, i8*** }
- %DESTROY_METHOD = type void (%OBJECT*)*
- %FILE = type { i32, i8*, i8*, i8, i8, i32, i32, i32 }
- %FILE_HANDLE = type { i8*, i32, i32, i32, i32, i8*, %FILE*, i32, i32 (%FILE_HANDLE*, i8*, i32*, i32*, i32, i32)*, void (%FILE_HANDLE*, %COLOUR*, i32)*, i32 (%FILE_HANDLE*, %COLOUR*, i32*)*, void (%IMAGE*, i8*)*, void (%FILE_HANDLE*)* }
- %FINISH = type { float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, %BBOX_VECT, %BBOX_VECT }
- %FOG = type { i32, double, double, double, %COLOUR, %VECTOR, %TURB*, float, %FOG* }
- %FRAME = type { %CAMERA*, i32, i32, i32, %LIGHT_SOURCE*, %OBJECT*, double, double, %COLOUR, %COLOUR, %COLOUR, %IMEDIA*, %FOG*, %RAINBOW*, %SKYSPHERE* }
- %FRAMESEQ = type { i32, double, i32, i32, double, i32, i32, double, i32, double, i32, double, i32, i32 }
- %IMAGE = type { i32, i32, i32, i32, i32, i16, i16, %VECTOR, float, float, i32, i32, i16, %IMAGE_COLOUR*, { %IMAGE_LINE*, i8** } }
- %IMAGE_COLOUR = type { i16, i16, i16, i16, i16 }
- %IMAGE_LINE = type { i8*, i8*, i8*, i8* }
- %IMEDIA = type { i32, i32, i32, i32, i32, double, double, i32, i32, i32, i32, %COLOUR, %COLOUR, %COLOUR, %COLOUR, double, double, double, double*, %PIGMENT*, %IMEDIA* }
- %INSIDE_METHOD = type i32 (double*, %OBJECT*)*
- %INTERIOR = type { i32, i32, float, float, float, float, float, %IMEDIA* }
- %INTERSECTION = type { double, %VECTOR, %VECTOR, %OBJECT*, i32, i32, double, double, i8* }
- %INVERT_METHOD = type void (%OBJECT*)*
- %ISTACK = type { %ISTACK*, %INTERSECTION*, i32 }
- %LIGHT_SOURCE = type { %METHODS*, i32, %OBJECT*, %TEXTURE*, %INTERIOR*, %OBJECT*, %OBJECT*, %BBOX, i32, %OBJECT*, %COLOUR, %VECTOR, %VECTOR, %VECTOR, %VECTOR, %VECTOR, double, double, double, double, double, %LIGHT_SOURCE*, i8, i8, i8, i8, i32, i32, i32, i32, i32, %COLOUR**, %OBJECT*, [6 x %PROJECT_TREE_NODE*] }
- %MATRIX = type [4 x %VECTOR_4D]
- %METHODS = type { %ALL_INTERSECTIONS_METHOD, %INSIDE_METHOD, %NORMAL_METHOD, %COPY_METHOD, %ROTATE_METHOD, %ROTATE_METHOD, %ROTATE_METHOD, %TRANSFORM_METHOD, %DESTROY_METHOD, %DESTROY_METHOD }
- %NORMAL_METHOD = type void (double*, %OBJECT*, %INTERSECTION*)*
- %OBJECT = type { %METHODS*, i32, %OBJECT*, %TEXTURE*, %INTERIOR*, %OBJECT*, %OBJECT*, %BBOX, i32 }
- %Opts = type { i32, i32, i8, i8, i8, i32, [150 x i8], [150 x i8], [150 x i8], [150 x i8], [150 x i8], double, double, i32, i32, double, double, i32, [25 x i8*], i32, i32, i32, double, double, i32, i32, double, double, double, i32, i32, i32, i32, i32, %FRAMESEQ, double, i32, double, double, double, double, double, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, [150 x i8], %SHELLDATA*, [150 x i8], i32, i32 }
- %PIGMENT = type { i16, i16, i16, i32, float, float, float, %WARP*, %TPATTERN*, %BLEND_MAP*, { %DENSITY_FILE*, %IMAGE*, %VECTOR, float, i16, i16, i16, { float, %VECTOR }, %complex.float }, %COLOUR }
- %PRIORITY_QUEUE = type { i32, i32, %QELEM* }
- %PROJECT = type { i32, i32, i32, i32 }
- %PROJECT_QUEUE = type { i32, i32, %PROJECT_TREE_NODE** }
- %PROJECT_TREE_NODE = type { i16, %BBOX_TREE*, %PROJECT, i16, %PROJECT_TREE_NODE** }
- %QELEM = type { double, %BBOX_TREE* }
- %RAINBOW = type { double, double, double, double, double, double, double, %VECTOR, %VECTOR, %VECTOR, %PIGMENT*, %RAINBOW* }
- %RAY = type { %VECTOR, %VECTOR, i32, [100 x %INTERIOR*] }
- %RAYINFO = type { %VECTOR, %VECTOR, %VECTORI, %VECTORI }
- %RGB = type [3 x float]
- %ROTATE_METHOD = type void (%OBJECT*, double*, %TRANSFORM*)*
- %SCALE_METHOD = type void (%OBJECT*, double*, %TRANSFORM*)*
- %SHELLDATA = type { i32, i32, [250 x i8] }
- %SKYSPHERE = type { i32, %PIGMENT**, %TRANSFORM* }
- %SNGL_VECT = type [3 x float]
- %TEXTURE = type { i16, i16, i16, i32, float, float, float, %WARP*, %TPATTERN*, %BLEND_MAP*, { %DENSITY_FILE*, %IMAGE*, %VECTOR, float, i16, i16, i16, { float, %VECTOR }, %complex.float }, %TEXTURE*, %PIGMENT*, %TNORMAL*, %FINISH*, %TEXTURE*, i32 }
- %TNORMAL = type { i16, i16, i16, i32, float, float, float, %WARP*, %TPATTERN*, %BLEND_MAP*, { %DENSITY_FILE*, %IMAGE*, %VECTOR, float, i16, i16, i16, { float, %VECTOR }, %complex.float }, float }
- %TPATTERN = type { i16, i16, i16, i32, float, float, float, %WARP*, %TPATTERN*, %BLEND_MAP*, { %DENSITY_FILE*, %IMAGE*, %VECTOR, float, i16, i16, i16, { float, %VECTOR }, %complex.float } }
- %TRANSFORM = type { %MATRIX, %MATRIX }
- %TRANSFORM_METHOD = type void (%OBJECT*, %TRANSFORM*)*
- %TRANSLATE_METHOD = type void (%OBJECT*, double*, %TRANSFORM*)*
- %TURB = type { i16, %WARP*, %VECTOR, i32, float, float }
- %UV_VECT = type [2 x double]
- %VECTOR = type [3 x double]
- %VECTORI = type [3 x i32]
- %VECTOR_4D = type [4 x double]
- %WARP = type { i16, %WARP* }
- %__FILE = type { i32, i8*, i8*, i8, i8, i32, i32, i32 }
- %_h_val = type { [2 x i32], double }
- %complex.float = type { float, float }
diff --git a/release_23/test/Assembler/2002-07-14-InternalLossage.ll b/release_23/test/Assembler/2002-07-14-InternalLossage.ll
deleted file mode 100644
index f93f1c4a5fb0..000000000000
--- a/release_23/test/Assembler/2002-07-14-InternalLossage.ll
+++ /dev/null
@@ -1,9 +0,0 @@
-; Test to make sure that the 'internal' tag is not lost!
-;
-; RUN: llvm-as < %s | llvm-dis | grep internal
-
-declare void @foo()
-
-define internal void @foo() {
- ret void
-}
diff --git a/release_23/test/Assembler/2002-07-14-OpaqueType.ll b/release_23/test/Assembler/2002-07-14-OpaqueType.ll
deleted file mode 100644
index 662fb0f31c1d..000000000000
--- a/release_23/test/Assembler/2002-07-14-OpaqueType.ll
+++ /dev/null
@@ -1,10 +0,0 @@
-; Test that opaque types are preserved correctly
-; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis
-;
-
-%Ty = type opaque
-
-define %Ty* @func() {
- ret %Ty* null
-}
-
diff --git a/release_23/test/Assembler/2002-07-25-ParserAssertionFailure.ll b/release_23/test/Assembler/2002-07-25-ParserAssertionFailure.ll
deleted file mode 100644
index 57ca2ffeb5f3..000000000000
--- a/release_23/test/Assembler/2002-07-25-ParserAssertionFailure.ll
+++ /dev/null
@@ -1,13 +0,0 @@
-; Make sure we don't get an assertion failure, even though this is a parse
-; error
-; RUN: not llvm-as < %s -o /dev/null -f |& grep {No arguments}
-
-%ty = type void (i32)
-
-declare %ty* @foo()
-
-define void @test() {
- call %ty* @foo( ) ; <%ty*>:0 [#uses=0]
- ret void
-}
-
diff --git a/release_23/test/Assembler/2002-07-25-QuoteInString.ll b/release_23/test/Assembler/2002-07-25-QuoteInString.ll
deleted file mode 100644
index facc5bdae62e..000000000000
--- a/release_23/test/Assembler/2002-07-25-QuoteInString.ll
+++ /dev/null
@@ -1,5 +0,0 @@
-; Test double quotes in strings work correctly!
-; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis
-;
-@str = internal global [6 x i8] c"\22foo\22\00" ; <[6 x i8]*> [#uses=0]
-
diff --git a/release_23/test/Assembler/2002-07-25-ReturnPtrFunction.ll b/release_23/test/Assembler/2002-07-25-ReturnPtrFunction.ll
deleted file mode 100644
index 515d105c14c6..000000000000
--- a/release_23/test/Assembler/2002-07-25-ReturnPtrFunction.ll
+++ /dev/null
@@ -1,15 +0,0 @@
-; Test that returning a pointer to a function causes the disassembler to print
-; the right thing.
-;
-; RUN: llvm-as < %s | llvm-dis | llvm-as
-
-%ty = type void (i32)
-
-declare %ty* @foo()
-
-define void @test() {
- call %ty* ()* @foo( ) ; <%ty*>:1 [#uses=0]
- ret void
-}
-
-
diff --git a/release_23/test/Assembler/2002-07-31-SlashInString.ll b/release_23/test/Assembler/2002-07-31-SlashInString.ll
deleted file mode 100644
index ff48258870dd..000000000000
--- a/release_23/test/Assembler/2002-07-31-SlashInString.ll
+++ /dev/null
@@ -1,5 +0,0 @@
-; RUN: llvm-as < %s | llvm-dis | llvm-as
-
-; Make sure that \\ works in a string initializer
-@Slashtest = internal global [8 x i8] c"\5Cbegin{\00"
-
diff --git a/release_23/test/Assembler/2002-08-15-CastAmbiguity.ll b/release_23/test/Assembler/2002-08-15-CastAmbiguity.ll
deleted file mode 100644
index 267a0d33ee45..000000000000
--- a/release_23/test/Assembler/2002-08-15-CastAmbiguity.ll
+++ /dev/null
@@ -1,6 +0,0 @@
-; RUN: llvm-as < %s -o /dev/null -f
-
-define void @test(i32 %X) {
- call void @test( i32 6 )
- ret void
-}
diff --git a/release_23/test/Assembler/2002-08-15-ConstantExprProblem.ll b/release_23/test/Assembler/2002-08-15-ConstantExprProblem.ll
deleted file mode 100644
index c6f434aff225..000000000000
--- a/release_23/test/Assembler/2002-08-15-ConstantExprProblem.ll
+++ /dev/null
@@ -1,16 +0,0 @@
-; RUN: llvm-as < %s -o /dev/null -f
-
-@.LC0 = internal global [12 x i8] c"hello world\00" ; <[12 x i8]*> [#uses=1]
-
-define i8* @test() {
-; <label>:0
- br label %BB1
-
-BB1: ; preds = %BB2, %0
- %ret = phi i8* [ getelementptr ([12 x i8]* @.LC0, i64 0, i64 0), %0 ], [ null, %BB2 ] ; <i8*> [#uses=1]
- ret i8* %ret
-
-BB2: ; No predecessors!
- br label %BB1
-}
-
diff --git a/release_23/test/Assembler/2002-08-15-UnresolvedGlobalReference.ll b/release_23/test/Assembler/2002-08-15-UnresolvedGlobalReference.ll
deleted file mode 100644
index 38802f0cf267..000000000000
--- a/release_23/test/Assembler/2002-08-15-UnresolvedGlobalReference.ll
+++ /dev/null
@@ -1,8 +0,0 @@
-; RUN: llvm-as < %s -o /dev/null -f
-
-@.LC0 = internal global [12 x i8] c"hello world\00" ; <[12 x i8]*> [#uses=1]
-
-define i8* @test() {
- ret i8* getelementptr ([12 x i8]* @.LC0, i64 0, i64 0)
-}
-
diff --git a/release_23/test/Assembler/2002-08-16-ConstExprInlined.ll b/release_23/test/Assembler/2002-08-16-ConstExprInlined.ll
deleted file mode 100644
index f233bacca46b..000000000000
--- a/release_23/test/Assembler/2002-08-16-ConstExprInlined.ll
+++ /dev/null
@@ -1,22 +0,0 @@
-; In this testcase, the bytecode reader or writer is not correctly handling the
-; ConstExpr reference. Disassembling this program assembled yields invalid
-; assembly (because there are placeholders still around), which the assembler
-; dies on.
-
-; There are two things that need to be fixed here. Obviously assembling and
-; disassembling this would be good, but in addition to that, the bytecode
-; reader should NEVER produce a program "successfully" with placeholders still
-; around!
-;
-; RUN: llvm-as < %s | llvm-dis | llvm-as
-
-@.LC0 = internal global [4 x i8] c"foo\00" ; <[4 x i8]*> [#uses=1]
-@X = global i8* null ; <i8**> [#uses=0]
-
-declare i32 @puts(i8*)
-
-define void @main() {
-bb1:
- %reg211 = call i32 @puts( i8* getelementptr ([4 x i8]* @.LC0, i64 0, i64 0) ) ; <i32> [#uses=0]
- ret void
-}
diff --git a/release_23/test/Assembler/2002-08-19-BytecodeReader.ll b/release_23/test/Assembler/2002-08-19-BytecodeReader.ll
deleted file mode 100644
index e42cda0baa07..000000000000
--- a/release_23/test/Assembler/2002-08-19-BytecodeReader.ll
+++ /dev/null
@@ -1,17 +0,0 @@
-; Testcase that seems to break the bytecode reader. This comes from the
-; "crafty" spec benchmark.
-;
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | llvm-as
-
-%CHESS_POSITION = type { i32, i32 }
-@pawn_probes = external global i32 ; <i32*> [#uses=0]
-@pawn_hash_mask = external global i32 ; <i32*> [#uses=0]
-@search = external global %CHESS_POSITION ; <%CHESS_POSITION*> [#uses=2]
-
-define void @Evaluate() {
- %reg1321 = getelementptr %CHESS_POSITION* @search, i64 0, i32 1 ; <i32*> [#uses=1]
- %reg114 = load i32* %reg1321 ; <i32> [#uses=0]
- %reg1801 = getelementptr %CHESS_POSITION* @search, i64 0, i32 0 ; <i32*> [#uses=1]
- %reg182 = load i32* %reg1801 ; <i32> [#uses=0]
- ret void
-}
diff --git a/release_23/test/Assembler/2002-08-22-DominanceProblem.ll b/release_23/test/Assembler/2002-08-22-DominanceProblem.ll
deleted file mode 100644
index 81c6129d85ec..000000000000
--- a/release_23/test/Assembler/2002-08-22-DominanceProblem.ll
+++ /dev/null
@@ -1,17 +0,0 @@
-; RUN: llvm-as < %s -o /dev/null -f
-
-; Dominance relationships is not calculated correctly for unreachable blocks,
-; which causes the verifier to barf on this input.
-
-define i32 @test(i1 %b) {
-BB0:
- ret i32 7 ; Loop is unreachable
-
-Loop: ; preds = %L2, %Loop
- %B = phi i32 [ %B, %L2 ], [ %B, %Loop ] ;PHI has same value always.
- br i1 %b, label %L2, label %Loop
-
-L2: ; preds = %Loop
- br label %Loop
-}
-
diff --git a/release_23/test/Assembler/2002-10-08-LargeArrayPerformance.ll b/release_23/test/Assembler/2002-10-08-LargeArrayPerformance.ll
deleted file mode 100644
index b067ea538dd2..000000000000
--- a/release_23/test/Assembler/2002-10-08-LargeArrayPerformance.ll
+++ /dev/null
@@ -1,8 +0,0 @@
-; RUN: llvm-as < %s -o /dev/null -f
-; This testcase comes from the following really simple c file:
-;; int foo[30000]
-;;; We should not be soo slow for such a simple case!
-
-@foo = global [30000 x i32] zeroinitializer ; <[30000 x i32]*> [#uses=0]
-
-declare void @__main()
diff --git a/release_23/test/Assembler/2002-10-13-ConstantEncodingProblem.ll b/release_23/test/Assembler/2002-10-13-ConstantEncodingProblem.ll
deleted file mode 100644
index bf3a52154342..000000000000
--- a/release_23/test/Assembler/2002-10-13-ConstantEncodingProblem.ll
+++ /dev/null
@@ -1,5 +0,0 @@
-; RUN: llvm-as < %s | llvm-dis
-
-%Domain = type { %Domain**, %Domain* }
-@D = global %Domain zeroinitializer ; <%Domain*> [#uses=0]
-
diff --git a/release_23/test/Assembler/2002-10-15-NameClash.ll b/release_23/test/Assembler/2002-10-15-NameClash.ll
deleted file mode 100644
index 278c98a7ef20..000000000000
--- a/release_23/test/Assembler/2002-10-15-NameClash.ll
+++ /dev/null
@@ -1,7 +0,0 @@
-; RUN: llvm-as < %s -o /dev/null -f
-
-declare i32 @"ArrayRef"([100 x i32] * %Array)
-
-define i32 @"ArrayRef"([100 x i32] * %Array) {
- ret i32 0
-}
diff --git a/release_23/test/Assembler/2002-12-15-GlobalResolve.ll b/release_23/test/Assembler/2002-12-15-GlobalResolve.ll
deleted file mode 100644
index 222721921d76..000000000000
--- a/release_23/test/Assembler/2002-12-15-GlobalResolve.ll
+++ /dev/null
@@ -1,7 +0,0 @@
-; RUN: llvm-as < %s -o /dev/null -f
-
-@X = external global i32*
-@X1 = external global %T*
-@X2 = external global i32*
-
-%T = type i32
diff --git a/release_23/test/Assembler/2003-01-30-UnsignedString.ll b/release_23/test/Assembler/2003-01-30-UnsignedString.ll
deleted file mode 100644
index 6d221a8cda65..000000000000
--- a/release_23/test/Assembler/2003-01-30-UnsignedString.ll
+++ /dev/null
@@ -1,4 +0,0 @@
-; RUN: llvm-as < %s -o /dev/null -f
-
-@spell_order = global [4 x i8] c"\FF\00\F7\00"
-
diff --git a/release_23/test/Assembler/2003-04-15-ConstantInitAssertion.ll b/release_23/test/Assembler/2003-04-15-ConstantInitAssertion.ll
deleted file mode 100644
index 66b80de348b1..000000000000
--- a/release_23/test/Assembler/2003-04-15-ConstantInitAssertion.ll
+++ /dev/null
@@ -1,4 +0,0 @@
-; RUN: not llvm-as < %s >/dev/null |& grep {Expected type 'i32' for element #0}
-; Test the case of a misformed constant initializer
-; This should cause an assembler error, not an assertion failure!
-constant { i32 } { float 1.0 }
diff --git a/release_23/test/Assembler/2003-04-25-UnresolvedGlobalReference.ll b/release_23/test/Assembler/2003-04-25-UnresolvedGlobalReference.ll
deleted file mode 100644
index 663acbbb2277..000000000000
--- a/release_23/test/Assembler/2003-04-25-UnresolvedGlobalReference.ll
+++ /dev/null
@@ -1,7 +0,0 @@
-; RUN: llvm-as < %s -o /dev/null -f
-; There should be absolutely no problem with this testcase.
-
-define i32 @test(i32 %arg1, i32 %arg2) {
- ret i32 ptrtoint (i32 (i32, i32)* @test to i32)
-}
-
diff --git a/release_23/test/Assembler/2003-05-03-BytecodeReaderProblem.ll b/release_23/test/Assembler/2003-05-03-BytecodeReaderProblem.ll
deleted file mode 100644
index f4a691160518..000000000000
--- a/release_23/test/Assembler/2003-05-03-BytecodeReaderProblem.ll
+++ /dev/null
@@ -1,6 +0,0 @@
-; RUN: llvm-as < %s | llvm-dis
-
-define void @test() {
- %tmp.123 = trunc i64 0 to i32 ; <i32> [#uses=0]
- ret void
-}
diff --git a/release_23/test/Assembler/2003-05-12-MinIntProblem.ll b/release_23/test/Assembler/2003-05-12-MinIntProblem.ll
deleted file mode 100644
index ebe169013b4c..000000000000
--- a/release_23/test/Assembler/2003-05-12-MinIntProblem.ll
+++ /dev/null
@@ -1,5 +0,0 @@
-; RUN: llvm-as < %s | llvm-dis | grep -- -2147483648
-
-define i32 @foo() {
- ret i32 -2147483648
-}
diff --git a/release_23/test/Assembler/2003-05-15-AssemblerProblem.ll b/release_23/test/Assembler/2003-05-15-AssemblerProblem.ll
deleted file mode 100644
index 10cde2877ce5..000000000000
--- a/release_23/test/Assembler/2003-05-15-AssemblerProblem.ll
+++ /dev/null
@@ -1,14 +0,0 @@
-; This bug was caused by two CPR's existing for the same global variable,
-; colliding in the Module level CPR map.
-; RUN: llvm-as < %s -o /dev/null -f
-
-define void @test() {
- call void (...)* bitcast (void (i16*, i32)* @AddString to void (...)*)( i16* null, i32 0 )
- ret void
-}
-
-define void @AddString(i16* %tmp.124, i32 %tmp.127) {
- call void (...)* bitcast (void (i16*, i32)* @AddString to void (...)*)( i16* %tmp.124, i32 %tmp.127 )
- ret void
-}
-
diff --git a/release_23/test/Assembler/2003-05-15-SwitchBug.ll b/release_23/test/Assembler/2003-05-15-SwitchBug.ll
deleted file mode 100644
index 78c5f9af1bed..000000000000
--- a/release_23/test/Assembler/2003-05-15-SwitchBug.ll
+++ /dev/null
@@ -1,11 +0,0 @@
-; RUN: llvm-as < %s -o /dev/null -f
-
-; Check minimal switch statement
-
-define void @test(i32 %X) {
- switch i32 %X, label %dest [
- ]
-
-dest: ; preds = %0
- ret void
-}
diff --git a/release_23/test/Assembler/2003-05-21-ConstantShiftExpr.ll b/release_23/test/Assembler/2003-05-21-ConstantShiftExpr.ll
deleted file mode 100644
index 904c755dca36..000000000000
--- a/release_23/test/Assembler/2003-05-21-ConstantShiftExpr.ll
+++ /dev/null
@@ -1,4 +0,0 @@
-; RUN: llvm-as < %s -o /dev/null -f
-; Test that shift instructions can be used in constant expressions.
-
-global i32 3670016
diff --git a/release_23/test/Assembler/2003-05-21-EmptyStructTest.ll b/release_23/test/Assembler/2003-05-21-EmptyStructTest.ll
deleted file mode 100644
index 333ab39f29a6..000000000000
--- a/release_23/test/Assembler/2003-05-21-EmptyStructTest.ll
+++ /dev/null
@@ -1,6 +0,0 @@
-; RUN: llvm-as < %s -o /dev/null -f
-
-; The old C front-end never generated empty structures, now the new one
-; can. For some reason we never handled them in the parser. Weird.
-
-@X = global { } zeroinitializer
diff --git a/release_23/test/Assembler/2003-05-21-MalformedShiftCrash.ll b/release_23/test/Assembler/2003-05-21-MalformedShiftCrash.ll
deleted file mode 100644
index d573403a13e5..000000000000
--- a/release_23/test/Assembler/2003-05-21-MalformedShiftCrash.ll
+++ /dev/null
@@ -1,4 +0,0 @@
-; Found by inspection of the code
-; RUN: not llvm-as < %s > /dev/null |& grep {Logical operator requires integral}
-
-global i32 ashr (float 1.0, float 2.0)
diff --git a/release_23/test/Assembler/2003-05-21-MalformedStructCrash.ll b/release_23/test/Assembler/2003-05-21-MalformedStructCrash.ll
deleted file mode 100644
index bf930350ef07..000000000000
--- a/release_23/test/Assembler/2003-05-21-MalformedStructCrash.ll
+++ /dev/null
@@ -1,4 +0,0 @@
-; Found by inspection of the code
-; RUN: not llvm-as < %s > /dev/null |& grep {Illegal number of init}
-
-global {} { i32 7, float 1.0, i32 7, i32 8 }
diff --git a/release_23/test/Assembler/2003-06-17-InvokeDisassemble.ll b/release_23/test/Assembler/2003-06-17-InvokeDisassemble.ll
deleted file mode 100644
index 922a996cd7dd..000000000000
--- a/release_23/test/Assembler/2003-06-17-InvokeDisassemble.ll
+++ /dev/null
@@ -1,9 +0,0 @@
-; RUN: llvm-as < %s | llvm-dis
-
-define void @test() {
- invoke void @test( )
- to label %Next unwind label %Next
-
-Next: ; preds = %0, %0
- ret void
-}
diff --git a/release_23/test/Assembler/2003-06-30-RecursiveTypeProblem.ll b/release_23/test/Assembler/2003-06-30-RecursiveTypeProblem.ll
deleted file mode 100644
index 1a5d8b50e384..000000000000
--- a/release_23/test/Assembler/2003-06-30-RecursiveTypeProblem.ll
+++ /dev/null
@@ -1,3 +0,0 @@
-; RUN: llvm-as < %s -o /dev/null -f
-
-%MidFnTy = type void (%MidFnTy*)
diff --git a/release_23/test/Assembler/2003-08-20-ConstantExprGEP-Fold.ll b/release_23/test/Assembler/2003-08-20-ConstantExprGEP-Fold.ll
deleted file mode 100644
index 6f31f16778f6..000000000000
--- a/release_23/test/Assembler/2003-08-20-ConstantExprGEP-Fold.ll
+++ /dev/null
@@ -1,16 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine -simplifycfg | llvm-dis | not grep br
-
-@.str_1 = internal constant [6 x i8] c"_Bool\00" ; <[6 x i8]*> [#uses=2]
-
-define i32 @test() {
- %tmp.54 = load i8* getelementptr ([6 x i8]* @.str_1, i64 0, i64 1) ; <i8> [#uses=1]
- %tmp.55 = icmp ne i8 %tmp.54, 66 ; <i1> [#uses=1]
- br i1 %tmp.55, label %then.7, label %endif.7
-
-then.7: ; preds = %then.7, %0
- br label %then.7
-
-endif.7: ; preds = %0
- ret i32 0
-}
-
diff --git a/release_23/test/Assembler/2003-08-21-ConstantExprCast-Fold.ll b/release_23/test/Assembler/2003-08-21-ConstantExprCast-Fold.ll
deleted file mode 100644
index b76f7745849e..000000000000
--- a/release_23/test/Assembler/2003-08-21-ConstantExprCast-Fold.ll
+++ /dev/null
@@ -1,4 +0,0 @@
-; RUN: llvm-as < %s | llvm-dis | not grep getelementptr
-
-@A = external global { float } ; <{ float }*> [#uses=2]
-global i32* bitcast ({ float }* @A to i32*) ; <i32**>:0 [#uses=0]
diff --git a/release_23/test/Assembler/2003-10-04-NotMergingGlobalConstants.ll b/release_23/test/Assembler/2003-10-04-NotMergingGlobalConstants.ll
deleted file mode 100644
index 9acea591bf63..000000000000
--- a/release_23/test/Assembler/2003-10-04-NotMergingGlobalConstants.ll
+++ /dev/null
@@ -1,6 +0,0 @@
-; RUN: llvm-as < %s -o /dev/null -f
-
-%T = type i32
-@X = global i32* null ; <i32**> [#uses=0]
-@Y = global i32* null ; <i32**> [#uses=0]
-
diff --git a/release_23/test/Assembler/2003-11-05-ConstantExprShift.ll b/release_23/test/Assembler/2003-11-05-ConstantExprShift.ll
deleted file mode 100644
index 86b093e35129..000000000000
--- a/release_23/test/Assembler/2003-11-05-ConstantExprShift.ll
+++ /dev/null
@@ -1,5 +0,0 @@
-; RUN: llvm-as < %s | llvm-dis
-
-define i32 @test() {
- ret i32 ashr (i32 ptrtoint (i32 ()* @test to i32), i32 2)
-}
diff --git a/release_23/test/Assembler/2003-11-11-ImplicitRename.ll b/release_23/test/Assembler/2003-11-11-ImplicitRename.ll
deleted file mode 100644
index 0f858b417cc0..000000000000
--- a/release_23/test/Assembler/2003-11-11-ImplicitRename.ll
+++ /dev/null
@@ -1,8 +0,0 @@
-; RUN: not llvm-as < %s > /dev/null
-
-void %test() {
- %X = add int 0, 1
- %X = add int 1, 2
- ret void
-}
-
diff --git a/release_23/test/Assembler/2003-11-12-ConstantExprCast.ll b/release_23/test/Assembler/2003-11-12-ConstantExprCast.ll
deleted file mode 100644
index 149fef2276e4..000000000000
--- a/release_23/test/Assembler/2003-11-12-ConstantExprCast.ll
+++ /dev/null
@@ -1,10 +0,0 @@
-; RUN: llvm-as < %s | llvm-dis | not grep { bitcast (}
-
-@.Base64_1 = external constant [4 x i8] ; <[4 x i8]*> [#uses=1]
-
-define i8 @test(i8 %Y) {
- %X = bitcast i8 %Y to i8 ; <i8> [#uses=1]
- %tmp.13 = add i8 %X, sub (i8 0, i8 ptrtoint ([4 x i8]* @.Base64_1 to i8)) ; <i8> [#uses=1]
- ret i8 %tmp.13
-}
-
diff --git a/release_23/test/Assembler/2003-11-24-SymbolTableCrash.ll b/release_23/test/Assembler/2003-11-24-SymbolTableCrash.ll
deleted file mode 100644
index 4b2cbdcc0376..000000000000
--- a/release_23/test/Assembler/2003-11-24-SymbolTableCrash.ll
+++ /dev/null
@@ -1,11 +0,0 @@
-; RUN: not llvm-as < %s |& not grep Asserti
-; RUN: not llvm-as < %s |& grep Redefinition
-
-define void @test() {
- %tmp.1 = add i32 0, 1
- br label %return
-return:
- %tmp.1 = add i32 0, 1
- ret void
-}
-
diff --git a/release_23/test/Assembler/2003-12-30-TypeMapInvalidMemory.ll b/release_23/test/Assembler/2003-12-30-TypeMapInvalidMemory.ll
deleted file mode 100644
index a0f99c63d8fe..000000000000
--- a/release_23/test/Assembler/2003-12-30-TypeMapInvalidMemory.ll
+++ /dev/null
@@ -1,55 +0,0 @@
-; RUN: not llvm-as < %s -o /dev/null -f |& grep {Undefined type remains}
-; END.
-
-@d_reduction_0_dparser_gram = global {
- i32 (i8*, i8**, i32, i32, {
- %struct.Grammar*, void (\4, %struct.d_loc_t*, i8**)*, %struct.D_Scope*,
- void (\4)*, { i32, %struct.d_loc_t, i8*, i8*, %struct.D_Scope*,
- void (\8, %struct.d_loc_t*, i8**)*, %struct.Grammar*,
- %struct.ParseNode_User }* (\4, i32, { i32, %struct.d_loc_t, i8*, i8*,
- %struct.D_Scope*, void (\9, %struct.d_loc_t*, i8**)*, %struct.Grammar*,
- %struct.ParseNode_User }**)*,
- void ({ i32, %struct.d_loc_t, i8*, i8*, %struct.D_Scope*,
- void (\8, %struct.d_loc_t*, i8**)*,
- %struct.Grammar*, %struct.ParseNode_User }*)*,
- %struct.d_loc_t, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32,
- i32 }*)*,
- i32 (i8*, i8**, i32, i32, { %struct.Grammar*,
- void (\4, %struct.d_loc_t*, i8**)*, %struct.D_Scope*, void (\4)*, {
- i32, %struct.d_loc_t, i8*, i8*, %struct.D_Scope*,
- void (\8, %struct.d_loc_t*, i8**)*, %struct.Grammar*,
- %struct.ParseNode_User }* (\4, i32, { i32, %struct.d_loc_t, i8*, i8*,
- %struct.D_Scope*, void (\9, %struct.d_loc_t*, i8**)*,
- %struct.Grammar*, %struct.ParseNode_User }**)*,
- void ({ i32, %struct.d_loc_t, i8*, i8*, %struct.D_Scope*,
- void (\8, %struct.d_loc_t*, i8**)*, %struct.Grammar*,
- %struct.ParseNode_User }*)*, %struct.d_loc_t, i32, i32, i32, i32,
- i32, i32, i32, i32, i32, i32, i32, i32 }*)** }
-
- { i32 (i8*, i8**, i32, i32, {
- %struct.Grammar*, void (\4, %struct.d_loc_t*, i8**)*,
- %struct.D_Scope*, void (\4)*, {
- i32, %struct.d_loc_t, i8*, i8*, %struct.D_Scope*,
- void (\8, %struct.d_loc_t*, i8**)*, %struct.Grammar*,
- %struct.ParseNode_User
- }* (\4, i32, { i32, %struct.d_loc_t, i8*, i8*, %struct.D_Scope*,
- void (\9, %struct.d_loc_t*, i8**)*, %struct.Grammar*,
- %struct.ParseNode_User }**)*,
- void ({ i32, %struct.d_loc_t, i8*, i8*, %struct.D_Scope*,
- void (\8, %struct.d_loc_t*, i8**)*, %struct.Grammar*,
- %struct.ParseNode_User }*)*,
- %struct.d_loc_t, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32,
- i32, i32 }*)* null,
- i32 (i8*, i8**, i32, i32, {
- %struct.Grammar*, void (\4, %struct.d_loc_t*, i8**)*,
- %struct.D_Scope*, void (\4)*, { i32, %struct.d_loc_t, i8*, i8*,
- %struct.D_Scope*, void (\8, %struct.d_loc_t*, i8**)*,
- %struct.Grammar*, %struct.ParseNode_User }* (\4, i32, { i32,
- %struct.d_loc_t, i8*, i8*, %struct.D_Scope*,
- void (\9, %struct.d_loc_t*, i8**)*, %struct.Grammar*,
- %struct.ParseNode_User }**)*,
- void ({ i32, %struct.d_loc_t, i8*, i8*, %struct.D_Scope*,
- void (\8, %struct.d_loc_t*, i8**)*, %struct.Grammar*,
- %struct.ParseNode_User }*)*, %struct.d_loc_t, i32, i32, i32,
- i32, i32, i32, i32, i32, i32, i32, i32, i32 }*)** null
- }
diff --git a/release_23/test/Assembler/2004-01-11-getelementptrfolding.ll b/release_23/test/Assembler/2004-01-11-getelementptrfolding.ll
deleted file mode 100644
index c22aede5df4b..000000000000
--- a/release_23/test/Assembler/2004-01-11-getelementptrfolding.ll
+++ /dev/null
@@ -1,12 +0,0 @@
-; RUN: llvm-as < %s | llvm-dis | \
-; RUN: not grep {getelementptr.*getelementptr}
-
-%struct.TTriangleItem = type { i8*, i8*, [3 x %struct.TUVVertex] }
-%struct.TUVVertex = type { i16, i16, i16, i16 }
-@data_triangleItems = internal constant [2908 x %struct.TTriangleItem] zeroinitializer; <[2908 x %struct.TTriangleItem]*> [#uses=2]
-
-define void @foo() {
- store i16 0, i16* getelementptr ([2908 x %struct.TTriangleItem]* @data_triangleItems, i64 0, i64 0, i32 2, i64 0, i32 0)
- ret void
-}
-
diff --git a/release_23/test/Assembler/2004-01-20-MaxLongLong.ll b/release_23/test/Assembler/2004-01-20-MaxLongLong.ll
deleted file mode 100644
index 8af5332ccc67..000000000000
--- a/release_23/test/Assembler/2004-01-20-MaxLongLong.ll
+++ /dev/null
@@ -1,4 +0,0 @@
-; RUN: llvm-as < %s | llvm-dis | grep 9223372036854775808
-
-global i64 -9223372036854775808
-
diff --git a/release_23/test/Assembler/2004-02-01-NegativeZero.ll b/release_23/test/Assembler/2004-02-01-NegativeZero.ll
deleted file mode 100644
index b28930f2852c..000000000000
--- a/release_23/test/Assembler/2004-02-01-NegativeZero.ll
+++ /dev/null
@@ -1,5 +0,0 @@
-; RUN: llvm-as < %s | llvm-dis | grep -- -0.0
-
-global double 0x8000000000000000
-global float -0.0
-
diff --git a/release_23/test/Assembler/2004-02-27-SelfUseAssertError.ll b/release_23/test/Assembler/2004-02-27-SelfUseAssertError.ll
deleted file mode 100644
index 73a9f5422b98..000000000000
--- a/release_23/test/Assembler/2004-02-27-SelfUseAssertError.ll
+++ /dev/null
@@ -1,25 +0,0 @@
-; RUN: llvm-as < %s -o /dev/null -f
-
-; %inc2 uses it's own value, but that's ok, as it's unreachable!
-
-define void @test() {
-entry:
- ret void
-
-no_exit.2: ; preds = %endif.6
- %tmp.103 = fcmp olt double 0.000000e+00, 0.000000e+00 ; <i1> [#uses=1]
- br i1 %tmp.103, label %endif.6, label %else.0
-
-else.0: ; preds = %no_exit.2
- store i16 0, i16* null
- br label %endif.6
-
-endif.6: ; preds = %else.0, %no_exit.2
- %inc.2 = add i32 %inc.2, 1 ; <i32> [#uses=2]
- %tmp.96 = icmp slt i32 %inc.2, 0 ; <i1> [#uses=1]
- br i1 %tmp.96, label %no_exit.2, label %UnifiedReturnBlock1
-
-UnifiedReturnBlock1: ; preds = %endif.6
- ret void
-}
-
diff --git a/release_23/test/Assembler/2004-03-07-FunctionAddressAlignment.ll b/release_23/test/Assembler/2004-03-07-FunctionAddressAlignment.ll
deleted file mode 100644
index e3bf0bb8ac78..000000000000
--- a/release_23/test/Assembler/2004-03-07-FunctionAddressAlignment.ll
+++ /dev/null
@@ -1,15 +0,0 @@
-; RUN: llvm-as < %s | llvm-dis | not grep ptrtoint
-; All of these should be eliminable
-
-
-define i32 @foo() {
- ret i32 and (i32 ptrtoint (i32()* @foo to i32), i32 1)
-}
-
-define i32 @foo2() {
- ret i32 and (i32 1, i32 ptrtoint (i32()* @foo2 to i32))
-}
-
-define i1 @foo3() {
- ret i1 icmp ne (i1()* @foo3, i1()* null)
-}
diff --git a/release_23/test/Assembler/2004-03-30-UnclosedFunctionCrash.ll b/release_23/test/Assembler/2004-03-30-UnclosedFunctionCrash.ll
deleted file mode 100644
index 62a713871bfb..000000000000
--- a/release_23/test/Assembler/2004-03-30-UnclosedFunctionCrash.ll
+++ /dev/null
@@ -1,3 +0,0 @@
-; RUN: not llvm-as %s |& grep error
-
-void %foo() {
diff --git a/release_23/test/Assembler/2004-04-04-GetElementPtrIndexTypes.ll b/release_23/test/Assembler/2004-04-04-GetElementPtrIndexTypes.ll
deleted file mode 100644
index 73ce7e68ce49..000000000000
--- a/release_23/test/Assembler/2004-04-04-GetElementPtrIndexTypes.ll
+++ /dev/null
@@ -1,10 +0,0 @@
-; RUN: llvm-as < %s -o /dev/null -f
-
-define i32* @t1({ float, i32 }* %X) {
- %W = getelementptr { float, i32 }* %X, i32 20, i32 1 ; <i32*> [#uses=0]
- %X.upgrd.1 = getelementptr { float, i32 }* %X, i64 20, i32 1 ; <i32*> [#uses=0]
- %Y = getelementptr { float, i32 }* %X, i64 20, i32 1 ; <i32*> [#uses=1]
- %Z = getelementptr { float, i32 }* %X, i64 20, i32 1 ; <i32*> [#uses=0]
- ret i32* %Y
-}
-
diff --git a/release_23/test/Assembler/2004-06-07-VerifierBug.ll b/release_23/test/Assembler/2004-06-07-VerifierBug.ll
deleted file mode 100644
index 07d2383ccff9..000000000000
--- a/release_23/test/Assembler/2004-06-07-VerifierBug.ll
+++ /dev/null
@@ -1,11 +0,0 @@
-; RUN: llvm-as < %s > /dev/null
-
-define void @t() {
-entry:
- ret void
-
-loop: ; preds = %loop
- %tmp.4.i9 = getelementptr i32* null, i32 %tmp.5.i10 ; <i32*> [#uses=1]
- %tmp.5.i10 = load i32* %tmp.4.i9 ; <i32> [#uses=1]
- br label %loop
-}
diff --git a/release_23/test/Assembler/2004-09-29-VerifierIsReallySlow.ll b/release_23/test/Assembler/2004-09-29-VerifierIsReallySlow.ll
deleted file mode 100644
index 3d1db5419da6..000000000000
--- a/release_23/test/Assembler/2004-09-29-VerifierIsReallySlow.ll
+++ /dev/null
@@ -1,24452 +0,0 @@
-; Check to see that the verifier does not take an outrageous amount of time on
-; this testcase.
-; RUN: llvm-as < %s -o /dev/null -f
-
-%"complex long double" = type { double, double }
-%"struct.std::dcomplex" = type { %"complex long double" }
-
-declare %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_(%"struct.std::dcomplex"*, %"struct.std::dcomplex"*)
-
-declare %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_(%"struct.std::dcomplex"*, %"struct.std::dcomplex"*)
-
-declare %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_(%"struct.std::dcomplex"*, %"struct.std::dcomplex"*)
-
-define void @_Z11determinantPA6_St8dcomplex(%"struct.std::dcomplex"* %agg.result, [6 x %"struct.std::dcomplex"]* %_m) {
-entry:
- %mem_tmp.i34350 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i34336 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i34322 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i34308 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i34294 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i34280 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i34266 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i34252 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i34238 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i34224 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i34210 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i34196 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i34182 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i34168 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i34134 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i34080 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i34066 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i34052 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i34038 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i34024 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i34010 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i33996 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i33982 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i33968 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i33954 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i33940 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i33926 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i33912 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i33898 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i33864 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i33810 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i33796 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i33782 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i33768 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i33754 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i33740 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i33726 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i33712 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i33698 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i33684 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i33670 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i33656 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i33642 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i33628 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i33594 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i33540 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i33526 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i33512 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i33498 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i33484 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i33470 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i33456 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i33442 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i33428 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i33414 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i33400 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i33386 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i33372 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i33358 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i33324 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i33270 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i33214 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i33200 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i33186 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i33172 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i33158 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i33144 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i33130 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i33116 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i33102 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i33088 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i33074 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i33060 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i33046 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i33032 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i32998 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i32944 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i32930 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i32916 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i32902 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i32888 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i32874 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i32860 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i32846 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i32832 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i32818 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i32804 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i32790 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i32776 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i32762 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i32728 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i32674 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i32660 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i32646 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i32632 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i32618 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i32604 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i32590 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i32576 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i32562 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i32548 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i32534 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i32520 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i32506 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i32492 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i32458 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i32404 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i32390 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i32376 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i32362 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i32348 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i32334 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i32320 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i32306 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i32292 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i32278 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i32264 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i32250 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i32236 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i32222 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i32188 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i32134 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i32078 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i32064 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i32050 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i32036 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i32022 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i32008 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i31994 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i31980 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i31966 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i31952 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i31938 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i31924 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i31910 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i31896 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i31862 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i31808 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i31794 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i31780 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i31766 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i31752 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i31738 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i31724 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i31710 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i31696 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i31682 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i31668 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i31654 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i31640 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i31626 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i31592 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i31538 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i31524 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i31510 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i31496 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i31482 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i31468 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i31454 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i31440 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i31426 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i31412 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i31398 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i31384 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i31370 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i31356 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i31322 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i31268 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i31254 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i31240 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i31226 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i31212 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i31198 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i31184 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i31170 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i31156 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i31142 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i31128 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i31114 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i31100 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i31086 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i31052 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i30998 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i30942 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i30928 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i30914 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i30900 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i30886 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i30872 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i30858 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i30844 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i30830 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i30816 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i30802 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i30788 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i30774 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i30760 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i30726 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i30672 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i30658 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i30644 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i30630 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i30616 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i30602 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i30588 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i30574 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i30560 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i30546 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i30532 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i30518 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i30504 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i30490 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i30456 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i30402 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i30388 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i30374 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i30360 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i30346 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i30332 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i30318 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i30304 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i30290 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i30276 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i30262 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i30248 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i30234 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i30220 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i30186 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i30132 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i30118 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i30104 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i30090 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i30076 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i30062 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i30048 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i30034 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i30020 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i30006 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i29992 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i29978 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i29964 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i29950 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i29916 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i29862 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i29806 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i29792 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i29778 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i29764 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i29750 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i29736 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i29722 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i29708 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i29694 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i29680 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i29666 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i29652 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i29638 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i29624 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i29590 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i29536 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i29522 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i29508 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i29494 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i29480 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i29466 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i29452 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i29438 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i29424 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i29410 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i29396 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i29382 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i29368 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i29354 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i29320 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i29266 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i29252 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i29238 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i29224 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i29210 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i29196 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i29182 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i29168 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i29154 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i29140 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i29126 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i29112 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i29098 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i29084 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i29050 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i28996 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i28982 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i28968 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i28954 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i28940 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i28926 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i28912 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i28898 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i28884 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i28870 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i28856 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i28842 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i28828 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i28814 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i28780 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i28726 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i28670 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i28614 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i28600 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i28586 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i28572 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i28558 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i28544 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i28530 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i28516 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i28502 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i28488 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i28474 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i28460 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i28446 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i28432 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i28398 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i28344 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i28330 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i28316 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i28302 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i28288 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i28274 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i28260 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i28246 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i28232 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i28218 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i28204 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i28190 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i28176 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i28162 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i28128 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i28074 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i28060 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i28046 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i28032 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i28018 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i28004 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i27990 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i27976 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i27962 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i27948 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i27934 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i27920 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i27906 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i27892 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i27858 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i27804 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i27790 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i27776 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i27762 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i27748 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i27734 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i27720 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i27706 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i27692 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i27678 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i27664 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i27650 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i27636 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i27622 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i27588 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i27534 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i27478 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i27464 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i27450 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i27436 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i27422 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i27408 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i27394 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i27380 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i27366 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i27352 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i27338 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i27324 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i27310 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i27296 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i27262 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i27208 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i27194 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i27180 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i27166 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i27152 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i27138 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i27124 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i27110 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i27096 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i27082 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i27068 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i27054 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i27040 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i27026 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i26992 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i26938 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i26924 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i26910 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i26896 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i26882 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i26868 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i26854 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i26840 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i26826 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i26812 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i26798 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i26784 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i26770 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i26756 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i26722 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i26668 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i26654 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i26640 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i26626 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i26612 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i26598 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i26584 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i26570 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i26556 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i26542 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i26528 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i26514 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i26500 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i26486 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i26452 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i26398 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i26342 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i26328 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i26314 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i26300 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i26286 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i26272 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i26258 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i26244 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i26230 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i26216 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i26202 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i26188 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i26174 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i26160 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i26126 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i26072 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i26058 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i26044 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i26030 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i26016 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i26002 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i25988 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i25974 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i25960 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i25946 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i25932 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i25918 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i25904 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i25890 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i25856 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i25802 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i25788 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i25774 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i25760 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i25746 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i25732 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i25718 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i25704 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i25690 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i25676 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i25662 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i25648 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i25634 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i25620 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i25586 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i25532 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i25518 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i25504 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i25490 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i25476 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i25462 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i25448 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i25434 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i25420 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i25406 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i25392 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i25378 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i25364 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i25350 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i25316 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i25262 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i25206 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i25192 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i25178 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i25164 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i25150 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i25136 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i25122 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i25108 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i25094 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i25080 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i25066 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i25052 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i25038 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i25024 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i24990 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i24936 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i24922 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i24908 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i24894 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i24880 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i24866 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i24852 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i24838 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i24824 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i24810 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i24796 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i24782 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i24768 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i24754 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i24720 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i24666 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i24652 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i24638 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i24624 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i24610 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i24596 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i24582 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i24568 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i24554 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i24540 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i24526 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i24512 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i24498 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i24484 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i24450 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i24396 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i24382 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i24368 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i24354 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i24340 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i24326 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i24312 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i24298 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i24284 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i24270 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i24256 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i24242 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i24228 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i24214 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i24180 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i24126 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i24070 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i24056 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i24042 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i24028 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i24014 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i24000 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i23986 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i23972 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i23958 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i23944 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i23930 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i23916 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i23902 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i23888 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i23854 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i23800 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i23786 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i23772 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i23758 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i23744 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i23730 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i23716 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i23702 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i23688 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i23674 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i23660 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i23646 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i23632 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i23618 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i23584 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i23530 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i23516 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i23502 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i23488 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i23474 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i23460 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i23446 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i23432 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i23418 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i23404 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i23390 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i23376 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i23362 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i23348 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i23314 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i23260 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i23246 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i23232 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i23218 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i23204 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i23190 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i23176 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i23162 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i23148 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i23134 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i23120 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i23106 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i23092 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i23078 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i23044 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i22990 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i22934 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i22878 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i22864 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i22850 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i22836 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i22822 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i22808 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i22794 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i22780 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i22766 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i22752 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i22738 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i22724 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i22710 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i22696 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i22662 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i22608 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i22594 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i22580 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i22566 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i22552 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i22538 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i22524 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i22510 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i22496 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i22482 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i22468 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i22454 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i22440 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i22426 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i22392 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i22338 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i22324 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i22310 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i22296 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i22282 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i22268 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i22254 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i22240 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i22226 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i22212 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i22198 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i22184 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i22170 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i22156 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i22122 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i22068 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i22054 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i22040 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i22026 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i22012 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i21998 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i21984 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i21970 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i21956 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i21942 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i21928 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i21914 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i21900 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i21886 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i21852 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i21798 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i21742 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i21728 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i21714 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i21700 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i21686 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i21672 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i21658 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i21644 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i21630 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i21616 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i21602 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i21588 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i21574 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i21560 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i21526 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i21472 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i21458 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i21444 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i21430 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i21416 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i21402 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i21388 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i21374 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i21360 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i21346 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i21332 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i21318 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i21304 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i21290 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i21256 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i21202 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i21188 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i21174 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i21160 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i21146 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i21132 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i21118 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i21104 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i21090 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i21076 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i21062 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i21048 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i21034 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i21020 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i20986 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i20932 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i20918 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i20904 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i20890 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i20876 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i20862 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i20848 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i20834 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i20820 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i20806 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i20792 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i20778 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i20764 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i20750 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i20716 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i20662 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i20606 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i20592 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i20578 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i20564 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i20550 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i20536 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i20522 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i20508 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i20494 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i20480 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i20466 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i20452 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i20438 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i20424 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i20390 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i20336 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i20322 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i20308 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i20294 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i20280 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i20266 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i20252 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i20238 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i20224 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i20210 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i20196 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i20182 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i20168 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i20154 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i20120 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i20066 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i20052 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i20038 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i20024 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i20010 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i19996 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i19982 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i19968 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i19954 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i19940 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i19926 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i19912 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i19898 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i19884 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i19850 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i19796 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i19782 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i19768 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i19754 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i19740 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i19726 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i19712 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i19698 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i19684 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i19670 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i19656 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i19642 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i19628 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i19614 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i19580 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i19526 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i19470 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i19456 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i19442 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i19428 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i19414 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i19400 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i19386 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i19372 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i19358 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i19344 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i19330 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i19316 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i19302 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i19288 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i19254 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i19200 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i19186 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i19172 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i19158 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i19144 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i19130 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i19116 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i19102 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i19088 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i19074 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i19060 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i19046 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i19032 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i19018 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i18984 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i18930 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i18916 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i18902 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i18888 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i18874 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i18860 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i18846 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i18832 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i18818 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i18804 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i18790 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i18776 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i18762 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i18748 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i18714 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i18660 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i18646 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i18632 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i18618 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i18604 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i18590 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i18576 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i18562 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i18548 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i18534 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i18520 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i18506 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i18492 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i18478 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i18444 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i18390 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i18334 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i18320 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i18306 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i18292 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i18278 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i18264 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i18250 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i18236 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i18222 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i18208 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i18194 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i18180 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i18166 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i18152 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i18118 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i18064 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i18050 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i18036 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i18022 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i18008 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i17994 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i17980 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i17966 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i17952 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i17938 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i17924 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i17910 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i17896 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i17882 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i17848 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i17794 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i17780 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i17766 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i17752 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i17738 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i17724 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i17710 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i17696 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i17682 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i17668 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i17654 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i17640 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i17626 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i17612 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i17578 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i17524 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i17510 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i17496 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i17482 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i17468 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i17454 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i17440 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i17426 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i17412 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i17398 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i17384 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i17370 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i17356 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i17342 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i17308 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i17254 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i17198 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i17142 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i17128 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i17114 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i17100 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i17086 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i17072 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i17058 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i17044 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i17030 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i17016 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i17002 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i16988 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i16974 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i16960 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i16926 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i16872 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i16858 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i16844 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i16830 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i16816 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i16802 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i16788 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i16774 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i16760 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i16746 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i16732 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i16718 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i16704 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i16690 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i16656 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i16602 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i16588 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i16574 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i16560 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i16546 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i16532 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i16518 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i16504 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i16490 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i16476 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i16462 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i16448 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i16434 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i16420 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i16386 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i16332 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i16318 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i16304 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i16290 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i16276 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i16262 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i16248 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i16234 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i16220 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i16206 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i16192 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i16178 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i16164 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i16150 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i16116 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i16062 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i16006 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i15992 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i15978 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i15964 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i15950 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i15936 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i15922 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i15908 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i15894 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i15880 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i15866 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i15852 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i15838 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i15824 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i15790 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i15736 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i15722 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i15708 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i15694 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i15680 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i15666 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i15652 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i15638 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i15624 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i15610 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i15596 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i15582 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i15568 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i15554 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i15520 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i15466 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i15452 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i15438 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i15424 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i15410 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i15396 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i15382 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i15368 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i15354 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i15340 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i15326 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i15312 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i15298 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i15284 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i15250 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i15196 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i15182 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i15168 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i15154 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i15140 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i15126 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i15112 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i15098 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i15084 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i15070 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i15056 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i15042 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i15028 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i15014 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i14980 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i14926 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i14870 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i14856 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i14842 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i14828 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i14814 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i14800 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i14786 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i14772 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i14758 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i14744 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i14730 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i14716 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i14702 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i14688 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i14654 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i14600 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i14586 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i14572 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i14558 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i14544 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i14530 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i14516 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i14502 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i14488 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i14474 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i14460 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i14446 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i14432 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i14418 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i14384 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i14330 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i14316 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i14302 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i14288 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i14274 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i14260 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i14246 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i14232 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i14218 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i14204 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i14190 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i14176 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i14162 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i14148 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i14114 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i14060 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i14046 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i14032 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i14018 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i14004 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i13990 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i13976 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i13962 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i13948 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i13934 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i13920 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i13906 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i13892 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i13878 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i13844 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i13790 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i13734 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i13720 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i13706 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i13692 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i13678 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i13664 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i13650 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i13636 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i13622 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i13608 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i13594 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i13580 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i13566 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i13552 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i13518 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i13464 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i13450 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i13436 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i13422 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i13408 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i13394 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i13380 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i13366 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i13352 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i13338 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i13324 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i13310 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i13296 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i13282 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i13248 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i13194 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i13180 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i13166 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i13152 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i13138 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i13124 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i13110 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i13096 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i13082 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i13068 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i13054 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i13040 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i13026 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i13012 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i12978 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i12924 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i12910 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i12896 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i12882 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i12868 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i12854 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i12840 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i12826 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i12812 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i12798 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i12784 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i12770 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i12756 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i12742 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i12708 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i12654 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i12598 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i12584 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i12570 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i12556 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i12542 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i12528 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i12514 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i12500 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i12486 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i12472 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i12458 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i12444 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i12430 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i12416 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i12382 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i12328 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i12314 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i12300 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i12286 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i12272 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i12258 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i12244 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i12230 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i12216 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i12202 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i12188 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i12174 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i12160 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i12146 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i12112 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i12058 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i12044 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i12030 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i12016 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i12002 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i11988 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i11974 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i11960 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i11946 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i11932 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i11918 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i11904 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i11890 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i11876 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i11842 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i11788 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i11774 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i11760 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i11746 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i11732 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i11718 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i11704 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i11690 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i11676 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i11662 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i11648 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i11634 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i11620 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i11606 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i11572 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i11518 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i11462 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i11406 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i11392 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i11378 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i11364 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i11350 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i11336 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i11322 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i11308 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i11294 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i11280 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i11266 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i11252 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i11238 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i11224 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i11190 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i11136 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i11122 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i11108 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i11094 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i11080 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i11066 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i11052 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i11038 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i11024 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i11010 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i10996 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i10982 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i10968 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i10954 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i10920 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i10866 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i10852 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i10838 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i10824 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i10810 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i10796 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i10782 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i10768 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i10754 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i10740 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i10726 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i10712 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i10698 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i10684 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i10650 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i10596 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i10582 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i10568 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i10554 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i10540 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i10526 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i10512 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i10498 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i10484 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i10470 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i10456 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i10442 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i10428 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i10414 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i10380 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i10326 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i10270 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i10256 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i10242 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i10228 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i10214 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i10200 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i10186 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i10172 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i10158 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i10144 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i10130 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i10116 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i10102 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i10088 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i10054 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i10000 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i9986 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i9972 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i9958 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i9944 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i9930 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i9916 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i9902 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i9888 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i9874 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i9860 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i9846 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i9832 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i9818 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i9784 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i9730 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i9716 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i9702 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i9688 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i9674 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i9660 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i9646 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i9632 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i9618 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i9604 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i9590 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i9576 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i9562 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i9548 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i9514 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i9460 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i9446 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i9432 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i9418 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i9404 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i9390 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i9376 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i9362 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i9348 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i9334 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i9320 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i9306 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i9292 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i9278 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i9244 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i9190 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i9134 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i9120 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i9106 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i9092 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i9078 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i9064 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i9050 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i9036 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i9022 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i9008 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i8994 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i8980 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i8966 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i8952 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i8918 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i8864 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i8850 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i8836 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i8822 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i8808 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i8794 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i8780 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i8766 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i8752 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i8738 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i8724 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i8710 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i8696 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i8682 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i8648 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i8594 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i8580 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i8566 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i8552 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i8538 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i8524 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i8510 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i8496 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i8482 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i8468 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i8454 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i8440 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i8426 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i8412 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i8378 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i8324 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i8310 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i8296 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i8282 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i8268 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i8254 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i8240 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i8226 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i8212 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i8198 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i8184 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i8170 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i8156 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i8142 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i8108 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i8054 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i7998 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i7984 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i7970 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i7956 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i7942 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i7928 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i7914 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i7900 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i7886 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i7872 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i7858 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i7844 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i7830 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i7816 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i7782 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i7728 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i7714 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i7700 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i7686 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i7672 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i7658 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i7644 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i7630 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i7616 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i7602 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i7588 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i7574 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i7560 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i7546 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i7512 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i7458 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i7444 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i7430 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i7416 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i7402 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i7388 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i7374 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i7360 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i7346 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i7332 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i7318 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i7304 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i7290 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i7276 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i7242 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i7188 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i7174 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i7160 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i7146 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i7132 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i7118 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i7104 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i7090 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i7076 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i7062 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i7048 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i7034 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i7020 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i7006 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i6972 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i6918 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i6862 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i6848 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i6834 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i6820 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i6806 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i6792 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i6778 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i6764 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i6750 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i6736 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i6722 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i6708 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i6694 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i6680 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i6646 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i6592 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i6578 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i6564 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i6550 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i6536 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i6522 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i6508 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i6494 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i6480 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i6466 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i6452 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i6438 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i6424 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i6410 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i6376 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i6322 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i6308 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i6294 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i6280 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i6266 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i6252 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i6238 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i6224 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i6210 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i6196 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i6182 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i6168 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i6154 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i6140 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i6106 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i6052 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i6038 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i6024 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i6010 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i5996 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i5982 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i5968 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i5954 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i5940 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i5926 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i5912 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i5898 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i5884 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i5870 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i5836 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i5782 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i5726 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i5670 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i5656 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i5642 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i5628 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i5614 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i5600 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i5586 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i5572 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i5558 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i5544 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i5530 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i5516 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i5502 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i5488 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i5454 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i5400 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i5386 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i5372 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i5358 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i5344 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i5330 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i5316 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i5302 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i5288 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i5274 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i5260 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i5246 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i5232 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i5218 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i5184 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i5130 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i5116 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i5102 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i5088 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i5074 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i5060 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i5046 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i5032 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i5018 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i5004 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i4990 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i4976 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i4962 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i4948 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i4914 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i4860 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i4846 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i4832 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i4818 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i4804 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i4790 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i4776 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i4762 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i4748 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i4734 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i4720 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i4706 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i4692 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i4678 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i4644 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i4590 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i4534 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i4520 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i4506 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i4492 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i4478 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i4464 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i4450 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i4436 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i4422 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i4408 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i4394 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i4380 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i4366 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i4352 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i4318 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i4264 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i4250 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i4236 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i4222 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i4208 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i4194 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i4180 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i4166 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i4152 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i4138 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i4124 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i4110 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i4096 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i4082 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i4048 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i3994 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i3980 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i3966 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i3952 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i3938 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i3924 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i3910 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i3896 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i3882 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i3868 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i3854 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i3840 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i3826 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i3812 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i3778 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i3724 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i3710 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i3696 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i3682 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i3668 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i3654 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i3640 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i3626 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i3612 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i3598 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i3584 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i3570 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i3556 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i3542 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i3508 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i3454 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i3398 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i3384 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i3370 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i3356 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i3342 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i3328 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i3314 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i3300 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i3286 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i3272 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i3258 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i3244 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i3230 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i3216 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i3182 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i3128 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i3114 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i3100 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i3086 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i3072 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i3058 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i3044 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i3030 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i3016 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i3002 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i2988 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i2974 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i2960 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i2946 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i2912 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i2858 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i2844 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i2830 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i2816 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i2802 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i2788 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i2774 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i2760 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i2746 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i2732 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i2718 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i2704 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i2690 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i2676 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i2642 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i2588 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i2574 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i2560 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i2546 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i2532 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i2518 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i2504 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i2490 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i2476 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i2462 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i2448 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i2434 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i2420 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i2406 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i2372 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i2318 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i2262 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i2248 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i2234 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i2220 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i2206 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i2192 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i2178 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i2164 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i2150 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i2136 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i2122 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i2108 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i2094 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i2080 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i2046 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i1992 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i1978 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i1964 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i1950 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i1936 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i1922 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i1908 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i1894 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i1880 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i1866 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i1852 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i1838 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i1824 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i1810 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i1776 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i1722 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i1708 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i1694 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i1680 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i1666 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i1652 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i1638 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i1624 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i1610 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i1596 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i1582 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i1568 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i1554 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i1540 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i1506 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i1452 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i1438 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i1424 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i1410 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i1396 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i1382 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i1368 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i1354 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i1340 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i1326 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i1312 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i1298 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i1284 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i1270 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i1236 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i1182 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i1126 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i1112 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i1098 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i1084 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i1070 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i1056 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i1042 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i1028 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i1014 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i1000 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i986 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i972 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i958 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i944 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i910 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i856 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i842 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i828 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i814 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i800 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i786 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i772 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i758 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i744 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i730 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i716 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i702 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i688 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i674 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i640 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i586 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i572 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i558 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i544 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i530 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i516 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i502 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i488 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i474 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i460 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i446 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i432 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i418 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i404 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i370 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i316 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i302 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i288 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i274 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i260 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i246 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i232 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i218 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i204 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i190 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i176 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i162 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i148 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i134 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i100 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i46 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.i = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %ret5 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=8]
- %ret4 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=32]
- %ret3 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=122]
- %mem_tmp.5 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.6 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.9 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.10 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.13 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.20 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.21 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.24 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.25 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.28 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.35 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.36 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.39 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.40 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.43 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.50 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.51 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.54 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.55 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.58 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.66 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.67 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.70 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.71 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.74 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.81 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.82 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.85 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.86 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.89 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.96 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.97 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.100 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.101 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.104 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.111 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.112 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.115 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.116 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.119 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.127 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.128 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.131 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.132 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.135 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.142 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.143 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.146 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.147 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.150 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.157 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.158 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.161 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.162 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.165 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.172 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.173 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.176 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.177 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.180 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.188 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.189 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.192 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.193 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.196 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.203 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.204 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.207 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.208 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.211 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.218 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.219 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.222 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.223 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.226 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.233 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.234 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.237 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.238 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.241 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.249 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.250 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.253 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.254 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.257 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.264 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.265 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.268 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.269 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.272 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.279 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.280 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.283 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.284 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.287 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.294 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.295 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.298 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.299 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.302 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.311 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.312 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.315 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.316 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.319 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.326 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.327 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.330 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.331 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.334 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.341 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.342 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.345 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.346 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.349 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.356 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.357 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.360 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.361 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.364 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.372 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.373 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.376 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.377 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.380 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.387 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.388 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.391 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.392 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.395 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.402 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.403 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.406 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.407 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.410 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.417 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.418 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.421 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.422 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.425 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.433 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.434 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.437 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.438 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.441 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.448 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.449 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.452 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.453 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.456 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.463 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.464 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.467 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.468 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.471 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.478 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.479 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.482 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.483 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.486 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.494 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.495 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.498 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.499 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.502 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.509 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.510 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.513 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.514 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.517 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.524 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.525 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.528 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.529 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.532 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.539 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.540 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.543 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.544 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.547 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.555 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.556 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.559 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.560 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.563 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.570 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.571 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.574 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.575 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.578 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.585 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.586 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.589 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.590 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.593 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.600 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.601 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.604 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.605 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.608 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.617 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.618 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.621 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.622 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.625 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.632 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.633 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.636 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.637 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.640 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.647 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.648 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.651 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.652 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.655 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.662 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.663 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.666 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.667 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.670 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.678 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.679 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.682 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.683 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.686 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.693 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.694 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.697 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.698 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.701 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.708 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.709 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.712 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.713 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.716 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.723 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.724 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.727 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.728 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.731 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.739 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.740 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.743 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.744 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.747 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.754 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.755 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.758 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.759 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.762 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.769 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.770 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.773 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.774 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.777 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.784 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.785 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.788 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.789 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.792 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.800 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.801 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.804 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.805 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.808 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.815 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.816 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.819 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.820 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.823 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.830 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.831 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.834 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.835 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.838 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.845 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.846 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.849 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.850 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.853 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.861 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.862 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.865 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.866 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.869 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.876 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.877 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.880 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.881 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.884 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.891 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.892 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.895 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.896 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.899 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.906 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.907 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.910 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.911 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.914 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.923 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.924 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.927 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.928 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.931 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.938 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.939 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.942 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.943 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.946 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.953 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.954 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.957 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.958 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.961 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.968 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.969 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.972 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.973 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.976 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.984 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.985 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.988 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.989 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.992 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.999 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1000 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1003 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1004 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1007 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1014 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1015 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1018 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1019 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1022 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1029 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1030 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1033 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1034 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1037 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1045 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1046 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1049 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1050 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1053 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1060 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1061 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1064 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1065 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1068 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1075 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1076 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1079 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1080 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1083 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1090 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1091 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1094 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1095 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1098 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1106 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1107 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1110 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1111 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1114 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1121 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1122 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1125 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1126 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1129 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1136 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1137 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1140 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1141 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1144 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1151 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1152 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1155 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1156 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1159 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1167 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1168 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1171 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1172 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1175 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1182 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1183 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1186 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1187 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1190 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1197 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1198 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1201 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1202 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1205 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1212 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1213 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1216 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1217 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1220 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1229 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1230 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1233 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1234 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1237 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1244 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1245 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1248 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1249 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1252 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1259 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1260 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1263 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1264 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1267 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1274 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1275 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1278 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1279 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1282 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1290 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1291 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1294 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1295 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1298 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1305 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1306 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1309 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1310 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1313 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1320 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1321 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1324 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1325 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1328 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1335 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1336 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1339 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1340 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1343 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1351 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1352 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1355 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1356 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1359 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1366 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1367 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1370 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1371 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1374 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1381 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1382 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1385 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1386 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1389 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1396 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1397 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1400 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1401 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1404 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1412 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1413 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1416 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1417 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1420 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1427 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1428 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1431 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1432 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1435 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1442 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1443 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1446 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1447 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1450 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1457 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1458 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1461 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1462 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1465 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1473 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1474 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1477 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1478 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1481 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1488 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1489 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1492 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1493 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1496 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1503 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1504 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1507 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1508 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1511 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1518 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1519 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1522 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1523 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1526 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1535 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1536 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1539 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1540 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1543 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1550 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1551 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1554 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1555 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1558 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1565 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1566 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1569 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1570 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1573 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1580 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1581 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1584 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1585 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1588 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1596 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1597 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1600 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1601 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1604 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1611 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1612 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1615 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1616 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1619 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1626 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1627 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1630 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1631 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1634 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1641 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1642 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1645 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1646 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1649 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1657 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1658 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1661 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1662 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1665 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1672 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1673 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1676 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1677 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1680 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1687 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1688 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1691 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1692 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1695 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1702 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1703 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1706 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1707 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1710 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1718 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1719 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1722 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1723 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1726 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1733 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1734 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1737 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1738 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1741 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1748 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1749 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1752 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1753 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1756 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1763 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1764 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1767 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1768 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1771 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1779 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1780 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1783 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1784 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1787 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1794 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1795 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1798 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1799 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1802 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1809 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1810 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1813 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1814 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1817 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1824 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1825 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1828 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1829 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %mem_tmp.1832 = alloca %"struct.std::dcomplex" ; <%"struct.std::dcomplex"*> [#uses=3]
- %tmp.2.i = getelementptr %"struct.std::dcomplex"* %agg.result, i32 0, i32 0, i32 0 ; <double*> [#uses=13]
- store double 0.000000e+00, double* %tmp.2.i
- %tmp.6.i = getelementptr %"struct.std::dcomplex"* %agg.result, i32 0, i32 0, i32 1 ; <double*> [#uses=13]
- store double 0.000000e+00, double* %tmp.6.i
- %tmp.2.i34368 = getelementptr %"struct.std::dcomplex"* %ret5, i32 0, i32 0, i32 0 ; <double*> [#uses=66]
- store double 0.000000e+00, double* %tmp.2.i34368
- %tmp.6.i34369 = getelementptr %"struct.std::dcomplex"* %ret5, i32 0, i32 0, i32 1 ; <double*> [#uses=66]
- store double 0.000000e+00, double* %tmp.6.i34369
- %tmp.2.i34366 = getelementptr %"struct.std::dcomplex"* %ret4, i32 0, i32 0, i32 0 ; <double*> [#uses=270]
- store double 0.000000e+00, double* %tmp.2.i34366
- %tmp.6.i34367 = getelementptr %"struct.std::dcomplex"* %ret4, i32 0, i32 0, i32 1 ; <double*> [#uses=270]
- store double 0.000000e+00, double* %tmp.6.i34367
- %tmp.2.i34364 = getelementptr %"struct.std::dcomplex"* %ret3, i32 0, i32 0, i32 0 ; <double*> [#uses=121]
- store double 0.000000e+00, double* %tmp.2.i34364
- %tmp.6.i34365 = getelementptr %"struct.std::dcomplex"* %ret3, i32 0, i32 0, i32 1 ; <double*> [#uses=121]
- store double 0.000000e+00, double* %tmp.6.i34365
- %tmp.6 = getelementptr [6 x %"struct.std::dcomplex"]* %_m, i32 1, i32 1 ; <%"struct.std::dcomplex"*> [#uses=120]
- %tmp.4.i34351 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i34350, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.5.i34352 = getelementptr [6 x %"struct.std::dcomplex"]* %_m, i32 0, i32 0, i32 0, i32 0 ; <double*> [#uses=120]
- %tmp.6.i34353 = load double* %tmp.5.i34352 ; <double> [#uses=1]
- store double %tmp.6.i34353, double* %tmp.4.i34351
- %tmp.7.i34354 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i34350, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.8.i34355 = getelementptr [6 x %"struct.std::dcomplex"]* %_m, i32 0, i32 0, i32 0, i32 1 ; <double*> [#uses=120]
- %tmp.9.i34356 = load double* %tmp.8.i34355 ; <double> [#uses=1]
- store double %tmp.9.i34356, double* %tmp.7.i34354
- %tmp.0.i34357 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i34350, %"struct.std::dcomplex"* %tmp.6 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i34359 = getelementptr %"struct.std::dcomplex"* %tmp.0.i34357, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i34360 = load double* %tmp.14.i34359 ; <double> [#uses=1]
- %tmp.17.i34362 = getelementptr %"struct.std::dcomplex"* %tmp.0.i34357, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i34363 = load double* %tmp.17.i34362 ; <double> [#uses=1]
- %tmp.12 = getelementptr [6 x %"struct.std::dcomplex"]* %_m, i32 1, i32 0 ; <%"struct.std::dcomplex"*> [#uses=120]
- %tmp.4.i34337 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i34336, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.5.i34338 = getelementptr [6 x %"struct.std::dcomplex"]* %_m, i32 0, i32 1, i32 0, i32 0 ; <double*> [#uses=120]
- %tmp.6.i34339 = load double* %tmp.5.i34338 ; <double> [#uses=1]
- store double %tmp.6.i34339, double* %tmp.4.i34337
- %tmp.7.i34340 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i34336, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.8.i34341 = getelementptr [6 x %"struct.std::dcomplex"]* %_m, i32 0, i32 1, i32 0, i32 1 ; <double*> [#uses=120]
- %tmp.9.i34342 = load double* %tmp.8.i34341 ; <double> [#uses=1]
- store double %tmp.9.i34342, double* %tmp.7.i34340
- %tmp.0.i34343 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i34336, %"struct.std::dcomplex"* %tmp.12 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i34344 = getelementptr %"struct.std::dcomplex"* %mem_tmp.5, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i34345 = getelementptr %"struct.std::dcomplex"* %tmp.0.i34343, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i34346 = load double* %tmp.14.i34345 ; <double> [#uses=1]
- store double %tmp.15.i34346, double* %tmp.13.i34344
- %tmp.16.i34347 = getelementptr %"struct.std::dcomplex"* %mem_tmp.5, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i34348 = getelementptr %"struct.std::dcomplex"* %tmp.0.i34343, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i34349 = load double* %tmp.17.i34348 ; <double> [#uses=1]
- store double %tmp.18.i34349, double* %tmp.16.i34347
- %tmp.4.i34323 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i34322, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i34360, double* %tmp.4.i34323
- %tmp.7.i34326 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i34322, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i34363, double* %tmp.7.i34326
- %tmp.0.i34329 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i34322, %"struct.std::dcomplex"* %mem_tmp.5 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i34331 = getelementptr %"struct.std::dcomplex"* %tmp.0.i34329, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i34332 = load double* %tmp.14.i34331 ; <double> [#uses=1]
- %tmp.17.i34334 = getelementptr %"struct.std::dcomplex"* %tmp.0.i34329, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i34335 = load double* %tmp.17.i34334 ; <double> [#uses=1]
- %tmp.15 = getelementptr [6 x %"struct.std::dcomplex"]* %_m, i32 2, i32 2 ; <%"struct.std::dcomplex"*> [#uses=60]
- %tmp.4.i34309 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i34308, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i34332, double* %tmp.4.i34309
- %tmp.7.i34312 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i34308, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i34335, double* %tmp.7.i34312
- %tmp.0.i34315 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i34308, %"struct.std::dcomplex"* %tmp.15 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i34317 = getelementptr %"struct.std::dcomplex"* %tmp.0.i34315, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i34318 = load double* %tmp.14.i34317 ; <double> [#uses=1]
- %tmp.17.i34320 = getelementptr %"struct.std::dcomplex"* %tmp.0.i34315, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i34321 = load double* %tmp.17.i34320 ; <double> [#uses=1]
- %tmp.21 = getelementptr [6 x %"struct.std::dcomplex"]* %_m, i32 1, i32 2 ; <%"struct.std::dcomplex"*> [#uses=120]
- %tmp.4.i34295 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i34294, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i34297 = load double* %tmp.5.i34338 ; <double> [#uses=1]
- store double %tmp.6.i34297, double* %tmp.4.i34295
- %tmp.7.i34298 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i34294, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i34300 = load double* %tmp.8.i34341 ; <double> [#uses=1]
- store double %tmp.9.i34300, double* %tmp.7.i34298
- %tmp.0.i34301 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i34294, %"struct.std::dcomplex"* %tmp.21 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i34303 = getelementptr %"struct.std::dcomplex"* %tmp.0.i34301, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i34304 = load double* %tmp.14.i34303 ; <double> [#uses=1]
- %tmp.17.i34306 = getelementptr %"struct.std::dcomplex"* %tmp.0.i34301, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i34307 = load double* %tmp.17.i34306 ; <double> [#uses=1]
- %tmp.4.i34281 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i34280, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.5.i34282 = getelementptr [6 x %"struct.std::dcomplex"]* %_m, i32 0, i32 2, i32 0, i32 0 ; <double*> [#uses=120]
- %tmp.6.i34283 = load double* %tmp.5.i34282 ; <double> [#uses=1]
- store double %tmp.6.i34283, double* %tmp.4.i34281
- %tmp.7.i34284 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i34280, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.8.i34285 = getelementptr [6 x %"struct.std::dcomplex"]* %_m, i32 0, i32 2, i32 0, i32 1 ; <double*> [#uses=120]
- %tmp.9.i34286 = load double* %tmp.8.i34285 ; <double> [#uses=1]
- store double %tmp.9.i34286, double* %tmp.7.i34284
- %tmp.0.i34287 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i34280, %"struct.std::dcomplex"* %tmp.6 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i34288 = getelementptr %"struct.std::dcomplex"* %mem_tmp.9, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i34289 = getelementptr %"struct.std::dcomplex"* %tmp.0.i34287, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i34290 = load double* %tmp.14.i34289 ; <double> [#uses=1]
- store double %tmp.15.i34290, double* %tmp.13.i34288
- %tmp.16.i34291 = getelementptr %"struct.std::dcomplex"* %mem_tmp.9, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i34292 = getelementptr %"struct.std::dcomplex"* %tmp.0.i34287, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i34293 = load double* %tmp.17.i34292 ; <double> [#uses=1]
- store double %tmp.18.i34293, double* %tmp.16.i34291
- %tmp.4.i34267 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i34266, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i34304, double* %tmp.4.i34267
- %tmp.7.i34270 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i34266, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i34307, double* %tmp.7.i34270
- %tmp.0.i34273 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i34266, %"struct.std::dcomplex"* %mem_tmp.9 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i34275 = getelementptr %"struct.std::dcomplex"* %tmp.0.i34273, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i34276 = load double* %tmp.14.i34275 ; <double> [#uses=1]
- %tmp.17.i34278 = getelementptr %"struct.std::dcomplex"* %tmp.0.i34273, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i34279 = load double* %tmp.17.i34278 ; <double> [#uses=1]
- %tmp.30 = getelementptr [6 x %"struct.std::dcomplex"]* %_m, i32 2, i32 0 ; <%"struct.std::dcomplex"*> [#uses=60]
- %tmp.4.i34253 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i34252, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i34276, double* %tmp.4.i34253
- %tmp.7.i34256 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i34252, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i34279, double* %tmp.7.i34256
- %tmp.0.i34259 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i34252, %"struct.std::dcomplex"* %tmp.30 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i34260 = getelementptr %"struct.std::dcomplex"* %mem_tmp.6, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i34261 = getelementptr %"struct.std::dcomplex"* %tmp.0.i34259, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i34262 = load double* %tmp.14.i34261 ; <double> [#uses=1]
- store double %tmp.15.i34262, double* %tmp.13.i34260
- %tmp.16.i34263 = getelementptr %"struct.std::dcomplex"* %mem_tmp.6, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i34264 = getelementptr %"struct.std::dcomplex"* %tmp.0.i34259, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i34265 = load double* %tmp.17.i34264 ; <double> [#uses=1]
- store double %tmp.18.i34265, double* %tmp.16.i34263
- %tmp.4.i34239 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i34238, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i34318, double* %tmp.4.i34239
- %tmp.7.i34242 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i34238, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i34321, double* %tmp.7.i34242
- %tmp.0.i34245 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i34238, %"struct.std::dcomplex"* %mem_tmp.6 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i34247 = getelementptr %"struct.std::dcomplex"* %tmp.0.i34245, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i34248 = load double* %tmp.14.i34247 ; <double> [#uses=1]
- %tmp.17.i34250 = getelementptr %"struct.std::dcomplex"* %tmp.0.i34245, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i34251 = load double* %tmp.17.i34250 ; <double> [#uses=1]
- %tmp.4.i34225 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i34224, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i34227 = load double* %tmp.5.i34282 ; <double> [#uses=1]
- store double %tmp.6.i34227, double* %tmp.4.i34225
- %tmp.7.i34228 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i34224, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i34230 = load double* %tmp.8.i34285 ; <double> [#uses=1]
- store double %tmp.9.i34230, double* %tmp.7.i34228
- %tmp.0.i34231 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i34224, %"struct.std::dcomplex"* %tmp.12 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i34233 = getelementptr %"struct.std::dcomplex"* %tmp.0.i34231, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i34234 = load double* %tmp.14.i34233 ; <double> [#uses=1]
- %tmp.17.i34236 = getelementptr %"struct.std::dcomplex"* %tmp.0.i34231, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i34237 = load double* %tmp.17.i34236 ; <double> [#uses=1]
- %tmp.4.i34211 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i34210, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i34213 = load double* %tmp.5.i34352 ; <double> [#uses=1]
- store double %tmp.6.i34213, double* %tmp.4.i34211
- %tmp.7.i34214 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i34210, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i34216 = load double* %tmp.8.i34355 ; <double> [#uses=1]
- store double %tmp.9.i34216, double* %tmp.7.i34214
- %tmp.0.i34217 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i34210, %"struct.std::dcomplex"* %tmp.21 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i34218 = getelementptr %"struct.std::dcomplex"* %mem_tmp.13, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i34219 = getelementptr %"struct.std::dcomplex"* %tmp.0.i34217, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i34220 = load double* %tmp.14.i34219 ; <double> [#uses=1]
- store double %tmp.15.i34220, double* %tmp.13.i34218
- %tmp.16.i34221 = getelementptr %"struct.std::dcomplex"* %mem_tmp.13, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i34222 = getelementptr %"struct.std::dcomplex"* %tmp.0.i34217, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i34223 = load double* %tmp.17.i34222 ; <double> [#uses=1]
- store double %tmp.18.i34223, double* %tmp.16.i34221
- %tmp.4.i34197 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i34196, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i34234, double* %tmp.4.i34197
- %tmp.7.i34200 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i34196, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i34237, double* %tmp.7.i34200
- %tmp.0.i34203 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i34196, %"struct.std::dcomplex"* %mem_tmp.13 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i34205 = getelementptr %"struct.std::dcomplex"* %tmp.0.i34203, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i34206 = load double* %tmp.14.i34205 ; <double> [#uses=1]
- %tmp.17.i34208 = getelementptr %"struct.std::dcomplex"* %tmp.0.i34203, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i34209 = load double* %tmp.17.i34208 ; <double> [#uses=1]
- %tmp.45 = getelementptr [6 x %"struct.std::dcomplex"]* %_m, i32 2, i32 1 ; <%"struct.std::dcomplex"*> [#uses=60]
- %tmp.4.i34183 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i34182, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i34206, double* %tmp.4.i34183
- %tmp.7.i34186 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i34182, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i34209, double* %tmp.7.i34186
- %tmp.0.i34189 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i34182, %"struct.std::dcomplex"* %tmp.45 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i34190 = getelementptr %"struct.std::dcomplex"* %mem_tmp.10, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i34191 = getelementptr %"struct.std::dcomplex"* %tmp.0.i34189, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i34192 = load double* %tmp.14.i34191 ; <double> [#uses=1]
- store double %tmp.15.i34192, double* %tmp.13.i34190
- %tmp.16.i34193 = getelementptr %"struct.std::dcomplex"* %mem_tmp.10, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i34194 = getelementptr %"struct.std::dcomplex"* %tmp.0.i34189, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i34195 = load double* %tmp.17.i34194 ; <double> [#uses=1]
- store double %tmp.18.i34195, double* %tmp.16.i34193
- %tmp.4.i34169 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i34168, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i34248, double* %tmp.4.i34169
- %tmp.7.i34172 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i34168, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i34251, double* %tmp.7.i34172
- %tmp.0.i34175 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i34168, %"struct.std::dcomplex"* %mem_tmp.10 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i34177 = getelementptr %"struct.std::dcomplex"* %tmp.0.i34175, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i34178 = load double* %tmp.14.i34177 ; <double> [#uses=1]
- %tmp.17.i34180 = getelementptr %"struct.std::dcomplex"* %tmp.0.i34175, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i34181 = load double* %tmp.17.i34180 ; <double> [#uses=1]
- store double %tmp.15.i34178, double* %tmp.2.i34364
- store double %tmp.18.i34181, double* %tmp.6.i34365
- %tmp.4.i34135 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i34134, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.5.i34136 = getelementptr [6 x %"struct.std::dcomplex"]* %_m, i32 3, i32 3, i32 0, i32 0 ; <double*> [#uses=20]
- %tmp.6.i34137 = load double* %tmp.5.i34136 ; <double> [#uses=1]
- store double %tmp.6.i34137, double* %tmp.4.i34135
- %tmp.7.i34138 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i34134, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.8.i34139 = getelementptr [6 x %"struct.std::dcomplex"]* %_m, i32 3, i32 3, i32 0, i32 1 ; <double*> [#uses=20]
- %tmp.9.i34140 = load double* %tmp.8.i34139 ; <double> [#uses=1]
- store double %tmp.9.i34140, double* %tmp.7.i34138
- %tmp.0.i34141 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i34134, %"struct.std::dcomplex"* %ret3 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i34143 = getelementptr %"struct.std::dcomplex"* %tmp.0.i34141, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i34144 = load double* %tmp.14.i34143 ; <double> [#uses=1]
- %tmp.17.i34146 = getelementptr %"struct.std::dcomplex"* %tmp.0.i34141, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i34147 = load double* %tmp.17.i34146 ; <double> [#uses=1]
- %tmp.7.i34101 = load double* %tmp.2.i34366 ; <double> [#uses=1]
- %tmp.15.i34115 = add double %tmp.7.i34101, %tmp.15.i34144 ; <double> [#uses=1]
- store double %tmp.15.i34115, double* %tmp.2.i34366
- %tmp.26.i34122 = load double* %tmp.6.i34367 ; <double> [#uses=1]
- %tmp.31.i34133 = add double %tmp.26.i34122, %tmp.18.i34147 ; <double> [#uses=1]
- store double %tmp.31.i34133, double* %tmp.6.i34367
- %tmp.4.i34081 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i34080, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.5.i34082 = getelementptr [6 x %"struct.std::dcomplex"]* %_m, i32 0, i32 3, i32 0, i32 0 ; <double*> [#uses=120]
- %tmp.6.i34083 = load double* %tmp.5.i34082 ; <double> [#uses=1]
- store double %tmp.6.i34083, double* %tmp.4.i34081
- %tmp.7.i34084 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i34080, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.8.i34085 = getelementptr [6 x %"struct.std::dcomplex"]* %_m, i32 0, i32 3, i32 0, i32 1 ; <double*> [#uses=120]
- %tmp.9.i34086 = load double* %tmp.8.i34085 ; <double> [#uses=1]
- store double %tmp.9.i34086, double* %tmp.7.i34084
- %tmp.0.i34087 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i34080, %"struct.std::dcomplex"* %tmp.21 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i34089 = getelementptr %"struct.std::dcomplex"* %tmp.0.i34087, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i34090 = load double* %tmp.14.i34089 ; <double> [#uses=1]
- %tmp.17.i34092 = getelementptr %"struct.std::dcomplex"* %tmp.0.i34087, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i34093 = load double* %tmp.17.i34092 ; <double> [#uses=1]
- %tmp.62 = getelementptr [6 x %"struct.std::dcomplex"]* %_m, i32 1, i32 3 ; <%"struct.std::dcomplex"*> [#uses=120]
- %tmp.4.i34067 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i34066, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i34069 = load double* %tmp.5.i34282 ; <double> [#uses=1]
- store double %tmp.6.i34069, double* %tmp.4.i34067
- %tmp.7.i34070 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i34066, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i34072 = load double* %tmp.8.i34285 ; <double> [#uses=1]
- store double %tmp.9.i34072, double* %tmp.7.i34070
- %tmp.0.i34073 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i34066, %"struct.std::dcomplex"* %tmp.62 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i34074 = getelementptr %"struct.std::dcomplex"* %mem_tmp.20, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i34075 = getelementptr %"struct.std::dcomplex"* %tmp.0.i34073, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i34076 = load double* %tmp.14.i34075 ; <double> [#uses=1]
- store double %tmp.15.i34076, double* %tmp.13.i34074
- %tmp.16.i34077 = getelementptr %"struct.std::dcomplex"* %mem_tmp.20, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i34078 = getelementptr %"struct.std::dcomplex"* %tmp.0.i34073, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i34079 = load double* %tmp.17.i34078 ; <double> [#uses=1]
- store double %tmp.18.i34079, double* %tmp.16.i34077
- %tmp.4.i34053 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i34052, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i34090, double* %tmp.4.i34053
- %tmp.7.i34056 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i34052, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i34093, double* %tmp.7.i34056
- %tmp.0.i34059 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i34052, %"struct.std::dcomplex"* %mem_tmp.20 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i34061 = getelementptr %"struct.std::dcomplex"* %tmp.0.i34059, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i34062 = load double* %tmp.14.i34061 ; <double> [#uses=1]
- %tmp.17.i34064 = getelementptr %"struct.std::dcomplex"* %tmp.0.i34059, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i34065 = load double* %tmp.17.i34064 ; <double> [#uses=1]
- %tmp.4.i34039 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i34038, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i34062, double* %tmp.4.i34039
- %tmp.7.i34042 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i34038, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i34065, double* %tmp.7.i34042
- %tmp.0.i34045 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i34038, %"struct.std::dcomplex"* %tmp.45 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i34047 = getelementptr %"struct.std::dcomplex"* %tmp.0.i34045, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i34048 = load double* %tmp.14.i34047 ; <double> [#uses=1]
- %tmp.17.i34050 = getelementptr %"struct.std::dcomplex"* %tmp.0.i34045, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i34051 = load double* %tmp.17.i34050 ; <double> [#uses=1]
- %tmp.4.i34025 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i34024, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i34027 = load double* %tmp.5.i34338 ; <double> [#uses=1]
- store double %tmp.6.i34027, double* %tmp.4.i34025
- %tmp.7.i34028 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i34024, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i34030 = load double* %tmp.8.i34341 ; <double> [#uses=1]
- store double %tmp.9.i34030, double* %tmp.7.i34028
- %tmp.0.i34031 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i34024, %"struct.std::dcomplex"* %tmp.62 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i34033 = getelementptr %"struct.std::dcomplex"* %tmp.0.i34031, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i34034 = load double* %tmp.14.i34033 ; <double> [#uses=1]
- %tmp.17.i34036 = getelementptr %"struct.std::dcomplex"* %tmp.0.i34031, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i34037 = load double* %tmp.17.i34036 ; <double> [#uses=1]
- %tmp.4.i34011 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i34010, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i34013 = load double* %tmp.5.i34082 ; <double> [#uses=1]
- store double %tmp.6.i34013, double* %tmp.4.i34011
- %tmp.7.i34014 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i34010, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i34016 = load double* %tmp.8.i34085 ; <double> [#uses=1]
- store double %tmp.9.i34016, double* %tmp.7.i34014
- %tmp.0.i34017 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i34010, %"struct.std::dcomplex"* %tmp.6 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i34018 = getelementptr %"struct.std::dcomplex"* %mem_tmp.24, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i34019 = getelementptr %"struct.std::dcomplex"* %tmp.0.i34017, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i34020 = load double* %tmp.14.i34019 ; <double> [#uses=1]
- store double %tmp.15.i34020, double* %tmp.13.i34018
- %tmp.16.i34021 = getelementptr %"struct.std::dcomplex"* %mem_tmp.24, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i34022 = getelementptr %"struct.std::dcomplex"* %tmp.0.i34017, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i34023 = load double* %tmp.17.i34022 ; <double> [#uses=1]
- store double %tmp.18.i34023, double* %tmp.16.i34021
- %tmp.4.i33997 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33996, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i34034, double* %tmp.4.i33997
- %tmp.7.i34000 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33996, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i34037, double* %tmp.7.i34000
- %tmp.0.i34003 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i33996, %"struct.std::dcomplex"* %mem_tmp.24 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i34005 = getelementptr %"struct.std::dcomplex"* %tmp.0.i34003, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i34006 = load double* %tmp.14.i34005 ; <double> [#uses=1]
- %tmp.17.i34008 = getelementptr %"struct.std::dcomplex"* %tmp.0.i34003, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i34009 = load double* %tmp.17.i34008 ; <double> [#uses=1]
- %tmp.4.i33983 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33982, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i34006, double* %tmp.4.i33983
- %tmp.7.i33986 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33982, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i34009, double* %tmp.7.i33986
- %tmp.0.i33989 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i33982, %"struct.std::dcomplex"* %tmp.15 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i33990 = getelementptr %"struct.std::dcomplex"* %mem_tmp.21, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i33991 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33989, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i33992 = load double* %tmp.14.i33991 ; <double> [#uses=1]
- store double %tmp.15.i33992, double* %tmp.13.i33990
- %tmp.16.i33993 = getelementptr %"struct.std::dcomplex"* %mem_tmp.21, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i33994 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33989, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i33995 = load double* %tmp.17.i33994 ; <double> [#uses=1]
- store double %tmp.18.i33995, double* %tmp.16.i33993
- %tmp.4.i33969 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33968, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i34048, double* %tmp.4.i33969
- %tmp.7.i33972 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33968, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i34051, double* %tmp.7.i33972
- %tmp.0.i33975 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i33968, %"struct.std::dcomplex"* %mem_tmp.21 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i33977 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33975, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i33978 = load double* %tmp.14.i33977 ; <double> [#uses=1]
- %tmp.17.i33980 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33975, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i33981 = load double* %tmp.17.i33980 ; <double> [#uses=1]
- %tmp.4.i33955 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33954, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i33957 = load double* %tmp.5.i34282 ; <double> [#uses=1]
- store double %tmp.6.i33957, double* %tmp.4.i33955
- %tmp.7.i33958 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33954, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i33960 = load double* %tmp.8.i34285 ; <double> [#uses=1]
- store double %tmp.9.i33960, double* %tmp.7.i33958
- %tmp.0.i33961 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i33954, %"struct.std::dcomplex"* %tmp.6 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i33963 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33961, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i33964 = load double* %tmp.14.i33963 ; <double> [#uses=1]
- %tmp.17.i33966 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33961, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i33967 = load double* %tmp.17.i33966 ; <double> [#uses=1]
- %tmp.4.i33941 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33940, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i33943 = load double* %tmp.5.i34338 ; <double> [#uses=1]
- store double %tmp.6.i33943, double* %tmp.4.i33941
- %tmp.7.i33944 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33940, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i33946 = load double* %tmp.8.i34341 ; <double> [#uses=1]
- store double %tmp.9.i33946, double* %tmp.7.i33944
- %tmp.0.i33947 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i33940, %"struct.std::dcomplex"* %tmp.21 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i33948 = getelementptr %"struct.std::dcomplex"* %mem_tmp.28, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i33949 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33947, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i33950 = load double* %tmp.14.i33949 ; <double> [#uses=1]
- store double %tmp.15.i33950, double* %tmp.13.i33948
- %tmp.16.i33951 = getelementptr %"struct.std::dcomplex"* %mem_tmp.28, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i33952 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33947, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i33953 = load double* %tmp.17.i33952 ; <double> [#uses=1]
- store double %tmp.18.i33953, double* %tmp.16.i33951
- %tmp.4.i33927 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33926, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i33964, double* %tmp.4.i33927
- %tmp.7.i33930 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33926, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i33967, double* %tmp.7.i33930
- %tmp.0.i33933 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i33926, %"struct.std::dcomplex"* %mem_tmp.28 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i33935 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33933, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i33936 = load double* %tmp.14.i33935 ; <double> [#uses=1]
- %tmp.17.i33938 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33933, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i33939 = load double* %tmp.17.i33938 ; <double> [#uses=1]
- %tmp.95 = getelementptr [6 x %"struct.std::dcomplex"]* %_m, i32 2, i32 3 ; <%"struct.std::dcomplex"*> [#uses=60]
- %tmp.4.i33913 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33912, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i33936, double* %tmp.4.i33913
- %tmp.7.i33916 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33912, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i33939, double* %tmp.7.i33916
- %tmp.0.i33919 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i33912, %"struct.std::dcomplex"* %tmp.95 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i33920 = getelementptr %"struct.std::dcomplex"* %mem_tmp.25, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i33921 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33919, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i33922 = load double* %tmp.14.i33921 ; <double> [#uses=1]
- store double %tmp.15.i33922, double* %tmp.13.i33920
- %tmp.16.i33923 = getelementptr %"struct.std::dcomplex"* %mem_tmp.25, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i33924 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33919, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i33925 = load double* %tmp.17.i33924 ; <double> [#uses=1]
- store double %tmp.18.i33925, double* %tmp.16.i33923
- %tmp.4.i33899 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33898, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i33978, double* %tmp.4.i33899
- %tmp.7.i33902 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33898, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i33981, double* %tmp.7.i33902
- %tmp.0.i33905 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i33898, %"struct.std::dcomplex"* %mem_tmp.25 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i33907 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33905, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i33908 = load double* %tmp.14.i33907 ; <double> [#uses=1]
- %tmp.17.i33910 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33905, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i33911 = load double* %tmp.17.i33910 ; <double> [#uses=1]
- store double %tmp.15.i33908, double* %tmp.2.i34364
- store double %tmp.18.i33911, double* %tmp.6.i34365
- %tmp.4.i33865 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33864, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.5.i33866 = getelementptr [6 x %"struct.std::dcomplex"]* %_m, i32 3, i32 0, i32 0, i32 0 ; <double*> [#uses=20]
- %tmp.6.i33867 = load double* %tmp.5.i33866 ; <double> [#uses=1]
- store double %tmp.6.i33867, double* %tmp.4.i33865
- %tmp.7.i33868 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33864, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.8.i33869 = getelementptr [6 x %"struct.std::dcomplex"]* %_m, i32 3, i32 0, i32 0, i32 1 ; <double*> [#uses=20]
- %tmp.9.i33870 = load double* %tmp.8.i33869 ; <double> [#uses=1]
- store double %tmp.9.i33870, double* %tmp.7.i33868
- %tmp.0.i33871 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i33864, %"struct.std::dcomplex"* %ret3 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i33873 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33871, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i33874 = load double* %tmp.14.i33873 ; <double> [#uses=1]
- %tmp.17.i33876 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33871, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i33877 = load double* %tmp.17.i33876 ; <double> [#uses=1]
- %tmp.7.i33831 = load double* %tmp.2.i34366 ; <double> [#uses=1]
- %tmp.15.i33845 = add double %tmp.7.i33831, %tmp.15.i33874 ; <double> [#uses=1]
- store double %tmp.15.i33845, double* %tmp.2.i34366
- %tmp.26.i33852 = load double* %tmp.6.i34367 ; <double> [#uses=1]
- %tmp.31.i33863 = add double %tmp.26.i33852, %tmp.18.i33877 ; <double> [#uses=1]
- store double %tmp.31.i33863, double* %tmp.6.i34367
- %tmp.4.i33811 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33810, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i33813 = load double* %tmp.5.i34352 ; <double> [#uses=1]
- store double %tmp.6.i33813, double* %tmp.4.i33811
- %tmp.7.i33814 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33810, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i33816 = load double* %tmp.8.i34355 ; <double> [#uses=1]
- store double %tmp.9.i33816, double* %tmp.7.i33814
- %tmp.0.i33817 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i33810, %"struct.std::dcomplex"* %tmp.21 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i33819 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33817, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i33820 = load double* %tmp.14.i33819 ; <double> [#uses=1]
- %tmp.17.i33822 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33817, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i33823 = load double* %tmp.17.i33822 ; <double> [#uses=1]
- %tmp.4.i33797 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33796, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i33799 = load double* %tmp.5.i34282 ; <double> [#uses=1]
- store double %tmp.6.i33799, double* %tmp.4.i33797
- %tmp.7.i33800 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33796, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i33802 = load double* %tmp.8.i34285 ; <double> [#uses=1]
- store double %tmp.9.i33802, double* %tmp.7.i33800
- %tmp.0.i33803 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i33796, %"struct.std::dcomplex"* %tmp.12 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i33804 = getelementptr %"struct.std::dcomplex"* %mem_tmp.35, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i33805 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33803, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i33806 = load double* %tmp.14.i33805 ; <double> [#uses=1]
- store double %tmp.15.i33806, double* %tmp.13.i33804
- %tmp.16.i33807 = getelementptr %"struct.std::dcomplex"* %mem_tmp.35, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i33808 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33803, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i33809 = load double* %tmp.17.i33808 ; <double> [#uses=1]
- store double %tmp.18.i33809, double* %tmp.16.i33807
- %tmp.4.i33783 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33782, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i33820, double* %tmp.4.i33783
- %tmp.7.i33786 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33782, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i33823, double* %tmp.7.i33786
- %tmp.0.i33789 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i33782, %"struct.std::dcomplex"* %mem_tmp.35 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i33791 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33789, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i33792 = load double* %tmp.14.i33791 ; <double> [#uses=1]
- %tmp.17.i33794 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33789, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i33795 = load double* %tmp.17.i33794 ; <double> [#uses=1]
- %tmp.4.i33769 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33768, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i33792, double* %tmp.4.i33769
- %tmp.7.i33772 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33768, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i33795, double* %tmp.7.i33772
- %tmp.0.i33775 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i33768, %"struct.std::dcomplex"* %tmp.95 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i33777 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33775, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i33778 = load double* %tmp.14.i33777 ; <double> [#uses=1]
- %tmp.17.i33780 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33775, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i33781 = load double* %tmp.17.i33780 ; <double> [#uses=1]
- %tmp.4.i33755 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33754, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i33757 = load double* %tmp.5.i34282 ; <double> [#uses=1]
- store double %tmp.6.i33757, double* %tmp.4.i33755
- %tmp.7.i33758 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33754, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i33760 = load double* %tmp.8.i34285 ; <double> [#uses=1]
- store double %tmp.9.i33760, double* %tmp.7.i33758
- %tmp.0.i33761 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i33754, %"struct.std::dcomplex"* %tmp.62 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i33763 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33761, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i33764 = load double* %tmp.14.i33763 ; <double> [#uses=1]
- %tmp.17.i33766 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33761, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i33767 = load double* %tmp.17.i33766 ; <double> [#uses=1]
- %tmp.4.i33741 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33740, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i33743 = load double* %tmp.5.i34082 ; <double> [#uses=1]
- store double %tmp.6.i33743, double* %tmp.4.i33741
- %tmp.7.i33744 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33740, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i33746 = load double* %tmp.8.i34085 ; <double> [#uses=1]
- store double %tmp.9.i33746, double* %tmp.7.i33744
- %tmp.0.i33747 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i33740, %"struct.std::dcomplex"* %tmp.21 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i33748 = getelementptr %"struct.std::dcomplex"* %mem_tmp.39, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i33749 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33747, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i33750 = load double* %tmp.14.i33749 ; <double> [#uses=1]
- store double %tmp.15.i33750, double* %tmp.13.i33748
- %tmp.16.i33751 = getelementptr %"struct.std::dcomplex"* %mem_tmp.39, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i33752 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33747, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i33753 = load double* %tmp.17.i33752 ; <double> [#uses=1]
- store double %tmp.18.i33753, double* %tmp.16.i33751
- %tmp.4.i33727 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33726, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i33764, double* %tmp.4.i33727
- %tmp.7.i33730 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33726, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i33767, double* %tmp.7.i33730
- %tmp.0.i33733 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i33726, %"struct.std::dcomplex"* %mem_tmp.39 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i33735 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33733, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i33736 = load double* %tmp.14.i33735 ; <double> [#uses=1]
- %tmp.17.i33738 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33733, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i33739 = load double* %tmp.17.i33738 ; <double> [#uses=1]
- %tmp.4.i33713 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33712, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i33736, double* %tmp.4.i33713
- %tmp.7.i33716 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33712, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i33739, double* %tmp.7.i33716
- %tmp.0.i33719 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i33712, %"struct.std::dcomplex"* %tmp.30 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i33720 = getelementptr %"struct.std::dcomplex"* %mem_tmp.36, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i33721 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33719, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i33722 = load double* %tmp.14.i33721 ; <double> [#uses=1]
- store double %tmp.15.i33722, double* %tmp.13.i33720
- %tmp.16.i33723 = getelementptr %"struct.std::dcomplex"* %mem_tmp.36, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i33724 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33719, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i33725 = load double* %tmp.17.i33724 ; <double> [#uses=1]
- store double %tmp.18.i33725, double* %tmp.16.i33723
- %tmp.4.i33699 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33698, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i33778, double* %tmp.4.i33699
- %tmp.7.i33702 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33698, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i33781, double* %tmp.7.i33702
- %tmp.0.i33705 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i33698, %"struct.std::dcomplex"* %mem_tmp.36 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i33707 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33705, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i33708 = load double* %tmp.14.i33707 ; <double> [#uses=1]
- %tmp.17.i33710 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33705, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i33711 = load double* %tmp.17.i33710 ; <double> [#uses=1]
- %tmp.4.i33685 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33684, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i33687 = load double* %tmp.5.i34082 ; <double> [#uses=1]
- store double %tmp.6.i33687, double* %tmp.4.i33685
- %tmp.7.i33688 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33684, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i33690 = load double* %tmp.8.i34085 ; <double> [#uses=1]
- store double %tmp.9.i33690, double* %tmp.7.i33688
- %tmp.0.i33691 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i33684, %"struct.std::dcomplex"* %tmp.12 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i33693 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33691, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i33694 = load double* %tmp.14.i33693 ; <double> [#uses=1]
- %tmp.17.i33696 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33691, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i33697 = load double* %tmp.17.i33696 ; <double> [#uses=1]
- %tmp.4.i33671 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33670, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i33673 = load double* %tmp.5.i34352 ; <double> [#uses=1]
- store double %tmp.6.i33673, double* %tmp.4.i33671
- %tmp.7.i33674 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33670, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i33676 = load double* %tmp.8.i34355 ; <double> [#uses=1]
- store double %tmp.9.i33676, double* %tmp.7.i33674
- %tmp.0.i33677 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i33670, %"struct.std::dcomplex"* %tmp.62 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i33678 = getelementptr %"struct.std::dcomplex"* %mem_tmp.43, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i33679 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33677, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i33680 = load double* %tmp.14.i33679 ; <double> [#uses=1]
- store double %tmp.15.i33680, double* %tmp.13.i33678
- %tmp.16.i33681 = getelementptr %"struct.std::dcomplex"* %mem_tmp.43, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i33682 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33677, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i33683 = load double* %tmp.17.i33682 ; <double> [#uses=1]
- store double %tmp.18.i33683, double* %tmp.16.i33681
- %tmp.4.i33657 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33656, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i33694, double* %tmp.4.i33657
- %tmp.7.i33660 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33656, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i33697, double* %tmp.7.i33660
- %tmp.0.i33663 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i33656, %"struct.std::dcomplex"* %mem_tmp.43 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i33665 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33663, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i33666 = load double* %tmp.14.i33665 ; <double> [#uses=1]
- %tmp.17.i33668 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33663, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i33669 = load double* %tmp.17.i33668 ; <double> [#uses=1]
- %tmp.4.i33643 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33642, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i33666, double* %tmp.4.i33643
- %tmp.7.i33646 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33642, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i33669, double* %tmp.7.i33646
- %tmp.0.i33649 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i33642, %"struct.std::dcomplex"* %tmp.15 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i33650 = getelementptr %"struct.std::dcomplex"* %mem_tmp.40, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i33651 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33649, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i33652 = load double* %tmp.14.i33651 ; <double> [#uses=1]
- store double %tmp.15.i33652, double* %tmp.13.i33650
- %tmp.16.i33653 = getelementptr %"struct.std::dcomplex"* %mem_tmp.40, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i33654 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33649, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i33655 = load double* %tmp.17.i33654 ; <double> [#uses=1]
- store double %tmp.18.i33655, double* %tmp.16.i33653
- %tmp.4.i33629 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33628, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i33708, double* %tmp.4.i33629
- %tmp.7.i33632 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33628, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i33711, double* %tmp.7.i33632
- %tmp.0.i33635 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i33628, %"struct.std::dcomplex"* %mem_tmp.40 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i33637 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33635, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i33638 = load double* %tmp.14.i33637 ; <double> [#uses=1]
- %tmp.17.i33640 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33635, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i33641 = load double* %tmp.17.i33640 ; <double> [#uses=1]
- store double %tmp.15.i33638, double* %tmp.2.i34364
- store double %tmp.18.i33641, double* %tmp.6.i34365
- %tmp.4.i33595 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33594, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.5.i33596 = getelementptr [6 x %"struct.std::dcomplex"]* %_m, i32 3, i32 1, i32 0, i32 0 ; <double*> [#uses=20]
- %tmp.6.i33597 = load double* %tmp.5.i33596 ; <double> [#uses=1]
- store double %tmp.6.i33597, double* %tmp.4.i33595
- %tmp.7.i33598 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33594, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.8.i33599 = getelementptr [6 x %"struct.std::dcomplex"]* %_m, i32 3, i32 1, i32 0, i32 1 ; <double*> [#uses=20]
- %tmp.9.i33600 = load double* %tmp.8.i33599 ; <double> [#uses=1]
- store double %tmp.9.i33600, double* %tmp.7.i33598
- %tmp.0.i33601 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i33594, %"struct.std::dcomplex"* %ret3 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i33603 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33601, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i33604 = load double* %tmp.14.i33603 ; <double> [#uses=1]
- %tmp.17.i33606 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33601, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i33607 = load double* %tmp.17.i33606 ; <double> [#uses=1]
- %tmp.7.i33561 = load double* %tmp.2.i34366 ; <double> [#uses=1]
- %tmp.15.i33575 = add double %tmp.7.i33561, %tmp.15.i33604 ; <double> [#uses=1]
- store double %tmp.15.i33575, double* %tmp.2.i34366
- %tmp.26.i33582 = load double* %tmp.6.i34367 ; <double> [#uses=1]
- %tmp.31.i33593 = add double %tmp.26.i33582, %tmp.18.i33607 ; <double> [#uses=1]
- store double %tmp.31.i33593, double* %tmp.6.i34367
- %tmp.4.i33541 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33540, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i33543 = load double* %tmp.5.i34352 ; <double> [#uses=1]
- store double %tmp.6.i33543, double* %tmp.4.i33541
- %tmp.7.i33544 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33540, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i33546 = load double* %tmp.8.i34355 ; <double> [#uses=1]
- store double %tmp.9.i33546, double* %tmp.7.i33544
- %tmp.0.i33547 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i33540, %"struct.std::dcomplex"* %tmp.62 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i33549 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33547, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i33550 = load double* %tmp.14.i33549 ; <double> [#uses=1]
- %tmp.17.i33552 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33547, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i33553 = load double* %tmp.17.i33552 ; <double> [#uses=1]
- %tmp.4.i33527 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33526, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i33529 = load double* %tmp.5.i34082 ; <double> [#uses=1]
- store double %tmp.6.i33529, double* %tmp.4.i33527
- %tmp.7.i33530 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33526, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i33532 = load double* %tmp.8.i34085 ; <double> [#uses=1]
- store double %tmp.9.i33532, double* %tmp.7.i33530
- %tmp.0.i33533 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i33526, %"struct.std::dcomplex"* %tmp.12 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i33534 = getelementptr %"struct.std::dcomplex"* %mem_tmp.50, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i33535 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33533, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i33536 = load double* %tmp.14.i33535 ; <double> [#uses=1]
- store double %tmp.15.i33536, double* %tmp.13.i33534
- %tmp.16.i33537 = getelementptr %"struct.std::dcomplex"* %mem_tmp.50, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i33538 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33533, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i33539 = load double* %tmp.17.i33538 ; <double> [#uses=1]
- store double %tmp.18.i33539, double* %tmp.16.i33537
- %tmp.4.i33513 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33512, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i33550, double* %tmp.4.i33513
- %tmp.7.i33516 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33512, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i33553, double* %tmp.7.i33516
- %tmp.0.i33519 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i33512, %"struct.std::dcomplex"* %mem_tmp.50 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i33521 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33519, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i33522 = load double* %tmp.14.i33521 ; <double> [#uses=1]
- %tmp.17.i33524 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33519, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i33525 = load double* %tmp.17.i33524 ; <double> [#uses=1]
- %tmp.4.i33499 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33498, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i33522, double* %tmp.4.i33499
- %tmp.7.i33502 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33498, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i33525, double* %tmp.7.i33502
- %tmp.0.i33505 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i33498, %"struct.std::dcomplex"* %tmp.45 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i33507 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33505, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i33508 = load double* %tmp.14.i33507 ; <double> [#uses=1]
- %tmp.17.i33510 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33505, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i33511 = load double* %tmp.17.i33510 ; <double> [#uses=1]
- %tmp.4.i33485 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33484, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i33487 = load double* %tmp.5.i34338 ; <double> [#uses=1]
- store double %tmp.6.i33487, double* %tmp.4.i33485
- %tmp.7.i33488 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33484, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i33490 = load double* %tmp.8.i34341 ; <double> [#uses=1]
- store double %tmp.9.i33490, double* %tmp.7.i33488
- %tmp.0.i33491 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i33484, %"struct.std::dcomplex"* %tmp.12 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i33493 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33491, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i33494 = load double* %tmp.14.i33493 ; <double> [#uses=1]
- %tmp.17.i33496 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33491, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i33497 = load double* %tmp.17.i33496 ; <double> [#uses=1]
- %tmp.4.i33471 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33470, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i33473 = load double* %tmp.5.i34352 ; <double> [#uses=1]
- store double %tmp.6.i33473, double* %tmp.4.i33471
- %tmp.7.i33474 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33470, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i33476 = load double* %tmp.8.i34355 ; <double> [#uses=1]
- store double %tmp.9.i33476, double* %tmp.7.i33474
- %tmp.0.i33477 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i33470, %"struct.std::dcomplex"* %tmp.6 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i33478 = getelementptr %"struct.std::dcomplex"* %mem_tmp.54, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i33479 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33477, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i33480 = load double* %tmp.14.i33479 ; <double> [#uses=1]
- store double %tmp.15.i33480, double* %tmp.13.i33478
- %tmp.16.i33481 = getelementptr %"struct.std::dcomplex"* %mem_tmp.54, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i33482 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33477, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i33483 = load double* %tmp.17.i33482 ; <double> [#uses=1]
- store double %tmp.18.i33483, double* %tmp.16.i33481
- %tmp.4.i33457 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33456, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i33494, double* %tmp.4.i33457
- %tmp.7.i33460 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33456, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i33497, double* %tmp.7.i33460
- %tmp.0.i33463 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i33456, %"struct.std::dcomplex"* %mem_tmp.54 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i33465 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33463, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i33466 = load double* %tmp.14.i33465 ; <double> [#uses=1]
- %tmp.17.i33468 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33463, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i33469 = load double* %tmp.17.i33468 ; <double> [#uses=1]
- %tmp.4.i33443 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33442, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i33466, double* %tmp.4.i33443
- %tmp.7.i33446 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33442, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i33469, double* %tmp.7.i33446
- %tmp.0.i33449 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i33442, %"struct.std::dcomplex"* %tmp.95 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i33450 = getelementptr %"struct.std::dcomplex"* %mem_tmp.51, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i33451 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33449, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i33452 = load double* %tmp.14.i33451 ; <double> [#uses=1]
- store double %tmp.15.i33452, double* %tmp.13.i33450
- %tmp.16.i33453 = getelementptr %"struct.std::dcomplex"* %mem_tmp.51, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i33454 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33449, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i33455 = load double* %tmp.17.i33454 ; <double> [#uses=1]
- store double %tmp.18.i33455, double* %tmp.16.i33453
- %tmp.4.i33429 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33428, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i33508, double* %tmp.4.i33429
- %tmp.7.i33432 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33428, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i33511, double* %tmp.7.i33432
- %tmp.0.i33435 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i33428, %"struct.std::dcomplex"* %mem_tmp.51 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i33437 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33435, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i33438 = load double* %tmp.14.i33437 ; <double> [#uses=1]
- %tmp.17.i33440 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33435, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i33441 = load double* %tmp.17.i33440 ; <double> [#uses=1]
- %tmp.4.i33415 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33414, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i33417 = load double* %tmp.5.i34082 ; <double> [#uses=1]
- store double %tmp.6.i33417, double* %tmp.4.i33415
- %tmp.7.i33418 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33414, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i33420 = load double* %tmp.8.i34085 ; <double> [#uses=1]
- store double %tmp.9.i33420, double* %tmp.7.i33418
- %tmp.0.i33421 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i33414, %"struct.std::dcomplex"* %tmp.6 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i33423 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33421, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i33424 = load double* %tmp.14.i33423 ; <double> [#uses=1]
- %tmp.17.i33426 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33421, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i33427 = load double* %tmp.17.i33426 ; <double> [#uses=1]
- %tmp.4.i33401 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33400, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i33403 = load double* %tmp.5.i34338 ; <double> [#uses=1]
- store double %tmp.6.i33403, double* %tmp.4.i33401
- %tmp.7.i33404 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33400, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i33406 = load double* %tmp.8.i34341 ; <double> [#uses=1]
- store double %tmp.9.i33406, double* %tmp.7.i33404
- %tmp.0.i33407 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i33400, %"struct.std::dcomplex"* %tmp.62 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i33408 = getelementptr %"struct.std::dcomplex"* %mem_tmp.58, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i33409 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33407, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i33410 = load double* %tmp.14.i33409 ; <double> [#uses=1]
- store double %tmp.15.i33410, double* %tmp.13.i33408
- %tmp.16.i33411 = getelementptr %"struct.std::dcomplex"* %mem_tmp.58, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i33412 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33407, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i33413 = load double* %tmp.17.i33412 ; <double> [#uses=1]
- store double %tmp.18.i33413, double* %tmp.16.i33411
- %tmp.4.i33387 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33386, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i33424, double* %tmp.4.i33387
- %tmp.7.i33390 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33386, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i33427, double* %tmp.7.i33390
- %tmp.0.i33393 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i33386, %"struct.std::dcomplex"* %mem_tmp.58 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i33395 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33393, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i33396 = load double* %tmp.14.i33395 ; <double> [#uses=1]
- %tmp.17.i33398 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33393, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i33399 = load double* %tmp.17.i33398 ; <double> [#uses=1]
- %tmp.4.i33373 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33372, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i33396, double* %tmp.4.i33373
- %tmp.7.i33376 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33372, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i33399, double* %tmp.7.i33376
- %tmp.0.i33379 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i33372, %"struct.std::dcomplex"* %tmp.30 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i33380 = getelementptr %"struct.std::dcomplex"* %mem_tmp.55, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i33381 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33379, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i33382 = load double* %tmp.14.i33381 ; <double> [#uses=1]
- store double %tmp.15.i33382, double* %tmp.13.i33380
- %tmp.16.i33383 = getelementptr %"struct.std::dcomplex"* %mem_tmp.55, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i33384 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33379, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i33385 = load double* %tmp.17.i33384 ; <double> [#uses=1]
- store double %tmp.18.i33385, double* %tmp.16.i33383
- %tmp.4.i33359 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33358, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i33438, double* %tmp.4.i33359
- %tmp.7.i33362 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33358, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i33441, double* %tmp.7.i33362
- %tmp.0.i33365 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i33358, %"struct.std::dcomplex"* %mem_tmp.55 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i33367 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33365, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i33368 = load double* %tmp.14.i33367 ; <double> [#uses=1]
- %tmp.17.i33370 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33365, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i33371 = load double* %tmp.17.i33370 ; <double> [#uses=1]
- store double %tmp.15.i33368, double* %tmp.2.i34364
- store double %tmp.18.i33371, double* %tmp.6.i34365
- %tmp.4.i33325 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33324, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.5.i33326 = getelementptr [6 x %"struct.std::dcomplex"]* %_m, i32 3, i32 2, i32 0, i32 0 ; <double*> [#uses=20]
- %tmp.6.i33327 = load double* %tmp.5.i33326 ; <double> [#uses=1]
- store double %tmp.6.i33327, double* %tmp.4.i33325
- %tmp.7.i33328 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33324, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.8.i33329 = getelementptr [6 x %"struct.std::dcomplex"]* %_m, i32 3, i32 2, i32 0, i32 1 ; <double*> [#uses=20]
- %tmp.9.i33330 = load double* %tmp.8.i33329 ; <double> [#uses=1]
- store double %tmp.9.i33330, double* %tmp.7.i33328
- %tmp.0.i33331 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i33324, %"struct.std::dcomplex"* %ret3 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i33333 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33331, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i33334 = load double* %tmp.14.i33333 ; <double> [#uses=1]
- %tmp.17.i33336 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33331, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i33337 = load double* %tmp.17.i33336 ; <double> [#uses=1]
- %tmp.7.i33291 = load double* %tmp.2.i34366 ; <double> [#uses=1]
- %tmp.15.i33305 = add double %tmp.7.i33291, %tmp.15.i33334 ; <double> [#uses=1]
- store double %tmp.15.i33305, double* %tmp.2.i34366
- %tmp.26.i33312 = load double* %tmp.6.i34367 ; <double> [#uses=1]
- %tmp.31.i33323 = add double %tmp.26.i33312, %tmp.18.i33337 ; <double> [#uses=1]
- store double %tmp.31.i33323, double* %tmp.6.i34367
- %tmp.4.i33271 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33270, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.5.i33272 = getelementptr [6 x %"struct.std::dcomplex"]* %_m, i32 4, i32 4, i32 0, i32 0 ; <double*> [#uses=5]
- %tmp.6.i33273 = load double* %tmp.5.i33272 ; <double> [#uses=1]
- store double %tmp.6.i33273, double* %tmp.4.i33271
- %tmp.7.i33274 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33270, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.8.i33275 = getelementptr [6 x %"struct.std::dcomplex"]* %_m, i32 4, i32 4, i32 0, i32 1 ; <double*> [#uses=5]
- %tmp.9.i33276 = load double* %tmp.8.i33275 ; <double> [#uses=1]
- store double %tmp.9.i33276, double* %tmp.7.i33274
- %tmp.0.i33277 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i33270, %"struct.std::dcomplex"* %ret4 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i33279 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33277, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i33280 = load double* %tmp.14.i33279 ; <double> [#uses=1]
- %tmp.17.i33282 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33277, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i33283 = load double* %tmp.17.i33282 ; <double> [#uses=1]
- %tmp.7.i33237 = load double* %tmp.2.i34368 ; <double> [#uses=1]
- %tmp.15.i33251 = add double %tmp.7.i33237, %tmp.15.i33280 ; <double> [#uses=1]
- store double %tmp.15.i33251, double* %tmp.2.i34368
- %tmp.26.i33258 = load double* %tmp.6.i34369 ; <double> [#uses=1]
- %tmp.31.i33269 = add double %tmp.26.i33258, %tmp.18.i33283 ; <double> [#uses=1]
- store double %tmp.31.i33269, double* %tmp.6.i34369
- store double 0.000000e+00, double* %tmp.2.i34366
- store double 0.000000e+00, double* %tmp.6.i34367
- %tmp.4.i33215 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33214, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i33217 = load double* %tmp.5.i34338 ; <double> [#uses=1]
- store double %tmp.6.i33217, double* %tmp.4.i33215
- %tmp.7.i33218 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33214, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i33220 = load double* %tmp.8.i34341 ; <double> [#uses=1]
- store double %tmp.9.i33220, double* %tmp.7.i33218
- %tmp.0.i33221 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i33214, %"struct.std::dcomplex"* %tmp.62 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i33223 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33221, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i33224 = load double* %tmp.14.i33223 ; <double> [#uses=1]
- %tmp.17.i33226 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33221, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i33227 = load double* %tmp.17.i33226 ; <double> [#uses=1]
- %tmp.4.i33201 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33200, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i33203 = load double* %tmp.5.i34082 ; <double> [#uses=1]
- store double %tmp.6.i33203, double* %tmp.4.i33201
- %tmp.7.i33204 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33200, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i33206 = load double* %tmp.8.i34085 ; <double> [#uses=1]
- store double %tmp.9.i33206, double* %tmp.7.i33204
- %tmp.0.i33207 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i33200, %"struct.std::dcomplex"* %tmp.6 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i33208 = getelementptr %"struct.std::dcomplex"* %mem_tmp.66, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i33209 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33207, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i33210 = load double* %tmp.14.i33209 ; <double> [#uses=1]
- store double %tmp.15.i33210, double* %tmp.13.i33208
- %tmp.16.i33211 = getelementptr %"struct.std::dcomplex"* %mem_tmp.66, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i33212 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33207, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i33213 = load double* %tmp.17.i33212 ; <double> [#uses=1]
- store double %tmp.18.i33213, double* %tmp.16.i33211
- %tmp.4.i33187 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33186, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i33224, double* %tmp.4.i33187
- %tmp.7.i33190 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33186, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i33227, double* %tmp.7.i33190
- %tmp.0.i33193 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i33186, %"struct.std::dcomplex"* %mem_tmp.66 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i33195 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33193, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i33196 = load double* %tmp.14.i33195 ; <double> [#uses=1]
- %tmp.17.i33198 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33193, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i33199 = load double* %tmp.17.i33198 ; <double> [#uses=1]
- %tmp.220 = getelementptr [6 x %"struct.std::dcomplex"]* %_m, i32 2, i32 4 ; <%"struct.std::dcomplex"*> [#uses=60]
- %tmp.4.i33173 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33172, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i33196, double* %tmp.4.i33173
- %tmp.7.i33176 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33172, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i33199, double* %tmp.7.i33176
- %tmp.0.i33179 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i33172, %"struct.std::dcomplex"* %tmp.220 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i33181 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33179, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i33182 = load double* %tmp.14.i33181 ; <double> [#uses=1]
- %tmp.17.i33184 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33179, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i33185 = load double* %tmp.17.i33184 ; <double> [#uses=1]
- %tmp.226 = getelementptr [6 x %"struct.std::dcomplex"]* %_m, i32 1, i32 4 ; <%"struct.std::dcomplex"*> [#uses=120]
- %tmp.4.i33159 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33158, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i33161 = load double* %tmp.5.i34082 ; <double> [#uses=1]
- store double %tmp.6.i33161, double* %tmp.4.i33159
- %tmp.7.i33162 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33158, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i33164 = load double* %tmp.8.i34085 ; <double> [#uses=1]
- store double %tmp.9.i33164, double* %tmp.7.i33162
- %tmp.0.i33165 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i33158, %"struct.std::dcomplex"* %tmp.226 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i33167 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33165, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i33168 = load double* %tmp.14.i33167 ; <double> [#uses=1]
- %tmp.17.i33170 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33165, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i33171 = load double* %tmp.17.i33170 ; <double> [#uses=1]
- %tmp.4.i33145 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33144, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.5.i33146 = getelementptr [6 x %"struct.std::dcomplex"]* %_m, i32 0, i32 4, i32 0, i32 0 ; <double*> [#uses=120]
- %tmp.6.i33147 = load double* %tmp.5.i33146 ; <double> [#uses=1]
- store double %tmp.6.i33147, double* %tmp.4.i33145
- %tmp.7.i33148 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33144, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.8.i33149 = getelementptr [6 x %"struct.std::dcomplex"]* %_m, i32 0, i32 4, i32 0, i32 1 ; <double*> [#uses=120]
- %tmp.9.i33150 = load double* %tmp.8.i33149 ; <double> [#uses=1]
- store double %tmp.9.i33150, double* %tmp.7.i33148
- %tmp.0.i33151 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i33144, %"struct.std::dcomplex"* %tmp.62 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i33152 = getelementptr %"struct.std::dcomplex"* %mem_tmp.70, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i33153 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33151, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i33154 = load double* %tmp.14.i33153 ; <double> [#uses=1]
- store double %tmp.15.i33154, double* %tmp.13.i33152
- %tmp.16.i33155 = getelementptr %"struct.std::dcomplex"* %mem_tmp.70, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i33156 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33151, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i33157 = load double* %tmp.17.i33156 ; <double> [#uses=1]
- store double %tmp.18.i33157, double* %tmp.16.i33155
- %tmp.4.i33131 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33130, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i33168, double* %tmp.4.i33131
- %tmp.7.i33134 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33130, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i33171, double* %tmp.7.i33134
- %tmp.0.i33137 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i33130, %"struct.std::dcomplex"* %mem_tmp.70 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i33139 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33137, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i33140 = load double* %tmp.14.i33139 ; <double> [#uses=1]
- %tmp.17.i33142 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33137, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i33143 = load double* %tmp.17.i33142 ; <double> [#uses=1]
- %tmp.4.i33117 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33116, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i33140, double* %tmp.4.i33117
- %tmp.7.i33120 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33116, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i33143, double* %tmp.7.i33120
- %tmp.0.i33123 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i33116, %"struct.std::dcomplex"* %tmp.45 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i33124 = getelementptr %"struct.std::dcomplex"* %mem_tmp.67, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i33125 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33123, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i33126 = load double* %tmp.14.i33125 ; <double> [#uses=1]
- store double %tmp.15.i33126, double* %tmp.13.i33124
- %tmp.16.i33127 = getelementptr %"struct.std::dcomplex"* %mem_tmp.67, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i33128 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33123, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i33129 = load double* %tmp.17.i33128 ; <double> [#uses=1]
- store double %tmp.18.i33129, double* %tmp.16.i33127
- %tmp.4.i33103 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33102, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i33182, double* %tmp.4.i33103
- %tmp.7.i33106 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33102, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i33185, double* %tmp.7.i33106
- %tmp.0.i33109 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i33102, %"struct.std::dcomplex"* %mem_tmp.67 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i33111 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33109, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i33112 = load double* %tmp.14.i33111 ; <double> [#uses=1]
- %tmp.17.i33114 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33109, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i33115 = load double* %tmp.17.i33114 ; <double> [#uses=1]
- %tmp.4.i33089 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33088, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i33091 = load double* %tmp.5.i33146 ; <double> [#uses=1]
- store double %tmp.6.i33091, double* %tmp.4.i33089
- %tmp.7.i33092 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33088, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i33094 = load double* %tmp.8.i33149 ; <double> [#uses=1]
- store double %tmp.9.i33094, double* %tmp.7.i33092
- %tmp.0.i33095 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i33088, %"struct.std::dcomplex"* %tmp.6 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i33097 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33095, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i33098 = load double* %tmp.14.i33097 ; <double> [#uses=1]
- %tmp.17.i33100 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33095, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i33101 = load double* %tmp.17.i33100 ; <double> [#uses=1]
- %tmp.4.i33075 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33074, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i33077 = load double* %tmp.5.i34338 ; <double> [#uses=1]
- store double %tmp.6.i33077, double* %tmp.4.i33075
- %tmp.7.i33078 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33074, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i33080 = load double* %tmp.8.i34341 ; <double> [#uses=1]
- store double %tmp.9.i33080, double* %tmp.7.i33078
- %tmp.0.i33081 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i33074, %"struct.std::dcomplex"* %tmp.226 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i33082 = getelementptr %"struct.std::dcomplex"* %mem_tmp.74, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i33083 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33081, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i33084 = load double* %tmp.14.i33083 ; <double> [#uses=1]
- store double %tmp.15.i33084, double* %tmp.13.i33082
- %tmp.16.i33085 = getelementptr %"struct.std::dcomplex"* %mem_tmp.74, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i33086 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33081, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i33087 = load double* %tmp.17.i33086 ; <double> [#uses=1]
- store double %tmp.18.i33087, double* %tmp.16.i33085
- %tmp.4.i33061 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33060, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i33098, double* %tmp.4.i33061
- %tmp.7.i33064 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33060, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i33101, double* %tmp.7.i33064
- %tmp.0.i33067 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i33060, %"struct.std::dcomplex"* %mem_tmp.74 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i33069 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33067, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i33070 = load double* %tmp.14.i33069 ; <double> [#uses=1]
- %tmp.17.i33072 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33067, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i33073 = load double* %tmp.17.i33072 ; <double> [#uses=1]
- %tmp.4.i33047 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33046, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i33070, double* %tmp.4.i33047
- %tmp.7.i33050 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33046, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i33073, double* %tmp.7.i33050
- %tmp.0.i33053 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i33046, %"struct.std::dcomplex"* %tmp.95 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i33054 = getelementptr %"struct.std::dcomplex"* %mem_tmp.71, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i33055 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33053, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i33056 = load double* %tmp.14.i33055 ; <double> [#uses=1]
- store double %tmp.15.i33056, double* %tmp.13.i33054
- %tmp.16.i33057 = getelementptr %"struct.std::dcomplex"* %mem_tmp.71, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i33058 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33053, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i33059 = load double* %tmp.17.i33058 ; <double> [#uses=1]
- store double %tmp.18.i33059, double* %tmp.16.i33057
- %tmp.4.i33033 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33032, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i33112, double* %tmp.4.i33033
- %tmp.7.i33036 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33032, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i33115, double* %tmp.7.i33036
- %tmp.0.i33039 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i33032, %"struct.std::dcomplex"* %mem_tmp.71 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i33041 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33039, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i33042 = load double* %tmp.14.i33041 ; <double> [#uses=1]
- %tmp.17.i33044 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33039, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i33045 = load double* %tmp.17.i33044 ; <double> [#uses=1]
- store double %tmp.15.i33042, double* %tmp.2.i34364
- store double %tmp.18.i33045, double* %tmp.6.i34365
- %tmp.4.i32999 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32998, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i33001 = load double* %tmp.5.i33326 ; <double> [#uses=1]
- store double %tmp.6.i33001, double* %tmp.4.i32999
- %tmp.7.i33002 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32998, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i33004 = load double* %tmp.8.i33329 ; <double> [#uses=1]
- store double %tmp.9.i33004, double* %tmp.7.i33002
- %tmp.0.i33005 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i32998, %"struct.std::dcomplex"* %ret3 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i33007 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33005, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i33008 = load double* %tmp.14.i33007 ; <double> [#uses=1]
- %tmp.17.i33010 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33005, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i33011 = load double* %tmp.17.i33010 ; <double> [#uses=1]
- %tmp.7.i32965 = load double* %tmp.2.i34366 ; <double> [#uses=1]
- %tmp.15.i32979 = add double %tmp.7.i32965, %tmp.15.i33008 ; <double> [#uses=1]
- store double %tmp.15.i32979, double* %tmp.2.i34366
- %tmp.26.i32986 = load double* %tmp.6.i34367 ; <double> [#uses=1]
- %tmp.31.i32997 = add double %tmp.26.i32986, %tmp.18.i33011 ; <double> [#uses=1]
- store double %tmp.31.i32997, double* %tmp.6.i34367
- %tmp.4.i32945 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32944, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i32947 = load double* %tmp.5.i34338 ; <double> [#uses=1]
- store double %tmp.6.i32947, double* %tmp.4.i32945
- %tmp.7.i32948 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32944, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i32950 = load double* %tmp.8.i34341 ; <double> [#uses=1]
- store double %tmp.9.i32950, double* %tmp.7.i32948
- %tmp.0.i32951 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i32944, %"struct.std::dcomplex"* %tmp.226 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i32953 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32951, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i32954 = load double* %tmp.14.i32953 ; <double> [#uses=1]
- %tmp.17.i32956 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32951, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i32957 = load double* %tmp.17.i32956 ; <double> [#uses=1]
- %tmp.4.i32931 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32930, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i32933 = load double* %tmp.5.i33146 ; <double> [#uses=1]
- store double %tmp.6.i32933, double* %tmp.4.i32931
- %tmp.7.i32934 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32930, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i32936 = load double* %tmp.8.i33149 ; <double> [#uses=1]
- store double %tmp.9.i32936, double* %tmp.7.i32934
- %tmp.0.i32937 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i32930, %"struct.std::dcomplex"* %tmp.6 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i32938 = getelementptr %"struct.std::dcomplex"* %mem_tmp.81, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i32939 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32937, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i32940 = load double* %tmp.14.i32939 ; <double> [#uses=1]
- store double %tmp.15.i32940, double* %tmp.13.i32938
- %tmp.16.i32941 = getelementptr %"struct.std::dcomplex"* %mem_tmp.81, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i32942 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32937, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i32943 = load double* %tmp.17.i32942 ; <double> [#uses=1]
- store double %tmp.18.i32943, double* %tmp.16.i32941
- %tmp.4.i32917 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32916, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i32954, double* %tmp.4.i32917
- %tmp.7.i32920 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32916, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i32957, double* %tmp.7.i32920
- %tmp.0.i32923 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i32916, %"struct.std::dcomplex"* %mem_tmp.81 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i32925 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32923, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i32926 = load double* %tmp.14.i32925 ; <double> [#uses=1]
- %tmp.17.i32928 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32923, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i32929 = load double* %tmp.17.i32928 ; <double> [#uses=1]
- %tmp.4.i32903 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32902, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i32926, double* %tmp.4.i32903
- %tmp.7.i32906 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32902, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i32929, double* %tmp.7.i32906
- %tmp.0.i32909 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i32902, %"struct.std::dcomplex"* %tmp.15 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i32911 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32909, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i32912 = load double* %tmp.14.i32911 ; <double> [#uses=1]
- %tmp.17.i32914 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32909, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i32915 = load double* %tmp.17.i32914 ; <double> [#uses=1]
- %tmp.4.i32889 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32888, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i32891 = load double* %tmp.5.i34282 ; <double> [#uses=1]
- store double %tmp.6.i32891, double* %tmp.4.i32889
- %tmp.7.i32892 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32888, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i32894 = load double* %tmp.8.i34285 ; <double> [#uses=1]
- store double %tmp.9.i32894, double* %tmp.7.i32892
- %tmp.0.i32895 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i32888, %"struct.std::dcomplex"* %tmp.6 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i32897 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32895, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i32898 = load double* %tmp.14.i32897 ; <double> [#uses=1]
- %tmp.17.i32900 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32895, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i32901 = load double* %tmp.17.i32900 ; <double> [#uses=1]
- %tmp.4.i32875 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32874, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i32877 = load double* %tmp.5.i34338 ; <double> [#uses=1]
- store double %tmp.6.i32877, double* %tmp.4.i32875
- %tmp.7.i32878 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32874, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i32880 = load double* %tmp.8.i34341 ; <double> [#uses=1]
- store double %tmp.9.i32880, double* %tmp.7.i32878
- %tmp.0.i32881 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i32874, %"struct.std::dcomplex"* %tmp.21 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i32882 = getelementptr %"struct.std::dcomplex"* %mem_tmp.85, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i32883 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32881, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i32884 = load double* %tmp.14.i32883 ; <double> [#uses=1]
- store double %tmp.15.i32884, double* %tmp.13.i32882
- %tmp.16.i32885 = getelementptr %"struct.std::dcomplex"* %mem_tmp.85, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i32886 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32881, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i32887 = load double* %tmp.17.i32886 ; <double> [#uses=1]
- store double %tmp.18.i32887, double* %tmp.16.i32885
- %tmp.4.i32861 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32860, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i32898, double* %tmp.4.i32861
- %tmp.7.i32864 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32860, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i32901, double* %tmp.7.i32864
- %tmp.0.i32867 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i32860, %"struct.std::dcomplex"* %mem_tmp.85 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i32869 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32867, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i32870 = load double* %tmp.14.i32869 ; <double> [#uses=1]
- %tmp.17.i32872 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32867, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i32873 = load double* %tmp.17.i32872 ; <double> [#uses=1]
- %tmp.4.i32847 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32846, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i32870, double* %tmp.4.i32847
- %tmp.7.i32850 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32846, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i32873, double* %tmp.7.i32850
- %tmp.0.i32853 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i32846, %"struct.std::dcomplex"* %tmp.220 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i32854 = getelementptr %"struct.std::dcomplex"* %mem_tmp.82, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i32855 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32853, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i32856 = load double* %tmp.14.i32855 ; <double> [#uses=1]
- store double %tmp.15.i32856, double* %tmp.13.i32854
- %tmp.16.i32857 = getelementptr %"struct.std::dcomplex"* %mem_tmp.82, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i32858 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32853, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i32859 = load double* %tmp.17.i32858 ; <double> [#uses=1]
- store double %tmp.18.i32859, double* %tmp.16.i32857
- %tmp.4.i32833 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32832, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i32912, double* %tmp.4.i32833
- %tmp.7.i32836 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32832, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i32915, double* %tmp.7.i32836
- %tmp.0.i32839 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i32832, %"struct.std::dcomplex"* %mem_tmp.82 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i32841 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32839, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i32842 = load double* %tmp.14.i32841 ; <double> [#uses=1]
- %tmp.17.i32844 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32839, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i32845 = load double* %tmp.17.i32844 ; <double> [#uses=1]
- %tmp.4.i32819 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32818, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i32821 = load double* %tmp.5.i33146 ; <double> [#uses=1]
- store double %tmp.6.i32821, double* %tmp.4.i32819
- %tmp.7.i32822 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32818, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i32824 = load double* %tmp.8.i33149 ; <double> [#uses=1]
- store double %tmp.9.i32824, double* %tmp.7.i32822
- %tmp.0.i32825 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i32818, %"struct.std::dcomplex"* %tmp.21 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i32827 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32825, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i32828 = load double* %tmp.14.i32827 ; <double> [#uses=1]
- %tmp.17.i32830 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32825, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i32831 = load double* %tmp.17.i32830 ; <double> [#uses=1]
- %tmp.4.i32805 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32804, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i32807 = load double* %tmp.5.i34282 ; <double> [#uses=1]
- store double %tmp.6.i32807, double* %tmp.4.i32805
- %tmp.7.i32808 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32804, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i32810 = load double* %tmp.8.i34285 ; <double> [#uses=1]
- store double %tmp.9.i32810, double* %tmp.7.i32808
- %tmp.0.i32811 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i32804, %"struct.std::dcomplex"* %tmp.226 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i32812 = getelementptr %"struct.std::dcomplex"* %mem_tmp.89, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i32813 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32811, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i32814 = load double* %tmp.14.i32813 ; <double> [#uses=1]
- store double %tmp.15.i32814, double* %tmp.13.i32812
- %tmp.16.i32815 = getelementptr %"struct.std::dcomplex"* %mem_tmp.89, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i32816 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32811, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i32817 = load double* %tmp.17.i32816 ; <double> [#uses=1]
- store double %tmp.18.i32817, double* %tmp.16.i32815
- %tmp.4.i32791 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32790, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i32828, double* %tmp.4.i32791
- %tmp.7.i32794 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32790, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i32831, double* %tmp.7.i32794
- %tmp.0.i32797 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i32790, %"struct.std::dcomplex"* %mem_tmp.89 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i32799 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32797, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i32800 = load double* %tmp.14.i32799 ; <double> [#uses=1]
- %tmp.17.i32802 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32797, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i32803 = load double* %tmp.17.i32802 ; <double> [#uses=1]
- %tmp.4.i32777 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32776, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i32800, double* %tmp.4.i32777
- %tmp.7.i32780 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32776, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i32803, double* %tmp.7.i32780
- %tmp.0.i32783 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i32776, %"struct.std::dcomplex"* %tmp.45 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i32784 = getelementptr %"struct.std::dcomplex"* %mem_tmp.86, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i32785 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32783, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i32786 = load double* %tmp.14.i32785 ; <double> [#uses=1]
- store double %tmp.15.i32786, double* %tmp.13.i32784
- %tmp.16.i32787 = getelementptr %"struct.std::dcomplex"* %mem_tmp.86, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i32788 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32783, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i32789 = load double* %tmp.17.i32788 ; <double> [#uses=1]
- store double %tmp.18.i32789, double* %tmp.16.i32787
- %tmp.4.i32763 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32762, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i32842, double* %tmp.4.i32763
- %tmp.7.i32766 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32762, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i32845, double* %tmp.7.i32766
- %tmp.0.i32769 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i32762, %"struct.std::dcomplex"* %mem_tmp.86 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i32771 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32769, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i32772 = load double* %tmp.14.i32771 ; <double> [#uses=1]
- %tmp.17.i32774 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32769, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i32775 = load double* %tmp.17.i32774 ; <double> [#uses=1]
- store double %tmp.15.i32772, double* %tmp.2.i34364
- store double %tmp.18.i32775, double* %tmp.6.i34365
- %tmp.4.i32729 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32728, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i32731 = load double* %tmp.5.i34136 ; <double> [#uses=1]
- store double %tmp.6.i32731, double* %tmp.4.i32729
- %tmp.7.i32732 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32728, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i32734 = load double* %tmp.8.i34139 ; <double> [#uses=1]
- store double %tmp.9.i32734, double* %tmp.7.i32732
- %tmp.0.i32735 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i32728, %"struct.std::dcomplex"* %ret3 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i32737 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32735, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i32738 = load double* %tmp.14.i32737 ; <double> [#uses=1]
- %tmp.17.i32740 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32735, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i32741 = load double* %tmp.17.i32740 ; <double> [#uses=1]
- %tmp.7.i32695 = load double* %tmp.2.i34366 ; <double> [#uses=1]
- %tmp.15.i32709 = add double %tmp.7.i32695, %tmp.15.i32738 ; <double> [#uses=1]
- store double %tmp.15.i32709, double* %tmp.2.i34366
- %tmp.26.i32716 = load double* %tmp.6.i34367 ; <double> [#uses=1]
- %tmp.31.i32727 = add double %tmp.26.i32716, %tmp.18.i32741 ; <double> [#uses=1]
- store double %tmp.31.i32727, double* %tmp.6.i34367
- %tmp.4.i32675 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32674, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i32677 = load double* %tmp.5.i34282 ; <double> [#uses=1]
- store double %tmp.6.i32677, double* %tmp.4.i32675
- %tmp.7.i32678 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32674, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i32680 = load double* %tmp.8.i34285 ; <double> [#uses=1]
- store double %tmp.9.i32680, double* %tmp.7.i32678
- %tmp.0.i32681 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i32674, %"struct.std::dcomplex"* %tmp.62 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i32683 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32681, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i32684 = load double* %tmp.14.i32683 ; <double> [#uses=1]
- %tmp.17.i32686 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32681, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i32687 = load double* %tmp.17.i32686 ; <double> [#uses=1]
- %tmp.4.i32661 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32660, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i32663 = load double* %tmp.5.i34082 ; <double> [#uses=1]
- store double %tmp.6.i32663, double* %tmp.4.i32661
- %tmp.7.i32664 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32660, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i32666 = load double* %tmp.8.i34085 ; <double> [#uses=1]
- store double %tmp.9.i32666, double* %tmp.7.i32664
- %tmp.0.i32667 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i32660, %"struct.std::dcomplex"* %tmp.21 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i32668 = getelementptr %"struct.std::dcomplex"* %mem_tmp.96, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i32669 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32667, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i32670 = load double* %tmp.14.i32669 ; <double> [#uses=1]
- store double %tmp.15.i32670, double* %tmp.13.i32668
- %tmp.16.i32671 = getelementptr %"struct.std::dcomplex"* %mem_tmp.96, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i32672 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32667, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i32673 = load double* %tmp.17.i32672 ; <double> [#uses=1]
- store double %tmp.18.i32673, double* %tmp.16.i32671
- %tmp.4.i32647 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32646, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i32684, double* %tmp.4.i32647
- %tmp.7.i32650 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32646, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i32687, double* %tmp.7.i32650
- %tmp.0.i32653 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i32646, %"struct.std::dcomplex"* %mem_tmp.96 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i32655 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32653, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i32656 = load double* %tmp.14.i32655 ; <double> [#uses=1]
- %tmp.17.i32658 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32653, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i32659 = load double* %tmp.17.i32658 ; <double> [#uses=1]
- %tmp.4.i32633 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32632, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i32656, double* %tmp.4.i32633
- %tmp.7.i32636 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32632, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i32659, double* %tmp.7.i32636
- %tmp.0.i32639 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i32632, %"struct.std::dcomplex"* %tmp.45 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i32641 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32639, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i32642 = load double* %tmp.14.i32641 ; <double> [#uses=1]
- %tmp.17.i32644 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32639, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i32645 = load double* %tmp.17.i32644 ; <double> [#uses=1]
- %tmp.4.i32619 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32618, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i32621 = load double* %tmp.5.i34082 ; <double> [#uses=1]
- store double %tmp.6.i32621, double* %tmp.4.i32619
- %tmp.7.i32622 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32618, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i32624 = load double* %tmp.8.i34085 ; <double> [#uses=1]
- store double %tmp.9.i32624, double* %tmp.7.i32622
- %tmp.0.i32625 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i32618, %"struct.std::dcomplex"* %tmp.6 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i32627 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32625, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i32628 = load double* %tmp.14.i32627 ; <double> [#uses=1]
- %tmp.17.i32630 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32625, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i32631 = load double* %tmp.17.i32630 ; <double> [#uses=1]
- %tmp.4.i32605 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32604, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i32607 = load double* %tmp.5.i34338 ; <double> [#uses=1]
- store double %tmp.6.i32607, double* %tmp.4.i32605
- %tmp.7.i32608 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32604, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i32610 = load double* %tmp.8.i34341 ; <double> [#uses=1]
- store double %tmp.9.i32610, double* %tmp.7.i32608
- %tmp.0.i32611 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i32604, %"struct.std::dcomplex"* %tmp.62 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i32612 = getelementptr %"struct.std::dcomplex"* %mem_tmp.100, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i32613 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32611, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i32614 = load double* %tmp.14.i32613 ; <double> [#uses=1]
- store double %tmp.15.i32614, double* %tmp.13.i32612
- %tmp.16.i32615 = getelementptr %"struct.std::dcomplex"* %mem_tmp.100, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i32616 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32611, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i32617 = load double* %tmp.17.i32616 ; <double> [#uses=1]
- store double %tmp.18.i32617, double* %tmp.16.i32615
- %tmp.4.i32591 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32590, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i32628, double* %tmp.4.i32591
- %tmp.7.i32594 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32590, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i32631, double* %tmp.7.i32594
- %tmp.0.i32597 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i32590, %"struct.std::dcomplex"* %mem_tmp.100 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i32599 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32597, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i32600 = load double* %tmp.14.i32599 ; <double> [#uses=1]
- %tmp.17.i32602 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32597, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i32603 = load double* %tmp.17.i32602 ; <double> [#uses=1]
- %tmp.4.i32577 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32576, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i32600, double* %tmp.4.i32577
- %tmp.7.i32580 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32576, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i32603, double* %tmp.7.i32580
- %tmp.0.i32583 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i32576, %"struct.std::dcomplex"* %tmp.15 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i32584 = getelementptr %"struct.std::dcomplex"* %mem_tmp.97, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i32585 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32583, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i32586 = load double* %tmp.14.i32585 ; <double> [#uses=1]
- store double %tmp.15.i32586, double* %tmp.13.i32584
- %tmp.16.i32587 = getelementptr %"struct.std::dcomplex"* %mem_tmp.97, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i32588 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32583, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i32589 = load double* %tmp.17.i32588 ; <double> [#uses=1]
- store double %tmp.18.i32589, double* %tmp.16.i32587
- %tmp.4.i32563 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32562, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i32642, double* %tmp.4.i32563
- %tmp.7.i32566 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32562, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i32645, double* %tmp.7.i32566
- %tmp.0.i32569 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i32562, %"struct.std::dcomplex"* %mem_tmp.97 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i32571 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32569, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i32572 = load double* %tmp.14.i32571 ; <double> [#uses=1]
- %tmp.17.i32574 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32569, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i32575 = load double* %tmp.17.i32574 ; <double> [#uses=1]
- %tmp.4.i32549 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32548, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i32551 = load double* %tmp.5.i34338 ; <double> [#uses=1]
- store double %tmp.6.i32551, double* %tmp.4.i32549
- %tmp.7.i32552 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32548, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i32554 = load double* %tmp.8.i34341 ; <double> [#uses=1]
- store double %tmp.9.i32554, double* %tmp.7.i32552
- %tmp.0.i32555 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i32548, %"struct.std::dcomplex"* %tmp.21 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i32557 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32555, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i32558 = load double* %tmp.14.i32557 ; <double> [#uses=1]
- %tmp.17.i32560 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32555, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i32561 = load double* %tmp.17.i32560 ; <double> [#uses=1]
- %tmp.4.i32535 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32534, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i32537 = load double* %tmp.5.i34282 ; <double> [#uses=1]
- store double %tmp.6.i32537, double* %tmp.4.i32535
- %tmp.7.i32538 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32534, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i32540 = load double* %tmp.8.i34285 ; <double> [#uses=1]
- store double %tmp.9.i32540, double* %tmp.7.i32538
- %tmp.0.i32541 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i32534, %"struct.std::dcomplex"* %tmp.6 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i32542 = getelementptr %"struct.std::dcomplex"* %mem_tmp.104, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i32543 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32541, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i32544 = load double* %tmp.14.i32543 ; <double> [#uses=1]
- store double %tmp.15.i32544, double* %tmp.13.i32542
- %tmp.16.i32545 = getelementptr %"struct.std::dcomplex"* %mem_tmp.104, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i32546 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32541, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i32547 = load double* %tmp.17.i32546 ; <double> [#uses=1]
- store double %tmp.18.i32547, double* %tmp.16.i32545
- %tmp.4.i32521 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32520, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i32558, double* %tmp.4.i32521
- %tmp.7.i32524 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32520, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i32561, double* %tmp.7.i32524
- %tmp.0.i32527 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i32520, %"struct.std::dcomplex"* %mem_tmp.104 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i32529 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32527, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i32530 = load double* %tmp.14.i32529 ; <double> [#uses=1]
- %tmp.17.i32532 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32527, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i32533 = load double* %tmp.17.i32532 ; <double> [#uses=1]
- %tmp.4.i32507 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32506, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i32530, double* %tmp.4.i32507
- %tmp.7.i32510 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32506, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i32533, double* %tmp.7.i32510
- %tmp.0.i32513 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i32506, %"struct.std::dcomplex"* %tmp.95 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i32514 = getelementptr %"struct.std::dcomplex"* %mem_tmp.101, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i32515 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32513, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i32516 = load double* %tmp.14.i32515 ; <double> [#uses=1]
- store double %tmp.15.i32516, double* %tmp.13.i32514
- %tmp.16.i32517 = getelementptr %"struct.std::dcomplex"* %mem_tmp.101, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i32518 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32513, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i32519 = load double* %tmp.17.i32518 ; <double> [#uses=1]
- store double %tmp.18.i32519, double* %tmp.16.i32517
- %tmp.4.i32493 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32492, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i32572, double* %tmp.4.i32493
- %tmp.7.i32496 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32492, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i32575, double* %tmp.7.i32496
- %tmp.0.i32499 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i32492, %"struct.std::dcomplex"* %mem_tmp.101 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i32501 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32499, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i32502 = load double* %tmp.14.i32501 ; <double> [#uses=1]
- %tmp.17.i32504 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32499, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i32505 = load double* %tmp.17.i32504 ; <double> [#uses=1]
- store double %tmp.15.i32502, double* %tmp.2.i34364
- store double %tmp.18.i32505, double* %tmp.6.i34365
- %tmp.4.i32459 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32458, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.5.i32460 = getelementptr [6 x %"struct.std::dcomplex"]* %_m, i32 3, i32 4, i32 0, i32 0 ; <double*> [#uses=20]
- %tmp.6.i32461 = load double* %tmp.5.i32460 ; <double> [#uses=1]
- store double %tmp.6.i32461, double* %tmp.4.i32459
- %tmp.7.i32462 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32458, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.8.i32463 = getelementptr [6 x %"struct.std::dcomplex"]* %_m, i32 3, i32 4, i32 0, i32 1 ; <double*> [#uses=20]
- %tmp.9.i32464 = load double* %tmp.8.i32463 ; <double> [#uses=1]
- store double %tmp.9.i32464, double* %tmp.7.i32462
- %tmp.0.i32465 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i32458, %"struct.std::dcomplex"* %ret3 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i32467 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32465, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i32468 = load double* %tmp.14.i32467 ; <double> [#uses=1]
- %tmp.17.i32470 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32465, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i32471 = load double* %tmp.17.i32470 ; <double> [#uses=1]
- %tmp.7.i32425 = load double* %tmp.2.i34366 ; <double> [#uses=1]
- %tmp.15.i32439 = add double %tmp.7.i32425, %tmp.15.i32468 ; <double> [#uses=1]
- store double %tmp.15.i32439, double* %tmp.2.i34366
- %tmp.26.i32446 = load double* %tmp.6.i34367 ; <double> [#uses=1]
- %tmp.31.i32457 = add double %tmp.26.i32446, %tmp.18.i32471 ; <double> [#uses=1]
- store double %tmp.31.i32457, double* %tmp.6.i34367
- %tmp.4.i32405 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32404, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i32407 = load double* %tmp.5.i34282 ; <double> [#uses=1]
- store double %tmp.6.i32407, double* %tmp.4.i32405
- %tmp.7.i32408 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32404, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i32410 = load double* %tmp.8.i34285 ; <double> [#uses=1]
- store double %tmp.9.i32410, double* %tmp.7.i32408
- %tmp.0.i32411 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i32404, %"struct.std::dcomplex"* %tmp.226 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i32413 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32411, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i32414 = load double* %tmp.14.i32413 ; <double> [#uses=1]
- %tmp.17.i32416 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32411, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i32417 = load double* %tmp.17.i32416 ; <double> [#uses=1]
- %tmp.4.i32391 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32390, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i32393 = load double* %tmp.5.i33146 ; <double> [#uses=1]
- store double %tmp.6.i32393, double* %tmp.4.i32391
- %tmp.7.i32394 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32390, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i32396 = load double* %tmp.8.i33149 ; <double> [#uses=1]
- store double %tmp.9.i32396, double* %tmp.7.i32394
- %tmp.0.i32397 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i32390, %"struct.std::dcomplex"* %tmp.21 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i32398 = getelementptr %"struct.std::dcomplex"* %mem_tmp.111, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i32399 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32397, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i32400 = load double* %tmp.14.i32399 ; <double> [#uses=1]
- store double %tmp.15.i32400, double* %tmp.13.i32398
- %tmp.16.i32401 = getelementptr %"struct.std::dcomplex"* %mem_tmp.111, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i32402 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32397, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i32403 = load double* %tmp.17.i32402 ; <double> [#uses=1]
- store double %tmp.18.i32403, double* %tmp.16.i32401
- %tmp.4.i32377 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32376, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i32414, double* %tmp.4.i32377
- %tmp.7.i32380 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32376, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i32417, double* %tmp.7.i32380
- %tmp.0.i32383 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i32376, %"struct.std::dcomplex"* %mem_tmp.111 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i32385 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32383, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i32386 = load double* %tmp.14.i32385 ; <double> [#uses=1]
- %tmp.17.i32388 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32383, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i32389 = load double* %tmp.17.i32388 ; <double> [#uses=1]
- %tmp.4.i32363 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32362, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i32386, double* %tmp.4.i32363
- %tmp.7.i32366 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32362, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i32389, double* %tmp.7.i32366
- %tmp.0.i32369 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i32362, %"struct.std::dcomplex"* %tmp.95 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i32371 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32369, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i32372 = load double* %tmp.14.i32371 ; <double> [#uses=1]
- %tmp.17.i32374 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32369, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i32375 = load double* %tmp.17.i32374 ; <double> [#uses=1]
- %tmp.4.i32349 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32348, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i32351 = load double* %tmp.5.i34082 ; <double> [#uses=1]
- store double %tmp.6.i32351, double* %tmp.4.i32349
- %tmp.7.i32352 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32348, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i32354 = load double* %tmp.8.i34085 ; <double> [#uses=1]
- store double %tmp.9.i32354, double* %tmp.7.i32352
- %tmp.0.i32355 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i32348, %"struct.std::dcomplex"* %tmp.21 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i32357 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32355, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i32358 = load double* %tmp.14.i32357 ; <double> [#uses=1]
- %tmp.17.i32360 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32355, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i32361 = load double* %tmp.17.i32360 ; <double> [#uses=1]
- %tmp.4.i32335 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32334, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i32337 = load double* %tmp.5.i34282 ; <double> [#uses=1]
- store double %tmp.6.i32337, double* %tmp.4.i32335
- %tmp.7.i32338 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32334, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i32340 = load double* %tmp.8.i34285 ; <double> [#uses=1]
- store double %tmp.9.i32340, double* %tmp.7.i32338
- %tmp.0.i32341 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i32334, %"struct.std::dcomplex"* %tmp.62 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i32342 = getelementptr %"struct.std::dcomplex"* %mem_tmp.115, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i32343 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32341, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i32344 = load double* %tmp.14.i32343 ; <double> [#uses=1]
- store double %tmp.15.i32344, double* %tmp.13.i32342
- %tmp.16.i32345 = getelementptr %"struct.std::dcomplex"* %mem_tmp.115, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i32346 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32341, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i32347 = load double* %tmp.17.i32346 ; <double> [#uses=1]
- store double %tmp.18.i32347, double* %tmp.16.i32345
- %tmp.4.i32321 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32320, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i32358, double* %tmp.4.i32321
- %tmp.7.i32324 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32320, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i32361, double* %tmp.7.i32324
- %tmp.0.i32327 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i32320, %"struct.std::dcomplex"* %mem_tmp.115 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i32329 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32327, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i32330 = load double* %tmp.14.i32329 ; <double> [#uses=1]
- %tmp.17.i32332 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32327, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i32333 = load double* %tmp.17.i32332 ; <double> [#uses=1]
- %tmp.4.i32307 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32306, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i32330, double* %tmp.4.i32307
- %tmp.7.i32310 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32306, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i32333, double* %tmp.7.i32310
- %tmp.0.i32313 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i32306, %"struct.std::dcomplex"* %tmp.220 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i32314 = getelementptr %"struct.std::dcomplex"* %mem_tmp.112, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i32315 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32313, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i32316 = load double* %tmp.14.i32315 ; <double> [#uses=1]
- store double %tmp.15.i32316, double* %tmp.13.i32314
- %tmp.16.i32317 = getelementptr %"struct.std::dcomplex"* %mem_tmp.112, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i32318 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32313, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i32319 = load double* %tmp.17.i32318 ; <double> [#uses=1]
- store double %tmp.18.i32319, double* %tmp.16.i32317
- %tmp.4.i32293 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32292, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i32372, double* %tmp.4.i32293
- %tmp.7.i32296 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32292, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i32375, double* %tmp.7.i32296
- %tmp.0.i32299 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i32292, %"struct.std::dcomplex"* %mem_tmp.112 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i32301 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32299, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i32302 = load double* %tmp.14.i32301 ; <double> [#uses=1]
- %tmp.17.i32304 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32299, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i32305 = load double* %tmp.17.i32304 ; <double> [#uses=1]
- %tmp.4.i32279 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32278, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i32281 = load double* %tmp.5.i33146 ; <double> [#uses=1]
- store double %tmp.6.i32281, double* %tmp.4.i32279
- %tmp.7.i32282 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32278, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i32284 = load double* %tmp.8.i33149 ; <double> [#uses=1]
- store double %tmp.9.i32284, double* %tmp.7.i32282
- %tmp.0.i32285 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i32278, %"struct.std::dcomplex"* %tmp.62 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i32287 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32285, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i32288 = load double* %tmp.14.i32287 ; <double> [#uses=1]
- %tmp.17.i32290 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32285, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i32291 = load double* %tmp.17.i32290 ; <double> [#uses=1]
- %tmp.4.i32265 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32264, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i32267 = load double* %tmp.5.i34082 ; <double> [#uses=1]
- store double %tmp.6.i32267, double* %tmp.4.i32265
- %tmp.7.i32268 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32264, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i32270 = load double* %tmp.8.i34085 ; <double> [#uses=1]
- store double %tmp.9.i32270, double* %tmp.7.i32268
- %tmp.0.i32271 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i32264, %"struct.std::dcomplex"* %tmp.226 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i32272 = getelementptr %"struct.std::dcomplex"* %mem_tmp.119, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i32273 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32271, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i32274 = load double* %tmp.14.i32273 ; <double> [#uses=1]
- store double %tmp.15.i32274, double* %tmp.13.i32272
- %tmp.16.i32275 = getelementptr %"struct.std::dcomplex"* %mem_tmp.119, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i32276 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32271, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i32277 = load double* %tmp.17.i32276 ; <double> [#uses=1]
- store double %tmp.18.i32277, double* %tmp.16.i32275
- %tmp.4.i32251 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32250, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i32288, double* %tmp.4.i32251
- %tmp.7.i32254 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32250, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i32291, double* %tmp.7.i32254
- %tmp.0.i32257 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i32250, %"struct.std::dcomplex"* %mem_tmp.119 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i32259 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32257, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i32260 = load double* %tmp.14.i32259 ; <double> [#uses=1]
- %tmp.17.i32262 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32257, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i32263 = load double* %tmp.17.i32262 ; <double> [#uses=1]
- %tmp.4.i32237 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32236, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i32260, double* %tmp.4.i32237
- %tmp.7.i32240 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32236, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i32263, double* %tmp.7.i32240
- %tmp.0.i32243 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i32236, %"struct.std::dcomplex"* %tmp.15 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i32244 = getelementptr %"struct.std::dcomplex"* %mem_tmp.116, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i32245 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32243, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i32246 = load double* %tmp.14.i32245 ; <double> [#uses=1]
- store double %tmp.15.i32246, double* %tmp.13.i32244
- %tmp.16.i32247 = getelementptr %"struct.std::dcomplex"* %mem_tmp.116, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i32248 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32243, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i32249 = load double* %tmp.17.i32248 ; <double> [#uses=1]
- store double %tmp.18.i32249, double* %tmp.16.i32247
- %tmp.4.i32223 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32222, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i32302, double* %tmp.4.i32223
- %tmp.7.i32226 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32222, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i32305, double* %tmp.7.i32226
- %tmp.0.i32229 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i32222, %"struct.std::dcomplex"* %mem_tmp.116 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i32231 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32229, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i32232 = load double* %tmp.14.i32231 ; <double> [#uses=1]
- %tmp.17.i32234 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32229, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i32235 = load double* %tmp.17.i32234 ; <double> [#uses=1]
- store double %tmp.15.i32232, double* %tmp.2.i34364
- store double %tmp.18.i32235, double* %tmp.6.i34365
- %tmp.4.i32189 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32188, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i32191 = load double* %tmp.5.i33596 ; <double> [#uses=1]
- store double %tmp.6.i32191, double* %tmp.4.i32189
- %tmp.7.i32192 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32188, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i32194 = load double* %tmp.8.i33599 ; <double> [#uses=1]
- store double %tmp.9.i32194, double* %tmp.7.i32192
- %tmp.0.i32195 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i32188, %"struct.std::dcomplex"* %ret3 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i32197 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32195, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i32198 = load double* %tmp.14.i32197 ; <double> [#uses=1]
- %tmp.17.i32200 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32195, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i32201 = load double* %tmp.17.i32200 ; <double> [#uses=1]
- %tmp.7.i32155 = load double* %tmp.2.i34366 ; <double> [#uses=1]
- %tmp.15.i32169 = add double %tmp.7.i32155, %tmp.15.i32198 ; <double> [#uses=1]
- store double %tmp.15.i32169, double* %tmp.2.i34366
- %tmp.26.i32176 = load double* %tmp.6.i34367 ; <double> [#uses=1]
- %tmp.31.i32187 = add double %tmp.26.i32176, %tmp.18.i32201 ; <double> [#uses=1]
- store double %tmp.31.i32187, double* %tmp.6.i34367
- %tmp.4.i32135 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32134, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.5.i32136 = getelementptr [6 x %"struct.std::dcomplex"]* %_m, i32 4, i32 0, i32 0, i32 0 ; <double*> [#uses=5]
- %tmp.6.i32137 = load double* %tmp.5.i32136 ; <double> [#uses=1]
- store double %tmp.6.i32137, double* %tmp.4.i32135
- %tmp.7.i32138 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32134, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.8.i32139 = getelementptr [6 x %"struct.std::dcomplex"]* %_m, i32 4, i32 0, i32 0, i32 1 ; <double*> [#uses=5]
- %tmp.9.i32140 = load double* %tmp.8.i32139 ; <double> [#uses=1]
- store double %tmp.9.i32140, double* %tmp.7.i32138
- %tmp.0.i32141 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i32134, %"struct.std::dcomplex"* %ret4 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i32143 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32141, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i32144 = load double* %tmp.14.i32143 ; <double> [#uses=1]
- %tmp.17.i32146 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32141, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i32147 = load double* %tmp.17.i32146 ; <double> [#uses=1]
- %tmp.7.i32101 = load double* %tmp.2.i34368 ; <double> [#uses=1]
- %tmp.15.i32115 = add double %tmp.7.i32101, %tmp.15.i32144 ; <double> [#uses=1]
- store double %tmp.15.i32115, double* %tmp.2.i34368
- %tmp.26.i32122 = load double* %tmp.6.i34369 ; <double> [#uses=1]
- %tmp.31.i32133 = add double %tmp.26.i32122, %tmp.18.i32147 ; <double> [#uses=1]
- store double %tmp.31.i32133, double* %tmp.6.i34369
- store double 0.000000e+00, double* %tmp.2.i34366
- store double 0.000000e+00, double* %tmp.6.i34367
- %tmp.4.i32079 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32078, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i32081 = load double* %tmp.5.i34082 ; <double> [#uses=1]
- store double %tmp.6.i32081, double* %tmp.4.i32079
- %tmp.7.i32082 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32078, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i32084 = load double* %tmp.8.i34085 ; <double> [#uses=1]
- store double %tmp.9.i32084, double* %tmp.7.i32082
- %tmp.0.i32085 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i32078, %"struct.std::dcomplex"* %tmp.226 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i32087 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32085, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i32088 = load double* %tmp.14.i32087 ; <double> [#uses=1]
- %tmp.17.i32090 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32085, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i32091 = load double* %tmp.17.i32090 ; <double> [#uses=1]
- %tmp.4.i32065 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32064, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i32067 = load double* %tmp.5.i33146 ; <double> [#uses=1]
- store double %tmp.6.i32067, double* %tmp.4.i32065
- %tmp.7.i32068 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32064, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i32070 = load double* %tmp.8.i33149 ; <double> [#uses=1]
- store double %tmp.9.i32070, double* %tmp.7.i32068
- %tmp.0.i32071 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i32064, %"struct.std::dcomplex"* %tmp.62 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i32072 = getelementptr %"struct.std::dcomplex"* %mem_tmp.127, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i32073 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32071, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i32074 = load double* %tmp.14.i32073 ; <double> [#uses=1]
- store double %tmp.15.i32074, double* %tmp.13.i32072
- %tmp.16.i32075 = getelementptr %"struct.std::dcomplex"* %mem_tmp.127, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i32076 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32071, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i32077 = load double* %tmp.17.i32076 ; <double> [#uses=1]
- store double %tmp.18.i32077, double* %tmp.16.i32075
- %tmp.4.i32051 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32050, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i32088, double* %tmp.4.i32051
- %tmp.7.i32054 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32050, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i32091, double* %tmp.7.i32054
- %tmp.0.i32057 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i32050, %"struct.std::dcomplex"* %mem_tmp.127 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i32059 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32057, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i32060 = load double* %tmp.14.i32059 ; <double> [#uses=1]
- %tmp.17.i32062 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32057, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i32063 = load double* %tmp.17.i32062 ; <double> [#uses=1]
- %tmp.4.i32037 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32036, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i32060, double* %tmp.4.i32037
- %tmp.7.i32040 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32036, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i32063, double* %tmp.7.i32040
- %tmp.0.i32043 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i32036, %"struct.std::dcomplex"* %tmp.15 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i32045 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32043, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i32046 = load double* %tmp.14.i32045 ; <double> [#uses=1]
- %tmp.17.i32048 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32043, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i32049 = load double* %tmp.17.i32048 ; <double> [#uses=1]
- %tmp.4.i32023 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32022, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i32025 = load double* %tmp.5.i33146 ; <double> [#uses=1]
- store double %tmp.6.i32025, double* %tmp.4.i32023
- %tmp.7.i32026 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32022, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i32028 = load double* %tmp.8.i33149 ; <double> [#uses=1]
- store double %tmp.9.i32028, double* %tmp.7.i32026
- %tmp.0.i32029 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i32022, %"struct.std::dcomplex"* %tmp.21 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i32031 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32029, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i32032 = load double* %tmp.14.i32031 ; <double> [#uses=1]
- %tmp.17.i32034 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32029, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i32035 = load double* %tmp.17.i32034 ; <double> [#uses=1]
- %tmp.4.i32009 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32008, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i32011 = load double* %tmp.5.i34282 ; <double> [#uses=1]
- store double %tmp.6.i32011, double* %tmp.4.i32009
- %tmp.7.i32012 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32008, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i32014 = load double* %tmp.8.i34285 ; <double> [#uses=1]
- store double %tmp.9.i32014, double* %tmp.7.i32012
- %tmp.0.i32015 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i32008, %"struct.std::dcomplex"* %tmp.226 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i32016 = getelementptr %"struct.std::dcomplex"* %mem_tmp.131, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i32017 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32015, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i32018 = load double* %tmp.14.i32017 ; <double> [#uses=1]
- store double %tmp.15.i32018, double* %tmp.13.i32016
- %tmp.16.i32019 = getelementptr %"struct.std::dcomplex"* %mem_tmp.131, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i32020 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32015, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i32021 = load double* %tmp.17.i32020 ; <double> [#uses=1]
- store double %tmp.18.i32021, double* %tmp.16.i32019
- %tmp.4.i31995 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i31994, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i32032, double* %tmp.4.i31995
- %tmp.7.i31998 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i31994, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i32035, double* %tmp.7.i31998
- %tmp.0.i32001 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i31994, %"struct.std::dcomplex"* %mem_tmp.131 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i32003 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32001, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i32004 = load double* %tmp.14.i32003 ; <double> [#uses=1]
- %tmp.17.i32006 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32001, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i32007 = load double* %tmp.17.i32006 ; <double> [#uses=1]
- %tmp.4.i31981 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i31980, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i32004, double* %tmp.4.i31981
- %tmp.7.i31984 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i31980, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i32007, double* %tmp.7.i31984
- %tmp.0.i31987 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i31980, %"struct.std::dcomplex"* %tmp.95 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i31988 = getelementptr %"struct.std::dcomplex"* %mem_tmp.128, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i31989 = getelementptr %"struct.std::dcomplex"* %tmp.0.i31987, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i31990 = load double* %tmp.14.i31989 ; <double> [#uses=1]
- store double %tmp.15.i31990, double* %tmp.13.i31988
- %tmp.16.i31991 = getelementptr %"struct.std::dcomplex"* %mem_tmp.128, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i31992 = getelementptr %"struct.std::dcomplex"* %tmp.0.i31987, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i31993 = load double* %tmp.17.i31992 ; <double> [#uses=1]
- store double %tmp.18.i31993, double* %tmp.16.i31991
- %tmp.4.i31967 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i31966, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i32046, double* %tmp.4.i31967
- %tmp.7.i31970 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i31966, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i32049, double* %tmp.7.i31970
- %tmp.0.i31973 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i31966, %"struct.std::dcomplex"* %mem_tmp.128 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i31975 = getelementptr %"struct.std::dcomplex"* %tmp.0.i31973, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i31976 = load double* %tmp.14.i31975 ; <double> [#uses=1]
- %tmp.17.i31978 = getelementptr %"struct.std::dcomplex"* %tmp.0.i31973, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i31979 = load double* %tmp.17.i31978 ; <double> [#uses=1]
- %tmp.4.i31953 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i31952, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i31955 = load double* %tmp.5.i34282 ; <double> [#uses=1]
- store double %tmp.6.i31955, double* %tmp.4.i31953
- %tmp.7.i31956 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i31952, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i31958 = load double* %tmp.8.i34285 ; <double> [#uses=1]
- store double %tmp.9.i31958, double* %tmp.7.i31956
- %tmp.0.i31959 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i31952, %"struct.std::dcomplex"* %tmp.62 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i31961 = getelementptr %"struct.std::dcomplex"* %tmp.0.i31959, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i31962 = load double* %tmp.14.i31961 ; <double> [#uses=1]
- %tmp.17.i31964 = getelementptr %"struct.std::dcomplex"* %tmp.0.i31959, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i31965 = load double* %tmp.17.i31964 ; <double> [#uses=1]
- %tmp.4.i31939 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i31938, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i31941 = load double* %tmp.5.i34082 ; <double> [#uses=1]
- store double %tmp.6.i31941, double* %tmp.4.i31939
- %tmp.7.i31942 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i31938, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i31944 = load double* %tmp.8.i34085 ; <double> [#uses=1]
- store double %tmp.9.i31944, double* %tmp.7.i31942
- %tmp.0.i31945 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i31938, %"struct.std::dcomplex"* %tmp.21 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i31946 = getelementptr %"struct.std::dcomplex"* %mem_tmp.135, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i31947 = getelementptr %"struct.std::dcomplex"* %tmp.0.i31945, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i31948 = load double* %tmp.14.i31947 ; <double> [#uses=1]
- store double %tmp.15.i31948, double* %tmp.13.i31946
- %tmp.16.i31949 = getelementptr %"struct.std::dcomplex"* %mem_tmp.135, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i31950 = getelementptr %"struct.std::dcomplex"* %tmp.0.i31945, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i31951 = load double* %tmp.17.i31950 ; <double> [#uses=1]
- store double %tmp.18.i31951, double* %tmp.16.i31949
- %tmp.4.i31925 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i31924, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i31962, double* %tmp.4.i31925
- %tmp.7.i31928 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i31924, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i31965, double* %tmp.7.i31928
- %tmp.0.i31931 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i31924, %"struct.std::dcomplex"* %mem_tmp.135 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i31933 = getelementptr %"struct.std::dcomplex"* %tmp.0.i31931, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i31934 = load double* %tmp.14.i31933 ; <double> [#uses=1]
- %tmp.17.i31936 = getelementptr %"struct.std::dcomplex"* %tmp.0.i31931, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i31937 = load double* %tmp.17.i31936 ; <double> [#uses=1]
- %tmp.4.i31911 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i31910, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i31934, double* %tmp.4.i31911
- %tmp.7.i31914 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i31910, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i31937, double* %tmp.7.i31914
- %tmp.0.i31917 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i31910, %"struct.std::dcomplex"* %tmp.220 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i31918 = getelementptr %"struct.std::dcomplex"* %mem_tmp.132, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i31919 = getelementptr %"struct.std::dcomplex"* %tmp.0.i31917, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i31920 = load double* %tmp.14.i31919 ; <double> [#uses=1]
- store double %tmp.15.i31920, double* %tmp.13.i31918
- %tmp.16.i31921 = getelementptr %"struct.std::dcomplex"* %mem_tmp.132, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i31922 = getelementptr %"struct.std::dcomplex"* %tmp.0.i31917, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i31923 = load double* %tmp.17.i31922 ; <double> [#uses=1]
- store double %tmp.18.i31923, double* %tmp.16.i31921
- %tmp.4.i31897 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i31896, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i31976, double* %tmp.4.i31897
- %tmp.7.i31900 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i31896, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i31979, double* %tmp.7.i31900
- %tmp.0.i31903 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i31896, %"struct.std::dcomplex"* %mem_tmp.132 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i31905 = getelementptr %"struct.std::dcomplex"* %tmp.0.i31903, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i31906 = load double* %tmp.14.i31905 ; <double> [#uses=1]
- %tmp.17.i31908 = getelementptr %"struct.std::dcomplex"* %tmp.0.i31903, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i31909 = load double* %tmp.17.i31908 ; <double> [#uses=1]
- store double %tmp.15.i31906, double* %tmp.2.i34364
- store double %tmp.18.i31909, double* %tmp.6.i34365
- %tmp.4.i31863 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i31862, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i31865 = load double* %tmp.5.i33866 ; <double> [#uses=1]
- store double %tmp.6.i31865, double* %tmp.4.i31863
- %tmp.7.i31866 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i31862, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i31868 = load double* %tmp.8.i33869 ; <double> [#uses=1]
- store double %tmp.9.i31868, double* %tmp.7.i31866
- %tmp.0.i31869 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i31862, %"struct.std::dcomplex"* %ret3 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i31871 = getelementptr %"struct.std::dcomplex"* %tmp.0.i31869, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i31872 = load double* %tmp.14.i31871 ; <double> [#uses=1]
- %tmp.17.i31874 = getelementptr %"struct.std::dcomplex"* %tmp.0.i31869, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i31875 = load double* %tmp.17.i31874 ; <double> [#uses=1]
- %tmp.7.i31829 = load double* %tmp.2.i34366 ; <double> [#uses=1]
- %tmp.15.i31843 = add double %tmp.7.i31829, %tmp.15.i31872 ; <double> [#uses=1]
- store double %tmp.15.i31843, double* %tmp.2.i34366
- %tmp.26.i31850 = load double* %tmp.6.i34367 ; <double> [#uses=1]
- %tmp.31.i31861 = add double %tmp.26.i31850, %tmp.18.i31875 ; <double> [#uses=1]
- store double %tmp.31.i31861, double* %tmp.6.i34367
- %tmp.4.i31809 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i31808, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i31811 = load double* %tmp.5.i34082 ; <double> [#uses=1]
- store double %tmp.6.i31811, double* %tmp.4.i31809
- %tmp.7.i31812 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i31808, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i31814 = load double* %tmp.8.i34085 ; <double> [#uses=1]
- store double %tmp.9.i31814, double* %tmp.7.i31812
- %tmp.0.i31815 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i31808, %"struct.std::dcomplex"* %tmp.12 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i31817 = getelementptr %"struct.std::dcomplex"* %tmp.0.i31815, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i31818 = load double* %tmp.14.i31817 ; <double> [#uses=1]
- %tmp.17.i31820 = getelementptr %"struct.std::dcomplex"* %tmp.0.i31815, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i31821 = load double* %tmp.17.i31820 ; <double> [#uses=1]
- %tmp.4.i31795 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i31794, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i31797 = load double* %tmp.5.i34352 ; <double> [#uses=1]
- store double %tmp.6.i31797, double* %tmp.4.i31795
- %tmp.7.i31798 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i31794, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i31800 = load double* %tmp.8.i34355 ; <double> [#uses=1]
- store double %tmp.9.i31800, double* %tmp.7.i31798
- %tmp.0.i31801 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i31794, %"struct.std::dcomplex"* %tmp.62 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i31802 = getelementptr %"struct.std::dcomplex"* %mem_tmp.142, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i31803 = getelementptr %"struct.std::dcomplex"* %tmp.0.i31801, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i31804 = load double* %tmp.14.i31803 ; <double> [#uses=1]
- store double %tmp.15.i31804, double* %tmp.13.i31802
- %tmp.16.i31805 = getelementptr %"struct.std::dcomplex"* %mem_tmp.142, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i31806 = getelementptr %"struct.std::dcomplex"* %tmp.0.i31801, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i31807 = load double* %tmp.17.i31806 ; <double> [#uses=1]
- store double %tmp.18.i31807, double* %tmp.16.i31805
- %tmp.4.i31781 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i31780, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i31818, double* %tmp.4.i31781
- %tmp.7.i31784 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i31780, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i31821, double* %tmp.7.i31784
- %tmp.0.i31787 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i31780, %"struct.std::dcomplex"* %mem_tmp.142 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i31789 = getelementptr %"struct.std::dcomplex"* %tmp.0.i31787, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i31790 = load double* %tmp.14.i31789 ; <double> [#uses=1]
- %tmp.17.i31792 = getelementptr %"struct.std::dcomplex"* %tmp.0.i31787, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i31793 = load double* %tmp.17.i31792 ; <double> [#uses=1]
- %tmp.4.i31767 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i31766, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i31790, double* %tmp.4.i31767
- %tmp.7.i31770 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i31766, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i31793, double* %tmp.7.i31770
- %tmp.0.i31773 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i31766, %"struct.std::dcomplex"* %tmp.220 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i31775 = getelementptr %"struct.std::dcomplex"* %tmp.0.i31773, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i31776 = load double* %tmp.14.i31775 ; <double> [#uses=1]
- %tmp.17.i31778 = getelementptr %"struct.std::dcomplex"* %tmp.0.i31773, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i31779 = load double* %tmp.17.i31778 ; <double> [#uses=1]
- %tmp.4.i31753 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i31752, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i31755 = load double* %tmp.5.i33146 ; <double> [#uses=1]
- store double %tmp.6.i31755, double* %tmp.4.i31753
- %tmp.7.i31756 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i31752, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i31758 = load double* %tmp.8.i33149 ; <double> [#uses=1]
- store double %tmp.9.i31758, double* %tmp.7.i31756
- %tmp.0.i31759 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i31752, %"struct.std::dcomplex"* %tmp.62 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i31761 = getelementptr %"struct.std::dcomplex"* %tmp.0.i31759, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i31762 = load double* %tmp.14.i31761 ; <double> [#uses=1]
- %tmp.17.i31764 = getelementptr %"struct.std::dcomplex"* %tmp.0.i31759, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i31765 = load double* %tmp.17.i31764 ; <double> [#uses=1]
- %tmp.4.i31739 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i31738, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i31741 = load double* %tmp.5.i34082 ; <double> [#uses=1]
- store double %tmp.6.i31741, double* %tmp.4.i31739
- %tmp.7.i31742 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i31738, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i31744 = load double* %tmp.8.i34085 ; <double> [#uses=1]
- store double %tmp.9.i31744, double* %tmp.7.i31742
- %tmp.0.i31745 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i31738, %"struct.std::dcomplex"* %tmp.226 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i31746 = getelementptr %"struct.std::dcomplex"* %mem_tmp.146, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i31747 = getelementptr %"struct.std::dcomplex"* %tmp.0.i31745, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i31748 = load double* %tmp.14.i31747 ; <double> [#uses=1]
- store double %tmp.15.i31748, double* %tmp.13.i31746
- %tmp.16.i31749 = getelementptr %"struct.std::dcomplex"* %mem_tmp.146, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i31750 = getelementptr %"struct.std::dcomplex"* %tmp.0.i31745, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i31751 = load double* %tmp.17.i31750 ; <double> [#uses=1]
- store double %tmp.18.i31751, double* %tmp.16.i31749
- %tmp.4.i31725 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i31724, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i31762, double* %tmp.4.i31725
- %tmp.7.i31728 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i31724, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i31765, double* %tmp.7.i31728
- %tmp.0.i31731 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i31724, %"struct.std::dcomplex"* %mem_tmp.146 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i31733 = getelementptr %"struct.std::dcomplex"* %tmp.0.i31731, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i31734 = load double* %tmp.14.i31733 ; <double> [#uses=1]
- %tmp.17.i31736 = getelementptr %"struct.std::dcomplex"* %tmp.0.i31731, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i31737 = load double* %tmp.17.i31736 ; <double> [#uses=1]
- %tmp.4.i31711 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i31710, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i31734, double* %tmp.4.i31711
- %tmp.7.i31714 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i31710, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i31737, double* %tmp.7.i31714
- %tmp.0.i31717 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i31710, %"struct.std::dcomplex"* %tmp.30 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i31718 = getelementptr %"struct.std::dcomplex"* %mem_tmp.143, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i31719 = getelementptr %"struct.std::dcomplex"* %tmp.0.i31717, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i31720 = load double* %tmp.14.i31719 ; <double> [#uses=1]
- store double %tmp.15.i31720, double* %tmp.13.i31718
- %tmp.16.i31721 = getelementptr %"struct.std::dcomplex"* %mem_tmp.143, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i31722 = getelementptr %"struct.std::dcomplex"* %tmp.0.i31717, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i31723 = load double* %tmp.17.i31722 ; <double> [#uses=1]
- store double %tmp.18.i31723, double* %tmp.16.i31721
- %tmp.4.i31697 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i31696, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i31776, double* %tmp.4.i31697
- %tmp.7.i31700 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i31696, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i31779, double* %tmp.7.i31700
- %tmp.0.i31703 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i31696, %"struct.std::dcomplex"* %mem_tmp.143 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i31705 = getelementptr %"struct.std::dcomplex"* %tmp.0.i31703, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i31706 = load double* %tmp.14.i31705 ; <double> [#uses=1]
- %tmp.17.i31708 = getelementptr %"struct.std::dcomplex"* %tmp.0.i31703, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i31709 = load double* %tmp.17.i31708 ; <double> [#uses=1]
- %tmp.4.i31683 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i31682, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i31685 = load double* %tmp.5.i34352 ; <double> [#uses=1]
- store double %tmp.6.i31685, double* %tmp.4.i31683
- %tmp.7.i31686 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i31682, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i31688 = load double* %tmp.8.i34355 ; <double> [#uses=1]
- store double %tmp.9.i31688, double* %tmp.7.i31686
- %tmp.0.i31689 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i31682, %"struct.std::dcomplex"* %tmp.226 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i31691 = getelementptr %"struct.std::dcomplex"* %tmp.0.i31689, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i31692 = load double* %tmp.14.i31691 ; <double> [#uses=1]
- %tmp.17.i31694 = getelementptr %"struct.std::dcomplex"* %tmp.0.i31689, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i31695 = load double* %tmp.17.i31694 ; <double> [#uses=1]
- %tmp.4.i31669 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i31668, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i31671 = load double* %tmp.5.i33146 ; <double> [#uses=1]
- store double %tmp.6.i31671, double* %tmp.4.i31669
- %tmp.7.i31672 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i31668, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i31674 = load double* %tmp.8.i33149 ; <double> [#uses=1]
- store double %tmp.9.i31674, double* %tmp.7.i31672
- %tmp.0.i31675 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i31668, %"struct.std::dcomplex"* %tmp.12 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i31676 = getelementptr %"struct.std::dcomplex"* %mem_tmp.150, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i31677 = getelementptr %"struct.std::dcomplex"* %tmp.0.i31675, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i31678 = load double* %tmp.14.i31677 ; <double> [#uses=1]
- store double %tmp.15.i31678, double* %tmp.13.i31676
- %tmp.16.i31679 = getelementptr %"struct.std::dcomplex"* %mem_tmp.150, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i31680 = getelementptr %"struct.std::dcomplex"* %tmp.0.i31675, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i31681 = load double* %tmp.17.i31680 ; <double> [#uses=1]
- store double %tmp.18.i31681, double* %tmp.16.i31679
- %tmp.4.i31655 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i31654, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i31692, double* %tmp.4.i31655
- %tmp.7.i31658 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i31654, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i31695, double* %tmp.7.i31658
- %tmp.0.i31661 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i31654, %"struct.std::dcomplex"* %mem_tmp.150 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i31663 = getelementptr %"struct.std::dcomplex"* %tmp.0.i31661, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i31664 = load double* %tmp.14.i31663 ; <double> [#uses=1]
- %tmp.17.i31666 = getelementptr %"struct.std::dcomplex"* %tmp.0.i31661, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i31667 = load double* %tmp.17.i31666 ; <double> [#uses=1]
- %tmp.4.i31641 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i31640, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i31664, double* %tmp.4.i31641
- %tmp.7.i31644 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i31640, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i31667, double* %tmp.7.i31644
- %tmp.0.i31647 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i31640, %"struct.std::dcomplex"* %tmp.95 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i31648 = getelementptr %"struct.std::dcomplex"* %mem_tmp.147, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i31649 = getelementptr %"struct.std::dcomplex"* %tmp.0.i31647, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i31650 = load double* %tmp.14.i31649 ; <double> [#uses=1]
- store double %tmp.15.i31650, double* %tmp.13.i31648
- %tmp.16.i31651 = getelementptr %"struct.std::dcomplex"* %mem_tmp.147, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i31652 = getelementptr %"struct.std::dcomplex"* %tmp.0.i31647, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i31653 = load double* %tmp.17.i31652 ; <double> [#uses=1]
- store double %tmp.18.i31653, double* %tmp.16.i31651
- %tmp.4.i31627 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i31626, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i31706, double* %tmp.4.i31627
- %tmp.7.i31630 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i31626, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i31709, double* %tmp.7.i31630
- %tmp.0.i31633 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i31626, %"struct.std::dcomplex"* %mem_tmp.147 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i31635 = getelementptr %"struct.std::dcomplex"* %tmp.0.i31633, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i31636 = load double* %tmp.14.i31635 ; <double> [#uses=1]
- %tmp.17.i31638 = getelementptr %"struct.std::dcomplex"* %tmp.0.i31633, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i31639 = load double* %tmp.17.i31638 ; <double> [#uses=1]
- store double %tmp.15.i31636, double* %tmp.2.i34364
- store double %tmp.18.i31639, double* %tmp.6.i34365
- %tmp.4.i31593 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i31592, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i31595 = load double* %tmp.5.i33326 ; <double> [#uses=1]
- store double %tmp.6.i31595, double* %tmp.4.i31593
- %tmp.7.i31596 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i31592, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i31598 = load double* %tmp.8.i33329 ; <double> [#uses=1]
- store double %tmp.9.i31598, double* %tmp.7.i31596
- %tmp.0.i31599 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i31592, %"struct.std::dcomplex"* %ret3 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i31601 = getelementptr %"struct.std::dcomplex"* %tmp.0.i31599, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i31602 = load double* %tmp.14.i31601 ; <double> [#uses=1]
- %tmp.17.i31604 = getelementptr %"struct.std::dcomplex"* %tmp.0.i31599, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i31605 = load double* %tmp.17.i31604 ; <double> [#uses=1]
- %tmp.7.i31559 = load double* %tmp.2.i34366 ; <double> [#uses=1]
- %tmp.15.i31573 = add double %tmp.7.i31559, %tmp.15.i31602 ; <double> [#uses=1]
- store double %tmp.15.i31573, double* %tmp.2.i34366
- %tmp.26.i31580 = load double* %tmp.6.i34367 ; <double> [#uses=1]
- %tmp.31.i31591 = add double %tmp.26.i31580, %tmp.18.i31605 ; <double> [#uses=1]
- store double %tmp.31.i31591, double* %tmp.6.i34367
- %tmp.4.i31539 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i31538, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i31541 = load double* %tmp.5.i33146 ; <double> [#uses=1]
- store double %tmp.6.i31541, double* %tmp.4.i31539
- %tmp.7.i31542 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i31538, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i31544 = load double* %tmp.8.i33149 ; <double> [#uses=1]
- store double %tmp.9.i31544, double* %tmp.7.i31542
- %tmp.0.i31545 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i31538, %"struct.std::dcomplex"* %tmp.12 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i31547 = getelementptr %"struct.std::dcomplex"* %tmp.0.i31545, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i31548 = load double* %tmp.14.i31547 ; <double> [#uses=1]
- %tmp.17.i31550 = getelementptr %"struct.std::dcomplex"* %tmp.0.i31545, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i31551 = load double* %tmp.17.i31550 ; <double> [#uses=1]
- %tmp.4.i31525 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i31524, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i31527 = load double* %tmp.5.i34352 ; <double> [#uses=1]
- store double %tmp.6.i31527, double* %tmp.4.i31525
- %tmp.7.i31528 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i31524, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i31530 = load double* %tmp.8.i34355 ; <double> [#uses=1]
- store double %tmp.9.i31530, double* %tmp.7.i31528
- %tmp.0.i31531 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i31524, %"struct.std::dcomplex"* %tmp.226 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i31532 = getelementptr %"struct.std::dcomplex"* %mem_tmp.157, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i31533 = getelementptr %"struct.std::dcomplex"* %tmp.0.i31531, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i31534 = load double* %tmp.14.i31533 ; <double> [#uses=1]
- store double %tmp.15.i31534, double* %tmp.13.i31532
- %tmp.16.i31535 = getelementptr %"struct.std::dcomplex"* %mem_tmp.157, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i31536 = getelementptr %"struct.std::dcomplex"* %tmp.0.i31531, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i31537 = load double* %tmp.17.i31536 ; <double> [#uses=1]
- store double %tmp.18.i31537, double* %tmp.16.i31535
- %tmp.4.i31511 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i31510, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i31548, double* %tmp.4.i31511
- %tmp.7.i31514 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i31510, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i31551, double* %tmp.7.i31514
- %tmp.0.i31517 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i31510, %"struct.std::dcomplex"* %mem_tmp.157 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i31519 = getelementptr %"struct.std::dcomplex"* %tmp.0.i31517, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i31520 = load double* %tmp.14.i31519 ; <double> [#uses=1]
- %tmp.17.i31522 = getelementptr %"struct.std::dcomplex"* %tmp.0.i31517, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i31523 = load double* %tmp.17.i31522 ; <double> [#uses=1]
- %tmp.4.i31497 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i31496, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i31520, double* %tmp.4.i31497
- %tmp.7.i31500 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i31496, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i31523, double* %tmp.7.i31500
- %tmp.0.i31503 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i31496, %"struct.std::dcomplex"* %tmp.15 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i31505 = getelementptr %"struct.std::dcomplex"* %tmp.0.i31503, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i31506 = load double* %tmp.14.i31505 ; <double> [#uses=1]
- %tmp.17.i31508 = getelementptr %"struct.std::dcomplex"* %tmp.0.i31503, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i31509 = load double* %tmp.17.i31508 ; <double> [#uses=1]
- %tmp.4.i31483 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i31482, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i31485 = load double* %tmp.5.i34352 ; <double> [#uses=1]
- store double %tmp.6.i31485, double* %tmp.4.i31483
- %tmp.7.i31486 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i31482, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i31488 = load double* %tmp.8.i34355 ; <double> [#uses=1]
- store double %tmp.9.i31488, double* %tmp.7.i31486
- %tmp.0.i31489 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i31482, %"struct.std::dcomplex"* %tmp.21 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i31491 = getelementptr %"struct.std::dcomplex"* %tmp.0.i31489, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i31492 = load double* %tmp.14.i31491 ; <double> [#uses=1]
- %tmp.17.i31494 = getelementptr %"struct.std::dcomplex"* %tmp.0.i31489, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i31495 = load double* %tmp.17.i31494 ; <double> [#uses=1]
- %tmp.4.i31469 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i31468, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i31471 = load double* %tmp.5.i34282 ; <double> [#uses=1]
- store double %tmp.6.i31471, double* %tmp.4.i31469
- %tmp.7.i31472 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i31468, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i31474 = load double* %tmp.8.i34285 ; <double> [#uses=1]
- store double %tmp.9.i31474, double* %tmp.7.i31472
- %tmp.0.i31475 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i31468, %"struct.std::dcomplex"* %tmp.12 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i31476 = getelementptr %"struct.std::dcomplex"* %mem_tmp.161, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i31477 = getelementptr %"struct.std::dcomplex"* %tmp.0.i31475, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i31478 = load double* %tmp.14.i31477 ; <double> [#uses=1]
- store double %tmp.15.i31478, double* %tmp.13.i31476
- %tmp.16.i31479 = getelementptr %"struct.std::dcomplex"* %mem_tmp.161, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i31480 = getelementptr %"struct.std::dcomplex"* %tmp.0.i31475, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i31481 = load double* %tmp.17.i31480 ; <double> [#uses=1]
- store double %tmp.18.i31481, double* %tmp.16.i31479
- %tmp.4.i31455 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i31454, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i31492, double* %tmp.4.i31455
- %tmp.7.i31458 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i31454, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i31495, double* %tmp.7.i31458
- %tmp.0.i31461 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i31454, %"struct.std::dcomplex"* %mem_tmp.161 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i31463 = getelementptr %"struct.std::dcomplex"* %tmp.0.i31461, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i31464 = load double* %tmp.14.i31463 ; <double> [#uses=1]
- %tmp.17.i31466 = getelementptr %"struct.std::dcomplex"* %tmp.0.i31461, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i31467 = load double* %tmp.17.i31466 ; <double> [#uses=1]
- %tmp.4.i31441 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i31440, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i31464, double* %tmp.4.i31441
- %tmp.7.i31444 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i31440, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i31467, double* %tmp.7.i31444
- %tmp.0.i31447 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i31440, %"struct.std::dcomplex"* %tmp.220 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i31448 = getelementptr %"struct.std::dcomplex"* %mem_tmp.158, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i31449 = getelementptr %"struct.std::dcomplex"* %tmp.0.i31447, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i31450 = load double* %tmp.14.i31449 ; <double> [#uses=1]
- store double %tmp.15.i31450, double* %tmp.13.i31448
- %tmp.16.i31451 = getelementptr %"struct.std::dcomplex"* %mem_tmp.158, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i31452 = getelementptr %"struct.std::dcomplex"* %tmp.0.i31447, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i31453 = load double* %tmp.17.i31452 ; <double> [#uses=1]
- store double %tmp.18.i31453, double* %tmp.16.i31451
- %tmp.4.i31427 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i31426, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i31506, double* %tmp.4.i31427
- %tmp.7.i31430 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i31426, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i31509, double* %tmp.7.i31430
- %tmp.0.i31433 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i31426, %"struct.std::dcomplex"* %mem_tmp.158 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i31435 = getelementptr %"struct.std::dcomplex"* %tmp.0.i31433, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i31436 = load double* %tmp.14.i31435 ; <double> [#uses=1]
- %tmp.17.i31438 = getelementptr %"struct.std::dcomplex"* %tmp.0.i31433, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i31439 = load double* %tmp.17.i31438 ; <double> [#uses=1]
- %tmp.4.i31413 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i31412, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i31415 = load double* %tmp.5.i34282 ; <double> [#uses=1]
- store double %tmp.6.i31415, double* %tmp.4.i31413
- %tmp.7.i31416 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i31412, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i31418 = load double* %tmp.8.i34285 ; <double> [#uses=1]
- store double %tmp.9.i31418, double* %tmp.7.i31416
- %tmp.0.i31419 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i31412, %"struct.std::dcomplex"* %tmp.226 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i31421 = getelementptr %"struct.std::dcomplex"* %tmp.0.i31419, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i31422 = load double* %tmp.14.i31421 ; <double> [#uses=1]
- %tmp.17.i31424 = getelementptr %"struct.std::dcomplex"* %tmp.0.i31419, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i31425 = load double* %tmp.17.i31424 ; <double> [#uses=1]
- %tmp.4.i31399 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i31398, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i31401 = load double* %tmp.5.i33146 ; <double> [#uses=1]
- store double %tmp.6.i31401, double* %tmp.4.i31399
- %tmp.7.i31402 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i31398, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i31404 = load double* %tmp.8.i33149 ; <double> [#uses=1]
- store double %tmp.9.i31404, double* %tmp.7.i31402
- %tmp.0.i31405 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i31398, %"struct.std::dcomplex"* %tmp.21 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i31406 = getelementptr %"struct.std::dcomplex"* %mem_tmp.165, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i31407 = getelementptr %"struct.std::dcomplex"* %tmp.0.i31405, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i31408 = load double* %tmp.14.i31407 ; <double> [#uses=1]
- store double %tmp.15.i31408, double* %tmp.13.i31406
- %tmp.16.i31409 = getelementptr %"struct.std::dcomplex"* %mem_tmp.165, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i31410 = getelementptr %"struct.std::dcomplex"* %tmp.0.i31405, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i31411 = load double* %tmp.17.i31410 ; <double> [#uses=1]
- store double %tmp.18.i31411, double* %tmp.16.i31409
- %tmp.4.i31385 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i31384, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i31422, double* %tmp.4.i31385
- %tmp.7.i31388 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i31384, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i31425, double* %tmp.7.i31388
- %tmp.0.i31391 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i31384, %"struct.std::dcomplex"* %mem_tmp.165 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i31393 = getelementptr %"struct.std::dcomplex"* %tmp.0.i31391, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i31394 = load double* %tmp.14.i31393 ; <double> [#uses=1]
- %tmp.17.i31396 = getelementptr %"struct.std::dcomplex"* %tmp.0.i31391, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i31397 = load double* %tmp.17.i31396 ; <double> [#uses=1]
- %tmp.4.i31371 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i31370, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i31394, double* %tmp.4.i31371
- %tmp.7.i31374 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i31370, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i31397, double* %tmp.7.i31374
- %tmp.0.i31377 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i31370, %"struct.std::dcomplex"* %tmp.30 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i31378 = getelementptr %"struct.std::dcomplex"* %mem_tmp.162, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i31379 = getelementptr %"struct.std::dcomplex"* %tmp.0.i31377, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i31380 = load double* %tmp.14.i31379 ; <double> [#uses=1]
- store double %tmp.15.i31380, double* %tmp.13.i31378
- %tmp.16.i31381 = getelementptr %"struct.std::dcomplex"* %mem_tmp.162, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i31382 = getelementptr %"struct.std::dcomplex"* %tmp.0.i31377, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i31383 = load double* %tmp.17.i31382 ; <double> [#uses=1]
- store double %tmp.18.i31383, double* %tmp.16.i31381
- %tmp.4.i31357 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i31356, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i31436, double* %tmp.4.i31357
- %tmp.7.i31360 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i31356, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i31439, double* %tmp.7.i31360
- %tmp.0.i31363 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i31356, %"struct.std::dcomplex"* %mem_tmp.162 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i31365 = getelementptr %"struct.std::dcomplex"* %tmp.0.i31363, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i31366 = load double* %tmp.14.i31365 ; <double> [#uses=1]
- %tmp.17.i31368 = getelementptr %"struct.std::dcomplex"* %tmp.0.i31363, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i31369 = load double* %tmp.17.i31368 ; <double> [#uses=1]
- store double %tmp.15.i31366, double* %tmp.2.i34364
- store double %tmp.18.i31369, double* %tmp.6.i34365
- %tmp.4.i31323 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i31322, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i31325 = load double* %tmp.5.i34136 ; <double> [#uses=1]
- store double %tmp.6.i31325, double* %tmp.4.i31323
- %tmp.7.i31326 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i31322, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i31328 = load double* %tmp.8.i34139 ; <double> [#uses=1]
- store double %tmp.9.i31328, double* %tmp.7.i31326
- %tmp.0.i31329 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i31322, %"struct.std::dcomplex"* %ret3 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i31331 = getelementptr %"struct.std::dcomplex"* %tmp.0.i31329, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i31332 = load double* %tmp.14.i31331 ; <double> [#uses=1]
- %tmp.17.i31334 = getelementptr %"struct.std::dcomplex"* %tmp.0.i31329, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i31335 = load double* %tmp.17.i31334 ; <double> [#uses=1]
- %tmp.7.i31289 = load double* %tmp.2.i34366 ; <double> [#uses=1]
- %tmp.15.i31303 = add double %tmp.7.i31289, %tmp.15.i31332 ; <double> [#uses=1]
- store double %tmp.15.i31303, double* %tmp.2.i34366
- %tmp.26.i31310 = load double* %tmp.6.i34367 ; <double> [#uses=1]
- %tmp.31.i31321 = add double %tmp.26.i31310, %tmp.18.i31335 ; <double> [#uses=1]
- store double %tmp.31.i31321, double* %tmp.6.i34367
- %tmp.4.i31269 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i31268, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i31271 = load double* %tmp.5.i34082 ; <double> [#uses=1]
- store double %tmp.6.i31271, double* %tmp.4.i31269
- %tmp.7.i31272 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i31268, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i31274 = load double* %tmp.8.i34085 ; <double> [#uses=1]
- store double %tmp.9.i31274, double* %tmp.7.i31272
- %tmp.0.i31275 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i31268, %"struct.std::dcomplex"* %tmp.21 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i31277 = getelementptr %"struct.std::dcomplex"* %tmp.0.i31275, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i31278 = load double* %tmp.14.i31277 ; <double> [#uses=1]
- %tmp.17.i31280 = getelementptr %"struct.std::dcomplex"* %tmp.0.i31275, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i31281 = load double* %tmp.17.i31280 ; <double> [#uses=1]
- %tmp.4.i31255 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i31254, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i31257 = load double* %tmp.5.i34282 ; <double> [#uses=1]
- store double %tmp.6.i31257, double* %tmp.4.i31255
- %tmp.7.i31258 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i31254, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i31260 = load double* %tmp.8.i34285 ; <double> [#uses=1]
- store double %tmp.9.i31260, double* %tmp.7.i31258
- %tmp.0.i31261 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i31254, %"struct.std::dcomplex"* %tmp.62 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i31262 = getelementptr %"struct.std::dcomplex"* %mem_tmp.172, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i31263 = getelementptr %"struct.std::dcomplex"* %tmp.0.i31261, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i31264 = load double* %tmp.14.i31263 ; <double> [#uses=1]
- store double %tmp.15.i31264, double* %tmp.13.i31262
- %tmp.16.i31265 = getelementptr %"struct.std::dcomplex"* %mem_tmp.172, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i31266 = getelementptr %"struct.std::dcomplex"* %tmp.0.i31261, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i31267 = load double* %tmp.17.i31266 ; <double> [#uses=1]
- store double %tmp.18.i31267, double* %tmp.16.i31265
- %tmp.4.i31241 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i31240, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i31278, double* %tmp.4.i31241
- %tmp.7.i31244 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i31240, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i31281, double* %tmp.7.i31244
- %tmp.0.i31247 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i31240, %"struct.std::dcomplex"* %mem_tmp.172 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i31249 = getelementptr %"struct.std::dcomplex"* %tmp.0.i31247, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i31250 = load double* %tmp.14.i31249 ; <double> [#uses=1]
- %tmp.17.i31252 = getelementptr %"struct.std::dcomplex"* %tmp.0.i31247, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i31253 = load double* %tmp.17.i31252 ; <double> [#uses=1]
- %tmp.4.i31227 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i31226, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i31250, double* %tmp.4.i31227
- %tmp.7.i31230 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i31226, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i31253, double* %tmp.7.i31230
- %tmp.0.i31233 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i31226, %"struct.std::dcomplex"* %tmp.30 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i31235 = getelementptr %"struct.std::dcomplex"* %tmp.0.i31233, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i31236 = load double* %tmp.14.i31235 ; <double> [#uses=1]
- %tmp.17.i31238 = getelementptr %"struct.std::dcomplex"* %tmp.0.i31233, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i31239 = load double* %tmp.17.i31238 ; <double> [#uses=1]
- %tmp.4.i31213 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i31212, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i31215 = load double* %tmp.5.i34352 ; <double> [#uses=1]
- store double %tmp.6.i31215, double* %tmp.4.i31213
- %tmp.7.i31216 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i31212, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i31218 = load double* %tmp.8.i34355 ; <double> [#uses=1]
- store double %tmp.9.i31218, double* %tmp.7.i31216
- %tmp.0.i31219 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i31212, %"struct.std::dcomplex"* %tmp.62 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i31221 = getelementptr %"struct.std::dcomplex"* %tmp.0.i31219, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i31222 = load double* %tmp.14.i31221 ; <double> [#uses=1]
- %tmp.17.i31224 = getelementptr %"struct.std::dcomplex"* %tmp.0.i31219, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i31225 = load double* %tmp.17.i31224 ; <double> [#uses=1]
- %tmp.4.i31199 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i31198, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i31201 = load double* %tmp.5.i34082 ; <double> [#uses=1]
- store double %tmp.6.i31201, double* %tmp.4.i31199
- %tmp.7.i31202 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i31198, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i31204 = load double* %tmp.8.i34085 ; <double> [#uses=1]
- store double %tmp.9.i31204, double* %tmp.7.i31202
- %tmp.0.i31205 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i31198, %"struct.std::dcomplex"* %tmp.12 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i31206 = getelementptr %"struct.std::dcomplex"* %mem_tmp.176, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i31207 = getelementptr %"struct.std::dcomplex"* %tmp.0.i31205, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i31208 = load double* %tmp.14.i31207 ; <double> [#uses=1]
- store double %tmp.15.i31208, double* %tmp.13.i31206
- %tmp.16.i31209 = getelementptr %"struct.std::dcomplex"* %mem_tmp.176, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i31210 = getelementptr %"struct.std::dcomplex"* %tmp.0.i31205, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i31211 = load double* %tmp.17.i31210 ; <double> [#uses=1]
- store double %tmp.18.i31211, double* %tmp.16.i31209
- %tmp.4.i31185 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i31184, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i31222, double* %tmp.4.i31185
- %tmp.7.i31188 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i31184, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i31225, double* %tmp.7.i31188
- %tmp.0.i31191 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i31184, %"struct.std::dcomplex"* %mem_tmp.176 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i31193 = getelementptr %"struct.std::dcomplex"* %tmp.0.i31191, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i31194 = load double* %tmp.14.i31193 ; <double> [#uses=1]
- %tmp.17.i31196 = getelementptr %"struct.std::dcomplex"* %tmp.0.i31191, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i31197 = load double* %tmp.17.i31196 ; <double> [#uses=1]
- %tmp.4.i31171 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i31170, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i31194, double* %tmp.4.i31171
- %tmp.7.i31174 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i31170, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i31197, double* %tmp.7.i31174
- %tmp.0.i31177 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i31170, %"struct.std::dcomplex"* %tmp.15 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i31178 = getelementptr %"struct.std::dcomplex"* %mem_tmp.173, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i31179 = getelementptr %"struct.std::dcomplex"* %tmp.0.i31177, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i31180 = load double* %tmp.14.i31179 ; <double> [#uses=1]
- store double %tmp.15.i31180, double* %tmp.13.i31178
- %tmp.16.i31181 = getelementptr %"struct.std::dcomplex"* %mem_tmp.173, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i31182 = getelementptr %"struct.std::dcomplex"* %tmp.0.i31177, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i31183 = load double* %tmp.17.i31182 ; <double> [#uses=1]
- store double %tmp.18.i31183, double* %tmp.16.i31181
- %tmp.4.i31157 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i31156, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i31236, double* %tmp.4.i31157
- %tmp.7.i31160 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i31156, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i31239, double* %tmp.7.i31160
- %tmp.0.i31163 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i31156, %"struct.std::dcomplex"* %mem_tmp.173 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i31165 = getelementptr %"struct.std::dcomplex"* %tmp.0.i31163, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i31166 = load double* %tmp.14.i31165 ; <double> [#uses=1]
- %tmp.17.i31168 = getelementptr %"struct.std::dcomplex"* %tmp.0.i31163, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i31169 = load double* %tmp.17.i31168 ; <double> [#uses=1]
- %tmp.4.i31143 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i31142, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i31145 = load double* %tmp.5.i34282 ; <double> [#uses=1]
- store double %tmp.6.i31145, double* %tmp.4.i31143
- %tmp.7.i31146 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i31142, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i31148 = load double* %tmp.8.i34285 ; <double> [#uses=1]
- store double %tmp.9.i31148, double* %tmp.7.i31146
- %tmp.0.i31149 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i31142, %"struct.std::dcomplex"* %tmp.12 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i31151 = getelementptr %"struct.std::dcomplex"* %tmp.0.i31149, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i31152 = load double* %tmp.14.i31151 ; <double> [#uses=1]
- %tmp.17.i31154 = getelementptr %"struct.std::dcomplex"* %tmp.0.i31149, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i31155 = load double* %tmp.17.i31154 ; <double> [#uses=1]
- %tmp.4.i31129 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i31128, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i31131 = load double* %tmp.5.i34352 ; <double> [#uses=1]
- store double %tmp.6.i31131, double* %tmp.4.i31129
- %tmp.7.i31132 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i31128, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i31134 = load double* %tmp.8.i34355 ; <double> [#uses=1]
- store double %tmp.9.i31134, double* %tmp.7.i31132
- %tmp.0.i31135 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i31128, %"struct.std::dcomplex"* %tmp.21 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i31136 = getelementptr %"struct.std::dcomplex"* %mem_tmp.180, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i31137 = getelementptr %"struct.std::dcomplex"* %tmp.0.i31135, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i31138 = load double* %tmp.14.i31137 ; <double> [#uses=1]
- store double %tmp.15.i31138, double* %tmp.13.i31136
- %tmp.16.i31139 = getelementptr %"struct.std::dcomplex"* %mem_tmp.180, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i31140 = getelementptr %"struct.std::dcomplex"* %tmp.0.i31135, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i31141 = load double* %tmp.17.i31140 ; <double> [#uses=1]
- store double %tmp.18.i31141, double* %tmp.16.i31139
- %tmp.4.i31115 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i31114, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i31152, double* %tmp.4.i31115
- %tmp.7.i31118 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i31114, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i31155, double* %tmp.7.i31118
- %tmp.0.i31121 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i31114, %"struct.std::dcomplex"* %mem_tmp.180 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i31123 = getelementptr %"struct.std::dcomplex"* %tmp.0.i31121, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i31124 = load double* %tmp.14.i31123 ; <double> [#uses=1]
- %tmp.17.i31126 = getelementptr %"struct.std::dcomplex"* %tmp.0.i31121, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i31127 = load double* %tmp.17.i31126 ; <double> [#uses=1]
- %tmp.4.i31101 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i31100, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i31124, double* %tmp.4.i31101
- %tmp.7.i31104 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i31100, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i31127, double* %tmp.7.i31104
- %tmp.0.i31107 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i31100, %"struct.std::dcomplex"* %tmp.95 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i31108 = getelementptr %"struct.std::dcomplex"* %mem_tmp.177, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i31109 = getelementptr %"struct.std::dcomplex"* %tmp.0.i31107, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i31110 = load double* %tmp.14.i31109 ; <double> [#uses=1]
- store double %tmp.15.i31110, double* %tmp.13.i31108
- %tmp.16.i31111 = getelementptr %"struct.std::dcomplex"* %mem_tmp.177, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i31112 = getelementptr %"struct.std::dcomplex"* %tmp.0.i31107, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i31113 = load double* %tmp.17.i31112 ; <double> [#uses=1]
- store double %tmp.18.i31113, double* %tmp.16.i31111
- %tmp.4.i31087 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i31086, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i31166, double* %tmp.4.i31087
- %tmp.7.i31090 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i31086, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i31169, double* %tmp.7.i31090
- %tmp.0.i31093 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i31086, %"struct.std::dcomplex"* %mem_tmp.177 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i31095 = getelementptr %"struct.std::dcomplex"* %tmp.0.i31093, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i31096 = load double* %tmp.14.i31095 ; <double> [#uses=1]
- %tmp.17.i31098 = getelementptr %"struct.std::dcomplex"* %tmp.0.i31093, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i31099 = load double* %tmp.17.i31098 ; <double> [#uses=1]
- store double %tmp.15.i31096, double* %tmp.2.i34364
- store double %tmp.18.i31099, double* %tmp.6.i34365
- %tmp.4.i31053 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i31052, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i31055 = load double* %tmp.5.i32460 ; <double> [#uses=1]
- store double %tmp.6.i31055, double* %tmp.4.i31053
- %tmp.7.i31056 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i31052, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i31058 = load double* %tmp.8.i32463 ; <double> [#uses=1]
- store double %tmp.9.i31058, double* %tmp.7.i31056
- %tmp.0.i31059 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i31052, %"struct.std::dcomplex"* %ret3 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i31061 = getelementptr %"struct.std::dcomplex"* %tmp.0.i31059, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i31062 = load double* %tmp.14.i31061 ; <double> [#uses=1]
- %tmp.17.i31064 = getelementptr %"struct.std::dcomplex"* %tmp.0.i31059, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i31065 = load double* %tmp.17.i31064 ; <double> [#uses=1]
- %tmp.7.i31019 = load double* %tmp.2.i34366 ; <double> [#uses=1]
- %tmp.15.i31033 = add double %tmp.7.i31019, %tmp.15.i31062 ; <double> [#uses=1]
- store double %tmp.15.i31033, double* %tmp.2.i34366
- %tmp.26.i31040 = load double* %tmp.6.i34367 ; <double> [#uses=1]
- %tmp.31.i31051 = add double %tmp.26.i31040, %tmp.18.i31065 ; <double> [#uses=1]
- store double %tmp.31.i31051, double* %tmp.6.i34367
- %tmp.4.i30999 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i30998, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.5.i31000 = getelementptr [6 x %"struct.std::dcomplex"]* %_m, i32 4, i32 1, i32 0, i32 0 ; <double*> [#uses=5]
- %tmp.6.i31001 = load double* %tmp.5.i31000 ; <double> [#uses=1]
- store double %tmp.6.i31001, double* %tmp.4.i30999
- %tmp.7.i31002 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i30998, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.8.i31003 = getelementptr [6 x %"struct.std::dcomplex"]* %_m, i32 4, i32 1, i32 0, i32 1 ; <double*> [#uses=5]
- %tmp.9.i31004 = load double* %tmp.8.i31003 ; <double> [#uses=1]
- store double %tmp.9.i31004, double* %tmp.7.i31002
- %tmp.0.i31005 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i30998, %"struct.std::dcomplex"* %ret4 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i31007 = getelementptr %"struct.std::dcomplex"* %tmp.0.i31005, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i31008 = load double* %tmp.14.i31007 ; <double> [#uses=1]
- %tmp.17.i31010 = getelementptr %"struct.std::dcomplex"* %tmp.0.i31005, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i31011 = load double* %tmp.17.i31010 ; <double> [#uses=1]
- %tmp.7.i30965 = load double* %tmp.2.i34368 ; <double> [#uses=1]
- %tmp.15.i30979 = add double %tmp.7.i30965, %tmp.15.i31008 ; <double> [#uses=1]
- store double %tmp.15.i30979, double* %tmp.2.i34368
- %tmp.26.i30986 = load double* %tmp.6.i34369 ; <double> [#uses=1]
- %tmp.31.i30997 = add double %tmp.26.i30986, %tmp.18.i31011 ; <double> [#uses=1]
- store double %tmp.31.i30997, double* %tmp.6.i34369
- store double 0.000000e+00, double* %tmp.2.i34366
- store double 0.000000e+00, double* %tmp.6.i34367
- %tmp.4.i30943 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i30942, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i30945 = load double* %tmp.5.i34352 ; <double> [#uses=1]
- store double %tmp.6.i30945, double* %tmp.4.i30943
- %tmp.7.i30946 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i30942, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i30948 = load double* %tmp.8.i34355 ; <double> [#uses=1]
- store double %tmp.9.i30948, double* %tmp.7.i30946
- %tmp.0.i30949 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i30942, %"struct.std::dcomplex"* %tmp.6 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i30951 = getelementptr %"struct.std::dcomplex"* %tmp.0.i30949, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i30952 = load double* %tmp.14.i30951 ; <double> [#uses=1]
- %tmp.17.i30954 = getelementptr %"struct.std::dcomplex"* %tmp.0.i30949, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i30955 = load double* %tmp.17.i30954 ; <double> [#uses=1]
- %tmp.4.i30929 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i30928, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i30931 = load double* %tmp.5.i34338 ; <double> [#uses=1]
- store double %tmp.6.i30931, double* %tmp.4.i30929
- %tmp.7.i30932 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i30928, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i30934 = load double* %tmp.8.i34341 ; <double> [#uses=1]
- store double %tmp.9.i30934, double* %tmp.7.i30932
- %tmp.0.i30935 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i30928, %"struct.std::dcomplex"* %tmp.12 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i30936 = getelementptr %"struct.std::dcomplex"* %mem_tmp.188, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i30937 = getelementptr %"struct.std::dcomplex"* %tmp.0.i30935, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i30938 = load double* %tmp.14.i30937 ; <double> [#uses=1]
- store double %tmp.15.i30938, double* %tmp.13.i30936
- %tmp.16.i30939 = getelementptr %"struct.std::dcomplex"* %mem_tmp.188, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i30940 = getelementptr %"struct.std::dcomplex"* %tmp.0.i30935, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i30941 = load double* %tmp.17.i30940 ; <double> [#uses=1]
- store double %tmp.18.i30941, double* %tmp.16.i30939
- %tmp.4.i30915 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i30914, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i30952, double* %tmp.4.i30915
- %tmp.7.i30918 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i30914, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i30955, double* %tmp.7.i30918
- %tmp.0.i30921 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i30914, %"struct.std::dcomplex"* %mem_tmp.188 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i30923 = getelementptr %"struct.std::dcomplex"* %tmp.0.i30921, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i30924 = load double* %tmp.14.i30923 ; <double> [#uses=1]
- %tmp.17.i30926 = getelementptr %"struct.std::dcomplex"* %tmp.0.i30921, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i30927 = load double* %tmp.17.i30926 ; <double> [#uses=1]
- %tmp.4.i30901 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i30900, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i30924, double* %tmp.4.i30901
- %tmp.7.i30904 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i30900, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i30927, double* %tmp.7.i30904
- %tmp.0.i30907 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i30900, %"struct.std::dcomplex"* %tmp.95 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i30909 = getelementptr %"struct.std::dcomplex"* %tmp.0.i30907, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i30910 = load double* %tmp.14.i30909 ; <double> [#uses=1]
- %tmp.17.i30912 = getelementptr %"struct.std::dcomplex"* %tmp.0.i30907, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i30913 = load double* %tmp.17.i30912 ; <double> [#uses=1]
- %tmp.4.i30887 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i30886, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i30889 = load double* %tmp.5.i34338 ; <double> [#uses=1]
- store double %tmp.6.i30889, double* %tmp.4.i30887
- %tmp.7.i30890 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i30886, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i30892 = load double* %tmp.8.i34341 ; <double> [#uses=1]
- store double %tmp.9.i30892, double* %tmp.7.i30890
- %tmp.0.i30893 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i30886, %"struct.std::dcomplex"* %tmp.62 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i30895 = getelementptr %"struct.std::dcomplex"* %tmp.0.i30893, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i30896 = load double* %tmp.14.i30895 ; <double> [#uses=1]
- %tmp.17.i30898 = getelementptr %"struct.std::dcomplex"* %tmp.0.i30893, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i30899 = load double* %tmp.17.i30898 ; <double> [#uses=1]
- %tmp.4.i30873 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i30872, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i30875 = load double* %tmp.5.i34082 ; <double> [#uses=1]
- store double %tmp.6.i30875, double* %tmp.4.i30873
- %tmp.7.i30876 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i30872, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i30878 = load double* %tmp.8.i34085 ; <double> [#uses=1]
- store double %tmp.9.i30878, double* %tmp.7.i30876
- %tmp.0.i30879 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i30872, %"struct.std::dcomplex"* %tmp.6 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i30880 = getelementptr %"struct.std::dcomplex"* %mem_tmp.192, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i30881 = getelementptr %"struct.std::dcomplex"* %tmp.0.i30879, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i30882 = load double* %tmp.14.i30881 ; <double> [#uses=1]
- store double %tmp.15.i30882, double* %tmp.13.i30880
- %tmp.16.i30883 = getelementptr %"struct.std::dcomplex"* %mem_tmp.192, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i30884 = getelementptr %"struct.std::dcomplex"* %tmp.0.i30879, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i30885 = load double* %tmp.17.i30884 ; <double> [#uses=1]
- store double %tmp.18.i30885, double* %tmp.16.i30883
- %tmp.4.i30859 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i30858, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i30896, double* %tmp.4.i30859
- %tmp.7.i30862 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i30858, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i30899, double* %tmp.7.i30862
- %tmp.0.i30865 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i30858, %"struct.std::dcomplex"* %mem_tmp.192 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i30867 = getelementptr %"struct.std::dcomplex"* %tmp.0.i30865, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i30868 = load double* %tmp.14.i30867 ; <double> [#uses=1]
- %tmp.17.i30870 = getelementptr %"struct.std::dcomplex"* %tmp.0.i30865, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i30871 = load double* %tmp.17.i30870 ; <double> [#uses=1]
- %tmp.4.i30845 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i30844, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i30868, double* %tmp.4.i30845
- %tmp.7.i30848 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i30844, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i30871, double* %tmp.7.i30848
- %tmp.0.i30851 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i30844, %"struct.std::dcomplex"* %tmp.30 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i30852 = getelementptr %"struct.std::dcomplex"* %mem_tmp.189, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i30853 = getelementptr %"struct.std::dcomplex"* %tmp.0.i30851, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i30854 = load double* %tmp.14.i30853 ; <double> [#uses=1]
- store double %tmp.15.i30854, double* %tmp.13.i30852
- %tmp.16.i30855 = getelementptr %"struct.std::dcomplex"* %mem_tmp.189, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i30856 = getelementptr %"struct.std::dcomplex"* %tmp.0.i30851, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i30857 = load double* %tmp.17.i30856 ; <double> [#uses=1]
- store double %tmp.18.i30857, double* %tmp.16.i30855
- %tmp.4.i30831 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i30830, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i30910, double* %tmp.4.i30831
- %tmp.7.i30834 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i30830, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i30913, double* %tmp.7.i30834
- %tmp.0.i30837 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i30830, %"struct.std::dcomplex"* %mem_tmp.189 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i30839 = getelementptr %"struct.std::dcomplex"* %tmp.0.i30837, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i30840 = load double* %tmp.14.i30839 ; <double> [#uses=1]
- %tmp.17.i30842 = getelementptr %"struct.std::dcomplex"* %tmp.0.i30837, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i30843 = load double* %tmp.17.i30842 ; <double> [#uses=1]
- %tmp.4.i30817 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i30816, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i30819 = load double* %tmp.5.i34082 ; <double> [#uses=1]
- store double %tmp.6.i30819, double* %tmp.4.i30817
- %tmp.7.i30820 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i30816, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i30822 = load double* %tmp.8.i34085 ; <double> [#uses=1]
- store double %tmp.9.i30822, double* %tmp.7.i30820
- %tmp.0.i30823 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i30816, %"struct.std::dcomplex"* %tmp.12 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i30825 = getelementptr %"struct.std::dcomplex"* %tmp.0.i30823, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i30826 = load double* %tmp.14.i30825 ; <double> [#uses=1]
- %tmp.17.i30828 = getelementptr %"struct.std::dcomplex"* %tmp.0.i30823, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i30829 = load double* %tmp.17.i30828 ; <double> [#uses=1]
- %tmp.4.i30803 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i30802, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i30805 = load double* %tmp.5.i34352 ; <double> [#uses=1]
- store double %tmp.6.i30805, double* %tmp.4.i30803
- %tmp.7.i30806 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i30802, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i30808 = load double* %tmp.8.i34355 ; <double> [#uses=1]
- store double %tmp.9.i30808, double* %tmp.7.i30806
- %tmp.0.i30809 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i30802, %"struct.std::dcomplex"* %tmp.62 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i30810 = getelementptr %"struct.std::dcomplex"* %mem_tmp.196, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i30811 = getelementptr %"struct.std::dcomplex"* %tmp.0.i30809, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i30812 = load double* %tmp.14.i30811 ; <double> [#uses=1]
- store double %tmp.15.i30812, double* %tmp.13.i30810
- %tmp.16.i30813 = getelementptr %"struct.std::dcomplex"* %mem_tmp.196, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i30814 = getelementptr %"struct.std::dcomplex"* %tmp.0.i30809, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i30815 = load double* %tmp.17.i30814 ; <double> [#uses=1]
- store double %tmp.18.i30815, double* %tmp.16.i30813
- %tmp.4.i30789 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i30788, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i30826, double* %tmp.4.i30789
- %tmp.7.i30792 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i30788, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i30829, double* %tmp.7.i30792
- %tmp.0.i30795 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i30788, %"struct.std::dcomplex"* %mem_tmp.196 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i30797 = getelementptr %"struct.std::dcomplex"* %tmp.0.i30795, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i30798 = load double* %tmp.14.i30797 ; <double> [#uses=1]
- %tmp.17.i30800 = getelementptr %"struct.std::dcomplex"* %tmp.0.i30795, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i30801 = load double* %tmp.17.i30800 ; <double> [#uses=1]
- %tmp.4.i30775 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i30774, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i30798, double* %tmp.4.i30775
- %tmp.7.i30778 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i30774, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i30801, double* %tmp.7.i30778
- %tmp.0.i30781 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i30774, %"struct.std::dcomplex"* %tmp.45 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i30782 = getelementptr %"struct.std::dcomplex"* %mem_tmp.193, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i30783 = getelementptr %"struct.std::dcomplex"* %tmp.0.i30781, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i30784 = load double* %tmp.14.i30783 ; <double> [#uses=1]
- store double %tmp.15.i30784, double* %tmp.13.i30782
- %tmp.16.i30785 = getelementptr %"struct.std::dcomplex"* %mem_tmp.193, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i30786 = getelementptr %"struct.std::dcomplex"* %tmp.0.i30781, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i30787 = load double* %tmp.17.i30786 ; <double> [#uses=1]
- store double %tmp.18.i30787, double* %tmp.16.i30785
- %tmp.4.i30761 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i30760, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i30840, double* %tmp.4.i30761
- %tmp.7.i30764 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i30760, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i30843, double* %tmp.7.i30764
- %tmp.0.i30767 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i30760, %"struct.std::dcomplex"* %mem_tmp.193 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i30769 = getelementptr %"struct.std::dcomplex"* %tmp.0.i30767, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i30770 = load double* %tmp.14.i30769 ; <double> [#uses=1]
- %tmp.17.i30772 = getelementptr %"struct.std::dcomplex"* %tmp.0.i30767, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i30773 = load double* %tmp.17.i30772 ; <double> [#uses=1]
- store double %tmp.15.i30770, double* %tmp.2.i34364
- store double %tmp.18.i30773, double* %tmp.6.i34365
- %tmp.4.i30727 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i30726, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i30729 = load double* %tmp.5.i32460 ; <double> [#uses=1]
- store double %tmp.6.i30729, double* %tmp.4.i30727
- %tmp.7.i30730 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i30726, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i30732 = load double* %tmp.8.i32463 ; <double> [#uses=1]
- store double %tmp.9.i30732, double* %tmp.7.i30730
- %tmp.0.i30733 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i30726, %"struct.std::dcomplex"* %ret3 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i30735 = getelementptr %"struct.std::dcomplex"* %tmp.0.i30733, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i30736 = load double* %tmp.14.i30735 ; <double> [#uses=1]
- %tmp.17.i30738 = getelementptr %"struct.std::dcomplex"* %tmp.0.i30733, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i30739 = load double* %tmp.17.i30738 ; <double> [#uses=1]
- %tmp.7.i30693 = load double* %tmp.2.i34366 ; <double> [#uses=1]
- %tmp.15.i30707 = add double %tmp.7.i30693, %tmp.15.i30736 ; <double> [#uses=1]
- store double %tmp.15.i30707, double* %tmp.2.i34366
- %tmp.26.i30714 = load double* %tmp.6.i34367 ; <double> [#uses=1]
- %tmp.31.i30725 = add double %tmp.26.i30714, %tmp.18.i30739 ; <double> [#uses=1]
- store double %tmp.31.i30725, double* %tmp.6.i34367
- %tmp.4.i30673 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i30672, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i30675 = load double* %tmp.5.i33146 ; <double> [#uses=1]
- store double %tmp.6.i30675, double* %tmp.4.i30673
- %tmp.7.i30676 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i30672, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i30678 = load double* %tmp.8.i33149 ; <double> [#uses=1]
- store double %tmp.9.i30678, double* %tmp.7.i30676
- %tmp.0.i30679 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i30672, %"struct.std::dcomplex"* %tmp.62 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i30681 = getelementptr %"struct.std::dcomplex"* %tmp.0.i30679, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i30682 = load double* %tmp.14.i30681 ; <double> [#uses=1]
- %tmp.17.i30684 = getelementptr %"struct.std::dcomplex"* %tmp.0.i30679, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i30685 = load double* %tmp.17.i30684 ; <double> [#uses=1]
- %tmp.4.i30659 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i30658, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i30661 = load double* %tmp.5.i34082 ; <double> [#uses=1]
- store double %tmp.6.i30661, double* %tmp.4.i30659
- %tmp.7.i30662 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i30658, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i30664 = load double* %tmp.8.i34085 ; <double> [#uses=1]
- store double %tmp.9.i30664, double* %tmp.7.i30662
- %tmp.0.i30665 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i30658, %"struct.std::dcomplex"* %tmp.226 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i30666 = getelementptr %"struct.std::dcomplex"* %mem_tmp.203, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i30667 = getelementptr %"struct.std::dcomplex"* %tmp.0.i30665, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i30668 = load double* %tmp.14.i30667 ; <double> [#uses=1]
- store double %tmp.15.i30668, double* %tmp.13.i30666
- %tmp.16.i30669 = getelementptr %"struct.std::dcomplex"* %mem_tmp.203, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i30670 = getelementptr %"struct.std::dcomplex"* %tmp.0.i30665, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i30671 = load double* %tmp.17.i30670 ; <double> [#uses=1]
- store double %tmp.18.i30671, double* %tmp.16.i30669
- %tmp.4.i30645 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i30644, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i30682, double* %tmp.4.i30645
- %tmp.7.i30648 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i30644, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i30685, double* %tmp.7.i30648
- %tmp.0.i30651 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i30644, %"struct.std::dcomplex"* %mem_tmp.203 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i30653 = getelementptr %"struct.std::dcomplex"* %tmp.0.i30651, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i30654 = load double* %tmp.14.i30653 ; <double> [#uses=1]
- %tmp.17.i30656 = getelementptr %"struct.std::dcomplex"* %tmp.0.i30651, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i30657 = load double* %tmp.17.i30656 ; <double> [#uses=1]
- %tmp.4.i30631 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i30630, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i30654, double* %tmp.4.i30631
- %tmp.7.i30634 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i30630, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i30657, double* %tmp.7.i30634
- %tmp.0.i30637 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i30630, %"struct.std::dcomplex"* %tmp.45 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i30639 = getelementptr %"struct.std::dcomplex"* %tmp.0.i30637, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i30640 = load double* %tmp.14.i30639 ; <double> [#uses=1]
- %tmp.17.i30642 = getelementptr %"struct.std::dcomplex"* %tmp.0.i30637, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i30643 = load double* %tmp.17.i30642 ; <double> [#uses=1]
- %tmp.4.i30617 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i30616, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i30619 = load double* %tmp.5.i34338 ; <double> [#uses=1]
- store double %tmp.6.i30619, double* %tmp.4.i30617
- %tmp.7.i30620 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i30616, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i30622 = load double* %tmp.8.i34341 ; <double> [#uses=1]
- store double %tmp.9.i30622, double* %tmp.7.i30620
- %tmp.0.i30623 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i30616, %"struct.std::dcomplex"* %tmp.226 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i30625 = getelementptr %"struct.std::dcomplex"* %tmp.0.i30623, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i30626 = load double* %tmp.14.i30625 ; <double> [#uses=1]
- %tmp.17.i30628 = getelementptr %"struct.std::dcomplex"* %tmp.0.i30623, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i30629 = load double* %tmp.17.i30628 ; <double> [#uses=1]
- %tmp.4.i30603 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i30602, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i30605 = load double* %tmp.5.i33146 ; <double> [#uses=1]
- store double %tmp.6.i30605, double* %tmp.4.i30603
- %tmp.7.i30606 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i30602, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i30608 = load double* %tmp.8.i33149 ; <double> [#uses=1]
- store double %tmp.9.i30608, double* %tmp.7.i30606
- %tmp.0.i30609 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i30602, %"struct.std::dcomplex"* %tmp.6 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i30610 = getelementptr %"struct.std::dcomplex"* %mem_tmp.207, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i30611 = getelementptr %"struct.std::dcomplex"* %tmp.0.i30609, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i30612 = load double* %tmp.14.i30611 ; <double> [#uses=1]
- store double %tmp.15.i30612, double* %tmp.13.i30610
- %tmp.16.i30613 = getelementptr %"struct.std::dcomplex"* %mem_tmp.207, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i30614 = getelementptr %"struct.std::dcomplex"* %tmp.0.i30609, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i30615 = load double* %tmp.17.i30614 ; <double> [#uses=1]
- store double %tmp.18.i30615, double* %tmp.16.i30613
- %tmp.4.i30589 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i30588, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i30626, double* %tmp.4.i30589
- %tmp.7.i30592 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i30588, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i30629, double* %tmp.7.i30592
- %tmp.0.i30595 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i30588, %"struct.std::dcomplex"* %mem_tmp.207 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i30597 = getelementptr %"struct.std::dcomplex"* %tmp.0.i30595, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i30598 = load double* %tmp.14.i30597 ; <double> [#uses=1]
- %tmp.17.i30600 = getelementptr %"struct.std::dcomplex"* %tmp.0.i30595, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i30601 = load double* %tmp.17.i30600 ; <double> [#uses=1]
- %tmp.4.i30575 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i30574, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i30598, double* %tmp.4.i30575
- %tmp.7.i30578 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i30574, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i30601, double* %tmp.7.i30578
- %tmp.0.i30581 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i30574, %"struct.std::dcomplex"* %tmp.95 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i30582 = getelementptr %"struct.std::dcomplex"* %mem_tmp.204, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i30583 = getelementptr %"struct.std::dcomplex"* %tmp.0.i30581, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i30584 = load double* %tmp.14.i30583 ; <double> [#uses=1]
- store double %tmp.15.i30584, double* %tmp.13.i30582
- %tmp.16.i30585 = getelementptr %"struct.std::dcomplex"* %mem_tmp.204, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i30586 = getelementptr %"struct.std::dcomplex"* %tmp.0.i30581, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i30587 = load double* %tmp.17.i30586 ; <double> [#uses=1]
- store double %tmp.18.i30587, double* %tmp.16.i30585
- %tmp.4.i30561 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i30560, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i30640, double* %tmp.4.i30561
- %tmp.7.i30564 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i30560, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i30643, double* %tmp.7.i30564
- %tmp.0.i30567 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i30560, %"struct.std::dcomplex"* %mem_tmp.204 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i30569 = getelementptr %"struct.std::dcomplex"* %tmp.0.i30567, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i30570 = load double* %tmp.14.i30569 ; <double> [#uses=1]
- %tmp.17.i30572 = getelementptr %"struct.std::dcomplex"* %tmp.0.i30567, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i30573 = load double* %tmp.17.i30572 ; <double> [#uses=1]
- %tmp.4.i30547 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i30546, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i30549 = load double* %tmp.5.i34082 ; <double> [#uses=1]
- store double %tmp.6.i30549, double* %tmp.4.i30547
- %tmp.7.i30550 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i30546, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i30552 = load double* %tmp.8.i34085 ; <double> [#uses=1]
- store double %tmp.9.i30552, double* %tmp.7.i30550
- %tmp.0.i30553 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i30546, %"struct.std::dcomplex"* %tmp.6 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i30555 = getelementptr %"struct.std::dcomplex"* %tmp.0.i30553, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i30556 = load double* %tmp.14.i30555 ; <double> [#uses=1]
- %tmp.17.i30558 = getelementptr %"struct.std::dcomplex"* %tmp.0.i30553, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i30559 = load double* %tmp.17.i30558 ; <double> [#uses=1]
- %tmp.4.i30533 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i30532, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i30535 = load double* %tmp.5.i34338 ; <double> [#uses=1]
- store double %tmp.6.i30535, double* %tmp.4.i30533
- %tmp.7.i30536 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i30532, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i30538 = load double* %tmp.8.i34341 ; <double> [#uses=1]
- store double %tmp.9.i30538, double* %tmp.7.i30536
- %tmp.0.i30539 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i30532, %"struct.std::dcomplex"* %tmp.62 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i30540 = getelementptr %"struct.std::dcomplex"* %mem_tmp.211, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i30541 = getelementptr %"struct.std::dcomplex"* %tmp.0.i30539, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i30542 = load double* %tmp.14.i30541 ; <double> [#uses=1]
- store double %tmp.15.i30542, double* %tmp.13.i30540
- %tmp.16.i30543 = getelementptr %"struct.std::dcomplex"* %mem_tmp.211, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i30544 = getelementptr %"struct.std::dcomplex"* %tmp.0.i30539, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i30545 = load double* %tmp.17.i30544 ; <double> [#uses=1]
- store double %tmp.18.i30545, double* %tmp.16.i30543
- %tmp.4.i30519 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i30518, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i30556, double* %tmp.4.i30519
- %tmp.7.i30522 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i30518, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i30559, double* %tmp.7.i30522
- %tmp.0.i30525 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i30518, %"struct.std::dcomplex"* %mem_tmp.211 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i30527 = getelementptr %"struct.std::dcomplex"* %tmp.0.i30525, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i30528 = load double* %tmp.14.i30527 ; <double> [#uses=1]
- %tmp.17.i30530 = getelementptr %"struct.std::dcomplex"* %tmp.0.i30525, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i30531 = load double* %tmp.17.i30530 ; <double> [#uses=1]
- %tmp.4.i30505 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i30504, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i30528, double* %tmp.4.i30505
- %tmp.7.i30508 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i30504, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i30531, double* %tmp.7.i30508
- %tmp.0.i30511 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i30504, %"struct.std::dcomplex"* %tmp.220 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i30512 = getelementptr %"struct.std::dcomplex"* %mem_tmp.208, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i30513 = getelementptr %"struct.std::dcomplex"* %tmp.0.i30511, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i30514 = load double* %tmp.14.i30513 ; <double> [#uses=1]
- store double %tmp.15.i30514, double* %tmp.13.i30512
- %tmp.16.i30515 = getelementptr %"struct.std::dcomplex"* %mem_tmp.208, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i30516 = getelementptr %"struct.std::dcomplex"* %tmp.0.i30511, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i30517 = load double* %tmp.17.i30516 ; <double> [#uses=1]
- store double %tmp.18.i30517, double* %tmp.16.i30515
- %tmp.4.i30491 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i30490, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i30570, double* %tmp.4.i30491
- %tmp.7.i30494 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i30490, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i30573, double* %tmp.7.i30494
- %tmp.0.i30497 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i30490, %"struct.std::dcomplex"* %mem_tmp.208 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i30499 = getelementptr %"struct.std::dcomplex"* %tmp.0.i30497, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i30500 = load double* %tmp.14.i30499 ; <double> [#uses=1]
- %tmp.17.i30502 = getelementptr %"struct.std::dcomplex"* %tmp.0.i30497, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i30503 = load double* %tmp.17.i30502 ; <double> [#uses=1]
- store double %tmp.15.i30500, double* %tmp.2.i34364
- store double %tmp.18.i30503, double* %tmp.6.i34365
- %tmp.4.i30457 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i30456, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i30459 = load double* %tmp.5.i33866 ; <double> [#uses=1]
- store double %tmp.6.i30459, double* %tmp.4.i30457
- %tmp.7.i30460 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i30456, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i30462 = load double* %tmp.8.i33869 ; <double> [#uses=1]
- store double %tmp.9.i30462, double* %tmp.7.i30460
- %tmp.0.i30463 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i30456, %"struct.std::dcomplex"* %ret3 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i30465 = getelementptr %"struct.std::dcomplex"* %tmp.0.i30463, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i30466 = load double* %tmp.14.i30465 ; <double> [#uses=1]
- %tmp.17.i30468 = getelementptr %"struct.std::dcomplex"* %tmp.0.i30463, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i30469 = load double* %tmp.17.i30468 ; <double> [#uses=1]
- %tmp.7.i30423 = load double* %tmp.2.i34366 ; <double> [#uses=1]
- %tmp.15.i30437 = add double %tmp.7.i30423, %tmp.15.i30466 ; <double> [#uses=1]
- store double %tmp.15.i30437, double* %tmp.2.i34366
- %tmp.26.i30444 = load double* %tmp.6.i34367 ; <double> [#uses=1]
- %tmp.31.i30455 = add double %tmp.26.i30444, %tmp.18.i30469 ; <double> [#uses=1]
- store double %tmp.31.i30455, double* %tmp.6.i34367
- %tmp.4.i30403 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i30402, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i30405 = load double* %tmp.5.i34352 ; <double> [#uses=1]
- store double %tmp.6.i30405, double* %tmp.4.i30403
- %tmp.7.i30406 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i30402, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i30408 = load double* %tmp.8.i34355 ; <double> [#uses=1]
- store double %tmp.9.i30408, double* %tmp.7.i30406
- %tmp.0.i30409 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i30402, %"struct.std::dcomplex"* %tmp.62 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i30411 = getelementptr %"struct.std::dcomplex"* %tmp.0.i30409, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i30412 = load double* %tmp.14.i30411 ; <double> [#uses=1]
- %tmp.17.i30414 = getelementptr %"struct.std::dcomplex"* %tmp.0.i30409, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i30415 = load double* %tmp.17.i30414 ; <double> [#uses=1]
- %tmp.4.i30389 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i30388, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i30391 = load double* %tmp.5.i34082 ; <double> [#uses=1]
- store double %tmp.6.i30391, double* %tmp.4.i30389
- %tmp.7.i30392 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i30388, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i30394 = load double* %tmp.8.i34085 ; <double> [#uses=1]
- store double %tmp.9.i30394, double* %tmp.7.i30392
- %tmp.0.i30395 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i30388, %"struct.std::dcomplex"* %tmp.12 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i30396 = getelementptr %"struct.std::dcomplex"* %mem_tmp.218, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i30397 = getelementptr %"struct.std::dcomplex"* %tmp.0.i30395, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i30398 = load double* %tmp.14.i30397 ; <double> [#uses=1]
- store double %tmp.15.i30398, double* %tmp.13.i30396
- %tmp.16.i30399 = getelementptr %"struct.std::dcomplex"* %mem_tmp.218, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i30400 = getelementptr %"struct.std::dcomplex"* %tmp.0.i30395, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i30401 = load double* %tmp.17.i30400 ; <double> [#uses=1]
- store double %tmp.18.i30401, double* %tmp.16.i30399
- %tmp.4.i30375 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i30374, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i30412, double* %tmp.4.i30375
- %tmp.7.i30378 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i30374, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i30415, double* %tmp.7.i30378
- %tmp.0.i30381 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i30374, %"struct.std::dcomplex"* %mem_tmp.218 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i30383 = getelementptr %"struct.std::dcomplex"* %tmp.0.i30381, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i30384 = load double* %tmp.14.i30383 ; <double> [#uses=1]
- %tmp.17.i30386 = getelementptr %"struct.std::dcomplex"* %tmp.0.i30381, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i30387 = load double* %tmp.17.i30386 ; <double> [#uses=1]
- %tmp.4.i30361 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i30360, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i30384, double* %tmp.4.i30361
- %tmp.7.i30364 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i30360, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i30387, double* %tmp.7.i30364
- %tmp.0.i30367 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i30360, %"struct.std::dcomplex"* %tmp.220 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i30369 = getelementptr %"struct.std::dcomplex"* %tmp.0.i30367, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i30370 = load double* %tmp.14.i30369 ; <double> [#uses=1]
- %tmp.17.i30372 = getelementptr %"struct.std::dcomplex"* %tmp.0.i30367, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i30373 = load double* %tmp.17.i30372 ; <double> [#uses=1]
- %tmp.4.i30347 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i30346, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i30349 = load double* %tmp.5.i34082 ; <double> [#uses=1]
- store double %tmp.6.i30349, double* %tmp.4.i30347
- %tmp.7.i30350 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i30346, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i30352 = load double* %tmp.8.i34085 ; <double> [#uses=1]
- store double %tmp.9.i30352, double* %tmp.7.i30350
- %tmp.0.i30353 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i30346, %"struct.std::dcomplex"* %tmp.226 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i30355 = getelementptr %"struct.std::dcomplex"* %tmp.0.i30353, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i30356 = load double* %tmp.14.i30355 ; <double> [#uses=1]
- %tmp.17.i30358 = getelementptr %"struct.std::dcomplex"* %tmp.0.i30353, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i30359 = load double* %tmp.17.i30358 ; <double> [#uses=1]
- %tmp.4.i30333 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i30332, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i30335 = load double* %tmp.5.i33146 ; <double> [#uses=1]
- store double %tmp.6.i30335, double* %tmp.4.i30333
- %tmp.7.i30336 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i30332, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i30338 = load double* %tmp.8.i33149 ; <double> [#uses=1]
- store double %tmp.9.i30338, double* %tmp.7.i30336
- %tmp.0.i30339 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i30332, %"struct.std::dcomplex"* %tmp.62 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i30340 = getelementptr %"struct.std::dcomplex"* %mem_tmp.222, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i30341 = getelementptr %"struct.std::dcomplex"* %tmp.0.i30339, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i30342 = load double* %tmp.14.i30341 ; <double> [#uses=1]
- store double %tmp.15.i30342, double* %tmp.13.i30340
- %tmp.16.i30343 = getelementptr %"struct.std::dcomplex"* %mem_tmp.222, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i30344 = getelementptr %"struct.std::dcomplex"* %tmp.0.i30339, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i30345 = load double* %tmp.17.i30344 ; <double> [#uses=1]
- store double %tmp.18.i30345, double* %tmp.16.i30343
- %tmp.4.i30319 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i30318, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i30356, double* %tmp.4.i30319
- %tmp.7.i30322 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i30318, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i30359, double* %tmp.7.i30322
- %tmp.0.i30325 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i30318, %"struct.std::dcomplex"* %mem_tmp.222 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i30327 = getelementptr %"struct.std::dcomplex"* %tmp.0.i30325, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i30328 = load double* %tmp.14.i30327 ; <double> [#uses=1]
- %tmp.17.i30330 = getelementptr %"struct.std::dcomplex"* %tmp.0.i30325, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i30331 = load double* %tmp.17.i30330 ; <double> [#uses=1]
- %tmp.4.i30305 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i30304, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i30328, double* %tmp.4.i30305
- %tmp.7.i30308 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i30304, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i30331, double* %tmp.7.i30308
- %tmp.0.i30311 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i30304, %"struct.std::dcomplex"* %tmp.30 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i30312 = getelementptr %"struct.std::dcomplex"* %mem_tmp.219, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i30313 = getelementptr %"struct.std::dcomplex"* %tmp.0.i30311, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i30314 = load double* %tmp.14.i30313 ; <double> [#uses=1]
- store double %tmp.15.i30314, double* %tmp.13.i30312
- %tmp.16.i30315 = getelementptr %"struct.std::dcomplex"* %mem_tmp.219, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i30316 = getelementptr %"struct.std::dcomplex"* %tmp.0.i30311, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i30317 = load double* %tmp.17.i30316 ; <double> [#uses=1]
- store double %tmp.18.i30317, double* %tmp.16.i30315
- %tmp.4.i30291 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i30290, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i30370, double* %tmp.4.i30291
- %tmp.7.i30294 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i30290, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i30373, double* %tmp.7.i30294
- %tmp.0.i30297 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i30290, %"struct.std::dcomplex"* %mem_tmp.219 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i30299 = getelementptr %"struct.std::dcomplex"* %tmp.0.i30297, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i30300 = load double* %tmp.14.i30299 ; <double> [#uses=1]
- %tmp.17.i30302 = getelementptr %"struct.std::dcomplex"* %tmp.0.i30297, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i30303 = load double* %tmp.17.i30302 ; <double> [#uses=1]
- %tmp.4.i30277 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i30276, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i30279 = load double* %tmp.5.i33146 ; <double> [#uses=1]
- store double %tmp.6.i30279, double* %tmp.4.i30277
- %tmp.7.i30280 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i30276, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i30282 = load double* %tmp.8.i33149 ; <double> [#uses=1]
- store double %tmp.9.i30282, double* %tmp.7.i30280
- %tmp.0.i30283 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i30276, %"struct.std::dcomplex"* %tmp.12 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i30285 = getelementptr %"struct.std::dcomplex"* %tmp.0.i30283, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i30286 = load double* %tmp.14.i30285 ; <double> [#uses=1]
- %tmp.17.i30288 = getelementptr %"struct.std::dcomplex"* %tmp.0.i30283, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i30289 = load double* %tmp.17.i30288 ; <double> [#uses=1]
- %tmp.4.i30263 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i30262, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i30265 = load double* %tmp.5.i34352 ; <double> [#uses=1]
- store double %tmp.6.i30265, double* %tmp.4.i30263
- %tmp.7.i30266 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i30262, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i30268 = load double* %tmp.8.i34355 ; <double> [#uses=1]
- store double %tmp.9.i30268, double* %tmp.7.i30266
- %tmp.0.i30269 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i30262, %"struct.std::dcomplex"* %tmp.226 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i30270 = getelementptr %"struct.std::dcomplex"* %mem_tmp.226, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i30271 = getelementptr %"struct.std::dcomplex"* %tmp.0.i30269, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i30272 = load double* %tmp.14.i30271 ; <double> [#uses=1]
- store double %tmp.15.i30272, double* %tmp.13.i30270
- %tmp.16.i30273 = getelementptr %"struct.std::dcomplex"* %mem_tmp.226, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i30274 = getelementptr %"struct.std::dcomplex"* %tmp.0.i30269, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i30275 = load double* %tmp.17.i30274 ; <double> [#uses=1]
- store double %tmp.18.i30275, double* %tmp.16.i30273
- %tmp.4.i30249 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i30248, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i30286, double* %tmp.4.i30249
- %tmp.7.i30252 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i30248, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i30289, double* %tmp.7.i30252
- %tmp.0.i30255 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i30248, %"struct.std::dcomplex"* %mem_tmp.226 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i30257 = getelementptr %"struct.std::dcomplex"* %tmp.0.i30255, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i30258 = load double* %tmp.14.i30257 ; <double> [#uses=1]
- %tmp.17.i30260 = getelementptr %"struct.std::dcomplex"* %tmp.0.i30255, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i30261 = load double* %tmp.17.i30260 ; <double> [#uses=1]
- %tmp.4.i30235 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i30234, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i30258, double* %tmp.4.i30235
- %tmp.7.i30238 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i30234, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i30261, double* %tmp.7.i30238
- %tmp.0.i30241 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i30234, %"struct.std::dcomplex"* %tmp.95 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i30242 = getelementptr %"struct.std::dcomplex"* %mem_tmp.223, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i30243 = getelementptr %"struct.std::dcomplex"* %tmp.0.i30241, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i30244 = load double* %tmp.14.i30243 ; <double> [#uses=1]
- store double %tmp.15.i30244, double* %tmp.13.i30242
- %tmp.16.i30245 = getelementptr %"struct.std::dcomplex"* %mem_tmp.223, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i30246 = getelementptr %"struct.std::dcomplex"* %tmp.0.i30241, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i30247 = load double* %tmp.17.i30246 ; <double> [#uses=1]
- store double %tmp.18.i30247, double* %tmp.16.i30245
- %tmp.4.i30221 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i30220, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i30300, double* %tmp.4.i30221
- %tmp.7.i30224 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i30220, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i30303, double* %tmp.7.i30224
- %tmp.0.i30227 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i30220, %"struct.std::dcomplex"* %mem_tmp.223 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i30229 = getelementptr %"struct.std::dcomplex"* %tmp.0.i30227, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i30230 = load double* %tmp.14.i30229 ; <double> [#uses=1]
- %tmp.17.i30232 = getelementptr %"struct.std::dcomplex"* %tmp.0.i30227, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i30233 = load double* %tmp.17.i30232 ; <double> [#uses=1]
- store double %tmp.15.i30230, double* %tmp.2.i34364
- store double %tmp.18.i30233, double* %tmp.6.i34365
- %tmp.4.i30187 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i30186, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i30189 = load double* %tmp.5.i33596 ; <double> [#uses=1]
- store double %tmp.6.i30189, double* %tmp.4.i30187
- %tmp.7.i30190 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i30186, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i30192 = load double* %tmp.8.i33599 ; <double> [#uses=1]
- store double %tmp.9.i30192, double* %tmp.7.i30190
- %tmp.0.i30193 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i30186, %"struct.std::dcomplex"* %ret3 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i30195 = getelementptr %"struct.std::dcomplex"* %tmp.0.i30193, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i30196 = load double* %tmp.14.i30195 ; <double> [#uses=1]
- %tmp.17.i30198 = getelementptr %"struct.std::dcomplex"* %tmp.0.i30193, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i30199 = load double* %tmp.17.i30198 ; <double> [#uses=1]
- %tmp.7.i30153 = load double* %tmp.2.i34366 ; <double> [#uses=1]
- %tmp.15.i30167 = add double %tmp.7.i30153, %tmp.15.i30196 ; <double> [#uses=1]
- store double %tmp.15.i30167, double* %tmp.2.i34366
- %tmp.26.i30174 = load double* %tmp.6.i34367 ; <double> [#uses=1]
- %tmp.31.i30185 = add double %tmp.26.i30174, %tmp.18.i30199 ; <double> [#uses=1]
- store double %tmp.31.i30185, double* %tmp.6.i34367
- %tmp.4.i30133 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i30132, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i30135 = load double* %tmp.5.i34352 ; <double> [#uses=1]
- store double %tmp.6.i30135, double* %tmp.4.i30133
- %tmp.7.i30136 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i30132, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i30138 = load double* %tmp.8.i34355 ; <double> [#uses=1]
- store double %tmp.9.i30138, double* %tmp.7.i30136
- %tmp.0.i30139 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i30132, %"struct.std::dcomplex"* %tmp.226 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i30141 = getelementptr %"struct.std::dcomplex"* %tmp.0.i30139, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i30142 = load double* %tmp.14.i30141 ; <double> [#uses=1]
- %tmp.17.i30144 = getelementptr %"struct.std::dcomplex"* %tmp.0.i30139, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i30145 = load double* %tmp.17.i30144 ; <double> [#uses=1]
- %tmp.4.i30119 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i30118, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i30121 = load double* %tmp.5.i33146 ; <double> [#uses=1]
- store double %tmp.6.i30121, double* %tmp.4.i30119
- %tmp.7.i30122 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i30118, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i30124 = load double* %tmp.8.i33149 ; <double> [#uses=1]
- store double %tmp.9.i30124, double* %tmp.7.i30122
- %tmp.0.i30125 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i30118, %"struct.std::dcomplex"* %tmp.12 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i30126 = getelementptr %"struct.std::dcomplex"* %mem_tmp.233, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i30127 = getelementptr %"struct.std::dcomplex"* %tmp.0.i30125, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i30128 = load double* %tmp.14.i30127 ; <double> [#uses=1]
- store double %tmp.15.i30128, double* %tmp.13.i30126
- %tmp.16.i30129 = getelementptr %"struct.std::dcomplex"* %mem_tmp.233, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i30130 = getelementptr %"struct.std::dcomplex"* %tmp.0.i30125, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i30131 = load double* %tmp.17.i30130 ; <double> [#uses=1]
- store double %tmp.18.i30131, double* %tmp.16.i30129
- %tmp.4.i30105 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i30104, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i30142, double* %tmp.4.i30105
- %tmp.7.i30108 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i30104, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i30145, double* %tmp.7.i30108
- %tmp.0.i30111 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i30104, %"struct.std::dcomplex"* %mem_tmp.233 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i30113 = getelementptr %"struct.std::dcomplex"* %tmp.0.i30111, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i30114 = load double* %tmp.14.i30113 ; <double> [#uses=1]
- %tmp.17.i30116 = getelementptr %"struct.std::dcomplex"* %tmp.0.i30111, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i30117 = load double* %tmp.17.i30116 ; <double> [#uses=1]
- %tmp.4.i30091 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i30090, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i30114, double* %tmp.4.i30091
- %tmp.7.i30094 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i30090, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i30117, double* %tmp.7.i30094
- %tmp.0.i30097 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i30090, %"struct.std::dcomplex"* %tmp.45 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i30099 = getelementptr %"struct.std::dcomplex"* %tmp.0.i30097, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i30100 = load double* %tmp.14.i30099 ; <double> [#uses=1]
- %tmp.17.i30102 = getelementptr %"struct.std::dcomplex"* %tmp.0.i30097, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i30103 = load double* %tmp.17.i30102 ; <double> [#uses=1]
- %tmp.4.i30077 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i30076, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i30079 = load double* %tmp.5.i34338 ; <double> [#uses=1]
- store double %tmp.6.i30079, double* %tmp.4.i30077
- %tmp.7.i30080 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i30076, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i30082 = load double* %tmp.8.i34341 ; <double> [#uses=1]
- store double %tmp.9.i30082, double* %tmp.7.i30080
- %tmp.0.i30083 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i30076, %"struct.std::dcomplex"* %tmp.12 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i30085 = getelementptr %"struct.std::dcomplex"* %tmp.0.i30083, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i30086 = load double* %tmp.14.i30085 ; <double> [#uses=1]
- %tmp.17.i30088 = getelementptr %"struct.std::dcomplex"* %tmp.0.i30083, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i30089 = load double* %tmp.17.i30088 ; <double> [#uses=1]
- %tmp.4.i30063 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i30062, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i30065 = load double* %tmp.5.i34352 ; <double> [#uses=1]
- store double %tmp.6.i30065, double* %tmp.4.i30063
- %tmp.7.i30066 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i30062, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i30068 = load double* %tmp.8.i34355 ; <double> [#uses=1]
- store double %tmp.9.i30068, double* %tmp.7.i30066
- %tmp.0.i30069 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i30062, %"struct.std::dcomplex"* %tmp.6 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i30070 = getelementptr %"struct.std::dcomplex"* %mem_tmp.237, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i30071 = getelementptr %"struct.std::dcomplex"* %tmp.0.i30069, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i30072 = load double* %tmp.14.i30071 ; <double> [#uses=1]
- store double %tmp.15.i30072, double* %tmp.13.i30070
- %tmp.16.i30073 = getelementptr %"struct.std::dcomplex"* %mem_tmp.237, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i30074 = getelementptr %"struct.std::dcomplex"* %tmp.0.i30069, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i30075 = load double* %tmp.17.i30074 ; <double> [#uses=1]
- store double %tmp.18.i30075, double* %tmp.16.i30073
- %tmp.4.i30049 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i30048, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i30086, double* %tmp.4.i30049
- %tmp.7.i30052 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i30048, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i30089, double* %tmp.7.i30052
- %tmp.0.i30055 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i30048, %"struct.std::dcomplex"* %mem_tmp.237 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i30057 = getelementptr %"struct.std::dcomplex"* %tmp.0.i30055, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i30058 = load double* %tmp.14.i30057 ; <double> [#uses=1]
- %tmp.17.i30060 = getelementptr %"struct.std::dcomplex"* %tmp.0.i30055, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i30061 = load double* %tmp.17.i30060 ; <double> [#uses=1]
- %tmp.4.i30035 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i30034, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i30058, double* %tmp.4.i30035
- %tmp.7.i30038 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i30034, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i30061, double* %tmp.7.i30038
- %tmp.0.i30041 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i30034, %"struct.std::dcomplex"* %tmp.220 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i30042 = getelementptr %"struct.std::dcomplex"* %mem_tmp.234, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i30043 = getelementptr %"struct.std::dcomplex"* %tmp.0.i30041, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i30044 = load double* %tmp.14.i30043 ; <double> [#uses=1]
- store double %tmp.15.i30044, double* %tmp.13.i30042
- %tmp.16.i30045 = getelementptr %"struct.std::dcomplex"* %mem_tmp.234, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i30046 = getelementptr %"struct.std::dcomplex"* %tmp.0.i30041, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i30047 = load double* %tmp.17.i30046 ; <double> [#uses=1]
- store double %tmp.18.i30047, double* %tmp.16.i30045
- %tmp.4.i30021 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i30020, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i30100, double* %tmp.4.i30021
- %tmp.7.i30024 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i30020, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i30103, double* %tmp.7.i30024
- %tmp.0.i30027 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i30020, %"struct.std::dcomplex"* %mem_tmp.234 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i30029 = getelementptr %"struct.std::dcomplex"* %tmp.0.i30027, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i30030 = load double* %tmp.14.i30029 ; <double> [#uses=1]
- %tmp.17.i30032 = getelementptr %"struct.std::dcomplex"* %tmp.0.i30027, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i30033 = load double* %tmp.17.i30032 ; <double> [#uses=1]
- %tmp.4.i30007 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i30006, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i30009 = load double* %tmp.5.i33146 ; <double> [#uses=1]
- store double %tmp.6.i30009, double* %tmp.4.i30007
- %tmp.7.i30010 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i30006, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i30012 = load double* %tmp.8.i33149 ; <double> [#uses=1]
- store double %tmp.9.i30012, double* %tmp.7.i30010
- %tmp.0.i30013 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i30006, %"struct.std::dcomplex"* %tmp.6 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i30015 = getelementptr %"struct.std::dcomplex"* %tmp.0.i30013, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i30016 = load double* %tmp.14.i30015 ; <double> [#uses=1]
- %tmp.17.i30018 = getelementptr %"struct.std::dcomplex"* %tmp.0.i30013, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i30019 = load double* %tmp.17.i30018 ; <double> [#uses=1]
- %tmp.4.i29993 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i29992, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i29995 = load double* %tmp.5.i34338 ; <double> [#uses=1]
- store double %tmp.6.i29995, double* %tmp.4.i29993
- %tmp.7.i29996 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i29992, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i29998 = load double* %tmp.8.i34341 ; <double> [#uses=1]
- store double %tmp.9.i29998, double* %tmp.7.i29996
- %tmp.0.i29999 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i29992, %"struct.std::dcomplex"* %tmp.226 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i30000 = getelementptr %"struct.std::dcomplex"* %mem_tmp.241, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i30001 = getelementptr %"struct.std::dcomplex"* %tmp.0.i29999, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i30002 = load double* %tmp.14.i30001 ; <double> [#uses=1]
- store double %tmp.15.i30002, double* %tmp.13.i30000
- %tmp.16.i30003 = getelementptr %"struct.std::dcomplex"* %mem_tmp.241, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i30004 = getelementptr %"struct.std::dcomplex"* %tmp.0.i29999, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i30005 = load double* %tmp.17.i30004 ; <double> [#uses=1]
- store double %tmp.18.i30005, double* %tmp.16.i30003
- %tmp.4.i29979 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i29978, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i30016, double* %tmp.4.i29979
- %tmp.7.i29982 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i29978, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i30019, double* %tmp.7.i29982
- %tmp.0.i29985 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i29978, %"struct.std::dcomplex"* %mem_tmp.241 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i29987 = getelementptr %"struct.std::dcomplex"* %tmp.0.i29985, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i29988 = load double* %tmp.14.i29987 ; <double> [#uses=1]
- %tmp.17.i29990 = getelementptr %"struct.std::dcomplex"* %tmp.0.i29985, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i29991 = load double* %tmp.17.i29990 ; <double> [#uses=1]
- %tmp.4.i29965 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i29964, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i29988, double* %tmp.4.i29965
- %tmp.7.i29968 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i29964, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i29991, double* %tmp.7.i29968
- %tmp.0.i29971 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i29964, %"struct.std::dcomplex"* %tmp.30 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i29972 = getelementptr %"struct.std::dcomplex"* %mem_tmp.238, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i29973 = getelementptr %"struct.std::dcomplex"* %tmp.0.i29971, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i29974 = load double* %tmp.14.i29973 ; <double> [#uses=1]
- store double %tmp.15.i29974, double* %tmp.13.i29972
- %tmp.16.i29975 = getelementptr %"struct.std::dcomplex"* %mem_tmp.238, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i29976 = getelementptr %"struct.std::dcomplex"* %tmp.0.i29971, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i29977 = load double* %tmp.17.i29976 ; <double> [#uses=1]
- store double %tmp.18.i29977, double* %tmp.16.i29975
- %tmp.4.i29951 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i29950, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i30030, double* %tmp.4.i29951
- %tmp.7.i29954 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i29950, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i30033, double* %tmp.7.i29954
- %tmp.0.i29957 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i29950, %"struct.std::dcomplex"* %mem_tmp.238 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i29959 = getelementptr %"struct.std::dcomplex"* %tmp.0.i29957, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i29960 = load double* %tmp.14.i29959 ; <double> [#uses=1]
- %tmp.17.i29962 = getelementptr %"struct.std::dcomplex"* %tmp.0.i29957, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i29963 = load double* %tmp.17.i29962 ; <double> [#uses=1]
- store double %tmp.15.i29960, double* %tmp.2.i34364
- store double %tmp.18.i29963, double* %tmp.6.i34365
- %tmp.4.i29917 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i29916, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i29919 = load double* %tmp.5.i34136 ; <double> [#uses=1]
- store double %tmp.6.i29919, double* %tmp.4.i29917
- %tmp.7.i29920 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i29916, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i29922 = load double* %tmp.8.i34139 ; <double> [#uses=1]
- store double %tmp.9.i29922, double* %tmp.7.i29920
- %tmp.0.i29923 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i29916, %"struct.std::dcomplex"* %ret3 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i29925 = getelementptr %"struct.std::dcomplex"* %tmp.0.i29923, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i29926 = load double* %tmp.14.i29925 ; <double> [#uses=1]
- %tmp.17.i29928 = getelementptr %"struct.std::dcomplex"* %tmp.0.i29923, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i29929 = load double* %tmp.17.i29928 ; <double> [#uses=1]
- %tmp.7.i29883 = load double* %tmp.2.i34366 ; <double> [#uses=1]
- %tmp.15.i29897 = add double %tmp.7.i29883, %tmp.15.i29926 ; <double> [#uses=1]
- store double %tmp.15.i29897, double* %tmp.2.i34366
- %tmp.26.i29904 = load double* %tmp.6.i34367 ; <double> [#uses=1]
- %tmp.31.i29915 = add double %tmp.26.i29904, %tmp.18.i29929 ; <double> [#uses=1]
- store double %tmp.31.i29915, double* %tmp.6.i34367
- %tmp.4.i29863 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i29862, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.5.i29864 = getelementptr [6 x %"struct.std::dcomplex"]* %_m, i32 4, i32 2, i32 0, i32 0 ; <double*> [#uses=5]
- %tmp.6.i29865 = load double* %tmp.5.i29864 ; <double> [#uses=1]
- store double %tmp.6.i29865, double* %tmp.4.i29863
- %tmp.7.i29866 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i29862, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.8.i29867 = getelementptr [6 x %"struct.std::dcomplex"]* %_m, i32 4, i32 2, i32 0, i32 1 ; <double*> [#uses=5]
- %tmp.9.i29868 = load double* %tmp.8.i29867 ; <double> [#uses=1]
- store double %tmp.9.i29868, double* %tmp.7.i29866
- %tmp.0.i29869 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i29862, %"struct.std::dcomplex"* %ret4 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i29871 = getelementptr %"struct.std::dcomplex"* %tmp.0.i29869, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i29872 = load double* %tmp.14.i29871 ; <double> [#uses=1]
- %tmp.17.i29874 = getelementptr %"struct.std::dcomplex"* %tmp.0.i29869, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i29875 = load double* %tmp.17.i29874 ; <double> [#uses=1]
- %tmp.7.i29829 = load double* %tmp.2.i34368 ; <double> [#uses=1]
- %tmp.15.i29843 = add double %tmp.7.i29829, %tmp.15.i29872 ; <double> [#uses=1]
- store double %tmp.15.i29843, double* %tmp.2.i34368
- %tmp.26.i29850 = load double* %tmp.6.i34369 ; <double> [#uses=1]
- %tmp.31.i29861 = add double %tmp.26.i29850, %tmp.18.i29875 ; <double> [#uses=1]
- store double %tmp.31.i29861, double* %tmp.6.i34369
- store double 0.000000e+00, double* %tmp.2.i34366
- store double 0.000000e+00, double* %tmp.6.i34367
- %tmp.4.i29807 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i29806, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i29809 = load double* %tmp.5.i34338 ; <double> [#uses=1]
- store double %tmp.6.i29809, double* %tmp.4.i29807
- %tmp.7.i29810 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i29806, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i29812 = load double* %tmp.8.i34341 ; <double> [#uses=1]
- store double %tmp.9.i29812, double* %tmp.7.i29810
- %tmp.0.i29813 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i29806, %"struct.std::dcomplex"* %tmp.226 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i29815 = getelementptr %"struct.std::dcomplex"* %tmp.0.i29813, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i29816 = load double* %tmp.14.i29815 ; <double> [#uses=1]
- %tmp.17.i29818 = getelementptr %"struct.std::dcomplex"* %tmp.0.i29813, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i29819 = load double* %tmp.17.i29818 ; <double> [#uses=1]
- %tmp.4.i29793 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i29792, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i29795 = load double* %tmp.5.i33146 ; <double> [#uses=1]
- store double %tmp.6.i29795, double* %tmp.4.i29793
- %tmp.7.i29796 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i29792, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i29798 = load double* %tmp.8.i33149 ; <double> [#uses=1]
- store double %tmp.9.i29798, double* %tmp.7.i29796
- %tmp.0.i29799 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i29792, %"struct.std::dcomplex"* %tmp.6 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i29800 = getelementptr %"struct.std::dcomplex"* %mem_tmp.249, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i29801 = getelementptr %"struct.std::dcomplex"* %tmp.0.i29799, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i29802 = load double* %tmp.14.i29801 ; <double> [#uses=1]
- store double %tmp.15.i29802, double* %tmp.13.i29800
- %tmp.16.i29803 = getelementptr %"struct.std::dcomplex"* %mem_tmp.249, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i29804 = getelementptr %"struct.std::dcomplex"* %tmp.0.i29799, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i29805 = load double* %tmp.17.i29804 ; <double> [#uses=1]
- store double %tmp.18.i29805, double* %tmp.16.i29803
- %tmp.4.i29779 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i29778, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i29816, double* %tmp.4.i29779
- %tmp.7.i29782 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i29778, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i29819, double* %tmp.7.i29782
- %tmp.0.i29785 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i29778, %"struct.std::dcomplex"* %mem_tmp.249 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i29787 = getelementptr %"struct.std::dcomplex"* %tmp.0.i29785, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i29788 = load double* %tmp.14.i29787 ; <double> [#uses=1]
- %tmp.17.i29790 = getelementptr %"struct.std::dcomplex"* %tmp.0.i29785, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i29791 = load double* %tmp.17.i29790 ; <double> [#uses=1]
- %tmp.4.i29765 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i29764, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i29788, double* %tmp.4.i29765
- %tmp.7.i29768 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i29764, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i29791, double* %tmp.7.i29768
- %tmp.0.i29771 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i29764, %"struct.std::dcomplex"* %tmp.30 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i29773 = getelementptr %"struct.std::dcomplex"* %tmp.0.i29771, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i29774 = load double* %tmp.14.i29773 ; <double> [#uses=1]
- %tmp.17.i29776 = getelementptr %"struct.std::dcomplex"* %tmp.0.i29771, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i29777 = load double* %tmp.17.i29776 ; <double> [#uses=1]
- %tmp.4.i29751 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i29750, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i29753 = load double* %tmp.5.i33146 ; <double> [#uses=1]
- store double %tmp.6.i29753, double* %tmp.4.i29751
- %tmp.7.i29754 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i29750, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i29756 = load double* %tmp.8.i33149 ; <double> [#uses=1]
- store double %tmp.9.i29756, double* %tmp.7.i29754
- %tmp.0.i29757 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i29750, %"struct.std::dcomplex"* %tmp.12 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i29759 = getelementptr %"struct.std::dcomplex"* %tmp.0.i29757, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i29760 = load double* %tmp.14.i29759 ; <double> [#uses=1]
- %tmp.17.i29762 = getelementptr %"struct.std::dcomplex"* %tmp.0.i29757, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i29763 = load double* %tmp.17.i29762 ; <double> [#uses=1]
- %tmp.4.i29737 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i29736, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i29739 = load double* %tmp.5.i34352 ; <double> [#uses=1]
- store double %tmp.6.i29739, double* %tmp.4.i29737
- %tmp.7.i29740 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i29736, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i29742 = load double* %tmp.8.i34355 ; <double> [#uses=1]
- store double %tmp.9.i29742, double* %tmp.7.i29740
- %tmp.0.i29743 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i29736, %"struct.std::dcomplex"* %tmp.226 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i29744 = getelementptr %"struct.std::dcomplex"* %mem_tmp.253, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i29745 = getelementptr %"struct.std::dcomplex"* %tmp.0.i29743, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i29746 = load double* %tmp.14.i29745 ; <double> [#uses=1]
- store double %tmp.15.i29746, double* %tmp.13.i29744
- %tmp.16.i29747 = getelementptr %"struct.std::dcomplex"* %mem_tmp.253, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i29748 = getelementptr %"struct.std::dcomplex"* %tmp.0.i29743, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i29749 = load double* %tmp.17.i29748 ; <double> [#uses=1]
- store double %tmp.18.i29749, double* %tmp.16.i29747
- %tmp.4.i29723 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i29722, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i29760, double* %tmp.4.i29723
- %tmp.7.i29726 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i29722, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i29763, double* %tmp.7.i29726
- %tmp.0.i29729 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i29722, %"struct.std::dcomplex"* %mem_tmp.253 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i29731 = getelementptr %"struct.std::dcomplex"* %tmp.0.i29729, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i29732 = load double* %tmp.14.i29731 ; <double> [#uses=1]
- %tmp.17.i29734 = getelementptr %"struct.std::dcomplex"* %tmp.0.i29729, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i29735 = load double* %tmp.17.i29734 ; <double> [#uses=1]
- %tmp.4.i29709 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i29708, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i29732, double* %tmp.4.i29709
- %tmp.7.i29712 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i29708, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i29735, double* %tmp.7.i29712
- %tmp.0.i29715 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i29708, %"struct.std::dcomplex"* %tmp.45 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i29716 = getelementptr %"struct.std::dcomplex"* %mem_tmp.250, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i29717 = getelementptr %"struct.std::dcomplex"* %tmp.0.i29715, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i29718 = load double* %tmp.14.i29717 ; <double> [#uses=1]
- store double %tmp.15.i29718, double* %tmp.13.i29716
- %tmp.16.i29719 = getelementptr %"struct.std::dcomplex"* %mem_tmp.250, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i29720 = getelementptr %"struct.std::dcomplex"* %tmp.0.i29715, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i29721 = load double* %tmp.17.i29720 ; <double> [#uses=1]
- store double %tmp.18.i29721, double* %tmp.16.i29719
- %tmp.4.i29695 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i29694, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i29774, double* %tmp.4.i29695
- %tmp.7.i29698 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i29694, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i29777, double* %tmp.7.i29698
- %tmp.0.i29701 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i29694, %"struct.std::dcomplex"* %mem_tmp.250 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i29703 = getelementptr %"struct.std::dcomplex"* %tmp.0.i29701, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i29704 = load double* %tmp.14.i29703 ; <double> [#uses=1]
- %tmp.17.i29706 = getelementptr %"struct.std::dcomplex"* %tmp.0.i29701, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i29707 = load double* %tmp.17.i29706 ; <double> [#uses=1]
- %tmp.4.i29681 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i29680, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i29683 = load double* %tmp.5.i34352 ; <double> [#uses=1]
- store double %tmp.6.i29683, double* %tmp.4.i29681
- %tmp.7.i29684 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i29680, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i29686 = load double* %tmp.8.i34355 ; <double> [#uses=1]
- store double %tmp.9.i29686, double* %tmp.7.i29684
- %tmp.0.i29687 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i29680, %"struct.std::dcomplex"* %tmp.6 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i29689 = getelementptr %"struct.std::dcomplex"* %tmp.0.i29687, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i29690 = load double* %tmp.14.i29689 ; <double> [#uses=1]
- %tmp.17.i29692 = getelementptr %"struct.std::dcomplex"* %tmp.0.i29687, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i29693 = load double* %tmp.17.i29692 ; <double> [#uses=1]
- %tmp.4.i29667 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i29666, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i29669 = load double* %tmp.5.i34338 ; <double> [#uses=1]
- store double %tmp.6.i29669, double* %tmp.4.i29667
- %tmp.7.i29670 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i29666, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i29672 = load double* %tmp.8.i34341 ; <double> [#uses=1]
- store double %tmp.9.i29672, double* %tmp.7.i29670
- %tmp.0.i29673 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i29666, %"struct.std::dcomplex"* %tmp.12 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i29674 = getelementptr %"struct.std::dcomplex"* %mem_tmp.257, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i29675 = getelementptr %"struct.std::dcomplex"* %tmp.0.i29673, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i29676 = load double* %tmp.14.i29675 ; <double> [#uses=1]
- store double %tmp.15.i29676, double* %tmp.13.i29674
- %tmp.16.i29677 = getelementptr %"struct.std::dcomplex"* %mem_tmp.257, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i29678 = getelementptr %"struct.std::dcomplex"* %tmp.0.i29673, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i29679 = load double* %tmp.17.i29678 ; <double> [#uses=1]
- store double %tmp.18.i29679, double* %tmp.16.i29677
- %tmp.4.i29653 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i29652, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i29690, double* %tmp.4.i29653
- %tmp.7.i29656 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i29652, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i29693, double* %tmp.7.i29656
- %tmp.0.i29659 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i29652, %"struct.std::dcomplex"* %mem_tmp.257 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i29661 = getelementptr %"struct.std::dcomplex"* %tmp.0.i29659, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i29662 = load double* %tmp.14.i29661 ; <double> [#uses=1]
- %tmp.17.i29664 = getelementptr %"struct.std::dcomplex"* %tmp.0.i29659, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i29665 = load double* %tmp.17.i29664 ; <double> [#uses=1]
- %tmp.4.i29639 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i29638, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i29662, double* %tmp.4.i29639
- %tmp.7.i29642 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i29638, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i29665, double* %tmp.7.i29642
- %tmp.0.i29645 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i29638, %"struct.std::dcomplex"* %tmp.220 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i29646 = getelementptr %"struct.std::dcomplex"* %mem_tmp.254, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i29647 = getelementptr %"struct.std::dcomplex"* %tmp.0.i29645, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i29648 = load double* %tmp.14.i29647 ; <double> [#uses=1]
- store double %tmp.15.i29648, double* %tmp.13.i29646
- %tmp.16.i29649 = getelementptr %"struct.std::dcomplex"* %mem_tmp.254, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i29650 = getelementptr %"struct.std::dcomplex"* %tmp.0.i29645, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i29651 = load double* %tmp.17.i29650 ; <double> [#uses=1]
- store double %tmp.18.i29651, double* %tmp.16.i29649
- %tmp.4.i29625 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i29624, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i29704, double* %tmp.4.i29625
- %tmp.7.i29628 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i29624, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i29707, double* %tmp.7.i29628
- %tmp.0.i29631 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i29624, %"struct.std::dcomplex"* %mem_tmp.254 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i29633 = getelementptr %"struct.std::dcomplex"* %tmp.0.i29631, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i29634 = load double* %tmp.14.i29633 ; <double> [#uses=1]
- %tmp.17.i29636 = getelementptr %"struct.std::dcomplex"* %tmp.0.i29631, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i29637 = load double* %tmp.17.i29636 ; <double> [#uses=1]
- store double %tmp.15.i29634, double* %tmp.2.i34364
- store double %tmp.18.i29637, double* %tmp.6.i34365
- %tmp.4.i29591 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i29590, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i29593 = load double* %tmp.5.i33326 ; <double> [#uses=1]
- store double %tmp.6.i29593, double* %tmp.4.i29591
- %tmp.7.i29594 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i29590, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i29596 = load double* %tmp.8.i33329 ; <double> [#uses=1]
- store double %tmp.9.i29596, double* %tmp.7.i29594
- %tmp.0.i29597 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i29590, %"struct.std::dcomplex"* %ret3 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i29599 = getelementptr %"struct.std::dcomplex"* %tmp.0.i29597, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i29600 = load double* %tmp.14.i29599 ; <double> [#uses=1]
- %tmp.17.i29602 = getelementptr %"struct.std::dcomplex"* %tmp.0.i29597, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i29603 = load double* %tmp.17.i29602 ; <double> [#uses=1]
- %tmp.7.i29557 = load double* %tmp.2.i34366 ; <double> [#uses=1]
- %tmp.15.i29571 = add double %tmp.7.i29557, %tmp.15.i29600 ; <double> [#uses=1]
- store double %tmp.15.i29571, double* %tmp.2.i34366
- %tmp.26.i29578 = load double* %tmp.6.i34367 ; <double> [#uses=1]
- %tmp.31.i29589 = add double %tmp.26.i29578, %tmp.18.i29603 ; <double> [#uses=1]
- store double %tmp.31.i29589, double* %tmp.6.i34367
- %tmp.4.i29537 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i29536, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i29539 = load double* %tmp.5.i34338 ; <double> [#uses=1]
- store double %tmp.6.i29539, double* %tmp.4.i29537
- %tmp.7.i29540 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i29536, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i29542 = load double* %tmp.8.i34341 ; <double> [#uses=1]
- store double %tmp.9.i29542, double* %tmp.7.i29540
- %tmp.0.i29543 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i29536, %"struct.std::dcomplex"* %tmp.12 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i29545 = getelementptr %"struct.std::dcomplex"* %tmp.0.i29543, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i29546 = load double* %tmp.14.i29545 ; <double> [#uses=1]
- %tmp.17.i29548 = getelementptr %"struct.std::dcomplex"* %tmp.0.i29543, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i29549 = load double* %tmp.17.i29548 ; <double> [#uses=1]
- %tmp.4.i29523 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i29522, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i29525 = load double* %tmp.5.i34352 ; <double> [#uses=1]
- store double %tmp.6.i29525, double* %tmp.4.i29523
- %tmp.7.i29526 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i29522, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i29528 = load double* %tmp.8.i34355 ; <double> [#uses=1]
- store double %tmp.9.i29528, double* %tmp.7.i29526
- %tmp.0.i29529 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i29522, %"struct.std::dcomplex"* %tmp.6 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i29530 = getelementptr %"struct.std::dcomplex"* %mem_tmp.264, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i29531 = getelementptr %"struct.std::dcomplex"* %tmp.0.i29529, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i29532 = load double* %tmp.14.i29531 ; <double> [#uses=1]
- store double %tmp.15.i29532, double* %tmp.13.i29530
- %tmp.16.i29533 = getelementptr %"struct.std::dcomplex"* %mem_tmp.264, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i29534 = getelementptr %"struct.std::dcomplex"* %tmp.0.i29529, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i29535 = load double* %tmp.17.i29534 ; <double> [#uses=1]
- store double %tmp.18.i29535, double* %tmp.16.i29533
- %tmp.4.i29509 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i29508, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i29546, double* %tmp.4.i29509
- %tmp.7.i29512 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i29508, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i29549, double* %tmp.7.i29512
- %tmp.0.i29515 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i29508, %"struct.std::dcomplex"* %mem_tmp.264 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i29517 = getelementptr %"struct.std::dcomplex"* %tmp.0.i29515, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i29518 = load double* %tmp.14.i29517 ; <double> [#uses=1]
- %tmp.17.i29520 = getelementptr %"struct.std::dcomplex"* %tmp.0.i29515, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i29521 = load double* %tmp.17.i29520 ; <double> [#uses=1]
- %tmp.4.i29495 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i29494, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i29518, double* %tmp.4.i29495
- %tmp.7.i29498 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i29494, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i29521, double* %tmp.7.i29498
- %tmp.0.i29501 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i29494, %"struct.std::dcomplex"* %tmp.15 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i29503 = getelementptr %"struct.std::dcomplex"* %tmp.0.i29501, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i29504 = load double* %tmp.14.i29503 ; <double> [#uses=1]
- %tmp.17.i29506 = getelementptr %"struct.std::dcomplex"* %tmp.0.i29501, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i29507 = load double* %tmp.17.i29506 ; <double> [#uses=1]
- %tmp.4.i29481 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i29480, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i29483 = load double* %tmp.5.i34282 ; <double> [#uses=1]
- store double %tmp.6.i29483, double* %tmp.4.i29481
- %tmp.7.i29484 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i29480, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i29486 = load double* %tmp.8.i34285 ; <double> [#uses=1]
- store double %tmp.9.i29486, double* %tmp.7.i29484
- %tmp.0.i29487 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i29480, %"struct.std::dcomplex"* %tmp.6 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i29489 = getelementptr %"struct.std::dcomplex"* %tmp.0.i29487, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i29490 = load double* %tmp.14.i29489 ; <double> [#uses=1]
- %tmp.17.i29492 = getelementptr %"struct.std::dcomplex"* %tmp.0.i29487, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i29493 = load double* %tmp.17.i29492 ; <double> [#uses=1]
- %tmp.4.i29467 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i29466, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i29469 = load double* %tmp.5.i34338 ; <double> [#uses=1]
- store double %tmp.6.i29469, double* %tmp.4.i29467
- %tmp.7.i29470 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i29466, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i29472 = load double* %tmp.8.i34341 ; <double> [#uses=1]
- store double %tmp.9.i29472, double* %tmp.7.i29470
- %tmp.0.i29473 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i29466, %"struct.std::dcomplex"* %tmp.21 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i29474 = getelementptr %"struct.std::dcomplex"* %mem_tmp.268, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i29475 = getelementptr %"struct.std::dcomplex"* %tmp.0.i29473, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i29476 = load double* %tmp.14.i29475 ; <double> [#uses=1]
- store double %tmp.15.i29476, double* %tmp.13.i29474
- %tmp.16.i29477 = getelementptr %"struct.std::dcomplex"* %mem_tmp.268, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i29478 = getelementptr %"struct.std::dcomplex"* %tmp.0.i29473, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i29479 = load double* %tmp.17.i29478 ; <double> [#uses=1]
- store double %tmp.18.i29479, double* %tmp.16.i29477
- %tmp.4.i29453 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i29452, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i29490, double* %tmp.4.i29453
- %tmp.7.i29456 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i29452, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i29493, double* %tmp.7.i29456
- %tmp.0.i29459 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i29452, %"struct.std::dcomplex"* %mem_tmp.268 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i29461 = getelementptr %"struct.std::dcomplex"* %tmp.0.i29459, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i29462 = load double* %tmp.14.i29461 ; <double> [#uses=1]
- %tmp.17.i29464 = getelementptr %"struct.std::dcomplex"* %tmp.0.i29459, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i29465 = load double* %tmp.17.i29464 ; <double> [#uses=1]
- %tmp.4.i29439 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i29438, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i29462, double* %tmp.4.i29439
- %tmp.7.i29442 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i29438, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i29465, double* %tmp.7.i29442
- %tmp.0.i29445 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i29438, %"struct.std::dcomplex"* %tmp.30 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i29446 = getelementptr %"struct.std::dcomplex"* %mem_tmp.265, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i29447 = getelementptr %"struct.std::dcomplex"* %tmp.0.i29445, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i29448 = load double* %tmp.14.i29447 ; <double> [#uses=1]
- store double %tmp.15.i29448, double* %tmp.13.i29446
- %tmp.16.i29449 = getelementptr %"struct.std::dcomplex"* %mem_tmp.265, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i29450 = getelementptr %"struct.std::dcomplex"* %tmp.0.i29445, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i29451 = load double* %tmp.17.i29450 ; <double> [#uses=1]
- store double %tmp.18.i29451, double* %tmp.16.i29449
- %tmp.4.i29425 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i29424, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i29504, double* %tmp.4.i29425
- %tmp.7.i29428 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i29424, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i29507, double* %tmp.7.i29428
- %tmp.0.i29431 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i29424, %"struct.std::dcomplex"* %mem_tmp.265 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i29433 = getelementptr %"struct.std::dcomplex"* %tmp.0.i29431, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i29434 = load double* %tmp.14.i29433 ; <double> [#uses=1]
- %tmp.17.i29436 = getelementptr %"struct.std::dcomplex"* %tmp.0.i29431, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i29437 = load double* %tmp.17.i29436 ; <double> [#uses=1]
- %tmp.4.i29411 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i29410, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i29413 = load double* %tmp.5.i34352 ; <double> [#uses=1]
- store double %tmp.6.i29413, double* %tmp.4.i29411
- %tmp.7.i29414 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i29410, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i29416 = load double* %tmp.8.i34355 ; <double> [#uses=1]
- store double %tmp.9.i29416, double* %tmp.7.i29414
- %tmp.0.i29417 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i29410, %"struct.std::dcomplex"* %tmp.21 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i29419 = getelementptr %"struct.std::dcomplex"* %tmp.0.i29417, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i29420 = load double* %tmp.14.i29419 ; <double> [#uses=1]
- %tmp.17.i29422 = getelementptr %"struct.std::dcomplex"* %tmp.0.i29417, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i29423 = load double* %tmp.17.i29422 ; <double> [#uses=1]
- %tmp.4.i29397 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i29396, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i29399 = load double* %tmp.5.i34282 ; <double> [#uses=1]
- store double %tmp.6.i29399, double* %tmp.4.i29397
- %tmp.7.i29400 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i29396, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i29402 = load double* %tmp.8.i34285 ; <double> [#uses=1]
- store double %tmp.9.i29402, double* %tmp.7.i29400
- %tmp.0.i29403 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i29396, %"struct.std::dcomplex"* %tmp.12 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i29404 = getelementptr %"struct.std::dcomplex"* %mem_tmp.272, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i29405 = getelementptr %"struct.std::dcomplex"* %tmp.0.i29403, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i29406 = load double* %tmp.14.i29405 ; <double> [#uses=1]
- store double %tmp.15.i29406, double* %tmp.13.i29404
- %tmp.16.i29407 = getelementptr %"struct.std::dcomplex"* %mem_tmp.272, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i29408 = getelementptr %"struct.std::dcomplex"* %tmp.0.i29403, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i29409 = load double* %tmp.17.i29408 ; <double> [#uses=1]
- store double %tmp.18.i29409, double* %tmp.16.i29407
- %tmp.4.i29383 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i29382, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i29420, double* %tmp.4.i29383
- %tmp.7.i29386 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i29382, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i29423, double* %tmp.7.i29386
- %tmp.0.i29389 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i29382, %"struct.std::dcomplex"* %mem_tmp.272 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i29391 = getelementptr %"struct.std::dcomplex"* %tmp.0.i29389, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i29392 = load double* %tmp.14.i29391 ; <double> [#uses=1]
- %tmp.17.i29394 = getelementptr %"struct.std::dcomplex"* %tmp.0.i29389, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i29395 = load double* %tmp.17.i29394 ; <double> [#uses=1]
- %tmp.4.i29369 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i29368, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i29392, double* %tmp.4.i29369
- %tmp.7.i29372 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i29368, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i29395, double* %tmp.7.i29372
- %tmp.0.i29375 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i29368, %"struct.std::dcomplex"* %tmp.45 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i29376 = getelementptr %"struct.std::dcomplex"* %mem_tmp.269, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i29377 = getelementptr %"struct.std::dcomplex"* %tmp.0.i29375, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i29378 = load double* %tmp.14.i29377 ; <double> [#uses=1]
- store double %tmp.15.i29378, double* %tmp.13.i29376
- %tmp.16.i29379 = getelementptr %"struct.std::dcomplex"* %mem_tmp.269, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i29380 = getelementptr %"struct.std::dcomplex"* %tmp.0.i29375, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i29381 = load double* %tmp.17.i29380 ; <double> [#uses=1]
- store double %tmp.18.i29381, double* %tmp.16.i29379
- %tmp.4.i29355 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i29354, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i29434, double* %tmp.4.i29355
- %tmp.7.i29358 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i29354, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i29437, double* %tmp.7.i29358
- %tmp.0.i29361 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i29354, %"struct.std::dcomplex"* %mem_tmp.269 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i29363 = getelementptr %"struct.std::dcomplex"* %tmp.0.i29361, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i29364 = load double* %tmp.14.i29363 ; <double> [#uses=1]
- %tmp.17.i29366 = getelementptr %"struct.std::dcomplex"* %tmp.0.i29361, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i29367 = load double* %tmp.17.i29366 ; <double> [#uses=1]
- store double %tmp.15.i29364, double* %tmp.2.i34364
- store double %tmp.18.i29367, double* %tmp.6.i34365
- %tmp.4.i29321 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i29320, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i29323 = load double* %tmp.5.i32460 ; <double> [#uses=1]
- store double %tmp.6.i29323, double* %tmp.4.i29321
- %tmp.7.i29324 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i29320, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i29326 = load double* %tmp.8.i32463 ; <double> [#uses=1]
- store double %tmp.9.i29326, double* %tmp.7.i29324
- %tmp.0.i29327 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i29320, %"struct.std::dcomplex"* %ret3 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i29329 = getelementptr %"struct.std::dcomplex"* %tmp.0.i29327, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i29330 = load double* %tmp.14.i29329 ; <double> [#uses=1]
- %tmp.17.i29332 = getelementptr %"struct.std::dcomplex"* %tmp.0.i29327, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i29333 = load double* %tmp.17.i29332 ; <double> [#uses=1]
- %tmp.7.i29287 = load double* %tmp.2.i34366 ; <double> [#uses=1]
- %tmp.15.i29301 = add double %tmp.7.i29287, %tmp.15.i29330 ; <double> [#uses=1]
- store double %tmp.15.i29301, double* %tmp.2.i34366
- %tmp.26.i29308 = load double* %tmp.6.i34367 ; <double> [#uses=1]
- %tmp.31.i29319 = add double %tmp.26.i29308, %tmp.18.i29333 ; <double> [#uses=1]
- store double %tmp.31.i29319, double* %tmp.6.i34367
- %tmp.4.i29267 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i29266, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i29269 = load double* %tmp.5.i34282 ; <double> [#uses=1]
- store double %tmp.6.i29269, double* %tmp.4.i29267
- %tmp.7.i29270 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i29266, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i29272 = load double* %tmp.8.i34285 ; <double> [#uses=1]
- store double %tmp.9.i29272, double* %tmp.7.i29270
- %tmp.0.i29273 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i29266, %"struct.std::dcomplex"* %tmp.226 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i29275 = getelementptr %"struct.std::dcomplex"* %tmp.0.i29273, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i29276 = load double* %tmp.14.i29275 ; <double> [#uses=1]
- %tmp.17.i29278 = getelementptr %"struct.std::dcomplex"* %tmp.0.i29273, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i29279 = load double* %tmp.17.i29278 ; <double> [#uses=1]
- %tmp.4.i29253 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i29252, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i29255 = load double* %tmp.5.i33146 ; <double> [#uses=1]
- store double %tmp.6.i29255, double* %tmp.4.i29253
- %tmp.7.i29256 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i29252, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i29258 = load double* %tmp.8.i33149 ; <double> [#uses=1]
- store double %tmp.9.i29258, double* %tmp.7.i29256
- %tmp.0.i29259 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i29252, %"struct.std::dcomplex"* %tmp.21 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i29260 = getelementptr %"struct.std::dcomplex"* %mem_tmp.279, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i29261 = getelementptr %"struct.std::dcomplex"* %tmp.0.i29259, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i29262 = load double* %tmp.14.i29261 ; <double> [#uses=1]
- store double %tmp.15.i29262, double* %tmp.13.i29260
- %tmp.16.i29263 = getelementptr %"struct.std::dcomplex"* %mem_tmp.279, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i29264 = getelementptr %"struct.std::dcomplex"* %tmp.0.i29259, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i29265 = load double* %tmp.17.i29264 ; <double> [#uses=1]
- store double %tmp.18.i29265, double* %tmp.16.i29263
- %tmp.4.i29239 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i29238, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i29276, double* %tmp.4.i29239
- %tmp.7.i29242 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i29238, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i29279, double* %tmp.7.i29242
- %tmp.0.i29245 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i29238, %"struct.std::dcomplex"* %mem_tmp.279 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i29247 = getelementptr %"struct.std::dcomplex"* %tmp.0.i29245, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i29248 = load double* %tmp.14.i29247 ; <double> [#uses=1]
- %tmp.17.i29250 = getelementptr %"struct.std::dcomplex"* %tmp.0.i29245, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i29251 = load double* %tmp.17.i29250 ; <double> [#uses=1]
- %tmp.4.i29225 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i29224, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i29248, double* %tmp.4.i29225
- %tmp.7.i29228 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i29224, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i29251, double* %tmp.7.i29228
- %tmp.0.i29231 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i29224, %"struct.std::dcomplex"* %tmp.45 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i29233 = getelementptr %"struct.std::dcomplex"* %tmp.0.i29231, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i29234 = load double* %tmp.14.i29233 ; <double> [#uses=1]
- %tmp.17.i29236 = getelementptr %"struct.std::dcomplex"* %tmp.0.i29231, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i29237 = load double* %tmp.17.i29236 ; <double> [#uses=1]
- %tmp.4.i29211 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i29210, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i29213 = load double* %tmp.5.i33146 ; <double> [#uses=1]
- store double %tmp.6.i29213, double* %tmp.4.i29211
- %tmp.7.i29214 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i29210, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i29216 = load double* %tmp.8.i33149 ; <double> [#uses=1]
- store double %tmp.9.i29216, double* %tmp.7.i29214
- %tmp.0.i29217 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i29210, %"struct.std::dcomplex"* %tmp.6 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i29219 = getelementptr %"struct.std::dcomplex"* %tmp.0.i29217, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i29220 = load double* %tmp.14.i29219 ; <double> [#uses=1]
- %tmp.17.i29222 = getelementptr %"struct.std::dcomplex"* %tmp.0.i29217, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i29223 = load double* %tmp.17.i29222 ; <double> [#uses=1]
- %tmp.4.i29197 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i29196, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i29199 = load double* %tmp.5.i34338 ; <double> [#uses=1]
- store double %tmp.6.i29199, double* %tmp.4.i29197
- %tmp.7.i29200 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i29196, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i29202 = load double* %tmp.8.i34341 ; <double> [#uses=1]
- store double %tmp.9.i29202, double* %tmp.7.i29200
- %tmp.0.i29203 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i29196, %"struct.std::dcomplex"* %tmp.226 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i29204 = getelementptr %"struct.std::dcomplex"* %mem_tmp.283, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i29205 = getelementptr %"struct.std::dcomplex"* %tmp.0.i29203, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i29206 = load double* %tmp.14.i29205 ; <double> [#uses=1]
- store double %tmp.15.i29206, double* %tmp.13.i29204
- %tmp.16.i29207 = getelementptr %"struct.std::dcomplex"* %mem_tmp.283, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i29208 = getelementptr %"struct.std::dcomplex"* %tmp.0.i29203, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i29209 = load double* %tmp.17.i29208 ; <double> [#uses=1]
- store double %tmp.18.i29209, double* %tmp.16.i29207
- %tmp.4.i29183 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i29182, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i29220, double* %tmp.4.i29183
- %tmp.7.i29186 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i29182, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i29223, double* %tmp.7.i29186
- %tmp.0.i29189 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i29182, %"struct.std::dcomplex"* %mem_tmp.283 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i29191 = getelementptr %"struct.std::dcomplex"* %tmp.0.i29189, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i29192 = load double* %tmp.14.i29191 ; <double> [#uses=1]
- %tmp.17.i29194 = getelementptr %"struct.std::dcomplex"* %tmp.0.i29189, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i29195 = load double* %tmp.17.i29194 ; <double> [#uses=1]
- %tmp.4.i29169 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i29168, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i29192, double* %tmp.4.i29169
- %tmp.7.i29172 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i29168, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i29195, double* %tmp.7.i29172
- %tmp.0.i29175 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i29168, %"struct.std::dcomplex"* %tmp.15 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i29176 = getelementptr %"struct.std::dcomplex"* %mem_tmp.280, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i29177 = getelementptr %"struct.std::dcomplex"* %tmp.0.i29175, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i29178 = load double* %tmp.14.i29177 ; <double> [#uses=1]
- store double %tmp.15.i29178, double* %tmp.13.i29176
- %tmp.16.i29179 = getelementptr %"struct.std::dcomplex"* %mem_tmp.280, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i29180 = getelementptr %"struct.std::dcomplex"* %tmp.0.i29175, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i29181 = load double* %tmp.17.i29180 ; <double> [#uses=1]
- store double %tmp.18.i29181, double* %tmp.16.i29179
- %tmp.4.i29155 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i29154, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i29234, double* %tmp.4.i29155
- %tmp.7.i29158 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i29154, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i29237, double* %tmp.7.i29158
- %tmp.0.i29161 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i29154, %"struct.std::dcomplex"* %mem_tmp.280 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i29163 = getelementptr %"struct.std::dcomplex"* %tmp.0.i29161, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i29164 = load double* %tmp.14.i29163 ; <double> [#uses=1]
- %tmp.17.i29166 = getelementptr %"struct.std::dcomplex"* %tmp.0.i29161, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i29167 = load double* %tmp.17.i29166 ; <double> [#uses=1]
- %tmp.4.i29141 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i29140, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i29143 = load double* %tmp.5.i34338 ; <double> [#uses=1]
- store double %tmp.6.i29143, double* %tmp.4.i29141
- %tmp.7.i29144 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i29140, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i29146 = load double* %tmp.8.i34341 ; <double> [#uses=1]
- store double %tmp.9.i29146, double* %tmp.7.i29144
- %tmp.0.i29147 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i29140, %"struct.std::dcomplex"* %tmp.21 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i29149 = getelementptr %"struct.std::dcomplex"* %tmp.0.i29147, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i29150 = load double* %tmp.14.i29149 ; <double> [#uses=1]
- %tmp.17.i29152 = getelementptr %"struct.std::dcomplex"* %tmp.0.i29147, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i29153 = load double* %tmp.17.i29152 ; <double> [#uses=1]
- %tmp.4.i29127 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i29126, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i29129 = load double* %tmp.5.i34282 ; <double> [#uses=1]
- store double %tmp.6.i29129, double* %tmp.4.i29127
- %tmp.7.i29130 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i29126, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i29132 = load double* %tmp.8.i34285 ; <double> [#uses=1]
- store double %tmp.9.i29132, double* %tmp.7.i29130
- %tmp.0.i29133 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i29126, %"struct.std::dcomplex"* %tmp.6 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i29134 = getelementptr %"struct.std::dcomplex"* %mem_tmp.287, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i29135 = getelementptr %"struct.std::dcomplex"* %tmp.0.i29133, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i29136 = load double* %tmp.14.i29135 ; <double> [#uses=1]
- store double %tmp.15.i29136, double* %tmp.13.i29134
- %tmp.16.i29137 = getelementptr %"struct.std::dcomplex"* %mem_tmp.287, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i29138 = getelementptr %"struct.std::dcomplex"* %tmp.0.i29133, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i29139 = load double* %tmp.17.i29138 ; <double> [#uses=1]
- store double %tmp.18.i29139, double* %tmp.16.i29137
- %tmp.4.i29113 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i29112, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i29150, double* %tmp.4.i29113
- %tmp.7.i29116 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i29112, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i29153, double* %tmp.7.i29116
- %tmp.0.i29119 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i29112, %"struct.std::dcomplex"* %mem_tmp.287 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i29121 = getelementptr %"struct.std::dcomplex"* %tmp.0.i29119, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i29122 = load double* %tmp.14.i29121 ; <double> [#uses=1]
- %tmp.17.i29124 = getelementptr %"struct.std::dcomplex"* %tmp.0.i29119, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i29125 = load double* %tmp.17.i29124 ; <double> [#uses=1]
- %tmp.4.i29099 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i29098, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i29122, double* %tmp.4.i29099
- %tmp.7.i29102 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i29098, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i29125, double* %tmp.7.i29102
- %tmp.0.i29105 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i29098, %"struct.std::dcomplex"* %tmp.220 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i29106 = getelementptr %"struct.std::dcomplex"* %mem_tmp.284, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i29107 = getelementptr %"struct.std::dcomplex"* %tmp.0.i29105, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i29108 = load double* %tmp.14.i29107 ; <double> [#uses=1]
- store double %tmp.15.i29108, double* %tmp.13.i29106
- %tmp.16.i29109 = getelementptr %"struct.std::dcomplex"* %mem_tmp.284, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i29110 = getelementptr %"struct.std::dcomplex"* %tmp.0.i29105, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i29111 = load double* %tmp.17.i29110 ; <double> [#uses=1]
- store double %tmp.18.i29111, double* %tmp.16.i29109
- %tmp.4.i29085 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i29084, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i29164, double* %tmp.4.i29085
- %tmp.7.i29088 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i29084, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i29167, double* %tmp.7.i29088
- %tmp.0.i29091 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i29084, %"struct.std::dcomplex"* %mem_tmp.284 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i29093 = getelementptr %"struct.std::dcomplex"* %tmp.0.i29091, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i29094 = load double* %tmp.14.i29093 ; <double> [#uses=1]
- %tmp.17.i29096 = getelementptr %"struct.std::dcomplex"* %tmp.0.i29091, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i29097 = load double* %tmp.17.i29096 ; <double> [#uses=1]
- store double %tmp.15.i29094, double* %tmp.2.i34364
- store double %tmp.18.i29097, double* %tmp.6.i34365
- %tmp.4.i29051 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i29050, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i29053 = load double* %tmp.5.i33866 ; <double> [#uses=1]
- store double %tmp.6.i29053, double* %tmp.4.i29051
- %tmp.7.i29054 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i29050, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i29056 = load double* %tmp.8.i33869 ; <double> [#uses=1]
- store double %tmp.9.i29056, double* %tmp.7.i29054
- %tmp.0.i29057 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i29050, %"struct.std::dcomplex"* %ret3 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i29059 = getelementptr %"struct.std::dcomplex"* %tmp.0.i29057, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i29060 = load double* %tmp.14.i29059 ; <double> [#uses=1]
- %tmp.17.i29062 = getelementptr %"struct.std::dcomplex"* %tmp.0.i29057, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i29063 = load double* %tmp.17.i29062 ; <double> [#uses=1]
- %tmp.7.i29017 = load double* %tmp.2.i34366 ; <double> [#uses=1]
- %tmp.15.i29031 = add double %tmp.7.i29017, %tmp.15.i29060 ; <double> [#uses=1]
- store double %tmp.15.i29031, double* %tmp.2.i34366
- %tmp.26.i29038 = load double* %tmp.6.i34367 ; <double> [#uses=1]
- %tmp.31.i29049 = add double %tmp.26.i29038, %tmp.18.i29063 ; <double> [#uses=1]
- store double %tmp.31.i29049, double* %tmp.6.i34367
- %tmp.4.i28997 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i28996, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i28999 = load double* %tmp.5.i34282 ; <double> [#uses=1]
- store double %tmp.6.i28999, double* %tmp.4.i28997
- %tmp.7.i29000 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i28996, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i29002 = load double* %tmp.8.i34285 ; <double> [#uses=1]
- store double %tmp.9.i29002, double* %tmp.7.i29000
- %tmp.0.i29003 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i28996, %"struct.std::dcomplex"* %tmp.12 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i29005 = getelementptr %"struct.std::dcomplex"* %tmp.0.i29003, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i29006 = load double* %tmp.14.i29005 ; <double> [#uses=1]
- %tmp.17.i29008 = getelementptr %"struct.std::dcomplex"* %tmp.0.i29003, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i29009 = load double* %tmp.17.i29008 ; <double> [#uses=1]
- %tmp.4.i28983 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i28982, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i28985 = load double* %tmp.5.i34352 ; <double> [#uses=1]
- store double %tmp.6.i28985, double* %tmp.4.i28983
- %tmp.7.i28986 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i28982, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i28988 = load double* %tmp.8.i34355 ; <double> [#uses=1]
- store double %tmp.9.i28988, double* %tmp.7.i28986
- %tmp.0.i28989 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i28982, %"struct.std::dcomplex"* %tmp.21 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i28990 = getelementptr %"struct.std::dcomplex"* %mem_tmp.294, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i28991 = getelementptr %"struct.std::dcomplex"* %tmp.0.i28989, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i28992 = load double* %tmp.14.i28991 ; <double> [#uses=1]
- store double %tmp.15.i28992, double* %tmp.13.i28990
- %tmp.16.i28993 = getelementptr %"struct.std::dcomplex"* %mem_tmp.294, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i28994 = getelementptr %"struct.std::dcomplex"* %tmp.0.i28989, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i28995 = load double* %tmp.17.i28994 ; <double> [#uses=1]
- store double %tmp.18.i28995, double* %tmp.16.i28993
- %tmp.4.i28969 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i28968, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i29006, double* %tmp.4.i28969
- %tmp.7.i28972 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i28968, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i29009, double* %tmp.7.i28972
- %tmp.0.i28975 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i28968, %"struct.std::dcomplex"* %mem_tmp.294 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i28977 = getelementptr %"struct.std::dcomplex"* %tmp.0.i28975, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i28978 = load double* %tmp.14.i28977 ; <double> [#uses=1]
- %tmp.17.i28980 = getelementptr %"struct.std::dcomplex"* %tmp.0.i28975, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i28981 = load double* %tmp.17.i28980 ; <double> [#uses=1]
- %tmp.4.i28955 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i28954, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i28978, double* %tmp.4.i28955
- %tmp.7.i28958 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i28954, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i28981, double* %tmp.7.i28958
- %tmp.0.i28961 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i28954, %"struct.std::dcomplex"* %tmp.220 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i28963 = getelementptr %"struct.std::dcomplex"* %tmp.0.i28961, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i28964 = load double* %tmp.14.i28963 ; <double> [#uses=1]
- %tmp.17.i28966 = getelementptr %"struct.std::dcomplex"* %tmp.0.i28961, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i28967 = load double* %tmp.17.i28966 ; <double> [#uses=1]
- %tmp.4.i28941 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i28940, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i28943 = load double* %tmp.5.i33146 ; <double> [#uses=1]
- store double %tmp.6.i28943, double* %tmp.4.i28941
- %tmp.7.i28944 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i28940, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i28946 = load double* %tmp.8.i33149 ; <double> [#uses=1]
- store double %tmp.9.i28946, double* %tmp.7.i28944
- %tmp.0.i28947 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i28940, %"struct.std::dcomplex"* %tmp.21 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i28949 = getelementptr %"struct.std::dcomplex"* %tmp.0.i28947, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i28950 = load double* %tmp.14.i28949 ; <double> [#uses=1]
- %tmp.17.i28952 = getelementptr %"struct.std::dcomplex"* %tmp.0.i28947, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i28953 = load double* %tmp.17.i28952 ; <double> [#uses=1]
- %tmp.4.i28927 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i28926, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i28929 = load double* %tmp.5.i34282 ; <double> [#uses=1]
- store double %tmp.6.i28929, double* %tmp.4.i28927
- %tmp.7.i28930 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i28926, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i28932 = load double* %tmp.8.i34285 ; <double> [#uses=1]
- store double %tmp.9.i28932, double* %tmp.7.i28930
- %tmp.0.i28933 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i28926, %"struct.std::dcomplex"* %tmp.226 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i28934 = getelementptr %"struct.std::dcomplex"* %mem_tmp.298, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i28935 = getelementptr %"struct.std::dcomplex"* %tmp.0.i28933, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i28936 = load double* %tmp.14.i28935 ; <double> [#uses=1]
- store double %tmp.15.i28936, double* %tmp.13.i28934
- %tmp.16.i28937 = getelementptr %"struct.std::dcomplex"* %mem_tmp.298, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i28938 = getelementptr %"struct.std::dcomplex"* %tmp.0.i28933, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i28939 = load double* %tmp.17.i28938 ; <double> [#uses=1]
- store double %tmp.18.i28939, double* %tmp.16.i28937
- %tmp.4.i28913 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i28912, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i28950, double* %tmp.4.i28913
- %tmp.7.i28916 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i28912, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i28953, double* %tmp.7.i28916
- %tmp.0.i28919 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i28912, %"struct.std::dcomplex"* %mem_tmp.298 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i28921 = getelementptr %"struct.std::dcomplex"* %tmp.0.i28919, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i28922 = load double* %tmp.14.i28921 ; <double> [#uses=1]
- %tmp.17.i28924 = getelementptr %"struct.std::dcomplex"* %tmp.0.i28919, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i28925 = load double* %tmp.17.i28924 ; <double> [#uses=1]
- %tmp.4.i28899 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i28898, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i28922, double* %tmp.4.i28899
- %tmp.7.i28902 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i28898, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i28925, double* %tmp.7.i28902
- %tmp.0.i28905 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i28898, %"struct.std::dcomplex"* %tmp.30 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i28906 = getelementptr %"struct.std::dcomplex"* %mem_tmp.295, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i28907 = getelementptr %"struct.std::dcomplex"* %tmp.0.i28905, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i28908 = load double* %tmp.14.i28907 ; <double> [#uses=1]
- store double %tmp.15.i28908, double* %tmp.13.i28906
- %tmp.16.i28909 = getelementptr %"struct.std::dcomplex"* %mem_tmp.295, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i28910 = getelementptr %"struct.std::dcomplex"* %tmp.0.i28905, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i28911 = load double* %tmp.17.i28910 ; <double> [#uses=1]
- store double %tmp.18.i28911, double* %tmp.16.i28909
- %tmp.4.i28885 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i28884, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i28964, double* %tmp.4.i28885
- %tmp.7.i28888 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i28884, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i28967, double* %tmp.7.i28888
- %tmp.0.i28891 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i28884, %"struct.std::dcomplex"* %mem_tmp.295 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i28893 = getelementptr %"struct.std::dcomplex"* %tmp.0.i28891, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i28894 = load double* %tmp.14.i28893 ; <double> [#uses=1]
- %tmp.17.i28896 = getelementptr %"struct.std::dcomplex"* %tmp.0.i28891, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i28897 = load double* %tmp.17.i28896 ; <double> [#uses=1]
- %tmp.4.i28871 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i28870, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i28873 = load double* %tmp.5.i34352 ; <double> [#uses=1]
- store double %tmp.6.i28873, double* %tmp.4.i28871
- %tmp.7.i28874 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i28870, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i28876 = load double* %tmp.8.i34355 ; <double> [#uses=1]
- store double %tmp.9.i28876, double* %tmp.7.i28874
- %tmp.0.i28877 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i28870, %"struct.std::dcomplex"* %tmp.226 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i28879 = getelementptr %"struct.std::dcomplex"* %tmp.0.i28877, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i28880 = load double* %tmp.14.i28879 ; <double> [#uses=1]
- %tmp.17.i28882 = getelementptr %"struct.std::dcomplex"* %tmp.0.i28877, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i28883 = load double* %tmp.17.i28882 ; <double> [#uses=1]
- %tmp.4.i28857 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i28856, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i28859 = load double* %tmp.5.i33146 ; <double> [#uses=1]
- store double %tmp.6.i28859, double* %tmp.4.i28857
- %tmp.7.i28860 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i28856, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i28862 = load double* %tmp.8.i33149 ; <double> [#uses=1]
- store double %tmp.9.i28862, double* %tmp.7.i28860
- %tmp.0.i28863 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i28856, %"struct.std::dcomplex"* %tmp.12 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i28864 = getelementptr %"struct.std::dcomplex"* %mem_tmp.302, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i28865 = getelementptr %"struct.std::dcomplex"* %tmp.0.i28863, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i28866 = load double* %tmp.14.i28865 ; <double> [#uses=1]
- store double %tmp.15.i28866, double* %tmp.13.i28864
- %tmp.16.i28867 = getelementptr %"struct.std::dcomplex"* %mem_tmp.302, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i28868 = getelementptr %"struct.std::dcomplex"* %tmp.0.i28863, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i28869 = load double* %tmp.17.i28868 ; <double> [#uses=1]
- store double %tmp.18.i28869, double* %tmp.16.i28867
- %tmp.4.i28843 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i28842, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i28880, double* %tmp.4.i28843
- %tmp.7.i28846 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i28842, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i28883, double* %tmp.7.i28846
- %tmp.0.i28849 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i28842, %"struct.std::dcomplex"* %mem_tmp.302 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i28851 = getelementptr %"struct.std::dcomplex"* %tmp.0.i28849, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i28852 = load double* %tmp.14.i28851 ; <double> [#uses=1]
- %tmp.17.i28854 = getelementptr %"struct.std::dcomplex"* %tmp.0.i28849, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i28855 = load double* %tmp.17.i28854 ; <double> [#uses=1]
- %tmp.4.i28829 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i28828, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i28852, double* %tmp.4.i28829
- %tmp.7.i28832 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i28828, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i28855, double* %tmp.7.i28832
- %tmp.0.i28835 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i28828, %"struct.std::dcomplex"* %tmp.15 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i28836 = getelementptr %"struct.std::dcomplex"* %mem_tmp.299, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i28837 = getelementptr %"struct.std::dcomplex"* %tmp.0.i28835, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i28838 = load double* %tmp.14.i28837 ; <double> [#uses=1]
- store double %tmp.15.i28838, double* %tmp.13.i28836
- %tmp.16.i28839 = getelementptr %"struct.std::dcomplex"* %mem_tmp.299, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i28840 = getelementptr %"struct.std::dcomplex"* %tmp.0.i28835, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i28841 = load double* %tmp.17.i28840 ; <double> [#uses=1]
- store double %tmp.18.i28841, double* %tmp.16.i28839
- %tmp.4.i28815 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i28814, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i28894, double* %tmp.4.i28815
- %tmp.7.i28818 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i28814, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i28897, double* %tmp.7.i28818
- %tmp.0.i28821 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i28814, %"struct.std::dcomplex"* %mem_tmp.299 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i28823 = getelementptr %"struct.std::dcomplex"* %tmp.0.i28821, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i28824 = load double* %tmp.14.i28823 ; <double> [#uses=1]
- %tmp.17.i28826 = getelementptr %"struct.std::dcomplex"* %tmp.0.i28821, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i28827 = load double* %tmp.17.i28826 ; <double> [#uses=1]
- store double %tmp.15.i28824, double* %tmp.2.i34364
- store double %tmp.18.i28827, double* %tmp.6.i34365
- %tmp.4.i28781 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i28780, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i28783 = load double* %tmp.5.i33596 ; <double> [#uses=1]
- store double %tmp.6.i28783, double* %tmp.4.i28781
- %tmp.7.i28784 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i28780, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i28786 = load double* %tmp.8.i33599 ; <double> [#uses=1]
- store double %tmp.9.i28786, double* %tmp.7.i28784
- %tmp.0.i28787 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i28780, %"struct.std::dcomplex"* %ret3 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i28789 = getelementptr %"struct.std::dcomplex"* %tmp.0.i28787, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i28790 = load double* %tmp.14.i28789 ; <double> [#uses=1]
- %tmp.17.i28792 = getelementptr %"struct.std::dcomplex"* %tmp.0.i28787, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i28793 = load double* %tmp.17.i28792 ; <double> [#uses=1]
- %tmp.7.i28747 = load double* %tmp.2.i34366 ; <double> [#uses=1]
- %tmp.15.i28761 = add double %tmp.7.i28747, %tmp.15.i28790 ; <double> [#uses=1]
- store double %tmp.15.i28761, double* %tmp.2.i34366
- %tmp.26.i28768 = load double* %tmp.6.i34367 ; <double> [#uses=1]
- %tmp.31.i28779 = add double %tmp.26.i28768, %tmp.18.i28793 ; <double> [#uses=1]
- store double %tmp.31.i28779, double* %tmp.6.i34367
- %tmp.4.i28727 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i28726, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.5.i28728 = getelementptr [6 x %"struct.std::dcomplex"]* %_m, i32 4, i32 3, i32 0, i32 0 ; <double*> [#uses=5]
- %tmp.6.i28729 = load double* %tmp.5.i28728 ; <double> [#uses=1]
- store double %tmp.6.i28729, double* %tmp.4.i28727
- %tmp.7.i28730 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i28726, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.8.i28731 = getelementptr [6 x %"struct.std::dcomplex"]* %_m, i32 4, i32 3, i32 0, i32 1 ; <double*> [#uses=5]
- %tmp.9.i28732 = load double* %tmp.8.i28731 ; <double> [#uses=1]
- store double %tmp.9.i28732, double* %tmp.7.i28730
- %tmp.0.i28733 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i28726, %"struct.std::dcomplex"* %ret4 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i28735 = getelementptr %"struct.std::dcomplex"* %tmp.0.i28733, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i28736 = load double* %tmp.14.i28735 ; <double> [#uses=1]
- %tmp.17.i28738 = getelementptr %"struct.std::dcomplex"* %tmp.0.i28733, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i28739 = load double* %tmp.17.i28738 ; <double> [#uses=1]
- %tmp.7.i28693 = load double* %tmp.2.i34368 ; <double> [#uses=1]
- %tmp.15.i28707 = add double %tmp.7.i28693, %tmp.15.i28736 ; <double> [#uses=1]
- store double %tmp.15.i28707, double* %tmp.2.i34368
- %tmp.26.i28714 = load double* %tmp.6.i34369 ; <double> [#uses=1]
- %tmp.31.i28725 = add double %tmp.26.i28714, %tmp.18.i28739 ; <double> [#uses=1]
- store double %tmp.31.i28725, double* %tmp.6.i34369
- store double 0.000000e+00, double* %tmp.2.i34366
- store double 0.000000e+00, double* %tmp.6.i34367
- %tmp.4.i28671 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i28670, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.5.i28672 = getelementptr [6 x %"struct.std::dcomplex"]* %_m, i32 5, i32 5, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i28673 = load double* %tmp.5.i28672 ; <double> [#uses=1]
- store double %tmp.6.i28673, double* %tmp.4.i28671
- %tmp.7.i28674 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i28670, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.8.i28675 = getelementptr [6 x %"struct.std::dcomplex"]* %_m, i32 5, i32 5, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i28676 = load double* %tmp.8.i28675 ; <double> [#uses=1]
- store double %tmp.9.i28676, double* %tmp.7.i28674
- %tmp.0.i28677 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i28670, %"struct.std::dcomplex"* %ret5 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i28679 = getelementptr %"struct.std::dcomplex"* %tmp.0.i28677, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i28680 = load double* %tmp.14.i28679 ; <double> [#uses=1]
- %tmp.17.i28682 = getelementptr %"struct.std::dcomplex"* %tmp.0.i28677, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i28683 = load double* %tmp.17.i28682 ; <double> [#uses=1]
- %tmp.7.i28637 = load double* %tmp.2.i ; <double> [#uses=1]
- %tmp.15.i28651 = add double %tmp.7.i28637, %tmp.15.i28680 ; <double> [#uses=1]
- store double %tmp.15.i28651, double* %tmp.2.i
- %tmp.26.i28658 = load double* %tmp.6.i ; <double> [#uses=1]
- %tmp.31.i28669 = add double %tmp.26.i28658, %tmp.18.i28683 ; <double> [#uses=1]
- store double %tmp.31.i28669, double* %tmp.6.i
- store double 0.000000e+00, double* %tmp.2.i34368
- store double 0.000000e+00, double* %tmp.6.i34369
- %tmp.1036 = getelementptr [6 x %"struct.std::dcomplex"]* %_m, i32 1, i32 5 ; <%"struct.std::dcomplex"*> [#uses=120]
- %tmp.4.i28615 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i28614, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i28617 = load double* %tmp.5.i33146 ; <double> [#uses=1]
- store double %tmp.6.i28617, double* %tmp.4.i28615
- %tmp.7.i28618 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i28614, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i28620 = load double* %tmp.8.i33149 ; <double> [#uses=1]
- store double %tmp.9.i28620, double* %tmp.7.i28618
- %tmp.0.i28621 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i28614, %"struct.std::dcomplex"* %tmp.1036 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i28623 = getelementptr %"struct.std::dcomplex"* %tmp.0.i28621, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i28624 = load double* %tmp.14.i28623 ; <double> [#uses=1]
- %tmp.17.i28626 = getelementptr %"struct.std::dcomplex"* %tmp.0.i28621, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i28627 = load double* %tmp.17.i28626 ; <double> [#uses=1]
- %tmp.4.i28601 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i28600, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.5.i28602 = getelementptr [6 x %"struct.std::dcomplex"]* %_m, i32 0, i32 5, i32 0, i32 0 ; <double*> [#uses=120]
- %tmp.6.i28603 = load double* %tmp.5.i28602 ; <double> [#uses=1]
- store double %tmp.6.i28603, double* %tmp.4.i28601
- %tmp.7.i28604 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i28600, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.8.i28605 = getelementptr [6 x %"struct.std::dcomplex"]* %_m, i32 0, i32 5, i32 0, i32 1 ; <double*> [#uses=120]
- %tmp.9.i28606 = load double* %tmp.8.i28605 ; <double> [#uses=1]
- store double %tmp.9.i28606, double* %tmp.7.i28604
- %tmp.0.i28607 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i28600, %"struct.std::dcomplex"* %tmp.226 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i28608 = getelementptr %"struct.std::dcomplex"* %mem_tmp.311, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i28609 = getelementptr %"struct.std::dcomplex"* %tmp.0.i28607, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i28610 = load double* %tmp.14.i28609 ; <double> [#uses=1]
- store double %tmp.15.i28610, double* %tmp.13.i28608
- %tmp.16.i28611 = getelementptr %"struct.std::dcomplex"* %mem_tmp.311, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i28612 = getelementptr %"struct.std::dcomplex"* %tmp.0.i28607, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i28613 = load double* %tmp.17.i28612 ; <double> [#uses=1]
- store double %tmp.18.i28613, double* %tmp.16.i28611
- %tmp.4.i28587 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i28586, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i28624, double* %tmp.4.i28587
- %tmp.7.i28590 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i28586, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i28627, double* %tmp.7.i28590
- %tmp.0.i28593 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i28586, %"struct.std::dcomplex"* %mem_tmp.311 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i28595 = getelementptr %"struct.std::dcomplex"* %tmp.0.i28593, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i28596 = load double* %tmp.14.i28595 ; <double> [#uses=1]
- %tmp.17.i28598 = getelementptr %"struct.std::dcomplex"* %tmp.0.i28593, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i28599 = load double* %tmp.17.i28598 ; <double> [#uses=1]
- %tmp.4.i28573 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i28572, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i28596, double* %tmp.4.i28573
- %tmp.7.i28576 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i28572, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i28599, double* %tmp.7.i28576
- %tmp.0.i28579 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i28572, %"struct.std::dcomplex"* %tmp.15 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i28581 = getelementptr %"struct.std::dcomplex"* %tmp.0.i28579, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i28582 = load double* %tmp.14.i28581 ; <double> [#uses=1]
- %tmp.17.i28584 = getelementptr %"struct.std::dcomplex"* %tmp.0.i28579, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i28585 = load double* %tmp.17.i28584 ; <double> [#uses=1]
- %tmp.4.i28559 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i28558, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i28561 = load double* %tmp.5.i28602 ; <double> [#uses=1]
- store double %tmp.6.i28561, double* %tmp.4.i28559
- %tmp.7.i28562 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i28558, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i28564 = load double* %tmp.8.i28605 ; <double> [#uses=1]
- store double %tmp.9.i28564, double* %tmp.7.i28562
- %tmp.0.i28565 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i28558, %"struct.std::dcomplex"* %tmp.21 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i28567 = getelementptr %"struct.std::dcomplex"* %tmp.0.i28565, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i28568 = load double* %tmp.14.i28567 ; <double> [#uses=1]
- %tmp.17.i28570 = getelementptr %"struct.std::dcomplex"* %tmp.0.i28565, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i28571 = load double* %tmp.17.i28570 ; <double> [#uses=1]
- %tmp.4.i28545 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i28544, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i28547 = load double* %tmp.5.i34282 ; <double> [#uses=1]
- store double %tmp.6.i28547, double* %tmp.4.i28545
- %tmp.7.i28548 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i28544, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i28550 = load double* %tmp.8.i34285 ; <double> [#uses=1]
- store double %tmp.9.i28550, double* %tmp.7.i28548
- %tmp.0.i28551 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i28544, %"struct.std::dcomplex"* %tmp.1036 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i28552 = getelementptr %"struct.std::dcomplex"* %mem_tmp.315, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i28553 = getelementptr %"struct.std::dcomplex"* %tmp.0.i28551, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i28554 = load double* %tmp.14.i28553 ; <double> [#uses=1]
- store double %tmp.15.i28554, double* %tmp.13.i28552
- %tmp.16.i28555 = getelementptr %"struct.std::dcomplex"* %mem_tmp.315, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i28556 = getelementptr %"struct.std::dcomplex"* %tmp.0.i28551, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i28557 = load double* %tmp.17.i28556 ; <double> [#uses=1]
- store double %tmp.18.i28557, double* %tmp.16.i28555
- %tmp.4.i28531 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i28530, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i28568, double* %tmp.4.i28531
- %tmp.7.i28534 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i28530, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i28571, double* %tmp.7.i28534
- %tmp.0.i28537 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i28530, %"struct.std::dcomplex"* %mem_tmp.315 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i28539 = getelementptr %"struct.std::dcomplex"* %tmp.0.i28537, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i28540 = load double* %tmp.14.i28539 ; <double> [#uses=1]
- %tmp.17.i28542 = getelementptr %"struct.std::dcomplex"* %tmp.0.i28537, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i28543 = load double* %tmp.17.i28542 ; <double> [#uses=1]
- %tmp.4.i28517 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i28516, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i28540, double* %tmp.4.i28517
- %tmp.7.i28520 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i28516, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i28543, double* %tmp.7.i28520
- %tmp.0.i28523 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i28516, %"struct.std::dcomplex"* %tmp.220 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i28524 = getelementptr %"struct.std::dcomplex"* %mem_tmp.312, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i28525 = getelementptr %"struct.std::dcomplex"* %tmp.0.i28523, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i28526 = load double* %tmp.14.i28525 ; <double> [#uses=1]
- store double %tmp.15.i28526, double* %tmp.13.i28524
- %tmp.16.i28527 = getelementptr %"struct.std::dcomplex"* %mem_tmp.312, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i28528 = getelementptr %"struct.std::dcomplex"* %tmp.0.i28523, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i28529 = load double* %tmp.17.i28528 ; <double> [#uses=1]
- store double %tmp.18.i28529, double* %tmp.16.i28527
- %tmp.4.i28503 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i28502, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i28582, double* %tmp.4.i28503
- %tmp.7.i28506 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i28502, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i28585, double* %tmp.7.i28506
- %tmp.0.i28509 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i28502, %"struct.std::dcomplex"* %mem_tmp.312 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i28511 = getelementptr %"struct.std::dcomplex"* %tmp.0.i28509, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i28512 = load double* %tmp.14.i28511 ; <double> [#uses=1]
- %tmp.17.i28514 = getelementptr %"struct.std::dcomplex"* %tmp.0.i28509, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i28515 = load double* %tmp.17.i28514 ; <double> [#uses=1]
- %tmp.4.i28489 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i28488, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i28491 = load double* %tmp.5.i34282 ; <double> [#uses=1]
- store double %tmp.6.i28491, double* %tmp.4.i28489
- %tmp.7.i28492 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i28488, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i28494 = load double* %tmp.8.i34285 ; <double> [#uses=1]
- store double %tmp.9.i28494, double* %tmp.7.i28492
- %tmp.0.i28495 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i28488, %"struct.std::dcomplex"* %tmp.226 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i28497 = getelementptr %"struct.std::dcomplex"* %tmp.0.i28495, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i28498 = load double* %tmp.14.i28497 ; <double> [#uses=1]
- %tmp.17.i28500 = getelementptr %"struct.std::dcomplex"* %tmp.0.i28495, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i28501 = load double* %tmp.17.i28500 ; <double> [#uses=1]
- %tmp.4.i28475 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i28474, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i28477 = load double* %tmp.5.i33146 ; <double> [#uses=1]
- store double %tmp.6.i28477, double* %tmp.4.i28475
- %tmp.7.i28478 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i28474, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i28480 = load double* %tmp.8.i33149 ; <double> [#uses=1]
- store double %tmp.9.i28480, double* %tmp.7.i28478
- %tmp.0.i28481 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i28474, %"struct.std::dcomplex"* %tmp.21 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i28482 = getelementptr %"struct.std::dcomplex"* %mem_tmp.319, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i28483 = getelementptr %"struct.std::dcomplex"* %tmp.0.i28481, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i28484 = load double* %tmp.14.i28483 ; <double> [#uses=1]
- store double %tmp.15.i28484, double* %tmp.13.i28482
- %tmp.16.i28485 = getelementptr %"struct.std::dcomplex"* %mem_tmp.319, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i28486 = getelementptr %"struct.std::dcomplex"* %tmp.0.i28481, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i28487 = load double* %tmp.17.i28486 ; <double> [#uses=1]
- store double %tmp.18.i28487, double* %tmp.16.i28485
- %tmp.4.i28461 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i28460, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i28498, double* %tmp.4.i28461
- %tmp.7.i28464 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i28460, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i28501, double* %tmp.7.i28464
- %tmp.0.i28467 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i28460, %"struct.std::dcomplex"* %mem_tmp.319 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i28469 = getelementptr %"struct.std::dcomplex"* %tmp.0.i28467, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i28470 = load double* %tmp.14.i28469 ; <double> [#uses=1]
- %tmp.17.i28472 = getelementptr %"struct.std::dcomplex"* %tmp.0.i28467, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i28473 = load double* %tmp.17.i28472 ; <double> [#uses=1]
- %tmp.1075 = getelementptr [6 x %"struct.std::dcomplex"]* %_m, i32 2, i32 5 ; <%"struct.std::dcomplex"*> [#uses=60]
- %tmp.4.i28447 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i28446, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i28470, double* %tmp.4.i28447
- %tmp.7.i28450 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i28446, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i28473, double* %tmp.7.i28450
- %tmp.0.i28453 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i28446, %"struct.std::dcomplex"* %tmp.1075 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i28454 = getelementptr %"struct.std::dcomplex"* %mem_tmp.316, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i28455 = getelementptr %"struct.std::dcomplex"* %tmp.0.i28453, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i28456 = load double* %tmp.14.i28455 ; <double> [#uses=1]
- store double %tmp.15.i28456, double* %tmp.13.i28454
- %tmp.16.i28457 = getelementptr %"struct.std::dcomplex"* %mem_tmp.316, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i28458 = getelementptr %"struct.std::dcomplex"* %tmp.0.i28453, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i28459 = load double* %tmp.17.i28458 ; <double> [#uses=1]
- store double %tmp.18.i28459, double* %tmp.16.i28457
- %tmp.4.i28433 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i28432, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i28512, double* %tmp.4.i28433
- %tmp.7.i28436 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i28432, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i28515, double* %tmp.7.i28436
- %tmp.0.i28439 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i28432, %"struct.std::dcomplex"* %mem_tmp.316 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i28441 = getelementptr %"struct.std::dcomplex"* %tmp.0.i28439, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i28442 = load double* %tmp.14.i28441 ; <double> [#uses=1]
- %tmp.17.i28444 = getelementptr %"struct.std::dcomplex"* %tmp.0.i28439, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i28445 = load double* %tmp.17.i28444 ; <double> [#uses=1]
- store double %tmp.15.i28442, double* %tmp.2.i34364
- store double %tmp.18.i28445, double* %tmp.6.i34365
- %tmp.4.i28399 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i28398, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i28401 = load double* %tmp.5.i33596 ; <double> [#uses=1]
- store double %tmp.6.i28401, double* %tmp.4.i28399
- %tmp.7.i28402 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i28398, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i28404 = load double* %tmp.8.i33599 ; <double> [#uses=1]
- store double %tmp.9.i28404, double* %tmp.7.i28402
- %tmp.0.i28405 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i28398, %"struct.std::dcomplex"* %ret3 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i28407 = getelementptr %"struct.std::dcomplex"* %tmp.0.i28405, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i28408 = load double* %tmp.14.i28407 ; <double> [#uses=1]
- %tmp.17.i28410 = getelementptr %"struct.std::dcomplex"* %tmp.0.i28405, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i28411 = load double* %tmp.17.i28410 ; <double> [#uses=1]
- %tmp.7.i28365 = load double* %tmp.2.i34366 ; <double> [#uses=1]
- %tmp.15.i28379 = add double %tmp.7.i28365, %tmp.15.i28408 ; <double> [#uses=1]
- store double %tmp.15.i28379, double* %tmp.2.i34366
- %tmp.26.i28386 = load double* %tmp.6.i34367 ; <double> [#uses=1]
- %tmp.31.i28397 = add double %tmp.26.i28386, %tmp.18.i28411 ; <double> [#uses=1]
- store double %tmp.31.i28397, double* %tmp.6.i34367
- %tmp.4.i28345 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i28344, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i28347 = load double* %tmp.5.i33146 ; <double> [#uses=1]
- store double %tmp.6.i28347, double* %tmp.4.i28345
- %tmp.7.i28348 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i28344, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i28350 = load double* %tmp.8.i33149 ; <double> [#uses=1]
- store double %tmp.9.i28350, double* %tmp.7.i28348
- %tmp.0.i28351 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i28344, %"struct.std::dcomplex"* %tmp.6 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i28353 = getelementptr %"struct.std::dcomplex"* %tmp.0.i28351, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i28354 = load double* %tmp.14.i28353 ; <double> [#uses=1]
- %tmp.17.i28356 = getelementptr %"struct.std::dcomplex"* %tmp.0.i28351, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i28357 = load double* %tmp.17.i28356 ; <double> [#uses=1]
- %tmp.4.i28331 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i28330, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i28333 = load double* %tmp.5.i34338 ; <double> [#uses=1]
- store double %tmp.6.i28333, double* %tmp.4.i28331
- %tmp.7.i28334 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i28330, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i28336 = load double* %tmp.8.i34341 ; <double> [#uses=1]
- store double %tmp.9.i28336, double* %tmp.7.i28334
- %tmp.0.i28337 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i28330, %"struct.std::dcomplex"* %tmp.226 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i28338 = getelementptr %"struct.std::dcomplex"* %mem_tmp.326, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i28339 = getelementptr %"struct.std::dcomplex"* %tmp.0.i28337, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i28340 = load double* %tmp.14.i28339 ; <double> [#uses=1]
- store double %tmp.15.i28340, double* %tmp.13.i28338
- %tmp.16.i28341 = getelementptr %"struct.std::dcomplex"* %mem_tmp.326, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i28342 = getelementptr %"struct.std::dcomplex"* %tmp.0.i28337, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i28343 = load double* %tmp.17.i28342 ; <double> [#uses=1]
- store double %tmp.18.i28343, double* %tmp.16.i28341
- %tmp.4.i28317 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i28316, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i28354, double* %tmp.4.i28317
- %tmp.7.i28320 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i28316, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i28357, double* %tmp.7.i28320
- %tmp.0.i28323 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i28316, %"struct.std::dcomplex"* %mem_tmp.326 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i28325 = getelementptr %"struct.std::dcomplex"* %tmp.0.i28323, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i28326 = load double* %tmp.14.i28325 ; <double> [#uses=1]
- %tmp.17.i28328 = getelementptr %"struct.std::dcomplex"* %tmp.0.i28323, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i28329 = load double* %tmp.17.i28328 ; <double> [#uses=1]
- %tmp.4.i28303 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i28302, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i28326, double* %tmp.4.i28303
- %tmp.7.i28306 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i28302, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i28329, double* %tmp.7.i28306
- %tmp.0.i28309 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i28302, %"struct.std::dcomplex"* %tmp.1075 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i28311 = getelementptr %"struct.std::dcomplex"* %tmp.0.i28309, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i28312 = load double* %tmp.14.i28311 ; <double> [#uses=1]
- %tmp.17.i28314 = getelementptr %"struct.std::dcomplex"* %tmp.0.i28309, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i28315 = load double* %tmp.17.i28314 ; <double> [#uses=1]
- %tmp.4.i28289 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i28288, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i28291 = load double* %tmp.5.i28602 ; <double> [#uses=1]
- store double %tmp.6.i28291, double* %tmp.4.i28289
- %tmp.7.i28292 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i28288, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i28294 = load double* %tmp.8.i28605 ; <double> [#uses=1]
- store double %tmp.9.i28294, double* %tmp.7.i28292
- %tmp.0.i28295 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i28288, %"struct.std::dcomplex"* %tmp.226 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i28297 = getelementptr %"struct.std::dcomplex"* %tmp.0.i28295, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i28298 = load double* %tmp.14.i28297 ; <double> [#uses=1]
- %tmp.17.i28300 = getelementptr %"struct.std::dcomplex"* %tmp.0.i28295, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i28301 = load double* %tmp.17.i28300 ; <double> [#uses=1]
- %tmp.4.i28275 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i28274, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i28277 = load double* %tmp.5.i33146 ; <double> [#uses=1]
- store double %tmp.6.i28277, double* %tmp.4.i28275
- %tmp.7.i28278 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i28274, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i28280 = load double* %tmp.8.i33149 ; <double> [#uses=1]
- store double %tmp.9.i28280, double* %tmp.7.i28278
- %tmp.0.i28281 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i28274, %"struct.std::dcomplex"* %tmp.1036 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i28282 = getelementptr %"struct.std::dcomplex"* %mem_tmp.330, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i28283 = getelementptr %"struct.std::dcomplex"* %tmp.0.i28281, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i28284 = load double* %tmp.14.i28283 ; <double> [#uses=1]
- store double %tmp.15.i28284, double* %tmp.13.i28282
- %tmp.16.i28285 = getelementptr %"struct.std::dcomplex"* %mem_tmp.330, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i28286 = getelementptr %"struct.std::dcomplex"* %tmp.0.i28281, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i28287 = load double* %tmp.17.i28286 ; <double> [#uses=1]
- store double %tmp.18.i28287, double* %tmp.16.i28285
- %tmp.4.i28261 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i28260, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i28298, double* %tmp.4.i28261
- %tmp.7.i28264 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i28260, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i28301, double* %tmp.7.i28264
- %tmp.0.i28267 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i28260, %"struct.std::dcomplex"* %mem_tmp.330 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i28269 = getelementptr %"struct.std::dcomplex"* %tmp.0.i28267, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i28270 = load double* %tmp.14.i28269 ; <double> [#uses=1]
- %tmp.17.i28272 = getelementptr %"struct.std::dcomplex"* %tmp.0.i28267, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i28273 = load double* %tmp.17.i28272 ; <double> [#uses=1]
- %tmp.4.i28247 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i28246, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i28270, double* %tmp.4.i28247
- %tmp.7.i28250 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i28246, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i28273, double* %tmp.7.i28250
- %tmp.0.i28253 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i28246, %"struct.std::dcomplex"* %tmp.45 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i28254 = getelementptr %"struct.std::dcomplex"* %mem_tmp.327, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i28255 = getelementptr %"struct.std::dcomplex"* %tmp.0.i28253, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i28256 = load double* %tmp.14.i28255 ; <double> [#uses=1]
- store double %tmp.15.i28256, double* %tmp.13.i28254
- %tmp.16.i28257 = getelementptr %"struct.std::dcomplex"* %mem_tmp.327, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i28258 = getelementptr %"struct.std::dcomplex"* %tmp.0.i28253, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i28259 = load double* %tmp.17.i28258 ; <double> [#uses=1]
- store double %tmp.18.i28259, double* %tmp.16.i28257
- %tmp.4.i28233 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i28232, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i28312, double* %tmp.4.i28233
- %tmp.7.i28236 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i28232, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i28315, double* %tmp.7.i28236
- %tmp.0.i28239 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i28232, %"struct.std::dcomplex"* %mem_tmp.327 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i28241 = getelementptr %"struct.std::dcomplex"* %tmp.0.i28239, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i28242 = load double* %tmp.14.i28241 ; <double> [#uses=1]
- %tmp.17.i28244 = getelementptr %"struct.std::dcomplex"* %tmp.0.i28239, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i28245 = load double* %tmp.17.i28244 ; <double> [#uses=1]
- %tmp.4.i28219 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i28218, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i28221 = load double* %tmp.5.i34338 ; <double> [#uses=1]
- store double %tmp.6.i28221, double* %tmp.4.i28219
- %tmp.7.i28222 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i28218, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i28224 = load double* %tmp.8.i34341 ; <double> [#uses=1]
- store double %tmp.9.i28224, double* %tmp.7.i28222
- %tmp.0.i28225 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i28218, %"struct.std::dcomplex"* %tmp.1036 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i28227 = getelementptr %"struct.std::dcomplex"* %tmp.0.i28225, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i28228 = load double* %tmp.14.i28227 ; <double> [#uses=1]
- %tmp.17.i28230 = getelementptr %"struct.std::dcomplex"* %tmp.0.i28225, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i28231 = load double* %tmp.17.i28230 ; <double> [#uses=1]
- %tmp.4.i28205 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i28204, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i28207 = load double* %tmp.5.i28602 ; <double> [#uses=1]
- store double %tmp.6.i28207, double* %tmp.4.i28205
- %tmp.7.i28208 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i28204, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i28210 = load double* %tmp.8.i28605 ; <double> [#uses=1]
- store double %tmp.9.i28210, double* %tmp.7.i28208
- %tmp.0.i28211 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i28204, %"struct.std::dcomplex"* %tmp.6 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i28212 = getelementptr %"struct.std::dcomplex"* %mem_tmp.334, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i28213 = getelementptr %"struct.std::dcomplex"* %tmp.0.i28211, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i28214 = load double* %tmp.14.i28213 ; <double> [#uses=1]
- store double %tmp.15.i28214, double* %tmp.13.i28212
- %tmp.16.i28215 = getelementptr %"struct.std::dcomplex"* %mem_tmp.334, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i28216 = getelementptr %"struct.std::dcomplex"* %tmp.0.i28211, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i28217 = load double* %tmp.17.i28216 ; <double> [#uses=1]
- store double %tmp.18.i28217, double* %tmp.16.i28215
- %tmp.4.i28191 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i28190, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i28228, double* %tmp.4.i28191
- %tmp.7.i28194 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i28190, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i28231, double* %tmp.7.i28194
- %tmp.0.i28197 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i28190, %"struct.std::dcomplex"* %mem_tmp.334 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i28199 = getelementptr %"struct.std::dcomplex"* %tmp.0.i28197, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i28200 = load double* %tmp.14.i28199 ; <double> [#uses=1]
- %tmp.17.i28202 = getelementptr %"struct.std::dcomplex"* %tmp.0.i28197, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i28203 = load double* %tmp.17.i28202 ; <double> [#uses=1]
- %tmp.4.i28177 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i28176, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i28200, double* %tmp.4.i28177
- %tmp.7.i28180 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i28176, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i28203, double* %tmp.7.i28180
- %tmp.0.i28183 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i28176, %"struct.std::dcomplex"* %tmp.220 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i28184 = getelementptr %"struct.std::dcomplex"* %mem_tmp.331, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i28185 = getelementptr %"struct.std::dcomplex"* %tmp.0.i28183, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i28186 = load double* %tmp.14.i28185 ; <double> [#uses=1]
- store double %tmp.15.i28186, double* %tmp.13.i28184
- %tmp.16.i28187 = getelementptr %"struct.std::dcomplex"* %mem_tmp.331, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i28188 = getelementptr %"struct.std::dcomplex"* %tmp.0.i28183, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i28189 = load double* %tmp.17.i28188 ; <double> [#uses=1]
- store double %tmp.18.i28189, double* %tmp.16.i28187
- %tmp.4.i28163 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i28162, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i28242, double* %tmp.4.i28163
- %tmp.7.i28166 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i28162, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i28245, double* %tmp.7.i28166
- %tmp.0.i28169 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i28162, %"struct.std::dcomplex"* %mem_tmp.331 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i28171 = getelementptr %"struct.std::dcomplex"* %tmp.0.i28169, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i28172 = load double* %tmp.14.i28171 ; <double> [#uses=1]
- %tmp.17.i28174 = getelementptr %"struct.std::dcomplex"* %tmp.0.i28169, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i28175 = load double* %tmp.17.i28174 ; <double> [#uses=1]
- store double %tmp.15.i28172, double* %tmp.2.i34364
- store double %tmp.18.i28175, double* %tmp.6.i34365
- %tmp.4.i28129 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i28128, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i28131 = load double* %tmp.5.i33326 ; <double> [#uses=1]
- store double %tmp.6.i28131, double* %tmp.4.i28129
- %tmp.7.i28132 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i28128, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i28134 = load double* %tmp.8.i33329 ; <double> [#uses=1]
- store double %tmp.9.i28134, double* %tmp.7.i28132
- %tmp.0.i28135 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i28128, %"struct.std::dcomplex"* %ret3 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i28137 = getelementptr %"struct.std::dcomplex"* %tmp.0.i28135, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i28138 = load double* %tmp.14.i28137 ; <double> [#uses=1]
- %tmp.17.i28140 = getelementptr %"struct.std::dcomplex"* %tmp.0.i28135, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i28141 = load double* %tmp.17.i28140 ; <double> [#uses=1]
- %tmp.7.i28095 = load double* %tmp.2.i34366 ; <double> [#uses=1]
- %tmp.15.i28109 = add double %tmp.7.i28095, %tmp.15.i28138 ; <double> [#uses=1]
- store double %tmp.15.i28109, double* %tmp.2.i34366
- %tmp.26.i28116 = load double* %tmp.6.i34367 ; <double> [#uses=1]
- %tmp.31.i28127 = add double %tmp.26.i28116, %tmp.18.i28141 ; <double> [#uses=1]
- store double %tmp.31.i28127, double* %tmp.6.i34367
- %tmp.4.i28075 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i28074, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i28077 = load double* %tmp.5.i28602 ; <double> [#uses=1]
- store double %tmp.6.i28077, double* %tmp.4.i28075
- %tmp.7.i28078 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i28074, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i28080 = load double* %tmp.8.i28605 ; <double> [#uses=1]
- store double %tmp.9.i28080, double* %tmp.7.i28078
- %tmp.0.i28081 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i28074, %"struct.std::dcomplex"* %tmp.6 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i28083 = getelementptr %"struct.std::dcomplex"* %tmp.0.i28081, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i28084 = load double* %tmp.14.i28083 ; <double> [#uses=1]
- %tmp.17.i28086 = getelementptr %"struct.std::dcomplex"* %tmp.0.i28081, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i28087 = load double* %tmp.17.i28086 ; <double> [#uses=1]
- %tmp.4.i28061 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i28060, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i28063 = load double* %tmp.5.i34338 ; <double> [#uses=1]
- store double %tmp.6.i28063, double* %tmp.4.i28061
- %tmp.7.i28064 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i28060, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i28066 = load double* %tmp.8.i34341 ; <double> [#uses=1]
- store double %tmp.9.i28066, double* %tmp.7.i28064
- %tmp.0.i28067 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i28060, %"struct.std::dcomplex"* %tmp.1036 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i28068 = getelementptr %"struct.std::dcomplex"* %mem_tmp.341, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i28069 = getelementptr %"struct.std::dcomplex"* %tmp.0.i28067, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i28070 = load double* %tmp.14.i28069 ; <double> [#uses=1]
- store double %tmp.15.i28070, double* %tmp.13.i28068
- %tmp.16.i28071 = getelementptr %"struct.std::dcomplex"* %mem_tmp.341, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i28072 = getelementptr %"struct.std::dcomplex"* %tmp.0.i28067, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i28073 = load double* %tmp.17.i28072 ; <double> [#uses=1]
- store double %tmp.18.i28073, double* %tmp.16.i28071
- %tmp.4.i28047 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i28046, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i28084, double* %tmp.4.i28047
- %tmp.7.i28050 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i28046, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i28087, double* %tmp.7.i28050
- %tmp.0.i28053 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i28046, %"struct.std::dcomplex"* %mem_tmp.341 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i28055 = getelementptr %"struct.std::dcomplex"* %tmp.0.i28053, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i28056 = load double* %tmp.14.i28055 ; <double> [#uses=1]
- %tmp.17.i28058 = getelementptr %"struct.std::dcomplex"* %tmp.0.i28053, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i28059 = load double* %tmp.17.i28058 ; <double> [#uses=1]
- %tmp.4.i28033 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i28032, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i28056, double* %tmp.4.i28033
- %tmp.7.i28036 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i28032, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i28059, double* %tmp.7.i28036
- %tmp.0.i28039 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i28032, %"struct.std::dcomplex"* %tmp.15 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i28041 = getelementptr %"struct.std::dcomplex"* %tmp.0.i28039, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i28042 = load double* %tmp.14.i28041 ; <double> [#uses=1]
- %tmp.17.i28044 = getelementptr %"struct.std::dcomplex"* %tmp.0.i28039, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i28045 = load double* %tmp.17.i28044 ; <double> [#uses=1]
- %tmp.4.i28019 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i28018, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i28021 = load double* %tmp.5.i34338 ; <double> [#uses=1]
- store double %tmp.6.i28021, double* %tmp.4.i28019
- %tmp.7.i28022 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i28018, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i28024 = load double* %tmp.8.i34341 ; <double> [#uses=1]
- store double %tmp.9.i28024, double* %tmp.7.i28022
- %tmp.0.i28025 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i28018, %"struct.std::dcomplex"* %tmp.21 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i28027 = getelementptr %"struct.std::dcomplex"* %tmp.0.i28025, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i28028 = load double* %tmp.14.i28027 ; <double> [#uses=1]
- %tmp.17.i28030 = getelementptr %"struct.std::dcomplex"* %tmp.0.i28025, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i28031 = load double* %tmp.17.i28030 ; <double> [#uses=1]
- %tmp.4.i28005 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i28004, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i28007 = load double* %tmp.5.i34282 ; <double> [#uses=1]
- store double %tmp.6.i28007, double* %tmp.4.i28005
- %tmp.7.i28008 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i28004, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i28010 = load double* %tmp.8.i34285 ; <double> [#uses=1]
- store double %tmp.9.i28010, double* %tmp.7.i28008
- %tmp.0.i28011 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i28004, %"struct.std::dcomplex"* %tmp.6 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i28012 = getelementptr %"struct.std::dcomplex"* %mem_tmp.345, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i28013 = getelementptr %"struct.std::dcomplex"* %tmp.0.i28011, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i28014 = load double* %tmp.14.i28013 ; <double> [#uses=1]
- store double %tmp.15.i28014, double* %tmp.13.i28012
- %tmp.16.i28015 = getelementptr %"struct.std::dcomplex"* %mem_tmp.345, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i28016 = getelementptr %"struct.std::dcomplex"* %tmp.0.i28011, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i28017 = load double* %tmp.17.i28016 ; <double> [#uses=1]
- store double %tmp.18.i28017, double* %tmp.16.i28015
- %tmp.4.i27991 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i27990, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i28028, double* %tmp.4.i27991
- %tmp.7.i27994 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i27990, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i28031, double* %tmp.7.i27994
- %tmp.0.i27997 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i27990, %"struct.std::dcomplex"* %mem_tmp.345 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i27999 = getelementptr %"struct.std::dcomplex"* %tmp.0.i27997, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i28000 = load double* %tmp.14.i27999 ; <double> [#uses=1]
- %tmp.17.i28002 = getelementptr %"struct.std::dcomplex"* %tmp.0.i27997, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i28003 = load double* %tmp.17.i28002 ; <double> [#uses=1]
- %tmp.4.i27977 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i27976, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i28000, double* %tmp.4.i27977
- %tmp.7.i27980 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i27976, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i28003, double* %tmp.7.i27980
- %tmp.0.i27983 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i27976, %"struct.std::dcomplex"* %tmp.1075 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i27984 = getelementptr %"struct.std::dcomplex"* %mem_tmp.342, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i27985 = getelementptr %"struct.std::dcomplex"* %tmp.0.i27983, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i27986 = load double* %tmp.14.i27985 ; <double> [#uses=1]
- store double %tmp.15.i27986, double* %tmp.13.i27984
- %tmp.16.i27987 = getelementptr %"struct.std::dcomplex"* %mem_tmp.342, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i27988 = getelementptr %"struct.std::dcomplex"* %tmp.0.i27983, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i27989 = load double* %tmp.17.i27988 ; <double> [#uses=1]
- store double %tmp.18.i27989, double* %tmp.16.i27987
- %tmp.4.i27963 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i27962, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i28042, double* %tmp.4.i27963
- %tmp.7.i27966 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i27962, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i28045, double* %tmp.7.i27966
- %tmp.0.i27969 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i27962, %"struct.std::dcomplex"* %mem_tmp.342 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i27971 = getelementptr %"struct.std::dcomplex"* %tmp.0.i27969, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i27972 = load double* %tmp.14.i27971 ; <double> [#uses=1]
- %tmp.17.i27974 = getelementptr %"struct.std::dcomplex"* %tmp.0.i27969, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i27975 = load double* %tmp.17.i27974 ; <double> [#uses=1]
- %tmp.4.i27949 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i27948, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i27951 = load double* %tmp.5.i34282 ; <double> [#uses=1]
- store double %tmp.6.i27951, double* %tmp.4.i27949
- %tmp.7.i27952 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i27948, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i27954 = load double* %tmp.8.i34285 ; <double> [#uses=1]
- store double %tmp.9.i27954, double* %tmp.7.i27952
- %tmp.0.i27955 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i27948, %"struct.std::dcomplex"* %tmp.1036 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i27957 = getelementptr %"struct.std::dcomplex"* %tmp.0.i27955, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i27958 = load double* %tmp.14.i27957 ; <double> [#uses=1]
- %tmp.17.i27960 = getelementptr %"struct.std::dcomplex"* %tmp.0.i27955, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i27961 = load double* %tmp.17.i27960 ; <double> [#uses=1]
- %tmp.4.i27935 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i27934, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i27937 = load double* %tmp.5.i28602 ; <double> [#uses=1]
- store double %tmp.6.i27937, double* %tmp.4.i27935
- %tmp.7.i27938 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i27934, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i27940 = load double* %tmp.8.i28605 ; <double> [#uses=1]
- store double %tmp.9.i27940, double* %tmp.7.i27938
- %tmp.0.i27941 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i27934, %"struct.std::dcomplex"* %tmp.21 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i27942 = getelementptr %"struct.std::dcomplex"* %mem_tmp.349, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i27943 = getelementptr %"struct.std::dcomplex"* %tmp.0.i27941, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i27944 = load double* %tmp.14.i27943 ; <double> [#uses=1]
- store double %tmp.15.i27944, double* %tmp.13.i27942
- %tmp.16.i27945 = getelementptr %"struct.std::dcomplex"* %mem_tmp.349, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i27946 = getelementptr %"struct.std::dcomplex"* %tmp.0.i27941, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i27947 = load double* %tmp.17.i27946 ; <double> [#uses=1]
- store double %tmp.18.i27947, double* %tmp.16.i27945
- %tmp.4.i27921 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i27920, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i27958, double* %tmp.4.i27921
- %tmp.7.i27924 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i27920, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i27961, double* %tmp.7.i27924
- %tmp.0.i27927 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i27920, %"struct.std::dcomplex"* %mem_tmp.349 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i27929 = getelementptr %"struct.std::dcomplex"* %tmp.0.i27927, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i27930 = load double* %tmp.14.i27929 ; <double> [#uses=1]
- %tmp.17.i27932 = getelementptr %"struct.std::dcomplex"* %tmp.0.i27927, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i27933 = load double* %tmp.17.i27932 ; <double> [#uses=1]
- %tmp.4.i27907 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i27906, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i27930, double* %tmp.4.i27907
- %tmp.7.i27910 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i27906, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i27933, double* %tmp.7.i27910
- %tmp.0.i27913 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i27906, %"struct.std::dcomplex"* %tmp.45 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i27914 = getelementptr %"struct.std::dcomplex"* %mem_tmp.346, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i27915 = getelementptr %"struct.std::dcomplex"* %tmp.0.i27913, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i27916 = load double* %tmp.14.i27915 ; <double> [#uses=1]
- store double %tmp.15.i27916, double* %tmp.13.i27914
- %tmp.16.i27917 = getelementptr %"struct.std::dcomplex"* %mem_tmp.346, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i27918 = getelementptr %"struct.std::dcomplex"* %tmp.0.i27913, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i27919 = load double* %tmp.17.i27918 ; <double> [#uses=1]
- store double %tmp.18.i27919, double* %tmp.16.i27917
- %tmp.4.i27893 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i27892, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i27972, double* %tmp.4.i27893
- %tmp.7.i27896 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i27892, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i27975, double* %tmp.7.i27896
- %tmp.0.i27899 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i27892, %"struct.std::dcomplex"* %mem_tmp.346 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i27901 = getelementptr %"struct.std::dcomplex"* %tmp.0.i27899, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i27902 = load double* %tmp.14.i27901 ; <double> [#uses=1]
- %tmp.17.i27904 = getelementptr %"struct.std::dcomplex"* %tmp.0.i27899, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i27905 = load double* %tmp.17.i27904 ; <double> [#uses=1]
- store double %tmp.15.i27902, double* %tmp.2.i34364
- store double %tmp.18.i27905, double* %tmp.6.i34365
- %tmp.4.i27859 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i27858, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i27861 = load double* %tmp.5.i32460 ; <double> [#uses=1]
- store double %tmp.6.i27861, double* %tmp.4.i27859
- %tmp.7.i27862 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i27858, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i27864 = load double* %tmp.8.i32463 ; <double> [#uses=1]
- store double %tmp.9.i27864, double* %tmp.7.i27862
- %tmp.0.i27865 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i27858, %"struct.std::dcomplex"* %ret3 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i27867 = getelementptr %"struct.std::dcomplex"* %tmp.0.i27865, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i27868 = load double* %tmp.14.i27867 ; <double> [#uses=1]
- %tmp.17.i27870 = getelementptr %"struct.std::dcomplex"* %tmp.0.i27865, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i27871 = load double* %tmp.17.i27870 ; <double> [#uses=1]
- %tmp.7.i27825 = load double* %tmp.2.i34366 ; <double> [#uses=1]
- %tmp.15.i27839 = add double %tmp.7.i27825, %tmp.15.i27868 ; <double> [#uses=1]
- store double %tmp.15.i27839, double* %tmp.2.i34366
- %tmp.26.i27846 = load double* %tmp.6.i34367 ; <double> [#uses=1]
- %tmp.31.i27857 = add double %tmp.26.i27846, %tmp.18.i27871 ; <double> [#uses=1]
- store double %tmp.31.i27857, double* %tmp.6.i34367
- %tmp.4.i27805 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i27804, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i27807 = load double* %tmp.5.i33146 ; <double> [#uses=1]
- store double %tmp.6.i27807, double* %tmp.4.i27805
- %tmp.7.i27808 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i27804, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i27810 = load double* %tmp.8.i33149 ; <double> [#uses=1]
- store double %tmp.9.i27810, double* %tmp.7.i27808
- %tmp.0.i27811 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i27804, %"struct.std::dcomplex"* %tmp.21 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i27813 = getelementptr %"struct.std::dcomplex"* %tmp.0.i27811, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i27814 = load double* %tmp.14.i27813 ; <double> [#uses=1]
- %tmp.17.i27816 = getelementptr %"struct.std::dcomplex"* %tmp.0.i27811, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i27817 = load double* %tmp.17.i27816 ; <double> [#uses=1]
- %tmp.4.i27791 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i27790, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i27793 = load double* %tmp.5.i34282 ; <double> [#uses=1]
- store double %tmp.6.i27793, double* %tmp.4.i27791
- %tmp.7.i27794 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i27790, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i27796 = load double* %tmp.8.i34285 ; <double> [#uses=1]
- store double %tmp.9.i27796, double* %tmp.7.i27794
- %tmp.0.i27797 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i27790, %"struct.std::dcomplex"* %tmp.226 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i27798 = getelementptr %"struct.std::dcomplex"* %mem_tmp.356, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i27799 = getelementptr %"struct.std::dcomplex"* %tmp.0.i27797, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i27800 = load double* %tmp.14.i27799 ; <double> [#uses=1]
- store double %tmp.15.i27800, double* %tmp.13.i27798
- %tmp.16.i27801 = getelementptr %"struct.std::dcomplex"* %mem_tmp.356, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i27802 = getelementptr %"struct.std::dcomplex"* %tmp.0.i27797, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i27803 = load double* %tmp.17.i27802 ; <double> [#uses=1]
- store double %tmp.18.i27803, double* %tmp.16.i27801
- %tmp.4.i27777 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i27776, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i27814, double* %tmp.4.i27777
- %tmp.7.i27780 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i27776, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i27817, double* %tmp.7.i27780
- %tmp.0.i27783 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i27776, %"struct.std::dcomplex"* %mem_tmp.356 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i27785 = getelementptr %"struct.std::dcomplex"* %tmp.0.i27783, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i27786 = load double* %tmp.14.i27785 ; <double> [#uses=1]
- %tmp.17.i27788 = getelementptr %"struct.std::dcomplex"* %tmp.0.i27783, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i27789 = load double* %tmp.17.i27788 ; <double> [#uses=1]
- %tmp.4.i27763 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i27762, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i27786, double* %tmp.4.i27763
- %tmp.7.i27766 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i27762, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i27789, double* %tmp.7.i27766
- %tmp.0.i27769 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i27762, %"struct.std::dcomplex"* %tmp.45 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i27771 = getelementptr %"struct.std::dcomplex"* %tmp.0.i27769, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i27772 = load double* %tmp.14.i27771 ; <double> [#uses=1]
- %tmp.17.i27774 = getelementptr %"struct.std::dcomplex"* %tmp.0.i27769, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i27775 = load double* %tmp.17.i27774 ; <double> [#uses=1]
- %tmp.4.i27749 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i27748, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i27751 = load double* %tmp.5.i34338 ; <double> [#uses=1]
- store double %tmp.6.i27751, double* %tmp.4.i27749
- %tmp.7.i27752 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i27748, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i27754 = load double* %tmp.8.i34341 ; <double> [#uses=1]
- store double %tmp.9.i27754, double* %tmp.7.i27752
- %tmp.0.i27755 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i27748, %"struct.std::dcomplex"* %tmp.226 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i27757 = getelementptr %"struct.std::dcomplex"* %tmp.0.i27755, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i27758 = load double* %tmp.14.i27757 ; <double> [#uses=1]
- %tmp.17.i27760 = getelementptr %"struct.std::dcomplex"* %tmp.0.i27755, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i27761 = load double* %tmp.17.i27760 ; <double> [#uses=1]
- %tmp.4.i27735 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i27734, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i27737 = load double* %tmp.5.i33146 ; <double> [#uses=1]
- store double %tmp.6.i27737, double* %tmp.4.i27735
- %tmp.7.i27738 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i27734, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i27740 = load double* %tmp.8.i33149 ; <double> [#uses=1]
- store double %tmp.9.i27740, double* %tmp.7.i27738
- %tmp.0.i27741 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i27734, %"struct.std::dcomplex"* %tmp.6 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i27742 = getelementptr %"struct.std::dcomplex"* %mem_tmp.360, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i27743 = getelementptr %"struct.std::dcomplex"* %tmp.0.i27741, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i27744 = load double* %tmp.14.i27743 ; <double> [#uses=1]
- store double %tmp.15.i27744, double* %tmp.13.i27742
- %tmp.16.i27745 = getelementptr %"struct.std::dcomplex"* %mem_tmp.360, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i27746 = getelementptr %"struct.std::dcomplex"* %tmp.0.i27741, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i27747 = load double* %tmp.17.i27746 ; <double> [#uses=1]
- store double %tmp.18.i27747, double* %tmp.16.i27745
- %tmp.4.i27721 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i27720, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i27758, double* %tmp.4.i27721
- %tmp.7.i27724 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i27720, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i27761, double* %tmp.7.i27724
- %tmp.0.i27727 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i27720, %"struct.std::dcomplex"* %mem_tmp.360 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i27729 = getelementptr %"struct.std::dcomplex"* %tmp.0.i27727, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i27730 = load double* %tmp.14.i27729 ; <double> [#uses=1]
- %tmp.17.i27732 = getelementptr %"struct.std::dcomplex"* %tmp.0.i27727, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i27733 = load double* %tmp.17.i27732 ; <double> [#uses=1]
- %tmp.4.i27707 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i27706, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i27730, double* %tmp.4.i27707
- %tmp.7.i27710 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i27706, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i27733, double* %tmp.7.i27710
- %tmp.0.i27713 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i27706, %"struct.std::dcomplex"* %tmp.15 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i27714 = getelementptr %"struct.std::dcomplex"* %mem_tmp.357, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i27715 = getelementptr %"struct.std::dcomplex"* %tmp.0.i27713, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i27716 = load double* %tmp.14.i27715 ; <double> [#uses=1]
- store double %tmp.15.i27716, double* %tmp.13.i27714
- %tmp.16.i27717 = getelementptr %"struct.std::dcomplex"* %mem_tmp.357, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i27718 = getelementptr %"struct.std::dcomplex"* %tmp.0.i27713, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i27719 = load double* %tmp.17.i27718 ; <double> [#uses=1]
- store double %tmp.18.i27719, double* %tmp.16.i27717
- %tmp.4.i27693 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i27692, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i27772, double* %tmp.4.i27693
- %tmp.7.i27696 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i27692, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i27775, double* %tmp.7.i27696
- %tmp.0.i27699 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i27692, %"struct.std::dcomplex"* %mem_tmp.357 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i27701 = getelementptr %"struct.std::dcomplex"* %tmp.0.i27699, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i27702 = load double* %tmp.14.i27701 ; <double> [#uses=1]
- %tmp.17.i27704 = getelementptr %"struct.std::dcomplex"* %tmp.0.i27699, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i27705 = load double* %tmp.17.i27704 ; <double> [#uses=1]
- %tmp.4.i27679 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i27678, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i27681 = load double* %tmp.5.i34282 ; <double> [#uses=1]
- store double %tmp.6.i27681, double* %tmp.4.i27679
- %tmp.7.i27682 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i27678, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i27684 = load double* %tmp.8.i34285 ; <double> [#uses=1]
- store double %tmp.9.i27684, double* %tmp.7.i27682
- %tmp.0.i27685 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i27678, %"struct.std::dcomplex"* %tmp.6 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i27687 = getelementptr %"struct.std::dcomplex"* %tmp.0.i27685, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i27688 = load double* %tmp.14.i27687 ; <double> [#uses=1]
- %tmp.17.i27690 = getelementptr %"struct.std::dcomplex"* %tmp.0.i27685, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i27691 = load double* %tmp.17.i27690 ; <double> [#uses=1]
- %tmp.4.i27665 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i27664, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i27667 = load double* %tmp.5.i34338 ; <double> [#uses=1]
- store double %tmp.6.i27667, double* %tmp.4.i27665
- %tmp.7.i27668 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i27664, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i27670 = load double* %tmp.8.i34341 ; <double> [#uses=1]
- store double %tmp.9.i27670, double* %tmp.7.i27668
- %tmp.0.i27671 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i27664, %"struct.std::dcomplex"* %tmp.21 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i27672 = getelementptr %"struct.std::dcomplex"* %mem_tmp.364, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i27673 = getelementptr %"struct.std::dcomplex"* %tmp.0.i27671, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i27674 = load double* %tmp.14.i27673 ; <double> [#uses=1]
- store double %tmp.15.i27674, double* %tmp.13.i27672
- %tmp.16.i27675 = getelementptr %"struct.std::dcomplex"* %mem_tmp.364, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i27676 = getelementptr %"struct.std::dcomplex"* %tmp.0.i27671, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i27677 = load double* %tmp.17.i27676 ; <double> [#uses=1]
- store double %tmp.18.i27677, double* %tmp.16.i27675
- %tmp.4.i27651 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i27650, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i27688, double* %tmp.4.i27651
- %tmp.7.i27654 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i27650, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i27691, double* %tmp.7.i27654
- %tmp.0.i27657 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i27650, %"struct.std::dcomplex"* %mem_tmp.364 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i27659 = getelementptr %"struct.std::dcomplex"* %tmp.0.i27657, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i27660 = load double* %tmp.14.i27659 ; <double> [#uses=1]
- %tmp.17.i27662 = getelementptr %"struct.std::dcomplex"* %tmp.0.i27657, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i27663 = load double* %tmp.17.i27662 ; <double> [#uses=1]
- %tmp.4.i27637 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i27636, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i27660, double* %tmp.4.i27637
- %tmp.7.i27640 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i27636, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i27663, double* %tmp.7.i27640
- %tmp.0.i27643 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i27636, %"struct.std::dcomplex"* %tmp.220 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i27644 = getelementptr %"struct.std::dcomplex"* %mem_tmp.361, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i27645 = getelementptr %"struct.std::dcomplex"* %tmp.0.i27643, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i27646 = load double* %tmp.14.i27645 ; <double> [#uses=1]
- store double %tmp.15.i27646, double* %tmp.13.i27644
- %tmp.16.i27647 = getelementptr %"struct.std::dcomplex"* %mem_tmp.361, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i27648 = getelementptr %"struct.std::dcomplex"* %tmp.0.i27643, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i27649 = load double* %tmp.17.i27648 ; <double> [#uses=1]
- store double %tmp.18.i27649, double* %tmp.16.i27647
- %tmp.4.i27623 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i27622, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i27702, double* %tmp.4.i27623
- %tmp.7.i27626 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i27622, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i27705, double* %tmp.7.i27626
- %tmp.0.i27629 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i27622, %"struct.std::dcomplex"* %mem_tmp.361 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i27631 = getelementptr %"struct.std::dcomplex"* %tmp.0.i27629, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i27632 = load double* %tmp.14.i27631 ; <double> [#uses=1]
- %tmp.17.i27634 = getelementptr %"struct.std::dcomplex"* %tmp.0.i27629, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i27635 = load double* %tmp.17.i27634 ; <double> [#uses=1]
- store double %tmp.15.i27632, double* %tmp.2.i34364
- store double %tmp.18.i27635, double* %tmp.6.i34365
- %tmp.4.i27589 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i27588, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.5.i27590 = getelementptr [6 x %"struct.std::dcomplex"]* %_m, i32 3, i32 5, i32 0, i32 0 ; <double*> [#uses=20]
- %tmp.6.i27591 = load double* %tmp.5.i27590 ; <double> [#uses=1]
- store double %tmp.6.i27591, double* %tmp.4.i27589
- %tmp.7.i27592 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i27588, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.8.i27593 = getelementptr [6 x %"struct.std::dcomplex"]* %_m, i32 3, i32 5, i32 0, i32 1 ; <double*> [#uses=20]
- %tmp.9.i27594 = load double* %tmp.8.i27593 ; <double> [#uses=1]
- store double %tmp.9.i27594, double* %tmp.7.i27592
- %tmp.0.i27595 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i27588, %"struct.std::dcomplex"* %ret3 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i27597 = getelementptr %"struct.std::dcomplex"* %tmp.0.i27595, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i27598 = load double* %tmp.14.i27597 ; <double> [#uses=1]
- %tmp.17.i27600 = getelementptr %"struct.std::dcomplex"* %tmp.0.i27595, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i27601 = load double* %tmp.17.i27600 ; <double> [#uses=1]
- %tmp.7.i27555 = load double* %tmp.2.i34366 ; <double> [#uses=1]
- %tmp.15.i27569 = add double %tmp.7.i27555, %tmp.15.i27598 ; <double> [#uses=1]
- store double %tmp.15.i27569, double* %tmp.2.i34366
- %tmp.26.i27576 = load double* %tmp.6.i34367 ; <double> [#uses=1]
- %tmp.31.i27587 = add double %tmp.26.i27576, %tmp.18.i27601 ; <double> [#uses=1]
- store double %tmp.31.i27587, double* %tmp.6.i34367
- %tmp.4.i27535 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i27534, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i27537 = load double* %tmp.5.i28728 ; <double> [#uses=1]
- store double %tmp.6.i27537, double* %tmp.4.i27535
- %tmp.7.i27538 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i27534, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i27540 = load double* %tmp.8.i28731 ; <double> [#uses=1]
- store double %tmp.9.i27540, double* %tmp.7.i27538
- %tmp.0.i27541 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i27534, %"struct.std::dcomplex"* %ret4 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i27543 = getelementptr %"struct.std::dcomplex"* %tmp.0.i27541, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i27544 = load double* %tmp.14.i27543 ; <double> [#uses=1]
- %tmp.17.i27546 = getelementptr %"struct.std::dcomplex"* %tmp.0.i27541, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i27547 = load double* %tmp.17.i27546 ; <double> [#uses=1]
- %tmp.7.i27501 = load double* %tmp.2.i34368 ; <double> [#uses=1]
- %tmp.15.i27515 = add double %tmp.7.i27501, %tmp.15.i27544 ; <double> [#uses=1]
- store double %tmp.15.i27515, double* %tmp.2.i34368
- %tmp.26.i27522 = load double* %tmp.6.i34369 ; <double> [#uses=1]
- %tmp.31.i27533 = add double %tmp.26.i27522, %tmp.18.i27547 ; <double> [#uses=1]
- store double %tmp.31.i27533, double* %tmp.6.i34369
- store double 0.000000e+00, double* %tmp.2.i34366
- store double 0.000000e+00, double* %tmp.6.i34367
- %tmp.4.i27479 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i27478, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i27481 = load double* %tmp.5.i34338 ; <double> [#uses=1]
- store double %tmp.6.i27481, double* %tmp.4.i27479
- %tmp.7.i27482 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i27478, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i27484 = load double* %tmp.8.i34341 ; <double> [#uses=1]
- store double %tmp.9.i27484, double* %tmp.7.i27482
- %tmp.0.i27485 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i27478, %"struct.std::dcomplex"* %tmp.21 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i27487 = getelementptr %"struct.std::dcomplex"* %tmp.0.i27485, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i27488 = load double* %tmp.14.i27487 ; <double> [#uses=1]
- %tmp.17.i27490 = getelementptr %"struct.std::dcomplex"* %tmp.0.i27485, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i27491 = load double* %tmp.17.i27490 ; <double> [#uses=1]
- %tmp.4.i27465 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i27464, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i27467 = load double* %tmp.5.i34282 ; <double> [#uses=1]
- store double %tmp.6.i27467, double* %tmp.4.i27465
- %tmp.7.i27468 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i27464, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i27470 = load double* %tmp.8.i34285 ; <double> [#uses=1]
- store double %tmp.9.i27470, double* %tmp.7.i27468
- %tmp.0.i27471 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i27464, %"struct.std::dcomplex"* %tmp.6 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i27472 = getelementptr %"struct.std::dcomplex"* %mem_tmp.372, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i27473 = getelementptr %"struct.std::dcomplex"* %tmp.0.i27471, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i27474 = load double* %tmp.14.i27473 ; <double> [#uses=1]
- store double %tmp.15.i27474, double* %tmp.13.i27472
- %tmp.16.i27475 = getelementptr %"struct.std::dcomplex"* %mem_tmp.372, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i27476 = getelementptr %"struct.std::dcomplex"* %tmp.0.i27471, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i27477 = load double* %tmp.17.i27476 ; <double> [#uses=1]
- store double %tmp.18.i27477, double* %tmp.16.i27475
- %tmp.4.i27451 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i27450, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i27488, double* %tmp.4.i27451
- %tmp.7.i27454 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i27450, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i27491, double* %tmp.7.i27454
- %tmp.0.i27457 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i27450, %"struct.std::dcomplex"* %mem_tmp.372 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i27459 = getelementptr %"struct.std::dcomplex"* %tmp.0.i27457, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i27460 = load double* %tmp.14.i27459 ; <double> [#uses=1]
- %tmp.17.i27462 = getelementptr %"struct.std::dcomplex"* %tmp.0.i27457, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i27463 = load double* %tmp.17.i27462 ; <double> [#uses=1]
- %tmp.4.i27437 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i27436, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i27460, double* %tmp.4.i27437
- %tmp.7.i27440 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i27436, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i27463, double* %tmp.7.i27440
- %tmp.0.i27443 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i27436, %"struct.std::dcomplex"* %tmp.95 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i27445 = getelementptr %"struct.std::dcomplex"* %tmp.0.i27443, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i27446 = load double* %tmp.14.i27445 ; <double> [#uses=1]
- %tmp.17.i27448 = getelementptr %"struct.std::dcomplex"* %tmp.0.i27443, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i27449 = load double* %tmp.17.i27448 ; <double> [#uses=1]
- %tmp.4.i27423 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i27422, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i27425 = load double* %tmp.5.i34282 ; <double> [#uses=1]
- store double %tmp.6.i27425, double* %tmp.4.i27423
- %tmp.7.i27426 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i27422, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i27428 = load double* %tmp.8.i34285 ; <double> [#uses=1]
- store double %tmp.9.i27428, double* %tmp.7.i27426
- %tmp.0.i27429 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i27422, %"struct.std::dcomplex"* %tmp.62 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i27431 = getelementptr %"struct.std::dcomplex"* %tmp.0.i27429, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i27432 = load double* %tmp.14.i27431 ; <double> [#uses=1]
- %tmp.17.i27434 = getelementptr %"struct.std::dcomplex"* %tmp.0.i27429, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i27435 = load double* %tmp.17.i27434 ; <double> [#uses=1]
- %tmp.4.i27409 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i27408, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i27411 = load double* %tmp.5.i34082 ; <double> [#uses=1]
- store double %tmp.6.i27411, double* %tmp.4.i27409
- %tmp.7.i27412 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i27408, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i27414 = load double* %tmp.8.i34085 ; <double> [#uses=1]
- store double %tmp.9.i27414, double* %tmp.7.i27412
- %tmp.0.i27415 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i27408, %"struct.std::dcomplex"* %tmp.21 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i27416 = getelementptr %"struct.std::dcomplex"* %mem_tmp.376, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i27417 = getelementptr %"struct.std::dcomplex"* %tmp.0.i27415, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i27418 = load double* %tmp.14.i27417 ; <double> [#uses=1]
- store double %tmp.15.i27418, double* %tmp.13.i27416
- %tmp.16.i27419 = getelementptr %"struct.std::dcomplex"* %mem_tmp.376, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i27420 = getelementptr %"struct.std::dcomplex"* %tmp.0.i27415, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i27421 = load double* %tmp.17.i27420 ; <double> [#uses=1]
- store double %tmp.18.i27421, double* %tmp.16.i27419
- %tmp.4.i27395 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i27394, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i27432, double* %tmp.4.i27395
- %tmp.7.i27398 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i27394, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i27435, double* %tmp.7.i27398
- %tmp.0.i27401 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i27394, %"struct.std::dcomplex"* %mem_tmp.376 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i27403 = getelementptr %"struct.std::dcomplex"* %tmp.0.i27401, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i27404 = load double* %tmp.14.i27403 ; <double> [#uses=1]
- %tmp.17.i27406 = getelementptr %"struct.std::dcomplex"* %tmp.0.i27401, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i27407 = load double* %tmp.17.i27406 ; <double> [#uses=1]
- %tmp.4.i27381 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i27380, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i27404, double* %tmp.4.i27381
- %tmp.7.i27384 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i27380, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i27407, double* %tmp.7.i27384
- %tmp.0.i27387 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i27380, %"struct.std::dcomplex"* %tmp.45 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i27388 = getelementptr %"struct.std::dcomplex"* %mem_tmp.373, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i27389 = getelementptr %"struct.std::dcomplex"* %tmp.0.i27387, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i27390 = load double* %tmp.14.i27389 ; <double> [#uses=1]
- store double %tmp.15.i27390, double* %tmp.13.i27388
- %tmp.16.i27391 = getelementptr %"struct.std::dcomplex"* %mem_tmp.373, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i27392 = getelementptr %"struct.std::dcomplex"* %tmp.0.i27387, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i27393 = load double* %tmp.17.i27392 ; <double> [#uses=1]
- store double %tmp.18.i27393, double* %tmp.16.i27391
- %tmp.4.i27367 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i27366, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i27446, double* %tmp.4.i27367
- %tmp.7.i27370 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i27366, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i27449, double* %tmp.7.i27370
- %tmp.0.i27373 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i27366, %"struct.std::dcomplex"* %mem_tmp.373 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i27375 = getelementptr %"struct.std::dcomplex"* %tmp.0.i27373, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i27376 = load double* %tmp.14.i27375 ; <double> [#uses=1]
- %tmp.17.i27378 = getelementptr %"struct.std::dcomplex"* %tmp.0.i27373, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i27379 = load double* %tmp.17.i27378 ; <double> [#uses=1]
- %tmp.4.i27353 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i27352, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i27355 = load double* %tmp.5.i34082 ; <double> [#uses=1]
- store double %tmp.6.i27355, double* %tmp.4.i27353
- %tmp.7.i27356 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i27352, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i27358 = load double* %tmp.8.i34085 ; <double> [#uses=1]
- store double %tmp.9.i27358, double* %tmp.7.i27356
- %tmp.0.i27359 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i27352, %"struct.std::dcomplex"* %tmp.6 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i27361 = getelementptr %"struct.std::dcomplex"* %tmp.0.i27359, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i27362 = load double* %tmp.14.i27361 ; <double> [#uses=1]
- %tmp.17.i27364 = getelementptr %"struct.std::dcomplex"* %tmp.0.i27359, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i27365 = load double* %tmp.17.i27364 ; <double> [#uses=1]
- %tmp.4.i27339 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i27338, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i27341 = load double* %tmp.5.i34338 ; <double> [#uses=1]
- store double %tmp.6.i27341, double* %tmp.4.i27339
- %tmp.7.i27342 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i27338, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i27344 = load double* %tmp.8.i34341 ; <double> [#uses=1]
- store double %tmp.9.i27344, double* %tmp.7.i27342
- %tmp.0.i27345 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i27338, %"struct.std::dcomplex"* %tmp.62 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i27346 = getelementptr %"struct.std::dcomplex"* %mem_tmp.380, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i27347 = getelementptr %"struct.std::dcomplex"* %tmp.0.i27345, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i27348 = load double* %tmp.14.i27347 ; <double> [#uses=1]
- store double %tmp.15.i27348, double* %tmp.13.i27346
- %tmp.16.i27349 = getelementptr %"struct.std::dcomplex"* %mem_tmp.380, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i27350 = getelementptr %"struct.std::dcomplex"* %tmp.0.i27345, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i27351 = load double* %tmp.17.i27350 ; <double> [#uses=1]
- store double %tmp.18.i27351, double* %tmp.16.i27349
- %tmp.4.i27325 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i27324, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i27362, double* %tmp.4.i27325
- %tmp.7.i27328 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i27324, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i27365, double* %tmp.7.i27328
- %tmp.0.i27331 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i27324, %"struct.std::dcomplex"* %mem_tmp.380 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i27333 = getelementptr %"struct.std::dcomplex"* %tmp.0.i27331, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i27334 = load double* %tmp.14.i27333 ; <double> [#uses=1]
- %tmp.17.i27336 = getelementptr %"struct.std::dcomplex"* %tmp.0.i27331, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i27337 = load double* %tmp.17.i27336 ; <double> [#uses=1]
- %tmp.4.i27311 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i27310, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i27334, double* %tmp.4.i27311
- %tmp.7.i27314 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i27310, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i27337, double* %tmp.7.i27314
- %tmp.0.i27317 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i27310, %"struct.std::dcomplex"* %tmp.15 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i27318 = getelementptr %"struct.std::dcomplex"* %mem_tmp.377, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i27319 = getelementptr %"struct.std::dcomplex"* %tmp.0.i27317, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i27320 = load double* %tmp.14.i27319 ; <double> [#uses=1]
- store double %tmp.15.i27320, double* %tmp.13.i27318
- %tmp.16.i27321 = getelementptr %"struct.std::dcomplex"* %mem_tmp.377, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i27322 = getelementptr %"struct.std::dcomplex"* %tmp.0.i27317, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i27323 = load double* %tmp.17.i27322 ; <double> [#uses=1]
- store double %tmp.18.i27323, double* %tmp.16.i27321
- %tmp.4.i27297 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i27296, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i27376, double* %tmp.4.i27297
- %tmp.7.i27300 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i27296, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i27379, double* %tmp.7.i27300
- %tmp.0.i27303 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i27296, %"struct.std::dcomplex"* %mem_tmp.377 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i27305 = getelementptr %"struct.std::dcomplex"* %tmp.0.i27303, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i27306 = load double* %tmp.14.i27305 ; <double> [#uses=1]
- %tmp.17.i27308 = getelementptr %"struct.std::dcomplex"* %tmp.0.i27303, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i27309 = load double* %tmp.17.i27308 ; <double> [#uses=1]
- store double %tmp.15.i27306, double* %tmp.2.i34364
- store double %tmp.18.i27309, double* %tmp.6.i34365
- %tmp.4.i27263 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i27262, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i27265 = load double* %tmp.5.i27590 ; <double> [#uses=1]
- store double %tmp.6.i27265, double* %tmp.4.i27263
- %tmp.7.i27266 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i27262, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i27268 = load double* %tmp.8.i27593 ; <double> [#uses=1]
- store double %tmp.9.i27268, double* %tmp.7.i27266
- %tmp.0.i27269 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i27262, %"struct.std::dcomplex"* %ret3 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i27271 = getelementptr %"struct.std::dcomplex"* %tmp.0.i27269, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i27272 = load double* %tmp.14.i27271 ; <double> [#uses=1]
- %tmp.17.i27274 = getelementptr %"struct.std::dcomplex"* %tmp.0.i27269, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i27275 = load double* %tmp.17.i27274 ; <double> [#uses=1]
- %tmp.7.i27229 = load double* %tmp.2.i34366 ; <double> [#uses=1]
- %tmp.15.i27243 = add double %tmp.7.i27229, %tmp.15.i27272 ; <double> [#uses=1]
- store double %tmp.15.i27243, double* %tmp.2.i34366
- %tmp.26.i27250 = load double* %tmp.6.i34367 ; <double> [#uses=1]
- %tmp.31.i27261 = add double %tmp.26.i27250, %tmp.18.i27275 ; <double> [#uses=1]
- store double %tmp.31.i27261, double* %tmp.6.i34367
- %tmp.4.i27209 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i27208, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i27211 = load double* %tmp.5.i28602 ; <double> [#uses=1]
- store double %tmp.6.i27211, double* %tmp.4.i27209
- %tmp.7.i27212 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i27208, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i27214 = load double* %tmp.8.i28605 ; <double> [#uses=1]
- store double %tmp.9.i27214, double* %tmp.7.i27212
- %tmp.0.i27215 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i27208, %"struct.std::dcomplex"* %tmp.62 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i27217 = getelementptr %"struct.std::dcomplex"* %tmp.0.i27215, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i27218 = load double* %tmp.14.i27217 ; <double> [#uses=1]
- %tmp.17.i27220 = getelementptr %"struct.std::dcomplex"* %tmp.0.i27215, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i27221 = load double* %tmp.17.i27220 ; <double> [#uses=1]
- %tmp.4.i27195 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i27194, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i27197 = load double* %tmp.5.i34082 ; <double> [#uses=1]
- store double %tmp.6.i27197, double* %tmp.4.i27195
- %tmp.7.i27198 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i27194, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i27200 = load double* %tmp.8.i34085 ; <double> [#uses=1]
- store double %tmp.9.i27200, double* %tmp.7.i27198
- %tmp.0.i27201 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i27194, %"struct.std::dcomplex"* %tmp.1036 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i27202 = getelementptr %"struct.std::dcomplex"* %mem_tmp.387, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i27203 = getelementptr %"struct.std::dcomplex"* %tmp.0.i27201, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i27204 = load double* %tmp.14.i27203 ; <double> [#uses=1]
- store double %tmp.15.i27204, double* %tmp.13.i27202
- %tmp.16.i27205 = getelementptr %"struct.std::dcomplex"* %mem_tmp.387, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i27206 = getelementptr %"struct.std::dcomplex"* %tmp.0.i27201, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i27207 = load double* %tmp.17.i27206 ; <double> [#uses=1]
- store double %tmp.18.i27207, double* %tmp.16.i27205
- %tmp.4.i27181 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i27180, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i27218, double* %tmp.4.i27181
- %tmp.7.i27184 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i27180, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i27221, double* %tmp.7.i27184
- %tmp.0.i27187 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i27180, %"struct.std::dcomplex"* %mem_tmp.387 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i27189 = getelementptr %"struct.std::dcomplex"* %tmp.0.i27187, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i27190 = load double* %tmp.14.i27189 ; <double> [#uses=1]
- %tmp.17.i27192 = getelementptr %"struct.std::dcomplex"* %tmp.0.i27187, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i27193 = load double* %tmp.17.i27192 ; <double> [#uses=1]
- %tmp.4.i27167 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i27166, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i27190, double* %tmp.4.i27167
- %tmp.7.i27170 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i27166, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i27193, double* %tmp.7.i27170
- %tmp.0.i27173 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i27166, %"struct.std::dcomplex"* %tmp.15 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i27175 = getelementptr %"struct.std::dcomplex"* %tmp.0.i27173, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i27176 = load double* %tmp.14.i27175 ; <double> [#uses=1]
- %tmp.17.i27178 = getelementptr %"struct.std::dcomplex"* %tmp.0.i27173, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i27179 = load double* %tmp.17.i27178 ; <double> [#uses=1]
- %tmp.4.i27153 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i27152, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i27155 = load double* %tmp.5.i34282 ; <double> [#uses=1]
- store double %tmp.6.i27155, double* %tmp.4.i27153
- %tmp.7.i27156 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i27152, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i27158 = load double* %tmp.8.i34285 ; <double> [#uses=1]
- store double %tmp.9.i27158, double* %tmp.7.i27156
- %tmp.0.i27159 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i27152, %"struct.std::dcomplex"* %tmp.1036 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i27161 = getelementptr %"struct.std::dcomplex"* %tmp.0.i27159, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i27162 = load double* %tmp.14.i27161 ; <double> [#uses=1]
- %tmp.17.i27164 = getelementptr %"struct.std::dcomplex"* %tmp.0.i27159, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i27165 = load double* %tmp.17.i27164 ; <double> [#uses=1]
- %tmp.4.i27139 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i27138, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i27141 = load double* %tmp.5.i28602 ; <double> [#uses=1]
- store double %tmp.6.i27141, double* %tmp.4.i27139
- %tmp.7.i27142 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i27138, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i27144 = load double* %tmp.8.i28605 ; <double> [#uses=1]
- store double %tmp.9.i27144, double* %tmp.7.i27142
- %tmp.0.i27145 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i27138, %"struct.std::dcomplex"* %tmp.21 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i27146 = getelementptr %"struct.std::dcomplex"* %mem_tmp.391, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i27147 = getelementptr %"struct.std::dcomplex"* %tmp.0.i27145, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i27148 = load double* %tmp.14.i27147 ; <double> [#uses=1]
- store double %tmp.15.i27148, double* %tmp.13.i27146
- %tmp.16.i27149 = getelementptr %"struct.std::dcomplex"* %mem_tmp.391, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i27150 = getelementptr %"struct.std::dcomplex"* %tmp.0.i27145, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i27151 = load double* %tmp.17.i27150 ; <double> [#uses=1]
- store double %tmp.18.i27151, double* %tmp.16.i27149
- %tmp.4.i27125 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i27124, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i27162, double* %tmp.4.i27125
- %tmp.7.i27128 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i27124, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i27165, double* %tmp.7.i27128
- %tmp.0.i27131 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i27124, %"struct.std::dcomplex"* %mem_tmp.391 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i27133 = getelementptr %"struct.std::dcomplex"* %tmp.0.i27131, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i27134 = load double* %tmp.14.i27133 ; <double> [#uses=1]
- %tmp.17.i27136 = getelementptr %"struct.std::dcomplex"* %tmp.0.i27131, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i27137 = load double* %tmp.17.i27136 ; <double> [#uses=1]
- %tmp.4.i27111 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i27110, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i27134, double* %tmp.4.i27111
- %tmp.7.i27114 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i27110, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i27137, double* %tmp.7.i27114
- %tmp.0.i27117 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i27110, %"struct.std::dcomplex"* %tmp.95 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i27118 = getelementptr %"struct.std::dcomplex"* %mem_tmp.388, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i27119 = getelementptr %"struct.std::dcomplex"* %tmp.0.i27117, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i27120 = load double* %tmp.14.i27119 ; <double> [#uses=1]
- store double %tmp.15.i27120, double* %tmp.13.i27118
- %tmp.16.i27121 = getelementptr %"struct.std::dcomplex"* %mem_tmp.388, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i27122 = getelementptr %"struct.std::dcomplex"* %tmp.0.i27117, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i27123 = load double* %tmp.17.i27122 ; <double> [#uses=1]
- store double %tmp.18.i27123, double* %tmp.16.i27121
- %tmp.4.i27097 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i27096, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i27176, double* %tmp.4.i27097
- %tmp.7.i27100 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i27096, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i27179, double* %tmp.7.i27100
- %tmp.0.i27103 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i27096, %"struct.std::dcomplex"* %mem_tmp.388 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i27105 = getelementptr %"struct.std::dcomplex"* %tmp.0.i27103, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i27106 = load double* %tmp.14.i27105 ; <double> [#uses=1]
- %tmp.17.i27108 = getelementptr %"struct.std::dcomplex"* %tmp.0.i27103, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i27109 = load double* %tmp.17.i27108 ; <double> [#uses=1]
- %tmp.4.i27083 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i27082, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i27085 = load double* %tmp.5.i34082 ; <double> [#uses=1]
- store double %tmp.6.i27085, double* %tmp.4.i27083
- %tmp.7.i27086 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i27082, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i27088 = load double* %tmp.8.i34085 ; <double> [#uses=1]
- store double %tmp.9.i27088, double* %tmp.7.i27086
- %tmp.0.i27089 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i27082, %"struct.std::dcomplex"* %tmp.21 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i27091 = getelementptr %"struct.std::dcomplex"* %tmp.0.i27089, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i27092 = load double* %tmp.14.i27091 ; <double> [#uses=1]
- %tmp.17.i27094 = getelementptr %"struct.std::dcomplex"* %tmp.0.i27089, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i27095 = load double* %tmp.17.i27094 ; <double> [#uses=1]
- %tmp.4.i27069 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i27068, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i27071 = load double* %tmp.5.i34282 ; <double> [#uses=1]
- store double %tmp.6.i27071, double* %tmp.4.i27069
- %tmp.7.i27072 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i27068, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i27074 = load double* %tmp.8.i34285 ; <double> [#uses=1]
- store double %tmp.9.i27074, double* %tmp.7.i27072
- %tmp.0.i27075 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i27068, %"struct.std::dcomplex"* %tmp.62 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i27076 = getelementptr %"struct.std::dcomplex"* %mem_tmp.395, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i27077 = getelementptr %"struct.std::dcomplex"* %tmp.0.i27075, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i27078 = load double* %tmp.14.i27077 ; <double> [#uses=1]
- store double %tmp.15.i27078, double* %tmp.13.i27076
- %tmp.16.i27079 = getelementptr %"struct.std::dcomplex"* %mem_tmp.395, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i27080 = getelementptr %"struct.std::dcomplex"* %tmp.0.i27075, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i27081 = load double* %tmp.17.i27080 ; <double> [#uses=1]
- store double %tmp.18.i27081, double* %tmp.16.i27079
- %tmp.4.i27055 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i27054, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i27092, double* %tmp.4.i27055
- %tmp.7.i27058 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i27054, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i27095, double* %tmp.7.i27058
- %tmp.0.i27061 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i27054, %"struct.std::dcomplex"* %mem_tmp.395 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i27063 = getelementptr %"struct.std::dcomplex"* %tmp.0.i27061, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i27064 = load double* %tmp.14.i27063 ; <double> [#uses=1]
- %tmp.17.i27066 = getelementptr %"struct.std::dcomplex"* %tmp.0.i27061, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i27067 = load double* %tmp.17.i27066 ; <double> [#uses=1]
- %tmp.4.i27041 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i27040, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i27064, double* %tmp.4.i27041
- %tmp.7.i27044 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i27040, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i27067, double* %tmp.7.i27044
- %tmp.0.i27047 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i27040, %"struct.std::dcomplex"* %tmp.1075 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i27048 = getelementptr %"struct.std::dcomplex"* %mem_tmp.392, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i27049 = getelementptr %"struct.std::dcomplex"* %tmp.0.i27047, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i27050 = load double* %tmp.14.i27049 ; <double> [#uses=1]
- store double %tmp.15.i27050, double* %tmp.13.i27048
- %tmp.16.i27051 = getelementptr %"struct.std::dcomplex"* %mem_tmp.392, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i27052 = getelementptr %"struct.std::dcomplex"* %tmp.0.i27047, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i27053 = load double* %tmp.17.i27052 ; <double> [#uses=1]
- store double %tmp.18.i27053, double* %tmp.16.i27051
- %tmp.4.i27027 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i27026, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i27106, double* %tmp.4.i27027
- %tmp.7.i27030 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i27026, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i27109, double* %tmp.7.i27030
- %tmp.0.i27033 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i27026, %"struct.std::dcomplex"* %mem_tmp.392 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i27035 = getelementptr %"struct.std::dcomplex"* %tmp.0.i27033, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i27036 = load double* %tmp.14.i27035 ; <double> [#uses=1]
- %tmp.17.i27038 = getelementptr %"struct.std::dcomplex"* %tmp.0.i27033, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i27039 = load double* %tmp.17.i27038 ; <double> [#uses=1]
- store double %tmp.15.i27036, double* %tmp.2.i34364
- store double %tmp.18.i27039, double* %tmp.6.i34365
- %tmp.4.i26993 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i26992, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i26995 = load double* %tmp.5.i33596 ; <double> [#uses=1]
- store double %tmp.6.i26995, double* %tmp.4.i26993
- %tmp.7.i26996 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i26992, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i26998 = load double* %tmp.8.i33599 ; <double> [#uses=1]
- store double %tmp.9.i26998, double* %tmp.7.i26996
- %tmp.0.i26999 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i26992, %"struct.std::dcomplex"* %ret3 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i27001 = getelementptr %"struct.std::dcomplex"* %tmp.0.i26999, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i27002 = load double* %tmp.14.i27001 ; <double> [#uses=1]
- %tmp.17.i27004 = getelementptr %"struct.std::dcomplex"* %tmp.0.i26999, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i27005 = load double* %tmp.17.i27004 ; <double> [#uses=1]
- %tmp.7.i26959 = load double* %tmp.2.i34366 ; <double> [#uses=1]
- %tmp.15.i26973 = add double %tmp.7.i26959, %tmp.15.i27002 ; <double> [#uses=1]
- store double %tmp.15.i26973, double* %tmp.2.i34366
- %tmp.26.i26980 = load double* %tmp.6.i34367 ; <double> [#uses=1]
- %tmp.31.i26991 = add double %tmp.26.i26980, %tmp.18.i27005 ; <double> [#uses=1]
- store double %tmp.31.i26991, double* %tmp.6.i34367
- %tmp.4.i26939 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i26938, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i26941 = load double* %tmp.5.i34338 ; <double> [#uses=1]
- store double %tmp.6.i26941, double* %tmp.4.i26939
- %tmp.7.i26942 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i26938, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i26944 = load double* %tmp.8.i34341 ; <double> [#uses=1]
- store double %tmp.9.i26944, double* %tmp.7.i26942
- %tmp.0.i26945 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i26938, %"struct.std::dcomplex"* %tmp.62 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i26947 = getelementptr %"struct.std::dcomplex"* %tmp.0.i26945, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i26948 = load double* %tmp.14.i26947 ; <double> [#uses=1]
- %tmp.17.i26950 = getelementptr %"struct.std::dcomplex"* %tmp.0.i26945, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i26951 = load double* %tmp.17.i26950 ; <double> [#uses=1]
- %tmp.4.i26925 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i26924, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i26927 = load double* %tmp.5.i34082 ; <double> [#uses=1]
- store double %tmp.6.i26927, double* %tmp.4.i26925
- %tmp.7.i26928 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i26924, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i26930 = load double* %tmp.8.i34085 ; <double> [#uses=1]
- store double %tmp.9.i26930, double* %tmp.7.i26928
- %tmp.0.i26931 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i26924, %"struct.std::dcomplex"* %tmp.6 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i26932 = getelementptr %"struct.std::dcomplex"* %mem_tmp.402, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i26933 = getelementptr %"struct.std::dcomplex"* %tmp.0.i26931, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i26934 = load double* %tmp.14.i26933 ; <double> [#uses=1]
- store double %tmp.15.i26934, double* %tmp.13.i26932
- %tmp.16.i26935 = getelementptr %"struct.std::dcomplex"* %mem_tmp.402, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i26936 = getelementptr %"struct.std::dcomplex"* %tmp.0.i26931, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i26937 = load double* %tmp.17.i26936 ; <double> [#uses=1]
- store double %tmp.18.i26937, double* %tmp.16.i26935
- %tmp.4.i26911 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i26910, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i26948, double* %tmp.4.i26911
- %tmp.7.i26914 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i26910, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i26951, double* %tmp.7.i26914
- %tmp.0.i26917 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i26910, %"struct.std::dcomplex"* %mem_tmp.402 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i26919 = getelementptr %"struct.std::dcomplex"* %tmp.0.i26917, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i26920 = load double* %tmp.14.i26919 ; <double> [#uses=1]
- %tmp.17.i26922 = getelementptr %"struct.std::dcomplex"* %tmp.0.i26917, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i26923 = load double* %tmp.17.i26922 ; <double> [#uses=1]
- %tmp.4.i26897 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i26896, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i26920, double* %tmp.4.i26897
- %tmp.7.i26900 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i26896, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i26923, double* %tmp.7.i26900
- %tmp.0.i26903 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i26896, %"struct.std::dcomplex"* %tmp.1075 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i26905 = getelementptr %"struct.std::dcomplex"* %tmp.0.i26903, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i26906 = load double* %tmp.14.i26905 ; <double> [#uses=1]
- %tmp.17.i26908 = getelementptr %"struct.std::dcomplex"* %tmp.0.i26903, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i26909 = load double* %tmp.17.i26908 ; <double> [#uses=1]
- %tmp.4.i26883 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i26882, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i26885 = load double* %tmp.5.i34082 ; <double> [#uses=1]
- store double %tmp.6.i26885, double* %tmp.4.i26883
- %tmp.7.i26886 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i26882, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i26888 = load double* %tmp.8.i34085 ; <double> [#uses=1]
- store double %tmp.9.i26888, double* %tmp.7.i26886
- %tmp.0.i26889 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i26882, %"struct.std::dcomplex"* %tmp.1036 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i26891 = getelementptr %"struct.std::dcomplex"* %tmp.0.i26889, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i26892 = load double* %tmp.14.i26891 ; <double> [#uses=1]
- %tmp.17.i26894 = getelementptr %"struct.std::dcomplex"* %tmp.0.i26889, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i26895 = load double* %tmp.17.i26894 ; <double> [#uses=1]
- %tmp.4.i26869 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i26868, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i26871 = load double* %tmp.5.i28602 ; <double> [#uses=1]
- store double %tmp.6.i26871, double* %tmp.4.i26869
- %tmp.7.i26872 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i26868, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i26874 = load double* %tmp.8.i28605 ; <double> [#uses=1]
- store double %tmp.9.i26874, double* %tmp.7.i26872
- %tmp.0.i26875 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i26868, %"struct.std::dcomplex"* %tmp.62 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i26876 = getelementptr %"struct.std::dcomplex"* %mem_tmp.406, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i26877 = getelementptr %"struct.std::dcomplex"* %tmp.0.i26875, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i26878 = load double* %tmp.14.i26877 ; <double> [#uses=1]
- store double %tmp.15.i26878, double* %tmp.13.i26876
- %tmp.16.i26879 = getelementptr %"struct.std::dcomplex"* %mem_tmp.406, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i26880 = getelementptr %"struct.std::dcomplex"* %tmp.0.i26875, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i26881 = load double* %tmp.17.i26880 ; <double> [#uses=1]
- store double %tmp.18.i26881, double* %tmp.16.i26879
- %tmp.4.i26855 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i26854, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i26892, double* %tmp.4.i26855
- %tmp.7.i26858 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i26854, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i26895, double* %tmp.7.i26858
- %tmp.0.i26861 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i26854, %"struct.std::dcomplex"* %mem_tmp.406 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i26863 = getelementptr %"struct.std::dcomplex"* %tmp.0.i26861, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i26864 = load double* %tmp.14.i26863 ; <double> [#uses=1]
- %tmp.17.i26866 = getelementptr %"struct.std::dcomplex"* %tmp.0.i26861, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i26867 = load double* %tmp.17.i26866 ; <double> [#uses=1]
- %tmp.4.i26841 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i26840, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i26864, double* %tmp.4.i26841
- %tmp.7.i26844 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i26840, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i26867, double* %tmp.7.i26844
- %tmp.0.i26847 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i26840, %"struct.std::dcomplex"* %tmp.45 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i26848 = getelementptr %"struct.std::dcomplex"* %mem_tmp.403, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i26849 = getelementptr %"struct.std::dcomplex"* %tmp.0.i26847, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i26850 = load double* %tmp.14.i26849 ; <double> [#uses=1]
- store double %tmp.15.i26850, double* %tmp.13.i26848
- %tmp.16.i26851 = getelementptr %"struct.std::dcomplex"* %mem_tmp.403, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i26852 = getelementptr %"struct.std::dcomplex"* %tmp.0.i26847, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i26853 = load double* %tmp.17.i26852 ; <double> [#uses=1]
- store double %tmp.18.i26853, double* %tmp.16.i26851
- %tmp.4.i26827 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i26826, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i26906, double* %tmp.4.i26827
- %tmp.7.i26830 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i26826, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i26909, double* %tmp.7.i26830
- %tmp.0.i26833 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i26826, %"struct.std::dcomplex"* %mem_tmp.403 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i26835 = getelementptr %"struct.std::dcomplex"* %tmp.0.i26833, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i26836 = load double* %tmp.14.i26835 ; <double> [#uses=1]
- %tmp.17.i26838 = getelementptr %"struct.std::dcomplex"* %tmp.0.i26833, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i26839 = load double* %tmp.17.i26838 ; <double> [#uses=1]
- %tmp.4.i26813 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i26812, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i26815 = load double* %tmp.5.i28602 ; <double> [#uses=1]
- store double %tmp.6.i26815, double* %tmp.4.i26813
- %tmp.7.i26816 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i26812, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i26818 = load double* %tmp.8.i28605 ; <double> [#uses=1]
- store double %tmp.9.i26818, double* %tmp.7.i26816
- %tmp.0.i26819 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i26812, %"struct.std::dcomplex"* %tmp.6 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i26821 = getelementptr %"struct.std::dcomplex"* %tmp.0.i26819, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i26822 = load double* %tmp.14.i26821 ; <double> [#uses=1]
- %tmp.17.i26824 = getelementptr %"struct.std::dcomplex"* %tmp.0.i26819, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i26825 = load double* %tmp.17.i26824 ; <double> [#uses=1]
- %tmp.4.i26799 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i26798, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i26801 = load double* %tmp.5.i34338 ; <double> [#uses=1]
- store double %tmp.6.i26801, double* %tmp.4.i26799
- %tmp.7.i26802 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i26798, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i26804 = load double* %tmp.8.i34341 ; <double> [#uses=1]
- store double %tmp.9.i26804, double* %tmp.7.i26802
- %tmp.0.i26805 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i26798, %"struct.std::dcomplex"* %tmp.1036 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i26806 = getelementptr %"struct.std::dcomplex"* %mem_tmp.410, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i26807 = getelementptr %"struct.std::dcomplex"* %tmp.0.i26805, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i26808 = load double* %tmp.14.i26807 ; <double> [#uses=1]
- store double %tmp.15.i26808, double* %tmp.13.i26806
- %tmp.16.i26809 = getelementptr %"struct.std::dcomplex"* %mem_tmp.410, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i26810 = getelementptr %"struct.std::dcomplex"* %tmp.0.i26805, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i26811 = load double* %tmp.17.i26810 ; <double> [#uses=1]
- store double %tmp.18.i26811, double* %tmp.16.i26809
- %tmp.4.i26785 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i26784, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i26822, double* %tmp.4.i26785
- %tmp.7.i26788 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i26784, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i26825, double* %tmp.7.i26788
- %tmp.0.i26791 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i26784, %"struct.std::dcomplex"* %mem_tmp.410 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i26793 = getelementptr %"struct.std::dcomplex"* %tmp.0.i26791, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i26794 = load double* %tmp.14.i26793 ; <double> [#uses=1]
- %tmp.17.i26796 = getelementptr %"struct.std::dcomplex"* %tmp.0.i26791, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i26797 = load double* %tmp.17.i26796 ; <double> [#uses=1]
- %tmp.4.i26771 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i26770, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i26794, double* %tmp.4.i26771
- %tmp.7.i26774 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i26770, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i26797, double* %tmp.7.i26774
- %tmp.0.i26777 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i26770, %"struct.std::dcomplex"* %tmp.95 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i26778 = getelementptr %"struct.std::dcomplex"* %mem_tmp.407, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i26779 = getelementptr %"struct.std::dcomplex"* %tmp.0.i26777, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i26780 = load double* %tmp.14.i26779 ; <double> [#uses=1]
- store double %tmp.15.i26780, double* %tmp.13.i26778
- %tmp.16.i26781 = getelementptr %"struct.std::dcomplex"* %mem_tmp.407, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i26782 = getelementptr %"struct.std::dcomplex"* %tmp.0.i26777, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i26783 = load double* %tmp.17.i26782 ; <double> [#uses=1]
- store double %tmp.18.i26783, double* %tmp.16.i26781
- %tmp.4.i26757 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i26756, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i26836, double* %tmp.4.i26757
- %tmp.7.i26760 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i26756, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i26839, double* %tmp.7.i26760
- %tmp.0.i26763 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i26756, %"struct.std::dcomplex"* %mem_tmp.407 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i26765 = getelementptr %"struct.std::dcomplex"* %tmp.0.i26763, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i26766 = load double* %tmp.14.i26765 ; <double> [#uses=1]
- %tmp.17.i26768 = getelementptr %"struct.std::dcomplex"* %tmp.0.i26763, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i26769 = load double* %tmp.17.i26768 ; <double> [#uses=1]
- store double %tmp.15.i26766, double* %tmp.2.i34364
- store double %tmp.18.i26769, double* %tmp.6.i34365
- %tmp.4.i26723 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i26722, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i26725 = load double* %tmp.5.i33326 ; <double> [#uses=1]
- store double %tmp.6.i26725, double* %tmp.4.i26723
- %tmp.7.i26726 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i26722, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i26728 = load double* %tmp.8.i33329 ; <double> [#uses=1]
- store double %tmp.9.i26728, double* %tmp.7.i26726
- %tmp.0.i26729 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i26722, %"struct.std::dcomplex"* %ret3 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i26731 = getelementptr %"struct.std::dcomplex"* %tmp.0.i26729, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i26732 = load double* %tmp.14.i26731 ; <double> [#uses=1]
- %tmp.17.i26734 = getelementptr %"struct.std::dcomplex"* %tmp.0.i26729, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i26735 = load double* %tmp.17.i26734 ; <double> [#uses=1]
- %tmp.7.i26689 = load double* %tmp.2.i34366 ; <double> [#uses=1]
- %tmp.15.i26703 = add double %tmp.7.i26689, %tmp.15.i26732 ; <double> [#uses=1]
- store double %tmp.15.i26703, double* %tmp.2.i34366
- %tmp.26.i26710 = load double* %tmp.6.i34367 ; <double> [#uses=1]
- %tmp.31.i26721 = add double %tmp.26.i26710, %tmp.18.i26735 ; <double> [#uses=1]
- store double %tmp.31.i26721, double* %tmp.6.i34367
- %tmp.4.i26669 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i26668, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i26671 = load double* %tmp.5.i34338 ; <double> [#uses=1]
- store double %tmp.6.i26671, double* %tmp.4.i26669
- %tmp.7.i26672 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i26668, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i26674 = load double* %tmp.8.i34341 ; <double> [#uses=1]
- store double %tmp.9.i26674, double* %tmp.7.i26672
- %tmp.0.i26675 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i26668, %"struct.std::dcomplex"* %tmp.1036 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i26677 = getelementptr %"struct.std::dcomplex"* %tmp.0.i26675, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i26678 = load double* %tmp.14.i26677 ; <double> [#uses=1]
- %tmp.17.i26680 = getelementptr %"struct.std::dcomplex"* %tmp.0.i26675, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i26681 = load double* %tmp.17.i26680 ; <double> [#uses=1]
- %tmp.4.i26655 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i26654, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i26657 = load double* %tmp.5.i28602 ; <double> [#uses=1]
- store double %tmp.6.i26657, double* %tmp.4.i26655
- %tmp.7.i26658 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i26654, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i26660 = load double* %tmp.8.i28605 ; <double> [#uses=1]
- store double %tmp.9.i26660, double* %tmp.7.i26658
- %tmp.0.i26661 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i26654, %"struct.std::dcomplex"* %tmp.6 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i26662 = getelementptr %"struct.std::dcomplex"* %mem_tmp.417, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i26663 = getelementptr %"struct.std::dcomplex"* %tmp.0.i26661, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i26664 = load double* %tmp.14.i26663 ; <double> [#uses=1]
- store double %tmp.15.i26664, double* %tmp.13.i26662
- %tmp.16.i26665 = getelementptr %"struct.std::dcomplex"* %mem_tmp.417, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i26666 = getelementptr %"struct.std::dcomplex"* %tmp.0.i26661, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i26667 = load double* %tmp.17.i26666 ; <double> [#uses=1]
- store double %tmp.18.i26667, double* %tmp.16.i26665
- %tmp.4.i26641 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i26640, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i26678, double* %tmp.4.i26641
- %tmp.7.i26644 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i26640, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i26681, double* %tmp.7.i26644
- %tmp.0.i26647 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i26640, %"struct.std::dcomplex"* %mem_tmp.417 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i26649 = getelementptr %"struct.std::dcomplex"* %tmp.0.i26647, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i26650 = load double* %tmp.14.i26649 ; <double> [#uses=1]
- %tmp.17.i26652 = getelementptr %"struct.std::dcomplex"* %tmp.0.i26647, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i26653 = load double* %tmp.17.i26652 ; <double> [#uses=1]
- %tmp.4.i26627 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i26626, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i26650, double* %tmp.4.i26627
- %tmp.7.i26630 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i26626, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i26653, double* %tmp.7.i26630
- %tmp.0.i26633 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i26626, %"struct.std::dcomplex"* %tmp.15 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i26635 = getelementptr %"struct.std::dcomplex"* %tmp.0.i26633, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i26636 = load double* %tmp.14.i26635 ; <double> [#uses=1]
- %tmp.17.i26638 = getelementptr %"struct.std::dcomplex"* %tmp.0.i26633, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i26639 = load double* %tmp.17.i26638 ; <double> [#uses=1]
- %tmp.4.i26613 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i26612, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i26615 = load double* %tmp.5.i34282 ; <double> [#uses=1]
- store double %tmp.6.i26615, double* %tmp.4.i26613
- %tmp.7.i26616 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i26612, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i26618 = load double* %tmp.8.i34285 ; <double> [#uses=1]
- store double %tmp.9.i26618, double* %tmp.7.i26616
- %tmp.0.i26619 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i26612, %"struct.std::dcomplex"* %tmp.6 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i26621 = getelementptr %"struct.std::dcomplex"* %tmp.0.i26619, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i26622 = load double* %tmp.14.i26621 ; <double> [#uses=1]
- %tmp.17.i26624 = getelementptr %"struct.std::dcomplex"* %tmp.0.i26619, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i26625 = load double* %tmp.17.i26624 ; <double> [#uses=1]
- %tmp.4.i26599 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i26598, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i26601 = load double* %tmp.5.i34338 ; <double> [#uses=1]
- store double %tmp.6.i26601, double* %tmp.4.i26599
- %tmp.7.i26602 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i26598, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i26604 = load double* %tmp.8.i34341 ; <double> [#uses=1]
- store double %tmp.9.i26604, double* %tmp.7.i26602
- %tmp.0.i26605 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i26598, %"struct.std::dcomplex"* %tmp.21 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i26606 = getelementptr %"struct.std::dcomplex"* %mem_tmp.421, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i26607 = getelementptr %"struct.std::dcomplex"* %tmp.0.i26605, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i26608 = load double* %tmp.14.i26607 ; <double> [#uses=1]
- store double %tmp.15.i26608, double* %tmp.13.i26606
- %tmp.16.i26609 = getelementptr %"struct.std::dcomplex"* %mem_tmp.421, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i26610 = getelementptr %"struct.std::dcomplex"* %tmp.0.i26605, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i26611 = load double* %tmp.17.i26610 ; <double> [#uses=1]
- store double %tmp.18.i26611, double* %tmp.16.i26609
- %tmp.4.i26585 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i26584, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i26622, double* %tmp.4.i26585
- %tmp.7.i26588 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i26584, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i26625, double* %tmp.7.i26588
- %tmp.0.i26591 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i26584, %"struct.std::dcomplex"* %mem_tmp.421 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i26593 = getelementptr %"struct.std::dcomplex"* %tmp.0.i26591, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i26594 = load double* %tmp.14.i26593 ; <double> [#uses=1]
- %tmp.17.i26596 = getelementptr %"struct.std::dcomplex"* %tmp.0.i26591, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i26597 = load double* %tmp.17.i26596 ; <double> [#uses=1]
- %tmp.4.i26571 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i26570, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i26594, double* %tmp.4.i26571
- %tmp.7.i26574 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i26570, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i26597, double* %tmp.7.i26574
- %tmp.0.i26577 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i26570, %"struct.std::dcomplex"* %tmp.1075 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i26578 = getelementptr %"struct.std::dcomplex"* %mem_tmp.418, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i26579 = getelementptr %"struct.std::dcomplex"* %tmp.0.i26577, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i26580 = load double* %tmp.14.i26579 ; <double> [#uses=1]
- store double %tmp.15.i26580, double* %tmp.13.i26578
- %tmp.16.i26581 = getelementptr %"struct.std::dcomplex"* %mem_tmp.418, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i26582 = getelementptr %"struct.std::dcomplex"* %tmp.0.i26577, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i26583 = load double* %tmp.17.i26582 ; <double> [#uses=1]
- store double %tmp.18.i26583, double* %tmp.16.i26581
- %tmp.4.i26557 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i26556, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i26636, double* %tmp.4.i26557
- %tmp.7.i26560 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i26556, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i26639, double* %tmp.7.i26560
- %tmp.0.i26563 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i26556, %"struct.std::dcomplex"* %mem_tmp.418 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i26565 = getelementptr %"struct.std::dcomplex"* %tmp.0.i26563, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i26566 = load double* %tmp.14.i26565 ; <double> [#uses=1]
- %tmp.17.i26568 = getelementptr %"struct.std::dcomplex"* %tmp.0.i26563, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i26569 = load double* %tmp.17.i26568 ; <double> [#uses=1]
- %tmp.4.i26543 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i26542, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i26545 = load double* %tmp.5.i28602 ; <double> [#uses=1]
- store double %tmp.6.i26545, double* %tmp.4.i26543
- %tmp.7.i26546 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i26542, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i26548 = load double* %tmp.8.i28605 ; <double> [#uses=1]
- store double %tmp.9.i26548, double* %tmp.7.i26546
- %tmp.0.i26549 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i26542, %"struct.std::dcomplex"* %tmp.21 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i26551 = getelementptr %"struct.std::dcomplex"* %tmp.0.i26549, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i26552 = load double* %tmp.14.i26551 ; <double> [#uses=1]
- %tmp.17.i26554 = getelementptr %"struct.std::dcomplex"* %tmp.0.i26549, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i26555 = load double* %tmp.17.i26554 ; <double> [#uses=1]
- %tmp.4.i26529 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i26528, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i26531 = load double* %tmp.5.i34282 ; <double> [#uses=1]
- store double %tmp.6.i26531, double* %tmp.4.i26529
- %tmp.7.i26532 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i26528, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i26534 = load double* %tmp.8.i34285 ; <double> [#uses=1]
- store double %tmp.9.i26534, double* %tmp.7.i26532
- %tmp.0.i26535 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i26528, %"struct.std::dcomplex"* %tmp.1036 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i26536 = getelementptr %"struct.std::dcomplex"* %mem_tmp.425, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i26537 = getelementptr %"struct.std::dcomplex"* %tmp.0.i26535, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i26538 = load double* %tmp.14.i26537 ; <double> [#uses=1]
- store double %tmp.15.i26538, double* %tmp.13.i26536
- %tmp.16.i26539 = getelementptr %"struct.std::dcomplex"* %mem_tmp.425, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i26540 = getelementptr %"struct.std::dcomplex"* %tmp.0.i26535, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i26541 = load double* %tmp.17.i26540 ; <double> [#uses=1]
- store double %tmp.18.i26541, double* %tmp.16.i26539
- %tmp.4.i26515 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i26514, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i26552, double* %tmp.4.i26515
- %tmp.7.i26518 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i26514, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i26555, double* %tmp.7.i26518
- %tmp.0.i26521 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i26514, %"struct.std::dcomplex"* %mem_tmp.425 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i26523 = getelementptr %"struct.std::dcomplex"* %tmp.0.i26521, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i26524 = load double* %tmp.14.i26523 ; <double> [#uses=1]
- %tmp.17.i26526 = getelementptr %"struct.std::dcomplex"* %tmp.0.i26521, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i26527 = load double* %tmp.17.i26526 ; <double> [#uses=1]
- %tmp.4.i26501 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i26500, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i26524, double* %tmp.4.i26501
- %tmp.7.i26504 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i26500, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i26527, double* %tmp.7.i26504
- %tmp.0.i26507 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i26500, %"struct.std::dcomplex"* %tmp.45 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i26508 = getelementptr %"struct.std::dcomplex"* %mem_tmp.422, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i26509 = getelementptr %"struct.std::dcomplex"* %tmp.0.i26507, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i26510 = load double* %tmp.14.i26509 ; <double> [#uses=1]
- store double %tmp.15.i26510, double* %tmp.13.i26508
- %tmp.16.i26511 = getelementptr %"struct.std::dcomplex"* %mem_tmp.422, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i26512 = getelementptr %"struct.std::dcomplex"* %tmp.0.i26507, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i26513 = load double* %tmp.17.i26512 ; <double> [#uses=1]
- store double %tmp.18.i26513, double* %tmp.16.i26511
- %tmp.4.i26487 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i26486, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i26566, double* %tmp.4.i26487
- %tmp.7.i26490 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i26486, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i26569, double* %tmp.7.i26490
- %tmp.0.i26493 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i26486, %"struct.std::dcomplex"* %mem_tmp.422 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i26495 = getelementptr %"struct.std::dcomplex"* %tmp.0.i26493, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i26496 = load double* %tmp.14.i26495 ; <double> [#uses=1]
- %tmp.17.i26498 = getelementptr %"struct.std::dcomplex"* %tmp.0.i26493, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i26499 = load double* %tmp.17.i26498 ; <double> [#uses=1]
- store double %tmp.15.i26496, double* %tmp.2.i34364
- store double %tmp.18.i26499, double* %tmp.6.i34365
- %tmp.4.i26453 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i26452, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i26455 = load double* %tmp.5.i34136 ; <double> [#uses=1]
- store double %tmp.6.i26455, double* %tmp.4.i26453
- %tmp.7.i26456 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i26452, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i26458 = load double* %tmp.8.i34139 ; <double> [#uses=1]
- store double %tmp.9.i26458, double* %tmp.7.i26456
- %tmp.0.i26459 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i26452, %"struct.std::dcomplex"* %ret3 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i26461 = getelementptr %"struct.std::dcomplex"* %tmp.0.i26459, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i26462 = load double* %tmp.14.i26461 ; <double> [#uses=1]
- %tmp.17.i26464 = getelementptr %"struct.std::dcomplex"* %tmp.0.i26459, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i26465 = load double* %tmp.17.i26464 ; <double> [#uses=1]
- %tmp.7.i26419 = load double* %tmp.2.i34366 ; <double> [#uses=1]
- %tmp.15.i26433 = add double %tmp.7.i26419, %tmp.15.i26462 ; <double> [#uses=1]
- store double %tmp.15.i26433, double* %tmp.2.i34366
- %tmp.26.i26440 = load double* %tmp.6.i34367 ; <double> [#uses=1]
- %tmp.31.i26451 = add double %tmp.26.i26440, %tmp.18.i26465 ; <double> [#uses=1]
- store double %tmp.31.i26451, double* %tmp.6.i34367
- %tmp.4.i26399 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i26398, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i26401 = load double* %tmp.5.i33272 ; <double> [#uses=1]
- store double %tmp.6.i26401, double* %tmp.4.i26399
- %tmp.7.i26402 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i26398, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i26404 = load double* %tmp.8.i33275 ; <double> [#uses=1]
- store double %tmp.9.i26404, double* %tmp.7.i26402
- %tmp.0.i26405 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i26398, %"struct.std::dcomplex"* %ret4 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i26407 = getelementptr %"struct.std::dcomplex"* %tmp.0.i26405, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i26408 = load double* %tmp.14.i26407 ; <double> [#uses=1]
- %tmp.17.i26410 = getelementptr %"struct.std::dcomplex"* %tmp.0.i26405, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i26411 = load double* %tmp.17.i26410 ; <double> [#uses=1]
- %tmp.7.i26365 = load double* %tmp.2.i34368 ; <double> [#uses=1]
- %tmp.15.i26379 = add double %tmp.7.i26365, %tmp.15.i26408 ; <double> [#uses=1]
- store double %tmp.15.i26379, double* %tmp.2.i34368
- %tmp.26.i26386 = load double* %tmp.6.i34369 ; <double> [#uses=1]
- %tmp.31.i26397 = add double %tmp.26.i26386, %tmp.18.i26411 ; <double> [#uses=1]
- store double %tmp.31.i26397, double* %tmp.6.i34369
- store double 0.000000e+00, double* %tmp.2.i34366
- store double 0.000000e+00, double* %tmp.6.i34367
- %tmp.4.i26343 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i26342, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i26345 = load double* %tmp.5.i34282 ; <double> [#uses=1]
- store double %tmp.6.i26345, double* %tmp.4.i26343
- %tmp.7.i26346 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i26342, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i26348 = load double* %tmp.8.i34285 ; <double> [#uses=1]
- store double %tmp.9.i26348, double* %tmp.7.i26346
- %tmp.0.i26349 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i26342, %"struct.std::dcomplex"* %tmp.226 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i26351 = getelementptr %"struct.std::dcomplex"* %tmp.0.i26349, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i26352 = load double* %tmp.14.i26351 ; <double> [#uses=1]
- %tmp.17.i26354 = getelementptr %"struct.std::dcomplex"* %tmp.0.i26349, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i26355 = load double* %tmp.17.i26354 ; <double> [#uses=1]
- %tmp.4.i26329 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i26328, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i26331 = load double* %tmp.5.i33146 ; <double> [#uses=1]
- store double %tmp.6.i26331, double* %tmp.4.i26329
- %tmp.7.i26332 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i26328, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i26334 = load double* %tmp.8.i33149 ; <double> [#uses=1]
- store double %tmp.9.i26334, double* %tmp.7.i26332
- %tmp.0.i26335 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i26328, %"struct.std::dcomplex"* %tmp.21 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i26336 = getelementptr %"struct.std::dcomplex"* %mem_tmp.433, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i26337 = getelementptr %"struct.std::dcomplex"* %tmp.0.i26335, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i26338 = load double* %tmp.14.i26337 ; <double> [#uses=1]
- store double %tmp.15.i26338, double* %tmp.13.i26336
- %tmp.16.i26339 = getelementptr %"struct.std::dcomplex"* %mem_tmp.433, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i26340 = getelementptr %"struct.std::dcomplex"* %tmp.0.i26335, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i26341 = load double* %tmp.17.i26340 ; <double> [#uses=1]
- store double %tmp.18.i26341, double* %tmp.16.i26339
- %tmp.4.i26315 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i26314, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i26352, double* %tmp.4.i26315
- %tmp.7.i26318 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i26314, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i26355, double* %tmp.7.i26318
- %tmp.0.i26321 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i26314, %"struct.std::dcomplex"* %mem_tmp.433 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i26323 = getelementptr %"struct.std::dcomplex"* %tmp.0.i26321, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i26324 = load double* %tmp.14.i26323 ; <double> [#uses=1]
- %tmp.17.i26326 = getelementptr %"struct.std::dcomplex"* %tmp.0.i26321, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i26327 = load double* %tmp.17.i26326 ; <double> [#uses=1]
- %tmp.4.i26301 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i26300, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i26324, double* %tmp.4.i26301
- %tmp.7.i26304 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i26300, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i26327, double* %tmp.7.i26304
- %tmp.0.i26307 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i26300, %"struct.std::dcomplex"* %tmp.45 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i26309 = getelementptr %"struct.std::dcomplex"* %tmp.0.i26307, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i26310 = load double* %tmp.14.i26309 ; <double> [#uses=1]
- %tmp.17.i26312 = getelementptr %"struct.std::dcomplex"* %tmp.0.i26307, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i26313 = load double* %tmp.17.i26312 ; <double> [#uses=1]
- %tmp.4.i26287 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i26286, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i26289 = load double* %tmp.5.i33146 ; <double> [#uses=1]
- store double %tmp.6.i26289, double* %tmp.4.i26287
- %tmp.7.i26290 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i26286, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i26292 = load double* %tmp.8.i33149 ; <double> [#uses=1]
- store double %tmp.9.i26292, double* %tmp.7.i26290
- %tmp.0.i26293 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i26286, %"struct.std::dcomplex"* %tmp.6 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i26295 = getelementptr %"struct.std::dcomplex"* %tmp.0.i26293, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i26296 = load double* %tmp.14.i26295 ; <double> [#uses=1]
- %tmp.17.i26298 = getelementptr %"struct.std::dcomplex"* %tmp.0.i26293, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i26299 = load double* %tmp.17.i26298 ; <double> [#uses=1]
- %tmp.4.i26273 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i26272, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i26275 = load double* %tmp.5.i34338 ; <double> [#uses=1]
- store double %tmp.6.i26275, double* %tmp.4.i26273
- %tmp.7.i26276 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i26272, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i26278 = load double* %tmp.8.i34341 ; <double> [#uses=1]
- store double %tmp.9.i26278, double* %tmp.7.i26276
- %tmp.0.i26279 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i26272, %"struct.std::dcomplex"* %tmp.226 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i26280 = getelementptr %"struct.std::dcomplex"* %mem_tmp.437, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i26281 = getelementptr %"struct.std::dcomplex"* %tmp.0.i26279, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i26282 = load double* %tmp.14.i26281 ; <double> [#uses=1]
- store double %tmp.15.i26282, double* %tmp.13.i26280
- %tmp.16.i26283 = getelementptr %"struct.std::dcomplex"* %mem_tmp.437, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i26284 = getelementptr %"struct.std::dcomplex"* %tmp.0.i26279, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i26285 = load double* %tmp.17.i26284 ; <double> [#uses=1]
- store double %tmp.18.i26285, double* %tmp.16.i26283
- %tmp.4.i26259 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i26258, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i26296, double* %tmp.4.i26259
- %tmp.7.i26262 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i26258, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i26299, double* %tmp.7.i26262
- %tmp.0.i26265 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i26258, %"struct.std::dcomplex"* %mem_tmp.437 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i26267 = getelementptr %"struct.std::dcomplex"* %tmp.0.i26265, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i26268 = load double* %tmp.14.i26267 ; <double> [#uses=1]
- %tmp.17.i26270 = getelementptr %"struct.std::dcomplex"* %tmp.0.i26265, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i26271 = load double* %tmp.17.i26270 ; <double> [#uses=1]
- %tmp.4.i26245 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i26244, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i26268, double* %tmp.4.i26245
- %tmp.7.i26248 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i26244, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i26271, double* %tmp.7.i26248
- %tmp.0.i26251 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i26244, %"struct.std::dcomplex"* %tmp.15 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i26252 = getelementptr %"struct.std::dcomplex"* %mem_tmp.434, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i26253 = getelementptr %"struct.std::dcomplex"* %tmp.0.i26251, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i26254 = load double* %tmp.14.i26253 ; <double> [#uses=1]
- store double %tmp.15.i26254, double* %tmp.13.i26252
- %tmp.16.i26255 = getelementptr %"struct.std::dcomplex"* %mem_tmp.434, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i26256 = getelementptr %"struct.std::dcomplex"* %tmp.0.i26251, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i26257 = load double* %tmp.17.i26256 ; <double> [#uses=1]
- store double %tmp.18.i26257, double* %tmp.16.i26255
- %tmp.4.i26231 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i26230, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i26310, double* %tmp.4.i26231
- %tmp.7.i26234 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i26230, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i26313, double* %tmp.7.i26234
- %tmp.0.i26237 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i26230, %"struct.std::dcomplex"* %mem_tmp.434 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i26239 = getelementptr %"struct.std::dcomplex"* %tmp.0.i26237, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i26240 = load double* %tmp.14.i26239 ; <double> [#uses=1]
- %tmp.17.i26242 = getelementptr %"struct.std::dcomplex"* %tmp.0.i26237, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i26243 = load double* %tmp.17.i26242 ; <double> [#uses=1]
- %tmp.4.i26217 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i26216, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i26219 = load double* %tmp.5.i34338 ; <double> [#uses=1]
- store double %tmp.6.i26219, double* %tmp.4.i26217
- %tmp.7.i26220 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i26216, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i26222 = load double* %tmp.8.i34341 ; <double> [#uses=1]
- store double %tmp.9.i26222, double* %tmp.7.i26220
- %tmp.0.i26223 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i26216, %"struct.std::dcomplex"* %tmp.21 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i26225 = getelementptr %"struct.std::dcomplex"* %tmp.0.i26223, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i26226 = load double* %tmp.14.i26225 ; <double> [#uses=1]
- %tmp.17.i26228 = getelementptr %"struct.std::dcomplex"* %tmp.0.i26223, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i26229 = load double* %tmp.17.i26228 ; <double> [#uses=1]
- %tmp.4.i26203 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i26202, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i26205 = load double* %tmp.5.i34282 ; <double> [#uses=1]
- store double %tmp.6.i26205, double* %tmp.4.i26203
- %tmp.7.i26206 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i26202, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i26208 = load double* %tmp.8.i34285 ; <double> [#uses=1]
- store double %tmp.9.i26208, double* %tmp.7.i26206
- %tmp.0.i26209 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i26202, %"struct.std::dcomplex"* %tmp.6 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i26210 = getelementptr %"struct.std::dcomplex"* %mem_tmp.441, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i26211 = getelementptr %"struct.std::dcomplex"* %tmp.0.i26209, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i26212 = load double* %tmp.14.i26211 ; <double> [#uses=1]
- store double %tmp.15.i26212, double* %tmp.13.i26210
- %tmp.16.i26213 = getelementptr %"struct.std::dcomplex"* %mem_tmp.441, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i26214 = getelementptr %"struct.std::dcomplex"* %tmp.0.i26209, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i26215 = load double* %tmp.17.i26214 ; <double> [#uses=1]
- store double %tmp.18.i26215, double* %tmp.16.i26213
- %tmp.4.i26189 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i26188, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i26226, double* %tmp.4.i26189
- %tmp.7.i26192 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i26188, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i26229, double* %tmp.7.i26192
- %tmp.0.i26195 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i26188, %"struct.std::dcomplex"* %mem_tmp.441 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i26197 = getelementptr %"struct.std::dcomplex"* %tmp.0.i26195, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i26198 = load double* %tmp.14.i26197 ; <double> [#uses=1]
- %tmp.17.i26200 = getelementptr %"struct.std::dcomplex"* %tmp.0.i26195, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i26201 = load double* %tmp.17.i26200 ; <double> [#uses=1]
- %tmp.4.i26175 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i26174, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i26198, double* %tmp.4.i26175
- %tmp.7.i26178 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i26174, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i26201, double* %tmp.7.i26178
- %tmp.0.i26181 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i26174, %"struct.std::dcomplex"* %tmp.220 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i26182 = getelementptr %"struct.std::dcomplex"* %mem_tmp.438, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i26183 = getelementptr %"struct.std::dcomplex"* %tmp.0.i26181, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i26184 = load double* %tmp.14.i26183 ; <double> [#uses=1]
- store double %tmp.15.i26184, double* %tmp.13.i26182
- %tmp.16.i26185 = getelementptr %"struct.std::dcomplex"* %mem_tmp.438, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i26186 = getelementptr %"struct.std::dcomplex"* %tmp.0.i26181, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i26187 = load double* %tmp.17.i26186 ; <double> [#uses=1]
- store double %tmp.18.i26187, double* %tmp.16.i26185
- %tmp.4.i26161 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i26160, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i26240, double* %tmp.4.i26161
- %tmp.7.i26164 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i26160, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i26243, double* %tmp.7.i26164
- %tmp.0.i26167 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i26160, %"struct.std::dcomplex"* %mem_tmp.438 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i26169 = getelementptr %"struct.std::dcomplex"* %tmp.0.i26167, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i26170 = load double* %tmp.14.i26169 ; <double> [#uses=1]
- %tmp.17.i26172 = getelementptr %"struct.std::dcomplex"* %tmp.0.i26167, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i26173 = load double* %tmp.17.i26172 ; <double> [#uses=1]
- store double %tmp.15.i26170, double* %tmp.2.i34364
- store double %tmp.18.i26173, double* %tmp.6.i34365
- %tmp.4.i26127 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i26126, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i26129 = load double* %tmp.5.i34136 ; <double> [#uses=1]
- store double %tmp.6.i26129, double* %tmp.4.i26127
- %tmp.7.i26130 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i26126, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i26132 = load double* %tmp.8.i34139 ; <double> [#uses=1]
- store double %tmp.9.i26132, double* %tmp.7.i26130
- %tmp.0.i26133 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i26126, %"struct.std::dcomplex"* %ret3 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i26135 = getelementptr %"struct.std::dcomplex"* %tmp.0.i26133, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i26136 = load double* %tmp.14.i26135 ; <double> [#uses=1]
- %tmp.17.i26138 = getelementptr %"struct.std::dcomplex"* %tmp.0.i26133, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i26139 = load double* %tmp.17.i26138 ; <double> [#uses=1]
- %tmp.7.i26093 = load double* %tmp.2.i34366 ; <double> [#uses=1]
- %tmp.15.i26107 = add double %tmp.7.i26093, %tmp.15.i26136 ; <double> [#uses=1]
- store double %tmp.15.i26107, double* %tmp.2.i34366
- %tmp.26.i26114 = load double* %tmp.6.i34367 ; <double> [#uses=1]
- %tmp.31.i26125 = add double %tmp.26.i26114, %tmp.18.i26139 ; <double> [#uses=1]
- store double %tmp.31.i26125, double* %tmp.6.i34367
- %tmp.4.i26073 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i26072, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i26075 = load double* %tmp.5.i34282 ; <double> [#uses=1]
- store double %tmp.6.i26075, double* %tmp.4.i26073
- %tmp.7.i26076 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i26072, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i26078 = load double* %tmp.8.i34285 ; <double> [#uses=1]
- store double %tmp.9.i26078, double* %tmp.7.i26076
- %tmp.0.i26079 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i26072, %"struct.std::dcomplex"* %tmp.6 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i26081 = getelementptr %"struct.std::dcomplex"* %tmp.0.i26079, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i26082 = load double* %tmp.14.i26081 ; <double> [#uses=1]
- %tmp.17.i26084 = getelementptr %"struct.std::dcomplex"* %tmp.0.i26079, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i26085 = load double* %tmp.17.i26084 ; <double> [#uses=1]
- %tmp.4.i26059 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i26058, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i26061 = load double* %tmp.5.i34338 ; <double> [#uses=1]
- store double %tmp.6.i26061, double* %tmp.4.i26059
- %tmp.7.i26062 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i26058, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i26064 = load double* %tmp.8.i34341 ; <double> [#uses=1]
- store double %tmp.9.i26064, double* %tmp.7.i26062
- %tmp.0.i26065 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i26058, %"struct.std::dcomplex"* %tmp.21 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i26066 = getelementptr %"struct.std::dcomplex"* %mem_tmp.448, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i26067 = getelementptr %"struct.std::dcomplex"* %tmp.0.i26065, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i26068 = load double* %tmp.14.i26067 ; <double> [#uses=1]
- store double %tmp.15.i26068, double* %tmp.13.i26066
- %tmp.16.i26069 = getelementptr %"struct.std::dcomplex"* %mem_tmp.448, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i26070 = getelementptr %"struct.std::dcomplex"* %tmp.0.i26065, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i26071 = load double* %tmp.17.i26070 ; <double> [#uses=1]
- store double %tmp.18.i26071, double* %tmp.16.i26069
- %tmp.4.i26045 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i26044, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i26082, double* %tmp.4.i26045
- %tmp.7.i26048 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i26044, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i26085, double* %tmp.7.i26048
- %tmp.0.i26051 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i26044, %"struct.std::dcomplex"* %mem_tmp.448 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i26053 = getelementptr %"struct.std::dcomplex"* %tmp.0.i26051, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i26054 = load double* %tmp.14.i26053 ; <double> [#uses=1]
- %tmp.17.i26056 = getelementptr %"struct.std::dcomplex"* %tmp.0.i26051, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i26057 = load double* %tmp.17.i26056 ; <double> [#uses=1]
- %tmp.4.i26031 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i26030, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i26054, double* %tmp.4.i26031
- %tmp.7.i26034 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i26030, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i26057, double* %tmp.7.i26034
- %tmp.0.i26037 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i26030, %"struct.std::dcomplex"* %tmp.95 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i26039 = getelementptr %"struct.std::dcomplex"* %tmp.0.i26037, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i26040 = load double* %tmp.14.i26039 ; <double> [#uses=1]
- %tmp.17.i26042 = getelementptr %"struct.std::dcomplex"* %tmp.0.i26037, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i26043 = load double* %tmp.17.i26042 ; <double> [#uses=1]
- %tmp.4.i26017 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i26016, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i26019 = load double* %tmp.5.i34082 ; <double> [#uses=1]
- store double %tmp.6.i26019, double* %tmp.4.i26017
- %tmp.7.i26020 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i26016, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i26022 = load double* %tmp.8.i34085 ; <double> [#uses=1]
- store double %tmp.9.i26022, double* %tmp.7.i26020
- %tmp.0.i26023 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i26016, %"struct.std::dcomplex"* %tmp.21 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i26025 = getelementptr %"struct.std::dcomplex"* %tmp.0.i26023, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i26026 = load double* %tmp.14.i26025 ; <double> [#uses=1]
- %tmp.17.i26028 = getelementptr %"struct.std::dcomplex"* %tmp.0.i26023, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i26029 = load double* %tmp.17.i26028 ; <double> [#uses=1]
- %tmp.4.i26003 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i26002, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i26005 = load double* %tmp.5.i34282 ; <double> [#uses=1]
- store double %tmp.6.i26005, double* %tmp.4.i26003
- %tmp.7.i26006 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i26002, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i26008 = load double* %tmp.8.i34285 ; <double> [#uses=1]
- store double %tmp.9.i26008, double* %tmp.7.i26006
- %tmp.0.i26009 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i26002, %"struct.std::dcomplex"* %tmp.62 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i26010 = getelementptr %"struct.std::dcomplex"* %mem_tmp.452, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i26011 = getelementptr %"struct.std::dcomplex"* %tmp.0.i26009, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i26012 = load double* %tmp.14.i26011 ; <double> [#uses=1]
- store double %tmp.15.i26012, double* %tmp.13.i26010
- %tmp.16.i26013 = getelementptr %"struct.std::dcomplex"* %mem_tmp.452, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i26014 = getelementptr %"struct.std::dcomplex"* %tmp.0.i26009, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i26015 = load double* %tmp.17.i26014 ; <double> [#uses=1]
- store double %tmp.18.i26015, double* %tmp.16.i26013
- %tmp.4.i25989 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i25988, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i26026, double* %tmp.4.i25989
- %tmp.7.i25992 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i25988, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i26029, double* %tmp.7.i25992
- %tmp.0.i25995 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i25988, %"struct.std::dcomplex"* %mem_tmp.452 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i25997 = getelementptr %"struct.std::dcomplex"* %tmp.0.i25995, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i25998 = load double* %tmp.14.i25997 ; <double> [#uses=1]
- %tmp.17.i26000 = getelementptr %"struct.std::dcomplex"* %tmp.0.i25995, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i26001 = load double* %tmp.17.i26000 ; <double> [#uses=1]
- %tmp.4.i25975 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i25974, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i25998, double* %tmp.4.i25975
- %tmp.7.i25978 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i25974, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i26001, double* %tmp.7.i25978
- %tmp.0.i25981 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i25974, %"struct.std::dcomplex"* %tmp.45 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i25982 = getelementptr %"struct.std::dcomplex"* %mem_tmp.449, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i25983 = getelementptr %"struct.std::dcomplex"* %tmp.0.i25981, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i25984 = load double* %tmp.14.i25983 ; <double> [#uses=1]
- store double %tmp.15.i25984, double* %tmp.13.i25982
- %tmp.16.i25985 = getelementptr %"struct.std::dcomplex"* %mem_tmp.449, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i25986 = getelementptr %"struct.std::dcomplex"* %tmp.0.i25981, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i25987 = load double* %tmp.17.i25986 ; <double> [#uses=1]
- store double %tmp.18.i25987, double* %tmp.16.i25985
- %tmp.4.i25961 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i25960, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i26040, double* %tmp.4.i25961
- %tmp.7.i25964 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i25960, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i26043, double* %tmp.7.i25964
- %tmp.0.i25967 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i25960, %"struct.std::dcomplex"* %mem_tmp.449 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i25969 = getelementptr %"struct.std::dcomplex"* %tmp.0.i25967, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i25970 = load double* %tmp.14.i25969 ; <double> [#uses=1]
- %tmp.17.i25972 = getelementptr %"struct.std::dcomplex"* %tmp.0.i25967, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i25973 = load double* %tmp.17.i25972 ; <double> [#uses=1]
- %tmp.4.i25947 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i25946, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i25949 = load double* %tmp.5.i34338 ; <double> [#uses=1]
- store double %tmp.6.i25949, double* %tmp.4.i25947
- %tmp.7.i25950 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i25946, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i25952 = load double* %tmp.8.i34341 ; <double> [#uses=1]
- store double %tmp.9.i25952, double* %tmp.7.i25950
- %tmp.0.i25953 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i25946, %"struct.std::dcomplex"* %tmp.62 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i25955 = getelementptr %"struct.std::dcomplex"* %tmp.0.i25953, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i25956 = load double* %tmp.14.i25955 ; <double> [#uses=1]
- %tmp.17.i25958 = getelementptr %"struct.std::dcomplex"* %tmp.0.i25953, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i25959 = load double* %tmp.17.i25958 ; <double> [#uses=1]
- %tmp.4.i25933 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i25932, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i25935 = load double* %tmp.5.i34082 ; <double> [#uses=1]
- store double %tmp.6.i25935, double* %tmp.4.i25933
- %tmp.7.i25936 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i25932, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i25938 = load double* %tmp.8.i34085 ; <double> [#uses=1]
- store double %tmp.9.i25938, double* %tmp.7.i25936
- %tmp.0.i25939 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i25932, %"struct.std::dcomplex"* %tmp.6 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i25940 = getelementptr %"struct.std::dcomplex"* %mem_tmp.456, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i25941 = getelementptr %"struct.std::dcomplex"* %tmp.0.i25939, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i25942 = load double* %tmp.14.i25941 ; <double> [#uses=1]
- store double %tmp.15.i25942, double* %tmp.13.i25940
- %tmp.16.i25943 = getelementptr %"struct.std::dcomplex"* %mem_tmp.456, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i25944 = getelementptr %"struct.std::dcomplex"* %tmp.0.i25939, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i25945 = load double* %tmp.17.i25944 ; <double> [#uses=1]
- store double %tmp.18.i25945, double* %tmp.16.i25943
- %tmp.4.i25919 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i25918, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i25956, double* %tmp.4.i25919
- %tmp.7.i25922 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i25918, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i25959, double* %tmp.7.i25922
- %tmp.0.i25925 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i25918, %"struct.std::dcomplex"* %mem_tmp.456 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i25927 = getelementptr %"struct.std::dcomplex"* %tmp.0.i25925, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i25928 = load double* %tmp.14.i25927 ; <double> [#uses=1]
- %tmp.17.i25930 = getelementptr %"struct.std::dcomplex"* %tmp.0.i25925, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i25931 = load double* %tmp.17.i25930 ; <double> [#uses=1]
- %tmp.4.i25905 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i25904, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i25928, double* %tmp.4.i25905
- %tmp.7.i25908 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i25904, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i25931, double* %tmp.7.i25908
- %tmp.0.i25911 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i25904, %"struct.std::dcomplex"* %tmp.15 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i25912 = getelementptr %"struct.std::dcomplex"* %mem_tmp.453, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i25913 = getelementptr %"struct.std::dcomplex"* %tmp.0.i25911, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i25914 = load double* %tmp.14.i25913 ; <double> [#uses=1]
- store double %tmp.15.i25914, double* %tmp.13.i25912
- %tmp.16.i25915 = getelementptr %"struct.std::dcomplex"* %mem_tmp.453, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i25916 = getelementptr %"struct.std::dcomplex"* %tmp.0.i25911, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i25917 = load double* %tmp.17.i25916 ; <double> [#uses=1]
- store double %tmp.18.i25917, double* %tmp.16.i25915
- %tmp.4.i25891 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i25890, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i25970, double* %tmp.4.i25891
- %tmp.7.i25894 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i25890, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i25973, double* %tmp.7.i25894
- %tmp.0.i25897 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i25890, %"struct.std::dcomplex"* %mem_tmp.453 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i25899 = getelementptr %"struct.std::dcomplex"* %tmp.0.i25897, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i25900 = load double* %tmp.14.i25899 ; <double> [#uses=1]
- %tmp.17.i25902 = getelementptr %"struct.std::dcomplex"* %tmp.0.i25897, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i25903 = load double* %tmp.17.i25902 ; <double> [#uses=1]
- store double %tmp.15.i25900, double* %tmp.2.i34364
- store double %tmp.18.i25903, double* %tmp.6.i34365
- %tmp.4.i25857 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i25856, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i25859 = load double* %tmp.5.i32460 ; <double> [#uses=1]
- store double %tmp.6.i25859, double* %tmp.4.i25857
- %tmp.7.i25860 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i25856, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i25862 = load double* %tmp.8.i32463 ; <double> [#uses=1]
- store double %tmp.9.i25862, double* %tmp.7.i25860
- %tmp.0.i25863 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i25856, %"struct.std::dcomplex"* %ret3 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i25865 = getelementptr %"struct.std::dcomplex"* %tmp.0.i25863, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i25866 = load double* %tmp.14.i25865 ; <double> [#uses=1]
- %tmp.17.i25868 = getelementptr %"struct.std::dcomplex"* %tmp.0.i25863, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i25869 = load double* %tmp.17.i25868 ; <double> [#uses=1]
- %tmp.7.i25823 = load double* %tmp.2.i34366 ; <double> [#uses=1]
- %tmp.15.i25837 = add double %tmp.7.i25823, %tmp.15.i25866 ; <double> [#uses=1]
- store double %tmp.15.i25837, double* %tmp.2.i34366
- %tmp.26.i25844 = load double* %tmp.6.i34367 ; <double> [#uses=1]
- %tmp.31.i25855 = add double %tmp.26.i25844, %tmp.18.i25869 ; <double> [#uses=1]
- store double %tmp.31.i25855, double* %tmp.6.i34367
- %tmp.4.i25803 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i25802, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i25805 = load double* %tmp.5.i34082 ; <double> [#uses=1]
- store double %tmp.6.i25805, double* %tmp.4.i25803
- %tmp.7.i25806 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i25802, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i25808 = load double* %tmp.8.i34085 ; <double> [#uses=1]
- store double %tmp.9.i25808, double* %tmp.7.i25806
- %tmp.0.i25809 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i25802, %"struct.std::dcomplex"* %tmp.226 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i25811 = getelementptr %"struct.std::dcomplex"* %tmp.0.i25809, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i25812 = load double* %tmp.14.i25811 ; <double> [#uses=1]
- %tmp.17.i25814 = getelementptr %"struct.std::dcomplex"* %tmp.0.i25809, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i25815 = load double* %tmp.17.i25814 ; <double> [#uses=1]
- %tmp.4.i25789 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i25788, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i25791 = load double* %tmp.5.i33146 ; <double> [#uses=1]
- store double %tmp.6.i25791, double* %tmp.4.i25789
- %tmp.7.i25792 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i25788, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i25794 = load double* %tmp.8.i33149 ; <double> [#uses=1]
- store double %tmp.9.i25794, double* %tmp.7.i25792
- %tmp.0.i25795 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i25788, %"struct.std::dcomplex"* %tmp.62 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i25796 = getelementptr %"struct.std::dcomplex"* %mem_tmp.463, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i25797 = getelementptr %"struct.std::dcomplex"* %tmp.0.i25795, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i25798 = load double* %tmp.14.i25797 ; <double> [#uses=1]
- store double %tmp.15.i25798, double* %tmp.13.i25796
- %tmp.16.i25799 = getelementptr %"struct.std::dcomplex"* %mem_tmp.463, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i25800 = getelementptr %"struct.std::dcomplex"* %tmp.0.i25795, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i25801 = load double* %tmp.17.i25800 ; <double> [#uses=1]
- store double %tmp.18.i25801, double* %tmp.16.i25799
- %tmp.4.i25775 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i25774, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i25812, double* %tmp.4.i25775
- %tmp.7.i25778 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i25774, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i25815, double* %tmp.7.i25778
- %tmp.0.i25781 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i25774, %"struct.std::dcomplex"* %mem_tmp.463 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i25783 = getelementptr %"struct.std::dcomplex"* %tmp.0.i25781, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i25784 = load double* %tmp.14.i25783 ; <double> [#uses=1]
- %tmp.17.i25786 = getelementptr %"struct.std::dcomplex"* %tmp.0.i25781, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i25787 = load double* %tmp.17.i25786 ; <double> [#uses=1]
- %tmp.4.i25761 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i25760, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i25784, double* %tmp.4.i25761
- %tmp.7.i25764 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i25760, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i25787, double* %tmp.7.i25764
- %tmp.0.i25767 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i25760, %"struct.std::dcomplex"* %tmp.15 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i25769 = getelementptr %"struct.std::dcomplex"* %tmp.0.i25767, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i25770 = load double* %tmp.14.i25769 ; <double> [#uses=1]
- %tmp.17.i25772 = getelementptr %"struct.std::dcomplex"* %tmp.0.i25767, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i25773 = load double* %tmp.17.i25772 ; <double> [#uses=1]
- %tmp.4.i25747 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i25746, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i25749 = load double* %tmp.5.i33146 ; <double> [#uses=1]
- store double %tmp.6.i25749, double* %tmp.4.i25747
- %tmp.7.i25750 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i25746, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i25752 = load double* %tmp.8.i33149 ; <double> [#uses=1]
- store double %tmp.9.i25752, double* %tmp.7.i25750
- %tmp.0.i25753 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i25746, %"struct.std::dcomplex"* %tmp.21 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i25755 = getelementptr %"struct.std::dcomplex"* %tmp.0.i25753, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i25756 = load double* %tmp.14.i25755 ; <double> [#uses=1]
- %tmp.17.i25758 = getelementptr %"struct.std::dcomplex"* %tmp.0.i25753, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i25759 = load double* %tmp.17.i25758 ; <double> [#uses=1]
- %tmp.4.i25733 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i25732, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i25735 = load double* %tmp.5.i34282 ; <double> [#uses=1]
- store double %tmp.6.i25735, double* %tmp.4.i25733
- %tmp.7.i25736 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i25732, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i25738 = load double* %tmp.8.i34285 ; <double> [#uses=1]
- store double %tmp.9.i25738, double* %tmp.7.i25736
- %tmp.0.i25739 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i25732, %"struct.std::dcomplex"* %tmp.226 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i25740 = getelementptr %"struct.std::dcomplex"* %mem_tmp.467, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i25741 = getelementptr %"struct.std::dcomplex"* %tmp.0.i25739, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i25742 = load double* %tmp.14.i25741 ; <double> [#uses=1]
- store double %tmp.15.i25742, double* %tmp.13.i25740
- %tmp.16.i25743 = getelementptr %"struct.std::dcomplex"* %mem_tmp.467, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i25744 = getelementptr %"struct.std::dcomplex"* %tmp.0.i25739, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i25745 = load double* %tmp.17.i25744 ; <double> [#uses=1]
- store double %tmp.18.i25745, double* %tmp.16.i25743
- %tmp.4.i25719 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i25718, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i25756, double* %tmp.4.i25719
- %tmp.7.i25722 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i25718, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i25759, double* %tmp.7.i25722
- %tmp.0.i25725 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i25718, %"struct.std::dcomplex"* %mem_tmp.467 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i25727 = getelementptr %"struct.std::dcomplex"* %tmp.0.i25725, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i25728 = load double* %tmp.14.i25727 ; <double> [#uses=1]
- %tmp.17.i25730 = getelementptr %"struct.std::dcomplex"* %tmp.0.i25725, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i25731 = load double* %tmp.17.i25730 ; <double> [#uses=1]
- %tmp.4.i25705 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i25704, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i25728, double* %tmp.4.i25705
- %tmp.7.i25708 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i25704, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i25731, double* %tmp.7.i25708
- %tmp.0.i25711 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i25704, %"struct.std::dcomplex"* %tmp.95 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i25712 = getelementptr %"struct.std::dcomplex"* %mem_tmp.464, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i25713 = getelementptr %"struct.std::dcomplex"* %tmp.0.i25711, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i25714 = load double* %tmp.14.i25713 ; <double> [#uses=1]
- store double %tmp.15.i25714, double* %tmp.13.i25712
- %tmp.16.i25715 = getelementptr %"struct.std::dcomplex"* %mem_tmp.464, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i25716 = getelementptr %"struct.std::dcomplex"* %tmp.0.i25711, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i25717 = load double* %tmp.17.i25716 ; <double> [#uses=1]
- store double %tmp.18.i25717, double* %tmp.16.i25715
- %tmp.4.i25691 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i25690, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i25770, double* %tmp.4.i25691
- %tmp.7.i25694 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i25690, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i25773, double* %tmp.7.i25694
- %tmp.0.i25697 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i25690, %"struct.std::dcomplex"* %mem_tmp.464 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i25699 = getelementptr %"struct.std::dcomplex"* %tmp.0.i25697, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i25700 = load double* %tmp.14.i25699 ; <double> [#uses=1]
- %tmp.17.i25702 = getelementptr %"struct.std::dcomplex"* %tmp.0.i25697, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i25703 = load double* %tmp.17.i25702 ; <double> [#uses=1]
- %tmp.4.i25677 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i25676, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i25679 = load double* %tmp.5.i34282 ; <double> [#uses=1]
- store double %tmp.6.i25679, double* %tmp.4.i25677
- %tmp.7.i25680 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i25676, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i25682 = load double* %tmp.8.i34285 ; <double> [#uses=1]
- store double %tmp.9.i25682, double* %tmp.7.i25680
- %tmp.0.i25683 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i25676, %"struct.std::dcomplex"* %tmp.62 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i25685 = getelementptr %"struct.std::dcomplex"* %tmp.0.i25683, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i25686 = load double* %tmp.14.i25685 ; <double> [#uses=1]
- %tmp.17.i25688 = getelementptr %"struct.std::dcomplex"* %tmp.0.i25683, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i25689 = load double* %tmp.17.i25688 ; <double> [#uses=1]
- %tmp.4.i25663 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i25662, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i25665 = load double* %tmp.5.i34082 ; <double> [#uses=1]
- store double %tmp.6.i25665, double* %tmp.4.i25663
- %tmp.7.i25666 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i25662, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i25668 = load double* %tmp.8.i34085 ; <double> [#uses=1]
- store double %tmp.9.i25668, double* %tmp.7.i25666
- %tmp.0.i25669 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i25662, %"struct.std::dcomplex"* %tmp.21 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i25670 = getelementptr %"struct.std::dcomplex"* %mem_tmp.471, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i25671 = getelementptr %"struct.std::dcomplex"* %tmp.0.i25669, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i25672 = load double* %tmp.14.i25671 ; <double> [#uses=1]
- store double %tmp.15.i25672, double* %tmp.13.i25670
- %tmp.16.i25673 = getelementptr %"struct.std::dcomplex"* %mem_tmp.471, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i25674 = getelementptr %"struct.std::dcomplex"* %tmp.0.i25669, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i25675 = load double* %tmp.17.i25674 ; <double> [#uses=1]
- store double %tmp.18.i25675, double* %tmp.16.i25673
- %tmp.4.i25649 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i25648, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i25686, double* %tmp.4.i25649
- %tmp.7.i25652 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i25648, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i25689, double* %tmp.7.i25652
- %tmp.0.i25655 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i25648, %"struct.std::dcomplex"* %mem_tmp.471 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i25657 = getelementptr %"struct.std::dcomplex"* %tmp.0.i25655, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i25658 = load double* %tmp.14.i25657 ; <double> [#uses=1]
- %tmp.17.i25660 = getelementptr %"struct.std::dcomplex"* %tmp.0.i25655, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i25661 = load double* %tmp.17.i25660 ; <double> [#uses=1]
- %tmp.4.i25635 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i25634, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i25658, double* %tmp.4.i25635
- %tmp.7.i25638 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i25634, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i25661, double* %tmp.7.i25638
- %tmp.0.i25641 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i25634, %"struct.std::dcomplex"* %tmp.220 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i25642 = getelementptr %"struct.std::dcomplex"* %mem_tmp.468, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i25643 = getelementptr %"struct.std::dcomplex"* %tmp.0.i25641, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i25644 = load double* %tmp.14.i25643 ; <double> [#uses=1]
- store double %tmp.15.i25644, double* %tmp.13.i25642
- %tmp.16.i25645 = getelementptr %"struct.std::dcomplex"* %mem_tmp.468, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i25646 = getelementptr %"struct.std::dcomplex"* %tmp.0.i25641, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i25647 = load double* %tmp.17.i25646 ; <double> [#uses=1]
- store double %tmp.18.i25647, double* %tmp.16.i25645
- %tmp.4.i25621 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i25620, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i25700, double* %tmp.4.i25621
- %tmp.7.i25624 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i25620, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i25703, double* %tmp.7.i25624
- %tmp.0.i25627 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i25620, %"struct.std::dcomplex"* %mem_tmp.468 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i25629 = getelementptr %"struct.std::dcomplex"* %tmp.0.i25627, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i25630 = load double* %tmp.14.i25629 ; <double> [#uses=1]
- %tmp.17.i25632 = getelementptr %"struct.std::dcomplex"* %tmp.0.i25627, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i25633 = load double* %tmp.17.i25632 ; <double> [#uses=1]
- store double %tmp.15.i25630, double* %tmp.2.i34364
- store double %tmp.18.i25633, double* %tmp.6.i34365
- %tmp.4.i25587 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i25586, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i25589 = load double* %tmp.5.i33596 ; <double> [#uses=1]
- store double %tmp.6.i25589, double* %tmp.4.i25587
- %tmp.7.i25590 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i25586, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i25592 = load double* %tmp.8.i33599 ; <double> [#uses=1]
- store double %tmp.9.i25592, double* %tmp.7.i25590
- %tmp.0.i25593 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i25586, %"struct.std::dcomplex"* %ret3 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i25595 = getelementptr %"struct.std::dcomplex"* %tmp.0.i25593, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i25596 = load double* %tmp.14.i25595 ; <double> [#uses=1]
- %tmp.17.i25598 = getelementptr %"struct.std::dcomplex"* %tmp.0.i25593, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i25599 = load double* %tmp.17.i25598 ; <double> [#uses=1]
- %tmp.7.i25553 = load double* %tmp.2.i34366 ; <double> [#uses=1]
- %tmp.15.i25567 = add double %tmp.7.i25553, %tmp.15.i25596 ; <double> [#uses=1]
- store double %tmp.15.i25567, double* %tmp.2.i34366
- %tmp.26.i25574 = load double* %tmp.6.i34367 ; <double> [#uses=1]
- %tmp.31.i25585 = add double %tmp.26.i25574, %tmp.18.i25599 ; <double> [#uses=1]
- store double %tmp.31.i25585, double* %tmp.6.i34367
- %tmp.4.i25533 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i25532, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i25535 = load double* %tmp.5.i34082 ; <double> [#uses=1]
- store double %tmp.6.i25535, double* %tmp.4.i25533
- %tmp.7.i25536 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i25532, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i25538 = load double* %tmp.8.i34085 ; <double> [#uses=1]
- store double %tmp.9.i25538, double* %tmp.7.i25536
- %tmp.0.i25539 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i25532, %"struct.std::dcomplex"* %tmp.6 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i25541 = getelementptr %"struct.std::dcomplex"* %tmp.0.i25539, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i25542 = load double* %tmp.14.i25541 ; <double> [#uses=1]
- %tmp.17.i25544 = getelementptr %"struct.std::dcomplex"* %tmp.0.i25539, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i25545 = load double* %tmp.17.i25544 ; <double> [#uses=1]
- %tmp.4.i25519 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i25518, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i25521 = load double* %tmp.5.i34338 ; <double> [#uses=1]
- store double %tmp.6.i25521, double* %tmp.4.i25519
- %tmp.7.i25522 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i25518, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i25524 = load double* %tmp.8.i34341 ; <double> [#uses=1]
- store double %tmp.9.i25524, double* %tmp.7.i25522
- %tmp.0.i25525 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i25518, %"struct.std::dcomplex"* %tmp.62 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i25526 = getelementptr %"struct.std::dcomplex"* %mem_tmp.478, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i25527 = getelementptr %"struct.std::dcomplex"* %tmp.0.i25525, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i25528 = load double* %tmp.14.i25527 ; <double> [#uses=1]
- store double %tmp.15.i25528, double* %tmp.13.i25526
- %tmp.16.i25529 = getelementptr %"struct.std::dcomplex"* %mem_tmp.478, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i25530 = getelementptr %"struct.std::dcomplex"* %tmp.0.i25525, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i25531 = load double* %tmp.17.i25530 ; <double> [#uses=1]
- store double %tmp.18.i25531, double* %tmp.16.i25529
- %tmp.4.i25505 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i25504, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i25542, double* %tmp.4.i25505
- %tmp.7.i25508 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i25504, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i25545, double* %tmp.7.i25508
- %tmp.0.i25511 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i25504, %"struct.std::dcomplex"* %mem_tmp.478 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i25513 = getelementptr %"struct.std::dcomplex"* %tmp.0.i25511, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i25514 = load double* %tmp.14.i25513 ; <double> [#uses=1]
- %tmp.17.i25516 = getelementptr %"struct.std::dcomplex"* %tmp.0.i25511, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i25517 = load double* %tmp.17.i25516 ; <double> [#uses=1]
- %tmp.4.i25491 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i25490, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i25514, double* %tmp.4.i25491
- %tmp.7.i25494 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i25490, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i25517, double* %tmp.7.i25494
- %tmp.0.i25497 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i25490, %"struct.std::dcomplex"* %tmp.220 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i25499 = getelementptr %"struct.std::dcomplex"* %tmp.0.i25497, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i25500 = load double* %tmp.14.i25499 ; <double> [#uses=1]
- %tmp.17.i25502 = getelementptr %"struct.std::dcomplex"* %tmp.0.i25497, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i25503 = load double* %tmp.17.i25502 ; <double> [#uses=1]
- %tmp.4.i25477 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i25476, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i25479 = load double* %tmp.5.i33146 ; <double> [#uses=1]
- store double %tmp.6.i25479, double* %tmp.4.i25477
- %tmp.7.i25480 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i25476, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i25482 = load double* %tmp.8.i33149 ; <double> [#uses=1]
- store double %tmp.9.i25482, double* %tmp.7.i25480
- %tmp.0.i25483 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i25476, %"struct.std::dcomplex"* %tmp.62 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i25485 = getelementptr %"struct.std::dcomplex"* %tmp.0.i25483, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i25486 = load double* %tmp.14.i25485 ; <double> [#uses=1]
- %tmp.17.i25488 = getelementptr %"struct.std::dcomplex"* %tmp.0.i25483, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i25489 = load double* %tmp.17.i25488 ; <double> [#uses=1]
- %tmp.4.i25463 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i25462, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i25465 = load double* %tmp.5.i34082 ; <double> [#uses=1]
- store double %tmp.6.i25465, double* %tmp.4.i25463
- %tmp.7.i25466 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i25462, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i25468 = load double* %tmp.8.i34085 ; <double> [#uses=1]
- store double %tmp.9.i25468, double* %tmp.7.i25466
- %tmp.0.i25469 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i25462, %"struct.std::dcomplex"* %tmp.226 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i25470 = getelementptr %"struct.std::dcomplex"* %mem_tmp.482, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i25471 = getelementptr %"struct.std::dcomplex"* %tmp.0.i25469, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i25472 = load double* %tmp.14.i25471 ; <double> [#uses=1]
- store double %tmp.15.i25472, double* %tmp.13.i25470
- %tmp.16.i25473 = getelementptr %"struct.std::dcomplex"* %mem_tmp.482, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i25474 = getelementptr %"struct.std::dcomplex"* %tmp.0.i25469, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i25475 = load double* %tmp.17.i25474 ; <double> [#uses=1]
- store double %tmp.18.i25475, double* %tmp.16.i25473
- %tmp.4.i25449 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i25448, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i25486, double* %tmp.4.i25449
- %tmp.7.i25452 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i25448, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i25489, double* %tmp.7.i25452
- %tmp.0.i25455 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i25448, %"struct.std::dcomplex"* %mem_tmp.482 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i25457 = getelementptr %"struct.std::dcomplex"* %tmp.0.i25455, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i25458 = load double* %tmp.14.i25457 ; <double> [#uses=1]
- %tmp.17.i25460 = getelementptr %"struct.std::dcomplex"* %tmp.0.i25455, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i25461 = load double* %tmp.17.i25460 ; <double> [#uses=1]
- %tmp.4.i25435 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i25434, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i25458, double* %tmp.4.i25435
- %tmp.7.i25438 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i25434, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i25461, double* %tmp.7.i25438
- %tmp.0.i25441 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i25434, %"struct.std::dcomplex"* %tmp.45 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i25442 = getelementptr %"struct.std::dcomplex"* %mem_tmp.479, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i25443 = getelementptr %"struct.std::dcomplex"* %tmp.0.i25441, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i25444 = load double* %tmp.14.i25443 ; <double> [#uses=1]
- store double %tmp.15.i25444, double* %tmp.13.i25442
- %tmp.16.i25445 = getelementptr %"struct.std::dcomplex"* %mem_tmp.479, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i25446 = getelementptr %"struct.std::dcomplex"* %tmp.0.i25441, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i25447 = load double* %tmp.17.i25446 ; <double> [#uses=1]
- store double %tmp.18.i25447, double* %tmp.16.i25445
- %tmp.4.i25421 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i25420, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i25500, double* %tmp.4.i25421
- %tmp.7.i25424 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i25420, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i25503, double* %tmp.7.i25424
- %tmp.0.i25427 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i25420, %"struct.std::dcomplex"* %mem_tmp.479 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i25429 = getelementptr %"struct.std::dcomplex"* %tmp.0.i25427, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i25430 = load double* %tmp.14.i25429 ; <double> [#uses=1]
- %tmp.17.i25432 = getelementptr %"struct.std::dcomplex"* %tmp.0.i25427, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i25433 = load double* %tmp.17.i25432 ; <double> [#uses=1]
- %tmp.4.i25407 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i25406, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i25409 = load double* %tmp.5.i34338 ; <double> [#uses=1]
- store double %tmp.6.i25409, double* %tmp.4.i25407
- %tmp.7.i25410 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i25406, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i25412 = load double* %tmp.8.i34341 ; <double> [#uses=1]
- store double %tmp.9.i25412, double* %tmp.7.i25410
- %tmp.0.i25413 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i25406, %"struct.std::dcomplex"* %tmp.226 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i25415 = getelementptr %"struct.std::dcomplex"* %tmp.0.i25413, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i25416 = load double* %tmp.14.i25415 ; <double> [#uses=1]
- %tmp.17.i25418 = getelementptr %"struct.std::dcomplex"* %tmp.0.i25413, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i25419 = load double* %tmp.17.i25418 ; <double> [#uses=1]
- %tmp.4.i25393 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i25392, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i25395 = load double* %tmp.5.i33146 ; <double> [#uses=1]
- store double %tmp.6.i25395, double* %tmp.4.i25393
- %tmp.7.i25396 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i25392, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i25398 = load double* %tmp.8.i33149 ; <double> [#uses=1]
- store double %tmp.9.i25398, double* %tmp.7.i25396
- %tmp.0.i25399 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i25392, %"struct.std::dcomplex"* %tmp.6 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i25400 = getelementptr %"struct.std::dcomplex"* %mem_tmp.486, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i25401 = getelementptr %"struct.std::dcomplex"* %tmp.0.i25399, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i25402 = load double* %tmp.14.i25401 ; <double> [#uses=1]
- store double %tmp.15.i25402, double* %tmp.13.i25400
- %tmp.16.i25403 = getelementptr %"struct.std::dcomplex"* %mem_tmp.486, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i25404 = getelementptr %"struct.std::dcomplex"* %tmp.0.i25399, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i25405 = load double* %tmp.17.i25404 ; <double> [#uses=1]
- store double %tmp.18.i25405, double* %tmp.16.i25403
- %tmp.4.i25379 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i25378, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i25416, double* %tmp.4.i25379
- %tmp.7.i25382 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i25378, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i25419, double* %tmp.7.i25382
- %tmp.0.i25385 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i25378, %"struct.std::dcomplex"* %mem_tmp.486 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i25387 = getelementptr %"struct.std::dcomplex"* %tmp.0.i25385, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i25388 = load double* %tmp.14.i25387 ; <double> [#uses=1]
- %tmp.17.i25390 = getelementptr %"struct.std::dcomplex"* %tmp.0.i25385, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i25391 = load double* %tmp.17.i25390 ; <double> [#uses=1]
- %tmp.4.i25365 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i25364, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i25388, double* %tmp.4.i25365
- %tmp.7.i25368 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i25364, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i25391, double* %tmp.7.i25368
- %tmp.0.i25371 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i25364, %"struct.std::dcomplex"* %tmp.95 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i25372 = getelementptr %"struct.std::dcomplex"* %mem_tmp.483, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i25373 = getelementptr %"struct.std::dcomplex"* %tmp.0.i25371, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i25374 = load double* %tmp.14.i25373 ; <double> [#uses=1]
- store double %tmp.15.i25374, double* %tmp.13.i25372
- %tmp.16.i25375 = getelementptr %"struct.std::dcomplex"* %mem_tmp.483, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i25376 = getelementptr %"struct.std::dcomplex"* %tmp.0.i25371, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i25377 = load double* %tmp.17.i25376 ; <double> [#uses=1]
- store double %tmp.18.i25377, double* %tmp.16.i25375
- %tmp.4.i25351 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i25350, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i25430, double* %tmp.4.i25351
- %tmp.7.i25354 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i25350, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i25433, double* %tmp.7.i25354
- %tmp.0.i25357 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i25350, %"struct.std::dcomplex"* %mem_tmp.483 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i25359 = getelementptr %"struct.std::dcomplex"* %tmp.0.i25357, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i25360 = load double* %tmp.14.i25359 ; <double> [#uses=1]
- %tmp.17.i25362 = getelementptr %"struct.std::dcomplex"* %tmp.0.i25357, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i25363 = load double* %tmp.17.i25362 ; <double> [#uses=1]
- store double %tmp.15.i25360, double* %tmp.2.i34364
- store double %tmp.18.i25363, double* %tmp.6.i34365
- %tmp.4.i25317 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i25316, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i25319 = load double* %tmp.5.i33326 ; <double> [#uses=1]
- store double %tmp.6.i25319, double* %tmp.4.i25317
- %tmp.7.i25320 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i25316, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i25322 = load double* %tmp.8.i33329 ; <double> [#uses=1]
- store double %tmp.9.i25322, double* %tmp.7.i25320
- %tmp.0.i25323 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i25316, %"struct.std::dcomplex"* %ret3 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i25325 = getelementptr %"struct.std::dcomplex"* %tmp.0.i25323, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i25326 = load double* %tmp.14.i25325 ; <double> [#uses=1]
- %tmp.17.i25328 = getelementptr %"struct.std::dcomplex"* %tmp.0.i25323, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i25329 = load double* %tmp.17.i25328 ; <double> [#uses=1]
- %tmp.7.i25283 = load double* %tmp.2.i34366 ; <double> [#uses=1]
- %tmp.15.i25297 = add double %tmp.7.i25283, %tmp.15.i25326 ; <double> [#uses=1]
- store double %tmp.15.i25297, double* %tmp.2.i34366
- %tmp.26.i25304 = load double* %tmp.6.i34367 ; <double> [#uses=1]
- %tmp.31.i25315 = add double %tmp.26.i25304, %tmp.18.i25329 ; <double> [#uses=1]
- store double %tmp.31.i25315, double* %tmp.6.i34367
- %tmp.4.i25263 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i25262, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.5.i25264 = getelementptr [6 x %"struct.std::dcomplex"]* %_m, i32 4, i32 5, i32 0, i32 0 ; <double*> [#uses=5]
- %tmp.6.i25265 = load double* %tmp.5.i25264 ; <double> [#uses=1]
- store double %tmp.6.i25265, double* %tmp.4.i25263
- %tmp.7.i25266 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i25262, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.8.i25267 = getelementptr [6 x %"struct.std::dcomplex"]* %_m, i32 4, i32 5, i32 0, i32 1 ; <double*> [#uses=5]
- %tmp.9.i25268 = load double* %tmp.8.i25267 ; <double> [#uses=1]
- store double %tmp.9.i25268, double* %tmp.7.i25266
- %tmp.0.i25269 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i25262, %"struct.std::dcomplex"* %ret4 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i25271 = getelementptr %"struct.std::dcomplex"* %tmp.0.i25269, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i25272 = load double* %tmp.14.i25271 ; <double> [#uses=1]
- %tmp.17.i25274 = getelementptr %"struct.std::dcomplex"* %tmp.0.i25269, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i25275 = load double* %tmp.17.i25274 ; <double> [#uses=1]
- %tmp.7.i25229 = load double* %tmp.2.i34368 ; <double> [#uses=1]
- %tmp.15.i25243 = add double %tmp.7.i25229, %tmp.15.i25272 ; <double> [#uses=1]
- store double %tmp.15.i25243, double* %tmp.2.i34368
- %tmp.26.i25250 = load double* %tmp.6.i34369 ; <double> [#uses=1]
- %tmp.31.i25261 = add double %tmp.26.i25250, %tmp.18.i25275 ; <double> [#uses=1]
- store double %tmp.31.i25261, double* %tmp.6.i34369
- store double 0.000000e+00, double* %tmp.2.i34366
- store double 0.000000e+00, double* %tmp.6.i34367
- %tmp.4.i25207 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i25206, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i25209 = load double* %tmp.5.i33146 ; <double> [#uses=1]
- store double %tmp.6.i25209, double* %tmp.4.i25207
- %tmp.7.i25210 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i25206, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i25212 = load double* %tmp.8.i33149 ; <double> [#uses=1]
- store double %tmp.9.i25212, double* %tmp.7.i25210
- %tmp.0.i25213 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i25206, %"struct.std::dcomplex"* %tmp.1036 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i25215 = getelementptr %"struct.std::dcomplex"* %tmp.0.i25213, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i25216 = load double* %tmp.14.i25215 ; <double> [#uses=1]
- %tmp.17.i25218 = getelementptr %"struct.std::dcomplex"* %tmp.0.i25213, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i25219 = load double* %tmp.17.i25218 ; <double> [#uses=1]
- %tmp.4.i25193 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i25192, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i25195 = load double* %tmp.5.i28602 ; <double> [#uses=1]
- store double %tmp.6.i25195, double* %tmp.4.i25193
- %tmp.7.i25196 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i25192, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i25198 = load double* %tmp.8.i28605 ; <double> [#uses=1]
- store double %tmp.9.i25198, double* %tmp.7.i25196
- %tmp.0.i25199 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i25192, %"struct.std::dcomplex"* %tmp.226 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i25200 = getelementptr %"struct.std::dcomplex"* %mem_tmp.494, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i25201 = getelementptr %"struct.std::dcomplex"* %tmp.0.i25199, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i25202 = load double* %tmp.14.i25201 ; <double> [#uses=1]
- store double %tmp.15.i25202, double* %tmp.13.i25200
- %tmp.16.i25203 = getelementptr %"struct.std::dcomplex"* %mem_tmp.494, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i25204 = getelementptr %"struct.std::dcomplex"* %tmp.0.i25199, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i25205 = load double* %tmp.17.i25204 ; <double> [#uses=1]
- store double %tmp.18.i25205, double* %tmp.16.i25203
- %tmp.4.i25179 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i25178, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i25216, double* %tmp.4.i25179
- %tmp.7.i25182 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i25178, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i25219, double* %tmp.7.i25182
- %tmp.0.i25185 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i25178, %"struct.std::dcomplex"* %mem_tmp.494 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i25187 = getelementptr %"struct.std::dcomplex"* %tmp.0.i25185, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i25188 = load double* %tmp.14.i25187 ; <double> [#uses=1]
- %tmp.17.i25190 = getelementptr %"struct.std::dcomplex"* %tmp.0.i25185, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i25191 = load double* %tmp.17.i25190 ; <double> [#uses=1]
- %tmp.4.i25165 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i25164, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i25188, double* %tmp.4.i25165
- %tmp.7.i25168 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i25164, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i25191, double* %tmp.7.i25168
- %tmp.0.i25171 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i25164, %"struct.std::dcomplex"* %tmp.95 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i25173 = getelementptr %"struct.std::dcomplex"* %tmp.0.i25171, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i25174 = load double* %tmp.14.i25173 ; <double> [#uses=1]
- %tmp.17.i25176 = getelementptr %"struct.std::dcomplex"* %tmp.0.i25171, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i25177 = load double* %tmp.17.i25176 ; <double> [#uses=1]
- %tmp.4.i25151 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i25150, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i25153 = load double* %tmp.5.i28602 ; <double> [#uses=1]
- store double %tmp.6.i25153, double* %tmp.4.i25151
- %tmp.7.i25154 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i25150, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i25156 = load double* %tmp.8.i28605 ; <double> [#uses=1]
- store double %tmp.9.i25156, double* %tmp.7.i25154
- %tmp.0.i25157 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i25150, %"struct.std::dcomplex"* %tmp.62 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i25159 = getelementptr %"struct.std::dcomplex"* %tmp.0.i25157, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i25160 = load double* %tmp.14.i25159 ; <double> [#uses=1]
- %tmp.17.i25162 = getelementptr %"struct.std::dcomplex"* %tmp.0.i25157, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i25163 = load double* %tmp.17.i25162 ; <double> [#uses=1]
- %tmp.4.i25137 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i25136, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i25139 = load double* %tmp.5.i34082 ; <double> [#uses=1]
- store double %tmp.6.i25139, double* %tmp.4.i25137
- %tmp.7.i25140 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i25136, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i25142 = load double* %tmp.8.i34085 ; <double> [#uses=1]
- store double %tmp.9.i25142, double* %tmp.7.i25140
- %tmp.0.i25143 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i25136, %"struct.std::dcomplex"* %tmp.1036 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i25144 = getelementptr %"struct.std::dcomplex"* %mem_tmp.498, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i25145 = getelementptr %"struct.std::dcomplex"* %tmp.0.i25143, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i25146 = load double* %tmp.14.i25145 ; <double> [#uses=1]
- store double %tmp.15.i25146, double* %tmp.13.i25144
- %tmp.16.i25147 = getelementptr %"struct.std::dcomplex"* %mem_tmp.498, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i25148 = getelementptr %"struct.std::dcomplex"* %tmp.0.i25143, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i25149 = load double* %tmp.17.i25148 ; <double> [#uses=1]
- store double %tmp.18.i25149, double* %tmp.16.i25147
- %tmp.4.i25123 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i25122, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i25160, double* %tmp.4.i25123
- %tmp.7.i25126 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i25122, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i25163, double* %tmp.7.i25126
- %tmp.0.i25129 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i25122, %"struct.std::dcomplex"* %mem_tmp.498 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i25131 = getelementptr %"struct.std::dcomplex"* %tmp.0.i25129, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i25132 = load double* %tmp.14.i25131 ; <double> [#uses=1]
- %tmp.17.i25134 = getelementptr %"struct.std::dcomplex"* %tmp.0.i25129, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i25135 = load double* %tmp.17.i25134 ; <double> [#uses=1]
- %tmp.4.i25109 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i25108, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i25132, double* %tmp.4.i25109
- %tmp.7.i25112 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i25108, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i25135, double* %tmp.7.i25112
- %tmp.0.i25115 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i25108, %"struct.std::dcomplex"* %tmp.220 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i25116 = getelementptr %"struct.std::dcomplex"* %mem_tmp.495, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i25117 = getelementptr %"struct.std::dcomplex"* %tmp.0.i25115, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i25118 = load double* %tmp.14.i25117 ; <double> [#uses=1]
- store double %tmp.15.i25118, double* %tmp.13.i25116
- %tmp.16.i25119 = getelementptr %"struct.std::dcomplex"* %mem_tmp.495, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i25120 = getelementptr %"struct.std::dcomplex"* %tmp.0.i25115, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i25121 = load double* %tmp.17.i25120 ; <double> [#uses=1]
- store double %tmp.18.i25121, double* %tmp.16.i25119
- %tmp.4.i25095 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i25094, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i25174, double* %tmp.4.i25095
- %tmp.7.i25098 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i25094, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i25177, double* %tmp.7.i25098
- %tmp.0.i25101 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i25094, %"struct.std::dcomplex"* %mem_tmp.495 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i25103 = getelementptr %"struct.std::dcomplex"* %tmp.0.i25101, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i25104 = load double* %tmp.14.i25103 ; <double> [#uses=1]
- %tmp.17.i25106 = getelementptr %"struct.std::dcomplex"* %tmp.0.i25101, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i25107 = load double* %tmp.17.i25106 ; <double> [#uses=1]
- %tmp.4.i25081 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i25080, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i25083 = load double* %tmp.5.i34082 ; <double> [#uses=1]
- store double %tmp.6.i25083, double* %tmp.4.i25081
- %tmp.7.i25084 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i25080, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i25086 = load double* %tmp.8.i34085 ; <double> [#uses=1]
- store double %tmp.9.i25086, double* %tmp.7.i25084
- %tmp.0.i25087 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i25080, %"struct.std::dcomplex"* %tmp.226 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i25089 = getelementptr %"struct.std::dcomplex"* %tmp.0.i25087, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i25090 = load double* %tmp.14.i25089 ; <double> [#uses=1]
- %tmp.17.i25092 = getelementptr %"struct.std::dcomplex"* %tmp.0.i25087, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i25093 = load double* %tmp.17.i25092 ; <double> [#uses=1]
- %tmp.4.i25067 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i25066, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i25069 = load double* %tmp.5.i33146 ; <double> [#uses=1]
- store double %tmp.6.i25069, double* %tmp.4.i25067
- %tmp.7.i25070 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i25066, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i25072 = load double* %tmp.8.i33149 ; <double> [#uses=1]
- store double %tmp.9.i25072, double* %tmp.7.i25070
- %tmp.0.i25073 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i25066, %"struct.std::dcomplex"* %tmp.62 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i25074 = getelementptr %"struct.std::dcomplex"* %mem_tmp.502, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i25075 = getelementptr %"struct.std::dcomplex"* %tmp.0.i25073, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i25076 = load double* %tmp.14.i25075 ; <double> [#uses=1]
- store double %tmp.15.i25076, double* %tmp.13.i25074
- %tmp.16.i25077 = getelementptr %"struct.std::dcomplex"* %mem_tmp.502, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i25078 = getelementptr %"struct.std::dcomplex"* %tmp.0.i25073, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i25079 = load double* %tmp.17.i25078 ; <double> [#uses=1]
- store double %tmp.18.i25079, double* %tmp.16.i25077
- %tmp.4.i25053 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i25052, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i25090, double* %tmp.4.i25053
- %tmp.7.i25056 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i25052, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i25093, double* %tmp.7.i25056
- %tmp.0.i25059 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i25052, %"struct.std::dcomplex"* %mem_tmp.502 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i25061 = getelementptr %"struct.std::dcomplex"* %tmp.0.i25059, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i25062 = load double* %tmp.14.i25061 ; <double> [#uses=1]
- %tmp.17.i25064 = getelementptr %"struct.std::dcomplex"* %tmp.0.i25059, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i25065 = load double* %tmp.17.i25064 ; <double> [#uses=1]
- %tmp.4.i25039 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i25038, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i25062, double* %tmp.4.i25039
- %tmp.7.i25042 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i25038, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i25065, double* %tmp.7.i25042
- %tmp.0.i25045 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i25038, %"struct.std::dcomplex"* %tmp.1075 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i25046 = getelementptr %"struct.std::dcomplex"* %mem_tmp.499, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i25047 = getelementptr %"struct.std::dcomplex"* %tmp.0.i25045, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i25048 = load double* %tmp.14.i25047 ; <double> [#uses=1]
- store double %tmp.15.i25048, double* %tmp.13.i25046
- %tmp.16.i25049 = getelementptr %"struct.std::dcomplex"* %mem_tmp.499, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i25050 = getelementptr %"struct.std::dcomplex"* %tmp.0.i25045, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i25051 = load double* %tmp.17.i25050 ; <double> [#uses=1]
- store double %tmp.18.i25051, double* %tmp.16.i25049
- %tmp.4.i25025 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i25024, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i25104, double* %tmp.4.i25025
- %tmp.7.i25028 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i25024, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i25107, double* %tmp.7.i25028
- %tmp.0.i25031 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i25024, %"struct.std::dcomplex"* %mem_tmp.499 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i25033 = getelementptr %"struct.std::dcomplex"* %tmp.0.i25031, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i25034 = load double* %tmp.14.i25033 ; <double> [#uses=1]
- %tmp.17.i25036 = getelementptr %"struct.std::dcomplex"* %tmp.0.i25031, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i25037 = load double* %tmp.17.i25036 ; <double> [#uses=1]
- store double %tmp.15.i25034, double* %tmp.2.i34364
- store double %tmp.18.i25037, double* %tmp.6.i34365
- %tmp.4.i24991 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i24990, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i24993 = load double* %tmp.5.i33326 ; <double> [#uses=1]
- store double %tmp.6.i24993, double* %tmp.4.i24991
- %tmp.7.i24994 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i24990, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i24996 = load double* %tmp.8.i33329 ; <double> [#uses=1]
- store double %tmp.9.i24996, double* %tmp.7.i24994
- %tmp.0.i24997 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i24990, %"struct.std::dcomplex"* %ret3 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i24999 = getelementptr %"struct.std::dcomplex"* %tmp.0.i24997, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i25000 = load double* %tmp.14.i24999 ; <double> [#uses=1]
- %tmp.17.i25002 = getelementptr %"struct.std::dcomplex"* %tmp.0.i24997, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i25003 = load double* %tmp.17.i25002 ; <double> [#uses=1]
- %tmp.7.i24957 = load double* %tmp.2.i34366 ; <double> [#uses=1]
- %tmp.15.i24971 = add double %tmp.7.i24957, %tmp.15.i25000 ; <double> [#uses=1]
- store double %tmp.15.i24971, double* %tmp.2.i34366
- %tmp.26.i24978 = load double* %tmp.6.i34367 ; <double> [#uses=1]
- %tmp.31.i24989 = add double %tmp.26.i24978, %tmp.18.i25003 ; <double> [#uses=1]
- store double %tmp.31.i24989, double* %tmp.6.i34367
- %tmp.4.i24937 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i24936, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i24939 = load double* %tmp.5.i33146 ; <double> [#uses=1]
- store double %tmp.6.i24939, double* %tmp.4.i24937
- %tmp.7.i24940 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i24936, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i24942 = load double* %tmp.8.i33149 ; <double> [#uses=1]
- store double %tmp.9.i24942, double* %tmp.7.i24940
- %tmp.0.i24943 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i24936, %"struct.std::dcomplex"* %tmp.21 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i24945 = getelementptr %"struct.std::dcomplex"* %tmp.0.i24943, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i24946 = load double* %tmp.14.i24945 ; <double> [#uses=1]
- %tmp.17.i24948 = getelementptr %"struct.std::dcomplex"* %tmp.0.i24943, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i24949 = load double* %tmp.17.i24948 ; <double> [#uses=1]
- %tmp.4.i24923 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i24922, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i24925 = load double* %tmp.5.i34282 ; <double> [#uses=1]
- store double %tmp.6.i24925, double* %tmp.4.i24923
- %tmp.7.i24926 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i24922, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i24928 = load double* %tmp.8.i34285 ; <double> [#uses=1]
- store double %tmp.9.i24928, double* %tmp.7.i24926
- %tmp.0.i24929 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i24922, %"struct.std::dcomplex"* %tmp.226 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i24930 = getelementptr %"struct.std::dcomplex"* %mem_tmp.509, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i24931 = getelementptr %"struct.std::dcomplex"* %tmp.0.i24929, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i24932 = load double* %tmp.14.i24931 ; <double> [#uses=1]
- store double %tmp.15.i24932, double* %tmp.13.i24930
- %tmp.16.i24933 = getelementptr %"struct.std::dcomplex"* %mem_tmp.509, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i24934 = getelementptr %"struct.std::dcomplex"* %tmp.0.i24929, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i24935 = load double* %tmp.17.i24934 ; <double> [#uses=1]
- store double %tmp.18.i24935, double* %tmp.16.i24933
- %tmp.4.i24909 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i24908, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i24946, double* %tmp.4.i24909
- %tmp.7.i24912 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i24908, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i24949, double* %tmp.7.i24912
- %tmp.0.i24915 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i24908, %"struct.std::dcomplex"* %mem_tmp.509 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i24917 = getelementptr %"struct.std::dcomplex"* %tmp.0.i24915, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i24918 = load double* %tmp.14.i24917 ; <double> [#uses=1]
- %tmp.17.i24920 = getelementptr %"struct.std::dcomplex"* %tmp.0.i24915, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i24921 = load double* %tmp.17.i24920 ; <double> [#uses=1]
- %tmp.4.i24895 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i24894, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i24918, double* %tmp.4.i24895
- %tmp.7.i24898 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i24894, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i24921, double* %tmp.7.i24898
- %tmp.0.i24901 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i24894, %"struct.std::dcomplex"* %tmp.1075 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i24903 = getelementptr %"struct.std::dcomplex"* %tmp.0.i24901, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i24904 = load double* %tmp.14.i24903 ; <double> [#uses=1]
- %tmp.17.i24906 = getelementptr %"struct.std::dcomplex"* %tmp.0.i24901, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i24907 = load double* %tmp.17.i24906 ; <double> [#uses=1]
- %tmp.4.i24881 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i24880, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i24883 = load double* %tmp.5.i28602 ; <double> [#uses=1]
- store double %tmp.6.i24883, double* %tmp.4.i24881
- %tmp.7.i24884 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i24880, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i24886 = load double* %tmp.8.i28605 ; <double> [#uses=1]
- store double %tmp.9.i24886, double* %tmp.7.i24884
- %tmp.0.i24887 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i24880, %"struct.std::dcomplex"* %tmp.226 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i24889 = getelementptr %"struct.std::dcomplex"* %tmp.0.i24887, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i24890 = load double* %tmp.14.i24889 ; <double> [#uses=1]
- %tmp.17.i24892 = getelementptr %"struct.std::dcomplex"* %tmp.0.i24887, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i24893 = load double* %tmp.17.i24892 ; <double> [#uses=1]
- %tmp.4.i24867 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i24866, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i24869 = load double* %tmp.5.i33146 ; <double> [#uses=1]
- store double %tmp.6.i24869, double* %tmp.4.i24867
- %tmp.7.i24870 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i24866, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i24872 = load double* %tmp.8.i33149 ; <double> [#uses=1]
- store double %tmp.9.i24872, double* %tmp.7.i24870
- %tmp.0.i24873 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i24866, %"struct.std::dcomplex"* %tmp.1036 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i24874 = getelementptr %"struct.std::dcomplex"* %mem_tmp.513, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i24875 = getelementptr %"struct.std::dcomplex"* %tmp.0.i24873, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i24876 = load double* %tmp.14.i24875 ; <double> [#uses=1]
- store double %tmp.15.i24876, double* %tmp.13.i24874
- %tmp.16.i24877 = getelementptr %"struct.std::dcomplex"* %mem_tmp.513, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i24878 = getelementptr %"struct.std::dcomplex"* %tmp.0.i24873, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i24879 = load double* %tmp.17.i24878 ; <double> [#uses=1]
- store double %tmp.18.i24879, double* %tmp.16.i24877
- %tmp.4.i24853 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i24852, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i24890, double* %tmp.4.i24853
- %tmp.7.i24856 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i24852, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i24893, double* %tmp.7.i24856
- %tmp.0.i24859 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i24852, %"struct.std::dcomplex"* %mem_tmp.513 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i24861 = getelementptr %"struct.std::dcomplex"* %tmp.0.i24859, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i24862 = load double* %tmp.14.i24861 ; <double> [#uses=1]
- %tmp.17.i24864 = getelementptr %"struct.std::dcomplex"* %tmp.0.i24859, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i24865 = load double* %tmp.17.i24864 ; <double> [#uses=1]
- %tmp.4.i24839 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i24838, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i24862, double* %tmp.4.i24839
- %tmp.7.i24842 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i24838, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i24865, double* %tmp.7.i24842
- %tmp.0.i24845 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i24838, %"struct.std::dcomplex"* %tmp.15 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i24846 = getelementptr %"struct.std::dcomplex"* %mem_tmp.510, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i24847 = getelementptr %"struct.std::dcomplex"* %tmp.0.i24845, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i24848 = load double* %tmp.14.i24847 ; <double> [#uses=1]
- store double %tmp.15.i24848, double* %tmp.13.i24846
- %tmp.16.i24849 = getelementptr %"struct.std::dcomplex"* %mem_tmp.510, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i24850 = getelementptr %"struct.std::dcomplex"* %tmp.0.i24845, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i24851 = load double* %tmp.17.i24850 ; <double> [#uses=1]
- store double %tmp.18.i24851, double* %tmp.16.i24849
- %tmp.4.i24825 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i24824, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i24904, double* %tmp.4.i24825
- %tmp.7.i24828 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i24824, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i24907, double* %tmp.7.i24828
- %tmp.0.i24831 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i24824, %"struct.std::dcomplex"* %mem_tmp.510 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i24833 = getelementptr %"struct.std::dcomplex"* %tmp.0.i24831, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i24834 = load double* %tmp.14.i24833 ; <double> [#uses=1]
- %tmp.17.i24836 = getelementptr %"struct.std::dcomplex"* %tmp.0.i24831, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i24837 = load double* %tmp.17.i24836 ; <double> [#uses=1]
- %tmp.4.i24811 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i24810, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i24813 = load double* %tmp.5.i34282 ; <double> [#uses=1]
- store double %tmp.6.i24813, double* %tmp.4.i24811
- %tmp.7.i24814 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i24810, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i24816 = load double* %tmp.8.i34285 ; <double> [#uses=1]
- store double %tmp.9.i24816, double* %tmp.7.i24814
- %tmp.0.i24817 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i24810, %"struct.std::dcomplex"* %tmp.1036 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i24819 = getelementptr %"struct.std::dcomplex"* %tmp.0.i24817, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i24820 = load double* %tmp.14.i24819 ; <double> [#uses=1]
- %tmp.17.i24822 = getelementptr %"struct.std::dcomplex"* %tmp.0.i24817, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i24823 = load double* %tmp.17.i24822 ; <double> [#uses=1]
- %tmp.4.i24797 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i24796, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i24799 = load double* %tmp.5.i28602 ; <double> [#uses=1]
- store double %tmp.6.i24799, double* %tmp.4.i24797
- %tmp.7.i24800 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i24796, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i24802 = load double* %tmp.8.i28605 ; <double> [#uses=1]
- store double %tmp.9.i24802, double* %tmp.7.i24800
- %tmp.0.i24803 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i24796, %"struct.std::dcomplex"* %tmp.21 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i24804 = getelementptr %"struct.std::dcomplex"* %mem_tmp.517, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i24805 = getelementptr %"struct.std::dcomplex"* %tmp.0.i24803, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i24806 = load double* %tmp.14.i24805 ; <double> [#uses=1]
- store double %tmp.15.i24806, double* %tmp.13.i24804
- %tmp.16.i24807 = getelementptr %"struct.std::dcomplex"* %mem_tmp.517, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i24808 = getelementptr %"struct.std::dcomplex"* %tmp.0.i24803, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i24809 = load double* %tmp.17.i24808 ; <double> [#uses=1]
- store double %tmp.18.i24809, double* %tmp.16.i24807
- %tmp.4.i24783 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i24782, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i24820, double* %tmp.4.i24783
- %tmp.7.i24786 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i24782, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i24823, double* %tmp.7.i24786
- %tmp.0.i24789 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i24782, %"struct.std::dcomplex"* %mem_tmp.517 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i24791 = getelementptr %"struct.std::dcomplex"* %tmp.0.i24789, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i24792 = load double* %tmp.14.i24791 ; <double> [#uses=1]
- %tmp.17.i24794 = getelementptr %"struct.std::dcomplex"* %tmp.0.i24789, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i24795 = load double* %tmp.17.i24794 ; <double> [#uses=1]
- %tmp.4.i24769 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i24768, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i24792, double* %tmp.4.i24769
- %tmp.7.i24772 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i24768, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i24795, double* %tmp.7.i24772
- %tmp.0.i24775 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i24768, %"struct.std::dcomplex"* %tmp.220 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i24776 = getelementptr %"struct.std::dcomplex"* %mem_tmp.514, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i24777 = getelementptr %"struct.std::dcomplex"* %tmp.0.i24775, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i24778 = load double* %tmp.14.i24777 ; <double> [#uses=1]
- store double %tmp.15.i24778, double* %tmp.13.i24776
- %tmp.16.i24779 = getelementptr %"struct.std::dcomplex"* %mem_tmp.514, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i24780 = getelementptr %"struct.std::dcomplex"* %tmp.0.i24775, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i24781 = load double* %tmp.17.i24780 ; <double> [#uses=1]
- store double %tmp.18.i24781, double* %tmp.16.i24779
- %tmp.4.i24755 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i24754, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i24834, double* %tmp.4.i24755
- %tmp.7.i24758 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i24754, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i24837, double* %tmp.7.i24758
- %tmp.0.i24761 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i24754, %"struct.std::dcomplex"* %mem_tmp.514 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i24763 = getelementptr %"struct.std::dcomplex"* %tmp.0.i24761, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i24764 = load double* %tmp.14.i24763 ; <double> [#uses=1]
- %tmp.17.i24766 = getelementptr %"struct.std::dcomplex"* %tmp.0.i24761, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i24767 = load double* %tmp.17.i24766 ; <double> [#uses=1]
- store double %tmp.15.i24764, double* %tmp.2.i34364
- store double %tmp.18.i24767, double* %tmp.6.i34365
- %tmp.4.i24721 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i24720, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i24723 = load double* %tmp.5.i34136 ; <double> [#uses=1]
- store double %tmp.6.i24723, double* %tmp.4.i24721
- %tmp.7.i24724 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i24720, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i24726 = load double* %tmp.8.i34139 ; <double> [#uses=1]
- store double %tmp.9.i24726, double* %tmp.7.i24724
- %tmp.0.i24727 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i24720, %"struct.std::dcomplex"* %ret3 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i24729 = getelementptr %"struct.std::dcomplex"* %tmp.0.i24727, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i24730 = load double* %tmp.14.i24729 ; <double> [#uses=1]
- %tmp.17.i24732 = getelementptr %"struct.std::dcomplex"* %tmp.0.i24727, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i24733 = load double* %tmp.17.i24732 ; <double> [#uses=1]
- %tmp.7.i24687 = load double* %tmp.2.i34366 ; <double> [#uses=1]
- %tmp.15.i24701 = add double %tmp.7.i24687, %tmp.15.i24730 ; <double> [#uses=1]
- store double %tmp.15.i24701, double* %tmp.2.i34366
- %tmp.26.i24708 = load double* %tmp.6.i34367 ; <double> [#uses=1]
- %tmp.31.i24719 = add double %tmp.26.i24708, %tmp.18.i24733 ; <double> [#uses=1]
- store double %tmp.31.i24719, double* %tmp.6.i34367
- %tmp.4.i24667 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i24666, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i24669 = load double* %tmp.5.i28602 ; <double> [#uses=1]
- store double %tmp.6.i24669, double* %tmp.4.i24667
- %tmp.7.i24670 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i24666, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i24672 = load double* %tmp.8.i28605 ; <double> [#uses=1]
- store double %tmp.9.i24672, double* %tmp.7.i24670
- %tmp.0.i24673 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i24666, %"struct.std::dcomplex"* %tmp.21 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i24675 = getelementptr %"struct.std::dcomplex"* %tmp.0.i24673, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i24676 = load double* %tmp.14.i24675 ; <double> [#uses=1]
- %tmp.17.i24678 = getelementptr %"struct.std::dcomplex"* %tmp.0.i24673, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i24679 = load double* %tmp.17.i24678 ; <double> [#uses=1]
- %tmp.4.i24653 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i24652, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i24655 = load double* %tmp.5.i34282 ; <double> [#uses=1]
- store double %tmp.6.i24655, double* %tmp.4.i24653
- %tmp.7.i24656 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i24652, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i24658 = load double* %tmp.8.i34285 ; <double> [#uses=1]
- store double %tmp.9.i24658, double* %tmp.7.i24656
- %tmp.0.i24659 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i24652, %"struct.std::dcomplex"* %tmp.1036 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i24660 = getelementptr %"struct.std::dcomplex"* %mem_tmp.524, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i24661 = getelementptr %"struct.std::dcomplex"* %tmp.0.i24659, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i24662 = load double* %tmp.14.i24661 ; <double> [#uses=1]
- store double %tmp.15.i24662, double* %tmp.13.i24660
- %tmp.16.i24663 = getelementptr %"struct.std::dcomplex"* %mem_tmp.524, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i24664 = getelementptr %"struct.std::dcomplex"* %tmp.0.i24659, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i24665 = load double* %tmp.17.i24664 ; <double> [#uses=1]
- store double %tmp.18.i24665, double* %tmp.16.i24663
- %tmp.4.i24639 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i24638, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i24676, double* %tmp.4.i24639
- %tmp.7.i24642 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i24638, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i24679, double* %tmp.7.i24642
- %tmp.0.i24645 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i24638, %"struct.std::dcomplex"* %mem_tmp.524 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i24647 = getelementptr %"struct.std::dcomplex"* %tmp.0.i24645, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i24648 = load double* %tmp.14.i24647 ; <double> [#uses=1]
- %tmp.17.i24650 = getelementptr %"struct.std::dcomplex"* %tmp.0.i24645, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i24651 = load double* %tmp.17.i24650 ; <double> [#uses=1]
- %tmp.4.i24625 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i24624, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i24648, double* %tmp.4.i24625
- %tmp.7.i24628 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i24624, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i24651, double* %tmp.7.i24628
- %tmp.0.i24631 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i24624, %"struct.std::dcomplex"* %tmp.95 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i24633 = getelementptr %"struct.std::dcomplex"* %tmp.0.i24631, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i24634 = load double* %tmp.14.i24633 ; <double> [#uses=1]
- %tmp.17.i24636 = getelementptr %"struct.std::dcomplex"* %tmp.0.i24631, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i24637 = load double* %tmp.17.i24636 ; <double> [#uses=1]
- %tmp.4.i24611 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i24610, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i24613 = load double* %tmp.5.i34282 ; <double> [#uses=1]
- store double %tmp.6.i24613, double* %tmp.4.i24611
- %tmp.7.i24614 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i24610, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i24616 = load double* %tmp.8.i34285 ; <double> [#uses=1]
- store double %tmp.9.i24616, double* %tmp.7.i24614
- %tmp.0.i24617 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i24610, %"struct.std::dcomplex"* %tmp.62 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i24619 = getelementptr %"struct.std::dcomplex"* %tmp.0.i24617, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i24620 = load double* %tmp.14.i24619 ; <double> [#uses=1]
- %tmp.17.i24622 = getelementptr %"struct.std::dcomplex"* %tmp.0.i24617, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i24623 = load double* %tmp.17.i24622 ; <double> [#uses=1]
- %tmp.4.i24597 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i24596, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i24599 = load double* %tmp.5.i34082 ; <double> [#uses=1]
- store double %tmp.6.i24599, double* %tmp.4.i24597
- %tmp.7.i24600 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i24596, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i24602 = load double* %tmp.8.i34085 ; <double> [#uses=1]
- store double %tmp.9.i24602, double* %tmp.7.i24600
- %tmp.0.i24603 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i24596, %"struct.std::dcomplex"* %tmp.21 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i24604 = getelementptr %"struct.std::dcomplex"* %mem_tmp.528, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i24605 = getelementptr %"struct.std::dcomplex"* %tmp.0.i24603, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i24606 = load double* %tmp.14.i24605 ; <double> [#uses=1]
- store double %tmp.15.i24606, double* %tmp.13.i24604
- %tmp.16.i24607 = getelementptr %"struct.std::dcomplex"* %mem_tmp.528, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i24608 = getelementptr %"struct.std::dcomplex"* %tmp.0.i24603, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i24609 = load double* %tmp.17.i24608 ; <double> [#uses=1]
- store double %tmp.18.i24609, double* %tmp.16.i24607
- %tmp.4.i24583 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i24582, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i24620, double* %tmp.4.i24583
- %tmp.7.i24586 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i24582, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i24623, double* %tmp.7.i24586
- %tmp.0.i24589 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i24582, %"struct.std::dcomplex"* %mem_tmp.528 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i24591 = getelementptr %"struct.std::dcomplex"* %tmp.0.i24589, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i24592 = load double* %tmp.14.i24591 ; <double> [#uses=1]
- %tmp.17.i24594 = getelementptr %"struct.std::dcomplex"* %tmp.0.i24589, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i24595 = load double* %tmp.17.i24594 ; <double> [#uses=1]
- %tmp.4.i24569 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i24568, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i24592, double* %tmp.4.i24569
- %tmp.7.i24572 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i24568, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i24595, double* %tmp.7.i24572
- %tmp.0.i24575 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i24568, %"struct.std::dcomplex"* %tmp.1075 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i24576 = getelementptr %"struct.std::dcomplex"* %mem_tmp.525, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i24577 = getelementptr %"struct.std::dcomplex"* %tmp.0.i24575, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i24578 = load double* %tmp.14.i24577 ; <double> [#uses=1]
- store double %tmp.15.i24578, double* %tmp.13.i24576
- %tmp.16.i24579 = getelementptr %"struct.std::dcomplex"* %mem_tmp.525, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i24580 = getelementptr %"struct.std::dcomplex"* %tmp.0.i24575, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i24581 = load double* %tmp.17.i24580 ; <double> [#uses=1]
- store double %tmp.18.i24581, double* %tmp.16.i24579
- %tmp.4.i24555 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i24554, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i24634, double* %tmp.4.i24555
- %tmp.7.i24558 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i24554, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i24637, double* %tmp.7.i24558
- %tmp.0.i24561 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i24554, %"struct.std::dcomplex"* %mem_tmp.525 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i24563 = getelementptr %"struct.std::dcomplex"* %tmp.0.i24561, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i24564 = load double* %tmp.14.i24563 ; <double> [#uses=1]
- %tmp.17.i24566 = getelementptr %"struct.std::dcomplex"* %tmp.0.i24561, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i24567 = load double* %tmp.17.i24566 ; <double> [#uses=1]
- %tmp.4.i24541 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i24540, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i24543 = load double* %tmp.5.i34082 ; <double> [#uses=1]
- store double %tmp.6.i24543, double* %tmp.4.i24541
- %tmp.7.i24544 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i24540, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i24546 = load double* %tmp.8.i34085 ; <double> [#uses=1]
- store double %tmp.9.i24546, double* %tmp.7.i24544
- %tmp.0.i24547 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i24540, %"struct.std::dcomplex"* %tmp.1036 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i24549 = getelementptr %"struct.std::dcomplex"* %tmp.0.i24547, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i24550 = load double* %tmp.14.i24549 ; <double> [#uses=1]
- %tmp.17.i24552 = getelementptr %"struct.std::dcomplex"* %tmp.0.i24547, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i24553 = load double* %tmp.17.i24552 ; <double> [#uses=1]
- %tmp.4.i24527 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i24526, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i24529 = load double* %tmp.5.i28602 ; <double> [#uses=1]
- store double %tmp.6.i24529, double* %tmp.4.i24527
- %tmp.7.i24530 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i24526, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i24532 = load double* %tmp.8.i28605 ; <double> [#uses=1]
- store double %tmp.9.i24532, double* %tmp.7.i24530
- %tmp.0.i24533 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i24526, %"struct.std::dcomplex"* %tmp.62 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i24534 = getelementptr %"struct.std::dcomplex"* %mem_tmp.532, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i24535 = getelementptr %"struct.std::dcomplex"* %tmp.0.i24533, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i24536 = load double* %tmp.14.i24535 ; <double> [#uses=1]
- store double %tmp.15.i24536, double* %tmp.13.i24534
- %tmp.16.i24537 = getelementptr %"struct.std::dcomplex"* %mem_tmp.532, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i24538 = getelementptr %"struct.std::dcomplex"* %tmp.0.i24533, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i24539 = load double* %tmp.17.i24538 ; <double> [#uses=1]
- store double %tmp.18.i24539, double* %tmp.16.i24537
- %tmp.4.i24513 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i24512, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i24550, double* %tmp.4.i24513
- %tmp.7.i24516 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i24512, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i24553, double* %tmp.7.i24516
- %tmp.0.i24519 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i24512, %"struct.std::dcomplex"* %mem_tmp.532 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i24521 = getelementptr %"struct.std::dcomplex"* %tmp.0.i24519, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i24522 = load double* %tmp.14.i24521 ; <double> [#uses=1]
- %tmp.17.i24524 = getelementptr %"struct.std::dcomplex"* %tmp.0.i24519, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i24525 = load double* %tmp.17.i24524 ; <double> [#uses=1]
- %tmp.4.i24499 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i24498, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i24522, double* %tmp.4.i24499
- %tmp.7.i24502 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i24498, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i24525, double* %tmp.7.i24502
- %tmp.0.i24505 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i24498, %"struct.std::dcomplex"* %tmp.15 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i24506 = getelementptr %"struct.std::dcomplex"* %mem_tmp.529, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i24507 = getelementptr %"struct.std::dcomplex"* %tmp.0.i24505, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i24508 = load double* %tmp.14.i24507 ; <double> [#uses=1]
- store double %tmp.15.i24508, double* %tmp.13.i24506
- %tmp.16.i24509 = getelementptr %"struct.std::dcomplex"* %mem_tmp.529, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i24510 = getelementptr %"struct.std::dcomplex"* %tmp.0.i24505, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i24511 = load double* %tmp.17.i24510 ; <double> [#uses=1]
- store double %tmp.18.i24511, double* %tmp.16.i24509
- %tmp.4.i24485 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i24484, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i24564, double* %tmp.4.i24485
- %tmp.7.i24488 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i24484, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i24567, double* %tmp.7.i24488
- %tmp.0.i24491 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i24484, %"struct.std::dcomplex"* %mem_tmp.529 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i24493 = getelementptr %"struct.std::dcomplex"* %tmp.0.i24491, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i24494 = load double* %tmp.14.i24493 ; <double> [#uses=1]
- %tmp.17.i24496 = getelementptr %"struct.std::dcomplex"* %tmp.0.i24491, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i24497 = load double* %tmp.17.i24496 ; <double> [#uses=1]
- store double %tmp.15.i24494, double* %tmp.2.i34364
- store double %tmp.18.i24497, double* %tmp.6.i34365
- %tmp.4.i24451 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i24450, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i24453 = load double* %tmp.5.i32460 ; <double> [#uses=1]
- store double %tmp.6.i24453, double* %tmp.4.i24451
- %tmp.7.i24454 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i24450, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i24456 = load double* %tmp.8.i32463 ; <double> [#uses=1]
- store double %tmp.9.i24456, double* %tmp.7.i24454
- %tmp.0.i24457 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i24450, %"struct.std::dcomplex"* %ret3 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i24459 = getelementptr %"struct.std::dcomplex"* %tmp.0.i24457, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i24460 = load double* %tmp.14.i24459 ; <double> [#uses=1]
- %tmp.17.i24462 = getelementptr %"struct.std::dcomplex"* %tmp.0.i24457, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i24463 = load double* %tmp.17.i24462 ; <double> [#uses=1]
- %tmp.7.i24417 = load double* %tmp.2.i34366 ; <double> [#uses=1]
- %tmp.15.i24431 = add double %tmp.7.i24417, %tmp.15.i24460 ; <double> [#uses=1]
- store double %tmp.15.i24431, double* %tmp.2.i34366
- %tmp.26.i24438 = load double* %tmp.6.i34367 ; <double> [#uses=1]
- %tmp.31.i24449 = add double %tmp.26.i24438, %tmp.18.i24463 ; <double> [#uses=1]
- store double %tmp.31.i24449, double* %tmp.6.i34367
- %tmp.4.i24397 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i24396, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i24399 = load double* %tmp.5.i33146 ; <double> [#uses=1]
- store double %tmp.6.i24399, double* %tmp.4.i24397
- %tmp.7.i24400 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i24396, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i24402 = load double* %tmp.8.i33149 ; <double> [#uses=1]
- store double %tmp.9.i24402, double* %tmp.7.i24400
- %tmp.0.i24403 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i24396, %"struct.std::dcomplex"* %tmp.62 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i24405 = getelementptr %"struct.std::dcomplex"* %tmp.0.i24403, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i24406 = load double* %tmp.14.i24405 ; <double> [#uses=1]
- %tmp.17.i24408 = getelementptr %"struct.std::dcomplex"* %tmp.0.i24403, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i24409 = load double* %tmp.17.i24408 ; <double> [#uses=1]
- %tmp.4.i24383 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i24382, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i24385 = load double* %tmp.5.i34082 ; <double> [#uses=1]
- store double %tmp.6.i24385, double* %tmp.4.i24383
- %tmp.7.i24386 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i24382, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i24388 = load double* %tmp.8.i34085 ; <double> [#uses=1]
- store double %tmp.9.i24388, double* %tmp.7.i24386
- %tmp.0.i24389 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i24382, %"struct.std::dcomplex"* %tmp.226 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i24390 = getelementptr %"struct.std::dcomplex"* %mem_tmp.539, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i24391 = getelementptr %"struct.std::dcomplex"* %tmp.0.i24389, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i24392 = load double* %tmp.14.i24391 ; <double> [#uses=1]
- store double %tmp.15.i24392, double* %tmp.13.i24390
- %tmp.16.i24393 = getelementptr %"struct.std::dcomplex"* %mem_tmp.539, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i24394 = getelementptr %"struct.std::dcomplex"* %tmp.0.i24389, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i24395 = load double* %tmp.17.i24394 ; <double> [#uses=1]
- store double %tmp.18.i24395, double* %tmp.16.i24393
- %tmp.4.i24369 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i24368, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i24406, double* %tmp.4.i24369
- %tmp.7.i24372 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i24368, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i24409, double* %tmp.7.i24372
- %tmp.0.i24375 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i24368, %"struct.std::dcomplex"* %mem_tmp.539 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i24377 = getelementptr %"struct.std::dcomplex"* %tmp.0.i24375, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i24378 = load double* %tmp.14.i24377 ; <double> [#uses=1]
- %tmp.17.i24380 = getelementptr %"struct.std::dcomplex"* %tmp.0.i24375, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i24381 = load double* %tmp.17.i24380 ; <double> [#uses=1]
- %tmp.4.i24355 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i24354, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i24378, double* %tmp.4.i24355
- %tmp.7.i24358 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i24354, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i24381, double* %tmp.7.i24358
- %tmp.0.i24361 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i24354, %"struct.std::dcomplex"* %tmp.15 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i24363 = getelementptr %"struct.std::dcomplex"* %tmp.0.i24361, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i24364 = load double* %tmp.14.i24363 ; <double> [#uses=1]
- %tmp.17.i24366 = getelementptr %"struct.std::dcomplex"* %tmp.0.i24361, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i24367 = load double* %tmp.17.i24366 ; <double> [#uses=1]
- %tmp.4.i24341 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i24340, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i24343 = load double* %tmp.5.i34282 ; <double> [#uses=1]
- store double %tmp.6.i24343, double* %tmp.4.i24341
- %tmp.7.i24344 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i24340, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i24346 = load double* %tmp.8.i34285 ; <double> [#uses=1]
- store double %tmp.9.i24346, double* %tmp.7.i24344
- %tmp.0.i24347 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i24340, %"struct.std::dcomplex"* %tmp.226 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i24349 = getelementptr %"struct.std::dcomplex"* %tmp.0.i24347, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i24350 = load double* %tmp.14.i24349 ; <double> [#uses=1]
- %tmp.17.i24352 = getelementptr %"struct.std::dcomplex"* %tmp.0.i24347, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i24353 = load double* %tmp.17.i24352 ; <double> [#uses=1]
- %tmp.4.i24327 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i24326, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i24329 = load double* %tmp.5.i33146 ; <double> [#uses=1]
- store double %tmp.6.i24329, double* %tmp.4.i24327
- %tmp.7.i24330 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i24326, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i24332 = load double* %tmp.8.i33149 ; <double> [#uses=1]
- store double %tmp.9.i24332, double* %tmp.7.i24330
- %tmp.0.i24333 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i24326, %"struct.std::dcomplex"* %tmp.21 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i24334 = getelementptr %"struct.std::dcomplex"* %mem_tmp.543, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i24335 = getelementptr %"struct.std::dcomplex"* %tmp.0.i24333, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i24336 = load double* %tmp.14.i24335 ; <double> [#uses=1]
- store double %tmp.15.i24336, double* %tmp.13.i24334
- %tmp.16.i24337 = getelementptr %"struct.std::dcomplex"* %mem_tmp.543, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i24338 = getelementptr %"struct.std::dcomplex"* %tmp.0.i24333, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i24339 = load double* %tmp.17.i24338 ; <double> [#uses=1]
- store double %tmp.18.i24339, double* %tmp.16.i24337
- %tmp.4.i24313 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i24312, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i24350, double* %tmp.4.i24313
- %tmp.7.i24316 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i24312, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i24353, double* %tmp.7.i24316
- %tmp.0.i24319 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i24312, %"struct.std::dcomplex"* %mem_tmp.543 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i24321 = getelementptr %"struct.std::dcomplex"* %tmp.0.i24319, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i24322 = load double* %tmp.14.i24321 ; <double> [#uses=1]
- %tmp.17.i24324 = getelementptr %"struct.std::dcomplex"* %tmp.0.i24319, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i24325 = load double* %tmp.17.i24324 ; <double> [#uses=1]
- %tmp.4.i24299 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i24298, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i24322, double* %tmp.4.i24299
- %tmp.7.i24302 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i24298, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i24325, double* %tmp.7.i24302
- %tmp.0.i24305 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i24298, %"struct.std::dcomplex"* %tmp.95 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i24306 = getelementptr %"struct.std::dcomplex"* %mem_tmp.540, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i24307 = getelementptr %"struct.std::dcomplex"* %tmp.0.i24305, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i24308 = load double* %tmp.14.i24307 ; <double> [#uses=1]
- store double %tmp.15.i24308, double* %tmp.13.i24306
- %tmp.16.i24309 = getelementptr %"struct.std::dcomplex"* %mem_tmp.540, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i24310 = getelementptr %"struct.std::dcomplex"* %tmp.0.i24305, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i24311 = load double* %tmp.17.i24310 ; <double> [#uses=1]
- store double %tmp.18.i24311, double* %tmp.16.i24309
- %tmp.4.i24285 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i24284, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i24364, double* %tmp.4.i24285
- %tmp.7.i24288 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i24284, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i24367, double* %tmp.7.i24288
- %tmp.0.i24291 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i24284, %"struct.std::dcomplex"* %mem_tmp.540 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i24293 = getelementptr %"struct.std::dcomplex"* %tmp.0.i24291, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i24294 = load double* %tmp.14.i24293 ; <double> [#uses=1]
- %tmp.17.i24296 = getelementptr %"struct.std::dcomplex"* %tmp.0.i24291, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i24297 = load double* %tmp.17.i24296 ; <double> [#uses=1]
- %tmp.4.i24271 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i24270, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i24273 = load double* %tmp.5.i34082 ; <double> [#uses=1]
- store double %tmp.6.i24273, double* %tmp.4.i24271
- %tmp.7.i24274 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i24270, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i24276 = load double* %tmp.8.i34085 ; <double> [#uses=1]
- store double %tmp.9.i24276, double* %tmp.7.i24274
- %tmp.0.i24277 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i24270, %"struct.std::dcomplex"* %tmp.21 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i24279 = getelementptr %"struct.std::dcomplex"* %tmp.0.i24277, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i24280 = load double* %tmp.14.i24279 ; <double> [#uses=1]
- %tmp.17.i24282 = getelementptr %"struct.std::dcomplex"* %tmp.0.i24277, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i24283 = load double* %tmp.17.i24282 ; <double> [#uses=1]
- %tmp.4.i24257 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i24256, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i24259 = load double* %tmp.5.i34282 ; <double> [#uses=1]
- store double %tmp.6.i24259, double* %tmp.4.i24257
- %tmp.7.i24260 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i24256, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i24262 = load double* %tmp.8.i34285 ; <double> [#uses=1]
- store double %tmp.9.i24262, double* %tmp.7.i24260
- %tmp.0.i24263 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i24256, %"struct.std::dcomplex"* %tmp.62 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i24264 = getelementptr %"struct.std::dcomplex"* %mem_tmp.547, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i24265 = getelementptr %"struct.std::dcomplex"* %tmp.0.i24263, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i24266 = load double* %tmp.14.i24265 ; <double> [#uses=1]
- store double %tmp.15.i24266, double* %tmp.13.i24264
- %tmp.16.i24267 = getelementptr %"struct.std::dcomplex"* %mem_tmp.547, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i24268 = getelementptr %"struct.std::dcomplex"* %tmp.0.i24263, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i24269 = load double* %tmp.17.i24268 ; <double> [#uses=1]
- store double %tmp.18.i24269, double* %tmp.16.i24267
- %tmp.4.i24243 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i24242, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i24280, double* %tmp.4.i24243
- %tmp.7.i24246 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i24242, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i24283, double* %tmp.7.i24246
- %tmp.0.i24249 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i24242, %"struct.std::dcomplex"* %mem_tmp.547 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i24251 = getelementptr %"struct.std::dcomplex"* %tmp.0.i24249, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i24252 = load double* %tmp.14.i24251 ; <double> [#uses=1]
- %tmp.17.i24254 = getelementptr %"struct.std::dcomplex"* %tmp.0.i24249, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i24255 = load double* %tmp.17.i24254 ; <double> [#uses=1]
- %tmp.4.i24229 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i24228, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i24252, double* %tmp.4.i24229
- %tmp.7.i24232 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i24228, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i24255, double* %tmp.7.i24232
- %tmp.0.i24235 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i24228, %"struct.std::dcomplex"* %tmp.220 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i24236 = getelementptr %"struct.std::dcomplex"* %mem_tmp.544, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i24237 = getelementptr %"struct.std::dcomplex"* %tmp.0.i24235, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i24238 = load double* %tmp.14.i24237 ; <double> [#uses=1]
- store double %tmp.15.i24238, double* %tmp.13.i24236
- %tmp.16.i24239 = getelementptr %"struct.std::dcomplex"* %mem_tmp.544, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i24240 = getelementptr %"struct.std::dcomplex"* %tmp.0.i24235, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i24241 = load double* %tmp.17.i24240 ; <double> [#uses=1]
- store double %tmp.18.i24241, double* %tmp.16.i24239
- %tmp.4.i24215 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i24214, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i24294, double* %tmp.4.i24215
- %tmp.7.i24218 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i24214, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i24297, double* %tmp.7.i24218
- %tmp.0.i24221 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i24214, %"struct.std::dcomplex"* %mem_tmp.544 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i24223 = getelementptr %"struct.std::dcomplex"* %tmp.0.i24221, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i24224 = load double* %tmp.14.i24223 ; <double> [#uses=1]
- %tmp.17.i24226 = getelementptr %"struct.std::dcomplex"* %tmp.0.i24221, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i24227 = load double* %tmp.17.i24226 ; <double> [#uses=1]
- store double %tmp.15.i24224, double* %tmp.2.i34364
- store double %tmp.18.i24227, double* %tmp.6.i34365
- %tmp.4.i24181 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i24180, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i24183 = load double* %tmp.5.i27590 ; <double> [#uses=1]
- store double %tmp.6.i24183, double* %tmp.4.i24181
- %tmp.7.i24184 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i24180, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i24186 = load double* %tmp.8.i27593 ; <double> [#uses=1]
- store double %tmp.9.i24186, double* %tmp.7.i24184
- %tmp.0.i24187 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i24180, %"struct.std::dcomplex"* %ret3 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i24189 = getelementptr %"struct.std::dcomplex"* %tmp.0.i24187, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i24190 = load double* %tmp.14.i24189 ; <double> [#uses=1]
- %tmp.17.i24192 = getelementptr %"struct.std::dcomplex"* %tmp.0.i24187, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i24193 = load double* %tmp.17.i24192 ; <double> [#uses=1]
- %tmp.7.i24147 = load double* %tmp.2.i34366 ; <double> [#uses=1]
- %tmp.15.i24161 = add double %tmp.7.i24147, %tmp.15.i24190 ; <double> [#uses=1]
- store double %tmp.15.i24161, double* %tmp.2.i34366
- %tmp.26.i24168 = load double* %tmp.6.i34367 ; <double> [#uses=1]
- %tmp.31.i24179 = add double %tmp.26.i24168, %tmp.18.i24193 ; <double> [#uses=1]
- store double %tmp.31.i24179, double* %tmp.6.i34367
- %tmp.4.i24127 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i24126, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i24129 = load double* %tmp.5.i31000 ; <double> [#uses=1]
- store double %tmp.6.i24129, double* %tmp.4.i24127
- %tmp.7.i24130 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i24126, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i24132 = load double* %tmp.8.i31003 ; <double> [#uses=1]
- store double %tmp.9.i24132, double* %tmp.7.i24130
- %tmp.0.i24133 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i24126, %"struct.std::dcomplex"* %ret4 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i24135 = getelementptr %"struct.std::dcomplex"* %tmp.0.i24133, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i24136 = load double* %tmp.14.i24135 ; <double> [#uses=1]
- %tmp.17.i24138 = getelementptr %"struct.std::dcomplex"* %tmp.0.i24133, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i24139 = load double* %tmp.17.i24138 ; <double> [#uses=1]
- %tmp.7.i24093 = load double* %tmp.2.i34368 ; <double> [#uses=1]
- %tmp.15.i24107 = add double %tmp.7.i24093, %tmp.15.i24136 ; <double> [#uses=1]
- store double %tmp.15.i24107, double* %tmp.2.i34368
- %tmp.26.i24114 = load double* %tmp.6.i34369 ; <double> [#uses=1]
- %tmp.31.i24125 = add double %tmp.26.i24114, %tmp.18.i24139 ; <double> [#uses=1]
- store double %tmp.31.i24125, double* %tmp.6.i34369
- store double 0.000000e+00, double* %tmp.2.i34366
- store double 0.000000e+00, double* %tmp.6.i34367
- %tmp.4.i24071 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i24070, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i24073 = load double* %tmp.5.i34338 ; <double> [#uses=1]
- store double %tmp.6.i24073, double* %tmp.4.i24071
- %tmp.7.i24074 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i24070, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i24076 = load double* %tmp.8.i34341 ; <double> [#uses=1]
- store double %tmp.9.i24076, double* %tmp.7.i24074
- %tmp.0.i24077 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i24070, %"struct.std::dcomplex"* %tmp.62 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i24079 = getelementptr %"struct.std::dcomplex"* %tmp.0.i24077, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i24080 = load double* %tmp.14.i24079 ; <double> [#uses=1]
- %tmp.17.i24082 = getelementptr %"struct.std::dcomplex"* %tmp.0.i24077, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i24083 = load double* %tmp.17.i24082 ; <double> [#uses=1]
- %tmp.4.i24057 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i24056, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i24059 = load double* %tmp.5.i34082 ; <double> [#uses=1]
- store double %tmp.6.i24059, double* %tmp.4.i24057
- %tmp.7.i24060 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i24056, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i24062 = load double* %tmp.8.i34085 ; <double> [#uses=1]
- store double %tmp.9.i24062, double* %tmp.7.i24060
- %tmp.0.i24063 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i24056, %"struct.std::dcomplex"* %tmp.6 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i24064 = getelementptr %"struct.std::dcomplex"* %mem_tmp.555, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i24065 = getelementptr %"struct.std::dcomplex"* %tmp.0.i24063, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i24066 = load double* %tmp.14.i24065 ; <double> [#uses=1]
- store double %tmp.15.i24066, double* %tmp.13.i24064
- %tmp.16.i24067 = getelementptr %"struct.std::dcomplex"* %mem_tmp.555, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i24068 = getelementptr %"struct.std::dcomplex"* %tmp.0.i24063, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i24069 = load double* %tmp.17.i24068 ; <double> [#uses=1]
- store double %tmp.18.i24069, double* %tmp.16.i24067
- %tmp.4.i24043 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i24042, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i24080, double* %tmp.4.i24043
- %tmp.7.i24046 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i24042, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i24083, double* %tmp.7.i24046
- %tmp.0.i24049 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i24042, %"struct.std::dcomplex"* %mem_tmp.555 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i24051 = getelementptr %"struct.std::dcomplex"* %tmp.0.i24049, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i24052 = load double* %tmp.14.i24051 ; <double> [#uses=1]
- %tmp.17.i24054 = getelementptr %"struct.std::dcomplex"* %tmp.0.i24049, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i24055 = load double* %tmp.17.i24054 ; <double> [#uses=1]
- %tmp.4.i24029 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i24028, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i24052, double* %tmp.4.i24029
- %tmp.7.i24032 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i24028, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i24055, double* %tmp.7.i24032
- %tmp.0.i24035 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i24028, %"struct.std::dcomplex"* %tmp.220 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i24037 = getelementptr %"struct.std::dcomplex"* %tmp.0.i24035, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i24038 = load double* %tmp.14.i24037 ; <double> [#uses=1]
- %tmp.17.i24040 = getelementptr %"struct.std::dcomplex"* %tmp.0.i24035, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i24041 = load double* %tmp.17.i24040 ; <double> [#uses=1]
- %tmp.4.i24015 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i24014, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i24017 = load double* %tmp.5.i34082 ; <double> [#uses=1]
- store double %tmp.6.i24017, double* %tmp.4.i24015
- %tmp.7.i24018 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i24014, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i24020 = load double* %tmp.8.i34085 ; <double> [#uses=1]
- store double %tmp.9.i24020, double* %tmp.7.i24018
- %tmp.0.i24021 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i24014, %"struct.std::dcomplex"* %tmp.226 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i24023 = getelementptr %"struct.std::dcomplex"* %tmp.0.i24021, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i24024 = load double* %tmp.14.i24023 ; <double> [#uses=1]
- %tmp.17.i24026 = getelementptr %"struct.std::dcomplex"* %tmp.0.i24021, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i24027 = load double* %tmp.17.i24026 ; <double> [#uses=1]
- %tmp.4.i24001 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i24000, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i24003 = load double* %tmp.5.i33146 ; <double> [#uses=1]
- store double %tmp.6.i24003, double* %tmp.4.i24001
- %tmp.7.i24004 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i24000, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i24006 = load double* %tmp.8.i33149 ; <double> [#uses=1]
- store double %tmp.9.i24006, double* %tmp.7.i24004
- %tmp.0.i24007 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i24000, %"struct.std::dcomplex"* %tmp.62 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i24008 = getelementptr %"struct.std::dcomplex"* %mem_tmp.559, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i24009 = getelementptr %"struct.std::dcomplex"* %tmp.0.i24007, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i24010 = load double* %tmp.14.i24009 ; <double> [#uses=1]
- store double %tmp.15.i24010, double* %tmp.13.i24008
- %tmp.16.i24011 = getelementptr %"struct.std::dcomplex"* %mem_tmp.559, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i24012 = getelementptr %"struct.std::dcomplex"* %tmp.0.i24007, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i24013 = load double* %tmp.17.i24012 ; <double> [#uses=1]
- store double %tmp.18.i24013, double* %tmp.16.i24011
- %tmp.4.i23987 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i23986, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i24024, double* %tmp.4.i23987
- %tmp.7.i23990 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i23986, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i24027, double* %tmp.7.i23990
- %tmp.0.i23993 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i23986, %"struct.std::dcomplex"* %mem_tmp.559 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i23995 = getelementptr %"struct.std::dcomplex"* %tmp.0.i23993, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i23996 = load double* %tmp.14.i23995 ; <double> [#uses=1]
- %tmp.17.i23998 = getelementptr %"struct.std::dcomplex"* %tmp.0.i23993, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i23999 = load double* %tmp.17.i23998 ; <double> [#uses=1]
- %tmp.4.i23973 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i23972, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i23996, double* %tmp.4.i23973
- %tmp.7.i23976 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i23972, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i23999, double* %tmp.7.i23976
- %tmp.0.i23979 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i23972, %"struct.std::dcomplex"* %tmp.45 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i23980 = getelementptr %"struct.std::dcomplex"* %mem_tmp.556, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i23981 = getelementptr %"struct.std::dcomplex"* %tmp.0.i23979, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i23982 = load double* %tmp.14.i23981 ; <double> [#uses=1]
- store double %tmp.15.i23982, double* %tmp.13.i23980
- %tmp.16.i23983 = getelementptr %"struct.std::dcomplex"* %mem_tmp.556, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i23984 = getelementptr %"struct.std::dcomplex"* %tmp.0.i23979, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i23985 = load double* %tmp.17.i23984 ; <double> [#uses=1]
- store double %tmp.18.i23985, double* %tmp.16.i23983
- %tmp.4.i23959 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i23958, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i24038, double* %tmp.4.i23959
- %tmp.7.i23962 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i23958, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i24041, double* %tmp.7.i23962
- %tmp.0.i23965 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i23958, %"struct.std::dcomplex"* %mem_tmp.556 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i23967 = getelementptr %"struct.std::dcomplex"* %tmp.0.i23965, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i23968 = load double* %tmp.14.i23967 ; <double> [#uses=1]
- %tmp.17.i23970 = getelementptr %"struct.std::dcomplex"* %tmp.0.i23965, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i23971 = load double* %tmp.17.i23970 ; <double> [#uses=1]
- %tmp.4.i23945 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i23944, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i23947 = load double* %tmp.5.i33146 ; <double> [#uses=1]
- store double %tmp.6.i23947, double* %tmp.4.i23945
- %tmp.7.i23948 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i23944, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i23950 = load double* %tmp.8.i33149 ; <double> [#uses=1]
- store double %tmp.9.i23950, double* %tmp.7.i23948
- %tmp.0.i23951 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i23944, %"struct.std::dcomplex"* %tmp.6 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i23953 = getelementptr %"struct.std::dcomplex"* %tmp.0.i23951, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i23954 = load double* %tmp.14.i23953 ; <double> [#uses=1]
- %tmp.17.i23956 = getelementptr %"struct.std::dcomplex"* %tmp.0.i23951, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i23957 = load double* %tmp.17.i23956 ; <double> [#uses=1]
- %tmp.4.i23931 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i23930, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i23933 = load double* %tmp.5.i34338 ; <double> [#uses=1]
- store double %tmp.6.i23933, double* %tmp.4.i23931
- %tmp.7.i23934 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i23930, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i23936 = load double* %tmp.8.i34341 ; <double> [#uses=1]
- store double %tmp.9.i23936, double* %tmp.7.i23934
- %tmp.0.i23937 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i23930, %"struct.std::dcomplex"* %tmp.226 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i23938 = getelementptr %"struct.std::dcomplex"* %mem_tmp.563, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i23939 = getelementptr %"struct.std::dcomplex"* %tmp.0.i23937, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i23940 = load double* %tmp.14.i23939 ; <double> [#uses=1]
- store double %tmp.15.i23940, double* %tmp.13.i23938
- %tmp.16.i23941 = getelementptr %"struct.std::dcomplex"* %mem_tmp.563, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i23942 = getelementptr %"struct.std::dcomplex"* %tmp.0.i23937, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i23943 = load double* %tmp.17.i23942 ; <double> [#uses=1]
- store double %tmp.18.i23943, double* %tmp.16.i23941
- %tmp.4.i23917 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i23916, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i23954, double* %tmp.4.i23917
- %tmp.7.i23920 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i23916, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i23957, double* %tmp.7.i23920
- %tmp.0.i23923 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i23916, %"struct.std::dcomplex"* %mem_tmp.563 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i23925 = getelementptr %"struct.std::dcomplex"* %tmp.0.i23923, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i23926 = load double* %tmp.14.i23925 ; <double> [#uses=1]
- %tmp.17.i23928 = getelementptr %"struct.std::dcomplex"* %tmp.0.i23923, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i23929 = load double* %tmp.17.i23928 ; <double> [#uses=1]
- %tmp.4.i23903 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i23902, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i23926, double* %tmp.4.i23903
- %tmp.7.i23906 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i23902, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i23929, double* %tmp.7.i23906
- %tmp.0.i23909 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i23902, %"struct.std::dcomplex"* %tmp.95 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i23910 = getelementptr %"struct.std::dcomplex"* %mem_tmp.560, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i23911 = getelementptr %"struct.std::dcomplex"* %tmp.0.i23909, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i23912 = load double* %tmp.14.i23911 ; <double> [#uses=1]
- store double %tmp.15.i23912, double* %tmp.13.i23910
- %tmp.16.i23913 = getelementptr %"struct.std::dcomplex"* %mem_tmp.560, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i23914 = getelementptr %"struct.std::dcomplex"* %tmp.0.i23909, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i23915 = load double* %tmp.17.i23914 ; <double> [#uses=1]
- store double %tmp.18.i23915, double* %tmp.16.i23913
- %tmp.4.i23889 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i23888, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i23968, double* %tmp.4.i23889
- %tmp.7.i23892 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i23888, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i23971, double* %tmp.7.i23892
- %tmp.0.i23895 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i23888, %"struct.std::dcomplex"* %mem_tmp.560 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i23897 = getelementptr %"struct.std::dcomplex"* %tmp.0.i23895, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i23898 = load double* %tmp.14.i23897 ; <double> [#uses=1]
- %tmp.17.i23900 = getelementptr %"struct.std::dcomplex"* %tmp.0.i23895, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i23901 = load double* %tmp.17.i23900 ; <double> [#uses=1]
- store double %tmp.15.i23898, double* %tmp.2.i34364
- store double %tmp.18.i23901, double* %tmp.6.i34365
- %tmp.4.i23855 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i23854, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i23857 = load double* %tmp.5.i27590 ; <double> [#uses=1]
- store double %tmp.6.i23857, double* %tmp.4.i23855
- %tmp.7.i23858 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i23854, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i23860 = load double* %tmp.8.i27593 ; <double> [#uses=1]
- store double %tmp.9.i23860, double* %tmp.7.i23858
- %tmp.0.i23861 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i23854, %"struct.std::dcomplex"* %ret3 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i23863 = getelementptr %"struct.std::dcomplex"* %tmp.0.i23861, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i23864 = load double* %tmp.14.i23863 ; <double> [#uses=1]
- %tmp.17.i23866 = getelementptr %"struct.std::dcomplex"* %tmp.0.i23861, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i23867 = load double* %tmp.17.i23866 ; <double> [#uses=1]
- %tmp.7.i23821 = load double* %tmp.2.i34366 ; <double> [#uses=1]
- %tmp.15.i23835 = add double %tmp.7.i23821, %tmp.15.i23864 ; <double> [#uses=1]
- store double %tmp.15.i23835, double* %tmp.2.i34366
- %tmp.26.i23842 = load double* %tmp.6.i34367 ; <double> [#uses=1]
- %tmp.31.i23853 = add double %tmp.26.i23842, %tmp.18.i23867 ; <double> [#uses=1]
- store double %tmp.31.i23853, double* %tmp.6.i34367
- %tmp.4.i23801 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i23800, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i23803 = load double* %tmp.5.i28602 ; <double> [#uses=1]
- store double %tmp.6.i23803, double* %tmp.4.i23801
- %tmp.7.i23804 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i23800, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i23806 = load double* %tmp.8.i28605 ; <double> [#uses=1]
- store double %tmp.9.i23806, double* %tmp.7.i23804
- %tmp.0.i23807 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i23800, %"struct.std::dcomplex"* %tmp.226 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i23809 = getelementptr %"struct.std::dcomplex"* %tmp.0.i23807, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i23810 = load double* %tmp.14.i23809 ; <double> [#uses=1]
- %tmp.17.i23812 = getelementptr %"struct.std::dcomplex"* %tmp.0.i23807, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i23813 = load double* %tmp.17.i23812 ; <double> [#uses=1]
- %tmp.4.i23787 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i23786, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i23789 = load double* %tmp.5.i33146 ; <double> [#uses=1]
- store double %tmp.6.i23789, double* %tmp.4.i23787
- %tmp.7.i23790 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i23786, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i23792 = load double* %tmp.8.i33149 ; <double> [#uses=1]
- store double %tmp.9.i23792, double* %tmp.7.i23790
- %tmp.0.i23793 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i23786, %"struct.std::dcomplex"* %tmp.1036 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i23794 = getelementptr %"struct.std::dcomplex"* %mem_tmp.570, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i23795 = getelementptr %"struct.std::dcomplex"* %tmp.0.i23793, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i23796 = load double* %tmp.14.i23795 ; <double> [#uses=1]
- store double %tmp.15.i23796, double* %tmp.13.i23794
- %tmp.16.i23797 = getelementptr %"struct.std::dcomplex"* %mem_tmp.570, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i23798 = getelementptr %"struct.std::dcomplex"* %tmp.0.i23793, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i23799 = load double* %tmp.17.i23798 ; <double> [#uses=1]
- store double %tmp.18.i23799, double* %tmp.16.i23797
- %tmp.4.i23773 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i23772, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i23810, double* %tmp.4.i23773
- %tmp.7.i23776 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i23772, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i23813, double* %tmp.7.i23776
- %tmp.0.i23779 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i23772, %"struct.std::dcomplex"* %mem_tmp.570 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i23781 = getelementptr %"struct.std::dcomplex"* %tmp.0.i23779, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i23782 = load double* %tmp.14.i23781 ; <double> [#uses=1]
- %tmp.17.i23784 = getelementptr %"struct.std::dcomplex"* %tmp.0.i23779, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i23785 = load double* %tmp.17.i23784 ; <double> [#uses=1]
- %tmp.4.i23759 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i23758, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i23782, double* %tmp.4.i23759
- %tmp.7.i23762 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i23758, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i23785, double* %tmp.7.i23762
- %tmp.0.i23765 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i23758, %"struct.std::dcomplex"* %tmp.95 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i23767 = getelementptr %"struct.std::dcomplex"* %tmp.0.i23765, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i23768 = load double* %tmp.14.i23767 ; <double> [#uses=1]
- %tmp.17.i23770 = getelementptr %"struct.std::dcomplex"* %tmp.0.i23765, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i23771 = load double* %tmp.17.i23770 ; <double> [#uses=1]
- %tmp.4.i23745 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i23744, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i23747 = load double* %tmp.5.i34082 ; <double> [#uses=1]
- store double %tmp.6.i23747, double* %tmp.4.i23745
- %tmp.7.i23748 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i23744, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i23750 = load double* %tmp.8.i34085 ; <double> [#uses=1]
- store double %tmp.9.i23750, double* %tmp.7.i23748
- %tmp.0.i23751 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i23744, %"struct.std::dcomplex"* %tmp.1036 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i23753 = getelementptr %"struct.std::dcomplex"* %tmp.0.i23751, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i23754 = load double* %tmp.14.i23753 ; <double> [#uses=1]
- %tmp.17.i23756 = getelementptr %"struct.std::dcomplex"* %tmp.0.i23751, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i23757 = load double* %tmp.17.i23756 ; <double> [#uses=1]
- %tmp.4.i23731 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i23730, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i23733 = load double* %tmp.5.i28602 ; <double> [#uses=1]
- store double %tmp.6.i23733, double* %tmp.4.i23731
- %tmp.7.i23734 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i23730, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i23736 = load double* %tmp.8.i28605 ; <double> [#uses=1]
- store double %tmp.9.i23736, double* %tmp.7.i23734
- %tmp.0.i23737 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i23730, %"struct.std::dcomplex"* %tmp.62 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i23738 = getelementptr %"struct.std::dcomplex"* %mem_tmp.574, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i23739 = getelementptr %"struct.std::dcomplex"* %tmp.0.i23737, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i23740 = load double* %tmp.14.i23739 ; <double> [#uses=1]
- store double %tmp.15.i23740, double* %tmp.13.i23738
- %tmp.16.i23741 = getelementptr %"struct.std::dcomplex"* %mem_tmp.574, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i23742 = getelementptr %"struct.std::dcomplex"* %tmp.0.i23737, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i23743 = load double* %tmp.17.i23742 ; <double> [#uses=1]
- store double %tmp.18.i23743, double* %tmp.16.i23741
- %tmp.4.i23717 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i23716, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i23754, double* %tmp.4.i23717
- %tmp.7.i23720 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i23716, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i23757, double* %tmp.7.i23720
- %tmp.0.i23723 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i23716, %"struct.std::dcomplex"* %mem_tmp.574 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i23725 = getelementptr %"struct.std::dcomplex"* %tmp.0.i23723, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i23726 = load double* %tmp.14.i23725 ; <double> [#uses=1]
- %tmp.17.i23728 = getelementptr %"struct.std::dcomplex"* %tmp.0.i23723, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i23729 = load double* %tmp.17.i23728 ; <double> [#uses=1]
- %tmp.4.i23703 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i23702, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i23726, double* %tmp.4.i23703
- %tmp.7.i23706 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i23702, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i23729, double* %tmp.7.i23706
- %tmp.0.i23709 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i23702, %"struct.std::dcomplex"* %tmp.220 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i23710 = getelementptr %"struct.std::dcomplex"* %mem_tmp.571, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i23711 = getelementptr %"struct.std::dcomplex"* %tmp.0.i23709, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i23712 = load double* %tmp.14.i23711 ; <double> [#uses=1]
- store double %tmp.15.i23712, double* %tmp.13.i23710
- %tmp.16.i23713 = getelementptr %"struct.std::dcomplex"* %mem_tmp.571, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i23714 = getelementptr %"struct.std::dcomplex"* %tmp.0.i23709, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i23715 = load double* %tmp.17.i23714 ; <double> [#uses=1]
- store double %tmp.18.i23715, double* %tmp.16.i23713
- %tmp.4.i23689 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i23688, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i23768, double* %tmp.4.i23689
- %tmp.7.i23692 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i23688, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i23771, double* %tmp.7.i23692
- %tmp.0.i23695 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i23688, %"struct.std::dcomplex"* %mem_tmp.571 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i23697 = getelementptr %"struct.std::dcomplex"* %tmp.0.i23695, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i23698 = load double* %tmp.14.i23697 ; <double> [#uses=1]
- %tmp.17.i23700 = getelementptr %"struct.std::dcomplex"* %tmp.0.i23695, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i23701 = load double* %tmp.17.i23700 ; <double> [#uses=1]
- %tmp.4.i23675 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i23674, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i23677 = load double* %tmp.5.i33146 ; <double> [#uses=1]
- store double %tmp.6.i23677, double* %tmp.4.i23675
- %tmp.7.i23678 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i23674, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i23680 = load double* %tmp.8.i33149 ; <double> [#uses=1]
- store double %tmp.9.i23680, double* %tmp.7.i23678
- %tmp.0.i23681 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i23674, %"struct.std::dcomplex"* %tmp.62 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i23683 = getelementptr %"struct.std::dcomplex"* %tmp.0.i23681, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i23684 = load double* %tmp.14.i23683 ; <double> [#uses=1]
- %tmp.17.i23686 = getelementptr %"struct.std::dcomplex"* %tmp.0.i23681, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i23687 = load double* %tmp.17.i23686 ; <double> [#uses=1]
- %tmp.4.i23661 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i23660, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i23663 = load double* %tmp.5.i34082 ; <double> [#uses=1]
- store double %tmp.6.i23663, double* %tmp.4.i23661
- %tmp.7.i23664 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i23660, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i23666 = load double* %tmp.8.i34085 ; <double> [#uses=1]
- store double %tmp.9.i23666, double* %tmp.7.i23664
- %tmp.0.i23667 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i23660, %"struct.std::dcomplex"* %tmp.226 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i23668 = getelementptr %"struct.std::dcomplex"* %mem_tmp.578, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i23669 = getelementptr %"struct.std::dcomplex"* %tmp.0.i23667, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i23670 = load double* %tmp.14.i23669 ; <double> [#uses=1]
- store double %tmp.15.i23670, double* %tmp.13.i23668
- %tmp.16.i23671 = getelementptr %"struct.std::dcomplex"* %mem_tmp.578, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i23672 = getelementptr %"struct.std::dcomplex"* %tmp.0.i23667, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i23673 = load double* %tmp.17.i23672 ; <double> [#uses=1]
- store double %tmp.18.i23673, double* %tmp.16.i23671
- %tmp.4.i23647 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i23646, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i23684, double* %tmp.4.i23647
- %tmp.7.i23650 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i23646, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i23687, double* %tmp.7.i23650
- %tmp.0.i23653 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i23646, %"struct.std::dcomplex"* %mem_tmp.578 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i23655 = getelementptr %"struct.std::dcomplex"* %tmp.0.i23653, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i23656 = load double* %tmp.14.i23655 ; <double> [#uses=1]
- %tmp.17.i23658 = getelementptr %"struct.std::dcomplex"* %tmp.0.i23653, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i23659 = load double* %tmp.17.i23658 ; <double> [#uses=1]
- %tmp.4.i23633 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i23632, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i23656, double* %tmp.4.i23633
- %tmp.7.i23636 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i23632, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i23659, double* %tmp.7.i23636
- %tmp.0.i23639 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i23632, %"struct.std::dcomplex"* %tmp.1075 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i23640 = getelementptr %"struct.std::dcomplex"* %mem_tmp.575, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i23641 = getelementptr %"struct.std::dcomplex"* %tmp.0.i23639, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i23642 = load double* %tmp.14.i23641 ; <double> [#uses=1]
- store double %tmp.15.i23642, double* %tmp.13.i23640
- %tmp.16.i23643 = getelementptr %"struct.std::dcomplex"* %mem_tmp.575, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i23644 = getelementptr %"struct.std::dcomplex"* %tmp.0.i23639, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i23645 = load double* %tmp.17.i23644 ; <double> [#uses=1]
- store double %tmp.18.i23645, double* %tmp.16.i23643
- %tmp.4.i23619 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i23618, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i23698, double* %tmp.4.i23619
- %tmp.7.i23622 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i23618, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i23701, double* %tmp.7.i23622
- %tmp.0.i23625 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i23618, %"struct.std::dcomplex"* %mem_tmp.575 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i23627 = getelementptr %"struct.std::dcomplex"* %tmp.0.i23625, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i23628 = load double* %tmp.14.i23627 ; <double> [#uses=1]
- %tmp.17.i23630 = getelementptr %"struct.std::dcomplex"* %tmp.0.i23625, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i23631 = load double* %tmp.17.i23630 ; <double> [#uses=1]
- store double %tmp.15.i23628, double* %tmp.2.i34364
- store double %tmp.18.i23631, double* %tmp.6.i34365
- %tmp.4.i23585 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i23584, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i23587 = load double* %tmp.5.i33596 ; <double> [#uses=1]
- store double %tmp.6.i23587, double* %tmp.4.i23585
- %tmp.7.i23588 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i23584, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i23590 = load double* %tmp.8.i33599 ; <double> [#uses=1]
- store double %tmp.9.i23590, double* %tmp.7.i23588
- %tmp.0.i23591 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i23584, %"struct.std::dcomplex"* %ret3 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i23593 = getelementptr %"struct.std::dcomplex"* %tmp.0.i23591, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i23594 = load double* %tmp.14.i23593 ; <double> [#uses=1]
- %tmp.17.i23596 = getelementptr %"struct.std::dcomplex"* %tmp.0.i23591, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i23597 = load double* %tmp.17.i23596 ; <double> [#uses=1]
- %tmp.7.i23551 = load double* %tmp.2.i34366 ; <double> [#uses=1]
- %tmp.15.i23565 = add double %tmp.7.i23551, %tmp.15.i23594 ; <double> [#uses=1]
- store double %tmp.15.i23565, double* %tmp.2.i34366
- %tmp.26.i23572 = load double* %tmp.6.i34367 ; <double> [#uses=1]
- %tmp.31.i23583 = add double %tmp.26.i23572, %tmp.18.i23597 ; <double> [#uses=1]
- store double %tmp.31.i23583, double* %tmp.6.i34367
- %tmp.4.i23531 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i23530, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i23533 = load double* %tmp.5.i34338 ; <double> [#uses=1]
- store double %tmp.6.i23533, double* %tmp.4.i23531
- %tmp.7.i23534 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i23530, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i23536 = load double* %tmp.8.i34341 ; <double> [#uses=1]
- store double %tmp.9.i23536, double* %tmp.7.i23534
- %tmp.0.i23537 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i23530, %"struct.std::dcomplex"* %tmp.226 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i23539 = getelementptr %"struct.std::dcomplex"* %tmp.0.i23537, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i23540 = load double* %tmp.14.i23539 ; <double> [#uses=1]
- %tmp.17.i23542 = getelementptr %"struct.std::dcomplex"* %tmp.0.i23537, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i23543 = load double* %tmp.17.i23542 ; <double> [#uses=1]
- %tmp.4.i23517 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i23516, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i23519 = load double* %tmp.5.i33146 ; <double> [#uses=1]
- store double %tmp.6.i23519, double* %tmp.4.i23517
- %tmp.7.i23520 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i23516, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i23522 = load double* %tmp.8.i33149 ; <double> [#uses=1]
- store double %tmp.9.i23522, double* %tmp.7.i23520
- %tmp.0.i23523 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i23516, %"struct.std::dcomplex"* %tmp.6 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i23524 = getelementptr %"struct.std::dcomplex"* %mem_tmp.585, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i23525 = getelementptr %"struct.std::dcomplex"* %tmp.0.i23523, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i23526 = load double* %tmp.14.i23525 ; <double> [#uses=1]
- store double %tmp.15.i23526, double* %tmp.13.i23524
- %tmp.16.i23527 = getelementptr %"struct.std::dcomplex"* %mem_tmp.585, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i23528 = getelementptr %"struct.std::dcomplex"* %tmp.0.i23523, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i23529 = load double* %tmp.17.i23528 ; <double> [#uses=1]
- store double %tmp.18.i23529, double* %tmp.16.i23527
- %tmp.4.i23503 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i23502, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i23540, double* %tmp.4.i23503
- %tmp.7.i23506 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i23502, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i23543, double* %tmp.7.i23506
- %tmp.0.i23509 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i23502, %"struct.std::dcomplex"* %mem_tmp.585 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i23511 = getelementptr %"struct.std::dcomplex"* %tmp.0.i23509, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i23512 = load double* %tmp.14.i23511 ; <double> [#uses=1]
- %tmp.17.i23514 = getelementptr %"struct.std::dcomplex"* %tmp.0.i23509, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i23515 = load double* %tmp.17.i23514 ; <double> [#uses=1]
- %tmp.4.i23489 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i23488, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i23512, double* %tmp.4.i23489
- %tmp.7.i23492 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i23488, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i23515, double* %tmp.7.i23492
- %tmp.0.i23495 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i23488, %"struct.std::dcomplex"* %tmp.1075 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i23497 = getelementptr %"struct.std::dcomplex"* %tmp.0.i23495, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i23498 = load double* %tmp.14.i23497 ; <double> [#uses=1]
- %tmp.17.i23500 = getelementptr %"struct.std::dcomplex"* %tmp.0.i23495, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i23501 = load double* %tmp.17.i23500 ; <double> [#uses=1]
- %tmp.4.i23475 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i23474, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i23477 = load double* %tmp.5.i33146 ; <double> [#uses=1]
- store double %tmp.6.i23477, double* %tmp.4.i23475
- %tmp.7.i23478 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i23474, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i23480 = load double* %tmp.8.i33149 ; <double> [#uses=1]
- store double %tmp.9.i23480, double* %tmp.7.i23478
- %tmp.0.i23481 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i23474, %"struct.std::dcomplex"* %tmp.1036 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i23483 = getelementptr %"struct.std::dcomplex"* %tmp.0.i23481, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i23484 = load double* %tmp.14.i23483 ; <double> [#uses=1]
- %tmp.17.i23486 = getelementptr %"struct.std::dcomplex"* %tmp.0.i23481, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i23487 = load double* %tmp.17.i23486 ; <double> [#uses=1]
- %tmp.4.i23461 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i23460, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i23463 = load double* %tmp.5.i28602 ; <double> [#uses=1]
- store double %tmp.6.i23463, double* %tmp.4.i23461
- %tmp.7.i23464 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i23460, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i23466 = load double* %tmp.8.i28605 ; <double> [#uses=1]
- store double %tmp.9.i23466, double* %tmp.7.i23464
- %tmp.0.i23467 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i23460, %"struct.std::dcomplex"* %tmp.226 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i23468 = getelementptr %"struct.std::dcomplex"* %mem_tmp.589, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i23469 = getelementptr %"struct.std::dcomplex"* %tmp.0.i23467, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i23470 = load double* %tmp.14.i23469 ; <double> [#uses=1]
- store double %tmp.15.i23470, double* %tmp.13.i23468
- %tmp.16.i23471 = getelementptr %"struct.std::dcomplex"* %mem_tmp.589, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i23472 = getelementptr %"struct.std::dcomplex"* %tmp.0.i23467, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i23473 = load double* %tmp.17.i23472 ; <double> [#uses=1]
- store double %tmp.18.i23473, double* %tmp.16.i23471
- %tmp.4.i23447 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i23446, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i23484, double* %tmp.4.i23447
- %tmp.7.i23450 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i23446, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i23487, double* %tmp.7.i23450
- %tmp.0.i23453 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i23446, %"struct.std::dcomplex"* %mem_tmp.589 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i23455 = getelementptr %"struct.std::dcomplex"* %tmp.0.i23453, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i23456 = load double* %tmp.14.i23455 ; <double> [#uses=1]
- %tmp.17.i23458 = getelementptr %"struct.std::dcomplex"* %tmp.0.i23453, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i23459 = load double* %tmp.17.i23458 ; <double> [#uses=1]
- %tmp.4.i23433 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i23432, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i23456, double* %tmp.4.i23433
- %tmp.7.i23436 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i23432, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i23459, double* %tmp.7.i23436
- %tmp.0.i23439 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i23432, %"struct.std::dcomplex"* %tmp.45 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i23440 = getelementptr %"struct.std::dcomplex"* %mem_tmp.586, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i23441 = getelementptr %"struct.std::dcomplex"* %tmp.0.i23439, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i23442 = load double* %tmp.14.i23441 ; <double> [#uses=1]
- store double %tmp.15.i23442, double* %tmp.13.i23440
- %tmp.16.i23443 = getelementptr %"struct.std::dcomplex"* %mem_tmp.586, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i23444 = getelementptr %"struct.std::dcomplex"* %tmp.0.i23439, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i23445 = load double* %tmp.17.i23444 ; <double> [#uses=1]
- store double %tmp.18.i23445, double* %tmp.16.i23443
- %tmp.4.i23419 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i23418, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i23498, double* %tmp.4.i23419
- %tmp.7.i23422 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i23418, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i23501, double* %tmp.7.i23422
- %tmp.0.i23425 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i23418, %"struct.std::dcomplex"* %mem_tmp.586 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i23427 = getelementptr %"struct.std::dcomplex"* %tmp.0.i23425, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i23428 = load double* %tmp.14.i23427 ; <double> [#uses=1]
- %tmp.17.i23430 = getelementptr %"struct.std::dcomplex"* %tmp.0.i23425, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i23431 = load double* %tmp.17.i23430 ; <double> [#uses=1]
- %tmp.4.i23405 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i23404, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i23407 = load double* %tmp.5.i28602 ; <double> [#uses=1]
- store double %tmp.6.i23407, double* %tmp.4.i23405
- %tmp.7.i23408 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i23404, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i23410 = load double* %tmp.8.i28605 ; <double> [#uses=1]
- store double %tmp.9.i23410, double* %tmp.7.i23408
- %tmp.0.i23411 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i23404, %"struct.std::dcomplex"* %tmp.6 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i23413 = getelementptr %"struct.std::dcomplex"* %tmp.0.i23411, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i23414 = load double* %tmp.14.i23413 ; <double> [#uses=1]
- %tmp.17.i23416 = getelementptr %"struct.std::dcomplex"* %tmp.0.i23411, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i23417 = load double* %tmp.17.i23416 ; <double> [#uses=1]
- %tmp.4.i23391 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i23390, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i23393 = load double* %tmp.5.i34338 ; <double> [#uses=1]
- store double %tmp.6.i23393, double* %tmp.4.i23391
- %tmp.7.i23394 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i23390, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i23396 = load double* %tmp.8.i34341 ; <double> [#uses=1]
- store double %tmp.9.i23396, double* %tmp.7.i23394
- %tmp.0.i23397 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i23390, %"struct.std::dcomplex"* %tmp.1036 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i23398 = getelementptr %"struct.std::dcomplex"* %mem_tmp.593, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i23399 = getelementptr %"struct.std::dcomplex"* %tmp.0.i23397, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i23400 = load double* %tmp.14.i23399 ; <double> [#uses=1]
- store double %tmp.15.i23400, double* %tmp.13.i23398
- %tmp.16.i23401 = getelementptr %"struct.std::dcomplex"* %mem_tmp.593, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i23402 = getelementptr %"struct.std::dcomplex"* %tmp.0.i23397, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i23403 = load double* %tmp.17.i23402 ; <double> [#uses=1]
- store double %tmp.18.i23403, double* %tmp.16.i23401
- %tmp.4.i23377 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i23376, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i23414, double* %tmp.4.i23377
- %tmp.7.i23380 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i23376, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i23417, double* %tmp.7.i23380
- %tmp.0.i23383 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i23376, %"struct.std::dcomplex"* %mem_tmp.593 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i23385 = getelementptr %"struct.std::dcomplex"* %tmp.0.i23383, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i23386 = load double* %tmp.14.i23385 ; <double> [#uses=1]
- %tmp.17.i23388 = getelementptr %"struct.std::dcomplex"* %tmp.0.i23383, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i23389 = load double* %tmp.17.i23388 ; <double> [#uses=1]
- %tmp.4.i23363 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i23362, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i23386, double* %tmp.4.i23363
- %tmp.7.i23366 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i23362, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i23389, double* %tmp.7.i23366
- %tmp.0.i23369 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i23362, %"struct.std::dcomplex"* %tmp.220 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i23370 = getelementptr %"struct.std::dcomplex"* %mem_tmp.590, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i23371 = getelementptr %"struct.std::dcomplex"* %tmp.0.i23369, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i23372 = load double* %tmp.14.i23371 ; <double> [#uses=1]
- store double %tmp.15.i23372, double* %tmp.13.i23370
- %tmp.16.i23373 = getelementptr %"struct.std::dcomplex"* %mem_tmp.590, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i23374 = getelementptr %"struct.std::dcomplex"* %tmp.0.i23369, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i23375 = load double* %tmp.17.i23374 ; <double> [#uses=1]
- store double %tmp.18.i23375, double* %tmp.16.i23373
- %tmp.4.i23349 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i23348, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i23428, double* %tmp.4.i23349
- %tmp.7.i23352 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i23348, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i23431, double* %tmp.7.i23352
- %tmp.0.i23355 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i23348, %"struct.std::dcomplex"* %mem_tmp.590 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i23357 = getelementptr %"struct.std::dcomplex"* %tmp.0.i23355, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i23358 = load double* %tmp.14.i23357 ; <double> [#uses=1]
- %tmp.17.i23360 = getelementptr %"struct.std::dcomplex"* %tmp.0.i23355, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i23361 = load double* %tmp.17.i23360 ; <double> [#uses=1]
- store double %tmp.15.i23358, double* %tmp.2.i34364
- store double %tmp.18.i23361, double* %tmp.6.i34365
- %tmp.4.i23315 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i23314, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i23317 = load double* %tmp.5.i34136 ; <double> [#uses=1]
- store double %tmp.6.i23317, double* %tmp.4.i23315
- %tmp.7.i23318 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i23314, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i23320 = load double* %tmp.8.i34139 ; <double> [#uses=1]
- store double %tmp.9.i23320, double* %tmp.7.i23318
- %tmp.0.i23321 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i23314, %"struct.std::dcomplex"* %ret3 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i23323 = getelementptr %"struct.std::dcomplex"* %tmp.0.i23321, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i23324 = load double* %tmp.14.i23323 ; <double> [#uses=1]
- %tmp.17.i23326 = getelementptr %"struct.std::dcomplex"* %tmp.0.i23321, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i23327 = load double* %tmp.17.i23326 ; <double> [#uses=1]
- %tmp.7.i23281 = load double* %tmp.2.i34366 ; <double> [#uses=1]
- %tmp.15.i23295 = add double %tmp.7.i23281, %tmp.15.i23324 ; <double> [#uses=1]
- store double %tmp.15.i23295, double* %tmp.2.i34366
- %tmp.26.i23302 = load double* %tmp.6.i34367 ; <double> [#uses=1]
- %tmp.31.i23313 = add double %tmp.26.i23302, %tmp.18.i23327 ; <double> [#uses=1]
- store double %tmp.31.i23313, double* %tmp.6.i34367
- %tmp.4.i23261 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i23260, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i23263 = load double* %tmp.5.i34338 ; <double> [#uses=1]
- store double %tmp.6.i23263, double* %tmp.4.i23261
- %tmp.7.i23264 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i23260, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i23266 = load double* %tmp.8.i34341 ; <double> [#uses=1]
- store double %tmp.9.i23266, double* %tmp.7.i23264
- %tmp.0.i23267 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i23260, %"struct.std::dcomplex"* %tmp.1036 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i23269 = getelementptr %"struct.std::dcomplex"* %tmp.0.i23267, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i23270 = load double* %tmp.14.i23269 ; <double> [#uses=1]
- %tmp.17.i23272 = getelementptr %"struct.std::dcomplex"* %tmp.0.i23267, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i23273 = load double* %tmp.17.i23272 ; <double> [#uses=1]
- %tmp.4.i23247 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i23246, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i23249 = load double* %tmp.5.i28602 ; <double> [#uses=1]
- store double %tmp.6.i23249, double* %tmp.4.i23247
- %tmp.7.i23250 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i23246, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i23252 = load double* %tmp.8.i28605 ; <double> [#uses=1]
- store double %tmp.9.i23252, double* %tmp.7.i23250
- %tmp.0.i23253 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i23246, %"struct.std::dcomplex"* %tmp.6 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i23254 = getelementptr %"struct.std::dcomplex"* %mem_tmp.600, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i23255 = getelementptr %"struct.std::dcomplex"* %tmp.0.i23253, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i23256 = load double* %tmp.14.i23255 ; <double> [#uses=1]
- store double %tmp.15.i23256, double* %tmp.13.i23254
- %tmp.16.i23257 = getelementptr %"struct.std::dcomplex"* %mem_tmp.600, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i23258 = getelementptr %"struct.std::dcomplex"* %tmp.0.i23253, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i23259 = load double* %tmp.17.i23258 ; <double> [#uses=1]
- store double %tmp.18.i23259, double* %tmp.16.i23257
- %tmp.4.i23233 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i23232, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i23270, double* %tmp.4.i23233
- %tmp.7.i23236 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i23232, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i23273, double* %tmp.7.i23236
- %tmp.0.i23239 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i23232, %"struct.std::dcomplex"* %mem_tmp.600 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i23241 = getelementptr %"struct.std::dcomplex"* %tmp.0.i23239, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i23242 = load double* %tmp.14.i23241 ; <double> [#uses=1]
- %tmp.17.i23244 = getelementptr %"struct.std::dcomplex"* %tmp.0.i23239, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i23245 = load double* %tmp.17.i23244 ; <double> [#uses=1]
- %tmp.4.i23219 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i23218, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i23242, double* %tmp.4.i23219
- %tmp.7.i23222 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i23218, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i23245, double* %tmp.7.i23222
- %tmp.0.i23225 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i23218, %"struct.std::dcomplex"* %tmp.95 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i23227 = getelementptr %"struct.std::dcomplex"* %tmp.0.i23225, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i23228 = load double* %tmp.14.i23227 ; <double> [#uses=1]
- %tmp.17.i23230 = getelementptr %"struct.std::dcomplex"* %tmp.0.i23225, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i23231 = load double* %tmp.17.i23230 ; <double> [#uses=1]
- %tmp.4.i23205 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i23204, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i23207 = load double* %tmp.5.i34082 ; <double> [#uses=1]
- store double %tmp.6.i23207, double* %tmp.4.i23205
- %tmp.7.i23208 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i23204, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i23210 = load double* %tmp.8.i34085 ; <double> [#uses=1]
- store double %tmp.9.i23210, double* %tmp.7.i23208
- %tmp.0.i23211 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i23204, %"struct.std::dcomplex"* %tmp.6 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i23213 = getelementptr %"struct.std::dcomplex"* %tmp.0.i23211, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i23214 = load double* %tmp.14.i23213 ; <double> [#uses=1]
- %tmp.17.i23216 = getelementptr %"struct.std::dcomplex"* %tmp.0.i23211, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i23217 = load double* %tmp.17.i23216 ; <double> [#uses=1]
- %tmp.4.i23191 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i23190, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i23193 = load double* %tmp.5.i34338 ; <double> [#uses=1]
- store double %tmp.6.i23193, double* %tmp.4.i23191
- %tmp.7.i23194 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i23190, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i23196 = load double* %tmp.8.i34341 ; <double> [#uses=1]
- store double %tmp.9.i23196, double* %tmp.7.i23194
- %tmp.0.i23197 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i23190, %"struct.std::dcomplex"* %tmp.62 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i23198 = getelementptr %"struct.std::dcomplex"* %mem_tmp.604, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i23199 = getelementptr %"struct.std::dcomplex"* %tmp.0.i23197, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i23200 = load double* %tmp.14.i23199 ; <double> [#uses=1]
- store double %tmp.15.i23200, double* %tmp.13.i23198
- %tmp.16.i23201 = getelementptr %"struct.std::dcomplex"* %mem_tmp.604, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i23202 = getelementptr %"struct.std::dcomplex"* %tmp.0.i23197, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i23203 = load double* %tmp.17.i23202 ; <double> [#uses=1]
- store double %tmp.18.i23203, double* %tmp.16.i23201
- %tmp.4.i23177 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i23176, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i23214, double* %tmp.4.i23177
- %tmp.7.i23180 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i23176, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i23217, double* %tmp.7.i23180
- %tmp.0.i23183 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i23176, %"struct.std::dcomplex"* %mem_tmp.604 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i23185 = getelementptr %"struct.std::dcomplex"* %tmp.0.i23183, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i23186 = load double* %tmp.14.i23185 ; <double> [#uses=1]
- %tmp.17.i23188 = getelementptr %"struct.std::dcomplex"* %tmp.0.i23183, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i23189 = load double* %tmp.17.i23188 ; <double> [#uses=1]
- %tmp.4.i23163 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i23162, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i23186, double* %tmp.4.i23163
- %tmp.7.i23166 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i23162, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i23189, double* %tmp.7.i23166
- %tmp.0.i23169 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i23162, %"struct.std::dcomplex"* %tmp.1075 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i23170 = getelementptr %"struct.std::dcomplex"* %mem_tmp.601, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i23171 = getelementptr %"struct.std::dcomplex"* %tmp.0.i23169, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i23172 = load double* %tmp.14.i23171 ; <double> [#uses=1]
- store double %tmp.15.i23172, double* %tmp.13.i23170
- %tmp.16.i23173 = getelementptr %"struct.std::dcomplex"* %mem_tmp.601, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i23174 = getelementptr %"struct.std::dcomplex"* %tmp.0.i23169, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i23175 = load double* %tmp.17.i23174 ; <double> [#uses=1]
- store double %tmp.18.i23175, double* %tmp.16.i23173
- %tmp.4.i23149 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i23148, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i23228, double* %tmp.4.i23149
- %tmp.7.i23152 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i23148, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i23231, double* %tmp.7.i23152
- %tmp.0.i23155 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i23148, %"struct.std::dcomplex"* %mem_tmp.601 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i23157 = getelementptr %"struct.std::dcomplex"* %tmp.0.i23155, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i23158 = load double* %tmp.14.i23157 ; <double> [#uses=1]
- %tmp.17.i23160 = getelementptr %"struct.std::dcomplex"* %tmp.0.i23155, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i23161 = load double* %tmp.17.i23160 ; <double> [#uses=1]
- %tmp.4.i23135 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i23134, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i23137 = load double* %tmp.5.i28602 ; <double> [#uses=1]
- store double %tmp.6.i23137, double* %tmp.4.i23135
- %tmp.7.i23138 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i23134, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i23140 = load double* %tmp.8.i28605 ; <double> [#uses=1]
- store double %tmp.9.i23140, double* %tmp.7.i23138
- %tmp.0.i23141 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i23134, %"struct.std::dcomplex"* %tmp.62 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i23143 = getelementptr %"struct.std::dcomplex"* %tmp.0.i23141, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i23144 = load double* %tmp.14.i23143 ; <double> [#uses=1]
- %tmp.17.i23146 = getelementptr %"struct.std::dcomplex"* %tmp.0.i23141, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i23147 = load double* %tmp.17.i23146 ; <double> [#uses=1]
- %tmp.4.i23121 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i23120, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i23123 = load double* %tmp.5.i34082 ; <double> [#uses=1]
- store double %tmp.6.i23123, double* %tmp.4.i23121
- %tmp.7.i23124 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i23120, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i23126 = load double* %tmp.8.i34085 ; <double> [#uses=1]
- store double %tmp.9.i23126, double* %tmp.7.i23124
- %tmp.0.i23127 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i23120, %"struct.std::dcomplex"* %tmp.1036 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i23128 = getelementptr %"struct.std::dcomplex"* %mem_tmp.608, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i23129 = getelementptr %"struct.std::dcomplex"* %tmp.0.i23127, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i23130 = load double* %tmp.14.i23129 ; <double> [#uses=1]
- store double %tmp.15.i23130, double* %tmp.13.i23128
- %tmp.16.i23131 = getelementptr %"struct.std::dcomplex"* %mem_tmp.608, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i23132 = getelementptr %"struct.std::dcomplex"* %tmp.0.i23127, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i23133 = load double* %tmp.17.i23132 ; <double> [#uses=1]
- store double %tmp.18.i23133, double* %tmp.16.i23131
- %tmp.4.i23107 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i23106, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i23144, double* %tmp.4.i23107
- %tmp.7.i23110 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i23106, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i23147, double* %tmp.7.i23110
- %tmp.0.i23113 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i23106, %"struct.std::dcomplex"* %mem_tmp.608 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i23115 = getelementptr %"struct.std::dcomplex"* %tmp.0.i23113, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i23116 = load double* %tmp.14.i23115 ; <double> [#uses=1]
- %tmp.17.i23118 = getelementptr %"struct.std::dcomplex"* %tmp.0.i23113, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i23119 = load double* %tmp.17.i23118 ; <double> [#uses=1]
- %tmp.4.i23093 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i23092, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i23116, double* %tmp.4.i23093
- %tmp.7.i23096 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i23092, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i23119, double* %tmp.7.i23096
- %tmp.0.i23099 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i23092, %"struct.std::dcomplex"* %tmp.45 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i23100 = getelementptr %"struct.std::dcomplex"* %mem_tmp.605, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i23101 = getelementptr %"struct.std::dcomplex"* %tmp.0.i23099, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i23102 = load double* %tmp.14.i23101 ; <double> [#uses=1]
- store double %tmp.15.i23102, double* %tmp.13.i23100
- %tmp.16.i23103 = getelementptr %"struct.std::dcomplex"* %mem_tmp.605, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i23104 = getelementptr %"struct.std::dcomplex"* %tmp.0.i23099, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i23105 = load double* %tmp.17.i23104 ; <double> [#uses=1]
- store double %tmp.18.i23105, double* %tmp.16.i23103
- %tmp.4.i23079 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i23078, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i23158, double* %tmp.4.i23079
- %tmp.7.i23082 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i23078, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i23161, double* %tmp.7.i23082
- %tmp.0.i23085 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i23078, %"struct.std::dcomplex"* %mem_tmp.605 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i23087 = getelementptr %"struct.std::dcomplex"* %tmp.0.i23085, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i23088 = load double* %tmp.14.i23087 ; <double> [#uses=1]
- %tmp.17.i23090 = getelementptr %"struct.std::dcomplex"* %tmp.0.i23085, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i23091 = load double* %tmp.17.i23090 ; <double> [#uses=1]
- store double %tmp.15.i23088, double* %tmp.2.i34364
- store double %tmp.18.i23091, double* %tmp.6.i34365
- %tmp.4.i23045 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i23044, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i23047 = load double* %tmp.5.i32460 ; <double> [#uses=1]
- store double %tmp.6.i23047, double* %tmp.4.i23045
- %tmp.7.i23048 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i23044, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i23050 = load double* %tmp.8.i32463 ; <double> [#uses=1]
- store double %tmp.9.i23050, double* %tmp.7.i23048
- %tmp.0.i23051 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i23044, %"struct.std::dcomplex"* %ret3 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i23053 = getelementptr %"struct.std::dcomplex"* %tmp.0.i23051, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i23054 = load double* %tmp.14.i23053 ; <double> [#uses=1]
- %tmp.17.i23056 = getelementptr %"struct.std::dcomplex"* %tmp.0.i23051, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i23057 = load double* %tmp.17.i23056 ; <double> [#uses=1]
- %tmp.7.i23011 = load double* %tmp.2.i34366 ; <double> [#uses=1]
- %tmp.15.i23025 = add double %tmp.7.i23011, %tmp.15.i23054 ; <double> [#uses=1]
- store double %tmp.15.i23025, double* %tmp.2.i34366
- %tmp.26.i23032 = load double* %tmp.6.i34367 ; <double> [#uses=1]
- %tmp.31.i23043 = add double %tmp.26.i23032, %tmp.18.i23057 ; <double> [#uses=1]
- store double %tmp.31.i23043, double* %tmp.6.i34367
- %tmp.4.i22991 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i22990, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i22993 = load double* %tmp.5.i29864 ; <double> [#uses=1]
- store double %tmp.6.i22993, double* %tmp.4.i22991
- %tmp.7.i22994 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i22990, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i22996 = load double* %tmp.8.i29867 ; <double> [#uses=1]
- store double %tmp.9.i22996, double* %tmp.7.i22994
- %tmp.0.i22997 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i22990, %"struct.std::dcomplex"* %ret4 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i22999 = getelementptr %"struct.std::dcomplex"* %tmp.0.i22997, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i23000 = load double* %tmp.14.i22999 ; <double> [#uses=1]
- %tmp.17.i23002 = getelementptr %"struct.std::dcomplex"* %tmp.0.i22997, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i23003 = load double* %tmp.17.i23002 ; <double> [#uses=1]
- %tmp.7.i22957 = load double* %tmp.2.i34368 ; <double> [#uses=1]
- %tmp.15.i22971 = add double %tmp.7.i22957, %tmp.15.i23000 ; <double> [#uses=1]
- store double %tmp.15.i22971, double* %tmp.2.i34368
- %tmp.26.i22978 = load double* %tmp.6.i34369 ; <double> [#uses=1]
- %tmp.31.i22989 = add double %tmp.26.i22978, %tmp.18.i23003 ; <double> [#uses=1]
- store double %tmp.31.i22989, double* %tmp.6.i34369
- store double 0.000000e+00, double* %tmp.2.i34366
- store double 0.000000e+00, double* %tmp.6.i34367
- %tmp.4.i22935 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i22934, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.5.i22936 = getelementptr [6 x %"struct.std::dcomplex"]* %_m, i32 5, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i22937 = load double* %tmp.5.i22936 ; <double> [#uses=1]
- store double %tmp.6.i22937, double* %tmp.4.i22935
- %tmp.7.i22938 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i22934, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.8.i22939 = getelementptr [6 x %"struct.std::dcomplex"]* %_m, i32 5, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i22940 = load double* %tmp.8.i22939 ; <double> [#uses=1]
- store double %tmp.9.i22940, double* %tmp.7.i22938
- %tmp.0.i22941 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i22934, %"struct.std::dcomplex"* %ret5 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i22943 = getelementptr %"struct.std::dcomplex"* %tmp.0.i22941, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i22944 = load double* %tmp.14.i22943 ; <double> [#uses=1]
- %tmp.17.i22946 = getelementptr %"struct.std::dcomplex"* %tmp.0.i22941, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i22947 = load double* %tmp.17.i22946 ; <double> [#uses=1]
- %tmp.7.i22901 = load double* %tmp.2.i ; <double> [#uses=1]
- %tmp.15.i22915 = add double %tmp.7.i22901, %tmp.15.i22944 ; <double> [#uses=1]
- store double %tmp.15.i22915, double* %tmp.2.i
- %tmp.26.i22922 = load double* %tmp.6.i ; <double> [#uses=1]
- %tmp.31.i22933 = add double %tmp.26.i22922, %tmp.18.i22947 ; <double> [#uses=1]
- store double %tmp.31.i22933, double* %tmp.6.i
- store double 0.000000e+00, double* %tmp.2.i34368
- store double 0.000000e+00, double* %tmp.6.i34369
- %tmp.4.i22879 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i22878, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i22881 = load double* %tmp.5.i34082 ; <double> [#uses=1]
- store double %tmp.6.i22881, double* %tmp.4.i22879
- %tmp.7.i22882 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i22878, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i22884 = load double* %tmp.8.i34085 ; <double> [#uses=1]
- store double %tmp.9.i22884, double* %tmp.7.i22882
- %tmp.0.i22885 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i22878, %"struct.std::dcomplex"* %tmp.1036 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i22887 = getelementptr %"struct.std::dcomplex"* %tmp.0.i22885, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i22888 = load double* %tmp.14.i22887 ; <double> [#uses=1]
- %tmp.17.i22890 = getelementptr %"struct.std::dcomplex"* %tmp.0.i22885, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i22891 = load double* %tmp.17.i22890 ; <double> [#uses=1]
- %tmp.4.i22865 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i22864, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i22867 = load double* %tmp.5.i28602 ; <double> [#uses=1]
- store double %tmp.6.i22867, double* %tmp.4.i22865
- %tmp.7.i22868 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i22864, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i22870 = load double* %tmp.8.i28605 ; <double> [#uses=1]
- store double %tmp.9.i22870, double* %tmp.7.i22868
- %tmp.0.i22871 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i22864, %"struct.std::dcomplex"* %tmp.62 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i22872 = getelementptr %"struct.std::dcomplex"* %mem_tmp.617, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i22873 = getelementptr %"struct.std::dcomplex"* %tmp.0.i22871, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i22874 = load double* %tmp.14.i22873 ; <double> [#uses=1]
- store double %tmp.15.i22874, double* %tmp.13.i22872
- %tmp.16.i22875 = getelementptr %"struct.std::dcomplex"* %mem_tmp.617, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i22876 = getelementptr %"struct.std::dcomplex"* %tmp.0.i22871, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i22877 = load double* %tmp.17.i22876 ; <double> [#uses=1]
- store double %tmp.18.i22877, double* %tmp.16.i22875
- %tmp.4.i22851 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i22850, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i22888, double* %tmp.4.i22851
- %tmp.7.i22854 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i22850, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i22891, double* %tmp.7.i22854
- %tmp.0.i22857 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i22850, %"struct.std::dcomplex"* %mem_tmp.617 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i22859 = getelementptr %"struct.std::dcomplex"* %tmp.0.i22857, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i22860 = load double* %tmp.14.i22859 ; <double> [#uses=1]
- %tmp.17.i22862 = getelementptr %"struct.std::dcomplex"* %tmp.0.i22857, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i22863 = load double* %tmp.17.i22862 ; <double> [#uses=1]
- %tmp.4.i22837 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i22836, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i22860, double* %tmp.4.i22837
- %tmp.7.i22840 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i22836, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i22863, double* %tmp.7.i22840
- %tmp.0.i22843 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i22836, %"struct.std::dcomplex"* %tmp.30 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i22845 = getelementptr %"struct.std::dcomplex"* %tmp.0.i22843, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i22846 = load double* %tmp.14.i22845 ; <double> [#uses=1]
- %tmp.17.i22848 = getelementptr %"struct.std::dcomplex"* %tmp.0.i22843, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i22849 = load double* %tmp.17.i22848 ; <double> [#uses=1]
- %tmp.4.i22823 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i22822, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i22825 = load double* %tmp.5.i28602 ; <double> [#uses=1]
- store double %tmp.6.i22825, double* %tmp.4.i22823
- %tmp.7.i22826 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i22822, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i22828 = load double* %tmp.8.i28605 ; <double> [#uses=1]
- store double %tmp.9.i22828, double* %tmp.7.i22826
- %tmp.0.i22829 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i22822, %"struct.std::dcomplex"* %tmp.12 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i22831 = getelementptr %"struct.std::dcomplex"* %tmp.0.i22829, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i22832 = load double* %tmp.14.i22831 ; <double> [#uses=1]
- %tmp.17.i22834 = getelementptr %"struct.std::dcomplex"* %tmp.0.i22829, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i22835 = load double* %tmp.17.i22834 ; <double> [#uses=1]
- %tmp.4.i22809 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i22808, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i22811 = load double* %tmp.5.i34352 ; <double> [#uses=1]
- store double %tmp.6.i22811, double* %tmp.4.i22809
- %tmp.7.i22812 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i22808, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i22814 = load double* %tmp.8.i34355 ; <double> [#uses=1]
- store double %tmp.9.i22814, double* %tmp.7.i22812
- %tmp.0.i22815 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i22808, %"struct.std::dcomplex"* %tmp.1036 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i22816 = getelementptr %"struct.std::dcomplex"* %mem_tmp.621, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i22817 = getelementptr %"struct.std::dcomplex"* %tmp.0.i22815, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i22818 = load double* %tmp.14.i22817 ; <double> [#uses=1]
- store double %tmp.15.i22818, double* %tmp.13.i22816
- %tmp.16.i22819 = getelementptr %"struct.std::dcomplex"* %mem_tmp.621, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i22820 = getelementptr %"struct.std::dcomplex"* %tmp.0.i22815, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i22821 = load double* %tmp.17.i22820 ; <double> [#uses=1]
- store double %tmp.18.i22821, double* %tmp.16.i22819
- %tmp.4.i22795 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i22794, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i22832, double* %tmp.4.i22795
- %tmp.7.i22798 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i22794, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i22835, double* %tmp.7.i22798
- %tmp.0.i22801 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i22794, %"struct.std::dcomplex"* %mem_tmp.621 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i22803 = getelementptr %"struct.std::dcomplex"* %tmp.0.i22801, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i22804 = load double* %tmp.14.i22803 ; <double> [#uses=1]
- %tmp.17.i22806 = getelementptr %"struct.std::dcomplex"* %tmp.0.i22801, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i22807 = load double* %tmp.17.i22806 ; <double> [#uses=1]
- %tmp.4.i22781 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i22780, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i22804, double* %tmp.4.i22781
- %tmp.7.i22784 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i22780, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i22807, double* %tmp.7.i22784
- %tmp.0.i22787 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i22780, %"struct.std::dcomplex"* %tmp.95 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i22788 = getelementptr %"struct.std::dcomplex"* %mem_tmp.618, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i22789 = getelementptr %"struct.std::dcomplex"* %tmp.0.i22787, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i22790 = load double* %tmp.14.i22789 ; <double> [#uses=1]
- store double %tmp.15.i22790, double* %tmp.13.i22788
- %tmp.16.i22791 = getelementptr %"struct.std::dcomplex"* %mem_tmp.618, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i22792 = getelementptr %"struct.std::dcomplex"* %tmp.0.i22787, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i22793 = load double* %tmp.17.i22792 ; <double> [#uses=1]
- store double %tmp.18.i22793, double* %tmp.16.i22791
- %tmp.4.i22767 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i22766, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i22846, double* %tmp.4.i22767
- %tmp.7.i22770 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i22766, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i22849, double* %tmp.7.i22770
- %tmp.0.i22773 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i22766, %"struct.std::dcomplex"* %mem_tmp.618 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i22775 = getelementptr %"struct.std::dcomplex"* %tmp.0.i22773, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i22776 = load double* %tmp.14.i22775 ; <double> [#uses=1]
- %tmp.17.i22778 = getelementptr %"struct.std::dcomplex"* %tmp.0.i22773, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i22779 = load double* %tmp.17.i22778 ; <double> [#uses=1]
- %tmp.4.i22753 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i22752, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i22755 = load double* %tmp.5.i34352 ; <double> [#uses=1]
- store double %tmp.6.i22755, double* %tmp.4.i22753
- %tmp.7.i22756 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i22752, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i22758 = load double* %tmp.8.i34355 ; <double> [#uses=1]
- store double %tmp.9.i22758, double* %tmp.7.i22756
- %tmp.0.i22759 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i22752, %"struct.std::dcomplex"* %tmp.62 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i22761 = getelementptr %"struct.std::dcomplex"* %tmp.0.i22759, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i22762 = load double* %tmp.14.i22761 ; <double> [#uses=1]
- %tmp.17.i22764 = getelementptr %"struct.std::dcomplex"* %tmp.0.i22759, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i22765 = load double* %tmp.17.i22764 ; <double> [#uses=1]
- %tmp.4.i22739 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i22738, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i22741 = load double* %tmp.5.i34082 ; <double> [#uses=1]
- store double %tmp.6.i22741, double* %tmp.4.i22739
- %tmp.7.i22742 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i22738, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i22744 = load double* %tmp.8.i34085 ; <double> [#uses=1]
- store double %tmp.9.i22744, double* %tmp.7.i22742
- %tmp.0.i22745 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i22738, %"struct.std::dcomplex"* %tmp.12 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i22746 = getelementptr %"struct.std::dcomplex"* %mem_tmp.625, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i22747 = getelementptr %"struct.std::dcomplex"* %tmp.0.i22745, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i22748 = load double* %tmp.14.i22747 ; <double> [#uses=1]
- store double %tmp.15.i22748, double* %tmp.13.i22746
- %tmp.16.i22749 = getelementptr %"struct.std::dcomplex"* %mem_tmp.625, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i22750 = getelementptr %"struct.std::dcomplex"* %tmp.0.i22745, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i22751 = load double* %tmp.17.i22750 ; <double> [#uses=1]
- store double %tmp.18.i22751, double* %tmp.16.i22749
- %tmp.4.i22725 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i22724, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i22762, double* %tmp.4.i22725
- %tmp.7.i22728 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i22724, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i22765, double* %tmp.7.i22728
- %tmp.0.i22731 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i22724, %"struct.std::dcomplex"* %mem_tmp.625 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i22733 = getelementptr %"struct.std::dcomplex"* %tmp.0.i22731, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i22734 = load double* %tmp.14.i22733 ; <double> [#uses=1]
- %tmp.17.i22736 = getelementptr %"struct.std::dcomplex"* %tmp.0.i22731, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i22737 = load double* %tmp.17.i22736 ; <double> [#uses=1]
- %tmp.4.i22711 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i22710, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i22734, double* %tmp.4.i22711
- %tmp.7.i22714 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i22710, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i22737, double* %tmp.7.i22714
- %tmp.0.i22717 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i22710, %"struct.std::dcomplex"* %tmp.1075 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i22718 = getelementptr %"struct.std::dcomplex"* %mem_tmp.622, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i22719 = getelementptr %"struct.std::dcomplex"* %tmp.0.i22717, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i22720 = load double* %tmp.14.i22719 ; <double> [#uses=1]
- store double %tmp.15.i22720, double* %tmp.13.i22718
- %tmp.16.i22721 = getelementptr %"struct.std::dcomplex"* %mem_tmp.622, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i22722 = getelementptr %"struct.std::dcomplex"* %tmp.0.i22717, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i22723 = load double* %tmp.17.i22722 ; <double> [#uses=1]
- store double %tmp.18.i22723, double* %tmp.16.i22721
- %tmp.4.i22697 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i22696, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i22776, double* %tmp.4.i22697
- %tmp.7.i22700 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i22696, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i22779, double* %tmp.7.i22700
- %tmp.0.i22703 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i22696, %"struct.std::dcomplex"* %mem_tmp.622 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i22705 = getelementptr %"struct.std::dcomplex"* %tmp.0.i22703, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i22706 = load double* %tmp.14.i22705 ; <double> [#uses=1]
- %tmp.17.i22708 = getelementptr %"struct.std::dcomplex"* %tmp.0.i22703, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i22709 = load double* %tmp.17.i22708 ; <double> [#uses=1]
- store double %tmp.15.i22706, double* %tmp.2.i34364
- store double %tmp.18.i22709, double* %tmp.6.i34365
- %tmp.4.i22663 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i22662, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i22665 = load double* %tmp.5.i32460 ; <double> [#uses=1]
- store double %tmp.6.i22665, double* %tmp.4.i22663
- %tmp.7.i22666 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i22662, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i22668 = load double* %tmp.8.i32463 ; <double> [#uses=1]
- store double %tmp.9.i22668, double* %tmp.7.i22666
- %tmp.0.i22669 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i22662, %"struct.std::dcomplex"* %ret3 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i22671 = getelementptr %"struct.std::dcomplex"* %tmp.0.i22669, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i22672 = load double* %tmp.14.i22671 ; <double> [#uses=1]
- %tmp.17.i22674 = getelementptr %"struct.std::dcomplex"* %tmp.0.i22669, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i22675 = load double* %tmp.17.i22674 ; <double> [#uses=1]
- %tmp.7.i22629 = load double* %tmp.2.i34366 ; <double> [#uses=1]
- %tmp.15.i22643 = add double %tmp.7.i22629, %tmp.15.i22672 ; <double> [#uses=1]
- store double %tmp.15.i22643, double* %tmp.2.i34366
- %tmp.26.i22650 = load double* %tmp.6.i34367 ; <double> [#uses=1]
- %tmp.31.i22661 = add double %tmp.26.i22650, %tmp.18.i22675 ; <double> [#uses=1]
- store double %tmp.31.i22661, double* %tmp.6.i34367
- %tmp.4.i22609 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i22608, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i22611 = load double* %tmp.5.i34082 ; <double> [#uses=1]
- store double %tmp.6.i22611, double* %tmp.4.i22609
- %tmp.7.i22612 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i22608, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i22614 = load double* %tmp.8.i34085 ; <double> [#uses=1]
- store double %tmp.9.i22614, double* %tmp.7.i22612
- %tmp.0.i22615 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i22608, %"struct.std::dcomplex"* %tmp.12 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i22617 = getelementptr %"struct.std::dcomplex"* %tmp.0.i22615, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i22618 = load double* %tmp.14.i22617 ; <double> [#uses=1]
- %tmp.17.i22620 = getelementptr %"struct.std::dcomplex"* %tmp.0.i22615, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i22621 = load double* %tmp.17.i22620 ; <double> [#uses=1]
- %tmp.4.i22595 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i22594, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i22597 = load double* %tmp.5.i34352 ; <double> [#uses=1]
- store double %tmp.6.i22597, double* %tmp.4.i22595
- %tmp.7.i22598 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i22594, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i22600 = load double* %tmp.8.i34355 ; <double> [#uses=1]
- store double %tmp.9.i22600, double* %tmp.7.i22598
- %tmp.0.i22601 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i22594, %"struct.std::dcomplex"* %tmp.62 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i22602 = getelementptr %"struct.std::dcomplex"* %mem_tmp.632, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i22603 = getelementptr %"struct.std::dcomplex"* %tmp.0.i22601, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i22604 = load double* %tmp.14.i22603 ; <double> [#uses=1]
- store double %tmp.15.i22604, double* %tmp.13.i22602
- %tmp.16.i22605 = getelementptr %"struct.std::dcomplex"* %mem_tmp.632, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i22606 = getelementptr %"struct.std::dcomplex"* %tmp.0.i22601, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i22607 = load double* %tmp.17.i22606 ; <double> [#uses=1]
- store double %tmp.18.i22607, double* %tmp.16.i22605
- %tmp.4.i22581 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i22580, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i22618, double* %tmp.4.i22581
- %tmp.7.i22584 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i22580, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i22621, double* %tmp.7.i22584
- %tmp.0.i22587 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i22580, %"struct.std::dcomplex"* %mem_tmp.632 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i22589 = getelementptr %"struct.std::dcomplex"* %tmp.0.i22587, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i22590 = load double* %tmp.14.i22589 ; <double> [#uses=1]
- %tmp.17.i22592 = getelementptr %"struct.std::dcomplex"* %tmp.0.i22587, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i22593 = load double* %tmp.17.i22592 ; <double> [#uses=1]
- %tmp.4.i22567 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i22566, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i22590, double* %tmp.4.i22567
- %tmp.7.i22570 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i22566, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i22593, double* %tmp.7.i22570
- %tmp.0.i22573 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i22566, %"struct.std::dcomplex"* %tmp.220 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i22575 = getelementptr %"struct.std::dcomplex"* %tmp.0.i22573, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i22576 = load double* %tmp.14.i22575 ; <double> [#uses=1]
- %tmp.17.i22578 = getelementptr %"struct.std::dcomplex"* %tmp.0.i22573, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i22579 = load double* %tmp.17.i22578 ; <double> [#uses=1]
- %tmp.4.i22553 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i22552, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i22555 = load double* %tmp.5.i33146 ; <double> [#uses=1]
- store double %tmp.6.i22555, double* %tmp.4.i22553
- %tmp.7.i22556 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i22552, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i22558 = load double* %tmp.8.i33149 ; <double> [#uses=1]
- store double %tmp.9.i22558, double* %tmp.7.i22556
- %tmp.0.i22559 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i22552, %"struct.std::dcomplex"* %tmp.62 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i22561 = getelementptr %"struct.std::dcomplex"* %tmp.0.i22559, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i22562 = load double* %tmp.14.i22561 ; <double> [#uses=1]
- %tmp.17.i22564 = getelementptr %"struct.std::dcomplex"* %tmp.0.i22559, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i22565 = load double* %tmp.17.i22564 ; <double> [#uses=1]
- %tmp.4.i22539 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i22538, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i22541 = load double* %tmp.5.i34082 ; <double> [#uses=1]
- store double %tmp.6.i22541, double* %tmp.4.i22539
- %tmp.7.i22542 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i22538, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i22544 = load double* %tmp.8.i34085 ; <double> [#uses=1]
- store double %tmp.9.i22544, double* %tmp.7.i22542
- %tmp.0.i22545 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i22538, %"struct.std::dcomplex"* %tmp.226 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i22546 = getelementptr %"struct.std::dcomplex"* %mem_tmp.636, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i22547 = getelementptr %"struct.std::dcomplex"* %tmp.0.i22545, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i22548 = load double* %tmp.14.i22547 ; <double> [#uses=1]
- store double %tmp.15.i22548, double* %tmp.13.i22546
- %tmp.16.i22549 = getelementptr %"struct.std::dcomplex"* %mem_tmp.636, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i22550 = getelementptr %"struct.std::dcomplex"* %tmp.0.i22545, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i22551 = load double* %tmp.17.i22550 ; <double> [#uses=1]
- store double %tmp.18.i22551, double* %tmp.16.i22549
- %tmp.4.i22525 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i22524, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i22562, double* %tmp.4.i22525
- %tmp.7.i22528 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i22524, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i22565, double* %tmp.7.i22528
- %tmp.0.i22531 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i22524, %"struct.std::dcomplex"* %mem_tmp.636 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i22533 = getelementptr %"struct.std::dcomplex"* %tmp.0.i22531, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i22534 = load double* %tmp.14.i22533 ; <double> [#uses=1]
- %tmp.17.i22536 = getelementptr %"struct.std::dcomplex"* %tmp.0.i22531, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i22537 = load double* %tmp.17.i22536 ; <double> [#uses=1]
- %tmp.4.i22511 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i22510, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i22534, double* %tmp.4.i22511
- %tmp.7.i22514 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i22510, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i22537, double* %tmp.7.i22514
- %tmp.0.i22517 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i22510, %"struct.std::dcomplex"* %tmp.30 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i22518 = getelementptr %"struct.std::dcomplex"* %mem_tmp.633, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i22519 = getelementptr %"struct.std::dcomplex"* %tmp.0.i22517, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i22520 = load double* %tmp.14.i22519 ; <double> [#uses=1]
- store double %tmp.15.i22520, double* %tmp.13.i22518
- %tmp.16.i22521 = getelementptr %"struct.std::dcomplex"* %mem_tmp.633, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i22522 = getelementptr %"struct.std::dcomplex"* %tmp.0.i22517, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i22523 = load double* %tmp.17.i22522 ; <double> [#uses=1]
- store double %tmp.18.i22523, double* %tmp.16.i22521
- %tmp.4.i22497 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i22496, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i22576, double* %tmp.4.i22497
- %tmp.7.i22500 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i22496, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i22579, double* %tmp.7.i22500
- %tmp.0.i22503 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i22496, %"struct.std::dcomplex"* %mem_tmp.633 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i22505 = getelementptr %"struct.std::dcomplex"* %tmp.0.i22503, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i22506 = load double* %tmp.14.i22505 ; <double> [#uses=1]
- %tmp.17.i22508 = getelementptr %"struct.std::dcomplex"* %tmp.0.i22503, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i22509 = load double* %tmp.17.i22508 ; <double> [#uses=1]
- %tmp.4.i22483 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i22482, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i22485 = load double* %tmp.5.i34352 ; <double> [#uses=1]
- store double %tmp.6.i22485, double* %tmp.4.i22483
- %tmp.7.i22486 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i22482, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i22488 = load double* %tmp.8.i34355 ; <double> [#uses=1]
- store double %tmp.9.i22488, double* %tmp.7.i22486
- %tmp.0.i22489 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i22482, %"struct.std::dcomplex"* %tmp.226 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i22491 = getelementptr %"struct.std::dcomplex"* %tmp.0.i22489, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i22492 = load double* %tmp.14.i22491 ; <double> [#uses=1]
- %tmp.17.i22494 = getelementptr %"struct.std::dcomplex"* %tmp.0.i22489, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i22495 = load double* %tmp.17.i22494 ; <double> [#uses=1]
- %tmp.4.i22469 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i22468, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i22471 = load double* %tmp.5.i33146 ; <double> [#uses=1]
- store double %tmp.6.i22471, double* %tmp.4.i22469
- %tmp.7.i22472 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i22468, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i22474 = load double* %tmp.8.i33149 ; <double> [#uses=1]
- store double %tmp.9.i22474, double* %tmp.7.i22472
- %tmp.0.i22475 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i22468, %"struct.std::dcomplex"* %tmp.12 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i22476 = getelementptr %"struct.std::dcomplex"* %mem_tmp.640, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i22477 = getelementptr %"struct.std::dcomplex"* %tmp.0.i22475, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i22478 = load double* %tmp.14.i22477 ; <double> [#uses=1]
- store double %tmp.15.i22478, double* %tmp.13.i22476
- %tmp.16.i22479 = getelementptr %"struct.std::dcomplex"* %mem_tmp.640, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i22480 = getelementptr %"struct.std::dcomplex"* %tmp.0.i22475, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i22481 = load double* %tmp.17.i22480 ; <double> [#uses=1]
- store double %tmp.18.i22481, double* %tmp.16.i22479
- %tmp.4.i22455 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i22454, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i22492, double* %tmp.4.i22455
- %tmp.7.i22458 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i22454, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i22495, double* %tmp.7.i22458
- %tmp.0.i22461 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i22454, %"struct.std::dcomplex"* %mem_tmp.640 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i22463 = getelementptr %"struct.std::dcomplex"* %tmp.0.i22461, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i22464 = load double* %tmp.14.i22463 ; <double> [#uses=1]
- %tmp.17.i22466 = getelementptr %"struct.std::dcomplex"* %tmp.0.i22461, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i22467 = load double* %tmp.17.i22466 ; <double> [#uses=1]
- %tmp.4.i22441 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i22440, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i22464, double* %tmp.4.i22441
- %tmp.7.i22444 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i22440, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i22467, double* %tmp.7.i22444
- %tmp.0.i22447 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i22440, %"struct.std::dcomplex"* %tmp.95 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i22448 = getelementptr %"struct.std::dcomplex"* %mem_tmp.637, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i22449 = getelementptr %"struct.std::dcomplex"* %tmp.0.i22447, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i22450 = load double* %tmp.14.i22449 ; <double> [#uses=1]
- store double %tmp.15.i22450, double* %tmp.13.i22448
- %tmp.16.i22451 = getelementptr %"struct.std::dcomplex"* %mem_tmp.637, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i22452 = getelementptr %"struct.std::dcomplex"* %tmp.0.i22447, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i22453 = load double* %tmp.17.i22452 ; <double> [#uses=1]
- store double %tmp.18.i22453, double* %tmp.16.i22451
- %tmp.4.i22427 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i22426, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i22506, double* %tmp.4.i22427
- %tmp.7.i22430 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i22426, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i22509, double* %tmp.7.i22430
- %tmp.0.i22433 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i22426, %"struct.std::dcomplex"* %mem_tmp.637 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i22435 = getelementptr %"struct.std::dcomplex"* %tmp.0.i22433, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i22436 = load double* %tmp.14.i22435 ; <double> [#uses=1]
- %tmp.17.i22438 = getelementptr %"struct.std::dcomplex"* %tmp.0.i22433, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i22439 = load double* %tmp.17.i22438 ; <double> [#uses=1]
- store double %tmp.15.i22436, double* %tmp.2.i34364
- store double %tmp.18.i22439, double* %tmp.6.i34365
- %tmp.4.i22393 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i22392, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i22395 = load double* %tmp.5.i27590 ; <double> [#uses=1]
- store double %tmp.6.i22395, double* %tmp.4.i22393
- %tmp.7.i22396 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i22392, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i22398 = load double* %tmp.8.i27593 ; <double> [#uses=1]
- store double %tmp.9.i22398, double* %tmp.7.i22396
- %tmp.0.i22399 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i22392, %"struct.std::dcomplex"* %ret3 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i22401 = getelementptr %"struct.std::dcomplex"* %tmp.0.i22399, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i22402 = load double* %tmp.14.i22401 ; <double> [#uses=1]
- %tmp.17.i22404 = getelementptr %"struct.std::dcomplex"* %tmp.0.i22399, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i22405 = load double* %tmp.17.i22404 ; <double> [#uses=1]
- %tmp.7.i22359 = load double* %tmp.2.i34366 ; <double> [#uses=1]
- %tmp.15.i22373 = add double %tmp.7.i22359, %tmp.15.i22402 ; <double> [#uses=1]
- store double %tmp.15.i22373, double* %tmp.2.i34366
- %tmp.26.i22380 = load double* %tmp.6.i34367 ; <double> [#uses=1]
- %tmp.31.i22391 = add double %tmp.26.i22380, %tmp.18.i22405 ; <double> [#uses=1]
- store double %tmp.31.i22391, double* %tmp.6.i34367
- %tmp.4.i22339 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i22338, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i22341 = load double* %tmp.5.i33146 ; <double> [#uses=1]
- store double %tmp.6.i22341, double* %tmp.4.i22339
- %tmp.7.i22342 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i22338, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i22344 = load double* %tmp.8.i33149 ; <double> [#uses=1]
- store double %tmp.9.i22344, double* %tmp.7.i22342
- %tmp.0.i22345 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i22338, %"struct.std::dcomplex"* %tmp.1036 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i22347 = getelementptr %"struct.std::dcomplex"* %tmp.0.i22345, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i22348 = load double* %tmp.14.i22347 ; <double> [#uses=1]
- %tmp.17.i22350 = getelementptr %"struct.std::dcomplex"* %tmp.0.i22345, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i22351 = load double* %tmp.17.i22350 ; <double> [#uses=1]
- %tmp.4.i22325 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i22324, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i22327 = load double* %tmp.5.i28602 ; <double> [#uses=1]
- store double %tmp.6.i22327, double* %tmp.4.i22325
- %tmp.7.i22328 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i22324, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i22330 = load double* %tmp.8.i28605 ; <double> [#uses=1]
- store double %tmp.9.i22330, double* %tmp.7.i22328
- %tmp.0.i22331 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i22324, %"struct.std::dcomplex"* %tmp.226 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i22332 = getelementptr %"struct.std::dcomplex"* %mem_tmp.647, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i22333 = getelementptr %"struct.std::dcomplex"* %tmp.0.i22331, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i22334 = load double* %tmp.14.i22333 ; <double> [#uses=1]
- store double %tmp.15.i22334, double* %tmp.13.i22332
- %tmp.16.i22335 = getelementptr %"struct.std::dcomplex"* %mem_tmp.647, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i22336 = getelementptr %"struct.std::dcomplex"* %tmp.0.i22331, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i22337 = load double* %tmp.17.i22336 ; <double> [#uses=1]
- store double %tmp.18.i22337, double* %tmp.16.i22335
- %tmp.4.i22311 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i22310, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i22348, double* %tmp.4.i22311
- %tmp.7.i22314 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i22310, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i22351, double* %tmp.7.i22314
- %tmp.0.i22317 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i22310, %"struct.std::dcomplex"* %mem_tmp.647 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i22319 = getelementptr %"struct.std::dcomplex"* %tmp.0.i22317, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i22320 = load double* %tmp.14.i22319 ; <double> [#uses=1]
- %tmp.17.i22322 = getelementptr %"struct.std::dcomplex"* %tmp.0.i22317, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i22323 = load double* %tmp.17.i22322 ; <double> [#uses=1]
- %tmp.4.i22297 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i22296, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i22320, double* %tmp.4.i22297
- %tmp.7.i22300 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i22296, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i22323, double* %tmp.7.i22300
- %tmp.0.i22303 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i22296, %"struct.std::dcomplex"* %tmp.95 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i22305 = getelementptr %"struct.std::dcomplex"* %tmp.0.i22303, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i22306 = load double* %tmp.14.i22305 ; <double> [#uses=1]
- %tmp.17.i22308 = getelementptr %"struct.std::dcomplex"* %tmp.0.i22303, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i22309 = load double* %tmp.17.i22308 ; <double> [#uses=1]
- %tmp.4.i22283 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i22282, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i22285 = load double* %tmp.5.i28602 ; <double> [#uses=1]
- store double %tmp.6.i22285, double* %tmp.4.i22283
- %tmp.7.i22286 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i22282, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i22288 = load double* %tmp.8.i28605 ; <double> [#uses=1]
- store double %tmp.9.i22288, double* %tmp.7.i22286
- %tmp.0.i22289 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i22282, %"struct.std::dcomplex"* %tmp.62 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i22291 = getelementptr %"struct.std::dcomplex"* %tmp.0.i22289, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i22292 = load double* %tmp.14.i22291 ; <double> [#uses=1]
- %tmp.17.i22294 = getelementptr %"struct.std::dcomplex"* %tmp.0.i22289, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i22295 = load double* %tmp.17.i22294 ; <double> [#uses=1]
- %tmp.4.i22269 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i22268, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i22271 = load double* %tmp.5.i34082 ; <double> [#uses=1]
- store double %tmp.6.i22271, double* %tmp.4.i22269
- %tmp.7.i22272 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i22268, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i22274 = load double* %tmp.8.i34085 ; <double> [#uses=1]
- store double %tmp.9.i22274, double* %tmp.7.i22272
- %tmp.0.i22275 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i22268, %"struct.std::dcomplex"* %tmp.1036 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i22276 = getelementptr %"struct.std::dcomplex"* %mem_tmp.651, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i22277 = getelementptr %"struct.std::dcomplex"* %tmp.0.i22275, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i22278 = load double* %tmp.14.i22277 ; <double> [#uses=1]
- store double %tmp.15.i22278, double* %tmp.13.i22276
- %tmp.16.i22279 = getelementptr %"struct.std::dcomplex"* %mem_tmp.651, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i22280 = getelementptr %"struct.std::dcomplex"* %tmp.0.i22275, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i22281 = load double* %tmp.17.i22280 ; <double> [#uses=1]
- store double %tmp.18.i22281, double* %tmp.16.i22279
- %tmp.4.i22255 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i22254, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i22292, double* %tmp.4.i22255
- %tmp.7.i22258 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i22254, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i22295, double* %tmp.7.i22258
- %tmp.0.i22261 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i22254, %"struct.std::dcomplex"* %mem_tmp.651 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i22263 = getelementptr %"struct.std::dcomplex"* %tmp.0.i22261, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i22264 = load double* %tmp.14.i22263 ; <double> [#uses=1]
- %tmp.17.i22266 = getelementptr %"struct.std::dcomplex"* %tmp.0.i22261, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i22267 = load double* %tmp.17.i22266 ; <double> [#uses=1]
- %tmp.4.i22241 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i22240, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i22264, double* %tmp.4.i22241
- %tmp.7.i22244 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i22240, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i22267, double* %tmp.7.i22244
- %tmp.0.i22247 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i22240, %"struct.std::dcomplex"* %tmp.220 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i22248 = getelementptr %"struct.std::dcomplex"* %mem_tmp.648, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i22249 = getelementptr %"struct.std::dcomplex"* %tmp.0.i22247, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i22250 = load double* %tmp.14.i22249 ; <double> [#uses=1]
- store double %tmp.15.i22250, double* %tmp.13.i22248
- %tmp.16.i22251 = getelementptr %"struct.std::dcomplex"* %mem_tmp.648, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i22252 = getelementptr %"struct.std::dcomplex"* %tmp.0.i22247, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i22253 = load double* %tmp.17.i22252 ; <double> [#uses=1]
- store double %tmp.18.i22253, double* %tmp.16.i22251
- %tmp.4.i22227 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i22226, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i22306, double* %tmp.4.i22227
- %tmp.7.i22230 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i22226, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i22309, double* %tmp.7.i22230
- %tmp.0.i22233 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i22226, %"struct.std::dcomplex"* %mem_tmp.648 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i22235 = getelementptr %"struct.std::dcomplex"* %tmp.0.i22233, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i22236 = load double* %tmp.14.i22235 ; <double> [#uses=1]
- %tmp.17.i22238 = getelementptr %"struct.std::dcomplex"* %tmp.0.i22233, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i22239 = load double* %tmp.17.i22238 ; <double> [#uses=1]
- %tmp.4.i22213 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i22212, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i22215 = load double* %tmp.5.i34082 ; <double> [#uses=1]
- store double %tmp.6.i22215, double* %tmp.4.i22213
- %tmp.7.i22216 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i22212, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i22218 = load double* %tmp.8.i34085 ; <double> [#uses=1]
- store double %tmp.9.i22218, double* %tmp.7.i22216
- %tmp.0.i22219 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i22212, %"struct.std::dcomplex"* %tmp.226 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i22221 = getelementptr %"struct.std::dcomplex"* %tmp.0.i22219, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i22222 = load double* %tmp.14.i22221 ; <double> [#uses=1]
- %tmp.17.i22224 = getelementptr %"struct.std::dcomplex"* %tmp.0.i22219, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i22225 = load double* %tmp.17.i22224 ; <double> [#uses=1]
- %tmp.4.i22199 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i22198, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i22201 = load double* %tmp.5.i33146 ; <double> [#uses=1]
- store double %tmp.6.i22201, double* %tmp.4.i22199
- %tmp.7.i22202 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i22198, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i22204 = load double* %tmp.8.i33149 ; <double> [#uses=1]
- store double %tmp.9.i22204, double* %tmp.7.i22202
- %tmp.0.i22205 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i22198, %"struct.std::dcomplex"* %tmp.62 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i22206 = getelementptr %"struct.std::dcomplex"* %mem_tmp.655, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i22207 = getelementptr %"struct.std::dcomplex"* %tmp.0.i22205, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i22208 = load double* %tmp.14.i22207 ; <double> [#uses=1]
- store double %tmp.15.i22208, double* %tmp.13.i22206
- %tmp.16.i22209 = getelementptr %"struct.std::dcomplex"* %mem_tmp.655, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i22210 = getelementptr %"struct.std::dcomplex"* %tmp.0.i22205, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i22211 = load double* %tmp.17.i22210 ; <double> [#uses=1]
- store double %tmp.18.i22211, double* %tmp.16.i22209
- %tmp.4.i22185 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i22184, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i22222, double* %tmp.4.i22185
- %tmp.7.i22188 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i22184, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i22225, double* %tmp.7.i22188
- %tmp.0.i22191 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i22184, %"struct.std::dcomplex"* %mem_tmp.655 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i22193 = getelementptr %"struct.std::dcomplex"* %tmp.0.i22191, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i22194 = load double* %tmp.14.i22193 ; <double> [#uses=1]
- %tmp.17.i22196 = getelementptr %"struct.std::dcomplex"* %tmp.0.i22191, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i22197 = load double* %tmp.17.i22196 ; <double> [#uses=1]
- %tmp.4.i22171 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i22170, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i22194, double* %tmp.4.i22171
- %tmp.7.i22174 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i22170, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i22197, double* %tmp.7.i22174
- %tmp.0.i22177 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i22170, %"struct.std::dcomplex"* %tmp.1075 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i22178 = getelementptr %"struct.std::dcomplex"* %mem_tmp.652, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i22179 = getelementptr %"struct.std::dcomplex"* %tmp.0.i22177, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i22180 = load double* %tmp.14.i22179 ; <double> [#uses=1]
- store double %tmp.15.i22180, double* %tmp.13.i22178
- %tmp.16.i22181 = getelementptr %"struct.std::dcomplex"* %mem_tmp.652, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i22182 = getelementptr %"struct.std::dcomplex"* %tmp.0.i22177, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i22183 = load double* %tmp.17.i22182 ; <double> [#uses=1]
- store double %tmp.18.i22183, double* %tmp.16.i22181
- %tmp.4.i22157 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i22156, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i22236, double* %tmp.4.i22157
- %tmp.7.i22160 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i22156, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i22239, double* %tmp.7.i22160
- %tmp.0.i22163 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i22156, %"struct.std::dcomplex"* %mem_tmp.652 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i22165 = getelementptr %"struct.std::dcomplex"* %tmp.0.i22163, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i22166 = load double* %tmp.14.i22165 ; <double> [#uses=1]
- %tmp.17.i22168 = getelementptr %"struct.std::dcomplex"* %tmp.0.i22163, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i22169 = load double* %tmp.17.i22168 ; <double> [#uses=1]
- store double %tmp.15.i22166, double* %tmp.2.i34364
- store double %tmp.18.i22169, double* %tmp.6.i34365
- %tmp.4.i22123 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i22122, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i22125 = load double* %tmp.5.i33866 ; <double> [#uses=1]
- store double %tmp.6.i22125, double* %tmp.4.i22123
- %tmp.7.i22126 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i22122, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i22128 = load double* %tmp.8.i33869 ; <double> [#uses=1]
- store double %tmp.9.i22128, double* %tmp.7.i22126
- %tmp.0.i22129 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i22122, %"struct.std::dcomplex"* %ret3 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i22131 = getelementptr %"struct.std::dcomplex"* %tmp.0.i22129, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i22132 = load double* %tmp.14.i22131 ; <double> [#uses=1]
- %tmp.17.i22134 = getelementptr %"struct.std::dcomplex"* %tmp.0.i22129, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i22135 = load double* %tmp.17.i22134 ; <double> [#uses=1]
- %tmp.7.i22089 = load double* %tmp.2.i34366 ; <double> [#uses=1]
- %tmp.15.i22103 = add double %tmp.7.i22089, %tmp.15.i22132 ; <double> [#uses=1]
- store double %tmp.15.i22103, double* %tmp.2.i34366
- %tmp.26.i22110 = load double* %tmp.6.i34367 ; <double> [#uses=1]
- %tmp.31.i22121 = add double %tmp.26.i22110, %tmp.18.i22135 ; <double> [#uses=1]
- store double %tmp.31.i22121, double* %tmp.6.i34367
- %tmp.4.i22069 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i22068, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i22071 = load double* %tmp.5.i33146 ; <double> [#uses=1]
- store double %tmp.6.i22071, double* %tmp.4.i22069
- %tmp.7.i22072 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i22068, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i22074 = load double* %tmp.8.i33149 ; <double> [#uses=1]
- store double %tmp.9.i22074, double* %tmp.7.i22072
- %tmp.0.i22075 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i22068, %"struct.std::dcomplex"* %tmp.12 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i22077 = getelementptr %"struct.std::dcomplex"* %tmp.0.i22075, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i22078 = load double* %tmp.14.i22077 ; <double> [#uses=1]
- %tmp.17.i22080 = getelementptr %"struct.std::dcomplex"* %tmp.0.i22075, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i22081 = load double* %tmp.17.i22080 ; <double> [#uses=1]
- %tmp.4.i22055 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i22054, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i22057 = load double* %tmp.5.i34352 ; <double> [#uses=1]
- store double %tmp.6.i22057, double* %tmp.4.i22055
- %tmp.7.i22058 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i22054, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i22060 = load double* %tmp.8.i34355 ; <double> [#uses=1]
- store double %tmp.9.i22060, double* %tmp.7.i22058
- %tmp.0.i22061 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i22054, %"struct.std::dcomplex"* %tmp.226 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i22062 = getelementptr %"struct.std::dcomplex"* %mem_tmp.662, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i22063 = getelementptr %"struct.std::dcomplex"* %tmp.0.i22061, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i22064 = load double* %tmp.14.i22063 ; <double> [#uses=1]
- store double %tmp.15.i22064, double* %tmp.13.i22062
- %tmp.16.i22065 = getelementptr %"struct.std::dcomplex"* %mem_tmp.662, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i22066 = getelementptr %"struct.std::dcomplex"* %tmp.0.i22061, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i22067 = load double* %tmp.17.i22066 ; <double> [#uses=1]
- store double %tmp.18.i22067, double* %tmp.16.i22065
- %tmp.4.i22041 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i22040, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i22078, double* %tmp.4.i22041
- %tmp.7.i22044 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i22040, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i22081, double* %tmp.7.i22044
- %tmp.0.i22047 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i22040, %"struct.std::dcomplex"* %mem_tmp.662 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i22049 = getelementptr %"struct.std::dcomplex"* %tmp.0.i22047, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i22050 = load double* %tmp.14.i22049 ; <double> [#uses=1]
- %tmp.17.i22052 = getelementptr %"struct.std::dcomplex"* %tmp.0.i22047, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i22053 = load double* %tmp.17.i22052 ; <double> [#uses=1]
- %tmp.4.i22027 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i22026, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i22050, double* %tmp.4.i22027
- %tmp.7.i22030 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i22026, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i22053, double* %tmp.7.i22030
- %tmp.0.i22033 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i22026, %"struct.std::dcomplex"* %tmp.1075 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i22035 = getelementptr %"struct.std::dcomplex"* %tmp.0.i22033, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i22036 = load double* %tmp.14.i22035 ; <double> [#uses=1]
- %tmp.17.i22038 = getelementptr %"struct.std::dcomplex"* %tmp.0.i22033, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i22039 = load double* %tmp.17.i22038 ; <double> [#uses=1]
- %tmp.4.i22013 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i22012, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i22015 = load double* %tmp.5.i28602 ; <double> [#uses=1]
- store double %tmp.6.i22015, double* %tmp.4.i22013
- %tmp.7.i22016 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i22012, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i22018 = load double* %tmp.8.i28605 ; <double> [#uses=1]
- store double %tmp.9.i22018, double* %tmp.7.i22016
- %tmp.0.i22019 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i22012, %"struct.std::dcomplex"* %tmp.226 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i22021 = getelementptr %"struct.std::dcomplex"* %tmp.0.i22019, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i22022 = load double* %tmp.14.i22021 ; <double> [#uses=1]
- %tmp.17.i22024 = getelementptr %"struct.std::dcomplex"* %tmp.0.i22019, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i22025 = load double* %tmp.17.i22024 ; <double> [#uses=1]
- %tmp.4.i21999 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i21998, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i22001 = load double* %tmp.5.i33146 ; <double> [#uses=1]
- store double %tmp.6.i22001, double* %tmp.4.i21999
- %tmp.7.i22002 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i21998, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i22004 = load double* %tmp.8.i33149 ; <double> [#uses=1]
- store double %tmp.9.i22004, double* %tmp.7.i22002
- %tmp.0.i22005 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i21998, %"struct.std::dcomplex"* %tmp.1036 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i22006 = getelementptr %"struct.std::dcomplex"* %mem_tmp.666, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i22007 = getelementptr %"struct.std::dcomplex"* %tmp.0.i22005, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i22008 = load double* %tmp.14.i22007 ; <double> [#uses=1]
- store double %tmp.15.i22008, double* %tmp.13.i22006
- %tmp.16.i22009 = getelementptr %"struct.std::dcomplex"* %mem_tmp.666, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i22010 = getelementptr %"struct.std::dcomplex"* %tmp.0.i22005, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i22011 = load double* %tmp.17.i22010 ; <double> [#uses=1]
- store double %tmp.18.i22011, double* %tmp.16.i22009
- %tmp.4.i21985 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i21984, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i22022, double* %tmp.4.i21985
- %tmp.7.i21988 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i21984, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i22025, double* %tmp.7.i21988
- %tmp.0.i21991 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i21984, %"struct.std::dcomplex"* %mem_tmp.666 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i21993 = getelementptr %"struct.std::dcomplex"* %tmp.0.i21991, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i21994 = load double* %tmp.14.i21993 ; <double> [#uses=1]
- %tmp.17.i21996 = getelementptr %"struct.std::dcomplex"* %tmp.0.i21991, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i21997 = load double* %tmp.17.i21996 ; <double> [#uses=1]
- %tmp.4.i21971 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i21970, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i21994, double* %tmp.4.i21971
- %tmp.7.i21974 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i21970, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i21997, double* %tmp.7.i21974
- %tmp.0.i21977 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i21970, %"struct.std::dcomplex"* %tmp.30 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i21978 = getelementptr %"struct.std::dcomplex"* %mem_tmp.663, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i21979 = getelementptr %"struct.std::dcomplex"* %tmp.0.i21977, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i21980 = load double* %tmp.14.i21979 ; <double> [#uses=1]
- store double %tmp.15.i21980, double* %tmp.13.i21978
- %tmp.16.i21981 = getelementptr %"struct.std::dcomplex"* %mem_tmp.663, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i21982 = getelementptr %"struct.std::dcomplex"* %tmp.0.i21977, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i21983 = load double* %tmp.17.i21982 ; <double> [#uses=1]
- store double %tmp.18.i21983, double* %tmp.16.i21981
- %tmp.4.i21957 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i21956, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i22036, double* %tmp.4.i21957
- %tmp.7.i21960 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i21956, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i22039, double* %tmp.7.i21960
- %tmp.0.i21963 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i21956, %"struct.std::dcomplex"* %mem_tmp.663 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i21965 = getelementptr %"struct.std::dcomplex"* %tmp.0.i21963, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i21966 = load double* %tmp.14.i21965 ; <double> [#uses=1]
- %tmp.17.i21968 = getelementptr %"struct.std::dcomplex"* %tmp.0.i21963, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i21969 = load double* %tmp.17.i21968 ; <double> [#uses=1]
- %tmp.4.i21943 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i21942, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i21945 = load double* %tmp.5.i34352 ; <double> [#uses=1]
- store double %tmp.6.i21945, double* %tmp.4.i21943
- %tmp.7.i21946 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i21942, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i21948 = load double* %tmp.8.i34355 ; <double> [#uses=1]
- store double %tmp.9.i21948, double* %tmp.7.i21946
- %tmp.0.i21949 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i21942, %"struct.std::dcomplex"* %tmp.1036 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i21951 = getelementptr %"struct.std::dcomplex"* %tmp.0.i21949, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i21952 = load double* %tmp.14.i21951 ; <double> [#uses=1]
- %tmp.17.i21954 = getelementptr %"struct.std::dcomplex"* %tmp.0.i21949, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i21955 = load double* %tmp.17.i21954 ; <double> [#uses=1]
- %tmp.4.i21929 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i21928, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i21931 = load double* %tmp.5.i28602 ; <double> [#uses=1]
- store double %tmp.6.i21931, double* %tmp.4.i21929
- %tmp.7.i21932 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i21928, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i21934 = load double* %tmp.8.i28605 ; <double> [#uses=1]
- store double %tmp.9.i21934, double* %tmp.7.i21932
- %tmp.0.i21935 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i21928, %"struct.std::dcomplex"* %tmp.12 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i21936 = getelementptr %"struct.std::dcomplex"* %mem_tmp.670, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i21937 = getelementptr %"struct.std::dcomplex"* %tmp.0.i21935, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i21938 = load double* %tmp.14.i21937 ; <double> [#uses=1]
- store double %tmp.15.i21938, double* %tmp.13.i21936
- %tmp.16.i21939 = getelementptr %"struct.std::dcomplex"* %mem_tmp.670, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i21940 = getelementptr %"struct.std::dcomplex"* %tmp.0.i21935, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i21941 = load double* %tmp.17.i21940 ; <double> [#uses=1]
- store double %tmp.18.i21941, double* %tmp.16.i21939
- %tmp.4.i21915 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i21914, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i21952, double* %tmp.4.i21915
- %tmp.7.i21918 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i21914, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i21955, double* %tmp.7.i21918
- %tmp.0.i21921 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i21914, %"struct.std::dcomplex"* %mem_tmp.670 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i21923 = getelementptr %"struct.std::dcomplex"* %tmp.0.i21921, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i21924 = load double* %tmp.14.i21923 ; <double> [#uses=1]
- %tmp.17.i21926 = getelementptr %"struct.std::dcomplex"* %tmp.0.i21921, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i21927 = load double* %tmp.17.i21926 ; <double> [#uses=1]
- %tmp.4.i21901 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i21900, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i21924, double* %tmp.4.i21901
- %tmp.7.i21904 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i21900, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i21927, double* %tmp.7.i21904
- %tmp.0.i21907 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i21900, %"struct.std::dcomplex"* %tmp.220 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i21908 = getelementptr %"struct.std::dcomplex"* %mem_tmp.667, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i21909 = getelementptr %"struct.std::dcomplex"* %tmp.0.i21907, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i21910 = load double* %tmp.14.i21909 ; <double> [#uses=1]
- store double %tmp.15.i21910, double* %tmp.13.i21908
- %tmp.16.i21911 = getelementptr %"struct.std::dcomplex"* %mem_tmp.667, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i21912 = getelementptr %"struct.std::dcomplex"* %tmp.0.i21907, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i21913 = load double* %tmp.17.i21912 ; <double> [#uses=1]
- store double %tmp.18.i21913, double* %tmp.16.i21911
- %tmp.4.i21887 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i21886, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i21966, double* %tmp.4.i21887
- %tmp.7.i21890 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i21886, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i21969, double* %tmp.7.i21890
- %tmp.0.i21893 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i21886, %"struct.std::dcomplex"* %mem_tmp.667 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i21895 = getelementptr %"struct.std::dcomplex"* %tmp.0.i21893, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i21896 = load double* %tmp.14.i21895 ; <double> [#uses=1]
- %tmp.17.i21898 = getelementptr %"struct.std::dcomplex"* %tmp.0.i21893, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i21899 = load double* %tmp.17.i21898 ; <double> [#uses=1]
- store double %tmp.15.i21896, double* %tmp.2.i34364
- store double %tmp.18.i21899, double* %tmp.6.i34365
- %tmp.4.i21853 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i21852, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i21855 = load double* %tmp.5.i34136 ; <double> [#uses=1]
- store double %tmp.6.i21855, double* %tmp.4.i21853
- %tmp.7.i21856 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i21852, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i21858 = load double* %tmp.8.i34139 ; <double> [#uses=1]
- store double %tmp.9.i21858, double* %tmp.7.i21856
- %tmp.0.i21859 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i21852, %"struct.std::dcomplex"* %ret3 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i21861 = getelementptr %"struct.std::dcomplex"* %tmp.0.i21859, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i21862 = load double* %tmp.14.i21861 ; <double> [#uses=1]
- %tmp.17.i21864 = getelementptr %"struct.std::dcomplex"* %tmp.0.i21859, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i21865 = load double* %tmp.17.i21864 ; <double> [#uses=1]
- %tmp.7.i21819 = load double* %tmp.2.i34366 ; <double> [#uses=1]
- %tmp.15.i21833 = add double %tmp.7.i21819, %tmp.15.i21862 ; <double> [#uses=1]
- store double %tmp.15.i21833, double* %tmp.2.i34366
- %tmp.26.i21840 = load double* %tmp.6.i34367 ; <double> [#uses=1]
- %tmp.31.i21851 = add double %tmp.26.i21840, %tmp.18.i21865 ; <double> [#uses=1]
- store double %tmp.31.i21851, double* %tmp.6.i34367
- %tmp.4.i21799 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i21798, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i21801 = load double* %tmp.5.i29864 ; <double> [#uses=1]
- store double %tmp.6.i21801, double* %tmp.4.i21799
- %tmp.7.i21802 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i21798, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i21804 = load double* %tmp.8.i29867 ; <double> [#uses=1]
- store double %tmp.9.i21804, double* %tmp.7.i21802
- %tmp.0.i21805 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i21798, %"struct.std::dcomplex"* %ret4 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i21807 = getelementptr %"struct.std::dcomplex"* %tmp.0.i21805, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i21808 = load double* %tmp.14.i21807 ; <double> [#uses=1]
- %tmp.17.i21810 = getelementptr %"struct.std::dcomplex"* %tmp.0.i21805, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i21811 = load double* %tmp.17.i21810 ; <double> [#uses=1]
- %tmp.7.i21765 = load double* %tmp.2.i34368 ; <double> [#uses=1]
- %tmp.15.i21779 = add double %tmp.7.i21765, %tmp.15.i21808 ; <double> [#uses=1]
- store double %tmp.15.i21779, double* %tmp.2.i34368
- %tmp.26.i21786 = load double* %tmp.6.i34369 ; <double> [#uses=1]
- %tmp.31.i21797 = add double %tmp.26.i21786, %tmp.18.i21811 ; <double> [#uses=1]
- store double %tmp.31.i21797, double* %tmp.6.i34369
- store double 0.000000e+00, double* %tmp.2.i34366
- store double 0.000000e+00, double* %tmp.6.i34367
- %tmp.4.i21743 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i21742, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i21745 = load double* %tmp.5.i28602 ; <double> [#uses=1]
- store double %tmp.6.i21745, double* %tmp.4.i21743
- %tmp.7.i21746 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i21742, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i21748 = load double* %tmp.8.i28605 ; <double> [#uses=1]
- store double %tmp.9.i21748, double* %tmp.7.i21746
- %tmp.0.i21749 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i21742, %"struct.std::dcomplex"* %tmp.12 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i21751 = getelementptr %"struct.std::dcomplex"* %tmp.0.i21749, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i21752 = load double* %tmp.14.i21751 ; <double> [#uses=1]
- %tmp.17.i21754 = getelementptr %"struct.std::dcomplex"* %tmp.0.i21749, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i21755 = load double* %tmp.17.i21754 ; <double> [#uses=1]
- %tmp.4.i21729 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i21728, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i21731 = load double* %tmp.5.i34352 ; <double> [#uses=1]
- store double %tmp.6.i21731, double* %tmp.4.i21729
- %tmp.7.i21732 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i21728, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i21734 = load double* %tmp.8.i34355 ; <double> [#uses=1]
- store double %tmp.9.i21734, double* %tmp.7.i21732
- %tmp.0.i21735 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i21728, %"struct.std::dcomplex"* %tmp.1036 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i21736 = getelementptr %"struct.std::dcomplex"* %mem_tmp.678, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i21737 = getelementptr %"struct.std::dcomplex"* %tmp.0.i21735, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i21738 = load double* %tmp.14.i21737 ; <double> [#uses=1]
- store double %tmp.15.i21738, double* %tmp.13.i21736
- %tmp.16.i21739 = getelementptr %"struct.std::dcomplex"* %mem_tmp.678, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i21740 = getelementptr %"struct.std::dcomplex"* %tmp.0.i21735, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i21741 = load double* %tmp.17.i21740 ; <double> [#uses=1]
- store double %tmp.18.i21741, double* %tmp.16.i21739
- %tmp.4.i21715 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i21714, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i21752, double* %tmp.4.i21715
- %tmp.7.i21718 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i21714, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i21755, double* %tmp.7.i21718
- %tmp.0.i21721 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i21714, %"struct.std::dcomplex"* %mem_tmp.678 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i21723 = getelementptr %"struct.std::dcomplex"* %tmp.0.i21721, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i21724 = load double* %tmp.14.i21723 ; <double> [#uses=1]
- %tmp.17.i21726 = getelementptr %"struct.std::dcomplex"* %tmp.0.i21721, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i21727 = load double* %tmp.17.i21726 ; <double> [#uses=1]
- %tmp.4.i21701 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i21700, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i21724, double* %tmp.4.i21701
- %tmp.7.i21704 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i21700, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i21727, double* %tmp.7.i21704
- %tmp.0.i21707 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i21700, %"struct.std::dcomplex"* %tmp.220 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i21709 = getelementptr %"struct.std::dcomplex"* %tmp.0.i21707, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i21710 = load double* %tmp.14.i21709 ; <double> [#uses=1]
- %tmp.17.i21712 = getelementptr %"struct.std::dcomplex"* %tmp.0.i21707, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i21713 = load double* %tmp.17.i21712 ; <double> [#uses=1]
- %tmp.4.i21687 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i21686, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i21689 = load double* %tmp.5.i34352 ; <double> [#uses=1]
- store double %tmp.6.i21689, double* %tmp.4.i21687
- %tmp.7.i21690 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i21686, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i21692 = load double* %tmp.8.i34355 ; <double> [#uses=1]
- store double %tmp.9.i21692, double* %tmp.7.i21690
- %tmp.0.i21693 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i21686, %"struct.std::dcomplex"* %tmp.226 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i21695 = getelementptr %"struct.std::dcomplex"* %tmp.0.i21693, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i21696 = load double* %tmp.14.i21695 ; <double> [#uses=1]
- %tmp.17.i21698 = getelementptr %"struct.std::dcomplex"* %tmp.0.i21693, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i21699 = load double* %tmp.17.i21698 ; <double> [#uses=1]
- %tmp.4.i21673 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i21672, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i21675 = load double* %tmp.5.i33146 ; <double> [#uses=1]
- store double %tmp.6.i21675, double* %tmp.4.i21673
- %tmp.7.i21676 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i21672, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i21678 = load double* %tmp.8.i33149 ; <double> [#uses=1]
- store double %tmp.9.i21678, double* %tmp.7.i21676
- %tmp.0.i21679 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i21672, %"struct.std::dcomplex"* %tmp.12 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i21680 = getelementptr %"struct.std::dcomplex"* %mem_tmp.682, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i21681 = getelementptr %"struct.std::dcomplex"* %tmp.0.i21679, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i21682 = load double* %tmp.14.i21681 ; <double> [#uses=1]
- store double %tmp.15.i21682, double* %tmp.13.i21680
- %tmp.16.i21683 = getelementptr %"struct.std::dcomplex"* %mem_tmp.682, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i21684 = getelementptr %"struct.std::dcomplex"* %tmp.0.i21679, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i21685 = load double* %tmp.17.i21684 ; <double> [#uses=1]
- store double %tmp.18.i21685, double* %tmp.16.i21683
- %tmp.4.i21659 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i21658, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i21696, double* %tmp.4.i21659
- %tmp.7.i21662 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i21658, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i21699, double* %tmp.7.i21662
- %tmp.0.i21665 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i21658, %"struct.std::dcomplex"* %mem_tmp.682 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i21667 = getelementptr %"struct.std::dcomplex"* %tmp.0.i21665, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i21668 = load double* %tmp.14.i21667 ; <double> [#uses=1]
- %tmp.17.i21670 = getelementptr %"struct.std::dcomplex"* %tmp.0.i21665, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i21671 = load double* %tmp.17.i21670 ; <double> [#uses=1]
- %tmp.4.i21645 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i21644, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i21668, double* %tmp.4.i21645
- %tmp.7.i21648 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i21644, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i21671, double* %tmp.7.i21648
- %tmp.0.i21651 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i21644, %"struct.std::dcomplex"* %tmp.1075 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i21652 = getelementptr %"struct.std::dcomplex"* %mem_tmp.679, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i21653 = getelementptr %"struct.std::dcomplex"* %tmp.0.i21651, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i21654 = load double* %tmp.14.i21653 ; <double> [#uses=1]
- store double %tmp.15.i21654, double* %tmp.13.i21652
- %tmp.16.i21655 = getelementptr %"struct.std::dcomplex"* %mem_tmp.679, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i21656 = getelementptr %"struct.std::dcomplex"* %tmp.0.i21651, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i21657 = load double* %tmp.17.i21656 ; <double> [#uses=1]
- store double %tmp.18.i21657, double* %tmp.16.i21655
- %tmp.4.i21631 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i21630, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i21710, double* %tmp.4.i21631
- %tmp.7.i21634 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i21630, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i21713, double* %tmp.7.i21634
- %tmp.0.i21637 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i21630, %"struct.std::dcomplex"* %mem_tmp.679 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i21639 = getelementptr %"struct.std::dcomplex"* %tmp.0.i21637, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i21640 = load double* %tmp.14.i21639 ; <double> [#uses=1]
- %tmp.17.i21642 = getelementptr %"struct.std::dcomplex"* %tmp.0.i21637, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i21643 = load double* %tmp.17.i21642 ; <double> [#uses=1]
- %tmp.4.i21617 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i21616, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i21619 = load double* %tmp.5.i33146 ; <double> [#uses=1]
- store double %tmp.6.i21619, double* %tmp.4.i21617
- %tmp.7.i21620 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i21616, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i21622 = load double* %tmp.8.i33149 ; <double> [#uses=1]
- store double %tmp.9.i21622, double* %tmp.7.i21620
- %tmp.0.i21623 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i21616, %"struct.std::dcomplex"* %tmp.1036 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i21625 = getelementptr %"struct.std::dcomplex"* %tmp.0.i21623, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i21626 = load double* %tmp.14.i21625 ; <double> [#uses=1]
- %tmp.17.i21628 = getelementptr %"struct.std::dcomplex"* %tmp.0.i21623, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i21629 = load double* %tmp.17.i21628 ; <double> [#uses=1]
- %tmp.4.i21603 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i21602, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i21605 = load double* %tmp.5.i28602 ; <double> [#uses=1]
- store double %tmp.6.i21605, double* %tmp.4.i21603
- %tmp.7.i21606 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i21602, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i21608 = load double* %tmp.8.i28605 ; <double> [#uses=1]
- store double %tmp.9.i21608, double* %tmp.7.i21606
- %tmp.0.i21609 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i21602, %"struct.std::dcomplex"* %tmp.226 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i21610 = getelementptr %"struct.std::dcomplex"* %mem_tmp.686, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i21611 = getelementptr %"struct.std::dcomplex"* %tmp.0.i21609, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i21612 = load double* %tmp.14.i21611 ; <double> [#uses=1]
- store double %tmp.15.i21612, double* %tmp.13.i21610
- %tmp.16.i21613 = getelementptr %"struct.std::dcomplex"* %mem_tmp.686, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i21614 = getelementptr %"struct.std::dcomplex"* %tmp.0.i21609, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i21615 = load double* %tmp.17.i21614 ; <double> [#uses=1]
- store double %tmp.18.i21615, double* %tmp.16.i21613
- %tmp.4.i21589 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i21588, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i21626, double* %tmp.4.i21589
- %tmp.7.i21592 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i21588, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i21629, double* %tmp.7.i21592
- %tmp.0.i21595 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i21588, %"struct.std::dcomplex"* %mem_tmp.686 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i21597 = getelementptr %"struct.std::dcomplex"* %tmp.0.i21595, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i21598 = load double* %tmp.14.i21597 ; <double> [#uses=1]
- %tmp.17.i21600 = getelementptr %"struct.std::dcomplex"* %tmp.0.i21595, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i21601 = load double* %tmp.17.i21600 ; <double> [#uses=1]
- %tmp.4.i21575 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i21574, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i21598, double* %tmp.4.i21575
- %tmp.7.i21578 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i21574, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i21601, double* %tmp.7.i21578
- %tmp.0.i21581 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i21574, %"struct.std::dcomplex"* %tmp.30 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i21582 = getelementptr %"struct.std::dcomplex"* %mem_tmp.683, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i21583 = getelementptr %"struct.std::dcomplex"* %tmp.0.i21581, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i21584 = load double* %tmp.14.i21583 ; <double> [#uses=1]
- store double %tmp.15.i21584, double* %tmp.13.i21582
- %tmp.16.i21585 = getelementptr %"struct.std::dcomplex"* %mem_tmp.683, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i21586 = getelementptr %"struct.std::dcomplex"* %tmp.0.i21581, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i21587 = load double* %tmp.17.i21586 ; <double> [#uses=1]
- store double %tmp.18.i21587, double* %tmp.16.i21585
- %tmp.4.i21561 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i21560, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i21640, double* %tmp.4.i21561
- %tmp.7.i21564 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i21560, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i21643, double* %tmp.7.i21564
- %tmp.0.i21567 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i21560, %"struct.std::dcomplex"* %mem_tmp.683 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i21569 = getelementptr %"struct.std::dcomplex"* %tmp.0.i21567, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i21570 = load double* %tmp.14.i21569 ; <double> [#uses=1]
- %tmp.17.i21572 = getelementptr %"struct.std::dcomplex"* %tmp.0.i21567, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i21573 = load double* %tmp.17.i21572 ; <double> [#uses=1]
- store double %tmp.15.i21570, double* %tmp.2.i34364
- store double %tmp.18.i21573, double* %tmp.6.i34365
- %tmp.4.i21527 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i21526, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i21529 = load double* %tmp.5.i33326 ; <double> [#uses=1]
- store double %tmp.6.i21529, double* %tmp.4.i21527
- %tmp.7.i21530 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i21526, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i21532 = load double* %tmp.8.i33329 ; <double> [#uses=1]
- store double %tmp.9.i21532, double* %tmp.7.i21530
- %tmp.0.i21533 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i21526, %"struct.std::dcomplex"* %ret3 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i21535 = getelementptr %"struct.std::dcomplex"* %tmp.0.i21533, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i21536 = load double* %tmp.14.i21535 ; <double> [#uses=1]
- %tmp.17.i21538 = getelementptr %"struct.std::dcomplex"* %tmp.0.i21533, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i21539 = load double* %tmp.17.i21538 ; <double> [#uses=1]
- %tmp.7.i21493 = load double* %tmp.2.i34366 ; <double> [#uses=1]
- %tmp.15.i21507 = add double %tmp.7.i21493, %tmp.15.i21536 ; <double> [#uses=1]
- store double %tmp.15.i21507, double* %tmp.2.i34366
- %tmp.26.i21514 = load double* %tmp.6.i34367 ; <double> [#uses=1]
- %tmp.31.i21525 = add double %tmp.26.i21514, %tmp.18.i21539 ; <double> [#uses=1]
- store double %tmp.31.i21525, double* %tmp.6.i34367
- %tmp.4.i21473 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i21472, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i21475 = load double* %tmp.5.i28602 ; <double> [#uses=1]
- store double %tmp.6.i21475, double* %tmp.4.i21473
- %tmp.7.i21476 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i21472, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i21478 = load double* %tmp.8.i28605 ; <double> [#uses=1]
- store double %tmp.9.i21478, double* %tmp.7.i21476
- %tmp.0.i21479 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i21472, %"struct.std::dcomplex"* %tmp.21 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i21481 = getelementptr %"struct.std::dcomplex"* %tmp.0.i21479, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i21482 = load double* %tmp.14.i21481 ; <double> [#uses=1]
- %tmp.17.i21484 = getelementptr %"struct.std::dcomplex"* %tmp.0.i21479, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i21485 = load double* %tmp.17.i21484 ; <double> [#uses=1]
- %tmp.4.i21459 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i21458, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i21461 = load double* %tmp.5.i34282 ; <double> [#uses=1]
- store double %tmp.6.i21461, double* %tmp.4.i21459
- %tmp.7.i21462 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i21458, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i21464 = load double* %tmp.8.i34285 ; <double> [#uses=1]
- store double %tmp.9.i21464, double* %tmp.7.i21462
- %tmp.0.i21465 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i21458, %"struct.std::dcomplex"* %tmp.1036 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i21466 = getelementptr %"struct.std::dcomplex"* %mem_tmp.693, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i21467 = getelementptr %"struct.std::dcomplex"* %tmp.0.i21465, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i21468 = load double* %tmp.14.i21467 ; <double> [#uses=1]
- store double %tmp.15.i21468, double* %tmp.13.i21466
- %tmp.16.i21469 = getelementptr %"struct.std::dcomplex"* %mem_tmp.693, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i21470 = getelementptr %"struct.std::dcomplex"* %tmp.0.i21465, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i21471 = load double* %tmp.17.i21470 ; <double> [#uses=1]
- store double %tmp.18.i21471, double* %tmp.16.i21469
- %tmp.4.i21445 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i21444, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i21482, double* %tmp.4.i21445
- %tmp.7.i21448 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i21444, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i21485, double* %tmp.7.i21448
- %tmp.0.i21451 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i21444, %"struct.std::dcomplex"* %mem_tmp.693 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i21453 = getelementptr %"struct.std::dcomplex"* %tmp.0.i21451, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i21454 = load double* %tmp.14.i21453 ; <double> [#uses=1]
- %tmp.17.i21456 = getelementptr %"struct.std::dcomplex"* %tmp.0.i21451, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i21457 = load double* %tmp.17.i21456 ; <double> [#uses=1]
- %tmp.4.i21431 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i21430, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i21454, double* %tmp.4.i21431
- %tmp.7.i21434 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i21430, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i21457, double* %tmp.7.i21434
- %tmp.0.i21437 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i21430, %"struct.std::dcomplex"* %tmp.30 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i21439 = getelementptr %"struct.std::dcomplex"* %tmp.0.i21437, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i21440 = load double* %tmp.14.i21439 ; <double> [#uses=1]
- %tmp.17.i21442 = getelementptr %"struct.std::dcomplex"* %tmp.0.i21437, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i21443 = load double* %tmp.17.i21442 ; <double> [#uses=1]
- %tmp.4.i21417 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i21416, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i21419 = load double* %tmp.5.i34352 ; <double> [#uses=1]
- store double %tmp.6.i21419, double* %tmp.4.i21417
- %tmp.7.i21420 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i21416, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i21422 = load double* %tmp.8.i34355 ; <double> [#uses=1]
- store double %tmp.9.i21422, double* %tmp.7.i21420
- %tmp.0.i21423 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i21416, %"struct.std::dcomplex"* %tmp.1036 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i21425 = getelementptr %"struct.std::dcomplex"* %tmp.0.i21423, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i21426 = load double* %tmp.14.i21425 ; <double> [#uses=1]
- %tmp.17.i21428 = getelementptr %"struct.std::dcomplex"* %tmp.0.i21423, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i21429 = load double* %tmp.17.i21428 ; <double> [#uses=1]
- %tmp.4.i21403 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i21402, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i21405 = load double* %tmp.5.i28602 ; <double> [#uses=1]
- store double %tmp.6.i21405, double* %tmp.4.i21403
- %tmp.7.i21406 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i21402, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i21408 = load double* %tmp.8.i28605 ; <double> [#uses=1]
- store double %tmp.9.i21408, double* %tmp.7.i21406
- %tmp.0.i21409 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i21402, %"struct.std::dcomplex"* %tmp.12 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i21410 = getelementptr %"struct.std::dcomplex"* %mem_tmp.697, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i21411 = getelementptr %"struct.std::dcomplex"* %tmp.0.i21409, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i21412 = load double* %tmp.14.i21411 ; <double> [#uses=1]
- store double %tmp.15.i21412, double* %tmp.13.i21410
- %tmp.16.i21413 = getelementptr %"struct.std::dcomplex"* %mem_tmp.697, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i21414 = getelementptr %"struct.std::dcomplex"* %tmp.0.i21409, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i21415 = load double* %tmp.17.i21414 ; <double> [#uses=1]
- store double %tmp.18.i21415, double* %tmp.16.i21413
- %tmp.4.i21389 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i21388, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i21426, double* %tmp.4.i21389
- %tmp.7.i21392 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i21388, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i21429, double* %tmp.7.i21392
- %tmp.0.i21395 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i21388, %"struct.std::dcomplex"* %mem_tmp.697 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i21397 = getelementptr %"struct.std::dcomplex"* %tmp.0.i21395, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i21398 = load double* %tmp.14.i21397 ; <double> [#uses=1]
- %tmp.17.i21400 = getelementptr %"struct.std::dcomplex"* %tmp.0.i21395, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i21401 = load double* %tmp.17.i21400 ; <double> [#uses=1]
- %tmp.4.i21375 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i21374, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i21398, double* %tmp.4.i21375
- %tmp.7.i21378 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i21374, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i21401, double* %tmp.7.i21378
- %tmp.0.i21381 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i21374, %"struct.std::dcomplex"* %tmp.15 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i21382 = getelementptr %"struct.std::dcomplex"* %mem_tmp.694, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i21383 = getelementptr %"struct.std::dcomplex"* %tmp.0.i21381, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i21384 = load double* %tmp.14.i21383 ; <double> [#uses=1]
- store double %tmp.15.i21384, double* %tmp.13.i21382
- %tmp.16.i21385 = getelementptr %"struct.std::dcomplex"* %mem_tmp.694, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i21386 = getelementptr %"struct.std::dcomplex"* %tmp.0.i21381, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i21387 = load double* %tmp.17.i21386 ; <double> [#uses=1]
- store double %tmp.18.i21387, double* %tmp.16.i21385
- %tmp.4.i21361 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i21360, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i21440, double* %tmp.4.i21361
- %tmp.7.i21364 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i21360, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i21443, double* %tmp.7.i21364
- %tmp.0.i21367 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i21360, %"struct.std::dcomplex"* %mem_tmp.694 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i21369 = getelementptr %"struct.std::dcomplex"* %tmp.0.i21367, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i21370 = load double* %tmp.14.i21369 ; <double> [#uses=1]
- %tmp.17.i21372 = getelementptr %"struct.std::dcomplex"* %tmp.0.i21367, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i21373 = load double* %tmp.17.i21372 ; <double> [#uses=1]
- %tmp.4.i21347 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i21346, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i21349 = load double* %tmp.5.i34282 ; <double> [#uses=1]
- store double %tmp.6.i21349, double* %tmp.4.i21347
- %tmp.7.i21350 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i21346, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i21352 = load double* %tmp.8.i34285 ; <double> [#uses=1]
- store double %tmp.9.i21352, double* %tmp.7.i21350
- %tmp.0.i21353 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i21346, %"struct.std::dcomplex"* %tmp.12 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i21355 = getelementptr %"struct.std::dcomplex"* %tmp.0.i21353, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i21356 = load double* %tmp.14.i21355 ; <double> [#uses=1]
- %tmp.17.i21358 = getelementptr %"struct.std::dcomplex"* %tmp.0.i21353, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i21359 = load double* %tmp.17.i21358 ; <double> [#uses=1]
- %tmp.4.i21333 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i21332, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i21335 = load double* %tmp.5.i34352 ; <double> [#uses=1]
- store double %tmp.6.i21335, double* %tmp.4.i21333
- %tmp.7.i21336 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i21332, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i21338 = load double* %tmp.8.i34355 ; <double> [#uses=1]
- store double %tmp.9.i21338, double* %tmp.7.i21336
- %tmp.0.i21339 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i21332, %"struct.std::dcomplex"* %tmp.21 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i21340 = getelementptr %"struct.std::dcomplex"* %mem_tmp.701, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i21341 = getelementptr %"struct.std::dcomplex"* %tmp.0.i21339, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i21342 = load double* %tmp.14.i21341 ; <double> [#uses=1]
- store double %tmp.15.i21342, double* %tmp.13.i21340
- %tmp.16.i21343 = getelementptr %"struct.std::dcomplex"* %mem_tmp.701, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i21344 = getelementptr %"struct.std::dcomplex"* %tmp.0.i21339, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i21345 = load double* %tmp.17.i21344 ; <double> [#uses=1]
- store double %tmp.18.i21345, double* %tmp.16.i21343
- %tmp.4.i21319 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i21318, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i21356, double* %tmp.4.i21319
- %tmp.7.i21322 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i21318, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i21359, double* %tmp.7.i21322
- %tmp.0.i21325 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i21318, %"struct.std::dcomplex"* %mem_tmp.701 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i21327 = getelementptr %"struct.std::dcomplex"* %tmp.0.i21325, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i21328 = load double* %tmp.14.i21327 ; <double> [#uses=1]
- %tmp.17.i21330 = getelementptr %"struct.std::dcomplex"* %tmp.0.i21325, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i21331 = load double* %tmp.17.i21330 ; <double> [#uses=1]
- %tmp.4.i21305 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i21304, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i21328, double* %tmp.4.i21305
- %tmp.7.i21308 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i21304, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i21331, double* %tmp.7.i21308
- %tmp.0.i21311 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i21304, %"struct.std::dcomplex"* %tmp.1075 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i21312 = getelementptr %"struct.std::dcomplex"* %mem_tmp.698, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i21313 = getelementptr %"struct.std::dcomplex"* %tmp.0.i21311, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i21314 = load double* %tmp.14.i21313 ; <double> [#uses=1]
- store double %tmp.15.i21314, double* %tmp.13.i21312
- %tmp.16.i21315 = getelementptr %"struct.std::dcomplex"* %mem_tmp.698, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i21316 = getelementptr %"struct.std::dcomplex"* %tmp.0.i21311, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i21317 = load double* %tmp.17.i21316 ; <double> [#uses=1]
- store double %tmp.18.i21317, double* %tmp.16.i21315
- %tmp.4.i21291 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i21290, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i21370, double* %tmp.4.i21291
- %tmp.7.i21294 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i21290, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i21373, double* %tmp.7.i21294
- %tmp.0.i21297 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i21290, %"struct.std::dcomplex"* %mem_tmp.698 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i21299 = getelementptr %"struct.std::dcomplex"* %tmp.0.i21297, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i21300 = load double* %tmp.14.i21299 ; <double> [#uses=1]
- %tmp.17.i21302 = getelementptr %"struct.std::dcomplex"* %tmp.0.i21297, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i21303 = load double* %tmp.17.i21302 ; <double> [#uses=1]
- store double %tmp.15.i21300, double* %tmp.2.i34364
- store double %tmp.18.i21303, double* %tmp.6.i34365
- %tmp.4.i21257 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i21256, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i21259 = load double* %tmp.5.i32460 ; <double> [#uses=1]
- store double %tmp.6.i21259, double* %tmp.4.i21257
- %tmp.7.i21260 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i21256, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i21262 = load double* %tmp.8.i32463 ; <double> [#uses=1]
- store double %tmp.9.i21262, double* %tmp.7.i21260
- %tmp.0.i21263 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i21256, %"struct.std::dcomplex"* %ret3 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i21265 = getelementptr %"struct.std::dcomplex"* %tmp.0.i21263, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i21266 = load double* %tmp.14.i21265 ; <double> [#uses=1]
- %tmp.17.i21268 = getelementptr %"struct.std::dcomplex"* %tmp.0.i21263, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i21269 = load double* %tmp.17.i21268 ; <double> [#uses=1]
- %tmp.7.i21223 = load double* %tmp.2.i34366 ; <double> [#uses=1]
- %tmp.15.i21237 = add double %tmp.7.i21223, %tmp.15.i21266 ; <double> [#uses=1]
- store double %tmp.15.i21237, double* %tmp.2.i34366
- %tmp.26.i21244 = load double* %tmp.6.i34367 ; <double> [#uses=1]
- %tmp.31.i21255 = add double %tmp.26.i21244, %tmp.18.i21269 ; <double> [#uses=1]
- store double %tmp.31.i21255, double* %tmp.6.i34367
- %tmp.4.i21203 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i21202, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i21205 = load double* %tmp.5.i34352 ; <double> [#uses=1]
- store double %tmp.6.i21205, double* %tmp.4.i21203
- %tmp.7.i21206 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i21202, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i21208 = load double* %tmp.8.i34355 ; <double> [#uses=1]
- store double %tmp.9.i21208, double* %tmp.7.i21206
- %tmp.0.i21209 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i21202, %"struct.std::dcomplex"* %tmp.21 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i21211 = getelementptr %"struct.std::dcomplex"* %tmp.0.i21209, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i21212 = load double* %tmp.14.i21211 ; <double> [#uses=1]
- %tmp.17.i21214 = getelementptr %"struct.std::dcomplex"* %tmp.0.i21209, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i21215 = load double* %tmp.17.i21214 ; <double> [#uses=1]
- %tmp.4.i21189 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i21188, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i21191 = load double* %tmp.5.i34282 ; <double> [#uses=1]
- store double %tmp.6.i21191, double* %tmp.4.i21189
- %tmp.7.i21192 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i21188, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i21194 = load double* %tmp.8.i34285 ; <double> [#uses=1]
- store double %tmp.9.i21194, double* %tmp.7.i21192
- %tmp.0.i21195 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i21188, %"struct.std::dcomplex"* %tmp.12 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i21196 = getelementptr %"struct.std::dcomplex"* %mem_tmp.708, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i21197 = getelementptr %"struct.std::dcomplex"* %tmp.0.i21195, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i21198 = load double* %tmp.14.i21197 ; <double> [#uses=1]
- store double %tmp.15.i21198, double* %tmp.13.i21196
- %tmp.16.i21199 = getelementptr %"struct.std::dcomplex"* %mem_tmp.708, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i21200 = getelementptr %"struct.std::dcomplex"* %tmp.0.i21195, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i21201 = load double* %tmp.17.i21200 ; <double> [#uses=1]
- store double %tmp.18.i21201, double* %tmp.16.i21199
- %tmp.4.i21175 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i21174, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i21212, double* %tmp.4.i21175
- %tmp.7.i21178 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i21174, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i21215, double* %tmp.7.i21178
- %tmp.0.i21181 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i21174, %"struct.std::dcomplex"* %mem_tmp.708 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i21183 = getelementptr %"struct.std::dcomplex"* %tmp.0.i21181, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i21184 = load double* %tmp.14.i21183 ; <double> [#uses=1]
- %tmp.17.i21186 = getelementptr %"struct.std::dcomplex"* %tmp.0.i21181, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i21187 = load double* %tmp.17.i21186 ; <double> [#uses=1]
- %tmp.4.i21161 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i21160, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i21184, double* %tmp.4.i21161
- %tmp.7.i21164 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i21160, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i21187, double* %tmp.7.i21164
- %tmp.0.i21167 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i21160, %"struct.std::dcomplex"* %tmp.220 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i21169 = getelementptr %"struct.std::dcomplex"* %tmp.0.i21167, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i21170 = load double* %tmp.14.i21169 ; <double> [#uses=1]
- %tmp.17.i21172 = getelementptr %"struct.std::dcomplex"* %tmp.0.i21167, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i21173 = load double* %tmp.17.i21172 ; <double> [#uses=1]
- %tmp.4.i21147 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i21146, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i21149 = load double* %tmp.5.i34282 ; <double> [#uses=1]
- store double %tmp.6.i21149, double* %tmp.4.i21147
- %tmp.7.i21150 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i21146, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i21152 = load double* %tmp.8.i34285 ; <double> [#uses=1]
- store double %tmp.9.i21152, double* %tmp.7.i21150
- %tmp.0.i21153 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i21146, %"struct.std::dcomplex"* %tmp.226 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i21155 = getelementptr %"struct.std::dcomplex"* %tmp.0.i21153, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i21156 = load double* %tmp.14.i21155 ; <double> [#uses=1]
- %tmp.17.i21158 = getelementptr %"struct.std::dcomplex"* %tmp.0.i21153, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i21159 = load double* %tmp.17.i21158 ; <double> [#uses=1]
- %tmp.4.i21133 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i21132, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i21135 = load double* %tmp.5.i33146 ; <double> [#uses=1]
- store double %tmp.6.i21135, double* %tmp.4.i21133
- %tmp.7.i21136 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i21132, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i21138 = load double* %tmp.8.i33149 ; <double> [#uses=1]
- store double %tmp.9.i21138, double* %tmp.7.i21136
- %tmp.0.i21139 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i21132, %"struct.std::dcomplex"* %tmp.21 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i21140 = getelementptr %"struct.std::dcomplex"* %mem_tmp.712, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i21141 = getelementptr %"struct.std::dcomplex"* %tmp.0.i21139, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i21142 = load double* %tmp.14.i21141 ; <double> [#uses=1]
- store double %tmp.15.i21142, double* %tmp.13.i21140
- %tmp.16.i21143 = getelementptr %"struct.std::dcomplex"* %mem_tmp.712, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i21144 = getelementptr %"struct.std::dcomplex"* %tmp.0.i21139, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i21145 = load double* %tmp.17.i21144 ; <double> [#uses=1]
- store double %tmp.18.i21145, double* %tmp.16.i21143
- %tmp.4.i21119 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i21118, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i21156, double* %tmp.4.i21119
- %tmp.7.i21122 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i21118, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i21159, double* %tmp.7.i21122
- %tmp.0.i21125 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i21118, %"struct.std::dcomplex"* %mem_tmp.712 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i21127 = getelementptr %"struct.std::dcomplex"* %tmp.0.i21125, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i21128 = load double* %tmp.14.i21127 ; <double> [#uses=1]
- %tmp.17.i21130 = getelementptr %"struct.std::dcomplex"* %tmp.0.i21125, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i21131 = load double* %tmp.17.i21130 ; <double> [#uses=1]
- %tmp.4.i21105 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i21104, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i21128, double* %tmp.4.i21105
- %tmp.7.i21108 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i21104, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i21131, double* %tmp.7.i21108
- %tmp.0.i21111 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i21104, %"struct.std::dcomplex"* %tmp.30 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i21112 = getelementptr %"struct.std::dcomplex"* %mem_tmp.709, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i21113 = getelementptr %"struct.std::dcomplex"* %tmp.0.i21111, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i21114 = load double* %tmp.14.i21113 ; <double> [#uses=1]
- store double %tmp.15.i21114, double* %tmp.13.i21112
- %tmp.16.i21115 = getelementptr %"struct.std::dcomplex"* %mem_tmp.709, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i21116 = getelementptr %"struct.std::dcomplex"* %tmp.0.i21111, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i21117 = load double* %tmp.17.i21116 ; <double> [#uses=1]
- store double %tmp.18.i21117, double* %tmp.16.i21115
- %tmp.4.i21091 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i21090, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i21170, double* %tmp.4.i21091
- %tmp.7.i21094 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i21090, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i21173, double* %tmp.7.i21094
- %tmp.0.i21097 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i21090, %"struct.std::dcomplex"* %mem_tmp.709 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i21099 = getelementptr %"struct.std::dcomplex"* %tmp.0.i21097, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i21100 = load double* %tmp.14.i21099 ; <double> [#uses=1]
- %tmp.17.i21102 = getelementptr %"struct.std::dcomplex"* %tmp.0.i21097, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i21103 = load double* %tmp.17.i21102 ; <double> [#uses=1]
- %tmp.4.i21077 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i21076, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i21079 = load double* %tmp.5.i33146 ; <double> [#uses=1]
- store double %tmp.6.i21079, double* %tmp.4.i21077
- %tmp.7.i21080 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i21076, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i21082 = load double* %tmp.8.i33149 ; <double> [#uses=1]
- store double %tmp.9.i21082, double* %tmp.7.i21080
- %tmp.0.i21083 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i21076, %"struct.std::dcomplex"* %tmp.12 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i21085 = getelementptr %"struct.std::dcomplex"* %tmp.0.i21083, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i21086 = load double* %tmp.14.i21085 ; <double> [#uses=1]
- %tmp.17.i21088 = getelementptr %"struct.std::dcomplex"* %tmp.0.i21083, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i21089 = load double* %tmp.17.i21088 ; <double> [#uses=1]
- %tmp.4.i21063 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i21062, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i21065 = load double* %tmp.5.i34352 ; <double> [#uses=1]
- store double %tmp.6.i21065, double* %tmp.4.i21063
- %tmp.7.i21066 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i21062, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i21068 = load double* %tmp.8.i34355 ; <double> [#uses=1]
- store double %tmp.9.i21068, double* %tmp.7.i21066
- %tmp.0.i21069 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i21062, %"struct.std::dcomplex"* %tmp.226 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i21070 = getelementptr %"struct.std::dcomplex"* %mem_tmp.716, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i21071 = getelementptr %"struct.std::dcomplex"* %tmp.0.i21069, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i21072 = load double* %tmp.14.i21071 ; <double> [#uses=1]
- store double %tmp.15.i21072, double* %tmp.13.i21070
- %tmp.16.i21073 = getelementptr %"struct.std::dcomplex"* %mem_tmp.716, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i21074 = getelementptr %"struct.std::dcomplex"* %tmp.0.i21069, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i21075 = load double* %tmp.17.i21074 ; <double> [#uses=1]
- store double %tmp.18.i21075, double* %tmp.16.i21073
- %tmp.4.i21049 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i21048, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i21086, double* %tmp.4.i21049
- %tmp.7.i21052 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i21048, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i21089, double* %tmp.7.i21052
- %tmp.0.i21055 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i21048, %"struct.std::dcomplex"* %mem_tmp.716 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i21057 = getelementptr %"struct.std::dcomplex"* %tmp.0.i21055, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i21058 = load double* %tmp.14.i21057 ; <double> [#uses=1]
- %tmp.17.i21060 = getelementptr %"struct.std::dcomplex"* %tmp.0.i21055, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i21061 = load double* %tmp.17.i21060 ; <double> [#uses=1]
- %tmp.4.i21035 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i21034, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i21058, double* %tmp.4.i21035
- %tmp.7.i21038 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i21034, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i21061, double* %tmp.7.i21038
- %tmp.0.i21041 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i21034, %"struct.std::dcomplex"* %tmp.15 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i21042 = getelementptr %"struct.std::dcomplex"* %mem_tmp.713, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i21043 = getelementptr %"struct.std::dcomplex"* %tmp.0.i21041, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i21044 = load double* %tmp.14.i21043 ; <double> [#uses=1]
- store double %tmp.15.i21044, double* %tmp.13.i21042
- %tmp.16.i21045 = getelementptr %"struct.std::dcomplex"* %mem_tmp.713, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i21046 = getelementptr %"struct.std::dcomplex"* %tmp.0.i21041, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i21047 = load double* %tmp.17.i21046 ; <double> [#uses=1]
- store double %tmp.18.i21047, double* %tmp.16.i21045
- %tmp.4.i21021 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i21020, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i21100, double* %tmp.4.i21021
- %tmp.7.i21024 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i21020, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i21103, double* %tmp.7.i21024
- %tmp.0.i21027 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i21020, %"struct.std::dcomplex"* %mem_tmp.713 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i21029 = getelementptr %"struct.std::dcomplex"* %tmp.0.i21027, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i21030 = load double* %tmp.14.i21029 ; <double> [#uses=1]
- %tmp.17.i21032 = getelementptr %"struct.std::dcomplex"* %tmp.0.i21027, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i21033 = load double* %tmp.17.i21032 ; <double> [#uses=1]
- store double %tmp.15.i21030, double* %tmp.2.i34364
- store double %tmp.18.i21033, double* %tmp.6.i34365
- %tmp.4.i20987 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i20986, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i20989 = load double* %tmp.5.i27590 ; <double> [#uses=1]
- store double %tmp.6.i20989, double* %tmp.4.i20987
- %tmp.7.i20990 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i20986, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i20992 = load double* %tmp.8.i27593 ; <double> [#uses=1]
- store double %tmp.9.i20992, double* %tmp.7.i20990
- %tmp.0.i20993 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i20986, %"struct.std::dcomplex"* %ret3 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i20995 = getelementptr %"struct.std::dcomplex"* %tmp.0.i20993, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i20996 = load double* %tmp.14.i20995 ; <double> [#uses=1]
- %tmp.17.i20998 = getelementptr %"struct.std::dcomplex"* %tmp.0.i20993, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i20999 = load double* %tmp.17.i20998 ; <double> [#uses=1]
- %tmp.7.i20953 = load double* %tmp.2.i34366 ; <double> [#uses=1]
- %tmp.15.i20967 = add double %tmp.7.i20953, %tmp.15.i20996 ; <double> [#uses=1]
- store double %tmp.15.i20967, double* %tmp.2.i34366
- %tmp.26.i20974 = load double* %tmp.6.i34367 ; <double> [#uses=1]
- %tmp.31.i20985 = add double %tmp.26.i20974, %tmp.18.i20999 ; <double> [#uses=1]
- store double %tmp.31.i20985, double* %tmp.6.i34367
- %tmp.4.i20933 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i20932, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i20935 = load double* %tmp.5.i28602 ; <double> [#uses=1]
- store double %tmp.6.i20935, double* %tmp.4.i20933
- %tmp.7.i20936 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i20932, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i20938 = load double* %tmp.8.i28605 ; <double> [#uses=1]
- store double %tmp.9.i20938, double* %tmp.7.i20936
- %tmp.0.i20939 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i20932, %"struct.std::dcomplex"* %tmp.226 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i20941 = getelementptr %"struct.std::dcomplex"* %tmp.0.i20939, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i20942 = load double* %tmp.14.i20941 ; <double> [#uses=1]
- %tmp.17.i20944 = getelementptr %"struct.std::dcomplex"* %tmp.0.i20939, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i20945 = load double* %tmp.17.i20944 ; <double> [#uses=1]
- %tmp.4.i20919 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i20918, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i20921 = load double* %tmp.5.i33146 ; <double> [#uses=1]
- store double %tmp.6.i20921, double* %tmp.4.i20919
- %tmp.7.i20922 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i20918, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i20924 = load double* %tmp.8.i33149 ; <double> [#uses=1]
- store double %tmp.9.i20924, double* %tmp.7.i20922
- %tmp.0.i20925 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i20918, %"struct.std::dcomplex"* %tmp.1036 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i20926 = getelementptr %"struct.std::dcomplex"* %mem_tmp.723, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i20927 = getelementptr %"struct.std::dcomplex"* %tmp.0.i20925, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i20928 = load double* %tmp.14.i20927 ; <double> [#uses=1]
- store double %tmp.15.i20928, double* %tmp.13.i20926
- %tmp.16.i20929 = getelementptr %"struct.std::dcomplex"* %mem_tmp.723, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i20930 = getelementptr %"struct.std::dcomplex"* %tmp.0.i20925, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i20931 = load double* %tmp.17.i20930 ; <double> [#uses=1]
- store double %tmp.18.i20931, double* %tmp.16.i20929
- %tmp.4.i20905 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i20904, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i20942, double* %tmp.4.i20905
- %tmp.7.i20908 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i20904, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i20945, double* %tmp.7.i20908
- %tmp.0.i20911 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i20904, %"struct.std::dcomplex"* %mem_tmp.723 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i20913 = getelementptr %"struct.std::dcomplex"* %tmp.0.i20911, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i20914 = load double* %tmp.14.i20913 ; <double> [#uses=1]
- %tmp.17.i20916 = getelementptr %"struct.std::dcomplex"* %tmp.0.i20911, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i20917 = load double* %tmp.17.i20916 ; <double> [#uses=1]
- %tmp.4.i20891 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i20890, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i20914, double* %tmp.4.i20891
- %tmp.7.i20894 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i20890, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i20917, double* %tmp.7.i20894
- %tmp.0.i20897 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i20890, %"struct.std::dcomplex"* %tmp.15 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i20899 = getelementptr %"struct.std::dcomplex"* %tmp.0.i20897, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i20900 = load double* %tmp.14.i20899 ; <double> [#uses=1]
- %tmp.17.i20902 = getelementptr %"struct.std::dcomplex"* %tmp.0.i20897, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i20903 = load double* %tmp.17.i20902 ; <double> [#uses=1]
- %tmp.4.i20877 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i20876, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i20879 = load double* %tmp.5.i34282 ; <double> [#uses=1]
- store double %tmp.6.i20879, double* %tmp.4.i20877
- %tmp.7.i20880 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i20876, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i20882 = load double* %tmp.8.i34285 ; <double> [#uses=1]
- store double %tmp.9.i20882, double* %tmp.7.i20880
- %tmp.0.i20883 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i20876, %"struct.std::dcomplex"* %tmp.1036 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i20885 = getelementptr %"struct.std::dcomplex"* %tmp.0.i20883, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i20886 = load double* %tmp.14.i20885 ; <double> [#uses=1]
- %tmp.17.i20888 = getelementptr %"struct.std::dcomplex"* %tmp.0.i20883, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i20889 = load double* %tmp.17.i20888 ; <double> [#uses=1]
- %tmp.4.i20863 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i20862, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i20865 = load double* %tmp.5.i28602 ; <double> [#uses=1]
- store double %tmp.6.i20865, double* %tmp.4.i20863
- %tmp.7.i20866 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i20862, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i20868 = load double* %tmp.8.i28605 ; <double> [#uses=1]
- store double %tmp.9.i20868, double* %tmp.7.i20866
- %tmp.0.i20869 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i20862, %"struct.std::dcomplex"* %tmp.21 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i20870 = getelementptr %"struct.std::dcomplex"* %mem_tmp.727, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i20871 = getelementptr %"struct.std::dcomplex"* %tmp.0.i20869, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i20872 = load double* %tmp.14.i20871 ; <double> [#uses=1]
- store double %tmp.15.i20872, double* %tmp.13.i20870
- %tmp.16.i20873 = getelementptr %"struct.std::dcomplex"* %mem_tmp.727, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i20874 = getelementptr %"struct.std::dcomplex"* %tmp.0.i20869, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i20875 = load double* %tmp.17.i20874 ; <double> [#uses=1]
- store double %tmp.18.i20875, double* %tmp.16.i20873
- %tmp.4.i20849 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i20848, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i20886, double* %tmp.4.i20849
- %tmp.7.i20852 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i20848, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i20889, double* %tmp.7.i20852
- %tmp.0.i20855 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i20848, %"struct.std::dcomplex"* %mem_tmp.727 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i20857 = getelementptr %"struct.std::dcomplex"* %tmp.0.i20855, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i20858 = load double* %tmp.14.i20857 ; <double> [#uses=1]
- %tmp.17.i20860 = getelementptr %"struct.std::dcomplex"* %tmp.0.i20855, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i20861 = load double* %tmp.17.i20860 ; <double> [#uses=1]
- %tmp.4.i20835 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i20834, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i20858, double* %tmp.4.i20835
- %tmp.7.i20838 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i20834, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i20861, double* %tmp.7.i20838
- %tmp.0.i20841 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i20834, %"struct.std::dcomplex"* %tmp.220 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i20842 = getelementptr %"struct.std::dcomplex"* %mem_tmp.724, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i20843 = getelementptr %"struct.std::dcomplex"* %tmp.0.i20841, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i20844 = load double* %tmp.14.i20843 ; <double> [#uses=1]
- store double %tmp.15.i20844, double* %tmp.13.i20842
- %tmp.16.i20845 = getelementptr %"struct.std::dcomplex"* %mem_tmp.724, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i20846 = getelementptr %"struct.std::dcomplex"* %tmp.0.i20841, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i20847 = load double* %tmp.17.i20846 ; <double> [#uses=1]
- store double %tmp.18.i20847, double* %tmp.16.i20845
- %tmp.4.i20821 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i20820, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i20900, double* %tmp.4.i20821
- %tmp.7.i20824 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i20820, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i20903, double* %tmp.7.i20824
- %tmp.0.i20827 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i20820, %"struct.std::dcomplex"* %mem_tmp.724 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i20829 = getelementptr %"struct.std::dcomplex"* %tmp.0.i20827, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i20830 = load double* %tmp.14.i20829 ; <double> [#uses=1]
- %tmp.17.i20832 = getelementptr %"struct.std::dcomplex"* %tmp.0.i20827, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i20833 = load double* %tmp.17.i20832 ; <double> [#uses=1]
- %tmp.4.i20807 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i20806, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i20809 = load double* %tmp.5.i33146 ; <double> [#uses=1]
- store double %tmp.6.i20809, double* %tmp.4.i20807
- %tmp.7.i20810 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i20806, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i20812 = load double* %tmp.8.i33149 ; <double> [#uses=1]
- store double %tmp.9.i20812, double* %tmp.7.i20810
- %tmp.0.i20813 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i20806, %"struct.std::dcomplex"* %tmp.21 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i20815 = getelementptr %"struct.std::dcomplex"* %tmp.0.i20813, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i20816 = load double* %tmp.14.i20815 ; <double> [#uses=1]
- %tmp.17.i20818 = getelementptr %"struct.std::dcomplex"* %tmp.0.i20813, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i20819 = load double* %tmp.17.i20818 ; <double> [#uses=1]
- %tmp.4.i20793 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i20792, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i20795 = load double* %tmp.5.i34282 ; <double> [#uses=1]
- store double %tmp.6.i20795, double* %tmp.4.i20793
- %tmp.7.i20796 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i20792, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i20798 = load double* %tmp.8.i34285 ; <double> [#uses=1]
- store double %tmp.9.i20798, double* %tmp.7.i20796
- %tmp.0.i20799 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i20792, %"struct.std::dcomplex"* %tmp.226 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i20800 = getelementptr %"struct.std::dcomplex"* %mem_tmp.731, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i20801 = getelementptr %"struct.std::dcomplex"* %tmp.0.i20799, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i20802 = load double* %tmp.14.i20801 ; <double> [#uses=1]
- store double %tmp.15.i20802, double* %tmp.13.i20800
- %tmp.16.i20803 = getelementptr %"struct.std::dcomplex"* %mem_tmp.731, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i20804 = getelementptr %"struct.std::dcomplex"* %tmp.0.i20799, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i20805 = load double* %tmp.17.i20804 ; <double> [#uses=1]
- store double %tmp.18.i20805, double* %tmp.16.i20803
- %tmp.4.i20779 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i20778, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i20816, double* %tmp.4.i20779
- %tmp.7.i20782 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i20778, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i20819, double* %tmp.7.i20782
- %tmp.0.i20785 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i20778, %"struct.std::dcomplex"* %mem_tmp.731 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i20787 = getelementptr %"struct.std::dcomplex"* %tmp.0.i20785, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i20788 = load double* %tmp.14.i20787 ; <double> [#uses=1]
- %tmp.17.i20790 = getelementptr %"struct.std::dcomplex"* %tmp.0.i20785, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i20791 = load double* %tmp.17.i20790 ; <double> [#uses=1]
- %tmp.4.i20765 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i20764, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i20788, double* %tmp.4.i20765
- %tmp.7.i20768 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i20764, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i20791, double* %tmp.7.i20768
- %tmp.0.i20771 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i20764, %"struct.std::dcomplex"* %tmp.1075 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i20772 = getelementptr %"struct.std::dcomplex"* %mem_tmp.728, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i20773 = getelementptr %"struct.std::dcomplex"* %tmp.0.i20771, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i20774 = load double* %tmp.14.i20773 ; <double> [#uses=1]
- store double %tmp.15.i20774, double* %tmp.13.i20772
- %tmp.16.i20775 = getelementptr %"struct.std::dcomplex"* %mem_tmp.728, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i20776 = getelementptr %"struct.std::dcomplex"* %tmp.0.i20771, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i20777 = load double* %tmp.17.i20776 ; <double> [#uses=1]
- store double %tmp.18.i20777, double* %tmp.16.i20775
- %tmp.4.i20751 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i20750, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i20830, double* %tmp.4.i20751
- %tmp.7.i20754 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i20750, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i20833, double* %tmp.7.i20754
- %tmp.0.i20757 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i20750, %"struct.std::dcomplex"* %mem_tmp.728 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i20759 = getelementptr %"struct.std::dcomplex"* %tmp.0.i20757, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i20760 = load double* %tmp.14.i20759 ; <double> [#uses=1]
- %tmp.17.i20762 = getelementptr %"struct.std::dcomplex"* %tmp.0.i20757, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i20763 = load double* %tmp.17.i20762 ; <double> [#uses=1]
- store double %tmp.15.i20760, double* %tmp.2.i34364
- store double %tmp.18.i20763, double* %tmp.6.i34365
- %tmp.4.i20717 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i20716, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i20719 = load double* %tmp.5.i33866 ; <double> [#uses=1]
- store double %tmp.6.i20719, double* %tmp.4.i20717
- %tmp.7.i20720 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i20716, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i20722 = load double* %tmp.8.i33869 ; <double> [#uses=1]
- store double %tmp.9.i20722, double* %tmp.7.i20720
- %tmp.0.i20723 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i20716, %"struct.std::dcomplex"* %ret3 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i20725 = getelementptr %"struct.std::dcomplex"* %tmp.0.i20723, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i20726 = load double* %tmp.14.i20725 ; <double> [#uses=1]
- %tmp.17.i20728 = getelementptr %"struct.std::dcomplex"* %tmp.0.i20723, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i20729 = load double* %tmp.17.i20728 ; <double> [#uses=1]
- %tmp.7.i20683 = load double* %tmp.2.i34366 ; <double> [#uses=1]
- %tmp.15.i20697 = add double %tmp.7.i20683, %tmp.15.i20726 ; <double> [#uses=1]
- store double %tmp.15.i20697, double* %tmp.2.i34366
- %tmp.26.i20704 = load double* %tmp.6.i34367 ; <double> [#uses=1]
- %tmp.31.i20715 = add double %tmp.26.i20704, %tmp.18.i20729 ; <double> [#uses=1]
- store double %tmp.31.i20715, double* %tmp.6.i34367
- %tmp.4.i20663 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i20662, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i20665 = load double* %tmp.5.i28728 ; <double> [#uses=1]
- store double %tmp.6.i20665, double* %tmp.4.i20663
- %tmp.7.i20666 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i20662, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i20668 = load double* %tmp.8.i28731 ; <double> [#uses=1]
- store double %tmp.9.i20668, double* %tmp.7.i20666
- %tmp.0.i20669 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i20662, %"struct.std::dcomplex"* %ret4 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i20671 = getelementptr %"struct.std::dcomplex"* %tmp.0.i20669, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i20672 = load double* %tmp.14.i20671 ; <double> [#uses=1]
- %tmp.17.i20674 = getelementptr %"struct.std::dcomplex"* %tmp.0.i20669, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i20675 = load double* %tmp.17.i20674 ; <double> [#uses=1]
- %tmp.7.i20629 = load double* %tmp.2.i34368 ; <double> [#uses=1]
- %tmp.15.i20643 = add double %tmp.7.i20629, %tmp.15.i20672 ; <double> [#uses=1]
- store double %tmp.15.i20643, double* %tmp.2.i34368
- %tmp.26.i20650 = load double* %tmp.6.i34369 ; <double> [#uses=1]
- %tmp.31.i20661 = add double %tmp.26.i20650, %tmp.18.i20675 ; <double> [#uses=1]
- store double %tmp.31.i20661, double* %tmp.6.i34369
- store double 0.000000e+00, double* %tmp.2.i34366
- store double 0.000000e+00, double* %tmp.6.i34367
- %tmp.4.i20607 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i20606, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i20609 = load double* %tmp.5.i34282 ; <double> [#uses=1]
- store double %tmp.6.i20609, double* %tmp.4.i20607
- %tmp.7.i20610 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i20606, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i20612 = load double* %tmp.8.i34285 ; <double> [#uses=1]
- store double %tmp.9.i20612, double* %tmp.7.i20610
- %tmp.0.i20613 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i20606, %"struct.std::dcomplex"* %tmp.62 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i20615 = getelementptr %"struct.std::dcomplex"* %tmp.0.i20613, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i20616 = load double* %tmp.14.i20615 ; <double> [#uses=1]
- %tmp.17.i20618 = getelementptr %"struct.std::dcomplex"* %tmp.0.i20613, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i20619 = load double* %tmp.17.i20618 ; <double> [#uses=1]
- %tmp.4.i20593 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i20592, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i20595 = load double* %tmp.5.i34082 ; <double> [#uses=1]
- store double %tmp.6.i20595, double* %tmp.4.i20593
- %tmp.7.i20596 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i20592, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i20598 = load double* %tmp.8.i34085 ; <double> [#uses=1]
- store double %tmp.9.i20598, double* %tmp.7.i20596
- %tmp.0.i20599 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i20592, %"struct.std::dcomplex"* %tmp.21 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i20600 = getelementptr %"struct.std::dcomplex"* %mem_tmp.739, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i20601 = getelementptr %"struct.std::dcomplex"* %tmp.0.i20599, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i20602 = load double* %tmp.14.i20601 ; <double> [#uses=1]
- store double %tmp.15.i20602, double* %tmp.13.i20600
- %tmp.16.i20603 = getelementptr %"struct.std::dcomplex"* %mem_tmp.739, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i20604 = getelementptr %"struct.std::dcomplex"* %tmp.0.i20599, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i20605 = load double* %tmp.17.i20604 ; <double> [#uses=1]
- store double %tmp.18.i20605, double* %tmp.16.i20603
- %tmp.4.i20579 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i20578, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i20616, double* %tmp.4.i20579
- %tmp.7.i20582 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i20578, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i20619, double* %tmp.7.i20582
- %tmp.0.i20585 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i20578, %"struct.std::dcomplex"* %mem_tmp.739 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i20587 = getelementptr %"struct.std::dcomplex"* %tmp.0.i20585, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i20588 = load double* %tmp.14.i20587 ; <double> [#uses=1]
- %tmp.17.i20590 = getelementptr %"struct.std::dcomplex"* %tmp.0.i20585, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i20591 = load double* %tmp.17.i20590 ; <double> [#uses=1]
- %tmp.4.i20565 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i20564, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i20588, double* %tmp.4.i20565
- %tmp.7.i20568 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i20564, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i20591, double* %tmp.7.i20568
- %tmp.0.i20571 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i20564, %"struct.std::dcomplex"* %tmp.1075 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i20573 = getelementptr %"struct.std::dcomplex"* %tmp.0.i20571, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i20574 = load double* %tmp.14.i20573 ; <double> [#uses=1]
- %tmp.17.i20576 = getelementptr %"struct.std::dcomplex"* %tmp.0.i20571, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i20577 = load double* %tmp.17.i20576 ; <double> [#uses=1]
- %tmp.4.i20551 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i20550, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i20553 = load double* %tmp.5.i34082 ; <double> [#uses=1]
- store double %tmp.6.i20553, double* %tmp.4.i20551
- %tmp.7.i20554 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i20550, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i20556 = load double* %tmp.8.i34085 ; <double> [#uses=1]
- store double %tmp.9.i20556, double* %tmp.7.i20554
- %tmp.0.i20557 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i20550, %"struct.std::dcomplex"* %tmp.1036 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i20559 = getelementptr %"struct.std::dcomplex"* %tmp.0.i20557, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i20560 = load double* %tmp.14.i20559 ; <double> [#uses=1]
- %tmp.17.i20562 = getelementptr %"struct.std::dcomplex"* %tmp.0.i20557, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i20563 = load double* %tmp.17.i20562 ; <double> [#uses=1]
- %tmp.4.i20537 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i20536, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i20539 = load double* %tmp.5.i28602 ; <double> [#uses=1]
- store double %tmp.6.i20539, double* %tmp.4.i20537
- %tmp.7.i20540 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i20536, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i20542 = load double* %tmp.8.i28605 ; <double> [#uses=1]
- store double %tmp.9.i20542, double* %tmp.7.i20540
- %tmp.0.i20543 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i20536, %"struct.std::dcomplex"* %tmp.62 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i20544 = getelementptr %"struct.std::dcomplex"* %mem_tmp.743, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i20545 = getelementptr %"struct.std::dcomplex"* %tmp.0.i20543, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i20546 = load double* %tmp.14.i20545 ; <double> [#uses=1]
- store double %tmp.15.i20546, double* %tmp.13.i20544
- %tmp.16.i20547 = getelementptr %"struct.std::dcomplex"* %mem_tmp.743, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i20548 = getelementptr %"struct.std::dcomplex"* %tmp.0.i20543, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i20549 = load double* %tmp.17.i20548 ; <double> [#uses=1]
- store double %tmp.18.i20549, double* %tmp.16.i20547
- %tmp.4.i20523 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i20522, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i20560, double* %tmp.4.i20523
- %tmp.7.i20526 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i20522, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i20563, double* %tmp.7.i20526
- %tmp.0.i20529 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i20522, %"struct.std::dcomplex"* %mem_tmp.743 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i20531 = getelementptr %"struct.std::dcomplex"* %tmp.0.i20529, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i20532 = load double* %tmp.14.i20531 ; <double> [#uses=1]
- %tmp.17.i20534 = getelementptr %"struct.std::dcomplex"* %tmp.0.i20529, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i20535 = load double* %tmp.17.i20534 ; <double> [#uses=1]
- %tmp.4.i20509 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i20508, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i20532, double* %tmp.4.i20509
- %tmp.7.i20512 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i20508, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i20535, double* %tmp.7.i20512
- %tmp.0.i20515 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i20508, %"struct.std::dcomplex"* %tmp.15 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i20516 = getelementptr %"struct.std::dcomplex"* %mem_tmp.740, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i20517 = getelementptr %"struct.std::dcomplex"* %tmp.0.i20515, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i20518 = load double* %tmp.14.i20517 ; <double> [#uses=1]
- store double %tmp.15.i20518, double* %tmp.13.i20516
- %tmp.16.i20519 = getelementptr %"struct.std::dcomplex"* %mem_tmp.740, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i20520 = getelementptr %"struct.std::dcomplex"* %tmp.0.i20515, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i20521 = load double* %tmp.17.i20520 ; <double> [#uses=1]
- store double %tmp.18.i20521, double* %tmp.16.i20519
- %tmp.4.i20495 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i20494, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i20574, double* %tmp.4.i20495
- %tmp.7.i20498 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i20494, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i20577, double* %tmp.7.i20498
- %tmp.0.i20501 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i20494, %"struct.std::dcomplex"* %mem_tmp.740 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i20503 = getelementptr %"struct.std::dcomplex"* %tmp.0.i20501, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i20504 = load double* %tmp.14.i20503 ; <double> [#uses=1]
- %tmp.17.i20506 = getelementptr %"struct.std::dcomplex"* %tmp.0.i20501, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i20507 = load double* %tmp.17.i20506 ; <double> [#uses=1]
- %tmp.4.i20481 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i20480, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i20483 = load double* %tmp.5.i28602 ; <double> [#uses=1]
- store double %tmp.6.i20483, double* %tmp.4.i20481
- %tmp.7.i20484 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i20480, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i20486 = load double* %tmp.8.i28605 ; <double> [#uses=1]
- store double %tmp.9.i20486, double* %tmp.7.i20484
- %tmp.0.i20487 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i20480, %"struct.std::dcomplex"* %tmp.21 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i20489 = getelementptr %"struct.std::dcomplex"* %tmp.0.i20487, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i20490 = load double* %tmp.14.i20489 ; <double> [#uses=1]
- %tmp.17.i20492 = getelementptr %"struct.std::dcomplex"* %tmp.0.i20487, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i20493 = load double* %tmp.17.i20492 ; <double> [#uses=1]
- %tmp.4.i20467 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i20466, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i20469 = load double* %tmp.5.i34282 ; <double> [#uses=1]
- store double %tmp.6.i20469, double* %tmp.4.i20467
- %tmp.7.i20470 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i20466, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i20472 = load double* %tmp.8.i34285 ; <double> [#uses=1]
- store double %tmp.9.i20472, double* %tmp.7.i20470
- %tmp.0.i20473 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i20466, %"struct.std::dcomplex"* %tmp.1036 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i20474 = getelementptr %"struct.std::dcomplex"* %mem_tmp.747, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i20475 = getelementptr %"struct.std::dcomplex"* %tmp.0.i20473, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i20476 = load double* %tmp.14.i20475 ; <double> [#uses=1]
- store double %tmp.15.i20476, double* %tmp.13.i20474
- %tmp.16.i20477 = getelementptr %"struct.std::dcomplex"* %mem_tmp.747, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i20478 = getelementptr %"struct.std::dcomplex"* %tmp.0.i20473, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i20479 = load double* %tmp.17.i20478 ; <double> [#uses=1]
- store double %tmp.18.i20479, double* %tmp.16.i20477
- %tmp.4.i20453 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i20452, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i20490, double* %tmp.4.i20453
- %tmp.7.i20456 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i20452, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i20493, double* %tmp.7.i20456
- %tmp.0.i20459 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i20452, %"struct.std::dcomplex"* %mem_tmp.747 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i20461 = getelementptr %"struct.std::dcomplex"* %tmp.0.i20459, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i20462 = load double* %tmp.14.i20461 ; <double> [#uses=1]
- %tmp.17.i20464 = getelementptr %"struct.std::dcomplex"* %tmp.0.i20459, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i20465 = load double* %tmp.17.i20464 ; <double> [#uses=1]
- %tmp.4.i20439 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i20438, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i20462, double* %tmp.4.i20439
- %tmp.7.i20442 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i20438, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i20465, double* %tmp.7.i20442
- %tmp.0.i20445 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i20438, %"struct.std::dcomplex"* %tmp.95 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i20446 = getelementptr %"struct.std::dcomplex"* %mem_tmp.744, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i20447 = getelementptr %"struct.std::dcomplex"* %tmp.0.i20445, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i20448 = load double* %tmp.14.i20447 ; <double> [#uses=1]
- store double %tmp.15.i20448, double* %tmp.13.i20446
- %tmp.16.i20449 = getelementptr %"struct.std::dcomplex"* %mem_tmp.744, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i20450 = getelementptr %"struct.std::dcomplex"* %tmp.0.i20445, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i20451 = load double* %tmp.17.i20450 ; <double> [#uses=1]
- store double %tmp.18.i20451, double* %tmp.16.i20449
- %tmp.4.i20425 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i20424, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i20504, double* %tmp.4.i20425
- %tmp.7.i20428 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i20424, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i20507, double* %tmp.7.i20428
- %tmp.0.i20431 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i20424, %"struct.std::dcomplex"* %mem_tmp.744 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i20433 = getelementptr %"struct.std::dcomplex"* %tmp.0.i20431, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i20434 = load double* %tmp.14.i20433 ; <double> [#uses=1]
- %tmp.17.i20436 = getelementptr %"struct.std::dcomplex"* %tmp.0.i20431, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i20437 = load double* %tmp.17.i20436 ; <double> [#uses=1]
- store double %tmp.15.i20434, double* %tmp.2.i34364
- store double %tmp.18.i20437, double* %tmp.6.i34365
- %tmp.4.i20391 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i20390, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i20393 = load double* %tmp.5.i33866 ; <double> [#uses=1]
- store double %tmp.6.i20393, double* %tmp.4.i20391
- %tmp.7.i20394 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i20390, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i20396 = load double* %tmp.8.i33869 ; <double> [#uses=1]
- store double %tmp.9.i20396, double* %tmp.7.i20394
- %tmp.0.i20397 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i20390, %"struct.std::dcomplex"* %ret3 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i20399 = getelementptr %"struct.std::dcomplex"* %tmp.0.i20397, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i20400 = load double* %tmp.14.i20399 ; <double> [#uses=1]
- %tmp.17.i20402 = getelementptr %"struct.std::dcomplex"* %tmp.0.i20397, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i20403 = load double* %tmp.17.i20402 ; <double> [#uses=1]
- %tmp.7.i20357 = load double* %tmp.2.i34366 ; <double> [#uses=1]
- %tmp.15.i20371 = add double %tmp.7.i20357, %tmp.15.i20400 ; <double> [#uses=1]
- store double %tmp.15.i20371, double* %tmp.2.i34366
- %tmp.26.i20378 = load double* %tmp.6.i34367 ; <double> [#uses=1]
- %tmp.31.i20389 = add double %tmp.26.i20378, %tmp.18.i20403 ; <double> [#uses=1]
- store double %tmp.31.i20389, double* %tmp.6.i34367
- %tmp.4.i20337 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i20336, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i20339 = load double* %tmp.5.i34352 ; <double> [#uses=1]
- store double %tmp.6.i20339, double* %tmp.4.i20337
- %tmp.7.i20340 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i20336, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i20342 = load double* %tmp.8.i34355 ; <double> [#uses=1]
- store double %tmp.9.i20342, double* %tmp.7.i20340
- %tmp.0.i20343 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i20336, %"struct.std::dcomplex"* %tmp.1036 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i20345 = getelementptr %"struct.std::dcomplex"* %tmp.0.i20343, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i20346 = load double* %tmp.14.i20345 ; <double> [#uses=1]
- %tmp.17.i20348 = getelementptr %"struct.std::dcomplex"* %tmp.0.i20343, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i20349 = load double* %tmp.17.i20348 ; <double> [#uses=1]
- %tmp.4.i20323 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i20322, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i20325 = load double* %tmp.5.i28602 ; <double> [#uses=1]
- store double %tmp.6.i20325, double* %tmp.4.i20323
- %tmp.7.i20326 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i20322, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i20328 = load double* %tmp.8.i28605 ; <double> [#uses=1]
- store double %tmp.9.i20328, double* %tmp.7.i20326
- %tmp.0.i20329 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i20322, %"struct.std::dcomplex"* %tmp.12 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i20330 = getelementptr %"struct.std::dcomplex"* %mem_tmp.754, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i20331 = getelementptr %"struct.std::dcomplex"* %tmp.0.i20329, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i20332 = load double* %tmp.14.i20331 ; <double> [#uses=1]
- store double %tmp.15.i20332, double* %tmp.13.i20330
- %tmp.16.i20333 = getelementptr %"struct.std::dcomplex"* %mem_tmp.754, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i20334 = getelementptr %"struct.std::dcomplex"* %tmp.0.i20329, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i20335 = load double* %tmp.17.i20334 ; <double> [#uses=1]
- store double %tmp.18.i20335, double* %tmp.16.i20333
- %tmp.4.i20309 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i20308, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i20346, double* %tmp.4.i20309
- %tmp.7.i20312 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i20308, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i20349, double* %tmp.7.i20312
- %tmp.0.i20315 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i20308, %"struct.std::dcomplex"* %mem_tmp.754 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i20317 = getelementptr %"struct.std::dcomplex"* %tmp.0.i20315, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i20318 = load double* %tmp.14.i20317 ; <double> [#uses=1]
- %tmp.17.i20320 = getelementptr %"struct.std::dcomplex"* %tmp.0.i20315, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i20321 = load double* %tmp.17.i20320 ; <double> [#uses=1]
- %tmp.4.i20295 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i20294, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i20318, double* %tmp.4.i20295
- %tmp.7.i20298 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i20294, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i20321, double* %tmp.7.i20298
- %tmp.0.i20301 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i20294, %"struct.std::dcomplex"* %tmp.95 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i20303 = getelementptr %"struct.std::dcomplex"* %tmp.0.i20301, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i20304 = load double* %tmp.14.i20303 ; <double> [#uses=1]
- %tmp.17.i20306 = getelementptr %"struct.std::dcomplex"* %tmp.0.i20301, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i20307 = load double* %tmp.17.i20306 ; <double> [#uses=1]
- %tmp.4.i20281 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i20280, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i20283 = load double* %tmp.5.i34082 ; <double> [#uses=1]
- store double %tmp.6.i20283, double* %tmp.4.i20281
- %tmp.7.i20284 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i20280, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i20286 = load double* %tmp.8.i34085 ; <double> [#uses=1]
- store double %tmp.9.i20286, double* %tmp.7.i20284
- %tmp.0.i20287 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i20280, %"struct.std::dcomplex"* %tmp.12 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i20289 = getelementptr %"struct.std::dcomplex"* %tmp.0.i20287, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i20290 = load double* %tmp.14.i20289 ; <double> [#uses=1]
- %tmp.17.i20292 = getelementptr %"struct.std::dcomplex"* %tmp.0.i20287, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i20293 = load double* %tmp.17.i20292 ; <double> [#uses=1]
- %tmp.4.i20267 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i20266, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i20269 = load double* %tmp.5.i34352 ; <double> [#uses=1]
- store double %tmp.6.i20269, double* %tmp.4.i20267
- %tmp.7.i20270 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i20266, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i20272 = load double* %tmp.8.i34355 ; <double> [#uses=1]
- store double %tmp.9.i20272, double* %tmp.7.i20270
- %tmp.0.i20273 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i20266, %"struct.std::dcomplex"* %tmp.62 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i20274 = getelementptr %"struct.std::dcomplex"* %mem_tmp.758, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i20275 = getelementptr %"struct.std::dcomplex"* %tmp.0.i20273, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i20276 = load double* %tmp.14.i20275 ; <double> [#uses=1]
- store double %tmp.15.i20276, double* %tmp.13.i20274
- %tmp.16.i20277 = getelementptr %"struct.std::dcomplex"* %mem_tmp.758, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i20278 = getelementptr %"struct.std::dcomplex"* %tmp.0.i20273, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i20279 = load double* %tmp.17.i20278 ; <double> [#uses=1]
- store double %tmp.18.i20279, double* %tmp.16.i20277
- %tmp.4.i20253 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i20252, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i20290, double* %tmp.4.i20253
- %tmp.7.i20256 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i20252, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i20293, double* %tmp.7.i20256
- %tmp.0.i20259 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i20252, %"struct.std::dcomplex"* %mem_tmp.758 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i20261 = getelementptr %"struct.std::dcomplex"* %tmp.0.i20259, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i20262 = load double* %tmp.14.i20261 ; <double> [#uses=1]
- %tmp.17.i20264 = getelementptr %"struct.std::dcomplex"* %tmp.0.i20259, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i20265 = load double* %tmp.17.i20264 ; <double> [#uses=1]
- %tmp.4.i20239 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i20238, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i20262, double* %tmp.4.i20239
- %tmp.7.i20242 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i20238, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i20265, double* %tmp.7.i20242
- %tmp.0.i20245 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i20238, %"struct.std::dcomplex"* %tmp.1075 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i20246 = getelementptr %"struct.std::dcomplex"* %mem_tmp.755, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i20247 = getelementptr %"struct.std::dcomplex"* %tmp.0.i20245, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i20248 = load double* %tmp.14.i20247 ; <double> [#uses=1]
- store double %tmp.15.i20248, double* %tmp.13.i20246
- %tmp.16.i20249 = getelementptr %"struct.std::dcomplex"* %mem_tmp.755, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i20250 = getelementptr %"struct.std::dcomplex"* %tmp.0.i20245, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i20251 = load double* %tmp.17.i20250 ; <double> [#uses=1]
- store double %tmp.18.i20251, double* %tmp.16.i20249
- %tmp.4.i20225 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i20224, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i20304, double* %tmp.4.i20225
- %tmp.7.i20228 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i20224, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i20307, double* %tmp.7.i20228
- %tmp.0.i20231 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i20224, %"struct.std::dcomplex"* %mem_tmp.755 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i20233 = getelementptr %"struct.std::dcomplex"* %tmp.0.i20231, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i20234 = load double* %tmp.14.i20233 ; <double> [#uses=1]
- %tmp.17.i20236 = getelementptr %"struct.std::dcomplex"* %tmp.0.i20231, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i20237 = load double* %tmp.17.i20236 ; <double> [#uses=1]
- %tmp.4.i20211 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i20210, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i20213 = load double* %tmp.5.i28602 ; <double> [#uses=1]
- store double %tmp.6.i20213, double* %tmp.4.i20211
- %tmp.7.i20214 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i20210, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i20216 = load double* %tmp.8.i28605 ; <double> [#uses=1]
- store double %tmp.9.i20216, double* %tmp.7.i20214
- %tmp.0.i20217 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i20210, %"struct.std::dcomplex"* %tmp.62 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i20219 = getelementptr %"struct.std::dcomplex"* %tmp.0.i20217, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i20220 = load double* %tmp.14.i20219 ; <double> [#uses=1]
- %tmp.17.i20222 = getelementptr %"struct.std::dcomplex"* %tmp.0.i20217, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i20223 = load double* %tmp.17.i20222 ; <double> [#uses=1]
- %tmp.4.i20197 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i20196, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i20199 = load double* %tmp.5.i34082 ; <double> [#uses=1]
- store double %tmp.6.i20199, double* %tmp.4.i20197
- %tmp.7.i20200 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i20196, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i20202 = load double* %tmp.8.i34085 ; <double> [#uses=1]
- store double %tmp.9.i20202, double* %tmp.7.i20200
- %tmp.0.i20203 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i20196, %"struct.std::dcomplex"* %tmp.1036 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i20204 = getelementptr %"struct.std::dcomplex"* %mem_tmp.762, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i20205 = getelementptr %"struct.std::dcomplex"* %tmp.0.i20203, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i20206 = load double* %tmp.14.i20205 ; <double> [#uses=1]
- store double %tmp.15.i20206, double* %tmp.13.i20204
- %tmp.16.i20207 = getelementptr %"struct.std::dcomplex"* %mem_tmp.762, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i20208 = getelementptr %"struct.std::dcomplex"* %tmp.0.i20203, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i20209 = load double* %tmp.17.i20208 ; <double> [#uses=1]
- store double %tmp.18.i20209, double* %tmp.16.i20207
- %tmp.4.i20183 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i20182, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i20220, double* %tmp.4.i20183
- %tmp.7.i20186 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i20182, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i20223, double* %tmp.7.i20186
- %tmp.0.i20189 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i20182, %"struct.std::dcomplex"* %mem_tmp.762 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i20191 = getelementptr %"struct.std::dcomplex"* %tmp.0.i20189, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i20192 = load double* %tmp.14.i20191 ; <double> [#uses=1]
- %tmp.17.i20194 = getelementptr %"struct.std::dcomplex"* %tmp.0.i20189, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i20195 = load double* %tmp.17.i20194 ; <double> [#uses=1]
- %tmp.4.i20169 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i20168, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i20192, double* %tmp.4.i20169
- %tmp.7.i20172 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i20168, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i20195, double* %tmp.7.i20172
- %tmp.0.i20175 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i20168, %"struct.std::dcomplex"* %tmp.30 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i20176 = getelementptr %"struct.std::dcomplex"* %mem_tmp.759, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i20177 = getelementptr %"struct.std::dcomplex"* %tmp.0.i20175, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i20178 = load double* %tmp.14.i20177 ; <double> [#uses=1]
- store double %tmp.15.i20178, double* %tmp.13.i20176
- %tmp.16.i20179 = getelementptr %"struct.std::dcomplex"* %mem_tmp.759, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i20180 = getelementptr %"struct.std::dcomplex"* %tmp.0.i20175, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i20181 = load double* %tmp.17.i20180 ; <double> [#uses=1]
- store double %tmp.18.i20181, double* %tmp.16.i20179
- %tmp.4.i20155 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i20154, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i20234, double* %tmp.4.i20155
- %tmp.7.i20158 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i20154, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i20237, double* %tmp.7.i20158
- %tmp.0.i20161 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i20154, %"struct.std::dcomplex"* %mem_tmp.759 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i20163 = getelementptr %"struct.std::dcomplex"* %tmp.0.i20161, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i20164 = load double* %tmp.14.i20163 ; <double> [#uses=1]
- %tmp.17.i20166 = getelementptr %"struct.std::dcomplex"* %tmp.0.i20161, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i20167 = load double* %tmp.17.i20166 ; <double> [#uses=1]
- store double %tmp.15.i20164, double* %tmp.2.i34364
- store double %tmp.18.i20167, double* %tmp.6.i34365
- %tmp.4.i20121 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i20120, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i20123 = load double* %tmp.5.i33326 ; <double> [#uses=1]
- store double %tmp.6.i20123, double* %tmp.4.i20121
- %tmp.7.i20124 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i20120, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i20126 = load double* %tmp.8.i33329 ; <double> [#uses=1]
- store double %tmp.9.i20126, double* %tmp.7.i20124
- %tmp.0.i20127 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i20120, %"struct.std::dcomplex"* %ret3 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i20129 = getelementptr %"struct.std::dcomplex"* %tmp.0.i20127, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i20130 = load double* %tmp.14.i20129 ; <double> [#uses=1]
- %tmp.17.i20132 = getelementptr %"struct.std::dcomplex"* %tmp.0.i20127, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i20133 = load double* %tmp.17.i20132 ; <double> [#uses=1]
- %tmp.7.i20087 = load double* %tmp.2.i34366 ; <double> [#uses=1]
- %tmp.15.i20101 = add double %tmp.7.i20087, %tmp.15.i20130 ; <double> [#uses=1]
- store double %tmp.15.i20101, double* %tmp.2.i34366
- %tmp.26.i20108 = load double* %tmp.6.i34367 ; <double> [#uses=1]
- %tmp.31.i20119 = add double %tmp.26.i20108, %tmp.18.i20133 ; <double> [#uses=1]
- store double %tmp.31.i20119, double* %tmp.6.i34367
- %tmp.4.i20067 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i20066, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i20069 = load double* %tmp.5.i34282 ; <double> [#uses=1]
- store double %tmp.6.i20069, double* %tmp.4.i20067
- %tmp.7.i20070 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i20066, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i20072 = load double* %tmp.8.i34285 ; <double> [#uses=1]
- store double %tmp.9.i20072, double* %tmp.7.i20070
- %tmp.0.i20073 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i20066, %"struct.std::dcomplex"* %tmp.1036 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i20075 = getelementptr %"struct.std::dcomplex"* %tmp.0.i20073, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i20076 = load double* %tmp.14.i20075 ; <double> [#uses=1]
- %tmp.17.i20078 = getelementptr %"struct.std::dcomplex"* %tmp.0.i20073, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i20079 = load double* %tmp.17.i20078 ; <double> [#uses=1]
- %tmp.4.i20053 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i20052, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i20055 = load double* %tmp.5.i28602 ; <double> [#uses=1]
- store double %tmp.6.i20055, double* %tmp.4.i20053
- %tmp.7.i20056 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i20052, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i20058 = load double* %tmp.8.i28605 ; <double> [#uses=1]
- store double %tmp.9.i20058, double* %tmp.7.i20056
- %tmp.0.i20059 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i20052, %"struct.std::dcomplex"* %tmp.21 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i20060 = getelementptr %"struct.std::dcomplex"* %mem_tmp.769, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i20061 = getelementptr %"struct.std::dcomplex"* %tmp.0.i20059, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i20062 = load double* %tmp.14.i20061 ; <double> [#uses=1]
- store double %tmp.15.i20062, double* %tmp.13.i20060
- %tmp.16.i20063 = getelementptr %"struct.std::dcomplex"* %mem_tmp.769, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i20064 = getelementptr %"struct.std::dcomplex"* %tmp.0.i20059, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i20065 = load double* %tmp.17.i20064 ; <double> [#uses=1]
- store double %tmp.18.i20065, double* %tmp.16.i20063
- %tmp.4.i20039 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i20038, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i20076, double* %tmp.4.i20039
- %tmp.7.i20042 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i20038, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i20079, double* %tmp.7.i20042
- %tmp.0.i20045 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i20038, %"struct.std::dcomplex"* %mem_tmp.769 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i20047 = getelementptr %"struct.std::dcomplex"* %tmp.0.i20045, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i20048 = load double* %tmp.14.i20047 ; <double> [#uses=1]
- %tmp.17.i20050 = getelementptr %"struct.std::dcomplex"* %tmp.0.i20045, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i20051 = load double* %tmp.17.i20050 ; <double> [#uses=1]
- %tmp.4.i20025 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i20024, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i20048, double* %tmp.4.i20025
- %tmp.7.i20028 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i20024, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i20051, double* %tmp.7.i20028
- %tmp.0.i20031 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i20024, %"struct.std::dcomplex"* %tmp.30 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i20033 = getelementptr %"struct.std::dcomplex"* %tmp.0.i20031, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i20034 = load double* %tmp.14.i20033 ; <double> [#uses=1]
- %tmp.17.i20036 = getelementptr %"struct.std::dcomplex"* %tmp.0.i20031, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i20037 = load double* %tmp.17.i20036 ; <double> [#uses=1]
- %tmp.4.i20011 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i20010, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i20013 = load double* %tmp.5.i28602 ; <double> [#uses=1]
- store double %tmp.6.i20013, double* %tmp.4.i20011
- %tmp.7.i20014 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i20010, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i20016 = load double* %tmp.8.i28605 ; <double> [#uses=1]
- store double %tmp.9.i20016, double* %tmp.7.i20014
- %tmp.0.i20017 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i20010, %"struct.std::dcomplex"* %tmp.12 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i20019 = getelementptr %"struct.std::dcomplex"* %tmp.0.i20017, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i20020 = load double* %tmp.14.i20019 ; <double> [#uses=1]
- %tmp.17.i20022 = getelementptr %"struct.std::dcomplex"* %tmp.0.i20017, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i20023 = load double* %tmp.17.i20022 ; <double> [#uses=1]
- %tmp.4.i19997 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i19996, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i19999 = load double* %tmp.5.i34352 ; <double> [#uses=1]
- store double %tmp.6.i19999, double* %tmp.4.i19997
- %tmp.7.i20000 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i19996, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i20002 = load double* %tmp.8.i34355 ; <double> [#uses=1]
- store double %tmp.9.i20002, double* %tmp.7.i20000
- %tmp.0.i20003 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i19996, %"struct.std::dcomplex"* %tmp.1036 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i20004 = getelementptr %"struct.std::dcomplex"* %mem_tmp.773, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i20005 = getelementptr %"struct.std::dcomplex"* %tmp.0.i20003, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i20006 = load double* %tmp.14.i20005 ; <double> [#uses=1]
- store double %tmp.15.i20006, double* %tmp.13.i20004
- %tmp.16.i20007 = getelementptr %"struct.std::dcomplex"* %mem_tmp.773, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i20008 = getelementptr %"struct.std::dcomplex"* %tmp.0.i20003, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i20009 = load double* %tmp.17.i20008 ; <double> [#uses=1]
- store double %tmp.18.i20009, double* %tmp.16.i20007
- %tmp.4.i19983 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i19982, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i20020, double* %tmp.4.i19983
- %tmp.7.i19986 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i19982, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i20023, double* %tmp.7.i19986
- %tmp.0.i19989 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i19982, %"struct.std::dcomplex"* %mem_tmp.773 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i19991 = getelementptr %"struct.std::dcomplex"* %tmp.0.i19989, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i19992 = load double* %tmp.14.i19991 ; <double> [#uses=1]
- %tmp.17.i19994 = getelementptr %"struct.std::dcomplex"* %tmp.0.i19989, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i19995 = load double* %tmp.17.i19994 ; <double> [#uses=1]
- %tmp.4.i19969 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i19968, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i19992, double* %tmp.4.i19969
- %tmp.7.i19972 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i19968, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i19995, double* %tmp.7.i19972
- %tmp.0.i19975 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i19968, %"struct.std::dcomplex"* %tmp.15 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i19976 = getelementptr %"struct.std::dcomplex"* %mem_tmp.770, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i19977 = getelementptr %"struct.std::dcomplex"* %tmp.0.i19975, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i19978 = load double* %tmp.14.i19977 ; <double> [#uses=1]
- store double %tmp.15.i19978, double* %tmp.13.i19976
- %tmp.16.i19979 = getelementptr %"struct.std::dcomplex"* %mem_tmp.770, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i19980 = getelementptr %"struct.std::dcomplex"* %tmp.0.i19975, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i19981 = load double* %tmp.17.i19980 ; <double> [#uses=1]
- store double %tmp.18.i19981, double* %tmp.16.i19979
- %tmp.4.i19955 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i19954, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i20034, double* %tmp.4.i19955
- %tmp.7.i19958 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i19954, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i20037, double* %tmp.7.i19958
- %tmp.0.i19961 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i19954, %"struct.std::dcomplex"* %mem_tmp.770 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i19963 = getelementptr %"struct.std::dcomplex"* %tmp.0.i19961, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i19964 = load double* %tmp.14.i19963 ; <double> [#uses=1]
- %tmp.17.i19966 = getelementptr %"struct.std::dcomplex"* %tmp.0.i19961, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i19967 = load double* %tmp.17.i19966 ; <double> [#uses=1]
- %tmp.4.i19941 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i19940, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i19943 = load double* %tmp.5.i34352 ; <double> [#uses=1]
- store double %tmp.6.i19943, double* %tmp.4.i19941
- %tmp.7.i19944 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i19940, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i19946 = load double* %tmp.8.i34355 ; <double> [#uses=1]
- store double %tmp.9.i19946, double* %tmp.7.i19944
- %tmp.0.i19947 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i19940, %"struct.std::dcomplex"* %tmp.21 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i19949 = getelementptr %"struct.std::dcomplex"* %tmp.0.i19947, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i19950 = load double* %tmp.14.i19949 ; <double> [#uses=1]
- %tmp.17.i19952 = getelementptr %"struct.std::dcomplex"* %tmp.0.i19947, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i19953 = load double* %tmp.17.i19952 ; <double> [#uses=1]
- %tmp.4.i19927 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i19926, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i19929 = load double* %tmp.5.i34282 ; <double> [#uses=1]
- store double %tmp.6.i19929, double* %tmp.4.i19927
- %tmp.7.i19930 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i19926, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i19932 = load double* %tmp.8.i34285 ; <double> [#uses=1]
- store double %tmp.9.i19932, double* %tmp.7.i19930
- %tmp.0.i19933 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i19926, %"struct.std::dcomplex"* %tmp.12 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i19934 = getelementptr %"struct.std::dcomplex"* %mem_tmp.777, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i19935 = getelementptr %"struct.std::dcomplex"* %tmp.0.i19933, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i19936 = load double* %tmp.14.i19935 ; <double> [#uses=1]
- store double %tmp.15.i19936, double* %tmp.13.i19934
- %tmp.16.i19937 = getelementptr %"struct.std::dcomplex"* %mem_tmp.777, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i19938 = getelementptr %"struct.std::dcomplex"* %tmp.0.i19933, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i19939 = load double* %tmp.17.i19938 ; <double> [#uses=1]
- store double %tmp.18.i19939, double* %tmp.16.i19937
- %tmp.4.i19913 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i19912, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i19950, double* %tmp.4.i19913
- %tmp.7.i19916 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i19912, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i19953, double* %tmp.7.i19916
- %tmp.0.i19919 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i19912, %"struct.std::dcomplex"* %mem_tmp.777 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i19921 = getelementptr %"struct.std::dcomplex"* %tmp.0.i19919, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i19922 = load double* %tmp.14.i19921 ; <double> [#uses=1]
- %tmp.17.i19924 = getelementptr %"struct.std::dcomplex"* %tmp.0.i19919, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i19925 = load double* %tmp.17.i19924 ; <double> [#uses=1]
- %tmp.4.i19899 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i19898, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i19922, double* %tmp.4.i19899
- %tmp.7.i19902 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i19898, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i19925, double* %tmp.7.i19902
- %tmp.0.i19905 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i19898, %"struct.std::dcomplex"* %tmp.1075 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i19906 = getelementptr %"struct.std::dcomplex"* %mem_tmp.774, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i19907 = getelementptr %"struct.std::dcomplex"* %tmp.0.i19905, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i19908 = load double* %tmp.14.i19907 ; <double> [#uses=1]
- store double %tmp.15.i19908, double* %tmp.13.i19906
- %tmp.16.i19909 = getelementptr %"struct.std::dcomplex"* %mem_tmp.774, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i19910 = getelementptr %"struct.std::dcomplex"* %tmp.0.i19905, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i19911 = load double* %tmp.17.i19910 ; <double> [#uses=1]
- store double %tmp.18.i19911, double* %tmp.16.i19909
- %tmp.4.i19885 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i19884, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i19964, double* %tmp.4.i19885
- %tmp.7.i19888 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i19884, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i19967, double* %tmp.7.i19888
- %tmp.0.i19891 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i19884, %"struct.std::dcomplex"* %mem_tmp.774 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i19893 = getelementptr %"struct.std::dcomplex"* %tmp.0.i19891, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i19894 = load double* %tmp.14.i19893 ; <double> [#uses=1]
- %tmp.17.i19896 = getelementptr %"struct.std::dcomplex"* %tmp.0.i19891, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i19897 = load double* %tmp.17.i19896 ; <double> [#uses=1]
- store double %tmp.15.i19894, double* %tmp.2.i34364
- store double %tmp.18.i19897, double* %tmp.6.i34365
- %tmp.4.i19851 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i19850, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i19853 = load double* %tmp.5.i34136 ; <double> [#uses=1]
- store double %tmp.6.i19853, double* %tmp.4.i19851
- %tmp.7.i19854 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i19850, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i19856 = load double* %tmp.8.i34139 ; <double> [#uses=1]
- store double %tmp.9.i19856, double* %tmp.7.i19854
- %tmp.0.i19857 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i19850, %"struct.std::dcomplex"* %ret3 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i19859 = getelementptr %"struct.std::dcomplex"* %tmp.0.i19857, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i19860 = load double* %tmp.14.i19859 ; <double> [#uses=1]
- %tmp.17.i19862 = getelementptr %"struct.std::dcomplex"* %tmp.0.i19857, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i19863 = load double* %tmp.17.i19862 ; <double> [#uses=1]
- %tmp.7.i19817 = load double* %tmp.2.i34366 ; <double> [#uses=1]
- %tmp.15.i19831 = add double %tmp.7.i19817, %tmp.15.i19860 ; <double> [#uses=1]
- store double %tmp.15.i19831, double* %tmp.2.i34366
- %tmp.26.i19838 = load double* %tmp.6.i34367 ; <double> [#uses=1]
- %tmp.31.i19849 = add double %tmp.26.i19838, %tmp.18.i19863 ; <double> [#uses=1]
- store double %tmp.31.i19849, double* %tmp.6.i34367
- %tmp.4.i19797 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i19796, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i19799 = load double* %tmp.5.i34282 ; <double> [#uses=1]
- store double %tmp.6.i19799, double* %tmp.4.i19797
- %tmp.7.i19800 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i19796, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i19802 = load double* %tmp.8.i34285 ; <double> [#uses=1]
- store double %tmp.9.i19802, double* %tmp.7.i19800
- %tmp.0.i19803 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i19796, %"struct.std::dcomplex"* %tmp.12 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i19805 = getelementptr %"struct.std::dcomplex"* %tmp.0.i19803, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i19806 = load double* %tmp.14.i19805 ; <double> [#uses=1]
- %tmp.17.i19808 = getelementptr %"struct.std::dcomplex"* %tmp.0.i19803, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i19809 = load double* %tmp.17.i19808 ; <double> [#uses=1]
- %tmp.4.i19783 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i19782, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i19785 = load double* %tmp.5.i34352 ; <double> [#uses=1]
- store double %tmp.6.i19785, double* %tmp.4.i19783
- %tmp.7.i19786 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i19782, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i19788 = load double* %tmp.8.i34355 ; <double> [#uses=1]
- store double %tmp.9.i19788, double* %tmp.7.i19786
- %tmp.0.i19789 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i19782, %"struct.std::dcomplex"* %tmp.21 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i19790 = getelementptr %"struct.std::dcomplex"* %mem_tmp.784, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i19791 = getelementptr %"struct.std::dcomplex"* %tmp.0.i19789, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i19792 = load double* %tmp.14.i19791 ; <double> [#uses=1]
- store double %tmp.15.i19792, double* %tmp.13.i19790
- %tmp.16.i19793 = getelementptr %"struct.std::dcomplex"* %mem_tmp.784, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i19794 = getelementptr %"struct.std::dcomplex"* %tmp.0.i19789, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i19795 = load double* %tmp.17.i19794 ; <double> [#uses=1]
- store double %tmp.18.i19795, double* %tmp.16.i19793
- %tmp.4.i19769 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i19768, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i19806, double* %tmp.4.i19769
- %tmp.7.i19772 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i19768, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i19809, double* %tmp.7.i19772
- %tmp.0.i19775 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i19768, %"struct.std::dcomplex"* %mem_tmp.784 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i19777 = getelementptr %"struct.std::dcomplex"* %tmp.0.i19775, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i19778 = load double* %tmp.14.i19777 ; <double> [#uses=1]
- %tmp.17.i19780 = getelementptr %"struct.std::dcomplex"* %tmp.0.i19775, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i19781 = load double* %tmp.17.i19780 ; <double> [#uses=1]
- %tmp.4.i19755 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i19754, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i19778, double* %tmp.4.i19755
- %tmp.7.i19758 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i19754, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i19781, double* %tmp.7.i19758
- %tmp.0.i19761 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i19754, %"struct.std::dcomplex"* %tmp.95 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i19763 = getelementptr %"struct.std::dcomplex"* %tmp.0.i19761, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i19764 = load double* %tmp.14.i19763 ; <double> [#uses=1]
- %tmp.17.i19766 = getelementptr %"struct.std::dcomplex"* %tmp.0.i19761, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i19767 = load double* %tmp.17.i19766 ; <double> [#uses=1]
- %tmp.4.i19741 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i19740, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i19743 = load double* %tmp.5.i34082 ; <double> [#uses=1]
- store double %tmp.6.i19743, double* %tmp.4.i19741
- %tmp.7.i19744 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i19740, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i19746 = load double* %tmp.8.i34085 ; <double> [#uses=1]
- store double %tmp.9.i19746, double* %tmp.7.i19744
- %tmp.0.i19747 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i19740, %"struct.std::dcomplex"* %tmp.21 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i19749 = getelementptr %"struct.std::dcomplex"* %tmp.0.i19747, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i19750 = load double* %tmp.14.i19749 ; <double> [#uses=1]
- %tmp.17.i19752 = getelementptr %"struct.std::dcomplex"* %tmp.0.i19747, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i19753 = load double* %tmp.17.i19752 ; <double> [#uses=1]
- %tmp.4.i19727 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i19726, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i19729 = load double* %tmp.5.i34282 ; <double> [#uses=1]
- store double %tmp.6.i19729, double* %tmp.4.i19727
- %tmp.7.i19730 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i19726, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i19732 = load double* %tmp.8.i34285 ; <double> [#uses=1]
- store double %tmp.9.i19732, double* %tmp.7.i19730
- %tmp.0.i19733 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i19726, %"struct.std::dcomplex"* %tmp.62 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i19734 = getelementptr %"struct.std::dcomplex"* %mem_tmp.788, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i19735 = getelementptr %"struct.std::dcomplex"* %tmp.0.i19733, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i19736 = load double* %tmp.14.i19735 ; <double> [#uses=1]
- store double %tmp.15.i19736, double* %tmp.13.i19734
- %tmp.16.i19737 = getelementptr %"struct.std::dcomplex"* %mem_tmp.788, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i19738 = getelementptr %"struct.std::dcomplex"* %tmp.0.i19733, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i19739 = load double* %tmp.17.i19738 ; <double> [#uses=1]
- store double %tmp.18.i19739, double* %tmp.16.i19737
- %tmp.4.i19713 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i19712, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i19750, double* %tmp.4.i19713
- %tmp.7.i19716 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i19712, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i19753, double* %tmp.7.i19716
- %tmp.0.i19719 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i19712, %"struct.std::dcomplex"* %mem_tmp.788 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i19721 = getelementptr %"struct.std::dcomplex"* %tmp.0.i19719, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i19722 = load double* %tmp.14.i19721 ; <double> [#uses=1]
- %tmp.17.i19724 = getelementptr %"struct.std::dcomplex"* %tmp.0.i19719, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i19725 = load double* %tmp.17.i19724 ; <double> [#uses=1]
- %tmp.4.i19699 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i19698, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i19722, double* %tmp.4.i19699
- %tmp.7.i19702 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i19698, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i19725, double* %tmp.7.i19702
- %tmp.0.i19705 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i19698, %"struct.std::dcomplex"* %tmp.30 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i19706 = getelementptr %"struct.std::dcomplex"* %mem_tmp.785, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i19707 = getelementptr %"struct.std::dcomplex"* %tmp.0.i19705, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i19708 = load double* %tmp.14.i19707 ; <double> [#uses=1]
- store double %tmp.15.i19708, double* %tmp.13.i19706
- %tmp.16.i19709 = getelementptr %"struct.std::dcomplex"* %mem_tmp.785, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i19710 = getelementptr %"struct.std::dcomplex"* %tmp.0.i19705, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i19711 = load double* %tmp.17.i19710 ; <double> [#uses=1]
- store double %tmp.18.i19711, double* %tmp.16.i19709
- %tmp.4.i19685 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i19684, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i19764, double* %tmp.4.i19685
- %tmp.7.i19688 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i19684, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i19767, double* %tmp.7.i19688
- %tmp.0.i19691 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i19684, %"struct.std::dcomplex"* %mem_tmp.785 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i19693 = getelementptr %"struct.std::dcomplex"* %tmp.0.i19691, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i19694 = load double* %tmp.14.i19693 ; <double> [#uses=1]
- %tmp.17.i19696 = getelementptr %"struct.std::dcomplex"* %tmp.0.i19691, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i19697 = load double* %tmp.17.i19696 ; <double> [#uses=1]
- %tmp.4.i19671 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i19670, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i19673 = load double* %tmp.5.i34352 ; <double> [#uses=1]
- store double %tmp.6.i19673, double* %tmp.4.i19671
- %tmp.7.i19674 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i19670, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i19676 = load double* %tmp.8.i34355 ; <double> [#uses=1]
- store double %tmp.9.i19676, double* %tmp.7.i19674
- %tmp.0.i19677 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i19670, %"struct.std::dcomplex"* %tmp.62 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i19679 = getelementptr %"struct.std::dcomplex"* %tmp.0.i19677, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i19680 = load double* %tmp.14.i19679 ; <double> [#uses=1]
- %tmp.17.i19682 = getelementptr %"struct.std::dcomplex"* %tmp.0.i19677, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i19683 = load double* %tmp.17.i19682 ; <double> [#uses=1]
- %tmp.4.i19657 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i19656, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i19659 = load double* %tmp.5.i34082 ; <double> [#uses=1]
- store double %tmp.6.i19659, double* %tmp.4.i19657
- %tmp.7.i19660 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i19656, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i19662 = load double* %tmp.8.i34085 ; <double> [#uses=1]
- store double %tmp.9.i19662, double* %tmp.7.i19660
- %tmp.0.i19663 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i19656, %"struct.std::dcomplex"* %tmp.12 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i19664 = getelementptr %"struct.std::dcomplex"* %mem_tmp.792, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i19665 = getelementptr %"struct.std::dcomplex"* %tmp.0.i19663, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i19666 = load double* %tmp.14.i19665 ; <double> [#uses=1]
- store double %tmp.15.i19666, double* %tmp.13.i19664
- %tmp.16.i19667 = getelementptr %"struct.std::dcomplex"* %mem_tmp.792, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i19668 = getelementptr %"struct.std::dcomplex"* %tmp.0.i19663, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i19669 = load double* %tmp.17.i19668 ; <double> [#uses=1]
- store double %tmp.18.i19669, double* %tmp.16.i19667
- %tmp.4.i19643 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i19642, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i19680, double* %tmp.4.i19643
- %tmp.7.i19646 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i19642, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i19683, double* %tmp.7.i19646
- %tmp.0.i19649 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i19642, %"struct.std::dcomplex"* %mem_tmp.792 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i19651 = getelementptr %"struct.std::dcomplex"* %tmp.0.i19649, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i19652 = load double* %tmp.14.i19651 ; <double> [#uses=1]
- %tmp.17.i19654 = getelementptr %"struct.std::dcomplex"* %tmp.0.i19649, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i19655 = load double* %tmp.17.i19654 ; <double> [#uses=1]
- %tmp.4.i19629 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i19628, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i19652, double* %tmp.4.i19629
- %tmp.7.i19632 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i19628, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i19655, double* %tmp.7.i19632
- %tmp.0.i19635 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i19628, %"struct.std::dcomplex"* %tmp.15 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i19636 = getelementptr %"struct.std::dcomplex"* %mem_tmp.789, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i19637 = getelementptr %"struct.std::dcomplex"* %tmp.0.i19635, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i19638 = load double* %tmp.14.i19637 ; <double> [#uses=1]
- store double %tmp.15.i19638, double* %tmp.13.i19636
- %tmp.16.i19639 = getelementptr %"struct.std::dcomplex"* %mem_tmp.789, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i19640 = getelementptr %"struct.std::dcomplex"* %tmp.0.i19635, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i19641 = load double* %tmp.17.i19640 ; <double> [#uses=1]
- store double %tmp.18.i19641, double* %tmp.16.i19639
- %tmp.4.i19615 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i19614, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i19694, double* %tmp.4.i19615
- %tmp.7.i19618 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i19614, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i19697, double* %tmp.7.i19618
- %tmp.0.i19621 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i19614, %"struct.std::dcomplex"* %mem_tmp.789 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i19623 = getelementptr %"struct.std::dcomplex"* %tmp.0.i19621, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i19624 = load double* %tmp.14.i19623 ; <double> [#uses=1]
- %tmp.17.i19626 = getelementptr %"struct.std::dcomplex"* %tmp.0.i19621, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i19627 = load double* %tmp.17.i19626 ; <double> [#uses=1]
- store double %tmp.15.i19624, double* %tmp.2.i34364
- store double %tmp.18.i19627, double* %tmp.6.i34365
- %tmp.4.i19581 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i19580, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i19583 = load double* %tmp.5.i27590 ; <double> [#uses=1]
- store double %tmp.6.i19583, double* %tmp.4.i19581
- %tmp.7.i19584 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i19580, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i19586 = load double* %tmp.8.i27593 ; <double> [#uses=1]
- store double %tmp.9.i19586, double* %tmp.7.i19584
- %tmp.0.i19587 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i19580, %"struct.std::dcomplex"* %ret3 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i19589 = getelementptr %"struct.std::dcomplex"* %tmp.0.i19587, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i19590 = load double* %tmp.14.i19589 ; <double> [#uses=1]
- %tmp.17.i19592 = getelementptr %"struct.std::dcomplex"* %tmp.0.i19587, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i19593 = load double* %tmp.17.i19592 ; <double> [#uses=1]
- %tmp.7.i19547 = load double* %tmp.2.i34366 ; <double> [#uses=1]
- %tmp.15.i19561 = add double %tmp.7.i19547, %tmp.15.i19590 ; <double> [#uses=1]
- store double %tmp.15.i19561, double* %tmp.2.i34366
- %tmp.26.i19568 = load double* %tmp.6.i34367 ; <double> [#uses=1]
- %tmp.31.i19579 = add double %tmp.26.i19568, %tmp.18.i19593 ; <double> [#uses=1]
- store double %tmp.31.i19579, double* %tmp.6.i34367
- %tmp.4.i19527 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i19526, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i19529 = load double* %tmp.5.i33272 ; <double> [#uses=1]
- store double %tmp.6.i19529, double* %tmp.4.i19527
- %tmp.7.i19530 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i19526, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i19532 = load double* %tmp.8.i33275 ; <double> [#uses=1]
- store double %tmp.9.i19532, double* %tmp.7.i19530
- %tmp.0.i19533 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i19526, %"struct.std::dcomplex"* %ret4 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i19535 = getelementptr %"struct.std::dcomplex"* %tmp.0.i19533, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i19536 = load double* %tmp.14.i19535 ; <double> [#uses=1]
- %tmp.17.i19538 = getelementptr %"struct.std::dcomplex"* %tmp.0.i19533, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i19539 = load double* %tmp.17.i19538 ; <double> [#uses=1]
- %tmp.7.i19493 = load double* %tmp.2.i34368 ; <double> [#uses=1]
- %tmp.15.i19507 = add double %tmp.7.i19493, %tmp.15.i19536 ; <double> [#uses=1]
- store double %tmp.15.i19507, double* %tmp.2.i34368
- %tmp.26.i19514 = load double* %tmp.6.i34369 ; <double> [#uses=1]
- %tmp.31.i19525 = add double %tmp.26.i19514, %tmp.18.i19539 ; <double> [#uses=1]
- store double %tmp.31.i19525, double* %tmp.6.i34369
- store double 0.000000e+00, double* %tmp.2.i34366
- store double 0.000000e+00, double* %tmp.6.i34367
- %tmp.4.i19471 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i19470, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i19473 = load double* %tmp.5.i34082 ; <double> [#uses=1]
- store double %tmp.6.i19473, double* %tmp.4.i19471
- %tmp.7.i19474 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i19470, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i19476 = load double* %tmp.8.i34085 ; <double> [#uses=1]
- store double %tmp.9.i19476, double* %tmp.7.i19474
- %tmp.0.i19477 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i19470, %"struct.std::dcomplex"* %tmp.12 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i19479 = getelementptr %"struct.std::dcomplex"* %tmp.0.i19477, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i19480 = load double* %tmp.14.i19479 ; <double> [#uses=1]
- %tmp.17.i19482 = getelementptr %"struct.std::dcomplex"* %tmp.0.i19477, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i19483 = load double* %tmp.17.i19482 ; <double> [#uses=1]
- %tmp.4.i19457 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i19456, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i19459 = load double* %tmp.5.i34352 ; <double> [#uses=1]
- store double %tmp.6.i19459, double* %tmp.4.i19457
- %tmp.7.i19460 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i19456, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i19462 = load double* %tmp.8.i34355 ; <double> [#uses=1]
- store double %tmp.9.i19462, double* %tmp.7.i19460
- %tmp.0.i19463 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i19456, %"struct.std::dcomplex"* %tmp.62 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i19464 = getelementptr %"struct.std::dcomplex"* %mem_tmp.800, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i19465 = getelementptr %"struct.std::dcomplex"* %tmp.0.i19463, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i19466 = load double* %tmp.14.i19465 ; <double> [#uses=1]
- store double %tmp.15.i19466, double* %tmp.13.i19464
- %tmp.16.i19467 = getelementptr %"struct.std::dcomplex"* %mem_tmp.800, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i19468 = getelementptr %"struct.std::dcomplex"* %tmp.0.i19463, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i19469 = load double* %tmp.17.i19468 ; <double> [#uses=1]
- store double %tmp.18.i19469, double* %tmp.16.i19467
- %tmp.4.i19443 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i19442, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i19480, double* %tmp.4.i19443
- %tmp.7.i19446 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i19442, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i19483, double* %tmp.7.i19446
- %tmp.0.i19449 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i19442, %"struct.std::dcomplex"* %mem_tmp.800 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i19451 = getelementptr %"struct.std::dcomplex"* %tmp.0.i19449, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i19452 = load double* %tmp.14.i19451 ; <double> [#uses=1]
- %tmp.17.i19454 = getelementptr %"struct.std::dcomplex"* %tmp.0.i19449, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i19455 = load double* %tmp.17.i19454 ; <double> [#uses=1]
- %tmp.4.i19429 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i19428, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i19452, double* %tmp.4.i19429
- %tmp.7.i19432 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i19428, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i19455, double* %tmp.7.i19432
- %tmp.0.i19435 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i19428, %"struct.std::dcomplex"* %tmp.15 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i19437 = getelementptr %"struct.std::dcomplex"* %tmp.0.i19435, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i19438 = load double* %tmp.14.i19437 ; <double> [#uses=1]
- %tmp.17.i19440 = getelementptr %"struct.std::dcomplex"* %tmp.0.i19435, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i19441 = load double* %tmp.17.i19440 ; <double> [#uses=1]
- %tmp.4.i19415 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i19414, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i19417 = load double* %tmp.5.i34352 ; <double> [#uses=1]
- store double %tmp.6.i19417, double* %tmp.4.i19415
- %tmp.7.i19418 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i19414, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i19420 = load double* %tmp.8.i34355 ; <double> [#uses=1]
- store double %tmp.9.i19420, double* %tmp.7.i19418
- %tmp.0.i19421 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i19414, %"struct.std::dcomplex"* %tmp.21 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i19423 = getelementptr %"struct.std::dcomplex"* %tmp.0.i19421, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i19424 = load double* %tmp.14.i19423 ; <double> [#uses=1]
- %tmp.17.i19426 = getelementptr %"struct.std::dcomplex"* %tmp.0.i19421, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i19427 = load double* %tmp.17.i19426 ; <double> [#uses=1]
- %tmp.4.i19401 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i19400, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i19403 = load double* %tmp.5.i34282 ; <double> [#uses=1]
- store double %tmp.6.i19403, double* %tmp.4.i19401
- %tmp.7.i19404 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i19400, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i19406 = load double* %tmp.8.i34285 ; <double> [#uses=1]
- store double %tmp.9.i19406, double* %tmp.7.i19404
- %tmp.0.i19407 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i19400, %"struct.std::dcomplex"* %tmp.12 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i19408 = getelementptr %"struct.std::dcomplex"* %mem_tmp.804, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i19409 = getelementptr %"struct.std::dcomplex"* %tmp.0.i19407, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i19410 = load double* %tmp.14.i19409 ; <double> [#uses=1]
- store double %tmp.15.i19410, double* %tmp.13.i19408
- %tmp.16.i19411 = getelementptr %"struct.std::dcomplex"* %mem_tmp.804, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i19412 = getelementptr %"struct.std::dcomplex"* %tmp.0.i19407, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i19413 = load double* %tmp.17.i19412 ; <double> [#uses=1]
- store double %tmp.18.i19413, double* %tmp.16.i19411
- %tmp.4.i19387 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i19386, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i19424, double* %tmp.4.i19387
- %tmp.7.i19390 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i19386, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i19427, double* %tmp.7.i19390
- %tmp.0.i19393 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i19386, %"struct.std::dcomplex"* %mem_tmp.804 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i19395 = getelementptr %"struct.std::dcomplex"* %tmp.0.i19393, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i19396 = load double* %tmp.14.i19395 ; <double> [#uses=1]
- %tmp.17.i19398 = getelementptr %"struct.std::dcomplex"* %tmp.0.i19393, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i19399 = load double* %tmp.17.i19398 ; <double> [#uses=1]
- %tmp.4.i19373 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i19372, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i19396, double* %tmp.4.i19373
- %tmp.7.i19376 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i19372, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i19399, double* %tmp.7.i19376
- %tmp.0.i19379 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i19372, %"struct.std::dcomplex"* %tmp.95 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i19380 = getelementptr %"struct.std::dcomplex"* %mem_tmp.801, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i19381 = getelementptr %"struct.std::dcomplex"* %tmp.0.i19379, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i19382 = load double* %tmp.14.i19381 ; <double> [#uses=1]
- store double %tmp.15.i19382, double* %tmp.13.i19380
- %tmp.16.i19383 = getelementptr %"struct.std::dcomplex"* %mem_tmp.801, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i19384 = getelementptr %"struct.std::dcomplex"* %tmp.0.i19379, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i19385 = load double* %tmp.17.i19384 ; <double> [#uses=1]
- store double %tmp.18.i19385, double* %tmp.16.i19383
- %tmp.4.i19359 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i19358, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i19438, double* %tmp.4.i19359
- %tmp.7.i19362 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i19358, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i19441, double* %tmp.7.i19362
- %tmp.0.i19365 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i19358, %"struct.std::dcomplex"* %mem_tmp.801 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i19367 = getelementptr %"struct.std::dcomplex"* %tmp.0.i19365, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i19368 = load double* %tmp.14.i19367 ; <double> [#uses=1]
- %tmp.17.i19370 = getelementptr %"struct.std::dcomplex"* %tmp.0.i19365, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i19371 = load double* %tmp.17.i19370 ; <double> [#uses=1]
- %tmp.4.i19345 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i19344, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i19347 = load double* %tmp.5.i34282 ; <double> [#uses=1]
- store double %tmp.6.i19347, double* %tmp.4.i19345
- %tmp.7.i19348 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i19344, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i19350 = load double* %tmp.8.i34285 ; <double> [#uses=1]
- store double %tmp.9.i19350, double* %tmp.7.i19348
- %tmp.0.i19351 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i19344, %"struct.std::dcomplex"* %tmp.62 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i19353 = getelementptr %"struct.std::dcomplex"* %tmp.0.i19351, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i19354 = load double* %tmp.14.i19353 ; <double> [#uses=1]
- %tmp.17.i19356 = getelementptr %"struct.std::dcomplex"* %tmp.0.i19351, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i19357 = load double* %tmp.17.i19356 ; <double> [#uses=1]
- %tmp.4.i19331 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i19330, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i19333 = load double* %tmp.5.i34082 ; <double> [#uses=1]
- store double %tmp.6.i19333, double* %tmp.4.i19331
- %tmp.7.i19334 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i19330, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i19336 = load double* %tmp.8.i34085 ; <double> [#uses=1]
- store double %tmp.9.i19336, double* %tmp.7.i19334
- %tmp.0.i19337 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i19330, %"struct.std::dcomplex"* %tmp.21 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i19338 = getelementptr %"struct.std::dcomplex"* %mem_tmp.808, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i19339 = getelementptr %"struct.std::dcomplex"* %tmp.0.i19337, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i19340 = load double* %tmp.14.i19339 ; <double> [#uses=1]
- store double %tmp.15.i19340, double* %tmp.13.i19338
- %tmp.16.i19341 = getelementptr %"struct.std::dcomplex"* %mem_tmp.808, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i19342 = getelementptr %"struct.std::dcomplex"* %tmp.0.i19337, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i19343 = load double* %tmp.17.i19342 ; <double> [#uses=1]
- store double %tmp.18.i19343, double* %tmp.16.i19341
- %tmp.4.i19317 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i19316, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i19354, double* %tmp.4.i19317
- %tmp.7.i19320 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i19316, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i19357, double* %tmp.7.i19320
- %tmp.0.i19323 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i19316, %"struct.std::dcomplex"* %mem_tmp.808 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i19325 = getelementptr %"struct.std::dcomplex"* %tmp.0.i19323, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i19326 = load double* %tmp.14.i19325 ; <double> [#uses=1]
- %tmp.17.i19328 = getelementptr %"struct.std::dcomplex"* %tmp.0.i19323, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i19329 = load double* %tmp.17.i19328 ; <double> [#uses=1]
- %tmp.4.i19303 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i19302, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i19326, double* %tmp.4.i19303
- %tmp.7.i19306 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i19302, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i19329, double* %tmp.7.i19306
- %tmp.0.i19309 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i19302, %"struct.std::dcomplex"* %tmp.30 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i19310 = getelementptr %"struct.std::dcomplex"* %mem_tmp.805, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i19311 = getelementptr %"struct.std::dcomplex"* %tmp.0.i19309, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i19312 = load double* %tmp.14.i19311 ; <double> [#uses=1]
- store double %tmp.15.i19312, double* %tmp.13.i19310
- %tmp.16.i19313 = getelementptr %"struct.std::dcomplex"* %mem_tmp.805, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i19314 = getelementptr %"struct.std::dcomplex"* %tmp.0.i19309, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i19315 = load double* %tmp.17.i19314 ; <double> [#uses=1]
- store double %tmp.18.i19315, double* %tmp.16.i19313
- %tmp.4.i19289 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i19288, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i19368, double* %tmp.4.i19289
- %tmp.7.i19292 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i19288, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i19371, double* %tmp.7.i19292
- %tmp.0.i19295 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i19288, %"struct.std::dcomplex"* %mem_tmp.805 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i19297 = getelementptr %"struct.std::dcomplex"* %tmp.0.i19295, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i19298 = load double* %tmp.14.i19297 ; <double> [#uses=1]
- %tmp.17.i19300 = getelementptr %"struct.std::dcomplex"* %tmp.0.i19295, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i19301 = load double* %tmp.17.i19300 ; <double> [#uses=1]
- store double %tmp.15.i19298, double* %tmp.2.i34364
- store double %tmp.18.i19301, double* %tmp.6.i34365
- %tmp.4.i19255 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i19254, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i19257 = load double* %tmp.5.i32460 ; <double> [#uses=1]
- store double %tmp.6.i19257, double* %tmp.4.i19255
- %tmp.7.i19258 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i19254, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i19260 = load double* %tmp.8.i32463 ; <double> [#uses=1]
- store double %tmp.9.i19260, double* %tmp.7.i19258
- %tmp.0.i19261 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i19254, %"struct.std::dcomplex"* %ret3 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i19263 = getelementptr %"struct.std::dcomplex"* %tmp.0.i19261, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i19264 = load double* %tmp.14.i19263 ; <double> [#uses=1]
- %tmp.17.i19266 = getelementptr %"struct.std::dcomplex"* %tmp.0.i19261, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i19267 = load double* %tmp.17.i19266 ; <double> [#uses=1]
- %tmp.7.i19221 = load double* %tmp.2.i34366 ; <double> [#uses=1]
- %tmp.15.i19235 = add double %tmp.7.i19221, %tmp.15.i19264 ; <double> [#uses=1]
- store double %tmp.15.i19235, double* %tmp.2.i34366
- %tmp.26.i19242 = load double* %tmp.6.i34367 ; <double> [#uses=1]
- %tmp.31.i19253 = add double %tmp.26.i19242, %tmp.18.i19267 ; <double> [#uses=1]
- store double %tmp.31.i19253, double* %tmp.6.i34367
- %tmp.4.i19201 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i19200, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i19203 = load double* %tmp.5.i34082 ; <double> [#uses=1]
- store double %tmp.6.i19203, double* %tmp.4.i19201
- %tmp.7.i19204 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i19200, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i19206 = load double* %tmp.8.i34085 ; <double> [#uses=1]
- store double %tmp.9.i19206, double* %tmp.7.i19204
- %tmp.0.i19207 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i19200, %"struct.std::dcomplex"* %tmp.21 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i19209 = getelementptr %"struct.std::dcomplex"* %tmp.0.i19207, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i19210 = load double* %tmp.14.i19209 ; <double> [#uses=1]
- %tmp.17.i19212 = getelementptr %"struct.std::dcomplex"* %tmp.0.i19207, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i19213 = load double* %tmp.17.i19212 ; <double> [#uses=1]
- %tmp.4.i19187 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i19186, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i19189 = load double* %tmp.5.i34282 ; <double> [#uses=1]
- store double %tmp.6.i19189, double* %tmp.4.i19187
- %tmp.7.i19190 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i19186, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i19192 = load double* %tmp.8.i34285 ; <double> [#uses=1]
- store double %tmp.9.i19192, double* %tmp.7.i19190
- %tmp.0.i19193 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i19186, %"struct.std::dcomplex"* %tmp.62 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i19194 = getelementptr %"struct.std::dcomplex"* %mem_tmp.815, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i19195 = getelementptr %"struct.std::dcomplex"* %tmp.0.i19193, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i19196 = load double* %tmp.14.i19195 ; <double> [#uses=1]
- store double %tmp.15.i19196, double* %tmp.13.i19194
- %tmp.16.i19197 = getelementptr %"struct.std::dcomplex"* %mem_tmp.815, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i19198 = getelementptr %"struct.std::dcomplex"* %tmp.0.i19193, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i19199 = load double* %tmp.17.i19198 ; <double> [#uses=1]
- store double %tmp.18.i19199, double* %tmp.16.i19197
- %tmp.4.i19173 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i19172, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i19210, double* %tmp.4.i19173
- %tmp.7.i19176 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i19172, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i19213, double* %tmp.7.i19176
- %tmp.0.i19179 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i19172, %"struct.std::dcomplex"* %mem_tmp.815 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i19181 = getelementptr %"struct.std::dcomplex"* %tmp.0.i19179, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i19182 = load double* %tmp.14.i19181 ; <double> [#uses=1]
- %tmp.17.i19184 = getelementptr %"struct.std::dcomplex"* %tmp.0.i19179, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i19185 = load double* %tmp.17.i19184 ; <double> [#uses=1]
- %tmp.4.i19159 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i19158, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i19182, double* %tmp.4.i19159
- %tmp.7.i19162 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i19158, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i19185, double* %tmp.7.i19162
- %tmp.0.i19165 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i19158, %"struct.std::dcomplex"* %tmp.220 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i19167 = getelementptr %"struct.std::dcomplex"* %tmp.0.i19165, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i19168 = load double* %tmp.14.i19167 ; <double> [#uses=1]
- %tmp.17.i19170 = getelementptr %"struct.std::dcomplex"* %tmp.0.i19165, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i19171 = load double* %tmp.17.i19170 ; <double> [#uses=1]
- %tmp.4.i19145 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i19144, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i19147 = load double* %tmp.5.i33146 ; <double> [#uses=1]
- store double %tmp.6.i19147, double* %tmp.4.i19145
- %tmp.7.i19148 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i19144, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i19150 = load double* %tmp.8.i33149 ; <double> [#uses=1]
- store double %tmp.9.i19150, double* %tmp.7.i19148
- %tmp.0.i19151 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i19144, %"struct.std::dcomplex"* %tmp.62 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i19153 = getelementptr %"struct.std::dcomplex"* %tmp.0.i19151, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i19154 = load double* %tmp.14.i19153 ; <double> [#uses=1]
- %tmp.17.i19156 = getelementptr %"struct.std::dcomplex"* %tmp.0.i19151, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i19157 = load double* %tmp.17.i19156 ; <double> [#uses=1]
- %tmp.4.i19131 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i19130, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i19133 = load double* %tmp.5.i34082 ; <double> [#uses=1]
- store double %tmp.6.i19133, double* %tmp.4.i19131
- %tmp.7.i19134 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i19130, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i19136 = load double* %tmp.8.i34085 ; <double> [#uses=1]
- store double %tmp.9.i19136, double* %tmp.7.i19134
- %tmp.0.i19137 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i19130, %"struct.std::dcomplex"* %tmp.226 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i19138 = getelementptr %"struct.std::dcomplex"* %mem_tmp.819, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i19139 = getelementptr %"struct.std::dcomplex"* %tmp.0.i19137, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i19140 = load double* %tmp.14.i19139 ; <double> [#uses=1]
- store double %tmp.15.i19140, double* %tmp.13.i19138
- %tmp.16.i19141 = getelementptr %"struct.std::dcomplex"* %mem_tmp.819, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i19142 = getelementptr %"struct.std::dcomplex"* %tmp.0.i19137, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i19143 = load double* %tmp.17.i19142 ; <double> [#uses=1]
- store double %tmp.18.i19143, double* %tmp.16.i19141
- %tmp.4.i19117 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i19116, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i19154, double* %tmp.4.i19117
- %tmp.7.i19120 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i19116, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i19157, double* %tmp.7.i19120
- %tmp.0.i19123 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i19116, %"struct.std::dcomplex"* %mem_tmp.819 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i19125 = getelementptr %"struct.std::dcomplex"* %tmp.0.i19123, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i19126 = load double* %tmp.14.i19125 ; <double> [#uses=1]
- %tmp.17.i19128 = getelementptr %"struct.std::dcomplex"* %tmp.0.i19123, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i19129 = load double* %tmp.17.i19128 ; <double> [#uses=1]
- %tmp.4.i19103 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i19102, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i19126, double* %tmp.4.i19103
- %tmp.7.i19106 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i19102, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i19129, double* %tmp.7.i19106
- %tmp.0.i19109 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i19102, %"struct.std::dcomplex"* %tmp.15 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i19110 = getelementptr %"struct.std::dcomplex"* %mem_tmp.816, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i19111 = getelementptr %"struct.std::dcomplex"* %tmp.0.i19109, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i19112 = load double* %tmp.14.i19111 ; <double> [#uses=1]
- store double %tmp.15.i19112, double* %tmp.13.i19110
- %tmp.16.i19113 = getelementptr %"struct.std::dcomplex"* %mem_tmp.816, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i19114 = getelementptr %"struct.std::dcomplex"* %tmp.0.i19109, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i19115 = load double* %tmp.17.i19114 ; <double> [#uses=1]
- store double %tmp.18.i19115, double* %tmp.16.i19113
- %tmp.4.i19089 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i19088, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i19168, double* %tmp.4.i19089
- %tmp.7.i19092 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i19088, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i19171, double* %tmp.7.i19092
- %tmp.0.i19095 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i19088, %"struct.std::dcomplex"* %mem_tmp.816 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i19097 = getelementptr %"struct.std::dcomplex"* %tmp.0.i19095, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i19098 = load double* %tmp.14.i19097 ; <double> [#uses=1]
- %tmp.17.i19100 = getelementptr %"struct.std::dcomplex"* %tmp.0.i19095, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i19101 = load double* %tmp.17.i19100 ; <double> [#uses=1]
- %tmp.4.i19075 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i19074, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i19077 = load double* %tmp.5.i34282 ; <double> [#uses=1]
- store double %tmp.6.i19077, double* %tmp.4.i19075
- %tmp.7.i19078 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i19074, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i19080 = load double* %tmp.8.i34285 ; <double> [#uses=1]
- store double %tmp.9.i19080, double* %tmp.7.i19078
- %tmp.0.i19081 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i19074, %"struct.std::dcomplex"* %tmp.226 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i19083 = getelementptr %"struct.std::dcomplex"* %tmp.0.i19081, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i19084 = load double* %tmp.14.i19083 ; <double> [#uses=1]
- %tmp.17.i19086 = getelementptr %"struct.std::dcomplex"* %tmp.0.i19081, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i19087 = load double* %tmp.17.i19086 ; <double> [#uses=1]
- %tmp.4.i19061 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i19060, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i19063 = load double* %tmp.5.i33146 ; <double> [#uses=1]
- store double %tmp.6.i19063, double* %tmp.4.i19061
- %tmp.7.i19064 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i19060, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i19066 = load double* %tmp.8.i33149 ; <double> [#uses=1]
- store double %tmp.9.i19066, double* %tmp.7.i19064
- %tmp.0.i19067 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i19060, %"struct.std::dcomplex"* %tmp.21 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i19068 = getelementptr %"struct.std::dcomplex"* %mem_tmp.823, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i19069 = getelementptr %"struct.std::dcomplex"* %tmp.0.i19067, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i19070 = load double* %tmp.14.i19069 ; <double> [#uses=1]
- store double %tmp.15.i19070, double* %tmp.13.i19068
- %tmp.16.i19071 = getelementptr %"struct.std::dcomplex"* %mem_tmp.823, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i19072 = getelementptr %"struct.std::dcomplex"* %tmp.0.i19067, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i19073 = load double* %tmp.17.i19072 ; <double> [#uses=1]
- store double %tmp.18.i19073, double* %tmp.16.i19071
- %tmp.4.i19047 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i19046, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i19084, double* %tmp.4.i19047
- %tmp.7.i19050 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i19046, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i19087, double* %tmp.7.i19050
- %tmp.0.i19053 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i19046, %"struct.std::dcomplex"* %mem_tmp.823 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i19055 = getelementptr %"struct.std::dcomplex"* %tmp.0.i19053, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i19056 = load double* %tmp.14.i19055 ; <double> [#uses=1]
- %tmp.17.i19058 = getelementptr %"struct.std::dcomplex"* %tmp.0.i19053, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i19059 = load double* %tmp.17.i19058 ; <double> [#uses=1]
- %tmp.4.i19033 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i19032, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i19056, double* %tmp.4.i19033
- %tmp.7.i19036 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i19032, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i19059, double* %tmp.7.i19036
- %tmp.0.i19039 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i19032, %"struct.std::dcomplex"* %tmp.95 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i19040 = getelementptr %"struct.std::dcomplex"* %mem_tmp.820, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i19041 = getelementptr %"struct.std::dcomplex"* %tmp.0.i19039, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i19042 = load double* %tmp.14.i19041 ; <double> [#uses=1]
- store double %tmp.15.i19042, double* %tmp.13.i19040
- %tmp.16.i19043 = getelementptr %"struct.std::dcomplex"* %mem_tmp.820, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i19044 = getelementptr %"struct.std::dcomplex"* %tmp.0.i19039, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i19045 = load double* %tmp.17.i19044 ; <double> [#uses=1]
- store double %tmp.18.i19045, double* %tmp.16.i19043
- %tmp.4.i19019 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i19018, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i19098, double* %tmp.4.i19019
- %tmp.7.i19022 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i19018, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i19101, double* %tmp.7.i19022
- %tmp.0.i19025 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i19018, %"struct.std::dcomplex"* %mem_tmp.820 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i19027 = getelementptr %"struct.std::dcomplex"* %tmp.0.i19025, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i19028 = load double* %tmp.14.i19027 ; <double> [#uses=1]
- %tmp.17.i19030 = getelementptr %"struct.std::dcomplex"* %tmp.0.i19025, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i19031 = load double* %tmp.17.i19030 ; <double> [#uses=1]
- store double %tmp.15.i19028, double* %tmp.2.i34364
- store double %tmp.18.i19031, double* %tmp.6.i34365
- %tmp.4.i18985 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i18984, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i18987 = load double* %tmp.5.i33866 ; <double> [#uses=1]
- store double %tmp.6.i18987, double* %tmp.4.i18985
- %tmp.7.i18988 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i18984, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i18990 = load double* %tmp.8.i33869 ; <double> [#uses=1]
- store double %tmp.9.i18990, double* %tmp.7.i18988
- %tmp.0.i18991 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i18984, %"struct.std::dcomplex"* %ret3 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i18993 = getelementptr %"struct.std::dcomplex"* %tmp.0.i18991, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i18994 = load double* %tmp.14.i18993 ; <double> [#uses=1]
- %tmp.17.i18996 = getelementptr %"struct.std::dcomplex"* %tmp.0.i18991, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i18997 = load double* %tmp.17.i18996 ; <double> [#uses=1]
- %tmp.7.i18951 = load double* %tmp.2.i34366 ; <double> [#uses=1]
- %tmp.15.i18965 = add double %tmp.7.i18951, %tmp.15.i18994 ; <double> [#uses=1]
- store double %tmp.15.i18965, double* %tmp.2.i34366
- %tmp.26.i18972 = load double* %tmp.6.i34367 ; <double> [#uses=1]
- %tmp.31.i18983 = add double %tmp.26.i18972, %tmp.18.i18997 ; <double> [#uses=1]
- store double %tmp.31.i18983, double* %tmp.6.i34367
- %tmp.4.i18931 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i18930, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i18933 = load double* %tmp.5.i33146 ; <double> [#uses=1]
- store double %tmp.6.i18933, double* %tmp.4.i18931
- %tmp.7.i18934 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i18930, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i18936 = load double* %tmp.8.i33149 ; <double> [#uses=1]
- store double %tmp.9.i18936, double* %tmp.7.i18934
- %tmp.0.i18937 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i18930, %"struct.std::dcomplex"* %tmp.12 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i18939 = getelementptr %"struct.std::dcomplex"* %tmp.0.i18937, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i18940 = load double* %tmp.14.i18939 ; <double> [#uses=1]
- %tmp.17.i18942 = getelementptr %"struct.std::dcomplex"* %tmp.0.i18937, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i18943 = load double* %tmp.17.i18942 ; <double> [#uses=1]
- %tmp.4.i18917 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i18916, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i18919 = load double* %tmp.5.i34352 ; <double> [#uses=1]
- store double %tmp.6.i18919, double* %tmp.4.i18917
- %tmp.7.i18920 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i18916, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i18922 = load double* %tmp.8.i34355 ; <double> [#uses=1]
- store double %tmp.9.i18922, double* %tmp.7.i18920
- %tmp.0.i18923 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i18916, %"struct.std::dcomplex"* %tmp.226 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i18924 = getelementptr %"struct.std::dcomplex"* %mem_tmp.830, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i18925 = getelementptr %"struct.std::dcomplex"* %tmp.0.i18923, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i18926 = load double* %tmp.14.i18925 ; <double> [#uses=1]
- store double %tmp.15.i18926, double* %tmp.13.i18924
- %tmp.16.i18927 = getelementptr %"struct.std::dcomplex"* %mem_tmp.830, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i18928 = getelementptr %"struct.std::dcomplex"* %tmp.0.i18923, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i18929 = load double* %tmp.17.i18928 ; <double> [#uses=1]
- store double %tmp.18.i18929, double* %tmp.16.i18927
- %tmp.4.i18903 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i18902, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i18940, double* %tmp.4.i18903
- %tmp.7.i18906 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i18902, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i18943, double* %tmp.7.i18906
- %tmp.0.i18909 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i18902, %"struct.std::dcomplex"* %mem_tmp.830 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i18911 = getelementptr %"struct.std::dcomplex"* %tmp.0.i18909, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i18912 = load double* %tmp.14.i18911 ; <double> [#uses=1]
- %tmp.17.i18914 = getelementptr %"struct.std::dcomplex"* %tmp.0.i18909, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i18915 = load double* %tmp.17.i18914 ; <double> [#uses=1]
- %tmp.4.i18889 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i18888, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i18912, double* %tmp.4.i18889
- %tmp.7.i18892 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i18888, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i18915, double* %tmp.7.i18892
- %tmp.0.i18895 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i18888, %"struct.std::dcomplex"* %tmp.95 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i18897 = getelementptr %"struct.std::dcomplex"* %tmp.0.i18895, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i18898 = load double* %tmp.14.i18897 ; <double> [#uses=1]
- %tmp.17.i18900 = getelementptr %"struct.std::dcomplex"* %tmp.0.i18895, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i18901 = load double* %tmp.17.i18900 ; <double> [#uses=1]
- %tmp.4.i18875 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i18874, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i18877 = load double* %tmp.5.i34352 ; <double> [#uses=1]
- store double %tmp.6.i18877, double* %tmp.4.i18875
- %tmp.7.i18878 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i18874, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i18880 = load double* %tmp.8.i34355 ; <double> [#uses=1]
- store double %tmp.9.i18880, double* %tmp.7.i18878
- %tmp.0.i18881 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i18874, %"struct.std::dcomplex"* %tmp.62 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i18883 = getelementptr %"struct.std::dcomplex"* %tmp.0.i18881, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i18884 = load double* %tmp.14.i18883 ; <double> [#uses=1]
- %tmp.17.i18886 = getelementptr %"struct.std::dcomplex"* %tmp.0.i18881, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i18887 = load double* %tmp.17.i18886 ; <double> [#uses=1]
- %tmp.4.i18861 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i18860, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i18863 = load double* %tmp.5.i34082 ; <double> [#uses=1]
- store double %tmp.6.i18863, double* %tmp.4.i18861
- %tmp.7.i18864 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i18860, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i18866 = load double* %tmp.8.i34085 ; <double> [#uses=1]
- store double %tmp.9.i18866, double* %tmp.7.i18864
- %tmp.0.i18867 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i18860, %"struct.std::dcomplex"* %tmp.12 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i18868 = getelementptr %"struct.std::dcomplex"* %mem_tmp.834, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i18869 = getelementptr %"struct.std::dcomplex"* %tmp.0.i18867, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i18870 = load double* %tmp.14.i18869 ; <double> [#uses=1]
- store double %tmp.15.i18870, double* %tmp.13.i18868
- %tmp.16.i18871 = getelementptr %"struct.std::dcomplex"* %mem_tmp.834, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i18872 = getelementptr %"struct.std::dcomplex"* %tmp.0.i18867, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i18873 = load double* %tmp.17.i18872 ; <double> [#uses=1]
- store double %tmp.18.i18873, double* %tmp.16.i18871
- %tmp.4.i18847 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i18846, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i18884, double* %tmp.4.i18847
- %tmp.7.i18850 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i18846, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i18887, double* %tmp.7.i18850
- %tmp.0.i18853 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i18846, %"struct.std::dcomplex"* %mem_tmp.834 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i18855 = getelementptr %"struct.std::dcomplex"* %tmp.0.i18853, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i18856 = load double* %tmp.14.i18855 ; <double> [#uses=1]
- %tmp.17.i18858 = getelementptr %"struct.std::dcomplex"* %tmp.0.i18853, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i18859 = load double* %tmp.17.i18858 ; <double> [#uses=1]
- %tmp.4.i18833 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i18832, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i18856, double* %tmp.4.i18833
- %tmp.7.i18836 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i18832, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i18859, double* %tmp.7.i18836
- %tmp.0.i18839 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i18832, %"struct.std::dcomplex"* %tmp.220 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i18840 = getelementptr %"struct.std::dcomplex"* %mem_tmp.831, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i18841 = getelementptr %"struct.std::dcomplex"* %tmp.0.i18839, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i18842 = load double* %tmp.14.i18841 ; <double> [#uses=1]
- store double %tmp.15.i18842, double* %tmp.13.i18840
- %tmp.16.i18843 = getelementptr %"struct.std::dcomplex"* %mem_tmp.831, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i18844 = getelementptr %"struct.std::dcomplex"* %tmp.0.i18839, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i18845 = load double* %tmp.17.i18844 ; <double> [#uses=1]
- store double %tmp.18.i18845, double* %tmp.16.i18843
- %tmp.4.i18819 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i18818, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i18898, double* %tmp.4.i18819
- %tmp.7.i18822 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i18818, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i18901, double* %tmp.7.i18822
- %tmp.0.i18825 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i18818, %"struct.std::dcomplex"* %mem_tmp.831 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i18827 = getelementptr %"struct.std::dcomplex"* %tmp.0.i18825, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i18828 = load double* %tmp.14.i18827 ; <double> [#uses=1]
- %tmp.17.i18830 = getelementptr %"struct.std::dcomplex"* %tmp.0.i18825, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i18831 = load double* %tmp.17.i18830 ; <double> [#uses=1]
- %tmp.4.i18805 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i18804, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i18807 = load double* %tmp.5.i34082 ; <double> [#uses=1]
- store double %tmp.6.i18807, double* %tmp.4.i18805
- %tmp.7.i18808 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i18804, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i18810 = load double* %tmp.8.i34085 ; <double> [#uses=1]
- store double %tmp.9.i18810, double* %tmp.7.i18808
- %tmp.0.i18811 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i18804, %"struct.std::dcomplex"* %tmp.226 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i18813 = getelementptr %"struct.std::dcomplex"* %tmp.0.i18811, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i18814 = load double* %tmp.14.i18813 ; <double> [#uses=1]
- %tmp.17.i18816 = getelementptr %"struct.std::dcomplex"* %tmp.0.i18811, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i18817 = load double* %tmp.17.i18816 ; <double> [#uses=1]
- %tmp.4.i18791 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i18790, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i18793 = load double* %tmp.5.i33146 ; <double> [#uses=1]
- store double %tmp.6.i18793, double* %tmp.4.i18791
- %tmp.7.i18794 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i18790, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i18796 = load double* %tmp.8.i33149 ; <double> [#uses=1]
- store double %tmp.9.i18796, double* %tmp.7.i18794
- %tmp.0.i18797 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i18790, %"struct.std::dcomplex"* %tmp.62 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i18798 = getelementptr %"struct.std::dcomplex"* %mem_tmp.838, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i18799 = getelementptr %"struct.std::dcomplex"* %tmp.0.i18797, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i18800 = load double* %tmp.14.i18799 ; <double> [#uses=1]
- store double %tmp.15.i18800, double* %tmp.13.i18798
- %tmp.16.i18801 = getelementptr %"struct.std::dcomplex"* %mem_tmp.838, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i18802 = getelementptr %"struct.std::dcomplex"* %tmp.0.i18797, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i18803 = load double* %tmp.17.i18802 ; <double> [#uses=1]
- store double %tmp.18.i18803, double* %tmp.16.i18801
- %tmp.4.i18777 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i18776, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i18814, double* %tmp.4.i18777
- %tmp.7.i18780 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i18776, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i18817, double* %tmp.7.i18780
- %tmp.0.i18783 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i18776, %"struct.std::dcomplex"* %mem_tmp.838 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i18785 = getelementptr %"struct.std::dcomplex"* %tmp.0.i18783, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i18786 = load double* %tmp.14.i18785 ; <double> [#uses=1]
- %tmp.17.i18788 = getelementptr %"struct.std::dcomplex"* %tmp.0.i18783, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i18789 = load double* %tmp.17.i18788 ; <double> [#uses=1]
- %tmp.4.i18763 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i18762, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i18786, double* %tmp.4.i18763
- %tmp.7.i18766 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i18762, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i18789, double* %tmp.7.i18766
- %tmp.0.i18769 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i18762, %"struct.std::dcomplex"* %tmp.30 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i18770 = getelementptr %"struct.std::dcomplex"* %mem_tmp.835, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i18771 = getelementptr %"struct.std::dcomplex"* %tmp.0.i18769, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i18772 = load double* %tmp.14.i18771 ; <double> [#uses=1]
- store double %tmp.15.i18772, double* %tmp.13.i18770
- %tmp.16.i18773 = getelementptr %"struct.std::dcomplex"* %mem_tmp.835, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i18774 = getelementptr %"struct.std::dcomplex"* %tmp.0.i18769, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i18775 = load double* %tmp.17.i18774 ; <double> [#uses=1]
- store double %tmp.18.i18775, double* %tmp.16.i18773
- %tmp.4.i18749 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i18748, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i18828, double* %tmp.4.i18749
- %tmp.7.i18752 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i18748, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i18831, double* %tmp.7.i18752
- %tmp.0.i18755 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i18748, %"struct.std::dcomplex"* %mem_tmp.835 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i18757 = getelementptr %"struct.std::dcomplex"* %tmp.0.i18755, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i18758 = load double* %tmp.14.i18757 ; <double> [#uses=1]
- %tmp.17.i18760 = getelementptr %"struct.std::dcomplex"* %tmp.0.i18755, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i18761 = load double* %tmp.17.i18760 ; <double> [#uses=1]
- store double %tmp.15.i18758, double* %tmp.2.i34364
- store double %tmp.18.i18761, double* %tmp.6.i34365
- %tmp.4.i18715 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i18714, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i18717 = load double* %tmp.5.i33326 ; <double> [#uses=1]
- store double %tmp.6.i18717, double* %tmp.4.i18715
- %tmp.7.i18718 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i18714, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i18720 = load double* %tmp.8.i33329 ; <double> [#uses=1]
- store double %tmp.9.i18720, double* %tmp.7.i18718
- %tmp.0.i18721 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i18714, %"struct.std::dcomplex"* %ret3 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i18723 = getelementptr %"struct.std::dcomplex"* %tmp.0.i18721, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i18724 = load double* %tmp.14.i18723 ; <double> [#uses=1]
- %tmp.17.i18726 = getelementptr %"struct.std::dcomplex"* %tmp.0.i18721, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i18727 = load double* %tmp.17.i18726 ; <double> [#uses=1]
- %tmp.7.i18681 = load double* %tmp.2.i34366 ; <double> [#uses=1]
- %tmp.15.i18695 = add double %tmp.7.i18681, %tmp.15.i18724 ; <double> [#uses=1]
- store double %tmp.15.i18695, double* %tmp.2.i34366
- %tmp.26.i18702 = load double* %tmp.6.i34367 ; <double> [#uses=1]
- %tmp.31.i18713 = add double %tmp.26.i18702, %tmp.18.i18727 ; <double> [#uses=1]
- store double %tmp.31.i18713, double* %tmp.6.i34367
- %tmp.4.i18661 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i18660, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i18663 = load double* %tmp.5.i33146 ; <double> [#uses=1]
- store double %tmp.6.i18663, double* %tmp.4.i18661
- %tmp.7.i18664 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i18660, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i18666 = load double* %tmp.8.i33149 ; <double> [#uses=1]
- store double %tmp.9.i18666, double* %tmp.7.i18664
- %tmp.0.i18667 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i18660, %"struct.std::dcomplex"* %tmp.21 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i18669 = getelementptr %"struct.std::dcomplex"* %tmp.0.i18667, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i18670 = load double* %tmp.14.i18669 ; <double> [#uses=1]
- %tmp.17.i18672 = getelementptr %"struct.std::dcomplex"* %tmp.0.i18667, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i18673 = load double* %tmp.17.i18672 ; <double> [#uses=1]
- %tmp.4.i18647 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i18646, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i18649 = load double* %tmp.5.i34282 ; <double> [#uses=1]
- store double %tmp.6.i18649, double* %tmp.4.i18647
- %tmp.7.i18650 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i18646, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i18652 = load double* %tmp.8.i34285 ; <double> [#uses=1]
- store double %tmp.9.i18652, double* %tmp.7.i18650
- %tmp.0.i18653 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i18646, %"struct.std::dcomplex"* %tmp.226 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i18654 = getelementptr %"struct.std::dcomplex"* %mem_tmp.845, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i18655 = getelementptr %"struct.std::dcomplex"* %tmp.0.i18653, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i18656 = load double* %tmp.14.i18655 ; <double> [#uses=1]
- store double %tmp.15.i18656, double* %tmp.13.i18654
- %tmp.16.i18657 = getelementptr %"struct.std::dcomplex"* %mem_tmp.845, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i18658 = getelementptr %"struct.std::dcomplex"* %tmp.0.i18653, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i18659 = load double* %tmp.17.i18658 ; <double> [#uses=1]
- store double %tmp.18.i18659, double* %tmp.16.i18657
- %tmp.4.i18633 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i18632, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i18670, double* %tmp.4.i18633
- %tmp.7.i18636 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i18632, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i18673, double* %tmp.7.i18636
- %tmp.0.i18639 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i18632, %"struct.std::dcomplex"* %mem_tmp.845 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i18641 = getelementptr %"struct.std::dcomplex"* %tmp.0.i18639, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i18642 = load double* %tmp.14.i18641 ; <double> [#uses=1]
- %tmp.17.i18644 = getelementptr %"struct.std::dcomplex"* %tmp.0.i18639, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i18645 = load double* %tmp.17.i18644 ; <double> [#uses=1]
- %tmp.4.i18619 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i18618, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i18642, double* %tmp.4.i18619
- %tmp.7.i18622 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i18618, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i18645, double* %tmp.7.i18622
- %tmp.0.i18625 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i18618, %"struct.std::dcomplex"* %tmp.30 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i18627 = getelementptr %"struct.std::dcomplex"* %tmp.0.i18625, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i18628 = load double* %tmp.14.i18627 ; <double> [#uses=1]
- %tmp.17.i18630 = getelementptr %"struct.std::dcomplex"* %tmp.0.i18625, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i18631 = load double* %tmp.17.i18630 ; <double> [#uses=1]
- %tmp.4.i18605 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i18604, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i18607 = load double* %tmp.5.i34352 ; <double> [#uses=1]
- store double %tmp.6.i18607, double* %tmp.4.i18605
- %tmp.7.i18608 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i18604, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i18610 = load double* %tmp.8.i34355 ; <double> [#uses=1]
- store double %tmp.9.i18610, double* %tmp.7.i18608
- %tmp.0.i18611 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i18604, %"struct.std::dcomplex"* %tmp.226 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i18613 = getelementptr %"struct.std::dcomplex"* %tmp.0.i18611, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i18614 = load double* %tmp.14.i18613 ; <double> [#uses=1]
- %tmp.17.i18616 = getelementptr %"struct.std::dcomplex"* %tmp.0.i18611, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i18617 = load double* %tmp.17.i18616 ; <double> [#uses=1]
- %tmp.4.i18591 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i18590, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i18593 = load double* %tmp.5.i33146 ; <double> [#uses=1]
- store double %tmp.6.i18593, double* %tmp.4.i18591
- %tmp.7.i18594 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i18590, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i18596 = load double* %tmp.8.i33149 ; <double> [#uses=1]
- store double %tmp.9.i18596, double* %tmp.7.i18594
- %tmp.0.i18597 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i18590, %"struct.std::dcomplex"* %tmp.12 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i18598 = getelementptr %"struct.std::dcomplex"* %mem_tmp.849, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i18599 = getelementptr %"struct.std::dcomplex"* %tmp.0.i18597, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i18600 = load double* %tmp.14.i18599 ; <double> [#uses=1]
- store double %tmp.15.i18600, double* %tmp.13.i18598
- %tmp.16.i18601 = getelementptr %"struct.std::dcomplex"* %mem_tmp.849, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i18602 = getelementptr %"struct.std::dcomplex"* %tmp.0.i18597, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i18603 = load double* %tmp.17.i18602 ; <double> [#uses=1]
- store double %tmp.18.i18603, double* %tmp.16.i18601
- %tmp.4.i18577 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i18576, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i18614, double* %tmp.4.i18577
- %tmp.7.i18580 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i18576, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i18617, double* %tmp.7.i18580
- %tmp.0.i18583 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i18576, %"struct.std::dcomplex"* %mem_tmp.849 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i18585 = getelementptr %"struct.std::dcomplex"* %tmp.0.i18583, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i18586 = load double* %tmp.14.i18585 ; <double> [#uses=1]
- %tmp.17.i18588 = getelementptr %"struct.std::dcomplex"* %tmp.0.i18583, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i18589 = load double* %tmp.17.i18588 ; <double> [#uses=1]
- %tmp.4.i18563 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i18562, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i18586, double* %tmp.4.i18563
- %tmp.7.i18566 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i18562, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i18589, double* %tmp.7.i18566
- %tmp.0.i18569 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i18562, %"struct.std::dcomplex"* %tmp.15 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i18570 = getelementptr %"struct.std::dcomplex"* %mem_tmp.846, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i18571 = getelementptr %"struct.std::dcomplex"* %tmp.0.i18569, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i18572 = load double* %tmp.14.i18571 ; <double> [#uses=1]
- store double %tmp.15.i18572, double* %tmp.13.i18570
- %tmp.16.i18573 = getelementptr %"struct.std::dcomplex"* %mem_tmp.846, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i18574 = getelementptr %"struct.std::dcomplex"* %tmp.0.i18569, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i18575 = load double* %tmp.17.i18574 ; <double> [#uses=1]
- store double %tmp.18.i18575, double* %tmp.16.i18573
- %tmp.4.i18549 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i18548, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i18628, double* %tmp.4.i18549
- %tmp.7.i18552 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i18548, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i18631, double* %tmp.7.i18552
- %tmp.0.i18555 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i18548, %"struct.std::dcomplex"* %mem_tmp.846 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i18557 = getelementptr %"struct.std::dcomplex"* %tmp.0.i18555, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i18558 = load double* %tmp.14.i18557 ; <double> [#uses=1]
- %tmp.17.i18560 = getelementptr %"struct.std::dcomplex"* %tmp.0.i18555, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i18561 = load double* %tmp.17.i18560 ; <double> [#uses=1]
- %tmp.4.i18535 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i18534, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i18537 = load double* %tmp.5.i34282 ; <double> [#uses=1]
- store double %tmp.6.i18537, double* %tmp.4.i18535
- %tmp.7.i18538 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i18534, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i18540 = load double* %tmp.8.i34285 ; <double> [#uses=1]
- store double %tmp.9.i18540, double* %tmp.7.i18538
- %tmp.0.i18541 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i18534, %"struct.std::dcomplex"* %tmp.12 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i18543 = getelementptr %"struct.std::dcomplex"* %tmp.0.i18541, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i18544 = load double* %tmp.14.i18543 ; <double> [#uses=1]
- %tmp.17.i18546 = getelementptr %"struct.std::dcomplex"* %tmp.0.i18541, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i18547 = load double* %tmp.17.i18546 ; <double> [#uses=1]
- %tmp.4.i18521 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i18520, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i18523 = load double* %tmp.5.i34352 ; <double> [#uses=1]
- store double %tmp.6.i18523, double* %tmp.4.i18521
- %tmp.7.i18524 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i18520, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i18526 = load double* %tmp.8.i34355 ; <double> [#uses=1]
- store double %tmp.9.i18526, double* %tmp.7.i18524
- %tmp.0.i18527 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i18520, %"struct.std::dcomplex"* %tmp.21 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i18528 = getelementptr %"struct.std::dcomplex"* %mem_tmp.853, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i18529 = getelementptr %"struct.std::dcomplex"* %tmp.0.i18527, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i18530 = load double* %tmp.14.i18529 ; <double> [#uses=1]
- store double %tmp.15.i18530, double* %tmp.13.i18528
- %tmp.16.i18531 = getelementptr %"struct.std::dcomplex"* %mem_tmp.853, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i18532 = getelementptr %"struct.std::dcomplex"* %tmp.0.i18527, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i18533 = load double* %tmp.17.i18532 ; <double> [#uses=1]
- store double %tmp.18.i18533, double* %tmp.16.i18531
- %tmp.4.i18507 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i18506, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i18544, double* %tmp.4.i18507
- %tmp.7.i18510 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i18506, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i18547, double* %tmp.7.i18510
- %tmp.0.i18513 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i18506, %"struct.std::dcomplex"* %mem_tmp.853 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i18515 = getelementptr %"struct.std::dcomplex"* %tmp.0.i18513, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i18516 = load double* %tmp.14.i18515 ; <double> [#uses=1]
- %tmp.17.i18518 = getelementptr %"struct.std::dcomplex"* %tmp.0.i18513, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i18519 = load double* %tmp.17.i18518 ; <double> [#uses=1]
- %tmp.4.i18493 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i18492, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i18516, double* %tmp.4.i18493
- %tmp.7.i18496 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i18492, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i18519, double* %tmp.7.i18496
- %tmp.0.i18499 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i18492, %"struct.std::dcomplex"* %tmp.220 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i18500 = getelementptr %"struct.std::dcomplex"* %mem_tmp.850, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i18501 = getelementptr %"struct.std::dcomplex"* %tmp.0.i18499, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i18502 = load double* %tmp.14.i18501 ; <double> [#uses=1]
- store double %tmp.15.i18502, double* %tmp.13.i18500
- %tmp.16.i18503 = getelementptr %"struct.std::dcomplex"* %mem_tmp.850, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i18504 = getelementptr %"struct.std::dcomplex"* %tmp.0.i18499, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i18505 = load double* %tmp.17.i18504 ; <double> [#uses=1]
- store double %tmp.18.i18505, double* %tmp.16.i18503
- %tmp.4.i18479 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i18478, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i18558, double* %tmp.4.i18479
- %tmp.7.i18482 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i18478, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i18561, double* %tmp.7.i18482
- %tmp.0.i18485 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i18478, %"struct.std::dcomplex"* %mem_tmp.850 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i18487 = getelementptr %"struct.std::dcomplex"* %tmp.0.i18485, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i18488 = load double* %tmp.14.i18487 ; <double> [#uses=1]
- %tmp.17.i18490 = getelementptr %"struct.std::dcomplex"* %tmp.0.i18485, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i18491 = load double* %tmp.17.i18490 ; <double> [#uses=1]
- store double %tmp.15.i18488, double* %tmp.2.i34364
- store double %tmp.18.i18491, double* %tmp.6.i34365
- %tmp.4.i18445 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i18444, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i18447 = load double* %tmp.5.i34136 ; <double> [#uses=1]
- store double %tmp.6.i18447, double* %tmp.4.i18445
- %tmp.7.i18448 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i18444, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i18450 = load double* %tmp.8.i34139 ; <double> [#uses=1]
- store double %tmp.9.i18450, double* %tmp.7.i18448
- %tmp.0.i18451 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i18444, %"struct.std::dcomplex"* %ret3 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i18453 = getelementptr %"struct.std::dcomplex"* %tmp.0.i18451, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i18454 = load double* %tmp.14.i18453 ; <double> [#uses=1]
- %tmp.17.i18456 = getelementptr %"struct.std::dcomplex"* %tmp.0.i18451, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i18457 = load double* %tmp.17.i18456 ; <double> [#uses=1]
- %tmp.7.i18411 = load double* %tmp.2.i34366 ; <double> [#uses=1]
- %tmp.15.i18425 = add double %tmp.7.i18411, %tmp.15.i18454 ; <double> [#uses=1]
- store double %tmp.15.i18425, double* %tmp.2.i34366
- %tmp.26.i18432 = load double* %tmp.6.i34367 ; <double> [#uses=1]
- %tmp.31.i18443 = add double %tmp.26.i18432, %tmp.18.i18457 ; <double> [#uses=1]
- store double %tmp.31.i18443, double* %tmp.6.i34367
- %tmp.4.i18391 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i18390, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i18393 = load double* %tmp.5.i25264 ; <double> [#uses=1]
- store double %tmp.6.i18393, double* %tmp.4.i18391
- %tmp.7.i18394 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i18390, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i18396 = load double* %tmp.8.i25267 ; <double> [#uses=1]
- store double %tmp.9.i18396, double* %tmp.7.i18394
- %tmp.0.i18397 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i18390, %"struct.std::dcomplex"* %ret4 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i18399 = getelementptr %"struct.std::dcomplex"* %tmp.0.i18397, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i18400 = load double* %tmp.14.i18399 ; <double> [#uses=1]
- %tmp.17.i18402 = getelementptr %"struct.std::dcomplex"* %tmp.0.i18397, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i18403 = load double* %tmp.17.i18402 ; <double> [#uses=1]
- %tmp.7.i18357 = load double* %tmp.2.i34368 ; <double> [#uses=1]
- %tmp.15.i18371 = add double %tmp.7.i18357, %tmp.15.i18400 ; <double> [#uses=1]
- store double %tmp.15.i18371, double* %tmp.2.i34368
- %tmp.26.i18378 = load double* %tmp.6.i34369 ; <double> [#uses=1]
- %tmp.31.i18389 = add double %tmp.26.i18378, %tmp.18.i18403 ; <double> [#uses=1]
- store double %tmp.31.i18389, double* %tmp.6.i34369
- store double 0.000000e+00, double* %tmp.2.i34366
- store double 0.000000e+00, double* %tmp.6.i34367
- %tmp.4.i18335 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i18334, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i18337 = load double* %tmp.5.i28602 ; <double> [#uses=1]
- store double %tmp.6.i18337, double* %tmp.4.i18335
- %tmp.7.i18338 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i18334, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i18340 = load double* %tmp.8.i28605 ; <double> [#uses=1]
- store double %tmp.9.i18340, double* %tmp.7.i18338
- %tmp.0.i18341 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i18334, %"struct.std::dcomplex"* %tmp.21 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i18343 = getelementptr %"struct.std::dcomplex"* %tmp.0.i18341, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i18344 = load double* %tmp.14.i18343 ; <double> [#uses=1]
- %tmp.17.i18346 = getelementptr %"struct.std::dcomplex"* %tmp.0.i18341, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i18347 = load double* %tmp.17.i18346 ; <double> [#uses=1]
- %tmp.4.i18321 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i18320, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i18323 = load double* %tmp.5.i34282 ; <double> [#uses=1]
- store double %tmp.6.i18323, double* %tmp.4.i18321
- %tmp.7.i18324 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i18320, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i18326 = load double* %tmp.8.i34285 ; <double> [#uses=1]
- store double %tmp.9.i18326, double* %tmp.7.i18324
- %tmp.0.i18327 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i18320, %"struct.std::dcomplex"* %tmp.1036 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i18328 = getelementptr %"struct.std::dcomplex"* %mem_tmp.861, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i18329 = getelementptr %"struct.std::dcomplex"* %tmp.0.i18327, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i18330 = load double* %tmp.14.i18329 ; <double> [#uses=1]
- store double %tmp.15.i18330, double* %tmp.13.i18328
- %tmp.16.i18331 = getelementptr %"struct.std::dcomplex"* %mem_tmp.861, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i18332 = getelementptr %"struct.std::dcomplex"* %tmp.0.i18327, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i18333 = load double* %tmp.17.i18332 ; <double> [#uses=1]
- store double %tmp.18.i18333, double* %tmp.16.i18331
- %tmp.4.i18307 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i18306, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i18344, double* %tmp.4.i18307
- %tmp.7.i18310 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i18306, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i18347, double* %tmp.7.i18310
- %tmp.0.i18313 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i18306, %"struct.std::dcomplex"* %mem_tmp.861 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i18315 = getelementptr %"struct.std::dcomplex"* %tmp.0.i18313, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i18316 = load double* %tmp.14.i18315 ; <double> [#uses=1]
- %tmp.17.i18318 = getelementptr %"struct.std::dcomplex"* %tmp.0.i18313, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i18319 = load double* %tmp.17.i18318 ; <double> [#uses=1]
- %tmp.4.i18293 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i18292, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i18316, double* %tmp.4.i18293
- %tmp.7.i18296 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i18292, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i18319, double* %tmp.7.i18296
- %tmp.0.i18299 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i18292, %"struct.std::dcomplex"* %tmp.220 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i18301 = getelementptr %"struct.std::dcomplex"* %tmp.0.i18299, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i18302 = load double* %tmp.14.i18301 ; <double> [#uses=1]
- %tmp.17.i18304 = getelementptr %"struct.std::dcomplex"* %tmp.0.i18299, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i18305 = load double* %tmp.17.i18304 ; <double> [#uses=1]
- %tmp.4.i18279 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i18278, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i18281 = load double* %tmp.5.i34282 ; <double> [#uses=1]
- store double %tmp.6.i18281, double* %tmp.4.i18279
- %tmp.7.i18282 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i18278, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i18284 = load double* %tmp.8.i34285 ; <double> [#uses=1]
- store double %tmp.9.i18284, double* %tmp.7.i18282
- %tmp.0.i18285 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i18278, %"struct.std::dcomplex"* %tmp.226 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i18287 = getelementptr %"struct.std::dcomplex"* %tmp.0.i18285, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i18288 = load double* %tmp.14.i18287 ; <double> [#uses=1]
- %tmp.17.i18290 = getelementptr %"struct.std::dcomplex"* %tmp.0.i18285, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i18291 = load double* %tmp.17.i18290 ; <double> [#uses=1]
- %tmp.4.i18265 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i18264, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i18267 = load double* %tmp.5.i33146 ; <double> [#uses=1]
- store double %tmp.6.i18267, double* %tmp.4.i18265
- %tmp.7.i18268 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i18264, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i18270 = load double* %tmp.8.i33149 ; <double> [#uses=1]
- store double %tmp.9.i18270, double* %tmp.7.i18268
- %tmp.0.i18271 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i18264, %"struct.std::dcomplex"* %tmp.21 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i18272 = getelementptr %"struct.std::dcomplex"* %mem_tmp.865, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i18273 = getelementptr %"struct.std::dcomplex"* %tmp.0.i18271, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i18274 = load double* %tmp.14.i18273 ; <double> [#uses=1]
- store double %tmp.15.i18274, double* %tmp.13.i18272
- %tmp.16.i18275 = getelementptr %"struct.std::dcomplex"* %mem_tmp.865, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i18276 = getelementptr %"struct.std::dcomplex"* %tmp.0.i18271, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i18277 = load double* %tmp.17.i18276 ; <double> [#uses=1]
- store double %tmp.18.i18277, double* %tmp.16.i18275
- %tmp.4.i18251 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i18250, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i18288, double* %tmp.4.i18251
- %tmp.7.i18254 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i18250, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i18291, double* %tmp.7.i18254
- %tmp.0.i18257 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i18250, %"struct.std::dcomplex"* %mem_tmp.865 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i18259 = getelementptr %"struct.std::dcomplex"* %tmp.0.i18257, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i18260 = load double* %tmp.14.i18259 ; <double> [#uses=1]
- %tmp.17.i18262 = getelementptr %"struct.std::dcomplex"* %tmp.0.i18257, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i18263 = load double* %tmp.17.i18262 ; <double> [#uses=1]
- %tmp.4.i18237 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i18236, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i18260, double* %tmp.4.i18237
- %tmp.7.i18240 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i18236, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i18263, double* %tmp.7.i18240
- %tmp.0.i18243 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i18236, %"struct.std::dcomplex"* %tmp.1075 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i18244 = getelementptr %"struct.std::dcomplex"* %mem_tmp.862, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i18245 = getelementptr %"struct.std::dcomplex"* %tmp.0.i18243, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i18246 = load double* %tmp.14.i18245 ; <double> [#uses=1]
- store double %tmp.15.i18246, double* %tmp.13.i18244
- %tmp.16.i18247 = getelementptr %"struct.std::dcomplex"* %mem_tmp.862, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i18248 = getelementptr %"struct.std::dcomplex"* %tmp.0.i18243, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i18249 = load double* %tmp.17.i18248 ; <double> [#uses=1]
- store double %tmp.18.i18249, double* %tmp.16.i18247
- %tmp.4.i18223 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i18222, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i18302, double* %tmp.4.i18223
- %tmp.7.i18226 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i18222, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i18305, double* %tmp.7.i18226
- %tmp.0.i18229 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i18222, %"struct.std::dcomplex"* %mem_tmp.862 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i18231 = getelementptr %"struct.std::dcomplex"* %tmp.0.i18229, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i18232 = load double* %tmp.14.i18231 ; <double> [#uses=1]
- %tmp.17.i18234 = getelementptr %"struct.std::dcomplex"* %tmp.0.i18229, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i18235 = load double* %tmp.17.i18234 ; <double> [#uses=1]
- %tmp.4.i18209 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i18208, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i18211 = load double* %tmp.5.i33146 ; <double> [#uses=1]
- store double %tmp.6.i18211, double* %tmp.4.i18209
- %tmp.7.i18212 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i18208, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i18214 = load double* %tmp.8.i33149 ; <double> [#uses=1]
- store double %tmp.9.i18214, double* %tmp.7.i18212
- %tmp.0.i18215 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i18208, %"struct.std::dcomplex"* %tmp.1036 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i18217 = getelementptr %"struct.std::dcomplex"* %tmp.0.i18215, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i18218 = load double* %tmp.14.i18217 ; <double> [#uses=1]
- %tmp.17.i18220 = getelementptr %"struct.std::dcomplex"* %tmp.0.i18215, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i18221 = load double* %tmp.17.i18220 ; <double> [#uses=1]
- %tmp.4.i18195 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i18194, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i18197 = load double* %tmp.5.i28602 ; <double> [#uses=1]
- store double %tmp.6.i18197, double* %tmp.4.i18195
- %tmp.7.i18198 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i18194, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i18200 = load double* %tmp.8.i28605 ; <double> [#uses=1]
- store double %tmp.9.i18200, double* %tmp.7.i18198
- %tmp.0.i18201 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i18194, %"struct.std::dcomplex"* %tmp.226 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i18202 = getelementptr %"struct.std::dcomplex"* %mem_tmp.869, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i18203 = getelementptr %"struct.std::dcomplex"* %tmp.0.i18201, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i18204 = load double* %tmp.14.i18203 ; <double> [#uses=1]
- store double %tmp.15.i18204, double* %tmp.13.i18202
- %tmp.16.i18205 = getelementptr %"struct.std::dcomplex"* %mem_tmp.869, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i18206 = getelementptr %"struct.std::dcomplex"* %tmp.0.i18201, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i18207 = load double* %tmp.17.i18206 ; <double> [#uses=1]
- store double %tmp.18.i18207, double* %tmp.16.i18205
- %tmp.4.i18181 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i18180, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i18218, double* %tmp.4.i18181
- %tmp.7.i18184 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i18180, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i18221, double* %tmp.7.i18184
- %tmp.0.i18187 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i18180, %"struct.std::dcomplex"* %mem_tmp.869 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i18189 = getelementptr %"struct.std::dcomplex"* %tmp.0.i18187, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i18190 = load double* %tmp.14.i18189 ; <double> [#uses=1]
- %tmp.17.i18192 = getelementptr %"struct.std::dcomplex"* %tmp.0.i18187, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i18193 = load double* %tmp.17.i18192 ; <double> [#uses=1]
- %tmp.4.i18167 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i18166, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i18190, double* %tmp.4.i18167
- %tmp.7.i18170 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i18166, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i18193, double* %tmp.7.i18170
- %tmp.0.i18173 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i18166, %"struct.std::dcomplex"* %tmp.15 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i18174 = getelementptr %"struct.std::dcomplex"* %mem_tmp.866, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i18175 = getelementptr %"struct.std::dcomplex"* %tmp.0.i18173, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i18176 = load double* %tmp.14.i18175 ; <double> [#uses=1]
- store double %tmp.15.i18176, double* %tmp.13.i18174
- %tmp.16.i18177 = getelementptr %"struct.std::dcomplex"* %mem_tmp.866, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i18178 = getelementptr %"struct.std::dcomplex"* %tmp.0.i18173, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i18179 = load double* %tmp.17.i18178 ; <double> [#uses=1]
- store double %tmp.18.i18179, double* %tmp.16.i18177
- %tmp.4.i18153 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i18152, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i18232, double* %tmp.4.i18153
- %tmp.7.i18156 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i18152, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i18235, double* %tmp.7.i18156
- %tmp.0.i18159 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i18152, %"struct.std::dcomplex"* %mem_tmp.866 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i18161 = getelementptr %"struct.std::dcomplex"* %tmp.0.i18159, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i18162 = load double* %tmp.14.i18161 ; <double> [#uses=1]
- %tmp.17.i18164 = getelementptr %"struct.std::dcomplex"* %tmp.0.i18159, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i18165 = load double* %tmp.17.i18164 ; <double> [#uses=1]
- store double %tmp.15.i18162, double* %tmp.2.i34364
- store double %tmp.18.i18165, double* %tmp.6.i34365
- %tmp.4.i18119 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i18118, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i18121 = load double* %tmp.5.i34136 ; <double> [#uses=1]
- store double %tmp.6.i18121, double* %tmp.4.i18119
- %tmp.7.i18122 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i18118, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i18124 = load double* %tmp.8.i34139 ; <double> [#uses=1]
- store double %tmp.9.i18124, double* %tmp.7.i18122
- %tmp.0.i18125 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i18118, %"struct.std::dcomplex"* %ret3 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i18127 = getelementptr %"struct.std::dcomplex"* %tmp.0.i18125, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i18128 = load double* %tmp.14.i18127 ; <double> [#uses=1]
- %tmp.17.i18130 = getelementptr %"struct.std::dcomplex"* %tmp.0.i18125, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i18131 = load double* %tmp.17.i18130 ; <double> [#uses=1]
- %tmp.7.i18085 = load double* %tmp.2.i34366 ; <double> [#uses=1]
- %tmp.15.i18099 = add double %tmp.7.i18085, %tmp.15.i18128 ; <double> [#uses=1]
- store double %tmp.15.i18099, double* %tmp.2.i34366
- %tmp.26.i18106 = load double* %tmp.6.i34367 ; <double> [#uses=1]
- %tmp.31.i18117 = add double %tmp.26.i18106, %tmp.18.i18131 ; <double> [#uses=1]
- store double %tmp.31.i18117, double* %tmp.6.i34367
- %tmp.4.i18065 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i18064, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i18067 = load double* %tmp.5.i28602 ; <double> [#uses=1]
- store double %tmp.6.i18067, double* %tmp.4.i18065
- %tmp.7.i18068 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i18064, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i18070 = load double* %tmp.8.i28605 ; <double> [#uses=1]
- store double %tmp.9.i18070, double* %tmp.7.i18068
- %tmp.0.i18071 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i18064, %"struct.std::dcomplex"* %tmp.62 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i18073 = getelementptr %"struct.std::dcomplex"* %tmp.0.i18071, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i18074 = load double* %tmp.14.i18073 ; <double> [#uses=1]
- %tmp.17.i18076 = getelementptr %"struct.std::dcomplex"* %tmp.0.i18071, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i18077 = load double* %tmp.17.i18076 ; <double> [#uses=1]
- %tmp.4.i18051 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i18050, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i18053 = load double* %tmp.5.i34082 ; <double> [#uses=1]
- store double %tmp.6.i18053, double* %tmp.4.i18051
- %tmp.7.i18054 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i18050, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i18056 = load double* %tmp.8.i34085 ; <double> [#uses=1]
- store double %tmp.9.i18056, double* %tmp.7.i18054
- %tmp.0.i18057 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i18050, %"struct.std::dcomplex"* %tmp.1036 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i18058 = getelementptr %"struct.std::dcomplex"* %mem_tmp.876, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i18059 = getelementptr %"struct.std::dcomplex"* %tmp.0.i18057, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i18060 = load double* %tmp.14.i18059 ; <double> [#uses=1]
- store double %tmp.15.i18060, double* %tmp.13.i18058
- %tmp.16.i18061 = getelementptr %"struct.std::dcomplex"* %mem_tmp.876, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i18062 = getelementptr %"struct.std::dcomplex"* %tmp.0.i18057, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i18063 = load double* %tmp.17.i18062 ; <double> [#uses=1]
- store double %tmp.18.i18063, double* %tmp.16.i18061
- %tmp.4.i18037 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i18036, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i18074, double* %tmp.4.i18037
- %tmp.7.i18040 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i18036, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i18077, double* %tmp.7.i18040
- %tmp.0.i18043 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i18036, %"struct.std::dcomplex"* %mem_tmp.876 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i18045 = getelementptr %"struct.std::dcomplex"* %tmp.0.i18043, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i18046 = load double* %tmp.14.i18045 ; <double> [#uses=1]
- %tmp.17.i18048 = getelementptr %"struct.std::dcomplex"* %tmp.0.i18043, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i18049 = load double* %tmp.17.i18048 ; <double> [#uses=1]
- %tmp.4.i18023 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i18022, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i18046, double* %tmp.4.i18023
- %tmp.7.i18026 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i18022, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i18049, double* %tmp.7.i18026
- %tmp.0.i18029 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i18022, %"struct.std::dcomplex"* %tmp.15 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i18031 = getelementptr %"struct.std::dcomplex"* %tmp.0.i18029, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i18032 = load double* %tmp.14.i18031 ; <double> [#uses=1]
- %tmp.17.i18034 = getelementptr %"struct.std::dcomplex"* %tmp.0.i18029, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i18035 = load double* %tmp.17.i18034 ; <double> [#uses=1]
- %tmp.4.i18009 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i18008, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i18011 = load double* %tmp.5.i34282 ; <double> [#uses=1]
- store double %tmp.6.i18011, double* %tmp.4.i18009
- %tmp.7.i18012 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i18008, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i18014 = load double* %tmp.8.i34285 ; <double> [#uses=1]
- store double %tmp.9.i18014, double* %tmp.7.i18012
- %tmp.0.i18015 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i18008, %"struct.std::dcomplex"* %tmp.1036 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i18017 = getelementptr %"struct.std::dcomplex"* %tmp.0.i18015, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i18018 = load double* %tmp.14.i18017 ; <double> [#uses=1]
- %tmp.17.i18020 = getelementptr %"struct.std::dcomplex"* %tmp.0.i18015, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i18021 = load double* %tmp.17.i18020 ; <double> [#uses=1]
- %tmp.4.i17995 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i17994, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i17997 = load double* %tmp.5.i28602 ; <double> [#uses=1]
- store double %tmp.6.i17997, double* %tmp.4.i17995
- %tmp.7.i17998 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i17994, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i18000 = load double* %tmp.8.i28605 ; <double> [#uses=1]
- store double %tmp.9.i18000, double* %tmp.7.i17998
- %tmp.0.i18001 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i17994, %"struct.std::dcomplex"* %tmp.21 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i18002 = getelementptr %"struct.std::dcomplex"* %mem_tmp.880, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i18003 = getelementptr %"struct.std::dcomplex"* %tmp.0.i18001, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i18004 = load double* %tmp.14.i18003 ; <double> [#uses=1]
- store double %tmp.15.i18004, double* %tmp.13.i18002
- %tmp.16.i18005 = getelementptr %"struct.std::dcomplex"* %mem_tmp.880, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i18006 = getelementptr %"struct.std::dcomplex"* %tmp.0.i18001, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i18007 = load double* %tmp.17.i18006 ; <double> [#uses=1]
- store double %tmp.18.i18007, double* %tmp.16.i18005
- %tmp.4.i17981 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i17980, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i18018, double* %tmp.4.i17981
- %tmp.7.i17984 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i17980, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i18021, double* %tmp.7.i17984
- %tmp.0.i17987 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i17980, %"struct.std::dcomplex"* %mem_tmp.880 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i17989 = getelementptr %"struct.std::dcomplex"* %tmp.0.i17987, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i17990 = load double* %tmp.14.i17989 ; <double> [#uses=1]
- %tmp.17.i17992 = getelementptr %"struct.std::dcomplex"* %tmp.0.i17987, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i17993 = load double* %tmp.17.i17992 ; <double> [#uses=1]
- %tmp.4.i17967 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i17966, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i17990, double* %tmp.4.i17967
- %tmp.7.i17970 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i17966, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i17993, double* %tmp.7.i17970
- %tmp.0.i17973 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i17966, %"struct.std::dcomplex"* %tmp.95 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i17974 = getelementptr %"struct.std::dcomplex"* %mem_tmp.877, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i17975 = getelementptr %"struct.std::dcomplex"* %tmp.0.i17973, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i17976 = load double* %tmp.14.i17975 ; <double> [#uses=1]
- store double %tmp.15.i17976, double* %tmp.13.i17974
- %tmp.16.i17977 = getelementptr %"struct.std::dcomplex"* %mem_tmp.877, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i17978 = getelementptr %"struct.std::dcomplex"* %tmp.0.i17973, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i17979 = load double* %tmp.17.i17978 ; <double> [#uses=1]
- store double %tmp.18.i17979, double* %tmp.16.i17977
- %tmp.4.i17953 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i17952, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i18032, double* %tmp.4.i17953
- %tmp.7.i17956 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i17952, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i18035, double* %tmp.7.i17956
- %tmp.0.i17959 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i17952, %"struct.std::dcomplex"* %mem_tmp.877 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i17961 = getelementptr %"struct.std::dcomplex"* %tmp.0.i17959, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i17962 = load double* %tmp.14.i17961 ; <double> [#uses=1]
- %tmp.17.i17964 = getelementptr %"struct.std::dcomplex"* %tmp.0.i17959, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i17965 = load double* %tmp.17.i17964 ; <double> [#uses=1]
- %tmp.4.i17939 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i17938, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i17941 = load double* %tmp.5.i34082 ; <double> [#uses=1]
- store double %tmp.6.i17941, double* %tmp.4.i17939
- %tmp.7.i17942 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i17938, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i17944 = load double* %tmp.8.i34085 ; <double> [#uses=1]
- store double %tmp.9.i17944, double* %tmp.7.i17942
- %tmp.0.i17945 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i17938, %"struct.std::dcomplex"* %tmp.21 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i17947 = getelementptr %"struct.std::dcomplex"* %tmp.0.i17945, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i17948 = load double* %tmp.14.i17947 ; <double> [#uses=1]
- %tmp.17.i17950 = getelementptr %"struct.std::dcomplex"* %tmp.0.i17945, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i17951 = load double* %tmp.17.i17950 ; <double> [#uses=1]
- %tmp.4.i17925 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i17924, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i17927 = load double* %tmp.5.i34282 ; <double> [#uses=1]
- store double %tmp.6.i17927, double* %tmp.4.i17925
- %tmp.7.i17928 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i17924, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i17930 = load double* %tmp.8.i34285 ; <double> [#uses=1]
- store double %tmp.9.i17930, double* %tmp.7.i17928
- %tmp.0.i17931 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i17924, %"struct.std::dcomplex"* %tmp.62 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i17932 = getelementptr %"struct.std::dcomplex"* %mem_tmp.884, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i17933 = getelementptr %"struct.std::dcomplex"* %tmp.0.i17931, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i17934 = load double* %tmp.14.i17933 ; <double> [#uses=1]
- store double %tmp.15.i17934, double* %tmp.13.i17932
- %tmp.16.i17935 = getelementptr %"struct.std::dcomplex"* %mem_tmp.884, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i17936 = getelementptr %"struct.std::dcomplex"* %tmp.0.i17931, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i17937 = load double* %tmp.17.i17936 ; <double> [#uses=1]
- store double %tmp.18.i17937, double* %tmp.16.i17935
- %tmp.4.i17911 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i17910, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i17948, double* %tmp.4.i17911
- %tmp.7.i17914 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i17910, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i17951, double* %tmp.7.i17914
- %tmp.0.i17917 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i17910, %"struct.std::dcomplex"* %mem_tmp.884 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i17919 = getelementptr %"struct.std::dcomplex"* %tmp.0.i17917, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i17920 = load double* %tmp.14.i17919 ; <double> [#uses=1]
- %tmp.17.i17922 = getelementptr %"struct.std::dcomplex"* %tmp.0.i17917, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i17923 = load double* %tmp.17.i17922 ; <double> [#uses=1]
- %tmp.4.i17897 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i17896, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i17920, double* %tmp.4.i17897
- %tmp.7.i17900 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i17896, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i17923, double* %tmp.7.i17900
- %tmp.0.i17903 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i17896, %"struct.std::dcomplex"* %tmp.1075 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i17904 = getelementptr %"struct.std::dcomplex"* %mem_tmp.881, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i17905 = getelementptr %"struct.std::dcomplex"* %tmp.0.i17903, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i17906 = load double* %tmp.14.i17905 ; <double> [#uses=1]
- store double %tmp.15.i17906, double* %tmp.13.i17904
- %tmp.16.i17907 = getelementptr %"struct.std::dcomplex"* %mem_tmp.881, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i17908 = getelementptr %"struct.std::dcomplex"* %tmp.0.i17903, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i17909 = load double* %tmp.17.i17908 ; <double> [#uses=1]
- store double %tmp.18.i17909, double* %tmp.16.i17907
- %tmp.4.i17883 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i17882, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i17962, double* %tmp.4.i17883
- %tmp.7.i17886 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i17882, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i17965, double* %tmp.7.i17886
- %tmp.0.i17889 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i17882, %"struct.std::dcomplex"* %mem_tmp.881 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i17891 = getelementptr %"struct.std::dcomplex"* %tmp.0.i17889, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i17892 = load double* %tmp.14.i17891 ; <double> [#uses=1]
- %tmp.17.i17894 = getelementptr %"struct.std::dcomplex"* %tmp.0.i17889, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i17895 = load double* %tmp.17.i17894 ; <double> [#uses=1]
- store double %tmp.15.i17892, double* %tmp.2.i34364
- store double %tmp.18.i17895, double* %tmp.6.i34365
- %tmp.4.i17849 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i17848, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i17851 = load double* %tmp.5.i32460 ; <double> [#uses=1]
- store double %tmp.6.i17851, double* %tmp.4.i17849
- %tmp.7.i17852 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i17848, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i17854 = load double* %tmp.8.i32463 ; <double> [#uses=1]
- store double %tmp.9.i17854, double* %tmp.7.i17852
- %tmp.0.i17855 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i17848, %"struct.std::dcomplex"* %ret3 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i17857 = getelementptr %"struct.std::dcomplex"* %tmp.0.i17855, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i17858 = load double* %tmp.14.i17857 ; <double> [#uses=1]
- %tmp.17.i17860 = getelementptr %"struct.std::dcomplex"* %tmp.0.i17855, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i17861 = load double* %tmp.17.i17860 ; <double> [#uses=1]
- %tmp.7.i17815 = load double* %tmp.2.i34366 ; <double> [#uses=1]
- %tmp.15.i17829 = add double %tmp.7.i17815, %tmp.15.i17858 ; <double> [#uses=1]
- store double %tmp.15.i17829, double* %tmp.2.i34366
- %tmp.26.i17836 = load double* %tmp.6.i34367 ; <double> [#uses=1]
- %tmp.31.i17847 = add double %tmp.26.i17836, %tmp.18.i17861 ; <double> [#uses=1]
- store double %tmp.31.i17847, double* %tmp.6.i34367
- %tmp.4.i17795 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i17794, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i17797 = load double* %tmp.5.i34282 ; <double> [#uses=1]
- store double %tmp.6.i17797, double* %tmp.4.i17795
- %tmp.7.i17798 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i17794, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i17800 = load double* %tmp.8.i34285 ; <double> [#uses=1]
- store double %tmp.9.i17800, double* %tmp.7.i17798
- %tmp.0.i17801 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i17794, %"struct.std::dcomplex"* %tmp.62 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i17803 = getelementptr %"struct.std::dcomplex"* %tmp.0.i17801, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i17804 = load double* %tmp.14.i17803 ; <double> [#uses=1]
- %tmp.17.i17806 = getelementptr %"struct.std::dcomplex"* %tmp.0.i17801, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i17807 = load double* %tmp.17.i17806 ; <double> [#uses=1]
- %tmp.4.i17781 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i17780, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i17783 = load double* %tmp.5.i34082 ; <double> [#uses=1]
- store double %tmp.6.i17783, double* %tmp.4.i17781
- %tmp.7.i17784 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i17780, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i17786 = load double* %tmp.8.i34085 ; <double> [#uses=1]
- store double %tmp.9.i17786, double* %tmp.7.i17784
- %tmp.0.i17787 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i17780, %"struct.std::dcomplex"* %tmp.21 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i17788 = getelementptr %"struct.std::dcomplex"* %mem_tmp.891, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i17789 = getelementptr %"struct.std::dcomplex"* %tmp.0.i17787, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i17790 = load double* %tmp.14.i17789 ; <double> [#uses=1]
- store double %tmp.15.i17790, double* %tmp.13.i17788
- %tmp.16.i17791 = getelementptr %"struct.std::dcomplex"* %mem_tmp.891, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i17792 = getelementptr %"struct.std::dcomplex"* %tmp.0.i17787, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i17793 = load double* %tmp.17.i17792 ; <double> [#uses=1]
- store double %tmp.18.i17793, double* %tmp.16.i17791
- %tmp.4.i17767 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i17766, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i17804, double* %tmp.4.i17767
- %tmp.7.i17770 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i17766, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i17807, double* %tmp.7.i17770
- %tmp.0.i17773 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i17766, %"struct.std::dcomplex"* %mem_tmp.891 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i17775 = getelementptr %"struct.std::dcomplex"* %tmp.0.i17773, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i17776 = load double* %tmp.14.i17775 ; <double> [#uses=1]
- %tmp.17.i17778 = getelementptr %"struct.std::dcomplex"* %tmp.0.i17773, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i17779 = load double* %tmp.17.i17778 ; <double> [#uses=1]
- %tmp.4.i17753 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i17752, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i17776, double* %tmp.4.i17753
- %tmp.7.i17756 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i17752, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i17779, double* %tmp.7.i17756
- %tmp.0.i17759 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i17752, %"struct.std::dcomplex"* %tmp.220 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i17761 = getelementptr %"struct.std::dcomplex"* %tmp.0.i17759, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i17762 = load double* %tmp.14.i17761 ; <double> [#uses=1]
- %tmp.17.i17764 = getelementptr %"struct.std::dcomplex"* %tmp.0.i17759, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i17765 = load double* %tmp.17.i17764 ; <double> [#uses=1]
- %tmp.4.i17739 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i17738, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i17741 = load double* %tmp.5.i34082 ; <double> [#uses=1]
- store double %tmp.6.i17741, double* %tmp.4.i17739
- %tmp.7.i17742 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i17738, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i17744 = load double* %tmp.8.i34085 ; <double> [#uses=1]
- store double %tmp.9.i17744, double* %tmp.7.i17742
- %tmp.0.i17745 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i17738, %"struct.std::dcomplex"* %tmp.226 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i17747 = getelementptr %"struct.std::dcomplex"* %tmp.0.i17745, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i17748 = load double* %tmp.14.i17747 ; <double> [#uses=1]
- %tmp.17.i17750 = getelementptr %"struct.std::dcomplex"* %tmp.0.i17745, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i17751 = load double* %tmp.17.i17750 ; <double> [#uses=1]
- %tmp.4.i17725 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i17724, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i17727 = load double* %tmp.5.i33146 ; <double> [#uses=1]
- store double %tmp.6.i17727, double* %tmp.4.i17725
- %tmp.7.i17728 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i17724, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i17730 = load double* %tmp.8.i33149 ; <double> [#uses=1]
- store double %tmp.9.i17730, double* %tmp.7.i17728
- %tmp.0.i17731 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i17724, %"struct.std::dcomplex"* %tmp.62 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i17732 = getelementptr %"struct.std::dcomplex"* %mem_tmp.895, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i17733 = getelementptr %"struct.std::dcomplex"* %tmp.0.i17731, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i17734 = load double* %tmp.14.i17733 ; <double> [#uses=1]
- store double %tmp.15.i17734, double* %tmp.13.i17732
- %tmp.16.i17735 = getelementptr %"struct.std::dcomplex"* %mem_tmp.895, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i17736 = getelementptr %"struct.std::dcomplex"* %tmp.0.i17731, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i17737 = load double* %tmp.17.i17736 ; <double> [#uses=1]
- store double %tmp.18.i17737, double* %tmp.16.i17735
- %tmp.4.i17711 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i17710, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i17748, double* %tmp.4.i17711
- %tmp.7.i17714 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i17710, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i17751, double* %tmp.7.i17714
- %tmp.0.i17717 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i17710, %"struct.std::dcomplex"* %mem_tmp.895 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i17719 = getelementptr %"struct.std::dcomplex"* %tmp.0.i17717, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i17720 = load double* %tmp.14.i17719 ; <double> [#uses=1]
- %tmp.17.i17722 = getelementptr %"struct.std::dcomplex"* %tmp.0.i17717, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i17723 = load double* %tmp.17.i17722 ; <double> [#uses=1]
- %tmp.4.i17697 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i17696, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i17720, double* %tmp.4.i17697
- %tmp.7.i17700 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i17696, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i17723, double* %tmp.7.i17700
- %tmp.0.i17703 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i17696, %"struct.std::dcomplex"* %tmp.15 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i17704 = getelementptr %"struct.std::dcomplex"* %mem_tmp.892, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i17705 = getelementptr %"struct.std::dcomplex"* %tmp.0.i17703, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i17706 = load double* %tmp.14.i17705 ; <double> [#uses=1]
- store double %tmp.15.i17706, double* %tmp.13.i17704
- %tmp.16.i17707 = getelementptr %"struct.std::dcomplex"* %mem_tmp.892, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i17708 = getelementptr %"struct.std::dcomplex"* %tmp.0.i17703, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i17709 = load double* %tmp.17.i17708 ; <double> [#uses=1]
- store double %tmp.18.i17709, double* %tmp.16.i17707
- %tmp.4.i17683 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i17682, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i17762, double* %tmp.4.i17683
- %tmp.7.i17686 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i17682, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i17765, double* %tmp.7.i17686
- %tmp.0.i17689 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i17682, %"struct.std::dcomplex"* %mem_tmp.892 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i17691 = getelementptr %"struct.std::dcomplex"* %tmp.0.i17689, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i17692 = load double* %tmp.14.i17691 ; <double> [#uses=1]
- %tmp.17.i17694 = getelementptr %"struct.std::dcomplex"* %tmp.0.i17689, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i17695 = load double* %tmp.17.i17694 ; <double> [#uses=1]
- %tmp.4.i17669 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i17668, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i17671 = load double* %tmp.5.i33146 ; <double> [#uses=1]
- store double %tmp.6.i17671, double* %tmp.4.i17669
- %tmp.7.i17672 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i17668, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i17674 = load double* %tmp.8.i33149 ; <double> [#uses=1]
- store double %tmp.9.i17674, double* %tmp.7.i17672
- %tmp.0.i17675 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i17668, %"struct.std::dcomplex"* %tmp.21 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i17677 = getelementptr %"struct.std::dcomplex"* %tmp.0.i17675, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i17678 = load double* %tmp.14.i17677 ; <double> [#uses=1]
- %tmp.17.i17680 = getelementptr %"struct.std::dcomplex"* %tmp.0.i17675, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i17681 = load double* %tmp.17.i17680 ; <double> [#uses=1]
- %tmp.4.i17655 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i17654, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i17657 = load double* %tmp.5.i34282 ; <double> [#uses=1]
- store double %tmp.6.i17657, double* %tmp.4.i17655
- %tmp.7.i17658 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i17654, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i17660 = load double* %tmp.8.i34285 ; <double> [#uses=1]
- store double %tmp.9.i17660, double* %tmp.7.i17658
- %tmp.0.i17661 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i17654, %"struct.std::dcomplex"* %tmp.226 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i17662 = getelementptr %"struct.std::dcomplex"* %mem_tmp.899, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i17663 = getelementptr %"struct.std::dcomplex"* %tmp.0.i17661, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i17664 = load double* %tmp.14.i17663 ; <double> [#uses=1]
- store double %tmp.15.i17664, double* %tmp.13.i17662
- %tmp.16.i17665 = getelementptr %"struct.std::dcomplex"* %mem_tmp.899, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i17666 = getelementptr %"struct.std::dcomplex"* %tmp.0.i17661, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i17667 = load double* %tmp.17.i17666 ; <double> [#uses=1]
- store double %tmp.18.i17667, double* %tmp.16.i17665
- %tmp.4.i17641 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i17640, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i17678, double* %tmp.4.i17641
- %tmp.7.i17644 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i17640, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i17681, double* %tmp.7.i17644
- %tmp.0.i17647 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i17640, %"struct.std::dcomplex"* %mem_tmp.899 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i17649 = getelementptr %"struct.std::dcomplex"* %tmp.0.i17647, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i17650 = load double* %tmp.14.i17649 ; <double> [#uses=1]
- %tmp.17.i17652 = getelementptr %"struct.std::dcomplex"* %tmp.0.i17647, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i17653 = load double* %tmp.17.i17652 ; <double> [#uses=1]
- %tmp.4.i17627 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i17626, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i17650, double* %tmp.4.i17627
- %tmp.7.i17630 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i17626, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i17653, double* %tmp.7.i17630
- %tmp.0.i17633 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i17626, %"struct.std::dcomplex"* %tmp.95 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i17634 = getelementptr %"struct.std::dcomplex"* %mem_tmp.896, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i17635 = getelementptr %"struct.std::dcomplex"* %tmp.0.i17633, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i17636 = load double* %tmp.14.i17635 ; <double> [#uses=1]
- store double %tmp.15.i17636, double* %tmp.13.i17634
- %tmp.16.i17637 = getelementptr %"struct.std::dcomplex"* %mem_tmp.896, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i17638 = getelementptr %"struct.std::dcomplex"* %tmp.0.i17633, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i17639 = load double* %tmp.17.i17638 ; <double> [#uses=1]
- store double %tmp.18.i17639, double* %tmp.16.i17637
- %tmp.4.i17613 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i17612, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i17692, double* %tmp.4.i17613
- %tmp.7.i17616 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i17612, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i17695, double* %tmp.7.i17616
- %tmp.0.i17619 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i17612, %"struct.std::dcomplex"* %mem_tmp.896 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i17621 = getelementptr %"struct.std::dcomplex"* %tmp.0.i17619, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i17622 = load double* %tmp.14.i17621 ; <double> [#uses=1]
- %tmp.17.i17624 = getelementptr %"struct.std::dcomplex"* %tmp.0.i17619, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i17625 = load double* %tmp.17.i17624 ; <double> [#uses=1]
- store double %tmp.15.i17622, double* %tmp.2.i34364
- store double %tmp.18.i17625, double* %tmp.6.i34365
- %tmp.4.i17579 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i17578, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i17581 = load double* %tmp.5.i27590 ; <double> [#uses=1]
- store double %tmp.6.i17581, double* %tmp.4.i17579
- %tmp.7.i17582 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i17578, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i17584 = load double* %tmp.8.i27593 ; <double> [#uses=1]
- store double %tmp.9.i17584, double* %tmp.7.i17582
- %tmp.0.i17585 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i17578, %"struct.std::dcomplex"* %ret3 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i17587 = getelementptr %"struct.std::dcomplex"* %tmp.0.i17585, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i17588 = load double* %tmp.14.i17587 ; <double> [#uses=1]
- %tmp.17.i17590 = getelementptr %"struct.std::dcomplex"* %tmp.0.i17585, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i17591 = load double* %tmp.17.i17590 ; <double> [#uses=1]
- %tmp.7.i17545 = load double* %tmp.2.i34366 ; <double> [#uses=1]
- %tmp.15.i17559 = add double %tmp.7.i17545, %tmp.15.i17588 ; <double> [#uses=1]
- store double %tmp.15.i17559, double* %tmp.2.i34366
- %tmp.26.i17566 = load double* %tmp.6.i34367 ; <double> [#uses=1]
- %tmp.31.i17577 = add double %tmp.26.i17566, %tmp.18.i17591 ; <double> [#uses=1]
- store double %tmp.31.i17577, double* %tmp.6.i34367
- %tmp.4.i17525 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i17524, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i17527 = load double* %tmp.5.i28602 ; <double> [#uses=1]
- store double %tmp.6.i17527, double* %tmp.4.i17525
- %tmp.7.i17528 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i17524, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i17530 = load double* %tmp.8.i28605 ; <double> [#uses=1]
- store double %tmp.9.i17530, double* %tmp.7.i17528
- %tmp.0.i17531 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i17524, %"struct.std::dcomplex"* %tmp.226 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i17533 = getelementptr %"struct.std::dcomplex"* %tmp.0.i17531, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i17534 = load double* %tmp.14.i17533 ; <double> [#uses=1]
- %tmp.17.i17536 = getelementptr %"struct.std::dcomplex"* %tmp.0.i17531, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i17537 = load double* %tmp.17.i17536 ; <double> [#uses=1]
- %tmp.4.i17511 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i17510, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i17513 = load double* %tmp.5.i33146 ; <double> [#uses=1]
- store double %tmp.6.i17513, double* %tmp.4.i17511
- %tmp.7.i17514 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i17510, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i17516 = load double* %tmp.8.i33149 ; <double> [#uses=1]
- store double %tmp.9.i17516, double* %tmp.7.i17514
- %tmp.0.i17517 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i17510, %"struct.std::dcomplex"* %tmp.1036 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i17518 = getelementptr %"struct.std::dcomplex"* %mem_tmp.906, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i17519 = getelementptr %"struct.std::dcomplex"* %tmp.0.i17517, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i17520 = load double* %tmp.14.i17519 ; <double> [#uses=1]
- store double %tmp.15.i17520, double* %tmp.13.i17518
- %tmp.16.i17521 = getelementptr %"struct.std::dcomplex"* %mem_tmp.906, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i17522 = getelementptr %"struct.std::dcomplex"* %tmp.0.i17517, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i17523 = load double* %tmp.17.i17522 ; <double> [#uses=1]
- store double %tmp.18.i17523, double* %tmp.16.i17521
- %tmp.4.i17497 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i17496, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i17534, double* %tmp.4.i17497
- %tmp.7.i17500 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i17496, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i17537, double* %tmp.7.i17500
- %tmp.0.i17503 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i17496, %"struct.std::dcomplex"* %mem_tmp.906 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i17505 = getelementptr %"struct.std::dcomplex"* %tmp.0.i17503, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i17506 = load double* %tmp.14.i17505 ; <double> [#uses=1]
- %tmp.17.i17508 = getelementptr %"struct.std::dcomplex"* %tmp.0.i17503, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i17509 = load double* %tmp.17.i17508 ; <double> [#uses=1]
- %tmp.4.i17483 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i17482, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i17506, double* %tmp.4.i17483
- %tmp.7.i17486 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i17482, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i17509, double* %tmp.7.i17486
- %tmp.0.i17489 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i17482, %"struct.std::dcomplex"* %tmp.95 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i17491 = getelementptr %"struct.std::dcomplex"* %tmp.0.i17489, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i17492 = load double* %tmp.14.i17491 ; <double> [#uses=1]
- %tmp.17.i17494 = getelementptr %"struct.std::dcomplex"* %tmp.0.i17489, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i17495 = load double* %tmp.17.i17494 ; <double> [#uses=1]
- %tmp.4.i17469 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i17468, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i17471 = load double* %tmp.5.i34082 ; <double> [#uses=1]
- store double %tmp.6.i17471, double* %tmp.4.i17469
- %tmp.7.i17472 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i17468, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i17474 = load double* %tmp.8.i34085 ; <double> [#uses=1]
- store double %tmp.9.i17474, double* %tmp.7.i17472
- %tmp.0.i17475 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i17468, %"struct.std::dcomplex"* %tmp.1036 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i17477 = getelementptr %"struct.std::dcomplex"* %tmp.0.i17475, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i17478 = load double* %tmp.14.i17477 ; <double> [#uses=1]
- %tmp.17.i17480 = getelementptr %"struct.std::dcomplex"* %tmp.0.i17475, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i17481 = load double* %tmp.17.i17480 ; <double> [#uses=1]
- %tmp.4.i17455 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i17454, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i17457 = load double* %tmp.5.i28602 ; <double> [#uses=1]
- store double %tmp.6.i17457, double* %tmp.4.i17455
- %tmp.7.i17458 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i17454, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i17460 = load double* %tmp.8.i28605 ; <double> [#uses=1]
- store double %tmp.9.i17460, double* %tmp.7.i17458
- %tmp.0.i17461 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i17454, %"struct.std::dcomplex"* %tmp.62 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i17462 = getelementptr %"struct.std::dcomplex"* %mem_tmp.910, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i17463 = getelementptr %"struct.std::dcomplex"* %tmp.0.i17461, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i17464 = load double* %tmp.14.i17463 ; <double> [#uses=1]
- store double %tmp.15.i17464, double* %tmp.13.i17462
- %tmp.16.i17465 = getelementptr %"struct.std::dcomplex"* %mem_tmp.910, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i17466 = getelementptr %"struct.std::dcomplex"* %tmp.0.i17461, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i17467 = load double* %tmp.17.i17466 ; <double> [#uses=1]
- store double %tmp.18.i17467, double* %tmp.16.i17465
- %tmp.4.i17441 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i17440, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i17478, double* %tmp.4.i17441
- %tmp.7.i17444 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i17440, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i17481, double* %tmp.7.i17444
- %tmp.0.i17447 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i17440, %"struct.std::dcomplex"* %mem_tmp.910 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i17449 = getelementptr %"struct.std::dcomplex"* %tmp.0.i17447, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i17450 = load double* %tmp.14.i17449 ; <double> [#uses=1]
- %tmp.17.i17452 = getelementptr %"struct.std::dcomplex"* %tmp.0.i17447, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i17453 = load double* %tmp.17.i17452 ; <double> [#uses=1]
- %tmp.4.i17427 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i17426, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i17450, double* %tmp.4.i17427
- %tmp.7.i17430 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i17426, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i17453, double* %tmp.7.i17430
- %tmp.0.i17433 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i17426, %"struct.std::dcomplex"* %tmp.220 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i17434 = getelementptr %"struct.std::dcomplex"* %mem_tmp.907, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i17435 = getelementptr %"struct.std::dcomplex"* %tmp.0.i17433, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i17436 = load double* %tmp.14.i17435 ; <double> [#uses=1]
- store double %tmp.15.i17436, double* %tmp.13.i17434
- %tmp.16.i17437 = getelementptr %"struct.std::dcomplex"* %mem_tmp.907, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i17438 = getelementptr %"struct.std::dcomplex"* %tmp.0.i17433, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i17439 = load double* %tmp.17.i17438 ; <double> [#uses=1]
- store double %tmp.18.i17439, double* %tmp.16.i17437
- %tmp.4.i17413 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i17412, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i17492, double* %tmp.4.i17413
- %tmp.7.i17416 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i17412, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i17495, double* %tmp.7.i17416
- %tmp.0.i17419 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i17412, %"struct.std::dcomplex"* %mem_tmp.907 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i17421 = getelementptr %"struct.std::dcomplex"* %tmp.0.i17419, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i17422 = load double* %tmp.14.i17421 ; <double> [#uses=1]
- %tmp.17.i17424 = getelementptr %"struct.std::dcomplex"* %tmp.0.i17419, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i17425 = load double* %tmp.17.i17424 ; <double> [#uses=1]
- %tmp.4.i17399 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i17398, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i17401 = load double* %tmp.5.i33146 ; <double> [#uses=1]
- store double %tmp.6.i17401, double* %tmp.4.i17399
- %tmp.7.i17402 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i17398, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i17404 = load double* %tmp.8.i33149 ; <double> [#uses=1]
- store double %tmp.9.i17404, double* %tmp.7.i17402
- %tmp.0.i17405 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i17398, %"struct.std::dcomplex"* %tmp.62 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i17407 = getelementptr %"struct.std::dcomplex"* %tmp.0.i17405, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i17408 = load double* %tmp.14.i17407 ; <double> [#uses=1]
- %tmp.17.i17410 = getelementptr %"struct.std::dcomplex"* %tmp.0.i17405, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i17411 = load double* %tmp.17.i17410 ; <double> [#uses=1]
- %tmp.4.i17385 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i17384, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i17387 = load double* %tmp.5.i34082 ; <double> [#uses=1]
- store double %tmp.6.i17387, double* %tmp.4.i17385
- %tmp.7.i17388 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i17384, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i17390 = load double* %tmp.8.i34085 ; <double> [#uses=1]
- store double %tmp.9.i17390, double* %tmp.7.i17388
- %tmp.0.i17391 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i17384, %"struct.std::dcomplex"* %tmp.226 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i17392 = getelementptr %"struct.std::dcomplex"* %mem_tmp.914, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i17393 = getelementptr %"struct.std::dcomplex"* %tmp.0.i17391, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i17394 = load double* %tmp.14.i17393 ; <double> [#uses=1]
- store double %tmp.15.i17394, double* %tmp.13.i17392
- %tmp.16.i17395 = getelementptr %"struct.std::dcomplex"* %mem_tmp.914, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i17396 = getelementptr %"struct.std::dcomplex"* %tmp.0.i17391, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i17397 = load double* %tmp.17.i17396 ; <double> [#uses=1]
- store double %tmp.18.i17397, double* %tmp.16.i17395
- %tmp.4.i17371 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i17370, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i17408, double* %tmp.4.i17371
- %tmp.7.i17374 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i17370, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i17411, double* %tmp.7.i17374
- %tmp.0.i17377 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i17370, %"struct.std::dcomplex"* %mem_tmp.914 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i17379 = getelementptr %"struct.std::dcomplex"* %tmp.0.i17377, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i17380 = load double* %tmp.14.i17379 ; <double> [#uses=1]
- %tmp.17.i17382 = getelementptr %"struct.std::dcomplex"* %tmp.0.i17377, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i17383 = load double* %tmp.17.i17382 ; <double> [#uses=1]
- %tmp.4.i17357 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i17356, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i17380, double* %tmp.4.i17357
- %tmp.7.i17360 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i17356, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i17383, double* %tmp.7.i17360
- %tmp.0.i17363 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i17356, %"struct.std::dcomplex"* %tmp.1075 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i17364 = getelementptr %"struct.std::dcomplex"* %mem_tmp.911, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i17365 = getelementptr %"struct.std::dcomplex"* %tmp.0.i17363, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i17366 = load double* %tmp.14.i17365 ; <double> [#uses=1]
- store double %tmp.15.i17366, double* %tmp.13.i17364
- %tmp.16.i17367 = getelementptr %"struct.std::dcomplex"* %mem_tmp.911, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i17368 = getelementptr %"struct.std::dcomplex"* %tmp.0.i17363, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i17369 = load double* %tmp.17.i17368 ; <double> [#uses=1]
- store double %tmp.18.i17369, double* %tmp.16.i17367
- %tmp.4.i17343 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i17342, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i17422, double* %tmp.4.i17343
- %tmp.7.i17346 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i17342, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i17425, double* %tmp.7.i17346
- %tmp.0.i17349 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i17342, %"struct.std::dcomplex"* %mem_tmp.911 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i17351 = getelementptr %"struct.std::dcomplex"* %tmp.0.i17349, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i17352 = load double* %tmp.14.i17351 ; <double> [#uses=1]
- %tmp.17.i17354 = getelementptr %"struct.std::dcomplex"* %tmp.0.i17349, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i17355 = load double* %tmp.17.i17354 ; <double> [#uses=1]
- store double %tmp.15.i17352, double* %tmp.2.i34364
- store double %tmp.18.i17355, double* %tmp.6.i34365
- %tmp.4.i17309 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i17308, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i17311 = load double* %tmp.5.i33326 ; <double> [#uses=1]
- store double %tmp.6.i17311, double* %tmp.4.i17309
- %tmp.7.i17312 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i17308, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i17314 = load double* %tmp.8.i33329 ; <double> [#uses=1]
- store double %tmp.9.i17314, double* %tmp.7.i17312
- %tmp.0.i17315 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i17308, %"struct.std::dcomplex"* %ret3 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i17317 = getelementptr %"struct.std::dcomplex"* %tmp.0.i17315, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i17318 = load double* %tmp.14.i17317 ; <double> [#uses=1]
- %tmp.17.i17320 = getelementptr %"struct.std::dcomplex"* %tmp.0.i17315, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i17321 = load double* %tmp.17.i17320 ; <double> [#uses=1]
- %tmp.7.i17275 = load double* %tmp.2.i34366 ; <double> [#uses=1]
- %tmp.15.i17289 = add double %tmp.7.i17275, %tmp.15.i17318 ; <double> [#uses=1]
- store double %tmp.15.i17289, double* %tmp.2.i34366
- %tmp.26.i17296 = load double* %tmp.6.i34367 ; <double> [#uses=1]
- %tmp.31.i17307 = add double %tmp.26.i17296, %tmp.18.i17321 ; <double> [#uses=1]
- store double %tmp.31.i17307, double* %tmp.6.i34367
- %tmp.4.i17255 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i17254, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i17257 = load double* %tmp.5.i32136 ; <double> [#uses=1]
- store double %tmp.6.i17257, double* %tmp.4.i17255
- %tmp.7.i17258 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i17254, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i17260 = load double* %tmp.8.i32139 ; <double> [#uses=1]
- store double %tmp.9.i17260, double* %tmp.7.i17258
- %tmp.0.i17261 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i17254, %"struct.std::dcomplex"* %ret4 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i17263 = getelementptr %"struct.std::dcomplex"* %tmp.0.i17261, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i17264 = load double* %tmp.14.i17263 ; <double> [#uses=1]
- %tmp.17.i17266 = getelementptr %"struct.std::dcomplex"* %tmp.0.i17261, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i17267 = load double* %tmp.17.i17266 ; <double> [#uses=1]
- %tmp.7.i17221 = load double* %tmp.2.i34368 ; <double> [#uses=1]
- %tmp.15.i17235 = add double %tmp.7.i17221, %tmp.15.i17264 ; <double> [#uses=1]
- store double %tmp.15.i17235, double* %tmp.2.i34368
- %tmp.26.i17242 = load double* %tmp.6.i34369 ; <double> [#uses=1]
- %tmp.31.i17253 = add double %tmp.26.i17242, %tmp.18.i17267 ; <double> [#uses=1]
- store double %tmp.31.i17253, double* %tmp.6.i34369
- store double 0.000000e+00, double* %tmp.2.i34366
- store double 0.000000e+00, double* %tmp.6.i34367
- %tmp.4.i17199 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i17198, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.5.i17200 = getelementptr [6 x %"struct.std::dcomplex"]* %_m, i32 5, i32 1, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i17201 = load double* %tmp.5.i17200 ; <double> [#uses=1]
- store double %tmp.6.i17201, double* %tmp.4.i17199
- %tmp.7.i17202 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i17198, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.8.i17203 = getelementptr [6 x %"struct.std::dcomplex"]* %_m, i32 5, i32 1, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i17204 = load double* %tmp.8.i17203 ; <double> [#uses=1]
- store double %tmp.9.i17204, double* %tmp.7.i17202
- %tmp.0.i17205 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i17198, %"struct.std::dcomplex"* %ret5 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i17207 = getelementptr %"struct.std::dcomplex"* %tmp.0.i17205, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i17208 = load double* %tmp.14.i17207 ; <double> [#uses=1]
- %tmp.17.i17210 = getelementptr %"struct.std::dcomplex"* %tmp.0.i17205, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i17211 = load double* %tmp.17.i17210 ; <double> [#uses=1]
- %tmp.7.i17165 = load double* %tmp.2.i ; <double> [#uses=1]
- %tmp.15.i17179 = add double %tmp.7.i17165, %tmp.15.i17208 ; <double> [#uses=1]
- store double %tmp.15.i17179, double* %tmp.2.i
- %tmp.26.i17186 = load double* %tmp.6.i ; <double> [#uses=1]
- %tmp.31.i17197 = add double %tmp.26.i17186, %tmp.18.i17211 ; <double> [#uses=1]
- store double %tmp.31.i17197, double* %tmp.6.i
- store double 0.000000e+00, double* %tmp.2.i34368
- store double 0.000000e+00, double* %tmp.6.i34369
- %tmp.4.i17143 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i17142, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i17145 = load double* %tmp.5.i34082 ; <double> [#uses=1]
- store double %tmp.6.i17145, double* %tmp.4.i17143
- %tmp.7.i17146 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i17142, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i17148 = load double* %tmp.8.i34085 ; <double> [#uses=1]
- store double %tmp.9.i17148, double* %tmp.7.i17146
- %tmp.0.i17149 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i17142, %"struct.std::dcomplex"* %tmp.226 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i17151 = getelementptr %"struct.std::dcomplex"* %tmp.0.i17149, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i17152 = load double* %tmp.14.i17151 ; <double> [#uses=1]
- %tmp.17.i17154 = getelementptr %"struct.std::dcomplex"* %tmp.0.i17149, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i17155 = load double* %tmp.17.i17154 ; <double> [#uses=1]
- %tmp.4.i17129 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i17128, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i17131 = load double* %tmp.5.i33146 ; <double> [#uses=1]
- store double %tmp.6.i17131, double* %tmp.4.i17129
- %tmp.7.i17132 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i17128, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i17134 = load double* %tmp.8.i33149 ; <double> [#uses=1]
- store double %tmp.9.i17134, double* %tmp.7.i17132
- %tmp.0.i17135 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i17128, %"struct.std::dcomplex"* %tmp.62 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i17136 = getelementptr %"struct.std::dcomplex"* %mem_tmp.923, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i17137 = getelementptr %"struct.std::dcomplex"* %tmp.0.i17135, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i17138 = load double* %tmp.14.i17137 ; <double> [#uses=1]
- store double %tmp.15.i17138, double* %tmp.13.i17136
- %tmp.16.i17139 = getelementptr %"struct.std::dcomplex"* %mem_tmp.923, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i17140 = getelementptr %"struct.std::dcomplex"* %tmp.0.i17135, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i17141 = load double* %tmp.17.i17140 ; <double> [#uses=1]
- store double %tmp.18.i17141, double* %tmp.16.i17139
- %tmp.4.i17115 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i17114, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i17152, double* %tmp.4.i17115
- %tmp.7.i17118 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i17114, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i17155, double* %tmp.7.i17118
- %tmp.0.i17121 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i17114, %"struct.std::dcomplex"* %mem_tmp.923 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i17123 = getelementptr %"struct.std::dcomplex"* %tmp.0.i17121, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i17124 = load double* %tmp.14.i17123 ; <double> [#uses=1]
- %tmp.17.i17126 = getelementptr %"struct.std::dcomplex"* %tmp.0.i17121, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i17127 = load double* %tmp.17.i17126 ; <double> [#uses=1]
- %tmp.4.i17101 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i17100, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i17124, double* %tmp.4.i17101
- %tmp.7.i17104 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i17100, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i17127, double* %tmp.7.i17104
- %tmp.0.i17107 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i17100, %"struct.std::dcomplex"* %tmp.1075 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i17109 = getelementptr %"struct.std::dcomplex"* %tmp.0.i17107, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i17110 = load double* %tmp.14.i17109 ; <double> [#uses=1]
- %tmp.17.i17112 = getelementptr %"struct.std::dcomplex"* %tmp.0.i17107, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i17113 = load double* %tmp.17.i17112 ; <double> [#uses=1]
- %tmp.4.i17087 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i17086, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i17089 = load double* %tmp.5.i33146 ; <double> [#uses=1]
- store double %tmp.6.i17089, double* %tmp.4.i17087
- %tmp.7.i17090 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i17086, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i17092 = load double* %tmp.8.i33149 ; <double> [#uses=1]
- store double %tmp.9.i17092, double* %tmp.7.i17090
- %tmp.0.i17093 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i17086, %"struct.std::dcomplex"* %tmp.1036 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i17095 = getelementptr %"struct.std::dcomplex"* %tmp.0.i17093, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i17096 = load double* %tmp.14.i17095 ; <double> [#uses=1]
- %tmp.17.i17098 = getelementptr %"struct.std::dcomplex"* %tmp.0.i17093, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i17099 = load double* %tmp.17.i17098 ; <double> [#uses=1]
- %tmp.4.i17073 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i17072, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i17075 = load double* %tmp.5.i28602 ; <double> [#uses=1]
- store double %tmp.6.i17075, double* %tmp.4.i17073
- %tmp.7.i17076 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i17072, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i17078 = load double* %tmp.8.i28605 ; <double> [#uses=1]
- store double %tmp.9.i17078, double* %tmp.7.i17076
- %tmp.0.i17079 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i17072, %"struct.std::dcomplex"* %tmp.226 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i17080 = getelementptr %"struct.std::dcomplex"* %mem_tmp.927, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i17081 = getelementptr %"struct.std::dcomplex"* %tmp.0.i17079, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i17082 = load double* %tmp.14.i17081 ; <double> [#uses=1]
- store double %tmp.15.i17082, double* %tmp.13.i17080
- %tmp.16.i17083 = getelementptr %"struct.std::dcomplex"* %mem_tmp.927, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i17084 = getelementptr %"struct.std::dcomplex"* %tmp.0.i17079, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i17085 = load double* %tmp.17.i17084 ; <double> [#uses=1]
- store double %tmp.18.i17085, double* %tmp.16.i17083
- %tmp.4.i17059 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i17058, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i17096, double* %tmp.4.i17059
- %tmp.7.i17062 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i17058, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i17099, double* %tmp.7.i17062
- %tmp.0.i17065 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i17058, %"struct.std::dcomplex"* %mem_tmp.927 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i17067 = getelementptr %"struct.std::dcomplex"* %tmp.0.i17065, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i17068 = load double* %tmp.14.i17067 ; <double> [#uses=1]
- %tmp.17.i17070 = getelementptr %"struct.std::dcomplex"* %tmp.0.i17065, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i17071 = load double* %tmp.17.i17070 ; <double> [#uses=1]
- %tmp.4.i17045 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i17044, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i17068, double* %tmp.4.i17045
- %tmp.7.i17048 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i17044, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i17071, double* %tmp.7.i17048
- %tmp.0.i17051 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i17044, %"struct.std::dcomplex"* %tmp.95 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i17052 = getelementptr %"struct.std::dcomplex"* %mem_tmp.924, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i17053 = getelementptr %"struct.std::dcomplex"* %tmp.0.i17051, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i17054 = load double* %tmp.14.i17053 ; <double> [#uses=1]
- store double %tmp.15.i17054, double* %tmp.13.i17052
- %tmp.16.i17055 = getelementptr %"struct.std::dcomplex"* %mem_tmp.924, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i17056 = getelementptr %"struct.std::dcomplex"* %tmp.0.i17051, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i17057 = load double* %tmp.17.i17056 ; <double> [#uses=1]
- store double %tmp.18.i17057, double* %tmp.16.i17055
- %tmp.4.i17031 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i17030, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i17110, double* %tmp.4.i17031
- %tmp.7.i17034 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i17030, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i17113, double* %tmp.7.i17034
- %tmp.0.i17037 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i17030, %"struct.std::dcomplex"* %mem_tmp.924 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i17039 = getelementptr %"struct.std::dcomplex"* %tmp.0.i17037, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i17040 = load double* %tmp.14.i17039 ; <double> [#uses=1]
- %tmp.17.i17042 = getelementptr %"struct.std::dcomplex"* %tmp.0.i17037, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i17043 = load double* %tmp.17.i17042 ; <double> [#uses=1]
- %tmp.4.i17017 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i17016, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i17019 = load double* %tmp.5.i28602 ; <double> [#uses=1]
- store double %tmp.6.i17019, double* %tmp.4.i17017
- %tmp.7.i17020 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i17016, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i17022 = load double* %tmp.8.i28605 ; <double> [#uses=1]
- store double %tmp.9.i17022, double* %tmp.7.i17020
- %tmp.0.i17023 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i17016, %"struct.std::dcomplex"* %tmp.62 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i17025 = getelementptr %"struct.std::dcomplex"* %tmp.0.i17023, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i17026 = load double* %tmp.14.i17025 ; <double> [#uses=1]
- %tmp.17.i17028 = getelementptr %"struct.std::dcomplex"* %tmp.0.i17023, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i17029 = load double* %tmp.17.i17028 ; <double> [#uses=1]
- %tmp.4.i17003 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i17002, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i17005 = load double* %tmp.5.i34082 ; <double> [#uses=1]
- store double %tmp.6.i17005, double* %tmp.4.i17003
- %tmp.7.i17006 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i17002, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i17008 = load double* %tmp.8.i34085 ; <double> [#uses=1]
- store double %tmp.9.i17008, double* %tmp.7.i17006
- %tmp.0.i17009 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i17002, %"struct.std::dcomplex"* %tmp.1036 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i17010 = getelementptr %"struct.std::dcomplex"* %mem_tmp.931, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i17011 = getelementptr %"struct.std::dcomplex"* %tmp.0.i17009, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i17012 = load double* %tmp.14.i17011 ; <double> [#uses=1]
- store double %tmp.15.i17012, double* %tmp.13.i17010
- %tmp.16.i17013 = getelementptr %"struct.std::dcomplex"* %mem_tmp.931, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i17014 = getelementptr %"struct.std::dcomplex"* %tmp.0.i17009, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i17015 = load double* %tmp.17.i17014 ; <double> [#uses=1]
- store double %tmp.18.i17015, double* %tmp.16.i17013
- %tmp.4.i16989 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i16988, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i17026, double* %tmp.4.i16989
- %tmp.7.i16992 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i16988, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i17029, double* %tmp.7.i16992
- %tmp.0.i16995 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i16988, %"struct.std::dcomplex"* %mem_tmp.931 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i16997 = getelementptr %"struct.std::dcomplex"* %tmp.0.i16995, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i16998 = load double* %tmp.14.i16997 ; <double> [#uses=1]
- %tmp.17.i17000 = getelementptr %"struct.std::dcomplex"* %tmp.0.i16995, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i17001 = load double* %tmp.17.i17000 ; <double> [#uses=1]
- %tmp.4.i16975 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i16974, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i16998, double* %tmp.4.i16975
- %tmp.7.i16978 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i16974, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i17001, double* %tmp.7.i16978
- %tmp.0.i16981 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i16974, %"struct.std::dcomplex"* %tmp.220 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i16982 = getelementptr %"struct.std::dcomplex"* %mem_tmp.928, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i16983 = getelementptr %"struct.std::dcomplex"* %tmp.0.i16981, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i16984 = load double* %tmp.14.i16983 ; <double> [#uses=1]
- store double %tmp.15.i16984, double* %tmp.13.i16982
- %tmp.16.i16985 = getelementptr %"struct.std::dcomplex"* %mem_tmp.928, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i16986 = getelementptr %"struct.std::dcomplex"* %tmp.0.i16981, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i16987 = load double* %tmp.17.i16986 ; <double> [#uses=1]
- store double %tmp.18.i16987, double* %tmp.16.i16985
- %tmp.4.i16961 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i16960, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i17040, double* %tmp.4.i16961
- %tmp.7.i16964 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i16960, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i17043, double* %tmp.7.i16964
- %tmp.0.i16967 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i16960, %"struct.std::dcomplex"* %mem_tmp.928 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i16969 = getelementptr %"struct.std::dcomplex"* %tmp.0.i16967, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i16970 = load double* %tmp.14.i16969 ; <double> [#uses=1]
- %tmp.17.i16972 = getelementptr %"struct.std::dcomplex"* %tmp.0.i16967, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i16973 = load double* %tmp.17.i16972 ; <double> [#uses=1]
- store double %tmp.15.i16970, double* %tmp.2.i34364
- store double %tmp.18.i16973, double* %tmp.6.i34365
- %tmp.4.i16927 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i16926, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i16929 = load double* %tmp.5.i33596 ; <double> [#uses=1]
- store double %tmp.6.i16929, double* %tmp.4.i16927
- %tmp.7.i16930 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i16926, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i16932 = load double* %tmp.8.i33599 ; <double> [#uses=1]
- store double %tmp.9.i16932, double* %tmp.7.i16930
- %tmp.0.i16933 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i16926, %"struct.std::dcomplex"* %ret3 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i16935 = getelementptr %"struct.std::dcomplex"* %tmp.0.i16933, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i16936 = load double* %tmp.14.i16935 ; <double> [#uses=1]
- %tmp.17.i16938 = getelementptr %"struct.std::dcomplex"* %tmp.0.i16933, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i16939 = load double* %tmp.17.i16938 ; <double> [#uses=1]
- %tmp.7.i16893 = load double* %tmp.2.i34366 ; <double> [#uses=1]
- %tmp.15.i16907 = add double %tmp.7.i16893, %tmp.15.i16936 ; <double> [#uses=1]
- store double %tmp.15.i16907, double* %tmp.2.i34366
- %tmp.26.i16914 = load double* %tmp.6.i34367 ; <double> [#uses=1]
- %tmp.31.i16925 = add double %tmp.26.i16914, %tmp.18.i16939 ; <double> [#uses=1]
- store double %tmp.31.i16925, double* %tmp.6.i34367
- %tmp.4.i16873 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i16872, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i16875 = load double* %tmp.5.i34338 ; <double> [#uses=1]
- store double %tmp.6.i16875, double* %tmp.4.i16873
- %tmp.7.i16876 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i16872, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i16878 = load double* %tmp.8.i34341 ; <double> [#uses=1]
- store double %tmp.9.i16878, double* %tmp.7.i16876
- %tmp.0.i16879 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i16872, %"struct.std::dcomplex"* %tmp.1036 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i16881 = getelementptr %"struct.std::dcomplex"* %tmp.0.i16879, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i16882 = load double* %tmp.14.i16881 ; <double> [#uses=1]
- %tmp.17.i16884 = getelementptr %"struct.std::dcomplex"* %tmp.0.i16879, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i16885 = load double* %tmp.17.i16884 ; <double> [#uses=1]
- %tmp.4.i16859 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i16858, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i16861 = load double* %tmp.5.i28602 ; <double> [#uses=1]
- store double %tmp.6.i16861, double* %tmp.4.i16859
- %tmp.7.i16862 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i16858, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i16864 = load double* %tmp.8.i28605 ; <double> [#uses=1]
- store double %tmp.9.i16864, double* %tmp.7.i16862
- %tmp.0.i16865 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i16858, %"struct.std::dcomplex"* %tmp.6 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i16866 = getelementptr %"struct.std::dcomplex"* %mem_tmp.938, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i16867 = getelementptr %"struct.std::dcomplex"* %tmp.0.i16865, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i16868 = load double* %tmp.14.i16867 ; <double> [#uses=1]
- store double %tmp.15.i16868, double* %tmp.13.i16866
- %tmp.16.i16869 = getelementptr %"struct.std::dcomplex"* %mem_tmp.938, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i16870 = getelementptr %"struct.std::dcomplex"* %tmp.0.i16865, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i16871 = load double* %tmp.17.i16870 ; <double> [#uses=1]
- store double %tmp.18.i16871, double* %tmp.16.i16869
- %tmp.4.i16845 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i16844, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i16882, double* %tmp.4.i16845
- %tmp.7.i16848 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i16844, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i16885, double* %tmp.7.i16848
- %tmp.0.i16851 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i16844, %"struct.std::dcomplex"* %mem_tmp.938 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i16853 = getelementptr %"struct.std::dcomplex"* %tmp.0.i16851, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i16854 = load double* %tmp.14.i16853 ; <double> [#uses=1]
- %tmp.17.i16856 = getelementptr %"struct.std::dcomplex"* %tmp.0.i16851, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i16857 = load double* %tmp.17.i16856 ; <double> [#uses=1]
- %tmp.4.i16831 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i16830, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i16854, double* %tmp.4.i16831
- %tmp.7.i16834 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i16830, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i16857, double* %tmp.7.i16834
- %tmp.0.i16837 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i16830, %"struct.std::dcomplex"* %tmp.220 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i16839 = getelementptr %"struct.std::dcomplex"* %tmp.0.i16837, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i16840 = load double* %tmp.14.i16839 ; <double> [#uses=1]
- %tmp.17.i16842 = getelementptr %"struct.std::dcomplex"* %tmp.0.i16837, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i16843 = load double* %tmp.17.i16842 ; <double> [#uses=1]
- %tmp.4.i16817 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i16816, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i16819 = load double* %tmp.5.i33146 ; <double> [#uses=1]
- store double %tmp.6.i16819, double* %tmp.4.i16817
- %tmp.7.i16820 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i16816, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i16822 = load double* %tmp.8.i33149 ; <double> [#uses=1]
- store double %tmp.9.i16822, double* %tmp.7.i16820
- %tmp.0.i16823 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i16816, %"struct.std::dcomplex"* %tmp.6 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i16825 = getelementptr %"struct.std::dcomplex"* %tmp.0.i16823, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i16826 = load double* %tmp.14.i16825 ; <double> [#uses=1]
- %tmp.17.i16828 = getelementptr %"struct.std::dcomplex"* %tmp.0.i16823, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i16829 = load double* %tmp.17.i16828 ; <double> [#uses=1]
- %tmp.4.i16803 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i16802, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i16805 = load double* %tmp.5.i34338 ; <double> [#uses=1]
- store double %tmp.6.i16805, double* %tmp.4.i16803
- %tmp.7.i16806 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i16802, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i16808 = load double* %tmp.8.i34341 ; <double> [#uses=1]
- store double %tmp.9.i16808, double* %tmp.7.i16806
- %tmp.0.i16809 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i16802, %"struct.std::dcomplex"* %tmp.226 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i16810 = getelementptr %"struct.std::dcomplex"* %mem_tmp.942, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i16811 = getelementptr %"struct.std::dcomplex"* %tmp.0.i16809, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i16812 = load double* %tmp.14.i16811 ; <double> [#uses=1]
- store double %tmp.15.i16812, double* %tmp.13.i16810
- %tmp.16.i16813 = getelementptr %"struct.std::dcomplex"* %mem_tmp.942, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i16814 = getelementptr %"struct.std::dcomplex"* %tmp.0.i16809, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i16815 = load double* %tmp.17.i16814 ; <double> [#uses=1]
- store double %tmp.18.i16815, double* %tmp.16.i16813
- %tmp.4.i16789 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i16788, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i16826, double* %tmp.4.i16789
- %tmp.7.i16792 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i16788, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i16829, double* %tmp.7.i16792
- %tmp.0.i16795 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i16788, %"struct.std::dcomplex"* %mem_tmp.942 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i16797 = getelementptr %"struct.std::dcomplex"* %tmp.0.i16795, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i16798 = load double* %tmp.14.i16797 ; <double> [#uses=1]
- %tmp.17.i16800 = getelementptr %"struct.std::dcomplex"* %tmp.0.i16795, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i16801 = load double* %tmp.17.i16800 ; <double> [#uses=1]
- %tmp.4.i16775 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i16774, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i16798, double* %tmp.4.i16775
- %tmp.7.i16778 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i16774, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i16801, double* %tmp.7.i16778
- %tmp.0.i16781 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i16774, %"struct.std::dcomplex"* %tmp.1075 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i16782 = getelementptr %"struct.std::dcomplex"* %mem_tmp.939, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i16783 = getelementptr %"struct.std::dcomplex"* %tmp.0.i16781, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i16784 = load double* %tmp.14.i16783 ; <double> [#uses=1]
- store double %tmp.15.i16784, double* %tmp.13.i16782
- %tmp.16.i16785 = getelementptr %"struct.std::dcomplex"* %mem_tmp.939, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i16786 = getelementptr %"struct.std::dcomplex"* %tmp.0.i16781, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i16787 = load double* %tmp.17.i16786 ; <double> [#uses=1]
- store double %tmp.18.i16787, double* %tmp.16.i16785
- %tmp.4.i16761 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i16760, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i16840, double* %tmp.4.i16761
- %tmp.7.i16764 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i16760, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i16843, double* %tmp.7.i16764
- %tmp.0.i16767 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i16760, %"struct.std::dcomplex"* %mem_tmp.939 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i16769 = getelementptr %"struct.std::dcomplex"* %tmp.0.i16767, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i16770 = load double* %tmp.14.i16769 ; <double> [#uses=1]
- %tmp.17.i16772 = getelementptr %"struct.std::dcomplex"* %tmp.0.i16767, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i16773 = load double* %tmp.17.i16772 ; <double> [#uses=1]
- %tmp.4.i16747 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i16746, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i16749 = load double* %tmp.5.i28602 ; <double> [#uses=1]
- store double %tmp.6.i16749, double* %tmp.4.i16747
- %tmp.7.i16750 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i16746, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i16752 = load double* %tmp.8.i28605 ; <double> [#uses=1]
- store double %tmp.9.i16752, double* %tmp.7.i16750
- %tmp.0.i16753 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i16746, %"struct.std::dcomplex"* %tmp.226 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i16755 = getelementptr %"struct.std::dcomplex"* %tmp.0.i16753, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i16756 = load double* %tmp.14.i16755 ; <double> [#uses=1]
- %tmp.17.i16758 = getelementptr %"struct.std::dcomplex"* %tmp.0.i16753, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i16759 = load double* %tmp.17.i16758 ; <double> [#uses=1]
- %tmp.4.i16733 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i16732, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i16735 = load double* %tmp.5.i33146 ; <double> [#uses=1]
- store double %tmp.6.i16735, double* %tmp.4.i16733
- %tmp.7.i16736 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i16732, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i16738 = load double* %tmp.8.i33149 ; <double> [#uses=1]
- store double %tmp.9.i16738, double* %tmp.7.i16736
- %tmp.0.i16739 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i16732, %"struct.std::dcomplex"* %tmp.1036 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i16740 = getelementptr %"struct.std::dcomplex"* %mem_tmp.946, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i16741 = getelementptr %"struct.std::dcomplex"* %tmp.0.i16739, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i16742 = load double* %tmp.14.i16741 ; <double> [#uses=1]
- store double %tmp.15.i16742, double* %tmp.13.i16740
- %tmp.16.i16743 = getelementptr %"struct.std::dcomplex"* %mem_tmp.946, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i16744 = getelementptr %"struct.std::dcomplex"* %tmp.0.i16739, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i16745 = load double* %tmp.17.i16744 ; <double> [#uses=1]
- store double %tmp.18.i16745, double* %tmp.16.i16743
- %tmp.4.i16719 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i16718, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i16756, double* %tmp.4.i16719
- %tmp.7.i16722 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i16718, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i16759, double* %tmp.7.i16722
- %tmp.0.i16725 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i16718, %"struct.std::dcomplex"* %mem_tmp.946 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i16727 = getelementptr %"struct.std::dcomplex"* %tmp.0.i16725, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i16728 = load double* %tmp.14.i16727 ; <double> [#uses=1]
- %tmp.17.i16730 = getelementptr %"struct.std::dcomplex"* %tmp.0.i16725, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i16731 = load double* %tmp.17.i16730 ; <double> [#uses=1]
- %tmp.4.i16705 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i16704, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i16728, double* %tmp.4.i16705
- %tmp.7.i16708 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i16704, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i16731, double* %tmp.7.i16708
- %tmp.0.i16711 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i16704, %"struct.std::dcomplex"* %tmp.45 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i16712 = getelementptr %"struct.std::dcomplex"* %mem_tmp.943, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i16713 = getelementptr %"struct.std::dcomplex"* %tmp.0.i16711, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i16714 = load double* %tmp.14.i16713 ; <double> [#uses=1]
- store double %tmp.15.i16714, double* %tmp.13.i16712
- %tmp.16.i16715 = getelementptr %"struct.std::dcomplex"* %mem_tmp.943, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i16716 = getelementptr %"struct.std::dcomplex"* %tmp.0.i16711, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i16717 = load double* %tmp.17.i16716 ; <double> [#uses=1]
- store double %tmp.18.i16717, double* %tmp.16.i16715
- %tmp.4.i16691 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i16690, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i16770, double* %tmp.4.i16691
- %tmp.7.i16694 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i16690, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i16773, double* %tmp.7.i16694
- %tmp.0.i16697 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i16690, %"struct.std::dcomplex"* %mem_tmp.943 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i16699 = getelementptr %"struct.std::dcomplex"* %tmp.0.i16697, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i16700 = load double* %tmp.14.i16699 ; <double> [#uses=1]
- %tmp.17.i16702 = getelementptr %"struct.std::dcomplex"* %tmp.0.i16697, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i16703 = load double* %tmp.17.i16702 ; <double> [#uses=1]
- store double %tmp.15.i16700, double* %tmp.2.i34364
- store double %tmp.18.i16703, double* %tmp.6.i34365
- %tmp.4.i16657 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i16656, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i16659 = load double* %tmp.5.i34136 ; <double> [#uses=1]
- store double %tmp.6.i16659, double* %tmp.4.i16657
- %tmp.7.i16660 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i16656, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i16662 = load double* %tmp.8.i34139 ; <double> [#uses=1]
- store double %tmp.9.i16662, double* %tmp.7.i16660
- %tmp.0.i16663 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i16656, %"struct.std::dcomplex"* %ret3 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i16665 = getelementptr %"struct.std::dcomplex"* %tmp.0.i16663, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i16666 = load double* %tmp.14.i16665 ; <double> [#uses=1]
- %tmp.17.i16668 = getelementptr %"struct.std::dcomplex"* %tmp.0.i16663, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i16669 = load double* %tmp.17.i16668 ; <double> [#uses=1]
- %tmp.7.i16623 = load double* %tmp.2.i34366 ; <double> [#uses=1]
- %tmp.15.i16637 = add double %tmp.7.i16623, %tmp.15.i16666 ; <double> [#uses=1]
- store double %tmp.15.i16637, double* %tmp.2.i34366
- %tmp.26.i16644 = load double* %tmp.6.i34367 ; <double> [#uses=1]
- %tmp.31.i16655 = add double %tmp.26.i16644, %tmp.18.i16669 ; <double> [#uses=1]
- store double %tmp.31.i16655, double* %tmp.6.i34367
- %tmp.4.i16603 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i16602, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i16605 = load double* %tmp.5.i34082 ; <double> [#uses=1]
- store double %tmp.6.i16605, double* %tmp.4.i16603
- %tmp.7.i16606 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i16602, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i16608 = load double* %tmp.8.i34085 ; <double> [#uses=1]
- store double %tmp.9.i16608, double* %tmp.7.i16606
- %tmp.0.i16609 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i16602, %"struct.std::dcomplex"* %tmp.1036 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i16611 = getelementptr %"struct.std::dcomplex"* %tmp.0.i16609, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i16612 = load double* %tmp.14.i16611 ; <double> [#uses=1]
- %tmp.17.i16614 = getelementptr %"struct.std::dcomplex"* %tmp.0.i16609, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i16615 = load double* %tmp.17.i16614 ; <double> [#uses=1]
- %tmp.4.i16589 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i16588, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i16591 = load double* %tmp.5.i28602 ; <double> [#uses=1]
- store double %tmp.6.i16591, double* %tmp.4.i16589
- %tmp.7.i16592 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i16588, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i16594 = load double* %tmp.8.i28605 ; <double> [#uses=1]
- store double %tmp.9.i16594, double* %tmp.7.i16592
- %tmp.0.i16595 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i16588, %"struct.std::dcomplex"* %tmp.62 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i16596 = getelementptr %"struct.std::dcomplex"* %mem_tmp.953, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i16597 = getelementptr %"struct.std::dcomplex"* %tmp.0.i16595, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i16598 = load double* %tmp.14.i16597 ; <double> [#uses=1]
- store double %tmp.15.i16598, double* %tmp.13.i16596
- %tmp.16.i16599 = getelementptr %"struct.std::dcomplex"* %mem_tmp.953, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i16600 = getelementptr %"struct.std::dcomplex"* %tmp.0.i16595, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i16601 = load double* %tmp.17.i16600 ; <double> [#uses=1]
- store double %tmp.18.i16601, double* %tmp.16.i16599
- %tmp.4.i16575 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i16574, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i16612, double* %tmp.4.i16575
- %tmp.7.i16578 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i16574, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i16615, double* %tmp.7.i16578
- %tmp.0.i16581 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i16574, %"struct.std::dcomplex"* %mem_tmp.953 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i16583 = getelementptr %"struct.std::dcomplex"* %tmp.0.i16581, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i16584 = load double* %tmp.14.i16583 ; <double> [#uses=1]
- %tmp.17.i16586 = getelementptr %"struct.std::dcomplex"* %tmp.0.i16581, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i16587 = load double* %tmp.17.i16586 ; <double> [#uses=1]
- %tmp.4.i16561 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i16560, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i16584, double* %tmp.4.i16561
- %tmp.7.i16564 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i16560, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i16587, double* %tmp.7.i16564
- %tmp.0.i16567 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i16560, %"struct.std::dcomplex"* %tmp.45 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i16569 = getelementptr %"struct.std::dcomplex"* %tmp.0.i16567, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i16570 = load double* %tmp.14.i16569 ; <double> [#uses=1]
- %tmp.17.i16572 = getelementptr %"struct.std::dcomplex"* %tmp.0.i16567, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i16573 = load double* %tmp.17.i16572 ; <double> [#uses=1]
- %tmp.4.i16547 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i16546, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i16549 = load double* %tmp.5.i28602 ; <double> [#uses=1]
- store double %tmp.6.i16549, double* %tmp.4.i16547
- %tmp.7.i16550 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i16546, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i16552 = load double* %tmp.8.i28605 ; <double> [#uses=1]
- store double %tmp.9.i16552, double* %tmp.7.i16550
- %tmp.0.i16553 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i16546, %"struct.std::dcomplex"* %tmp.6 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i16555 = getelementptr %"struct.std::dcomplex"* %tmp.0.i16553, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i16556 = load double* %tmp.14.i16555 ; <double> [#uses=1]
- %tmp.17.i16558 = getelementptr %"struct.std::dcomplex"* %tmp.0.i16553, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i16559 = load double* %tmp.17.i16558 ; <double> [#uses=1]
- %tmp.4.i16533 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i16532, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i16535 = load double* %tmp.5.i34338 ; <double> [#uses=1]
- store double %tmp.6.i16535, double* %tmp.4.i16533
- %tmp.7.i16536 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i16532, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i16538 = load double* %tmp.8.i34341 ; <double> [#uses=1]
- store double %tmp.9.i16538, double* %tmp.7.i16536
- %tmp.0.i16539 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i16532, %"struct.std::dcomplex"* %tmp.1036 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i16540 = getelementptr %"struct.std::dcomplex"* %mem_tmp.957, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i16541 = getelementptr %"struct.std::dcomplex"* %tmp.0.i16539, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i16542 = load double* %tmp.14.i16541 ; <double> [#uses=1]
- store double %tmp.15.i16542, double* %tmp.13.i16540
- %tmp.16.i16543 = getelementptr %"struct.std::dcomplex"* %mem_tmp.957, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i16544 = getelementptr %"struct.std::dcomplex"* %tmp.0.i16539, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i16545 = load double* %tmp.17.i16544 ; <double> [#uses=1]
- store double %tmp.18.i16545, double* %tmp.16.i16543
- %tmp.4.i16519 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i16518, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i16556, double* %tmp.4.i16519
- %tmp.7.i16522 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i16518, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i16559, double* %tmp.7.i16522
- %tmp.0.i16525 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i16518, %"struct.std::dcomplex"* %mem_tmp.957 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i16527 = getelementptr %"struct.std::dcomplex"* %tmp.0.i16525, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i16528 = load double* %tmp.14.i16527 ; <double> [#uses=1]
- %tmp.17.i16530 = getelementptr %"struct.std::dcomplex"* %tmp.0.i16525, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i16531 = load double* %tmp.17.i16530 ; <double> [#uses=1]
- %tmp.4.i16505 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i16504, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i16528, double* %tmp.4.i16505
- %tmp.7.i16508 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i16504, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i16531, double* %tmp.7.i16508
- %tmp.0.i16511 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i16504, %"struct.std::dcomplex"* %tmp.95 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i16512 = getelementptr %"struct.std::dcomplex"* %mem_tmp.954, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i16513 = getelementptr %"struct.std::dcomplex"* %tmp.0.i16511, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i16514 = load double* %tmp.14.i16513 ; <double> [#uses=1]
- store double %tmp.15.i16514, double* %tmp.13.i16512
- %tmp.16.i16515 = getelementptr %"struct.std::dcomplex"* %mem_tmp.954, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i16516 = getelementptr %"struct.std::dcomplex"* %tmp.0.i16511, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i16517 = load double* %tmp.17.i16516 ; <double> [#uses=1]
- store double %tmp.18.i16517, double* %tmp.16.i16515
- %tmp.4.i16491 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i16490, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i16570, double* %tmp.4.i16491
- %tmp.7.i16494 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i16490, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i16573, double* %tmp.7.i16494
- %tmp.0.i16497 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i16490, %"struct.std::dcomplex"* %mem_tmp.954 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i16499 = getelementptr %"struct.std::dcomplex"* %tmp.0.i16497, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i16500 = load double* %tmp.14.i16499 ; <double> [#uses=1]
- %tmp.17.i16502 = getelementptr %"struct.std::dcomplex"* %tmp.0.i16497, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i16503 = load double* %tmp.17.i16502 ; <double> [#uses=1]
- %tmp.4.i16477 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i16476, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i16479 = load double* %tmp.5.i34338 ; <double> [#uses=1]
- store double %tmp.6.i16479, double* %tmp.4.i16477
- %tmp.7.i16480 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i16476, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i16482 = load double* %tmp.8.i34341 ; <double> [#uses=1]
- store double %tmp.9.i16482, double* %tmp.7.i16480
- %tmp.0.i16483 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i16476, %"struct.std::dcomplex"* %tmp.62 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i16485 = getelementptr %"struct.std::dcomplex"* %tmp.0.i16483, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i16486 = load double* %tmp.14.i16485 ; <double> [#uses=1]
- %tmp.17.i16488 = getelementptr %"struct.std::dcomplex"* %tmp.0.i16483, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i16489 = load double* %tmp.17.i16488 ; <double> [#uses=1]
- %tmp.4.i16463 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i16462, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i16465 = load double* %tmp.5.i34082 ; <double> [#uses=1]
- store double %tmp.6.i16465, double* %tmp.4.i16463
- %tmp.7.i16466 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i16462, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i16468 = load double* %tmp.8.i34085 ; <double> [#uses=1]
- store double %tmp.9.i16468, double* %tmp.7.i16466
- %tmp.0.i16469 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i16462, %"struct.std::dcomplex"* %tmp.6 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i16470 = getelementptr %"struct.std::dcomplex"* %mem_tmp.961, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i16471 = getelementptr %"struct.std::dcomplex"* %tmp.0.i16469, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i16472 = load double* %tmp.14.i16471 ; <double> [#uses=1]
- store double %tmp.15.i16472, double* %tmp.13.i16470
- %tmp.16.i16473 = getelementptr %"struct.std::dcomplex"* %mem_tmp.961, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i16474 = getelementptr %"struct.std::dcomplex"* %tmp.0.i16469, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i16475 = load double* %tmp.17.i16474 ; <double> [#uses=1]
- store double %tmp.18.i16475, double* %tmp.16.i16473
- %tmp.4.i16449 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i16448, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i16486, double* %tmp.4.i16449
- %tmp.7.i16452 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i16448, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i16489, double* %tmp.7.i16452
- %tmp.0.i16455 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i16448, %"struct.std::dcomplex"* %mem_tmp.961 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i16457 = getelementptr %"struct.std::dcomplex"* %tmp.0.i16455, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i16458 = load double* %tmp.14.i16457 ; <double> [#uses=1]
- %tmp.17.i16460 = getelementptr %"struct.std::dcomplex"* %tmp.0.i16455, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i16461 = load double* %tmp.17.i16460 ; <double> [#uses=1]
- %tmp.4.i16435 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i16434, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i16458, double* %tmp.4.i16435
- %tmp.7.i16438 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i16434, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i16461, double* %tmp.7.i16438
- %tmp.0.i16441 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i16434, %"struct.std::dcomplex"* %tmp.1075 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i16442 = getelementptr %"struct.std::dcomplex"* %mem_tmp.958, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i16443 = getelementptr %"struct.std::dcomplex"* %tmp.0.i16441, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i16444 = load double* %tmp.14.i16443 ; <double> [#uses=1]
- store double %tmp.15.i16444, double* %tmp.13.i16442
- %tmp.16.i16445 = getelementptr %"struct.std::dcomplex"* %mem_tmp.958, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i16446 = getelementptr %"struct.std::dcomplex"* %tmp.0.i16441, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i16447 = load double* %tmp.17.i16446 ; <double> [#uses=1]
- store double %tmp.18.i16447, double* %tmp.16.i16445
- %tmp.4.i16421 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i16420, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i16500, double* %tmp.4.i16421
- %tmp.7.i16424 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i16420, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i16503, double* %tmp.7.i16424
- %tmp.0.i16427 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i16420, %"struct.std::dcomplex"* %mem_tmp.958 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i16429 = getelementptr %"struct.std::dcomplex"* %tmp.0.i16427, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i16430 = load double* %tmp.14.i16429 ; <double> [#uses=1]
- %tmp.17.i16432 = getelementptr %"struct.std::dcomplex"* %tmp.0.i16427, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i16433 = load double* %tmp.17.i16432 ; <double> [#uses=1]
- store double %tmp.15.i16430, double* %tmp.2.i34364
- store double %tmp.18.i16433, double* %tmp.6.i34365
- %tmp.4.i16387 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i16386, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i16389 = load double* %tmp.5.i32460 ; <double> [#uses=1]
- store double %tmp.6.i16389, double* %tmp.4.i16387
- %tmp.7.i16390 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i16386, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i16392 = load double* %tmp.8.i32463 ; <double> [#uses=1]
- store double %tmp.9.i16392, double* %tmp.7.i16390
- %tmp.0.i16393 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i16386, %"struct.std::dcomplex"* %ret3 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i16395 = getelementptr %"struct.std::dcomplex"* %tmp.0.i16393, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i16396 = load double* %tmp.14.i16395 ; <double> [#uses=1]
- %tmp.17.i16398 = getelementptr %"struct.std::dcomplex"* %tmp.0.i16393, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i16399 = load double* %tmp.17.i16398 ; <double> [#uses=1]
- %tmp.7.i16353 = load double* %tmp.2.i34366 ; <double> [#uses=1]
- %tmp.15.i16367 = add double %tmp.7.i16353, %tmp.15.i16396 ; <double> [#uses=1]
- store double %tmp.15.i16367, double* %tmp.2.i34366
- %tmp.26.i16374 = load double* %tmp.6.i34367 ; <double> [#uses=1]
- %tmp.31.i16385 = add double %tmp.26.i16374, %tmp.18.i16399 ; <double> [#uses=1]
- store double %tmp.31.i16385, double* %tmp.6.i34367
- %tmp.4.i16333 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i16332, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i16335 = load double* %tmp.5.i34082 ; <double> [#uses=1]
- store double %tmp.6.i16335, double* %tmp.4.i16333
- %tmp.7.i16336 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i16332, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i16338 = load double* %tmp.8.i34085 ; <double> [#uses=1]
- store double %tmp.9.i16338, double* %tmp.7.i16336
- %tmp.0.i16339 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i16332, %"struct.std::dcomplex"* %tmp.6 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i16341 = getelementptr %"struct.std::dcomplex"* %tmp.0.i16339, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i16342 = load double* %tmp.14.i16341 ; <double> [#uses=1]
- %tmp.17.i16344 = getelementptr %"struct.std::dcomplex"* %tmp.0.i16339, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i16345 = load double* %tmp.17.i16344 ; <double> [#uses=1]
- %tmp.4.i16319 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i16318, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i16321 = load double* %tmp.5.i34338 ; <double> [#uses=1]
- store double %tmp.6.i16321, double* %tmp.4.i16319
- %tmp.7.i16322 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i16318, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i16324 = load double* %tmp.8.i34341 ; <double> [#uses=1]
- store double %tmp.9.i16324, double* %tmp.7.i16322
- %tmp.0.i16325 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i16318, %"struct.std::dcomplex"* %tmp.62 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i16326 = getelementptr %"struct.std::dcomplex"* %mem_tmp.968, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i16327 = getelementptr %"struct.std::dcomplex"* %tmp.0.i16325, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i16328 = load double* %tmp.14.i16327 ; <double> [#uses=1]
- store double %tmp.15.i16328, double* %tmp.13.i16326
- %tmp.16.i16329 = getelementptr %"struct.std::dcomplex"* %mem_tmp.968, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i16330 = getelementptr %"struct.std::dcomplex"* %tmp.0.i16325, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i16331 = load double* %tmp.17.i16330 ; <double> [#uses=1]
- store double %tmp.18.i16331, double* %tmp.16.i16329
- %tmp.4.i16305 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i16304, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i16342, double* %tmp.4.i16305
- %tmp.7.i16308 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i16304, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i16345, double* %tmp.7.i16308
- %tmp.0.i16311 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i16304, %"struct.std::dcomplex"* %mem_tmp.968 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i16313 = getelementptr %"struct.std::dcomplex"* %tmp.0.i16311, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i16314 = load double* %tmp.14.i16313 ; <double> [#uses=1]
- %tmp.17.i16316 = getelementptr %"struct.std::dcomplex"* %tmp.0.i16311, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i16317 = load double* %tmp.17.i16316 ; <double> [#uses=1]
- %tmp.4.i16291 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i16290, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i16314, double* %tmp.4.i16291
- %tmp.7.i16294 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i16290, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i16317, double* %tmp.7.i16294
- %tmp.0.i16297 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i16290, %"struct.std::dcomplex"* %tmp.220 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i16299 = getelementptr %"struct.std::dcomplex"* %tmp.0.i16297, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i16300 = load double* %tmp.14.i16299 ; <double> [#uses=1]
- %tmp.17.i16302 = getelementptr %"struct.std::dcomplex"* %tmp.0.i16297, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i16303 = load double* %tmp.17.i16302 ; <double> [#uses=1]
- %tmp.4.i16277 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i16276, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i16279 = load double* %tmp.5.i33146 ; <double> [#uses=1]
- store double %tmp.6.i16279, double* %tmp.4.i16277
- %tmp.7.i16280 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i16276, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i16282 = load double* %tmp.8.i33149 ; <double> [#uses=1]
- store double %tmp.9.i16282, double* %tmp.7.i16280
- %tmp.0.i16283 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i16276, %"struct.std::dcomplex"* %tmp.62 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i16285 = getelementptr %"struct.std::dcomplex"* %tmp.0.i16283, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i16286 = load double* %tmp.14.i16285 ; <double> [#uses=1]
- %tmp.17.i16288 = getelementptr %"struct.std::dcomplex"* %tmp.0.i16283, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i16289 = load double* %tmp.17.i16288 ; <double> [#uses=1]
- %tmp.4.i16263 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i16262, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i16265 = load double* %tmp.5.i34082 ; <double> [#uses=1]
- store double %tmp.6.i16265, double* %tmp.4.i16263
- %tmp.7.i16266 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i16262, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i16268 = load double* %tmp.8.i34085 ; <double> [#uses=1]
- store double %tmp.9.i16268, double* %tmp.7.i16266
- %tmp.0.i16269 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i16262, %"struct.std::dcomplex"* %tmp.226 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i16270 = getelementptr %"struct.std::dcomplex"* %mem_tmp.972, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i16271 = getelementptr %"struct.std::dcomplex"* %tmp.0.i16269, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i16272 = load double* %tmp.14.i16271 ; <double> [#uses=1]
- store double %tmp.15.i16272, double* %tmp.13.i16270
- %tmp.16.i16273 = getelementptr %"struct.std::dcomplex"* %mem_tmp.972, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i16274 = getelementptr %"struct.std::dcomplex"* %tmp.0.i16269, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i16275 = load double* %tmp.17.i16274 ; <double> [#uses=1]
- store double %tmp.18.i16275, double* %tmp.16.i16273
- %tmp.4.i16249 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i16248, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i16286, double* %tmp.4.i16249
- %tmp.7.i16252 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i16248, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i16289, double* %tmp.7.i16252
- %tmp.0.i16255 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i16248, %"struct.std::dcomplex"* %mem_tmp.972 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i16257 = getelementptr %"struct.std::dcomplex"* %tmp.0.i16255, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i16258 = load double* %tmp.14.i16257 ; <double> [#uses=1]
- %tmp.17.i16260 = getelementptr %"struct.std::dcomplex"* %tmp.0.i16255, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i16261 = load double* %tmp.17.i16260 ; <double> [#uses=1]
- %tmp.4.i16235 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i16234, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i16258, double* %tmp.4.i16235
- %tmp.7.i16238 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i16234, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i16261, double* %tmp.7.i16238
- %tmp.0.i16241 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i16234, %"struct.std::dcomplex"* %tmp.45 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i16242 = getelementptr %"struct.std::dcomplex"* %mem_tmp.969, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i16243 = getelementptr %"struct.std::dcomplex"* %tmp.0.i16241, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i16244 = load double* %tmp.14.i16243 ; <double> [#uses=1]
- store double %tmp.15.i16244, double* %tmp.13.i16242
- %tmp.16.i16245 = getelementptr %"struct.std::dcomplex"* %mem_tmp.969, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i16246 = getelementptr %"struct.std::dcomplex"* %tmp.0.i16241, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i16247 = load double* %tmp.17.i16246 ; <double> [#uses=1]
- store double %tmp.18.i16247, double* %tmp.16.i16245
- %tmp.4.i16221 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i16220, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i16300, double* %tmp.4.i16221
- %tmp.7.i16224 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i16220, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i16303, double* %tmp.7.i16224
- %tmp.0.i16227 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i16220, %"struct.std::dcomplex"* %mem_tmp.969 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i16229 = getelementptr %"struct.std::dcomplex"* %tmp.0.i16227, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i16230 = load double* %tmp.14.i16229 ; <double> [#uses=1]
- %tmp.17.i16232 = getelementptr %"struct.std::dcomplex"* %tmp.0.i16227, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i16233 = load double* %tmp.17.i16232 ; <double> [#uses=1]
- %tmp.4.i16207 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i16206, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i16209 = load double* %tmp.5.i34338 ; <double> [#uses=1]
- store double %tmp.6.i16209, double* %tmp.4.i16207
- %tmp.7.i16210 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i16206, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i16212 = load double* %tmp.8.i34341 ; <double> [#uses=1]
- store double %tmp.9.i16212, double* %tmp.7.i16210
- %tmp.0.i16213 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i16206, %"struct.std::dcomplex"* %tmp.226 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i16215 = getelementptr %"struct.std::dcomplex"* %tmp.0.i16213, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i16216 = load double* %tmp.14.i16215 ; <double> [#uses=1]
- %tmp.17.i16218 = getelementptr %"struct.std::dcomplex"* %tmp.0.i16213, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i16219 = load double* %tmp.17.i16218 ; <double> [#uses=1]
- %tmp.4.i16193 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i16192, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i16195 = load double* %tmp.5.i33146 ; <double> [#uses=1]
- store double %tmp.6.i16195, double* %tmp.4.i16193
- %tmp.7.i16196 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i16192, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i16198 = load double* %tmp.8.i33149 ; <double> [#uses=1]
- store double %tmp.9.i16198, double* %tmp.7.i16196
- %tmp.0.i16199 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i16192, %"struct.std::dcomplex"* %tmp.6 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i16200 = getelementptr %"struct.std::dcomplex"* %mem_tmp.976, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i16201 = getelementptr %"struct.std::dcomplex"* %tmp.0.i16199, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i16202 = load double* %tmp.14.i16201 ; <double> [#uses=1]
- store double %tmp.15.i16202, double* %tmp.13.i16200
- %tmp.16.i16203 = getelementptr %"struct.std::dcomplex"* %mem_tmp.976, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i16204 = getelementptr %"struct.std::dcomplex"* %tmp.0.i16199, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i16205 = load double* %tmp.17.i16204 ; <double> [#uses=1]
- store double %tmp.18.i16205, double* %tmp.16.i16203
- %tmp.4.i16179 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i16178, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i16216, double* %tmp.4.i16179
- %tmp.7.i16182 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i16178, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i16219, double* %tmp.7.i16182
- %tmp.0.i16185 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i16178, %"struct.std::dcomplex"* %mem_tmp.976 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i16187 = getelementptr %"struct.std::dcomplex"* %tmp.0.i16185, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i16188 = load double* %tmp.14.i16187 ; <double> [#uses=1]
- %tmp.17.i16190 = getelementptr %"struct.std::dcomplex"* %tmp.0.i16185, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i16191 = load double* %tmp.17.i16190 ; <double> [#uses=1]
- %tmp.4.i16165 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i16164, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i16188, double* %tmp.4.i16165
- %tmp.7.i16168 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i16164, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i16191, double* %tmp.7.i16168
- %tmp.0.i16171 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i16164, %"struct.std::dcomplex"* %tmp.95 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i16172 = getelementptr %"struct.std::dcomplex"* %mem_tmp.973, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i16173 = getelementptr %"struct.std::dcomplex"* %tmp.0.i16171, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i16174 = load double* %tmp.14.i16173 ; <double> [#uses=1]
- store double %tmp.15.i16174, double* %tmp.13.i16172
- %tmp.16.i16175 = getelementptr %"struct.std::dcomplex"* %mem_tmp.973, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i16176 = getelementptr %"struct.std::dcomplex"* %tmp.0.i16171, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i16177 = load double* %tmp.17.i16176 ; <double> [#uses=1]
- store double %tmp.18.i16177, double* %tmp.16.i16175
- %tmp.4.i16151 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i16150, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i16230, double* %tmp.4.i16151
- %tmp.7.i16154 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i16150, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i16233, double* %tmp.7.i16154
- %tmp.0.i16157 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i16150, %"struct.std::dcomplex"* %mem_tmp.973 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i16159 = getelementptr %"struct.std::dcomplex"* %tmp.0.i16157, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i16160 = load double* %tmp.14.i16159 ; <double> [#uses=1]
- %tmp.17.i16162 = getelementptr %"struct.std::dcomplex"* %tmp.0.i16157, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i16163 = load double* %tmp.17.i16162 ; <double> [#uses=1]
- store double %tmp.15.i16160, double* %tmp.2.i34364
- store double %tmp.18.i16163, double* %tmp.6.i34365
- %tmp.4.i16117 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i16116, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i16119 = load double* %tmp.5.i27590 ; <double> [#uses=1]
- store double %tmp.6.i16119, double* %tmp.4.i16117
- %tmp.7.i16120 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i16116, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i16122 = load double* %tmp.8.i27593 ; <double> [#uses=1]
- store double %tmp.9.i16122, double* %tmp.7.i16120
- %tmp.0.i16123 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i16116, %"struct.std::dcomplex"* %ret3 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i16125 = getelementptr %"struct.std::dcomplex"* %tmp.0.i16123, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i16126 = load double* %tmp.14.i16125 ; <double> [#uses=1]
- %tmp.17.i16128 = getelementptr %"struct.std::dcomplex"* %tmp.0.i16123, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i16129 = load double* %tmp.17.i16128 ; <double> [#uses=1]
- %tmp.7.i16083 = load double* %tmp.2.i34366 ; <double> [#uses=1]
- %tmp.15.i16097 = add double %tmp.7.i16083, %tmp.15.i16126 ; <double> [#uses=1]
- store double %tmp.15.i16097, double* %tmp.2.i34366
- %tmp.26.i16104 = load double* %tmp.6.i34367 ; <double> [#uses=1]
- %tmp.31.i16115 = add double %tmp.26.i16104, %tmp.18.i16129 ; <double> [#uses=1]
- store double %tmp.31.i16115, double* %tmp.6.i34367
- %tmp.4.i16063 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i16062, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i16065 = load double* %tmp.5.i32136 ; <double> [#uses=1]
- store double %tmp.6.i16065, double* %tmp.4.i16063
- %tmp.7.i16066 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i16062, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i16068 = load double* %tmp.8.i32139 ; <double> [#uses=1]
- store double %tmp.9.i16068, double* %tmp.7.i16066
- %tmp.0.i16069 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i16062, %"struct.std::dcomplex"* %ret4 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i16071 = getelementptr %"struct.std::dcomplex"* %tmp.0.i16069, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i16072 = load double* %tmp.14.i16071 ; <double> [#uses=1]
- %tmp.17.i16074 = getelementptr %"struct.std::dcomplex"* %tmp.0.i16069, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i16075 = load double* %tmp.17.i16074 ; <double> [#uses=1]
- %tmp.7.i16029 = load double* %tmp.2.i34368 ; <double> [#uses=1]
- %tmp.15.i16043 = add double %tmp.7.i16029, %tmp.15.i16072 ; <double> [#uses=1]
- store double %tmp.15.i16043, double* %tmp.2.i34368
- %tmp.26.i16050 = load double* %tmp.6.i34369 ; <double> [#uses=1]
- %tmp.31.i16061 = add double %tmp.26.i16050, %tmp.18.i16075 ; <double> [#uses=1]
- store double %tmp.31.i16061, double* %tmp.6.i34369
- store double 0.000000e+00, double* %tmp.2.i34366
- store double 0.000000e+00, double* %tmp.6.i34367
- %tmp.4.i16007 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i16006, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i16009 = load double* %tmp.5.i33146 ; <double> [#uses=1]
- store double %tmp.6.i16009, double* %tmp.4.i16007
- %tmp.7.i16010 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i16006, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i16012 = load double* %tmp.8.i33149 ; <double> [#uses=1]
- store double %tmp.9.i16012, double* %tmp.7.i16010
- %tmp.0.i16013 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i16006, %"struct.std::dcomplex"* %tmp.12 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i16015 = getelementptr %"struct.std::dcomplex"* %tmp.0.i16013, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i16016 = load double* %tmp.14.i16015 ; <double> [#uses=1]
- %tmp.17.i16018 = getelementptr %"struct.std::dcomplex"* %tmp.0.i16013, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i16019 = load double* %tmp.17.i16018 ; <double> [#uses=1]
- %tmp.4.i15993 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i15992, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i15995 = load double* %tmp.5.i34352 ; <double> [#uses=1]
- store double %tmp.6.i15995, double* %tmp.4.i15993
- %tmp.7.i15996 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i15992, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i15998 = load double* %tmp.8.i34355 ; <double> [#uses=1]
- store double %tmp.9.i15998, double* %tmp.7.i15996
- %tmp.0.i15999 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i15992, %"struct.std::dcomplex"* %tmp.226 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i16000 = getelementptr %"struct.std::dcomplex"* %mem_tmp.984, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i16001 = getelementptr %"struct.std::dcomplex"* %tmp.0.i15999, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i16002 = load double* %tmp.14.i16001 ; <double> [#uses=1]
- store double %tmp.15.i16002, double* %tmp.13.i16000
- %tmp.16.i16003 = getelementptr %"struct.std::dcomplex"* %mem_tmp.984, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i16004 = getelementptr %"struct.std::dcomplex"* %tmp.0.i15999, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i16005 = load double* %tmp.17.i16004 ; <double> [#uses=1]
- store double %tmp.18.i16005, double* %tmp.16.i16003
- %tmp.4.i15979 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i15978, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i16016, double* %tmp.4.i15979
- %tmp.7.i15982 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i15978, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i16019, double* %tmp.7.i15982
- %tmp.0.i15985 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i15978, %"struct.std::dcomplex"* %mem_tmp.984 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i15987 = getelementptr %"struct.std::dcomplex"* %tmp.0.i15985, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i15988 = load double* %tmp.14.i15987 ; <double> [#uses=1]
- %tmp.17.i15990 = getelementptr %"struct.std::dcomplex"* %tmp.0.i15985, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i15991 = load double* %tmp.17.i15990 ; <double> [#uses=1]
- %tmp.4.i15965 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i15964, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i15988, double* %tmp.4.i15965
- %tmp.7.i15968 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i15964, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i15991, double* %tmp.7.i15968
- %tmp.0.i15971 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i15964, %"struct.std::dcomplex"* %tmp.95 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i15973 = getelementptr %"struct.std::dcomplex"* %tmp.0.i15971, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i15974 = load double* %tmp.14.i15973 ; <double> [#uses=1]
- %tmp.17.i15976 = getelementptr %"struct.std::dcomplex"* %tmp.0.i15971, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i15977 = load double* %tmp.17.i15976 ; <double> [#uses=1]
- %tmp.4.i15951 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i15950, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i15953 = load double* %tmp.5.i34352 ; <double> [#uses=1]
- store double %tmp.6.i15953, double* %tmp.4.i15951
- %tmp.7.i15954 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i15950, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i15956 = load double* %tmp.8.i34355 ; <double> [#uses=1]
- store double %tmp.9.i15956, double* %tmp.7.i15954
- %tmp.0.i15957 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i15950, %"struct.std::dcomplex"* %tmp.62 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i15959 = getelementptr %"struct.std::dcomplex"* %tmp.0.i15957, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i15960 = load double* %tmp.14.i15959 ; <double> [#uses=1]
- %tmp.17.i15962 = getelementptr %"struct.std::dcomplex"* %tmp.0.i15957, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i15963 = load double* %tmp.17.i15962 ; <double> [#uses=1]
- %tmp.4.i15937 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i15936, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i15939 = load double* %tmp.5.i34082 ; <double> [#uses=1]
- store double %tmp.6.i15939, double* %tmp.4.i15937
- %tmp.7.i15940 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i15936, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i15942 = load double* %tmp.8.i34085 ; <double> [#uses=1]
- store double %tmp.9.i15942, double* %tmp.7.i15940
- %tmp.0.i15943 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i15936, %"struct.std::dcomplex"* %tmp.12 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i15944 = getelementptr %"struct.std::dcomplex"* %mem_tmp.988, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i15945 = getelementptr %"struct.std::dcomplex"* %tmp.0.i15943, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i15946 = load double* %tmp.14.i15945 ; <double> [#uses=1]
- store double %tmp.15.i15946, double* %tmp.13.i15944
- %tmp.16.i15947 = getelementptr %"struct.std::dcomplex"* %mem_tmp.988, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i15948 = getelementptr %"struct.std::dcomplex"* %tmp.0.i15943, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i15949 = load double* %tmp.17.i15948 ; <double> [#uses=1]
- store double %tmp.18.i15949, double* %tmp.16.i15947
- %tmp.4.i15923 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i15922, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i15960, double* %tmp.4.i15923
- %tmp.7.i15926 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i15922, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i15963, double* %tmp.7.i15926
- %tmp.0.i15929 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i15922, %"struct.std::dcomplex"* %mem_tmp.988 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i15931 = getelementptr %"struct.std::dcomplex"* %tmp.0.i15929, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i15932 = load double* %tmp.14.i15931 ; <double> [#uses=1]
- %tmp.17.i15934 = getelementptr %"struct.std::dcomplex"* %tmp.0.i15929, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i15935 = load double* %tmp.17.i15934 ; <double> [#uses=1]
- %tmp.4.i15909 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i15908, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i15932, double* %tmp.4.i15909
- %tmp.7.i15912 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i15908, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i15935, double* %tmp.7.i15912
- %tmp.0.i15915 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i15908, %"struct.std::dcomplex"* %tmp.220 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i15916 = getelementptr %"struct.std::dcomplex"* %mem_tmp.985, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i15917 = getelementptr %"struct.std::dcomplex"* %tmp.0.i15915, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i15918 = load double* %tmp.14.i15917 ; <double> [#uses=1]
- store double %tmp.15.i15918, double* %tmp.13.i15916
- %tmp.16.i15919 = getelementptr %"struct.std::dcomplex"* %mem_tmp.985, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i15920 = getelementptr %"struct.std::dcomplex"* %tmp.0.i15915, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i15921 = load double* %tmp.17.i15920 ; <double> [#uses=1]
- store double %tmp.18.i15921, double* %tmp.16.i15919
- %tmp.4.i15895 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i15894, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i15974, double* %tmp.4.i15895
- %tmp.7.i15898 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i15894, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i15977, double* %tmp.7.i15898
- %tmp.0.i15901 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i15894, %"struct.std::dcomplex"* %mem_tmp.985 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i15903 = getelementptr %"struct.std::dcomplex"* %tmp.0.i15901, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i15904 = load double* %tmp.14.i15903 ; <double> [#uses=1]
- %tmp.17.i15906 = getelementptr %"struct.std::dcomplex"* %tmp.0.i15901, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i15907 = load double* %tmp.17.i15906 ; <double> [#uses=1]
- %tmp.4.i15881 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i15880, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i15883 = load double* %tmp.5.i34082 ; <double> [#uses=1]
- store double %tmp.6.i15883, double* %tmp.4.i15881
- %tmp.7.i15884 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i15880, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i15886 = load double* %tmp.8.i34085 ; <double> [#uses=1]
- store double %tmp.9.i15886, double* %tmp.7.i15884
- %tmp.0.i15887 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i15880, %"struct.std::dcomplex"* %tmp.226 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i15889 = getelementptr %"struct.std::dcomplex"* %tmp.0.i15887, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i15890 = load double* %tmp.14.i15889 ; <double> [#uses=1]
- %tmp.17.i15892 = getelementptr %"struct.std::dcomplex"* %tmp.0.i15887, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i15893 = load double* %tmp.17.i15892 ; <double> [#uses=1]
- %tmp.4.i15867 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i15866, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i15869 = load double* %tmp.5.i33146 ; <double> [#uses=1]
- store double %tmp.6.i15869, double* %tmp.4.i15867
- %tmp.7.i15870 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i15866, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i15872 = load double* %tmp.8.i33149 ; <double> [#uses=1]
- store double %tmp.9.i15872, double* %tmp.7.i15870
- %tmp.0.i15873 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i15866, %"struct.std::dcomplex"* %tmp.62 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i15874 = getelementptr %"struct.std::dcomplex"* %mem_tmp.992, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i15875 = getelementptr %"struct.std::dcomplex"* %tmp.0.i15873, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i15876 = load double* %tmp.14.i15875 ; <double> [#uses=1]
- store double %tmp.15.i15876, double* %tmp.13.i15874
- %tmp.16.i15877 = getelementptr %"struct.std::dcomplex"* %mem_tmp.992, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i15878 = getelementptr %"struct.std::dcomplex"* %tmp.0.i15873, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i15879 = load double* %tmp.17.i15878 ; <double> [#uses=1]
- store double %tmp.18.i15879, double* %tmp.16.i15877
- %tmp.4.i15853 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i15852, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i15890, double* %tmp.4.i15853
- %tmp.7.i15856 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i15852, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i15893, double* %tmp.7.i15856
- %tmp.0.i15859 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i15852, %"struct.std::dcomplex"* %mem_tmp.992 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i15861 = getelementptr %"struct.std::dcomplex"* %tmp.0.i15859, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i15862 = load double* %tmp.14.i15861 ; <double> [#uses=1]
- %tmp.17.i15864 = getelementptr %"struct.std::dcomplex"* %tmp.0.i15859, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i15865 = load double* %tmp.17.i15864 ; <double> [#uses=1]
- %tmp.4.i15839 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i15838, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i15862, double* %tmp.4.i15839
- %tmp.7.i15842 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i15838, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i15865, double* %tmp.7.i15842
- %tmp.0.i15845 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i15838, %"struct.std::dcomplex"* %tmp.30 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i15846 = getelementptr %"struct.std::dcomplex"* %mem_tmp.989, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i15847 = getelementptr %"struct.std::dcomplex"* %tmp.0.i15845, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i15848 = load double* %tmp.14.i15847 ; <double> [#uses=1]
- store double %tmp.15.i15848, double* %tmp.13.i15846
- %tmp.16.i15849 = getelementptr %"struct.std::dcomplex"* %mem_tmp.989, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i15850 = getelementptr %"struct.std::dcomplex"* %tmp.0.i15845, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i15851 = load double* %tmp.17.i15850 ; <double> [#uses=1]
- store double %tmp.18.i15851, double* %tmp.16.i15849
- %tmp.4.i15825 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i15824, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i15904, double* %tmp.4.i15825
- %tmp.7.i15828 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i15824, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i15907, double* %tmp.7.i15828
- %tmp.0.i15831 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i15824, %"struct.std::dcomplex"* %mem_tmp.989 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i15833 = getelementptr %"struct.std::dcomplex"* %tmp.0.i15831, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i15834 = load double* %tmp.14.i15833 ; <double> [#uses=1]
- %tmp.17.i15836 = getelementptr %"struct.std::dcomplex"* %tmp.0.i15831, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i15837 = load double* %tmp.17.i15836 ; <double> [#uses=1]
- store double %tmp.15.i15834, double* %tmp.2.i34364
- store double %tmp.18.i15837, double* %tmp.6.i34365
- %tmp.4.i15791 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i15790, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i15793 = load double* %tmp.5.i27590 ; <double> [#uses=1]
- store double %tmp.6.i15793, double* %tmp.4.i15791
- %tmp.7.i15794 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i15790, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i15796 = load double* %tmp.8.i27593 ; <double> [#uses=1]
- store double %tmp.9.i15796, double* %tmp.7.i15794
- %tmp.0.i15797 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i15790, %"struct.std::dcomplex"* %ret3 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i15799 = getelementptr %"struct.std::dcomplex"* %tmp.0.i15797, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i15800 = load double* %tmp.14.i15799 ; <double> [#uses=1]
- %tmp.17.i15802 = getelementptr %"struct.std::dcomplex"* %tmp.0.i15797, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i15803 = load double* %tmp.17.i15802 ; <double> [#uses=1]
- %tmp.7.i15757 = load double* %tmp.2.i34366 ; <double> [#uses=1]
- %tmp.15.i15771 = add double %tmp.7.i15757, %tmp.15.i15800 ; <double> [#uses=1]
- store double %tmp.15.i15771, double* %tmp.2.i34366
- %tmp.26.i15778 = load double* %tmp.6.i34367 ; <double> [#uses=1]
- %tmp.31.i15789 = add double %tmp.26.i15778, %tmp.18.i15803 ; <double> [#uses=1]
- store double %tmp.31.i15789, double* %tmp.6.i34367
- %tmp.4.i15737 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i15736, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i15739 = load double* %tmp.5.i33146 ; <double> [#uses=1]
- store double %tmp.6.i15739, double* %tmp.4.i15737
- %tmp.7.i15740 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i15736, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i15742 = load double* %tmp.8.i33149 ; <double> [#uses=1]
- store double %tmp.9.i15742, double* %tmp.7.i15740
- %tmp.0.i15743 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i15736, %"struct.std::dcomplex"* %tmp.62 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i15745 = getelementptr %"struct.std::dcomplex"* %tmp.0.i15743, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i15746 = load double* %tmp.14.i15745 ; <double> [#uses=1]
- %tmp.17.i15748 = getelementptr %"struct.std::dcomplex"* %tmp.0.i15743, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i15749 = load double* %tmp.17.i15748 ; <double> [#uses=1]
- %tmp.4.i15723 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i15722, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i15725 = load double* %tmp.5.i34082 ; <double> [#uses=1]
- store double %tmp.6.i15725, double* %tmp.4.i15723
- %tmp.7.i15726 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i15722, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i15728 = load double* %tmp.8.i34085 ; <double> [#uses=1]
- store double %tmp.9.i15728, double* %tmp.7.i15726
- %tmp.0.i15729 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i15722, %"struct.std::dcomplex"* %tmp.226 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i15730 = getelementptr %"struct.std::dcomplex"* %mem_tmp.999, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i15731 = getelementptr %"struct.std::dcomplex"* %tmp.0.i15729, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i15732 = load double* %tmp.14.i15731 ; <double> [#uses=1]
- store double %tmp.15.i15732, double* %tmp.13.i15730
- %tmp.16.i15733 = getelementptr %"struct.std::dcomplex"* %mem_tmp.999, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i15734 = getelementptr %"struct.std::dcomplex"* %tmp.0.i15729, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i15735 = load double* %tmp.17.i15734 ; <double> [#uses=1]
- store double %tmp.18.i15735, double* %tmp.16.i15733
- %tmp.4.i15709 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i15708, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i15746, double* %tmp.4.i15709
- %tmp.7.i15712 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i15708, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i15749, double* %tmp.7.i15712
- %tmp.0.i15715 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i15708, %"struct.std::dcomplex"* %mem_tmp.999 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i15717 = getelementptr %"struct.std::dcomplex"* %tmp.0.i15715, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i15718 = load double* %tmp.14.i15717 ; <double> [#uses=1]
- %tmp.17.i15720 = getelementptr %"struct.std::dcomplex"* %tmp.0.i15715, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i15721 = load double* %tmp.17.i15720 ; <double> [#uses=1]
- %tmp.4.i15695 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i15694, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i15718, double* %tmp.4.i15695
- %tmp.7.i15698 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i15694, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i15721, double* %tmp.7.i15698
- %tmp.0.i15701 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i15694, %"struct.std::dcomplex"* %tmp.1075 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i15703 = getelementptr %"struct.std::dcomplex"* %tmp.0.i15701, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i15704 = load double* %tmp.14.i15703 ; <double> [#uses=1]
- %tmp.17.i15706 = getelementptr %"struct.std::dcomplex"* %tmp.0.i15701, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i15707 = load double* %tmp.17.i15706 ; <double> [#uses=1]
- %tmp.4.i15681 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i15680, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i15683 = load double* %tmp.5.i28602 ; <double> [#uses=1]
- store double %tmp.6.i15683, double* %tmp.4.i15681
- %tmp.7.i15684 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i15680, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i15686 = load double* %tmp.8.i28605 ; <double> [#uses=1]
- store double %tmp.9.i15686, double* %tmp.7.i15684
- %tmp.0.i15687 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i15680, %"struct.std::dcomplex"* %tmp.226 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i15689 = getelementptr %"struct.std::dcomplex"* %tmp.0.i15687, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i15690 = load double* %tmp.14.i15689 ; <double> [#uses=1]
- %tmp.17.i15692 = getelementptr %"struct.std::dcomplex"* %tmp.0.i15687, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i15693 = load double* %tmp.17.i15692 ; <double> [#uses=1]
- %tmp.4.i15667 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i15666, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i15669 = load double* %tmp.5.i33146 ; <double> [#uses=1]
- store double %tmp.6.i15669, double* %tmp.4.i15667
- %tmp.7.i15670 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i15666, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i15672 = load double* %tmp.8.i33149 ; <double> [#uses=1]
- store double %tmp.9.i15672, double* %tmp.7.i15670
- %tmp.0.i15673 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i15666, %"struct.std::dcomplex"* %tmp.1036 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i15674 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1003, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i15675 = getelementptr %"struct.std::dcomplex"* %tmp.0.i15673, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i15676 = load double* %tmp.14.i15675 ; <double> [#uses=1]
- store double %tmp.15.i15676, double* %tmp.13.i15674
- %tmp.16.i15677 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1003, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i15678 = getelementptr %"struct.std::dcomplex"* %tmp.0.i15673, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i15679 = load double* %tmp.17.i15678 ; <double> [#uses=1]
- store double %tmp.18.i15679, double* %tmp.16.i15677
- %tmp.4.i15653 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i15652, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i15690, double* %tmp.4.i15653
- %tmp.7.i15656 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i15652, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i15693, double* %tmp.7.i15656
- %tmp.0.i15659 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i15652, %"struct.std::dcomplex"* %mem_tmp.1003 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i15661 = getelementptr %"struct.std::dcomplex"* %tmp.0.i15659, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i15662 = load double* %tmp.14.i15661 ; <double> [#uses=1]
- %tmp.17.i15664 = getelementptr %"struct.std::dcomplex"* %tmp.0.i15659, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i15665 = load double* %tmp.17.i15664 ; <double> [#uses=1]
- %tmp.4.i15639 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i15638, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i15662, double* %tmp.4.i15639
- %tmp.7.i15642 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i15638, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i15665, double* %tmp.7.i15642
- %tmp.0.i15645 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i15638, %"struct.std::dcomplex"* %tmp.95 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i15646 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1000, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i15647 = getelementptr %"struct.std::dcomplex"* %tmp.0.i15645, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i15648 = load double* %tmp.14.i15647 ; <double> [#uses=1]
- store double %tmp.15.i15648, double* %tmp.13.i15646
- %tmp.16.i15649 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1000, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i15650 = getelementptr %"struct.std::dcomplex"* %tmp.0.i15645, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i15651 = load double* %tmp.17.i15650 ; <double> [#uses=1]
- store double %tmp.18.i15651, double* %tmp.16.i15649
- %tmp.4.i15625 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i15624, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i15704, double* %tmp.4.i15625
- %tmp.7.i15628 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i15624, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i15707, double* %tmp.7.i15628
- %tmp.0.i15631 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i15624, %"struct.std::dcomplex"* %mem_tmp.1000 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i15633 = getelementptr %"struct.std::dcomplex"* %tmp.0.i15631, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i15634 = load double* %tmp.14.i15633 ; <double> [#uses=1]
- %tmp.17.i15636 = getelementptr %"struct.std::dcomplex"* %tmp.0.i15631, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i15637 = load double* %tmp.17.i15636 ; <double> [#uses=1]
- %tmp.4.i15611 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i15610, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i15613 = load double* %tmp.5.i34082 ; <double> [#uses=1]
- store double %tmp.6.i15613, double* %tmp.4.i15611
- %tmp.7.i15614 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i15610, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i15616 = load double* %tmp.8.i34085 ; <double> [#uses=1]
- store double %tmp.9.i15616, double* %tmp.7.i15614
- %tmp.0.i15617 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i15610, %"struct.std::dcomplex"* %tmp.1036 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i15619 = getelementptr %"struct.std::dcomplex"* %tmp.0.i15617, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i15620 = load double* %tmp.14.i15619 ; <double> [#uses=1]
- %tmp.17.i15622 = getelementptr %"struct.std::dcomplex"* %tmp.0.i15617, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i15623 = load double* %tmp.17.i15622 ; <double> [#uses=1]
- %tmp.4.i15597 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i15596, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i15599 = load double* %tmp.5.i28602 ; <double> [#uses=1]
- store double %tmp.6.i15599, double* %tmp.4.i15597
- %tmp.7.i15600 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i15596, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i15602 = load double* %tmp.8.i28605 ; <double> [#uses=1]
- store double %tmp.9.i15602, double* %tmp.7.i15600
- %tmp.0.i15603 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i15596, %"struct.std::dcomplex"* %tmp.62 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i15604 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1007, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i15605 = getelementptr %"struct.std::dcomplex"* %tmp.0.i15603, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i15606 = load double* %tmp.14.i15605 ; <double> [#uses=1]
- store double %tmp.15.i15606, double* %tmp.13.i15604
- %tmp.16.i15607 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1007, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i15608 = getelementptr %"struct.std::dcomplex"* %tmp.0.i15603, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i15609 = load double* %tmp.17.i15608 ; <double> [#uses=1]
- store double %tmp.18.i15609, double* %tmp.16.i15607
- %tmp.4.i15583 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i15582, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i15620, double* %tmp.4.i15583
- %tmp.7.i15586 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i15582, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i15623, double* %tmp.7.i15586
- %tmp.0.i15589 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i15582, %"struct.std::dcomplex"* %mem_tmp.1007 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i15591 = getelementptr %"struct.std::dcomplex"* %tmp.0.i15589, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i15592 = load double* %tmp.14.i15591 ; <double> [#uses=1]
- %tmp.17.i15594 = getelementptr %"struct.std::dcomplex"* %tmp.0.i15589, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i15595 = load double* %tmp.17.i15594 ; <double> [#uses=1]
- %tmp.4.i15569 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i15568, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i15592, double* %tmp.4.i15569
- %tmp.7.i15572 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i15568, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i15595, double* %tmp.7.i15572
- %tmp.0.i15575 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i15568, %"struct.std::dcomplex"* %tmp.220 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i15576 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1004, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i15577 = getelementptr %"struct.std::dcomplex"* %tmp.0.i15575, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i15578 = load double* %tmp.14.i15577 ; <double> [#uses=1]
- store double %tmp.15.i15578, double* %tmp.13.i15576
- %tmp.16.i15579 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1004, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i15580 = getelementptr %"struct.std::dcomplex"* %tmp.0.i15575, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i15581 = load double* %tmp.17.i15580 ; <double> [#uses=1]
- store double %tmp.18.i15581, double* %tmp.16.i15579
- %tmp.4.i15555 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i15554, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i15634, double* %tmp.4.i15555
- %tmp.7.i15558 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i15554, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i15637, double* %tmp.7.i15558
- %tmp.0.i15561 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i15554, %"struct.std::dcomplex"* %mem_tmp.1004 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i15563 = getelementptr %"struct.std::dcomplex"* %tmp.0.i15561, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i15564 = load double* %tmp.14.i15563 ; <double> [#uses=1]
- %tmp.17.i15566 = getelementptr %"struct.std::dcomplex"* %tmp.0.i15561, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i15567 = load double* %tmp.17.i15566 ; <double> [#uses=1]
- store double %tmp.15.i15564, double* %tmp.2.i34364
- store double %tmp.18.i15567, double* %tmp.6.i34365
- %tmp.4.i15521 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i15520, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i15523 = load double* %tmp.5.i33866 ; <double> [#uses=1]
- store double %tmp.6.i15523, double* %tmp.4.i15521
- %tmp.7.i15524 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i15520, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i15526 = load double* %tmp.8.i33869 ; <double> [#uses=1]
- store double %tmp.9.i15526, double* %tmp.7.i15524
- %tmp.0.i15527 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i15520, %"struct.std::dcomplex"* %ret3 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i15529 = getelementptr %"struct.std::dcomplex"* %tmp.0.i15527, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i15530 = load double* %tmp.14.i15529 ; <double> [#uses=1]
- %tmp.17.i15532 = getelementptr %"struct.std::dcomplex"* %tmp.0.i15527, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i15533 = load double* %tmp.17.i15532 ; <double> [#uses=1]
- %tmp.7.i15487 = load double* %tmp.2.i34366 ; <double> [#uses=1]
- %tmp.15.i15501 = add double %tmp.7.i15487, %tmp.15.i15530 ; <double> [#uses=1]
- store double %tmp.15.i15501, double* %tmp.2.i34366
- %tmp.26.i15508 = load double* %tmp.6.i34367 ; <double> [#uses=1]
- %tmp.31.i15519 = add double %tmp.26.i15508, %tmp.18.i15533 ; <double> [#uses=1]
- store double %tmp.31.i15519, double* %tmp.6.i34367
- %tmp.4.i15467 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i15466, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i15469 = load double* %tmp.5.i28602 ; <double> [#uses=1]
- store double %tmp.6.i15469, double* %tmp.4.i15467
- %tmp.7.i15470 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i15466, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i15472 = load double* %tmp.8.i28605 ; <double> [#uses=1]
- store double %tmp.9.i15472, double* %tmp.7.i15470
- %tmp.0.i15473 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i15466, %"struct.std::dcomplex"* %tmp.12 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i15475 = getelementptr %"struct.std::dcomplex"* %tmp.0.i15473, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i15476 = load double* %tmp.14.i15475 ; <double> [#uses=1]
- %tmp.17.i15478 = getelementptr %"struct.std::dcomplex"* %tmp.0.i15473, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i15479 = load double* %tmp.17.i15478 ; <double> [#uses=1]
- %tmp.4.i15453 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i15452, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i15455 = load double* %tmp.5.i34352 ; <double> [#uses=1]
- store double %tmp.6.i15455, double* %tmp.4.i15453
- %tmp.7.i15456 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i15452, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i15458 = load double* %tmp.8.i34355 ; <double> [#uses=1]
- store double %tmp.9.i15458, double* %tmp.7.i15456
- %tmp.0.i15459 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i15452, %"struct.std::dcomplex"* %tmp.1036 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i15460 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1014, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i15461 = getelementptr %"struct.std::dcomplex"* %tmp.0.i15459, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i15462 = load double* %tmp.14.i15461 ; <double> [#uses=1]
- store double %tmp.15.i15462, double* %tmp.13.i15460
- %tmp.16.i15463 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1014, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i15464 = getelementptr %"struct.std::dcomplex"* %tmp.0.i15459, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i15465 = load double* %tmp.17.i15464 ; <double> [#uses=1]
- store double %tmp.18.i15465, double* %tmp.16.i15463
- %tmp.4.i15439 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i15438, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i15476, double* %tmp.4.i15439
- %tmp.7.i15442 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i15438, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i15479, double* %tmp.7.i15442
- %tmp.0.i15445 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i15438, %"struct.std::dcomplex"* %mem_tmp.1014 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i15447 = getelementptr %"struct.std::dcomplex"* %tmp.0.i15445, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i15448 = load double* %tmp.14.i15447 ; <double> [#uses=1]
- %tmp.17.i15450 = getelementptr %"struct.std::dcomplex"* %tmp.0.i15445, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i15451 = load double* %tmp.17.i15450 ; <double> [#uses=1]
- %tmp.4.i15425 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i15424, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i15448, double* %tmp.4.i15425
- %tmp.7.i15428 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i15424, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i15451, double* %tmp.7.i15428
- %tmp.0.i15431 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i15424, %"struct.std::dcomplex"* %tmp.220 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i15433 = getelementptr %"struct.std::dcomplex"* %tmp.0.i15431, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i15434 = load double* %tmp.14.i15433 ; <double> [#uses=1]
- %tmp.17.i15436 = getelementptr %"struct.std::dcomplex"* %tmp.0.i15431, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i15437 = load double* %tmp.17.i15436 ; <double> [#uses=1]
- %tmp.4.i15411 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i15410, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i15413 = load double* %tmp.5.i34352 ; <double> [#uses=1]
- store double %tmp.6.i15413, double* %tmp.4.i15411
- %tmp.7.i15414 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i15410, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i15416 = load double* %tmp.8.i34355 ; <double> [#uses=1]
- store double %tmp.9.i15416, double* %tmp.7.i15414
- %tmp.0.i15417 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i15410, %"struct.std::dcomplex"* %tmp.226 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i15419 = getelementptr %"struct.std::dcomplex"* %tmp.0.i15417, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i15420 = load double* %tmp.14.i15419 ; <double> [#uses=1]
- %tmp.17.i15422 = getelementptr %"struct.std::dcomplex"* %tmp.0.i15417, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i15423 = load double* %tmp.17.i15422 ; <double> [#uses=1]
- %tmp.4.i15397 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i15396, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i15399 = load double* %tmp.5.i33146 ; <double> [#uses=1]
- store double %tmp.6.i15399, double* %tmp.4.i15397
- %tmp.7.i15400 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i15396, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i15402 = load double* %tmp.8.i33149 ; <double> [#uses=1]
- store double %tmp.9.i15402, double* %tmp.7.i15400
- %tmp.0.i15403 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i15396, %"struct.std::dcomplex"* %tmp.12 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i15404 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1018, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i15405 = getelementptr %"struct.std::dcomplex"* %tmp.0.i15403, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i15406 = load double* %tmp.14.i15405 ; <double> [#uses=1]
- store double %tmp.15.i15406, double* %tmp.13.i15404
- %tmp.16.i15407 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1018, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i15408 = getelementptr %"struct.std::dcomplex"* %tmp.0.i15403, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i15409 = load double* %tmp.17.i15408 ; <double> [#uses=1]
- store double %tmp.18.i15409, double* %tmp.16.i15407
- %tmp.4.i15383 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i15382, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i15420, double* %tmp.4.i15383
- %tmp.7.i15386 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i15382, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i15423, double* %tmp.7.i15386
- %tmp.0.i15389 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i15382, %"struct.std::dcomplex"* %mem_tmp.1018 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i15391 = getelementptr %"struct.std::dcomplex"* %tmp.0.i15389, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i15392 = load double* %tmp.14.i15391 ; <double> [#uses=1]
- %tmp.17.i15394 = getelementptr %"struct.std::dcomplex"* %tmp.0.i15389, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i15395 = load double* %tmp.17.i15394 ; <double> [#uses=1]
- %tmp.4.i15369 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i15368, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i15392, double* %tmp.4.i15369
- %tmp.7.i15372 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i15368, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i15395, double* %tmp.7.i15372
- %tmp.0.i15375 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i15368, %"struct.std::dcomplex"* %tmp.1075 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i15376 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1015, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i15377 = getelementptr %"struct.std::dcomplex"* %tmp.0.i15375, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i15378 = load double* %tmp.14.i15377 ; <double> [#uses=1]
- store double %tmp.15.i15378, double* %tmp.13.i15376
- %tmp.16.i15379 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1015, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i15380 = getelementptr %"struct.std::dcomplex"* %tmp.0.i15375, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i15381 = load double* %tmp.17.i15380 ; <double> [#uses=1]
- store double %tmp.18.i15381, double* %tmp.16.i15379
- %tmp.4.i15355 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i15354, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i15434, double* %tmp.4.i15355
- %tmp.7.i15358 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i15354, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i15437, double* %tmp.7.i15358
- %tmp.0.i15361 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i15354, %"struct.std::dcomplex"* %mem_tmp.1015 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i15363 = getelementptr %"struct.std::dcomplex"* %tmp.0.i15361, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i15364 = load double* %tmp.14.i15363 ; <double> [#uses=1]
- %tmp.17.i15366 = getelementptr %"struct.std::dcomplex"* %tmp.0.i15361, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i15367 = load double* %tmp.17.i15366 ; <double> [#uses=1]
- %tmp.4.i15341 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i15340, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i15343 = load double* %tmp.5.i33146 ; <double> [#uses=1]
- store double %tmp.6.i15343, double* %tmp.4.i15341
- %tmp.7.i15344 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i15340, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i15346 = load double* %tmp.8.i33149 ; <double> [#uses=1]
- store double %tmp.9.i15346, double* %tmp.7.i15344
- %tmp.0.i15347 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i15340, %"struct.std::dcomplex"* %tmp.1036 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i15349 = getelementptr %"struct.std::dcomplex"* %tmp.0.i15347, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i15350 = load double* %tmp.14.i15349 ; <double> [#uses=1]
- %tmp.17.i15352 = getelementptr %"struct.std::dcomplex"* %tmp.0.i15347, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i15353 = load double* %tmp.17.i15352 ; <double> [#uses=1]
- %tmp.4.i15327 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i15326, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i15329 = load double* %tmp.5.i28602 ; <double> [#uses=1]
- store double %tmp.6.i15329, double* %tmp.4.i15327
- %tmp.7.i15330 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i15326, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i15332 = load double* %tmp.8.i28605 ; <double> [#uses=1]
- store double %tmp.9.i15332, double* %tmp.7.i15330
- %tmp.0.i15333 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i15326, %"struct.std::dcomplex"* %tmp.226 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i15334 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1022, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i15335 = getelementptr %"struct.std::dcomplex"* %tmp.0.i15333, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i15336 = load double* %tmp.14.i15335 ; <double> [#uses=1]
- store double %tmp.15.i15336, double* %tmp.13.i15334
- %tmp.16.i15337 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1022, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i15338 = getelementptr %"struct.std::dcomplex"* %tmp.0.i15333, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i15339 = load double* %tmp.17.i15338 ; <double> [#uses=1]
- store double %tmp.18.i15339, double* %tmp.16.i15337
- %tmp.4.i15313 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i15312, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i15350, double* %tmp.4.i15313
- %tmp.7.i15316 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i15312, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i15353, double* %tmp.7.i15316
- %tmp.0.i15319 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i15312, %"struct.std::dcomplex"* %mem_tmp.1022 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i15321 = getelementptr %"struct.std::dcomplex"* %tmp.0.i15319, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i15322 = load double* %tmp.14.i15321 ; <double> [#uses=1]
- %tmp.17.i15324 = getelementptr %"struct.std::dcomplex"* %tmp.0.i15319, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i15325 = load double* %tmp.17.i15324 ; <double> [#uses=1]
- %tmp.4.i15299 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i15298, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i15322, double* %tmp.4.i15299
- %tmp.7.i15302 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i15298, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i15325, double* %tmp.7.i15302
- %tmp.0.i15305 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i15298, %"struct.std::dcomplex"* %tmp.30 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i15306 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1019, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i15307 = getelementptr %"struct.std::dcomplex"* %tmp.0.i15305, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i15308 = load double* %tmp.14.i15307 ; <double> [#uses=1]
- store double %tmp.15.i15308, double* %tmp.13.i15306
- %tmp.16.i15309 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1019, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i15310 = getelementptr %"struct.std::dcomplex"* %tmp.0.i15305, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i15311 = load double* %tmp.17.i15310 ; <double> [#uses=1]
- store double %tmp.18.i15311, double* %tmp.16.i15309
- %tmp.4.i15285 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i15284, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i15364, double* %tmp.4.i15285
- %tmp.7.i15288 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i15284, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i15367, double* %tmp.7.i15288
- %tmp.0.i15291 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i15284, %"struct.std::dcomplex"* %mem_tmp.1019 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i15293 = getelementptr %"struct.std::dcomplex"* %tmp.0.i15291, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i15294 = load double* %tmp.14.i15293 ; <double> [#uses=1]
- %tmp.17.i15296 = getelementptr %"struct.std::dcomplex"* %tmp.0.i15291, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i15297 = load double* %tmp.17.i15296 ; <double> [#uses=1]
- store double %tmp.15.i15294, double* %tmp.2.i34364
- store double %tmp.18.i15297, double* %tmp.6.i34365
- %tmp.4.i15251 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i15250, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i15253 = load double* %tmp.5.i34136 ; <double> [#uses=1]
- store double %tmp.6.i15253, double* %tmp.4.i15251
- %tmp.7.i15254 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i15250, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i15256 = load double* %tmp.8.i34139 ; <double> [#uses=1]
- store double %tmp.9.i15256, double* %tmp.7.i15254
- %tmp.0.i15257 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i15250, %"struct.std::dcomplex"* %ret3 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i15259 = getelementptr %"struct.std::dcomplex"* %tmp.0.i15257, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i15260 = load double* %tmp.14.i15259 ; <double> [#uses=1]
- %tmp.17.i15262 = getelementptr %"struct.std::dcomplex"* %tmp.0.i15257, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i15263 = load double* %tmp.17.i15262 ; <double> [#uses=1]
- %tmp.7.i15217 = load double* %tmp.2.i34366 ; <double> [#uses=1]
- %tmp.15.i15231 = add double %tmp.7.i15217, %tmp.15.i15260 ; <double> [#uses=1]
- store double %tmp.15.i15231, double* %tmp.2.i34366
- %tmp.26.i15238 = load double* %tmp.6.i34367 ; <double> [#uses=1]
- %tmp.31.i15249 = add double %tmp.26.i15238, %tmp.18.i15263 ; <double> [#uses=1]
- store double %tmp.31.i15249, double* %tmp.6.i34367
- %tmp.4.i15197 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i15196, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i15199 = load double* %tmp.5.i28602 ; <double> [#uses=1]
- store double %tmp.6.i15199, double* %tmp.4.i15197
- %tmp.7.i15200 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i15196, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i15202 = load double* %tmp.8.i28605 ; <double> [#uses=1]
- store double %tmp.9.i15202, double* %tmp.7.i15200
- %tmp.0.i15203 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i15196, %"struct.std::dcomplex"* %tmp.62 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i15205 = getelementptr %"struct.std::dcomplex"* %tmp.0.i15203, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i15206 = load double* %tmp.14.i15205 ; <double> [#uses=1]
- %tmp.17.i15208 = getelementptr %"struct.std::dcomplex"* %tmp.0.i15203, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i15209 = load double* %tmp.17.i15208 ; <double> [#uses=1]
- %tmp.4.i15183 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i15182, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i15185 = load double* %tmp.5.i34082 ; <double> [#uses=1]
- store double %tmp.6.i15185, double* %tmp.4.i15183
- %tmp.7.i15186 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i15182, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i15188 = load double* %tmp.8.i34085 ; <double> [#uses=1]
- store double %tmp.9.i15188, double* %tmp.7.i15186
- %tmp.0.i15189 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i15182, %"struct.std::dcomplex"* %tmp.1036 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i15190 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1029, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i15191 = getelementptr %"struct.std::dcomplex"* %tmp.0.i15189, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i15192 = load double* %tmp.14.i15191 ; <double> [#uses=1]
- store double %tmp.15.i15192, double* %tmp.13.i15190
- %tmp.16.i15193 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1029, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i15194 = getelementptr %"struct.std::dcomplex"* %tmp.0.i15189, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i15195 = load double* %tmp.17.i15194 ; <double> [#uses=1]
- store double %tmp.18.i15195, double* %tmp.16.i15193
- %tmp.4.i15169 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i15168, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i15206, double* %tmp.4.i15169
- %tmp.7.i15172 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i15168, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i15209, double* %tmp.7.i15172
- %tmp.0.i15175 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i15168, %"struct.std::dcomplex"* %mem_tmp.1029 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i15177 = getelementptr %"struct.std::dcomplex"* %tmp.0.i15175, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i15178 = load double* %tmp.14.i15177 ; <double> [#uses=1]
- %tmp.17.i15180 = getelementptr %"struct.std::dcomplex"* %tmp.0.i15175, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i15181 = load double* %tmp.17.i15180 ; <double> [#uses=1]
- %tmp.4.i15155 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i15154, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i15178, double* %tmp.4.i15155
- %tmp.7.i15158 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i15154, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i15181, double* %tmp.7.i15158
- %tmp.0.i15161 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i15154, %"struct.std::dcomplex"* %tmp.30 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i15163 = getelementptr %"struct.std::dcomplex"* %tmp.0.i15161, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i15164 = load double* %tmp.14.i15163 ; <double> [#uses=1]
- %tmp.17.i15166 = getelementptr %"struct.std::dcomplex"* %tmp.0.i15161, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i15167 = load double* %tmp.17.i15166 ; <double> [#uses=1]
- %tmp.4.i15141 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i15140, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i15143 = load double* %tmp.5.i34352 ; <double> [#uses=1]
- store double %tmp.6.i15143, double* %tmp.4.i15141
- %tmp.7.i15144 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i15140, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i15146 = load double* %tmp.8.i34355 ; <double> [#uses=1]
- store double %tmp.9.i15146, double* %tmp.7.i15144
- %tmp.0.i15147 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i15140, %"struct.std::dcomplex"* %tmp.1036 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i15149 = getelementptr %"struct.std::dcomplex"* %tmp.0.i15147, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i15150 = load double* %tmp.14.i15149 ; <double> [#uses=1]
- %tmp.17.i15152 = getelementptr %"struct.std::dcomplex"* %tmp.0.i15147, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i15153 = load double* %tmp.17.i15152 ; <double> [#uses=1]
- %tmp.4.i15127 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i15126, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i15129 = load double* %tmp.5.i28602 ; <double> [#uses=1]
- store double %tmp.6.i15129, double* %tmp.4.i15127
- %tmp.7.i15130 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i15126, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i15132 = load double* %tmp.8.i28605 ; <double> [#uses=1]
- store double %tmp.9.i15132, double* %tmp.7.i15130
- %tmp.0.i15133 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i15126, %"struct.std::dcomplex"* %tmp.12 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i15134 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1033, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i15135 = getelementptr %"struct.std::dcomplex"* %tmp.0.i15133, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i15136 = load double* %tmp.14.i15135 ; <double> [#uses=1]
- store double %tmp.15.i15136, double* %tmp.13.i15134
- %tmp.16.i15137 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1033, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i15138 = getelementptr %"struct.std::dcomplex"* %tmp.0.i15133, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i15139 = load double* %tmp.17.i15138 ; <double> [#uses=1]
- store double %tmp.18.i15139, double* %tmp.16.i15137
- %tmp.4.i15113 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i15112, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i15150, double* %tmp.4.i15113
- %tmp.7.i15116 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i15112, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i15153, double* %tmp.7.i15116
- %tmp.0.i15119 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i15112, %"struct.std::dcomplex"* %mem_tmp.1033 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i15121 = getelementptr %"struct.std::dcomplex"* %tmp.0.i15119, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i15122 = load double* %tmp.14.i15121 ; <double> [#uses=1]
- %tmp.17.i15124 = getelementptr %"struct.std::dcomplex"* %tmp.0.i15119, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i15125 = load double* %tmp.17.i15124 ; <double> [#uses=1]
- %tmp.4.i15099 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i15098, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i15122, double* %tmp.4.i15099
- %tmp.7.i15102 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i15098, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i15125, double* %tmp.7.i15102
- %tmp.0.i15105 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i15098, %"struct.std::dcomplex"* %tmp.95 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i15106 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1030, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i15107 = getelementptr %"struct.std::dcomplex"* %tmp.0.i15105, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i15108 = load double* %tmp.14.i15107 ; <double> [#uses=1]
- store double %tmp.15.i15108, double* %tmp.13.i15106
- %tmp.16.i15109 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1030, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i15110 = getelementptr %"struct.std::dcomplex"* %tmp.0.i15105, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i15111 = load double* %tmp.17.i15110 ; <double> [#uses=1]
- store double %tmp.18.i15111, double* %tmp.16.i15109
- %tmp.4.i15085 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i15084, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i15164, double* %tmp.4.i15085
- %tmp.7.i15088 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i15084, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i15167, double* %tmp.7.i15088
- %tmp.0.i15091 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i15084, %"struct.std::dcomplex"* %mem_tmp.1030 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i15093 = getelementptr %"struct.std::dcomplex"* %tmp.0.i15091, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i15094 = load double* %tmp.14.i15093 ; <double> [#uses=1]
- %tmp.17.i15096 = getelementptr %"struct.std::dcomplex"* %tmp.0.i15091, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i15097 = load double* %tmp.17.i15096 ; <double> [#uses=1]
- %tmp.4.i15071 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i15070, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i15073 = load double* %tmp.5.i34082 ; <double> [#uses=1]
- store double %tmp.6.i15073, double* %tmp.4.i15071
- %tmp.7.i15074 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i15070, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i15076 = load double* %tmp.8.i34085 ; <double> [#uses=1]
- store double %tmp.9.i15076, double* %tmp.7.i15074
- %tmp.0.i15077 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i15070, %"struct.std::dcomplex"* %tmp.12 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i15079 = getelementptr %"struct.std::dcomplex"* %tmp.0.i15077, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i15080 = load double* %tmp.14.i15079 ; <double> [#uses=1]
- %tmp.17.i15082 = getelementptr %"struct.std::dcomplex"* %tmp.0.i15077, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i15083 = load double* %tmp.17.i15082 ; <double> [#uses=1]
- %tmp.4.i15057 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i15056, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i15059 = load double* %tmp.5.i34352 ; <double> [#uses=1]
- store double %tmp.6.i15059, double* %tmp.4.i15057
- %tmp.7.i15060 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i15056, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i15062 = load double* %tmp.8.i34355 ; <double> [#uses=1]
- store double %tmp.9.i15062, double* %tmp.7.i15060
- %tmp.0.i15063 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i15056, %"struct.std::dcomplex"* %tmp.62 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i15064 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1037, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i15065 = getelementptr %"struct.std::dcomplex"* %tmp.0.i15063, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i15066 = load double* %tmp.14.i15065 ; <double> [#uses=1]
- store double %tmp.15.i15066, double* %tmp.13.i15064
- %tmp.16.i15067 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1037, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i15068 = getelementptr %"struct.std::dcomplex"* %tmp.0.i15063, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i15069 = load double* %tmp.17.i15068 ; <double> [#uses=1]
- store double %tmp.18.i15069, double* %tmp.16.i15067
- %tmp.4.i15043 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i15042, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i15080, double* %tmp.4.i15043
- %tmp.7.i15046 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i15042, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i15083, double* %tmp.7.i15046
- %tmp.0.i15049 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i15042, %"struct.std::dcomplex"* %mem_tmp.1037 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i15051 = getelementptr %"struct.std::dcomplex"* %tmp.0.i15049, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i15052 = load double* %tmp.14.i15051 ; <double> [#uses=1]
- %tmp.17.i15054 = getelementptr %"struct.std::dcomplex"* %tmp.0.i15049, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i15055 = load double* %tmp.17.i15054 ; <double> [#uses=1]
- %tmp.4.i15029 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i15028, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i15052, double* %tmp.4.i15029
- %tmp.7.i15032 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i15028, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i15055, double* %tmp.7.i15032
- %tmp.0.i15035 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i15028, %"struct.std::dcomplex"* %tmp.1075 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i15036 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1034, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i15037 = getelementptr %"struct.std::dcomplex"* %tmp.0.i15035, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i15038 = load double* %tmp.14.i15037 ; <double> [#uses=1]
- store double %tmp.15.i15038, double* %tmp.13.i15036
- %tmp.16.i15039 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1034, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i15040 = getelementptr %"struct.std::dcomplex"* %tmp.0.i15035, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i15041 = load double* %tmp.17.i15040 ; <double> [#uses=1]
- store double %tmp.18.i15041, double* %tmp.16.i15039
- %tmp.4.i15015 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i15014, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i15094, double* %tmp.4.i15015
- %tmp.7.i15018 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i15014, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i15097, double* %tmp.7.i15018
- %tmp.0.i15021 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i15014, %"struct.std::dcomplex"* %mem_tmp.1034 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i15023 = getelementptr %"struct.std::dcomplex"* %tmp.0.i15021, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i15024 = load double* %tmp.14.i15023 ; <double> [#uses=1]
- %tmp.17.i15026 = getelementptr %"struct.std::dcomplex"* %tmp.0.i15021, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i15027 = load double* %tmp.17.i15026 ; <double> [#uses=1]
- store double %tmp.15.i15024, double* %tmp.2.i34364
- store double %tmp.18.i15027, double* %tmp.6.i34365
- %tmp.4.i14981 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i14980, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i14983 = load double* %tmp.5.i32460 ; <double> [#uses=1]
- store double %tmp.6.i14983, double* %tmp.4.i14981
- %tmp.7.i14984 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i14980, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i14986 = load double* %tmp.8.i32463 ; <double> [#uses=1]
- store double %tmp.9.i14986, double* %tmp.7.i14984
- %tmp.0.i14987 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i14980, %"struct.std::dcomplex"* %ret3 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i14989 = getelementptr %"struct.std::dcomplex"* %tmp.0.i14987, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i14990 = load double* %tmp.14.i14989 ; <double> [#uses=1]
- %tmp.17.i14992 = getelementptr %"struct.std::dcomplex"* %tmp.0.i14987, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i14993 = load double* %tmp.17.i14992 ; <double> [#uses=1]
- %tmp.7.i14947 = load double* %tmp.2.i34366 ; <double> [#uses=1]
- %tmp.15.i14961 = add double %tmp.7.i14947, %tmp.15.i14990 ; <double> [#uses=1]
- store double %tmp.15.i14961, double* %tmp.2.i34366
- %tmp.26.i14968 = load double* %tmp.6.i34367 ; <double> [#uses=1]
- %tmp.31.i14979 = add double %tmp.26.i14968, %tmp.18.i14993 ; <double> [#uses=1]
- store double %tmp.31.i14979, double* %tmp.6.i34367
- %tmp.4.i14927 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i14926, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i14929 = load double* %tmp.5.i31000 ; <double> [#uses=1]
- store double %tmp.6.i14929, double* %tmp.4.i14927
- %tmp.7.i14930 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i14926, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i14932 = load double* %tmp.8.i31003 ; <double> [#uses=1]
- store double %tmp.9.i14932, double* %tmp.7.i14930
- %tmp.0.i14933 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i14926, %"struct.std::dcomplex"* %ret4 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i14935 = getelementptr %"struct.std::dcomplex"* %tmp.0.i14933, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i14936 = load double* %tmp.14.i14935 ; <double> [#uses=1]
- %tmp.17.i14938 = getelementptr %"struct.std::dcomplex"* %tmp.0.i14933, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i14939 = load double* %tmp.17.i14938 ; <double> [#uses=1]
- %tmp.7.i14893 = load double* %tmp.2.i34368 ; <double> [#uses=1]
- %tmp.15.i14907 = add double %tmp.7.i14893, %tmp.15.i14936 ; <double> [#uses=1]
- store double %tmp.15.i14907, double* %tmp.2.i34368
- %tmp.26.i14914 = load double* %tmp.6.i34369 ; <double> [#uses=1]
- %tmp.31.i14925 = add double %tmp.26.i14914, %tmp.18.i14939 ; <double> [#uses=1]
- store double %tmp.31.i14925, double* %tmp.6.i34369
- store double 0.000000e+00, double* %tmp.2.i34366
- store double 0.000000e+00, double* %tmp.6.i34367
- %tmp.4.i14871 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i14870, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i14873 = load double* %tmp.5.i34352 ; <double> [#uses=1]
- store double %tmp.6.i14873, double* %tmp.4.i14871
- %tmp.7.i14874 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i14870, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i14876 = load double* %tmp.8.i34355 ; <double> [#uses=1]
- store double %tmp.9.i14876, double* %tmp.7.i14874
- %tmp.0.i14877 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i14870, %"struct.std::dcomplex"* %tmp.6 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i14879 = getelementptr %"struct.std::dcomplex"* %tmp.0.i14877, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i14880 = load double* %tmp.14.i14879 ; <double> [#uses=1]
- %tmp.17.i14882 = getelementptr %"struct.std::dcomplex"* %tmp.0.i14877, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i14883 = load double* %tmp.17.i14882 ; <double> [#uses=1]
- %tmp.4.i14857 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i14856, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i14859 = load double* %tmp.5.i34338 ; <double> [#uses=1]
- store double %tmp.6.i14859, double* %tmp.4.i14857
- %tmp.7.i14860 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i14856, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i14862 = load double* %tmp.8.i34341 ; <double> [#uses=1]
- store double %tmp.9.i14862, double* %tmp.7.i14860
- %tmp.0.i14863 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i14856, %"struct.std::dcomplex"* %tmp.12 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i14864 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1045, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i14865 = getelementptr %"struct.std::dcomplex"* %tmp.0.i14863, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i14866 = load double* %tmp.14.i14865 ; <double> [#uses=1]
- store double %tmp.15.i14866, double* %tmp.13.i14864
- %tmp.16.i14867 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1045, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i14868 = getelementptr %"struct.std::dcomplex"* %tmp.0.i14863, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i14869 = load double* %tmp.17.i14868 ; <double> [#uses=1]
- store double %tmp.18.i14869, double* %tmp.16.i14867
- %tmp.4.i14843 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i14842, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i14880, double* %tmp.4.i14843
- %tmp.7.i14846 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i14842, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i14883, double* %tmp.7.i14846
- %tmp.0.i14849 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i14842, %"struct.std::dcomplex"* %mem_tmp.1045 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i14851 = getelementptr %"struct.std::dcomplex"* %tmp.0.i14849, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i14852 = load double* %tmp.14.i14851 ; <double> [#uses=1]
- %tmp.17.i14854 = getelementptr %"struct.std::dcomplex"* %tmp.0.i14849, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i14855 = load double* %tmp.17.i14854 ; <double> [#uses=1]
- %tmp.4.i14829 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i14828, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i14852, double* %tmp.4.i14829
- %tmp.7.i14832 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i14828, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i14855, double* %tmp.7.i14832
- %tmp.0.i14835 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i14828, %"struct.std::dcomplex"* %tmp.1075 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i14837 = getelementptr %"struct.std::dcomplex"* %tmp.0.i14835, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i14838 = load double* %tmp.14.i14837 ; <double> [#uses=1]
- %tmp.17.i14840 = getelementptr %"struct.std::dcomplex"* %tmp.0.i14835, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i14841 = load double* %tmp.17.i14840 ; <double> [#uses=1]
- %tmp.4.i14815 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i14814, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i14817 = load double* %tmp.5.i34338 ; <double> [#uses=1]
- store double %tmp.6.i14817, double* %tmp.4.i14815
- %tmp.7.i14818 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i14814, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i14820 = load double* %tmp.8.i34341 ; <double> [#uses=1]
- store double %tmp.9.i14820, double* %tmp.7.i14818
- %tmp.0.i14821 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i14814, %"struct.std::dcomplex"* %tmp.1036 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i14823 = getelementptr %"struct.std::dcomplex"* %tmp.0.i14821, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i14824 = load double* %tmp.14.i14823 ; <double> [#uses=1]
- %tmp.17.i14826 = getelementptr %"struct.std::dcomplex"* %tmp.0.i14821, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i14827 = load double* %tmp.17.i14826 ; <double> [#uses=1]
- %tmp.4.i14801 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i14800, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i14803 = load double* %tmp.5.i28602 ; <double> [#uses=1]
- store double %tmp.6.i14803, double* %tmp.4.i14801
- %tmp.7.i14804 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i14800, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i14806 = load double* %tmp.8.i28605 ; <double> [#uses=1]
- store double %tmp.9.i14806, double* %tmp.7.i14804
- %tmp.0.i14807 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i14800, %"struct.std::dcomplex"* %tmp.6 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i14808 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1049, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i14809 = getelementptr %"struct.std::dcomplex"* %tmp.0.i14807, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i14810 = load double* %tmp.14.i14809 ; <double> [#uses=1]
- store double %tmp.15.i14810, double* %tmp.13.i14808
- %tmp.16.i14811 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1049, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i14812 = getelementptr %"struct.std::dcomplex"* %tmp.0.i14807, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i14813 = load double* %tmp.17.i14812 ; <double> [#uses=1]
- store double %tmp.18.i14813, double* %tmp.16.i14811
- %tmp.4.i14787 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i14786, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i14824, double* %tmp.4.i14787
- %tmp.7.i14790 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i14786, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i14827, double* %tmp.7.i14790
- %tmp.0.i14793 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i14786, %"struct.std::dcomplex"* %mem_tmp.1049 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i14795 = getelementptr %"struct.std::dcomplex"* %tmp.0.i14793, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i14796 = load double* %tmp.14.i14795 ; <double> [#uses=1]
- %tmp.17.i14798 = getelementptr %"struct.std::dcomplex"* %tmp.0.i14793, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i14799 = load double* %tmp.17.i14798 ; <double> [#uses=1]
- %tmp.4.i14773 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i14772, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i14796, double* %tmp.4.i14773
- %tmp.7.i14776 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i14772, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i14799, double* %tmp.7.i14776
- %tmp.0.i14779 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i14772, %"struct.std::dcomplex"* %tmp.30 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i14780 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1046, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i14781 = getelementptr %"struct.std::dcomplex"* %tmp.0.i14779, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i14782 = load double* %tmp.14.i14781 ; <double> [#uses=1]
- store double %tmp.15.i14782, double* %tmp.13.i14780
- %tmp.16.i14783 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1046, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i14784 = getelementptr %"struct.std::dcomplex"* %tmp.0.i14779, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i14785 = load double* %tmp.17.i14784 ; <double> [#uses=1]
- store double %tmp.18.i14785, double* %tmp.16.i14783
- %tmp.4.i14759 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i14758, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i14838, double* %tmp.4.i14759
- %tmp.7.i14762 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i14758, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i14841, double* %tmp.7.i14762
- %tmp.0.i14765 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i14758, %"struct.std::dcomplex"* %mem_tmp.1046 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i14767 = getelementptr %"struct.std::dcomplex"* %tmp.0.i14765, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i14768 = load double* %tmp.14.i14767 ; <double> [#uses=1]
- %tmp.17.i14770 = getelementptr %"struct.std::dcomplex"* %tmp.0.i14765, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i14771 = load double* %tmp.17.i14770 ; <double> [#uses=1]
- %tmp.4.i14745 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i14744, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i14747 = load double* %tmp.5.i28602 ; <double> [#uses=1]
- store double %tmp.6.i14747, double* %tmp.4.i14745
- %tmp.7.i14748 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i14744, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i14750 = load double* %tmp.8.i28605 ; <double> [#uses=1]
- store double %tmp.9.i14750, double* %tmp.7.i14748
- %tmp.0.i14751 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i14744, %"struct.std::dcomplex"* %tmp.12 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i14753 = getelementptr %"struct.std::dcomplex"* %tmp.0.i14751, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i14754 = load double* %tmp.14.i14753 ; <double> [#uses=1]
- %tmp.17.i14756 = getelementptr %"struct.std::dcomplex"* %tmp.0.i14751, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i14757 = load double* %tmp.17.i14756 ; <double> [#uses=1]
- %tmp.4.i14731 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i14730, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i14733 = load double* %tmp.5.i34352 ; <double> [#uses=1]
- store double %tmp.6.i14733, double* %tmp.4.i14731
- %tmp.7.i14734 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i14730, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i14736 = load double* %tmp.8.i34355 ; <double> [#uses=1]
- store double %tmp.9.i14736, double* %tmp.7.i14734
- %tmp.0.i14737 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i14730, %"struct.std::dcomplex"* %tmp.1036 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i14738 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1053, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i14739 = getelementptr %"struct.std::dcomplex"* %tmp.0.i14737, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i14740 = load double* %tmp.14.i14739 ; <double> [#uses=1]
- store double %tmp.15.i14740, double* %tmp.13.i14738
- %tmp.16.i14741 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1053, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i14742 = getelementptr %"struct.std::dcomplex"* %tmp.0.i14737, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i14743 = load double* %tmp.17.i14742 ; <double> [#uses=1]
- store double %tmp.18.i14743, double* %tmp.16.i14741
- %tmp.4.i14717 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i14716, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i14754, double* %tmp.4.i14717
- %tmp.7.i14720 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i14716, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i14757, double* %tmp.7.i14720
- %tmp.0.i14723 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i14716, %"struct.std::dcomplex"* %mem_tmp.1053 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i14725 = getelementptr %"struct.std::dcomplex"* %tmp.0.i14723, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i14726 = load double* %tmp.14.i14725 ; <double> [#uses=1]
- %tmp.17.i14728 = getelementptr %"struct.std::dcomplex"* %tmp.0.i14723, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i14729 = load double* %tmp.17.i14728 ; <double> [#uses=1]
- %tmp.4.i14703 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i14702, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i14726, double* %tmp.4.i14703
- %tmp.7.i14706 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i14702, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i14729, double* %tmp.7.i14706
- %tmp.0.i14709 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i14702, %"struct.std::dcomplex"* %tmp.45 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i14710 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1050, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i14711 = getelementptr %"struct.std::dcomplex"* %tmp.0.i14709, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i14712 = load double* %tmp.14.i14711 ; <double> [#uses=1]
- store double %tmp.15.i14712, double* %tmp.13.i14710
- %tmp.16.i14713 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1050, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i14714 = getelementptr %"struct.std::dcomplex"* %tmp.0.i14709, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i14715 = load double* %tmp.17.i14714 ; <double> [#uses=1]
- store double %tmp.18.i14715, double* %tmp.16.i14713
- %tmp.4.i14689 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i14688, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i14768, double* %tmp.4.i14689
- %tmp.7.i14692 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i14688, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i14771, double* %tmp.7.i14692
- %tmp.0.i14695 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i14688, %"struct.std::dcomplex"* %mem_tmp.1050 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i14697 = getelementptr %"struct.std::dcomplex"* %tmp.0.i14695, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i14698 = load double* %tmp.14.i14697 ; <double> [#uses=1]
- %tmp.17.i14700 = getelementptr %"struct.std::dcomplex"* %tmp.0.i14695, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i14701 = load double* %tmp.17.i14700 ; <double> [#uses=1]
- store double %tmp.15.i14698, double* %tmp.2.i34364
- store double %tmp.18.i14701, double* %tmp.6.i34365
- %tmp.4.i14655 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i14654, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i14657 = load double* %tmp.5.i32460 ; <double> [#uses=1]
- store double %tmp.6.i14657, double* %tmp.4.i14655
- %tmp.7.i14658 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i14654, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i14660 = load double* %tmp.8.i32463 ; <double> [#uses=1]
- store double %tmp.9.i14660, double* %tmp.7.i14658
- %tmp.0.i14661 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i14654, %"struct.std::dcomplex"* %ret3 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i14663 = getelementptr %"struct.std::dcomplex"* %tmp.0.i14661, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i14664 = load double* %tmp.14.i14663 ; <double> [#uses=1]
- %tmp.17.i14666 = getelementptr %"struct.std::dcomplex"* %tmp.0.i14661, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i14667 = load double* %tmp.17.i14666 ; <double> [#uses=1]
- %tmp.7.i14621 = load double* %tmp.2.i34366 ; <double> [#uses=1]
- %tmp.15.i14635 = add double %tmp.7.i14621, %tmp.15.i14664 ; <double> [#uses=1]
- store double %tmp.15.i14635, double* %tmp.2.i34366
- %tmp.26.i14642 = load double* %tmp.6.i34367 ; <double> [#uses=1]
- %tmp.31.i14653 = add double %tmp.26.i14642, %tmp.18.i14667 ; <double> [#uses=1]
- store double %tmp.31.i14653, double* %tmp.6.i34367
- %tmp.4.i14601 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i14600, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i14603 = load double* %tmp.5.i34352 ; <double> [#uses=1]
- store double %tmp.6.i14603, double* %tmp.4.i14601
- %tmp.7.i14604 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i14600, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i14606 = load double* %tmp.8.i34355 ; <double> [#uses=1]
- store double %tmp.9.i14606, double* %tmp.7.i14604
- %tmp.0.i14607 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i14600, %"struct.std::dcomplex"* %tmp.226 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i14609 = getelementptr %"struct.std::dcomplex"* %tmp.0.i14607, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i14610 = load double* %tmp.14.i14609 ; <double> [#uses=1]
- %tmp.17.i14612 = getelementptr %"struct.std::dcomplex"* %tmp.0.i14607, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i14613 = load double* %tmp.17.i14612 ; <double> [#uses=1]
- %tmp.4.i14587 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i14586, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i14589 = load double* %tmp.5.i33146 ; <double> [#uses=1]
- store double %tmp.6.i14589, double* %tmp.4.i14587
- %tmp.7.i14590 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i14586, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i14592 = load double* %tmp.8.i33149 ; <double> [#uses=1]
- store double %tmp.9.i14592, double* %tmp.7.i14590
- %tmp.0.i14593 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i14586, %"struct.std::dcomplex"* %tmp.12 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i14594 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1060, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i14595 = getelementptr %"struct.std::dcomplex"* %tmp.0.i14593, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i14596 = load double* %tmp.14.i14595 ; <double> [#uses=1]
- store double %tmp.15.i14596, double* %tmp.13.i14594
- %tmp.16.i14597 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1060, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i14598 = getelementptr %"struct.std::dcomplex"* %tmp.0.i14593, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i14599 = load double* %tmp.17.i14598 ; <double> [#uses=1]
- store double %tmp.18.i14599, double* %tmp.16.i14597
- %tmp.4.i14573 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i14572, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i14610, double* %tmp.4.i14573
- %tmp.7.i14576 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i14572, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i14613, double* %tmp.7.i14576
- %tmp.0.i14579 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i14572, %"struct.std::dcomplex"* %mem_tmp.1060 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i14581 = getelementptr %"struct.std::dcomplex"* %tmp.0.i14579, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i14582 = load double* %tmp.14.i14581 ; <double> [#uses=1]
- %tmp.17.i14584 = getelementptr %"struct.std::dcomplex"* %tmp.0.i14579, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i14585 = load double* %tmp.17.i14584 ; <double> [#uses=1]
- %tmp.4.i14559 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i14558, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i14582, double* %tmp.4.i14559
- %tmp.7.i14562 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i14558, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i14585, double* %tmp.7.i14562
- %tmp.0.i14565 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i14558, %"struct.std::dcomplex"* %tmp.45 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i14567 = getelementptr %"struct.std::dcomplex"* %tmp.0.i14565, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i14568 = load double* %tmp.14.i14567 ; <double> [#uses=1]
- %tmp.17.i14570 = getelementptr %"struct.std::dcomplex"* %tmp.0.i14565, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i14571 = load double* %tmp.17.i14570 ; <double> [#uses=1]
- %tmp.4.i14545 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i14544, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i14547 = load double* %tmp.5.i34338 ; <double> [#uses=1]
- store double %tmp.6.i14547, double* %tmp.4.i14545
- %tmp.7.i14548 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i14544, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i14550 = load double* %tmp.8.i34341 ; <double> [#uses=1]
- store double %tmp.9.i14550, double* %tmp.7.i14548
- %tmp.0.i14551 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i14544, %"struct.std::dcomplex"* %tmp.12 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i14553 = getelementptr %"struct.std::dcomplex"* %tmp.0.i14551, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i14554 = load double* %tmp.14.i14553 ; <double> [#uses=1]
- %tmp.17.i14556 = getelementptr %"struct.std::dcomplex"* %tmp.0.i14551, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i14557 = load double* %tmp.17.i14556 ; <double> [#uses=1]
- %tmp.4.i14531 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i14530, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i14533 = load double* %tmp.5.i34352 ; <double> [#uses=1]
- store double %tmp.6.i14533, double* %tmp.4.i14531
- %tmp.7.i14534 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i14530, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i14536 = load double* %tmp.8.i34355 ; <double> [#uses=1]
- store double %tmp.9.i14536, double* %tmp.7.i14534
- %tmp.0.i14537 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i14530, %"struct.std::dcomplex"* %tmp.6 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i14538 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1064, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i14539 = getelementptr %"struct.std::dcomplex"* %tmp.0.i14537, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i14540 = load double* %tmp.14.i14539 ; <double> [#uses=1]
- store double %tmp.15.i14540, double* %tmp.13.i14538
- %tmp.16.i14541 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1064, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i14542 = getelementptr %"struct.std::dcomplex"* %tmp.0.i14537, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i14543 = load double* %tmp.17.i14542 ; <double> [#uses=1]
- store double %tmp.18.i14543, double* %tmp.16.i14541
- %tmp.4.i14517 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i14516, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i14554, double* %tmp.4.i14517
- %tmp.7.i14520 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i14516, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i14557, double* %tmp.7.i14520
- %tmp.0.i14523 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i14516, %"struct.std::dcomplex"* %mem_tmp.1064 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i14525 = getelementptr %"struct.std::dcomplex"* %tmp.0.i14523, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i14526 = load double* %tmp.14.i14525 ; <double> [#uses=1]
- %tmp.17.i14528 = getelementptr %"struct.std::dcomplex"* %tmp.0.i14523, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i14529 = load double* %tmp.17.i14528 ; <double> [#uses=1]
- %tmp.4.i14503 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i14502, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i14526, double* %tmp.4.i14503
- %tmp.7.i14506 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i14502, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i14529, double* %tmp.7.i14506
- %tmp.0.i14509 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i14502, %"struct.std::dcomplex"* %tmp.220 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i14510 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1061, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i14511 = getelementptr %"struct.std::dcomplex"* %tmp.0.i14509, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i14512 = load double* %tmp.14.i14511 ; <double> [#uses=1]
- store double %tmp.15.i14512, double* %tmp.13.i14510
- %tmp.16.i14513 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1061, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i14514 = getelementptr %"struct.std::dcomplex"* %tmp.0.i14509, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i14515 = load double* %tmp.17.i14514 ; <double> [#uses=1]
- store double %tmp.18.i14515, double* %tmp.16.i14513
- %tmp.4.i14489 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i14488, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i14568, double* %tmp.4.i14489
- %tmp.7.i14492 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i14488, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i14571, double* %tmp.7.i14492
- %tmp.0.i14495 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i14488, %"struct.std::dcomplex"* %mem_tmp.1061 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i14497 = getelementptr %"struct.std::dcomplex"* %tmp.0.i14495, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i14498 = load double* %tmp.14.i14497 ; <double> [#uses=1]
- %tmp.17.i14500 = getelementptr %"struct.std::dcomplex"* %tmp.0.i14495, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i14501 = load double* %tmp.17.i14500 ; <double> [#uses=1]
- %tmp.4.i14475 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i14474, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i14477 = load double* %tmp.5.i33146 ; <double> [#uses=1]
- store double %tmp.6.i14477, double* %tmp.4.i14475
- %tmp.7.i14478 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i14474, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i14480 = load double* %tmp.8.i33149 ; <double> [#uses=1]
- store double %tmp.9.i14480, double* %tmp.7.i14478
- %tmp.0.i14481 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i14474, %"struct.std::dcomplex"* %tmp.6 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i14483 = getelementptr %"struct.std::dcomplex"* %tmp.0.i14481, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i14484 = load double* %tmp.14.i14483 ; <double> [#uses=1]
- %tmp.17.i14486 = getelementptr %"struct.std::dcomplex"* %tmp.0.i14481, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i14487 = load double* %tmp.17.i14486 ; <double> [#uses=1]
- %tmp.4.i14461 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i14460, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i14463 = load double* %tmp.5.i34338 ; <double> [#uses=1]
- store double %tmp.6.i14463, double* %tmp.4.i14461
- %tmp.7.i14464 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i14460, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i14466 = load double* %tmp.8.i34341 ; <double> [#uses=1]
- store double %tmp.9.i14466, double* %tmp.7.i14464
- %tmp.0.i14467 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i14460, %"struct.std::dcomplex"* %tmp.226 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i14468 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1068, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i14469 = getelementptr %"struct.std::dcomplex"* %tmp.0.i14467, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i14470 = load double* %tmp.14.i14469 ; <double> [#uses=1]
- store double %tmp.15.i14470, double* %tmp.13.i14468
- %tmp.16.i14471 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1068, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i14472 = getelementptr %"struct.std::dcomplex"* %tmp.0.i14467, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i14473 = load double* %tmp.17.i14472 ; <double> [#uses=1]
- store double %tmp.18.i14473, double* %tmp.16.i14471
- %tmp.4.i14447 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i14446, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i14484, double* %tmp.4.i14447
- %tmp.7.i14450 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i14446, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i14487, double* %tmp.7.i14450
- %tmp.0.i14453 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i14446, %"struct.std::dcomplex"* %mem_tmp.1068 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i14455 = getelementptr %"struct.std::dcomplex"* %tmp.0.i14453, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i14456 = load double* %tmp.14.i14455 ; <double> [#uses=1]
- %tmp.17.i14458 = getelementptr %"struct.std::dcomplex"* %tmp.0.i14453, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i14459 = load double* %tmp.17.i14458 ; <double> [#uses=1]
- %tmp.4.i14433 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i14432, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i14456, double* %tmp.4.i14433
- %tmp.7.i14436 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i14432, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i14459, double* %tmp.7.i14436
- %tmp.0.i14439 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i14432, %"struct.std::dcomplex"* %tmp.30 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i14440 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1065, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i14441 = getelementptr %"struct.std::dcomplex"* %tmp.0.i14439, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i14442 = load double* %tmp.14.i14441 ; <double> [#uses=1]
- store double %tmp.15.i14442, double* %tmp.13.i14440
- %tmp.16.i14443 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1065, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i14444 = getelementptr %"struct.std::dcomplex"* %tmp.0.i14439, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i14445 = load double* %tmp.17.i14444 ; <double> [#uses=1]
- store double %tmp.18.i14445, double* %tmp.16.i14443
- %tmp.4.i14419 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i14418, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i14498, double* %tmp.4.i14419
- %tmp.7.i14422 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i14418, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i14501, double* %tmp.7.i14422
- %tmp.0.i14425 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i14418, %"struct.std::dcomplex"* %mem_tmp.1065 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i14427 = getelementptr %"struct.std::dcomplex"* %tmp.0.i14425, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i14428 = load double* %tmp.14.i14427 ; <double> [#uses=1]
- %tmp.17.i14430 = getelementptr %"struct.std::dcomplex"* %tmp.0.i14425, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i14431 = load double* %tmp.17.i14430 ; <double> [#uses=1]
- store double %tmp.15.i14428, double* %tmp.2.i34364
- store double %tmp.18.i14431, double* %tmp.6.i34365
- %tmp.4.i14385 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i14384, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i14387 = load double* %tmp.5.i27590 ; <double> [#uses=1]
- store double %tmp.6.i14387, double* %tmp.4.i14385
- %tmp.7.i14388 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i14384, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i14390 = load double* %tmp.8.i27593 ; <double> [#uses=1]
- store double %tmp.9.i14390, double* %tmp.7.i14388
- %tmp.0.i14391 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i14384, %"struct.std::dcomplex"* %ret3 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i14393 = getelementptr %"struct.std::dcomplex"* %tmp.0.i14391, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i14394 = load double* %tmp.14.i14393 ; <double> [#uses=1]
- %tmp.17.i14396 = getelementptr %"struct.std::dcomplex"* %tmp.0.i14391, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i14397 = load double* %tmp.17.i14396 ; <double> [#uses=1]
- %tmp.7.i14351 = load double* %tmp.2.i34366 ; <double> [#uses=1]
- %tmp.15.i14365 = add double %tmp.7.i14351, %tmp.15.i14394 ; <double> [#uses=1]
- store double %tmp.15.i14365, double* %tmp.2.i34366
- %tmp.26.i14372 = load double* %tmp.6.i34367 ; <double> [#uses=1]
- %tmp.31.i14383 = add double %tmp.26.i14372, %tmp.18.i14397 ; <double> [#uses=1]
- store double %tmp.31.i14383, double* %tmp.6.i34367
- %tmp.4.i14331 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i14330, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i14333 = load double* %tmp.5.i34338 ; <double> [#uses=1]
- store double %tmp.6.i14333, double* %tmp.4.i14331
- %tmp.7.i14334 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i14330, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i14336 = load double* %tmp.8.i34341 ; <double> [#uses=1]
- store double %tmp.9.i14336, double* %tmp.7.i14334
- %tmp.0.i14337 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i14330, %"struct.std::dcomplex"* %tmp.226 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i14339 = getelementptr %"struct.std::dcomplex"* %tmp.0.i14337, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i14340 = load double* %tmp.14.i14339 ; <double> [#uses=1]
- %tmp.17.i14342 = getelementptr %"struct.std::dcomplex"* %tmp.0.i14337, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i14343 = load double* %tmp.17.i14342 ; <double> [#uses=1]
- %tmp.4.i14317 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i14316, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i14319 = load double* %tmp.5.i33146 ; <double> [#uses=1]
- store double %tmp.6.i14319, double* %tmp.4.i14317
- %tmp.7.i14320 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i14316, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i14322 = load double* %tmp.8.i33149 ; <double> [#uses=1]
- store double %tmp.9.i14322, double* %tmp.7.i14320
- %tmp.0.i14323 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i14316, %"struct.std::dcomplex"* %tmp.6 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i14324 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1075, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i14325 = getelementptr %"struct.std::dcomplex"* %tmp.0.i14323, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i14326 = load double* %tmp.14.i14325 ; <double> [#uses=1]
- store double %tmp.15.i14326, double* %tmp.13.i14324
- %tmp.16.i14327 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1075, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i14328 = getelementptr %"struct.std::dcomplex"* %tmp.0.i14323, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i14329 = load double* %tmp.17.i14328 ; <double> [#uses=1]
- store double %tmp.18.i14329, double* %tmp.16.i14327
- %tmp.4.i14303 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i14302, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i14340, double* %tmp.4.i14303
- %tmp.7.i14306 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i14302, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i14343, double* %tmp.7.i14306
- %tmp.0.i14309 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i14302, %"struct.std::dcomplex"* %mem_tmp.1075 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i14311 = getelementptr %"struct.std::dcomplex"* %tmp.0.i14309, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i14312 = load double* %tmp.14.i14311 ; <double> [#uses=1]
- %tmp.17.i14314 = getelementptr %"struct.std::dcomplex"* %tmp.0.i14309, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i14315 = load double* %tmp.17.i14314 ; <double> [#uses=1]
- %tmp.4.i14289 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i14288, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i14312, double* %tmp.4.i14289
- %tmp.7.i14292 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i14288, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i14315, double* %tmp.7.i14292
- %tmp.0.i14295 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i14288, %"struct.std::dcomplex"* %tmp.1075 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i14297 = getelementptr %"struct.std::dcomplex"* %tmp.0.i14295, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i14298 = load double* %tmp.14.i14297 ; <double> [#uses=1]
- %tmp.17.i14300 = getelementptr %"struct.std::dcomplex"* %tmp.0.i14295, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i14301 = load double* %tmp.17.i14300 ; <double> [#uses=1]
- %tmp.4.i14275 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i14274, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i14277 = load double* %tmp.5.i33146 ; <double> [#uses=1]
- store double %tmp.6.i14277, double* %tmp.4.i14275
- %tmp.7.i14278 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i14274, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i14280 = load double* %tmp.8.i33149 ; <double> [#uses=1]
- store double %tmp.9.i14280, double* %tmp.7.i14278
- %tmp.0.i14281 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i14274, %"struct.std::dcomplex"* %tmp.1036 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i14283 = getelementptr %"struct.std::dcomplex"* %tmp.0.i14281, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i14284 = load double* %tmp.14.i14283 ; <double> [#uses=1]
- %tmp.17.i14286 = getelementptr %"struct.std::dcomplex"* %tmp.0.i14281, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i14287 = load double* %tmp.17.i14286 ; <double> [#uses=1]
- %tmp.4.i14261 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i14260, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i14263 = load double* %tmp.5.i28602 ; <double> [#uses=1]
- store double %tmp.6.i14263, double* %tmp.4.i14261
- %tmp.7.i14264 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i14260, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i14266 = load double* %tmp.8.i28605 ; <double> [#uses=1]
- store double %tmp.9.i14266, double* %tmp.7.i14264
- %tmp.0.i14267 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i14260, %"struct.std::dcomplex"* %tmp.226 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i14268 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1079, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i14269 = getelementptr %"struct.std::dcomplex"* %tmp.0.i14267, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i14270 = load double* %tmp.14.i14269 ; <double> [#uses=1]
- store double %tmp.15.i14270, double* %tmp.13.i14268
- %tmp.16.i14271 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1079, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i14272 = getelementptr %"struct.std::dcomplex"* %tmp.0.i14267, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i14273 = load double* %tmp.17.i14272 ; <double> [#uses=1]
- store double %tmp.18.i14273, double* %tmp.16.i14271
- %tmp.4.i14247 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i14246, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i14284, double* %tmp.4.i14247
- %tmp.7.i14250 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i14246, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i14287, double* %tmp.7.i14250
- %tmp.0.i14253 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i14246, %"struct.std::dcomplex"* %mem_tmp.1079 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i14255 = getelementptr %"struct.std::dcomplex"* %tmp.0.i14253, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i14256 = load double* %tmp.14.i14255 ; <double> [#uses=1]
- %tmp.17.i14258 = getelementptr %"struct.std::dcomplex"* %tmp.0.i14253, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i14259 = load double* %tmp.17.i14258 ; <double> [#uses=1]
- %tmp.4.i14233 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i14232, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i14256, double* %tmp.4.i14233
- %tmp.7.i14236 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i14232, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i14259, double* %tmp.7.i14236
- %tmp.0.i14239 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i14232, %"struct.std::dcomplex"* %tmp.45 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i14240 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1076, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i14241 = getelementptr %"struct.std::dcomplex"* %tmp.0.i14239, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i14242 = load double* %tmp.14.i14241 ; <double> [#uses=1]
- store double %tmp.15.i14242, double* %tmp.13.i14240
- %tmp.16.i14243 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1076, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i14244 = getelementptr %"struct.std::dcomplex"* %tmp.0.i14239, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i14245 = load double* %tmp.17.i14244 ; <double> [#uses=1]
- store double %tmp.18.i14245, double* %tmp.16.i14243
- %tmp.4.i14219 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i14218, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i14298, double* %tmp.4.i14219
- %tmp.7.i14222 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i14218, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i14301, double* %tmp.7.i14222
- %tmp.0.i14225 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i14218, %"struct.std::dcomplex"* %mem_tmp.1076 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i14227 = getelementptr %"struct.std::dcomplex"* %tmp.0.i14225, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i14228 = load double* %tmp.14.i14227 ; <double> [#uses=1]
- %tmp.17.i14230 = getelementptr %"struct.std::dcomplex"* %tmp.0.i14225, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i14231 = load double* %tmp.17.i14230 ; <double> [#uses=1]
- %tmp.4.i14205 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i14204, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i14207 = load double* %tmp.5.i28602 ; <double> [#uses=1]
- store double %tmp.6.i14207, double* %tmp.4.i14205
- %tmp.7.i14208 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i14204, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i14210 = load double* %tmp.8.i28605 ; <double> [#uses=1]
- store double %tmp.9.i14210, double* %tmp.7.i14208
- %tmp.0.i14211 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i14204, %"struct.std::dcomplex"* %tmp.6 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i14213 = getelementptr %"struct.std::dcomplex"* %tmp.0.i14211, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i14214 = load double* %tmp.14.i14213 ; <double> [#uses=1]
- %tmp.17.i14216 = getelementptr %"struct.std::dcomplex"* %tmp.0.i14211, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i14217 = load double* %tmp.17.i14216 ; <double> [#uses=1]
- %tmp.4.i14191 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i14190, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i14193 = load double* %tmp.5.i34338 ; <double> [#uses=1]
- store double %tmp.6.i14193, double* %tmp.4.i14191
- %tmp.7.i14194 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i14190, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i14196 = load double* %tmp.8.i34341 ; <double> [#uses=1]
- store double %tmp.9.i14196, double* %tmp.7.i14194
- %tmp.0.i14197 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i14190, %"struct.std::dcomplex"* %tmp.1036 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i14198 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1083, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i14199 = getelementptr %"struct.std::dcomplex"* %tmp.0.i14197, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i14200 = load double* %tmp.14.i14199 ; <double> [#uses=1]
- store double %tmp.15.i14200, double* %tmp.13.i14198
- %tmp.16.i14201 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1083, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i14202 = getelementptr %"struct.std::dcomplex"* %tmp.0.i14197, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i14203 = load double* %tmp.17.i14202 ; <double> [#uses=1]
- store double %tmp.18.i14203, double* %tmp.16.i14201
- %tmp.4.i14177 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i14176, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i14214, double* %tmp.4.i14177
- %tmp.7.i14180 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i14176, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i14217, double* %tmp.7.i14180
- %tmp.0.i14183 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i14176, %"struct.std::dcomplex"* %mem_tmp.1083 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i14185 = getelementptr %"struct.std::dcomplex"* %tmp.0.i14183, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i14186 = load double* %tmp.14.i14185 ; <double> [#uses=1]
- %tmp.17.i14188 = getelementptr %"struct.std::dcomplex"* %tmp.0.i14183, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i14189 = load double* %tmp.17.i14188 ; <double> [#uses=1]
- %tmp.4.i14163 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i14162, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i14186, double* %tmp.4.i14163
- %tmp.7.i14166 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i14162, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i14189, double* %tmp.7.i14166
- %tmp.0.i14169 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i14162, %"struct.std::dcomplex"* %tmp.220 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i14170 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1080, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i14171 = getelementptr %"struct.std::dcomplex"* %tmp.0.i14169, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i14172 = load double* %tmp.14.i14171 ; <double> [#uses=1]
- store double %tmp.15.i14172, double* %tmp.13.i14170
- %tmp.16.i14173 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1080, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i14174 = getelementptr %"struct.std::dcomplex"* %tmp.0.i14169, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i14175 = load double* %tmp.17.i14174 ; <double> [#uses=1]
- store double %tmp.18.i14175, double* %tmp.16.i14173
- %tmp.4.i14149 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i14148, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i14228, double* %tmp.4.i14149
- %tmp.7.i14152 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i14148, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i14231, double* %tmp.7.i14152
- %tmp.0.i14155 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i14148, %"struct.std::dcomplex"* %mem_tmp.1080 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i14157 = getelementptr %"struct.std::dcomplex"* %tmp.0.i14155, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i14158 = load double* %tmp.14.i14157 ; <double> [#uses=1]
- %tmp.17.i14160 = getelementptr %"struct.std::dcomplex"* %tmp.0.i14155, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i14161 = load double* %tmp.17.i14160 ; <double> [#uses=1]
- store double %tmp.15.i14158, double* %tmp.2.i34364
- store double %tmp.18.i14161, double* %tmp.6.i34365
- %tmp.4.i14115 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i14114, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i14117 = load double* %tmp.5.i33866 ; <double> [#uses=1]
- store double %tmp.6.i14117, double* %tmp.4.i14115
- %tmp.7.i14118 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i14114, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i14120 = load double* %tmp.8.i33869 ; <double> [#uses=1]
- store double %tmp.9.i14120, double* %tmp.7.i14118
- %tmp.0.i14121 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i14114, %"struct.std::dcomplex"* %ret3 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i14123 = getelementptr %"struct.std::dcomplex"* %tmp.0.i14121, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i14124 = load double* %tmp.14.i14123 ; <double> [#uses=1]
- %tmp.17.i14126 = getelementptr %"struct.std::dcomplex"* %tmp.0.i14121, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i14127 = load double* %tmp.17.i14126 ; <double> [#uses=1]
- %tmp.7.i14081 = load double* %tmp.2.i34366 ; <double> [#uses=1]
- %tmp.15.i14095 = add double %tmp.7.i14081, %tmp.15.i14124 ; <double> [#uses=1]
- store double %tmp.15.i14095, double* %tmp.2.i34366
- %tmp.26.i14102 = load double* %tmp.6.i34367 ; <double> [#uses=1]
- %tmp.31.i14113 = add double %tmp.26.i14102, %tmp.18.i14127 ; <double> [#uses=1]
- store double %tmp.31.i14113, double* %tmp.6.i34367
- %tmp.4.i14061 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i14060, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i14063 = load double* %tmp.5.i34352 ; <double> [#uses=1]
- store double %tmp.6.i14063, double* %tmp.4.i14061
- %tmp.7.i14064 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i14060, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i14066 = load double* %tmp.8.i34355 ; <double> [#uses=1]
- store double %tmp.9.i14066, double* %tmp.7.i14064
- %tmp.0.i14067 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i14060, %"struct.std::dcomplex"* %tmp.1036 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i14069 = getelementptr %"struct.std::dcomplex"* %tmp.0.i14067, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i14070 = load double* %tmp.14.i14069 ; <double> [#uses=1]
- %tmp.17.i14072 = getelementptr %"struct.std::dcomplex"* %tmp.0.i14067, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i14073 = load double* %tmp.17.i14072 ; <double> [#uses=1]
- %tmp.4.i14047 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i14046, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i14049 = load double* %tmp.5.i28602 ; <double> [#uses=1]
- store double %tmp.6.i14049, double* %tmp.4.i14047
- %tmp.7.i14050 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i14046, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i14052 = load double* %tmp.8.i28605 ; <double> [#uses=1]
- store double %tmp.9.i14052, double* %tmp.7.i14050
- %tmp.0.i14053 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i14046, %"struct.std::dcomplex"* %tmp.12 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i14054 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1090, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i14055 = getelementptr %"struct.std::dcomplex"* %tmp.0.i14053, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i14056 = load double* %tmp.14.i14055 ; <double> [#uses=1]
- store double %tmp.15.i14056, double* %tmp.13.i14054
- %tmp.16.i14057 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1090, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i14058 = getelementptr %"struct.std::dcomplex"* %tmp.0.i14053, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i14059 = load double* %tmp.17.i14058 ; <double> [#uses=1]
- store double %tmp.18.i14059, double* %tmp.16.i14057
- %tmp.4.i14033 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i14032, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i14070, double* %tmp.4.i14033
- %tmp.7.i14036 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i14032, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i14073, double* %tmp.7.i14036
- %tmp.0.i14039 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i14032, %"struct.std::dcomplex"* %mem_tmp.1090 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i14041 = getelementptr %"struct.std::dcomplex"* %tmp.0.i14039, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i14042 = load double* %tmp.14.i14041 ; <double> [#uses=1]
- %tmp.17.i14044 = getelementptr %"struct.std::dcomplex"* %tmp.0.i14039, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i14045 = load double* %tmp.17.i14044 ; <double> [#uses=1]
- %tmp.4.i14019 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i14018, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i14042, double* %tmp.4.i14019
- %tmp.7.i14022 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i14018, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i14045, double* %tmp.7.i14022
- %tmp.0.i14025 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i14018, %"struct.std::dcomplex"* %tmp.220 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i14027 = getelementptr %"struct.std::dcomplex"* %tmp.0.i14025, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i14028 = load double* %tmp.14.i14027 ; <double> [#uses=1]
- %tmp.17.i14030 = getelementptr %"struct.std::dcomplex"* %tmp.0.i14025, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i14031 = load double* %tmp.17.i14030 ; <double> [#uses=1]
- %tmp.4.i14005 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i14004, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i14007 = load double* %tmp.5.i33146 ; <double> [#uses=1]
- store double %tmp.6.i14007, double* %tmp.4.i14005
- %tmp.7.i14008 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i14004, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i14010 = load double* %tmp.8.i33149 ; <double> [#uses=1]
- store double %tmp.9.i14010, double* %tmp.7.i14008
- %tmp.0.i14011 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i14004, %"struct.std::dcomplex"* %tmp.12 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i14013 = getelementptr %"struct.std::dcomplex"* %tmp.0.i14011, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i14014 = load double* %tmp.14.i14013 ; <double> [#uses=1]
- %tmp.17.i14016 = getelementptr %"struct.std::dcomplex"* %tmp.0.i14011, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i14017 = load double* %tmp.17.i14016 ; <double> [#uses=1]
- %tmp.4.i13991 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i13990, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i13993 = load double* %tmp.5.i34352 ; <double> [#uses=1]
- store double %tmp.6.i13993, double* %tmp.4.i13991
- %tmp.7.i13994 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i13990, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i13996 = load double* %tmp.8.i34355 ; <double> [#uses=1]
- store double %tmp.9.i13996, double* %tmp.7.i13994
- %tmp.0.i13997 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i13990, %"struct.std::dcomplex"* %tmp.226 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i13998 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1094, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i13999 = getelementptr %"struct.std::dcomplex"* %tmp.0.i13997, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i14000 = load double* %tmp.14.i13999 ; <double> [#uses=1]
- store double %tmp.15.i14000, double* %tmp.13.i13998
- %tmp.16.i14001 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1094, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i14002 = getelementptr %"struct.std::dcomplex"* %tmp.0.i13997, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i14003 = load double* %tmp.17.i14002 ; <double> [#uses=1]
- store double %tmp.18.i14003, double* %tmp.16.i14001
- %tmp.4.i13977 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i13976, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i14014, double* %tmp.4.i13977
- %tmp.7.i13980 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i13976, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i14017, double* %tmp.7.i13980
- %tmp.0.i13983 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i13976, %"struct.std::dcomplex"* %mem_tmp.1094 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i13985 = getelementptr %"struct.std::dcomplex"* %tmp.0.i13983, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i13986 = load double* %tmp.14.i13985 ; <double> [#uses=1]
- %tmp.17.i13988 = getelementptr %"struct.std::dcomplex"* %tmp.0.i13983, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i13989 = load double* %tmp.17.i13988 ; <double> [#uses=1]
- %tmp.4.i13963 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i13962, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i13986, double* %tmp.4.i13963
- %tmp.7.i13966 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i13962, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i13989, double* %tmp.7.i13966
- %tmp.0.i13969 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i13962, %"struct.std::dcomplex"* %tmp.1075 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i13970 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1091, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i13971 = getelementptr %"struct.std::dcomplex"* %tmp.0.i13969, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i13972 = load double* %tmp.14.i13971 ; <double> [#uses=1]
- store double %tmp.15.i13972, double* %tmp.13.i13970
- %tmp.16.i13973 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1091, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i13974 = getelementptr %"struct.std::dcomplex"* %tmp.0.i13969, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i13975 = load double* %tmp.17.i13974 ; <double> [#uses=1]
- store double %tmp.18.i13975, double* %tmp.16.i13973
- %tmp.4.i13949 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i13948, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i14028, double* %tmp.4.i13949
- %tmp.7.i13952 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i13948, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i14031, double* %tmp.7.i13952
- %tmp.0.i13955 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i13948, %"struct.std::dcomplex"* %mem_tmp.1091 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i13957 = getelementptr %"struct.std::dcomplex"* %tmp.0.i13955, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i13958 = load double* %tmp.14.i13957 ; <double> [#uses=1]
- %tmp.17.i13960 = getelementptr %"struct.std::dcomplex"* %tmp.0.i13955, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i13961 = load double* %tmp.17.i13960 ; <double> [#uses=1]
- %tmp.4.i13935 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i13934, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i13937 = load double* %tmp.5.i28602 ; <double> [#uses=1]
- store double %tmp.6.i13937, double* %tmp.4.i13935
- %tmp.7.i13938 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i13934, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i13940 = load double* %tmp.8.i28605 ; <double> [#uses=1]
- store double %tmp.9.i13940, double* %tmp.7.i13938
- %tmp.0.i13941 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i13934, %"struct.std::dcomplex"* %tmp.226 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i13943 = getelementptr %"struct.std::dcomplex"* %tmp.0.i13941, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i13944 = load double* %tmp.14.i13943 ; <double> [#uses=1]
- %tmp.17.i13946 = getelementptr %"struct.std::dcomplex"* %tmp.0.i13941, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i13947 = load double* %tmp.17.i13946 ; <double> [#uses=1]
- %tmp.4.i13921 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i13920, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i13923 = load double* %tmp.5.i33146 ; <double> [#uses=1]
- store double %tmp.6.i13923, double* %tmp.4.i13921
- %tmp.7.i13924 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i13920, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i13926 = load double* %tmp.8.i33149 ; <double> [#uses=1]
- store double %tmp.9.i13926, double* %tmp.7.i13924
- %tmp.0.i13927 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i13920, %"struct.std::dcomplex"* %tmp.1036 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i13928 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1098, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i13929 = getelementptr %"struct.std::dcomplex"* %tmp.0.i13927, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i13930 = load double* %tmp.14.i13929 ; <double> [#uses=1]
- store double %tmp.15.i13930, double* %tmp.13.i13928
- %tmp.16.i13931 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1098, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i13932 = getelementptr %"struct.std::dcomplex"* %tmp.0.i13927, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i13933 = load double* %tmp.17.i13932 ; <double> [#uses=1]
- store double %tmp.18.i13933, double* %tmp.16.i13931
- %tmp.4.i13907 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i13906, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i13944, double* %tmp.4.i13907
- %tmp.7.i13910 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i13906, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i13947, double* %tmp.7.i13910
- %tmp.0.i13913 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i13906, %"struct.std::dcomplex"* %mem_tmp.1098 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i13915 = getelementptr %"struct.std::dcomplex"* %tmp.0.i13913, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i13916 = load double* %tmp.14.i13915 ; <double> [#uses=1]
- %tmp.17.i13918 = getelementptr %"struct.std::dcomplex"* %tmp.0.i13913, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i13919 = load double* %tmp.17.i13918 ; <double> [#uses=1]
- %tmp.4.i13893 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i13892, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i13916, double* %tmp.4.i13893
- %tmp.7.i13896 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i13892, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i13919, double* %tmp.7.i13896
- %tmp.0.i13899 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i13892, %"struct.std::dcomplex"* %tmp.30 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i13900 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1095, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i13901 = getelementptr %"struct.std::dcomplex"* %tmp.0.i13899, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i13902 = load double* %tmp.14.i13901 ; <double> [#uses=1]
- store double %tmp.15.i13902, double* %tmp.13.i13900
- %tmp.16.i13903 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1095, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i13904 = getelementptr %"struct.std::dcomplex"* %tmp.0.i13899, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i13905 = load double* %tmp.17.i13904 ; <double> [#uses=1]
- store double %tmp.18.i13905, double* %tmp.16.i13903
- %tmp.4.i13879 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i13878, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i13958, double* %tmp.4.i13879
- %tmp.7.i13882 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i13878, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i13961, double* %tmp.7.i13882
- %tmp.0.i13885 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i13878, %"struct.std::dcomplex"* %mem_tmp.1095 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i13887 = getelementptr %"struct.std::dcomplex"* %tmp.0.i13885, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i13888 = load double* %tmp.14.i13887 ; <double> [#uses=1]
- %tmp.17.i13890 = getelementptr %"struct.std::dcomplex"* %tmp.0.i13885, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i13891 = load double* %tmp.17.i13890 ; <double> [#uses=1]
- store double %tmp.15.i13888, double* %tmp.2.i34364
- store double %tmp.18.i13891, double* %tmp.6.i34365
- %tmp.4.i13845 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i13844, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i13847 = load double* %tmp.5.i33596 ; <double> [#uses=1]
- store double %tmp.6.i13847, double* %tmp.4.i13845
- %tmp.7.i13848 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i13844, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i13850 = load double* %tmp.8.i33599 ; <double> [#uses=1]
- store double %tmp.9.i13850, double* %tmp.7.i13848
- %tmp.0.i13851 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i13844, %"struct.std::dcomplex"* %ret3 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i13853 = getelementptr %"struct.std::dcomplex"* %tmp.0.i13851, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i13854 = load double* %tmp.14.i13853 ; <double> [#uses=1]
- %tmp.17.i13856 = getelementptr %"struct.std::dcomplex"* %tmp.0.i13851, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i13857 = load double* %tmp.17.i13856 ; <double> [#uses=1]
- %tmp.7.i13811 = load double* %tmp.2.i34366 ; <double> [#uses=1]
- %tmp.15.i13825 = add double %tmp.7.i13811, %tmp.15.i13854 ; <double> [#uses=1]
- store double %tmp.15.i13825, double* %tmp.2.i34366
- %tmp.26.i13832 = load double* %tmp.6.i34367 ; <double> [#uses=1]
- %tmp.31.i13843 = add double %tmp.26.i13832, %tmp.18.i13857 ; <double> [#uses=1]
- store double %tmp.31.i13843, double* %tmp.6.i34367
- %tmp.4.i13791 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i13790, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i13793 = load double* %tmp.5.i28728 ; <double> [#uses=1]
- store double %tmp.6.i13793, double* %tmp.4.i13791
- %tmp.7.i13794 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i13790, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i13796 = load double* %tmp.8.i28731 ; <double> [#uses=1]
- store double %tmp.9.i13796, double* %tmp.7.i13794
- %tmp.0.i13797 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i13790, %"struct.std::dcomplex"* %ret4 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i13799 = getelementptr %"struct.std::dcomplex"* %tmp.0.i13797, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i13800 = load double* %tmp.14.i13799 ; <double> [#uses=1]
- %tmp.17.i13802 = getelementptr %"struct.std::dcomplex"* %tmp.0.i13797, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i13803 = load double* %tmp.17.i13802 ; <double> [#uses=1]
- %tmp.7.i13757 = load double* %tmp.2.i34368 ; <double> [#uses=1]
- %tmp.15.i13771 = add double %tmp.7.i13757, %tmp.15.i13800 ; <double> [#uses=1]
- store double %tmp.15.i13771, double* %tmp.2.i34368
- %tmp.26.i13778 = load double* %tmp.6.i34369 ; <double> [#uses=1]
- %tmp.31.i13789 = add double %tmp.26.i13778, %tmp.18.i13803 ; <double> [#uses=1]
- store double %tmp.31.i13789, double* %tmp.6.i34369
- store double 0.000000e+00, double* %tmp.2.i34366
- store double 0.000000e+00, double* %tmp.6.i34367
- %tmp.4.i13735 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i13734, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i13737 = load double* %tmp.5.i34082 ; <double> [#uses=1]
- store double %tmp.6.i13737, double* %tmp.4.i13735
- %tmp.7.i13738 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i13734, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i13740 = load double* %tmp.8.i34085 ; <double> [#uses=1]
- store double %tmp.9.i13740, double* %tmp.7.i13738
- %tmp.0.i13741 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i13734, %"struct.std::dcomplex"* %tmp.1036 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i13743 = getelementptr %"struct.std::dcomplex"* %tmp.0.i13741, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i13744 = load double* %tmp.14.i13743 ; <double> [#uses=1]
- %tmp.17.i13746 = getelementptr %"struct.std::dcomplex"* %tmp.0.i13741, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i13747 = load double* %tmp.17.i13746 ; <double> [#uses=1]
- %tmp.4.i13721 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i13720, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i13723 = load double* %tmp.5.i28602 ; <double> [#uses=1]
- store double %tmp.6.i13723, double* %tmp.4.i13721
- %tmp.7.i13724 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i13720, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i13726 = load double* %tmp.8.i28605 ; <double> [#uses=1]
- store double %tmp.9.i13726, double* %tmp.7.i13724
- %tmp.0.i13727 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i13720, %"struct.std::dcomplex"* %tmp.62 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i13728 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1106, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i13729 = getelementptr %"struct.std::dcomplex"* %tmp.0.i13727, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i13730 = load double* %tmp.14.i13729 ; <double> [#uses=1]
- store double %tmp.15.i13730, double* %tmp.13.i13728
- %tmp.16.i13731 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1106, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i13732 = getelementptr %"struct.std::dcomplex"* %tmp.0.i13727, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i13733 = load double* %tmp.17.i13732 ; <double> [#uses=1]
- store double %tmp.18.i13733, double* %tmp.16.i13731
- %tmp.4.i13707 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i13706, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i13744, double* %tmp.4.i13707
- %tmp.7.i13710 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i13706, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i13747, double* %tmp.7.i13710
- %tmp.0.i13713 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i13706, %"struct.std::dcomplex"* %mem_tmp.1106 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i13715 = getelementptr %"struct.std::dcomplex"* %tmp.0.i13713, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i13716 = load double* %tmp.14.i13715 ; <double> [#uses=1]
- %tmp.17.i13718 = getelementptr %"struct.std::dcomplex"* %tmp.0.i13713, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i13719 = load double* %tmp.17.i13718 ; <double> [#uses=1]
- %tmp.4.i13693 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i13692, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i13716, double* %tmp.4.i13693
- %tmp.7.i13696 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i13692, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i13719, double* %tmp.7.i13696
- %tmp.0.i13699 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i13692, %"struct.std::dcomplex"* %tmp.30 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i13701 = getelementptr %"struct.std::dcomplex"* %tmp.0.i13699, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i13702 = load double* %tmp.14.i13701 ; <double> [#uses=1]
- %tmp.17.i13704 = getelementptr %"struct.std::dcomplex"* %tmp.0.i13699, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i13705 = load double* %tmp.17.i13704 ; <double> [#uses=1]
- %tmp.4.i13679 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i13678, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i13681 = load double* %tmp.5.i28602 ; <double> [#uses=1]
- store double %tmp.6.i13681, double* %tmp.4.i13679
- %tmp.7.i13682 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i13678, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i13684 = load double* %tmp.8.i28605 ; <double> [#uses=1]
- store double %tmp.9.i13684, double* %tmp.7.i13682
- %tmp.0.i13685 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i13678, %"struct.std::dcomplex"* %tmp.12 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i13687 = getelementptr %"struct.std::dcomplex"* %tmp.0.i13685, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i13688 = load double* %tmp.14.i13687 ; <double> [#uses=1]
- %tmp.17.i13690 = getelementptr %"struct.std::dcomplex"* %tmp.0.i13685, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i13691 = load double* %tmp.17.i13690 ; <double> [#uses=1]
- %tmp.4.i13665 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i13664, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i13667 = load double* %tmp.5.i34352 ; <double> [#uses=1]
- store double %tmp.6.i13667, double* %tmp.4.i13665
- %tmp.7.i13668 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i13664, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i13670 = load double* %tmp.8.i34355 ; <double> [#uses=1]
- store double %tmp.9.i13670, double* %tmp.7.i13668
- %tmp.0.i13671 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i13664, %"struct.std::dcomplex"* %tmp.1036 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i13672 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1110, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i13673 = getelementptr %"struct.std::dcomplex"* %tmp.0.i13671, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i13674 = load double* %tmp.14.i13673 ; <double> [#uses=1]
- store double %tmp.15.i13674, double* %tmp.13.i13672
- %tmp.16.i13675 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1110, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i13676 = getelementptr %"struct.std::dcomplex"* %tmp.0.i13671, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i13677 = load double* %tmp.17.i13676 ; <double> [#uses=1]
- store double %tmp.18.i13677, double* %tmp.16.i13675
- %tmp.4.i13651 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i13650, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i13688, double* %tmp.4.i13651
- %tmp.7.i13654 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i13650, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i13691, double* %tmp.7.i13654
- %tmp.0.i13657 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i13650, %"struct.std::dcomplex"* %mem_tmp.1110 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i13659 = getelementptr %"struct.std::dcomplex"* %tmp.0.i13657, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i13660 = load double* %tmp.14.i13659 ; <double> [#uses=1]
- %tmp.17.i13662 = getelementptr %"struct.std::dcomplex"* %tmp.0.i13657, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i13663 = load double* %tmp.17.i13662 ; <double> [#uses=1]
- %tmp.4.i13637 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i13636, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i13660, double* %tmp.4.i13637
- %tmp.7.i13640 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i13636, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i13663, double* %tmp.7.i13640
- %tmp.0.i13643 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i13636, %"struct.std::dcomplex"* %tmp.95 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i13644 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1107, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i13645 = getelementptr %"struct.std::dcomplex"* %tmp.0.i13643, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i13646 = load double* %tmp.14.i13645 ; <double> [#uses=1]
- store double %tmp.15.i13646, double* %tmp.13.i13644
- %tmp.16.i13647 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1107, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i13648 = getelementptr %"struct.std::dcomplex"* %tmp.0.i13643, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i13649 = load double* %tmp.17.i13648 ; <double> [#uses=1]
- store double %tmp.18.i13649, double* %tmp.16.i13647
- %tmp.4.i13623 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i13622, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i13702, double* %tmp.4.i13623
- %tmp.7.i13626 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i13622, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i13705, double* %tmp.7.i13626
- %tmp.0.i13629 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i13622, %"struct.std::dcomplex"* %mem_tmp.1107 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i13631 = getelementptr %"struct.std::dcomplex"* %tmp.0.i13629, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i13632 = load double* %tmp.14.i13631 ; <double> [#uses=1]
- %tmp.17.i13634 = getelementptr %"struct.std::dcomplex"* %tmp.0.i13629, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i13635 = load double* %tmp.17.i13634 ; <double> [#uses=1]
- %tmp.4.i13609 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i13608, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i13611 = load double* %tmp.5.i34352 ; <double> [#uses=1]
- store double %tmp.6.i13611, double* %tmp.4.i13609
- %tmp.7.i13612 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i13608, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i13614 = load double* %tmp.8.i34355 ; <double> [#uses=1]
- store double %tmp.9.i13614, double* %tmp.7.i13612
- %tmp.0.i13615 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i13608, %"struct.std::dcomplex"* %tmp.62 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i13617 = getelementptr %"struct.std::dcomplex"* %tmp.0.i13615, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i13618 = load double* %tmp.14.i13617 ; <double> [#uses=1]
- %tmp.17.i13620 = getelementptr %"struct.std::dcomplex"* %tmp.0.i13615, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i13621 = load double* %tmp.17.i13620 ; <double> [#uses=1]
- %tmp.4.i13595 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i13594, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i13597 = load double* %tmp.5.i34082 ; <double> [#uses=1]
- store double %tmp.6.i13597, double* %tmp.4.i13595
- %tmp.7.i13598 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i13594, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i13600 = load double* %tmp.8.i34085 ; <double> [#uses=1]
- store double %tmp.9.i13600, double* %tmp.7.i13598
- %tmp.0.i13601 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i13594, %"struct.std::dcomplex"* %tmp.12 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i13602 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1114, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i13603 = getelementptr %"struct.std::dcomplex"* %tmp.0.i13601, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i13604 = load double* %tmp.14.i13603 ; <double> [#uses=1]
- store double %tmp.15.i13604, double* %tmp.13.i13602
- %tmp.16.i13605 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1114, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i13606 = getelementptr %"struct.std::dcomplex"* %tmp.0.i13601, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i13607 = load double* %tmp.17.i13606 ; <double> [#uses=1]
- store double %tmp.18.i13607, double* %tmp.16.i13605
- %tmp.4.i13581 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i13580, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i13618, double* %tmp.4.i13581
- %tmp.7.i13584 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i13580, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i13621, double* %tmp.7.i13584
- %tmp.0.i13587 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i13580, %"struct.std::dcomplex"* %mem_tmp.1114 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i13589 = getelementptr %"struct.std::dcomplex"* %tmp.0.i13587, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i13590 = load double* %tmp.14.i13589 ; <double> [#uses=1]
- %tmp.17.i13592 = getelementptr %"struct.std::dcomplex"* %tmp.0.i13587, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i13593 = load double* %tmp.17.i13592 ; <double> [#uses=1]
- %tmp.4.i13567 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i13566, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i13590, double* %tmp.4.i13567
- %tmp.7.i13570 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i13566, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i13593, double* %tmp.7.i13570
- %tmp.0.i13573 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i13566, %"struct.std::dcomplex"* %tmp.1075 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i13574 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1111, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i13575 = getelementptr %"struct.std::dcomplex"* %tmp.0.i13573, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i13576 = load double* %tmp.14.i13575 ; <double> [#uses=1]
- store double %tmp.15.i13576, double* %tmp.13.i13574
- %tmp.16.i13577 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1111, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i13578 = getelementptr %"struct.std::dcomplex"* %tmp.0.i13573, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i13579 = load double* %tmp.17.i13578 ; <double> [#uses=1]
- store double %tmp.18.i13579, double* %tmp.16.i13577
- %tmp.4.i13553 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i13552, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i13632, double* %tmp.4.i13553
- %tmp.7.i13556 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i13552, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i13635, double* %tmp.7.i13556
- %tmp.0.i13559 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i13552, %"struct.std::dcomplex"* %mem_tmp.1111 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i13561 = getelementptr %"struct.std::dcomplex"* %tmp.0.i13559, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i13562 = load double* %tmp.14.i13561 ; <double> [#uses=1]
- %tmp.17.i13564 = getelementptr %"struct.std::dcomplex"* %tmp.0.i13559, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i13565 = load double* %tmp.17.i13564 ; <double> [#uses=1]
- store double %tmp.15.i13562, double* %tmp.2.i34364
- store double %tmp.18.i13565, double* %tmp.6.i34365
- %tmp.4.i13519 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i13518, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i13521 = load double* %tmp.5.i33596 ; <double> [#uses=1]
- store double %tmp.6.i13521, double* %tmp.4.i13519
- %tmp.7.i13522 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i13518, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i13524 = load double* %tmp.8.i33599 ; <double> [#uses=1]
- store double %tmp.9.i13524, double* %tmp.7.i13522
- %tmp.0.i13525 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i13518, %"struct.std::dcomplex"* %ret3 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i13527 = getelementptr %"struct.std::dcomplex"* %tmp.0.i13525, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i13528 = load double* %tmp.14.i13527 ; <double> [#uses=1]
- %tmp.17.i13530 = getelementptr %"struct.std::dcomplex"* %tmp.0.i13525, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i13531 = load double* %tmp.17.i13530 ; <double> [#uses=1]
- %tmp.7.i13485 = load double* %tmp.2.i34366 ; <double> [#uses=1]
- %tmp.15.i13499 = add double %tmp.7.i13485, %tmp.15.i13528 ; <double> [#uses=1]
- store double %tmp.15.i13499, double* %tmp.2.i34366
- %tmp.26.i13506 = load double* %tmp.6.i34367 ; <double> [#uses=1]
- %tmp.31.i13517 = add double %tmp.26.i13506, %tmp.18.i13531 ; <double> [#uses=1]
- store double %tmp.31.i13517, double* %tmp.6.i34367
- %tmp.4.i13465 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i13464, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i13467 = load double* %tmp.5.i34338 ; <double> [#uses=1]
- store double %tmp.6.i13467, double* %tmp.4.i13465
- %tmp.7.i13468 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i13464, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i13470 = load double* %tmp.8.i34341 ; <double> [#uses=1]
- store double %tmp.9.i13470, double* %tmp.7.i13468
- %tmp.0.i13471 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i13464, %"struct.std::dcomplex"* %tmp.12 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i13473 = getelementptr %"struct.std::dcomplex"* %tmp.0.i13471, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i13474 = load double* %tmp.14.i13473 ; <double> [#uses=1]
- %tmp.17.i13476 = getelementptr %"struct.std::dcomplex"* %tmp.0.i13471, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i13477 = load double* %tmp.17.i13476 ; <double> [#uses=1]
- %tmp.4.i13451 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i13450, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i13453 = load double* %tmp.5.i34352 ; <double> [#uses=1]
- store double %tmp.6.i13453, double* %tmp.4.i13451
- %tmp.7.i13454 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i13450, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i13456 = load double* %tmp.8.i34355 ; <double> [#uses=1]
- store double %tmp.9.i13456, double* %tmp.7.i13454
- %tmp.0.i13457 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i13450, %"struct.std::dcomplex"* %tmp.6 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i13458 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1121, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i13459 = getelementptr %"struct.std::dcomplex"* %tmp.0.i13457, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i13460 = load double* %tmp.14.i13459 ; <double> [#uses=1]
- store double %tmp.15.i13460, double* %tmp.13.i13458
- %tmp.16.i13461 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1121, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i13462 = getelementptr %"struct.std::dcomplex"* %tmp.0.i13457, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i13463 = load double* %tmp.17.i13462 ; <double> [#uses=1]
- store double %tmp.18.i13463, double* %tmp.16.i13461
- %tmp.4.i13437 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i13436, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i13474, double* %tmp.4.i13437
- %tmp.7.i13440 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i13436, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i13477, double* %tmp.7.i13440
- %tmp.0.i13443 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i13436, %"struct.std::dcomplex"* %mem_tmp.1121 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i13445 = getelementptr %"struct.std::dcomplex"* %tmp.0.i13443, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i13446 = load double* %tmp.14.i13445 ; <double> [#uses=1]
- %tmp.17.i13448 = getelementptr %"struct.std::dcomplex"* %tmp.0.i13443, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i13449 = load double* %tmp.17.i13448 ; <double> [#uses=1]
- %tmp.4.i13423 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i13422, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i13446, double* %tmp.4.i13423
- %tmp.7.i13426 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i13422, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i13449, double* %tmp.7.i13426
- %tmp.0.i13429 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i13422, %"struct.std::dcomplex"* %tmp.1075 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i13431 = getelementptr %"struct.std::dcomplex"* %tmp.0.i13429, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i13432 = load double* %tmp.14.i13431 ; <double> [#uses=1]
- %tmp.17.i13434 = getelementptr %"struct.std::dcomplex"* %tmp.0.i13429, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i13435 = load double* %tmp.17.i13434 ; <double> [#uses=1]
- %tmp.4.i13409 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i13408, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i13411 = load double* %tmp.5.i28602 ; <double> [#uses=1]
- store double %tmp.6.i13411, double* %tmp.4.i13409
- %tmp.7.i13412 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i13408, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i13414 = load double* %tmp.8.i28605 ; <double> [#uses=1]
- store double %tmp.9.i13414, double* %tmp.7.i13412
- %tmp.0.i13415 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i13408, %"struct.std::dcomplex"* %tmp.6 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i13417 = getelementptr %"struct.std::dcomplex"* %tmp.0.i13415, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i13418 = load double* %tmp.14.i13417 ; <double> [#uses=1]
- %tmp.17.i13420 = getelementptr %"struct.std::dcomplex"* %tmp.0.i13415, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i13421 = load double* %tmp.17.i13420 ; <double> [#uses=1]
- %tmp.4.i13395 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i13394, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i13397 = load double* %tmp.5.i34338 ; <double> [#uses=1]
- store double %tmp.6.i13397, double* %tmp.4.i13395
- %tmp.7.i13398 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i13394, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i13400 = load double* %tmp.8.i34341 ; <double> [#uses=1]
- store double %tmp.9.i13400, double* %tmp.7.i13398
- %tmp.0.i13401 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i13394, %"struct.std::dcomplex"* %tmp.1036 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i13402 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1125, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i13403 = getelementptr %"struct.std::dcomplex"* %tmp.0.i13401, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i13404 = load double* %tmp.14.i13403 ; <double> [#uses=1]
- store double %tmp.15.i13404, double* %tmp.13.i13402
- %tmp.16.i13405 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1125, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i13406 = getelementptr %"struct.std::dcomplex"* %tmp.0.i13401, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i13407 = load double* %tmp.17.i13406 ; <double> [#uses=1]
- store double %tmp.18.i13407, double* %tmp.16.i13405
- %tmp.4.i13381 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i13380, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i13418, double* %tmp.4.i13381
- %tmp.7.i13384 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i13380, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i13421, double* %tmp.7.i13384
- %tmp.0.i13387 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i13380, %"struct.std::dcomplex"* %mem_tmp.1125 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i13389 = getelementptr %"struct.std::dcomplex"* %tmp.0.i13387, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i13390 = load double* %tmp.14.i13389 ; <double> [#uses=1]
- %tmp.17.i13392 = getelementptr %"struct.std::dcomplex"* %tmp.0.i13387, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i13393 = load double* %tmp.17.i13392 ; <double> [#uses=1]
- %tmp.4.i13367 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i13366, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i13390, double* %tmp.4.i13367
- %tmp.7.i13370 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i13366, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i13393, double* %tmp.7.i13370
- %tmp.0.i13373 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i13366, %"struct.std::dcomplex"* %tmp.30 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i13374 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1122, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i13375 = getelementptr %"struct.std::dcomplex"* %tmp.0.i13373, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i13376 = load double* %tmp.14.i13375 ; <double> [#uses=1]
- store double %tmp.15.i13376, double* %tmp.13.i13374
- %tmp.16.i13377 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1122, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i13378 = getelementptr %"struct.std::dcomplex"* %tmp.0.i13373, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i13379 = load double* %tmp.17.i13378 ; <double> [#uses=1]
- store double %tmp.18.i13379, double* %tmp.16.i13377
- %tmp.4.i13353 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i13352, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i13432, double* %tmp.4.i13353
- %tmp.7.i13356 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i13352, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i13435, double* %tmp.7.i13356
- %tmp.0.i13359 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i13352, %"struct.std::dcomplex"* %mem_tmp.1122 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i13361 = getelementptr %"struct.std::dcomplex"* %tmp.0.i13359, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i13362 = load double* %tmp.14.i13361 ; <double> [#uses=1]
- %tmp.17.i13364 = getelementptr %"struct.std::dcomplex"* %tmp.0.i13359, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i13365 = load double* %tmp.17.i13364 ; <double> [#uses=1]
- %tmp.4.i13339 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i13338, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i13341 = load double* %tmp.5.i34352 ; <double> [#uses=1]
- store double %tmp.6.i13341, double* %tmp.4.i13339
- %tmp.7.i13342 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i13338, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i13344 = load double* %tmp.8.i34355 ; <double> [#uses=1]
- store double %tmp.9.i13344, double* %tmp.7.i13342
- %tmp.0.i13345 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i13338, %"struct.std::dcomplex"* %tmp.1036 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i13347 = getelementptr %"struct.std::dcomplex"* %tmp.0.i13345, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i13348 = load double* %tmp.14.i13347 ; <double> [#uses=1]
- %tmp.17.i13350 = getelementptr %"struct.std::dcomplex"* %tmp.0.i13345, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i13351 = load double* %tmp.17.i13350 ; <double> [#uses=1]
- %tmp.4.i13325 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i13324, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i13327 = load double* %tmp.5.i28602 ; <double> [#uses=1]
- store double %tmp.6.i13327, double* %tmp.4.i13325
- %tmp.7.i13328 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i13324, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i13330 = load double* %tmp.8.i28605 ; <double> [#uses=1]
- store double %tmp.9.i13330, double* %tmp.7.i13328
- %tmp.0.i13331 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i13324, %"struct.std::dcomplex"* %tmp.12 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i13332 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1129, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i13333 = getelementptr %"struct.std::dcomplex"* %tmp.0.i13331, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i13334 = load double* %tmp.14.i13333 ; <double> [#uses=1]
- store double %tmp.15.i13334, double* %tmp.13.i13332
- %tmp.16.i13335 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1129, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i13336 = getelementptr %"struct.std::dcomplex"* %tmp.0.i13331, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i13337 = load double* %tmp.17.i13336 ; <double> [#uses=1]
- store double %tmp.18.i13337, double* %tmp.16.i13335
- %tmp.4.i13311 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i13310, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i13348, double* %tmp.4.i13311
- %tmp.7.i13314 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i13310, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i13351, double* %tmp.7.i13314
- %tmp.0.i13317 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i13310, %"struct.std::dcomplex"* %mem_tmp.1129 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i13319 = getelementptr %"struct.std::dcomplex"* %tmp.0.i13317, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i13320 = load double* %tmp.14.i13319 ; <double> [#uses=1]
- %tmp.17.i13322 = getelementptr %"struct.std::dcomplex"* %tmp.0.i13317, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i13323 = load double* %tmp.17.i13322 ; <double> [#uses=1]
- %tmp.4.i13297 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i13296, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i13320, double* %tmp.4.i13297
- %tmp.7.i13300 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i13296, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i13323, double* %tmp.7.i13300
- %tmp.0.i13303 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i13296, %"struct.std::dcomplex"* %tmp.45 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i13304 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1126, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i13305 = getelementptr %"struct.std::dcomplex"* %tmp.0.i13303, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i13306 = load double* %tmp.14.i13305 ; <double> [#uses=1]
- store double %tmp.15.i13306, double* %tmp.13.i13304
- %tmp.16.i13307 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1126, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i13308 = getelementptr %"struct.std::dcomplex"* %tmp.0.i13303, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i13309 = load double* %tmp.17.i13308 ; <double> [#uses=1]
- store double %tmp.18.i13309, double* %tmp.16.i13307
- %tmp.4.i13283 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i13282, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i13362, double* %tmp.4.i13283
- %tmp.7.i13286 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i13282, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i13365, double* %tmp.7.i13286
- %tmp.0.i13289 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i13282, %"struct.std::dcomplex"* %mem_tmp.1126 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i13291 = getelementptr %"struct.std::dcomplex"* %tmp.0.i13289, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i13292 = load double* %tmp.14.i13291 ; <double> [#uses=1]
- %tmp.17.i13294 = getelementptr %"struct.std::dcomplex"* %tmp.0.i13289, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i13295 = load double* %tmp.17.i13294 ; <double> [#uses=1]
- store double %tmp.15.i13292, double* %tmp.2.i34364
- store double %tmp.18.i13295, double* %tmp.6.i34365
- %tmp.4.i13249 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i13248, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i13251 = load double* %tmp.5.i34136 ; <double> [#uses=1]
- store double %tmp.6.i13251, double* %tmp.4.i13249
- %tmp.7.i13252 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i13248, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i13254 = load double* %tmp.8.i34139 ; <double> [#uses=1]
- store double %tmp.9.i13254, double* %tmp.7.i13252
- %tmp.0.i13255 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i13248, %"struct.std::dcomplex"* %ret3 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i13257 = getelementptr %"struct.std::dcomplex"* %tmp.0.i13255, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i13258 = load double* %tmp.14.i13257 ; <double> [#uses=1]
- %tmp.17.i13260 = getelementptr %"struct.std::dcomplex"* %tmp.0.i13255, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i13261 = load double* %tmp.17.i13260 ; <double> [#uses=1]
- %tmp.7.i13215 = load double* %tmp.2.i34366 ; <double> [#uses=1]
- %tmp.15.i13229 = add double %tmp.7.i13215, %tmp.15.i13258 ; <double> [#uses=1]
- store double %tmp.15.i13229, double* %tmp.2.i34366
- %tmp.26.i13236 = load double* %tmp.6.i34367 ; <double> [#uses=1]
- %tmp.31.i13247 = add double %tmp.26.i13236, %tmp.18.i13261 ; <double> [#uses=1]
- store double %tmp.31.i13247, double* %tmp.6.i34367
- %tmp.4.i13195 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i13194, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i13197 = load double* %tmp.5.i34082 ; <double> [#uses=1]
- store double %tmp.6.i13197, double* %tmp.4.i13195
- %tmp.7.i13198 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i13194, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i13200 = load double* %tmp.8.i34085 ; <double> [#uses=1]
- store double %tmp.9.i13200, double* %tmp.7.i13198
- %tmp.0.i13201 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i13194, %"struct.std::dcomplex"* %tmp.12 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i13203 = getelementptr %"struct.std::dcomplex"* %tmp.0.i13201, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i13204 = load double* %tmp.14.i13203 ; <double> [#uses=1]
- %tmp.17.i13206 = getelementptr %"struct.std::dcomplex"* %tmp.0.i13201, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i13207 = load double* %tmp.17.i13206 ; <double> [#uses=1]
- %tmp.4.i13181 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i13180, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i13183 = load double* %tmp.5.i34352 ; <double> [#uses=1]
- store double %tmp.6.i13183, double* %tmp.4.i13181
- %tmp.7.i13184 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i13180, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i13186 = load double* %tmp.8.i34355 ; <double> [#uses=1]
- store double %tmp.9.i13186, double* %tmp.7.i13184
- %tmp.0.i13187 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i13180, %"struct.std::dcomplex"* %tmp.62 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i13188 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1136, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i13189 = getelementptr %"struct.std::dcomplex"* %tmp.0.i13187, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i13190 = load double* %tmp.14.i13189 ; <double> [#uses=1]
- store double %tmp.15.i13190, double* %tmp.13.i13188
- %tmp.16.i13191 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1136, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i13192 = getelementptr %"struct.std::dcomplex"* %tmp.0.i13187, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i13193 = load double* %tmp.17.i13192 ; <double> [#uses=1]
- store double %tmp.18.i13193, double* %tmp.16.i13191
- %tmp.4.i13167 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i13166, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i13204, double* %tmp.4.i13167
- %tmp.7.i13170 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i13166, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i13207, double* %tmp.7.i13170
- %tmp.0.i13173 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i13166, %"struct.std::dcomplex"* %mem_tmp.1136 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i13175 = getelementptr %"struct.std::dcomplex"* %tmp.0.i13173, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i13176 = load double* %tmp.14.i13175 ; <double> [#uses=1]
- %tmp.17.i13178 = getelementptr %"struct.std::dcomplex"* %tmp.0.i13173, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i13179 = load double* %tmp.17.i13178 ; <double> [#uses=1]
- %tmp.4.i13153 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i13152, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i13176, double* %tmp.4.i13153
- %tmp.7.i13156 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i13152, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i13179, double* %tmp.7.i13156
- %tmp.0.i13159 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i13152, %"struct.std::dcomplex"* %tmp.45 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i13161 = getelementptr %"struct.std::dcomplex"* %tmp.0.i13159, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i13162 = load double* %tmp.14.i13161 ; <double> [#uses=1]
- %tmp.17.i13164 = getelementptr %"struct.std::dcomplex"* %tmp.0.i13159, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i13165 = load double* %tmp.17.i13164 ; <double> [#uses=1]
- %tmp.4.i13139 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i13138, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i13141 = load double* %tmp.5.i34352 ; <double> [#uses=1]
- store double %tmp.6.i13141, double* %tmp.4.i13139
- %tmp.7.i13142 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i13138, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i13144 = load double* %tmp.8.i34355 ; <double> [#uses=1]
- store double %tmp.9.i13144, double* %tmp.7.i13142
- %tmp.0.i13145 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i13138, %"struct.std::dcomplex"* %tmp.6 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i13147 = getelementptr %"struct.std::dcomplex"* %tmp.0.i13145, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i13148 = load double* %tmp.14.i13147 ; <double> [#uses=1]
- %tmp.17.i13150 = getelementptr %"struct.std::dcomplex"* %tmp.0.i13145, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i13151 = load double* %tmp.17.i13150 ; <double> [#uses=1]
- %tmp.4.i13125 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i13124, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i13127 = load double* %tmp.5.i34338 ; <double> [#uses=1]
- store double %tmp.6.i13127, double* %tmp.4.i13125
- %tmp.7.i13128 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i13124, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i13130 = load double* %tmp.8.i34341 ; <double> [#uses=1]
- store double %tmp.9.i13130, double* %tmp.7.i13128
- %tmp.0.i13131 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i13124, %"struct.std::dcomplex"* %tmp.12 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i13132 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1140, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i13133 = getelementptr %"struct.std::dcomplex"* %tmp.0.i13131, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i13134 = load double* %tmp.14.i13133 ; <double> [#uses=1]
- store double %tmp.15.i13134, double* %tmp.13.i13132
- %tmp.16.i13135 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1140, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i13136 = getelementptr %"struct.std::dcomplex"* %tmp.0.i13131, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i13137 = load double* %tmp.17.i13136 ; <double> [#uses=1]
- store double %tmp.18.i13137, double* %tmp.16.i13135
- %tmp.4.i13111 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i13110, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i13148, double* %tmp.4.i13111
- %tmp.7.i13114 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i13110, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i13151, double* %tmp.7.i13114
- %tmp.0.i13117 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i13110, %"struct.std::dcomplex"* %mem_tmp.1140 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i13119 = getelementptr %"struct.std::dcomplex"* %tmp.0.i13117, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i13120 = load double* %tmp.14.i13119 ; <double> [#uses=1]
- %tmp.17.i13122 = getelementptr %"struct.std::dcomplex"* %tmp.0.i13117, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i13123 = load double* %tmp.17.i13122 ; <double> [#uses=1]
- %tmp.4.i13097 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i13096, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i13120, double* %tmp.4.i13097
- %tmp.7.i13100 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i13096, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i13123, double* %tmp.7.i13100
- %tmp.0.i13103 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i13096, %"struct.std::dcomplex"* %tmp.95 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i13104 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1137, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i13105 = getelementptr %"struct.std::dcomplex"* %tmp.0.i13103, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i13106 = load double* %tmp.14.i13105 ; <double> [#uses=1]
- store double %tmp.15.i13106, double* %tmp.13.i13104
- %tmp.16.i13107 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1137, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i13108 = getelementptr %"struct.std::dcomplex"* %tmp.0.i13103, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i13109 = load double* %tmp.17.i13108 ; <double> [#uses=1]
- store double %tmp.18.i13109, double* %tmp.16.i13107
- %tmp.4.i13083 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i13082, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i13162, double* %tmp.4.i13083
- %tmp.7.i13086 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i13082, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i13165, double* %tmp.7.i13086
- %tmp.0.i13089 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i13082, %"struct.std::dcomplex"* %mem_tmp.1137 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i13091 = getelementptr %"struct.std::dcomplex"* %tmp.0.i13089, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i13092 = load double* %tmp.14.i13091 ; <double> [#uses=1]
- %tmp.17.i13094 = getelementptr %"struct.std::dcomplex"* %tmp.0.i13089, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i13095 = load double* %tmp.17.i13094 ; <double> [#uses=1]
- %tmp.4.i13069 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i13068, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i13071 = load double* %tmp.5.i34338 ; <double> [#uses=1]
- store double %tmp.6.i13071, double* %tmp.4.i13069
- %tmp.7.i13072 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i13068, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i13074 = load double* %tmp.8.i34341 ; <double> [#uses=1]
- store double %tmp.9.i13074, double* %tmp.7.i13072
- %tmp.0.i13075 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i13068, %"struct.std::dcomplex"* %tmp.62 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i13077 = getelementptr %"struct.std::dcomplex"* %tmp.0.i13075, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i13078 = load double* %tmp.14.i13077 ; <double> [#uses=1]
- %tmp.17.i13080 = getelementptr %"struct.std::dcomplex"* %tmp.0.i13075, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i13081 = load double* %tmp.17.i13080 ; <double> [#uses=1]
- %tmp.4.i13055 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i13054, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i13057 = load double* %tmp.5.i34082 ; <double> [#uses=1]
- store double %tmp.6.i13057, double* %tmp.4.i13055
- %tmp.7.i13058 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i13054, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i13060 = load double* %tmp.8.i34085 ; <double> [#uses=1]
- store double %tmp.9.i13060, double* %tmp.7.i13058
- %tmp.0.i13061 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i13054, %"struct.std::dcomplex"* %tmp.6 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i13062 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1144, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i13063 = getelementptr %"struct.std::dcomplex"* %tmp.0.i13061, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i13064 = load double* %tmp.14.i13063 ; <double> [#uses=1]
- store double %tmp.15.i13064, double* %tmp.13.i13062
- %tmp.16.i13065 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1144, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i13066 = getelementptr %"struct.std::dcomplex"* %tmp.0.i13061, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i13067 = load double* %tmp.17.i13066 ; <double> [#uses=1]
- store double %tmp.18.i13067, double* %tmp.16.i13065
- %tmp.4.i13041 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i13040, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i13078, double* %tmp.4.i13041
- %tmp.7.i13044 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i13040, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i13081, double* %tmp.7.i13044
- %tmp.0.i13047 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i13040, %"struct.std::dcomplex"* %mem_tmp.1144 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i13049 = getelementptr %"struct.std::dcomplex"* %tmp.0.i13047, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i13050 = load double* %tmp.14.i13049 ; <double> [#uses=1]
- %tmp.17.i13052 = getelementptr %"struct.std::dcomplex"* %tmp.0.i13047, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i13053 = load double* %tmp.17.i13052 ; <double> [#uses=1]
- %tmp.4.i13027 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i13026, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i13050, double* %tmp.4.i13027
- %tmp.7.i13030 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i13026, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i13053, double* %tmp.7.i13030
- %tmp.0.i13033 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i13026, %"struct.std::dcomplex"* %tmp.30 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i13034 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1141, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i13035 = getelementptr %"struct.std::dcomplex"* %tmp.0.i13033, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i13036 = load double* %tmp.14.i13035 ; <double> [#uses=1]
- store double %tmp.15.i13036, double* %tmp.13.i13034
- %tmp.16.i13037 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1141, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i13038 = getelementptr %"struct.std::dcomplex"* %tmp.0.i13033, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i13039 = load double* %tmp.17.i13038 ; <double> [#uses=1]
- store double %tmp.18.i13039, double* %tmp.16.i13037
- %tmp.4.i13013 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i13012, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i13092, double* %tmp.4.i13013
- %tmp.7.i13016 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i13012, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i13095, double* %tmp.7.i13016
- %tmp.0.i13019 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i13012, %"struct.std::dcomplex"* %mem_tmp.1141 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i13021 = getelementptr %"struct.std::dcomplex"* %tmp.0.i13019, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i13022 = load double* %tmp.14.i13021 ; <double> [#uses=1]
- %tmp.17.i13024 = getelementptr %"struct.std::dcomplex"* %tmp.0.i13019, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i13025 = load double* %tmp.17.i13024 ; <double> [#uses=1]
- store double %tmp.15.i13022, double* %tmp.2.i34364
- store double %tmp.18.i13025, double* %tmp.6.i34365
- %tmp.4.i12979 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i12978, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i12981 = load double* %tmp.5.i27590 ; <double> [#uses=1]
- store double %tmp.6.i12981, double* %tmp.4.i12979
- %tmp.7.i12982 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i12978, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i12984 = load double* %tmp.8.i27593 ; <double> [#uses=1]
- store double %tmp.9.i12984, double* %tmp.7.i12982
- %tmp.0.i12985 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i12978, %"struct.std::dcomplex"* %ret3 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i12987 = getelementptr %"struct.std::dcomplex"* %tmp.0.i12985, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i12988 = load double* %tmp.14.i12987 ; <double> [#uses=1]
- %tmp.17.i12990 = getelementptr %"struct.std::dcomplex"* %tmp.0.i12985, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i12991 = load double* %tmp.17.i12990 ; <double> [#uses=1]
- %tmp.7.i12945 = load double* %tmp.2.i34366 ; <double> [#uses=1]
- %tmp.15.i12959 = add double %tmp.7.i12945, %tmp.15.i12988 ; <double> [#uses=1]
- store double %tmp.15.i12959, double* %tmp.2.i34366
- %tmp.26.i12966 = load double* %tmp.6.i34367 ; <double> [#uses=1]
- %tmp.31.i12977 = add double %tmp.26.i12966, %tmp.18.i12991 ; <double> [#uses=1]
- store double %tmp.31.i12977, double* %tmp.6.i34367
- %tmp.4.i12925 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i12924, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i12927 = load double* %tmp.5.i34082 ; <double> [#uses=1]
- store double %tmp.6.i12927, double* %tmp.4.i12925
- %tmp.7.i12928 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i12924, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i12930 = load double* %tmp.8.i34085 ; <double> [#uses=1]
- store double %tmp.9.i12930, double* %tmp.7.i12928
- %tmp.0.i12931 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i12924, %"struct.std::dcomplex"* %tmp.6 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i12933 = getelementptr %"struct.std::dcomplex"* %tmp.0.i12931, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i12934 = load double* %tmp.14.i12933 ; <double> [#uses=1]
- %tmp.17.i12936 = getelementptr %"struct.std::dcomplex"* %tmp.0.i12931, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i12937 = load double* %tmp.17.i12936 ; <double> [#uses=1]
- %tmp.4.i12911 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i12910, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i12913 = load double* %tmp.5.i34338 ; <double> [#uses=1]
- store double %tmp.6.i12913, double* %tmp.4.i12911
- %tmp.7.i12914 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i12910, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i12916 = load double* %tmp.8.i34341 ; <double> [#uses=1]
- store double %tmp.9.i12916, double* %tmp.7.i12914
- %tmp.0.i12917 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i12910, %"struct.std::dcomplex"* %tmp.62 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i12918 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1151, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i12919 = getelementptr %"struct.std::dcomplex"* %tmp.0.i12917, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i12920 = load double* %tmp.14.i12919 ; <double> [#uses=1]
- store double %tmp.15.i12920, double* %tmp.13.i12918
- %tmp.16.i12921 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1151, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i12922 = getelementptr %"struct.std::dcomplex"* %tmp.0.i12917, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i12923 = load double* %tmp.17.i12922 ; <double> [#uses=1]
- store double %tmp.18.i12923, double* %tmp.16.i12921
- %tmp.4.i12897 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i12896, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i12934, double* %tmp.4.i12897
- %tmp.7.i12900 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i12896, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i12937, double* %tmp.7.i12900
- %tmp.0.i12903 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i12896, %"struct.std::dcomplex"* %mem_tmp.1151 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i12905 = getelementptr %"struct.std::dcomplex"* %tmp.0.i12903, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i12906 = load double* %tmp.14.i12905 ; <double> [#uses=1]
- %tmp.17.i12908 = getelementptr %"struct.std::dcomplex"* %tmp.0.i12903, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i12909 = load double* %tmp.17.i12908 ; <double> [#uses=1]
- %tmp.4.i12883 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i12882, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i12906, double* %tmp.4.i12883
- %tmp.7.i12886 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i12882, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i12909, double* %tmp.7.i12886
- %tmp.0.i12889 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i12882, %"struct.std::dcomplex"* %tmp.1075 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i12891 = getelementptr %"struct.std::dcomplex"* %tmp.0.i12889, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i12892 = load double* %tmp.14.i12891 ; <double> [#uses=1]
- %tmp.17.i12894 = getelementptr %"struct.std::dcomplex"* %tmp.0.i12889, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i12895 = load double* %tmp.17.i12894 ; <double> [#uses=1]
- %tmp.4.i12869 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i12868, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i12871 = load double* %tmp.5.i28602 ; <double> [#uses=1]
- store double %tmp.6.i12871, double* %tmp.4.i12869
- %tmp.7.i12872 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i12868, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i12874 = load double* %tmp.8.i28605 ; <double> [#uses=1]
- store double %tmp.9.i12874, double* %tmp.7.i12872
- %tmp.0.i12875 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i12868, %"struct.std::dcomplex"* %tmp.62 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i12877 = getelementptr %"struct.std::dcomplex"* %tmp.0.i12875, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i12878 = load double* %tmp.14.i12877 ; <double> [#uses=1]
- %tmp.17.i12880 = getelementptr %"struct.std::dcomplex"* %tmp.0.i12875, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i12881 = load double* %tmp.17.i12880 ; <double> [#uses=1]
- %tmp.4.i12855 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i12854, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i12857 = load double* %tmp.5.i34082 ; <double> [#uses=1]
- store double %tmp.6.i12857, double* %tmp.4.i12855
- %tmp.7.i12858 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i12854, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i12860 = load double* %tmp.8.i34085 ; <double> [#uses=1]
- store double %tmp.9.i12860, double* %tmp.7.i12858
- %tmp.0.i12861 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i12854, %"struct.std::dcomplex"* %tmp.1036 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i12862 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1155, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i12863 = getelementptr %"struct.std::dcomplex"* %tmp.0.i12861, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i12864 = load double* %tmp.14.i12863 ; <double> [#uses=1]
- store double %tmp.15.i12864, double* %tmp.13.i12862
- %tmp.16.i12865 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1155, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i12866 = getelementptr %"struct.std::dcomplex"* %tmp.0.i12861, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i12867 = load double* %tmp.17.i12866 ; <double> [#uses=1]
- store double %tmp.18.i12867, double* %tmp.16.i12865
- %tmp.4.i12841 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i12840, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i12878, double* %tmp.4.i12841
- %tmp.7.i12844 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i12840, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i12881, double* %tmp.7.i12844
- %tmp.0.i12847 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i12840, %"struct.std::dcomplex"* %mem_tmp.1155 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i12849 = getelementptr %"struct.std::dcomplex"* %tmp.0.i12847, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i12850 = load double* %tmp.14.i12849 ; <double> [#uses=1]
- %tmp.17.i12852 = getelementptr %"struct.std::dcomplex"* %tmp.0.i12847, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i12853 = load double* %tmp.17.i12852 ; <double> [#uses=1]
- %tmp.4.i12827 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i12826, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i12850, double* %tmp.4.i12827
- %tmp.7.i12830 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i12826, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i12853, double* %tmp.7.i12830
- %tmp.0.i12833 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i12826, %"struct.std::dcomplex"* %tmp.45 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i12834 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1152, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i12835 = getelementptr %"struct.std::dcomplex"* %tmp.0.i12833, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i12836 = load double* %tmp.14.i12835 ; <double> [#uses=1]
- store double %tmp.15.i12836, double* %tmp.13.i12834
- %tmp.16.i12837 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1152, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i12838 = getelementptr %"struct.std::dcomplex"* %tmp.0.i12833, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i12839 = load double* %tmp.17.i12838 ; <double> [#uses=1]
- store double %tmp.18.i12839, double* %tmp.16.i12837
- %tmp.4.i12813 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i12812, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i12892, double* %tmp.4.i12813
- %tmp.7.i12816 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i12812, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i12895, double* %tmp.7.i12816
- %tmp.0.i12819 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i12812, %"struct.std::dcomplex"* %mem_tmp.1152 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i12821 = getelementptr %"struct.std::dcomplex"* %tmp.0.i12819, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i12822 = load double* %tmp.14.i12821 ; <double> [#uses=1]
- %tmp.17.i12824 = getelementptr %"struct.std::dcomplex"* %tmp.0.i12819, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i12825 = load double* %tmp.17.i12824 ; <double> [#uses=1]
- %tmp.4.i12799 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i12798, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i12801 = load double* %tmp.5.i34338 ; <double> [#uses=1]
- store double %tmp.6.i12801, double* %tmp.4.i12799
- %tmp.7.i12802 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i12798, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i12804 = load double* %tmp.8.i34341 ; <double> [#uses=1]
- store double %tmp.9.i12804, double* %tmp.7.i12802
- %tmp.0.i12805 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i12798, %"struct.std::dcomplex"* %tmp.1036 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i12807 = getelementptr %"struct.std::dcomplex"* %tmp.0.i12805, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i12808 = load double* %tmp.14.i12807 ; <double> [#uses=1]
- %tmp.17.i12810 = getelementptr %"struct.std::dcomplex"* %tmp.0.i12805, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i12811 = load double* %tmp.17.i12810 ; <double> [#uses=1]
- %tmp.4.i12785 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i12784, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i12787 = load double* %tmp.5.i28602 ; <double> [#uses=1]
- store double %tmp.6.i12787, double* %tmp.4.i12785
- %tmp.7.i12788 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i12784, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i12790 = load double* %tmp.8.i28605 ; <double> [#uses=1]
- store double %tmp.9.i12790, double* %tmp.7.i12788
- %tmp.0.i12791 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i12784, %"struct.std::dcomplex"* %tmp.6 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i12792 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1159, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i12793 = getelementptr %"struct.std::dcomplex"* %tmp.0.i12791, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i12794 = load double* %tmp.14.i12793 ; <double> [#uses=1]
- store double %tmp.15.i12794, double* %tmp.13.i12792
- %tmp.16.i12795 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1159, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i12796 = getelementptr %"struct.std::dcomplex"* %tmp.0.i12791, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i12797 = load double* %tmp.17.i12796 ; <double> [#uses=1]
- store double %tmp.18.i12797, double* %tmp.16.i12795
- %tmp.4.i12771 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i12770, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i12808, double* %tmp.4.i12771
- %tmp.7.i12774 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i12770, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i12811, double* %tmp.7.i12774
- %tmp.0.i12777 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i12770, %"struct.std::dcomplex"* %mem_tmp.1159 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i12779 = getelementptr %"struct.std::dcomplex"* %tmp.0.i12777, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i12780 = load double* %tmp.14.i12779 ; <double> [#uses=1]
- %tmp.17.i12782 = getelementptr %"struct.std::dcomplex"* %tmp.0.i12777, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i12783 = load double* %tmp.17.i12782 ; <double> [#uses=1]
- %tmp.4.i12757 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i12756, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i12780, double* %tmp.4.i12757
- %tmp.7.i12760 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i12756, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i12783, double* %tmp.7.i12760
- %tmp.0.i12763 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i12756, %"struct.std::dcomplex"* %tmp.95 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i12764 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1156, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i12765 = getelementptr %"struct.std::dcomplex"* %tmp.0.i12763, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i12766 = load double* %tmp.14.i12765 ; <double> [#uses=1]
- store double %tmp.15.i12766, double* %tmp.13.i12764
- %tmp.16.i12767 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1156, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i12768 = getelementptr %"struct.std::dcomplex"* %tmp.0.i12763, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i12769 = load double* %tmp.17.i12768 ; <double> [#uses=1]
- store double %tmp.18.i12769, double* %tmp.16.i12767
- %tmp.4.i12743 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i12742, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i12822, double* %tmp.4.i12743
- %tmp.7.i12746 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i12742, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i12825, double* %tmp.7.i12746
- %tmp.0.i12749 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i12742, %"struct.std::dcomplex"* %mem_tmp.1156 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i12751 = getelementptr %"struct.std::dcomplex"* %tmp.0.i12749, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i12752 = load double* %tmp.14.i12751 ; <double> [#uses=1]
- %tmp.17.i12754 = getelementptr %"struct.std::dcomplex"* %tmp.0.i12749, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i12755 = load double* %tmp.17.i12754 ; <double> [#uses=1]
- store double %tmp.15.i12752, double* %tmp.2.i34364
- store double %tmp.18.i12755, double* %tmp.6.i34365
- %tmp.4.i12709 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i12708, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i12711 = load double* %tmp.5.i33866 ; <double> [#uses=1]
- store double %tmp.6.i12711, double* %tmp.4.i12709
- %tmp.7.i12712 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i12708, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i12714 = load double* %tmp.8.i33869 ; <double> [#uses=1]
- store double %tmp.9.i12714, double* %tmp.7.i12712
- %tmp.0.i12715 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i12708, %"struct.std::dcomplex"* %ret3 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i12717 = getelementptr %"struct.std::dcomplex"* %tmp.0.i12715, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i12718 = load double* %tmp.14.i12717 ; <double> [#uses=1]
- %tmp.17.i12720 = getelementptr %"struct.std::dcomplex"* %tmp.0.i12715, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i12721 = load double* %tmp.17.i12720 ; <double> [#uses=1]
- %tmp.7.i12675 = load double* %tmp.2.i34366 ; <double> [#uses=1]
- %tmp.15.i12689 = add double %tmp.7.i12675, %tmp.15.i12718 ; <double> [#uses=1]
- store double %tmp.15.i12689, double* %tmp.2.i34366
- %tmp.26.i12696 = load double* %tmp.6.i34367 ; <double> [#uses=1]
- %tmp.31.i12707 = add double %tmp.26.i12696, %tmp.18.i12721 ; <double> [#uses=1]
- store double %tmp.31.i12707, double* %tmp.6.i34367
- %tmp.4.i12655 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i12654, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i12657 = load double* %tmp.5.i33272 ; <double> [#uses=1]
- store double %tmp.6.i12657, double* %tmp.4.i12655
- %tmp.7.i12658 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i12654, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i12660 = load double* %tmp.8.i33275 ; <double> [#uses=1]
- store double %tmp.9.i12660, double* %tmp.7.i12658
- %tmp.0.i12661 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i12654, %"struct.std::dcomplex"* %ret4 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i12663 = getelementptr %"struct.std::dcomplex"* %tmp.0.i12661, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i12664 = load double* %tmp.14.i12663 ; <double> [#uses=1]
- %tmp.17.i12666 = getelementptr %"struct.std::dcomplex"* %tmp.0.i12661, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i12667 = load double* %tmp.17.i12666 ; <double> [#uses=1]
- %tmp.7.i12621 = load double* %tmp.2.i34368 ; <double> [#uses=1]
- %tmp.15.i12635 = add double %tmp.7.i12621, %tmp.15.i12664 ; <double> [#uses=1]
- store double %tmp.15.i12635, double* %tmp.2.i34368
- %tmp.26.i12642 = load double* %tmp.6.i34369 ; <double> [#uses=1]
- %tmp.31.i12653 = add double %tmp.26.i12642, %tmp.18.i12667 ; <double> [#uses=1]
- store double %tmp.31.i12653, double* %tmp.6.i34369
- store double 0.000000e+00, double* %tmp.2.i34366
- store double 0.000000e+00, double* %tmp.6.i34367
- %tmp.4.i12599 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i12598, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i12601 = load double* %tmp.5.i33146 ; <double> [#uses=1]
- store double %tmp.6.i12601, double* %tmp.4.i12599
- %tmp.7.i12602 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i12598, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i12604 = load double* %tmp.8.i33149 ; <double> [#uses=1]
- store double %tmp.9.i12604, double* %tmp.7.i12602
- %tmp.0.i12605 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i12598, %"struct.std::dcomplex"* %tmp.6 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i12607 = getelementptr %"struct.std::dcomplex"* %tmp.0.i12605, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i12608 = load double* %tmp.14.i12607 ; <double> [#uses=1]
- %tmp.17.i12610 = getelementptr %"struct.std::dcomplex"* %tmp.0.i12605, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i12611 = load double* %tmp.17.i12610 ; <double> [#uses=1]
- %tmp.4.i12585 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i12584, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i12587 = load double* %tmp.5.i34338 ; <double> [#uses=1]
- store double %tmp.6.i12587, double* %tmp.4.i12585
- %tmp.7.i12588 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i12584, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i12590 = load double* %tmp.8.i34341 ; <double> [#uses=1]
- store double %tmp.9.i12590, double* %tmp.7.i12588
- %tmp.0.i12591 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i12584, %"struct.std::dcomplex"* %tmp.226 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i12592 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1167, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i12593 = getelementptr %"struct.std::dcomplex"* %tmp.0.i12591, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i12594 = load double* %tmp.14.i12593 ; <double> [#uses=1]
- store double %tmp.15.i12594, double* %tmp.13.i12592
- %tmp.16.i12595 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1167, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i12596 = getelementptr %"struct.std::dcomplex"* %tmp.0.i12591, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i12597 = load double* %tmp.17.i12596 ; <double> [#uses=1]
- store double %tmp.18.i12597, double* %tmp.16.i12595
- %tmp.4.i12571 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i12570, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i12608, double* %tmp.4.i12571
- %tmp.7.i12574 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i12570, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i12611, double* %tmp.7.i12574
- %tmp.0.i12577 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i12570, %"struct.std::dcomplex"* %mem_tmp.1167 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i12579 = getelementptr %"struct.std::dcomplex"* %tmp.0.i12577, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i12580 = load double* %tmp.14.i12579 ; <double> [#uses=1]
- %tmp.17.i12582 = getelementptr %"struct.std::dcomplex"* %tmp.0.i12577, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i12583 = load double* %tmp.17.i12582 ; <double> [#uses=1]
- %tmp.4.i12557 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i12556, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i12580, double* %tmp.4.i12557
- %tmp.7.i12560 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i12556, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i12583, double* %tmp.7.i12560
- %tmp.0.i12563 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i12556, %"struct.std::dcomplex"* %tmp.95 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i12565 = getelementptr %"struct.std::dcomplex"* %tmp.0.i12563, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i12566 = load double* %tmp.14.i12565 ; <double> [#uses=1]
- %tmp.17.i12568 = getelementptr %"struct.std::dcomplex"* %tmp.0.i12563, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i12569 = load double* %tmp.17.i12568 ; <double> [#uses=1]
- %tmp.4.i12543 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i12542, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i12545 = load double* %tmp.5.i34338 ; <double> [#uses=1]
- store double %tmp.6.i12545, double* %tmp.4.i12543
- %tmp.7.i12546 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i12542, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i12548 = load double* %tmp.8.i34341 ; <double> [#uses=1]
- store double %tmp.9.i12548, double* %tmp.7.i12546
- %tmp.0.i12549 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i12542, %"struct.std::dcomplex"* %tmp.62 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i12551 = getelementptr %"struct.std::dcomplex"* %tmp.0.i12549, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i12552 = load double* %tmp.14.i12551 ; <double> [#uses=1]
- %tmp.17.i12554 = getelementptr %"struct.std::dcomplex"* %tmp.0.i12549, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i12555 = load double* %tmp.17.i12554 ; <double> [#uses=1]
- %tmp.4.i12529 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i12528, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i12531 = load double* %tmp.5.i34082 ; <double> [#uses=1]
- store double %tmp.6.i12531, double* %tmp.4.i12529
- %tmp.7.i12532 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i12528, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i12534 = load double* %tmp.8.i34085 ; <double> [#uses=1]
- store double %tmp.9.i12534, double* %tmp.7.i12532
- %tmp.0.i12535 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i12528, %"struct.std::dcomplex"* %tmp.6 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i12536 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1171, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i12537 = getelementptr %"struct.std::dcomplex"* %tmp.0.i12535, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i12538 = load double* %tmp.14.i12537 ; <double> [#uses=1]
- store double %tmp.15.i12538, double* %tmp.13.i12536
- %tmp.16.i12539 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1171, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i12540 = getelementptr %"struct.std::dcomplex"* %tmp.0.i12535, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i12541 = load double* %tmp.17.i12540 ; <double> [#uses=1]
- store double %tmp.18.i12541, double* %tmp.16.i12539
- %tmp.4.i12515 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i12514, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i12552, double* %tmp.4.i12515
- %tmp.7.i12518 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i12514, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i12555, double* %tmp.7.i12518
- %tmp.0.i12521 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i12514, %"struct.std::dcomplex"* %mem_tmp.1171 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i12523 = getelementptr %"struct.std::dcomplex"* %tmp.0.i12521, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i12524 = load double* %tmp.14.i12523 ; <double> [#uses=1]
- %tmp.17.i12526 = getelementptr %"struct.std::dcomplex"* %tmp.0.i12521, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i12527 = load double* %tmp.17.i12526 ; <double> [#uses=1]
- %tmp.4.i12501 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i12500, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i12524, double* %tmp.4.i12501
- %tmp.7.i12504 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i12500, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i12527, double* %tmp.7.i12504
- %tmp.0.i12507 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i12500, %"struct.std::dcomplex"* %tmp.220 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i12508 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1168, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i12509 = getelementptr %"struct.std::dcomplex"* %tmp.0.i12507, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i12510 = load double* %tmp.14.i12509 ; <double> [#uses=1]
- store double %tmp.15.i12510, double* %tmp.13.i12508
- %tmp.16.i12511 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1168, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i12512 = getelementptr %"struct.std::dcomplex"* %tmp.0.i12507, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i12513 = load double* %tmp.17.i12512 ; <double> [#uses=1]
- store double %tmp.18.i12513, double* %tmp.16.i12511
- %tmp.4.i12487 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i12486, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i12566, double* %tmp.4.i12487
- %tmp.7.i12490 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i12486, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i12569, double* %tmp.7.i12490
- %tmp.0.i12493 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i12486, %"struct.std::dcomplex"* %mem_tmp.1168 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i12495 = getelementptr %"struct.std::dcomplex"* %tmp.0.i12493, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i12496 = load double* %tmp.14.i12495 ; <double> [#uses=1]
- %tmp.17.i12498 = getelementptr %"struct.std::dcomplex"* %tmp.0.i12493, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i12499 = load double* %tmp.17.i12498 ; <double> [#uses=1]
- %tmp.4.i12473 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i12472, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i12475 = load double* %tmp.5.i34082 ; <double> [#uses=1]
- store double %tmp.6.i12475, double* %tmp.4.i12473
- %tmp.7.i12476 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i12472, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i12478 = load double* %tmp.8.i34085 ; <double> [#uses=1]
- store double %tmp.9.i12478, double* %tmp.7.i12476
- %tmp.0.i12479 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i12472, %"struct.std::dcomplex"* %tmp.226 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i12481 = getelementptr %"struct.std::dcomplex"* %tmp.0.i12479, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i12482 = load double* %tmp.14.i12481 ; <double> [#uses=1]
- %tmp.17.i12484 = getelementptr %"struct.std::dcomplex"* %tmp.0.i12479, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i12485 = load double* %tmp.17.i12484 ; <double> [#uses=1]
- %tmp.4.i12459 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i12458, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i12461 = load double* %tmp.5.i33146 ; <double> [#uses=1]
- store double %tmp.6.i12461, double* %tmp.4.i12459
- %tmp.7.i12462 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i12458, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i12464 = load double* %tmp.8.i33149 ; <double> [#uses=1]
- store double %tmp.9.i12464, double* %tmp.7.i12462
- %tmp.0.i12465 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i12458, %"struct.std::dcomplex"* %tmp.62 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i12466 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1175, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i12467 = getelementptr %"struct.std::dcomplex"* %tmp.0.i12465, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i12468 = load double* %tmp.14.i12467 ; <double> [#uses=1]
- store double %tmp.15.i12468, double* %tmp.13.i12466
- %tmp.16.i12469 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1175, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i12470 = getelementptr %"struct.std::dcomplex"* %tmp.0.i12465, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i12471 = load double* %tmp.17.i12470 ; <double> [#uses=1]
- store double %tmp.18.i12471, double* %tmp.16.i12469
- %tmp.4.i12445 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i12444, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i12482, double* %tmp.4.i12445
- %tmp.7.i12448 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i12444, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i12485, double* %tmp.7.i12448
- %tmp.0.i12451 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i12444, %"struct.std::dcomplex"* %mem_tmp.1175 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i12453 = getelementptr %"struct.std::dcomplex"* %tmp.0.i12451, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i12454 = load double* %tmp.14.i12453 ; <double> [#uses=1]
- %tmp.17.i12456 = getelementptr %"struct.std::dcomplex"* %tmp.0.i12451, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i12457 = load double* %tmp.17.i12456 ; <double> [#uses=1]
- %tmp.4.i12431 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i12430, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i12454, double* %tmp.4.i12431
- %tmp.7.i12434 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i12430, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i12457, double* %tmp.7.i12434
- %tmp.0.i12437 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i12430, %"struct.std::dcomplex"* %tmp.45 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i12438 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1172, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i12439 = getelementptr %"struct.std::dcomplex"* %tmp.0.i12437, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i12440 = load double* %tmp.14.i12439 ; <double> [#uses=1]
- store double %tmp.15.i12440, double* %tmp.13.i12438
- %tmp.16.i12441 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1172, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i12442 = getelementptr %"struct.std::dcomplex"* %tmp.0.i12437, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i12443 = load double* %tmp.17.i12442 ; <double> [#uses=1]
- store double %tmp.18.i12443, double* %tmp.16.i12441
- %tmp.4.i12417 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i12416, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i12496, double* %tmp.4.i12417
- %tmp.7.i12420 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i12416, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i12499, double* %tmp.7.i12420
- %tmp.0.i12423 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i12416, %"struct.std::dcomplex"* %mem_tmp.1172 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i12425 = getelementptr %"struct.std::dcomplex"* %tmp.0.i12423, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i12426 = load double* %tmp.14.i12425 ; <double> [#uses=1]
- %tmp.17.i12428 = getelementptr %"struct.std::dcomplex"* %tmp.0.i12423, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i12429 = load double* %tmp.17.i12428 ; <double> [#uses=1]
- store double %tmp.15.i12426, double* %tmp.2.i34364
- store double %tmp.18.i12429, double* %tmp.6.i34365
- %tmp.4.i12383 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i12382, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i12385 = load double* %tmp.5.i33866 ; <double> [#uses=1]
- store double %tmp.6.i12385, double* %tmp.4.i12383
- %tmp.7.i12386 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i12382, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i12388 = load double* %tmp.8.i33869 ; <double> [#uses=1]
- store double %tmp.9.i12388, double* %tmp.7.i12386
- %tmp.0.i12389 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i12382, %"struct.std::dcomplex"* %ret3 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i12391 = getelementptr %"struct.std::dcomplex"* %tmp.0.i12389, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i12392 = load double* %tmp.14.i12391 ; <double> [#uses=1]
- %tmp.17.i12394 = getelementptr %"struct.std::dcomplex"* %tmp.0.i12389, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i12395 = load double* %tmp.17.i12394 ; <double> [#uses=1]
- %tmp.7.i12349 = load double* %tmp.2.i34366 ; <double> [#uses=1]
- %tmp.15.i12363 = add double %tmp.7.i12349, %tmp.15.i12392 ; <double> [#uses=1]
- store double %tmp.15.i12363, double* %tmp.2.i34366
- %tmp.26.i12370 = load double* %tmp.6.i34367 ; <double> [#uses=1]
- %tmp.31.i12381 = add double %tmp.26.i12370, %tmp.18.i12395 ; <double> [#uses=1]
- store double %tmp.31.i12381, double* %tmp.6.i34367
- %tmp.4.i12329 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i12328, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i12331 = load double* %tmp.5.i33146 ; <double> [#uses=1]
- store double %tmp.6.i12331, double* %tmp.4.i12329
- %tmp.7.i12332 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i12328, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i12334 = load double* %tmp.8.i33149 ; <double> [#uses=1]
- store double %tmp.9.i12334, double* %tmp.7.i12332
- %tmp.0.i12335 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i12328, %"struct.std::dcomplex"* %tmp.62 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i12337 = getelementptr %"struct.std::dcomplex"* %tmp.0.i12335, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i12338 = load double* %tmp.14.i12337 ; <double> [#uses=1]
- %tmp.17.i12340 = getelementptr %"struct.std::dcomplex"* %tmp.0.i12335, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i12341 = load double* %tmp.17.i12340 ; <double> [#uses=1]
- %tmp.4.i12315 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i12314, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i12317 = load double* %tmp.5.i34082 ; <double> [#uses=1]
- store double %tmp.6.i12317, double* %tmp.4.i12315
- %tmp.7.i12318 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i12314, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i12320 = load double* %tmp.8.i34085 ; <double> [#uses=1]
- store double %tmp.9.i12320, double* %tmp.7.i12318
- %tmp.0.i12321 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i12314, %"struct.std::dcomplex"* %tmp.226 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i12322 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1182, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i12323 = getelementptr %"struct.std::dcomplex"* %tmp.0.i12321, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i12324 = load double* %tmp.14.i12323 ; <double> [#uses=1]
- store double %tmp.15.i12324, double* %tmp.13.i12322
- %tmp.16.i12325 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1182, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i12326 = getelementptr %"struct.std::dcomplex"* %tmp.0.i12321, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i12327 = load double* %tmp.17.i12326 ; <double> [#uses=1]
- store double %tmp.18.i12327, double* %tmp.16.i12325
- %tmp.4.i12301 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i12300, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i12338, double* %tmp.4.i12301
- %tmp.7.i12304 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i12300, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i12341, double* %tmp.7.i12304
- %tmp.0.i12307 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i12300, %"struct.std::dcomplex"* %mem_tmp.1182 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i12309 = getelementptr %"struct.std::dcomplex"* %tmp.0.i12307, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i12310 = load double* %tmp.14.i12309 ; <double> [#uses=1]
- %tmp.17.i12312 = getelementptr %"struct.std::dcomplex"* %tmp.0.i12307, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i12313 = load double* %tmp.17.i12312 ; <double> [#uses=1]
- %tmp.4.i12287 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i12286, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i12310, double* %tmp.4.i12287
- %tmp.7.i12290 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i12286, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i12313, double* %tmp.7.i12290
- %tmp.0.i12293 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i12286, %"struct.std::dcomplex"* %tmp.30 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i12295 = getelementptr %"struct.std::dcomplex"* %tmp.0.i12293, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i12296 = load double* %tmp.14.i12295 ; <double> [#uses=1]
- %tmp.17.i12298 = getelementptr %"struct.std::dcomplex"* %tmp.0.i12293, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i12299 = load double* %tmp.17.i12298 ; <double> [#uses=1]
- %tmp.4.i12273 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i12272, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i12275 = load double* %tmp.5.i34352 ; <double> [#uses=1]
- store double %tmp.6.i12275, double* %tmp.4.i12273
- %tmp.7.i12276 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i12272, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i12278 = load double* %tmp.8.i34355 ; <double> [#uses=1]
- store double %tmp.9.i12278, double* %tmp.7.i12276
- %tmp.0.i12279 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i12272, %"struct.std::dcomplex"* %tmp.226 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i12281 = getelementptr %"struct.std::dcomplex"* %tmp.0.i12279, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i12282 = load double* %tmp.14.i12281 ; <double> [#uses=1]
- %tmp.17.i12284 = getelementptr %"struct.std::dcomplex"* %tmp.0.i12279, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i12285 = load double* %tmp.17.i12284 ; <double> [#uses=1]
- %tmp.4.i12259 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i12258, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i12261 = load double* %tmp.5.i33146 ; <double> [#uses=1]
- store double %tmp.6.i12261, double* %tmp.4.i12259
- %tmp.7.i12262 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i12258, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i12264 = load double* %tmp.8.i33149 ; <double> [#uses=1]
- store double %tmp.9.i12264, double* %tmp.7.i12262
- %tmp.0.i12265 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i12258, %"struct.std::dcomplex"* %tmp.12 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i12266 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1186, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i12267 = getelementptr %"struct.std::dcomplex"* %tmp.0.i12265, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i12268 = load double* %tmp.14.i12267 ; <double> [#uses=1]
- store double %tmp.15.i12268, double* %tmp.13.i12266
- %tmp.16.i12269 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1186, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i12270 = getelementptr %"struct.std::dcomplex"* %tmp.0.i12265, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i12271 = load double* %tmp.17.i12270 ; <double> [#uses=1]
- store double %tmp.18.i12271, double* %tmp.16.i12269
- %tmp.4.i12245 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i12244, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i12282, double* %tmp.4.i12245
- %tmp.7.i12248 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i12244, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i12285, double* %tmp.7.i12248
- %tmp.0.i12251 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i12244, %"struct.std::dcomplex"* %mem_tmp.1186 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i12253 = getelementptr %"struct.std::dcomplex"* %tmp.0.i12251, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i12254 = load double* %tmp.14.i12253 ; <double> [#uses=1]
- %tmp.17.i12256 = getelementptr %"struct.std::dcomplex"* %tmp.0.i12251, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i12257 = load double* %tmp.17.i12256 ; <double> [#uses=1]
- %tmp.4.i12231 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i12230, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i12254, double* %tmp.4.i12231
- %tmp.7.i12234 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i12230, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i12257, double* %tmp.7.i12234
- %tmp.0.i12237 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i12230, %"struct.std::dcomplex"* %tmp.95 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i12238 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1183, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i12239 = getelementptr %"struct.std::dcomplex"* %tmp.0.i12237, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i12240 = load double* %tmp.14.i12239 ; <double> [#uses=1]
- store double %tmp.15.i12240, double* %tmp.13.i12238
- %tmp.16.i12241 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1183, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i12242 = getelementptr %"struct.std::dcomplex"* %tmp.0.i12237, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i12243 = load double* %tmp.17.i12242 ; <double> [#uses=1]
- store double %tmp.18.i12243, double* %tmp.16.i12241
- %tmp.4.i12217 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i12216, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i12296, double* %tmp.4.i12217
- %tmp.7.i12220 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i12216, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i12299, double* %tmp.7.i12220
- %tmp.0.i12223 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i12216, %"struct.std::dcomplex"* %mem_tmp.1183 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i12225 = getelementptr %"struct.std::dcomplex"* %tmp.0.i12223, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i12226 = load double* %tmp.14.i12225 ; <double> [#uses=1]
- %tmp.17.i12228 = getelementptr %"struct.std::dcomplex"* %tmp.0.i12223, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i12229 = load double* %tmp.17.i12228 ; <double> [#uses=1]
- %tmp.4.i12203 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i12202, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i12205 = load double* %tmp.5.i34082 ; <double> [#uses=1]
- store double %tmp.6.i12205, double* %tmp.4.i12203
- %tmp.7.i12206 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i12202, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i12208 = load double* %tmp.8.i34085 ; <double> [#uses=1]
- store double %tmp.9.i12208, double* %tmp.7.i12206
- %tmp.0.i12209 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i12202, %"struct.std::dcomplex"* %tmp.12 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i12211 = getelementptr %"struct.std::dcomplex"* %tmp.0.i12209, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i12212 = load double* %tmp.14.i12211 ; <double> [#uses=1]
- %tmp.17.i12214 = getelementptr %"struct.std::dcomplex"* %tmp.0.i12209, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i12215 = load double* %tmp.17.i12214 ; <double> [#uses=1]
- %tmp.4.i12189 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i12188, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i12191 = load double* %tmp.5.i34352 ; <double> [#uses=1]
- store double %tmp.6.i12191, double* %tmp.4.i12189
- %tmp.7.i12192 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i12188, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i12194 = load double* %tmp.8.i34355 ; <double> [#uses=1]
- store double %tmp.9.i12194, double* %tmp.7.i12192
- %tmp.0.i12195 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i12188, %"struct.std::dcomplex"* %tmp.62 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i12196 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1190, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i12197 = getelementptr %"struct.std::dcomplex"* %tmp.0.i12195, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i12198 = load double* %tmp.14.i12197 ; <double> [#uses=1]
- store double %tmp.15.i12198, double* %tmp.13.i12196
- %tmp.16.i12199 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1190, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i12200 = getelementptr %"struct.std::dcomplex"* %tmp.0.i12195, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i12201 = load double* %tmp.17.i12200 ; <double> [#uses=1]
- store double %tmp.18.i12201, double* %tmp.16.i12199
- %tmp.4.i12175 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i12174, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i12212, double* %tmp.4.i12175
- %tmp.7.i12178 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i12174, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i12215, double* %tmp.7.i12178
- %tmp.0.i12181 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i12174, %"struct.std::dcomplex"* %mem_tmp.1190 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i12183 = getelementptr %"struct.std::dcomplex"* %tmp.0.i12181, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i12184 = load double* %tmp.14.i12183 ; <double> [#uses=1]
- %tmp.17.i12186 = getelementptr %"struct.std::dcomplex"* %tmp.0.i12181, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i12187 = load double* %tmp.17.i12186 ; <double> [#uses=1]
- %tmp.4.i12161 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i12160, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i12184, double* %tmp.4.i12161
- %tmp.7.i12164 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i12160, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i12187, double* %tmp.7.i12164
- %tmp.0.i12167 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i12160, %"struct.std::dcomplex"* %tmp.220 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i12168 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1187, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i12169 = getelementptr %"struct.std::dcomplex"* %tmp.0.i12167, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i12170 = load double* %tmp.14.i12169 ; <double> [#uses=1]
- store double %tmp.15.i12170, double* %tmp.13.i12168
- %tmp.16.i12171 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1187, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i12172 = getelementptr %"struct.std::dcomplex"* %tmp.0.i12167, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i12173 = load double* %tmp.17.i12172 ; <double> [#uses=1]
- store double %tmp.18.i12173, double* %tmp.16.i12171
- %tmp.4.i12147 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i12146, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i12226, double* %tmp.4.i12147
- %tmp.7.i12150 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i12146, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i12229, double* %tmp.7.i12150
- %tmp.0.i12153 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i12146, %"struct.std::dcomplex"* %mem_tmp.1187 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i12155 = getelementptr %"struct.std::dcomplex"* %tmp.0.i12153, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i12156 = load double* %tmp.14.i12155 ; <double> [#uses=1]
- %tmp.17.i12158 = getelementptr %"struct.std::dcomplex"* %tmp.0.i12153, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i12159 = load double* %tmp.17.i12158 ; <double> [#uses=1]
- store double %tmp.15.i12156, double* %tmp.2.i34364
- store double %tmp.18.i12159, double* %tmp.6.i34365
- %tmp.4.i12113 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i12112, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i12115 = load double* %tmp.5.i33596 ; <double> [#uses=1]
- store double %tmp.6.i12115, double* %tmp.4.i12113
- %tmp.7.i12116 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i12112, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i12118 = load double* %tmp.8.i33599 ; <double> [#uses=1]
- store double %tmp.9.i12118, double* %tmp.7.i12116
- %tmp.0.i12119 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i12112, %"struct.std::dcomplex"* %ret3 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i12121 = getelementptr %"struct.std::dcomplex"* %tmp.0.i12119, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i12122 = load double* %tmp.14.i12121 ; <double> [#uses=1]
- %tmp.17.i12124 = getelementptr %"struct.std::dcomplex"* %tmp.0.i12119, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i12125 = load double* %tmp.17.i12124 ; <double> [#uses=1]
- %tmp.7.i12079 = load double* %tmp.2.i34366 ; <double> [#uses=1]
- %tmp.15.i12093 = add double %tmp.7.i12079, %tmp.15.i12122 ; <double> [#uses=1]
- store double %tmp.15.i12093, double* %tmp.2.i34366
- %tmp.26.i12100 = load double* %tmp.6.i34367 ; <double> [#uses=1]
- %tmp.31.i12111 = add double %tmp.26.i12100, %tmp.18.i12125 ; <double> [#uses=1]
- store double %tmp.31.i12111, double* %tmp.6.i34367
- %tmp.4.i12059 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i12058, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i12061 = load double* %tmp.5.i34352 ; <double> [#uses=1]
- store double %tmp.6.i12061, double* %tmp.4.i12059
- %tmp.7.i12062 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i12058, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i12064 = load double* %tmp.8.i34355 ; <double> [#uses=1]
- store double %tmp.9.i12064, double* %tmp.7.i12062
- %tmp.0.i12065 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i12058, %"struct.std::dcomplex"* %tmp.6 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i12067 = getelementptr %"struct.std::dcomplex"* %tmp.0.i12065, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i12068 = load double* %tmp.14.i12067 ; <double> [#uses=1]
- %tmp.17.i12070 = getelementptr %"struct.std::dcomplex"* %tmp.0.i12065, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i12071 = load double* %tmp.17.i12070 ; <double> [#uses=1]
- %tmp.4.i12045 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i12044, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i12047 = load double* %tmp.5.i34338 ; <double> [#uses=1]
- store double %tmp.6.i12047, double* %tmp.4.i12045
- %tmp.7.i12048 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i12044, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i12050 = load double* %tmp.8.i34341 ; <double> [#uses=1]
- store double %tmp.9.i12050, double* %tmp.7.i12048
- %tmp.0.i12051 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i12044, %"struct.std::dcomplex"* %tmp.12 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i12052 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1197, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i12053 = getelementptr %"struct.std::dcomplex"* %tmp.0.i12051, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i12054 = load double* %tmp.14.i12053 ; <double> [#uses=1]
- store double %tmp.15.i12054, double* %tmp.13.i12052
- %tmp.16.i12055 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1197, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i12056 = getelementptr %"struct.std::dcomplex"* %tmp.0.i12051, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i12057 = load double* %tmp.17.i12056 ; <double> [#uses=1]
- store double %tmp.18.i12057, double* %tmp.16.i12055
- %tmp.4.i12031 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i12030, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i12068, double* %tmp.4.i12031
- %tmp.7.i12034 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i12030, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i12071, double* %tmp.7.i12034
- %tmp.0.i12037 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i12030, %"struct.std::dcomplex"* %mem_tmp.1197 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i12039 = getelementptr %"struct.std::dcomplex"* %tmp.0.i12037, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i12040 = load double* %tmp.14.i12039 ; <double> [#uses=1]
- %tmp.17.i12042 = getelementptr %"struct.std::dcomplex"* %tmp.0.i12037, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i12043 = load double* %tmp.17.i12042 ; <double> [#uses=1]
- %tmp.4.i12017 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i12016, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i12040, double* %tmp.4.i12017
- %tmp.7.i12020 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i12016, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i12043, double* %tmp.7.i12020
- %tmp.0.i12023 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i12016, %"struct.std::dcomplex"* %tmp.220 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i12025 = getelementptr %"struct.std::dcomplex"* %tmp.0.i12023, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i12026 = load double* %tmp.14.i12025 ; <double> [#uses=1]
- %tmp.17.i12028 = getelementptr %"struct.std::dcomplex"* %tmp.0.i12023, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i12029 = load double* %tmp.17.i12028 ; <double> [#uses=1]
- %tmp.4.i12003 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i12002, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i12005 = load double* %tmp.5.i34338 ; <double> [#uses=1]
- store double %tmp.6.i12005, double* %tmp.4.i12003
- %tmp.7.i12006 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i12002, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i12008 = load double* %tmp.8.i34341 ; <double> [#uses=1]
- store double %tmp.9.i12008, double* %tmp.7.i12006
- %tmp.0.i12009 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i12002, %"struct.std::dcomplex"* %tmp.226 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i12011 = getelementptr %"struct.std::dcomplex"* %tmp.0.i12009, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i12012 = load double* %tmp.14.i12011 ; <double> [#uses=1]
- %tmp.17.i12014 = getelementptr %"struct.std::dcomplex"* %tmp.0.i12009, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i12015 = load double* %tmp.17.i12014 ; <double> [#uses=1]
- %tmp.4.i11989 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i11988, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i11991 = load double* %tmp.5.i33146 ; <double> [#uses=1]
- store double %tmp.6.i11991, double* %tmp.4.i11989
- %tmp.7.i11992 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i11988, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i11994 = load double* %tmp.8.i33149 ; <double> [#uses=1]
- store double %tmp.9.i11994, double* %tmp.7.i11992
- %tmp.0.i11995 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i11988, %"struct.std::dcomplex"* %tmp.6 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i11996 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1201, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i11997 = getelementptr %"struct.std::dcomplex"* %tmp.0.i11995, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i11998 = load double* %tmp.14.i11997 ; <double> [#uses=1]
- store double %tmp.15.i11998, double* %tmp.13.i11996
- %tmp.16.i11999 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1201, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i12000 = getelementptr %"struct.std::dcomplex"* %tmp.0.i11995, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i12001 = load double* %tmp.17.i12000 ; <double> [#uses=1]
- store double %tmp.18.i12001, double* %tmp.16.i11999
- %tmp.4.i11975 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i11974, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i12012, double* %tmp.4.i11975
- %tmp.7.i11978 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i11974, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i12015, double* %tmp.7.i11978
- %tmp.0.i11981 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i11974, %"struct.std::dcomplex"* %mem_tmp.1201 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i11983 = getelementptr %"struct.std::dcomplex"* %tmp.0.i11981, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i11984 = load double* %tmp.14.i11983 ; <double> [#uses=1]
- %tmp.17.i11986 = getelementptr %"struct.std::dcomplex"* %tmp.0.i11981, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i11987 = load double* %tmp.17.i11986 ; <double> [#uses=1]
- %tmp.4.i11961 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i11960, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i11984, double* %tmp.4.i11961
- %tmp.7.i11964 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i11960, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i11987, double* %tmp.7.i11964
- %tmp.0.i11967 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i11960, %"struct.std::dcomplex"* %tmp.30 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i11968 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1198, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i11969 = getelementptr %"struct.std::dcomplex"* %tmp.0.i11967, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i11970 = load double* %tmp.14.i11969 ; <double> [#uses=1]
- store double %tmp.15.i11970, double* %tmp.13.i11968
- %tmp.16.i11971 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1198, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i11972 = getelementptr %"struct.std::dcomplex"* %tmp.0.i11967, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i11973 = load double* %tmp.17.i11972 ; <double> [#uses=1]
- store double %tmp.18.i11973, double* %tmp.16.i11971
- %tmp.4.i11947 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i11946, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i12026, double* %tmp.4.i11947
- %tmp.7.i11950 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i11946, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i12029, double* %tmp.7.i11950
- %tmp.0.i11953 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i11946, %"struct.std::dcomplex"* %mem_tmp.1198 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i11955 = getelementptr %"struct.std::dcomplex"* %tmp.0.i11953, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i11956 = load double* %tmp.14.i11955 ; <double> [#uses=1]
- %tmp.17.i11958 = getelementptr %"struct.std::dcomplex"* %tmp.0.i11953, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i11959 = load double* %tmp.17.i11958 ; <double> [#uses=1]
- %tmp.4.i11933 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i11932, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i11935 = load double* %tmp.5.i33146 ; <double> [#uses=1]
- store double %tmp.6.i11935, double* %tmp.4.i11933
- %tmp.7.i11936 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i11932, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i11938 = load double* %tmp.8.i33149 ; <double> [#uses=1]
- store double %tmp.9.i11938, double* %tmp.7.i11936
- %tmp.0.i11939 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i11932, %"struct.std::dcomplex"* %tmp.12 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i11941 = getelementptr %"struct.std::dcomplex"* %tmp.0.i11939, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i11942 = load double* %tmp.14.i11941 ; <double> [#uses=1]
- %tmp.17.i11944 = getelementptr %"struct.std::dcomplex"* %tmp.0.i11939, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i11945 = load double* %tmp.17.i11944 ; <double> [#uses=1]
- %tmp.4.i11919 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i11918, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i11921 = load double* %tmp.5.i34352 ; <double> [#uses=1]
- store double %tmp.6.i11921, double* %tmp.4.i11919
- %tmp.7.i11922 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i11918, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i11924 = load double* %tmp.8.i34355 ; <double> [#uses=1]
- store double %tmp.9.i11924, double* %tmp.7.i11922
- %tmp.0.i11925 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i11918, %"struct.std::dcomplex"* %tmp.226 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i11926 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1205, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i11927 = getelementptr %"struct.std::dcomplex"* %tmp.0.i11925, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i11928 = load double* %tmp.14.i11927 ; <double> [#uses=1]
- store double %tmp.15.i11928, double* %tmp.13.i11926
- %tmp.16.i11929 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1205, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i11930 = getelementptr %"struct.std::dcomplex"* %tmp.0.i11925, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i11931 = load double* %tmp.17.i11930 ; <double> [#uses=1]
- store double %tmp.18.i11931, double* %tmp.16.i11929
- %tmp.4.i11905 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i11904, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i11942, double* %tmp.4.i11905
- %tmp.7.i11908 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i11904, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i11945, double* %tmp.7.i11908
- %tmp.0.i11911 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i11904, %"struct.std::dcomplex"* %mem_tmp.1205 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i11913 = getelementptr %"struct.std::dcomplex"* %tmp.0.i11911, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i11914 = load double* %tmp.14.i11913 ; <double> [#uses=1]
- %tmp.17.i11916 = getelementptr %"struct.std::dcomplex"* %tmp.0.i11911, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i11917 = load double* %tmp.17.i11916 ; <double> [#uses=1]
- %tmp.4.i11891 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i11890, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i11914, double* %tmp.4.i11891
- %tmp.7.i11894 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i11890, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i11917, double* %tmp.7.i11894
- %tmp.0.i11897 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i11890, %"struct.std::dcomplex"* %tmp.45 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i11898 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1202, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i11899 = getelementptr %"struct.std::dcomplex"* %tmp.0.i11897, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i11900 = load double* %tmp.14.i11899 ; <double> [#uses=1]
- store double %tmp.15.i11900, double* %tmp.13.i11898
- %tmp.16.i11901 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1202, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i11902 = getelementptr %"struct.std::dcomplex"* %tmp.0.i11897, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i11903 = load double* %tmp.17.i11902 ; <double> [#uses=1]
- store double %tmp.18.i11903, double* %tmp.16.i11901
- %tmp.4.i11877 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i11876, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i11956, double* %tmp.4.i11877
- %tmp.7.i11880 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i11876, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i11959, double* %tmp.7.i11880
- %tmp.0.i11883 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i11876, %"struct.std::dcomplex"* %mem_tmp.1202 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i11885 = getelementptr %"struct.std::dcomplex"* %tmp.0.i11883, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i11886 = load double* %tmp.14.i11885 ; <double> [#uses=1]
- %tmp.17.i11888 = getelementptr %"struct.std::dcomplex"* %tmp.0.i11883, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i11889 = load double* %tmp.17.i11888 ; <double> [#uses=1]
- store double %tmp.15.i11886, double* %tmp.2.i34364
- store double %tmp.18.i11889, double* %tmp.6.i34365
- %tmp.4.i11843 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i11842, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i11845 = load double* %tmp.5.i34136 ; <double> [#uses=1]
- store double %tmp.6.i11845, double* %tmp.4.i11843
- %tmp.7.i11846 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i11842, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i11848 = load double* %tmp.8.i34139 ; <double> [#uses=1]
- store double %tmp.9.i11848, double* %tmp.7.i11846
- %tmp.0.i11849 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i11842, %"struct.std::dcomplex"* %ret3 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i11851 = getelementptr %"struct.std::dcomplex"* %tmp.0.i11849, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i11852 = load double* %tmp.14.i11851 ; <double> [#uses=1]
- %tmp.17.i11854 = getelementptr %"struct.std::dcomplex"* %tmp.0.i11849, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i11855 = load double* %tmp.17.i11854 ; <double> [#uses=1]
- %tmp.7.i11809 = load double* %tmp.2.i34366 ; <double> [#uses=1]
- %tmp.15.i11823 = add double %tmp.7.i11809, %tmp.15.i11852 ; <double> [#uses=1]
- store double %tmp.15.i11823, double* %tmp.2.i34366
- %tmp.26.i11830 = load double* %tmp.6.i34367 ; <double> [#uses=1]
- %tmp.31.i11841 = add double %tmp.26.i11830, %tmp.18.i11855 ; <double> [#uses=1]
- store double %tmp.31.i11841, double* %tmp.6.i34367
- %tmp.4.i11789 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i11788, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i11791 = load double* %tmp.5.i34352 ; <double> [#uses=1]
- store double %tmp.6.i11791, double* %tmp.4.i11789
- %tmp.7.i11792 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i11788, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i11794 = load double* %tmp.8.i34355 ; <double> [#uses=1]
- store double %tmp.9.i11794, double* %tmp.7.i11792
- %tmp.0.i11795 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i11788, %"struct.std::dcomplex"* %tmp.62 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i11797 = getelementptr %"struct.std::dcomplex"* %tmp.0.i11795, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i11798 = load double* %tmp.14.i11797 ; <double> [#uses=1]
- %tmp.17.i11800 = getelementptr %"struct.std::dcomplex"* %tmp.0.i11795, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i11801 = load double* %tmp.17.i11800 ; <double> [#uses=1]
- %tmp.4.i11775 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i11774, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i11777 = load double* %tmp.5.i34082 ; <double> [#uses=1]
- store double %tmp.6.i11777, double* %tmp.4.i11775
- %tmp.7.i11778 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i11774, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i11780 = load double* %tmp.8.i34085 ; <double> [#uses=1]
- store double %tmp.9.i11780, double* %tmp.7.i11778
- %tmp.0.i11781 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i11774, %"struct.std::dcomplex"* %tmp.12 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i11782 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1212, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i11783 = getelementptr %"struct.std::dcomplex"* %tmp.0.i11781, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i11784 = load double* %tmp.14.i11783 ; <double> [#uses=1]
- store double %tmp.15.i11784, double* %tmp.13.i11782
- %tmp.16.i11785 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1212, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i11786 = getelementptr %"struct.std::dcomplex"* %tmp.0.i11781, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i11787 = load double* %tmp.17.i11786 ; <double> [#uses=1]
- store double %tmp.18.i11787, double* %tmp.16.i11785
- %tmp.4.i11761 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i11760, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i11798, double* %tmp.4.i11761
- %tmp.7.i11764 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i11760, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i11801, double* %tmp.7.i11764
- %tmp.0.i11767 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i11760, %"struct.std::dcomplex"* %mem_tmp.1212 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i11769 = getelementptr %"struct.std::dcomplex"* %tmp.0.i11767, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i11770 = load double* %tmp.14.i11769 ; <double> [#uses=1]
- %tmp.17.i11772 = getelementptr %"struct.std::dcomplex"* %tmp.0.i11767, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i11773 = load double* %tmp.17.i11772 ; <double> [#uses=1]
- %tmp.4.i11747 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i11746, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i11770, double* %tmp.4.i11747
- %tmp.7.i11750 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i11746, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i11773, double* %tmp.7.i11750
- %tmp.0.i11753 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i11746, %"struct.std::dcomplex"* %tmp.45 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i11755 = getelementptr %"struct.std::dcomplex"* %tmp.0.i11753, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i11756 = load double* %tmp.14.i11755 ; <double> [#uses=1]
- %tmp.17.i11758 = getelementptr %"struct.std::dcomplex"* %tmp.0.i11753, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i11759 = load double* %tmp.17.i11758 ; <double> [#uses=1]
- %tmp.4.i11733 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i11732, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i11735 = load double* %tmp.5.i34338 ; <double> [#uses=1]
- store double %tmp.6.i11735, double* %tmp.4.i11733
- %tmp.7.i11736 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i11732, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i11738 = load double* %tmp.8.i34341 ; <double> [#uses=1]
- store double %tmp.9.i11738, double* %tmp.7.i11736
- %tmp.0.i11739 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i11732, %"struct.std::dcomplex"* %tmp.12 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i11741 = getelementptr %"struct.std::dcomplex"* %tmp.0.i11739, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i11742 = load double* %tmp.14.i11741 ; <double> [#uses=1]
- %tmp.17.i11744 = getelementptr %"struct.std::dcomplex"* %tmp.0.i11739, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i11745 = load double* %tmp.17.i11744 ; <double> [#uses=1]
- %tmp.4.i11719 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i11718, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i11721 = load double* %tmp.5.i34352 ; <double> [#uses=1]
- store double %tmp.6.i11721, double* %tmp.4.i11719
- %tmp.7.i11722 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i11718, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i11724 = load double* %tmp.8.i34355 ; <double> [#uses=1]
- store double %tmp.9.i11724, double* %tmp.7.i11722
- %tmp.0.i11725 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i11718, %"struct.std::dcomplex"* %tmp.6 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i11726 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1216, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i11727 = getelementptr %"struct.std::dcomplex"* %tmp.0.i11725, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i11728 = load double* %tmp.14.i11727 ; <double> [#uses=1]
- store double %tmp.15.i11728, double* %tmp.13.i11726
- %tmp.16.i11729 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1216, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i11730 = getelementptr %"struct.std::dcomplex"* %tmp.0.i11725, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i11731 = load double* %tmp.17.i11730 ; <double> [#uses=1]
- store double %tmp.18.i11731, double* %tmp.16.i11729
- %tmp.4.i11705 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i11704, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i11742, double* %tmp.4.i11705
- %tmp.7.i11708 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i11704, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i11745, double* %tmp.7.i11708
- %tmp.0.i11711 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i11704, %"struct.std::dcomplex"* %mem_tmp.1216 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i11713 = getelementptr %"struct.std::dcomplex"* %tmp.0.i11711, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i11714 = load double* %tmp.14.i11713 ; <double> [#uses=1]
- %tmp.17.i11716 = getelementptr %"struct.std::dcomplex"* %tmp.0.i11711, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i11717 = load double* %tmp.17.i11716 ; <double> [#uses=1]
- %tmp.4.i11691 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i11690, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i11714, double* %tmp.4.i11691
- %tmp.7.i11694 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i11690, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i11717, double* %tmp.7.i11694
- %tmp.0.i11697 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i11690, %"struct.std::dcomplex"* %tmp.95 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i11698 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1213, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i11699 = getelementptr %"struct.std::dcomplex"* %tmp.0.i11697, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i11700 = load double* %tmp.14.i11699 ; <double> [#uses=1]
- store double %tmp.15.i11700, double* %tmp.13.i11698
- %tmp.16.i11701 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1213, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i11702 = getelementptr %"struct.std::dcomplex"* %tmp.0.i11697, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i11703 = load double* %tmp.17.i11702 ; <double> [#uses=1]
- store double %tmp.18.i11703, double* %tmp.16.i11701
- %tmp.4.i11677 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i11676, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i11756, double* %tmp.4.i11677
- %tmp.7.i11680 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i11676, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i11759, double* %tmp.7.i11680
- %tmp.0.i11683 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i11676, %"struct.std::dcomplex"* %mem_tmp.1213 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i11685 = getelementptr %"struct.std::dcomplex"* %tmp.0.i11683, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i11686 = load double* %tmp.14.i11685 ; <double> [#uses=1]
- %tmp.17.i11688 = getelementptr %"struct.std::dcomplex"* %tmp.0.i11683, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i11689 = load double* %tmp.17.i11688 ; <double> [#uses=1]
- %tmp.4.i11663 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i11662, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i11665 = load double* %tmp.5.i34082 ; <double> [#uses=1]
- store double %tmp.6.i11665, double* %tmp.4.i11663
- %tmp.7.i11666 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i11662, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i11668 = load double* %tmp.8.i34085 ; <double> [#uses=1]
- store double %tmp.9.i11668, double* %tmp.7.i11666
- %tmp.0.i11669 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i11662, %"struct.std::dcomplex"* %tmp.6 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i11671 = getelementptr %"struct.std::dcomplex"* %tmp.0.i11669, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i11672 = load double* %tmp.14.i11671 ; <double> [#uses=1]
- %tmp.17.i11674 = getelementptr %"struct.std::dcomplex"* %tmp.0.i11669, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i11675 = load double* %tmp.17.i11674 ; <double> [#uses=1]
- %tmp.4.i11649 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i11648, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i11651 = load double* %tmp.5.i34338 ; <double> [#uses=1]
- store double %tmp.6.i11651, double* %tmp.4.i11649
- %tmp.7.i11652 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i11648, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i11654 = load double* %tmp.8.i34341 ; <double> [#uses=1]
- store double %tmp.9.i11654, double* %tmp.7.i11652
- %tmp.0.i11655 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i11648, %"struct.std::dcomplex"* %tmp.62 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i11656 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1220, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i11657 = getelementptr %"struct.std::dcomplex"* %tmp.0.i11655, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i11658 = load double* %tmp.14.i11657 ; <double> [#uses=1]
- store double %tmp.15.i11658, double* %tmp.13.i11656
- %tmp.16.i11659 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1220, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i11660 = getelementptr %"struct.std::dcomplex"* %tmp.0.i11655, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i11661 = load double* %tmp.17.i11660 ; <double> [#uses=1]
- store double %tmp.18.i11661, double* %tmp.16.i11659
- %tmp.4.i11635 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i11634, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i11672, double* %tmp.4.i11635
- %tmp.7.i11638 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i11634, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i11675, double* %tmp.7.i11638
- %tmp.0.i11641 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i11634, %"struct.std::dcomplex"* %mem_tmp.1220 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i11643 = getelementptr %"struct.std::dcomplex"* %tmp.0.i11641, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i11644 = load double* %tmp.14.i11643 ; <double> [#uses=1]
- %tmp.17.i11646 = getelementptr %"struct.std::dcomplex"* %tmp.0.i11641, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i11647 = load double* %tmp.17.i11646 ; <double> [#uses=1]
- %tmp.4.i11621 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i11620, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i11644, double* %tmp.4.i11621
- %tmp.7.i11624 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i11620, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i11647, double* %tmp.7.i11624
- %tmp.0.i11627 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i11620, %"struct.std::dcomplex"* %tmp.30 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i11628 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1217, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i11629 = getelementptr %"struct.std::dcomplex"* %tmp.0.i11627, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i11630 = load double* %tmp.14.i11629 ; <double> [#uses=1]
- store double %tmp.15.i11630, double* %tmp.13.i11628
- %tmp.16.i11631 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1217, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i11632 = getelementptr %"struct.std::dcomplex"* %tmp.0.i11627, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i11633 = load double* %tmp.17.i11632 ; <double> [#uses=1]
- store double %tmp.18.i11633, double* %tmp.16.i11631
- %tmp.4.i11607 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i11606, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i11686, double* %tmp.4.i11607
- %tmp.7.i11610 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i11606, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i11689, double* %tmp.7.i11610
- %tmp.0.i11613 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i11606, %"struct.std::dcomplex"* %mem_tmp.1217 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i11615 = getelementptr %"struct.std::dcomplex"* %tmp.0.i11613, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i11616 = load double* %tmp.14.i11615 ; <double> [#uses=1]
- %tmp.17.i11618 = getelementptr %"struct.std::dcomplex"* %tmp.0.i11613, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i11619 = load double* %tmp.17.i11618 ; <double> [#uses=1]
- store double %tmp.15.i11616, double* %tmp.2.i34364
- store double %tmp.18.i11619, double* %tmp.6.i34365
- %tmp.4.i11573 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i11572, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i11575 = load double* %tmp.5.i32460 ; <double> [#uses=1]
- store double %tmp.6.i11575, double* %tmp.4.i11573
- %tmp.7.i11576 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i11572, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i11578 = load double* %tmp.8.i32463 ; <double> [#uses=1]
- store double %tmp.9.i11578, double* %tmp.7.i11576
- %tmp.0.i11579 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i11572, %"struct.std::dcomplex"* %ret3 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i11581 = getelementptr %"struct.std::dcomplex"* %tmp.0.i11579, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i11582 = load double* %tmp.14.i11581 ; <double> [#uses=1]
- %tmp.17.i11584 = getelementptr %"struct.std::dcomplex"* %tmp.0.i11579, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i11585 = load double* %tmp.17.i11584 ; <double> [#uses=1]
- %tmp.7.i11539 = load double* %tmp.2.i34366 ; <double> [#uses=1]
- %tmp.15.i11553 = add double %tmp.7.i11539, %tmp.15.i11582 ; <double> [#uses=1]
- store double %tmp.15.i11553, double* %tmp.2.i34366
- %tmp.26.i11560 = load double* %tmp.6.i34367 ; <double> [#uses=1]
- %tmp.31.i11571 = add double %tmp.26.i11560, %tmp.18.i11585 ; <double> [#uses=1]
- store double %tmp.31.i11571, double* %tmp.6.i34367
- %tmp.4.i11519 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i11518, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i11521 = load double* %tmp.5.i25264 ; <double> [#uses=1]
- store double %tmp.6.i11521, double* %tmp.4.i11519
- %tmp.7.i11522 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i11518, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i11524 = load double* %tmp.8.i25267 ; <double> [#uses=1]
- store double %tmp.9.i11524, double* %tmp.7.i11522
- %tmp.0.i11525 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i11518, %"struct.std::dcomplex"* %ret4 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i11527 = getelementptr %"struct.std::dcomplex"* %tmp.0.i11525, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i11528 = load double* %tmp.14.i11527 ; <double> [#uses=1]
- %tmp.17.i11530 = getelementptr %"struct.std::dcomplex"* %tmp.0.i11525, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i11531 = load double* %tmp.17.i11530 ; <double> [#uses=1]
- %tmp.7.i11485 = load double* %tmp.2.i34368 ; <double> [#uses=1]
- %tmp.15.i11499 = add double %tmp.7.i11485, %tmp.15.i11528 ; <double> [#uses=1]
- store double %tmp.15.i11499, double* %tmp.2.i34368
- %tmp.26.i11506 = load double* %tmp.6.i34369 ; <double> [#uses=1]
- %tmp.31.i11517 = add double %tmp.26.i11506, %tmp.18.i11531 ; <double> [#uses=1]
- store double %tmp.31.i11517, double* %tmp.6.i34369
- store double 0.000000e+00, double* %tmp.2.i34366
- store double 0.000000e+00, double* %tmp.6.i34367
- %tmp.4.i11463 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i11462, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.5.i11464 = getelementptr [6 x %"struct.std::dcomplex"]* %_m, i32 5, i32 2, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i11465 = load double* %tmp.5.i11464 ; <double> [#uses=1]
- store double %tmp.6.i11465, double* %tmp.4.i11463
- %tmp.7.i11466 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i11462, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.8.i11467 = getelementptr [6 x %"struct.std::dcomplex"]* %_m, i32 5, i32 2, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i11468 = load double* %tmp.8.i11467 ; <double> [#uses=1]
- store double %tmp.9.i11468, double* %tmp.7.i11466
- %tmp.0.i11469 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i11462, %"struct.std::dcomplex"* %ret5 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i11471 = getelementptr %"struct.std::dcomplex"* %tmp.0.i11469, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i11472 = load double* %tmp.14.i11471 ; <double> [#uses=1]
- %tmp.17.i11474 = getelementptr %"struct.std::dcomplex"* %tmp.0.i11469, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i11475 = load double* %tmp.17.i11474 ; <double> [#uses=1]
- %tmp.7.i11429 = load double* %tmp.2.i ; <double> [#uses=1]
- %tmp.15.i11443 = add double %tmp.7.i11429, %tmp.15.i11472 ; <double> [#uses=1]
- store double %tmp.15.i11443, double* %tmp.2.i
- %tmp.26.i11450 = load double* %tmp.6.i ; <double> [#uses=1]
- %tmp.31.i11461 = add double %tmp.26.i11450, %tmp.18.i11475 ; <double> [#uses=1]
- store double %tmp.31.i11461, double* %tmp.6.i
- store double 0.000000e+00, double* %tmp.2.i34368
- store double 0.000000e+00, double* %tmp.6.i34369
- %tmp.4.i11407 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i11406, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i11409 = load double* %tmp.5.i34338 ; <double> [#uses=1]
- store double %tmp.6.i11409, double* %tmp.4.i11407
- %tmp.7.i11410 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i11406, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i11412 = load double* %tmp.8.i34341 ; <double> [#uses=1]
- store double %tmp.9.i11412, double* %tmp.7.i11410
- %tmp.0.i11413 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i11406, %"struct.std::dcomplex"* %tmp.21 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i11415 = getelementptr %"struct.std::dcomplex"* %tmp.0.i11413, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i11416 = load double* %tmp.14.i11415 ; <double> [#uses=1]
- %tmp.17.i11418 = getelementptr %"struct.std::dcomplex"* %tmp.0.i11413, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i11419 = load double* %tmp.17.i11418 ; <double> [#uses=1]
- %tmp.4.i11393 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i11392, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i11395 = load double* %tmp.5.i34282 ; <double> [#uses=1]
- store double %tmp.6.i11395, double* %tmp.4.i11393
- %tmp.7.i11396 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i11392, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i11398 = load double* %tmp.8.i34285 ; <double> [#uses=1]
- store double %tmp.9.i11398, double* %tmp.7.i11396
- %tmp.0.i11399 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i11392, %"struct.std::dcomplex"* %tmp.6 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i11400 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1229, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i11401 = getelementptr %"struct.std::dcomplex"* %tmp.0.i11399, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i11402 = load double* %tmp.14.i11401 ; <double> [#uses=1]
- store double %tmp.15.i11402, double* %tmp.13.i11400
- %tmp.16.i11403 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1229, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i11404 = getelementptr %"struct.std::dcomplex"* %tmp.0.i11399, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i11405 = load double* %tmp.17.i11404 ; <double> [#uses=1]
- store double %tmp.18.i11405, double* %tmp.16.i11403
- %tmp.4.i11379 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i11378, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i11416, double* %tmp.4.i11379
- %tmp.7.i11382 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i11378, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i11419, double* %tmp.7.i11382
- %tmp.0.i11385 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i11378, %"struct.std::dcomplex"* %mem_tmp.1229 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i11387 = getelementptr %"struct.std::dcomplex"* %tmp.0.i11385, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i11388 = load double* %tmp.14.i11387 ; <double> [#uses=1]
- %tmp.17.i11390 = getelementptr %"struct.std::dcomplex"* %tmp.0.i11385, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i11391 = load double* %tmp.17.i11390 ; <double> [#uses=1]
- %tmp.4.i11365 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i11364, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i11388, double* %tmp.4.i11365
- %tmp.7.i11368 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i11364, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i11391, double* %tmp.7.i11368
- %tmp.0.i11371 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i11364, %"struct.std::dcomplex"* %tmp.30 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i11373 = getelementptr %"struct.std::dcomplex"* %tmp.0.i11371, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i11374 = load double* %tmp.14.i11373 ; <double> [#uses=1]
- %tmp.17.i11376 = getelementptr %"struct.std::dcomplex"* %tmp.0.i11371, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i11377 = load double* %tmp.17.i11376 ; <double> [#uses=1]
- %tmp.4.i11351 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i11350, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i11353 = load double* %tmp.5.i34282 ; <double> [#uses=1]
- store double %tmp.6.i11353, double* %tmp.4.i11351
- %tmp.7.i11354 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i11350, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i11356 = load double* %tmp.8.i34285 ; <double> [#uses=1]
- store double %tmp.9.i11356, double* %tmp.7.i11354
- %tmp.0.i11357 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i11350, %"struct.std::dcomplex"* %tmp.12 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i11359 = getelementptr %"struct.std::dcomplex"* %tmp.0.i11357, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i11360 = load double* %tmp.14.i11359 ; <double> [#uses=1]
- %tmp.17.i11362 = getelementptr %"struct.std::dcomplex"* %tmp.0.i11357, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i11363 = load double* %tmp.17.i11362 ; <double> [#uses=1]
- %tmp.4.i11337 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i11336, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i11339 = load double* %tmp.5.i34352 ; <double> [#uses=1]
- store double %tmp.6.i11339, double* %tmp.4.i11337
- %tmp.7.i11340 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i11336, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i11342 = load double* %tmp.8.i34355 ; <double> [#uses=1]
- store double %tmp.9.i11342, double* %tmp.7.i11340
- %tmp.0.i11343 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i11336, %"struct.std::dcomplex"* %tmp.21 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i11344 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1233, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i11345 = getelementptr %"struct.std::dcomplex"* %tmp.0.i11343, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i11346 = load double* %tmp.14.i11345 ; <double> [#uses=1]
- store double %tmp.15.i11346, double* %tmp.13.i11344
- %tmp.16.i11347 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1233, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i11348 = getelementptr %"struct.std::dcomplex"* %tmp.0.i11343, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i11349 = load double* %tmp.17.i11348 ; <double> [#uses=1]
- store double %tmp.18.i11349, double* %tmp.16.i11347
- %tmp.4.i11323 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i11322, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i11360, double* %tmp.4.i11323
- %tmp.7.i11326 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i11322, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i11363, double* %tmp.7.i11326
- %tmp.0.i11329 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i11322, %"struct.std::dcomplex"* %mem_tmp.1233 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i11331 = getelementptr %"struct.std::dcomplex"* %tmp.0.i11329, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i11332 = load double* %tmp.14.i11331 ; <double> [#uses=1]
- %tmp.17.i11334 = getelementptr %"struct.std::dcomplex"* %tmp.0.i11329, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i11335 = load double* %tmp.17.i11334 ; <double> [#uses=1]
- %tmp.4.i11309 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i11308, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i11332, double* %tmp.4.i11309
- %tmp.7.i11312 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i11308, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i11335, double* %tmp.7.i11312
- %tmp.0.i11315 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i11308, %"struct.std::dcomplex"* %tmp.45 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i11316 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1230, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i11317 = getelementptr %"struct.std::dcomplex"* %tmp.0.i11315, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i11318 = load double* %tmp.14.i11317 ; <double> [#uses=1]
- store double %tmp.15.i11318, double* %tmp.13.i11316
- %tmp.16.i11319 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1230, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i11320 = getelementptr %"struct.std::dcomplex"* %tmp.0.i11315, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i11321 = load double* %tmp.17.i11320 ; <double> [#uses=1]
- store double %tmp.18.i11321, double* %tmp.16.i11319
- %tmp.4.i11295 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i11294, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i11374, double* %tmp.4.i11295
- %tmp.7.i11298 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i11294, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i11377, double* %tmp.7.i11298
- %tmp.0.i11301 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i11294, %"struct.std::dcomplex"* %mem_tmp.1230 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i11303 = getelementptr %"struct.std::dcomplex"* %tmp.0.i11301, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i11304 = load double* %tmp.14.i11303 ; <double> [#uses=1]
- %tmp.17.i11306 = getelementptr %"struct.std::dcomplex"* %tmp.0.i11301, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i11307 = load double* %tmp.17.i11306 ; <double> [#uses=1]
- %tmp.4.i11281 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i11280, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i11283 = load double* %tmp.5.i34352 ; <double> [#uses=1]
- store double %tmp.6.i11283, double* %tmp.4.i11281
- %tmp.7.i11284 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i11280, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i11286 = load double* %tmp.8.i34355 ; <double> [#uses=1]
- store double %tmp.9.i11286, double* %tmp.7.i11284
- %tmp.0.i11287 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i11280, %"struct.std::dcomplex"* %tmp.6 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i11289 = getelementptr %"struct.std::dcomplex"* %tmp.0.i11287, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i11290 = load double* %tmp.14.i11289 ; <double> [#uses=1]
- %tmp.17.i11292 = getelementptr %"struct.std::dcomplex"* %tmp.0.i11287, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i11293 = load double* %tmp.17.i11292 ; <double> [#uses=1]
- %tmp.4.i11267 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i11266, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i11269 = load double* %tmp.5.i34338 ; <double> [#uses=1]
- store double %tmp.6.i11269, double* %tmp.4.i11267
- %tmp.7.i11270 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i11266, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i11272 = load double* %tmp.8.i34341 ; <double> [#uses=1]
- store double %tmp.9.i11272, double* %tmp.7.i11270
- %tmp.0.i11273 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i11266, %"struct.std::dcomplex"* %tmp.12 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i11274 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1237, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i11275 = getelementptr %"struct.std::dcomplex"* %tmp.0.i11273, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i11276 = load double* %tmp.14.i11275 ; <double> [#uses=1]
- store double %tmp.15.i11276, double* %tmp.13.i11274
- %tmp.16.i11277 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1237, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i11278 = getelementptr %"struct.std::dcomplex"* %tmp.0.i11273, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i11279 = load double* %tmp.17.i11278 ; <double> [#uses=1]
- store double %tmp.18.i11279, double* %tmp.16.i11277
- %tmp.4.i11253 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i11252, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i11290, double* %tmp.4.i11253
- %tmp.7.i11256 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i11252, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i11293, double* %tmp.7.i11256
- %tmp.0.i11259 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i11252, %"struct.std::dcomplex"* %mem_tmp.1237 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i11261 = getelementptr %"struct.std::dcomplex"* %tmp.0.i11259, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i11262 = load double* %tmp.14.i11261 ; <double> [#uses=1]
- %tmp.17.i11264 = getelementptr %"struct.std::dcomplex"* %tmp.0.i11259, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i11265 = load double* %tmp.17.i11264 ; <double> [#uses=1]
- %tmp.4.i11239 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i11238, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i11262, double* %tmp.4.i11239
- %tmp.7.i11242 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i11238, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i11265, double* %tmp.7.i11242
- %tmp.0.i11245 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i11238, %"struct.std::dcomplex"* %tmp.15 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i11246 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1234, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i11247 = getelementptr %"struct.std::dcomplex"* %tmp.0.i11245, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i11248 = load double* %tmp.14.i11247 ; <double> [#uses=1]
- store double %tmp.15.i11248, double* %tmp.13.i11246
- %tmp.16.i11249 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1234, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i11250 = getelementptr %"struct.std::dcomplex"* %tmp.0.i11245, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i11251 = load double* %tmp.17.i11250 ; <double> [#uses=1]
- store double %tmp.18.i11251, double* %tmp.16.i11249
- %tmp.4.i11225 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i11224, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i11304, double* %tmp.4.i11225
- %tmp.7.i11228 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i11224, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i11307, double* %tmp.7.i11228
- %tmp.0.i11231 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i11224, %"struct.std::dcomplex"* %mem_tmp.1234 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i11233 = getelementptr %"struct.std::dcomplex"* %tmp.0.i11231, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i11234 = load double* %tmp.14.i11233 ; <double> [#uses=1]
- %tmp.17.i11236 = getelementptr %"struct.std::dcomplex"* %tmp.0.i11231, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i11237 = load double* %tmp.17.i11236 ; <double> [#uses=1]
- store double %tmp.15.i11234, double* %tmp.2.i34364
- store double %tmp.18.i11237, double* %tmp.6.i34365
- %tmp.4.i11191 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i11190, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i11193 = load double* %tmp.5.i32460 ; <double> [#uses=1]
- store double %tmp.6.i11193, double* %tmp.4.i11191
- %tmp.7.i11194 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i11190, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i11196 = load double* %tmp.8.i32463 ; <double> [#uses=1]
- store double %tmp.9.i11196, double* %tmp.7.i11194
- %tmp.0.i11197 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i11190, %"struct.std::dcomplex"* %ret3 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i11199 = getelementptr %"struct.std::dcomplex"* %tmp.0.i11197, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i11200 = load double* %tmp.14.i11199 ; <double> [#uses=1]
- %tmp.17.i11202 = getelementptr %"struct.std::dcomplex"* %tmp.0.i11197, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i11203 = load double* %tmp.17.i11202 ; <double> [#uses=1]
- %tmp.7.i11157 = load double* %tmp.2.i34366 ; <double> [#uses=1]
- %tmp.15.i11171 = add double %tmp.7.i11157, %tmp.15.i11200 ; <double> [#uses=1]
- store double %tmp.15.i11171, double* %tmp.2.i34366
- %tmp.26.i11178 = load double* %tmp.6.i34367 ; <double> [#uses=1]
- %tmp.31.i11189 = add double %tmp.26.i11178, %tmp.18.i11203 ; <double> [#uses=1]
- store double %tmp.31.i11189, double* %tmp.6.i34367
- %tmp.4.i11137 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i11136, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i11139 = load double* %tmp.5.i34338 ; <double> [#uses=1]
- store double %tmp.6.i11139, double* %tmp.4.i11137
- %tmp.7.i11140 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i11136, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i11142 = load double* %tmp.8.i34341 ; <double> [#uses=1]
- store double %tmp.9.i11142, double* %tmp.7.i11140
- %tmp.0.i11143 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i11136, %"struct.std::dcomplex"* %tmp.226 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i11145 = getelementptr %"struct.std::dcomplex"* %tmp.0.i11143, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i11146 = load double* %tmp.14.i11145 ; <double> [#uses=1]
- %tmp.17.i11148 = getelementptr %"struct.std::dcomplex"* %tmp.0.i11143, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i11149 = load double* %tmp.17.i11148 ; <double> [#uses=1]
- %tmp.4.i11123 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i11122, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i11125 = load double* %tmp.5.i33146 ; <double> [#uses=1]
- store double %tmp.6.i11125, double* %tmp.4.i11123
- %tmp.7.i11126 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i11122, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i11128 = load double* %tmp.8.i33149 ; <double> [#uses=1]
- store double %tmp.9.i11128, double* %tmp.7.i11126
- %tmp.0.i11129 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i11122, %"struct.std::dcomplex"* %tmp.6 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i11130 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1244, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i11131 = getelementptr %"struct.std::dcomplex"* %tmp.0.i11129, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i11132 = load double* %tmp.14.i11131 ; <double> [#uses=1]
- store double %tmp.15.i11132, double* %tmp.13.i11130
- %tmp.16.i11133 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1244, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i11134 = getelementptr %"struct.std::dcomplex"* %tmp.0.i11129, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i11135 = load double* %tmp.17.i11134 ; <double> [#uses=1]
- store double %tmp.18.i11135, double* %tmp.16.i11133
- %tmp.4.i11109 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i11108, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i11146, double* %tmp.4.i11109
- %tmp.7.i11112 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i11108, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i11149, double* %tmp.7.i11112
- %tmp.0.i11115 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i11108, %"struct.std::dcomplex"* %mem_tmp.1244 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i11117 = getelementptr %"struct.std::dcomplex"* %tmp.0.i11115, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i11118 = load double* %tmp.14.i11117 ; <double> [#uses=1]
- %tmp.17.i11120 = getelementptr %"struct.std::dcomplex"* %tmp.0.i11115, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i11121 = load double* %tmp.17.i11120 ; <double> [#uses=1]
- %tmp.4.i11095 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i11094, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i11118, double* %tmp.4.i11095
- %tmp.7.i11098 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i11094, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i11121, double* %tmp.7.i11098
- %tmp.0.i11101 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i11094, %"struct.std::dcomplex"* %tmp.15 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i11103 = getelementptr %"struct.std::dcomplex"* %tmp.0.i11101, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i11104 = load double* %tmp.14.i11103 ; <double> [#uses=1]
- %tmp.17.i11106 = getelementptr %"struct.std::dcomplex"* %tmp.0.i11101, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i11107 = load double* %tmp.17.i11106 ; <double> [#uses=1]
- %tmp.4.i11081 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i11080, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i11083 = load double* %tmp.5.i34282 ; <double> [#uses=1]
- store double %tmp.6.i11083, double* %tmp.4.i11081
- %tmp.7.i11084 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i11080, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i11086 = load double* %tmp.8.i34285 ; <double> [#uses=1]
- store double %tmp.9.i11086, double* %tmp.7.i11084
- %tmp.0.i11087 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i11080, %"struct.std::dcomplex"* %tmp.6 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i11089 = getelementptr %"struct.std::dcomplex"* %tmp.0.i11087, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i11090 = load double* %tmp.14.i11089 ; <double> [#uses=1]
- %tmp.17.i11092 = getelementptr %"struct.std::dcomplex"* %tmp.0.i11087, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i11093 = load double* %tmp.17.i11092 ; <double> [#uses=1]
- %tmp.4.i11067 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i11066, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i11069 = load double* %tmp.5.i34338 ; <double> [#uses=1]
- store double %tmp.6.i11069, double* %tmp.4.i11067
- %tmp.7.i11070 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i11066, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i11072 = load double* %tmp.8.i34341 ; <double> [#uses=1]
- store double %tmp.9.i11072, double* %tmp.7.i11070
- %tmp.0.i11073 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i11066, %"struct.std::dcomplex"* %tmp.21 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i11074 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1248, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i11075 = getelementptr %"struct.std::dcomplex"* %tmp.0.i11073, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i11076 = load double* %tmp.14.i11075 ; <double> [#uses=1]
- store double %tmp.15.i11076, double* %tmp.13.i11074
- %tmp.16.i11077 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1248, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i11078 = getelementptr %"struct.std::dcomplex"* %tmp.0.i11073, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i11079 = load double* %tmp.17.i11078 ; <double> [#uses=1]
- store double %tmp.18.i11079, double* %tmp.16.i11077
- %tmp.4.i11053 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i11052, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i11090, double* %tmp.4.i11053
- %tmp.7.i11056 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i11052, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i11093, double* %tmp.7.i11056
- %tmp.0.i11059 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i11052, %"struct.std::dcomplex"* %mem_tmp.1248 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i11061 = getelementptr %"struct.std::dcomplex"* %tmp.0.i11059, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i11062 = load double* %tmp.14.i11061 ; <double> [#uses=1]
- %tmp.17.i11064 = getelementptr %"struct.std::dcomplex"* %tmp.0.i11059, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i11065 = load double* %tmp.17.i11064 ; <double> [#uses=1]
- %tmp.4.i11039 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i11038, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i11062, double* %tmp.4.i11039
- %tmp.7.i11042 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i11038, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i11065, double* %tmp.7.i11042
- %tmp.0.i11045 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i11038, %"struct.std::dcomplex"* %tmp.220 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i11046 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1245, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i11047 = getelementptr %"struct.std::dcomplex"* %tmp.0.i11045, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i11048 = load double* %tmp.14.i11047 ; <double> [#uses=1]
- store double %tmp.15.i11048, double* %tmp.13.i11046
- %tmp.16.i11049 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1245, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i11050 = getelementptr %"struct.std::dcomplex"* %tmp.0.i11045, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i11051 = load double* %tmp.17.i11050 ; <double> [#uses=1]
- store double %tmp.18.i11051, double* %tmp.16.i11049
- %tmp.4.i11025 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i11024, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i11104, double* %tmp.4.i11025
- %tmp.7.i11028 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i11024, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i11107, double* %tmp.7.i11028
- %tmp.0.i11031 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i11024, %"struct.std::dcomplex"* %mem_tmp.1245 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i11033 = getelementptr %"struct.std::dcomplex"* %tmp.0.i11031, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i11034 = load double* %tmp.14.i11033 ; <double> [#uses=1]
- %tmp.17.i11036 = getelementptr %"struct.std::dcomplex"* %tmp.0.i11031, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i11037 = load double* %tmp.17.i11036 ; <double> [#uses=1]
- %tmp.4.i11011 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i11010, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i11013 = load double* %tmp.5.i33146 ; <double> [#uses=1]
- store double %tmp.6.i11013, double* %tmp.4.i11011
- %tmp.7.i11014 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i11010, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i11016 = load double* %tmp.8.i33149 ; <double> [#uses=1]
- store double %tmp.9.i11016, double* %tmp.7.i11014
- %tmp.0.i11017 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i11010, %"struct.std::dcomplex"* %tmp.21 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i11019 = getelementptr %"struct.std::dcomplex"* %tmp.0.i11017, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i11020 = load double* %tmp.14.i11019 ; <double> [#uses=1]
- %tmp.17.i11022 = getelementptr %"struct.std::dcomplex"* %tmp.0.i11017, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i11023 = load double* %tmp.17.i11022 ; <double> [#uses=1]
- %tmp.4.i10997 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i10996, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i10999 = load double* %tmp.5.i34282 ; <double> [#uses=1]
- store double %tmp.6.i10999, double* %tmp.4.i10997
- %tmp.7.i11000 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i10996, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i11002 = load double* %tmp.8.i34285 ; <double> [#uses=1]
- store double %tmp.9.i11002, double* %tmp.7.i11000
- %tmp.0.i11003 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i10996, %"struct.std::dcomplex"* %tmp.226 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i11004 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1252, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i11005 = getelementptr %"struct.std::dcomplex"* %tmp.0.i11003, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i11006 = load double* %tmp.14.i11005 ; <double> [#uses=1]
- store double %tmp.15.i11006, double* %tmp.13.i11004
- %tmp.16.i11007 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1252, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i11008 = getelementptr %"struct.std::dcomplex"* %tmp.0.i11003, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i11009 = load double* %tmp.17.i11008 ; <double> [#uses=1]
- store double %tmp.18.i11009, double* %tmp.16.i11007
- %tmp.4.i10983 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i10982, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i11020, double* %tmp.4.i10983
- %tmp.7.i10986 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i10982, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i11023, double* %tmp.7.i10986
- %tmp.0.i10989 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i10982, %"struct.std::dcomplex"* %mem_tmp.1252 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i10991 = getelementptr %"struct.std::dcomplex"* %tmp.0.i10989, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i10992 = load double* %tmp.14.i10991 ; <double> [#uses=1]
- %tmp.17.i10994 = getelementptr %"struct.std::dcomplex"* %tmp.0.i10989, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i10995 = load double* %tmp.17.i10994 ; <double> [#uses=1]
- %tmp.4.i10969 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i10968, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i10992, double* %tmp.4.i10969
- %tmp.7.i10972 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i10968, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i10995, double* %tmp.7.i10972
- %tmp.0.i10975 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i10968, %"struct.std::dcomplex"* %tmp.45 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i10976 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1249, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i10977 = getelementptr %"struct.std::dcomplex"* %tmp.0.i10975, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i10978 = load double* %tmp.14.i10977 ; <double> [#uses=1]
- store double %tmp.15.i10978, double* %tmp.13.i10976
- %tmp.16.i10979 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1249, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i10980 = getelementptr %"struct.std::dcomplex"* %tmp.0.i10975, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i10981 = load double* %tmp.17.i10980 ; <double> [#uses=1]
- store double %tmp.18.i10981, double* %tmp.16.i10979
- %tmp.4.i10955 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i10954, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i11034, double* %tmp.4.i10955
- %tmp.7.i10958 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i10954, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i11037, double* %tmp.7.i10958
- %tmp.0.i10961 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i10954, %"struct.std::dcomplex"* %mem_tmp.1249 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i10963 = getelementptr %"struct.std::dcomplex"* %tmp.0.i10961, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i10964 = load double* %tmp.14.i10963 ; <double> [#uses=1]
- %tmp.17.i10966 = getelementptr %"struct.std::dcomplex"* %tmp.0.i10961, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i10967 = load double* %tmp.17.i10966 ; <double> [#uses=1]
- store double %tmp.15.i10964, double* %tmp.2.i34364
- store double %tmp.18.i10967, double* %tmp.6.i34365
- %tmp.4.i10921 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i10920, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i10923 = load double* %tmp.5.i33866 ; <double> [#uses=1]
- store double %tmp.6.i10923, double* %tmp.4.i10921
- %tmp.7.i10924 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i10920, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i10926 = load double* %tmp.8.i33869 ; <double> [#uses=1]
- store double %tmp.9.i10926, double* %tmp.7.i10924
- %tmp.0.i10927 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i10920, %"struct.std::dcomplex"* %ret3 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i10929 = getelementptr %"struct.std::dcomplex"* %tmp.0.i10927, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i10930 = load double* %tmp.14.i10929 ; <double> [#uses=1]
- %tmp.17.i10932 = getelementptr %"struct.std::dcomplex"* %tmp.0.i10927, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i10933 = load double* %tmp.17.i10932 ; <double> [#uses=1]
- %tmp.7.i10887 = load double* %tmp.2.i34366 ; <double> [#uses=1]
- %tmp.15.i10901 = add double %tmp.7.i10887, %tmp.15.i10930 ; <double> [#uses=1]
- store double %tmp.15.i10901, double* %tmp.2.i34366
- %tmp.26.i10908 = load double* %tmp.6.i34367 ; <double> [#uses=1]
- %tmp.31.i10919 = add double %tmp.26.i10908, %tmp.18.i10933 ; <double> [#uses=1]
- store double %tmp.31.i10919, double* %tmp.6.i34367
- %tmp.4.i10867 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i10866, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i10869 = load double* %tmp.5.i34282 ; <double> [#uses=1]
- store double %tmp.6.i10869, double* %tmp.4.i10867
- %tmp.7.i10870 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i10866, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i10872 = load double* %tmp.8.i34285 ; <double> [#uses=1]
- store double %tmp.9.i10872, double* %tmp.7.i10870
- %tmp.0.i10873 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i10866, %"struct.std::dcomplex"* %tmp.226 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i10875 = getelementptr %"struct.std::dcomplex"* %tmp.0.i10873, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i10876 = load double* %tmp.14.i10875 ; <double> [#uses=1]
- %tmp.17.i10878 = getelementptr %"struct.std::dcomplex"* %tmp.0.i10873, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i10879 = load double* %tmp.17.i10878 ; <double> [#uses=1]
- %tmp.4.i10853 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i10852, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i10855 = load double* %tmp.5.i33146 ; <double> [#uses=1]
- store double %tmp.6.i10855, double* %tmp.4.i10853
- %tmp.7.i10856 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i10852, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i10858 = load double* %tmp.8.i33149 ; <double> [#uses=1]
- store double %tmp.9.i10858, double* %tmp.7.i10856
- %tmp.0.i10859 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i10852, %"struct.std::dcomplex"* %tmp.21 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i10860 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1259, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i10861 = getelementptr %"struct.std::dcomplex"* %tmp.0.i10859, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i10862 = load double* %tmp.14.i10861 ; <double> [#uses=1]
- store double %tmp.15.i10862, double* %tmp.13.i10860
- %tmp.16.i10863 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1259, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i10864 = getelementptr %"struct.std::dcomplex"* %tmp.0.i10859, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i10865 = load double* %tmp.17.i10864 ; <double> [#uses=1]
- store double %tmp.18.i10865, double* %tmp.16.i10863
- %tmp.4.i10839 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i10838, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i10876, double* %tmp.4.i10839
- %tmp.7.i10842 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i10838, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i10879, double* %tmp.7.i10842
- %tmp.0.i10845 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i10838, %"struct.std::dcomplex"* %mem_tmp.1259 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i10847 = getelementptr %"struct.std::dcomplex"* %tmp.0.i10845, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i10848 = load double* %tmp.14.i10847 ; <double> [#uses=1]
- %tmp.17.i10850 = getelementptr %"struct.std::dcomplex"* %tmp.0.i10845, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i10851 = load double* %tmp.17.i10850 ; <double> [#uses=1]
- %tmp.4.i10825 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i10824, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i10848, double* %tmp.4.i10825
- %tmp.7.i10828 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i10824, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i10851, double* %tmp.7.i10828
- %tmp.0.i10831 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i10824, %"struct.std::dcomplex"* %tmp.30 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i10833 = getelementptr %"struct.std::dcomplex"* %tmp.0.i10831, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i10834 = load double* %tmp.14.i10833 ; <double> [#uses=1]
- %tmp.17.i10836 = getelementptr %"struct.std::dcomplex"* %tmp.0.i10831, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i10837 = load double* %tmp.17.i10836 ; <double> [#uses=1]
- %tmp.4.i10811 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i10810, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i10813 = load double* %tmp.5.i33146 ; <double> [#uses=1]
- store double %tmp.6.i10813, double* %tmp.4.i10811
- %tmp.7.i10814 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i10810, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i10816 = load double* %tmp.8.i33149 ; <double> [#uses=1]
- store double %tmp.9.i10816, double* %tmp.7.i10814
- %tmp.0.i10817 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i10810, %"struct.std::dcomplex"* %tmp.12 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i10819 = getelementptr %"struct.std::dcomplex"* %tmp.0.i10817, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i10820 = load double* %tmp.14.i10819 ; <double> [#uses=1]
- %tmp.17.i10822 = getelementptr %"struct.std::dcomplex"* %tmp.0.i10817, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i10823 = load double* %tmp.17.i10822 ; <double> [#uses=1]
- %tmp.4.i10797 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i10796, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i10799 = load double* %tmp.5.i34352 ; <double> [#uses=1]
- store double %tmp.6.i10799, double* %tmp.4.i10797
- %tmp.7.i10800 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i10796, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i10802 = load double* %tmp.8.i34355 ; <double> [#uses=1]
- store double %tmp.9.i10802, double* %tmp.7.i10800
- %tmp.0.i10803 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i10796, %"struct.std::dcomplex"* %tmp.226 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i10804 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1263, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i10805 = getelementptr %"struct.std::dcomplex"* %tmp.0.i10803, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i10806 = load double* %tmp.14.i10805 ; <double> [#uses=1]
- store double %tmp.15.i10806, double* %tmp.13.i10804
- %tmp.16.i10807 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1263, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i10808 = getelementptr %"struct.std::dcomplex"* %tmp.0.i10803, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i10809 = load double* %tmp.17.i10808 ; <double> [#uses=1]
- store double %tmp.18.i10809, double* %tmp.16.i10807
- %tmp.4.i10783 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i10782, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i10820, double* %tmp.4.i10783
- %tmp.7.i10786 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i10782, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i10823, double* %tmp.7.i10786
- %tmp.0.i10789 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i10782, %"struct.std::dcomplex"* %mem_tmp.1263 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i10791 = getelementptr %"struct.std::dcomplex"* %tmp.0.i10789, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i10792 = load double* %tmp.14.i10791 ; <double> [#uses=1]
- %tmp.17.i10794 = getelementptr %"struct.std::dcomplex"* %tmp.0.i10789, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i10795 = load double* %tmp.17.i10794 ; <double> [#uses=1]
- %tmp.4.i10769 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i10768, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i10792, double* %tmp.4.i10769
- %tmp.7.i10772 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i10768, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i10795, double* %tmp.7.i10772
- %tmp.0.i10775 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i10768, %"struct.std::dcomplex"* %tmp.15 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i10776 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1260, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i10777 = getelementptr %"struct.std::dcomplex"* %tmp.0.i10775, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i10778 = load double* %tmp.14.i10777 ; <double> [#uses=1]
- store double %tmp.15.i10778, double* %tmp.13.i10776
- %tmp.16.i10779 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1260, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i10780 = getelementptr %"struct.std::dcomplex"* %tmp.0.i10775, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i10781 = load double* %tmp.17.i10780 ; <double> [#uses=1]
- store double %tmp.18.i10781, double* %tmp.16.i10779
- %tmp.4.i10755 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i10754, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i10834, double* %tmp.4.i10755
- %tmp.7.i10758 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i10754, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i10837, double* %tmp.7.i10758
- %tmp.0.i10761 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i10754, %"struct.std::dcomplex"* %mem_tmp.1260 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i10763 = getelementptr %"struct.std::dcomplex"* %tmp.0.i10761, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i10764 = load double* %tmp.14.i10763 ; <double> [#uses=1]
- %tmp.17.i10766 = getelementptr %"struct.std::dcomplex"* %tmp.0.i10761, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i10767 = load double* %tmp.17.i10766 ; <double> [#uses=1]
- %tmp.4.i10741 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i10740, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i10743 = load double* %tmp.5.i34352 ; <double> [#uses=1]
- store double %tmp.6.i10743, double* %tmp.4.i10741
- %tmp.7.i10744 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i10740, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i10746 = load double* %tmp.8.i34355 ; <double> [#uses=1]
- store double %tmp.9.i10746, double* %tmp.7.i10744
- %tmp.0.i10747 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i10740, %"struct.std::dcomplex"* %tmp.21 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i10749 = getelementptr %"struct.std::dcomplex"* %tmp.0.i10747, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i10750 = load double* %tmp.14.i10749 ; <double> [#uses=1]
- %tmp.17.i10752 = getelementptr %"struct.std::dcomplex"* %tmp.0.i10747, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i10753 = load double* %tmp.17.i10752 ; <double> [#uses=1]
- %tmp.4.i10727 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i10726, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i10729 = load double* %tmp.5.i34282 ; <double> [#uses=1]
- store double %tmp.6.i10729, double* %tmp.4.i10727
- %tmp.7.i10730 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i10726, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i10732 = load double* %tmp.8.i34285 ; <double> [#uses=1]
- store double %tmp.9.i10732, double* %tmp.7.i10730
- %tmp.0.i10733 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i10726, %"struct.std::dcomplex"* %tmp.12 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i10734 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1267, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i10735 = getelementptr %"struct.std::dcomplex"* %tmp.0.i10733, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i10736 = load double* %tmp.14.i10735 ; <double> [#uses=1]
- store double %tmp.15.i10736, double* %tmp.13.i10734
- %tmp.16.i10737 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1267, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i10738 = getelementptr %"struct.std::dcomplex"* %tmp.0.i10733, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i10739 = load double* %tmp.17.i10738 ; <double> [#uses=1]
- store double %tmp.18.i10739, double* %tmp.16.i10737
- %tmp.4.i10713 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i10712, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i10750, double* %tmp.4.i10713
- %tmp.7.i10716 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i10712, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i10753, double* %tmp.7.i10716
- %tmp.0.i10719 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i10712, %"struct.std::dcomplex"* %mem_tmp.1267 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i10721 = getelementptr %"struct.std::dcomplex"* %tmp.0.i10719, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i10722 = load double* %tmp.14.i10721 ; <double> [#uses=1]
- %tmp.17.i10724 = getelementptr %"struct.std::dcomplex"* %tmp.0.i10719, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i10725 = load double* %tmp.17.i10724 ; <double> [#uses=1]
- %tmp.4.i10699 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i10698, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i10722, double* %tmp.4.i10699
- %tmp.7.i10702 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i10698, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i10725, double* %tmp.7.i10702
- %tmp.0.i10705 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i10698, %"struct.std::dcomplex"* %tmp.220 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i10706 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1264, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i10707 = getelementptr %"struct.std::dcomplex"* %tmp.0.i10705, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i10708 = load double* %tmp.14.i10707 ; <double> [#uses=1]
- store double %tmp.15.i10708, double* %tmp.13.i10706
- %tmp.16.i10709 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1264, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i10710 = getelementptr %"struct.std::dcomplex"* %tmp.0.i10705, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i10711 = load double* %tmp.17.i10710 ; <double> [#uses=1]
- store double %tmp.18.i10711, double* %tmp.16.i10709
- %tmp.4.i10685 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i10684, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i10764, double* %tmp.4.i10685
- %tmp.7.i10688 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i10684, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i10767, double* %tmp.7.i10688
- %tmp.0.i10691 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i10684, %"struct.std::dcomplex"* %mem_tmp.1264 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i10693 = getelementptr %"struct.std::dcomplex"* %tmp.0.i10691, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i10694 = load double* %tmp.14.i10693 ; <double> [#uses=1]
- %tmp.17.i10696 = getelementptr %"struct.std::dcomplex"* %tmp.0.i10691, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i10697 = load double* %tmp.17.i10696 ; <double> [#uses=1]
- store double %tmp.15.i10694, double* %tmp.2.i34364
- store double %tmp.18.i10697, double* %tmp.6.i34365
- %tmp.4.i10651 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i10650, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i10653 = load double* %tmp.5.i33596 ; <double> [#uses=1]
- store double %tmp.6.i10653, double* %tmp.4.i10651
- %tmp.7.i10654 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i10650, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i10656 = load double* %tmp.8.i33599 ; <double> [#uses=1]
- store double %tmp.9.i10656, double* %tmp.7.i10654
- %tmp.0.i10657 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i10650, %"struct.std::dcomplex"* %ret3 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i10659 = getelementptr %"struct.std::dcomplex"* %tmp.0.i10657, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i10660 = load double* %tmp.14.i10659 ; <double> [#uses=1]
- %tmp.17.i10662 = getelementptr %"struct.std::dcomplex"* %tmp.0.i10657, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i10663 = load double* %tmp.17.i10662 ; <double> [#uses=1]
- %tmp.7.i10617 = load double* %tmp.2.i34366 ; <double> [#uses=1]
- %tmp.15.i10631 = add double %tmp.7.i10617, %tmp.15.i10660 ; <double> [#uses=1]
- store double %tmp.15.i10631, double* %tmp.2.i34366
- %tmp.26.i10638 = load double* %tmp.6.i34367 ; <double> [#uses=1]
- %tmp.31.i10649 = add double %tmp.26.i10638, %tmp.18.i10663 ; <double> [#uses=1]
- store double %tmp.31.i10649, double* %tmp.6.i34367
- %tmp.4.i10597 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i10596, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i10599 = load double* %tmp.5.i34338 ; <double> [#uses=1]
- store double %tmp.6.i10599, double* %tmp.4.i10597
- %tmp.7.i10600 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i10596, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i10602 = load double* %tmp.8.i34341 ; <double> [#uses=1]
- store double %tmp.9.i10602, double* %tmp.7.i10600
- %tmp.0.i10603 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i10596, %"struct.std::dcomplex"* %tmp.12 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i10605 = getelementptr %"struct.std::dcomplex"* %tmp.0.i10603, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i10606 = load double* %tmp.14.i10605 ; <double> [#uses=1]
- %tmp.17.i10608 = getelementptr %"struct.std::dcomplex"* %tmp.0.i10603, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i10609 = load double* %tmp.17.i10608 ; <double> [#uses=1]
- %tmp.4.i10583 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i10582, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i10585 = load double* %tmp.5.i34352 ; <double> [#uses=1]
- store double %tmp.6.i10585, double* %tmp.4.i10583
- %tmp.7.i10586 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i10582, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i10588 = load double* %tmp.8.i34355 ; <double> [#uses=1]
- store double %tmp.9.i10588, double* %tmp.7.i10586
- %tmp.0.i10589 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i10582, %"struct.std::dcomplex"* %tmp.6 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i10590 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1274, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i10591 = getelementptr %"struct.std::dcomplex"* %tmp.0.i10589, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i10592 = load double* %tmp.14.i10591 ; <double> [#uses=1]
- store double %tmp.15.i10592, double* %tmp.13.i10590
- %tmp.16.i10593 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1274, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i10594 = getelementptr %"struct.std::dcomplex"* %tmp.0.i10589, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i10595 = load double* %tmp.17.i10594 ; <double> [#uses=1]
- store double %tmp.18.i10595, double* %tmp.16.i10593
- %tmp.4.i10569 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i10568, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i10606, double* %tmp.4.i10569
- %tmp.7.i10572 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i10568, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i10609, double* %tmp.7.i10572
- %tmp.0.i10575 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i10568, %"struct.std::dcomplex"* %mem_tmp.1274 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i10577 = getelementptr %"struct.std::dcomplex"* %tmp.0.i10575, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i10578 = load double* %tmp.14.i10577 ; <double> [#uses=1]
- %tmp.17.i10580 = getelementptr %"struct.std::dcomplex"* %tmp.0.i10575, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i10581 = load double* %tmp.17.i10580 ; <double> [#uses=1]
- %tmp.4.i10555 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i10554, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i10578, double* %tmp.4.i10555
- %tmp.7.i10558 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i10554, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i10581, double* %tmp.7.i10558
- %tmp.0.i10561 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i10554, %"struct.std::dcomplex"* %tmp.220 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i10563 = getelementptr %"struct.std::dcomplex"* %tmp.0.i10561, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i10564 = load double* %tmp.14.i10563 ; <double> [#uses=1]
- %tmp.17.i10566 = getelementptr %"struct.std::dcomplex"* %tmp.0.i10561, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i10567 = load double* %tmp.17.i10566 ; <double> [#uses=1]
- %tmp.4.i10541 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i10540, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i10543 = load double* %tmp.5.i33146 ; <double> [#uses=1]
- store double %tmp.6.i10543, double* %tmp.4.i10541
- %tmp.7.i10544 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i10540, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i10546 = load double* %tmp.8.i33149 ; <double> [#uses=1]
- store double %tmp.9.i10546, double* %tmp.7.i10544
- %tmp.0.i10547 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i10540, %"struct.std::dcomplex"* %tmp.6 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i10549 = getelementptr %"struct.std::dcomplex"* %tmp.0.i10547, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i10550 = load double* %tmp.14.i10549 ; <double> [#uses=1]
- %tmp.17.i10552 = getelementptr %"struct.std::dcomplex"* %tmp.0.i10547, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i10553 = load double* %tmp.17.i10552 ; <double> [#uses=1]
- %tmp.4.i10527 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i10526, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i10529 = load double* %tmp.5.i34338 ; <double> [#uses=1]
- store double %tmp.6.i10529, double* %tmp.4.i10527
- %tmp.7.i10530 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i10526, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i10532 = load double* %tmp.8.i34341 ; <double> [#uses=1]
- store double %tmp.9.i10532, double* %tmp.7.i10530
- %tmp.0.i10533 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i10526, %"struct.std::dcomplex"* %tmp.226 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i10534 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1278, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i10535 = getelementptr %"struct.std::dcomplex"* %tmp.0.i10533, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i10536 = load double* %tmp.14.i10535 ; <double> [#uses=1]
- store double %tmp.15.i10536, double* %tmp.13.i10534
- %tmp.16.i10537 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1278, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i10538 = getelementptr %"struct.std::dcomplex"* %tmp.0.i10533, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i10539 = load double* %tmp.17.i10538 ; <double> [#uses=1]
- store double %tmp.18.i10539, double* %tmp.16.i10537
- %tmp.4.i10513 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i10512, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i10550, double* %tmp.4.i10513
- %tmp.7.i10516 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i10512, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i10553, double* %tmp.7.i10516
- %tmp.0.i10519 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i10512, %"struct.std::dcomplex"* %mem_tmp.1278 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i10521 = getelementptr %"struct.std::dcomplex"* %tmp.0.i10519, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i10522 = load double* %tmp.14.i10521 ; <double> [#uses=1]
- %tmp.17.i10524 = getelementptr %"struct.std::dcomplex"* %tmp.0.i10519, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i10525 = load double* %tmp.17.i10524 ; <double> [#uses=1]
- %tmp.4.i10499 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i10498, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i10522, double* %tmp.4.i10499
- %tmp.7.i10502 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i10498, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i10525, double* %tmp.7.i10502
- %tmp.0.i10505 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i10498, %"struct.std::dcomplex"* %tmp.30 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i10506 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1275, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i10507 = getelementptr %"struct.std::dcomplex"* %tmp.0.i10505, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i10508 = load double* %tmp.14.i10507 ; <double> [#uses=1]
- store double %tmp.15.i10508, double* %tmp.13.i10506
- %tmp.16.i10509 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1275, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i10510 = getelementptr %"struct.std::dcomplex"* %tmp.0.i10505, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i10511 = load double* %tmp.17.i10510 ; <double> [#uses=1]
- store double %tmp.18.i10511, double* %tmp.16.i10509
- %tmp.4.i10485 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i10484, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i10564, double* %tmp.4.i10485
- %tmp.7.i10488 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i10484, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i10567, double* %tmp.7.i10488
- %tmp.0.i10491 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i10484, %"struct.std::dcomplex"* %mem_tmp.1275 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i10493 = getelementptr %"struct.std::dcomplex"* %tmp.0.i10491, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i10494 = load double* %tmp.14.i10493 ; <double> [#uses=1]
- %tmp.17.i10496 = getelementptr %"struct.std::dcomplex"* %tmp.0.i10491, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i10497 = load double* %tmp.17.i10496 ; <double> [#uses=1]
- %tmp.4.i10471 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i10470, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i10473 = load double* %tmp.5.i34352 ; <double> [#uses=1]
- store double %tmp.6.i10473, double* %tmp.4.i10471
- %tmp.7.i10474 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i10470, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i10476 = load double* %tmp.8.i34355 ; <double> [#uses=1]
- store double %tmp.9.i10476, double* %tmp.7.i10474
- %tmp.0.i10477 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i10470, %"struct.std::dcomplex"* %tmp.226 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i10479 = getelementptr %"struct.std::dcomplex"* %tmp.0.i10477, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i10480 = load double* %tmp.14.i10479 ; <double> [#uses=1]
- %tmp.17.i10482 = getelementptr %"struct.std::dcomplex"* %tmp.0.i10477, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i10483 = load double* %tmp.17.i10482 ; <double> [#uses=1]
- %tmp.4.i10457 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i10456, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i10459 = load double* %tmp.5.i33146 ; <double> [#uses=1]
- store double %tmp.6.i10459, double* %tmp.4.i10457
- %tmp.7.i10460 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i10456, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i10462 = load double* %tmp.8.i33149 ; <double> [#uses=1]
- store double %tmp.9.i10462, double* %tmp.7.i10460
- %tmp.0.i10463 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i10456, %"struct.std::dcomplex"* %tmp.12 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i10464 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1282, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i10465 = getelementptr %"struct.std::dcomplex"* %tmp.0.i10463, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i10466 = load double* %tmp.14.i10465 ; <double> [#uses=1]
- store double %tmp.15.i10466, double* %tmp.13.i10464
- %tmp.16.i10467 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1282, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i10468 = getelementptr %"struct.std::dcomplex"* %tmp.0.i10463, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i10469 = load double* %tmp.17.i10468 ; <double> [#uses=1]
- store double %tmp.18.i10469, double* %tmp.16.i10467
- %tmp.4.i10443 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i10442, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i10480, double* %tmp.4.i10443
- %tmp.7.i10446 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i10442, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i10483, double* %tmp.7.i10446
- %tmp.0.i10449 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i10442, %"struct.std::dcomplex"* %mem_tmp.1282 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i10451 = getelementptr %"struct.std::dcomplex"* %tmp.0.i10449, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i10452 = load double* %tmp.14.i10451 ; <double> [#uses=1]
- %tmp.17.i10454 = getelementptr %"struct.std::dcomplex"* %tmp.0.i10449, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i10455 = load double* %tmp.17.i10454 ; <double> [#uses=1]
- %tmp.4.i10429 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i10428, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i10452, double* %tmp.4.i10429
- %tmp.7.i10432 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i10428, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i10455, double* %tmp.7.i10432
- %tmp.0.i10435 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i10428, %"struct.std::dcomplex"* %tmp.45 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i10436 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1279, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i10437 = getelementptr %"struct.std::dcomplex"* %tmp.0.i10435, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i10438 = load double* %tmp.14.i10437 ; <double> [#uses=1]
- store double %tmp.15.i10438, double* %tmp.13.i10436
- %tmp.16.i10439 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1279, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i10440 = getelementptr %"struct.std::dcomplex"* %tmp.0.i10435, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i10441 = load double* %tmp.17.i10440 ; <double> [#uses=1]
- store double %tmp.18.i10441, double* %tmp.16.i10439
- %tmp.4.i10415 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i10414, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i10494, double* %tmp.4.i10415
- %tmp.7.i10418 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i10414, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i10497, double* %tmp.7.i10418
- %tmp.0.i10421 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i10414, %"struct.std::dcomplex"* %mem_tmp.1279 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i10423 = getelementptr %"struct.std::dcomplex"* %tmp.0.i10421, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i10424 = load double* %tmp.14.i10423 ; <double> [#uses=1]
- %tmp.17.i10426 = getelementptr %"struct.std::dcomplex"* %tmp.0.i10421, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i10427 = load double* %tmp.17.i10426 ; <double> [#uses=1]
- store double %tmp.15.i10424, double* %tmp.2.i34364
- store double %tmp.18.i10427, double* %tmp.6.i34365
- %tmp.4.i10381 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i10380, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i10383 = load double* %tmp.5.i33326 ; <double> [#uses=1]
- store double %tmp.6.i10383, double* %tmp.4.i10381
- %tmp.7.i10384 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i10380, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i10386 = load double* %tmp.8.i33329 ; <double> [#uses=1]
- store double %tmp.9.i10386, double* %tmp.7.i10384
- %tmp.0.i10387 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i10380, %"struct.std::dcomplex"* %ret3 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i10389 = getelementptr %"struct.std::dcomplex"* %tmp.0.i10387, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i10390 = load double* %tmp.14.i10389 ; <double> [#uses=1]
- %tmp.17.i10392 = getelementptr %"struct.std::dcomplex"* %tmp.0.i10387, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i10393 = load double* %tmp.17.i10392 ; <double> [#uses=1]
- %tmp.7.i10347 = load double* %tmp.2.i34366 ; <double> [#uses=1]
- %tmp.15.i10361 = add double %tmp.7.i10347, %tmp.15.i10390 ; <double> [#uses=1]
- store double %tmp.15.i10361, double* %tmp.2.i34366
- %tmp.26.i10368 = load double* %tmp.6.i34367 ; <double> [#uses=1]
- %tmp.31.i10379 = add double %tmp.26.i10368, %tmp.18.i10393 ; <double> [#uses=1]
- store double %tmp.31.i10379, double* %tmp.6.i34367
- %tmp.4.i10327 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i10326, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i10329 = load double* %tmp.5.i25264 ; <double> [#uses=1]
- store double %tmp.6.i10329, double* %tmp.4.i10327
- %tmp.7.i10330 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i10326, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i10332 = load double* %tmp.8.i25267 ; <double> [#uses=1]
- store double %tmp.9.i10332, double* %tmp.7.i10330
- %tmp.0.i10333 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i10326, %"struct.std::dcomplex"* %ret4 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i10335 = getelementptr %"struct.std::dcomplex"* %tmp.0.i10333, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i10336 = load double* %tmp.14.i10335 ; <double> [#uses=1]
- %tmp.17.i10338 = getelementptr %"struct.std::dcomplex"* %tmp.0.i10333, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i10339 = load double* %tmp.17.i10338 ; <double> [#uses=1]
- %tmp.7.i10293 = load double* %tmp.2.i34368 ; <double> [#uses=1]
- %tmp.15.i10307 = add double %tmp.7.i10293, %tmp.15.i10336 ; <double> [#uses=1]
- store double %tmp.15.i10307, double* %tmp.2.i34368
- %tmp.26.i10314 = load double* %tmp.6.i34369 ; <double> [#uses=1]
- %tmp.31.i10325 = add double %tmp.26.i10314, %tmp.18.i10339 ; <double> [#uses=1]
- store double %tmp.31.i10325, double* %tmp.6.i34369
- store double 0.000000e+00, double* %tmp.2.i34366
- store double 0.000000e+00, double* %tmp.6.i34367
- %tmp.4.i10271 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i10270, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i10273 = load double* %tmp.5.i33146 ; <double> [#uses=1]
- store double %tmp.6.i10273, double* %tmp.4.i10271
- %tmp.7.i10274 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i10270, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i10276 = load double* %tmp.8.i33149 ; <double> [#uses=1]
- store double %tmp.9.i10276, double* %tmp.7.i10274
- %tmp.0.i10277 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i10270, %"struct.std::dcomplex"* %tmp.1036 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i10279 = getelementptr %"struct.std::dcomplex"* %tmp.0.i10277, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i10280 = load double* %tmp.14.i10279 ; <double> [#uses=1]
- %tmp.17.i10282 = getelementptr %"struct.std::dcomplex"* %tmp.0.i10277, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i10283 = load double* %tmp.17.i10282 ; <double> [#uses=1]
- %tmp.4.i10257 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i10256, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i10259 = load double* %tmp.5.i28602 ; <double> [#uses=1]
- store double %tmp.6.i10259, double* %tmp.4.i10257
- %tmp.7.i10260 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i10256, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i10262 = load double* %tmp.8.i28605 ; <double> [#uses=1]
- store double %tmp.9.i10262, double* %tmp.7.i10260
- %tmp.0.i10263 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i10256, %"struct.std::dcomplex"* %tmp.226 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i10264 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1290, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i10265 = getelementptr %"struct.std::dcomplex"* %tmp.0.i10263, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i10266 = load double* %tmp.14.i10265 ; <double> [#uses=1]
- store double %tmp.15.i10266, double* %tmp.13.i10264
- %tmp.16.i10267 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1290, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i10268 = getelementptr %"struct.std::dcomplex"* %tmp.0.i10263, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i10269 = load double* %tmp.17.i10268 ; <double> [#uses=1]
- store double %tmp.18.i10269, double* %tmp.16.i10267
- %tmp.4.i10243 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i10242, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i10280, double* %tmp.4.i10243
- %tmp.7.i10246 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i10242, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i10283, double* %tmp.7.i10246
- %tmp.0.i10249 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i10242, %"struct.std::dcomplex"* %mem_tmp.1290 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i10251 = getelementptr %"struct.std::dcomplex"* %tmp.0.i10249, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i10252 = load double* %tmp.14.i10251 ; <double> [#uses=1]
- %tmp.17.i10254 = getelementptr %"struct.std::dcomplex"* %tmp.0.i10249, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i10255 = load double* %tmp.17.i10254 ; <double> [#uses=1]
- %tmp.4.i10229 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i10228, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i10252, double* %tmp.4.i10229
- %tmp.7.i10232 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i10228, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i10255, double* %tmp.7.i10232
- %tmp.0.i10235 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i10228, %"struct.std::dcomplex"* %tmp.45 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i10237 = getelementptr %"struct.std::dcomplex"* %tmp.0.i10235, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i10238 = load double* %tmp.14.i10237 ; <double> [#uses=1]
- %tmp.17.i10240 = getelementptr %"struct.std::dcomplex"* %tmp.0.i10235, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i10241 = load double* %tmp.17.i10240 ; <double> [#uses=1]
- %tmp.4.i10215 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i10214, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i10217 = load double* %tmp.5.i28602 ; <double> [#uses=1]
- store double %tmp.6.i10217, double* %tmp.4.i10215
- %tmp.7.i10218 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i10214, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i10220 = load double* %tmp.8.i28605 ; <double> [#uses=1]
- store double %tmp.9.i10220, double* %tmp.7.i10218
- %tmp.0.i10221 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i10214, %"struct.std::dcomplex"* %tmp.6 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i10223 = getelementptr %"struct.std::dcomplex"* %tmp.0.i10221, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i10224 = load double* %tmp.14.i10223 ; <double> [#uses=1]
- %tmp.17.i10226 = getelementptr %"struct.std::dcomplex"* %tmp.0.i10221, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i10227 = load double* %tmp.17.i10226 ; <double> [#uses=1]
- %tmp.4.i10201 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i10200, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i10203 = load double* %tmp.5.i34338 ; <double> [#uses=1]
- store double %tmp.6.i10203, double* %tmp.4.i10201
- %tmp.7.i10204 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i10200, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i10206 = load double* %tmp.8.i34341 ; <double> [#uses=1]
- store double %tmp.9.i10206, double* %tmp.7.i10204
- %tmp.0.i10207 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i10200, %"struct.std::dcomplex"* %tmp.1036 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i10208 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1294, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i10209 = getelementptr %"struct.std::dcomplex"* %tmp.0.i10207, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i10210 = load double* %tmp.14.i10209 ; <double> [#uses=1]
- store double %tmp.15.i10210, double* %tmp.13.i10208
- %tmp.16.i10211 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1294, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i10212 = getelementptr %"struct.std::dcomplex"* %tmp.0.i10207, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i10213 = load double* %tmp.17.i10212 ; <double> [#uses=1]
- store double %tmp.18.i10213, double* %tmp.16.i10211
- %tmp.4.i10187 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i10186, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i10224, double* %tmp.4.i10187
- %tmp.7.i10190 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i10186, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i10227, double* %tmp.7.i10190
- %tmp.0.i10193 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i10186, %"struct.std::dcomplex"* %mem_tmp.1294 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i10195 = getelementptr %"struct.std::dcomplex"* %tmp.0.i10193, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i10196 = load double* %tmp.14.i10195 ; <double> [#uses=1]
- %tmp.17.i10198 = getelementptr %"struct.std::dcomplex"* %tmp.0.i10193, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i10199 = load double* %tmp.17.i10198 ; <double> [#uses=1]
- %tmp.4.i10173 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i10172, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i10196, double* %tmp.4.i10173
- %tmp.7.i10176 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i10172, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i10199, double* %tmp.7.i10176
- %tmp.0.i10179 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i10172, %"struct.std::dcomplex"* %tmp.220 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i10180 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1291, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i10181 = getelementptr %"struct.std::dcomplex"* %tmp.0.i10179, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i10182 = load double* %tmp.14.i10181 ; <double> [#uses=1]
- store double %tmp.15.i10182, double* %tmp.13.i10180
- %tmp.16.i10183 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1291, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i10184 = getelementptr %"struct.std::dcomplex"* %tmp.0.i10179, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i10185 = load double* %tmp.17.i10184 ; <double> [#uses=1]
- store double %tmp.18.i10185, double* %tmp.16.i10183
- %tmp.4.i10159 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i10158, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i10238, double* %tmp.4.i10159
- %tmp.7.i10162 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i10158, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i10241, double* %tmp.7.i10162
- %tmp.0.i10165 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i10158, %"struct.std::dcomplex"* %mem_tmp.1291 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i10167 = getelementptr %"struct.std::dcomplex"* %tmp.0.i10165, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i10168 = load double* %tmp.14.i10167 ; <double> [#uses=1]
- %tmp.17.i10170 = getelementptr %"struct.std::dcomplex"* %tmp.0.i10165, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i10171 = load double* %tmp.17.i10170 ; <double> [#uses=1]
- %tmp.4.i10145 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i10144, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i10147 = load double* %tmp.5.i34338 ; <double> [#uses=1]
- store double %tmp.6.i10147, double* %tmp.4.i10145
- %tmp.7.i10148 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i10144, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i10150 = load double* %tmp.8.i34341 ; <double> [#uses=1]
- store double %tmp.9.i10150, double* %tmp.7.i10148
- %tmp.0.i10151 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i10144, %"struct.std::dcomplex"* %tmp.226 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i10153 = getelementptr %"struct.std::dcomplex"* %tmp.0.i10151, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i10154 = load double* %tmp.14.i10153 ; <double> [#uses=1]
- %tmp.17.i10156 = getelementptr %"struct.std::dcomplex"* %tmp.0.i10151, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i10157 = load double* %tmp.17.i10156 ; <double> [#uses=1]
- %tmp.4.i10131 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i10130, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i10133 = load double* %tmp.5.i33146 ; <double> [#uses=1]
- store double %tmp.6.i10133, double* %tmp.4.i10131
- %tmp.7.i10134 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i10130, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i10136 = load double* %tmp.8.i33149 ; <double> [#uses=1]
- store double %tmp.9.i10136, double* %tmp.7.i10134
- %tmp.0.i10137 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i10130, %"struct.std::dcomplex"* %tmp.6 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i10138 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1298, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i10139 = getelementptr %"struct.std::dcomplex"* %tmp.0.i10137, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i10140 = load double* %tmp.14.i10139 ; <double> [#uses=1]
- store double %tmp.15.i10140, double* %tmp.13.i10138
- %tmp.16.i10141 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1298, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i10142 = getelementptr %"struct.std::dcomplex"* %tmp.0.i10137, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i10143 = load double* %tmp.17.i10142 ; <double> [#uses=1]
- store double %tmp.18.i10143, double* %tmp.16.i10141
- %tmp.4.i10117 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i10116, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i10154, double* %tmp.4.i10117
- %tmp.7.i10120 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i10116, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i10157, double* %tmp.7.i10120
- %tmp.0.i10123 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i10116, %"struct.std::dcomplex"* %mem_tmp.1298 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i10125 = getelementptr %"struct.std::dcomplex"* %tmp.0.i10123, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i10126 = load double* %tmp.14.i10125 ; <double> [#uses=1]
- %tmp.17.i10128 = getelementptr %"struct.std::dcomplex"* %tmp.0.i10123, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i10129 = load double* %tmp.17.i10128 ; <double> [#uses=1]
- %tmp.4.i10103 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i10102, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i10126, double* %tmp.4.i10103
- %tmp.7.i10106 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i10102, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i10129, double* %tmp.7.i10106
- %tmp.0.i10109 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i10102, %"struct.std::dcomplex"* %tmp.1075 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i10110 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1295, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i10111 = getelementptr %"struct.std::dcomplex"* %tmp.0.i10109, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i10112 = load double* %tmp.14.i10111 ; <double> [#uses=1]
- store double %tmp.15.i10112, double* %tmp.13.i10110
- %tmp.16.i10113 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1295, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i10114 = getelementptr %"struct.std::dcomplex"* %tmp.0.i10109, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i10115 = load double* %tmp.17.i10114 ; <double> [#uses=1]
- store double %tmp.18.i10115, double* %tmp.16.i10113
- %tmp.4.i10089 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i10088, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i10168, double* %tmp.4.i10089
- %tmp.7.i10092 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i10088, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i10171, double* %tmp.7.i10092
- %tmp.0.i10095 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i10088, %"struct.std::dcomplex"* %mem_tmp.1295 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i10097 = getelementptr %"struct.std::dcomplex"* %tmp.0.i10095, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i10098 = load double* %tmp.14.i10097 ; <double> [#uses=1]
- %tmp.17.i10100 = getelementptr %"struct.std::dcomplex"* %tmp.0.i10095, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i10101 = load double* %tmp.17.i10100 ; <double> [#uses=1]
- store double %tmp.15.i10098, double* %tmp.2.i34364
- store double %tmp.18.i10101, double* %tmp.6.i34365
- %tmp.4.i10055 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i10054, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i10057 = load double* %tmp.5.i33326 ; <double> [#uses=1]
- store double %tmp.6.i10057, double* %tmp.4.i10055
- %tmp.7.i10058 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i10054, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i10060 = load double* %tmp.8.i33329 ; <double> [#uses=1]
- store double %tmp.9.i10060, double* %tmp.7.i10058
- %tmp.0.i10061 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i10054, %"struct.std::dcomplex"* %ret3 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i10063 = getelementptr %"struct.std::dcomplex"* %tmp.0.i10061, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i10064 = load double* %tmp.14.i10063 ; <double> [#uses=1]
- %tmp.17.i10066 = getelementptr %"struct.std::dcomplex"* %tmp.0.i10061, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i10067 = load double* %tmp.17.i10066 ; <double> [#uses=1]
- %tmp.7.i10021 = load double* %tmp.2.i34366 ; <double> [#uses=1]
- %tmp.15.i10035 = add double %tmp.7.i10021, %tmp.15.i10064 ; <double> [#uses=1]
- store double %tmp.15.i10035, double* %tmp.2.i34366
- %tmp.26.i10042 = load double* %tmp.6.i34367 ; <double> [#uses=1]
- %tmp.31.i10053 = add double %tmp.26.i10042, %tmp.18.i10067 ; <double> [#uses=1]
- store double %tmp.31.i10053, double* %tmp.6.i34367
- %tmp.4.i10001 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i10000, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i10003 = load double* %tmp.5.i34282 ; <double> [#uses=1]
- store double %tmp.6.i10003, double* %tmp.4.i10001
- %tmp.7.i10004 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i10000, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i10006 = load double* %tmp.8.i34285 ; <double> [#uses=1]
- store double %tmp.9.i10006, double* %tmp.7.i10004
- %tmp.0.i10007 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i10000, %"struct.std::dcomplex"* %tmp.6 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i10009 = getelementptr %"struct.std::dcomplex"* %tmp.0.i10007, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i10010 = load double* %tmp.14.i10009 ; <double> [#uses=1]
- %tmp.17.i10012 = getelementptr %"struct.std::dcomplex"* %tmp.0.i10007, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i10013 = load double* %tmp.17.i10012 ; <double> [#uses=1]
- %tmp.4.i9987 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i9986, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i9989 = load double* %tmp.5.i34338 ; <double> [#uses=1]
- store double %tmp.6.i9989, double* %tmp.4.i9987
- %tmp.7.i9990 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i9986, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i9992 = load double* %tmp.8.i34341 ; <double> [#uses=1]
- store double %tmp.9.i9992, double* %tmp.7.i9990
- %tmp.0.i9993 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i9986, %"struct.std::dcomplex"* %tmp.21 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i9994 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1305, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i9995 = getelementptr %"struct.std::dcomplex"* %tmp.0.i9993, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i9996 = load double* %tmp.14.i9995 ; <double> [#uses=1]
- store double %tmp.15.i9996, double* %tmp.13.i9994
- %tmp.16.i9997 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1305, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i9998 = getelementptr %"struct.std::dcomplex"* %tmp.0.i9993, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i9999 = load double* %tmp.17.i9998 ; <double> [#uses=1]
- store double %tmp.18.i9999, double* %tmp.16.i9997
- %tmp.4.i9973 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i9972, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i10010, double* %tmp.4.i9973
- %tmp.7.i9976 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i9972, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i10013, double* %tmp.7.i9976
- %tmp.0.i9979 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i9972, %"struct.std::dcomplex"* %mem_tmp.1305 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i9981 = getelementptr %"struct.std::dcomplex"* %tmp.0.i9979, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i9982 = load double* %tmp.14.i9981 ; <double> [#uses=1]
- %tmp.17.i9984 = getelementptr %"struct.std::dcomplex"* %tmp.0.i9979, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i9985 = load double* %tmp.17.i9984 ; <double> [#uses=1]
- %tmp.4.i9959 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i9958, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i9982, double* %tmp.4.i9959
- %tmp.7.i9962 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i9958, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i9985, double* %tmp.7.i9962
- %tmp.0.i9965 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i9958, %"struct.std::dcomplex"* %tmp.1075 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i9967 = getelementptr %"struct.std::dcomplex"* %tmp.0.i9965, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i9968 = load double* %tmp.14.i9967 ; <double> [#uses=1]
- %tmp.17.i9970 = getelementptr %"struct.std::dcomplex"* %tmp.0.i9965, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i9971 = load double* %tmp.17.i9970 ; <double> [#uses=1]
- %tmp.4.i9945 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i9944, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i9947 = load double* %tmp.5.i28602 ; <double> [#uses=1]
- store double %tmp.6.i9947, double* %tmp.4.i9945
- %tmp.7.i9948 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i9944, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i9950 = load double* %tmp.8.i28605 ; <double> [#uses=1]
- store double %tmp.9.i9950, double* %tmp.7.i9948
- %tmp.0.i9951 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i9944, %"struct.std::dcomplex"* %tmp.21 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i9953 = getelementptr %"struct.std::dcomplex"* %tmp.0.i9951, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i9954 = load double* %tmp.14.i9953 ; <double> [#uses=1]
- %tmp.17.i9956 = getelementptr %"struct.std::dcomplex"* %tmp.0.i9951, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i9957 = load double* %tmp.17.i9956 ; <double> [#uses=1]
- %tmp.4.i9931 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i9930, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i9933 = load double* %tmp.5.i34282 ; <double> [#uses=1]
- store double %tmp.6.i9933, double* %tmp.4.i9931
- %tmp.7.i9934 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i9930, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i9936 = load double* %tmp.8.i34285 ; <double> [#uses=1]
- store double %tmp.9.i9936, double* %tmp.7.i9934
- %tmp.0.i9937 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i9930, %"struct.std::dcomplex"* %tmp.1036 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i9938 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1309, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i9939 = getelementptr %"struct.std::dcomplex"* %tmp.0.i9937, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i9940 = load double* %tmp.14.i9939 ; <double> [#uses=1]
- store double %tmp.15.i9940, double* %tmp.13.i9938
- %tmp.16.i9941 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1309, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i9942 = getelementptr %"struct.std::dcomplex"* %tmp.0.i9937, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i9943 = load double* %tmp.17.i9942 ; <double> [#uses=1]
- store double %tmp.18.i9943, double* %tmp.16.i9941
- %tmp.4.i9917 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i9916, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i9954, double* %tmp.4.i9917
- %tmp.7.i9920 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i9916, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i9957, double* %tmp.7.i9920
- %tmp.0.i9923 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i9916, %"struct.std::dcomplex"* %mem_tmp.1309 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i9925 = getelementptr %"struct.std::dcomplex"* %tmp.0.i9923, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i9926 = load double* %tmp.14.i9925 ; <double> [#uses=1]
- %tmp.17.i9928 = getelementptr %"struct.std::dcomplex"* %tmp.0.i9923, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i9929 = load double* %tmp.17.i9928 ; <double> [#uses=1]
- %tmp.4.i9903 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i9902, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i9926, double* %tmp.4.i9903
- %tmp.7.i9906 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i9902, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i9929, double* %tmp.7.i9906
- %tmp.0.i9909 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i9902, %"struct.std::dcomplex"* %tmp.45 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i9910 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1306, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i9911 = getelementptr %"struct.std::dcomplex"* %tmp.0.i9909, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i9912 = load double* %tmp.14.i9911 ; <double> [#uses=1]
- store double %tmp.15.i9912, double* %tmp.13.i9910
- %tmp.16.i9913 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1306, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i9914 = getelementptr %"struct.std::dcomplex"* %tmp.0.i9909, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i9915 = load double* %tmp.17.i9914 ; <double> [#uses=1]
- store double %tmp.18.i9915, double* %tmp.16.i9913
- %tmp.4.i9889 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i9888, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i9968, double* %tmp.4.i9889
- %tmp.7.i9892 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i9888, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i9971, double* %tmp.7.i9892
- %tmp.0.i9895 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i9888, %"struct.std::dcomplex"* %mem_tmp.1306 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i9897 = getelementptr %"struct.std::dcomplex"* %tmp.0.i9895, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i9898 = load double* %tmp.14.i9897 ; <double> [#uses=1]
- %tmp.17.i9900 = getelementptr %"struct.std::dcomplex"* %tmp.0.i9895, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i9901 = load double* %tmp.17.i9900 ; <double> [#uses=1]
- %tmp.4.i9875 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i9874, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i9877 = load double* %tmp.5.i34338 ; <double> [#uses=1]
- store double %tmp.6.i9877, double* %tmp.4.i9875
- %tmp.7.i9878 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i9874, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i9880 = load double* %tmp.8.i34341 ; <double> [#uses=1]
- store double %tmp.9.i9880, double* %tmp.7.i9878
- %tmp.0.i9881 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i9874, %"struct.std::dcomplex"* %tmp.1036 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i9883 = getelementptr %"struct.std::dcomplex"* %tmp.0.i9881, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i9884 = load double* %tmp.14.i9883 ; <double> [#uses=1]
- %tmp.17.i9886 = getelementptr %"struct.std::dcomplex"* %tmp.0.i9881, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i9887 = load double* %tmp.17.i9886 ; <double> [#uses=1]
- %tmp.4.i9861 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i9860, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i9863 = load double* %tmp.5.i28602 ; <double> [#uses=1]
- store double %tmp.6.i9863, double* %tmp.4.i9861
- %tmp.7.i9864 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i9860, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i9866 = load double* %tmp.8.i28605 ; <double> [#uses=1]
- store double %tmp.9.i9866, double* %tmp.7.i9864
- %tmp.0.i9867 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i9860, %"struct.std::dcomplex"* %tmp.6 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i9868 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1313, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i9869 = getelementptr %"struct.std::dcomplex"* %tmp.0.i9867, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i9870 = load double* %tmp.14.i9869 ; <double> [#uses=1]
- store double %tmp.15.i9870, double* %tmp.13.i9868
- %tmp.16.i9871 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1313, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i9872 = getelementptr %"struct.std::dcomplex"* %tmp.0.i9867, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i9873 = load double* %tmp.17.i9872 ; <double> [#uses=1]
- store double %tmp.18.i9873, double* %tmp.16.i9871
- %tmp.4.i9847 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i9846, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i9884, double* %tmp.4.i9847
- %tmp.7.i9850 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i9846, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i9887, double* %tmp.7.i9850
- %tmp.0.i9853 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i9846, %"struct.std::dcomplex"* %mem_tmp.1313 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i9855 = getelementptr %"struct.std::dcomplex"* %tmp.0.i9853, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i9856 = load double* %tmp.14.i9855 ; <double> [#uses=1]
- %tmp.17.i9858 = getelementptr %"struct.std::dcomplex"* %tmp.0.i9853, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i9859 = load double* %tmp.17.i9858 ; <double> [#uses=1]
- %tmp.4.i9833 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i9832, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i9856, double* %tmp.4.i9833
- %tmp.7.i9836 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i9832, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i9859, double* %tmp.7.i9836
- %tmp.0.i9839 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i9832, %"struct.std::dcomplex"* %tmp.15 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i9840 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1310, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i9841 = getelementptr %"struct.std::dcomplex"* %tmp.0.i9839, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i9842 = load double* %tmp.14.i9841 ; <double> [#uses=1]
- store double %tmp.15.i9842, double* %tmp.13.i9840
- %tmp.16.i9843 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1310, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i9844 = getelementptr %"struct.std::dcomplex"* %tmp.0.i9839, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i9845 = load double* %tmp.17.i9844 ; <double> [#uses=1]
- store double %tmp.18.i9845, double* %tmp.16.i9843
- %tmp.4.i9819 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i9818, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i9898, double* %tmp.4.i9819
- %tmp.7.i9822 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i9818, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i9901, double* %tmp.7.i9822
- %tmp.0.i9825 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i9818, %"struct.std::dcomplex"* %mem_tmp.1310 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i9827 = getelementptr %"struct.std::dcomplex"* %tmp.0.i9825, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i9828 = load double* %tmp.14.i9827 ; <double> [#uses=1]
- %tmp.17.i9830 = getelementptr %"struct.std::dcomplex"* %tmp.0.i9825, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i9831 = load double* %tmp.17.i9830 ; <double> [#uses=1]
- store double %tmp.15.i9828, double* %tmp.2.i34364
- store double %tmp.18.i9831, double* %tmp.6.i34365
- %tmp.4.i9785 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i9784, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i9787 = load double* %tmp.5.i32460 ; <double> [#uses=1]
- store double %tmp.6.i9787, double* %tmp.4.i9785
- %tmp.7.i9788 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i9784, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i9790 = load double* %tmp.8.i32463 ; <double> [#uses=1]
- store double %tmp.9.i9790, double* %tmp.7.i9788
- %tmp.0.i9791 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i9784, %"struct.std::dcomplex"* %ret3 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i9793 = getelementptr %"struct.std::dcomplex"* %tmp.0.i9791, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i9794 = load double* %tmp.14.i9793 ; <double> [#uses=1]
- %tmp.17.i9796 = getelementptr %"struct.std::dcomplex"* %tmp.0.i9791, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i9797 = load double* %tmp.17.i9796 ; <double> [#uses=1]
- %tmp.7.i9751 = load double* %tmp.2.i34366 ; <double> [#uses=1]
- %tmp.15.i9765 = add double %tmp.7.i9751, %tmp.15.i9794 ; <double> [#uses=1]
- store double %tmp.15.i9765, double* %tmp.2.i34366
- %tmp.26.i9772 = load double* %tmp.6.i34367 ; <double> [#uses=1]
- %tmp.31.i9783 = add double %tmp.26.i9772, %tmp.18.i9797 ; <double> [#uses=1]
- store double %tmp.31.i9783, double* %tmp.6.i34367
- %tmp.4.i9731 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i9730, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i9733 = load double* %tmp.5.i33146 ; <double> [#uses=1]
- store double %tmp.6.i9733, double* %tmp.4.i9731
- %tmp.7.i9734 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i9730, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i9736 = load double* %tmp.8.i33149 ; <double> [#uses=1]
- store double %tmp.9.i9736, double* %tmp.7.i9734
- %tmp.0.i9737 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i9730, %"struct.std::dcomplex"* %tmp.6 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i9739 = getelementptr %"struct.std::dcomplex"* %tmp.0.i9737, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i9740 = load double* %tmp.14.i9739 ; <double> [#uses=1]
- %tmp.17.i9742 = getelementptr %"struct.std::dcomplex"* %tmp.0.i9737, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i9743 = load double* %tmp.17.i9742 ; <double> [#uses=1]
- %tmp.4.i9717 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i9716, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i9719 = load double* %tmp.5.i34338 ; <double> [#uses=1]
- store double %tmp.6.i9719, double* %tmp.4.i9717
- %tmp.7.i9720 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i9716, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i9722 = load double* %tmp.8.i34341 ; <double> [#uses=1]
- store double %tmp.9.i9722, double* %tmp.7.i9720
- %tmp.0.i9723 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i9716, %"struct.std::dcomplex"* %tmp.226 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i9724 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1320, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i9725 = getelementptr %"struct.std::dcomplex"* %tmp.0.i9723, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i9726 = load double* %tmp.14.i9725 ; <double> [#uses=1]
- store double %tmp.15.i9726, double* %tmp.13.i9724
- %tmp.16.i9727 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1320, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i9728 = getelementptr %"struct.std::dcomplex"* %tmp.0.i9723, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i9729 = load double* %tmp.17.i9728 ; <double> [#uses=1]
- store double %tmp.18.i9729, double* %tmp.16.i9727
- %tmp.4.i9703 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i9702, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i9740, double* %tmp.4.i9703
- %tmp.7.i9706 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i9702, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i9743, double* %tmp.7.i9706
- %tmp.0.i9709 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i9702, %"struct.std::dcomplex"* %mem_tmp.1320 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i9711 = getelementptr %"struct.std::dcomplex"* %tmp.0.i9709, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i9712 = load double* %tmp.14.i9711 ; <double> [#uses=1]
- %tmp.17.i9714 = getelementptr %"struct.std::dcomplex"* %tmp.0.i9709, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i9715 = load double* %tmp.17.i9714 ; <double> [#uses=1]
- %tmp.4.i9689 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i9688, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i9712, double* %tmp.4.i9689
- %tmp.7.i9692 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i9688, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i9715, double* %tmp.7.i9692
- %tmp.0.i9695 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i9688, %"struct.std::dcomplex"* %tmp.15 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i9697 = getelementptr %"struct.std::dcomplex"* %tmp.0.i9695, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i9698 = load double* %tmp.14.i9697 ; <double> [#uses=1]
- %tmp.17.i9700 = getelementptr %"struct.std::dcomplex"* %tmp.0.i9695, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i9701 = load double* %tmp.17.i9700 ; <double> [#uses=1]
- %tmp.4.i9675 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i9674, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i9677 = load double* %tmp.5.i34338 ; <double> [#uses=1]
- store double %tmp.6.i9677, double* %tmp.4.i9675
- %tmp.7.i9678 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i9674, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i9680 = load double* %tmp.8.i34341 ; <double> [#uses=1]
- store double %tmp.9.i9680, double* %tmp.7.i9678
- %tmp.0.i9681 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i9674, %"struct.std::dcomplex"* %tmp.21 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i9683 = getelementptr %"struct.std::dcomplex"* %tmp.0.i9681, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i9684 = load double* %tmp.14.i9683 ; <double> [#uses=1]
- %tmp.17.i9686 = getelementptr %"struct.std::dcomplex"* %tmp.0.i9681, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i9687 = load double* %tmp.17.i9686 ; <double> [#uses=1]
- %tmp.4.i9661 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i9660, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i9663 = load double* %tmp.5.i34282 ; <double> [#uses=1]
- store double %tmp.6.i9663, double* %tmp.4.i9661
- %tmp.7.i9664 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i9660, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i9666 = load double* %tmp.8.i34285 ; <double> [#uses=1]
- store double %tmp.9.i9666, double* %tmp.7.i9664
- %tmp.0.i9667 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i9660, %"struct.std::dcomplex"* %tmp.6 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i9668 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1324, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i9669 = getelementptr %"struct.std::dcomplex"* %tmp.0.i9667, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i9670 = load double* %tmp.14.i9669 ; <double> [#uses=1]
- store double %tmp.15.i9670, double* %tmp.13.i9668
- %tmp.16.i9671 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1324, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i9672 = getelementptr %"struct.std::dcomplex"* %tmp.0.i9667, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i9673 = load double* %tmp.17.i9672 ; <double> [#uses=1]
- store double %tmp.18.i9673, double* %tmp.16.i9671
- %tmp.4.i9647 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i9646, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i9684, double* %tmp.4.i9647
- %tmp.7.i9650 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i9646, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i9687, double* %tmp.7.i9650
- %tmp.0.i9653 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i9646, %"struct.std::dcomplex"* %mem_tmp.1324 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i9655 = getelementptr %"struct.std::dcomplex"* %tmp.0.i9653, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i9656 = load double* %tmp.14.i9655 ; <double> [#uses=1]
- %tmp.17.i9658 = getelementptr %"struct.std::dcomplex"* %tmp.0.i9653, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i9659 = load double* %tmp.17.i9658 ; <double> [#uses=1]
- %tmp.4.i9633 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i9632, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i9656, double* %tmp.4.i9633
- %tmp.7.i9636 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i9632, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i9659, double* %tmp.7.i9636
- %tmp.0.i9639 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i9632, %"struct.std::dcomplex"* %tmp.220 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i9640 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1321, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i9641 = getelementptr %"struct.std::dcomplex"* %tmp.0.i9639, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i9642 = load double* %tmp.14.i9641 ; <double> [#uses=1]
- store double %tmp.15.i9642, double* %tmp.13.i9640
- %tmp.16.i9643 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1321, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i9644 = getelementptr %"struct.std::dcomplex"* %tmp.0.i9639, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i9645 = load double* %tmp.17.i9644 ; <double> [#uses=1]
- store double %tmp.18.i9645, double* %tmp.16.i9643
- %tmp.4.i9619 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i9618, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i9698, double* %tmp.4.i9619
- %tmp.7.i9622 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i9618, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i9701, double* %tmp.7.i9622
- %tmp.0.i9625 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i9618, %"struct.std::dcomplex"* %mem_tmp.1321 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i9627 = getelementptr %"struct.std::dcomplex"* %tmp.0.i9625, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i9628 = load double* %tmp.14.i9627 ; <double> [#uses=1]
- %tmp.17.i9630 = getelementptr %"struct.std::dcomplex"* %tmp.0.i9625, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i9631 = load double* %tmp.17.i9630 ; <double> [#uses=1]
- %tmp.4.i9605 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i9604, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i9607 = load double* %tmp.5.i34282 ; <double> [#uses=1]
- store double %tmp.6.i9607, double* %tmp.4.i9605
- %tmp.7.i9608 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i9604, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i9610 = load double* %tmp.8.i34285 ; <double> [#uses=1]
- store double %tmp.9.i9610, double* %tmp.7.i9608
- %tmp.0.i9611 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i9604, %"struct.std::dcomplex"* %tmp.226 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i9613 = getelementptr %"struct.std::dcomplex"* %tmp.0.i9611, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i9614 = load double* %tmp.14.i9613 ; <double> [#uses=1]
- %tmp.17.i9616 = getelementptr %"struct.std::dcomplex"* %tmp.0.i9611, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i9617 = load double* %tmp.17.i9616 ; <double> [#uses=1]
- %tmp.4.i9591 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i9590, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i9593 = load double* %tmp.5.i33146 ; <double> [#uses=1]
- store double %tmp.6.i9593, double* %tmp.4.i9591
- %tmp.7.i9594 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i9590, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i9596 = load double* %tmp.8.i33149 ; <double> [#uses=1]
- store double %tmp.9.i9596, double* %tmp.7.i9594
- %tmp.0.i9597 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i9590, %"struct.std::dcomplex"* %tmp.21 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i9598 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1328, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i9599 = getelementptr %"struct.std::dcomplex"* %tmp.0.i9597, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i9600 = load double* %tmp.14.i9599 ; <double> [#uses=1]
- store double %tmp.15.i9600, double* %tmp.13.i9598
- %tmp.16.i9601 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1328, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i9602 = getelementptr %"struct.std::dcomplex"* %tmp.0.i9597, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i9603 = load double* %tmp.17.i9602 ; <double> [#uses=1]
- store double %tmp.18.i9603, double* %tmp.16.i9601
- %tmp.4.i9577 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i9576, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i9614, double* %tmp.4.i9577
- %tmp.7.i9580 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i9576, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i9617, double* %tmp.7.i9580
- %tmp.0.i9583 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i9576, %"struct.std::dcomplex"* %mem_tmp.1328 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i9585 = getelementptr %"struct.std::dcomplex"* %tmp.0.i9583, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i9586 = load double* %tmp.14.i9585 ; <double> [#uses=1]
- %tmp.17.i9588 = getelementptr %"struct.std::dcomplex"* %tmp.0.i9583, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i9589 = load double* %tmp.17.i9588 ; <double> [#uses=1]
- %tmp.4.i9563 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i9562, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i9586, double* %tmp.4.i9563
- %tmp.7.i9566 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i9562, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i9589, double* %tmp.7.i9566
- %tmp.0.i9569 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i9562, %"struct.std::dcomplex"* %tmp.45 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i9570 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1325, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i9571 = getelementptr %"struct.std::dcomplex"* %tmp.0.i9569, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i9572 = load double* %tmp.14.i9571 ; <double> [#uses=1]
- store double %tmp.15.i9572, double* %tmp.13.i9570
- %tmp.16.i9573 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1325, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i9574 = getelementptr %"struct.std::dcomplex"* %tmp.0.i9569, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i9575 = load double* %tmp.17.i9574 ; <double> [#uses=1]
- store double %tmp.18.i9575, double* %tmp.16.i9573
- %tmp.4.i9549 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i9548, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i9628, double* %tmp.4.i9549
- %tmp.7.i9552 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i9548, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i9631, double* %tmp.7.i9552
- %tmp.0.i9555 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i9548, %"struct.std::dcomplex"* %mem_tmp.1325 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i9557 = getelementptr %"struct.std::dcomplex"* %tmp.0.i9555, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i9558 = load double* %tmp.14.i9557 ; <double> [#uses=1]
- %tmp.17.i9560 = getelementptr %"struct.std::dcomplex"* %tmp.0.i9555, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i9561 = load double* %tmp.17.i9560 ; <double> [#uses=1]
- store double %tmp.15.i9558, double* %tmp.2.i34364
- store double %tmp.18.i9561, double* %tmp.6.i34365
- %tmp.4.i9515 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i9514, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i9517 = load double* %tmp.5.i27590 ; <double> [#uses=1]
- store double %tmp.6.i9517, double* %tmp.4.i9515
- %tmp.7.i9518 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i9514, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i9520 = load double* %tmp.8.i27593 ; <double> [#uses=1]
- store double %tmp.9.i9520, double* %tmp.7.i9518
- %tmp.0.i9521 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i9514, %"struct.std::dcomplex"* %ret3 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i9523 = getelementptr %"struct.std::dcomplex"* %tmp.0.i9521, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i9524 = load double* %tmp.14.i9523 ; <double> [#uses=1]
- %tmp.17.i9526 = getelementptr %"struct.std::dcomplex"* %tmp.0.i9521, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i9527 = load double* %tmp.17.i9526 ; <double> [#uses=1]
- %tmp.7.i9481 = load double* %tmp.2.i34366 ; <double> [#uses=1]
- %tmp.15.i9495 = add double %tmp.7.i9481, %tmp.15.i9524 ; <double> [#uses=1]
- store double %tmp.15.i9495, double* %tmp.2.i34366
- %tmp.26.i9502 = load double* %tmp.6.i34367 ; <double> [#uses=1]
- %tmp.31.i9513 = add double %tmp.26.i9502, %tmp.18.i9527 ; <double> [#uses=1]
- store double %tmp.31.i9513, double* %tmp.6.i34367
- %tmp.4.i9461 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i9460, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i9463 = load double* %tmp.5.i33146 ; <double> [#uses=1]
- store double %tmp.6.i9463, double* %tmp.4.i9461
- %tmp.7.i9464 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i9460, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i9466 = load double* %tmp.8.i33149 ; <double> [#uses=1]
- store double %tmp.9.i9466, double* %tmp.7.i9464
- %tmp.0.i9467 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i9460, %"struct.std::dcomplex"* %tmp.21 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i9469 = getelementptr %"struct.std::dcomplex"* %tmp.0.i9467, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i9470 = load double* %tmp.14.i9469 ; <double> [#uses=1]
- %tmp.17.i9472 = getelementptr %"struct.std::dcomplex"* %tmp.0.i9467, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i9473 = load double* %tmp.17.i9472 ; <double> [#uses=1]
- %tmp.4.i9447 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i9446, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i9449 = load double* %tmp.5.i34282 ; <double> [#uses=1]
- store double %tmp.6.i9449, double* %tmp.4.i9447
- %tmp.7.i9450 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i9446, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i9452 = load double* %tmp.8.i34285 ; <double> [#uses=1]
- store double %tmp.9.i9452, double* %tmp.7.i9450
- %tmp.0.i9453 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i9446, %"struct.std::dcomplex"* %tmp.226 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i9454 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1335, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i9455 = getelementptr %"struct.std::dcomplex"* %tmp.0.i9453, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i9456 = load double* %tmp.14.i9455 ; <double> [#uses=1]
- store double %tmp.15.i9456, double* %tmp.13.i9454
- %tmp.16.i9457 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1335, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i9458 = getelementptr %"struct.std::dcomplex"* %tmp.0.i9453, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i9459 = load double* %tmp.17.i9458 ; <double> [#uses=1]
- store double %tmp.18.i9459, double* %tmp.16.i9457
- %tmp.4.i9433 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i9432, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i9470, double* %tmp.4.i9433
- %tmp.7.i9436 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i9432, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i9473, double* %tmp.7.i9436
- %tmp.0.i9439 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i9432, %"struct.std::dcomplex"* %mem_tmp.1335 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i9441 = getelementptr %"struct.std::dcomplex"* %tmp.0.i9439, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i9442 = load double* %tmp.14.i9441 ; <double> [#uses=1]
- %tmp.17.i9444 = getelementptr %"struct.std::dcomplex"* %tmp.0.i9439, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i9445 = load double* %tmp.17.i9444 ; <double> [#uses=1]
- %tmp.4.i9419 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i9418, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i9442, double* %tmp.4.i9419
- %tmp.7.i9422 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i9418, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i9445, double* %tmp.7.i9422
- %tmp.0.i9425 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i9418, %"struct.std::dcomplex"* %tmp.1075 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i9427 = getelementptr %"struct.std::dcomplex"* %tmp.0.i9425, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i9428 = load double* %tmp.14.i9427 ; <double> [#uses=1]
- %tmp.17.i9430 = getelementptr %"struct.std::dcomplex"* %tmp.0.i9425, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i9431 = load double* %tmp.17.i9430 ; <double> [#uses=1]
- %tmp.4.i9405 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i9404, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i9407 = load double* %tmp.5.i28602 ; <double> [#uses=1]
- store double %tmp.6.i9407, double* %tmp.4.i9405
- %tmp.7.i9408 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i9404, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i9410 = load double* %tmp.8.i28605 ; <double> [#uses=1]
- store double %tmp.9.i9410, double* %tmp.7.i9408
- %tmp.0.i9411 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i9404, %"struct.std::dcomplex"* %tmp.226 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i9413 = getelementptr %"struct.std::dcomplex"* %tmp.0.i9411, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i9414 = load double* %tmp.14.i9413 ; <double> [#uses=1]
- %tmp.17.i9416 = getelementptr %"struct.std::dcomplex"* %tmp.0.i9411, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i9417 = load double* %tmp.17.i9416 ; <double> [#uses=1]
- %tmp.4.i9391 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i9390, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i9393 = load double* %tmp.5.i33146 ; <double> [#uses=1]
- store double %tmp.6.i9393, double* %tmp.4.i9391
- %tmp.7.i9394 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i9390, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i9396 = load double* %tmp.8.i33149 ; <double> [#uses=1]
- store double %tmp.9.i9396, double* %tmp.7.i9394
- %tmp.0.i9397 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i9390, %"struct.std::dcomplex"* %tmp.1036 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i9398 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1339, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i9399 = getelementptr %"struct.std::dcomplex"* %tmp.0.i9397, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i9400 = load double* %tmp.14.i9399 ; <double> [#uses=1]
- store double %tmp.15.i9400, double* %tmp.13.i9398
- %tmp.16.i9401 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1339, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i9402 = getelementptr %"struct.std::dcomplex"* %tmp.0.i9397, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i9403 = load double* %tmp.17.i9402 ; <double> [#uses=1]
- store double %tmp.18.i9403, double* %tmp.16.i9401
- %tmp.4.i9377 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i9376, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i9414, double* %tmp.4.i9377
- %tmp.7.i9380 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i9376, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i9417, double* %tmp.7.i9380
- %tmp.0.i9383 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i9376, %"struct.std::dcomplex"* %mem_tmp.1339 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i9385 = getelementptr %"struct.std::dcomplex"* %tmp.0.i9383, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i9386 = load double* %tmp.14.i9385 ; <double> [#uses=1]
- %tmp.17.i9388 = getelementptr %"struct.std::dcomplex"* %tmp.0.i9383, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i9389 = load double* %tmp.17.i9388 ; <double> [#uses=1]
- %tmp.4.i9363 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i9362, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i9386, double* %tmp.4.i9363
- %tmp.7.i9366 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i9362, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i9389, double* %tmp.7.i9366
- %tmp.0.i9369 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i9362, %"struct.std::dcomplex"* %tmp.15 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i9370 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1336, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i9371 = getelementptr %"struct.std::dcomplex"* %tmp.0.i9369, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i9372 = load double* %tmp.14.i9371 ; <double> [#uses=1]
- store double %tmp.15.i9372, double* %tmp.13.i9370
- %tmp.16.i9373 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1336, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i9374 = getelementptr %"struct.std::dcomplex"* %tmp.0.i9369, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i9375 = load double* %tmp.17.i9374 ; <double> [#uses=1]
- store double %tmp.18.i9375, double* %tmp.16.i9373
- %tmp.4.i9349 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i9348, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i9428, double* %tmp.4.i9349
- %tmp.7.i9352 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i9348, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i9431, double* %tmp.7.i9352
- %tmp.0.i9355 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i9348, %"struct.std::dcomplex"* %mem_tmp.1336 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i9357 = getelementptr %"struct.std::dcomplex"* %tmp.0.i9355, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i9358 = load double* %tmp.14.i9357 ; <double> [#uses=1]
- %tmp.17.i9360 = getelementptr %"struct.std::dcomplex"* %tmp.0.i9355, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i9361 = load double* %tmp.17.i9360 ; <double> [#uses=1]
- %tmp.4.i9335 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i9334, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i9337 = load double* %tmp.5.i34282 ; <double> [#uses=1]
- store double %tmp.6.i9337, double* %tmp.4.i9335
- %tmp.7.i9338 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i9334, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i9340 = load double* %tmp.8.i34285 ; <double> [#uses=1]
- store double %tmp.9.i9340, double* %tmp.7.i9338
- %tmp.0.i9341 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i9334, %"struct.std::dcomplex"* %tmp.1036 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i9343 = getelementptr %"struct.std::dcomplex"* %tmp.0.i9341, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i9344 = load double* %tmp.14.i9343 ; <double> [#uses=1]
- %tmp.17.i9346 = getelementptr %"struct.std::dcomplex"* %tmp.0.i9341, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i9347 = load double* %tmp.17.i9346 ; <double> [#uses=1]
- %tmp.4.i9321 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i9320, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i9323 = load double* %tmp.5.i28602 ; <double> [#uses=1]
- store double %tmp.6.i9323, double* %tmp.4.i9321
- %tmp.7.i9324 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i9320, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i9326 = load double* %tmp.8.i28605 ; <double> [#uses=1]
- store double %tmp.9.i9326, double* %tmp.7.i9324
- %tmp.0.i9327 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i9320, %"struct.std::dcomplex"* %tmp.21 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i9328 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1343, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i9329 = getelementptr %"struct.std::dcomplex"* %tmp.0.i9327, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i9330 = load double* %tmp.14.i9329 ; <double> [#uses=1]
- store double %tmp.15.i9330, double* %tmp.13.i9328
- %tmp.16.i9331 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1343, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i9332 = getelementptr %"struct.std::dcomplex"* %tmp.0.i9327, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i9333 = load double* %tmp.17.i9332 ; <double> [#uses=1]
- store double %tmp.18.i9333, double* %tmp.16.i9331
- %tmp.4.i9307 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i9306, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i9344, double* %tmp.4.i9307
- %tmp.7.i9310 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i9306, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i9347, double* %tmp.7.i9310
- %tmp.0.i9313 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i9306, %"struct.std::dcomplex"* %mem_tmp.1343 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i9315 = getelementptr %"struct.std::dcomplex"* %tmp.0.i9313, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i9316 = load double* %tmp.14.i9315 ; <double> [#uses=1]
- %tmp.17.i9318 = getelementptr %"struct.std::dcomplex"* %tmp.0.i9313, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i9319 = load double* %tmp.17.i9318 ; <double> [#uses=1]
- %tmp.4.i9293 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i9292, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i9316, double* %tmp.4.i9293
- %tmp.7.i9296 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i9292, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i9319, double* %tmp.7.i9296
- %tmp.0.i9299 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i9292, %"struct.std::dcomplex"* %tmp.220 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i9300 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1340, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i9301 = getelementptr %"struct.std::dcomplex"* %tmp.0.i9299, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i9302 = load double* %tmp.14.i9301 ; <double> [#uses=1]
- store double %tmp.15.i9302, double* %tmp.13.i9300
- %tmp.16.i9303 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1340, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i9304 = getelementptr %"struct.std::dcomplex"* %tmp.0.i9299, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i9305 = load double* %tmp.17.i9304 ; <double> [#uses=1]
- store double %tmp.18.i9305, double* %tmp.16.i9303
- %tmp.4.i9279 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i9278, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i9358, double* %tmp.4.i9279
- %tmp.7.i9282 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i9278, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i9361, double* %tmp.7.i9282
- %tmp.0.i9285 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i9278, %"struct.std::dcomplex"* %mem_tmp.1340 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i9287 = getelementptr %"struct.std::dcomplex"* %tmp.0.i9285, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i9288 = load double* %tmp.14.i9287 ; <double> [#uses=1]
- %tmp.17.i9290 = getelementptr %"struct.std::dcomplex"* %tmp.0.i9285, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i9291 = load double* %tmp.17.i9290 ; <double> [#uses=1]
- store double %tmp.15.i9288, double* %tmp.2.i34364
- store double %tmp.18.i9291, double* %tmp.6.i34365
- %tmp.4.i9245 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i9244, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i9247 = load double* %tmp.5.i33596 ; <double> [#uses=1]
- store double %tmp.6.i9247, double* %tmp.4.i9245
- %tmp.7.i9248 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i9244, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i9250 = load double* %tmp.8.i33599 ; <double> [#uses=1]
- store double %tmp.9.i9250, double* %tmp.7.i9248
- %tmp.0.i9251 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i9244, %"struct.std::dcomplex"* %ret3 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i9253 = getelementptr %"struct.std::dcomplex"* %tmp.0.i9251, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i9254 = load double* %tmp.14.i9253 ; <double> [#uses=1]
- %tmp.17.i9256 = getelementptr %"struct.std::dcomplex"* %tmp.0.i9251, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i9257 = load double* %tmp.17.i9256 ; <double> [#uses=1]
- %tmp.7.i9211 = load double* %tmp.2.i34366 ; <double> [#uses=1]
- %tmp.15.i9225 = add double %tmp.7.i9211, %tmp.15.i9254 ; <double> [#uses=1]
- store double %tmp.15.i9225, double* %tmp.2.i34366
- %tmp.26.i9232 = load double* %tmp.6.i34367 ; <double> [#uses=1]
- %tmp.31.i9243 = add double %tmp.26.i9232, %tmp.18.i9257 ; <double> [#uses=1]
- store double %tmp.31.i9243, double* %tmp.6.i34367
- %tmp.4.i9191 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i9190, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i9193 = load double* %tmp.5.i32136 ; <double> [#uses=1]
- store double %tmp.6.i9193, double* %tmp.4.i9191
- %tmp.7.i9194 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i9190, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i9196 = load double* %tmp.8.i32139 ; <double> [#uses=1]
- store double %tmp.9.i9196, double* %tmp.7.i9194
- %tmp.0.i9197 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i9190, %"struct.std::dcomplex"* %ret4 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i9199 = getelementptr %"struct.std::dcomplex"* %tmp.0.i9197, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i9200 = load double* %tmp.14.i9199 ; <double> [#uses=1]
- %tmp.17.i9202 = getelementptr %"struct.std::dcomplex"* %tmp.0.i9197, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i9203 = load double* %tmp.17.i9202 ; <double> [#uses=1]
- %tmp.7.i9157 = load double* %tmp.2.i34368 ; <double> [#uses=1]
- %tmp.15.i9171 = add double %tmp.7.i9157, %tmp.15.i9200 ; <double> [#uses=1]
- store double %tmp.15.i9171, double* %tmp.2.i34368
- %tmp.26.i9178 = load double* %tmp.6.i34369 ; <double> [#uses=1]
- %tmp.31.i9189 = add double %tmp.26.i9178, %tmp.18.i9203 ; <double> [#uses=1]
- store double %tmp.31.i9189, double* %tmp.6.i34369
- store double 0.000000e+00, double* %tmp.2.i34366
- store double 0.000000e+00, double* %tmp.6.i34367
- %tmp.4.i9135 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i9134, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i9137 = load double* %tmp.5.i28602 ; <double> [#uses=1]
- store double %tmp.6.i9137, double* %tmp.4.i9135
- %tmp.7.i9138 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i9134, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i9140 = load double* %tmp.8.i28605 ; <double> [#uses=1]
- store double %tmp.9.i9140, double* %tmp.7.i9138
- %tmp.0.i9141 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i9134, %"struct.std::dcomplex"* %tmp.21 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i9143 = getelementptr %"struct.std::dcomplex"* %tmp.0.i9141, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i9144 = load double* %tmp.14.i9143 ; <double> [#uses=1]
- %tmp.17.i9146 = getelementptr %"struct.std::dcomplex"* %tmp.0.i9141, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i9147 = load double* %tmp.17.i9146 ; <double> [#uses=1]
- %tmp.4.i9121 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i9120, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i9123 = load double* %tmp.5.i34282 ; <double> [#uses=1]
- store double %tmp.6.i9123, double* %tmp.4.i9121
- %tmp.7.i9124 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i9120, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i9126 = load double* %tmp.8.i34285 ; <double> [#uses=1]
- store double %tmp.9.i9126, double* %tmp.7.i9124
- %tmp.0.i9127 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i9120, %"struct.std::dcomplex"* %tmp.1036 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i9128 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1351, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i9129 = getelementptr %"struct.std::dcomplex"* %tmp.0.i9127, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i9130 = load double* %tmp.14.i9129 ; <double> [#uses=1]
- store double %tmp.15.i9130, double* %tmp.13.i9128
- %tmp.16.i9131 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1351, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i9132 = getelementptr %"struct.std::dcomplex"* %tmp.0.i9127, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i9133 = load double* %tmp.17.i9132 ; <double> [#uses=1]
- store double %tmp.18.i9133, double* %tmp.16.i9131
- %tmp.4.i9107 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i9106, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i9144, double* %tmp.4.i9107
- %tmp.7.i9110 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i9106, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i9147, double* %tmp.7.i9110
- %tmp.0.i9113 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i9106, %"struct.std::dcomplex"* %mem_tmp.1351 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i9115 = getelementptr %"struct.std::dcomplex"* %tmp.0.i9113, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i9116 = load double* %tmp.14.i9115 ; <double> [#uses=1]
- %tmp.17.i9118 = getelementptr %"struct.std::dcomplex"* %tmp.0.i9113, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i9119 = load double* %tmp.17.i9118 ; <double> [#uses=1]
- %tmp.4.i9093 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i9092, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i9116, double* %tmp.4.i9093
- %tmp.7.i9096 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i9092, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i9119, double* %tmp.7.i9096
- %tmp.0.i9099 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i9092, %"struct.std::dcomplex"* %tmp.220 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i9101 = getelementptr %"struct.std::dcomplex"* %tmp.0.i9099, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i9102 = load double* %tmp.14.i9101 ; <double> [#uses=1]
- %tmp.17.i9104 = getelementptr %"struct.std::dcomplex"* %tmp.0.i9099, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i9105 = load double* %tmp.17.i9104 ; <double> [#uses=1]
- %tmp.4.i9079 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i9078, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i9081 = load double* %tmp.5.i34282 ; <double> [#uses=1]
- store double %tmp.6.i9081, double* %tmp.4.i9079
- %tmp.7.i9082 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i9078, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i9084 = load double* %tmp.8.i34285 ; <double> [#uses=1]
- store double %tmp.9.i9084, double* %tmp.7.i9082
- %tmp.0.i9085 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i9078, %"struct.std::dcomplex"* %tmp.226 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i9087 = getelementptr %"struct.std::dcomplex"* %tmp.0.i9085, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i9088 = load double* %tmp.14.i9087 ; <double> [#uses=1]
- %tmp.17.i9090 = getelementptr %"struct.std::dcomplex"* %tmp.0.i9085, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i9091 = load double* %tmp.17.i9090 ; <double> [#uses=1]
- %tmp.4.i9065 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i9064, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i9067 = load double* %tmp.5.i33146 ; <double> [#uses=1]
- store double %tmp.6.i9067, double* %tmp.4.i9065
- %tmp.7.i9068 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i9064, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i9070 = load double* %tmp.8.i33149 ; <double> [#uses=1]
- store double %tmp.9.i9070, double* %tmp.7.i9068
- %tmp.0.i9071 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i9064, %"struct.std::dcomplex"* %tmp.21 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i9072 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1355, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i9073 = getelementptr %"struct.std::dcomplex"* %tmp.0.i9071, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i9074 = load double* %tmp.14.i9073 ; <double> [#uses=1]
- store double %tmp.15.i9074, double* %tmp.13.i9072
- %tmp.16.i9075 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1355, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i9076 = getelementptr %"struct.std::dcomplex"* %tmp.0.i9071, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i9077 = load double* %tmp.17.i9076 ; <double> [#uses=1]
- store double %tmp.18.i9077, double* %tmp.16.i9075
- %tmp.4.i9051 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i9050, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i9088, double* %tmp.4.i9051
- %tmp.7.i9054 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i9050, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i9091, double* %tmp.7.i9054
- %tmp.0.i9057 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i9050, %"struct.std::dcomplex"* %mem_tmp.1355 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i9059 = getelementptr %"struct.std::dcomplex"* %tmp.0.i9057, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i9060 = load double* %tmp.14.i9059 ; <double> [#uses=1]
- %tmp.17.i9062 = getelementptr %"struct.std::dcomplex"* %tmp.0.i9057, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i9063 = load double* %tmp.17.i9062 ; <double> [#uses=1]
- %tmp.4.i9037 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i9036, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i9060, double* %tmp.4.i9037
- %tmp.7.i9040 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i9036, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i9063, double* %tmp.7.i9040
- %tmp.0.i9043 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i9036, %"struct.std::dcomplex"* %tmp.1075 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i9044 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1352, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i9045 = getelementptr %"struct.std::dcomplex"* %tmp.0.i9043, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i9046 = load double* %tmp.14.i9045 ; <double> [#uses=1]
- store double %tmp.15.i9046, double* %tmp.13.i9044
- %tmp.16.i9047 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1352, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i9048 = getelementptr %"struct.std::dcomplex"* %tmp.0.i9043, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i9049 = load double* %tmp.17.i9048 ; <double> [#uses=1]
- store double %tmp.18.i9049, double* %tmp.16.i9047
- %tmp.4.i9023 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i9022, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i9102, double* %tmp.4.i9023
- %tmp.7.i9026 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i9022, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i9105, double* %tmp.7.i9026
- %tmp.0.i9029 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i9022, %"struct.std::dcomplex"* %mem_tmp.1352 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i9031 = getelementptr %"struct.std::dcomplex"* %tmp.0.i9029, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i9032 = load double* %tmp.14.i9031 ; <double> [#uses=1]
- %tmp.17.i9034 = getelementptr %"struct.std::dcomplex"* %tmp.0.i9029, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i9035 = load double* %tmp.17.i9034 ; <double> [#uses=1]
- %tmp.4.i9009 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i9008, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i9011 = load double* %tmp.5.i33146 ; <double> [#uses=1]
- store double %tmp.6.i9011, double* %tmp.4.i9009
- %tmp.7.i9012 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i9008, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i9014 = load double* %tmp.8.i33149 ; <double> [#uses=1]
- store double %tmp.9.i9014, double* %tmp.7.i9012
- %tmp.0.i9015 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i9008, %"struct.std::dcomplex"* %tmp.1036 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i9017 = getelementptr %"struct.std::dcomplex"* %tmp.0.i9015, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i9018 = load double* %tmp.14.i9017 ; <double> [#uses=1]
- %tmp.17.i9020 = getelementptr %"struct.std::dcomplex"* %tmp.0.i9015, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i9021 = load double* %tmp.17.i9020 ; <double> [#uses=1]
- %tmp.4.i8995 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i8994, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i8997 = load double* %tmp.5.i28602 ; <double> [#uses=1]
- store double %tmp.6.i8997, double* %tmp.4.i8995
- %tmp.7.i8998 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i8994, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i9000 = load double* %tmp.8.i28605 ; <double> [#uses=1]
- store double %tmp.9.i9000, double* %tmp.7.i8998
- %tmp.0.i9001 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i8994, %"struct.std::dcomplex"* %tmp.226 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i9002 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1359, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i9003 = getelementptr %"struct.std::dcomplex"* %tmp.0.i9001, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i9004 = load double* %tmp.14.i9003 ; <double> [#uses=1]
- store double %tmp.15.i9004, double* %tmp.13.i9002
- %tmp.16.i9005 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1359, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i9006 = getelementptr %"struct.std::dcomplex"* %tmp.0.i9001, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i9007 = load double* %tmp.17.i9006 ; <double> [#uses=1]
- store double %tmp.18.i9007, double* %tmp.16.i9005
- %tmp.4.i8981 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i8980, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i9018, double* %tmp.4.i8981
- %tmp.7.i8984 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i8980, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i9021, double* %tmp.7.i8984
- %tmp.0.i8987 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i8980, %"struct.std::dcomplex"* %mem_tmp.1359 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i8989 = getelementptr %"struct.std::dcomplex"* %tmp.0.i8987, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i8990 = load double* %tmp.14.i8989 ; <double> [#uses=1]
- %tmp.17.i8992 = getelementptr %"struct.std::dcomplex"* %tmp.0.i8987, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i8993 = load double* %tmp.17.i8992 ; <double> [#uses=1]
- %tmp.4.i8967 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i8966, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i8990, double* %tmp.4.i8967
- %tmp.7.i8970 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i8966, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i8993, double* %tmp.7.i8970
- %tmp.0.i8973 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i8966, %"struct.std::dcomplex"* %tmp.15 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i8974 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1356, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i8975 = getelementptr %"struct.std::dcomplex"* %tmp.0.i8973, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i8976 = load double* %tmp.14.i8975 ; <double> [#uses=1]
- store double %tmp.15.i8976, double* %tmp.13.i8974
- %tmp.16.i8977 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1356, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i8978 = getelementptr %"struct.std::dcomplex"* %tmp.0.i8973, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i8979 = load double* %tmp.17.i8978 ; <double> [#uses=1]
- store double %tmp.18.i8979, double* %tmp.16.i8977
- %tmp.4.i8953 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i8952, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i9032, double* %tmp.4.i8953
- %tmp.7.i8956 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i8952, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i9035, double* %tmp.7.i8956
- %tmp.0.i8959 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i8952, %"struct.std::dcomplex"* %mem_tmp.1356 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i8961 = getelementptr %"struct.std::dcomplex"* %tmp.0.i8959, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i8962 = load double* %tmp.14.i8961 ; <double> [#uses=1]
- %tmp.17.i8964 = getelementptr %"struct.std::dcomplex"* %tmp.0.i8959, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i8965 = load double* %tmp.17.i8964 ; <double> [#uses=1]
- store double %tmp.15.i8962, double* %tmp.2.i34364
- store double %tmp.18.i8965, double* %tmp.6.i34365
- %tmp.4.i8919 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i8918, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i8921 = load double* %tmp.5.i33866 ; <double> [#uses=1]
- store double %tmp.6.i8921, double* %tmp.4.i8919
- %tmp.7.i8922 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i8918, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i8924 = load double* %tmp.8.i33869 ; <double> [#uses=1]
- store double %tmp.9.i8924, double* %tmp.7.i8922
- %tmp.0.i8925 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i8918, %"struct.std::dcomplex"* %ret3 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i8927 = getelementptr %"struct.std::dcomplex"* %tmp.0.i8925, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i8928 = load double* %tmp.14.i8927 ; <double> [#uses=1]
- %tmp.17.i8930 = getelementptr %"struct.std::dcomplex"* %tmp.0.i8925, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i8931 = load double* %tmp.17.i8930 ; <double> [#uses=1]
- %tmp.7.i8885 = load double* %tmp.2.i34366 ; <double> [#uses=1]
- %tmp.15.i8899 = add double %tmp.7.i8885, %tmp.15.i8928 ; <double> [#uses=1]
- store double %tmp.15.i8899, double* %tmp.2.i34366
- %tmp.26.i8906 = load double* %tmp.6.i34367 ; <double> [#uses=1]
- %tmp.31.i8917 = add double %tmp.26.i8906, %tmp.18.i8931 ; <double> [#uses=1]
- store double %tmp.31.i8917, double* %tmp.6.i34367
- %tmp.4.i8865 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i8864, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i8867 = load double* %tmp.5.i28602 ; <double> [#uses=1]
- store double %tmp.6.i8867, double* %tmp.4.i8865
- %tmp.7.i8868 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i8864, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i8870 = load double* %tmp.8.i28605 ; <double> [#uses=1]
- store double %tmp.9.i8870, double* %tmp.7.i8868
- %tmp.0.i8871 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i8864, %"struct.std::dcomplex"* %tmp.226 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i8873 = getelementptr %"struct.std::dcomplex"* %tmp.0.i8871, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i8874 = load double* %tmp.14.i8873 ; <double> [#uses=1]
- %tmp.17.i8876 = getelementptr %"struct.std::dcomplex"* %tmp.0.i8871, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i8877 = load double* %tmp.17.i8876 ; <double> [#uses=1]
- %tmp.4.i8851 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i8850, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i8853 = load double* %tmp.5.i33146 ; <double> [#uses=1]
- store double %tmp.6.i8853, double* %tmp.4.i8851
- %tmp.7.i8854 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i8850, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i8856 = load double* %tmp.8.i33149 ; <double> [#uses=1]
- store double %tmp.9.i8856, double* %tmp.7.i8854
- %tmp.0.i8857 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i8850, %"struct.std::dcomplex"* %tmp.1036 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i8858 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1366, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i8859 = getelementptr %"struct.std::dcomplex"* %tmp.0.i8857, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i8860 = load double* %tmp.14.i8859 ; <double> [#uses=1]
- store double %tmp.15.i8860, double* %tmp.13.i8858
- %tmp.16.i8861 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1366, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i8862 = getelementptr %"struct.std::dcomplex"* %tmp.0.i8857, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i8863 = load double* %tmp.17.i8862 ; <double> [#uses=1]
- store double %tmp.18.i8863, double* %tmp.16.i8861
- %tmp.4.i8837 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i8836, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i8874, double* %tmp.4.i8837
- %tmp.7.i8840 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i8836, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i8877, double* %tmp.7.i8840
- %tmp.0.i8843 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i8836, %"struct.std::dcomplex"* %mem_tmp.1366 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i8845 = getelementptr %"struct.std::dcomplex"* %tmp.0.i8843, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i8846 = load double* %tmp.14.i8845 ; <double> [#uses=1]
- %tmp.17.i8848 = getelementptr %"struct.std::dcomplex"* %tmp.0.i8843, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i8849 = load double* %tmp.17.i8848 ; <double> [#uses=1]
- %tmp.4.i8823 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i8822, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i8846, double* %tmp.4.i8823
- %tmp.7.i8826 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i8822, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i8849, double* %tmp.7.i8826
- %tmp.0.i8829 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i8822, %"struct.std::dcomplex"* %tmp.30 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i8831 = getelementptr %"struct.std::dcomplex"* %tmp.0.i8829, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i8832 = load double* %tmp.14.i8831 ; <double> [#uses=1]
- %tmp.17.i8834 = getelementptr %"struct.std::dcomplex"* %tmp.0.i8829, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i8835 = load double* %tmp.17.i8834 ; <double> [#uses=1]
- %tmp.4.i8809 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i8808, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i8811 = load double* %tmp.5.i34352 ; <double> [#uses=1]
- store double %tmp.6.i8811, double* %tmp.4.i8809
- %tmp.7.i8812 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i8808, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i8814 = load double* %tmp.8.i34355 ; <double> [#uses=1]
- store double %tmp.9.i8814, double* %tmp.7.i8812
- %tmp.0.i8815 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i8808, %"struct.std::dcomplex"* %tmp.1036 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i8817 = getelementptr %"struct.std::dcomplex"* %tmp.0.i8815, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i8818 = load double* %tmp.14.i8817 ; <double> [#uses=1]
- %tmp.17.i8820 = getelementptr %"struct.std::dcomplex"* %tmp.0.i8815, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i8821 = load double* %tmp.17.i8820 ; <double> [#uses=1]
- %tmp.4.i8795 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i8794, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i8797 = load double* %tmp.5.i28602 ; <double> [#uses=1]
- store double %tmp.6.i8797, double* %tmp.4.i8795
- %tmp.7.i8798 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i8794, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i8800 = load double* %tmp.8.i28605 ; <double> [#uses=1]
- store double %tmp.9.i8800, double* %tmp.7.i8798
- %tmp.0.i8801 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i8794, %"struct.std::dcomplex"* %tmp.12 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i8802 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1370, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i8803 = getelementptr %"struct.std::dcomplex"* %tmp.0.i8801, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i8804 = load double* %tmp.14.i8803 ; <double> [#uses=1]
- store double %tmp.15.i8804, double* %tmp.13.i8802
- %tmp.16.i8805 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1370, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i8806 = getelementptr %"struct.std::dcomplex"* %tmp.0.i8801, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i8807 = load double* %tmp.17.i8806 ; <double> [#uses=1]
- store double %tmp.18.i8807, double* %tmp.16.i8805
- %tmp.4.i8781 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i8780, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i8818, double* %tmp.4.i8781
- %tmp.7.i8784 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i8780, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i8821, double* %tmp.7.i8784
- %tmp.0.i8787 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i8780, %"struct.std::dcomplex"* %mem_tmp.1370 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i8789 = getelementptr %"struct.std::dcomplex"* %tmp.0.i8787, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i8790 = load double* %tmp.14.i8789 ; <double> [#uses=1]
- %tmp.17.i8792 = getelementptr %"struct.std::dcomplex"* %tmp.0.i8787, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i8793 = load double* %tmp.17.i8792 ; <double> [#uses=1]
- %tmp.4.i8767 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i8766, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i8790, double* %tmp.4.i8767
- %tmp.7.i8770 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i8766, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i8793, double* %tmp.7.i8770
- %tmp.0.i8773 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i8766, %"struct.std::dcomplex"* %tmp.220 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i8774 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1367, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i8775 = getelementptr %"struct.std::dcomplex"* %tmp.0.i8773, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i8776 = load double* %tmp.14.i8775 ; <double> [#uses=1]
- store double %tmp.15.i8776, double* %tmp.13.i8774
- %tmp.16.i8777 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1367, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i8778 = getelementptr %"struct.std::dcomplex"* %tmp.0.i8773, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i8779 = load double* %tmp.17.i8778 ; <double> [#uses=1]
- store double %tmp.18.i8779, double* %tmp.16.i8777
- %tmp.4.i8753 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i8752, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i8832, double* %tmp.4.i8753
- %tmp.7.i8756 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i8752, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i8835, double* %tmp.7.i8756
- %tmp.0.i8759 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i8752, %"struct.std::dcomplex"* %mem_tmp.1367 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i8761 = getelementptr %"struct.std::dcomplex"* %tmp.0.i8759, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i8762 = load double* %tmp.14.i8761 ; <double> [#uses=1]
- %tmp.17.i8764 = getelementptr %"struct.std::dcomplex"* %tmp.0.i8759, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i8765 = load double* %tmp.17.i8764 ; <double> [#uses=1]
- %tmp.4.i8739 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i8738, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i8741 = load double* %tmp.5.i33146 ; <double> [#uses=1]
- store double %tmp.6.i8741, double* %tmp.4.i8739
- %tmp.7.i8742 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i8738, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i8744 = load double* %tmp.8.i33149 ; <double> [#uses=1]
- store double %tmp.9.i8744, double* %tmp.7.i8742
- %tmp.0.i8745 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i8738, %"struct.std::dcomplex"* %tmp.12 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i8747 = getelementptr %"struct.std::dcomplex"* %tmp.0.i8745, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i8748 = load double* %tmp.14.i8747 ; <double> [#uses=1]
- %tmp.17.i8750 = getelementptr %"struct.std::dcomplex"* %tmp.0.i8745, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i8751 = load double* %tmp.17.i8750 ; <double> [#uses=1]
- %tmp.4.i8725 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i8724, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i8727 = load double* %tmp.5.i34352 ; <double> [#uses=1]
- store double %tmp.6.i8727, double* %tmp.4.i8725
- %tmp.7.i8728 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i8724, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i8730 = load double* %tmp.8.i34355 ; <double> [#uses=1]
- store double %tmp.9.i8730, double* %tmp.7.i8728
- %tmp.0.i8731 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i8724, %"struct.std::dcomplex"* %tmp.226 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i8732 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1374, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i8733 = getelementptr %"struct.std::dcomplex"* %tmp.0.i8731, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i8734 = load double* %tmp.14.i8733 ; <double> [#uses=1]
- store double %tmp.15.i8734, double* %tmp.13.i8732
- %tmp.16.i8735 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1374, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i8736 = getelementptr %"struct.std::dcomplex"* %tmp.0.i8731, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i8737 = load double* %tmp.17.i8736 ; <double> [#uses=1]
- store double %tmp.18.i8737, double* %tmp.16.i8735
- %tmp.4.i8711 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i8710, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i8748, double* %tmp.4.i8711
- %tmp.7.i8714 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i8710, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i8751, double* %tmp.7.i8714
- %tmp.0.i8717 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i8710, %"struct.std::dcomplex"* %mem_tmp.1374 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i8719 = getelementptr %"struct.std::dcomplex"* %tmp.0.i8717, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i8720 = load double* %tmp.14.i8719 ; <double> [#uses=1]
- %tmp.17.i8722 = getelementptr %"struct.std::dcomplex"* %tmp.0.i8717, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i8723 = load double* %tmp.17.i8722 ; <double> [#uses=1]
- %tmp.4.i8697 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i8696, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i8720, double* %tmp.4.i8697
- %tmp.7.i8700 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i8696, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i8723, double* %tmp.7.i8700
- %tmp.0.i8703 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i8696, %"struct.std::dcomplex"* %tmp.1075 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i8704 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1371, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i8705 = getelementptr %"struct.std::dcomplex"* %tmp.0.i8703, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i8706 = load double* %tmp.14.i8705 ; <double> [#uses=1]
- store double %tmp.15.i8706, double* %tmp.13.i8704
- %tmp.16.i8707 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1371, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i8708 = getelementptr %"struct.std::dcomplex"* %tmp.0.i8703, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i8709 = load double* %tmp.17.i8708 ; <double> [#uses=1]
- store double %tmp.18.i8709, double* %tmp.16.i8707
- %tmp.4.i8683 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i8682, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i8762, double* %tmp.4.i8683
- %tmp.7.i8686 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i8682, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i8765, double* %tmp.7.i8686
- %tmp.0.i8689 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i8682, %"struct.std::dcomplex"* %mem_tmp.1371 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i8691 = getelementptr %"struct.std::dcomplex"* %tmp.0.i8689, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i8692 = load double* %tmp.14.i8691 ; <double> [#uses=1]
- %tmp.17.i8694 = getelementptr %"struct.std::dcomplex"* %tmp.0.i8689, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i8695 = load double* %tmp.17.i8694 ; <double> [#uses=1]
- store double %tmp.15.i8692, double* %tmp.2.i34364
- store double %tmp.18.i8695, double* %tmp.6.i34365
- %tmp.4.i8649 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i8648, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i8651 = load double* %tmp.5.i33326 ; <double> [#uses=1]
- store double %tmp.6.i8651, double* %tmp.4.i8649
- %tmp.7.i8652 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i8648, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i8654 = load double* %tmp.8.i33329 ; <double> [#uses=1]
- store double %tmp.9.i8654, double* %tmp.7.i8652
- %tmp.0.i8655 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i8648, %"struct.std::dcomplex"* %ret3 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i8657 = getelementptr %"struct.std::dcomplex"* %tmp.0.i8655, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i8658 = load double* %tmp.14.i8657 ; <double> [#uses=1]
- %tmp.17.i8660 = getelementptr %"struct.std::dcomplex"* %tmp.0.i8655, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i8661 = load double* %tmp.17.i8660 ; <double> [#uses=1]
- %tmp.7.i8615 = load double* %tmp.2.i34366 ; <double> [#uses=1]
- %tmp.15.i8629 = add double %tmp.7.i8615, %tmp.15.i8658 ; <double> [#uses=1]
- store double %tmp.15.i8629, double* %tmp.2.i34366
- %tmp.26.i8636 = load double* %tmp.6.i34367 ; <double> [#uses=1]
- %tmp.31.i8647 = add double %tmp.26.i8636, %tmp.18.i8661 ; <double> [#uses=1]
- store double %tmp.31.i8647, double* %tmp.6.i34367
- %tmp.4.i8595 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i8594, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i8597 = load double* %tmp.5.i34352 ; <double> [#uses=1]
- store double %tmp.6.i8597, double* %tmp.4.i8595
- %tmp.7.i8598 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i8594, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i8600 = load double* %tmp.8.i34355 ; <double> [#uses=1]
- store double %tmp.9.i8600, double* %tmp.7.i8598
- %tmp.0.i8601 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i8594, %"struct.std::dcomplex"* %tmp.21 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i8603 = getelementptr %"struct.std::dcomplex"* %tmp.0.i8601, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i8604 = load double* %tmp.14.i8603 ; <double> [#uses=1]
- %tmp.17.i8606 = getelementptr %"struct.std::dcomplex"* %tmp.0.i8601, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i8607 = load double* %tmp.17.i8606 ; <double> [#uses=1]
- %tmp.4.i8581 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i8580, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i8583 = load double* %tmp.5.i34282 ; <double> [#uses=1]
- store double %tmp.6.i8583, double* %tmp.4.i8581
- %tmp.7.i8584 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i8580, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i8586 = load double* %tmp.8.i34285 ; <double> [#uses=1]
- store double %tmp.9.i8586, double* %tmp.7.i8584
- %tmp.0.i8587 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i8580, %"struct.std::dcomplex"* %tmp.12 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i8588 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1381, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i8589 = getelementptr %"struct.std::dcomplex"* %tmp.0.i8587, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i8590 = load double* %tmp.14.i8589 ; <double> [#uses=1]
- store double %tmp.15.i8590, double* %tmp.13.i8588
- %tmp.16.i8591 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1381, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i8592 = getelementptr %"struct.std::dcomplex"* %tmp.0.i8587, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i8593 = load double* %tmp.17.i8592 ; <double> [#uses=1]
- store double %tmp.18.i8593, double* %tmp.16.i8591
- %tmp.4.i8567 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i8566, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i8604, double* %tmp.4.i8567
- %tmp.7.i8570 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i8566, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i8607, double* %tmp.7.i8570
- %tmp.0.i8573 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i8566, %"struct.std::dcomplex"* %mem_tmp.1381 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i8575 = getelementptr %"struct.std::dcomplex"* %tmp.0.i8573, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i8576 = load double* %tmp.14.i8575 ; <double> [#uses=1]
- %tmp.17.i8578 = getelementptr %"struct.std::dcomplex"* %tmp.0.i8573, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i8579 = load double* %tmp.17.i8578 ; <double> [#uses=1]
- %tmp.4.i8553 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i8552, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i8576, double* %tmp.4.i8553
- %tmp.7.i8556 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i8552, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i8579, double* %tmp.7.i8556
- %tmp.0.i8559 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i8552, %"struct.std::dcomplex"* %tmp.1075 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i8561 = getelementptr %"struct.std::dcomplex"* %tmp.0.i8559, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i8562 = load double* %tmp.14.i8561 ; <double> [#uses=1]
- %tmp.17.i8564 = getelementptr %"struct.std::dcomplex"* %tmp.0.i8559, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i8565 = load double* %tmp.17.i8564 ; <double> [#uses=1]
- %tmp.4.i8539 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i8538, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i8541 = load double* %tmp.5.i34282 ; <double> [#uses=1]
- store double %tmp.6.i8541, double* %tmp.4.i8539
- %tmp.7.i8542 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i8538, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i8544 = load double* %tmp.8.i34285 ; <double> [#uses=1]
- store double %tmp.9.i8544, double* %tmp.7.i8542
- %tmp.0.i8545 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i8538, %"struct.std::dcomplex"* %tmp.1036 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i8547 = getelementptr %"struct.std::dcomplex"* %tmp.0.i8545, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i8548 = load double* %tmp.14.i8547 ; <double> [#uses=1]
- %tmp.17.i8550 = getelementptr %"struct.std::dcomplex"* %tmp.0.i8545, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i8551 = load double* %tmp.17.i8550 ; <double> [#uses=1]
- %tmp.4.i8525 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i8524, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i8527 = load double* %tmp.5.i28602 ; <double> [#uses=1]
- store double %tmp.6.i8527, double* %tmp.4.i8525
- %tmp.7.i8528 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i8524, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i8530 = load double* %tmp.8.i28605 ; <double> [#uses=1]
- store double %tmp.9.i8530, double* %tmp.7.i8528
- %tmp.0.i8531 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i8524, %"struct.std::dcomplex"* %tmp.21 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i8532 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1385, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i8533 = getelementptr %"struct.std::dcomplex"* %tmp.0.i8531, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i8534 = load double* %tmp.14.i8533 ; <double> [#uses=1]
- store double %tmp.15.i8534, double* %tmp.13.i8532
- %tmp.16.i8535 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1385, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i8536 = getelementptr %"struct.std::dcomplex"* %tmp.0.i8531, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i8537 = load double* %tmp.17.i8536 ; <double> [#uses=1]
- store double %tmp.18.i8537, double* %tmp.16.i8535
- %tmp.4.i8511 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i8510, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i8548, double* %tmp.4.i8511
- %tmp.7.i8514 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i8510, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i8551, double* %tmp.7.i8514
- %tmp.0.i8517 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i8510, %"struct.std::dcomplex"* %mem_tmp.1385 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i8519 = getelementptr %"struct.std::dcomplex"* %tmp.0.i8517, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i8520 = load double* %tmp.14.i8519 ; <double> [#uses=1]
- %tmp.17.i8522 = getelementptr %"struct.std::dcomplex"* %tmp.0.i8517, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i8523 = load double* %tmp.17.i8522 ; <double> [#uses=1]
- %tmp.4.i8497 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i8496, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i8520, double* %tmp.4.i8497
- %tmp.7.i8500 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i8496, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i8523, double* %tmp.7.i8500
- %tmp.0.i8503 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i8496, %"struct.std::dcomplex"* %tmp.30 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i8504 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1382, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i8505 = getelementptr %"struct.std::dcomplex"* %tmp.0.i8503, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i8506 = load double* %tmp.14.i8505 ; <double> [#uses=1]
- store double %tmp.15.i8506, double* %tmp.13.i8504
- %tmp.16.i8507 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1382, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i8508 = getelementptr %"struct.std::dcomplex"* %tmp.0.i8503, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i8509 = load double* %tmp.17.i8508 ; <double> [#uses=1]
- store double %tmp.18.i8509, double* %tmp.16.i8507
- %tmp.4.i8483 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i8482, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i8562, double* %tmp.4.i8483
- %tmp.7.i8486 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i8482, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i8565, double* %tmp.7.i8486
- %tmp.0.i8489 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i8482, %"struct.std::dcomplex"* %mem_tmp.1382 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i8491 = getelementptr %"struct.std::dcomplex"* %tmp.0.i8489, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i8492 = load double* %tmp.14.i8491 ; <double> [#uses=1]
- %tmp.17.i8494 = getelementptr %"struct.std::dcomplex"* %tmp.0.i8489, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i8495 = load double* %tmp.17.i8494 ; <double> [#uses=1]
- %tmp.4.i8469 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i8468, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i8471 = load double* %tmp.5.i28602 ; <double> [#uses=1]
- store double %tmp.6.i8471, double* %tmp.4.i8469
- %tmp.7.i8472 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i8468, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i8474 = load double* %tmp.8.i28605 ; <double> [#uses=1]
- store double %tmp.9.i8474, double* %tmp.7.i8472
- %tmp.0.i8475 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i8468, %"struct.std::dcomplex"* %tmp.12 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i8477 = getelementptr %"struct.std::dcomplex"* %tmp.0.i8475, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i8478 = load double* %tmp.14.i8477 ; <double> [#uses=1]
- %tmp.17.i8480 = getelementptr %"struct.std::dcomplex"* %tmp.0.i8475, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i8481 = load double* %tmp.17.i8480 ; <double> [#uses=1]
- %tmp.4.i8455 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i8454, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i8457 = load double* %tmp.5.i34352 ; <double> [#uses=1]
- store double %tmp.6.i8457, double* %tmp.4.i8455
- %tmp.7.i8458 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i8454, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i8460 = load double* %tmp.8.i34355 ; <double> [#uses=1]
- store double %tmp.9.i8460, double* %tmp.7.i8458
- %tmp.0.i8461 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i8454, %"struct.std::dcomplex"* %tmp.1036 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i8462 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1389, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i8463 = getelementptr %"struct.std::dcomplex"* %tmp.0.i8461, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i8464 = load double* %tmp.14.i8463 ; <double> [#uses=1]
- store double %tmp.15.i8464, double* %tmp.13.i8462
- %tmp.16.i8465 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1389, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i8466 = getelementptr %"struct.std::dcomplex"* %tmp.0.i8461, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i8467 = load double* %tmp.17.i8466 ; <double> [#uses=1]
- store double %tmp.18.i8467, double* %tmp.16.i8465
- %tmp.4.i8441 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i8440, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i8478, double* %tmp.4.i8441
- %tmp.7.i8444 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i8440, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i8481, double* %tmp.7.i8444
- %tmp.0.i8447 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i8440, %"struct.std::dcomplex"* %mem_tmp.1389 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i8449 = getelementptr %"struct.std::dcomplex"* %tmp.0.i8447, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i8450 = load double* %tmp.14.i8449 ; <double> [#uses=1]
- %tmp.17.i8452 = getelementptr %"struct.std::dcomplex"* %tmp.0.i8447, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i8453 = load double* %tmp.17.i8452 ; <double> [#uses=1]
- %tmp.4.i8427 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i8426, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i8450, double* %tmp.4.i8427
- %tmp.7.i8430 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i8426, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i8453, double* %tmp.7.i8430
- %tmp.0.i8433 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i8426, %"struct.std::dcomplex"* %tmp.15 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i8434 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1386, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i8435 = getelementptr %"struct.std::dcomplex"* %tmp.0.i8433, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i8436 = load double* %tmp.14.i8435 ; <double> [#uses=1]
- store double %tmp.15.i8436, double* %tmp.13.i8434
- %tmp.16.i8437 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1386, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i8438 = getelementptr %"struct.std::dcomplex"* %tmp.0.i8433, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i8439 = load double* %tmp.17.i8438 ; <double> [#uses=1]
- store double %tmp.18.i8439, double* %tmp.16.i8437
- %tmp.4.i8413 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i8412, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i8492, double* %tmp.4.i8413
- %tmp.7.i8416 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i8412, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i8495, double* %tmp.7.i8416
- %tmp.0.i8419 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i8412, %"struct.std::dcomplex"* %mem_tmp.1386 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i8421 = getelementptr %"struct.std::dcomplex"* %tmp.0.i8419, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i8422 = load double* %tmp.14.i8421 ; <double> [#uses=1]
- %tmp.17.i8424 = getelementptr %"struct.std::dcomplex"* %tmp.0.i8419, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i8425 = load double* %tmp.17.i8424 ; <double> [#uses=1]
- store double %tmp.15.i8422, double* %tmp.2.i34364
- store double %tmp.18.i8425, double* %tmp.6.i34365
- %tmp.4.i8379 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i8378, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i8381 = load double* %tmp.5.i32460 ; <double> [#uses=1]
- store double %tmp.6.i8381, double* %tmp.4.i8379
- %tmp.7.i8382 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i8378, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i8384 = load double* %tmp.8.i32463 ; <double> [#uses=1]
- store double %tmp.9.i8384, double* %tmp.7.i8382
- %tmp.0.i8385 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i8378, %"struct.std::dcomplex"* %ret3 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i8387 = getelementptr %"struct.std::dcomplex"* %tmp.0.i8385, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i8388 = load double* %tmp.14.i8387 ; <double> [#uses=1]
- %tmp.17.i8390 = getelementptr %"struct.std::dcomplex"* %tmp.0.i8385, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i8391 = load double* %tmp.17.i8390 ; <double> [#uses=1]
- %tmp.7.i8345 = load double* %tmp.2.i34366 ; <double> [#uses=1]
- %tmp.15.i8359 = add double %tmp.7.i8345, %tmp.15.i8388 ; <double> [#uses=1]
- store double %tmp.15.i8359, double* %tmp.2.i34366
- %tmp.26.i8366 = load double* %tmp.6.i34367 ; <double> [#uses=1]
- %tmp.31.i8377 = add double %tmp.26.i8366, %tmp.18.i8391 ; <double> [#uses=1]
- store double %tmp.31.i8377, double* %tmp.6.i34367
- %tmp.4.i8325 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i8324, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i8327 = load double* %tmp.5.i34352 ; <double> [#uses=1]
- store double %tmp.6.i8327, double* %tmp.4.i8325
- %tmp.7.i8328 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i8324, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i8330 = load double* %tmp.8.i34355 ; <double> [#uses=1]
- store double %tmp.9.i8330, double* %tmp.7.i8328
- %tmp.0.i8331 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i8324, %"struct.std::dcomplex"* %tmp.226 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i8333 = getelementptr %"struct.std::dcomplex"* %tmp.0.i8331, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i8334 = load double* %tmp.14.i8333 ; <double> [#uses=1]
- %tmp.17.i8336 = getelementptr %"struct.std::dcomplex"* %tmp.0.i8331, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i8337 = load double* %tmp.17.i8336 ; <double> [#uses=1]
- %tmp.4.i8311 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i8310, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i8313 = load double* %tmp.5.i33146 ; <double> [#uses=1]
- store double %tmp.6.i8313, double* %tmp.4.i8311
- %tmp.7.i8314 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i8310, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i8316 = load double* %tmp.8.i33149 ; <double> [#uses=1]
- store double %tmp.9.i8316, double* %tmp.7.i8314
- %tmp.0.i8317 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i8310, %"struct.std::dcomplex"* %tmp.12 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i8318 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1396, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i8319 = getelementptr %"struct.std::dcomplex"* %tmp.0.i8317, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i8320 = load double* %tmp.14.i8319 ; <double> [#uses=1]
- store double %tmp.15.i8320, double* %tmp.13.i8318
- %tmp.16.i8321 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1396, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i8322 = getelementptr %"struct.std::dcomplex"* %tmp.0.i8317, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i8323 = load double* %tmp.17.i8322 ; <double> [#uses=1]
- store double %tmp.18.i8323, double* %tmp.16.i8321
- %tmp.4.i8297 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i8296, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i8334, double* %tmp.4.i8297
- %tmp.7.i8300 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i8296, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i8337, double* %tmp.7.i8300
- %tmp.0.i8303 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i8296, %"struct.std::dcomplex"* %mem_tmp.1396 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i8305 = getelementptr %"struct.std::dcomplex"* %tmp.0.i8303, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i8306 = load double* %tmp.14.i8305 ; <double> [#uses=1]
- %tmp.17.i8308 = getelementptr %"struct.std::dcomplex"* %tmp.0.i8303, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i8309 = load double* %tmp.17.i8308 ; <double> [#uses=1]
- %tmp.4.i8283 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i8282, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i8306, double* %tmp.4.i8283
- %tmp.7.i8286 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i8282, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i8309, double* %tmp.7.i8286
- %tmp.0.i8289 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i8282, %"struct.std::dcomplex"* %tmp.15 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i8291 = getelementptr %"struct.std::dcomplex"* %tmp.0.i8289, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i8292 = load double* %tmp.14.i8291 ; <double> [#uses=1]
- %tmp.17.i8294 = getelementptr %"struct.std::dcomplex"* %tmp.0.i8289, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i8295 = load double* %tmp.17.i8294 ; <double> [#uses=1]
- %tmp.4.i8269 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i8268, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i8271 = load double* %tmp.5.i34282 ; <double> [#uses=1]
- store double %tmp.6.i8271, double* %tmp.4.i8269
- %tmp.7.i8272 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i8268, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i8274 = load double* %tmp.8.i34285 ; <double> [#uses=1]
- store double %tmp.9.i8274, double* %tmp.7.i8272
- %tmp.0.i8275 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i8268, %"struct.std::dcomplex"* %tmp.12 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i8277 = getelementptr %"struct.std::dcomplex"* %tmp.0.i8275, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i8278 = load double* %tmp.14.i8277 ; <double> [#uses=1]
- %tmp.17.i8280 = getelementptr %"struct.std::dcomplex"* %tmp.0.i8275, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i8281 = load double* %tmp.17.i8280 ; <double> [#uses=1]
- %tmp.4.i8255 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i8254, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i8257 = load double* %tmp.5.i34352 ; <double> [#uses=1]
- store double %tmp.6.i8257, double* %tmp.4.i8255
- %tmp.7.i8258 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i8254, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i8260 = load double* %tmp.8.i34355 ; <double> [#uses=1]
- store double %tmp.9.i8260, double* %tmp.7.i8258
- %tmp.0.i8261 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i8254, %"struct.std::dcomplex"* %tmp.21 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i8262 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1400, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i8263 = getelementptr %"struct.std::dcomplex"* %tmp.0.i8261, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i8264 = load double* %tmp.14.i8263 ; <double> [#uses=1]
- store double %tmp.15.i8264, double* %tmp.13.i8262
- %tmp.16.i8265 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1400, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i8266 = getelementptr %"struct.std::dcomplex"* %tmp.0.i8261, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i8267 = load double* %tmp.17.i8266 ; <double> [#uses=1]
- store double %tmp.18.i8267, double* %tmp.16.i8265
- %tmp.4.i8241 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i8240, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i8278, double* %tmp.4.i8241
- %tmp.7.i8244 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i8240, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i8281, double* %tmp.7.i8244
- %tmp.0.i8247 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i8240, %"struct.std::dcomplex"* %mem_tmp.1400 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i8249 = getelementptr %"struct.std::dcomplex"* %tmp.0.i8247, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i8250 = load double* %tmp.14.i8249 ; <double> [#uses=1]
- %tmp.17.i8252 = getelementptr %"struct.std::dcomplex"* %tmp.0.i8247, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i8253 = load double* %tmp.17.i8252 ; <double> [#uses=1]
- %tmp.4.i8227 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i8226, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i8250, double* %tmp.4.i8227
- %tmp.7.i8230 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i8226, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i8253, double* %tmp.7.i8230
- %tmp.0.i8233 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i8226, %"struct.std::dcomplex"* %tmp.220 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i8234 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1397, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i8235 = getelementptr %"struct.std::dcomplex"* %tmp.0.i8233, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i8236 = load double* %tmp.14.i8235 ; <double> [#uses=1]
- store double %tmp.15.i8236, double* %tmp.13.i8234
- %tmp.16.i8237 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1397, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i8238 = getelementptr %"struct.std::dcomplex"* %tmp.0.i8233, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i8239 = load double* %tmp.17.i8238 ; <double> [#uses=1]
- store double %tmp.18.i8239, double* %tmp.16.i8237
- %tmp.4.i8213 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i8212, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i8292, double* %tmp.4.i8213
- %tmp.7.i8216 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i8212, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i8295, double* %tmp.7.i8216
- %tmp.0.i8219 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i8212, %"struct.std::dcomplex"* %mem_tmp.1397 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i8221 = getelementptr %"struct.std::dcomplex"* %tmp.0.i8219, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i8222 = load double* %tmp.14.i8221 ; <double> [#uses=1]
- %tmp.17.i8224 = getelementptr %"struct.std::dcomplex"* %tmp.0.i8219, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i8225 = load double* %tmp.17.i8224 ; <double> [#uses=1]
- %tmp.4.i8199 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i8198, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i8201 = load double* %tmp.5.i33146 ; <double> [#uses=1]
- store double %tmp.6.i8201, double* %tmp.4.i8199
- %tmp.7.i8202 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i8198, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i8204 = load double* %tmp.8.i33149 ; <double> [#uses=1]
- store double %tmp.9.i8204, double* %tmp.7.i8202
- %tmp.0.i8205 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i8198, %"struct.std::dcomplex"* %tmp.21 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i8207 = getelementptr %"struct.std::dcomplex"* %tmp.0.i8205, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i8208 = load double* %tmp.14.i8207 ; <double> [#uses=1]
- %tmp.17.i8210 = getelementptr %"struct.std::dcomplex"* %tmp.0.i8205, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i8211 = load double* %tmp.17.i8210 ; <double> [#uses=1]
- %tmp.4.i8185 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i8184, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i8187 = load double* %tmp.5.i34282 ; <double> [#uses=1]
- store double %tmp.6.i8187, double* %tmp.4.i8185
- %tmp.7.i8188 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i8184, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i8190 = load double* %tmp.8.i34285 ; <double> [#uses=1]
- store double %tmp.9.i8190, double* %tmp.7.i8188
- %tmp.0.i8191 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i8184, %"struct.std::dcomplex"* %tmp.226 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i8192 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1404, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i8193 = getelementptr %"struct.std::dcomplex"* %tmp.0.i8191, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i8194 = load double* %tmp.14.i8193 ; <double> [#uses=1]
- store double %tmp.15.i8194, double* %tmp.13.i8192
- %tmp.16.i8195 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1404, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i8196 = getelementptr %"struct.std::dcomplex"* %tmp.0.i8191, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i8197 = load double* %tmp.17.i8196 ; <double> [#uses=1]
- store double %tmp.18.i8197, double* %tmp.16.i8195
- %tmp.4.i8171 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i8170, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i8208, double* %tmp.4.i8171
- %tmp.7.i8174 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i8170, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i8211, double* %tmp.7.i8174
- %tmp.0.i8177 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i8170, %"struct.std::dcomplex"* %mem_tmp.1404 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i8179 = getelementptr %"struct.std::dcomplex"* %tmp.0.i8177, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i8180 = load double* %tmp.14.i8179 ; <double> [#uses=1]
- %tmp.17.i8182 = getelementptr %"struct.std::dcomplex"* %tmp.0.i8177, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i8183 = load double* %tmp.17.i8182 ; <double> [#uses=1]
- %tmp.4.i8157 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i8156, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i8180, double* %tmp.4.i8157
- %tmp.7.i8160 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i8156, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i8183, double* %tmp.7.i8160
- %tmp.0.i8163 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i8156, %"struct.std::dcomplex"* %tmp.30 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i8164 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1401, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i8165 = getelementptr %"struct.std::dcomplex"* %tmp.0.i8163, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i8166 = load double* %tmp.14.i8165 ; <double> [#uses=1]
- store double %tmp.15.i8166, double* %tmp.13.i8164
- %tmp.16.i8167 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1401, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i8168 = getelementptr %"struct.std::dcomplex"* %tmp.0.i8163, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i8169 = load double* %tmp.17.i8168 ; <double> [#uses=1]
- store double %tmp.18.i8169, double* %tmp.16.i8167
- %tmp.4.i8143 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i8142, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i8222, double* %tmp.4.i8143
- %tmp.7.i8146 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i8142, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i8225, double* %tmp.7.i8146
- %tmp.0.i8149 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i8142, %"struct.std::dcomplex"* %mem_tmp.1401 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i8151 = getelementptr %"struct.std::dcomplex"* %tmp.0.i8149, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i8152 = load double* %tmp.14.i8151 ; <double> [#uses=1]
- %tmp.17.i8154 = getelementptr %"struct.std::dcomplex"* %tmp.0.i8149, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i8155 = load double* %tmp.17.i8154 ; <double> [#uses=1]
- store double %tmp.15.i8152, double* %tmp.2.i34364
- store double %tmp.18.i8155, double* %tmp.6.i34365
- %tmp.4.i8109 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i8108, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i8111 = load double* %tmp.5.i27590 ; <double> [#uses=1]
- store double %tmp.6.i8111, double* %tmp.4.i8109
- %tmp.7.i8112 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i8108, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i8114 = load double* %tmp.8.i27593 ; <double> [#uses=1]
- store double %tmp.9.i8114, double* %tmp.7.i8112
- %tmp.0.i8115 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i8108, %"struct.std::dcomplex"* %ret3 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i8117 = getelementptr %"struct.std::dcomplex"* %tmp.0.i8115, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i8118 = load double* %tmp.14.i8117 ; <double> [#uses=1]
- %tmp.17.i8120 = getelementptr %"struct.std::dcomplex"* %tmp.0.i8115, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i8121 = load double* %tmp.17.i8120 ; <double> [#uses=1]
- %tmp.7.i8075 = load double* %tmp.2.i34366 ; <double> [#uses=1]
- %tmp.15.i8089 = add double %tmp.7.i8075, %tmp.15.i8118 ; <double> [#uses=1]
- store double %tmp.15.i8089, double* %tmp.2.i34366
- %tmp.26.i8096 = load double* %tmp.6.i34367 ; <double> [#uses=1]
- %tmp.31.i8107 = add double %tmp.26.i8096, %tmp.18.i8121 ; <double> [#uses=1]
- store double %tmp.31.i8107, double* %tmp.6.i34367
- %tmp.4.i8055 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i8054, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i8057 = load double* %tmp.5.i31000 ; <double> [#uses=1]
- store double %tmp.6.i8057, double* %tmp.4.i8055
- %tmp.7.i8058 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i8054, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i8060 = load double* %tmp.8.i31003 ; <double> [#uses=1]
- store double %tmp.9.i8060, double* %tmp.7.i8058
- %tmp.0.i8061 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i8054, %"struct.std::dcomplex"* %ret4 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i8063 = getelementptr %"struct.std::dcomplex"* %tmp.0.i8061, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i8064 = load double* %tmp.14.i8063 ; <double> [#uses=1]
- %tmp.17.i8066 = getelementptr %"struct.std::dcomplex"* %tmp.0.i8061, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i8067 = load double* %tmp.17.i8066 ; <double> [#uses=1]
- %tmp.7.i8021 = load double* %tmp.2.i34368 ; <double> [#uses=1]
- %tmp.15.i8035 = add double %tmp.7.i8021, %tmp.15.i8064 ; <double> [#uses=1]
- store double %tmp.15.i8035, double* %tmp.2.i34368
- %tmp.26.i8042 = load double* %tmp.6.i34369 ; <double> [#uses=1]
- %tmp.31.i8053 = add double %tmp.26.i8042, %tmp.18.i8067 ; <double> [#uses=1]
- store double %tmp.31.i8053, double* %tmp.6.i34369
- store double 0.000000e+00, double* %tmp.2.i34366
- store double 0.000000e+00, double* %tmp.6.i34367
- %tmp.4.i7999 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i7998, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i8001 = load double* %tmp.5.i34338 ; <double> [#uses=1]
- store double %tmp.6.i8001, double* %tmp.4.i7999
- %tmp.7.i8002 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i7998, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i8004 = load double* %tmp.8.i34341 ; <double> [#uses=1]
- store double %tmp.9.i8004, double* %tmp.7.i8002
- %tmp.0.i8005 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i7998, %"struct.std::dcomplex"* %tmp.226 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i8007 = getelementptr %"struct.std::dcomplex"* %tmp.0.i8005, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i8008 = load double* %tmp.14.i8007 ; <double> [#uses=1]
- %tmp.17.i8010 = getelementptr %"struct.std::dcomplex"* %tmp.0.i8005, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i8011 = load double* %tmp.17.i8010 ; <double> [#uses=1]
- %tmp.4.i7985 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i7984, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i7987 = load double* %tmp.5.i33146 ; <double> [#uses=1]
- store double %tmp.6.i7987, double* %tmp.4.i7985
- %tmp.7.i7988 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i7984, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i7990 = load double* %tmp.8.i33149 ; <double> [#uses=1]
- store double %tmp.9.i7990, double* %tmp.7.i7988
- %tmp.0.i7991 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i7984, %"struct.std::dcomplex"* %tmp.6 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i7992 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1412, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i7993 = getelementptr %"struct.std::dcomplex"* %tmp.0.i7991, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i7994 = load double* %tmp.14.i7993 ; <double> [#uses=1]
- store double %tmp.15.i7994, double* %tmp.13.i7992
- %tmp.16.i7995 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1412, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i7996 = getelementptr %"struct.std::dcomplex"* %tmp.0.i7991, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i7997 = load double* %tmp.17.i7996 ; <double> [#uses=1]
- store double %tmp.18.i7997, double* %tmp.16.i7995
- %tmp.4.i7971 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i7970, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i8008, double* %tmp.4.i7971
- %tmp.7.i7974 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i7970, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i8011, double* %tmp.7.i7974
- %tmp.0.i7977 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i7970, %"struct.std::dcomplex"* %mem_tmp.1412 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i7979 = getelementptr %"struct.std::dcomplex"* %tmp.0.i7977, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i7980 = load double* %tmp.14.i7979 ; <double> [#uses=1]
- %tmp.17.i7982 = getelementptr %"struct.std::dcomplex"* %tmp.0.i7977, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i7983 = load double* %tmp.17.i7982 ; <double> [#uses=1]
- %tmp.4.i7957 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i7956, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i7980, double* %tmp.4.i7957
- %tmp.7.i7960 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i7956, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i7983, double* %tmp.7.i7960
- %tmp.0.i7963 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i7956, %"struct.std::dcomplex"* %tmp.30 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i7965 = getelementptr %"struct.std::dcomplex"* %tmp.0.i7963, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i7966 = load double* %tmp.14.i7965 ; <double> [#uses=1]
- %tmp.17.i7968 = getelementptr %"struct.std::dcomplex"* %tmp.0.i7963, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i7969 = load double* %tmp.17.i7968 ; <double> [#uses=1]
- %tmp.4.i7943 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i7942, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i7945 = load double* %tmp.5.i33146 ; <double> [#uses=1]
- store double %tmp.6.i7945, double* %tmp.4.i7943
- %tmp.7.i7946 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i7942, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i7948 = load double* %tmp.8.i33149 ; <double> [#uses=1]
- store double %tmp.9.i7948, double* %tmp.7.i7946
- %tmp.0.i7949 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i7942, %"struct.std::dcomplex"* %tmp.12 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i7951 = getelementptr %"struct.std::dcomplex"* %tmp.0.i7949, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i7952 = load double* %tmp.14.i7951 ; <double> [#uses=1]
- %tmp.17.i7954 = getelementptr %"struct.std::dcomplex"* %tmp.0.i7949, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i7955 = load double* %tmp.17.i7954 ; <double> [#uses=1]
- %tmp.4.i7929 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i7928, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i7931 = load double* %tmp.5.i34352 ; <double> [#uses=1]
- store double %tmp.6.i7931, double* %tmp.4.i7929
- %tmp.7.i7932 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i7928, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i7934 = load double* %tmp.8.i34355 ; <double> [#uses=1]
- store double %tmp.9.i7934, double* %tmp.7.i7932
- %tmp.0.i7935 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i7928, %"struct.std::dcomplex"* %tmp.226 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i7936 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1416, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i7937 = getelementptr %"struct.std::dcomplex"* %tmp.0.i7935, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i7938 = load double* %tmp.14.i7937 ; <double> [#uses=1]
- store double %tmp.15.i7938, double* %tmp.13.i7936
- %tmp.16.i7939 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1416, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i7940 = getelementptr %"struct.std::dcomplex"* %tmp.0.i7935, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i7941 = load double* %tmp.17.i7940 ; <double> [#uses=1]
- store double %tmp.18.i7941, double* %tmp.16.i7939
- %tmp.4.i7915 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i7914, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i7952, double* %tmp.4.i7915
- %tmp.7.i7918 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i7914, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i7955, double* %tmp.7.i7918
- %tmp.0.i7921 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i7914, %"struct.std::dcomplex"* %mem_tmp.1416 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i7923 = getelementptr %"struct.std::dcomplex"* %tmp.0.i7921, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i7924 = load double* %tmp.14.i7923 ; <double> [#uses=1]
- %tmp.17.i7926 = getelementptr %"struct.std::dcomplex"* %tmp.0.i7921, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i7927 = load double* %tmp.17.i7926 ; <double> [#uses=1]
- %tmp.4.i7901 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i7900, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i7924, double* %tmp.4.i7901
- %tmp.7.i7904 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i7900, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i7927, double* %tmp.7.i7904
- %tmp.0.i7907 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i7900, %"struct.std::dcomplex"* %tmp.45 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i7908 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1413, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i7909 = getelementptr %"struct.std::dcomplex"* %tmp.0.i7907, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i7910 = load double* %tmp.14.i7909 ; <double> [#uses=1]
- store double %tmp.15.i7910, double* %tmp.13.i7908
- %tmp.16.i7911 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1413, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i7912 = getelementptr %"struct.std::dcomplex"* %tmp.0.i7907, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i7913 = load double* %tmp.17.i7912 ; <double> [#uses=1]
- store double %tmp.18.i7913, double* %tmp.16.i7911
- %tmp.4.i7887 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i7886, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i7966, double* %tmp.4.i7887
- %tmp.7.i7890 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i7886, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i7969, double* %tmp.7.i7890
- %tmp.0.i7893 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i7886, %"struct.std::dcomplex"* %mem_tmp.1413 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i7895 = getelementptr %"struct.std::dcomplex"* %tmp.0.i7893, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i7896 = load double* %tmp.14.i7895 ; <double> [#uses=1]
- %tmp.17.i7898 = getelementptr %"struct.std::dcomplex"* %tmp.0.i7893, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i7899 = load double* %tmp.17.i7898 ; <double> [#uses=1]
- %tmp.4.i7873 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i7872, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i7875 = load double* %tmp.5.i34352 ; <double> [#uses=1]
- store double %tmp.6.i7875, double* %tmp.4.i7873
- %tmp.7.i7876 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i7872, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i7878 = load double* %tmp.8.i34355 ; <double> [#uses=1]
- store double %tmp.9.i7878, double* %tmp.7.i7876
- %tmp.0.i7879 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i7872, %"struct.std::dcomplex"* %tmp.6 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i7881 = getelementptr %"struct.std::dcomplex"* %tmp.0.i7879, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i7882 = load double* %tmp.14.i7881 ; <double> [#uses=1]
- %tmp.17.i7884 = getelementptr %"struct.std::dcomplex"* %tmp.0.i7879, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i7885 = load double* %tmp.17.i7884 ; <double> [#uses=1]
- %tmp.4.i7859 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i7858, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i7861 = load double* %tmp.5.i34338 ; <double> [#uses=1]
- store double %tmp.6.i7861, double* %tmp.4.i7859
- %tmp.7.i7862 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i7858, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i7864 = load double* %tmp.8.i34341 ; <double> [#uses=1]
- store double %tmp.9.i7864, double* %tmp.7.i7862
- %tmp.0.i7865 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i7858, %"struct.std::dcomplex"* %tmp.12 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i7866 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1420, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i7867 = getelementptr %"struct.std::dcomplex"* %tmp.0.i7865, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i7868 = load double* %tmp.14.i7867 ; <double> [#uses=1]
- store double %tmp.15.i7868, double* %tmp.13.i7866
- %tmp.16.i7869 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1420, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i7870 = getelementptr %"struct.std::dcomplex"* %tmp.0.i7865, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i7871 = load double* %tmp.17.i7870 ; <double> [#uses=1]
- store double %tmp.18.i7871, double* %tmp.16.i7869
- %tmp.4.i7845 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i7844, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i7882, double* %tmp.4.i7845
- %tmp.7.i7848 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i7844, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i7885, double* %tmp.7.i7848
- %tmp.0.i7851 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i7844, %"struct.std::dcomplex"* %mem_tmp.1420 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i7853 = getelementptr %"struct.std::dcomplex"* %tmp.0.i7851, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i7854 = load double* %tmp.14.i7853 ; <double> [#uses=1]
- %tmp.17.i7856 = getelementptr %"struct.std::dcomplex"* %tmp.0.i7851, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i7857 = load double* %tmp.17.i7856 ; <double> [#uses=1]
- %tmp.4.i7831 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i7830, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i7854, double* %tmp.4.i7831
- %tmp.7.i7834 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i7830, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i7857, double* %tmp.7.i7834
- %tmp.0.i7837 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i7830, %"struct.std::dcomplex"* %tmp.220 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i7838 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1417, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i7839 = getelementptr %"struct.std::dcomplex"* %tmp.0.i7837, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i7840 = load double* %tmp.14.i7839 ; <double> [#uses=1]
- store double %tmp.15.i7840, double* %tmp.13.i7838
- %tmp.16.i7841 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1417, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i7842 = getelementptr %"struct.std::dcomplex"* %tmp.0.i7837, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i7843 = load double* %tmp.17.i7842 ; <double> [#uses=1]
- store double %tmp.18.i7843, double* %tmp.16.i7841
- %tmp.4.i7817 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i7816, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i7896, double* %tmp.4.i7817
- %tmp.7.i7820 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i7816, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i7899, double* %tmp.7.i7820
- %tmp.0.i7823 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i7816, %"struct.std::dcomplex"* %mem_tmp.1417 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i7825 = getelementptr %"struct.std::dcomplex"* %tmp.0.i7823, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i7826 = load double* %tmp.14.i7825 ; <double> [#uses=1]
- %tmp.17.i7828 = getelementptr %"struct.std::dcomplex"* %tmp.0.i7823, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i7829 = load double* %tmp.17.i7828 ; <double> [#uses=1]
- store double %tmp.15.i7826, double* %tmp.2.i34364
- store double %tmp.18.i7829, double* %tmp.6.i34365
- %tmp.4.i7783 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i7782, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i7785 = load double* %tmp.5.i27590 ; <double> [#uses=1]
- store double %tmp.6.i7785, double* %tmp.4.i7783
- %tmp.7.i7786 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i7782, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i7788 = load double* %tmp.8.i27593 ; <double> [#uses=1]
- store double %tmp.9.i7788, double* %tmp.7.i7786
- %tmp.0.i7789 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i7782, %"struct.std::dcomplex"* %ret3 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i7791 = getelementptr %"struct.std::dcomplex"* %tmp.0.i7789, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i7792 = load double* %tmp.14.i7791 ; <double> [#uses=1]
- %tmp.17.i7794 = getelementptr %"struct.std::dcomplex"* %tmp.0.i7789, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i7795 = load double* %tmp.17.i7794 ; <double> [#uses=1]
- %tmp.7.i7749 = load double* %tmp.2.i34366 ; <double> [#uses=1]
- %tmp.15.i7763 = add double %tmp.7.i7749, %tmp.15.i7792 ; <double> [#uses=1]
- store double %tmp.15.i7763, double* %tmp.2.i34366
- %tmp.26.i7770 = load double* %tmp.6.i34367 ; <double> [#uses=1]
- %tmp.31.i7781 = add double %tmp.26.i7770, %tmp.18.i7795 ; <double> [#uses=1]
- store double %tmp.31.i7781, double* %tmp.6.i34367
- %tmp.4.i7729 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i7728, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i7731 = load double* %tmp.5.i34338 ; <double> [#uses=1]
- store double %tmp.6.i7731, double* %tmp.4.i7729
- %tmp.7.i7732 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i7728, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i7734 = load double* %tmp.8.i34341 ; <double> [#uses=1]
- store double %tmp.9.i7734, double* %tmp.7.i7732
- %tmp.0.i7735 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i7728, %"struct.std::dcomplex"* %tmp.1036 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i7737 = getelementptr %"struct.std::dcomplex"* %tmp.0.i7735, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i7738 = load double* %tmp.14.i7737 ; <double> [#uses=1]
- %tmp.17.i7740 = getelementptr %"struct.std::dcomplex"* %tmp.0.i7735, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i7741 = load double* %tmp.17.i7740 ; <double> [#uses=1]
- %tmp.4.i7715 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i7714, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i7717 = load double* %tmp.5.i28602 ; <double> [#uses=1]
- store double %tmp.6.i7717, double* %tmp.4.i7715
- %tmp.7.i7718 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i7714, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i7720 = load double* %tmp.8.i28605 ; <double> [#uses=1]
- store double %tmp.9.i7720, double* %tmp.7.i7718
- %tmp.0.i7721 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i7714, %"struct.std::dcomplex"* %tmp.6 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i7722 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1427, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i7723 = getelementptr %"struct.std::dcomplex"* %tmp.0.i7721, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i7724 = load double* %tmp.14.i7723 ; <double> [#uses=1]
- store double %tmp.15.i7724, double* %tmp.13.i7722
- %tmp.16.i7725 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1427, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i7726 = getelementptr %"struct.std::dcomplex"* %tmp.0.i7721, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i7727 = load double* %tmp.17.i7726 ; <double> [#uses=1]
- store double %tmp.18.i7727, double* %tmp.16.i7725
- %tmp.4.i7701 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i7700, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i7738, double* %tmp.4.i7701
- %tmp.7.i7704 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i7700, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i7741, double* %tmp.7.i7704
- %tmp.0.i7707 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i7700, %"struct.std::dcomplex"* %mem_tmp.1427 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i7709 = getelementptr %"struct.std::dcomplex"* %tmp.0.i7707, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i7710 = load double* %tmp.14.i7709 ; <double> [#uses=1]
- %tmp.17.i7712 = getelementptr %"struct.std::dcomplex"* %tmp.0.i7707, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i7713 = load double* %tmp.17.i7712 ; <double> [#uses=1]
- %tmp.4.i7687 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i7686, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i7710, double* %tmp.4.i7687
- %tmp.7.i7690 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i7686, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i7713, double* %tmp.7.i7690
- %tmp.0.i7693 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i7686, %"struct.std::dcomplex"* %tmp.220 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i7695 = getelementptr %"struct.std::dcomplex"* %tmp.0.i7693, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i7696 = load double* %tmp.14.i7695 ; <double> [#uses=1]
- %tmp.17.i7698 = getelementptr %"struct.std::dcomplex"* %tmp.0.i7693, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i7699 = load double* %tmp.17.i7698 ; <double> [#uses=1]
- %tmp.4.i7673 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i7672, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i7675 = load double* %tmp.5.i33146 ; <double> [#uses=1]
- store double %tmp.6.i7675, double* %tmp.4.i7673
- %tmp.7.i7676 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i7672, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i7678 = load double* %tmp.8.i33149 ; <double> [#uses=1]
- store double %tmp.9.i7678, double* %tmp.7.i7676
- %tmp.0.i7679 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i7672, %"struct.std::dcomplex"* %tmp.6 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i7681 = getelementptr %"struct.std::dcomplex"* %tmp.0.i7679, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i7682 = load double* %tmp.14.i7681 ; <double> [#uses=1]
- %tmp.17.i7684 = getelementptr %"struct.std::dcomplex"* %tmp.0.i7679, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i7685 = load double* %tmp.17.i7684 ; <double> [#uses=1]
- %tmp.4.i7659 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i7658, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i7661 = load double* %tmp.5.i34338 ; <double> [#uses=1]
- store double %tmp.6.i7661, double* %tmp.4.i7659
- %tmp.7.i7662 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i7658, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i7664 = load double* %tmp.8.i34341 ; <double> [#uses=1]
- store double %tmp.9.i7664, double* %tmp.7.i7662
- %tmp.0.i7665 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i7658, %"struct.std::dcomplex"* %tmp.226 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i7666 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1431, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i7667 = getelementptr %"struct.std::dcomplex"* %tmp.0.i7665, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i7668 = load double* %tmp.14.i7667 ; <double> [#uses=1]
- store double %tmp.15.i7668, double* %tmp.13.i7666
- %tmp.16.i7669 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1431, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i7670 = getelementptr %"struct.std::dcomplex"* %tmp.0.i7665, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i7671 = load double* %tmp.17.i7670 ; <double> [#uses=1]
- store double %tmp.18.i7671, double* %tmp.16.i7669
- %tmp.4.i7645 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i7644, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i7682, double* %tmp.4.i7645
- %tmp.7.i7648 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i7644, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i7685, double* %tmp.7.i7648
- %tmp.0.i7651 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i7644, %"struct.std::dcomplex"* %mem_tmp.1431 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i7653 = getelementptr %"struct.std::dcomplex"* %tmp.0.i7651, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i7654 = load double* %tmp.14.i7653 ; <double> [#uses=1]
- %tmp.17.i7656 = getelementptr %"struct.std::dcomplex"* %tmp.0.i7651, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i7657 = load double* %tmp.17.i7656 ; <double> [#uses=1]
- %tmp.4.i7631 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i7630, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i7654, double* %tmp.4.i7631
- %tmp.7.i7634 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i7630, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i7657, double* %tmp.7.i7634
- %tmp.0.i7637 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i7630, %"struct.std::dcomplex"* %tmp.1075 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i7638 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1428, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i7639 = getelementptr %"struct.std::dcomplex"* %tmp.0.i7637, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i7640 = load double* %tmp.14.i7639 ; <double> [#uses=1]
- store double %tmp.15.i7640, double* %tmp.13.i7638
- %tmp.16.i7641 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1428, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i7642 = getelementptr %"struct.std::dcomplex"* %tmp.0.i7637, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i7643 = load double* %tmp.17.i7642 ; <double> [#uses=1]
- store double %tmp.18.i7643, double* %tmp.16.i7641
- %tmp.4.i7617 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i7616, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i7696, double* %tmp.4.i7617
- %tmp.7.i7620 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i7616, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i7699, double* %tmp.7.i7620
- %tmp.0.i7623 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i7616, %"struct.std::dcomplex"* %mem_tmp.1428 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i7625 = getelementptr %"struct.std::dcomplex"* %tmp.0.i7623, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i7626 = load double* %tmp.14.i7625 ; <double> [#uses=1]
- %tmp.17.i7628 = getelementptr %"struct.std::dcomplex"* %tmp.0.i7623, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i7629 = load double* %tmp.17.i7628 ; <double> [#uses=1]
- %tmp.4.i7603 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i7602, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i7605 = load double* %tmp.5.i28602 ; <double> [#uses=1]
- store double %tmp.6.i7605, double* %tmp.4.i7603
- %tmp.7.i7606 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i7602, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i7608 = load double* %tmp.8.i28605 ; <double> [#uses=1]
- store double %tmp.9.i7608, double* %tmp.7.i7606
- %tmp.0.i7609 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i7602, %"struct.std::dcomplex"* %tmp.226 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i7611 = getelementptr %"struct.std::dcomplex"* %tmp.0.i7609, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i7612 = load double* %tmp.14.i7611 ; <double> [#uses=1]
- %tmp.17.i7614 = getelementptr %"struct.std::dcomplex"* %tmp.0.i7609, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i7615 = load double* %tmp.17.i7614 ; <double> [#uses=1]
- %tmp.4.i7589 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i7588, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i7591 = load double* %tmp.5.i33146 ; <double> [#uses=1]
- store double %tmp.6.i7591, double* %tmp.4.i7589
- %tmp.7.i7592 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i7588, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i7594 = load double* %tmp.8.i33149 ; <double> [#uses=1]
- store double %tmp.9.i7594, double* %tmp.7.i7592
- %tmp.0.i7595 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i7588, %"struct.std::dcomplex"* %tmp.1036 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i7596 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1435, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i7597 = getelementptr %"struct.std::dcomplex"* %tmp.0.i7595, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i7598 = load double* %tmp.14.i7597 ; <double> [#uses=1]
- store double %tmp.15.i7598, double* %tmp.13.i7596
- %tmp.16.i7599 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1435, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i7600 = getelementptr %"struct.std::dcomplex"* %tmp.0.i7595, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i7601 = load double* %tmp.17.i7600 ; <double> [#uses=1]
- store double %tmp.18.i7601, double* %tmp.16.i7599
- %tmp.4.i7575 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i7574, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i7612, double* %tmp.4.i7575
- %tmp.7.i7578 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i7574, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i7615, double* %tmp.7.i7578
- %tmp.0.i7581 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i7574, %"struct.std::dcomplex"* %mem_tmp.1435 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i7583 = getelementptr %"struct.std::dcomplex"* %tmp.0.i7581, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i7584 = load double* %tmp.14.i7583 ; <double> [#uses=1]
- %tmp.17.i7586 = getelementptr %"struct.std::dcomplex"* %tmp.0.i7581, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i7587 = load double* %tmp.17.i7586 ; <double> [#uses=1]
- %tmp.4.i7561 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i7560, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i7584, double* %tmp.4.i7561
- %tmp.7.i7564 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i7560, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i7587, double* %tmp.7.i7564
- %tmp.0.i7567 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i7560, %"struct.std::dcomplex"* %tmp.45 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i7568 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1432, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i7569 = getelementptr %"struct.std::dcomplex"* %tmp.0.i7567, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i7570 = load double* %tmp.14.i7569 ; <double> [#uses=1]
- store double %tmp.15.i7570, double* %tmp.13.i7568
- %tmp.16.i7571 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1432, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i7572 = getelementptr %"struct.std::dcomplex"* %tmp.0.i7567, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i7573 = load double* %tmp.17.i7572 ; <double> [#uses=1]
- store double %tmp.18.i7573, double* %tmp.16.i7571
- %tmp.4.i7547 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i7546, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i7626, double* %tmp.4.i7547
- %tmp.7.i7550 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i7546, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i7629, double* %tmp.7.i7550
- %tmp.0.i7553 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i7546, %"struct.std::dcomplex"* %mem_tmp.1432 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i7555 = getelementptr %"struct.std::dcomplex"* %tmp.0.i7553, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i7556 = load double* %tmp.14.i7555 ; <double> [#uses=1]
- %tmp.17.i7558 = getelementptr %"struct.std::dcomplex"* %tmp.0.i7553, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i7559 = load double* %tmp.17.i7558 ; <double> [#uses=1]
- store double %tmp.15.i7556, double* %tmp.2.i34364
- store double %tmp.18.i7559, double* %tmp.6.i34365
- %tmp.4.i7513 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i7512, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i7515 = load double* %tmp.5.i33866 ; <double> [#uses=1]
- store double %tmp.6.i7515, double* %tmp.4.i7513
- %tmp.7.i7516 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i7512, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i7518 = load double* %tmp.8.i33869 ; <double> [#uses=1]
- store double %tmp.9.i7518, double* %tmp.7.i7516
- %tmp.0.i7519 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i7512, %"struct.std::dcomplex"* %ret3 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i7521 = getelementptr %"struct.std::dcomplex"* %tmp.0.i7519, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i7522 = load double* %tmp.14.i7521 ; <double> [#uses=1]
- %tmp.17.i7524 = getelementptr %"struct.std::dcomplex"* %tmp.0.i7519, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i7525 = load double* %tmp.17.i7524 ; <double> [#uses=1]
- %tmp.7.i7479 = load double* %tmp.2.i34366 ; <double> [#uses=1]
- %tmp.15.i7493 = add double %tmp.7.i7479, %tmp.15.i7522 ; <double> [#uses=1]
- store double %tmp.15.i7493, double* %tmp.2.i34366
- %tmp.26.i7500 = load double* %tmp.6.i34367 ; <double> [#uses=1]
- %tmp.31.i7511 = add double %tmp.26.i7500, %tmp.18.i7525 ; <double> [#uses=1]
- store double %tmp.31.i7511, double* %tmp.6.i34367
- %tmp.4.i7459 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i7458, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i7461 = load double* %tmp.5.i33146 ; <double> [#uses=1]
- store double %tmp.6.i7461, double* %tmp.4.i7459
- %tmp.7.i7462 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i7458, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i7464 = load double* %tmp.8.i33149 ; <double> [#uses=1]
- store double %tmp.9.i7464, double* %tmp.7.i7462
- %tmp.0.i7465 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i7458, %"struct.std::dcomplex"* %tmp.1036 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i7467 = getelementptr %"struct.std::dcomplex"* %tmp.0.i7465, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i7468 = load double* %tmp.14.i7467 ; <double> [#uses=1]
- %tmp.17.i7470 = getelementptr %"struct.std::dcomplex"* %tmp.0.i7465, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i7471 = load double* %tmp.17.i7470 ; <double> [#uses=1]
- %tmp.4.i7445 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i7444, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i7447 = load double* %tmp.5.i28602 ; <double> [#uses=1]
- store double %tmp.6.i7447, double* %tmp.4.i7445
- %tmp.7.i7448 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i7444, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i7450 = load double* %tmp.8.i28605 ; <double> [#uses=1]
- store double %tmp.9.i7450, double* %tmp.7.i7448
- %tmp.0.i7451 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i7444, %"struct.std::dcomplex"* %tmp.226 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i7452 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1442, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i7453 = getelementptr %"struct.std::dcomplex"* %tmp.0.i7451, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i7454 = load double* %tmp.14.i7453 ; <double> [#uses=1]
- store double %tmp.15.i7454, double* %tmp.13.i7452
- %tmp.16.i7455 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1442, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i7456 = getelementptr %"struct.std::dcomplex"* %tmp.0.i7451, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i7457 = load double* %tmp.17.i7456 ; <double> [#uses=1]
- store double %tmp.18.i7457, double* %tmp.16.i7455
- %tmp.4.i7431 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i7430, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i7468, double* %tmp.4.i7431
- %tmp.7.i7434 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i7430, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i7471, double* %tmp.7.i7434
- %tmp.0.i7437 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i7430, %"struct.std::dcomplex"* %mem_tmp.1442 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i7439 = getelementptr %"struct.std::dcomplex"* %tmp.0.i7437, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i7440 = load double* %tmp.14.i7439 ; <double> [#uses=1]
- %tmp.17.i7442 = getelementptr %"struct.std::dcomplex"* %tmp.0.i7437, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i7443 = load double* %tmp.17.i7442 ; <double> [#uses=1]
- %tmp.4.i7417 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i7416, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i7440, double* %tmp.4.i7417
- %tmp.7.i7420 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i7416, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i7443, double* %tmp.7.i7420
- %tmp.0.i7423 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i7416, %"struct.std::dcomplex"* %tmp.30 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i7425 = getelementptr %"struct.std::dcomplex"* %tmp.0.i7423, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i7426 = load double* %tmp.14.i7425 ; <double> [#uses=1]
- %tmp.17.i7428 = getelementptr %"struct.std::dcomplex"* %tmp.0.i7423, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i7429 = load double* %tmp.17.i7428 ; <double> [#uses=1]
- %tmp.4.i7403 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i7402, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i7405 = load double* %tmp.5.i28602 ; <double> [#uses=1]
- store double %tmp.6.i7405, double* %tmp.4.i7403
- %tmp.7.i7406 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i7402, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i7408 = load double* %tmp.8.i28605 ; <double> [#uses=1]
- store double %tmp.9.i7408, double* %tmp.7.i7406
- %tmp.0.i7409 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i7402, %"struct.std::dcomplex"* %tmp.12 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i7411 = getelementptr %"struct.std::dcomplex"* %tmp.0.i7409, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i7412 = load double* %tmp.14.i7411 ; <double> [#uses=1]
- %tmp.17.i7414 = getelementptr %"struct.std::dcomplex"* %tmp.0.i7409, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i7415 = load double* %tmp.17.i7414 ; <double> [#uses=1]
- %tmp.4.i7389 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i7388, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i7391 = load double* %tmp.5.i34352 ; <double> [#uses=1]
- store double %tmp.6.i7391, double* %tmp.4.i7389
- %tmp.7.i7392 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i7388, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i7394 = load double* %tmp.8.i34355 ; <double> [#uses=1]
- store double %tmp.9.i7394, double* %tmp.7.i7392
- %tmp.0.i7395 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i7388, %"struct.std::dcomplex"* %tmp.1036 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i7396 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1446, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i7397 = getelementptr %"struct.std::dcomplex"* %tmp.0.i7395, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i7398 = load double* %tmp.14.i7397 ; <double> [#uses=1]
- store double %tmp.15.i7398, double* %tmp.13.i7396
- %tmp.16.i7399 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1446, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i7400 = getelementptr %"struct.std::dcomplex"* %tmp.0.i7395, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i7401 = load double* %tmp.17.i7400 ; <double> [#uses=1]
- store double %tmp.18.i7401, double* %tmp.16.i7399
- %tmp.4.i7375 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i7374, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i7412, double* %tmp.4.i7375
- %tmp.7.i7378 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i7374, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i7415, double* %tmp.7.i7378
- %tmp.0.i7381 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i7374, %"struct.std::dcomplex"* %mem_tmp.1446 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i7383 = getelementptr %"struct.std::dcomplex"* %tmp.0.i7381, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i7384 = load double* %tmp.14.i7383 ; <double> [#uses=1]
- %tmp.17.i7386 = getelementptr %"struct.std::dcomplex"* %tmp.0.i7381, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i7387 = load double* %tmp.17.i7386 ; <double> [#uses=1]
- %tmp.4.i7361 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i7360, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i7384, double* %tmp.4.i7361
- %tmp.7.i7364 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i7360, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i7387, double* %tmp.7.i7364
- %tmp.0.i7367 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i7360, %"struct.std::dcomplex"* %tmp.220 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i7368 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1443, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i7369 = getelementptr %"struct.std::dcomplex"* %tmp.0.i7367, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i7370 = load double* %tmp.14.i7369 ; <double> [#uses=1]
- store double %tmp.15.i7370, double* %tmp.13.i7368
- %tmp.16.i7371 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1443, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i7372 = getelementptr %"struct.std::dcomplex"* %tmp.0.i7367, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i7373 = load double* %tmp.17.i7372 ; <double> [#uses=1]
- store double %tmp.18.i7373, double* %tmp.16.i7371
- %tmp.4.i7347 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i7346, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i7426, double* %tmp.4.i7347
- %tmp.7.i7350 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i7346, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i7429, double* %tmp.7.i7350
- %tmp.0.i7353 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i7346, %"struct.std::dcomplex"* %mem_tmp.1443 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i7355 = getelementptr %"struct.std::dcomplex"* %tmp.0.i7353, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i7356 = load double* %tmp.14.i7355 ; <double> [#uses=1]
- %tmp.17.i7358 = getelementptr %"struct.std::dcomplex"* %tmp.0.i7353, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i7359 = load double* %tmp.17.i7358 ; <double> [#uses=1]
- %tmp.4.i7333 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i7332, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i7335 = load double* %tmp.5.i34352 ; <double> [#uses=1]
- store double %tmp.6.i7335, double* %tmp.4.i7333
- %tmp.7.i7336 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i7332, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i7338 = load double* %tmp.8.i34355 ; <double> [#uses=1]
- store double %tmp.9.i7338, double* %tmp.7.i7336
- %tmp.0.i7339 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i7332, %"struct.std::dcomplex"* %tmp.226 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i7341 = getelementptr %"struct.std::dcomplex"* %tmp.0.i7339, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i7342 = load double* %tmp.14.i7341 ; <double> [#uses=1]
- %tmp.17.i7344 = getelementptr %"struct.std::dcomplex"* %tmp.0.i7339, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i7345 = load double* %tmp.17.i7344 ; <double> [#uses=1]
- %tmp.4.i7319 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i7318, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i7321 = load double* %tmp.5.i33146 ; <double> [#uses=1]
- store double %tmp.6.i7321, double* %tmp.4.i7319
- %tmp.7.i7322 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i7318, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i7324 = load double* %tmp.8.i33149 ; <double> [#uses=1]
- store double %tmp.9.i7324, double* %tmp.7.i7322
- %tmp.0.i7325 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i7318, %"struct.std::dcomplex"* %tmp.12 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i7326 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1450, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i7327 = getelementptr %"struct.std::dcomplex"* %tmp.0.i7325, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i7328 = load double* %tmp.14.i7327 ; <double> [#uses=1]
- store double %tmp.15.i7328, double* %tmp.13.i7326
- %tmp.16.i7329 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1450, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i7330 = getelementptr %"struct.std::dcomplex"* %tmp.0.i7325, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i7331 = load double* %tmp.17.i7330 ; <double> [#uses=1]
- store double %tmp.18.i7331, double* %tmp.16.i7329
- %tmp.4.i7305 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i7304, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i7342, double* %tmp.4.i7305
- %tmp.7.i7308 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i7304, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i7345, double* %tmp.7.i7308
- %tmp.0.i7311 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i7304, %"struct.std::dcomplex"* %mem_tmp.1450 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i7313 = getelementptr %"struct.std::dcomplex"* %tmp.0.i7311, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i7314 = load double* %tmp.14.i7313 ; <double> [#uses=1]
- %tmp.17.i7316 = getelementptr %"struct.std::dcomplex"* %tmp.0.i7311, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i7317 = load double* %tmp.17.i7316 ; <double> [#uses=1]
- %tmp.4.i7291 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i7290, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i7314, double* %tmp.4.i7291
- %tmp.7.i7294 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i7290, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i7317, double* %tmp.7.i7294
- %tmp.0.i7297 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i7290, %"struct.std::dcomplex"* %tmp.1075 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i7298 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1447, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i7299 = getelementptr %"struct.std::dcomplex"* %tmp.0.i7297, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i7300 = load double* %tmp.14.i7299 ; <double> [#uses=1]
- store double %tmp.15.i7300, double* %tmp.13.i7298
- %tmp.16.i7301 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1447, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i7302 = getelementptr %"struct.std::dcomplex"* %tmp.0.i7297, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i7303 = load double* %tmp.17.i7302 ; <double> [#uses=1]
- store double %tmp.18.i7303, double* %tmp.16.i7301
- %tmp.4.i7277 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i7276, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i7356, double* %tmp.4.i7277
- %tmp.7.i7280 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i7276, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i7359, double* %tmp.7.i7280
- %tmp.0.i7283 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i7276, %"struct.std::dcomplex"* %mem_tmp.1447 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i7285 = getelementptr %"struct.std::dcomplex"* %tmp.0.i7283, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i7286 = load double* %tmp.14.i7285 ; <double> [#uses=1]
- %tmp.17.i7288 = getelementptr %"struct.std::dcomplex"* %tmp.0.i7283, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i7289 = load double* %tmp.17.i7288 ; <double> [#uses=1]
- store double %tmp.15.i7286, double* %tmp.2.i34364
- store double %tmp.18.i7289, double* %tmp.6.i34365
- %tmp.4.i7243 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i7242, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i7245 = load double* %tmp.5.i33596 ; <double> [#uses=1]
- store double %tmp.6.i7245, double* %tmp.4.i7243
- %tmp.7.i7246 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i7242, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i7248 = load double* %tmp.8.i33599 ; <double> [#uses=1]
- store double %tmp.9.i7248, double* %tmp.7.i7246
- %tmp.0.i7249 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i7242, %"struct.std::dcomplex"* %ret3 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i7251 = getelementptr %"struct.std::dcomplex"* %tmp.0.i7249, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i7252 = load double* %tmp.14.i7251 ; <double> [#uses=1]
- %tmp.17.i7254 = getelementptr %"struct.std::dcomplex"* %tmp.0.i7249, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i7255 = load double* %tmp.17.i7254 ; <double> [#uses=1]
- %tmp.7.i7209 = load double* %tmp.2.i34366 ; <double> [#uses=1]
- %tmp.15.i7223 = add double %tmp.7.i7209, %tmp.15.i7252 ; <double> [#uses=1]
- store double %tmp.15.i7223, double* %tmp.2.i34366
- %tmp.26.i7230 = load double* %tmp.6.i34367 ; <double> [#uses=1]
- %tmp.31.i7241 = add double %tmp.26.i7230, %tmp.18.i7255 ; <double> [#uses=1]
- store double %tmp.31.i7241, double* %tmp.6.i34367
- %tmp.4.i7189 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i7188, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i7191 = load double* %tmp.5.i34338 ; <double> [#uses=1]
- store double %tmp.6.i7191, double* %tmp.4.i7189
- %tmp.7.i7192 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i7188, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i7194 = load double* %tmp.8.i34341 ; <double> [#uses=1]
- store double %tmp.9.i7194, double* %tmp.7.i7192
- %tmp.0.i7195 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i7188, %"struct.std::dcomplex"* %tmp.12 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i7197 = getelementptr %"struct.std::dcomplex"* %tmp.0.i7195, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i7198 = load double* %tmp.14.i7197 ; <double> [#uses=1]
- %tmp.17.i7200 = getelementptr %"struct.std::dcomplex"* %tmp.0.i7195, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i7201 = load double* %tmp.17.i7200 ; <double> [#uses=1]
- %tmp.4.i7175 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i7174, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i7177 = load double* %tmp.5.i34352 ; <double> [#uses=1]
- store double %tmp.6.i7177, double* %tmp.4.i7175
- %tmp.7.i7178 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i7174, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i7180 = load double* %tmp.8.i34355 ; <double> [#uses=1]
- store double %tmp.9.i7180, double* %tmp.7.i7178
- %tmp.0.i7181 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i7174, %"struct.std::dcomplex"* %tmp.6 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i7182 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1457, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i7183 = getelementptr %"struct.std::dcomplex"* %tmp.0.i7181, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i7184 = load double* %tmp.14.i7183 ; <double> [#uses=1]
- store double %tmp.15.i7184, double* %tmp.13.i7182
- %tmp.16.i7185 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1457, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i7186 = getelementptr %"struct.std::dcomplex"* %tmp.0.i7181, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i7187 = load double* %tmp.17.i7186 ; <double> [#uses=1]
- store double %tmp.18.i7187, double* %tmp.16.i7185
- %tmp.4.i7161 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i7160, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i7198, double* %tmp.4.i7161
- %tmp.7.i7164 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i7160, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i7201, double* %tmp.7.i7164
- %tmp.0.i7167 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i7160, %"struct.std::dcomplex"* %mem_tmp.1457 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i7169 = getelementptr %"struct.std::dcomplex"* %tmp.0.i7167, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i7170 = load double* %tmp.14.i7169 ; <double> [#uses=1]
- %tmp.17.i7172 = getelementptr %"struct.std::dcomplex"* %tmp.0.i7167, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i7173 = load double* %tmp.17.i7172 ; <double> [#uses=1]
- %tmp.4.i7147 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i7146, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i7170, double* %tmp.4.i7147
- %tmp.7.i7150 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i7146, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i7173, double* %tmp.7.i7150
- %tmp.0.i7153 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i7146, %"struct.std::dcomplex"* %tmp.1075 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i7155 = getelementptr %"struct.std::dcomplex"* %tmp.0.i7153, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i7156 = load double* %tmp.14.i7155 ; <double> [#uses=1]
- %tmp.17.i7158 = getelementptr %"struct.std::dcomplex"* %tmp.0.i7153, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i7159 = load double* %tmp.17.i7158 ; <double> [#uses=1]
- %tmp.4.i7133 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i7132, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i7135 = load double* %tmp.5.i28602 ; <double> [#uses=1]
- store double %tmp.6.i7135, double* %tmp.4.i7133
- %tmp.7.i7136 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i7132, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i7138 = load double* %tmp.8.i28605 ; <double> [#uses=1]
- store double %tmp.9.i7138, double* %tmp.7.i7136
- %tmp.0.i7139 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i7132, %"struct.std::dcomplex"* %tmp.6 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i7141 = getelementptr %"struct.std::dcomplex"* %tmp.0.i7139, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i7142 = load double* %tmp.14.i7141 ; <double> [#uses=1]
- %tmp.17.i7144 = getelementptr %"struct.std::dcomplex"* %tmp.0.i7139, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i7145 = load double* %tmp.17.i7144 ; <double> [#uses=1]
- %tmp.4.i7119 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i7118, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i7121 = load double* %tmp.5.i34338 ; <double> [#uses=1]
- store double %tmp.6.i7121, double* %tmp.4.i7119
- %tmp.7.i7122 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i7118, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i7124 = load double* %tmp.8.i34341 ; <double> [#uses=1]
- store double %tmp.9.i7124, double* %tmp.7.i7122
- %tmp.0.i7125 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i7118, %"struct.std::dcomplex"* %tmp.1036 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i7126 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1461, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i7127 = getelementptr %"struct.std::dcomplex"* %tmp.0.i7125, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i7128 = load double* %tmp.14.i7127 ; <double> [#uses=1]
- store double %tmp.15.i7128, double* %tmp.13.i7126
- %tmp.16.i7129 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1461, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i7130 = getelementptr %"struct.std::dcomplex"* %tmp.0.i7125, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i7131 = load double* %tmp.17.i7130 ; <double> [#uses=1]
- store double %tmp.18.i7131, double* %tmp.16.i7129
- %tmp.4.i7105 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i7104, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i7142, double* %tmp.4.i7105
- %tmp.7.i7108 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i7104, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i7145, double* %tmp.7.i7108
- %tmp.0.i7111 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i7104, %"struct.std::dcomplex"* %mem_tmp.1461 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i7113 = getelementptr %"struct.std::dcomplex"* %tmp.0.i7111, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i7114 = load double* %tmp.14.i7113 ; <double> [#uses=1]
- %tmp.17.i7116 = getelementptr %"struct.std::dcomplex"* %tmp.0.i7111, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i7117 = load double* %tmp.17.i7116 ; <double> [#uses=1]
- %tmp.4.i7091 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i7090, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i7114, double* %tmp.4.i7091
- %tmp.7.i7094 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i7090, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i7117, double* %tmp.7.i7094
- %tmp.0.i7097 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i7090, %"struct.std::dcomplex"* %tmp.30 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i7098 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1458, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i7099 = getelementptr %"struct.std::dcomplex"* %tmp.0.i7097, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i7100 = load double* %tmp.14.i7099 ; <double> [#uses=1]
- store double %tmp.15.i7100, double* %tmp.13.i7098
- %tmp.16.i7101 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1458, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i7102 = getelementptr %"struct.std::dcomplex"* %tmp.0.i7097, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i7103 = load double* %tmp.17.i7102 ; <double> [#uses=1]
- store double %tmp.18.i7103, double* %tmp.16.i7101
- %tmp.4.i7077 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i7076, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i7156, double* %tmp.4.i7077
- %tmp.7.i7080 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i7076, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i7159, double* %tmp.7.i7080
- %tmp.0.i7083 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i7076, %"struct.std::dcomplex"* %mem_tmp.1458 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i7085 = getelementptr %"struct.std::dcomplex"* %tmp.0.i7083, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i7086 = load double* %tmp.14.i7085 ; <double> [#uses=1]
- %tmp.17.i7088 = getelementptr %"struct.std::dcomplex"* %tmp.0.i7083, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i7089 = load double* %tmp.17.i7088 ; <double> [#uses=1]
- %tmp.4.i7063 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i7062, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i7065 = load double* %tmp.5.i34352 ; <double> [#uses=1]
- store double %tmp.6.i7065, double* %tmp.4.i7063
- %tmp.7.i7066 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i7062, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i7068 = load double* %tmp.8.i34355 ; <double> [#uses=1]
- store double %tmp.9.i7068, double* %tmp.7.i7066
- %tmp.0.i7069 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i7062, %"struct.std::dcomplex"* %tmp.1036 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i7071 = getelementptr %"struct.std::dcomplex"* %tmp.0.i7069, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i7072 = load double* %tmp.14.i7071 ; <double> [#uses=1]
- %tmp.17.i7074 = getelementptr %"struct.std::dcomplex"* %tmp.0.i7069, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i7075 = load double* %tmp.17.i7074 ; <double> [#uses=1]
- %tmp.4.i7049 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i7048, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i7051 = load double* %tmp.5.i28602 ; <double> [#uses=1]
- store double %tmp.6.i7051, double* %tmp.4.i7049
- %tmp.7.i7052 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i7048, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i7054 = load double* %tmp.8.i28605 ; <double> [#uses=1]
- store double %tmp.9.i7054, double* %tmp.7.i7052
- %tmp.0.i7055 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i7048, %"struct.std::dcomplex"* %tmp.12 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i7056 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1465, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i7057 = getelementptr %"struct.std::dcomplex"* %tmp.0.i7055, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i7058 = load double* %tmp.14.i7057 ; <double> [#uses=1]
- store double %tmp.15.i7058, double* %tmp.13.i7056
- %tmp.16.i7059 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1465, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i7060 = getelementptr %"struct.std::dcomplex"* %tmp.0.i7055, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i7061 = load double* %tmp.17.i7060 ; <double> [#uses=1]
- store double %tmp.18.i7061, double* %tmp.16.i7059
- %tmp.4.i7035 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i7034, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i7072, double* %tmp.4.i7035
- %tmp.7.i7038 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i7034, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i7075, double* %tmp.7.i7038
- %tmp.0.i7041 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i7034, %"struct.std::dcomplex"* %mem_tmp.1465 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i7043 = getelementptr %"struct.std::dcomplex"* %tmp.0.i7041, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i7044 = load double* %tmp.14.i7043 ; <double> [#uses=1]
- %tmp.17.i7046 = getelementptr %"struct.std::dcomplex"* %tmp.0.i7041, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i7047 = load double* %tmp.17.i7046 ; <double> [#uses=1]
- %tmp.4.i7021 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i7020, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i7044, double* %tmp.4.i7021
- %tmp.7.i7024 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i7020, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i7047, double* %tmp.7.i7024
- %tmp.0.i7027 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i7020, %"struct.std::dcomplex"* %tmp.45 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i7028 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1462, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i7029 = getelementptr %"struct.std::dcomplex"* %tmp.0.i7027, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i7030 = load double* %tmp.14.i7029 ; <double> [#uses=1]
- store double %tmp.15.i7030, double* %tmp.13.i7028
- %tmp.16.i7031 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1462, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i7032 = getelementptr %"struct.std::dcomplex"* %tmp.0.i7027, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i7033 = load double* %tmp.17.i7032 ; <double> [#uses=1]
- store double %tmp.18.i7033, double* %tmp.16.i7031
- %tmp.4.i7007 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i7006, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i7086, double* %tmp.4.i7007
- %tmp.7.i7010 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i7006, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i7089, double* %tmp.7.i7010
- %tmp.0.i7013 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i7006, %"struct.std::dcomplex"* %mem_tmp.1462 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i7015 = getelementptr %"struct.std::dcomplex"* %tmp.0.i7013, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i7016 = load double* %tmp.14.i7015 ; <double> [#uses=1]
- %tmp.17.i7018 = getelementptr %"struct.std::dcomplex"* %tmp.0.i7013, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i7019 = load double* %tmp.17.i7018 ; <double> [#uses=1]
- store double %tmp.15.i7016, double* %tmp.2.i34364
- store double %tmp.18.i7019, double* %tmp.6.i34365
- %tmp.4.i6973 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i6972, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i6975 = load double* %tmp.5.i32460 ; <double> [#uses=1]
- store double %tmp.6.i6975, double* %tmp.4.i6973
- %tmp.7.i6976 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i6972, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i6978 = load double* %tmp.8.i32463 ; <double> [#uses=1]
- store double %tmp.9.i6978, double* %tmp.7.i6976
- %tmp.0.i6979 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i6972, %"struct.std::dcomplex"* %ret3 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i6981 = getelementptr %"struct.std::dcomplex"* %tmp.0.i6979, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i6982 = load double* %tmp.14.i6981 ; <double> [#uses=1]
- %tmp.17.i6984 = getelementptr %"struct.std::dcomplex"* %tmp.0.i6979, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i6985 = load double* %tmp.17.i6984 ; <double> [#uses=1]
- %tmp.7.i6939 = load double* %tmp.2.i34366 ; <double> [#uses=1]
- %tmp.15.i6953 = add double %tmp.7.i6939, %tmp.15.i6982 ; <double> [#uses=1]
- store double %tmp.15.i6953, double* %tmp.2.i34366
- %tmp.26.i6960 = load double* %tmp.6.i34367 ; <double> [#uses=1]
- %tmp.31.i6971 = add double %tmp.26.i6960, %tmp.18.i6985 ; <double> [#uses=1]
- store double %tmp.31.i6971, double* %tmp.6.i34367
- %tmp.4.i6919 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i6918, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i6921 = load double* %tmp.5.i29864 ; <double> [#uses=1]
- store double %tmp.6.i6921, double* %tmp.4.i6919
- %tmp.7.i6922 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i6918, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i6924 = load double* %tmp.8.i29867 ; <double> [#uses=1]
- store double %tmp.9.i6924, double* %tmp.7.i6922
- %tmp.0.i6925 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i6918, %"struct.std::dcomplex"* %ret4 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i6927 = getelementptr %"struct.std::dcomplex"* %tmp.0.i6925, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i6928 = load double* %tmp.14.i6927 ; <double> [#uses=1]
- %tmp.17.i6930 = getelementptr %"struct.std::dcomplex"* %tmp.0.i6925, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i6931 = load double* %tmp.17.i6930 ; <double> [#uses=1]
- %tmp.7.i6885 = load double* %tmp.2.i34368 ; <double> [#uses=1]
- %tmp.15.i6899 = add double %tmp.7.i6885, %tmp.15.i6928 ; <double> [#uses=1]
- store double %tmp.15.i6899, double* %tmp.2.i34368
- %tmp.26.i6906 = load double* %tmp.6.i34369 ; <double> [#uses=1]
- %tmp.31.i6917 = add double %tmp.26.i6906, %tmp.18.i6931 ; <double> [#uses=1]
- store double %tmp.31.i6917, double* %tmp.6.i34369
- store double 0.000000e+00, double* %tmp.2.i34366
- store double 0.000000e+00, double* %tmp.6.i34367
- %tmp.4.i6863 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i6862, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i6865 = load double* %tmp.5.i28602 ; <double> [#uses=1]
- store double %tmp.6.i6865, double* %tmp.4.i6863
- %tmp.7.i6866 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i6862, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i6868 = load double* %tmp.8.i28605 ; <double> [#uses=1]
- store double %tmp.9.i6868, double* %tmp.7.i6866
- %tmp.0.i6869 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i6862, %"struct.std::dcomplex"* %tmp.12 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i6871 = getelementptr %"struct.std::dcomplex"* %tmp.0.i6869, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i6872 = load double* %tmp.14.i6871 ; <double> [#uses=1]
- %tmp.17.i6874 = getelementptr %"struct.std::dcomplex"* %tmp.0.i6869, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i6875 = load double* %tmp.17.i6874 ; <double> [#uses=1]
- %tmp.4.i6849 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i6848, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i6851 = load double* %tmp.5.i34352 ; <double> [#uses=1]
- store double %tmp.6.i6851, double* %tmp.4.i6849
- %tmp.7.i6852 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i6848, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i6854 = load double* %tmp.8.i34355 ; <double> [#uses=1]
- store double %tmp.9.i6854, double* %tmp.7.i6852
- %tmp.0.i6855 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i6848, %"struct.std::dcomplex"* %tmp.1036 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i6856 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1473, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i6857 = getelementptr %"struct.std::dcomplex"* %tmp.0.i6855, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i6858 = load double* %tmp.14.i6857 ; <double> [#uses=1]
- store double %tmp.15.i6858, double* %tmp.13.i6856
- %tmp.16.i6859 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1473, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i6860 = getelementptr %"struct.std::dcomplex"* %tmp.0.i6855, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i6861 = load double* %tmp.17.i6860 ; <double> [#uses=1]
- store double %tmp.18.i6861, double* %tmp.16.i6859
- %tmp.4.i6835 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i6834, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i6872, double* %tmp.4.i6835
- %tmp.7.i6838 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i6834, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i6875, double* %tmp.7.i6838
- %tmp.0.i6841 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i6834, %"struct.std::dcomplex"* %mem_tmp.1473 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i6843 = getelementptr %"struct.std::dcomplex"* %tmp.0.i6841, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i6844 = load double* %tmp.14.i6843 ; <double> [#uses=1]
- %tmp.17.i6846 = getelementptr %"struct.std::dcomplex"* %tmp.0.i6841, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i6847 = load double* %tmp.17.i6846 ; <double> [#uses=1]
- %tmp.4.i6821 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i6820, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i6844, double* %tmp.4.i6821
- %tmp.7.i6824 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i6820, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i6847, double* %tmp.7.i6824
- %tmp.0.i6827 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i6820, %"struct.std::dcomplex"* %tmp.45 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i6829 = getelementptr %"struct.std::dcomplex"* %tmp.0.i6827, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i6830 = load double* %tmp.14.i6829 ; <double> [#uses=1]
- %tmp.17.i6832 = getelementptr %"struct.std::dcomplex"* %tmp.0.i6827, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i6833 = load double* %tmp.17.i6832 ; <double> [#uses=1]
- %tmp.4.i6807 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i6806, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i6809 = load double* %tmp.5.i34352 ; <double> [#uses=1]
- store double %tmp.6.i6809, double* %tmp.4.i6807
- %tmp.7.i6810 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i6806, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i6812 = load double* %tmp.8.i34355 ; <double> [#uses=1]
- store double %tmp.9.i6812, double* %tmp.7.i6810
- %tmp.0.i6813 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i6806, %"struct.std::dcomplex"* %tmp.6 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i6815 = getelementptr %"struct.std::dcomplex"* %tmp.0.i6813, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i6816 = load double* %tmp.14.i6815 ; <double> [#uses=1]
- %tmp.17.i6818 = getelementptr %"struct.std::dcomplex"* %tmp.0.i6813, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i6819 = load double* %tmp.17.i6818 ; <double> [#uses=1]
- %tmp.4.i6793 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i6792, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i6795 = load double* %tmp.5.i34338 ; <double> [#uses=1]
- store double %tmp.6.i6795, double* %tmp.4.i6793
- %tmp.7.i6796 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i6792, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i6798 = load double* %tmp.8.i34341 ; <double> [#uses=1]
- store double %tmp.9.i6798, double* %tmp.7.i6796
- %tmp.0.i6799 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i6792, %"struct.std::dcomplex"* %tmp.12 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i6800 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1477, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i6801 = getelementptr %"struct.std::dcomplex"* %tmp.0.i6799, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i6802 = load double* %tmp.14.i6801 ; <double> [#uses=1]
- store double %tmp.15.i6802, double* %tmp.13.i6800
- %tmp.16.i6803 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1477, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i6804 = getelementptr %"struct.std::dcomplex"* %tmp.0.i6799, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i6805 = load double* %tmp.17.i6804 ; <double> [#uses=1]
- store double %tmp.18.i6805, double* %tmp.16.i6803
- %tmp.4.i6779 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i6778, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i6816, double* %tmp.4.i6779
- %tmp.7.i6782 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i6778, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i6819, double* %tmp.7.i6782
- %tmp.0.i6785 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i6778, %"struct.std::dcomplex"* %mem_tmp.1477 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i6787 = getelementptr %"struct.std::dcomplex"* %tmp.0.i6785, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i6788 = load double* %tmp.14.i6787 ; <double> [#uses=1]
- %tmp.17.i6790 = getelementptr %"struct.std::dcomplex"* %tmp.0.i6785, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i6791 = load double* %tmp.17.i6790 ; <double> [#uses=1]
- %tmp.4.i6765 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i6764, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i6788, double* %tmp.4.i6765
- %tmp.7.i6768 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i6764, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i6791, double* %tmp.7.i6768
- %tmp.0.i6771 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i6764, %"struct.std::dcomplex"* %tmp.1075 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i6772 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1474, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i6773 = getelementptr %"struct.std::dcomplex"* %tmp.0.i6771, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i6774 = load double* %tmp.14.i6773 ; <double> [#uses=1]
- store double %tmp.15.i6774, double* %tmp.13.i6772
- %tmp.16.i6775 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1474, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i6776 = getelementptr %"struct.std::dcomplex"* %tmp.0.i6771, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i6777 = load double* %tmp.17.i6776 ; <double> [#uses=1]
- store double %tmp.18.i6777, double* %tmp.16.i6775
- %tmp.4.i6751 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i6750, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i6830, double* %tmp.4.i6751
- %tmp.7.i6754 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i6750, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i6833, double* %tmp.7.i6754
- %tmp.0.i6757 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i6750, %"struct.std::dcomplex"* %mem_tmp.1474 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i6759 = getelementptr %"struct.std::dcomplex"* %tmp.0.i6757, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i6760 = load double* %tmp.14.i6759 ; <double> [#uses=1]
- %tmp.17.i6762 = getelementptr %"struct.std::dcomplex"* %tmp.0.i6757, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i6763 = load double* %tmp.17.i6762 ; <double> [#uses=1]
- %tmp.4.i6737 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i6736, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i6739 = load double* %tmp.5.i34338 ; <double> [#uses=1]
- store double %tmp.6.i6739, double* %tmp.4.i6737
- %tmp.7.i6740 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i6736, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i6742 = load double* %tmp.8.i34341 ; <double> [#uses=1]
- store double %tmp.9.i6742, double* %tmp.7.i6740
- %tmp.0.i6743 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i6736, %"struct.std::dcomplex"* %tmp.1036 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i6745 = getelementptr %"struct.std::dcomplex"* %tmp.0.i6743, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i6746 = load double* %tmp.14.i6745 ; <double> [#uses=1]
- %tmp.17.i6748 = getelementptr %"struct.std::dcomplex"* %tmp.0.i6743, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i6749 = load double* %tmp.17.i6748 ; <double> [#uses=1]
- %tmp.4.i6723 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i6722, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i6725 = load double* %tmp.5.i28602 ; <double> [#uses=1]
- store double %tmp.6.i6725, double* %tmp.4.i6723
- %tmp.7.i6726 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i6722, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i6728 = load double* %tmp.8.i28605 ; <double> [#uses=1]
- store double %tmp.9.i6728, double* %tmp.7.i6726
- %tmp.0.i6729 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i6722, %"struct.std::dcomplex"* %tmp.6 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i6730 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1481, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i6731 = getelementptr %"struct.std::dcomplex"* %tmp.0.i6729, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i6732 = load double* %tmp.14.i6731 ; <double> [#uses=1]
- store double %tmp.15.i6732, double* %tmp.13.i6730
- %tmp.16.i6733 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1481, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i6734 = getelementptr %"struct.std::dcomplex"* %tmp.0.i6729, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i6735 = load double* %tmp.17.i6734 ; <double> [#uses=1]
- store double %tmp.18.i6735, double* %tmp.16.i6733
- %tmp.4.i6709 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i6708, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i6746, double* %tmp.4.i6709
- %tmp.7.i6712 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i6708, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i6749, double* %tmp.7.i6712
- %tmp.0.i6715 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i6708, %"struct.std::dcomplex"* %mem_tmp.1481 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i6717 = getelementptr %"struct.std::dcomplex"* %tmp.0.i6715, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i6718 = load double* %tmp.14.i6717 ; <double> [#uses=1]
- %tmp.17.i6720 = getelementptr %"struct.std::dcomplex"* %tmp.0.i6715, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i6721 = load double* %tmp.17.i6720 ; <double> [#uses=1]
- %tmp.4.i6695 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i6694, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i6718, double* %tmp.4.i6695
- %tmp.7.i6698 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i6694, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i6721, double* %tmp.7.i6698
- %tmp.0.i6701 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i6694, %"struct.std::dcomplex"* %tmp.30 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i6702 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1478, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i6703 = getelementptr %"struct.std::dcomplex"* %tmp.0.i6701, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i6704 = load double* %tmp.14.i6703 ; <double> [#uses=1]
- store double %tmp.15.i6704, double* %tmp.13.i6702
- %tmp.16.i6705 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1478, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i6706 = getelementptr %"struct.std::dcomplex"* %tmp.0.i6701, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i6707 = load double* %tmp.17.i6706 ; <double> [#uses=1]
- store double %tmp.18.i6707, double* %tmp.16.i6705
- %tmp.4.i6681 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i6680, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i6760, double* %tmp.4.i6681
- %tmp.7.i6684 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i6680, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i6763, double* %tmp.7.i6684
- %tmp.0.i6687 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i6680, %"struct.std::dcomplex"* %mem_tmp.1478 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i6689 = getelementptr %"struct.std::dcomplex"* %tmp.0.i6687, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i6690 = load double* %tmp.14.i6689 ; <double> [#uses=1]
- %tmp.17.i6692 = getelementptr %"struct.std::dcomplex"* %tmp.0.i6687, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i6693 = load double* %tmp.17.i6692 ; <double> [#uses=1]
- store double %tmp.15.i6690, double* %tmp.2.i34364
- store double %tmp.18.i6693, double* %tmp.6.i34365
- %tmp.4.i6647 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i6646, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i6649 = load double* %tmp.5.i33326 ; <double> [#uses=1]
- store double %tmp.6.i6649, double* %tmp.4.i6647
- %tmp.7.i6650 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i6646, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i6652 = load double* %tmp.8.i33329 ; <double> [#uses=1]
- store double %tmp.9.i6652, double* %tmp.7.i6650
- %tmp.0.i6653 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i6646, %"struct.std::dcomplex"* %ret3 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i6655 = getelementptr %"struct.std::dcomplex"* %tmp.0.i6653, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i6656 = load double* %tmp.14.i6655 ; <double> [#uses=1]
- %tmp.17.i6658 = getelementptr %"struct.std::dcomplex"* %tmp.0.i6653, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i6659 = load double* %tmp.17.i6658 ; <double> [#uses=1]
- %tmp.7.i6613 = load double* %tmp.2.i34366 ; <double> [#uses=1]
- %tmp.15.i6627 = add double %tmp.7.i6613, %tmp.15.i6656 ; <double> [#uses=1]
- store double %tmp.15.i6627, double* %tmp.2.i34366
- %tmp.26.i6634 = load double* %tmp.6.i34367 ; <double> [#uses=1]
- %tmp.31.i6645 = add double %tmp.26.i6634, %tmp.18.i6659 ; <double> [#uses=1]
- store double %tmp.31.i6645, double* %tmp.6.i34367
- %tmp.4.i6593 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i6592, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i6595 = load double* %tmp.5.i34282 ; <double> [#uses=1]
- store double %tmp.6.i6595, double* %tmp.4.i6593
- %tmp.7.i6596 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i6592, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i6598 = load double* %tmp.8.i34285 ; <double> [#uses=1]
- store double %tmp.9.i6598, double* %tmp.7.i6596
- %tmp.0.i6599 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i6592, %"struct.std::dcomplex"* %tmp.6 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i6601 = getelementptr %"struct.std::dcomplex"* %tmp.0.i6599, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i6602 = load double* %tmp.14.i6601 ; <double> [#uses=1]
- %tmp.17.i6604 = getelementptr %"struct.std::dcomplex"* %tmp.0.i6599, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i6605 = load double* %tmp.17.i6604 ; <double> [#uses=1]
- %tmp.4.i6579 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i6578, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i6581 = load double* %tmp.5.i34338 ; <double> [#uses=1]
- store double %tmp.6.i6581, double* %tmp.4.i6579
- %tmp.7.i6582 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i6578, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i6584 = load double* %tmp.8.i34341 ; <double> [#uses=1]
- store double %tmp.9.i6584, double* %tmp.7.i6582
- %tmp.0.i6585 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i6578, %"struct.std::dcomplex"* %tmp.21 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i6586 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1488, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i6587 = getelementptr %"struct.std::dcomplex"* %tmp.0.i6585, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i6588 = load double* %tmp.14.i6587 ; <double> [#uses=1]
- store double %tmp.15.i6588, double* %tmp.13.i6586
- %tmp.16.i6589 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1488, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i6590 = getelementptr %"struct.std::dcomplex"* %tmp.0.i6585, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i6591 = load double* %tmp.17.i6590 ; <double> [#uses=1]
- store double %tmp.18.i6591, double* %tmp.16.i6589
- %tmp.4.i6565 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i6564, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i6602, double* %tmp.4.i6565
- %tmp.7.i6568 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i6564, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i6605, double* %tmp.7.i6568
- %tmp.0.i6571 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i6564, %"struct.std::dcomplex"* %mem_tmp.1488 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i6573 = getelementptr %"struct.std::dcomplex"* %tmp.0.i6571, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i6574 = load double* %tmp.14.i6573 ; <double> [#uses=1]
- %tmp.17.i6576 = getelementptr %"struct.std::dcomplex"* %tmp.0.i6571, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i6577 = load double* %tmp.17.i6576 ; <double> [#uses=1]
- %tmp.4.i6551 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i6550, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i6574, double* %tmp.4.i6551
- %tmp.7.i6554 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i6550, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i6577, double* %tmp.7.i6554
- %tmp.0.i6557 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i6550, %"struct.std::dcomplex"* %tmp.30 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i6559 = getelementptr %"struct.std::dcomplex"* %tmp.0.i6557, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i6560 = load double* %tmp.14.i6559 ; <double> [#uses=1]
- %tmp.17.i6562 = getelementptr %"struct.std::dcomplex"* %tmp.0.i6557, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i6563 = load double* %tmp.17.i6562 ; <double> [#uses=1]
- %tmp.4.i6537 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i6536, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i6539 = load double* %tmp.5.i34352 ; <double> [#uses=1]
- store double %tmp.6.i6539, double* %tmp.4.i6537
- %tmp.7.i6540 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i6536, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i6542 = load double* %tmp.8.i34355 ; <double> [#uses=1]
- store double %tmp.9.i6542, double* %tmp.7.i6540
- %tmp.0.i6543 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i6536, %"struct.std::dcomplex"* %tmp.21 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i6545 = getelementptr %"struct.std::dcomplex"* %tmp.0.i6543, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i6546 = load double* %tmp.14.i6545 ; <double> [#uses=1]
- %tmp.17.i6548 = getelementptr %"struct.std::dcomplex"* %tmp.0.i6543, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i6549 = load double* %tmp.17.i6548 ; <double> [#uses=1]
- %tmp.4.i6523 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i6522, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i6525 = load double* %tmp.5.i34282 ; <double> [#uses=1]
- store double %tmp.6.i6525, double* %tmp.4.i6523
- %tmp.7.i6526 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i6522, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i6528 = load double* %tmp.8.i34285 ; <double> [#uses=1]
- store double %tmp.9.i6528, double* %tmp.7.i6526
- %tmp.0.i6529 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i6522, %"struct.std::dcomplex"* %tmp.12 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i6530 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1492, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i6531 = getelementptr %"struct.std::dcomplex"* %tmp.0.i6529, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i6532 = load double* %tmp.14.i6531 ; <double> [#uses=1]
- store double %tmp.15.i6532, double* %tmp.13.i6530
- %tmp.16.i6533 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1492, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i6534 = getelementptr %"struct.std::dcomplex"* %tmp.0.i6529, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i6535 = load double* %tmp.17.i6534 ; <double> [#uses=1]
- store double %tmp.18.i6535, double* %tmp.16.i6533
- %tmp.4.i6509 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i6508, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i6546, double* %tmp.4.i6509
- %tmp.7.i6512 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i6508, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i6549, double* %tmp.7.i6512
- %tmp.0.i6515 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i6508, %"struct.std::dcomplex"* %mem_tmp.1492 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i6517 = getelementptr %"struct.std::dcomplex"* %tmp.0.i6515, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i6518 = load double* %tmp.14.i6517 ; <double> [#uses=1]
- %tmp.17.i6520 = getelementptr %"struct.std::dcomplex"* %tmp.0.i6515, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i6521 = load double* %tmp.17.i6520 ; <double> [#uses=1]
- %tmp.4.i6495 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i6494, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i6518, double* %tmp.4.i6495
- %tmp.7.i6498 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i6494, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i6521, double* %tmp.7.i6498
- %tmp.0.i6501 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i6494, %"struct.std::dcomplex"* %tmp.45 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i6502 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1489, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i6503 = getelementptr %"struct.std::dcomplex"* %tmp.0.i6501, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i6504 = load double* %tmp.14.i6503 ; <double> [#uses=1]
- store double %tmp.15.i6504, double* %tmp.13.i6502
- %tmp.16.i6505 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1489, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i6506 = getelementptr %"struct.std::dcomplex"* %tmp.0.i6501, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i6507 = load double* %tmp.17.i6506 ; <double> [#uses=1]
- store double %tmp.18.i6507, double* %tmp.16.i6505
- %tmp.4.i6481 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i6480, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i6560, double* %tmp.4.i6481
- %tmp.7.i6484 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i6480, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i6563, double* %tmp.7.i6484
- %tmp.0.i6487 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i6480, %"struct.std::dcomplex"* %mem_tmp.1489 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i6489 = getelementptr %"struct.std::dcomplex"* %tmp.0.i6487, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i6490 = load double* %tmp.14.i6489 ; <double> [#uses=1]
- %tmp.17.i6492 = getelementptr %"struct.std::dcomplex"* %tmp.0.i6487, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i6493 = load double* %tmp.17.i6492 ; <double> [#uses=1]
- %tmp.4.i6467 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i6466, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i6469 = load double* %tmp.5.i34338 ; <double> [#uses=1]
- store double %tmp.6.i6469, double* %tmp.4.i6467
- %tmp.7.i6470 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i6466, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i6472 = load double* %tmp.8.i34341 ; <double> [#uses=1]
- store double %tmp.9.i6472, double* %tmp.7.i6470
- %tmp.0.i6473 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i6466, %"struct.std::dcomplex"* %tmp.12 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i6475 = getelementptr %"struct.std::dcomplex"* %tmp.0.i6473, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i6476 = load double* %tmp.14.i6475 ; <double> [#uses=1]
- %tmp.17.i6478 = getelementptr %"struct.std::dcomplex"* %tmp.0.i6473, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i6479 = load double* %tmp.17.i6478 ; <double> [#uses=1]
- %tmp.4.i6453 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i6452, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i6455 = load double* %tmp.5.i34352 ; <double> [#uses=1]
- store double %tmp.6.i6455, double* %tmp.4.i6453
- %tmp.7.i6456 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i6452, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i6458 = load double* %tmp.8.i34355 ; <double> [#uses=1]
- store double %tmp.9.i6458, double* %tmp.7.i6456
- %tmp.0.i6459 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i6452, %"struct.std::dcomplex"* %tmp.6 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i6460 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1496, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i6461 = getelementptr %"struct.std::dcomplex"* %tmp.0.i6459, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i6462 = load double* %tmp.14.i6461 ; <double> [#uses=1]
- store double %tmp.15.i6462, double* %tmp.13.i6460
- %tmp.16.i6463 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1496, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i6464 = getelementptr %"struct.std::dcomplex"* %tmp.0.i6459, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i6465 = load double* %tmp.17.i6464 ; <double> [#uses=1]
- store double %tmp.18.i6465, double* %tmp.16.i6463
- %tmp.4.i6439 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i6438, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i6476, double* %tmp.4.i6439
- %tmp.7.i6442 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i6438, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i6479, double* %tmp.7.i6442
- %tmp.0.i6445 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i6438, %"struct.std::dcomplex"* %mem_tmp.1496 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i6447 = getelementptr %"struct.std::dcomplex"* %tmp.0.i6445, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i6448 = load double* %tmp.14.i6447 ; <double> [#uses=1]
- %tmp.17.i6450 = getelementptr %"struct.std::dcomplex"* %tmp.0.i6445, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i6451 = load double* %tmp.17.i6450 ; <double> [#uses=1]
- %tmp.4.i6425 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i6424, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i6448, double* %tmp.4.i6425
- %tmp.7.i6428 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i6424, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i6451, double* %tmp.7.i6428
- %tmp.0.i6431 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i6424, %"struct.std::dcomplex"* %tmp.15 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i6432 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1493, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i6433 = getelementptr %"struct.std::dcomplex"* %tmp.0.i6431, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i6434 = load double* %tmp.14.i6433 ; <double> [#uses=1]
- store double %tmp.15.i6434, double* %tmp.13.i6432
- %tmp.16.i6435 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1493, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i6436 = getelementptr %"struct.std::dcomplex"* %tmp.0.i6431, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i6437 = load double* %tmp.17.i6436 ; <double> [#uses=1]
- store double %tmp.18.i6437, double* %tmp.16.i6435
- %tmp.4.i6411 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i6410, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i6490, double* %tmp.4.i6411
- %tmp.7.i6414 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i6410, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i6493, double* %tmp.7.i6414
- %tmp.0.i6417 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i6410, %"struct.std::dcomplex"* %mem_tmp.1493 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i6419 = getelementptr %"struct.std::dcomplex"* %tmp.0.i6417, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i6420 = load double* %tmp.14.i6419 ; <double> [#uses=1]
- %tmp.17.i6422 = getelementptr %"struct.std::dcomplex"* %tmp.0.i6417, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i6423 = load double* %tmp.17.i6422 ; <double> [#uses=1]
- store double %tmp.15.i6420, double* %tmp.2.i34364
- store double %tmp.18.i6423, double* %tmp.6.i34365
- %tmp.4.i6377 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i6376, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i6379 = load double* %tmp.5.i27590 ; <double> [#uses=1]
- store double %tmp.6.i6379, double* %tmp.4.i6377
- %tmp.7.i6380 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i6376, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i6382 = load double* %tmp.8.i27593 ; <double> [#uses=1]
- store double %tmp.9.i6382, double* %tmp.7.i6380
- %tmp.0.i6383 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i6376, %"struct.std::dcomplex"* %ret3 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i6385 = getelementptr %"struct.std::dcomplex"* %tmp.0.i6383, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i6386 = load double* %tmp.14.i6385 ; <double> [#uses=1]
- %tmp.17.i6388 = getelementptr %"struct.std::dcomplex"* %tmp.0.i6383, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i6389 = load double* %tmp.17.i6388 ; <double> [#uses=1]
- %tmp.7.i6343 = load double* %tmp.2.i34366 ; <double> [#uses=1]
- %tmp.15.i6357 = add double %tmp.7.i6343, %tmp.15.i6386 ; <double> [#uses=1]
- store double %tmp.15.i6357, double* %tmp.2.i34366
- %tmp.26.i6364 = load double* %tmp.6.i34367 ; <double> [#uses=1]
- %tmp.31.i6375 = add double %tmp.26.i6364, %tmp.18.i6389 ; <double> [#uses=1]
- store double %tmp.31.i6375, double* %tmp.6.i34367
- %tmp.4.i6323 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i6322, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i6325 = load double* %tmp.5.i28602 ; <double> [#uses=1]
- store double %tmp.6.i6325, double* %tmp.4.i6323
- %tmp.7.i6326 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i6322, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i6328 = load double* %tmp.8.i28605 ; <double> [#uses=1]
- store double %tmp.9.i6328, double* %tmp.7.i6326
- %tmp.0.i6329 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i6322, %"struct.std::dcomplex"* %tmp.6 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i6331 = getelementptr %"struct.std::dcomplex"* %tmp.0.i6329, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i6332 = load double* %tmp.14.i6331 ; <double> [#uses=1]
- %tmp.17.i6334 = getelementptr %"struct.std::dcomplex"* %tmp.0.i6329, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i6335 = load double* %tmp.17.i6334 ; <double> [#uses=1]
- %tmp.4.i6309 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i6308, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i6311 = load double* %tmp.5.i34338 ; <double> [#uses=1]
- store double %tmp.6.i6311, double* %tmp.4.i6309
- %tmp.7.i6312 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i6308, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i6314 = load double* %tmp.8.i34341 ; <double> [#uses=1]
- store double %tmp.9.i6314, double* %tmp.7.i6312
- %tmp.0.i6315 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i6308, %"struct.std::dcomplex"* %tmp.1036 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i6316 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1503, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i6317 = getelementptr %"struct.std::dcomplex"* %tmp.0.i6315, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i6318 = load double* %tmp.14.i6317 ; <double> [#uses=1]
- store double %tmp.15.i6318, double* %tmp.13.i6316
- %tmp.16.i6319 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1503, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i6320 = getelementptr %"struct.std::dcomplex"* %tmp.0.i6315, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i6321 = load double* %tmp.17.i6320 ; <double> [#uses=1]
- store double %tmp.18.i6321, double* %tmp.16.i6319
- %tmp.4.i6295 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i6294, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i6332, double* %tmp.4.i6295
- %tmp.7.i6298 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i6294, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i6335, double* %tmp.7.i6298
- %tmp.0.i6301 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i6294, %"struct.std::dcomplex"* %mem_tmp.1503 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i6303 = getelementptr %"struct.std::dcomplex"* %tmp.0.i6301, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i6304 = load double* %tmp.14.i6303 ; <double> [#uses=1]
- %tmp.17.i6306 = getelementptr %"struct.std::dcomplex"* %tmp.0.i6301, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i6307 = load double* %tmp.17.i6306 ; <double> [#uses=1]
- %tmp.4.i6281 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i6280, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i6304, double* %tmp.4.i6281
- %tmp.7.i6284 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i6280, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i6307, double* %tmp.7.i6284
- %tmp.0.i6287 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i6280, %"struct.std::dcomplex"* %tmp.15 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i6289 = getelementptr %"struct.std::dcomplex"* %tmp.0.i6287, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i6290 = load double* %tmp.14.i6289 ; <double> [#uses=1]
- %tmp.17.i6292 = getelementptr %"struct.std::dcomplex"* %tmp.0.i6287, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i6293 = load double* %tmp.17.i6292 ; <double> [#uses=1]
- %tmp.4.i6267 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i6266, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i6269 = load double* %tmp.5.i34338 ; <double> [#uses=1]
- store double %tmp.6.i6269, double* %tmp.4.i6267
- %tmp.7.i6270 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i6266, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i6272 = load double* %tmp.8.i34341 ; <double> [#uses=1]
- store double %tmp.9.i6272, double* %tmp.7.i6270
- %tmp.0.i6273 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i6266, %"struct.std::dcomplex"* %tmp.21 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i6275 = getelementptr %"struct.std::dcomplex"* %tmp.0.i6273, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i6276 = load double* %tmp.14.i6275 ; <double> [#uses=1]
- %tmp.17.i6278 = getelementptr %"struct.std::dcomplex"* %tmp.0.i6273, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i6279 = load double* %tmp.17.i6278 ; <double> [#uses=1]
- %tmp.4.i6253 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i6252, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i6255 = load double* %tmp.5.i34282 ; <double> [#uses=1]
- store double %tmp.6.i6255, double* %tmp.4.i6253
- %tmp.7.i6256 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i6252, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i6258 = load double* %tmp.8.i34285 ; <double> [#uses=1]
- store double %tmp.9.i6258, double* %tmp.7.i6256
- %tmp.0.i6259 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i6252, %"struct.std::dcomplex"* %tmp.6 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i6260 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1507, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i6261 = getelementptr %"struct.std::dcomplex"* %tmp.0.i6259, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i6262 = load double* %tmp.14.i6261 ; <double> [#uses=1]
- store double %tmp.15.i6262, double* %tmp.13.i6260
- %tmp.16.i6263 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1507, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i6264 = getelementptr %"struct.std::dcomplex"* %tmp.0.i6259, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i6265 = load double* %tmp.17.i6264 ; <double> [#uses=1]
- store double %tmp.18.i6265, double* %tmp.16.i6263
- %tmp.4.i6239 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i6238, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i6276, double* %tmp.4.i6239
- %tmp.7.i6242 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i6238, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i6279, double* %tmp.7.i6242
- %tmp.0.i6245 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i6238, %"struct.std::dcomplex"* %mem_tmp.1507 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i6247 = getelementptr %"struct.std::dcomplex"* %tmp.0.i6245, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i6248 = load double* %tmp.14.i6247 ; <double> [#uses=1]
- %tmp.17.i6250 = getelementptr %"struct.std::dcomplex"* %tmp.0.i6245, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i6251 = load double* %tmp.17.i6250 ; <double> [#uses=1]
- %tmp.4.i6225 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i6224, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i6248, double* %tmp.4.i6225
- %tmp.7.i6228 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i6224, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i6251, double* %tmp.7.i6228
- %tmp.0.i6231 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i6224, %"struct.std::dcomplex"* %tmp.1075 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i6232 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1504, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i6233 = getelementptr %"struct.std::dcomplex"* %tmp.0.i6231, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i6234 = load double* %tmp.14.i6233 ; <double> [#uses=1]
- store double %tmp.15.i6234, double* %tmp.13.i6232
- %tmp.16.i6235 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1504, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i6236 = getelementptr %"struct.std::dcomplex"* %tmp.0.i6231, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i6237 = load double* %tmp.17.i6236 ; <double> [#uses=1]
- store double %tmp.18.i6237, double* %tmp.16.i6235
- %tmp.4.i6211 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i6210, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i6290, double* %tmp.4.i6211
- %tmp.7.i6214 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i6210, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i6293, double* %tmp.7.i6214
- %tmp.0.i6217 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i6210, %"struct.std::dcomplex"* %mem_tmp.1504 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i6219 = getelementptr %"struct.std::dcomplex"* %tmp.0.i6217, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i6220 = load double* %tmp.14.i6219 ; <double> [#uses=1]
- %tmp.17.i6222 = getelementptr %"struct.std::dcomplex"* %tmp.0.i6217, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i6223 = load double* %tmp.17.i6222 ; <double> [#uses=1]
- %tmp.4.i6197 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i6196, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i6199 = load double* %tmp.5.i34282 ; <double> [#uses=1]
- store double %tmp.6.i6199, double* %tmp.4.i6197
- %tmp.7.i6200 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i6196, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i6202 = load double* %tmp.8.i34285 ; <double> [#uses=1]
- store double %tmp.9.i6202, double* %tmp.7.i6200
- %tmp.0.i6203 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i6196, %"struct.std::dcomplex"* %tmp.1036 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i6205 = getelementptr %"struct.std::dcomplex"* %tmp.0.i6203, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i6206 = load double* %tmp.14.i6205 ; <double> [#uses=1]
- %tmp.17.i6208 = getelementptr %"struct.std::dcomplex"* %tmp.0.i6203, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i6209 = load double* %tmp.17.i6208 ; <double> [#uses=1]
- %tmp.4.i6183 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i6182, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i6185 = load double* %tmp.5.i28602 ; <double> [#uses=1]
- store double %tmp.6.i6185, double* %tmp.4.i6183
- %tmp.7.i6186 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i6182, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i6188 = load double* %tmp.8.i28605 ; <double> [#uses=1]
- store double %tmp.9.i6188, double* %tmp.7.i6186
- %tmp.0.i6189 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i6182, %"struct.std::dcomplex"* %tmp.21 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i6190 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1511, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i6191 = getelementptr %"struct.std::dcomplex"* %tmp.0.i6189, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i6192 = load double* %tmp.14.i6191 ; <double> [#uses=1]
- store double %tmp.15.i6192, double* %tmp.13.i6190
- %tmp.16.i6193 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1511, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i6194 = getelementptr %"struct.std::dcomplex"* %tmp.0.i6189, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i6195 = load double* %tmp.17.i6194 ; <double> [#uses=1]
- store double %tmp.18.i6195, double* %tmp.16.i6193
- %tmp.4.i6169 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i6168, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i6206, double* %tmp.4.i6169
- %tmp.7.i6172 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i6168, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i6209, double* %tmp.7.i6172
- %tmp.0.i6175 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i6168, %"struct.std::dcomplex"* %mem_tmp.1511 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i6177 = getelementptr %"struct.std::dcomplex"* %tmp.0.i6175, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i6178 = load double* %tmp.14.i6177 ; <double> [#uses=1]
- %tmp.17.i6180 = getelementptr %"struct.std::dcomplex"* %tmp.0.i6175, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i6181 = load double* %tmp.17.i6180 ; <double> [#uses=1]
- %tmp.4.i6155 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i6154, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i6178, double* %tmp.4.i6155
- %tmp.7.i6158 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i6154, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i6181, double* %tmp.7.i6158
- %tmp.0.i6161 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i6154, %"struct.std::dcomplex"* %tmp.45 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i6162 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1508, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i6163 = getelementptr %"struct.std::dcomplex"* %tmp.0.i6161, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i6164 = load double* %tmp.14.i6163 ; <double> [#uses=1]
- store double %tmp.15.i6164, double* %tmp.13.i6162
- %tmp.16.i6165 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1508, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i6166 = getelementptr %"struct.std::dcomplex"* %tmp.0.i6161, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i6167 = load double* %tmp.17.i6166 ; <double> [#uses=1]
- store double %tmp.18.i6167, double* %tmp.16.i6165
- %tmp.4.i6141 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i6140, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i6220, double* %tmp.4.i6141
- %tmp.7.i6144 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i6140, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i6223, double* %tmp.7.i6144
- %tmp.0.i6147 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i6140, %"struct.std::dcomplex"* %mem_tmp.1508 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i6149 = getelementptr %"struct.std::dcomplex"* %tmp.0.i6147, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i6150 = load double* %tmp.14.i6149 ; <double> [#uses=1]
- %tmp.17.i6152 = getelementptr %"struct.std::dcomplex"* %tmp.0.i6147, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i6153 = load double* %tmp.17.i6152 ; <double> [#uses=1]
- store double %tmp.15.i6150, double* %tmp.2.i34364
- store double %tmp.18.i6153, double* %tmp.6.i34365
- %tmp.4.i6107 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i6106, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i6109 = load double* %tmp.5.i33866 ; <double> [#uses=1]
- store double %tmp.6.i6109, double* %tmp.4.i6107
- %tmp.7.i6110 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i6106, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i6112 = load double* %tmp.8.i33869 ; <double> [#uses=1]
- store double %tmp.9.i6112, double* %tmp.7.i6110
- %tmp.0.i6113 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i6106, %"struct.std::dcomplex"* %ret3 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i6115 = getelementptr %"struct.std::dcomplex"* %tmp.0.i6113, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i6116 = load double* %tmp.14.i6115 ; <double> [#uses=1]
- %tmp.17.i6118 = getelementptr %"struct.std::dcomplex"* %tmp.0.i6113, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i6119 = load double* %tmp.17.i6118 ; <double> [#uses=1]
- %tmp.7.i6073 = load double* %tmp.2.i34366 ; <double> [#uses=1]
- %tmp.15.i6087 = add double %tmp.7.i6073, %tmp.15.i6116 ; <double> [#uses=1]
- store double %tmp.15.i6087, double* %tmp.2.i34366
- %tmp.26.i6094 = load double* %tmp.6.i34367 ; <double> [#uses=1]
- %tmp.31.i6105 = add double %tmp.26.i6094, %tmp.18.i6119 ; <double> [#uses=1]
- store double %tmp.31.i6105, double* %tmp.6.i34367
- %tmp.4.i6053 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i6052, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i6055 = load double* %tmp.5.i28602 ; <double> [#uses=1]
- store double %tmp.6.i6055, double* %tmp.4.i6053
- %tmp.7.i6056 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i6052, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i6058 = load double* %tmp.8.i28605 ; <double> [#uses=1]
- store double %tmp.9.i6058, double* %tmp.7.i6056
- %tmp.0.i6059 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i6052, %"struct.std::dcomplex"* %tmp.21 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i6061 = getelementptr %"struct.std::dcomplex"* %tmp.0.i6059, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i6062 = load double* %tmp.14.i6061 ; <double> [#uses=1]
- %tmp.17.i6064 = getelementptr %"struct.std::dcomplex"* %tmp.0.i6059, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i6065 = load double* %tmp.17.i6064 ; <double> [#uses=1]
- %tmp.4.i6039 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i6038, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i6041 = load double* %tmp.5.i34282 ; <double> [#uses=1]
- store double %tmp.6.i6041, double* %tmp.4.i6039
- %tmp.7.i6042 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i6038, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i6044 = load double* %tmp.8.i34285 ; <double> [#uses=1]
- store double %tmp.9.i6044, double* %tmp.7.i6042
- %tmp.0.i6045 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i6038, %"struct.std::dcomplex"* %tmp.1036 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i6046 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1518, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i6047 = getelementptr %"struct.std::dcomplex"* %tmp.0.i6045, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i6048 = load double* %tmp.14.i6047 ; <double> [#uses=1]
- store double %tmp.15.i6048, double* %tmp.13.i6046
- %tmp.16.i6049 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1518, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i6050 = getelementptr %"struct.std::dcomplex"* %tmp.0.i6045, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i6051 = load double* %tmp.17.i6050 ; <double> [#uses=1]
- store double %tmp.18.i6051, double* %tmp.16.i6049
- %tmp.4.i6025 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i6024, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i6062, double* %tmp.4.i6025
- %tmp.7.i6028 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i6024, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i6065, double* %tmp.7.i6028
- %tmp.0.i6031 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i6024, %"struct.std::dcomplex"* %mem_tmp.1518 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i6033 = getelementptr %"struct.std::dcomplex"* %tmp.0.i6031, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i6034 = load double* %tmp.14.i6033 ; <double> [#uses=1]
- %tmp.17.i6036 = getelementptr %"struct.std::dcomplex"* %tmp.0.i6031, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i6037 = load double* %tmp.17.i6036 ; <double> [#uses=1]
- %tmp.4.i6011 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i6010, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i6034, double* %tmp.4.i6011
- %tmp.7.i6014 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i6010, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i6037, double* %tmp.7.i6014
- %tmp.0.i6017 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i6010, %"struct.std::dcomplex"* %tmp.30 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i6019 = getelementptr %"struct.std::dcomplex"* %tmp.0.i6017, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i6020 = load double* %tmp.14.i6019 ; <double> [#uses=1]
- %tmp.17.i6022 = getelementptr %"struct.std::dcomplex"* %tmp.0.i6017, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i6023 = load double* %tmp.17.i6022 ; <double> [#uses=1]
- %tmp.4.i5997 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i5996, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i5999 = load double* %tmp.5.i34352 ; <double> [#uses=1]
- store double %tmp.6.i5999, double* %tmp.4.i5997
- %tmp.7.i6000 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i5996, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i6002 = load double* %tmp.8.i34355 ; <double> [#uses=1]
- store double %tmp.9.i6002, double* %tmp.7.i6000
- %tmp.0.i6003 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i5996, %"struct.std::dcomplex"* %tmp.1036 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i6005 = getelementptr %"struct.std::dcomplex"* %tmp.0.i6003, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i6006 = load double* %tmp.14.i6005 ; <double> [#uses=1]
- %tmp.17.i6008 = getelementptr %"struct.std::dcomplex"* %tmp.0.i6003, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i6009 = load double* %tmp.17.i6008 ; <double> [#uses=1]
- %tmp.4.i5983 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i5982, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i5985 = load double* %tmp.5.i28602 ; <double> [#uses=1]
- store double %tmp.6.i5985, double* %tmp.4.i5983
- %tmp.7.i5986 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i5982, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i5988 = load double* %tmp.8.i28605 ; <double> [#uses=1]
- store double %tmp.9.i5988, double* %tmp.7.i5986
- %tmp.0.i5989 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i5982, %"struct.std::dcomplex"* %tmp.12 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i5990 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1522, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i5991 = getelementptr %"struct.std::dcomplex"* %tmp.0.i5989, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i5992 = load double* %tmp.14.i5991 ; <double> [#uses=1]
- store double %tmp.15.i5992, double* %tmp.13.i5990
- %tmp.16.i5993 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1522, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i5994 = getelementptr %"struct.std::dcomplex"* %tmp.0.i5989, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i5995 = load double* %tmp.17.i5994 ; <double> [#uses=1]
- store double %tmp.18.i5995, double* %tmp.16.i5993
- %tmp.4.i5969 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i5968, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i6006, double* %tmp.4.i5969
- %tmp.7.i5972 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i5968, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i6009, double* %tmp.7.i5972
- %tmp.0.i5975 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i5968, %"struct.std::dcomplex"* %mem_tmp.1522 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i5977 = getelementptr %"struct.std::dcomplex"* %tmp.0.i5975, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i5978 = load double* %tmp.14.i5977 ; <double> [#uses=1]
- %tmp.17.i5980 = getelementptr %"struct.std::dcomplex"* %tmp.0.i5975, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i5981 = load double* %tmp.17.i5980 ; <double> [#uses=1]
- %tmp.4.i5955 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i5954, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i5978, double* %tmp.4.i5955
- %tmp.7.i5958 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i5954, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i5981, double* %tmp.7.i5958
- %tmp.0.i5961 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i5954, %"struct.std::dcomplex"* %tmp.15 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i5962 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1519, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i5963 = getelementptr %"struct.std::dcomplex"* %tmp.0.i5961, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i5964 = load double* %tmp.14.i5963 ; <double> [#uses=1]
- store double %tmp.15.i5964, double* %tmp.13.i5962
- %tmp.16.i5965 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1519, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i5966 = getelementptr %"struct.std::dcomplex"* %tmp.0.i5961, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i5967 = load double* %tmp.17.i5966 ; <double> [#uses=1]
- store double %tmp.18.i5967, double* %tmp.16.i5965
- %tmp.4.i5941 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i5940, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i6020, double* %tmp.4.i5941
- %tmp.7.i5944 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i5940, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i6023, double* %tmp.7.i5944
- %tmp.0.i5947 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i5940, %"struct.std::dcomplex"* %mem_tmp.1519 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i5949 = getelementptr %"struct.std::dcomplex"* %tmp.0.i5947, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i5950 = load double* %tmp.14.i5949 ; <double> [#uses=1]
- %tmp.17.i5952 = getelementptr %"struct.std::dcomplex"* %tmp.0.i5947, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i5953 = load double* %tmp.17.i5952 ; <double> [#uses=1]
- %tmp.4.i5927 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i5926, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i5929 = load double* %tmp.5.i34282 ; <double> [#uses=1]
- store double %tmp.6.i5929, double* %tmp.4.i5927
- %tmp.7.i5930 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i5926, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i5932 = load double* %tmp.8.i34285 ; <double> [#uses=1]
- store double %tmp.9.i5932, double* %tmp.7.i5930
- %tmp.0.i5933 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i5926, %"struct.std::dcomplex"* %tmp.12 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i5935 = getelementptr %"struct.std::dcomplex"* %tmp.0.i5933, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i5936 = load double* %tmp.14.i5935 ; <double> [#uses=1]
- %tmp.17.i5938 = getelementptr %"struct.std::dcomplex"* %tmp.0.i5933, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i5939 = load double* %tmp.17.i5938 ; <double> [#uses=1]
- %tmp.4.i5913 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i5912, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i5915 = load double* %tmp.5.i34352 ; <double> [#uses=1]
- store double %tmp.6.i5915, double* %tmp.4.i5913
- %tmp.7.i5916 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i5912, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i5918 = load double* %tmp.8.i34355 ; <double> [#uses=1]
- store double %tmp.9.i5918, double* %tmp.7.i5916
- %tmp.0.i5919 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i5912, %"struct.std::dcomplex"* %tmp.21 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i5920 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1526, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i5921 = getelementptr %"struct.std::dcomplex"* %tmp.0.i5919, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i5922 = load double* %tmp.14.i5921 ; <double> [#uses=1]
- store double %tmp.15.i5922, double* %tmp.13.i5920
- %tmp.16.i5923 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1526, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i5924 = getelementptr %"struct.std::dcomplex"* %tmp.0.i5919, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i5925 = load double* %tmp.17.i5924 ; <double> [#uses=1]
- store double %tmp.18.i5925, double* %tmp.16.i5923
- %tmp.4.i5899 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i5898, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i5936, double* %tmp.4.i5899
- %tmp.7.i5902 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i5898, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i5939, double* %tmp.7.i5902
- %tmp.0.i5905 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i5898, %"struct.std::dcomplex"* %mem_tmp.1526 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i5907 = getelementptr %"struct.std::dcomplex"* %tmp.0.i5905, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i5908 = load double* %tmp.14.i5907 ; <double> [#uses=1]
- %tmp.17.i5910 = getelementptr %"struct.std::dcomplex"* %tmp.0.i5905, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i5911 = load double* %tmp.17.i5910 ; <double> [#uses=1]
- %tmp.4.i5885 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i5884, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i5908, double* %tmp.4.i5885
- %tmp.7.i5888 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i5884, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i5911, double* %tmp.7.i5888
- %tmp.0.i5891 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i5884, %"struct.std::dcomplex"* %tmp.1075 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i5892 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1523, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i5893 = getelementptr %"struct.std::dcomplex"* %tmp.0.i5891, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i5894 = load double* %tmp.14.i5893 ; <double> [#uses=1]
- store double %tmp.15.i5894, double* %tmp.13.i5892
- %tmp.16.i5895 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1523, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i5896 = getelementptr %"struct.std::dcomplex"* %tmp.0.i5891, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i5897 = load double* %tmp.17.i5896 ; <double> [#uses=1]
- store double %tmp.18.i5897, double* %tmp.16.i5895
- %tmp.4.i5871 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i5870, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i5950, double* %tmp.4.i5871
- %tmp.7.i5874 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i5870, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i5953, double* %tmp.7.i5874
- %tmp.0.i5877 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i5870, %"struct.std::dcomplex"* %mem_tmp.1523 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i5879 = getelementptr %"struct.std::dcomplex"* %tmp.0.i5877, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i5880 = load double* %tmp.14.i5879 ; <double> [#uses=1]
- %tmp.17.i5882 = getelementptr %"struct.std::dcomplex"* %tmp.0.i5877, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i5883 = load double* %tmp.17.i5882 ; <double> [#uses=1]
- store double %tmp.15.i5880, double* %tmp.2.i34364
- store double %tmp.18.i5883, double* %tmp.6.i34365
- %tmp.4.i5837 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i5836, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i5839 = load double* %tmp.5.i33596 ; <double> [#uses=1]
- store double %tmp.6.i5839, double* %tmp.4.i5837
- %tmp.7.i5840 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i5836, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i5842 = load double* %tmp.8.i33599 ; <double> [#uses=1]
- store double %tmp.9.i5842, double* %tmp.7.i5840
- %tmp.0.i5843 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i5836, %"struct.std::dcomplex"* %ret3 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i5845 = getelementptr %"struct.std::dcomplex"* %tmp.0.i5843, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i5846 = load double* %tmp.14.i5845 ; <double> [#uses=1]
- %tmp.17.i5848 = getelementptr %"struct.std::dcomplex"* %tmp.0.i5843, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i5849 = load double* %tmp.17.i5848 ; <double> [#uses=1]
- %tmp.7.i5803 = load double* %tmp.2.i34366 ; <double> [#uses=1]
- %tmp.15.i5817 = add double %tmp.7.i5803, %tmp.15.i5846 ; <double> [#uses=1]
- store double %tmp.15.i5817, double* %tmp.2.i34366
- %tmp.26.i5824 = load double* %tmp.6.i34367 ; <double> [#uses=1]
- %tmp.31.i5835 = add double %tmp.26.i5824, %tmp.18.i5849 ; <double> [#uses=1]
- store double %tmp.31.i5835, double* %tmp.6.i34367
- %tmp.4.i5783 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i5782, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i5785 = load double* %tmp.5.i33272 ; <double> [#uses=1]
- store double %tmp.6.i5785, double* %tmp.4.i5783
- %tmp.7.i5786 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i5782, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i5788 = load double* %tmp.8.i33275 ; <double> [#uses=1]
- store double %tmp.9.i5788, double* %tmp.7.i5786
- %tmp.0.i5789 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i5782, %"struct.std::dcomplex"* %ret4 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i5791 = getelementptr %"struct.std::dcomplex"* %tmp.0.i5789, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i5792 = load double* %tmp.14.i5791 ; <double> [#uses=1]
- %tmp.17.i5794 = getelementptr %"struct.std::dcomplex"* %tmp.0.i5789, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i5795 = load double* %tmp.17.i5794 ; <double> [#uses=1]
- %tmp.7.i5749 = load double* %tmp.2.i34368 ; <double> [#uses=1]
- %tmp.15.i5763 = add double %tmp.7.i5749, %tmp.15.i5792 ; <double> [#uses=1]
- store double %tmp.15.i5763, double* %tmp.2.i34368
- %tmp.26.i5770 = load double* %tmp.6.i34369 ; <double> [#uses=1]
- %tmp.31.i5781 = add double %tmp.26.i5770, %tmp.18.i5795 ; <double> [#uses=1]
- store double %tmp.31.i5781, double* %tmp.6.i34369
- store double 0.000000e+00, double* %tmp.2.i34366
- store double 0.000000e+00, double* %tmp.6.i34367
- %tmp.4.i5727 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i5726, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.5.i5728 = getelementptr [6 x %"struct.std::dcomplex"]* %_m, i32 5, i32 3, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i5729 = load double* %tmp.5.i5728 ; <double> [#uses=1]
- store double %tmp.6.i5729, double* %tmp.4.i5727
- %tmp.7.i5730 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i5726, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.8.i5731 = getelementptr [6 x %"struct.std::dcomplex"]* %_m, i32 5, i32 3, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i5732 = load double* %tmp.8.i5731 ; <double> [#uses=1]
- store double %tmp.9.i5732, double* %tmp.7.i5730
- %tmp.0.i5733 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i5726, %"struct.std::dcomplex"* %ret5 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i5735 = getelementptr %"struct.std::dcomplex"* %tmp.0.i5733, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i5736 = load double* %tmp.14.i5735 ; <double> [#uses=1]
- %tmp.17.i5738 = getelementptr %"struct.std::dcomplex"* %tmp.0.i5733, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i5739 = load double* %tmp.17.i5738 ; <double> [#uses=1]
- %tmp.7.i5693 = load double* %tmp.2.i ; <double> [#uses=1]
- %tmp.15.i5707 = add double %tmp.7.i5693, %tmp.15.i5736 ; <double> [#uses=1]
- store double %tmp.15.i5707, double* %tmp.2.i
- %tmp.26.i5714 = load double* %tmp.6.i ; <double> [#uses=1]
- %tmp.31.i5725 = add double %tmp.26.i5714, %tmp.18.i5739 ; <double> [#uses=1]
- store double %tmp.31.i5725, double* %tmp.6.i
- store double 0.000000e+00, double* %tmp.2.i34368
- store double 0.000000e+00, double* %tmp.6.i34369
- %tmp.4.i5671 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i5670, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i5673 = load double* %tmp.5.i34352 ; <double> [#uses=1]
- store double %tmp.6.i5673, double* %tmp.4.i5671
- %tmp.7.i5674 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i5670, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i5676 = load double* %tmp.8.i34355 ; <double> [#uses=1]
- store double %tmp.9.i5676, double* %tmp.7.i5674
- %tmp.0.i5677 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i5670, %"struct.std::dcomplex"* %tmp.21 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i5679 = getelementptr %"struct.std::dcomplex"* %tmp.0.i5677, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i5680 = load double* %tmp.14.i5679 ; <double> [#uses=1]
- %tmp.17.i5682 = getelementptr %"struct.std::dcomplex"* %tmp.0.i5677, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i5683 = load double* %tmp.17.i5682 ; <double> [#uses=1]
- %tmp.4.i5657 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i5656, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i5659 = load double* %tmp.5.i34282 ; <double> [#uses=1]
- store double %tmp.6.i5659, double* %tmp.4.i5657
- %tmp.7.i5660 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i5656, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i5662 = load double* %tmp.8.i34285 ; <double> [#uses=1]
- store double %tmp.9.i5662, double* %tmp.7.i5660
- %tmp.0.i5663 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i5656, %"struct.std::dcomplex"* %tmp.12 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i5664 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1535, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i5665 = getelementptr %"struct.std::dcomplex"* %tmp.0.i5663, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i5666 = load double* %tmp.14.i5665 ; <double> [#uses=1]
- store double %tmp.15.i5666, double* %tmp.13.i5664
- %tmp.16.i5667 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1535, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i5668 = getelementptr %"struct.std::dcomplex"* %tmp.0.i5663, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i5669 = load double* %tmp.17.i5668 ; <double> [#uses=1]
- store double %tmp.18.i5669, double* %tmp.16.i5667
- %tmp.4.i5643 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i5642, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i5680, double* %tmp.4.i5643
- %tmp.7.i5646 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i5642, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i5683, double* %tmp.7.i5646
- %tmp.0.i5649 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i5642, %"struct.std::dcomplex"* %mem_tmp.1535 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i5651 = getelementptr %"struct.std::dcomplex"* %tmp.0.i5649, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i5652 = load double* %tmp.14.i5651 ; <double> [#uses=1]
- %tmp.17.i5654 = getelementptr %"struct.std::dcomplex"* %tmp.0.i5649, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i5655 = load double* %tmp.17.i5654 ; <double> [#uses=1]
- %tmp.4.i5629 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i5628, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i5652, double* %tmp.4.i5629
- %tmp.7.i5632 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i5628, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i5655, double* %tmp.7.i5632
- %tmp.0.i5635 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i5628, %"struct.std::dcomplex"* %tmp.1075 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i5637 = getelementptr %"struct.std::dcomplex"* %tmp.0.i5635, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i5638 = load double* %tmp.14.i5637 ; <double> [#uses=1]
- %tmp.17.i5640 = getelementptr %"struct.std::dcomplex"* %tmp.0.i5635, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i5641 = load double* %tmp.17.i5640 ; <double> [#uses=1]
- %tmp.4.i5615 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i5614, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i5617 = load double* %tmp.5.i34282 ; <double> [#uses=1]
- store double %tmp.6.i5617, double* %tmp.4.i5615
- %tmp.7.i5618 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i5614, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i5620 = load double* %tmp.8.i34285 ; <double> [#uses=1]
- store double %tmp.9.i5620, double* %tmp.7.i5618
- %tmp.0.i5621 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i5614, %"struct.std::dcomplex"* %tmp.1036 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i5623 = getelementptr %"struct.std::dcomplex"* %tmp.0.i5621, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i5624 = load double* %tmp.14.i5623 ; <double> [#uses=1]
- %tmp.17.i5626 = getelementptr %"struct.std::dcomplex"* %tmp.0.i5621, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i5627 = load double* %tmp.17.i5626 ; <double> [#uses=1]
- %tmp.4.i5601 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i5600, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i5603 = load double* %tmp.5.i28602 ; <double> [#uses=1]
- store double %tmp.6.i5603, double* %tmp.4.i5601
- %tmp.7.i5604 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i5600, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i5606 = load double* %tmp.8.i28605 ; <double> [#uses=1]
- store double %tmp.9.i5606, double* %tmp.7.i5604
- %tmp.0.i5607 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i5600, %"struct.std::dcomplex"* %tmp.21 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i5608 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1539, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i5609 = getelementptr %"struct.std::dcomplex"* %tmp.0.i5607, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i5610 = load double* %tmp.14.i5609 ; <double> [#uses=1]
- store double %tmp.15.i5610, double* %tmp.13.i5608
- %tmp.16.i5611 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1539, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i5612 = getelementptr %"struct.std::dcomplex"* %tmp.0.i5607, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i5613 = load double* %tmp.17.i5612 ; <double> [#uses=1]
- store double %tmp.18.i5613, double* %tmp.16.i5611
- %tmp.4.i5587 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i5586, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i5624, double* %tmp.4.i5587
- %tmp.7.i5590 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i5586, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i5627, double* %tmp.7.i5590
- %tmp.0.i5593 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i5586, %"struct.std::dcomplex"* %mem_tmp.1539 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i5595 = getelementptr %"struct.std::dcomplex"* %tmp.0.i5593, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i5596 = load double* %tmp.14.i5595 ; <double> [#uses=1]
- %tmp.17.i5598 = getelementptr %"struct.std::dcomplex"* %tmp.0.i5593, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i5599 = load double* %tmp.17.i5598 ; <double> [#uses=1]
- %tmp.4.i5573 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i5572, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i5596, double* %tmp.4.i5573
- %tmp.7.i5576 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i5572, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i5599, double* %tmp.7.i5576
- %tmp.0.i5579 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i5572, %"struct.std::dcomplex"* %tmp.30 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i5580 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1536, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i5581 = getelementptr %"struct.std::dcomplex"* %tmp.0.i5579, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i5582 = load double* %tmp.14.i5581 ; <double> [#uses=1]
- store double %tmp.15.i5582, double* %tmp.13.i5580
- %tmp.16.i5583 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1536, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i5584 = getelementptr %"struct.std::dcomplex"* %tmp.0.i5579, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i5585 = load double* %tmp.17.i5584 ; <double> [#uses=1]
- store double %tmp.18.i5585, double* %tmp.16.i5583
- %tmp.4.i5559 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i5558, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i5638, double* %tmp.4.i5559
- %tmp.7.i5562 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i5558, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i5641, double* %tmp.7.i5562
- %tmp.0.i5565 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i5558, %"struct.std::dcomplex"* %mem_tmp.1536 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i5567 = getelementptr %"struct.std::dcomplex"* %tmp.0.i5565, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i5568 = load double* %tmp.14.i5567 ; <double> [#uses=1]
- %tmp.17.i5570 = getelementptr %"struct.std::dcomplex"* %tmp.0.i5565, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i5571 = load double* %tmp.17.i5570 ; <double> [#uses=1]
- %tmp.4.i5545 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i5544, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i5547 = load double* %tmp.5.i28602 ; <double> [#uses=1]
- store double %tmp.6.i5547, double* %tmp.4.i5545
- %tmp.7.i5548 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i5544, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i5550 = load double* %tmp.8.i28605 ; <double> [#uses=1]
- store double %tmp.9.i5550, double* %tmp.7.i5548
- %tmp.0.i5551 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i5544, %"struct.std::dcomplex"* %tmp.12 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i5553 = getelementptr %"struct.std::dcomplex"* %tmp.0.i5551, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i5554 = load double* %tmp.14.i5553 ; <double> [#uses=1]
- %tmp.17.i5556 = getelementptr %"struct.std::dcomplex"* %tmp.0.i5551, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i5557 = load double* %tmp.17.i5556 ; <double> [#uses=1]
- %tmp.4.i5531 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i5530, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i5533 = load double* %tmp.5.i34352 ; <double> [#uses=1]
- store double %tmp.6.i5533, double* %tmp.4.i5531
- %tmp.7.i5534 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i5530, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i5536 = load double* %tmp.8.i34355 ; <double> [#uses=1]
- store double %tmp.9.i5536, double* %tmp.7.i5534
- %tmp.0.i5537 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i5530, %"struct.std::dcomplex"* %tmp.1036 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i5538 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1543, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i5539 = getelementptr %"struct.std::dcomplex"* %tmp.0.i5537, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i5540 = load double* %tmp.14.i5539 ; <double> [#uses=1]
- store double %tmp.15.i5540, double* %tmp.13.i5538
- %tmp.16.i5541 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1543, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i5542 = getelementptr %"struct.std::dcomplex"* %tmp.0.i5537, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i5543 = load double* %tmp.17.i5542 ; <double> [#uses=1]
- store double %tmp.18.i5543, double* %tmp.16.i5541
- %tmp.4.i5517 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i5516, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i5554, double* %tmp.4.i5517
- %tmp.7.i5520 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i5516, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i5557, double* %tmp.7.i5520
- %tmp.0.i5523 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i5516, %"struct.std::dcomplex"* %mem_tmp.1543 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i5525 = getelementptr %"struct.std::dcomplex"* %tmp.0.i5523, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i5526 = load double* %tmp.14.i5525 ; <double> [#uses=1]
- %tmp.17.i5528 = getelementptr %"struct.std::dcomplex"* %tmp.0.i5523, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i5529 = load double* %tmp.17.i5528 ; <double> [#uses=1]
- %tmp.4.i5503 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i5502, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i5526, double* %tmp.4.i5503
- %tmp.7.i5506 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i5502, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i5529, double* %tmp.7.i5506
- %tmp.0.i5509 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i5502, %"struct.std::dcomplex"* %tmp.15 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i5510 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1540, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i5511 = getelementptr %"struct.std::dcomplex"* %tmp.0.i5509, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i5512 = load double* %tmp.14.i5511 ; <double> [#uses=1]
- store double %tmp.15.i5512, double* %tmp.13.i5510
- %tmp.16.i5513 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1540, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i5514 = getelementptr %"struct.std::dcomplex"* %tmp.0.i5509, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i5515 = load double* %tmp.17.i5514 ; <double> [#uses=1]
- store double %tmp.18.i5515, double* %tmp.16.i5513
- %tmp.4.i5489 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i5488, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i5568, double* %tmp.4.i5489
- %tmp.7.i5492 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i5488, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i5571, double* %tmp.7.i5492
- %tmp.0.i5495 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i5488, %"struct.std::dcomplex"* %mem_tmp.1540 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i5497 = getelementptr %"struct.std::dcomplex"* %tmp.0.i5495, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i5498 = load double* %tmp.14.i5497 ; <double> [#uses=1]
- %tmp.17.i5500 = getelementptr %"struct.std::dcomplex"* %tmp.0.i5495, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i5501 = load double* %tmp.17.i5500 ; <double> [#uses=1]
- store double %tmp.15.i5498, double* %tmp.2.i34364
- store double %tmp.18.i5501, double* %tmp.6.i34365
- %tmp.4.i5455 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i5454, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i5457 = load double* %tmp.5.i33596 ; <double> [#uses=1]
- store double %tmp.6.i5457, double* %tmp.4.i5455
- %tmp.7.i5458 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i5454, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i5460 = load double* %tmp.8.i33599 ; <double> [#uses=1]
- store double %tmp.9.i5460, double* %tmp.7.i5458
- %tmp.0.i5461 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i5454, %"struct.std::dcomplex"* %ret3 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i5463 = getelementptr %"struct.std::dcomplex"* %tmp.0.i5461, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i5464 = load double* %tmp.14.i5463 ; <double> [#uses=1]
- %tmp.17.i5466 = getelementptr %"struct.std::dcomplex"* %tmp.0.i5461, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i5467 = load double* %tmp.17.i5466 ; <double> [#uses=1]
- %tmp.7.i5421 = load double* %tmp.2.i34366 ; <double> [#uses=1]
- %tmp.15.i5435 = add double %tmp.7.i5421, %tmp.15.i5464 ; <double> [#uses=1]
- store double %tmp.15.i5435, double* %tmp.2.i34366
- %tmp.26.i5442 = load double* %tmp.6.i34367 ; <double> [#uses=1]
- %tmp.31.i5453 = add double %tmp.26.i5442, %tmp.18.i5467 ; <double> [#uses=1]
- store double %tmp.31.i5453, double* %tmp.6.i34367
- %tmp.4.i5401 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i5400, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i5403 = load double* %tmp.5.i34352 ; <double> [#uses=1]
- store double %tmp.6.i5403, double* %tmp.4.i5401
- %tmp.7.i5404 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i5400, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i5406 = load double* %tmp.8.i34355 ; <double> [#uses=1]
- store double %tmp.9.i5406, double* %tmp.7.i5404
- %tmp.0.i5407 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i5400, %"struct.std::dcomplex"* %tmp.1036 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i5409 = getelementptr %"struct.std::dcomplex"* %tmp.0.i5407, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i5410 = load double* %tmp.14.i5409 ; <double> [#uses=1]
- %tmp.17.i5412 = getelementptr %"struct.std::dcomplex"* %tmp.0.i5407, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i5413 = load double* %tmp.17.i5412 ; <double> [#uses=1]
- %tmp.4.i5387 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i5386, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i5389 = load double* %tmp.5.i28602 ; <double> [#uses=1]
- store double %tmp.6.i5389, double* %tmp.4.i5387
- %tmp.7.i5390 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i5386, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i5392 = load double* %tmp.8.i28605 ; <double> [#uses=1]
- store double %tmp.9.i5392, double* %tmp.7.i5390
- %tmp.0.i5393 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i5386, %"struct.std::dcomplex"* %tmp.12 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i5394 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1550, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i5395 = getelementptr %"struct.std::dcomplex"* %tmp.0.i5393, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i5396 = load double* %tmp.14.i5395 ; <double> [#uses=1]
- store double %tmp.15.i5396, double* %tmp.13.i5394
- %tmp.16.i5397 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1550, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i5398 = getelementptr %"struct.std::dcomplex"* %tmp.0.i5393, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i5399 = load double* %tmp.17.i5398 ; <double> [#uses=1]
- store double %tmp.18.i5399, double* %tmp.16.i5397
- %tmp.4.i5373 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i5372, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i5410, double* %tmp.4.i5373
- %tmp.7.i5376 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i5372, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i5413, double* %tmp.7.i5376
- %tmp.0.i5379 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i5372, %"struct.std::dcomplex"* %mem_tmp.1550 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i5381 = getelementptr %"struct.std::dcomplex"* %tmp.0.i5379, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i5382 = load double* %tmp.14.i5381 ; <double> [#uses=1]
- %tmp.17.i5384 = getelementptr %"struct.std::dcomplex"* %tmp.0.i5379, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i5385 = load double* %tmp.17.i5384 ; <double> [#uses=1]
- %tmp.4.i5359 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i5358, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i5382, double* %tmp.4.i5359
- %tmp.7.i5362 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i5358, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i5385, double* %tmp.7.i5362
- %tmp.0.i5365 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i5358, %"struct.std::dcomplex"* %tmp.45 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i5367 = getelementptr %"struct.std::dcomplex"* %tmp.0.i5365, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i5368 = load double* %tmp.14.i5367 ; <double> [#uses=1]
- %tmp.17.i5370 = getelementptr %"struct.std::dcomplex"* %tmp.0.i5365, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i5371 = load double* %tmp.17.i5370 ; <double> [#uses=1]
- %tmp.4.i5345 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i5344, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i5347 = load double* %tmp.5.i34338 ; <double> [#uses=1]
- store double %tmp.6.i5347, double* %tmp.4.i5345
- %tmp.7.i5348 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i5344, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i5350 = load double* %tmp.8.i34341 ; <double> [#uses=1]
- store double %tmp.9.i5350, double* %tmp.7.i5348
- %tmp.0.i5351 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i5344, %"struct.std::dcomplex"* %tmp.12 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i5353 = getelementptr %"struct.std::dcomplex"* %tmp.0.i5351, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i5354 = load double* %tmp.14.i5353 ; <double> [#uses=1]
- %tmp.17.i5356 = getelementptr %"struct.std::dcomplex"* %tmp.0.i5351, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i5357 = load double* %tmp.17.i5356 ; <double> [#uses=1]
- %tmp.4.i5331 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i5330, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i5333 = load double* %tmp.5.i34352 ; <double> [#uses=1]
- store double %tmp.6.i5333, double* %tmp.4.i5331
- %tmp.7.i5334 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i5330, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i5336 = load double* %tmp.8.i34355 ; <double> [#uses=1]
- store double %tmp.9.i5336, double* %tmp.7.i5334
- %tmp.0.i5337 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i5330, %"struct.std::dcomplex"* %tmp.6 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i5338 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1554, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i5339 = getelementptr %"struct.std::dcomplex"* %tmp.0.i5337, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i5340 = load double* %tmp.14.i5339 ; <double> [#uses=1]
- store double %tmp.15.i5340, double* %tmp.13.i5338
- %tmp.16.i5341 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1554, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i5342 = getelementptr %"struct.std::dcomplex"* %tmp.0.i5337, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i5343 = load double* %tmp.17.i5342 ; <double> [#uses=1]
- store double %tmp.18.i5343, double* %tmp.16.i5341
- %tmp.4.i5317 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i5316, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i5354, double* %tmp.4.i5317
- %tmp.7.i5320 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i5316, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i5357, double* %tmp.7.i5320
- %tmp.0.i5323 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i5316, %"struct.std::dcomplex"* %mem_tmp.1554 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i5325 = getelementptr %"struct.std::dcomplex"* %tmp.0.i5323, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i5326 = load double* %tmp.14.i5325 ; <double> [#uses=1]
- %tmp.17.i5328 = getelementptr %"struct.std::dcomplex"* %tmp.0.i5323, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i5329 = load double* %tmp.17.i5328 ; <double> [#uses=1]
- %tmp.4.i5303 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i5302, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i5326, double* %tmp.4.i5303
- %tmp.7.i5306 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i5302, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i5329, double* %tmp.7.i5306
- %tmp.0.i5309 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i5302, %"struct.std::dcomplex"* %tmp.1075 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i5310 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1551, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i5311 = getelementptr %"struct.std::dcomplex"* %tmp.0.i5309, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i5312 = load double* %tmp.14.i5311 ; <double> [#uses=1]
- store double %tmp.15.i5312, double* %tmp.13.i5310
- %tmp.16.i5313 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1551, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i5314 = getelementptr %"struct.std::dcomplex"* %tmp.0.i5309, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i5315 = load double* %tmp.17.i5314 ; <double> [#uses=1]
- store double %tmp.18.i5315, double* %tmp.16.i5313
- %tmp.4.i5289 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i5288, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i5368, double* %tmp.4.i5289
- %tmp.7.i5292 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i5288, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i5371, double* %tmp.7.i5292
- %tmp.0.i5295 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i5288, %"struct.std::dcomplex"* %mem_tmp.1551 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i5297 = getelementptr %"struct.std::dcomplex"* %tmp.0.i5295, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i5298 = load double* %tmp.14.i5297 ; <double> [#uses=1]
- %tmp.17.i5300 = getelementptr %"struct.std::dcomplex"* %tmp.0.i5295, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i5301 = load double* %tmp.17.i5300 ; <double> [#uses=1]
- %tmp.4.i5275 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i5274, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i5277 = load double* %tmp.5.i28602 ; <double> [#uses=1]
- store double %tmp.6.i5277, double* %tmp.4.i5275
- %tmp.7.i5278 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i5274, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i5280 = load double* %tmp.8.i28605 ; <double> [#uses=1]
- store double %tmp.9.i5280, double* %tmp.7.i5278
- %tmp.0.i5281 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i5274, %"struct.std::dcomplex"* %tmp.6 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i5283 = getelementptr %"struct.std::dcomplex"* %tmp.0.i5281, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i5284 = load double* %tmp.14.i5283 ; <double> [#uses=1]
- %tmp.17.i5286 = getelementptr %"struct.std::dcomplex"* %tmp.0.i5281, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i5287 = load double* %tmp.17.i5286 ; <double> [#uses=1]
- %tmp.4.i5261 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i5260, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i5263 = load double* %tmp.5.i34338 ; <double> [#uses=1]
- store double %tmp.6.i5263, double* %tmp.4.i5261
- %tmp.7.i5264 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i5260, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i5266 = load double* %tmp.8.i34341 ; <double> [#uses=1]
- store double %tmp.9.i5266, double* %tmp.7.i5264
- %tmp.0.i5267 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i5260, %"struct.std::dcomplex"* %tmp.1036 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i5268 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1558, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i5269 = getelementptr %"struct.std::dcomplex"* %tmp.0.i5267, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i5270 = load double* %tmp.14.i5269 ; <double> [#uses=1]
- store double %tmp.15.i5270, double* %tmp.13.i5268
- %tmp.16.i5271 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1558, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i5272 = getelementptr %"struct.std::dcomplex"* %tmp.0.i5267, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i5273 = load double* %tmp.17.i5272 ; <double> [#uses=1]
- store double %tmp.18.i5273, double* %tmp.16.i5271
- %tmp.4.i5247 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i5246, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i5284, double* %tmp.4.i5247
- %tmp.7.i5250 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i5246, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i5287, double* %tmp.7.i5250
- %tmp.0.i5253 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i5246, %"struct.std::dcomplex"* %mem_tmp.1558 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i5255 = getelementptr %"struct.std::dcomplex"* %tmp.0.i5253, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i5256 = load double* %tmp.14.i5255 ; <double> [#uses=1]
- %tmp.17.i5258 = getelementptr %"struct.std::dcomplex"* %tmp.0.i5253, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i5259 = load double* %tmp.17.i5258 ; <double> [#uses=1]
- %tmp.4.i5233 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i5232, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i5256, double* %tmp.4.i5233
- %tmp.7.i5236 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i5232, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i5259, double* %tmp.7.i5236
- %tmp.0.i5239 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i5232, %"struct.std::dcomplex"* %tmp.30 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i5240 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1555, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i5241 = getelementptr %"struct.std::dcomplex"* %tmp.0.i5239, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i5242 = load double* %tmp.14.i5241 ; <double> [#uses=1]
- store double %tmp.15.i5242, double* %tmp.13.i5240
- %tmp.16.i5243 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1555, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i5244 = getelementptr %"struct.std::dcomplex"* %tmp.0.i5239, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i5245 = load double* %tmp.17.i5244 ; <double> [#uses=1]
- store double %tmp.18.i5245, double* %tmp.16.i5243
- %tmp.4.i5219 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i5218, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i5298, double* %tmp.4.i5219
- %tmp.7.i5222 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i5218, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i5301, double* %tmp.7.i5222
- %tmp.0.i5225 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i5218, %"struct.std::dcomplex"* %mem_tmp.1555 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i5227 = getelementptr %"struct.std::dcomplex"* %tmp.0.i5225, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i5228 = load double* %tmp.14.i5227 ; <double> [#uses=1]
- %tmp.17.i5230 = getelementptr %"struct.std::dcomplex"* %tmp.0.i5225, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i5231 = load double* %tmp.17.i5230 ; <double> [#uses=1]
- store double %tmp.15.i5228, double* %tmp.2.i34364
- store double %tmp.18.i5231, double* %tmp.6.i34365
- %tmp.4.i5185 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i5184, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i5187 = load double* %tmp.5.i33326 ; <double> [#uses=1]
- store double %tmp.6.i5187, double* %tmp.4.i5185
- %tmp.7.i5188 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i5184, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i5190 = load double* %tmp.8.i33329 ; <double> [#uses=1]
- store double %tmp.9.i5190, double* %tmp.7.i5188
- %tmp.0.i5191 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i5184, %"struct.std::dcomplex"* %ret3 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i5193 = getelementptr %"struct.std::dcomplex"* %tmp.0.i5191, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i5194 = load double* %tmp.14.i5193 ; <double> [#uses=1]
- %tmp.17.i5196 = getelementptr %"struct.std::dcomplex"* %tmp.0.i5191, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i5197 = load double* %tmp.17.i5196 ; <double> [#uses=1]
- %tmp.7.i5151 = load double* %tmp.2.i34366 ; <double> [#uses=1]
- %tmp.15.i5165 = add double %tmp.7.i5151, %tmp.15.i5194 ; <double> [#uses=1]
- store double %tmp.15.i5165, double* %tmp.2.i34366
- %tmp.26.i5172 = load double* %tmp.6.i34367 ; <double> [#uses=1]
- %tmp.31.i5183 = add double %tmp.26.i5172, %tmp.18.i5197 ; <double> [#uses=1]
- store double %tmp.31.i5183, double* %tmp.6.i34367
- %tmp.4.i5131 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i5130, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i5133 = load double* %tmp.5.i34338 ; <double> [#uses=1]
- store double %tmp.6.i5133, double* %tmp.4.i5131
- %tmp.7.i5134 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i5130, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i5136 = load double* %tmp.8.i34341 ; <double> [#uses=1]
- store double %tmp.9.i5136, double* %tmp.7.i5134
- %tmp.0.i5137 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i5130, %"struct.std::dcomplex"* %tmp.21 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i5139 = getelementptr %"struct.std::dcomplex"* %tmp.0.i5137, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i5140 = load double* %tmp.14.i5139 ; <double> [#uses=1]
- %tmp.17.i5142 = getelementptr %"struct.std::dcomplex"* %tmp.0.i5137, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i5143 = load double* %tmp.17.i5142 ; <double> [#uses=1]
- %tmp.4.i5117 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i5116, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i5119 = load double* %tmp.5.i34282 ; <double> [#uses=1]
- store double %tmp.6.i5119, double* %tmp.4.i5117
- %tmp.7.i5120 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i5116, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i5122 = load double* %tmp.8.i34285 ; <double> [#uses=1]
- store double %tmp.9.i5122, double* %tmp.7.i5120
- %tmp.0.i5123 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i5116, %"struct.std::dcomplex"* %tmp.6 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i5124 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1565, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i5125 = getelementptr %"struct.std::dcomplex"* %tmp.0.i5123, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i5126 = load double* %tmp.14.i5125 ; <double> [#uses=1]
- store double %tmp.15.i5126, double* %tmp.13.i5124
- %tmp.16.i5127 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1565, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i5128 = getelementptr %"struct.std::dcomplex"* %tmp.0.i5123, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i5129 = load double* %tmp.17.i5128 ; <double> [#uses=1]
- store double %tmp.18.i5129, double* %tmp.16.i5127
- %tmp.4.i5103 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i5102, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i5140, double* %tmp.4.i5103
- %tmp.7.i5106 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i5102, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i5143, double* %tmp.7.i5106
- %tmp.0.i5109 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i5102, %"struct.std::dcomplex"* %mem_tmp.1565 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i5111 = getelementptr %"struct.std::dcomplex"* %tmp.0.i5109, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i5112 = load double* %tmp.14.i5111 ; <double> [#uses=1]
- %tmp.17.i5114 = getelementptr %"struct.std::dcomplex"* %tmp.0.i5109, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i5115 = load double* %tmp.17.i5114 ; <double> [#uses=1]
- %tmp.4.i5089 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i5088, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i5112, double* %tmp.4.i5089
- %tmp.7.i5092 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i5088, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i5115, double* %tmp.7.i5092
- %tmp.0.i5095 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i5088, %"struct.std::dcomplex"* %tmp.30 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i5097 = getelementptr %"struct.std::dcomplex"* %tmp.0.i5095, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i5098 = load double* %tmp.14.i5097 ; <double> [#uses=1]
- %tmp.17.i5100 = getelementptr %"struct.std::dcomplex"* %tmp.0.i5095, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i5101 = load double* %tmp.17.i5100 ; <double> [#uses=1]
- %tmp.4.i5075 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i5074, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i5077 = load double* %tmp.5.i34282 ; <double> [#uses=1]
- store double %tmp.6.i5077, double* %tmp.4.i5075
- %tmp.7.i5078 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i5074, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i5080 = load double* %tmp.8.i34285 ; <double> [#uses=1]
- store double %tmp.9.i5080, double* %tmp.7.i5078
- %tmp.0.i5081 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i5074, %"struct.std::dcomplex"* %tmp.12 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i5083 = getelementptr %"struct.std::dcomplex"* %tmp.0.i5081, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i5084 = load double* %tmp.14.i5083 ; <double> [#uses=1]
- %tmp.17.i5086 = getelementptr %"struct.std::dcomplex"* %tmp.0.i5081, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i5087 = load double* %tmp.17.i5086 ; <double> [#uses=1]
- %tmp.4.i5061 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i5060, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i5063 = load double* %tmp.5.i34352 ; <double> [#uses=1]
- store double %tmp.6.i5063, double* %tmp.4.i5061
- %tmp.7.i5064 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i5060, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i5066 = load double* %tmp.8.i34355 ; <double> [#uses=1]
- store double %tmp.9.i5066, double* %tmp.7.i5064
- %tmp.0.i5067 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i5060, %"struct.std::dcomplex"* %tmp.21 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i5068 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1569, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i5069 = getelementptr %"struct.std::dcomplex"* %tmp.0.i5067, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i5070 = load double* %tmp.14.i5069 ; <double> [#uses=1]
- store double %tmp.15.i5070, double* %tmp.13.i5068
- %tmp.16.i5071 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1569, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i5072 = getelementptr %"struct.std::dcomplex"* %tmp.0.i5067, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i5073 = load double* %tmp.17.i5072 ; <double> [#uses=1]
- store double %tmp.18.i5073, double* %tmp.16.i5071
- %tmp.4.i5047 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i5046, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i5084, double* %tmp.4.i5047
- %tmp.7.i5050 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i5046, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i5087, double* %tmp.7.i5050
- %tmp.0.i5053 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i5046, %"struct.std::dcomplex"* %mem_tmp.1569 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i5055 = getelementptr %"struct.std::dcomplex"* %tmp.0.i5053, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i5056 = load double* %tmp.14.i5055 ; <double> [#uses=1]
- %tmp.17.i5058 = getelementptr %"struct.std::dcomplex"* %tmp.0.i5053, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i5059 = load double* %tmp.17.i5058 ; <double> [#uses=1]
- %tmp.4.i5033 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i5032, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i5056, double* %tmp.4.i5033
- %tmp.7.i5036 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i5032, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i5059, double* %tmp.7.i5036
- %tmp.0.i5039 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i5032, %"struct.std::dcomplex"* %tmp.45 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i5040 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1566, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i5041 = getelementptr %"struct.std::dcomplex"* %tmp.0.i5039, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i5042 = load double* %tmp.14.i5041 ; <double> [#uses=1]
- store double %tmp.15.i5042, double* %tmp.13.i5040
- %tmp.16.i5043 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1566, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i5044 = getelementptr %"struct.std::dcomplex"* %tmp.0.i5039, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i5045 = load double* %tmp.17.i5044 ; <double> [#uses=1]
- store double %tmp.18.i5045, double* %tmp.16.i5043
- %tmp.4.i5019 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i5018, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i5098, double* %tmp.4.i5019
- %tmp.7.i5022 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i5018, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i5101, double* %tmp.7.i5022
- %tmp.0.i5025 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i5018, %"struct.std::dcomplex"* %mem_tmp.1566 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i5027 = getelementptr %"struct.std::dcomplex"* %tmp.0.i5025, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i5028 = load double* %tmp.14.i5027 ; <double> [#uses=1]
- %tmp.17.i5030 = getelementptr %"struct.std::dcomplex"* %tmp.0.i5025, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i5031 = load double* %tmp.17.i5030 ; <double> [#uses=1]
- %tmp.4.i5005 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i5004, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i5007 = load double* %tmp.5.i34352 ; <double> [#uses=1]
- store double %tmp.6.i5007, double* %tmp.4.i5005
- %tmp.7.i5008 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i5004, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i5010 = load double* %tmp.8.i34355 ; <double> [#uses=1]
- store double %tmp.9.i5010, double* %tmp.7.i5008
- %tmp.0.i5011 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i5004, %"struct.std::dcomplex"* %tmp.6 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i5013 = getelementptr %"struct.std::dcomplex"* %tmp.0.i5011, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i5014 = load double* %tmp.14.i5013 ; <double> [#uses=1]
- %tmp.17.i5016 = getelementptr %"struct.std::dcomplex"* %tmp.0.i5011, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i5017 = load double* %tmp.17.i5016 ; <double> [#uses=1]
- %tmp.4.i4991 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i4990, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i4993 = load double* %tmp.5.i34338 ; <double> [#uses=1]
- store double %tmp.6.i4993, double* %tmp.4.i4991
- %tmp.7.i4994 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i4990, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i4996 = load double* %tmp.8.i34341 ; <double> [#uses=1]
- store double %tmp.9.i4996, double* %tmp.7.i4994
- %tmp.0.i4997 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i4990, %"struct.std::dcomplex"* %tmp.12 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i4998 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1573, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i4999 = getelementptr %"struct.std::dcomplex"* %tmp.0.i4997, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i5000 = load double* %tmp.14.i4999 ; <double> [#uses=1]
- store double %tmp.15.i5000, double* %tmp.13.i4998
- %tmp.16.i5001 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1573, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i5002 = getelementptr %"struct.std::dcomplex"* %tmp.0.i4997, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i5003 = load double* %tmp.17.i5002 ; <double> [#uses=1]
- store double %tmp.18.i5003, double* %tmp.16.i5001
- %tmp.4.i4977 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i4976, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i5014, double* %tmp.4.i4977
- %tmp.7.i4980 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i4976, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i5017, double* %tmp.7.i4980
- %tmp.0.i4983 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i4976, %"struct.std::dcomplex"* %mem_tmp.1573 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i4985 = getelementptr %"struct.std::dcomplex"* %tmp.0.i4983, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i4986 = load double* %tmp.14.i4985 ; <double> [#uses=1]
- %tmp.17.i4988 = getelementptr %"struct.std::dcomplex"* %tmp.0.i4983, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i4989 = load double* %tmp.17.i4988 ; <double> [#uses=1]
- %tmp.4.i4963 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i4962, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i4986, double* %tmp.4.i4963
- %tmp.7.i4966 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i4962, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i4989, double* %tmp.7.i4966
- %tmp.0.i4969 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i4962, %"struct.std::dcomplex"* %tmp.15 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i4970 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1570, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i4971 = getelementptr %"struct.std::dcomplex"* %tmp.0.i4969, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i4972 = load double* %tmp.14.i4971 ; <double> [#uses=1]
- store double %tmp.15.i4972, double* %tmp.13.i4970
- %tmp.16.i4973 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1570, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i4974 = getelementptr %"struct.std::dcomplex"* %tmp.0.i4969, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i4975 = load double* %tmp.17.i4974 ; <double> [#uses=1]
- store double %tmp.18.i4975, double* %tmp.16.i4973
- %tmp.4.i4949 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i4948, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i5028, double* %tmp.4.i4949
- %tmp.7.i4952 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i4948, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i5031, double* %tmp.7.i4952
- %tmp.0.i4955 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i4948, %"struct.std::dcomplex"* %mem_tmp.1570 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i4957 = getelementptr %"struct.std::dcomplex"* %tmp.0.i4955, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i4958 = load double* %tmp.14.i4957 ; <double> [#uses=1]
- %tmp.17.i4960 = getelementptr %"struct.std::dcomplex"* %tmp.0.i4955, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i4961 = load double* %tmp.17.i4960 ; <double> [#uses=1]
- store double %tmp.15.i4958, double* %tmp.2.i34364
- store double %tmp.18.i4961, double* %tmp.6.i34365
- %tmp.4.i4915 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i4914, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i4917 = load double* %tmp.5.i27590 ; <double> [#uses=1]
- store double %tmp.6.i4917, double* %tmp.4.i4915
- %tmp.7.i4918 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i4914, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i4920 = load double* %tmp.8.i27593 ; <double> [#uses=1]
- store double %tmp.9.i4920, double* %tmp.7.i4918
- %tmp.0.i4921 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i4914, %"struct.std::dcomplex"* %ret3 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i4923 = getelementptr %"struct.std::dcomplex"* %tmp.0.i4921, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i4924 = load double* %tmp.14.i4923 ; <double> [#uses=1]
- %tmp.17.i4926 = getelementptr %"struct.std::dcomplex"* %tmp.0.i4921, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i4927 = load double* %tmp.17.i4926 ; <double> [#uses=1]
- %tmp.7.i4881 = load double* %tmp.2.i34366 ; <double> [#uses=1]
- %tmp.15.i4895 = add double %tmp.7.i4881, %tmp.15.i4924 ; <double> [#uses=1]
- store double %tmp.15.i4895, double* %tmp.2.i34366
- %tmp.26.i4902 = load double* %tmp.6.i34367 ; <double> [#uses=1]
- %tmp.31.i4913 = add double %tmp.26.i4902, %tmp.18.i4927 ; <double> [#uses=1]
- store double %tmp.31.i4913, double* %tmp.6.i34367
- %tmp.4.i4861 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i4860, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i4863 = load double* %tmp.5.i34338 ; <double> [#uses=1]
- store double %tmp.6.i4863, double* %tmp.4.i4861
- %tmp.7.i4864 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i4860, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i4866 = load double* %tmp.8.i34341 ; <double> [#uses=1]
- store double %tmp.9.i4866, double* %tmp.7.i4864
- %tmp.0.i4867 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i4860, %"struct.std::dcomplex"* %tmp.1036 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i4869 = getelementptr %"struct.std::dcomplex"* %tmp.0.i4867, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i4870 = load double* %tmp.14.i4869 ; <double> [#uses=1]
- %tmp.17.i4872 = getelementptr %"struct.std::dcomplex"* %tmp.0.i4867, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i4873 = load double* %tmp.17.i4872 ; <double> [#uses=1]
- %tmp.4.i4847 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i4846, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i4849 = load double* %tmp.5.i28602 ; <double> [#uses=1]
- store double %tmp.6.i4849, double* %tmp.4.i4847
- %tmp.7.i4850 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i4846, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i4852 = load double* %tmp.8.i28605 ; <double> [#uses=1]
- store double %tmp.9.i4852, double* %tmp.7.i4850
- %tmp.0.i4853 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i4846, %"struct.std::dcomplex"* %tmp.6 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i4854 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1580, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i4855 = getelementptr %"struct.std::dcomplex"* %tmp.0.i4853, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i4856 = load double* %tmp.14.i4855 ; <double> [#uses=1]
- store double %tmp.15.i4856, double* %tmp.13.i4854
- %tmp.16.i4857 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1580, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i4858 = getelementptr %"struct.std::dcomplex"* %tmp.0.i4853, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i4859 = load double* %tmp.17.i4858 ; <double> [#uses=1]
- store double %tmp.18.i4859, double* %tmp.16.i4857
- %tmp.4.i4833 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i4832, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i4870, double* %tmp.4.i4833
- %tmp.7.i4836 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i4832, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i4873, double* %tmp.7.i4836
- %tmp.0.i4839 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i4832, %"struct.std::dcomplex"* %mem_tmp.1580 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i4841 = getelementptr %"struct.std::dcomplex"* %tmp.0.i4839, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i4842 = load double* %tmp.14.i4841 ; <double> [#uses=1]
- %tmp.17.i4844 = getelementptr %"struct.std::dcomplex"* %tmp.0.i4839, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i4845 = load double* %tmp.17.i4844 ; <double> [#uses=1]
- %tmp.4.i4819 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i4818, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i4842, double* %tmp.4.i4819
- %tmp.7.i4822 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i4818, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i4845, double* %tmp.7.i4822
- %tmp.0.i4825 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i4818, %"struct.std::dcomplex"* %tmp.15 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i4827 = getelementptr %"struct.std::dcomplex"* %tmp.0.i4825, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i4828 = load double* %tmp.14.i4827 ; <double> [#uses=1]
- %tmp.17.i4830 = getelementptr %"struct.std::dcomplex"* %tmp.0.i4825, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i4831 = load double* %tmp.17.i4830 ; <double> [#uses=1]
- %tmp.4.i4805 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i4804, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i4807 = load double* %tmp.5.i34282 ; <double> [#uses=1]
- store double %tmp.6.i4807, double* %tmp.4.i4805
- %tmp.7.i4808 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i4804, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i4810 = load double* %tmp.8.i34285 ; <double> [#uses=1]
- store double %tmp.9.i4810, double* %tmp.7.i4808
- %tmp.0.i4811 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i4804, %"struct.std::dcomplex"* %tmp.6 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i4813 = getelementptr %"struct.std::dcomplex"* %tmp.0.i4811, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i4814 = load double* %tmp.14.i4813 ; <double> [#uses=1]
- %tmp.17.i4816 = getelementptr %"struct.std::dcomplex"* %tmp.0.i4811, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i4817 = load double* %tmp.17.i4816 ; <double> [#uses=1]
- %tmp.4.i4791 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i4790, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i4793 = load double* %tmp.5.i34338 ; <double> [#uses=1]
- store double %tmp.6.i4793, double* %tmp.4.i4791
- %tmp.7.i4794 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i4790, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i4796 = load double* %tmp.8.i34341 ; <double> [#uses=1]
- store double %tmp.9.i4796, double* %tmp.7.i4794
- %tmp.0.i4797 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i4790, %"struct.std::dcomplex"* %tmp.21 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i4798 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1584, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i4799 = getelementptr %"struct.std::dcomplex"* %tmp.0.i4797, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i4800 = load double* %tmp.14.i4799 ; <double> [#uses=1]
- store double %tmp.15.i4800, double* %tmp.13.i4798
- %tmp.16.i4801 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1584, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i4802 = getelementptr %"struct.std::dcomplex"* %tmp.0.i4797, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i4803 = load double* %tmp.17.i4802 ; <double> [#uses=1]
- store double %tmp.18.i4803, double* %tmp.16.i4801
- %tmp.4.i4777 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i4776, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i4814, double* %tmp.4.i4777
- %tmp.7.i4780 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i4776, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i4817, double* %tmp.7.i4780
- %tmp.0.i4783 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i4776, %"struct.std::dcomplex"* %mem_tmp.1584 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i4785 = getelementptr %"struct.std::dcomplex"* %tmp.0.i4783, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i4786 = load double* %tmp.14.i4785 ; <double> [#uses=1]
- %tmp.17.i4788 = getelementptr %"struct.std::dcomplex"* %tmp.0.i4783, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i4789 = load double* %tmp.17.i4788 ; <double> [#uses=1]
- %tmp.4.i4763 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i4762, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i4786, double* %tmp.4.i4763
- %tmp.7.i4766 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i4762, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i4789, double* %tmp.7.i4766
- %tmp.0.i4769 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i4762, %"struct.std::dcomplex"* %tmp.1075 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i4770 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1581, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i4771 = getelementptr %"struct.std::dcomplex"* %tmp.0.i4769, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i4772 = load double* %tmp.14.i4771 ; <double> [#uses=1]
- store double %tmp.15.i4772, double* %tmp.13.i4770
- %tmp.16.i4773 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1581, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i4774 = getelementptr %"struct.std::dcomplex"* %tmp.0.i4769, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i4775 = load double* %tmp.17.i4774 ; <double> [#uses=1]
- store double %tmp.18.i4775, double* %tmp.16.i4773
- %tmp.4.i4749 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i4748, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i4828, double* %tmp.4.i4749
- %tmp.7.i4752 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i4748, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i4831, double* %tmp.7.i4752
- %tmp.0.i4755 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i4748, %"struct.std::dcomplex"* %mem_tmp.1581 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i4757 = getelementptr %"struct.std::dcomplex"* %tmp.0.i4755, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i4758 = load double* %tmp.14.i4757 ; <double> [#uses=1]
- %tmp.17.i4760 = getelementptr %"struct.std::dcomplex"* %tmp.0.i4755, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i4761 = load double* %tmp.17.i4760 ; <double> [#uses=1]
- %tmp.4.i4735 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i4734, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i4737 = load double* %tmp.5.i28602 ; <double> [#uses=1]
- store double %tmp.6.i4737, double* %tmp.4.i4735
- %tmp.7.i4738 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i4734, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i4740 = load double* %tmp.8.i28605 ; <double> [#uses=1]
- store double %tmp.9.i4740, double* %tmp.7.i4738
- %tmp.0.i4741 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i4734, %"struct.std::dcomplex"* %tmp.21 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i4743 = getelementptr %"struct.std::dcomplex"* %tmp.0.i4741, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i4744 = load double* %tmp.14.i4743 ; <double> [#uses=1]
- %tmp.17.i4746 = getelementptr %"struct.std::dcomplex"* %tmp.0.i4741, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i4747 = load double* %tmp.17.i4746 ; <double> [#uses=1]
- %tmp.4.i4721 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i4720, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i4723 = load double* %tmp.5.i34282 ; <double> [#uses=1]
- store double %tmp.6.i4723, double* %tmp.4.i4721
- %tmp.7.i4724 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i4720, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i4726 = load double* %tmp.8.i34285 ; <double> [#uses=1]
- store double %tmp.9.i4726, double* %tmp.7.i4724
- %tmp.0.i4727 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i4720, %"struct.std::dcomplex"* %tmp.1036 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i4728 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1588, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i4729 = getelementptr %"struct.std::dcomplex"* %tmp.0.i4727, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i4730 = load double* %tmp.14.i4729 ; <double> [#uses=1]
- store double %tmp.15.i4730, double* %tmp.13.i4728
- %tmp.16.i4731 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1588, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i4732 = getelementptr %"struct.std::dcomplex"* %tmp.0.i4727, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i4733 = load double* %tmp.17.i4732 ; <double> [#uses=1]
- store double %tmp.18.i4733, double* %tmp.16.i4731
- %tmp.4.i4707 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i4706, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i4744, double* %tmp.4.i4707
- %tmp.7.i4710 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i4706, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i4747, double* %tmp.7.i4710
- %tmp.0.i4713 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i4706, %"struct.std::dcomplex"* %mem_tmp.1588 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i4715 = getelementptr %"struct.std::dcomplex"* %tmp.0.i4713, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i4716 = load double* %tmp.14.i4715 ; <double> [#uses=1]
- %tmp.17.i4718 = getelementptr %"struct.std::dcomplex"* %tmp.0.i4713, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i4719 = load double* %tmp.17.i4718 ; <double> [#uses=1]
- %tmp.4.i4693 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i4692, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i4716, double* %tmp.4.i4693
- %tmp.7.i4696 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i4692, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i4719, double* %tmp.7.i4696
- %tmp.0.i4699 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i4692, %"struct.std::dcomplex"* %tmp.45 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i4700 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1585, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i4701 = getelementptr %"struct.std::dcomplex"* %tmp.0.i4699, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i4702 = load double* %tmp.14.i4701 ; <double> [#uses=1]
- store double %tmp.15.i4702, double* %tmp.13.i4700
- %tmp.16.i4703 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1585, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i4704 = getelementptr %"struct.std::dcomplex"* %tmp.0.i4699, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i4705 = load double* %tmp.17.i4704 ; <double> [#uses=1]
- store double %tmp.18.i4705, double* %tmp.16.i4703
- %tmp.4.i4679 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i4678, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i4758, double* %tmp.4.i4679
- %tmp.7.i4682 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i4678, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i4761, double* %tmp.7.i4682
- %tmp.0.i4685 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i4678, %"struct.std::dcomplex"* %mem_tmp.1585 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i4687 = getelementptr %"struct.std::dcomplex"* %tmp.0.i4685, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i4688 = load double* %tmp.14.i4687 ; <double> [#uses=1]
- %tmp.17.i4690 = getelementptr %"struct.std::dcomplex"* %tmp.0.i4685, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i4691 = load double* %tmp.17.i4690 ; <double> [#uses=1]
- store double %tmp.15.i4688, double* %tmp.2.i34364
- store double %tmp.18.i4691, double* %tmp.6.i34365
- %tmp.4.i4645 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i4644, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i4647 = load double* %tmp.5.i33866 ; <double> [#uses=1]
- store double %tmp.6.i4647, double* %tmp.4.i4645
- %tmp.7.i4648 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i4644, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i4650 = load double* %tmp.8.i33869 ; <double> [#uses=1]
- store double %tmp.9.i4650, double* %tmp.7.i4648
- %tmp.0.i4651 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i4644, %"struct.std::dcomplex"* %ret3 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i4653 = getelementptr %"struct.std::dcomplex"* %tmp.0.i4651, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i4654 = load double* %tmp.14.i4653 ; <double> [#uses=1]
- %tmp.17.i4656 = getelementptr %"struct.std::dcomplex"* %tmp.0.i4651, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i4657 = load double* %tmp.17.i4656 ; <double> [#uses=1]
- %tmp.7.i4611 = load double* %tmp.2.i34366 ; <double> [#uses=1]
- %tmp.15.i4625 = add double %tmp.7.i4611, %tmp.15.i4654 ; <double> [#uses=1]
- store double %tmp.15.i4625, double* %tmp.2.i34366
- %tmp.26.i4632 = load double* %tmp.6.i34367 ; <double> [#uses=1]
- %tmp.31.i4643 = add double %tmp.26.i4632, %tmp.18.i4657 ; <double> [#uses=1]
- store double %tmp.31.i4643, double* %tmp.6.i34367
- %tmp.4.i4591 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i4590, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i4593 = load double* %tmp.5.i28728 ; <double> [#uses=1]
- store double %tmp.6.i4593, double* %tmp.4.i4591
- %tmp.7.i4594 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i4590, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i4596 = load double* %tmp.8.i28731 ; <double> [#uses=1]
- store double %tmp.9.i4596, double* %tmp.7.i4594
- %tmp.0.i4597 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i4590, %"struct.std::dcomplex"* %ret4 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i4599 = getelementptr %"struct.std::dcomplex"* %tmp.0.i4597, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i4600 = load double* %tmp.14.i4599 ; <double> [#uses=1]
- %tmp.17.i4602 = getelementptr %"struct.std::dcomplex"* %tmp.0.i4597, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i4603 = load double* %tmp.17.i4602 ; <double> [#uses=1]
- %tmp.7.i4557 = load double* %tmp.2.i34368 ; <double> [#uses=1]
- %tmp.15.i4571 = add double %tmp.7.i4557, %tmp.15.i4600 ; <double> [#uses=1]
- store double %tmp.15.i4571, double* %tmp.2.i34368
- %tmp.26.i4578 = load double* %tmp.6.i34369 ; <double> [#uses=1]
- %tmp.31.i4589 = add double %tmp.26.i4578, %tmp.18.i4603 ; <double> [#uses=1]
- store double %tmp.31.i4589, double* %tmp.6.i34369
- store double 0.000000e+00, double* %tmp.2.i34366
- store double 0.000000e+00, double* %tmp.6.i34367
- %tmp.4.i4535 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i4534, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i4537 = load double* %tmp.5.i34282 ; <double> [#uses=1]
- store double %tmp.6.i4537, double* %tmp.4.i4535
- %tmp.7.i4538 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i4534, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i4540 = load double* %tmp.8.i34285 ; <double> [#uses=1]
- store double %tmp.9.i4540, double* %tmp.7.i4538
- %tmp.0.i4541 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i4534, %"struct.std::dcomplex"* %tmp.62 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i4543 = getelementptr %"struct.std::dcomplex"* %tmp.0.i4541, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i4544 = load double* %tmp.14.i4543 ; <double> [#uses=1]
- %tmp.17.i4546 = getelementptr %"struct.std::dcomplex"* %tmp.0.i4541, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i4547 = load double* %tmp.17.i4546 ; <double> [#uses=1]
- %tmp.4.i4521 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i4520, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i4523 = load double* %tmp.5.i34082 ; <double> [#uses=1]
- store double %tmp.6.i4523, double* %tmp.4.i4521
- %tmp.7.i4524 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i4520, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i4526 = load double* %tmp.8.i34085 ; <double> [#uses=1]
- store double %tmp.9.i4526, double* %tmp.7.i4524
- %tmp.0.i4527 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i4520, %"struct.std::dcomplex"* %tmp.21 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i4528 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1596, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i4529 = getelementptr %"struct.std::dcomplex"* %tmp.0.i4527, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i4530 = load double* %tmp.14.i4529 ; <double> [#uses=1]
- store double %tmp.15.i4530, double* %tmp.13.i4528
- %tmp.16.i4531 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1596, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i4532 = getelementptr %"struct.std::dcomplex"* %tmp.0.i4527, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i4533 = load double* %tmp.17.i4532 ; <double> [#uses=1]
- store double %tmp.18.i4533, double* %tmp.16.i4531
- %tmp.4.i4507 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i4506, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i4544, double* %tmp.4.i4507
- %tmp.7.i4510 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i4506, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i4547, double* %tmp.7.i4510
- %tmp.0.i4513 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i4506, %"struct.std::dcomplex"* %mem_tmp.1596 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i4515 = getelementptr %"struct.std::dcomplex"* %tmp.0.i4513, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i4516 = load double* %tmp.14.i4515 ; <double> [#uses=1]
- %tmp.17.i4518 = getelementptr %"struct.std::dcomplex"* %tmp.0.i4513, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i4519 = load double* %tmp.17.i4518 ; <double> [#uses=1]
- %tmp.4.i4493 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i4492, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i4516, double* %tmp.4.i4493
- %tmp.7.i4496 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i4492, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i4519, double* %tmp.7.i4496
- %tmp.0.i4499 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i4492, %"struct.std::dcomplex"* %tmp.45 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i4501 = getelementptr %"struct.std::dcomplex"* %tmp.0.i4499, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i4502 = load double* %tmp.14.i4501 ; <double> [#uses=1]
- %tmp.17.i4504 = getelementptr %"struct.std::dcomplex"* %tmp.0.i4499, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i4505 = load double* %tmp.17.i4504 ; <double> [#uses=1]
- %tmp.4.i4479 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i4478, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i4481 = load double* %tmp.5.i34082 ; <double> [#uses=1]
- store double %tmp.6.i4481, double* %tmp.4.i4479
- %tmp.7.i4482 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i4478, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i4484 = load double* %tmp.8.i34085 ; <double> [#uses=1]
- store double %tmp.9.i4484, double* %tmp.7.i4482
- %tmp.0.i4485 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i4478, %"struct.std::dcomplex"* %tmp.6 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i4487 = getelementptr %"struct.std::dcomplex"* %tmp.0.i4485, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i4488 = load double* %tmp.14.i4487 ; <double> [#uses=1]
- %tmp.17.i4490 = getelementptr %"struct.std::dcomplex"* %tmp.0.i4485, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i4491 = load double* %tmp.17.i4490 ; <double> [#uses=1]
- %tmp.4.i4465 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i4464, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i4467 = load double* %tmp.5.i34338 ; <double> [#uses=1]
- store double %tmp.6.i4467, double* %tmp.4.i4465
- %tmp.7.i4468 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i4464, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i4470 = load double* %tmp.8.i34341 ; <double> [#uses=1]
- store double %tmp.9.i4470, double* %tmp.7.i4468
- %tmp.0.i4471 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i4464, %"struct.std::dcomplex"* %tmp.62 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i4472 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1600, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i4473 = getelementptr %"struct.std::dcomplex"* %tmp.0.i4471, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i4474 = load double* %tmp.14.i4473 ; <double> [#uses=1]
- store double %tmp.15.i4474, double* %tmp.13.i4472
- %tmp.16.i4475 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1600, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i4476 = getelementptr %"struct.std::dcomplex"* %tmp.0.i4471, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i4477 = load double* %tmp.17.i4476 ; <double> [#uses=1]
- store double %tmp.18.i4477, double* %tmp.16.i4475
- %tmp.4.i4451 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i4450, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i4488, double* %tmp.4.i4451
- %tmp.7.i4454 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i4450, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i4491, double* %tmp.7.i4454
- %tmp.0.i4457 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i4450, %"struct.std::dcomplex"* %mem_tmp.1600 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i4459 = getelementptr %"struct.std::dcomplex"* %tmp.0.i4457, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i4460 = load double* %tmp.14.i4459 ; <double> [#uses=1]
- %tmp.17.i4462 = getelementptr %"struct.std::dcomplex"* %tmp.0.i4457, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i4463 = load double* %tmp.17.i4462 ; <double> [#uses=1]
- %tmp.4.i4437 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i4436, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i4460, double* %tmp.4.i4437
- %tmp.7.i4440 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i4436, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i4463, double* %tmp.7.i4440
- %tmp.0.i4443 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i4436, %"struct.std::dcomplex"* %tmp.15 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i4444 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1597, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i4445 = getelementptr %"struct.std::dcomplex"* %tmp.0.i4443, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i4446 = load double* %tmp.14.i4445 ; <double> [#uses=1]
- store double %tmp.15.i4446, double* %tmp.13.i4444
- %tmp.16.i4447 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1597, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i4448 = getelementptr %"struct.std::dcomplex"* %tmp.0.i4443, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i4449 = load double* %tmp.17.i4448 ; <double> [#uses=1]
- store double %tmp.18.i4449, double* %tmp.16.i4447
- %tmp.4.i4423 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i4422, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i4502, double* %tmp.4.i4423
- %tmp.7.i4426 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i4422, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i4505, double* %tmp.7.i4426
- %tmp.0.i4429 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i4422, %"struct.std::dcomplex"* %mem_tmp.1597 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i4431 = getelementptr %"struct.std::dcomplex"* %tmp.0.i4429, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i4432 = load double* %tmp.14.i4431 ; <double> [#uses=1]
- %tmp.17.i4434 = getelementptr %"struct.std::dcomplex"* %tmp.0.i4429, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i4435 = load double* %tmp.17.i4434 ; <double> [#uses=1]
- %tmp.4.i4409 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i4408, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i4411 = load double* %tmp.5.i34338 ; <double> [#uses=1]
- store double %tmp.6.i4411, double* %tmp.4.i4409
- %tmp.7.i4412 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i4408, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i4414 = load double* %tmp.8.i34341 ; <double> [#uses=1]
- store double %tmp.9.i4414, double* %tmp.7.i4412
- %tmp.0.i4415 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i4408, %"struct.std::dcomplex"* %tmp.21 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i4417 = getelementptr %"struct.std::dcomplex"* %tmp.0.i4415, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i4418 = load double* %tmp.14.i4417 ; <double> [#uses=1]
- %tmp.17.i4420 = getelementptr %"struct.std::dcomplex"* %tmp.0.i4415, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i4421 = load double* %tmp.17.i4420 ; <double> [#uses=1]
- %tmp.4.i4395 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i4394, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i4397 = load double* %tmp.5.i34282 ; <double> [#uses=1]
- store double %tmp.6.i4397, double* %tmp.4.i4395
- %tmp.7.i4398 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i4394, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i4400 = load double* %tmp.8.i34285 ; <double> [#uses=1]
- store double %tmp.9.i4400, double* %tmp.7.i4398
- %tmp.0.i4401 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i4394, %"struct.std::dcomplex"* %tmp.6 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i4402 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1604, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i4403 = getelementptr %"struct.std::dcomplex"* %tmp.0.i4401, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i4404 = load double* %tmp.14.i4403 ; <double> [#uses=1]
- store double %tmp.15.i4404, double* %tmp.13.i4402
- %tmp.16.i4405 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1604, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i4406 = getelementptr %"struct.std::dcomplex"* %tmp.0.i4401, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i4407 = load double* %tmp.17.i4406 ; <double> [#uses=1]
- store double %tmp.18.i4407, double* %tmp.16.i4405
- %tmp.4.i4381 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i4380, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i4418, double* %tmp.4.i4381
- %tmp.7.i4384 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i4380, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i4421, double* %tmp.7.i4384
- %tmp.0.i4387 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i4380, %"struct.std::dcomplex"* %mem_tmp.1604 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i4389 = getelementptr %"struct.std::dcomplex"* %tmp.0.i4387, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i4390 = load double* %tmp.14.i4389 ; <double> [#uses=1]
- %tmp.17.i4392 = getelementptr %"struct.std::dcomplex"* %tmp.0.i4387, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i4393 = load double* %tmp.17.i4392 ; <double> [#uses=1]
- %tmp.4.i4367 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i4366, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i4390, double* %tmp.4.i4367
- %tmp.7.i4370 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i4366, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i4393, double* %tmp.7.i4370
- %tmp.0.i4373 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i4366, %"struct.std::dcomplex"* %tmp.95 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i4374 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1601, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i4375 = getelementptr %"struct.std::dcomplex"* %tmp.0.i4373, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i4376 = load double* %tmp.14.i4375 ; <double> [#uses=1]
- store double %tmp.15.i4376, double* %tmp.13.i4374
- %tmp.16.i4377 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1601, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i4378 = getelementptr %"struct.std::dcomplex"* %tmp.0.i4373, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i4379 = load double* %tmp.17.i4378 ; <double> [#uses=1]
- store double %tmp.18.i4379, double* %tmp.16.i4377
- %tmp.4.i4353 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i4352, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i4432, double* %tmp.4.i4353
- %tmp.7.i4356 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i4352, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i4435, double* %tmp.7.i4356
- %tmp.0.i4359 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i4352, %"struct.std::dcomplex"* %mem_tmp.1601 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i4361 = getelementptr %"struct.std::dcomplex"* %tmp.0.i4359, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i4362 = load double* %tmp.14.i4361 ; <double> [#uses=1]
- %tmp.17.i4364 = getelementptr %"struct.std::dcomplex"* %tmp.0.i4359, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i4365 = load double* %tmp.17.i4364 ; <double> [#uses=1]
- store double %tmp.15.i4362, double* %tmp.2.i34364
- store double %tmp.18.i4365, double* %tmp.6.i34365
- %tmp.4.i4319 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i4318, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i4321 = load double* %tmp.5.i33866 ; <double> [#uses=1]
- store double %tmp.6.i4321, double* %tmp.4.i4319
- %tmp.7.i4322 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i4318, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i4324 = load double* %tmp.8.i33869 ; <double> [#uses=1]
- store double %tmp.9.i4324, double* %tmp.7.i4322
- %tmp.0.i4325 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i4318, %"struct.std::dcomplex"* %ret3 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i4327 = getelementptr %"struct.std::dcomplex"* %tmp.0.i4325, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i4328 = load double* %tmp.14.i4327 ; <double> [#uses=1]
- %tmp.17.i4330 = getelementptr %"struct.std::dcomplex"* %tmp.0.i4325, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i4331 = load double* %tmp.17.i4330 ; <double> [#uses=1]
- %tmp.7.i4285 = load double* %tmp.2.i34366 ; <double> [#uses=1]
- %tmp.15.i4299 = add double %tmp.7.i4285, %tmp.15.i4328 ; <double> [#uses=1]
- store double %tmp.15.i4299, double* %tmp.2.i34366
- %tmp.26.i4306 = load double* %tmp.6.i34367 ; <double> [#uses=1]
- %tmp.31.i4317 = add double %tmp.26.i4306, %tmp.18.i4331 ; <double> [#uses=1]
- store double %tmp.31.i4317, double* %tmp.6.i34367
- %tmp.4.i4265 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i4264, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i4267 = load double* %tmp.5.i34282 ; <double> [#uses=1]
- store double %tmp.6.i4267, double* %tmp.4.i4265
- %tmp.7.i4268 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i4264, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i4270 = load double* %tmp.8.i34285 ; <double> [#uses=1]
- store double %tmp.9.i4270, double* %tmp.7.i4268
- %tmp.0.i4271 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i4264, %"struct.std::dcomplex"* %tmp.12 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i4273 = getelementptr %"struct.std::dcomplex"* %tmp.0.i4271, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i4274 = load double* %tmp.14.i4273 ; <double> [#uses=1]
- %tmp.17.i4276 = getelementptr %"struct.std::dcomplex"* %tmp.0.i4271, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i4277 = load double* %tmp.17.i4276 ; <double> [#uses=1]
- %tmp.4.i4251 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i4250, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i4253 = load double* %tmp.5.i34352 ; <double> [#uses=1]
- store double %tmp.6.i4253, double* %tmp.4.i4251
- %tmp.7.i4254 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i4250, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i4256 = load double* %tmp.8.i34355 ; <double> [#uses=1]
- store double %tmp.9.i4256, double* %tmp.7.i4254
- %tmp.0.i4257 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i4250, %"struct.std::dcomplex"* %tmp.21 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i4258 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1611, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i4259 = getelementptr %"struct.std::dcomplex"* %tmp.0.i4257, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i4260 = load double* %tmp.14.i4259 ; <double> [#uses=1]
- store double %tmp.15.i4260, double* %tmp.13.i4258
- %tmp.16.i4261 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1611, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i4262 = getelementptr %"struct.std::dcomplex"* %tmp.0.i4257, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i4263 = load double* %tmp.17.i4262 ; <double> [#uses=1]
- store double %tmp.18.i4263, double* %tmp.16.i4261
- %tmp.4.i4237 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i4236, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i4274, double* %tmp.4.i4237
- %tmp.7.i4240 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i4236, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i4277, double* %tmp.7.i4240
- %tmp.0.i4243 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i4236, %"struct.std::dcomplex"* %mem_tmp.1611 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i4245 = getelementptr %"struct.std::dcomplex"* %tmp.0.i4243, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i4246 = load double* %tmp.14.i4245 ; <double> [#uses=1]
- %tmp.17.i4248 = getelementptr %"struct.std::dcomplex"* %tmp.0.i4243, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i4249 = load double* %tmp.17.i4248 ; <double> [#uses=1]
- %tmp.4.i4223 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i4222, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i4246, double* %tmp.4.i4223
- %tmp.7.i4226 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i4222, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i4249, double* %tmp.7.i4226
- %tmp.0.i4229 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i4222, %"struct.std::dcomplex"* %tmp.95 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i4231 = getelementptr %"struct.std::dcomplex"* %tmp.0.i4229, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i4232 = load double* %tmp.14.i4231 ; <double> [#uses=1]
- %tmp.17.i4234 = getelementptr %"struct.std::dcomplex"* %tmp.0.i4229, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i4235 = load double* %tmp.17.i4234 ; <double> [#uses=1]
- %tmp.4.i4209 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i4208, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i4211 = load double* %tmp.5.i34082 ; <double> [#uses=1]
- store double %tmp.6.i4211, double* %tmp.4.i4209
- %tmp.7.i4212 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i4208, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i4214 = load double* %tmp.8.i34085 ; <double> [#uses=1]
- store double %tmp.9.i4214, double* %tmp.7.i4212
- %tmp.0.i4215 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i4208, %"struct.std::dcomplex"* %tmp.21 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i4217 = getelementptr %"struct.std::dcomplex"* %tmp.0.i4215, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i4218 = load double* %tmp.14.i4217 ; <double> [#uses=1]
- %tmp.17.i4220 = getelementptr %"struct.std::dcomplex"* %tmp.0.i4215, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i4221 = load double* %tmp.17.i4220 ; <double> [#uses=1]
- %tmp.4.i4195 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i4194, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i4197 = load double* %tmp.5.i34282 ; <double> [#uses=1]
- store double %tmp.6.i4197, double* %tmp.4.i4195
- %tmp.7.i4198 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i4194, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i4200 = load double* %tmp.8.i34285 ; <double> [#uses=1]
- store double %tmp.9.i4200, double* %tmp.7.i4198
- %tmp.0.i4201 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i4194, %"struct.std::dcomplex"* %tmp.62 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i4202 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1615, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i4203 = getelementptr %"struct.std::dcomplex"* %tmp.0.i4201, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i4204 = load double* %tmp.14.i4203 ; <double> [#uses=1]
- store double %tmp.15.i4204, double* %tmp.13.i4202
- %tmp.16.i4205 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1615, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i4206 = getelementptr %"struct.std::dcomplex"* %tmp.0.i4201, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i4207 = load double* %tmp.17.i4206 ; <double> [#uses=1]
- store double %tmp.18.i4207, double* %tmp.16.i4205
- %tmp.4.i4181 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i4180, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i4218, double* %tmp.4.i4181
- %tmp.7.i4184 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i4180, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i4221, double* %tmp.7.i4184
- %tmp.0.i4187 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i4180, %"struct.std::dcomplex"* %mem_tmp.1615 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i4189 = getelementptr %"struct.std::dcomplex"* %tmp.0.i4187, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i4190 = load double* %tmp.14.i4189 ; <double> [#uses=1]
- %tmp.17.i4192 = getelementptr %"struct.std::dcomplex"* %tmp.0.i4187, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i4193 = load double* %tmp.17.i4192 ; <double> [#uses=1]
- %tmp.4.i4167 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i4166, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i4190, double* %tmp.4.i4167
- %tmp.7.i4170 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i4166, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i4193, double* %tmp.7.i4170
- %tmp.0.i4173 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i4166, %"struct.std::dcomplex"* %tmp.30 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i4174 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1612, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i4175 = getelementptr %"struct.std::dcomplex"* %tmp.0.i4173, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i4176 = load double* %tmp.14.i4175 ; <double> [#uses=1]
- store double %tmp.15.i4176, double* %tmp.13.i4174
- %tmp.16.i4177 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1612, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i4178 = getelementptr %"struct.std::dcomplex"* %tmp.0.i4173, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i4179 = load double* %tmp.17.i4178 ; <double> [#uses=1]
- store double %tmp.18.i4179, double* %tmp.16.i4177
- %tmp.4.i4153 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i4152, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i4232, double* %tmp.4.i4153
- %tmp.7.i4156 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i4152, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i4235, double* %tmp.7.i4156
- %tmp.0.i4159 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i4152, %"struct.std::dcomplex"* %mem_tmp.1612 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i4161 = getelementptr %"struct.std::dcomplex"* %tmp.0.i4159, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i4162 = load double* %tmp.14.i4161 ; <double> [#uses=1]
- %tmp.17.i4164 = getelementptr %"struct.std::dcomplex"* %tmp.0.i4159, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i4165 = load double* %tmp.17.i4164 ; <double> [#uses=1]
- %tmp.4.i4139 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i4138, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i4141 = load double* %tmp.5.i34352 ; <double> [#uses=1]
- store double %tmp.6.i4141, double* %tmp.4.i4139
- %tmp.7.i4142 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i4138, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i4144 = load double* %tmp.8.i34355 ; <double> [#uses=1]
- store double %tmp.9.i4144, double* %tmp.7.i4142
- %tmp.0.i4145 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i4138, %"struct.std::dcomplex"* %tmp.62 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i4147 = getelementptr %"struct.std::dcomplex"* %tmp.0.i4145, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i4148 = load double* %tmp.14.i4147 ; <double> [#uses=1]
- %tmp.17.i4150 = getelementptr %"struct.std::dcomplex"* %tmp.0.i4145, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i4151 = load double* %tmp.17.i4150 ; <double> [#uses=1]
- %tmp.4.i4125 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i4124, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i4127 = load double* %tmp.5.i34082 ; <double> [#uses=1]
- store double %tmp.6.i4127, double* %tmp.4.i4125
- %tmp.7.i4128 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i4124, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i4130 = load double* %tmp.8.i34085 ; <double> [#uses=1]
- store double %tmp.9.i4130, double* %tmp.7.i4128
- %tmp.0.i4131 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i4124, %"struct.std::dcomplex"* %tmp.12 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i4132 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1619, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i4133 = getelementptr %"struct.std::dcomplex"* %tmp.0.i4131, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i4134 = load double* %tmp.14.i4133 ; <double> [#uses=1]
- store double %tmp.15.i4134, double* %tmp.13.i4132
- %tmp.16.i4135 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1619, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i4136 = getelementptr %"struct.std::dcomplex"* %tmp.0.i4131, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i4137 = load double* %tmp.17.i4136 ; <double> [#uses=1]
- store double %tmp.18.i4137, double* %tmp.16.i4135
- %tmp.4.i4111 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i4110, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i4148, double* %tmp.4.i4111
- %tmp.7.i4114 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i4110, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i4151, double* %tmp.7.i4114
- %tmp.0.i4117 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i4110, %"struct.std::dcomplex"* %mem_tmp.1619 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i4119 = getelementptr %"struct.std::dcomplex"* %tmp.0.i4117, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i4120 = load double* %tmp.14.i4119 ; <double> [#uses=1]
- %tmp.17.i4122 = getelementptr %"struct.std::dcomplex"* %tmp.0.i4117, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i4123 = load double* %tmp.17.i4122 ; <double> [#uses=1]
- %tmp.4.i4097 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i4096, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i4120, double* %tmp.4.i4097
- %tmp.7.i4100 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i4096, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i4123, double* %tmp.7.i4100
- %tmp.0.i4103 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i4096, %"struct.std::dcomplex"* %tmp.15 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i4104 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1616, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i4105 = getelementptr %"struct.std::dcomplex"* %tmp.0.i4103, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i4106 = load double* %tmp.14.i4105 ; <double> [#uses=1]
- store double %tmp.15.i4106, double* %tmp.13.i4104
- %tmp.16.i4107 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1616, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i4108 = getelementptr %"struct.std::dcomplex"* %tmp.0.i4103, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i4109 = load double* %tmp.17.i4108 ; <double> [#uses=1]
- store double %tmp.18.i4109, double* %tmp.16.i4107
- %tmp.4.i4083 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i4082, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i4162, double* %tmp.4.i4083
- %tmp.7.i4086 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i4082, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i4165, double* %tmp.7.i4086
- %tmp.0.i4089 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i4082, %"struct.std::dcomplex"* %mem_tmp.1616 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i4091 = getelementptr %"struct.std::dcomplex"* %tmp.0.i4089, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i4092 = load double* %tmp.14.i4091 ; <double> [#uses=1]
- %tmp.17.i4094 = getelementptr %"struct.std::dcomplex"* %tmp.0.i4089, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i4095 = load double* %tmp.17.i4094 ; <double> [#uses=1]
- store double %tmp.15.i4092, double* %tmp.2.i34364
- store double %tmp.18.i4095, double* %tmp.6.i34365
- %tmp.4.i4049 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i4048, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i4051 = load double* %tmp.5.i33596 ; <double> [#uses=1]
- store double %tmp.6.i4051, double* %tmp.4.i4049
- %tmp.7.i4052 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i4048, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i4054 = load double* %tmp.8.i33599 ; <double> [#uses=1]
- store double %tmp.9.i4054, double* %tmp.7.i4052
- %tmp.0.i4055 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i4048, %"struct.std::dcomplex"* %ret3 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i4057 = getelementptr %"struct.std::dcomplex"* %tmp.0.i4055, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i4058 = load double* %tmp.14.i4057 ; <double> [#uses=1]
- %tmp.17.i4060 = getelementptr %"struct.std::dcomplex"* %tmp.0.i4055, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i4061 = load double* %tmp.17.i4060 ; <double> [#uses=1]
- %tmp.7.i4015 = load double* %tmp.2.i34366 ; <double> [#uses=1]
- %tmp.15.i4029 = add double %tmp.7.i4015, %tmp.15.i4058 ; <double> [#uses=1]
- store double %tmp.15.i4029, double* %tmp.2.i34366
- %tmp.26.i4036 = load double* %tmp.6.i34367 ; <double> [#uses=1]
- %tmp.31.i4047 = add double %tmp.26.i4036, %tmp.18.i4061 ; <double> [#uses=1]
- store double %tmp.31.i4047, double* %tmp.6.i34367
- %tmp.4.i3995 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i3994, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i3997 = load double* %tmp.5.i34082 ; <double> [#uses=1]
- store double %tmp.6.i3997, double* %tmp.4.i3995
- %tmp.7.i3998 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i3994, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i4000 = load double* %tmp.8.i34085 ; <double> [#uses=1]
- store double %tmp.9.i4000, double* %tmp.7.i3998
- %tmp.0.i4001 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i3994, %"struct.std::dcomplex"* %tmp.12 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i4003 = getelementptr %"struct.std::dcomplex"* %tmp.0.i4001, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i4004 = load double* %tmp.14.i4003 ; <double> [#uses=1]
- %tmp.17.i4006 = getelementptr %"struct.std::dcomplex"* %tmp.0.i4001, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i4007 = load double* %tmp.17.i4006 ; <double> [#uses=1]
- %tmp.4.i3981 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i3980, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i3983 = load double* %tmp.5.i34352 ; <double> [#uses=1]
- store double %tmp.6.i3983, double* %tmp.4.i3981
- %tmp.7.i3984 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i3980, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i3986 = load double* %tmp.8.i34355 ; <double> [#uses=1]
- store double %tmp.9.i3986, double* %tmp.7.i3984
- %tmp.0.i3987 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i3980, %"struct.std::dcomplex"* %tmp.62 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i3988 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1626, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i3989 = getelementptr %"struct.std::dcomplex"* %tmp.0.i3987, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i3990 = load double* %tmp.14.i3989 ; <double> [#uses=1]
- store double %tmp.15.i3990, double* %tmp.13.i3988
- %tmp.16.i3991 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1626, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i3992 = getelementptr %"struct.std::dcomplex"* %tmp.0.i3987, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i3993 = load double* %tmp.17.i3992 ; <double> [#uses=1]
- store double %tmp.18.i3993, double* %tmp.16.i3991
- %tmp.4.i3967 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i3966, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i4004, double* %tmp.4.i3967
- %tmp.7.i3970 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i3966, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i4007, double* %tmp.7.i3970
- %tmp.0.i3973 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i3966, %"struct.std::dcomplex"* %mem_tmp.1626 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i3975 = getelementptr %"struct.std::dcomplex"* %tmp.0.i3973, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i3976 = load double* %tmp.14.i3975 ; <double> [#uses=1]
- %tmp.17.i3978 = getelementptr %"struct.std::dcomplex"* %tmp.0.i3973, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i3979 = load double* %tmp.17.i3978 ; <double> [#uses=1]
- %tmp.4.i3953 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i3952, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i3976, double* %tmp.4.i3953
- %tmp.7.i3956 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i3952, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i3979, double* %tmp.7.i3956
- %tmp.0.i3959 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i3952, %"struct.std::dcomplex"* %tmp.45 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i3961 = getelementptr %"struct.std::dcomplex"* %tmp.0.i3959, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i3962 = load double* %tmp.14.i3961 ; <double> [#uses=1]
- %tmp.17.i3964 = getelementptr %"struct.std::dcomplex"* %tmp.0.i3959, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i3965 = load double* %tmp.17.i3964 ; <double> [#uses=1]
- %tmp.4.i3939 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i3938, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i3941 = load double* %tmp.5.i34352 ; <double> [#uses=1]
- store double %tmp.6.i3941, double* %tmp.4.i3939
- %tmp.7.i3942 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i3938, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i3944 = load double* %tmp.8.i34355 ; <double> [#uses=1]
- store double %tmp.9.i3944, double* %tmp.7.i3942
- %tmp.0.i3945 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i3938, %"struct.std::dcomplex"* %tmp.6 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i3947 = getelementptr %"struct.std::dcomplex"* %tmp.0.i3945, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i3948 = load double* %tmp.14.i3947 ; <double> [#uses=1]
- %tmp.17.i3950 = getelementptr %"struct.std::dcomplex"* %tmp.0.i3945, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i3951 = load double* %tmp.17.i3950 ; <double> [#uses=1]
- %tmp.4.i3925 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i3924, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i3927 = load double* %tmp.5.i34338 ; <double> [#uses=1]
- store double %tmp.6.i3927, double* %tmp.4.i3925
- %tmp.7.i3928 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i3924, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i3930 = load double* %tmp.8.i34341 ; <double> [#uses=1]
- store double %tmp.9.i3930, double* %tmp.7.i3928
- %tmp.0.i3931 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i3924, %"struct.std::dcomplex"* %tmp.12 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i3932 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1630, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i3933 = getelementptr %"struct.std::dcomplex"* %tmp.0.i3931, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i3934 = load double* %tmp.14.i3933 ; <double> [#uses=1]
- store double %tmp.15.i3934, double* %tmp.13.i3932
- %tmp.16.i3935 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1630, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i3936 = getelementptr %"struct.std::dcomplex"* %tmp.0.i3931, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i3937 = load double* %tmp.17.i3936 ; <double> [#uses=1]
- store double %tmp.18.i3937, double* %tmp.16.i3935
- %tmp.4.i3911 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i3910, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i3948, double* %tmp.4.i3911
- %tmp.7.i3914 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i3910, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i3951, double* %tmp.7.i3914
- %tmp.0.i3917 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i3910, %"struct.std::dcomplex"* %mem_tmp.1630 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i3919 = getelementptr %"struct.std::dcomplex"* %tmp.0.i3917, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i3920 = load double* %tmp.14.i3919 ; <double> [#uses=1]
- %tmp.17.i3922 = getelementptr %"struct.std::dcomplex"* %tmp.0.i3917, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i3923 = load double* %tmp.17.i3922 ; <double> [#uses=1]
- %tmp.4.i3897 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i3896, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i3920, double* %tmp.4.i3897
- %tmp.7.i3900 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i3896, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i3923, double* %tmp.7.i3900
- %tmp.0.i3903 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i3896, %"struct.std::dcomplex"* %tmp.95 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i3904 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1627, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i3905 = getelementptr %"struct.std::dcomplex"* %tmp.0.i3903, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i3906 = load double* %tmp.14.i3905 ; <double> [#uses=1]
- store double %tmp.15.i3906, double* %tmp.13.i3904
- %tmp.16.i3907 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1627, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i3908 = getelementptr %"struct.std::dcomplex"* %tmp.0.i3903, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i3909 = load double* %tmp.17.i3908 ; <double> [#uses=1]
- store double %tmp.18.i3909, double* %tmp.16.i3907
- %tmp.4.i3883 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i3882, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i3962, double* %tmp.4.i3883
- %tmp.7.i3886 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i3882, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i3965, double* %tmp.7.i3886
- %tmp.0.i3889 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i3882, %"struct.std::dcomplex"* %mem_tmp.1627 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i3891 = getelementptr %"struct.std::dcomplex"* %tmp.0.i3889, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i3892 = load double* %tmp.14.i3891 ; <double> [#uses=1]
- %tmp.17.i3894 = getelementptr %"struct.std::dcomplex"* %tmp.0.i3889, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i3895 = load double* %tmp.17.i3894 ; <double> [#uses=1]
- %tmp.4.i3869 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i3868, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i3871 = load double* %tmp.5.i34338 ; <double> [#uses=1]
- store double %tmp.6.i3871, double* %tmp.4.i3869
- %tmp.7.i3872 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i3868, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i3874 = load double* %tmp.8.i34341 ; <double> [#uses=1]
- store double %tmp.9.i3874, double* %tmp.7.i3872
- %tmp.0.i3875 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i3868, %"struct.std::dcomplex"* %tmp.62 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i3877 = getelementptr %"struct.std::dcomplex"* %tmp.0.i3875, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i3878 = load double* %tmp.14.i3877 ; <double> [#uses=1]
- %tmp.17.i3880 = getelementptr %"struct.std::dcomplex"* %tmp.0.i3875, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i3881 = load double* %tmp.17.i3880 ; <double> [#uses=1]
- %tmp.4.i3855 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i3854, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i3857 = load double* %tmp.5.i34082 ; <double> [#uses=1]
- store double %tmp.6.i3857, double* %tmp.4.i3855
- %tmp.7.i3858 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i3854, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i3860 = load double* %tmp.8.i34085 ; <double> [#uses=1]
- store double %tmp.9.i3860, double* %tmp.7.i3858
- %tmp.0.i3861 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i3854, %"struct.std::dcomplex"* %tmp.6 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i3862 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1634, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i3863 = getelementptr %"struct.std::dcomplex"* %tmp.0.i3861, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i3864 = load double* %tmp.14.i3863 ; <double> [#uses=1]
- store double %tmp.15.i3864, double* %tmp.13.i3862
- %tmp.16.i3865 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1634, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i3866 = getelementptr %"struct.std::dcomplex"* %tmp.0.i3861, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i3867 = load double* %tmp.17.i3866 ; <double> [#uses=1]
- store double %tmp.18.i3867, double* %tmp.16.i3865
- %tmp.4.i3841 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i3840, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i3878, double* %tmp.4.i3841
- %tmp.7.i3844 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i3840, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i3881, double* %tmp.7.i3844
- %tmp.0.i3847 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i3840, %"struct.std::dcomplex"* %mem_tmp.1634 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i3849 = getelementptr %"struct.std::dcomplex"* %tmp.0.i3847, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i3850 = load double* %tmp.14.i3849 ; <double> [#uses=1]
- %tmp.17.i3852 = getelementptr %"struct.std::dcomplex"* %tmp.0.i3847, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i3853 = load double* %tmp.17.i3852 ; <double> [#uses=1]
- %tmp.4.i3827 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i3826, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i3850, double* %tmp.4.i3827
- %tmp.7.i3830 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i3826, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i3853, double* %tmp.7.i3830
- %tmp.0.i3833 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i3826, %"struct.std::dcomplex"* %tmp.30 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i3834 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1631, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i3835 = getelementptr %"struct.std::dcomplex"* %tmp.0.i3833, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i3836 = load double* %tmp.14.i3835 ; <double> [#uses=1]
- store double %tmp.15.i3836, double* %tmp.13.i3834
- %tmp.16.i3837 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1631, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i3838 = getelementptr %"struct.std::dcomplex"* %tmp.0.i3833, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i3839 = load double* %tmp.17.i3838 ; <double> [#uses=1]
- store double %tmp.18.i3839, double* %tmp.16.i3837
- %tmp.4.i3813 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i3812, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i3892, double* %tmp.4.i3813
- %tmp.7.i3816 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i3812, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i3895, double* %tmp.7.i3816
- %tmp.0.i3819 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i3812, %"struct.std::dcomplex"* %mem_tmp.1631 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i3821 = getelementptr %"struct.std::dcomplex"* %tmp.0.i3819, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i3822 = load double* %tmp.14.i3821 ; <double> [#uses=1]
- %tmp.17.i3824 = getelementptr %"struct.std::dcomplex"* %tmp.0.i3819, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i3825 = load double* %tmp.17.i3824 ; <double> [#uses=1]
- store double %tmp.15.i3822, double* %tmp.2.i34364
- store double %tmp.18.i3825, double* %tmp.6.i34365
- %tmp.4.i3779 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i3778, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i3781 = load double* %tmp.5.i33326 ; <double> [#uses=1]
- store double %tmp.6.i3781, double* %tmp.4.i3779
- %tmp.7.i3782 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i3778, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i3784 = load double* %tmp.8.i33329 ; <double> [#uses=1]
- store double %tmp.9.i3784, double* %tmp.7.i3782
- %tmp.0.i3785 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i3778, %"struct.std::dcomplex"* %ret3 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i3787 = getelementptr %"struct.std::dcomplex"* %tmp.0.i3785, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i3788 = load double* %tmp.14.i3787 ; <double> [#uses=1]
- %tmp.17.i3790 = getelementptr %"struct.std::dcomplex"* %tmp.0.i3785, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i3791 = load double* %tmp.17.i3790 ; <double> [#uses=1]
- %tmp.7.i3745 = load double* %tmp.2.i34366 ; <double> [#uses=1]
- %tmp.15.i3759 = add double %tmp.7.i3745, %tmp.15.i3788 ; <double> [#uses=1]
- store double %tmp.15.i3759, double* %tmp.2.i34366
- %tmp.26.i3766 = load double* %tmp.6.i34367 ; <double> [#uses=1]
- %tmp.31.i3777 = add double %tmp.26.i3766, %tmp.18.i3791 ; <double> [#uses=1]
- store double %tmp.31.i3777, double* %tmp.6.i34367
- %tmp.4.i3725 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i3724, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i3727 = load double* %tmp.5.i34282 ; <double> [#uses=1]
- store double %tmp.6.i3727, double* %tmp.4.i3725
- %tmp.7.i3728 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i3724, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i3730 = load double* %tmp.8.i34285 ; <double> [#uses=1]
- store double %tmp.9.i3730, double* %tmp.7.i3728
- %tmp.0.i3731 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i3724, %"struct.std::dcomplex"* %tmp.6 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i3733 = getelementptr %"struct.std::dcomplex"* %tmp.0.i3731, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i3734 = load double* %tmp.14.i3733 ; <double> [#uses=1]
- %tmp.17.i3736 = getelementptr %"struct.std::dcomplex"* %tmp.0.i3731, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i3737 = load double* %tmp.17.i3736 ; <double> [#uses=1]
- %tmp.4.i3711 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i3710, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i3713 = load double* %tmp.5.i34338 ; <double> [#uses=1]
- store double %tmp.6.i3713, double* %tmp.4.i3711
- %tmp.7.i3714 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i3710, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i3716 = load double* %tmp.8.i34341 ; <double> [#uses=1]
- store double %tmp.9.i3716, double* %tmp.7.i3714
- %tmp.0.i3717 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i3710, %"struct.std::dcomplex"* %tmp.21 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i3718 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1641, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i3719 = getelementptr %"struct.std::dcomplex"* %tmp.0.i3717, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i3720 = load double* %tmp.14.i3719 ; <double> [#uses=1]
- store double %tmp.15.i3720, double* %tmp.13.i3718
- %tmp.16.i3721 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1641, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i3722 = getelementptr %"struct.std::dcomplex"* %tmp.0.i3717, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i3723 = load double* %tmp.17.i3722 ; <double> [#uses=1]
- store double %tmp.18.i3723, double* %tmp.16.i3721
- %tmp.4.i3697 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i3696, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i3734, double* %tmp.4.i3697
- %tmp.7.i3700 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i3696, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i3737, double* %tmp.7.i3700
- %tmp.0.i3703 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i3696, %"struct.std::dcomplex"* %mem_tmp.1641 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i3705 = getelementptr %"struct.std::dcomplex"* %tmp.0.i3703, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i3706 = load double* %tmp.14.i3705 ; <double> [#uses=1]
- %tmp.17.i3708 = getelementptr %"struct.std::dcomplex"* %tmp.0.i3703, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i3709 = load double* %tmp.17.i3708 ; <double> [#uses=1]
- %tmp.4.i3683 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i3682, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i3706, double* %tmp.4.i3683
- %tmp.7.i3686 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i3682, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i3709, double* %tmp.7.i3686
- %tmp.0.i3689 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i3682, %"struct.std::dcomplex"* %tmp.30 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i3691 = getelementptr %"struct.std::dcomplex"* %tmp.0.i3689, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i3692 = load double* %tmp.14.i3691 ; <double> [#uses=1]
- %tmp.17.i3694 = getelementptr %"struct.std::dcomplex"* %tmp.0.i3689, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i3695 = load double* %tmp.17.i3694 ; <double> [#uses=1]
- %tmp.4.i3669 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i3668, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i3671 = load double* %tmp.5.i34352 ; <double> [#uses=1]
- store double %tmp.6.i3671, double* %tmp.4.i3669
- %tmp.7.i3672 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i3668, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i3674 = load double* %tmp.8.i34355 ; <double> [#uses=1]
- store double %tmp.9.i3674, double* %tmp.7.i3672
- %tmp.0.i3675 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i3668, %"struct.std::dcomplex"* %tmp.21 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i3677 = getelementptr %"struct.std::dcomplex"* %tmp.0.i3675, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i3678 = load double* %tmp.14.i3677 ; <double> [#uses=1]
- %tmp.17.i3680 = getelementptr %"struct.std::dcomplex"* %tmp.0.i3675, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i3681 = load double* %tmp.17.i3680 ; <double> [#uses=1]
- %tmp.4.i3655 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i3654, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i3657 = load double* %tmp.5.i34282 ; <double> [#uses=1]
- store double %tmp.6.i3657, double* %tmp.4.i3655
- %tmp.7.i3658 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i3654, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i3660 = load double* %tmp.8.i34285 ; <double> [#uses=1]
- store double %tmp.9.i3660, double* %tmp.7.i3658
- %tmp.0.i3661 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i3654, %"struct.std::dcomplex"* %tmp.12 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i3662 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1645, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i3663 = getelementptr %"struct.std::dcomplex"* %tmp.0.i3661, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i3664 = load double* %tmp.14.i3663 ; <double> [#uses=1]
- store double %tmp.15.i3664, double* %tmp.13.i3662
- %tmp.16.i3665 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1645, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i3666 = getelementptr %"struct.std::dcomplex"* %tmp.0.i3661, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i3667 = load double* %tmp.17.i3666 ; <double> [#uses=1]
- store double %tmp.18.i3667, double* %tmp.16.i3665
- %tmp.4.i3641 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i3640, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i3678, double* %tmp.4.i3641
- %tmp.7.i3644 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i3640, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i3681, double* %tmp.7.i3644
- %tmp.0.i3647 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i3640, %"struct.std::dcomplex"* %mem_tmp.1645 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i3649 = getelementptr %"struct.std::dcomplex"* %tmp.0.i3647, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i3650 = load double* %tmp.14.i3649 ; <double> [#uses=1]
- %tmp.17.i3652 = getelementptr %"struct.std::dcomplex"* %tmp.0.i3647, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i3653 = load double* %tmp.17.i3652 ; <double> [#uses=1]
- %tmp.4.i3627 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i3626, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i3650, double* %tmp.4.i3627
- %tmp.7.i3630 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i3626, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i3653, double* %tmp.7.i3630
- %tmp.0.i3633 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i3626, %"struct.std::dcomplex"* %tmp.45 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i3634 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1642, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i3635 = getelementptr %"struct.std::dcomplex"* %tmp.0.i3633, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i3636 = load double* %tmp.14.i3635 ; <double> [#uses=1]
- store double %tmp.15.i3636, double* %tmp.13.i3634
- %tmp.16.i3637 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1642, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i3638 = getelementptr %"struct.std::dcomplex"* %tmp.0.i3633, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i3639 = load double* %tmp.17.i3638 ; <double> [#uses=1]
- store double %tmp.18.i3639, double* %tmp.16.i3637
- %tmp.4.i3613 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i3612, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i3692, double* %tmp.4.i3613
- %tmp.7.i3616 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i3612, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i3695, double* %tmp.7.i3616
- %tmp.0.i3619 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i3612, %"struct.std::dcomplex"* %mem_tmp.1642 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i3621 = getelementptr %"struct.std::dcomplex"* %tmp.0.i3619, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i3622 = load double* %tmp.14.i3621 ; <double> [#uses=1]
- %tmp.17.i3624 = getelementptr %"struct.std::dcomplex"* %tmp.0.i3619, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i3625 = load double* %tmp.17.i3624 ; <double> [#uses=1]
- %tmp.4.i3599 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i3598, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i3601 = load double* %tmp.5.i34338 ; <double> [#uses=1]
- store double %tmp.6.i3601, double* %tmp.4.i3599
- %tmp.7.i3602 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i3598, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i3604 = load double* %tmp.8.i34341 ; <double> [#uses=1]
- store double %tmp.9.i3604, double* %tmp.7.i3602
- %tmp.0.i3605 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i3598, %"struct.std::dcomplex"* %tmp.12 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i3607 = getelementptr %"struct.std::dcomplex"* %tmp.0.i3605, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i3608 = load double* %tmp.14.i3607 ; <double> [#uses=1]
- %tmp.17.i3610 = getelementptr %"struct.std::dcomplex"* %tmp.0.i3605, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i3611 = load double* %tmp.17.i3610 ; <double> [#uses=1]
- %tmp.4.i3585 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i3584, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i3587 = load double* %tmp.5.i34352 ; <double> [#uses=1]
- store double %tmp.6.i3587, double* %tmp.4.i3585
- %tmp.7.i3588 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i3584, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i3590 = load double* %tmp.8.i34355 ; <double> [#uses=1]
- store double %tmp.9.i3590, double* %tmp.7.i3588
- %tmp.0.i3591 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i3584, %"struct.std::dcomplex"* %tmp.6 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i3592 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1649, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i3593 = getelementptr %"struct.std::dcomplex"* %tmp.0.i3591, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i3594 = load double* %tmp.14.i3593 ; <double> [#uses=1]
- store double %tmp.15.i3594, double* %tmp.13.i3592
- %tmp.16.i3595 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1649, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i3596 = getelementptr %"struct.std::dcomplex"* %tmp.0.i3591, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i3597 = load double* %tmp.17.i3596 ; <double> [#uses=1]
- store double %tmp.18.i3597, double* %tmp.16.i3595
- %tmp.4.i3571 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i3570, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i3608, double* %tmp.4.i3571
- %tmp.7.i3574 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i3570, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i3611, double* %tmp.7.i3574
- %tmp.0.i3577 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i3570, %"struct.std::dcomplex"* %mem_tmp.1649 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i3579 = getelementptr %"struct.std::dcomplex"* %tmp.0.i3577, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i3580 = load double* %tmp.14.i3579 ; <double> [#uses=1]
- %tmp.17.i3582 = getelementptr %"struct.std::dcomplex"* %tmp.0.i3577, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i3583 = load double* %tmp.17.i3582 ; <double> [#uses=1]
- %tmp.4.i3557 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i3556, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i3580, double* %tmp.4.i3557
- %tmp.7.i3560 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i3556, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i3583, double* %tmp.7.i3560
- %tmp.0.i3563 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i3556, %"struct.std::dcomplex"* %tmp.15 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i3564 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1646, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i3565 = getelementptr %"struct.std::dcomplex"* %tmp.0.i3563, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i3566 = load double* %tmp.14.i3565 ; <double> [#uses=1]
- store double %tmp.15.i3566, double* %tmp.13.i3564
- %tmp.16.i3567 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1646, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i3568 = getelementptr %"struct.std::dcomplex"* %tmp.0.i3563, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i3569 = load double* %tmp.17.i3568 ; <double> [#uses=1]
- store double %tmp.18.i3569, double* %tmp.16.i3567
- %tmp.4.i3543 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i3542, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i3622, double* %tmp.4.i3543
- %tmp.7.i3546 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i3542, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i3625, double* %tmp.7.i3546
- %tmp.0.i3549 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i3542, %"struct.std::dcomplex"* %mem_tmp.1646 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i3551 = getelementptr %"struct.std::dcomplex"* %tmp.0.i3549, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i3552 = load double* %tmp.14.i3551 ; <double> [#uses=1]
- %tmp.17.i3554 = getelementptr %"struct.std::dcomplex"* %tmp.0.i3549, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i3555 = load double* %tmp.17.i3554 ; <double> [#uses=1]
- store double %tmp.15.i3552, double* %tmp.2.i34364
- store double %tmp.18.i3555, double* %tmp.6.i34365
- %tmp.4.i3509 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i3508, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i3511 = load double* %tmp.5.i34136 ; <double> [#uses=1]
- store double %tmp.6.i3511, double* %tmp.4.i3509
- %tmp.7.i3512 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i3508, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i3514 = load double* %tmp.8.i34139 ; <double> [#uses=1]
- store double %tmp.9.i3514, double* %tmp.7.i3512
- %tmp.0.i3515 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i3508, %"struct.std::dcomplex"* %ret3 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i3517 = getelementptr %"struct.std::dcomplex"* %tmp.0.i3515, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i3518 = load double* %tmp.14.i3517 ; <double> [#uses=1]
- %tmp.17.i3520 = getelementptr %"struct.std::dcomplex"* %tmp.0.i3515, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i3521 = load double* %tmp.17.i3520 ; <double> [#uses=1]
- %tmp.7.i3475 = load double* %tmp.2.i34366 ; <double> [#uses=1]
- %tmp.15.i3489 = add double %tmp.7.i3475, %tmp.15.i3518 ; <double> [#uses=1]
- store double %tmp.15.i3489, double* %tmp.2.i34366
- %tmp.26.i3496 = load double* %tmp.6.i34367 ; <double> [#uses=1]
- %tmp.31.i3507 = add double %tmp.26.i3496, %tmp.18.i3521 ; <double> [#uses=1]
- store double %tmp.31.i3507, double* %tmp.6.i34367
- %tmp.4.i3455 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i3454, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i3457 = load double* %tmp.5.i25264 ; <double> [#uses=1]
- store double %tmp.6.i3457, double* %tmp.4.i3455
- %tmp.7.i3458 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i3454, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i3460 = load double* %tmp.8.i25267 ; <double> [#uses=1]
- store double %tmp.9.i3460, double* %tmp.7.i3458
- %tmp.0.i3461 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i3454, %"struct.std::dcomplex"* %ret4 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i3463 = getelementptr %"struct.std::dcomplex"* %tmp.0.i3461, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i3464 = load double* %tmp.14.i3463 ; <double> [#uses=1]
- %tmp.17.i3466 = getelementptr %"struct.std::dcomplex"* %tmp.0.i3461, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i3467 = load double* %tmp.17.i3466 ; <double> [#uses=1]
- %tmp.7.i3421 = load double* %tmp.2.i34368 ; <double> [#uses=1]
- %tmp.15.i3435 = add double %tmp.7.i3421, %tmp.15.i3464 ; <double> [#uses=1]
- store double %tmp.15.i3435, double* %tmp.2.i34368
- %tmp.26.i3442 = load double* %tmp.6.i34369 ; <double> [#uses=1]
- %tmp.31.i3453 = add double %tmp.26.i3442, %tmp.18.i3467 ; <double> [#uses=1]
- store double %tmp.31.i3453, double* %tmp.6.i34369
- store double 0.000000e+00, double* %tmp.2.i34366
- store double 0.000000e+00, double* %tmp.6.i34367
- %tmp.4.i3399 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i3398, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i3401 = load double* %tmp.5.i28602 ; <double> [#uses=1]
- store double %tmp.6.i3401, double* %tmp.4.i3399
- %tmp.7.i3402 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i3398, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i3404 = load double* %tmp.8.i28605 ; <double> [#uses=1]
- store double %tmp.9.i3404, double* %tmp.7.i3402
- %tmp.0.i3405 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i3398, %"struct.std::dcomplex"* %tmp.6 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i3407 = getelementptr %"struct.std::dcomplex"* %tmp.0.i3405, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i3408 = load double* %tmp.14.i3407 ; <double> [#uses=1]
- %tmp.17.i3410 = getelementptr %"struct.std::dcomplex"* %tmp.0.i3405, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i3411 = load double* %tmp.17.i3410 ; <double> [#uses=1]
- %tmp.4.i3385 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i3384, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i3387 = load double* %tmp.5.i34338 ; <double> [#uses=1]
- store double %tmp.6.i3387, double* %tmp.4.i3385
- %tmp.7.i3388 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i3384, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i3390 = load double* %tmp.8.i34341 ; <double> [#uses=1]
- store double %tmp.9.i3390, double* %tmp.7.i3388
- %tmp.0.i3391 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i3384, %"struct.std::dcomplex"* %tmp.1036 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i3392 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1657, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i3393 = getelementptr %"struct.std::dcomplex"* %tmp.0.i3391, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i3394 = load double* %tmp.14.i3393 ; <double> [#uses=1]
- store double %tmp.15.i3394, double* %tmp.13.i3392
- %tmp.16.i3395 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1657, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i3396 = getelementptr %"struct.std::dcomplex"* %tmp.0.i3391, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i3397 = load double* %tmp.17.i3396 ; <double> [#uses=1]
- store double %tmp.18.i3397, double* %tmp.16.i3395
- %tmp.4.i3371 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i3370, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i3408, double* %tmp.4.i3371
- %tmp.7.i3374 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i3370, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i3411, double* %tmp.7.i3374
- %tmp.0.i3377 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i3370, %"struct.std::dcomplex"* %mem_tmp.1657 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i3379 = getelementptr %"struct.std::dcomplex"* %tmp.0.i3377, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i3380 = load double* %tmp.14.i3379 ; <double> [#uses=1]
- %tmp.17.i3382 = getelementptr %"struct.std::dcomplex"* %tmp.0.i3377, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i3383 = load double* %tmp.17.i3382 ; <double> [#uses=1]
- %tmp.4.i3357 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i3356, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i3380, double* %tmp.4.i3357
- %tmp.7.i3360 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i3356, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i3383, double* %tmp.7.i3360
- %tmp.0.i3363 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i3356, %"struct.std::dcomplex"* %tmp.15 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i3365 = getelementptr %"struct.std::dcomplex"* %tmp.0.i3363, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i3366 = load double* %tmp.14.i3365 ; <double> [#uses=1]
- %tmp.17.i3368 = getelementptr %"struct.std::dcomplex"* %tmp.0.i3363, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i3369 = load double* %tmp.17.i3368 ; <double> [#uses=1]
- %tmp.4.i3343 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i3342, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i3345 = load double* %tmp.5.i34338 ; <double> [#uses=1]
- store double %tmp.6.i3345, double* %tmp.4.i3343
- %tmp.7.i3346 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i3342, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i3348 = load double* %tmp.8.i34341 ; <double> [#uses=1]
- store double %tmp.9.i3348, double* %tmp.7.i3346
- %tmp.0.i3349 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i3342, %"struct.std::dcomplex"* %tmp.21 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i3351 = getelementptr %"struct.std::dcomplex"* %tmp.0.i3349, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i3352 = load double* %tmp.14.i3351 ; <double> [#uses=1]
- %tmp.17.i3354 = getelementptr %"struct.std::dcomplex"* %tmp.0.i3349, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i3355 = load double* %tmp.17.i3354 ; <double> [#uses=1]
- %tmp.4.i3329 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i3328, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i3331 = load double* %tmp.5.i34282 ; <double> [#uses=1]
- store double %tmp.6.i3331, double* %tmp.4.i3329
- %tmp.7.i3332 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i3328, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i3334 = load double* %tmp.8.i34285 ; <double> [#uses=1]
- store double %tmp.9.i3334, double* %tmp.7.i3332
- %tmp.0.i3335 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i3328, %"struct.std::dcomplex"* %tmp.6 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i3336 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1661, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i3337 = getelementptr %"struct.std::dcomplex"* %tmp.0.i3335, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i3338 = load double* %tmp.14.i3337 ; <double> [#uses=1]
- store double %tmp.15.i3338, double* %tmp.13.i3336
- %tmp.16.i3339 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1661, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i3340 = getelementptr %"struct.std::dcomplex"* %tmp.0.i3335, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i3341 = load double* %tmp.17.i3340 ; <double> [#uses=1]
- store double %tmp.18.i3341, double* %tmp.16.i3339
- %tmp.4.i3315 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i3314, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i3352, double* %tmp.4.i3315
- %tmp.7.i3318 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i3314, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i3355, double* %tmp.7.i3318
- %tmp.0.i3321 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i3314, %"struct.std::dcomplex"* %mem_tmp.1661 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i3323 = getelementptr %"struct.std::dcomplex"* %tmp.0.i3321, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i3324 = load double* %tmp.14.i3323 ; <double> [#uses=1]
- %tmp.17.i3326 = getelementptr %"struct.std::dcomplex"* %tmp.0.i3321, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i3327 = load double* %tmp.17.i3326 ; <double> [#uses=1]
- %tmp.4.i3301 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i3300, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i3324, double* %tmp.4.i3301
- %tmp.7.i3304 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i3300, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i3327, double* %tmp.7.i3304
- %tmp.0.i3307 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i3300, %"struct.std::dcomplex"* %tmp.1075 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i3308 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1658, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i3309 = getelementptr %"struct.std::dcomplex"* %tmp.0.i3307, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i3310 = load double* %tmp.14.i3309 ; <double> [#uses=1]
- store double %tmp.15.i3310, double* %tmp.13.i3308
- %tmp.16.i3311 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1658, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i3312 = getelementptr %"struct.std::dcomplex"* %tmp.0.i3307, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i3313 = load double* %tmp.17.i3312 ; <double> [#uses=1]
- store double %tmp.18.i3313, double* %tmp.16.i3311
- %tmp.4.i3287 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i3286, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i3366, double* %tmp.4.i3287
- %tmp.7.i3290 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i3286, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i3369, double* %tmp.7.i3290
- %tmp.0.i3293 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i3286, %"struct.std::dcomplex"* %mem_tmp.1658 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i3295 = getelementptr %"struct.std::dcomplex"* %tmp.0.i3293, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i3296 = load double* %tmp.14.i3295 ; <double> [#uses=1]
- %tmp.17.i3298 = getelementptr %"struct.std::dcomplex"* %tmp.0.i3293, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i3299 = load double* %tmp.17.i3298 ; <double> [#uses=1]
- %tmp.4.i3273 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i3272, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i3275 = load double* %tmp.5.i34282 ; <double> [#uses=1]
- store double %tmp.6.i3275, double* %tmp.4.i3273
- %tmp.7.i3276 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i3272, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i3278 = load double* %tmp.8.i34285 ; <double> [#uses=1]
- store double %tmp.9.i3278, double* %tmp.7.i3276
- %tmp.0.i3279 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i3272, %"struct.std::dcomplex"* %tmp.1036 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i3281 = getelementptr %"struct.std::dcomplex"* %tmp.0.i3279, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i3282 = load double* %tmp.14.i3281 ; <double> [#uses=1]
- %tmp.17.i3284 = getelementptr %"struct.std::dcomplex"* %tmp.0.i3279, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i3285 = load double* %tmp.17.i3284 ; <double> [#uses=1]
- %tmp.4.i3259 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i3258, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i3261 = load double* %tmp.5.i28602 ; <double> [#uses=1]
- store double %tmp.6.i3261, double* %tmp.4.i3259
- %tmp.7.i3262 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i3258, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i3264 = load double* %tmp.8.i28605 ; <double> [#uses=1]
- store double %tmp.9.i3264, double* %tmp.7.i3262
- %tmp.0.i3265 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i3258, %"struct.std::dcomplex"* %tmp.21 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i3266 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1665, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i3267 = getelementptr %"struct.std::dcomplex"* %tmp.0.i3265, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i3268 = load double* %tmp.14.i3267 ; <double> [#uses=1]
- store double %tmp.15.i3268, double* %tmp.13.i3266
- %tmp.16.i3269 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1665, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i3270 = getelementptr %"struct.std::dcomplex"* %tmp.0.i3265, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i3271 = load double* %tmp.17.i3270 ; <double> [#uses=1]
- store double %tmp.18.i3271, double* %tmp.16.i3269
- %tmp.4.i3245 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i3244, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i3282, double* %tmp.4.i3245
- %tmp.7.i3248 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i3244, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i3285, double* %tmp.7.i3248
- %tmp.0.i3251 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i3244, %"struct.std::dcomplex"* %mem_tmp.1665 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i3253 = getelementptr %"struct.std::dcomplex"* %tmp.0.i3251, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i3254 = load double* %tmp.14.i3253 ; <double> [#uses=1]
- %tmp.17.i3256 = getelementptr %"struct.std::dcomplex"* %tmp.0.i3251, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i3257 = load double* %tmp.17.i3256 ; <double> [#uses=1]
- %tmp.4.i3231 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i3230, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i3254, double* %tmp.4.i3231
- %tmp.7.i3234 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i3230, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i3257, double* %tmp.7.i3234
- %tmp.0.i3237 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i3230, %"struct.std::dcomplex"* %tmp.45 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i3238 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1662, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i3239 = getelementptr %"struct.std::dcomplex"* %tmp.0.i3237, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i3240 = load double* %tmp.14.i3239 ; <double> [#uses=1]
- store double %tmp.15.i3240, double* %tmp.13.i3238
- %tmp.16.i3241 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1662, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i3242 = getelementptr %"struct.std::dcomplex"* %tmp.0.i3237, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i3243 = load double* %tmp.17.i3242 ; <double> [#uses=1]
- store double %tmp.18.i3243, double* %tmp.16.i3241
- %tmp.4.i3217 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i3216, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i3296, double* %tmp.4.i3217
- %tmp.7.i3220 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i3216, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i3299, double* %tmp.7.i3220
- %tmp.0.i3223 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i3216, %"struct.std::dcomplex"* %mem_tmp.1662 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i3225 = getelementptr %"struct.std::dcomplex"* %tmp.0.i3223, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i3226 = load double* %tmp.14.i3225 ; <double> [#uses=1]
- %tmp.17.i3228 = getelementptr %"struct.std::dcomplex"* %tmp.0.i3223, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i3229 = load double* %tmp.17.i3228 ; <double> [#uses=1]
- store double %tmp.15.i3226, double* %tmp.2.i34364
- store double %tmp.18.i3229, double* %tmp.6.i34365
- %tmp.4.i3183 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i3182, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i3185 = load double* %tmp.5.i34136 ; <double> [#uses=1]
- store double %tmp.6.i3185, double* %tmp.4.i3183
- %tmp.7.i3186 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i3182, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i3188 = load double* %tmp.8.i34139 ; <double> [#uses=1]
- store double %tmp.9.i3188, double* %tmp.7.i3186
- %tmp.0.i3189 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i3182, %"struct.std::dcomplex"* %ret3 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i3191 = getelementptr %"struct.std::dcomplex"* %tmp.0.i3189, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i3192 = load double* %tmp.14.i3191 ; <double> [#uses=1]
- %tmp.17.i3194 = getelementptr %"struct.std::dcomplex"* %tmp.0.i3189, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i3195 = load double* %tmp.17.i3194 ; <double> [#uses=1]
- %tmp.7.i3149 = load double* %tmp.2.i34366 ; <double> [#uses=1]
- %tmp.15.i3163 = add double %tmp.7.i3149, %tmp.15.i3192 ; <double> [#uses=1]
- store double %tmp.15.i3163, double* %tmp.2.i34366
- %tmp.26.i3170 = load double* %tmp.6.i34367 ; <double> [#uses=1]
- %tmp.31.i3181 = add double %tmp.26.i3170, %tmp.18.i3195 ; <double> [#uses=1]
- store double %tmp.31.i3181, double* %tmp.6.i34367
- %tmp.4.i3129 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i3128, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i3131 = load double* %tmp.5.i34082 ; <double> [#uses=1]
- store double %tmp.6.i3131, double* %tmp.4.i3129
- %tmp.7.i3132 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i3128, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i3134 = load double* %tmp.8.i34085 ; <double> [#uses=1]
- store double %tmp.9.i3134, double* %tmp.7.i3132
- %tmp.0.i3135 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i3128, %"struct.std::dcomplex"* %tmp.21 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i3137 = getelementptr %"struct.std::dcomplex"* %tmp.0.i3135, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i3138 = load double* %tmp.14.i3137 ; <double> [#uses=1]
- %tmp.17.i3140 = getelementptr %"struct.std::dcomplex"* %tmp.0.i3135, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i3141 = load double* %tmp.17.i3140 ; <double> [#uses=1]
- %tmp.4.i3115 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i3114, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i3117 = load double* %tmp.5.i34282 ; <double> [#uses=1]
- store double %tmp.6.i3117, double* %tmp.4.i3115
- %tmp.7.i3118 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i3114, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i3120 = load double* %tmp.8.i34285 ; <double> [#uses=1]
- store double %tmp.9.i3120, double* %tmp.7.i3118
- %tmp.0.i3121 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i3114, %"struct.std::dcomplex"* %tmp.62 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i3122 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1672, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i3123 = getelementptr %"struct.std::dcomplex"* %tmp.0.i3121, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i3124 = load double* %tmp.14.i3123 ; <double> [#uses=1]
- store double %tmp.15.i3124, double* %tmp.13.i3122
- %tmp.16.i3125 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1672, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i3126 = getelementptr %"struct.std::dcomplex"* %tmp.0.i3121, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i3127 = load double* %tmp.17.i3126 ; <double> [#uses=1]
- store double %tmp.18.i3127, double* %tmp.16.i3125
- %tmp.4.i3101 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i3100, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i3138, double* %tmp.4.i3101
- %tmp.7.i3104 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i3100, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i3141, double* %tmp.7.i3104
- %tmp.0.i3107 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i3100, %"struct.std::dcomplex"* %mem_tmp.1672 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i3109 = getelementptr %"struct.std::dcomplex"* %tmp.0.i3107, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i3110 = load double* %tmp.14.i3109 ; <double> [#uses=1]
- %tmp.17.i3112 = getelementptr %"struct.std::dcomplex"* %tmp.0.i3107, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i3113 = load double* %tmp.17.i3112 ; <double> [#uses=1]
- %tmp.4.i3087 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i3086, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i3110, double* %tmp.4.i3087
- %tmp.7.i3090 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i3086, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i3113, double* %tmp.7.i3090
- %tmp.0.i3093 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i3086, %"struct.std::dcomplex"* %tmp.45 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i3095 = getelementptr %"struct.std::dcomplex"* %tmp.0.i3093, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i3096 = load double* %tmp.14.i3095 ; <double> [#uses=1]
- %tmp.17.i3098 = getelementptr %"struct.std::dcomplex"* %tmp.0.i3093, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i3099 = load double* %tmp.17.i3098 ; <double> [#uses=1]
- %tmp.4.i3073 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i3072, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i3075 = load double* %tmp.5.i34338 ; <double> [#uses=1]
- store double %tmp.6.i3075, double* %tmp.4.i3073
- %tmp.7.i3076 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i3072, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i3078 = load double* %tmp.8.i34341 ; <double> [#uses=1]
- store double %tmp.9.i3078, double* %tmp.7.i3076
- %tmp.0.i3079 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i3072, %"struct.std::dcomplex"* %tmp.62 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i3081 = getelementptr %"struct.std::dcomplex"* %tmp.0.i3079, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i3082 = load double* %tmp.14.i3081 ; <double> [#uses=1]
- %tmp.17.i3084 = getelementptr %"struct.std::dcomplex"* %tmp.0.i3079, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i3085 = load double* %tmp.17.i3084 ; <double> [#uses=1]
- %tmp.4.i3059 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i3058, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i3061 = load double* %tmp.5.i34082 ; <double> [#uses=1]
- store double %tmp.6.i3061, double* %tmp.4.i3059
- %tmp.7.i3062 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i3058, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i3064 = load double* %tmp.8.i34085 ; <double> [#uses=1]
- store double %tmp.9.i3064, double* %tmp.7.i3062
- %tmp.0.i3065 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i3058, %"struct.std::dcomplex"* %tmp.6 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i3066 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1676, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i3067 = getelementptr %"struct.std::dcomplex"* %tmp.0.i3065, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i3068 = load double* %tmp.14.i3067 ; <double> [#uses=1]
- store double %tmp.15.i3068, double* %tmp.13.i3066
- %tmp.16.i3069 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1676, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i3070 = getelementptr %"struct.std::dcomplex"* %tmp.0.i3065, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i3071 = load double* %tmp.17.i3070 ; <double> [#uses=1]
- store double %tmp.18.i3071, double* %tmp.16.i3069
- %tmp.4.i3045 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i3044, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i3082, double* %tmp.4.i3045
- %tmp.7.i3048 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i3044, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i3085, double* %tmp.7.i3048
- %tmp.0.i3051 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i3044, %"struct.std::dcomplex"* %mem_tmp.1676 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i3053 = getelementptr %"struct.std::dcomplex"* %tmp.0.i3051, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i3054 = load double* %tmp.14.i3053 ; <double> [#uses=1]
- %tmp.17.i3056 = getelementptr %"struct.std::dcomplex"* %tmp.0.i3051, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i3057 = load double* %tmp.17.i3056 ; <double> [#uses=1]
- %tmp.4.i3031 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i3030, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i3054, double* %tmp.4.i3031
- %tmp.7.i3034 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i3030, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i3057, double* %tmp.7.i3034
- %tmp.0.i3037 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i3030, %"struct.std::dcomplex"* %tmp.15 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i3038 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1673, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i3039 = getelementptr %"struct.std::dcomplex"* %tmp.0.i3037, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i3040 = load double* %tmp.14.i3039 ; <double> [#uses=1]
- store double %tmp.15.i3040, double* %tmp.13.i3038
- %tmp.16.i3041 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1673, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i3042 = getelementptr %"struct.std::dcomplex"* %tmp.0.i3037, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i3043 = load double* %tmp.17.i3042 ; <double> [#uses=1]
- store double %tmp.18.i3043, double* %tmp.16.i3041
- %tmp.4.i3017 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i3016, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i3096, double* %tmp.4.i3017
- %tmp.7.i3020 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i3016, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i3099, double* %tmp.7.i3020
- %tmp.0.i3023 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i3016, %"struct.std::dcomplex"* %mem_tmp.1673 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i3025 = getelementptr %"struct.std::dcomplex"* %tmp.0.i3023, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i3026 = load double* %tmp.14.i3025 ; <double> [#uses=1]
- %tmp.17.i3028 = getelementptr %"struct.std::dcomplex"* %tmp.0.i3023, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i3029 = load double* %tmp.17.i3028 ; <double> [#uses=1]
- %tmp.4.i3003 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i3002, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i3005 = load double* %tmp.5.i34282 ; <double> [#uses=1]
- store double %tmp.6.i3005, double* %tmp.4.i3003
- %tmp.7.i3006 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i3002, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i3008 = load double* %tmp.8.i34285 ; <double> [#uses=1]
- store double %tmp.9.i3008, double* %tmp.7.i3006
- %tmp.0.i3009 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i3002, %"struct.std::dcomplex"* %tmp.6 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i3011 = getelementptr %"struct.std::dcomplex"* %tmp.0.i3009, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i3012 = load double* %tmp.14.i3011 ; <double> [#uses=1]
- %tmp.17.i3014 = getelementptr %"struct.std::dcomplex"* %tmp.0.i3009, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i3015 = load double* %tmp.17.i3014 ; <double> [#uses=1]
- %tmp.4.i2989 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i2988, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i2991 = load double* %tmp.5.i34338 ; <double> [#uses=1]
- store double %tmp.6.i2991, double* %tmp.4.i2989
- %tmp.7.i2992 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i2988, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i2994 = load double* %tmp.8.i34341 ; <double> [#uses=1]
- store double %tmp.9.i2994, double* %tmp.7.i2992
- %tmp.0.i2995 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i2988, %"struct.std::dcomplex"* %tmp.21 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i2996 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1680, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i2997 = getelementptr %"struct.std::dcomplex"* %tmp.0.i2995, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i2998 = load double* %tmp.14.i2997 ; <double> [#uses=1]
- store double %tmp.15.i2998, double* %tmp.13.i2996
- %tmp.16.i2999 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1680, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i3000 = getelementptr %"struct.std::dcomplex"* %tmp.0.i2995, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i3001 = load double* %tmp.17.i3000 ; <double> [#uses=1]
- store double %tmp.18.i3001, double* %tmp.16.i2999
- %tmp.4.i2975 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i2974, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i3012, double* %tmp.4.i2975
- %tmp.7.i2978 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i2974, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i3015, double* %tmp.7.i2978
- %tmp.0.i2981 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i2974, %"struct.std::dcomplex"* %mem_tmp.1680 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i2983 = getelementptr %"struct.std::dcomplex"* %tmp.0.i2981, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i2984 = load double* %tmp.14.i2983 ; <double> [#uses=1]
- %tmp.17.i2986 = getelementptr %"struct.std::dcomplex"* %tmp.0.i2981, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i2987 = load double* %tmp.17.i2986 ; <double> [#uses=1]
- %tmp.4.i2961 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i2960, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i2984, double* %tmp.4.i2961
- %tmp.7.i2964 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i2960, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i2987, double* %tmp.7.i2964
- %tmp.0.i2967 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i2960, %"struct.std::dcomplex"* %tmp.95 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i2968 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1677, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i2969 = getelementptr %"struct.std::dcomplex"* %tmp.0.i2967, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i2970 = load double* %tmp.14.i2969 ; <double> [#uses=1]
- store double %tmp.15.i2970, double* %tmp.13.i2968
- %tmp.16.i2971 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1677, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i2972 = getelementptr %"struct.std::dcomplex"* %tmp.0.i2967, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i2973 = load double* %tmp.17.i2972 ; <double> [#uses=1]
- store double %tmp.18.i2973, double* %tmp.16.i2971
- %tmp.4.i2947 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i2946, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i3026, double* %tmp.4.i2947
- %tmp.7.i2950 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i2946, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i3029, double* %tmp.7.i2950
- %tmp.0.i2953 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i2946, %"struct.std::dcomplex"* %mem_tmp.1677 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i2955 = getelementptr %"struct.std::dcomplex"* %tmp.0.i2953, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i2956 = load double* %tmp.14.i2955 ; <double> [#uses=1]
- %tmp.17.i2958 = getelementptr %"struct.std::dcomplex"* %tmp.0.i2953, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i2959 = load double* %tmp.17.i2958 ; <double> [#uses=1]
- store double %tmp.15.i2956, double* %tmp.2.i34364
- store double %tmp.18.i2959, double* %tmp.6.i34365
- %tmp.4.i2913 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i2912, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i2915 = load double* %tmp.5.i27590 ; <double> [#uses=1]
- store double %tmp.6.i2915, double* %tmp.4.i2913
- %tmp.7.i2916 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i2912, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i2918 = load double* %tmp.8.i27593 ; <double> [#uses=1]
- store double %tmp.9.i2918, double* %tmp.7.i2916
- %tmp.0.i2919 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i2912, %"struct.std::dcomplex"* %ret3 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i2921 = getelementptr %"struct.std::dcomplex"* %tmp.0.i2919, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i2922 = load double* %tmp.14.i2921 ; <double> [#uses=1]
- %tmp.17.i2924 = getelementptr %"struct.std::dcomplex"* %tmp.0.i2919, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i2925 = load double* %tmp.17.i2924 ; <double> [#uses=1]
- %tmp.7.i2879 = load double* %tmp.2.i34366 ; <double> [#uses=1]
- %tmp.15.i2893 = add double %tmp.7.i2879, %tmp.15.i2922 ; <double> [#uses=1]
- store double %tmp.15.i2893, double* %tmp.2.i34366
- %tmp.26.i2900 = load double* %tmp.6.i34367 ; <double> [#uses=1]
- %tmp.31.i2911 = add double %tmp.26.i2900, %tmp.18.i2925 ; <double> [#uses=1]
- store double %tmp.31.i2911, double* %tmp.6.i34367
- %tmp.4.i2859 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i2858, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i2861 = load double* %tmp.5.i28602 ; <double> [#uses=1]
- store double %tmp.6.i2861, double* %tmp.4.i2859
- %tmp.7.i2862 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i2858, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i2864 = load double* %tmp.8.i28605 ; <double> [#uses=1]
- store double %tmp.9.i2864, double* %tmp.7.i2862
- %tmp.0.i2865 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i2858, %"struct.std::dcomplex"* %tmp.21 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i2867 = getelementptr %"struct.std::dcomplex"* %tmp.0.i2865, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i2868 = load double* %tmp.14.i2867 ; <double> [#uses=1]
- %tmp.17.i2870 = getelementptr %"struct.std::dcomplex"* %tmp.0.i2865, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i2871 = load double* %tmp.17.i2870 ; <double> [#uses=1]
- %tmp.4.i2845 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i2844, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i2847 = load double* %tmp.5.i34282 ; <double> [#uses=1]
- store double %tmp.6.i2847, double* %tmp.4.i2845
- %tmp.7.i2848 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i2844, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i2850 = load double* %tmp.8.i34285 ; <double> [#uses=1]
- store double %tmp.9.i2850, double* %tmp.7.i2848
- %tmp.0.i2851 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i2844, %"struct.std::dcomplex"* %tmp.1036 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i2852 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1687, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i2853 = getelementptr %"struct.std::dcomplex"* %tmp.0.i2851, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i2854 = load double* %tmp.14.i2853 ; <double> [#uses=1]
- store double %tmp.15.i2854, double* %tmp.13.i2852
- %tmp.16.i2855 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1687, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i2856 = getelementptr %"struct.std::dcomplex"* %tmp.0.i2851, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i2857 = load double* %tmp.17.i2856 ; <double> [#uses=1]
- store double %tmp.18.i2857, double* %tmp.16.i2855
- %tmp.4.i2831 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i2830, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i2868, double* %tmp.4.i2831
- %tmp.7.i2834 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i2830, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i2871, double* %tmp.7.i2834
- %tmp.0.i2837 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i2830, %"struct.std::dcomplex"* %mem_tmp.1687 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i2839 = getelementptr %"struct.std::dcomplex"* %tmp.0.i2837, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i2840 = load double* %tmp.14.i2839 ; <double> [#uses=1]
- %tmp.17.i2842 = getelementptr %"struct.std::dcomplex"* %tmp.0.i2837, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i2843 = load double* %tmp.17.i2842 ; <double> [#uses=1]
- %tmp.4.i2817 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i2816, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i2840, double* %tmp.4.i2817
- %tmp.7.i2820 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i2816, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i2843, double* %tmp.7.i2820
- %tmp.0.i2823 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i2816, %"struct.std::dcomplex"* %tmp.95 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i2825 = getelementptr %"struct.std::dcomplex"* %tmp.0.i2823, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i2826 = load double* %tmp.14.i2825 ; <double> [#uses=1]
- %tmp.17.i2828 = getelementptr %"struct.std::dcomplex"* %tmp.0.i2823, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i2829 = load double* %tmp.17.i2828 ; <double> [#uses=1]
- %tmp.4.i2803 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i2802, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i2805 = load double* %tmp.5.i34282 ; <double> [#uses=1]
- store double %tmp.6.i2805, double* %tmp.4.i2803
- %tmp.7.i2806 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i2802, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i2808 = load double* %tmp.8.i34285 ; <double> [#uses=1]
- store double %tmp.9.i2808, double* %tmp.7.i2806
- %tmp.0.i2809 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i2802, %"struct.std::dcomplex"* %tmp.62 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i2811 = getelementptr %"struct.std::dcomplex"* %tmp.0.i2809, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i2812 = load double* %tmp.14.i2811 ; <double> [#uses=1]
- %tmp.17.i2814 = getelementptr %"struct.std::dcomplex"* %tmp.0.i2809, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i2815 = load double* %tmp.17.i2814 ; <double> [#uses=1]
- %tmp.4.i2789 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i2788, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i2791 = load double* %tmp.5.i34082 ; <double> [#uses=1]
- store double %tmp.6.i2791, double* %tmp.4.i2789
- %tmp.7.i2792 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i2788, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i2794 = load double* %tmp.8.i34085 ; <double> [#uses=1]
- store double %tmp.9.i2794, double* %tmp.7.i2792
- %tmp.0.i2795 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i2788, %"struct.std::dcomplex"* %tmp.21 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i2796 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1691, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i2797 = getelementptr %"struct.std::dcomplex"* %tmp.0.i2795, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i2798 = load double* %tmp.14.i2797 ; <double> [#uses=1]
- store double %tmp.15.i2798, double* %tmp.13.i2796
- %tmp.16.i2799 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1691, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i2800 = getelementptr %"struct.std::dcomplex"* %tmp.0.i2795, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i2801 = load double* %tmp.17.i2800 ; <double> [#uses=1]
- store double %tmp.18.i2801, double* %tmp.16.i2799
- %tmp.4.i2775 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i2774, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i2812, double* %tmp.4.i2775
- %tmp.7.i2778 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i2774, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i2815, double* %tmp.7.i2778
- %tmp.0.i2781 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i2774, %"struct.std::dcomplex"* %mem_tmp.1691 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i2783 = getelementptr %"struct.std::dcomplex"* %tmp.0.i2781, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i2784 = load double* %tmp.14.i2783 ; <double> [#uses=1]
- %tmp.17.i2786 = getelementptr %"struct.std::dcomplex"* %tmp.0.i2781, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i2787 = load double* %tmp.17.i2786 ; <double> [#uses=1]
- %tmp.4.i2761 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i2760, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i2784, double* %tmp.4.i2761
- %tmp.7.i2764 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i2760, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i2787, double* %tmp.7.i2764
- %tmp.0.i2767 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i2760, %"struct.std::dcomplex"* %tmp.1075 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i2768 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1688, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i2769 = getelementptr %"struct.std::dcomplex"* %tmp.0.i2767, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i2770 = load double* %tmp.14.i2769 ; <double> [#uses=1]
- store double %tmp.15.i2770, double* %tmp.13.i2768
- %tmp.16.i2771 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1688, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i2772 = getelementptr %"struct.std::dcomplex"* %tmp.0.i2767, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i2773 = load double* %tmp.17.i2772 ; <double> [#uses=1]
- store double %tmp.18.i2773, double* %tmp.16.i2771
- %tmp.4.i2747 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i2746, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i2826, double* %tmp.4.i2747
- %tmp.7.i2750 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i2746, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i2829, double* %tmp.7.i2750
- %tmp.0.i2753 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i2746, %"struct.std::dcomplex"* %mem_tmp.1688 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i2755 = getelementptr %"struct.std::dcomplex"* %tmp.0.i2753, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i2756 = load double* %tmp.14.i2755 ; <double> [#uses=1]
- %tmp.17.i2758 = getelementptr %"struct.std::dcomplex"* %tmp.0.i2753, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i2759 = load double* %tmp.17.i2758 ; <double> [#uses=1]
- %tmp.4.i2733 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i2732, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i2735 = load double* %tmp.5.i34082 ; <double> [#uses=1]
- store double %tmp.6.i2735, double* %tmp.4.i2733
- %tmp.7.i2736 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i2732, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i2738 = load double* %tmp.8.i34085 ; <double> [#uses=1]
- store double %tmp.9.i2738, double* %tmp.7.i2736
- %tmp.0.i2739 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i2732, %"struct.std::dcomplex"* %tmp.1036 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i2741 = getelementptr %"struct.std::dcomplex"* %tmp.0.i2739, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i2742 = load double* %tmp.14.i2741 ; <double> [#uses=1]
- %tmp.17.i2744 = getelementptr %"struct.std::dcomplex"* %tmp.0.i2739, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i2745 = load double* %tmp.17.i2744 ; <double> [#uses=1]
- %tmp.4.i2719 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i2718, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i2721 = load double* %tmp.5.i28602 ; <double> [#uses=1]
- store double %tmp.6.i2721, double* %tmp.4.i2719
- %tmp.7.i2722 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i2718, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i2724 = load double* %tmp.8.i28605 ; <double> [#uses=1]
- store double %tmp.9.i2724, double* %tmp.7.i2722
- %tmp.0.i2725 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i2718, %"struct.std::dcomplex"* %tmp.62 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i2726 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1695, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i2727 = getelementptr %"struct.std::dcomplex"* %tmp.0.i2725, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i2728 = load double* %tmp.14.i2727 ; <double> [#uses=1]
- store double %tmp.15.i2728, double* %tmp.13.i2726
- %tmp.16.i2729 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1695, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i2730 = getelementptr %"struct.std::dcomplex"* %tmp.0.i2725, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i2731 = load double* %tmp.17.i2730 ; <double> [#uses=1]
- store double %tmp.18.i2731, double* %tmp.16.i2729
- %tmp.4.i2705 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i2704, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i2742, double* %tmp.4.i2705
- %tmp.7.i2708 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i2704, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i2745, double* %tmp.7.i2708
- %tmp.0.i2711 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i2704, %"struct.std::dcomplex"* %mem_tmp.1695 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i2713 = getelementptr %"struct.std::dcomplex"* %tmp.0.i2711, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i2714 = load double* %tmp.14.i2713 ; <double> [#uses=1]
- %tmp.17.i2716 = getelementptr %"struct.std::dcomplex"* %tmp.0.i2711, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i2717 = load double* %tmp.17.i2716 ; <double> [#uses=1]
- %tmp.4.i2691 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i2690, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i2714, double* %tmp.4.i2691
- %tmp.7.i2694 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i2690, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i2717, double* %tmp.7.i2694
- %tmp.0.i2697 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i2690, %"struct.std::dcomplex"* %tmp.15 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i2698 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1692, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i2699 = getelementptr %"struct.std::dcomplex"* %tmp.0.i2697, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i2700 = load double* %tmp.14.i2699 ; <double> [#uses=1]
- store double %tmp.15.i2700, double* %tmp.13.i2698
- %tmp.16.i2701 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1692, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i2702 = getelementptr %"struct.std::dcomplex"* %tmp.0.i2697, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i2703 = load double* %tmp.17.i2702 ; <double> [#uses=1]
- store double %tmp.18.i2703, double* %tmp.16.i2701
- %tmp.4.i2677 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i2676, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i2756, double* %tmp.4.i2677
- %tmp.7.i2680 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i2676, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i2759, double* %tmp.7.i2680
- %tmp.0.i2683 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i2676, %"struct.std::dcomplex"* %mem_tmp.1692 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i2685 = getelementptr %"struct.std::dcomplex"* %tmp.0.i2683, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i2686 = load double* %tmp.14.i2685 ; <double> [#uses=1]
- %tmp.17.i2688 = getelementptr %"struct.std::dcomplex"* %tmp.0.i2683, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i2689 = load double* %tmp.17.i2688 ; <double> [#uses=1]
- store double %tmp.15.i2686, double* %tmp.2.i34364
- store double %tmp.18.i2689, double* %tmp.6.i34365
- %tmp.4.i2643 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i2642, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i2645 = load double* %tmp.5.i33596 ; <double> [#uses=1]
- store double %tmp.6.i2645, double* %tmp.4.i2643
- %tmp.7.i2646 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i2642, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i2648 = load double* %tmp.8.i33599 ; <double> [#uses=1]
- store double %tmp.9.i2648, double* %tmp.7.i2646
- %tmp.0.i2649 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i2642, %"struct.std::dcomplex"* %ret3 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i2651 = getelementptr %"struct.std::dcomplex"* %tmp.0.i2649, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i2652 = load double* %tmp.14.i2651 ; <double> [#uses=1]
- %tmp.17.i2654 = getelementptr %"struct.std::dcomplex"* %tmp.0.i2649, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i2655 = load double* %tmp.17.i2654 ; <double> [#uses=1]
- %tmp.7.i2609 = load double* %tmp.2.i34366 ; <double> [#uses=1]
- %tmp.15.i2623 = add double %tmp.7.i2609, %tmp.15.i2652 ; <double> [#uses=1]
- store double %tmp.15.i2623, double* %tmp.2.i34366
- %tmp.26.i2630 = load double* %tmp.6.i34367 ; <double> [#uses=1]
- %tmp.31.i2641 = add double %tmp.26.i2630, %tmp.18.i2655 ; <double> [#uses=1]
- store double %tmp.31.i2641, double* %tmp.6.i34367
- %tmp.4.i2589 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i2588, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i2591 = load double* %tmp.5.i28602 ; <double> [#uses=1]
- store double %tmp.6.i2591, double* %tmp.4.i2589
- %tmp.7.i2592 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i2588, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i2594 = load double* %tmp.8.i28605 ; <double> [#uses=1]
- store double %tmp.9.i2594, double* %tmp.7.i2592
- %tmp.0.i2595 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i2588, %"struct.std::dcomplex"* %tmp.62 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i2597 = getelementptr %"struct.std::dcomplex"* %tmp.0.i2595, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i2598 = load double* %tmp.14.i2597 ; <double> [#uses=1]
- %tmp.17.i2600 = getelementptr %"struct.std::dcomplex"* %tmp.0.i2595, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i2601 = load double* %tmp.17.i2600 ; <double> [#uses=1]
- %tmp.4.i2575 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i2574, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i2577 = load double* %tmp.5.i34082 ; <double> [#uses=1]
- store double %tmp.6.i2577, double* %tmp.4.i2575
- %tmp.7.i2578 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i2574, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i2580 = load double* %tmp.8.i34085 ; <double> [#uses=1]
- store double %tmp.9.i2580, double* %tmp.7.i2578
- %tmp.0.i2581 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i2574, %"struct.std::dcomplex"* %tmp.1036 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i2582 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1702, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i2583 = getelementptr %"struct.std::dcomplex"* %tmp.0.i2581, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i2584 = load double* %tmp.14.i2583 ; <double> [#uses=1]
- store double %tmp.15.i2584, double* %tmp.13.i2582
- %tmp.16.i2585 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1702, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i2586 = getelementptr %"struct.std::dcomplex"* %tmp.0.i2581, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i2587 = load double* %tmp.17.i2586 ; <double> [#uses=1]
- store double %tmp.18.i2587, double* %tmp.16.i2585
- %tmp.4.i2561 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i2560, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i2598, double* %tmp.4.i2561
- %tmp.7.i2564 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i2560, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i2601, double* %tmp.7.i2564
- %tmp.0.i2567 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i2560, %"struct.std::dcomplex"* %mem_tmp.1702 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i2569 = getelementptr %"struct.std::dcomplex"* %tmp.0.i2567, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i2570 = load double* %tmp.14.i2569 ; <double> [#uses=1]
- %tmp.17.i2572 = getelementptr %"struct.std::dcomplex"* %tmp.0.i2567, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i2573 = load double* %tmp.17.i2572 ; <double> [#uses=1]
- %tmp.4.i2547 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i2546, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i2570, double* %tmp.4.i2547
- %tmp.7.i2550 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i2546, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i2573, double* %tmp.7.i2550
- %tmp.0.i2553 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i2546, %"struct.std::dcomplex"* %tmp.45 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i2555 = getelementptr %"struct.std::dcomplex"* %tmp.0.i2553, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i2556 = load double* %tmp.14.i2555 ; <double> [#uses=1]
- %tmp.17.i2558 = getelementptr %"struct.std::dcomplex"* %tmp.0.i2553, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i2559 = load double* %tmp.17.i2558 ; <double> [#uses=1]
- %tmp.4.i2533 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i2532, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i2535 = load double* %tmp.5.i34338 ; <double> [#uses=1]
- store double %tmp.6.i2535, double* %tmp.4.i2533
- %tmp.7.i2536 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i2532, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i2538 = load double* %tmp.8.i34341 ; <double> [#uses=1]
- store double %tmp.9.i2538, double* %tmp.7.i2536
- %tmp.0.i2539 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i2532, %"struct.std::dcomplex"* %tmp.1036 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i2541 = getelementptr %"struct.std::dcomplex"* %tmp.0.i2539, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i2542 = load double* %tmp.14.i2541 ; <double> [#uses=1]
- %tmp.17.i2544 = getelementptr %"struct.std::dcomplex"* %tmp.0.i2539, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i2545 = load double* %tmp.17.i2544 ; <double> [#uses=1]
- %tmp.4.i2519 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i2518, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i2521 = load double* %tmp.5.i28602 ; <double> [#uses=1]
- store double %tmp.6.i2521, double* %tmp.4.i2519
- %tmp.7.i2522 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i2518, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i2524 = load double* %tmp.8.i28605 ; <double> [#uses=1]
- store double %tmp.9.i2524, double* %tmp.7.i2522
- %tmp.0.i2525 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i2518, %"struct.std::dcomplex"* %tmp.6 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i2526 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1706, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i2527 = getelementptr %"struct.std::dcomplex"* %tmp.0.i2525, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i2528 = load double* %tmp.14.i2527 ; <double> [#uses=1]
- store double %tmp.15.i2528, double* %tmp.13.i2526
- %tmp.16.i2529 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1706, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i2530 = getelementptr %"struct.std::dcomplex"* %tmp.0.i2525, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i2531 = load double* %tmp.17.i2530 ; <double> [#uses=1]
- store double %tmp.18.i2531, double* %tmp.16.i2529
- %tmp.4.i2505 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i2504, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i2542, double* %tmp.4.i2505
- %tmp.7.i2508 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i2504, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i2545, double* %tmp.7.i2508
- %tmp.0.i2511 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i2504, %"struct.std::dcomplex"* %mem_tmp.1706 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i2513 = getelementptr %"struct.std::dcomplex"* %tmp.0.i2511, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i2514 = load double* %tmp.14.i2513 ; <double> [#uses=1]
- %tmp.17.i2516 = getelementptr %"struct.std::dcomplex"* %tmp.0.i2511, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i2517 = load double* %tmp.17.i2516 ; <double> [#uses=1]
- %tmp.4.i2491 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i2490, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i2514, double* %tmp.4.i2491
- %tmp.7.i2494 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i2490, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i2517, double* %tmp.7.i2494
- %tmp.0.i2497 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i2490, %"struct.std::dcomplex"* %tmp.95 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i2498 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1703, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i2499 = getelementptr %"struct.std::dcomplex"* %tmp.0.i2497, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i2500 = load double* %tmp.14.i2499 ; <double> [#uses=1]
- store double %tmp.15.i2500, double* %tmp.13.i2498
- %tmp.16.i2501 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1703, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i2502 = getelementptr %"struct.std::dcomplex"* %tmp.0.i2497, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i2503 = load double* %tmp.17.i2502 ; <double> [#uses=1]
- store double %tmp.18.i2503, double* %tmp.16.i2501
- %tmp.4.i2477 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i2476, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i2556, double* %tmp.4.i2477
- %tmp.7.i2480 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i2476, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i2559, double* %tmp.7.i2480
- %tmp.0.i2483 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i2476, %"struct.std::dcomplex"* %mem_tmp.1703 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i2485 = getelementptr %"struct.std::dcomplex"* %tmp.0.i2483, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i2486 = load double* %tmp.14.i2485 ; <double> [#uses=1]
- %tmp.17.i2488 = getelementptr %"struct.std::dcomplex"* %tmp.0.i2483, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i2489 = load double* %tmp.17.i2488 ; <double> [#uses=1]
- %tmp.4.i2463 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i2462, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i2465 = load double* %tmp.5.i34082 ; <double> [#uses=1]
- store double %tmp.6.i2465, double* %tmp.4.i2463
- %tmp.7.i2466 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i2462, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i2468 = load double* %tmp.8.i34085 ; <double> [#uses=1]
- store double %tmp.9.i2468, double* %tmp.7.i2466
- %tmp.0.i2469 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i2462, %"struct.std::dcomplex"* %tmp.6 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i2471 = getelementptr %"struct.std::dcomplex"* %tmp.0.i2469, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i2472 = load double* %tmp.14.i2471 ; <double> [#uses=1]
- %tmp.17.i2474 = getelementptr %"struct.std::dcomplex"* %tmp.0.i2469, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i2475 = load double* %tmp.17.i2474 ; <double> [#uses=1]
- %tmp.4.i2449 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i2448, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i2451 = load double* %tmp.5.i34338 ; <double> [#uses=1]
- store double %tmp.6.i2451, double* %tmp.4.i2449
- %tmp.7.i2452 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i2448, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i2454 = load double* %tmp.8.i34341 ; <double> [#uses=1]
- store double %tmp.9.i2454, double* %tmp.7.i2452
- %tmp.0.i2455 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i2448, %"struct.std::dcomplex"* %tmp.62 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i2456 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1710, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i2457 = getelementptr %"struct.std::dcomplex"* %tmp.0.i2455, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i2458 = load double* %tmp.14.i2457 ; <double> [#uses=1]
- store double %tmp.15.i2458, double* %tmp.13.i2456
- %tmp.16.i2459 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1710, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i2460 = getelementptr %"struct.std::dcomplex"* %tmp.0.i2455, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i2461 = load double* %tmp.17.i2460 ; <double> [#uses=1]
- store double %tmp.18.i2461, double* %tmp.16.i2459
- %tmp.4.i2435 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i2434, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i2472, double* %tmp.4.i2435
- %tmp.7.i2438 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i2434, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i2475, double* %tmp.7.i2438
- %tmp.0.i2441 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i2434, %"struct.std::dcomplex"* %mem_tmp.1710 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i2443 = getelementptr %"struct.std::dcomplex"* %tmp.0.i2441, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i2444 = load double* %tmp.14.i2443 ; <double> [#uses=1]
- %tmp.17.i2446 = getelementptr %"struct.std::dcomplex"* %tmp.0.i2441, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i2447 = load double* %tmp.17.i2446 ; <double> [#uses=1]
- %tmp.4.i2421 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i2420, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i2444, double* %tmp.4.i2421
- %tmp.7.i2424 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i2420, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i2447, double* %tmp.7.i2424
- %tmp.0.i2427 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i2420, %"struct.std::dcomplex"* %tmp.1075 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i2428 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1707, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i2429 = getelementptr %"struct.std::dcomplex"* %tmp.0.i2427, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i2430 = load double* %tmp.14.i2429 ; <double> [#uses=1]
- store double %tmp.15.i2430, double* %tmp.13.i2428
- %tmp.16.i2431 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1707, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i2432 = getelementptr %"struct.std::dcomplex"* %tmp.0.i2427, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i2433 = load double* %tmp.17.i2432 ; <double> [#uses=1]
- store double %tmp.18.i2433, double* %tmp.16.i2431
- %tmp.4.i2407 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i2406, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i2486, double* %tmp.4.i2407
- %tmp.7.i2410 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i2406, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i2489, double* %tmp.7.i2410
- %tmp.0.i2413 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i2406, %"struct.std::dcomplex"* %mem_tmp.1707 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i2415 = getelementptr %"struct.std::dcomplex"* %tmp.0.i2413, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i2416 = load double* %tmp.14.i2415 ; <double> [#uses=1]
- %tmp.17.i2418 = getelementptr %"struct.std::dcomplex"* %tmp.0.i2413, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i2419 = load double* %tmp.17.i2418 ; <double> [#uses=1]
- store double %tmp.15.i2416, double* %tmp.2.i34364
- store double %tmp.18.i2419, double* %tmp.6.i34365
- %tmp.4.i2373 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i2372, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i2375 = load double* %tmp.5.i33326 ; <double> [#uses=1]
- store double %tmp.6.i2375, double* %tmp.4.i2373
- %tmp.7.i2376 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i2372, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i2378 = load double* %tmp.8.i33329 ; <double> [#uses=1]
- store double %tmp.9.i2378, double* %tmp.7.i2376
- %tmp.0.i2379 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i2372, %"struct.std::dcomplex"* %ret3 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i2381 = getelementptr %"struct.std::dcomplex"* %tmp.0.i2379, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i2382 = load double* %tmp.14.i2381 ; <double> [#uses=1]
- %tmp.17.i2384 = getelementptr %"struct.std::dcomplex"* %tmp.0.i2379, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i2385 = load double* %tmp.17.i2384 ; <double> [#uses=1]
- %tmp.7.i2339 = load double* %tmp.2.i34366 ; <double> [#uses=1]
- %tmp.15.i2353 = add double %tmp.7.i2339, %tmp.15.i2382 ; <double> [#uses=1]
- store double %tmp.15.i2353, double* %tmp.2.i34366
- %tmp.26.i2360 = load double* %tmp.6.i34367 ; <double> [#uses=1]
- %tmp.31.i2371 = add double %tmp.26.i2360, %tmp.18.i2385 ; <double> [#uses=1]
- store double %tmp.31.i2371, double* %tmp.6.i34367
- %tmp.4.i2319 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i2318, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i2321 = load double* %tmp.5.i32136 ; <double> [#uses=1]
- store double %tmp.6.i2321, double* %tmp.4.i2319
- %tmp.7.i2322 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i2318, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i2324 = load double* %tmp.8.i32139 ; <double> [#uses=1]
- store double %tmp.9.i2324, double* %tmp.7.i2322
- %tmp.0.i2325 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i2318, %"struct.std::dcomplex"* %ret4 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i2327 = getelementptr %"struct.std::dcomplex"* %tmp.0.i2325, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i2328 = load double* %tmp.14.i2327 ; <double> [#uses=1]
- %tmp.17.i2330 = getelementptr %"struct.std::dcomplex"* %tmp.0.i2325, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i2331 = load double* %tmp.17.i2330 ; <double> [#uses=1]
- %tmp.7.i2285 = load double* %tmp.2.i34368 ; <double> [#uses=1]
- %tmp.15.i2299 = add double %tmp.7.i2285, %tmp.15.i2328 ; <double> [#uses=1]
- store double %tmp.15.i2299, double* %tmp.2.i34368
- %tmp.26.i2306 = load double* %tmp.6.i34369 ; <double> [#uses=1]
- %tmp.31.i2317 = add double %tmp.26.i2306, %tmp.18.i2331 ; <double> [#uses=1]
- store double %tmp.31.i2317, double* %tmp.6.i34369
- store double 0.000000e+00, double* %tmp.2.i34366
- store double 0.000000e+00, double* %tmp.6.i34367
- %tmp.4.i2263 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i2262, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i2265 = load double* %tmp.5.i34352 ; <double> [#uses=1]
- store double %tmp.6.i2265, double* %tmp.4.i2263
- %tmp.7.i2266 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i2262, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i2268 = load double* %tmp.8.i34355 ; <double> [#uses=1]
- store double %tmp.9.i2268, double* %tmp.7.i2266
- %tmp.0.i2269 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i2262, %"struct.std::dcomplex"* %tmp.62 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i2271 = getelementptr %"struct.std::dcomplex"* %tmp.0.i2269, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i2272 = load double* %tmp.14.i2271 ; <double> [#uses=1]
- %tmp.17.i2274 = getelementptr %"struct.std::dcomplex"* %tmp.0.i2269, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i2275 = load double* %tmp.17.i2274 ; <double> [#uses=1]
- %tmp.4.i2249 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i2248, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i2251 = load double* %tmp.5.i34082 ; <double> [#uses=1]
- store double %tmp.6.i2251, double* %tmp.4.i2249
- %tmp.7.i2252 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i2248, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i2254 = load double* %tmp.8.i34085 ; <double> [#uses=1]
- store double %tmp.9.i2254, double* %tmp.7.i2252
- %tmp.0.i2255 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i2248, %"struct.std::dcomplex"* %tmp.12 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i2256 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1718, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i2257 = getelementptr %"struct.std::dcomplex"* %tmp.0.i2255, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i2258 = load double* %tmp.14.i2257 ; <double> [#uses=1]
- store double %tmp.15.i2258, double* %tmp.13.i2256
- %tmp.16.i2259 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1718, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i2260 = getelementptr %"struct.std::dcomplex"* %tmp.0.i2255, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i2261 = load double* %tmp.17.i2260 ; <double> [#uses=1]
- store double %tmp.18.i2261, double* %tmp.16.i2259
- %tmp.4.i2235 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i2234, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i2272, double* %tmp.4.i2235
- %tmp.7.i2238 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i2234, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i2275, double* %tmp.7.i2238
- %tmp.0.i2241 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i2234, %"struct.std::dcomplex"* %mem_tmp.1718 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i2243 = getelementptr %"struct.std::dcomplex"* %tmp.0.i2241, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i2244 = load double* %tmp.14.i2243 ; <double> [#uses=1]
- %tmp.17.i2246 = getelementptr %"struct.std::dcomplex"* %tmp.0.i2241, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i2247 = load double* %tmp.17.i2246 ; <double> [#uses=1]
- %tmp.4.i2221 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i2220, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i2244, double* %tmp.4.i2221
- %tmp.7.i2224 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i2220, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i2247, double* %tmp.7.i2224
- %tmp.0.i2227 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i2220, %"struct.std::dcomplex"* %tmp.1075 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i2229 = getelementptr %"struct.std::dcomplex"* %tmp.0.i2227, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i2230 = load double* %tmp.14.i2229 ; <double> [#uses=1]
- %tmp.17.i2232 = getelementptr %"struct.std::dcomplex"* %tmp.0.i2227, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i2233 = load double* %tmp.17.i2232 ; <double> [#uses=1]
- %tmp.4.i2207 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i2206, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i2209 = load double* %tmp.5.i34082 ; <double> [#uses=1]
- store double %tmp.6.i2209, double* %tmp.4.i2207
- %tmp.7.i2210 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i2206, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i2212 = load double* %tmp.8.i34085 ; <double> [#uses=1]
- store double %tmp.9.i2212, double* %tmp.7.i2210
- %tmp.0.i2213 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i2206, %"struct.std::dcomplex"* %tmp.1036 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i2215 = getelementptr %"struct.std::dcomplex"* %tmp.0.i2213, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i2216 = load double* %tmp.14.i2215 ; <double> [#uses=1]
- %tmp.17.i2218 = getelementptr %"struct.std::dcomplex"* %tmp.0.i2213, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i2219 = load double* %tmp.17.i2218 ; <double> [#uses=1]
- %tmp.4.i2193 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i2192, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i2195 = load double* %tmp.5.i28602 ; <double> [#uses=1]
- store double %tmp.6.i2195, double* %tmp.4.i2193
- %tmp.7.i2196 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i2192, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i2198 = load double* %tmp.8.i28605 ; <double> [#uses=1]
- store double %tmp.9.i2198, double* %tmp.7.i2196
- %tmp.0.i2199 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i2192, %"struct.std::dcomplex"* %tmp.62 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i2200 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1722, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i2201 = getelementptr %"struct.std::dcomplex"* %tmp.0.i2199, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i2202 = load double* %tmp.14.i2201 ; <double> [#uses=1]
- store double %tmp.15.i2202, double* %tmp.13.i2200
- %tmp.16.i2203 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1722, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i2204 = getelementptr %"struct.std::dcomplex"* %tmp.0.i2199, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i2205 = load double* %tmp.17.i2204 ; <double> [#uses=1]
- store double %tmp.18.i2205, double* %tmp.16.i2203
- %tmp.4.i2179 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i2178, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i2216, double* %tmp.4.i2179
- %tmp.7.i2182 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i2178, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i2219, double* %tmp.7.i2182
- %tmp.0.i2185 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i2178, %"struct.std::dcomplex"* %mem_tmp.1722 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i2187 = getelementptr %"struct.std::dcomplex"* %tmp.0.i2185, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i2188 = load double* %tmp.14.i2187 ; <double> [#uses=1]
- %tmp.17.i2190 = getelementptr %"struct.std::dcomplex"* %tmp.0.i2185, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i2191 = load double* %tmp.17.i2190 ; <double> [#uses=1]
- %tmp.4.i2165 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i2164, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i2188, double* %tmp.4.i2165
- %tmp.7.i2168 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i2164, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i2191, double* %tmp.7.i2168
- %tmp.0.i2171 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i2164, %"struct.std::dcomplex"* %tmp.30 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i2172 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1719, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i2173 = getelementptr %"struct.std::dcomplex"* %tmp.0.i2171, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i2174 = load double* %tmp.14.i2173 ; <double> [#uses=1]
- store double %tmp.15.i2174, double* %tmp.13.i2172
- %tmp.16.i2175 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1719, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i2176 = getelementptr %"struct.std::dcomplex"* %tmp.0.i2171, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i2177 = load double* %tmp.17.i2176 ; <double> [#uses=1]
- store double %tmp.18.i2177, double* %tmp.16.i2175
- %tmp.4.i2151 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i2150, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i2230, double* %tmp.4.i2151
- %tmp.7.i2154 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i2150, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i2233, double* %tmp.7.i2154
- %tmp.0.i2157 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i2150, %"struct.std::dcomplex"* %mem_tmp.1719 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i2159 = getelementptr %"struct.std::dcomplex"* %tmp.0.i2157, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i2160 = load double* %tmp.14.i2159 ; <double> [#uses=1]
- %tmp.17.i2162 = getelementptr %"struct.std::dcomplex"* %tmp.0.i2157, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i2163 = load double* %tmp.17.i2162 ; <double> [#uses=1]
- %tmp.4.i2137 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i2136, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i2139 = load double* %tmp.5.i28602 ; <double> [#uses=1]
- store double %tmp.6.i2139, double* %tmp.4.i2137
- %tmp.7.i2140 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i2136, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i2142 = load double* %tmp.8.i28605 ; <double> [#uses=1]
- store double %tmp.9.i2142, double* %tmp.7.i2140
- %tmp.0.i2143 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i2136, %"struct.std::dcomplex"* %tmp.12 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i2145 = getelementptr %"struct.std::dcomplex"* %tmp.0.i2143, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i2146 = load double* %tmp.14.i2145 ; <double> [#uses=1]
- %tmp.17.i2148 = getelementptr %"struct.std::dcomplex"* %tmp.0.i2143, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i2149 = load double* %tmp.17.i2148 ; <double> [#uses=1]
- %tmp.4.i2123 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i2122, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i2125 = load double* %tmp.5.i34352 ; <double> [#uses=1]
- store double %tmp.6.i2125, double* %tmp.4.i2123
- %tmp.7.i2126 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i2122, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i2128 = load double* %tmp.8.i34355 ; <double> [#uses=1]
- store double %tmp.9.i2128, double* %tmp.7.i2126
- %tmp.0.i2129 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i2122, %"struct.std::dcomplex"* %tmp.1036 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i2130 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1726, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i2131 = getelementptr %"struct.std::dcomplex"* %tmp.0.i2129, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i2132 = load double* %tmp.14.i2131 ; <double> [#uses=1]
- store double %tmp.15.i2132, double* %tmp.13.i2130
- %tmp.16.i2133 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1726, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i2134 = getelementptr %"struct.std::dcomplex"* %tmp.0.i2129, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i2135 = load double* %tmp.17.i2134 ; <double> [#uses=1]
- store double %tmp.18.i2135, double* %tmp.16.i2133
- %tmp.4.i2109 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i2108, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i2146, double* %tmp.4.i2109
- %tmp.7.i2112 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i2108, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i2149, double* %tmp.7.i2112
- %tmp.0.i2115 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i2108, %"struct.std::dcomplex"* %mem_tmp.1726 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i2117 = getelementptr %"struct.std::dcomplex"* %tmp.0.i2115, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i2118 = load double* %tmp.14.i2117 ; <double> [#uses=1]
- %tmp.17.i2120 = getelementptr %"struct.std::dcomplex"* %tmp.0.i2115, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i2121 = load double* %tmp.17.i2120 ; <double> [#uses=1]
- %tmp.4.i2095 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i2094, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i2118, double* %tmp.4.i2095
- %tmp.7.i2098 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i2094, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i2121, double* %tmp.7.i2098
- %tmp.0.i2101 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i2094, %"struct.std::dcomplex"* %tmp.95 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i2102 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1723, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i2103 = getelementptr %"struct.std::dcomplex"* %tmp.0.i2101, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i2104 = load double* %tmp.14.i2103 ; <double> [#uses=1]
- store double %tmp.15.i2104, double* %tmp.13.i2102
- %tmp.16.i2105 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1723, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i2106 = getelementptr %"struct.std::dcomplex"* %tmp.0.i2101, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i2107 = load double* %tmp.17.i2106 ; <double> [#uses=1]
- store double %tmp.18.i2107, double* %tmp.16.i2105
- %tmp.4.i2081 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i2080, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i2160, double* %tmp.4.i2081
- %tmp.7.i2084 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i2080, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i2163, double* %tmp.7.i2084
- %tmp.0.i2087 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i2080, %"struct.std::dcomplex"* %mem_tmp.1723 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i2089 = getelementptr %"struct.std::dcomplex"* %tmp.0.i2087, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i2090 = load double* %tmp.14.i2089 ; <double> [#uses=1]
- %tmp.17.i2092 = getelementptr %"struct.std::dcomplex"* %tmp.0.i2087, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i2093 = load double* %tmp.17.i2092 ; <double> [#uses=1]
- store double %tmp.15.i2090, double* %tmp.2.i34364
- store double %tmp.18.i2093, double* %tmp.6.i34365
- %tmp.4.i2047 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i2046, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i2049 = load double* %tmp.5.i33326 ; <double> [#uses=1]
- store double %tmp.6.i2049, double* %tmp.4.i2047
- %tmp.7.i2050 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i2046, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i2052 = load double* %tmp.8.i33329 ; <double> [#uses=1]
- store double %tmp.9.i2052, double* %tmp.7.i2050
- %tmp.0.i2053 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i2046, %"struct.std::dcomplex"* %ret3 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i2055 = getelementptr %"struct.std::dcomplex"* %tmp.0.i2053, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i2056 = load double* %tmp.14.i2055 ; <double> [#uses=1]
- %tmp.17.i2058 = getelementptr %"struct.std::dcomplex"* %tmp.0.i2053, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i2059 = load double* %tmp.17.i2058 ; <double> [#uses=1]
- %tmp.7.i2013 = load double* %tmp.2.i34366 ; <double> [#uses=1]
- %tmp.15.i2027 = add double %tmp.7.i2013, %tmp.15.i2056 ; <double> [#uses=1]
- store double %tmp.15.i2027, double* %tmp.2.i34366
- %tmp.26.i2034 = load double* %tmp.6.i34367 ; <double> [#uses=1]
- %tmp.31.i2045 = add double %tmp.26.i2034, %tmp.18.i2059 ; <double> [#uses=1]
- store double %tmp.31.i2045, double* %tmp.6.i34367
- %tmp.4.i1993 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i1992, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i1995 = load double* %tmp.5.i34352 ; <double> [#uses=1]
- store double %tmp.6.i1995, double* %tmp.4.i1993
- %tmp.7.i1996 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i1992, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i1998 = load double* %tmp.8.i34355 ; <double> [#uses=1]
- store double %tmp.9.i1998, double* %tmp.7.i1996
- %tmp.0.i1999 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i1992, %"struct.std::dcomplex"* %tmp.1036 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i2001 = getelementptr %"struct.std::dcomplex"* %tmp.0.i1999, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i2002 = load double* %tmp.14.i2001 ; <double> [#uses=1]
- %tmp.17.i2004 = getelementptr %"struct.std::dcomplex"* %tmp.0.i1999, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i2005 = load double* %tmp.17.i2004 ; <double> [#uses=1]
- %tmp.4.i1979 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i1978, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i1981 = load double* %tmp.5.i28602 ; <double> [#uses=1]
- store double %tmp.6.i1981, double* %tmp.4.i1979
- %tmp.7.i1982 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i1978, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i1984 = load double* %tmp.8.i28605 ; <double> [#uses=1]
- store double %tmp.9.i1984, double* %tmp.7.i1982
- %tmp.0.i1985 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i1978, %"struct.std::dcomplex"* %tmp.12 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i1986 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1733, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i1987 = getelementptr %"struct.std::dcomplex"* %tmp.0.i1985, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i1988 = load double* %tmp.14.i1987 ; <double> [#uses=1]
- store double %tmp.15.i1988, double* %tmp.13.i1986
- %tmp.16.i1989 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1733, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i1990 = getelementptr %"struct.std::dcomplex"* %tmp.0.i1985, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i1991 = load double* %tmp.17.i1990 ; <double> [#uses=1]
- store double %tmp.18.i1991, double* %tmp.16.i1989
- %tmp.4.i1965 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i1964, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i2002, double* %tmp.4.i1965
- %tmp.7.i1968 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i1964, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i2005, double* %tmp.7.i1968
- %tmp.0.i1971 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i1964, %"struct.std::dcomplex"* %mem_tmp.1733 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i1973 = getelementptr %"struct.std::dcomplex"* %tmp.0.i1971, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i1974 = load double* %tmp.14.i1973 ; <double> [#uses=1]
- %tmp.17.i1976 = getelementptr %"struct.std::dcomplex"* %tmp.0.i1971, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i1977 = load double* %tmp.17.i1976 ; <double> [#uses=1]
- %tmp.4.i1951 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i1950, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i1974, double* %tmp.4.i1951
- %tmp.7.i1954 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i1950, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i1977, double* %tmp.7.i1954
- %tmp.0.i1957 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i1950, %"struct.std::dcomplex"* %tmp.15 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i1959 = getelementptr %"struct.std::dcomplex"* %tmp.0.i1957, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i1960 = load double* %tmp.14.i1959 ; <double> [#uses=1]
- %tmp.17.i1962 = getelementptr %"struct.std::dcomplex"* %tmp.0.i1957, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i1963 = load double* %tmp.17.i1962 ; <double> [#uses=1]
- %tmp.4.i1937 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i1936, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i1939 = load double* %tmp.5.i34282 ; <double> [#uses=1]
- store double %tmp.6.i1939, double* %tmp.4.i1937
- %tmp.7.i1940 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i1936, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i1942 = load double* %tmp.8.i34285 ; <double> [#uses=1]
- store double %tmp.9.i1942, double* %tmp.7.i1940
- %tmp.0.i1943 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i1936, %"struct.std::dcomplex"* %tmp.12 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i1945 = getelementptr %"struct.std::dcomplex"* %tmp.0.i1943, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i1946 = load double* %tmp.14.i1945 ; <double> [#uses=1]
- %tmp.17.i1948 = getelementptr %"struct.std::dcomplex"* %tmp.0.i1943, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i1949 = load double* %tmp.17.i1948 ; <double> [#uses=1]
- %tmp.4.i1923 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i1922, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i1925 = load double* %tmp.5.i34352 ; <double> [#uses=1]
- store double %tmp.6.i1925, double* %tmp.4.i1923
- %tmp.7.i1926 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i1922, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i1928 = load double* %tmp.8.i34355 ; <double> [#uses=1]
- store double %tmp.9.i1928, double* %tmp.7.i1926
- %tmp.0.i1929 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i1922, %"struct.std::dcomplex"* %tmp.21 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i1930 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1737, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i1931 = getelementptr %"struct.std::dcomplex"* %tmp.0.i1929, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i1932 = load double* %tmp.14.i1931 ; <double> [#uses=1]
- store double %tmp.15.i1932, double* %tmp.13.i1930
- %tmp.16.i1933 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1737, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i1934 = getelementptr %"struct.std::dcomplex"* %tmp.0.i1929, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i1935 = load double* %tmp.17.i1934 ; <double> [#uses=1]
- store double %tmp.18.i1935, double* %tmp.16.i1933
- %tmp.4.i1909 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i1908, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i1946, double* %tmp.4.i1909
- %tmp.7.i1912 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i1908, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i1949, double* %tmp.7.i1912
- %tmp.0.i1915 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i1908, %"struct.std::dcomplex"* %mem_tmp.1737 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i1917 = getelementptr %"struct.std::dcomplex"* %tmp.0.i1915, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i1918 = load double* %tmp.14.i1917 ; <double> [#uses=1]
- %tmp.17.i1920 = getelementptr %"struct.std::dcomplex"* %tmp.0.i1915, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i1921 = load double* %tmp.17.i1920 ; <double> [#uses=1]
- %tmp.4.i1895 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i1894, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i1918, double* %tmp.4.i1895
- %tmp.7.i1898 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i1894, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i1921, double* %tmp.7.i1898
- %tmp.0.i1901 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i1894, %"struct.std::dcomplex"* %tmp.1075 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i1902 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1734, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i1903 = getelementptr %"struct.std::dcomplex"* %tmp.0.i1901, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i1904 = load double* %tmp.14.i1903 ; <double> [#uses=1]
- store double %tmp.15.i1904, double* %tmp.13.i1902
- %tmp.16.i1905 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1734, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i1906 = getelementptr %"struct.std::dcomplex"* %tmp.0.i1901, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i1907 = load double* %tmp.17.i1906 ; <double> [#uses=1]
- store double %tmp.18.i1907, double* %tmp.16.i1905
- %tmp.4.i1881 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i1880, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i1960, double* %tmp.4.i1881
- %tmp.7.i1884 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i1880, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i1963, double* %tmp.7.i1884
- %tmp.0.i1887 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i1880, %"struct.std::dcomplex"* %mem_tmp.1734 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i1889 = getelementptr %"struct.std::dcomplex"* %tmp.0.i1887, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i1890 = load double* %tmp.14.i1889 ; <double> [#uses=1]
- %tmp.17.i1892 = getelementptr %"struct.std::dcomplex"* %tmp.0.i1887, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i1893 = load double* %tmp.17.i1892 ; <double> [#uses=1]
- %tmp.4.i1867 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i1866, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i1869 = load double* %tmp.5.i28602 ; <double> [#uses=1]
- store double %tmp.6.i1869, double* %tmp.4.i1867
- %tmp.7.i1870 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i1866, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i1872 = load double* %tmp.8.i28605 ; <double> [#uses=1]
- store double %tmp.9.i1872, double* %tmp.7.i1870
- %tmp.0.i1873 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i1866, %"struct.std::dcomplex"* %tmp.21 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i1875 = getelementptr %"struct.std::dcomplex"* %tmp.0.i1873, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i1876 = load double* %tmp.14.i1875 ; <double> [#uses=1]
- %tmp.17.i1878 = getelementptr %"struct.std::dcomplex"* %tmp.0.i1873, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i1879 = load double* %tmp.17.i1878 ; <double> [#uses=1]
- %tmp.4.i1853 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i1852, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i1855 = load double* %tmp.5.i34282 ; <double> [#uses=1]
- store double %tmp.6.i1855, double* %tmp.4.i1853
- %tmp.7.i1856 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i1852, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i1858 = load double* %tmp.8.i34285 ; <double> [#uses=1]
- store double %tmp.9.i1858, double* %tmp.7.i1856
- %tmp.0.i1859 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i1852, %"struct.std::dcomplex"* %tmp.1036 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i1860 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1741, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i1861 = getelementptr %"struct.std::dcomplex"* %tmp.0.i1859, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i1862 = load double* %tmp.14.i1861 ; <double> [#uses=1]
- store double %tmp.15.i1862, double* %tmp.13.i1860
- %tmp.16.i1863 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1741, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i1864 = getelementptr %"struct.std::dcomplex"* %tmp.0.i1859, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i1865 = load double* %tmp.17.i1864 ; <double> [#uses=1]
- store double %tmp.18.i1865, double* %tmp.16.i1863
- %tmp.4.i1839 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i1838, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i1876, double* %tmp.4.i1839
- %tmp.7.i1842 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i1838, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i1879, double* %tmp.7.i1842
- %tmp.0.i1845 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i1838, %"struct.std::dcomplex"* %mem_tmp.1741 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i1847 = getelementptr %"struct.std::dcomplex"* %tmp.0.i1845, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i1848 = load double* %tmp.14.i1847 ; <double> [#uses=1]
- %tmp.17.i1850 = getelementptr %"struct.std::dcomplex"* %tmp.0.i1845, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i1851 = load double* %tmp.17.i1850 ; <double> [#uses=1]
- %tmp.4.i1825 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i1824, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i1848, double* %tmp.4.i1825
- %tmp.7.i1828 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i1824, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i1851, double* %tmp.7.i1828
- %tmp.0.i1831 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i1824, %"struct.std::dcomplex"* %tmp.30 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i1832 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1738, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i1833 = getelementptr %"struct.std::dcomplex"* %tmp.0.i1831, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i1834 = load double* %tmp.14.i1833 ; <double> [#uses=1]
- store double %tmp.15.i1834, double* %tmp.13.i1832
- %tmp.16.i1835 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1738, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i1836 = getelementptr %"struct.std::dcomplex"* %tmp.0.i1831, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i1837 = load double* %tmp.17.i1836 ; <double> [#uses=1]
- store double %tmp.18.i1837, double* %tmp.16.i1835
- %tmp.4.i1811 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i1810, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i1890, double* %tmp.4.i1811
- %tmp.7.i1814 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i1810, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i1893, double* %tmp.7.i1814
- %tmp.0.i1817 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i1810, %"struct.std::dcomplex"* %mem_tmp.1738 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i1819 = getelementptr %"struct.std::dcomplex"* %tmp.0.i1817, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i1820 = load double* %tmp.14.i1819 ; <double> [#uses=1]
- %tmp.17.i1822 = getelementptr %"struct.std::dcomplex"* %tmp.0.i1817, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i1823 = load double* %tmp.17.i1822 ; <double> [#uses=1]
- store double %tmp.15.i1820, double* %tmp.2.i34364
- store double %tmp.18.i1823, double* %tmp.6.i34365
- %tmp.4.i1777 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i1776, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i1779 = load double* %tmp.5.i34136 ; <double> [#uses=1]
- store double %tmp.6.i1779, double* %tmp.4.i1777
- %tmp.7.i1780 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i1776, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i1782 = load double* %tmp.8.i34139 ; <double> [#uses=1]
- store double %tmp.9.i1782, double* %tmp.7.i1780
- %tmp.0.i1783 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i1776, %"struct.std::dcomplex"* %ret3 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i1785 = getelementptr %"struct.std::dcomplex"* %tmp.0.i1783, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i1786 = load double* %tmp.14.i1785 ; <double> [#uses=1]
- %tmp.17.i1788 = getelementptr %"struct.std::dcomplex"* %tmp.0.i1783, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i1789 = load double* %tmp.17.i1788 ; <double> [#uses=1]
- %tmp.7.i1743 = load double* %tmp.2.i34366 ; <double> [#uses=1]
- %tmp.15.i1757 = add double %tmp.7.i1743, %tmp.15.i1786 ; <double> [#uses=1]
- store double %tmp.15.i1757, double* %tmp.2.i34366
- %tmp.26.i1764 = load double* %tmp.6.i34367 ; <double> [#uses=1]
- %tmp.31.i1775 = add double %tmp.26.i1764, %tmp.18.i1789 ; <double> [#uses=1]
- store double %tmp.31.i1775, double* %tmp.6.i34367
- %tmp.4.i1723 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i1722, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i1725 = load double* %tmp.5.i34282 ; <double> [#uses=1]
- store double %tmp.6.i1725, double* %tmp.4.i1723
- %tmp.7.i1726 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i1722, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i1728 = load double* %tmp.8.i34285 ; <double> [#uses=1]
- store double %tmp.9.i1728, double* %tmp.7.i1726
- %tmp.0.i1729 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i1722, %"struct.std::dcomplex"* %tmp.62 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i1731 = getelementptr %"struct.std::dcomplex"* %tmp.0.i1729, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i1732 = load double* %tmp.14.i1731 ; <double> [#uses=1]
- %tmp.17.i1734 = getelementptr %"struct.std::dcomplex"* %tmp.0.i1729, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i1735 = load double* %tmp.17.i1734 ; <double> [#uses=1]
- %tmp.4.i1709 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i1708, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i1711 = load double* %tmp.5.i34082 ; <double> [#uses=1]
- store double %tmp.6.i1711, double* %tmp.4.i1709
- %tmp.7.i1712 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i1708, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i1714 = load double* %tmp.8.i34085 ; <double> [#uses=1]
- store double %tmp.9.i1714, double* %tmp.7.i1712
- %tmp.0.i1715 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i1708, %"struct.std::dcomplex"* %tmp.21 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i1716 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1748, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i1717 = getelementptr %"struct.std::dcomplex"* %tmp.0.i1715, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i1718 = load double* %tmp.14.i1717 ; <double> [#uses=1]
- store double %tmp.15.i1718, double* %tmp.13.i1716
- %tmp.16.i1719 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1748, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i1720 = getelementptr %"struct.std::dcomplex"* %tmp.0.i1715, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i1721 = load double* %tmp.17.i1720 ; <double> [#uses=1]
- store double %tmp.18.i1721, double* %tmp.16.i1719
- %tmp.4.i1695 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i1694, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i1732, double* %tmp.4.i1695
- %tmp.7.i1698 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i1694, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i1735, double* %tmp.7.i1698
- %tmp.0.i1701 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i1694, %"struct.std::dcomplex"* %mem_tmp.1748 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i1703 = getelementptr %"struct.std::dcomplex"* %tmp.0.i1701, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i1704 = load double* %tmp.14.i1703 ; <double> [#uses=1]
- %tmp.17.i1706 = getelementptr %"struct.std::dcomplex"* %tmp.0.i1701, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i1707 = load double* %tmp.17.i1706 ; <double> [#uses=1]
- %tmp.4.i1681 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i1680, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i1704, double* %tmp.4.i1681
- %tmp.7.i1684 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i1680, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i1707, double* %tmp.7.i1684
- %tmp.0.i1687 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i1680, %"struct.std::dcomplex"* %tmp.30 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i1689 = getelementptr %"struct.std::dcomplex"* %tmp.0.i1687, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i1690 = load double* %tmp.14.i1689 ; <double> [#uses=1]
- %tmp.17.i1692 = getelementptr %"struct.std::dcomplex"* %tmp.0.i1687, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i1693 = load double* %tmp.17.i1692 ; <double> [#uses=1]
- %tmp.4.i1667 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i1666, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i1669 = load double* %tmp.5.i34082 ; <double> [#uses=1]
- store double %tmp.6.i1669, double* %tmp.4.i1667
- %tmp.7.i1670 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i1666, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i1672 = load double* %tmp.8.i34085 ; <double> [#uses=1]
- store double %tmp.9.i1672, double* %tmp.7.i1670
- %tmp.0.i1673 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i1666, %"struct.std::dcomplex"* %tmp.12 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i1675 = getelementptr %"struct.std::dcomplex"* %tmp.0.i1673, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i1676 = load double* %tmp.14.i1675 ; <double> [#uses=1]
- %tmp.17.i1678 = getelementptr %"struct.std::dcomplex"* %tmp.0.i1673, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i1679 = load double* %tmp.17.i1678 ; <double> [#uses=1]
- %tmp.4.i1653 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i1652, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i1655 = load double* %tmp.5.i34352 ; <double> [#uses=1]
- store double %tmp.6.i1655, double* %tmp.4.i1653
- %tmp.7.i1656 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i1652, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i1658 = load double* %tmp.8.i34355 ; <double> [#uses=1]
- store double %tmp.9.i1658, double* %tmp.7.i1656
- %tmp.0.i1659 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i1652, %"struct.std::dcomplex"* %tmp.62 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i1660 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1752, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i1661 = getelementptr %"struct.std::dcomplex"* %tmp.0.i1659, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i1662 = load double* %tmp.14.i1661 ; <double> [#uses=1]
- store double %tmp.15.i1662, double* %tmp.13.i1660
- %tmp.16.i1663 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1752, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i1664 = getelementptr %"struct.std::dcomplex"* %tmp.0.i1659, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i1665 = load double* %tmp.17.i1664 ; <double> [#uses=1]
- store double %tmp.18.i1665, double* %tmp.16.i1663
- %tmp.4.i1639 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i1638, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i1676, double* %tmp.4.i1639
- %tmp.7.i1642 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i1638, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i1679, double* %tmp.7.i1642
- %tmp.0.i1645 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i1638, %"struct.std::dcomplex"* %mem_tmp.1752 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i1647 = getelementptr %"struct.std::dcomplex"* %tmp.0.i1645, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i1648 = load double* %tmp.14.i1647 ; <double> [#uses=1]
- %tmp.17.i1650 = getelementptr %"struct.std::dcomplex"* %tmp.0.i1645, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i1651 = load double* %tmp.17.i1650 ; <double> [#uses=1]
- %tmp.4.i1625 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i1624, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i1648, double* %tmp.4.i1625
- %tmp.7.i1628 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i1624, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i1651, double* %tmp.7.i1628
- %tmp.0.i1631 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i1624, %"struct.std::dcomplex"* %tmp.15 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i1632 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1749, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i1633 = getelementptr %"struct.std::dcomplex"* %tmp.0.i1631, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i1634 = load double* %tmp.14.i1633 ; <double> [#uses=1]
- store double %tmp.15.i1634, double* %tmp.13.i1632
- %tmp.16.i1635 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1749, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i1636 = getelementptr %"struct.std::dcomplex"* %tmp.0.i1631, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i1637 = load double* %tmp.17.i1636 ; <double> [#uses=1]
- store double %tmp.18.i1637, double* %tmp.16.i1635
- %tmp.4.i1611 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i1610, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i1690, double* %tmp.4.i1611
- %tmp.7.i1614 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i1610, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i1693, double* %tmp.7.i1614
- %tmp.0.i1617 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i1610, %"struct.std::dcomplex"* %mem_tmp.1749 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i1619 = getelementptr %"struct.std::dcomplex"* %tmp.0.i1617, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i1620 = load double* %tmp.14.i1619 ; <double> [#uses=1]
- %tmp.17.i1622 = getelementptr %"struct.std::dcomplex"* %tmp.0.i1617, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i1623 = load double* %tmp.17.i1622 ; <double> [#uses=1]
- %tmp.4.i1597 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i1596, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i1599 = load double* %tmp.5.i34352 ; <double> [#uses=1]
- store double %tmp.6.i1599, double* %tmp.4.i1597
- %tmp.7.i1600 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i1596, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i1602 = load double* %tmp.8.i34355 ; <double> [#uses=1]
- store double %tmp.9.i1602, double* %tmp.7.i1600
- %tmp.0.i1603 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i1596, %"struct.std::dcomplex"* %tmp.21 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i1605 = getelementptr %"struct.std::dcomplex"* %tmp.0.i1603, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i1606 = load double* %tmp.14.i1605 ; <double> [#uses=1]
- %tmp.17.i1608 = getelementptr %"struct.std::dcomplex"* %tmp.0.i1603, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i1609 = load double* %tmp.17.i1608 ; <double> [#uses=1]
- %tmp.4.i1583 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i1582, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i1585 = load double* %tmp.5.i34282 ; <double> [#uses=1]
- store double %tmp.6.i1585, double* %tmp.4.i1583
- %tmp.7.i1586 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i1582, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i1588 = load double* %tmp.8.i34285 ; <double> [#uses=1]
- store double %tmp.9.i1588, double* %tmp.7.i1586
- %tmp.0.i1589 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i1582, %"struct.std::dcomplex"* %tmp.12 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i1590 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1756, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i1591 = getelementptr %"struct.std::dcomplex"* %tmp.0.i1589, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i1592 = load double* %tmp.14.i1591 ; <double> [#uses=1]
- store double %tmp.15.i1592, double* %tmp.13.i1590
- %tmp.16.i1593 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1756, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i1594 = getelementptr %"struct.std::dcomplex"* %tmp.0.i1589, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i1595 = load double* %tmp.17.i1594 ; <double> [#uses=1]
- store double %tmp.18.i1595, double* %tmp.16.i1593
- %tmp.4.i1569 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i1568, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i1606, double* %tmp.4.i1569
- %tmp.7.i1572 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i1568, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i1609, double* %tmp.7.i1572
- %tmp.0.i1575 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i1568, %"struct.std::dcomplex"* %mem_tmp.1756 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i1577 = getelementptr %"struct.std::dcomplex"* %tmp.0.i1575, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i1578 = load double* %tmp.14.i1577 ; <double> [#uses=1]
- %tmp.17.i1580 = getelementptr %"struct.std::dcomplex"* %tmp.0.i1575, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i1581 = load double* %tmp.17.i1580 ; <double> [#uses=1]
- %tmp.4.i1555 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i1554, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i1578, double* %tmp.4.i1555
- %tmp.7.i1558 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i1554, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i1581, double* %tmp.7.i1558
- %tmp.0.i1561 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i1554, %"struct.std::dcomplex"* %tmp.95 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i1562 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1753, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i1563 = getelementptr %"struct.std::dcomplex"* %tmp.0.i1561, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i1564 = load double* %tmp.14.i1563 ; <double> [#uses=1]
- store double %tmp.15.i1564, double* %tmp.13.i1562
- %tmp.16.i1565 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1753, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i1566 = getelementptr %"struct.std::dcomplex"* %tmp.0.i1561, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i1567 = load double* %tmp.17.i1566 ; <double> [#uses=1]
- store double %tmp.18.i1567, double* %tmp.16.i1565
- %tmp.4.i1541 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i1540, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i1620, double* %tmp.4.i1541
- %tmp.7.i1544 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i1540, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i1623, double* %tmp.7.i1544
- %tmp.0.i1547 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i1540, %"struct.std::dcomplex"* %mem_tmp.1753 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i1549 = getelementptr %"struct.std::dcomplex"* %tmp.0.i1547, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i1550 = load double* %tmp.14.i1549 ; <double> [#uses=1]
- %tmp.17.i1552 = getelementptr %"struct.std::dcomplex"* %tmp.0.i1547, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i1553 = load double* %tmp.17.i1552 ; <double> [#uses=1]
- store double %tmp.15.i1550, double* %tmp.2.i34364
- store double %tmp.18.i1553, double* %tmp.6.i34365
- %tmp.4.i1507 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i1506, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i1509 = load double* %tmp.5.i27590 ; <double> [#uses=1]
- store double %tmp.6.i1509, double* %tmp.4.i1507
- %tmp.7.i1510 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i1506, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i1512 = load double* %tmp.8.i27593 ; <double> [#uses=1]
- store double %tmp.9.i1512, double* %tmp.7.i1510
- %tmp.0.i1513 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i1506, %"struct.std::dcomplex"* %ret3 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i1515 = getelementptr %"struct.std::dcomplex"* %tmp.0.i1513, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i1516 = load double* %tmp.14.i1515 ; <double> [#uses=1]
- %tmp.17.i1518 = getelementptr %"struct.std::dcomplex"* %tmp.0.i1513, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i1519 = load double* %tmp.17.i1518 ; <double> [#uses=1]
- %tmp.7.i1473 = load double* %tmp.2.i34366 ; <double> [#uses=1]
- %tmp.15.i1487 = add double %tmp.7.i1473, %tmp.15.i1516 ; <double> [#uses=1]
- store double %tmp.15.i1487, double* %tmp.2.i34366
- %tmp.26.i1494 = load double* %tmp.6.i34367 ; <double> [#uses=1]
- %tmp.31.i1505 = add double %tmp.26.i1494, %tmp.18.i1519 ; <double> [#uses=1]
- store double %tmp.31.i1505, double* %tmp.6.i34367
- %tmp.4.i1453 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i1452, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i1455 = load double* %tmp.5.i34282 ; <double> [#uses=1]
- store double %tmp.6.i1455, double* %tmp.4.i1453
- %tmp.7.i1456 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i1452, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i1458 = load double* %tmp.8.i34285 ; <double> [#uses=1]
- store double %tmp.9.i1458, double* %tmp.7.i1456
- %tmp.0.i1459 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i1452, %"struct.std::dcomplex"* %tmp.1036 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i1461 = getelementptr %"struct.std::dcomplex"* %tmp.0.i1459, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i1462 = load double* %tmp.14.i1461 ; <double> [#uses=1]
- %tmp.17.i1464 = getelementptr %"struct.std::dcomplex"* %tmp.0.i1459, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i1465 = load double* %tmp.17.i1464 ; <double> [#uses=1]
- %tmp.4.i1439 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i1438, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i1441 = load double* %tmp.5.i28602 ; <double> [#uses=1]
- store double %tmp.6.i1441, double* %tmp.4.i1439
- %tmp.7.i1442 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i1438, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i1444 = load double* %tmp.8.i28605 ; <double> [#uses=1]
- store double %tmp.9.i1444, double* %tmp.7.i1442
- %tmp.0.i1445 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i1438, %"struct.std::dcomplex"* %tmp.21 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i1446 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1763, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i1447 = getelementptr %"struct.std::dcomplex"* %tmp.0.i1445, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i1448 = load double* %tmp.14.i1447 ; <double> [#uses=1]
- store double %tmp.15.i1448, double* %tmp.13.i1446
- %tmp.16.i1449 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1763, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i1450 = getelementptr %"struct.std::dcomplex"* %tmp.0.i1445, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i1451 = load double* %tmp.17.i1450 ; <double> [#uses=1]
- store double %tmp.18.i1451, double* %tmp.16.i1449
- %tmp.4.i1425 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i1424, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i1462, double* %tmp.4.i1425
- %tmp.7.i1428 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i1424, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i1465, double* %tmp.7.i1428
- %tmp.0.i1431 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i1424, %"struct.std::dcomplex"* %mem_tmp.1763 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i1433 = getelementptr %"struct.std::dcomplex"* %tmp.0.i1431, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i1434 = load double* %tmp.14.i1433 ; <double> [#uses=1]
- %tmp.17.i1436 = getelementptr %"struct.std::dcomplex"* %tmp.0.i1431, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i1437 = load double* %tmp.17.i1436 ; <double> [#uses=1]
- %tmp.4.i1411 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i1410, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i1434, double* %tmp.4.i1411
- %tmp.7.i1414 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i1410, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i1437, double* %tmp.7.i1414
- %tmp.0.i1417 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i1410, %"struct.std::dcomplex"* %tmp.95 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i1419 = getelementptr %"struct.std::dcomplex"* %tmp.0.i1417, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i1420 = load double* %tmp.14.i1419 ; <double> [#uses=1]
- %tmp.17.i1422 = getelementptr %"struct.std::dcomplex"* %tmp.0.i1417, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i1423 = load double* %tmp.17.i1422 ; <double> [#uses=1]
- %tmp.4.i1397 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i1396, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i1399 = load double* %tmp.5.i34082 ; <double> [#uses=1]
- store double %tmp.6.i1399, double* %tmp.4.i1397
- %tmp.7.i1400 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i1396, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i1402 = load double* %tmp.8.i34085 ; <double> [#uses=1]
- store double %tmp.9.i1402, double* %tmp.7.i1400
- %tmp.0.i1403 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i1396, %"struct.std::dcomplex"* %tmp.21 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i1405 = getelementptr %"struct.std::dcomplex"* %tmp.0.i1403, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i1406 = load double* %tmp.14.i1405 ; <double> [#uses=1]
- %tmp.17.i1408 = getelementptr %"struct.std::dcomplex"* %tmp.0.i1403, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i1409 = load double* %tmp.17.i1408 ; <double> [#uses=1]
- %tmp.4.i1383 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i1382, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i1385 = load double* %tmp.5.i34282 ; <double> [#uses=1]
- store double %tmp.6.i1385, double* %tmp.4.i1383
- %tmp.7.i1386 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i1382, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i1388 = load double* %tmp.8.i34285 ; <double> [#uses=1]
- store double %tmp.9.i1388, double* %tmp.7.i1386
- %tmp.0.i1389 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i1382, %"struct.std::dcomplex"* %tmp.62 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i1390 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1767, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i1391 = getelementptr %"struct.std::dcomplex"* %tmp.0.i1389, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i1392 = load double* %tmp.14.i1391 ; <double> [#uses=1]
- store double %tmp.15.i1392, double* %tmp.13.i1390
- %tmp.16.i1393 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1767, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i1394 = getelementptr %"struct.std::dcomplex"* %tmp.0.i1389, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i1395 = load double* %tmp.17.i1394 ; <double> [#uses=1]
- store double %tmp.18.i1395, double* %tmp.16.i1393
- %tmp.4.i1369 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i1368, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i1406, double* %tmp.4.i1369
- %tmp.7.i1372 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i1368, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i1409, double* %tmp.7.i1372
- %tmp.0.i1375 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i1368, %"struct.std::dcomplex"* %mem_tmp.1767 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i1377 = getelementptr %"struct.std::dcomplex"* %tmp.0.i1375, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i1378 = load double* %tmp.14.i1377 ; <double> [#uses=1]
- %tmp.17.i1380 = getelementptr %"struct.std::dcomplex"* %tmp.0.i1375, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i1381 = load double* %tmp.17.i1380 ; <double> [#uses=1]
- %tmp.4.i1355 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i1354, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i1378, double* %tmp.4.i1355
- %tmp.7.i1358 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i1354, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i1381, double* %tmp.7.i1358
- %tmp.0.i1361 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i1354, %"struct.std::dcomplex"* %tmp.1075 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i1362 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1764, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i1363 = getelementptr %"struct.std::dcomplex"* %tmp.0.i1361, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i1364 = load double* %tmp.14.i1363 ; <double> [#uses=1]
- store double %tmp.15.i1364, double* %tmp.13.i1362
- %tmp.16.i1365 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1764, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i1366 = getelementptr %"struct.std::dcomplex"* %tmp.0.i1361, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i1367 = load double* %tmp.17.i1366 ; <double> [#uses=1]
- store double %tmp.18.i1367, double* %tmp.16.i1365
- %tmp.4.i1341 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i1340, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i1420, double* %tmp.4.i1341
- %tmp.7.i1344 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i1340, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i1423, double* %tmp.7.i1344
- %tmp.0.i1347 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i1340, %"struct.std::dcomplex"* %mem_tmp.1764 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i1349 = getelementptr %"struct.std::dcomplex"* %tmp.0.i1347, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i1350 = load double* %tmp.14.i1349 ; <double> [#uses=1]
- %tmp.17.i1352 = getelementptr %"struct.std::dcomplex"* %tmp.0.i1347, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i1353 = load double* %tmp.17.i1352 ; <double> [#uses=1]
- %tmp.4.i1327 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i1326, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i1329 = load double* %tmp.5.i28602 ; <double> [#uses=1]
- store double %tmp.6.i1329, double* %tmp.4.i1327
- %tmp.7.i1330 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i1326, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i1332 = load double* %tmp.8.i28605 ; <double> [#uses=1]
- store double %tmp.9.i1332, double* %tmp.7.i1330
- %tmp.0.i1333 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i1326, %"struct.std::dcomplex"* %tmp.62 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i1335 = getelementptr %"struct.std::dcomplex"* %tmp.0.i1333, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i1336 = load double* %tmp.14.i1335 ; <double> [#uses=1]
- %tmp.17.i1338 = getelementptr %"struct.std::dcomplex"* %tmp.0.i1333, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i1339 = load double* %tmp.17.i1338 ; <double> [#uses=1]
- %tmp.4.i1313 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i1312, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i1315 = load double* %tmp.5.i34082 ; <double> [#uses=1]
- store double %tmp.6.i1315, double* %tmp.4.i1313
- %tmp.7.i1316 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i1312, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i1318 = load double* %tmp.8.i34085 ; <double> [#uses=1]
- store double %tmp.9.i1318, double* %tmp.7.i1316
- %tmp.0.i1319 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i1312, %"struct.std::dcomplex"* %tmp.1036 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i1320 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1771, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i1321 = getelementptr %"struct.std::dcomplex"* %tmp.0.i1319, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i1322 = load double* %tmp.14.i1321 ; <double> [#uses=1]
- store double %tmp.15.i1322, double* %tmp.13.i1320
- %tmp.16.i1323 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1771, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i1324 = getelementptr %"struct.std::dcomplex"* %tmp.0.i1319, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i1325 = load double* %tmp.17.i1324 ; <double> [#uses=1]
- store double %tmp.18.i1325, double* %tmp.16.i1323
- %tmp.4.i1299 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i1298, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i1336, double* %tmp.4.i1299
- %tmp.7.i1302 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i1298, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i1339, double* %tmp.7.i1302
- %tmp.0.i1305 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i1298, %"struct.std::dcomplex"* %mem_tmp.1771 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i1307 = getelementptr %"struct.std::dcomplex"* %tmp.0.i1305, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i1308 = load double* %tmp.14.i1307 ; <double> [#uses=1]
- %tmp.17.i1310 = getelementptr %"struct.std::dcomplex"* %tmp.0.i1305, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i1311 = load double* %tmp.17.i1310 ; <double> [#uses=1]
- %tmp.4.i1285 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i1284, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i1308, double* %tmp.4.i1285
- %tmp.7.i1288 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i1284, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i1311, double* %tmp.7.i1288
- %tmp.0.i1291 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i1284, %"struct.std::dcomplex"* %tmp.15 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i1292 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1768, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i1293 = getelementptr %"struct.std::dcomplex"* %tmp.0.i1291, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i1294 = load double* %tmp.14.i1293 ; <double> [#uses=1]
- store double %tmp.15.i1294, double* %tmp.13.i1292
- %tmp.16.i1295 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1768, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i1296 = getelementptr %"struct.std::dcomplex"* %tmp.0.i1291, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i1297 = load double* %tmp.17.i1296 ; <double> [#uses=1]
- store double %tmp.18.i1297, double* %tmp.16.i1295
- %tmp.4.i1271 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i1270, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i1350, double* %tmp.4.i1271
- %tmp.7.i1274 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i1270, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i1353, double* %tmp.7.i1274
- %tmp.0.i1277 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i1270, %"struct.std::dcomplex"* %mem_tmp.1768 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i1279 = getelementptr %"struct.std::dcomplex"* %tmp.0.i1277, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i1280 = load double* %tmp.14.i1279 ; <double> [#uses=1]
- %tmp.17.i1282 = getelementptr %"struct.std::dcomplex"* %tmp.0.i1277, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i1283 = load double* %tmp.17.i1282 ; <double> [#uses=1]
- store double %tmp.15.i1280, double* %tmp.2.i34364
- store double %tmp.18.i1283, double* %tmp.6.i34365
- %tmp.4.i1237 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i1236, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i1239 = load double* %tmp.5.i33866 ; <double> [#uses=1]
- store double %tmp.6.i1239, double* %tmp.4.i1237
- %tmp.7.i1240 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i1236, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i1242 = load double* %tmp.8.i33869 ; <double> [#uses=1]
- store double %tmp.9.i1242, double* %tmp.7.i1240
- %tmp.0.i1243 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i1236, %"struct.std::dcomplex"* %ret3 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i1245 = getelementptr %"struct.std::dcomplex"* %tmp.0.i1243, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i1246 = load double* %tmp.14.i1245 ; <double> [#uses=1]
- %tmp.17.i1248 = getelementptr %"struct.std::dcomplex"* %tmp.0.i1243, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i1249 = load double* %tmp.17.i1248 ; <double> [#uses=1]
- %tmp.7.i1203 = load double* %tmp.2.i34366 ; <double> [#uses=1]
- %tmp.15.i1217 = add double %tmp.7.i1203, %tmp.15.i1246 ; <double> [#uses=1]
- store double %tmp.15.i1217, double* %tmp.2.i34366
- %tmp.26.i1224 = load double* %tmp.6.i34367 ; <double> [#uses=1]
- %tmp.31.i1235 = add double %tmp.26.i1224, %tmp.18.i1249 ; <double> [#uses=1]
- store double %tmp.31.i1235, double* %tmp.6.i34367
- %tmp.4.i1183 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i1182, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i1185 = load double* %tmp.5.i31000 ; <double> [#uses=1]
- store double %tmp.6.i1185, double* %tmp.4.i1183
- %tmp.7.i1186 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i1182, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i1188 = load double* %tmp.8.i31003 ; <double> [#uses=1]
- store double %tmp.9.i1188, double* %tmp.7.i1186
- %tmp.0.i1189 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i1182, %"struct.std::dcomplex"* %ret4 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i1191 = getelementptr %"struct.std::dcomplex"* %tmp.0.i1189, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i1192 = load double* %tmp.14.i1191 ; <double> [#uses=1]
- %tmp.17.i1194 = getelementptr %"struct.std::dcomplex"* %tmp.0.i1189, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i1195 = load double* %tmp.17.i1194 ; <double> [#uses=1]
- %tmp.7.i1149 = load double* %tmp.2.i34368 ; <double> [#uses=1]
- %tmp.15.i1163 = add double %tmp.7.i1149, %tmp.15.i1192 ; <double> [#uses=1]
- store double %tmp.15.i1163, double* %tmp.2.i34368
- %tmp.26.i1170 = load double* %tmp.6.i34369 ; <double> [#uses=1]
- %tmp.31.i1181 = add double %tmp.26.i1170, %tmp.18.i1195 ; <double> [#uses=1]
- store double %tmp.31.i1181, double* %tmp.6.i34369
- store double 0.000000e+00, double* %tmp.2.i34366
- store double 0.000000e+00, double* %tmp.6.i34367
- %tmp.4.i1127 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i1126, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i1129 = load double* %tmp.5.i34082 ; <double> [#uses=1]
- store double %tmp.6.i1129, double* %tmp.4.i1127
- %tmp.7.i1130 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i1126, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i1132 = load double* %tmp.8.i34085 ; <double> [#uses=1]
- store double %tmp.9.i1132, double* %tmp.7.i1130
- %tmp.0.i1133 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i1126, %"struct.std::dcomplex"* %tmp.1036 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i1135 = getelementptr %"struct.std::dcomplex"* %tmp.0.i1133, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i1136 = load double* %tmp.14.i1135 ; <double> [#uses=1]
- %tmp.17.i1138 = getelementptr %"struct.std::dcomplex"* %tmp.0.i1133, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i1139 = load double* %tmp.17.i1138 ; <double> [#uses=1]
- %tmp.4.i1113 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i1112, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i1115 = load double* %tmp.5.i28602 ; <double> [#uses=1]
- store double %tmp.6.i1115, double* %tmp.4.i1113
- %tmp.7.i1116 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i1112, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i1118 = load double* %tmp.8.i28605 ; <double> [#uses=1]
- store double %tmp.9.i1118, double* %tmp.7.i1116
- %tmp.0.i1119 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i1112, %"struct.std::dcomplex"* %tmp.62 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i1120 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1779, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i1121 = getelementptr %"struct.std::dcomplex"* %tmp.0.i1119, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i1122 = load double* %tmp.14.i1121 ; <double> [#uses=1]
- store double %tmp.15.i1122, double* %tmp.13.i1120
- %tmp.16.i1123 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1779, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i1124 = getelementptr %"struct.std::dcomplex"* %tmp.0.i1119, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i1125 = load double* %tmp.17.i1124 ; <double> [#uses=1]
- store double %tmp.18.i1125, double* %tmp.16.i1123
- %tmp.4.i1099 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i1098, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i1136, double* %tmp.4.i1099
- %tmp.7.i1102 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i1098, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i1139, double* %tmp.7.i1102
- %tmp.0.i1105 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i1098, %"struct.std::dcomplex"* %mem_tmp.1779 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i1107 = getelementptr %"struct.std::dcomplex"* %tmp.0.i1105, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i1108 = load double* %tmp.14.i1107 ; <double> [#uses=1]
- %tmp.17.i1110 = getelementptr %"struct.std::dcomplex"* %tmp.0.i1105, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i1111 = load double* %tmp.17.i1110 ; <double> [#uses=1]
- %tmp.4.i1085 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i1084, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i1108, double* %tmp.4.i1085
- %tmp.7.i1088 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i1084, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i1111, double* %tmp.7.i1088
- %tmp.0.i1091 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i1084, %"struct.std::dcomplex"* %tmp.45 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i1093 = getelementptr %"struct.std::dcomplex"* %tmp.0.i1091, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i1094 = load double* %tmp.14.i1093 ; <double> [#uses=1]
- %tmp.17.i1096 = getelementptr %"struct.std::dcomplex"* %tmp.0.i1091, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i1097 = load double* %tmp.17.i1096 ; <double> [#uses=1]
- %tmp.4.i1071 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i1070, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i1073 = load double* %tmp.5.i28602 ; <double> [#uses=1]
- store double %tmp.6.i1073, double* %tmp.4.i1071
- %tmp.7.i1074 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i1070, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i1076 = load double* %tmp.8.i28605 ; <double> [#uses=1]
- store double %tmp.9.i1076, double* %tmp.7.i1074
- %tmp.0.i1077 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i1070, %"struct.std::dcomplex"* %tmp.6 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i1079 = getelementptr %"struct.std::dcomplex"* %tmp.0.i1077, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i1080 = load double* %tmp.14.i1079 ; <double> [#uses=1]
- %tmp.17.i1082 = getelementptr %"struct.std::dcomplex"* %tmp.0.i1077, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i1083 = load double* %tmp.17.i1082 ; <double> [#uses=1]
- %tmp.4.i1057 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i1056, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i1059 = load double* %tmp.5.i34338 ; <double> [#uses=1]
- store double %tmp.6.i1059, double* %tmp.4.i1057
- %tmp.7.i1060 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i1056, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i1062 = load double* %tmp.8.i34341 ; <double> [#uses=1]
- store double %tmp.9.i1062, double* %tmp.7.i1060
- %tmp.0.i1063 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i1056, %"struct.std::dcomplex"* %tmp.1036 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i1064 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1783, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i1065 = getelementptr %"struct.std::dcomplex"* %tmp.0.i1063, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i1066 = load double* %tmp.14.i1065 ; <double> [#uses=1]
- store double %tmp.15.i1066, double* %tmp.13.i1064
- %tmp.16.i1067 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1783, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i1068 = getelementptr %"struct.std::dcomplex"* %tmp.0.i1063, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i1069 = load double* %tmp.17.i1068 ; <double> [#uses=1]
- store double %tmp.18.i1069, double* %tmp.16.i1067
- %tmp.4.i1043 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i1042, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i1080, double* %tmp.4.i1043
- %tmp.7.i1046 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i1042, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i1083, double* %tmp.7.i1046
- %tmp.0.i1049 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i1042, %"struct.std::dcomplex"* %mem_tmp.1783 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i1051 = getelementptr %"struct.std::dcomplex"* %tmp.0.i1049, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i1052 = load double* %tmp.14.i1051 ; <double> [#uses=1]
- %tmp.17.i1054 = getelementptr %"struct.std::dcomplex"* %tmp.0.i1049, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i1055 = load double* %tmp.17.i1054 ; <double> [#uses=1]
- %tmp.4.i1029 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i1028, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i1052, double* %tmp.4.i1029
- %tmp.7.i1032 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i1028, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i1055, double* %tmp.7.i1032
- %tmp.0.i1035 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i1028, %"struct.std::dcomplex"* %tmp.95 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i1036 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1780, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i1037 = getelementptr %"struct.std::dcomplex"* %tmp.0.i1035, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i1038 = load double* %tmp.14.i1037 ; <double> [#uses=1]
- store double %tmp.15.i1038, double* %tmp.13.i1036
- %tmp.16.i1039 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1780, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i1040 = getelementptr %"struct.std::dcomplex"* %tmp.0.i1035, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i1041 = load double* %tmp.17.i1040 ; <double> [#uses=1]
- store double %tmp.18.i1041, double* %tmp.16.i1039
- %tmp.4.i1015 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i1014, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i1094, double* %tmp.4.i1015
- %tmp.7.i1018 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i1014, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i1097, double* %tmp.7.i1018
- %tmp.0.i1021 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i1014, %"struct.std::dcomplex"* %mem_tmp.1780 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i1023 = getelementptr %"struct.std::dcomplex"* %tmp.0.i1021, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i1024 = load double* %tmp.14.i1023 ; <double> [#uses=1]
- %tmp.17.i1026 = getelementptr %"struct.std::dcomplex"* %tmp.0.i1021, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i1027 = load double* %tmp.17.i1026 ; <double> [#uses=1]
- %tmp.4.i1001 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i1000, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i1003 = load double* %tmp.5.i34338 ; <double> [#uses=1]
- store double %tmp.6.i1003, double* %tmp.4.i1001
- %tmp.7.i1004 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i1000, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i1006 = load double* %tmp.8.i34341 ; <double> [#uses=1]
- store double %tmp.9.i1006, double* %tmp.7.i1004
- %tmp.0.i1007 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i1000, %"struct.std::dcomplex"* %tmp.62 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i1009 = getelementptr %"struct.std::dcomplex"* %tmp.0.i1007, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i1010 = load double* %tmp.14.i1009 ; <double> [#uses=1]
- %tmp.17.i1012 = getelementptr %"struct.std::dcomplex"* %tmp.0.i1007, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i1013 = load double* %tmp.17.i1012 ; <double> [#uses=1]
- %tmp.4.i987 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i986, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i989 = load double* %tmp.5.i34082 ; <double> [#uses=1]
- store double %tmp.6.i989, double* %tmp.4.i987
- %tmp.7.i990 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i986, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i992 = load double* %tmp.8.i34085 ; <double> [#uses=1]
- store double %tmp.9.i992, double* %tmp.7.i990
- %tmp.0.i993 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i986, %"struct.std::dcomplex"* %tmp.6 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i994 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1787, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i995 = getelementptr %"struct.std::dcomplex"* %tmp.0.i993, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i996 = load double* %tmp.14.i995 ; <double> [#uses=1]
- store double %tmp.15.i996, double* %tmp.13.i994
- %tmp.16.i997 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1787, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i998 = getelementptr %"struct.std::dcomplex"* %tmp.0.i993, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i999 = load double* %tmp.17.i998 ; <double> [#uses=1]
- store double %tmp.18.i999, double* %tmp.16.i997
- %tmp.4.i973 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i972, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i1010, double* %tmp.4.i973
- %tmp.7.i976 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i972, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i1013, double* %tmp.7.i976
- %tmp.0.i979 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i972, %"struct.std::dcomplex"* %mem_tmp.1787 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i981 = getelementptr %"struct.std::dcomplex"* %tmp.0.i979, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i982 = load double* %tmp.14.i981 ; <double> [#uses=1]
- %tmp.17.i984 = getelementptr %"struct.std::dcomplex"* %tmp.0.i979, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i985 = load double* %tmp.17.i984 ; <double> [#uses=1]
- %tmp.4.i959 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i958, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i982, double* %tmp.4.i959
- %tmp.7.i962 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i958, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i985, double* %tmp.7.i962
- %tmp.0.i965 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i958, %"struct.std::dcomplex"* %tmp.1075 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i966 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1784, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i967 = getelementptr %"struct.std::dcomplex"* %tmp.0.i965, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i968 = load double* %tmp.14.i967 ; <double> [#uses=1]
- store double %tmp.15.i968, double* %tmp.13.i966
- %tmp.16.i969 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1784, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i970 = getelementptr %"struct.std::dcomplex"* %tmp.0.i965, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i971 = load double* %tmp.17.i970 ; <double> [#uses=1]
- store double %tmp.18.i971, double* %tmp.16.i969
- %tmp.4.i945 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i944, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i1024, double* %tmp.4.i945
- %tmp.7.i948 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i944, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i1027, double* %tmp.7.i948
- %tmp.0.i951 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i944, %"struct.std::dcomplex"* %mem_tmp.1784 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i953 = getelementptr %"struct.std::dcomplex"* %tmp.0.i951, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i954 = load double* %tmp.14.i953 ; <double> [#uses=1]
- %tmp.17.i956 = getelementptr %"struct.std::dcomplex"* %tmp.0.i951, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i957 = load double* %tmp.17.i956 ; <double> [#uses=1]
- store double %tmp.15.i954, double* %tmp.2.i34364
- store double %tmp.18.i957, double* %tmp.6.i34365
- %tmp.4.i911 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i910, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i913 = load double* %tmp.5.i33866 ; <double> [#uses=1]
- store double %tmp.6.i913, double* %tmp.4.i911
- %tmp.7.i914 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i910, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i916 = load double* %tmp.8.i33869 ; <double> [#uses=1]
- store double %tmp.9.i916, double* %tmp.7.i914
- %tmp.0.i917 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i910, %"struct.std::dcomplex"* %ret3 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i919 = getelementptr %"struct.std::dcomplex"* %tmp.0.i917, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i920 = load double* %tmp.14.i919 ; <double> [#uses=1]
- %tmp.17.i922 = getelementptr %"struct.std::dcomplex"* %tmp.0.i917, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i923 = load double* %tmp.17.i922 ; <double> [#uses=1]
- %tmp.7.i877 = load double* %tmp.2.i34366 ; <double> [#uses=1]
- %tmp.15.i891 = add double %tmp.7.i877, %tmp.15.i920 ; <double> [#uses=1]
- store double %tmp.15.i891, double* %tmp.2.i34366
- %tmp.26.i898 = load double* %tmp.6.i34367 ; <double> [#uses=1]
- %tmp.31.i909 = add double %tmp.26.i898, %tmp.18.i923 ; <double> [#uses=1]
- store double %tmp.31.i909, double* %tmp.6.i34367
- %tmp.4.i857 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i856, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i859 = load double* %tmp.5.i34082 ; <double> [#uses=1]
- store double %tmp.6.i859, double* %tmp.4.i857
- %tmp.7.i860 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i856, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i862 = load double* %tmp.8.i34085 ; <double> [#uses=1]
- store double %tmp.9.i862, double* %tmp.7.i860
- %tmp.0.i863 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i856, %"struct.std::dcomplex"* %tmp.12 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i865 = getelementptr %"struct.std::dcomplex"* %tmp.0.i863, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i866 = load double* %tmp.14.i865 ; <double> [#uses=1]
- %tmp.17.i868 = getelementptr %"struct.std::dcomplex"* %tmp.0.i863, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i869 = load double* %tmp.17.i868 ; <double> [#uses=1]
- %tmp.4.i843 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i842, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i845 = load double* %tmp.5.i34352 ; <double> [#uses=1]
- store double %tmp.6.i845, double* %tmp.4.i843
- %tmp.7.i846 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i842, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i848 = load double* %tmp.8.i34355 ; <double> [#uses=1]
- store double %tmp.9.i848, double* %tmp.7.i846
- %tmp.0.i849 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i842, %"struct.std::dcomplex"* %tmp.62 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i850 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1794, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i851 = getelementptr %"struct.std::dcomplex"* %tmp.0.i849, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i852 = load double* %tmp.14.i851 ; <double> [#uses=1]
- store double %tmp.15.i852, double* %tmp.13.i850
- %tmp.16.i853 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1794, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i854 = getelementptr %"struct.std::dcomplex"* %tmp.0.i849, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i855 = load double* %tmp.17.i854 ; <double> [#uses=1]
- store double %tmp.18.i855, double* %tmp.16.i853
- %tmp.4.i829 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i828, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i866, double* %tmp.4.i829
- %tmp.7.i832 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i828, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i869, double* %tmp.7.i832
- %tmp.0.i835 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i828, %"struct.std::dcomplex"* %mem_tmp.1794 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i837 = getelementptr %"struct.std::dcomplex"* %tmp.0.i835, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i838 = load double* %tmp.14.i837 ; <double> [#uses=1]
- %tmp.17.i840 = getelementptr %"struct.std::dcomplex"* %tmp.0.i835, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i841 = load double* %tmp.17.i840 ; <double> [#uses=1]
- %tmp.4.i815 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i814, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i838, double* %tmp.4.i815
- %tmp.7.i818 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i814, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i841, double* %tmp.7.i818
- %tmp.0.i821 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i814, %"struct.std::dcomplex"* %tmp.1075 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i823 = getelementptr %"struct.std::dcomplex"* %tmp.0.i821, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i824 = load double* %tmp.14.i823 ; <double> [#uses=1]
- %tmp.17.i826 = getelementptr %"struct.std::dcomplex"* %tmp.0.i821, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i827 = load double* %tmp.17.i826 ; <double> [#uses=1]
- %tmp.4.i801 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i800, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i803 = load double* %tmp.5.i28602 ; <double> [#uses=1]
- store double %tmp.6.i803, double* %tmp.4.i801
- %tmp.7.i804 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i800, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i806 = load double* %tmp.8.i28605 ; <double> [#uses=1]
- store double %tmp.9.i806, double* %tmp.7.i804
- %tmp.0.i807 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i800, %"struct.std::dcomplex"* %tmp.62 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i809 = getelementptr %"struct.std::dcomplex"* %tmp.0.i807, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i810 = load double* %tmp.14.i809 ; <double> [#uses=1]
- %tmp.17.i812 = getelementptr %"struct.std::dcomplex"* %tmp.0.i807, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i813 = load double* %tmp.17.i812 ; <double> [#uses=1]
- %tmp.4.i787 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i786, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i789 = load double* %tmp.5.i34082 ; <double> [#uses=1]
- store double %tmp.6.i789, double* %tmp.4.i787
- %tmp.7.i790 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i786, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i792 = load double* %tmp.8.i34085 ; <double> [#uses=1]
- store double %tmp.9.i792, double* %tmp.7.i790
- %tmp.0.i793 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i786, %"struct.std::dcomplex"* %tmp.1036 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i794 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1798, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i795 = getelementptr %"struct.std::dcomplex"* %tmp.0.i793, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i796 = load double* %tmp.14.i795 ; <double> [#uses=1]
- store double %tmp.15.i796, double* %tmp.13.i794
- %tmp.16.i797 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1798, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i798 = getelementptr %"struct.std::dcomplex"* %tmp.0.i793, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i799 = load double* %tmp.17.i798 ; <double> [#uses=1]
- store double %tmp.18.i799, double* %tmp.16.i797
- %tmp.4.i773 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i772, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i810, double* %tmp.4.i773
- %tmp.7.i776 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i772, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i813, double* %tmp.7.i776
- %tmp.0.i779 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i772, %"struct.std::dcomplex"* %mem_tmp.1798 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i781 = getelementptr %"struct.std::dcomplex"* %tmp.0.i779, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i782 = load double* %tmp.14.i781 ; <double> [#uses=1]
- %tmp.17.i784 = getelementptr %"struct.std::dcomplex"* %tmp.0.i779, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i785 = load double* %tmp.17.i784 ; <double> [#uses=1]
- %tmp.4.i759 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i758, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i782, double* %tmp.4.i759
- %tmp.7.i762 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i758, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i785, double* %tmp.7.i762
- %tmp.0.i765 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i758, %"struct.std::dcomplex"* %tmp.30 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i766 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1795, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i767 = getelementptr %"struct.std::dcomplex"* %tmp.0.i765, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i768 = load double* %tmp.14.i767 ; <double> [#uses=1]
- store double %tmp.15.i768, double* %tmp.13.i766
- %tmp.16.i769 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1795, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i770 = getelementptr %"struct.std::dcomplex"* %tmp.0.i765, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i771 = load double* %tmp.17.i770 ; <double> [#uses=1]
- store double %tmp.18.i771, double* %tmp.16.i769
- %tmp.4.i745 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i744, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i824, double* %tmp.4.i745
- %tmp.7.i748 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i744, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i827, double* %tmp.7.i748
- %tmp.0.i751 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i744, %"struct.std::dcomplex"* %mem_tmp.1795 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i753 = getelementptr %"struct.std::dcomplex"* %tmp.0.i751, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i754 = load double* %tmp.14.i753 ; <double> [#uses=1]
- %tmp.17.i756 = getelementptr %"struct.std::dcomplex"* %tmp.0.i751, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i757 = load double* %tmp.17.i756 ; <double> [#uses=1]
- %tmp.4.i731 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i730, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i733 = load double* %tmp.5.i34352 ; <double> [#uses=1]
- store double %tmp.6.i733, double* %tmp.4.i731
- %tmp.7.i734 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i730, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i736 = load double* %tmp.8.i34355 ; <double> [#uses=1]
- store double %tmp.9.i736, double* %tmp.7.i734
- %tmp.0.i737 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i730, %"struct.std::dcomplex"* %tmp.1036 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i739 = getelementptr %"struct.std::dcomplex"* %tmp.0.i737, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i740 = load double* %tmp.14.i739 ; <double> [#uses=1]
- %tmp.17.i742 = getelementptr %"struct.std::dcomplex"* %tmp.0.i737, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i743 = load double* %tmp.17.i742 ; <double> [#uses=1]
- %tmp.4.i717 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i716, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i719 = load double* %tmp.5.i28602 ; <double> [#uses=1]
- store double %tmp.6.i719, double* %tmp.4.i717
- %tmp.7.i720 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i716, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i722 = load double* %tmp.8.i28605 ; <double> [#uses=1]
- store double %tmp.9.i722, double* %tmp.7.i720
- %tmp.0.i723 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i716, %"struct.std::dcomplex"* %tmp.12 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i724 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1802, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i725 = getelementptr %"struct.std::dcomplex"* %tmp.0.i723, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i726 = load double* %tmp.14.i725 ; <double> [#uses=1]
- store double %tmp.15.i726, double* %tmp.13.i724
- %tmp.16.i727 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1802, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i728 = getelementptr %"struct.std::dcomplex"* %tmp.0.i723, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i729 = load double* %tmp.17.i728 ; <double> [#uses=1]
- store double %tmp.18.i729, double* %tmp.16.i727
- %tmp.4.i703 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i702, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i740, double* %tmp.4.i703
- %tmp.7.i706 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i702, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i743, double* %tmp.7.i706
- %tmp.0.i709 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i702, %"struct.std::dcomplex"* %mem_tmp.1802 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i711 = getelementptr %"struct.std::dcomplex"* %tmp.0.i709, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i712 = load double* %tmp.14.i711 ; <double> [#uses=1]
- %tmp.17.i714 = getelementptr %"struct.std::dcomplex"* %tmp.0.i709, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i715 = load double* %tmp.17.i714 ; <double> [#uses=1]
- %tmp.4.i689 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i688, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i712, double* %tmp.4.i689
- %tmp.7.i692 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i688, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i715, double* %tmp.7.i692
- %tmp.0.i695 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i688, %"struct.std::dcomplex"* %tmp.95 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i696 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1799, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i697 = getelementptr %"struct.std::dcomplex"* %tmp.0.i695, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i698 = load double* %tmp.14.i697 ; <double> [#uses=1]
- store double %tmp.15.i698, double* %tmp.13.i696
- %tmp.16.i699 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1799, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i700 = getelementptr %"struct.std::dcomplex"* %tmp.0.i695, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i701 = load double* %tmp.17.i700 ; <double> [#uses=1]
- store double %tmp.18.i701, double* %tmp.16.i699
- %tmp.4.i675 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i674, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i754, double* %tmp.4.i675
- %tmp.7.i678 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i674, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i757, double* %tmp.7.i678
- %tmp.0.i681 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i674, %"struct.std::dcomplex"* %mem_tmp.1799 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i683 = getelementptr %"struct.std::dcomplex"* %tmp.0.i681, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i684 = load double* %tmp.14.i683 ; <double> [#uses=1]
- %tmp.17.i686 = getelementptr %"struct.std::dcomplex"* %tmp.0.i681, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i687 = load double* %tmp.17.i686 ; <double> [#uses=1]
- store double %tmp.15.i684, double* %tmp.2.i34364
- store double %tmp.18.i687, double* %tmp.6.i34365
- %tmp.4.i641 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i640, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i643 = load double* %tmp.5.i33596 ; <double> [#uses=1]
- store double %tmp.6.i643, double* %tmp.4.i641
- %tmp.7.i644 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i640, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i646 = load double* %tmp.8.i33599 ; <double> [#uses=1]
- store double %tmp.9.i646, double* %tmp.7.i644
- %tmp.0.i647 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i640, %"struct.std::dcomplex"* %ret3 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i649 = getelementptr %"struct.std::dcomplex"* %tmp.0.i647, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i650 = load double* %tmp.14.i649 ; <double> [#uses=1]
- %tmp.17.i652 = getelementptr %"struct.std::dcomplex"* %tmp.0.i647, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i653 = load double* %tmp.17.i652 ; <double> [#uses=1]
- %tmp.7.i607 = load double* %tmp.2.i34366 ; <double> [#uses=1]
- %tmp.15.i621 = add double %tmp.7.i607, %tmp.15.i650 ; <double> [#uses=1]
- store double %tmp.15.i621, double* %tmp.2.i34366
- %tmp.26.i628 = load double* %tmp.6.i34367 ; <double> [#uses=1]
- %tmp.31.i639 = add double %tmp.26.i628, %tmp.18.i653 ; <double> [#uses=1]
- store double %tmp.31.i639, double* %tmp.6.i34367
- %tmp.4.i587 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i586, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i589 = load double* %tmp.5.i28602 ; <double> [#uses=1]
- store double %tmp.6.i589, double* %tmp.4.i587
- %tmp.7.i590 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i586, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i592 = load double* %tmp.8.i28605 ; <double> [#uses=1]
- store double %tmp.9.i592, double* %tmp.7.i590
- %tmp.0.i593 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i586, %"struct.std::dcomplex"* %tmp.12 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i595 = getelementptr %"struct.std::dcomplex"* %tmp.0.i593, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i596 = load double* %tmp.14.i595 ; <double> [#uses=1]
- %tmp.17.i598 = getelementptr %"struct.std::dcomplex"* %tmp.0.i593, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i599 = load double* %tmp.17.i598 ; <double> [#uses=1]
- %tmp.4.i573 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i572, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i575 = load double* %tmp.5.i34352 ; <double> [#uses=1]
- store double %tmp.6.i575, double* %tmp.4.i573
- %tmp.7.i576 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i572, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i578 = load double* %tmp.8.i34355 ; <double> [#uses=1]
- store double %tmp.9.i578, double* %tmp.7.i576
- %tmp.0.i579 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i572, %"struct.std::dcomplex"* %tmp.1036 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i580 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1809, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i581 = getelementptr %"struct.std::dcomplex"* %tmp.0.i579, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i582 = load double* %tmp.14.i581 ; <double> [#uses=1]
- store double %tmp.15.i582, double* %tmp.13.i580
- %tmp.16.i583 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1809, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i584 = getelementptr %"struct.std::dcomplex"* %tmp.0.i579, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i585 = load double* %tmp.17.i584 ; <double> [#uses=1]
- store double %tmp.18.i585, double* %tmp.16.i583
- %tmp.4.i559 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i558, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i596, double* %tmp.4.i559
- %tmp.7.i562 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i558, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i599, double* %tmp.7.i562
- %tmp.0.i565 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i558, %"struct.std::dcomplex"* %mem_tmp.1809 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i567 = getelementptr %"struct.std::dcomplex"* %tmp.0.i565, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i568 = load double* %tmp.14.i567 ; <double> [#uses=1]
- %tmp.17.i570 = getelementptr %"struct.std::dcomplex"* %tmp.0.i565, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i571 = load double* %tmp.17.i570 ; <double> [#uses=1]
- %tmp.4.i545 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i544, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i568, double* %tmp.4.i545
- %tmp.7.i548 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i544, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i571, double* %tmp.7.i548
- %tmp.0.i551 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i544, %"struct.std::dcomplex"* %tmp.45 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i553 = getelementptr %"struct.std::dcomplex"* %tmp.0.i551, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i554 = load double* %tmp.14.i553 ; <double> [#uses=1]
- %tmp.17.i556 = getelementptr %"struct.std::dcomplex"* %tmp.0.i551, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i557 = load double* %tmp.17.i556 ; <double> [#uses=1]
- %tmp.4.i531 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i530, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i533 = load double* %tmp.5.i34352 ; <double> [#uses=1]
- store double %tmp.6.i533, double* %tmp.4.i531
- %tmp.7.i534 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i530, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i536 = load double* %tmp.8.i34355 ; <double> [#uses=1]
- store double %tmp.9.i536, double* %tmp.7.i534
- %tmp.0.i537 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i530, %"struct.std::dcomplex"* %tmp.6 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i539 = getelementptr %"struct.std::dcomplex"* %tmp.0.i537, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i540 = load double* %tmp.14.i539 ; <double> [#uses=1]
- %tmp.17.i542 = getelementptr %"struct.std::dcomplex"* %tmp.0.i537, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i543 = load double* %tmp.17.i542 ; <double> [#uses=1]
- %tmp.4.i517 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i516, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i519 = load double* %tmp.5.i34338 ; <double> [#uses=1]
- store double %tmp.6.i519, double* %tmp.4.i517
- %tmp.7.i520 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i516, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i522 = load double* %tmp.8.i34341 ; <double> [#uses=1]
- store double %tmp.9.i522, double* %tmp.7.i520
- %tmp.0.i523 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i516, %"struct.std::dcomplex"* %tmp.12 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i524 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1813, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i525 = getelementptr %"struct.std::dcomplex"* %tmp.0.i523, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i526 = load double* %tmp.14.i525 ; <double> [#uses=1]
- store double %tmp.15.i526, double* %tmp.13.i524
- %tmp.16.i527 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1813, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i528 = getelementptr %"struct.std::dcomplex"* %tmp.0.i523, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i529 = load double* %tmp.17.i528 ; <double> [#uses=1]
- store double %tmp.18.i529, double* %tmp.16.i527
- %tmp.4.i503 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i502, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i540, double* %tmp.4.i503
- %tmp.7.i506 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i502, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i543, double* %tmp.7.i506
- %tmp.0.i509 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i502, %"struct.std::dcomplex"* %mem_tmp.1813 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i511 = getelementptr %"struct.std::dcomplex"* %tmp.0.i509, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i512 = load double* %tmp.14.i511 ; <double> [#uses=1]
- %tmp.17.i514 = getelementptr %"struct.std::dcomplex"* %tmp.0.i509, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i515 = load double* %tmp.17.i514 ; <double> [#uses=1]
- %tmp.4.i489 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i488, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i512, double* %tmp.4.i489
- %tmp.7.i492 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i488, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i515, double* %tmp.7.i492
- %tmp.0.i495 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i488, %"struct.std::dcomplex"* %tmp.1075 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i496 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1810, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i497 = getelementptr %"struct.std::dcomplex"* %tmp.0.i495, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i498 = load double* %tmp.14.i497 ; <double> [#uses=1]
- store double %tmp.15.i498, double* %tmp.13.i496
- %tmp.16.i499 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1810, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i500 = getelementptr %"struct.std::dcomplex"* %tmp.0.i495, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i501 = load double* %tmp.17.i500 ; <double> [#uses=1]
- store double %tmp.18.i501, double* %tmp.16.i499
- %tmp.4.i475 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i474, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i554, double* %tmp.4.i475
- %tmp.7.i478 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i474, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i557, double* %tmp.7.i478
- %tmp.0.i481 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i474, %"struct.std::dcomplex"* %mem_tmp.1810 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i483 = getelementptr %"struct.std::dcomplex"* %tmp.0.i481, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i484 = load double* %tmp.14.i483 ; <double> [#uses=1]
- %tmp.17.i486 = getelementptr %"struct.std::dcomplex"* %tmp.0.i481, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i487 = load double* %tmp.17.i486 ; <double> [#uses=1]
- %tmp.4.i461 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i460, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i463 = load double* %tmp.5.i34338 ; <double> [#uses=1]
- store double %tmp.6.i463, double* %tmp.4.i461
- %tmp.7.i464 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i460, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i466 = load double* %tmp.8.i34341 ; <double> [#uses=1]
- store double %tmp.9.i466, double* %tmp.7.i464
- %tmp.0.i467 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i460, %"struct.std::dcomplex"* %tmp.1036 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i469 = getelementptr %"struct.std::dcomplex"* %tmp.0.i467, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i470 = load double* %tmp.14.i469 ; <double> [#uses=1]
- %tmp.17.i472 = getelementptr %"struct.std::dcomplex"* %tmp.0.i467, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i473 = load double* %tmp.17.i472 ; <double> [#uses=1]
- %tmp.4.i447 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i446, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i449 = load double* %tmp.5.i28602 ; <double> [#uses=1]
- store double %tmp.6.i449, double* %tmp.4.i447
- %tmp.7.i450 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i446, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i452 = load double* %tmp.8.i28605 ; <double> [#uses=1]
- store double %tmp.9.i452, double* %tmp.7.i450
- %tmp.0.i453 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i446, %"struct.std::dcomplex"* %tmp.6 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i454 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1817, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i455 = getelementptr %"struct.std::dcomplex"* %tmp.0.i453, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i456 = load double* %tmp.14.i455 ; <double> [#uses=1]
- store double %tmp.15.i456, double* %tmp.13.i454
- %tmp.16.i457 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1817, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i458 = getelementptr %"struct.std::dcomplex"* %tmp.0.i453, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i459 = load double* %tmp.17.i458 ; <double> [#uses=1]
- store double %tmp.18.i459, double* %tmp.16.i457
- %tmp.4.i433 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i432, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i470, double* %tmp.4.i433
- %tmp.7.i436 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i432, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i473, double* %tmp.7.i436
- %tmp.0.i439 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i432, %"struct.std::dcomplex"* %mem_tmp.1817 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i441 = getelementptr %"struct.std::dcomplex"* %tmp.0.i439, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i442 = load double* %tmp.14.i441 ; <double> [#uses=1]
- %tmp.17.i444 = getelementptr %"struct.std::dcomplex"* %tmp.0.i439, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i445 = load double* %tmp.17.i444 ; <double> [#uses=1]
- %tmp.4.i419 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i418, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i442, double* %tmp.4.i419
- %tmp.7.i422 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i418, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i445, double* %tmp.7.i422
- %tmp.0.i425 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i418, %"struct.std::dcomplex"* %tmp.30 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i426 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1814, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i427 = getelementptr %"struct.std::dcomplex"* %tmp.0.i425, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i428 = load double* %tmp.14.i427 ; <double> [#uses=1]
- store double %tmp.15.i428, double* %tmp.13.i426
- %tmp.16.i429 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1814, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i430 = getelementptr %"struct.std::dcomplex"* %tmp.0.i425, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i431 = load double* %tmp.17.i430 ; <double> [#uses=1]
- store double %tmp.18.i431, double* %tmp.16.i429
- %tmp.4.i405 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i404, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i484, double* %tmp.4.i405
- %tmp.7.i408 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i404, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i487, double* %tmp.7.i408
- %tmp.0.i411 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i404, %"struct.std::dcomplex"* %mem_tmp.1814 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i413 = getelementptr %"struct.std::dcomplex"* %tmp.0.i411, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i414 = load double* %tmp.14.i413 ; <double> [#uses=1]
- %tmp.17.i416 = getelementptr %"struct.std::dcomplex"* %tmp.0.i411, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i417 = load double* %tmp.17.i416 ; <double> [#uses=1]
- store double %tmp.15.i414, double* %tmp.2.i34364
- store double %tmp.18.i417, double* %tmp.6.i34365
- %tmp.4.i371 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i370, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i373 = load double* %tmp.5.i34136 ; <double> [#uses=1]
- store double %tmp.6.i373, double* %tmp.4.i371
- %tmp.7.i374 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i370, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i376 = load double* %tmp.8.i34139 ; <double> [#uses=1]
- store double %tmp.9.i376, double* %tmp.7.i374
- %tmp.0.i377 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i370, %"struct.std::dcomplex"* %ret3 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i379 = getelementptr %"struct.std::dcomplex"* %tmp.0.i377, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i380 = load double* %tmp.14.i379 ; <double> [#uses=1]
- %tmp.17.i382 = getelementptr %"struct.std::dcomplex"* %tmp.0.i377, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i383 = load double* %tmp.17.i382 ; <double> [#uses=1]
- %tmp.7.i337 = load double* %tmp.2.i34366 ; <double> [#uses=1]
- %tmp.15.i351 = add double %tmp.7.i337, %tmp.15.i380 ; <double> [#uses=1]
- store double %tmp.15.i351, double* %tmp.2.i34366
- %tmp.26.i358 = load double* %tmp.6.i34367 ; <double> [#uses=1]
- %tmp.31.i369 = add double %tmp.26.i358, %tmp.18.i383 ; <double> [#uses=1]
- store double %tmp.31.i369, double* %tmp.6.i34367
- %tmp.4.i317 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i316, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i319 = load double* %tmp.5.i34082 ; <double> [#uses=1]
- store double %tmp.6.i319, double* %tmp.4.i317
- %tmp.7.i320 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i316, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i322 = load double* %tmp.8.i34085 ; <double> [#uses=1]
- store double %tmp.9.i322, double* %tmp.7.i320
- %tmp.0.i323 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i316, %"struct.std::dcomplex"* %tmp.6 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i325 = getelementptr %"struct.std::dcomplex"* %tmp.0.i323, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i326 = load double* %tmp.14.i325 ; <double> [#uses=1]
- %tmp.17.i328 = getelementptr %"struct.std::dcomplex"* %tmp.0.i323, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i329 = load double* %tmp.17.i328 ; <double> [#uses=1]
- %tmp.4.i303 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i302, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i305 = load double* %tmp.5.i34338 ; <double> [#uses=1]
- store double %tmp.6.i305, double* %tmp.4.i303
- %tmp.7.i306 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i302, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i308 = load double* %tmp.8.i34341 ; <double> [#uses=1]
- store double %tmp.9.i308, double* %tmp.7.i306
- %tmp.0.i309 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i302, %"struct.std::dcomplex"* %tmp.62 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i310 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1824, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i311 = getelementptr %"struct.std::dcomplex"* %tmp.0.i309, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i312 = load double* %tmp.14.i311 ; <double> [#uses=1]
- store double %tmp.15.i312, double* %tmp.13.i310
- %tmp.16.i313 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1824, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i314 = getelementptr %"struct.std::dcomplex"* %tmp.0.i309, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i315 = load double* %tmp.17.i314 ; <double> [#uses=1]
- store double %tmp.18.i315, double* %tmp.16.i313
- %tmp.4.i289 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i288, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i326, double* %tmp.4.i289
- %tmp.7.i292 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i288, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i329, double* %tmp.7.i292
- %tmp.0.i295 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i288, %"struct.std::dcomplex"* %mem_tmp.1824 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i297 = getelementptr %"struct.std::dcomplex"* %tmp.0.i295, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i298 = load double* %tmp.14.i297 ; <double> [#uses=1]
- %tmp.17.i300 = getelementptr %"struct.std::dcomplex"* %tmp.0.i295, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i301 = load double* %tmp.17.i300 ; <double> [#uses=1]
- %tmp.4.i275 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i274, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i298, double* %tmp.4.i275
- %tmp.7.i278 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i274, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i301, double* %tmp.7.i278
- %tmp.0.i281 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i274, %"struct.std::dcomplex"* %tmp.30 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i283 = getelementptr %"struct.std::dcomplex"* %tmp.0.i281, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i284 = load double* %tmp.14.i283 ; <double> [#uses=1]
- %tmp.17.i286 = getelementptr %"struct.std::dcomplex"* %tmp.0.i281, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i287 = load double* %tmp.17.i286 ; <double> [#uses=1]
- %tmp.4.i261 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i260, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i263 = load double* %tmp.5.i34352 ; <double> [#uses=1]
- store double %tmp.6.i263, double* %tmp.4.i261
- %tmp.7.i264 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i260, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i266 = load double* %tmp.8.i34355 ; <double> [#uses=1]
- store double %tmp.9.i266, double* %tmp.7.i264
- %tmp.0.i267 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i260, %"struct.std::dcomplex"* %tmp.62 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i269 = getelementptr %"struct.std::dcomplex"* %tmp.0.i267, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i270 = load double* %tmp.14.i269 ; <double> [#uses=1]
- %tmp.17.i272 = getelementptr %"struct.std::dcomplex"* %tmp.0.i267, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i273 = load double* %tmp.17.i272 ; <double> [#uses=1]
- %tmp.4.i247 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i246, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i249 = load double* %tmp.5.i34082 ; <double> [#uses=1]
- store double %tmp.6.i249, double* %tmp.4.i247
- %tmp.7.i250 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i246, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i252 = load double* %tmp.8.i34085 ; <double> [#uses=1]
- store double %tmp.9.i252, double* %tmp.7.i250
- %tmp.0.i253 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i246, %"struct.std::dcomplex"* %tmp.12 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i254 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1828, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i255 = getelementptr %"struct.std::dcomplex"* %tmp.0.i253, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i256 = load double* %tmp.14.i255 ; <double> [#uses=1]
- store double %tmp.15.i256, double* %tmp.13.i254
- %tmp.16.i257 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1828, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i258 = getelementptr %"struct.std::dcomplex"* %tmp.0.i253, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i259 = load double* %tmp.17.i258 ; <double> [#uses=1]
- store double %tmp.18.i259, double* %tmp.16.i257
- %tmp.4.i233 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i232, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i270, double* %tmp.4.i233
- %tmp.7.i236 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i232, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i273, double* %tmp.7.i236
- %tmp.0.i239 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i232, %"struct.std::dcomplex"* %mem_tmp.1828 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i241 = getelementptr %"struct.std::dcomplex"* %tmp.0.i239, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i242 = load double* %tmp.14.i241 ; <double> [#uses=1]
- %tmp.17.i244 = getelementptr %"struct.std::dcomplex"* %tmp.0.i239, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i245 = load double* %tmp.17.i244 ; <double> [#uses=1]
- %tmp.4.i219 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i218, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i242, double* %tmp.4.i219
- %tmp.7.i222 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i218, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i245, double* %tmp.7.i222
- %tmp.0.i225 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i218, %"struct.std::dcomplex"* %tmp.45 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i226 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1825, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i227 = getelementptr %"struct.std::dcomplex"* %tmp.0.i225, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i228 = load double* %tmp.14.i227 ; <double> [#uses=1]
- store double %tmp.15.i228, double* %tmp.13.i226
- %tmp.16.i229 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1825, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i230 = getelementptr %"struct.std::dcomplex"* %tmp.0.i225, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i231 = load double* %tmp.17.i230 ; <double> [#uses=1]
- store double %tmp.18.i231, double* %tmp.16.i229
- %tmp.4.i205 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i204, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i284, double* %tmp.4.i205
- %tmp.7.i208 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i204, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i287, double* %tmp.7.i208
- %tmp.0.i211 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i204, %"struct.std::dcomplex"* %mem_tmp.1825 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i213 = getelementptr %"struct.std::dcomplex"* %tmp.0.i211, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i214 = load double* %tmp.14.i213 ; <double> [#uses=1]
- %tmp.17.i216 = getelementptr %"struct.std::dcomplex"* %tmp.0.i211, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i217 = load double* %tmp.17.i216 ; <double> [#uses=1]
- %tmp.4.i191 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i190, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i193 = load double* %tmp.5.i34338 ; <double> [#uses=1]
- store double %tmp.6.i193, double* %tmp.4.i191
- %tmp.7.i194 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i190, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i196 = load double* %tmp.8.i34341 ; <double> [#uses=1]
- store double %tmp.9.i196, double* %tmp.7.i194
- %tmp.0.i197 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i190, %"struct.std::dcomplex"* %tmp.12 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i199 = getelementptr %"struct.std::dcomplex"* %tmp.0.i197, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i200 = load double* %tmp.14.i199 ; <double> [#uses=1]
- %tmp.17.i202 = getelementptr %"struct.std::dcomplex"* %tmp.0.i197, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i203 = load double* %tmp.17.i202 ; <double> [#uses=1]
- %tmp.4.i177 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i176, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i179 = load double* %tmp.5.i34352 ; <double> [#uses=1]
- store double %tmp.6.i179, double* %tmp.4.i177
- %tmp.7.i180 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i176, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i182 = load double* %tmp.8.i34355 ; <double> [#uses=1]
- store double %tmp.9.i182, double* %tmp.7.i180
- %tmp.0.i183 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i176, %"struct.std::dcomplex"* %tmp.6 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i184 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1832, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i185 = getelementptr %"struct.std::dcomplex"* %tmp.0.i183, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i186 = load double* %tmp.14.i185 ; <double> [#uses=1]
- store double %tmp.15.i186, double* %tmp.13.i184
- %tmp.16.i187 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1832, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i188 = getelementptr %"struct.std::dcomplex"* %tmp.0.i183, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i189 = load double* %tmp.17.i188 ; <double> [#uses=1]
- store double %tmp.18.i189, double* %tmp.16.i187
- %tmp.4.i163 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i162, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i200, double* %tmp.4.i163
- %tmp.7.i166 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i162, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i203, double* %tmp.7.i166
- %tmp.0.i169 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i162, %"struct.std::dcomplex"* %mem_tmp.1832 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i171 = getelementptr %"struct.std::dcomplex"* %tmp.0.i169, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i172 = load double* %tmp.14.i171 ; <double> [#uses=1]
- %tmp.17.i174 = getelementptr %"struct.std::dcomplex"* %tmp.0.i169, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i175 = load double* %tmp.17.i174 ; <double> [#uses=1]
- %tmp.4.i149 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i148, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i172, double* %tmp.4.i149
- %tmp.7.i152 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i148, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i175, double* %tmp.7.i152
- %tmp.0.i155 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i148, %"struct.std::dcomplex"* %tmp.95 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.13.i156 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1829, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.14.i157 = getelementptr %"struct.std::dcomplex"* %tmp.0.i155, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i158 = load double* %tmp.14.i157 ; <double> [#uses=1]
- store double %tmp.15.i158, double* %tmp.13.i156
- %tmp.16.i159 = getelementptr %"struct.std::dcomplex"* %mem_tmp.1829, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.17.i160 = getelementptr %"struct.std::dcomplex"* %tmp.0.i155, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i161 = load double* %tmp.17.i160 ; <double> [#uses=1]
- store double %tmp.18.i161, double* %tmp.16.i159
- %tmp.4.i135 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i134, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp.15.i214, double* %tmp.4.i135
- %tmp.7.i138 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i134, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.18.i217, double* %tmp.7.i138
- %tmp.0.i141 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i134, %"struct.std::dcomplex"* %mem_tmp.1829 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i143 = getelementptr %"struct.std::dcomplex"* %tmp.0.i141, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i144 = load double* %tmp.14.i143 ; <double> [#uses=1]
- %tmp.17.i146 = getelementptr %"struct.std::dcomplex"* %tmp.0.i141, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i147 = load double* %tmp.17.i146 ; <double> [#uses=1]
- store double %tmp.15.i144, double* %tmp.2.i34364
- store double %tmp.18.i147, double* %tmp.6.i34365
- %tmp.4.i101 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i100, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i103 = load double* %tmp.5.i27590 ; <double> [#uses=1]
- store double %tmp.6.i103, double* %tmp.4.i101
- %tmp.7.i104 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i100, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i106 = load double* %tmp.8.i27593 ; <double> [#uses=1]
- store double %tmp.9.i106, double* %tmp.7.i104
- %tmp.0.i107 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i100, %"struct.std::dcomplex"* %ret3 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i109 = getelementptr %"struct.std::dcomplex"* %tmp.0.i107, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i110 = load double* %tmp.14.i109 ; <double> [#uses=1]
- %tmp.17.i112 = getelementptr %"struct.std::dcomplex"* %tmp.0.i107, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i113 = load double* %tmp.17.i112 ; <double> [#uses=1]
- %tmp.7.i67 = load double* %tmp.2.i34366 ; <double> [#uses=1]
- %tmp.15.i81 = add double %tmp.7.i67, %tmp.15.i110 ; <double> [#uses=1]
- store double %tmp.15.i81, double* %tmp.2.i34366
- %tmp.26.i88 = load double* %tmp.6.i34367 ; <double> [#uses=1]
- %tmp.31.i99 = add double %tmp.26.i88, %tmp.18.i113 ; <double> [#uses=1]
- store double %tmp.31.i99, double* %tmp.6.i34367
- %tmp.4.i47 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i46, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i49 = load double* %tmp.5.i29864 ; <double> [#uses=1]
- store double %tmp.6.i49, double* %tmp.4.i47
- %tmp.7.i50 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i46, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i52 = load double* %tmp.8.i29867 ; <double> [#uses=1]
- store double %tmp.9.i52, double* %tmp.7.i50
- %tmp.0.i53 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i46, %"struct.std::dcomplex"* %ret4 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i55 = getelementptr %"struct.std::dcomplex"* %tmp.0.i53, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i56 = load double* %tmp.14.i55 ; <double> [#uses=1]
- %tmp.17.i58 = getelementptr %"struct.std::dcomplex"* %tmp.0.i53, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i59 = load double* %tmp.17.i58 ; <double> [#uses=1]
- %tmp.7.i13 = load double* %tmp.2.i34368 ; <double> [#uses=1]
- %tmp.15.i27 = add double %tmp.7.i13, %tmp.15.i56 ; <double> [#uses=1]
- store double %tmp.15.i27, double* %tmp.2.i34368
- %tmp.26.i34 = load double* %tmp.6.i34369 ; <double> [#uses=1]
- %tmp.31.i45 = add double %tmp.26.i34, %tmp.18.i59 ; <double> [#uses=1]
- store double %tmp.31.i45, double* %tmp.6.i34369
- %tmp.4.i = getelementptr %"struct.std::dcomplex"* %mem_tmp.i, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.5.i3 = getelementptr [6 x %"struct.std::dcomplex"]* %_m, i32 5, i32 4, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.6.i.upgrd.1 = load double* %tmp.5.i3 ; <double> [#uses=1]
- store double %tmp.6.i.upgrd.1, double* %tmp.4.i
- %tmp.7.i = getelementptr %"struct.std::dcomplex"* %mem_tmp.i, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.8.i4 = getelementptr [6 x %"struct.std::dcomplex"]* %_m, i32 5, i32 4, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.9.i = load double* %tmp.8.i4 ; <double> [#uses=1]
- store double %tmp.9.i, double* %tmp.7.i
- %tmp.0.i = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i, %"struct.std::dcomplex"* %ret5 ) ; <%"struct.std::dcomplex"*> [#uses=2]
- %tmp.14.i = getelementptr %"struct.std::dcomplex"* %tmp.0.i, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp.15.i5 = load double* %tmp.14.i ; <double> [#uses=1]
- %tmp.17.i = getelementptr %"struct.std::dcomplex"* %tmp.0.i, i32 0, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp.18.i = load double* %tmp.17.i ; <double> [#uses=1]
- %tmp.7.i.upgrd.2 = load double* %tmp.2.i ; <double> [#uses=1]
- %tmp.15.i = add double %tmp.7.i.upgrd.2, %tmp.15.i5 ; <double> [#uses=1]
- store double %tmp.15.i, double* %tmp.2.i
- %tmp.26.i = load double* %tmp.6.i ; <double> [#uses=1]
- %tmp.31.i = add double %tmp.26.i, %tmp.18.i ; <double> [#uses=1]
- store double %tmp.31.i, double* %tmp.6.i
- ret void
-}
diff --git a/release_23/test/Assembler/2004-10-22-BCWriterUndefBug.ll b/release_23/test/Assembler/2004-10-22-BCWriterUndefBug.ll
deleted file mode 100644
index 3c2654456c8c..000000000000
--- a/release_23/test/Assembler/2004-10-22-BCWriterUndefBug.ll
+++ /dev/null
@@ -1,5 +0,0 @@
-;; The bytecode writer was trying to treat undef values as ConstantArray's when
-;; they looked like strings.
-;; RUN: llvm-as < %s -o /dev/null -f
-@G = internal global [8 x i8] undef
-
diff --git a/release_23/test/Assembler/2004-11-28-InvalidTypeCrash.ll b/release_23/test/Assembler/2004-11-28-InvalidTypeCrash.ll
deleted file mode 100644
index 4ae4765169e4..000000000000
--- a/release_23/test/Assembler/2004-11-28-InvalidTypeCrash.ll
+++ /dev/null
@@ -1,5 +0,0 @@
-; Test for PR463. This program is erroneous, but should not crash llvm-as.
-; RUN: not llvm-as < %s -o /dev/null -f |& \
-; RUN: grep {Cannot create a null initialized value of this type}
-
-@.FOO = internal global %struct.none zeroinitializer
diff --git a/release_23/test/Assembler/2005-01-03-FPConstantDisassembly.ll b/release_23/test/Assembler/2005-01-03-FPConstantDisassembly.ll
deleted file mode 100644
index aaa776f51b81..000000000000
--- a/release_23/test/Assembler/2005-01-03-FPConstantDisassembly.ll
+++ /dev/null
@@ -1,6 +0,0 @@
-; RUN: llvm-as < %s | llvm-dis | grep 1.0
-
-define double @test() {
- ret double 1.0 ;; This should not require hex notation
-}
-
diff --git a/release_23/test/Assembler/2005-01-31-CallingAggregateFunction.ll b/release_23/test/Assembler/2005-01-31-CallingAggregateFunction.ll
deleted file mode 100644
index 9bd6e31e39d3..000000000000
--- a/release_23/test/Assembler/2005-01-31-CallingAggregateFunction.ll
+++ /dev/null
@@ -1,8 +0,0 @@
-; RUN: llvm-as < %s -o /dev/null -f
-
-define void @test() {
- call {i32} @foo()
- ret void
-}
-
-declare {i32 } @foo()
diff --git a/release_23/test/Assembler/2005-02-09-AsmWriterStoreBug.ll b/release_23/test/Assembler/2005-02-09-AsmWriterStoreBug.ll
deleted file mode 100644
index 4ec17966e792..000000000000
--- a/release_23/test/Assembler/2005-02-09-AsmWriterStoreBug.ll
+++ /dev/null
@@ -1,14 +0,0 @@
-; RUN: llvm-as < %s | llvm-dis | llvm-as
-
-; Ensure that the asm writer emits types before both operands of the
-; store, even though they can be the same.
-
-%RecTy = type %RecTy*
-
-define void @foo() {
- %A = malloc %RecTy ; <%RecTy> [#uses=1]
- %B = malloc %RecTy ; <%RecTy> [#uses=1]
- store %RecTy %B, %RecTy %A
- ret void
-}
-
diff --git a/release_23/test/Assembler/2005-05-05-OpaqueUndefValues.ll b/release_23/test/Assembler/2005-05-05-OpaqueUndefValues.ll
deleted file mode 100644
index 483a895124e8..000000000000
--- a/release_23/test/Assembler/2005-05-05-OpaqueUndefValues.ll
+++ /dev/null
@@ -1,4 +0,0 @@
-; RUN: llvm-as < %s | llvm-dis | llvm-as
-
-%t = type opaque
-@x = global %t undef
diff --git a/release_23/test/Assembler/2005-12-21-ZeroInitVector.ll b/release_23/test/Assembler/2005-12-21-ZeroInitVector.ll
deleted file mode 100644
index d3a692c60c9e..000000000000
--- a/release_23/test/Assembler/2005-12-21-ZeroInitVector.ll
+++ /dev/null
@@ -1,6 +0,0 @@
-; RUN: llvm-as < %s > /dev/null
-
-define <4 x i32> @foo() {
- ret <4 x i32> zeroinitializer
-}
-
diff --git a/release_23/test/Assembler/2006-05-26-VarargsCallEncode.ll b/release_23/test/Assembler/2006-05-26-VarargsCallEncode.ll
deleted file mode 100644
index bfa4343940f1..000000000000
--- a/release_23/test/Assembler/2006-05-26-VarargsCallEncode.ll
+++ /dev/null
@@ -1,8 +0,0 @@
-; RUN: llvm-as < %s | llvm-dis | grep {tail call void.*sret null}
-
-declare void @foo({ }* sret , ...)
-
-define void @bar() {
- tail call void ({ }* sret , ...)* @foo( { }* null sret , i32 0 )
- ret void
-}
diff --git a/release_23/test/Assembler/2006-09-28-CrashOnInvalid.ll b/release_23/test/Assembler/2006-09-28-CrashOnInvalid.ll
deleted file mode 100644
index f77ea5c427ea..000000000000
--- a/release_23/test/Assembler/2006-09-28-CrashOnInvalid.ll
+++ /dev/null
@@ -1,8 +0,0 @@
-; Test for PR902. This program is erroneous, but should not crash llvm-as.
-; This tests that a simple error is caught and processed correctly.
-; RUN: not llvm-as < %s >/dev/null |& grep {FP constant invalid for type}
-
-define void @test() {
- add i32 1, 2.0
- ret void
-}
diff --git a/release_23/test/Assembler/2006-12-09-Cast-To-Bool.ll b/release_23/test/Assembler/2006-12-09-Cast-To-Bool.ll
deleted file mode 100644
index a70262c802c1..000000000000
--- a/release_23/test/Assembler/2006-12-09-Cast-To-Bool.ll
+++ /dev/null
@@ -1,6 +0,0 @@
-; RUN: llvm-as < %s | llvm-dis | grep bitcast
-
-define i1 @main(i32 %X) {
- %res = bitcast i1 true to i1
- ret i1 %res
-}
diff --git a/release_23/test/Assembler/2007-01-02-Undefined-Arg-Type.ll b/release_23/test/Assembler/2007-01-02-Undefined-Arg-Type.ll
deleted file mode 100644
index 9304a389f185..000000000000
--- a/release_23/test/Assembler/2007-01-02-Undefined-Arg-Type.ll
+++ /dev/null
@@ -1,9 +0,0 @@
-; The assembler should catch an undefined argument type .
-; RUN: not llvm-as < %s -o /dev/null -f |& grep {Reference to abstract argument}
-
-; %typedef.bc_struct = type opaque
-
-
-define i1 @someFunc(i32* %tmp.71.reload, %typedef.bc_struct* %n1) {
- ret i1 true
-}
diff --git a/release_23/test/Assembler/2007-01-05-Cmp-ConstExpr.ll b/release_23/test/Assembler/2007-01-05-Cmp-ConstExpr.ll
deleted file mode 100644
index c9efe177fe77..000000000000
--- a/release_23/test/Assembler/2007-01-05-Cmp-ConstExpr.ll
+++ /dev/null
@@ -1,18 +0,0 @@
-; Test Case for PR1080
-; RUN: llvm-as < %s -o /dev/null -f
-
-@str = internal constant [4 x i8] c"-ga\00" ; <[4 x i8]*> [#uses=2]
-
-define i32 @main(i32 %argc, i8** %argv) {
-entry:
- %tmp65 = getelementptr i8** %argv, i32 1 ; <i8**> [#uses=1]
- %tmp66 = load i8** %tmp65 ; <i8*> [#uses=0]
- br i1 icmp ne (i32 sub (i32 ptrtoint (i8* getelementptr ([4 x i8]* @str, i32 0, i64 1) to i32), i32 ptrtoint ([4 x i8]* @str to i32)), i32 1), label %exit_1, label %exit_2
-
-exit_1: ; preds = %entry
- ret i32 0
-
-exit_2: ; preds = %entry
- ret i32 1
-}
-
diff --git a/release_23/test/Assembler/2007-01-16-CrashOnBadCast.ll b/release_23/test/Assembler/2007-01-16-CrashOnBadCast.ll
deleted file mode 100644
index e2bb59e88bae..000000000000
--- a/release_23/test/Assembler/2007-01-16-CrashOnBadCast.ll
+++ /dev/null
@@ -1,7 +0,0 @@
-; PR1117
-; RUN: not llvm-as < %s -o /dev/null -f |& grep {invalid cast opcode for cast from}
-
-define i8* @nada(i64 %X) {
- %result = trunc i64 %X to i8*
- ret i8* %result
-}
diff --git a/release_23/test/Assembler/2007-01-16-CrashOnBadCast2.ll b/release_23/test/Assembler/2007-01-16-CrashOnBadCast2.ll
deleted file mode 100644
index ff6b5352a99d..000000000000
--- a/release_23/test/Assembler/2007-01-16-CrashOnBadCast2.ll
+++ /dev/null
@@ -1,4 +0,0 @@
-; PR1117
-; RUN: not llvm-as < %s -o /dev/null -f |& grep {invalid cast opcode for cast from}
-
-@X = constant i8* trunc (i64 0 to i8*)
diff --git a/release_23/test/Assembler/2007-03-18-InvalidNumberedVar.ll b/release_23/test/Assembler/2007-03-18-InvalidNumberedVar.ll
deleted file mode 100644
index 8e821132d8ad..000000000000
--- a/release_23/test/Assembler/2007-03-18-InvalidNumberedVar.ll
+++ /dev/null
@@ -1,9 +0,0 @@
-; PR 1258
-; RUN: not llvm-as < %s >/dev/null -f |& grep {Numbered.*does not match}
-
-define i32 @test1(i32 %a, i32 %b) {
-entry:
- icmp eq i32 %b, %a ; <i1>:0 [#uses=1]
- zext i1 %0 to i32 ; <i32>:0 [#uses=1]
- ret i32 %0 ; Invalid Type for %0
-}
diff --git a/release_23/test/Assembler/2007-03-19-NegValue.ll b/release_23/test/Assembler/2007-03-19-NegValue.ll
deleted file mode 100644
index e90cf351e1d7..000000000000
--- a/release_23/test/Assembler/2007-03-19-NegValue.ll
+++ /dev/null
@@ -1,7 +0,0 @@
-; Test whether negative values > 64 bits retain their negativeness.
-; RUN: llvm-as < %s | llvm-dis | grep {add i65.*, -1}
-
-define i65 @testConsts(i65 %N) {
- %a = add i65 %N, -1
- ret i65 %a
-}
diff --git a/release_23/test/Assembler/2007-04-15-BadIntrinsic.ll b/release_23/test/Assembler/2007-04-15-BadIntrinsic.ll
deleted file mode 100644
index 25c35409693f..000000000000
--- a/release_23/test/Assembler/2007-04-15-BadIntrinsic.ll
+++ /dev/null
@@ -1,9 +0,0 @@
-; RUN: not llvm-as < %s -o /dev/null -f |& grep {Call to invalid LLVM intrinsic}
-
-declare i32 @llvm.foobar(i32 %foo)
-
-define i32 @test() {
- %nada = call i32 @llvm.foobar(i32 0)
- ret i32 %nada
-}
-
diff --git a/release_23/test/Assembler/2007-04-20-AlignedLoad.ll b/release_23/test/Assembler/2007-04-20-AlignedLoad.ll
deleted file mode 100644
index f0217aec2ced..000000000000
--- a/release_23/test/Assembler/2007-04-20-AlignedLoad.ll
+++ /dev/null
@@ -1,7 +0,0 @@
-; RUN: llvm-as < %s | llvm-dis | grep {align 1024}
-
-define i32 @test(i32* %arg) {
-entry:
- %tmp2 = load i32* %arg, align 1024 ; <i32> [#uses=1]
- ret i32 %tmp2
-}
diff --git a/release_23/test/Assembler/2007-04-20-AlignedStore.ll b/release_23/test/Assembler/2007-04-20-AlignedStore.ll
deleted file mode 100644
index 1b08c48444c5..000000000000
--- a/release_23/test/Assembler/2007-04-20-AlignedStore.ll
+++ /dev/null
@@ -1,7 +0,0 @@
-; RUN: llvm-as < %s | llvm-dis | grep {align 1024}
-
-define void @test(i32* %arg) {
-entry:
- store i32 0, i32* %arg, align 1024
- ret void
-}
diff --git a/release_23/test/Assembler/2007-04-25-AssemblerFoldExternWeak.ll b/release_23/test/Assembler/2007-04-25-AssemblerFoldExternWeak.ll
deleted file mode 100644
index c26d9ebc26c1..000000000000
--- a/release_23/test/Assembler/2007-04-25-AssemblerFoldExternWeak.ll
+++ /dev/null
@@ -1,6 +0,0 @@
-; RUN: llvm-as < %s | llvm-dis | grep {icmp.*test_weak.*null}
-; PR1358
-@G = global i1 icmp ne (i32 (...)* @test_weak, i32 (...)* null)
-
-declare extern_weak i32 @test_weak(...)
-
diff --git a/release_23/test/Assembler/2007-05-21-Escape.ll b/release_23/test/Assembler/2007-05-21-Escape.ll
deleted file mode 100644
index 08681339d212..000000000000
--- a/release_23/test/Assembler/2007-05-21-Escape.ll
+++ /dev/null
@@ -1,22 +0,0 @@
-; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis
-target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64"
-target triple = "x86_64-apple-darwin8"
- %struct.bar = type { i32 }
- %struct.foo = type { i32 }
-
-define i32 @"Func64"(%struct.bar* %F) {
-entry:
- ret i32 1
-}
-
-define i32 @Func64(%struct.bar* %B) {
-entry:
- ret i32 0
-}
-
-define i32 @test() {
-entry:
- %tmp = tail call i32 @"Func64"( %struct.bar* null ) ; <i32> [#uses=0]
- %tmp1 = tail call i32 @Func64( %struct.bar* null ) ; <i32> [#uses=0]
- ret i32 undef
-}
diff --git a/release_23/test/Assembler/2007-07-19-ParamAttrAmbiguity.ll b/release_23/test/Assembler/2007-07-19-ParamAttrAmbiguity.ll
deleted file mode 100644
index 9c7daa841ab8..000000000000
--- a/release_23/test/Assembler/2007-07-19-ParamAttrAmbiguity.ll
+++ /dev/null
@@ -1,9 +0,0 @@
-; PR1553
-; RUN: llvm-as < %s > /dev/null
-define void @bar() {
- %t = call i8 @foo( i8 10 )
- zext i8 %t to i32
- ret void
-}
-
-declare i8 @foo(i8)
diff --git a/release_23/test/Assembler/2007-07-30-AutoUpgradeZextSext.ll b/release_23/test/Assembler/2007-07-30-AutoUpgradeZextSext.ll
deleted file mode 100644
index ea2db4414f56..000000000000
--- a/release_23/test/Assembler/2007-07-30-AutoUpgradeZextSext.ll
+++ /dev/null
@@ -1,12 +0,0 @@
-; Test that upgrading zext/sext attributes to zeroext and signext
-; works correctly.
-; PR1553
-; RUN: llvm-as < %s > /dev/null
-
-define i32 @bar() {
- %t = call i8 @foo( i8 10 sext ) zext
- %x = zext i8 %t to i32
- ret i32 %x
-}
-
-declare i8 @foo(i8 signext ) zeroext
diff --git a/release_23/test/Assembler/2007-08-06-AliasInvalid.ll b/release_23/test/Assembler/2007-08-06-AliasInvalid.ll
deleted file mode 100644
index b54acec1c94b..000000000000
--- a/release_23/test/Assembler/2007-08-06-AliasInvalid.ll
+++ /dev/null
@@ -1,7 +0,0 @@
-; RUN: not llvm-as < %s > /dev/null |& grep {Invalid type for reference to global}
-; PR1577
-
-@anInt = global i32 1 alias i32 @anAlias
-define i32 @main() {
- ret i32 0
-}
diff --git a/release_23/test/Assembler/2007-09-10-AliasFwdRef.ll b/release_23/test/Assembler/2007-09-10-AliasFwdRef.ll
deleted file mode 100644
index b21491ba5a90..000000000000
--- a/release_23/test/Assembler/2007-09-10-AliasFwdRef.ll
+++ /dev/null
@@ -1,9 +0,0 @@
-; RUN: llvm-as < %s | llvm-dis
-; PR1645
-
-@__gthread_active_ptr.5335 = internal constant i8* bitcast (i32 (i32)* @__gthrw_pthread_cancel to i8*)
-@__gthrw_pthread_cancel = alias weak i32 (i32)* @pthread_cancel
-
-
-
-declare extern_weak i32 @pthread_cancel(i32)
diff --git a/release_23/test/Assembler/2007-09-29-GC.ll b/release_23/test/Assembler/2007-09-29-GC.ll
deleted file mode 100644
index 789a0fe1edc0..000000000000
--- a/release_23/test/Assembler/2007-09-29-GC.ll
+++ /dev/null
@@ -1,12 +0,0 @@
-; RUN: llvm-as < %s | llvm-dis | grep {@f.*gc.*shadowstack}
-; RUN: llvm-as < %s | llvm-dis | grep {@g.*gc.*java}
-
-define void @f() gc "shadowstack" {
-entry:
- ret void
-}
-
-define void @g() gc "java" {
-entry:
- ret void
-}
diff --git a/release_23/test/Assembler/2007-11-26-AttributeOverload.ll b/release_23/test/Assembler/2007-11-26-AttributeOverload.ll
deleted file mode 100644
index 9aec8d951096..000000000000
--- a/release_23/test/Assembler/2007-11-26-AttributeOverload.ll
+++ /dev/null
@@ -1,4 +0,0 @@
-; RUN: not llvm-as < %s
-
-declare i32 @atoi(i8*) nounwind readonly
-declare i32 @atoi(i8*)
diff --git a/release_23/test/Assembler/2007-11-27-AutoUpgradeAttributes.ll b/release_23/test/Assembler/2007-11-27-AutoUpgradeAttributes.ll
deleted file mode 100644
index ee260eadb7ae..000000000000
--- a/release_23/test/Assembler/2007-11-27-AutoUpgradeAttributes.ll
+++ /dev/null
@@ -1,3 +0,0 @@
-; RUN: llvm-as < %s
-
-@FP = weak global i8 (...) signext * null
diff --git a/release_23/test/Assembler/2007-12-11-AddressSpaces.ll b/release_23/test/Assembler/2007-12-11-AddressSpaces.ll
deleted file mode 100644
index 16d01307f3a3..000000000000
--- a/release_23/test/Assembler/2007-12-11-AddressSpaces.ll
+++ /dev/null
@@ -1,25 +0,0 @@
-; RUN: llvm-as < %s | llvm-dis | grep {addrspace(33)} | count 7
-; RUN: llvm-as < %s | llvm-dis | grep {addrspace(42)} | count 2
-; RUN: llvm-as < %s | llvm-dis | grep {addrspace(66)} | count 2
-; RUN: llvm-as < %s | llvm-dis | grep {addrspace(11)} | count 6
-; RUN: llvm-as < %s | llvm-dis | grep {addrspace(22)} | count 5
-
- %struct.mystruct = type { i32, i32 addrspace(33)*, i32, i32 addrspace(33)* }
-@input = weak global %struct.mystruct zeroinitializer addrspace(42) ; <%struct.mystruct addrspace(42)*> [#uses=1]
-@output = global %struct.mystruct zeroinitializer addrspace(66) ; <%struct.mystruct addrspace(66)*> [#uses=1]
-@y = external global i32 addrspace(11)* addrspace(22)* addrspace(33) ; <i32 addrspace(11)* addrspace(22)* addrspace(33)*> [#uses=1]
-
-define void @foo() {
-entry:
- %tmp1 = load i32 addrspace(33)* addrspace(42)* getelementptr (%struct.mystruct addrspace(42)* @input, i32 0, i32 3), align 4 ; <i32 addrspace(33)*> [#uses=1]
- store i32 addrspace(33)* %tmp1, i32 addrspace(33)* addrspace(66)* getelementptr (%struct.mystruct addrspace(66)* @output, i32 0, i32 1), align 4
- ret void
-}
-
-define i32 addrspace(11)* @bar(i32 addrspace(11)* addrspace(22)* addrspace(33)* %x) {
-entry:
- %tmp1 = load i32 addrspace(11)* addrspace(22)* addrspace(33)* @y, align 4 ; <i32 addrspace(11)* addrspace(22)*> [#uses=2]
- store i32 addrspace(11)* addrspace(22)* %tmp1, i32 addrspace(11)* addrspace(22)* addrspace(33)* %x, align 4
- %tmp5 = load i32 addrspace(11)* addrspace(22)* %tmp1, align 4 ; <i32 addrspace(11)*> [#uses=1]
- ret i32 addrspace(11)* %tmp5
-}
diff --git a/release_23/test/Assembler/2008-01-11-VarargAttrs.ll b/release_23/test/Assembler/2008-01-11-VarargAttrs.ll
deleted file mode 100644
index c0aedc80b4c3..000000000000
--- a/release_23/test/Assembler/2008-01-11-VarargAttrs.ll
+++ /dev/null
@@ -1,10 +0,0 @@
-; RUN: llvm-as < %s | llvm-dis | grep byval
-
- %struct = type { }
-
-declare void @foo(...)
-
-define void @bar() {
- call void (...)* @foo(%struct* byval null )
- ret void
-}
diff --git a/release_23/test/Assembler/2008-02-18-IntPointerCrash.ll b/release_23/test/Assembler/2008-02-18-IntPointerCrash.ll
deleted file mode 100644
index 69632ae85cd5..000000000000
--- a/release_23/test/Assembler/2008-02-18-IntPointerCrash.ll
+++ /dev/null
@@ -1,6 +0,0 @@
-; RUN: not llvm-as %s |& grep {is invalid or}
-; PR2060
-
-define i8* @foo() {
- ret i8* 0
-}
diff --git a/release_23/test/Assembler/2008-02-20-MultipleReturnValue.ll b/release_23/test/Assembler/2008-02-20-MultipleReturnValue.ll
deleted file mode 100644
index 5b2ed7e8f480..000000000000
--- a/release_23/test/Assembler/2008-02-20-MultipleReturnValue.ll
+++ /dev/null
@@ -1,22 +0,0 @@
-; RUN: llvm-as < %s | opt -verify | llvm-dis | llvm-as -disable-output
-
-define {i32, i8} @foo(i32 %p) {
- ret i32 1, i8 2
-}
-
-define i8 @f2(i32 %p) {
- %c = call {i32, i8} @foo(i32 %p)
- %d = getresult {i32, i8} %c, 1
- %e = add i8 %d, 1
- ret i8 %e
-}
-
-define i32 @f3(i32 %p) {
- %c = invoke {i32, i8} @foo(i32 %p)
- to label %L unwind label %L2
- L:
- %d = getresult {i32, i8} %c, 0
- ret i32 %d
- L2:
- ret i32 0
-}
diff --git a/release_23/test/Assembler/AutoUpgradeIntrinsics.ll b/release_23/test/Assembler/AutoUpgradeIntrinsics.ll
deleted file mode 100644
index 15f638ce06fd..000000000000
--- a/release_23/test/Assembler/AutoUpgradeIntrinsics.ll
+++ /dev/null
@@ -1,81 +0,0 @@
-; Tests to make sure intrinsics are automatically upgraded.
-; RUN: llvm-as < %s | llvm-dis | not grep {i32 @llvm\\.ct}
-; RUN: llvm-as < %s | llvm-dis | \
-; RUN: not grep {llvm\\.part\\.set\\.i\[0-9\]*\\.i\[0-9\]*\\.i\[0-9\]*}
-; RUN: llvm-as < %s | llvm-dis | \
-; RUN: not grep {llvm\\.part\\.select\\.i\[0-9\]*\\.i\[0-9\]*}
-; RUN: llvm-as < %s | llvm-dis | \
-; RUN: not grep {llvm\\.bswap\\.i\[0-9\]*\\.i\[0-9\]*}
-; RUN: llvm-as < %s | llvm-dis | \
-; RUN: grep {llvm\\.x86\\.mmx\\.ps} | grep {2 x i32> | count 6
-
-declare i32 @llvm.ctpop.i28(i28 %val)
-declare i32 @llvm.cttz.i29(i29 %val)
-declare i32 @llvm.ctlz.i30(i30 %val)
-
-define i32 @test_ct(i32 %A) {
- %c1 = call i32 @llvm.ctpop.i28(i28 1234)
- %c2 = call i32 @llvm.cttz.i29(i29 2345)
- %c3 = call i32 @llvm.ctlz.i30(i30 3456)
- %r1 = add i32 %c1, %c2
- %r2 = add i32 %r1, %c3
- ret i32 %r2
-}
-
-declare i32 @llvm.part.set.i32.i32.i32(i32 %x, i32 %rep, i32 %hi, i32 %lo)
-declare i16 @llvm.part.set.i16.i16.i16(i16 %x, i16 %rep, i32 %hi, i32 %lo)
-define i32 @test_part_set(i32 %A, i16 %B) {
- %a = call i32 @llvm.part.set.i32.i32.i32(i32 %A, i32 27, i32 8, i32 0)
- %b = call i16 @llvm.part.set.i16.i16.i16(i16 %B, i16 27, i32 8, i32 0)
- %c = zext i16 %b to i32
- %d = add i32 %a, %c
- ret i32 %d
-}
-
-declare i32 @llvm.part.select.i32.i32(i32 %x, i32 %hi, i32 %lo)
-declare i16 @llvm.part.select.i16.i16(i16 %x, i32 %hi, i32 %lo)
-define i32 @test_part_select(i32 %A, i16 %B) {
- %a = call i32 @llvm.part.select.i32.i32(i32 %A, i32 8, i32 0)
- %b = call i16 @llvm.part.select.i16.i16(i16 %B, i32 8, i32 0)
- %c = zext i16 %b to i32
- %d = add i32 %a, %c
- ret i32 %d
-}
-
-declare i32 @llvm.bswap.i32.i32(i32 %x)
-declare i16 @llvm.bswap.i16.i16(i16 %x)
-define i32 @test_bswap(i32 %A, i16 %B) {
- %a = call i32 @llvm.bswap.i32.i32(i32 %A)
- %b = call i16 @llvm.bswap.i16.i16(i16 %B)
- %c = zext i16 %b to i32
- %d = add i32 %a, %c
- ret i32 %d
-}
-
-declare <4 x i16> @llvm.x86.mmx.psra.w(<4 x i16>, <2 x i32>) nounwind readnone
-declare <4 x i16> @llvm.x86.mmx.psll.w(<4 x i16>, <2 x i32>) nounwind readnone
-declare <4 x i16> @llvm.x86.mmx.psrl.w(<4 x i16>, <2 x i32>) nounwind readnone
-define void @sh16(<4 x i16> %A, <2 x i32> %B) {
- %r1 = call <4 x i16> @llvm.x86.mmx.psra.w( <4 x i16> %A, <2 x i32> %B ) ; <<4 x i16>> [#uses=0]
- %r2 = call <4 x i16> @llvm.x86.mmx.psll.w( <4 x i16> %A, <2 x i32> %B ) ; <<4 x i16>> [#uses=0]
- %r3 = call <4 x i16> @llvm.x86.mmx.psrl.w( <4 x i16> %A, <2 x i32> %B ) ; <<4 x i16>> [#uses=0]
- ret void
-}
-
-declare <2 x i32> @llvm.x86.mmx.psra.d(<2 x i32>, <2 x i32>) nounwind readnone
-declare <2 x i32> @llvm.x86.mmx.psll.d(<2 x i32>, <2 x i32>) nounwind readnone
-declare <2 x i32> @llvm.x86.mmx.psrl.d(<2 x i32>, <2 x i32>) nounwind readnone
-define void @sh32(<2 x i32> %A, <2 x i32> %B) {
- %r1 = call <2 x i32> @llvm.x86.mmx.psra.d( <2 x i32> %A, <2 x i32> %B ) ; <<2 x i32>> [#uses=0]
- %r2 = call <2 x i32> @llvm.x86.mmx.psll.d( <2 x i32> %A, <2 x i32> %B ) ; <<2 x i32>> [#uses=0]
- %r3 = call <2 x i32> @llvm.x86.mmx.psrl.d( <2 x i32> %A, <2 x i32> %B ) ; <<2 x i32>> [#uses=0]
- ret void
-}
-
-declare <1 x i64> @llvm.x86.mmx.psll.q(<1 x i64>, <2 x i32>) nounwind readnone
-declare <1 x i64> @llvm.x86.mmx.psrl.q(<1 x i64>, <2 x i32>) nounwind readnone
-define void @sh64(<1 x i64> %A, <2 x i32> %B) {
- %r1 = call <1 x i64> @llvm.x86.mmx.psll.q( <1 x i64> %A, <2 x i32> %B ) ; <<1 x i64>> [#uses=0]
- %r2 = call <1 x i64> @llvm.x86.mmx.psrl.q( <1 x i64> %A, <2 x i32> %B ) ; <<1 x i64>> [#uses=0]
- ret void
-}
diff --git a/release_23/test/Assembler/ConstantExprFold.ll b/release_23/test/Assembler/ConstantExprFold.ll
deleted file mode 100644
index 89edc24b37ec..000000000000
--- a/release_23/test/Assembler/ConstantExprFold.ll
+++ /dev/null
@@ -1,30 +0,0 @@
-; This test checks to make sure that constant exprs fold in some simple
-; situations
-
-; RUN: llvm-as < %s | llvm-dis | not grep {(}
-
-@A = global i64 0
-
-global i64* inttoptr (i64 add (i64 ptrtoint (i64* @A to i64), i64 0) to i64*) ; X + 0 == X
-global i64* inttoptr (i64 sub (i64 ptrtoint (i64* @A to i64), i64 0) to i64*) ; X - 0 == X
-global i64* inttoptr (i64 mul (i64 ptrtoint (i64* @A to i64), i64 0) to i64*) ; X * 0 == 0
-global i64* inttoptr (i64 sdiv (i64 ptrtoint (i64* @A to i64), i64 1) to i64*) ; X / 1 == X
-global i64* inttoptr (i64 srem (i64 ptrtoint (i64* @A to i64), i64 1) to i64*) ; X % 1 == 0
-global i64* inttoptr (i64 and (i64 ptrtoint (i64* @A to i64), i64 0) to i64*) ; X & 0 == 0
-global i64* inttoptr (i64 and (i64 ptrtoint (i64* @A to i64), i64 -1) to i64*) ; X & -1 == X
-global i64 or (i64 ptrtoint (i64* @A to i64), i64 -1) ; X | -1 == -1
-global i64* inttoptr (i64 xor (i64 ptrtoint (i64* @A to i64), i64 0) to i64*) ; X ^ 0 == X
-
-%Ty = type { i32, i32 }
-@B = external global %Ty
-
-global i1 icmp slt (i64* @A, i64* getelementptr (i64* @A, i64 1)) ; true
-global i1 icmp slt (i64* @A, i64* getelementptr (i64* @A, i64 0)) ; false
-global i1 icmp slt (i32* getelementptr (%Ty* @B, i64 0, i32 0),
- i32* getelementptr (%Ty* @B, i64 0, i32 1)) ; true
-;global i1 icmp ne (i64* @A, i64* bitcast (%Ty* @B to i64*)) ; true
-
-; PR2206
-@cons = weak global i32 0, align 8 ; <i32*> [#uses=1]
-global i64 and (i64 ptrtoint (i32* @cons to i64), i64 7)
-
diff --git a/release_23/test/Assembler/ConstantExprFoldCast.ll b/release_23/test/Assembler/ConstantExprFoldCast.ll
deleted file mode 100644
index 0ce6e84626a3..000000000000
--- a/release_23/test/Assembler/ConstantExprFoldCast.ll
+++ /dev/null
@@ -1,14 +0,0 @@
-; This test checks to make sure that constant exprs fold in some simple situations
-
-; RUN: llvm-as < %s | llvm-dis | not grep cast
-
-@A = global i32* bitcast (i8* null to i32*) ; Cast null -> fold
-@B = global i32** bitcast (i32** @A to i32**) ; Cast to same type -> fold
-@C = global i32 trunc (i64 42 to i32) ; Integral casts
-@D = global i32* bitcast(float* bitcast (i32* @C to float*) to i32*) ; cast of cast ptr->ptr
-@E = global i32 ptrtoint(float* inttoptr (i8 5 to float*) to i32) ; i32 -> ptr -> i32
-
-; Test folding of binary instrs
-@F = global i32* inttoptr (i32 add (i32 5, i32 -5) to i32*)
-@G = global i32* inttoptr (i32 sub (i32 5, i32 5) to i32*)
-
diff --git a/release_23/test/Assembler/MultipleReturnValueType.ll b/release_23/test/Assembler/MultipleReturnValueType.ll
deleted file mode 100644
index 617714394542..000000000000
--- a/release_23/test/Assembler/MultipleReturnValueType.ll
+++ /dev/null
@@ -1,13 +0,0 @@
-; RUN: llvm-as < %s
-
- %struct.S_102 = type { float, float }
-
-declare %struct.S_102 @f_102() nounwind
-
-@callthis = external global void ()* ; <void ()**> [#uses=50]
-
-
-define void @foo() {
- store void ()* bitcast (%struct.S_102 ()* @f_102 to void ()*), void ()** @callthis, align 8
- ret void
-}
diff --git a/release_23/test/Assembler/dg.exp b/release_23/test/Assembler/dg.exp
deleted file mode 100644
index 879685ca879d..000000000000
--- a/release_23/test/Assembler/dg.exp
+++ /dev/null
@@ -1,3 +0,0 @@
-load_lib llvm.exp
-
-RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
diff --git a/release_23/test/Assembler/select.ll b/release_23/test/Assembler/select.ll
deleted file mode 100644
index f204c9505067..000000000000
--- a/release_23/test/Assembler/select.ll
+++ /dev/null
@@ -1,9 +0,0 @@
-; RUN: llvm-as < %s -o /dev/null -f
-
-
-define i32 @test(i1 %C, i32 %V1, i32 %V2) {
- %X = select i1 true, i1 false, i1 true ; <i1> [#uses=1]
- %V = select i1 %X, i32 %V1, i32 %V2 ; <i32> [#uses=1]
- ret i32 %V
-}
-
diff --git a/release_23/test/Bindings/Ocaml/analysis.ml b/release_23/test/Bindings/Ocaml/analysis.ml
deleted file mode 100644
index 9c61295d455c..000000000000
--- a/release_23/test/Bindings/Ocaml/analysis.ml
+++ /dev/null
@@ -1,48 +0,0 @@
-(* RUN: %ocamlc -warn-error A llvm.cma llvm_analysis.cma %s -o %t
- * RUN: ./%t %t.bc
- *)
-
-open Llvm
-open Llvm_analysis
-
-(* Note that this takes a moment to link, so it's best to keep the number of
- individual tests low. *)
-
-let test x = if not x then exit 1 else ()
-
-let bomb msg =
- prerr_endline msg;
- exit 2
-
-let _ =
- let fty = function_type void_type [| |] in
- let m = create_module "valid_m" in
- let fn = define_function "valid_fn" fty m in
- let at_entry = builder_at_end (entry_block fn) in
- ignore (build_ret_void at_entry);
-
-
- (* Test that valid constructs verify. *)
- begin match verify_module m with
- Some msg -> bomb "valid module failed verification!"
- | None -> ()
- end;
-
- if not (verify_function fn) then bomb "valid function failed verification!";
-
-
- (* Test that invalid constructs do not verify.
- A basic block can contain only one terminator instruction. *)
- ignore (build_ret_void at_entry);
-
- begin match verify_module m with
- Some msg -> ()
- | None -> bomb "invalid module passed verification!"
- end;
-
- if verify_function fn then bomb "invalid function passed verification!";
-
-
- dispose_module m
-
- (* Don't bother to test assert_valid_{module,function}. *)
diff --git a/release_23/test/Bindings/Ocaml/bitreader.ml b/release_23/test/Bindings/Ocaml/bitreader.ml
deleted file mode 100644
index 59f036fe2dfe..000000000000
--- a/release_23/test/Bindings/Ocaml/bitreader.ml
+++ /dev/null
@@ -1,75 +0,0 @@
-(* RUN: %ocamlc -warn-error A llvm.cma llvm_bitreader.cma llvm_bitwriter.cma %s -o %t
- * RUN: ./%t %t.bc
- * RUN: llvm-dis < %t.bc | grep caml_int_ty
- *)
-
-(* Note that this takes a moment to link, so it's best to keep the number of
- individual tests low. *)
-
-let test x = if not x then exit 1 else ()
-
-let _ =
- let fn = Sys.argv.(1) in
- let m = Llvm.create_module "ocaml_test_module" in
-
- ignore (Llvm.define_type_name "caml_int_ty" Llvm.i32_type m);
-
- test (Llvm_bitwriter.write_bitcode_file m fn);
-
- Llvm.dispose_module m;
-
- (* parse_bitcode *)
- begin
- let mb = Llvm.MemoryBuffer.of_file fn in
- begin try
- let m = Llvm_bitreader.parse_bitcode mb in
- Llvm.dispose_module m
- with x ->
- Llvm.MemoryBuffer.dispose mb;
- raise x
- end
- end;
-
- (* MemoryBuffer.of_file *)
- test begin try
- let mb = Llvm.MemoryBuffer.of_file (fn ^ ".bogus") in
- Llvm.MemoryBuffer.dispose mb;
- false
- with Llvm.IoError _ ->
- true
- end;
-
- (* get_module_provider *)
- begin
- let mb = Llvm.MemoryBuffer.of_file fn in
- let mp = begin try
- Llvm_bitreader.get_module_provider mb
- with x ->
- Llvm.MemoryBuffer.dispose mb;
- raise x
- end in
- Llvm.ModuleProvider.dispose mp
- end;
-
- (* corrupt the bitcode *)
- let fn = fn ^ ".txt" in
- begin let oc = open_out fn in
- output_string oc "not a bitcode file\n";
- close_out oc
- end;
-
- (* test get_module_provider exceptions *)
- test begin
- try
- let mb = Llvm.MemoryBuffer.of_file fn in
- let mp = begin try
- Llvm_bitreader.get_module_provider mb
- with x ->
- Llvm.MemoryBuffer.dispose mb;
- raise x
- end in
- Llvm.ModuleProvider.dispose mp;
- false
- with Llvm_bitreader.Error _ ->
- true
- end
diff --git a/release_23/test/Bindings/Ocaml/bitwriter.ml b/release_23/test/Bindings/Ocaml/bitwriter.ml
deleted file mode 100644
index 93e8d00cea0e..000000000000
--- a/release_23/test/Bindings/Ocaml/bitwriter.ml
+++ /dev/null
@@ -1,16 +0,0 @@
-(* RUN: %ocamlc -warn-error A llvm.cma llvm_bitwriter.cma %s -o %t
- * RUN: ./%t %t.bc
- * RUN: llvm-dis < %t.bc | grep caml_int_ty
- *)
-
-(* Note that this takes a moment to link, so it's best to keep the number of
- individual tests low. *)
-
-let test x = if not x then exit 1 else ()
-
-let _ =
- let m = Llvm.create_module "ocaml_test_module" in
-
- ignore (Llvm.define_type_name "caml_int_ty" Llvm.i32_type m);
-
- test (Llvm_bitwriter.write_bitcode_file m Sys.argv.(1))
diff --git a/release_23/test/Bindings/Ocaml/executionengine.ml b/release_23/test/Bindings/Ocaml/executionengine.ml
deleted file mode 100644
index d238076a0654..000000000000
--- a/release_23/test/Bindings/Ocaml/executionengine.ml
+++ /dev/null
@@ -1,109 +0,0 @@
-(* RUN: %ocamlc -warn-error A llvm.cma llvm_target.cma llvm_executionengine.cma %s -o %t
- * RUN: ./%t %t.bc
- *)
-
-open Llvm
-open Llvm_executionengine
-open Llvm_target
-
-(* Note that this takes a moment to link, so it's best to keep the number of
- individual tests low. *)
-
-let bomb msg =
- prerr_endline msg;
- exit 2
-
-let define_main_fn m retval =
- let fn =
- let str_arr_type = pointer_type (pointer_type i8_type) in
- define_function "main" (function_type i32_type [| i32_type;
- str_arr_type;
- str_arr_type |]) m in
- let b = builder_at_end (entry_block fn) in
- ignore (build_ret (const_int i32_type retval) b);
- fn
-
-let define_plus m =
- let fn = define_function "plus" (function_type i32_type [| i32_type;
- i32_type |]) m in
- let b = builder_at_end (entry_block fn) in
- let add = build_add (param fn 0) (param fn 1) "sum" b in
- ignore (build_ret add b)
-
-let test_genericvalue () =
- let tu = (1, 2) in
- let ptrgv = GenericValue.of_pointer tu in
- assert (tu = GenericValue.as_pointer ptrgv);
-
- let fpgv = GenericValue.of_float double_type 2. in
- assert (2. = GenericValue.as_float double_type fpgv);
-
- let intgv = GenericValue.of_int i32_type 3 in
- assert (3 = GenericValue.as_int intgv);
-
- let i32gv = GenericValue.of_int32 i32_type (Int32.of_int 4) in
- assert ((Int32.of_int 4) = GenericValue.as_int32 i32gv);
-
- let nigv = GenericValue.of_nativeint i32_type (Nativeint.of_int 5) in
- assert ((Nativeint.of_int 5) = GenericValue.as_nativeint nigv);
-
- let i64gv = GenericValue.of_int64 i64_type (Int64.of_int 6) in
- assert ((Int64.of_int 6) = GenericValue.as_int64 i64gv)
-
-let test_executionengine () =
- (* create *)
- let m = create_module "test_module" in
- let main = define_main_fn m 42 in
-
- let m2 = create_module "test_module2" in
- define_plus m2;
-
- let ee = ExecutionEngine.create (ModuleProvider.create m) in
- let mp2 = ModuleProvider.create m2 in
- ExecutionEngine.add_module_provider mp2 ee;
-
- (* run_static_ctors *)
- ExecutionEngine.run_static_ctors ee;
-
- (* run_function_as_main *)
- let res = ExecutionEngine.run_function_as_main main [|"test"|] [||] ee in
- if 42 != res then bomb "main did not return 42";
-
- (* free_machine_code *)
- ExecutionEngine.free_machine_code main ee;
-
- (* find_function *)
- match ExecutionEngine.find_function "dne" ee with
- | Some _ -> raise (Failure "find_function 'dne' failed")
- | None ->
-
- match ExecutionEngine.find_function "plus" ee with
- | None -> raise (Failure "find_function 'plus' failed")
- | Some plus ->
-
- (* run_function *)
- let res = ExecutionEngine.run_function plus
- [| GenericValue.of_int i32_type 2;
- GenericValue.of_int i32_type 2 |]
- ee in
- if 4 != GenericValue.as_int res then bomb "plus did not work";
-
- (* remove_module_provider *)
- Llvm.dispose_module (ExecutionEngine.remove_module_provider mp2 ee);
-
- (* run_static_dtors *)
- ExecutionEngine.run_static_dtors ee;
-
- (* Show that the target data binding links and runs.*)
- let td = ExecutionEngine.target_data ee in
-
- (* Demonstrate that a garbage pointer wasn't returned. *)
- let ty = intptr_type td in
- if ty != i32_type && ty != i64_type then bomb "target_data did not work";
-
- (* dispose *)
- ExecutionEngine.dispose ee
-
-let _ =
- test_genericvalue ();
- test_executionengine ()
diff --git a/release_23/test/Bindings/Ocaml/ocaml.exp b/release_23/test/Bindings/Ocaml/ocaml.exp
deleted file mode 100644
index 5f8469536a4f..000000000000
--- a/release_23/test/Bindings/Ocaml/ocaml.exp
+++ /dev/null
@@ -1,3 +0,0 @@
-load_lib llvm.exp
-
-RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr,ml}]]
diff --git a/release_23/test/Bindings/Ocaml/scalar_opts.ml b/release_23/test/Bindings/Ocaml/scalar_opts.ml
deleted file mode 100644
index 7f850cbeb99f..000000000000
--- a/release_23/test/Bindings/Ocaml/scalar_opts.ml
+++ /dev/null
@@ -1,56 +0,0 @@
-(* RUN: %ocamlc -warn-error A llvm.cma llvm_scalar_opts.cma llvm_target.cma %s -o %t
- *)
-
-(* Note: It takes several seconds for ocamlc to link an executable with
- libLLVMCore.a, so it's better to write a big test than a bunch of
- little ones. *)
-
-open Llvm
-open Llvm_scalar_opts
-open Llvm_target
-
-
-(* Tiny unit test framework - really just to help find which line is busted *)
-let suite name f =
- prerr_endline (name ^ ":");
- f ()
-
-
-(*===-- Fixture -----------------------------------------------------------===*)
-
-let filename = Sys.argv.(1)
-let m = create_module filename
-let mp = ModuleProvider.create m
-
-
-(*===-- Transforms --------------------------------------------------------===*)
-
-let test_transforms () =
- let (++) x f = ignore (f x); x in
-
- let fty = function_type void_type [| |] in
- let fn = define_function "fn" fty m in
- ignore (build_ret_void (builder_at_end (entry_block fn)));
-
- let td = TargetData.create (target_triple m) in
-
- ignore (PassManager.create_function mp
- ++ TargetData.add td
- ++ add_instruction_combining
- ++ add_reassociation
- ++ add_gvn
- ++ add_cfg_simplification
- ++ add_constant_propagation
- ++ PassManager.initialize
- ++ PassManager.run_function fn
- ++ PassManager.finalize
- ++ PassManager.dispose);
-
- TargetData.dispose td
-
-
-(*===-- Driver ------------------------------------------------------------===*)
-
-let _ =
- suite "transforms" test_transforms;
- ModuleProvider.dispose mp
diff --git a/release_23/test/Bindings/Ocaml/target.ml b/release_23/test/Bindings/Ocaml/target.ml
deleted file mode 100644
index 2e83b318d8e3..000000000000
--- a/release_23/test/Bindings/Ocaml/target.ml
+++ /dev/null
@@ -1,51 +0,0 @@
-(* RUN: %ocamlc -warn-error A llvm.cma llvm_target.cma %s -o %t
- *)
-
-(* Note: It takes several seconds for ocamlc to link an executable with
- libLLVMCore.a, so it's better to write a big test than a bunch of
- little ones. *)
-
-open Llvm
-open Llvm_target
-
-
-(* Tiny unit test framework - really just to help find which line is busted *)
-let suite name f =
- prerr_endline (name ^ ":");
- f ()
-
-
-(*===-- Fixture -----------------------------------------------------------===*)
-
-let filename = Sys.argv.(1)
-let m = create_module filename
-
-
-(*===-- Target Data -------------------------------------------------------===*)
-
-let test_target_data () =
- let td = TargetData.create (target_triple m) in
- let sty = struct_type [| i32_type; i64_type |] in
-
- ignore (TargetData.as_string td);
- ignore (TargetData.invalidate_struct_layout td sty);
- ignore (byte_order td);
- ignore (pointer_size td);
- ignore (intptr_type td);
- ignore (size_in_bits td sty);
- ignore (store_size td sty);
- ignore (abi_size td sty);
- ignore (stack_align td sty);
- ignore (preferred_align td sty);
- ignore (preferred_align_of_global td (declare_global sty "g" m));
- ignore (element_at_offset td sty (Int64.of_int 1));
- ignore (offset_of_element td sty 1);
-
- TargetData.dispose td
-
-
-(*===-- Driver ------------------------------------------------------------===*)
-
-let _ =
- suite "target data" test_target_data;
- dispose_module m
diff --git a/release_23/test/Bindings/Ocaml/vmcore.ml b/release_23/test/Bindings/Ocaml/vmcore.ml
deleted file mode 100644
index 637ef3532c54..000000000000
--- a/release_23/test/Bindings/Ocaml/vmcore.ml
+++ /dev/null
@@ -1,1066 +0,0 @@
-(* RUN: %ocamlc -warn-error A llvm.cma llvm_analysis.cma llvm_bitwriter.cma %s -o %t
- * RUN: ./%t %t.bc
- * RUN: llvm-dis < %t.bc > %t.ll
- *)
-
-(* Note: It takes several seconds for ocamlc to link an executable with
- libLLVMCore.a, so it's better to write a big test than a bunch of
- little ones. *)
-
-open Llvm
-open Llvm_bitwriter
-
-
-(* Tiny unit test framework - really just to help find which line is busted *)
-let exit_status = ref 0
-let case_num = ref 0
-
-let group name =
- case_num := 0;
- prerr_endline (" " ^ name ^ "...")
-
-let insist cond =
- incr case_num;
- if not cond then exit_status := 10;
- prerr_endline (" " ^ (string_of_int !case_num) ^ if cond then ""
- else " FAIL")
-
-let suite name f =
- prerr_endline (name ^ ":");
- f ()
-
-
-(*===-- Fixture -----------------------------------------------------------===*)
-
-let filename = Sys.argv.(1)
-let m = create_module filename
-let mp = ModuleProvider.create m
-
-
-(*===-- Target ------------------------------------------------------------===*)
-
-let test_target () =
- begin group "triple";
- (* RUN: grep "i686-apple-darwin8" < %t.ll
- *)
- let trip = "i686-apple-darwin8" in
- set_target_triple trip m;
- insist (trip = target_triple m)
- end;
-
- begin group "layout";
- (* RUN: grep "bogus" < %t.ll
- *)
- let layout = "bogus" in
- set_data_layout layout m;
- insist (layout = data_layout m)
- end
-
-(*===-- Types -------------------------------------------------------------===*)
-
-let test_types () =
- (* RUN: grep {Ty01.*void} < %t.ll
- *)
- group "void";
- insist (define_type_name "Ty01" void_type m);
- insist (TypeKind.Void == classify_type void_type);
-
- (* RUN: grep {Ty02.*i1} < %t.ll
- *)
- group "i1";
- insist (define_type_name "Ty02" i1_type m);
- insist (TypeKind.Integer == classify_type i1_type);
-
- (* RUN: grep {Ty03.*i32} < %t.ll
- *)
- group "i32";
- insist (define_type_name "Ty03" i32_type m);
-
- (* RUN: grep {Ty04.*i42} < %t.ll
- *)
- group "i42";
- let ty = integer_type 42 in
- insist (define_type_name "Ty04" ty m);
-
- (* RUN: grep {Ty05.*float} < %t.ll
- *)
- group "float";
- insist (define_type_name "Ty05" float_type m);
- insist (TypeKind.Float == classify_type float_type);
-
- (* RUN: grep {Ty06.*double} < %t.ll
- *)
- group "double";
- insist (define_type_name "Ty06" double_type m);
- insist (TypeKind.Double == classify_type double_type);
-
- (* RUN: grep {Ty07.*i32.*i1, double} < %t.ll
- *)
- group "function";
- let ty = function_type i32_type [| i1_type; double_type |] in
- insist (define_type_name "Ty07" ty m);
- insist (TypeKind.Function = classify_type ty);
- insist (not (is_var_arg ty));
- insist (i32_type == return_type ty);
- insist (double_type == (param_types ty).(1));
-
- (* RUN: grep {Ty08.*\.\.\.} < %t.ll
- *)
- group "var arg function";
- let ty = var_arg_function_type void_type [| i32_type |] in
- insist (define_type_name "Ty08" ty m);
- insist (is_var_arg ty);
-
- (* RUN: grep {Ty09.*\\\[7 x i8\\\]} < %t.ll
- *)
- group "array";
- let ty = array_type i8_type 7 in
- insist (define_type_name "Ty09" ty m);
- insist (7 = array_length ty);
- insist (i8_type == element_type ty);
- insist (TypeKind.Array == classify_type ty);
-
- begin group "pointer";
- (* RUN: grep {UnqualPtrTy.*float\*} < %t.ll
- *)
- let ty = pointer_type float_type in
- insist (define_type_name "UnqualPtrTy" ty m);
- insist (float_type == element_type ty);
- insist (0 == address_space ty);
- insist (TypeKind.Pointer == classify_type ty)
- end;
-
- begin group "qualified_pointer";
- (* RUN: grep {QualPtrTy.*i8.*3.*\*} < %t.ll
- *)
- let ty = qualified_pointer_type i8_type 3 in
- insist (define_type_name "QualPtrTy" ty m);
- insist (i8_type == element_type ty);
- insist (3 == address_space ty)
- end;
-
- (* RUN: grep {Ty11.*\<4 x i16\>} < %t.ll
- *)
- group "vector";
- let ty = vector_type i16_type 4 in
- insist (define_type_name "Ty11" ty m);
- insist (i16_type == element_type ty);
- insist (4 = vector_size ty);
-
- (* RUN: grep {Ty12.*opaque} < %t.ll
- *)
- group "opaque";
- let ty = opaque_type () in
- insist (define_type_name "Ty12" ty m);
- insist (ty == ty);
- insist (ty <> opaque_type ());
-
- (* RUN: grep -v {Ty13} < %t.ll
- *)
- group "delete";
- let ty = opaque_type () in
- insist (define_type_name "Ty13" ty m);
- delete_type_name "Ty13" m;
-
- (* RUN: grep -v {RecursiveTy.*RecursiveTy} < %t.ll
- *)
- group "recursive";
- let ty = opaque_type () in
- let th = handle_to_type ty in
- refine_type ty (pointer_type ty);
- let ty = type_of_handle th in
- insist (define_type_name "RecursiveTy" ty m);
- insist (ty == element_type ty)
-
-
-(*===-- Constants ---------------------------------------------------------===*)
-
-let test_constants () =
- (* RUN: grep {Const01.*i32.*-1} < %t.ll
- *)
- group "int";
- let c = const_int i32_type (-1) in
- ignore (define_global "Const01" c m);
- insist (i32_type = type_of c);
- insist (is_constant c);
-
- (* RUN: grep {Const02.*i64.*-1} < %t.ll
- *)
- group "sext int";
- let c = const_int i64_type (-1) in
- ignore (define_global "Const02" c m);
- insist (i64_type = type_of c);
-
- (* RUN: grep {Const03.*i64.*4294967295} < %t.ll
- *)
- group "zext int64";
- let c = const_of_int64 i64_type (Int64.of_string "4294967295") false in
- ignore (define_global "Const03" c m);
- insist (i64_type = type_of c);
-
- (* RUN: grep {Const04.*"cruel\\\\00world"} < %t.ll
- *)
- group "string";
- let c = const_string "cruel\000world" in
- ignore (define_global "Const04" c m);
- insist ((array_type i8_type 11) = type_of c);
-
- (* RUN: grep {Const05.*"hi\\\\00again\\\\00"} < %t.ll
- *)
- group "stringz";
- let c = const_stringz "hi\000again" in
- ignore (define_global "Const05" c m);
- insist ((array_type i8_type 9) = type_of c);
-
- (* RUN: grep {ConstSingle.*2.75} < %t.ll
- * RUN: grep {ConstDouble.*3.1459} < %t.ll
- *)
- begin group "real";
- let cs = const_float float_type 2.75 in
- ignore (define_global "ConstSingle" cs m);
- insist (float_type = type_of cs);
-
- let cd = const_float double_type 3.1459 in
- ignore (define_global "ConstDouble" cd m);
- insist (double_type = type_of cd)
- end;
-
- let one = const_int i16_type 1 in
- let two = const_int i16_type 2 in
- let three = const_int i32_type 3 in
- let four = const_int i32_type 4 in
-
- (* RUN: grep {Const07.*\\\[ i32 3, i32 4 \\\]} < %t.ll
- *)
- group "array";
- let c = const_array i32_type [| three; four |] in
- ignore (define_global "Const07" c m);
- insist ((array_type i32_type 2) = (type_of c));
-
- (* RUN: grep {Const08.*< i16 1, i16 2.* >} < %t.ll
- *)
- group "vector";
- let c = const_vector [| one; two; one; two;
- one; two; one; two |] in
- ignore (define_global "Const08" c m);
- insist ((vector_type i16_type 8) = (type_of c));
-
- (* RUN: grep {Const09.*\{ i16, i16, i32, i32 \} \{} < %t.ll
- *)
- group "structure";
- let c = const_struct [| one; two; three; four |] in
- ignore (define_global "Const09" c m);
- insist ((struct_type [| i16_type; i16_type; i32_type; i32_type |])
- = (type_of c));
-
- (* RUN: grep {Const10.*zeroinit} < %t.ll
- *)
- group "null";
- let c = const_null (packed_struct_type [| i1_type; i8_type;
- i64_type; double_type |]) in
- ignore (define_global "Const10" c m);
-
- (* RUN: grep {Const11.*-1} < %t.ll
- *)
- group "all ones";
- let c = const_all_ones i64_type in
- ignore (define_global "Const11" c m);
-
- (* RUN: grep {Const12.*undef} < %t.ll
- *)
- group "undef";
- let c = undef i1_type in
- ignore (define_global "Const12" c m);
- insist (i1_type = type_of c);
- insist (is_undef c);
-
- group "constant arithmetic";
- (* RUN: grep {ConstNeg.*sub} < %t.ll
- * RUN: grep {ConstNot.*xor} < %t.ll
- * RUN: grep {ConstAdd.*add} < %t.ll
- * RUN: grep {ConstSub.*sub} < %t.ll
- * RUN: grep {ConstMul.*mul} < %t.ll
- * RUN: grep {ConstUDiv.*udiv} < %t.ll
- * RUN: grep {ConstSDiv.*sdiv} < %t.ll
- * RUN: grep {ConstFDiv.*fdiv} < %t.ll
- * RUN: grep {ConstURem.*urem} < %t.ll
- * RUN: grep {ConstSRem.*srem} < %t.ll
- * RUN: grep {ConstFRem.*frem} < %t.ll
- * RUN: grep {ConstAnd.*and} < %t.ll
- * RUN: grep {ConstOr.*or} < %t.ll
- * RUN: grep {ConstXor.*xor} < %t.ll
- * RUN: grep {ConstICmp.*icmp} < %t.ll
- * RUN: grep {ConstFCmp.*fcmp} < %t.ll
- *)
- let void_ptr = pointer_type i8_type in
- let five = const_int i64_type 5 in
- let ffive = const_uitofp five double_type in
- let foldbomb_gv = define_global "FoldBomb" (const_null i8_type) m in
- let foldbomb = const_ptrtoint foldbomb_gv i64_type in
- let ffoldbomb = const_uitofp foldbomb double_type in
- ignore (define_global "ConstNeg" (const_neg foldbomb) m);
- ignore (define_global "ConstNot" (const_not foldbomb) m);
- ignore (define_global "ConstAdd" (const_add foldbomb five) m);
- ignore (define_global "ConstSub" (const_sub foldbomb five) m);
- ignore (define_global "ConstMul" (const_mul foldbomb five) m);
- ignore (define_global "ConstUDiv" (const_udiv foldbomb five) m);
- ignore (define_global "ConstSDiv" (const_sdiv foldbomb five) m);
- ignore (define_global "ConstFDiv" (const_fdiv ffoldbomb ffive) m);
- ignore (define_global "ConstURem" (const_urem foldbomb five) m);
- ignore (define_global "ConstSRem" (const_srem foldbomb five) m);
- ignore (define_global "ConstFRem" (const_frem ffoldbomb ffive) m);
- ignore (define_global "ConstAnd" (const_and foldbomb five) m);
- ignore (define_global "ConstOr" (const_or foldbomb five) m);
- ignore (define_global "ConstXor" (const_xor foldbomb five) m);
- ignore (define_global "ConstICmp" (const_icmp Icmp.Sle foldbomb five) m);
- ignore (define_global "ConstFCmp" (const_fcmp Fcmp.Ole ffoldbomb ffive) m);
-
- group "constant casts";
- (* RUN: grep {ConstTrunc.*trunc} < %t.ll
- * RUN: grep {ConstSExt.*sext} < %t.ll
- * RUN: grep {ConstZExt.*zext} < %t.ll
- * RUN: grep {ConstFPTrunc.*fptrunc} < %t.ll
- * RUN: grep {ConstFPExt.*fpext} < %t.ll
- * RUN: grep {ConstUIToFP.*uitofp} < %t.ll
- * RUN: grep {ConstSIToFP.*sitofp} < %t.ll
- * RUN: grep {ConstFPToUI.*fptoui} < %t.ll
- * RUN: grep {ConstFPToSI.*fptosi} < %t.ll
- * RUN: grep {ConstPtrToInt.*ptrtoint} < %t.ll
- * RUN: grep {ConstIntToPtr.*inttoptr} < %t.ll
- * RUN: grep {ConstBitCast.*bitcast} < %t.ll
- *)
- let i128_type = integer_type 128 in
- ignore (define_global "ConstTrunc" (const_trunc (const_add foldbomb five)
- i8_type) m);
- ignore (define_global "ConstSExt" (const_sext foldbomb i128_type) m);
- ignore (define_global "ConstZExt" (const_zext foldbomb i128_type) m);
- ignore (define_global "ConstFPTrunc" (const_fptrunc ffoldbomb float_type) m);
- ignore (define_global "ConstFPExt" (const_fpext ffoldbomb fp128_type) m);
- ignore (define_global "ConstUIToFP" (const_uitofp foldbomb double_type) m);
- ignore (define_global "ConstSIToFP" (const_sitofp foldbomb double_type) m);
- ignore (define_global "ConstFPToUI" (const_fptoui ffoldbomb i32_type) m);
- ignore (define_global "ConstFPToSI" (const_fptosi ffoldbomb i32_type) m);
- ignore (define_global "ConstPtrToInt" (const_ptrtoint
- (const_gep (const_null (pointer_type i8_type))
- [| const_int i32_type 1 |])
- i32_type) m);
- ignore (define_global "ConstIntToPtr" (const_inttoptr (const_add foldbomb five)
- void_ptr) m);
- ignore (define_global "ConstBitCast" (const_bitcast ffoldbomb i64_type) m);
-
- group "misc constants";
- (* RUN: grep {ConstSizeOf.*getelementptr.*null} < %t.ll
- * RUN: grep {ConstGEP.*getelementptr} < %t.ll
- * RUN: grep {ConstSelect.*select} < %t.ll
- * RUN: grep {ConstExtractElement.*extractelement} < %t.ll
- * RUN: grep {ConstInsertElement.*insertelement} < %t.ll
- * RUN: grep {ConstShuffleVector.*shufflevector} < %t.ll
- *)
- ignore (define_global "ConstSizeOf" (size_of (pointer_type i8_type)) m);
- ignore (define_global "ConstGEP" (const_gep foldbomb_gv [| five |]) m);
- ignore (define_global "ConstSelect" (const_select
- (const_icmp Icmp.Sle foldbomb five)
- (const_int i8_type (-1))
- (const_int i8_type 0)) m);
- let zero = const_int i32_type 0 in
- let one = const_int i32_type 1 in
- ignore (define_global "ConstExtractElement" (const_extractelement
- (const_vector [| zero; one; zero; one |])
- (const_trunc foldbomb i32_type)) m);
- ignore (define_global "ConstInsertElement" (const_insertelement
- (const_vector [| zero; one; zero; one |])
- zero (const_trunc foldbomb i32_type)) m);
- ignore (define_global "ConstShuffleVector" (const_shufflevector
- (const_vector [| zero; one |])
- (const_vector [| one; zero |])
- (const_bitcast foldbomb (vector_type i32_type 2))) m)
-
-
-(*===-- Global Values -----------------------------------------------------===*)
-
-let test_global_values () =
- let (++) x f = f x; x in
- let zero32 = const_null i32_type in
-
- (* RUN: grep {GVal01} < %t.ll
- *)
- group "naming";
- let g = define_global "TEMPORARY" zero32 m in
- insist ("TEMPORARY" = value_name g);
- set_value_name "GVal01" g;
- insist ("GVal01" = value_name g);
-
- (* RUN: grep {GVal02.*linkonce} < %t.ll
- *)
- group "linkage";
- let g = define_global "GVal02" zero32 m ++
- set_linkage Linkage.Link_once in
- insist (Linkage.Link_once = linkage g);
-
- (* RUN: grep {GVal03.*Hanalei} < %t.ll
- *)
- group "section";
- let g = define_global "GVal03" zero32 m ++
- set_section "Hanalei" in
- insist ("Hanalei" = section g);
-
- (* RUN: grep {GVal04.*hidden} < %t.ll
- *)
- group "visibility";
- let g = define_global "GVal04" zero32 m ++
- set_visibility Visibility.Hidden in
- insist (Visibility.Hidden = visibility g);
-
- (* RUN: grep {GVal05.*align 128} < %t.ll
- *)
- group "alignment";
- let g = define_global "GVal05" zero32 m ++
- set_alignment 128 in
- insist (128 = alignment g)
-
-
-(*===-- Global Variables --------------------------------------------------===*)
-
-let test_global_variables () =
- let (++) x f = f x; x in
- let fourty_two32 = const_int i32_type 42 in
-
- (* RUN: grep {GVar01.*external} < %t.ll
- *)
- group "declarations";
- insist (None == lookup_global "GVar01" m);
- let g = declare_global i32_type "GVar01" m in
- insist (is_declaration g);
- insist (pointer_type float_type ==
- type_of (declare_global float_type "GVar01" m));
- insist (g == declare_global i32_type "GVar01" m);
- insist (match lookup_global "GVar01" m with Some x -> x = g
- | None -> false);
-
- (* RUN: grep {GVar02.*42} < %t.ll
- * RUN: grep {GVar03.*42} < %t.ll
- *)
- group "definitions";
- let g = define_global "GVar02" fourty_two32 m in
- let g2 = declare_global i32_type "GVar03" m ++
- set_initializer fourty_two32 in
- insist (not (is_declaration g));
- insist (not (is_declaration g2));
- insist ((global_initializer g) == (global_initializer g2));
-
- (* RUN: grep {GVar04.*thread_local} < %t.ll
- *)
- group "threadlocal";
- let g = define_global "GVar04" fourty_two32 m ++
- set_thread_local true in
- insist (is_thread_local g);
-
- (* RUN: grep -v {GVar05} < %t.ll
- *)
- group "delete";
- let g = define_global "GVar05" fourty_two32 m in
- delete_global g;
-
- (* RUN: grep -v {ConstGlobalVar.*constant} < %t.ll
- *)
- group "constant";
- let g = define_global "ConstGlobalVar" fourty_two32 m in
- insist (not (is_global_constant g));
- set_global_constant true g;
- insist (is_global_constant g);
-
- begin group "iteration";
- let m = create_module "temp" in
-
- insist (At_end m = global_begin m);
- insist (At_start m = global_end m);
-
- let g1 = declare_global i32_type "One" m in
- let g2 = declare_global i32_type "Two" m in
-
- insist (Before g1 = global_begin m);
- insist (Before g2 = global_succ g1);
- insist (At_end m = global_succ g2);
-
- insist (After g2 = global_end m);
- insist (After g1 = global_pred g2);
- insist (At_start m = global_pred g1);
-
- let lf s x = s ^ "->" ^ value_name x in
- insist ("->One->Two" = fold_left_globals lf "" m);
-
- let rf x s = value_name x ^ "<-" ^ s in
- insist ("One<-Two<-" = fold_right_globals rf m "");
-
- dispose_module m
- end
-
-
-(*===-- Functions ---------------------------------------------------------===*)
-
-let test_functions () =
- let ty = function_type i32_type [| i32_type; i64_type |] in
- let ty2 = function_type i8_type [| i8_type; i64_type |] in
-
- (* RUN: grep {declare i32 @Fn1\(i32, i64\)} < %t.ll
- *)
- begin group "declare";
- insist (None = lookup_function "Fn1" m);
- let fn = declare_function "Fn1" ty m in
- insist (pointer_type ty = type_of fn);
- insist (is_declaration fn);
- insist (0 = Array.length (basic_blocks fn));
- insist (pointer_type ty2 == type_of (declare_function "Fn1" ty2 m));
- insist (fn == declare_function "Fn1" ty m);
- insist (None <> lookup_function "Fn1" m);
- insist (match lookup_function "Fn1" m with Some x -> x = fn
- | None -> false);
- insist (m == global_parent fn)
- end;
-
- (* RUN: grep -v {Fn2} < %t.ll
- *)
- group "delete";
- let fn = declare_function "Fn2" ty m in
- delete_function fn;
-
- (* RUN: grep {define.*Fn3} < %t.ll
- *)
- group "define";
- let fn = define_function "Fn3" ty m in
- insist (not (is_declaration fn));
- insist (1 = Array.length (basic_blocks fn));
- ignore (build_unreachable (builder_at_end (entry_block fn)));
-
- (* RUN: grep {define.*Fn4.*Param1.*Param2} < %t.ll
- *)
- group "params";
- let fn = define_function "Fn4" ty m in
- let params = params fn in
- insist (2 = Array.length params);
- insist (params.(0) = param fn 0);
- insist (params.(1) = param fn 1);
- insist (i32_type = type_of params.(0));
- insist (i64_type = type_of params.(1));
- set_value_name "Param1" params.(0);
- set_value_name "Param2" params.(1);
- ignore (build_unreachable (builder_at_end (entry_block fn)));
-
- (* RUN: grep {fastcc.*Fn5} < %t.ll
- *)
- group "callconv";
- let fn = define_function "Fn5" ty m in
- insist (CallConv.c = function_call_conv fn);
- set_function_call_conv CallConv.fast fn;
- insist (CallConv.fast = function_call_conv fn);
- ignore (build_unreachable (builder_at_end (entry_block fn)));
-
- begin group "collector";
- (* RUN: grep {Fn6.*gc.*shadowstack} < %t.ll
- *)
- let fn = define_function "Fn6" ty m in
- insist (None = collector fn);
- set_collector (Some "ocaml") fn;
- insist (Some "ocaml" = collector fn);
- set_collector None fn;
- insist (None = collector fn);
- set_collector (Some "shadowstack") fn;
- ignore (build_unreachable (builder_at_end (entry_block fn)));
- end;
-
- begin group "iteration";
- let m = create_module "temp" in
-
- insist (At_end m = function_begin m);
- insist (At_start m = function_end m);
-
- let f1 = define_function "One" ty m in
- let f2 = define_function "Two" ty m in
-
- insist (Before f1 = function_begin m);
- insist (Before f2 = function_succ f1);
- insist (At_end m = function_succ f2);
-
- insist (After f2 = function_end m);
- insist (After f1 = function_pred f2);
- insist (At_start m = function_pred f1);
-
- let lf s x = s ^ "->" ^ value_name x in
- insist ("->One->Two" = fold_left_functions lf "" m);
-
- let rf x s = value_name x ^ "<-" ^ s in
- insist ("One<-Two<-" = fold_right_functions rf m "");
-
- dispose_module m
- end
-
-
-(*===-- Params ------------------------------------------------------------===*)
-
-let test_params () =
- begin group "iteration";
- let m = create_module "temp" in
-
- let vf = define_function "void" (function_type void_type [| |]) m in
-
- insist (At_end vf = param_begin vf);
- insist (At_start vf = param_end vf);
-
- let ty = function_type void_type [| i32_type; i32_type |] in
- let f = define_function "f" ty m in
- let p1 = param f 0 in
- let p2 = param f 1 in
- set_value_name "One" p1;
- set_value_name "Two" p2;
-
- insist (Before p1 = param_begin f);
- insist (Before p2 = param_succ p1);
- insist (At_end f = param_succ p2);
-
- insist (After p2 = param_end f);
- insist (After p1 = param_pred p2);
- insist (At_start f = param_pred p1);
-
- let lf s x = s ^ "->" ^ value_name x in
- insist ("->One->Two" = fold_left_params lf "" f);
-
- let rf x s = value_name x ^ "<-" ^ s in
- insist ("One<-Two<-" = fold_right_params rf f "");
-
- dispose_module m
- end
-
-
-(*===-- Basic Blocks ------------------------------------------------------===*)
-
-let test_basic_blocks () =
- let ty = function_type void_type [| |] in
-
- (* RUN: grep {Bb1} < %t.ll
- *)
- group "entry";
- let fn = declare_function "X" ty m in
- let bb = append_block "Bb1" fn in
- insist (bb = entry_block fn);
- ignore (build_unreachable (builder_at_end bb));
-
- (* RUN: grep -v Bb2 < %t.ll
- *)
- group "delete";
- let fn = declare_function "X2" ty m in
- let bb = append_block "Bb2" fn in
- delete_block bb;
-
- group "insert";
- let fn = declare_function "X3" ty m in
- let bbb = append_block "b" fn in
- let bba = insert_block "a" bbb in
- insist ([| bba; bbb |] = basic_blocks fn);
- ignore (build_unreachable (builder_at_end bba));
- ignore (build_unreachable (builder_at_end bbb));
-
- (* RUN: grep Bb3 < %t.ll
- *)
- group "name/value";
- let fn = define_function "X4" ty m in
- let bb = entry_block fn in
- ignore (build_unreachable (builder_at_end bb));
- let bbv = value_of_block bb in
- set_value_name "Bb3" bbv;
- insist ("Bb3" = value_name bbv);
-
- group "casts";
- let fn = define_function "X5" ty m in
- let bb = entry_block fn in
- ignore (build_unreachable (builder_at_end bb));
- insist (bb = block_of_value (value_of_block bb));
- insist (value_is_block (value_of_block bb));
- insist (not (value_is_block (const_null i32_type)));
-
- begin group "iteration";
- let m = create_module "temp" in
- let f = declare_function "Temp" (function_type i32_type [| |]) m in
-
- insist (At_end f = block_begin f);
- insist (At_start f = block_end f);
-
- let b1 = append_block "One" f in
- let b2 = append_block "Two" f in
-
- insist (Before b1 = block_begin f);
- insist (Before b2 = block_succ b1);
- insist (At_end f = block_succ b2);
-
- insist (After b2 = block_end f);
- insist (After b1 = block_pred b2);
- insist (At_start f = block_pred b1);
-
- let lf s x = s ^ "->" ^ value_name (value_of_block x) in
- insist ("->One->Two" = fold_left_blocks lf "" f);
-
- let rf x s = value_name (value_of_block x) ^ "<-" ^ s in
- insist ("One<-Two<-" = fold_right_blocks rf f "");
-
- dispose_module m
- end
-
-
-(*===-- Instructions ------------------------------------------------------===*)
-
-let test_instructions () =
- begin group "iteration";
- let m = create_module "temp" in
- let fty = function_type void_type [| i32_type; i32_type |] in
- let f = define_function "f" fty m in
- let bb = entry_block f in
- let b = builder_at (At_end bb) in
-
- insist (At_end bb = instr_begin bb);
- insist (At_start bb = instr_end bb);
-
- let i1 = build_add (param f 0) (param f 1) "One" b in
- let i2 = build_sub (param f 0) (param f 1) "Two" b in
-
- insist (Before i1 = instr_begin bb);
- insist (Before i2 = instr_succ i1);
- insist (At_end bb = instr_succ i2);
-
- insist (After i2 = instr_end bb);
- insist (After i1 = instr_pred i2);
- insist (At_start bb = instr_pred i1);
-
- let lf s x = s ^ "->" ^ value_name x in
- insist ("->One->Two" = fold_left_instrs lf "" bb);
-
- let rf x s = value_name x ^ "<-" ^ s in
- insist ("One<-Two<-" = fold_right_instrs rf bb "");
-
- dispose_module m
- end
-
-
-(*===-- Builder -----------------------------------------------------------===*)
-
-let test_builder () =
- let (++) x f = f x; x in
-
- begin group "parent";
- insist (try
- ignore (insertion_block (builder ()));
- false
- with Not_found ->
- true);
-
- let fty = function_type void_type [| i32_type |] in
- let fn = define_function "BuilderParent" fty m in
- let bb = entry_block fn in
- let b = builder_at_end bb in
- let p = param fn 0 in
- let sum = build_add p p "sum" b in
- ignore (build_ret_void b);
-
- insist (fn = block_parent bb);
- insist (fn = param_parent p);
- insist (bb = instr_parent sum);
- insist (bb = insertion_block b)
- end;
-
- group "ret void";
- begin
- (* RUN: grep {ret void} < %t.ll
- *)
- let fty = function_type void_type [| |] in
- let fn = declare_function "X6" fty m in
- let b = builder_at_end (append_block "Bb01" fn) in
- ignore (build_ret_void b)
- end;
-
- (* The rest of the tests will use one big function. *)
- let fty = function_type i32_type [| i32_type; i32_type |] in
- let fn = define_function "X7" fty m in
- let atentry = builder_at_end (entry_block fn) in
- let p1 = param fn 0 ++ set_value_name "P1" in
- let p2 = param fn 1 ++ set_value_name "P2" in
- let f1 = build_uitofp p1 float_type "F1" atentry in
- let f2 = build_uitofp p2 float_type "F2" atentry in
-
- let bb00 = append_block "Bb00" fn in
- ignore (build_unreachable (builder_at_end bb00));
-
- group "ret"; begin
- (* RUN: grep {ret.*P1} < %t.ll
- *)
- let ret = build_ret p1 atentry in
- position_before ret atentry
- end;
-
- group "br"; begin
- (* RUN: grep {br.*Bb02} < %t.ll
- *)
- let bb02 = append_block "Bb02" fn in
- let b = builder_at_end bb02 in
- ignore (build_br bb02 b)
- end;
-
- group "cond_br"; begin
- (* RUN: grep {br.*Inst01.*Bb03.*Bb00} < %t.ll
- *)
- let bb03 = append_block "Bb03" fn in
- let b = builder_at_end bb03 in
- let cond = build_trunc p1 i1_type "Inst01" b in
- ignore (build_cond_br cond bb03 bb00 b)
- end;
-
- (* TODO: Switch *)
-
- group "invoke"; begin
- (* RUN: grep {Inst02.*invoke.*P1.*P2} < %t.ll
- * RUN: grep {to.*Bb04.*unwind.*Bb00} < %t.ll
- *)
- let bb04 = append_block "Bb04" fn in
- let b = builder_at_end bb04 in
- ignore (build_invoke fn [| p1; p2 |] bb04 bb00 "Inst02" b)
- end;
-
- group "unwind"; begin
- (* RUN: grep {unwind} < %t.ll
- *)
- let bb05 = append_block "Bb05" fn in
- let b = builder_at_end bb05 in
- ignore (build_unwind b)
- end;
-
- group "unreachable"; begin
- (* RUN: grep {unreachable} < %t.ll
- *)
- let bb06 = append_block "Bb06" fn in
- let b = builder_at_end bb06 in
- ignore (build_unreachable b)
- end;
-
- group "arithmetic"; begin
- let bb07 = append_block "Bb07" fn in
- let b = builder_at_end bb07 in
-
- (* RUN: grep {Inst03.*add.*P1.*P2} < %t.ll
- * RUN: grep {Inst04.*sub.*P1.*Inst03} < %t.ll
- * RUN: grep {Inst05.*mul.*P1.*Inst04} < %t.ll
- * RUN: grep {Inst06.*udiv.*P1.*Inst05} < %t.ll
- * RUN: grep {Inst07.*sdiv.*P1.*Inst06} < %t.ll
- * RUN: grep {Inst08.*fdiv.*F1.*F2} < %t.ll
- * RUN: grep {Inst09.*urem.*P1.*Inst07} < %t.ll
- * RUN: grep {Inst10.*srem.*P1.*Inst09} < %t.ll
- * RUN: grep {Inst11.*frem.*F1.*Inst08} < %t.ll
- * RUN: grep {Inst12.*shl.*P1.*Inst10} < %t.ll
- * RUN: grep {Inst13.*lshr.*P1.*Inst12} < %t.ll
- * RUN: grep {Inst14.*ashr.*P1.*Inst13} < %t.ll
- * RUN: grep {Inst15.*and.*P1.*Inst14} < %t.ll
- * RUN: grep {Inst16.*or.*P1.*Inst15} < %t.ll
- * RUN: grep {Inst17.*xor.*P1.*Inst16} < %t.ll
- * RUN: grep {Inst18.*sub.*0.*Inst17} < %t.ll
- * RUN: grep {Inst19.*xor.*Inst18.*-1} < %t.ll
- *)
- let inst03 = build_add p1 p2 "Inst03" b in
- let inst04 = build_sub p1 inst03 "Inst04" b in
- let inst05 = build_mul p1 inst04 "Inst05" b in
- let inst06 = build_udiv p1 inst05 "Inst06" b in
- let inst07 = build_sdiv p1 inst06 "Inst07" b in
- let inst08 = build_fdiv f1 f2 "Inst08" b in
- let inst09 = build_urem p1 inst07 "Inst09" b in
- let inst10 = build_srem p1 inst09 "Inst10" b in
- ignore(build_frem f1 inst08 "Inst11" b);
- let inst12 = build_shl p1 inst10 "Inst12" b in
- let inst13 = build_lshr p1 inst12 "Inst13" b in
- let inst14 = build_ashr p1 inst13 "Inst14" b in
- let inst15 = build_and p1 inst14 "Inst15" b in
- let inst16 = build_or p1 inst15 "Inst16" b in
- let inst17 = build_xor p1 inst16 "Inst17" b in
- let inst18 = build_neg inst17 "Inst18" b in
- ignore (build_not inst18 "Inst19" b);
- ignore (build_unreachable b)
- end;
-
- group "memory"; begin
- let bb08 = append_block "Bb08" fn in
- let b = builder_at_end bb08 in
-
- (* RUN: grep {Inst20.*malloc.*i8 } < %t.ll
- * RUN: grep {Inst21.*malloc.*i8.*P1} < %t.ll
- * RUN: grep {Inst22.*alloca.*i32 } < %t.ll
- * RUN: grep {Inst23.*alloca.*i32.*P2} < %t.ll
- * RUN: grep {free.*Inst20} < %t.ll
- * RUN: grep {Inst25.*load.*Inst21} < %t.ll
- * RUN: grep {store.*P2.*Inst22} < %t.ll
- * RUN: grep {Inst27.*getelementptr.*Inst23.*P2} < %t.ll
- *)
- let inst20 = build_malloc i8_type "Inst20" b in
- let inst21 = build_array_malloc i8_type p1 "Inst21" b in
- let inst22 = build_alloca i32_type "Inst22" b in
- let inst23 = build_array_alloca i32_type p2 "Inst23" b in
- ignore(build_free inst20 b);
- ignore(build_load inst21 "Inst25" b);
- ignore(build_store p2 inst22 b);
- ignore(build_gep inst23 [| p2 |] "Inst27" b);
- ignore(build_unreachable b)
- end;
-
- group "casts"; begin
- let void_ptr = pointer_type i8_type in
-
- (* RUN: grep {Inst28.*trunc.*P1.*i8} < %t.ll
- * RUN: grep {Inst29.*zext.*Inst28.*i32} < %t.ll
- * RUN: grep {Inst30.*sext.*Inst29.*i64} < %t.ll
- * RUN: grep {Inst31.*uitofp.*Inst30.*float} < %t.ll
- * RUN: grep {Inst32.*sitofp.*Inst29.*double} < %t.ll
- * RUN: grep {Inst33.*fptoui.*Inst31.*i32} < %t.ll
- * RUN: grep {Inst34.*fptosi.*Inst32.*i64} < %t.ll
- * RUN: grep {Inst35.*fptrunc.*Inst32.*float} < %t.ll
- * RUN: grep {Inst36.*fpext.*Inst35.*double} < %t.ll
- * RUN: grep {Inst37.*inttoptr.*P1.*i8\*} < %t.ll
- * RUN: grep {Inst38.*ptrtoint.*Inst37.*i64} < %t.ll
- * RUN: grep {Inst39.*bitcast.*Inst38.*double} < %t.ll
- *)
- let inst28 = build_trunc p1 i8_type "Inst28" atentry in
- let inst29 = build_zext inst28 i32_type "Inst29" atentry in
- let inst30 = build_sext inst29 i64_type "Inst30" atentry in
- let inst31 = build_uitofp inst30 float_type "Inst31" atentry in
- let inst32 = build_sitofp inst29 double_type "Inst32" atentry in
- ignore(build_fptoui inst31 i32_type "Inst33" atentry);
- ignore(build_fptosi inst32 i64_type "Inst34" atentry);
- let inst35 = build_fptrunc inst32 float_type "Inst35" atentry in
- ignore(build_fpext inst35 double_type "Inst36" atentry);
- let inst37 = build_inttoptr p1 void_ptr "Inst37" atentry in
- let inst38 = build_ptrtoint inst37 i64_type "Inst38" atentry in
- ignore(build_bitcast inst38 double_type "Inst39" atentry)
- end;
-
- group "comparisons"; begin
- (* RUN: grep {Inst40.*icmp.*ne.*P1.*P2} < %t.ll
- * RUN: grep {Inst41.*icmp.*sle.*P2.*P1} < %t.ll
- * RUN: grep {Inst42.*fcmp.*false.*F1.*F2} < %t.ll
- * RUN: grep {Inst43.*fcmp.*true.*F2.*F1} < %t.ll
- *)
- ignore (build_icmp Icmp.Ne p1 p2 "Inst40" atentry);
- ignore (build_icmp Icmp.Sle p2 p1 "Inst41" atentry);
- ignore (build_fcmp Fcmp.False f1 f2 "Inst42" atentry);
- ignore (build_fcmp Fcmp.True f2 f1 "Inst43" atentry)
- end;
-
- group "miscellaneous"; begin
- (* RUN: grep {CallInst.*call.*P2.*P1} < %t.ll
- * RUN: grep {CallInst.*cc63} < %t.ll
- * RUN: grep {Inst47.*select.*Inst46.*P1.*P2} < %t.ll
- * RUN: grep {Inst48.*va_arg.*null.*i32} < %t.ll
- * RUN: grep {Inst49.*extractelement.*Vec1.*P2} < %t.ll
- * RUN: grep {Inst50.*insertelement.*Vec1.*P1.*P2} < %t.ll
- * RUN: grep {Inst51.*shufflevector.*Vec1.*Vec2.*1.*1.*0.*0} < %t.ll
- *)
- let ci = build_call fn [| p2; p1 |] "CallInst" atentry in
- insist (CallConv.c = instruction_call_conv ci);
- set_instruction_call_conv 63 ci;
- insist (63 = instruction_call_conv ci);
-
- let inst46 = build_icmp Icmp.Eq p1 p2 "Inst46" atentry in
- ignore (build_select inst46 p1 p2 "Inst47" atentry);
- ignore (build_va_arg
- (const_null (pointer_type (pointer_type i8_type)))
- i32_type "Inst48" atentry);
-
- (* Set up some vector vregs. *)
- let one = const_int i32_type 1 in
- let zero = const_int i32_type 0 in
- let t1 = const_vector [| one; zero; one; zero |] in
- let t2 = const_vector [| zero; one; zero; one |] in
- let t3 = const_vector [| one; one; zero; zero |] in
- let vec1 = build_insertelement t1 p1 p2 "Vec1" atentry in
- let vec2 = build_insertelement t2 p1 p2 "Vec2" atentry in
-
- ignore (build_extractelement vec1 p2 "Inst49" atentry);
- ignore (build_insertelement vec1 p1 p2 "Inst50" atentry);
- ignore (build_shufflevector vec1 vec2 t3 "Inst51" atentry);
- end;
-
- group "phi"; begin
- (* RUN: grep {PhiNode.*P1.*PhiBlock1.*P2.*PhiBlock2} < %t.ll
- *)
- let b1 = append_block "PhiBlock1" fn in
- let b2 = append_block "PhiBlock2" fn in
-
- let jb = append_block "PhiJoinBlock" fn in
- ignore (build_br jb (builder_at_end b1));
- ignore (build_br jb (builder_at_end b2));
- let at_jb = builder_at_end jb in
-
- let phi = build_phi [(p1, b1)] "PhiNode" at_jb in
- insist ([(p1, b1)] = incoming phi);
-
- add_incoming (p2, b2) phi;
- insist ([(p1, b1); (p2, b2)] = incoming phi);
-
- ignore (build_unreachable at_jb);
- end
-
-
-(*===-- Module Provider ---------------------------------------------------===*)
-
-let test_module_provider () =
- let m = create_module "test" in
- let mp = ModuleProvider.create m in
- ModuleProvider.dispose mp
-
-
-(*===-- Pass Managers -----------------------------------------------------===*)
-
-let test_pass_manager () =
- let (++) x f = ignore (f x); x in
-
- begin group "module pass manager";
- ignore (PassManager.create ()
- ++ PassManager.run_module m
- ++ PassManager.dispose)
- end;
-
- begin group "function pass manager";
- let fty = function_type void_type [| |] in
- let fn = define_function "FunctionPassManager" fty m in
- ignore (build_ret_void (builder_at_end (entry_block fn)));
-
- ignore (PassManager.create_function mp
- ++ PassManager.initialize
- ++ PassManager.run_function fn
- ++ PassManager.finalize
- ++ PassManager.dispose)
- end
-
-
-(*===-- Writer ------------------------------------------------------------===*)
-
-let test_writer () =
- group "valid";
- insist (match Llvm_analysis.verify_module m with
- | None -> true
- | Some msg -> prerr_string msg; false);
-
- group "writer";
- insist (write_bitcode_file m filename);
-
- ModuleProvider.dispose mp
-
-
-(*===-- Driver ------------------------------------------------------------===*)
-
-let _ =
- suite "target" test_target;
- suite "types" test_types;
- suite "constants" test_constants;
- suite "global values" test_global_values;
- suite "global variables" test_global_variables;
- suite "functions" test_functions;
- suite "params" test_params;
- suite "basic blocks" test_basic_blocks;
- suite "instructions" test_instructions;
- suite "builder" test_builder;
- suite "module provider" test_module_provider;
- suite "pass manager" test_pass_manager;
- suite "writer" test_writer; (* Keep this last; it disposes m. *)
- exit !exit_status
diff --git a/release_23/test/Bitcode/2006-12-11-Cast-ConstExpr.ll b/release_23/test/Bitcode/2006-12-11-Cast-ConstExpr.ll
deleted file mode 100644
index 6df8711fe708..000000000000
--- a/release_23/test/Bitcode/2006-12-11-Cast-ConstExpr.ll
+++ /dev/null
@@ -1,10 +0,0 @@
-; This test ensures that we get a bitcast constant expression in and out,
-; not a sitofp constant expression.
-; RUN: llvm-as < %s | llvm-dis | \
-; RUN: grep {bitcast (}
-
-@G = external global i32
-
-define float @tryit(i32 %A) {
- ret float bitcast( i32 ptrtoint (i32* @G to i32) to float)
-}
diff --git a/release_23/test/Bitcode/AutoUpgradeIntrinsics.ll b/release_23/test/Bitcode/AutoUpgradeIntrinsics.ll
deleted file mode 100644
index 5f9bcd56f192..000000000000
--- a/release_23/test/Bitcode/AutoUpgradeIntrinsics.ll
+++ /dev/null
@@ -1,10 +0,0 @@
-; This isn't really an assembly file. It just runs test on bitcode to ensure
-; it is auto-upgraded.
-; RUN: llvm-dis < %s.bc | not grep {i32 @llvm\\.ct}
-; RUN: llvm-dis < %s.bc | \
-; RUN: not grep {llvm\\.part\\.set\\.i\[0-9\]*\\.i\[0-9\]*\\.i\[0-9\]*}
-; RUN: llvm-dis < %s.bc | \
-; RUN: not grep {llvm\\.part\\.select\\.i\[0-9\]*\\.i\[0-9\]*}
-; RUN: llvm-dis < %s.bc | \
-; RUN: not grep {llvm\\.bswap\\.i\[0-9\]*\\.i\[0-9\]*}
-
diff --git a/release_23/test/Bitcode/AutoUpgradeIntrinsics.ll.bc b/release_23/test/Bitcode/AutoUpgradeIntrinsics.ll.bc
deleted file mode 100644
index 9de756ba6859..000000000000
--- a/release_23/test/Bitcode/AutoUpgradeIntrinsics.ll.bc
+++ /dev/null
Binary files differ
diff --git a/release_23/test/Bitcode/dg.exp b/release_23/test/Bitcode/dg.exp
deleted file mode 100644
index 879685ca879d..000000000000
--- a/release_23/test/Bitcode/dg.exp
+++ /dev/null
@@ -1,3 +0,0 @@
-load_lib llvm.exp
-
-RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
diff --git a/release_23/test/Bitcode/memcpy.ll b/release_23/test/Bitcode/memcpy.ll
deleted file mode 100644
index 13daeeb181c2..000000000000
--- a/release_23/test/Bitcode/memcpy.ll
+++ /dev/null
@@ -1,21 +0,0 @@
-; RUN: llvm-as < %s -o /dev/null -f
-
-define void @test(i32* %P, i32* %Q) {
-entry:
- %tmp.1 = bitcast i32* %P to i8* ; <i8*> [#uses=3]
- %tmp.3 = bitcast i32* %Q to i8* ; <i8*> [#uses=4]
- tail call void @llvm.memcpy.i32( i8* %tmp.1, i8* %tmp.3, i32 100000, i32 1 )
- tail call void @llvm.memcpy.i64( i8* %tmp.1, i8* %tmp.3, i64 100000, i32 1 )
- tail call void @llvm.memset.i32( i8* %tmp.3, i8 14, i32 10000, i32 0 )
- tail call void @llvm.memmove.i32( i8* %tmp.1, i8* %tmp.3, i32 123124, i32 1 )
- ret void
-}
-
-declare void @llvm.memcpy.i32(i8*, i8*, i32, i32)
-
-declare void @llvm.memcpy.i64(i8*, i8*, i64, i32)
-
-declare void @llvm.memset.i32(i8*, i8, i32, i32)
-
-declare void @llvm.memmove.i32(i8*, i8*, i32, i32)
-
diff --git a/release_23/test/Bitcode/sse2_movl_dq.ll b/release_23/test/Bitcode/sse2_movl_dq.ll
deleted file mode 100644
index 093d8213ed4a..000000000000
--- a/release_23/test/Bitcode/sse2_movl_dq.ll
+++ /dev/null
@@ -1,2 +0,0 @@
-; RUN: llvm-dis < %s.bc | not grep {i32 @llvm\\.movl.dq}
-; RUN: llvm-dis < %s.bc | grep shufflevector
diff --git a/release_23/test/Bitcode/sse2_movl_dq.ll.bc b/release_23/test/Bitcode/sse2_movl_dq.ll.bc
deleted file mode 100644
index 74d1826d2e1c..000000000000
--- a/release_23/test/Bitcode/sse2_movl_dq.ll.bc
+++ /dev/null
Binary files differ
diff --git a/release_23/test/BugPoint/crash-narrowfunctiontest.ll b/release_23/test/BugPoint/crash-narrowfunctiontest.ll
deleted file mode 100644
index ef0db8d980b6..000000000000
--- a/release_23/test/BugPoint/crash-narrowfunctiontest.ll
+++ /dev/null
@@ -1,12 +0,0 @@
-; Test that bugpoint can narrow down the testcase to the important function
-;
-; RUN: bugpoint %s -bugpoint-crashcalls
-
-define i32 @foo() { ret i32 1 }
-
-define i32 @test() {
- call i32 @test()
- ret i32 %1
-}
-
-define i32 @bar() { ret i32 2 }
diff --git a/release_23/test/BugPoint/dg.exp b/release_23/test/BugPoint/dg.exp
deleted file mode 100644
index de42dad163fd..000000000000
--- a/release_23/test/BugPoint/dg.exp
+++ /dev/null
@@ -1,3 +0,0 @@
-load_lib llvm.exp
-
-RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.ll]]
diff --git a/release_23/test/BugPoint/misopt-basictest.ll b/release_23/test/BugPoint/misopt-basictest.ll
deleted file mode 100644
index 6136e3e194f7..000000000000
--- a/release_23/test/BugPoint/misopt-basictest.ll
+++ /dev/null
@@ -1,10 +0,0 @@
-; RUN: bugpoint %s -dce -bugpoint-deletecalls -simplifycfg
-
-@.LC0 = internal global [13 x i8] c"Hello World\0A\00" ; <[13 x i8]*> [#uses=1]
-
-declare i32 @printf(i8*, ...)
-
-define i32 @main() {
- call i32 (i8*, ...)* @printf( i8* getelementptr ([13 x i8]* @.LC0, i64 0, i64 0) ) ; <i32>:1 [#uses=0]
- ret i32 0
-}
diff --git a/release_23/test/BugPoint/remove_arguments_test.ll b/release_23/test/BugPoint/remove_arguments_test.ll
deleted file mode 100644
index 4d2c60dc35c5..000000000000
--- a/release_23/test/BugPoint/remove_arguments_test.ll
+++ /dev/null
@@ -1,11 +0,0 @@
-; RUN: bugpoint %s -bugpoint-crashcalls
-
-; Test to make sure that arguments are removed from the function if they are
-; unnecessary.
-
-declare i32 @test2()
-
-define i32 @test(i32 %A, i32 %B, float %C) {
- call i32 @test2()
- ret i32 %1
-}
diff --git a/release_23/test/C++Frontend/2003-08-20-ExceptionFail.cpp b/release_23/test/C++Frontend/2003-08-20-ExceptionFail.cpp
deleted file mode 100644
index fd1c6ad4c2a5..000000000000
--- a/release_23/test/C++Frontend/2003-08-20-ExceptionFail.cpp
+++ /dev/null
@@ -1,12 +0,0 @@
-// RUN: %llvmgxx -S %s -o - | llvm-as -f -o /dev/null
-
-void foo();
-
-void bar() {
- struct local {
- ~local() { foo(); }
- } local_obj;
-
- foo();
-}
-
diff --git a/release_23/test/C++Frontend/2003-08-21-EmptyClass.cpp b/release_23/test/C++Frontend/2003-08-21-EmptyClass.cpp
deleted file mode 100644
index 2f90b3a10531..000000000000
--- a/release_23/test/C++Frontend/2003-08-21-EmptyClass.cpp
+++ /dev/null
@@ -1,9 +0,0 @@
-// RUN: %llvmgxx -S %s -o - | llvm-as -f -o /dev/null
-
-// This tests compilation of EMPTY_CLASS_EXPR's
-
-struct empty {};
-
-void foo(empty) {}
-
-void bar() { foo(empty()); }
diff --git a/release_23/test/C++Frontend/2003-08-24-Cleanup.cpp.tr b/release_23/test/C++Frontend/2003-08-24-Cleanup.cpp.tr
deleted file mode 100644
index ab0d1a0d11cd..000000000000
--- a/release_23/test/C++Frontend/2003-08-24-Cleanup.cpp.tr
+++ /dev/null
@@ -1,10 +0,0 @@
-// RUN: %llvmgxx -xc++ %s -c -o - | llvm-dis | grep unwind
-
-struct S { ~S(); };
-
-int mightthrow();
-
-int test() {
- S s;
- mightthrow();
-}
diff --git a/release_23/test/C++Frontend/2003-08-27-TypeNamespaces.cpp b/release_23/test/C++Frontend/2003-08-27-TypeNamespaces.cpp
deleted file mode 100644
index cd7247e6085b..000000000000
--- a/release_23/test/C++Frontend/2003-08-27-TypeNamespaces.cpp
+++ /dev/null
@@ -1,16 +0,0 @@
-// RUN: %llvmgxx -S %s -o - | llvm-as -f -o /dev/null
-
-
-namespace foo {
- namespace bar {
- struct X { X(); };
-
- X::X() {}
- }
-}
-
-
-namespace {
- struct Y { Y(); };
- Y::Y() {}
-}
diff --git a/release_23/test/C++Frontend/2003-08-28-ForwardType.cpp b/release_23/test/C++Frontend/2003-08-28-ForwardType.cpp
deleted file mode 100644
index 38c4e2d84a07..000000000000
--- a/release_23/test/C++Frontend/2003-08-28-ForwardType.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-// RUN: %llvmgxx -S %s -o - | llvm-as -f -o /dev/null
-
-// Default placement versions of operator new.
-#include <new>
-
-void* operator new(size_t, void* __p) throw();
-
-
-template<typename _CharT>
-struct stdio_filebuf
-{ stdio_filebuf();
-
-};
-
-extern stdio_filebuf<char> buf_cout;
-
-void foo() {
- // Create stream buffers for the standard streams and use
- // those buffers without destroying and recreating the
- // streams.
- new (&buf_cout) stdio_filebuf<char>();
-
-}
diff --git a/release_23/test/C++Frontend/2003-08-28-SaveExprBug.cpp b/release_23/test/C++Frontend/2003-08-28-SaveExprBug.cpp
deleted file mode 100644
index 2be35d8d522d..000000000000
--- a/release_23/test/C++Frontend/2003-08-28-SaveExprBug.cpp
+++ /dev/null
@@ -1,24 +0,0 @@
-// RUN: %llvmgxx -S %s -o - | llvm-as -f -o /dev/null
-
-
-char* eback();
-
-template<typename foo>
-struct basic_filebuf {
- char *instancevar;
-
- void callee() {
- instancevar += eback() != eback();
- }
-
- void caller();
-};
-
-
-template<typename _CharT>
-void basic_filebuf<_CharT>::caller() {
- callee();
-}
-
-
-template class basic_filebuf<char>;
diff --git a/release_23/test/C++Frontend/2003-08-29-ArgPassingBug.cpp.tr b/release_23/test/C++Frontend/2003-08-29-ArgPassingBug.cpp.tr
deleted file mode 100644
index d4cddff3147c..000000000000
--- a/release_23/test/C++Frontend/2003-08-29-ArgPassingBug.cpp.tr
+++ /dev/null
@@ -1,13 +0,0 @@
-
-// RUN: %llvmgcc -xc++ -c -o /dev/null %s |& not grep WARNING
-
-struct iterator {
- iterator();
- iterator(const iterator &I);
-};
-
-iterator foo(const iterator &I) { return I; }
-
-void test() {
- foo(iterator());
-}
diff --git a/release_23/test/C++Frontend/2003-08-31-StructLayout.cpp b/release_23/test/C++Frontend/2003-08-31-StructLayout.cpp
deleted file mode 100644
index 99d668266220..000000000000
--- a/release_23/test/C++Frontend/2003-08-31-StructLayout.cpp
+++ /dev/null
@@ -1,16 +0,0 @@
-// RUN: %llvmgxx -S %s -o - | llvm-as -f -o /dev/null
-
-// There is a HOLE in the derived2 object due to not wanting to place the two
-// baseclass instances at the same offset!
-
-struct baseclass {};
-
-class derived1 : public baseclass {
- void * NodePtr;
-};
-
-class derived2 : public baseclass {
- derived1 current;
-};
-
-derived2 RI;
diff --git a/release_23/test/C++Frontend/2003-09-22-CompositeExprValue.cpp b/release_23/test/C++Frontend/2003-09-22-CompositeExprValue.cpp
deleted file mode 100644
index a8208adc5127..000000000000
--- a/release_23/test/C++Frontend/2003-09-22-CompositeExprValue.cpp
+++ /dev/null
@@ -1,11 +0,0 @@
-// RUN: %llvmgxx -S %s -o - | llvm-as -f -o /dev/null
-
-struct duration {
- duration operator/=(int c) {
- return *this;
- }
-};
-
-void a000090() {
- duration() /= 1;
-}
diff --git a/release_23/test/C++Frontend/2003-09-29-ArgumentNumberMismatch.cpp b/release_23/test/C++Frontend/2003-09-29-ArgumentNumberMismatch.cpp
deleted file mode 100644
index 4873123d1241..000000000000
--- a/release_23/test/C++Frontend/2003-09-29-ArgumentNumberMismatch.cpp
+++ /dev/null
@@ -1,17 +0,0 @@
-// RUN: %llvmgxx -S %s -o - | llvm-as -f -o /dev/null
-
-// Non-POD classes cannot be passed into a function by component, because their
-// dtors must be run. Instead, pass them in by reference. The C++ front-end
-// was mistakenly "thinking" that 'foo' took a structure by component.
-
-struct C {
- int A, B;
- ~C() {}
-};
-
-void foo(C b);
-
-void test(C *P) {
- foo(*P);
-}
-
diff --git a/release_23/test/C++Frontend/2003-09-30-CommaExprBug.cpp b/release_23/test/C++Frontend/2003-09-30-CommaExprBug.cpp
deleted file mode 100644
index afe470cd11b0..000000000000
--- a/release_23/test/C++Frontend/2003-09-30-CommaExprBug.cpp
+++ /dev/null
@@ -1,10 +0,0 @@
-// RUN: %llvmgxx -S %s -o - | llvm-as -f -o /dev/null
-
-class Empty {};
-
-void foo(Empty E);
-
-void bar() {
- foo(Empty());
-}
-
diff --git a/release_23/test/C++Frontend/2003-09-30-ForIncrementExprBug.cpp b/release_23/test/C++Frontend/2003-09-30-ForIncrementExprBug.cpp
deleted file mode 100644
index 40c9c87ae1e0..000000000000
--- a/release_23/test/C++Frontend/2003-09-30-ForIncrementExprBug.cpp
+++ /dev/null
@@ -1,10 +0,0 @@
-// RUN: %llvmgxx -S %s -o - | llvm-as -f -o /dev/null
-
-struct C {};
-
-C &foo();
-
-void foox() {
- for (; ; foo());
-}
-
diff --git a/release_23/test/C++Frontend/2003-09-30-ForIncrementExprBug2.cpp b/release_23/test/C++Frontend/2003-09-30-ForIncrementExprBug2.cpp
deleted file mode 100644
index e07eb425d286..000000000000
--- a/release_23/test/C++Frontend/2003-09-30-ForIncrementExprBug2.cpp
+++ /dev/null
@@ -1,12 +0,0 @@
-// RUN: %llvmgxx -S %s -o - | llvm-as -f -o /dev/null
-
-// Test with an opaque type
-
-struct C;
-
-C &foo();
-
-void foox() {
- for (; ; foo());
-}
-
diff --git a/release_23/test/C++Frontend/2003-09-30-NestedFunctionDecl.cpp b/release_23/test/C++Frontend/2003-09-30-NestedFunctionDecl.cpp
deleted file mode 100644
index b1c54b89d599..000000000000
--- a/release_23/test/C++Frontend/2003-09-30-NestedFunctionDecl.cpp
+++ /dev/null
@@ -1,12 +0,0 @@
-// RUN: %llvmgxx -S %s -o - | llvm-as -f -o /dev/null
-
-// The C++ front-end thinks the two foo's are different, the LLVM emitter
-// thinks they are the same. The disconnect causes problems.
-
-void foo() { }
-
-void bar() {
- void foo();
-
- foo();
-}
diff --git a/release_23/test/C++Frontend/2003-10-17-BoolBitfields.cpp b/release_23/test/C++Frontend/2003-10-17-BoolBitfields.cpp
deleted file mode 100644
index 547a367d34e6..000000000000
--- a/release_23/test/C++Frontend/2003-10-17-BoolBitfields.cpp
+++ /dev/null
@@ -1,11 +0,0 @@
-// RUN: %llvmgxx -S %s -o - | llvm-as -f -o /dev/null
-
-struct test {
- bool A : 1;
- bool B : 1;
-};
-
-void foo(test *T) {
- T->B = true;
-}
-
diff --git a/release_23/test/C++Frontend/2003-10-21-InnerClass.cpp.tr b/release_23/test/C++Frontend/2003-10-21-InnerClass.cpp.tr
deleted file mode 100644
index fadd51d22670..000000000000
--- a/release_23/test/C++Frontend/2003-10-21-InnerClass.cpp.tr
+++ /dev/null
@@ -1,12 +0,0 @@
-// RUN: %llvmgcc -xc++ -S -o - %s | grep {struct.X::Y}
-struct X {
-
- struct Y {
- Y();
- };
-
-};
-
-X::Y::Y() {
-
-}
diff --git a/release_23/test/C++Frontend/2003-10-27-VirtualBaseClassCrash.cpp b/release_23/test/C++Frontend/2003-10-27-VirtualBaseClassCrash.cpp
deleted file mode 100644
index f9fc80ee9407..000000000000
--- a/release_23/test/C++Frontend/2003-10-27-VirtualBaseClassCrash.cpp
+++ /dev/null
@@ -1,17 +0,0 @@
-// RUN: %llvmgxx -S %s -o - | llvm-as -f -o /dev/null
-
-
-template<class T>
-struct super {
- int Y;
- void foo();
-};
-
-template <class T>
-struct test : virtual super<int> {};
-
-extern test<int> X;
-
-void foo() {
- X.foo();
-}
diff --git a/release_23/test/C++Frontend/2003-11-02-WeakLinkage.cpp.tr b/release_23/test/C++Frontend/2003-11-02-WeakLinkage.cpp.tr
deleted file mode 100644
index 748ca6385be9..000000000000
--- a/release_23/test/C++Frontend/2003-11-02-WeakLinkage.cpp.tr
+++ /dev/null
@@ -1,13 +0,0 @@
-// RUN: %llvmgcc -xc++ -S -o - %s | not grep weak
-// The template should compile to linkonce linkage, not weak linkage.
-
-template<class T>
-void thefunc();
-
-template<class T>
-inline void thefunc() {}
-
-void test() {
- thefunc<int>();
-}
-
diff --git a/release_23/test/C++Frontend/2003-11-04-ArrayConstructors.cpp b/release_23/test/C++Frontend/2003-11-04-ArrayConstructors.cpp
deleted file mode 100644
index 4df4f9b6727b..000000000000
--- a/release_23/test/C++Frontend/2003-11-04-ArrayConstructors.cpp
+++ /dev/null
@@ -1,12 +0,0 @@
-// RUN: %llvmgxx -S %s -o - | llvm-as -f -o /dev/null
-
-
-struct Foo {
- Foo(int);
- ~Foo();
-};
-void foo() {
- struct {
- Foo name;
- } Int[] = { 1 };
-}
diff --git a/release_23/test/C++Frontend/2003-11-04-CatchLabelName.cpp b/release_23/test/C++Frontend/2003-11-04-CatchLabelName.cpp
deleted file mode 100644
index 8acf88ddbaf3..000000000000
--- a/release_23/test/C++Frontend/2003-11-04-CatchLabelName.cpp
+++ /dev/null
@@ -1,11 +0,0 @@
-// RUN: %llvmgxx -S %s -o - | llvm-as -f -o /dev/null
-
-#include <string>
-
-void bar();
-
-void test() {
- try {
- bar();
- } catch (std::string) {}
-}
diff --git a/release_23/test/C++Frontend/2003-11-08-ArrayAddress.cpp.tr b/release_23/test/C++Frontend/2003-11-08-ArrayAddress.cpp.tr
deleted file mode 100644
index 9ad1b8f82f72..000000000000
--- a/release_23/test/C++Frontend/2003-11-08-ArrayAddress.cpp.tr
+++ /dev/null
@@ -1,10 +0,0 @@
-// RUN: %llvmgxx -xc++ %s -c -o - | llvm-dis | grep getelementptr
-
-struct foo {
- int array[100];
- void *getAddr(unsigned i);
-};
-
-void *foo::getAddr(unsigned i) {
- return &array[i];
-}
diff --git a/release_23/test/C++Frontend/2003-11-09-ConstructorTypeSafety.cpp.tr b/release_23/test/C++Frontend/2003-11-09-ConstructorTypeSafety.cpp.tr
deleted file mode 100644
index e6c09e5bfe14..000000000000
--- a/release_23/test/C++Frontend/2003-11-09-ConstructorTypeSafety.cpp.tr
+++ /dev/null
@@ -1,21 +0,0 @@
-// The code generated for this testcase should be completely typesafe!
-// RUN: %llvmgcc -xc++ -S -o - %s | llvm-as | opt -die | llvm-dis | \
-// RUN: notcast
-
-struct contained {
- unsigned X;
- contained();
-};
-
-struct base {
- unsigned A, B;
-};
-
-struct derived : public base {
- contained _M_value_field;
-};
-
-int test() {
- derived X;
-}
-
diff --git a/release_23/test/C++Frontend/2003-11-18-EnumArray.cpp b/release_23/test/C++Frontend/2003-11-18-EnumArray.cpp
deleted file mode 100644
index 6eaf9d66f2dc..000000000000
--- a/release_23/test/C++Frontend/2003-11-18-EnumArray.cpp
+++ /dev/null
@@ -1,14 +0,0 @@
-// RUN: %llvmgxx -S %s -o - | llvm-as -f -o /dev/null
-
-enum TchkType {
- tchkNum, tchkString, tchkSCN, tchkNone
-};
-
-struct Operator {
- enum TchkType tchk[8];
-};
-
-struct Operator opTab[] = {
- {{tchkNum, tchkNum, tchkString} }
-};
-
diff --git a/release_23/test/C++Frontend/2003-11-18-MemberInitializationCasting.cpp.tr b/release_23/test/C++Frontend/2003-11-18-MemberInitializationCasting.cpp.tr
deleted file mode 100644
index cb66ba1127db..000000000000
--- a/release_23/test/C++Frontend/2003-11-18-MemberInitializationCasting.cpp.tr
+++ /dev/null
@@ -1,13 +0,0 @@
-// RUN: %llvmgcc -xc++ -S -o - %s | llvm-as | opt -die | llvm-dis | notcast
-
-struct A {
- A() : i(0) {}
- int getI() {return i;}
- int i;
-};
-
-int f(int j)
-{
- A a;
- return j+a.getI();
-}
diff --git a/release_23/test/C++Frontend/2003-11-18-PtrMemConstantInitializer.cpp b/release_23/test/C++Frontend/2003-11-18-PtrMemConstantInitializer.cpp
deleted file mode 100644
index ae76a6c6379d..000000000000
--- a/release_23/test/C++Frontend/2003-11-18-PtrMemConstantInitializer.cpp
+++ /dev/null
@@ -1,14 +0,0 @@
-// RUN: %llvmgxx -S %s -o - | llvm-as -f -o /dev/null
-
-struct Gfx {
- void opMoveSetShowText();
-};
-
-struct Operator {
- void (Gfx::*func)();
-};
-
-Operator opTab[] = {
- {&Gfx::opMoveSetShowText},
-};
-
diff --git a/release_23/test/C++Frontend/2003-11-25-ReturningOpaqueByValue.cpp b/release_23/test/C++Frontend/2003-11-25-ReturningOpaqueByValue.cpp
deleted file mode 100644
index 83fe1b3e810c..000000000000
--- a/release_23/test/C++Frontend/2003-11-25-ReturningOpaqueByValue.cpp
+++ /dev/null
@@ -1,12 +0,0 @@
-// RUN: %llvmgxx -S %s -o - | llvm-as -f -o /dev/null
-
-#include <vector>
-std::vector<int> my_method ();
-
-int
-main ()
-{
- my_method ();
- return 0;
-}
-
diff --git a/release_23/test/C++Frontend/2003-11-27-MultipleInheritanceThunk.cpp b/release_23/test/C++Frontend/2003-11-27-MultipleInheritanceThunk.cpp
deleted file mode 100644
index 16026c34b51c..000000000000
--- a/release_23/test/C++Frontend/2003-11-27-MultipleInheritanceThunk.cpp
+++ /dev/null
@@ -1,28 +0,0 @@
-// RUN: %llvmgxx -S %s -o - | llvm-as -f -o /dev/null
-
-
-struct CallSite {
- int X;
-
- CallSite(const CallSite &CS);
-};
-
-struct AliasAnalysis {
- int TD;
-
- virtual int getModRefInfo(CallSite CS);
-};
-
-
-struct Pass {
- int X;
- virtual int foo();
-};
-
-struct AliasAnalysisCounter : public Pass, public AliasAnalysis {
- int getModRefInfo(CallSite CS) {
- return 0;
- }
-};
-
-AliasAnalysisCounter AAC;
diff --git a/release_23/test/C++Frontend/2003-11-29-DuplicatedCleanupTest.cpp b/release_23/test/C++Frontend/2003-11-29-DuplicatedCleanupTest.cpp
deleted file mode 100644
index 8131baafae7e..000000000000
--- a/release_23/test/C++Frontend/2003-11-29-DuplicatedCleanupTest.cpp
+++ /dev/null
@@ -1,41 +0,0 @@
-// RUN: %llvmgxx -S %s -o - | llvm-as -f -o /dev/null
-
-
-void doesntThrow() throw();
-struct F {
- ~F() { doesntThrow(); }
-};
-
-void atest() {
- F A;
-lab:
- F B;
- goto lab;
-}
-
-void test(int val) {
-label: {
- F A;
- F B;
- if (val == 0) goto label;
- if (val == 1) goto label;
-}
-}
-
-void test3(int val) {
-label: {
- F A;
- F B;
- if (val == 0) { doesntThrow(); goto label; }
- if (val == 1) { doesntThrow(); goto label; }
-}
-}
-
-void test4(int val) {
-label: {
- F A;
- F B;
- if (val == 0) { F C; goto label; }
- if (val == 1) { F D; goto label; }
-}
-}
diff --git a/release_23/test/C++Frontend/2003-12-08-ArrayOfPtrToMemberFunc.cpp b/release_23/test/C++Frontend/2003-12-08-ArrayOfPtrToMemberFunc.cpp
deleted file mode 100644
index d5122340225c..000000000000
--- a/release_23/test/C++Frontend/2003-12-08-ArrayOfPtrToMemberFunc.cpp
+++ /dev/null
@@ -1,12 +0,0 @@
-// RUN: %llvmgxx -S %s -o - | llvm-as -f -o /dev/null
-
-struct Evil {
- void fun ();
-};
-int foo();
-typedef void (Evil::*memfunptr) ();
-static memfunptr jumpTable[] = { &Evil::fun };
-
-void Evil::fun() {
- (this->*jumpTable[foo()]) ();
-}
diff --git a/release_23/test/C++Frontend/2004-01-11-DynamicInitializedConstant.cpp.tr b/release_23/test/C++Frontend/2004-01-11-DynamicInitializedConstant.cpp.tr
deleted file mode 100644
index 8ae15c9592b1..000000000000
--- a/release_23/test/C++Frontend/2004-01-11-DynamicInitializedConstant.cpp.tr
+++ /dev/null
@@ -1,6 +0,0 @@
-// RUN: %llvmgcc -xc++ -S -o - %s | not grep { constant }
-
-extern int X;
-const int Y = X;
-const int* foo() { return &Y; }
-
diff --git a/release_23/test/C++Frontend/2004-03-08-ReinterpretCastCopy.cpp b/release_23/test/C++Frontend/2004-03-08-ReinterpretCastCopy.cpp
deleted file mode 100644
index 755d7c7621f3..000000000000
--- a/release_23/test/C++Frontend/2004-03-08-ReinterpretCastCopy.cpp
+++ /dev/null
@@ -1,21 +0,0 @@
-// RUN: %llvmgxx -S %s -o - | llvm-as -f -o /dev/null
-
-struct A {
- virtual void Method() = 0;
-};
-
-struct B : public A {
- virtual void Method() { }
-};
-
-typedef void (A::*fn_type_a)(void);
-typedef void (B::*fn_type_b)(void);
-
-int main(int argc, char **argv)
-{
- fn_type_a f = reinterpret_cast<fn_type_a>(&B::Method);
- fn_type_b g = reinterpret_cast<fn_type_b>(f);
- B b;
- (b.*g)();
- return 0;
-}
diff --git a/release_23/test/C++Frontend/2004-03-09-UnmangledBuiltinMethods.cpp.tr b/release_23/test/C++Frontend/2004-03-09-UnmangledBuiltinMethods.cpp.tr
deleted file mode 100644
index b019e0c0ef3d..000000000000
--- a/release_23/test/C++Frontend/2004-03-09-UnmangledBuiltinMethods.cpp.tr
+++ /dev/null
@@ -1,8 +0,0 @@
-// RUN: %llvmgcc -xc++ -c -o - %s | llvm-dis | grep _ZN11AccessFlags6strlenEv
-
-struct AccessFlags {
- void strlen();
-};
-
-void AccessFlags::strlen() { }
-
diff --git a/release_23/test/C++Frontend/2004-03-15-CleanupsAndGotos.cpp b/release_23/test/C++Frontend/2004-03-15-CleanupsAndGotos.cpp
deleted file mode 100644
index 9bc70c84ab42..000000000000
--- a/release_23/test/C++Frontend/2004-03-15-CleanupsAndGotos.cpp
+++ /dev/null
@@ -1,14 +0,0 @@
-// RUN: %llvmgxx -S %s -o - | llvm-as -f -o /dev/null
-
-// Testcase from Bug 291
-
-struct X {
- ~X();
-};
-
-void foo() {
- X v;
-
-TryAgain:
- goto TryAgain;
-}
diff --git a/release_23/test/C++Frontend/2004-06-08-LateTemplateInstantiation.cpp b/release_23/test/C++Frontend/2004-06-08-LateTemplateInstantiation.cpp
deleted file mode 100644
index 16d8e5edf51e..000000000000
--- a/release_23/test/C++Frontend/2004-06-08-LateTemplateInstantiation.cpp
+++ /dev/null
@@ -1,19 +0,0 @@
-// RUN: %llvmgxx -S %s -o - | llvm-as -f -o /dev/null
-
-
-
-template<typename Ty>
-struct normal_iterator {
- int FIELD;
-};
-
-void foo(normal_iterator<int>);
-normal_iterator<int> baz();
-
-void bar() {
- foo(baz());
-}
-
-void *bar2() {
- return (void*)foo;
-}
diff --git a/release_23/test/C++Frontend/2004-09-27-CompilerCrash.cpp b/release_23/test/C++Frontend/2004-09-27-CompilerCrash.cpp
deleted file mode 100644
index f507c2391508..000000000000
--- a/release_23/test/C++Frontend/2004-09-27-CompilerCrash.cpp
+++ /dev/null
@@ -1,13 +0,0 @@
-// RUN: %llvmgxx -S %s -o - | llvm-as -f -o /dev/null
-
-struct Pass {} ;
-template<typename PassName>
-Pass *callDefaultCtor() { return new PassName(); }
-
-void foo(Pass *(*C)());
-
-#include <string>
-
-bool foo(std::string &X) {
- return X.empty();
-}
diff --git a/release_23/test/C++Frontend/2004-09-27-DidntEmitTemplate.cpp.tr b/release_23/test/C++Frontend/2004-09-27-DidntEmitTemplate.cpp.tr
deleted file mode 100644
index 706d541bee67..000000000000
--- a/release_23/test/C++Frontend/2004-09-27-DidntEmitTemplate.cpp.tr
+++ /dev/null
@@ -1,23 +0,0 @@
-// RUN: %llvmgxx -xc++ %s -c -o - | llvm-dis | grep callDefaultCtor | \
-// RUN: not grep declare
-
-// This is a testcase for LLVM PR445, which was a problem where the
-// instantiation of callDefaultCtor was not being emitted correctly.
-
-struct Pass {};
-
-template<typename PassName>
-Pass *callDefaultCtor() { return new Pass(); }
-
-void foo(Pass *(*C)());
-
-struct basic_string {
- bool empty() const { return true; }
-};
-
-
-bool foo2(basic_string &X) {
- return X.empty();
-}
-void baz() { foo(callDefaultCtor<Pass>); }
-
diff --git a/release_23/test/C++Frontend/2004-11-27-EmitsUnusedInlineFunctions.cpp b/release_23/test/C++Frontend/2004-11-27-EmitsUnusedInlineFunctions.cpp
deleted file mode 100644
index 794b7d7fd8b7..000000000000
--- a/release_23/test/C++Frontend/2004-11-27-EmitsUnusedInlineFunctions.cpp
+++ /dev/null
@@ -1,7 +0,0 @@
-// The C++ front-end was emitting WAY too many inline functions. This test
-// verifies that it does not emit the body of getchar, because it is not used.
-// This corresponds to PR459
-
-// RUN: %llvmgxx %s -S -o - | not grep {^i32 .getchar}
-
-#include <stdio.h>
diff --git a/release_23/test/C++Frontend/2004-11-27-ExceptionCleanupAssertion.cpp b/release_23/test/C++Frontend/2004-11-27-ExceptionCleanupAssertion.cpp
deleted file mode 100644
index f3d225e81a60..000000000000
--- a/release_23/test/C++Frontend/2004-11-27-ExceptionCleanupAssertion.cpp
+++ /dev/null
@@ -1,14 +0,0 @@
-// RUN: %llvmgxx %s -S -o /dev/null
-
-// This is PR421
-
-struct Strongbad {
- Strongbad(const char *str );
- ~Strongbad();
- operator const char *() const;
-};
-
-void TheCheat () {
- Strongbad foo(0);
- Strongbad dirs[] = { Strongbad(0) + 1};
-}
diff --git a/release_23/test/C++Frontend/2004-11-27-FriendDefaultArgCrash.cpp b/release_23/test/C++Frontend/2004-11-27-FriendDefaultArgCrash.cpp
deleted file mode 100644
index 731e72617b9e..000000000000
--- a/release_23/test/C++Frontend/2004-11-27-FriendDefaultArgCrash.cpp
+++ /dev/null
@@ -1,9 +0,0 @@
-// RUN: %llvmgxx %s -o /dev/null -S
-
-// PR447
-
-namespace nm {
- struct str {
- friend int foo(int arg = 0);
- };
-}
diff --git a/release_23/test/C++Frontend/2004-11-27-InlineAsmFunctionRedefinition.cpp b/release_23/test/C++Frontend/2004-11-27-InlineAsmFunctionRedefinition.cpp
deleted file mode 100644
index 42b223bc99cc..000000000000
--- a/release_23/test/C++Frontend/2004-11-27-InlineAsmFunctionRedefinition.cpp
+++ /dev/null
@@ -1,26 +0,0 @@
-// RUN: %llvmgxx %s -S -o /dev/null
-
-// PR397
-
-struct stat { };
-struct stat64 { };
-
-extern "C" {
-
-extern int lstat(const char *, struct stat *) __asm__("lstat64");
-extern int lstat64(const char *, struct stat64 *);
-
-extern int __lxstat(int, const char *, struct stat *) __asm__("__lxstat64");
-extern int __lxstat64(int, const char *, struct stat64 *);
-
-extern __inline__ int lstat(const char *path, struct stat *statbuf) {
- return __lxstat(3, path, statbuf);
-}
-extern __inline__ int lstat64(const char *path, struct stat64 *statbuf) {
- return __lxstat64(3, path, statbuf);
-}
-}
-
-int do_one_file(void) {
- return lstat(0, 0) + lstat64(0,0);
-}
diff --git a/release_23/test/C++Frontend/2005-01-03-StaticInitializers.cpp b/release_23/test/C++Frontend/2005-01-03-StaticInitializers.cpp
deleted file mode 100644
index da1b005cf4ab..000000000000
--- a/release_23/test/C++Frontend/2005-01-03-StaticInitializers.cpp
+++ /dev/null
@@ -1,8 +0,0 @@
-// RUN: %llvmgxx %s -S -o - | not grep llvm.global_ctor
-
-struct S {
- int A[2];
-};
-
-int XX = (int)(long)&(((struct S*)0)->A[1]);
-
diff --git a/release_23/test/C++Frontend/2005-02-11-AnonymousUnion.cpp b/release_23/test/C++Frontend/2005-02-11-AnonymousUnion.cpp
deleted file mode 100644
index b0ff7e750758..000000000000
--- a/release_23/test/C++Frontend/2005-02-11-AnonymousUnion.cpp
+++ /dev/null
@@ -1,32 +0,0 @@
-// RUN: %llvmgxx %s -S -o -
-
-// Test anonymous union with members of the same size.
-int test1(float F) {
- union {
- float G;
- int i;
- };
- G = F;
- return i;
-}
-
-// test anonymous union with members of differing size.
-int test2(short F) {
- volatile union {
- short G;
- int i;
- };
- G = F;
- return i;
-}
-
-// Make sure that normal unions work. duh :)
-volatile union {
- short S;
- int i;
-} U;
-
-int test3(short s) {
- U.S = s;
- return U.i;
-}
diff --git a/release_23/test/C++Frontend/2005-02-13-BadDynamicInit.cpp b/release_23/test/C++Frontend/2005-02-13-BadDynamicInit.cpp
deleted file mode 100644
index 84fa565f2406..000000000000
--- a/release_23/test/C++Frontend/2005-02-13-BadDynamicInit.cpp
+++ /dev/null
@@ -1,9 +0,0 @@
-// RUN: %llvmgxx %s -S -o - | not grep llvm.global_ctors
-// This testcase corresponds to PR509
-struct Data {
- unsigned *data;
- unsigned array[1];
-};
-
-Data shared_null = { shared_null.array };
-
diff --git a/release_23/test/C++Frontend/2005-02-14-BitFieldOffset.cpp b/release_23/test/C++Frontend/2005-02-14-BitFieldOffset.cpp
deleted file mode 100644
index 522e20a478df..000000000000
--- a/release_23/test/C++Frontend/2005-02-14-BitFieldOffset.cpp
+++ /dev/null
@@ -1,11 +0,0 @@
-// RUN: %llvmgxx %s -S -o - | not grep {i32 6}
-
-struct QVectorTypedData {
- int size;
- unsigned int sharable : 1;
- unsigned short array[1];
-};
-
-void foo(QVectorTypedData *X) {
- X->array[0] = 123;
-}
diff --git a/release_23/test/C++Frontend/2005-02-19-BitfieldStructCrash.cpp b/release_23/test/C++Frontend/2005-02-19-BitfieldStructCrash.cpp
deleted file mode 100644
index 8f571e074b8e..000000000000
--- a/release_23/test/C++Frontend/2005-02-19-BitfieldStructCrash.cpp
+++ /dev/null
@@ -1,14 +0,0 @@
-// RUN: %llvmgxx -S %s -o -
-
-struct QChar {unsigned short X; QChar(unsigned short); } ;
-
-struct Command {
- Command(QChar c) : c(c) {}
- unsigned int type : 4;
- QChar c;
- };
-
-Command X(QChar('c'));
-
-void Foo(QChar );
-void bar() { Foo(X.c); }
diff --git a/release_23/test/C++Frontend/2005-02-19-UnnamedVirtualThunkArgument.cpp b/release_23/test/C++Frontend/2005-02-19-UnnamedVirtualThunkArgument.cpp
deleted file mode 100644
index 853fee7dcf30..000000000000
--- a/release_23/test/C++Frontend/2005-02-19-UnnamedVirtualThunkArgument.cpp
+++ /dev/null
@@ -1,22 +0,0 @@
-// RUN: %llvmgxx -S %s -o /dev/null
-
-struct Foo {
- Foo();
- virtual ~Foo();
-};
-
-struct Bar {
- Bar();
- virtual ~Bar();
- virtual bool test(bool) const;
-};
-
-struct Baz : public Foo, public Bar {
- Baz();
- virtual ~Baz();
- virtual bool test(bool) const;
-};
-
-bool Baz::test(bool) const {
- return true;
-}
diff --git a/release_23/test/C++Frontend/2005-02-20-BrokenReferenceTest.cpp b/release_23/test/C++Frontend/2005-02-20-BrokenReferenceTest.cpp
deleted file mode 100644
index 31026d30e90c..000000000000
--- a/release_23/test/C++Frontend/2005-02-20-BrokenReferenceTest.cpp
+++ /dev/null
@@ -1,11 +0,0 @@
-// RUN: %llvmgxx %s -S -o /dev/null
-
-void test(unsigned char *b, int rb) {
- typedef unsigned char imgfoo[10][rb];
- imgfoo &br = *(imgfoo *)b;
-
- br[0][0] = 1;
-
- rb = br[0][0];
-}
-
diff --git a/release_23/test/C++Frontend/2005-02-27-PlacementArrayNewCrash.cpp b/release_23/test/C++Frontend/2005-02-27-PlacementArrayNewCrash.cpp
deleted file mode 100644
index a8fc6685ac4c..000000000000
--- a/release_23/test/C++Frontend/2005-02-27-PlacementArrayNewCrash.cpp
+++ /dev/null
@@ -1,8 +0,0 @@
-// RUN: %llvmgxx -S %s -o -
-
-#include <new>
-typedef double Ty[4];
-
-void foo(Ty *XX) {
- new(XX) Ty();
-}
diff --git a/release_23/test/C++Frontend/2005-07-21-VirtualBaseAccess.cpp b/release_23/test/C++Frontend/2005-07-21-VirtualBaseAccess.cpp
deleted file mode 100644
index 7711cff6d360..000000000000
--- a/release_23/test/C++Frontend/2005-07-21-VirtualBaseAccess.cpp
+++ /dev/null
@@ -1,14 +0,0 @@
-// RUN: %llvmgxx -xc++ %s -c -o - | opt -die | llvm-dis | not grep cast
-
-void foo(int*);
-
-struct FOO {
- int X;
-};
-
-struct BAR : virtual FOO { BAR(); };
-
-int testfn() {
- BAR B;
- foo(&B.X);
-}
diff --git a/release_23/test/C++Frontend/2006-03-01-GimplifyCrash.cpp b/release_23/test/C++Frontend/2006-03-01-GimplifyCrash.cpp
deleted file mode 100644
index b0d00fe17ddf..000000000000
--- a/release_23/test/C++Frontend/2006-03-01-GimplifyCrash.cpp
+++ /dev/null
@@ -1,14 +0,0 @@
-// RUN: %llvmgxx -S %s -o -
-
-struct PrefMapElem {
- virtual ~PrefMapElem();
- unsigned int fPrefId;
-};
-
-int foo() {
- PrefMapElem* fMap;
- if (fMap[0].fPrefId == 1)
- return 1;
-
- return 0;
-}
diff --git a/release_23/test/C++Frontend/2006-03-06-C++RecurseCrash.cpp b/release_23/test/C++Frontend/2006-03-06-C++RecurseCrash.cpp
deleted file mode 100644
index 2fb3fb7cdc25..000000000000
--- a/release_23/test/C++Frontend/2006-03-06-C++RecurseCrash.cpp
+++ /dev/null
@@ -1,24 +0,0 @@
-// RUN: %llvmgcc %s -S -o -
-namespace std {
- class exception { };
-
- class type_info {
- public:
- virtual ~type_info();
- };
-
-}
-
-namespace __cxxabiv1 {
- class __si_class_type_info : public std::type_info {
- ~__si_class_type_info();
- };
-}
-
-class recursive_init: public std::exception {
-public:
- virtual ~recursive_init() throw ();
-};
-
-recursive_init::~recursive_init() throw() { }
-
diff --git a/release_23/test/C++Frontend/2006-09-08-powi.cpp b/release_23/test/C++Frontend/2006-09-08-powi.cpp
deleted file mode 100644
index 75cbfda7cbc9..000000000000
--- a/release_23/test/C++Frontend/2006-09-08-powi.cpp
+++ /dev/null
@@ -1,7 +0,0 @@
-// RUN: %llvmgxx -O3 -S -o - %s
-
-#include <cmath>
-
-double foo(double X, int Y) {
- return std::pow(X, Y);
-}
diff --git a/release_23/test/C++Frontend/2006-09-12-OpaqueStructCrash.cpp b/release_23/test/C++Frontend/2006-09-12-OpaqueStructCrash.cpp
deleted file mode 100644
index f3160e84e2c2..000000000000
--- a/release_23/test/C++Frontend/2006-09-12-OpaqueStructCrash.cpp
+++ /dev/null
@@ -1,28 +0,0 @@
-// RUN: %llvmgxx -O3 -S -o - %s
-
-struct A {
- virtual ~A();
-};
-
-template <typename Ty>
-struct B : public A {
- ~B () { delete [] val; }
-private:
- Ty* val;
-};
-
-template <typename Ty>
-struct C : public A {
- C ();
- ~C ();
-};
-
-template <typename Ty>
-struct D : public A {
- D () {}
- private:
- B<C<Ty> > blocks;
-};
-
-template class D<double>;
-
diff --git a/release_23/test/C++Frontend/2006-09-27-Debug-Protection.cpp b/release_23/test/C++Frontend/2006-09-27-Debug-Protection.cpp
deleted file mode 100644
index d9a25aa70e73..000000000000
--- a/release_23/test/C++Frontend/2006-09-27-Debug-Protection.cpp
+++ /dev/null
@@ -1,13 +0,0 @@
-// RUN: %llvmgxx -O0 -emit-llvm -S -g -o - %s | grep {i32 1,}
-// RUN: %llvmgxx -O0 -emit-llvm -S -g -o - %s | grep {i32 2,}
-
-class A {
-public:
- int x;
-protected:
- int y;
-private:
- int z;
-};
-
-A a;
diff --git a/release_23/test/C++Frontend/2006-10-30-ClassBitfield.cpp b/release_23/test/C++Frontend/2006-10-30-ClassBitfield.cpp
deleted file mode 100644
index bd3b173cf8fd..000000000000
--- a/release_23/test/C++Frontend/2006-10-30-ClassBitfield.cpp
+++ /dev/null
@@ -1,16 +0,0 @@
-// RUN: %llvmgxx %s -emit-llvm -S -o -
-// PR954
-
-struct _Refcount_Base {
- unsigned long _M_ref_count;
- int _M_ref_count_lock;
- _Refcount_Base() : _M_ref_count(0) {}
-};
-
-struct _Rope_RopeRep : public _Refcount_Base
-{
-public:
- int _M_tag:8;
-};
-
-int foo(_Rope_RopeRep* r) { return r->_M_tag; }
diff --git a/release_23/test/C++Frontend/2006-11-06-StackTrace.cpp b/release_23/test/C++Frontend/2006-11-06-StackTrace.cpp
deleted file mode 100644
index 55b34ad82d52..000000000000
--- a/release_23/test/C++Frontend/2006-11-06-StackTrace.cpp
+++ /dev/null
@@ -1,36 +0,0 @@
-// This is a regression test on debug info to make sure that we can get a
-// meaningful stack trace from a C++ program.
-// RUN: %llvmgcc -S -O0 -g %s -o - | llvm-as | llc --disable-fp-elim -o %t.s -f
-// RUN: %compile_c %t.s -o %t.o
-// RUN: %link %t.o -o %t.exe
-// RUN: echo {break DeepStack::deepest\nrun 17\nwhere\n} > %t.in
-// RUN: gdb -q -batch -n -x %t.in %t.exe | tee %t.out | \
-// RUN: grep {#0 DeepStack::deepest.*(this=.*,.*x=33)}
-// RUN: gdb -q -batch -n -x %t.in %t.exe | \
-// RUN: grep {#7 0x.* in main.*(argc=\[12\],.*argv=.*)}
-
-// Only works on ppc, x86 and x86_64. Should generalize?
-// XFAIL: alpha|ia64|arm
-
-#include <stdlib.h>
-
-class DeepStack {
- int seedVal;
-public:
- DeepStack(int seed) : seedVal(seed) {}
-
- int shallowest( int x ) { return shallower(x + 1); }
- int shallower ( int x ) { return shallow(x + 2); }
- int shallow ( int x ) { return deep(x + 3); }
- int deep ( int x ) { return deeper(x + 4); }
- int deeper ( int x ) { return deepest(x + 6); }
- int deepest ( int x ) { return x + 7; }
-
- int runit() { return shallowest(seedVal); }
-};
-
-int main ( int argc, char** argv) {
-
- DeepStack DS9( (argc > 1 ? atoi(argv[1]) : 0) );
- return DS9.runit();
-}
diff --git a/release_23/test/C++Frontend/2006-11-20-GlobalSymbols.cpp b/release_23/test/C++Frontend/2006-11-20-GlobalSymbols.cpp
deleted file mode 100644
index fc896b330a4d..000000000000
--- a/release_23/test/C++Frontend/2006-11-20-GlobalSymbols.cpp
+++ /dev/null
@@ -1,10 +0,0 @@
-// PR1013
-// Check to make sure debug symbols use the correct name for globals and
-// functions. Will not assemble if it fails to.
-// RUN: %llvmgcc -O0 -g -c %s
-
-int foo __asm__("f\001oo");
-
-int bar() {
- return foo;
-}
diff --git a/release_23/test/C++Frontend/2006-11-30-ConstantExprCrash.cpp b/release_23/test/C++Frontend/2006-11-30-ConstantExprCrash.cpp
deleted file mode 100644
index 365c8e80fbf5..000000000000
--- a/release_23/test/C++Frontend/2006-11-30-ConstantExprCrash.cpp
+++ /dev/null
@@ -1,27 +0,0 @@
-// RUN: %llvmgxx %s -emit-llvm -S -o -
-// PR1027
-
-struct sys_var {
- unsigned name_length;
-
- bool no_support_one_shot;
- sys_var() {}
-};
-
-
-struct sys_var_thd : public sys_var {
-};
-
-extern sys_var_thd sys_auto_is_null;
-
-sys_var *getsys_variables() {
- return &sys_auto_is_null;
-}
-
-sys_var *sys_variables = &sys_auto_is_null;
-
-
-
-
-
-
diff --git a/release_23/test/C++Frontend/2006-11-30-NoCompileUnit.cpp b/release_23/test/C++Frontend/2006-11-30-NoCompileUnit.cpp
deleted file mode 100644
index c1fa9aed894f..000000000000
--- a/release_23/test/C++Frontend/2006-11-30-NoCompileUnit.cpp
+++ /dev/null
@@ -1,58 +0,0 @@
-// This is a regression test on debug info to make sure we don't hit a compile
-// unit size issue with gdb.
-// RUN: %llvmgcc -S -O0 -g %s -o - | llvm-as | \
-// RUN: llc --disable-fp-elim -o NoCompileUnit.s -f
-// RUN: %compile_c NoCompileUnit.s -o NoCompileUnit.o
-// RUN: %compile_cxx NoCompileUnit.o -o NoCompileUnit.exe
-// RUN: echo {break main\nrun\np NoCompileUnit::pubname} > %t2
-// RUN: gdb -q -batch -n -x %t2 NoCompileUnit.exe | \
-// RUN: tee NoCompileUnit.out | not grep {"low == high"}
-// XFAIL: alpha|ia64|arm
-
-
-class MamaDebugTest {
-private:
- int N;
-
-protected:
- MamaDebugTest(int n) : N(n) {}
-
- int getN() const { return N; }
-
-};
-
-class BabyDebugTest : public MamaDebugTest {
-private:
-
-public:
- BabyDebugTest(int n) : MamaDebugTest(n) {}
-
- static int doh;
-
- int doit() {
- int N = getN();
- int Table[N];
-
- int sum = 0;
-
- for (int i = 0; i < N; ++i) {
- int j = i;
- Table[i] = j;
- }
- for (int i = 0; i < N; ++i) {
- int j = Table[i];
- sum += j;
- }
-
- return sum;
- }
-
-};
-
-int BabyDebugTest::doh;
-
-
-int main(int argc, const char *argv[]) {
- BabyDebugTest BDT(20);
- return BDT.doit();
-}
diff --git a/release_23/test/C++Frontend/2006-11-30-Pubnames.cpp b/release_23/test/C++Frontend/2006-11-30-Pubnames.cpp
deleted file mode 100644
index c6165a6e354c..000000000000
--- a/release_23/test/C++Frontend/2006-11-30-Pubnames.cpp
+++ /dev/null
@@ -1,20 +0,0 @@
-// This is a regression test on debug info to make sure that we can access
-// qualified global names.
-// RUN: %llvmgcc -S -O0 -g %s -o - | llvm-as | \
-// RUN: llc --disable-fp-elim -o %t.s -f
-// RUN: %compile_c %t.s -o %t.o
-// RUN: %link %t.o -o %t.exe
-// RUN: echo {break main\nrun\np Pubnames::pubname} > %t.in
-// RUN: gdb -q -batch -n -x %t.in %t.exe | tee %t.out | grep {\$1 = 10}
-// XFAIL: alpha|ia64|arm
-
-struct Pubnames {
- static int pubname;
-};
-
-int Pubnames::pubname = 10;
-
-int main (int argc, char** argv) {
- Pubnames p;
- return 0;
-}
diff --git a/release_23/test/C++Frontend/2007-01-02-UnboundedArray.cpp b/release_23/test/C++Frontend/2007-01-02-UnboundedArray.cpp
deleted file mode 100644
index 648d19be62b8..000000000000
--- a/release_23/test/C++Frontend/2007-01-02-UnboundedArray.cpp
+++ /dev/null
@@ -1,14 +0,0 @@
-// Make sure unbounded arrays compile with debug information.
-//
-// RUN: %llvmgcc -O0 -c -g %s
-
-// PR1068
-
-struct Object {
- char buffer[];
-};
-
-int main(int argc, char** argv) {
- new Object;
- return 0;
-}
diff --git a/release_23/test/C++Frontend/2007-01-06-ELF-Thunk-Sections.cpp b/release_23/test/C++Frontend/2007-01-06-ELF-Thunk-Sections.cpp
deleted file mode 100644
index 654e11be1ffc..000000000000
--- a/release_23/test/C++Frontend/2007-01-06-ELF-Thunk-Sections.cpp
+++ /dev/null
@@ -1,49 +0,0 @@
-// RUN: %llvmgxx %s -emit-llvm -S -o - | not grep gnu.linkonce.
-// PR1085
-
-class
-__attribute__((visibility("default"))) QGenericArgument
-{
- public:inline QGenericArgument(const char *aName = 0, const void *aData = 0):_data(aData), _name(aName) {
- }
- private:const void *_data;
- const char *_name;
-};
-struct __attribute__ ((
- visibility("default"))) QMetaObject
-{
- struct {
- }
- d;
-};
-class
-__attribute__((visibility("default"))) QObject
-{
- virtual const QMetaObject *metaObject() const;
-};
-class
-__attribute__((visibility("default"))) QPaintDevice
-{
- public:enum PaintDeviceMetric {
- PdmWidth = 1, PdmHeight, PdmWidthMM, PdmHeightMM, PdmNumColors, PdmDepth, PdmDpiX, PdmDpiY, PdmPhysicalDpiX, PdmPhysicalDpiY
- };
- virtual ~ QPaintDevice();
- union {
- }
- ct;
-};
-class
-__attribute__((visibility("default"))) QWidget:public QObject, public QPaintDevice
-{
-};
-class
-__attribute__((visibility("default"))) QDialog:public QWidget
-{
-};
-class TopicChooser:public QDialog {
- virtual const QMetaObject *metaObject() const;
-};
-const QMetaObject *TopicChooser::
-metaObject() const
-{
-}
diff --git a/release_23/test/C++Frontend/2007-01-06-PtrMethodInit.cpp b/release_23/test/C++Frontend/2007-01-06-PtrMethodInit.cpp
deleted file mode 100644
index f87c8d888fce..000000000000
--- a/release_23/test/C++Frontend/2007-01-06-PtrMethodInit.cpp
+++ /dev/null
@@ -1,75 +0,0 @@
-// RUN: %llvmgxx %s -emit-llvm -S -o -
-// PR1084
-
-extern "C"
-{
- typedef unsigned char PRUint8;
- typedef unsigned int PRUint32;
-}
-typedef PRUint32 nsresult;
-struct nsID
-{
-};
-typedef nsID nsIID;
-class nsISupports
-{
-};
-extern "C++"
-{
- template < class T > struct nsCOMTypeInfo
- {
- static const nsIID & GetIID ()
- {
- }
- };
-}
-
-class nsIDOMEvent:public nsISupports
-{
-};
-class nsIDOMEventListener:public nsISupports
-{
-public:static const nsIID & GetIID ()
- {
- }
- virtual nsresult
- __attribute__ ((regparm (0), cdecl)) HandleEvent (nsIDOMEvent * event) =
- 0;
-};
-class nsIDOMMouseListener:public nsIDOMEventListener
-{
-public:static const nsIID & GetIID ()
- {
- static const nsIID iid = {
- };
- }
- virtual nsresult
- __attribute__ ((regparm (0),
- cdecl)) MouseDown (nsIDOMEvent * aMouseEvent) = 0;
-};
-typedef
-typeof (&nsIDOMEventListener::HandleEvent)
- GenericHandler;
- struct EventDispatchData
- {
- PRUint32 message;
- GenericHandler method;
- PRUint8 bits;
- };
- struct EventTypeData
- {
- const EventDispatchData *events;
- int numEvents;
- const nsIID *iid;
- };
- static const EventDispatchData sMouseEvents[] = {
- {
- (300 + 2),
- reinterpret_cast < GenericHandler > (&nsIDOMMouseListener::MouseDown),
- 0x01}
- };
-static const EventTypeData sEventTypes[] = {
- {
- sMouseEvents, (sizeof (sMouseEvents) / sizeof (sMouseEvents[0])),
- &nsCOMTypeInfo < nsIDOMMouseListener >::GetIID ()}
-};
diff --git a/release_23/test/C++Frontend/2007-03-27-FunctionVarRename.cpp b/release_23/test/C++Frontend/2007-03-27-FunctionVarRename.cpp
deleted file mode 100644
index 538d6df1813c..000000000000
--- a/release_23/test/C++Frontend/2007-03-27-FunctionVarRename.cpp
+++ /dev/null
@@ -1,17 +0,0 @@
-// RUN: %llvmgxx %s -emit-llvm -S -o - | not grep eprintf1
-// RUN: %llvmgxx %s -emit-llvm -S -o - | grep eprintf
-
-// Only one eprintf should exist in the output
-
-extern "C"
-void __eprintf();
-
-void foo() {
-
- __eprintf();
-}
-
-void *bar() {
- extern void *__eprintf;
- return &__eprintf;
-}
diff --git a/release_23/test/C++Frontend/2007-04-05-PackedBitFields-1.cpp b/release_23/test/C++Frontend/2007-04-05-PackedBitFields-1.cpp
deleted file mode 100644
index 4797baf2d8f5..000000000000
--- a/release_23/test/C++Frontend/2007-04-05-PackedBitFields-1.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-// RUN: %llvmgxx -S %s -o - | llvm-as -f -o /dev/null
-
-#ifdef PACKED
-#define P __attribute__((packed))
-#else
-#define P
-#endif
-
-struct P M_Packed {
- unsigned int l_Packed;
- unsigned short k_Packed : 6,
- i_Packed : 15,
- j_Packed : 11;
-
-};
-
-struct M_Packed sM_Packed;
-
-int testM_Packed (void) {
- struct M_Packed x;
- return (x.i_Packed != 0);
-}
-
diff --git a/release_23/test/C++Frontend/2007-04-05-PackedBitFieldsOverlap-2.cpp b/release_23/test/C++Frontend/2007-04-05-PackedBitFieldsOverlap-2.cpp
deleted file mode 100644
index 3ba5d7bd849e..000000000000
--- a/release_23/test/C++Frontend/2007-04-05-PackedBitFieldsOverlap-2.cpp
+++ /dev/null
@@ -1,24 +0,0 @@
-// RUN: %llvmgxx -S %s -o - | llvm-as -f -o /dev/null
-
-#ifdef PACKED
-#define P __attribute__((packed))
-#else
-#define P
-#endif
-
-struct P M_Packed {
- unsigned long sorted : 1;
- unsigned long from_array : 1;
- unsigned long mixed_encoding : 1;
- unsigned long encoding : 8;
- unsigned long count : 21;
-
-};
-
-struct M_Packed sM_Packed;
-
-int testM_Packed (void) {
- struct M_Packed x;
- return (x.count != 0);
-}
-
diff --git a/release_23/test/C++Frontend/2007-04-05-PackedBitFieldsOverlap.cpp b/release_23/test/C++Frontend/2007-04-05-PackedBitFieldsOverlap.cpp
deleted file mode 100644
index ad272c947d66..000000000000
--- a/release_23/test/C++Frontend/2007-04-05-PackedBitFieldsOverlap.cpp
+++ /dev/null
@@ -1,24 +0,0 @@
-// RUN: %llvmgxx -S %s -o - | llvm-as -f -o /dev/null
-
-
-#ifdef PACKED
-#define P __attribute__((packed))
-#else
-#define P
-#endif
-
-struct P M_Packed {
- unsigned int l_Packed;
- unsigned short k_Packed : 6,
- i_Packed : 15;
- char c;
-
-};
-
-struct M_Packed sM_Packed;
-
-int testM_Packed (void) {
- struct M_Packed x;
- return (x.i_Packed != 0);
-}
-
diff --git a/release_23/test/C++Frontend/2007-04-05-PackedBitFieldsSmall.cpp b/release_23/test/C++Frontend/2007-04-05-PackedBitFieldsSmall.cpp
deleted file mode 100644
index e7517dd74b90..000000000000
--- a/release_23/test/C++Frontend/2007-04-05-PackedBitFieldsSmall.cpp
+++ /dev/null
@@ -1,27 +0,0 @@
-// RUN: %llvmgxx -S %s -o - | llvm-as -f -o /dev/null
-
-
-#ifdef PACKED
-// This is an example where size of Packed struct is smaller then
-// the size of bit field type.
-#define P __attribute__((packed))
-#else
-#define P
-#endif
-
-struct P M_Packed {
- unsigned long long X:50;
- unsigned Y:2;
-};
-
-struct M_Packed sM_Packed;
-
-int testM_Packed (void) {
- struct M_Packed x;
- return (0 != x.Y);
-}
-
-int testM_Packed2 (void) {
- struct M_Packed x;
- return (0 != x.X);
-}
diff --git a/release_23/test/C++Frontend/2007-04-05-StructPackedFieldUnpacked.cpp b/release_23/test/C++Frontend/2007-04-05-StructPackedFieldUnpacked.cpp
deleted file mode 100644
index 52e247133769..000000000000
--- a/release_23/test/C++Frontend/2007-04-05-StructPackedFieldUnpacked.cpp
+++ /dev/null
@@ -1,25 +0,0 @@
-// RUN: %llvmgxx -S %s -o - | llvm-as -f -o /dev/null
-
-#ifdef PACKED
-#define P __attribute__((packed))
-#else
-#define P
-#endif
-
-struct UnPacked {
- int X;
- int Y;
-};
-
-struct P M_Packed {
- unsigned char A;
- struct UnPacked B;
-};
-
-struct M_Packed sM_Packed;
-
-int testM_Packed (void) {
- struct M_Packed x;
- return (x.B.Y != 0);
-}
-
diff --git a/release_23/test/C++Frontend/2007-04-10-PackedUnion.cpp b/release_23/test/C++Frontend/2007-04-10-PackedUnion.cpp
deleted file mode 100644
index b4b8894ae2cf..000000000000
--- a/release_23/test/C++Frontend/2007-04-10-PackedUnion.cpp
+++ /dev/null
@@ -1,41 +0,0 @@
-// RUN: %llvmgxx -S %s -o /dev/null
-extern "C" {
-
-#pragma pack(push, 2)
- typedef struct ABC* abc;
-
- struct ABCS {
- float red;
- float green;
- float blue;
- float alpha;
- };
-
- typedef void (*XYZ)();
-#pragma pack(pop)
-}
-
-
-union ABCU {
- ABCS color;
- XYZ bg;
-};
-
-struct AData {
- ABCU data;
-};
-
-class L {
- public:
- L() {}
- L(const L& other);
-
- private:
- AData fdata;
-};
-
-
-L::L(const L& other)
-{
- fdata = other.fdata;
-}
diff --git a/release_23/test/C++Frontend/2007-04-11-InlineStorageClassC++.cpp b/release_23/test/C++Frontend/2007-04-11-InlineStorageClassC++.cpp
deleted file mode 100644
index eabcd5732708..000000000000
--- a/release_23/test/C++Frontend/2007-04-11-InlineStorageClassC++.cpp
+++ /dev/null
@@ -1,44 +0,0 @@
-// RUN: %llvmgxx %s -S -emit-llvm -O0 -o - | grep define | \
-// RUN: grep xglobWeak | grep linkonce | count 1
-// RUN: %llvmgxx %s -S -emit-llvm -O0 -o - | grep define | \
-// RUN: grep xextWeak | grep linkonce | count 1
-// RUN: %llvmgxx %s -S -emit-llvm -O0 -o - | grep define | \
-// RUN: grep xWeaknoinline | grep weak | count 1
-// RUN: %llvmgxx %s -S -emit-llvm -O0 -o - | grep define | \
-// RUN: grep xWeakextnoinline | grep weak | count 1
-// RUN: %llvmgxx %s -S -emit-llvm -O0 -o - | grep define | \
-// RUN: grep xglobnoWeak | grep linkonce | count 1
-// RUN: %llvmgxx %s -S -emit-llvm -O0 -o - | grep define | \
-// RUN: grep xstatnoWeak | grep internal | count 1
-// RUN: %llvmgxx %s -S -emit-llvm -O0 -o - | grep define | \
-// RUN: grep xextnoWeak | grep linkonce | count 1
-inline int xglobWeak(int) __attribute__((weak));
-inline int xglobWeak (int i) {
- return i*2;
-}
-inline int xextWeak(int) __attribute__((weak));
-extern inline int xextWeak (int i) {
- return i*4;
-}
-int xWeaknoinline(int) __attribute__((weak));
-int xWeaknoinline(int i) {
- return i*8;
-}
-int xWeakextnoinline(int) __attribute__((weak));
-extern int xWeakextnoinline(int i) {
- return i*16;
-}
-inline int xglobnoWeak (int i) {
- return i*32;
-}
-static inline int xstatnoWeak (int i) {
- return i*64;
-}
-extern inline int xextnoWeak (int i) {
- return i*128;
-}
-int j(int y) {
- return xglobnoWeak(y)+xstatnoWeak(y)+xextnoWeak(y)+
- xglobWeak(y)+xextWeak(y)+
- xWeakextnoinline(y)+xWeaknoinline(y);
-}
diff --git a/release_23/test/C++Frontend/2007-04-14-FNoBuiltin.cpp b/release_23/test/C++Frontend/2007-04-14-FNoBuiltin.cpp
deleted file mode 100644
index 31e4528754e0..000000000000
--- a/release_23/test/C++Frontend/2007-04-14-FNoBuiltin.cpp
+++ /dev/null
@@ -1,7 +0,0 @@
-// RUN: %llvmgcc -S %s -O2 -fno-builtin -o - | grep call.*printf
-// Check that -fno-builtin is honored.
-
-extern "C" int printf(const char*, ...);
-void foo(const char *msg) {
- printf("%s\n",msg);
-}
diff --git a/release_23/test/C++Frontend/2007-04-31-TryCatch.cpp b/release_23/test/C++Frontend/2007-04-31-TryCatch.cpp
deleted file mode 100644
index 8b8254d76e76..000000000000
--- a/release_23/test/C++Frontend/2007-04-31-TryCatch.cpp
+++ /dev/null
@@ -1,12 +0,0 @@
-// RUN: %llvmgxx -S %s -o /dev/null
-
-#include <locale>
-
-namespace std
-{
- codecvt<char, char, mbstate_t>::
- codecvt(size_t __refs)
- : __codecvt_abstract_base<char, char, mbstate_t>(__refs),
- _M_c_locale_codecvt(_S_get_c_locale())
- { }
-}
diff --git a/release_23/test/C++Frontend/2007-05-03-VectorInit.cpp b/release_23/test/C++Frontend/2007-05-03-VectorInit.cpp
deleted file mode 100644
index b87f4d4665ca..000000000000
--- a/release_23/test/C++Frontend/2007-05-03-VectorInit.cpp
+++ /dev/null
@@ -1,17 +0,0 @@
-// RUN: %llvmgxx %s -S -emit-llvm -O0 -o -
-// PR1378
-
-typedef float v4sf __attribute__((vector_size(16)));
-
-typedef v4sf float4;
-
-static float4 splat4(float a)
-{
- float4 tmp = {a,a,a,a};
- return tmp;
-}
-
-float4 foo(float a)
-{
- return splat4(a);
-}
diff --git a/release_23/test/C++Frontend/2007-05-16-ReverseBitFieldCrash.cpp b/release_23/test/C++Frontend/2007-05-16-ReverseBitFieldCrash.cpp
deleted file mode 100644
index 8392c0b94a52..000000000000
--- a/release_23/test/C++Frontend/2007-05-16-ReverseBitFieldCrash.cpp
+++ /dev/null
@@ -1,24 +0,0 @@
-// RUN: %llvmgxx %s -emit-llvm -S -o -
-
-#pragma reverse_bitfields on
-typedef unsigned long UINT32;
-
-extern void abort(void);
-
-typedef struct TestStruct
-{
- long first: 15,
- second: 17;
-} TestStruct;
-
-int main (int argc, char * const argv[]) {
-
- TestStruct testStruct = {1, 0};
-
- UINT32 dw = *(UINT32 *)(&testStruct);
-
- if(!(dw & 0xFFFF))
- abort ();
-
- return 0;
-}
diff --git a/release_23/test/C++Frontend/2007-05-23-TryFinally.cpp b/release_23/test/C++Frontend/2007-05-23-TryFinally.cpp
deleted file mode 100644
index 38f0b021aba0..000000000000
--- a/release_23/test/C++Frontend/2007-05-23-TryFinally.cpp
+++ /dev/null
@@ -1,16 +0,0 @@
-// RUN: %llvmgxx %s -S -emit-llvm -O2 -o - | ignore grep _Unwind_Resume | \
-// RUN: wc -l | grep {\[23\]}
-
-struct One { };
-struct Two { };
-
-void handle_unexpected () {
- try
- {
- throw;
- }
- catch (One &)
- {
- throw Two ();
- }
-}
diff --git a/release_23/test/C++Frontend/2007-07-04-NestedCatches.cpp b/release_23/test/C++Frontend/2007-07-04-NestedCatches.cpp
deleted file mode 100644
index b10a5db754bd..000000000000
--- a/release_23/test/C++Frontend/2007-07-04-NestedCatches.cpp
+++ /dev/null
@@ -1,32 +0,0 @@
-// RUN: %llvmgxx %s -S -O2 -o - | \
-// RUN: ignore grep {eh\.selector.*One.*Two.*Three.*Four.*Five.*Six.*null} | \
-// RUN: wc -l | grep {\[01\]}
-
-extern void X(void);
-
-struct One {};
-struct Two {};
-struct Three {};
-struct Four {};
-struct Five {};
-struct Six {};
-
-static void A(void) throw ()
-{
- X();
-}
-
-static void B(void) throw (Two)
-{
- try { A(); } catch (One) {}
-}
-
-static void C(void) throw (Six, Five)
-{
- try { B(); } catch (Three) {} catch (Four) {}
-}
-
-int main ()
-{
- try { C(); } catch (...) {}
-}
diff --git a/release_23/test/C++Frontend/2007-07-29-RestrictPtrArg.cpp b/release_23/test/C++Frontend/2007-07-29-RestrictPtrArg.cpp
deleted file mode 100644
index d54dfbe57121..000000000000
--- a/release_23/test/C++Frontend/2007-07-29-RestrictPtrArg.cpp
+++ /dev/null
@@ -1,6 +0,0 @@
-// RUN: %llvmgxx -c -emit-llvm %s -o - | llvm-dis | grep noalias
-
-void foo(int * __restrict myptr1, int * myptr2) {
- myptr1[0] = 0;
- myptr2[0] = 0;
-}
diff --git a/release_23/test/C++Frontend/2007-07-29-RestrictRefArg.cpp b/release_23/test/C++Frontend/2007-07-29-RestrictRefArg.cpp
deleted file mode 100644
index 0c28e4d27a2b..000000000000
--- a/release_23/test/C++Frontend/2007-07-29-RestrictRefArg.cpp
+++ /dev/null
@@ -1,6 +0,0 @@
-// RUN: %llvmgxx -c -emit-llvm %s -o - | llvm-dis | grep noalias
-
-void foo(int & __restrict myptr1, int & myptr2) {
- myptr1 = 0;
- myptr2 = 0;
-}
diff --git a/release_23/test/C++Frontend/2007-08-01-RestrictMethod.cpp b/release_23/test/C++Frontend/2007-08-01-RestrictMethod.cpp
deleted file mode 100644
index b4922beab1b2..000000000000
--- a/release_23/test/C++Frontend/2007-08-01-RestrictMethod.cpp
+++ /dev/null
@@ -1,13 +0,0 @@
-// RUN: %llvmgxx -c -emit-llvm %s -o - | llvm-dis | grep noalias
-
-
-class foo {
- int member[4];
-
- void bar(int * a);
-
-};
-
-void foo::bar(int * a) __restrict {
- member[3] = *a;
-}
diff --git a/release_23/test/C++Frontend/2007-09-10-RecursiveTypeResolution.cpp b/release_23/test/C++Frontend/2007-09-10-RecursiveTypeResolution.cpp
deleted file mode 100644
index f81394409d4a..000000000000
--- a/release_23/test/C++Frontend/2007-09-10-RecursiveTypeResolution.cpp
+++ /dev/null
@@ -1,88 +0,0 @@
-// RUN: %llvmgxx -c -emit-llvm %s -o -
-// PR1634
-
-namespace Manta
-{
- class CallbackHandle
- {
- protected:virtual ~ CallbackHandle (void)
- {
- }
- };
-template < typename Data1 > class CallbackBase_1Data:public CallbackHandle
- {
- };
-}
-
-namespace __gnu_cxx
-{
- template < typename _Iterator, typename _Container >
- class __normal_iterator
- {
- _Iterator _M_current;
- };
-}
-
-namespace std
-{
- template < typename _Tp > struct allocator
- {
- typedef _Tp *pointer;
- };
- template < typename _InputIterator,
- typename _Tp > inline void find (_InputIterator __last,
- const _Tp & __val)
- {
- };
-}
-
-namespace Manta
-{
- template < typename _Tp, typename _Alloc> struct _Vector_base
- {
- struct _Vector_impl
- {
- _Tp *_M_start;
- };
- public:
- _Vector_impl _M_impl;
- };
- template < typename _Tp, typename _Alloc = std::allocator < _Tp > >
- class vector:protected _Vector_base < _Tp,_Alloc >
- {
- public:
- typedef __gnu_cxx::__normal_iterator < typename _Alloc::pointer,
- vector < _Tp, _Alloc > > iterator;
- iterator end ()
- {
- }
- };
- class MantaInterface
- {
- };
- class RTRT
- {
- virtual CallbackHandle *registerTerminationCallback (CallbackBase_1Data <
- MantaInterface * >*);
- virtual void unregisterCallback (CallbackHandle *);
- typedef vector < CallbackBase_1Data < int >*>PRCallbackMapType;
- PRCallbackMapType parallelPreRenderCallbacks;
- };
-}
-using namespace Manta;
-CallbackHandle *
-RTRT::registerTerminationCallback (CallbackBase_1Data < MantaInterface * >*cb)
-{
- return cb;
-}
-
-void
-RTRT::unregisterCallback (CallbackHandle * callback)
-{
- {
- typedef CallbackBase_1Data < int > callback_t;
- callback_t *cb = static_cast < callback_t * >(callback);
- find (parallelPreRenderCallbacks.end (), cb);
- }
-}
-
diff --git a/release_23/test/C++Frontend/2007-10-01-StructResize.cpp b/release_23/test/C++Frontend/2007-10-01-StructResize.cpp
deleted file mode 100644
index d37057a901a4..000000000000
--- a/release_23/test/C++Frontend/2007-10-01-StructResize.cpp
+++ /dev/null
@@ -1,14 +0,0 @@
-// RUN: %llvmgxx -c %s -o /dev/null
-
-#pragma pack(4)
-
-struct Bork {
- unsigned int f1 : 3;
- unsigned int f2 : 30;
-};
-
-int Foo(Bork *hdr) {
- hdr->f1 = 7;
- hdr->f2 = 927;
-}
-
diff --git a/release_23/test/C++Frontend/2008-01-11-BadWarning.cpp b/release_23/test/C++Frontend/2008-01-11-BadWarning.cpp
deleted file mode 100644
index 43f6a7173b0a..000000000000
--- a/release_23/test/C++Frontend/2008-01-11-BadWarning.cpp
+++ /dev/null
@@ -1,6 +0,0 @@
-// RUN: %llvmgcc -xc++ %s -S -o /dev/null |& not grep warning
-// rdar://5683899
-void** f(void **Buckets, unsigned NumBuckets) {
- return Buckets + NumBuckets;
-}
-
diff --git a/release_23/test/C++Frontend/2008-01-12-VecInit.cpp b/release_23/test/C++Frontend/2008-01-12-VecInit.cpp
deleted file mode 100644
index e21bbb9468c4..000000000000
--- a/release_23/test/C++Frontend/2008-01-12-VecInit.cpp
+++ /dev/null
@@ -1,6 +0,0 @@
-// RUN: %llvmgcc -xc++ %s -S -o -
-// rdar://5685492
-
-typedef int __attribute__((vector_size(16))) v;
-v vt = {1, 2, 3, 4};
-
diff --git a/release_23/test/C++Frontend/2008-02-13-sret.cpp b/release_23/test/C++Frontend/2008-02-13-sret.cpp
deleted file mode 100644
index 15bfa2ddabdc..000000000000
--- a/release_23/test/C++Frontend/2008-02-13-sret.cpp
+++ /dev/null
@@ -1,41 +0,0 @@
-// RUN: %llvmgxx -S -O1 -m32 -emit-llvm %s -o - | grep {store i32} | count 1
-
-// Test that all 8 bytes of ret in check242 are copied, and only 4 bytes of
-// ret in check93 are copied (the same LLVM struct is used for both).
-
-typedef __builtin_va_list va_list;
-typedef unsigned long size_t;
-void *memset(void *, int, size_t);
-
-struct S93 { __attribute__((aligned (8))) void * a; } ;
- extern struct S93 s93;
- struct S93 check93 () {
- struct S93 ret;
- memset (&ret, 0, sizeof (ret));
- ret.a = s93.a;
- return ret; }
-
-struct S242 { char * a;int b[1]; } ;
- extern struct S242 s242;
-
- struct S242 check242 () {
- struct S242 ret;
- memset (&ret, 0, sizeof (ret));
- ret.a = s242.a;
- ret.b[0] = s242.b[0];
- return ret; }
-
-void check93va (int z, ...) {
- struct S93 arg;
- va_list ap;
- __builtin_va_start(ap,z);
- arg = __builtin_va_arg(ap,struct S93);
- __builtin_va_end(ap); }
-
-void check242va (int z, ...) {
-struct S242 arg;
-va_list ap;
-__builtin_va_start(ap,z);
- arg = __builtin_va_arg(ap,struct S242);
- __builtin_va_end(ap); }
-
diff --git a/release_23/test/C++Frontend/2008-05-07-CrazyOffsetOf.cpp b/release_23/test/C++Frontend/2008-05-07-CrazyOffsetOf.cpp
deleted file mode 100644
index f1831976f4ec..000000000000
--- a/release_23/test/C++Frontend/2008-05-07-CrazyOffsetOf.cpp
+++ /dev/null
@@ -1,8 +0,0 @@
-// RUN: %llvmgxx -S %s -o -
-// rdar://5914926
-
-struct bork {
- struct bork *next_local;
- char * query;
-};
-int offset = (char *) &(((struct bork *) 0x10)->query) - (char *) 0x10;
diff --git a/release_23/test/C++Frontend/dg.exp b/release_23/test/C++Frontend/dg.exp
deleted file mode 100644
index d8e898993012..000000000000
--- a/release_23/test/C++Frontend/dg.exp
+++ /dev/null
@@ -1,5 +0,0 @@
-load_lib llvm.exp
-
-if [ llvm_gcc_supports c++ ] then {
- RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
-}
diff --git a/release_23/test/C++Frontend/ptr-to-method-devirt.cpp b/release_23/test/C++Frontend/ptr-to-method-devirt.cpp
deleted file mode 100644
index 358b801af556..000000000000
--- a/release_23/test/C++Frontend/ptr-to-method-devirt.cpp
+++ /dev/null
@@ -1,14 +0,0 @@
-// PR1602
-// RUN: %llvmgxx -c -emit-llvm %s -o - -O3 | llvm-dis | not grep ptrtoint
-// RUN: %llvmgxx -c -emit-llvm %s -o - -O3 | llvm-dis | grep getelementptr | count 1
-
-
-struct S { virtual void f(); };
-
-typedef void (S::*P)(void);
-
-const P p = &S::f;
-
-void g(S s) {
- (s.*p)();
- }
diff --git a/release_23/test/CFrontend/2002-01-23-LoadQISIReloadFailure.c b/release_23/test/CFrontend/2002-01-23-LoadQISIReloadFailure.c
deleted file mode 100644
index 258d3cc0e3dc..000000000000
--- a/release_23/test/CFrontend/2002-01-23-LoadQISIReloadFailure.c
+++ /dev/null
@@ -1,11 +0,0 @@
-// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
-
-/* Regression test. Just compile .c -> .ll to test */
-int foo(void) {
- unsigned char *pp;
- unsigned w_cnt;
-
- w_cnt += *pp;
-
- return w_cnt;
-}
diff --git a/release_23/test/CFrontend/2002-01-24-ComplexSpaceInType.c b/release_23/test/CFrontend/2002-01-24-ComplexSpaceInType.c
deleted file mode 100644
index 9559d5b37b79..000000000000
--- a/release_23/test/CFrontend/2002-01-24-ComplexSpaceInType.c
+++ /dev/null
@@ -1,11 +0,0 @@
-// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
-
-// This caused generation of the following type name:
-// %Array = uninitialized global [10 x %complex int]
-//
-// which caused problems because of the space int the complex int type
-//
-
-struct { int X, Y; } Array[10];
-
-void foo() {}
diff --git a/release_23/test/CFrontend/2002-01-24-HandleCallInsnSEGV.c b/release_23/test/CFrontend/2002-01-24-HandleCallInsnSEGV.c
deleted file mode 100644
index 09029fb945ef..000000000000
--- a/release_23/test/CFrontend/2002-01-24-HandleCallInsnSEGV.c
+++ /dev/null
@@ -1,9 +0,0 @@
-// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
-
-void *dlclose(void*);
-
-void ap_os_dso_unload(void *handle)
-{
- dlclose(handle);
- return; /* This return triggers the bug: Weird */
-}
diff --git a/release_23/test/CFrontend/2002-02-13-ConditionalInCall.c b/release_23/test/CFrontend/2002-02-13-ConditionalInCall.c
deleted file mode 100644
index 0dad6ff5c2f4..000000000000
--- a/release_23/test/CFrontend/2002-02-13-ConditionalInCall.c
+++ /dev/null
@@ -1,11 +0,0 @@
-// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
-
-/* Test problem where bad code was generated with a ?: statement was
- in a function call argument */
-
-void foo(int, double, float);
-
-void bar(int x) {
- foo(x, x ? 1.0 : 12.5, 1.0f);
-}
-
diff --git a/release_23/test/CFrontend/2002-02-13-ReloadProblem.c b/release_23/test/CFrontend/2002-02-13-ReloadProblem.c
deleted file mode 100644
index ab9b56da3e39..000000000000
--- a/release_23/test/CFrontend/2002-02-13-ReloadProblem.c
+++ /dev/null
@@ -1,18 +0,0 @@
-// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
-
-/* This triggered a problem in reload, fixed by disabling most of the
- * steps of compilation in GCC. Before this change, the code went through
- * the entire backend of GCC, even though it was unnecessary for LLVM output
- * now it is skipped entirely, and since reload doesn't run, it can't cause
- * a problem.
- */
-
-extern int tolower(int);
-
-const char *rangematch(const char *pattern, int test, int c) {
-
- if ((c <= test) | (tolower(c) <= tolower((unsigned char)test)))
- return 0;
-
- return pattern;
-}
diff --git a/release_23/test/CFrontend/2002-02-13-TypeVarNameCollision.c b/release_23/test/CFrontend/2002-02-13-TypeVarNameCollision.c
deleted file mode 100644
index ec334013ae01..000000000000
--- a/release_23/test/CFrontend/2002-02-13-TypeVarNameCollision.c
+++ /dev/null
@@ -1,16 +0,0 @@
-// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
-
-/* This testcase causes a symbol table collision. Type names and variable
- * names should be in distinct namespaces
- */
-
-typedef struct foo {
- int X, Y;
-} FOO;
-
-static FOO foo[100];
-
-int test() {
- return foo[4].Y;
-}
-
diff --git a/release_23/test/CFrontend/2002-02-13-UnnamedLocal.c b/release_23/test/CFrontend/2002-02-13-UnnamedLocal.c
deleted file mode 100644
index 6fdc7efdd3a3..000000000000
--- a/release_23/test/CFrontend/2002-02-13-UnnamedLocal.c
+++ /dev/null
@@ -1,21 +0,0 @@
-// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
-
-/* Testcase for a problem where GCC allocated xqic to a register,
- * and did not have a VAR_DECL that explained the stack slot to LLVM.
- * Now the LLVM code synthesizes a stack slot if one is presented that
- * has not been previously recognized. This is where alloca's named
- * 'local' come from now.
- */
-
-typedef struct {
- short x;
-} foostruct;
-
-int foo(foostruct ic);
-
-void test() {
- foostruct xqic;
- foo(xqic);
-}
-
-
diff --git a/release_23/test/CFrontend/2002-02-14-EntryNodePreds.c b/release_23/test/CFrontend/2002-02-14-EntryNodePreds.c
deleted file mode 100644
index f1e01515fd77..000000000000
--- a/release_23/test/CFrontend/2002-02-14-EntryNodePreds.c
+++ /dev/null
@@ -1,37 +0,0 @@
-// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
-
-/* GCC Used to generate code that contained a branch to the entry node of
- * the do_merge function. This is illegal LLVM code. To fix this, GCC now
- * inserts an entry node regardless of whether or not it has to insert allocas.
- */
-
-struct edge_rec
-{
- struct VERTEX *v;
- struct edge_rec *next;
- int wasseen;
- int more_data;
-};
-
-typedef struct edge_rec *QUAD_EDGE;
-
-typedef struct {
- QUAD_EDGE left, right;
-} EDGE_PAIR;
-
-struct EDGE_STACK {
- int ptr;
- QUAD_EDGE *elts;
- int stack_size;
-};
-
-int do_merge(QUAD_EDGE ldo, QUAD_EDGE rdo) {
- int lvalid;
- QUAD_EDGE basel,rcand;
- while (1) {
- if (!lvalid) {
- return (int)basel->next;
- }
- }
-}
-
diff --git a/release_23/test/CFrontend/2002-02-16-RenamingTest.c b/release_23/test/CFrontend/2002-02-16-RenamingTest.c
deleted file mode 100644
index 952af90c87ef..000000000000
--- a/release_23/test/CFrontend/2002-02-16-RenamingTest.c
+++ /dev/null
@@ -1,18 +0,0 @@
-// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
-
-/* test that locals are renamed with . notation */
-
-void abc(void *);
-
-void Test5(double X) {
- abc(&X);
- {
- int X;
- abc(&X);
- {
- float X;
- abc(&X);
- }
- }
-}
-
diff --git a/release_23/test/CFrontend/2002-02-17-ArgumentAddress.c b/release_23/test/CFrontend/2002-02-17-ArgumentAddress.c
deleted file mode 100644
index 937929559fe7..000000000000
--- a/release_23/test/CFrontend/2002-02-17-ArgumentAddress.c
+++ /dev/null
@@ -1,39 +0,0 @@
-// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
-
-int test(int X) {
- return X;
-}
-
-void abc(int *X);
-int def(int Y, int Z) {
- abc(&Z);
- return Y;
-}
-
-struct Test { short X, x; int Y, Z; };
-
-int Testing(struct Test *A) {
- return A->X+A->Y;
-}
-
-int Test2(int X, struct Test A, int Y) {
- return X+Y+A.X+A.Y;
-}
-int Test3(struct Test A, struct Test B) {
- return A.X+A.Y+B.Y+B.Z;
-}
-
-struct Test Test4(struct Test A) {
- return A;
-}
-
-int Test6() {
- int B[200];
- return B[4];
-}
-
-struct STest2 { int X; short Y[4]; double Z; };
-
-struct STest2 Test7(struct STest2 X) {
- return X;
-}
diff --git a/release_23/test/CFrontend/2002-02-18-64bitConstant.c b/release_23/test/CFrontend/2002-02-18-64bitConstant.c
deleted file mode 100644
index 6fd3e29d2429..000000000000
--- a/release_23/test/CFrontend/2002-02-18-64bitConstant.c
+++ /dev/null
@@ -1,8 +0,0 @@
-// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
-
-/* GCC wasn't handling 64 bit constants right fixed */
-
-void main() {
- long long Var = 123455678902ll;
- printf("%lld\n", Var);
-}
diff --git a/release_23/test/CFrontend/2002-02-18-StaticData.c b/release_23/test/CFrontend/2002-02-18-StaticData.c
deleted file mode 100644
index 10439c373097..000000000000
--- a/release_23/test/CFrontend/2002-02-18-StaticData.c
+++ /dev/null
@@ -1,13 +0,0 @@
-// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
-
-
-double FOO = 17;
-double BAR = 12.0;
-float XX = 12.0f;
-
-static char *procnames[] = {
- "EXIT"
-};
-
-void *Data[] = { &FOO, &BAR, &XX };
-
diff --git a/release_23/test/CFrontend/2002-03-11-LargeCharInString.c b/release_23/test/CFrontend/2002-03-11-LargeCharInString.c
deleted file mode 100644
index d8a1671fc773..000000000000
--- a/release_23/test/CFrontend/2002-03-11-LargeCharInString.c
+++ /dev/null
@@ -1,10 +0,0 @@
-// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
-
-#include <string.h>
-
-int test(char *X) {
- /* LLVM-GCC used to emit:
- %.LC0 = internal global [3 x sbyte] c"\1F\FFFFFF8B\00"
- */
- return strcmp(X, "\037\213");
-}
diff --git a/release_23/test/CFrontend/2002-03-12-ArrayInitialization.c b/release_23/test/CFrontend/2002-03-12-ArrayInitialization.c
deleted file mode 100644
index d6cf44625bd1..000000000000
--- a/release_23/test/CFrontend/2002-03-12-ArrayInitialization.c
+++ /dev/null
@@ -1,19 +0,0 @@
-// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
-
-/* GCC would generate bad code if not enough initializers are
- specified for an array.
- */
-
-int a[10] = { 0, 2};
-
-char str[10] = "x";
-
-void *Arr[5] = { 0, 0 };
-
-float F[12] = { 1.23f, 34.7f };
-
-struct Test { int X; double Y; };
-
-struct Test Array[10] = { { 2, 12.0 }, { 3, 24.0 } };
-
-int B[4][4] = { { 1, 2, 3, 4}, { 5, 6, 7 }, { 8, 9 } };
diff --git a/release_23/test/CFrontend/2002-03-12-StructInitialize.c b/release_23/test/CFrontend/2002-03-12-StructInitialize.c
deleted file mode 100644
index 5174ad4906d2..000000000000
--- a/release_23/test/CFrontend/2002-03-12-StructInitialize.c
+++ /dev/null
@@ -1,14 +0,0 @@
-// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
-
-
-typedef struct Connection_Type {
- long to;
- char type[10];
- long length;
-} Connection;
-
-Connection link[3]
-= { {1, "link1", 10},
- {2, "link2", 20},
- {3, "link3", 30} };
-
diff --git a/release_23/test/CFrontend/2002-03-12-StructInitializer.c b/release_23/test/CFrontend/2002-03-12-StructInitializer.c
deleted file mode 100644
index cf2ba4e8cf89..000000000000
--- a/release_23/test/CFrontend/2002-03-12-StructInitializer.c
+++ /dev/null
@@ -1,18 +0,0 @@
-// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
-
-/* GCC was not emitting string constants of the correct length when
- * embedded into a structure field like this. It thought the strlength
- * was -1.
- */
-
-typedef struct Connection_Type {
- long to;
- char type[10];
- long length;
-} Connection;
-
-Connection link[3]
-= { {1, "link1", 10},
- {2, "link2", 20},
- {3, "link3", 30} };
-
diff --git a/release_23/test/CFrontend/2002-03-14-BrokenPHINode.c b/release_23/test/CFrontend/2002-03-14-BrokenPHINode.c
deleted file mode 100644
index 16d9bc7814f3..000000000000
--- a/release_23/test/CFrontend/2002-03-14-BrokenPHINode.c
+++ /dev/null
@@ -1,19 +0,0 @@
-// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
-
-/* GCC was generating PHI nodes with an arity < #pred of the basic block the
- * PHI node lived in. This was breaking LLVM because the number of entries
- * in a PHI node must equal the number of predecessors for a basic block.
- */
-
-int trys(char *s, int x)
-{
- int asa;
- double Val;
- int LLS;
- if (x) {
- asa = LLS + asa;
- } else {
- }
- return asa+(int)Val;
-}
-
diff --git a/release_23/test/CFrontend/2002-03-14-BrokenSSA.c b/release_23/test/CFrontend/2002-03-14-BrokenSSA.c
deleted file mode 100644
index 01f259738e3f..000000000000
--- a/release_23/test/CFrontend/2002-03-14-BrokenSSA.c
+++ /dev/null
@@ -1,17 +0,0 @@
-// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
-
-/* This code used to break GCC's SSA computation code. It would create
- uses of B & C that are not dominated by their definitions. See:
- http://gcc.gnu.org/ml/gcc/2002-03/msg00697.html
- */
-int bar();
-int foo()
-{
- int a,b,c;
-
- a = b + c;
- b = bar();
- c = bar();
- return a + b + c;
-}
-
diff --git a/release_23/test/CFrontend/2002-03-14-QuotesInStrConst.c b/release_23/test/CFrontend/2002-03-14-QuotesInStrConst.c
deleted file mode 100644
index 42f82bfa8950..000000000000
--- a/release_23/test/CFrontend/2002-03-14-QuotesInStrConst.c
+++ /dev/null
@@ -1,10 +0,0 @@
-// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
-
-/* GCC was not escaping quotes in string constants correctly, so this would
- * get emitted:
- * %.LC1 = internal global [32 x sbyte] c"*** Word "%s" on line %d is not\00"
- */
-
-const char *Foo() {
- return "*** Word \"%s\" on line %d is not";
-}
diff --git a/release_23/test/CFrontend/2002-04-07-SwitchStmt.c b/release_23/test/CFrontend/2002-04-07-SwitchStmt.c
deleted file mode 100644
index 79632c9eb8ad..000000000000
--- a/release_23/test/CFrontend/2002-04-07-SwitchStmt.c
+++ /dev/null
@@ -1,22 +0,0 @@
-// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
-
-int printf(const char *, ...);
-int foo();
-
-int main() {
- while (foo()) {
- switch (foo()) {
- case 0:
- case 1:
- case 2:
- case 3:
- printf("3");
- case 4: printf("4");
- case 5:
- case 6:
- default:
- break;
- }
- }
- return 0;
-}
diff --git a/release_23/test/CFrontend/2002-04-08-LocalArray.c b/release_23/test/CFrontend/2002-04-08-LocalArray.c
deleted file mode 100644
index af6ebd6bdf90..000000000000
--- a/release_23/test/CFrontend/2002-04-08-LocalArray.c
+++ /dev/null
@@ -1,14 +0,0 @@
-// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
-
-/* GCC is not outputting the static array to the LLVM backend, so bad things
- * happen. Note that if this is defined static, everything seems fine.
- */
-void test(unsigned X) {
- double student_t[30]={0.0 , 12.706 , 4.303 , 3.182 , 2.776 , 2.571 ,
- 2.447 , 2.365 , 2.306 , 2.262 , 2.228 ,
- 2.201 , 2.179 , 2.160 , 2.145 , 2.131 ,
- 2.120 , 2.110 , 2.101 , 2.093 , 2.086 ,
- 2.080 , 2.074 , 2.069 , 2.064 , 2.060 ,
- 2.056 , 2.052 , 2.048 , 2.045 };
- return student_t[X];
-}
diff --git a/release_23/test/CFrontend/2002-04-09-StructRetVal.c b/release_23/test/CFrontend/2002-04-09-StructRetVal.c
deleted file mode 100644
index c655e4a4d05d..000000000000
--- a/release_23/test/CFrontend/2002-04-09-StructRetVal.c
+++ /dev/null
@@ -1,12 +0,0 @@
-// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
-
-struct S {
- int i;
- short s1, s2;
-};
-
-struct S func_returning_struct(void);
-
-void loop(void) {
- func_returning_struct();
-}
diff --git a/release_23/test/CFrontend/2002-04-10-StructParameters.c b/release_23/test/CFrontend/2002-04-10-StructParameters.c
deleted file mode 100644
index 9db6a132bc1e..000000000000
--- a/release_23/test/CFrontend/2002-04-10-StructParameters.c
+++ /dev/null
@@ -1,25 +0,0 @@
-// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
-
-
-typedef struct {
- char p;
- short q;
- char r;
- int X;
- short Y, Z;
- int Q;
-} foo;
-
-int test(foo X, float);
-int testE(char,short,char,int,int,float);
-void test3(foo *X) {
- X->q = 1;
-}
-
-void test2(foo Y) {
- testE(Y.p, Y.q, Y.r, Y.X, Y.Y, 0.1f);
- test(Y, 0.1f);
- test2(Y);
- test3(&Y);
-}
-
diff --git a/release_23/test/CFrontend/2002-05-23-StaticValues.c b/release_23/test/CFrontend/2002-05-23-StaticValues.c
deleted file mode 100644
index bf583e203d35..000000000000
--- a/release_23/test/CFrontend/2002-05-23-StaticValues.c
+++ /dev/null
@@ -1,15 +0,0 @@
-// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
-
-/* Make sure the frontend is correctly marking static stuff as internal! */
-
-int X;
-static int Y = 12;
-
-static void foo(int Z) {
- Y = Z;
-}
-
-void *test() {
- foo(12);
- return &Y;
-}
diff --git a/release_23/test/CFrontend/2002-05-23-TypeNameCollision.c b/release_23/test/CFrontend/2002-05-23-TypeNameCollision.c
deleted file mode 100644
index 43faf97b1e63..000000000000
--- a/release_23/test/CFrontend/2002-05-23-TypeNameCollision.c
+++ /dev/null
@@ -1,19 +0,0 @@
-// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
-
-/* Testcase for when struct tag conflicts with typedef name... grr */
-
-typedef struct foo {
- struct foo *X;
- int Y;
-} * foo;
-
-foo F1;
-struct foo *F2;
-
-enum bar { test1, test2 };
-
-typedef float bar;
-
-enum bar B1;
-bar B2;
-
diff --git a/release_23/test/CFrontend/2002-05-24-Alloca.c b/release_23/test/CFrontend/2002-05-24-Alloca.c
deleted file mode 100644
index ac5b78d0c997..000000000000
--- a/release_23/test/CFrontend/2002-05-24-Alloca.c
+++ /dev/null
@@ -1,11 +0,0 @@
-// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
-
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-
-int main(int argc, char **argv) {
- char *C = (char*)alloca(argc);
- strcpy(C, argv[0]);
- puts(C);
-}
diff --git a/release_23/test/CFrontend/2002-06-25-FWriteInterfaceFailure.c b/release_23/test/CFrontend/2002-06-25-FWriteInterfaceFailure.c
deleted file mode 100644
index fb1b54bf72e2..000000000000
--- a/release_23/test/CFrontend/2002-06-25-FWriteInterfaceFailure.c
+++ /dev/null
@@ -1,7 +0,0 @@
-// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
-
-#include <stdio.h>
-
-void test() {
- fprintf(stderr, "testing\n");
-}
diff --git a/release_23/test/CFrontend/2002-07-14-MiscListTests.c b/release_23/test/CFrontend/2002-07-14-MiscListTests.c
deleted file mode 100644
index baae585f6c33..000000000000
--- a/release_23/test/CFrontend/2002-07-14-MiscListTests.c
+++ /dev/null
@@ -1,71 +0,0 @@
-// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
-
-// Test list stuff
-
-void *malloc(unsigned);
-
-// Test opaque structure support. the list type is defined later
-struct list;
-
-struct list *PassThroughList(struct list *L) {
- return L;
-}
-
-
-// Recursive data structure tests...
-
-typedef struct list {
- int Data;
- struct list *Next;
-} list;
-
-list *Data;
-
-void foo() {
- static int Foo = 0; // Test static local variable
- Foo += 1; // Increment static variable
-
- Data = (list*)malloc(12); // This is not a proper list allocation
-}
-
-extern list ListNode1;
-list ListNode3 = { 4, 0 };
-list ListNode2 = { 3, &ListNode3 };
-list ListNode0 = { 1, &ListNode1 };
-list ListNode1 = { 2, &ListNode2 };
-
-
-list ListArray[10];
-
-// Iterative insert fn
-void InsertIntoListTail(list **L, int Data) {
- while (*L)
- L = &(*L)->Next;
- *L = (list*)malloc(sizeof(list));
- (*L)->Data = Data;
- (*L)->Next = 0;
-}
-
-// Recursive list search fn
-list *FindData(list *L, int Data) {
- if (L == 0) return 0;
- if (L->Data == Data) return L;
- return FindData(L->Next, Data);
-}
-
-void foundIt(void);
-
-// Driver fn...
-void DoListStuff() {
- list *MyList = 0;
- InsertIntoListTail(&MyList, 100);
- InsertIntoListTail(&MyList, 12);
- InsertIntoListTail(&MyList, 42);
- InsertIntoListTail(&MyList, 1123);
- InsertIntoListTail(&MyList, 1213);
-
- if (FindData(MyList, 75)) foundIt();
- if (FindData(MyList, 42)) foundIt();
- if (FindData(MyList, 700)) foundIt();
-}
-
diff --git a/release_23/test/CFrontend/2002-07-14-MiscTests.c b/release_23/test/CFrontend/2002-07-14-MiscTests.c
deleted file mode 100644
index e78dbd72eb93..000000000000
--- a/release_23/test/CFrontend/2002-07-14-MiscTests.c
+++ /dev/null
@@ -1,57 +0,0 @@
-// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
-
-/* These are random tests that I used when working on the GCC frontend
- originally. */
-
-// test floating point comparison!
-int floatcomptest(double *X, double *Y, float *x, float *y) {
- return *X < *Y || *x < *y;
-}
-
-extern void *malloc(unsigned);
-
-// Exposed a bug
-void *memset_impl(void *dstpp, int c, unsigned len) {
- long long int dstp = (long long int) dstpp;
-
- while (dstp % 4 != 0)
- {
- ((unsigned char *) dstp)[0] = c;
- dstp += 1;
- len -= 1;
- }
- return dstpp;
-}
-
-// TEST problem with signed/unsigned versions of the same constants being shared
-// incorrectly!
-//
-static char *temp;
-static int remaining;
-static char *localmalloc(int size) {
- char *blah;
-
- if (size>remaining)
- {
- temp = (char *) malloc(32768);
- remaining = 32768;
- return temp;
- }
- return 0;
-}
-
-typedef struct { double X; double Y; int Z; } PBVTest;
-
-PBVTest testRetStruct(float X, double Y, int Z) {
- PBVTest T = { X, Y, Z };
- return T;
-}
-PBVTest testRetStruct2(void); // external func no inlining
-
-
-double CallRetStruct(float X, double Y, int Z) {
- PBVTest T = testRetStruct2();
- return T.X+X+Y+Z;
-}
-
-
diff --git a/release_23/test/CFrontend/2002-07-14-MiscTests2.c b/release_23/test/CFrontend/2002-07-14-MiscTests2.c
deleted file mode 100644
index ac58926abf29..000000000000
--- a/release_23/test/CFrontend/2002-07-14-MiscTests2.c
+++ /dev/null
@@ -1,13 +0,0 @@
-// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
-
-
-// Test ?: in function calls
-extern fp(int, char*);
-char *Ext;
-void
-__bb_exit_func (void)
-{
- fp (12, Ext ? Ext : "<none>");
-}
-
-
diff --git a/release_23/test/CFrontend/2002-07-14-MiscTests3.c b/release_23/test/CFrontend/2002-07-14-MiscTests3.c
deleted file mode 100644
index 9a262d5fcef8..000000000000
--- a/release_23/test/CFrontend/2002-07-14-MiscTests3.c
+++ /dev/null
@@ -1,187 +0,0 @@
-// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
-
-
-
-void *malloc(unsigned);
-
-//#include <stdio.h>
-int puts(const char *s);
-
-struct FunStructTest {
- int Test1;
- char *Pointer;
- int Array[12];
-};
-
-struct SubStruct {
- short X, Y;
-};
-
-struct Quad {
- int w;
- struct SubStruct SS;
- struct SubStruct *SSP;
- char c;
- int y;
-};
-
-struct Quad GlobalQuad = { 4, {1, 2}, 0, 3, 156 };
-
-typedef int (*FuncPtr)(int);
-
-unsigned PtrFunc(int (*Func)(int), int X) {
- return Func(X);
-}
-
-char PtrFunc2(FuncPtr FuncTab[30], int Num) {
- return FuncTab[Num]('b');
-}
-
-extern char SmallArgs2(char w, char x, long long Zrrk, char y, char z);
-extern int SomeFunc(void);
-char SmallArgs(char w, char x, char y, char z) {
- SomeFunc();
- return SmallArgs2(w-1, x+1, y, z, w);
-}
-
-static int F0(struct Quad Q, int i) { /* Pass Q by value */
- struct Quad R;
- if (i) R.SS = Q.SS;
- Q.SSP = &R.SS;
- Q.w = Q.y = Q.c = 1;
- return Q.SS.Y + i + R.y - Q.c;
-}
-
-int F1(struct Quad *Q, int i) { /* Pass Q by address */
- struct Quad R;
-#if 0
- if (i) R.SS = Q->SS;
-#else
- if (i) R = *Q;
-#endif
- Q->w = Q->y = Q->c = 1;
- return Q->SS.Y+i+R.y-Q->c;
-}
-
-
-int BadFunc(float Val) {
- int Result;
- if (Val > 12.345) Result = 4;
- return Result; /* Test use of undefined value */
-}
-
-int RealFunc(void) {
- return SomeUndefinedFunction(1, 4, 5);
-}
-
-extern int EF1(int *, char *, int *);
-
-int Func(int Param, long long Param2) {
- int Result = Param;
-
- {{{{
- char c; int X;
- EF1(&Result, &c, &X);
- }}}
-
- { // c & X are duplicate names!
- char c; int X;
- EF1(&Result, &c, &X);
- }
-
- }
- return Result;
-}
-
-
-short FunFunc(long long x, char z) {
- return x+z;
-}
-
-unsigned castTest(int X) { return X; }
-
-double TestAdd(double X, float Y) {
- return X+Y+.5;
-}
-
-int func(int i, int j) {
- while (i != 20)
- i += 2;
-
- j += func(2, i);
- return (i * 3 + j*2)*j;
-}
-
-int SumArray(int Array[], int Num) {
- int i, Result = 0;
- for (i = 0; i < Num; ++i)
- Result += Array[i];
-
- return Result;
-}
-
-int ArrayParam(int Values[100]) {
- return EF1((int*)Values[50], (char*)1, &Values[50]);
-}
-
-int ArrayToSum(void) {
- int A[100], i;
- for (i = 0; i < 100; ++i)
- A[i] = i*4;
-
- return A[A[0]]; //SumArray(A, 100);
-}
-
-
-int ExternFunc(long long, unsigned*, short, unsigned char);
-
-int main(int argc, char *argv[]) {
- unsigned i;
- puts("Hello world!\n");
-
- ExternFunc(-1, 0, (short)argc, 2);
- //func(argc, argc);
-
- for (i = 0; i < 10; i++)
- puts(argv[3]);
- return 0;
-}
-
-double MathFunc(double X, double Y, double Z,
- double AA, double BB, double CC, double DD,
- double EE, double FF, double GG, double HH,
- double aAA, double aBB, double aCC, double aDD,
- double aEE, double aFF) {
- return X + Y + Z + AA + BB + CC + DD + EE + FF + GG + HH
- + aAA + aBB + aCC + aDD + aEE + aFF;
-}
-
-
-
-void strcpy(char *s1, char *s2) {
- while (*s1++ = *s2++);
-}
-
-void strcat(char *s1, char *s2) {
- while (*s1++);
- s1--;
- while (*s1++ = *s2++);
-}
-
-int strcmp(char *s1, char *s2) {
- while (*s1++ == *s2++);
- if (*s1 == 0) {
- if (*s2 == 0) {
- return 0;
- } else {
- return -1;
- }
- } else {
- if (*s2 == 0) {
- return 1;
- } else {
- return (*(--s1) - *(--s2));
- }
- }
-}
-
diff --git a/release_23/test/CFrontend/2002-07-16-HardStringInit.c b/release_23/test/CFrontend/2002-07-16-HardStringInit.c
deleted file mode 100644
index d1d03216ce1f..000000000000
--- a/release_23/test/CFrontend/2002-07-16-HardStringInit.c
+++ /dev/null
@@ -1,8 +0,0 @@
-// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
-
- char auto_kibitz_list[100][20] = {
- {"diepx"},
- {"ferret"},
- {"knightc"},
- {"knightcap"}};
-
diff --git a/release_23/test/CFrontend/2002-07-17-StringConstant.c b/release_23/test/CFrontend/2002-07-17-StringConstant.c
deleted file mode 100644
index 8a392033f392..000000000000
--- a/release_23/test/CFrontend/2002-07-17-StringConstant.c
+++ /dev/null
@@ -1,4 +0,0 @@
-// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
-
-
-char * foo() { return "\\begin{"; }
diff --git a/release_23/test/CFrontend/2002-07-29-Casts.c b/release_23/test/CFrontend/2002-07-29-Casts.c
deleted file mode 100644
index 6794e80b5e3e..000000000000
--- a/release_23/test/CFrontend/2002-07-29-Casts.c
+++ /dev/null
@@ -1,86 +0,0 @@
-// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <sys/types.h>
-
-int
-main(int argc, char** argv)
-{
- char c1;
- short s1, ssf1, ssd1;
- unsigned char ubs0;
- signed char bs0;
- unsigned char ubc0, uc2;
- unsigned short us2, usf1, usd1;
- int ic3, is3, sif1, sid1;
- unsigned int uic4, uis4, uif1, uid1;
- long slf1, sld1;
- unsigned long ulf1, uld1;
- float f1;
- double d1;
-
- /* Test integer to integer conversions */
-
- c1 = (char) (argc >= 2)? atoi(argv[1]) : 0xff64; /* 100 = 'd' */
- s1 = (short) (argc >= 3)? atoi(argv[2]) : -769; /* 0xf7ff = -769 */
-
- ubc0 = (unsigned char) c1; /* 100 = 'd' */
- ubs0 = (unsigned char) s1; /* 0xff = 255 */
- bs0 = (signed char) s1; /* 0xff = -1 */
-
- uc2 = (unsigned char) c1; /* 100 = 'd' */
- us2 = (unsigned short) s1; /* 0xf7ff = 64767 */
-
- ic3 = (int) c1; /* 100 = 'd' */
- is3 = (int) s1; /* 0xfffff7ff = -769 */
-
- uic4 = (unsigned int) c1; /* 100 = 'd' */
- uis4 = (unsigned int) s1; /* 0xfffff7ff = 4294966527 */
-
- printf("ubc0 = '%c'\n", ubc0);
- printf("ubs0 = %u\n", ubs0);
- printf("bs0 = %d\n", bs0);
- printf("c1 = '%c'\n", c1);
- printf("s1 = %d\n", s1);
- printf("uc2 = '%c'\n", uc2);
- printf("us2 = %u\n", us2);
- printf("ic3 = '%c'\n", ic3);
- printf("is3 = %d\n", is3);
- printf("uic4 = '%c'\n", uic4);
- printf("uis4 = %u\n", uis4);
-
- /* Test floating-point to integer conversions */
- f1 = (float) (argc >= 4)? atof(argv[3]) : 1.0;
- d1 = (argc >= 5)? atof(argv[4]) : 2.0;
-
- usf1 = (unsigned short) f1;
- usd1 = (unsigned short) d1;
- uif1 = (unsigned int) f1;
- uid1 = (unsigned int) d1;
- ulf1 = (unsigned long) f1;
- uld1 = (unsigned long) d1;
-
- ssf1 = (short) f1;
- ssd1 = (short) d1;
- sif1 = (int) f1;
- sid1 = (int) d1;
- slf1 = (long) f1;
- sld1 = (long) d1;
-
- printf("usf1 = %u\n", usf1);
- printf("usd1 = %u\n", usd1);
- printf("uif1 = %u\n", uif1);
- printf("uid1 = %u\n", uid1);
- printf("ulf1 = %u\n", ulf1);
- printf("uld1 = %u\n", uld1);
-
- printf("ssf1 = %d\n", ssf1);
- printf("ssd1 = %d\n", ssd1);
- printf("sif1 = %d\n", sif1);
- printf("sid1 = %d\n", sid1);
- printf("slf1 = %d\n", slf1);
- printf("sld1 = %d\n", sld1);
-
- return 0;
-}
diff --git a/release_23/test/CFrontend/2002-07-30-SubregSetAssertion.c b/release_23/test/CFrontend/2002-07-30-SubregSetAssertion.c
deleted file mode 100644
index 6d4f9f620581..000000000000
--- a/release_23/test/CFrontend/2002-07-30-SubregSetAssertion.c
+++ /dev/null
@@ -1,12 +0,0 @@
-// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
-
-
-union X {
- void *B;
-};
-
-union X foo() {
- union X A;
- A.B = (void*)123;
- return A;
-}
diff --git a/release_23/test/CFrontend/2002-07-30-UnionTest.c b/release_23/test/CFrontend/2002-07-30-UnionTest.c
deleted file mode 100644
index b2c481e4079c..000000000000
--- a/release_23/test/CFrontend/2002-07-30-UnionTest.c
+++ /dev/null
@@ -1,22 +0,0 @@
-// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
-
-union X;
-struct Empty {};
-union F {};
-union Q { union Q *X; };
-union X {
- char C;
- int A, Z;
- long long B;
- void *b1;
- struct { int A; long long Z; } Q;
-};
-
-union X foo(union X A) {
- A.C = 123;
- A.A = 39249;
- //A.B = (void*)123040123321;
- A.B = 12301230123123LL;
- A.Z = 1;
- return A;
-}
diff --git a/release_23/test/CFrontend/2002-07-30-VarArgsCallFailure.c b/release_23/test/CFrontend/2002-07-30-VarArgsCallFailure.c
deleted file mode 100644
index b37a462220b2..000000000000
--- a/release_23/test/CFrontend/2002-07-30-VarArgsCallFailure.c
+++ /dev/null
@@ -1,8 +0,0 @@
-// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
-
-int tcount;
-void test(char *, const char*, int);
-void foo() {
- char Buf[10];
- test(Buf, "n%%%d", tcount++);
-}
diff --git a/release_23/test/CFrontend/2002-07-31-BadAssert.c b/release_23/test/CFrontend/2002-07-31-BadAssert.c
deleted file mode 100644
index 5801d03a0993..000000000000
--- a/release_23/test/CFrontend/2002-07-31-BadAssert.c
+++ /dev/null
@@ -1,16 +0,0 @@
-// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
-
-typedef struct
-{
- unsigned char type; /* Indicates, NORMAL, SUBNORMAL, etc. */
-} InternalFPF;
-
-
-static void SetInternalFPFZero(InternalFPF *dest) {
- dest->type=0;
-}
-
-void denormalize(InternalFPF *ptr) {
- SetInternalFPFZero(ptr);
-}
-
diff --git a/release_23/test/CFrontend/2002-07-31-SubregFailure.c b/release_23/test/CFrontend/2002-07-31-SubregFailure.c
deleted file mode 100644
index 15573f9128ad..000000000000
--- a/release_23/test/CFrontend/2002-07-31-SubregFailure.c
+++ /dev/null
@@ -1,14 +0,0 @@
-// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
-
-
-typedef union {
- long (*ap)[4];
-} ptrs;
-
-void DoAssignIteration() {
- ptrs abase;
- abase.ap+=27;
- Assignment(*abase.ap);
-}
-
-
diff --git a/release_23/test/CFrontend/2002-08-02-UnionTest.c b/release_23/test/CFrontend/2002-08-02-UnionTest.c
deleted file mode 100644
index bc44e461dec5..000000000000
--- a/release_23/test/CFrontend/2002-08-02-UnionTest.c
+++ /dev/null
@@ -1,19 +0,0 @@
-// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
-
-/* In this testcase, the return value of foo() is being promotedto a register
- * which breaks stuff
- */
-#include <stdio.h>
-
-union X { char X; void *B; int a, b, c, d;};
-
-union X foo() {
- union X Global;
- Global.B = (void*)123; /* Interesting part */
- return Global;
-}
-
-void main() {
- union X test = foo();
- printf("0x%p", test.B);
-}
diff --git a/release_23/test/CFrontend/2002-08-19-RecursiveLocals.c b/release_23/test/CFrontend/2002-08-19-RecursiveLocals.c
deleted file mode 100644
index e5007af7254e..000000000000
--- a/release_23/test/CFrontend/2002-08-19-RecursiveLocals.c
+++ /dev/null
@@ -1,18 +0,0 @@
-// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
-
-/* This testcase doesn't actually test a bug, it's just the result of me
- * figuring out the syntax for forward declaring a static variable. */
-struct list {
- int x;
- struct list *Next;
-};
-
-static struct list B; /* Forward declare static */
-static struct list A = { 7, &B };
-static struct list B = { 8, &A };
-
-extern struct list D; /* forward declare normal var */
-
-struct list C = { 7, &D };
-struct list D = { 8, &C };
-
diff --git a/release_23/test/CFrontend/2002-09-08-PointerShifts.c b/release_23/test/CFrontend/2002-09-08-PointerShifts.c
deleted file mode 100644
index cc7e91a7f9a8..000000000000
--- a/release_23/test/CFrontend/2002-09-08-PointerShifts.c
+++ /dev/null
@@ -1,6 +0,0 @@
-// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
-
-
-int foo(int *A, unsigned X) {
- return A[X];
-}
diff --git a/release_23/test/CFrontend/2002-09-18-UnionProblem.c b/release_23/test/CFrontend/2002-09-18-UnionProblem.c
deleted file mode 100644
index 56ec6cec8ed0..000000000000
--- a/release_23/test/CFrontend/2002-09-18-UnionProblem.c
+++ /dev/null
@@ -1,26 +0,0 @@
-// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
-
-
-struct DWstruct {
- char high, low;
-};
-
-typedef union {
- struct DWstruct s;
- short ll;
-} DWunion;
-
-short __udivmodhi4 (char n1, char bm) {
- DWunion rr;
-
- if (bm == 0)
- {
- rr.s.high = n1;
- }
- else
- {
- rr.s.high = bm;
- }
-
- return rr.ll;
-}
diff --git a/release_23/test/CFrontend/2002-09-19-StarInLabel.c b/release_23/test/CFrontend/2002-09-19-StarInLabel.c
deleted file mode 100644
index 86a2571d57bc..000000000000
--- a/release_23/test/CFrontend/2002-09-19-StarInLabel.c
+++ /dev/null
@@ -1,9 +0,0 @@
-// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
-
-extern void start() __asm__("start");
-extern void _start() __asm__("_start");
-extern void __start() __asm__("__start");
-void start() {}
-void _start() {}
-void __start() {}
-
diff --git a/release_23/test/CFrontend/2002-10-12-TooManyArguments.c b/release_23/test/CFrontend/2002-10-12-TooManyArguments.c
deleted file mode 100644
index 206cdd98da0b..000000000000
--- a/release_23/test/CFrontend/2002-10-12-TooManyArguments.c
+++ /dev/null
@@ -1,8 +0,0 @@
-// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
-
-
-void foo() {}
-
-void bar() {
- foo(1, 2, 3); /* Too many arguments passed */
-}
diff --git a/release_23/test/CFrontend/2002-12-15-GlobalBoolTest.c b/release_23/test/CFrontend/2002-12-15-GlobalBoolTest.c
deleted file mode 100644
index 6b27391d9b5c..000000000000
--- a/release_23/test/CFrontend/2002-12-15-GlobalBoolTest.c
+++ /dev/null
@@ -1,5 +0,0 @@
-// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
-
-
-_Bool X = 0;
-
diff --git a/release_23/test/CFrontend/2002-12-15-GlobalConstantTest.c b/release_23/test/CFrontend/2002-12-15-GlobalConstantTest.c
deleted file mode 100644
index a5a679db6758..000000000000
--- a/release_23/test/CFrontend/2002-12-15-GlobalConstantTest.c
+++ /dev/null
@@ -1,8 +0,0 @@
-// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
-
-
-const char *W = "foo";
-const int X = 7;
-int Y = 8;
-const char * const Z = "bar";
-
diff --git a/release_23/test/CFrontend/2002-12-15-GlobalRedefinition.c b/release_23/test/CFrontend/2002-12-15-GlobalRedefinition.c
deleted file mode 100644
index 39632a150666..000000000000
--- a/release_23/test/CFrontend/2002-12-15-GlobalRedefinition.c
+++ /dev/null
@@ -1,5 +0,0 @@
-// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
-
-extern char algbrfile[9];
-char algbrfile[9] = "abcdefgh";
-
diff --git a/release_23/test/CFrontend/2002-12-15-StructParameters.c b/release_23/test/CFrontend/2002-12-15-StructParameters.c
deleted file mode 100644
index c85dab1cd1e4..000000000000
--- a/release_23/test/CFrontend/2002-12-15-StructParameters.c
+++ /dev/null
@@ -1,18 +0,0 @@
-// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
-
-typedef struct
-{
- void *stack;
- unsigned size;
- unsigned avail;
-} compile_stack_type;
-
-void foo(void*);
-void bar(compile_stack_type T, unsigned);
-
-void test() {
- compile_stack_type CST;
- foo(&CST);
-
- bar(CST, 12);
-}
diff --git a/release_23/test/CFrontend/2003-01-30-UnionInit.c b/release_23/test/CFrontend/2003-01-30-UnionInit.c
deleted file mode 100644
index 576958442aec..000000000000
--- a/release_23/test/CFrontend/2003-01-30-UnionInit.c
+++ /dev/null
@@ -1,8 +0,0 @@
-// RUN: %llvmgcc -S %s -o /dev/null
-
-union foo {
- struct { char A, B; } X;
- int C;
-};
-
-union foo V = { {1, 2} };
diff --git a/release_23/test/CFrontend/2003-03-03-DeferredType.c b/release_23/test/CFrontend/2003-03-03-DeferredType.c
deleted file mode 100644
index fa51991b3057..000000000000
--- a/release_23/test/CFrontend/2003-03-03-DeferredType.c
+++ /dev/null
@@ -1,12 +0,0 @@
-// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
-
-
-
-
-struct foo A;
-
-struct foo {
- int x;
-double D;
-};
-
diff --git a/release_23/test/CFrontend/2003-06-22-UnionCrash.c b/release_23/test/CFrontend/2003-06-22-UnionCrash.c
deleted file mode 100644
index dab0716ae630..000000000000
--- a/release_23/test/CFrontend/2003-06-22-UnionCrash.c
+++ /dev/null
@@ -1,13 +0,0 @@
-// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
-
-struct Blend_Map_Entry {
- union {
- float Colour[5];
- double Point_Slope[2];
- } Vals;
-};
-
-void test(struct Blend_Map_Entry* Foo)
-{
-}
-
diff --git a/release_23/test/CFrontend/2003-06-23-GCC-fold-infinite-recursion.c b/release_23/test/CFrontend/2003-06-23-GCC-fold-infinite-recursion.c
deleted file mode 100644
index ba66276683b3..000000000000
--- a/release_23/test/CFrontend/2003-06-23-GCC-fold-infinite-recursion.c
+++ /dev/null
@@ -1,6 +0,0 @@
-// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
-
-double Test(double A, double B, double C, double D) {
- return -(A-B) - (C-D);
-}
-
diff --git a/release_23/test/CFrontend/2003-06-26-CFECrash.c b/release_23/test/CFrontend/2003-06-26-CFECrash.c
deleted file mode 100644
index bb6977f4838e..000000000000
--- a/release_23/test/CFrontend/2003-06-26-CFECrash.c
+++ /dev/null
@@ -1,19 +0,0 @@
-// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
-
-typedef struct min_info {
- long offset;
- unsigned file_attr;
-} min_info;
-
-typedef struct Globals {
- char answerbuf;
- min_info info[1];
- min_info *pInfo;
-} Uz_Globs;
-
-extern Uz_Globs G;
-
-int extract_or_test_files() {
- G.pInfo = G.info;
-}
-
diff --git a/release_23/test/CFrontend/2003-06-29-MultipleFunctionDefinition.c b/release_23/test/CFrontend/2003-06-29-MultipleFunctionDefinition.c
deleted file mode 100644
index b7bc80330673..000000000000
--- a/release_23/test/CFrontend/2003-06-29-MultipleFunctionDefinition.c
+++ /dev/null
@@ -1,8 +0,0 @@
-// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
-
-/* This is apparently legal C.
- */
-extern __inline__ void test() { }
-
-void test() {
-}
diff --git a/release_23/test/CFrontend/2003-07-22-ArrayAccessTypeSafety.c.tr b/release_23/test/CFrontend/2003-07-22-ArrayAccessTypeSafety.c.tr
deleted file mode 100644
index 51e66c9b8395..000000000000
--- a/release_23/test/CFrontend/2003-07-22-ArrayAccessTypeSafety.c.tr
+++ /dev/null
@@ -1,7 +0,0 @@
-/* RUN: %llvmgcc -xc %s -S -o - | grep -v alloca | not grep bitcast
- */
-
-void test(int* array, long long N) {
- array[N] = N[array] = 33;
-}
-
diff --git a/release_23/test/CFrontend/2003-08-06-BuiltinSetjmpLongjmp.c.tr b/release_23/test/CFrontend/2003-08-06-BuiltinSetjmpLongjmp.c.tr
deleted file mode 100644
index 39412e5f84ee..000000000000
--- a/release_23/test/CFrontend/2003-08-06-BuiltinSetjmpLongjmp.c.tr
+++ /dev/null
@@ -1,14 +0,0 @@
-/* RUN: %llvmgcc -xc %s -c -o - | llvm-dis | not grep __builtin_
- *
- * __builtin_longjmp/setjmp should get transformed into llvm.setjmp/longjmp
- * just like explicit setjmp/longjmp calls are.
- */
-
-void jumpaway(int *ptr) {
- __builtin_longjmp(ptr,1);
-}
-
-int main(void) {
- __builtin_setjmp(0);
- jumpaway(0);
-}
diff --git a/release_23/test/CFrontend/2003-08-17-DeadCodeShortCircuit.c.tr b/release_23/test/CFrontend/2003-08-17-DeadCodeShortCircuit.c.tr
deleted file mode 100644
index c275fee5d09a..000000000000
--- a/release_23/test/CFrontend/2003-08-17-DeadCodeShortCircuit.c.tr
+++ /dev/null
@@ -1,7 +0,0 @@
-// RUN: %llvmgcc -xc %s -c -o %t.o
-
-int test(_Bool pos, _Bool color) {
- return 0;
- return (pos && color);
-}
-
diff --git a/release_23/test/CFrontend/2003-08-18-SigSetJmp.c b/release_23/test/CFrontend/2003-08-18-SigSetJmp.c
deleted file mode 100644
index b7f4553f41d6..000000000000
--- a/release_23/test/CFrontend/2003-08-18-SigSetJmp.c
+++ /dev/null
@@ -1,10 +0,0 @@
-// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
-
-
-#include <setjmp.h>
-
-sigjmp_buf B;
-int foo() {
- sigsetjmp(B, 1);
- bar();
-}
diff --git a/release_23/test/CFrontend/2003-08-18-StructAsValue.c b/release_23/test/CFrontend/2003-08-18-StructAsValue.c
deleted file mode 100644
index 649eadc4e451..000000000000
--- a/release_23/test/CFrontend/2003-08-18-StructAsValue.c
+++ /dev/null
@@ -1,11 +0,0 @@
-// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
-
-
-typedef struct {
- int op;
-} event_t;
-
-event_t test(int X) {
- event_t foo = { 1 }, bar = { 2 };
- return X ? foo : bar;
-}
diff --git a/release_23/test/CFrontend/2003-08-20-BadBitfieldRef.c b/release_23/test/CFrontend/2003-08-20-BadBitfieldRef.c
deleted file mode 100644
index 58cf1bc334c6..000000000000
--- a/release_23/test/CFrontend/2003-08-20-BadBitfieldRef.c
+++ /dev/null
@@ -1,8 +0,0 @@
-// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
-
-void foo()
-{
- char *ap;
- ap[1] == '-' && ap[2] == 0;
-}
-
diff --git a/release_23/test/CFrontend/2003-08-20-PrototypeMismatch.c b/release_23/test/CFrontend/2003-08-20-PrototypeMismatch.c
deleted file mode 100644
index 8358a2f6fd05..000000000000
--- a/release_23/test/CFrontend/2003-08-20-PrototypeMismatch.c
+++ /dev/null
@@ -1,15 +0,0 @@
-// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
-
-
-
-static int foo(int);
-
-static int foo(C)
-char C;
-{
- return C;
-}
-
-void test() {
- foo(7);
-}
diff --git a/release_23/test/CFrontend/2003-08-20-vfork-bug.c b/release_23/test/CFrontend/2003-08-20-vfork-bug.c
deleted file mode 100644
index 575bfd6c194b..000000000000
--- a/release_23/test/CFrontend/2003-08-20-vfork-bug.c
+++ /dev/null
@@ -1,6 +0,0 @@
-// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
-
-extern int vfork(void);
-test() {
- vfork();
-}
diff --git a/release_23/test/CFrontend/2003-08-21-BinOp-Type-Mismatch.c b/release_23/test/CFrontend/2003-08-21-BinOp-Type-Mismatch.c
deleted file mode 100644
index 8829652cb154..000000000000
--- a/release_23/test/CFrontend/2003-08-21-BinOp-Type-Mismatch.c
+++ /dev/null
@@ -1,10 +0,0 @@
-// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
-
-struct bar;
-
-void foo()
-{
- unsigned int frame, focus;
- (struct bar *) focus == (focus ? ((struct bar *) frame) : 0);
-}
-
diff --git a/release_23/test/CFrontend/2003-08-21-StmtExpr.c b/release_23/test/CFrontend/2003-08-21-StmtExpr.c
deleted file mode 100644
index 878ed473487e..000000000000
--- a/release_23/test/CFrontend/2003-08-21-StmtExpr.c
+++ /dev/null
@@ -1,12 +0,0 @@
-// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
-
-
-typedef struct {
- unsigned long val;
-} structty;
-
-void bar(structty new_mask);
-static void foo() {
- bar(({ structty mask; mask; }));
-}
-
diff --git a/release_23/test/CFrontend/2003-08-21-WideString.c b/release_23/test/CFrontend/2003-08-21-WideString.c
deleted file mode 100644
index 0a833dcac547..000000000000
--- a/release_23/test/CFrontend/2003-08-21-WideString.c
+++ /dev/null
@@ -1,5 +0,0 @@
-// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
-
-struct {
- int *name;
-} syms = { L"NUL" };
diff --git a/release_23/test/CFrontend/2003-08-23-LocalUnionTest.c b/release_23/test/CFrontend/2003-08-23-LocalUnionTest.c
deleted file mode 100644
index dc27802623ae..000000000000
--- a/release_23/test/CFrontend/2003-08-23-LocalUnionTest.c
+++ /dev/null
@@ -1,11 +0,0 @@
-// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
-
-
-
-union foo { int X; };
-
-int test(union foo* F) {
- {
- union foo { float X; } A;
- }
-}
diff --git a/release_23/test/CFrontend/2003-08-29-BitFieldStruct.c b/release_23/test/CFrontend/2003-08-29-BitFieldStruct.c
deleted file mode 100644
index 8c303e8f2e01..000000000000
--- a/release_23/test/CFrontend/2003-08-29-BitFieldStruct.c
+++ /dev/null
@@ -1,13 +0,0 @@
-// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
-
-struct Word {
- short bar;
- short baz;
- int final:1;
- short quux;
-} *word_limit;
-
-void foo ()
-{
- word_limit->final = (word_limit->final && word_limit->final);
-}
diff --git a/release_23/test/CFrontend/2003-08-29-HugeCharConst.c b/release_23/test/CFrontend/2003-08-29-HugeCharConst.c
deleted file mode 100644
index a997994e91c3..000000000000
--- a/release_23/test/CFrontend/2003-08-29-HugeCharConst.c
+++ /dev/null
@@ -1,5 +0,0 @@
-// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
-
-void foo() {
- unsigned char int_latin1[] = "f\200\372b\200\343\200\340";
-}
diff --git a/release_23/test/CFrontend/2003-08-29-StructLayoutBug.c b/release_23/test/CFrontend/2003-08-29-StructLayoutBug.c
deleted file mode 100644
index a5f6fb106ff8..000000000000
--- a/release_23/test/CFrontend/2003-08-29-StructLayoutBug.c
+++ /dev/null
@@ -1,10 +0,0 @@
-// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
-
-struct foo {
- unsigned int I:1;
- unsigned char J[1];
- unsigned int K:1;
- };
-
-void test(struct foo *X) {}
-
diff --git a/release_23/test/CFrontend/2003-08-30-AggregateInitializer.c b/release_23/test/CFrontend/2003-08-30-AggregateInitializer.c
deleted file mode 100644
index 58c77b6aa04f..000000000000
--- a/release_23/test/CFrontend/2003-08-30-AggregateInitializer.c
+++ /dev/null
@@ -1,16 +0,0 @@
-// RUN: %llvmgcc -S %s -o /dev/null
-
-struct istruct {
- unsigned char C;
-};
-
-struct foo {
- unsigned int I:1;
- struct istruct J;
- unsigned char L[1];
- unsigned int K:1;
-};
-
-struct foo F = { 1, { 7 }, { 123 } , 1 };
-
-
diff --git a/release_23/test/CFrontend/2003-08-30-LargeIntegerBitfieldMember.c b/release_23/test/CFrontend/2003-08-30-LargeIntegerBitfieldMember.c
deleted file mode 100644
index f67aee4c10fb..000000000000
--- a/release_23/test/CFrontend/2003-08-30-LargeIntegerBitfieldMember.c
+++ /dev/null
@@ -1,9 +0,0 @@
-// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
-
-struct foo {
- unsigned int I:1;
- unsigned char J[1][123];
- unsigned int K:1;
- };
-
-struct foo F;
diff --git a/release_23/test/CFrontend/2003-09-18-BitfieldTests.c b/release_23/test/CFrontend/2003-09-18-BitfieldTests.c
deleted file mode 100644
index 3a7879bfb5c0..000000000000
--- a/release_23/test/CFrontend/2003-09-18-BitfieldTests.c
+++ /dev/null
@@ -1,30 +0,0 @@
-// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
-
-
-typedef struct BF {
- int A : 1;
- char B;
- int C : 13;
-} BF;
-
-char *test1(BF *b) {
- return &b->B; // Must be able to address non-bitfield
-}
-
-void test2(BF *b) { // Increment and decrement operators
- b->A++;
- --b->C;
-}
-
-void test3(BF *b) {
- b->C = 12345; // Store
-}
-
-int test4(BF *b) {
- return b->C; // Load
-}
-
-void test5(BF *b, int i) { // array ref
- b[i].C = 12345;
-}
-
diff --git a/release_23/test/CFrontend/2003-09-30-StructLayout.c b/release_23/test/CFrontend/2003-09-30-StructLayout.c
deleted file mode 100644
index 3a4016606ec7..000000000000
--- a/release_23/test/CFrontend/2003-09-30-StructLayout.c
+++ /dev/null
@@ -1,18 +0,0 @@
-// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
-
-enum En {
- ENUM_VAL
-};
-
-struct St {
- unsigned char A;
- enum En B;
- unsigned char C;
- enum En D;
- float E;
-};
-
-
-void func(struct St* A) {
- A->D = ENUM_VAL;
-}
diff --git a/release_23/test/CFrontend/2003-10-02-UnionLValueError.c b/release_23/test/CFrontend/2003-10-02-UnionLValueError.c
deleted file mode 100644
index 732f93a77311..000000000000
--- a/release_23/test/CFrontend/2003-10-02-UnionLValueError.c
+++ /dev/null
@@ -1,11 +0,0 @@
-// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
-
-union U{
- int i[8];
- char s[80];
-};
-
-void format_message(char *buffer, union U *u) {
- sprintf(buffer, u->s);
-}
-
diff --git a/release_23/test/CFrontend/2003-10-06-NegateExprType.c b/release_23/test/CFrontend/2003-10-06-NegateExprType.c
deleted file mode 100644
index 02386031b71f..000000000000
--- a/release_23/test/CFrontend/2003-10-06-NegateExprType.c
+++ /dev/null
@@ -1,8 +0,0 @@
-// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
-
-
-extern int A[10];
-void Func(int *B) {
- B - &A[5];
-}
-
diff --git a/release_23/test/CFrontend/2003-10-09-UnionInitializerBug.c b/release_23/test/CFrontend/2003-10-09-UnionInitializerBug.c
deleted file mode 100644
index 90dbd37f0d61..000000000000
--- a/release_23/test/CFrontend/2003-10-09-UnionInitializerBug.c
+++ /dev/null
@@ -1,17 +0,0 @@
-// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
-
-struct Foo {
- unsigned a;
- unsigned b;
- unsigned c;
-};
-
-struct Bar {
- union {
- void **a;
- struct Foo b;
- }u;
-};
-
-struct Bar test = {0};
-
diff --git a/release_23/test/CFrontend/2003-10-28-ident.c b/release_23/test/CFrontend/2003-10-28-ident.c
deleted file mode 100644
index 9911dfd1ffe0..000000000000
--- a/release_23/test/CFrontend/2003-10-28-ident.c
+++ /dev/null
@@ -1,4 +0,0 @@
-// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
-
-
-#ident "foo"
diff --git a/release_23/test/CFrontend/2003-10-29-AsmRename.c b/release_23/test/CFrontend/2003-10-29-AsmRename.c
deleted file mode 100644
index 5750cedd026a..000000000000
--- a/release_23/test/CFrontend/2003-10-29-AsmRename.c
+++ /dev/null
@@ -1,22 +0,0 @@
-// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
-
-
-struct foo { int X; };
-struct bar { int Y; };
-
-extern int Func(struct foo*) __asm__("Func64");
-extern int Func64(struct bar*);
-
-int Func(struct foo *F) {
- return 1;
-}
-
-int Func64(struct bar* B) {
- return 0;
-}
-
-
-int test() {
- Func(0); /* should be renamed to call Func64 */
- Func64(0);
-}
diff --git a/release_23/test/CFrontend/2003-11-01-C99-CompoundLiteral.c b/release_23/test/CFrontend/2003-11-01-C99-CompoundLiteral.c
deleted file mode 100644
index a0aa69858cf1..000000000000
--- a/release_23/test/CFrontend/2003-11-01-C99-CompoundLiteral.c
+++ /dev/null
@@ -1,8 +0,0 @@
-// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
-
-typedef struct { int foo; } spinlock_t;
-typedef struct wait_queue_head_t { spinlock_t lock; } wait_queue_head_t;
-void call_usermodehelper(void) {
- struct wait_queue_head_t work = { lock: (spinlock_t) { 0 }, };
-}
-
diff --git a/release_23/test/CFrontend/2003-11-01-EmptyStructCrash.c b/release_23/test/CFrontend/2003-11-01-EmptyStructCrash.c
deleted file mode 100644
index fb6993bb209f..000000000000
--- a/release_23/test/CFrontend/2003-11-01-EmptyStructCrash.c
+++ /dev/null
@@ -1,6 +0,0 @@
-// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
-
-typedef struct { } the_coolest_struct_in_the_world;
-extern the_coolest_struct_in_the_world xyzzy;
-void *foo() { return &xyzzy; }
-
diff --git a/release_23/test/CFrontend/2003-11-01-GlobalUnionInit.c b/release_23/test/CFrontend/2003-11-01-GlobalUnionInit.c
deleted file mode 100644
index be7788d1abb5..000000000000
--- a/release_23/test/CFrontend/2003-11-01-GlobalUnionInit.c
+++ /dev/null
@@ -1,7 +0,0 @@
-// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
-
-union bdflush_param {
- struct { int x; } b_un;
- int y[1];
-} bdf_prm = {{30}};
-
diff --git a/release_23/test/CFrontend/2003-11-03-AddrArrayElement.c.tr b/release_23/test/CFrontend/2003-11-03-AddrArrayElement.c.tr
deleted file mode 100644
index ed3fc1a6cb42..000000000000
--- a/release_23/test/CFrontend/2003-11-03-AddrArrayElement.c.tr
+++ /dev/null
@@ -1,11 +0,0 @@
-// RUN: %llvmgcc -xc %s -c -o - | llvm-dis | grep getelementptr
-
-// This should be turned into a tasty getelementptr instruction, not a nasty
-// series of casts and address arithmetic.
-
-char Global[100];
-
-char *test1(unsigned i) {
- return &Global[i];
-}
-
diff --git a/release_23/test/CFrontend/2003-11-04-EmptyStruct.c b/release_23/test/CFrontend/2003-11-04-EmptyStruct.c
deleted file mode 100644
index c7a016415910..000000000000
--- a/release_23/test/CFrontend/2003-11-04-EmptyStruct.c
+++ /dev/null
@@ -1,6 +0,0 @@
-// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
-
-typedef struct { } rwlock_t;
-struct fs_struct { rwlock_t lock; int umask; };
-void __copy_fs_struct(struct fs_struct *fs) { fs->lock = (rwlock_t) { }; }
-
diff --git a/release_23/test/CFrontend/2003-11-04-OutOfMemory.c b/release_23/test/CFrontend/2003-11-04-OutOfMemory.c
deleted file mode 100644
index 6a42e160f279..000000000000
--- a/release_23/test/CFrontend/2003-11-04-OutOfMemory.c
+++ /dev/null
@@ -1,9 +0,0 @@
-// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
-
-void schedule_timeout(signed long timeout)
-{
- switch (timeout)
- {
- case ((long)(~0UL>>1)): break;
- }
-}
diff --git a/release_23/test/CFrontend/2003-11-08-PointerSubNotGetelementptr.c.tr b/release_23/test/CFrontend/2003-11-08-PointerSubNotGetelementptr.c.tr
deleted file mode 100644
index 443dfbdb37fc..000000000000
--- a/release_23/test/CFrontend/2003-11-08-PointerSubNotGetelementptr.c.tr
+++ /dev/null
@@ -1,9 +0,0 @@
-// RUN: %llvmgcc -xc %s -c -o - | llvm-dis | grep getelementptr
-
-char *test(char* C) {
- return C-1; // Should turn into a GEP
-}
-
-int *test2(int* I) {
- return I-1;
-}
diff --git a/release_23/test/CFrontend/2003-11-12-VoidString.c b/release_23/test/CFrontend/2003-11-12-VoidString.c
deleted file mode 100644
index db2e84bbbbcf..000000000000
--- a/release_23/test/CFrontend/2003-11-12-VoidString.c
+++ /dev/null
@@ -1,4 +0,0 @@
-// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
-
-void query_newnamebuf(void) { ((void)"query_newnamebuf"); }
-
diff --git a/release_23/test/CFrontend/2003-11-13-TypeSafety.c.tr b/release_23/test/CFrontend/2003-11-13-TypeSafety.c.tr
deleted file mode 100644
index 128b767e22da..000000000000
--- a/release_23/test/CFrontend/2003-11-13-TypeSafety.c.tr
+++ /dev/null
@@ -1,5 +0,0 @@
-// RUN: %llvmgcc -xc %s -c -o - | llvm-dis | grep getelementptr
-
-int *test(int *X, int Y) {
- return X + Y;
-}
diff --git a/release_23/test/CFrontend/2003-11-16-StaticArrayInit.c b/release_23/test/CFrontend/2003-11-16-StaticArrayInit.c
deleted file mode 100644
index 2b42e38dc9ae..000000000000
--- a/release_23/test/CFrontend/2003-11-16-StaticArrayInit.c
+++ /dev/null
@@ -1,8 +0,0 @@
-// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
-
-void bar () {
- static char x[10];
- static char *xend = x + 10;
-}
-
-
diff --git a/release_23/test/CFrontend/2003-11-18-CondExprLValue.c b/release_23/test/CFrontend/2003-11-18-CondExprLValue.c
deleted file mode 100644
index ec000a443d90..000000000000
--- a/release_23/test/CFrontend/2003-11-18-CondExprLValue.c
+++ /dev/null
@@ -1,9 +0,0 @@
-// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
-
-typedef struct { unsigned long pgprot; } pgprot_t;
-
-void split_large_page(unsigned long addr, pgprot_t prot)
-{
- (addr ? prot : ((pgprot_t) { 0x001 } )).pgprot;
-}
-
diff --git a/release_23/test/CFrontend/2003-11-19-AddressOfRegister.c.tr b/release_23/test/CFrontend/2003-11-19-AddressOfRegister.c.tr
deleted file mode 100644
index 69dc54d9289c..000000000000
--- a/release_23/test/CFrontend/2003-11-19-AddressOfRegister.c.tr
+++ /dev/null
@@ -1,12 +0,0 @@
-// RUN: %llvmgcc -xc %s -S -o /dev/null |& not grep warning
-
-struct item {
- short delta[4];
-};
-
-int TEST(int nt) {
- register struct item *aa;
- aa[nt].delta;
- return 1;
-}
-
diff --git a/release_23/test/CFrontend/2003-11-19-BitFieldArray.c b/release_23/test/CFrontend/2003-11-19-BitFieldArray.c
deleted file mode 100644
index 9d54112e86e2..000000000000
--- a/release_23/test/CFrontend/2003-11-19-BitFieldArray.c
+++ /dev/null
@@ -1,12 +0,0 @@
-// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
-
-struct _GIOChannel {
- int write_buf;
- char partial_write_buf[6];
- int d :1;
-};
-
-void g_io_channel_init (struct _GIOChannel *channel) {
- channel->partial_write_buf[0];
-}
-
diff --git a/release_23/test/CFrontend/2003-11-20-Bitfields.c b/release_23/test/CFrontend/2003-11-20-Bitfields.c
deleted file mode 100644
index c9ea0dc7f1ec..000000000000
--- a/release_23/test/CFrontend/2003-11-20-Bitfields.c
+++ /dev/null
@@ -1,12 +0,0 @@
-// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
-
-struct face_cachel {
- unsigned int reverse :1;
- unsigned char font_specified[1];
-};
-
-void
-ensure_face_cachel_contains_charset (struct face_cachel *cachel) {
- cachel->font_specified[0] = 0;
-}
-
diff --git a/release_23/test/CFrontend/2003-11-20-ComplexDivision.c b/release_23/test/CFrontend/2003-11-20-ComplexDivision.c
deleted file mode 100644
index cd548c0313fc..000000000000
--- a/release_23/test/CFrontend/2003-11-20-ComplexDivision.c
+++ /dev/null
@@ -1,7 +0,0 @@
-// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
-
-int test() {
- __complex__ double C;
- double D;
- C / D;
-}
diff --git a/release_23/test/CFrontend/2003-11-20-UnionBitfield.c b/release_23/test/CFrontend/2003-11-20-UnionBitfield.c
deleted file mode 100644
index 12e7df5890aa..000000000000
--- a/release_23/test/CFrontend/2003-11-20-UnionBitfield.c
+++ /dev/null
@@ -1,12 +0,0 @@
-// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
-
-struct printf_spec {
- unsigned int minus_flag:1;
- char converter;
-};
-
-void parse_doprnt_spec () {
- struct printf_spec spec;
- spec.minus_flag = 1;
-}
-
diff --git a/release_23/test/CFrontend/2003-11-26-PointerShift.c b/release_23/test/CFrontend/2003-11-26-PointerShift.c
deleted file mode 100644
index 079f6903a233..000000000000
--- a/release_23/test/CFrontend/2003-11-26-PointerShift.c
+++ /dev/null
@@ -1,6 +0,0 @@
-// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
-
-unsigned long do_csum(const unsigned char *buff, int len, unsigned long result) {
- if (2 & (unsigned long) buff) result += 1;
- return result;
-}
diff --git a/release_23/test/CFrontend/2003-11-27-ConstructorCast.c b/release_23/test/CFrontend/2003-11-27-ConstructorCast.c
deleted file mode 100644
index 3780e7a4b97e..000000000000
--- a/release_23/test/CFrontend/2003-11-27-ConstructorCast.c
+++ /dev/null
@@ -1,14 +0,0 @@
-// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
-
-struct i387_soft_struct {
- long cwd;
-};
-union i387_union {
- struct i387_soft_struct soft;
-};
-struct thread_struct {
- union i387_union i387;
-};
-void _init_task_union(void) {
- struct thread_struct thread = (struct thread_struct) { {{0}} };
-}
diff --git a/release_23/test/CFrontend/2003-11-27-UnionCtorInitialization.c b/release_23/test/CFrontend/2003-11-27-UnionCtorInitialization.c
deleted file mode 100644
index 472b59158536..000000000000
--- a/release_23/test/CFrontend/2003-11-27-UnionCtorInitialization.c
+++ /dev/null
@@ -1,16 +0,0 @@
-// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
-
-struct i387_soft_struct {
- long cwd;
- long twd;
- long fip;
-};
-union i387_union {
- struct i387_soft_struct soft;
-};
-struct thread_struct {
- union i387_union i387;
-};
-void _init_task_union(void) {
- struct thread_struct thread = (struct thread_struct) { {{0}} };
-}
diff --git a/release_23/test/CFrontend/2003-12-14-ExternInlineSupport.c.tr b/release_23/test/CFrontend/2003-12-14-ExternInlineSupport.c.tr
deleted file mode 100644
index fb92ec773c1a..000000000000
--- a/release_23/test/CFrontend/2003-12-14-ExternInlineSupport.c.tr
+++ /dev/null
@@ -1,3 +0,0 @@
-// RUN: %llvmgcc -xc %s -c -o - | llvm-dis | not grep dead_function
-
-extern __inline__ void dead_function() {}
diff --git a/release_23/test/CFrontend/2004-01-01-UnknownInitSize.c b/release_23/test/CFrontend/2004-01-01-UnknownInitSize.c
deleted file mode 100644
index b26b6cd87560..000000000000
--- a/release_23/test/CFrontend/2004-01-01-UnknownInitSize.c
+++ /dev/null
@@ -1,14 +0,0 @@
-// RUN: %llvmgcc -S %s -o /dev/null
-
-/*
- * This regression test ensures that the C front end can compile initializers
- * even when it cannot determine the size (as below).
-*/
-struct one
-{
- int a;
- int values [];
-};
-
-struct one hobbit = {5, {1, 2, 3}};
-
diff --git a/release_23/test/CFrontend/2004-01-08-ExternInlineRedefine.c b/release_23/test/CFrontend/2004-01-08-ExternInlineRedefine.c
deleted file mode 100644
index b3907ee9933b..000000000000
--- a/release_23/test/CFrontend/2004-01-08-ExternInlineRedefine.c
+++ /dev/null
@@ -1,14 +0,0 @@
-// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
-
-
-extern __inline long int
-__strtol_l (int a)
-{
- return 0;
-}
-
-long int
-__strtol_l (int a)
-{
- return 0;
-}
diff --git a/release_23/test/CFrontend/2004-02-12-LargeAggregateCopy.c.tr b/release_23/test/CFrontend/2004-02-12-LargeAggregateCopy.c.tr
deleted file mode 100644
index b3c9bcf38108..000000000000
--- a/release_23/test/CFrontend/2004-02-12-LargeAggregateCopy.c.tr
+++ /dev/null
@@ -1,8 +0,0 @@
-// RUN: %llvmgcc -xc %s -c -o - | llvm-dis | grep llvm.memcpy
-
-struct X { int V[10000]; };
-struct X Global1, Global2;
-void test() {
- Global2 = Global1;
-}
-
diff --git a/release_23/test/CFrontend/2004-02-13-BuiltinFrameReturnAddress.c.tr b/release_23/test/CFrontend/2004-02-13-BuiltinFrameReturnAddress.c.tr
deleted file mode 100644
index 162d32a658c0..000000000000
--- a/release_23/test/CFrontend/2004-02-13-BuiltinFrameReturnAddress.c.tr
+++ /dev/null
@@ -1,8 +0,0 @@
-// RUN: %llvmgcc -xc %s -c -o - | llvm-dis | grep llvm.*address | count 4
-
-void *test1() {
- return __builtin_return_address(1);
-}
-void *test2() {
- return __builtin_frame_address(0);
-}
diff --git a/release_23/test/CFrontend/2004-02-13-IllegalVararg.c.tr b/release_23/test/CFrontend/2004-02-13-IllegalVararg.c.tr
deleted file mode 100644
index 1f3eded0cdce..000000000000
--- a/release_23/test/CFrontend/2004-02-13-IllegalVararg.c.tr
+++ /dev/null
@@ -1,11 +0,0 @@
-// RUN: %llvmgcc -xc %s -c -o - | llc
-
-#include <stdarg.h>
-
-float test(int X, ...) {
- va_list ap;
- float F;
- va_start(ap, X);
- F = va_arg(ap, float);
- return F;
-}
diff --git a/release_23/test/CFrontend/2004-02-13-Memset.c b/release_23/test/CFrontend/2004-02-13-Memset.c
deleted file mode 100644
index 89ab9b9e4c06..000000000000
--- a/release_23/test/CFrontend/2004-02-13-Memset.c
+++ /dev/null
@@ -1,6 +0,0 @@
-// RUN: %llvmgcc -xc %s -c -o - | llvm-dis | grep llvm.memset | count 3
-
-void test(int* X, char *Y) {
- memset(X, 4, 1000);
- bzero(Y, 100);
-}
diff --git a/release_23/test/CFrontend/2004-02-14-ZeroInitializer.c b/release_23/test/CFrontend/2004-02-14-ZeroInitializer.c
deleted file mode 100644
index bede9078741f..000000000000
--- a/release_23/test/CFrontend/2004-02-14-ZeroInitializer.c
+++ /dev/null
@@ -1,4 +0,0 @@
-// RUN: %llvmgcc -xc %s -S -o - | grep zeroinitializer
-
-int X[1000];
-
diff --git a/release_23/test/CFrontend/2004-02-20-Builtins.c.tr b/release_23/test/CFrontend/2004-02-20-Builtins.c.tr
deleted file mode 100644
index 82b7dc1f34cb..000000000000
--- a/release_23/test/CFrontend/2004-02-20-Builtins.c.tr
+++ /dev/null
@@ -1,6 +0,0 @@
-// RUN: %llvmgcc -O3 -xc %s -c -o - | llvm-dis | not grep builtin
-
-void zsqrtxxx(float num) {
- num = sqrt(num);
-}
-
diff --git a/release_23/test/CFrontend/2004-03-07-ComplexDivEquals.c b/release_23/test/CFrontend/2004-03-07-ComplexDivEquals.c
deleted file mode 100644
index b1da58054123..000000000000
--- a/release_23/test/CFrontend/2004-03-07-ComplexDivEquals.c
+++ /dev/null
@@ -1,6 +0,0 @@
-// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
-
-
-void test(__complex__ double D, double X) {
- D /= X;
-}
diff --git a/release_23/test/CFrontend/2004-03-07-ExternalConstant.c.tr b/release_23/test/CFrontend/2004-03-07-ExternalConstant.c.tr
deleted file mode 100644
index b8e13a35548a..000000000000
--- a/release_23/test/CFrontend/2004-03-07-ExternalConstant.c.tr
+++ /dev/null
@@ -1,7 +0,0 @@
-// RUN: %llvmgcc -xc %s -c -o - | llvm-dis | grep constant
-
-extern const int a[]; // 'a' should be marked constant even though it's external!
-int foo () {
- return a[0];
-}
-
diff --git a/release_23/test/CFrontend/2004-03-09-LargeArrayInitializers.c b/release_23/test/CFrontend/2004-03-09-LargeArrayInitializers.c
deleted file mode 100644
index 335c5684870a..000000000000
--- a/release_23/test/CFrontend/2004-03-09-LargeArrayInitializers.c
+++ /dev/null
@@ -1,32 +0,0 @@
-// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
-
-// Test that these initializers are handled efficiently
-
-int test(int x) {
- const int XX[1000] = { 0, 0 };
- const char S [1000] = "foo";
-
- const int array[] = {
- 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, 17, 23, 123, 123, 49,
- 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, 17, 23, 123, 123, 49,
- 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, 17, 23, 123, 123, 49,
- 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, 17, 23, 123, 123, 49,
- 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, 17, 23, 123, 123, 49,
- 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, 17, 23, 123, 123, 49,
- 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, 17, 23, 123, 123, 49,
- 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, 17, 23, 123, 123, 49,
- 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, 17, 23, 123, 123, 49,
- 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, 17, 23, 123, 123, 49,
- 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, 17, 23, 123, 123, 49,
- 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, 17, 23, 123, 123, 49,
- 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, 17, 23, 123, 123, 49,
- 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, 17, 23, 123, 123, 49,
- 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, 17, 23, 123, 123, 49,
- 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, 17, 23, 123, 123, 49,
- 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, 17, 23, 123, 123, 49,
- 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, 17, 23, 123, 123, 49,
- 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, 17, 23, 123, 123, 49,
- 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, 17, 23, 123, 123, 49,
- };
- return array[x];
-}
diff --git a/release_23/test/CFrontend/2004-03-15-SimpleIndirectGoto.c b/release_23/test/CFrontend/2004-03-15-SimpleIndirectGoto.c
deleted file mode 100644
index ad7221e96a00..000000000000
--- a/release_23/test/CFrontend/2004-03-15-SimpleIndirectGoto.c
+++ /dev/null
@@ -1,23 +0,0 @@
-// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
-
-int code[]={0,0,0,0,1};
-void foo(int x) {
- volatile int b;
- b = 0xffffffff;
-}
-void bar(int *pc) {
- static const void *l[] = {&&lab0, &&end};
-
- foo(0);
- goto *l[*pc];
- lab0:
- foo(0);
- pc++;
- goto *l[*pc];
- end:
- return;
-}
-int main() {
- bar(code);
- return 0;
-}
diff --git a/release_23/test/CFrontend/2004-03-16-AsmRegisterCrash.c b/release_23/test/CFrontend/2004-03-16-AsmRegisterCrash.c
deleted file mode 100644
index 6ad1cd48f3cd..000000000000
--- a/release_23/test/CFrontend/2004-03-16-AsmRegisterCrash.c
+++ /dev/null
@@ -1,6 +0,0 @@
-// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
-
-int foo() {
- register int X __asm__("ebx");
- return X;
-}
diff --git a/release_23/test/CFrontend/2004-05-07-VarArrays.c b/release_23/test/CFrontend/2004-05-07-VarArrays.c
deleted file mode 100644
index 20412983e90e..000000000000
--- a/release_23/test/CFrontend/2004-05-07-VarArrays.c
+++ /dev/null
@@ -1,5 +0,0 @@
-// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
-
-int foo(int len, char arr[][len], int X) {
- return arr[X][0];
-}
diff --git a/release_23/test/CFrontend/2004-05-21-IncompleteEnum.c b/release_23/test/CFrontend/2004-05-21-IncompleteEnum.c
deleted file mode 100644
index 3636ca74293e..000000000000
--- a/release_23/test/CFrontend/2004-05-21-IncompleteEnum.c
+++ /dev/null
@@ -1,5 +0,0 @@
-// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
-
-void test(enum foo *X) {
-}
-
diff --git a/release_23/test/CFrontend/2004-06-08-OpaqueStructArg.c b/release_23/test/CFrontend/2004-06-08-OpaqueStructArg.c
deleted file mode 100644
index ede811c38988..000000000000
--- a/release_23/test/CFrontend/2004-06-08-OpaqueStructArg.c
+++ /dev/null
@@ -1,7 +0,0 @@
-// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
-
- struct fu;
- void foo(struct fu);
- void bar() {
- foo;
- }
diff --git a/release_23/test/CFrontend/2004-06-17-UnorderedBuiltins.c b/release_23/test/CFrontend/2004-06-17-UnorderedBuiltins.c
deleted file mode 100644
index 5e02e7f325aa..000000000000
--- a/release_23/test/CFrontend/2004-06-17-UnorderedBuiltins.c
+++ /dev/null
@@ -1,24 +0,0 @@
-// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
-
-
-_Bool A, B, C, D, E, F, G, H;
-void TestF(float X, float Y) {
- A = __builtin_isgreater(X, Y);
- B = __builtin_isgreaterequal(X, Y);
- C = __builtin_isless(X, Y);
- D = __builtin_islessequal(X, Y);
- E = __builtin_islessgreater(X, Y);
- F = __builtin_isunordered(X, Y);
- //G = __builtin_isordered(X, Y); // Our current snapshot of GCC doesn't include this builtin
- H = __builtin_isunordered(X, Y);
-}
-void TestD(double X, double Y) {
- A = __builtin_isgreater(X, Y);
- B = __builtin_isgreaterequal(X, Y);
- C = __builtin_isless(X, Y);
- D = __builtin_islessequal(X, Y);
- E = __builtin_islessgreater(X, Y);
- F = __builtin_isunordered(X, Y);
- //G = __builtin_isordered(X, Y); // Our current snapshot doesn't include this builtin. FIXME
- H = __builtin_isunordered(X, Y);
-}
diff --git a/release_23/test/CFrontend/2004-06-17-UnorderedCompares.c.tr b/release_23/test/CFrontend/2004-06-17-UnorderedCompares.c.tr
deleted file mode 100644
index f91ed6687ce4..000000000000
--- a/release_23/test/CFrontend/2004-06-17-UnorderedCompares.c.tr
+++ /dev/null
@@ -1,21 +0,0 @@
-// RUN: %llvmgcc -xc -std=c99 %s -c -o - | llvm-dis | grep -v llvm.isunordered | not grep call
-
-#include <math.h>
-
-_Bool A, B, C, D, E, F;
-void TestF(float X, float Y) {
- A = __builtin_isgreater(X, Y);
- B = __builtin_isgreaterequal(X, Y);
- C = __builtin_isless(X, Y);
- D = __builtin_islessequal(X, Y);
- E = __builtin_islessgreater(X, Y);
- F = __builtin_isunordered(X, Y);
-}
-void TestD(double X, double Y) {
- A = __builtin_isgreater(X, Y);
- B = __builtin_isgreaterequal(X, Y);
- C = __builtin_isless(X, Y);
- D = __builtin_islessequal(X, Y);
- E = __builtin_islessgreater(X, Y);
- F = __builtin_isunordered(X, Y);
-}
diff --git a/release_23/test/CFrontend/2004-06-18-VariableLengthArrayOfStructures.c b/release_23/test/CFrontend/2004-06-18-VariableLengthArrayOfStructures.c
deleted file mode 100644
index e474a13b37f0..000000000000
--- a/release_23/test/CFrontend/2004-06-18-VariableLengthArrayOfStructures.c
+++ /dev/null
@@ -1,10 +0,0 @@
-// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
-
-
-struct S { };
-
-int xxxx(int a) {
- struct S comps[a];
- comps[0];
-}
-
diff --git a/release_23/test/CFrontend/2004-07-06-FunctionCast.c b/release_23/test/CFrontend/2004-07-06-FunctionCast.c
deleted file mode 100644
index 169f74036423..000000000000
--- a/release_23/test/CFrontend/2004-07-06-FunctionCast.c
+++ /dev/null
@@ -1,10 +0,0 @@
-// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
-
-static int unused_func(void) {
- return 1;
-}
-
-int foo(void) {
- (void)unused_func; /* avoid compiler warning */
- return 2;
-}
diff --git a/release_23/test/CFrontend/2004-08-06-LargeStructTest.c b/release_23/test/CFrontend/2004-08-06-LargeStructTest.c
deleted file mode 100644
index b0413b4b0cee..000000000000
--- a/release_23/test/CFrontend/2004-08-06-LargeStructTest.c
+++ /dev/null
@@ -1,19 +0,0 @@
-// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
-
-
-#define A(X) int X;
-#define B(X) A(X##0) A(X##1) A(X##2) A(X##3) A(X##4) A(X##5) A(X##6) A(X##7) \
- A(X##8) A(X##9) A(X##A) A(X##B) A(X##C) A(X##D) A(X##E) A(X##F)
-#define C(X) B(X##0) B(X##1) B(X##2) B(X##3) B(X##4) B(X##5) B(X##6) B(X##7) \
- B(X##8) B(X##9) B(X##A) B(X##B) B(X##C) B(X##D) B(X##E) B(X##F)
-
-struct foo {
- C(x); // 256
- C(y); // 256
- C(z);
-};
-
-
-int test(struct foo *F) {
- return F->xA1 + F->yFF + F->zC4;
-}
diff --git a/release_23/test/CFrontend/2004-11-25-UnnamedBitfieldPadding.c b/release_23/test/CFrontend/2004-11-25-UnnamedBitfieldPadding.c
deleted file mode 100644
index b3f4a829a9eb..000000000000
--- a/release_23/test/CFrontend/2004-11-25-UnnamedBitfieldPadding.c
+++ /dev/null
@@ -1,8 +0,0 @@
-// RUN: %llvmgcc -S %s -o /dev/null
-// This is a testcase for PR461
-typedef struct {
- unsigned min_align: 1;
- unsigned : 1;
-} addr_diff_vec_flags;
-
-addr_diff_vec_flags X;
diff --git a/release_23/test/CFrontend/2004-11-27-InvalidConstantExpr.c b/release_23/test/CFrontend/2004-11-27-InvalidConstantExpr.c
deleted file mode 100644
index ee8642fa3aa2..000000000000
--- a/release_23/test/CFrontend/2004-11-27-InvalidConstantExpr.c
+++ /dev/null
@@ -1,10 +0,0 @@
-// RUN: %llvmgcc %s -S -o - | not grep {foo\\* sub}
-// This should not produce a subtrace constantexpr of a pointer
-struct foo {
- int Y;
- char X[100];
-} F;
-
-int test(char *Y) {
- return Y - F.X;
-}
diff --git a/release_23/test/CFrontend/2004-11-27-StaticFunctionRedeclare.c b/release_23/test/CFrontend/2004-11-27-StaticFunctionRedeclare.c
deleted file mode 100644
index b1e14212732e..000000000000
--- a/release_23/test/CFrontend/2004-11-27-StaticFunctionRedeclare.c
+++ /dev/null
@@ -1,15 +0,0 @@
-// RUN: %llvmgcc -c -emit-llvm %s -o - | \
-// RUN: opt -std-compile-opts | llvm-dis | not grep {declare i32.*func}
-
-// There should not be an unresolved reference to func here. Believe it or not,
-// the "expected result" is a function named 'func' which is internal and
-// referenced by bar().
-
-// This is PR244
-
-static int func();
-void bar() {
- int func();
- foo(func);
-}
-static int func(char** A, char ** B) {}
diff --git a/release_23/test/CFrontend/2004-11-27-VariableSizeInStructure.c b/release_23/test/CFrontend/2004-11-27-VariableSizeInStructure.c
deleted file mode 100644
index bd63ae3b0122..000000000000
--- a/release_23/test/CFrontend/2004-11-27-VariableSizeInStructure.c
+++ /dev/null
@@ -1,11 +0,0 @@
-// RUN: %llvmgcc %s -S -o /dev/null
-
-// GCC allows variable sized arrays in structures, crazy!
-
-// This is PR360.
-
-int sub1(int i, char *pi) {
- typedef int foo[i];
- struct bar {foo f1; int f2;} *p = (struct bar *) pi;
- return p->f2;
-}
diff --git a/release_23/test/CFrontend/2005-01-02-ConstantInits.c b/release_23/test/CFrontend/2005-01-02-ConstantInits.c
deleted file mode 100644
index 735278e0f930..000000000000
--- a/release_23/test/CFrontend/2005-01-02-ConstantInits.c
+++ /dev/null
@@ -1,24 +0,0 @@
-// RUN: %llvmgcc %s -S -o -
-
-// This tests all kinds of hard cases with initializers and
-// array subscripts. This corresponds to PR487.
-
-struct X { int a[2]; };
-
-int test() {
- static int i23 = (int) &(((struct X *)0)->a[1]);
- return i23;
-}
-
-int i = (int) &( ((struct X *)0) -> a[1]);
-
-int Arr[100];
-
-int foo(int i) { return bar(&Arr[49])+bar(&Arr[i]); }
-int foo2(int i) {
- static const int *X = &Arr[49];
- static int i23 = (int) &( ((struct X *)0) -> a[0]);
- int *P = Arr;
- ++P;
- return bar(Arr+i);
-}
diff --git a/release_23/test/CFrontend/2005-01-02-PointerDifference.c.tr b/release_23/test/CFrontend/2005-01-02-PointerDifference.c.tr
deleted file mode 100644
index a351da2ed8c8..000000000000
--- a/release_23/test/CFrontend/2005-01-02-PointerDifference.c.tr
+++ /dev/null
@@ -1,3 +0,0 @@
-// RUN: %llvmgcc -xc %s -c -o - | llvm-dis | grep -v div
-
-int Diff(int *P, int *Q) { return P-Q; }
diff --git a/release_23/test/CFrontend/2005-01-02-VAArgError-ICE.c b/release_23/test/CFrontend/2005-01-02-VAArgError-ICE.c
deleted file mode 100644
index db8255846274..000000000000
--- a/release_23/test/CFrontend/2005-01-02-VAArgError-ICE.c
+++ /dev/null
@@ -1,10 +0,0 @@
-// This file is erroneous, but should not cause the compiler to ICE.
-// PR481
-// RUN: %llvmgcc %s -S -o /dev/null |& not grep {internal compiler error}
-
-#include <stdarg.h>
-int flags(int a, int b, ...) {
- va_list args;
- va_start(args,a); // not the last named arg
- foo(args);
-}
diff --git a/release_23/test/CFrontend/2005-02-20-AggregateSAVEEXPR.c b/release_23/test/CFrontend/2005-02-20-AggregateSAVEEXPR.c
deleted file mode 100644
index 7a9553303314..000000000000
--- a/release_23/test/CFrontend/2005-02-20-AggregateSAVEEXPR.c
+++ /dev/null
@@ -1,19 +0,0 @@
-// RUN: %llvmgcc %s -o /dev/null -S
-// Note:
-// We fail this on Sparc because the C library seems to be missing complex.h
-// and the corresponding C99 complex support.
-//
-// We could modify the test to use only GCC extensions, but I don't know if
-// that would change the nature of the test.
-//
-// XFAIL: sparc
-
-#ifdef __CYGWIN__
- #include <mingw/complex.h>
-#else
- #include <complex.h>
-#endif
-
-int foo(complex float c) {
- return creal(c);
-}
diff --git a/release_23/test/CFrontend/2005-02-27-MarkGlobalConstant.c b/release_23/test/CFrontend/2005-02-27-MarkGlobalConstant.c
deleted file mode 100644
index 4d24d0c67317..000000000000
--- a/release_23/test/CFrontend/2005-02-27-MarkGlobalConstant.c
+++ /dev/null
@@ -1,10 +0,0 @@
-// RUN: %llvmgcc -xc %s -S -o - | grep {internal constant }
-
-// The synthetic global made by the CFE for big initializer should be marked
-// constant.
-
-void bar();
-void foo() {
- char Blah[] = "asdlfkajsdlfkajsd;lfkajds;lfkjasd;flkajsd;lkfja;sdlkfjasd";
- bar(Blah);
-}
diff --git a/release_23/test/CFrontend/2005-03-05-OffsetOfHack.c b/release_23/test/CFrontend/2005-03-05-OffsetOfHack.c
deleted file mode 100644
index 8df7231df6ac..000000000000
--- a/release_23/test/CFrontend/2005-03-05-OffsetOfHack.c
+++ /dev/null
@@ -1,12 +0,0 @@
-// RUN: %llvmgcc %s -S -o -
-
-struct s {
- unsigned long int field[0];
-};
-
-#define OFFS \
- (((char *) &((struct s *) 0)->field[0]) - (char *) 0)
-
-int foo[OFFS];
-
-
diff --git a/release_23/test/CFrontend/2005-03-06-OffsetOfStructCrash.c b/release_23/test/CFrontend/2005-03-06-OffsetOfStructCrash.c
deleted file mode 100644
index 91e686280233..000000000000
--- a/release_23/test/CFrontend/2005-03-06-OffsetOfStructCrash.c
+++ /dev/null
@@ -1,14 +0,0 @@
-// RUN: %llvmgcc %s -S -o -
-
-struct Y {};
-struct XXX {
- struct Y F;
-};
-
-void test1() {
- (int)&((struct XXX*)(((void *)0)))->F;
-}
-
-void test2() {
- &((struct XXX*)(((void *)0)))->F;
-}
diff --git a/release_23/test/CFrontend/2005-03-11-Prefetch.c b/release_23/test/CFrontend/2005-03-11-Prefetch.c
deleted file mode 100644
index bf7965304f1d..000000000000
--- a/release_23/test/CFrontend/2005-03-11-Prefetch.c
+++ /dev/null
@@ -1,6 +0,0 @@
-// RUN: %llvmgcc %s -S -o - | llvm-as | llvm-dis | grep llvm.prefetch
-
-void foo(int *P) {
- __builtin_prefetch(P);
- __builtin_prefetch(P, 1);
-}
diff --git a/release_23/test/CFrontend/2005-04-09-ComplexOps.c b/release_23/test/CFrontend/2005-04-09-ComplexOps.c
deleted file mode 100644
index 2962b7455344..000000000000
--- a/release_23/test/CFrontend/2005-04-09-ComplexOps.c
+++ /dev/null
@@ -1,9 +0,0 @@
-// RUN: %llvmgcc %s -S -o -
-
-#include <math.h>
-#define I 1.0iF
-
-double __complex test(double X) { return ~-(X*I); }
-
-_Bool EQ(double __complex A, double __complex B) { return A == B; }
-_Bool NE(double __complex A, double __complex B) { return A != B; }
diff --git a/release_23/test/CFrontend/2005-05-06-CountBuiltins.c b/release_23/test/CFrontend/2005-05-06-CountBuiltins.c
deleted file mode 100644
index da40a142ae90..000000000000
--- a/release_23/test/CFrontend/2005-05-06-CountBuiltins.c
+++ /dev/null
@@ -1,17 +0,0 @@
-// RUN: %llvmgcc %s -S -o - | llvm-as | llvm-dis | not grep call.*__builtin
-
-int G, H, I;
-void foo(int P) {
- G = __builtin_clz(P);
- H = __builtin_ctz(P);
- I = __builtin_popcount(P);
-}
-
-long long g, h, i;
-void fooll(float P) {
- g = __builtin_clzll(P);
- g = __builtin_clzll(P);
- h = __builtin_ctzll(P);
- i = __builtin_popcountll(P);
-}
-
diff --git a/release_23/test/CFrontend/2005-05-10-GlobalUnionInit.c b/release_23/test/CFrontend/2005-05-10-GlobalUnionInit.c
deleted file mode 100644
index 443064c921d5..000000000000
--- a/release_23/test/CFrontend/2005-05-10-GlobalUnionInit.c
+++ /dev/null
@@ -1,6 +0,0 @@
-// RUN: %llvmgcc %s -S -o -
-
-union A { // { uint }
- union B { double *C; } D;
-} E = { { (double*)12312 } };
-
diff --git a/release_23/test/CFrontend/2005-06-15-ExpandGotoInternalProblem.c b/release_23/test/CFrontend/2005-06-15-ExpandGotoInternalProblem.c
deleted file mode 100644
index d7d03badfddf..000000000000
--- a/release_23/test/CFrontend/2005-06-15-ExpandGotoInternalProblem.c
+++ /dev/null
@@ -1,14 +0,0 @@
-// RUN: %llvmgcc -std=c99 %s -S -o - | llvm-as | \
-// RUN: opt -std-compile-opts -disable-output
-// PR580
-
-int X, Y;
-int foo() {
- int i;
- for (i=0; i<100; i++ )
- {
- break;
- i = ( X || Y ) ;
- }
-}
-
diff --git a/release_23/test/CFrontend/2005-07-20-SqrtNoErrno.c b/release_23/test/CFrontend/2005-07-20-SqrtNoErrno.c
deleted file mode 100644
index fd976a679331..000000000000
--- a/release_23/test/CFrontend/2005-07-20-SqrtNoErrno.c
+++ /dev/null
@@ -1,7 +0,0 @@
-// RUN: %llvmgcc %s -S -o - -fno-math-errno | gccas | llvm-dis | grep llvm.sqrt
-#include <math.h>
-
-float foo(float X) {
- // Check that this compiles to llvm.sqrt when errno is ignored.
- return sqrtf(X);
-}
diff --git a/release_23/test/CFrontend/2005-07-26-UnionInitCrash.c b/release_23/test/CFrontend/2005-07-26-UnionInitCrash.c
deleted file mode 100644
index 563278a9c68e..000000000000
--- a/release_23/test/CFrontend/2005-07-26-UnionInitCrash.c
+++ /dev/null
@@ -1,3 +0,0 @@
-// PR607
-// RUN: %llvmgcc %s -S -o -
-union { char bytes[8]; double alignment; }EQ1 = {0,0,0,0,0,0,0,0};
diff --git a/release_23/test/CFrontend/2005-07-28-IncorrectWeakGlobal.c b/release_23/test/CFrontend/2005-07-28-IncorrectWeakGlobal.c
deleted file mode 100644
index 1a8c409439ce..000000000000
--- a/release_23/test/CFrontend/2005-07-28-IncorrectWeakGlobal.c
+++ /dev/null
@@ -1,5 +0,0 @@
-// RUN: %llvmgcc %s -S -o - | grep TheGlobal | not grep weak
-
-extern int TheGlobal;
-int foo() { return TheGlobal; }
-int TheGlobal = 1;
diff --git a/release_23/test/CFrontend/2005-09-20-ComplexConstants.c b/release_23/test/CFrontend/2005-09-20-ComplexConstants.c
deleted file mode 100644
index db98fc2385a0..000000000000
--- a/release_23/test/CFrontend/2005-09-20-ComplexConstants.c
+++ /dev/null
@@ -1,4 +0,0 @@
-// RUN: %llvmgcc %s -S -o - | llvm-as -o /dev/null -f
-
-const double _Complex x[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
-
diff --git a/release_23/test/CFrontend/2005-09-24-AsmUserPrefix.c b/release_23/test/CFrontend/2005-09-24-AsmUserPrefix.c
deleted file mode 100644
index 9b9b153e2761..000000000000
--- a/release_23/test/CFrontend/2005-09-24-AsmUserPrefix.c
+++ /dev/null
@@ -1,8 +0,0 @@
-// RUN: %llvmgcc %s -S -o - | llvm-as | opt -std-compile-opts | llc | \
-// RUN: not grep _foo2
-
-void foo() __asm__("foo2");
-
-void bar() {
- foo();
-}
diff --git a/release_23/test/CFrontend/2005-09-24-BitFieldCrash.c b/release_23/test/CFrontend/2005-09-24-BitFieldCrash.c
deleted file mode 100644
index b4c85ffb2d83..000000000000
--- a/release_23/test/CFrontend/2005-09-24-BitFieldCrash.c
+++ /dev/null
@@ -1,33 +0,0 @@
-// RUN: %llvmgcc %s -S -o -
-
-struct tree_common {};
-
-struct tree_int_cst {
- struct tree_common common;
- struct tree_int_cst_lowhi {
- unsigned long long low;
- long long high;
- } int_cst;
-};
-
-enum XXX { yyy };
-
-struct tree_function_decl {
- struct tree_common common;
- long long locus, y;
- __extension__ enum XXX built_in_class : 2;
-
-};
-
-
-union tree_node {
- struct tree_int_cst int_cst;
- struct tree_function_decl function_decl;
-};
-
-
-void foo (union tree_node * decl) {
- decl->function_decl.built_in_class != 0;
-}
-
-
diff --git a/release_23/test/CFrontend/2005-10-18-VariableSizedElementCrash.c b/release_23/test/CFrontend/2005-10-18-VariableSizedElementCrash.c
deleted file mode 100644
index 867e4d285e60..000000000000
--- a/release_23/test/CFrontend/2005-10-18-VariableSizedElementCrash.c
+++ /dev/null
@@ -1,9 +0,0 @@
-// RUN: %llvmgcc %s -S -o -
-
-int sub1(int i, char *pi) {
- typedef int foo[i];
- struct bar {foo f1; int f2:3; int f3:4} *p = (struct bar *) pi;
- xxx(p->f1);
- return p->f3;
-}
-
diff --git a/release_23/test/CFrontend/2005-12-04-AttributeUsed.c b/release_23/test/CFrontend/2005-12-04-AttributeUsed.c
deleted file mode 100644
index 33e27e89f4c8..000000000000
--- a/release_23/test/CFrontend/2005-12-04-AttributeUsed.c
+++ /dev/null
@@ -1,8 +0,0 @@
-// RUN: %llvmgcc %s -S -emit-llvm -o - | llvm-as | llvm-dis | \
-// RUN: grep llvm.used | grep foo | grep X
-
-int X __attribute__((used));
-int Y;
-
-__attribute__((used)) void foo() {}
-
diff --git a/release_23/test/CFrontend/2005-12-04-DeclarationLineNumbers.c b/release_23/test/CFrontend/2005-12-04-DeclarationLineNumbers.c
deleted file mode 100644
index 0ced92e553f7..000000000000
--- a/release_23/test/CFrontend/2005-12-04-DeclarationLineNumbers.c
+++ /dev/null
@@ -1,23 +0,0 @@
-// RUN: %llvmgcc %s -S -g -o - | grep {llvm.dbg.stoppoint.*i32 14}
-// PR664: ensure that line #'s are emitted for declarations
-
-
-short test(short br_data_0,
-short br_data_1,
-short br_data_2,
-short br_data_3,
-short br_data_4,
-short br_data_5,
-short br_data_6,
-short br_data_7) {
-
-short sm07 = br_data_0 + br_data_7;
-short sm16 = br_data_1 + br_data_6;
-short sm25 = br_data_2 + br_data_5;
-short sm34 = br_data_3 + br_data_4;
-short s0734 = sm07 + sm34;
-short s1625 = sm16 + sm25;
-
-return s0734 + s1625;
-}
-
diff --git a/release_23/test/CFrontend/2006-01-13-Includes.c b/release_23/test/CFrontend/2006-01-13-Includes.c
deleted file mode 100644
index 46e7867a2823..000000000000
--- a/release_23/test/CFrontend/2006-01-13-Includes.c
+++ /dev/null
@@ -1,9 +0,0 @@
-// RUN: %llvmgcc %s -g -S -o - | llvm-as | opt -std-compile-opts | \
-// RUN: llvm-dis | grep {test/CFrontend}
-// PR676
-
-#include <stdio.h>
-
-void test() {
- printf("Hello World\n");
-}
diff --git a/release_23/test/CFrontend/2006-01-13-StackSave.c b/release_23/test/CFrontend/2006-01-13-StackSave.c
deleted file mode 100644
index dfe00fbde330..000000000000
--- a/release_23/test/CFrontend/2006-01-13-StackSave.c
+++ /dev/null
@@ -1,11 +0,0 @@
-// PR691
-// RUN: %llvmgcc %s -S -o - | llvm-as | opt -std-compile-opts | \
-// RUN: llvm-dis | grep llvm.stacksave
-
-void test(int N) {
- int i;
- for (i = 0; i < N; ++i) {
- int VLA[i];
- external(VLA);
- }
-}
diff --git a/release_23/test/CFrontend/2006-01-16-BitCountIntrinsicsUnsigned.c b/release_23/test/CFrontend/2006-01-16-BitCountIntrinsicsUnsigned.c
deleted file mode 100644
index 598ffb5132c0..000000000000
--- a/release_23/test/CFrontend/2006-01-16-BitCountIntrinsicsUnsigned.c
+++ /dev/null
@@ -1,9 +0,0 @@
-// RUN: %llvmgcc -S %s -o - | grep {llvm.ctlz.i32( i32} | count 2
-// RUN: %llvmgcc -S %s -o - | grep {llvm.ctlz.i32(i32} | count 1
-
-unsigned t2(unsigned X) {
- return __builtin_clz(X);
-}
-int t1(int X) {
- return __builtin_clz(X);
-}
diff --git a/release_23/test/CFrontend/2006-01-23-FileScopeAsm.c b/release_23/test/CFrontend/2006-01-23-FileScopeAsm.c
deleted file mode 100644
index fb55a41e87c5..000000000000
--- a/release_23/test/CFrontend/2006-01-23-FileScopeAsm.c
+++ /dev/null
@@ -1,8 +0,0 @@
-// RUN: %llvmgcc %s -S -o - | llvm-as | opt -std-compile-opts | \
-// RUN: llvm-dis | grep {foo\[12345\]} | count 5
-
-__asm__ ("foo1");
-__asm__ ("foo2");
-__asm__ ("foo3");
-__asm__ ("foo4");
-__asm__ ("foo5");
diff --git a/release_23/test/CFrontend/2006-03-03-MissingInitializer.c b/release_23/test/CFrontend/2006-03-03-MissingInitializer.c
deleted file mode 100644
index 0d09d297d191..000000000000
--- a/release_23/test/CFrontend/2006-03-03-MissingInitializer.c
+++ /dev/null
@@ -1,11 +0,0 @@
-// RUN: %llvmgcc %s -S -o - | llvm-as | opt -std-compile-opts | \
-// RUN: llvm-dis | grep {@nate.*internal global i32 0}
-
-struct X { int *XX; int Y;};
-
-void foo() {
- static int nate = 0;
- struct X bob = { &nate, 14 };
- bar(&bob);
-}
-
diff --git a/release_23/test/CFrontend/2006-03-16-VectorCtor.c b/release_23/test/CFrontend/2006-03-16-VectorCtor.c
deleted file mode 100644
index b95593b12147..000000000000
--- a/release_23/test/CFrontend/2006-03-16-VectorCtor.c
+++ /dev/null
@@ -1,10 +0,0 @@
-// Test that basic generic vector support works
-// RUN: %llvmgcc %s -S -o -
-
-typedef int v4si __attribute__ ((__vector_size__ (16)));
-void test(v4si *P, v4si *Q, float X) {
- *P = (v4si){ X, X, X, X } * *Q;
-}
-
-v4si G = (v4si){ 0.1, 1.2, 4.2, 17.2 };
-
diff --git a/release_23/test/CFrontend/2006-03-17-KnRMismatch.c b/release_23/test/CFrontend/2006-03-17-KnRMismatch.c
deleted file mode 100644
index 19391122fcad..000000000000
--- a/release_23/test/CFrontend/2006-03-17-KnRMismatch.c
+++ /dev/null
@@ -1,8 +0,0 @@
-// RUN: %llvmgcc %s -S -o -
-
-void regnode(int op);
-
-void regnode(op)
-char op;
-{
-}
diff --git a/release_23/test/CFrontend/2006-05-01-AppleAlignmentPragma.c b/release_23/test/CFrontend/2006-05-01-AppleAlignmentPragma.c
deleted file mode 100644
index c9050aa9e4e4..000000000000
--- a/release_23/test/CFrontend/2006-05-01-AppleAlignmentPragma.c
+++ /dev/null
@@ -1,12 +0,0 @@
-// RUN: %llvmgcc %s -S -o -
-
-#ifdef __APPLE__
-/* test that X is layed out correctly when this pragma is used. */
-#pragma options align=mac68k
-#endif
-
-struct S {
- unsigned A;
- unsigned short B;
-} X;
-
diff --git a/release_23/test/CFrontend/2006-05-19-SingleEltReturn.c b/release_23/test/CFrontend/2006-05-19-SingleEltReturn.c
deleted file mode 100644
index 70c94c620527..000000000000
--- a/release_23/test/CFrontend/2006-05-19-SingleEltReturn.c
+++ /dev/null
@@ -1,23 +0,0 @@
-// Test returning a single element aggregate value containing a double.
-// RUN: %llvmgcc %s -S -o -
-
-struct X {
- double D;
-};
-
-struct Y {
- struct X x;
-};
-
-struct Y bar();
-
-void foo(struct Y *P) {
- *P = bar();
-}
-
-struct Y bar() {
- struct Y a;
- a.x.D = 0;
- return a;
-}
-
diff --git a/release_23/test/CFrontend/2006-07-31-PR854.c b/release_23/test/CFrontend/2006-07-31-PR854.c
deleted file mode 100644
index 516085ae48f5..000000000000
--- a/release_23/test/CFrontend/2006-07-31-PR854.c
+++ /dev/null
@@ -1,11 +0,0 @@
-// RUN: %llvmgcc %s -S -o -
-// PR854
- struct kernel_symbol {
- unsigned long value;
- };
- unsigned long loops_per_jiffy = (1<<12);
- static const char __kstrtab_loops_per_jiffy[]
-__attribute__((section("__ksymtab_strings"))) = "loops_per_jiffy";
- static const struct kernel_symbol __ksymtab_loops_per_jiffy
-__attribute__((__used__)) __attribute__((section("__ksymtab"))) = { (unsigned
-long)&loops_per_jiffy, __kstrtab_loops_per_jiffy };
diff --git a/release_23/test/CFrontend/2006-09-11-BitfieldRefCrash.c b/release_23/test/CFrontend/2006-09-11-BitfieldRefCrash.c
deleted file mode 100644
index d06cc3afbf3d..000000000000
--- a/release_23/test/CFrontend/2006-09-11-BitfieldRefCrash.c
+++ /dev/null
@@ -1,12 +0,0 @@
-// RUN: %llvmgcc %s -S -o -
-// PR906
-
-struct state_struct {
- unsigned long long phys_frame: 50;
- unsigned valid : 2;
-} s;
-
-int mem_access(struct state_struct *p) {
- return p->valid;
-}
-
diff --git a/release_23/test/CFrontend/2006-09-18-fwrite-cast-crash.c b/release_23/test/CFrontend/2006-09-18-fwrite-cast-crash.c
deleted file mode 100644
index 8ba20520714e..000000000000
--- a/release_23/test/CFrontend/2006-09-18-fwrite-cast-crash.c
+++ /dev/null
@@ -1,13 +0,0 @@
-// RUN: %llvmgcc %s -S -o -
-// PR910
-
-struct l_struct_2E_FILE { char x; };
-unsigned fwrite(signed char *, unsigned , unsigned , signed char *);
-static signed char str301[39];
-static void Usage(signed char *ltmp_611_6) {
- struct l_struct_2E_FILE *ltmp_6202_16;
- unsigned ltmp_6203_92;
- ltmp_6203_92 = /*tail*/ ((unsigned (*) (signed char *, unsigned , unsigned ,
-struct l_struct_2E_FILE *))(void*)fwrite)((&(str301[0u])), 38u, 1u, ltmp_6202_16);
-}
-
diff --git a/release_23/test/CFrontend/2006-09-21-IncompleteElementType.c b/release_23/test/CFrontend/2006-09-21-IncompleteElementType.c
deleted file mode 100644
index a5091821cb69..000000000000
--- a/release_23/test/CFrontend/2006-09-21-IncompleteElementType.c
+++ /dev/null
@@ -1,3 +0,0 @@
-// RUN: not %llvmgcc %s -S -o /dev/null |& not grep {internal compiler error}
-
-struct A X[(927 - 37) / sizeof(struct A)];
diff --git a/release_23/test/CFrontend/2006-09-25-DebugFilename.c b/release_23/test/CFrontend/2006-09-25-DebugFilename.c
deleted file mode 100644
index eea52ba7608c..000000000000
--- a/release_23/test/CFrontend/2006-09-25-DebugFilename.c
+++ /dev/null
@@ -1,6 +0,0 @@
-// RUN: not %llvmgcc -xc %s -S -o /dev/null |& \
-// RUN: grep fluffy | grep 2006-09-25-DebugFilename.c
-#include "2006-09-25-DebugFilename.h"
-int func1() { return hfunc1(); }
-int func2() { fluffy; return hfunc1(); }
-
diff --git a/release_23/test/CFrontend/2006-09-25-DebugFilename.h b/release_23/test/CFrontend/2006-09-25-DebugFilename.h
deleted file mode 100644
index 9b03666b3c27..000000000000
--- a/release_23/test/CFrontend/2006-09-25-DebugFilename.h
+++ /dev/null
@@ -1,6 +0,0 @@
-extern int exfunc(int a);
-
-static inline int hfunc1()
-{
- return exfunc(1);
-}
diff --git a/release_23/test/CFrontend/2006-09-28-SimpleAsm.c b/release_23/test/CFrontend/2006-09-28-SimpleAsm.c
deleted file mode 100644
index e3040200a60b..000000000000
--- a/release_23/test/CFrontend/2006-09-28-SimpleAsm.c
+++ /dev/null
@@ -1,10 +0,0 @@
-// RUN: %llvmgcc %s -S -o - | grep {ext: xorl %eax, eax; movl}
-// RUN: %llvmgcc %s -S -o - | grep {nonext: xorl %eax, %eax; mov}
-// PR924
-
-void bar() {
- // Extended asm
- asm volatile ("ext: xorl %%eax, eax; movl eax, fs; movl eax, gs %%blah %= %% " : : "r"(1));
- // Non-extended asm.
- asm volatile ("nonext: xorl %eax, %eax; movl %eax, %fs; movl %eax, %gs %%blah %= %% ");
-}
diff --git a/release_23/test/CFrontend/2006-10-30-ArrayCrash.c b/release_23/test/CFrontend/2006-10-30-ArrayCrash.c
deleted file mode 100644
index 09464dd3a067..000000000000
--- a/release_23/test/CFrontend/2006-10-30-ArrayCrash.c
+++ /dev/null
@@ -1,17 +0,0 @@
-// RUN: %llvmgcc -O3 -S -o - %s
-// PR954, PR911
-
-extern void foo();
-
-struct S {
- short f1[3];
- unsigned int f2 : 1;
-};
-
-void bar()
-{
- struct S *A;
-
- if (A->f2)
- foo();
-}
diff --git a/release_23/test/CFrontend/2006-12-14-ordered_expr.c b/release_23/test/CFrontend/2006-12-14-ordered_expr.c
deleted file mode 100644
index 8ff2eb607210..000000000000
--- a/release_23/test/CFrontend/2006-12-14-ordered_expr.c
+++ /dev/null
@@ -1,6 +0,0 @@
-// RUN: %llvmgcc -O3 -S %s -o - | grep {fcmp ord float %X, %Y}
-
-int test2(float X, float Y) {
- return !__builtin_isunordered(X, Y);
-}
-
diff --git a/release_23/test/CFrontend/2007-01-06-KNR-Proto.c b/release_23/test/CFrontend/2007-01-06-KNR-Proto.c
deleted file mode 100644
index eb2f25482d9d..000000000000
--- a/release_23/test/CFrontend/2007-01-06-KNR-Proto.c
+++ /dev/null
@@ -1,10 +0,0 @@
-// RUN: %llvmgcc -S -o - -emit-llvm %s
-// PR1083
-
-int svc_register (void (*dispatch) (int));
-
-int svc_register (dispatch)
- void (*dispatch) ();
-{
-}
-
diff --git a/release_23/test/CFrontend/2007-01-20-VectorICE.c b/release_23/test/CFrontend/2007-01-20-VectorICE.c
deleted file mode 100644
index c2dcdef19443..000000000000
--- a/release_23/test/CFrontend/2007-01-20-VectorICE.c
+++ /dev/null
@@ -1,11 +0,0 @@
-// RUN: %llvmgcc %s -S -o -
-
-typedef float __m128 __attribute__((__vector_size__(16)));
-typedef long long __v2di __attribute__((__vector_size__(16)));
-typedef int __v4si __attribute__((__vector_size__(16)));
-
-__v2di bar(void);
-void foo(int X, __v4si *P) {
- *P = X == 2 ? bar() : bar();
-}
-
diff --git a/release_23/test/CFrontend/2007-01-24-InlineAsmCModifier.c b/release_23/test/CFrontend/2007-01-24-InlineAsmCModifier.c
deleted file mode 100644
index 5735cce11e33..000000000000
--- a/release_23/test/CFrontend/2007-01-24-InlineAsmCModifier.c
+++ /dev/null
@@ -1,10 +0,0 @@
-// Verify that the %c modifier works and strips off any prefixes from
-// immediates.
-// RUN: %llvmgcc -S %s -o - | llvm-as | llc | grep {pickANumber: 789514}
-
-void foo() {
- __asm__ volatile("/* " "pickANumber" ": %c0 */"::"i"(0xC0C0A));
-
- // Check that non-c modifiers work also (not greped for above).
- __asm__ volatile("/* " "pickANumber2 " ": %0 */"::"i"(123));
-}
diff --git a/release_23/test/CFrontend/2007-02-04-AddrLValue-2.c b/release_23/test/CFrontend/2007-02-04-AddrLValue-2.c
deleted file mode 100644
index 90251e6debdf..000000000000
--- a/release_23/test/CFrontend/2007-02-04-AddrLValue-2.c
+++ /dev/null
@@ -1,13 +0,0 @@
-// RUN: %llvmgcc %s -O3 -S -o - -emit-llvm
-// PR1173
-
-struct S { char s; };
-struct T { struct S t; };
-
-struct S *const p = &((struct T * const) (0x4000))->t;
-
-void
-foo (void)
-{
- p->s = 0;
-}
diff --git a/release_23/test/CFrontend/2007-02-04-AddrLValue.c b/release_23/test/CFrontend/2007-02-04-AddrLValue.c
deleted file mode 100644
index c8b65a946f5e..000000000000
--- a/release_23/test/CFrontend/2007-02-04-AddrLValue.c
+++ /dev/null
@@ -1,23 +0,0 @@
-// RUN: %llvmgcc %s -O3 -S -o - -emit-llvm
-// PR1176
-
-typedef struct
-{
- char *key;
- char *value;
-} T1;
-
-typedef struct
-{
- long type;
- char *value;
-} T3;
-
-T1 a[] =
-{
- {
- "",
- ((char *)&((T3) {1, (char *) 1}))
- }
-};
-
diff --git a/release_23/test/CFrontend/2007-02-04-EmptyStruct.c b/release_23/test/CFrontend/2007-02-04-EmptyStruct.c
deleted file mode 100644
index 48ad31f7c3fd..000000000000
--- a/release_23/test/CFrontend/2007-02-04-EmptyStruct.c
+++ /dev/null
@@ -1,9 +0,0 @@
-// RUN: %llvmgcc %s -O3 -S -o - -emit-llvm
-// PR1175
-
-struct empty { };
-
-void foo(struct empty *p) {
- p++;
-}
-
diff --git a/release_23/test/CFrontend/2007-02-04-WITH_SIZE_EXPR.c b/release_23/test/CFrontend/2007-02-04-WITH_SIZE_EXPR.c
deleted file mode 100644
index f02a44b15733..000000000000
--- a/release_23/test/CFrontend/2007-02-04-WITH_SIZE_EXPR.c
+++ /dev/null
@@ -1,21 +0,0 @@
-// RUN: %llvmgcc %s -O3 -S -o - -emit-llvm
-// PR1174
-
-void zzz (char *s1, char *s2, int len, int *q)
-{
- int z = 5;
- unsigned int i, b;
- struct { char a[z]; } x;
-
- for (i = 0; i < len; i++)
- s1[i] = s2[i];
-
- b = z & 0x3;
-
- len += (b == 0 ? 0 : 1) + z;
-
- *q = len;
-
- foo (x, x);
-}
-
diff --git a/release_23/test/CFrontend/2007-02-05-nested.c b/release_23/test/CFrontend/2007-02-05-nested.c
deleted file mode 100644
index be23f175c8c8..000000000000
--- a/release_23/test/CFrontend/2007-02-05-nested.c
+++ /dev/null
@@ -1,54 +0,0 @@
-// RUN: %llvmgcc -S -fnested-functions -O0 -o - -emit-llvm %s
-// PR915
-
-extern void abort(void);
-
-void nest(int n)
-{
- int a = 0;
- int b = 5;
- int c = 0;
- int d = 7;
-
- void o(int i, int j)
- {
- if (i!=j)
- abort();
- }
-
- void f(x)
- int x; /* K&R style */
- {
- int e = 0;
- int f = 2;
- int g = 0;
-
- void y(void)
- {
- c = n;
- e = 1;
- g = x;
- }
-
- void z(void)
- {
- a = 4;
- g = 3;
- }
-
- a = 5;
- y();
- c = x;
- z();
- o(1,e);
- o(2,f);
- o(3,g);
- }
-
- c = 2;
- f(6);
- o(4,a);
- o(5,b);
- o(6,c);
- o(7,d);
-}
diff --git a/release_23/test/CFrontend/2007-02-07-AddrLabel.c b/release_23/test/CFrontend/2007-02-07-AddrLabel.c
deleted file mode 100644
index 144f62d0992b..000000000000
--- a/release_23/test/CFrontend/2007-02-07-AddrLabel.c
+++ /dev/null
@@ -1,10 +0,0 @@
-// PR947
-// RUN: %llvmgcc %s -c -o -
-
-void foo() {
- void *ptr;
- label:
- ptr = &&label;
-
- goto *ptr;
- }
diff --git a/release_23/test/CFrontend/2007-02-16-VariableSizeStructArg.c b/release_23/test/CFrontend/2007-02-16-VariableSizeStructArg.c
deleted file mode 100644
index fd07cd8176f5..000000000000
--- a/release_23/test/CFrontend/2007-02-16-VariableSizeStructArg.c
+++ /dev/null
@@ -1,7 +0,0 @@
-// RUN: %llvmgcc -S %s -o -
-// PR1170
-int f(int a, struct {int b[a];} c) { return c.b[0]; }
-
-int g(struct {int b[1];} c) {
- return c.b[0];
-}
diff --git a/release_23/test/CFrontend/2007-02-16-VoidPtrDiff.c b/release_23/test/CFrontend/2007-02-16-VoidPtrDiff.c
deleted file mode 100644
index 713b9b28b075..000000000000
--- a/release_23/test/CFrontend/2007-02-16-VoidPtrDiff.c
+++ /dev/null
@@ -1,5 +0,0 @@
-// RUN: %llvmgcc %s -S -o - -emit-llvm
-
-void foo(void *ptr, int test) {
- (ptr - ((void *) test + 0x2000));
-}
diff --git a/release_23/test/CFrontend/2007-02-16-WritableStrings.c b/release_23/test/CFrontend/2007-02-16-WritableStrings.c
deleted file mode 100644
index d11fa089dbab..000000000000
--- a/release_23/test/CFrontend/2007-02-16-WritableStrings.c
+++ /dev/null
@@ -1,8 +0,0 @@
-// Test the -fwritable-strings option.
-
-// RUN: %llvmgcc -O3 -S -o - -emit-llvm -fwritable-strings %s | \
-// RUN: grep {internal global}
-// RUN: %llvmgcc -O3 -S -o - -emit-llvm %s | grep {internal constant}
-
-char *X = "foo";
-
diff --git a/release_23/test/CFrontend/2007-02-25-C-DotDotDot.c b/release_23/test/CFrontend/2007-02-25-C-DotDotDot.c
deleted file mode 100644
index 969602200c19..000000000000
--- a/release_23/test/CFrontend/2007-02-25-C-DotDotDot.c
+++ /dev/null
@@ -1,12 +0,0 @@
-// RUN: %llvmgcc -O0 -S -o - -emit-llvm -fno-inline -fno-unit-at-a-time %s | \
-// RUN: grep {call float @foo}
-
-// Make sure the call to foo is compiled as:
-// call float @foo()
-// not
-// call float (...)* bitcast (float ()* @foo to float (...)*)( )
-
-static float foo() { return 0.0; }
-float bar() { return foo()*10.0;}
-
-
diff --git a/release_23/test/CFrontend/2007-03-01-VarSizeArrayIdx.c b/release_23/test/CFrontend/2007-03-01-VarSizeArrayIdx.c
deleted file mode 100644
index a3d480cafe66..000000000000
--- a/release_23/test/CFrontend/2007-03-01-VarSizeArrayIdx.c
+++ /dev/null
@@ -1,7 +0,0 @@
-// RUN: %llvmgcc %s -O3 -S -o - -emit-llvm | grep mul
-// PR1233
-
-float foo(int w, float A[][w], int g, int h) {
- return A[g][0];
-}
-
diff --git a/release_23/test/CFrontend/2007-03-05-DataLayout.c b/release_23/test/CFrontend/2007-03-05-DataLayout.c
deleted file mode 100644
index 18819f169080..000000000000
--- a/release_23/test/CFrontend/2007-03-05-DataLayout.c
+++ /dev/null
@@ -1,53 +0,0 @@
-// Testcase for PR1242
-// RUN: %llvmgcc -S %s -o - | grep datalayout | \
-// RUN: not grep {"\[Ee\]-p:\[36\]\[24\]:\[36\]\[24\]"}
-// END.
-#include <stdlib.h>
-#define NDIM 3
-#define BODY 01
-typedef double vector[NDIM];
-typedef struct bnode* bodyptr;
-// { i16, double, [3 x double], i32, i32, [3 x double], [3 x double], [3 x
-// double], double, \2 *, \2 * }
-struct bnode {
- short int type;
- double mass;
- vector pos;
- int proc;
- int new_proc;
- vector vel;
- vector acc;
- vector new_acc;
- double phi;
- bodyptr next;
- bodyptr proc_next;
-} body;
-
-#define Type(x) ((x)->type)
-#define Mass(x) ((x)->mass)
-#define Pos(x) ((x)->pos)
-#define Proc(x) ((x)->proc)
-#define New_Proc(x) ((x)->new_proc)
-#define Vel(x) ((x)->vel)
-#define Acc(x) ((x)->acc)
-#define New_Acc(x) ((x)->new_acc)
-#define Phi(x) ((x)->phi)
-#define Next(x) ((x)->next)
-#define Proc_Next(x) ((x)->proc_next)
-
-bodyptr ubody_alloc(int p)
-{
- register bodyptr tmp;
- tmp = (bodyptr)malloc(sizeof(body));
-
- Type(tmp) = BODY;
- Proc(tmp) = p;
- Proc_Next(tmp) = NULL;
- New_Proc(tmp) = p;
- return tmp;
-}
-
-int main(int argc, char** argv) {
- bodyptr b = ubody_alloc(17);
- return 0;
-}
diff --git a/release_23/test/CFrontend/2007-03-06-VarSizeInStruct1.c b/release_23/test/CFrontend/2007-03-06-VarSizeInStruct1.c
deleted file mode 100644
index 8d28a1dbd58a..000000000000
--- a/release_23/test/CFrontend/2007-03-06-VarSizeInStruct1.c
+++ /dev/null
@@ -1,8 +0,0 @@
-// RUN: %llvmgcc %s -S -o -
-void* p (int n) {
- struct f {
- char w; char x[n]; char z[];
- } F;
- F.x[0]='x';
- return &F;
-}
diff --git a/release_23/test/CFrontend/2007-03-06-VarSizeInStruct2.c b/release_23/test/CFrontend/2007-03-06-VarSizeInStruct2.c
deleted file mode 100644
index 13bc3aaf9ae7..000000000000
--- a/release_23/test/CFrontend/2007-03-06-VarSizeInStruct2.c
+++ /dev/null
@@ -1,8 +0,0 @@
-// RUN: %llvmgcc %s -S -o -
-char p (int n) {
- struct f {
- char w; char x[n]; char y[n];
- } F;
-
- return F.x[0];
-}
diff --git a/release_23/test/CFrontend/2007-03-26-BitfieldAfterZeroWidth.c b/release_23/test/CFrontend/2007-03-26-BitfieldAfterZeroWidth.c
deleted file mode 100644
index 9b6a8690a336..000000000000
--- a/release_23/test/CFrontend/2007-03-26-BitfieldAfterZeroWidth.c
+++ /dev/null
@@ -1,6 +0,0 @@
-// RUN: %llvmgcc %s -S -o -
-struct W {};
-struct Y {
- struct W w;
- int i:1;
-} __attribute__ ((packed)) y;
diff --git a/release_23/test/CFrontend/2007-03-26-ZeroWidthBitfield.c b/release_23/test/CFrontend/2007-03-26-ZeroWidthBitfield.c
deleted file mode 100644
index 89bfb8e1cb09..000000000000
--- a/release_23/test/CFrontend/2007-03-26-ZeroWidthBitfield.c
+++ /dev/null
@@ -1,2 +0,0 @@
-// RUN: %llvmgcc %s -S -o -
-struct Z { int :0; } z;
diff --git a/release_23/test/CFrontend/2007-03-27-ArrayCompatible.c b/release_23/test/CFrontend/2007-03-27-ArrayCompatible.c
deleted file mode 100644
index fa3d2db23cc3..000000000000
--- a/release_23/test/CFrontend/2007-03-27-ArrayCompatible.c
+++ /dev/null
@@ -1,10 +0,0 @@
-// RUN: %llvmgcc -S %s -O2 -o - | grep {ret i8 0}
-static char c(int n) {
- char x[2][n];
- x[1][0]=0;
- return *(n+(char *)x);
-}
-
-char d(void) {
- return c(2);
-}
diff --git a/release_23/test/CFrontend/2007-03-27-VarLengthArray.c b/release_23/test/CFrontend/2007-03-27-VarLengthArray.c
deleted file mode 100644
index 5bebe9b09e23..000000000000
--- a/release_23/test/CFrontend/2007-03-27-VarLengthArray.c
+++ /dev/null
@@ -1,7 +0,0 @@
-// RUN: %llvmgcc -S %s -o - | grep {getelementptr i32}
-extern void f(int *);
-int e(int m, int n) {
- int x[n];
- f(x);
- return x[m];
-}
diff --git a/release_23/test/CFrontend/2007-04-05-PackedBitFields-2.c b/release_23/test/CFrontend/2007-04-05-PackedBitFields-2.c
deleted file mode 100644
index d9db4206c169..000000000000
--- a/release_23/test/CFrontend/2007-04-05-PackedBitFields-2.c
+++ /dev/null
@@ -1,16 +0,0 @@
-// RUN: %llvmgcc %s -S -o -
-
-# define pck __attribute__((packed))
-
-
-struct pck F {
- unsigned long long i : 12,
- j : 23,
- k : 27,
- l;
-};
-struct F f1;
-
-void foo() {
- f1.l = 5;
-}
diff --git a/release_23/test/CFrontend/2007-04-05-PackedBitFields.c b/release_23/test/CFrontend/2007-04-05-PackedBitFields.c
deleted file mode 100644
index f9de35639b0d..000000000000
--- a/release_23/test/CFrontend/2007-04-05-PackedBitFields.c
+++ /dev/null
@@ -1,16 +0,0 @@
-// RUN: %llvmgcc %s -S -o -
-
-# define pck __attribute__((packed))
-
-
-struct pck E {
- unsigned long long l,
- i : 12,
- j : 23,
- k : 29; };
-
-struct E e1;
-
-void foo() {
- e1.k = 5;
-}
diff --git a/release_23/test/CFrontend/2007-04-05-PackedStruct.c b/release_23/test/CFrontend/2007-04-05-PackedStruct.c
deleted file mode 100644
index 0d524c489ea8..000000000000
--- a/release_23/test/CFrontend/2007-04-05-PackedStruct.c
+++ /dev/null
@@ -1,18 +0,0 @@
-// RUN: %llvmgcc %s -S -o -
-
-#pragma pack(push, 2)
-
-enum {
- tA = 0,
- tB = 1
-};
-
-struct MyStruct {
- unsigned long A;
- char C;
- void * B;
-};
-
-void bar(){
-struct MyStruct MS = { tB, 0 };
-}
diff --git a/release_23/test/CFrontend/2007-04-05-PadBeforeZeroLengthField.c b/release_23/test/CFrontend/2007-04-05-PadBeforeZeroLengthField.c
deleted file mode 100644
index acc382199255..000000000000
--- a/release_23/test/CFrontend/2007-04-05-PadBeforeZeroLengthField.c
+++ /dev/null
@@ -1,9 +0,0 @@
-// RUN: %llvmgcc %s -S -o -
-struct c__ { unsigned int type:4; };
-union A { struct c__ c; } __attribute__((aligned(8)));
-struct B {
- unsigned int retainCount;
- union A objects[];
-};
-void foo(union A * objects, struct B *array, unsigned long k)
-{ array->objects[k] = objects[k]; }
diff --git a/release_23/test/CFrontend/2007-04-05-UnPackedStruct.c b/release_23/test/CFrontend/2007-04-05-UnPackedStruct.c
deleted file mode 100644
index 9e168ed34feb..000000000000
--- a/release_23/test/CFrontend/2007-04-05-UnPackedStruct.c
+++ /dev/null
@@ -1,16 +0,0 @@
-// RUN: %llvmgcc %s -S -o -
-
-
-enum {
- tA = 0,
- tB = 1
-};
-
-struct MyStruct {
- unsigned long A;
- void * B;
-};
-
-void bar(){
-struct MyStruct MS = { tB, 0 };
-}
diff --git a/release_23/test/CFrontend/2007-04-11-InlineAsmStruct.c b/release_23/test/CFrontend/2007-04-11-InlineAsmStruct.c
deleted file mode 100644
index 158a16e53665..000000000000
--- a/release_23/test/CFrontend/2007-04-11-InlineAsmStruct.c
+++ /dev/null
@@ -1,9 +0,0 @@
-// RUN: %llvmgcc %s -S -emit-llvm -o - | llvm-as | llc
-
-struct V { short X, Y; };
-int bar() {
- struct V bar;
- __asm__ volatile("foo %0\n" : "=r"(bar));
- return bar.X;
-}
-
diff --git a/release_23/test/CFrontend/2007-04-11-InlineAsmUnion.c b/release_23/test/CFrontend/2007-04-11-InlineAsmUnion.c
deleted file mode 100644
index 0435d6498ee5..000000000000
--- a/release_23/test/CFrontend/2007-04-11-InlineAsmUnion.c
+++ /dev/null
@@ -1,7 +0,0 @@
-// RUN: %llvmgcc %s -S -emit-llvm -o - | llvm-as | llc
-
-union U { int x; float p; };
-void foo() {
- union U bar;
- __asm__ volatile("foo %0\n" : "=r"(bar));
-}
diff --git a/release_23/test/CFrontend/2007-04-11-InlineStorageClassC89.c b/release_23/test/CFrontend/2007-04-11-InlineStorageClassC89.c
deleted file mode 100644
index ab1f556b84fd..000000000000
--- a/release_23/test/CFrontend/2007-04-11-InlineStorageClassC89.c
+++ /dev/null
@@ -1,46 +0,0 @@
-// RUN: %llvmgcc %s -S -emit-llvm -O0 -o - | grep define | grep xglobWeak | \
-// RUN: grep weak | count 1
-// RUN: %llvmgcc %s -S -emit-llvm -O0 -o - | grep define | grep xextWeak | \
-// RUN: grep weak | count 1
-// RUN: %llvmgcc %s -S -emit-llvm -O0 -o - | grep define | \
-// RUN: grep xWeaknoinline | grep weak | count 1
-// RUN: %llvmgcc %s -S -emit-llvm -O0 -o - | grep define | \
-// RUN: grep xWeakextnoinline | grep weak | count 1
-// RUN: %llvmgcc %s -S -emit-llvm -O0 -o - | grep define | \
-// RUN: grep xglobnoWeak | grep -v internal | grep -v weak | \
-// RUN: grep -v linkonce | count 1
-// RUN: %llvmgcc %s -S -emit-llvm -O0 -o - | grep define | \
-// RUN: grep xstatnoWeak | grep internal | count 1
-// RUN: %llvmgcc %s -S -emit-llvm -O0 -o - | grep declare | \
-// RUN: grep xextnoWeak | grep -v internal | grep -v weak | \
-// RUN: grep -v linkonce | count 1
-inline int xglobWeak(int) __attribute__((weak));
-inline int xglobWeak (int i) {
- return i*2;
-}
-inline int xextWeak(int) __attribute__((weak));
-extern inline int xextWeak (int i) {
- return i*4;
-}
-int xWeaknoinline(int) __attribute__((weak));
-int xWeaknoinline(int i) {
- return i*8;
-}
-int xWeakextnoinline(int) __attribute__((weak));
-extern int xWeakextnoinline(int i) {
- return i*16;
-}
-inline int xglobnoWeak (int i) {
- return i*32;
-}
-static inline int xstatnoWeak (int i) {
- return i*64;
-}
-extern inline int xextnoWeak (int i) {
- return i*128;
-}
-int j(int y) {
- return xglobnoWeak(y)+xstatnoWeak(y)+xextnoWeak(y)+
- xglobWeak(y)+xextWeak(y)+
- xWeakextnoinline(y)+xWeaknoinline(y);
-}
diff --git a/release_23/test/CFrontend/2007-04-11-InlineStorageClassC99.c b/release_23/test/CFrontend/2007-04-11-InlineStorageClassC99.c
deleted file mode 100644
index f6193aa0ff6a..000000000000
--- a/release_23/test/CFrontend/2007-04-11-InlineStorageClassC99.c
+++ /dev/null
@@ -1,46 +0,0 @@
-// RUN: %llvmgcc -std=c99 %s -S -emit-llvm -O0 -o - | grep declare | \
-// RUN: grep xglobWeak | grep extern_weak | count 1
-// RUN: %llvmgcc -std=c99 %s -S -emit-llvm -O0 -o - | grep define | \
-// RUN: grep xextWeak | grep weak | count 1
-// RUN: %llvmgcc -std=c99 %s -S -emit-llvm -O0 -o - | grep define | \
-// RUN: grep xWeaknoinline | grep weak | count 1
-// RUN: %llvmgcc -std=c99 %s -S -emit-llvm -O0 -o - | grep define | \
-// RUN: grep xWeakextnoinline | grep weak | count 1
-// RUN: %llvmgcc -std=c99 %s -S -emit-llvm -O0 -o - | grep declare | \
-// RUN: grep xglobnoWeak | grep -v internal | grep -v weak | \
-// RUN: grep -v linkonce | count 1
-// RUN: %llvmgcc -std=c99 %s -S -emit-llvm -O0 -o - | grep define | \
-// RUN: grep xstatnoWeak | grep internal | count 1
-// RUN: %llvmgcc -std=c99 %s -S -emit-llvm -O0 -o - | grep define | \
-// RUN: grep xextnoWeak | grep -v internal | grep -v weak | \
-// RUN: grep -v linkonce | count 1
-inline int xglobWeak(int) __attribute__((weak));
-inline int xglobWeak (int i) {
- return i*2;
-}
-inline int xextWeak(int) __attribute__((weak));
-extern inline int xextWeak (int i) {
- return i*4;
-}
-int xWeaknoinline(int) __attribute__((weak));
-int xWeaknoinline(int i) {
- return i*8;
-}
-int xWeakextnoinline(int) __attribute__((weak));
-extern int xWeakextnoinline(int i) {
- return i*16;
-}
-inline int xglobnoWeak (int i) {
- return i*32;
-}
-static inline int xstatnoWeak (int i) {
- return i*64;
-}
-extern inline int xextnoWeak (int i) {
- return i*128;
-}
-int j(int y) {
- return xglobnoWeak(y)+xstatnoWeak(y)+xextnoWeak(y)+
- xglobWeak(y)+xextWeak(y)+
- xWeakextnoinline(y)+xWeaknoinline(y);
-}
diff --git a/release_23/test/CFrontend/2007-04-11-PR1321.c b/release_23/test/CFrontend/2007-04-11-PR1321.c
deleted file mode 100644
index f391329a0f11..000000000000
--- a/release_23/test/CFrontend/2007-04-11-PR1321.c
+++ /dev/null
@@ -1,12 +0,0 @@
-// RUN: %llvmgcc %s -S -o /dev/null
-
-struct X {
- unsigned int e0 : 17;
- unsigned int e1 : 17;
- unsigned int e2 : 17;
- unsigned int e3 : 17;
- unsigned int e4 : 17;
- unsigned int e5 : 17;
- unsigned int e6 : 17;
- unsigned int e7 : 17;
-} __attribute__((packed)) x;
diff --git a/release_23/test/CFrontend/2007-04-13-InlineAsmStruct2.c b/release_23/test/CFrontend/2007-04-13-InlineAsmStruct2.c
deleted file mode 100644
index e4870e75be2f..000000000000
--- a/release_23/test/CFrontend/2007-04-13-InlineAsmStruct2.c
+++ /dev/null
@@ -1,9 +0,0 @@
-// RUN: %llvmgcc %s -S -emit-llvm -o - | grep {call void asm}
-
-struct V { short X, Y; };
-int bar() {
- struct V bar;
- __asm__ volatile("foo %0\n" :: "r"(bar));
- return bar.X;
-}
-
diff --git a/release_23/test/CFrontend/2007-04-13-InlineAsmUnion2.c b/release_23/test/CFrontend/2007-04-13-InlineAsmUnion2.c
deleted file mode 100644
index 284654d223c0..000000000000
--- a/release_23/test/CFrontend/2007-04-13-InlineAsmUnion2.c
+++ /dev/null
@@ -1,7 +0,0 @@
-// RUN: %llvmgcc %s -S -emit-llvm -o - | grep {call void asm}
-
-union U { int x; char* p; };
-void foo() {
- union U bar;
- __asm__ volatile("foo %0\n" :: "r"(bar));
-}
diff --git a/release_23/test/CFrontend/2007-04-14-FNoBuiltin.c b/release_23/test/CFrontend/2007-04-14-FNoBuiltin.c
deleted file mode 100644
index 88bf0e014309..000000000000
--- a/release_23/test/CFrontend/2007-04-14-FNoBuiltin.c
+++ /dev/null
@@ -1,7 +0,0 @@
-// RUN: %llvmgcc -S %s -O2 -fno-builtin -o - | grep call.*printf
-// Check that -fno-builtin is honored.
-
-extern int printf(const char*, ...);
-void foo(const char *msg) {
- printf("%s\n",msg);
-}
diff --git a/release_23/test/CFrontend/2007-04-17-ZeroSizeBitFields.c b/release_23/test/CFrontend/2007-04-17-ZeroSizeBitFields.c
deleted file mode 100644
index ec7b7ea273f4..000000000000
--- a/release_23/test/CFrontend/2007-04-17-ZeroSizeBitFields.c
+++ /dev/null
@@ -1,4 +0,0 @@
-// PR 1332
-// RUN: %llvmgcc %s -S -o /dev/null
-
-struct Z { int a:1; int :0; int c:1; } z;
diff --git a/release_23/test/CFrontend/2007-04-24-VolatileStructCopy.c b/release_23/test/CFrontend/2007-04-24-VolatileStructCopy.c
deleted file mode 100644
index 4765921f1d21..000000000000
--- a/release_23/test/CFrontend/2007-04-24-VolatileStructCopy.c
+++ /dev/null
@@ -1,10 +0,0 @@
-// RUN: %llvmgcc -O3 -S -o - -emit-llvm %s | grep {volatile store}
-// PR1352
-
-struct foo {
- int x;
-};
-
-void copy(volatile struct foo *p, struct foo *q) {
- *p = *q;
-}
diff --git a/release_23/test/CFrontend/2007-04-24-bit-not-expr.c b/release_23/test/CFrontend/2007-04-24-bit-not-expr.c
deleted file mode 100644
index 1c27f181c0e4..000000000000
--- a/release_23/test/CFrontend/2007-04-24-bit-not-expr.c
+++ /dev/null
@@ -1,7 +0,0 @@
-// PR 1346
-// RUN: %llvmgcc -c %s -o /dev/null
-extern bar(void *);
-
-void f(void *cd) {
- bar(((void *)((unsigned long)(cd) ^ -1)));
-}
diff --git a/release_23/test/CFrontend/2007-04-24-str-const.c b/release_23/test/CFrontend/2007-04-24-str-const.c
deleted file mode 100644
index 4c109c41b019..000000000000
--- a/release_23/test/CFrontend/2007-04-24-str-const.c
+++ /dev/null
@@ -1,17 +0,0 @@
-// RUN: %llvmgcc -c %s -o /dev/null
-static char *str;
-
-static const struct {
- const char *name;
- unsigned type;
-} scan_special[] = {
- {"shift", 1},
- {0, 0}
-};
-
-static void
-sb(void)
-{
- while (*str == ' ' || *str == '\t')
- str++;
-}
diff --git a/release_23/test/CFrontend/2007-05-07-NestedStructReturn.c b/release_23/test/CFrontend/2007-05-07-NestedStructReturn.c
deleted file mode 100644
index aea58e3ae8bb..000000000000
--- a/release_23/test/CFrontend/2007-05-07-NestedStructReturn.c
+++ /dev/null
@@ -1,13 +0,0 @@
-// RUN: %llvmgcc %s -S -fnested-functions -o - | grep {sret *%agg.result}
-
-struct X { long m, n, o, p; };
-
-struct X p(int n) {
- struct X c(int m) {
- struct X x;
- x.m = m;
- x.n = n;
- return x;
- }
- return c(n);
-}
diff --git a/release_23/test/CFrontend/2007-05-07-PaddingElements.c b/release_23/test/CFrontend/2007-05-07-PaddingElements.c
deleted file mode 100644
index c0a65f054acc..000000000000
--- a/release_23/test/CFrontend/2007-05-07-PaddingElements.c
+++ /dev/null
@@ -1,12 +0,0 @@
-// PR 1278
-// RUN: %llvmgcc %s -S -emit-llvm -O0 -o - | not grep "4 x i8] zeroinitializer"
-// RUN: %llvmgcc %s -S -emit-llvm -O0 -o - | not grep "i32 0, i32 2"
-struct s {
- double d1;
- int s1;
-};
-
-struct s foo(void) {
- struct s S = {1.1, 2};
- return S;
-}
diff --git a/release_23/test/CFrontend/2007-05-08-PCH.c b/release_23/test/CFrontend/2007-05-08-PCH.c
deleted file mode 100644
index aa277ece99e0..000000000000
--- a/release_23/test/CFrontend/2007-05-08-PCH.c
+++ /dev/null
@@ -1,7 +0,0 @@
-// PR 1400
-// RUN: %llvmgcc -x c-header %s -o /dev/null
-
-int main() {
- return 0;
-}
-
diff --git a/release_23/test/CFrontend/2007-05-11-str-const.c b/release_23/test/CFrontend/2007-05-11-str-const.c
deleted file mode 100644
index 48deddbb019e..000000000000
--- a/release_23/test/CFrontend/2007-05-11-str-const.c
+++ /dev/null
@@ -1,5 +0,0 @@
-// RUN: %llvmgcc -c -g %s -o /dev/null
-
-static unsigned char out[]={0,1};
-static const unsigned char str1[]="1";
-
diff --git a/release_23/test/CFrontend/2007-05-15-PaddingElement.c b/release_23/test/CFrontend/2007-05-15-PaddingElement.c
deleted file mode 100644
index a218b3594d72..000000000000
--- a/release_23/test/CFrontend/2007-05-15-PaddingElement.c
+++ /dev/null
@@ -1,23 +0,0 @@
-// PR 1419
-
-// RUN: %llvmgcc -xc -O2 %s -c -o - | llvm-dis | grep "ret i32 1"
-struct A {
- short x;
- long long :0;
-};
-
-struct B {
- char a;
- char b;
- unsigned char i;
-};
-
-union X { struct A a; struct B b; };
-
-int check(void) {
- union X x, y;
-
- y.b.i = 0xff;
- x = y;
- return (x.b.i == 0xff);
-}
diff --git a/release_23/test/CFrontend/2007-05-16-EmptyStruct.c b/release_23/test/CFrontend/2007-05-16-EmptyStruct.c
deleted file mode 100644
index 64652be8b065..000000000000
--- a/release_23/test/CFrontend/2007-05-16-EmptyStruct.c
+++ /dev/null
@@ -1,5 +0,0 @@
-// PR 1417
-
-// RUN: %llvmgcc -xc %s -c -o - | llvm-dis | grep "struct.anon = type \{ \}"
-
-struct { } *X;
diff --git a/release_23/test/CFrontend/2007-05-29-UnionCopy.c b/release_23/test/CFrontend/2007-05-29-UnionCopy.c
deleted file mode 100644
index ded67d4d6b28..000000000000
--- a/release_23/test/CFrontend/2007-05-29-UnionCopy.c
+++ /dev/null
@@ -1,18 +0,0 @@
-// RUN: %llvmgcc -S -o - -emit-llvm %s | grep memcpy
-// PR1421
-
-struct A {
- char c;
- int i;
-};
-
-struct B {
- int c;
- unsigned char x;
-};
-
-union U { struct A a; struct B b; };
-
-void check(union U *u, union U *v) {
- *u = *v;
-}
diff --git a/release_23/test/CFrontend/2007-06-05-NoInlineAttribute.c b/release_23/test/CFrontend/2007-06-05-NoInlineAttribute.c
deleted file mode 100644
index cb1920aed091..000000000000
--- a/release_23/test/CFrontend/2007-06-05-NoInlineAttribute.c
+++ /dev/null
@@ -1,13 +0,0 @@
-// RUN: %llvmgcc -c -emit-llvm %s -o - | llvm-dis | grep llvm.noinline
-
-static int bar(int x, int y) __attribute__((noinline));
-
-static int bar(int x, int y)
-{
- return x + y;
-}
-
-int foo(int a, int b) {
- return bar(b, a);
-}
-
diff --git a/release_23/test/CFrontend/2007-06-15-AnnotateAttribute.c b/release_23/test/CFrontend/2007-06-15-AnnotateAttribute.c
deleted file mode 100644
index 009911737036..000000000000
--- a/release_23/test/CFrontend/2007-06-15-AnnotateAttribute.c
+++ /dev/null
@@ -1,24 +0,0 @@
-// RUN: %llvmgcc -c -emit-llvm %s -o - | llvm-dis | grep llvm.global.annotations
-// RUN: %llvmgcc -c -emit-llvm %s -o - | llvm-dis | grep llvm.var.annotation | count 3
-
-#include <stdio.h>
-
-/* Global variable with attribute */
-int X __attribute__((annotate("GlobalValAnnotation")));
-
-/* Function with attribute */
-int foo(int y) __attribute__((annotate("GlobalValAnnotation")))
- __attribute__((noinline));
-
-int foo(int y __attribute__((annotate("LocalValAnnotation")))) {
- int x __attribute__((annotate("LocalValAnnotation")));
- x = 34;
- return y + x;
-}
-
-int main() {
- static int a __attribute__((annotate("GlobalValAnnotation")));
- a = foo(2);
- printf("hello world%d\n", a);
- return 0;
-}
diff --git a/release_23/test/CFrontend/2007-06-18-SextAttrAggregate.c b/release_23/test/CFrontend/2007-06-18-SextAttrAggregate.c
deleted file mode 100644
index 2fcd72607a2a..000000000000
--- a/release_23/test/CFrontend/2007-06-18-SextAttrAggregate.c
+++ /dev/null
@@ -1,11 +0,0 @@
-// RUN: %llvmgcc %s -o - -S -emit-llvm -O3 | grep {i8 signext}
-// PR1513
-
-struct s{
-long a;
-long b;
-};
-
-void f(struct s a, char *b, signed char C) {
-
-}
diff --git a/release_23/test/CFrontend/2007-07-29-RestrictPtrArg.c b/release_23/test/CFrontend/2007-07-29-RestrictPtrArg.c
deleted file mode 100644
index 99eae39054b3..000000000000
--- a/release_23/test/CFrontend/2007-07-29-RestrictPtrArg.c
+++ /dev/null
@@ -1,6 +0,0 @@
-// RUN: %llvmgcc -c -emit-llvm %s -o - | llvm-dis | grep noalias
-
-void foo(int * __restrict myptr1, int * myptr2) {
- myptr1[0] = 0;
- myptr2[0] = 0;
-}
diff --git a/release_23/test/CFrontend/2007-08-01-LoadStoreAlign.c b/release_23/test/CFrontend/2007-08-01-LoadStoreAlign.c
deleted file mode 100644
index ef890bf7cfc9..000000000000
--- a/release_23/test/CFrontend/2007-08-01-LoadStoreAlign.c
+++ /dev/null
@@ -1,17 +0,0 @@
-// RUN: %llvmgcc -O3 -S -o - -emit-llvm %s | grep {align 1} | count 2
-// RUN: %llvmgcc -O3 -S -o - -emit-llvm %s | llvm-as | llc
-
-struct p {
- char a;
- int b;
-} __attribute__ ((packed));
-
-struct p t = { 1, 10 };
-struct p u;
-
-int main () {
- int tmp = t.b;
- u.b = tmp;
- return tmp;
-
-}
diff --git a/release_23/test/CFrontend/2007-08-21-ComplexCst.c b/release_23/test/CFrontend/2007-08-21-ComplexCst.c
deleted file mode 100644
index 7ddd87c08e48..000000000000
--- a/release_23/test/CFrontend/2007-08-21-ComplexCst.c
+++ /dev/null
@@ -1,3 +0,0 @@
-// RUN: %llvmgcc -O2 -c %s -o /dev/null
-void f(_Complex float z);
-void g() { f(1.0i); }
diff --git a/release_23/test/CFrontend/2007-08-22-CTTZ.c b/release_23/test/CFrontend/2007-08-22-CTTZ.c
deleted file mode 100644
index 9e74f24cdcb8..000000000000
--- a/release_23/test/CFrontend/2007-08-22-CTTZ.c
+++ /dev/null
@@ -1,6 +0,0 @@
-// RUN: %llvmgcc -O2 -S -o - %s | grep {llvm.cttz.i64} | count 2
-// RUN: %llvmgcc -O2 -S -o - %s | not grep {lshr}
-
-int bork(unsigned long long x) {
- return __builtin_ctzll(x);
-}
diff --git a/release_23/test/CFrontend/2007-09-05-ConstCtor.c b/release_23/test/CFrontend/2007-09-05-ConstCtor.c
deleted file mode 100644
index c267a5903345..000000000000
--- a/release_23/test/CFrontend/2007-09-05-ConstCtor.c
+++ /dev/null
@@ -1,14 +0,0 @@
-// RUN: %llvmgcc -xc -Os -c %s -o /dev/null
-// PR1641
-
-struct A {
- unsigned long l;
-};
-
-void bar(struct A *a);
-
-void bork() {
- const unsigned long vcgt = 'vcgt';
- struct A a = { vcgt };
- bar(&a);
-}
diff --git a/release_23/test/CFrontend/2007-09-12-PragmaPack.c b/release_23/test/CFrontend/2007-09-12-PragmaPack.c
deleted file mode 100644
index 4fc7f48be01c..000000000000
--- a/release_23/test/CFrontend/2007-09-12-PragmaPack.c
+++ /dev/null
@@ -1,30 +0,0 @@
-// RUN: %llvmgcc -O3 -S -o - %s | grep {18}
-
-#include <stdint.h>
-
-#pragma pack(push, 1)
-typedef struct
-{
- uint32_t a;
-} foo;
-
-typedef struct {
- uint8_t major;
- uint8_t minor;
- uint16_t build;
-} VERSION;
-
-typedef struct {
- uint8_t a[5];
- VERSION version;
- uint8_t b;
- foo d;
- uint32_t guard;
-} bar;
-#pragma pack(pop)
-
-
-unsigned barsize(void) {
- return sizeof(bar);
-}
-
diff --git a/release_23/test/CFrontend/2007-09-14-NegatePointer.c b/release_23/test/CFrontend/2007-09-14-NegatePointer.c
deleted file mode 100644
index cb49e46ddb11..000000000000
--- a/release_23/test/CFrontend/2007-09-14-NegatePointer.c
+++ /dev/null
@@ -1,7 +0,0 @@
-// RUN: %llvmgcc -S %s -o -
-// PR1662
-
-int foo(unsigned char *test) {
- return 0U - (unsigned int )test;
-}
-
diff --git a/release_23/test/CFrontend/2007-09-17-WeakRef.c b/release_23/test/CFrontend/2007-09-17-WeakRef.c
deleted file mode 100644
index 3cdd47e4e082..000000000000
--- a/release_23/test/CFrontend/2007-09-17-WeakRef.c
+++ /dev/null
@@ -1,10 +0,0 @@
-// RUN: %llvmgcc -O1 -S %s -o - | grep icmp
-// PR1678
-// XFAIL: llvmgcc4.0.1
-extern void B (void);
-static __typeof(B) A __attribute__ ((__weakref__("B")));
-int active (void)
-{
- static void *const p = __extension__ (void *) &A;
- return p != 0;
-}
diff --git a/release_23/test/CFrontend/2007-09-20-GcrootAttribute.c b/release_23/test/CFrontend/2007-09-20-GcrootAttribute.c
deleted file mode 100644
index 23cd37ff6a55..000000000000
--- a/release_23/test/CFrontend/2007-09-20-GcrootAttribute.c
+++ /dev/null
@@ -1,29 +0,0 @@
-// RUN: %llvmgcc -S -emit-llvm %s -o - | grep llvm.gcroot
-// RUN: %llvmgcc -S -emit-llvm %s -o - | grep llvm.gcroot | count 6
-// RUN: %llvmgcc -S -emit-llvm %s -o - | llvm-as
-
-typedef struct foo_s
-{
- int a;
-} foo, __attribute__ ((gcroot)) *foo_p;
-
-foo my_foo;
-
-int alpha ()
-{
- foo my_foo2 = my_foo;
-
- return my_foo2.a;
-}
-
-int bar (foo a)
-{
- foo_p b;
- return b->a;
-}
-
-foo_p baz (foo_p a, foo_p b, foo_p *c)
-{
- a = b = *c;
- return a;
-}
diff --git a/release_23/test/CFrontend/2007-09-26-Alignment.c b/release_23/test/CFrontend/2007-09-26-Alignment.c
deleted file mode 100644
index 1638fed05873..000000000000
--- a/release_23/test/CFrontend/2007-09-26-Alignment.c
+++ /dev/null
@@ -1,7 +0,0 @@
-// RUN: %llvmgcc -S %s -o - | grep {align 16}
-extern p(int *);
-int q(void) {
- int x __attribute__ ((aligned (16)));
- p(&x);
- return x;
-}
diff --git a/release_23/test/CFrontend/2007-09-27-ComplexIntCompare.c b/release_23/test/CFrontend/2007-09-27-ComplexIntCompare.c
deleted file mode 100644
index ee9a85c2454d..000000000000
--- a/release_23/test/CFrontend/2007-09-27-ComplexIntCompare.c
+++ /dev/null
@@ -1,14 +0,0 @@
-// RUN: %llvmgcc -S %s -o -
-// PR1708
-struct s { _Complex unsigned short x; };
-struct s gs = { 100 + 200i };
-struct s __attribute__((noinline)) foo (void) { return gs; }
-
-int main ()
-{
- if (foo ().x != gs.x)
- abort ();
- exit (0);
-}
-
-
diff --git a/release_23/test/CFrontend/2007-09-28-PackedUnionMember.c b/release_23/test/CFrontend/2007-09-28-PackedUnionMember.c
deleted file mode 100644
index 1e6465748300..000000000000
--- a/release_23/test/CFrontend/2007-09-28-PackedUnionMember.c
+++ /dev/null
@@ -1,37 +0,0 @@
-// RUN: %llvmgcc %s -S -o -
-#pragma pack(push, 2)
-struct H {
- unsigned long f1;
- unsigned long f2;
- union {
- struct opaque1 *f3;
- struct opaque2 *f4;
- struct {
- struct opaque3 *f5;
- unsigned short f6;
- } f7;
- } f8;
-};
-#pragma pack(pop)
-
-struct E {
- unsigned long f1;
- unsigned long f2;
-};
-
-typedef long (*FuncPtr) ();
-
-extern long bork(FuncPtr handler, const struct E *list);
-
-static long hndlr()
-{
- struct H cmd = { 4, 'fart' };
- return 0;
-}
-void foo(void *inWindow) {
- static const struct E events[] = {
- { 'cmds', 1 }
- };
- bork(hndlr, events);
-}
-
diff --git a/release_23/test/CFrontend/2007-10-01-BuildArrayRef.c b/release_23/test/CFrontend/2007-10-01-BuildArrayRef.c
deleted file mode 100644
index e9037552308a..000000000000
--- a/release_23/test/CFrontend/2007-10-01-BuildArrayRef.c
+++ /dev/null
@@ -1,8 +0,0 @@
-// RUN: not %llvmgcc -S %s -o /dev/null |& grep "error: assignment of read-only location"
-// PR 1603
-int func()
-{
- const int *arr;
- arr[0] = 1;
-}
-
diff --git a/release_23/test/CFrontend/2007-10-02-VolatileArray.c b/release_23/test/CFrontend/2007-10-02-VolatileArray.c
deleted file mode 100644
index 7e8bf24a84b8..000000000000
--- a/release_23/test/CFrontend/2007-10-02-VolatileArray.c
+++ /dev/null
@@ -1,7 +0,0 @@
-// RUN: %llvmgcc -S %s -o - | grep volatile
-// PR1647
-
-void foo(volatile int *p)
-{
-p[0] = 0;
-}
diff --git a/release_23/test/CFrontend/2007-10-15-VoidPtr.c b/release_23/test/CFrontend/2007-10-15-VoidPtr.c
deleted file mode 100644
index c5948b93e163..000000000000
--- a/release_23/test/CFrontend/2007-10-15-VoidPtr.c
+++ /dev/null
@@ -1,4 +0,0 @@
-// RUN: %llvmgcc -S %s -o /dev/null
-void bork(void **data) {
- (*(unsigned short *) (&(data[37])[927]) = 0);
-}
diff --git a/release_23/test/CFrontend/2007-10-30-Volatile.c b/release_23/test/CFrontend/2007-10-30-Volatile.c
deleted file mode 100644
index 7a75b05d5d2b..000000000000
--- a/release_23/test/CFrontend/2007-10-30-Volatile.c
+++ /dev/null
@@ -1,6 +0,0 @@
-// RUN: %llvmgcc -S %s -o /dev/null -Wall -Werror
-void bork() {
- char * volatile p;
- volatile int cc;
- p += cc;
-}
diff --git a/release_23/test/CFrontend/2007-11-07-AlignedMemcpy.c b/release_23/test/CFrontend/2007-11-07-AlignedMemcpy.c
deleted file mode 100644
index f1900bb646b4..000000000000
--- a/release_23/test/CFrontend/2007-11-07-AlignedMemcpy.c
+++ /dev/null
@@ -1,4 +0,0 @@
-// RUN: %llvmgcc -c %s -o /dev/null
-void bork() {
- int Qux[33] = {0};
-}
diff --git a/release_23/test/CFrontend/2007-11-07-CopyAggregateAlign.c b/release_23/test/CFrontend/2007-11-07-CopyAggregateAlign.c
deleted file mode 100644
index 8bd94b00a783..000000000000
--- a/release_23/test/CFrontend/2007-11-07-CopyAggregateAlign.c
+++ /dev/null
@@ -1,3 +0,0 @@
-// RUN: %llvmgcc -S %s -o - | grep "align 2" | count 6
-struct A { char s, t, u, v; short a; };
-void q() { struct A a, b; a = b; }
diff --git a/release_23/test/CFrontend/2007-11-07-ZeroAggregateAlign.c b/release_23/test/CFrontend/2007-11-07-ZeroAggregateAlign.c
deleted file mode 100644
index 424120d6c217..000000000000
--- a/release_23/test/CFrontend/2007-11-07-ZeroAggregateAlign.c
+++ /dev/null
@@ -1,3 +0,0 @@
-// RUN: %llvmgcc -S %s -o - | grep "align 2"
-struct A { short s; short t; int i; };
-void q() { struct A a = {0}; }
diff --git a/release_23/test/CFrontend/2007-11-27-SExtZExt.c b/release_23/test/CFrontend/2007-11-27-SExtZExt.c
deleted file mode 100644
index 2b6cd6232d52..000000000000
--- a/release_23/test/CFrontend/2007-11-27-SExtZExt.c
+++ /dev/null
@@ -1,12 +0,0 @@
-// RUN: %llvmgcc -S %s -emit-llvm -o - | grep "signext" | count 4
-
-signed char foo1() { return 1; }
-
-void foo2(signed short a) { }
-
-signed char foo3(void) { return 1; }
-
-void foo4(a) signed short a; { }
-
-
-
diff --git a/release_23/test/CFrontend/2007-11-28-GlobalInitializer.c b/release_23/test/CFrontend/2007-11-28-GlobalInitializer.c
deleted file mode 100644
index c8c7a594d0b6..000000000000
--- a/release_23/test/CFrontend/2007-11-28-GlobalInitializer.c
+++ /dev/null
@@ -1,8 +0,0 @@
-// RUN: %llvmgcc -S %s -o -
-// PR1744
-typedef struct foo { int x; char *p; } FOO;
-extern FOO yy[];
-
-int *y = &((yy + 1)->x);
-void *z = &((yy + 1)->x);
-
diff --git a/release_23/test/CFrontend/2007-12-16-AsmNoUnwind.c b/release_23/test/CFrontend/2007-12-16-AsmNoUnwind.c
deleted file mode 100644
index b080e6a511e8..000000000000
--- a/release_23/test/CFrontend/2007-12-16-AsmNoUnwind.c
+++ /dev/null
@@ -1,3 +0,0 @@
-// RUN: %llvmgcc %s -S -o - | grep nounwind
-
-void bar() { asm (""); }
diff --git a/release_23/test/CFrontend/2007-12-VarArrayDebug.c b/release_23/test/CFrontend/2007-12-VarArrayDebug.c
deleted file mode 100644
index cd6cfdf4672b..000000000000
--- a/release_23/test/CFrontend/2007-12-VarArrayDebug.c
+++ /dev/null
@@ -1,18 +0,0 @@
-// RUN: %llvmgcc -S -g -O %s -o - | llvm-as | llc
-// RUN: %llvmgcc -S -g %s -o - | llvm-as | llc
-
-extern void foo (void);
-
-static
-void baz (int i)
-{
- foo ();
- typedef char A[i];
- struct { A b; } *x = 0;
-}
-
-void
-bar (i)
-{
- baz (i);
-}
diff --git a/release_23/test/CFrontend/2008-01-04-WideBitfield.c b/release_23/test/CFrontend/2008-01-04-WideBitfield.c
deleted file mode 100644
index a0045a402762..000000000000
--- a/release_23/test/CFrontend/2008-01-04-WideBitfield.c
+++ /dev/null
@@ -1,13 +0,0 @@
-// RUN: %llvmgcc -S -o - %s
-// PR1386
-#include <stdint.h>
-
-struct X {
- unsigned char pad : 4;
- uint64_t a : 64;
-} __attribute__((packed)) x;
-
-uint64_t f(void)
-{
- return x.a;
-}
diff --git a/release_23/test/CFrontend/2008-01-07-UnusualIntSize.c b/release_23/test/CFrontend/2008-01-07-UnusualIntSize.c
deleted file mode 100644
index 924ae2ba37db..000000000000
--- a/release_23/test/CFrontend/2008-01-07-UnusualIntSize.c
+++ /dev/null
@@ -1,11 +0,0 @@
-// RUN: %llvmgcc %s -S -o - -O | grep {and.*8589934591}
-// PR1721
-
-struct s {
- unsigned long long u33: 33;
-} a, b;
-
-// This should turn into a real 33-bit add, not a 64-bit add.
-_Bool test(void) {
- return a.u33 + b.u33 != 0;
-}
diff --git a/release_23/test/CFrontend/2008-01-11-ChainConsistency.c b/release_23/test/CFrontend/2008-01-11-ChainConsistency.c
deleted file mode 100644
index 13e48a34ac52..000000000000
--- a/release_23/test/CFrontend/2008-01-11-ChainConsistency.c
+++ /dev/null
@@ -1,3 +0,0 @@
-// RUN: %llvmgcc -S %s -o - -fnested-functions | not grep nest
-
-void n1(void) { void a(void) { a(); } a(); }
diff --git a/release_23/test/CFrontend/2008-01-21-PackedBitFields.c b/release_23/test/CFrontend/2008-01-21-PackedBitFields.c
deleted file mode 100644
index 4c38dee408cb..000000000000
--- a/release_23/test/CFrontend/2008-01-21-PackedBitFields.c
+++ /dev/null
@@ -1,7 +0,0 @@
-// RUN: %llvmgcc %s -S -o -
-
-typedef double Al1Double __attribute__((aligned(1)));
-struct x { int a:23; Al1Double v; };
-struct x X = { 5, 3.0 };
-double foo() { return X.v; }
-
diff --git a/release_23/test/CFrontend/2008-01-21-PackedStructField.c b/release_23/test/CFrontend/2008-01-21-PackedStructField.c
deleted file mode 100644
index 9cc1731063f5..000000000000
--- a/release_23/test/CFrontend/2008-01-21-PackedStructField.c
+++ /dev/null
@@ -1,18 +0,0 @@
-// RUN: %llvmgcc %s -S -o -
-
-struct X { long double b; unsigned char c; double __attribute__((packed)) d; };
-struct X x = { 3.0L, 5, 3.0 };
-
-
-struct S2504 {
- int e:17;
- __attribute__((packed)) unsigned long long int f;
-} ;
-int fails;
- extern struct S2504 s2504;
-void check2504va (int z) {
- struct S2504 arg, *p;
- long long int i = 0;
- arg.f = i;
-}
-
diff --git a/release_23/test/CFrontend/2008-01-24-StructAlignAndBitFields.c b/release_23/test/CFrontend/2008-01-24-StructAlignAndBitFields.c
deleted file mode 100644
index 380a7ef77ca5..000000000000
--- a/release_23/test/CFrontend/2008-01-24-StructAlignAndBitFields.c
+++ /dev/null
@@ -1,4 +0,0 @@
-// RUN: %llvmgcc %s -S -o -
-
-struct U { char a; short b; int c:25; char d; } u;
-
diff --git a/release_23/test/CFrontend/2008-01-25-ByValReadNone.c b/release_23/test/CFrontend/2008-01-25-ByValReadNone.c
deleted file mode 100644
index 8ec60525af8a..000000000000
--- a/release_23/test/CFrontend/2008-01-25-ByValReadNone.c
+++ /dev/null
@@ -1,15 +0,0 @@
-// RUN: %llvmgcc -O3 -S -o - -emit-llvm %s | not grep readonly
-// RUN: %llvmgcc -O3 -S -o - -emit-llvm %s | not grep readnone
-
-
-// The struct being passed byval means that we cannot mark the
-// function readnone. Readnone would allow stores to the arg to
-// be deleted in the caller. We also don't allow readonly since
-// the callee might write to the byval parameter. The inliner
-// would have to assume the worse and introduce an explicit
-// temporary when inlining such a function, which is costly for
-// the common case in which the byval argument is not written.
-struct S { int A[1000]; };
-int __attribute__ ((const)) f(struct S x) { return x.A[0]; }
-int g(struct S x) __attribute__ ((pure));
-int h(struct S x) { return g(x); }
diff --git a/release_23/test/CFrontend/2008-01-25-ZeroSizedAggregate.c b/release_23/test/CFrontend/2008-01-25-ZeroSizedAggregate.c
deleted file mode 100644
index 643caffb6d2a..000000000000
--- a/release_23/test/CFrontend/2008-01-25-ZeroSizedAggregate.c
+++ /dev/null
@@ -1,39 +0,0 @@
-// RUN: %llvmgcc %s -S -o -
-
-// Aggregates of size zero should be dropped from argument list.
-typedef long int Tlong;
-struct S2411 {
- __attribute__((aligned)) Tlong:0;
-};
-
-extern struct S2411 a2411[5];
-extern void checkx2411(struct S2411);
-void test2411(void) {
- checkx2411(a2411[0]);
-}
-
-// Proper handling of zero sized fields during type conversion.
-typedef unsigned long long int Tal2ullong __attribute__((aligned(2)));
-struct S2525 {
- Tal2ullong: 0;
- struct {
- } e;
-};
-struct S2525 s2525;
-
-struct {
- signed char f;
- char :0;
- struct{}h;
- char * i[5];
-} data;
-
-// Taking address of a zero sized field.
-struct Z {};
-struct Y {
- int i;
- struct Z z;
-};
-void *f(struct Y *y) {
- return &y->z;
-}
diff --git a/release_23/test/CFrontend/2008-01-28-PragmaMark.c b/release_23/test/CFrontend/2008-01-28-PragmaMark.c
deleted file mode 100644
index 0b3ac17df32a..000000000000
--- a/release_23/test/CFrontend/2008-01-28-PragmaMark.c
+++ /dev/null
@@ -1,6 +0,0 @@
-// RUN: %llvmgcc -Werror -c %s -o /dev/null
-#pragma mark LLVM's world
-#ifdef DO_ERROR
-#error LLVM's world
-#endif
-int i;
diff --git a/release_23/test/CFrontend/2008-01-28-UnionSize.c b/release_23/test/CFrontend/2008-01-28-UnionSize.c
deleted file mode 100644
index ea2c863b1848..000000000000
--- a/release_23/test/CFrontend/2008-01-28-UnionSize.c
+++ /dev/null
@@ -1,24 +0,0 @@
-// RUN: %llvmgcc %s -S -o -
-// PR 1861
-
-typedef unsigned char __u8;
-typedef unsigned int __u32;
-typedef unsigned short u16;
-typedef __u32 __le32;
-struct bcm43xx_plcp_hdr6 {
- union {
- __le32 data;
- __u8 raw[6];
- }
- __attribute__((__packed__));
-}
- __attribute__((__packed__));
-struct bcm43xx_txhdr {
- union {
- struct {
- struct bcm43xx_plcp_hdr6 plcp;
- };
- };
-}
- __attribute__((__packed__));
-static void bcm43xx_generate_rts(struct bcm43xx_txhdr *txhdr ) { }
diff --git a/release_23/test/CFrontend/2008-02-11-AnnotateBuiltin.c b/release_23/test/CFrontend/2008-02-11-AnnotateBuiltin.c
deleted file mode 100644
index 32bc7a827450..000000000000
--- a/release_23/test/CFrontend/2008-02-11-AnnotateBuiltin.c
+++ /dev/null
@@ -1,7 +0,0 @@
-// RUN: %llvmgcc %s -S -o - | llvm-as | llvm-dis | grep llvm.annotation
-
-int main() {
- int x = 0;
- return __builtin_annotation(x, "annotate");
-}
-
diff --git a/release_23/test/CFrontend/2008-03-03-CtorAttrType.c b/release_23/test/CFrontend/2008-03-03-CtorAttrType.c
deleted file mode 100644
index dc0e47d811a4..000000000000
--- a/release_23/test/CFrontend/2008-03-03-CtorAttrType.c
+++ /dev/null
@@ -1,6 +0,0 @@
-// RUN: %llvmgcc %s -S -emit-llvm -o - | grep llvm.global_ctors
-int __attribute__((constructor)) foo(void) {
- return 0;
-}
-void __attribute__((constructor)) bar(void) {}
-
diff --git a/release_23/test/CFrontend/2008-03-05-syncPtr.c b/release_23/test/CFrontend/2008-03-05-syncPtr.c
deleted file mode 100644
index b371c34e6b27..000000000000
--- a/release_23/test/CFrontend/2008-03-05-syncPtr.c
+++ /dev/null
@@ -1,27 +0,0 @@
-// RUN: %llvmgcc %s -S -emit-llvm -o - | grep llvm.atomic
-// XFAIL: powerpc|sparc-sun-solaris2|arm|ia64
-// Feature currently implemented only for x86 and alpha.
-
-int* foo(int** a, int* b, int* c) {
-return __sync_val_compare_and_swap (a, b, c);
-}
-
-int foo2(int** a, int* b, int* c) {
-return __sync_bool_compare_and_swap (a, b, c);
-}
-
-int* foo3(int** a, int b) {
- return __sync_fetch_and_add (a, b);
-}
-
-int* foo4(int** a, int b) {
- return __sync_fetch_and_sub (a, b);
-}
-
-int* foo5(int** a, int* b) {
- return __sync_lock_test_and_set (a, b);
-}
-
-int* foo6(int** a, int*** b) {
- return __sync_lock_test_and_set (a, b);
-}
diff --git a/release_23/test/CFrontend/2008-03-24-BitField-And-Alloca.c b/release_23/test/CFrontend/2008-03-24-BitField-And-Alloca.c
deleted file mode 100644
index e8112bbb38bc..000000000000
--- a/release_23/test/CFrontend/2008-03-24-BitField-And-Alloca.c
+++ /dev/null
@@ -1,88 +0,0 @@
-// RUN: %llvmgcc -S --emit-llvm %s -o - | not grep "\{ i8, .7 x i8. \}"
-// RUN: %llvmgcc -O2 -S %s -o - | not grep alloca
-enum {
- PP_C,
- PP_D,
- PP_R,
- PP_2D,
- PP_1D,
- PP_SR,
- PP_S2D,
- PP_S1D,
- PP_SC
-};
-
-enum {
- G_VP,
- G_FP,
- G_VS,
- G_GS,
- G_FS
-};
-
-enum {
- G_NONE,
- G_B,
- G_R
-};
-
-typedef union _Key {
- struct {
- unsigned int count : 2;
- unsigned int Aconst : 1;
- unsigned int Bconst : 1;
- unsigned int Cconst : 1;
- unsigned int Xused : 1;
- unsigned int Yused : 1;
- unsigned int Zused : 1;
- unsigned int Wused : 1;
- unsigned int ttype : 3;
- unsigned int scalar : 1;
- unsigned int AType : 4;
- unsigned int BType : 4;
- unsigned int CType : 4;
- unsigned int RType : 4;
- unsigned int Size : 2;
- unsigned int prec : 1;
-
- unsigned int ASize : 2;
- unsigned int BSize : 2;
- unsigned int CSize : 2;
- unsigned int tTex : 4;
- unsigned int proj : 1;
- unsigned int lod : 2;
- unsigned int dvts : 1;
- unsigned int uipad : 18;
- } key_io;
- struct {
- unsigned int key0;
- unsigned int key1;
- } key;
- unsigned long long lkey;
-} Key;
-
-static inline __attribute__ ((always_inline)) void foo(const Key iospec, int* ret)
-{
- *ret=0;
- if(((iospec.key_io.lod == G_B) &&
- (iospec.key_io.ttype != G_VS) &&
- (iospec.key_io.ttype != G_GS) &&
- (iospec.key_io.ttype != G_FS)) ||
-
- (((iospec.key_io.tTex == PP_C) ||
- (iospec.key_io.tTex == PP_SC)) &&
- ((iospec.key_io.tTex == PP_SR) ||
- (iospec.key_io.tTex == PP_S2D) ||
- (iospec.key_io.tTex == PP_S1D) ||
- (iospec.key_io.tTex == PP_SC))))
- *ret=1;
-}
-
-
-extern int bar(unsigned long long key_token2)
-{
- int ret;
- __attribute__ ((unused)) Key iospec = (Key) key_token2;
- foo(iospec, &ret);
- return ret;
-}
diff --git a/release_23/test/CFrontend/2008-03-26-PackedBitFields.c b/release_23/test/CFrontend/2008-03-26-PackedBitFields.c
deleted file mode 100644
index 7214281d020c..000000000000
--- a/release_23/test/CFrontend/2008-03-26-PackedBitFields.c
+++ /dev/null
@@ -1,7 +0,0 @@
-// RUN: %llvmgcc %s -S -o -
-
-
-struct S1757 {
- long double c;
- long int __attribute__((packed)) e:28;
-} x;
diff --git a/release_23/test/CFrontend/2008-04-08-NoExceptions.c b/release_23/test/CFrontend/2008-04-08-NoExceptions.c
deleted file mode 100644
index 257fee23b068..000000000000
--- a/release_23/test/CFrontend/2008-04-08-NoExceptions.c
+++ /dev/null
@@ -1,7 +0,0 @@
-// RUN: %llvmgcc -S -o - %s | grep nounwind | count 2
-// RUN: %llvmgcc -S -o - %s | not grep {declare.*nounwind}
-
-void f(void);
-void g(void) {
- f();
-}
diff --git a/release_23/test/CFrontend/2008-05-06-CFECrash.c b/release_23/test/CFrontend/2008-05-06-CFECrash.c
deleted file mode 100644
index 94d556c1ec29..000000000000
--- a/release_23/test/CFrontend/2008-05-06-CFECrash.c
+++ /dev/null
@@ -1,4 +0,0 @@
-// RUN: %llvmgcc -S -O2 %s -o /dev/null
-// PR2292.
-__inline__ __attribute__ ((__pure__)) int g (void) {}
-void f (int k) { k = g (); }
diff --git a/release_23/test/CFrontend/BasicInstrs.c b/release_23/test/CFrontend/BasicInstrs.c
deleted file mode 100644
index 812b49db28db..000000000000
--- a/release_23/test/CFrontend/BasicInstrs.c
+++ /dev/null
@@ -1,26 +0,0 @@
-// This file can be used to see what a native C compiler is generating for a
-// variety of interesting operations.
-//
-// RUN: %llvmgcc -S %s -o - | llvm-as | llc
-
-unsigned int udiv(unsigned int X, unsigned int Y) {
- return X/Y;
-}
-int sdiv(int X, int Y) {
- return X/Y;
-}
-unsigned int urem(unsigned int X, unsigned int Y) {
- return X%Y;
-}
-int srem(int X, int Y) {
- return X%Y;
-}
-
-_Bool setlt(int X, int Y) {
- return X < Y;
-}
-
-_Bool setgt(int X, int Y) {
- return X > Y;
-}
-
diff --git a/release_23/test/CFrontend/attribute_constructor.c b/release_23/test/CFrontend/attribute_constructor.c
deleted file mode 100644
index b2f7c9b19fc0..000000000000
--- a/release_23/test/CFrontend/attribute_constructor.c
+++ /dev/null
@@ -1,6 +0,0 @@
-// RUN: %llvmgcc %s -c -o - | llvm-dis | grep llvm.global_ctors
-
-void foo() __attribute__((constructor));
-void foo() {
- bar();
-}
diff --git a/release_23/test/CFrontend/block-copy.c b/release_23/test/CFrontend/block-copy.c
deleted file mode 100644
index a53732e4f9ff..000000000000
--- a/release_23/test/CFrontend/block-copy.c
+++ /dev/null
@@ -1,20 +0,0 @@
-/* RUN: %llvmgcc %s -S -o - -emit-llvm -O3 | grep {call.*memcpy}
-
- This should compile into a memcpy from a global, not 128 stores. */
-
-
-
-void foo();
-
-float bar() {
- float lookupTable[] = {-1,-1,-1,0, -1,-1,0,-1, -1,-1,0,1, -1,-1,1,0,
- -1,0,-1,-1, -1,0,-1,1, -1,0,1,-1, -1,0,1,1,
- -1,1,-1,0, -1,1,0,-1, -1,1,0,1, -1,1,1,0,
- 0,-1,-1,-1, 0,-1,-1,1, 0,-1,1,-1, 0,-1,1,1,
- 1,-1,-1,0, 1,-1,0,-1, 1,-1,0,1, 1,-1,1,0,
- 1,0,-1,-1, 1,0,-1,1, 1,0,1,-1, 1,0,1,1,
- 1,1,-1,0, 1,1,0,-1, 1,1,0,1, 1,1,1,0,
- 0,1,-1,-1, 0,1,-1,1, 0,1,1,-1, 0,1,1,1};
- foo(lookupTable);
-}
-
diff --git a/release_23/test/CFrontend/dg.exp b/release_23/test/CFrontend/dg.exp
deleted file mode 100644
index 6675048e6932..000000000000
--- a/release_23/test/CFrontend/dg.exp
+++ /dev/null
@@ -1,5 +0,0 @@
-load_lib llvm.exp
-
-if [ llvm_gcc_supports c ] then {
- RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
-}
diff --git a/release_23/test/CFrontend/exact-div-expr.c b/release_23/test/CFrontend/exact-div-expr.c
deleted file mode 100644
index 9dce922f9532..000000000000
--- a/release_23/test/CFrontend/exact-div-expr.c
+++ /dev/null
@@ -1,6 +0,0 @@
-// RUN: %llvmgcc -S %s -o - -O1 | grep ashr
-// RUN: %llvmgcc -S %s -o - -O1 | not grep sdiv
-
-long long test(int *A, int *B) {
- return A-B;
-}
diff --git a/release_23/test/CFrontend/extern-weak.c b/release_23/test/CFrontend/extern-weak.c
deleted file mode 100644
index 2a8569ca781a..000000000000
--- a/release_23/test/CFrontend/extern-weak.c
+++ /dev/null
@@ -1,12 +0,0 @@
-// RUN: %llvmgcc -O3 -S -o - -emit-llvm %s | grep extern_weak
-// RUN: %llvmgcc -O3 -S -o - -emit-llvm %s | llvm-as | llc
-
-#if !defined(__linux__) && !defined(__FreeBSD__) && \
- !defined(__OpenBSD__) && !defined(__CYGWIN__)
-void foo() __attribute__((weak_import));
-#else
-void foo() __attribute__((weak));
-#endif
-
-void bar() { foo(); }
-
diff --git a/release_23/test/CFrontend/funccall.c b/release_23/test/CFrontend/funccall.c
deleted file mode 100644
index 9735e3470570..000000000000
--- a/release_23/test/CFrontend/funccall.c
+++ /dev/null
@@ -1,17 +0,0 @@
-
-static int q;
-
-void foo() {
- int t = q;
- q = t + 1;
-}
-int main() {
- q = 0;
- foo();
- q = q - 1;
-
- return q;
-}
-
-// This is the source that corresponds to funccall.ll
-// RUN: echo foo
diff --git a/release_23/test/CFrontend/hidden-visibility.c b/release_23/test/CFrontend/hidden-visibility.c
deleted file mode 100644
index fc2ae444b404..000000000000
--- a/release_23/test/CFrontend/hidden-visibility.c
+++ /dev/null
@@ -1,3 +0,0 @@
-// RUN: %llvmgcc %s -emit-llvm -S -o - | grep {hidden global}
-
-int X __attribute__ ((__visibility__ ("hidden"))) = 123;
diff --git a/release_23/test/CFrontend/inline-asm-mrv.c b/release_23/test/CFrontend/inline-asm-mrv.c
deleted file mode 100644
index 6d1df67af1bd..000000000000
--- a/release_23/test/CFrontend/inline-asm-mrv.c
+++ /dev/null
@@ -1,12 +0,0 @@
-// RUN: %llvmgcc -S %s -o - -O | not grep alloca
-// PR2094
-
-int sad16_sse2(void *v, unsigned char *blk2, unsigned char *blk1,
- int stride, int h) {
- int ret;
- asm volatile( "%0 %1 %2 %3"
- : "+r" (h), "+r" (blk1), "+r" (blk2)
- : "r" ((long)stride));
- asm volatile("set %0 %1" : "=r"(ret) : "r"(blk1));
- return ret;
-}
diff --git a/release_23/test/CFrontend/libcalls.c b/release_23/test/CFrontend/libcalls.c
deleted file mode 100644
index c027ea4125e6..000000000000
--- a/release_23/test/CFrontend/libcalls.c
+++ /dev/null
@@ -1,10 +0,0 @@
-// llvm-gcc -O1+ should run simplify libcalls, O0 shouldn't
-// and -fno-builtins shouldn't.
-// RUN: %llvmgcc %s -S -emit-llvm -O0 -o - | grep {call.*exp2f}
-// RUN: %llvmgcc %s -S -emit-llvm -O1 -o - | grep {call.*ldexp}
-// RUN: %llvmgcc %s -S -emit-llvm -O3 -fno-builtin -o - | grep {call.*exp2f}
-
-float t4(unsigned char x) {
- return exp2f(x);
-}
-
diff --git a/release_23/test/CFrontend/nested-functions.c b/release_23/test/CFrontend/nested-functions.c
deleted file mode 100644
index bccbef3dbdd8..000000000000
--- a/release_23/test/CFrontend/nested-functions.c
+++ /dev/null
@@ -1,18 +0,0 @@
-// RUN: %llvmgcc -S %s -o - -fnested-functions
-// PR1274
-
-void Bork() {
- void Fork(const int *src, int size) {
- int i = 1;
- int x;
-
- while (i < size)
- x = src[i];
- }
-}
-
-void foo(void *a){
- inline void foo_bar() {
- a += 1;
- }
-}
diff --git a/release_23/test/CFrontend/sret.c b/release_23/test/CFrontend/sret.c
deleted file mode 100644
index 11ac5d6824e8..000000000000
--- a/release_23/test/CFrontend/sret.c
+++ /dev/null
@@ -1,15 +0,0 @@
-// RUN: %llvmgcc %s -S -emit-llvm -O0 -o - | grep sret | count 5
-
-struct abc {
- long a;
- long b;
- long c;
-};
-
-struct abc foo1(void);
-struct abc foo2();
-
-void bar() {
- struct abc dummy1 = foo1();
- struct abc dummy2 = foo2();
-}
diff --git a/release_23/test/CFrontend/sret2.c b/release_23/test/CFrontend/sret2.c
deleted file mode 100644
index 7b621f942fa9..000000000000
--- a/release_23/test/CFrontend/sret2.c
+++ /dev/null
@@ -1,9 +0,0 @@
-// RUN: %llvmgcc %s -S -emit-llvm -O0 -o - | grep sret | count 2
-
-struct abc {
- long a;
- long b;
- long c;
-};
-
-struct abc foo2(){}
diff --git a/release_23/test/CFrontend/unaligned-memcpy.c b/release_23/test/CFrontend/unaligned-memcpy.c
deleted file mode 100644
index e5d810f3ace8..000000000000
--- a/release_23/test/CFrontend/unaligned-memcpy.c
+++ /dev/null
@@ -1,5 +0,0 @@
-// RUN: %llvmgcc %s -S -emit-llvm -o - | llvm-as | llc
-
-void bork() {
- char Qux[33] = {0};
-}
diff --git a/release_23/test/CodeGen/ARM/2006-11-10-CycleInDAG.ll b/release_23/test/CodeGen/ARM/2006-11-10-CycleInDAG.ll
deleted file mode 100644
index caa9a981fc6a..000000000000
--- a/release_23/test/CodeGen/ARM/2006-11-10-CycleInDAG.ll
+++ /dev/null
@@ -1,20 +0,0 @@
-; RUN: llvm-as < %s | llc -march=arm -mattr=+v6
-
-%struct.layer_data = type { i32, [2048 x i8], i8*, [16 x i8], i32, i8*, i32, i32, [64 x i32], [64 x i32], [64 x i32], [64 x i32], i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, [12 x [64 x i16]] }
-@ld = external global %struct.layer_data* ; <%struct.layer_data**> [#uses=1]
-
-define void @main() {
-entry:
- br i1 false, label %bb169.i, label %cond_true11
-
-bb169.i: ; preds = %entry
- ret void
-
-cond_true11: ; preds = %entry
- %tmp.i32 = load %struct.layer_data** @ld ; <%struct.layer_data*> [#uses=2]
- %tmp3.i35 = getelementptr %struct.layer_data* %tmp.i32, i32 0, i32 1, i32 2048; <i8*> [#uses=2]
- %tmp.i36 = getelementptr %struct.layer_data* %tmp.i32, i32 0, i32 2 ; <i8**> [#uses=1]
- store i8* %tmp3.i35, i8** %tmp.i36
- store i8* %tmp3.i35, i8** null
- ret void
-}
diff --git a/release_23/test/CodeGen/ARM/2007-01-19-InfiniteLoop.ll b/release_23/test/CodeGen/ARM/2007-01-19-InfiniteLoop.ll
deleted file mode 100644
index 3661c4c06d69..000000000000
--- a/release_23/test/CodeGen/ARM/2007-01-19-InfiniteLoop.ll
+++ /dev/null
@@ -1,103 +0,0 @@
-; RUN: llvm-as < %s | llc -march=arm -mattr=+v6,+vfp2
-
-@quant_coef = external global [6 x [4 x [4 x i32]]] ; <[6 x [4 x [4 x i32]]]*> [#uses=1]
-@dequant_coef = external global [6 x [4 x [4 x i32]]] ; <[6 x [4 x [4 x i32]]]*> [#uses=1]
-@A = external global [4 x [4 x i32]] ; <[4 x [4 x i32]]*> [#uses=1]
-
-define fastcc i32 @dct_luma_sp(i32 %block_x, i32 %block_y, i32* %coeff_cost) {
-entry:
- %predicted_block = alloca [4 x [4 x i32]], align 4 ; <[4 x [4 x i32]]*> [#uses=1]
- br label %cond_next489
-
-cond_next489: ; preds = %cond_false, %bb471
- %j.7.in = load i8* null ; <i8> [#uses=1]
- %i.8.in = load i8* null ; <i8> [#uses=1]
- %i.8 = zext i8 %i.8.in to i32 ; <i32> [#uses=4]
- %j.7 = zext i8 %j.7.in to i32 ; <i32> [#uses=4]
- %tmp495 = getelementptr [4 x [4 x i32]]* %predicted_block, i32 0, i32 %i.8, i32 %j.7 ; <i32*> [#uses=2]
- %tmp496 = load i32* %tmp495 ; <i32> [#uses=2]
- %tmp502 = load i32* null ; <i32> [#uses=1]
- %tmp542 = getelementptr [6 x [4 x [4 x i32]]]* @quant_coef, i32 0, i32 0, i32 %i.8, i32 %j.7 ; <i32*> [#uses=1]
- %tmp543 = load i32* %tmp542 ; <i32> [#uses=1]
- %tmp548 = ashr i32 0, 0 ; <i32> [#uses=3]
- %tmp561 = sub i32 0, %tmp496 ; <i32> [#uses=3]
- %abscond563 = icmp sgt i32 %tmp561, -1 ; <i1> [#uses=1]
- %abs564 = select i1 %abscond563, i32 %tmp561, i32 0 ; <i32> [#uses=1]
- %tmp572 = mul i32 %abs564, %tmp543 ; <i32> [#uses=1]
- %tmp574 = add i32 %tmp572, 0 ; <i32> [#uses=1]
- %tmp576 = ashr i32 %tmp574, 0 ; <i32> [#uses=7]
- %tmp579 = icmp eq i32 %tmp548, %tmp576 ; <i1> [#uses=1]
- br i1 %tmp579, label %bb712, label %cond_next589
-
-cond_next589: ; preds = %cond_next489
- %tmp605 = getelementptr [6 x [4 x [4 x i32]]]* @dequant_coef, i32 0, i32 0, i32 %i.8, i32 %j.7 ; <i32*> [#uses=1]
- %tmp606 = load i32* %tmp605 ; <i32> [#uses=1]
- %tmp612 = load i32* null ; <i32> [#uses=1]
- %tmp629 = load i32* null ; <i32> [#uses=1]
- %tmp629a = sitofp i32 %tmp629 to double ; <double> [#uses=1]
- %tmp631 = mul double %tmp629a, 0.000000e+00 ; <double> [#uses=1]
- %tmp632 = add double 0.000000e+00, %tmp631 ; <double> [#uses=1]
- %tmp642 = call fastcc i32 @sign( i32 %tmp576, i32 %tmp561 ) ; <i32> [#uses=1]
- %tmp650 = mul i32 %tmp606, %tmp642 ; <i32> [#uses=1]
- %tmp656 = mul i32 %tmp650, %tmp612 ; <i32> [#uses=1]
- %tmp658 = shl i32 %tmp656, 0 ; <i32> [#uses=1]
- %tmp659 = ashr i32 %tmp658, 6 ; <i32> [#uses=1]
- %tmp660 = sub i32 0, %tmp659 ; <i32> [#uses=1]
- %tmp666 = sub i32 %tmp660, %tmp496 ; <i32> [#uses=1]
- %tmp667 = sitofp i32 %tmp666 to double ; <double> [#uses=2]
- call void @levrun_linfo_inter( i32 %tmp576, i32 0, i32* null, i32* null )
- %tmp671 = mul double %tmp667, %tmp667 ; <double> [#uses=1]
- %tmp675 = add double %tmp671, 0.000000e+00 ; <double> [#uses=1]
- %tmp678 = fcmp oeq double %tmp632, %tmp675 ; <i1> [#uses=1]
- br i1 %tmp678, label %cond_true679, label %cond_false693
-
-cond_true679: ; preds = %cond_next589
- %abscond681 = icmp sgt i32 %tmp548, -1 ; <i1> [#uses=1]
- %abs682 = select i1 %abscond681, i32 %tmp548, i32 0 ; <i32> [#uses=1]
- %abscond684 = icmp sgt i32 %tmp576, -1 ; <i1> [#uses=1]
- %abs685 = select i1 %abscond684, i32 %tmp576, i32 0 ; <i32> [#uses=1]
- %tmp686 = icmp slt i32 %abs682, %abs685 ; <i1> [#uses=1]
- br i1 %tmp686, label %cond_next702, label %cond_false689
-
-cond_false689: ; preds = %cond_true679
- %tmp739 = icmp eq i32 %tmp576, 0 ; <i1> [#uses=1]
- br i1 %tmp579, label %bb737, label %cond_false708
-
-cond_false693: ; preds = %cond_next589
- ret i32 0
-
-cond_next702: ; preds = %cond_true679
- ret i32 0
-
-cond_false708: ; preds = %cond_false689
- ret i32 0
-
-bb712: ; preds = %cond_next489
- ret i32 0
-
-bb737: ; preds = %cond_false689
- br i1 %tmp739, label %cond_next791, label %cond_true740
-
-cond_true740: ; preds = %bb737
- %tmp761 = call fastcc i32 @sign( i32 %tmp576, i32 0 ) ; <i32> [#uses=1]
- %tmp780 = load i32* null ; <i32> [#uses=1]
- %tmp785 = getelementptr [4 x [4 x i32]]* @A, i32 0, i32 %i.8, i32 %j.7 ; <i32*> [#uses=1]
- %tmp786 = load i32* %tmp785 ; <i32> [#uses=1]
- %tmp781 = mul i32 %tmp780, %tmp761 ; <i32> [#uses=1]
- %tmp787 = mul i32 %tmp781, %tmp786 ; <i32> [#uses=1]
- %tmp789 = shl i32 %tmp787, 0 ; <i32> [#uses=1]
- %tmp790 = ashr i32 %tmp789, 6 ; <i32> [#uses=1]
- br label %cond_next791
-
-cond_next791: ; preds = %cond_true740, %bb737
- %ilev.1 = phi i32 [ %tmp790, %cond_true740 ], [ 0, %bb737 ] ; <i32> [#uses=1]
- %tmp796 = load i32* %tmp495 ; <i32> [#uses=1]
- %tmp798 = add i32 %tmp796, %ilev.1 ; <i32> [#uses=1]
- %tmp812 = mul i32 0, %tmp502 ; <i32> [#uses=0]
- %tmp818 = call fastcc i32 @sign( i32 0, i32 %tmp798 ) ; <i32> [#uses=0]
- unreachable
-}
-
-declare i32 @sign(i32, i32)
-
-declare void @levrun_linfo_inter(i32, i32, i32*, i32*)
diff --git a/release_23/test/CodeGen/ARM/2007-01-31-RegInfoAssert.ll b/release_23/test/CodeGen/ARM/2007-01-31-RegInfoAssert.ll
deleted file mode 100644
index 19c156d47f43..000000000000
--- a/release_23/test/CodeGen/ARM/2007-01-31-RegInfoAssert.ll
+++ /dev/null
@@ -1,16 +0,0 @@
-; RUN: llvm-as < %s | llc -mtriple=thumb-apple-darwin
-
-%struct.rtx_def = type { i8 }
-@str = external global [7 x i8]
-
-define void @f1() {
- %D = alloca %struct.rtx_def, align 1
- %tmp1 = bitcast %struct.rtx_def* %D to i32*
- %tmp7 = load i32* %tmp1
- %tmp14 = lshr i32 %tmp7, 1
- %tmp1415 = and i32 %tmp14, 1
- call void (i32, ...)* @printf( i32 undef, i32 0, i32 %tmp1415 )
- ret void
-}
-
-declare void @printf(i32, ...)
diff --git a/release_23/test/CodeGen/ARM/2007-02-02-JoinIntervalsCrash.ll b/release_23/test/CodeGen/ARM/2007-02-02-JoinIntervalsCrash.ll
deleted file mode 100644
index ee52cf0f4e7b..000000000000
--- a/release_23/test/CodeGen/ARM/2007-02-02-JoinIntervalsCrash.ll
+++ /dev/null
@@ -1,27 +0,0 @@
-; RUN: llvm-as < %s | llc -mtriple=thumb-apple-darwin
-
- %struct.color_sample = type { i32 }
- %struct.ref = type { %struct.color_sample, i16, i16 }
-
-define void @zcvrs() {
- br i1 false, label %bb22, label %UnifiedReturnBlock
-
-bb22:
- br i1 false, label %bb64, label %UnifiedReturnBlock
-
-bb64:
- %tmp67 = urem i32 0, 0
- %tmp69 = icmp slt i32 %tmp67, 10
- %iftmp.13.0 = select i1 %tmp69, i8 48, i8 55
- %tmp75 = add i8 %iftmp.13.0, 0
- store i8 %tmp75, i8* null
- %tmp81 = udiv i32 0, 0
- %tmp83 = icmp eq i32 %tmp81, 0
- br i1 %tmp83, label %bb85, label %bb64
-
-bb85:
- ret void
-
-UnifiedReturnBlock:
- ret void
-}
diff --git a/release_23/test/CodeGen/ARM/2007-03-06-AddR7.ll b/release_23/test/CodeGen/ARM/2007-03-06-AddR7.ll
deleted file mode 100644
index ad3e195a0dd7..000000000000
--- a/release_23/test/CodeGen/ARM/2007-03-06-AddR7.ll
+++ /dev/null
@@ -1,117 +0,0 @@
-; RUN: llvm-as < %s | llc -march=thumb
-; RUN: llvm-as < %s | llc -mtriple=thumb-apple-darwin -relocation-model=pic \
-; RUN: -mattr=+v6,+vfp2 | not grep {add r., r7, #2 \\* 4}
-
- %struct.__fooAllocator = type opaque
- %struct.__fooY = type { %struct.fooXBase, %struct.__fooString*, %struct.__fooU*, %struct.__fooV*, i8** }
- %struct.__fooZ = type opaque
- %struct.__fooU = type opaque
- %struct.__fooString = type opaque
- %struct.__fooV = type opaque
- %struct.fooXBase = type { i32, [4 x i8] }
- %struct.fooXClass = type { i32, i8*, void (i8*)*, i8* (%struct.__fooAllocator*, i8*)*, void (i8*)*, i8 (i8*, i8*) zeroext *, i32 (i8*)*, %struct.__fooString* (i8*, %struct.__fooZ*)*, %struct.__fooString* (i8*)* }
- %struct.aa_cache = type { i32, i32, [1 x %struct.aa_method*] }
- %struct.aa_class = type { %struct.aa_class*, %struct.aa_class*, i8*, i32, i32, i32, %struct.aa_ivar_list*, %struct.aa_method_list**, %struct.aa_cache*, %struct.aa_protocol_list* }
- %struct.aa_ivar = type { i8*, i8*, i32 }
- %struct.aa_ivar_list = type { i32, [1 x %struct.aa_ivar] }
- %struct.aa_method = type { %struct.aa_ss*, i8*, %struct.aa_object* (%struct.aa_object*, %struct.aa_ss*, ...)* }
- %struct.aa_method_list = type { %struct.aa_method_list*, i32, [1 x %struct.aa_method] }
- %struct.aa_object = type { %struct.aa_class* }
- %struct.aa_protocol_list = type { %struct.aa_protocol_list*, i32, [1 x %struct.aa_object*] }
- %struct.aa_ss = type opaque
-@__kfooYTypeID = external global i32 ; <i32*> [#uses=3]
-@__fooYClass = external constant %struct.fooXClass ; <%struct.fooXClass*> [#uses=1]
-@__fooXClassTableSize = external global i32 ; <i32*> [#uses=1]
-@__fooXAaClassTable = external global i32* ; <i32**> [#uses=1]
-@s.10319 = external global %struct.aa_ss* ; <%struct.aa_ss**> [#uses=2]
-@str15 = external constant [24 x i8] ; <[24 x i8]*> [#uses=1]
-
-
-define i8 @test(%struct.__fooY* %calendar, double* %atp, i8* %componentDesc, ...) zeroext {
-entry:
- %args = alloca i8*, align 4 ; <i8**> [#uses=5]
- %args4 = bitcast i8** %args to i8* ; <i8*> [#uses=2]
- call void @llvm.va_start( i8* %args4 )
- %tmp6 = load i32* @__kfooYTypeID ; <i32> [#uses=1]
- icmp eq i32 %tmp6, 0 ; <i1>:0 [#uses=1]
- br i1 %0, label %cond_true, label %cond_next
-
-cond_true: ; preds = %entry
- %tmp7 = call i32 @_fooXRegisterClass( %struct.fooXClass* @__fooYClass ) ; <i32> [#uses=1]
- store i32 %tmp7, i32* @__kfooYTypeID
- br label %cond_next
-
-cond_next: ; preds = %cond_true, %entry
- %tmp8 = load i32* @__kfooYTypeID ; <i32> [#uses=2]
- %tmp15 = load i32* @__fooXClassTableSize ; <i32> [#uses=1]
- icmp ugt i32 %tmp15, %tmp8 ; <i1>:1 [#uses=1]
- br i1 %1, label %cond_next18, label %cond_true58
-
-cond_next18: ; preds = %cond_next
- %tmp21 = getelementptr %struct.__fooY* %calendar, i32 0, i32 0, i32 0 ; <i32*> [#uses=1]
- %tmp22 = load i32* %tmp21 ; <i32> [#uses=2]
- %tmp29 = load i32** @__fooXAaClassTable ; <i32*> [#uses=1]
- %tmp31 = getelementptr i32* %tmp29, i32 %tmp8 ; <i32*> [#uses=1]
- %tmp32 = load i32* %tmp31 ; <i32> [#uses=1]
- icmp eq i32 %tmp22, %tmp32 ; <i1>:2 [#uses=1]
- %.not = xor i1 %2, true ; <i1> [#uses=1]
- icmp ugt i32 %tmp22, 4095 ; <i1>:3 [#uses=1]
- %bothcond = and i1 %.not, %3 ; <i1> [#uses=1]
- br i1 %bothcond, label %cond_true58, label %bb48
-
-bb48: ; preds = %cond_next18
- %tmp78 = call i32 @strlen( i8* %componentDesc ) ; <i32> [#uses=4]
- %tmp92 = alloca i32, i32 %tmp78 ; <i32*> [#uses=2]
- icmp sgt i32 %tmp78, 0 ; <i1>:4 [#uses=1]
- br i1 %4, label %cond_true111, label %bb114
-
-cond_true58: ; preds = %cond_next18, %cond_next
- %tmp59 = load %struct.aa_ss** @s.10319 ; <%struct.aa_ss*> [#uses=2]
- icmp eq %struct.aa_ss* %tmp59, null ; <i1>:5 [#uses=1]
- %tmp6869 = bitcast %struct.__fooY* %calendar to i8* ; <i8*> [#uses=2]
- br i1 %5, label %cond_true60, label %cond_next64
-
-cond_true60: ; preds = %cond_true58
- %tmp63 = call %struct.aa_ss* @sel_registerName( i8* getelementptr ([24 x i8]* @str15, i32 0, i32 0) ) ; <%struct.aa_ss*> [#uses=2]
- store %struct.aa_ss* %tmp63, %struct.aa_ss** @s.10319
- %tmp66137 = volatile load i8** %args ; <i8*> [#uses=1]
- %tmp73138 = call i8 (i8*, %struct.aa_ss*, ...) zeroext * bitcast (%struct.aa_object* (%struct.aa_object*, %struct.aa_ss*, ...)* @aa_mm to i8 (i8*, %struct.aa_ss*, ...) zeroext *)( i8* %tmp6869, %struct.aa_ss* %tmp63, double* %atp, i8* %componentDesc, i8* %tmp66137) zeroext ; <i8> [#uses=1]
- ret i8 %tmp73138
-
-cond_next64: ; preds = %cond_true58
- %tmp66 = volatile load i8** %args ; <i8*> [#uses=1]
- %tmp73 = call i8 (i8*, %struct.aa_ss*, ...) zeroext * bitcast (%struct.aa_object* (%struct.aa_object*, %struct.aa_ss*, ...)* @aa_mm to i8 (i8*, %struct.aa_ss*, ...) zeroext *)( i8* %tmp6869, %struct.aa_ss* %tmp59, double* %atp, i8* %componentDesc, i8* %tmp66 ) zeroext ; <i8> [#uses=1]
- ret i8 %tmp73
-
-cond_true111: ; preds = %cond_true111, %bb48
- %idx.2132.0 = phi i32 [ 0, %bb48 ], [ %indvar.next, %cond_true111 ] ; <i32> [#uses=2]
- %tmp95 = volatile load i8** %args ; <i8*> [#uses=2]
- %tmp97 = getelementptr i8* %tmp95, i32 4 ; <i8*> [#uses=1]
- volatile store i8* %tmp97, i8** %args
- %tmp9899 = bitcast i8* %tmp95 to i32* ; <i32*> [#uses=1]
- %tmp100 = load i32* %tmp9899 ; <i32> [#uses=1]
- %tmp104 = getelementptr i32* %tmp92, i32 %idx.2132.0 ; <i32*> [#uses=1]
- store i32 %tmp100, i32* %tmp104
- %indvar.next = add i32 %idx.2132.0, 1 ; <i32> [#uses=2]
- icmp eq i32 %indvar.next, %tmp78 ; <i1>:6 [#uses=1]
- br i1 %6, label %bb114, label %cond_true111
-
-bb114: ; preds = %cond_true111, %bb48
- call void @llvm.va_end( i8* %args4 )
- %tmp122 = call i8 @_fooYCCV( %struct.__fooY* %calendar, double* %atp, i8* %componentDesc, i32* %tmp92, i32 %tmp78 ) zeroext ; <i8> [#uses=1]
- ret i8 %tmp122
-}
-
-declare i32 @_fooXRegisterClass(%struct.fooXClass*)
-
-declare i8 @_fooYCCV(%struct.__fooY*, double*, i8*, i32*, i32) zeroext
-
-declare %struct.aa_object* @aa_mm(%struct.aa_object*, %struct.aa_ss*, ...)
-
-declare %struct.aa_ss* @sel_registerName(i8*)
-
-declare void @llvm.va_start(i8*)
-
-declare i32 @strlen(i8*)
-
-declare void @llvm.va_end(i8*)
diff --git a/release_23/test/CodeGen/ARM/2007-03-07-CombinerCrash.ll b/release_23/test/CodeGen/ARM/2007-03-07-CombinerCrash.ll
deleted file mode 100644
index 7317e62e3182..000000000000
--- a/release_23/test/CodeGen/ARM/2007-03-07-CombinerCrash.ll
+++ /dev/null
@@ -1,21 +0,0 @@
-; RUN: llvm-as < %s | llc -mtriple=arm-apple-darwin -mattr=+v6,+vfp2
-
-define fastcc i8* @read_sleb128(i8* %p, i32* %val) {
- br label %bb
-
-bb: ; preds = %bb, %0
- %p_addr.0 = getelementptr i8* %p, i32 0 ; <i8*> [#uses=1]
- %tmp2 = load i8* %p_addr.0 ; <i8> [#uses=2]
- %tmp4.rec = add i32 0, 1 ; <i32> [#uses=1]
- %tmp4 = getelementptr i8* %p, i32 %tmp4.rec ; <i8*> [#uses=1]
- %tmp56 = zext i8 %tmp2 to i32 ; <i32> [#uses=1]
- %tmp7 = and i32 %tmp56, 127 ; <i32> [#uses=1]
- %tmp9 = shl i32 %tmp7, 0 ; <i32> [#uses=1]
- %tmp11 = or i32 %tmp9, 0 ; <i32> [#uses=1]
- icmp slt i8 %tmp2, 0 ; <i1>:1 [#uses=1]
- br i1 %1, label %bb, label %cond_next28
-
-cond_next28: ; preds = %bb
- store i32 %tmp11, i32* %val
- ret i8* %tmp4
-}
diff --git a/release_23/test/CodeGen/ARM/2007-03-13-InstrSched.ll b/release_23/test/CodeGen/ARM/2007-03-13-InstrSched.ll
deleted file mode 100644
index 8fdff52f015f..000000000000
--- a/release_23/test/CodeGen/ARM/2007-03-13-InstrSched.ll
+++ /dev/null
@@ -1,48 +0,0 @@
-; RUN: llvm-as < %s | llc -mtriple=arm-apple-darwin -relocation-model=pic \
-; RUN: -mattr=+v6 -stats |& grep asm-printer | grep 41
-
-define void @test(i32 %tmp56222, i32 %tmp36224, i32 %tmp46223, i32 %i.0196.0.ph, i32 %tmp8, i32* %tmp1011, i32** %tmp1, i32* %d2.1.out, i32* %d3.1.out, i32* %d0.1.out, i32* %d1.1.out) {
-newFuncRoot:
- br label %bb74
-
-bb78.exitStub: ; preds = %bb74
- store i32 %d2.1, i32* %d2.1.out
- store i32 %d3.1, i32* %d3.1.out
- store i32 %d0.1, i32* %d0.1.out
- store i32 %d1.1, i32* %d1.1.out
- ret void
-
-bb74: ; preds = %bb26, %newFuncRoot
- %fp.1.rec = phi i32 [ 0, %newFuncRoot ], [ %tmp71.rec, %bb26 ] ; <i32> [#uses=3]
- %fm.1.in = phi i32* [ %tmp71, %bb26 ], [ %tmp1011, %newFuncRoot ] ; <i32*> [#uses=1]
- %d0.1 = phi i32 [ %tmp44, %bb26 ], [ 8192, %newFuncRoot ] ; <i32> [#uses=2]
- %d1.1 = phi i32 [ %tmp54, %bb26 ], [ 8192, %newFuncRoot ] ; <i32> [#uses=2]
- %d2.1 = phi i32 [ %tmp64, %bb26 ], [ 8192, %newFuncRoot ] ; <i32> [#uses=2]
- %d3.1 = phi i32 [ %tmp69, %bb26 ], [ 8192, %newFuncRoot ] ; <i32> [#uses=2]
- %fm.1 = load i32* %fm.1.in ; <i32> [#uses=4]
- icmp eq i32 %fp.1.rec, %tmp8 ; <i1>:0 [#uses=1]
- br i1 %0, label %bb78.exitStub, label %bb26
-
-bb26: ; preds = %bb74
- %tmp28 = getelementptr i32** %tmp1, i32 %fp.1.rec ; <i32**> [#uses=1]
- %tmp30 = load i32** %tmp28 ; <i32*> [#uses=4]
- %tmp33 = getelementptr i32* %tmp30, i32 %i.0196.0.ph ; <i32*> [#uses=1]
- %tmp34 = load i32* %tmp33 ; <i32> [#uses=1]
- %tmp38 = getelementptr i32* %tmp30, i32 %tmp36224 ; <i32*> [#uses=1]
- %tmp39 = load i32* %tmp38 ; <i32> [#uses=1]
- %tmp42 = mul i32 %tmp34, %fm.1 ; <i32> [#uses=1]
- %tmp44 = add i32 %tmp42, %d0.1 ; <i32> [#uses=1]
- %tmp48 = getelementptr i32* %tmp30, i32 %tmp46223 ; <i32*> [#uses=1]
- %tmp49 = load i32* %tmp48 ; <i32> [#uses=1]
- %tmp52 = mul i32 %tmp39, %fm.1 ; <i32> [#uses=1]
- %tmp54 = add i32 %tmp52, %d1.1 ; <i32> [#uses=1]
- %tmp58 = getelementptr i32* %tmp30, i32 %tmp56222 ; <i32*> [#uses=1]
- %tmp59 = load i32* %tmp58 ; <i32> [#uses=1]
- %tmp62 = mul i32 %tmp49, %fm.1 ; <i32> [#uses=1]
- %tmp64 = add i32 %tmp62, %d2.1 ; <i32> [#uses=1]
- %tmp67 = mul i32 %tmp59, %fm.1 ; <i32> [#uses=1]
- %tmp69 = add i32 %tmp67, %d3.1 ; <i32> [#uses=1]
- %tmp71.rec = add i32 %fp.1.rec, 1 ; <i32> [#uses=2]
- %tmp71 = getelementptr i32* %tmp1011, i32 %tmp71.rec ; <i32*> [#uses=1]
- br label %bb74
-}
diff --git a/release_23/test/CodeGen/ARM/2007-03-21-JoinIntervalsCrash.ll b/release_23/test/CodeGen/ARM/2007-03-21-JoinIntervalsCrash.ll
deleted file mode 100644
index 32daf839f0fc..000000000000
--- a/release_23/test/CodeGen/ARM/2007-03-21-JoinIntervalsCrash.ll
+++ /dev/null
@@ -1,96 +0,0 @@
-; RUN: llvm-as < %s | llc -mtriple=arm-linux-gnueabi
-; PR1257
-
- %struct.CUMULATIVE_ARGS = type { i32, i32, i32, i32, i32, i32 }
- %struct.arm_stack_offsets = type { i32, i32, i32, i32, i32 }
- %struct.c_arg_info = type { %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, i8 }
- %struct.c_language_function = type { %struct.stmt_tree_s }
- %struct.c_switch = type opaque
- %struct.eh_status = type opaque
- %struct.emit_status = type { i32, i32, %struct.rtx_def*, %struct.rtx_def*, %struct.sequence_stack*, i32, %struct.location_t, i32, i8*, %struct.rtx_def** }
- %struct.expr_status = type { i32, i32, i32, %struct.rtx_def*, %struct.rtx_def*, %struct.rtx_def* }
- %struct.function = type { %struct.eh_status*, %struct.expr_status*, %struct.emit_status*, %struct.varasm_status*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.function*, i32, i32, i32, i32, %struct.rtx_def*, %struct.CUMULATIVE_ARGS, %struct.rtx_def*, %struct.rtx_def*, %struct.initial_value_struct*, %struct.rtx_def*, %struct.rtx_def*, %struct.rtx_def*, %struct.rtx_def*, %struct.rtx_def*, %struct.rtx_def*, i8, i32, i64, %struct.tree_node*, %struct.tree_node*, %struct.rtx_def*, %struct.varray_head_tag*, %struct.temp_slot*, i32, %struct.var_refs_queue*, i32, i32, %struct.rtvec_def*, %struct.tree_node*, i32, i32, i32, %struct.machine_function*, i32, i32, i8, i8, %struct.language_function*, %struct.rtx_def*, i32, i32, i32, i32, %struct.location_t, %struct.varray_head_tag*, %struct.tree_node*, i8, i8, i8 }
- %struct.ht_identifier = type { i8*, i32, i32 }
- %struct.initial_value_struct = type opaque
- %struct.lang_decl = type { i8 }
- %struct.language_function = type { %struct.c_language_function, %struct.tree_node*, %struct.tree_node*, %struct.c_switch*, %struct.c_arg_info*, i32, i32, i32, i32 }
- %struct.location_t = type { i8*, i32 }
- %struct.machine_function = type { %struct.rtx_def*, i32, i32, i32, %struct.arm_stack_offsets, i32, i32, i32, [14 x %struct.rtx_def*] }
- %struct.rtvec_def = type { i32, [1 x %struct.rtx_def*] }
- %struct.rtx_def = type { i16, i8, i8, %struct.u }
- %struct.sequence_stack = type { %struct.rtx_def*, %struct.rtx_def*, %struct.sequence_stack* }
- %struct.stmt_tree_s = type { %struct.tree_node*, i32 }
- %struct.temp_slot = type opaque
- %struct.tree_common = type { %struct.tree_node*, %struct.tree_node*, %union.tree_ann_d*, i8, i8, i8, i8, i8 }
- %struct.tree_decl = type { %struct.tree_common, %struct.location_t, i32, %struct.tree_node*, i8, i8, i8, i8, i8, i8, i8, i8, i32, %struct.tree_decl_u1, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.rtx_def*, i32, %struct.tree_decl_u2, %struct.tree_node*, %struct.tree_node*, i64, %struct.lang_decl* }
- %struct.tree_decl_u1 = type { i64 }
- %struct.tree_decl_u2 = type { %struct.function* }
- %struct.tree_identifier = type { %struct.tree_common, %struct.ht_identifier }
- %struct.tree_node = type { %struct.tree_decl }
- %struct.u = type { [1 x i64] }
- %struct.var_refs_queue = type { %struct.rtx_def*, i32, i32, %struct.var_refs_queue* }
- %struct.varasm_status = type opaque
- %struct.varray_head_tag = type opaque
- %union.tree_ann_d = type opaque
-
-
-define void @declspecs_add_type(i32 %spec.1) {
-entry:
- %spec.1961 = zext i32 %spec.1 to i64 ; <i64> [#uses=1]
- %spec.1961.adj = shl i64 %spec.1961, 32 ; <i64> [#uses=1]
- %spec.1961.adj.ins = or i64 %spec.1961.adj, 0 ; <i64> [#uses=2]
- %tmp10959 = lshr i64 %spec.1961.adj.ins, 32 ; <i64> [#uses=2]
- %tmp1920 = inttoptr i64 %tmp10959 to %struct.tree_common* ; <%struct.tree_common*> [#uses=1]
- %tmp21 = getelementptr %struct.tree_common* %tmp1920, i32 0, i32 3 ; <i8*> [#uses=1]
- %tmp2122 = bitcast i8* %tmp21 to i32* ; <i32*> [#uses=1]
- br i1 false, label %cond_next53, label %cond_true
-
-cond_true: ; preds = %entry
- ret void
-
-cond_next53: ; preds = %entry
- br i1 false, label %cond_true63, label %cond_next689
-
-cond_true63: ; preds = %cond_next53
- ret void
-
-cond_next689: ; preds = %cond_next53
- br i1 false, label %cond_false841, label %bb743
-
-bb743: ; preds = %cond_next689
- ret void
-
-cond_false841: ; preds = %cond_next689
- br i1 false, label %cond_true851, label %cond_true918
-
-cond_true851: ; preds = %cond_false841
- tail call void @lookup_name( )
- br i1 false, label %bb866, label %cond_next856
-
-cond_next856: ; preds = %cond_true851
- ret void
-
-bb866: ; preds = %cond_true851
- %tmp874 = load i32* %tmp2122 ; <i32> [#uses=1]
- %tmp876877 = trunc i32 %tmp874 to i8 ; <i8> [#uses=1]
- icmp eq i8 %tmp876877, 1 ; <i1>:0 [#uses=1]
- br i1 %0, label %cond_next881, label %cond_true878
-
-cond_true878: ; preds = %bb866
- unreachable
-
-cond_next881: ; preds = %bb866
- %tmp884885 = inttoptr i64 %tmp10959 to %struct.tree_identifier* ; <%struct.tree_identifier*> [#uses=1]
- %tmp887 = getelementptr %struct.tree_identifier* %tmp884885, i32 0, i32 1, i32 0 ; <i8**> [#uses=1]
- %tmp888 = load i8** %tmp887 ; <i8*> [#uses=1]
- tail call void (i32, ...)* @error( i32 undef, i8* %tmp888 )
- ret void
-
-cond_true918: ; preds = %cond_false841
- %tmp920957 = trunc i64 %spec.1961.adj.ins to i32 ; <i32> [#uses=0]
- ret void
-}
-
-declare void @error(i32, ...)
-
-declare void @lookup_name()
diff --git a/release_23/test/CodeGen/ARM/2007-03-26-RegScavengerAssert.ll b/release_23/test/CodeGen/ARM/2007-03-26-RegScavengerAssert.ll
deleted file mode 100644
index 6d3f6404af84..000000000000
--- a/release_23/test/CodeGen/ARM/2007-03-26-RegScavengerAssert.ll
+++ /dev/null
@@ -1,947 +0,0 @@
-; RUN: llvm-as < %s | llc -march=arm
-; PR1266
-
-target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64"
-target triple = "arm-linux-gnueabi"
- %struct.CUMULATIVE_ARGS = type { i32, i32, i32, i32, i32, i32 }
- %struct.FILE = type { i32, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, %struct._IO_marker*, %struct.FILE*, i32, i32, i32, i16, i8, [1 x i8], i8*, i64, i8*, i8*, i32, [52 x i8] }
- %struct.VEC_edge = type { i32, i32, [1 x %struct.edge_def*] }
- %struct.VEC_tree = type { i32, i32, [1 x %struct.tree_node*] }
- %struct._IO_marker = type { %struct._IO_marker*, %struct.FILE*, i32 }
- %struct._obstack_chunk = type { i8*, %struct._obstack_chunk*, [4 x i8] }
- %struct.addr_diff_vec_flags = type { i8, i8, i8, i8 }
- %struct.arm_stack_offsets = type { i32, i32, i32, i32, i32 }
- %struct.attribute_spec = type { i8*, i32, i32, i8, i8, i8, %struct.tree_node* (%struct.tree_node**, %struct.tree_node*, %struct.tree_node*, i32, i8*)* }
- %struct.basic_block_def = type { %struct.rtx_def*, %struct.rtx_def*, %struct.tree_node*, %struct.VEC_edge*, %struct.VEC_edge*, %struct.bitmap_head_def*, %struct.bitmap_head_def*, i8*, %struct.loop*, [2 x %struct.et_node*], %struct.basic_block_def*, %struct.basic_block_def*, %struct.reorder_block_def*, %struct.bb_ann_d*, i64, i32, i32, i32, i32 }
- %struct.bb_ann_d = type { %struct.tree_node*, i8, %struct.edge_prediction* }
- %struct.bitmap_element_def = type { %struct.bitmap_element_def*, %struct.bitmap_element_def*, i32, [4 x i32] }
- %struct.bitmap_head_def = type { %struct.bitmap_element_def*, %struct.bitmap_element_def*, i32, %struct.bitmap_obstack* }
- %struct.bitmap_obstack = type { %struct.bitmap_element_def*, %struct.bitmap_head_def*, %struct.obstack }
- %struct.cgraph_edge = type { %struct.cgraph_node*, %struct.cgraph_node*, %struct.cgraph_edge*, %struct.cgraph_edge*, %struct.cgraph_edge*, %struct.cgraph_edge*, %struct.tree_node*, i8*, i8* }
- %struct.cgraph_global_info = type { %struct.cgraph_node*, i32, i8 }
- %struct.cgraph_local_info = type { i32, i8, i8, i8, i8, i8, i8, i8 }
- %struct.cgraph_node = type { %struct.tree_node*, %struct.cgraph_edge*, %struct.cgraph_edge*, %struct.cgraph_node*, %struct.cgraph_node*, %struct.cgraph_node*, %struct.cgraph_node*, %struct.cgraph_node*, %struct.cgraph_node*, %struct.cgraph_node*, i8*, %struct.cgraph_local_info, %struct.cgraph_global_info, %struct.cgraph_rtl_info, i32, i8, i8, i8, i8, i8 }
- %struct.cgraph_rtl_info = type { i32, i8, i8 }
- %struct.cl_perfunc_opts = type { i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i32, i32, i32, i32, i32, i32, i32, i32, i32 }
- %struct.cselib_val_struct = type opaque
- %struct.dataflow_d = type { %struct.varray_head_tag*, [2 x %struct.tree_node*] }
- %struct.def_operand_ptr = type { %struct.tree_node** }
- %struct.def_optype_d = type { i32, [1 x %struct.def_operand_ptr] }
- %struct.diagnostic_context = type { %struct.pretty_printer*, [8 x i32], i8, i8, i8, void (%struct.diagnostic_context*, %struct.diagnostic_info*)*, void (%struct.diagnostic_context*, %struct.diagnostic_info*)*, void (i8*, i8**)*, %struct.tree_node*, i32, i32 }
- %struct.diagnostic_info = type { %struct.text_info, %struct.location_t, i32 }
- %struct.die_struct = type opaque
- %struct.edge_def = type { %struct.basic_block_def*, %struct.basic_block_def*, %struct.edge_def_insns, i8*, %struct.location_t*, i32, i32, i64, i32 }
- %struct.edge_def_insns = type { %struct.rtx_def* }
- %struct.edge_prediction = type { %struct.edge_prediction*, %struct.edge_def*, i32, i32 }
- %struct.eh_status = type opaque
- %struct.elt_list = type opaque
- %struct.elt_t = type { %struct.tree_node*, %struct.tree_node* }
- %struct.emit_status = type { i32, i32, %struct.rtx_def*, %struct.rtx_def*, %struct.sequence_stack*, i32, %struct.location_t, i32, i8*, %struct.rtx_def** }
- %struct.et_node = type opaque
- %struct.expr_status = type { i32, i32, i32, %struct.rtx_def*, %struct.rtx_def*, %struct.rtx_def* }
- %struct.function = type { %struct.eh_status*, %struct.expr_status*, %struct.emit_status*, %struct.varasm_status*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.function*, i32, i32, i32, i32, %struct.rtx_def*, %struct.CUMULATIVE_ARGS, %struct.rtx_def*, %struct.rtx_def*, %struct.initial_value_struct*, %struct.rtx_def*, %struct.rtx_def*, %struct.rtx_def*, %struct.rtx_def*, %struct.rtx_def*, %struct.rtx_def*, i8, i32, i64, %struct.tree_node*, %struct.tree_node*, %struct.rtx_def*, %struct.varray_head_tag*, %struct.temp_slot*, i32, %struct.var_refs_queue*, i32, i32, %struct.rtvec_def*, %struct.tree_node*, i32, i32, i32, %struct.machine_function*, i32, i32, i8, i8, %struct.language_function*, %struct.rtx_def*, i32, i32, i32, i32, %struct.location_t, %struct.varray_head_tag*, %struct.tree_node*, i8, i8, i8 }
- %struct.ggc_root_tab = type { i8*, i32, i32, void (i8*)*, void (i8*)* }
- %struct.gimplify_ctx = type { %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.varray_head_tag*, %struct.htab*, i32, i8, i8 }
- %struct.gimplify_init_ctor_preeval_data = type { %struct.tree_node*, i32 }
- %struct.ht_identifier = type { i8*, i32, i32 }
- %struct.htab = type { i32 (i8*)*, i32 (i8*, i8*)*, void (i8*)*, i8**, i32, i32, i32, i32, i32, i8* (i32, i32)*, void (i8*)*, i8*, i8* (i8*, i32, i32)*, void (i8*, i8*)*, i32 }
- %struct.initial_value_struct = type opaque
- %struct.lang_decl = type opaque
- %struct.lang_hooks = type { i8*, i32, i32 (i32)*, i32 (i32, i8**)*, void (%struct.diagnostic_context*)*, i32 (i32, i8*, i32)*, i8 (i8*, i32) zeroext *, i8 (i8**) zeroext *, i8 () zeroext *, void ()*, void ()*, void (i32)*, void ()*, i64 (%struct.tree_node*)*, %struct.tree_node* (%struct.tree_node*)*, %struct.rtx_def* (%struct.tree_node*, %struct.rtx_def*, i32, i32, %struct.rtx_def**)*, i32 (%struct.tree_node*)*, %struct.tree_node* (%struct.tree_node*)*, i32 (%struct.rtx_def*, %struct.tree_node*)*, void (%struct.tree_node*)*, i8 (%struct.tree_node*) zeroext *, %struct.tree_node* (%struct.tree_node*)*, void (%struct.tree_node*)*, void (%struct.tree_node*)*, i8 () zeroext *, i8, i8, void ()*, void (%struct.FILE*, %struct.tree_node*, i32)*, void (%struct.FILE*, %struct.tree_node*, i32)*, void (%struct.FILE*, %struct.tree_node*, i32)*, void (%struct.FILE*, %struct.tree_node*, i32)*, i8* (%struct.tree_node*, i32)*, i32 (%struct.tree_node*, %struct.tree_node*)*, %struct.tree_node* (%struct.tree_node*)*, void (%struct.diagnostic_context*, i8*)*, %struct.tree_node* (%struct.tree_node*)*, i64 (i64)*, %struct.attribute_spec*, %struct.attribute_spec*, %struct.attribute_spec*, i32 (%struct.tree_node*)*, %struct.lang_hooks_for_functions, %struct.lang_hooks_for_tree_inlining, %struct.lang_hooks_for_callgraph, %struct.lang_hooks_for_tree_dump, %struct.lang_hooks_for_decls, %struct.lang_hooks_for_types, i32 (%struct.tree_node**, %struct.tree_node**, %struct.tree_node**)*, %struct.tree_node* (%struct.tree_node*, %struct.tree_node*)*, %struct.tree_node* (i8*, %struct.tree_node*, i32, i32, i8*, %struct.tree_node*)* }
- %struct.lang_hooks_for_callgraph = type { %struct.tree_node* (%struct.tree_node**, i32*, %struct.tree_node*)*, void (%struct.tree_node*)* }
- %struct.lang_hooks_for_decls = type { i32 ()*, void (%struct.tree_node*)*, %struct.tree_node* (%struct.tree_node*)*, %struct.tree_node* ()*, i8 (%struct.tree_node*) zeroext *, void ()*, void (%struct.tree_node*)*, i8 (%struct.tree_node*) zeroext *, i8* (%struct.tree_node*)* }
- %struct.lang_hooks_for_functions = type { void (%struct.function*)*, void (%struct.function*)*, void (%struct.function*)*, void (%struct.function*)*, i8 (%struct.tree_node*) zeroext * }
- %struct.lang_hooks_for_tree_dump = type { i8 (i8*, %struct.tree_node*) zeroext *, i32 (%struct.tree_node*)* }
- %struct.lang_hooks_for_tree_inlining = type { %struct.tree_node* (%struct.tree_node**, i32*, %struct.tree_node* (%struct.tree_node**, i32*, i8*)*, i8*, %struct.pointer_set_t*)*, i32 (%struct.tree_node**)*, i32 (%struct.tree_node*)*, %struct.tree_node* (i8*, %struct.tree_node*)*, i32 (%struct.tree_node*, %struct.tree_node*)*, i32 (%struct.tree_node*)*, i8 (%struct.tree_node*, %struct.tree_node*) zeroext *, i32 (%struct.tree_node*)*, void (%struct.tree_node*)*, %struct.tree_node* (%struct.tree_node*, %struct.tree_node*, %struct.tree_node*, i32)* }
- %struct.lang_hooks_for_types = type { %struct.tree_node* (i32)*, %struct.tree_node* (i32, i32)*, %struct.tree_node* (i32, i32)*, %struct.tree_node* (%struct.tree_node*)*, %struct.tree_node* (%struct.tree_node*)*, %struct.tree_node* (i32, %struct.tree_node*)*, %struct.tree_node* (%struct.tree_node*)*, void (%struct.tree_node*, i8*)*, void (%struct.tree_node*, %struct.tree_node*)*, %struct.tree_node* (%struct.tree_node*)*, i8 }
- %struct.lang_type = type opaque
- %struct.language_function = type opaque
- %struct.location_t = type { i8*, i32 }
- %struct.loop = type opaque
- %struct.machine_function = type { %struct.rtx_def*, i32, i32, i32, %struct.arm_stack_offsets, i32, i32, i32, [14 x %struct.rtx_def*] }
- %struct.mem_attrs = type { i64, %struct.tree_node*, %struct.rtx_def*, %struct.rtx_def*, i32 }
- %struct.obstack = type { i32, %struct._obstack_chunk*, i8*, i8*, i8*, i32, i32, %struct._obstack_chunk* (i8*, i32)*, void (i8*, %struct._obstack_chunk*)*, i8*, i8 }
- %struct.output_buffer = type { %struct.obstack, %struct.FILE*, i32, [128 x i8] }
- %struct.phi_arg_d = type { %struct.tree_node*, i8 }
- %struct.pointer_set_t = type opaque
- %struct.pretty_printer = type { %struct.output_buffer*, i8*, i32, i32, i32, i32, i32, i8 (%struct.pretty_printer*, %struct.text_info*) zeroext *, i8, i8 }
- %struct.ptr_info_def = type { i8, %struct.bitmap_head_def*, %struct.tree_node* }
- %struct.real_value = type { i8, [3 x i8], [5 x i32] }
- %struct.reg_attrs = type { %struct.tree_node*, i64 }
- %struct.reg_info_def = type opaque
- %struct.reorder_block_def = type { %struct.rtx_def*, %struct.rtx_def*, %struct.basic_block_def*, %struct.basic_block_def*, %struct.basic_block_def*, i32, i32, i32 }
- %struct.rtunion = type { i32 }
- %struct.rtvec_def = type { i32, [1 x %struct.rtx_def*] }
- %struct.rtx_def = type { i16, i8, i8, %struct.u }
- %struct.sequence_stack = type { %struct.rtx_def*, %struct.rtx_def*, %struct.sequence_stack* }
- %struct.stmt_ann_d = type { %struct.tree_ann_common_d, i8, %struct.basic_block_def*, %struct.stmt_operands_d, %struct.dataflow_d*, %struct.bitmap_head_def*, i32 }
- %struct.stmt_operands_d = type { %struct.def_optype_d*, %struct.def_optype_d*, %struct.v_may_def_optype_d*, %struct.vuse_optype_d*, %struct.v_may_def_optype_d* }
- %struct.temp_slot = type opaque
- %struct.text_info = type { i8*, i8**, i32 }
- %struct.tree_ann_common_d = type { i32, i8*, %struct.tree_node* }
- %struct.tree_ann_d = type { %struct.stmt_ann_d }
- %struct.tree_binfo = type { %struct.tree_common, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.VEC_tree*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.VEC_tree }
- %struct.tree_block = type { %struct.tree_common, i8, [3 x i8], %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node* }
- %struct.tree_common = type { %struct.tree_node*, %struct.tree_node*, %struct.tree_ann_d*, i8, i8, i8, i8, i8 }
- %struct.tree_complex = type { %struct.tree_common, %struct.tree_node*, %struct.tree_node* }
- %struct.tree_decl = type { %struct.tree_common, %struct.location_t, i32, %struct.tree_node*, i8, i8, i8, i8, i8, i8, i8, i8, i32, %struct.tree_decl_u1, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.rtx_def*, i32, %struct.tree_decl_u2, %struct.tree_node*, %struct.tree_node*, i64, %struct.lang_decl* }
- %struct.tree_decl_u1 = type { i64 }
- %struct.tree_decl_u1_a = type { i32 }
- %struct.tree_decl_u2 = type { %struct.function* }
- %struct.tree_exp = type { %struct.tree_common, %struct.location_t*, i32, %struct.tree_node*, [1 x %struct.tree_node*] }
- %struct.tree_identifier = type { %struct.tree_common, %struct.ht_identifier }
- %struct.tree_int_cst = type { %struct.tree_common, %struct.tree_int_cst_lowhi }
- %struct.tree_int_cst_lowhi = type { i64, i64 }
- %struct.tree_list = type { %struct.tree_common, %struct.tree_node*, %struct.tree_node* }
- %struct.tree_node = type { %struct.tree_decl }
- %struct.tree_phi_node = type { %struct.tree_common, %struct.tree_node*, i32, i32, i32, %struct.basic_block_def*, %struct.dataflow_d*, [1 x %struct.phi_arg_d] }
- %struct.tree_real_cst = type { %struct.tree_common, %struct.real_value* }
- %struct.tree_ssa_name = type { %struct.tree_common, %struct.tree_node*, i32, %struct.ptr_info_def*, %struct.tree_node*, i8* }
- %struct.tree_statement_list = type { %struct.tree_common, %struct.tree_statement_list_node*, %struct.tree_statement_list_node* }
- %struct.tree_statement_list_node = type { %struct.tree_statement_list_node*, %struct.tree_statement_list_node*, %struct.tree_node* }
- %struct.tree_stmt_iterator = type { %struct.tree_statement_list_node*, %struct.tree_node* }
- %struct.tree_string = type { %struct.tree_common, i32, [1 x i8] }
- %struct.tree_type = type { %struct.tree_common, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, i32, i16, i8, i8, i32, %struct.tree_node*, %struct.tree_node*, %struct.rtunion, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, i64, %struct.lang_type* }
- %struct.tree_type_symtab = type { i32 }
- %struct.tree_value_handle = type { %struct.tree_common, %struct.value_set*, i32 }
- %struct.tree_vec = type { %struct.tree_common, i32, [1 x %struct.tree_node*] }
- %struct.tree_vector = type { %struct.tree_common, %struct.tree_node* }
- %struct.u = type { [1 x i64] }
- %struct.use_operand_ptr = type { %struct.tree_node** }
- %struct.use_optype_d = type { i32, [1 x %struct.def_operand_ptr] }
- %struct.v_def_use_operand_type_t = type { %struct.tree_node*, %struct.tree_node* }
- %struct.v_may_def_optype_d = type { i32, [1 x %struct.elt_t] }
- %struct.v_must_def_optype_d = type { i32, [1 x %struct.elt_t] }
- %struct.value_set = type opaque
- %struct.var_ann_d = type { %struct.tree_ann_common_d, i8, i8, %struct.tree_node*, %struct.varray_head_tag*, i32, i32, i32, %struct.tree_node*, %struct.tree_node* }
- %struct.var_refs_queue = type { %struct.rtx_def*, i32, i32, %struct.var_refs_queue* }
- %struct.varasm_status = type opaque
- %struct.varray_data = type { [1 x i64] }
- %struct.varray_head_tag = type { i32, i32, i32, i8*, %struct.u }
- %struct.vuse_optype_d = type { i32, [1 x %struct.tree_node*] }
-@gt_pch_rs_gt_gimplify_h = external global [2 x %struct.ggc_root_tab] ; <[2 x %struct.ggc_root_tab]*> [#uses=0]
-@tmp_var_id_num = external global i32 ; <i32*> [#uses=0]
-@gt_ggc_r_gt_gimplify_h = external global [1 x %struct.ggc_root_tab] ; <[1 x %struct.ggc_root_tab]*> [#uses=0]
-@__FUNCTION__.19956 = external global [15 x i8] ; <[15 x i8]*> [#uses=0]
-@str = external global [42 x i8] ; <[42 x i8]*> [#uses=1]
-@__FUNCTION__.19974 = external global [22 x i8] ; <[22 x i8]*> [#uses=0]
-@gimplify_ctxp = external global %struct.gimplify_ctx* ; <%struct.gimplify_ctx**> [#uses=0]
-@cl_pf_opts = external global %struct.cl_perfunc_opts ; <%struct.cl_perfunc_opts*> [#uses=0]
-@__FUNCTION__.20030 = external global [22 x i8] ; <[22 x i8]*> [#uses=0]
-@__FUNCTION__.20099 = external global [24 x i8] ; <[24 x i8]*> [#uses=0]
-@global_trees = external global [47 x %struct.tree_node*] ; <[47 x %struct.tree_node*]*> [#uses=0]
-@tree_code_type = external global [0 x i32] ; <[0 x i32]*> [#uses=2]
-@current_function_decl = external global %struct.tree_node* ; <%struct.tree_node**> [#uses=0]
-@str1 = external global [2 x i8] ; <[2 x i8]*> [#uses=0]
-@str2 = external global [7 x i8] ; <[7 x i8]*> [#uses=0]
-@__FUNCTION__.20151 = external global [19 x i8] ; <[19 x i8]*> [#uses=0]
-@__FUNCTION__.20221 = external global [9 x i8] ; <[9 x i8]*> [#uses=0]
-@tree_code_length = external global [0 x i8] ; <[0 x i8]*> [#uses=0]
-@__FUNCTION__.20435 = external global [17 x i8] ; <[17 x i8]*> [#uses=0]
-@__FUNCTION__.20496 = external global [19 x i8] ; <[19 x i8]*> [#uses=0]
-@cfun = external global %struct.function* ; <%struct.function**> [#uses=0]
-@__FUNCTION__.20194 = external global [15 x i8] ; <[15 x i8]*> [#uses=0]
-@__FUNCTION__.19987 = external global [21 x i8] ; <[21 x i8]*> [#uses=0]
-@__FUNCTION__.20532 = external global [21 x i8] ; <[21 x i8]*> [#uses=0]
-@__FUNCTION__.20583 = external global [19 x i8] ; <[19 x i8]*> [#uses=0]
-@__FUNCTION__.20606 = external global [22 x i8] ; <[22 x i8]*> [#uses=0]
-@__FUNCTION__.20644 = external global [17 x i8] ; <[17 x i8]*> [#uses=0]
-@__FUNCTION__.20681 = external global [13 x i8] ; <[13 x i8]*> [#uses=0]
-@__FUNCTION__.20700 = external global [13 x i8] ; <[13 x i8]*> [#uses=0]
-@__FUNCTION__.21426 = external global [20 x i8] ; <[20 x i8]*> [#uses=0]
-@__FUNCTION__.21471 = external global [17 x i8] ; <[17 x i8]*> [#uses=0]
-@__FUNCTION__.21962 = external global [27 x i8] ; <[27 x i8]*> [#uses=0]
-@__FUNCTION__.22992 = external global [21 x i8] ; <[21 x i8]*> [#uses=0]
-@__FUNCTION__.23735 = external global [15 x i8] ; <[15 x i8]*> [#uses=0]
-@lang_hooks = external global %struct.lang_hooks ; <%struct.lang_hooks*> [#uses=0]
-@__FUNCTION__.27383 = external global [22 x i8] ; <[22 x i8]*> [#uses=0]
-@__FUNCTION__.20776 = external global [21 x i8] ; <[21 x i8]*> [#uses=0]
-@__FUNCTION__.10672 = external global [9 x i8] ; <[9 x i8]*> [#uses=0]
-@str3 = external global [47 x i8] ; <[47 x i8]*> [#uses=0]
-@str4 = external global [7 x i8] ; <[7 x i8]*> [#uses=0]
-@__FUNCTION__.20065 = external global [25 x i8] ; <[25 x i8]*> [#uses=0]
-@__FUNCTION__.23256 = external global [16 x i8] ; <[16 x i8]*> [#uses=0]
-@__FUNCTION__.23393 = external global [19 x i8] ; <[19 x i8]*> [#uses=0]
-@__FUNCTION__.20043 = external global [21 x i8] ; <[21 x i8]*> [#uses=0]
-@__FUNCTION__.20729 = external global [23 x i8] ; <[23 x i8]*> [#uses=0]
-@__FUNCTION__.20563 = external global [24 x i8] ; <[24 x i8]*> [#uses=0]
-@__FUNCTION__.10663 = external global [10 x i8] ; <[10 x i8]*> [#uses=0]
-@__FUNCTION__.20367 = external global [21 x i8] ; <[21 x i8]*> [#uses=0]
-@__FUNCTION__.20342 = external global [15 x i8] ; <[15 x i8]*> [#uses=0]
-@input_location = external global %struct.location_t ; <%struct.location_t*> [#uses=0]
-@__FUNCTION__.24510 = external global [27 x i8] ; <[27 x i8]*> [#uses=0]
-@__FUNCTION__.25097 = external global [25 x i8] ; <[25 x i8]*> [#uses=0]
-@__FUNCTION__.24705 = external global [26 x i8] ; <[26 x i8]*> [#uses=0]
-@str5 = external global [2 x i8] ; <[2 x i8]*> [#uses=0]
-@__FUNCTION__.25136 = external global [21 x i8] ; <[21 x i8]*> [#uses=0]
-@__FUNCTION__.24450 = external global [31 x i8] ; <[31 x i8]*> [#uses=0]
-@implicit_built_in_decls = external global [471 x %struct.tree_node*] ; <[471 x %struct.tree_node*]*> [#uses=0]
-@__FUNCTION__.24398 = external global [31 x i8] ; <[31 x i8]*> [#uses=0]
-@__FUNCTION__.26156 = external global [14 x i8] ; <[14 x i8]*> [#uses=1]
-@unknown_location = external global %struct.location_t ; <%struct.location_t*> [#uses=0]
-@__FUNCTION__.23038 = external global [19 x i8] ; <[19 x i8]*> [#uses=0]
-@str6 = external global [43 x i8] ; <[43 x i8]*> [#uses=0]
-@__FUNCTION__.25476 = external global [19 x i8] ; <[19 x i8]*> [#uses=0]
-@__FUNCTION__.22136 = external global [20 x i8] ; <[20 x i8]*> [#uses=1]
-@__FUNCTION__.21997 = external global [23 x i8] ; <[23 x i8]*> [#uses=0]
-@__FUNCTION__.21247 = external global [19 x i8] ; <[19 x i8]*> [#uses=0]
-@built_in_decls = external global [471 x %struct.tree_node*] ; <[471 x %struct.tree_node*]*> [#uses=0]
-@__FUNCTION__.21924 = external global [19 x i8] ; <[19 x i8]*> [#uses=0]
-@__FUNCTION__.21861 = external global [25 x i8] ; <[25 x i8]*> [#uses=0]
-@global_dc = external global %struct.diagnostic_context* ; <%struct.diagnostic_context**> [#uses=0]
-@__FUNCTION__.25246 = external global [32 x i8] ; <[32 x i8]*> [#uses=0]
-@str7 = external global [4 x i8] ; <[4 x i8]*> [#uses=0]
-@stderr = external global %struct.FILE* ; <%struct.FILE**> [#uses=0]
-@str8 = external global [24 x i8] ; <[24 x i8]*> [#uses=0]
-@str9 = external global [22 x i8] ; <[22 x i8]*> [#uses=0]
-@__FUNCTION__.27653 = external global [21 x i8] ; <[21 x i8]*> [#uses=0]
-@__FUNCTION__.27322 = external global [21 x i8] ; <[21 x i8]*> [#uses=0]
-@__FUNCTION__.27139 = external global [20 x i8] ; <[20 x i8]*> [#uses=0]
-@__FUNCTION__.22462 = external global [23 x i8] ; <[23 x i8]*> [#uses=0]
-@str10 = external global [6 x i8] ; <[6 x i8]*> [#uses=0]
-@__FUNCTION__.25389 = external global [19 x i8] ; <[19 x i8]*> [#uses=0]
-@__FUNCTION__.25650 = external global [18 x i8] ; <[18 x i8]*> [#uses=0]
-@str11 = external global [32 x i8] ; <[32 x i8]*> [#uses=0]
-@str12 = external global [3 x i8] ; <[3 x i8]*> [#uses=0]
-@str13 = external global [44 x i8] ; <[44 x i8]*> [#uses=0]
-@__FUNCTION__.27444 = external global [14 x i8] ; <[14 x i8]*> [#uses=0]
-@timevar_enable = external global i8 ; <i8*> [#uses=0]
-@__FUNCTION__.27533 = external global [23 x i8] ; <[23 x i8]*> [#uses=0]
-@flag_instrument_function_entry_exit = external global i32 ; <i32*> [#uses=0]
-@__FUNCTION__.25331 = external global [23 x i8] ; <[23 x i8]*> [#uses=0]
-@__FUNCTION__.20965 = external global [19 x i8] ; <[19 x i8]*> [#uses=0]
-@str14 = external global [12 x i8] ; <[12 x i8]*> [#uses=0]
-@__FUNCTION__.26053 = external global [21 x i8] ; <[21 x i8]*> [#uses=0]
-@__FUNCTION__.26004 = external global [20 x i8] ; <[20 x i8]*> [#uses=0]
-@str15 = external global [8 x i8] ; <[8 x i8]*> [#uses=0]
-@__FUNCTION__.21584 = external global [21 x i8] ; <[21 x i8]*> [#uses=0]
-@str16 = external global [12 x i8] ; <[12 x i8]*> [#uses=0]
-@__FUNCTION__.25903 = external global [28 x i8] ; <[28 x i8]*> [#uses=0]
-@__FUNCTION__.22930 = external global [23 x i8] ; <[23 x i8]*> [#uses=0]
-@__FUNCTION__.23832 = external global [19 x i8] ; <[19 x i8]*> [#uses=0]
-@str17 = external global [6 x i8] ; <[6 x i8]*> [#uses=0]
-@__FUNCTION__.24620 = external global [24 x i8] ; <[24 x i8]*> [#uses=0]
-@__FUNCTION__.24582 = external global [30 x i8] ; <[30 x i8]*> [#uses=0]
-@__FUNCTION__.21382 = external global [19 x i8] ; <[19 x i8]*> [#uses=0]
-@__FUNCTION__.21117 = external global [21 x i8] ; <[21 x i8]*> [#uses=0]
-
-
-declare void @push_gimplify_context()
-
-declare i32 @gimple_tree_hash(i8*)
-
-declare i32 @iterative_hash_expr(%struct.tree_node*, i32)
-
-declare i32 @gimple_tree_eq(i8*, i8*)
-
-declare i32 @operand_equal_p(%struct.tree_node*, %struct.tree_node*, i32)
-
-declare void @fancy_abort(i8*, i32, i8*)
-
-declare i8* @xcalloc(i32, i32)
-
-declare %struct.htab* @htab_create(i32, i32 (i8*)*, i32 (i8*, i8*)*, void (i8*)*)
-
-declare void @free(i8*)
-
-declare void @gimple_push_bind_expr(%struct.tree_node*)
-
-declare void @gimple_pop_bind_expr()
-
-declare %struct.tree_node* @gimple_current_bind_expr()
-
-declare fastcc void @gimple_push_condition()
-
-declare %struct.tree_node* @create_artificial_label()
-
-declare %struct.tree_node* @build_decl_stat(i32, %struct.tree_node*, %struct.tree_node*)
-
-declare void @tree_class_check_failed(%struct.tree_node*, i32, i8*, i32, i8*)
-
-declare %struct.tree_node* @create_tmp_var_name(i8*)
-
-declare i32 @strlen(i8*)
-
-declare void @llvm.memcpy.i32(i8*, i8*, i32, i32)
-
-declare i32 @sprintf(i8*, i8*, ...)
-
-declare %struct.tree_node* @get_identifier(i8*)
-
-declare %struct.tree_node* @create_tmp_var_raw(%struct.tree_node*, i8*)
-
-declare %struct.tree_node* @build_qualified_type(%struct.tree_node*, i32)
-
-declare i8* @get_name(%struct.tree_node*)
-
-declare void @tree_operand_check_failed(i32, i32, i8*, i32, i8*)
-
-declare void @tree_check_failed(%struct.tree_node*, i8*, i32, i8*, ...)
-
-declare void @declare_tmp_vars(%struct.tree_node*, %struct.tree_node*)
-
-declare %struct.tree_node* @nreverse(%struct.tree_node*)
-
-declare void @gimple_add_tmp_var(%struct.tree_node*)
-
-declare void @record_vars(%struct.tree_node*)
-
-declare %struct.tree_node* @create_tmp_var(%struct.tree_node*, i8*)
-
-declare void @pop_gimplify_context(%struct.tree_node*)
-
-declare void @htab_delete(%struct.htab*)
-
-declare fastcc void @annotate_one_with_locus(%struct.tree_node*, i32, i32)
-
-declare void @annotate_with_locus(%struct.tree_node*, i32, i32)
-
-declare %struct.tree_node* @mostly_copy_tree_r(%struct.tree_node**, i32*, i8*)
-
-declare %struct.tree_node* @copy_tree_r(%struct.tree_node**, i32*, i8*)
-
-declare %struct.tree_node* @mark_decls_volatile_r(%struct.tree_node**, i32*, i8*)
-
-declare %struct.tree_node* @copy_if_shared_r(%struct.tree_node**, i32*, i8*)
-
-declare %struct.tree_node* @walk_tree(%struct.tree_node**, %struct.tree_node* (%struct.tree_node**, i32*, i8*)*, i8*, %struct.pointer_set_t*)
-
-declare %struct.tree_node* @unmark_visited_r(%struct.tree_node**, i32*, i8*)
-
-declare fastcc void @unshare_body(%struct.tree_node**, %struct.tree_node*)
-
-declare %struct.cgraph_node* @cgraph_node(%struct.tree_node*)
-
-declare fastcc void @unvisit_body(%struct.tree_node**, %struct.tree_node*)
-
-declare void @unshare_all_trees(%struct.tree_node*)
-
-declare %struct.tree_node* @unshare_expr(%struct.tree_node*)
-
-declare %struct.tree_node* @build_and_jump(%struct.tree_node**)
-
-declare %struct.tree_node* @build1_stat(i32, %struct.tree_node*, %struct.tree_node*)
-
-declare i32 @compare_case_labels(i8*, i8*)
-
-declare i32 @tree_int_cst_compare(%struct.tree_node*, %struct.tree_node*)
-
-declare void @sort_case_labels(%struct.tree_node*)
-
-declare void @tree_vec_elt_check_failed(i32, i32, i8*, i32, i8*)
-
-declare void @qsort(i8*, i32, i32, i32 (i8*, i8*)*)
-
-declare %struct.tree_node* @force_labels_r(%struct.tree_node**, i32*, i8*)
-
-declare fastcc void @canonicalize_component_ref(%struct.tree_node**)
-
-declare %struct.tree_node* @get_unwidened(%struct.tree_node*, %struct.tree_node*)
-
-declare fastcc void @maybe_with_size_expr(%struct.tree_node**)
-
-declare %struct.tree_node* @substitute_placeholder_in_expr(%struct.tree_node*, %struct.tree_node*)
-
-declare %struct.tree_node* @build2_stat(i32, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*)
-
-declare fastcc %struct.tree_node* @gimple_boolify(%struct.tree_node*)
-
-declare %struct.tree_node* @convert(%struct.tree_node*, %struct.tree_node*)
-
-declare %struct.tree_node* @gimplify_init_ctor_preeval_1(%struct.tree_node**, i32*, i8*)
-
-declare i64 @get_alias_set(%struct.tree_node*)
-
-declare i32 @alias_sets_conflict_p(i64, i64)
-
-declare fastcc i8 @cpt_same_type(%struct.tree_node*, %struct.tree_node*) zeroext
-
-declare %struct.tree_node* @check_pointer_types_r(%struct.tree_node**, i32*, i8*)
-
-declare %struct.tree_node* @voidify_wrapper_expr(%struct.tree_node*, %struct.tree_node*)
-
-declare i32 @integer_zerop(%struct.tree_node*)
-
-declare fastcc void @append_to_statement_list_1(%struct.tree_node*, %struct.tree_node**)
-
-declare %struct.tree_node* @alloc_stmt_list()
-
-declare void @tsi_link_after(%struct.tree_stmt_iterator*, %struct.tree_node*, i32)
-
-declare void @append_to_statement_list_force(%struct.tree_node*, %struct.tree_node**)
-
-declare void @append_to_statement_list(%struct.tree_node*, %struct.tree_node**)
-
-declare fastcc %struct.tree_node* @shortcut_cond_r(%struct.tree_node*, %struct.tree_node**, %struct.tree_node**)
-
-declare %struct.tree_node* @build3_stat(i32, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*)
-
-declare fastcc %struct.tree_node* @shortcut_cond_expr(%struct.tree_node*)
-
-declare %struct.tree_node* @expr_last(%struct.tree_node*)
-
-declare i8 @block_may_fallthru(%struct.tree_node*) zeroext
-
-declare fastcc void @gimple_pop_condition(%struct.tree_node**)
-
-declare %struct.tree_node* @gimple_build_eh_filter(%struct.tree_node*, %struct.tree_node*, %struct.tree_node*)
-
-declare void @annotate_all_with_locus(%struct.tree_node**, i32, i32)
-
-declare fastcc %struct.tree_node* @internal_get_tmp_var(%struct.tree_node*, %struct.tree_node**, %struct.tree_node**, i8 zeroext )
-
-define i32 @gimplify_expr(%struct.tree_node** %expr_p, %struct.tree_node** %pre_p, %struct.tree_node** %post_p, i8 (%struct.tree_node*) zeroext * %gimple_test_f, i32 %fallback) {
-entry:
- %internal_post = alloca %struct.tree_node*, align 4 ; <%struct.tree_node**> [#uses=2]
- %pre_p_addr.0 = select i1 false, %struct.tree_node** null, %struct.tree_node** %pre_p ; <%struct.tree_node**> [#uses=7]
- %post_p_addr.0 = select i1 false, %struct.tree_node** %internal_post, %struct.tree_node** %post_p ; <%struct.tree_node**> [#uses=7]
- br i1 false, label %bb277, label %bb191
-
-bb191: ; preds = %entry
- ret i32 0
-
-bb277: ; preds = %entry
- %tmp283 = call i32 null( %struct.tree_node** %expr_p, %struct.tree_node** %pre_p_addr.0, %struct.tree_node** %post_p_addr.0 ) ; <i32> [#uses=1]
- switch i32 %tmp283, label %bb7478 [
- i32 0, label %cond_next289
- i32 -1, label %cond_next298
- ]
-
-cond_next289: ; preds = %bb277
- ret i32 0
-
-cond_next298: ; preds = %bb277
- switch i32 0, label %bb7444 [
- i32 24, label %bb7463
- i32 25, label %bb7463
- i32 26, label %bb7463
- i32 27, label %bb7463
- i32 28, label %bb7463
- i32 33, label %bb4503
- i32 39, label %bb397
- i32 40, label %bb5650
- i32 41, label %bb4339
- i32 42, label %bb4350
- i32 43, label %bb4350
- i32 44, label %bb319
- i32 45, label %bb397
- i32 46, label %bb6124
- i32 47, label %bb7463
- i32 49, label %bb5524
- i32 50, label %bb1283
- i32 51, label %bb1289
- i32 52, label %bb1289
- i32 53, label %bb5969
- i32 54, label %bb408
- i32 56, label %bb5079
- i32 57, label %bb428
- i32 59, label %bb5965
- i32 74, label %bb4275
- i32 75, label %bb4275
- i32 76, label %bb4275
- i32 77, label %bb4275
- i32 91, label %bb1296
- i32 92, label %bb1296
- i32 96, label %bb1322
- i32 112, label %bb2548
- i32 113, label %bb2548
- i32 115, label %bb397
- i32 116, label %bb5645
- i32 117, label %bb1504
- i32 121, label %bb397
- i32 122, label %bb397
- i32 123, label %bb313
- i32 124, label %bb313
- i32 125, label %bb313
- i32 126, label %bb313
- i32 127, label %bb2141
- i32 128, label %cond_next5873
- i32 129, label %cond_next5873
- i32 130, label %bb4536
- i32 131, label %bb5300
- i32 132, label %bb5170
- i32 133, label %bb5519
- i32 134, label %bb5091
- i32 135, label %bb5083
- i32 136, label %bb5087
- i32 137, label %bb5382
- i32 139, label %bb7463
- i32 140, label %bb7463
- i32 142, label %bb5974
- i32 143, label %bb6049
- i32 147, label %bb6296
- i32 151, label %cond_next6474
- ]
-
-bb313: ; preds = %cond_next298, %cond_next298, %cond_next298, %cond_next298
- ret i32 0
-
-bb319: ; preds = %cond_next298
- ret i32 0
-
-bb397: ; preds = %cond_next298, %cond_next298, %cond_next298, %cond_next298, %cond_next298
- ret i32 0
-
-bb408: ; preds = %cond_next298
- %tmp413 = call fastcc i32 @gimplify_cond_expr( %struct.tree_node** %expr_p, %struct.tree_node** %pre_p_addr.0, %struct.tree_node** %post_p_addr.0, %struct.tree_node* null, i32 %fallback ) ; <i32> [#uses=0]
- ret i32 0
-
-bb428: ; preds = %cond_next298
- ret i32 0
-
-bb1283: ; preds = %cond_next298
- ret i32 0
-
-bb1289: ; preds = %cond_next298, %cond_next298
- ret i32 0
-
-bb1296: ; preds = %cond_next298, %cond_next298
- ret i32 0
-
-bb1322: ; preds = %cond_next298
- ret i32 0
-
-bb1504: ; preds = %cond_next298
- ret i32 0
-
-bb2141: ; preds = %cond_next298
- ret i32 0
-
-bb2548: ; preds = %cond_next298, %cond_next298
- %tmp2554 = load %struct.tree_node** %expr_p ; <%struct.tree_node*> [#uses=2]
- %tmp2562 = and i32 0, 255 ; <i32> [#uses=1]
- %tmp2569 = add i8 0, -4 ; <i8> [#uses=1]
- icmp ugt i8 %tmp2569, 5 ; <i1>:0 [#uses=2]
- %tmp2587 = load i8* null ; <i8> [#uses=1]
- icmp eq i8 %tmp2587, 0 ; <i1>:1 [#uses=2]
- %tmp2607 = load %struct.tree_node** null ; <%struct.tree_node*> [#uses=2]
- br i1 false, label %bb2754, label %cond_next2617
-
-cond_next2617: ; preds = %bb2548
- ret i32 0
-
-bb2754: ; preds = %bb2548
- br i1 %0, label %cond_true2780, label %cond_next2783
-
-cond_true2780: ; preds = %bb2754
- call void @tree_class_check_failed( %struct.tree_node* %tmp2554, i32 9, i8* getelementptr ([42 x i8]* @str, i32 0, i32 0), i32 1415, i8* getelementptr ([20 x i8]* @__FUNCTION__.22136, i32 0, i32 0) )
- unreachable
-
-cond_next2783: ; preds = %bb2754
- %tmp2825 = and i32 0, 255 ; <i32> [#uses=1]
- %tmp2829 = load i32* null ; <i32> [#uses=1]
- %tmp28292830 = trunc i32 %tmp2829 to i8 ; <i8> [#uses=1]
- %tmp2832 = add i8 %tmp28292830, -4 ; <i8> [#uses=1]
- icmp ugt i8 %tmp2832, 5 ; <i1>:2 [#uses=1]
- icmp eq i8 0, 0 ; <i1>:3 [#uses=1]
- %tmp28652866 = bitcast %struct.tree_node* %tmp2607 to %struct.tree_exp* ; <%struct.tree_exp*> [#uses=1]
- %tmp2868 = getelementptr %struct.tree_exp* %tmp28652866, i32 0, i32 4, i32 0 ; <%struct.tree_node**> [#uses=1]
- %tmp2870 = load %struct.tree_node** %tmp2868 ; <%struct.tree_node*> [#uses=1]
- br i1 %1, label %cond_true2915, label %cond_next2927
-
-cond_true2915: ; preds = %cond_next2783
- unreachable
-
-cond_next2927: ; preds = %cond_next2783
- %tmp2938 = load %struct.tree_node** null ; <%struct.tree_node*> [#uses=1]
- %tmp2944 = load i32* null ; <i32> [#uses=1]
- %tmp2946 = and i32 %tmp2944, 255 ; <i32> [#uses=1]
- %tmp2949 = getelementptr [0 x i32]* @tree_code_type, i32 0, i32 %tmp2946 ; <i32*> [#uses=1]
- %tmp2950 = load i32* %tmp2949 ; <i32> [#uses=1]
- icmp eq i32 %tmp2950, 2 ; <i1>:4 [#uses=1]
- br i1 %4, label %cond_next2954, label %cond_true2951
-
-cond_true2951: ; preds = %cond_next2927
- call void @tree_class_check_failed( %struct.tree_node* %tmp2938, i32 2, i8* getelementptr ([42 x i8]* @str, i32 0, i32 0), i32 1415, i8* getelementptr ([20 x i8]* @__FUNCTION__.22136, i32 0, i32 0) )
- unreachable
-
-cond_next2954: ; preds = %cond_next2927
- br i1 %0, label %cond_true2991, label %cond_next2994
-
-cond_true2991: ; preds = %cond_next2954
- unreachable
-
-cond_next2994: ; preds = %cond_next2954
- br i1 %1, label %cond_true3009, label %cond_next3021
-
-cond_true3009: ; preds = %cond_next2994
- call void @tree_operand_check_failed( i32 0, i32 %tmp2562, i8* getelementptr ([42 x i8]* @str, i32 0, i32 0), i32 1415, i8* getelementptr ([20 x i8]* @__FUNCTION__.22136, i32 0, i32 0) )
- unreachable
-
-cond_next3021: ; preds = %cond_next2994
- br i1 %2, label %cond_true3044, label %cond_next3047
-
-cond_true3044: ; preds = %cond_next3021
- call void @tree_class_check_failed( %struct.tree_node* %tmp2607, i32 9, i8* getelementptr ([42 x i8]* @str, i32 0, i32 0), i32 1415, i8* getelementptr ([20 x i8]* @__FUNCTION__.22136, i32 0, i32 0) )
- unreachable
-
-cond_next3047: ; preds = %cond_next3021
- br i1 %3, label %cond_true3062, label %cond_next3074
-
-cond_true3062: ; preds = %cond_next3047
- call void @tree_operand_check_failed( i32 0, i32 %tmp2825, i8* getelementptr ([42 x i8]* @str, i32 0, i32 0), i32 1415, i8* getelementptr ([20 x i8]* @__FUNCTION__.22136, i32 0, i32 0) )
- unreachable
-
-cond_next3074: ; preds = %cond_next3047
- %tmp3084 = getelementptr %struct.tree_node* %tmp2870, i32 0, i32 0, i32 0, i32 1 ; <%struct.tree_node**> [#uses=1]
- %tmp3085 = load %struct.tree_node** %tmp3084 ; <%struct.tree_node*> [#uses=1]
- %tmp31043105 = bitcast %struct.tree_node* %tmp3085 to %struct.tree_type* ; <%struct.tree_type*> [#uses=1]
- %tmp3106 = getelementptr %struct.tree_type* %tmp31043105, i32 0, i32 6 ; <i16*> [#uses=1]
- %tmp31063107 = bitcast i16* %tmp3106 to i32* ; <i32*> [#uses=1]
- %tmp3108 = load i32* %tmp31063107 ; <i32> [#uses=1]
- xor i32 %tmp3108, 0 ; <i32>:5 [#uses=1]
- %tmp81008368 = and i32 %5, 65024 ; <i32> [#uses=1]
- icmp eq i32 %tmp81008368, 0 ; <i1>:6 [#uses=1]
- br i1 %6, label %cond_next3113, label %bb3351
-
-cond_next3113: ; preds = %cond_next3074
- ret i32 0
-
-bb3351: ; preds = %cond_next3074
- %tmp3354 = call i8 @tree_ssa_useless_type_conversion( %struct.tree_node* %tmp2554 ) zeroext ; <i8> [#uses=1]
- icmp eq i8 %tmp3354, 0 ; <i1>:7 [#uses=1]
- %tmp3424 = load i32* null ; <i32> [#uses=1]
- br i1 %7, label %cond_next3417, label %cond_true3356
-
-cond_true3356: ; preds = %bb3351
- ret i32 0
-
-cond_next3417: ; preds = %bb3351
- br i1 false, label %cond_true3429, label %cond_next4266
-
-cond_true3429: ; preds = %cond_next3417
- %tmp3443 = and i32 %tmp3424, 255 ; <i32> [#uses=0]
- ret i32 0
-
-cond_next4266: ; preds = %cond_next3417
- %tmp4268 = load %struct.tree_node** %expr_p ; <%struct.tree_node*> [#uses=1]
- icmp eq %struct.tree_node* %tmp4268, null ; <i1>:8 [#uses=1]
- br i1 %8, label %bb4275, label %bb7463
-
-bb4275: ; preds = %cond_next4266, %cond_next298, %cond_next298, %cond_next298, %cond_next298
- %tmp4289 = and i32 0, 255 ; <i32> [#uses=2]
- %tmp4292 = getelementptr [0 x i32]* @tree_code_type, i32 0, i32 %tmp4289 ; <i32*> [#uses=1]
- %tmp4293 = load i32* %tmp4292 ; <i32> [#uses=1]
- %tmp42934294 = trunc i32 %tmp4293 to i8 ; <i8> [#uses=1]
- %tmp4296 = add i8 %tmp42934294, -4 ; <i8> [#uses=1]
- icmp ugt i8 %tmp4296, 5 ; <i1>:9 [#uses=1]
- br i1 %9, label %cond_true4297, label %cond_next4300
-
-cond_true4297: ; preds = %bb4275
- unreachable
-
-cond_next4300: ; preds = %bb4275
- %tmp4314 = load i8* null ; <i8> [#uses=1]
- icmp eq i8 %tmp4314, 0 ; <i1>:10 [#uses=1]
- br i1 %10, label %cond_true4315, label %cond_next4327
-
-cond_true4315: ; preds = %cond_next4300
- call void @tree_operand_check_failed( i32 0, i32 %tmp4289, i8* getelementptr ([42 x i8]* @str, i32 0, i32 0), i32 3997, i8* getelementptr ([14 x i8]* @__FUNCTION__.26156, i32 0, i32 0) )
- unreachable
-
-cond_next4327: ; preds = %cond_next4300
- %tmp4336 = call i32 @gimplify_expr( %struct.tree_node** null, %struct.tree_node** %pre_p_addr.0, %struct.tree_node** %post_p_addr.0, i8 (%struct.tree_node*) zeroext * @is_gimple_val, i32 1 ) ; <i32> [#uses=0]
- ret i32 0
-
-bb4339: ; preds = %cond_next298
- ret i32 0
-
-bb4350: ; preds = %cond_next298, %cond_next298
- ret i32 0
-
-bb4503: ; preds = %cond_next298
- ret i32 0
-
-bb4536: ; preds = %cond_next298
- ret i32 0
-
-bb5079: ; preds = %cond_next298
- ret i32 0
-
-bb5083: ; preds = %cond_next298
- ret i32 0
-
-bb5087: ; preds = %cond_next298
- ret i32 0
-
-bb5091: ; preds = %cond_next298
- ret i32 0
-
-bb5170: ; preds = %cond_next298
- ret i32 0
-
-bb5300: ; preds = %cond_next298
- ret i32 0
-
-bb5382: ; preds = %cond_next298
- ret i32 0
-
-bb5519: ; preds = %cond_next298
- ret i32 0
-
-bb5524: ; preds = %cond_next298
- ret i32 0
-
-bb5645: ; preds = %cond_next298
- ret i32 0
-
-bb5650: ; preds = %cond_next298
- ret i32 0
-
-cond_next5873: ; preds = %cond_next298, %cond_next298
- ret i32 0
-
-bb5965: ; preds = %cond_next298
- %tmp5968 = call fastcc i32 @gimplify_cleanup_point_expr( %struct.tree_node** %expr_p, %struct.tree_node** %pre_p_addr.0 ) ; <i32> [#uses=0]
- ret i32 0
-
-bb5969: ; preds = %cond_next298
- %tmp5973 = call fastcc i32 @gimplify_target_expr( %struct.tree_node** %expr_p, %struct.tree_node** %pre_p_addr.0, %struct.tree_node** %post_p_addr.0 ) ; <i32> [#uses=0]
- ret i32 0
-
-bb5974: ; preds = %cond_next298
- ret i32 0
-
-bb6049: ; preds = %cond_next298
- ret i32 0
-
-bb6124: ; preds = %cond_next298
- ret i32 0
-
-bb6296: ; preds = %cond_next298
- ret i32 0
-
-cond_next6474: ; preds = %cond_next298
- icmp eq %struct.tree_node** %internal_post, %post_p_addr.0 ; <i1>:11 [#uses=1]
- %iftmp.381.0 = select i1 %11, %struct.tree_node** null, %struct.tree_node** %post_p_addr.0 ; <%struct.tree_node**> [#uses=1]
- %tmp6490 = call i32 @gimplify_expr( %struct.tree_node** null, %struct.tree_node** %pre_p_addr.0, %struct.tree_node** %iftmp.381.0, i8 (%struct.tree_node*) zeroext * %gimple_test_f, i32 %fallback ) ; <i32> [#uses=0]
- %tmp6551 = call i32 @gimplify_expr( %struct.tree_node** null, %struct.tree_node** %pre_p_addr.0, %struct.tree_node** %post_p_addr.0, i8 (%struct.tree_node*) zeroext * @is_gimple_val, i32 1 ) ; <i32> [#uses=0]
- ret i32 0
-
-bb7444: ; preds = %cond_next298
- ret i32 0
-
-bb7463: ; preds = %cond_next4266, %cond_next298, %cond_next298, %cond_next298, %cond_next298, %cond_next298, %cond_next298, %cond_next298, %cond_next298
- ret i32 0
-
-bb7478: ; preds = %bb277
- ret i32 0
-}
-
-declare i8 @is_gimple_formal_tmp_rhs(%struct.tree_node*) zeroext
-
-declare void @gimplify_and_add(%struct.tree_node*, %struct.tree_node**)
-
-declare %struct.tree_node* @get_initialized_tmp_var(%struct.tree_node*, %struct.tree_node**, %struct.tree_node**)
-
-declare %struct.tree_node* @get_formal_tmp_var(%struct.tree_node*, %struct.tree_node**)
-
-declare fastcc void @gimplify_init_ctor_preeval(%struct.tree_node**, %struct.tree_node**, %struct.tree_node**, %struct.gimplify_init_ctor_preeval_data*)
-
-declare i8 @type_contains_placeholder_p(%struct.tree_node*) zeroext
-
-declare i8 @is_gimple_mem_rhs(%struct.tree_node*) zeroext
-
-declare fastcc i32 @gimplify_modify_expr_rhs(%struct.tree_node**, %struct.tree_node**, %struct.tree_node**, %struct.tree_node**, %struct.tree_node**, i8 zeroext )
-
-declare %struct.tree_node* @fold_indirect_ref(%struct.tree_node*)
-
-declare fastcc i32 @gimplify_compound_expr(%struct.tree_node**, %struct.tree_node**, i8 zeroext )
-
-declare i8 @is_gimple_lvalue(%struct.tree_node*) zeroext
-
-declare void @categorize_ctor_elements(%struct.tree_node*, i64*, i64*, i64*, i8*)
-
-declare void @lhd_set_decl_assembler_name(%struct.tree_node*)
-
-declare i64 @int_size_in_bytes(%struct.tree_node*)
-
-declare i32 @can_move_by_pieces(i64, i32)
-
-declare i64 @count_type_elements(%struct.tree_node*)
-
-declare void @gimplify_stmt(%struct.tree_node**)
-
-declare %struct.tree_node* @get_base_address(%struct.tree_node*)
-
-declare fastcc void @gimplify_init_ctor_eval(%struct.tree_node*, %struct.tree_node*, %struct.tree_node**, i8 zeroext )
-
-declare %struct.tree_node* @build_complex(%struct.tree_node*, %struct.tree_node*, %struct.tree_node*)
-
-declare i8 (%struct.tree_node*) zeroext * @rhs_predicate_for(%struct.tree_node*)
-
-declare %struct.tree_node* @build_vector(%struct.tree_node*, %struct.tree_node*)
-
-declare i8 @is_gimple_val(%struct.tree_node*) zeroext
-
-declare i8 @is_gimple_reg_type(%struct.tree_node*) zeroext
-
-declare fastcc i32 @gimplify_cond_expr(%struct.tree_node**, %struct.tree_node**, %struct.tree_node**, %struct.tree_node*, i32)
-
-declare fastcc i32 @gimplify_modify_expr(%struct.tree_node**, %struct.tree_node**, %struct.tree_node**, i8 zeroext )
-
-declare %struct.tree_node* @tree_cons_stat(%struct.tree_node*, %struct.tree_node*, %struct.tree_node*)
-
-declare %struct.tree_node* @build_fold_addr_expr(%struct.tree_node*)
-
-declare %struct.tree_node* @build_function_call_expr(%struct.tree_node*, %struct.tree_node*)
-
-declare i8 @is_gimple_addressable(%struct.tree_node*) zeroext
-
-declare i8 @is_gimple_reg(%struct.tree_node*) zeroext
-
-declare %struct.tree_node* @make_ssa_name(%struct.tree_node*, %struct.tree_node*)
-
-declare i8 @tree_ssa_useless_type_conversion(%struct.tree_node*) zeroext
-
-declare fastcc i32 @gimplify_self_mod_expr(%struct.tree_node**, %struct.tree_node**, %struct.tree_node**, i8 zeroext )
-
-declare fastcc i32 @gimplify_compound_lval(%struct.tree_node**, %struct.tree_node**, %struct.tree_node**, i32)
-
-declare %struct.tree_node* @get_callee_fndecl(%struct.tree_node*)
-
-declare %struct.tree_node* @fold_builtin(%struct.tree_node*, i8 zeroext )
-
-declare void @error(i8*, ...)
-
-declare %struct.tree_node* @build_empty_stmt()
-
-declare i8 @fold_builtin_next_arg(%struct.tree_node*) zeroext
-
-declare fastcc i32 @gimplify_arg(%struct.tree_node**, %struct.tree_node**)
-
-declare i8 @is_gimple_call_addr(%struct.tree_node*) zeroext
-
-declare i32 @call_expr_flags(%struct.tree_node*)
-
-declare void @recalculate_side_effects(%struct.tree_node*)
-
-declare %struct.tree_node* @fold_convert(%struct.tree_node*, %struct.tree_node*)
-
-declare void @recompute_tree_invarant_for_addr_expr(%struct.tree_node*)
-
-declare i32 @gimplify_va_arg_expr(%struct.tree_node**, %struct.tree_node**, %struct.tree_node**)
-
-declare %struct.tree_node* @size_int_kind(i64, i32)
-
-declare %struct.tree_node* @size_binop(i32, %struct.tree_node*, %struct.tree_node*)
-
-declare %struct.tree_node* @build4_stat(i32, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*)
-
-declare void @gimplify_type_sizes(%struct.tree_node*, %struct.tree_node**)
-
-declare void @gimplify_one_sizepos(%struct.tree_node**, %struct.tree_node**)
-
-declare %struct.tree_node* @build_pointer_type(%struct.tree_node*)
-
-declare %struct.tree_node* @build_fold_indirect_ref(%struct.tree_node*)
-
-declare fastcc i32 @gimplify_bind_expr(%struct.tree_node**, %struct.tree_node*, %struct.tree_node**)
-
-declare fastcc void @gimplify_loop_expr(%struct.tree_node**, %struct.tree_node**)
-
-declare fastcc i32 @gimplify_switch_expr(%struct.tree_node**, %struct.tree_node**)
-
-declare %struct.tree_node* @decl_function_context(%struct.tree_node*)
-
-declare %struct.varray_head_tag* @varray_grow(%struct.varray_head_tag*, i32)
-
-declare fastcc void @gimplify_return_expr(%struct.tree_node*, %struct.tree_node**)
-
-declare fastcc i32 @gimplify_save_expr(%struct.tree_node**, %struct.tree_node**, %struct.tree_node**)
-
-declare fastcc i32 @gimplify_asm_expr(%struct.tree_node**, %struct.tree_node**, %struct.tree_node**)
-
-declare void @gimplify_to_stmt_list(%struct.tree_node**)
-
-declare fastcc i32 @gimplify_cleanup_point_expr(%struct.tree_node**, %struct.tree_node**)
-
-declare fastcc i32 @gimplify_target_expr(%struct.tree_node**, %struct.tree_node**, %struct.tree_node**)
-
-declare void @tsi_delink(%struct.tree_stmt_iterator*)
-
-declare void @tsi_link_before(%struct.tree_stmt_iterator*, %struct.tree_node*, i32)
-
-declare i8 @is_gimple_stmt(%struct.tree_node*) zeroext
-
-declare void @print_generic_expr(%struct.FILE*, %struct.tree_node*, i32)
-
-declare void @debug_tree(%struct.tree_node*)
-
-declare void @internal_error(i8*, ...)
-
-declare %struct.tree_node* @force_gimple_operand(%struct.tree_node*, %struct.tree_node**, i8 zeroext , %struct.tree_node*)
-
-declare i8 @is_gimple_reg_rhs(%struct.tree_node*) zeroext
-
-declare void @add_referenced_tmp_var(%struct.tree_node*)
-
-declare i8 @contains_placeholder_p(%struct.tree_node*) zeroext
-
-declare %struct.varray_head_tag* @varray_init(i32, i32, i8*)
-
-declare i32 @handled_component_p(%struct.tree_node*)
-
-declare void @varray_check_failed(%struct.varray_head_tag*, i32, i8*, i32, i8*)
-
-declare %struct.tree_node* @array_ref_low_bound(%struct.tree_node*)
-
-declare i8 @is_gimple_min_invariant(%struct.tree_node*) zeroext
-
-declare i8 @is_gimple_formal_tmp_reg(%struct.tree_node*) zeroext
-
-declare %struct.tree_node* @array_ref_element_size(%struct.tree_node*)
-
-declare %struct.tree_node* @component_ref_field_offset(%struct.tree_node*)
-
-declare i8 @is_gimple_min_lval(%struct.tree_node*) zeroext
-
-declare void @varray_underflow(%struct.varray_head_tag*, i8*, i32, i8*)
-
-declare i32 @list_length(%struct.tree_node*)
-
-declare i8 @parse_output_constraint(i8**, i32, i32, i32, i8*, i8*, i8*) zeroext
-
-declare i8* @xstrdup(i8*)
-
-declare %struct.tree_node* @build_string(i32, i8*)
-
-declare i8* @strchr(i8*, i32)
-
-declare %struct.tree_node* @build_tree_list_stat(%struct.tree_node*, %struct.tree_node*)
-
-declare %struct.tree_node* @chainon(%struct.tree_node*, %struct.tree_node*)
-
-declare i8 @parse_input_constraint(i8**, i32, i32, i32, i32, i8**, i8*, i8*) zeroext
-
-declare i8 @is_gimple_asm_val(%struct.tree_node*) zeroext
-
-declare void @gimplify_body(%struct.tree_node**, %struct.tree_node*, i8 zeroext )
-
-declare void @timevar_push_1(i32)
-
-declare %struct.tree_node* @gimplify_parameters()
-
-declare %struct.tree_node* @expr_only(%struct.tree_node*)
-
-declare void @timevar_pop_1(i32)
-
-declare void @gimplify_function_tree(%struct.tree_node*)
-
-declare void @allocate_struct_function(%struct.tree_node*)
-
-declare %struct.tree_node* @make_tree_vec_stat(i32)
-
-declare %struct.tree_node* @tsi_split_statement_list_after(%struct.tree_stmt_iterator*)
-
-declare i8 @is_gimple_condexpr(%struct.tree_node*) zeroext
-
-declare %struct.tree_node* @invert_truthvalue(%struct.tree_node*)
-
-declare i8 @initializer_zerop(%struct.tree_node*) zeroext
-
-declare i32 @simple_cst_equal(%struct.tree_node*, %struct.tree_node*)
-
-declare i32 @aggregate_value_p(%struct.tree_node*, %struct.tree_node*)
-
-declare i32 @fwrite(i8*, i32, i32, %struct.FILE*)
diff --git a/release_23/test/CodeGen/ARM/2007-03-27-RegScavengerAssert.ll b/release_23/test/CodeGen/ARM/2007-03-27-RegScavengerAssert.ll
deleted file mode 100644
index f927ef43ca19..000000000000
--- a/release_23/test/CodeGen/ARM/2007-03-27-RegScavengerAssert.ll
+++ /dev/null
@@ -1,35 +0,0 @@
-; RUN: llvm-as < %s | llc -march=arm -mtriple=arm-linux-gnueabi
-; PR1279
-
- %struct.rtx_def = type { i16, i8, i8, %struct.u }
- %struct.u = type { [1 x i64] }
-
-define fastcc void @find_reloads_address(%struct.rtx_def** %loc) {
-entry:
- %ad_addr = alloca %struct.rtx_def* ; <%struct.rtx_def**> [#uses=2]
- br i1 false, label %cond_next416, label %cond_true340
-
-cond_true340: ; preds = %entry
- ret void
-
-cond_next416: ; preds = %entry
- %tmp1085 = load %struct.rtx_def** %ad_addr ; <%struct.rtx_def*> [#uses=1]
- br i1 false, label %bb1084, label %cond_true418
-
-cond_true418: ; preds = %cond_next416
- ret void
-
-bb1084: ; preds = %cond_next416
- br i1 false, label %cond_true1092, label %cond_next1102
-
-cond_true1092: ; preds = %bb1084
- %tmp1094 = getelementptr %struct.rtx_def* %tmp1085, i32 0, i32 3 ; <%struct.u*> [#uses=1]
- %tmp10981099 = bitcast %struct.u* %tmp1094 to %struct.rtx_def** ; <%struct.rtx_def**> [#uses=2]
- %tmp1101 = load %struct.rtx_def** %tmp10981099 ; <%struct.rtx_def*> [#uses=1]
- store %struct.rtx_def* %tmp1101, %struct.rtx_def** %ad_addr
- br label %cond_next1102
-
-cond_next1102: ; preds = %cond_true1092, %bb1084
- %loc_addr.0 = phi %struct.rtx_def** [ %tmp10981099, %cond_true1092 ], [ %loc, %bb1084 ] ; <%struct.rtx_def**> [#uses=0]
- ret void
-}
diff --git a/release_23/test/CodeGen/ARM/2007-03-30-RegScavengerAssert.ll b/release_23/test/CodeGen/ARM/2007-03-30-RegScavengerAssert.ll
deleted file mode 100644
index 55d29933a55c..000000000000
--- a/release_23/test/CodeGen/ARM/2007-03-30-RegScavengerAssert.ll
+++ /dev/null
@@ -1,101 +0,0 @@
-; RUN: llvm-as < %s | llc -march=arm -mtriple=arm-linux-gnueabi
-; PR1279
-
- %struct.CUMULATIVE_ARGS = type { i32, i32, i32, i32, i32, i32 }
- %struct.arm_stack_offsets = type { i32, i32, i32, i32, i32 }
- %struct.eh_status = type opaque
- %struct.emit_status = type { i32, i32, %struct.rtx_def*, %struct.rtx_def*, %struct.sequence_stack*, i32, %struct.location_t, i32, i8*, %struct.rtx_def** }
- %struct.expr_status = type { i32, i32, i32, %struct.rtx_def*, %struct.rtx_def*, %struct.rtx_def* }
- %struct.function = type { %struct.eh_status*, %struct.expr_status*, %struct.emit_status*, %struct.varasm_status*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.function*, i32, i32, i32, i32, %struct.rtx_def*, %struct.CUMULATIVE_ARGS, %struct.rtx_def*, %struct.rtx_def*, %struct.initial_value_struct*, %struct.rtx_def*, %struct.rtx_def*, %struct.rtx_def*, %struct.rtx_def*, %struct.rtx_def*, %struct.rtx_def*, i8, i32, i64, %struct.tree_node*, %struct.tree_node*, %struct.rtx_def*, %struct.varray_head_tag*, %struct.temp_slot*, i32, %struct.var_refs_queue*, i32, i32, %struct.rtvec_def*, %struct.tree_node*, i32, i32, i32, %struct.machine_function*, i32, i32, i8, i8, %struct.language_function*, %struct.rtx_def*, i32, i32, i32, i32, %struct.location_t, %struct.varray_head_tag*, %struct.tree_node*, i8, i8, i8 }
- %struct.initial_value_struct = type opaque
- %struct.lang_decl = type opaque
- %struct.language_function = type opaque
- %struct.location_t = type { i8*, i32 }
- %struct.machine_function = type { %struct.rtx_def*, i32, i32, i32, %struct.arm_stack_offsets, i32, i32, i32, [14 x %struct.rtx_def*] }
- %struct.rtvec_def = type { i32, [1 x %struct.rtx_def*] }
- %struct.rtx_def = type { i16, i8, i8, %struct.u }
- %struct.sequence_stack = type { %struct.rtx_def*, %struct.rtx_def*, %struct.sequence_stack* }
- %struct.temp_slot = type opaque
- %struct.tree_common = type { %struct.tree_node*, %struct.tree_node*, %union.tree_ann_d*, i8, i8, i8, i8, i8 }
- %struct.tree_decl = type { %struct.tree_common, %struct.location_t, i32, %struct.tree_node*, i8, i8, i8, i8, i8, i8, i8, i8, i32, %struct.tree_decl_u1, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.rtx_def*, i32, %struct.tree_decl_u2, %struct.tree_node*, %struct.tree_node*, i64, %struct.lang_decl* }
- %struct.tree_decl_u1 = type { i64 }
- %struct.tree_decl_u2 = type { %struct.function* }
- %struct.tree_node = type { %struct.tree_decl }
- %struct.u = type { [1 x i64] }
- %struct.var_refs_queue = type { %struct.rtx_def*, i32, i32, %struct.var_refs_queue* }
- %struct.varasm_status = type opaque
- %struct.varray_head_tag = type { i32, i32, i32, i8*, %struct.u }
- %union.tree_ann_d = type opaque
-@str469 = external global [42 x i8] ; <[42 x i8]*> [#uses=0]
-@__FUNCTION__.24265 = external global [19 x i8] ; <[19 x i8]*> [#uses=0]
-
-declare void @fancy_abort()
-
-define fastcc void @fold_builtin_bitop() {
-entry:
- br i1 false, label %cond_true105, label %UnifiedReturnBlock
-
-cond_true105: ; preds = %entry
- br i1 false, label %cond_true134, label %UnifiedReturnBlock
-
-cond_true134: ; preds = %cond_true105
- switch i32 0, label %bb479 [
- i32 378, label %bb313
- i32 380, label %bb313
- i32 381, label %bb313
- i32 383, label %bb366
- i32 385, label %bb366
- i32 386, label %bb366
- i32 403, label %bb250
- i32 405, label %bb250
- i32 406, label %bb250
- i32 434, label %bb464
- i32 436, label %bb464
- i32 437, label %bb464
- i32 438, label %bb441
- i32 440, label %bb441
- i32 441, label %bb441
- ]
-
-bb250: ; preds = %cond_true134, %cond_true134, %cond_true134
- ret void
-
-bb313: ; preds = %cond_true134, %cond_true134, %cond_true134
- ret void
-
-bb366: ; preds = %cond_true134, %cond_true134, %cond_true134
- ret void
-
-bb441: ; preds = %cond_true134, %cond_true134, %cond_true134
- ret void
-
-bb457: ; preds = %bb464, %bb457
- %tmp459 = add i64 0, 1 ; <i64> [#uses=1]
- br i1 false, label %bb474.preheader, label %bb457
-
-bb464: ; preds = %cond_true134, %cond_true134, %cond_true134
- br i1 false, label %bb474.preheader, label %bb457
-
-bb474.preheader: ; preds = %bb464, %bb457
- %result.5.ph = phi i64 [ 0, %bb464 ], [ %tmp459, %bb457 ] ; <i64> [#uses=1]
- br label %bb474
-
-bb467: ; preds = %bb474
- %indvar.next586 = add i64 %indvar585, 1 ; <i64> [#uses=1]
- br label %bb474
-
-bb474: ; preds = %bb467, %bb474.preheader
- %indvar585 = phi i64 [ 0, %bb474.preheader ], [ %indvar.next586, %bb467 ] ; <i64> [#uses=2]
- br i1 false, label %bb476, label %bb467
-
-bb476: ; preds = %bb474
- %result.5 = add i64 %indvar585, %result.5.ph ; <i64> [#uses=0]
- ret void
-
-bb479: ; preds = %cond_true134
- tail call void @fancy_abort( )
- unreachable
-
-UnifiedReturnBlock: ; preds = %cond_true105, %entry
- ret void
-}
diff --git a/release_23/test/CodeGen/ARM/2007-04-02-RegScavengerAssert.ll b/release_23/test/CodeGen/ARM/2007-04-02-RegScavengerAssert.ll
deleted file mode 100644
index ef5a1ae40459..000000000000
--- a/release_23/test/CodeGen/ARM/2007-04-02-RegScavengerAssert.ll
+++ /dev/null
@@ -1,55 +0,0 @@
-; RUN: llvm-as < %s | llc -march=arm -mtriple=arm-apple-darwin
-
- %struct.H_TBL = type { [17 x i8], [256 x i8], i32 }
- %struct.Q_TBL = type { [64 x i16], i32 }
- %struct.anon = type { [80 x i8] }
- %struct.X_c_coef_ccler = type { void (%struct.X_Y*, i32)*, i32 (%struct.X_Y*, i8***)* }
- %struct.X_c_main_ccler = type { void (%struct.X_Y*, i32)*, void (%struct.X_Y*, i8**, i32*, i32)* }
- %struct.X_c_prep_ccler = type { void (%struct.X_Y*, i32)*, void (%struct.X_Y*, i8**, i32*, i32, i8***, i32*, i32)* }
- %struct.X_color_converter = type { void (%struct.X_Y*)*, void (%struct.X_Y*, i8**, i8***, i32, i32)* }
- %struct.X_common_struct = type { %struct.X_error_mgr*, %struct.X_memory_mgr*, %struct.X_progress_mgr*, i8*, i32, i32 }
- %struct.X_comp_master = type { void (%struct.X_Y*)*, void (%struct.X_Y*)*, void (%struct.X_Y*)*, i32, i32 }
- %struct.X_component_info = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, %struct.Q_TBL*, i8* }
- %struct.X_Y = type { %struct.X_error_mgr*, %struct.X_memory_mgr*, %struct.X_progress_mgr*, i8*, i32, i32, %struct.X_destination_mgr*, i32, i32, i32, i32, double, i32, i32, i32, %struct.X_component_info*, [4 x %struct.Q_TBL*], [4 x %struct.H_TBL*], [4 x %struct.H_TBL*], [16 x i8], [16 x i8], [16 x i8], i32, %struct.X_scan_info*, i32, i32, i32, i32, i32, i32, i32, i32, i32, i8, i8, i8, i16, i16, i32, i32, i32, i32, i32, i32, i32, [4 x %struct.X_component_info*], i32, i32, i32, [10 x i32], i32, i32, i32, i32, %struct.X_comp_master*, %struct.X_c_main_ccler*, %struct.X_c_prep_ccler*, %struct.X_c_coef_ccler*, %struct.X_marker_writer*, %struct.X_color_converter*, %struct.X_downssr*, %struct.X_forward_D*, %struct.X_entropy_en*, %struct.X_scan_info*, i32 }
- %struct.X_destination_mgr = type { i8*, i32, void (%struct.X_Y*)*, i32 (%struct.X_Y*)*, void (%struct.X_Y*)* }
- %struct.X_downssr = type { void (%struct.X_Y*)*, void (%struct.X_Y*, i8***, i32, i8***, i32)*, i32 }
- %struct.X_entropy_en = type { void (%struct.X_Y*, i32)*, i32 (%struct.X_Y*, [64 x i16]**)*, void (%struct.X_Y*)* }
- %struct.X_error_mgr = type { void (%struct.X_common_struct*)*, void (%struct.X_common_struct*, i32)*, void (%struct.X_common_struct*)*, void (%struct.X_common_struct*, i8*)*, void (%struct.X_common_struct*)*, i32, %struct.anon, i32, i32, i8**, i32, i8**, i32, i32 }
- %struct.X_forward_D = type { void (%struct.X_Y*)*, void (%struct.X_Y*, %struct.X_component_info*, i8**, [64 x i16]*, i32, i32, i32)* }
- %struct.X_marker_writer = type { void (%struct.X_Y*)*, void (%struct.X_Y*)*, void (%struct.X_Y*)*, void (%struct.X_Y*)*, void (%struct.X_Y*)*, void (%struct.X_Y*, i32, i32)*, void (%struct.X_Y*, i32)* }
- %struct.X_memory_mgr = type { i8* (%struct.X_common_struct*, i32, i32)*, i8* (%struct.X_common_struct*, i32, i32)*, i8** (%struct.X_common_struct*, i32, i32, i32)*, [64 x i16]** (%struct.X_common_struct*, i32, i32, i32)*, %struct.jvirt_sAY_cc* (%struct.X_common_struct*, i32, i32, i32, i32, i32)*, %struct.jvirt_bAY_cc* (%struct.X_common_struct*, i32, i32, i32, i32, i32)*, void (%struct.X_common_struct*)*, i8** (%struct.X_common_struct*, %struct.jvirt_sAY_cc*, i32, i32, i32)*, [64 x i16]** (%struct.X_common_struct*, %struct.jvirt_bAY_cc*, i32, i32, i32)*, void (%struct.X_common_struct*, i32)*, void (%struct.X_common_struct*)*, i32, i32 }
- %struct.X_progress_mgr = type { void (%struct.X_common_struct*)*, i32, i32, i32, i32 }
- %struct.X_scan_info = type { i32, [4 x i32], i32, i32, i32, i32 }
- %struct.jvirt_bAY_cc = type opaque
- %struct.jvirt_sAY_cc = type opaque
-
-define void @test(%struct.X_Y* %cinfo) {
-entry:
- br i1 false, label %bb.preheader, label %return
-
-bb.preheader: ; preds = %entry
- %tbl.014.us = load i32* null ; <i32> [#uses=1]
- br i1 false, label %cond_next.us, label %bb
-
-cond_next51.us: ; preds = %cond_next.us, %cond_true33.us.cond_true46.us_crit_edge
- %htblptr.019.1.us = phi %struct.H_TBL** [ %tmp37.us, %cond_true33.us.cond_true46.us_crit_edge ], [ %tmp37.us, %cond_next.us ] ; <%struct.H_TBL**> [#uses=0]
- ret void
-
-cond_true33.us.cond_true46.us_crit_edge: ; preds = %cond_next.us
- call void @_C_X_a_HT( )
- br label %cond_next51.us
-
-cond_next.us: ; preds = %bb.preheader
- %tmp37.us = getelementptr %struct.X_Y* %cinfo, i32 0, i32 17, i32 %tbl.014.us ; <%struct.H_TBL**> [#uses=3]
- %tmp4524.us = load %struct.H_TBL** %tmp37.us ; <%struct.H_TBL*> [#uses=1]
- icmp eq %struct.H_TBL* %tmp4524.us, null ; <i1>:0 [#uses=1]
- br i1 %0, label %cond_true33.us.cond_true46.us_crit_edge, label %cond_next51.us
-
-bb: ; preds = %bb.preheader
- ret void
-
-return: ; preds = %entry
- ret void
-}
-
-declare void @_C_X_a_HT()
diff --git a/release_23/test/CodeGen/ARM/2007-04-03-PEIBug.ll b/release_23/test/CodeGen/ARM/2007-04-03-PEIBug.ll
deleted file mode 100644
index e412127eae7b..000000000000
--- a/release_23/test/CodeGen/ARM/2007-04-03-PEIBug.ll
+++ /dev/null
@@ -1,12 +0,0 @@
-; RUN: llvm-as < %s | llc -march=arm | not grep {add.*#0}
-
-define i32 @foo() {
-entry:
- %A = alloca [1123 x i32], align 16 ; <[1123 x i32]*> [#uses=1]
- %B = alloca [3123 x i32], align 16 ; <[3123 x i32]*> [#uses=1]
- %C = alloca [12312 x i32], align 16 ; <[12312 x i32]*> [#uses=1]
- %tmp = call i32 (...)* @bar( [3123 x i32]* %B, [1123 x i32]* %A, [12312 x i32]* %C ) ; <i32> [#uses=0]
- ret i32 undef
-}
-
-declare i32 @bar(...)
diff --git a/release_23/test/CodeGen/ARM/2007-04-03-UndefinedSymbol.ll b/release_23/test/CodeGen/ARM/2007-04-03-UndefinedSymbol.ll
deleted file mode 100644
index 42f5034c70a7..000000000000
--- a/release_23/test/CodeGen/ARM/2007-04-03-UndefinedSymbol.ll
+++ /dev/null
@@ -1,99 +0,0 @@
-; RUN: llvm-as < %s | llc -mtriple=arm-apple-darwin -relocation-model=pic | \
-; RUN: not grep LPC9
-
- %struct.B = type { i32 }
- %struct.anon = type { void (%struct.B*)*, i32 }
-@str = internal constant [7 x i8] c"i, %d\0A\00" ; <[7 x i8]*> [#uses=1]
-@str1 = internal constant [7 x i8] c"j, %d\0A\00" ; <[7 x i8]*> [#uses=1]
-
-define internal void @_ZN1B1iEv(%struct.B* %this) {
-entry:
- %tmp1 = getelementptr %struct.B* %this, i32 0, i32 0 ; <i32*> [#uses=1]
- %tmp2 = load i32* %tmp1 ; <i32> [#uses=1]
- %tmp4 = tail call i32 (i8*, ...)* @printf( i8* getelementptr ([7 x i8]* @str, i32 0, i32 0), i32 %tmp2 ) ; <i32> [#uses=0]
- ret void
-}
-
-declare i32 @printf(i8*, ...)
-
-define internal void @_ZN1B1jEv(%struct.B* %this) {
-entry:
- %tmp1 = getelementptr %struct.B* %this, i32 0, i32 0 ; <i32*> [#uses=1]
- %tmp2 = load i32* %tmp1 ; <i32> [#uses=1]
- %tmp4 = tail call i32 (i8*, ...)* @printf( i8* getelementptr ([7 x i8]* @str1, i32 0, i32 0), i32 %tmp2 ) ; <i32> [#uses=0]
- ret void
-}
-
-define i32 @main() {
-entry:
- %b.i29 = alloca %struct.B, align 4 ; <%struct.B*> [#uses=3]
- %b.i1 = alloca %struct.B, align 4 ; <%struct.B*> [#uses=3]
- %b.i = alloca %struct.B, align 4 ; <%struct.B*> [#uses=3]
- %tmp2.i = getelementptr %struct.B* %b.i, i32 0, i32 0 ; <i32*> [#uses=1]
- store i32 4, i32* %tmp2.i
- br i1 icmp eq (i64 and (i64 zext (i32 ptrtoint (void (%struct.B*)* @_ZN1B1iEv to i32) to i64), i64 4294967296), i64 0), label %_Z3fooiM1BFvvE.exit, label %cond_true.i
-
-cond_true.i: ; preds = %entry
- %b2.i = bitcast %struct.B* %b.i to i8* ; <i8*> [#uses=1]
- %ctg23.i = getelementptr i8* %b2.i, i32 ashr (i32 trunc (i64 lshr (i64 zext (i32 ptrtoint (void (%struct.B*)* @_ZN1B1iEv to i32) to i64), i64 32) to i32), i32 1) ; <i8*> [#uses=1]
- %tmp121314.i = bitcast i8* %ctg23.i to i32 (...)*** ; <i32 (...)***> [#uses=1]
- %tmp15.i = load i32 (...)*** %tmp121314.i ; <i32 (...)**> [#uses=1]
- %tmp151.i = bitcast i32 (...)** %tmp15.i to i8* ; <i8*> [#uses=1]
- %ctg2.i = getelementptr i8* %tmp151.i, i32 ptrtoint (void (%struct.B*)* @_ZN1B1iEv to i32) ; <i8*> [#uses=1]
- %tmp2021.i = bitcast i8* %ctg2.i to i32 (...)** ; <i32 (...)**> [#uses=1]
- %tmp22.i = load i32 (...)** %tmp2021.i ; <i32 (...)*> [#uses=1]
- %tmp2223.i = bitcast i32 (...)* %tmp22.i to void (%struct.B*)* ; <void (%struct.B*)*> [#uses=1]
- br label %_Z3fooiM1BFvvE.exit
-
-_Z3fooiM1BFvvE.exit: ; preds = %cond_true.i, %entry
- %iftmp.2.0.i = phi void (%struct.B*)* [ %tmp2223.i, %cond_true.i ], [ inttoptr (i32 ptrtoint (void (%struct.B*)* @_ZN1B1iEv to i32) to void (%struct.B*)*), %entry ] ; <void (%struct.B*)*> [#uses=1]
- %b4.i = bitcast %struct.B* %b.i to i8* ; <i8*> [#uses=1]
- %ctg25.i = getelementptr i8* %b4.i, i32 ashr (i32 trunc (i64 lshr (i64 zext (i32 ptrtoint (void (%struct.B*)* @_ZN1B1iEv to i32) to i64), i64 32) to i32), i32 1) ; <i8*> [#uses=1]
- %tmp3031.i = bitcast i8* %ctg25.i to %struct.B* ; <%struct.B*> [#uses=1]
- call void %iftmp.2.0.i( %struct.B* %tmp3031.i )
- %tmp2.i30 = getelementptr %struct.B* %b.i29, i32 0, i32 0 ; <i32*> [#uses=1]
- store i32 6, i32* %tmp2.i30
- br i1 icmp eq (i64 and (i64 zext (i32 ptrtoint (void (%struct.B*)* @_ZN1B1jEv to i32) to i64), i64 4294967296), i64 0), label %_Z3fooiM1BFvvE.exit56, label %cond_true.i46
-
-cond_true.i46: ; preds = %_Z3fooiM1BFvvE.exit
- %b2.i35 = bitcast %struct.B* %b.i29 to i8* ; <i8*> [#uses=1]
- %ctg23.i36 = getelementptr i8* %b2.i35, i32 ashr (i32 trunc (i64 lshr (i64 zext (i32 ptrtoint (void (%struct.B*)* @_ZN1B1jEv to i32) to i64), i64 32) to i32), i32 1) ; <i8*> [#uses=1]
- %tmp121314.i37 = bitcast i8* %ctg23.i36 to i32 (...)*** ; <i32 (...)***> [#uses=1]
- %tmp15.i38 = load i32 (...)*** %tmp121314.i37 ; <i32 (...)**> [#uses=1]
- %tmp151.i41 = bitcast i32 (...)** %tmp15.i38 to i8* ; <i8*> [#uses=1]
- %ctg2.i42 = getelementptr i8* %tmp151.i41, i32 ptrtoint (void (%struct.B*)* @_ZN1B1jEv to i32) ; <i8*> [#uses=1]
- %tmp2021.i43 = bitcast i8* %ctg2.i42 to i32 (...)** ; <i32 (...)**> [#uses=1]
- %tmp22.i44 = load i32 (...)** %tmp2021.i43 ; <i32 (...)*> [#uses=1]
- %tmp2223.i45 = bitcast i32 (...)* %tmp22.i44 to void (%struct.B*)* ; <void (%struct.B*)*> [#uses=1]
- br label %_Z3fooiM1BFvvE.exit56
-
-_Z3fooiM1BFvvE.exit56: ; preds = %cond_true.i46, %_Z3fooiM1BFvvE.exit
- %iftmp.2.0.i49 = phi void (%struct.B*)* [ %tmp2223.i45, %cond_true.i46 ], [ inttoptr (i32 ptrtoint (void (%struct.B*)* @_ZN1B1jEv to i32) to void (%struct.B*)*), %_Z3fooiM1BFvvE.exit ] ; <void (%struct.B*)*> [#uses=1]
- %b4.i53 = bitcast %struct.B* %b.i29 to i8* ; <i8*> [#uses=1]
- %ctg25.i54 = getelementptr i8* %b4.i53, i32 ashr (i32 trunc (i64 lshr (i64 zext (i32 ptrtoint (void (%struct.B*)* @_ZN1B1jEv to i32) to i64), i64 32) to i32), i32 1) ; <i8*> [#uses=1]
- %tmp3031.i55 = bitcast i8* %ctg25.i54 to %struct.B* ; <%struct.B*> [#uses=1]
- call void %iftmp.2.0.i49( %struct.B* %tmp3031.i55 )
- %tmp2.i2 = getelementptr %struct.B* %b.i1, i32 0, i32 0 ; <i32*> [#uses=1]
- store i32 -1, i32* %tmp2.i2
- br i1 icmp eq (i64 and (i64 zext (i32 ptrtoint (void (%struct.B*)* @_ZN1B1iEv to i32) to i64), i64 4294967296), i64 0), label %_Z3fooiM1BFvvE.exit28, label %cond_true.i18
-
-cond_true.i18: ; preds = %_Z3fooiM1BFvvE.exit56
- %b2.i7 = bitcast %struct.B* %b.i1 to i8* ; <i8*> [#uses=1]
- %ctg23.i8 = getelementptr i8* %b2.i7, i32 ashr (i32 trunc (i64 lshr (i64 zext (i32 ptrtoint (void (%struct.B*)* @_ZN1B1iEv to i32) to i64), i64 32) to i32), i32 1) ; <i8*> [#uses=1]
- %tmp121314.i9 = bitcast i8* %ctg23.i8 to i32 (...)*** ; <i32 (...)***> [#uses=1]
- %tmp15.i10 = load i32 (...)*** %tmp121314.i9 ; <i32 (...)**> [#uses=1]
- %tmp151.i13 = bitcast i32 (...)** %tmp15.i10 to i8* ; <i8*> [#uses=1]
- %ctg2.i14 = getelementptr i8* %tmp151.i13, i32 ptrtoint (void (%struct.B*)* @_ZN1B1iEv to i32) ; <i8*> [#uses=1]
- %tmp2021.i15 = bitcast i8* %ctg2.i14 to i32 (...)** ; <i32 (...)**> [#uses=1]
- %tmp22.i16 = load i32 (...)** %tmp2021.i15 ; <i32 (...)*> [#uses=1]
- %tmp2223.i17 = bitcast i32 (...)* %tmp22.i16 to void (%struct.B*)* ; <void (%struct.B*)*> [#uses=1]
- br label %_Z3fooiM1BFvvE.exit28
-
-_Z3fooiM1BFvvE.exit28: ; preds = %cond_true.i18, %_Z3fooiM1BFvvE.exit56
- %iftmp.2.0.i21 = phi void (%struct.B*)* [ %tmp2223.i17, %cond_true.i18 ], [ inttoptr (i32 ptrtoint (void (%struct.B*)* @_ZN1B1iEv to i32) to void (%struct.B*)*), %_Z3fooiM1BFvvE.exit56 ] ; <void (%struct.B*)*> [#uses=1]
- %b4.i25 = bitcast %struct.B* %b.i1 to i8* ; <i8*> [#uses=1]
- %ctg25.i26 = getelementptr i8* %b4.i25, i32 ashr (i32 trunc (i64 lshr (i64 zext (i32 ptrtoint (void (%struct.B*)* @_ZN1B1iEv to i32) to i64), i64 32) to i32), i32 1) ; <i8*> [#uses=1]
- %tmp3031.i27 = bitcast i8* %ctg25.i26 to %struct.B* ; <%struct.B*> [#uses=1]
- call void %iftmp.2.0.i21( %struct.B* %tmp3031.i27 )
- ret i32 0
-}
diff --git a/release_23/test/CodeGen/ARM/2007-04-30-CombinerCrash.ll b/release_23/test/CodeGen/ARM/2007-04-30-CombinerCrash.ll
deleted file mode 100644
index ec70a596bc3a..000000000000
--- a/release_23/test/CodeGen/ARM/2007-04-30-CombinerCrash.ll
+++ /dev/null
@@ -1,32 +0,0 @@
-; RUN: llvm-as < %s | llc -mtriple=arm-apple-darwin -mattr=+v6,+vfp2
-
-target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:32-f32:32:32-f64:32:32-v64:64:64-v128:128:128-a0:0:64"
-target triple = "arm-apple-darwin8"
- %struct.CHESS_POSITION = type { i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i32, i32, i8, i8, [64 x i8], i8, i8, i8, i8, i8 }
-@search = external global %struct.CHESS_POSITION ; <%struct.CHESS_POSITION*> [#uses=3]
-@file_mask = external global [8 x i64] ; <[8 x i64]*> [#uses=1]
-@rank_mask.1.b = external global i1 ; <i1*> [#uses=1]
-
-define fastcc void @EvaluateDevelopment() {
-entry:
- %tmp7 = load i64* getelementptr (%struct.CHESS_POSITION* @search, i32 0, i32 7) ; <i64> [#uses=1]
- %tmp50 = load i64* getelementptr (%struct.CHESS_POSITION* @search, i32 0, i32 0) ; <i64> [#uses=1]
- %tmp52 = load i64* getelementptr (%struct.CHESS_POSITION* @search, i32 0, i32 1) ; <i64> [#uses=1]
- %tmp53 = or i64 %tmp52, %tmp50 ; <i64> [#uses=1]
- %tmp57.b = load i1* @rank_mask.1.b ; <i1> [#uses=1]
- %tmp57 = select i1 %tmp57.b, i64 71776119061217280, i64 0 ; <i64> [#uses=1]
- %tmp58 = and i64 %tmp57, %tmp7 ; <i64> [#uses=1]
- %tmp59 = lshr i64 %tmp58, 8 ; <i64> [#uses=1]
- %tmp63 = load i64* getelementptr ([8 x i64]* @file_mask, i32 0, i32 4) ; <i64> [#uses=1]
- %tmp64 = or i64 %tmp63, 0 ; <i64> [#uses=1]
- %tmp65 = and i64 %tmp59, %tmp53 ; <i64> [#uses=1]
- %tmp66 = and i64 %tmp65, %tmp64 ; <i64> [#uses=1]
- %tmp67 = icmp eq i64 %tmp66, 0 ; <i1> [#uses=1]
- br i1 %tmp67, label %cond_next145, label %cond_true70
-
-cond_true70: ; preds = %entry
- ret void
-
-cond_next145: ; preds = %entry
- ret void
-}
diff --git a/release_23/test/CodeGen/ARM/2007-05-03-BadPostIndexedLd.ll b/release_23/test/CodeGen/ARM/2007-05-03-BadPostIndexedLd.ll
deleted file mode 100644
index f3f82bc4846f..000000000000
--- a/release_23/test/CodeGen/ARM/2007-05-03-BadPostIndexedLd.ll
+++ /dev/null
@@ -1,113 +0,0 @@
-; RUN: llvm-as < %s | llc -mtriple=arm-apple-darwin
-
- %struct.Connection = type { i32, [10 x i8], i32 }
- %struct.IntChunk = type { %struct.cppobjtype, i32, i32*, i32 }
- %struct.Point = type { i8*, %struct.cppobjtype, i16 (%struct.Point*) signext *, i16 (%struct.Point*) signext *, double (%struct.Point*)*, double (%struct.Point*)* }
- %struct.RefPoint = type { %struct.Point*, %struct.cppobjtype }
- %struct.ShortArray = type { %struct.cppobjtype, i32, i16* }
- %struct.TestObj = type { i8*, %struct.cppobjtype, i8, [32 x i8], i8*, i8**, i16, i16, i32, i32, i32, i32, float, double, %struct.cppobjtype, i32, i16*, i16**, i8**, i32, %struct.XyPoint, [3 x %struct.Connection], %struct.Point*, %struct.XyPoint*, i32, i8*, i8*, i16*, %struct.ShortArray, %struct.IntChunk, %struct.cppobjtype, %struct.cppobjtype, %struct.RefPoint, i32, %struct.cppobjtype, %struct.cppobjtype }
- %struct.XyPoint = type { i16, i16 }
- %struct.cppobjtype = type { i32, i16, i16 }
-@Msg = external global [256 x i8] ; <[256 x i8]*> [#uses=1]
-@.str53615 = external constant [48 x i8] ; <[48 x i8]*> [#uses=1]
-@FirstTime.4637.b = external global i1 ; <i1*> [#uses=1]
-
-define fastcc void @Draw7(i32 %Option, i32* %Status) {
-entry:
- %tmp115.b = load i1* @FirstTime.4637.b ; <i1> [#uses=1]
- br i1 %tmp115.b, label %cond_next239, label %cond_next.i
-
-cond_next.i: ; preds = %entry
- ret void
-
-cond_next239: ; preds = %entry
- %tmp242 = icmp eq i32 0, 0 ; <i1> [#uses=1]
- br i1 %tmp242, label %cond_next253, label %cond_next296
-
-cond_next253: ; preds = %cond_next239
- switch i32 %Option, label %bb1326 [
- i32 3, label %cond_true258
- i32 4, label %cond_true268
- i32 2, label %cond_true279
- i32 1, label %cond_next315
- ]
-
-cond_true258: ; preds = %cond_next253
- ret void
-
-cond_true268: ; preds = %cond_next253
- ret void
-
-cond_true279: ; preds = %cond_next253
- ret void
-
-cond_next296: ; preds = %cond_next239
- ret void
-
-cond_next315: ; preds = %cond_next253
- %tmp1140 = icmp eq i32 0, 0 ; <i1> [#uses=1]
- br i1 %tmp1140, label %cond_true1143, label %bb1326
-
-cond_true1143: ; preds = %cond_next315
- %tmp1148 = icmp eq i32 0, 0 ; <i1> [#uses=4]
- br i1 %tmp1148, label %cond_next1153, label %cond_true1151
-
-cond_true1151: ; preds = %cond_true1143
- ret void
-
-cond_next1153: ; preds = %cond_true1143
- %tmp8.i.i185 = icmp eq i32 0, 0 ; <i1> [#uses=1]
- br i1 %tmp8.i.i185, label %TestObj_new1.exit, label %cond_true.i.i187
-
-cond_true.i.i187: ; preds = %cond_next1153
- ret void
-
-TestObj_new1.exit: ; preds = %cond_next1153
- %tmp1167 = icmp eq i16 0, 0 ; <i1> [#uses=1]
- %tmp1178 = icmp eq i32 0, 0 ; <i1> [#uses=1]
- %bothcond = and i1 %tmp1167, %tmp1178 ; <i1> [#uses=1]
- br i1 %bothcond, label %bb1199, label %bb1181
-
-bb1181: ; preds = %TestObj_new1.exit
- ret void
-
-bb1199: ; preds = %TestObj_new1.exit
- br i1 %tmp1148, label %cond_next1235, label %Object_Dump.exit302
-
-Object_Dump.exit302: ; preds = %bb1199
- ret void
-
-cond_next1235: ; preds = %bb1199
- %bothcond10485 = or i1 false, %tmp1148 ; <i1> [#uses=1]
- br i1 %bothcond10485, label %cond_next1267, label %cond_true1248
-
-cond_true1248: ; preds = %cond_next1235
- ret void
-
-cond_next1267: ; preds = %cond_next1235
- br i1 %tmp1148, label %cond_next1275, label %cond_true1272
-
-cond_true1272: ; preds = %cond_next1267
- %tmp1273 = load %struct.TestObj** null ; <%struct.TestObj*> [#uses=2]
- %tmp2930.i = ptrtoint %struct.TestObj* %tmp1273 to i32 ; <i32> [#uses=1]
- %tmp42.i348 = sub i32 0, %tmp2930.i ; <i32> [#uses=1]
- %tmp45.i = getelementptr %struct.TestObj* %tmp1273, i32 0, i32 0 ; <i8**> [#uses=2]
- %tmp48.i = load i8** %tmp45.i ; <i8*> [#uses=1]
- %tmp50.i350 = call i32 (i8*, i8*, ...)* @sprintf( i8* getelementptr ([256 x i8]* @Msg, i32 0, i32 0), i8* getelementptr ([48 x i8]* @.str53615, i32 0, i32 0), i8* null, i8** %tmp45.i, i8* %tmp48.i ) ; <i32> [#uses=0]
- br i1 false, label %cond_true.i632.i, label %Ut_TraceMsg.exit648.i
-
-cond_true.i632.i: ; preds = %cond_true1272
- ret void
-
-Ut_TraceMsg.exit648.i: ; preds = %cond_true1272
- %tmp57.i = getelementptr i8* null, i32 %tmp42.i348 ; <i8*> [#uses=0]
- ret void
-
-cond_next1275: ; preds = %cond_next1267
- ret void
-
-bb1326: ; preds = %cond_next315, %cond_next253
- ret void
-}
-
-declare i32 @sprintf(i8*, i8*, ...)
diff --git a/release_23/test/CodeGen/ARM/2007-05-05-InvalidPushPop.ll b/release_23/test/CodeGen/ARM/2007-05-05-InvalidPushPop.ll
deleted file mode 100644
index 159be4eca334..000000000000
--- a/release_23/test/CodeGen/ARM/2007-05-05-InvalidPushPop.ll
+++ /dev/null
@@ -1,41 +0,0 @@
-; RUN: llvm-as < %s | llc | not grep r11
-
-target triple = "thumb-linux-gnueabi"
- %struct.__sched_param = type { i32 }
- %struct.pthread_attr_t = type { i32, i32, %struct.__sched_param, i32, i32, i32, i32, i8*, i32 }
-@i.1882 = internal global i32 1 ; <i32*> [#uses=2]
-@.str = internal constant [14 x i8] c"Thread 1: %d\0A\00" ; <[14 x i8]*> [#uses=1]
-@.str1 = internal constant [14 x i8] c"Thread 2: %d\0A\00" ; <[14 x i8]*> [#uses=1]
-
-define i8* @f(i8* %a) {
-entry:
- %tmp1 = load i32* @i.1882 ; <i32> [#uses=1]
- %tmp2 = add i32 %tmp1, 1 ; <i32> [#uses=2]
- store i32 %tmp2, i32* @i.1882
- %tmp34 = inttoptr i32 %tmp2 to i8* ; <i8*> [#uses=1]
- ret i8* %tmp34
-}
-
-define i32 @main() {
-entry:
- %t = alloca i32, align 4 ; <i32*> [#uses=4]
- %ret = alloca i32, align 4 ; <i32*> [#uses=3]
- %tmp1 = call i32 @pthread_create( i32* %t, %struct.pthread_attr_t* null, i8* (i8*)* @f, i8* null ) ; <i32> [#uses=0]
- %tmp2 = load i32* %t ; <i32> [#uses=1]
- %ret3 = bitcast i32* %ret to i8** ; <i8**> [#uses=2]
- %tmp4 = call i32 @pthread_join( i32 %tmp2, i8** %ret3 ) ; <i32> [#uses=0]
- %tmp5 = load i32* %ret ; <i32> [#uses=1]
- %tmp7 = call i32 (i8*, ...)* @printf( i8* getelementptr ([14 x i8]* @.str, i32 0, i32 0), i32 %tmp5 ) ; <i32> [#uses=0]
- %tmp8 = call i32 @pthread_create( i32* %t, %struct.pthread_attr_t* null, i8* (i8*)* @f, i8* null ) ; <i32> [#uses=0]
- %tmp9 = load i32* %t ; <i32> [#uses=1]
- %tmp11 = call i32 @pthread_join( i32 %tmp9, i8** %ret3 ) ; <i32> [#uses=0]
- %tmp12 = load i32* %ret ; <i32> [#uses=1]
- %tmp14 = call i32 (i8*, ...)* @printf( i8* getelementptr ([14 x i8]* @.str1, i32 0, i32 0), i32 %tmp12 ) ; <i32> [#uses=0]
- ret i32 0
-}
-
-declare i32 @pthread_create(i32*, %struct.pthread_attr_t*, i8* (i8*)*, i8*)
-
-declare i32 @pthread_join(i32, i8**)
-
-declare i32 @printf(i8*, ...)
diff --git a/release_23/test/CodeGen/ARM/2007-05-07-jumptoentry.ll b/release_23/test/CodeGen/ARM/2007-05-07-jumptoentry.ll
deleted file mode 100644
index 11431be9c28c..000000000000
--- a/release_23/test/CodeGen/ARM/2007-05-07-jumptoentry.ll
+++ /dev/null
@@ -1,58 +0,0 @@
-; RUN: llvm-as < %s | llc | not grep 1_0
-; This used to create an extra branch to 'entry', LBB1_0.
-
-; ModuleID = 'bug.bc'
-target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:32-f32:32:32-f64:32:32-v64:64:64-v128:128:128-a0:0:64"
-target triple = "arm-apple-darwin8"
- %struct.HexxagonMove = type { i8, i8, i32 }
- %struct.HexxagonMoveList = type { i32, %struct.HexxagonMove* }
-
-define void @_ZN16HexxagonMoveList8sortListEv(%struct.HexxagonMoveList* %this) {
-entry:
- %tmp51 = getelementptr %struct.HexxagonMoveList* %this, i32 0, i32 0 ; <i32*> [#uses=1]
- %tmp2 = getelementptr %struct.HexxagonMoveList* %this, i32 0, i32 1 ; <%struct.HexxagonMove**> [#uses=2]
- br label %bb49
-
-bb1: ; preds = %bb49
- %tmp3 = load %struct.HexxagonMove** %tmp2 ; <%struct.HexxagonMove*> [#uses=5]
- %tmp6 = getelementptr %struct.HexxagonMove* %tmp3, i32 %i.1, i32 2 ; <i32*> [#uses=1]
- %tmp7 = load i32* %tmp6 ; <i32> [#uses=2]
- %tmp12 = add i32 %i.1, 1 ; <i32> [#uses=7]
- %tmp14 = getelementptr %struct.HexxagonMove* %tmp3, i32 %tmp12, i32 2 ; <i32*> [#uses=1]
- %tmp15 = load i32* %tmp14 ; <i32> [#uses=1]
- %tmp16 = icmp slt i32 %tmp7, %tmp15 ; <i1> [#uses=1]
- br i1 %tmp16, label %cond_true, label %bb49
-
-cond_true: ; preds = %bb1
- %tmp23.0 = getelementptr %struct.HexxagonMove* %tmp3, i32 %i.1, i32 0 ; <i8*> [#uses=2]
- %tmp67 = load i8* %tmp23.0 ; <i8> [#uses=1]
- %tmp23.1 = getelementptr %struct.HexxagonMove* %tmp3, i32 %i.1, i32 1 ; <i8*> [#uses=1]
- %tmp68 = load i8* %tmp23.1 ; <i8> [#uses=1]
- %tmp3638 = getelementptr %struct.HexxagonMove* %tmp3, i32 %tmp12, i32 0 ; <i8*> [#uses=1]
- tail call void @llvm.memcpy.i32( i8* %tmp23.0, i8* %tmp3638, i32 8, i32 4 )
- %tmp41 = load %struct.HexxagonMove** %tmp2 ; <%struct.HexxagonMove*> [#uses=3]
- %tmp44.0 = getelementptr %struct.HexxagonMove* %tmp41, i32 %tmp12, i32 0 ; <i8*> [#uses=1]
- store i8 %tmp67, i8* %tmp44.0
- %tmp44.1 = getelementptr %struct.HexxagonMove* %tmp41, i32 %tmp12, i32 1 ; <i8*> [#uses=1]
- store i8 %tmp68, i8* %tmp44.1
- %tmp44.2 = getelementptr %struct.HexxagonMove* %tmp41, i32 %tmp12, i32 2 ; <i32*> [#uses=1]
- store i32 %tmp7, i32* %tmp44.2
- br label %bb49
-
-bb49: ; preds = %bb59, %cond_true, %bb1, %entry
- %i.1 = phi i32 [ 0, %entry ], [ %tmp12, %bb1 ], [ %tmp12, %cond_true ], [ 0, %bb59 ] ; <i32> [#uses=5]
- %move.2 = phi i32 [ 0, %entry ], [ 1, %cond_true ], [ %move.2, %bb1 ], [ 0, %bb59 ] ; <i32> [#uses=2]
- %tmp52 = load i32* %tmp51 ; <i32> [#uses=1]
- %tmp53 = add i32 %tmp52, -1 ; <i32> [#uses=1]
- %tmp55 = icmp sgt i32 %tmp53, %i.1 ; <i1> [#uses=1]
- br i1 %tmp55, label %bb1, label %bb59
-
-bb59: ; preds = %bb49
- %tmp61 = icmp eq i32 %move.2, 0 ; <i1> [#uses=1]
- br i1 %tmp61, label %return, label %bb49
-
-return: ; preds = %bb59
- ret void
-}
-
-declare void @llvm.memcpy.i32(i8*, i8*, i32, i32)
diff --git a/release_23/test/CodeGen/ARM/2007-05-07-tailmerge-1.ll b/release_23/test/CodeGen/ARM/2007-05-07-tailmerge-1.ll
deleted file mode 100644
index c3596e7c7b4f..000000000000
--- a/release_23/test/CodeGen/ARM/2007-05-07-tailmerge-1.ll
+++ /dev/null
@@ -1,68 +0,0 @@
-; RUN: llvm-as < %s | llc -march=arm -enable-tail-merge | grep bl.*baz | count 1
-; RUN: llvm-as < %s | llc -march=arm -enable-tail-merge | grep bl.*quux | count 1
-; RUN: llvm-as < %s | llc -march=arm -enable-tail-merge -enable-eh | grep bl.*baz | count 1
-; RUN: llvm-as < %s | llc -march=arm -enable-tail-merge -enable-eh | grep bl.*quux | count 1
-; Check that calls to baz and quux are tail-merged.
-; PR1628
-
-; ModuleID = 'tail.c'
-target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64"
-target triple = "i686-apple-darwin8"
-
-define i32 @f(i32 %i, i32 %q) {
-entry:
- %i_addr = alloca i32 ; <i32*> [#uses=2]
- %q_addr = alloca i32 ; <i32*> [#uses=2]
- %retval = alloca i32, align 4 ; <i32*> [#uses=1]
- "alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
- store i32 %i, i32* %i_addr
- store i32 %q, i32* %q_addr
- %tmp = load i32* %i_addr ; <i32> [#uses=1]
- %tmp1 = icmp ne i32 %tmp, 0 ; <i1> [#uses=1]
- %tmp12 = zext i1 %tmp1 to i8 ; <i8> [#uses=1]
- %toBool = icmp ne i8 %tmp12, 0 ; <i1> [#uses=1]
- br i1 %toBool, label %cond_true, label %cond_false
-
-cond_true: ; preds = %entry
- %tmp3 = call i32 (...)* @bar( ) ; <i32> [#uses=0]
- %tmp4 = call i32 (...)* @baz( i32 5, i32 6 ) ; <i32> [#uses=0]
- br label %cond_next
-
-cond_false: ; preds = %entry
- %tmp5 = call i32 (...)* @foo( ) ; <i32> [#uses=0]
- %tmp6 = call i32 (...)* @baz( i32 5, i32 6 ) ; <i32> [#uses=0]
- br label %cond_next
-
-cond_next: ; preds = %cond_false, %cond_true
- %tmp7 = load i32* %q_addr ; <i32> [#uses=1]
- %tmp8 = icmp ne i32 %tmp7, 0 ; <i1> [#uses=1]
- %tmp89 = zext i1 %tmp8 to i8 ; <i8> [#uses=1]
- %toBool10 = icmp ne i8 %tmp89, 0 ; <i1> [#uses=1]
- br i1 %toBool10, label %cond_true11, label %cond_false15
-
-cond_true11: ; preds = %cond_next
- %tmp13 = call i32 (...)* @foo( ) ; <i32> [#uses=0]
- %tmp14 = call i32 (...)* @quux( i32 3, i32 4 ) ; <i32> [#uses=0]
- br label %cond_next18
-
-cond_false15: ; preds = %cond_next
- %tmp16 = call i32 (...)* @bar( ) ; <i32> [#uses=0]
- %tmp17 = call i32 (...)* @quux( i32 3, i32 4 ) ; <i32> [#uses=0]
- br label %cond_next18
-
-cond_next18: ; preds = %cond_false15, %cond_true11
- %tmp19 = call i32 (...)* @bar( ) ; <i32> [#uses=0]
- br label %return
-
-return: ; preds = %cond_next18
- %retval20 = load i32* %retval ; <i32> [#uses=1]
- ret i32 %retval20
-}
-
-declare i32 @bar(...)
-
-declare i32 @baz(...)
-
-declare i32 @foo(...)
-
-declare i32 @quux(...)
diff --git a/release_23/test/CodeGen/ARM/2007-05-09-tailmerge-2.ll b/release_23/test/CodeGen/ARM/2007-05-09-tailmerge-2.ll
deleted file mode 100644
index 41ab1e52f674..000000000000
--- a/release_23/test/CodeGen/ARM/2007-05-09-tailmerge-2.ll
+++ /dev/null
@@ -1,69 +0,0 @@
-; RUN: llvm-as < %s | llc -march=arm -enable-tail-merge | grep bl.*baz | count 1
-; RUN: llvm-as < %s | llc -march=arm -enable-tail-merge | grep bl.*quux | count 1
-; RUN: llvm-as < %s | llc -march=arm -enable-tail-merge -enable-eh | grep bl.*baz | count 1
-; RUN: llvm-as < %s | llc -march=arm -enable-tail-merge -enable-eh | grep bl.*quux | count 1
-; Check that calls to baz and quux are tail-merged.
-; PR1628
-
-; ModuleID = 'tail.c'
-target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64"
-target triple = "i686-apple-darwin8"
-
-define i32 @f(i32 %i, i32 %q) {
-entry:
- %i_addr = alloca i32 ; <i32*> [#uses=2]
- %q_addr = alloca i32 ; <i32*> [#uses=2]
- %retval = alloca i32, align 4 ; <i32*> [#uses=1]
- "alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
- store i32 %i, i32* %i_addr
- store i32 %q, i32* %q_addr
- %tmp = load i32* %i_addr ; <i32> [#uses=1]
- %tmp1 = icmp ne i32 %tmp, 0 ; <i1> [#uses=1]
- %tmp12 = zext i1 %tmp1 to i8 ; <i8> [#uses=1]
- %toBool = icmp ne i8 %tmp12, 0 ; <i1> [#uses=1]
- br i1 %toBool, label %cond_true, label %cond_false
-
-cond_true: ; preds = %entry
- %tmp3 = call i32 (...)* @bar( ) ; <i32> [#uses=0]
- %tmp4 = call i32 (...)* @baz( i32 5, i32 6 ) ; <i32> [#uses=0]
- %tmp7 = load i32* %q_addr ; <i32> [#uses=1]
- %tmp8 = icmp ne i32 %tmp7, 0 ; <i1> [#uses=1]
- %tmp89 = zext i1 %tmp8 to i8 ; <i8> [#uses=1]
- %toBool10 = icmp ne i8 %tmp89, 0 ; <i1> [#uses=1]
- br i1 %toBool10, label %cond_true11, label %cond_false15
-
-cond_false: ; preds = %entry
- %tmp5 = call i32 (...)* @foo( ) ; <i32> [#uses=0]
- %tmp6 = call i32 (...)* @baz( i32 5, i32 6 ) ; <i32> [#uses=0]
- %tmp27 = load i32* %q_addr ; <i32> [#uses=1]
- %tmp28 = icmp ne i32 %tmp27, 0 ; <i1> [#uses=1]
- %tmp289 = zext i1 %tmp28 to i8 ; <i8> [#uses=1]
- %toBool210 = icmp ne i8 %tmp289, 0 ; <i1> [#uses=1]
- br i1 %toBool210, label %cond_true11, label %cond_false15
-
-cond_true11: ; preds = %cond_next
- %tmp13 = call i32 (...)* @foo( ) ; <i32> [#uses=0]
- %tmp14 = call i32 (...)* @quux( i32 3, i32 4 ) ; <i32> [#uses=0]
- br label %cond_next18
-
-cond_false15: ; preds = %cond_next
- %tmp16 = call i32 (...)* @bar( ) ; <i32> [#uses=0]
- %tmp17 = call i32 (...)* @quux( i32 3, i32 4 ) ; <i32> [#uses=0]
- br label %cond_next18
-
-cond_next18: ; preds = %cond_false15, %cond_true11
- %tmp19 = call i32 (...)* @bar( ) ; <i32> [#uses=0]
- br label %return
-
-return: ; preds = %cond_next18
- %retval20 = load i32* %retval ; <i32> [#uses=1]
- ret i32 %retval20
-}
-
-declare i32 @bar(...)
-
-declare i32 @baz(...)
-
-declare i32 @foo(...)
-
-declare i32 @quux(...)
diff --git a/release_23/test/CodeGen/ARM/2007-05-14-InlineAsmCstCrash.ll b/release_23/test/CodeGen/ARM/2007-05-14-InlineAsmCstCrash.ll
deleted file mode 100644
index 58c5f89c619d..000000000000
--- a/release_23/test/CodeGen/ARM/2007-05-14-InlineAsmCstCrash.ll
+++ /dev/null
@@ -1,6 +0,0 @@
-; RUN: llvm-as < %s | llc -march=arm -mattr=+v6
-
-define i32 @test3() {
- tail call void asm sideeffect "/* number: ${0:c} */", "i"( i32 1 )
- ret i32 11
-}
diff --git a/release_23/test/CodeGen/ARM/2007-05-14-RegScavengerAssert.ll b/release_23/test/CodeGen/ARM/2007-05-14-RegScavengerAssert.ll
deleted file mode 100644
index 430b3689c0b4..000000000000
--- a/release_23/test/CodeGen/ARM/2007-05-14-RegScavengerAssert.ll
+++ /dev/null
@@ -1,30 +0,0 @@
-; RUN: llvm-as < %s | llc -march=arm -mtriple=arm-linux-gnueabi
-; PR1406
-
- %struct.AVClass = type { i8*, i8* (i8*)*, %struct.AVOption* }
- %struct.AVCodec = type { i8*, i32, i32, i32, i32 (%struct.AVCodecContext*)*, i32 (%struct.AVCodecContext*, i8*, i32, i8*)*, i32 (%struct.AVCodecContext*)*, i32 (%struct.AVCodecContext*, i8*, i32*, i8*, i32)*, i32, %struct.AVCodec*, void (%struct.AVCodecContext*)*, %struct.AVRational*, i32* }
- %struct.AVCodecContext = type { %struct.AVClass*, i32, i32, i32, i32, i32, i8*, i32, %struct.AVRational, i32, i32, i32, i32, i32, void (%struct.AVCodecContext*, %struct.AVFrame*, i32*, i32, i32, i32)*, i32, i32, i32, i32, i32, i32, i32, float, float, i32, i32, i32, i32, float, i32, i32, i32, %struct.AVCodec*, i8*, i32, i32, void (%struct.AVCodecContext*, i8*, i32, i32)*, i32, i32, i32, i32, i32, i32, i32, i32, i32, i8*, [32 x i8], i32, i32, i32, i32, i32, i32, i32, float, i32, i32 (%struct.AVCodecContext*, %struct.AVFrame*)*, void (%struct.AVCodecContext*, %struct.AVFrame*)*, i32, i32, i32, i32, i8*, i8*, float, float, i32, %struct.RcOverride*, i32, i8*, i32, i32, i32, float, float, float, float, i32, float, float, float, float, float, i32, i32, i32, i32*, i32, i32, i32, i32, %struct.AVRational, %struct.AVFrame*, i32, i32, [4 x i64], i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 (%struct.AVCodecContext*, i32*)*, i32, i32, i32, i32, i32, i32, i8*, i32, i32, i32, i32, i32, i32, i16*, i16*, i32, i32, i32, i32, %struct.AVPaletteControl*, i32, i32 (%struct.AVCodecContext*, %struct.AVFrame*)*, i32, i32, i32, i32, i32, i32, i32, i32 (%struct.AVCodecContext*, i32 (%struct.AVCodecContext*, i8*)*, i8**, i32*, i32)*, i8*, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, float, i32, i32, i32, i32, i32, i32, i32, i32, float, i32, i32, i32, i32, i32, i32, float, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i64 }
- %struct.AVFrame = type { [4 x i8*], [4 x i32], [4 x i8*], i32, i32, i64, i32, i32, i32, i32, i32, i8*, i32, i8*, [2 x [2 x i16]*], i32*, i8, i8*, [4 x i64], i32, i32, i32, i32, i32, %struct.AVPanScan*, i32, i32, i16*, [2 x i8*] }
- %struct.AVOption = type opaque
- %struct.AVPaletteControl = type { i32, [256 x i32] }
- %struct.AVPanScan = type { i32, i32, i32, [3 x [2 x i16]] }
- %struct.AVRational = type { i32, i32 }
- %struct.RcOverride = type { i32, i32, i32, float }
-
-define i32 @decode_init(%struct.AVCodecContext* %avctx) {
-entry:
- br i1 false, label %bb, label %cond_next789
-
-bb: ; preds = %bb, %entry
- br i1 false, label %bb59, label %bb
-
-bb59: ; preds = %bb
- %tmp68 = sdiv i64 0, 0 ; <i64> [#uses=1]
- %tmp6869 = trunc i64 %tmp68 to i32 ; <i32> [#uses=2]
- %tmp81 = call i32 asm "smull $0, $1, $2, $3 \0A\09mov $0, $0, lsr $4\0A\09add $1, $0, $1, lsl $5\0A\09", "=&r,=*&r,r,r,i,i"( i32* null, i32 %tmp6869, i32 13316085, i32 23, i32 9 ) ; <i32> [#uses=0]
- %tmp90 = call i32 asm "smull $0, $1, $2, $3 \0A\09mov $0, $0, lsr $4\0A\09add $1, $0, $1, lsl $5\0A\09", "=&r,=*&r,r,r,i,i"( i32* null, i32 %tmp6869, i32 10568984, i32 23, i32 9 ) ; <i32> [#uses=0]
- unreachable
-
-cond_next789: ; preds = %entry
- ret i32 0
-}
diff --git a/release_23/test/CodeGen/ARM/2007-05-22-tailmerge-3.ll b/release_23/test/CodeGen/ARM/2007-05-22-tailmerge-3.ll
deleted file mode 100644
index 4c4a9336fd91..000000000000
--- a/release_23/test/CodeGen/ARM/2007-05-22-tailmerge-3.ll
+++ /dev/null
@@ -1,73 +0,0 @@
-; RUN: llvm-as < %s | llc -march=arm | grep bl.*baz | count 1
-; RUN: llvm-as < %s | llc -march=arm | grep bl.*quux | count 1
-; RUN: llvm-as < %s | llc -march=arm -enable-tail-merge=0 | grep bl.*baz | count 2
-; RUN: llvm-as < %s | llc -march=arm -enable-tail-merge=0 | grep bl.*quux | count 2
-; RUN: llvm-as < %s | llc -march=arm -enable-eh | grep bl.*baz | count 1
-; RUN: llvm-as < %s | llc -march=arm -enable-eh | grep bl.*quux | count 1
-; RUN: llvm-as < %s | llc -march=arm -enable-tail-merge=0 -enable-eh | grep bl.*baz | count 2
-; RUN: llvm-as < %s | llc -march=arm -enable-tail-merge=0 -enable-eh | grep bl.*quux | count 2
-; Check that tail merging is the default on ARM, and that -enable-tail-merge=0 works.
-; PR1628
-
-; ModuleID = 'tail.c'
-target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64"
-target triple = "i686-apple-darwin8"
-
-define i32 @f(i32 %i, i32 %q) {
-entry:
- %i_addr = alloca i32 ; <i32*> [#uses=2]
- %q_addr = alloca i32 ; <i32*> [#uses=2]
- %retval = alloca i32, align 4 ; <i32*> [#uses=1]
- "alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
- store i32 %i, i32* %i_addr
- store i32 %q, i32* %q_addr
- %tmp = load i32* %i_addr ; <i32> [#uses=1]
- %tmp1 = icmp ne i32 %tmp, 0 ; <i1> [#uses=1]
- %tmp12 = zext i1 %tmp1 to i8 ; <i8> [#uses=1]
- %toBool = icmp ne i8 %tmp12, 0 ; <i1> [#uses=1]
- br i1 %toBool, label %cond_true, label %cond_false
-
-cond_true: ; preds = %entry
- %tmp3 = call i32 (...)* @bar( ) ; <i32> [#uses=0]
- %tmp4 = call i32 (...)* @baz( i32 5, i32 6 ) ; <i32> [#uses=0]
- %tmp7 = load i32* %q_addr ; <i32> [#uses=1]
- %tmp8 = icmp ne i32 %tmp7, 0 ; <i1> [#uses=1]
- %tmp89 = zext i1 %tmp8 to i8 ; <i8> [#uses=1]
- %toBool10 = icmp ne i8 %tmp89, 0 ; <i1> [#uses=1]
- br i1 %toBool10, label %cond_true11, label %cond_false15
-
-cond_false: ; preds = %entry
- %tmp5 = call i32 (...)* @foo( ) ; <i32> [#uses=0]
- %tmp6 = call i32 (...)* @baz( i32 5, i32 6 ) ; <i32> [#uses=0]
- %tmp27 = load i32* %q_addr ; <i32> [#uses=1]
- %tmp28 = icmp ne i32 %tmp27, 0 ; <i1> [#uses=1]
- %tmp289 = zext i1 %tmp28 to i8 ; <i8> [#uses=1]
- %toBool210 = icmp ne i8 %tmp289, 0 ; <i1> [#uses=1]
- br i1 %toBool210, label %cond_true11, label %cond_false15
-
-cond_true11: ; preds = %cond_next
- %tmp13 = call i32 (...)* @foo( ) ; <i32> [#uses=0]
- %tmp14 = call i32 (...)* @quux( i32 3, i32 4 ) ; <i32> [#uses=0]
- br label %cond_next18
-
-cond_false15: ; preds = %cond_next
- %tmp16 = call i32 (...)* @bar( ) ; <i32> [#uses=0]
- %tmp17 = call i32 (...)* @quux( i32 3, i32 4 ) ; <i32> [#uses=0]
- br label %cond_next18
-
-cond_next18: ; preds = %cond_false15, %cond_true11
- %tmp19 = call i32 (...)* @bar( ) ; <i32> [#uses=0]
- br label %return
-
-return: ; preds = %cond_next18
- %retval20 = load i32* %retval ; <i32> [#uses=1]
- ret i32 %retval20
-}
-
-declare i32 @bar(...)
-
-declare i32 @baz(...)
-
-declare i32 @foo(...)
-
-declare i32 @quux(...)
diff --git a/release_23/test/CodeGen/ARM/2007-05-23-BadPreIndexedStore.ll b/release_23/test/CodeGen/ARM/2007-05-23-BadPreIndexedStore.ll
deleted file mode 100644
index de32a26ae9cf..000000000000
--- a/release_23/test/CodeGen/ARM/2007-05-23-BadPreIndexedStore.ll
+++ /dev/null
@@ -1,34 +0,0 @@
-; RUN: llvm-as < %s | llc -march=arm | not grep {str.*\\!}
-
- %struct.shape_edge_t = type { %struct.shape_edge_t*, %struct.shape_edge_t*, i32, i32, i32, i32 }
- %struct.shape_path_t = type { %struct.shape_edge_t*, %struct.shape_edge_t*, i32, i32, i32, i32, i32, i32 }
- %struct.shape_pool_t = type { i8* (%struct.shape_pool_t*, i8*, i32)*, i8* (%struct.shape_pool_t*, i32)*, void (%struct.shape_pool_t*, i8*)* }
-
-define %struct.shape_path_t* @shape_path_alloc(%struct.shape_pool_t* %pool, i32* %shape) {
-entry:
- br i1 false, label %cond_false, label %bb45
-
-bb45: ; preds = %entry
- ret %struct.shape_path_t* null
-
-cond_false: ; preds = %entry
- br i1 false, label %bb140, label %bb174
-
-bb140: ; preds = %bb140, %cond_false
- %indvar = phi i32 [ 0, %cond_false ], [ %indvar.next, %bb140 ] ; <i32> [#uses=2]
- %edge.230.0.rec = shl i32 %indvar, 1 ; <i32> [#uses=3]
- %edge.230.0 = getelementptr %struct.shape_edge_t* null, i32 %edge.230.0.rec ; <%struct.shape_edge_t*> [#uses=1]
- %edge.230.0.sum6970 = or i32 %edge.230.0.rec, 1 ; <i32> [#uses=2]
- %tmp154 = getelementptr %struct.shape_edge_t* null, i32 %edge.230.0.sum6970 ; <%struct.shape_edge_t*> [#uses=1]
- %tmp11.i5 = getelementptr %struct.shape_edge_t* null, i32 %edge.230.0.sum6970, i32 0 ; <%struct.shape_edge_t**> [#uses=1]
- store %struct.shape_edge_t* %edge.230.0, %struct.shape_edge_t** %tmp11.i5
- store %struct.shape_edge_t* %tmp154, %struct.shape_edge_t** null
- %tmp16254.0.rec = add i32 %edge.230.0.rec, 2 ; <i32> [#uses=1]
- %xp.350.sum = add i32 0, %tmp16254.0.rec ; <i32> [#uses=1]
- %tmp168 = icmp slt i32 %xp.350.sum, 0 ; <i1> [#uses=1]
- %indvar.next = add i32 %indvar, 1 ; <i32> [#uses=1]
- br i1 %tmp168, label %bb140, label %bb174
-
-bb174: ; preds = %bb140, %cond_false
- ret %struct.shape_path_t* null
-}
diff --git a/release_23/test/CodeGen/ARM/2007-05-31-RegScavengerInfiniteLoop.ll b/release_23/test/CodeGen/ARM/2007-05-31-RegScavengerInfiniteLoop.ll
deleted file mode 100644
index d21a8f209e96..000000000000
--- a/release_23/test/CodeGen/ARM/2007-05-31-RegScavengerInfiniteLoop.ll
+++ /dev/null
@@ -1,237 +0,0 @@
-; RUN: llvm-as < %s | llc
-; PR1424
-
-target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64"
-target triple = "arm-linux-gnueabi"
- %struct.AVClass = type { i8*, i8* (i8*)*, %struct.AVOption* }
- %struct.AVCodec = type { i8*, i32, i32, i32, i32 (%struct.AVCodecContext*)*, i32 (%struct.AVCodecContext*, i8*, i32, i8*)*, i32 (%struct.AVCodecContext*)*, i32 (%struct.AVCodecContext*, i8*, i32*, i8*, i32)*, i32, %struct.AVCodec*, void (%struct.AVCodecContext*)*, %struct.AVRational*, i32* }
- %struct.AVCodecContext = type { %struct.AVClass*, i32, i32, i32, i32, i32, i8*, i32, %struct.AVRational, i32, i32, i32, i32, i32, void (%struct.AVCodecContext*, %struct.AVFrame*, i32*, i32, i32, i32)*, i32, i32, i32, i32, i32, i32, i32, float, float, i32, i32, i32, i32, float, i32, i32, i32, %struct.AVCodec*, i8*, i32, i32, void (%struct.AVCodecContext*, i8*, i32, i32)*, i32, i32, i32, i32, i32, i32, i32, i32, i32, i8*, [32 x i8], i32, i32, i32, i32, i32, i32, i32, float, i32, i32 (%struct.AVCodecContext*, %struct.AVFrame*)*, void (%struct.AVCodecContext*, %struct.AVFrame*)*, i32, i32, i32, i32, i8*, i8*, float, float, i32, %struct.RcOverride*, i32, i8*, i32, i32, i32, float, float, float, float, i32, float, float, float, float, float, i32, i32, i32, i32*, i32, i32, i32, i32, %struct.AVRational, %struct.AVFrame*, i32, i32, [4 x i64], i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 (%struct.AVCodecContext*, i32*)*, i32, i32, i32, i32, i32, i32, i8*, i32, i32, i32, i32, i32, i32, i16*, i16*, i32, i32, i32, i32, %struct.AVPaletteControl*, i32, i32 (%struct.AVCodecContext*, %struct.AVFrame*)*, i32, i32, i32, i32, i32, i32, i32, i32 (%struct.AVCodecContext*, i32 (%struct.AVCodecContext*, i8*)*, i8**, i32*, i32)*, i8*, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, float, i32, i32, i32, i32, i32, i32, i32, i32, float, i32, i32, i32, i32, i32, i32, float, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i64 }
- %struct.AVEvalExpr = type opaque
- %struct.AVFrame = type { [4 x i8*], [4 x i32], [4 x i8*], i32, i32, i64, i32, i32, i32, i32, i32, i8*, i32, i8*, [2 x [2 x i16]*], i32*, i8, i8*, [4 x i64], i32, i32, i32, i32, i32, %struct.AVPanScan*, i32, i32, i16*, [2 x i8*] }
- %struct.AVOption = type opaque
- %struct.AVPaletteControl = type { i32, [256 x i32] }
- %struct.AVPanScan = type { i32, i32, i32, [3 x [2 x i16]] }
- %struct.AVRational = type { i32, i32 }
- %struct.BlockNode = type { i16, i16, i8, [3 x i8], i8, i8 }
- %struct.DSPContext = type { void (i16*, i8*, i32)*, void (i16*, i8*, i8*, i32)*, void (i16*, i8*, i32)*, void (i16*, i8*, i32)*, void (i16*, i8*, i32)*, void (i8*, i16*, i32)*, void (i8*, i16*, i32)*, i32 (i16*)*, void (i8*, i8*, i32, i32, i32, i32, i32)*, void (i8*, i8*, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32)*, void (i16*)*, i32 (i8*, i32)*, i32 (i8*, i32)*, [5 x i32 (i8*, i8*, i8*, i32, i32)*], [5 x i32 (i8*, i8*, i8*, i32, i32)*], [5 x i32 (i8*, i8*, i8*, i32, i32)*], [5 x i32 (i8*, i8*, i8*, i32, i32)*], [5 x i32 (i8*, i8*, i8*, i32, i32)*], [5 x i32 (i8*, i8*, i8*, i32, i32)*], [5 x i32 (i8*, i8*, i8*, i32, i32)*], [5 x i32 (i8*, i8*, i8*, i32, i32)*], [5 x i32 (i8*, i8*, i8*, i32, i32)*], [5 x i32 (i8*, i8*, i8*, i32, i32)*], [5 x i32 (i8*, i8*, i8*, i32, i32)*], [5 x i32 (i8*, i8*, i8*, i32, i32)*], [5 x i32 (i8*, i8*, i8*, i32, i32)*], [5 x i32 (i8*, i8*, i8*, i32, i32)*], [5 x i32 (i8*, i8*, i8*, i32, i32)*], [5 x i32 (i8*, i8*, i8*, i32, i32)*], [5 x i32 (i8*, i8*, i8*, i32, i32)*], [5 x i32 (i8*, i8*, i8*, i32, i32)*], [5 x i32 (i8*, i8*, i8*, i32, i32)*], [5 x i32 (i8*, i8*, i8*, i32, i32)*], i32 (i8*, i16*, i32)*, [4 x [4 x void (i8*, i8*, i32, i32)*]], [4 x [4 x void (i8*, i8*, i32, i32)*]], [4 x [4 x void (i8*, i8*, i32, i32)*]], [4 x [4 x void (i8*, i8*, i32, i32)*]], [2 x void (i8*, i8*, i8*, i32, i32)*], [11 x void (i8*, i8*, i32, i32, i32)*], [11 x void (i8*, i8*, i32, i32, i32)*], [2 x [16 x void (i8*, i8*, i32)*]], [2 x [16 x void (i8*, i8*, i32)*]], [2 x [16 x void (i8*, i8*, i32)*]], [2 x [16 x void (i8*, i8*, i32)*]], [8 x void (i8*, i8*, i32)*], [3 x void (i8*, i8*, i32, i32, i32, i32)*], [3 x void (i8*, i8*, i32, i32, i32, i32)*], [3 x void (i8*, i8*, i32, i32, i32, i32)*], [4 x [16 x void (i8*, i8*, i32)*]], [4 x [16 x void (i8*, i8*, i32)*]], [4 x [16 x void (i8*, i8*, i32)*]], [4 x [16 x void (i8*, i8*, i32)*]], [10 x void (i8*, i32, i32, i32, i32)*], [10 x void (i8*, i8*, i32, i32, i32, i32, i32)*], [2 x [16 x void (i8*, i8*, i32)*]], [2 x [16 x void (i8*, i8*, i32)*]], void (i8*, i32, i32, i32, i32, i32, i32)*, void (i8*, i32, i32, i32, i32, i32, i32)*, void (i8*, i32, i32, i32, i32, i32, i32)*, void (i8*, i32, i32, i32, i32, i32, i32)*, void (i8*, i16*, i32)*, [2 x [4 x i32 (i8*, i8*, i8*, i32, i32)*]], void (i8*, i8*, i32)*, void (i8*, i8*, i8*, i32)*, void (i8*, i8*, i8*, i32, i32*, i32*)*, void (i32*, i32*, i32)*, void (i8*, i32, i32, i32, i8*)*, void (i8*, i32, i32, i32, i8*)*, void (i8*, i32, i32, i32, i8*)*, void (i8*, i32, i32, i32, i8*)*, void (i8*, i32, i32, i32)*, void (i8*, i32, i32, i32)*, void ([4 x [4 x i16]]*, i8*, [40 x i8]*, [40 x [2 x i16]]*, i32, i32, i32, i32, i32)*, void (i8*, i32, i32)*, void (i8*, i32, i32)*, void (i8*, i32)*, void (float*, float*, i32)*, void (float*, float*, i32)*, void (float*, float*, float*, i32)*, void (float*, float*, float*, float*, i32, i32, i32)*, void (i16*, float*, i32)*, void (i16*)*, void (i16*)*, void (i16*)*, void (i8*, i32, i16*)*, void (i8*, i32, i16*)*, [64 x i8], i32, i32 (i16*, i16*, i16*, i32)*, void (i16*, i16*, i32)*, void (i8*, i16*, i32)*, void (i8*, i16*, i32)*, void (i8*, i16*, i32)*, void (i8*, i16*, i32)*, void ([4 x i16]*)*, void (i32*, i32*, i32*, i32*, i32*, i32*, i32)*, void (i32*, i32)*, void (i8*, i32, i8**, i32, i32, i32, i32, i32, %struct.slice_buffer*, i32, i8*)*, void (i8*, i32, i32)*, [4 x void (i8*, i32, i8*, i32, i32, i32)*], void (i16*)*, void (i16*, i32)*, void (i16*, i32)*, void (i16*, i32)*, void (i8*, i32)*, void (i8*, i32)*, [16 x void (i8*, i8*, i32, i32)*] }
- %struct.FILE = type { i32, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, %struct._IO_marker*, %struct.FILE*, i32, i32, i32, i16, i8, [1 x i8], i8*, i64, i8*, i8*, i8*, i8*, i32, i32, [40 x i8] }
- %struct.GetBitContext = type { i8*, i8*, i32*, i32, i32, i32, i32 }
- %struct.MJpegContext = type opaque
- %struct.MotionEstContext = type { %struct.AVCodecContext*, i32, [4 x [2 x i32]], [4 x [2 x i32]], i8*, i8*, [2 x i8*], i8*, i32, i32*, i32*, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, [4 x [4 x i8*]], [4 x [4 x i8*]], i32, i32, i32, i32, i32, [4 x void (i8*, i8*, i32, i32)*]*, [4 x void (i8*, i8*, i32, i32)*]*, [16 x void (i8*, i8*, i32)*]*, [16 x void (i8*, i8*, i32)*]*, [4097 x i8]*, i8*, i32 (%struct.MpegEncContext*, i32*, i32*, i32, i32, i32, i32, i32)* }
- %struct.MpegEncContext = type { %struct.AVCodecContext*, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, %struct.PutBitContext, i32, i32, i32, i32, i32, i32, i64, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, %struct.Picture*, %struct.Picture**, %struct.Picture**, i32, i32, [8 x %struct.MpegEncContext*], %struct.Picture, %struct.Picture, %struct.Picture, %struct.Picture, %struct.Picture*, %struct.Picture*, %struct.Picture*, [3 x i8*], [3 x i32], i16*, [3 x i16*], [20 x i16], i32, i32, i8*, i8*, i8*, i8*, i8*, [16 x i16]*, [3 x [16 x i16]*], i32, i8*, i32, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i32, i32, i32, i32, i32*, i32, i32, i32, i32, i32, i32, i32, [5 x i32], i32, i32, i32, i32, %struct.DSPContext, i32, i32, [2 x i16]*, [2 x i16]*, [2 x i16]*, [2 x i16]*, [2 x i16]*, [2 x i16]*, [2 x [2 x [2 x i16]*]], [2 x [2 x [2 x [2 x i16]*]]], [2 x i16]*, [2 x i16]*, [2 x i16]*, [2 x i16]*, [2 x i16]*, [2 x i16]*, [2 x [2 x [2 x i16]*]], [2 x [2 x [2 x [2 x i16]*]]], [2 x i8*], [2 x [2 x i8*]], i32, i32, i32, [2 x [4 x [2 x i32]]], [2 x [2 x i32]], [2 x [2 x [2 x i32]]], i8*, [2 x [64 x i16]], %struct.MotionEstContext, i32, i32, i32, i32, i32, i32, i16*, [6 x i32], [6 x i32], [3 x i8*], i32*, [64 x i16], [64 x i16], [64 x i16], [64 x i16], i32, i32, i32, i32, i32, i8*, i8*, i8*, i8*, i8*, i8*, [8 x i32], [64 x i32]*, [64 x i32]*, [2 x [64 x i16]]*, [2 x [64 x i16]]*, [12 x i32], %struct.ScanTable, %struct.ScanTable, %struct.ScanTable, %struct.ScanTable, [64 x i32]*, [2 x i32], [64 x i16]*, i8*, i64, i64, i32, i32, %struct.RateControlContext, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i8*, i32, i32, %struct.GetBitContext, i32, i32, i32, %struct.ParseContext, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i64, i64, i16, i16, i16, i16, i32, i32, i32, i32, i32, i32, i32, i32, i32, [2 x [2 x i32]], [2 x [2 x i32]], [2 x i32], i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, %struct.PutBitContext, %struct.PutBitContext, i32, i32, i32, i32, i32, i32, i8*, i32, i32, i32, i32, i32, [3 x i32], %struct.MJpegContext*, [3 x i32], [3 x i32], i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, [2 x [65 x [65 x [2 x i32]]]]*, i32, i32, %struct.GetBitContext, i32, i32, i32, i8*, i32, [2 x [2 x i32]], i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, [2 x i32], i32, i32, i32, i32, i8*, i32, [12 x i16*], [64 x i16]*, [8 x [64 x i16]]*, i32 (%struct.MpegEncContext*, [64 x i16]*)*, void (%struct.MpegEncContext*, i16*, i32, i32)*, void (%struct.MpegEncContext*, i16*, i32, i32)*, void (%struct.MpegEncContext*, i16*, i32, i32)*, void (%struct.MpegEncContext*, i16*, i32, i32)*, void (%struct.MpegEncContext*, i16*, i32, i32)*, void (%struct.MpegEncContext*, i16*, i32, i32)*, void (%struct.MpegEncContext*, i16*, i32, i32)*, void (%struct.MpegEncContext*, i16*, i32, i32)*, void (%struct.MpegEncContext*, i16*, i32, i32)*, void (%struct.MpegEncContext*, i16*, i32, i32)*, i32 (%struct.MpegEncContext*, i16*, i32, i32, i32*)*, i32 (%struct.MpegEncContext*, i16*, i32, i32, i32*)*, void (%struct.MpegEncContext*, i16*)* }
- %struct.ParseContext = type { i8*, i32, i32, i32, i32, i32, i32, i32 }
- %struct.Picture = type { [4 x i8*], [4 x i32], [4 x i8*], i32, i32, i64, i32, i32, i32, i32, i32, i8*, i32, i8*, [2 x [2 x i16]*], i32*, i8, i8*, [4 x i64], i32, i32, i32, i32, i32, %struct.AVPanScan*, i32, i32, i16*, [2 x i8*], [3 x i8*], [2 x [2 x i16]*], i32*, [2 x i32], i32, i32, i32, i32, [2 x [16 x i32]], [2 x i32], i32, i32, i16*, i16*, i8*, i32*, i32 }
- %struct.Plane = type { i32, i32, [8 x [4 x %struct.SubBand]] }
- %struct.Predictor = type { double, double, double }
- %struct.PutBitContext = type { i32, i32, i8*, i8*, i8* }
- %struct.RangeCoder = type { i32, i32, i32, i32, [256 x i8], [256 x i8], i8*, i8*, i8* }
- %struct.RateControlContext = type { %struct.FILE*, i32, %struct.RateControlEntry*, double, [5 x %struct.Predictor], double, double, double, double, double, [5 x double], i32, i32, [5 x i64], [5 x i64], [5 x i64], [5 x i64], [5 x i32], i32, i8*, float, i32, %struct.AVEvalExpr* }
- %struct.RateControlEntry = type { i32, float, i32, i32, i32, i32, i32, i64, i32, float, i32, i32, i32, i32, i32, i32 }
- %struct.RcOverride = type { i32, i32, i32, float }
- %struct.ScanTable = type { i8*, [64 x i8], [64 x i8] }
- %struct.SnowContext = type { %struct.AVCodecContext*, %struct.RangeCoder, %struct.DSPContext, %struct.AVFrame, %struct.AVFrame, %struct.AVFrame, [8 x %struct.AVFrame], %struct.AVFrame, [32 x i8], [4224 x i8], i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, [8 x [2 x i16]*], [8 x i32*], i32*, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, [4 x %struct.Plane], %struct.BlockNode*, [1024 x i32], i32, %struct.slice_buffer, %struct.MpegEncContext }
- %struct.SubBand = type { i32, i32, i32, i32, i32, i32*, i32, i32, i32, %struct.x_and_coeff*, %struct.SubBand*, [519 x [32 x i8]] }
- %struct._IO_marker = type { %struct._IO_marker*, %struct.FILE*, i32 }
- %struct.slice_buffer = type { i32**, i32**, i32, i32, i32, i32, i32* }
- %struct.x_and_coeff = type { i16, i16 }
-
-define fastcc void @iterative_me(%struct.SnowContext* %s) {
-entry:
- %state = alloca [4224 x i8], align 8 ; <[4224 x i8]*> [#uses=0]
- %best_rd4233 = alloca i32, align 4 ; <i32*> [#uses=0]
- %tmp21 = getelementptr %struct.SnowContext* %s, i32 0, i32 36 ; <i32*> [#uses=2]
- br label %bb4198
-
-bb79: ; preds = %bb4189.preheader
- br i1 false, label %cond_next239, label %cond_true
-
-cond_true: ; preds = %bb79
- ret void
-
-cond_next239: ; preds = %bb79
- %tmp286 = alloca i8, i32 0 ; <i8*> [#uses=0]
- ret void
-
-bb4198: ; preds = %bb4189.preheader, %entry
- br i1 false, label %bb4189.preheader, label %bb4204
-
-bb4189.preheader: ; preds = %bb4198
- br i1 false, label %bb79, label %bb4198
-
-bb4204: ; preds = %bb4198
- br i1 false, label %bb4221, label %cond_next4213
-
-cond_next4213: ; preds = %bb4204
- ret void
-
-bb4221: ; preds = %bb4204
- br i1 false, label %bb5242.preheader, label %UnifiedReturnBlock
-
-bb5242.preheader: ; preds = %bb4221
- br label %bb5242
-
-bb4231: ; preds = %bb5233
- %tmp4254.sum = add i32 0, 1 ; <i32> [#uses=2]
- br i1 false, label %bb4559, label %cond_next4622
-
-bb4559: ; preds = %bb4231
- ret void
-
-cond_next4622: ; preds = %bb4231
- %tmp4637 = load i16* null ; <i16> [#uses=1]
- %tmp46374638 = sext i16 %tmp4637 to i32 ; <i32> [#uses=1]
- %tmp4642 = load i16* null ; <i16> [#uses=1]
- %tmp46424643 = sext i16 %tmp4642 to i32 ; <i32> [#uses=1]
- %tmp4648 = load i16* null ; <i16> [#uses=1]
- %tmp46484649 = sext i16 %tmp4648 to i32 ; <i32> [#uses=1]
- %tmp4653 = getelementptr %struct.BlockNode* null, i32 %tmp4254.sum, i32 0 ; <i16*> [#uses=1]
- %tmp4654 = load i16* %tmp4653 ; <i16> [#uses=1]
- %tmp46544655 = sext i16 %tmp4654 to i32 ; <i32> [#uses=1]
- %tmp4644 = add i32 %tmp46374638, 2 ; <i32> [#uses=1]
- %tmp4650 = add i32 %tmp4644, %tmp46424643 ; <i32> [#uses=1]
- %tmp4656 = add i32 %tmp4650, %tmp46484649 ; <i32> [#uses=1]
- %tmp4657 = add i32 %tmp4656, %tmp46544655 ; <i32> [#uses=2]
- %tmp4658 = ashr i32 %tmp4657, 2 ; <i32> [#uses=1]
- %tmp4662 = load i16* null ; <i16> [#uses=1]
- %tmp46624663 = sext i16 %tmp4662 to i32 ; <i32> [#uses=1]
- %tmp4672 = getelementptr %struct.BlockNode* null, i32 0, i32 1 ; <i16*> [#uses=1]
- %tmp4673 = load i16* %tmp4672 ; <i16> [#uses=1]
- %tmp46734674 = sext i16 %tmp4673 to i32 ; <i32> [#uses=1]
- %tmp4678 = getelementptr %struct.BlockNode* null, i32 %tmp4254.sum, i32 1 ; <i16*> [#uses=1]
- %tmp4679 = load i16* %tmp4678 ; <i16> [#uses=1]
- %tmp46794680 = sext i16 %tmp4679 to i32 ; <i32> [#uses=1]
- %tmp4669 = add i32 %tmp46624663, 2 ; <i32> [#uses=1]
- %tmp4675 = add i32 %tmp4669, 0 ; <i32> [#uses=1]
- %tmp4681 = add i32 %tmp4675, %tmp46734674 ; <i32> [#uses=1]
- %tmp4682 = add i32 %tmp4681, %tmp46794680 ; <i32> [#uses=2]
- %tmp4683 = ashr i32 %tmp4682, 2 ; <i32> [#uses=1]
- %tmp4703 = load i32* %tmp21 ; <i32> [#uses=1]
- %tmp4707 = shl i32 %tmp4703, 0 ; <i32> [#uses=4]
- %tmp4710 = load %struct.BlockNode** null ; <%struct.BlockNode*> [#uses=6]
- %tmp4713 = mul i32 %tmp4707, %mb_y.4 ; <i32> [#uses=1]
- %tmp4715 = add i32 %tmp4713, %mb_x.7 ; <i32> [#uses=7]
- store i8 0, i8* null
- store i8 0, i8* null
- %tmp47594761 = bitcast %struct.BlockNode* null to i8* ; <i8*> [#uses=2]
- call void @llvm.memcpy.i32( i8* null, i8* %tmp47594761, i32 10, i32 0 )
- %tmp4716.sum5775 = add i32 %tmp4715, 1 ; <i32> [#uses=1]
- %tmp4764 = getelementptr %struct.BlockNode* %tmp4710, i32 %tmp4716.sum5775 ; <%struct.BlockNode*> [#uses=1]
- %tmp47644766 = bitcast %struct.BlockNode* %tmp4764 to i8* ; <i8*> [#uses=1]
- %tmp4716.sum5774 = add i32 %tmp4715, %tmp4707 ; <i32> [#uses=0]
- %tmp47704772 = bitcast %struct.BlockNode* null to i8* ; <i8*> [#uses=1]
- %tmp4774 = add i32 %tmp4707, 1 ; <i32> [#uses=1]
- %tmp4716.sum5773 = add i32 %tmp4774, %tmp4715 ; <i32> [#uses=1]
- %tmp4777 = getelementptr %struct.BlockNode* %tmp4710, i32 %tmp4716.sum5773 ; <%struct.BlockNode*> [#uses=1]
- %tmp47774779 = bitcast %struct.BlockNode* %tmp4777 to i8* ; <i8*> [#uses=1]
- %tmp4781 = icmp slt i32 %mb_x.7, 0 ; <i1> [#uses=1]
- %tmp4788 = or i1 %tmp4781, %tmp4784 ; <i1> [#uses=2]
- br i1 %tmp4788, label %cond_true4791, label %cond_next4794
-
-cond_true4791: ; preds = %cond_next4622
- unreachable
-
-cond_next4794: ; preds = %cond_next4622
- %tmp4797 = icmp slt i32 %mb_x.7, %tmp4707 ; <i1> [#uses=1]
- br i1 %tmp4797, label %cond_next4803, label %cond_true4800
-
-cond_true4800: ; preds = %cond_next4794
- unreachable
-
-cond_next4803: ; preds = %cond_next4794
- %tmp4825 = ashr i32 %tmp4657, 12 ; <i32> [#uses=1]
- shl i32 %tmp4682, 4 ; <i32>:0 [#uses=1]
- %tmp4828 = and i32 %0, -64 ; <i32> [#uses=1]
- %tmp4831 = getelementptr %struct.BlockNode* %tmp4710, i32 %tmp4715, i32 2 ; <i8*> [#uses=0]
- %tmp4826 = add i32 %tmp4828, %tmp4825 ; <i32> [#uses=1]
- %tmp4829 = add i32 %tmp4826, 0 ; <i32> [#uses=1]
- %tmp4835 = add i32 %tmp4829, 0 ; <i32> [#uses=1]
- store i32 %tmp4835, i32* null
- %tmp48534854 = trunc i32 %tmp4658 to i16 ; <i16> [#uses=1]
- %tmp4856 = getelementptr %struct.BlockNode* %tmp4710, i32 %tmp4715, i32 0 ; <i16*> [#uses=1]
- store i16 %tmp48534854, i16* %tmp4856
- %tmp48574858 = trunc i32 %tmp4683 to i16 ; <i16> [#uses=1]
- %tmp4860 = getelementptr %struct.BlockNode* %tmp4710, i32 %tmp4715, i32 1 ; <i16*> [#uses=1]
- store i16 %tmp48574858, i16* %tmp4860
- %tmp4866 = getelementptr %struct.BlockNode* %tmp4710, i32 %tmp4715, i32 4 ; <i8*> [#uses=0]
- br i1 false, label %bb4933, label %cond_false4906
-
-cond_false4906: ; preds = %cond_next4803
- call void @llvm.memcpy.i32( i8* %tmp47594761, i8* null, i32 10, i32 0 )
- call void @llvm.memcpy.i32( i8* %tmp47644766, i8* null, i32 10, i32 0 )
- call void @llvm.memcpy.i32( i8* %tmp47704772, i8* null, i32 10, i32 0 )
- call void @llvm.memcpy.i32( i8* %tmp47774779, i8* null, i32 10, i32 0 )
- br label %bb5215
-
-bb4933: ; preds = %bb5215, %cond_next4803
- br i1 false, label %cond_true4944, label %bb5215
-
-cond_true4944: ; preds = %bb4933
- %tmp4982 = load i32* %tmp21 ; <i32> [#uses=1]
- %tmp4986 = shl i32 %tmp4982, 0 ; <i32> [#uses=2]
- %tmp4992 = mul i32 %tmp4986, %mb_y.4 ; <i32> [#uses=1]
- %tmp4994 = add i32 %tmp4992, %mb_x.7 ; <i32> [#uses=5]
- %tmp4995.sum5765 = add i32 %tmp4994, 1 ; <i32> [#uses=1]
- %tmp5043 = getelementptr %struct.BlockNode* null, i32 %tmp4995.sum5765 ; <%struct.BlockNode*> [#uses=1]
- %tmp50435045 = bitcast %struct.BlockNode* %tmp5043 to i8* ; <i8*> [#uses=2]
- call void @llvm.memcpy.i32( i8* null, i8* %tmp50435045, i32 10, i32 0 )
- %tmp4995.sum5764 = add i32 %tmp4994, %tmp4986 ; <i32> [#uses=1]
- %tmp5049 = getelementptr %struct.BlockNode* null, i32 %tmp4995.sum5764 ; <%struct.BlockNode*> [#uses=1]
- %tmp50495051 = bitcast %struct.BlockNode* %tmp5049 to i8* ; <i8*> [#uses=2]
- call void @llvm.memcpy.i32( i8* null, i8* %tmp50495051, i32 10, i32 0 )
- %tmp4995.sum5763 = add i32 0, %tmp4994 ; <i32> [#uses=1]
- %tmp5056 = getelementptr %struct.BlockNode* null, i32 %tmp4995.sum5763 ; <%struct.BlockNode*> [#uses=1]
- %tmp50565058 = bitcast %struct.BlockNode* %tmp5056 to i8* ; <i8*> [#uses=1]
- br i1 %tmp4788, label %cond_true5070, label %cond_next5073
-
-cond_true5070: ; preds = %cond_true4944
- unreachable
-
-cond_next5073: ; preds = %cond_true4944
- %tmp5139 = getelementptr %struct.BlockNode* null, i32 %tmp4994, i32 1 ; <i16*> [#uses=0]
- %tmp5145 = getelementptr %struct.BlockNode* null, i32 %tmp4994, i32 4 ; <i8*> [#uses=0]
- call void @llvm.memcpy.i32( i8* %tmp50435045, i8* null, i32 10, i32 0 )
- call void @llvm.memcpy.i32( i8* %tmp50495051, i8* null, i32 10, i32 0 )
- call void @llvm.memcpy.i32( i8* %tmp50565058, i8* null, i32 10, i32 0 )
- br label %bb5215
-
-bb5215: ; preds = %cond_next5073, %bb4933, %cond_false4906
- %i4232.3 = phi i32 [ 0, %cond_false4906 ], [ 0, %cond_next5073 ], [ 0, %bb4933 ] ; <i32> [#uses=1]
- %tmp5217 = icmp slt i32 %i4232.3, 4 ; <i1> [#uses=1]
- br i1 %tmp5217, label %bb4933, label %bb5220
-
-bb5220: ; preds = %bb5215
- br i1 false, label %bb5230, label %cond_true5226
-
-cond_true5226: ; preds = %bb5220
- ret void
-
-bb5230: ; preds = %bb5220
- %indvar.next = add i32 %indvar, 1 ; <i32> [#uses=1]
- br label %bb5233
-
-bb5233: ; preds = %bb5233.preheader, %bb5230
- %indvar = phi i32 [ 0, %bb5233.preheader ], [ %indvar.next, %bb5230 ] ; <i32> [#uses=2]
- %mb_x.7 = shl i32 %indvar, 1 ; <i32> [#uses=4]
- br i1 false, label %bb4231, label %bb5239
-
-bb5239: ; preds = %bb5233
- %indvar.next37882 = add i32 %indvar37881, 1 ; <i32> [#uses=1]
- br label %bb5242
-
-bb5242: ; preds = %bb5239, %bb5242.preheader
- %indvar37881 = phi i32 [ 0, %bb5242.preheader ], [ %indvar.next37882, %bb5239 ] ; <i32> [#uses=2]
- %mb_y.4 = shl i32 %indvar37881, 1 ; <i32> [#uses=3]
- br i1 false, label %bb5233.preheader, label %bb5248
-
-bb5233.preheader: ; preds = %bb5242
- %tmp4784 = icmp slt i32 %mb_y.4, 0 ; <i1> [#uses=1]
- br label %bb5233
-
-bb5248: ; preds = %bb5242
- ret void
-
-UnifiedReturnBlock: ; preds = %bb4221
- ret void
-}
-
-declare void @llvm.memcpy.i32(i8*, i8*, i32, i32)
diff --git a/release_23/test/CodeGen/ARM/2007-08-15-ReuseBug.ll b/release_23/test/CodeGen/ARM/2007-08-15-ReuseBug.ll
deleted file mode 100644
index d4ce286bfaec..000000000000
--- a/release_23/test/CodeGen/ARM/2007-08-15-ReuseBug.ll
+++ /dev/null
@@ -1,106 +0,0 @@
-; RUN: llvm-as < %s | llc -mtriple=arm-apple-darwin -relocation-model=pic -mattr=+v6 | %prcontext {ldr.*\\!} 1 | grep mov
-; PR1609
-
- %struct.FILE = type { i8*, i32, i32, i16, i16, %struct.__sbuf, i32, i8*, i32 (i8*)*, i32 (i8*, i8*, i32)*, i64 (i8*, i64, i32)*, i32 (i8*, i8*, i32)*, %struct.__sbuf, %struct.__sFILEX*, i32, [3 x i8], [1 x i8], %struct.__sbuf, i32, i64 }
- %struct.__sFILEX = type opaque
- %struct.__sbuf = type { i8*, i32 }
-@_C_nextcmd = external global i32 ; <i32*> [#uses=2]
-@_C_cmds = external global [100 x i8*] ; <[100 x i8*]*> [#uses=2]
-@.str44 = external constant [2 x i8] ; <[2 x i8]*> [#uses=1]
-
-define i32 @main(i32 %argc, i8** %argv) {
-entry:
- br label %cond_next212.i
-
-bb21.i: ; preds = %cond_next212.i
- br label %cond_next212.i
-
-bb24.i: ; preds = %cond_next212.i
- ret i32 0
-
-bb27.i: ; preds = %cond_next212.i
- ret i32 0
-
-bb30.i: ; preds = %cond_next212.i
- %tmp205399.i = add i32 %argc_addr.2358.0.i, -1 ; <i32> [#uses=1]
- br label %cond_next212.i
-
-bb33.i: ; preds = %cond_next212.i
- ret i32 0
-
-cond_next73.i: ; preds = %cond_next212.i
- ret i32 0
-
-bb75.i: ; preds = %cond_next212.i
- ret i32 0
-
-bb77.i: ; preds = %cond_next212.i
- ret i32 0
-
-bb79.i: ; preds = %cond_next212.i
- ret i32 0
-
-bb102.i: ; preds = %cond_next212.i
- br i1 false, label %cond_true110.i, label %cond_next123.i
-
-cond_true110.i: ; preds = %bb102.i
- %tmp116.i = getelementptr i8** %argv_addr.2321.0.i, i32 2 ; <i8**> [#uses=1]
- %tmp117.i = load i8** %tmp116.i ; <i8*> [#uses=1]
- %tmp126425.i = call %struct.FILE* @fopen( i8* %tmp117.i, i8* getelementptr ([2 x i8]* @.str44, i32 0, i32 0) ) ; <%struct.FILE*> [#uses=0]
- ret i32 0
-
-cond_next123.i: ; preds = %bb102.i
- %tmp122.i = getelementptr i8* %tmp215.i, i32 2 ; <i8*> [#uses=0]
- ret i32 0
-
-bb162.i: ; preds = %cond_next212.i
- ret i32 0
-
-C_addcmd.exit120.i: ; preds = %cond_next212.i
- %tmp3.i.i.i.i105.i = call i8* @calloc( i32 15, i32 1 ) ; <i8*> [#uses=1]
- %tmp1.i108.i = getelementptr [100 x i8*]* @_C_cmds, i32 0, i32 0 ; <i8**> [#uses=1]
- store i8* %tmp3.i.i.i.i105.i, i8** %tmp1.i108.i, align 4
- %tmp.i91.i = load i32* @_C_nextcmd, align 4 ; <i32> [#uses=1]
- store i32 0, i32* @_C_nextcmd, align 4
- %tmp3.i.i.i.i95.i = call i8* @calloc( i32 15, i32 1 ) ; <i8*> [#uses=1]
- %tmp1.i98.i = getelementptr [100 x i8*]* @_C_cmds, i32 0, i32 %tmp.i91.i ; <i8**> [#uses=1]
- store i8* %tmp3.i.i.i.i95.i, i8** %tmp1.i98.i, align 4
- br label %cond_next212.i
-
-bb174.i: ; preds = %cond_next212.i
- ret i32 0
-
-bb192.i: ; preds = %cond_next212.i
- br label %cond_next212.i
-
-cond_next212.i: ; preds = %cond_next212.i, %cond_next212.i, %cond_next212.i, %cond_next212.i, %bb192.i, %C_addcmd.exit120.i, %bb30.i, %bb21.i, %entry
- %max_d.3 = phi i32 [ -1, %entry ], [ %max_d.3, %bb30.i ], [ %max_d.3, %bb21.i ], [ %max_d.3, %C_addcmd.exit120.i ], [ 0, %bb192.i ], [ %max_d.3, %cond_next212.i ], [ %max_d.3, %cond_next212.i ], [ %max_d.3, %cond_next212.i ], [ %max_d.3, %cond_next212.i ] ; <i32> [#uses=7]
- %argv_addr.2321.0.i = phi i8** [ %argv, %entry ], [ %tmp214.i, %bb192.i ], [ %tmp214.i, %C_addcmd.exit120.i ], [ %tmp214.i, %bb30.i ], [ %tmp214.i, %bb21.i ], [ %tmp214.i, %cond_next212.i ], [ %tmp214.i, %cond_next212.i ], [ %tmp214.i, %cond_next212.i ], [ %tmp214.i, %cond_next212.i ] ; <i8**> [#uses=2]
- %argc_addr.2358.0.i = phi i32 [ %argc, %entry ], [ %tmp205399.i, %bb30.i ], [ 0, %bb21.i ], [ 0, %C_addcmd.exit120.i ], [ 0, %bb192.i ], [ 0, %cond_next212.i ], [ 0, %cond_next212.i ], [ 0, %cond_next212.i ], [ 0, %cond_next212.i ] ; <i32> [#uses=1]
- %tmp214.i = getelementptr i8** %argv_addr.2321.0.i, i32 1 ; <i8**> [#uses=9]
- %tmp215.i = load i8** %tmp214.i ; <i8*> [#uses=1]
- %tmp1314.i = sext i8 0 to i32 ; <i32> [#uses=1]
- switch i32 %tmp1314.i, label %bb192.i [
- i32 76, label %C_addcmd.exit120.i
- i32 77, label %bb174.i
- i32 83, label %bb162.i
- i32 97, label %bb33.i
- i32 98, label %bb21.i
- i32 99, label %bb24.i
- i32 100, label %bb27.i
- i32 101, label %cond_next212.i
- i32 102, label %bb102.i
- i32 105, label %bb75.i
- i32 109, label %bb30.i
- i32 113, label %cond_next212.i
- i32 114, label %cond_next73.i
- i32 115, label %bb79.i
- i32 116, label %cond_next212.i
- i32 118, label %bb77.i
- i32 119, label %cond_next212.i
- ]
-}
-
-declare %struct.FILE* @fopen(i8*, i8*)
-
-declare i8* @calloc(i32, i32)
diff --git a/release_23/test/CodeGen/ARM/2008-02-04-LocalRegAllocBug.ll b/release_23/test/CodeGen/ARM/2008-02-04-LocalRegAllocBug.ll
deleted file mode 100644
index ec170f8eac5b..000000000000
--- a/release_23/test/CodeGen/ARM/2008-02-04-LocalRegAllocBug.ll
+++ /dev/null
@@ -1,19 +0,0 @@
-; RUN: llvm-as < %s | llc -mtriple=arm-linux-gnueabi -regalloc=local
-; PR1925
-
- %struct.encode_aux_nearestmatch = type { i32*, i32*, i32*, i32*, i32, i32 }
- %struct.encode_aux_pigeonhole = type { float, float, i32, i32, i32*, i32, i32*, i32*, i32* }
- %struct.encode_aux_threshmatch = type { float*, i32*, i32, i32 }
- %struct.oggpack_buffer = type { i32, i32, i8*, i8*, i32 }
- %struct.static_codebook = type { i32, i32, i32*, i32, i32, i32, i32, i32, i32*, %struct.encode_aux_nearestmatch*, %struct.encode_aux_threshmatch*, %struct.encode_aux_pigeonhole*, i32 }
-
-define i32 @vorbis_staticbook_pack(%struct.static_codebook* %c, %struct.oggpack_buffer* %opb) {
-entry:
- %opb_addr = alloca %struct.oggpack_buffer* ; <%struct.oggpack_buffer**> [#uses=1]
- %tmp1 = load %struct.oggpack_buffer** %opb_addr, align 4 ; <%struct.oggpack_buffer*> [#uses=1]
- call void @oggpack_write( %struct.oggpack_buffer* %tmp1, i32 5653314, i32 24 ) nounwind
- call void @oggpack_write( %struct.oggpack_buffer* null, i32 0, i32 24 ) nounwind
- unreachable
-}
-
-declare void @oggpack_write(%struct.oggpack_buffer*, i32, i32)
diff --git a/release_23/test/CodeGen/ARM/2008-02-29-RegAllocLocal.ll b/release_23/test/CodeGen/ARM/2008-02-29-RegAllocLocal.ll
deleted file mode 100644
index b81d5759b6cf..000000000000
--- a/release_23/test/CodeGen/ARM/2008-02-29-RegAllocLocal.ll
+++ /dev/null
@@ -1,21 +0,0 @@
-; RUN: llvm-as < %s | llc -mtriple=arm-apple-darwin -regalloc=local
-; PR1925
-
- %"struct.kc::impl_Ccode_option" = type { %"struct.kc::impl_abstract_phylum" }
- %"struct.kc::impl_ID" = type { %"struct.kc::impl_abstract_phylum", %"struct.kc::impl_Ccode_option"*, %"struct.kc::impl_casestring__Str"*, i32, %"struct.kc::impl_casestring__Str"* }
- %"struct.kc::impl_abstract_phylum" = type { i32 (...)** }
- %"struct.kc::impl_casestring__Str" = type { %"struct.kc::impl_abstract_phylum", i8* }
-
-define %"struct.kc::impl_ID"* @_ZN2kc18f_typeofunpsubtermEPNS_15impl_unpsubtermEPNS_7impl_IDE(%"struct.kc::impl_Ccode_option"* %a_unpsubterm, %"struct.kc::impl_ID"* %a_operator) {
-entry:
- %tmp8 = getelementptr %"struct.kc::impl_Ccode_option"* %a_unpsubterm, i32 0, i32 0, i32 0 ; <i32 (...)***> [#uses=0]
- br i1 false, label %bb41, label %bb55
-
-bb41: ; preds = %entry
- ret %"struct.kc::impl_ID"* null
-
-bb55: ; preds = %entry
- %tmp67 = tail call i32 null( %"struct.kc::impl_abstract_phylum"* null ) ; <i32> [#uses=0]
- %tmp97 = tail call i32 null( %"struct.kc::impl_abstract_phylum"* null ) ; <i32> [#uses=0]
- ret %"struct.kc::impl_ID"* null
-}
diff --git a/release_23/test/CodeGen/ARM/2008-03-05-SxtInRegBug.ll b/release_23/test/CodeGen/ARM/2008-03-05-SxtInRegBug.ll
deleted file mode 100644
index ca34275f79f4..000000000000
--- a/release_23/test/CodeGen/ARM/2008-03-05-SxtInRegBug.ll
+++ /dev/null
@@ -1,14 +0,0 @@
-; RUN: llvm-as < %s | llc -march=arm -mattr=+v6 | not grep 255
-
-define i32 @main(i32 %argc, i8** %argv) {
-entry:
- br label %bb1
-bb1: ; preds = %entry
- %tmp3.i.i = load i8* null, align 1 ; <i8> [#uses=1]
- %tmp4.i.i = icmp slt i8 %tmp3.i.i, 0 ; <i1> [#uses=1]
- br i1 %tmp4.i.i, label %bb2, label %bb3
-bb2: ; preds = %bb1
- ret i32 1
-bb3: ; preds = %bb1
- ret i32 0
-}
diff --git a/release_23/test/CodeGen/ARM/2008-03-07-RegScavengerAssert.ll b/release_23/test/CodeGen/ARM/2008-03-07-RegScavengerAssert.ll
deleted file mode 100644
index 70f1774b4c52..000000000000
--- a/release_23/test/CodeGen/ARM/2008-03-07-RegScavengerAssert.ll
+++ /dev/null
@@ -1,20 +0,0 @@
-; RUN: llvm-as < %s | llc -mtriple=arm-apple-darwin -mattr=+v6,+vfp2
-
-@accum = external global { double, double } ; <{ double, double }*> [#uses=1]
-@.str = external constant [4 x i8] ; <[4 x i8]*> [#uses=1]
-
-define i32 @main() {
-entry:
- br label %bb74.i
-bb74.i: ; preds = %bb88.i, %bb74.i, %entry
- br i1 false, label %bb88.i, label %bb74.i
-bb88.i: ; preds = %bb74.i
- br i1 false, label %mandel.exit, label %bb74.i
-mandel.exit: ; preds = %bb88.i
- %tmp2 = volatile load double* getelementptr ({ double, double }* @accum, i32 0, i32 0), align 8 ; <double> [#uses=1]
- %tmp23 = fptosi double %tmp2 to i32 ; <i32> [#uses=1]
- %tmp5 = tail call i32 (i8*, ...)* @printf( i8* getelementptr ([4 x i8]* @.str, i32 0, i32 0), i32 %tmp23 ) ; <i32> [#uses=0]
- ret i32 0
-}
-
-declare i32 @printf(i8*, ...)
diff --git a/release_23/test/CodeGen/ARM/2008-04-04-ScavengerAssert.ll b/release_23/test/CodeGen/ARM/2008-04-04-ScavengerAssert.ll
deleted file mode 100644
index 610f5ea7cd05..000000000000
--- a/release_23/test/CodeGen/ARM/2008-04-04-ScavengerAssert.ll
+++ /dev/null
@@ -1,60 +0,0 @@
-; RUN: llvm-as < %s | llc -mtriple=arm-apple-darwin
-
-@numBinsY = external global i32 ; <i32*> [#uses=1]
-
-declare double @pow(double, double)
-
-define void @main(i32 %argc, i8** %argv) noreturn nounwind {
-entry:
- br i1 false, label %bb34.outer.i.i.i, label %cond_false674
-bb34.outer.i.i.i: ; preds = %entry
- br i1 false, label %bb2.i.i.i, label %bb47.i.i.i
-bb2.i.i.i: ; preds = %bb34.outer.i.i.i
- %tmp24.i.i.i = call double @pow( double 0.000000e+00, double 2.000000e+00 ) ; <double> [#uses=0]
- ret void
-bb47.i.i.i: ; preds = %bb34.outer.i.i.i
- br i1 false, label %bb220.i.i.i, label %bb62.preheader.i.i.i
-bb62.preheader.i.i.i: ; preds = %bb47.i.i.i
- ret void
-bb220.i.i.i: ; preds = %bb47.i.i.i
- br i1 false, label %bb248.i.i.i, label %cond_next232.i.i.i
-cond_next232.i.i.i: ; preds = %bb220.i.i.i
- ret void
-bb248.i.i.i: ; preds = %bb220.i.i.i
- br i1 false, label %bb300.i.i.i, label %cond_false256.i.i.i
-cond_false256.i.i.i: ; preds = %bb248.i.i.i
- ret void
-bb300.i.i.i: ; preds = %bb248.i.i.i
- store i32 undef, i32* @numBinsY, align 4
- ret void
-cond_false674: ; preds = %entry
- ret void
-}
-
- %struct.anon = type { %struct.rnode*, %struct.rnode* }
- %struct.ch_set = type { { i8, i8 }*, %struct.ch_set* }
- %struct.pat_list = type { i32, %struct.pat_list* }
- %struct.rnode = type { i16, { %struct.anon }, i16, %struct.pat_list*, %struct.pat_list* }
-
-define fastcc { i16, %struct.rnode* }* @get_token(i8** %s) nounwind {
-entry:
- br i1 false, label %bb42, label %bb78
-bb42: ; preds = %entry
- br label %cond_next119.i
-bb17.i: ; preds = %cond_next119.i
- br i1 false, label %cond_true53.i, label %cond_false99.i
-cond_true53.i: ; preds = %bb17.i
- ret { i16, %struct.rnode* }* null
-cond_false99.i: ; preds = %bb17.i
- %tmp106.i = malloc %struct.ch_set ; <%struct.ch_set*> [#uses=1]
- br i1 false, label %bb126.i, label %cond_next119.i
-cond_next119.i: ; preds = %cond_false99.i, %bb42
- %curr_ptr.0.reg2mem.0.i = phi %struct.ch_set* [ %tmp106.i, %cond_false99.i ], [ null, %bb42 ] ; <%struct.ch_set*> [#uses=2]
- %prev_ptr.0.reg2mem.0.i = phi %struct.ch_set* [ %curr_ptr.0.reg2mem.0.i, %cond_false99.i ], [ undef, %bb42 ] ; <%struct.ch_set*> [#uses=1]
- br i1 false, label %bb126.i, label %bb17.i
-bb126.i: ; preds = %cond_next119.i, %cond_false99.i
- %prev_ptr.0.reg2mem.1.i = phi %struct.ch_set* [ %prev_ptr.0.reg2mem.0.i, %cond_next119.i ], [ %curr_ptr.0.reg2mem.0.i, %cond_false99.i ] ; <%struct.ch_set*> [#uses=0]
- ret { i16, %struct.rnode* }* null
-bb78: ; preds = %entry
- ret { i16, %struct.rnode* }* null
-}
diff --git a/release_23/test/CodeGen/ARM/2008-04-10-ScavengerAssert.ll b/release_23/test/CodeGen/ARM/2008-04-10-ScavengerAssert.ll
deleted file mode 100644
index 80ccddfcd735..000000000000
--- a/release_23/test/CodeGen/ARM/2008-04-10-ScavengerAssert.ll
+++ /dev/null
@@ -1,258 +0,0 @@
-; RUN: llvm-as < %s | llc -mtriple=arm-apple-darwin
-
- %struct.CONTENTBOX = type { i32, i32, i32, i32, i32 }
- %struct.FILE = type { i8*, i32, i32, i16, i16, %struct.__sbuf, i32, i8*, i32 (i8*)*, i32 (i8*, i8*, i32)*, i64 (i8*, i64, i32)*, i32 (i8*, i8*, i32)*, %struct.__sbuf, %struct.__sFILEX*, i32, [3 x i8], [1 x i8], %struct.__sbuf, i32, i64 }
- %struct.LOCBOX = type { i32, i32, i32, i32 }
- %struct.SIDEBOX = type { i32, i32 }
- %struct.UNCOMBOX = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 }
- %struct.__sFILEX = type opaque
- %struct.__sbuf = type { i8*, i32 }
- %struct.cellbox = type { i8*, i32, i32, i32, [9 x i32], i32, i32, i32, i32, i32, i32, i32, double, double, double, double, double, i32, i32, %struct.CONTENTBOX*, %struct.UNCOMBOX*, [8 x %struct.tilebox*], %struct.SIDEBOX* }
- %struct.termbox = type { %struct.termbox*, i32, i32, i32, i32, i32 }
- %struct.tilebox = type { %struct.tilebox*, double, double, double, double, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, %struct.termbox*, %struct.LOCBOX* }
-@.str127 = external constant [2 x i8] ; <[2 x i8]*> [#uses=1]
-@.str584 = external constant [5 x i8] ; <[5 x i8]*> [#uses=1]
-@.str8115 = external constant [9 x i8] ; <[9 x i8]*> [#uses=1]
-
-declare %struct.FILE* @fopen(i8*, i8*)
-
-declare i32 @strcmp(i8*, i8*)
-
-declare i32 @fscanf(%struct.FILE*, i8*, ...)
-
-define void @main(i32 %argc, i8** %argv) noreturn {
-entry:
- br i1 false, label %cond_next48, label %cond_false674
-cond_next48: ; preds = %entry
- %tmp61 = call %struct.FILE* @fopen( i8* null, i8* getelementptr ([2 x i8]* @.str127, i32 0, i32 0) ) ; <%struct.FILE*> [#uses=2]
- br i1 false, label %bb220.i.i.i, label %bb62.preheader.i.i.i
-bb62.preheader.i.i.i: ; preds = %cond_next48
- ret void
-bb220.i.i.i: ; preds = %cond_next48
- br i1 false, label %bb248.i.i.i, label %cond_next232.i.i.i
-cond_next232.i.i.i: ; preds = %bb220.i.i.i
- ret void
-bb248.i.i.i: ; preds = %bb220.i.i.i
- br i1 false, label %bb300.i.i.i, label %cond_false256.i.i.i
-cond_false256.i.i.i: ; preds = %bb248.i.i.i
- ret void
-bb300.i.i.i: ; preds = %bb248.i.i.i
- br label %bb.i.i347.i
-bb.i.i347.i: ; preds = %bb.i.i347.i, %bb300.i.i.i
- br i1 false, label %bb894.loopexit.i.i, label %bb.i.i347.i
-bb.i350.i: ; preds = %bb894.i.i
- br i1 false, label %bb24.i.i, label %cond_false373.i.i
-bb24.i.i: ; preds = %bb24.i.i, %bb.i350.i
- br i1 false, label %bb40.i.i, label %bb24.i.i
-bb40.i.i: ; preds = %bb24.i.i
- br i1 false, label %bb177.i393.i, label %bb82.i.i
-bb82.i.i: ; preds = %bb40.i.i
- ret void
-bb177.i393.i: ; preds = %bb40.i.i
- br i1 false, label %bb894.i.i, label %bb192.i.i
-bb192.i.i: ; preds = %bb177.i393.i
- ret void
-cond_false373.i.i: ; preds = %bb.i350.i
- %tmp376.i.i = call i32 @strcmp( i8* null, i8* getelementptr ([9 x i8]* @.str8115, i32 0, i32 0) ) ; <i32> [#uses=0]
- br i1 false, label %cond_true380.i.i, label %cond_next602.i.i
-cond_true380.i.i: ; preds = %cond_false373.i.i
- %tmp394.i418.i = add i32 %cell.0.i.i, 1 ; <i32> [#uses=1]
- %tmp397.i420.i = load %struct.cellbox** null, align 4 ; <%struct.cellbox*> [#uses=1]
- br label %bb398.i.i
-bb398.i.i: ; preds = %bb398.i.i, %cond_true380.i.i
- br i1 false, label %bb414.i.i, label %bb398.i.i
-bb414.i.i: ; preds = %bb398.i.i
- br i1 false, label %bb581.i.i, label %bb455.i442.i
-bb455.i442.i: ; preds = %bb414.i.i
- ret void
-bb581.i.i: ; preds = %bb581.i.i, %bb414.i.i
- br i1 false, label %bb894.i.i, label %bb581.i.i
-cond_next602.i.i: ; preds = %cond_false373.i.i
- br i1 false, label %bb609.i.i, label %bb661.i.i
-bb609.i.i: ; preds = %cond_next602.i.i
- br label %bb620.i.i
-bb620.i.i: ; preds = %bb620.i.i, %bb609.i.i
- %indvar166.i465.i = phi i32 [ %indvar.next167.i.i, %bb620.i.i ], [ 0, %bb609.i.i ] ; <i32> [#uses=1]
- %tmp640.i.i = call i32 (%struct.FILE*, i8*, ...)* @fscanf( %struct.FILE* %tmp61, i8* getelementptr ([5 x i8]* @.str584, i32 0, i32 0), [1024 x i8]* null ) ; <i32> [#uses=0]
- %tmp648.i.i = load i32* null, align 4 ; <i32> [#uses=1]
- %tmp650.i468.i = icmp sgt i32 0, %tmp648.i.i ; <i1> [#uses=1]
- %tmp624.i469.i = call i32 (%struct.FILE*, i8*, ...)* @fscanf( %struct.FILE* %tmp61, i8* getelementptr ([5 x i8]* @.str584, i32 0, i32 0), [1024 x i8]* null ) ; <i32> [#uses=0]
- %indvar.next167.i.i = add i32 %indvar166.i465.i, 1 ; <i32> [#uses=1]
- br i1 %tmp650.i468.i, label %bb653.i.i.loopexit, label %bb620.i.i
-bb653.i.i.loopexit: ; preds = %bb620.i.i
- %tmp642.i466.i = add i32 0, 1 ; <i32> [#uses=1]
- br label %bb894.i.i
-bb661.i.i: ; preds = %cond_next602.i.i
- ret void
-bb894.loopexit.i.i: ; preds = %bb.i.i347.i
- br label %bb894.i.i
-bb894.i.i: ; preds = %bb894.loopexit.i.i, %bb653.i.i.loopexit, %bb581.i.i, %bb177.i393.i
- %pinctr.0.i.i = phi i32 [ 0, %bb894.loopexit.i.i ], [ %tmp642.i466.i, %bb653.i.i.loopexit ], [ %pinctr.0.i.i, %bb177.i393.i ], [ %pinctr.0.i.i, %bb581.i.i ] ; <i32> [#uses=2]
- %soft.0.i.i = phi i32 [ undef, %bb894.loopexit.i.i ], [ %soft.0.i.i, %bb653.i.i.loopexit ], [ 0, %bb177.i393.i ], [ 1, %bb581.i.i ] ; <i32> [#uses=1]
- %cell.0.i.i = phi i32 [ 0, %bb894.loopexit.i.i ], [ %cell.0.i.i, %bb653.i.i.loopexit ], [ 0, %bb177.i393.i ], [ %tmp394.i418.i, %bb581.i.i ] ; <i32> [#uses=2]
- %ptr.0.i.i = phi %struct.cellbox* [ undef, %bb894.loopexit.i.i ], [ %ptr.0.i.i, %bb653.i.i.loopexit ], [ null, %bb177.i393.i ], [ %tmp397.i420.i, %bb581.i.i ] ; <%struct.cellbox*> [#uses=1]
- br i1 false, label %bb.i350.i, label %bb902.i502.i
-bb902.i502.i: ; preds = %bb894.i.i
- ret void
-cond_false674: ; preds = %entry
- ret void
-}
-
- %struct.III_psy_xmin = type { [22 x double], [13 x [3 x double]] }
- %struct.III_scalefac_t = type { [22 x i32], [13 x [3 x i32]] }
- %struct.gr_info = type { i32, i32, i32, i32, i32, i32, i32, i32, [3 x i32], [3 x i32], i32, i32, i32, i32, i32, i32, i32, i32, i32, i32*, [4 x i32] }
- %struct.lame_global_flags = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i8*, i8*, i32, i32, float, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, float, i32, i32, i32, float, float, float, float, i32, i32, i32, i32, i32, i32, i32, i32 }
-@scalefac_band.1 = external global [14 x i32] ; <[14 x i32]*> [#uses=2]
-
-declare fastcc i32 @init_outer_loop(%struct.lame_global_flags*, double*, %struct.gr_info*)
-
-define fastcc void @outer_loop(%struct.lame_global_flags* %gfp, double* %xr, i32 %targ_bits, double* %best_noise, %struct.III_psy_xmin* %l3_xmin, i32* %l3_enc, %struct.III_scalefac_t* %scalefac, %struct.gr_info* %cod_info, i32 %ch) {
-entry:
- %cod_info.182 = getelementptr %struct.gr_info* %cod_info, i32 0, i32 1 ; <i32*> [#uses=1]
- br label %bb
-bb: ; preds = %bb226, %entry
- %save_cod_info.1.1 = phi i32 [ undef, %entry ], [ %save_cod_info.1.1, %bb226 ] ; <i32> [#uses=2]
- br i1 false, label %cond_next, label %cond_true
-cond_true: ; preds = %bb
- ret void
-cond_next: ; preds = %bb
- br i1 false, label %cond_next144, label %cond_false
-cond_false: ; preds = %cond_next
- ret void
-cond_next144: ; preds = %cond_next
- br i1 false, label %cond_next205, label %cond_true163
-cond_true163: ; preds = %cond_next144
- br i1 false, label %bb34.i, label %bb.i53
-bb.i53: ; preds = %cond_true163
- ret void
-bb34.i: ; preds = %cond_true163
- %tmp37.i55 = load i32* null, align 4 ; <i32> [#uses=1]
- br i1 false, label %bb65.preheader.i, label %bb78.i
-bb65.preheader.i: ; preds = %bb34.i
- br label %bb65.outer.us.i
-bb65.outer.us.i: ; preds = %bb65.outer.us.i, %bb65.preheader.i
- br i1 false, label %bb78.i, label %bb65.outer.us.i
-bb78.i: ; preds = %bb65.outer.us.i, %bb34.i
- br i1 false, label %bb151.i.preheader, label %bb90.i
-bb90.i: ; preds = %bb78.i
- ret void
-bb151.i.preheader: ; preds = %bb78.i
- br label %bb151.i
-bb151.i: ; preds = %bb226.backedge.i, %bb151.i.preheader
- %i.154.i = phi i32 [ %tmp15747.i, %bb226.backedge.i ], [ 0, %bb151.i.preheader ] ; <i32> [#uses=2]
- %tmp15747.i = add i32 %i.154.i, 1 ; <i32> [#uses=3]
- br i1 false, label %bb155.i, label %bb226.backedge.i
-bb226.backedge.i: ; preds = %cond_next215.i, %bb151.i
- %tmp228.i71 = icmp slt i32 %tmp15747.i, 3 ; <i1> [#uses=1]
- br i1 %tmp228.i71, label %bb151.i, label %amp_scalefac_bands.exit
-bb155.i: ; preds = %cond_next215.i, %bb151.i
- %indvar90.i = phi i32 [ %indvar.next91.i, %cond_next215.i ], [ 0, %bb151.i ] ; <i32> [#uses=2]
- %sfb.3.reg2mem.0.i = add i32 %indvar90.i, %tmp37.i55 ; <i32> [#uses=4]
- %tmp161.i = getelementptr [4 x [21 x double]]* null, i32 0, i32 %tmp15747.i, i32 %sfb.3.reg2mem.0.i ; <double*> [#uses=1]
- %tmp162.i74 = load double* %tmp161.i, align 4 ; <double> [#uses=0]
- br i1 false, label %cond_true167.i, label %cond_next215.i
-cond_true167.i: ; preds = %bb155.i
- %tmp173.i = getelementptr %struct.III_scalefac_t* null, i32 0, i32 1, i32 %sfb.3.reg2mem.0.i, i32 %i.154.i ; <i32*> [#uses=1]
- store i32 0, i32* %tmp173.i, align 4
- %tmp182.1.i = getelementptr [14 x i32]* @scalefac_band.1, i32 0, i32 %sfb.3.reg2mem.0.i ; <i32*> [#uses=0]
- %tmp185.i78 = add i32 %sfb.3.reg2mem.0.i, 1 ; <i32> [#uses=1]
- %tmp187.1.i = getelementptr [14 x i32]* @scalefac_band.1, i32 0, i32 %tmp185.i78 ; <i32*> [#uses=1]
- %tmp188.i = load i32* %tmp187.1.i, align 4 ; <i32> [#uses=1]
- %tmp21153.i = icmp slt i32 0, %tmp188.i ; <i1> [#uses=1]
- br i1 %tmp21153.i, label %bb190.preheader.i, label %cond_next215.i
-bb190.preheader.i: ; preds = %cond_true167.i
- ret void
-cond_next215.i: ; preds = %cond_true167.i, %bb155.i
- %indvar.next91.i = add i32 %indvar90.i, 1 ; <i32> [#uses=2]
- %exitcond99.i87 = icmp eq i32 %indvar.next91.i, 0 ; <i1> [#uses=1]
- br i1 %exitcond99.i87, label %bb226.backedge.i, label %bb155.i
-amp_scalefac_bands.exit: ; preds = %bb226.backedge.i
- br i1 false, label %bb19.i, label %bb.i16
-bb.i16: ; preds = %amp_scalefac_bands.exit
- ret void
-bb19.i: ; preds = %amp_scalefac_bands.exit
- br i1 false, label %bb40.outer.i, label %cond_next205
-bb40.outer.i: ; preds = %bb19.i
- ret void
-cond_next205: ; preds = %bb19.i, %cond_next144
- br i1 false, label %bb226, label %cond_true210
-cond_true210: ; preds = %cond_next205
- br i1 false, label %bb226, label %cond_true217
-cond_true217: ; preds = %cond_true210
- %tmp221 = call fastcc i32 @init_outer_loop( %struct.lame_global_flags* %gfp, double* %xr, %struct.gr_info* %cod_info ) ; <i32> [#uses=0]
- ret void
-bb226: ; preds = %cond_true210, %cond_next205
- br i1 false, label %bb231, label %bb
-bb231: ; preds = %bb226
- store i32 %save_cod_info.1.1, i32* %cod_info.182
- ret void
-}
-
- %struct.III_psy_xmin = type { [22 x double], [13 x [3 x double]] }
- %struct.III_scalefac_t = type { [22 x i32], [13 x [3 x i32]] }
- %struct.gr_info = type { i32, i32, i32, i32, i32, i32, i32, i32, [3 x i32], [3 x i32], i32, i32, i32, i32, i32, i32, i32, i32, i32, i32*, [4 x i32] }
- %struct.lame_global_flags = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i8*, i8*, i32, i32, float, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, float, i32, i32, i32, float, float, float, float, i32, i32, i32, i32, i32, i32, i32, i32 }
-
-define fastcc void @outer_loop2(%struct.lame_global_flags* %gfp, double* %xr, i32 %targ_bits, double* %best_noise, %struct.III_psy_xmin* %l3_xmin, i32* %l3_enc, %struct.III_scalefac_t* %scalefac, %struct.gr_info* %cod_info, i32 %ch) {
-entry:
- %cod_info.20128.1 = getelementptr %struct.gr_info* %cod_info, i32 0, i32 20, i32 1 ; <i32*> [#uses=1]
- %cod_info.20128.2 = getelementptr %struct.gr_info* %cod_info, i32 0, i32 20, i32 2 ; <i32*> [#uses=1]
- %cod_info.20128.3 = getelementptr %struct.gr_info* %cod_info, i32 0, i32 20, i32 3 ; <i32*> [#uses=1]
- br label %bb
-bb: ; preds = %bb226, %entry
- %save_cod_info.19.1 = phi i32* [ undef, %entry ], [ %save_cod_info.19.0, %bb226 ] ; <i32*> [#uses=1]
- %save_cod_info.0.1 = phi i32 [ undef, %entry ], [ %save_cod_info.0.0, %bb226 ] ; <i32> [#uses=1]
- br i1 false, label %cond_next144, label %cond_false
-cond_false: ; preds = %bb
- br i1 false, label %cond_true56, label %cond_false78
-cond_true56: ; preds = %cond_false
- br i1 false, label %inner_loop.exit, label %cond_next85
-inner_loop.exit: ; preds = %cond_true56
- br i1 false, label %cond_next104, label %cond_false96
-cond_false78: ; preds = %cond_false
- ret void
-cond_next85: ; preds = %cond_true56
- ret void
-cond_false96: ; preds = %inner_loop.exit
- ret void
-cond_next104: ; preds = %inner_loop.exit
- br i1 false, label %cond_next144, label %cond_false110
-cond_false110: ; preds = %cond_next104
- ret void
-cond_next144: ; preds = %cond_next104, %bb
- %save_cod_info.19.0 = phi i32* [ %save_cod_info.19.1, %bb ], [ null, %cond_next104 ] ; <i32*> [#uses=1]
- %save_cod_info.4.0 = phi i32 [ 0, %bb ], [ 0, %cond_next104 ] ; <i32> [#uses=1]
- %save_cod_info.3.0 = phi i32 [ 0, %bb ], [ 0, %cond_next104 ] ; <i32> [#uses=1]
- %save_cod_info.2.0 = phi i32 [ 0, %bb ], [ 0, %cond_next104 ] ; <i32> [#uses=1]
- %save_cod_info.1.0 = phi i32 [ 0, %bb ], [ 0, %cond_next104 ] ; <i32> [#uses=1]
- %save_cod_info.0.0 = phi i32 [ %save_cod_info.0.1, %bb ], [ 0, %cond_next104 ] ; <i32> [#uses=1]
- %over.1 = phi i32 [ 0, %bb ], [ 0, %cond_next104 ] ; <i32> [#uses=1]
- %best_over.0 = phi i32 [ 0, %bb ], [ 0, %cond_next104 ] ; <i32> [#uses=1]
- %notdone.0 = phi i32 [ 0, %bb ], [ 0, %cond_next104 ] ; <i32> [#uses=1]
- %tmp147 = load i32* null, align 4 ; <i32> [#uses=1]
- %tmp148 = icmp eq i32 %tmp147, 0 ; <i1> [#uses=1]
- %tmp153 = icmp eq i32 %over.1, 0 ; <i1> [#uses=1]
- %bothcond = and i1 %tmp148, %tmp153 ; <i1> [#uses=1]
- %notdone.2 = select i1 %bothcond, i32 0, i32 %notdone.0 ; <i32> [#uses=1]
- br i1 false, label %cond_next205, label %cond_true163
-cond_true163: ; preds = %cond_next144
- ret void
-cond_next205: ; preds = %cond_next144
- br i1 false, label %bb226, label %cond_true210
-cond_true210: ; preds = %cond_next205
- ret void
-bb226: ; preds = %cond_next205
- %tmp228 = icmp eq i32 %notdone.2, 0 ; <i1> [#uses=1]
- br i1 %tmp228, label %bb231, label %bb
-bb231: ; preds = %bb226
- store i32 %save_cod_info.1.0, i32* null
- store i32 %save_cod_info.2.0, i32* null
- store i32 %save_cod_info.3.0, i32* null
- store i32 %save_cod_info.4.0, i32* null
- store i32 0, i32* %cod_info.20128.1
- store i32 0, i32* %cod_info.20128.2
- store i32 0, i32* %cod_info.20128.3
- %tmp244245 = sitofp i32 %best_over.0 to double ; <double> [#uses=1]
- store double %tmp244245, double* %best_noise, align 4
- ret void
-}
diff --git a/release_23/test/CodeGen/ARM/2008-04-11-PHIofImpDef.ll b/release_23/test/CodeGen/ARM/2008-04-11-PHIofImpDef.ll
deleted file mode 100644
index 3cd757fa62ad..000000000000
--- a/release_23/test/CodeGen/ARM/2008-04-11-PHIofImpDef.ll
+++ /dev/null
@@ -1,3544 +0,0 @@
-; RUN: llvm-as < %s | llc -mtriple=arm-apple-darwin
-
-declare void @foo(i8*, i8*, i32, i32, i32, i32, i32, i32, i32)
-
-define void @t() nounwind {
- br label %1
-; <label>:1 ; preds = %0
- br label %bb4351.i
-bb4351.i: ; preds = %1
- switch i32 0, label %bb4411.i [
- i32 1, label %bb4354.i
- i32 2, label %bb4369.i
- ]
-bb4354.i: ; preds = %bb4351.i
- br label %t.exit
-bb4369.i: ; preds = %bb4351.i
- br label %bb4374.i
-bb4374.i: ; preds = %bb4369.i
- br label %bb4411.i
-bb4411.i: ; preds = %bb4374.i, %bb4351.i
- %sf4083.0.i = phi i32 [ 0, %bb4374.i ], [ 6, %bb4351.i ] ; <i32> [#uses=8]
- br label %bb4498.i
-bb4498.i: ; preds = %bb4411.i
- %sfComp4077.1.i = phi i32 [ undef, %bb4411.i ] ; <i32> [#uses=2]
- %stComp4075.1.i = phi i32 [ undef, %bb4411.i ] ; <i32> [#uses=1]
- switch i32 0, label %bb4553.i [
- i32 1, label %bb4501.i
- i32 2, label %bb4521.i
- ]
-bb4501.i: ; preds = %bb4498.i
- %sfComp4077.1.reg2mem.0.i = phi i32 [ %sfComp4077.1.i, %bb4498.i ] ; <i32> [#uses=1]
- call void @foo( i8* null, i8* null, i32 %sfComp4077.1.reg2mem.0.i, i32 0, i32 8, i32 0, i32 0, i32 0, i32 0 ) nounwind
- br i1 false, label %UnifiedReturnBlock.i, label %bb4517.i
-bb4517.i: ; preds = %bb4501.i
- br label %t.exit
-bb4521.i: ; preds = %bb4498.i
- br label %bb4526.i
-bb4526.i: ; preds = %bb4521.i
- switch i32 0, label %bb4529.i [
- i32 6, label %bb4530.i
- i32 7, label %bb4530.i
- ]
-bb4529.i: ; preds = %bb4526.i
- br label %bb4530.i
-bb4530.i: ; preds = %bb4529.i, %bb4526.i, %bb4526.i
- br label %bb4553.i
-bb4553.i: ; preds = %bb4530.i, %bb4498.i
- %dt4080.0.i = phi i32 [ %stComp4075.1.i, %bb4530.i ], [ 7, %bb4498.i ] ; <i32> [#uses=32]
- %df4081.0.i = phi i32 [ %sfComp4077.1.i, %bb4530.i ], [ 8, %bb4498.i ] ; <i32> [#uses=17]
- switch i32 %sf4083.0.i, label %bb4559.i [
- i32 0, label %bb4558.i
- i32 1, label %bb4558.i
- i32 2, label %bb4558.i
- i32 5, label %bb4561.i
- i32 6, label %bb4561.i
- i32 7, label %bb4561.i
- i32 9, label %bb4557.i
- ]
-bb4557.i: ; preds = %bb4553.i
- switch i32 %df4081.0.i, label %bb4569.i [
- i32 0, label %bb4568.i
- i32 1, label %bb4568.i
- i32 2, label %bb4568.i
- i32 5, label %bb4571.i
- i32 6, label %bb4571.i
- i32 7, label %bb4571.i
- i32 9, label %bb4567.i
- ]
-bb4558.i: ; preds = %bb4553.i, %bb4553.i, %bb4553.i
- switch i32 %df4081.0.i, label %bb4569.i [
- i32 0, label %bb4568.i
- i32 1, label %bb4568.i
- i32 2, label %bb4568.i
- i32 5, label %bb4571.i
- i32 6, label %bb4571.i
- i32 7, label %bb4571.i
- i32 9, label %bb4567.i
- ]
-bb4559.i: ; preds = %bb4553.i
- br label %bb4561.i
-bb4561.i: ; preds = %bb4559.i, %bb4553.i, %bb4553.i, %bb4553.i
- switch i32 %df4081.0.i, label %bb4569.i [
- i32 0, label %bb4568.i
- i32 1, label %bb4568.i
- i32 2, label %bb4568.i
- i32 5, label %bb4571.i
- i32 6, label %bb4571.i
- i32 7, label %bb4571.i
- i32 9, label %bb4567.i
- ]
-bb4567.i: ; preds = %bb4561.i, %bb4558.i, %bb4557.i
- br label %bb4580.i
-bb4568.i: ; preds = %bb4561.i, %bb4561.i, %bb4561.i, %bb4558.i, %bb4558.i, %bb4558.i, %bb4557.i, %bb4557.i, %bb4557.i
- br label %bb4580.i
-bb4569.i: ; preds = %bb4561.i, %bb4558.i, %bb4557.i
- br label %bb4571.i
-bb4571.i: ; preds = %bb4569.i, %bb4561.i, %bb4561.i, %bb4561.i, %bb4558.i, %bb4558.i, %bb4558.i, %bb4557.i, %bb4557.i, %bb4557.i
- br label %bb4580.i
-bb4580.i: ; preds = %bb4571.i, %bb4568.i, %bb4567.i
- br i1 false, label %bb4611.i, label %bb4593.i
-bb4593.i: ; preds = %bb4580.i
- br i1 false, label %bb4610.i, label %bb4611.i
-bb4610.i: ; preds = %bb4593.i
- br label %bb4611.i
-bb4611.i: ; preds = %bb4610.i, %bb4593.i, %bb4580.i
- br i1 false, label %bb4776.i, label %bb4620.i
-bb4620.i: ; preds = %bb4611.i
- switch i32 0, label %bb4776.i [
- i32 0, label %bb4691.i
- i32 2, label %bb4740.i
- i32 4, label %bb4755.i
- i32 8, label %bb4622.i
- i32 9, label %bb4622.i
- i32 10, label %bb4629.i
- i32 11, label %bb4629.i
- i32 12, label %bb4651.i
- i32 13, label %bb4651.i
- i32 14, label %bb4665.i
- i32 15, label %bb4665.i
- i32 16, label %bb4691.i
- i32 17, label %bb4691.i
- i32 18, label %bb4712.i
- i32 19, label %bb4712.i
- i32 22, label %bb4733.i
- i32 23, label %bb4733.i
- ]
-bb4622.i: ; preds = %bb4620.i, %bb4620.i
- br i1 false, label %bb4628.i, label %bb4776.i
-bb4628.i: ; preds = %bb4622.i
- br label %bb4776.i
-bb4629.i: ; preds = %bb4620.i, %bb4620.i
- br i1 false, label %bb4776.i, label %bb4644.i
-bb4644.i: ; preds = %bb4629.i
- br i1 false, label %bb4650.i, label %bb4776.i
-bb4650.i: ; preds = %bb4644.i
- br label %bb4776.i
-bb4651.i: ; preds = %bb4620.i, %bb4620.i
- br i1 false, label %bb4776.i, label %bb4658.i
-bb4658.i: ; preds = %bb4651.i
- br i1 false, label %bb4664.i, label %bb4776.i
-bb4664.i: ; preds = %bb4658.i
- br label %bb4776.i
-bb4665.i: ; preds = %bb4620.i, %bb4620.i
- br i1 false, label %bb4776.i, label %bb4684.i
-bb4684.i: ; preds = %bb4665.i
- br i1 false, label %bb4690.i, label %bb4776.i
-bb4690.i: ; preds = %bb4684.i
- br label %bb4776.i
-bb4691.i: ; preds = %bb4620.i, %bb4620.i, %bb4620.i
- br i1 false, label %bb4776.i, label %bb4698.i
-bb4698.i: ; preds = %bb4691.i
- br i1 false, label %bb4711.i, label %bb4776.i
-bb4711.i: ; preds = %bb4698.i
- br label %bb4776.i
-bb4712.i: ; preds = %bb4620.i, %bb4620.i
- br i1 false, label %bb4776.i, label %bb4726.i
-bb4726.i: ; preds = %bb4712.i
- br i1 false, label %bb4732.i, label %bb4776.i
-bb4732.i: ; preds = %bb4726.i
- br label %bb4776.i
-bb4733.i: ; preds = %bb4620.i, %bb4620.i
- br i1 false, label %bb4739.i, label %bb4776.i
-bb4739.i: ; preds = %bb4733.i
- br label %bb4776.i
-bb4740.i: ; preds = %bb4620.i
- br i1 false, label %bb4776.i, label %bb4754.i
-bb4754.i: ; preds = %bb4740.i
- br label %bb4776.i
-bb4755.i: ; preds = %bb4620.i
- br i1 false, label %bb4776.i, label %bb4774.i
-bb4774.i: ; preds = %bb4755.i
- br label %bb4776.i
-bb4776.i: ; preds = %bb4774.i, %bb4755.i, %bb4754.i, %bb4740.i, %bb4739.i, %bb4733.i, %bb4732.i, %bb4726.i, %bb4712.i, %bb4711.i, %bb4698.i, %bb4691.i, %bb4690.i, %bb4684.i, %bb4665.i, %bb4664.i, %bb4658.i, %bb4651.i, %bb4650.i, %bb4644.i, %bb4629.i, %bb4628.i, %bb4622.i, %bb4620.i, %bb4611.i
- switch i32 0, label %bb4790.i [
- i32 0, label %bb4786.i
- i32 1, label %bb4784.i
- i32 3, label %bb4784.i
- i32 5, label %bb4784.i
- i32 6, label %bb4785.i
- i32 7, label %bb4785.i
- i32 8, label %bb4791.i
- i32 9, label %bb4791.i
- i32 10, label %bb4791.i
- i32 11, label %bb4791.i
- i32 12, label %bb4791.i
- i32 13, label %bb4791.i
- i32 14, label %bb4791.i
- i32 15, label %bb4791.i
- i32 16, label %bb4791.i
- i32 17, label %bb4791.i
- i32 18, label %bb4791.i
- i32 19, label %bb4791.i
- ]
-bb4784.i: ; preds = %bb4776.i, %bb4776.i, %bb4776.i
- br label %bb4791.i
-bb4785.i: ; preds = %bb4776.i, %bb4776.i
- br label %bb4791.i
-bb4786.i: ; preds = %bb4776.i
- br label %bb4791.i
-bb4790.i: ; preds = %bb4776.i
- br label %bb4791.i
-bb4791.i: ; preds = %bb4790.i, %bb4786.i, %bb4785.i, %bb4784.i, %bb4776.i, %bb4776.i, %bb4776.i, %bb4776.i, %bb4776.i, %bb4776.i, %bb4776.i, %bb4776.i, %bb4776.i, %bb4776.i, %bb4776.i, %bb4776.i
- switch i32 %dt4080.0.i, label %bb4803.i [
- i32 0, label %bb4799.i
- i32 6, label %bb4794.i
- i32 7, label %bb4794.i
- i32 8, label %bb4804.i
- i32 9, label %bb4804.i
- i32 10, label %bb4804.i
- i32 11, label %bb4804.i
- i32 12, label %bb4804.i
- i32 13, label %bb4804.i
- i32 14, label %bb4804.i
- i32 15, label %bb4804.i
- i32 16, label %bb4804.i
- i32 17, label %bb4804.i
- i32 18, label %bb4804.i
- i32 19, label %bb4804.i
- ]
-bb4794.i: ; preds = %bb4791.i, %bb4791.i
- br i1 false, label %bb4809.i, label %bb4819.i
-bb4799.i: ; preds = %bb4791.i
- br i1 false, label %bb4809.i, label %bb4819.i
-bb4803.i: ; preds = %bb4791.i
- br label %bb4804.i
-bb4804.i: ; preds = %bb4803.i, %bb4791.i, %bb4791.i, %bb4791.i, %bb4791.i, %bb4791.i, %bb4791.i, %bb4791.i, %bb4791.i, %bb4791.i, %bb4791.i, %bb4791.i, %bb4791.i
- br i1 false, label %bb4809.i, label %bb4819.i
-bb4809.i: ; preds = %bb4804.i, %bb4799.i, %bb4794.i
- switch i32 %df4081.0.i, label %bb71.i.i [
- i32 3, label %bb61.i.i
- i32 4, label %bb.i.i
- i32 5, label %bb.i.i
- i32 6, label %bb.i.i
- i32 7, label %bb.i.i
- i32 8, label %bb38.i.i
- i32 9, label %bb38.i.i
- i32 10, label %bb50.i.i
- i32 11, label %bb40.i.i
- i32 16, label %bb38.i.i
- ]
-bb.i.i: ; preds = %bb4809.i, %bb4809.i, %bb4809.i, %bb4809.i
- br label %bb403.i.i
-bb38.i.i: ; preds = %bb4809.i, %bb4809.i, %bb4809.i
- br label %bb403.i.i
-bb40.i.i: ; preds = %bb4809.i
- br label %bb403.i.i
-bb50.i.i: ; preds = %bb4809.i
- br label %bb403.i.i
-bb61.i.i: ; preds = %bb4809.i
- br label %bb403.i.i
-bb71.i.i: ; preds = %bb4809.i
- br label %bb403.i.i
-bb403.i.i: ; preds = %bb71.i.i, %bb61.i.i, %bb50.i.i, %bb40.i.i, %bb38.i.i, %bb.i.i
- br i1 false, label %bb408.i.i, label %bb502.i.i
-bb408.i.i: ; preds = %bb403.i.i
- br label %bb708.i.i
-bb502.i.i: ; preds = %bb403.i.i
- br label %bb708.i.i
-bb708.i.i: ; preds = %bb502.i.i, %bb408.i.i
- switch i32 0, label %bb758.i.i [
- i32 0, label %bb710.i.i
- i32 1, label %bb713.i.i
- i32 2, label %bb718.i.i
- i32 3, label %bb721.i.i
- i32 4, label %bb726.i.i
- i32 5, label %bb729.i.i
- i32 8, label %bb732.i.i
- i32 9, label %bb732.i.i
- i32 10, label %bb737.i.i
- i32 11, label %bb737.i.i
- i32 12, label %bb742.i.i
- i32 13, label %bb742.i.i
- i32 14, label %bb745.i.i
- i32 15, label %bb745.i.i
- i32 16, label %bb750.i.i
- i32 17, label %bb750.i.i
- i32 18, label %bb753.i.i
- i32 19, label %bb753.i.i
- i32 22, label %bb750.i.i
- i32 23, label %bb750.i.i
- ]
-bb710.i.i: ; preds = %bb708.i.i
- br label %bb758.i.i
-bb713.i.i: ; preds = %bb708.i.i
- br label %bb758.i.i
-bb718.i.i: ; preds = %bb708.i.i
- br label %bb758.i.i
-bb721.i.i: ; preds = %bb708.i.i
- br label %bb758.i.i
-bb726.i.i: ; preds = %bb708.i.i
- br label %bb758.i.i
-bb729.i.i: ; preds = %bb708.i.i
- br label %bb758.i.i
-bb732.i.i: ; preds = %bb708.i.i, %bb708.i.i
- br label %bb758.i.i
-bb737.i.i: ; preds = %bb708.i.i, %bb708.i.i
- br label %bb758.i.i
-bb742.i.i: ; preds = %bb708.i.i, %bb708.i.i
- br label %bb758.i.i
-bb745.i.i: ; preds = %bb708.i.i, %bb708.i.i
- br label %bb758.i.i
-bb750.i.i: ; preds = %bb708.i.i, %bb708.i.i, %bb708.i.i, %bb708.i.i
- br label %bb758.i.i
-bb753.i.i: ; preds = %bb708.i.i, %bb708.i.i
- br label %bb758.i.i
-bb758.i.i: ; preds = %bb753.i.i, %bb750.i.i, %bb745.i.i, %bb742.i.i, %bb737.i.i, %bb732.i.i, %bb729.i.i, %bb726.i.i, %bb721.i.i, %bb718.i.i, %bb713.i.i, %bb710.i.i, %bb708.i.i
- switch i32 %dt4080.0.i, label %bb808.i.i [
- i32 0, label %bb760.i.i
- i32 1, label %bb763.i.i
- i32 2, label %bb768.i.i
- i32 3, label %bb771.i.i
- i32 4, label %bb776.i.i
- i32 5, label %bb779.i.i
- i32 8, label %bb782.i.i
- i32 9, label %bb782.i.i
- i32 10, label %bb787.i.i
- i32 11, label %bb787.i.i
- i32 12, label %bb792.i.i
- i32 13, label %bb792.i.i
- i32 14, label %bb795.i.i
- i32 15, label %bb795.i.i
- i32 16, label %bb800.i.i
- i32 17, label %bb800.i.i
- i32 18, label %bb803.i.i
- i32 19, label %bb803.i.i
- i32 22, label %bb800.i.i
- i32 23, label %bb800.i.i
- ]
-bb760.i.i: ; preds = %bb758.i.i
- br label %bb811.i.i
-bb763.i.i: ; preds = %bb758.i.i
- br label %bb811.i.i
-bb768.i.i: ; preds = %bb758.i.i
- br label %bb811.i.i
-bb771.i.i: ; preds = %bb758.i.i
- br label %bb811.i.i
-bb776.i.i: ; preds = %bb758.i.i
- br label %bb811.i.i
-bb779.i.i: ; preds = %bb758.i.i
- br label %bb811.i.i
-bb782.i.i: ; preds = %bb758.i.i, %bb758.i.i
- br label %bb811.i.i
-bb787.i.i: ; preds = %bb758.i.i, %bb758.i.i
- br label %bb811.i.i
-bb792.i.i: ; preds = %bb758.i.i, %bb758.i.i
- br label %bb811.i.i
-bb795.i.i: ; preds = %bb758.i.i, %bb758.i.i
- br label %bb811.i.i
-bb800.i.i: ; preds = %bb758.i.i, %bb758.i.i, %bb758.i.i, %bb758.i.i
- br label %bb811.i.i
-bb803.i.i: ; preds = %bb758.i.i, %bb758.i.i
- br label %bb808.i.i
-bb808.i.i: ; preds = %bb803.i.i, %bb758.i.i
- br label %bb811.i.i
-bb811.i.i: ; preds = %bb808.i.i, %bb800.i.i, %bb795.i.i, %bb792.i.i, %bb787.i.i, %bb782.i.i, %bb779.i.i, %bb776.i.i, %bb771.i.i, %bb768.i.i, %bb763.i.i, %bb760.i.i
- switch i32 0, label %bb928.i.i [
- i32 0, label %bb813.i.i
- i32 1, label %bb833.i.i
- i32 2, label %bb813.i.i
- i32 3, label %bb833.i.i
- i32 4, label %bb813.i.i
- i32 5, label %bb813.i.i
- i32 8, label %bb872.i.i
- i32 9, label %bb872.i.i
- i32 10, label %bb890.i.i
- i32 11, label %bb890.i.i
- i32 12, label %bb813.i.i
- i32 13, label %bb813.i.i
- i32 14, label %bb908.i.i
- i32 15, label %bb908.i.i
- i32 16, label %bb813.i.i
- i32 17, label %bb813.i.i
- i32 18, label %bb908.i.i
- i32 19, label %bb908.i.i
- i32 22, label %bb813.i.i
- i32 23, label %bb813.i.i
- ]
-bb813.i.i: ; preds = %bb811.i.i, %bb811.i.i, %bb811.i.i, %bb811.i.i, %bb811.i.i, %bb811.i.i, %bb811.i.i, %bb811.i.i, %bb811.i.i, %bb811.i.i
- switch i32 %dt4080.0.i, label %bb1065.i.i [
- i32 0, label %bb930.i.i
- i32 1, label %bb950.i.i
- i32 2, label %bb930.i.i
- i32 3, label %bb950.i.i
- i32 4, label %bb989.i.i
- i32 5, label %bb989.i.i
- i32 8, label %bb1009.i.i
- i32 9, label %bb1009.i.i
- i32 10, label %bb1027.i.i
- i32 11, label %bb1027.i.i
- i32 12, label %bb930.i.i
- i32 13, label %bb930.i.i
- i32 14, label %bb1045.i.i
- i32 15, label %bb1045.i.i
- i32 16, label %bb930.i.i
- i32 17, label %bb930.i.i
- i32 18, label %bb1045.i.i
- i32 19, label %bb1045.i.i
- i32 22, label %bb930.i.i
- i32 23, label %bb930.i.i
- ]
-bb833.i.i: ; preds = %bb811.i.i, %bb811.i.i
- switch i32 %dt4080.0.i, label %bb1065.i.i [
- i32 0, label %bb930.i.i
- i32 1, label %bb950.i.i
- i32 2, label %bb930.i.i
- i32 3, label %bb950.i.i
- i32 4, label %bb989.i.i
- i32 5, label %bb989.i.i
- i32 8, label %bb1009.i.i
- i32 9, label %bb1009.i.i
- i32 10, label %bb1027.i.i
- i32 11, label %bb1027.i.i
- i32 12, label %bb930.i.i
- i32 13, label %bb930.i.i
- i32 14, label %bb1045.i.i
- i32 15, label %bb1045.i.i
- i32 16, label %bb930.i.i
- i32 17, label %bb930.i.i
- i32 18, label %bb1045.i.i
- i32 19, label %bb1045.i.i
- i32 22, label %bb930.i.i
- i32 23, label %bb930.i.i
- ]
-bb872.i.i: ; preds = %bb811.i.i, %bb811.i.i
- switch i32 %dt4080.0.i, label %bb1065.i.i [
- i32 0, label %bb930.i.i
- i32 1, label %bb950.i.i
- i32 2, label %bb930.i.i
- i32 3, label %bb950.i.i
- i32 4, label %bb989.i.i
- i32 5, label %bb989.i.i
- i32 8, label %bb1009.i.i
- i32 9, label %bb1009.i.i
- i32 10, label %bb1027.i.i
- i32 11, label %bb1027.i.i
- i32 12, label %bb930.i.i
- i32 13, label %bb930.i.i
- i32 14, label %bb1045.i.i
- i32 15, label %bb1045.i.i
- i32 16, label %bb930.i.i
- i32 17, label %bb930.i.i
- i32 18, label %bb1045.i.i
- i32 19, label %bb1045.i.i
- i32 22, label %bb930.i.i
- i32 23, label %bb930.i.i
- ]
-bb890.i.i: ; preds = %bb811.i.i, %bb811.i.i
- switch i32 %dt4080.0.i, label %bb1065.i.i [
- i32 0, label %bb930.i.i
- i32 1, label %bb950.i.i
- i32 2, label %bb930.i.i
- i32 3, label %bb950.i.i
- i32 4, label %bb989.i.i
- i32 5, label %bb989.i.i
- i32 8, label %bb1009.i.i
- i32 9, label %bb1009.i.i
- i32 10, label %bb1027.i.i
- i32 11, label %bb1027.i.i
- i32 12, label %bb930.i.i
- i32 13, label %bb930.i.i
- i32 14, label %bb1045.i.i
- i32 15, label %bb1045.i.i
- i32 16, label %bb930.i.i
- i32 17, label %bb930.i.i
- i32 18, label %bb1045.i.i
- i32 19, label %bb1045.i.i
- i32 22, label %bb930.i.i
- i32 23, label %bb930.i.i
- ]
-bb908.i.i: ; preds = %bb811.i.i, %bb811.i.i, %bb811.i.i, %bb811.i.i
- br label %bb928.i.i
-bb928.i.i: ; preds = %bb908.i.i, %bb811.i.i
- switch i32 %dt4080.0.i, label %bb1065.i.i [
- i32 0, label %bb930.i.i
- i32 1, label %bb950.i.i
- i32 2, label %bb930.i.i
- i32 3, label %bb950.i.i
- i32 4, label %bb989.i.i
- i32 5, label %bb989.i.i
- i32 8, label %bb1009.i.i
- i32 9, label %bb1009.i.i
- i32 10, label %bb1027.i.i
- i32 11, label %bb1027.i.i
- i32 12, label %bb930.i.i
- i32 13, label %bb930.i.i
- i32 14, label %bb1045.i.i
- i32 15, label %bb1045.i.i
- i32 16, label %bb930.i.i
- i32 17, label %bb930.i.i
- i32 18, label %bb1045.i.i
- i32 19, label %bb1045.i.i
- i32 22, label %bb930.i.i
- i32 23, label %bb930.i.i
- ]
-bb930.i.i: ; preds = %bb928.i.i, %bb928.i.i, %bb928.i.i, %bb928.i.i, %bb928.i.i, %bb928.i.i, %bb928.i.i, %bb928.i.i, %bb890.i.i, %bb890.i.i, %bb890.i.i, %bb890.i.i, %bb890.i.i, %bb890.i.i, %bb890.i.i, %bb890.i.i, %bb872.i.i, %bb872.i.i, %bb872.i.i, %bb872.i.i, %bb872.i.i, %bb872.i.i, %bb872.i.i, %bb872.i.i, %bb833.i.i, %bb833.i.i, %bb833.i.i, %bb833.i.i, %bb833.i.i, %bb833.i.i, %bb833.i.i, %bb833.i.i, %bb813.i.i, %bb813.i.i, %bb813.i.i, %bb813.i.i, %bb813.i.i, %bb813.i.i, %bb813.i.i, %bb813.i.i
- br label %bb5235.i
-bb950.i.i: ; preds = %bb928.i.i, %bb928.i.i, %bb890.i.i, %bb890.i.i, %bb872.i.i, %bb872.i.i, %bb833.i.i, %bb833.i.i, %bb813.i.i, %bb813.i.i
- br label %bb5235.i
-bb989.i.i: ; preds = %bb928.i.i, %bb928.i.i, %bb890.i.i, %bb890.i.i, %bb872.i.i, %bb872.i.i, %bb833.i.i, %bb833.i.i, %bb813.i.i, %bb813.i.i
- br label %bb5235.i
-bb1009.i.i: ; preds = %bb928.i.i, %bb928.i.i, %bb890.i.i, %bb890.i.i, %bb872.i.i, %bb872.i.i, %bb833.i.i, %bb833.i.i, %bb813.i.i, %bb813.i.i
- br label %bb5235.i
-bb1027.i.i: ; preds = %bb928.i.i, %bb928.i.i, %bb890.i.i, %bb890.i.i, %bb872.i.i, %bb872.i.i, %bb833.i.i, %bb833.i.i, %bb813.i.i, %bb813.i.i
- br label %bb5235.i
-bb1045.i.i: ; preds = %bb928.i.i, %bb928.i.i, %bb928.i.i, %bb928.i.i, %bb890.i.i, %bb890.i.i, %bb890.i.i, %bb890.i.i, %bb872.i.i, %bb872.i.i, %bb872.i.i, %bb872.i.i, %bb833.i.i, %bb833.i.i, %bb833.i.i, %bb833.i.i, %bb813.i.i, %bb813.i.i, %bb813.i.i, %bb813.i.i
- br label %bb1065.i.i
-bb1065.i.i: ; preds = %bb1045.i.i, %bb928.i.i, %bb890.i.i, %bb872.i.i, %bb833.i.i, %bb813.i.i
- br label %bb5235.i
-bb4819.i: ; preds = %bb4804.i, %bb4799.i, %bb4794.i
- br i1 false, label %bb5208.i, label %bb5011.i
-bb5011.i: ; preds = %bb4819.i
- switch i32 0, label %bb5039.i [
- i32 10, label %bb5016.i
- i32 3, label %bb5103.i
- ]
-bb5016.i: ; preds = %bb5011.i
- br i1 false, label %bb5103.i, label %bb5039.i
-bb5039.i: ; preds = %bb5016.i, %bb5011.i
- switch i32 0, label %bb5052.i [
- i32 3, label %bb5103.i
- i32 10, label %bb5103.i
- ]
-bb5052.i: ; preds = %bb5039.i
- br i1 false, label %bb5103.i, label %bb5065.i
-bb5065.i: ; preds = %bb5052.i
- br i1 false, label %bb5078.i, label %bb5103.i
-bb5078.i: ; preds = %bb5065.i
- br i1 false, label %bb5103.i, label %bb5084.i
-bb5084.i: ; preds = %bb5078.i
- br i1 false, label %bb5103.i, label %bb5090.i
-bb5090.i: ; preds = %bb5084.i
- br i1 false, label %bb5103.i, label %bb5096.i
-bb5096.i: ; preds = %bb5090.i
- br i1 false, label %bb5103.i, label %bb5102.i
-bb5102.i: ; preds = %bb5096.i
- br label %bb5103.i
-bb5103.i: ; preds = %bb5102.i, %bb5096.i, %bb5090.i, %bb5084.i, %bb5078.i, %bb5065.i, %bb5052.i, %bb5039.i, %bb5039.i, %bb5016.i, %bb5011.i
- switch i32 0, label %bb5208.i [
- i32 0, label %bb5133.i
- i32 2, label %bb5162.i
- i32 4, label %bb5182.i
- i32 10, label %bb5113.i
- i32 11, label %bb5113.i
- i32 12, label %bb5121.i
- i32 13, label %bb5121.i
- i32 14, label %bb5125.i
- i32 15, label %bb5125.i
- i32 16, label %bb5133.i
- i32 17, label %bb5133.i
- i32 18, label %bb5146.i
- i32 19, label %bb5146.i
- ]
-bb5113.i: ; preds = %bb5103.i, %bb5103.i
- switch i32 %dt4080.0.i, label %bb5208.i [
- i32 8, label %bb5115.i
- i32 9, label %bb5115.i
- i32 12, label %bb5117.i
- i32 13, label %bb5117.i
- i32 14, label %bb5119.i
- i32 15, label %bb5119.i
- ]
-bb5115.i: ; preds = %bb5113.i, %bb5113.i
- br label %bb5208.i
-bb5117.i: ; preds = %bb5113.i, %bb5113.i
- br label %bb5208.i
-bb5119.i: ; preds = %bb5113.i, %bb5113.i
- br label %bb5208.i
-bb5121.i: ; preds = %bb5103.i, %bb5103.i
- switch i32 %dt4080.0.i, label %bb5208.i [
- i32 8, label %bb5123.i
- i32 9, label %bb5123.i
- ]
-bb5123.i: ; preds = %bb5121.i, %bb5121.i
- br label %bb5208.i
-bb5125.i: ; preds = %bb5103.i, %bb5103.i
- switch i32 %dt4080.0.i, label %bb5208.i [
- i32 8, label %bb5127.i
- i32 9, label %bb5127.i
- i32 12, label %bb5129.i
- i32 13, label %bb5129.i
- ]
-bb5127.i: ; preds = %bb5125.i, %bb5125.i
- br label %bb5208.i
-bb5129.i: ; preds = %bb5125.i, %bb5125.i
- br label %bb5208.i
-bb5133.i: ; preds = %bb5103.i, %bb5103.i, %bb5103.i
- switch i32 %dt4080.0.i, label %bb5208.i [
- i32 8, label %bb5135.i
- i32 9, label %bb5135.i
- i32 10, label %bb5137.i
- i32 11, label %bb5137.i
- i32 12, label %bb5139.i
- i32 13, label %bb5139.i
- i32 14, label %bb5143.i
- i32 15, label %bb5143.i
- ]
-bb5135.i: ; preds = %bb5133.i, %bb5133.i
- br label %bb5208.i
-bb5137.i: ; preds = %bb5133.i, %bb5133.i
- br label %bb5208.i
-bb5139.i: ; preds = %bb5133.i, %bb5133.i
- br label %bb5208.i
-bb5143.i: ; preds = %bb5133.i, %bb5133.i
- br label %bb5208.i
-bb5146.i: ; preds = %bb5103.i, %bb5103.i
- switch i32 %dt4080.0.i, label %bb5208.i [
- i32 0, label %bb5158.i
- i32 8, label %bb5148.i
- i32 9, label %bb5148.i
- i32 10, label %bb5150.i
- i32 11, label %bb5150.i
- i32 12, label %bb5152.i
- i32 13, label %bb5152.i
- i32 14, label %bb5155.i
- i32 15, label %bb5155.i
- i32 16, label %bb5158.i
- i32 17, label %bb5158.i
- ]
-bb5148.i: ; preds = %bb5146.i, %bb5146.i
- br label %bb5208.i
-bb5150.i: ; preds = %bb5146.i, %bb5146.i
- br label %bb5208.i
-bb5152.i: ; preds = %bb5146.i, %bb5146.i
- br label %bb5208.i
-bb5155.i: ; preds = %bb5146.i, %bb5146.i
- br label %bb5208.i
-bb5158.i: ; preds = %bb5146.i, %bb5146.i, %bb5146.i
- br label %bb5208.i
-bb5162.i: ; preds = %bb5103.i
- switch i32 %dt4080.0.i, label %bb5208.i [
- i32 0, label %bb5175.i
- i32 8, label %bb5164.i
- i32 9, label %bb5164.i
- i32 10, label %bb5166.i
- i32 11, label %bb5166.i
- i32 12, label %bb5168.i
- i32 13, label %bb5168.i
- i32 14, label %bb5172.i
- i32 15, label %bb5172.i
- i32 16, label %bb5175.i
- i32 17, label %bb5175.i
- i32 18, label %bb5179.i
- i32 19, label %bb5179.i
- ]
-bb5164.i: ; preds = %bb5162.i, %bb5162.i
- br label %bb5208.i
-bb5166.i: ; preds = %bb5162.i, %bb5162.i
- br label %bb5208.i
-bb5168.i: ; preds = %bb5162.i, %bb5162.i
- br label %bb5208.i
-bb5172.i: ; preds = %bb5162.i, %bb5162.i
- br label %bb5208.i
-bb5175.i: ; preds = %bb5162.i, %bb5162.i, %bb5162.i
- br label %bb5208.i
-bb5179.i: ; preds = %bb5162.i, %bb5162.i
- br label %bb5208.i
-bb5182.i: ; preds = %bb5103.i
- switch i32 %dt4080.0.i, label %bb5208.i [
- i32 0, label %bb5195.i
- i32 2, label %bb5202.i
- i32 8, label %bb5184.i
- i32 9, label %bb5184.i
- i32 10, label %bb5186.i
- i32 11, label %bb5186.i
- i32 12, label %bb5188.i
- i32 13, label %bb5188.i
- i32 14, label %bb5192.i
- i32 15, label %bb5192.i
- i32 16, label %bb5195.i
- i32 17, label %bb5195.i
- i32 18, label %bb5199.i
- i32 19, label %bb5199.i
- ]
-bb5184.i: ; preds = %bb5182.i, %bb5182.i
- br label %bb5208.i
-bb5186.i: ; preds = %bb5182.i, %bb5182.i
- br label %bb5208.i
-bb5188.i: ; preds = %bb5182.i, %bb5182.i
- br label %bb5208.i
-bb5192.i: ; preds = %bb5182.i, %bb5182.i
- br label %bb5208.i
-bb5195.i: ; preds = %bb5182.i, %bb5182.i, %bb5182.i
- br label %bb5208.i
-bb5199.i: ; preds = %bb5182.i, %bb5182.i
- br label %bb5208.i
-bb5202.i: ; preds = %bb5182.i
- br label %bb5208.i
-bb5208.i: ; preds = %bb5202.i, %bb5199.i, %bb5195.i, %bb5192.i, %bb5188.i, %bb5186.i, %bb5184.i, %bb5182.i, %bb5179.i, %bb5175.i, %bb5172.i, %bb5168.i, %bb5166.i, %bb5164.i, %bb5162.i, %bb5158.i, %bb5155.i, %bb5152.i, %bb5150.i, %bb5148.i, %bb5146.i, %bb5143.i, %bb5139.i, %bb5137.i, %bb5135.i, %bb5133.i, %bb5129.i, %bb5127.i, %bb5125.i, %bb5123.i, %bb5121.i, %bb5119.i, %bb5117.i, %bb5115.i, %bb5113.i, %bb5103.i, %bb4819.i
- switch i32 0, label %bb5221.i [
- i32 0, label %bb5210.i
- i32 1, label %bb5211.i
- i32 2, label %bb5212.i
- i32 3, label %bb5213.i
- i32 4, label %bb5214.i
- i32 5, label %bb5215.i
- i32 6, label %bb5217.i
- i32 7, label %bb5216.i
- i32 12, label %bb5218.i
- i32 13, label %bb5218.i
- i32 14, label %bb5219.i
- i32 15, label %bb5219.i
- i32 16, label %bb5210.i
- i32 17, label %bb5210.i
- i32 22, label %bb5210.i
- i32 23, label %bb5210.i
- ]
-bb5210.i: ; preds = %bb5208.i, %bb5208.i, %bb5208.i, %bb5208.i, %bb5208.i
- br label %bb5224.i
-bb5211.i: ; preds = %bb5208.i
- br label %bb5224.i
-bb5212.i: ; preds = %bb5208.i
- br label %bb5224.i
-bb5213.i: ; preds = %bb5208.i
- br label %bb5224.i
-bb5214.i: ; preds = %bb5208.i
- br label %bb5224.i
-bb5215.i: ; preds = %bb5208.i
- br label %bb5224.i
-bb5216.i: ; preds = %bb5208.i
- br label %bb5224.i
-bb5217.i: ; preds = %bb5208.i
- br label %bb5224.i
-bb5218.i: ; preds = %bb5208.i, %bb5208.i
- br label %bb5224.i
-bb5219.i: ; preds = %bb5208.i, %bb5208.i
- br label %bb5224.i
-bb5221.i: ; preds = %bb5208.i
- br label %bb5224.i
-bb5224.i: ; preds = %bb5221.i, %bb5219.i, %bb5218.i, %bb5217.i, %bb5216.i, %bb5215.i, %bb5214.i, %bb5213.i, %bb5212.i, %bb5211.i, %bb5210.i
- br label %bb5235.i
-bb5235.i: ; preds = %bb5224.i, %bb1065.i.i, %bb1027.i.i, %bb1009.i.i, %bb989.i.i, %bb950.i.i, %bb930.i.i
- br label %bb5272.i
-bb5272.i: ; preds = %bb5235.i
- br label %bb5276.i
-bb5276.i: ; preds = %bb19808.i, %bb5272.i
- br label %bb16607.i
-bb5295.i: ; preds = %bb5295.preheader.i, %storeVecColor_RGB_UI.exit
- br label %loadVecColor_BGRA_UI8888R.exit
-loadVecColor_BGRA_UI8888R.exit: ; preds = %bb5295.i
- br i1 false, label %bb5325.i, label %bb5351.i
-bb5325.i: ; preds = %loadVecColor_BGRA_UI8888R.exit
- br i1 false, label %bb4527.i, label %bb.i
-bb.i: ; preds = %bb5325.i
- switch i32 0, label %bb4527.i [
- i32 4, label %bb4362.i
- i32 8, label %bb4448.i
- ]
-bb4362.i: ; preds = %bb.i
- br i1 false, label %bb4532.i, label %bb5556.i
-bb4448.i: ; preds = %bb.i
- br label %bb4527.i
-bb4527.i: ; preds = %bb4448.i, %bb.i, %bb5325.i
- br i1 false, label %bb4532.i, label %bb5556.i
-bb4532.i: ; preds = %bb4527.i, %bb4362.i
- switch i32 0, label %bb4997.i [
- i32 6, label %bb4534.i
- i32 7, label %bb4982.i
- ]
-bb4534.i: ; preds = %bb4532.i
- br i1 false, label %bb4875.i, label %bb4619.i
-bb4619.i: ; preds = %bb4534.i
- br i1 false, label %bb4875.i, label %bb4663.i
-bb4663.i: ; preds = %bb4619.i
- br label %bb4855.i
-bb4759.i: ; preds = %bb4855.i
- br label %bb4855.i
-bb4855.i: ; preds = %bb4759.i, %bb4663.i
- br i1 false, label %bb4866.i, label %bb4759.i
-bb4866.i: ; preds = %bb4855.i
- br label %bb4875.i
-bb4875.i: ; preds = %bb4866.i, %bb4619.i, %bb4534.i
- br i1 false, label %bb4973.i, label %bb4922.i
-bb4922.i: ; preds = %bb4875.i
- br label %bb4973.i
-bb4973.i: ; preds = %bb4922.i, %bb4875.i
- br label %bb4982.i
-bb4982.i: ; preds = %bb4973.i, %bb4532.i
- br label %bb5041.i
-bb4997.i: ; preds = %bb4532.i
- br label %bb5041.i
-bb5041.i: ; preds = %bb4997.i, %bb4982.i
- switch i32 0, label %bb5464.i [
- i32 0, label %bb5344.i
- i32 1, label %bb5374.i
- i32 2, label %bb5404.i
- i32 3, label %bb5434.i
- i32 11, label %bb5263.i
- ]
-bb5263.i: ; preds = %bb5041.i
- br i1 false, label %bb12038.i, label %bb5467.i
-bb5344.i: ; preds = %bb5041.i
- br i1 false, label %bb12038.i, label %bb5467.i
-bb5374.i: ; preds = %bb5041.i
- br i1 false, label %bb12038.i, label %bb5467.i
-bb5404.i: ; preds = %bb5041.i
- br i1 false, label %bb12038.i, label %bb5467.i
-bb5434.i: ; preds = %bb5041.i
- br label %bb5464.i
-bb5464.i: ; preds = %bb5434.i, %bb5041.i
- br i1 false, label %bb12038.i, label %bb5467.i
-bb5467.i: ; preds = %bb5464.i, %bb5404.i, %bb5374.i, %bb5344.i, %bb5263.i
- switch i32 0, label %bb15866.i [
- i32 3, label %bb13016.i
- i32 4, label %bb12040.i
- i32 8, label %bb12514.i
- i32 10, label %bb12903.i
- i32 11, label %bb12553.i
- i32 16, label %bb12514.i
- ]
-bb5556.i: ; preds = %bb4527.i, %bb4362.i
- switch i32 0, label %bb8990.i [
- i32 3, label %bb6403.i
- i32 4, label %bb6924.i
- i32 8, label %bb6924.i
- i32 10, label %bb6403.i
- i32 11, label %bb5882.i
- i32 16, label %bb5558.i
- ]
-bb5558.i: ; preds = %bb5556.i
- br label %bb8990.i
-bb5882.i: ; preds = %bb5556.i
- switch i32 0, label %bb6387.i [
- i32 1, label %bb6332.i
- i32 3, label %bb6332.i
- i32 4, label %bb6352.i
- i32 6, label %bb5884.i
- i32 7, label %bb8990.i
- ]
-bb5884.i: ; preds = %bb5882.i
- br i1 false, label %bb6225.i, label %bb5969.i
-bb5969.i: ; preds = %bb5884.i
- br i1 false, label %bb6225.i, label %bb6013.i
-bb6013.i: ; preds = %bb5969.i
- br label %bb6205.i
-bb6109.i: ; preds = %bb6205.i
- br label %bb6205.i
-bb6205.i: ; preds = %bb6109.i, %bb6013.i
- br i1 false, label %bb6216.i, label %bb6109.i
-bb6216.i: ; preds = %bb6205.i
- br label %bb6225.i
-bb6225.i: ; preds = %bb6216.i, %bb5969.i, %bb5884.i
- br i1 false, label %bb6323.i, label %bb6272.i
-bb6272.i: ; preds = %bb6225.i
- switch i32 0, label %bb6908.i [
- i32 1, label %bb6853.i48
- i32 3, label %bb6853.i48
- i32 4, label %bb6873.i
- i32 6, label %bb6405.i
- i32 7, label %bb8990.i
- ]
-bb6323.i: ; preds = %bb6225.i
- switch i32 0, label %bb6908.i [
- i32 1, label %bb6853.i48
- i32 3, label %bb6853.i48
- i32 4, label %bb6873.i
- i32 6, label %bb6405.i
- i32 7, label %bb8990.i
- ]
-bb6332.i: ; preds = %bb5882.i, %bb5882.i
- switch i32 0, label %bb6908.i [
- i32 1, label %bb6853.i48
- i32 3, label %bb6853.i48
- i32 4, label %bb6873.i
- i32 6, label %bb6405.i
- i32 7, label %bb8990.i
- ]
-bb6352.i: ; preds = %bb5882.i
- br label %bb6873.i
-bb6387.i: ; preds = %bb5882.i
- br label %bb6403.i
-bb6403.i: ; preds = %bb6387.i, %bb5556.i, %bb5556.i
- switch i32 0, label %bb6908.i [
- i32 1, label %bb6853.i48
- i32 3, label %bb6853.i48
- i32 4, label %bb6873.i
- i32 6, label %bb6405.i
- i32 7, label %bb8990.i
- ]
-bb6405.i: ; preds = %bb6403.i, %bb6332.i, %bb6323.i, %bb6272.i
- br i1 false, label %bb6746.i, label %bb6490.i
-bb6490.i: ; preds = %bb6405.i
- br i1 false, label %bb6746.i, label %bb6534.i
-bb6534.i: ; preds = %bb6490.i
- br label %bb6726.i
-bb6630.i: ; preds = %bb6726.i
- br label %bb6726.i
-bb6726.i: ; preds = %bb6630.i, %bb6534.i
- br i1 false, label %bb6737.i, label %bb6630.i
-bb6737.i: ; preds = %bb6726.i
- br label %bb6746.i
-bb6746.i: ; preds = %bb6737.i, %bb6490.i, %bb6405.i
- br i1 false, label %bb6844.i, label %bb6793.i
-bb6793.i: ; preds = %bb6746.i
- br label %bb8990.i
-bb6844.i: ; preds = %bb6746.i
- br label %bb8990.i
-bb6853.i48: ; preds = %bb6403.i, %bb6403.i, %bb6332.i, %bb6332.i, %bb6323.i, %bb6323.i, %bb6272.i, %bb6272.i
- br label %bb8990.i
-bb6873.i: ; preds = %bb6403.i, %bb6352.i, %bb6332.i, %bb6323.i, %bb6272.i
- br label %bb8990.i
-bb6908.i: ; preds = %bb6403.i, %bb6332.i, %bb6323.i, %bb6272.i
- br label %bb8990.i
-bb6924.i: ; preds = %bb5556.i, %bb5556.i
- switch i32 0, label %bb8929.i [
- i32 1, label %bb8715.i
- i32 3, label %bb8715.i
- i32 4, label %bb8792.i
- i32 6, label %bb6926.i
- i32 7, label %bb8990.i
- ]
-bb6926.i: ; preds = %bb6924.i
- br i1 false, label %bb7267.i, label %bb7011.i
-bb7011.i: ; preds = %bb6926.i
- br i1 false, label %bb7267.i, label %bb7055.i
-bb7055.i: ; preds = %bb7011.i
- br label %bb7247.i
-bb7151.i: ; preds = %bb7247.i
- br label %bb7247.i
-bb7247.i: ; preds = %bb7151.i, %bb7055.i
- br i1 false, label %bb7258.i, label %bb7151.i
-bb7258.i: ; preds = %bb7247.i
- br label %bb7267.i
-bb7267.i: ; preds = %bb7258.i, %bb7011.i, %bb6926.i
- br i1 false, label %bb7365.i, label %bb7314.i
-bb7314.i: ; preds = %bb7267.i
- br label %bb7365.i
-bb7365.i: ; preds = %bb7314.i, %bb7267.i
- br i1 false, label %bb7714.i, label %bb7458.i
-bb7458.i: ; preds = %bb7365.i
- br i1 false, label %bb7714.i, label %bb7502.i
-bb7502.i: ; preds = %bb7458.i
- br label %bb7694.i
-bb7598.i: ; preds = %bb7694.i
- br label %bb7694.i
-bb7694.i: ; preds = %bb7598.i, %bb7502.i
- br i1 false, label %bb7705.i, label %bb7598.i
-bb7705.i: ; preds = %bb7694.i
- br label %bb7714.i
-bb7714.i: ; preds = %bb7705.i, %bb7458.i, %bb7365.i
- br i1 false, label %bb7812.i, label %bb7761.i
-bb7761.i: ; preds = %bb7714.i
- br label %bb7812.i
-bb7812.i: ; preds = %bb7761.i, %bb7714.i
- br i1 false, label %bb8161.i, label %bb7905.i
-bb7905.i: ; preds = %bb7812.i
- br i1 false, label %bb8161.i, label %bb7949.i
-bb7949.i: ; preds = %bb7905.i
- br label %bb8141.i
-bb8045.i: ; preds = %bb8141.i
- br label %bb8141.i
-bb8141.i: ; preds = %bb8045.i, %bb7949.i
- br i1 false, label %bb8152.i, label %bb8045.i
-bb8152.i: ; preds = %bb8141.i
- br label %bb8161.i
-bb8161.i: ; preds = %bb8152.i, %bb7905.i, %bb7812.i
- br i1 false, label %bb8259.i, label %bb8208.i
-bb8208.i: ; preds = %bb8161.i
- br label %bb8259.i
-bb8259.i: ; preds = %bb8208.i, %bb8161.i
- br i1 false, label %bb8608.i, label %bb8352.i
-bb8352.i: ; preds = %bb8259.i
- br i1 false, label %bb8608.i, label %bb8396.i
-bb8396.i: ; preds = %bb8352.i
- br label %bb8588.i63
-bb8492.i: ; preds = %bb8588.i63
- br label %bb8588.i63
-bb8588.i63: ; preds = %bb8492.i, %bb8396.i
- br i1 false, label %bb8599.i, label %bb8492.i
-bb8599.i: ; preds = %bb8588.i63
- br label %bb8608.i
-bb8608.i: ; preds = %bb8599.i, %bb8352.i, %bb8259.i
- br i1 false, label %bb8706.i, label %bb8655.i
-bb8655.i: ; preds = %bb8608.i
- br label %bb8990.i
-bb8706.i: ; preds = %bb8608.i
- br label %bb8990.i
-bb8715.i: ; preds = %bb6924.i, %bb6924.i
- br label %bb8990.i
-bb8792.i: ; preds = %bb6924.i
- br label %bb8990.i
-bb8929.i: ; preds = %bb6924.i
- br label %bb8990.i
-bb8990.i: ; preds = %bb8929.i, %bb8792.i, %bb8715.i, %bb8706.i, %bb8655.i, %bb6924.i, %bb6908.i, %bb6873.i, %bb6853.i48, %bb6844.i, %bb6793.i, %bb6403.i, %bb6332.i, %bb6323.i, %bb6272.i, %bb5882.i, %bb5558.i, %bb5556.i
- switch i32 %sf4083.0.i, label %bb11184.i [
- i32 0, label %bb10372.i
- i32 1, label %bb10609.i
- i32 2, label %bb10811.i
- i32 3, label %bb11013.i
- i32 4, label %bb8992.i
- i32 5, label %bb8992.i
- i32 6, label %bb8992.i
- i32 7, label %bb8992.i
- i32 8, label %bb9195.i
- i32 9, label %bb9195.i
- i32 10, label %bb9965.i
- i32 11, label %bb9585.i
- i32 16, label %bb9195.i
- ]
-bb8992.i: ; preds = %bb8990.i, %bb8990.i, %bb8990.i, %bb8990.i
- switch i32 0, label %bb11184.i [
- i32 0, label %bb9075.i
- i32 1, label %bb9105.i
- i32 2, label %bb9135.i
- i32 3, label %bb9165.i
- i32 11, label %bb8994.i
- ]
-bb8994.i: ; preds = %bb8992.i
- br label %bb11247.i
-bb9075.i: ; preds = %bb8992.i
- br label %bb11247.i
-bb9105.i: ; preds = %bb8992.i
- br label %bb11247.i
-bb9135.i: ; preds = %bb8992.i
- br label %bb11247.i
-bb9165.i: ; preds = %bb8992.i
- br label %bb11247.i
-bb9195.i: ; preds = %bb8990.i, %bb8990.i, %bb8990.i
- switch i32 0, label %bb11184.i [
- i32 0, label %bb9491.i
- i32 1, label %bb9521.i
- i32 2, label %bb9551.i
- i32 3, label %bb9581.i
- i32 4, label %bb9197.i
- i32 11, label %bb9342.i
- ]
-bb9197.i: ; preds = %bb9195.i
- br label %bb11247.i
-bb9342.i: ; preds = %bb9195.i
- br label %bb11247.i
-bb9491.i: ; preds = %bb9195.i
- br label %bb11247.i
-bb9521.i: ; preds = %bb9195.i
- br label %bb11247.i
-bb9551.i: ; preds = %bb9195.i
- br label %bb11247.i
-bb9581.i: ; preds = %bb9195.i
- br label %bb11247.i
-bb9585.i: ; preds = %bb8990.i
- switch i32 0, label %bb11184.i [
- i32 0, label %bb9879.i
- i32 1, label %bb9920.i
- i32 2, label %bb9920.i
- i32 3, label %bb9924.i
- i32 4, label %bb9587.i
- i32 8, label %bb9587.i
- ]
-bb9587.i: ; preds = %bb9585.i, %bb9585.i
- br label %bb11247.i
-bb9879.i: ; preds = %bb9585.i
- br label %bb11247.i
-bb9920.i: ; preds = %bb9585.i, %bb9585.i
- br label %bb11247.i
-bb9924.i: ; preds = %bb9585.i
- br label %bb11247.i
-bb9965.i: ; preds = %bb8990.i
- switch i32 0, label %bb11184.i [
- i32 1, label %bb10368.i
- i32 2, label %bb10368.i
- i32 3, label %bb10364.i
- i32 4, label %bb9967.i
- i32 8, label %bb10127.i
- i32 11, label %bb10287.i
- ]
-bb9967.i: ; preds = %bb9965.i
- br label %bb11247.i
-bb10127.i: ; preds = %bb9965.i
- br label %bb11247.i
-bb10287.i: ; preds = %bb9965.i
- br label %bb11247.i
-bb10364.i: ; preds = %bb9965.i
- br label %bb11247.i
-bb10368.i: ; preds = %bb9965.i, %bb9965.i
- br label %bb11247.i
-bb10372.i: ; preds = %bb8990.i
- switch i32 0, label %bb11184.i [
- i32 1, label %bb10605.i
- i32 2, label %bb10605.i
- i32 3, label %bb10601.i
- i32 4, label %bb10374.i
- i32 8, label %bb10449.i
- i32 11, label %bb10524.i
- ]
-bb10374.i: ; preds = %bb10372.i
- br label %bb11247.i
-bb10449.i: ; preds = %bb10372.i
- br label %bb11247.i
-bb10524.i: ; preds = %bb10372.i
- br label %bb11247.i
-bb10601.i: ; preds = %bb10372.i
- br label %bb11247.i
-bb10605.i: ; preds = %bb10372.i, %bb10372.i
- br label %bb11247.i
-bb10609.i: ; preds = %bb8990.i
- switch i32 0, label %bb11184.i [
- i32 0, label %bb10807.i
- i32 2, label %bb10807.i
- i32 3, label %bb10803.i
- i32 4, label %bb10611.i
- i32 8, label %bb10686.i
- i32 11, label %bb10761.i
- ]
-bb10611.i: ; preds = %bb10609.i
- br label %bb11247.i
-bb10686.i: ; preds = %bb10609.i
- br label %bb11247.i
-bb10761.i: ; preds = %bb10609.i
- br label %bb11247.i
-bb10803.i: ; preds = %bb10609.i
- br label %bb11247.i
-bb10807.i: ; preds = %bb10609.i, %bb10609.i
- br label %bb11247.i
-bb10811.i: ; preds = %bb8990.i
- switch i32 0, label %bb11184.i [
- i32 0, label %bb11009.i
- i32 1, label %bb11009.i
- i32 3, label %bb11005.i
- i32 4, label %bb10813.i
- i32 8, label %bb10888.i
- i32 11, label %bb10963.i
- ]
-bb10813.i: ; preds = %bb10811.i
- br label %bb11247.i
-bb10888.i: ; preds = %bb10811.i
- br label %bb11247.i
-bb10963.i: ; preds = %bb10811.i
- br label %bb11247.i
-bb11005.i: ; preds = %bb10811.i
- br label %bb11247.i
-bb11009.i: ; preds = %bb10811.i, %bb10811.i
- br label %bb11247.i
-bb11013.i: ; preds = %bb8990.i
- switch i32 0, label %bb11184.i [
- i32 0, label %bb11180.i
- i32 1, label %bb11180.i
- i32 2, label %bb11180.i
- i32 4, label %bb11015.i
- i32 8, label %bb11090.i
- i32 11, label %bb11103.i
- ]
-bb11015.i: ; preds = %bb11013.i
- br label %bb11247.i
-bb11090.i: ; preds = %bb11013.i
- br label %bb11247.i
-bb11103.i: ; preds = %bb11013.i
- br label %bb11247.i
-bb11180.i: ; preds = %bb11013.i, %bb11013.i, %bb11013.i
- br label %bb11184.i
-bb11184.i: ; preds = %bb11180.i, %bb11013.i, %bb10811.i, %bb10609.i, %bb10372.i, %bb9965.i, %bb9585.i, %bb9195.i, %bb8992.i, %bb8990.i
- br label %bb11247.i
-bb11247.i: ; preds = %bb11184.i, %bb11103.i, %bb11090.i, %bb11015.i, %bb11009.i, %bb11005.i, %bb10963.i, %bb10888.i, %bb10813.i, %bb10807.i, %bb10803.i, %bb10761.i, %bb10686.i, %bb10611.i, %bb10605.i, %bb10601.i, %bb10524.i, %bb10449.i, %bb10374.i, %bb10368.i, %bb10364.i, %bb10287.i, %bb10127.i, %bb9967.i, %bb9924.i, %bb9920.i, %bb9879.i, %bb9587.i, %bb9581.i, %bb9551.i, %bb9521.i, %bb9491.i, %bb9342.i, %bb9197.i, %bb9165.i, %bb9135.i, %bb9105.i, %bb9075.i, %bb8994.i
- br i1 false, label %bb11250.i, label %bb11256.i
-bb11250.i: ; preds = %bb11247.i
- br label %bb11378.i
-bb11256.i: ; preds = %bb11247.i
- switch i32 0, label %bb11348.i [
- i32 4, label %bb11258.i
- i32 8, label %bb11258.i
- i32 11, label %bb11318.i
- ]
-bb11258.i: ; preds = %bb11256.i, %bb11256.i
- br i1 false, label %bb11273.i, label %bb11261.i
-bb11261.i: ; preds = %bb11258.i
- br label %bb11273.i
-bb11273.i: ; preds = %bb11261.i, %bb11258.i
- br i1 false, label %bb11288.i, label %bb11276.i
-bb11276.i: ; preds = %bb11273.i
- br label %bb11288.i
-bb11288.i: ; preds = %bb11276.i, %bb11273.i
- br i1 false, label %bb11303.i, label %bb11291.i
-bb11291.i: ; preds = %bb11288.i
- br label %bb11303.i
-bb11303.i: ; preds = %bb11291.i, %bb11288.i
- br i1 false, label %bb11318.i, label %bb11306.i
-bb11306.i: ; preds = %bb11303.i
- br label %bb11318.i
-bb11318.i: ; preds = %bb11306.i, %bb11303.i, %bb11256.i
- br i1 false, label %bb11333.i, label %bb11321.i
-bb11321.i: ; preds = %bb11318.i
- br label %bb11333.i
-bb11333.i: ; preds = %bb11321.i, %bb11318.i
- br i1 false, label %bb11348.i, label %bb11336.i
-bb11336.i: ; preds = %bb11333.i
- br label %bb11348.i
-bb11348.i: ; preds = %bb11336.i, %bb11333.i, %bb11256.i
- br i1 false, label %bb11363.i, label %bb11351.i
-bb11351.i: ; preds = %bb11348.i
- br label %bb11363.i
-bb11363.i: ; preds = %bb11351.i, %bb11348.i
- br i1 false, label %bb11378.i, label %bb11366.i
-bb11366.i: ; preds = %bb11363.i
- br label %bb11378.i
-bb11378.i: ; preds = %bb11366.i, %bb11363.i, %bb11250.i
- br label %bb12038.i
-bb12038.i: ; preds = %bb11378.i, %bb5464.i, %bb5404.i, %bb5374.i, %bb5344.i, %bb5263.i
- switch i32 0, label %bb15866.i [
- i32 3, label %bb13016.i
- i32 4, label %bb12040.i
- i32 8, label %bb12514.i
- i32 10, label %bb12903.i
- i32 11, label %bb12553.i
- i32 16, label %bb12514.i
- ]
-bb12040.i: ; preds = %bb12038.i, %bb5467.i
- br label %bb13026.i
-bb12514.i: ; preds = %bb12038.i, %bb12038.i, %bb5467.i, %bb5467.i
- br label %bb13026.i
-bb12553.i: ; preds = %bb12038.i, %bb5467.i
- br i1 false, label %bb12558.i, label %bb12747.i
-bb12558.i: ; preds = %bb12553.i
- br i1 false, label %bb12666.i, label %bb12654.i
-bb12654.i: ; preds = %bb12558.i
- br label %bb12666.i
-bb12666.i: ; preds = %bb12654.i, %bb12558.i
- br label %bb12747.i
-bb12747.i: ; preds = %bb12666.i, %bb12553.i
- br label %bb13026.i
-bb12903.i: ; preds = %bb12038.i, %bb5467.i
- br i1 false, label %bb12908.i, label %bb13026.i
-bb12908.i: ; preds = %bb12903.i
- br i1 false, label %bb13026.i, label %bb13004.i
-bb13004.i: ; preds = %bb12908.i
- switch i32 0, label %bb15866.i [
- i32 3, label %bb13752.i
- i32 4, label %bb14197.i
- i32 8, label %bb14197.i
- i32 10, label %bb13752.i
- i32 11, label %bb13307.i
- i32 16, label %bb13028.i
- ]
-bb13016.i: ; preds = %bb12038.i, %bb5467.i
- br label %bb13026.i
-bb13026.i: ; preds = %bb13016.i, %bb12908.i, %bb12903.i, %bb12747.i, %bb12514.i, %bb12040.i
- switch i32 0, label %bb15866.i [
- i32 3, label %bb13752.i
- i32 4, label %bb14197.i
- i32 8, label %bb14197.i
- i32 10, label %bb13752.i
- i32 11, label %bb13307.i
- i32 16, label %bb13028.i
- ]
-bb13028.i: ; preds = %bb13026.i, %bb13004.i
- br i1 false, label %UnifiedReturnBlock.i177, label %bb15869.i
-bb13307.i: ; preds = %bb13026.i, %bb13004.i
- switch i32 %dt4080.0.i, label %bb13736.i [
- i32 6, label %bb13312.i
- i32 1, label %bb13624.i
- i32 3, label %bb13624.i
- i32 5, label %bb13649.i
- i32 4, label %bb13688.i
- i32 7, label %bb15866.i
- ]
-bb13312.i: ; preds = %bb13307.i
- br i1 false, label %bb13483.i, label %bb13400.i
-bb13400.i: ; preds = %bb13312.i
- br label %bb13483.i
-bb13483.i: ; preds = %bb13400.i, %bb13312.i
- br i1 false, label %bb13593.i, label %bb13505.i
-bb13505.i: ; preds = %bb13483.i
- switch i32 %dt4080.0.i, label %bb14181.i [
- i32 6, label %bb13757.i
- i32 1, label %bb14069.i
- i32 3, label %bb14069.i
- i32 5, label %bb14094.i
- i32 4, label %bb14133.i
- i32 7, label %bb15866.i
- ]
-bb13593.i: ; preds = %bb13483.i
- switch i32 %dt4080.0.i, label %bb14181.i [
- i32 6, label %bb13757.i
- i32 1, label %bb14069.i
- i32 3, label %bb14069.i
- i32 5, label %bb14094.i
- i32 4, label %bb14133.i
- i32 7, label %bb15866.i
- ]
-bb13624.i: ; preds = %bb13307.i, %bb13307.i
- switch i32 %dt4080.0.i, label %bb14181.i [
- i32 6, label %bb13757.i
- i32 1, label %bb14069.i
- i32 3, label %bb14069.i
- i32 5, label %bb14094.i
- i32 4, label %bb14133.i
- i32 7, label %bb15866.i
- ]
-bb13649.i: ; preds = %bb13307.i
- br label %bb14094.i
-bb13688.i: ; preds = %bb13307.i
- br label %bb14133.i
-bb13736.i: ; preds = %bb13307.i
- br label %bb13752.i
-bb13752.i: ; preds = %bb13736.i, %bb13026.i, %bb13026.i, %bb13004.i, %bb13004.i
- switch i32 %dt4080.0.i, label %bb14181.i [
- i32 6, label %bb13757.i
- i32 1, label %bb14069.i
- i32 3, label %bb14069.i
- i32 5, label %bb14094.i
- i32 4, label %bb14133.i
- i32 7, label %bb15866.i
- ]
-bb13757.i: ; preds = %bb13752.i, %bb13624.i, %bb13593.i, %bb13505.i
- br i1 false, label %bb13928.i, label %bb13845.i
-bb13845.i: ; preds = %bb13757.i
- br label %bb13928.i
-bb13928.i: ; preds = %bb13845.i, %bb13757.i
- br i1 false, label %bb14038.i, label %bb13950.i
-bb13950.i: ; preds = %bb13928.i
- br i1 false, label %UnifiedReturnBlock.i177, label %bb15869.i
-bb14038.i: ; preds = %bb13928.i
- br i1 false, label %UnifiedReturnBlock.i177, label %bb15869.i
-bb14069.i: ; preds = %bb13752.i, %bb13752.i, %bb13624.i, %bb13624.i, %bb13593.i, %bb13593.i, %bb13505.i, %bb13505.i
- br i1 false, label %UnifiedReturnBlock.i177, label %bb15869.i
-bb14094.i: ; preds = %bb13752.i, %bb13649.i, %bb13624.i, %bb13593.i, %bb13505.i
- br i1 false, label %UnifiedReturnBlock.i177, label %bb15869.i
-bb14133.i: ; preds = %bb13752.i, %bb13688.i, %bb13624.i, %bb13593.i, %bb13505.i
- br i1 false, label %UnifiedReturnBlock.i177, label %bb15869.i
-bb14181.i: ; preds = %bb13752.i, %bb13624.i, %bb13593.i, %bb13505.i
- br i1 false, label %UnifiedReturnBlock.i177, label %bb15869.i
-bb14197.i: ; preds = %bb13026.i, %bb13026.i, %bb13004.i, %bb13004.i
- switch i32 %dt4080.0.i, label %bb15805.i [
- i32 6, label %bb14202.i
- i32 1, label %bb15411.i
- i32 3, label %bb15411.i
- i32 5, label %bb15493.i
- i32 4, label %bb15631.i
- i32 7, label %bb15866.i
- ]
-bb14202.i: ; preds = %bb14197.i
- br i1 false, label %bb14373.i, label %bb14290.i
-bb14290.i: ; preds = %bb14202.i
- br label %bb14373.i
-bb14373.i: ; preds = %bb14290.i, %bb14202.i
- br i1 false, label %bb14483.i, label %bb14395.i
-bb14395.i: ; preds = %bb14373.i
- br label %bb14483.i
-bb14483.i: ; preds = %bb14395.i, %bb14373.i
- br i1 false, label %bb14672.i, label %bb14589.i
-bb14589.i: ; preds = %bb14483.i
- br label %bb14672.i
-bb14672.i: ; preds = %bb14589.i, %bb14483.i
- br i1 false, label %bb14782.i, label %bb14694.i
-bb14694.i: ; preds = %bb14672.i
- br label %bb14782.i
-bb14782.i: ; preds = %bb14694.i, %bb14672.i
- br i1 false, label %bb14971.i, label %bb14888.i
-bb14888.i: ; preds = %bb14782.i
- br label %bb14971.i
-bb14971.i: ; preds = %bb14888.i, %bb14782.i
- br i1 false, label %bb15081.i, label %bb14993.i
-bb14993.i: ; preds = %bb14971.i
- br label %bb15081.i
-bb15081.i: ; preds = %bb14993.i, %bb14971.i
- br i1 false, label %bb15270.i, label %bb15187.i
-bb15187.i: ; preds = %bb15081.i
- br label %bb15270.i
-bb15270.i: ; preds = %bb15187.i, %bb15081.i
- br i1 false, label %bb15380.i, label %bb15292.i
-bb15292.i: ; preds = %bb15270.i
- br i1 false, label %UnifiedReturnBlock.i177, label %bb15869.i
-bb15380.i: ; preds = %bb15270.i
- br i1 false, label %UnifiedReturnBlock.i177, label %bb15869.i
-bb15411.i: ; preds = %bb14197.i, %bb14197.i
- br i1 false, label %UnifiedReturnBlock.i177, label %bb15869.i
-bb15493.i: ; preds = %bb14197.i
- br i1 false, label %UnifiedReturnBlock.i177, label %bb15869.i
-bb15631.i: ; preds = %bb14197.i
- br i1 false, label %UnifiedReturnBlock.i177, label %bb15869.i
-bb15805.i: ; preds = %bb14197.i
- br label %bb15866.i
-bb15866.i: ; preds = %bb15805.i, %bb14197.i, %bb13752.i, %bb13624.i, %bb13593.i, %bb13505.i, %bb13307.i, %bb13026.i, %bb13004.i, %bb12038.i, %bb5467.i
- br i1 false, label %UnifiedReturnBlock.i177, label %bb15869.i
-bb15869.i: ; preds = %bb15866.i, %bb15631.i, %bb15493.i, %bb15411.i, %bb15380.i, %bb15292.i, %bb14181.i, %bb14133.i, %bb14094.i, %bb14069.i, %bb14038.i, %bb13950.i, %bb13028.i
- switch i32 0, label %UnifiedReturnBlock.i177 [
- i32 4, label %bb15874.i
- i32 8, label %bb15960.i
- ]
-bb15874.i: ; preds = %bb15869.i
- br label %glgVectorFloatConversion.exit
-bb15960.i: ; preds = %bb15869.i
- br label %glgVectorFloatConversion.exit
-UnifiedReturnBlock.i177: ; preds = %bb15869.i, %bb15866.i, %bb15631.i, %bb15493.i, %bb15411.i, %bb15380.i, %bb15292.i, %bb14181.i, %bb14133.i, %bb14094.i, %bb14069.i, %bb14038.i, %bb13950.i, %bb13028.i
- br label %glgVectorFloatConversion.exit
-glgVectorFloatConversion.exit: ; preds = %UnifiedReturnBlock.i177, %bb15960.i, %bb15874.i
- br label %bb16581.i
-bb5351.i: ; preds = %loadVecColor_BGRA_UI8888R.exit
- br i1 false, label %bb5359.i, label %bb5586.i
-bb5359.i: ; preds = %bb5351.i
- switch i32 0, label %bb5586.i [
- i32 0, label %bb5361.i
- i32 1, label %bb5511.i
- i32 2, label %bb5511.i
- ]
-bb5361.i: ; preds = %bb5359.i
- br i1 false, label %bb5366.i, label %bb5379.i
-bb5366.i: ; preds = %bb5361.i
- br label %bb7230.i
-bb5379.i: ; preds = %bb5361.i
- switch i32 %sf4083.0.i, label %bb5415.i [
- i32 1, label %bb5384.i
- i32 2, label %bb5402.i
- ]
-bb5384.i: ; preds = %bb5379.i
- switch i32 0, label %bb7230.i [
- i32 4, label %bb5445.i
- i32 8, label %bb5445.i
- i32 11, label %bb5445.i
- ]
-bb5402.i: ; preds = %bb5379.i
- switch i32 0, label %bb7230.i [
- i32 4, label %bb5445.i
- i32 8, label %bb5445.i
- i32 11, label %bb5445.i
- ]
-bb5415.i: ; preds = %bb5379.i
- switch i32 0, label %bb7230.i [
- i32 4, label %bb5445.i
- i32 8, label %bb5445.i
- i32 11, label %bb5445.i
- ]
-bb5445.i: ; preds = %bb5415.i, %bb5415.i, %bb5415.i, %bb5402.i, %bb5402.i, %bb5402.i, %bb5384.i, %bb5384.i, %bb5384.i
- switch i32 0, label %bb7230.i [
- i32 4, label %bb5470.i
- i32 8, label %bb5470.i
- i32 11, label %bb6853.i
- ]
-bb5470.i: ; preds = %bb5445.i, %bb5445.i
- switch i32 0, label %bb7230.i [
- i32 4, label %bb5498.i
- i32 8, label %bb5493.i
- i32 11, label %bb6853.i
- ]
-bb5493.i: ; preds = %bb5470.i
- br i1 false, label %bb5498.i, label %bb5586.i
-bb5498.i: ; preds = %bb5493.i, %bb5470.i
- switch i32 0, label %bb7230.i [
- i32 4, label %bb5591.i
- i32 8, label %bb6153.i
- i32 11, label %bb6853.i
- ]
-bb5511.i: ; preds = %bb5359.i, %bb5359.i
- br i1 false, label %bb5568.i, label %bb5586.i
-bb5568.i: ; preds = %bb5511.i
- br label %bb5586.i
-bb5586.i: ; preds = %bb5568.i, %bb5511.i, %bb5493.i, %bb5359.i, %bb5351.i
- switch i32 0, label %bb7230.i [
- i32 4, label %bb5591.i
- i32 8, label %bb6153.i
- i32 11, label %bb6853.i
- ]
-bb5591.i: ; preds = %bb5586.i, %bb5498.i
- switch i32 0, label %bb5995.i [
- i32 4, label %bb5596.i
- i32 8, label %bb5680.i
- i32 11, label %bb5842.i
- ]
-bb5596.i: ; preds = %bb5591.i
- br i1 false, label %bb8428.i, label %bb5602.i
-bb5602.i: ; preds = %bb5596.i
- br i1 false, label %bb8668.i, label %bb8434.i
-bb5680.i: ; preds = %bb5591.i
- br i1 false, label %bb5692.i, label %bb5764.i
-bb5692.i: ; preds = %bb5680.i
- br i1 false, label %bb8668.i, label %bb8434.i
-bb5764.i: ; preds = %bb5680.i
- br i1 false, label %bb8428.i, label %bb5772.i
-bb5772.i: ; preds = %bb5764.i
- br i1 false, label %bb8668.i, label %bb8434.i
-bb5842.i: ; preds = %bb5591.i
- br i1 false, label %bb5920.i, label %bb5845.i
-bb5845.i: ; preds = %bb5842.i
- br i1 false, label %bb8668.i, label %bb8434.i
-bb5920.i: ; preds = %bb5842.i
- br i1 false, label %bb8668.i, label %bb8434.i
-bb5995.i: ; preds = %bb5591.i
- switch i32 %df4081.0.i, label %bb8428.i [
- i32 0, label %bb6007.i
- i32 10, label %bb6007.i
- i32 1, label %bb6042.i
- i32 2, label %bb6079.i
- i32 3, label %bb6116.i
- ]
-bb6007.i: ; preds = %bb5995.i, %bb5995.i
- br i1 false, label %bb6012.i, label %bb8428.i
-bb6012.i: ; preds = %bb6007.i
- br i1 false, label %bb8668.i, label %bb8434.i
-bb6042.i: ; preds = %bb5995.i
- br i1 false, label %bb6049.i, label %bb6045.i
-bb6045.i: ; preds = %bb6042.i
- br i1 false, label %bb8668.i, label %bb8434.i
-bb6049.i: ; preds = %bb6042.i
- br i1 false, label %bb8668.i, label %bb8434.i
-bb6079.i: ; preds = %bb5995.i
- br i1 false, label %bb6086.i, label %bb6082.i
-bb6082.i: ; preds = %bb6079.i
- br i1 false, label %bb8668.i, label %bb8434.i
-bb6086.i: ; preds = %bb6079.i
- br i1 false, label %bb8668.i, label %bb8434.i
-bb6116.i: ; preds = %bb5995.i
- br i1 false, label %bb6123.i, label %bb6119.i
-bb6119.i: ; preds = %bb6116.i
- br i1 false, label %bb8668.i, label %bb8434.i
-bb6123.i: ; preds = %bb6116.i
- br i1 false, label %bb8668.i, label %bb8434.i
-bb6153.i: ; preds = %bb5586.i, %bb5498.i
- switch i32 0, label %bb6724.i [
- i32 4, label %bb6158.i
- i32 8, label %bb6459.i
- i32 11, label %bb6621.i
- ]
-bb6158.i: ; preds = %bb6153.i
- br i1 false, label %bb6242.i, label %bb6161.i
-bb6161.i: ; preds = %bb6158.i
- br i1 false, label %bb6239.i, label %bb6166.i
-bb6166.i: ; preds = %bb6161.i
- br i1 false, label %bb8668.i, label %bb8434.i
-bb6239.i: ; preds = %bb6161.i
- br i1 false, label %bb8668.i, label %bb8434.i
-bb6242.i: ; preds = %bb6158.i
- br i1 false, label %bb6245.i, label %bb6317.i
-bb6245.i: ; preds = %bb6242.i
- br i1 false, label %bb8668.i, label %bb8434.i
-bb6317.i: ; preds = %bb6242.i
- br i1 false, label %bb8668.i, label %bb8434.i
-bb6459.i: ; preds = %bb6153.i
- br i1 false, label %bb6471.i, label %bb6543.i
-bb6471.i: ; preds = %bb6459.i
- br i1 false, label %bb8668.i, label %bb8434.i
-bb6543.i: ; preds = %bb6459.i
- br i1 false, label %bb8428.i, label %bb6551.i
-bb6551.i: ; preds = %bb6543.i
- br i1 false, label %bb8668.i, label %bb8434.i
-bb6621.i: ; preds = %bb6153.i
- br i1 false, label %bb6626.i, label %bb6651.i
-bb6626.i: ; preds = %bb6621.i
- br label %bb6651.i
-bb6651.i: ; preds = %bb6626.i, %bb6621.i
- br i1 false, label %bb8668.i, label %bb8434.i
-bb6724.i: ; preds = %bb6153.i
- switch i32 %df4081.0.i, label %bb8428.i [
- i32 0, label %bb6736.i
- i32 10, label %bb6736.i
- i32 1, label %bb6771.i
- i32 2, label %bb6808.i
- i32 3, label %bb6845.i
- ]
-bb6736.i: ; preds = %bb6724.i, %bb6724.i
- br i1 false, label %bb6741.i, label %bb8428.i
-bb6741.i: ; preds = %bb6736.i
- br i1 false, label %bb8668.i, label %bb8434.i
-bb6771.i: ; preds = %bb6724.i
- br i1 false, label %bb6778.i, label %bb6774.i
-bb6774.i: ; preds = %bb6771.i
- br i1 false, label %bb8668.i, label %bb8434.i
-bb6778.i: ; preds = %bb6771.i
- br i1 false, label %bb8668.i, label %bb8434.i
-bb6808.i: ; preds = %bb6724.i
- br i1 false, label %bb6815.i, label %bb6811.i
-bb6811.i: ; preds = %bb6808.i
- br i1 false, label %bb8668.i, label %bb8434.i
-bb6815.i: ; preds = %bb6808.i
- br i1 false, label %bb8668.i, label %bb8434.i
-bb6845.i: ; preds = %bb6724.i
- br i1 false, label %bb8668.i, label %bb8434.i
-bb6853.i: ; preds = %bb5586.i, %bb5498.i, %bb5470.i, %bb5445.i
- switch i32 0, label %bb8428.i [
- i32 4, label %bb6858.i
- i32 8, label %bb7072.i
- i32 10, label %bb7149.i
- i32 3, label %bb7192.i
- ]
-bb6858.i: ; preds = %bb6853.i
- br i1 false, label %bb6942.i, label %bb6861.i
-bb6861.i: ; preds = %bb6858.i
- br i1 false, label %bb8668.i, label %bb8434.i
-bb6942.i: ; preds = %bb6858.i
- br i1 false, label %bb8668.i, label %bb8434.i
-bb7072.i: ; preds = %bb6853.i
- br i1 false, label %bb7119.i, label %bb7075.i
-bb7075.i: ; preds = %bb7072.i
- br i1 false, label %bb8668.i, label %bb8434.i
-bb7119.i: ; preds = %bb7072.i
- br i1 false, label %bb8668.i, label %bb8434.i
-bb7149.i: ; preds = %bb6853.i
- br i1 false, label %bb8668.i, label %bb8434.i
-bb7192.i: ; preds = %bb6853.i
- br i1 false, label %bb8668.i, label %bb8434.i
-bb7230.i: ; preds = %bb5586.i, %bb5498.i, %bb5470.i, %bb5445.i, %bb5415.i, %bb5402.i, %bb5384.i, %bb5366.i
- switch i32 %sf4083.0.i, label %bb8428.i [
- i32 10, label %bb7235.i
- i32 0, label %bb7455.i
- i32 1, label %bb7725.i
- i32 2, label %bb7978.i
- i32 3, label %bb8231.i
- ]
-bb7235.i: ; preds = %bb7230.i
- switch i32 0, label %bb7442.i [
- i32 4, label %bb7240.i
- i32 8, label %bb7329.i
- i32 11, label %bb7369.i
- ]
-bb7240.i: ; preds = %bb7235.i
- br i1 false, label %bb7252.i, label %bb7243.i
-bb7243.i: ; preds = %bb7240.i
- br i1 false, label %bb8668.i, label %bb8434.i
-bb7252.i: ; preds = %bb7240.i
- br i1 false, label %bb8668.i, label %bb8434.i
-bb7329.i: ; preds = %bb7235.i
- br i1 false, label %bb7339.i, label %bb7332.i
-bb7332.i: ; preds = %bb7329.i
- br i1 false, label %bb8668.i, label %bb8434.i
-bb7339.i: ; preds = %bb7329.i
- br i1 false, label %bb8668.i, label %bb8434.i
-bb7369.i: ; preds = %bb7235.i
- br i1 false, label %bb8668.i, label %bb8434.i
-bb7442.i: ; preds = %bb7235.i
- br i1 false, label %bb7447.i, label %bb8428.i
-bb7447.i: ; preds = %bb7442.i
- br i1 false, label %bb8668.i, label %bb8434.i
-bb7455.i: ; preds = %bb7230.i
- switch i32 0, label %bb7703.i [
- i32 4, label %bb7460.i
- i32 8, label %bb7546.i
- i32 11, label %bb7630.i
- ]
-bb7460.i: ; preds = %bb7455.i
- br i1 false, label %bb7471.i, label %bb7463.i
-bb7463.i: ; preds = %bb7460.i
- br i1 false, label %bb8668.i, label %bb8434.i
-bb7471.i: ; preds = %bb7460.i
- br i1 false, label %bb8668.i, label %bb8434.i
-bb7546.i: ; preds = %bb7455.i
- br i1 false, label %bb7555.i, label %bb7549.i
-bb7549.i: ; preds = %bb7546.i
- br i1 false, label %bb8668.i, label %bb8434.i
-bb7555.i: ; preds = %bb7546.i
- br i1 false, label %bb8668.i, label %bb8434.i
-bb7630.i: ; preds = %bb7455.i
- br i1 false, label %bb8668.i, label %bb8434.i
-bb7703.i: ; preds = %bb7455.i
- br i1 false, label %bb7709.i, label %bb7712.i
-bb7709.i: ; preds = %bb7703.i
- br i1 false, label %bb8668.i, label %bb8434.i
-bb7712.i: ; preds = %bb7703.i
- br i1 false, label %bb7717.i, label %bb8428.i
-bb7717.i: ; preds = %bb7712.i
- br i1 false, label %bb8668.i, label %bb8434.i
-bb7725.i: ; preds = %bb7230.i
- switch i32 0, label %bb7945.i [
- i32 4, label %bb7730.i
- i32 8, label %bb7819.i
- i32 11, label %bb7906.i
- ]
-bb7730.i: ; preds = %bb7725.i
- br i1 false, label %bb7744.i, label %bb7733.i
-bb7733.i: ; preds = %bb7730.i
- br i1 false, label %bb8668.i, label %bb8434.i
-bb7744.i: ; preds = %bb7730.i
- br i1 false, label %bb8668.i, label %bb8434.i
-bb7819.i: ; preds = %bb7725.i
- br i1 false, label %bb7831.i, label %bb7822.i
-bb7822.i: ; preds = %bb7819.i
- br i1 false, label %bb8668.i, label %bb8434.i
-bb7831.i: ; preds = %bb7819.i
- br i1 false, label %bb8668.i, label %bb8434.i
-bb7906.i: ; preds = %bb7725.i
- br i1 false, label %bb8668.i, label %bb8434.i
-bb7945.i: ; preds = %bb7725.i
- switch i32 %df4081.0.i, label %bb8428.i [
- i32 0, label %bb7962.i
- i32 2, label %bb7962.i
- i32 10, label %bb7962.i
- i32 3, label %bb7970.i
- ]
-bb7962.i: ; preds = %bb7945.i, %bb7945.i, %bb7945.i
- br i1 false, label %bb8668.i, label %bb8434.i
-bb7970.i: ; preds = %bb7945.i
- br i1 false, label %bb8668.i, label %bb8434.i
-bb7978.i: ; preds = %bb7230.i
- switch i32 0, label %bb8198.i [
- i32 4, label %bb7983.i
- i32 8, label %bb8072.i
- i32 11, label %bb8159.i
- ]
-bb7983.i: ; preds = %bb7978.i
- br i1 false, label %bb7997.i, label %bb7986.i
-bb7986.i: ; preds = %bb7983.i
- br i1 false, label %bb8668.i, label %bb8434.i
-bb7997.i: ; preds = %bb7983.i
- br i1 false, label %bb8668.i, label %bb8434.i
-bb8072.i: ; preds = %bb7978.i
- br i1 false, label %bb8084.i, label %bb8075.i
-bb8075.i: ; preds = %bb8072.i
- br i1 false, label %bb8668.i, label %bb8434.i
-bb8084.i: ; preds = %bb8072.i
- br i1 false, label %bb8668.i, label %bb8434.i
-bb8159.i: ; preds = %bb7978.i
- br i1 false, label %bb8668.i, label %bb8434.i
-bb8198.i: ; preds = %bb7978.i
- switch i32 %df4081.0.i, label %bb8428.i [
- i32 0, label %bb8215.i
- i32 1, label %bb8215.i
- i32 10, label %bb8215.i
- i32 3, label %bb8223.i
- ]
-bb8215.i: ; preds = %bb8198.i, %bb8198.i, %bb8198.i
- br i1 false, label %bb8668.i, label %bb8434.i
-bb8223.i: ; preds = %bb8198.i
- br i1 false, label %bb8668.i, label %bb8434.i
-bb8231.i: ; preds = %bb7230.i
- switch i32 0, label %bb8428.i [
- i32 4, label %bb8236.i
- i32 8, label %bb8326.i
- i32 11, label %bb8347.i
- i32 10, label %bb8425.i
- ]
-bb8236.i: ; preds = %bb8231.i
- br i1 false, label %bb8251.i, label %bb8239.i
-bb8239.i: ; preds = %bb8236.i
- br i1 false, label %bb8668.i, label %bb8434.i
-bb8251.i: ; preds = %bb8236.i
- br i1 false, label %bb8668.i, label %bb8434.i
-bb8326.i: ; preds = %bb8231.i
- br i1 false, label %bb8339.i, label %bb8428.i
-bb8339.i: ; preds = %bb8326.i
- br i1 false, label %bb8668.i, label %bb8434.i
-bb8347.i: ; preds = %bb8231.i
- br i1 false, label %bb8668.i, label %bb8434.i
-bb8425.i: ; preds = %bb8231.i
- br label %bb8428.i
-bb8428.i: ; preds = %bb8425.i, %bb8326.i, %bb8231.i, %bb8198.i, %bb7945.i, %bb7712.i, %bb7442.i, %bb7230.i, %bb6853.i, %bb6736.i, %bb6724.i, %bb6543.i, %bb6007.i, %bb5995.i, %bb5764.i, %bb5596.i
- br i1 false, label %bb8668.i, label %bb8434.i
-bb8434.i: ; preds = %bb8428.i, %bb8347.i, %bb8339.i, %bb8251.i, %bb8239.i, %bb8223.i, %bb8215.i, %bb8159.i, %bb8084.i, %bb8075.i, %bb7997.i, %bb7986.i, %bb7970.i, %bb7962.i, %bb7906.i, %bb7831.i, %bb7822.i, %bb7744.i, %bb7733.i, %bb7717.i, %bb7709.i, %bb7630.i, %bb7555.i, %bb7549.i, %bb7471.i, %bb7463.i, %bb7447.i, %bb7369.i, %bb7339.i, %bb7332.i, %bb7252.i, %bb7243.i, %bb7192.i, %bb7149.i, %bb7119.i, %bb7075.i, %bb6942.i, %bb6861.i, %bb6845.i, %bb6815.i, %bb6811.i, %bb6778.i, %bb6774.i, %bb6741.i, %bb6651.i, %bb6551.i, %bb6471.i, %bb6317.i, %bb6245.i, %bb6239.i, %bb6166.i, %bb6123.i, %bb6119.i, %bb6086.i, %bb6082.i, %bb6049.i, %bb6045.i, %bb6012.i, %bb5920.i, %bb5845.i, %bb5772.i, %bb5692.i, %bb5602.i
- switch i32 0, label %bb8668.i [
- i32 0, label %bb8436.i
- i32 1, label %bb8531.i
- i32 2, label %bb8531.i
- ]
-bb8436.i: ; preds = %bb8434.i
- switch i32 0, label %bb9310.i [
- i32 4, label %bb8465.i
- i32 8, label %bb8465.i
- i32 11, label %bb8465.i
- i32 3, label %bb9301.i
- ]
-bb8465.i: ; preds = %bb8436.i, %bb8436.i, %bb8436.i
- switch i32 0, label %bb9310.i [
- i32 4, label %bb8490.i
- i32 8, label %bb8490.i
- i32 3, label %bb9301.i
- i32 11, label %bb9153.i
- ]
-bb8490.i: ; preds = %bb8465.i, %bb8465.i
- switch i32 0, label %bb9310.i [
- i32 4, label %bb8518.i
- i32 8, label %bb8513.i
- i32 3, label %bb9301.i
- i32 11, label %bb9153.i
- ]
-bb8513.i: ; preds = %bb8490.i
- br i1 false, label %bb8518.i, label %bb8668.i
-bb8518.i: ; preds = %bb8513.i, %bb8490.i
- switch i32 0, label %bb9310.i [
- i32 3, label %bb9301.i
- i32 4, label %bb8670.i
- i32 8, label %bb9112.i
- i32 11, label %bb9153.i
- ]
-bb8531.i: ; preds = %bb8434.i, %bb8434.i
- br i1 false, label %bb8536.i, label %bb8575.i
-bb8536.i: ; preds = %bb8531.i
- br i1 false, label %bb8557.i, label %bb8588.i
-bb8557.i: ; preds = %bb8536.i
- switch i32 0, label %bb9310.i [
- i32 4, label %bb8600.i
- i32 8, label %bb8600.i
- i32 3, label %bb9301.i
- i32 11, label %bb9153.i
- ]
-bb8575.i: ; preds = %bb8531.i
- br label %bb8588.i
-bb8588.i: ; preds = %bb8575.i, %bb8536.i
- switch i32 0, label %bb9310.i [
- i32 4, label %bb8600.i
- i32 8, label %bb8600.i
- i32 3, label %bb9301.i
- i32 11, label %bb9153.i
- ]
-bb8600.i: ; preds = %bb8588.i, %bb8588.i, %bb8557.i, %bb8557.i
- switch i32 0, label %bb9310.i [
- i32 4, label %bb8629.i
- i32 3, label %bb9301.i
- i32 8, label %bb9112.i
- i32 11, label %bb9153.i
- ]
-bb8629.i: ; preds = %bb8600.i
- br i1 false, label %bb8650.i, label %bb8668.i
-bb8650.i: ; preds = %bb8629.i
- br label %bb8668.i
-bb8668.i: ; preds = %bb8650.i, %bb8629.i, %bb8513.i, %bb8434.i, %bb8428.i, %bb8347.i, %bb8339.i, %bb8251.i, %bb8239.i, %bb8223.i, %bb8215.i, %bb8159.i, %bb8084.i, %bb8075.i, %bb7997.i, %bb7986.i, %bb7970.i, %bb7962.i, %bb7906.i, %bb7831.i, %bb7822.i, %bb7744.i, %bb7733.i, %bb7717.i, %bb7709.i, %bb7630.i, %bb7555.i, %bb7549.i, %bb7471.i, %bb7463.i, %bb7447.i, %bb7369.i, %bb7339.i, %bb7332.i, %bb7252.i, %bb7243.i, %bb7192.i, %bb7149.i, %bb7119.i, %bb7075.i, %bb6942.i, %bb6861.i, %bb6845.i, %bb6815.i, %bb6811.i, %bb6778.i, %bb6774.i, %bb6741.i, %bb6651.i, %bb6551.i, %bb6471.i, %bb6317.i, %bb6245.i, %bb6239.i, %bb6166.i, %bb6123.i, %bb6119.i, %bb6086.i, %bb6082.i, %bb6049.i, %bb6045.i, %bb6012.i, %bb5920.i, %bb5845.i, %bb5772.i, %bb5692.i, %bb5602.i
- switch i32 0, label %bb9310.i [
- i32 3, label %bb9301.i
- i32 4, label %bb8670.i
- i32 8, label %bb9112.i
- i32 11, label %bb9153.i
- ]
-bb8670.i: ; preds = %bb8668.i, %bb8518.i
- br label %bb9310.i
-bb9112.i: ; preds = %bb8668.i, %bb8600.i, %bb8518.i
- br label %bb9310.i
-bb9153.i: ; preds = %bb8668.i, %bb8600.i, %bb8588.i, %bb8557.i, %bb8518.i, %bb8490.i, %bb8465.i
- br label %bb9310.i
-bb9301.i: ; preds = %bb8668.i, %bb8600.i, %bb8588.i, %bb8557.i, %bb8518.i, %bb8490.i, %bb8465.i, %bb8436.i
- br label %bb9310.i
-bb9310.i: ; preds = %bb9301.i, %bb9153.i, %bb9112.i, %bb8670.i, %bb8668.i, %bb8600.i, %bb8588.i, %bb8557.i, %bb8518.i, %bb8490.i, %bb8465.i, %bb8436.i
- br i1 false, label %bb16581.i, label %bb9313.i
-bb9313.i: ; preds = %bb9310.i
- switch i32 %dt4080.0.i, label %bb16578.i [
- i32 0, label %bb9315.i
- i32 1, label %bb9890.i
- i32 2, label %bb10465.i
- i32 3, label %bb11040.i
- i32 4, label %bb11615.i
- i32 5, label %bb11823.i
- i32 8, label %bb12398.i
- i32 9, label %bb12833.i
- i32 10, label %bb13268.i
- i32 11, label %bb13268.i
- i32 12, label %bb13703.i
- i32 13, label %bb13703.i
- i32 14, label %bb14278.i
- i32 15, label %bb14853.i
- i32 16, label %bb9315.i
- i32 17, label %bb9315.i
- i32 18, label %bb15428.i
- i32 19, label %bb16003.i
- ]
-bb9315.i: ; preds = %bb9313.i, %bb9313.i, %bb9313.i
- br i1 false, label %bb9535.i, label %bb9323.i
-bb9323.i: ; preds = %bb9315.i
- br label %bb9535.i
-bb9535.i: ; preds = %bb9323.i, %bb9315.i
- br label %bb16581.i
-bb9890.i: ; preds = %bb9313.i
- br i1 false, label %bb10255.i, label %bb9898.i
-bb9898.i: ; preds = %bb9890.i
- br label %bb10255.i
-bb10255.i: ; preds = %bb9898.i, %bb9890.i
- br label %bb16581.i
-bb10465.i: ; preds = %bb9313.i
- br i1 false, label %bb10685.i, label %bb10473.i
-bb10473.i: ; preds = %bb10465.i
- br label %bb10685.i
-bb10685.i: ; preds = %bb10473.i, %bb10465.i
- br label %bb16581.i
-bb11040.i: ; preds = %bb9313.i
- br i1 false, label %bb11405.i, label %bb11048.i
-bb11048.i: ; preds = %bb11040.i
- br label %bb11405.i
-bb11405.i: ; preds = %bb11048.i, %bb11040.i
- br label %bb16581.i
-bb11615.i: ; preds = %bb9313.i
- br i1 false, label %bb16581.i, label %bb11618.i
-bb11618.i: ; preds = %bb11615.i
- br label %bb16581.i
-bb11823.i: ; preds = %bb9313.i
- br i1 false, label %bb12188.i, label %bb11831.i
-bb11831.i: ; preds = %bb11823.i
- br label %bb12188.i
-bb12188.i: ; preds = %bb11831.i, %bb11823.i
- br label %bb16581.i
-bb12398.i: ; preds = %bb9313.i
- br i1 false, label %bb12566.i, label %bb12406.i
-bb12406.i: ; preds = %bb12398.i
- br label %bb12566.i
-bb12566.i: ; preds = %bb12406.i, %bb12398.i
- br label %bb16581.i
-bb12833.i: ; preds = %bb9313.i
- br i1 false, label %bb13001.i, label %bb12841.i
-bb12841.i: ; preds = %bb12833.i
- br label %bb13001.i
-bb13001.i: ; preds = %bb12841.i, %bb12833.i
- br label %bb16581.i
-bb13268.i: ; preds = %bb9313.i, %bb9313.i
- br i1 false, label %bb13436.i, label %bb13276.i
-bb13276.i: ; preds = %bb13268.i
- br label %bb13436.i
-bb13436.i: ; preds = %bb13276.i, %bb13268.i
- br label %bb16581.i
-bb13703.i: ; preds = %bb9313.i, %bb9313.i
- br i1 false, label %bb13923.i, label %bb13711.i
-bb13711.i: ; preds = %bb13703.i
- br label %bb13923.i
-bb13923.i: ; preds = %bb13711.i, %bb13703.i
- br label %bb16581.i
-bb14278.i: ; preds = %bb9313.i
- br i1 false, label %bb14498.i, label %bb14286.i
-bb14286.i: ; preds = %bb14278.i
- br label %bb14498.i
-bb14498.i: ; preds = %bb14286.i, %bb14278.i
- br label %bb16581.i
-bb14853.i: ; preds = %bb9313.i
- br i1 false, label %bb15073.i, label %bb14861.i
-bb14861.i: ; preds = %bb14853.i
- br label %bb15073.i
-bb15073.i: ; preds = %bb14861.i, %bb14853.i
- br label %bb16581.i
-bb15428.i: ; preds = %bb9313.i
- br i1 false, label %bb15648.i, label %bb15436.i
-bb15436.i: ; preds = %bb15428.i
- br label %bb15648.i
-bb15648.i: ; preds = %bb15436.i, %bb15428.i
- br label %bb16581.i
-bb16003.i: ; preds = %bb9313.i
- br i1 false, label %bb16223.i, label %bb16011.i
-bb16011.i: ; preds = %bb16003.i
- br label %bb16223.i
-bb16223.i: ; preds = %bb16011.i, %bb16003.i
- br label %bb16581.i
-bb16578.i: ; preds = %bb9313.i
- unreachable
-bb16581.i: ; preds = %bb16223.i, %bb15648.i, %bb15073.i, %bb14498.i, %bb13923.i, %bb13436.i, %bb13001.i, %bb12566.i, %bb12188.i, %bb11618.i, %bb11615.i, %bb11405.i, %bb10685.i, %bb10255.i, %bb9535.i, %bb9310.i, %glgVectorFloatConversion.exit
- br label %storeVecColor_RGB_UI.exit
-storeVecColor_RGB_UI.exit: ; preds = %bb16581.i
- br i1 false, label %bb5295.i, label %bb16621.i
-bb16607.i: ; preds = %bb5276.i
- br i1 false, label %bb5295.preheader.i, label %bb16621.i
-bb5295.preheader.i: ; preds = %bb16607.i
- br label %bb5295.i
-bb16621.i: ; preds = %bb16607.i, %storeVecColor_RGB_UI.exit
- br label %bb16650.outer.i
-bb16650.outer.i: ; preds = %bb16621.i
- br label %bb16650.i
-bb16650.i: ; preds = %storeColor_RGB_UI.exit, %bb16650.outer.i
- br label %loadColor_BGRA_UI8888R.exit
-loadColor_BGRA_UI8888R.exit: ; preds = %bb16650.i
- br i1 false, label %bb16671.i, label %bb16697.i
-bb16671.i: ; preds = %loadColor_BGRA_UI8888R.exit
- br i1 false, label %bb.i179, label %bb662.i
-bb.i179: ; preds = %bb16671.i
- switch i32 0, label %bb513.i [
- i32 7, label %bb418.i
- i32 6, label %bb433.i
- ]
-bb418.i: ; preds = %bb.i179
- br label %bb559.i
-bb433.i: ; preds = %bb.i179
- switch i32 0, label %bb493.i [
- i32 31744, label %bb455.i
- i32 0, label %bb471.i
- ]
-bb455.i: ; preds = %bb433.i
- br i1 false, label %bb463.i, label %bb504.i
-bb463.i: ; preds = %bb455.i
- br label %bb559.i
-bb471.i: ; preds = %bb433.i
- br i1 false, label %bb497.i, label %bb484.preheader.i
-bb484.preheader.i: ; preds = %bb471.i
- br i1 false, label %bb479.i, label %bb490.i
-bb479.i: ; preds = %bb479.i, %bb484.preheader.i
- br i1 false, label %bb479.i, label %bb490.i
-bb490.i: ; preds = %bb479.i, %bb484.preheader.i
- br label %bb559.i
-bb493.i: ; preds = %bb433.i
- br label %bb497.i
-bb497.i: ; preds = %bb493.i, %bb471.i
- br label %bb504.i
-bb504.i: ; preds = %bb497.i, %bb455.i
- br label %bb513.i
-bb513.i: ; preds = %bb504.i, %bb.i179
- br label %bb559.i
-bb559.i: ; preds = %bb513.i, %bb490.i, %bb463.i, %bb418.i
- br i1 false, label %bb2793.i, label %bb614.i
-bb614.i: ; preds = %bb559.i
- br i1 false, label %bb626.i, label %bb620.i
-bb620.i: ; preds = %bb614.i
- br i1 false, label %bb625.i, label %bb626.i
-bb625.i: ; preds = %bb620.i
- br label %bb626.i
-bb626.i: ; preds = %bb625.i, %bb620.i, %bb614.i
- br i1 false, label %bb638.i, label %bb632.i
-bb632.i: ; preds = %bb626.i
- br i1 false, label %bb637.i, label %bb638.i
-bb637.i: ; preds = %bb632.i
- br label %bb638.i
-bb638.i: ; preds = %bb637.i, %bb632.i, %bb626.i
- br i1 false, label %bb650.i, label %bb644.i
-bb644.i: ; preds = %bb638.i
- br i1 false, label %bb649.i, label %bb650.i
-bb649.i: ; preds = %bb644.i
- br label %bb650.i
-bb650.i: ; preds = %bb649.i, %bb644.i, %bb638.i
- br i1 false, label %bb2793.i, label %bb656.i
-bb656.i: ; preds = %bb650.i
- br i1 false, label %bb661.i, label %bb2793.i
-bb661.i: ; preds = %bb656.i
- switch i32 0, label %bb2883.i [
- i32 3, label %bb2874.i
- i32 4, label %bb2795.i
- i32 8, label %bb2810.i
- i32 10, label %bb2834.i
- i32 11, label %bb2819.i
- i32 16, label %bb2810.i
- ]
-bb662.i: ; preds = %bb16671.i
- switch i32 0, label %bb1937.i [
- i32 3, label %bb902.i
- i32 4, label %bb1416.i
- i32 8, label %bb1020.i
- i32 10, label %bb902.i
- i32 11, label %bb784.i
- i32 16, label %bb664.i
- ]
-bb664.i: ; preds = %bb662.i
- br i1 false, label %bb682.i, label %bb669.i
-bb669.i: ; preds = %bb664.i
- br label %bb710.i
-bb682.i: ; preds = %bb664.i
- br label %bb710.i
-bb710.i: ; preds = %bb682.i, %bb669.i
- br i1 false, label %bb760.i, label %bb754.i
-bb754.i: ; preds = %bb710.i
- br i1 false, label %bb759.i, label %bb760.i
-bb759.i: ; preds = %bb754.i
- br label %bb760.i
-bb760.i: ; preds = %bb759.i, %bb754.i, %bb710.i
- br i1 false, label %bb772.i, label %bb766.i
-bb766.i: ; preds = %bb760.i
- br i1 false, label %bb771.i, label %bb772.i
-bb771.i: ; preds = %bb766.i
- br label %bb772.i
-bb772.i: ; preds = %bb771.i, %bb766.i, %bb760.i
- br i1 false, label %bb1937.i, label %bb778.i
-bb778.i: ; preds = %bb772.i
- br i1 false, label %bb783.i, label %bb1937.i
-bb783.i: ; preds = %bb778.i
- br label %bb1937.i
-bb784.i: ; preds = %bb662.i
- switch i32 0, label %bb892.i [
- i32 1, label %bb868.i
- i32 3, label %bb868.i
- i32 4, label %bb882.i
- i32 6, label %bb792.i
- i32 7, label %bb786.i
- ]
-bb786.i: ; preds = %bb784.i
- br label %bb904.i
-bb792.i: ; preds = %bb784.i
- switch i32 0, label %bb852.i [
- i32 31744, label %bb814.i
- i32 0, label %bb830.i
- ]
-bb814.i: ; preds = %bb792.i
- br i1 false, label %bb822.i, label %bb863.i
-bb822.i: ; preds = %bb814.i
- switch i32 0, label %bb1010.i [
- i32 1, label %bb986.i
- i32 3, label %bb986.i
- i32 4, label %bb1000.i
- i32 6, label %bb910.i
- i32 7, label %bb904.i
- ]
-bb830.i: ; preds = %bb792.i
- br i1 false, label %bb856.i, label %bb843.preheader.i
-bb843.preheader.i: ; preds = %bb830.i
- br i1 false, label %bb838.i, label %bb849.i
-bb838.i: ; preds = %bb838.i, %bb843.preheader.i
- br i1 false, label %bb838.i, label %bb849.i
-bb849.i: ; preds = %bb838.i, %bb843.preheader.i
- switch i32 0, label %bb1010.i [
- i32 1, label %bb986.i
- i32 3, label %bb986.i
- i32 4, label %bb1000.i
- i32 6, label %bb910.i
- i32 7, label %bb904.i
- ]
-bb852.i: ; preds = %bb792.i
- br label %bb856.i
-bb856.i: ; preds = %bb852.i, %bb830.i
- switch i32 0, label %bb1010.i [
- i32 1, label %bb986.i
- i32 3, label %bb986.i
- i32 4, label %bb1000.i
- i32 6, label %bb910.i
- i32 7, label %bb904.i
- ]
-bb863.i: ; preds = %bb814.i
- switch i32 0, label %bb1010.i [
- i32 1, label %bb986.i
- i32 3, label %bb986.i
- i32 4, label %bb1000.i
- i32 6, label %bb910.i
- i32 7, label %bb904.i
- ]
-bb868.i: ; preds = %bb784.i, %bb784.i
- switch i32 0, label %bb1010.i [
- i32 1, label %bb986.i
- i32 3, label %bb986.i
- i32 4, label %bb1000.i
- i32 6, label %bb910.i
- i32 7, label %bb904.i
- ]
-bb882.i: ; preds = %bb784.i
- br label %bb1000.i
-bb892.i: ; preds = %bb784.i
- br label %bb902.i
-bb902.i: ; preds = %bb892.i, %bb662.i, %bb662.i
- switch i32 0, label %bb1010.i [
- i32 1, label %bb986.i
- i32 3, label %bb986.i
- i32 4, label %bb1000.i
- i32 6, label %bb910.i
- i32 7, label %bb904.i
- ]
-bb904.i: ; preds = %bb902.i, %bb868.i, %bb863.i, %bb856.i, %bb849.i, %bb822.i, %bb786.i
- br label %bb1937.i
-bb910.i: ; preds = %bb902.i, %bb868.i, %bb863.i, %bb856.i, %bb849.i, %bb822.i
- switch i32 0, label %bb970.i [
- i32 31744, label %bb932.i
- i32 0, label %bb948.i
- ]
-bb932.i: ; preds = %bb910.i
- br i1 false, label %bb940.i, label %bb981.i
-bb940.i: ; preds = %bb932.i
- br label %bb1937.i
-bb948.i: ; preds = %bb910.i
- br i1 false, label %bb974.i, label %bb961.preheader.i
-bb961.preheader.i: ; preds = %bb948.i
- br i1 false, label %bb956.i, label %bb967.i
-bb956.i: ; preds = %bb956.i, %bb961.preheader.i
- br i1 false, label %bb956.i, label %bb967.i
-bb967.i: ; preds = %bb956.i, %bb961.preheader.i
- br label %bb1937.i
-bb970.i: ; preds = %bb910.i
- br label %bb974.i
-bb974.i: ; preds = %bb970.i, %bb948.i
- br label %bb1937.i
-bb981.i: ; preds = %bb932.i
- br label %bb1937.i
-bb986.i: ; preds = %bb902.i, %bb902.i, %bb868.i, %bb868.i, %bb863.i, %bb863.i, %bb856.i, %bb856.i, %bb849.i, %bb849.i, %bb822.i, %bb822.i
- br label %bb1937.i
-bb1000.i: ; preds = %bb902.i, %bb882.i, %bb868.i, %bb863.i, %bb856.i, %bb849.i, %bb822.i
- br label %bb1937.i
-bb1010.i: ; preds = %bb902.i, %bb868.i, %bb863.i, %bb856.i, %bb849.i, %bb822.i
- br label %bb1937.i
-bb1020.i: ; preds = %bb662.i
- switch i32 0, label %bb1388.i [
- i32 1, label %bb1264.i
- i32 3, label %bb1264.i
- i32 4, label %bb1304.i
- i32 6, label %bb1038.i
- i32 7, label %bb1022.i
- i32 8, label %bb1332.i
- i32 9, label %bb1332.i
- i32 10, label %bb1360.i
- i32 11, label %bb1360.i
- ]
-bb1022.i: ; preds = %bb1020.i
- br label %bb1937.i
-bb1038.i: ; preds = %bb1020.i
- switch i32 0, label %bb1098.i [
- i32 31744, label %bb1060.i
- i32 0, label %bb1076.i
- ]
-bb1060.i: ; preds = %bb1038.i
- br i1 false, label %bb1068.i, label %bb1109.i
-bb1068.i: ; preds = %bb1060.i
- br label %bb1109.i
-bb1076.i: ; preds = %bb1038.i
- br i1 false, label %bb1102.i, label %bb1089.preheader.i
-bb1089.preheader.i: ; preds = %bb1076.i
- br i1 false, label %bb1084.i, label %bb1095.i
-bb1084.i: ; preds = %bb1084.i, %bb1089.preheader.i
- br i1 false, label %bb1084.i, label %bb1095.i
-bb1095.i: ; preds = %bb1084.i, %bb1089.preheader.i
- br label %bb1109.i
-bb1098.i: ; preds = %bb1038.i
- br label %bb1102.i
-bb1102.i: ; preds = %bb1098.i, %bb1076.i
- br label %bb1109.i
-bb1109.i: ; preds = %bb1102.i, %bb1095.i, %bb1068.i, %bb1060.i
- switch i32 0, label %bb1173.i [
- i32 31744, label %bb1135.i
- i32 0, label %bb1151.i
- ]
-bb1135.i: ; preds = %bb1109.i
- br i1 false, label %bb1143.i, label %bb1184.i
-bb1143.i: ; preds = %bb1135.i
- br label %bb1184.i
-bb1151.i: ; preds = %bb1109.i
- br i1 false, label %bb1177.i, label %bb1164.preheader.i
-bb1164.preheader.i: ; preds = %bb1151.i
- br i1 false, label %bb1159.i, label %bb1170.i
-bb1159.i: ; preds = %bb1159.i, %bb1164.preheader.i
- br i1 false, label %bb1159.i, label %bb1170.i
-bb1170.i: ; preds = %bb1159.i, %bb1164.preheader.i
- br label %bb1184.i
-bb1173.i: ; preds = %bb1109.i
- br label %bb1177.i
-bb1177.i: ; preds = %bb1173.i, %bb1151.i
- br label %bb1184.i
-bb1184.i: ; preds = %bb1177.i, %bb1170.i, %bb1143.i, %bb1135.i
- switch i32 0, label %bb1248.i [
- i32 31744, label %bb1210.i
- i32 0, label %bb1226.i
- ]
-bb1210.i: ; preds = %bb1184.i
- br i1 false, label %bb1218.i, label %bb1259.i
-bb1218.i: ; preds = %bb1210.i
- br label %bb1937.i
-bb1226.i: ; preds = %bb1184.i
- br i1 false, label %bb1252.i, label %bb1239.preheader.i
-bb1239.preheader.i: ; preds = %bb1226.i
- br i1 false, label %bb1234.i, label %bb1245.i
-bb1234.i: ; preds = %bb1234.i, %bb1239.preheader.i
- br i1 false, label %bb1234.i, label %bb1245.i
-bb1245.i: ; preds = %bb1234.i, %bb1239.preheader.i
- br label %bb1937.i
-bb1248.i: ; preds = %bb1184.i
- br label %bb1252.i
-bb1252.i: ; preds = %bb1248.i, %bb1226.i
- br label %bb1937.i
-bb1259.i: ; preds = %bb1210.i
- br label %bb1937.i
-bb1264.i: ; preds = %bb1020.i, %bb1020.i
- br label %bb1937.i
-bb1304.i: ; preds = %bb1020.i
- br label %bb1937.i
-bb1332.i: ; preds = %bb1020.i, %bb1020.i
- br label %bb1937.i
-bb1360.i: ; preds = %bb1020.i, %bb1020.i
- br label %bb1937.i
-bb1388.i: ; preds = %bb1020.i
- br label %bb1937.i
-bb1416.i: ; preds = %bb662.i
- switch i32 0, label %bb1900.i [
- i32 1, label %bb1740.i
- i32 3, label %bb1740.i
- i32 4, label %bb1793.i
- i32 6, label %bb1439.i
- i32 7, label %bb1418.i
- i32 14, label %bb1830.i
- i32 15, label %bb1830.i
- i32 18, label %bb1863.i
- i32 19, label %bb1863.i
- ]
-bb1418.i: ; preds = %bb1416.i
- br label %bb1937.i
-bb1439.i: ; preds = %bb1416.i
- switch i32 0, label %bb1499.i [
- i32 31744, label %bb1461.i
- i32 0, label %bb1477.i
- ]
-bb1461.i: ; preds = %bb1439.i
- br i1 false, label %bb1469.i, label %bb1510.i
-bb1469.i: ; preds = %bb1461.i
- br label %bb1510.i
-bb1477.i: ; preds = %bb1439.i
- br i1 false, label %bb1503.i, label %bb1490.preheader.i
-bb1490.preheader.i: ; preds = %bb1477.i
- br i1 false, label %bb1485.i, label %bb1496.i
-bb1485.i: ; preds = %bb1485.i, %bb1490.preheader.i
- br i1 false, label %bb1485.i, label %bb1496.i
-bb1496.i: ; preds = %bb1485.i, %bb1490.preheader.i
- br label %bb1510.i
-bb1499.i: ; preds = %bb1439.i
- br label %bb1503.i
-bb1503.i: ; preds = %bb1499.i, %bb1477.i
- br label %bb1510.i
-bb1510.i: ; preds = %bb1503.i, %bb1496.i, %bb1469.i, %bb1461.i
- switch i32 0, label %bb1574.i [
- i32 31744, label %bb1536.i
- i32 0, label %bb1552.i
- ]
-bb1536.i: ; preds = %bb1510.i
- br i1 false, label %bb1544.i, label %bb1585.i
-bb1544.i: ; preds = %bb1536.i
- br label %bb1585.i
-bb1552.i: ; preds = %bb1510.i
- br i1 false, label %bb1578.i, label %bb1565.preheader.i
-bb1565.preheader.i: ; preds = %bb1552.i
- br i1 false, label %bb1560.i, label %bb1571.i
-bb1560.i: ; preds = %bb1560.i, %bb1565.preheader.i
- br i1 false, label %bb1560.i, label %bb1571.i
-bb1571.i: ; preds = %bb1560.i, %bb1565.preheader.i
- br label %bb1585.i
-bb1574.i: ; preds = %bb1510.i
- br label %bb1578.i
-bb1578.i: ; preds = %bb1574.i, %bb1552.i
- br label %bb1585.i
-bb1585.i: ; preds = %bb1578.i, %bb1571.i, %bb1544.i, %bb1536.i
- switch i32 0, label %bb1649.i [
- i32 31744, label %bb1611.i
- i32 0, label %bb1627.i
- ]
-bb1611.i: ; preds = %bb1585.i
- br i1 false, label %bb1619.i, label %bb1660.i
-bb1619.i: ; preds = %bb1611.i
- br label %bb1660.i
-bb1627.i: ; preds = %bb1585.i
- br i1 false, label %bb1653.i, label %bb1640.preheader.i
-bb1640.preheader.i: ; preds = %bb1627.i
- br i1 false, label %bb1635.i, label %bb1646.i
-bb1635.i: ; preds = %bb1635.i, %bb1640.preheader.i
- br i1 false, label %bb1635.i, label %bb1646.i
-bb1646.i: ; preds = %bb1635.i, %bb1640.preheader.i
- br label %bb1660.i
-bb1649.i: ; preds = %bb1585.i
- br label %bb1653.i
-bb1653.i: ; preds = %bb1649.i, %bb1627.i
- br label %bb1660.i
-bb1660.i: ; preds = %bb1653.i, %bb1646.i, %bb1619.i, %bb1611.i
- switch i32 0, label %bb1724.i [
- i32 31744, label %bb1686.i
- i32 0, label %bb1702.i
- ]
-bb1686.i: ; preds = %bb1660.i
- br i1 false, label %bb1694.i, label %bb1735.i
-bb1694.i: ; preds = %bb1686.i
- br label %bb1937.i
-bb1702.i: ; preds = %bb1660.i
- br i1 false, label %bb1728.i, label %bb1715.preheader.i
-bb1715.preheader.i: ; preds = %bb1702.i
- br i1 false, label %bb1710.i, label %bb1721.i
-bb1710.i: ; preds = %bb1710.i, %bb1715.preheader.i
- br i1 false, label %bb1710.i, label %bb1721.i
-bb1721.i: ; preds = %bb1710.i, %bb1715.preheader.i
- br label %bb1937.i
-bb1724.i: ; preds = %bb1660.i
- br label %bb1728.i
-bb1728.i: ; preds = %bb1724.i, %bb1702.i
- br label %bb1937.i
-bb1735.i: ; preds = %bb1686.i
- br label %bb1937.i
-bb1740.i: ; preds = %bb1416.i, %bb1416.i
- br label %bb1937.i
-bb1793.i: ; preds = %bb1416.i
- br label %bb1937.i
-bb1830.i: ; preds = %bb1416.i, %bb1416.i
- br label %bb1937.i
-bb1863.i: ; preds = %bb1416.i, %bb1416.i
- br label %bb1937.i
-bb1900.i: ; preds = %bb1416.i
- br label %bb1937.i
-bb1937.i: ; preds = %bb1900.i, %bb1863.i, %bb1830.i, %bb1793.i, %bb1740.i, %bb1735.i, %bb1728.i, %bb1721.i, %bb1694.i, %bb1418.i, %bb1388.i, %bb1360.i, %bb1332.i, %bb1304.i, %bb1264.i, %bb1259.i, %bb1252.i, %bb1245.i, %bb1218.i, %bb1022.i, %bb1010.i, %bb1000.i, %bb986.i, %bb981.i, %bb974.i, %bb967.i, %bb940.i, %bb904.i, %bb783.i, %bb778.i, %bb772.i, %bb662.i
- switch i32 %sf4083.0.i, label %bb2321.i [
- i32 0, label %bb2027.i
- i32 1, label %bb2081.i
- i32 2, label %bb2161.i
- i32 3, label %bb2241.i
- i32 8, label %bb1939.i
- i32 9, label %bb1939.i
- i32 10, label %bb1957.i
- i32 11, label %bb1975.i
- i32 16, label %bb1939.i
- ]
-bb1939.i: ; preds = %bb1937.i, %bb1937.i, %bb1937.i
- switch i32 0, label %bb2321.i [
- i32 3, label %bb1956.i
- i32 4, label %bb1956.i
- i32 11, label %bb1956.i
- ]
-bb1956.i: ; preds = %bb1939.i, %bb1939.i, %bb1939.i
- br label %bb2337.i
-bb1957.i: ; preds = %bb1937.i
- switch i32 0, label %bb1975.i [
- i32 3, label %bb1974.i
- i32 4, label %bb1974.i
- i32 11, label %bb1974.i
- ]
-bb1974.i: ; preds = %bb1957.i, %bb1957.i, %bb1957.i
- br label %bb1975.i
-bb1975.i: ; preds = %bb1974.i, %bb1957.i, %bb1937.i
- switch i32 0, label %bb2001.i [
- i32 1, label %bb1992.i
- i32 4, label %bb1992.i
- i32 8, label %bb1992.i
- ]
-bb1992.i: ; preds = %bb1975.i, %bb1975.i, %bb1975.i
- br label %bb2001.i
-bb2001.i: ; preds = %bb1992.i, %bb1975.i
- switch i32 0, label %bb2321.i [
- i32 2, label %bb2018.i
- i32 4, label %bb2018.i
- i32 8, label %bb2018.i
- ]
-bb2018.i: ; preds = %bb2001.i, %bb2001.i, %bb2001.i
- br label %bb2321.i
-bb2027.i: ; preds = %bb1937.i
- switch i32 0, label %bb2045.i [
- i32 1, label %bb2044.i
- i32 4, label %bb2044.i
- i32 8, label %bb2044.i
- ]
-bb2044.i: ; preds = %bb2027.i, %bb2027.i, %bb2027.i
- br label %bb2045.i
-bb2045.i: ; preds = %bb2044.i, %bb2027.i
- switch i32 0, label %bb2063.i [
- i32 2, label %bb2062.i
- i32 4, label %bb2062.i
- i32 8, label %bb2062.i
- ]
-bb2062.i: ; preds = %bb2045.i, %bb2045.i, %bb2045.i
- br label %bb2063.i
-bb2063.i: ; preds = %bb2062.i, %bb2045.i
- switch i32 0, label %bb2321.i [
- i32 3, label %bb2080.i
- i32 4, label %bb2080.i
- i32 11, label %bb2080.i
- ]
-bb2080.i: ; preds = %bb2063.i, %bb2063.i, %bb2063.i
- br label %bb2321.i
-bb2081.i: ; preds = %bb1937.i
- switch i32 0, label %bb2100.i [
- i32 1, label %bb2098.i
- i32 4, label %bb2098.i
- i32 8, label %bb2098.i
- ]
-bb2098.i: ; preds = %bb2081.i, %bb2081.i, %bb2081.i
- br label %bb2100.i
-bb2100.i: ; preds = %bb2098.i, %bb2081.i
- switch i32 0, label %bb2125.i [
- i32 4, label %bb2124.i
- i32 8, label %bb2124.i
- i32 0, label %bb2124.i
- i32 11, label %bb2124.i
- ]
-bb2124.i: ; preds = %bb2100.i, %bb2100.i, %bb2100.i, %bb2100.i
- br label %bb2125.i
-bb2125.i: ; preds = %bb2124.i, %bb2100.i
- switch i32 0, label %bb2143.i [
- i32 2, label %bb2142.i
- i32 4, label %bb2142.i
- i32 8, label %bb2142.i
- ]
-bb2142.i: ; preds = %bb2125.i, %bb2125.i, %bb2125.i
- br label %bb2143.i
-bb2143.i: ; preds = %bb2142.i, %bb2125.i
- switch i32 0, label %bb2321.i [
- i32 3, label %bb2160.i
- i32 4, label %bb2160.i
- i32 11, label %bb2160.i
- ]
-bb2160.i: ; preds = %bb2143.i, %bb2143.i, %bb2143.i
- br label %bb2321.i
-bb2161.i: ; preds = %bb1937.i
- switch i32 0, label %bb2180.i [
- i32 2, label %bb2178.i
- i32 4, label %bb2178.i
- i32 8, label %bb2178.i
- ]
-bb2178.i: ; preds = %bb2161.i, %bb2161.i, %bb2161.i
- br label %bb2180.i
-bb2180.i: ; preds = %bb2178.i, %bb2161.i
- switch i32 0, label %bb2205.i [
- i32 4, label %bb2204.i
- i32 8, label %bb2204.i
- i32 0, label %bb2204.i
- i32 11, label %bb2204.i
- ]
-bb2204.i: ; preds = %bb2180.i, %bb2180.i, %bb2180.i, %bb2180.i
- br label %bb2205.i
-bb2205.i: ; preds = %bb2204.i, %bb2180.i
- switch i32 0, label %bb2223.i [
- i32 1, label %bb2222.i
- i32 4, label %bb2222.i
- i32 8, label %bb2222.i
- ]
-bb2222.i: ; preds = %bb2205.i, %bb2205.i, %bb2205.i
- br label %bb2223.i
-bb2223.i: ; preds = %bb2222.i, %bb2205.i
- switch i32 0, label %bb2321.i [
- i32 3, label %bb2240.i
- i32 4, label %bb2240.i
- i32 11, label %bb2240.i
- ]
-bb2240.i: ; preds = %bb2223.i, %bb2223.i, %bb2223.i
- br label %bb2321.i
-bb2241.i: ; preds = %bb1937.i
- switch i32 0, label %bb2260.i [
- i32 3, label %bb2258.i
- i32 4, label %bb2258.i
- i32 11, label %bb2258.i
- ]
-bb2258.i: ; preds = %bb2241.i, %bb2241.i, %bb2241.i
- br label %bb2260.i
-bb2260.i: ; preds = %bb2258.i, %bb2241.i
- switch i32 0, label %bb2285.i [
- i32 4, label %bb2284.i
- i32 11, label %bb2284.i
- i32 0, label %bb2284.i
- i32 8, label %bb2284.i
- ]
-bb2284.i: ; preds = %bb2260.i, %bb2260.i, %bb2260.i, %bb2260.i
- br label %bb2285.i
-bb2285.i: ; preds = %bb2284.i, %bb2260.i
- switch i32 0, label %bb2303.i [
- i32 1, label %bb2302.i
- i32 4, label %bb2302.i
- i32 8, label %bb2302.i
- ]
-bb2302.i: ; preds = %bb2285.i, %bb2285.i, %bb2285.i
- br label %bb2303.i
-bb2303.i: ; preds = %bb2302.i, %bb2285.i
- switch i32 0, label %bb2321.i [
- i32 2, label %bb2320.i
- i32 4, label %bb2320.i
- i32 8, label %bb2320.i
- ]
-bb2320.i: ; preds = %bb2303.i, %bb2303.i, %bb2303.i
- br label %bb2321.i
-bb2321.i: ; preds = %bb2320.i, %bb2303.i, %bb2240.i, %bb2223.i, %bb2160.i, %bb2143.i, %bb2080.i, %bb2063.i, %bb2018.i, %bb2001.i, %bb1939.i, %bb1937.i
- br label %bb2337.i
-bb2337.i: ; preds = %bb2321.i, %bb1956.i
- br label %bb2353.i
-bb2353.i: ; preds = %bb2337.i
- br label %bb2369.i
-bb2369.i: ; preds = %bb2353.i
- br label %bb2385.i
-bb2385.i: ; preds = %bb2369.i
- br i1 false, label %bb2388.i, label %bb2394.i
-bb2388.i: ; preds = %bb2385.i
- br label %bb2600.i
-bb2394.i: ; preds = %bb2385.i
- switch i32 0, label %bb2600.i [
- i32 0, label %bb2504.i
- i32 1, label %bb2528.i
- i32 2, label %bb2552.i
- i32 3, label %bb2576.i
- i32 4, label %bb2396.i
- i32 8, label %bb2420.i
- i32 11, label %bb2480.i
- ]
-bb2396.i: ; preds = %bb2394.i
- br i1 false, label %bb2411.i, label %bb2399.i
-bb2399.i: ; preds = %bb2396.i
- br i1 false, label %bb2420.i, label %bb2405.i
-bb2405.i: ; preds = %bb2399.i
- br i1 false, label %bb2410.i, label %bb2420.i
-bb2410.i: ; preds = %bb2405.i
- br i1 false, label %bb2459.i, label %bb2423.i
-bb2411.i: ; preds = %bb2396.i
- br i1 false, label %bb2420.i, label %bb2414.i
-bb2414.i: ; preds = %bb2411.i
- br i1 false, label %bb2419.i, label %bb2420.i
-bb2419.i: ; preds = %bb2414.i
- br label %bb2420.i
-bb2420.i: ; preds = %bb2419.i, %bb2414.i, %bb2411.i, %bb2405.i, %bb2399.i, %bb2394.i
- br i1 false, label %bb2459.i, label %bb2423.i
-bb2423.i: ; preds = %bb2420.i, %bb2410.i
- br i1 false, label %bb2435.i, label %bb2429.i
-bb2429.i: ; preds = %bb2423.i
- br i1 false, label %bb2434.i, label %bb2435.i
-bb2434.i: ; preds = %bb2429.i
- br label %bb2435.i
-bb2435.i: ; preds = %bb2434.i, %bb2429.i, %bb2423.i
- br i1 false, label %bb2447.i, label %bb2441.i
-bb2441.i: ; preds = %bb2435.i
- br i1 false, label %bb2446.i, label %bb2447.i
-bb2446.i: ; preds = %bb2441.i
- br label %bb2447.i
-bb2447.i: ; preds = %bb2446.i, %bb2441.i, %bb2435.i
- br i1 false, label %bb2600.i, label %bb2453.i
-bb2453.i: ; preds = %bb2447.i
- br i1 false, label %bb2458.i, label %bb2600.i
-bb2458.i: ; preds = %bb2453.i
- br label %bb2793.i
-bb2459.i: ; preds = %bb2420.i, %bb2410.i
- br i1 false, label %bb2600.i, label %bb2462.i
-bb2462.i: ; preds = %bb2459.i
- br i1 false, label %bb2479.i, label %bb2600.i
-bb2479.i: ; preds = %bb2462.i
- br label %bb2600.i
-bb2480.i: ; preds = %bb2394.i
- br i1 false, label %bb2495.i, label %bb2483.i
-bb2483.i: ; preds = %bb2480.i
- br i1 false, label %bb2504.i, label %bb2489.i
-bb2489.i: ; preds = %bb2483.i
- br i1 false, label %bb2494.i, label %bb2504.i
-bb2494.i: ; preds = %bb2489.i
- br i1 false, label %bb2519.i, label %bb2507.i
-bb2495.i: ; preds = %bb2480.i
- br i1 false, label %bb2504.i, label %bb2498.i
-bb2498.i: ; preds = %bb2495.i
- br i1 false, label %bb2503.i, label %bb2504.i
-bb2503.i: ; preds = %bb2498.i
- br label %bb2504.i
-bb2504.i: ; preds = %bb2503.i, %bb2498.i, %bb2495.i, %bb2489.i, %bb2483.i, %bb2394.i
- br i1 false, label %bb2519.i, label %bb2507.i
-bb2507.i: ; preds = %bb2504.i, %bb2494.i
- br i1 false, label %bb2600.i, label %bb2513.i
-bb2513.i: ; preds = %bb2507.i
- br i1 false, label %bb2518.i, label %bb2600.i
-bb2518.i: ; preds = %bb2513.i
- br label %bb2600.i
-bb2519.i: ; preds = %bb2504.i, %bb2494.i
- br i1 false, label %bb2600.i, label %bb2522.i
-bb2522.i: ; preds = %bb2519.i
- br i1 false, label %bb2527.i, label %bb2600.i
-bb2527.i: ; preds = %bb2522.i
- br label %bb2600.i
-bb2528.i: ; preds = %bb2394.i
- br i1 false, label %bb2543.i, label %bb2531.i
-bb2531.i: ; preds = %bb2528.i
- br i1 false, label %bb2600.i, label %bb2537.i
-bb2537.i: ; preds = %bb2531.i
- br i1 false, label %bb2542.i, label %bb2600.i
-bb2542.i: ; preds = %bb2537.i
- br label %bb2600.i
-bb2543.i: ; preds = %bb2528.i
- br i1 false, label %bb2600.i, label %bb2546.i
-bb2546.i: ; preds = %bb2543.i
- br i1 false, label %bb2551.i, label %bb2600.i
-bb2551.i: ; preds = %bb2546.i
- br label %bb2600.i
-bb2552.i: ; preds = %bb2394.i
- br i1 false, label %bb2567.i, label %bb2555.i
-bb2555.i: ; preds = %bb2552.i
- br i1 false, label %bb2600.i, label %bb2561.i
-bb2561.i: ; preds = %bb2555.i
- br i1 false, label %bb2566.i, label %bb2600.i
-bb2566.i: ; preds = %bb2561.i
- br label %bb2600.i
-bb2567.i: ; preds = %bb2552.i
- br i1 false, label %bb2600.i, label %bb2570.i
-bb2570.i: ; preds = %bb2567.i
- br i1 false, label %bb2575.i, label %bb2600.i
-bb2575.i: ; preds = %bb2570.i
- br label %bb2600.i
-bb2576.i: ; preds = %bb2394.i
- br i1 false, label %bb2591.i, label %bb2579.i
-bb2579.i: ; preds = %bb2576.i
- br i1 false, label %bb2600.i, label %bb2585.i
-bb2585.i: ; preds = %bb2579.i
- br i1 false, label %bb2590.i, label %bb2600.i
-bb2590.i: ; preds = %bb2585.i
- br label %bb2600.i
-bb2591.i: ; preds = %bb2576.i
- br i1 false, label %bb2600.i, label %bb2594.i
-bb2594.i: ; preds = %bb2591.i
- br i1 false, label %bb2599.i, label %bb2600.i
-bb2599.i: ; preds = %bb2594.i
- br label %bb2600.i
-bb2600.i: ; preds = %bb2599.i, %bb2594.i, %bb2591.i, %bb2590.i, %bb2585.i, %bb2579.i, %bb2575.i, %bb2570.i, %bb2567.i, %bb2566.i, %bb2561.i, %bb2555.i, %bb2551.i, %bb2546.i, %bb2543.i, %bb2542.i, %bb2537.i, %bb2531.i, %bb2527.i, %bb2522.i, %bb2519.i, %bb2518.i, %bb2513.i, %bb2507.i, %bb2479.i, %bb2462.i, %bb2459.i, %bb2453.i, %bb2447.i, %bb2394.i, %bb2388.i
- br label %bb2793.i
-bb2793.i: ; preds = %bb2600.i, %bb2458.i, %bb656.i, %bb650.i, %bb559.i
- switch i32 0, label %bb2883.i [
- i32 3, label %bb2874.i
- i32 4, label %bb2795.i
- i32 8, label %bb2810.i
- i32 10, label %bb2834.i
- i32 11, label %bb2819.i
- i32 16, label %bb2810.i
- ]
-bb2795.i: ; preds = %bb2793.i, %bb661.i
- br label %bb2810.i
-bb2810.i: ; preds = %bb2795.i, %bb2793.i, %bb2793.i, %bb661.i, %bb661.i
- br label %bb2883.i
-bb2819.i: ; preds = %bb2793.i, %bb661.i
- br label %bb2834.i
-bb2834.i: ; preds = %bb2819.i, %bb2793.i, %bb661.i
- switch i32 0, label %bb2860.i [
- i32 4, label %bb2846.i
- i32 8, label %bb2846.i
- ]
-bb2846.i: ; preds = %bb2834.i, %bb2834.i
- br i1 false, label %bb2859.i, label %bb2860.i
-bb2859.i: ; preds = %bb2846.i
- br label %bb2860.i
-bb2860.i: ; preds = %bb2859.i, %bb2846.i, %bb2834.i
- switch i32 %df4081.0.i, label %bb2867.bb2883_crit_edge.i [
- i32 1, label %bb2883.i
- i32 2, label %bb2872.i
- ]
-bb2867.bb2883_crit_edge.i: ; preds = %bb2860.i
- br label %bb2883.i
-bb2872.i: ; preds = %bb2860.i
- switch i32 0, label %UnifiedReturnBlock.i235 [
- i32 3, label %bb3253.i
- i32 4, label %bb4173.i
- i32 8, label %bb3485.i
- i32 10, label %bb3253.i
- i32 11, label %bb3021.i
- i32 16, label %bb2885.i
- ]
-bb2874.i: ; preds = %bb2793.i, %bb661.i
- br label %bb2883.i
-bb2883.i: ; preds = %bb2874.i, %bb2867.bb2883_crit_edge.i, %bb2860.i, %bb2810.i, %bb2793.i, %bb661.i
- %f_alpha.1.i = phi i32 [ 0, %bb2867.bb2883_crit_edge.i ], [ 0, %bb2874.i ], [ 1065353216, %bb661.i ], [ 0, %bb2793.i ], [ 0, %bb2810.i ], [ 0, %bb2860.i ] ; <i32> [#uses=1]
- switch i32 0, label %UnifiedReturnBlock.i235 [
- i32 3, label %bb3253.i
- i32 4, label %bb4173.i
- i32 8, label %bb3485.i
- i32 10, label %bb3253.i
- i32 11, label %bb3021.i
- i32 16, label %bb2885.i
- ]
-bb2885.i: ; preds = %bb2883.i, %bb2872.i
- br i1 false, label %bb3011.i, label %bb2890.i
-bb2890.i: ; preds = %bb2885.i
- br i1 false, label %bb2960.i, label %bb2954.i
-bb2954.i: ; preds = %bb2890.i
- br i1 false, label %bb2959.i, label %bb2960.i
-bb2959.i: ; preds = %bb2954.i
- br label %bb2960.i
-bb2960.i: ; preds = %bb2959.i, %bb2954.i, %bb2890.i
- br i1 false, label %bb2972.i, label %bb2966.i
-bb2966.i: ; preds = %bb2960.i
- br i1 false, label %bb2971.i, label %bb2972.i
-bb2971.i: ; preds = %bb2966.i
- br label %bb2972.i
-bb2972.i: ; preds = %bb2971.i, %bb2966.i, %bb2960.i
- br label %glgScalarFloatConversion.exit
-bb3011.i: ; preds = %bb2885.i
- br label %glgScalarFloatConversion.exit
-bb3021.i: ; preds = %bb2883.i, %bb2872.i
- switch i32 %dt4080.0.i, label %bb3192.i [
- i32 7, label %bb3026.i
- i32 6, label %bb3037.i
- i32 1, label %bb3125.i
- i32 3, label %bb3125.i
- i32 5, label %bb3144.i
- ]
-bb3026.i: ; preds = %bb3021.i
- br label %bb3258.i
-bb3037.i: ; preds = %bb3021.i
- br i1 false, label %bb3052.i, label %bb3074.i
-bb3052.i: ; preds = %bb3037.i
- br i1 false, label %bb3105.i, label %bb3069.i
-bb3069.i: ; preds = %bb3052.i
- switch i32 %dt4080.0.i, label %bb3424.i [
- i32 7, label %bb3258.i
- i32 6, label %bb3269.i
- i32 1, label %bb3357.i
- i32 3, label %bb3357.i
- i32 5, label %bb3376.i
- ]
-bb3074.i: ; preds = %bb3037.i
- br i1 false, label %bb3079.i, label %bb3092.i
-bb3079.i: ; preds = %bb3074.i
- switch i32 %dt4080.0.i, label %bb3424.i [
- i32 7, label %bb3258.i
- i32 6, label %bb3269.i
- i32 1, label %bb3357.i
- i32 3, label %bb3357.i
- i32 5, label %bb3376.i
- ]
-bb3092.i: ; preds = %bb3074.i
- switch i32 %dt4080.0.i, label %bb3424.i [
- i32 7, label %bb3258.i
- i32 6, label %bb3269.i
- i32 1, label %bb3357.i
- i32 3, label %bb3357.i
- i32 5, label %bb3376.i
- ]
-bb3105.i: ; preds = %bb3052.i
- switch i32 %dt4080.0.i, label %bb3424.i [
- i32 7, label %bb3258.i
- i32 6, label %bb3269.i
- i32 1, label %bb3357.i
- i32 3, label %bb3357.i
- i32 5, label %bb3376.i
- ]
-bb3125.i: ; preds = %bb3021.i, %bb3021.i
- switch i32 %dt4080.0.i, label %bb3424.i [
- i32 7, label %bb3258.i
- i32 6, label %bb3269.i
- i32 1, label %bb3357.i
- i32 3, label %bb3357.i
- i32 5, label %bb3376.i
- ]
-bb3144.i: ; preds = %bb3021.i
- br label %bb3376.i
-bb3192.i: ; preds = %bb3021.i
- br i1 false, label %bb3197.i, label %bb3243.i
-bb3197.i: ; preds = %bb3192.i
- br label %bb3424.i
-bb3243.i: ; preds = %bb3192.i
- br label %bb3253.i
-bb3253.i: ; preds = %bb3243.i, %bb2883.i, %bb2883.i, %bb2872.i, %bb2872.i
- switch i32 %dt4080.0.i, label %bb3424.i [
- i32 7, label %bb3258.i
- i32 6, label %bb3269.i
- i32 1, label %bb3357.i
- i32 3, label %bb3357.i
- i32 5, label %bb3376.i
- ]
-bb3258.i: ; preds = %bb3253.i, %bb3125.i, %bb3105.i, %bb3092.i, %bb3079.i, %bb3069.i, %bb3026.i
- br label %glgScalarFloatConversion.exit
-bb3269.i: ; preds = %bb3253.i, %bb3125.i, %bb3105.i, %bb3092.i, %bb3079.i, %bb3069.i
- br i1 false, label %bb3284.i, label %bb3306.i
-bb3284.i: ; preds = %bb3269.i
- br i1 false, label %bb3337.i, label %bb3301.i
-bb3301.i: ; preds = %bb3284.i
- br label %glgScalarFloatConversion.exit
-bb3306.i: ; preds = %bb3269.i
- br i1 false, label %bb3311.i, label %bb3324.i
-bb3311.i: ; preds = %bb3306.i
- br label %glgScalarFloatConversion.exit
-bb3324.i: ; preds = %bb3306.i
- br label %glgScalarFloatConversion.exit
-bb3337.i: ; preds = %bb3284.i
- br label %glgScalarFloatConversion.exit
-bb3357.i: ; preds = %bb3253.i, %bb3253.i, %bb3125.i, %bb3125.i, %bb3105.i, %bb3105.i, %bb3092.i, %bb3092.i, %bb3079.i, %bb3079.i, %bb3069.i, %bb3069.i
- br label %glgScalarFloatConversion.exit
-bb3376.i: ; preds = %bb3253.i, %bb3144.i, %bb3125.i, %bb3105.i, %bb3092.i, %bb3079.i, %bb3069.i
- br label %glgScalarFloatConversion.exit
-bb3424.i: ; preds = %bb3253.i, %bb3197.i, %bb3125.i, %bb3105.i, %bb3092.i, %bb3079.i, %bb3069.i
- br i1 false, label %bb3429.i, label %bb3475.i
-bb3429.i: ; preds = %bb3424.i
- br label %glgScalarFloatConversion.exit
-bb3475.i: ; preds = %bb3424.i
- br label %glgScalarFloatConversion.exit
-bb3485.i: ; preds = %bb2883.i, %bb2872.i
- switch i32 %dt4080.0.i, label %bb4077.i [
- i32 7, label %bb3490.i
- i32 6, label %bb3511.i
- i32 1, label %bb3749.i
- i32 3, label %bb3749.i
- i32 5, label %bb3794.i
- i32 4, label %bb3941.i
- ]
-bb3490.i: ; preds = %bb3485.i
- br label %glgScalarFloatConversion.exit
-bb3511.i: ; preds = %bb3485.i
- br i1 false, label %bb3526.i, label %bb3548.i
-bb3526.i: ; preds = %bb3511.i
- br i1 false, label %bb3579.i, label %bb3543.i
-bb3543.i: ; preds = %bb3526.i
- br label %bb3579.i
-bb3548.i: ; preds = %bb3511.i
- br i1 false, label %bb3553.i, label %bb3566.i
-bb3553.i: ; preds = %bb3548.i
- br label %bb3579.i
-bb3566.i: ; preds = %bb3548.i
- br label %bb3579.i
-bb3579.i: ; preds = %bb3566.i, %bb3553.i, %bb3543.i, %bb3526.i
- br i1 false, label %bb3601.i, label %bb3623.i
-bb3601.i: ; preds = %bb3579.i
- br i1 false, label %bb3654.i, label %bb3618.i
-bb3618.i: ; preds = %bb3601.i
- br label %bb3654.i
-bb3623.i: ; preds = %bb3579.i
- br i1 false, label %bb3628.i, label %bb3641.i
-bb3628.i: ; preds = %bb3623.i
- br label %bb3654.i
-bb3641.i: ; preds = %bb3623.i
- br label %bb3654.i
-bb3654.i: ; preds = %bb3641.i, %bb3628.i, %bb3618.i, %bb3601.i
- br i1 false, label %bb3676.i, label %bb3698.i
-bb3676.i: ; preds = %bb3654.i
- br i1 false, label %bb3729.i, label %bb3693.i
-bb3693.i: ; preds = %bb3676.i
- br label %glgScalarFloatConversion.exit
-bb3698.i: ; preds = %bb3654.i
- br i1 false, label %bb3703.i, label %bb3716.i
-bb3703.i: ; preds = %bb3698.i
- br label %glgScalarFloatConversion.exit
-bb3716.i: ; preds = %bb3698.i
- br label %glgScalarFloatConversion.exit
-bb3729.i: ; preds = %bb3676.i
- br label %glgScalarFloatConversion.exit
-bb3749.i: ; preds = %bb3485.i, %bb3485.i
- br label %glgScalarFloatConversion.exit
-bb3794.i: ; preds = %bb3485.i
- br label %glgScalarFloatConversion.exit
-bb3941.i: ; preds = %bb3485.i
- br label %glgScalarFloatConversion.exit
-bb4077.i: ; preds = %bb3485.i
- br i1 false, label %bb4083.i, label %bb4111.i
-bb4083.i: ; preds = %bb4077.i
- br label %glgScalarFloatConversion.exit
-bb4111.i: ; preds = %bb4077.i
- br i1 false, label %bb4117.i, label %bb4145.i
-bb4117.i: ; preds = %bb4111.i
- br label %glgScalarFloatConversion.exit
-bb4145.i: ; preds = %bb4111.i
- br label %glgScalarFloatConversion.exit
-bb4173.i: ; preds = %bb2883.i, %bb2872.i
- %f_red.0.reg2mem.4.i = phi i32 [ 0, %bb2872.i ], [ 0, %bb2883.i ] ; <i32> [#uses=2]
- %f_green.0.reg2mem.2.i = phi i32 [ 0, %bb2872.i ], [ 0, %bb2883.i ] ; <i32> [#uses=1]
- %f_blue.0.reg2mem.2.i = phi i32 [ 0, %bb2872.i ], [ 0, %bb2883.i ] ; <i32> [#uses=1]
- %f_alpha.1.reg2mem.1.i = phi i32 [ 0, %bb2872.i ], [ %f_alpha.1.i, %bb2883.i ] ; <i32> [#uses=1]
- switch i32 %dt4080.0.i, label %bb4950.i [
- i32 7, label %bb4178.i
- i32 6, label %bb4204.i
- i32 1, label %bb4517.i202
- i32 3, label %bb4517.i202
- i32 5, label %bb4575.i
- i32 4, label %bb4769.i
- ]
-bb4178.i: ; preds = %bb4173.i
- br label %glgScalarFloatConversion.exit
-bb4204.i: ; preds = %bb4173.i
- %tmp4210.i = and i32 0, 32768 ; <i32> [#uses=4]
- %tmp4212.i = and i32 %f_red.0.reg2mem.4.i, 2139095040 ; <i32> [#uses=1]
- %tmp4214.i = and i32 %f_red.0.reg2mem.4.i, 8388607 ; <i32> [#uses=1]
- br i1 false, label %bb4219.i, label %bb4241.i
-bb4219.i: ; preds = %bb4204.i
- br i1 false, label %bb4272.i, label %bb4236.i
-bb4236.i: ; preds = %bb4219.i
- br label %bb4272.i
-bb4241.i: ; preds = %bb4204.i
- br i1 false, label %bb4246.i, label %bb4259.i
-bb4246.i: ; preds = %bb4241.i
- %tmp4253.i = lshr i32 %tmp4214.i, 0 ; <i32> [#uses=1]
- %tmp4253.masked.i = and i32 %tmp4253.i, 65535 ; <i32> [#uses=1]
- br label %bb4272.i
-bb4259.i: ; preds = %bb4241.i
- %tmp4261.i187 = add i32 %tmp4212.i, 134217728 ; <i32> [#uses=1]
- %tmp4262.i188 = lshr i32 %tmp4261.i187, 13 ; <i32> [#uses=1]
- %tmp4262.masked.i = and i32 %tmp4262.i188, 64512 ; <i32> [#uses=1]
- %tmp42665693.masked.i = or i32 %tmp4262.masked.i, %tmp4210.i ; <i32> [#uses=1]
- br label %bb4272.i
-bb4272.i: ; preds = %bb4259.i, %bb4246.i, %bb4236.i, %bb4219.i
- %tmp42665693.masked.pn.i = phi i32 [ %tmp42665693.masked.i, %bb4259.i ], [ %tmp4253.masked.i, %bb4246.i ], [ %tmp4210.i, %bb4236.i ], [ %tmp4210.i, %bb4219.i ] ; <i32> [#uses=1]
- %tmp4268.pn.i = phi i32 [ 0, %bb4259.i ], [ %tmp4210.i, %bb4246.i ], [ 31744, %bb4236.i ], [ 32767, %bb4219.i ] ; <i32> [#uses=1]
- %tmp100.0.i = or i32 %tmp4268.pn.i, %tmp42665693.masked.pn.i ; <i32> [#uses=0]
- %tmp4289.i = and i32 %f_green.0.reg2mem.2.i, 8388607 ; <i32> [#uses=1]
- br i1 false, label %bb4294.i, label %bb4316.i
-bb4294.i: ; preds = %bb4272.i
- br i1 false, label %bb4347.i, label %bb4311.i
-bb4311.i: ; preds = %bb4294.i
- br label %bb4347.i
-bb4316.i: ; preds = %bb4272.i
- br i1 false, label %bb4321.i, label %bb4334.i
-bb4321.i: ; preds = %bb4316.i
- br label %bb4347.i
-bb4334.i: ; preds = %bb4316.i
- %tmp4343.i = lshr i32 %tmp4289.i, 13 ; <i32> [#uses=0]
- br label %bb4347.i
-bb4347.i: ; preds = %bb4334.i, %bb4321.i, %bb4311.i, %bb4294.i
- %tmp4364.i190 = and i32 %f_blue.0.reg2mem.2.i, 8388607 ; <i32> [#uses=1]
- br i1 false, label %bb4369.i192, label %bb4391.i
-bb4369.i192: ; preds = %bb4347.i
- br i1 false, label %bb4422.i, label %bb4386.i
-bb4386.i: ; preds = %bb4369.i192
- br label %bb4422.i
-bb4391.i: ; preds = %bb4347.i
- br i1 false, label %bb4396.i, label %bb4409.i
-bb4396.i: ; preds = %bb4391.i
- br label %bb4422.i
-bb4409.i: ; preds = %bb4391.i
- %tmp4418.i = lshr i32 %tmp4364.i190, 13 ; <i32> [#uses=0]
- br label %bb4422.i
-bb4422.i: ; preds = %bb4409.i, %bb4396.i, %bb4386.i, %bb4369.i192
- %tmp4439.i194 = and i32 %f_alpha.1.reg2mem.1.i, 8388607 ; <i32> [#uses=1]
- br i1 false, label %bb4444.i, label %bb4466.i
-bb4444.i: ; preds = %bb4422.i
- br i1 false, label %bb4497.i, label %bb4461.i
-bb4461.i: ; preds = %bb4444.i
- br label %glgScalarFloatConversion.exit
-bb4466.i: ; preds = %bb4422.i
- br i1 false, label %bb4471.i, label %bb4484.i
-bb4471.i: ; preds = %bb4466.i
- br label %glgScalarFloatConversion.exit
-bb4484.i: ; preds = %bb4466.i
- %tmp4493.i = lshr i32 %tmp4439.i194, 13 ; <i32> [#uses=0]
- br label %glgScalarFloatConversion.exit
-bb4497.i: ; preds = %bb4444.i
- br label %glgScalarFloatConversion.exit
-bb4517.i202: ; preds = %bb4173.i, %bb4173.i
- br label %glgScalarFloatConversion.exit
-bb4575.i: ; preds = %bb4173.i
- br label %glgScalarFloatConversion.exit
-bb4769.i: ; preds = %bb4173.i
- br label %glgScalarFloatConversion.exit
-bb4950.i: ; preds = %bb4173.i
- br i1 false, label %bb4956.i, label %bb4993.i
-bb4956.i: ; preds = %bb4950.i
- br label %glgScalarFloatConversion.exit
-bb4993.i: ; preds = %bb4950.i
- br i1 false, label %bb4999.i, label %bb5036.i
-bb4999.i: ; preds = %bb4993.i
- br label %glgScalarFloatConversion.exit
-bb5036.i: ; preds = %bb4993.i
- br label %glgScalarFloatConversion.exit
-UnifiedReturnBlock.i235: ; preds = %bb2883.i, %bb2872.i
- br label %glgScalarFloatConversion.exit
-glgScalarFloatConversion.exit: ; preds = %UnifiedReturnBlock.i235, %bb5036.i, %bb4999.i, %bb4956.i, %bb4769.i, %bb4575.i, %bb4517.i202, %bb4497.i, %bb4484.i, %bb4471.i, %bb4461.i, %bb4178.i, %bb4145.i, %bb4117.i, %bb4083.i, %bb3941.i, %bb3794.i, %bb3749.i, %bb3729.i, %bb3716.i, %bb3703.i, %bb3693.i, %bb3490.i, %bb3475.i, %bb3429.i, %bb3376.i, %bb3357.i, %bb3337.i, %bb3324.i, %bb3311.i, %bb3301.i, %bb3258.i, %bb3011.i, %bb2972.i
- br label %bb18851.i
-bb16697.i: ; preds = %loadColor_BGRA_UI8888R.exit
- br i1 false, label %bb17749.i, label %bb16700.i
-bb16700.i: ; preds = %bb16697.i
- switch i32 0, label %bb16829.i [
- i32 4, label %bb16705.i
- i32 8, label %bb16743.i
- i32 11, label %bb16795.i
- ]
-bb16705.i: ; preds = %bb16700.i
- switch i32 %df4081.0.i, label %bb17183.i [
- i32 1, label %bb16710.i
- i32 2, label %bb16721.i
- i32 3, label %bb16732.i
- ]
-bb16710.i: ; preds = %bb16705.i
- br label %bb17195.i
-bb16721.i: ; preds = %bb16705.i
- br label %bb17195.i
-bb16732.i: ; preds = %bb16705.i
- br label %bb17195.i
-bb16743.i: ; preds = %bb16700.i
- switch i32 0, label %bb16759.i [
- i32 4, label %bb16755.i
- i32 11, label %bb16755.i
- ]
-bb16755.i: ; preds = %bb16743.i, %bb16743.i
- br label %bb17195.i
-bb16759.i: ; preds = %bb16743.i
- switch i32 %df4081.0.i, label %bb17183.i [
- i32 1, label %bb16764.i
- i32 2, label %bb16775.i
- i32 3, label %bb16786.i
- ]
-bb16764.i: ; preds = %bb16759.i
- br label %bb17195.i
-bb16775.i: ; preds = %bb16759.i
- br label %bb17195.i
-bb16786.i: ; preds = %bb16759.i
- br label %bb17195.i
-bb16795.i: ; preds = %bb16700.i
- switch i32 0, label %bb17183.i [
- i32 4, label %bb16807.i
- i32 8, label %bb16807.i
- i32 3, label %bb16823.i
- ]
-bb16807.i: ; preds = %bb16795.i, %bb16795.i
- br label %bb17195.i
-bb16823.i: ; preds = %bb16795.i
- br label %bb17195.i
-bb16829.i: ; preds = %bb16700.i
- switch i32 %sf4083.0.i, label %bb17183.i [
- i32 10, label %bb16834.i
- i32 0, label %bb16892.i
- i32 1, label %bb16953.i
- i32 2, label %bb17037.i
- i32 3, label %bb17121.i
- ]
-bb16834.i: ; preds = %bb16829.i
- switch i32 0, label %bb16878.i [
- i32 4, label %bb16839.i
- i32 8, label %bb16858.i
- i32 11, label %bb16874.i
- ]
-bb16839.i: ; preds = %bb16834.i
- br label %bb17195.i
-bb16858.i: ; preds = %bb16834.i
- br label %bb17195.i
-bb16874.i: ; preds = %bb16834.i
- br label %bb17195.i
-bb16878.i: ; preds = %bb16834.i
- br i1 false, label %bb16883.i, label %bb17183.i
-bb16883.i: ; preds = %bb16878.i
- br label %bb17195.i
-bb16892.i: ; preds = %bb16829.i
- switch i32 0, label %bb16930.i [
- i32 4, label %bb16897.i
- i32 8, label %bb16913.i
- i32 11, label %bb16926.i
- ]
-bb16897.i: ; preds = %bb16892.i
- br label %bb17195.i
-bb16913.i: ; preds = %bb16892.i
- br label %bb17195.i
-bb16926.i: ; preds = %bb16892.i
- br label %bb17195.i
-bb16930.i: ; preds = %bb16892.i
- br i1 false, label %bb16936.i, label %bb16939.i
-bb16936.i: ; preds = %bb16930.i
- br label %bb17195.i
-bb16939.i: ; preds = %bb16930.i
- br i1 false, label %bb16944.i, label %bb17183.i
-bb16944.i: ; preds = %bb16939.i
- br label %bb17195.i
-bb16953.i: ; preds = %bb16829.i
- switch i32 0, label %bb17003.i [
- i32 4, label %bb16958.i
- i32 8, label %bb16979.i
- i32 11, label %bb16997.i
- ]
-bb16958.i: ; preds = %bb16953.i
- br label %bb17195.i
-bb16979.i: ; preds = %bb16953.i
- br label %bb17195.i
-bb16997.i: ; preds = %bb16953.i
- br label %bb17195.i
-bb17003.i: ; preds = %bb16953.i
- switch i32 %df4081.0.i, label %bb17183.i [
- i32 0, label %bb17020.i
- i32 2, label %bb17020.i
- i32 10, label %bb17020.i
- i32 3, label %bb17028.i
- ]
-bb17020.i: ; preds = %bb17003.i, %bb17003.i, %bb17003.i
- br label %bb17195.i
-bb17028.i: ; preds = %bb17003.i
- br label %bb17195.i
-bb17037.i: ; preds = %bb16829.i
- switch i32 0, label %bb17087.i [
- i32 4, label %bb17042.i
- i32 8, label %bb17063.i
- i32 11, label %bb17081.i
- ]
-bb17042.i: ; preds = %bb17037.i
- br label %bb17195.i
-bb17063.i: ; preds = %bb17037.i
- br label %bb17195.i
-bb17081.i: ; preds = %bb17037.i
- br label %bb17195.i
-bb17087.i: ; preds = %bb17037.i
- switch i32 %df4081.0.i, label %bb17183.i [
- i32 0, label %bb17104.i
- i32 1, label %bb17104.i
- i32 10, label %bb17104.i
- i32 3, label %bb17112.i
- ]
-bb17104.i: ; preds = %bb17087.i, %bb17087.i, %bb17087.i
- br label %bb17195.i
-bb17112.i: ; preds = %bb17087.i
- br label %bb17195.i
-bb17121.i: ; preds = %bb16829.i
- switch i32 0, label %bb17183.i [
- i32 4, label %bb17126.i
- i32 8, label %bb17149.i
- i32 11, label %bb17167.i
- i32 10, label %bb17180.i
- ]
-bb17126.i: ; preds = %bb17121.i
- br label %bb17195.i
-bb17149.i: ; preds = %bb17121.i
- br label %bb17195.i
-bb17167.i: ; preds = %bb17121.i
- br label %bb17195.i
-bb17180.i: ; preds = %bb17121.i
- br label %bb17183.i
-bb17183.i: ; preds = %bb17180.i, %bb17121.i, %bb17087.i, %bb17003.i, %bb16939.i, %bb16878.i, %bb16829.i, %bb16795.i, %bb16759.i, %bb16705.i
- br label %bb17195.i
-bb17195.i: ; preds = %bb17183.i, %bb17167.i, %bb17149.i, %bb17126.i, %bb17112.i, %bb17104.i, %bb17081.i, %bb17063.i, %bb17042.i, %bb17028.i, %bb17020.i, %bb16997.i, %bb16979.i, %bb16958.i, %bb16944.i, %bb16936.i, %bb16926.i, %bb16913.i, %bb16897.i, %bb16883.i, %bb16874.i, %bb16858.i, %bb16839.i, %bb16823.i, %bb16807.i, %bb16786.i, %bb16775.i, %bb16764.i, %bb16755.i, %bb16732.i, %bb16721.i, %bb16710.i
- br i1 false, label %bb18845.i, label %bb17225.i
-bb17225.i: ; preds = %bb17195.i
- switch i32 %dt4080.0.i, label %bb17677.i [
- i32 4, label %bb17227.i
- i32 8, label %bb17259.i
- i32 9, label %bb17309.i
- i32 10, label %bb17359.i
- i32 11, label %bb17359.i
- i32 14, label %bb17409.i
- i32 15, label %bb17474.i
- i32 18, label %bb17539.i
- i32 19, label %bb17604.i
- i32 0, label %bb17680.i
- i32 1, label %bb17672.i
- i32 2, label %bb17673.i
- i32 3, label %bb17674.i
- i32 5, label %bb17675.i
- i32 12, label %bb17676.i
- i32 13, label %bb17676.i
- i32 16, label %bb17680.i
- i32 17, label %bb17680.i
- ]
-bb17227.i: ; preds = %bb17225.i
- br i1 false, label %bb18845.i, label %bb17230.i
-bb17230.i: ; preds = %bb17227.i
- br label %bb18851.i
-bb17259.i: ; preds = %bb17225.i
- br i1 false, label %bb17284.i, label %bb17262.i
-bb17262.i: ; preds = %bb17259.i
- br label %bb17284.i
-bb17284.i: ; preds = %bb17262.i, %bb17259.i
- br label %bb18851.i
-bb17309.i: ; preds = %bb17225.i
- br i1 false, label %bb17334.i, label %bb17312.i
-bb17312.i: ; preds = %bb17309.i
- br label %bb17334.i
-bb17334.i: ; preds = %bb17312.i, %bb17309.i
- br label %bb18851.i
-bb17359.i: ; preds = %bb17225.i, %bb17225.i
- br i1 false, label %bb17384.i, label %bb17362.i
-bb17362.i: ; preds = %bb17359.i
- br label %bb17384.i
-bb17384.i: ; preds = %bb17362.i, %bb17359.i
- br label %bb18851.i
-bb17409.i: ; preds = %bb17225.i
- br i1 false, label %bb17441.i, label %bb17412.i
-bb17412.i: ; preds = %bb17409.i
- br label %bb17441.i
-bb17441.i: ; preds = %bb17412.i, %bb17409.i
- br label %bb18851.i
-bb17474.i: ; preds = %bb17225.i
- br i1 false, label %bb17506.i, label %bb17477.i
-bb17477.i: ; preds = %bb17474.i
- br label %bb17506.i
-bb17506.i: ; preds = %bb17477.i, %bb17474.i
- br label %bb18851.i
-bb17539.i: ; preds = %bb17225.i
- br i1 false, label %bb17571.i, label %bb17542.i
-bb17542.i: ; preds = %bb17539.i
- br label %bb17571.i
-bb17571.i: ; preds = %bb17542.i, %bb17539.i
- br label %bb18851.i
-bb17604.i: ; preds = %bb17225.i
- br i1 false, label %bb17636.i, label %bb17607.i
-bb17607.i: ; preds = %bb17604.i
- br label %bb17636.i
-bb17636.i: ; preds = %bb17607.i, %bb17604.i
- br label %bb18851.i
-bb17672.i: ; preds = %bb17225.i
- br i1 false, label %bb17716.i, label %bb17683.i
-bb17673.i: ; preds = %bb17225.i
- br i1 false, label %bb17716.i, label %bb17683.i
-bb17674.i: ; preds = %bb17225.i
- br i1 false, label %bb17716.i, label %bb17683.i
-bb17675.i: ; preds = %bb17225.i
- br i1 false, label %bb17716.i, label %bb17683.i
-bb17676.i: ; preds = %bb17225.i, %bb17225.i
- br i1 false, label %bb17716.i, label %bb17683.i
-bb17677.i: ; preds = %bb17225.i
- unreachable
-bb17680.i: ; preds = %bb17225.i, %bb17225.i, %bb17225.i
- br i1 false, label %bb17716.i, label %bb17683.i
-bb17683.i: ; preds = %bb17680.i, %bb17676.i, %bb17675.i, %bb17674.i, %bb17673.i, %bb17672.i
- br label %bb17716.i
-bb17716.i: ; preds = %bb17683.i, %bb17680.i, %bb17676.i, %bb17675.i, %bb17674.i, %bb17673.i, %bb17672.i
- br label %bb18851.i
-bb17749.i: ; preds = %bb16697.i
- br i1 false, label %bb17757.i, label %bb17903.i
-bb17757.i: ; preds = %bb17749.i
- switch i32 0, label %bb17903.i [
- i32 0, label %bb17759.i
- i32 1, label %bb17853.i
- i32 2, label %bb17853.i
- ]
-bb17759.i: ; preds = %bb17757.i
- br i1 false, label %bb17764.i, label %bb17772.i
-bb17764.i: ; preds = %bb17759.i
- br label %bb18032.i
-bb17772.i: ; preds = %bb17759.i
- switch i32 %sf4083.0.i, label %bb17798.i [
- i32 1, label %bb17777.i
- i32 2, label %bb17790.i
- ]
-bb17777.i: ; preds = %bb17772.i
- switch i32 0, label %bb18032.i [
- i32 4, label %bb17818.i
- i32 8, label %bb17818.i
- i32 11, label %bb17845.i
- ]
-bb17790.i: ; preds = %bb17772.i
- switch i32 0, label %bb18032.i [
- i32 4, label %bb17818.i
- i32 8, label %bb17818.i
- i32 11, label %bb17845.i
- ]
-bb17798.i: ; preds = %bb17772.i
- switch i32 0, label %bb18032.i [
- i32 4, label %bb17818.i
- i32 8, label %bb17818.i
- i32 11, label %bb17845.i
- ]
-bb17818.i: ; preds = %bb17798.i, %bb17798.i, %bb17790.i, %bb17790.i, %bb17777.i, %bb17777.i
- switch i32 0, label %bb18032.i [
- i32 4, label %bb17845.i
- i32 11, label %bb17845.i
- i32 8, label %bb17946.i
- ]
-bb17845.i: ; preds = %bb17818.i, %bb17818.i, %bb17798.i, %bb17790.i, %bb17777.i
- switch i32 0, label %bb18032.i [
- i32 4, label %bb17908.i
- i32 8, label %bb17946.i
- i32 11, label %bb17998.i
- ]
-bb17853.i: ; preds = %bb17757.i, %bb17757.i
- br i1 false, label %bb17890.i, label %bb17903.i
-bb17890.i: ; preds = %bb17853.i
- br label %bb17903.i
-bb17903.i: ; preds = %bb17890.i, %bb17853.i, %bb17757.i, %bb17749.i
- switch i32 0, label %bb18032.i [
- i32 4, label %bb17908.i
- i32 8, label %bb17946.i
- i32 11, label %bb17998.i
- ]
-bb17908.i: ; preds = %bb17903.i, %bb17845.i
- switch i32 %df4081.0.i, label %bb18386.i [
- i32 1, label %bb17913.i
- i32 2, label %bb17924.i
- i32 3, label %bb17935.i
- ]
-bb17913.i: ; preds = %bb17908.i
- br label %bb18398.i
-bb17924.i: ; preds = %bb17908.i
- br label %bb18398.i
-bb17935.i: ; preds = %bb17908.i
- br label %bb18398.i
-bb17946.i: ; preds = %bb17903.i, %bb17845.i, %bb17818.i
- switch i32 0, label %bb17962.i [
- i32 4, label %bb17958.i
- i32 11, label %bb17958.i
- ]
-bb17958.i: ; preds = %bb17946.i, %bb17946.i
- br label %bb18398.i
-bb17962.i: ; preds = %bb17946.i
- switch i32 %df4081.0.i, label %bb18386.i [
- i32 1, label %bb17967.i
- i32 2, label %bb17978.i
- i32 3, label %bb17989.i
- ]
-bb17967.i: ; preds = %bb17962.i
- br label %bb18398.i
-bb17978.i: ; preds = %bb17962.i
- br label %bb18398.i
-bb17989.i: ; preds = %bb17962.i
- br label %bb18398.i
-bb17998.i: ; preds = %bb17903.i, %bb17845.i
- switch i32 0, label %bb18386.i [
- i32 4, label %bb18010.i
- i32 8, label %bb18010.i
- i32 3, label %bb18026.i
- ]
-bb18010.i: ; preds = %bb17998.i, %bb17998.i
- br label %bb18398.i
-bb18026.i: ; preds = %bb17998.i
- br label %bb18398.i
-bb18032.i: ; preds = %bb17903.i, %bb17845.i, %bb17818.i, %bb17798.i, %bb17790.i, %bb17777.i, %bb17764.i
- switch i32 %sf4083.0.i, label %bb18386.i [
- i32 10, label %bb18037.i
- i32 0, label %bb18095.i
- i32 1, label %bb18156.i
- i32 2, label %bb18240.i
- i32 3, label %bb18324.i
- ]
-bb18037.i: ; preds = %bb18032.i
- switch i32 0, label %bb18081.i [
- i32 4, label %bb18042.i
- i32 8, label %bb18061.i
- i32 11, label %bb18077.i
- ]
-bb18042.i: ; preds = %bb18037.i
- br label %bb18398.i
-bb18061.i: ; preds = %bb18037.i
- br label %bb18398.i
-bb18077.i: ; preds = %bb18037.i
- br label %bb18398.i
-bb18081.i: ; preds = %bb18037.i
- br i1 false, label %bb18086.i, label %bb18386.i
-bb18086.i: ; preds = %bb18081.i
- br label %bb18398.i
-bb18095.i: ; preds = %bb18032.i
- switch i32 0, label %bb18133.i [
- i32 4, label %bb18100.i
- i32 8, label %bb18116.i
- i32 11, label %bb18129.i
- ]
-bb18100.i: ; preds = %bb18095.i
- br label %bb18398.i
-bb18116.i: ; preds = %bb18095.i
- br label %bb18398.i
-bb18129.i: ; preds = %bb18095.i
- br label %bb18398.i
-bb18133.i: ; preds = %bb18095.i
- br i1 false, label %bb18139.i, label %bb18142.i
-bb18139.i: ; preds = %bb18133.i
- br label %bb18398.i
-bb18142.i: ; preds = %bb18133.i
- br i1 false, label %bb18147.i, label %bb18386.i
-bb18147.i: ; preds = %bb18142.i
- br label %bb18398.i
-bb18156.i: ; preds = %bb18032.i
- switch i32 0, label %bb18206.i [
- i32 4, label %bb18161.i
- i32 8, label %bb18182.i
- i32 11, label %bb18200.i
- ]
-bb18161.i: ; preds = %bb18156.i
- br label %bb18398.i
-bb18182.i: ; preds = %bb18156.i
- br label %bb18398.i
-bb18200.i: ; preds = %bb18156.i
- br label %bb18398.i
-bb18206.i: ; preds = %bb18156.i
- switch i32 %df4081.0.i, label %bb18386.i [
- i32 0, label %bb18223.i
- i32 2, label %bb18223.i
- i32 10, label %bb18223.i
- i32 3, label %bb18231.i
- ]
-bb18223.i: ; preds = %bb18206.i, %bb18206.i, %bb18206.i
- br label %bb18398.i
-bb18231.i: ; preds = %bb18206.i
- br label %bb18398.i
-bb18240.i: ; preds = %bb18032.i
- switch i32 0, label %bb18290.i [
- i32 4, label %bb18245.i
- i32 8, label %bb18266.i
- i32 11, label %bb18284.i
- ]
-bb18245.i: ; preds = %bb18240.i
- br label %bb18398.i
-bb18266.i: ; preds = %bb18240.i
- br label %bb18398.i
-bb18284.i: ; preds = %bb18240.i
- br label %bb18398.i
-bb18290.i: ; preds = %bb18240.i
- switch i32 %df4081.0.i, label %bb18386.i [
- i32 0, label %bb18307.i
- i32 1, label %bb18307.i
- i32 10, label %bb18307.i
- i32 3, label %bb18315.i
- ]
-bb18307.i: ; preds = %bb18290.i, %bb18290.i, %bb18290.i
- br label %bb18398.i
-bb18315.i: ; preds = %bb18290.i
- br label %bb18398.i
-bb18324.i: ; preds = %bb18032.i
- switch i32 0, label %bb18386.i [
- i32 4, label %bb18329.i
- i32 8, label %bb18352.i
- i32 11, label %bb18370.i
- i32 10, label %bb18383.i
- ]
-bb18329.i: ; preds = %bb18324.i
- br label %bb18398.i
-bb18352.i: ; preds = %bb18324.i
- br label %bb18398.i
-bb18370.i: ; preds = %bb18324.i
- br label %bb18398.i
-bb18383.i: ; preds = %bb18324.i
- br label %bb18386.i
-bb18386.i: ; preds = %bb18383.i, %bb18324.i, %bb18290.i, %bb18206.i, %bb18142.i, %bb18081.i, %bb18032.i, %bb17998.i, %bb17962.i, %bb17908.i
- br label %bb18398.i
-bb18398.i: ; preds = %bb18386.i, %bb18370.i, %bb18352.i, %bb18329.i, %bb18315.i, %bb18307.i, %bb18284.i, %bb18266.i, %bb18245.i, %bb18231.i, %bb18223.i, %bb18200.i, %bb18182.i, %bb18161.i, %bb18147.i, %bb18139.i, %bb18129.i, %bb18116.i, %bb18100.i, %bb18086.i, %bb18077.i, %bb18061.i, %bb18042.i, %bb18026.i, %bb18010.i, %bb17989.i, %bb17978.i, %bb17967.i, %bb17958.i, %bb17935.i, %bb17924.i, %bb17913.i
- br i1 false, label %bb18589.i, label %bb18431.i
-bb18431.i: ; preds = %bb18398.i
- switch i32 0, label %bb18589.i [
- i32 0, label %bb18433.i
- i32 1, label %bb18487.i
- i32 2, label %bb18487.i
- ]
-bb18433.i: ; preds = %bb18431.i
- switch i32 0, label %bb18589.i [
- i32 4, label %bb18452.i
- i32 8, label %bb18452.i
- i32 11, label %bb18479.i
- ]
-bb18452.i: ; preds = %bb18433.i, %bb18433.i
- switch i32 0, label %bb18589.i [
- i32 4, label %bb18479.i
- i32 11, label %bb18479.i
- ]
-bb18479.i: ; preds = %bb18452.i, %bb18452.i, %bb18433.i
- br i1 false, label %bb18845.i, label %bb18592.i
-bb18487.i: ; preds = %bb18431.i, %bb18431.i
- br i1 false, label %bb18492.i, label %bb18521.i
-bb18492.i: ; preds = %bb18487.i
- br i1 false, label %bb18508.i, label %bb18529.i
-bb18508.i: ; preds = %bb18492.i
- switch i32 0, label %bb18589.i [
- i32 4, label %bb18541.i
- i32 8, label %bb18541.i
- ]
-bb18521.i: ; preds = %bb18487.i
- br label %bb18529.i
-bb18529.i: ; preds = %bb18521.i, %bb18492.i
- switch i32 0, label %bb18589.i [
- i32 4, label %bb18541.i
- i32 8, label %bb18541.i
- ]
-bb18541.i: ; preds = %bb18529.i, %bb18529.i, %bb18508.i, %bb18508.i
- br i1 false, label %bb18560.i, label %bb18589.i
-bb18560.i: ; preds = %bb18541.i
- br i1 false, label %bb18576.i, label %bb18589.i
-bb18576.i: ; preds = %bb18560.i
- br label %bb18589.i
-bb18589.i: ; preds = %bb18576.i, %bb18560.i, %bb18541.i, %bb18529.i, %bb18508.i, %bb18452.i, %bb18433.i, %bb18431.i, %bb18398.i
- br i1 false, label %bb18845.i, label %bb18592.i
-bb18592.i: ; preds = %bb18589.i, %bb18479.i
- switch i32 %dt4080.0.i, label %bb18809.i [
- i32 4, label %bb18845.i
- i32 8, label %bb18594.i
- i32 9, label %bb18619.i
- i32 10, label %bb18644.i
- i32 11, label %bb18644.i
- i32 14, label %bb18669.i
- i32 15, label %bb18702.i
- i32 18, label %bb18735.i
- i32 19, label %bb18768.i
- i32 0, label %bb18812.i
- i32 1, label %bb18804.i
- i32 2, label %bb18805.i
- i32 3, label %bb18806.i
- i32 5, label %bb18807.i
- i32 12, label %bb18808.i
- i32 13, label %bb18808.i
- i32 16, label %bb18812.i
- i32 17, label %bb18812.i
- ]
-bb18594.i: ; preds = %bb18592.i
- br label %bb18851.i
-bb18619.i: ; preds = %bb18592.i
- br label %bb18851.i
-bb18644.i: ; preds = %bb18592.i, %bb18592.i
- br label %bb18851.i
-bb18669.i: ; preds = %bb18592.i
- br label %bb18851.i
-bb18702.i: ; preds = %bb18592.i
- br label %bb18851.i
-bb18735.i: ; preds = %bb18592.i
- br label %bb18851.i
-bb18768.i: ; preds = %bb18592.i
- br label %bb18851.i
-bb18804.i: ; preds = %bb18592.i
- br label %bb18812.i
-bb18805.i: ; preds = %bb18592.i
- br label %bb18812.i
-bb18806.i: ; preds = %bb18592.i
- br label %bb18812.i
-bb18807.i: ; preds = %bb18592.i
- br label %bb18812.i
-bb18808.i: ; preds = %bb18592.i, %bb18592.i
- br label %bb18812.i
-bb18809.i: ; preds = %bb18592.i
- unreachable
-bb18812.i: ; preds = %bb18808.i, %bb18807.i, %bb18806.i, %bb18805.i, %bb18804.i, %bb18592.i, %bb18592.i, %bb18592.i
- br label %bb18845.i
-bb18845.i: ; preds = %bb18812.i, %bb18592.i, %bb18589.i, %bb18479.i, %bb17227.i, %bb17195.i
- br label %bb18851.i
-bb18851.i: ; preds = %bb18845.i, %bb18768.i, %bb18735.i, %bb18702.i, %bb18669.i, %bb18644.i, %bb18619.i, %bb18594.i, %bb17716.i, %bb17636.i, %bb17571.i, %bb17506.i, %bb17441.i, %bb17384.i, %bb17334.i, %bb17284.i, %bb17230.i, %glgScalarFloatConversion.exit
- br label %storeColor_RGB_UI.exit
-storeColor_RGB_UI.exit: ; preds = %bb18851.i
- br i1 false, label %bb19786.i, label %bb16650.i
-bb19786.i: ; preds = %storeColor_RGB_UI.exit
- br label %bb19808.i
-bb19808.i: ; preds = %bb19786.i
- br i1 false, label %bb19818.i, label %bb5276.i
-bb19818.i: ; preds = %bb19808.i
- br i1 false, label %bb19840.i, label %bb19821.i
-bb19821.i: ; preds = %bb19818.i
- br label %bb19840.i
-bb19840.i: ; preds = %bb19821.i, %bb19818.i
- br i1 false, label %UnifiedReturnBlock.i, label %bb19843.i
-bb19843.i: ; preds = %bb19840.i
- br label %t.exit
-UnifiedReturnBlock.i: ; preds = %bb19840.i, %bb4501.i
- br label %t.exit
-t.exit: ; preds = %UnifiedReturnBlock.i, %bb19843.i, %bb4517.i, %bb4354.i
- ret void
-}
diff --git a/release_23/test/CodeGen/ARM/addrmode.ll b/release_23/test/CodeGen/ARM/addrmode.ll
deleted file mode 100644
index a3832c0ea3db..000000000000
--- a/release_23/test/CodeGen/ARM/addrmode.ll
+++ /dev/null
@@ -1,15 +0,0 @@
-; RUN: llvm-as < %s | llc -march=arm -stats |& grep asm-printer | grep 4
-
-define i32 @t1(i32 %a) {
- %b = mul i32 %a, 9
- %c = inttoptr i32 %b to i32*
- %d = load i32* %c
- ret i32 %d
-}
-
-define i32 @t2(i32 %a) {
- %b = mul i32 %a, -7
- %c = inttoptr i32 %b to i32*
- %d = load i32* %c
- ret i32 %d
-}
diff --git a/release_23/test/CodeGen/ARM/aliases.ll b/release_23/test/CodeGen/ARM/aliases.ll
deleted file mode 100644
index 70b2c4d4195b..000000000000
--- a/release_23/test/CodeGen/ARM/aliases.ll
+++ /dev/null
@@ -1,32 +0,0 @@
-; RUN: llvm-as < %s | \
-; RUN: llc -mtriple=arm-linux-gnueabi -o %t -f
-; RUN: grep set %t | count 5
-; RUN: grep globl %t | count 4
-; RUN: grep weak %t | count 1
-
-@bar = external global i32
-@foo1 = alias i32* @bar
-@foo2 = alias i32* @bar
-
-%FunTy = type i32()
-
-declare i32 @foo_f()
-@bar_f = alias weak %FunTy* @foo_f
-
-@bar_i = alias internal i32* @bar
-
-@A = alias bitcast (i32* @bar to i64*)
-
-define i32 @test() {
-entry:
- %tmp = load i32* @foo1
- %tmp1 = load i32* @foo2
- %tmp0 = load i32* @bar_i
- %tmp2 = call i32 @foo_f()
- %tmp3 = add i32 %tmp, %tmp2
- %tmp4 = call %FunTy* @bar_f()
- %tmp5 = add i32 %tmp3, %tmp4
- %tmp6 = add i32 %tmp1, %tmp5
- %tmp7 = add i32 %tmp6, %tmp0
- ret i32 %tmp7
-}
diff --git a/release_23/test/CodeGen/ARM/align.ll b/release_23/test/CodeGen/ARM/align.ll
deleted file mode 100644
index bb336ceebbab..000000000000
--- a/release_23/test/CodeGen/ARM/align.ll
+++ /dev/null
@@ -1,15 +0,0 @@
-; RUN: llvm-as < %s | llc -march=arm | grep align.*1 | count 1
-; RUN: llvm-as < %s | llc -mtriple=arm-linux-gnueabi | \
-; RUN: grep align.*2 | count 2
-; RUN: llvm-as < %s | llc -mtriple=arm-linux-gnueabi | \
-; RUN: grep align.*3 | count 2
-; RUN: llvm-as < %s | llc -mtriple=arm-apple-darwin | \
-; RUN: grep align.*2 | count 4
-
-@a = global i1 true
-@b = global i8 1
-@c = global i16 2
-@d = global i32 3
-@e = global i64 4
-@f = global float 5.0
-@g = global double 6.0
diff --git a/release_23/test/CodeGen/ARM/alloca.ll b/release_23/test/CodeGen/ARM/alloca.ll
deleted file mode 100644
index f7e450f59324..000000000000
--- a/release_23/test/CodeGen/ARM/alloca.ll
+++ /dev/null
@@ -1,13 +0,0 @@
-; RUN: llvm-as < %s | llc -march=arm -mtriple=arm-linux-gnu | \
-; RUN: grep {mov r11, sp}
-; RUN: llvm-as < %s | llc -march=arm -mtriple=arm-linux-gnu | \
-; RUN: grep {mov sp, r11}
-
-define void @f(i32 %a) {
-entry:
- %tmp = alloca i8, i32 %a ; <i8*> [#uses=1]
- call void @g( i8* %tmp, i32 %a, i32 1, i32 2, i32 3 )
- ret void
-}
-
-declare void @g(i8*, i32, i32, i32, i32)
diff --git a/release_23/test/CodeGen/ARM/argaddr.ll b/release_23/test/CodeGen/ARM/argaddr.ll
deleted file mode 100644
index 080827d7f42e..000000000000
--- a/release_23/test/CodeGen/ARM/argaddr.ll
+++ /dev/null
@@ -1,19 +0,0 @@
-; RUN: llvm-as < %s | llc -march=arm
-
-define void @f(i32 %a, i32 %b, i32 %c, i32 %d, i32 %e) {
-entry:
- %a_addr = alloca i32 ; <i32*> [#uses=2]
- %b_addr = alloca i32 ; <i32*> [#uses=2]
- %c_addr = alloca i32 ; <i32*> [#uses=2]
- %d_addr = alloca i32 ; <i32*> [#uses=2]
- %e_addr = alloca i32 ; <i32*> [#uses=2]
- store i32 %a, i32* %a_addr
- store i32 %b, i32* %b_addr
- store i32 %c, i32* %c_addr
- store i32 %d, i32* %d_addr
- store i32 %e, i32* %e_addr
- call void @g( i32* %a_addr, i32* %b_addr, i32* %c_addr, i32* %d_addr, i32* %e_addr )
- ret void
-}
-
-declare void @g(i32*, i32*, i32*, i32*, i32*)
diff --git a/release_23/test/CodeGen/ARM/arguments.ll b/release_23/test/CodeGen/ARM/arguments.ll
deleted file mode 100644
index 833e22dc269d..000000000000
--- a/release_23/test/CodeGen/ARM/arguments.ll
+++ /dev/null
@@ -1,11 +0,0 @@
-; RUN: llvm-as < %s | llc -mtriple=arm-linux-gnueabi | \
-; RUN: grep {mov r0, r2} | count 1
-; RUN: llvm-as < %s | llc -mtriple=arm-apple-darwin | \
-; RUN: grep {mov r0, r1} | count 1
-
-define i32 @f(i32 %a, i64 %b) {
- %tmp = call i32 @g(i64 %b)
- ret i32 %tmp
-}
-
-declare i32 @g(i64)
diff --git a/release_23/test/CodeGen/ARM/arm-asm.ll b/release_23/test/CodeGen/ARM/arm-asm.ll
deleted file mode 100644
index b260b1312daf..000000000000
--- a/release_23/test/CodeGen/ARM/arm-asm.ll
+++ /dev/null
@@ -1,7 +0,0 @@
-; RUN: llvm-as < %s | llc -march=arm
-
-define void @frame_dummy() {
-entry:
- %tmp1 = tail call void (i8*)* (void (i8*)*)* asm "", "=r,0,~{dirflag},~{fpsr},~{flags}"( void (i8*)* null ) ; <void (i8*)*> [#uses=0]
- ret void
-}
diff --git a/release_23/test/CodeGen/ARM/arm-negative-stride.ll b/release_23/test/CodeGen/ARM/arm-negative-stride.ll
deleted file mode 100644
index 1048fb7ad62c..000000000000
--- a/release_23/test/CodeGen/ARM/arm-negative-stride.ll
+++ /dev/null
@@ -1,20 +0,0 @@
-; RUN: llvm-as < %s | llc -march=arm | grep {str r1, \\\[r.*, -r.*, lsl #2\}
-
-define void @test(i32* %P, i32 %A, i32 %i) {
-entry:
- icmp eq i32 %i, 0 ; <i1>:0 [#uses=1]
- br i1 %0, label %return, label %bb
-
-bb: ; preds = %bb, %entry
- %indvar = phi i32 [ 0, %entry ], [ %indvar.next, %bb ] ; <i32> [#uses=2]
- %i_addr.09.0 = sub i32 %i, %indvar ; <i32> [#uses=1]
- %tmp2 = getelementptr i32* %P, i32 %i_addr.09.0 ; <i32*> [#uses=1]
- store i32 %A, i32* %tmp2
- %indvar.next = add i32 %indvar, 1 ; <i32> [#uses=2]
- icmp eq i32 %indvar.next, %i ; <i1>:1 [#uses=1]
- br i1 %1, label %return, label %bb
-
-return: ; preds = %bb, %entry
- ret void
-}
-
diff --git a/release_23/test/CodeGen/ARM/bits.ll b/release_23/test/CodeGen/ARM/bits.ll
deleted file mode 100644
index 0ac4f9a3833d..000000000000
--- a/release_23/test/CodeGen/ARM/bits.ll
+++ /dev/null
@@ -1,36 +0,0 @@
-; RUN: llvm-as < %s | llc -march=arm > %t
-; RUN: grep and %t | count 1
-; RUN: grep orr %t | count 1
-; RUN: grep eor %t | count 1
-; RUN: grep mov.*lsl %t | count 1
-; RUN: grep mov.*asr %t | count 1
-
-define i32 @f1(i32 %a, i32 %b) {
-entry:
- %tmp2 = and i32 %b, %a ; <i32> [#uses=1]
- ret i32 %tmp2
-}
-
-define i32 @f2(i32 %a, i32 %b) {
-entry:
- %tmp2 = or i32 %b, %a ; <i32> [#uses=1]
- ret i32 %tmp2
-}
-
-define i32 @f3(i32 %a, i32 %b) {
-entry:
- %tmp2 = xor i32 %b, %a ; <i32> [#uses=1]
- ret i32 %tmp2
-}
-
-define i32 @f4(i32 %a, i32 %b) {
-entry:
- %tmp3 = shl i32 %a, %b ; <i32> [#uses=1]
- ret i32 %tmp3
-}
-
-define i32 @f5(i32 %a, i32 %b) {
-entry:
- %tmp3 = ashr i32 %a, %b ; <i32> [#uses=1]
- ret i32 %tmp3
-}
diff --git a/release_23/test/CodeGen/ARM/branch.ll b/release_23/test/CodeGen/ARM/branch.ll
deleted file mode 100644
index 7f6b18333bf2..000000000000
--- a/release_23/test/CodeGen/ARM/branch.ll
+++ /dev/null
@@ -1,57 +0,0 @@
-; RUN: llvm-as < %s | llc -march=arm -disable-arm-if-conversion > %t
-; RUN: grep bne %t
-; RUN: grep bge %t
-; RUN: grep bhs %t
-; RUN: grep blo %t
-
-define void @f1(i32 %a, i32 %b, i32* %v) {
-entry:
- %tmp = icmp eq i32 %a, %b ; <i1> [#uses=1]
- br i1 %tmp, label %cond_true, label %return
-
-cond_true: ; preds = %entry
- store i32 0, i32* %v
- ret void
-
-return: ; preds = %entry
- ret void
-}
-
-define void @f2(i32 %a, i32 %b, i32* %v) {
-entry:
- %tmp = icmp slt i32 %a, %b ; <i1> [#uses=1]
- br i1 %tmp, label %cond_true, label %return
-
-cond_true: ; preds = %entry
- store i32 0, i32* %v
- ret void
-
-return: ; preds = %entry
- ret void
-}
-
-define void @f3(i32 %a, i32 %b, i32* %v) {
-entry:
- %tmp = icmp ult i32 %a, %b ; <i1> [#uses=1]
- br i1 %tmp, label %cond_true, label %return
-
-cond_true: ; preds = %entry
- store i32 0, i32* %v
- ret void
-
-return: ; preds = %entry
- ret void
-}
-
-define void @f4(i32 %a, i32 %b, i32* %v) {
-entry:
- %tmp = icmp ult i32 %a, %b ; <i1> [#uses=1]
- br i1 %tmp, label %return, label %cond_true
-
-cond_true: ; preds = %entry
- store i32 0, i32* %v
- ret void
-
-return: ; preds = %entry
- ret void
-}
diff --git a/release_23/test/CodeGen/ARM/bx_fold.ll b/release_23/test/CodeGen/ARM/bx_fold.ll
deleted file mode 100644
index 437b3189141d..000000000000
--- a/release_23/test/CodeGen/ARM/bx_fold.ll
+++ /dev/null
@@ -1,30 +0,0 @@
-; RUN: llvm-as < %s | llc -march=arm
-; RUN: llvm-as < %s | llc -march=arm | not grep bx
-
-define void @test(i32 %Ptr, i8* %L) {
-entry:
- br label %bb1
-
-bb: ; preds = %bb1
- %gep.upgrd.1 = zext i32 %indvar to i64 ; <i64> [#uses=1]
- %tmp7 = getelementptr i8* %L, i64 %gep.upgrd.1 ; <i8*> [#uses=1]
- store i8 0, i8* %tmp7
- %indvar.next = add i32 %indvar, 1 ; <i32> [#uses=1]
- br label %bb1
-
-bb1: ; preds = %bb, %entry
- %indvar = phi i32 [ 0, %entry ], [ %indvar.next, %bb ] ; <i32> [#uses=3]
- %i.0 = bitcast i32 %indvar to i32 ; <i32> [#uses=2]
- %tmp = tail call i32 (...)* @bar( ) ; <i32> [#uses=1]
- %tmp2 = add i32 %i.0, %tmp ; <i32> [#uses=1]
- %Ptr_addr.0 = sub i32 %Ptr, %tmp2 ; <i32> [#uses=0]
- %tmp12 = icmp eq i32 %i.0, %Ptr ; <i1> [#uses=1]
- %tmp12.not = xor i1 %tmp12, true ; <i1> [#uses=1]
- %bothcond = and i1 %tmp12.not, false ; <i1> [#uses=1]
- br i1 %bothcond, label %bb, label %bb18
-
-bb18: ; preds = %bb1
- ret void
-}
-
-declare i32 @bar(...)
diff --git a/release_23/test/CodeGen/ARM/call.ll b/release_23/test/CodeGen/ARM/call.ll
deleted file mode 100644
index 6b196653e05a..000000000000
--- a/release_23/test/CodeGen/ARM/call.ll
+++ /dev/null
@@ -1,19 +0,0 @@
-; RUN: llvm-as < %s | llc -march=arm | grep {mov lr, pc}
-; RUN: llvm-as < %s | llc -march=arm -mattr=+v5t | grep blx
-; RUN: llvm-as < %s | llc -march=arm -mtriple=arm-linux-gnueabi\
-; RUN: -relocation-model=pic | grep {PLT}
-
-@t = weak global i32 ()* null ; <i32 ()**> [#uses=1]
-
-declare void @g(i32, i32, i32, i32)
-
-define void @f() {
- call void @g( i32 1, i32 2, i32 3, i32 4 )
- ret void
-}
-
-define void @g.upgrd.1() {
- %tmp = load i32 ()** @t ; <i32 ()*> [#uses=1]
- %tmp.upgrd.2 = tail call i32 %tmp( ) ; <i32> [#uses=0]
- ret void
-}
diff --git a/release_23/test/CodeGen/ARM/call_nolink.ll b/release_23/test/CodeGen/ARM/call_nolink.ll
deleted file mode 100644
index 1af6fad099b4..000000000000
--- a/release_23/test/CodeGen/ARM/call_nolink.ll
+++ /dev/null
@@ -1,52 +0,0 @@
-; RUN: llvm-as < %s | llc -march=arm -mtriple=arm-linux-gnueabi | \
-; RUN: not grep {bx lr}
-
- %struct.anon = type { i32 (i32, i32, i32)*, i32, i32, [3 x i32], i8*, i8*, i8* }
-@r = external global [14 x i32] ; <[14 x i32]*> [#uses=4]
-@isa = external global [13 x %struct.anon] ; <[13 x %struct.anon]*> [#uses=1]
-@pgm = external global [2 x { i32, [3 x i32] }] ; <[2 x { i32, [3 x i32] }]*> [#uses=4]
-@numi = external global i32 ; <i32*> [#uses=1]
-@counter = external global [2 x i32] ; <[2 x i32]*> [#uses=1]
-
-
-define void @main_bb_2E_i_bb205_2E_i_2E_i_bb115_2E_i_2E_i() {
-newFuncRoot:
- br label %bb115.i.i
-
-bb115.i.i.bb170.i.i_crit_edge.exitStub: ; preds = %bb115.i.i
- ret void
-
-bb115.i.i.bb115.i.i_crit_edge: ; preds = %bb115.i.i
- br label %bb115.i.i
-
-bb115.i.i: ; preds = %bb115.i.i.bb115.i.i_crit_edge, %newFuncRoot
- %i_addr.3210.0.i.i = phi i32 [ %tmp166.i.i, %bb115.i.i.bb115.i.i_crit_edge ], [ 0, %newFuncRoot ] ; <i32> [#uses=7]
- %tmp124.i.i = getelementptr [2 x { i32, [3 x i32] }]* @pgm, i32 0, i32 %i_addr.3210.0.i.i, i32 1, i32 0 ; <i32*> [#uses=1]
- %tmp125.i.i = load i32* %tmp124.i.i ; <i32> [#uses=1]
- %tmp126.i.i = getelementptr [14 x i32]* @r, i32 0, i32 %tmp125.i.i ; <i32*> [#uses=1]
- %tmp127.i.i = load i32* %tmp126.i.i ; <i32> [#uses=1]
- %tmp131.i.i = getelementptr [2 x { i32, [3 x i32] }]* @pgm, i32 0, i32 %i_addr.3210.0.i.i, i32 1, i32 1 ; <i32*> [#uses=1]
- %tmp132.i.i = load i32* %tmp131.i.i ; <i32> [#uses=1]
- %tmp133.i.i = getelementptr [14 x i32]* @r, i32 0, i32 %tmp132.i.i ; <i32*> [#uses=1]
- %tmp134.i.i = load i32* %tmp133.i.i ; <i32> [#uses=1]
- %tmp138.i.i = getelementptr [2 x { i32, [3 x i32] }]* @pgm, i32 0, i32 %i_addr.3210.0.i.i, i32 1, i32 2 ; <i32*> [#uses=1]
- %tmp139.i.i = load i32* %tmp138.i.i ; <i32> [#uses=1]
- %tmp140.i.i = getelementptr [14 x i32]* @r, i32 0, i32 %tmp139.i.i ; <i32*> [#uses=1]
- %tmp141.i.i = load i32* %tmp140.i.i ; <i32> [#uses=1]
- %tmp143.i.i = add i32 %i_addr.3210.0.i.i, 12 ; <i32> [#uses=1]
- %tmp146.i.i = getelementptr [2 x { i32, [3 x i32] }]* @pgm, i32 0, i32 %i_addr.3210.0.i.i, i32 0 ; <i32*> [#uses=1]
- %tmp147.i.i = load i32* %tmp146.i.i ; <i32> [#uses=1]
- %tmp149.i.i = getelementptr [13 x %struct.anon]* @isa, i32 0, i32 %tmp147.i.i, i32 0 ; <i32 (i32, i32, i32)**> [#uses=1]
- %tmp150.i.i = load i32 (i32, i32, i32)** %tmp149.i.i ; <i32 (i32, i32, i32)*> [#uses=1]
- %tmp154.i.i = tail call i32 %tmp150.i.i( i32 %tmp127.i.i, i32 %tmp134.i.i, i32 %tmp141.i.i ) ; <i32> [#uses=1]
- %tmp155.i.i = getelementptr [14 x i32]* @r, i32 0, i32 %tmp143.i.i ; <i32*> [#uses=1]
- store i32 %tmp154.i.i, i32* %tmp155.i.i
- %tmp159.i.i = getelementptr [2 x i32]* @counter, i32 0, i32 %i_addr.3210.0.i.i ; <i32*> [#uses=2]
- %tmp160.i.i = load i32* %tmp159.i.i ; <i32> [#uses=1]
- %tmp161.i.i = add i32 %tmp160.i.i, 1 ; <i32> [#uses=1]
- store i32 %tmp161.i.i, i32* %tmp159.i.i
- %tmp166.i.i = add i32 %i_addr.3210.0.i.i, 1 ; <i32> [#uses=2]
- %tmp168.i.i = load i32* @numi ; <i32> [#uses=1]
- icmp slt i32 %tmp166.i.i, %tmp168.i.i ; <i1>:0 [#uses=1]
- br i1 %0, label %bb115.i.i.bb115.i.i_crit_edge, label %bb115.i.i.bb170.i.i_crit_edge.exitStub
-}
diff --git a/release_23/test/CodeGen/ARM/clz.ll b/release_23/test/CodeGen/ARM/clz.ll
deleted file mode 100644
index 389fb2ce1ee8..000000000000
--- a/release_23/test/CodeGen/ARM/clz.ll
+++ /dev/null
@@ -1,8 +0,0 @@
-; RUN: llvm-as < %s | llc -march=arm -mattr=+v5t | grep clz
-
-declare i32 @llvm.ctlz.i32(i32)
-
-define i32 @test(i32 %x) {
- %tmp.1 = call i32 @llvm.ctlz.i32( i32 %x ) ; <i32> [#uses=1]
- ret i32 %tmp.1
-}
diff --git a/release_23/test/CodeGen/ARM/compare-call.ll b/release_23/test/CodeGen/ARM/compare-call.ll
deleted file mode 100644
index fcb8b179c803..000000000000
--- a/release_23/test/CodeGen/ARM/compare-call.ll
+++ /dev/null
@@ -1,20 +0,0 @@
-; RUN: llvm-as < %s | llc -march=arm -mattr=+v6,+vfp2 | \
-; RUN: grep fcmpes
-
-define void @test3(float* %glob, i32 %X) {
-entry:
- %tmp = load float* %glob ; <float> [#uses=1]
- %tmp2 = getelementptr float* %glob, i32 2 ; <float*> [#uses=1]
- %tmp3 = load float* %tmp2 ; <float> [#uses=1]
- %tmp.upgrd.1 = fcmp ogt float %tmp, %tmp3 ; <i1> [#uses=1]
- br i1 %tmp.upgrd.1, label %cond_true, label %UnifiedReturnBlock
-
-cond_true: ; preds = %entry
- %tmp.upgrd.2 = tail call i32 (...)* @bar( ) ; <i32> [#uses=0]
- ret void
-
-UnifiedReturnBlock: ; preds = %entry
- ret void
-}
-
-declare i32 @bar(...)
diff --git a/release_23/test/CodeGen/ARM/constants.ll b/release_23/test/CodeGen/ARM/constants.ll
deleted file mode 100644
index 2d863128a863..000000000000
--- a/release_23/test/CodeGen/ARM/constants.ll
+++ /dev/null
@@ -1,42 +0,0 @@
-; RUN: llvm-as < %s | llc -march=arm | \
-; RUN: grep {mov r0, #0} | count 1
-; RUN: llvm-as < %s | llc -march=arm | \
-; RUN: grep {mov r0, #255$} | count 1
-; RUN: llvm-as < %s | llc -march=arm | \
-; RUN: grep {mov r0.*256} | count 1
-; RUN: llvm-as < %s | llc -march=arm | grep {orr.*256} | count 1
-; RUN: llvm-as < %s | llc -march=arm | grep {mov r0, .*-1073741761} | count 1
-; RUN: llvm-as < %s | llc -march=arm | grep {mov r0, .*1008} | count 1
-; RUN: llvm-as < %s | llc -march=arm | grep {cmp r0, #1, 16} | count 1
-
-define i32 @f1() {
- ret i32 0
-}
-
-define i32 @f2() {
- ret i32 255
-}
-
-define i32 @f3() {
- ret i32 256
-}
-
-define i32 @f4() {
- ret i32 257
-}
-
-define i32 @f5() {
- ret i32 -1073741761
-}
-
-define i32 @f6() {
- ret i32 1008
-}
-
-define void @f7(i32 %a) {
- %b = icmp ugt i32 %a, 65536 ; <i1> [#uses=1]
- br i1 %b, label %r, label %r
-
-r: ; preds = %0, %0
- ret void
-}
diff --git a/release_23/test/CodeGen/ARM/ctors_dtors.ll b/release_23/test/CodeGen/ARM/ctors_dtors.ll
deleted file mode 100644
index 5caa5b1266da..000000000000
--- a/release_23/test/CodeGen/ARM/ctors_dtors.ll
+++ /dev/null
@@ -1,25 +0,0 @@
-; RUN: llvm-as < %s | llc -mtriple=arm-apple-darwin | \
-; RUN: grep {\\.mod_init_func}
-; RUN: llvm-as < %s | llc -mtriple=arm-apple-darwin | \
-; RUN: grep {\\.mod_term_func}
-; RUN: llvm-as < %s | llc -mtriple=arm-linux-gnu | \
-; RUN: grep {\\.section \\.ctors,"aw",.progbits}
-; RUN: llvm-as < %s | llc -mtriple=arm-linux-gnu | \
-; RUN: grep {\\.section \\.dtors,"aw",.progbits}
-; RUN: llvm-as < %s | llc -mtriple=arm-linux-gnueabi | \
-; RUN: grep {\\.section \\.init_array,"aw",.init_array}
-; RUN: llvm-as < %s | llc -mtriple=arm-linux-gnueabi | \
-; RUN: grep {\\.section \\.fini_array,"aw",.fini_array}
-
-@llvm.global_ctors = appending global [1 x { i32, void ()* }] [ { i32, void ()* } { i32 65535, void ()* @__mf_init } ] ; <[1 x { i32, void ()* }]*> [#uses=0]
-@llvm.global_dtors = appending global [1 x { i32, void ()* }] [ { i32, void ()* } { i32 65535, void ()* @__mf_fini } ] ; <[1 x { i32, void ()* }]*> [#uses=0]
-
-define void @__mf_init() {
-entry:
- ret void
-}
-
-define void @__mf_fini() {
-entry:
- ret void
-}
diff --git a/release_23/test/CodeGen/ARM/dg.exp b/release_23/test/CodeGen/ARM/dg.exp
deleted file mode 100644
index ba4ade5c1046..000000000000
--- a/release_23/test/CodeGen/ARM/dg.exp
+++ /dev/null
@@ -1,5 +0,0 @@
-load_lib llvm.exp
-
-if { [llvm_supports_target ARM] } {
- RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
-}
diff --git a/release_23/test/CodeGen/ARM/div.ll b/release_23/test/CodeGen/ARM/div.ll
deleted file mode 100644
index 1085ec7fa624..000000000000
--- a/release_23/test/CodeGen/ARM/div.ll
+++ /dev/null
@@ -1,30 +0,0 @@
-; RUN: llvm-as < %s | llc -march=arm > %t
-; RUN: grep __divsi3 %t
-; RUN: grep __udivsi3 %t
-; RUN: grep __modsi3 %t
-; RUN: grep __umodsi3 %t
-
-define i32 @f1(i32 %a, i32 %b) {
-entry:
- %tmp1 = sdiv i32 %a, %b ; <i32> [#uses=1]
- ret i32 %tmp1
-}
-
-define i32 @f2(i32 %a, i32 %b) {
-entry:
- %tmp1 = udiv i32 %a, %b ; <i32> [#uses=1]
- ret i32 %tmp1
-}
-
-define i32 @f3(i32 %a, i32 %b) {
-entry:
- %tmp1 = srem i32 %a, %b ; <i32> [#uses=1]
- ret i32 %tmp1
-}
-
-define i32 @f4(i32 %a, i32 %b) {
-entry:
- %tmp1 = urem i32 %a, %b ; <i32> [#uses=1]
- ret i32 %tmp1
-}
-
diff --git a/release_23/test/CodeGen/ARM/dyn-stackalloc.ll b/release_23/test/CodeGen/ARM/dyn-stackalloc.ll
deleted file mode 100644
index 602fd9bd550a..000000000000
--- a/release_23/test/CodeGen/ARM/dyn-stackalloc.ll
+++ /dev/null
@@ -1,60 +0,0 @@
-; RUN: llvm-as < %s | llc -march=arm
-; RUN: llvm-as < %s | llc -march=thumb | not grep {ldr sp}
-; RUN: llvm-as < %s | llc -mtriple=thumb-apple-darwin | \
-; RUN: not grep {sub.*r7}
-; RUN: llvm-as < %s | llc -march=thumb | grep 4294967280
-
- %struct.state = type { i32, %struct.info*, float**, i32, i32, i32, i32, i32, i32, i32, i32, i32, i64, i64, i64, i64, i64, i64, i8* }
- %struct.info = type { i32, i32, i32, i32, i32, i32, i32, i8* }
-
-define void @t1(%struct.state* %v) {
- %tmp6 = load i32* null
- %tmp8 = alloca float, i32 %tmp6
- store i32 1, i32* null
- br i1 false, label %bb123.preheader, label %return
-
-bb123.preheader:
- br i1 false, label %bb43, label %return
-
-bb43:
- call fastcc void @f1( float* %tmp8, float* null, i32 0 )
- %tmp70 = load i32* null
- %tmp85 = getelementptr float* %tmp8, i32 0
- call fastcc void @f2( float* null, float* null, float* %tmp85, i32 %tmp70 )
- ret void
-
-return:
- ret void
-}
-
-declare fastcc void @f1(float*, float*, i32)
-
-declare fastcc void @f2(float*, float*, float*, i32)
-
- %struct.comment = type { i8**, i32*, i32, i8* }
-@str215 = external global [2 x i8]
-
-define void @t2(%struct.comment* %vc, i8* %tag, i8* %contents) {
- %tmp1 = call i32 @strlen( i8* %tag )
- %tmp3 = call i32 @strlen( i8* %contents )
- %tmp4 = add i32 %tmp1, 2
- %tmp5 = add i32 %tmp4, %tmp3
- %tmp6 = alloca i8, i32 %tmp5
- %tmp9 = call i8* @strcpy( i8* %tmp6, i8* %tag )
- %tmp6.len = call i32 @strlen( i8* %tmp6 )
- %tmp6.indexed = getelementptr i8* %tmp6, i32 %tmp6.len
- call void @llvm.memcpy.i32( i8* %tmp6.indexed, i8* getelementptr ([2 x i8]* @str215, i32 0, i32 0), i32 2, i32 1 )
- %tmp15 = call i8* @strcat( i8* %tmp6, i8* %contents )
- call fastcc void @comment_add( %struct.comment* %vc, i8* %tmp6 )
- ret void
-}
-
-declare i32 @strlen(i8*)
-
-declare i8* @strcat(i8*, i8*)
-
-declare fastcc void @comment_add(%struct.comment*, i8*)
-
-declare void @llvm.memcpy.i32(i8*, i8*, i32, i32)
-
-declare i8* @strcpy(i8*, i8*)
diff --git a/release_23/test/CodeGen/ARM/extloadi1.ll b/release_23/test/CodeGen/ARM/extloadi1.ll
deleted file mode 100644
index 2e9041c6ecab..000000000000
--- a/release_23/test/CodeGen/ARM/extloadi1.ll
+++ /dev/null
@@ -1,20 +0,0 @@
-; RUN: llvm-as < %s | llc -march=arm
-@handler_installed.6144.b = external global i1 ; <i1*> [#uses=1]
-
-define void @__mf_sigusr1_respond() {
-entry:
- %tmp8.b = load i1* @handler_installed.6144.b ; <i1> [#uses=1]
- br i1 false, label %cond_true7, label %cond_next
-
-cond_next: ; preds = %entry
- br i1 %tmp8.b, label %bb, label %cond_next3
-
-cond_next3: ; preds = %cond_next
- ret void
-
-bb: ; preds = %cond_next
- ret void
-
-cond_true7: ; preds = %entry
- ret void
-}
diff --git a/release_23/test/CodeGen/ARM/fcopysign.ll b/release_23/test/CodeGen/ARM/fcopysign.ll
deleted file mode 100644
index 66acda9c9b91..000000000000
--- a/release_23/test/CodeGen/ARM/fcopysign.ll
+++ /dev/null
@@ -1,18 +0,0 @@
-; RUN: llvm-as < %s | llc -march=arm | grep bic | count 2
-; RUN: llvm-as < %s | llc -march=arm -mattr=+v6,+vfp2 | \
-; RUN: grep fneg | count 2
-
-define float @test1(float %x, double %y) {
- %tmp = fpext float %x to double
- %tmp2 = tail call double @copysign( double %tmp, double %y )
- %tmp3 = fptrunc double %tmp2 to float
- ret float %tmp3
-}
-
-define double @test2(double %x, float %y) {
- %tmp = fpext float %y to double
- %tmp2 = tail call double @copysign( double %x, double %tmp )
- ret double %tmp2
-}
-
-declare double @copysign(double, double)
diff --git a/release_23/test/CodeGen/ARM/fmdrr-fmrrd.ll b/release_23/test/CodeGen/ARM/fmdrr-fmrrd.ll
deleted file mode 100644
index 315e6238732f..000000000000
--- a/release_23/test/CodeGen/ARM/fmdrr-fmrrd.ll
+++ /dev/null
@@ -1,13 +0,0 @@
-; RUN: llvm-as < %s | llc -march=arm -mattr=vfp2 | not grep fmdrr
-; RUN: llvm-as < %s | llc -march=arm -mattr=vfp2 | not grep fmrrd
-
-; naive codegen for this is:
-; _i:
-; fmdrr d0, r0, r1
-; fmrrd r0, r1, d0
-; bx lr
-
-define i64 @test(double %X) {
- %Y = bitcast double %X to i64
- ret i64 %Y
-}
diff --git a/release_23/test/CodeGen/ARM/fnmul.ll b/release_23/test/CodeGen/ARM/fnmul.ll
deleted file mode 100644
index 87a30c99e281..000000000000
--- a/release_23/test/CodeGen/ARM/fnmul.ll
+++ /dev/null
@@ -1,11 +0,0 @@
-; RUN: llvm-as < %s | llc -march=arm -mattr=+v6,+vfp2 | grep fnmuld
-; RUN: llvm-as < %s | llc -march=arm -mattr=+v6,+vfp2 -enable-sign-dependent-rounding-fp-math | grep fmul
-
-
-define double @t1(double %a, double %b) {
-entry:
- %tmp2 = sub double -0.000000e+00, %a ; <double> [#uses=1]
- %tmp4 = mul double %tmp2, %b ; <double> [#uses=1]
- ret double %tmp4
-}
-
diff --git a/release_23/test/CodeGen/ARM/fp.ll b/release_23/test/CodeGen/ARM/fp.ll
deleted file mode 100644
index ba199dbf5608..000000000000
--- a/release_23/test/CodeGen/ARM/fp.ll
+++ /dev/null
@@ -1,62 +0,0 @@
-; RUN: llvm-as < %s | llc -march=arm -mattr=+vfp2 > %t
-; RUN: grep fmsr %t | count 4
-; RUN: grep fsitos %t
-; RUN: grep fmrs %t | count 2
-; RUN: grep fsitod %t
-; RUN: grep fmrrd %t | count 3
-; RUN: not grep fmdrr %t
-; RUN: grep fldd %t
-; RUN: grep fuitod %t
-; RUN: grep fuitos %t
-; RUN: grep 1065353216 %t
-
-define float @f(i32 %a) {
-entry:
- %tmp = sitofp i32 %a to float ; <float> [#uses=1]
- ret float %tmp
-}
-
-define double @g(i32 %a) {
-entry:
- %tmp = sitofp i32 %a to double ; <double> [#uses=1]
- ret double %tmp
-}
-
-define double @uint_to_double(i32 %a) {
-entry:
- %tmp = uitofp i32 %a to double ; <double> [#uses=1]
- ret double %tmp
-}
-
-define float @uint_to_float(i32 %a) {
-entry:
- %tmp = uitofp i32 %a to float ; <float> [#uses=1]
- ret float %tmp
-}
-
-define double @h(double* %v) {
-entry:
- %tmp = load double* %v ; <double> [#uses=1]
- ret double %tmp
-}
-
-define float @h2() {
-entry:
- ret float 1.000000e+00
-}
-
-define double @f2(double %a) {
- ret double %a
-}
-
-define void @f3() {
-entry:
- %tmp = call double @f5( ) ; <double> [#uses=1]
- call void @f4( double %tmp )
- ret void
-}
-
-declare void @f4(double)
-
-declare double @f5()
-
diff --git a/release_23/test/CodeGen/ARM/fparith.ll b/release_23/test/CodeGen/ARM/fparith.ll
deleted file mode 100644
index 11933d5f70c9..000000000000
--- a/release_23/test/CodeGen/ARM/fparith.ll
+++ /dev/null
@@ -1,85 +0,0 @@
-; RUN: llvm-as < %s | llc -march=arm -mattr=+vfp2 > %t
-; RUN: grep fadds %t
-; RUN: grep faddd %t
-; RUN: grep fmuls %t
-; RUN: grep fmuld %t
-; RUN: grep eor %t
-; RUN: grep fnegd %t
-; RUN: grep fdivs %t
-; RUN: grep fdivd %t
-
-define float @f1(float %a, float %b) {
-entry:
- %tmp = add float %a, %b ; <float> [#uses=1]
- ret float %tmp
-}
-
-define double @f2(double %a, double %b) {
-entry:
- %tmp = add double %a, %b ; <double> [#uses=1]
- ret double %tmp
-}
-
-define float @f3(float %a, float %b) {
-entry:
- %tmp = mul float %a, %b ; <float> [#uses=1]
- ret float %tmp
-}
-
-define double @f4(double %a, double %b) {
-entry:
- %tmp = mul double %a, %b ; <double> [#uses=1]
- ret double %tmp
-}
-
-define float @f5(float %a, float %b) {
-entry:
- %tmp = sub float %a, %b ; <float> [#uses=1]
- ret float %tmp
-}
-
-define double @f6(double %a, double %b) {
-entry:
- %tmp = sub double %a, %b ; <double> [#uses=1]
- ret double %tmp
-}
-
-define float @f7(float %a) {
-entry:
- %tmp1 = sub float -0.000000e+00, %a ; <float> [#uses=1]
- ret float %tmp1
-}
-
-define double @f8(double %a) {
-entry:
- %tmp1 = sub double -0.000000e+00, %a ; <double> [#uses=1]
- ret double %tmp1
-}
-
-define float @f9(float %a, float %b) {
-entry:
- %tmp1 = fdiv float %a, %b ; <float> [#uses=1]
- ret float %tmp1
-}
-
-define double @f10(double %a, double %b) {
-entry:
- %tmp1 = fdiv double %a, %b ; <double> [#uses=1]
- ret double %tmp1
-}
-
-define float @f11(float %a) {
-entry:
- %tmp1 = call float @fabsf( float %a ) ; <float> [#uses=1]
- ret float %tmp1
-}
-
-declare float @fabsf(float)
-
-define double @f12(double %a) {
-entry:
- %tmp1 = call double @fabs( double %a ) ; <double> [#uses=1]
- ret double %tmp1
-}
-
-declare double @fabs(double)
diff --git a/release_23/test/CodeGen/ARM/fpcmp.ll b/release_23/test/CodeGen/ARM/fpcmp.ll
deleted file mode 100644
index ce0f4029589d..000000000000
--- a/release_23/test/CodeGen/ARM/fpcmp.ll
+++ /dev/null
@@ -1,57 +0,0 @@
-; RUN: llvm-as < %s | llc -march=arm -mattr=+vfp2 > %t
-; RUN: grep movmi %t
-; RUN: grep moveq %t
-; RUN: grep movgt %t
-; RUN: grep movge %t
-; RUN: grep movne %t
-; RUN: grep fcmped %t | count 1
-; RUN: grep fcmpes %t | count 6
-
-define i32 @f1(float %a) {
-entry:
- %tmp = fcmp olt float %a, 1.000000e+00 ; <i1> [#uses=1]
- %tmp1 = zext i1 %tmp to i32 ; <i32> [#uses=1]
- ret i32 %tmp1
-}
-
-define i32 @f2(float %a) {
-entry:
- %tmp = fcmp oeq float %a, 1.000000e+00 ; <i1> [#uses=1]
- %tmp2 = zext i1 %tmp to i32 ; <i32> [#uses=1]
- ret i32 %tmp2
-}
-
-define i32 @f3(float %a) {
-entry:
- %tmp = fcmp ogt float %a, 1.000000e+00 ; <i1> [#uses=1]
- %tmp3 = zext i1 %tmp to i32 ; <i32> [#uses=1]
- ret i32 %tmp3
-}
-
-define i32 @f4(float %a) {
-entry:
- %tmp = fcmp oge float %a, 1.000000e+00 ; <i1> [#uses=1]
- %tmp4 = zext i1 %tmp to i32 ; <i32> [#uses=1]
- ret i32 %tmp4
-}
-
-define i32 @f5(float %a) {
-entry:
- %tmp = fcmp ole float %a, 1.000000e+00 ; <i1> [#uses=1]
- %tmp5 = zext i1 %tmp to i32 ; <i32> [#uses=1]
- ret i32 %tmp5
-}
-
-define i32 @f6(float %a) {
-entry:
- %tmp = fcmp une float %a, 1.000000e+00 ; <i1> [#uses=1]
- %tmp6 = zext i1 %tmp to i32 ; <i32> [#uses=1]
- ret i32 %tmp6
-}
-
-define i32 @g1(double %a) {
-entry:
- %tmp = fcmp olt double %a, 1.000000e+00 ; <i1> [#uses=1]
- %tmp7 = zext i1 %tmp to i32 ; <i32> [#uses=1]
- ret i32 %tmp7
-}
diff --git a/release_23/test/CodeGen/ARM/fpcmp_ueq.ll b/release_23/test/CodeGen/ARM/fpcmp_ueq.ll
deleted file mode 100644
index 3e749afb400c..000000000000
--- a/release_23/test/CodeGen/ARM/fpcmp_ueq.ll
+++ /dev/null
@@ -1,10 +0,0 @@
-; RUN: llvm-as < %s | llc -march=arm | grep moveq
-; RUN: llvm-as < %s | llc -march=arm -mattr=+vfp2 | grep movvs
-
-define i32 @f7(float %a, float %b) {
-entry:
- %tmp = fcmp ueq float %a,%b
- %retval = select i1 %tmp, i32 666, i32 42
- ret i32 %retval
-}
-
diff --git a/release_23/test/CodeGen/ARM/fpconv.ll b/release_23/test/CodeGen/ARM/fpconv.ll
deleted file mode 100644
index 23850075d0dc..000000000000
--- a/release_23/test/CodeGen/ARM/fpconv.ll
+++ /dev/null
@@ -1,83 +0,0 @@
-; RUN: llvm-as < %s | llc -march=arm -mattr=+vfp2 > %t
-; RUN: grep fcvtsd %t
-; RUN: grep fcvtds %t
-; RUN: grep ftosizs %t
-; RUN: grep ftouizs %t
-; RUN: grep ftosizd %t
-; RUN: grep ftouizd %t
-; RUN: grep fsitos %t
-; RUN: grep fsitod %t
-; RUN: grep fuitos %t
-; RUN: grep fuitod %t
-; RUN: llvm-as < %s | llc -march=arm > %t
-; RUN: grep truncdfsf2 %t
-; RUN: grep extendsfdf2 %t
-; RUN: grep fixsfsi %t
-; RUN: grep fixunssfsi %t
-; RUN: grep fixdfsi %t
-; RUN: grep fixunsdfsi %t
-; RUN: grep floatsisf %t
-; RUN: grep floatsidf %t
-; RUN: grep floatunsisf %t
-; RUN: grep floatunsidf %t
-; RUN: llvm-as < %s | llc -march=thumb
-
-define float @f1(double %x) {
-entry:
- %tmp1 = fptrunc double %x to float ; <float> [#uses=1]
- ret float %tmp1
-}
-
-define double @f2(float %x) {
-entry:
- %tmp1 = fpext float %x to double ; <double> [#uses=1]
- ret double %tmp1
-}
-
-define i32 @f3(float %x) {
-entry:
- %tmp = fptosi float %x to i32 ; <i32> [#uses=1]
- ret i32 %tmp
-}
-
-define i32 @f4(float %x) {
-entry:
- %tmp = fptoui float %x to i32 ; <i32> [#uses=1]
- ret i32 %tmp
-}
-
-define i32 @f5(double %x) {
-entry:
- %tmp = fptosi double %x to i32 ; <i32> [#uses=1]
- ret i32 %tmp
-}
-
-define i32 @f6(double %x) {
-entry:
- %tmp = fptoui double %x to i32 ; <i32> [#uses=1]
- ret i32 %tmp
-}
-
-define float @f7(i32 %a) {
-entry:
- %tmp = sitofp i32 %a to float ; <float> [#uses=1]
- ret float %tmp
-}
-
-define double @f8(i32 %a) {
-entry:
- %tmp = sitofp i32 %a to double ; <double> [#uses=1]
- ret double %tmp
-}
-
-define float @f9(i32 %a) {
-entry:
- %tmp = uitofp i32 %a to float ; <float> [#uses=1]
- ret float %tmp
-}
-
-define double @f10(i32 %a) {
-entry:
- %tmp = uitofp i32 %a to double ; <double> [#uses=1]
- ret double %tmp
-}
diff --git a/release_23/test/CodeGen/ARM/fpmem.ll b/release_23/test/CodeGen/ARM/fpmem.ll
deleted file mode 100644
index 48204ecdebf9..000000000000
--- a/release_23/test/CodeGen/ARM/fpmem.ll
+++ /dev/null
@@ -1,22 +0,0 @@
-; RUN: llvm-as < %s | llc -march=arm | \
-; RUN: grep {mov r0, #0} | count 1
-; RUN: llvm-as < %s | llc -march=arm -mattr=+vfp2 | \
-; RUN: grep {flds.*\\\[} | count 1
-; RUN: llvm-as < %s | llc -march=arm -mattr=+vfp2 | \
-; RUN: grep {fsts.*\\\[} | count 1
-
-define float @f1(float %a) {
- ret float 0.000000e+00
-}
-
-define float @f2(float* %v, float %u) {
- %tmp = load float* %v ; <float> [#uses=1]
- %tmp1 = add float %tmp, %u ; <float> [#uses=1]
- ret float %tmp1
-}
-
-define void @f3(float %a, float %b, float* %v) {
- %tmp = add float %a, %b ; <float> [#uses=1]
- store float %tmp, float* %v
- ret void
-}
diff --git a/release_23/test/CodeGen/ARM/fpowi.ll b/release_23/test/CodeGen/ARM/fpowi.ll
deleted file mode 100644
index ab09ffff6b36..000000000000
--- a/release_23/test/CodeGen/ARM/fpowi.ll
+++ /dev/null
@@ -1,16 +0,0 @@
-; RUN: llvm-as < %s | llc -mtriple=arm-linux-gnueabi | grep powidf2
-; PR1287
-
-; ModuleID = '<stdin>'
-target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64"
-target triple = "arm-linux-gnueabi"
-
-define double @_ZSt3powdi(double %__x, i32 %__i) {
-entry:
- %tmp3 = call double @llvm.powi.f64( double 0.000000e+00, i32 0 ) ; <double> [#uses=1]
- store double %tmp3, double* null, align 8
- unreachable
-}
-
-declare double @llvm.powi.f64(double, i32)
-
diff --git a/release_23/test/CodeGen/ARM/fptoint.ll b/release_23/test/CodeGen/ARM/fptoint.ll
deleted file mode 100644
index 41168acc42a5..000000000000
--- a/release_23/test/CodeGen/ARM/fptoint.ll
+++ /dev/null
@@ -1,47 +0,0 @@
-; RUN: llvm-as < %s | llc -march=arm -mattr=+v6,+vfp2 | grep fmrs | count 1
-; RUN: llvm-as < %s | llc -march=arm -mattr=+v6,+vfp2 | not grep fmrrd
-
-@i = weak global i32 0 ; <i32*> [#uses=2]
-@u = weak global i32 0 ; <i32*> [#uses=2]
-
-define i32 @foo1(float *%x) {
- %tmp1 = load float* %x
- %tmp2 = bitcast float %tmp1 to i32
- ret i32 %tmp2
-}
-
-define i64 @foo2(double *%x) {
- %tmp1 = load double* %x
- %tmp2 = bitcast double %tmp1 to i64
- ret i64 %tmp2
-}
-
-define void @foo5(float %x) {
- %tmp1 = fptosi float %x to i32
- store i32 %tmp1, i32* @i
- ret void
-}
-
-define void @foo6(float %x) {
- %tmp1 = fptoui float %x to i32
- store i32 %tmp1, i32* @u
- ret void
-}
-
-define void @foo7(double %x) {
- %tmp1 = fptosi double %x to i32
- store i32 %tmp1, i32* @i
- ret void
-}
-
-define void @foo8(double %x) {
- %tmp1 = fptoui double %x to i32
- store i32 %tmp1, i32* @u
- ret void
-}
-
-define void @foo9(double %x) {
- %tmp = fptoui double %x to i16
- store i16 %tmp, i16* null
- ret void
-}
diff --git a/release_23/test/CodeGen/ARM/frame_thumb.ll b/release_23/test/CodeGen/ARM/frame_thumb.ll
deleted file mode 100644
index fe82db992129..000000000000
--- a/release_23/test/CodeGen/ARM/frame_thumb.ll
+++ /dev/null
@@ -1,9 +0,0 @@
-; RUN: llvm-as < %s | llc -march=thumb -mtriple=arm-apple-darwin \
-; RUN: -disable-fp-elim | not grep {r11}
-; RUN: llvm-as < %s | llc -march=thumb -mtriple=arm-linux-gnueabi \
-; RUN: -disable-fp-elim | not grep {r11}
-
-define i32 @f() {
-entry:
- ret i32 10
-}
diff --git a/release_23/test/CodeGen/ARM/hello.ll b/release_23/test/CodeGen/ARM/hello.ll
deleted file mode 100644
index 16231da39b7c..000000000000
--- a/release_23/test/CodeGen/ARM/hello.ll
+++ /dev/null
@@ -1,14 +0,0 @@
-; RUN: llvm-as < %s | llc -march=arm
-; RUN: llvm-as < %s | llc -mtriple=arm-linux-gnueabi | grep mov | count 1
-; RUN: llvm-as < %s | llc -mtriple=arm-linux-gnu --disable-fp-elim | \
-; RUN: grep mov | count 3
-; RUN: llvm-as < %s | llc -mtriple=arm-apple-darwin | grep mov | count 2
-
-@str = internal constant [12 x i8] c"Hello World\00"
-
-define i32 @main() {
- %tmp = call i32 @puts( i8* getelementptr ([12 x i8]* @str, i32 0, i64 0) ) ; <i32> [#uses=0]
- ret i32 0
-}
-
-declare i32 @puts(i8*)
diff --git a/release_23/test/CodeGen/ARM/iabs.ll b/release_23/test/CodeGen/ARM/iabs.ll
deleted file mode 100644
index f10591f41f76..000000000000
--- a/release_23/test/CodeGen/ARM/iabs.ll
+++ /dev/null
@@ -1,22 +0,0 @@
-; RUN: llvm-as < %s | llc -march=arm -stats |& \
-; RUN: grep {3 .*Number of machine instrs printed}
-; RUN: llvm-as < %s | llc -march=thumb -stats |& \
-; RUN: grep {4 .*Number of machine instrs printed}
-
-;; Integer absolute value, should produce something as good as: ARM:
-;; add r3, r0, r0, asr #31
-;; eor r0, r3, r0, asr #31
-;; bx lr
-;; Thumb:
-;; asr r2, r0, #31
-;; add r0, r0, r2
-;; eor r0, r2
-;; bx lr
-
-define i32 @test(i32 %a) {
- %tmp1neg = sub i32 0, %a
- %b = icmp sgt i32 %a, -1
- %abs = select i1 %b, i32 %a, i32 %tmp1neg
- ret i32 %abs
-}
-
diff --git a/release_23/test/CodeGen/ARM/ifcvt1.ll b/release_23/test/CodeGen/ARM/ifcvt1.ll
deleted file mode 100644
index 7d429550b3ad..000000000000
--- a/release_23/test/CodeGen/ARM/ifcvt1.ll
+++ /dev/null
@@ -1,15 +0,0 @@
-; RUN: llvm-as < %s | llc -march=arm
-; RUN: llvm-as < %s | llc -march=arm | grep bx | count 1
-
-define i32 @t1(i32 %a, i32 %b) {
- %tmp2 = icmp eq i32 %a, 0
- br i1 %tmp2, label %cond_false, label %cond_true
-
-cond_true:
- %tmp5 = add i32 %b, 1
- ret i32 %tmp5
-
-cond_false:
- %tmp7 = add i32 %b, -1
- ret i32 %tmp7
-}
diff --git a/release_23/test/CodeGen/ARM/ifcvt2.ll b/release_23/test/CodeGen/ARM/ifcvt2.ll
deleted file mode 100644
index 394206121218..000000000000
--- a/release_23/test/CodeGen/ARM/ifcvt2.ll
+++ /dev/null
@@ -1,36 +0,0 @@
-; RUN: llvm-as < %s | llc -march=arm
-; RUN: llvm-as < %s | llc -march=arm | grep bxlt | count 1
-; RUN: llvm-as < %s | llc -march=arm | grep bxgt | count 1
-; RUN: llvm-as < %s | llc -march=arm | grep bxge | count 1
-
-define i32 @t1(i32 %a, i32 %b, i32 %c, i32 %d) {
- %tmp2 = icmp sgt i32 %c, 10
- %tmp5 = icmp slt i32 %d, 4
- %tmp8 = or i1 %tmp5, %tmp2
- %tmp13 = add i32 %b, %a
- br i1 %tmp8, label %cond_true, label %UnifiedReturnBlock
-
-cond_true:
- %tmp15 = add i32 %tmp13, %c
- %tmp1821 = sub i32 %tmp15, %d
- ret i32 %tmp1821
-
-UnifiedReturnBlock:
- ret i32 %tmp13
-}
-
-define i32 @t2(i32 %a, i32 %b, i32 %c, i32 %d) {
- %tmp2 = icmp sgt i32 %c, 10
- %tmp5 = icmp slt i32 %d, 4
- %tmp8 = and i1 %tmp5, %tmp2
- %tmp13 = add i32 %b, %a
- br i1 %tmp8, label %cond_true, label %UnifiedReturnBlock
-
-cond_true:
- %tmp15 = add i32 %tmp13, %c
- %tmp1821 = sub i32 %tmp15, %d
- ret i32 %tmp1821
-
-UnifiedReturnBlock:
- ret i32 %tmp13
-}
diff --git a/release_23/test/CodeGen/ARM/ifcvt3.ll b/release_23/test/CodeGen/ARM/ifcvt3.ll
deleted file mode 100644
index 620bcbea1f27..000000000000
--- a/release_23/test/CodeGen/ARM/ifcvt3.ll
+++ /dev/null
@@ -1,19 +0,0 @@
-; RUN: llvm-as < %s | llc -march=arm
-; RUN: llvm-as < %s | llc -march=arm | grep cmpne | count 1
-; RUN: llvm-as < %s | llc -march=arm | grep bx | count 2
-
-define i32 @t1(i32 %a, i32 %b, i32 %c, i32 %d) {
- switch i32 %c, label %cond_next [
- i32 1, label %cond_true
- i32 7, label %cond_true
- ]
-
-cond_true:
- %tmp12 = add i32 %a, 1
- %tmp1518 = add i32 %tmp12, %b
- ret i32 %tmp1518
-
-cond_next:
- %tmp15 = add i32 %b, %a
- ret i32 %tmp15
-}
diff --git a/release_23/test/CodeGen/ARM/ifcvt4.ll b/release_23/test/CodeGen/ARM/ifcvt4.ll
deleted file mode 100644
index ce5a679196c5..000000000000
--- a/release_23/test/CodeGen/ARM/ifcvt4.ll
+++ /dev/null
@@ -1,38 +0,0 @@
-; RUN: llvm-as < %s | llc -march=arm
-; RUN: llvm-as < %s | llc -march=arm | grep subgt | count 1
-; RUN: llvm-as < %s | llc -march=arm | grep suble | count 1
-; FIXME: Check for # of unconditional branch after adding branch folding post ifcvt.
-
-define i32 @t(i32 %a, i32 %b) {
-entry:
- %tmp1434 = icmp eq i32 %a, %b ; <i1> [#uses=1]
- br i1 %tmp1434, label %bb17, label %bb.outer
-
-bb.outer: ; preds = %cond_false, %entry
- %b_addr.021.0.ph = phi i32 [ %b, %entry ], [ %tmp10, %cond_false ] ; <i32> [#uses=5]
- %a_addr.026.0.ph = phi i32 [ %a, %entry ], [ %a_addr.026.0, %cond_false ] ; <i32> [#uses=1]
- br label %bb
-
-bb: ; preds = %cond_true, %bb.outer
- %indvar = phi i32 [ 0, %bb.outer ], [ %indvar.next, %cond_true ] ; <i32> [#uses=2]
- %tmp. = sub i32 0, %b_addr.021.0.ph ; <i32> [#uses=1]
- %tmp.40 = mul i32 %indvar, %tmp. ; <i32> [#uses=1]
- %a_addr.026.0 = add i32 %tmp.40, %a_addr.026.0.ph ; <i32> [#uses=6]
- %tmp3 = icmp sgt i32 %a_addr.026.0, %b_addr.021.0.ph ; <i1> [#uses=1]
- br i1 %tmp3, label %cond_true, label %cond_false
-
-cond_true: ; preds = %bb
- %tmp7 = sub i32 %a_addr.026.0, %b_addr.021.0.ph ; <i32> [#uses=2]
- %tmp1437 = icmp eq i32 %tmp7, %b_addr.021.0.ph ; <i1> [#uses=1]
- %indvar.next = add i32 %indvar, 1 ; <i32> [#uses=1]
- br i1 %tmp1437, label %bb17, label %bb
-
-cond_false: ; preds = %bb
- %tmp10 = sub i32 %b_addr.021.0.ph, %a_addr.026.0 ; <i32> [#uses=2]
- %tmp14 = icmp eq i32 %a_addr.026.0, %tmp10 ; <i1> [#uses=1]
- br i1 %tmp14, label %bb17, label %bb.outer
-
-bb17: ; preds = %cond_false, %cond_true, %entry
- %a_addr.026.1 = phi i32 [ %a, %entry ], [ %tmp7, %cond_true ], [ %a_addr.026.0, %cond_false ] ; <i32> [#uses=1]
- ret i32 %a_addr.026.1
-}
diff --git a/release_23/test/CodeGen/ARM/ifcvt5.ll b/release_23/test/CodeGen/ARM/ifcvt5.ll
deleted file mode 100644
index f8d4f82bbe28..000000000000
--- a/release_23/test/CodeGen/ARM/ifcvt5.ll
+++ /dev/null
@@ -1,24 +0,0 @@
-; RUN: llvm-as < %s | llc -march=arm
-; RUN: llvm-as < %s | llc -march=arm | grep blge | count 1
-
-@x = external global i32* ; <i32**> [#uses=1]
-
-define void @foo(i32 %a) {
-entry:
- %tmp = load i32** @x ; <i32*> [#uses=1]
- store i32 %a, i32* %tmp
- ret void
-}
-
-define void @t1(i32 %a, i32 %b) {
-entry:
- %tmp1 = icmp sgt i32 %a, 10 ; <i1> [#uses=1]
- br i1 %tmp1, label %cond_true, label %UnifiedReturnBlock
-
-cond_true: ; preds = %entry
- tail call void @foo( i32 %b )
- ret void
-
-UnifiedReturnBlock: ; preds = %entry
- ret void
-}
diff --git a/release_23/test/CodeGen/ARM/ifcvt6.ll b/release_23/test/CodeGen/ARM/ifcvt6.ll
deleted file mode 100644
index 63c4a0819dbf..000000000000
--- a/release_23/test/CodeGen/ARM/ifcvt6.ll
+++ /dev/null
@@ -1,25 +0,0 @@
-; RUN: llvm-as < %s | \
-; RUN: llc -march=arm -mtriple=arm-apple-darwin
-; RUN: llvm-as < %s | \
-; RUN: llc -march=arm -mtriple=arm-apple-darwin | \
-; RUN: grep cmpne | count 1
-; RUN: llvm-as < %s | \
-; RUN: llc -march=arm -mtriple=arm-apple-darwin | \
-; RUN: grep ldmhi | count 1
-
-define void @foo(i32 %X, i32 %Y) {
-entry:
- %tmp1 = icmp ult i32 %X, 4 ; <i1> [#uses=1]
- %tmp4 = icmp eq i32 %Y, 0 ; <i1> [#uses=1]
- %tmp7 = or i1 %tmp4, %tmp1 ; <i1> [#uses=1]
- br i1 %tmp7, label %cond_true, label %UnifiedReturnBlock
-
-cond_true: ; preds = %entry
- %tmp10 = tail call i32 (...)* @bar( ) ; <i32> [#uses=0]
- ret void
-
-UnifiedReturnBlock: ; preds = %entry
- ret void
-}
-
-declare i32 @bar(...)
diff --git a/release_23/test/CodeGen/ARM/ifcvt7.ll b/release_23/test/CodeGen/ARM/ifcvt7.ll
deleted file mode 100644
index 6bb4b5609a58..000000000000
--- a/release_23/test/CodeGen/ARM/ifcvt7.ll
+++ /dev/null
@@ -1,39 +0,0 @@
-; RUN: llvm-as < %s | \
-; RUN: llc -march=arm -mtriple=arm-apple-darwin
-; RUN: llvm-as < %s | \
-; RUN: llc -march=arm -mtriple=arm-apple-darwin | \
-; RUN: grep cmpeq | count 1
-; RUN: llvm-as < %s | \
-; RUN: llc -march=arm -mtriple=arm-apple-darwin | \
-; RUN: grep moveq | count 1
-; RUN: llvm-as < %s | \
-; RUN: llc -march=arm -mtriple=arm-apple-darwin | \
-; RUN: grep ldmeq | count 1
-; FIXME: Need post-ifcvt branch folding to get rid of the extra br at end of BB1.
-
- %struct.quad_struct = type { i32, i32, %struct.quad_struct*, %struct.quad_struct*, %struct.quad_struct*, %struct.quad_struct*, %struct.quad_struct* }
-
-define fastcc i32 @CountTree(%struct.quad_struct* %tree) {
-entry:
- br label %tailrecurse
-
-tailrecurse: ; preds = %bb, %entry
- %tmp6 = load %struct.quad_struct** null ; <%struct.quad_struct*> [#uses=1]
- %tmp9 = load %struct.quad_struct** null ; <%struct.quad_struct*> [#uses=2]
- %tmp12 = load %struct.quad_struct** null ; <%struct.quad_struct*> [#uses=1]
- %tmp14 = icmp eq %struct.quad_struct* null, null ; <i1> [#uses=1]
- %tmp17 = icmp eq %struct.quad_struct* %tmp6, null ; <i1> [#uses=1]
- %tmp23 = icmp eq %struct.quad_struct* %tmp9, null ; <i1> [#uses=1]
- %tmp29 = icmp eq %struct.quad_struct* %tmp12, null ; <i1> [#uses=1]
- %bothcond = and i1 %tmp17, %tmp14 ; <i1> [#uses=1]
- %bothcond1 = and i1 %bothcond, %tmp23 ; <i1> [#uses=1]
- %bothcond2 = and i1 %bothcond1, %tmp29 ; <i1> [#uses=1]
- br i1 %bothcond2, label %return, label %bb
-
-bb: ; preds = %tailrecurse
- %tmp41 = tail call fastcc i32 @CountTree( %struct.quad_struct* %tmp9 ) ; <i32> [#uses=0]
- br label %tailrecurse
-
-return: ; preds = %tailrecurse
- ret i32 0
-}
diff --git a/release_23/test/CodeGen/ARM/ifcvt8.ll b/release_23/test/CodeGen/ARM/ifcvt8.ll
deleted file mode 100644
index 85bd8c7bf1fc..000000000000
--- a/release_23/test/CodeGen/ARM/ifcvt8.ll
+++ /dev/null
@@ -1,22 +0,0 @@
-; RUN: llvm-as < %s | \
-; RUN: llc -march=arm -mtriple=arm-apple-darwin
-; RUN: llvm-as < %s | \
-; RUN: llc -march=arm -mtriple=arm-apple-darwin | \
-; RUN: grep ldmne | count 1
-
- %struct.SString = type { i8*, i32, i32 }
-
-declare void @abort()
-
-define fastcc void @t(%struct.SString* %word, i8 signext %c) {
-entry:
- %tmp1 = icmp eq %struct.SString* %word, null ; <i1> [#uses=1]
- br i1 %tmp1, label %cond_true, label %cond_false
-
-cond_true: ; preds = %entry
- tail call void @abort( )
- unreachable
-
-cond_false: ; preds = %entry
- ret void
-}
diff --git a/release_23/test/CodeGen/ARM/illegal-vector-bitcast.ll b/release_23/test/CodeGen/ARM/illegal-vector-bitcast.ll
deleted file mode 100644
index 79f9929b7df3..000000000000
--- a/release_23/test/CodeGen/ARM/illegal-vector-bitcast.ll
+++ /dev/null
@@ -1,13 +0,0 @@
-; RUN: llvm-as < %s | llc -march=arm
-
-define void @foo(<8 x float>* %f, <8 x float>* %g, <4 x i64>* %y)
-{
- %h = load <8 x float>* %f
- %i = mul <8 x float> %h, <float 0x3FF19999A0000000, float 0x400A666660000000, float 0x40119999A0000000, float 0x40159999A0000000, float 0.5, float 0x3FE3333340000000, float 0x3FE6666660000000, float 0x3FE99999A0000000>
- %m = bitcast <8 x float> %i to <4 x i64>
- %z = load <4 x i64>* %y
- %n = mul <4 x i64> %z, %m
- %p = bitcast <4 x i64> %n to <8 x float>
- store <8 x float> %p, <8 x float>* %g
- ret void
-}
diff --git a/release_23/test/CodeGen/ARM/imm.ll b/release_23/test/CodeGen/ARM/imm.ll
deleted file mode 100644
index 998adbae5c94..000000000000
--- a/release_23/test/CodeGen/ARM/imm.ll
+++ /dev/null
@@ -1,16 +0,0 @@
-; RUN: llvm-as < %s | llc -march=arm | not grep CPI
-
-define i32 @test1(i32 %A) {
- %B = add i32 %A, -268435441 ; <i32> [#uses=1]
- ret i32 %B
-}
-
-define i32 @test2() {
- ret i32 65533
-}
-
-define i32 @test3(i32 %A) {
- %B = or i32 %A, 65533 ; <i32> [#uses=1]
- ret i32 %B
-}
-
diff --git a/release_23/test/CodeGen/ARM/inlineasm.ll b/release_23/test/CodeGen/ARM/inlineasm.ll
deleted file mode 100644
index 2f7332a5f480..000000000000
--- a/release_23/test/CodeGen/ARM/inlineasm.ll
+++ /dev/null
@@ -1,19 +0,0 @@
-; RUN: llvm-as < %s | llc -march=arm -mattr=+v6
-
-define i32 @test1(i32 %tmp54) {
- %tmp56 = tail call i32 asm "uxtb16 $0,$1", "=r,r"( i32 %tmp54 ) ; <i32> [#uses=1]
- ret i32 %tmp56
-}
-
-define void @test2() {
- %tmp1 = call i64 asm "ldmia $1!, {$0, ${0:H}}", "=r,=*r,1"( i32** null, i32* null ) ; <i64> [#uses=2]
- %tmp2 = lshr i64 %tmp1, 32 ; <i64> [#uses=1]
- %tmp3 = trunc i64 %tmp2 to i32 ; <i32> [#uses=1]
- %tmp4 = call i32 asm "pkhbt $0, $1, $2, lsl #16", "=r,r,r"( i32 0, i32 %tmp3 ) ; <i32> [#uses=0]
- ret void
-}
-
-define void @test3() {
- tail call void asm sideeffect "/* number: ${0:c} */", "i"( i32 1 )
- ret void
-}
diff --git a/release_23/test/CodeGen/ARM/inlineasm2.ll b/release_23/test/CodeGen/ARM/inlineasm2.ll
deleted file mode 100644
index 69394eb5bd49..000000000000
--- a/release_23/test/CodeGen/ARM/inlineasm2.ll
+++ /dev/null
@@ -1,11 +0,0 @@
-; RUN: llvm-as < %s | llc -march=arm -mattr=+vfp2
-
-define double @__ieee754_sqrt(double %x) {
- %tmp2 = tail call double asm "fsqrtd ${0:P}, ${1:P}", "=w,w"( double %x )
- ret double %tmp2
-}
-
-define float @__ieee754_sqrtf(float %x) {
- %tmp2 = tail call float asm "fsqrts $0, $1", "=w,w"( float %x )
- ret float %tmp2
-}
diff --git a/release_23/test/CodeGen/ARM/insn-sched1.ll b/release_23/test/CodeGen/ARM/insn-sched1.ll
deleted file mode 100644
index f20344301e99..000000000000
--- a/release_23/test/CodeGen/ARM/insn-sched1.ll
+++ /dev/null
@@ -1,11 +0,0 @@
-; RUN: llvm-as < %s | llc -march=arm -mattr=+v6
-; RUN: llvm-as < %s | llc -mtriple=arm-apple-darwin -mattr=+v6 |\
-; RUN: grep mov | count 3
-
-define i32 @test(i32 %x) {
- %tmp = trunc i32 %x to i16 ; <i16> [#uses=1]
- %tmp2 = tail call i32 @f( i32 1, i16 %tmp ) ; <i32> [#uses=1]
- ret i32 %tmp2
-}
-
-declare i32 @f(i32, i16)
diff --git a/release_23/test/CodeGen/ARM/ispositive.ll b/release_23/test/CodeGen/ARM/ispositive.ll
deleted file mode 100644
index 8dcac30fac8b..000000000000
--- a/release_23/test/CodeGen/ARM/ispositive.ll
+++ /dev/null
@@ -1,10 +0,0 @@
-; RUN: llvm-as < %s | llc -march=arm | grep {mov r0, r0, lsr #31}
-; RUN: llvm-as < %s | llc -march=thumb | grep {lsr r0, r0, #31}
-
-define i32 @test1(i32 %X) {
-entry:
- icmp slt i32 %X, 0 ; <i1>:0 [#uses=1]
- zext i1 %0 to i32 ; <i32>:1 [#uses=1]
- ret i32 %1
-}
-
diff --git a/release_23/test/CodeGen/ARM/large-stack.ll b/release_23/test/CodeGen/ARM/large-stack.ll
deleted file mode 100644
index 42d7d0972dca..000000000000
--- a/release_23/test/CodeGen/ARM/large-stack.ll
+++ /dev/null
@@ -1,21 +0,0 @@
-; RUN: llvm-as < %s | llc -march=arm
-; RUN: llvm-as < %s | llc -march=thumb | grep {ldr.*LCP} | count 5
-
-define void @test1() {
- %tmp = alloca [ 64 x i32 ] , align 4
- ret void
-}
-
-define void @test2() {
- %tmp = alloca [ 4168 x i8 ] , align 4
- ret void
-}
-
-define i32 @test3() {
- %retval = alloca i32, align 4
- %tmp = alloca i32, align 4
- %a = alloca [805306369 x i8], align 16
- store i32 0, i32* %tmp
- %tmp1 = load i32* %tmp
- ret i32 %tmp1
-}
diff --git a/release_23/test/CodeGen/ARM/ldm.ll b/release_23/test/CodeGen/ARM/ldm.ll
deleted file mode 100644
index 6a054577fc8b..000000000000
--- a/release_23/test/CodeGen/ARM/ldm.ll
+++ /dev/null
@@ -1,35 +0,0 @@
-; RUN: llvm-as < %s | llc -march=arm | \
-; RUN: grep ldmia | count 2
-; RUN: llvm-as < %s | llc -march=arm | \
-; RUN: grep ldmib | count 1
-; RUN: llvm-as < %s | llc -mtriple=arm-apple-darwin | \
-; RUN: grep {ldmfd sp\!} | count 3
-
-@X = external global [0 x i32] ; <[0 x i32]*> [#uses=5]
-
-define i32 @t1() {
- %tmp = load i32* getelementptr ([0 x i32]* @X, i32 0, i32 0) ; <i32> [#uses=1]
- %tmp3 = load i32* getelementptr ([0 x i32]* @X, i32 0, i32 1) ; <i32> [#uses=1]
- %tmp4 = tail call i32 @f1( i32 %tmp, i32 %tmp3 ) ; <i32> [#uses=1]
- ret i32 %tmp4
-}
-
-define i32 @t2() {
- %tmp = load i32* getelementptr ([0 x i32]* @X, i32 0, i32 2) ; <i32> [#uses=1]
- %tmp3 = load i32* getelementptr ([0 x i32]* @X, i32 0, i32 3) ; <i32> [#uses=1]
- %tmp5 = load i32* getelementptr ([0 x i32]* @X, i32 0, i32 4) ; <i32> [#uses=1]
- %tmp6 = tail call i32 @f2( i32 %tmp, i32 %tmp3, i32 %tmp5 ) ; <i32> [#uses=1]
- ret i32 %tmp6
-}
-
-define i32 @t3() {
- %tmp = load i32* getelementptr ([0 x i32]* @X, i32 0, i32 1) ; <i32> [#uses=1]
- %tmp3 = load i32* getelementptr ([0 x i32]* @X, i32 0, i32 2) ; <i32> [#uses=1]
- %tmp5 = load i32* getelementptr ([0 x i32]* @X, i32 0, i32 3) ; <i32> [#uses=1]
- %tmp6 = tail call i32 @f2( i32 %tmp, i32 %tmp3, i32 %tmp5 ) ; <i32> [#uses=1]
- ret i32 %tmp6
-}
-
-declare i32 @f1(i32, i32)
-
-declare i32 @f2(i32, i32, i32)
diff --git a/release_23/test/CodeGen/ARM/ldr.ll b/release_23/test/CodeGen/ARM/ldr.ll
deleted file mode 100644
index 23c0b99a8620..000000000000
--- a/release_23/test/CodeGen/ARM/ldr.ll
+++ /dev/null
@@ -1,23 +0,0 @@
-; RUN: llvm-as < %s | llc -march=arm | \
-; RUN: grep {ldr r0} | count 3
-
-define i32 @f1(i32* %v) {
-entry:
- %tmp = load i32* %v ; <i32> [#uses=1]
- ret i32 %tmp
-}
-
-define i32 @f2(i32* %v) {
-entry:
- %tmp2 = getelementptr i32* %v, i32 1023 ; <i32*> [#uses=1]
- %tmp = load i32* %tmp2 ; <i32> [#uses=1]
- ret i32 %tmp
-}
-
-define i32 @f3(i32* %v) {
-entry:
- %tmp2 = getelementptr i32* %v, i32 1024 ; <i32*> [#uses=1]
- %tmp = load i32* %tmp2 ; <i32> [#uses=1]
- ret i32 %tmp
-}
-
diff --git a/release_23/test/CodeGen/ARM/ldr_ext.ll b/release_23/test/CodeGen/ARM/ldr_ext.ll
deleted file mode 100644
index edb70d5396df..000000000000
--- a/release_23/test/CodeGen/ARM/ldr_ext.ll
+++ /dev/null
@@ -1,32 +0,0 @@
-; RUN: llvm-as < %s | llc -march=arm | grep ldrb | count 1
-; RUN: llvm-as < %s | llc -march=arm | grep ldrh | count 1
-; RUN: llvm-as < %s | llc -march=arm | grep ldrsb | count 1
-; RUN: llvm-as < %s | llc -march=arm | grep ldrsh | count 1
-; RUN: llvm-as < %s | llc -march=thumb | grep ldrb | count 1
-; RUN: llvm-as < %s | llc -march=thumb | grep ldrh | count 1
-; RUN: llvm-as < %s | llc -march=thumb | grep ldrsb | count 1
-; RUN: llvm-as < %s | llc -march=thumb | grep ldrsh | count 1
-
-define i32 @test1(i8* %v.pntr.s0.u1) {
- %tmp.u = load i8* %v.pntr.s0.u1
- %tmp1.s = zext i8 %tmp.u to i32
- ret i32 %tmp1.s
-}
-
-define i32 @test2(i16* %v.pntr.s0.u1) {
- %tmp.u = load i16* %v.pntr.s0.u1
- %tmp1.s = zext i16 %tmp.u to i32
- ret i32 %tmp1.s
-}
-
-define i32 @test3(i8* %v.pntr.s1.u0) {
- %tmp.s = load i8* %v.pntr.s1.u0
- %tmp1.s = sext i8 %tmp.s to i32
- ret i32 %tmp1.s
-}
-
-define i32 @test4() {
- %tmp.s = load i16* null
- %tmp1.s = sext i16 %tmp.s to i32
- ret i32 %tmp1.s
-}
diff --git a/release_23/test/CodeGen/ARM/ldr_frame.ll b/release_23/test/CodeGen/ARM/ldr_frame.ll
deleted file mode 100644
index 56acc9009799..000000000000
--- a/release_23/test/CodeGen/ARM/ldr_frame.ll
+++ /dev/null
@@ -1,32 +0,0 @@
-; RUN: llvm-as < %s | llc -march=arm | not grep mov
-; RUN: llvm-as < %s | llc -march=thumb | grep cpy | count 2
-
-define i32 @f1() {
- %buf = alloca [32 x i32], align 4
- %tmp = getelementptr [32 x i32]* %buf, i32 0, i32 0
- %tmp1 = load i32* %tmp
- ret i32 %tmp1
-}
-
-define i32 @f2() {
- %buf = alloca [32 x i8], align 4
- %tmp = getelementptr [32 x i8]* %buf, i32 0, i32 0
- %tmp1 = load i8* %tmp
- %tmp2 = zext i8 %tmp1 to i32
- ret i32 %tmp2
-}
-
-define i32 @f3() {
- %buf = alloca [32 x i32], align 4
- %tmp = getelementptr [32 x i32]* %buf, i32 0, i32 32
- %tmp1 = load i32* %tmp
- ret i32 %tmp1
-}
-
-define i32 @f4() {
- %buf = alloca [32 x i8], align 4
- %tmp = getelementptr [32 x i8]* %buf, i32 0, i32 2
- %tmp1 = load i8* %tmp
- %tmp2 = zext i8 %tmp1 to i32
- ret i32 %tmp2
-}
diff --git a/release_23/test/CodeGen/ARM/ldr_post.ll b/release_23/test/CodeGen/ARM/ldr_post.ll
deleted file mode 100644
index 0491563fc6a6..000000000000
--- a/release_23/test/CodeGen/ARM/ldr_post.ll
+++ /dev/null
@@ -1,12 +0,0 @@
-; RUN: llvm-as < %s | llc -march=arm | \
-; RUN: grep {ldr.*\\\[.*\],} | count 1
-
-define i32 @test(i32 %a, i32 %b, i32 %c) {
- %tmp1 = mul i32 %a, %b ; <i32> [#uses=2]
- %tmp2 = inttoptr i32 %tmp1 to i32* ; <i32*> [#uses=1]
- %tmp3 = load i32* %tmp2 ; <i32> [#uses=1]
- %tmp4 = sub i32 %tmp1, %c ; <i32> [#uses=1]
- %tmp5 = mul i32 %tmp4, %tmp3 ; <i32> [#uses=1]
- ret i32 %tmp5
-}
-
diff --git a/release_23/test/CodeGen/ARM/ldr_pre.ll b/release_23/test/CodeGen/ARM/ldr_pre.ll
deleted file mode 100644
index 7e447422361e..000000000000
--- a/release_23/test/CodeGen/ARM/ldr_pre.ll
+++ /dev/null
@@ -1,19 +0,0 @@
-; RUN: llvm-as < %s | llc -march=arm | \
-; RUN: grep {ldr.*\\!} | count 2
-
-define i32* @test1(i32* %X, i32* %dest) {
- %Y = getelementptr i32* %X, i32 4 ; <i32*> [#uses=2]
- %A = load i32* %Y ; <i32> [#uses=1]
- store i32 %A, i32* %dest
- ret i32* %Y
-}
-
-define i32 @test2(i32 %a, i32 %b, i32 %c) {
- %tmp1 = sub i32 %a, %b ; <i32> [#uses=2]
- %tmp2 = inttoptr i32 %tmp1 to i32* ; <i32*> [#uses=1]
- %tmp3 = load i32* %tmp2 ; <i32> [#uses=1]
- %tmp4 = sub i32 %tmp1, %c ; <i32> [#uses=1]
- %tmp5 = add i32 %tmp4, %tmp3 ; <i32> [#uses=1]
- ret i32 %tmp5
-}
-
diff --git a/release_23/test/CodeGen/ARM/load-global.ll b/release_23/test/CodeGen/ARM/load-global.ll
deleted file mode 100644
index 8896ead5a51c..000000000000
--- a/release_23/test/CodeGen/ARM/load-global.ll
+++ /dev/null
@@ -1,19 +0,0 @@
-; RUN: llvm-as < %s | \
-; RUN: llc -mtriple=arm-apple-darwin -relocation-model=static | \
-; RUN: not grep {L_G\$non_lazy_ptr}
-; RUN: llvm-as < %s | \
-; RUN: llc -mtriple=arm-apple-darwin -relocation-model=dynamic-no-pic | \
-; RUN: grep {L_G\$non_lazy_ptr} | count 2
-; RUN: llvm-as < %s | \
-; RUN: llc -mtriple=arm-apple-darwin -relocation-model=pic | \
-; RUN: grep {ldr.*pc} | count 1
-; RUN: llvm-as < %s | \
-; RUN: llc -mtriple=arm-linux-gnueabi -relocation-model=pic | \
-; RUN: grep {GOT} | count 1
-
-@G = external global i32
-
-define i32 @test1() {
- %tmp = load i32* @G
- ret i32 %tmp
-}
diff --git a/release_23/test/CodeGen/ARM/load.ll b/release_23/test/CodeGen/ARM/load.ll
deleted file mode 100644
index 05097328102c..000000000000
--- a/release_23/test/CodeGen/ARM/load.ll
+++ /dev/null
@@ -1,34 +0,0 @@
-; RUN: llvm-as < %s | llc -march=arm > %t
-; RUN: grep ldrsb %t
-; RUN: grep ldrb %t
-; RUN: grep ldrsh %t
-; RUN: grep ldrh %t
-
-
-define i32 @f1(i8* %p) {
-entry:
- %tmp = load i8* %p ; <i8> [#uses=1]
- %tmp1 = sext i8 %tmp to i32 ; <i32> [#uses=1]
- ret i32 %tmp1
-}
-
-define i32 @f2(i8* %p) {
-entry:
- %tmp = load i8* %p ; <i8> [#uses=1]
- %tmp2 = zext i8 %tmp to i32 ; <i32> [#uses=1]
- ret i32 %tmp2
-}
-
-define i32 @f3(i16* %p) {
-entry:
- %tmp = load i16* %p ; <i16> [#uses=1]
- %tmp3 = sext i16 %tmp to i32 ; <i32> [#uses=1]
- ret i32 %tmp3
-}
-
-define i32 @f4(i16* %p) {
-entry:
- %tmp = load i16* %p ; <i16> [#uses=1]
- %tmp4 = zext i16 %tmp to i32 ; <i32> [#uses=1]
- ret i32 %tmp4
-}
diff --git a/release_23/test/CodeGen/ARM/long-setcc.ll b/release_23/test/CodeGen/ARM/long-setcc.ll
deleted file mode 100644
index 12af8b8d11fd..000000000000
--- a/release_23/test/CodeGen/ARM/long-setcc.ll
+++ /dev/null
@@ -1,18 +0,0 @@
-; RUN: llvm-as < %s | llc -march=arm | grep cmp | count 1
-; RUN: llvm-as < %s | llc -march=thumb | grep cmp | count 1
-
-
-define i1 @t1(i64 %x) {
- %B = icmp slt i64 %x, 0
- ret i1 %B
-}
-
-define i1 @t2(i64 %x) {
- %tmp = icmp ult i64 %x, 4294967296
- ret i1 %tmp
-}
-
-define i1 @t3(i32 %x) {
- %tmp = icmp ugt i32 %x, -1
- ret i1 %tmp
-}
diff --git a/release_23/test/CodeGen/ARM/long.ll b/release_23/test/CodeGen/ARM/long.ll
deleted file mode 100644
index 53798ed82621..000000000000
--- a/release_23/test/CodeGen/ARM/long.ll
+++ /dev/null
@@ -1,87 +0,0 @@
-; RUN: llvm-as < %s | llc -march=arm | \
-; RUN: grep -- {-2147483648} | count 3
-; RUN: llvm-as < %s | llc -march=arm | grep mvn | count 3
-; RUN: llvm-as < %s | llc -march=arm | grep adds | count 1
-; RUN: llvm-as < %s | llc -march=arm | grep adc | count 1
-; RUN: llvm-as < %s | llc -march=arm | grep {subs } | count 1
-; RUN: llvm-as < %s | llc -march=arm | grep sbc | count 1
-; RUN: llvm-as < %s | llc -march=arm | \
-; RUN: grep smull | count 1
-; RUN: llvm-as < %s | llc -march=arm | \
-; RUN: grep umull | count 1
-; RUN: llvm-as < %s | llc -march=thumb | \
-; RUN: grep mvn | count 1
-; RUN: llvm-as < %s | llc -march=thumb | \
-; RUN: grep adc | count 1
-; RUN: llvm-as < %s | llc -march=thumb | \
-; RUN: grep sbc | count 1
-; RUN: llvm-as < %s | llc -march=thumb | grep __muldi3
-
-define i64 @f1() {
-entry:
- ret i64 0
-}
-
-define i64 @f2() {
-entry:
- ret i64 1
-}
-
-define i64 @f3() {
-entry:
- ret i64 2147483647
-}
-
-define i64 @f4() {
-entry:
- ret i64 2147483648
-}
-
-define i64 @f5() {
-entry:
- ret i64 9223372036854775807
-}
-
-define i64 @f6(i64 %x, i64 %y) {
-entry:
- %tmp1 = add i64 %y, 1 ; <i64> [#uses=1]
- ret i64 %tmp1
-}
-
-define void @f7() {
-entry:
- %tmp = call i64 @f8( ) ; <i64> [#uses=0]
- ret void
-}
-
-declare i64 @f8()
-
-define i64 @f9(i64 %a, i64 %b) {
-entry:
- %tmp = sub i64 %a, %b ; <i64> [#uses=1]
- ret i64 %tmp
-}
-
-define i64 @f(i32 %a, i32 %b) {
-entry:
- %tmp = sext i32 %a to i64 ; <i64> [#uses=1]
- %tmp1 = sext i32 %b to i64 ; <i64> [#uses=1]
- %tmp2 = mul i64 %tmp1, %tmp ; <i64> [#uses=1]
- ret i64 %tmp2
-}
-
-define i64 @g(i32 %a, i32 %b) {
-entry:
- %tmp = zext i32 %a to i64 ; <i64> [#uses=1]
- %tmp1 = zext i32 %b to i64 ; <i64> [#uses=1]
- %tmp2 = mul i64 %tmp1, %tmp ; <i64> [#uses=1]
- ret i64 %tmp2
-}
-
-define i64 @f10() {
-entry:
- %a = alloca i64, align 8 ; <i64*> [#uses=1]
- %retval = load i64* %a ; <i64> [#uses=1]
- ret i64 %retval
-}
-
diff --git a/release_23/test/CodeGen/ARM/long_shift.ll b/release_23/test/CodeGen/ARM/long_shift.ll
deleted file mode 100644
index 8d5d2f387973..000000000000
--- a/release_23/test/CodeGen/ARM/long_shift.ll
+++ /dev/null
@@ -1,31 +0,0 @@
-; RUN: llvm-as < %s | llc -march=thumb
-; RUN: llvm-as < %s | llc -march=arm > %t
-; RUN: grep rrx %t | count 1
-; RUN: grep __ashldi3 %t
-; RUN: grep __ashrdi3 %t
-; RUN: grep __lshrdi3 %t
-
-define i64 @f0(i64 %A, i64 %B) {
- %tmp = bitcast i64 %A to i64
- %tmp2 = lshr i64 %B, 1
- %tmp3 = sub i64 %tmp, %tmp2
- ret i64 %tmp3
-}
-
-define i32 @f1(i64 %x, i64 %y) {
- %a = shl i64 %x, %y
- %b = trunc i64 %a to i32
- ret i32 %b
-}
-
-define i32 @f2(i64 %x, i64 %y) {
- %a = ashr i64 %x, %y
- %b = trunc i64 %a to i32
- ret i32 %b
-}
-
-define i32 @f3(i64 %x, i64 %y) {
- %a = lshr i64 %x, %y
- %b = trunc i64 %a to i32
- ret i32 %b
-}
diff --git a/release_23/test/CodeGen/ARM/lsr-code-insertion.ll b/release_23/test/CodeGen/ARM/lsr-code-insertion.ll
deleted file mode 100644
index 3881e91453b4..000000000000
--- a/release_23/test/CodeGen/ARM/lsr-code-insertion.ll
+++ /dev/null
@@ -1,60 +0,0 @@
-; RUN: llvm-as < %s | llc -stats |& grep {39.*Number of machine instrs printed}
-; RUN: llvm-as < %s | llc -stats |& grep {.*Number of re-materialization}
-; This test really wants to check that the resultant "cond_true" block only
-; has a single store in it, and that cond_true55 only has code to materialize
-; the constant and do a store. We do *not* want something like this:
-;
-;LBB1_3: @cond_true
-; add r8, r0, r6
-; str r10, [r8, #+4]
-;
-target triple = "arm-apple-darwin8"
-
-define void @foo(i32* %mc, i32* %mpp, i32* %ip, i32* %dpp, i32* %tpmm, i32 %M, i32* %tpim, i32* %tpdm, i32* %bp, i32* %ms, i32 %xmb) {
-entry:
- %tmp6584 = icmp slt i32 %M, 1 ; <i1> [#uses=1]
- br i1 %tmp6584, label %return, label %bb
-
-bb: ; preds = %cond_next59, %entry
- %indvar = phi i32 [ 0, %entry ], [ %k.069.0, %cond_next59 ] ; <i32> [#uses=6]
- %k.069.0 = add i32 %indvar, 1 ; <i32> [#uses=3]
- %tmp3 = getelementptr i32* %mpp, i32 %indvar ; <i32*> [#uses=1]
- %tmp4 = load i32* %tmp3 ; <i32> [#uses=1]
- %tmp8 = getelementptr i32* %tpmm, i32 %indvar ; <i32*> [#uses=1]
- %tmp9 = load i32* %tmp8 ; <i32> [#uses=1]
- %tmp10 = add i32 %tmp9, %tmp4 ; <i32> [#uses=2]
- %tmp13 = getelementptr i32* %mc, i32 %k.069.0 ; <i32*> [#uses=5]
- store i32 %tmp10, i32* %tmp13
- %tmp17 = getelementptr i32* %ip, i32 %indvar ; <i32*> [#uses=1]
- %tmp18 = load i32* %tmp17 ; <i32> [#uses=1]
- %tmp22 = getelementptr i32* %tpim, i32 %indvar ; <i32*> [#uses=1]
- %tmp23 = load i32* %tmp22 ; <i32> [#uses=1]
- %tmp24 = add i32 %tmp23, %tmp18 ; <i32> [#uses=2]
- %tmp30 = icmp sgt i32 %tmp24, %tmp10 ; <i1> [#uses=1]
- br i1 %tmp30, label %cond_true, label %cond_next
-
-cond_true: ; preds = %bb
- store i32 %tmp24, i32* %tmp13
- br label %cond_next
-
-cond_next: ; preds = %cond_true, %bb
- %tmp39 = load i32* %tmp13 ; <i32> [#uses=1]
- %tmp42 = getelementptr i32* %ms, i32 %k.069.0 ; <i32*> [#uses=1]
- %tmp43 = load i32* %tmp42 ; <i32> [#uses=1]
- %tmp44 = add i32 %tmp43, %tmp39 ; <i32> [#uses=2]
- store i32 %tmp44, i32* %tmp13
- %tmp52 = icmp slt i32 %tmp44, -987654321 ; <i1> [#uses=1]
- br i1 %tmp52, label %cond_true55, label %cond_next59
-
-cond_true55: ; preds = %cond_next
- store i32 -987654321, i32* %tmp13
- br label %cond_next59
-
-cond_next59: ; preds = %cond_true55, %cond_next
- %tmp61 = add i32 %indvar, 2 ; <i32> [#uses=1]
- %tmp65 = icmp sgt i32 %tmp61, %M ; <i1> [#uses=1]
- br i1 %tmp65, label %return, label %bb
-
-return: ; preds = %cond_next59, %entry
- ret void
-}
diff --git a/release_23/test/CodeGen/ARM/lsr-scale-addr-mode.ll b/release_23/test/CodeGen/ARM/lsr-scale-addr-mode.ll
deleted file mode 100644
index 230cf3e5e725..000000000000
--- a/release_23/test/CodeGen/ARM/lsr-scale-addr-mode.ll
+++ /dev/null
@@ -1,19 +0,0 @@
-; RUN: llvm-as < %s | llc -march=arm | grep -F {str r2, \[r0, +r3, lsl #2\]}
-; Should use scaled addressing mode.
-
-define void @sintzero(i32* %a) {
-entry:
- store i32 0, i32* %a
- br label %cond_next
-
-cond_next: ; preds = %cond_next, %entry
- %indvar = phi i32 [ 0, %entry ], [ %tmp25, %cond_next ] ; <i32> [#uses=1]
- %tmp25 = add i32 %indvar, 1 ; <i32> [#uses=3]
- %tmp36 = getelementptr i32* %a, i32 %tmp25 ; <i32*> [#uses=1]
- store i32 0, i32* %tmp36
- icmp eq i32 %tmp25, -1 ; <i1>:0 [#uses=1]
- br i1 %0, label %return, label %cond_next
-
-return: ; preds = %cond_next
- ret void
-}
diff --git a/release_23/test/CodeGen/ARM/mem.ll b/release_23/test/CodeGen/ARM/mem.ll
deleted file mode 100644
index e98316576d8a..000000000000
--- a/release_23/test/CodeGen/ARM/mem.ll
+++ /dev/null
@@ -1,14 +0,0 @@
-; RUN: llvm-as < %s | llc -march=arm | grep strb
-; RUN: llvm-as < %s | llc -march=arm | grep strh
-
-define void @f1() {
-entry:
- store i8 0, i8* null
- ret void
-}
-
-define void @f2() {
-entry:
- store i16 0, i16* null
- ret void
-}
diff --git a/release_23/test/CodeGen/ARM/memcpy-inline.ll b/release_23/test/CodeGen/ARM/memcpy-inline.ll
deleted file mode 100644
index 665d3acd89d7..000000000000
--- a/release_23/test/CodeGen/ARM/memcpy-inline.ll
+++ /dev/null
@@ -1,15 +0,0 @@
-; RUN: llvm-as < %s | llc -mtriple=arm-apple-darwin | grep ldmia
-; RUN: llvm-as < %s | llc -mtriple=arm-apple-darwin | grep ldrb
-; RUN: llvm-as < %s | llc -mtriple=arm-apple-darwin | grep ldrh
-
- %struct.x = type { i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }
-@src = external global %struct.x
-@dst = external global %struct.x
-
-define i32 @t() {
-entry:
- call void @llvm.memcpy.i32( i8* getelementptr (%struct.x* @dst, i32 0, i32 0), i8* getelementptr (%struct.x* @src, i32 0, i32 0), i32 11, i32 8 )
- ret i32 0
-}
-
-declare void @llvm.memcpy.i32(i8*, i8*, i32, i32)
diff --git a/release_23/test/CodeGen/ARM/memfunc.ll b/release_23/test/CodeGen/ARM/memfunc.ll
deleted file mode 100644
index 0b58bf680157..000000000000
--- a/release_23/test/CodeGen/ARM/memfunc.ll
+++ /dev/null
@@ -1,16 +0,0 @@
-; RUN: llvm-as < %s | llc -march=arm
-
-define void @f() {
-entry:
- call void @llvm.memmove.i32( i8* null, i8* null, i32 64, i32 0 )
- call void @llvm.memcpy.i32( i8* null, i8* null, i32 64, i32 0 )
- call void @llvm.memset.i32( i8* null, i8 64, i32 0, i32 0 )
- unreachable
-}
-
-declare void @llvm.memmove.i32(i8*, i8*, i32, i32)
-
-declare void @llvm.memcpy.i32(i8*, i8*, i32, i32)
-
-declare void @llvm.memset.i32(i8*, i8, i32, i32)
-
diff --git a/release_23/test/CodeGen/ARM/mul.ll b/release_23/test/CodeGen/ARM/mul.ll
deleted file mode 100644
index f4f0a04266c2..000000000000
--- a/release_23/test/CodeGen/ARM/mul.ll
+++ /dev/null
@@ -1,24 +0,0 @@
-; RUN: llvm-as < %s | llc -march=arm | grep mul | count 2
-; RUN: llvm-as < %s | llc -march=arm | grep lsl | count 2
-; RUN: llvm-as < %s | llc -march=thumb | grep mul | count 3
-; RUN: llvm-as < %s | llc -march=thumb | grep lsl | count 1
-
-define i32 @f1(i32 %u) {
- %tmp = mul i32 %u, %u
- ret i32 %tmp
-}
-
-define i32 @f2(i32 %u, i32 %v) {
- %tmp = mul i32 %u, %v
- ret i32 %tmp
-}
-
-define i32 @f3(i32 %u) {
- %tmp = mul i32 %u, 5
- ret i32 %tmp
-}
-
-define i32 @f4(i32 %u) {
- %tmp = mul i32 %u, 4
- ret i32 %tmp
-}
diff --git a/release_23/test/CodeGen/ARM/mulhi.ll b/release_23/test/CodeGen/ARM/mulhi.ll
deleted file mode 100644
index de75e96b8704..000000000000
--- a/release_23/test/CodeGen/ARM/mulhi.ll
+++ /dev/null
@@ -1,22 +0,0 @@
-; RUN: llvm-as < %s | llc -march=arm -mattr=+v6
-; RUN: llvm-as < %s | llc -march=arm -mattr=+v6 | \
-; RUN: grep smmul | count 1
-; RUN: llvm-as < %s | llc -march=arm | grep umull | count 1
-
-define i32 @smulhi(i32 %x, i32 %y) {
- %tmp = sext i32 %x to i64 ; <i64> [#uses=1]
- %tmp1 = sext i32 %y to i64 ; <i64> [#uses=1]
- %tmp2 = mul i64 %tmp1, %tmp ; <i64> [#uses=1]
- %tmp3 = lshr i64 %tmp2, 32 ; <i64> [#uses=1]
- %tmp3.upgrd.1 = trunc i64 %tmp3 to i32 ; <i32> [#uses=1]
- ret i32 %tmp3.upgrd.1
-}
-
-define i32 @umulhi(i32 %x, i32 %y) {
- %tmp = zext i32 %x to i64 ; <i64> [#uses=1]
- %tmp1 = zext i32 %y to i64 ; <i64> [#uses=1]
- %tmp2 = mul i64 %tmp1, %tmp ; <i64> [#uses=1]
- %tmp3 = lshr i64 %tmp2, 32 ; <i64> [#uses=1]
- %tmp3.upgrd.2 = trunc i64 %tmp3 to i32 ; <i32> [#uses=1]
- ret i32 %tmp3.upgrd.2
-}
diff --git a/release_23/test/CodeGen/ARM/mvn.ll b/release_23/test/CodeGen/ARM/mvn.ll
deleted file mode 100644
index a7ef907033de..000000000000
--- a/release_23/test/CodeGen/ARM/mvn.ll
+++ /dev/null
@@ -1,74 +0,0 @@
-; RUN: llvm-as < %s | llc -march=arm | grep mvn | count 8
-
-define i32 @f1() {
-entry:
- ret i32 -1
-}
-
-define i32 @f2(i32 %a) {
-entry:
- %tmpnot = xor i32 %a, -1 ; <i32> [#uses=1]
- ret i32 %tmpnot
-}
-
-define i32 @f3(i32 %a) {
-entry:
- %tmp1 = shl i32 %a, 2 ; <i32> [#uses=1]
- %tmp1not = xor i32 %tmp1, -1 ; <i32> [#uses=1]
- ret i32 %tmp1not
-}
-
-define i32 @f4(i32 %a, i8 %b) {
-entry:
- %shift.upgrd.1 = zext i8 %b to i32 ; <i32> [#uses=1]
- %tmp3 = shl i32 %a, %shift.upgrd.1 ; <i32> [#uses=1]
- %tmp3not = xor i32 %tmp3, -1 ; <i32> [#uses=1]
- ret i32 %tmp3not
-}
-
-define i32 @f5(i32 %a) {
-entry:
- %tmp1 = lshr i32 %a, 2 ; <i32> [#uses=1]
- %tmp1not = xor i32 %tmp1, -1 ; <i32> [#uses=1]
- ret i32 %tmp1not
-}
-
-define i32 @f6(i32 %a, i8 %b) {
-entry:
- %shift.upgrd.2 = zext i8 %b to i32 ; <i32> [#uses=1]
- %tmp2 = lshr i32 %a, %shift.upgrd.2 ; <i32> [#uses=1]
- %tmp2not = xor i32 %tmp2, -1 ; <i32> [#uses=1]
- ret i32 %tmp2not
-}
-
-define i32 @f7(i32 %a) {
-entry:
- %tmp1 = ashr i32 %a, 2 ; <i32> [#uses=1]
- %tmp1not = xor i32 %tmp1, -1 ; <i32> [#uses=1]
- ret i32 %tmp1not
-}
-
-define i32 @f8(i32 %a, i8 %b) {
-entry:
- %shift.upgrd.3 = zext i8 %b to i32 ; <i32> [#uses=1]
- %tmp3 = ashr i32 %a, %shift.upgrd.3 ; <i32> [#uses=1]
- %tmp3not = xor i32 %tmp3, -1 ; <i32> [#uses=1]
- ret i32 %tmp3not
-}
-
-define i32 @f9() {
-entry:
- %tmp4845 = add i32 0, 0 ; <i32> [#uses=1]
- br label %cond_true4848
-
-cond_true4848: ; preds = %entry
- %tmp4851 = sub i32 -3, 0 ; <i32> [#uses=1]
- %abc = add i32 %tmp4851, %tmp4845 ; <i32> [#uses=1]
- ret i32 %abc
-}
-
-define i1 @f10(i32 %a) {
-entry:
- %tmp102 = icmp eq i32 -2, %a ; <i1> [#uses=1]
- ret i1 %tmp102
-}
diff --git a/release_23/test/CodeGen/ARM/pack.ll b/release_23/test/CodeGen/ARM/pack.ll
deleted file mode 100644
index 151beac3efce..000000000000
--- a/release_23/test/CodeGen/ARM/pack.ll
+++ /dev/null
@@ -1,73 +0,0 @@
-; RUN: llvm-as < %s | llc -march=arm -mattr=+v6 | \
-; RUN: grep pkhbt | count 5
-; RUN: llvm-as < %s | llc -march=arm -mattr=+v6 | \
-; RUN: grep pkhtb | count 4
-
-define i32 @test1(i32 %X, i32 %Y) {
- %tmp1 = and i32 %X, 65535 ; <i32> [#uses=1]
- %tmp4 = shl i32 %Y, 16 ; <i32> [#uses=1]
- %tmp5 = or i32 %tmp4, %tmp1 ; <i32> [#uses=1]
- ret i32 %tmp5
-}
-
-define i32 @test1a(i32 %X, i32 %Y) {
- %tmp19 = and i32 %X, 65535 ; <i32> [#uses=1]
- %tmp37 = shl i32 %Y, 16 ; <i32> [#uses=1]
- %tmp5 = or i32 %tmp37, %tmp19 ; <i32> [#uses=1]
- ret i32 %tmp5
-}
-
-define i32 @test2(i32 %X, i32 %Y) {
- %tmp1 = and i32 %X, 65535 ; <i32> [#uses=1]
- %tmp3 = shl i32 %Y, 12 ; <i32> [#uses=1]
- %tmp4 = and i32 %tmp3, -65536 ; <i32> [#uses=1]
- %tmp57 = or i32 %tmp4, %tmp1 ; <i32> [#uses=1]
- ret i32 %tmp57
-}
-
-define i32 @test3(i32 %X, i32 %Y) {
- %tmp19 = and i32 %X, 65535 ; <i32> [#uses=1]
- %tmp37 = shl i32 %Y, 18 ; <i32> [#uses=1]
- %tmp5 = or i32 %tmp37, %tmp19 ; <i32> [#uses=1]
- ret i32 %tmp5
-}
-
-define i32 @test4(i32 %X, i32 %Y) {
- %tmp1 = and i32 %X, 65535 ; <i32> [#uses=1]
- %tmp3 = and i32 %Y, -65536 ; <i32> [#uses=1]
- %tmp46 = or i32 %tmp3, %tmp1 ; <i32> [#uses=1]
- ret i32 %tmp46
-}
-
-define i32 @test5(i32 %X, i32 %Y) {
- %tmp17 = and i32 %X, -65536 ; <i32> [#uses=1]
- %tmp2 = bitcast i32 %Y to i32 ; <i32> [#uses=1]
- %tmp4 = lshr i32 %tmp2, 16 ; <i32> [#uses=2]
- %tmp5 = or i32 %tmp4, %tmp17 ; <i32> [#uses=1]
- ret i32 %tmp5
-}
-
-define i32 @test5a(i32 %X, i32 %Y) {
- %tmp110 = and i32 %X, -65536 ; <i32> [#uses=1]
- %tmp37 = lshr i32 %Y, 16 ; <i32> [#uses=1]
- %tmp39 = bitcast i32 %tmp37 to i32 ; <i32> [#uses=1]
- %tmp5 = or i32 %tmp39, %tmp110 ; <i32> [#uses=1]
- ret i32 %tmp5
-}
-
-define i32 @test6(i32 %X, i32 %Y) {
- %tmp1 = and i32 %X, -65536 ; <i32> [#uses=1]
- %tmp37 = lshr i32 %Y, 12 ; <i32> [#uses=1]
- %tmp38 = bitcast i32 %tmp37 to i32 ; <i32> [#uses=1]
- %tmp4 = and i32 %tmp38, 65535 ; <i32> [#uses=1]
- %tmp59 = or i32 %tmp4, %tmp1 ; <i32> [#uses=1]
- ret i32 %tmp59
-}
-
-define i32 @test7(i32 %X, i32 %Y) {
- %tmp1 = and i32 %X, -65536 ; <i32> [#uses=1]
- %tmp3 = ashr i32 %Y, 18 ; <i32> [#uses=1]
- %tmp4 = and i32 %tmp3, 65535 ; <i32> [#uses=1]
- %tmp57 = or i32 %tmp4, %tmp1 ; <i32> [#uses=1]
- ret i32 %tmp57
-}
diff --git a/release_23/test/CodeGen/ARM/remat.ll b/release_23/test/CodeGen/ARM/remat.ll
deleted file mode 100644
index 82bf5f0b7a6c..000000000000
--- a/release_23/test/CodeGen/ARM/remat.ll
+++ /dev/null
@@ -1,116 +0,0 @@
-; RUN: llvm-as < %s | llc -mtriple=arm-apple-darwin
-; RUN: llvm-as < %s | llc -mtriple=arm-apple-darwin -stats -info-output-file - | grep "Number of re-materialization" | grep 3
-
- %struct.CONTENTBOX = type { i32, i32, i32, i32, i32 }
- %struct.LOCBOX = type { i32, i32, i32, i32 }
- %struct.SIDEBOX = type { i32, i32 }
- %struct.UNCOMBOX = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 }
- %struct.cellbox = type { i8*, i32, i32, i32, [9 x i32], i32, i32, i32, i32, i32, i32, i32, double, double, double, double, double, i32, i32, %struct.CONTENTBOX*, %struct.UNCOMBOX*, [8 x %struct.tilebox*], %struct.SIDEBOX* }
- %struct.termbox = type { %struct.termbox*, i32, i32, i32, i32, i32 }
- %struct.tilebox = type { %struct.tilebox*, double, double, double, double, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, %struct.termbox*, %struct.LOCBOX* }
-@numcells = external global i32 ; <i32*> [#uses=1]
-@cellarray = external global %struct.cellbox** ; <%struct.cellbox***> [#uses=1]
-@numBinsY = external global i32 ; <i32*> [#uses=1]
-
-define fastcc void @fixpenal() {
-entry:
- %tmp491 = load i32* @numcells, align 4 ; <i32> [#uses=1]
- %tmp9 = load %struct.cellbox*** @cellarray, align 4 ; <%struct.cellbox**> [#uses=1]
- %tmp77.i = load i32* @numBinsY, align 4 ; <i32> [#uses=2]
- br label %bb490
-
-bb8: ; preds = %bb490, %cond_false428
- br i1 false, label %cond_false58.i, label %cond_false.i
-
-cond_false.i: ; preds = %bb8
- ret void
-
-cond_false58.i: ; preds = %bb8
- %highBinX.0.i = select i1 false, i32 1, i32 0 ; <i32> [#uses=2]
- br i1 false, label %cond_next85.i, label %cond_false76.i
-
-cond_false76.i: ; preds = %cond_false58.i
- ret void
-
-cond_next85.i: ; preds = %cond_false58.i
- br i1 false, label %cond_next105.i, label %cond_false98.i
-
-cond_false98.i: ; preds = %cond_next85.i
- ret void
-
-cond_next105.i: ; preds = %cond_next85.i
- %tmp108.i = icmp eq i32 1, %highBinX.0.i ; <i1> [#uses=1]
- %tmp115.i = icmp eq i32 1, %tmp77.i ; <i1> [#uses=1]
- %bothcond.i = and i1 %tmp115.i, %tmp108.i ; <i1> [#uses=1]
- %storemerge.i = select i1 %bothcond.i, i32 1, i32 0 ; <i32> [#uses=2]
- br i1 false, label %whoOverlaps.exit, label %bb503.preheader.i
-
-bb503.preheader.i: ; preds = %bb513.i, %cond_next105.i
- %i.022.0.i = phi i32 [ %tmp512.i, %bb513.i ], [ 0, %cond_next105.i ] ; <i32> [#uses=2]
- %tmp165.i = getelementptr i32*** null, i32 %i.022.0.i ; <i32***> [#uses=0]
- br label %bb503.i
-
-bb137.i: ; preds = %bb503.i
- br i1 false, label %bb162.i, label %bb148.i
-
-bb148.i: ; preds = %bb137.i
- ret void
-
-bb162.i: ; preds = %bb137.i
- %tmp49435.i = load i32* null ; <i32> [#uses=1]
- br label %bb170.i
-
-bb170.i: ; preds = %bb491.i, %bb162.i
- %indvar.i = phi i32 [ %k.032.0.i, %bb491.i ], [ 0, %bb162.i ] ; <i32> [#uses=2]
- %k.032.0.i = add i32 %indvar.i, 1 ; <i32> [#uses=2]
- %tmp173.i = getelementptr i32* null, i32 %k.032.0.i ; <i32*> [#uses=1]
- %tmp174.i = load i32* %tmp173.i ; <i32> [#uses=4]
- %tmp177.i = icmp eq i32 %tmp174.i, %cell.1 ; <i1> [#uses=1]
- %tmp184.i = icmp sgt i32 %tmp174.i, %tmp491 ; <i1> [#uses=1]
- %bothcond = or i1 %tmp177.i, %tmp184.i ; <i1> [#uses=1]
- br i1 %bothcond, label %bb491.i, label %cond_next188.i
-
-cond_next188.i: ; preds = %bb170.i
- %tmp191.i = getelementptr %struct.cellbox** %tmp9, i32 %tmp174.i ; <%struct.cellbox**> [#uses=1]
- %tmp192.i = load %struct.cellbox** %tmp191.i ; <%struct.cellbox*> [#uses=1]
- %tmp195.i = icmp eq i32 %tmp174.i, 0 ; <i1> [#uses=1]
- br i1 %tmp195.i, label %bb491.i, label %cond_true198.i
-
-cond_true198.i: ; preds = %cond_next188.i
- %tmp210.i = getelementptr %struct.cellbox* %tmp192.i, i32 0, i32 3 ; <i32*> [#uses=0]
- ret void
-
-bb491.i: ; preds = %cond_next188.i, %bb170.i
- %tmp490.i = add i32 %indvar.i, 2 ; <i32> [#uses=1]
- %tmp496.i = icmp slt i32 %tmp49435.i, %tmp490.i ; <i1> [#uses=1]
- br i1 %tmp496.i, label %bb500.i, label %bb170.i
-
-bb500.i: ; preds = %bb491.i
- %indvar.next82.i = add i32 %j.0.i, 1 ; <i32> [#uses=1]
- br label %bb503.i
-
-bb503.i: ; preds = %bb500.i, %bb503.preheader.i
- %j.0.i = phi i32 [ 0, %bb503.preheader.i ], [ %indvar.next82.i, %bb500.i ] ; <i32> [#uses=2]
- %tmp506.i = icmp sgt i32 %j.0.i, %tmp77.i ; <i1> [#uses=1]
- br i1 %tmp506.i, label %bb513.i, label %bb137.i
-
-bb513.i: ; preds = %bb503.i
- %tmp512.i = add i32 %i.022.0.i, 1 ; <i32> [#uses=2]
- %tmp516.i = icmp sgt i32 %tmp512.i, %highBinX.0.i ; <i1> [#uses=1]
- br i1 %tmp516.i, label %whoOverlaps.exit, label %bb503.preheader.i
-
-whoOverlaps.exit: ; preds = %bb513.i, %cond_next105.i
- br i1 false, label %cond_false428, label %bb490
-
-cond_false428: ; preds = %whoOverlaps.exit
- br i1 false, label %bb497, label %bb8
-
-bb490: ; preds = %whoOverlaps.exit, %entry
- %binY.tmp.2 = phi i32 [ 0, %entry ], [ %storemerge.i, %whoOverlaps.exit ] ; <i32> [#uses=1]
- %cell.1 = phi i32 [ 1, %entry ], [ 0, %whoOverlaps.exit ] ; <i32> [#uses=1]
- br i1 false, label %bb497, label %bb8
-
-bb497: ; preds = %bb490, %cond_false428
- %binY.tmp.3 = phi i32 [ %binY.tmp.2, %bb490 ], [ %storemerge.i, %cond_false428 ] ; <i32> [#uses=0]
- ret void
-}
diff --git a/release_23/test/CodeGen/ARM/ret0.ll b/release_23/test/CodeGen/ARM/ret0.ll
deleted file mode 100644
index 792b1690add2..000000000000
--- a/release_23/test/CodeGen/ARM/ret0.ll
+++ /dev/null
@@ -1,5 +0,0 @@
-; RUN: llvm-as < %s | llc -march=arm
-
-define i32 @test() {
- ret i32 0
-}
diff --git a/release_23/test/CodeGen/ARM/ret_arg1.ll b/release_23/test/CodeGen/ARM/ret_arg1.ll
deleted file mode 100644
index 48a1fda35b33..000000000000
--- a/release_23/test/CodeGen/ARM/ret_arg1.ll
+++ /dev/null
@@ -1,5 +0,0 @@
-; RUN: llvm-as < %s | llc -march=arm
-
-define i32 @test(i32 %a1) {
- ret i32 %a1
-}
diff --git a/release_23/test/CodeGen/ARM/ret_arg2.ll b/release_23/test/CodeGen/ARM/ret_arg2.ll
deleted file mode 100644
index a74870f85870..000000000000
--- a/release_23/test/CodeGen/ARM/ret_arg2.ll
+++ /dev/null
@@ -1,6 +0,0 @@
-; RUN: llvm-as < %s | llc -march=arm
-
-define i32 @test(i32 %a1, i32 %a2) {
- ret i32 %a2
-}
-
diff --git a/release_23/test/CodeGen/ARM/ret_arg3.ll b/release_23/test/CodeGen/ARM/ret_arg3.ll
deleted file mode 100644
index 9210e7b09f58..000000000000
--- a/release_23/test/CodeGen/ARM/ret_arg3.ll
+++ /dev/null
@@ -1,5 +0,0 @@
-; RUN: llvm-as < %s | llc -march=arm
-define i32 @test(i32 %a1, i32 %a2, i32 %a3) {
- ret i32 %a3
-}
-
diff --git a/release_23/test/CodeGen/ARM/ret_arg4.ll b/release_23/test/CodeGen/ARM/ret_arg4.ll
deleted file mode 100644
index a9c66e9e98d1..000000000000
--- a/release_23/test/CodeGen/ARM/ret_arg4.ll
+++ /dev/null
@@ -1,5 +0,0 @@
-; RUN: llvm-as < %s | llc -march=arm
-
-define i32 @test(i32 %a1, i32 %a2, i32 %a3, i32 %a4) {
- ret i32 %a4
-}
diff --git a/release_23/test/CodeGen/ARM/ret_arg5.ll b/release_23/test/CodeGen/ARM/ret_arg5.ll
deleted file mode 100644
index 620a0175e072..000000000000
--- a/release_23/test/CodeGen/ARM/ret_arg5.ll
+++ /dev/null
@@ -1,5 +0,0 @@
-; RUN: llvm-as < %s | llc -march=arm
-
-define i32 @test(i32 %a1, i32 %a2, i32 %a3, i32 %a4, i32 %a5) {
- ret i32 %a5
-}
diff --git a/release_23/test/CodeGen/ARM/ret_void.ll b/release_23/test/CodeGen/ARM/ret_void.ll
deleted file mode 100644
index 68db8c423461..000000000000
--- a/release_23/test/CodeGen/ARM/ret_void.ll
+++ /dev/null
@@ -1,6 +0,0 @@
-; RUN: llvm-as < %s | llc -march=arm
-
-define void @test() {
- ret void
-}
-
diff --git a/release_23/test/CodeGen/ARM/rev.ll b/release_23/test/CodeGen/ARM/rev.ll
deleted file mode 100644
index 68f6264e8a06..000000000000
--- a/release_23/test/CodeGen/ARM/rev.ll
+++ /dev/null
@@ -1,27 +0,0 @@
-; RUN: llvm-as < %s | llc -march=arm -mattr=+v6 | grep rev16
-; RUN: llvm-as < %s | llc -march=arm -mattr=+v6 | grep revsh
-
-define i32 @test1(i32 %X) {
- %tmp1 = lshr i32 %X, 8 ; <i32> [#uses=3]
- %X15 = bitcast i32 %X to i32 ; <i32> [#uses=1]
- %tmp4 = shl i32 %X15, 8 ; <i32> [#uses=2]
- %tmp2 = and i32 %tmp1, 16711680 ; <i32> [#uses=1]
- %tmp5 = and i32 %tmp4, -16777216 ; <i32> [#uses=1]
- %tmp9 = and i32 %tmp1, 255 ; <i32> [#uses=1]
- %tmp13 = and i32 %tmp4, 65280 ; <i32> [#uses=1]
- %tmp6 = or i32 %tmp5, %tmp2 ; <i32> [#uses=1]
- %tmp10 = or i32 %tmp6, %tmp13 ; <i32> [#uses=1]
- %tmp14 = or i32 %tmp10, %tmp9 ; <i32> [#uses=1]
- ret i32 %tmp14
-}
-
-define i32 @test2(i32 %X) {
- %tmp1 = lshr i32 %X, 8 ; <i32> [#uses=1]
- %tmp1.upgrd.1 = trunc i32 %tmp1 to i16 ; <i16> [#uses=1]
- %tmp3 = trunc i32 %X to i16 ; <i16> [#uses=1]
- %tmp2 = and i16 %tmp1.upgrd.1, 255 ; <i16> [#uses=1]
- %tmp4 = shl i16 %tmp3, 8 ; <i16> [#uses=1]
- %tmp5 = or i16 %tmp2, %tmp4 ; <i16> [#uses=1]
- %tmp5.upgrd.2 = sext i16 %tmp5 to i32 ; <i32> [#uses=1]
- ret i32 %tmp5.upgrd.2
-}
diff --git a/release_23/test/CodeGen/ARM/section.ll b/release_23/test/CodeGen/ARM/section.ll
deleted file mode 100644
index 0397bcc36e62..000000000000
--- a/release_23/test/CodeGen/ARM/section.ll
+++ /dev/null
@@ -1,7 +0,0 @@
-; RUN: llvm-as < %s | llc -mtriple=arm-linux | \
-; RUN: grep {__DTOR_END__:}
-; RUN: llvm-as < %s | llc -mtriple=arm-linux | \
-; RUN: grep {.section .dtors,"aw",.progbits}
-
-@__DTOR_END__ = internal global [1 x i32] zeroinitializer, section ".dtors" ; <[1 x i32]*> [#uses=0]
-
diff --git a/release_23/test/CodeGen/ARM/select.ll b/release_23/test/CodeGen/ARM/select.ll
deleted file mode 100644
index ba29c30af5b6..000000000000
--- a/release_23/test/CodeGen/ARM/select.ll
+++ /dev/null
@@ -1,63 +0,0 @@
-; RUN: llvm-as < %s | llc -march=arm | grep moveq | count 1
-; RUN: llvm-as < %s | llc -march=arm | grep movgt | count 1
-; RUN: llvm-as < %s | llc -march=arm | grep movlt | count 3
-; RUN: llvm-as < %s | llc -march=arm | grep movle | count 1
-; RUN: llvm-as < %s | llc -march=arm | grep movls | count 1
-; RUN: llvm-as < %s | llc -march=arm | grep movhi | count 1
-; RUN: llvm-as < %s | llc -march=arm -mattr=+vfp2 | \
-; RUN: grep fcpydmi | count 1
-; RUN: llvm-as < %s | llc -march=thumb | grep beq | count 1
-; RUN: llvm-as < %s | llc -march=thumb | grep bgt | count 1
-; RUN: llvm-as < %s | llc -march=thumb | grep blt | count 3
-; RUN: llvm-as < %s | llc -march=thumb | grep ble | count 1
-; RUN: llvm-as < %s | llc -march=thumb | grep bls | count 1
-; RUN: llvm-as < %s | llc -march=thumb | grep bhi | count 1
-; RUN: llvm-as < %s | llc -march=thumb | grep __ltdf2
-
-define i32 @f1(i32 %a.s) {
-entry:
- %tmp = icmp eq i32 %a.s, 4
- %tmp1.s = select i1 %tmp, i32 2, i32 3
- ret i32 %tmp1.s
-}
-
-define i32 @f2(i32 %a.s) {
-entry:
- %tmp = icmp sgt i32 %a.s, 4
- %tmp1.s = select i1 %tmp, i32 2, i32 3
- ret i32 %tmp1.s
-}
-
-define i32 @f3(i32 %a.s, i32 %b.s) {
-entry:
- %tmp = icmp slt i32 %a.s, %b.s
- %tmp1.s = select i1 %tmp, i32 2, i32 3
- ret i32 %tmp1.s
-}
-
-define i32 @f4(i32 %a.s, i32 %b.s) {
-entry:
- %tmp = icmp sle i32 %a.s, %b.s
- %tmp1.s = select i1 %tmp, i32 2, i32 3
- ret i32 %tmp1.s
-}
-
-define i32 @f5(i32 %a.u, i32 %b.u) {
-entry:
- %tmp = icmp ule i32 %a.u, %b.u
- %tmp1.s = select i1 %tmp, i32 2, i32 3
- ret i32 %tmp1.s
-}
-
-define i32 @f6(i32 %a.u, i32 %b.u) {
-entry:
- %tmp = icmp ugt i32 %a.u, %b.u
- %tmp1.s = select i1 %tmp, i32 2, i32 3
- ret i32 %tmp1.s
-}
-
-define double @f7(double %a, double %b) {
- %tmp = fcmp olt double %a, 1.234e+00
- %tmp1 = select i1 %tmp, double -1.000e+00, double %b
- ret double %tmp1
-}
diff --git a/release_23/test/CodeGen/ARM/select_xform.ll b/release_23/test/CodeGen/ARM/select_xform.ll
deleted file mode 100644
index 97ac9a13edca..000000000000
--- a/release_23/test/CodeGen/ARM/select_xform.ll
+++ /dev/null
@@ -1,16 +0,0 @@
-; RUN: llvm-as < %s | llc -march=arm
-; RUN: llvm-as < %s | llc -march=arm | grep mov | count 2
-
-define i32 @t1(i32 %a, i32 %b, i32 %c) {
- %tmp1 = icmp sgt i32 %c, 10
- %tmp2 = select i1 %tmp1, i32 0, i32 2147483647
- %tmp3 = add i32 %tmp2, %b
- ret i32 %tmp3
-}
-
-define i32 @t2(i32 %a, i32 %b, i32 %c, i32 %d) {
- %tmp1 = icmp sgt i32 %c, 10
- %tmp2 = select i1 %tmp1, i32 0, i32 10
- %tmp3 = sub i32 %b, %tmp2
- ret i32 %tmp3
-}
diff --git a/release_23/test/CodeGen/ARM/shifter_operand.ll b/release_23/test/CodeGen/ARM/shifter_operand.ll
deleted file mode 100644
index cae1c44a729d..000000000000
--- a/release_23/test/CodeGen/ARM/shifter_operand.ll
+++ /dev/null
@@ -1,18 +0,0 @@
-; RUN: llvm-as < %s | llc -march=arm | grep add | grep lsl
-; RUN: llvm-as < %s | llc -march=arm | grep bic | grep asr
-
-
-define i32 @test1(i32 %X, i32 %Y, i8 %sh) {
- %shift.upgrd.1 = zext i8 %sh to i32 ; <i32> [#uses=1]
- %A = shl i32 %Y, %shift.upgrd.1 ; <i32> [#uses=1]
- %B = add i32 %X, %A ; <i32> [#uses=1]
- ret i32 %B
-}
-
-define i32 @test2(i32 %X, i32 %Y, i8 %sh) {
- %shift.upgrd.2 = zext i8 %sh to i32 ; <i32> [#uses=1]
- %A = ashr i32 %Y, %shift.upgrd.2 ; <i32> [#uses=1]
- %B = xor i32 %A, -1 ; <i32> [#uses=1]
- %C = and i32 %X, %B ; <i32> [#uses=1]
- ret i32 %C
-}
diff --git a/release_23/test/CodeGen/ARM/smul.ll b/release_23/test/CodeGen/ARM/smul.ll
deleted file mode 100644
index 7a4e4887cc7b..000000000000
--- a/release_23/test/CodeGen/ARM/smul.ll
+++ /dev/null
@@ -1,36 +0,0 @@
-; RUN: llvm-as < %s | llc -march=arm
-; RUN: llvm-as < %s | llc -march=arm -mattr=+v5TE
-; RUN: llvm-as < %s | llc -march=arm -mattr=+v5TE | \
-; RUN: grep smulbt | count 1
-; RUN: llvm-as < %s | llc -march=arm -mattr=+v5TE | \
-; RUN: grep smultt | count 1
-; RUN: llvm-as < %s | llc -march=arm -mattr=+v5TE | \
-; RUN: grep smlabt | count 1
-
-@x = weak global i16 0 ; <i16*> [#uses=1]
-@y = weak global i16 0 ; <i16*> [#uses=0]
-
-define i32 @f1(i32 %y) {
- %tmp = load i16* @x ; <i16> [#uses=1]
- %tmp1 = add i16 %tmp, 2 ; <i16> [#uses=1]
- %tmp2 = sext i16 %tmp1 to i32 ; <i32> [#uses=1]
- %tmp3 = ashr i32 %y, 16 ; <i32> [#uses=1]
- %tmp4 = mul i32 %tmp2, %tmp3 ; <i32> [#uses=1]
- ret i32 %tmp4
-}
-
-define i32 @f2(i32 %x, i32 %y) {
- %tmp1 = ashr i32 %x, 16 ; <i32> [#uses=1]
- %tmp3 = ashr i32 %y, 16 ; <i32> [#uses=1]
- %tmp4 = mul i32 %tmp3, %tmp1 ; <i32> [#uses=1]
- ret i32 %tmp4
-}
-
-define i32 @f3(i32 %a, i16 %x, i32 %y) {
- %tmp = sext i16 %x to i32 ; <i32> [#uses=1]
- %tmp2 = ashr i32 %y, 16 ; <i32> [#uses=1]
- %tmp3 = mul i32 %tmp2, %tmp ; <i32> [#uses=1]
- %tmp5 = add i32 %tmp3, %a ; <i32> [#uses=1]
- ret i32 %tmp5
-}
-
diff --git a/release_23/test/CodeGen/ARM/stack-frame.ll b/release_23/test/CodeGen/ARM/stack-frame.ll
deleted file mode 100644
index 73ae11b973c2..000000000000
--- a/release_23/test/CodeGen/ARM/stack-frame.ll
+++ /dev/null
@@ -1,15 +0,0 @@
-; RUN: llvm-as < %s | llc -march=arm
-; RUN: llvm-as < %s | llc -march=arm | grep add | count 1
-; RUN: llvm-as < %s | llc -march=thumb
-; RUN: llvm-as < %s | llc -march=thumb | grep add | count 1
-
-define void @f1() {
- %c = alloca i8, align 1
- ret void
-}
-
-define i32 @f2() {
- ret i32 1
-}
-
-
diff --git a/release_23/test/CodeGen/ARM/str_post.ll b/release_23/test/CodeGen/ARM/str_post.ll
deleted file mode 100644
index ba813805bacc..000000000000
--- a/release_23/test/CodeGen/ARM/str_post.ll
+++ /dev/null
@@ -1,21 +0,0 @@
-; RUN: llvm-as < %s | llc -march=arm | \
-; RUN: grep {strh .*\\\[.*\], #-4} | count 1
-; RUN: llvm-as < %s | llc -march=arm | \
-; RUN: grep {str .*\\\[.*\],} | count 1
-
-define i16 @test1(i32* %X, i16* %A) {
- %Y = load i32* %X ; <i32> [#uses=1]
- %tmp1 = trunc i32 %Y to i16 ; <i16> [#uses=1]
- store i16 %tmp1, i16* %A
- %tmp2 = ptrtoint i16* %A to i16 ; <i16> [#uses=1]
- %tmp3 = sub i16 %tmp2, 4 ; <i16> [#uses=1]
- ret i16 %tmp3
-}
-
-define i32 @test2(i32* %X, i32* %A) {
- %Y = load i32* %X ; <i32> [#uses=1]
- store i32 %Y, i32* %A
- %tmp1 = ptrtoint i32* %A to i32 ; <i32> [#uses=1]
- %tmp2 = sub i32 %tmp1, 4 ; <i32> [#uses=1]
- ret i32 %tmp2
-}
diff --git a/release_23/test/CodeGen/ARM/str_pre.ll b/release_23/test/CodeGen/ARM/str_pre.ll
deleted file mode 100644
index c02663fa4040..000000000000
--- a/release_23/test/CodeGen/ARM/str_pre.ll
+++ /dev/null
@@ -1,18 +0,0 @@
-; RUN: llvm-as < %s | llc -march=arm | \
-; RUN: grep {str.*\\!} | count 2
-
-define void @test1(i32* %X, i32* %A, i32** %dest) {
- %B = load i32* %A ; <i32> [#uses=1]
- %Y = getelementptr i32* %X, i32 4 ; <i32*> [#uses=2]
- store i32 %B, i32* %Y
- store i32* %Y, i32** %dest
- ret void
-}
-
-define i16* @test2(i16* %X, i32* %A) {
- %B = load i32* %A ; <i32> [#uses=1]
- %Y = getelementptr i16* %X, i32 4 ; <i16*> [#uses=2]
- %tmp = trunc i32 %B to i16 ; <i16> [#uses=1]
- store i16 %tmp, i16* %Y
- ret i16* %Y
-}
diff --git a/release_23/test/CodeGen/ARM/str_trunc.ll b/release_23/test/CodeGen/ARM/str_trunc.ll
deleted file mode 100644
index 77c66ec2c7e0..000000000000
--- a/release_23/test/CodeGen/ARM/str_trunc.ll
+++ /dev/null
@@ -1,16 +0,0 @@
-; RUN: llvm-as < %s | llc -march=arm | \
-; RUN: grep strb | count 1
-; RUN: llvm-as < %s | llc -march=arm | \
-; RUN: grep strh | count 1
-
-define void @test1(i32 %v, i16* %ptr) {
- %tmp = trunc i32 %v to i16 ; <i16> [#uses=1]
- store i16 %tmp, i16* %ptr
- ret void
-}
-
-define void @test2(i32 %v, i8* %ptr) {
- %tmp = trunc i32 %v to i8 ; <i8> [#uses=1]
- store i8 %tmp, i8* %ptr
- ret void
-}
diff --git a/release_23/test/CodeGen/ARM/sxt_rot.ll b/release_23/test/CodeGen/ARM/sxt_rot.ll
deleted file mode 100644
index bfecce8bde22..000000000000
--- a/release_23/test/CodeGen/ARM/sxt_rot.ll
+++ /dev/null
@@ -1,22 +0,0 @@
-; RUN: llvm-as < %s | llc -march=arm -mattr=+v6 | \
-; RUN: grep sxtb | count 1
-; RUN: llvm-as < %s | llc -march=arm -mattr=+v6 | \
-; RUN: grep sxtab | count 1
-
-define i8 @test1(i32 %A) signext {
- %B = lshr i32 %A, 8
- %C = shl i32 %A, 24
- %D = or i32 %B, %C
- %E = trunc i32 %D to i8
- ret i8 %E
-}
-
-define i32 @test2(i32 %A, i32 %X) signext {
- %B = lshr i32 %A, 8
- %C = shl i32 %A, 24
- %D = or i32 %B, %C
- %E = trunc i32 %D to i8
- %F = sext i8 %E to i32
- %G = add i32 %F, %X
- ret i32 %G
-}
diff --git a/release_23/test/CodeGen/ARM/thread_pointer.ll b/release_23/test/CodeGen/ARM/thread_pointer.ll
deleted file mode 100644
index 6476b483d7d9..000000000000
--- a/release_23/test/CodeGen/ARM/thread_pointer.ll
+++ /dev/null
@@ -1,10 +0,0 @@
-; RUN: llvm-as < %s | llc -march=arm -mtriple=arm-linux-gnueabi | \
-; RUN: grep {__aeabi_read_tp}
-
-define i8* @test() {
-entry:
- %tmp1 = call i8* @llvm.arm.thread.pointer( ) ; <i8*> [#uses=0]
- ret i8* %tmp1
-}
-
-declare i8* @llvm.arm.thread.pointer()
diff --git a/release_23/test/CodeGen/ARM/thumb-imm.ll b/release_23/test/CodeGen/ARM/thumb-imm.ll
deleted file mode 100644
index 2be393a95cac..000000000000
--- a/release_23/test/CodeGen/ARM/thumb-imm.ll
+++ /dev/null
@@ -1,10 +0,0 @@
-; RUN: llvm-as < %s | llc -march=thumb | not grep CPI
-
-
-define i32 @test1() {
- ret i32 1000
-}
-
-define i32 @test2() {
- ret i32 -256
-}
diff --git a/release_23/test/CodeGen/ARM/tls1.ll b/release_23/test/CodeGen/ARM/tls1.ll
deleted file mode 100644
index 6866a42db495..000000000000
--- a/release_23/test/CodeGen/ARM/tls1.ll
+++ /dev/null
@@ -1,20 +0,0 @@
-; RUN: llvm-as < %s | llc -march=arm -mtriple=arm-linux-gnueabi | \
-; RUN: grep {i(tpoff)}
-; RUN: llvm-as < %s | llc -march=arm -mtriple=arm-linux-gnueabi | \
-; RUN: grep {__aeabi_read_tp}
-; RUN: llvm-as < %s | llc -march=arm -mtriple=arm-linux-gnueabi \
-; RUN: -relocation-model=pic | grep {__tls_get_addr}
-
-
-@i = thread_local global i32 15 ; <i32*> [#uses=2]
-
-define i32 @f() {
-entry:
- %tmp1 = load i32* @i ; <i32> [#uses=1]
- ret i32 %tmp1
-}
-
-define i32* @g() {
-entry:
- ret i32* @i
-}
diff --git a/release_23/test/CodeGen/ARM/tls2.ll b/release_23/test/CodeGen/ARM/tls2.ll
deleted file mode 100644
index 90e3bcf9040b..000000000000
--- a/release_23/test/CodeGen/ARM/tls2.ll
+++ /dev/null
@@ -1,19 +0,0 @@
-; RUN: llvm-as < %s | llc -march=arm -mtriple=arm-linux-gnueabi | \
-; RUN: grep {i(gottpoff)}
-; RUN: llvm-as < %s | llc -march=arm -mtriple=arm-linux-gnueabi | \
-; RUN: grep {ldr r., \[pc, r.\]}
-; RUN: llvm-as < %s | llc -march=arm -mtriple=arm-linux-gnueabi \
-; RUN: -relocation-model=pic | grep {__tls_get_addr}
-
-@i = external thread_local global i32 ; <i32*> [#uses=2]
-
-define i32 @f() {
-entry:
- %tmp1 = load i32* @i ; <i32> [#uses=1]
- ret i32 %tmp1
-}
-
-define i32* @g() {
-entry:
- ret i32* @i
-}
diff --git a/release_23/test/CodeGen/ARM/tls3.ll b/release_23/test/CodeGen/ARM/tls3.ll
deleted file mode 100644
index df2913b61cda..000000000000
--- a/release_23/test/CodeGen/ARM/tls3.ll
+++ /dev/null
@@ -1,11 +0,0 @@
-; RUN: llvm-as < %s | llc -march=arm -mtriple=arm-linux-gnueabi | \
-; RUN: grep {tbss}
-
-%struct.anon = type { i32, i32 }
-@teste = internal thread_local global %struct.anon zeroinitializer ; <%struct.anon*> [#uses=1]
-
-define i32 @main() {
-entry:
- %tmp2 = load i32* getelementptr (%struct.anon* @teste, i32 0, i32 0), align 8 ; <i32> [#uses=1]
- ret i32 %tmp2
-}
diff --git a/release_23/test/CodeGen/ARM/trunc_ldr.ll b/release_23/test/CodeGen/ARM/trunc_ldr.ll
deleted file mode 100644
index 6111ec9d2f48..000000000000
--- a/release_23/test/CodeGen/ARM/trunc_ldr.ll
+++ /dev/null
@@ -1,24 +0,0 @@
-; RUN: llvm-as < %s | llc -march=arm | grep ldrb.*7 | count 1
-; RUN: llvm-as < %s | llc -march=arm | grep ldrsb.*7 | count 1
-
- %struct.A = type { i8, i8, i8, i8, i16, i8, i8, %struct.B** }
- %struct.B = type { float, float, i32, i32, i32, [0 x i8] }
-
-define i8 @f1(%struct.A* %d) {
- %tmp2 = getelementptr %struct.A* %d, i32 0, i32 4
- %tmp23 = bitcast i16* %tmp2 to i32*
- %tmp4 = load i32* %tmp23
- %tmp512 = lshr i32 %tmp4, 24
- %tmp56 = trunc i32 %tmp512 to i8
- ret i8 %tmp56
-}
-
-define i32 @f2(%struct.A* %d) {
- %tmp2 = getelementptr %struct.A* %d, i32 0, i32 4
- %tmp23 = bitcast i16* %tmp2 to i32*
- %tmp4 = load i32* %tmp23
- %tmp512 = lshr i32 %tmp4, 24
- %tmp56 = trunc i32 %tmp512 to i8
- %tmp57 = sext i8 %tmp56 to i32
- ret i32 %tmp57
-}
diff --git a/release_23/test/CodeGen/ARM/truncstore-dag-combine.ll b/release_23/test/CodeGen/ARM/truncstore-dag-combine.ll
deleted file mode 100644
index 0e85fb69eb3a..000000000000
--- a/release_23/test/CodeGen/ARM/truncstore-dag-combine.ll
+++ /dev/null
@@ -1,18 +0,0 @@
-; RUN: llvm-as < %s | llc -march=arm | not grep orr
-; RUN: llvm-as < %s | llc -march=arm | not grep mov
-
-define void @bar(i8* %P, i16* %Q) {
-entry:
- %P1 = bitcast i8* %P to i16* ; <i16*> [#uses=1]
- %tmp = load i16* %Q, align 1 ; <i16> [#uses=1]
- store i16 %tmp, i16* %P1, align 1
- ret void
-}
-
-define void @foo(i8* %P, i32* %Q) {
-entry:
- %P1 = bitcast i8* %P to i32* ; <i32*> [#uses=1]
- %tmp = load i32* %Q, align 1 ; <i32> [#uses=1]
- store i32 %tmp, i32* %P1, align 1
- ret void
-}
diff --git a/release_23/test/CodeGen/ARM/tst_teq.ll b/release_23/test/CodeGen/ARM/tst_teq.ll
deleted file mode 100644
index e5aa029d2c1e..000000000000
--- a/release_23/test/CodeGen/ARM/tst_teq.ll
+++ /dev/null
@@ -1,19 +0,0 @@
-; RUN: llvm-as < %s | llc -march=arm | grep tst
-; RUN: llvm-as < %s | llc -march=arm | grep teq
-; RUN: llvm-as < %s | llc -march=thumb | grep tst
-
-define i32 @f(i32 %a) {
-entry:
- %tmp2 = and i32 %a, 255 ; <i32> [#uses=1]
- icmp eq i32 %tmp2, 0 ; <i1>:0 [#uses=1]
- %retval = select i1 %0, i32 20, i32 10 ; <i32> [#uses=1]
- ret i32 %retval
-}
-
-define i32 @g(i32 %a) {
-entry:
- %tmp2 = xor i32 %a, 255
- icmp eq i32 %tmp2, 0 ; <i1>:0 [#uses=1]
- %retval = select i1 %0, i32 20, i32 10 ; <i32> [#uses=1]
- ret i32 %retval
-}
diff --git a/release_23/test/CodeGen/ARM/unaligned_load_store.ll b/release_23/test/CodeGen/ARM/unaligned_load_store.ll
deleted file mode 100644
index dad1897463a6..000000000000
--- a/release_23/test/CodeGen/ARM/unaligned_load_store.ll
+++ /dev/null
@@ -1,16 +0,0 @@
-; RUN: llvm-as < %s | \
-; RUN: llc -march=arm -o %t -f
-; RUN: grep ldrb %t | count 4
-; RUN: grep strb %t | count 4
-
-
- %struct.p = type <{ i8, i32 }>
-@t = global %struct.p <{ i8 1, i32 10 }> ; <%struct.p*> [#uses=1]
-@u = weak global %struct.p zeroinitializer ; <%struct.p*> [#uses=1]
-
-define i32 @main() {
-entry:
- %tmp3 = load i32* getelementptr (%struct.p* @t, i32 0, i32 1), align 1 ; <i32> [#uses=2]
- store i32 %tmp3, i32* getelementptr (%struct.p* @u, i32 0, i32 1), align 1
- ret i32 %tmp3
-}
diff --git a/release_23/test/CodeGen/ARM/unord.ll b/release_23/test/CodeGen/ARM/unord.ll
deleted file mode 100644
index e1774232d159..000000000000
--- a/release_23/test/CodeGen/ARM/unord.ll
+++ /dev/null
@@ -1,16 +0,0 @@
-; RUN: llvm-as < %s | llc -march=arm | grep movne | count 1
-; RUN: llvm-as < %s | llc -march=arm | grep moveq | count 1
-; RUN: llvm-as < %s | llc -march=thumb | grep bne | count 1
-; RUN: llvm-as < %s | llc -march=thumb | grep beq | count 1
-
-define i32 @f1(float %X, float %Y) {
- %tmp = fcmp uno float %X, %Y
- %retval = select i1 %tmp, i32 1, i32 -1
- ret i32 %retval
-}
-
-define i32 @f2(float %X, float %Y) {
- %tmp = fcmp ord float %X, %Y
- %retval = select i1 %tmp, i32 1, i32 -1
- ret i32 %retval
-}
diff --git a/release_23/test/CodeGen/ARM/uxt_rot.ll b/release_23/test/CodeGen/ARM/uxt_rot.ll
deleted file mode 100644
index 09c74ebbb776..000000000000
--- a/release_23/test/CodeGen/ARM/uxt_rot.ll
+++ /dev/null
@@ -1,24 +0,0 @@
-; RUN: llvm-as < %s | llc -march=arm -mattr=+v6 | grep uxtb | count 1
-; RUN: llvm-as < %s | llc -march=arm -mattr=+v6 | grep uxtab | count 1
-; RUN: llvm-as < %s | llc -march=arm -mattr=+v6 | grep uxth | count 1
-
-define i8 @test1(i32 %A.u) zeroext {
- %B.u = trunc i32 %A.u to i8
- ret i8 %B.u
-}
-
-define i32 @test2(i32 %A.u, i32 %B.u) zeroext {
- %C.u = trunc i32 %B.u to i8
- %D.u = zext i8 %C.u to i32
- %E.u = add i32 %A.u, %D.u
- ret i32 %E.u
-}
-
-define i32 @test3(i32 %A.u) zeroext {
- %B.u = lshr i32 %A.u, 8
- %C.u = shl i32 %A.u, 24
- %D.u = or i32 %B.u, %C.u
- %E.u = trunc i32 %D.u to i16
- %F.u = zext i16 %E.u to i32
- ret i32 %F.u
-}
diff --git a/release_23/test/CodeGen/ARM/uxtb.ll b/release_23/test/CodeGen/ARM/uxtb.ll
deleted file mode 100644
index 85659a7cc981..000000000000
--- a/release_23/test/CodeGen/ARM/uxtb.ll
+++ /dev/null
@@ -1,74 +0,0 @@
-; RUN: llvm-as < %s | llc -march=arm -mattr=+v6 | \
-; RUN: grep uxt | count 10
-
-define i32 @test1(i32 %x) {
- %tmp1 = and i32 %x, 16711935 ; <i32> [#uses=1]
- ret i32 %tmp1
-}
-
-define i32 @test2(i32 %x) {
- %tmp1 = lshr i32 %x, 8 ; <i32> [#uses=1]
- %tmp2 = and i32 %tmp1, 16711935 ; <i32> [#uses=1]
- ret i32 %tmp2
-}
-
-define i32 @test3(i32 %x) {
- %tmp1 = lshr i32 %x, 8 ; <i32> [#uses=1]
- %tmp2 = and i32 %tmp1, 16711935 ; <i32> [#uses=1]
- ret i32 %tmp2
-}
-
-define i32 @test4(i32 %x) {
- %tmp1 = lshr i32 %x, 8 ; <i32> [#uses=1]
- %tmp6 = and i32 %tmp1, 16711935 ; <i32> [#uses=1]
- ret i32 %tmp6
-}
-
-define i32 @test5(i32 %x) {
- %tmp1 = lshr i32 %x, 8 ; <i32> [#uses=1]
- %tmp2 = and i32 %tmp1, 16711935 ; <i32> [#uses=1]
- ret i32 %tmp2
-}
-
-define i32 @test6(i32 %x) {
- %tmp1 = lshr i32 %x, 16 ; <i32> [#uses=1]
- %tmp2 = and i32 %tmp1, 255 ; <i32> [#uses=1]
- %tmp4 = shl i32 %x, 16 ; <i32> [#uses=1]
- %tmp5 = and i32 %tmp4, 16711680 ; <i32> [#uses=1]
- %tmp6 = or i32 %tmp2, %tmp5 ; <i32> [#uses=1]
- ret i32 %tmp6
-}
-
-define i32 @test7(i32 %x) {
- %tmp1 = lshr i32 %x, 16 ; <i32> [#uses=1]
- %tmp2 = and i32 %tmp1, 255 ; <i32> [#uses=1]
- %tmp4 = shl i32 %x, 16 ; <i32> [#uses=1]
- %tmp5 = and i32 %tmp4, 16711680 ; <i32> [#uses=1]
- %tmp6 = or i32 %tmp2, %tmp5 ; <i32> [#uses=1]
- ret i32 %tmp6
-}
-
-define i32 @test8(i32 %x) {
- %tmp1 = shl i32 %x, 8 ; <i32> [#uses=1]
- %tmp2 = and i32 %tmp1, 16711680 ; <i32> [#uses=1]
- %tmp5 = lshr i32 %x, 24 ; <i32> [#uses=1]
- %tmp6 = or i32 %tmp2, %tmp5 ; <i32> [#uses=1]
- ret i32 %tmp6
-}
-
-define i32 @test9(i32 %x) {
- %tmp1 = lshr i32 %x, 24 ; <i32> [#uses=1]
- %tmp4 = shl i32 %x, 8 ; <i32> [#uses=1]
- %tmp5 = and i32 %tmp4, 16711680 ; <i32> [#uses=1]
- %tmp6 = or i32 %tmp5, %tmp1 ; <i32> [#uses=1]
- ret i32 %tmp6
-}
-
-define i32 @test10(i32 %p0) {
- %tmp1 = lshr i32 %p0, 7 ; <i32> [#uses=1]
- %tmp2 = and i32 %tmp1, 16253176 ; <i32> [#uses=2]
- %tmp4 = lshr i32 %tmp2, 5 ; <i32> [#uses=1]
- %tmp5 = and i32 %tmp4, 458759 ; <i32> [#uses=1]
- %tmp7 = or i32 %tmp5, %tmp2 ; <i32> [#uses=1]
- ret i32 %tmp7
-}
diff --git a/release_23/test/CodeGen/ARM/vargs.ll b/release_23/test/CodeGen/ARM/vargs.ll
deleted file mode 100644
index 4bf79c041922..000000000000
--- a/release_23/test/CodeGen/ARM/vargs.ll
+++ /dev/null
@@ -1,12 +0,0 @@
-; RUN: llvm-as < %s | llc -march=arm
-@str = internal constant [43 x i8] c"Hello World %d %d %d %d %d %d %d %d %d %d\0A\00" ; <[43 x i8]*> [#uses=1]
-
-define i32 @main() {
-entry:
- %tmp = call i32 (i8*, ...)* @printf( i8* getelementptr ([43 x i8]* @str, i32 0, i64 0), i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10 ) ; <i32> [#uses=0]
- %tmp2 = call i32 (i8*, ...)* @printf( i8* getelementptr ([43 x i8]* @str, i32 0, i64 0), i32 10, i32 9, i32 8, i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1 ) ; <i32> [#uses=0]
- ret i32 11
-}
-
-declare i32 @printf(i8*, ...)
-
diff --git a/release_23/test/CodeGen/ARM/vargs2.ll b/release_23/test/CodeGen/ARM/vargs2.ll
deleted file mode 100644
index fb0b8d8ef7cb..000000000000
--- a/release_23/test/CodeGen/ARM/vargs2.ll
+++ /dev/null
@@ -1,36 +0,0 @@
-; RUN: llvm-as < %s | llc -march=thumb
-; RUN: llvm-as < %s | llc -march=thumb | \
-; RUN: grep pop | count 2
-
-@str = internal constant [4 x i8] c"%d\0A\00" ; <[4 x i8]*> [#uses=1]
-
-define void @f(i32 %a, ...) {
-entry:
- %va = alloca i8*, align 4 ; <i8**> [#uses=4]
- %va.upgrd.1 = bitcast i8** %va to i8* ; <i8*> [#uses=1]
- call void @llvm.va_start( i8* %va.upgrd.1 )
- br label %bb
-
-bb: ; preds = %bb, %entry
- %a_addr.0 = phi i32 [ %a, %entry ], [ %tmp5, %bb ] ; <i32> [#uses=2]
- %tmp = volatile load i8** %va ; <i8*> [#uses=2]
- %tmp2 = getelementptr i8* %tmp, i32 4 ; <i8*> [#uses=1]
- volatile store i8* %tmp2, i8** %va
- %tmp5 = add i32 %a_addr.0, -1 ; <i32> [#uses=1]
- %tmp.upgrd.2 = icmp eq i32 %a_addr.0, 1 ; <i1> [#uses=1]
- br i1 %tmp.upgrd.2, label %bb7, label %bb
-
-bb7: ; preds = %bb
- %tmp3 = bitcast i8* %tmp to i32* ; <i32*> [#uses=1]
- %tmp.upgrd.3 = load i32* %tmp3 ; <i32> [#uses=1]
- %tmp10 = call i32 (i8*, ...)* @printf( i8* getelementptr ([4 x i8]* @str, i32 0, i64 0), i32 %tmp.upgrd.3 ) ; <i32> [#uses=0]
- %va.upgrd.4 = bitcast i8** %va to i8* ; <i8*> [#uses=1]
- call void @llvm.va_end( i8* %va.upgrd.4 )
- ret void
-}
-
-declare void @llvm.va_start(i8*)
-
-declare i32 @printf(i8*, ...)
-
-declare void @llvm.va_end(i8*)
diff --git a/release_23/test/CodeGen/ARM/vargs_align.ll b/release_23/test/CodeGen/ARM/vargs_align.ll
deleted file mode 100644
index 1f2f05bd6086..000000000000
--- a/release_23/test/CodeGen/ARM/vargs_align.ll
+++ /dev/null
@@ -1,21 +0,0 @@
-; RUN: llvm-as < %s | llc -march=arm -mtriple=arm-linux-gnueabi | \
-; RUN: grep {add sp, sp, #16} | count 1
-; RUN: llvm-as < %s | llc -march=arm -mtriple=arm-linux-gnu | \
-; RUN: grep {add sp, sp, #12} | count 2
-
-define i32 @f(i32 %a, ...) {
-entry:
- %a_addr = alloca i32 ; <i32*> [#uses=1]
- %retval = alloca i32, align 4 ; <i32*> [#uses=2]
- %tmp = alloca i32, align 4 ; <i32*> [#uses=2]
- "alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
- store i32 %a, i32* %a_addr
- store i32 0, i32* %tmp
- %tmp1 = load i32* %tmp ; <i32> [#uses=1]
- store i32 %tmp1, i32* %retval
- br label %return
-
-return: ; preds = %entry
- %retval2 = load i32* %retval ; <i32> [#uses=1]
- ret i32 %retval2
-}
diff --git a/release_23/test/CodeGen/ARM/vfp.ll b/release_23/test/CodeGen/ARM/vfp.ll
deleted file mode 100644
index 2acb33f9aebf..000000000000
--- a/release_23/test/CodeGen/ARM/vfp.ll
+++ /dev/null
@@ -1,144 +0,0 @@
-; RUN: llvm-as < %s | llc -march=arm -mattr=+vfp2 | \
-; RUN: grep fabs | count 2
-; RUN: llvm-as < %s | llc -march=arm -mattr=+vfp2 | \
-; RUN: grep fmscs | count 1
-; RUN: llvm-as < %s | llc -march=arm -mattr=+vfp2 | \
-; RUN: grep fcvt | count 2
-; RUN: llvm-as < %s | llc -march=arm -mattr=+vfp2 | \
-; RUN: grep fuito | count 2
-; RUN: llvm-as < %s | llc -march=arm -mattr=+vfp2 | \
-; RUN: grep fto.i | count 4
-; RUN: llvm-as < %s | llc -march=arm -mattr=+vfp2 | \
-; RUN: grep bmi | count 1
-; RUN: llvm-as < %s | llc -march=arm -mattr=+vfp2 | \
-; RUN: grep bgt | count 1
-; RUN: llvm-as < %s | llc -march=arm -mattr=+vfp2 | \
-; RUN: grep fcmpezs | count 1
-
-define void @test(float* %P, double* %D) {
- %A = load float* %P ; <float> [#uses=1]
- %B = load double* %D ; <double> [#uses=1]
- store float %A, float* %P
- store double %B, double* %D
- ret void
-}
-
-declare float @fabsf(float)
-
-declare double @fabs(double)
-
-define void @test_abs(float* %P, double* %D) {
- %a = load float* %P ; <float> [#uses=1]
- %b = call float @fabsf( float %a ) ; <float> [#uses=1]
- store float %b, float* %P
- %A = load double* %D ; <double> [#uses=1]
- %B = call double @fabs( double %A ) ; <double> [#uses=1]
- store double %B, double* %D
- ret void
-}
-
-define void @test_add(float* %P, double* %D) {
- %a = load float* %P ; <float> [#uses=2]
- %b = add float %a, %a ; <float> [#uses=1]
- store float %b, float* %P
- %A = load double* %D ; <double> [#uses=2]
- %B = add double %A, %A ; <double> [#uses=1]
- store double %B, double* %D
- ret void
-}
-
-define void @test_ext_round(float* %P, double* %D) {
- %a = load float* %P ; <float> [#uses=1]
- %b = fpext float %a to double ; <double> [#uses=1]
- %A = load double* %D ; <double> [#uses=1]
- %B = fptrunc double %A to float ; <float> [#uses=1]
- store double %b, double* %D
- store float %B, float* %P
- ret void
-}
-
-define void @test_fma(float* %P1, float* %P2, float* %P3) {
- %a1 = load float* %P1 ; <float> [#uses=1]
- %a2 = load float* %P2 ; <float> [#uses=1]
- %a3 = load float* %P3 ; <float> [#uses=1]
- %X = mul float %a1, %a2 ; <float> [#uses=1]
- %Y = sub float %X, %a3 ; <float> [#uses=1]
- store float %Y, float* %P1
- ret void
-}
-
-define i32 @test_ftoi(float* %P1) {
- %a1 = load float* %P1 ; <float> [#uses=1]
- %b1 = fptosi float %a1 to i32 ; <i32> [#uses=1]
- ret i32 %b1
-}
-
-define i32 @test_ftou(float* %P1) {
- %a1 = load float* %P1 ; <float> [#uses=1]
- %b1 = fptoui float %a1 to i32 ; <i32> [#uses=1]
- ret i32 %b1
-}
-
-define i32 @test_dtoi(double* %P1) {
- %a1 = load double* %P1 ; <double> [#uses=1]
- %b1 = fptosi double %a1 to i32 ; <i32> [#uses=1]
- ret i32 %b1
-}
-
-define i32 @test_dtou(double* %P1) {
- %a1 = load double* %P1 ; <double> [#uses=1]
- %b1 = fptoui double %a1 to i32 ; <i32> [#uses=1]
- ret i32 %b1
-}
-
-define void @test_utod(double* %P1, i32 %X) {
- %b1 = uitofp i32 %X to double ; <double> [#uses=1]
- store double %b1, double* %P1
- ret void
-}
-
-define void @test_utod2(double* %P1, i8 %X) {
- %b1 = uitofp i8 %X to double ; <double> [#uses=1]
- store double %b1, double* %P1
- ret void
-}
-
-define void @test_cmp(float* %glob, i32 %X) {
-entry:
- %tmp = load float* %glob ; <float> [#uses=2]
- %tmp3 = getelementptr float* %glob, i32 2 ; <float*> [#uses=1]
- %tmp4 = load float* %tmp3 ; <float> [#uses=2]
- %tmp.upgrd.1 = fcmp oeq float %tmp, %tmp4 ; <i1> [#uses=1]
- %tmp5 = fcmp uno float %tmp, %tmp4 ; <i1> [#uses=1]
- %tmp6 = or i1 %tmp.upgrd.1, %tmp5 ; <i1> [#uses=1]
- br i1 %tmp6, label %cond_true, label %cond_false
-
-cond_true: ; preds = %entry
- %tmp.upgrd.2 = tail call i32 (...)* @bar( ) ; <i32> [#uses=0]
- ret void
-
-cond_false: ; preds = %entry
- %tmp7 = tail call i32 (...)* @baz( ) ; <i32> [#uses=0]
- ret void
-}
-
-declare i1 @llvm.isunordered.f32(float, float)
-
-declare i32 @bar(...)
-
-declare i32 @baz(...)
-
-define void @test_cmpfp0(float* %glob, i32 %X) {
-entry:
- %tmp = load float* %glob ; <float> [#uses=1]
- %tmp.upgrd.3 = fcmp ogt float %tmp, 0.000000e+00 ; <i1> [#uses=1]
- br i1 %tmp.upgrd.3, label %cond_true, label %cond_false
-
-cond_true: ; preds = %entry
- %tmp.upgrd.4 = tail call i32 (...)* @bar( ) ; <i32> [#uses=0]
- ret void
-
-cond_false: ; preds = %entry
- %tmp1 = tail call i32 (...)* @baz( ) ; <i32> [#uses=0]
- ret void
-}
diff --git a/release_23/test/CodeGen/ARM/weak.ll b/release_23/test/CodeGen/ARM/weak.ll
deleted file mode 100644
index dadd1b976798..000000000000
--- a/release_23/test/CodeGen/ARM/weak.ll
+++ /dev/null
@@ -1,16 +0,0 @@
-; RUN: llvm-as < %s | llc -march=arm | grep .weak.*f
-; RUN: llvm-as < %s | llc -march=arm | grep .weak.*h
-
-define weak i32 @f() {
-entry:
- unreachable
-}
-
-define void @g() {
-entry:
- tail call void @h( )
- ret void
-}
-
-declare extern_weak void @h()
-
diff --git a/release_23/test/CodeGen/ARM/weak2.ll b/release_23/test/CodeGen/ARM/weak2.ll
deleted file mode 100644
index a57a76707ce6..000000000000
--- a/release_23/test/CodeGen/ARM/weak2.ll
+++ /dev/null
@@ -1,18 +0,0 @@
-; RUN: llvm-as < %s | llc -march=arm | grep .weak
-
-define i32 @f(i32 %a) {
-entry:
- %tmp2 = icmp eq i32 %a, 0 ; <i1> [#uses=1]
- %t.0 = select i1 %tmp2, i32 (...)* null, i32 (...)* @test_weak ; <i32 (...)*> [#uses=2]
- %tmp5 = icmp eq i32 (...)* %t.0, null ; <i1> [#uses=1]
- br i1 %tmp5, label %UnifiedReturnBlock, label %cond_true8
-
-cond_true8: ; preds = %entry
- %tmp10 = tail call i32 (...)* %t.0( ) ; <i32> [#uses=1]
- ret i32 %tmp10
-
-UnifiedReturnBlock: ; preds = %entry
- ret i32 250
-}
-
-declare extern_weak i32 @test_weak(...)
diff --git a/release_23/test/CodeGen/Alpha/2005-07-12-TwoMallocCalls.ll b/release_23/test/CodeGen/Alpha/2005-07-12-TwoMallocCalls.ll
deleted file mode 100644
index c96b14ac97e5..000000000000
--- a/release_23/test/CodeGen/Alpha/2005-07-12-TwoMallocCalls.ll
+++ /dev/null
@@ -1,17 +0,0 @@
-; There should be exactly two calls here (memset and malloc), no more.
-; RUN: llvm-as < %s | llc -march=alpha | grep jsr | count 2
-
-%typedef.bc_struct = type opaque
-declare void @llvm.memset.i64(i8*, i8, i64, i32)
-
-define i1 @l12_l94_bc_divide_endif_2E_3_2E_ce(i32* %tmp.71.reload, i32 %scale2.1.3, i32 %extra.0, %typedef.bc_struct* %n1, %typedef.bc_struct* %n2, i32* %tmp.92.reload, i32 %tmp.94.reload, i32* %tmp.98.reload, i32 %tmp.100.reload, i8** %tmp.112.out, i32* %tmp.157.out, i8** %tmp.158.out) {
-newFuncRoot:
- %tmp.120 = add i32 %extra.0, 2 ; <i32> [#uses=1]
- %tmp.122 = add i32 %tmp.120, %tmp.94.reload ; <i32> [#uses=1]
- %tmp.123 = add i32 %tmp.122, %tmp.100.reload ; <i32> [#uses=2]
- %tmp.112 = malloc i8, i32 %tmp.123 ; <i8*> [#uses=1]
- %tmp.137 = zext i32 %tmp.123 to i64 ; <i64> [#uses=1]
- tail call void @llvm.memset.i64( i8* %tmp.112, i8 0, i64 %tmp.137, i32 0 )
- ret i1 true
-}
-
diff --git a/release_23/test/CodeGen/Alpha/2005-12-12-MissingFCMov.ll b/release_23/test/CodeGen/Alpha/2005-12-12-MissingFCMov.ll
deleted file mode 100644
index b45c2a44388e..000000000000
--- a/release_23/test/CodeGen/Alpha/2005-12-12-MissingFCMov.ll
+++ /dev/null
@@ -1,40 +0,0 @@
-; This shouldn't crash
-; RUN: llvm-as < %s | llc -march=alpha
-
-@.str_4 = external global [44 x i8] ; <[44 x i8]*> [#uses=0]
-
-declare void @printf(i32, ...)
-
-define void @main() {
-entry:
- %tmp.11861 = icmp slt i64 0, 1 ; <i1> [#uses=1]
- %tmp.19466 = icmp slt i64 0, 1 ; <i1> [#uses=1]
- %tmp.21571 = icmp slt i64 0, 1 ; <i1> [#uses=1]
- %tmp.36796 = icmp slt i64 0, 1 ; <i1> [#uses=1]
- br i1 %tmp.11861, label %loopexit.2, label %no_exit.2
-
-no_exit.2: ; preds = %entry
- ret void
-
-loopexit.2: ; preds = %entry
- br i1 %tmp.19466, label %loopexit.3, label %no_exit.3.preheader
-
-no_exit.3.preheader: ; preds = %loopexit.2
- ret void
-
-loopexit.3: ; preds = %loopexit.2
- br i1 %tmp.21571, label %no_exit.6, label %no_exit.4
-
-no_exit.4: ; preds = %loopexit.3
- ret void
-
-no_exit.6: ; preds = %no_exit.6, %loopexit.3
- %tmp.30793 = icmp sgt i64 0, 0 ; <i1> [#uses=1]
- br i1 %tmp.30793, label %loopexit.6, label %no_exit.6
-
-loopexit.6: ; preds = %no_exit.6
- %Z.1 = select i1 %tmp.36796, double 1.000000e+00, double 0x3FEFFF7CEDE74EAE; <double> [#uses=2]
- tail call void (i32, ...)* @printf( i32 0, i64 0, i64 0, i64 0, double 1.000000e+00, double 1.000000e+00, double %Z.1, double %Z.1 )
- ret void
-}
-
diff --git a/release_23/test/CodeGen/Alpha/2006-01-18-MissedGlobal.ll b/release_23/test/CodeGen/Alpha/2006-01-18-MissedGlobal.ll
deleted file mode 100644
index f89997e0bf6b..000000000000
--- a/release_23/test/CodeGen/Alpha/2006-01-18-MissedGlobal.ll
+++ /dev/null
@@ -1,27 +0,0 @@
-; The global symbol should be legalized
-; RUN: llvm-as < %s | llc -march=alpha
-
-target datalayout = "e-p:64:64"
- %struct.LIST_HELP = type { %struct.LIST_HELP*, i8* }
- %struct._IO_FILE = type { i32, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, %struct._IO_marker*, %struct._IO_FILE*, i32, i32, i64, i16, i8, [1 x i8], i8*, i64, i8*, i8*, i32, [44 x i8] }
- %struct._IO_marker = type { %struct._IO_marker*, %struct._IO_FILE*, i32 }
-@clause_SORT = external global [21 x %struct.LIST_HELP*] ; <[21 x %struct.LIST_HELP*]*> [#uses=0]
-@ia_in = external global %struct._IO_FILE* ; <%struct._IO_FILE**> [#uses=1]
-@multvec_j = external global [100 x i32] ; <[100 x i32]*> [#uses=0]
-
-define void @main(i32 %argc) {
-clock_Init.exit:
- %tmp.5.i575 = load i32* null ; <i32> [#uses=1]
- %tmp.309 = icmp eq i32 %tmp.5.i575, 0 ; <i1> [#uses=1]
- br i1 %tmp.309, label %UnifiedReturnBlock, label %then.17
-
-then.17: ; preds = %clock_Init.exit
- store %struct._IO_FILE* null, %struct._IO_FILE** @ia_in
- %savedstack = call i8* @llvm.stacksave( ) ; <i8*> [#uses=0]
- ret void
-
-UnifiedReturnBlock: ; preds = %clock_Init.exit
- ret void
-}
-
-declare i8* @llvm.stacksave()
diff --git a/release_23/test/CodeGen/Alpha/2006-01-26-VaargBreak.ll b/release_23/test/CodeGen/Alpha/2006-01-26-VaargBreak.ll
deleted file mode 100644
index 05ebe1eb888b..000000000000
--- a/release_23/test/CodeGen/Alpha/2006-01-26-VaargBreak.ll
+++ /dev/null
@@ -1,14 +0,0 @@
-; This shouldn't crash
-; RUN: llvm-as < %s | llc -march=alpha
-
-target datalayout = "e-p:64:64"
-target triple = "alphaev6-unknown-linux-gnu"
-deplibs = [ "c", "crtend", "stdc++" ]
- %struct.__va_list_tag = type { i8*, i32 }
-
-define i32 @emit_library_call_value(i32 %nargs, ...) {
-entry:
- %tmp.223 = va_arg %struct.__va_list_tag* null, i32 ; <i32> [#uses=1]
- ret i32 %tmp.223
-}
-
diff --git a/release_23/test/CodeGen/Alpha/2006-04-04-zextload.ll b/release_23/test/CodeGen/Alpha/2006-04-04-zextload.ll
deleted file mode 100644
index f3ff5b1750fe..000000000000
--- a/release_23/test/CodeGen/Alpha/2006-04-04-zextload.ll
+++ /dev/null
@@ -1,34 +0,0 @@
-; RUN: llvm-as < %s | llc -march=alpha
-
-target datalayout = "e-p:64:64"
-target triple = "alphaev67-unknown-linux-gnu"
- %llvm.dbg.compile_unit.type = type { i32, { }*, i32, i32, i8*, i8*, i8* }
- %struct._Callback_list = type { %struct._Callback_list*, void (i32, %struct.ios_base*, i32)*, i32, i32 }
- %struct._Impl = type { i32, %struct.facet**, i64, %struct.facet**, i8** }
- %struct._Words = type { i8*, i64 }
- %"struct.__codecvt_abstract_base<char,char,__mbstate_t>" = type { %struct.facet }
- %"struct.basic_streambuf<char,std::char_traits<char> >" = type { i32 (...)**, i8*, i8*, i8*, i8*, i8*, i8*, %struct.locale }
- %struct.facet = type { i32 (...)**, i32 }
- %struct.ios_base = type { i32 (...)**, i64, i64, i32, i32, i32, %struct._Callback_list*, %struct._Words, [8 x %struct._Words], i32, %struct._Words*, %struct.locale }
- %struct.locale = type { %struct._Impl* }
- %"struct.ostreambuf_iterator<char,std::char_traits<char> >" = type { %"struct.basic_streambuf<char,std::char_traits<char> >"*, i1 }
-@llvm.dbg.compile_unit1047 = external global %llvm.dbg.compile_unit.type ; <%llvm.dbg.compile_unit.type*> [#uses=1]
-
-define void @_ZNKSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE15_M_insert_floatIdEES3_S3_RSt8ios_baseccT_() {
-entry:
- %tmp234 = icmp eq i8 0, 0 ; <i1> [#uses=1]
- br i1 %tmp234, label %cond_next243, label %cond_true235
-
-cond_true235: ; preds = %entry
- ret void
-
-cond_next243: ; preds = %entry
- %tmp428 = load i64* null ; <i64> [#uses=1]
- %tmp428.upgrd.1 = trunc i64 %tmp428 to i32 ; <i32> [#uses=1]
- %tmp429 = alloca i8, i32 %tmp428.upgrd.1 ; <i8*> [#uses=0]
- call void @llvm.dbg.stoppoint( i32 1146, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit1047 to { }*) )
- unreachable
-}
-
-declare void @llvm.dbg.stoppoint(i32, i32, { }*)
-
diff --git a/release_23/test/CodeGen/Alpha/2006-07-03-ASMFormalLowering.ll b/release_23/test/CodeGen/Alpha/2006-07-03-ASMFormalLowering.ll
deleted file mode 100644
index 6b5504757913..000000000000
--- a/release_23/test/CodeGen/Alpha/2006-07-03-ASMFormalLowering.ll
+++ /dev/null
@@ -1,18 +0,0 @@
-; RUN: llvm-as < %s | llc -march=alpha
-
-target datalayout = "e-p:64:64"
-target triple = "alphaev67-unknown-linux-gnu"
-
-define i32 @_ZN9__gnu_cxx18__exchange_and_addEPVii(i32* %__mem, i32 %__val) {
-entry:
- %__tmp = alloca i32, align 4 ; <i32*> [#uses=1]
- %tmp3 = call i32 asm sideeffect "\0A$$Lxadd_0:\0A\09ldl_l $0,$3\0A\09addl $0,$4,$1\0A\09stl_c $1,$2\0A\09beq $1,$$Lxadd_0\0A\09mb", "=&r,=*&r,=*m,m,r"( i32* %__tmp, i32* %__mem, i32* %__mem, i32 %__val ) ; <i32> [#uses=1]
- ret i32 %tmp3
-}
-
-define void @_ZN9__gnu_cxx12__atomic_addEPVii(i32* %__mem, i32 %__val) {
-entry:
- %tmp2 = call i32 asm sideeffect "\0A$$Ladd_1:\0A\09ldl_l $0,$2\0A\09addl $0,$3,$0\0A\09stl_c $0,$1\0A\09beq $0,$$Ladd_1\0A\09mb", "=&r,=*m,m,r"( i32* %__mem, i32* %__mem, i32 %__val ) ; <i32> [#uses=0]
- ret void
-}
-
diff --git a/release_23/test/CodeGen/Alpha/2006-11-01-vastart.ll b/release_23/test/CodeGen/Alpha/2006-11-01-vastart.ll
deleted file mode 100644
index 3f42eda4beb5..000000000000
--- a/release_23/test/CodeGen/Alpha/2006-11-01-vastart.ll
+++ /dev/null
@@ -1,15 +0,0 @@
-; RUN: llvm-as < %s | llc -march=alpha
-
-target datalayout = "e-p:64:64"
-target triple = "alphaev67-unknown-linux-gnu"
- %struct.va_list = type { i8*, i32, i32 }
-
-define void @yyerror(i32, ...) {
-entry:
- %va.upgrd.1 = bitcast %struct.va_list* null to i8* ; <i8*> [#uses=1]
- call void @llvm.va_start( i8* %va.upgrd.1 )
- ret void
-}
-
-declare void @llvm.va_start(i8*)
-
diff --git a/release_23/test/CodeGen/Alpha/2007-11-27-mulneg3.ll b/release_23/test/CodeGen/Alpha/2007-11-27-mulneg3.ll
deleted file mode 100644
index 3eac13d2b7ac..000000000000
--- a/release_23/test/CodeGen/Alpha/2007-11-27-mulneg3.ll
+++ /dev/null
@@ -1,13 +0,0 @@
-; RUN: llvm-as < %s | llc -march=alpha
-
-;FIXME: this should produce no mul inst. But not crashing will have to do for now
-
-; ModuleID = 'Output/bugpoint-train/bugpoint-reduced-simplified.bc'
-target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-f128:128:128"
-target triple = "alphaev6-unknown-linux-gnu"
-
-define fastcc i32 @getcount(i32 %s) {
-cond_next43: ; preds = %bb27
- %tmp431 = mul i32 %s, -3
- ret i32 %tmp431
-}
diff --git a/release_23/test/CodeGen/Alpha/add.ll b/release_23/test/CodeGen/Alpha/add.ll
deleted file mode 100644
index 260584b79048..000000000000
--- a/release_23/test/CodeGen/Alpha/add.ll
+++ /dev/null
@@ -1,179 +0,0 @@
-;test all the shifted and signextending adds and subs with and without consts
-;
-; RUN: llvm-as < %s | llc -march=alpha -o %t.s -f
-; RUN: grep { addl} %t.s | count 2
-; RUN: grep { addq} %t.s | count 2
-; RUN: grep { subl} %t.s | count 2
-; RUN: grep { subq} %t.s | count 1
-;
-; RUN: grep {lda \$0,-100(\$16)} %t.s | count 1
-; RUN: grep {s4addl} %t.s | count 2
-; RUN: grep {s8addl} %t.s | count 2
-; RUN: grep {s4addq} %t.s | count 2
-; RUN: grep {s8addq} %t.s | count 2
-;
-; RUN: grep {s4subl} %t.s | count 2
-; RUN: grep {s8subl} %t.s | count 2
-; RUN: grep {s4subq} %t.s | count 2
-; RUN: grep {s8subq} %t.s | count 2
-
-
-define i32 @al(i32 signext %x.s, i32 signext %y.s) signext {
-entry:
- %tmp.3.s = add i32 %y.s, %x.s ; <i32> [#uses=1]
- ret i32 %tmp.3.s
-}
-
-define i32 @ali(i32 signext %x.s) signext {
-entry:
- %tmp.3.s = add i32 100, %x.s ; <i32> [#uses=1]
- ret i32 %tmp.3.s
-}
-
-define i64 @aq(i64 signext %x.s, i64 signext %y.s) signext {
-entry:
- %tmp.3.s = add i64 %y.s, %x.s ; <i64> [#uses=1]
- ret i64 %tmp.3.s
-}
-
-define i64 @aqi(i64 %x.s) {
-entry:
- %tmp.3.s = add i64 100, %x.s ; <i64> [#uses=1]
- ret i64 %tmp.3.s
-}
-
-define i32 @sl(i32 signext %x.s, i32 signext %y.s) signext {
-entry:
- %tmp.3.s = sub i32 %y.s, %x.s ; <i32> [#uses=1]
- ret i32 %tmp.3.s
-}
-
-define i32 @sli(i32 signext %x.s) signext {
-entry:
- %tmp.3.s = sub i32 %x.s, 100 ; <i32> [#uses=1]
- ret i32 %tmp.3.s
-}
-
-define i64 @sq(i64 %x.s, i64 %y.s) {
-entry:
- %tmp.3.s = sub i64 %y.s, %x.s ; <i64> [#uses=1]
- ret i64 %tmp.3.s
-}
-
-define i64 @sqi(i64 %x.s) {
-entry:
- %tmp.3.s = sub i64 %x.s, 100 ; <i64> [#uses=1]
- ret i64 %tmp.3.s
-}
-
-define i32 @a4l(i32 signext %x.s, i32 signext %y.s) signext {
-entry:
- %tmp.1.s = shl i32 %y.s, 2 ; <i32> [#uses=1]
- %tmp.3.s = add i32 %tmp.1.s, %x.s ; <i32> [#uses=1]
- ret i32 %tmp.3.s
-}
-
-define i32 @a8l(i32 signext %x.s, i32 signext %y.s) signext {
-entry:
- %tmp.1.s = shl i32 %y.s, 3 ; <i32> [#uses=1]
- %tmp.3.s = add i32 %tmp.1.s, %x.s ; <i32> [#uses=1]
- ret i32 %tmp.3.s
-}
-
-define i64 @a4q(i64 %x.s, i64 %y.s) {
-entry:
- %tmp.1.s = shl i64 %y.s, 2 ; <i64> [#uses=1]
- %tmp.3.s = add i64 %tmp.1.s, %x.s ; <i64> [#uses=1]
- ret i64 %tmp.3.s
-}
-
-define i64 @a8q(i64 %x.s, i64 %y.s) {
-entry:
- %tmp.1.s = shl i64 %y.s, 3 ; <i64> [#uses=1]
- %tmp.3.s = add i64 %tmp.1.s, %x.s ; <i64> [#uses=1]
- ret i64 %tmp.3.s
-}
-
-define i32 @a4li(i32 signext %y.s) signext {
-entry:
- %tmp.1.s = shl i32 %y.s, 2 ; <i32> [#uses=1]
- %tmp.3.s = add i32 100, %tmp.1.s ; <i32> [#uses=1]
- ret i32 %tmp.3.s
-}
-
-define i32 @a8li(i32 signext %y.s) signext {
-entry:
- %tmp.1.s = shl i32 %y.s, 3 ; <i32> [#uses=1]
- %tmp.3.s = add i32 100, %tmp.1.s ; <i32> [#uses=1]
- ret i32 %tmp.3.s
-}
-
-define i64 @a4qi(i64 %y.s) {
-entry:
- %tmp.1.s = shl i64 %y.s, 2 ; <i64> [#uses=1]
- %tmp.3.s = add i64 100, %tmp.1.s ; <i64> [#uses=1]
- ret i64 %tmp.3.s
-}
-
-define i64 @a8qi(i64 %y.s) {
-entry:
- %tmp.1.s = shl i64 %y.s, 3 ; <i64> [#uses=1]
- %tmp.3.s = add i64 100, %tmp.1.s ; <i64> [#uses=1]
- ret i64 %tmp.3.s
-}
-
-define i32 @s4l(i32 signext %x.s, i32 signext %y.s) signext {
-entry:
- %tmp.1.s = shl i32 %y.s, 2 ; <i32> [#uses=1]
- %tmp.3.s = sub i32 %tmp.1.s, %x.s ; <i32> [#uses=1]
- ret i32 %tmp.3.s
-}
-
-define i32 @s8l(i32 signext %x.s, i32 signext %y.s) signext {
-entry:
- %tmp.1.s = shl i32 %y.s, 3 ; <i32> [#uses=1]
- %tmp.3.s = sub i32 %tmp.1.s, %x.s ; <i32> [#uses=1]
- ret i32 %tmp.3.s
-}
-
-define i64 @s4q(i64 %x.s, i64 %y.s) {
-entry:
- %tmp.1.s = shl i64 %y.s, 2 ; <i64> [#uses=1]
- %tmp.3.s = sub i64 %tmp.1.s, %x.s ; <i64> [#uses=1]
- ret i64 %tmp.3.s
-}
-
-define i64 @s8q(i64 %x.s, i64 %y.s) {
-entry:
- %tmp.1.s = shl i64 %y.s, 3 ; <i64> [#uses=1]
- %tmp.3.s = sub i64 %tmp.1.s, %x.s ; <i64> [#uses=1]
- ret i64 %tmp.3.s
-}
-
-define i32 @s4li(i32 signext %y.s) signext {
-entry:
- %tmp.1.s = shl i32 %y.s, 2 ; <i32> [#uses=1]
- %tmp.3.s = sub i32 %tmp.1.s, 100 ; <i32> [#uses=1]
- ret i32 %tmp.3.s
-}
-
-define i32 @s8li(i32 signext %y.s) signext {
-entry:
- %tmp.1.s = shl i32 %y.s, 3 ; <i32> [#uses=1]
- %tmp.3.s = sub i32 %tmp.1.s, 100 ; <i32> [#uses=1]
- ret i32 %tmp.3.s
-}
-
-define i64 @s4qi(i64 %y.s) {
-entry:
- %tmp.1.s = shl i64 %y.s, 2 ; <i64> [#uses=1]
- %tmp.3.s = sub i64 %tmp.1.s, 100 ; <i64> [#uses=1]
- ret i64 %tmp.3.s
-}
-
-define i64 @s8qi(i64 %y.s) {
-entry:
- %tmp.1.s = shl i64 %y.s, 3 ; <i64> [#uses=1]
- %tmp.3.s = sub i64 %tmp.1.s, 100 ; <i64> [#uses=1]
- ret i64 %tmp.3.s
-}
diff --git a/release_23/test/CodeGen/Alpha/bic.ll b/release_23/test/CodeGen/Alpha/bic.ll
deleted file mode 100644
index 6e635119e569..000000000000
--- a/release_23/test/CodeGen/Alpha/bic.ll
+++ /dev/null
@@ -1,9 +0,0 @@
-; Make sure this testcase codegens to the bic instruction
-; RUN: llvm-as < %s | llc -march=alpha | grep {bic}
-
-define i64 @bar(i64 %x, i64 %y) {
-entry:
- %tmp.1 = xor i64 %x, -1 ; <i64> [#uses=1]
- %tmp.2 = and i64 %y, %tmp.1 ; <i64> [#uses=1]
- ret i64 %tmp.2
-}
diff --git a/release_23/test/CodeGen/Alpha/bsr.ll b/release_23/test/CodeGen/Alpha/bsr.ll
deleted file mode 100644
index d4618577a044..000000000000
--- a/release_23/test/CodeGen/Alpha/bsr.ll
+++ /dev/null
@@ -1,12 +0,0 @@
-; Make sure this testcase codegens the bsr instruction
-; RUN: llvm-as < %s | llc -march=alpha | grep bsr
-
-define internal i64 @abc(i32 %x) {
- %tmp.2 = add i32 %x, -1 ; <i32> [#uses=1]
- %tmp.0 = call i64 @abc( i32 %tmp.2 ) ; <i64> [#uses=1]
- %tmp.5 = add i32 %x, -2 ; <i32> [#uses=1]
- %tmp.3 = call i64 @abc( i32 %tmp.5 ) ; <i64> [#uses=1]
- %tmp.6 = add i64 %tmp.0, %tmp.3 ; <i64> [#uses=1]
- ret i64 %tmp.6
-}
-
diff --git a/release_23/test/CodeGen/Alpha/call_adj.ll b/release_23/test/CodeGen/Alpha/call_adj.ll
deleted file mode 100644
index ee8cda840e0a..000000000000
--- a/release_23/test/CodeGen/Alpha/call_adj.ll
+++ /dev/null
@@ -1,13 +0,0 @@
-;All this should do is not crash
-;RUN: llvm-as < %s | llc -march=alpha
-
-target datalayout = "e-p:64:64"
-target triple = "alphaev67-unknown-linux-gnu"
-
-define void @_ZNSt13basic_filebufIcSt11char_traitsIcEE22_M_convert_to_externalEPcl(i32 %f) {
-entry:
- %tmp49 = alloca i8, i32 %f ; <i8*> [#uses=0]
- %tmp = call i32 null( i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null ) ; <i32> [#uses=0]
- ret void
-}
-
diff --git a/release_23/test/CodeGen/Alpha/cmov.ll b/release_23/test/CodeGen/Alpha/cmov.ll
deleted file mode 100644
index 08e1dad2c0e7..000000000000
--- a/release_23/test/CodeGen/Alpha/cmov.ll
+++ /dev/null
@@ -1,23 +0,0 @@
-; RUN: llvm-as < %s | llc -march=alpha | not grep cmovlt
-; RUN: llvm-as < %s | llc -march=alpha | grep cmoveq
-
-define i64 @cmov_lt(i64 %a, i64 %c) {
-entry:
- %tmp.1 = icmp slt i64 %c, 0 ; <i1> [#uses=1]
- %retval = select i1 %tmp.1, i64 %a, i64 10 ; <i64> [#uses=1]
- ret i64 %retval
-}
-
-define i64 @cmov_const(i64 %a, i64 %b, i64 %c) {
-entry:
- %tmp.1 = icmp slt i64 %a, %b ; <i1> [#uses=1]
- %retval = select i1 %tmp.1, i64 %c, i64 10 ; <i64> [#uses=1]
- ret i64 %retval
-}
-
-define i64 @cmov_lt2(i64 %a, i64 %c) {
-entry:
- %tmp.1 = icmp sgt i64 %c, 0 ; <i1> [#uses=1]
- %retval = select i1 %tmp.1, i64 10, i64 %a ; <i64> [#uses=1]
- ret i64 %retval
-}
diff --git a/release_23/test/CodeGen/Alpha/cmpbge.ll b/release_23/test/CodeGen/Alpha/cmpbge.ll
deleted file mode 100644
index 9b83215181c9..000000000000
--- a/release_23/test/CodeGen/Alpha/cmpbge.ll
+++ /dev/null
@@ -1,16 +0,0 @@
-; RUN: llvm-as < %s | llc -march=alpha | grep cmpbge | count 2
-
-define i1 @test1(i64 %A, i64 %B) {
- %C = and i64 %A, 255 ; <i64> [#uses=1]
- %D = and i64 %B, 255 ; <i64> [#uses=1]
- %E = icmp uge i64 %C, %D ; <i1> [#uses=1]
- ret i1 %E
-}
-
-define i1 @test2(i64 %a, i64 %B) {
- %A = shl i64 %a, 1 ; <i64> [#uses=1]
- %C = and i64 %A, 254 ; <i64> [#uses=1]
- %D = and i64 %B, 255 ; <i64> [#uses=1]
- %E = icmp uge i64 %C, %D ; <i1> [#uses=1]
- ret i1 %E
-}
diff --git a/release_23/test/CodeGen/Alpha/ctlz.ll b/release_23/test/CodeGen/Alpha/ctlz.ll
deleted file mode 100644
index fba60227f830..000000000000
--- a/release_23/test/CodeGen/Alpha/ctlz.ll
+++ /dev/null
@@ -1,15 +0,0 @@
-; Make sure this testcase codegens to the ctlz instruction
-; RUN: llvm-as < %s | llc -march=alpha -mcpu=ev67 | grep -i ctlz
-; RUN: llvm-as < %s | llc -march=alpha -mattr=+CIX | grep -i ctlz
-; RUN: llvm-as < %s | llc -march=alpha -mcpu=ev6 | not grep -i ctlz
-; RUN: llvm-as < %s | llc -march=alpha -mcpu=ev56 | not grep -i ctlz
-; RUN: llvm-as < %s | llc -march=alpha -mattr=-CIX | not grep -i ctlz
-
-declare i8 @llvm.ctlz.i8(i8)
-
-define i32 @bar(i8 %x) {
-entry:
- %tmp.1 = call i8 @llvm.ctlz.i8( i8 %x )
- %tmp.2 = sext i8 %tmp.1 to i32
- ret i32 %tmp.2
-}
diff --git a/release_23/test/CodeGen/Alpha/ctlz_e.ll b/release_23/test/CodeGen/Alpha/ctlz_e.ll
deleted file mode 100644
index 56027dd3ea7b..000000000000
--- a/release_23/test/CodeGen/Alpha/ctlz_e.ll
+++ /dev/null
@@ -1,11 +0,0 @@
-; Make sure this testcase does not use ctpop
-; RUN: llvm-as < %s | llc -march=alpha | not grep -i ctpop
-
-declare i64 @llvm.ctlz.i64(i64)
-
-define i64 @bar(i64 %x) {
-entry:
- %tmp.1 = call i64 @llvm.ctlz.i64( i64 %x ) ; <i64> [#uses=1]
- ret i64 %tmp.1
-}
-
diff --git a/release_23/test/CodeGen/Alpha/ctpop.ll b/release_23/test/CodeGen/Alpha/ctpop.ll
deleted file mode 100644
index 654cd04dd4f8..000000000000
--- a/release_23/test/CodeGen/Alpha/ctpop.ll
+++ /dev/null
@@ -1,19 +0,0 @@
-; Make sure this testcase codegens to the ctpop instruction
-; RUN: llvm-as < %s | llc -march=alpha -mcpu=ev67 | grep -i ctpop
-; RUN: llvm-as < %s | llc -march=alpha -mattr=+CIX | \
-; RUN: grep -i ctpop
-; RUN: llvm-as < %s | llc -march=alpha -mcpu=ev6 | \
-; RUN: not grep -i ctpop
-; RUN: llvm-as < %s | llc -march=alpha -mcpu=ev56 | \
-; RUN: not grep -i ctpop
-; RUN: llvm-as < %s | llc -march=alpha -mattr=-CIX | \
-; RUN: not grep -i ctpop
-
-declare i64 @llvm.ctpop.i64(i64)
-
-define i64 @bar(i64 %x) {
-entry:
- %tmp.1 = call i64 @llvm.ctpop.i64( i64 %x ) ; <i64> [#uses=1]
- ret i64 %tmp.1
-}
-
diff --git a/release_23/test/CodeGen/Alpha/dg.exp b/release_23/test/CodeGen/Alpha/dg.exp
deleted file mode 100644
index fb9f710b295f..000000000000
--- a/release_23/test/CodeGen/Alpha/dg.exp
+++ /dev/null
@@ -1,5 +0,0 @@
-load_lib llvm.exp
-
-if { [llvm_supports_target Alpha] } {
- RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll}]]
-}
diff --git a/release_23/test/CodeGen/Alpha/eqv.ll b/release_23/test/CodeGen/Alpha/eqv.ll
deleted file mode 100644
index 2539d7247448..000000000000
--- a/release_23/test/CodeGen/Alpha/eqv.ll
+++ /dev/null
@@ -1,10 +0,0 @@
-; Make sure this testcase codegens to the eqv instruction
-; RUN: llvm-as < %s | llc -march=alpha | grep eqv
-
-define i64 @bar(i64 %x, i64 %y) {
-entry:
- %tmp.1 = xor i64 %x, -1 ; <i64> [#uses=1]
- %tmp.2 = xor i64 %y, %tmp.1 ; <i64> [#uses=1]
- ret i64 %tmp.2
-}
-
diff --git a/release_23/test/CodeGen/Alpha/i32_sub_1.ll b/release_23/test/CodeGen/Alpha/i32_sub_1.ll
deleted file mode 100644
index 7af813454072..000000000000
--- a/release_23/test/CodeGen/Alpha/i32_sub_1.ll
+++ /dev/null
@@ -1,9 +0,0 @@
-; Make sure this testcase codegens to the ctpop instruction
-; RUN: llvm-as < %s | llc -march=alpha | grep -i {subl \$16,1,\$0}
-
-
-define i32 @foo(i32 signext %x) signext {
-entry:
- %tmp.1 = add i32 %x, -1 ; <int> [#uses=1]
- ret i32 %tmp.1
-}
diff --git a/release_23/test/CodeGen/Alpha/illegal-element-type.ll b/release_23/test/CodeGen/Alpha/illegal-element-type.ll
deleted file mode 100644
index c95d57153db2..000000000000
--- a/release_23/test/CodeGen/Alpha/illegal-element-type.ll
+++ /dev/null
@@ -1,23 +0,0 @@
-; RUN: llvm-as < %s | llc -mtriple=alphaev6-unknown-linux-gnu
-
-define void @foo() {
-entry:
- br label %bb
-
-bb: ; preds = %bb, %entry
- br i1 false, label %bb26, label %bb
-
-bb19: ; preds = %bb26
- ret void
-
-bb26: ; preds = %bb
- br i1 false, label %bb30, label %bb19
-
-bb30: ; preds = %bb26
- br label %bb45
-
-bb45: ; preds = %bb45, %bb30
- %V.0 = phi <8 x i16> [ %tmp42, %bb45 ], [ zeroinitializer, %bb30 ] ; <<8 x i16>> [#uses=1]
- %tmp42 = mul <8 x i16> zeroinitializer, %V.0 ; <<8 x i16>> [#uses=1]
- br label %bb45
-}
diff --git a/release_23/test/CodeGen/Alpha/jmp_table.ll b/release_23/test/CodeGen/Alpha/jmp_table.ll
deleted file mode 100644
index d7b61163e7b8..000000000000
--- a/release_23/test/CodeGen/Alpha/jmp_table.ll
+++ /dev/null
@@ -1,99 +0,0 @@
-; try to check that we have the most important instructions, which shouldn't
-; appear otherwise
-; RUN: llvm-as < %s | llc -march=alpha | grep jmp
-; RUN: llvm-as < %s | llc -march=alpha | grep gprel32
-; RUN: llvm-as < %s | llc -march=alpha | grep ldl
-; RUN: llvm-as < %s | llc -march=alpha | grep rodata
-; END.
-
-target datalayout = "e-p:64:64"
-target triple = "alphaev67-unknown-linux-gnu"
-@str = internal constant [2 x i8] c"1\00" ; <[2 x i8]*> [#uses=1]
-@str1 = internal constant [2 x i8] c"2\00" ; <[2 x i8]*> [#uses=1]
-@str2 = internal constant [2 x i8] c"3\00" ; <[2 x i8]*> [#uses=1]
-@str3 = internal constant [2 x i8] c"4\00" ; <[2 x i8]*> [#uses=1]
-@str4 = internal constant [2 x i8] c"5\00" ; <[2 x i8]*> [#uses=1]
-@str5 = internal constant [2 x i8] c"6\00" ; <[2 x i8]*> [#uses=1]
-@str6 = internal constant [2 x i8] c"7\00" ; <[2 x i8]*> [#uses=1]
-@str7 = internal constant [2 x i8] c"8\00" ; <[2 x i8]*> [#uses=1]
-
-define i32 @main(i32 %x, i8** %y) {
-entry:
- %x_addr = alloca i32 ; <i32*> [#uses=2]
- %y_addr = alloca i8** ; <i8***> [#uses=1]
- %retval = alloca i32, align 4 ; <i32*> [#uses=2]
- %tmp = alloca i32, align 4 ; <i32*> [#uses=2]
- %foo = alloca i8*, align 8 ; <i8**> [#uses=9]
- %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
- store i32 %x, i32* %x_addr
- store i8** %y, i8*** %y_addr
- %tmp.upgrd.1 = load i32* %x_addr ; <i32> [#uses=1]
- switch i32 %tmp.upgrd.1, label %bb15 [
- i32 1, label %bb
- i32 2, label %bb1
- i32 3, label %bb3
- i32 4, label %bb5
- i32 5, label %bb7
- i32 6, label %bb9
- i32 7, label %bb11
- i32 8, label %bb13
- ]
-
-bb: ; preds = %entry
- %tmp.upgrd.2 = getelementptr [2 x i8]* @str, i32 0, i64 0 ; <i8*> [#uses=1]
- store i8* %tmp.upgrd.2, i8** %foo
- br label %bb16
-
-bb1: ; preds = %entry
- %tmp2 = getelementptr [2 x i8]* @str1, i32 0, i64 0 ; <i8*> [#uses=1]
- store i8* %tmp2, i8** %foo
- br label %bb16
-
-bb3: ; preds = %entry
- %tmp4 = getelementptr [2 x i8]* @str2, i32 0, i64 0 ; <i8*> [#uses=1]
- store i8* %tmp4, i8** %foo
- br label %bb16
-
-bb5: ; preds = %entry
- %tmp6 = getelementptr [2 x i8]* @str3, i32 0, i64 0 ; <i8*> [#uses=1]
- store i8* %tmp6, i8** %foo
- br label %bb16
-
-bb7: ; preds = %entry
- %tmp8 = getelementptr [2 x i8]* @str4, i32 0, i64 0 ; <i8*> [#uses=1]
- store i8* %tmp8, i8** %foo
- br label %bb16
-
-bb9: ; preds = %entry
- %tmp10 = getelementptr [2 x i8]* @str5, i32 0, i64 0 ; <i8*> [#uses=1]
- store i8* %tmp10, i8** %foo
- br label %bb16
-
-bb11: ; preds = %entry
- %tmp12 = getelementptr [2 x i8]* @str6, i32 0, i64 0 ; <i8*> [#uses=1]
- store i8* %tmp12, i8** %foo
- br label %bb16
-
-bb13: ; preds = %entry
- %tmp14 = getelementptr [2 x i8]* @str7, i32 0, i64 0 ; <i8*> [#uses=1]
- store i8* %tmp14, i8** %foo
- br label %bb16
-
-bb15: ; preds = %entry
- br label %bb16
-
-bb16: ; preds = %bb15, %bb13, %bb11, %bb9, %bb7, %bb5, %bb3, %bb1, %bb
- %tmp17 = load i8** %foo ; <i8*> [#uses=1]
- %tmp18 = call i32 (...)* @print( i8* %tmp17 ) ; <i32> [#uses=0]
- store i32 0, i32* %tmp
- %tmp19 = load i32* %tmp ; <i32> [#uses=1]
- store i32 %tmp19, i32* %retval
- br label %return
-
-return: ; preds = %bb16
- %retval.upgrd.3 = load i32* %retval ; <i32> [#uses=1]
- ret i32 %retval.upgrd.3
-}
-
-declare i32 @print(...)
-
diff --git a/release_23/test/CodeGen/Alpha/mb.ll b/release_23/test/CodeGen/Alpha/mb.ll
deleted file mode 100644
index 50c245ff3d9e..000000000000
--- a/release_23/test/CodeGen/Alpha/mb.ll
+++ /dev/null
@@ -1,8 +0,0 @@
-; RUN: llvm-as < %s | llc -march=alpha | grep mb
-
-declare void @llvm.memory.barrier( i1 , i1 , i1 , i1 , i1)
-
-define void @test() {
- call void @llvm.memory.barrier( i1 true, i1 true, i1 true, i1 true , i1 true)
- ret void
-}
diff --git a/release_23/test/CodeGen/Alpha/mul5.ll b/release_23/test/CodeGen/Alpha/mul5.ll
deleted file mode 100644
index 052ec0aa42a1..000000000000
--- a/release_23/test/CodeGen/Alpha/mul5.ll
+++ /dev/null
@@ -1,53 +0,0 @@
-; Make sure this testcase does not use mulq
-; RUN: llvm-as < %s | llc -march=alpha | \
-; RUN: not grep -i mul
-; XFAIL: *
-
-define i64 @foo1(i64 %x) {
-entry:
- %tmp.1 = mul i64 %x, 9 ; <i64> [#uses=1]
- ret i64 %tmp.1
-}
-
-define i64 @foo3(i64 %x) {
-entry:
- %tmp.1 = mul i64 %x, 259 ; <i64> [#uses=1]
- ret i64 %tmp.1
-}
-
-define i64 @foo4l(i64 %x) {
-entry:
- %tmp.1 = mul i64 %x, 260 ; <i64> [#uses=1]
- ret i64 %tmp.1
-}
-
-define i64 @foo4ln(i64 %x) {
-entry:
- %tmp.1 = mul i64 %x, 508 ; <i64> [#uses=1]
- ret i64 %tmp.1
-}
-
-define i64 @foo4ln_more(i64 %x) {
-entry:
- %tmp.1 = mul i64 %x, 252 ; <i64> [#uses=1]
- ret i64 %tmp.1
-}
-
-define i64 @foo1n(i64 %x) {
-entry:
- %tmp.1 = mul i64 %x, 511 ; <i64> [#uses=1]
- ret i64 %tmp.1
-}
-
-define i64 @foo8l(i64 %x) {
-entry:
- %tmp.1 = mul i64 %x, 768 ; <i64> [#uses=1]
- ret i64 %tmp.1
-}
-
-define i64 @bar(i64 %x) {
-entry:
- %tmp.1 = mul i64 %x, 5 ; <i64> [#uses=1]
- ret i64 %tmp.1
-}
-
diff --git a/release_23/test/CodeGen/Alpha/neg1.ll b/release_23/test/CodeGen/Alpha/neg1.ll
deleted file mode 100644
index ddaed4a0c6e2..000000000000
--- a/release_23/test/CodeGen/Alpha/neg1.ll
+++ /dev/null
@@ -1,7 +0,0 @@
-; Make sure this testcase codegens to the lda -1 instruction
-; RUN: llvm-as < %s | llc -march=alpha | grep {\\-1}
-
-define i64 @bar() {
-entry:
- ret i64 -1
-}
diff --git a/release_23/test/CodeGen/Alpha/not.ll b/release_23/test/CodeGen/Alpha/not.ll
deleted file mode 100644
index cea9f6bc95f5..000000000000
--- a/release_23/test/CodeGen/Alpha/not.ll
+++ /dev/null
@@ -1,8 +0,0 @@
-; Make sure this testcase codegens to the ornot instruction
-; RUN: llvm-as < %s | llc -march=alpha | grep eqv
-
-define i64 @bar(i64 %x) {
-entry:
- %tmp.1 = xor i64 %x, -1 ; <i64> [#uses=1]
- ret i64 %tmp.1
-}
diff --git a/release_23/test/CodeGen/Alpha/ornot.ll b/release_23/test/CodeGen/Alpha/ornot.ll
deleted file mode 100644
index b8d350dc100e..000000000000
--- a/release_23/test/CodeGen/Alpha/ornot.ll
+++ /dev/null
@@ -1,10 +0,0 @@
-; Make sure this testcase codegens to the ornot instruction
-; RUN: llvm-as < %s | llc -march=alpha | grep ornot
-
-define i64 @bar(i64 %x, i64 %y) {
-entry:
- %tmp.1 = xor i64 %x, -1 ; <i64> [#uses=1]
- %tmp.2 = or i64 %y, %tmp.1 ; <i64> [#uses=1]
- ret i64 %tmp.2
-}
-
diff --git a/release_23/test/CodeGen/Alpha/rpcc.ll b/release_23/test/CodeGen/Alpha/rpcc.ll
deleted file mode 100644
index 193a47f7ce3f..000000000000
--- a/release_23/test/CodeGen/Alpha/rpcc.ll
+++ /dev/null
@@ -1,9 +0,0 @@
-; RUN: llvm-as < %s | llc -march=alpha | grep rpcc
-
-declare i64 @llvm.readcyclecounter()
-
-define i64 @foo() {
-entry:
- %tmp.1 = call i64 @llvm.readcyclecounter( ) ; <i64> [#uses=1]
- ret i64 %tmp.1
-}
diff --git a/release_23/test/CodeGen/Alpha/srl_and.ll b/release_23/test/CodeGen/Alpha/srl_and.ll
deleted file mode 100644
index 2344833dc5b3..000000000000
--- a/release_23/test/CodeGen/Alpha/srl_and.ll
+++ /dev/null
@@ -1,10 +0,0 @@
-; Make sure this testcase codegens to the zapnot instruction
-; RUN: llvm-as < %s | llc -march=alpha | grep zapnot
-
-define i64 @foo(i64 %y) {
-entry:
- %tmp = lshr i64 %y, 3 ; <i64> [#uses=1]
- %tmp2 = and i64 %tmp, 8191 ; <i64> [#uses=1]
- ret i64 %tmp2
-}
-
diff --git a/release_23/test/CodeGen/Alpha/weak.ll b/release_23/test/CodeGen/Alpha/weak.ll
deleted file mode 100644
index e00e6d7bfe26..000000000000
--- a/release_23/test/CodeGen/Alpha/weak.ll
+++ /dev/null
@@ -1,16 +0,0 @@
-; RUN: llvm-as < %s | llc -march=alpha | grep .weak.*f
-; RUN: llvm-as < %s | llc -march=alpha | grep .weak.*h
-
-define weak i32 @f() {
-entry:
- unreachable
-}
-
-define void @g() {
-entry:
- tail call void @h( )
- ret void
-}
-
-declare extern_weak void @h()
-
diff --git a/release_23/test/CodeGen/Alpha/wmb.ll b/release_23/test/CodeGen/Alpha/wmb.ll
deleted file mode 100644
index f745cd52ba3d..000000000000
--- a/release_23/test/CodeGen/Alpha/wmb.ll
+++ /dev/null
@@ -1,8 +0,0 @@
-; RUN: llvm-as < %s | llc -march=alpha | grep wmb
-
-declare void @llvm.memory.barrier( i1 , i1 , i1 , i1 , i1)
-
-define void @test() {
- call void @llvm.memory.barrier( i1 false, i1 false, i1 false, i1 true , i1 true)
- ret void
-}
diff --git a/release_23/test/CodeGen/Alpha/zapnot.ll b/release_23/test/CodeGen/Alpha/zapnot.ll
deleted file mode 100644
index 7fec19bdf3f5..000000000000
--- a/release_23/test/CodeGen/Alpha/zapnot.ll
+++ /dev/null
@@ -1,9 +0,0 @@
-; Make sure this testcase codegens to the bic instruction
-; RUN: llvm-as < %s | llc -march=alpha | grep zapnot
-
-
-define i16 @foo(i64 %y) zeroext {
-entry:
- %tmp.1 = trunc i64 %y to i16 ; <ushort> [#uses=1]
- ret i16 %tmp.1
-}
diff --git a/release_23/test/CodeGen/Alpha/zapnot2.ll b/release_23/test/CodeGen/Alpha/zapnot2.ll
deleted file mode 100644
index 6a33ca2ab21f..000000000000
--- a/release_23/test/CodeGen/Alpha/zapnot2.ll
+++ /dev/null
@@ -1,9 +0,0 @@
-; Make sure this testcase codegens to the zapnot instruction
-; RUN: llvm-as < %s | llc -march=alpha | grep zapnot
-
-define i64 @bar(i64 %x) {
-entry:
- %tmp.1 = and i64 %x, 16711935 ; <i64> [#uses=1]
- ret i64 %tmp.1
-}
-
diff --git a/release_23/test/CodeGen/Alpha/zapnot3.ll b/release_23/test/CodeGen/Alpha/zapnot3.ll
deleted file mode 100644
index 26aab37d7bb9..000000000000
--- a/release_23/test/CodeGen/Alpha/zapnot3.ll
+++ /dev/null
@@ -1,15 +0,0 @@
-; RUN: llvm-as < %s | llc -march=alpha | grep zapnot
-
-;demanded bits mess up this mask in a hard to fix way
-;define i64 @foo(i64 %y) {
-; %tmp = and i64 %y, 65535
-; %tmp2 = shr i64 %tmp, i8 3
-; ret i64 %tmp2
-;}
-
-define i64 @foo2(i64 %y) {
- %tmp = lshr i64 %y, 3 ; <i64> [#uses=1]
- %tmp2 = and i64 %tmp, 8191 ; <i64> [#uses=1]
- ret i64 %tmp2
-}
-
diff --git a/release_23/test/CodeGen/Alpha/zapnot4.ll b/release_23/test/CodeGen/Alpha/zapnot4.ll
deleted file mode 100644
index 1be3ca2e3c72..000000000000
--- a/release_23/test/CodeGen/Alpha/zapnot4.ll
+++ /dev/null
@@ -1,7 +0,0 @@
-; RUN: llvm-as < %s | llc -march=alpha | grep zapnot
-
-define i64 @foo(i64 %y) {
- %tmp = shl i64 %y, 3 ; <i64> [#uses=1]
- %tmp2 = and i64 %tmp, 65535 ; <i64> [#uses=1]
- ret i64 %tmp2
-}
diff --git a/release_23/test/CodeGen/CBackend/2002-05-16-NameCollide.ll b/release_23/test/CodeGen/CBackend/2002-05-16-NameCollide.ll
deleted file mode 100644
index c69b9b0c2cd7..000000000000
--- a/release_23/test/CodeGen/CBackend/2002-05-16-NameCollide.ll
+++ /dev/null
@@ -1,8 +0,0 @@
-; RUN: llvm-as < %s | llc -march=c
-
-; Make sure that global variables do not collide if they have the same name,
-; but different types.
-
-@X = global i32 5 ; <i32*> [#uses=0]
-@X.upgrd.1 = global i64 7 ; <i64*> [#uses=0]
-
diff --git a/release_23/test/CodeGen/CBackend/2002-05-21-MissingReturn.ll b/release_23/test/CodeGen/CBackend/2002-05-21-MissingReturn.ll
deleted file mode 100644
index 29081579ac71..000000000000
--- a/release_23/test/CodeGen/CBackend/2002-05-21-MissingReturn.ll
+++ /dev/null
@@ -1,20 +0,0 @@
-; RUN: llvm-as < %s | llc -march=c
-
-; This case was emitting code that looked like this:
-; ...
-; llvm_BB1: /* no statement here */
-; }
-;
-; Which the Sun C compiler rejected, so now we are sure to put a return
-; instruction in there if the basic block is otherwise empty.
-;
-define void @test() {
- br label %BB1
-
-BB2: ; preds = %BB2
- br label %BB2
-
-BB1: ; preds = %0
- ret void
-}
-
diff --git a/release_23/test/CodeGen/CBackend/2002-08-19-ConstPointerRef.ll b/release_23/test/CodeGen/CBackend/2002-08-19-ConstPointerRef.ll
deleted file mode 100644
index 297807ee32d1..000000000000
--- a/release_23/test/CodeGen/CBackend/2002-08-19-ConstPointerRef.ll
+++ /dev/null
@@ -1,7 +0,0 @@
-; RUN: llvm-as < %s | llc -march=c
-
-; Test const pointer refs & forward references
-
-@t3 = global i32* @t1 ; <i32**> [#uses=0]
-@t1 = global i32 4 ; <i32*> [#uses=1]
-
diff --git a/release_23/test/CodeGen/CBackend/2002-08-19-ConstantExpr.ll b/release_23/test/CodeGen/CBackend/2002-08-19-ConstantExpr.ll
deleted file mode 100644
index ead1bce818f2..000000000000
--- a/release_23/test/CodeGen/CBackend/2002-08-19-ConstantExpr.ll
+++ /dev/null
@@ -1,8 +0,0 @@
-; RUN: llvm-as < %s | llc -march=c
-
-global i32* bitcast (float* @2 to i32*) ;; Forward numeric reference
-global float* @2 ;; Duplicate forward numeric reference
-global float 0.0
-
-@array = constant [2 x i32] [ i32 12, i32 52 ]
-@arrayPtr = global i32* getelementptr ([2 x i32]* @array, i64 0, i64 0)
diff --git a/release_23/test/CodeGen/CBackend/2002-08-19-DataPointer.ll b/release_23/test/CodeGen/CBackend/2002-08-19-DataPointer.ll
deleted file mode 100644
index 7ae13ec54c30..000000000000
--- a/release_23/test/CodeGen/CBackend/2002-08-19-DataPointer.ll
+++ /dev/null
@@ -1,4 +0,0 @@
-; RUN: llvm-as < %s | llc -march=c
-
-@sptr1 = global [11 x i8]* @somestr ;; Forward ref to a constant
-@somestr = constant [11 x i8] c"hello world"
diff --git a/release_23/test/CodeGen/CBackend/2002-08-19-FunctionPointer.ll b/release_23/test/CodeGen/CBackend/2002-08-19-FunctionPointer.ll
deleted file mode 100644
index 25f63a0da6b3..000000000000
--- a/release_23/test/CodeGen/CBackend/2002-08-19-FunctionPointer.ll
+++ /dev/null
@@ -1,5 +0,0 @@
-; RUN: llvm-as < %s | llc -march=c
-
-@fptr = global void ()* @f ;; Forward ref method defn
-declare void @f() ;; External method
-
diff --git a/release_23/test/CodeGen/CBackend/2002-08-19-HardConstantExpr.ll b/release_23/test/CodeGen/CBackend/2002-08-19-HardConstantExpr.ll
deleted file mode 100644
index 528b8de87edf..000000000000
--- a/release_23/test/CodeGen/CBackend/2002-08-19-HardConstantExpr.ll
+++ /dev/null
@@ -1,5 +0,0 @@
-; RUN: llvm-as < %s | llc -march=c
-
-@array = constant [2 x i32] [ i32 12, i32 52 ] ; <[2 x i32]*> [#uses=1]
-@arrayPtr = global i32* getelementptr ([2 x i32]* @array, i64 0, i64 0) ; <i32**> [#uses=0]
-
diff --git a/release_23/test/CodeGen/CBackend/2002-08-20-RecursiveTypes.ll b/release_23/test/CodeGen/CBackend/2002-08-20-RecursiveTypes.ll
deleted file mode 100644
index e9df0c29e1a9..000000000000
--- a/release_23/test/CodeGen/CBackend/2002-08-20-RecursiveTypes.ll
+++ /dev/null
@@ -1,3 +0,0 @@
-; RUN: llvm-as < %s | llc -march=c
-
-@MyIntList = external global { \2*, i32 }
diff --git a/release_23/test/CodeGen/CBackend/2002-08-20-UnnamedArgument.ll b/release_23/test/CodeGen/CBackend/2002-08-20-UnnamedArgument.ll
deleted file mode 100644
index ccffe688992c..000000000000
--- a/release_23/test/CodeGen/CBackend/2002-08-20-UnnamedArgument.ll
+++ /dev/null
@@ -1,10 +0,0 @@
-; RUN: llvm-as < %s | llc -march=c
-
-; The C Writer bombs on this testcase because it tries the print the prototype
-; for the test function, which tries to print the argument name. The function
-; has not been incorporated into the slot calculator, so after it does the name
-; lookup, it tries a slot calculator lookup, which fails.
-
-define i32 @test(i32) {
- ret i32 0
-}
diff --git a/release_23/test/CodeGen/CBackend/2002-08-26-IndirectCallTest.ll b/release_23/test/CodeGen/CBackend/2002-08-26-IndirectCallTest.ll
deleted file mode 100644
index bf592ce3f6fb..000000000000
--- a/release_23/test/CodeGen/CBackend/2002-08-26-IndirectCallTest.ll
+++ /dev/null
@@ -1,17 +0,0 @@
-; RUN: llvm-as < %s | llc -march=c
-
-; Indirect function call test... found by Joel & Brian
-;
-
-@taskArray = external global i32* ; <i32**> [#uses=1]
-
-define void @test(i32 %X) {
- %Y = add i32 %X, -1 ; <i32> [#uses=1]
- %cast100 = sext i32 %Y to i64 ; <i64> [#uses=1]
- %gep100 = getelementptr i32** @taskArray, i64 %cast100 ; <i32**> [#uses=1]
- %fooPtr = load i32** %gep100 ; <i32*> [#uses=1]
- %cast101 = bitcast i32* %fooPtr to void (i32)* ; <void (i32)*> [#uses=1]
- call void %cast101( i32 1000 )
- ret void
-}
-
diff --git a/release_23/test/CodeGen/CBackend/2002-08-30-StructureOrderingTest.ll b/release_23/test/CodeGen/CBackend/2002-08-30-StructureOrderingTest.ll
deleted file mode 100644
index e04890519d9e..000000000000
--- a/release_23/test/CodeGen/CBackend/2002-08-30-StructureOrderingTest.ll
+++ /dev/null
@@ -1,8 +0,0 @@
-; RUN: llvm-as < %s | llc -march=c
-
-; This testcase fails because the C backend does not arrange to output the
-; contents of a structure type before it outputs the structure type itself.
-
-@Y = external global { { i32 } } ; <{ { i32 } }*> [#uses=0]
-@X = external global { float } ; <{ float }*> [#uses=0]
-
diff --git a/release_23/test/CodeGen/CBackend/2002-09-20-ArrayTypeFailure.ll b/release_23/test/CodeGen/CBackend/2002-09-20-ArrayTypeFailure.ll
deleted file mode 100644
index ebb1c0fae265..000000000000
--- a/release_23/test/CodeGen/CBackend/2002-09-20-ArrayTypeFailure.ll
+++ /dev/null
@@ -1,7 +0,0 @@
-; RUN: llvm-as < %s | llc -march=c
-
-define void @test() {
- %X = alloca [4 x i32] ; <[4 x i32]*> [#uses=0]
- ret void
-}
-
diff --git a/release_23/test/CodeGen/CBackend/2002-09-20-VarArgPrototypes.ll b/release_23/test/CodeGen/CBackend/2002-09-20-VarArgPrototypes.ll
deleted file mode 100644
index 69f45753c50e..000000000000
--- a/release_23/test/CodeGen/CBackend/2002-09-20-VarArgPrototypes.ll
+++ /dev/null
@@ -1,6 +0,0 @@
-; RUN: llvm-as < %s | llc -march=c
-
-
-declare void @foo(...)
-
-
diff --git a/release_23/test/CodeGen/CBackend/2002-10-15-OpaqueTypeProblem.ll b/release_23/test/CodeGen/CBackend/2002-10-15-OpaqueTypeProblem.ll
deleted file mode 100644
index 2f6d9beb74a5..000000000000
--- a/release_23/test/CodeGen/CBackend/2002-10-15-OpaqueTypeProblem.ll
+++ /dev/null
@@ -1,6 +0,0 @@
-; RUN: llvm-as < %s | llc -march=c
-
-%MPI_Comm = type %struct.Comm*
-%struct.Comm = type opaque
-@thing = global %MPI_Comm* null ; <%MPI_Comm**> [#uses=0]
-
diff --git a/release_23/test/CodeGen/CBackend/2002-10-16-External.ll b/release_23/test/CodeGen/CBackend/2002-10-16-External.ll
deleted file mode 100644
index d40cbdaa9ad0..000000000000
--- a/release_23/test/CodeGen/CBackend/2002-10-16-External.ll
+++ /dev/null
@@ -1,4 +0,0 @@
-; RUN: llvm-as < %s | llc -march=c
-
-@bob = external global i32 ; <i32*> [#uses=0]
-
diff --git a/release_23/test/CodeGen/CBackend/2002-10-30-FunctionPointerAlloca.ll b/release_23/test/CodeGen/CBackend/2002-10-30-FunctionPointerAlloca.ll
deleted file mode 100644
index a17b8db41c8b..000000000000
--- a/release_23/test/CodeGen/CBackend/2002-10-30-FunctionPointerAlloca.ll
+++ /dev/null
@@ -1,10 +0,0 @@
-; RUN: llvm-as < %s | llc -march=c
-
- %BitField = type i32
- %tokenptr = type i32*
-
-define void @test() {
- %pmf1 = alloca %tokenptr (%tokenptr, i8*)* ; <%tokenptr (%tokenptr, i8*)**> [#uses=0]
- ret void
-}
-
diff --git a/release_23/test/CodeGen/CBackend/2002-11-06-PrintEscaped.ll b/release_23/test/CodeGen/CBackend/2002-11-06-PrintEscaped.ll
deleted file mode 100644
index 2dd281a4beeb..000000000000
--- a/release_23/test/CodeGen/CBackend/2002-11-06-PrintEscaped.ll
+++ /dev/null
@@ -1,11 +0,0 @@
-; RUN: llvm-as < %s | llc -march=c
-
-@testString = internal constant [18 x i8] c"Escaped newline\5Cn\00" ; <[18 x i8]*> [#uses=1]
-
-declare i32 @printf(i8*, ...)
-
-define i32 @main() {
- call i32 (i8*, ...)* @printf( i8* getelementptr ([18 x i8]* @testString, i64 0, i64 0) ) ; <i32>:1 [#uses=0]
- ret i32 0
-}
-
diff --git a/release_23/test/CodeGen/CBackend/2003-05-12-IntegerSizeWarning.ll b/release_23/test/CodeGen/CBackend/2003-05-12-IntegerSizeWarning.ll
deleted file mode 100644
index 4a7170dbbd17..000000000000
--- a/release_23/test/CodeGen/CBackend/2003-05-12-IntegerSizeWarning.ll
+++ /dev/null
@@ -1,8 +0,0 @@
-; RUN: llvm-as < %s | llc -march=c
-
-; Apparently this constant was unsigned in ISO C 90, but not in C 99.
-
-define i32 @foo() {
- ret i32 -2147483648
-}
-
diff --git a/release_23/test/CodeGen/CBackend/2003-05-13-VarArgFunction.ll b/release_23/test/CodeGen/CBackend/2003-05-13-VarArgFunction.ll
deleted file mode 100644
index 2a4e839d737c..000000000000
--- a/release_23/test/CodeGen/CBackend/2003-05-13-VarArgFunction.ll
+++ /dev/null
@@ -1,11 +0,0 @@
-; RUN: llvm-as < %s | llc -march=c
-
-; This testcase breaks the C backend, because gcc doesn't like (...) functions
-; with no arguments at all.
-
-define void @test(i64 %Ptr) {
- %P = inttoptr i64 %Ptr to void (...)* ; <void (...)*> [#uses=1]
- call void (...)* %P( i64 %Ptr )
- ret void
-}
-
diff --git a/release_23/test/CodeGen/CBackend/2003-05-31-MissingStructName.ll b/release_23/test/CodeGen/CBackend/2003-05-31-MissingStructName.ll
deleted file mode 100644
index fb7e2ba69fd5..000000000000
--- a/release_23/test/CodeGen/CBackend/2003-05-31-MissingStructName.ll
+++ /dev/null
@@ -1,5 +0,0 @@
-; RUN: llvm-as < %s | llc -march=c
-
-; The C backend was dying when there was no typename for a struct type!
-
-declare i32 @test(i32, { [32 x i32] }*)
diff --git a/release_23/test/CodeGen/CBackend/2003-06-01-NullPointerType.ll b/release_23/test/CodeGen/CBackend/2003-06-01-NullPointerType.ll
deleted file mode 100644
index 6b7f9f0d378a..000000000000
--- a/release_23/test/CodeGen/CBackend/2003-06-01-NullPointerType.ll
+++ /dev/null
@@ -1,9 +0,0 @@
-; RUN: llvm-as < %s | llc -march=c
-
-%X = type { i32, float }
-
-define void @test() {
- getelementptr %X* null, i64 0, i32 1 ; <float*>:1 [#uses=0]
- ret void
-}
-
diff --git a/release_23/test/CodeGen/CBackend/2003-06-11-HexConstant.ll b/release_23/test/CodeGen/CBackend/2003-06-11-HexConstant.ll
deleted file mode 100644
index c6128d6df7a7..000000000000
--- a/release_23/test/CodeGen/CBackend/2003-06-11-HexConstant.ll
+++ /dev/null
@@ -1,4 +0,0 @@
-; RUN: llvm-as < %s | llc -march=c
-
-; Make sure hex constant does not continue into a valid hexadecimal letter/number
-@version = global [3 x i8] c"\001\00"
diff --git a/release_23/test/CodeGen/CBackend/2003-06-11-LiteralStringProblem.ll b/release_23/test/CodeGen/CBackend/2003-06-11-LiteralStringProblem.ll
deleted file mode 100644
index fd6821174bf2..000000000000
--- a/release_23/test/CodeGen/CBackend/2003-06-11-LiteralStringProblem.ll
+++ /dev/null
@@ -1,3 +0,0 @@
-; RUN: llvm-as < %s | llc -march=c
-
-@version = global [3 x i8] c"1\00\00"
diff --git a/release_23/test/CodeGen/CBackend/2003-06-28-InvokeSupport.ll b/release_23/test/CodeGen/CBackend/2003-06-28-InvokeSupport.ll
deleted file mode 100644
index 9fe98e22063a..000000000000
--- a/release_23/test/CodeGen/CBackend/2003-06-28-InvokeSupport.ll
+++ /dev/null
@@ -1,17 +0,0 @@
-; RUN: llvm-as < %s | llc -march=c
-
-declare i32 @callee(i32, i32)
-
-define i32 @test(i32 %X) {
-; <label>:0
- %A = invoke i32 @callee( i32 %X, i32 5 )
- to label %Ok unwind label %Threw ; <i32> [#uses=1]
-
-Ok: ; preds = %Threw, %0
- %B = phi i32 [ %A, %0 ], [ -1, %Threw ] ; <i32> [#uses=1]
- ret i32 %B
-
-Threw: ; preds = %0
- br label %Ok
-}
-
diff --git a/release_23/test/CodeGen/CBackend/2003-06-28-LinkOnceGlobalVars.ll b/release_23/test/CodeGen/CBackend/2003-06-28-LinkOnceGlobalVars.ll
deleted file mode 100644
index ef3b579b5b47..000000000000
--- a/release_23/test/CodeGen/CBackend/2003-06-28-LinkOnceGlobalVars.ll
+++ /dev/null
@@ -1,3 +0,0 @@
-; RUN: llvm-as < %s | llc -march=c | grep common | grep X
-
-@X = linkonce global i32 5
diff --git a/release_23/test/CodeGen/CBackend/2003-10-12-NANGlobalInits.ll b/release_23/test/CodeGen/CBackend/2003-10-12-NANGlobalInits.ll
deleted file mode 100644
index 077f16cfac92..000000000000
--- a/release_23/test/CodeGen/CBackend/2003-10-12-NANGlobalInits.ll
+++ /dev/null
@@ -1,5 +0,0 @@
-; RUN: llvm-as < %s | llc -march=c
-
-; This is a non-normal FP value: it's a nan.
-@NAN = global { float } { float 0x7FF8000000000000 } ; <{ float }*> [#uses=0]
-@NANs = global { float } { float 0x7FFC000000000000 } ; <{ float }*> [#uses=0]
diff --git a/release_23/test/CodeGen/CBackend/2003-10-23-UnusedType.ll b/release_23/test/CodeGen/CBackend/2003-10-23-UnusedType.ll
deleted file mode 100644
index e67ba2e5b164..000000000000
--- a/release_23/test/CodeGen/CBackend/2003-10-23-UnusedType.ll
+++ /dev/null
@@ -1,8 +0,0 @@
-; RUN: llvm-as < %s | llc -march=c
-
-%A = type { i32, i8*, { i32, i32, i32, i32, i32, i32, i32, i32 }*, i16 }
-
-define void @test(%A*) {
- ret void
-}
-
diff --git a/release_23/test/CodeGen/CBackend/2003-10-28-CastToPtrToStruct.ll b/release_23/test/CodeGen/CBackend/2003-10-28-CastToPtrToStruct.ll
deleted file mode 100644
index 41f3f1ef0fb3..000000000000
--- a/release_23/test/CodeGen/CBackend/2003-10-28-CastToPtrToStruct.ll
+++ /dev/null
@@ -1,12 +0,0 @@
-; RUN: llvm-as < %s | llc -march=c
-
-; reduced from DOOM.
- %union._XEvent = type { i32 }
-@.X_event_9 = global %union._XEvent zeroinitializer ; <%union._XEvent*> [#uses=1]
-
-define void @I_InitGraphics() {
-shortcirc_next.3:
- %tmp.319 = load i32* getelementptr ({ i32, i32 }* bitcast (%union._XEvent* @.X_event_9 to { i32, i32 }*), i64 0, i32 1) ; <i32> [#uses=0]
- ret void
-}
-
diff --git a/release_23/test/CodeGen/CBackend/2003-11-21-ConstantShiftExpr.ll b/release_23/test/CodeGen/CBackend/2003-11-21-ConstantShiftExpr.ll
deleted file mode 100644
index e8da787d27fc..000000000000
--- a/release_23/test/CodeGen/CBackend/2003-11-21-ConstantShiftExpr.ll
+++ /dev/null
@@ -1,13 +0,0 @@
-; RUN: llvm-as < %s | llc -march=c
-@y = weak global i8 0 ; <i8*> [#uses=1]
-
-define i32 @testcaseshr() {
-entry:
- ret i32 lshr (i32 ptrtoint (i8* @y to i32), i32 4)
-}
-
-define i32 @testcaseshl() {
-entry:
- ret i32 shl (i32 ptrtoint (i8* @y to i32), i32 4)
-}
-
diff --git a/release_23/test/CodeGen/CBackend/2004-02-13-FrameReturnAddress.ll b/release_23/test/CodeGen/CBackend/2004-02-13-FrameReturnAddress.ll
deleted file mode 100644
index 911d6d4e9f5f..000000000000
--- a/release_23/test/CodeGen/CBackend/2004-02-13-FrameReturnAddress.ll
+++ /dev/null
@@ -1,16 +0,0 @@
-; RUN: llvm-as < %s | llc -march=c | grep builtin_return_address
-
-declare i8* @llvm.returnaddress(i32)
-
-declare i8* @llvm.frameaddress(i32)
-
-define i8* @test1() {
- %X = call i8* @llvm.returnaddress( i32 0 ) ; <i8*> [#uses=1]
- ret i8* %X
-}
-
-define i8* @test2() {
- %X = call i8* @llvm.frameaddress( i32 0 ) ; <i8*> [#uses=1]
- ret i8* %X
-}
-
diff --git a/release_23/test/CodeGen/CBackend/2004-02-15-PreexistingExternals.ll b/release_23/test/CodeGen/CBackend/2004-02-15-PreexistingExternals.ll
deleted file mode 100644
index 1629debc58fb..000000000000
--- a/release_23/test/CodeGen/CBackend/2004-02-15-PreexistingExternals.ll
+++ /dev/null
@@ -1,18 +0,0 @@
-; The intrinsic lowering pass was lowering intrinsics like llvm.memcpy to
-; explicitly specified prototypes, inserting a new function if the old one
-; didn't exist. This caused there to be two external memcpy functions in
-; this testcase for example, which caused the CBE to mangle one, screwing
-; everything up. :( Test that this does not happen anymore.
-;
-; RUN: llvm-as < %s | llc -march=c | not grep _memcpy
-
-declare void @llvm.memcpy.i32(i8*, i8*, i32, i32)
-
-declare float* @memcpy(i32*, i32, i32)
-
-define i32 @test(i8* %A, i8* %B, i32* %C) {
- call float* @memcpy( i32* %C, i32 4, i32 17 ) ; <float*>:1 [#uses=0]
- call void @llvm.memcpy.i32( i8* %A, i8* %B, i32 123, i32 14 )
- ret i32 7
-}
-
diff --git a/release_23/test/CodeGen/CBackend/2004-02-26-FPNotPrintableConstants.ll b/release_23/test/CodeGen/CBackend/2004-02-26-FPNotPrintableConstants.ll
deleted file mode 100644
index 6f23915a75c0..000000000000
--- a/release_23/test/CodeGen/CBackend/2004-02-26-FPNotPrintableConstants.ll
+++ /dev/null
@@ -1,11 +0,0 @@
-; This is a non-normal FP value
-; RUN: llvm-as < %s | llc -march=c | grep FPConstant | grep static
-
-define float @func() {
- ret float 0xFFF0000000000000
-}
-
-define double @func2() {
- ret double 0xFF20000000000000
-}
-
diff --git a/release_23/test/CodeGen/CBackend/2004-02-26-LinkOnceFunctions.ll b/release_23/test/CodeGen/CBackend/2004-02-26-LinkOnceFunctions.ll
deleted file mode 100644
index 2d62231b74e3..000000000000
--- a/release_23/test/CodeGen/CBackend/2004-02-26-LinkOnceFunctions.ll
+++ /dev/null
@@ -1,6 +0,0 @@
-; RUN: llvm-as < %s | llc -march=c | grep func1 | grep WEAK
-
-define linkonce i32 @func1() {
- ret i32 5
-}
-
diff --git a/release_23/test/CodeGen/CBackend/2004-08-09-va-end-null.ll b/release_23/test/CodeGen/CBackend/2004-08-09-va-end-null.ll
deleted file mode 100644
index ae7ba5305c00..000000000000
--- a/release_23/test/CodeGen/CBackend/2004-08-09-va-end-null.ll
+++ /dev/null
@@ -1,10 +0,0 @@
-; RUN: llvm-as < %s | llc -march=c
-
-declare void @llvm.va_end(i8*)
-
-define void @test() {
- %va.upgrd.1 = bitcast i8* null to i8* ; <i8*> [#uses=1]
- call void @llvm.va_end( i8* %va.upgrd.1 )
- ret void
-}
-
diff --git a/release_23/test/CodeGen/CBackend/2004-11-13-FunctionPointerCast.ll b/release_23/test/CodeGen/CBackend/2004-11-13-FunctionPointerCast.ll
deleted file mode 100644
index a8ee438cc431..000000000000
--- a/release_23/test/CodeGen/CBackend/2004-11-13-FunctionPointerCast.ll
+++ /dev/null
@@ -1,12 +0,0 @@
-; The CBE should not emit code that casts the function pointer. This causes
-; GCC to get testy and insert trap instructions instead of doing the right
-; thing. :(
-; RUN: llvm-as < %s | llc -march=c
-
-declare void @external(i8*)
-
-define i32 @test(i32* %X) {
- %RV = call i32 bitcast (void (i8*)* @external to i32 (i32*)*)( i32* %X ) ; <i32> [#uses=1]
- ret i32 %RV
-}
-
diff --git a/release_23/test/CodeGen/CBackend/2004-12-03-ExternStatics.ll b/release_23/test/CodeGen/CBackend/2004-12-03-ExternStatics.ll
deleted file mode 100644
index 8acab764d780..000000000000
--- a/release_23/test/CodeGen/CBackend/2004-12-03-ExternStatics.ll
+++ /dev/null
@@ -1,10 +0,0 @@
-; RUN: llvm-as < %s | llc -march=c | not grep extern.*msg
-; PR472
-
-@msg = internal global [6 x i8] c"hello\00" ; <[6 x i8]*> [#uses=1]
-
-define i8* @foo() {
-entry:
- ret i8* getelementptr ([6 x i8]* @msg, i32 0, i32 0)
-}
-
diff --git a/release_23/test/CodeGen/CBackend/2004-12-28-LogicalConstantExprs.ll b/release_23/test/CodeGen/CBackend/2004-12-28-LogicalConstantExprs.ll
deleted file mode 100644
index 9acaa726dbe6..000000000000
--- a/release_23/test/CodeGen/CBackend/2004-12-28-LogicalConstantExprs.ll
+++ /dev/null
@@ -1,5 +0,0 @@
-; RUN: llvm-as < %s | llc -march=c
-
-define i32 @foo() {
- ret i32 and (i32 123456, i32 ptrtoint (i32 ()* @foo to i32))
-}
diff --git a/release_23/test/CodeGen/CBackend/2005-02-14-VolatileOperations.ll b/release_23/test/CodeGen/CBackend/2005-02-14-VolatileOperations.ll
deleted file mode 100644
index 12c87901f54e..000000000000
--- a/release_23/test/CodeGen/CBackend/2005-02-14-VolatileOperations.ll
+++ /dev/null
@@ -1,8 +0,0 @@
-; RUN: llvm-as < %s | llc -march=c | grep volatile
-
-define void @test(i32* %P) {
- %X = volatile load i32* %P ; <i32> [#uses=1]
- volatile store i32 %X, i32* %P
- ret void
-}
-
diff --git a/release_23/test/CodeGen/CBackend/2005-03-08-RecursiveTypeCrash.ll b/release_23/test/CodeGen/CBackend/2005-03-08-RecursiveTypeCrash.ll
deleted file mode 100644
index 162e3d358fdb..000000000000
--- a/release_23/test/CodeGen/CBackend/2005-03-08-RecursiveTypeCrash.ll
+++ /dev/null
@@ -1,5 +0,0 @@
-; RUN: llvm-as < %s | llc -march=c
-
- %JNIEnv = type %struct.JNINa*
- %struct.JNINa = type { i8*, i8*, i8*, void (%JNIEnv*)* }
-
diff --git a/release_23/test/CodeGen/CBackend/2005-07-14-NegationToMinusMinus.ll b/release_23/test/CodeGen/CBackend/2005-07-14-NegationToMinusMinus.ll
deleted file mode 100644
index 55d43e2bb020..000000000000
--- a/release_23/test/CodeGen/CBackend/2005-07-14-NegationToMinusMinus.ll
+++ /dev/null
@@ -1,18 +0,0 @@
-; RUN: llvm-as < %s | llc -march=c | not grep -- --65535
-; PR596
-
-target datalayout = "e-p:32:32"
-target triple = "i686-pc-linux-gnu"
-
-declare void @func(i32)
-
-define void @funcb() {
-entry:
- %tmp.1 = sub i32 0, -65535 ; <i32> [#uses=1]
- call void @func( i32 %tmp.1 )
- br label %return
-
-return: ; preds = %entry
- ret void
-}
-
diff --git a/release_23/test/CodeGen/CBackend/2005-08-23-Fmod.ll b/release_23/test/CodeGen/CBackend/2005-08-23-Fmod.ll
deleted file mode 100644
index 7c55019d2350..000000000000
--- a/release_23/test/CodeGen/CBackend/2005-08-23-Fmod.ll
+++ /dev/null
@@ -1,7 +0,0 @@
-; RUN: llvm-as < %s | llc -march=c | grep fmod
-
-define double @test(double %A, double %B) {
- %C = frem double %A, %B ; <double> [#uses=1]
- ret double %C
-}
-
diff --git a/release_23/test/CodeGen/CBackend/2005-09-27-VolatileFuncPtr.ll b/release_23/test/CodeGen/CBackend/2005-09-27-VolatileFuncPtr.ll
deleted file mode 100644
index 37f311d4b93b..000000000000
--- a/release_23/test/CodeGen/CBackend/2005-09-27-VolatileFuncPtr.ll
+++ /dev/null
@@ -1,10 +0,0 @@
-; RUN: llvm-as < %s | llc -march=c | grep {\\* *volatile *\\*}
-
-@G = external global void ()* ; <void ()**> [#uses=2]
-
-define void @test() {
- volatile store void ()* @test, void ()** @G
- volatile load void ()** @G ; <void ()*>:1 [#uses=0]
- ret void
-}
-
diff --git a/release_23/test/CodeGen/CBackend/2006-12-11-Float-Bitcast.ll b/release_23/test/CodeGen/CBackend/2006-12-11-Float-Bitcast.ll
deleted file mode 100644
index ca4e48eb5ea4..000000000000
--- a/release_23/test/CodeGen/CBackend/2006-12-11-Float-Bitcast.ll
+++ /dev/null
@@ -1,49 +0,0 @@
-; RUN: llvm-as < %s | llc -march=c | \
-; RUN: grep __BITCAST | count 14
-
-define i32 @test1(float %F) {
- %X = bitcast float %F to i32 ; <i32> [#uses=1]
- ret i32 %X
-}
-
-define float @test2(i32 %I) {
- %X = bitcast i32 %I to float ; <float> [#uses=1]
- ret float %X
-}
-
-define i64 @test3(double %D) {
- %X = bitcast double %D to i64 ; <i64> [#uses=1]
- ret i64 %X
-}
-
-define double @test4(i64 %L) {
- %X = bitcast i64 %L to double ; <double> [#uses=1]
- ret double %X
-}
-
-define double @test5(double %D) {
- %X = bitcast double %D to double ; <double> [#uses=1]
- %Y = add double %X, 2.000000e+00 ; <double> [#uses=1]
- %Z = bitcast double %Y to i64 ; <i64> [#uses=1]
- %res = bitcast i64 %Z to double ; <double> [#uses=1]
- ret double %res
-}
-
-define float @test6(float %F) {
- %X = bitcast float %F to float ; <float> [#uses=1]
- %Y = add float %X, 2.000000e+00 ; <float> [#uses=1]
- %Z = bitcast float %Y to i32 ; <i32> [#uses=1]
- %res = bitcast i32 %Z to float ; <float> [#uses=1]
- ret float %res
-}
-
-define i32 @main(i32 %argc, i8** %argv) {
- %a = call i32 @test1( float 0x400921FB40000000 ) ; <i32> [#uses=2]
- %b = call float @test2( i32 %a ) ; <float> [#uses=0]
- %c = call i64 @test3( double 0x400921FB4D12D84A ) ; <i64> [#uses=1]
- %d = call double @test4( i64 %c ) ; <double> [#uses=0]
- %e = call double @test5( double 7.000000e+00 ) ; <double> [#uses=0]
- %f = call float @test6( float 7.000000e+00 ) ; <float> [#uses=0]
- ret i32 %a
-}
-
diff --git a/release_23/test/CodeGen/CBackend/2007-01-08-ParamAttr-ICmp.ll b/release_23/test/CodeGen/CBackend/2007-01-08-ParamAttr-ICmp.ll
deleted file mode 100644
index 63dd9da0b11d..000000000000
--- a/release_23/test/CodeGen/CBackend/2007-01-08-ParamAttr-ICmp.ll
+++ /dev/null
@@ -1,26 +0,0 @@
-; For PR1099
-; RUN: llvm-as < %s | llc -march=c | grep {(llvm_cbe_tmp2 == llvm_cbe_b_2e_0_2e_0_2e_val)}
-
-target datalayout = "e-p:32:32"
-target triple = "i686-apple-darwin8"
- %struct.Connector = type { i16, i16, i8, i8, %struct.Connector*, i8* }
-
-
-define i1 @prune_match_entry_2E_ce(%struct.Connector* %a, i16 %b.0.0.val) {
-newFuncRoot:
- br label %entry.ce
-
-cond_next.exitStub: ; preds = %entry.ce
- ret i1 true
-
-entry.return_crit_edge.exitStub: ; preds = %entry.ce
- ret i1 false
-
-entry.ce: ; preds = %newFuncRoot
- %tmp1 = getelementptr %struct.Connector* %a, i32 0, i32 0 ; <i16*> [#uses=1]
- %tmp2 = load i16* %tmp1 ; <i16> [#uses=1]
- %tmp3 = icmp eq i16 %tmp2, %b.0.0.val ; <i1> [#uses=1]
- br i1 %tmp3, label %cond_next.exitStub, label %entry.return_crit_edge.exitStub
-}
-
-
diff --git a/release_23/test/CodeGen/CBackend/2007-01-15-NamedArrayType.ll b/release_23/test/CodeGen/CBackend/2007-01-15-NamedArrayType.ll
deleted file mode 100644
index a9eeff3bffda..000000000000
--- a/release_23/test/CodeGen/CBackend/2007-01-15-NamedArrayType.ll
+++ /dev/null
@@ -1,11 +0,0 @@
-; PR918
-; RUN: llvm-as < %s | llc -march=c | not grep fixarray_array3
-
-%structtype_s = type { i32 }
-%fixarray_array3 = type [3 x %structtype_s]
-
-define i32 @witness(%fixarray_array3* %p) {
- %q = getelementptr %fixarray_array3* %p, i32 0, i32 0, i32 0
- %v = load i32* %q
- ret i32 %v
-}
diff --git a/release_23/test/CodeGen/CBackend/2007-01-17-StackSaveNRestore.ll b/release_23/test/CodeGen/CBackend/2007-01-17-StackSaveNRestore.ll
deleted file mode 100644
index 8fe06b77d787..000000000000
--- a/release_23/test/CodeGen/CBackend/2007-01-17-StackSaveNRestore.ll
+++ /dev/null
@@ -1,12 +0,0 @@
-; RUN: llvm-as < %s | llc -march=c | grep __builtin_stack_save
-; RUN: llvm-as < %s | llc -march=c | grep __builtin_stack_restore
-; PR1028
-
-declare i8* @llvm.stacksave()
-declare void @llvm.stackrestore(i8*)
-
-define i8* @test() {
- %s = call i8* @llvm.stacksave()
- call void @llvm.stackrestore(i8* %s)
- ret i8* %s
-}
diff --git a/release_23/test/CodeGen/CBackend/2007-02-05-memset.ll b/release_23/test/CodeGen/CBackend/2007-02-05-memset.ll
deleted file mode 100644
index f253b30136f0..000000000000
--- a/release_23/test/CodeGen/CBackend/2007-02-05-memset.ll
+++ /dev/null
@@ -1,13 +0,0 @@
-; RUN: llvm-as < %s | llc -march=c
-; PR1181
-target datalayout = "e-p:64:64"
-target triple = "x86_64-apple-darwin8"
-
-
-declare void @llvm.memset.i64(i8*, i8, i64, i32)
-
-define fastcc void @InitUser_data_unregistered() {
-entry:
- tail call void @llvm.memset.i64( i8* null, i8 0, i64 65496, i32 1 )
- ret void
-}
diff --git a/release_23/test/CodeGen/CBackend/2007-02-23-NameConflicts.ll b/release_23/test/CodeGen/CBackend/2007-02-23-NameConflicts.ll
deleted file mode 100644
index 2bc4d516808c..000000000000
--- a/release_23/test/CodeGen/CBackend/2007-02-23-NameConflicts.ll
+++ /dev/null
@@ -1,13 +0,0 @@
-; PR1164
-; RUN: llvm-as < %s | llc -march=c | grep {llvm_cbe_A = \\*llvm_cbe_G;}
-; RUN: llvm-as < %s | llc -march=c | grep {llvm_cbe_B = \\*(&ltmp_0_1);}
-; RUN: llvm-as < %s | llc -march=c | grep {return (llvm_cbe_A + llvm_cbe_B);}
-@G = global i32 123
-@ltmp_0_1 = global i32 123
-
-define i32 @test(i32 *%G) {
- %A = load i32* %G
- %B = load i32* @ltmp_0_1
- %C = add i32 %A, %B
- ret i32 %C
-}
diff --git a/release_23/test/CodeGen/CBackend/2007-07-11-PackedStruct.ll b/release_23/test/CodeGen/CBackend/2007-07-11-PackedStruct.ll
deleted file mode 100644
index 605761611184..000000000000
--- a/release_23/test/CodeGen/CBackend/2007-07-11-PackedStruct.ll
+++ /dev/null
@@ -1,9 +0,0 @@
-; RUN: llvm-as < %s | llc -march=c | grep {packed}
-
- %struct.p = type <{ i16 }>
-
-define i32 @main() {
-entry:
- %t = alloca %struct.p, align 2
- ret i32 5
-}
diff --git a/release_23/test/CodeGen/CBackend/2008-02-01-UnalignedLoadStore.ll b/release_23/test/CodeGen/CBackend/2008-02-01-UnalignedLoadStore.ll
deleted file mode 100644
index 269126d75983..000000000000
--- a/release_23/test/CodeGen/CBackend/2008-02-01-UnalignedLoadStore.ll
+++ /dev/null
@@ -1,15 +0,0 @@
-; RUN: llvm-as < %s | llc -march=c | \
-; RUN: grep {struct __attribute__ ((packed, aligned(} | count 4
-
-define void @test(i32* %P) {
- %X = load i32* %P, align 1
- store i32 %X, i32* %P, align 1
- ret void
-}
-
-define void @test2(i32* %P) {
- %X = volatile load i32* %P, align 2
- volatile store i32 %X, i32* %P, align 2
- ret void
-}
-
diff --git a/release_23/test/CodeGen/CBackend/2008-05-21-MRV-InlineAsm.ll b/release_23/test/CodeGen/CBackend/2008-05-21-MRV-InlineAsm.ll
deleted file mode 100644
index 16bf23e4d88e..000000000000
--- a/release_23/test/CodeGen/CBackend/2008-05-21-MRV-InlineAsm.ll
+++ /dev/null
@@ -1,19 +0,0 @@
-; RUN: llvm-as < %s | llc -march=c
-
-declare {i32, i32} @foo()
-
-define i32 @test() {
- %A = call {i32, i32} @foo()
- %B = getresult {i32, i32} %A, 0
- %C = getresult {i32, i32} %A, 1
- %D = add i32 %B, %C
- ret i32 %D
-}
-
-define i32 @test2() {
- %A = call {i32, i32} asm sideeffect "...", "={cx},={di},~{dirflag},~{fpsr},~{flags},~{memory}"()
- %B = getresult {i32, i32} %A, 0
- %C = getresult {i32, i32} %A, 1
- %D = add i32 %B, %C
- ret i32 %D
-}
diff --git a/release_23/test/CodeGen/CBackend/2008-05-31-BoolOverflow.ll b/release_23/test/CodeGen/CBackend/2008-05-31-BoolOverflow.ll
deleted file mode 100644
index 52e025900780..000000000000
--- a/release_23/test/CodeGen/CBackend/2008-05-31-BoolOverflow.ll
+++ /dev/null
@@ -1,14 +0,0 @@
-; RUN: llvm-as < %s | llc -march=c | grep {llvm_cbe_t.*&1}
-define i32 @test(i32 %r) {
- %s = icmp eq i32 %r, 0
- %t = add i1 %s, %s
- %u = zext i1 %t to i32
- br i1 %t, label %A, label %B
-A:
-
- ret i32 %u
-B:
-
- %v = select i1 %t, i32 %r, i32 %u
- ret i32 %v
-}
diff --git a/release_23/test/CodeGen/CBackend/2008-06-04-IndirectMem.ll b/release_23/test/CodeGen/CBackend/2008-06-04-IndirectMem.ll
deleted file mode 100644
index a2c10469bd7f..000000000000
--- a/release_23/test/CodeGen/CBackend/2008-06-04-IndirectMem.ll
+++ /dev/null
@@ -1,12 +0,0 @@
-; RUN: llvm-as < %s | llc -march=c | grep {"m"(llvm_cbe_newcw))}
-; PR2407
-
-target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32"
-target triple = "i386-pc-linux-gnu"
-
-define void @foo() {
- %newcw = alloca i16 ; <i16*> [#uses=2]
- call void asm sideeffect "fldcw $0", "*m,~{dirflag},~{fpsr},~{flags}"( i16*
-%newcw ) nounwind
- ret void
-}
diff --git a/release_23/test/CodeGen/CBackend/dg.exp b/release_23/test/CodeGen/CBackend/dg.exp
deleted file mode 100644
index 304b90f4ff0a..000000000000
--- a/release_23/test/CodeGen/CBackend/dg.exp
+++ /dev/null
@@ -1,5 +0,0 @@
-load_lib llvm.exp
-
-if { [llvm_supports_target CBackend] } {
- RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
-}
diff --git a/release_23/test/CodeGen/CBackend/vectors.ll b/release_23/test/CodeGen/CBackend/vectors.ll
deleted file mode 100644
index de78975491ef..000000000000
--- a/release_23/test/CodeGen/CBackend/vectors.ll
+++ /dev/null
@@ -1,37 +0,0 @@
-; RUN: llvm-as < %s | llc -march=c
-@.str15 = external global [2 x i8]
-
-define <4 x i32> @foo(<4 x i32> %a, i32 %b) {
- %c = insertelement <4 x i32> %a, i32 1, i32 %b
-
- ret <4 x i32> %c
-}
-
-define i32 @test2(<4 x i32> %a, i32 %b) {
- %c = extractelement <4 x i32> %a, i32 1
-
- ret i32 %c
-}
-
-define <4 x float> @test3(<4 x float> %Y) {
- %Z = add <4 x float> %Y, %Y
- %X = shufflevector <4 x float> zeroinitializer, <4 x float> %Z, <4 x i32> < i32 0, i32 5, i32 6, i32 7 >
- ret <4 x float> %X
-}
-
-define void @test4() {
- %x = alloca <4 x float>
- %tmp3.i16 = getelementptr <4 x float>* %x, i32 0, i32 0
- store float 1.0, float* %tmp3.i16
- ret void
-}
-
-define i32* @test5({i32, i32} * %P) {
- %x = getelementptr {i32, i32} * %P, i32 0, i32 1
- ret i32* %x
-}
-
-define i8* @test6() {
- ret i8* getelementptr ([2 x i8]* @.str15, i32 0, i32 0)
-}
-
diff --git a/release_23/test/CodeGen/CellSPU/and_ops.ll b/release_23/test/CodeGen/CellSPU/and_ops.ll
deleted file mode 100644
index a18b6f8d05fc..000000000000
--- a/release_23/test/CodeGen/CellSPU/and_ops.ll
+++ /dev/null
@@ -1,279 +0,0 @@
-; RUN: llvm-as -o - %s | llc -march=cellspu > %t1.s
-; RUN: grep and %t1.s | count 234
-; RUN: grep andc %t1.s | count 85
-; RUN: grep andi %t1.s | count 37
-; RUN: grep andhi %t1.s | count 30
-; RUN: grep andbi %t1.s | count 4
-
-target datalayout = "E-p:32:32:128-f64:64:128-f32:32:128-i64:32:128-i32:32:128-i16:16:128-i8:8:128-i1:8:128-a0:0:128-v128:128:128-s0:128:128"
-target triple = "spu"
-
-; AND instruction generation:
-define <4 x i32> @and_v4i32_1(<4 x i32> %arg1, <4 x i32> %arg2) {
- %A = and <4 x i32> %arg1, %arg2
- ret <4 x i32> %A
-}
-
-define <4 x i32> @and_v4i32_2(<4 x i32> %arg1, <4 x i32> %arg2) {
- %A = and <4 x i32> %arg2, %arg1
- ret <4 x i32> %A
-}
-
-define <8 x i16> @and_v8i16_1(<8 x i16> %arg1, <8 x i16> %arg2) {
- %A = and <8 x i16> %arg1, %arg2
- ret <8 x i16> %A
-}
-
-define <8 x i16> @and_v8i16_2(<8 x i16> %arg1, <8 x i16> %arg2) {
- %A = and <8 x i16> %arg2, %arg1
- ret <8 x i16> %A
-}
-
-define <16 x i8> @and_v16i8_1(<16 x i8> %arg1, <16 x i8> %arg2) {
- %A = and <16 x i8> %arg2, %arg1
- ret <16 x i8> %A
-}
-
-define <16 x i8> @and_v16i8_2(<16 x i8> %arg1, <16 x i8> %arg2) {
- %A = and <16 x i8> %arg1, %arg2
- ret <16 x i8> %A
-}
-
-define i32 @and_i32_1(i32 %arg1, i32 %arg2) {
- %A = and i32 %arg2, %arg1
- ret i32 %A
-}
-
-define i32 @and_i32_2(i32 %arg1, i32 %arg2) {
- %A = and i32 %arg1, %arg2
- ret i32 %A
-}
-
-define i16 @and_i16_1(i16 %arg1, i16 %arg2) {
- %A = and i16 %arg2, %arg1
- ret i16 %A
-}
-
-define i16 @and_i16_2(i16 %arg1, i16 %arg2) {
- %A = and i16 %arg1, %arg2
- ret i16 %A
-}
-
-define i8 @and_i8_1(i8 %arg1, i8 %arg2) {
- %A = and i8 %arg2, %arg1
- ret i8 %A
-}
-
-define i8 @and_i8_2(i8 %arg1, i8 %arg2) {
- %A = and i8 %arg1, %arg2
- ret i8 %A
-}
-
-; ANDC instruction generation:
-define <4 x i32> @andc_v4i32_1(<4 x i32> %arg1, <4 x i32> %arg2) {
- %A = xor <4 x i32> %arg2, < i32 -1, i32 -1, i32 -1, i32 -1 >
- %B = and <4 x i32> %arg1, %A
- ret <4 x i32> %B
-}
-
-define <4 x i32> @andc_v4i32_2(<4 x i32> %arg1, <4 x i32> %arg2) {
- %A = xor <4 x i32> %arg1, < i32 -1, i32 -1, i32 -1, i32 -1 >
- %B = and <4 x i32> %arg2, %A
- ret <4 x i32> %B
-}
-
-define <4 x i32> @andc_v4i32_3(<4 x i32> %arg1, <4 x i32> %arg2) {
- %A = xor <4 x i32> %arg1, < i32 -1, i32 -1, i32 -1, i32 -1 >
- %B = and <4 x i32> %A, %arg2
- ret <4 x i32> %B
-}
-
-define <8 x i16> @andc_v8i16_1(<8 x i16> %arg1, <8 x i16> %arg2) {
- %A = xor <8 x i16> %arg2, < i16 -1, i16 -1, i16 -1, i16 -1,
- i16 -1, i16 -1, i16 -1, i16 -1 >
- %B = and <8 x i16> %arg1, %A
- ret <8 x i16> %B
-}
-
-define <8 x i16> @andc_v8i16_2(<8 x i16> %arg1, <8 x i16> %arg2) {
- %A = xor <8 x i16> %arg1, < i16 -1, i16 -1, i16 -1, i16 -1,
- i16 -1, i16 -1, i16 -1, i16 -1 >
- %B = and <8 x i16> %arg2, %A
- ret <8 x i16> %B
-}
-
-define <16 x i8> @andc_v16i8_1(<16 x i8> %arg1, <16 x i8> %arg2) {
- %A = xor <16 x i8> %arg1, < i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1,
- i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1,
- i8 -1, i8 -1, i8 -1, i8 -1 >
- %B = and <16 x i8> %arg2, %A
- ret <16 x i8> %B
-}
-
-define <16 x i8> @andc_v16i8_2(<16 x i8> %arg1, <16 x i8> %arg2) {
- %A = xor <16 x i8> %arg2, < i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1,
- i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1,
- i8 -1, i8 -1, i8 -1, i8 -1 >
- %B = and <16 x i8> %arg1, %A
- ret <16 x i8> %B
-}
-
-define <16 x i8> @andc_v16i8_3(<16 x i8> %arg1, <16 x i8> %arg2) {
- %A = xor <16 x i8> %arg2, < i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1,
- i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1,
- i8 -1, i8 -1, i8 -1, i8 -1 >
- %B = and <16 x i8> %A, %arg1
- ret <16 x i8> %B
-}
-
-define i32 @andc_i32_1(i32 %arg1, i32 %arg2) {
- %A = xor i32 %arg2, -1
- %B = and i32 %A, %arg1
- ret i32 %B
-}
-
-define i32 @andc_i32_2(i32 %arg1, i32 %arg2) {
- %A = xor i32 %arg1, -1
- %B = and i32 %A, %arg2
- ret i32 %B
-}
-
-define i32 @andc_i32_3(i32 %arg1, i32 %arg2) {
- %A = xor i32 %arg2, -1
- %B = and i32 %arg1, %A
- ret i32 %B
-}
-
-define i16 @andc_i16_1(i16 %arg1, i16 %arg2) {
- %A = xor i16 %arg2, -1
- %B = and i16 %A, %arg1
- ret i16 %B
-}
-
-define i16 @andc_i16_2(i16 %arg1, i16 %arg2) {
- %A = xor i16 %arg1, -1
- %B = and i16 %A, %arg2
- ret i16 %B
-}
-
-define i16 @andc_i16_3(i16 %arg1, i16 %arg2) {
- %A = xor i16 %arg2, -1
- %B = and i16 %arg1, %A
- ret i16 %B
-}
-
-define i8 @andc_i8_1(i8 %arg1, i8 %arg2) {
- %A = xor i8 %arg2, -1
- %B = and i8 %A, %arg1
- ret i8 %B
-}
-
-define i8 @andc_i8_2(i8 %arg1, i8 %arg2) {
- %A = xor i8 %arg1, -1
- %B = and i8 %A, %arg2
- ret i8 %B
-}
-
-define i8 @andc_i8_3(i8 %arg1, i8 %arg2) {
- %A = xor i8 %arg2, -1
- %B = and i8 %arg1, %A
- ret i8 %B
-}
-
-; ANDI instruction generation (i32 data type):
-define <4 x i32> @andi_v4i32_1(<4 x i32> %in) {
- %tmp2 = and <4 x i32> %in, < i32 511, i32 511, i32 511, i32 511 >
- ret <4 x i32> %tmp2
-}
-
-define <4 x i32> @andi_v4i32_2(<4 x i32> %in) {
- %tmp2 = and <4 x i32> %in, < i32 510, i32 510, i32 510, i32 510 >
- ret <4 x i32> %tmp2
-}
-
-define <4 x i32> @andi_v4i32_3(<4 x i32> %in) {
- %tmp2 = and <4 x i32> %in, < i32 -1, i32 -1, i32 -1, i32 -1 >
- ret <4 x i32> %tmp2
-}
-
-define <4 x i32> @andi_v4i32_4(<4 x i32> %in) {
- %tmp2 = and <4 x i32> %in, < i32 -512, i32 -512, i32 -512, i32 -512 >
- ret <4 x i32> %tmp2
-}
-
-define i32 @andi_u32(i32 zeroext %in) zeroext {
- %tmp37 = and i32 %in, 37
- ret i32 %tmp37
-}
-
-define i32 @andi_i32(i32 signext %in) signext {
- %tmp38 = and i32 %in, 37
- ret i32 %tmp38
-}
-
-define i32 @andi_i32_1(i32 %in) {
- %tmp37 = and i32 %in, 37
- ret i32 %tmp37
-}
-
-; ANDHI instruction generation (i16 data type):
-define <8 x i16> @andhi_v8i16_1(<8 x i16> %in) {
- %tmp2 = and <8 x i16> %in, < i16 511, i16 511, i16 511, i16 511,
- i16 511, i16 511, i16 511, i16 511 >
- ret <8 x i16> %tmp2
-}
-
-define <8 x i16> @andhi_v8i16_2(<8 x i16> %in) {
- %tmp2 = and <8 x i16> %in, < i16 510, i16 510, i16 510, i16 510,
- i16 510, i16 510, i16 510, i16 510 >
- ret <8 x i16> %tmp2
-}
-
-define <8 x i16> @andhi_v8i16_3(<8 x i16> %in) {
- %tmp2 = and <8 x i16> %in, < i16 -1, i16 -1, i16 -1, i16 -1, i16 -1,
- i16 -1, i16 -1, i16 -1 >
- ret <8 x i16> %tmp2
-}
-
-define <8 x i16> @andhi_v8i16_4(<8 x i16> %in) {
- %tmp2 = and <8 x i16> %in, < i16 -512, i16 -512, i16 -512, i16 -512,
- i16 -512, i16 -512, i16 -512, i16 -512 >
- ret <8 x i16> %tmp2
-}
-
-define i16 @andhi_u16(i16 zeroext %in) zeroext {
- %tmp37 = and i16 %in, 37 ; <i16> [#uses=1]
- ret i16 %tmp37
-}
-
-define i16 @andhi_i16(i16 signext %in) signext {
- %tmp38 = and i16 %in, 37 ; <i16> [#uses=1]
- ret i16 %tmp38
-}
-
-; i8 data type (s/b ANDBI if 8-bit registers were supported):
-define <16 x i8> @and_v16i8(<16 x i8> %in) {
- ; ANDBI generated for vector types
- %tmp2 = and <16 x i8> %in, < i8 42, i8 42, i8 42, i8 42, i8 42, i8 42,
- i8 42, i8 42, i8 42, i8 42, i8 42, i8 42,
- i8 42, i8 42, i8 42, i8 42 >
- ret <16 x i8> %tmp2
-}
-
-define i8 @and_u8(i8 zeroext %in) zeroext {
- ; ANDBI generated:
- %tmp37 = and i8 %in, 37
- ret i8 %tmp37
-}
-
-define i8 @and_sext8(i8 signext %in) signext {
- ; ANDBI generated
- %tmp38 = and i8 %in, 37
- ret i8 %tmp38
-}
-
-define i8 @and_i8(i8 %in) {
- ; ANDBI generated
- %tmp38 = and i8 %in, 205
- ret i8 %tmp38
-}
diff --git a/release_23/test/CodeGen/CellSPU/and_ops_more.ll b/release_23/test/CodeGen/CellSPU/and_ops_more.ll
deleted file mode 100644
index 3c9342a1542c..000000000000
--- a/release_23/test/CodeGen/CellSPU/and_ops_more.ll
+++ /dev/null
@@ -1,26 +0,0 @@
-; RUN: llvm-as -o - %s | llc -march=cellspu > %t1.s
-; RUN: grep and %t1.s | count 10
-; RUN: not grep andc %t1.s
-; RUN: not grep andi %t1.s
-; RUN: grep andhi %t1.s | count 5
-; RUN: grep andbi %t1.s | count 1
-; XFAIL: *
-
-; This testcase is derived from test/CodeGen/CellSPU/and_ops.ll and
-; records the changes due to r50358. The and_sext8 function appears
-; to be improved by this change, while the andhi_i16 function appears
-; to be pessimized.
-
-target datalayout = "E-p:32:32:128-f64:64:128-f32:32:128-i64:32:128-i32:32:128-i16:16:128-i8:8:128-i1:8:128-a0:0:128-v128:128:128-s0:128:128"
-target triple = "spu"
-
-define i16 @andhi_i16(i16 signext %in) signext {
- %tmp38 = and i16 %in, 37 ; <i16> [#uses=1]
- ret i16 %tmp38
-}
-
-define i8 @and_sext8(i8 signext %in) signext {
- ; ANDBI generated
- %tmp38 = and i8 %in, 37
- ret i8 %tmp38
-}
diff --git a/release_23/test/CodeGen/CellSPU/call.ll b/release_23/test/CodeGen/CellSPU/call.ll
deleted file mode 100644
index c69aebb55b35..000000000000
--- a/release_23/test/CodeGen/CellSPU/call.ll
+++ /dev/null
@@ -1,20 +0,0 @@
-; RUN: llvm-as -o - %s | llc -march=cellspu > %t1.s
-; RUN: grep brsl %t1.s | count 1
-; RUN: grep brasl %t1.s | count 1
-
-target datalayout = "E-p:32:32:128-f64:64:128-f32:32:128-i64:32:128-i32:32:128-i16:16:128-i8:8:128-i1:8:128-a0:0:128-v128:128:128-s0:128:128"
-target triple = "spu"
-
-define i32 @main() {
-entry:
- %a = call i32 @stub_1(i32 1, float 0x400921FA00000000)
- call void @extern_stub_1(i32 %a, i32 4)
- ret i32 %a
-}
-
-declare void @extern_stub_1(i32, i32)
-
-define i32 @stub_1(i32 %x, float %y) {
-entry:
- ret i32 0
-}
diff --git a/release_23/test/CodeGen/CellSPU/call_indirect.ll b/release_23/test/CodeGen/CellSPU/call_indirect.ll
deleted file mode 100644
index b3437b89095e..000000000000
--- a/release_23/test/CodeGen/CellSPU/call_indirect.ll
+++ /dev/null
@@ -1,49 +0,0 @@
-; RUN: llvm-as -o - %s | llc -march=cellspu > %t1.s
-; RUN: llvm-as -o - %s | llc -march=cellspu -mattr=large_mem > %t2.s
-; RUN: grep bisl %t1.s | count 7
-; RUN: grep ila %t1.s | count 1
-; RUN: grep rotqbyi %t1.s | count 4
-; RUN: grep lqa %t1.s | count 1
-; RUN: grep lqd %t1.s | count 11
-; RUN: grep dispatch_tab %t1.s | count 6
-; RUN: grep bisl %t2.s | count 7
-; RUN: grep ilhu %t2.s | count 2
-; RUN: grep iohl %t2.s | count 2
-; RUN: grep rotqby %t2.s | count 6
-; RUN: grep lqd %t2.s | count 17
-; RUN: grep il %t2.s | count 2
-; RUN: grep ai %t2.s | count 7
-; RUN: grep dispatch_tab %t2.s | count 7
-
-; ModuleID = 'call_indirect.bc'
-target datalayout = "E-p:32:32:128-f64:64:128-f32:32:128-i64:32:128-i32:32:128-i16:16:128-i8:8:128-i1:8:128-a0:0:128-v128:128:128"
-target triple = "spu-unknown-elf"
-
-@dispatch_tab = global [6 x void (i32, float)*] zeroinitializer, align 16
-
-define void @dispatcher(i32 %i_arg, float %f_arg) {
-entry:
- %tmp2 = load void (i32, float)** getelementptr ([6 x void (i32, float)*]* @dispatch_tab, i32 0, i32 0), align 16
- tail call void %tmp2( i32 %i_arg, float %f_arg )
- %tmp2.1 = load void (i32, float)** getelementptr ([6 x void (i32, float)*]* @dispatch_tab, i32 0, i32 1), align 4
- tail call void %tmp2.1( i32 %i_arg, float %f_arg )
- %tmp2.2 = load void (i32, float)** getelementptr ([6 x void (i32, float)*]* @dispatch_tab, i32 0, i32 2), align 4
- tail call void %tmp2.2( i32 %i_arg, float %f_arg )
- %tmp2.3 = load void (i32, float)** getelementptr ([6 x void (i32, float)*]* @dispatch_tab, i32 0, i32 3), align 4
- tail call void %tmp2.3( i32 %i_arg, float %f_arg )
- %tmp2.4 = load void (i32, float)** getelementptr ([6 x void (i32, float)*]* @dispatch_tab, i32 0, i32 4), align 4
- tail call void %tmp2.4( i32 %i_arg, float %f_arg )
- %tmp2.5 = load void (i32, float)** getelementptr ([6 x void (i32, float)*]* @dispatch_tab, i32 0, i32 5), align 4
- tail call void %tmp2.5( i32 %i_arg, float %f_arg )
- ret void
-}
-
-@ptr_list = internal global [1 x void ()*] [ void ()* inttoptr (i64 4294967295 to void ()*) ], align 4
-@ptr.a = internal global void ()** getelementptr ([1 x void ()*]* @ptr_list, i32 0, i32 1), align 16
-
-define void @double_indirect_call() {
- %a = load void ()*** @ptr.a, align 16
- %b = load void ()** %a, align 4
- tail call void %b()
- ret void
-}
diff --git a/release_23/test/CodeGen/CellSPU/ctpop.ll b/release_23/test/CodeGen/CellSPU/ctpop.ll
deleted file mode 100644
index 3c7ee7aeea2b..000000000000
--- a/release_23/test/CodeGen/CellSPU/ctpop.ll
+++ /dev/null
@@ -1,30 +0,0 @@
-; RUN: llvm-as -o - %s | llc -march=cellspu > %t1.s
-; RUN: grep cntb %t1.s | count 3
-; RUN: grep andi %t1.s | count 3
-; RUN: grep rotmi %t1.s | count 2
-; RUN: grep rothmi %t1.s | count 1
-target datalayout = "E-p:32:32:128-f64:64:128-f32:32:128-i64:32:128-i32:32:128-i16:16:128-i8:8:128-i1:8:128-a0:0:128-v128:128:128-s0:128:128"
-target triple = "spu"
-
-declare i8 @llvm.ctpop.i8(i8)
-declare i16 @llvm.ctpop.i16(i16)
-declare i32 @llvm.ctpop.i32(i32)
-
-define i32 @test_i8(i8 %X) {
- call i8 @llvm.ctpop.i8(i8 %X)
- %Y = zext i8 %1 to i32
- ret i32 %Y
-}
-
-define i32 @test_i16(i16 %X) {
- call i16 @llvm.ctpop.i16(i16 %X)
- %Y = zext i16 %1 to i32
- ret i32 %Y
-}
-
-define i32 @test_i32(i32 %X) {
- call i32 @llvm.ctpop.i32(i32 %X)
- %Y = bitcast i32 %1 to i32
- ret i32 %Y
-}
-
diff --git a/release_23/test/CodeGen/CellSPU/dg.exp b/release_23/test/CodeGen/CellSPU/dg.exp
deleted file mode 100644
index 1c0f7f8a4f50..000000000000
--- a/release_23/test/CodeGen/CellSPU/dg.exp
+++ /dev/null
@@ -1,5 +0,0 @@
-load_lib llvm.exp
-
-if { [llvm_supports_target CellSPU] } {
- RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
-}
diff --git a/release_23/test/CodeGen/CellSPU/dp_farith.ll b/release_23/test/CodeGen/CellSPU/dp_farith.ll
deleted file mode 100644
index 2579a404eea5..000000000000
--- a/release_23/test/CodeGen/CellSPU/dp_farith.ll
+++ /dev/null
@@ -1,102 +0,0 @@
-; RUN: llvm-as -o - %s | llc -march=cellspu > %t1.s
-; RUN: grep dfa %t1.s | count 2
-; RUN: grep dfs %t1.s | count 2
-; RUN: grep dfm %t1.s | count 6
-; RUN: grep dfma %t1.s | count 2
-; RUN: grep dfms %t1.s | count 2
-; RUN: grep dfnms %t1.s | count 4
-;
-; This file includes double precision floating point arithmetic instructions
-target datalayout = "E-p:32:32:128-f64:64:128-f32:32:128-i64:32:128-i32:32:128-i16:16:128-i8:8:128-i1:8:128-a0:0:128-v128:128:128-s0:128:128"
-target triple = "spu"
-
-define double @fadd(double %arg1, double %arg2) {
- %A = add double %arg1, %arg2
- ret double %A
-}
-
-define <2 x double> @fadd_vec(<2 x double> %arg1, <2 x double> %arg2) {
- %A = add <2 x double> %arg1, %arg2
- ret <2 x double> %A
-}
-
-define double @fsub(double %arg1, double %arg2) {
- %A = sub double %arg1, %arg2
- ret double %A
-}
-
-define <2 x double> @fsub_vec(<2 x double> %arg1, <2 x double> %arg2) {
- %A = sub <2 x double> %arg1, %arg2
- ret <2 x double> %A
-}
-
-define double @fmul(double %arg1, double %arg2) {
- %A = mul double %arg1, %arg2
- ret double %A
-}
-
-define <2 x double> @fmul_vec(<2 x double> %arg1, <2 x double> %arg2) {
- %A = mul <2 x double> %arg1, %arg2
- ret <2 x double> %A
-}
-
-define double @fma(double %arg1, double %arg2, double %arg3) {
- %A = mul double %arg1, %arg2
- %B = add double %A, %arg3
- ret double %B
-}
-
-define <2 x double> @fma_vec(<2 x double> %arg1, <2 x double> %arg2, <2 x double> %arg3) {
- %A = mul <2 x double> %arg1, %arg2
- %B = add <2 x double> %A, %arg3
- ret <2 x double> %B
-}
-
-define double @fms(double %arg1, double %arg2, double %arg3) {
- %A = mul double %arg1, %arg2
- %B = sub double %A, %arg3
- ret double %B
-}
-
-define <2 x double> @fms_vec(<2 x double> %arg1, <2 x double> %arg2, <2 x double> %arg3) {
- %A = mul <2 x double> %arg1, %arg2
- %B = sub <2 x double> %A, %arg3
- ret <2 x double> %B
-}
-
-; - (a * b - c)
-define double @d_fnms_1(double %arg1, double %arg2, double %arg3) {
- %A = mul double %arg1, %arg2
- %B = sub double %A, %arg3
- %C = sub double -0.000000e+00, %B ; <double> [#uses=1]
- ret double %C
-}
-
-; Annother way of getting fnms
-; - ( a * b ) + c => c - (a * b)
-define double @d_fnms_2(double %arg1, double %arg2, double %arg3) {
- %A = mul double %arg1, %arg2
- %B = sub double %arg3, %A
- ret double %B
-}
-
-; FNMS: - (a * b - c) => c - (a * b)
-define <2 x double> @d_fnms_vec_1(<2 x double> %arg1, <2 x double> %arg2, <2 x double> %arg3) {
- %A = mul <2 x double> %arg1, %arg2
- %B = sub <2 x double> %arg3, %A ;
- ret <2 x double> %B
-}
-
-; Another way to get fnms using a constant vector
-; - ( a * b - c)
-define <2 x double> @d_fnms_vec_2(<2 x double> %arg1, <2 x double> %arg2, <2 x double> %arg3) {
- %A = mul <2 x double> %arg1, %arg2 ; <<2 x double>> [#uses=1]
- %B = sub <2 x double> %A, %arg3 ; <<2 x double>> [#uses=1]
- %C = sub <2 x double> < double -0.00000e+00, double -0.00000e+00 >, %B
- ret <2 x double> %C
-}
-
-;define double @fdiv_1(double %arg1, double %arg2) {
-; %A = fdiv double %arg1, %arg2 ; <double> [#uses=1]
-; ret double %A
-;}
diff --git a/release_23/test/CodeGen/CellSPU/eqv.ll b/release_23/test/CodeGen/CellSPU/eqv.ll
deleted file mode 100644
index 540695677205..000000000000
--- a/release_23/test/CodeGen/CellSPU/eqv.ll
+++ /dev/null
@@ -1,152 +0,0 @@
-; RUN: llvm-as -o - %s | llc -march=cellspu > %t1.s
-; RUN: grep eqv %t1.s | count 18
-; RUN: grep xshw %t1.s | count 6
-; RUN: grep xsbh %t1.s | count 3
-; RUN: grep andi %t1.s | count 3
-
-; Test the 'eqv' instruction, whose boolean expression is:
-; (a & b) | (~a & ~b), which simplifies to
-; (a & b) | ~(a | b)
-; Alternatively, a ^ ~b, which the compiler will also match.
-
-; ModuleID = 'eqv.bc'
-target datalayout = "E-p:32:32:128-f64:64:128-f32:32:128-i64:32:128-i32:32:128-i16:16:128-i8:8:128-i1:8:128-a0:0:128-v128:128:128-s0:128:128"
-target triple = "spu"
-
-define <4 x i32> @equiv_v4i32_1(<4 x i32> %arg1, <4 x i32> %arg2) {
- %A = and <4 x i32> %arg1, %arg2
- %B = or <4 x i32> %arg1, %arg2
- %Bnot = xor <4 x i32> %B, < i32 -1, i32 -1, i32 -1, i32 -1 >
- %C = or <4 x i32> %A, %Bnot
- ret <4 x i32> %C
-}
-
-define <4 x i32> @equiv_v4i32_2(<4 x i32> %arg1, <4 x i32> %arg2) {
- %B = or <4 x i32> %arg1, %arg2 ; <<4 x i32>> [#uses=1]
- %Bnot = xor <4 x i32> %B, < i32 -1, i32 -1, i32 -1, i32 -1 > ; <<4 x i32>> [#uses=1]
- %A = and <4 x i32> %arg1, %arg2 ; <<4 x i32>> [#uses=1]
- %C = or <4 x i32> %A, %Bnot ; <<4 x i32>> [#uses=1]
- ret <4 x i32> %C
-}
-
-define <4 x i32> @equiv_v4i32_3(<4 x i32> %arg1, <4 x i32> %arg2) {
- %B = or <4 x i32> %arg1, %arg2 ; <<4 x i32>> [#uses=1]
- %A = and <4 x i32> %arg1, %arg2 ; <<4 x i32>> [#uses=1]
- %Bnot = xor <4 x i32> %B, < i32 -1, i32 -1, i32 -1, i32 -1 > ; <<4 x i32>> [#uses=1]
- %C = or <4 x i32> %A, %Bnot ; <<4 x i32>> [#uses=1]
- ret <4 x i32> %C
-}
-
-define <4 x i32> @equiv_v4i32_4(<4 x i32> %arg1, <4 x i32> %arg2) {
- %arg2not = xor <4 x i32> %arg2, < i32 -1, i32 -1, i32 -1, i32 -1 >
- %C = xor <4 x i32> %arg1, %arg2not
- ret <4 x i32> %C
-}
-
-define i32 @equiv_i32_1(i32 %arg1, i32 %arg2) {
- %A = and i32 %arg1, %arg2 ; <i32> [#uses=1]
- %B = or i32 %arg1, %arg2 ; <i32> [#uses=1]
- %Bnot = xor i32 %B, -1 ; <i32> [#uses=1]
- %C = or i32 %A, %Bnot ; <i32> [#uses=1]
- ret i32 %C
-}
-
-define i32 @equiv_i32_2(i32 %arg1, i32 %arg2) {
- %B = or i32 %arg1, %arg2 ; <i32> [#uses=1]
- %Bnot = xor i32 %B, -1 ; <i32> [#uses=1]
- %A = and i32 %arg1, %arg2 ; <i32> [#uses=1]
- %C = or i32 %A, %Bnot ; <i32> [#uses=1]
- ret i32 %C
-}
-
-define i32 @equiv_i32_3(i32 %arg1, i32 %arg2) {
- %B = or i32 %arg1, %arg2 ; <i32> [#uses=1]
- %A = and i32 %arg1, %arg2 ; <i32> [#uses=1]
- %Bnot = xor i32 %B, -1 ; <i32> [#uses=1]
- %C = or i32 %A, %Bnot ; <i32> [#uses=1]
- ret i32 %C
-}
-
-define i32 @equiv_i32_4(i32 %arg1, i32 %arg2) {
- %arg2not = xor i32 %arg2, -1
- %C = xor i32 %arg1, %arg2not
- ret i32 %C
-}
-
-define i32 @equiv_i32_5(i32 %arg1, i32 %arg2) {
- %arg1not = xor i32 %arg1, -1
- %C = xor i32 %arg2, %arg1not
- ret i32 %C
-}
-
-define i16 @equiv_i16_1(i16 signext %arg1, i16 signext %arg2) signext {
- %A = and i16 %arg1, %arg2 ; <i16> [#uses=1]
- %B = or i16 %arg1, %arg2 ; <i16> [#uses=1]
- %Bnot = xor i16 %B, -1 ; <i16> [#uses=1]
- %C = or i16 %A, %Bnot ; <i16> [#uses=1]
- ret i16 %C
-}
-
-define i16 @equiv_i16_2(i16 signext %arg1, i16 signext %arg2) signext {
- %B = or i16 %arg1, %arg2 ; <i16> [#uses=1]
- %Bnot = xor i16 %B, -1 ; <i16> [#uses=1]
- %A = and i16 %arg1, %arg2 ; <i16> [#uses=1]
- %C = or i16 %A, %Bnot ; <i16> [#uses=1]
- ret i16 %C
-}
-
-define i16 @equiv_i16_3(i16 signext %arg1, i16 signext %arg2) signext {
- %B = or i16 %arg1, %arg2 ; <i16> [#uses=1]
- %A = and i16 %arg1, %arg2 ; <i16> [#uses=1]
- %Bnot = xor i16 %B, -1 ; <i16> [#uses=1]
- %C = or i16 %A, %Bnot ; <i16> [#uses=1]
- ret i16 %C
-}
-
-define i8 @equiv_i8_1(i8 signext %arg1, i8 signext %arg2) signext {
- %A = and i8 %arg1, %arg2 ; <i8> [#uses=1]
- %B = or i8 %arg1, %arg2 ; <i8> [#uses=1]
- %Bnot = xor i8 %B, -1 ; <i8> [#uses=1]
- %C = or i8 %A, %Bnot ; <i8> [#uses=1]
- ret i8 %C
-}
-
-define i8 @equiv_i8_2(i8 signext %arg1, i8 signext %arg2) signext {
- %B = or i8 %arg1, %arg2 ; <i8> [#uses=1]
- %Bnot = xor i8 %B, -1 ; <i8> [#uses=1]
- %A = and i8 %arg1, %arg2 ; <i8> [#uses=1]
- %C = or i8 %A, %Bnot ; <i8> [#uses=1]
- ret i8 %C
-}
-
-define i8 @equiv_i8_3(i8 signext %arg1, i8 signext %arg2) signext {
- %B = or i8 %arg1, %arg2 ; <i8> [#uses=1]
- %A = and i8 %arg1, %arg2 ; <i8> [#uses=1]
- %Bnot = xor i8 %B, -1 ; <i8> [#uses=1]
- %C = or i8 %A, %Bnot ; <i8> [#uses=1]
- ret i8 %C
-}
-
-define i8 @equiv_u8_1(i8 zeroext %arg1, i8 zeroext %arg2) zeroext {
- %A = and i8 %arg1, %arg2 ; <i8> [#uses=1]
- %B = or i8 %arg1, %arg2 ; <i8> [#uses=1]
- %Bnot = xor i8 %B, -1 ; <i8> [#uses=1]
- %C = or i8 %A, %Bnot ; <i8> [#uses=1]
- ret i8 %C
-}
-
-define i8 @equiv_u8_2(i8 zeroext %arg1, i8 zeroext %arg2) zeroext {
- %B = or i8 %arg1, %arg2 ; <i8> [#uses=1]
- %Bnot = xor i8 %B, -1 ; <i8> [#uses=1]
- %A = and i8 %arg1, %arg2 ; <i8> [#uses=1]
- %C = or i8 %A, %Bnot ; <i8> [#uses=1]
- ret i8 %C
-}
-
-define i8 @equiv_u8_3(i8 zeroext %arg1, i8 zeroext %arg2) zeroext {
- %B = or i8 %arg1, %arg2 ; <i8> [#uses=1]
- %A = and i8 %arg1, %arg2 ; <i8> [#uses=1]
- %Bnot = xor i8 %B, -1 ; <i8> [#uses=1]
- %C = or i8 %A, %Bnot ; <i8> [#uses=1]
- ret i8 %C
-}
diff --git a/release_23/test/CodeGen/CellSPU/extract_elt.ll b/release_23/test/CodeGen/CellSPU/extract_elt.ll
deleted file mode 100644
index 6e05686f4081..000000000000
--- a/release_23/test/CodeGen/CellSPU/extract_elt.ll
+++ /dev/null
@@ -1,177 +0,0 @@
-; RUN: llvm-as -o - %s | llc -march=cellspu > %t1.s
-; RUN: llvm-as -o - %s | llc -march=cellspu -mattr=large_mem > %t2.s
-; RUN: grep shufb %t1.s | count 27
-; RUN: grep lqa %t1.s | count 27
-; RUN: grep lqd %t2.s | count 27
-; RUN: grep space %t1.s | count 8
-; RUN: grep byte %t1.s | count 424
-target datalayout = "E-p:32:32:128-f64:64:128-f32:32:128-i64:32:128-i32:32:128-i16:16:128-i8:8:128-i1:8:128-a0:0:128-v128:128:128-s0:128:128"
-target triple = "spu"
-
-define i32 @i32_extract_0(<4 x i32> %v) {
-entry:
- %a = extractelement <4 x i32> %v, i32 0
- ret i32 %a
-}
-
-define i32 @i32_extract_1(<4 x i32> %v) {
-entry:
- %a = extractelement <4 x i32> %v, i32 1
- ret i32 %a
-}
-
-define i32 @i32_extract_2(<4 x i32> %v) {
-entry:
- %a = extractelement <4 x i32> %v, i32 2
- ret i32 %a
-}
-
-define i32 @i32_extract_3(<4 x i32> %v) {
-entry:
- %a = extractelement <4 x i32> %v, i32 3
- ret i32 %a
-}
-
-define i16 @i16_extract_0(<8 x i16> %v) {
-entry:
- %a = extractelement <8 x i16> %v, i32 0
- ret i16 %a
-}
-
-define i16 @i16_extract_1(<8 x i16> %v) {
-entry:
- %a = extractelement <8 x i16> %v, i32 1
- ret i16 %a
-}
-
-define i16 @i16_extract_2(<8 x i16> %v) {
-entry:
- %a = extractelement <8 x i16> %v, i32 2
- ret i16 %a
-}
-
-define i16 @i16_extract_3(<8 x i16> %v) {
-entry:
- %a = extractelement <8 x i16> %v, i32 3
- ret i16 %a
-}
-
-define i16 @i16_extract_4(<8 x i16> %v) {
-entry:
- %a = extractelement <8 x i16> %v, i32 4
- ret i16 %a
-}
-
-define i16 @i16_extract_5(<8 x i16> %v) {
-entry:
- %a = extractelement <8 x i16> %v, i32 5
- ret i16 %a
-}
-
-define i16 @i16_extract_6(<8 x i16> %v) {
-entry:
- %a = extractelement <8 x i16> %v, i32 6
- ret i16 %a
-}
-
-define i16 @i16_extract_7(<8 x i16> %v) {
-entry:
- %a = extractelement <8 x i16> %v, i32 7
- ret i16 %a
-}
-
-define i8 @i8_extract_0(<16 x i8> %v) {
-entry:
- %a = extractelement <16 x i8> %v, i32 0
- ret i8 %a
-}
-
-define i8 @i8_extract_1(<16 x i8> %v) {
-entry:
- %a = extractelement <16 x i8> %v, i32 1
- ret i8 %a
-}
-
-define i8 @i8_extract_2(<16 x i8> %v) {
-entry:
- %a = extractelement <16 x i8> %v, i32 2
- ret i8 %a
-}
-
-define i8 @i8_extract_3(<16 x i8> %v) {
-entry:
- %a = extractelement <16 x i8> %v, i32 3
- ret i8 %a
-}
-
-define i8 @i8_extract_4(<16 x i8> %v) {
-entry:
- %a = extractelement <16 x i8> %v, i32 4
- ret i8 %a
-}
-
-define i8 @i8_extract_5(<16 x i8> %v) {
-entry:
- %a = extractelement <16 x i8> %v, i32 5
- ret i8 %a
-}
-
-define i8 @i8_extract_6(<16 x i8> %v) {
-entry:
- %a = extractelement <16 x i8> %v, i32 6
- ret i8 %a
-}
-
-define i8 @i8_extract_7(<16 x i8> %v) {
-entry:
- %a = extractelement <16 x i8> %v, i32 7
- ret i8 %a
-}
-
-define i8 @i8_extract_8(<16 x i8> %v) {
-entry:
- %a = extractelement <16 x i8> %v, i32 8
- ret i8 %a
-}
-
-define i8 @i8_extract_9(<16 x i8> %v) {
-entry:
- %a = extractelement <16 x i8> %v, i32 9
- ret i8 %a
-}
-
-define i8 @i8_extract_10(<16 x i8> %v) {
-entry:
- %a = extractelement <16 x i8> %v, i32 10
- ret i8 %a
-}
-
-define i8 @i8_extract_11(<16 x i8> %v) {
-entry:
- %a = extractelement <16 x i8> %v, i32 11
- ret i8 %a
-}
-
-define i8 @i8_extract_12(<16 x i8> %v) {
-entry:
- %a = extractelement <16 x i8> %v, i32 12
- ret i8 %a
-}
-
-define i8 @i8_extract_13(<16 x i8> %v) {
-entry:
- %a = extractelement <16 x i8> %v, i32 13
- ret i8 %a
-}
-
-define i8 @i8_extract_14(<16 x i8> %v) {
-entry:
- %a = extractelement <16 x i8> %v, i32 14
- ret i8 %a
-}
-
-define i8 @i8_extract_15(<16 x i8> %v) {
-entry:
- %a = extractelement <16 x i8> %v, i32 15
- ret i8 %a
-}
diff --git a/release_23/test/CodeGen/CellSPU/fcmp.ll b/release_23/test/CodeGen/CellSPU/fcmp.ll
deleted file mode 100644
index aad77175d163..000000000000
--- a/release_23/test/CodeGen/CellSPU/fcmp.ll
+++ /dev/null
@@ -1,22 +0,0 @@
-; RUN: llvm-as -o - %s | llc -march=cellspu > %t1.s
-; RUN: grep fceq %t1.s | count 1
-; RUN: grep fcmeq %t1.s | count 1
-;
-; This file includes standard floating point arithmetic instructions
-target datalayout = "E-p:32:32:128-f64:64:128-f32:32:128-i64:32:128-i32:32:128-i16:16:128-i8:8:128-i1:8:128-a0:0:128-v128:128:128-s0:128:128"
-target triple = "spu"
-
-declare double @fabs(double)
-declare float @fabsf(float)
-
-define i1 @fcmp_eq(float %arg1, float %arg2) {
- %A = fcmp oeq float %arg1, %arg2 ; <float> [#uses=1]
- ret i1 %A
-}
-
-define i1 @fcmp_mag_eq(float %arg1, float %arg2) {
- %A = call float @fabsf(float %arg1) ; <float> [#uses=1]
- %B = call float @fabsf(float %arg2) ; <float> [#uses=1]
- %C = fcmp oeq float %A, %B ; <float> [#uses=1]
- ret i1 %C
-}
diff --git a/release_23/test/CodeGen/CellSPU/fdiv.ll b/release_23/test/CodeGen/CellSPU/fdiv.ll
deleted file mode 100644
index 75af90e23f88..000000000000
--- a/release_23/test/CodeGen/CellSPU/fdiv.ll
+++ /dev/null
@@ -1,20 +0,0 @@
-; RUN: llvm-as -o - %s | llc -march=cellspu > %t1.s
-; RUN: grep frest %t1.s | count 2
-; RUN: grep fi %t1.s | count 2
-; RUN: grep fm %t1.s | count 4
-; RUN: grep fma %t1.s | count 2
-; RUN: grep fnms %t1.s | count 2
-;
-; This file includes standard floating point arithmetic instructions
-target datalayout = "E-p:32:32:128-f64:64:128-f32:32:128-i64:32:128-i32:32:128-i16:16:128-i8:8:128-i1:8:128-a0:0:128-v128:128:128-s0:128:128"
-target triple = "spu"
-
-define float @fdiv32(float %arg1, float %arg2) {
- %A = fdiv float %arg1, %arg2
- ret float %A
-}
-
-define <4 x float> @fdiv_v4f32(<4 x float> %arg1, <4 x float> %arg2) {
- %A = fdiv <4 x float> %arg1, %arg2
- ret <4 x float> %A
-}
diff --git a/release_23/test/CodeGen/CellSPU/fneg-fabs.ll b/release_23/test/CodeGen/CellSPU/fneg-fabs.ll
deleted file mode 100644
index 045bb0529892..000000000000
--- a/release_23/test/CodeGen/CellSPU/fneg-fabs.ll
+++ /dev/null
@@ -1,43 +0,0 @@
-; RUN: llvm-as -o - %s | llc -march=cellspu > %t1.s
-; RUN: grep fsmbi %t1.s | count 3
-; RUN: grep 32768 %t1.s | count 2
-; RUN: grep xor %t1.s | count 4
-; RUN: grep and %t1.s | count 5
-; RUN: grep andbi %t1.s | count 3
-target datalayout = "E-p:32:32:128-f64:64:128-f32:32:128-i64:32:128-i32:32:128-i16:16:128-i8:8:128-i1:8:128-a0:0:128-v128:128:128-s0:128:128"
-target triple = "spu"
-
-define double @fneg_dp(double %X) {
- %Y = sub double -0.000000e+00, %X
- ret double %Y
-}
-
-define <2 x double> @fneg_dp_vec(<2 x double> %X) {
- %Y = sub <2 x double> < double -0.0000e+00, double -0.0000e+00 >, %X
- ret <2 x double> %Y
-}
-
-define float @fneg_sp(float %X) {
- %Y = sub float -0.000000e+00, %X
- ret float %Y
-}
-
-define <4 x float> @fneg_sp_vec(<4 x float> %X) {
- %Y = sub <4 x float> <float -0.000000e+00, float -0.000000e+00,
- float -0.000000e+00, float -0.000000e+00>, %X
- ret <4 x float> %Y
-}
-
-declare double @fabs(double)
-
-declare float @fabsf(float)
-
-define double @fabs_dp(double %X) {
- %Y = call double @fabs( double %X ) ; <double> [#uses=1]
- ret double %Y
-}
-
-define float @fabs_sp(float %X) {
- %Y = call float @fabsf( float %X ) ; <float> [#uses=1]
- ret float %Y
-}
diff --git a/release_23/test/CodeGen/CellSPU/icmp16.ll b/release_23/test/CodeGen/CellSPU/icmp16.ll
deleted file mode 100644
index bace03105411..000000000000
--- a/release_23/test/CodeGen/CellSPU/icmp16.ll
+++ /dev/null
@@ -1,350 +0,0 @@
-; RUN: llvm-as -o - %s | llc -march=cellspu > %t1.s
-; RUN: grep ilh %t1.s | count 5
-; RUN: grep ceqh %t1.s | count 29
-; RUN: grep ceqhi %t1.s | count 13
-; RUN: grep clgth %t1.s | count 15
-; RUN: grep cgth %t1.s | count 14
-; RUN: grep cgthi %t1.s | count 6
-; RUN: grep {selb\t\\\$3, \\\$6, \\\$5, \\\$3} %t1.s | count 7
-; RUN: grep {selb\t\\\$3, \\\$5, \\\$6, \\\$3} %t1.s | count 3
-; RUN: grep {selb\t\\\$3, \\\$5, \\\$4, \\\$3} %t1.s | count 17
-; RUN: grep {selb\t\\\$3, \\\$4, \\\$5, \\\$3} %t1.s | count 6
-
-target datalayout = "E-p:32:32:128-f64:64:128-f32:32:128-i64:32:128-i32:32:128-i16:16:128-i8:8:128-i1:8:128-a0:0:128-v128:128:128-s0:128:128"
-target triple = "spu"
-
-; $3 = %arg1, $4 = %arg2, $5 = %val1, $6 = %val2
-; $3 = %arg1, $4 = %val1, $5 = %val2
-;
-; For "positive" comparisons:
-; selb $3, $6, $5, <i1>
-; selb $3, $5, $4, <i1>
-;
-; For "negative" comparisons, i.e., those where the result of the comparison
-; must be inverted (setne, for example):
-; selb $3, $5, $6, <i1>
-; selb $3, $4, $5, <i1>
-
-; i16 integer comparisons:
-define i16 @icmp_eq_select_i16(i16 %arg1, i16 %arg2, i16 %val1, i16 %val2) nounwind {
-entry:
- %A = icmp eq i16 %arg1, %arg2
- %B = select i1 %A, i16 %val1, i16 %val2
- ret i16 %B
-}
-
-define i1 @icmp_eq_setcc_i16(i16 %arg1, i16 %arg2, i16 %val1, i16 %val2) nounwind {
-entry:
- %A = icmp eq i16 %arg1, %arg2
- ret i1 %A
-}
-
-define i16 @icmp_eq_immed01_i16(i16 %arg1, i16 %val1, i16 %val2) nounwind {
-entry:
- %A = icmp eq i16 %arg1, 511
- %B = select i1 %A, i16 %val1, i16 %val2
- ret i16 %B
-}
-
-define i16 @icmp_eq_immed02_i16(i16 %arg1, i16 %val1, i16 %val2) nounwind {
-entry:
- %A = icmp eq i16 %arg1, -512
- %B = select i1 %A, i16 %val1, i16 %val2
- ret i16 %B
-}
-
-define i16 @icmp_eq_immed03_i16(i16 %arg1, i16 %val1, i16 %val2) nounwind {
-entry:
- %A = icmp eq i16 %arg1, -1
- %B = select i1 %A, i16 %val1, i16 %val2
- ret i16 %B
-}
-
-define i16 @icmp_eq_immed04_i16(i16 %arg1, i16 %val1, i16 %val2) nounwind {
-entry:
- %A = icmp eq i16 %arg1, 32768
- %B = select i1 %A, i16 %val1, i16 %val2
- ret i16 %B
-}
-
-define i16 @icmp_ne_select_i16(i16 %arg1, i16 %arg2, i16 %val1, i16 %val2) nounwind {
-entry:
- %A = icmp ne i16 %arg1, %arg2
- %B = select i1 %A, i16 %val1, i16 %val2
- ret i16 %B
-}
-
-define i1 @icmp_ne_setcc_i16(i16 %arg1, i16 %arg2, i16 %val1, i16 %val2) nounwind {
-entry:
- %A = icmp ne i16 %arg1, %arg2
- ret i1 %A
-}
-
-define i16 @icmp_ne_immed01_i16(i16 %arg1, i16 %val1, i16 %val2) nounwind {
-entry:
- %A = icmp ne i16 %arg1, 511
- %B = select i1 %A, i16 %val1, i16 %val2
- ret i16 %B
-}
-
-define i16 @icmp_ne_immed02_i16(i16 %arg1, i16 %val1, i16 %val2) nounwind {
-entry:
- %A = icmp ne i16 %arg1, -512
- %B = select i1 %A, i16 %val1, i16 %val2
- ret i16 %B
-}
-
-define i16 @icmp_ne_immed03_i16(i16 %arg1, i16 %val1, i16 %val2) nounwind {
-entry:
- %A = icmp ne i16 %arg1, -1
- %B = select i1 %A, i16 %val1, i16 %val2
- ret i16 %B
-}
-
-define i16 @icmp_ne_immed04_i16(i16 %arg1, i16 %val1, i16 %val2) nounwind {
-entry:
- %A = icmp ne i16 %arg1, 32768
- %B = select i1 %A, i16 %val1, i16 %val2
- ret i16 %B
-}
-
-define i16 @icmp_ugt_select_i16(i16 %arg1, i16 %arg2, i16 %val1, i16 %val2) nounwind {
-entry:
- %A = icmp ugt i16 %arg1, %arg2
- %B = select i1 %A, i16 %val1, i16 %val2
- ret i16 %B
-}
-
-define i1 @icmp_ugt_setcc_i16(i16 %arg1, i16 %arg2, i16 %val1, i16 %val2) nounwind {
-entry:
- %A = icmp ugt i16 %arg1, %arg2
- ret i1 %A
-}
-
-define i16 @icmp_ugt_immed01_i16(i16 %arg1, i16 %val1, i16 %val2) nounwind {
-entry:
- %A = icmp ugt i16 %arg1, 500
- %B = select i1 %A, i16 %val1, i16 %val2
- ret i16 %B
-}
-
-define i16 @icmp_ugt_immed02_i16(i16 %arg1, i16 %val1, i16 %val2) nounwind {
-entry:
- %A = icmp ugt i16 %arg1, 0
- %B = select i1 %A, i16 %val1, i16 %val2
- ret i16 %B
-}
-
-define i16 @icmp_ugt_immed03_i16(i16 %arg1, i16 %val1, i16 %val2) nounwind {
-entry:
- %A = icmp ugt i16 %arg1, 65024
- %B = select i1 %A, i16 %val1, i16 %val2
- ret i16 %B
-}
-
-define i16 @icmp_ugt_immed04_i16(i16 %arg1, i16 %val1, i16 %val2) nounwind {
-entry:
- %A = icmp ugt i16 %arg1, 32768
- %B = select i1 %A, i16 %val1, i16 %val2
- ret i16 %B
-}
-
-define i16 @icmp_uge_select_i16(i16 %arg1, i16 %arg2, i16 %val1, i16 %val2) nounwind {
-entry:
- %A = icmp uge i16 %arg1, %arg2
- %B = select i1 %A, i16 %val1, i16 %val2
- ret i16 %B
-}
-
-define i1 @icmp_uge_setcc_i16(i16 %arg1, i16 %arg2, i16 %val1, i16 %val2) nounwind {
-entry:
- %A = icmp uge i16 %arg1, %arg2
- ret i1 %A
-}
-
-;; Note: icmp uge i16 %arg1, <immed> can always be transformed into
-;; icmp ugt i16 %arg1, <immed>-1
-;;
-;; Consequently, even though the patterns exist to match, it's unlikely
-;; they'll ever be generated.
-
-define i16 @icmp_ult_select_i16(i16 %arg1, i16 %arg2, i16 %val1, i16 %val2) nounwind {
-entry:
- %A = icmp ult i16 %arg1, %arg2
- %B = select i1 %A, i16 %val1, i16 %val2
- ret i16 %B
-}
-
-define i1 @icmp_ult_setcc_i16(i16 %arg1, i16 %arg2, i16 %val1, i16 %val2) nounwind {
-entry:
- %A = icmp ult i16 %arg1, %arg2
- ret i1 %A
-}
-
-define i16 @icmp_ult_immed01_i16(i16 %arg1, i16 %val1, i16 %val2) nounwind {
-entry:
- %A = icmp ult i16 %arg1, 511
- %B = select i1 %A, i16 %val1, i16 %val2
- ret i16 %B
-}
-
-define i16 @icmp_ult_immed02_i16(i16 %arg1, i16 %val1, i16 %val2) nounwind {
-entry:
- %A = icmp ult i16 %arg1, 65534
- %B = select i1 %A, i16 %val1, i16 %val2
- ret i16 %B
-}
-
-define i16 @icmp_ult_immed03_i16(i16 %arg1, i16 %val1, i16 %val2) nounwind {
-entry:
- %A = icmp ult i16 %arg1, 65024
- %B = select i1 %A, i16 %val1, i16 %val2
- ret i16 %B
-}
-
-define i16 @icmp_ult_immed04_i16(i16 %arg1, i16 %val1, i16 %val2) nounwind {
-entry:
- %A = icmp ult i16 %arg1, 32768
- %B = select i1 %A, i16 %val1, i16 %val2
- ret i16 %B
-}
-
-define i16 @icmp_ule_select_i16(i16 %arg1, i16 %arg2, i16 %val1, i16 %val2) nounwind {
-entry:
- %A = icmp ule i16 %arg1, %arg2
- %B = select i1 %A, i16 %val1, i16 %val2
- ret i16 %B
-}
-
-define i1 @icmp_ule_setcc_i16(i16 %arg1, i16 %arg2, i16 %val1, i16 %val2) nounwind {
-entry:
- %A = icmp ule i16 %arg1, %arg2
- ret i1 %A
-}
-
-;; Note: icmp ule i16 %arg1, <immed> can always be transformed into
-;; icmp ult i16 %arg1, <immed>+1
-;;
-;; Consequently, even though the patterns exist to match, it's unlikely
-;; they'll ever be generated.
-
-define i16 @icmp_sgt_select_i16(i16 %arg1, i16 %arg2, i16 %val1, i16 %val2) nounwind {
-entry:
- %A = icmp sgt i16 %arg1, %arg2
- %B = select i1 %A, i16 %val1, i16 %val2
- ret i16 %B
-}
-
-define i1 @icmp_sgt_setcc_i16(i16 %arg1, i16 %arg2, i16 %val1, i16 %val2) nounwind {
-entry:
- %A = icmp sgt i16 %arg1, %arg2
- ret i1 %A
-}
-
-define i16 @icmp_sgt_immed01_i16(i16 %arg1, i16 %val1, i16 %val2) nounwind {
-entry:
- %A = icmp sgt i16 %arg1, 511
- %B = select i1 %A, i16 %val1, i16 %val2
- ret i16 %B
-}
-
-define i16 @icmp_sgt_immed02_i16(i16 %arg1, i16 %val1, i16 %val2) nounwind {
-entry:
- %A = icmp sgt i16 %arg1, -1
- %B = select i1 %A, i16 %val1, i16 %val2
- ret i16 %B
-}
-
-define i16 @icmp_sgt_immed03_i16(i16 %arg1, i16 %val1, i16 %val2) nounwind {
-entry:
- %A = icmp sgt i16 %arg1, -512
- %B = select i1 %A, i16 %val1, i16 %val2
- ret i16 %B
-}
-
-define i16 @icmp_sgt_immed04_i16(i16 %arg1, i16 %val1, i16 %val2) nounwind {
-entry:
- %A = icmp sgt i16 %arg1, 32768
- %B = select i1 %A, i16 %val1, i16 %val2
- ret i16 %B
-}
-
-define i16 @icmp_sge_select_i16(i16 %arg1, i16 %arg2, i16 %val1, i16 %val2) nounwind {
-entry:
- %A = icmp sge i16 %arg1, %arg2
- %B = select i1 %A, i16 %val1, i16 %val2
- ret i16 %B
-}
-
-define i1 @icmp_sge_setcc_i16(i16 %arg1, i16 %arg2, i16 %val1, i16 %val2) nounwind {
-entry:
- %A = icmp sge i16 %arg1, %arg2
- ret i1 %A
-}
-
-;; Note: icmp sge i16 %arg1, <immed> can always be transformed into
-;; icmp sgt i16 %arg1, <immed>-1
-;;
-;; Consequently, even though the patterns exist to match, it's unlikely
-;; they'll ever be generated.
-
-define i16 @icmp_slt_select_i16(i16 %arg1, i16 %arg2, i16 %val1, i16 %val2) nounwind {
-entry:
- %A = icmp slt i16 %arg1, %arg2
- %B = select i1 %A, i16 %val1, i16 %val2
- ret i16 %B
-}
-
-define i1 @icmp_slt_setcc_i16(i16 %arg1, i16 %arg2, i16 %val1, i16 %val2) nounwind {
-entry:
- %A = icmp slt i16 %arg1, %arg2
- ret i1 %A
-}
-
-define i16 @icmp_slt_immed01_i16(i16 %arg1, i16 %val1, i16 %val2) nounwind {
-entry:
- %A = icmp slt i16 %arg1, 511
- %B = select i1 %A, i16 %val1, i16 %val2
- ret i16 %B
-}
-
-define i16 @icmp_slt_immed02_i16(i16 %arg1, i16 %val1, i16 %val2) nounwind {
-entry:
- %A = icmp slt i16 %arg1, -512
- %B = select i1 %A, i16 %val1, i16 %val2
- ret i16 %B
-}
-
-define i16 @icmp_slt_immed03_i16(i16 %arg1, i16 %val1, i16 %val2) nounwind {
-entry:
- %A = icmp slt i16 %arg1, -1
- %B = select i1 %A, i16 %val1, i16 %val2
- ret i16 %B
-}
-
-define i16 @icmp_slt_immed04_i16(i16 %arg1, i16 %val1, i16 %val2) nounwind {
-entry:
- %A = icmp slt i16 %arg1, 32768
- %B = select i1 %A, i16 %val1, i16 %val2
- ret i16 %B
-}
-
-define i16 @icmp_sle_select_i16(i16 %arg1, i16 %arg2, i16 %val1, i16 %val2) nounwind {
-entry:
- %A = icmp sle i16 %arg1, %arg2
- %B = select i1 %A, i16 %val1, i16 %val2
- ret i16 %B
-}
-
-define i1 @icmp_sle_setcc_i16(i16 %arg1, i16 %arg2, i16 %val1, i16 %val2) nounwind {
-entry:
- %A = icmp sle i16 %arg1, %arg2
- ret i1 %A
-}
-
-;; Note: icmp sle i16 %arg1, <immed> can always be transformed into
-;; icmp slt i16 %arg1, <immed>+1
-;;
-;; Consequently, even though the patterns exist to match, it's unlikely
-;; they'll ever be generated.
-
diff --git a/release_23/test/CodeGen/CellSPU/icmp32.ll b/release_23/test/CodeGen/CellSPU/icmp32.ll
deleted file mode 100644
index 4f74b0dd0429..000000000000
--- a/release_23/test/CodeGen/CellSPU/icmp32.ll
+++ /dev/null
@@ -1,350 +0,0 @@
-; RUN: llvm-as -o - %s | llc -march=cellspu > %t1.s
-; RUN: grep ila %t1.s | count 6
-; RUN: grep ceq %t1.s | count 28
-; RUN: grep ceqi %t1.s | count 12
-; RUN: grep clgt %t1.s | count 16
-; RUN: grep clgti %t1.s | count 6
-; RUN: grep cgt %t1.s | count 16
-; RUN: grep cgti %t1.s | count 6
-; RUN: grep {selb\t\\\$3, \\\$6, \\\$5, \\\$3} %t1.s | count 7
-; RUN: grep {selb\t\\\$3, \\\$5, \\\$6, \\\$3} %t1.s | count 3
-; RUN: grep {selb\t\\\$3, \\\$5, \\\$4, \\\$3} %t1.s | count 20
-
-target datalayout = "E-p:32:32:128-f64:64:128-f32:32:128-i64:32:128-i32:32:128-i16:16:128-i8:8:128-i1:8:128-a0:0:128-v128:128:128-s0:128:128"
-target triple = "spu"
-
-; $3 = %arg1, $4 = %arg2, $5 = %val1, $6 = %val2
-; $3 = %arg1, $4 = %val1, $5 = %val2
-;
-; For "positive" comparisons:
-; selb $3, $6, $5, <i1>
-; selb $3, $5, $4, <i1>
-;
-; For "negative" comparisons, i.e., those where the result of the comparison
-; must be inverted (setne, for example):
-; selb $3, $5, $6, <i1>
-; selb $3, $4, $5, <i1>
-
-; i32 integer comparisons:
-define i32 @icmp_eq_select_i32(i32 %arg1, i32 %arg2, i32 %val1, i32 %val2) nounwind {
-entry:
- %A = icmp eq i32 %arg1, %arg2
- %B = select i1 %A, i32 %val1, i32 %val2
- ret i32 %B
-}
-
-define i1 @icmp_eq_setcc_i32(i32 %arg1, i32 %arg2, i32 %val1, i32 %val2) nounwind {
-entry:
- %A = icmp eq i32 %arg1, %arg2
- ret i1 %A
-}
-
-define i32 @icmp_eq_immed01_i32(i32 %arg1, i32 %val1, i32 %val2) nounwind {
-entry:
- %A = icmp eq i32 %arg1, 511
- %B = select i1 %A, i32 %val1, i32 %val2
- ret i32 %B
-}
-
-define i32 @icmp_eq_immed02_i32(i32 %arg1, i32 %val1, i32 %val2) nounwind {
-entry:
- %A = icmp eq i32 %arg1, -512
- %B = select i1 %A, i32 %val1, i32 %val2
- ret i32 %B
-}
-
-define i32 @icmp_eq_immed03_i32(i32 %arg1, i32 %val1, i32 %val2) nounwind {
-entry:
- %A = icmp eq i32 %arg1, -1
- %B = select i1 %A, i32 %val1, i32 %val2
- ret i32 %B
-}
-
-define i32 @icmp_eq_immed04_i32(i32 %arg1, i32 %val1, i32 %val2) nounwind {
-entry:
- %A = icmp eq i32 %arg1, 32768
- %B = select i1 %A, i32 %val1, i32 %val2
- ret i32 %B
-}
-
-define i32 @icmp_ne_select_i32(i32 %arg1, i32 %arg2, i32 %val1, i32 %val2) nounwind {
-entry:
- %A = icmp ne i32 %arg1, %arg2
- %B = select i1 %A, i32 %val1, i32 %val2
- ret i32 %B
-}
-
-define i1 @icmp_ne_setcc_i32(i32 %arg1, i32 %arg2, i32 %val1, i32 %val2) nounwind {
-entry:
- %A = icmp ne i32 %arg1, %arg2
- ret i1 %A
-}
-
-define i32 @icmp_ne_immed01_i32(i32 %arg1, i32 %val1, i32 %val2) nounwind {
-entry:
- %A = icmp ne i32 %arg1, 511
- %B = select i1 %A, i32 %val1, i32 %val2
- ret i32 %B
-}
-
-define i32 @icmp_ne_immed02_i32(i32 %arg1, i32 %val1, i32 %val2) nounwind {
-entry:
- %A = icmp ne i32 %arg1, -512
- %B = select i1 %A, i32 %val1, i32 %val2
- ret i32 %B
-}
-
-define i32 @icmp_ne_immed03_i32(i32 %arg1, i32 %val1, i32 %val2) nounwind {
-entry:
- %A = icmp ne i32 %arg1, -1
- %B = select i1 %A, i32 %val1, i32 %val2
- ret i32 %B
-}
-
-define i32 @icmp_ne_immed04_i32(i32 %arg1, i32 %val1, i32 %val2) nounwind {
-entry:
- %A = icmp ne i32 %arg1, 32768
- %B = select i1 %A, i32 %val1, i32 %val2
- ret i32 %B
-}
-
-define i32 @icmp_ugt_select_i32(i32 %arg1, i32 %arg2, i32 %val1, i32 %val2) nounwind {
-entry:
- %A = icmp ugt i32 %arg1, %arg2
- %B = select i1 %A, i32 %val1, i32 %val2
- ret i32 %B
-}
-
-define i1 @icmp_ugt_setcc_i32(i32 %arg1, i32 %arg2, i32 %val1, i32 %val2) nounwind {
-entry:
- %A = icmp ugt i32 %arg1, %arg2
- ret i1 %A
-}
-
-define i32 @icmp_ugt_immed01_i32(i32 %arg1, i32 %val1, i32 %val2) nounwind {
-entry:
- %A = icmp ugt i32 %arg1, 511
- %B = select i1 %A, i32 %val1, i32 %val2
- ret i32 %B
-}
-
-define i32 @icmp_ugt_immed02_i32(i32 %arg1, i32 %val1, i32 %val2) nounwind {
-entry:
- %A = icmp ugt i32 %arg1, 4294966784
- %B = select i1 %A, i32 %val1, i32 %val2
- ret i32 %B
-}
-
-define i32 @icmp_ugt_immed03_i32(i32 %arg1, i32 %val1, i32 %val2) nounwind {
-entry:
- %A = icmp ugt i32 %arg1, 4294967293
- %B = select i1 %A, i32 %val1, i32 %val2
- ret i32 %B
-}
-
-define i32 @icmp_ugt_immed04_i32(i32 %arg1, i32 %val1, i32 %val2) nounwind {
-entry:
- %A = icmp ugt i32 %arg1, 32768
- %B = select i1 %A, i32 %val1, i32 %val2
- ret i32 %B
-}
-
-define i32 @icmp_uge_select_i32(i32 %arg1, i32 %arg2, i32 %val1, i32 %val2) nounwind {
-entry:
- %A = icmp uge i32 %arg1, %arg2
- %B = select i1 %A, i32 %val1, i32 %val2
- ret i32 %B
-}
-
-define i1 @icmp_uge_setcc_i32(i32 %arg1, i32 %arg2, i32 %val1, i32 %val2) nounwind {
-entry:
- %A = icmp uge i32 %arg1, %arg2
- ret i1 %A
-}
-
-;; Note: icmp uge i32 %arg1, <immed> can always be transformed into
-;; icmp ugt i32 %arg1, <immed>-1
-;;
-;; Consequently, even though the patterns exist to match, it's unlikely
-;; they'll ever be generated.
-
-define i32 @icmp_ult_select_i32(i32 %arg1, i32 %arg2, i32 %val1, i32 %val2) nounwind {
-entry:
- %A = icmp ult i32 %arg1, %arg2
- %B = select i1 %A, i32 %val1, i32 %val2
- ret i32 %B
-}
-
-define i1 @icmp_ult_setcc_i32(i32 %arg1, i32 %arg2, i32 %val1, i32 %val2) nounwind {
-entry:
- %A = icmp ult i32 %arg1, %arg2
- ret i1 %A
-}
-
-define i32 @icmp_ult_immed01_i32(i32 %arg1, i32 %val1, i32 %val2) nounwind {
-entry:
- %A = icmp ult i32 %arg1, 511
- %B = select i1 %A, i32 %val1, i32 %val2
- ret i32 %B
-}
-
-define i32 @icmp_ult_immed02_i32(i32 %arg1, i32 %val1, i32 %val2) nounwind {
-entry:
- %A = icmp ult i32 %arg1, 4294966784
- %B = select i1 %A, i32 %val1, i32 %val2
- ret i32 %B
-}
-
-define i32 @icmp_ult_immed03_i32(i32 %arg1, i32 %val1, i32 %val2) nounwind {
-entry:
- %A = icmp ult i32 %arg1, 4294967293
- %B = select i1 %A, i32 %val1, i32 %val2
- ret i32 %B
-}
-
-define i32 @icmp_ult_immed04_i32(i32 %arg1, i32 %val1, i32 %val2) nounwind {
-entry:
- %A = icmp ult i32 %arg1, 32768
- %B = select i1 %A, i32 %val1, i32 %val2
- ret i32 %B
-}
-
-define i32 @icmp_ule_select_i32(i32 %arg1, i32 %arg2, i32 %val1, i32 %val2) nounwind {
-entry:
- %A = icmp ule i32 %arg1, %arg2
- %B = select i1 %A, i32 %val1, i32 %val2
- ret i32 %B
-}
-
-define i1 @icmp_ule_setcc_i32(i32 %arg1, i32 %arg2, i32 %val1, i32 %val2) nounwind {
-entry:
- %A = icmp ule i32 %arg1, %arg2
- ret i1 %A
-}
-
-;; Note: icmp ule i32 %arg1, <immed> can always be transformed into
-;; icmp ult i32 %arg1, <immed>+1
-;;
-;; Consequently, even though the patterns exist to match, it's unlikely
-;; they'll ever be generated.
-
-define i32 @icmp_sgt_select_i32(i32 %arg1, i32 %arg2, i32 %val1, i32 %val2) nounwind {
-entry:
- %A = icmp sgt i32 %arg1, %arg2
- %B = select i1 %A, i32 %val1, i32 %val2
- ret i32 %B
-}
-
-define i1 @icmp_sgt_setcc_i32(i32 %arg1, i32 %arg2, i32 %val1, i32 %val2) nounwind {
-entry:
- %A = icmp sgt i32 %arg1, %arg2
- ret i1 %A
-}
-
-define i32 @icmp_sgt_immed01_i32(i32 %arg1, i32 %val1, i32 %val2) nounwind {
-entry:
- %A = icmp sgt i32 %arg1, 511
- %B = select i1 %A, i32 %val1, i32 %val2
- ret i32 %B
-}
-
-define i32 @icmp_sgt_immed02_i32(i32 %arg1, i32 %val1, i32 %val2) nounwind {
-entry:
- %A = icmp sgt i32 %arg1, 4294966784
- %B = select i1 %A, i32 %val1, i32 %val2
- ret i32 %B
-}
-
-define i32 @icmp_sgt_immed03_i32(i32 %arg1, i32 %val1, i32 %val2) nounwind {
-entry:
- %A = icmp sgt i32 %arg1, 4294967293
- %B = select i1 %A, i32 %val1, i32 %val2
- ret i32 %B
-}
-
-define i32 @icmp_sgt_immed04_i32(i32 %arg1, i32 %val1, i32 %val2) nounwind {
-entry:
- %A = icmp sgt i32 %arg1, 32768
- %B = select i1 %A, i32 %val1, i32 %val2
- ret i32 %B
-}
-
-define i32 @icmp_sge_select_i32(i32 %arg1, i32 %arg2, i32 %val1, i32 %val2) nounwind {
-entry:
- %A = icmp sge i32 %arg1, %arg2
- %B = select i1 %A, i32 %val1, i32 %val2
- ret i32 %B
-}
-
-define i1 @icmp_sge_setcc_i32(i32 %arg1, i32 %arg2, i32 %val1, i32 %val2) nounwind {
-entry:
- %A = icmp sge i32 %arg1, %arg2
- ret i1 %A
-}
-
-;; Note: icmp sge i32 %arg1, <immed> can always be transformed into
-;; icmp sgt i32 %arg1, <immed>-1
-;;
-;; Consequently, even though the patterns exist to match, it's unlikely
-;; they'll ever be generated.
-
-define i32 @icmp_slt_select_i32(i32 %arg1, i32 %arg2, i32 %val1, i32 %val2) nounwind {
-entry:
- %A = icmp slt i32 %arg1, %arg2
- %B = select i1 %A, i32 %val1, i32 %val2
- ret i32 %B
-}
-
-define i1 @icmp_slt_setcc_i32(i32 %arg1, i32 %arg2, i32 %val1, i32 %val2) nounwind {
-entry:
- %A = icmp slt i32 %arg1, %arg2
- ret i1 %A
-}
-
-define i32 @icmp_slt_immed01_i32(i32 %arg1, i32 %val1, i32 %val2) nounwind {
-entry:
- %A = icmp slt i32 %arg1, 511
- %B = select i1 %A, i32 %val1, i32 %val2
- ret i32 %B
-}
-
-define i32 @icmp_slt_immed02_i32(i32 %arg1, i32 %val1, i32 %val2) nounwind {
-entry:
- %A = icmp slt i32 %arg1, -512
- %B = select i1 %A, i32 %val1, i32 %val2
- ret i32 %B
-}
-
-define i32 @icmp_slt_immed03_i32(i32 %arg1, i32 %val1, i32 %val2) nounwind {
-entry:
- %A = icmp slt i32 %arg1, -1
- %B = select i1 %A, i32 %val1, i32 %val2
- ret i32 %B
-}
-
-define i32 @icmp_slt_immed04_i32(i32 %arg1, i32 %val1, i32 %val2) nounwind {
-entry:
- %A = icmp slt i32 %arg1, 32768
- %B = select i1 %A, i32 %val1, i32 %val2
- ret i32 %B
-}
-
-define i32 @icmp_sle_select_i32(i32 %arg1, i32 %arg2, i32 %val1, i32 %val2) nounwind {
-entry:
- %A = icmp sle i32 %arg1, %arg2
- %B = select i1 %A, i32 %val1, i32 %val2
- ret i32 %B
-}
-
-define i1 @icmp_sle_setcc_i32(i32 %arg1, i32 %arg2, i32 %val1, i32 %val2) nounwind {
-entry:
- %A = icmp sle i32 %arg1, %arg2
- ret i1 %A
-}
-
-;; Note: icmp sle i32 %arg1, <immed> can always be transformed into
-;; icmp slt i32 %arg1, <immed>+1
-;;
-;; Consequently, even though the patterns exist to match, it's unlikely
-;; they'll ever be generated.
-
diff --git a/release_23/test/CodeGen/CellSPU/icmp8.ll b/release_23/test/CodeGen/CellSPU/icmp8.ll
deleted file mode 100644
index d246481f03a1..000000000000
--- a/release_23/test/CodeGen/CellSPU/icmp8.ll
+++ /dev/null
@@ -1,286 +0,0 @@
-; RUN: llvm-as -o - %s | llc -march=cellspu > %t1.s
-; RUN: grep ceqb %t1.s | count 24
-; RUN: grep ceqbi %t1.s | count 12
-; RUN: grep clgtb %t1.s | count 11
-; RUN: grep cgtb %t1.s | count 13
-; RUN: grep cgtbi %t1.s | count 5
-; RUN: grep {selb\t\\\$3, \\\$6, \\\$5, \\\$3} %t1.s | count 7
-; RUN: grep {selb\t\\\$3, \\\$5, \\\$6, \\\$3} %t1.s | count 3
-; RUN: grep {selb\t\\\$3, \\\$5, \\\$4, \\\$3} %t1.s | count 11
-; RUN: grep {selb\t\\\$3, \\\$4, \\\$5, \\\$3} %t1.s | count 4
-
-target datalayout = "E-p:32:32:128-f64:64:128-f32:32:128-i64:32:128-i32:32:128-i16:16:128-i8:8:128-i1:8:128-a0:0:128-v128:128:128-s0:128:128"
-target triple = "spu"
-
-; $3 = %arg1, $4 = %arg2, $5 = %val1, $6 = %val2
-; $3 = %arg1, $4 = %val1, $5 = %val2
-;
-; For "positive" comparisons:
-; selb $3, $6, $5, <i1>
-; selb $3, $5, $4, <i1>
-;
-; For "negative" comparisons, i.e., those where the result of the comparison
-; must be inverted (setne, for example):
-; selb $3, $5, $6, <i1>
-; selb $3, $4, $5, <i1>
-
-; i8 integer comparisons:
-define i8 @icmp_eq_select_i8(i8 %arg1, i8 %arg2, i8 %val1, i8 %val2) nounwind {
-entry:
- %A = icmp eq i8 %arg1, %arg2
- %B = select i1 %A, i8 %val1, i8 %val2
- ret i8 %B
-}
-
-define i1 @icmp_eq_setcc_i8(i8 %arg1, i8 %arg2, i8 %val1, i8 %val2) nounwind {
-entry:
- %A = icmp eq i8 %arg1, %arg2
- ret i1 %A
-}
-
-define i8 @icmp_eq_immed01_i8(i8 %arg1, i8 %val1, i8 %val2) nounwind {
-entry:
- %A = icmp eq i8 %arg1, 127
- %B = select i1 %A, i8 %val1, i8 %val2
- ret i8 %B
-}
-
-define i8 @icmp_eq_immed02_i8(i8 %arg1, i8 %val1, i8 %val2) nounwind {
-entry:
- %A = icmp eq i8 %arg1, -128
- %B = select i1 %A, i8 %val1, i8 %val2
- ret i8 %B
-}
-
-define i8 @icmp_eq_immed03_i8(i8 %arg1, i8 %val1, i8 %val2) nounwind {
-entry:
- %A = icmp eq i8 %arg1, -1
- %B = select i1 %A, i8 %val1, i8 %val2
- ret i8 %B
-}
-
-define i8 @icmp_ne_select_i8(i8 %arg1, i8 %arg2, i8 %val1, i8 %val2) nounwind {
-entry:
- %A = icmp ne i8 %arg1, %arg2
- %B = select i1 %A, i8 %val1, i8 %val2
- ret i8 %B
-}
-
-define i1 @icmp_ne_setcc_i8(i8 %arg1, i8 %arg2, i8 %val1, i8 %val2) nounwind {
-entry:
- %A = icmp ne i8 %arg1, %arg2
- ret i1 %A
-}
-
-define i8 @icmp_ne_immed01_i8(i8 %arg1, i8 %val1, i8 %val2) nounwind {
-entry:
- %A = icmp ne i8 %arg1, 127
- %B = select i1 %A, i8 %val1, i8 %val2
- ret i8 %B
-}
-
-define i8 @icmp_ne_immed02_i8(i8 %arg1, i8 %val1, i8 %val2) nounwind {
-entry:
- %A = icmp ne i8 %arg1, -128
- %B = select i1 %A, i8 %val1, i8 %val2
- ret i8 %B
-}
-
-define i8 @icmp_ne_immed03_i8(i8 %arg1, i8 %val1, i8 %val2) nounwind {
-entry:
- %A = icmp ne i8 %arg1, -1
- %B = select i1 %A, i8 %val1, i8 %val2
- ret i8 %B
-}
-
-define i8 @icmp_ugt_select_i8(i8 %arg1, i8 %arg2, i8 %val1, i8 %val2) nounwind {
-entry:
- %A = icmp ugt i8 %arg1, %arg2
- %B = select i1 %A, i8 %val1, i8 %val2
- ret i8 %B
-}
-
-define i1 @icmp_ugt_setcc_i8(i8 %arg1, i8 %arg2, i8 %val1, i8 %val2) nounwind {
-entry:
- %A = icmp ugt i8 %arg1, %arg2
- ret i1 %A
-}
-
-define i8 @icmp_ugt_immed01_i8(i8 %arg1, i8 %val1, i8 %val2) nounwind {
-entry:
- %A = icmp ugt i8 %arg1, 126
- %B = select i1 %A, i8 %val1, i8 %val2
- ret i8 %B
-}
-
-define i8 @icmp_uge_select_i8(i8 %arg1, i8 %arg2, i8 %val1, i8 %val2) nounwind {
-entry:
- %A = icmp uge i8 %arg1, %arg2
- %B = select i1 %A, i8 %val1, i8 %val2
- ret i8 %B
-}
-
-define i1 @icmp_uge_setcc_i8(i8 %arg1, i8 %arg2, i8 %val1, i8 %val2) nounwind {
-entry:
- %A = icmp uge i8 %arg1, %arg2
- ret i1 %A
-}
-
-;; Note: icmp uge i8 %arg1, <immed> can always be transformed into
-;; icmp ugt i8 %arg1, <immed>-1
-;;
-;; Consequently, even though the patterns exist to match, it's unlikely
-;; they'll ever be generated.
-
-define i8 @icmp_ult_select_i8(i8 %arg1, i8 %arg2, i8 %val1, i8 %val2) nounwind {
-entry:
- %A = icmp ult i8 %arg1, %arg2
- %B = select i1 %A, i8 %val1, i8 %val2
- ret i8 %B
-}
-
-define i1 @icmp_ult_setcc_i8(i8 %arg1, i8 %arg2, i8 %val1, i8 %val2) nounwind {
-entry:
- %A = icmp ult i8 %arg1, %arg2
- ret i1 %A
-}
-
-define i8 @icmp_ult_immed01_i8(i8 %arg1, i8 %val1, i8 %val2) nounwind {
-entry:
- %A = icmp ult i8 %arg1, 253
- %B = select i1 %A, i8 %val1, i8 %val2
- ret i8 %B
-}
-
-define i8 @icmp_ult_immed02_i8(i8 %arg1, i8 %val1, i8 %val2) nounwind {
-entry:
- %A = icmp ult i8 %arg1, 129
- %B = select i1 %A, i8 %val1, i8 %val2
- ret i8 %B
-}
-
-define i8 @icmp_ule_select_i8(i8 %arg1, i8 %arg2, i8 %val1, i8 %val2) nounwind {
-entry:
- %A = icmp ule i8 %arg1, %arg2
- %B = select i1 %A, i8 %val1, i8 %val2
- ret i8 %B
-}
-
-define i1 @icmp_ule_setcc_i8(i8 %arg1, i8 %arg2, i8 %val1, i8 %val2) nounwind {
-entry:
- %A = icmp ule i8 %arg1, %arg2
- ret i1 %A
-}
-
-;; Note: icmp ule i8 %arg1, <immed> can always be transformed into
-;; icmp ult i8 %arg1, <immed>+1
-;;
-;; Consequently, even though the patterns exist to match, it's unlikely
-;; they'll ever be generated.
-
-define i8 @icmp_sgt_select_i8(i8 %arg1, i8 %arg2, i8 %val1, i8 %val2) nounwind {
-entry:
- %A = icmp sgt i8 %arg1, %arg2
- %B = select i1 %A, i8 %val1, i8 %val2
- ret i8 %B
-}
-
-define i1 @icmp_sgt_setcc_i8(i8 %arg1, i8 %arg2, i8 %val1, i8 %val2) nounwind {
-entry:
- %A = icmp sgt i8 %arg1, %arg2
- ret i1 %A
-}
-
-define i8 @icmp_sgt_immed01_i8(i8 %arg1, i8 %val1, i8 %val2) nounwind {
-entry:
- %A = icmp sgt i8 %arg1, 96
- %B = select i1 %A, i8 %val1, i8 %val2
- ret i8 %B
-}
-
-define i8 @icmp_sgt_immed02_i8(i8 %arg1, i8 %val1, i8 %val2) nounwind {
-entry:
- %A = icmp sgt i8 %arg1, -1
- %B = select i1 %A, i8 %val1, i8 %val2
- ret i8 %B
-}
-
-define i8 @icmp_sgt_immed03_i8(i8 %arg1, i8 %val1, i8 %val2) nounwind {
-entry:
- %A = icmp sgt i8 %arg1, -128
- %B = select i1 %A, i8 %val1, i8 %val2
- ret i8 %B
-}
-
-define i8 @icmp_sge_select_i8(i8 %arg1, i8 %arg2, i8 %val1, i8 %val2) nounwind {
-entry:
- %A = icmp sge i8 %arg1, %arg2
- %B = select i1 %A, i8 %val1, i8 %val2
- ret i8 %B
-}
-
-define i1 @icmp_sge_setcc_i8(i8 %arg1, i8 %arg2, i8 %val1, i8 %val2) nounwind {
-entry:
- %A = icmp sge i8 %arg1, %arg2
- ret i1 %A
-}
-
-;; Note: icmp sge i8 %arg1, <immed> can always be transformed into
-;; icmp sgt i8 %arg1, <immed>-1
-;;
-;; Consequently, even though the patterns exist to match, it's unlikely
-;; they'll ever be generated.
-
-define i8 @icmp_slt_select_i8(i8 %arg1, i8 %arg2, i8 %val1, i8 %val2) nounwind {
-entry:
- %A = icmp slt i8 %arg1, %arg2
- %B = select i1 %A, i8 %val1, i8 %val2
- ret i8 %B
-}
-
-define i1 @icmp_slt_setcc_i8(i8 %arg1, i8 %arg2, i8 %val1, i8 %val2) nounwind {
-entry:
- %A = icmp slt i8 %arg1, %arg2
- ret i1 %A
-}
-
-define i8 @icmp_slt_immed01_i8(i8 %arg1, i8 %val1, i8 %val2) nounwind {
-entry:
- %A = icmp slt i8 %arg1, 96
- %B = select i1 %A, i8 %val1, i8 %val2
- ret i8 %B
-}
-
-define i8 @icmp_slt_immed02_i8(i8 %arg1, i8 %val1, i8 %val2) nounwind {
-entry:
- %A = icmp slt i8 %arg1, -120
- %B = select i1 %A, i8 %val1, i8 %val2
- ret i8 %B
-}
-
-define i8 @icmp_slt_immed03_i8(i8 %arg1, i8 %val1, i8 %val2) nounwind {
-entry:
- %A = icmp slt i8 %arg1, -1
- %B = select i1 %A, i8 %val1, i8 %val2
- ret i8 %B
-}
-
-define i8 @icmp_sle_select_i8(i8 %arg1, i8 %arg2, i8 %val1, i8 %val2) nounwind {
-entry:
- %A = icmp sle i8 %arg1, %arg2
- %B = select i1 %A, i8 %val1, i8 %val2
- ret i8 %B
-}
-
-define i1 @icmp_sle_setcc_i8(i8 %arg1, i8 %arg2, i8 %val1, i8 %val2) nounwind {
-entry:
- %A = icmp sle i8 %arg1, %arg2
- ret i1 %A
-}
-
-;; Note: icmp sle i8 %arg1, <immed> can always be transformed into
-;; icmp slt i8 %arg1, <immed>+1
-;;
-;; Consequently, even though the patterns exist to match, it's unlikely
-;; they'll ever be generated.
-
diff --git a/release_23/test/CodeGen/CellSPU/immed16.ll b/release_23/test/CodeGen/CellSPU/immed16.ll
deleted file mode 100644
index 684305bd0c97..000000000000
--- a/release_23/test/CodeGen/CellSPU/immed16.ll
+++ /dev/null
@@ -1,40 +0,0 @@
-; RUN: llvm-as -o - %s | llc -march=cellspu > %t1.s
-; RUN: grep "ilh" %t1.s | count 5
-target datalayout = "E-p:32:32:128-f64:64:128-f32:32:128-i64:32:128-i32:32:128-i16:16:128-i8:8:128-i1:8:128-a0:0:128-v128:128:128-s0:128:128"
-target triple = "spu"
-
-define i16 @test_1() {
- %x = alloca i16, align 16
- store i16 419, i16* %x ;; ILH via pattern
- ret i16 0
-}
-
-define i16 @test_2() {
- %x = alloca i16, align 16
- store i16 1023, i16* %x ;; ILH via pattern
- ret i16 0
-}
-
-define i16 @test_3() {
- %x = alloca i16, align 16
- store i16 -1023, i16* %x ;; ILH via pattern
- ret i16 0
-}
-
-define i16 @test_4() {
- %x = alloca i16, align 16
- store i16 32767, i16* %x ;; ILH via pattern
- ret i16 0
-}
-
-define i16 @test_5() {
- %x = alloca i16, align 16
- store i16 -32768, i16* %x ;; ILH via pattern
- ret i16 0
-}
-
-define i16 @test_6() {
- ret i16 0
-}
-
-
diff --git a/release_23/test/CodeGen/CellSPU/immed32.ll b/release_23/test/CodeGen/CellSPU/immed32.ll
deleted file mode 100644
index 2cadfff9dca0..000000000000
--- a/release_23/test/CodeGen/CellSPU/immed32.ll
+++ /dev/null
@@ -1,72 +0,0 @@
-; RUN: llvm-as -o - %s | llc -march=cellspu > %t1.s
-; RUN: grep ilhu %t1.s | count 8
-; RUN: grep iohl %t1.s | count 6
-; RUN: grep il %t1.s | count 11
-; RUN: grep 16429 %t1.s | count 1
-; RUN: grep 63572 %t1.s | count 1
-; RUN: grep 128 %t1.s | count 1
-; RUN: grep 32639 %t1.s | count 1
-; RUN: grep 65535 %t1.s | count 1
-; RUN: grep 16457 %t1.s | count 1
-; RUN: grep 4059 %t1.s | count 1
-; RUN: grep 49077 %t1.s | count 1
-; RUN: grep 1267 %t1.s | count 2
-; RUN: grep 16309 %t1.s | count 1
-target datalayout = "E-p:32:32:128-f64:64:128-f32:32:128-i64:32:128-i32:32:128-i16:16:128-i8:8:128-i1:8:128-a0:0:128-v128:128:128-s0:128:128"
-target triple = "spu"
-
-define i32 @test_1() {
- ret i32 4784128 ;; ILHU via pattern (0x49000)
-}
-
-define i32 @test_2() {
- ret i32 5308431 ;; ILHU/IOHL via pattern (0x5100f)
-}
-
-define i32 @test_3() {
- ret i32 511 ;; IL via pattern
-}
-
-define i32 @test_4() {
- ret i32 -512 ;; IL via pattern
-}
-
-;; double float floatval
-;; 0x4005bf0a80000000 0x402d|f854 2.718282
-define float @float_const_1() {
- ret float 0x4005BF0A80000000 ;; ILHU/IOHL
-}
-
-;; double float floatval
-;; 0x3810000000000000 0x0080|0000 0.000000
-define float @float_const_2() {
- ret float 0x3810000000000000 ;; IL 128
-}
-
-;; double float floatval
-;; 0x47efffffe0000000 0x7f7f|ffff NaN
-define float @float_const_3() {
- ret float 0x47EFFFFFE0000000 ;; ILHU/IOHL via pattern
-}
-
-;; double float floatval
-;; 0x400921fb60000000 0x4049|0fdb 3.141593
-define float @float_const_4() {
- ret float 0x400921FB60000000 ;; ILHU/IOHL via pattern
-}
-
-;; double float floatval
-;; 0xbff6a09e60000000 0xbfb5|04f3 -1.414214
-define float @float_const_5() {
- ret float 0xBFF6A09E60000000 ;; ILHU/IOHL via pattern
-}
-
-;; double float floatval
-;; 0x3ff6a09e60000000 0x3fb5|04f3 1.414214
-define float @float_const_6() {
- ret float 0x3FF6A09E60000000 ;; ILHU/IOHL via pattern
-}
-
-define float @float_const_7() {
- ret float 0.000000e+00 ;; IL 0 via pattern
-}
diff --git a/release_23/test/CodeGen/CellSPU/immed64.ll b/release_23/test/CodeGen/CellSPU/immed64.ll
deleted file mode 100644
index 7ef3d766bb51..000000000000
--- a/release_23/test/CodeGen/CellSPU/immed64.ll
+++ /dev/null
@@ -1,93 +0,0 @@
-; RUN: llvm-as -o - %s | llc -march=cellspu > %t1.s
-; RUN: grep lqa %t1.s | count 13
-; RUN: grep il %t1.s | count 22
-; RUN: grep shufb %t1.s | count 13
-; RUN: grep 65520 %t1.s | count 1
-; RUN: grep 43981 %t1.s | count 1
-; RUN: grep 13702 %t1.s | count 1
-; RUN: grep 81 %t1.s | count 2
-; RUN: grep 28225 %t1.s | count 1
-; RUN: grep 30720 %t1.s | count 1
-; RUN: grep 192 %t1.s | count 32
-; RUN: grep 128 %t1.s | count 30
-; RUN: grep 224 %t1.s | count 2
-
-target datalayout = "E-p:32:32:128-f64:64:128-f32:32:128-i64:32:128-i32:32:128-i16:16:128-i8:8:128-i1:8:128-a0:0:128-v128:128:128-s0:128:128"
-target triple = "spu"
-
-; 1311768467750121234 => 0x 12345678 abcdef12 (4660,22136/43981,61202)
-; 18446744073709551591 => 0x ffffffff ffffffe7 (-25)
-; 18446744073708516742 => 0x ffffffff fff03586 (-1034874)
-; 5308431 => 0x 00000000 0051000F
-; 9223372038704560128 => 0x 80000000 6e417800
-
-define i64 @i64_const_1() {
- ret i64 1311768467750121234 ;; Constant pool spill
-}
-
-define i64 @i64_const_2() {
- ret i64 18446744073709551591 ;; IL/SHUFB
-}
-
-define i64 @i64_const_3() {
- ret i64 18446744073708516742 ;; IHLU/IOHL/SHUFB
-}
-
-define i64 @i64_const_4() {
- ret i64 5308431 ;; ILHU/IOHL/SHUFB
-}
-
-define i64 @i64_const_5() {
- ret i64 511 ;; IL/SHUFB
-}
-
-define i64 @i64_const_6() {
- ret i64 -512 ;; IL/SHUFB
-}
-
-define i64 @i64_const_7() {
- ret i64 9223372038704560128 ;; IHLU/IOHL/SHUFB
-}
-
-define i64 @i64_const_8() {
- ret i64 0 ;; IL
-}
-
-define i64 @i64_const_9() {
- ret i64 -1 ;; IL
-}
-
-define i64 @i64_const_10() {
- ret i64 281470681808895 ;; IL 65535
-}
-
-; 0x4005bf0a8b145769 ->
-; (ILHU 0x4005 [16389]/IOHL 0xbf0a [48906])
-; (ILHU 0x8b14 [35604]/IOHL 0x5769 [22377])
-define double @f64_const_1() {
- ret double 0x4005bf0a8b145769 ;; ILHU/IOHL via pattern
-}
-
-define double @f64_const_2() {
- ret double 0x0010000000000000
-}
-
-define double @f64_const_3() {
- ret double 0x7fefffffffffffff
-}
-
-define double @f64_const_4() {
- ret double 0x400921fb54442d18
-}
-
-define double @f64_const_5() {
- ret double 0xbff6a09e667f3bcd ;; ILHU/IOHL via pattern
-}
-
-define double @f64_const_6() {
- ret double 0x3ff6a09e667f3bcd
-}
-
-define double @f64_const_7() {
- ret double 0.000000e+00
-}
diff --git a/release_23/test/CodeGen/CellSPU/int2fp.ll b/release_23/test/CodeGen/CellSPU/int2fp.ll
deleted file mode 100644
index ee3076594ad6..000000000000
--- a/release_23/test/CodeGen/CellSPU/int2fp.ll
+++ /dev/null
@@ -1,41 +0,0 @@
-; RUN: llvm-as -o - %s | llc -march=cellspu > %t1.s
-; RUN: grep csflt %t1.s | count 5
-; RUN: grep cuflt %t1.s | count 1
-; RUN: grep xshw %t1.s | count 2
-; RUN: grep xsbh %t1.s | count 1
-; RUN: grep and %t1.s | count 2
-; RUN: grep andi %t1.s | count 1
-; RUN: grep ila %t1.s | count 1
-
-target datalayout = "E-p:32:32:128-f64:64:128-f32:32:128-i64:32:128-i32:32:128-i16:16:128-i8:8:128-i1:8:128-a0:0:128-v128:128:128-s0:128:128"
-target triple = "spu"
-
-define float @sitofp_i32(i32 %arg1) {
- %A = sitofp i32 %arg1 to float ; <float> [#uses=1]
- ret float %A
-}
-
-define float @uitofp_u32(i32 %arg1) {
- %A = uitofp i32 %arg1 to float ; <float> [#uses=1]
- ret float %A
-}
-
-define float @sitofp_i16(i16 %arg1) {
- %A = sitofp i16 %arg1 to float ; <float> [#uses=1]
- ret float %A
-}
-
-define float @uitofp_i16(i16 %arg1) {
- %A = uitofp i16 %arg1 to float ; <float> [#uses=1]
- ret float %A
-}
-
-define float @sitofp_i8(i8 %arg1) {
- %A = sitofp i8 %arg1 to float ; <float> [#uses=1]
- ret float %A
-}
-
-define float @uitofp_i8(i8 %arg1) {
- %A = uitofp i8 %arg1 to float ; <float> [#uses=1]
- ret float %A
-}
diff --git a/release_23/test/CodeGen/CellSPU/intrinsics_branch.ll b/release_23/test/CodeGen/CellSPU/intrinsics_branch.ll
deleted file mode 100644
index 87ad18211a25..000000000000
--- a/release_23/test/CodeGen/CellSPU/intrinsics_branch.ll
+++ /dev/null
@@ -1,150 +0,0 @@
-; RUN: llvm-as -o - %s | llc -march=cellspu > %t1.s
-; RUN: grep ceq %t1.s | count 30
-; RUN: grep ceqb %t1.s | count 10
-; RUN: grep ceqhi %t1.s | count 5
-; RUN: grep ceqi %t1.s | count 5
-; RUN: grep cgt %t1.s | count 30
-; RUN: grep cgtb %t1.s | count 10
-; RUN: grep cgthi %t1.s | count 5
-; RUN: grep cgti %t1.s | count 5
-target datalayout = "E-p:32:32:128-f64:64:128-f32:32:128-i64:32:128-i32:32:128-i16:16:128-i8:8:128-i1:8:128-a0:0:128-v128:128:128-s0:128:128"
-target triple = "spu"
-
-declare <4 x i32> @llvm.spu.si.shli(<4 x i32>, i8)
-
-declare <4 x i32> @llvm.spu.si.ceq(<4 x i32>, <4 x i32>)
-declare <16 x i8> @llvm.spu.si.ceqb(<16 x i8>, <16 x i8>)
-declare <8 x i16> @llvm.spu.si.ceqh(<8 x i16>, <8 x i16>)
-declare <4 x i32> @llvm.spu.si.ceqi(<4 x i32>, i16)
-declare <8 x i16> @llvm.spu.si.ceqhi(<8 x i16>, i16)
-declare <16 x i8> @llvm.spu.si.ceqbi(<16 x i8>, i8)
-
-declare <4 x i32> @llvm.spu.si.cgt(<4 x i32>, <4 x i32>)
-declare <16 x i8> @llvm.spu.si.cgtb(<16 x i8>, <16 x i8>)
-declare <8 x i16> @llvm.spu.si.cgth(<8 x i16>, <8 x i16>)
-declare <4 x i32> @llvm.spu.si.cgti(<4 x i32>, i16)
-declare <8 x i16> @llvm.spu.si.cgthi(<8 x i16>, i16)
-declare <16 x i8> @llvm.spu.si.cgtbi(<16 x i8>, i8)
-
-declare <4 x i32> @llvm.spu.si.clgt(<4 x i32>, <4 x i32>)
-declare <16 x i8> @llvm.spu.si.clgtb(<16 x i8>, <16 x i8>)
-declare <8 x i16> @llvm.spu.si.clgth(<8 x i16>, <8 x i16>)
-declare <4 x i32> @llvm.spu.si.clgti(<4 x i32>, i16)
-declare <8 x i16> @llvm.spu.si.clgthi(<8 x i16>, i16)
-declare <16 x i8> @llvm.spu.si.clgtbi(<16 x i8>, i8)
-
-
-
-define <4 x i32> @test(<4 x i32> %A) {
- call <4 x i32> @llvm.spu.si.shli(<4 x i32> %A, i8 3)
- %Y = bitcast <4 x i32> %1 to <4 x i32>
- ret <4 x i32> %Y
-}
-
-define <4 x i32> @ceqtest(<4 x i32> %A, <4 x i32> %B) {
- call <4 x i32> @llvm.spu.si.ceq(<4 x i32> %A, <4 x i32> %B)
- %Y = bitcast <4 x i32> %1 to <4 x i32>
- ret <4 x i32> %Y
-}
-
-define <8 x i16> @ceqhtest(<8 x i16> %A, <8 x i16> %B) {
- call <8 x i16> @llvm.spu.si.ceqh(<8 x i16> %A, <8 x i16> %B)
- %Y = bitcast <8 x i16> %1 to <8 x i16>
- ret <8 x i16> %Y
-}
-
-define <16 x i8> @ceqbtest(<16 x i8> %A, <16 x i8> %B) {
- call <16 x i8> @llvm.spu.si.ceqb(<16 x i8> %A, <16 x i8> %B)
- %Y = bitcast <16 x i8> %1 to <16 x i8>
- ret <16 x i8> %Y
-}
-
-define <4 x i32> @ceqitest(<4 x i32> %A) {
- call <4 x i32> @llvm.spu.si.ceqi(<4 x i32> %A, i16 65)
- %Y = bitcast <4 x i32> %1 to <4 x i32>
- ret <4 x i32> %Y
-}
-
-define <8 x i16> @ceqhitest(<8 x i16> %A) {
- call <8 x i16> @llvm.spu.si.ceqhi(<8 x i16> %A, i16 65)
- %Y = bitcast <8 x i16> %1 to <8 x i16>
- ret <8 x i16> %Y
-}
-
-define <16 x i8> @ceqbitest(<16 x i8> %A) {
- call <16 x i8> @llvm.spu.si.ceqbi(<16 x i8> %A, i8 65)
- %Y = bitcast <16 x i8> %1 to <16 x i8>
- ret <16 x i8> %Y
-}
-
-define <4 x i32> @cgttest(<4 x i32> %A, <4 x i32> %B) {
- call <4 x i32> @llvm.spu.si.cgt(<4 x i32> %A, <4 x i32> %B)
- %Y = bitcast <4 x i32> %1 to <4 x i32>
- ret <4 x i32> %Y
-}
-
-define <8 x i16> @cgthtest(<8 x i16> %A, <8 x i16> %B) {
- call <8 x i16> @llvm.spu.si.cgth(<8 x i16> %A, <8 x i16> %B)
- %Y = bitcast <8 x i16> %1 to <8 x i16>
- ret <8 x i16> %Y
-}
-
-define <16 x i8> @cgtbtest(<16 x i8> %A, <16 x i8> %B) {
- call <16 x i8> @llvm.spu.si.cgtb(<16 x i8> %A, <16 x i8> %B)
- %Y = bitcast <16 x i8> %1 to <16 x i8>
- ret <16 x i8> %Y
-}
-
-define <4 x i32> @cgtitest(<4 x i32> %A) {
- call <4 x i32> @llvm.spu.si.cgti(<4 x i32> %A, i16 65)
- %Y = bitcast <4 x i32> %1 to <4 x i32>
- ret <4 x i32> %Y
-}
-
-define <8 x i16> @cgthitest(<8 x i16> %A) {
- call <8 x i16> @llvm.spu.si.cgthi(<8 x i16> %A, i16 65)
- %Y = bitcast <8 x i16> %1 to <8 x i16>
- ret <8 x i16> %Y
-}
-
-define <16 x i8> @cgtbitest(<16 x i8> %A) {
- call <16 x i8> @llvm.spu.si.cgtbi(<16 x i8> %A, i8 65)
- %Y = bitcast <16 x i8> %1 to <16 x i8>
- ret <16 x i8> %Y
-}
-
-define <4 x i32> @clgttest(<4 x i32> %A, <4 x i32> %B) {
- call <4 x i32> @llvm.spu.si.clgt(<4 x i32> %A, <4 x i32> %B)
- %Y = bitcast <4 x i32> %1 to <4 x i32>
- ret <4 x i32> %Y
-}
-
-define <8 x i16> @clgthtest(<8 x i16> %A, <8 x i16> %B) {
- call <8 x i16> @llvm.spu.si.clgth(<8 x i16> %A, <8 x i16> %B)
- %Y = bitcast <8 x i16> %1 to <8 x i16>
- ret <8 x i16> %Y
-}
-
-define <16 x i8> @clgtbtest(<16 x i8> %A, <16 x i8> %B) {
- call <16 x i8> @llvm.spu.si.clgtb(<16 x i8> %A, <16 x i8> %B)
- %Y = bitcast <16 x i8> %1 to <16 x i8>
- ret <16 x i8> %Y
-}
-
-define <4 x i32> @clgtitest(<4 x i32> %A) {
- call <4 x i32> @llvm.spu.si.clgti(<4 x i32> %A, i16 65)
- %Y = bitcast <4 x i32> %1 to <4 x i32>
- ret <4 x i32> %Y
-}
-
-define <8 x i16> @clgthitest(<8 x i16> %A) {
- call <8 x i16> @llvm.spu.si.clgthi(<8 x i16> %A, i16 65)
- %Y = bitcast <8 x i16> %1 to <8 x i16>
- ret <8 x i16> %Y
-}
-
-define <16 x i8> @clgtbitest(<16 x i8> %A) {
- call <16 x i8> @llvm.spu.si.clgtbi(<16 x i8> %A, i8 65)
- %Y = bitcast <16 x i8> %1 to <16 x i8>
- ret <16 x i8> %Y
-}
diff --git a/release_23/test/CodeGen/CellSPU/intrinsics_float.ll b/release_23/test/CodeGen/CellSPU/intrinsics_float.ll
deleted file mode 100644
index c18f8deb385e..000000000000
--- a/release_23/test/CodeGen/CellSPU/intrinsics_float.ll
+++ /dev/null
@@ -1,94 +0,0 @@
-; RUN: llvm-as -o - %s | llc -march=cellspu > %t1.s
-; RUN: grep fa %t1.s | count 5
-; RUN: grep fs %t1.s | count 5
-; RUN: grep fm %t1.s | count 15
-; RUN: grep fceq %t1.s | count 5
-; RUN: grep fcmeq %t1.s | count 5
-; RUN: grep fcgt %t1.s | count 5
-; RUN: grep fcmgt %t1.s | count 5
-; RUN: grep fma %t1.s | count 5
-; RUN: grep fnms %t1.s | count 5
-; RUN: grep fms %t1.s | count 5
-target datalayout = "E-p:32:32:128-f64:64:128-f32:32:128-i64:32:128-i32:32:128-i16:16:128-i8:8:128-i1:8:128-a0:0:128-v128:128:128-s0:128:128"
-target triple = "spu"
-
-declare <4 x i32> @llvm.spu.si.shli(<4 x i32>, i8)
-
-declare <4 x float> @llvm.spu.si.fa(<4 x float>, <4 x float>)
-declare <4 x float> @llvm.spu.si.fs(<4 x float>, <4 x float>)
-declare <4 x float> @llvm.spu.si.fm(<4 x float>, <4 x float>)
-
-declare <4 x float> @llvm.spu.si.fceq(<4 x float>, <4 x float>)
-declare <4 x float> @llvm.spu.si.fcmeq(<4 x float>, <4 x float>)
-declare <4 x float> @llvm.spu.si.fcgt(<4 x float>, <4 x float>)
-declare <4 x float> @llvm.spu.si.fcmgt(<4 x float>, <4 x float>)
-
-declare <4 x float> @llvm.spu.si.fma(<4 x float>, <4 x float>, <4 x float>)
-declare <4 x float> @llvm.spu.si.fnms(<4 x float>, <4 x float>, <4 x float>)
-declare <4 x float> @llvm.spu.si.fms(<4 x float>, <4 x float>, <4 x float>)
-
-define <4 x i32> @test(<4 x i32> %A) {
- call <4 x i32> @llvm.spu.si.shli(<4 x i32> %A, i8 3)
- %Y = bitcast <4 x i32> %1 to <4 x i32>
- ret <4 x i32> %Y
-}
-
-define <4 x float> @fatest(<4 x float> %A, <4 x float> %B) {
- call <4 x float> @llvm.spu.si.fa(<4 x float> %A, <4 x float> %B)
- %Y = bitcast <4 x float> %1 to <4 x float>
- ret <4 x float> %Y
-}
-
-define <4 x float> @fstest(<4 x float> %A, <4 x float> %B) {
- call <4 x float> @llvm.spu.si.fs(<4 x float> %A, <4 x float> %B)
- %Y = bitcast <4 x float> %1 to <4 x float>
- ret <4 x float> %Y
-}
-
-define <4 x float> @fmtest(<4 x float> %A, <4 x float> %B) {
- call <4 x float> @llvm.spu.si.fm(<4 x float> %A, <4 x float> %B)
- %Y = bitcast <4 x float> %1 to <4 x float>
- ret <4 x float> %Y
-}
-
-define <4 x float> @fceqtest(<4 x float> %A, <4 x float> %B) {
- call <4 x float> @llvm.spu.si.fceq(<4 x float> %A, <4 x float> %B)
- %Y = bitcast <4 x float> %1 to <4 x float>
- ret <4 x float> %Y
-}
-
-define <4 x float> @fcmeqtest(<4 x float> %A, <4 x float> %B) {
- call <4 x float> @llvm.spu.si.fcmeq(<4 x float> %A, <4 x float> %B)
- %Y = bitcast <4 x float> %1 to <4 x float>
- ret <4 x float> %Y
-}
-
-define <4 x float> @fcgttest(<4 x float> %A, <4 x float> %B) {
- call <4 x float> @llvm.spu.si.fcgt(<4 x float> %A, <4 x float> %B)
- %Y = bitcast <4 x float> %1 to <4 x float>
- ret <4 x float> %Y
-}
-
-define <4 x float> @fcmgttest(<4 x float> %A, <4 x float> %B) {
- call <4 x float> @llvm.spu.si.fcmgt(<4 x float> %A, <4 x float> %B)
- %Y = bitcast <4 x float> %1 to <4 x float>
- ret <4 x float> %Y
-}
-
-define <4 x float> @fmatest(<4 x float> %A, <4 x float> %B, <4 x float> %C) {
- call <4 x float> @llvm.spu.si.fma(<4 x float> %A, <4 x float> %B, <4 x float> %C)
- %Y = bitcast <4 x float> %1 to <4 x float>
- ret <4 x float> %Y
-}
-
-define <4 x float> @fnmstest(<4 x float> %A, <4 x float> %B, <4 x float> %C) {
- call <4 x float> @llvm.spu.si.fnms(<4 x float> %A, <4 x float> %B, <4 x float> %C)
- %Y = bitcast <4 x float> %1 to <4 x float>
- ret <4 x float> %Y
-}
-
-define <4 x float> @fmstest(<4 x float> %A, <4 x float> %B, <4 x float> %C) {
- call <4 x float> @llvm.spu.si.fms(<4 x float> %A, <4 x float> %B, <4 x float> %C)
- %Y = bitcast <4 x float> %1 to <4 x float>
- ret <4 x float> %Y
-}
diff --git a/release_23/test/CodeGen/CellSPU/intrinsics_logical.ll b/release_23/test/CodeGen/CellSPU/intrinsics_logical.ll
deleted file mode 100644
index 843340b74542..000000000000
--- a/release_23/test/CodeGen/CellSPU/intrinsics_logical.ll
+++ /dev/null
@@ -1,49 +0,0 @@
-; RUN: llvm-as -o - %s | llc -march=cellspu > %t1.s
-; RUN: grep and %t1.s | count 20
-; RUN: grep andc %t1.s | count 5
-target datalayout = "E-p:32:32:128-f64:64:128-f32:32:128-i64:32:128-i32:32:128-i16:16:128-i8:8:128-i1:8:128-a0:0:128-v128:128:128-s0:128:128"
-target triple = "spu"
-
-declare <4 x i32> @llvm.spu.si.and(<4 x i32>, <4 x i32>)
-declare <4 x i32> @llvm.spu.si.andc(<4 x i32>, <4 x i32>)
-declare <4 x i32> @llvm.spu.si.andi(<4 x i32>, i16)
-declare <8 x i16> @llvm.spu.si.andhi(<8 x i16>, i16)
-declare <16 x i8> @llvm.spu.si.andbi(<16 x i8>, i8)
-
-declare <4 x i32> @llvm.spu.si.or(<4 x i32>, <4 x i32>)
-declare <4 x i32> @llvm.spu.si.orc(<4 x i32>, <4 x i32>)
-declare <4 x i32> @llvm.spu.si.ori(<4 x i32>, i16)
-declare <8 x i16> @llvm.spu.si.orhi(<8 x i16>, i16)
-declare <16 x i8> @llvm.spu.si.orbi(<16 x i8>, i8)
-
-declare <4 x i32> @llvm.spu.si.xor(<4 x i32>, <4 x i32>)
-declare <4 x i32> @llvm.spu.si.xori(<4 x i32>, i16)
-declare <8 x i16> @llvm.spu.si.xorhi(<8 x i16>, i16)
-declare <16 x i8> @llvm.spu.si.xorbi(<16 x i8>, i8)
-
-declare <4 x i32> @llvm.spu.si.nand(<4 x i32>, <4 x i32>)
-declare <4 x i32> @llvm.spu.si.nor(<4 x i32>, <4 x i32>)
-
-define <4 x i32> @andtest(<4 x i32> %A, <4 x i32> %B) {
- call <4 x i32> @llvm.spu.si.and(<4 x i32> %A, <4 x i32> %B)
- %Y = bitcast <4 x i32> %1 to <4 x i32>
- ret <4 x i32> %Y
-}
-
-define <4 x i32> @andctest(<4 x i32> %A, <4 x i32> %B) {
- call <4 x i32> @llvm.spu.si.andc(<4 x i32> %A, <4 x i32> %B)
- %Y = bitcast <4 x i32> %1 to <4 x i32>
- ret <4 x i32> %Y
-}
-
-define <4 x i32> @anditest(<4 x i32> %A) {
- call <4 x i32> @llvm.spu.si.andi(<4 x i32> %A, i16 65)
- %Y = bitcast <4 x i32> %1 to <4 x i32>
- ret <4 x i32> %Y
-}
-
-define <8 x i16> @andhitest(<8 x i16> %A) {
- call <8 x i16> @llvm.spu.si.andhi(<8 x i16> %A, i16 65)
- %Y = bitcast <8 x i16> %1 to <8 x i16>
- ret <8 x i16> %Y
-}
diff --git a/release_23/test/CodeGen/CellSPU/mul_ops.ll b/release_23/test/CodeGen/CellSPU/mul_ops.ll
deleted file mode 100644
index 843505f13599..000000000000
--- a/release_23/test/CodeGen/CellSPU/mul_ops.ll
+++ /dev/null
@@ -1,89 +0,0 @@
-; RUN: llvm-as -o - %s | llc -march=cellspu > %t1.s
-; RUN: grep mpy %t1.s | count 44
-; RUN: grep mpyu %t1.s | count 4
-; RUN: grep mpyh %t1.s | count 10
-; RUN: grep mpyhh %t1.s | count 2
-; RUN: grep rotma %t1.s | count 12
-; RUN: grep rotmahi %t1.s | count 4
-; RUN: grep and %t1.s | count 2
-; RUN: grep selb %t1.s | count 6
-; RUN: grep fsmbi %t1.s | count 4
-; RUN: grep shli %t1.s | count 2
-; RUN: grep shlhi %t1.s | count 4
-; RUN: grep ila %t1.s | count 2
-; RUN: grep xsbh %t1.s | count 4
-target datalayout = "E-p:32:32:128-f64:64:128-f32:32:128-i64:32:128-i32:32:128-i16:16:128-i8:8:128-i1:8:128-a0:0:128-v128:128:128-s0:128:128"
-target triple = "spu"
-
-; 32-bit multiply instruction generation:
-define <4 x i32> @mpy_v4i32_1(<4 x i32> %arg1, <4 x i32> %arg2) {
-entry:
- %A = mul <4 x i32> %arg1, %arg2
- ret <4 x i32> %A
-}
-
-define <4 x i32> @mpy_v4i32_2(<4 x i32> %arg1, <4 x i32> %arg2) {
-entry:
- %A = mul <4 x i32> %arg2, %arg1
- ret <4 x i32> %A
-}
-
-define <8 x i16> @mpy_v8i16_1(<8 x i16> %arg1, <8 x i16> %arg2) {
-entry:
- %A = mul <8 x i16> %arg1, %arg2
- ret <8 x i16> %A
-}
-
-define <8 x i16> @mpy_v8i16_2(<8 x i16> %arg1, <8 x i16> %arg2) {
-entry:
- %A = mul <8 x i16> %arg2, %arg1
- ret <8 x i16> %A
-}
-
-define <16 x i8> @mul_v16i8_1(<16 x i8> %arg1, <16 x i8> %arg2) {
-entry:
- %A = mul <16 x i8> %arg2, %arg1
- ret <16 x i8> %A
-}
-
-define <16 x i8> @mul_v16i8_2(<16 x i8> %arg1, <16 x i8> %arg2) {
-entry:
- %A = mul <16 x i8> %arg1, %arg2
- ret <16 x i8> %A
-}
-
-define i32 @mul_i32_1(i32 %arg1, i32 %arg2) {
-entry:
- %A = mul i32 %arg2, %arg1
- ret i32 %A
-}
-
-define i32 @mul_i32_2(i32 %arg1, i32 %arg2) {
-entry:
- %A = mul i32 %arg1, %arg2
- ret i32 %A
-}
-
-define i16 @mul_i16_1(i16 %arg1, i16 %arg2) {
-entry:
- %A = mul i16 %arg2, %arg1
- ret i16 %A
-}
-
-define i16 @mul_i16_2(i16 %arg1, i16 %arg2) {
-entry:
- %A = mul i16 %arg1, %arg2
- ret i16 %A
-}
-
-define i8 @mul_i8_1(i8 %arg1, i8 %arg2) {
-entry:
- %A = mul i8 %arg2, %arg1
- ret i8 %A
-}
-
-define i8 @mul_i8_2(i8 %arg1, i8 %arg2) {
-entry:
- %A = mul i8 %arg1, %arg2
- ret i8 %A
-}
diff --git a/release_23/test/CodeGen/CellSPU/nand.ll b/release_23/test/CodeGen/CellSPU/nand.ll
deleted file mode 100644
index 841a3ec54d6f..000000000000
--- a/release_23/test/CodeGen/CellSPU/nand.ll
+++ /dev/null
@@ -1,121 +0,0 @@
-; RUN: llvm-as -o - %s | llc -march=cellspu > %t1.s
-; RUN: grep nand %t1.s | count 90
-; RUN: grep and %t1.s | count 94
-; RUN: grep xsbh %t1.s | count 2
-; RUN: grep xshw %t1.s | count 4
-target datalayout = "E-p:32:32:128-f64:64:128-f32:32:128-i64:32:128-i32:32:128-i16:16:128-i8:8:128-i1:8:128-a0:0:128-v128:128:128-s0:128:128"
-target triple = "spu"
-
-define <4 x i32> @nand_v4i32_1(<4 x i32> %arg1, <4 x i32> %arg2) {
- %A = and <4 x i32> %arg2, %arg1 ; <<4 x i32>> [#uses=1]
- %B = xor <4 x i32> %A, < i32 -1, i32 -1, i32 -1, i32 -1 >
- ret <4 x i32> %B
-}
-
-define <4 x i32> @nand_v4i32_2(<4 x i32> %arg1, <4 x i32> %arg2) {
- %A = and <4 x i32> %arg1, %arg2 ; <<4 x i32>> [#uses=1]
- %B = xor <4 x i32> %A, < i32 -1, i32 -1, i32 -1, i32 -1 >
- ret <4 x i32> %B
-}
-
-define <8 x i16> @nand_v8i16_1(<8 x i16> %arg1, <8 x i16> %arg2) {
- %A = and <8 x i16> %arg2, %arg1 ; <<8 x i16>> [#uses=1]
- %B = xor <8 x i16> %A, < i16 -1, i16 -1, i16 -1, i16 -1,
- i16 -1, i16 -1, i16 -1, i16 -1 >
- ret <8 x i16> %B
-}
-
-define <8 x i16> @nand_v8i16_2(<8 x i16> %arg1, <8 x i16> %arg2) {
- %A = and <8 x i16> %arg1, %arg2 ; <<8 x i16>> [#uses=1]
- %B = xor <8 x i16> %A, < i16 -1, i16 -1, i16 -1, i16 -1,
- i16 -1, i16 -1, i16 -1, i16 -1 >
- ret <8 x i16> %B
-}
-
-define <16 x i8> @nand_v16i8_1(<16 x i8> %arg1, <16 x i8> %arg2) {
- %A = and <16 x i8> %arg2, %arg1 ; <<16 x i8>> [#uses=1]
- %B = xor <16 x i8> %A, < i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1,
- i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1,
- i8 -1, i8 -1, i8 -1, i8 -1 >
- ret <16 x i8> %B
-}
-
-define <16 x i8> @nand_v16i8_2(<16 x i8> %arg1, <16 x i8> %arg2) {
- %A = and <16 x i8> %arg1, %arg2 ; <<16 x i8>> [#uses=1]
- %B = xor <16 x i8> %A, < i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1,
- i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1,
- i8 -1, i8 -1, i8 -1, i8 -1 >
- ret <16 x i8> %B
-}
-
-define i32 @nand_i32_1(i32 %arg1, i32 %arg2) {
- %A = and i32 %arg2, %arg1 ; <i32> [#uses=1]
- %B = xor i32 %A, -1 ; <i32> [#uses=1]
- ret i32 %B
-}
-
-define i32 @nand_i32_2(i32 %arg1, i32 %arg2) {
- %A = and i32 %arg1, %arg2 ; <i32> [#uses=1]
- %B = xor i32 %A, -1 ; <i32> [#uses=1]
- ret i32 %B
-}
-
-define i16 @nand_i16_1(i16 signext %arg1, i16 signext %arg2) signext {
- %A = and i16 %arg2, %arg1 ; <i16> [#uses=1]
- %B = xor i16 %A, -1 ; <i16> [#uses=1]
- ret i16 %B
-}
-
-define i16 @nand_i16_2(i16 signext %arg1, i16 signext %arg2) signext {
- %A = and i16 %arg1, %arg2 ; <i16> [#uses=1]
- %B = xor i16 %A, -1 ; <i16> [#uses=1]
- ret i16 %B
-}
-
-define i16 @nand_i16u_1(i16 zeroext %arg1, i16 zeroext %arg2) zeroext {
- %A = and i16 %arg2, %arg1 ; <i16> [#uses=1]
- %B = xor i16 %A, -1 ; <i16> [#uses=1]
- ret i16 %B
-}
-
-define i16 @nand_i16u_2(i16 zeroext %arg1, i16 zeroext %arg2) zeroext {
- %A = and i16 %arg1, %arg2 ; <i16> [#uses=1]
- %B = xor i16 %A, -1 ; <i16> [#uses=1]
- ret i16 %B
-}
-
-define i8 @nand_i8u_1(i8 zeroext %arg1, i8 zeroext %arg2) zeroext {
- %A = and i8 %arg2, %arg1 ; <i8> [#uses=1]
- %B = xor i8 %A, -1 ; <i8> [#uses=1]
- ret i8 %B
-}
-
-define i8 @nand_i8u_2(i8 zeroext %arg1, i8 zeroext %arg2) zeroext {
- %A = and i8 %arg1, %arg2 ; <i8> [#uses=1]
- %B = xor i8 %A, -1 ; <i8> [#uses=1]
- ret i8 %B
-}
-
-define i8 @nand_i8_1(i8 signext %arg1, i8 signext %arg2) signext {
- %A = and i8 %arg2, %arg1 ; <i8> [#uses=1]
- %B = xor i8 %A, -1 ; <i8> [#uses=1]
- ret i8 %B
-}
-
-define i8 @nand_i8_2(i8 signext %arg1, i8 signext %arg2) signext {
- %A = and i8 %arg1, %arg2 ; <i8> [#uses=1]
- %B = xor i8 %A, -1 ; <i8> [#uses=1]
- ret i8 %B
-}
-
-define i8 @nand_i8_3(i8 %arg1, i8 %arg2) {
- %A = and i8 %arg2, %arg1 ; <i8> [#uses=1]
- %B = xor i8 %A, -1 ; <i8> [#uses=1]
- ret i8 %B
-}
-
-define i8 @nand_i8_4(i8 %arg1, i8 %arg2) {
- %A = and i8 %arg1, %arg2 ; <i8> [#uses=1]
- %B = xor i8 %A, -1 ; <i8> [#uses=1]
- ret i8 %B
-}
diff --git a/release_23/test/CodeGen/CellSPU/or_ops.ll b/release_23/test/CodeGen/CellSPU/or_ops.ll
deleted file mode 100644
index 4e9da8f12972..000000000000
--- a/release_23/test/CodeGen/CellSPU/or_ops.ll
+++ /dev/null
@@ -1,264 +0,0 @@
-; RUN: llvm-as -o - %s | llc -march=cellspu > %t1.s
-; RUN: grep and %t1.s | count 2
-; RUN: grep orc %t1.s | count 85
-; RUN: grep ori %t1.s | count 30
-; RUN: grep orhi %t1.s | count 30
-; RUN: grep orbi %t1.s | count 15
-target datalayout = "E-p:32:32:128-f64:64:128-f32:32:128-i64:32:128-i32:32:128-i16:16:128-i8:8:128-i1:8:128-a0:0:128-v128:128:128-s0:128:128"
-target triple = "spu"
-
-; OR instruction generation:
-define <4 x i32> @or_v4i32_1(<4 x i32> %arg1, <4 x i32> %arg2) {
- %A = or <4 x i32> %arg1, %arg2
- ret <4 x i32> %A
-}
-
-define <4 x i32> @or_v4i32_2(<4 x i32> %arg1, <4 x i32> %arg2) {
- %A = or <4 x i32> %arg2, %arg1
- ret <4 x i32> %A
-}
-
-define <8 x i16> @or_v8i16_1(<8 x i16> %arg1, <8 x i16> %arg2) {
- %A = or <8 x i16> %arg1, %arg2
- ret <8 x i16> %A
-}
-
-define <8 x i16> @or_v8i16_2(<8 x i16> %arg1, <8 x i16> %arg2) {
- %A = or <8 x i16> %arg2, %arg1
- ret <8 x i16> %A
-}
-
-define <16 x i8> @or_v16i8_1(<16 x i8> %arg1, <16 x i8> %arg2) {
- %A = or <16 x i8> %arg2, %arg1
- ret <16 x i8> %A
-}
-
-define <16 x i8> @or_v16i8_2(<16 x i8> %arg1, <16 x i8> %arg2) {
- %A = or <16 x i8> %arg1, %arg2
- ret <16 x i8> %A
-}
-
-define i32 @or_i32_1(i32 %arg1, i32 %arg2) {
- %A = or i32 %arg2, %arg1
- ret i32 %A
-}
-
-define i32 @or_i32_2(i32 %arg1, i32 %arg2) {
- %A = or i32 %arg1, %arg2
- ret i32 %A
-}
-
-define i16 @or_i16_1(i16 %arg1, i16 %arg2) {
- %A = or i16 %arg2, %arg1
- ret i16 %A
-}
-
-define i16 @or_i16_2(i16 %arg1, i16 %arg2) {
- %A = or i16 %arg1, %arg2
- ret i16 %A
-}
-
-define i8 @or_i8_1(i8 %arg1, i8 %arg2) {
- %A = or i8 %arg2, %arg1
- ret i8 %A
-}
-
-define i8 @or_i8_2(i8 %arg1, i8 %arg2) {
- %A = or i8 %arg1, %arg2
- ret i8 %A
-}
-
-; ORC instruction generation:
-define <4 x i32> @orc_v4i32_1(<4 x i32> %arg1, <4 x i32> %arg2) {
- %A = xor <4 x i32> %arg2, < i32 -1, i32 -1, i32 -1, i32 -1 >
- %B = or <4 x i32> %arg1, %A
- ret <4 x i32> %B
-}
-
-define <4 x i32> @orc_v4i32_2(<4 x i32> %arg1, <4 x i32> %arg2) {
- %A = xor <4 x i32> %arg1, < i32 -1, i32 -1, i32 -1, i32 -1 >
- %B = or <4 x i32> %arg2, %A
- ret <4 x i32> %B
-}
-
-define <4 x i32> @orc_v4i32_3(<4 x i32> %arg1, <4 x i32> %arg2) {
- %A = xor <4 x i32> %arg1, < i32 -1, i32 -1, i32 -1, i32 -1 >
- %B = or <4 x i32> %A, %arg2
- ret <4 x i32> %B
-}
-
-define <8 x i16> @orc_v8i16_1(<8 x i16> %arg1, <8 x i16> %arg2) {
- %A = xor <8 x i16> %arg2, < i16 -1, i16 -1, i16 -1, i16 -1,
- i16 -1, i16 -1, i16 -1, i16 -1 >
- %B = or <8 x i16> %arg1, %A
- ret <8 x i16> %B
-}
-
-define <8 x i16> @orc_v8i16_2(<8 x i16> %arg1, <8 x i16> %arg2) {
- %A = xor <8 x i16> %arg1, < i16 -1, i16 -1, i16 -1, i16 -1,
- i16 -1, i16 -1, i16 -1, i16 -1 >
- %B = or <8 x i16> %arg2, %A
- ret <8 x i16> %B
-}
-
-define <16 x i8> @orc_v16i8_1(<16 x i8> %arg1, <16 x i8> %arg2) {
- %A = xor <16 x i8> %arg1, < i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1,
- i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1,
- i8 -1, i8 -1, i8 -1, i8 -1 >
- %B = or <16 x i8> %arg2, %A
- ret <16 x i8> %B
-}
-
-define <16 x i8> @orc_v16i8_2(<16 x i8> %arg1, <16 x i8> %arg2) {
- %A = xor <16 x i8> %arg2, < i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1,
- i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1,
- i8 -1, i8 -1, i8 -1, i8 -1 >
- %B = or <16 x i8> %arg1, %A
- ret <16 x i8> %B
-}
-
-define <16 x i8> @orc_v16i8_3(<16 x i8> %arg1, <16 x i8> %arg2) {
- %A = xor <16 x i8> %arg2, < i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1,
- i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1,
- i8 -1, i8 -1, i8 -1, i8 -1 >
- %B = or <16 x i8> %A, %arg1
- ret <16 x i8> %B
-}
-
-define i32 @orc_i32_1(i32 %arg1, i32 %arg2) {
- %A = xor i32 %arg2, -1
- %B = or i32 %A, %arg1
- ret i32 %B
-}
-
-define i32 @orc_i32_2(i32 %arg1, i32 %arg2) {
- %A = xor i32 %arg1, -1
- %B = or i32 %A, %arg2
- ret i32 %B
-}
-
-define i32 @orc_i32_3(i32 %arg1, i32 %arg2) {
- %A = xor i32 %arg2, -1
- %B = or i32 %arg1, %A
- ret i32 %B
-}
-
-define i16 @orc_i16_1(i16 %arg1, i16 %arg2) {
- %A = xor i16 %arg2, -1
- %B = or i16 %A, %arg1
- ret i16 %B
-}
-
-define i16 @orc_i16_2(i16 %arg1, i16 %arg2) {
- %A = xor i16 %arg1, -1
- %B = or i16 %A, %arg2
- ret i16 %B
-}
-
-define i16 @orc_i16_3(i16 %arg1, i16 %arg2) {
- %A = xor i16 %arg2, -1
- %B = or i16 %arg1, %A
- ret i16 %B
-}
-
-define i8 @orc_i8_1(i8 %arg1, i8 %arg2) {
- %A = xor i8 %arg2, -1
- %B = or i8 %A, %arg1
- ret i8 %B
-}
-
-define i8 @orc_i8_2(i8 %arg1, i8 %arg2) {
- %A = xor i8 %arg1, -1
- %B = or i8 %A, %arg2
- ret i8 %B
-}
-
-define i8 @orc_i8_3(i8 %arg1, i8 %arg2) {
- %A = xor i8 %arg2, -1
- %B = or i8 %arg1, %A
- ret i8 %B
-}
-
-; ORI instruction generation (i32 data type):
-define <4 x i32> @ori_v4i32_1(<4 x i32> %in) {
- %tmp2 = or <4 x i32> %in, < i32 511, i32 511, i32 511, i32 511 >
- ret <4 x i32> %tmp2
-}
-
-define <4 x i32> @ori_v4i32_2(<4 x i32> %in) {
- %tmp2 = or <4 x i32> %in, < i32 510, i32 510, i32 510, i32 510 >
- ret <4 x i32> %tmp2
-}
-
-define <4 x i32> @ori_v4i32_3(<4 x i32> %in) {
- %tmp2 = or <4 x i32> %in, < i32 -1, i32 -1, i32 -1, i32 -1 >
- ret <4 x i32> %tmp2
-}
-
-define <4 x i32> @ori_v4i32_4(<4 x i32> %in) {
- %tmp2 = or <4 x i32> %in, < i32 -512, i32 -512, i32 -512, i32 -512 >
- ret <4 x i32> %tmp2
-}
-
-define i32 @ori_u32(i32 zeroext %in) zeroext {
- %tmp37 = or i32 %in, 37 ; <i32> [#uses=1]
- ret i32 %tmp37
-}
-
-define i32 @ori_i32(i32 signext %in) signext {
- %tmp38 = or i32 %in, 37 ; <i32> [#uses=1]
- ret i32 %tmp38
-}
-
-; ORHI instruction generation (i16 data type):
-define <8 x i16> @orhi_v8i16_1(<8 x i16> %in) {
- %tmp2 = or <8 x i16> %in, < i16 511, i16 511, i16 511, i16 511,
- i16 511, i16 511, i16 511, i16 511 >
- ret <8 x i16> %tmp2
-}
-
-define <8 x i16> @orhi_v8i16_2(<8 x i16> %in) {
- %tmp2 = or <8 x i16> %in, < i16 510, i16 510, i16 510, i16 510,
- i16 510, i16 510, i16 510, i16 510 >
- ret <8 x i16> %tmp2
-}
-
-define <8 x i16> @orhi_v8i16_3(<8 x i16> %in) {
- %tmp2 = or <8 x i16> %in, < i16 -1, i16 -1, i16 -1, i16 -1, i16 -1,
- i16 -1, i16 -1, i16 -1 >
- ret <8 x i16> %tmp2
-}
-
-define <8 x i16> @orhi_v8i16_4(<8 x i16> %in) {
- %tmp2 = or <8 x i16> %in, < i16 -512, i16 -512, i16 -512, i16 -512,
- i16 -512, i16 -512, i16 -512, i16 -512 >
- ret <8 x i16> %tmp2
-}
-
-define i16 @orhi_u16(i16 zeroext %in) zeroext {
- %tmp37 = or i16 %in, 37 ; <i16> [#uses=1]
- ret i16 %tmp37
-}
-
-define i16 @orhi_i16(i16 signext %in) signext {
- %tmp38 = or i16 %in, 37 ; <i16> [#uses=1]
- ret i16 %tmp38
-}
-
-; ORBI instruction generation (i8 data type):
-define <16 x i8> @orbi_v16i8(<16 x i8> %in) {
- %tmp2 = or <16 x i8> %in, < i8 42, i8 42, i8 42, i8 42, i8 42, i8 42,
- i8 42, i8 42, i8 42, i8 42, i8 42, i8 42,
- i8 42, i8 42, i8 42, i8 42 >
- ret <16 x i8> %tmp2
-}
-
-define i8 @orbi_u8(i8 zeroext %in) zeroext {
- %tmp37 = or i8 %in, 37 ; <i8> [#uses=1]
- ret i8 %tmp37
-}
-
-define i8 @orbi_i8(i8 signext %in) signext {
- %tmp38 = or i8 %in, 37 ; <i8> [#uses=1]
- ret i8 %tmp38
-}
diff --git a/release_23/test/CodeGen/CellSPU/rotate_ops.ll b/release_23/test/CodeGen/CellSPU/rotate_ops.ll
deleted file mode 100644
index 55104a4ceb7f..000000000000
--- a/release_23/test/CodeGen/CellSPU/rotate_ops.ll
+++ /dev/null
@@ -1,159 +0,0 @@
-; RUN: llvm-as -o - %s | llc -march=cellspu -f -o %t1.s
-; RUN: grep rot %t1.s | count 85
-; RUN: grep roth %t1.s | count 8
-; RUN: grep roti.*5 %t1.s | count 1
-; RUN: grep roti.*27 %t1.s | count 1
-; RUN grep rothi.*5 %t1.s | count 2
-; RUN grep rothi.*11 %t1.s | count 1
-; RUN grep rothi.*,.3 %t1.s | count 1
-; RUN: grep andhi %t1.s | count 4
-; RUN: grep shlhi %t1.s | count 4
-target datalayout = "E-p:32:32:128-f64:64:128-f32:32:128-i64:32:128-i32:32:128-i16:16:128-i8:8:128-i1:8:128-a0:0:128-v128:128:128-s0:128:128"
-target triple = "spu"
-
-; Vector rotates are not currently supported in gcc or llvm assembly. These are
-; not tested.
-
-; 32-bit rotates:
-define i32 @rotl32_1a(i32 %arg1, i8 %arg2) {
- %tmp1 = zext i8 %arg2 to i32 ; <i32> [#uses=1]
- %B = shl i32 %arg1, %tmp1 ; <i32> [#uses=1]
- %arg22 = sub i8 32, %arg2 ; <i8> [#uses=1]
- %tmp2 = zext i8 %arg22 to i32 ; <i32> [#uses=1]
- %C = lshr i32 %arg1, %tmp2 ; <i32> [#uses=1]
- %D = or i32 %B, %C ; <i32> [#uses=1]
- ret i32 %D
-}
-
-define i32 @rotl32_1b(i32 %arg1, i16 %arg2) {
- %tmp1 = zext i16 %arg2 to i32 ; <i32> [#uses=1]
- %B = shl i32 %arg1, %tmp1 ; <i32> [#uses=1]
- %arg22 = sub i16 32, %arg2 ; <i8> [#uses=1]
- %tmp2 = zext i16 %arg22 to i32 ; <i32> [#uses=1]
- %C = lshr i32 %arg1, %tmp2 ; <i32> [#uses=1]
- %D = or i32 %B, %C ; <i32> [#uses=1]
- ret i32 %D
-}
-
-define i32 @rotl32_2(i32 %arg1, i32 %arg2) {
- %B = shl i32 %arg1, %arg2 ; <i32> [#uses=1]
- %tmp1 = sub i32 32, %arg2 ; <i32> [#uses=1]
- %C = lshr i32 %arg1, %tmp1 ; <i32> [#uses=1]
- %D = or i32 %B, %C ; <i32> [#uses=1]
- ret i32 %D
-}
-
-define i32 @rotl32_3(i32 %arg1, i32 %arg2) {
- %tmp1 = sub i32 32, %arg2 ; <i32> [#uses=1]
- %B = shl i32 %arg1, %arg2 ; <i32> [#uses=1]
- %C = lshr i32 %arg1, %tmp1 ; <i32> [#uses=1]
- %D = or i32 %B, %C ; <i32> [#uses=1]
- ret i32 %D
-}
-
-define i32 @rotl32_4(i32 %arg1, i32 %arg2) {
- %tmp1 = sub i32 32, %arg2 ; <i32> [#uses=1]
- %C = lshr i32 %arg1, %tmp1 ; <i32> [#uses=1]
- %B = shl i32 %arg1, %arg2 ; <i32> [#uses=1]
- %D = or i32 %B, %C ; <i32> [#uses=1]
- ret i32 %D
-}
-
-define i32 @rotr32_1(i32 %A, i8 %Amt) {
- %tmp1 = zext i8 %Amt to i32 ; <i32> [#uses=1]
- %B = lshr i32 %A, %tmp1 ; <i32> [#uses=1]
- %Amt2 = sub i8 32, %Amt ; <i8> [#uses=1]
- %tmp2 = zext i8 %Amt2 to i32 ; <i32> [#uses=1]
- %C = shl i32 %A, %tmp2 ; <i32> [#uses=1]
- %D = or i32 %B, %C ; <i32> [#uses=1]
- ret i32 %D
-}
-
-define i32 @rotr32_2(i32 %A, i8 %Amt) {
- %Amt2 = sub i8 32, %Amt ; <i8> [#uses=1]
- %tmp1 = zext i8 %Amt to i32 ; <i32> [#uses=1]
- %B = lshr i32 %A, %tmp1 ; <i32> [#uses=1]
- %tmp2 = zext i8 %Amt2 to i32 ; <i32> [#uses=1]
- %C = shl i32 %A, %tmp2 ; <i32> [#uses=1]
- %D = or i32 %B, %C ; <i32> [#uses=1]
- ret i32 %D
-}
-
-; Rotate left with immediate
-define i32 @rotli32(i32 %A) {
- %B = shl i32 %A, 5 ; <i32> [#uses=1]
- %C = lshr i32 %A, 27 ; <i32> [#uses=1]
- %D = or i32 %B, %C ; <i32> [#uses=1]
- ret i32 %D
-}
-
-; Rotate right with immediate
-define i32 @rotri32(i32 %A) {
- %B = lshr i32 %A, 5 ; <i32> [#uses=1]
- %C = shl i32 %A, 27 ; <i32> [#uses=1]
- %D = or i32 %B, %C ; <i32> [#uses=1]
- ret i32 %D
-}
-
-; 16-bit rotates:
-define i16 @rotr16_1(i16 %arg1, i8 %arg) {
- %tmp1 = zext i8 %arg to i16 ; <i16> [#uses=1]
- %B = lshr i16 %arg1, %tmp1 ; <i16> [#uses=1]
- %arg2 = sub i8 16, %arg ; <i8> [#uses=1]
- %tmp2 = zext i8 %arg2 to i16 ; <i16> [#uses=1]
- %C = shl i16 %arg1, %tmp2 ; <i16> [#uses=1]
- %D = or i16 %B, %C ; <i16> [#uses=1]
- ret i16 %D
-}
-
-define i16 @rotr16_2(i16 %arg1, i16 %arg) {
- %B = lshr i16 %arg1, %arg ; <i16> [#uses=1]
- %tmp1 = sub i16 16, %arg ; <i16> [#uses=1]
- %C = shl i16 %arg1, %tmp1 ; <i16> [#uses=1]
- %D = or i16 %B, %C ; <i16> [#uses=1]
- ret i16 %D
-}
-
-define i16 @rotli16(i16 %A) {
- %B = shl i16 %A, 5 ; <i16> [#uses=1]
- %C = lshr i16 %A, 11 ; <i16> [#uses=1]
- %D = or i16 %B, %C ; <i16> [#uses=1]
- ret i16 %D
-}
-
-define i16 @rotri16(i16 %A) {
- %B = lshr i16 %A, 5 ; <i16> [#uses=1]
- %C = shl i16 %A, 11 ; <i16> [#uses=1]
- %D = or i16 %B, %C ; <i16> [#uses=1]
- ret i16 %D
-}
-
-define i8 @rotl8(i8 %A, i8 %Amt) {
- %B = shl i8 %A, %Amt ; <i8> [#uses=1]
- %Amt2 = sub i8 8, %Amt ; <i8> [#uses=1]
- %C = lshr i8 %A, %Amt2 ; <i8> [#uses=1]
- %D = or i8 %B, %C ; <i8> [#uses=1]
- ret i8 %D
-}
-
-define i8 @rotr8(i8 %A, i8 %Amt) {
- %B = lshr i8 %A, %Amt ; <i8> [#uses=1]
- %Amt2 = sub i8 8, %Amt ; <i8> [#uses=1]
- %C = shl i8 %A, %Amt2 ; <i8> [#uses=1]
- %D = or i8 %B, %C ; <i8> [#uses=1]
- ret i8 %D
-}
-
-define i8 @rotli8(i8 %A) {
- %B = shl i8 %A, 5 ; <i8> [#uses=1]
- %C = lshr i8 %A, 3 ; <i8> [#uses=1]
- %D = or i8 %B, %C ; <i8> [#uses=1]
- ret i8 %D
-}
-
-define i8 @rotri8(i8 %A) {
- %B = lshr i8 %A, 5 ; <i8> [#uses=1]
- %C = shl i8 %A, 3 ; <i8> [#uses=1]
- %D = or i8 %B, %C ; <i8> [#uses=1]
- ret i8 %D
-}
diff --git a/release_23/test/CodeGen/CellSPU/select_bits.ll b/release_23/test/CodeGen/CellSPU/select_bits.ll
deleted file mode 100644
index 3a7334d808cf..000000000000
--- a/release_23/test/CodeGen/CellSPU/select_bits.ll
+++ /dev/null
@@ -1,569 +0,0 @@
-; RUN: llvm-as -o - %s | llc -march=cellspu > %t1.s
-; RUN: grep selb %t1.s | count 280
-
-target datalayout = "E-p:32:32:128-f64:64:128-f32:32:128-i64:32:128-i32:32:128-i16:16:128-i8:8:128-i1:8:128-a0:0:128-v128:128:128-s0:128:128"
-target triple = "spu"
-
-;-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
-; v2i64
-;-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
-
-; (or (and rC, rB), (and (not rC), rA))
-define <2 x i64> @selb_v2i64_01(<2 x i64> %rA, <2 x i64> %rB, <2 x i64> %rC) {
- %C = and <2 x i64> %rC, %rB
- %A = xor <2 x i64> %rC, < i64 -1, i64 -1 >
- %B = and <2 x i64> %A, %rA
- %D = or <2 x i64> %C, %B
- ret <2 x i64> %D
-}
-
-; (or (and rB, rC), (and (not rC), rA))
-define <2 x i64> @selb_v2i64_02(<2 x i64> %rA, <2 x i64> %rB, <2 x i64> %rC) {
- %C = and <2 x i64> %rB, %rC
- %A = xor <2 x i64> %rC, < i64 -1, i64 -1 >
- %B = and <2 x i64> %A, %rA
- %D = or <2 x i64> %C, %B
- ret <2 x i64> %D
-}
-
-; (or (and (not rC), rA), (and rB, rC))
-define <2 x i64> @selb_v2i64_03(<2 x i64> %rA, <2 x i64> %rB, <2 x i64> %rC) {
- %A = xor <2 x i64> %rC, < i64 -1, i64 -1 >
- %B = and <2 x i64> %A, %rA
- %C = and <2 x i64> %rB, %rC
- %D = or <2 x i64> %C, %B
- ret <2 x i64> %D
-}
-
-; (or (and (not rC), rA), (and rC, rB))
-define <2 x i64> @selb_v2i64_04(<2 x i64> %rA, <2 x i64> %rB, <2 x i64> %rC) {
- %A = xor <2 x i64> %rC, < i64 -1, i64 -1 >
- %B = and <2 x i64> %A, %rA
- %C = and <2 x i64> %rC, %rB
- %D = or <2 x i64> %C, %B
- ret <2 x i64> %D
-}
-
-; (or (and rC, rB), (and rA, (not rC)))
-define <2 x i64> @selb_v2i64_05(<2 x i64> %rA, <2 x i64> %rB, <2 x i64> %rC) {
- %C = and <2 x i64> %rC, %rB
- %A = xor <2 x i64> %rC, < i64 -1, i64 -1 >
- %B = and <2 x i64> %rA, %A
- %D = or <2 x i64> %C, %B
- ret <2 x i64> %D
-}
-
-; (or (and rB, rC), (and rA, (not rC)))
-define <2 x i64> @selb_v2i64_06(<2 x i64> %rA, <2 x i64> %rB, <2 x i64> %rC) {
- %C = and <2 x i64> %rB, %rC
- %A = xor <2 x i64> %rC, < i64 -1, i64 -1 >
- %B = and <2 x i64> %rA, %A
- %D = or <2 x i64> %C, %B
- ret <2 x i64> %D
-}
-
-; (or (and rA, (not rC)), (and rB, rC))
-define <2 x i64> @selb_v2i64_07(<2 x i64> %rA, <2 x i64> %rB, <2 x i64> %rC) {
- %A = xor <2 x i64> %rC, < i64 -1, i64 -1 >
- %B = and <2 x i64> %rA, %A
- %C = and <2 x i64> %rB, %rC
- %D = or <2 x i64> %C, %B
- ret <2 x i64> %D
-}
-
-; (or (and rA, (not rC)), (and rC, rB))
-define <2 x i64> @selb_v2i64_08(<2 x i64> %rA, <2 x i64> %rB, <2 x i64> %rC) {
- %A = xor <2 x i64> %rC, < i64 -1, i64 -1 >
- %B = and <2 x i64> %rA, %A
- %C = and <2 x i64> %rC, %rB
- %D = or <2 x i64> %C, %B
- ret <2 x i64> %D
-}
-
-;-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
-; v4i32
-;-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
-
-; (or (and rC, rB), (and (not rC), rA))
-define <4 x i32> @selb_v4i32_01(<4 x i32> %rA, <4 x i32> %rB, <4 x i32> %rC) {
- %C = and <4 x i32> %rC, %rB
- %A = xor <4 x i32> %rC, < i32 -1, i32 -1, i32 -1, i32 -1 >
- %B = and <4 x i32> %A, %rA
- %D = or <4 x i32> %C, %B
- ret <4 x i32> %D
-}
-
-; (or (and rB, rC), (and (not rC), rA))
-define <4 x i32> @selb_v4i32_02(<4 x i32> %rA, <4 x i32> %rB, <4 x i32> %rC) {
- %C = and <4 x i32> %rB, %rC
- %A = xor <4 x i32> %rC, < i32 -1, i32 -1, i32 -1, i32 -1 >
- %B = and <4 x i32> %A, %rA
- %D = or <4 x i32> %C, %B
- ret <4 x i32> %D
-}
-
-; (or (and (not rC), rA), (and rB, rC))
-define <4 x i32> @selb_v4i32_03(<4 x i32> %rA, <4 x i32> %rB, <4 x i32> %rC) {
- %A = xor <4 x i32> %rC, < i32 -1, i32 -1, i32 -1, i32 -1 >
- %B = and <4 x i32> %A, %rA
- %C = and <4 x i32> %rB, %rC
- %D = or <4 x i32> %C, %B
- ret <4 x i32> %D
-}
-
-; (or (and (not rC), rA), (and rC, rB))
-define <4 x i32> @selb_v4i32_04(<4 x i32> %rA, <4 x i32> %rB, <4 x i32> %rC) {
- %A = xor <4 x i32> %rC, < i32 -1, i32 -1, i32 -1, i32 -1>
- %B = and <4 x i32> %A, %rA
- %C = and <4 x i32> %rC, %rB
- %D = or <4 x i32> %C, %B
- ret <4 x i32> %D
-}
-
-; (or (and rC, rB), (and rA, (not rC)))
-define <4 x i32> @selb_v4i32_05(<4 x i32> %rA, <4 x i32> %rB, <4 x i32> %rC) {
- %C = and <4 x i32> %rC, %rB
- %A = xor <4 x i32> %rC, < i32 -1, i32 -1, i32 -1, i32 -1>
- %B = and <4 x i32> %rA, %A
- %D = or <4 x i32> %C, %B
- ret <4 x i32> %D
-}
-
-; (or (and rB, rC), (and rA, (not rC)))
-define <4 x i32> @selb_v4i32_06(<4 x i32> %rA, <4 x i32> %rB, <4 x i32> %rC) {
- %C = and <4 x i32> %rB, %rC
- %A = xor <4 x i32> %rC, < i32 -1, i32 -1, i32 -1, i32 -1>
- %B = and <4 x i32> %rA, %A
- %D = or <4 x i32> %C, %B
- ret <4 x i32> %D
-}
-
-; (or (and rA, (not rC)), (and rB, rC))
-define <4 x i32> @selb_v4i32_07(<4 x i32> %rA, <4 x i32> %rB, <4 x i32> %rC) {
- %A = xor <4 x i32> %rC, < i32 -1, i32 -1, i32 -1, i32 -1>
- %B = and <4 x i32> %rA, %A
- %C = and <4 x i32> %rB, %rC
- %D = or <4 x i32> %C, %B
- ret <4 x i32> %D
-}
-
-; (or (and rA, (not rC)), (and rC, rB))
-define <4 x i32> @selb_v4i32_08(<4 x i32> %rA, <4 x i32> %rB, <4 x i32> %rC) {
- %A = xor <4 x i32> %rC, < i32 -1, i32 -1, i32 -1, i32 -1>
- %B = and <4 x i32> %rA, %A
- %C = and <4 x i32> %rC, %rB
- %D = or <4 x i32> %C, %B
- ret <4 x i32> %D
-}
-
-;-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
-; v8i16
-;-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
-
-; (or (and rC, rB), (and (not rC), rA))
-define <8 x i16> @selb_v8i16_01(<8 x i16> %rA, <8 x i16> %rB, <8 x i16> %rC) {
- %C = and <8 x i16> %rC, %rB
- %A = xor <8 x i16> %rC, < i16 -1, i16 -1, i16 -1, i16 -1,
- i16 -1, i16 -1, i16 -1, i16 -1 >
- %B = and <8 x i16> %A, %rA
- %D = or <8 x i16> %C, %B
- ret <8 x i16> %D
-}
-
-; (or (and rB, rC), (and (not rC), rA))
-define <8 x i16> @selb_v8i16_02(<8 x i16> %rA, <8 x i16> %rB, <8 x i16> %rC) {
- %C = and <8 x i16> %rB, %rC
- %A = xor <8 x i16> %rC, < i16 -1, i16 -1, i16 -1, i16 -1,
- i16 -1, i16 -1, i16 -1, i16 -1 >
- %B = and <8 x i16> %A, %rA
- %D = or <8 x i16> %C, %B
- ret <8 x i16> %D
-}
-
-; (or (and (not rC), rA), (and rB, rC))
-define <8 x i16> @selb_v8i16_03(<8 x i16> %rA, <8 x i16> %rB, <8 x i16> %rC) {
- %A = xor <8 x i16> %rC, < i16 -1, i16 -1, i16 -1, i16 -1,
- i16 -1, i16 -1, i16 -1, i16 -1 >
- %B = and <8 x i16> %A, %rA
- %C = and <8 x i16> %rB, %rC
- %D = or <8 x i16> %C, %B
- ret <8 x i16> %D
-}
-
-; (or (and (not rC), rA), (and rC, rB))
-define <8 x i16> @selb_v8i16_04(<8 x i16> %rA, <8 x i16> %rB, <8 x i16> %rC) {
- %A = xor <8 x i16> %rC, < i16 -1, i16 -1, i16 -1, i16 -1,
- i16 -1, i16 -1, i16 -1, i16 -1 >
- %B = and <8 x i16> %A, %rA
- %C = and <8 x i16> %rC, %rB
- %D = or <8 x i16> %C, %B
- ret <8 x i16> %D
-}
-
-; (or (and rC, rB), (and rA, (not rC)))
-define <8 x i16> @selb_v8i16_05(<8 x i16> %rA, <8 x i16> %rB, <8 x i16> %rC) {
- %C = and <8 x i16> %rC, %rB
- %A = xor <8 x i16> %rC, < i16 -1, i16 -1, i16 -1, i16 -1,
- i16 -1, i16 -1, i16 -1, i16 -1 >
- %B = and <8 x i16> %rA, %A
- %D = or <8 x i16> %C, %B
- ret <8 x i16> %D
-}
-
-; (or (and rB, rC), (and rA, (not rC)))
-define <8 x i16> @selb_v8i16_06(<8 x i16> %rA, <8 x i16> %rB, <8 x i16> %rC) {
- %C = and <8 x i16> %rB, %rC
- %A = xor <8 x i16> %rC, < i16 -1, i16 -1, i16 -1, i16 -1,
- i16 -1, i16 -1, i16 -1, i16 -1 >
- %B = and <8 x i16> %rA, %A
- %D = or <8 x i16> %C, %B
- ret <8 x i16> %D
-}
-
-; (or (and rA, (not rC)), (and rB, rC))
-define <8 x i16> @selb_v8i16_07(<8 x i16> %rA, <8 x i16> %rB, <8 x i16> %rC) {
- %A = xor <8 x i16> %rC, < i16 -1, i16 -1, i16 -1, i16 -1,
- i16 -1, i16 -1, i16 -1, i16 -1 >
- %B = and <8 x i16> %rA, %A
- %C = and <8 x i16> %rB, %rC
- %D = or <8 x i16> %C, %B
- ret <8 x i16> %D
-}
-
-; (or (and rA, (not rC)), (and rC, rB))
-define <8 x i16> @selb_v8i16_08(<8 x i16> %rA, <8 x i16> %rB, <8 x i16> %rC) {
- %A = xor <8 x i16> %rC, < i16 -1, i16 -1, i16 -1, i16 -1,
- i16 -1, i16 -1, i16 -1, i16 -1 >
- %B = and <8 x i16> %rA, %A
- %C = and <8 x i16> %rC, %rB
- %D = or <8 x i16> %C, %B
- ret <8 x i16> %D
-}
-
-;-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
-; v16i8
-;-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
-
-; (or (and rC, rB), (and (not rC), rA))
-define <16 x i8> @selb_v16i8_01(<16 x i8> %rA, <16 x i8> %rB, <16 x i8> %rC) {
- %C = and <16 x i8> %rC, %rB
- %A = xor <16 x i8> %rC, < i8 -1, i8 -1, i8 -1, i8 -1,
- i8 -1, i8 -1, i8 -1, i8 -1,
- i8 -1, i8 -1, i8 -1, i8 -1,
- i8 -1, i8 -1, i8 -1, i8 -1 >
- %B = and <16 x i8> %A, %rA
- %D = or <16 x i8> %C, %B
- ret <16 x i8> %D
-}
-
-; (or (and rB, rC), (and (not rC), rA))
-define <16 x i8> @selb_v16i8_02(<16 x i8> %rA, <16 x i8> %rB, <16 x i8> %rC) {
- %C = and <16 x i8> %rB, %rC
- %A = xor <16 x i8> %rC, < i8 -1, i8 -1, i8 -1, i8 -1,
- i8 -1, i8 -1, i8 -1, i8 -1,
- i8 -1, i8 -1, i8 -1, i8 -1,
- i8 -1, i8 -1, i8 -1, i8 -1 >
- %B = and <16 x i8> %A, %rA
- %D = or <16 x i8> %C, %B
- ret <16 x i8> %D
-}
-
-; (or (and (not rC), rA), (and rB, rC))
-define <16 x i8> @selb_v16i8_03(<16 x i8> %rA, <16 x i8> %rB, <16 x i8> %rC) {
- %A = xor <16 x i8> %rC, < i8 -1, i8 -1, i8 -1, i8 -1,
- i8 -1, i8 -1, i8 -1, i8 -1,
- i8 -1, i8 -1, i8 -1, i8 -1,
- i8 -1, i8 -1, i8 -1, i8 -1 >
- %B = and <16 x i8> %A, %rA
- %C = and <16 x i8> %rB, %rC
- %D = or <16 x i8> %C, %B
- ret <16 x i8> %D
-}
-
-; (or (and (not rC), rA), (and rC, rB))
-define <16 x i8> @selb_v16i8_04(<16 x i8> %rA, <16 x i8> %rB, <16 x i8> %rC) {
- %A = xor <16 x i8> %rC, < i8 -1, i8 -1, i8 -1, i8 -1,
- i8 -1, i8 -1, i8 -1, i8 -1,
- i8 -1, i8 -1, i8 -1, i8 -1,
- i8 -1, i8 -1, i8 -1, i8 -1 >
- %B = and <16 x i8> %A, %rA
- %C = and <16 x i8> %rC, %rB
- %D = or <16 x i8> %C, %B
- ret <16 x i8> %D
-}
-
-; (or (and rC, rB), (and rA, (not rC)))
-define <16 x i8> @selb_v16i8_05(<16 x i8> %rA, <16 x i8> %rB, <16 x i8> %rC) {
- %C = and <16 x i8> %rC, %rB
- %A = xor <16 x i8> %rC, < i8 -1, i8 -1, i8 -1, i8 -1,
- i8 -1, i8 -1, i8 -1, i8 -1,
- i8 -1, i8 -1, i8 -1, i8 -1,
- i8 -1, i8 -1, i8 -1, i8 -1 >
- %B = and <16 x i8> %rA, %A
- %D = or <16 x i8> %C, %B
- ret <16 x i8> %D
-}
-
-; (or (and rB, rC), (and rA, (not rC)))
-define <16 x i8> @selb_v16i8_06(<16 x i8> %rA, <16 x i8> %rB, <16 x i8> %rC) {
- %C = and <16 x i8> %rB, %rC
- %A = xor <16 x i8> %rC, < i8 -1, i8 -1, i8 -1, i8 -1,
- i8 -1, i8 -1, i8 -1, i8 -1,
- i8 -1, i8 -1, i8 -1, i8 -1,
- i8 -1, i8 -1, i8 -1, i8 -1 >
- %B = and <16 x i8> %rA, %A
- %D = or <16 x i8> %C, %B
- ret <16 x i8> %D
-}
-
-; (or (and rA, (not rC)), (and rB, rC))
-define <16 x i8> @selb_v16i8_07(<16 x i8> %rA, <16 x i8> %rB, <16 x i8> %rC) {
- %A = xor <16 x i8> %rC, < i8 -1, i8 -1, i8 -1, i8 -1,
- i8 -1, i8 -1, i8 -1, i8 -1,
- i8 -1, i8 -1, i8 -1, i8 -1,
- i8 -1, i8 -1, i8 -1, i8 -1 >
- %B = and <16 x i8> %rA, %A
- %C = and <16 x i8> %rB, %rC
- %D = or <16 x i8> %C, %B
- ret <16 x i8> %D
-}
-
-; (or (and rA, (not rC)), (and rC, rB))
-define <16 x i8> @selb_v16i8_08(<16 x i8> %rA, <16 x i8> %rB, <16 x i8> %rC) {
- %A = xor <16 x i8> %rC, < i8 -1, i8 -1, i8 -1, i8 -1,
- i8 -1, i8 -1, i8 -1, i8 -1,
- i8 -1, i8 -1, i8 -1, i8 -1,
- i8 -1, i8 -1, i8 -1, i8 -1 >
- %B = and <16 x i8> %rA, %A
- %C = and <16 x i8> %rC, %rB
- %D = or <16 x i8> %C, %B
- ret <16 x i8> %D
-}
-
-;-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
-; i32
-;-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
-
-; (or (and rC, rB), (and (not rC), rA))
-define i32 @selb_i32_01(i32 %rA, i32 %rB, i32 %rC) {
- %C = and i32 %rC, %rB
- %A = xor i32 %rC, -1
- %B = and i32 %A, %rA
- %D = or i32 %C, %B
- ret i32 %D
-}
-
-; (or (and rB, rC), (and (not rC), rA))
-define i32 @selb_i32_02(i32 %rA, i32 %rB, i32 %rC) {
- %C = and i32 %rB, %rC
- %A = xor i32 %rC, -1
- %B = and i32 %A, %rA
- %D = or i32 %C, %B
- ret i32 %D
-}
-
-; (or (and (not rC), rA), (and rB, rC))
-define i32 @selb_i32_03(i32 %rA, i32 %rB, i32 %rC) {
- %A = xor i32 %rC, -1
- %B = and i32 %A, %rA
- %C = and i32 %rB, %rC
- %D = or i32 %C, %B
- ret i32 %D
-}
-
-; (or (and (not rC), rA), (and rC, rB))
-define i32 @selb_i32_04(i32 %rA, i32 %rB, i32 %rC) {
- %A = xor i32 %rC, -1
- %B = and i32 %A, %rA
- %C = and i32 %rC, %rB
- %D = or i32 %C, %B
- ret i32 %D
-}
-
-; (or (and rC, rB), (and rA, (not rC)))
-define i32 @selb_i32_05(i32 %rA, i32 %rB, i32 %rC) {
- %C = and i32 %rC, %rB
- %A = xor i32 %rC, -1
- %B = and i32 %rA, %A
- %D = or i32 %C, %B
- ret i32 %D
-}
-
-; (or (and rB, rC), (and rA, (not rC)))
-define i32 @selb_i32_06(i32 %rA, i32 %rB, i32 %rC) {
- %C = and i32 %rB, %rC
- %A = xor i32 %rC, -1
- %B = and i32 %rA, %A
- %D = or i32 %C, %B
- ret i32 %D
-}
-
-; (or (and rA, (not rC)), (and rB, rC))
-define i32 @selb_i32_07(i32 %rA, i32 %rB, i32 %rC) {
- %A = xor i32 %rC, -1
- %B = and i32 %rA, %A
- %C = and i32 %rB, %rC
- %D = or i32 %C, %B
- ret i32 %D
-}
-
-; (or (and rA, (not rC)), (and rC, rB))
-define i32 @selb_i32_08(i32 %rA, i32 %rB, i32 %rC) {
- %A = xor i32 %rC, -1
- %B = and i32 %rA, %A
- %C = and i32 %rC, %rB
- %D = or i32 %C, %B
- ret i32 %D
-}
-
-;-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
-; i16
-;-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
-
-; (or (and rC, rB), (and (not rC), rA))
-define i16 @selb_i16_01(i16 %rA, i16 %rB, i16 %rC) {
- %C = and i16 %rC, %rB
- %A = xor i16 %rC, -1
- %B = and i16 %A, %rA
- %D = or i16 %C, %B
- ret i16 %D
-}
-
-; (or (and rB, rC), (and (not rC), rA))
-define i16 @selb_i16_02(i16 %rA, i16 %rB, i16 %rC) {
- %C = and i16 %rB, %rC
- %A = xor i16 %rC, -1
- %B = and i16 %A, %rA
- %D = or i16 %C, %B
- ret i16 %D
-}
-
-; (or (and (not rC), rA), (and rB, rC))
-define i16 @selb_i16_03(i16 %rA, i16 %rB, i16 %rC) {
- %A = xor i16 %rC, -1
- %B = and i16 %A, %rA
- %C = and i16 %rB, %rC
- %D = or i16 %C, %B
- ret i16 %D
-}
-
-; (or (and (not rC), rA), (and rC, rB))
-define i16 @selb_i16_04(i16 %rA, i16 %rB, i16 %rC) {
- %A = xor i16 %rC, -1
- %B = and i16 %A, %rA
- %C = and i16 %rC, %rB
- %D = or i16 %C, %B
- ret i16 %D
-}
-
-; (or (and rC, rB), (and rA, (not rC)))
-define i16 @selb_i16_05(i16 %rA, i16 %rB, i16 %rC) {
- %C = and i16 %rC, %rB
- %A = xor i16 %rC, -1
- %B = and i16 %rA, %A
- %D = or i16 %C, %B
- ret i16 %D
-}
-
-; (or (and rB, rC), (and rA, (not rC)))
-define i16 @selb_i16_06(i16 %rA, i16 %rB, i16 %rC) {
- %C = and i16 %rB, %rC
- %A = xor i16 %rC, -1
- %B = and i16 %rA, %A
- %D = or i16 %C, %B
- ret i16 %D
-}
-
-; (or (and rA, (not rC)), (and rB, rC))
-define i16 @selb_i16_07(i16 %rA, i16 %rB, i16 %rC) {
- %A = xor i16 %rC, -1
- %B = and i16 %rA, %A
- %C = and i16 %rB, %rC
- %D = or i16 %C, %B
- ret i16 %D
-}
-
-; (or (and rA, (not rC)), (and rC, rB))
-define i16 @selb_i16_08(i16 %rA, i16 %rB, i16 %rC) {
- %A = xor i16 %rC, -1
- %B = and i16 %rA, %A
- %C = and i16 %rC, %rB
- %D = or i16 %C, %B
- ret i16 %D
-}
-
-;-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
-; i8
-;-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
-
-; (or (and rC, rB), (and (not rC), rA))
-define i8 @selb_i8_01(i8 %rA, i8 %rB, i8 %rC) {
- %C = and i8 %rC, %rB
- %A = xor i8 %rC, -1
- %B = and i8 %A, %rA
- %D = or i8 %C, %B
- ret i8 %D
-}
-
-; (or (and rB, rC), (and (not rC), rA))
-define i8 @selb_i8_02(i8 %rA, i8 %rB, i8 %rC) {
- %C = and i8 %rB, %rC
- %A = xor i8 %rC, -1
- %B = and i8 %A, %rA
- %D = or i8 %C, %B
- ret i8 %D
-}
-
-; (or (and (not rC), rA), (and rB, rC))
-define i8 @selb_i8_03(i8 %rA, i8 %rB, i8 %rC) {
- %A = xor i8 %rC, -1
- %B = and i8 %A, %rA
- %C = and i8 %rB, %rC
- %D = or i8 %C, %B
- ret i8 %D
-}
-
-; (or (and (not rC), rA), (and rC, rB))
-define i8 @selb_i8_04(i8 %rA, i8 %rB, i8 %rC) {
- %A = xor i8 %rC, -1
- %B = and i8 %A, %rA
- %C = and i8 %rC, %rB
- %D = or i8 %C, %B
- ret i8 %D
-}
-
-; (or (and rC, rB), (and rA, (not rC)))
-define i8 @selb_i8_05(i8 %rA, i8 %rB, i8 %rC) {
- %C = and i8 %rC, %rB
- %A = xor i8 %rC, -1
- %B = and i8 %rA, %A
- %D = or i8 %C, %B
- ret i8 %D
-}
-
-; (or (and rB, rC), (and rA, (not rC)))
-define i8 @selb_i8_06(i8 %rA, i8 %rB, i8 %rC) {
- %C = and i8 %rB, %rC
- %A = xor i8 %rC, -1
- %B = and i8 %rA, %A
- %D = or i8 %C, %B
- ret i8 %D
-}
-
-; (or (and rA, (not rC)), (and rB, rC))
-define i8 @selb_i8_07(i8 %rA, i8 %rB, i8 %rC) {
- %A = xor i8 %rC, -1
- %B = and i8 %rA, %A
- %C = and i8 %rB, %rC
- %D = or i8 %C, %B
- ret i8 %D
-}
-
-; (or (and rA, (not rC)), (and rC, rB))
-define i8 @selb_i8_08(i8 %rA, i8 %rB, i8 %rC) {
- %A = xor i8 %rC, -1
- %B = and i8 %rA, %A
- %C = and i8 %rC, %rB
- %D = or i8 %C, %B
- ret i8 %D
-}
diff --git a/release_23/test/CodeGen/CellSPU/shift_ops.ll b/release_23/test/CodeGen/CellSPU/shift_ops.ll
deleted file mode 100644
index b6629cac2a15..000000000000
--- a/release_23/test/CodeGen/CellSPU/shift_ops.ll
+++ /dev/null
@@ -1,212 +0,0 @@
-; RUN: llvm-as -o - %s | llc -march=cellspu > %t1.s
-; RUN: grep shlh %t1.s | count 84
-; RUN: grep shlhi %t1.s | count 51
-; RUN: grep shl %t1.s | count 168
-; RUN: grep shli %t1.s | count 51
-; RUN: grep xshw %t1.s | count 5
-; RUN: grep and %t1.s | count 5
-target datalayout = "E-p:32:32:128-f64:64:128-f32:32:128-i64:32:128-i32:32:128-i16:16:128-i8:8:128-i1:8:128-a0:0:128-v128:128:128-s0:128:128"
-target triple = "spu"
-
-; Vector shifts are not currently supported in gcc or llvm assembly. These are
-; not tested.
-
-; Shift left i16 via register, note that the second operand to shl is promoted
-; to a 32-bit type:
-
-define i16 @shlh_i16_1(i16 %arg1, i16 %arg2) {
- %A = shl i16 %arg1, %arg2
- ret i16 %A
-}
-
-define i16 @shlh_i16_2(i16 %arg1, i16 %arg2) {
- %A = shl i16 %arg2, %arg1
- ret i16 %A
-}
-
-define i16 @shlh_i16_3(i16 signext %arg1, i16 signext %arg2) signext {
- %A = shl i16 %arg1, %arg2
- ret i16 %A
-}
-
-define i16 @shlh_i16_4(i16 signext %arg1, i16 signext %arg2) signext {
- %A = shl i16 %arg2, %arg1
- ret i16 %A
-}
-
-define i16 @shlh_i16_5(i16 zeroext %arg1, i16 zeroext %arg2) zeroext {
- %A = shl i16 %arg1, %arg2
- ret i16 %A
-}
-
-define i16 @shlh_i16_6(i16 zeroext %arg1, i16 zeroext %arg2) zeroext {
- %A = shl i16 %arg2, %arg1
- ret i16 %A
-}
-
-; Shift left i16 with immediate:
-define i16 @shlhi_i16_1(i16 %arg1) {
- %A = shl i16 %arg1, 12
- ret i16 %A
-}
-
-; Should not generate anything other than the return, arg1 << 0 = arg1
-define i16 @shlhi_i16_2(i16 %arg1) {
- %A = shl i16 %arg1, 0
- ret i16 %A
-}
-
-define i16 @shlhi_i16_3(i16 %arg1) {
- %A = shl i16 16383, %arg1
- ret i16 %A
-}
-
-; Should generate 0, 0 << arg1 = 0
-define i16 @shlhi_i16_4(i16 %arg1) {
- %A = shl i16 0, %arg1
- ret i16 %A
-}
-
-define i16 @shlhi_i16_5(i16 signext %arg1) signext {
- %A = shl i16 %arg1, 12
- ret i16 %A
-}
-
-; Should not generate anything other than the return, arg1 << 0 = arg1
-define i16 @shlhi_i16_6(i16 signext %arg1) signext {
- %A = shl i16 %arg1, 0
- ret i16 %A
-}
-
-define i16 @shlhi_i16_7(i16 signext %arg1) signext {
- %A = shl i16 16383, %arg1
- ret i16 %A
-}
-
-; Should generate 0, 0 << arg1 = 0
-define i16 @shlhi_i16_8(i16 signext %arg1) signext {
- %A = shl i16 0, %arg1
- ret i16 %A
-}
-
-define i16 @shlhi_i16_9(i16 zeroext %arg1) zeroext {
- %A = shl i16 %arg1, 12
- ret i16 %A
-}
-
-; Should not generate anything other than the return, arg1 << 0 = arg1
-define i16 @shlhi_i16_10(i16 zeroext %arg1) zeroext {
- %A = shl i16 %arg1, 0
- ret i16 %A
-}
-
-define i16 @shlhi_i16_11(i16 zeroext %arg1) zeroext {
- %A = shl i16 16383, %arg1
- ret i16 %A
-}
-
-; Should generate 0, 0 << arg1 = 0
-define i16 @shlhi_i16_12(i16 zeroext %arg1) zeroext {
- %A = shl i16 0, %arg1
- ret i16 %A
-}
-
-; Shift left i32 via register, note that the second operand to shl is promoted
-; to a 32-bit type:
-
-define i32 @shl_i32_1(i32 %arg1, i32 %arg2) {
- %A = shl i32 %arg1, %arg2
- ret i32 %A
-}
-
-define i32 @shl_i32_2(i32 %arg1, i32 %arg2) {
- %A = shl i32 %arg2, %arg1
- ret i32 %A
-}
-
-define i32 @shl_i32_3(i32 signext %arg1, i32 signext %arg2) signext {
- %A = shl i32 %arg1, %arg2
- ret i32 %A
-}
-
-define i32 @shl_i32_4(i32 signext %arg1, i32 signext %arg2) signext {
- %A = shl i32 %arg2, %arg1
- ret i32 %A
-}
-
-define i32 @shl_i32_5(i32 zeroext %arg1, i32 zeroext %arg2) zeroext {
- %A = shl i32 %arg1, %arg2
- ret i32 %A
-}
-
-define i32 @shl_i32_6(i32 zeroext %arg1, i32 zeroext %arg2) zeroext {
- %A = shl i32 %arg2, %arg1
- ret i32 %A
-}
-
-; Shift left i32 with immediate:
-define i32 @shli_i32_1(i32 %arg1) {
- %A = shl i32 %arg1, 12
- ret i32 %A
-}
-
-; Should not generate anything other than the return, arg1 << 0 = arg1
-define i32 @shli_i32_2(i32 %arg1) {
- %A = shl i32 %arg1, 0
- ret i32 %A
-}
-
-define i32 @shli_i32_3(i32 %arg1) {
- %A = shl i32 16383, %arg1
- ret i32 %A
-}
-
-; Should generate 0, 0 << arg1 = 0
-define i32 @shli_i32_4(i32 %arg1) {
- %A = shl i32 0, %arg1
- ret i32 %A
-}
-
-define i32 @shli_i32_5(i32 signext %arg1) signext {
- %A = shl i32 %arg1, 12
- ret i32 %A
-}
-
-; Should not generate anything other than the return, arg1 << 0 = arg1
-define i32 @shli_i32_6(i32 signext %arg1) signext {
- %A = shl i32 %arg1, 0
- ret i32 %A
-}
-
-define i32 @shli_i32_7(i32 signext %arg1) signext {
- %A = shl i32 16383, %arg1
- ret i32 %A
-}
-
-; Should generate 0, 0 << arg1 = 0
-define i32 @shli_i32_8(i32 signext %arg1) signext {
- %A = shl i32 0, %arg1
- ret i32 %A
-}
-
-define i32 @shli_i32_9(i32 zeroext %arg1) zeroext {
- %A = shl i32 %arg1, 12
- ret i32 %A
-}
-
-; Should not generate anything other than the return, arg1 << 0 = arg1
-define i32 @shli_i32_10(i32 zeroext %arg1) zeroext {
- %A = shl i32 %arg1, 0
- ret i32 %A
-}
-
-define i32 @shli_i32_11(i32 zeroext %arg1) zeroext {
- %A = shl i32 16383, %arg1
- ret i32 %A
-}
-
-; Should generate 0, 0 << arg1 = 0
-define i32 @shli_i32_12(i32 zeroext %arg1) zeroext {
- %A = shl i32 0, %arg1
- ret i32 %A
-}
diff --git a/release_23/test/CodeGen/CellSPU/sp_farith.ll b/release_23/test/CodeGen/CellSPU/sp_farith.ll
deleted file mode 100644
index 949e69a5a3d4..000000000000
--- a/release_23/test/CodeGen/CellSPU/sp_farith.ll
+++ /dev/null
@@ -1,90 +0,0 @@
-; RUN: llvm-as -o - %s | llc -march=cellspu > %t1.s
-; RUN: grep fa %t1.s | count 2
-; RUN: grep fs %t1.s | count 2
-; RUN: grep fm %t1.s | count 6
-; RUN: grep fma %t1.s | count 2
-; RUN: grep fms %t1.s | count 2
-; RUN: grep fnms %t1.s | count 3
-;
-; This file includes standard floating point arithmetic instructions
-; NOTE fdiv is tested separately since it is a compound operation
-target datalayout = "E-p:32:32:128-f64:64:128-f32:32:128-i64:32:128-i32:32:128-i16:16:128-i8:8:128-i1:8:128-a0:0:128-v128:128:128-s0:128:128"
-target triple = "spu"
-
-define float @fp_add(float %arg1, float %arg2) {
- %A = add float %arg1, %arg2 ; <float> [#uses=1]
- ret float %A
-}
-
-define <4 x float> @fp_add_vec(<4 x float> %arg1, <4 x float> %arg2) {
- %A = add <4 x float> %arg1, %arg2 ; <<4 x float>> [#uses=1]
- ret <4 x float> %A
-}
-
-define float @fp_sub(float %arg1, float %arg2) {
- %A = sub float %arg1, %arg2 ; <float> [#uses=1]
- ret float %A
-}
-
-define <4 x float> @fp_sub_vec(<4 x float> %arg1, <4 x float> %arg2) {
- %A = sub <4 x float> %arg1, %arg2 ; <<4 x float>> [#uses=1]
- ret <4 x float> %A
-}
-
-define float @fp_mul(float %arg1, float %arg2) {
- %A = mul float %arg1, %arg2 ; <float> [#uses=1]
- ret float %A
-}
-
-define <4 x float> @fp_mul_vec(<4 x float> %arg1, <4 x float> %arg2) {
- %A = mul <4 x float> %arg1, %arg2 ; <<4 x float>> [#uses=1]
- ret <4 x float> %A
-}
-
-define float @fp_mul_add(float %arg1, float %arg2, float %arg3) {
- %A = mul float %arg1, %arg2 ; <float> [#uses=1]
- %B = add float %A, %arg3 ; <float> [#uses=1]
- ret float %B
-}
-
-define <4 x float> @fp_mul_add_vec(<4 x float> %arg1, <4 x float> %arg2, <4 x float> %arg3) {
- %A = mul <4 x float> %arg1, %arg2 ; <<4 x float>> [#uses=1]
- %B = add <4 x float> %A, %arg3 ; <<4 x float>> [#uses=1]
- ret <4 x float> %B
-}
-
-define float @fp_mul_sub(float %arg1, float %arg2, float %arg3) {
- %A = mul float %arg1, %arg2 ; <float> [#uses=1]
- %B = sub float %A, %arg3 ; <float> [#uses=1]
- ret float %B
-}
-
-define <4 x float> @fp_mul_sub_vec(<4 x float> %arg1, <4 x float> %arg2, <4 x float> %arg3) {
- %A = mul <4 x float> %arg1, %arg2 ; <<4 x float>> [#uses=1]
- %B = sub <4 x float> %A, %arg3 ; <<4 x float>> [#uses=1]
- ret <4 x float> %B
-}
-
-; Test the straightforward way of getting fnms
-; c - a * b
-define float @fp_neg_mul_sub_1(float %arg1, float %arg2, float %arg3) {
- %A = mul float %arg1, %arg2
- %B = sub float %arg3, %A
- ret float %B
-}
-
-; Test another way of getting fnms
-; - ( a *b -c ) = c - a * b
-define float @fp_neg_mul_sub_2(float %arg1, float %arg2, float %arg3) {
- %A = mul float %arg1, %arg2
- %B = sub float %A, %arg3
- %C = sub float -0.0, %B
- ret float %C
-}
-
-define <4 x float> @fp_neg_mul_sub_vec(<4 x float> %arg1, <4 x float> %arg2, <4 x float> %arg3) {
- %A = mul <4 x float> %arg1, %arg2
- %B = sub <4 x float> %A, %arg3
- %D = sub <4 x float> < float -0.0, float -0.0, float -0.0, float -0.0 >, %B
- ret <4 x float> %D
-}
diff --git a/release_23/test/CodeGen/CellSPU/struct_1.ll b/release_23/test/CodeGen/CellSPU/struct_1.ll
deleted file mode 100644
index 3df7267ff27f..000000000000
--- a/release_23/test/CodeGen/CellSPU/struct_1.ll
+++ /dev/null
@@ -1,144 +0,0 @@
-; RUN: llvm-as -o - %s | llc -march=cellspu > %t1.s
-; RUN: llvm-as -o - %s | llc -march=cellspu -mattr=large_mem > %t2.s
-; RUN: grep lqa %t1.s | count 5
-; RUN: grep lqd %t1.s | count 11
-; RUN: grep rotqbyi %t1.s | count 7
-; RUN: grep xshw %t1.s | count 1
-; RUN: grep andi %t1.s | count 5
-; RUN: grep cbd %t1.s | count 3
-; RUN: grep chd %t1.s | count 1
-; RUN: grep cwd %t1.s | count 3
-; RUN: grep shufb %t1.s | count 7
-; RUN: grep stqd %t1.s | count 7
-; RUN: grep iohl %t2.s | count 16
-; RUN: grep ilhu %t2.s | count 16
-; RUN: grep lqd %t2.s | count 16
-; RUN: grep rotqbyi %t2.s | count 7
-; RUN: grep xshw %t2.s | count 1
-; RUN: grep andi %t2.s | count 5
-; RUN: grep cbd %t2.s | count 3
-; RUN: grep chd %t2.s | count 1
-; RUN: grep cwd %t2.s | count 3
-; RUN: grep shufb %t2.s | count 7
-; RUN: grep stqd %t2.s | count 7
-
-; ModuleID = 'struct_1.bc'
-target datalayout = "E-p:32:32:128-f64:64:128-f32:32:128-i64:32:128-i32:32:128-i16:16:128-i8:8:128-i1:8:128-a0:0:128-v128:128:128-s0:128:128"
-target triple = "spu"
-
-; struct hackstate {
-; unsigned char c1; // offset 0 (rotate left by 13 bytes to byte 3)
-; unsigned char c2; // offset 1 (rotate left by 14 bytes to byte 3)
-; unsigned char c3; // offset 2 (rotate left by 15 bytes to byte 3)
-; int i1; // offset 4 (rotate left by 4 bytes to byte 0)
-; short s1; // offset 8 (rotate left by 6 bytes to byte 2)
-; int i2; // offset 12 [ignored]
-; unsigned char c4; // offset 16 [ignored]
-; unsigned char c5; // offset 17 [ignored]
-; unsigned char c6; // offset 18 [ignored]
-; unsigned char c7; // offset 19 (no rotate, in preferred slot)
-; int i3; // offset 20 [ignored]
-; int i4; // offset 24 [ignored]
-; int i5; // offset 28 [ignored]
-; int i6; // offset 32 (no rotate, in preferred slot)
-; }
-%struct.hackstate = type { i8, i8, i8, i32, i16, i32, i8, i8, i8, i8, i32, i32, i32, i32 }
-
-; struct hackstate state = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
-@state = global %struct.hackstate zeroinitializer, align 16
-
-define i8 @get_hackstate_c1() zeroext nounwind {
-entry:
- %tmp2 = load i8* getelementptr (%struct.hackstate* @state, i32 0, i32 0), align 16
- ret i8 %tmp2
-}
-
-define i8 @get_hackstate_c2() zeroext nounwind {
-entry:
- %tmp2 = load i8* getelementptr (%struct.hackstate* @state, i32 0, i32 1), align 16
- ret i8 %tmp2
-}
-
-define i8 @get_hackstate_c3() zeroext nounwind {
-entry:
- %tmp2 = load i8* getelementptr (%struct.hackstate* @state, i32 0, i32 2), align 16
- ret i8 %tmp2
-}
-
-define i32 @get_hackstate_i1() nounwind {
-entry:
- %tmp2 = load i32* getelementptr (%struct.hackstate* @state, i32 0, i32 3), align 16
- ret i32 %tmp2
-}
-
-define i16 @get_hackstate_s1() signext nounwind {
-entry:
- %tmp2 = load i16* getelementptr (%struct.hackstate* @state, i32 0, i32 4), align 16
- ret i16 %tmp2
-}
-
-define i8 @get_hackstate_c6() zeroext nounwind {
-entry:
- %tmp2 = load i8* getelementptr (%struct.hackstate* @state, i32 0, i32 8), align 16
- ret i8 %tmp2
-}
-
-define i8 @get_hackstate_c7() zeroext nounwind {
-entry:
- %tmp2 = load i8* getelementptr (%struct.hackstate* @state, i32 0, i32 9), align 16
- ret i8 %tmp2
-}
-
-define i32 @get_hackstate_i3() nounwind {
-entry:
- %tmp2 = load i32* getelementptr (%struct.hackstate* @state, i32 0, i32 10), align 16
- ret i32 %tmp2
-}
-
-define i32 @get_hackstate_i6() nounwind {
-entry:
- %tmp2 = load i32* getelementptr (%struct.hackstate* @state, i32 0, i32 13), align 16
- ret i32 %tmp2
-}
-
-define void @set_hackstate_c1(i8 zeroext %c) nounwind {
-entry:
- store i8 %c, i8* getelementptr (%struct.hackstate* @state, i32 0, i32 0), align 16
- ret void
-}
-
-define void @set_hackstate_c2(i8 zeroext %c) nounwind {
-entry:
- store i8 %c, i8* getelementptr (%struct.hackstate* @state, i32 0, i32 1), align 16
- ret void
-}
-
-define void @set_hackstate_c3(i8 zeroext %c) nounwind {
-entry:
- store i8 %c, i8* getelementptr (%struct.hackstate* @state, i32 0, i32 2), align 16
- ret void
-}
-
-define void @set_hackstate_i1(i32 %i) nounwind {
-entry:
- store i32 %i, i32* getelementptr (%struct.hackstate* @state, i32 0, i32 3), align 16
- ret void
-}
-
-define void @set_hackstate_s1(i16 signext %s) nounwind {
-entry:
- store i16 %s, i16* getelementptr (%struct.hackstate* @state, i32 0, i32 4), align 16
- ret void
-}
-
-define void @set_hackstate_i3(i32 %i) nounwind {
-entry:
- store i32 %i, i32* getelementptr (%struct.hackstate* @state, i32 0, i32 10), align 16
- ret void
-}
-
-define void @set_hackstate_i6(i32 %i) nounwind {
-entry:
- store i32 %i, i32* getelementptr (%struct.hackstate* @state, i32 0, i32 13), align 16
- ret void
-}
diff --git a/release_23/test/CodeGen/CellSPU/vec_const.ll b/release_23/test/CodeGen/CellSPU/vec_const.ll
deleted file mode 100644
index f604100c4c8c..000000000000
--- a/release_23/test/CodeGen/CellSPU/vec_const.ll
+++ /dev/null
@@ -1,154 +0,0 @@
-; RUN: llvm-as -o - %s | llc -march=cellspu > %t1.s
-; RUN: llvm-as -o - %s | llc -march=cellspu -mattr=large_mem > %t2.s
-; RUN: grep il %t1.s | count 16
-; RUN: grep ilhu %t1.s | count 8
-; RUN: grep ilh %t1.s | count 13
-; RUN: grep iohl %t1.s | count 7
-; RUN: grep lqa %t1.s | count 6
-; RUN: grep 24672 %t1.s | count 2
-; RUN: grep 16429 %t1.s | count 1
-; RUN: grep 63572 %t1.s | count 1
-; RUN: grep 4660 %t1.s | count 1
-; RUN: grep 22136 %t1.s | count 1
-; RUN: grep 43981 %t1.s | count 1
-; RUN: grep 61202 %t1.s | count 1
-; RUN: grep 16393 %t1.s | count 1
-; RUN: grep 8699 %t1.s | count 1
-; RUN: grep 21572 %t1.s | count 1
-; RUN: grep 11544 %t1.s | count 1
-; RUN: grep 1311768467750121234 %t1.s | count 1
-; RUN: grep lqd %t2.s | count 6
-
-target datalayout = "E-p:32:32:128-f64:64:128-f32:32:128-i64:32:128-i32:32:128-i16:16:128-i8:8:128-i1:8:128-a0:0:128-v128:128:128"
-target triple = "spu-unknown-elf"
-
-; Vector constant load tests:
-
-; IL <reg>, 2
-define <4 x i32> @v4i32_constvec() {
- ret <4 x i32> < i32 2, i32 2, i32 2, i32 2 >
-}
-
-; Spill to constant pool
-define <4 x i32> @v4i32_constpool() {
- ret <4 x i32> < i32 2, i32 1, i32 1, i32 2 >
-}
-
-; Max negative range for IL
-define <4 x i32> @v4i32_constvec_2() {
- ret <4 x i32> < i32 -32768, i32 -32768, i32 -32768, i32 -32768 >
-}
-
-; ILHU <reg>, 73 (0x49)
-; 4784128 = 0x490000
-define <4 x i32> @v4i32_constvec_3() {
- ret <4 x i32> < i32 4784128, i32 4784128,
- i32 4784128, i32 4784128 >
-}
-
-; ILHU <reg>, 61 (0x3d)
-; IOHL <reg>, 15395 (0x3c23)
-define <4 x i32> @v4i32_constvec_4() {
- ret <4 x i32> < i32 4013091, i32 4013091,
- i32 4013091, i32 4013091 >
-}
-
-; ILHU <reg>, 0x5050 (20560)
-; IOHL <reg>, 0x5050 (20560)
-; Tests for whether we expand the size of the bit pattern properly, because
-; this could be interpreted as an i8 pattern (0x50)
-define <4 x i32> @v4i32_constvec_5() {
- ret <4 x i32> < i32 1347440720, i32 1347440720,
- i32 1347440720, i32 1347440720 >
-}
-
-; ILH
-define <8 x i16> @v8i16_constvec_1() {
- ret <8 x i16> < i16 32767, i16 32767, i16 32767, i16 32767,
- i16 32767, i16 32767, i16 32767, i16 32767 >
-}
-
-; ILH
-define <8 x i16> @v8i16_constvec_2() {
- ret <8 x i16> < i16 511, i16 511, i16 511, i16 511, i16 511,
- i16 511, i16 511, i16 511 >
-}
-
-; ILH
-define <8 x i16> @v8i16_constvec_3() {
- ret <8 x i16> < i16 -512, i16 -512, i16 -512, i16 -512, i16 -512,
- i16 -512, i16 -512, i16 -512 >
-}
-
-; ILH <reg>, 24672 (0x6060)
-; Tests whether we expand the size of the bit pattern properly, because
-; this could be interpreted as an i8 pattern (0x60)
-define <8 x i16> @v8i16_constvec_4() {
- ret <8 x i16> < i16 24672, i16 24672, i16 24672, i16 24672, i16 24672,
- i16 24672, i16 24672, i16 24672 >
-}
-
-; ILH <reg>, 24672 (0x6060)
-; Tests whether we expand the size of the bit pattern properly, because
-; this is an i8 pattern but has to be expanded out to i16 to load it
-; properly into the vector register.
-define <16 x i8> @v16i8_constvec_1() {
- ret <16 x i8> < i8 96, i8 96, i8 96, i8 96, i8 96, i8 96, i8 96, i8 96,
- i8 96, i8 96, i8 96, i8 96, i8 96, i8 96, i8 96, i8 96 >
-}
-
-define <4 x float> @v4f32_constvec_1() {
-entry:
- ret <4 x float> < float 0x4005BF0A80000000,
- float 0x4005BF0A80000000,
- float 0x4005BF0A80000000,
- float 0x4005BF0A80000000 >
-}
-
-define <4 x float> @v4f32_constvec_2() {
-entry:
- ret <4 x float> < float 0.000000e+00,
- float 0.000000e+00,
- float 0.000000e+00,
- float 0.000000e+00 >
-}
-
-
-define <4 x float> @v4f32_constvec_3() {
-entry:
- ret <4 x float> < float 0x4005BF0A80000000,
- float 0x3810000000000000,
- float 0x47EFFFFFE0000000,
- float 0x400921FB60000000 >
-}
-
-; 1311768467750121234 => 0x 12345678 abcdef12
-; HI32_hi: 4660
-; HI32_lo: 22136
-; LO32_hi: 43981
-; LO32_lo: 61202
-define <2 x i64> @i64_constvec_1() {
-entry:
- ret <2 x i64> < i64 1311768467750121234,
- i64 1311768467750121234 >
-}
-
-define <2 x i64> @i64_constvec_2() {
-entry:
- ret <2 x i64> < i64 1, i64 1311768467750121234 >
-}
-
-define <2 x double> @f64_constvec_1() {
-entry:
- ret <2 x double> < double 0x400921fb54442d18,
- double 0xbff6a09e667f3bcd >
-}
-
-; 0x400921fb 54442d18 ->
-; (ILHU 0x4009 [16393]/IOHL 0x21fb [ 8699])
-; (ILHU 0x5444 [21572]/IOHL 0x2d18 [11544])
-define <2 x double> @f64_constvec_2() {
-entry:
- ret <2 x double> < double 0x400921fb54442d18,
- double 0x400921fb54442d18 >
-}
diff --git a/release_23/test/CodeGen/CellSPU/vecinsert.ll b/release_23/test/CodeGen/CellSPU/vecinsert.ll
deleted file mode 100644
index 9864c5384939..000000000000
--- a/release_23/test/CodeGen/CellSPU/vecinsert.ll
+++ /dev/null
@@ -1,53 +0,0 @@
-; RUN: llvm-as -o - %s | llc -march=cellspu > %t1.s
-; RUN: grep cbd %t1.s | count 3
-; RUN: grep chd %t1.s | count 3
-; RUN: grep cwd %t1.s | count 6
-; RUN: grep il %t1.s | count 4
-; RUN: grep ilh %t1.s | count 3
-; RUN: grep iohl %t1.s | count 1
-; RUN: grep ilhu %t1.s | count 1
-; RUN: grep shufb %t1.s | count 12
-; RUN: grep 17219 %t1.s | count 1
-; RUN: grep 22598 %t1.s | count 1
-; RUN: grep -- -39 %t1.s | count 1
-; RUN: grep 24 %t1.s | count 1
-; RUN: grep 1159 %t1.s | count 1
-; ModuleID = 'vecinsert.bc'
-target datalayout = "E-p:32:32:128-f64:64:128-f32:32:128-i64:32:128-i32:32:128-i16:16:128-i8:8:128-i1:8:128-a0:0:128-v128:128:128"
-target triple = "spu-unknown-elf"
-
-; 67 -> 0x43, as 8-bit vector constant load = 0x4343 (17219)0x4343
-define <16 x i8> @test_v16i8(<16 x i8> %P, i8 %x) {
-entry:
- %tmp1 = insertelement <16 x i8> %P, i8 %x, i32 10
- %tmp1.1 = insertelement <16 x i8> %tmp1, i8 67, i32 7
- %tmp1.2 = insertelement <16 x i8> %tmp1.1, i8 %x, i32 15
- ret <16 x i8> %tmp1.2
-}
-
-; 22598 -> 0x5846
-define <8 x i16> @test_v8i16(<8 x i16> %P, i16 %x) {
-entry:
- %tmp1 = insertelement <8 x i16> %P, i16 %x, i32 5
- %tmp1.1 = insertelement <8 x i16> %tmp1, i16 22598, i32 7
- %tmp1.2 = insertelement <8 x i16> %tmp1.1, i16 %x, i32 2
- ret <8 x i16> %tmp1.2
-}
-
-; 1574023 -> 0x180487 (ILHU 24/IOHL 1159)
-define <4 x i32> @test_v4i32_1(<4 x i32> %P, i32 %x) {
-entry:
- %tmp1 = insertelement <4 x i32> %P, i32 %x, i32 2
- %tmp1.1 = insertelement <4 x i32> %tmp1, i32 1574023, i32 1
- %tmp1.2 = insertelement <4 x i32> %tmp1.1, i32 %x, i32 3
- ret <4 x i32> %tmp1.2
-}
-
-; Should generate IL for the load
-define <4 x i32> @test_v4i32_2(<4 x i32> %P, i32 %x) {
-entry:
- %tmp1 = insertelement <4 x i32> %P, i32 %x, i32 2
- %tmp1.1 = insertelement <4 x i32> %tmp1, i32 -39, i32 1
- %tmp1.2 = insertelement <4 x i32> %tmp1.1, i32 %x, i32 3
- ret <4 x i32> %tmp1.2
-}
diff --git a/release_23/test/CodeGen/Generic/2002-04-14-UnexpectedUnsignedType.ll b/release_23/test/CodeGen/Generic/2002-04-14-UnexpectedUnsignedType.ll
deleted file mode 100644
index 879c4c8baa1b..000000000000
--- a/release_23/test/CodeGen/Generic/2002-04-14-UnexpectedUnsignedType.ll
+++ /dev/null
@@ -1,13 +0,0 @@
-; RUN: llvm-as < %s -o - | llc
-
-; This caused the backend to assert out with:
-; SparcInstrInfo.cpp:103: failed assertion `0 && "Unexpected unsigned type"'
-;
-
-declare void @bar(i8*)
-
-define void @foo() {
- %cast225 = inttoptr i64 123456 to i8* ; <i8*> [#uses=1]
- call void @bar( i8* %cast225 )
- ret void
-}
diff --git a/release_23/test/CodeGen/Generic/2002-04-16-StackFrameSizeAlignment.ll b/release_23/test/CodeGen/Generic/2002-04-16-StackFrameSizeAlignment.ll
deleted file mode 100644
index d77b9e15596e..000000000000
--- a/release_23/test/CodeGen/Generic/2002-04-16-StackFrameSizeAlignment.ll
+++ /dev/null
@@ -1,14 +0,0 @@
-; RUN: llvm-as < %s | llc
-
-; Compiling this file produces:
-; Sparc.cpp:91: failed assertion `(offset - OFFSET) % getStackFrameSizeAlignment() == 0'
-;
-declare i32 @SIM(i8*, i8*, i32, i32, i32, [256 x i32]*, i32, i32, i32)
-
-define void @foo() {
-bb0:
- %V = alloca [256 x i32], i32 256 ; <[256 x i32]*> [#uses=1]
- call i32 @SIM( i8* null, i8* null, i32 0, i32 0, i32 0, [256 x i32]* %V, i32 0, i32 0, i32 2 ) ; <i32>:0 [#uses=0]
- ret void
-}
-
diff --git a/release_23/test/CodeGen/Generic/2003-05-27-phifcmpd.ll b/release_23/test/CodeGen/Generic/2003-05-27-phifcmpd.ll
deleted file mode 100644
index cf17ef455418..000000000000
--- a/release_23/test/CodeGen/Generic/2003-05-27-phifcmpd.ll
+++ /dev/null
@@ -1,19 +0,0 @@
-; RUN: llvm-as < %s | llc
-
-define void @QRiterate(i32 %p.1, double %tmp.212) {
-entry:
- %tmp.184 = icmp sgt i32 %p.1, 0 ; <i1> [#uses=1]
- br i1 %tmp.184, label %shortcirc_next.1, label %shortcirc_done.1
-
-shortcirc_next.1: ; preds = %shortcirc_done.1, %entry
- %tmp.213 = fcmp une double %tmp.212, 0.000000e+00 ; <i1> [#uses=1]
- br label %shortcirc_done.1
-
-shortcirc_done.1: ; preds = %shortcirc_next.1, %entry
- %val.1 = phi i1 [ false, %entry ], [ %tmp.213, %shortcirc_next.1 ] ; <i1> [#uses=1]
- br i1 %val.1, label %shortcirc_next.1, label %exit.1
-
-exit.1: ; preds = %shortcirc_done.1
- ret void
-}
-
diff --git a/release_23/test/CodeGen/Generic/2003-05-27-useboolinotherbb.ll b/release_23/test/CodeGen/Generic/2003-05-27-useboolinotherbb.ll
deleted file mode 100644
index 03b2a1684670..000000000000
--- a/release_23/test/CodeGen/Generic/2003-05-27-useboolinotherbb.ll
+++ /dev/null
@@ -1,13 +0,0 @@
-; RUN: llvm-as < %s | llc
-
-define void @QRiterate(double %tmp.212) {
- %tmp.213 = fcmp une double %tmp.212, 0.000000e+00 ; <i1> [#uses=1]
- br label %shortcirc_next.1
-
-shortcirc_next.1: ; preds = %shortcirc_next.1, %0
- br i1 %tmp.213, label %shortcirc_next.1, label %exit.1
-
-exit.1: ; preds = %shortcirc_next.1
- ret void
-}
-
diff --git a/release_23/test/CodeGen/Generic/2003-05-27-usefsubasbool.ll b/release_23/test/CodeGen/Generic/2003-05-27-usefsubasbool.ll
deleted file mode 100644
index b456eebea2c2..000000000000
--- a/release_23/test/CodeGen/Generic/2003-05-27-usefsubasbool.ll
+++ /dev/null
@@ -1,14 +0,0 @@
-; RUN: llvm-as < %s | llc
-
-define void @QRiterate(double %tmp.212) {
-entry:
- br label %shortcirc_next.1
-
-shortcirc_next.1: ; preds = %shortcirc_next.1, %entry
- %tmp.213 = fcmp une double %tmp.212, 0.000000e+00 ; <i1> [#uses=1]
- br i1 %tmp.213, label %shortcirc_next.1, label %exit.1
-
-exit.1: ; preds = %shortcirc_next.1
- ret void
-}
-
diff --git a/release_23/test/CodeGen/Generic/2003-05-28-ManyArgs.ll b/release_23/test/CodeGen/Generic/2003-05-28-ManyArgs.ll
deleted file mode 100644
index 595700ad183e..000000000000
--- a/release_23/test/CodeGen/Generic/2003-05-28-ManyArgs.ll
+++ /dev/null
@@ -1,153 +0,0 @@
-; RUN: llvm-as < %s | llc
-
-;; Date: May 28, 2003.
-;; From: test/Programs/External/SPEC/CINT2000/175.vpr.llvm.bc
-;; Function: int %main(int %argc.1, sbyte** %argv.1)
-;;
-;; Error: A function call with about 56 arguments causes an assertion failure
-;; in llc because the register allocator cannot find a register
-;; not used explicitly by the call instruction.
-;;
-;; Cause: Regalloc was not keeping track of free registers correctly.
-;; It was counting the registers allocated to all outgoing arguments,
-;; even though most of those are copied to the stack (so those
-;; registers are not actually used by the call instruction).
-;;
-;; Fixed: By rewriting selection and allocation so that selection explicitly
-;; inserts all copy operations required for passing arguments and
-;; for the return value of a call, copying to/from registers
-;; and/or to stack locations as needed.
-;;
- %struct..s_annealing_sched = type { i32, float, float, float, float }
- %struct..s_chan = type { i32, float, float, float, float }
- %struct..s_det_routing_arch = type { i32, float, float, float, i32, i32, i16, i16, i16, float, float }
- %struct..s_placer_opts = type { i32, float, i32, i32, i8*, i32, i32 }
- %struct..s_router_opts = type { float, float, float, float, float, i32, i32, i32, i32 }
- %struct..s_segment_inf = type { float, i32, i16, i16, float, float, i32, float, float }
- %struct..s_switch_inf = type { i32, float, float, float, float }
-
-define i32 @main(i32 %argc.1, i8** %argv.1) {
-entry:
- %net_file = alloca [300 x i8] ; <[300 x i8]*> [#uses=1]
- %place_file = alloca [300 x i8] ; <[300 x i8]*> [#uses=1]
- %arch_file = alloca [300 x i8] ; <[300 x i8]*> [#uses=1]
- %route_file = alloca [300 x i8] ; <[300 x i8]*> [#uses=1]
- %full_stats = alloca i32 ; <i32*> [#uses=1]
- %operation = alloca i32 ; <i32*> [#uses=1]
- %verify_binary_search = alloca i32 ; <i32*> [#uses=1]
- %show_graphics = alloca i32 ; <i32*> [#uses=1]
- %annealing_sched = alloca %struct..s_annealing_sched ; <%struct..s_annealing_sched*> [#uses=5]
- %placer_opts = alloca %struct..s_placer_opts ; <%struct..s_placer_opts*> [#uses=7]
- %router_opts = alloca %struct..s_router_opts ; <%struct..s_router_opts*> [#uses=9]
- %det_routing_arch = alloca %struct..s_det_routing_arch ; <%struct..s_det_routing_arch*> [#uses=11]
- %segment_inf = alloca %struct..s_segment_inf* ; <%struct..s_segment_inf**> [#uses=1]
- %timing_inf = alloca { i32, float, float, float, float, float, float, float, float, float, float } ; <{ i32, float, float, float, float, float, float, float, float, float, float }*> [#uses=11]
- %tmp.101 = getelementptr %struct..s_placer_opts* %placer_opts, i64 0, i32 4 ; <i8**> [#uses=1]
- %tmp.105 = getelementptr [300 x i8]* %net_file, i64 0, i64 0 ; <i8*> [#uses=1]
- %tmp.106 = getelementptr [300 x i8]* %arch_file, i64 0, i64 0 ; <i8*> [#uses=1]
- %tmp.107 = getelementptr [300 x i8]* %place_file, i64 0, i64 0 ; <i8*> [#uses=1]
- %tmp.108 = getelementptr [300 x i8]* %route_file, i64 0, i64 0 ; <i8*> [#uses=1]
- %tmp.109 = getelementptr { i32, float, float, float, float, float, float, float, float, float, float }* %timing_inf, i64 0, i32 0 ; <i32*> [#uses=1]
- %tmp.112 = getelementptr %struct..s_placer_opts* %placer_opts, i64 0, i32 0 ; <i32*> [#uses=1]
- %tmp.114 = getelementptr %struct..s_placer_opts* %placer_opts, i64 0, i32 6 ; <i32*> [#uses=1]
- %tmp.118 = getelementptr %struct..s_router_opts* %router_opts, i64 0, i32 7 ; <i32*> [#uses=1]
- %tmp.135 = load i32* %operation ; <i32> [#uses=1]
- %tmp.137 = load i32* %tmp.112 ; <i32> [#uses=1]
- %tmp.138 = getelementptr %struct..s_placer_opts* %placer_opts, i64 0, i32 1 ; <float*> [#uses=1]
- %tmp.139 = load float* %tmp.138 ; <float> [#uses=1]
- %tmp.140 = getelementptr %struct..s_placer_opts* %placer_opts, i64 0, i32 2 ; <i32*> [#uses=1]
- %tmp.141 = load i32* %tmp.140 ; <i32> [#uses=1]
- %tmp.142 = getelementptr %struct..s_placer_opts* %placer_opts, i64 0, i32 3 ; <i32*> [#uses=1]
- %tmp.143 = load i32* %tmp.142 ; <i32> [#uses=1]
- %tmp.145 = load i8** %tmp.101 ; <i8*> [#uses=1]
- %tmp.146 = getelementptr %struct..s_placer_opts* %placer_opts, i64 0, i32 5 ; <i32*> [#uses=1]
- %tmp.147 = load i32* %tmp.146 ; <i32> [#uses=1]
- %tmp.149 = load i32* %tmp.114 ; <i32> [#uses=1]
- %tmp.154 = load i32* %full_stats ; <i32> [#uses=1]
- %tmp.155 = load i32* %verify_binary_search ; <i32> [#uses=1]
- %tmp.156 = getelementptr %struct..s_annealing_sched* %annealing_sched, i64 0, i32 0 ; <i32*> [#uses=1]
- %tmp.157 = load i32* %tmp.156 ; <i32> [#uses=1]
- %tmp.158 = getelementptr %struct..s_annealing_sched* %annealing_sched, i64 0, i32 1 ; <float*> [#uses=1]
- %tmp.159 = load float* %tmp.158 ; <float> [#uses=1]
- %tmp.160 = getelementptr %struct..s_annealing_sched* %annealing_sched, i64 0, i32 2 ; <float*> [#uses=1]
- %tmp.161 = load float* %tmp.160 ; <float> [#uses=1]
- %tmp.162 = getelementptr %struct..s_annealing_sched* %annealing_sched, i64 0, i32 3 ; <float*> [#uses=1]
- %tmp.163 = load float* %tmp.162 ; <float> [#uses=1]
- %tmp.164 = getelementptr %struct..s_annealing_sched* %annealing_sched, i64 0, i32 4 ; <float*> [#uses=1]
- %tmp.165 = load float* %tmp.164 ; <float> [#uses=1]
- %tmp.166 = getelementptr %struct..s_router_opts* %router_opts, i64 0, i32 0 ; <float*> [#uses=1]
- %tmp.167 = load float* %tmp.166 ; <float> [#uses=1]
- %tmp.168 = getelementptr %struct..s_router_opts* %router_opts, i64 0, i32 1 ; <float*> [#uses=1]
- %tmp.169 = load float* %tmp.168 ; <float> [#uses=1]
- %tmp.170 = getelementptr %struct..s_router_opts* %router_opts, i64 0, i32 2 ; <float*> [#uses=1]
- %tmp.171 = load float* %tmp.170 ; <float> [#uses=1]
- %tmp.172 = getelementptr %struct..s_router_opts* %router_opts, i64 0, i32 3 ; <float*> [#uses=1]
- %tmp.173 = load float* %tmp.172 ; <float> [#uses=1]
- %tmp.174 = getelementptr %struct..s_router_opts* %router_opts, i64 0, i32 4 ; <float*> [#uses=1]
- %tmp.175 = load float* %tmp.174 ; <float> [#uses=1]
- %tmp.176 = getelementptr %struct..s_router_opts* %router_opts, i64 0, i32 5 ; <i32*> [#uses=1]
- %tmp.177 = load i32* %tmp.176 ; <i32> [#uses=1]
- %tmp.178 = getelementptr %struct..s_router_opts* %router_opts, i64 0, i32 6 ; <i32*> [#uses=1]
- %tmp.179 = load i32* %tmp.178 ; <i32> [#uses=1]
- %tmp.181 = load i32* %tmp.118 ; <i32> [#uses=1]
- %tmp.182 = getelementptr %struct..s_router_opts* %router_opts, i64 0, i32 8 ; <i32*> [#uses=1]
- %tmp.183 = load i32* %tmp.182 ; <i32> [#uses=1]
- %tmp.184 = getelementptr %struct..s_det_routing_arch* %det_routing_arch, i64 0, i32 0 ; <i32*> [#uses=1]
- %tmp.185 = load i32* %tmp.184 ; <i32> [#uses=1]
- %tmp.186 = getelementptr %struct..s_det_routing_arch* %det_routing_arch, i64 0, i32 1 ; <float*> [#uses=1]
- %tmp.187 = load float* %tmp.186 ; <float> [#uses=1]
- %tmp.188 = getelementptr %struct..s_det_routing_arch* %det_routing_arch, i64 0, i32 2 ; <float*> [#uses=1]
- %tmp.189 = load float* %tmp.188 ; <float> [#uses=1]
- %tmp.190 = getelementptr %struct..s_det_routing_arch* %det_routing_arch, i64 0, i32 3 ; <float*> [#uses=1]
- %tmp.191 = load float* %tmp.190 ; <float> [#uses=1]
- %tmp.192 = getelementptr %struct..s_det_routing_arch* %det_routing_arch, i64 0, i32 4 ; <i32*> [#uses=1]
- %tmp.193 = load i32* %tmp.192 ; <i32> [#uses=1]
- %tmp.194 = getelementptr %struct..s_det_routing_arch* %det_routing_arch, i64 0, i32 5 ; <i32*> [#uses=1]
- %tmp.195 = load i32* %tmp.194 ; <i32> [#uses=1]
- %tmp.196 = getelementptr %struct..s_det_routing_arch* %det_routing_arch, i64 0, i32 6 ; <i16*> [#uses=1]
- %tmp.197 = load i16* %tmp.196 ; <i16> [#uses=1]
- %tmp.198 = getelementptr %struct..s_det_routing_arch* %det_routing_arch, i64 0, i32 7 ; <i16*> [#uses=1]
- %tmp.199 = load i16* %tmp.198 ; <i16> [#uses=1]
- %tmp.200 = getelementptr %struct..s_det_routing_arch* %det_routing_arch, i64 0, i32 8 ; <i16*> [#uses=1]
- %tmp.201 = load i16* %tmp.200 ; <i16> [#uses=1]
- %tmp.202 = getelementptr %struct..s_det_routing_arch* %det_routing_arch, i64 0, i32 9 ; <float*> [#uses=1]
- %tmp.203 = load float* %tmp.202 ; <float> [#uses=1]
- %tmp.204 = getelementptr %struct..s_det_routing_arch* %det_routing_arch, i64 0, i32 10 ; <float*> [#uses=1]
- %tmp.205 = load float* %tmp.204 ; <float> [#uses=1]
- %tmp.206 = load %struct..s_segment_inf** %segment_inf ; <%struct..s_segment_inf*> [#uses=1]
- %tmp.208 = load i32* %tmp.109 ; <i32> [#uses=1]
- %tmp.209 = getelementptr { i32, float, float, float, float, float, float, float, float, float, float }* %timing_inf, i64 0, i32 1 ; <float*> [#uses=1]
- %tmp.210 = load float* %tmp.209 ; <float> [#uses=1]
- %tmp.211 = getelementptr { i32, float, float, float, float, float, float, float, float, float, float }* %timing_inf, i64 0, i32 2 ; <float*> [#uses=1]
- %tmp.212 = load float* %tmp.211 ; <float> [#uses=1]
- %tmp.213 = getelementptr { i32, float, float, float, float, float, float, float, float, float, float }* %timing_inf, i64 0, i32 3 ; <float*> [#uses=1]
- %tmp.214 = load float* %tmp.213 ; <float> [#uses=1]
- %tmp.215 = getelementptr { i32, float, float, float, float, float, float, float, float, float, float }* %timing_inf, i64 0, i32 4 ; <float*> [#uses=1]
- %tmp.216 = load float* %tmp.215 ; <float> [#uses=1]
- %tmp.217 = getelementptr { i32, float, float, float, float, float, float, float, float, float, float }* %timing_inf, i64 0, i32 5 ; <float*> [#uses=1]
- %tmp.218 = load float* %tmp.217 ; <float> [#uses=1]
- %tmp.219 = getelementptr { i32, float, float, float, float, float, float, float, float, float, float }* %timing_inf, i64 0, i32 6 ; <float*> [#uses=1]
- %tmp.220 = load float* %tmp.219 ; <float> [#uses=1]
- %tmp.221 = getelementptr { i32, float, float, float, float, float, float, float, float, float, float }* %timing_inf, i64 0, i32 7 ; <float*> [#uses=1]
- %tmp.222 = load float* %tmp.221 ; <float> [#uses=1]
- %tmp.223 = getelementptr { i32, float, float, float, float, float, float, float, float, float, float }* %timing_inf, i64 0, i32 8 ; <float*> [#uses=1]
- %tmp.224 = load float* %tmp.223 ; <float> [#uses=1]
- %tmp.225 = getelementptr { i32, float, float, float, float, float, float, float, float, float, float }* %timing_inf, i64 0, i32 9 ; <float*> [#uses=1]
- %tmp.226 = load float* %tmp.225 ; <float> [#uses=1]
- %tmp.227 = getelementptr { i32, float, float, float, float, float, float, float, float, float, float }* %timing_inf, i64 0, i32 10 ; <float*> [#uses=1]
- %tmp.228 = load float* %tmp.227 ; <float> [#uses=1]
- call void @place_and_route( i32 %tmp.135, i32 %tmp.137, float %tmp.139, i32 %tmp.141, i32 %tmp.143, i8* %tmp.145, i32 %tmp.147, i32 %tmp.149, i8* %tmp.107, i8* %tmp.105, i8* %tmp.106, i8* %tmp.108, i32 %tmp.154, i32 %tmp.155, i32 %tmp.157, float %tmp.159, float %tmp.161, float %tmp.163, float %tmp.165, float %tmp.167, float %tmp.169, float %tmp.171, float %tmp.173, float %tmp.175, i32 %tmp.177, i32 %tmp.179, i32 %tmp.181, i32 %tmp.183, i32 %tmp.185, float %tmp.187, float %tmp.189, float %tmp.191, i32 %tmp.193, i32 %tmp.195, i16 %tmp.197, i16 %tmp.199, i16 %tmp.201, float %tmp.203, float %tmp.205, %struct..s_segment_inf* %tmp.206, i32 %tmp.208, float %tmp.210, float %tmp.212, float %tmp.214, float %tmp.216, float %tmp.218, float %tmp.220, float %tmp.222, float %tmp.224, float %tmp.226, float %tmp.228 )
- %tmp.231 = load i32* %show_graphics ; <i32> [#uses=1]
- %tmp.232 = icmp ne i32 %tmp.231, 0 ; <i1> [#uses=1]
- br i1 %tmp.232, label %then.2, label %endif.2
-
-then.2: ; preds = %entry
- br label %endif.2
-
-endif.2: ; preds = %then.2, %entry
- ret i32 0
-}
-
-declare i32 @printf(i8*, ...)
-
-declare void @place_and_route(i32, i32, float, i32, i32, i8*, i32, i32, i8*, i8*, i8*, i8*, i32, i32, i32, float, float, float, float, float, float, float, float, float, i32, i32, i32, i32, i32, float, float, float, i32, i32, i16, i16, i16, float, float, %struct..s_segment_inf*, i32, float, float, float, float, float, float, float, float, float, float)
diff --git a/release_23/test/CodeGen/Generic/2003-05-30-BadFoldGEP.ll b/release_23/test/CodeGen/Generic/2003-05-30-BadFoldGEP.ll
deleted file mode 100644
index 41c90bd29d38..000000000000
--- a/release_23/test/CodeGen/Generic/2003-05-30-BadFoldGEP.ll
+++ /dev/null
@@ -1,39 +0,0 @@
-; RUN: llvm-as < %s | llc
-
-;; Date: May 28, 2003.
-;; From: test/Programs/External/SPEC/CINT2000/254.gap.llvm.bc
-;; Function: int %OpenOutput(sbyte* %filename.1)
-;;
-;; Error: A sequence of GEPs is folded incorrectly by llc during selection
-;; causing an assertion about a dynamic casting error.
-;; This code sequence was produced (correctly) by preselection
-;; from a nested pair of ConstantExpr getelementptrs.
-;; The code below is the output of preselection.
-;; The original ConstantExprs are included in a comment.
-;;
-;; Cause: FoldGetElemChain() was inserting an extra leading 0 even though
-;; the first instruction in the sequence contributes no indices.
-;; The next instruction contributes a leading non-zero so another
-;; zero should not be added before it!
-;;
- %FileType = type { i32, [256 x i8], i32, i32, i32, i32 }
-@OutputFiles = external global [16 x %FileType] ; <[16 x %FileType]*> [#uses=1]
-@Output = internal global %FileType* null ; <%FileType**> [#uses=1]
-
-define internal i32 @OpenOutput(i8* %filename.1) {
-entry:
- %tmp.0 = load %FileType** @Output ; <%FileType*> [#uses=1]
- %tmp.4 = getelementptr %FileType* %tmp.0, i64 1 ; <%FileType*> [#uses=1]
- %addrOfGlobal = getelementptr [16 x %FileType]* @OutputFiles, i64 0 ; <[16 x %FileType]*> [#uses=1]
- %constantGEP = getelementptr [16 x %FileType]* %addrOfGlobal, i64 1 ; <[16 x %FileType]*> [#uses=1]
- %constantGEP.upgrd.1 = getelementptr [16 x %FileType]* %constantGEP, i64 0, i64 0 ; <%FileType*> [#uses=1]
- %tmp.10 = icmp eq %FileType* %tmp.4, %constantGEP.upgrd.1 ; <i1> [#uses=1]
- br i1 %tmp.10, label %return, label %endif.0
-
-endif.0: ; preds = %entry
- ret i32 0
-
-return: ; preds = %entry
- ret i32 1
-}
-
diff --git a/release_23/test/CodeGen/Generic/2003-05-30-BadPreselectPhi.ll b/release_23/test/CodeGen/Generic/2003-05-30-BadPreselectPhi.ll
deleted file mode 100644
index 43bff82ef7cc..000000000000
--- a/release_23/test/CodeGen/Generic/2003-05-30-BadPreselectPhi.ll
+++ /dev/null
@@ -1,33 +0,0 @@
-; RUN: llvm-as < %s | llc
-
-;; Date: May 28, 2003.
-;; From: test/Programs/SingleSource/richards_benchmark.c
-;; Function: struct task *handlerfn(struct packet *pkt)
-;;
-;; Error: PreSelection puts the arguments of the Phi just before
-;; the Phi instead of in predecessor blocks. This later
-;; causes llc to produces an invalid register <NULL VALUE>
-;; for the phi arguments.
-
- %struct..packet = type { %struct..packet*, i32, i32, i32, [4 x i8] }
- %struct..task = type { %struct..task*, i32, i32, %struct..packet*, i32, %struct..task* (%struct..packet*)*, i32, i32 }
-@v1 = external global i32 ; <i32*> [#uses=1]
-@v2 = external global i32 ; <i32*> [#uses=1]
-
-define %struct..task* @handlerfn(%struct..packet* %pkt.2) {
-entry:
- %tmp.1 = icmp ne %struct..packet* %pkt.2, null ; <i1> [#uses=1]
- br i1 %tmp.1, label %cond_false, label %cond_continue
-
-cond_false: ; preds = %entry
- br label %cond_continue
-
-cond_continue: ; preds = %cond_false, %entry
- %mem_tmp.0 = phi i32* [ @v2, %cond_false ], [ @v1, %entry ] ; <i32*> [#uses=1]
- %tmp.12 = bitcast i32* %mem_tmp.0 to %struct..packet* ; <%struct..packet*> [#uses=1]
- call void @append( %struct..packet* %pkt.2, %struct..packet* %tmp.12 )
- ret %struct..task* null
-}
-
-declare void @append(%struct..packet*, %struct..packet*)
-
diff --git a/release_23/test/CodeGen/Generic/2003-07-06-BadIntCmp.ll b/release_23/test/CodeGen/Generic/2003-07-06-BadIntCmp.ll
deleted file mode 100644
index d66ea186e873..000000000000
--- a/release_23/test/CodeGen/Generic/2003-07-06-BadIntCmp.ll
+++ /dev/null
@@ -1,51 +0,0 @@
-; RUN: llvm-as < %s | llc
-
-;; Date: May 28, 2003.
-;; From: test/Programs/MultiSource/Olden-perimeter/maketree.c
-;; Function: int CheckOutside(int x, int y)
-;;
-;; Note: The .ll code below for this regression test has identical
-;; behavior to the above function up to the error, but then prints
-;; true/false on the two branches.
-;;
-;; Error: llc generates a branch-on-xcc instead of branch-on-icc, which
-;; is wrong because the value being compared (int euclid = x*x + y*y)
-;; overflows, so that the 64-bit and 32-bit compares are not equal.
-
-@.str_1 = internal constant [6 x i8] c"true\0A\00" ; <[6 x i8]*> [#uses=1]
-@.str_2 = internal constant [7 x i8] c"false\0A\00" ; <[7 x i8]*> [#uses=1]
-
-declare i32 @printf(i8*, ...)
-
-define internal void @__main() {
-entry:
- ret void
-}
-
-define internal void @CheckOutside(i32 %x.1, i32 %y.1) {
-entry:
- %tmp.2 = mul i32 %x.1, %x.1 ; <i32> [#uses=1]
- %tmp.5 = mul i32 %y.1, %y.1 ; <i32> [#uses=1]
- %tmp.6 = add i32 %tmp.2, %tmp.5 ; <i32> [#uses=1]
- %tmp.8 = icmp sle i32 %tmp.6, 4194304 ; <i1> [#uses=1]
- br i1 %tmp.8, label %then, label %else
-
-then: ; preds = %entry
- %tmp.11 = call i32 (i8*, ...)* @printf( i8* getelementptr ([6 x i8]* @.str_1, i64 0, i64 0) ) ; <i32> [#uses=0]
- br label %UnifiedExitNode
-
-else: ; preds = %entry
- %tmp.13 = call i32 (i8*, ...)* @printf( i8* getelementptr ([7 x i8]* @.str_2, i64 0, i64 0) ) ; <i32> [#uses=0]
- br label %UnifiedExitNode
-
-UnifiedExitNode: ; preds = %else, %then
- ret void
-}
-
-define i32 @main() {
-entry:
- call void @__main( )
- call void @CheckOutside( i32 2097152, i32 2097152 )
- ret i32 0
-}
-
diff --git a/release_23/test/CodeGen/Generic/2003-07-07-BadLongConst.ll b/release_23/test/CodeGen/Generic/2003-07-07-BadLongConst.ll
deleted file mode 100644
index 80738d54370c..000000000000
--- a/release_23/test/CodeGen/Generic/2003-07-07-BadLongConst.ll
+++ /dev/null
@@ -1,20 +0,0 @@
-; RUN: llvm-as < %s | llc
-
-@.str_1 = internal constant [42 x i8] c" ui = %u (0x%x)\09\09UL-ui = %lld (0x%llx)\0A\00" ; <[42 x i8]*> [#uses=1]
-
-declare i32 @printf(i8*, ...)
-
-define internal i64 @getL() {
-entry:
- ret i64 -5787213826675591005
-}
-
-define i32 @main(i32 %argc.1, i8** %argv.1) {
-entry:
- %tmp.11 = call i64 @getL( ) ; <i64> [#uses=2]
- %tmp.5 = trunc i64 %tmp.11 to i32 ; <i32> [#uses=2]
- %tmp.23 = and i64 %tmp.11, -4294967296 ; <i64> [#uses=2]
- %tmp.16 = call i32 (i8*, ...)* @printf( i8* getelementptr ([42 x i8]* @.str_1, i64 0, i64 0), i32 %tmp.5, i32 %tmp.5, i64 %tmp.23, i64 %tmp.23 ) ; <i32> [#uses=0]
- ret i32 0
-}
-
diff --git a/release_23/test/CodeGen/Generic/2003-07-08-BadCastToBool.ll b/release_23/test/CodeGen/Generic/2003-07-08-BadCastToBool.ll
deleted file mode 100644
index 4532b760c707..000000000000
--- a/release_23/test/CodeGen/Generic/2003-07-08-BadCastToBool.ll
+++ /dev/null
@@ -1,34 +0,0 @@
-; RUN: llvm-as < %s | llc
-
-;; Date: Jul 8, 2003.
-;; From: test/Programs/MultiSource/Olden-perimeter
-;; Function: int %adj(uint %d.1, uint %ct.1)
-;;
-;; Errors: (1) cast-int-to-bool was being treated as a NOP (i.e., the int
-;; register was treated as effectively true if non-zero).
-;; This cannot be used for later boolean operations.
-;; (2) (A or NOT(B)) was being folded into A orn B, which is ok
-;; for bitwise operations but not booleans! For booleans,
-;; the result has to be compared with 0.
-
-@.str_1 = internal constant [30 x i8] c"d = %d, ct = %d, d ^ ct = %d\0A\00"
-
-declare i32 @printf(i8*, ...)
-
-define i32 @adj(i32 %d.1, i32 %ct.1) {
-entry:
- %tmp.19 = icmp eq i32 %ct.1, 2 ; <i1> [#uses=1]
- %tmp.22.not = trunc i32 %ct.1 to i1 ; <i1> [#uses=1]
- %tmp.221 = xor i1 %tmp.22.not, true ; <i1> [#uses=1]
- %tmp.26 = or i1 %tmp.19, %tmp.221 ; <i1> [#uses=1]
- %tmp.27 = zext i1 %tmp.26 to i32 ; <i32> [#uses=1]
- ret i32 %tmp.27
-}
-
-define i32 @main() {
-entry:
- %result = call i32 @adj( i32 3, i32 2 ) ; <i32> [#uses=1]
- %tmp.0 = call i32 (i8*, ...)* @printf( i8* getelementptr ([30 x i8]* @.str_1, i64 0, i64 0), i32 3, i32 2, i32 %result ) ; <i32> [#uses=0]
- ret i32 0
-}
-
diff --git a/release_23/test/CodeGen/Generic/2003-07-29-BadConstSbyte.ll b/release_23/test/CodeGen/Generic/2003-07-29-BadConstSbyte.ll
deleted file mode 100644
index 54880db39289..000000000000
--- a/release_23/test/CodeGen/Generic/2003-07-29-BadConstSbyte.ll
+++ /dev/null
@@ -1,40 +0,0 @@
-; RUN: llvm-as < %s | llc
-
-;; Date: Jul 29, 2003.
-;; From: test/Programs/MultiSource/Ptrdist-bc
-;; Function: ---
-;; Global: %yy_ec = internal constant [256 x sbyte] ...
-;; A subset of this array is used in the test below.
-;;
-;; Error: Character '\07' was being emitted as '\a', at yy_ec[38].
-;; When loaded, this returned the value 97 ('a'), instead of 7.
-;;
-;; Incorrect LLC Output for the array yy_ec was:
-;; yy_ec_1094:
-;; .ascii "\000\001\001\001\001\001\001\001\001\002\003\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\002\004\005\001\001\006\a\001\b\t\n\v\f\r\016\017\020\020\020\020\020\020\020\020\020\020\001\021\022\023\024\001\001\025\025\025\025\025\025\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\026\027\030\031\032\001\033\034\035\036\037 !\"#$%&'()*+,-./$0$1$234\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001"
-;;
-
-@yy_ec = internal constant [6 x i8] c"\06\07\01\08\01\09" ; <[6 x i8]*> [#uses=1]
-@.str_3 = internal constant [8 x i8] c"[%d] = \00" ; <[8 x i8]*> [#uses=1]
-@.str_4 = internal constant [4 x i8] c"%d\0A\00" ; <[4 x i8]*> [#uses=1]
-
-declare i32 @printf(i8*, ...)
-
-define i32 @main() {
-entry:
- br label %loopentry
-
-loopentry: ; preds = %loopentry, %entry
- %i = phi i64 [ 0, %entry ], [ %inc.i, %loopentry ] ; <i64> [#uses=3]
- %cptr = getelementptr [6 x i8]* @yy_ec, i64 0, i64 %i ; <i8*> [#uses=1]
- %c = load i8* %cptr ; <i8> [#uses=1]
- %ignore = call i32 (i8*, ...)* @printf( i8* getelementptr ([8 x i8]* @.str_3, i64 0, i64 0), i64 %i ) ; <i32> [#uses=0]
- %ignore2 = call i32 (i8*, ...)* @printf( i8* getelementptr ([4 x i8]* @.str_4, i64 0, i64 0), i8 %c ) ; <i32> [#uses=0]
- %inc.i = add i64 %i, 1 ; <i64> [#uses=2]
- %done = icmp sle i64 %inc.i, 5 ; <i1> [#uses=1]
- br i1 %done, label %loopentry, label %exit.1
-
-exit.1: ; preds = %loopentry
- ret i32 0
-}
-
diff --git a/release_23/test/CodeGen/Generic/2004-02-08-UnwindSupport.ll b/release_23/test/CodeGen/Generic/2004-02-08-UnwindSupport.ll
deleted file mode 100644
index 10d40693d8e5..000000000000
--- a/release_23/test/CodeGen/Generic/2004-02-08-UnwindSupport.ll
+++ /dev/null
@@ -1,17 +0,0 @@
-; RUN: llvm-as < %s | llc -enable-correct-eh-support
-
-define i32 @test() {
- unwind
-}
-
-define i32 @main() {
- %X = invoke i32 @test( )
- to label %cont unwind label %EH ; <i32> [#uses=0]
-
-cont: ; preds = %0
- ret i32 1
-
-EH: ; preds = %0
- ret i32 0
-}
-
diff --git a/release_23/test/CodeGen/Generic/2004-05-09-LiveVarPartialRegister.ll b/release_23/test/CodeGen/Generic/2004-05-09-LiveVarPartialRegister.ll
deleted file mode 100644
index 1f58ce11fe71..000000000000
--- a/release_23/test/CodeGen/Generic/2004-05-09-LiveVarPartialRegister.ll
+++ /dev/null
@@ -1,13 +0,0 @@
-; RUN: llvm-as < %s | llc
-@global_long_1 = linkonce global i64 7 ; <i64*> [#uses=1]
-@global_long_2 = linkonce global i64 49 ; <i64*> [#uses=1]
-
-define i32 @main() {
- %l1 = load i64* @global_long_1 ; <i64> [#uses=1]
- %l2 = load i64* @global_long_2 ; <i64> [#uses=1]
- %cond = icmp sle i64 %l1, %l2 ; <i1> [#uses=1]
- %cast2 = zext i1 %cond to i32 ; <i32> [#uses=1]
- %RV = sub i32 1, %cast2 ; <i32> [#uses=1]
- ret i32 %RV
-}
-
diff --git a/release_23/test/CodeGen/Generic/2005-01-18-SetUO-InfLoop.ll b/release_23/test/CodeGen/Generic/2005-01-18-SetUO-InfLoop.ll
deleted file mode 100644
index ed8b2a22607d..000000000000
--- a/release_23/test/CodeGen/Generic/2005-01-18-SetUO-InfLoop.ll
+++ /dev/null
@@ -1,20 +0,0 @@
-; RUN: llvm-as < %s | llc
-
-define void @intersect_pixel() {
-entry:
- %tmp125 = fcmp uno double 0.000000e+00, 0.000000e+00 ; <i1> [#uses=1]
- %tmp126 = or i1 %tmp125, false ; <i1> [#uses=1]
- %tmp126.not = xor i1 %tmp126, true ; <i1> [#uses=1]
- %brmerge1 = or i1 %tmp126.not, false ; <i1> [#uses=1]
- br i1 %brmerge1, label %bb154, label %cond_false133
-
-cond_false133: ; preds = %entry
- ret void
-
-bb154: ; preds = %entry
- %tmp164 = icmp eq i32 0, 0 ; <i1> [#uses=0]
- ret void
-}
-
-declare i1 @llvm.isunordered.f64(double, double)
-
diff --git a/release_23/test/CodeGen/Generic/2005-04-09-GlobalInPHI.ll b/release_23/test/CodeGen/Generic/2005-04-09-GlobalInPHI.ll
deleted file mode 100644
index 37aaa3237caa..000000000000
--- a/release_23/test/CodeGen/Generic/2005-04-09-GlobalInPHI.ll
+++ /dev/null
@@ -1,20 +0,0 @@
-; RUN: llvm-as < %s | llc
- %struct.TypHeader = type { i32, %struct.TypHeader**, [3 x i8], i8 }
-@.str_67 = external global [4 x i8] ; <[4 x i8]*> [#uses=1]
-@.str_87 = external global [17 x i8] ; <[17 x i8]*> [#uses=1]
-
-define void @PrBinop() {
-entry:
- br i1 false, label %cond_true, label %else.0
-
-cond_true: ; preds = %entry
- br label %else.0
-
-else.0: ; preds = %cond_true, %entry
- %tmp.167.1 = phi i32 [ ptrtoint ([17 x i8]* @.str_87 to i32), %entry ], [ 0, %cond_true ] ; <i32> [#uses=0]
- call void @Pr( i8* getelementptr ([4 x i8]* @.str_67, i32 0, i32 0), i32 0, i32 0 )
- ret void
-}
-
-declare void @Pr(i8*, i32, i32)
-
diff --git a/release_23/test/CodeGen/Generic/2005-07-12-memcpy-i64-length.ll b/release_23/test/CodeGen/Generic/2005-07-12-memcpy-i64-length.ll
deleted file mode 100644
index ab3a31d3c077..000000000000
--- a/release_23/test/CodeGen/Generic/2005-07-12-memcpy-i64-length.ll
+++ /dev/null
@@ -1,11 +0,0 @@
-; RUN: llvm-as < %s | llc
-; Test that llvm.memcpy works with a i64 length operand on all targets.
-
-declare void @llvm.memcpy.i64(i8*, i8*, i64, i32)
-
-define void @l12_l94_bc_divide_endif_2E_3_2E_ce() {
-newFuncRoot:
- tail call void @llvm.memcpy.i64( i8* null, i8* null, i64 0, i32 1 )
- unreachable
-}
-
diff --git a/release_23/test/CodeGen/Generic/2005-10-18-ZeroSizeStackObject.ll b/release_23/test/CodeGen/Generic/2005-10-18-ZeroSizeStackObject.ll
deleted file mode 100644
index b2bea1c6be3b..000000000000
--- a/release_23/test/CodeGen/Generic/2005-10-18-ZeroSizeStackObject.ll
+++ /dev/null
@@ -1,6 +0,0 @@
-; RUN: llvm-as < %s | llc
-
-define void @test() {
- %X = alloca { } ; <{ }*> [#uses=0]
- ret void
-}
diff --git a/release_23/test/CodeGen/Generic/2005-10-21-longlonggtu.ll b/release_23/test/CodeGen/Generic/2005-10-21-longlonggtu.ll
deleted file mode 100644
index b355b026531e..000000000000
--- a/release_23/test/CodeGen/Generic/2005-10-21-longlonggtu.ll
+++ /dev/null
@@ -1,16 +0,0 @@
-; RUN: llvm-as < %s | llc
-
-define float @t(i64 %u_arg) {
- %u = bitcast i64 %u_arg to i64 ; <i64> [#uses=1]
- %tmp5 = add i64 %u, 9007199254740991 ; <i64> [#uses=1]
- %tmp = icmp ugt i64 %tmp5, 18014398509481982 ; <i1> [#uses=1]
- br i1 %tmp, label %T, label %F
-
-T: ; preds = %0
- ret float 1.000000e+00
-
-F: ; preds = %0
- call float @t( i64 0 ) ; <float>:1 [#uses=0]
- ret float 0.000000e+00
-}
-
diff --git a/release_23/test/CodeGen/Generic/2005-12-01-Crash.ll b/release_23/test/CodeGen/Generic/2005-12-01-Crash.ll
deleted file mode 100644
index ee72ee1317b0..000000000000
--- a/release_23/test/CodeGen/Generic/2005-12-01-Crash.ll
+++ /dev/null
@@ -1,20 +0,0 @@
-; RUN: llvm-as < %s | llc
-@str = external global [36 x i8] ; <[36 x i8]*> [#uses=0]
-@str.upgrd.1 = external global [29 x i8] ; <[29 x i8]*> [#uses=0]
-@str1 = external global [29 x i8] ; <[29 x i8]*> [#uses=0]
-@str2 = external global [29 x i8] ; <[29 x i8]*> [#uses=1]
-@str.upgrd.2 = external global [2 x i8] ; <[2 x i8]*> [#uses=0]
-@str3 = external global [2 x i8] ; <[2 x i8]*> [#uses=0]
-@str4 = external global [2 x i8] ; <[2 x i8]*> [#uses=0]
-@str5 = external global [2 x i8] ; <[2 x i8]*> [#uses=0]
-
-define void @printArgsNoRet(i32 %a1, float %a2, i8 %a3, double %a4, i8* %a5, i32 %a6, float %a7, i8 %a8, double %a9, i8* %a10, i32 %a11, float %a12, i8 %a13, double %a14, i8* %a15) {
-entry:
- %tmp17 = sext i8 %a13 to i32 ; <i32> [#uses=1]
- %tmp23 = call i32 (i8*, ...)* @printf( i8* getelementptr ([29 x i8]* @str2, i32 0, i64 0), i32 %a11, double 0.000000e+00, i32 %tmp17, double %a14, i32 0 ) ; <i32> [#uses=0]
- ret void
-}
-
-declare i32 @printf(i8*, ...)
-
-declare i32 @main(i32, i8**)
diff --git a/release_23/test/CodeGen/Generic/2005-12-12-ExpandSextInreg.ll b/release_23/test/CodeGen/Generic/2005-12-12-ExpandSextInreg.ll
deleted file mode 100644
index bd2e043c96f4..000000000000
--- a/release_23/test/CodeGen/Generic/2005-12-12-ExpandSextInreg.ll
+++ /dev/null
@@ -1,7 +0,0 @@
-; RUN: llvm-as < %s | llc
-
-define i64 @test(i64 %A) {
- %B = trunc i64 %A to i8 ; <i8> [#uses=1]
- %C = sext i8 %B to i64 ; <i64> [#uses=1]
- ret i64 %C
-}
diff --git a/release_23/test/CodeGen/Generic/2006-01-12-BadSetCCFold.ll b/release_23/test/CodeGen/Generic/2006-01-12-BadSetCCFold.ll
deleted file mode 100644
index 1a555b355067..000000000000
--- a/release_23/test/CodeGen/Generic/2006-01-12-BadSetCCFold.ll
+++ /dev/null
@@ -1,35 +0,0 @@
-; RUN: llvm-as < %s | llc
-; ModuleID = '2006-01-12-BadSetCCFold.ll'
- %struct.node_t = type { double*, %struct.node_t*, %struct.node_t**, double**, double*, i32, i32 }
-
-define void @main() {
-entry:
- br i1 false, label %then.2.i, label %endif.2.i
-
-then.2.i: ; preds = %entry
- br label %dealwithargs.exit
-
-endif.2.i: ; preds = %entry
- br i1 false, label %then.3.i, label %dealwithargs.exit
-
-then.3.i: ; preds = %endif.2.i
- br label %dealwithargs.exit
-
-dealwithargs.exit: ; preds = %then.3.i, %endif.2.i, %then.2.i
- %n_nodes.4 = phi i32 [ 64, %then.3.i ], [ 64, %then.2.i ], [ 64, %endif.2.i ] ; <i32> [#uses=1]
- %tmp.14.i1134.i.i = icmp sgt i32 %n_nodes.4, 1 ; <i1> [#uses=2]
- br i1 %tmp.14.i1134.i.i, label %no_exit.i12.i.i, label %fill_table.exit22.i.i
-
-no_exit.i12.i.i: ; preds = %no_exit.i12.i.i, %dealwithargs.exit
- br i1 false, label %fill_table.exit22.i.i, label %no_exit.i12.i.i
-
-fill_table.exit22.i.i: ; preds = %no_exit.i12.i.i, %dealwithargs.exit
- %cur_node.0.i8.1.i.i = phi %struct.node_t* [ undef, %dealwithargs.exit ], [ null, %no_exit.i12.i.i ] ; <%struct.node_t*> [#uses=0]
- br i1 %tmp.14.i1134.i.i, label %no_exit.i.preheader.i.i, label %make_tables.exit.i
-
-no_exit.i.preheader.i.i: ; preds = %fill_table.exit22.i.i
- ret void
-
-make_tables.exit.i: ; preds = %fill_table.exit22.i.i
- ret void
-}
diff --git a/release_23/test/CodeGen/Generic/2006-01-18-InvalidBranchOpcodeAssert.ll b/release_23/test/CodeGen/Generic/2006-01-18-InvalidBranchOpcodeAssert.ll
deleted file mode 100644
index b1e08c759c08..000000000000
--- a/release_23/test/CodeGen/Generic/2006-01-18-InvalidBranchOpcodeAssert.ll
+++ /dev/null
@@ -1,15 +0,0 @@
-; RUN: llvm-as < %s | llc
-; This crashed the PPC backend.
-
-define void @test() {
- %tmp125 = fcmp uno double 0.000000e+00, 0.000000e+00 ; <i1> [#uses=1]
- br i1 %tmp125, label %bb154, label %cond_false133
-
-cond_false133: ; preds = %0
- ret void
-
-bb154: ; preds = %0
- %tmp164 = icmp eq i32 0, 0 ; <i1> [#uses=0]
- ret void
-}
-
diff --git a/release_23/test/CodeGen/Generic/2006-02-12-InsertLibcall.ll b/release_23/test/CodeGen/Generic/2006-02-12-InsertLibcall.ll
deleted file mode 100644
index bacf8b5e2f9e..000000000000
--- a/release_23/test/CodeGen/Generic/2006-02-12-InsertLibcall.ll
+++ /dev/null
@@ -1,60 +0,0 @@
-; RUN: llvm-as < %s | llc
-@G = external global i32 ; <i32*> [#uses=1]
-
-define void @encode_one_frame(i64 %tmp.2i) {
-entry:
- %tmp.9 = icmp eq i32 0, 0 ; <i1> [#uses=1]
- br i1 %tmp.9, label %endif.0, label %shortcirc_next.0
-
-then.5.i: ; preds = %shortcirc_next.i
- %tmp.114.i = sdiv i64 %tmp.2i, 3 ; <i64> [#uses=1]
- %tmp.111.i = call i64 @lseek( i32 0, i64 %tmp.114.i, i32 1 ) ; <i64> [#uses=0]
- ret void
-
-shortcirc_next.0: ; preds = %entry
- ret void
-
-endif.0: ; preds = %entry
- %tmp.324.i = icmp eq i32 0, 0 ; <i1> [#uses=2]
- %tmp.362.i = icmp slt i32 0, 0 ; <i1> [#uses=1]
- br i1 %tmp.324.i, label %else.4.i, label %then.11.i37
-
-then.11.i37: ; preds = %endif.0
- ret void
-
-else.4.i: ; preds = %endif.0
- br i1 %tmp.362.i, label %else.5.i, label %then.12.i
-
-then.12.i: ; preds = %else.4.i
- ret void
-
-else.5.i: ; preds = %else.4.i
- br i1 %tmp.324.i, label %then.0.i40, label %then.17.i
-
-then.17.i: ; preds = %else.5.i
- ret void
-
-then.0.i40: ; preds = %else.5.i
- %tmp.8.i42 = icmp eq i32 0, 0 ; <i1> [#uses=1]
- br i1 %tmp.8.i42, label %else.1.i56, label %then.1.i52
-
-then.1.i52: ; preds = %then.0.i40
- ret void
-
-else.1.i56: ; preds = %then.0.i40
- %tmp.28.i = load i32* @G ; <i32> [#uses=1]
- %tmp.29.i = icmp eq i32 %tmp.28.i, 1 ; <i1> [#uses=1]
- br i1 %tmp.29.i, label %shortcirc_next.i, label %shortcirc_done.i
-
-shortcirc_next.i: ; preds = %else.1.i56
- %tmp.34.i = icmp eq i32 0, 3 ; <i1> [#uses=1]
- br i1 %tmp.34.i, label %then.5.i, label %endif.5.i
-
-shortcirc_done.i: ; preds = %else.1.i56
- ret void
-
-endif.5.i: ; preds = %shortcirc_next.i
- ret void
-}
-
-declare i64 @lseek(i32, i64, i32)
diff --git a/release_23/test/CodeGen/Generic/2006-03-01-dagcombineinfloop.ll b/release_23/test/CodeGen/Generic/2006-03-01-dagcombineinfloop.ll
deleted file mode 100644
index 9607ebee1cc8..000000000000
--- a/release_23/test/CodeGen/Generic/2006-03-01-dagcombineinfloop.ll
+++ /dev/null
@@ -1,95 +0,0 @@
-; RUN: llvm-as < %s | llc
-; Infinite loop in the dag combiner, reduced from 176.gcc.
-%struct._obstack_chunk = type { i8*, %struct._obstack_chunk*, [4 x i8] }
- %struct.anon = type { i32 }
- %struct.lang_decl = type opaque
- %struct.lang_type = type { i32, [1 x %struct.tree_node*] }
- %struct.obstack = type { i32, %struct._obstack_chunk*, i8*, i8*, i8*, i32, i32, %struct._obstack_chunk* (...)*, void (...)*, i8*, i8 }
- %struct.rtx_def = type { i16, i8, i8, [1 x %struct.anon] }
- %struct.tree_common = type { %struct.tree_node*, %struct.tree_node*, i8, i8, i8, i8 }
- %struct.tree_decl = type { [12 x i8], i8*, i32, %struct.tree_node*, i32, i8, i8, i8, i8, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.rtx_def*, %struct.anon, { %struct.rtx_def* }, %struct.tree_node*, %struct.lang_decl* }
- %struct.tree_list = type { [12 x i8], %struct.tree_node*, %struct.tree_node* }
- %struct.tree_node = type { %struct.tree_decl }
- %struct.tree_type = type { [12 x i8], %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, i32, i8, i8, i8, i8, i32, %struct.tree_node*, %struct.tree_node*, %struct.anon, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.obstack*, %struct.lang_type* }
-@void_type_node = external global %struct.tree_node* ; <%struct.tree_node**> [#uses=1]
-@char_type_node = external global %struct.tree_node* ; <%struct.tree_node**> [#uses=1]
-@short_integer_type_node = external global %struct.tree_node* ; <%struct.tree_node**> [#uses=1]
-@short_unsigned_type_node = external global %struct.tree_node* ; <%struct.tree_node**> [#uses=1]
-@float_type_node = external global %struct.tree_node* ; <%struct.tree_node**> [#uses=1]
-@signed_char_type_node = external global %struct.tree_node* ; <%struct.tree_node**> [#uses=1]
-@unsigned_char_type_node = external global %struct.tree_node* ; <%struct.tree_node**> [#uses=1]
-
-define fastcc i32 @self_promoting_args_p(%struct.tree_node* %parms) {
-entry:
- %tmp915 = icmp eq %struct.tree_node* %parms, null ; <i1> [#uses=1]
- br i1 %tmp915, label %return, label %cond_true92.preheader
-
-cond_true: ; preds = %cond_true92
- %tmp9.not = icmp ne %struct.tree_node* %tmp2, %tmp7 ; <i1> [#uses=1]
- %tmp14 = icmp eq %struct.tree_node* %tmp2, null ; <i1> [#uses=1]
- %bothcond = or i1 %tmp9.not, %tmp14 ; <i1> [#uses=1]
- br i1 %bothcond, label %return, label %cond_next18
-
-cond_next12: ; preds = %cond_true92
- %tmp14.old = icmp eq %struct.tree_node* %tmp2, null ; <i1> [#uses=1]
- br i1 %tmp14.old, label %return, label %cond_next18
-
-cond_next18: ; preds = %cond_next12, %cond_true
- %tmp20 = bitcast %struct.tree_node* %tmp2 to %struct.tree_type* ; <%struct.tree_type*> [#uses=1]
- %tmp21 = getelementptr %struct.tree_type* %tmp20, i32 0, i32 17 ; <%struct.tree_node**> [#uses=1]
- %tmp22 = load %struct.tree_node** %tmp21 ; <%struct.tree_node*> [#uses=6]
- %tmp24 = icmp eq %struct.tree_node* %tmp22, %tmp23 ; <i1> [#uses=1]
- br i1 %tmp24, label %return, label %cond_next28
-
-cond_next28: ; preds = %cond_next18
- %tmp30 = bitcast %struct.tree_node* %tmp2 to %struct.tree_common* ; <%struct.tree_common*> [#uses=1]
- %tmp = getelementptr %struct.tree_common* %tmp30, i32 0, i32 2 ; <i8*> [#uses=1]
- %tmp.upgrd.1 = bitcast i8* %tmp to i32* ; <i32*> [#uses=1]
- %tmp.upgrd.2 = load i32* %tmp.upgrd.1 ; <i32> [#uses=1]
- %tmp32 = trunc i32 %tmp.upgrd.2 to i8 ; <i8> [#uses=1]
- %tmp33 = icmp eq i8 %tmp32, 7 ; <i1> [#uses=1]
- br i1 %tmp33, label %cond_true34, label %cond_next84
-
-cond_true34: ; preds = %cond_next28
- %tmp40 = icmp eq %struct.tree_node* %tmp22, %tmp39 ; <i1> [#uses=1]
- %tmp49 = icmp eq %struct.tree_node* %tmp22, %tmp48 ; <i1> [#uses=1]
- %bothcond6 = or i1 %tmp40, %tmp49 ; <i1> [#uses=1]
- %tmp58 = icmp eq %struct.tree_node* %tmp22, %tmp57 ; <i1> [#uses=1]
- %bothcond7 = or i1 %bothcond6, %tmp58 ; <i1> [#uses=1]
- %tmp67 = icmp eq %struct.tree_node* %tmp22, %tmp66 ; <i1> [#uses=1]
- %bothcond8 = or i1 %bothcond7, %tmp67 ; <i1> [#uses=1]
- %tmp76 = icmp eq %struct.tree_node* %tmp22, %tmp75 ; <i1> [#uses=1]
- %bothcond9 = or i1 %bothcond8, %tmp76 ; <i1> [#uses=2]
- %brmerge = or i1 %bothcond9, %tmp.upgrd.6 ; <i1> [#uses=1]
- %bothcond9.upgrd.3 = zext i1 %bothcond9 to i32 ; <i32> [#uses=1]
- %.mux = xor i32 %bothcond9.upgrd.3, 1 ; <i32> [#uses=1]
- br i1 %brmerge, label %return, label %cond_true92
-
-cond_next84: ; preds = %cond_next28
- br i1 %tmp.upgrd.6, label %return, label %cond_true92
-
-cond_true92.preheader: ; preds = %entry
- %tmp7 = load %struct.tree_node** @void_type_node ; <%struct.tree_node*> [#uses=1]
- %tmp23 = load %struct.tree_node** @float_type_node ; <%struct.tree_node*> [#uses=1]
- %tmp39 = load %struct.tree_node** @char_type_node ; <%struct.tree_node*> [#uses=1]
- %tmp48 = load %struct.tree_node** @signed_char_type_node ; <%struct.tree_node*> [#uses=1]
- %tmp57 = load %struct.tree_node** @unsigned_char_type_node ; <%struct.tree_node*> [#uses=1]
- %tmp66 = load %struct.tree_node** @short_integer_type_node ; <%struct.tree_node*> [#uses=1]
- %tmp75 = load %struct.tree_node** @short_unsigned_type_node ; <%struct.tree_node*> [#uses=1]
- br label %cond_true92
-
-cond_true92: ; preds = %cond_true92.preheader, %cond_next84, %cond_true34
- %t.0.0 = phi %struct.tree_node* [ %parms, %cond_true92.preheader ], [ %tmp6, %cond_true34 ], [ %tmp6, %cond_next84 ] ; <%struct.tree_node*> [#uses=2]
- %tmp.upgrd.4 = bitcast %struct.tree_node* %t.0.0 to %struct.tree_list* ; <%struct.tree_list*> [#uses=1]
- %tmp.upgrd.5 = getelementptr %struct.tree_list* %tmp.upgrd.4, i32 0, i32 2 ; <%struct.tree_node**> [#uses=1]
- %tmp2 = load %struct.tree_node** %tmp.upgrd.5 ; <%struct.tree_node*> [#uses=5]
- %tmp4 = bitcast %struct.tree_node* %t.0.0 to %struct.tree_common* ; <%struct.tree_common*> [#uses=1]
- %tmp5 = getelementptr %struct.tree_common* %tmp4, i32 0, i32 0 ; <%struct.tree_node**> [#uses=1]
- %tmp6 = load %struct.tree_node** %tmp5 ; <%struct.tree_node*> [#uses=3]
- %tmp.upgrd.6 = icmp eq %struct.tree_node* %tmp6, null ; <i1> [#uses=3]
- br i1 %tmp.upgrd.6, label %cond_true, label %cond_next12
-
-return: ; preds = %cond_next84, %cond_true34, %cond_next18, %cond_next12, %cond_true, %entry
- %retval.0 = phi i32 [ 1, %entry ], [ 1, %cond_next84 ], [ %.mux, %cond_true34 ], [ 0, %cond_next18 ], [ 0, %cond_next12 ], [ 0, %cond_true ] ; <i32> [#uses=1]
- ret i32 %retval.0
-}
diff --git a/release_23/test/CodeGen/Generic/2006-03-27-DebugInfoNULLDeclare.ll b/release_23/test/CodeGen/Generic/2006-03-27-DebugInfoNULLDeclare.ll
deleted file mode 100644
index 2f2fb8b2e9fd..000000000000
--- a/release_23/test/CodeGen/Generic/2006-03-27-DebugInfoNULLDeclare.ll
+++ /dev/null
@@ -1,9 +0,0 @@
-; RUN: llvm-as < %s | llc
-
-declare void @llvm.dbg.declare({ }*, { }*)
-
-define void @foo() {
- call void @llvm.dbg.declare( { }* null, { }* null )
- ret void
-}
-
diff --git a/release_23/test/CodeGen/Generic/2006-04-11-vecload.ll b/release_23/test/CodeGen/Generic/2006-04-11-vecload.ll
deleted file mode 100644
index cc96d8f1ab6a..000000000000
--- a/release_23/test/CodeGen/Generic/2006-04-11-vecload.ll
+++ /dev/null
@@ -1,12 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -mcpu=yonah
-
-; The vload was getting memoized to the previous scalar load!
-
-define void @VertexProgram2() {
- %xFloat0.688 = load float* null ; <float> [#uses=0]
- %loadVector37.712 = load <4 x float>* null ; <<4 x float>> [#uses=1]
- %inFloat3.713 = insertelement <4 x float> %loadVector37.712, float 0.000000e+00, i32 3 ; <<4 x float>> [#uses=1]
- store <4 x float> %inFloat3.713, <4 x float>* null
- unreachable
-}
-
diff --git a/release_23/test/CodeGen/Generic/2006-04-26-SetCCAnd.ll b/release_23/test/CodeGen/Generic/2006-04-26-SetCCAnd.ll
deleted file mode 100644
index b99aa98fe9e8..000000000000
--- a/release_23/test/CodeGen/Generic/2006-04-26-SetCCAnd.ll
+++ /dev/null
@@ -1,40 +0,0 @@
-; RUN: llvm-as < %s | llc
-; PR748
-@G = external global i16 ; <i16*> [#uses=1]
-
-define void @OmNewObjHdr() {
-entry:
- br i1 false, label %endif.4, label %then.0
-
-then.0: ; preds = %entry
- ret void
-
-endif.4: ; preds = %entry
- br i1 false, label %else.3, label %shortcirc_next.3
-
-shortcirc_next.3: ; preds = %endif.4
- ret void
-
-else.3: ; preds = %endif.4
- switch i32 0, label %endif.10 [
- i32 5001, label %then.10
- i32 -5008, label %then.10
- ]
-
-then.10: ; preds = %else.3, %else.3
- %tmp.112 = load i16* null ; <i16> [#uses=2]
- %tmp.113 = load i16* @G ; <i16> [#uses=2]
- %tmp.114 = icmp ugt i16 %tmp.112, %tmp.113 ; <i1> [#uses=1]
- %tmp.120 = icmp ult i16 %tmp.112, %tmp.113 ; <i1> [#uses=1]
- %bothcond = and i1 %tmp.114, %tmp.120 ; <i1> [#uses=1]
- br i1 %bothcond, label %else.4, label %then.11
-
-then.11: ; preds = %then.10
- ret void
-
-else.4: ; preds = %then.10
- ret void
-
-endif.10: ; preds = %else.3
- ret void
-}
diff --git a/release_23/test/CodeGen/Generic/2006-04-28-Sign-extend-bool.ll b/release_23/test/CodeGen/Generic/2006-04-28-Sign-extend-bool.ll
deleted file mode 100644
index 6b9bf11860f9..000000000000
--- a/release_23/test/CodeGen/Generic/2006-04-28-Sign-extend-bool.ll
+++ /dev/null
@@ -1,9 +0,0 @@
-; RUN: llvm-as < %s | llc
-
-define i32 @test(i32 %tmp93) {
- %tmp98 = shl i32 %tmp93, 31 ; <i32> [#uses=1]
- %tmp99 = ashr i32 %tmp98, 31 ; <i32> [#uses=1]
- %tmp99.upgrd.1 = trunc i32 %tmp99 to i8 ; <i8> [#uses=1]
- %tmp99100 = sext i8 %tmp99.upgrd.1 to i32 ; <i32> [#uses=1]
- ret i32 %tmp99100
-}
diff --git a/release_23/test/CodeGen/Generic/2006-05-06-GEP-Cast-Sink-Crash.ll b/release_23/test/CodeGen/Generic/2006-05-06-GEP-Cast-Sink-Crash.ll
deleted file mode 100644
index 59ed2953afad..000000000000
--- a/release_23/test/CodeGen/Generic/2006-05-06-GEP-Cast-Sink-Crash.ll
+++ /dev/null
@@ -1,29 +0,0 @@
-; RUN: llvm-as < %s | llc
-%struct.FILE = type { i8*, i32, i32, i16, i16, %struct.__sbuf, i32, i8*, i32 (i8*)*, i32 (i8*, i8*, i32)*, i64 (i8*, i64, i32)*, i32 (i8*, i8*, i32)*, %struct.__sbuf, %struct.__sFILEX*, i32, [3 x i8], [1 x i8], %struct.__sbuf, i32, i64 }
- %struct.SYMBOL_TABLE_ENTRY = type { [9 x i8], [9 x i8], i32, i32, i32, %struct.SYMBOL_TABLE_ENTRY* }
- %struct.__sFILEX = type opaque
- %struct.__sbuf = type { i8*, i32 }
-@str14 = external global [6 x i8] ; <[6 x i8]*> [#uses=0]
-
-declare void @fprintf(i32, ...)
-
-define void @OUTPUT_TABLE(%struct.SYMBOL_TABLE_ENTRY* %SYM_TAB) {
-entry:
- %tmp11 = getelementptr %struct.SYMBOL_TABLE_ENTRY* %SYM_TAB, i32 0, i32 1, i32 0 ; <i8*> [#uses=2]
- %tmp.i = bitcast i8* %tmp11 to i8* ; <i8*> [#uses=1]
- br label %bb.i
-
-bb.i: ; preds = %cond_next.i, %entry
- %s1.0.i = phi i8* [ %tmp.i, %entry ], [ null, %cond_next.i ] ; <i8*> [#uses=0]
- br i1 false, label %cond_true.i31, label %cond_next.i
-
-cond_true.i31: ; preds = %bb.i
- call void (i32, ...)* @fprintf( i32 0, i8* %tmp11, i8* null )
- ret void
-
-cond_next.i: ; preds = %bb.i
- br i1 false, label %bb.i, label %bb19.i
-
-bb19.i: ; preds = %cond_next.i
- ret void
-}
diff --git a/release_23/test/CodeGen/Generic/2006-06-12-LowerSwitchCrash.ll b/release_23/test/CodeGen/Generic/2006-06-12-LowerSwitchCrash.ll
deleted file mode 100644
index 47ee7c5fccdd..000000000000
--- a/release_23/test/CodeGen/Generic/2006-06-12-LowerSwitchCrash.ll
+++ /dev/null
@@ -1,10 +0,0 @@
-; RUN: llvm-as < %s | llc -fast
-
-define float @test(i32 %tmp12771278) {
- switch i32 %tmp12771278, label %bb1279 [
- ]
-
-bb1279: ; preds = %0
- ret float 1.000000e+00
-}
-
diff --git a/release_23/test/CodeGen/Generic/2006-06-13-ComputeMaskedBitsCrash.ll b/release_23/test/CodeGen/Generic/2006-06-13-ComputeMaskedBitsCrash.ll
deleted file mode 100644
index 920cf3c46451..000000000000
--- a/release_23/test/CodeGen/Generic/2006-06-13-ComputeMaskedBitsCrash.ll
+++ /dev/null
@@ -1,35 +0,0 @@
-; RUN: llvm-as < %s | llc -fast
-
-%struct.cl_perfunc_opts = type { i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i32, i32, i32, i32, i32, i32, i32 }
-@cl_pf_opts = external global %struct.cl_perfunc_opts ; <%struct.cl_perfunc_opts*> [#uses=2]
-
-define void @set_flags_from_O() {
-entry:
- %tmp22 = icmp sgt i32 0, 0 ; <i1> [#uses=1]
- br i1 %tmp22, label %cond_true23, label %cond_next159
-
-cond_true23: ; preds = %entry
- %tmp138 = getelementptr %struct.cl_perfunc_opts* @cl_pf_opts, i32 0, i32 8 ; <i8*> [#uses=1]
- %tmp138.upgrd.1 = bitcast i8* %tmp138 to i32* ; <i32*> [#uses=2]
- %tmp139 = load i32* %tmp138.upgrd.1 ; <i32> [#uses=1]
- %tmp140 = shl i32 1, 27 ; <i32> [#uses=1]
- %tmp141 = and i32 %tmp140, 134217728 ; <i32> [#uses=1]
- %tmp142 = and i32 %tmp139, -134217729 ; <i32> [#uses=1]
- %tmp143 = or i32 %tmp142, %tmp141 ; <i32> [#uses=1]
- store i32 %tmp143, i32* %tmp138.upgrd.1
- %tmp144 = getelementptr %struct.cl_perfunc_opts* @cl_pf_opts, i32 0, i32 8 ; <i8*> [#uses=1]
- %tmp144.upgrd.2 = bitcast i8* %tmp144 to i32* ; <i32*> [#uses=1]
- %tmp145 = load i32* %tmp144.upgrd.2 ; <i32> [#uses=1]
- %tmp146 = shl i32 %tmp145, 22 ; <i32> [#uses=1]
- %tmp147 = lshr i32 %tmp146, 31 ; <i32> [#uses=1]
- %tmp147.upgrd.3 = trunc i32 %tmp147 to i8 ; <i8> [#uses=1]
- %tmp148 = icmp eq i8 %tmp147.upgrd.3, 0 ; <i1> [#uses=1]
- br i1 %tmp148, label %cond_true149, label %cond_next159
-
-cond_true149: ; preds = %cond_true23
- %tmp150 = bitcast i8* null to i32* ; <i32*> [#uses=0]
- ret void
-
-cond_next159: ; preds = %cond_true23, %entry
- ret void
-}
diff --git a/release_23/test/CodeGen/Generic/2006-06-28-SimplifySetCCCrash.ll b/release_23/test/CodeGen/Generic/2006-06-28-SimplifySetCCCrash.ll
deleted file mode 100644
index 8e8f18639bdb..000000000000
--- a/release_23/test/CodeGen/Generic/2006-06-28-SimplifySetCCCrash.ll
+++ /dev/null
@@ -1,279 +0,0 @@
-; RUN: llvm-as < %s | llc
-%struct.rtunion = type { i64 }
- %struct.rtx_def = type { i16, i8, i8, [1 x %struct.rtunion] }
-@ix86_cpu = external global i32 ; <i32*> [#uses=1]
-@which_alternative = external global i32 ; <i32*> [#uses=3]
-
-declare fastcc i32 @recog()
-
-define void @athlon_fp_unit_ready_cost() {
-entry:
- %tmp = icmp slt i32 0, 0 ; <i1> [#uses=1]
- br i1 %tmp, label %cond_true.i, label %cond_true
-
-cond_true: ; preds = %entry
- ret void
-
-cond_true.i: ; preds = %entry
- %tmp8.i = tail call fastcc i32 @recog( ) ; <i32> [#uses=1]
- switch i32 %tmp8.i, label %UnifiedReturnBlock [
- i32 -1, label %bb2063
- i32 19, label %bb2035
- i32 20, label %bb2035
- i32 21, label %bb2035
- i32 23, label %bb2035
- i32 24, label %bb2035
- i32 27, label %bb2035
- i32 32, label %bb2035
- i32 33, label %bb1994
- i32 35, label %bb2035
- i32 36, label %bb1994
- i32 90, label %bb1948
- i32 94, label %bb1948
- i32 95, label %bb1948
- i32 101, label %bb1648
- i32 102, label %bb1648
- i32 103, label %bb1648
- i32 104, label %bb1648
- i32 133, label %bb1419
- i32 135, label %bb1238
- i32 136, label %bb1238
- i32 137, label %bb1238
- i32 138, label %bb1238
- i32 139, label %bb1201
- i32 140, label %bb1201
- i32 141, label %bb1154
- i32 142, label %bb1126
- i32 144, label %bb1201
- i32 145, label %bb1126
- i32 146, label %bb1201
- i32 147, label %bb1126
- i32 148, label %bb1201
- i32 149, label %bb1126
- i32 150, label %bb1201
- i32 151, label %bb1126
- i32 152, label %bb1096
- i32 153, label %bb1096
- i32 154, label %bb1096
- i32 157, label %bb1096
- i32 158, label %bb1096
- i32 159, label %bb1096
- i32 162, label %bb1096
- i32 163, label %bb1096
- i32 164, label %bb1096
- i32 167, label %bb1201
- i32 168, label %bb1201
- i32 170, label %bb1201
- i32 171, label %bb1201
- i32 173, label %bb1201
- i32 174, label %bb1201
- i32 176, label %bb1201
- i32 177, label %bb1201
- i32 179, label %bb993
- i32 180, label %bb993
- i32 181, label %bb993
- i32 182, label %bb993
- i32 183, label %bb993
- i32 184, label %bb993
- i32 365, label %bb1126
- i32 366, label %bb1126
- i32 367, label %bb1126
- i32 368, label %bb1126
- i32 369, label %bb1126
- i32 370, label %bb1126
- i32 371, label %bb1126
- i32 372, label %bb1126
- i32 373, label %bb1126
- i32 384, label %bb1126
- i32 385, label %bb1126
- i32 386, label %bb1126
- i32 387, label %bb1126
- i32 388, label %bb1126
- i32 389, label %bb1126
- i32 390, label %bb1126
- i32 391, label %bb1126
- i32 392, label %bb1126
- i32 525, label %bb919
- i32 526, label %bb839
- i32 528, label %bb919
- i32 529, label %bb839
- i32 531, label %cond_next6.i119
- i32 532, label %cond_next6.i97
- i32 533, label %cond_next6.i81
- i32 534, label %bb495
- i32 536, label %cond_next6.i81
- i32 537, label %cond_next6.i81
- i32 538, label %bb396
- i32 539, label %bb288
- i32 541, label %bb396
- i32 542, label %bb396
- i32 543, label %bb396
- i32 544, label %bb396
- i32 545, label %bb189
- i32 546, label %cond_next6.i
- i32 547, label %bb189
- i32 548, label %cond_next6.i
- i32 549, label %bb189
- i32 550, label %cond_next6.i
- i32 551, label %bb189
- i32 552, label %cond_next6.i
- i32 553, label %bb189
- i32 554, label %cond_next6.i
- i32 555, label %bb189
- i32 556, label %cond_next6.i
- i32 557, label %bb189
- i32 558, label %cond_next6.i
- i32 618, label %bb40
- i32 619, label %bb18
- i32 620, label %bb40
- i32 621, label %bb10
- i32 622, label %bb10
- ]
-
-bb10: ; preds = %cond_true.i, %cond_true.i
- ret void
-
-bb18: ; preds = %cond_true.i
- ret void
-
-bb40: ; preds = %cond_true.i, %cond_true.i
- ret void
-
-cond_next6.i: ; preds = %cond_true.i, %cond_true.i, %cond_true.i, %cond_true.i, %cond_true.i, %cond_true.i, %cond_true.i
- ret void
-
-bb189: ; preds = %cond_true.i, %cond_true.i, %cond_true.i, %cond_true.i, %cond_true.i, %cond_true.i, %cond_true.i
- ret void
-
-bb288: ; preds = %cond_true.i
- ret void
-
-bb396: ; preds = %cond_true.i, %cond_true.i, %cond_true.i, %cond_true.i, %cond_true.i
- ret void
-
-bb495: ; preds = %cond_true.i
- ret void
-
-cond_next6.i81: ; preds = %cond_true.i, %cond_true.i, %cond_true.i
- ret void
-
-cond_next6.i97: ; preds = %cond_true.i
- ret void
-
-cond_next6.i119: ; preds = %cond_true.i
- %tmp.i126 = icmp eq i16 0, 78 ; <i1> [#uses=1]
- br i1 %tmp.i126, label %cond_next778, label %bb802
-
-cond_next778: ; preds = %cond_next6.i119
- %tmp781 = icmp eq i32 0, 1 ; <i1> [#uses=1]
- br i1 %tmp781, label %cond_next784, label %bb790
-
-cond_next784: ; preds = %cond_next778
- %tmp785 = load i32* @ix86_cpu ; <i32> [#uses=1]
- %tmp786 = icmp eq i32 %tmp785, 5 ; <i1> [#uses=1]
- br i1 %tmp786, label %UnifiedReturnBlock, label %bb790
-
-bb790: ; preds = %cond_next784, %cond_next778
- %tmp793 = icmp eq i32 0, 1 ; <i1> [#uses=0]
- ret void
-
-bb802: ; preds = %cond_next6.i119
- ret void
-
-bb839: ; preds = %cond_true.i, %cond_true.i
- ret void
-
-bb919: ; preds = %cond_true.i, %cond_true.i
- ret void
-
-bb993: ; preds = %cond_true.i, %cond_true.i, %cond_true.i, %cond_true.i, %cond_true.i, %cond_true.i
- ret void
-
-bb1096: ; preds = %cond_true.i, %cond_true.i, %cond_true.i, %cond_true.i, %cond_true.i, %cond_true.i, %cond_true.i, %cond_true.i, %cond_true.i
- ret void
-
-bb1126: ; preds = %cond_true.i, %cond_true.i, %cond_true.i, %cond_true.i, %cond_true.i, %cond_true.i, %cond_true.i, %cond_true.i, %cond_true.i, %cond_true.i, %cond_true.i, %cond_true.i, %cond_true.i, %cond_true.i, %cond_true.i, %cond_true.i, %cond_true.i, %cond_true.i, %cond_true.i, %cond_true.i, %cond_true.i, %cond_true.i, %cond_true.i
- ret void
-
-bb1154: ; preds = %cond_true.i
- ret void
-
-bb1201: ; preds = %cond_true.i, %cond_true.i, %cond_true.i, %cond_true.i, %cond_true.i, %cond_true.i, %cond_true.i, %cond_true.i, %cond_true.i, %cond_true.i, %cond_true.i, %cond_true.i, %cond_true.i, %cond_true.i
- ret void
-
-bb1238: ; preds = %cond_true.i, %cond_true.i, %cond_true.i, %cond_true.i
- ret void
-
-bb1419: ; preds = %cond_true.i
- ret void
-
-bb1648: ; preds = %cond_true.i, %cond_true.i, %cond_true.i, %cond_true.i
- %tmp1650 = load i32* @which_alternative ; <i32> [#uses=1]
- switch i32 %tmp1650, label %bb1701 [
- i32 0, label %cond_next1675
- i32 1, label %cond_next1675
- i32 2, label %cond_next1675
- ]
-
-cond_next1675: ; preds = %bb1648, %bb1648, %bb1648
- ret void
-
-bb1701: ; preds = %bb1648
- %tmp1702 = load i32* @which_alternative ; <i32> [#uses=1]
- switch i32 %tmp1702, label %bb1808 [
- i32 0, label %cond_next1727
- i32 1, label %cond_next1727
- i32 2, label %cond_next1727
- ]
-
-cond_next1727: ; preds = %bb1701, %bb1701, %bb1701
- ret void
-
-bb1808: ; preds = %bb1701
- %bothcond696 = or i1 false, false ; <i1> [#uses=1]
- br i1 %bothcond696, label %bb1876, label %cond_next1834
-
-cond_next1834: ; preds = %bb1808
- ret void
-
-bb1876: ; preds = %bb1808
- %tmp1877signed = load i32* @which_alternative ; <i32> [#uses=4]
- %tmp1877 = bitcast i32 %tmp1877signed to i32 ; <i32> [#uses=1]
- %bothcond699 = icmp ult i32 %tmp1877, 2 ; <i1> [#uses=1]
- %tmp1888 = icmp eq i32 %tmp1877signed, 2 ; <i1> [#uses=1]
- %bothcond700 = or i1 %bothcond699, %tmp1888 ; <i1> [#uses=1]
- %bothcond700.not = xor i1 %bothcond700, true ; <i1> [#uses=1]
- %tmp1894 = icmp eq i32 %tmp1877signed, 3 ; <i1> [#uses=1]
- %bothcond701 = or i1 %tmp1894, %bothcond700.not ; <i1> [#uses=1]
- %bothcond702 = or i1 %bothcond701, false ; <i1> [#uses=1]
- br i1 %bothcond702, label %UnifiedReturnBlock, label %cond_next1902
-
-cond_next1902: ; preds = %bb1876
- switch i32 %tmp1877signed, label %cond_next1937 [
- i32 0, label %bb1918
- i32 1, label %bb1918
- i32 2, label %bb1918
- ]
-
-bb1918: ; preds = %cond_next1902, %cond_next1902, %cond_next1902
- ret void
-
-cond_next1937: ; preds = %cond_next1902
- ret void
-
-bb1948: ; preds = %cond_true.i, %cond_true.i, %cond_true.i
- ret void
-
-bb1994: ; preds = %cond_true.i, %cond_true.i
- ret void
-
-bb2035: ; preds = %cond_true.i, %cond_true.i, %cond_true.i, %cond_true.i, %cond_true.i, %cond_true.i, %cond_true.i, %cond_true.i
- ret void
-
-bb2063: ; preds = %cond_true.i
- ret void
-
-UnifiedReturnBlock: ; preds = %bb1876, %cond_next784, %cond_true.i
- %UnifiedRetVal = phi i32 [ 100, %bb1876 ], [ 100, %cond_true.i ], [ 4, %cond_next784 ] ; <i32> [#uses=0]
- ret void
-}
diff --git a/release_23/test/CodeGen/Generic/2006-07-03-schedulers.ll b/release_23/test/CodeGen/Generic/2006-07-03-schedulers.ll
deleted file mode 100644
index 1e423f84e6b6..000000000000
--- a/release_23/test/CodeGen/Generic/2006-07-03-schedulers.ll
+++ /dev/null
@@ -1,30 +0,0 @@
-; RUN: llvm-as < %s | llc -pre-RA-sched=default
-; RUN: llvm-as < %s | llc -pre-RA-sched=list-td
-; RUN: llvm-as < %s | llc -pre-RA-sched=list-tdrr
-; RUN: llvm-as < %s | llc -pre-RA-sched=list-burr
-; PR859
-
-declare i32 @printf(i8*, i32, float)
-
-define i32 @testissue(i32 %i, float %x, float %y) {
- br label %bb1
-
-bb1: ; preds = %bb1, %0
- %x1 = mul float %x, %y ; <float> [#uses=1]
- %y1 = mul float %y, 7.500000e-01 ; <float> [#uses=1]
- %z1 = add float %x1, %y1 ; <float> [#uses=1]
- %x2 = mul float %x, 5.000000e-01 ; <float> [#uses=1]
- %y2 = mul float %y, 0x3FECCCCCC0000000 ; <float> [#uses=1]
- %z2 = add float %x2, %y2 ; <float> [#uses=1]
- %z3 = add float %z1, %z2 ; <float> [#uses=1]
- %i1 = shl i32 %i, 3 ; <i32> [#uses=1]
- %j1 = add i32 %i, 7 ; <i32> [#uses=1]
- %m1 = add i32 %i1, %j1 ; <i32> [#uses=2]
- %b = icmp sle i32 %m1, 6 ; <i1> [#uses=1]
- br i1 %b, label %bb1, label %bb2
-
-bb2: ; preds = %bb1
- %Msg = inttoptr i64 0 to i8* ; <i8*> [#uses=1]
- call i32 @printf( i8* %Msg, i32 %m1, float %z3 ) ; <i32>:1 [#uses=0]
- ret i32 0
-}
diff --git a/release_23/test/CodeGen/Generic/2006-08-30-CoalescerCrash.ll b/release_23/test/CodeGen/Generic/2006-08-30-CoalescerCrash.ll
deleted file mode 100644
index 7f8af5dda498..000000000000
--- a/release_23/test/CodeGen/Generic/2006-08-30-CoalescerCrash.ll
+++ /dev/null
@@ -1,112 +0,0 @@
-; RUN: llvm-as < %s | llc
-%struct.CUMULATIVE_ARGS = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 }
- %struct.VEC_edge = type { i32, i32, [1 x %struct.edge_def*] }
- %struct._obstack_chunk = type { i8*, %struct._obstack_chunk*, [4 x i8] }
- %struct.basic_block_def = type { %struct.rtx_def*, %struct.rtx_def*, %struct.tree_node*, %struct.VEC_edge*, %struct.VEC_edge*, %struct.bitmap_head_def*, %struct.bitmap_head_def*, i8*, %struct.loop*, [2 x %struct.et_node*], %struct.basic_block_def*, %struct.basic_block_def*, %struct.reorder_block_def*, %struct.bb_ann_d*, i64, i32, i32, i32, i32 }
- %struct.bb_ann_d = type { %struct.tree_node*, i8, %struct.edge_prediction* }
- %struct.bitmap_element_def = type { %struct.bitmap_element_def*, %struct.bitmap_element_def*, i32, [4 x i32] }
- %struct.bitmap_head_def = type { %struct.bitmap_element_def*, %struct.bitmap_element_def*, i32, %struct.bitmap_obstack* }
- %struct.bitmap_obstack = type { %struct.bitmap_element_def*, %struct.bitmap_head_def*, %struct.obstack }
- %struct.cost_pair = type { %struct.iv_cand*, i32, %struct.bitmap_head_def* }
- %struct.dataflow_d = type { %struct.varray_head_tag*, [2 x %struct.tree_node*] }
- %struct.def_operand_ptr = type { %struct.tree_node** }
- %struct.def_optype_d = type { i32, [1 x %struct.def_operand_ptr] }
- %struct.edge_def = type { %struct.basic_block_def*, %struct.basic_block_def*, %struct.edge_def_insns, i8*, %struct.location_t*, i32, i32, i64, i32 }
- %struct.edge_def_insns = type { %struct.rtx_def* }
- %struct.edge_prediction = type { %struct.edge_prediction*, %struct.edge_def*, i32, i32 }
- %struct.eh_status = type opaque
- %struct.emit_status = type { i32, i32, %struct.rtx_def*, %struct.rtx_def*, %struct.sequence_stack*, i32, %struct.location_t, i32, i8*, %struct.rtx_def** }
- %struct.et_node = type opaque
- %struct.expr_status = type { i32, i32, i32, %struct.rtx_def*, %struct.rtx_def*, %struct.rtx_def* }
- %struct.function = type { %struct.eh_status*, %struct.expr_status*, %struct.emit_status*, %struct.varasm_status*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.function*, i32, i32, i32, i32, %struct.rtx_def*, %struct.CUMULATIVE_ARGS, %struct.rtx_def*, %struct.rtx_def*, %struct.initial_value_struct*, %struct.rtx_def*, %struct.rtx_def*, %struct.rtx_def*, %struct.rtx_def*, %struct.rtx_def*, %struct.rtx_def*, i8, i32, i64, %struct.tree_node*, %struct.tree_node*, %struct.rtx_def*, %struct.varray_head_tag*, %struct.temp_slot*, i32, %struct.var_refs_queue*, i32, i32, %struct.rtvec_def*, %struct.tree_node*, i32, i32, i32, %struct.machine_function*, i32, i32, i1, i1, %struct.language_function*, %struct.rtx_def*, i32, i32, i32, i32, %struct.location_t, %struct.varray_head_tag*, %struct.tree_node*, i8, i8, i8 }
- %struct.htab = type { i32 (i8*)*, i32 (i8*, i8*)*, void (i8*)*, i8**, i32, i32, i32, i32, i32, i8* (i32, i32)*, void (i8*)*, i8*, i8* (i8*, i32, i32)*, void (i8*, i8*)*, i32 }
- %struct.initial_value_struct = type opaque
- %struct.iv = type { %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, i1, i1, i32 }
- %struct.iv_cand = type { i32, i1, i32, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.iv*, i32 }
- %struct.iv_use = type { i32, i32, %struct.iv*, %struct.tree_node*, %struct.tree_node**, %struct.bitmap_head_def*, i32, %struct.cost_pair*, %struct.iv_cand* }
- %struct.ivopts_data = type { %struct.loop*, %struct.htab*, i32, %struct.version_info*, %struct.bitmap_head_def*, i32, %struct.varray_head_tag*, %struct.varray_head_tag*, %struct.bitmap_head_def*, i1 }
- %struct.lang_decl = type opaque
- %struct.language_function = type opaque
- %struct.location_t = type { i8*, i32 }
- %struct.loop = type { i32, %struct.basic_block_def*, %struct.basic_block_def*, %struct.basic_block_def*, %struct.lpt_decision, i32, i32, %struct.edge_def**, i32, %struct.basic_block_def*, %struct.basic_block_def*, i32, %struct.edge_def**, i32, %struct.edge_def**, i32, %struct.simple_bitmap_def*, i32, %struct.loop**, i32, %struct.loop*, %struct.loop*, %struct.loop*, %struct.loop*, i32, i8*, %struct.rtx_def*, %struct.rtx_def*, %struct.rtx_def*, %struct.rtx_def*, %struct.rtx_def*, %struct.rtx_def*, i32, %struct.tree_node*, %struct.tree_node*, %struct.nb_iter_bound*, %struct.edge_def*, i1 }
- %struct.lpt_decision = type { i32, i32 }
- %struct.machine_function = type { %struct.stack_local_entry*, i8*, %struct.rtx_def*, i32, i32, i32, i32, i32 }
- %struct.nb_iter_bound = type { %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.nb_iter_bound* }
- %struct.obstack = type { i32, %struct._obstack_chunk*, i8*, i8*, i8*, i32, i32, %struct._obstack_chunk* (i8*, i32)*, void (i8*, %struct._obstack_chunk*)*, i8*, i8 }
- %struct.reorder_block_def = type { %struct.rtx_def*, %struct.rtx_def*, %struct.basic_block_def*, %struct.basic_block_def*, %struct.basic_block_def*, i32, i32, i32 }
- %struct.rtvec_def = type { i32, [1 x %struct.rtx_def*] }
- %struct.rtx_def = type { i16, i8, i8, %struct.u }
- %struct.sequence_stack = type { %struct.rtx_def*, %struct.rtx_def*, %struct.sequence_stack* }
- %struct.simple_bitmap_def = type { i32, i32, i32, [1 x i64] }
- %struct.stack_local_entry = type opaque
- %struct.stmt_ann_d = type { %struct.tree_ann_common_d, i8, %struct.basic_block_def*, %struct.stmt_operands_d, %struct.dataflow_d*, %struct.bitmap_head_def*, i32 }
- %struct.stmt_operands_d = type { %struct.def_optype_d*, %struct.def_optype_d*, %struct.v_may_def_optype_d*, %struct.vuse_optype_d*, %struct.v_may_def_optype_d* }
- %struct.temp_slot = type opaque
- %struct.tree_ann_common_d = type { i32, i8*, %struct.tree_node* }
- %struct.tree_ann_d = type { %struct.stmt_ann_d }
- %struct.tree_common = type { %struct.tree_node*, %struct.tree_node*, %struct.tree_ann_d*, i8, i8, i8, i8, i8 }
- %struct.tree_decl = type { %struct.tree_common, %struct.location_t, i32, %struct.tree_node*, i8, i8, i8, i8, i8, i8, i8, i32, %struct.tree_decl_u1, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.rtx_def*, i32, %struct.tree_decl_u2, %struct.tree_node*, %struct.tree_node*, i64, %struct.lang_decl* }
- %struct.tree_decl_u1 = type { i64 }
- %struct.tree_decl_u2 = type { %struct.function* }
- %struct.tree_node = type { %struct.tree_decl }
- %struct.u = type { [1 x i64] }
- %struct.v_def_use_operand_type_t = type { %struct.tree_node*, %struct.tree_node* }
- %struct.v_may_def_optype_d = type { i32, [1 x %struct.v_def_use_operand_type_t] }
- %struct.var_refs_queue = type { %struct.rtx_def*, i32, i32, %struct.var_refs_queue* }
- %struct.varasm_status = type opaque
- %struct.varray_head_tag = type { i32, i32, i32, i8*, %struct.u }
- %struct.version_info = type { %struct.tree_node*, %struct.iv*, i1, i32, i1 }
- %struct.vuse_optype_d = type { i32, [1 x %struct.tree_node*] }
-
-define i1 @determine_use_iv_cost(%struct.ivopts_data* %data, %struct.iv_use* %use, %struct.iv_cand* %cand) {
-entry:
- switch i32 0, label %bb91 [
- i32 0, label %bb
- i32 1, label %bb6
- i32 3, label %cond_next135
- ]
-
-bb: ; preds = %entry
- ret i1 false
-
-bb6: ; preds = %entry
- br i1 false, label %bb87, label %cond_next27
-
-cond_next27: ; preds = %bb6
- br i1 false, label %cond_true30, label %cond_next55
-
-cond_true30: ; preds = %cond_next27
- br i1 false, label %cond_next41, label %cond_true35
-
-cond_true35: ; preds = %cond_true30
- ret i1 false
-
-cond_next41: ; preds = %cond_true30
- %tmp44 = call i32 @force_var_cost( %struct.ivopts_data* %data, %struct.tree_node* null, %struct.bitmap_head_def** null ) ; <i32> [#uses=2]
- %tmp46 = udiv i32 %tmp44, 5 ; <i32> [#uses=1]
- call void @set_use_iv_cost( %struct.ivopts_data* %data, %struct.iv_use* %use, %struct.iv_cand* %cand, i32 %tmp46, %struct.bitmap_head_def* null )
- %tmp44.off = add i32 %tmp44, -50000000 ; <i32> [#uses=1]
- %tmp52 = icmp ugt i32 %tmp44.off, 4 ; <i1> [#uses=1]
- %tmp52.upgrd.1 = zext i1 %tmp52 to i32 ; <i32> [#uses=1]
- br label %bb87
-
-cond_next55: ; preds = %cond_next27
- ret i1 false
-
-bb87: ; preds = %cond_next41, %bb6
- %tmp2.0 = phi i32 [ %tmp52.upgrd.1, %cond_next41 ], [ 1, %bb6 ] ; <i32> [#uses=0]
- ret i1 false
-
-bb91: ; preds = %entry
- ret i1 false
-
-cond_next135: ; preds = %entry
- %tmp193 = call i1 @determine_use_iv_cost_generic( %struct.ivopts_data* %data, %struct.iv_use* %use, %struct.iv_cand* %cand ) ; <i1> [#uses=0]
- ret i1 false
-}
-
-declare void @set_use_iv_cost(%struct.ivopts_data*, %struct.iv_use*, %struct.iv_cand*, i32, %struct.bitmap_head_def*)
-
-declare i32 @force_var_cost(%struct.ivopts_data*, %struct.tree_node*, %struct.bitmap_head_def**)
-
-declare i1 @determine_use_iv_cost_generic(%struct.ivopts_data*, %struct.iv_use*, %struct.iv_cand*)
diff --git a/release_23/test/CodeGen/Generic/2006-09-02-LocalAllocCrash.ll b/release_23/test/CodeGen/Generic/2006-09-02-LocalAllocCrash.ll
deleted file mode 100644
index c6d0dfee3815..000000000000
--- a/release_23/test/CodeGen/Generic/2006-09-02-LocalAllocCrash.ll
+++ /dev/null
@@ -1,117 +0,0 @@
-; RUN: llvm-as < %s | llc -regalloc=local
-
-%struct.CHESS_POSITION = type { i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i32, i32, i8, i8, [64 x i8], i8, i8, i8, i8, i8 }
-@search = external global %struct.CHESS_POSITION ; <%struct.CHESS_POSITION*> [#uses=2]
-@bishop_shift_rl45 = external global [64 x i32] ; <[64 x i32]*> [#uses=1]
-@bishop_shift_rr45 = external global [64 x i32] ; <[64 x i32]*> [#uses=1]
-@black_outpost = external global [64 x i8] ; <[64 x i8]*> [#uses=1]
-@bishop_mobility_rl45 = external global [64 x [256 x i32]] ; <[64 x [256 x i32]]*> [#uses=1]
-@bishop_mobility_rr45 = external global [64 x [256 x i32]] ; <[64 x [256 x i32]]*> [#uses=1]
-
-declare fastcc i32 @FirstOne()
-
-define fastcc void @Evaluate() {
-entry:
- br i1 false, label %cond_false186, label %cond_true
-
-cond_true: ; preds = %entry
- ret void
-
-cond_false186: ; preds = %entry
- br i1 false, label %cond_true293, label %bb203
-
-bb203: ; preds = %cond_false186
- ret void
-
-cond_true293: ; preds = %cond_false186
- br i1 false, label %cond_true298, label %cond_next317
-
-cond_true298: ; preds = %cond_true293
- br i1 false, label %cond_next518, label %cond_true397.preheader
-
-cond_next317: ; preds = %cond_true293
- ret void
-
-cond_true397.preheader: ; preds = %cond_true298
- ret void
-
-cond_next518: ; preds = %cond_true298
- br i1 false, label %bb1069, label %cond_true522
-
-cond_true522: ; preds = %cond_next518
- ret void
-
-bb1069: ; preds = %cond_next518
- br i1 false, label %cond_next1131, label %bb1096
-
-bb1096: ; preds = %bb1069
- ret void
-
-cond_next1131: ; preds = %bb1069
- br i1 false, label %cond_next1207, label %cond_true1150
-
-cond_true1150: ; preds = %cond_next1131
- ret void
-
-cond_next1207: ; preds = %cond_next1131
- br i1 false, label %cond_next1219, label %cond_true1211
-
-cond_true1211: ; preds = %cond_next1207
- ret void
-
-cond_next1219: ; preds = %cond_next1207
- br i1 false, label %cond_true1223, label %cond_next1283
-
-cond_true1223: ; preds = %cond_next1219
- br i1 false, label %cond_true1254, label %cond_true1264
-
-cond_true1254: ; preds = %cond_true1223
- br i1 false, label %bb1567, label %cond_true1369.preheader
-
-cond_true1264: ; preds = %cond_true1223
- ret void
-
-cond_next1283: ; preds = %cond_next1219
- ret void
-
-cond_true1369.preheader: ; preds = %cond_true1254
- ret void
-
-bb1567: ; preds = %cond_true1254
- %tmp1580 = load i64* getelementptr (%struct.CHESS_POSITION* @search, i32 0, i32 3) ; <i64> [#uses=1]
- %tmp1591 = load i64* getelementptr (%struct.CHESS_POSITION* @search, i32 0, i32 4) ; <i64> [#uses=1]
- %tmp1572 = tail call fastcc i32 @FirstOne( ) ; <i32> [#uses=5]
- %tmp1582 = getelementptr [64 x i32]* @bishop_shift_rl45, i32 0, i32 %tmp1572 ; <i32*> [#uses=1]
- %tmp1583 = load i32* %tmp1582 ; <i32> [#uses=1]
- %tmp1583.upgrd.1 = trunc i32 %tmp1583 to i8 ; <i8> [#uses=1]
- %shift.upgrd.2 = zext i8 %tmp1583.upgrd.1 to i64 ; <i64> [#uses=1]
- %tmp1584 = lshr i64 %tmp1580, %shift.upgrd.2 ; <i64> [#uses=1]
- %tmp1584.upgrd.3 = trunc i64 %tmp1584 to i32 ; <i32> [#uses=1]
- %tmp1585 = and i32 %tmp1584.upgrd.3, 255 ; <i32> [#uses=1]
- %gep.upgrd.4 = zext i32 %tmp1585 to i64 ; <i64> [#uses=1]
- %tmp1587 = getelementptr [64 x [256 x i32]]* @bishop_mobility_rl45, i32 0, i32 %tmp1572, i64 %gep.upgrd.4 ; <i32*> [#uses=1]
- %tmp1588 = load i32* %tmp1587 ; <i32> [#uses=1]
- %tmp1593 = getelementptr [64 x i32]* @bishop_shift_rr45, i32 0, i32 %tmp1572 ; <i32*> [#uses=1]
- %tmp1594 = load i32* %tmp1593 ; <i32> [#uses=1]
- %tmp1594.upgrd.5 = trunc i32 %tmp1594 to i8 ; <i8> [#uses=1]
- %shift.upgrd.6 = zext i8 %tmp1594.upgrd.5 to i64 ; <i64> [#uses=1]
- %tmp1595 = lshr i64 %tmp1591, %shift.upgrd.6 ; <i64> [#uses=1]
- %tmp1595.upgrd.7 = trunc i64 %tmp1595 to i32 ; <i32> [#uses=1]
- %tmp1596 = and i32 %tmp1595.upgrd.7, 255 ; <i32> [#uses=1]
- %gep.upgrd.8 = zext i32 %tmp1596 to i64 ; <i64> [#uses=1]
- %tmp1598 = getelementptr [64 x [256 x i32]]* @bishop_mobility_rr45, i32 0, i32 %tmp1572, i64 %gep.upgrd.8 ; <i32*> [#uses=1]
- %tmp1599 = load i32* %tmp1598 ; <i32> [#uses=1]
- %tmp1600.neg = sub i32 0, %tmp1588 ; <i32> [#uses=1]
- %tmp1602 = sub i32 %tmp1600.neg, %tmp1599 ; <i32> [#uses=1]
- %tmp1604 = getelementptr [64 x i8]* @black_outpost, i32 0, i32 %tmp1572 ; <i8*> [#uses=1]
- %tmp1605 = load i8* %tmp1604 ; <i8> [#uses=1]
- %tmp1606 = icmp eq i8 %tmp1605, 0 ; <i1> [#uses=1]
- br i1 %tmp1606, label %cond_next1637, label %cond_true1607
-
-cond_true1607: ; preds = %bb1567
- ret void
-
-cond_next1637: ; preds = %bb1567
- %tmp1662 = sub i32 %tmp1602, 0 ; <i32> [#uses=0]
- ret void
-}
diff --git a/release_23/test/CodeGen/Generic/2006-09-06-SwitchLowering.ll b/release_23/test/CodeGen/Generic/2006-09-06-SwitchLowering.ll
deleted file mode 100644
index 2134d3302bc2..000000000000
--- a/release_23/test/CodeGen/Generic/2006-09-06-SwitchLowering.ll
+++ /dev/null
@@ -1,96 +0,0 @@
-; RUN: llvm-as < %s | llc
-
-define void @foo() {
- br label %cond_true813.i
-
-cond_true813.i: ; preds = %0
- br i1 false, label %cond_true818.i, label %cond_next1146.i
-
-cond_true818.i: ; preds = %cond_true813.i
- br i1 false, label %recog_memoized.exit52, label %cond_next1146.i
-
-recog_memoized.exit52: ; preds = %cond_true818.i
- switch i32 0, label %bb886.i.preheader [
- i32 0, label %bb907.i
- i32 44, label %bb866.i
- i32 103, label %bb874.i
- i32 114, label %bb874.i
- ]
-
-bb857.i: ; preds = %bb886.i, %bb866.i
- %tmp862.i494.24 = phi i8* [ null, %bb866.i ], [ %tmp862.i494.26, %bb886.i ] ; <i8*> [#uses=4]
- switch i32 0, label %bb886.i.preheader [
- i32 0, label %bb907.i
- i32 44, label %bb866.i
- i32 103, label %bb874.i
- i32 114, label %bb874.i
- ]
-
-bb866.i.loopexit: ; preds = %bb874.i
- br label %bb866.i
-
-bb866.i.loopexit31: ; preds = %cond_true903.i
- br label %bb866.i
-
-bb866.i: ; preds = %bb866.i.loopexit31, %bb866.i.loopexit, %bb857.i, %recog_memoized.exit52
- br i1 false, label %bb907.i, label %bb857.i
-
-bb874.i.preheader.loopexit: ; preds = %cond_true903.i, %cond_true903.i
- ret void
-
-bb874.i: ; preds = %bb857.i, %bb857.i, %recog_memoized.exit52, %recog_memoized.exit52
- %tmp862.i494.25 = phi i8* [ %tmp862.i494.24, %bb857.i ], [ %tmp862.i494.24, %bb857.i ], [ undef, %recog_memoized.exit52 ], [ undef, %recog_memoized.exit52 ] ; <i8*> [#uses=1]
- switch i32 0, label %bb886.i.preheader.loopexit [
- i32 0, label %bb907.i
- i32 44, label %bb866.i.loopexit
- i32 103, label %bb874.i.backedge
- i32 114, label %bb874.i.backedge
- ]
-
-bb874.i.backedge: ; preds = %bb874.i, %bb874.i
- ret void
-
-bb886.i.preheader.loopexit: ; preds = %bb874.i
- ret void
-
-bb886.i.preheader: ; preds = %bb857.i, %recog_memoized.exit52
- %tmp862.i494.26 = phi i8* [ undef, %recog_memoized.exit52 ], [ %tmp862.i494.24, %bb857.i ] ; <i8*> [#uses=1]
- br label %bb886.i
-
-bb886.i: ; preds = %cond_true903.i, %bb886.i.preheader
- br i1 false, label %bb857.i, label %cond_true903.i
-
-cond_true903.i: ; preds = %bb886.i
- switch i32 0, label %bb886.i [
- i32 0, label %bb907.i
- i32 44, label %bb866.i.loopexit31
- i32 103, label %bb874.i.preheader.loopexit
- i32 114, label %bb874.i.preheader.loopexit
- ]
-
-bb907.i: ; preds = %cond_true903.i, %bb874.i, %bb866.i, %bb857.i, %recog_memoized.exit52
- %tmp862.i494.0 = phi i8* [ %tmp862.i494.24, %bb857.i ], [ null, %bb866.i ], [ undef, %recog_memoized.exit52 ], [ %tmp862.i494.25, %bb874.i ], [ null, %cond_true903.i ] ; <i8*> [#uses=1]
- br i1 false, label %cond_next1146.i, label %cond_true910.i
-
-cond_true910.i: ; preds = %bb907.i
- ret void
-
-cond_next1146.i: ; preds = %bb907.i, %cond_true818.i, %cond_true813.i
- %tmp862.i494.1 = phi i8* [ %tmp862.i494.0, %bb907.i ], [ undef, %cond_true818.i ], [ undef, %cond_true813.i ] ; <i8*> [#uses=0]
- ret void
-
-bb2060.i: ; No predecessors!
- br i1 false, label %cond_true2064.i, label %bb2067.i
-
-cond_true2064.i: ; preds = %bb2060.i
- unreachable
-
-bb2067.i: ; preds = %bb2060.i
- ret void
-
-cond_next3473: ; No predecessors!
- ret void
-
-cond_next3521: ; No predecessors!
- ret void
-}
diff --git a/release_23/test/CodeGen/Generic/2006-10-27-CondFolding.ll b/release_23/test/CodeGen/Generic/2006-10-27-CondFolding.ll
deleted file mode 100644
index b3cfb9941bbb..000000000000
--- a/release_23/test/CodeGen/Generic/2006-10-27-CondFolding.ll
+++ /dev/null
@@ -1,21 +0,0 @@
-; RUN: llvm-as < %s | llc
-
-define void @start_pass_huff(i32 %gather_statistics) {
-entry:
- %tmp = icmp eq i32 %gather_statistics, 0 ; <i1> [#uses=1]
- br i1 false, label %cond_next22, label %bb166
-
-cond_next22: ; preds = %entry
- %bothcond = and i1 false, %tmp ; <i1> [#uses=1]
- br i1 %bothcond, label %bb34, label %bb46
-
-bb34: ; preds = %cond_next22
- ret void
-
-bb46: ; preds = %cond_next22
- ret void
-
-bb166: ; preds = %entry
- ret void
-}
-
diff --git a/release_23/test/CodeGen/Generic/2006-10-29-Crash.ll b/release_23/test/CodeGen/Generic/2006-10-29-Crash.ll
deleted file mode 100644
index cabec54d1610..000000000000
--- a/release_23/test/CodeGen/Generic/2006-10-29-Crash.ll
+++ /dev/null
@@ -1,22 +0,0 @@
-; RUN: llvm-as < %s | llc
-
-define void @form_component_prediction(i32 %dy) {
-entry:
- %tmp7 = and i32 %dy, 1 ; <i32> [#uses=1]
- %tmp27 = icmp eq i32 %tmp7, 0 ; <i1> [#uses=1]
- br i1 false, label %cond_next30, label %bb115
-
-cond_next30: ; preds = %entry
- ret void
-
-bb115: ; preds = %entry
- %bothcond1 = or i1 %tmp27, false ; <i1> [#uses=1]
- br i1 %bothcond1, label %bb228, label %cond_next125
-
-cond_next125: ; preds = %bb115
- ret void
-
-bb228: ; preds = %bb115
- ret void
-}
-
diff --git a/release_23/test/CodeGen/Generic/2006-11-06-MemIntrinsicExpand.ll b/release_23/test/CodeGen/Generic/2006-11-06-MemIntrinsicExpand.ll
deleted file mode 100644
index a773759f36ea..000000000000
--- a/release_23/test/CodeGen/Generic/2006-11-06-MemIntrinsicExpand.ll
+++ /dev/null
@@ -1,11 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 | not grep adc
-; PR987
-
-declare void @llvm.memcpy.i64(i8*, i8*, i64, i32)
-
-define void @foo(i64 %a) {
- %b = add i64 %a, 1 ; <i64> [#uses=1]
- call void @llvm.memcpy.i64( i8* null, i8* null, i64 %b, i32 1 )
- ret void
-}
-
diff --git a/release_23/test/CodeGen/Generic/2006-11-20-DAGCombineCrash.ll b/release_23/test/CodeGen/Generic/2006-11-20-DAGCombineCrash.ll
deleted file mode 100644
index 95ef53c62ec5..000000000000
--- a/release_23/test/CodeGen/Generic/2006-11-20-DAGCombineCrash.ll
+++ /dev/null
@@ -1,41 +0,0 @@
-; RUN: llvm-as < %s | llc
-; PR1011
-%struct.mng_data = type { i8* (%struct.mng_data*, i32)*, i32, i32, i32, i8, i8, i32, i32, i32, i32, i32 }
-
-define void @mng_display_bgr565() {
-entry:
- br i1 false, label %bb.preheader, label %return
-
-bb.preheader: ; preds = %entry
- br i1 false, label %cond_true48, label %cond_next80
-
-cond_true48: ; preds = %bb.preheader
- %tmp = load i8* null ; <i8> [#uses=1]
- %tmp51 = zext i8 %tmp to i16 ; <i16> [#uses=1]
- %tmp99 = load i8* null ; <i8> [#uses=1]
- %tmp54 = bitcast i8 %tmp99 to i8 ; <i8> [#uses=1]
- %tmp54.upgrd.1 = zext i8 %tmp54 to i32 ; <i32> [#uses=1]
- %tmp55 = lshr i32 %tmp54.upgrd.1, 3 ; <i32> [#uses=1]
- %tmp55.upgrd.2 = trunc i32 %tmp55 to i16 ; <i16> [#uses=1]
- %tmp52 = shl i16 %tmp51, 5 ; <i16> [#uses=1]
- %tmp56 = and i16 %tmp55.upgrd.2, 28 ; <i16> [#uses=1]
- %tmp57 = or i16 %tmp56, %tmp52 ; <i16> [#uses=1]
- %tmp60 = zext i16 %tmp57 to i32 ; <i32> [#uses=1]
- %tmp62 = xor i32 0, 65535 ; <i32> [#uses=1]
- %tmp63 = mul i32 %tmp60, %tmp62 ; <i32> [#uses=1]
- %tmp65 = add i32 0, %tmp63 ; <i32> [#uses=1]
- %tmp69 = add i32 0, %tmp65 ; <i32> [#uses=1]
- %tmp70 = lshr i32 %tmp69, 16 ; <i32> [#uses=1]
- %tmp70.upgrd.3 = trunc i32 %tmp70 to i16 ; <i16> [#uses=1]
- %tmp75 = lshr i16 %tmp70.upgrd.3, 8 ; <i16> [#uses=1]
- %tmp75.upgrd.4 = trunc i16 %tmp75 to i8 ; <i8> [#uses=1]
- %tmp76 = lshr i8 %tmp75.upgrd.4, 5 ; <i8> [#uses=1]
- store i8 %tmp76, i8* null
- ret void
-
-cond_next80: ; preds = %bb.preheader
- ret void
-
-return: ; preds = %entry
- ret void
-}
diff --git a/release_23/test/CodeGen/Generic/2006-12-16-InlineAsmCrash.ll b/release_23/test/CodeGen/Generic/2006-12-16-InlineAsmCrash.ll
deleted file mode 100644
index 91ac3b9909dc..000000000000
--- a/release_23/test/CodeGen/Generic/2006-12-16-InlineAsmCrash.ll
+++ /dev/null
@@ -1,30 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86
-; PR1049
-target datalayout = "e-p:32:32"
-target triple = "i686-pc-linux-gnu"
- %struct.QBasicAtomic = type { i32 }
- %struct.QByteArray = type { %"struct.QByteArray::Data"* }
- %"struct.QByteArray::Data" = type { %struct.QBasicAtomic, i32, i32, i8*, [1 x i8] }
- %struct.QFactoryLoader = type { %struct.QObject }
- %struct.QImageIOHandler = type { i32 (...)**, %struct.QImageIOHandlerPrivate* }
- %struct.QImageIOHandlerPrivate = type opaque
- %struct.QImageWriter = type { %struct.QImageWriterPrivate* }
- %struct.QImageWriterPrivate = type { %struct.QByteArray, %struct.QFactoryLoader*, i1, %struct.QImageIOHandler*, i32, float, %struct.QString, %struct.QString, i32, %struct.QString, %struct.QImageWriter* }
- %"struct.QList<QByteArray>" = type { %"struct.QList<QByteArray>::._20" }
- %"struct.QList<QByteArray>::._20" = type { %struct.QListData }
- %struct.QListData = type { %"struct.QListData::Data"* }
- %"struct.QListData::Data" = type { %struct.QBasicAtomic, i32, i32, i32, i8, [1 x i8*] }
- %struct.QObject = type { i32 (...)**, %struct.QObjectData* }
- %struct.QObjectData = type { i32 (...)**, %struct.QObject*, %struct.QObject*, %"struct.QList<QByteArray>", i8, [3 x i8], i32, i32 }
- %struct.QString = type { %"struct.QString::Data"* }
- %"struct.QString::Data" = type { %struct.QBasicAtomic, i32, i32, i16*, i8, i8, [1 x i16] }
-
-define i1 @_ZNK12QImageWriter8canWriteEv() {
- %tmp62 = load %struct.QImageWriterPrivate** null ; <%struct.QImageWriterPrivate*> [#uses=1]
- %tmp = getelementptr %struct.QImageWriterPrivate* %tmp62, i32 0, i32 9 ; <%struct.QString*> [#uses=1]
- %tmp75 = call %struct.QString* @_ZN7QStringaSERKS_( %struct.QString* %tmp, %struct.QString* null ) ; <%struct.QString*> [#uses=0]
- call void asm sideeffect "lock\0Adecl $0\0Asetne 1", "=*m"( i32* null )
- ret i1 false
-}
-
-declare %struct.QString* @_ZN7QStringaSERKS_(%struct.QString*, %struct.QString*)
diff --git a/release_23/test/CodeGen/Generic/2007-01-15-LoadSelectCycle.ll b/release_23/test/CodeGen/Generic/2007-01-15-LoadSelectCycle.ll
deleted file mode 100644
index 49203d95d4a0..000000000000
--- a/release_23/test/CodeGen/Generic/2007-01-15-LoadSelectCycle.ll
+++ /dev/null
@@ -1,12 +0,0 @@
-; RUN: llvm-as < %s | llc
-; PR1114
-
-declare i1 @foo()
-
-define i32 @test(i32* %A, i32* %B) {
- %a = load i32* %A
- %b = load i32* %B
- %cond = call i1 @foo()
- %c = select i1 %cond, i32 %a, i32 %b
- ret i32 %c
-}
diff --git a/release_23/test/CodeGen/Generic/2007-02-16-BranchFold.ll b/release_23/test/CodeGen/Generic/2007-02-16-BranchFold.ll
deleted file mode 100644
index 0a8e49e56e49..000000000000
--- a/release_23/test/CodeGen/Generic/2007-02-16-BranchFold.ll
+++ /dev/null
@@ -1,95 +0,0 @@
-; PR 1200
-; RUN: llvm-as < %s | llc -enable-tail-merge=0 | not grep jmp
-
-; ModuleID = '<stdin>'
-target datalayout = "e-p:32:32"
-target triple = "i686-apple-darwin8"
- %struct.FILE = type { i8*, i32, i32, i16, i16, %struct.__sbuf, i32, i8*, i32 (i8*)*, i32 (i8*, i8*, i32)*, i64 (i8*, i64, i32)*, i32 (i8*, i8*, i32)*, %struct.__sbuf, %struct.__sFILEX*, i32, [3 x i8], [1 x i8], %struct.__sbuf, i32, i64 }
- %struct.Index_Map = type { i32, %struct.item_set** }
- %struct.Item = type { [4 x i16], %struct.rule* }
- %struct.__sFILEX = type opaque
- %struct.__sbuf = type { i8*, i32 }
- %struct.dimension = type { i16*, %struct.Index_Map, %struct.mapping*, i32, %struct.plankMap* }
- %struct.item_set = type { i32, i32, %struct.operator*, [2 x %struct.item_set*], %struct.item_set*, i16*, %struct.Item*, %struct.Item* }
- %struct.list = type { i8*, %struct.list* }
- %struct.mapping = type { %struct.list**, i32, i32, i32, %struct.item_set** }
- %struct.nonterminal = type { i8*, i32, i32, i32, %struct.plankMap*, %struct.rule* }
- %struct.operator = type { i8*, i8, i32, i32, i32, i32, %struct.table* }
- %struct.pattern = type { %struct.nonterminal*, %struct.operator*, [2 x %struct.nonterminal*] }
- %struct.plank = type { i8*, %struct.list*, i32 }
- %struct.plankMap = type { %struct.list*, i32, %struct.stateMap* }
- %struct.rule = type { [4 x i16], i32, i32, i32, %struct.nonterminal*, %struct.pattern*, i8 }
- %struct.stateMap = type { i8*, %struct.plank*, i32, i16* }
- %struct.table = type { %struct.operator*, %struct.list*, i16*, [2 x %struct.dimension*], %struct.item_set** }
-@outfile = external global %struct.FILE* ; <%struct.FILE**> [#uses=1]
-@str1 = external global [11 x i8] ; <[11 x i8]*> [#uses=1]
-
-declare i32 @fprintf(%struct.FILE*, i8*, ...)
-
-define i16 @main_bb_2E_i9_2E_i_2E_i932_2E_ce(%struct.list* %l_addr.01.0.i2.i.i929, %struct.operator** %tmp66.i62.i.out) {
-newFuncRoot:
- br label %bb.i9.i.i932.ce
-
-NewDefault: ; preds = %LeafBlock, %LeafBlock1, %LeafBlock2, %LeafBlock3
- br label %bb36.i.i.exitStub
-
-bb36.i.i.exitStub: ; preds = %NewDefault
- store %struct.operator* %tmp66.i62.i, %struct.operator** %tmp66.i62.i.out
- ret i16 0
-
-bb.i14.i.exitStub: ; preds = %LeafBlock
- store %struct.operator* %tmp66.i62.i, %struct.operator** %tmp66.i62.i.out
- ret i16 1
-
-bb12.i.i935.exitStub: ; preds = %LeafBlock1
- store %struct.operator* %tmp66.i62.i, %struct.operator** %tmp66.i62.i.out
- ret i16 2
-
-bb20.i.i937.exitStub: ; preds = %LeafBlock2
- store %struct.operator* %tmp66.i62.i, %struct.operator** %tmp66.i62.i.out
- ret i16 3
-
-bb28.i.i938.exitStub: ; preds = %LeafBlock3
- store %struct.operator* %tmp66.i62.i, %struct.operator** %tmp66.i62.i.out
- ret i16 4
-
-bb.i9.i.i932.ce: ; preds = %newFuncRoot
- %tmp1.i3.i.i930 = getelementptr %struct.list* %l_addr.01.0.i2.i.i929, i32 0, i32 0 ; <i8**> [#uses=1]
- %tmp2.i4.i.i931 = load i8** %tmp1.i3.i.i930 ; <i8*> [#uses=1]
- %tmp66.i62.i = bitcast i8* %tmp2.i4.i.i931 to %struct.operator* ; <%struct.operator*> [#uses=7]
- %tmp1.i6.i = getelementptr %struct.operator* %tmp66.i62.i, i32 0, i32 2 ; <i32*> [#uses=1]
- %tmp2.i7.i = load i32* %tmp1.i6.i ; <i32> [#uses=1]
- %tmp3.i8.i = load %struct.FILE** @outfile ; <%struct.FILE*> [#uses=1]
- %tmp5.i9.i = call i32 (%struct.FILE*, i8*, ...)* @fprintf( %struct.FILE* %tmp3.i8.i, i8* getelementptr ([11 x i8]* @str1, i32 0, i32 0), i32 %tmp2.i7.i ) ; <i32> [#uses=0]
- %tmp7.i10.i = getelementptr %struct.operator* %tmp66.i62.i, i32 0, i32 5 ; <i32*> [#uses=1]
- %tmp8.i11.i = load i32* %tmp7.i10.i ; <i32> [#uses=7]
- br label %NodeBlock5
-
-NodeBlock5: ; preds = %bb.i9.i.i932.ce
- icmp slt i32 %tmp8.i11.i, 1 ; <i1>:0 [#uses=1]
- br i1 %0, label %NodeBlock, label %NodeBlock4
-
-NodeBlock4: ; preds = %NodeBlock5
- icmp slt i32 %tmp8.i11.i, 2 ; <i1>:1 [#uses=1]
- br i1 %1, label %LeafBlock2, label %LeafBlock3
-
-LeafBlock3: ; preds = %NodeBlock4
- icmp eq i32 %tmp8.i11.i, 2 ; <i1>:2 [#uses=1]
- br i1 %2, label %bb28.i.i938.exitStub, label %NewDefault
-
-LeafBlock2: ; preds = %NodeBlock4
- icmp eq i32 %tmp8.i11.i, 1 ; <i1>:3 [#uses=1]
- br i1 %3, label %bb20.i.i937.exitStub, label %NewDefault
-
-NodeBlock: ; preds = %NodeBlock5
- icmp slt i32 %tmp8.i11.i, 0 ; <i1>:4 [#uses=1]
- br i1 %4, label %LeafBlock, label %LeafBlock1
-
-LeafBlock1: ; preds = %NodeBlock
- icmp eq i32 %tmp8.i11.i, 0 ; <i1>:5 [#uses=1]
- br i1 %5, label %bb12.i.i935.exitStub, label %NewDefault
-
-LeafBlock: ; preds = %NodeBlock
- icmp eq i32 %tmp8.i11.i, -1 ; <i1>:6 [#uses=1]
- br i1 %6, label %bb.i14.i.exitStub, label %NewDefault
-}
diff --git a/release_23/test/CodeGen/Generic/2007-02-23-DAGCombine-Miscompile.ll b/release_23/test/CodeGen/Generic/2007-02-23-DAGCombine-Miscompile.ll
deleted file mode 100644
index 8b7db478181e..000000000000
--- a/release_23/test/CodeGen/Generic/2007-02-23-DAGCombine-Miscompile.ll
+++ /dev/null
@@ -1,13 +0,0 @@
-; PR1219
-; RUN: llvm-as < %s | llc -march=x86 | grep {movl \$1, %eax}
-
-define i32 @test(i1 %X) {
-old_entry1:
- %hvar2 = zext i1 %X to i32
- %C = icmp sgt i32 %hvar2, -1
- br i1 %C, label %cond_true15, label %cond_true
-cond_true15:
- ret i32 1
-cond_true:
- ret i32 2
-}
diff --git a/release_23/test/CodeGen/Generic/2007-02-25-invoke.ll b/release_23/test/CodeGen/Generic/2007-02-25-invoke.ll
deleted file mode 100644
index 6dba99e21f79..000000000000
--- a/release_23/test/CodeGen/Generic/2007-02-25-invoke.ll
+++ /dev/null
@@ -1,12 +0,0 @@
-; RUN: llvm-as < %s | llc
-
-; PR1224
-
-declare i32 @test()
-define i32 @test2() {
- %A = invoke i32 @test() to label %invcont unwind label %blat
-invcont:
- ret i32 %A
-blat:
- ret i32 0
-}
diff --git a/release_23/test/CodeGen/Generic/2007-04-08-MultipleFrameIndices.ll b/release_23/test/CodeGen/Generic/2007-04-08-MultipleFrameIndices.ll
deleted file mode 100644
index 9cbf3146eb80..000000000000
--- a/release_23/test/CodeGen/Generic/2007-04-08-MultipleFrameIndices.ll
+++ /dev/null
@@ -1,11 +0,0 @@
-; RUN: llvm-as < %s | llc
-; XFAIL: sparc-sun-solaris2
-; PR1308
-; PR1557
-
-define i32 @stuff(i32, ...) {
- %foo = alloca i8*
- %bar = alloca i32*
- %A = call i32 asm sideeffect "inline asm $0 $2 $3 $4", "=r,0,i,m,m"( i32 0, i32 1, i8** %foo, i32** %bar )
- ret i32 %A
-}
diff --git a/release_23/test/CodeGen/Generic/2007-04-13-SwitchLowerBadPhi.ll b/release_23/test/CodeGen/Generic/2007-04-13-SwitchLowerBadPhi.ll
deleted file mode 100644
index b95a3613904b..000000000000
--- a/release_23/test/CodeGen/Generic/2007-04-13-SwitchLowerBadPhi.ll
+++ /dev/null
@@ -1,27 +0,0 @@
-; RUN: llvm-as < %s | llc -fast
-; PR 1323
-
-; ModuleID = 'test.bc'
-target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64"
-target triple = "i686-apple-darwin8"
- %struct.comp = type { i8*, i32, i8*, [3 x i8], i32 }
-
-define void @regbranch() {
-cond_next240.i:
- br i1 false, label %cond_true251.i, label %cond_next272.i
-
-cond_true251.i: ; preds = %cond_next240.i
- switch i8 0, label %cond_next272.i [
- i8 42, label %bb268.i
- i8 43, label %bb268.i
- i8 63, label %bb268.i
- ]
-
-bb268.i: ; preds = %cond_true251.i, %cond_true251.i, %cond_true251.i
- br label %cond_next272.i
-
-cond_next272.i: ; preds = %bb268.i, %cond_true251.i, %cond_next240.i
- %len.2.i = phi i32 [ 0, %bb268.i ], [ 0, %cond_next240.i ], [ 0, %cond_true251.i ] ; <i32> [#uses=1]
- %tmp278.i = icmp eq i32 %len.2.i, 1 ; <i1> [#uses=0]
- ret void
-}
diff --git a/release_23/test/CodeGen/Generic/2007-04-14-BitTestsBadMask.ll b/release_23/test/CodeGen/Generic/2007-04-14-BitTestsBadMask.ll
deleted file mode 100644
index 5490687e1ba8..000000000000
--- a/release_23/test/CodeGen/Generic/2007-04-14-BitTestsBadMask.ll
+++ /dev/null
@@ -1,160 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 | grep 8388635
-; RUN: llvm-as < %s | llc -march=x86-64 | grep 4294981120
-; PR 1325
-
-; ModuleID = 'bugpoint.test.bc'
-target datalayout = "E-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64"
-target triple = "powerpc-apple-darwin8.8.0"
-;target triple = "i686-linux-gnu"
- %struct.FILE = type { i8*, i32, i32, i16, i16, %struct.__sbuf, i32, i8*, i32 (i8*)*, i32 (i8*, i8*, i32)*, i64 (i8*, i64, i32)*, i32 (i8*, i8*, i32)*, %struct.__sbuf, %struct.__sFILEX*, i32, [3 x i8], [1 x i8], %struct.__sbuf, i32, i64 }
- %struct.__sFILEX = type opaque
- %struct.__sbuf = type { i8*, i32 }
-@PL_rsfp = external global %struct.FILE* ; <%struct.FILE**> [#uses=1]
-@PL_bufend = external global i8* ; <i8**> [#uses=1]
-@PL_in_eval = external global i32 ; <i32*> [#uses=1]
-
-declare fastcc void @incline(i8*)
-
-define i16 @Perl_skipspace_bb60(i8* %s, i8** %s_addr.4.out) {
-newFuncRoot:
- %tmp138.loc = alloca i8* ; <i8**> [#uses=2]
- %s_addr.4.loc = alloca i8* ; <i8**> [#uses=2]
- %tmp274.loc = alloca i8* ; <i8**> [#uses=2]
- br label %bb60
-
-cond_next154.UnifiedReturnBlock_crit_edge.exitStub: ; preds = %codeRepl
- store i8* %s_addr.4.reload, i8** %s_addr.4.out
- ret i16 0
-
-cond_next161.UnifiedReturnBlock_crit_edge.exitStub: ; preds = %codeRepl
- store i8* %s_addr.4.reload, i8** %s_addr.4.out
- ret i16 1
-
-cond_next167.UnifiedReturnBlock_crit_edge.exitStub: ; preds = %codeRepl
- store i8* %s_addr.4.reload, i8** %s_addr.4.out
- ret i16 2
-
-cond_false29.i.cond_true190_crit_edge.exitStub: ; preds = %codeRepl
- store i8* %s_addr.4.reload, i8** %s_addr.4.out
- ret i16 3
-
-cond_next.i.cond_true190_crit_edge.exitStub: ; preds = %codeRepl
- store i8* %s_addr.4.reload, i8** %s_addr.4.out
- ret i16 4
-
-cond_true19.i.cond_true190_crit_edge.exitStub: ; preds = %codeRepl
- store i8* %s_addr.4.reload, i8** %s_addr.4.out
- ret i16 5
-
-bb60: ; preds = %bb60.backedge, %newFuncRoot
- %s_addr.2 = phi i8* [ %s, %newFuncRoot ], [ %s_addr.2.be, %bb60.backedge ] ; <i8*> [#uses=3]
- %tmp61 = load i8** @PL_bufend ; <i8*> [#uses=1]
- %tmp63 = icmp ult i8* %s_addr.2, %tmp61 ; <i1> [#uses=1]
- br i1 %tmp63, label %bb60.cond_next67_crit_edge, label %bb60.bb101_crit_edge
-
-bb37: ; preds = %cond_next67.bb37_crit_edge5, %cond_next67.bb37_crit_edge4, %cond_next67.bb37_crit_edge3, %cond_next67.bb37_crit_edge2, %cond_next67.bb37_crit_edge
- %tmp40 = icmp eq i8 %tmp69, 10 ; <i1> [#uses=1]
- %tmp43 = getelementptr i8* %s_addr.27.2, i32 1 ; <i8*> [#uses=5]
- br i1 %tmp40, label %cond_true45, label %bb37.bb60_crit_edge
-
-cond_true45: ; preds = %bb37
- %tmp46 = volatile load i32* @PL_in_eval ; <i32> [#uses=1]
- %tmp47 = icmp eq i32 %tmp46, 0 ; <i1> [#uses=1]
- br i1 %tmp47, label %cond_true45.bb60_crit_edge, label %cond_true50
-
-cond_true50: ; preds = %cond_true45
- %tmp51 = volatile load %struct.FILE** @PL_rsfp ; <%struct.FILE*> [#uses=1]
- %tmp52 = icmp eq %struct.FILE* %tmp51, null ; <i1> [#uses=1]
- br i1 %tmp52, label %cond_true55, label %cond_true50.bb60_crit_edge
-
-cond_true55: ; preds = %cond_true50
- tail call fastcc void @incline( i8* %tmp43 )
- br label %bb60.backedge
-
-cond_next67: ; preds = %Perl_newSV.exit.cond_next67_crit_edge, %cond_true148.cond_next67_crit_edge, %bb60.cond_next67_crit_edge
- %s_addr.27.2 = phi i8* [ %s_addr.2, %bb60.cond_next67_crit_edge ], [ %tmp274.reload, %Perl_newSV.exit.cond_next67_crit_edge ], [ %tmp138.reload, %cond_true148.cond_next67_crit_edge ] ; <i8*> [#uses=3]
- %tmp69 = load i8* %s_addr.27.2 ; <i8> [#uses=2]
- switch i8 %tmp69, label %cond_next67.bb101_crit_edge [
- i8 32, label %cond_next67.bb37_crit_edge
- i8 9, label %cond_next67.bb37_crit_edge2
- i8 10, label %cond_next67.bb37_crit_edge3
- i8 13, label %cond_next67.bb37_crit_edge4
- i8 12, label %cond_next67.bb37_crit_edge5
- ]
-
-codeRepl: ; preds = %bb101.preheader
- %targetBlock = call i16 @Perl_skipspace_bb60_bb101( i8* %s_addr.27.3.ph, i8** %tmp274.loc, i8** %s_addr.4.loc, i8** %tmp138.loc ) ; <i16> [#uses=1]
- %tmp274.reload = load i8** %tmp274.loc ; <i8*> [#uses=4]
- %s_addr.4.reload = load i8** %s_addr.4.loc ; <i8*> [#uses=6]
- %tmp138.reload = load i8** %tmp138.loc ; <i8*> [#uses=1]
- switch i16 %targetBlock, label %cond_true19.i.cond_true190_crit_edge.exitStub [
- i16 0, label %cond_next271.bb60_crit_edge
- i16 1, label %cond_true290.bb60_crit_edge
- i16 2, label %cond_true295.bb60_crit_edge
- i16 3, label %Perl_newSV.exit.cond_next67_crit_edge
- i16 4, label %cond_true148.cond_next67_crit_edge
- i16 5, label %cond_next154.UnifiedReturnBlock_crit_edge.exitStub
- i16 6, label %cond_next161.UnifiedReturnBlock_crit_edge.exitStub
- i16 7, label %cond_next167.UnifiedReturnBlock_crit_edge.exitStub
- i16 8, label %cond_false29.i.cond_true190_crit_edge.exitStub
- i16 9, label %cond_next.i.cond_true190_crit_edge.exitStub
- ]
-
-bb37.bb60_crit_edge: ; preds = %bb37
- br label %bb60.backedge
-
-cond_true45.bb60_crit_edge: ; preds = %cond_true45
- br label %bb60.backedge
-
-cond_true50.bb60_crit_edge: ; preds = %cond_true50
- br label %bb60.backedge
-
-bb60.cond_next67_crit_edge: ; preds = %bb60
- br label %cond_next67
-
-bb60.bb101_crit_edge: ; preds = %bb60
- br label %bb101.preheader
-
-cond_next67.bb101_crit_edge: ; preds = %cond_next67
- br label %bb101.preheader
-
-cond_next67.bb37_crit_edge: ; preds = %cond_next67
- br label %bb37
-
-cond_next67.bb37_crit_edge2: ; preds = %cond_next67
- br label %bb37
-
-cond_next67.bb37_crit_edge3: ; preds = %cond_next67
- br label %bb37
-
-cond_next67.bb37_crit_edge4: ; preds = %cond_next67
- br label %bb37
-
-cond_next67.bb37_crit_edge5: ; preds = %cond_next67
- br label %bb37
-
-cond_true148.cond_next67_crit_edge: ; preds = %codeRepl
- br label %cond_next67
-
-cond_next271.bb60_crit_edge: ; preds = %codeRepl
- br label %bb60.backedge
-
-cond_true290.bb60_crit_edge: ; preds = %codeRepl
- br label %bb60.backedge
-
-cond_true295.bb60_crit_edge: ; preds = %codeRepl
- br label %bb60.backedge
-
-Perl_newSV.exit.cond_next67_crit_edge: ; preds = %codeRepl
- br label %cond_next67
-
-bb101.preheader: ; preds = %cond_next67.bb101_crit_edge, %bb60.bb101_crit_edge
- %s_addr.27.3.ph = phi i8* [ %s_addr.27.2, %cond_next67.bb101_crit_edge ], [ %s_addr.2, %bb60.bb101_crit_edge ] ; <i8*> [#uses=1]
- br label %codeRepl
-
-bb60.backedge: ; preds = %cond_true295.bb60_crit_edge, %cond_true290.bb60_crit_edge, %cond_next271.bb60_crit_edge, %cond_true50.bb60_crit_edge, %cond_true45.bb60_crit_edge, %bb37.bb60_crit_edge, %cond_true55
- %s_addr.2.be = phi i8* [ %tmp43, %cond_true55 ], [ %tmp43, %bb37.bb60_crit_edge ], [ %tmp43, %cond_true45.bb60_crit_edge ], [ %tmp43, %cond_true50.bb60_crit_edge ], [ %tmp274.reload, %cond_next271.bb60_crit_edge ], [ %tmp274.reload, %cond_true290.bb60_crit_edge ], [ %tmp274.reload, %cond_true295.bb60_crit_edge ] ; <i8*> [#uses=1]
- br label %bb60
-}
-
-declare i16 @Perl_skipspace_bb60_bb101(i8*, i8**, i8**, i8**)
diff --git a/release_23/test/CodeGen/Generic/2007-04-14-EHSelectorCrash.ll b/release_23/test/CodeGen/Generic/2007-04-14-EHSelectorCrash.ll
deleted file mode 100644
index be039bf757d3..000000000000
--- a/release_23/test/CodeGen/Generic/2007-04-14-EHSelectorCrash.ll
+++ /dev/null
@@ -1,18 +0,0 @@
-; RUN: llvm-as < %s | llc -enable-eh
-; RUN: llvm-as < %s | llc -enable-eh -march=x86-64
-; XFAIL: *
-; Un-XFAIL this when PR1508 is fixed.
-
-; PR1326
-
-@__gnat_others_value = external constant i32 ; <i32*> [#uses=1]
-
-define void @_ada_eh() {
-entry:
- %eh_select = tail call i32 (i8*, i8*, ...)* @llvm.eh.selector( i8* null, i8* bitcast (i32 (...)* @__gnat_eh_personality to i8*), i32* @__gnat_others_value ) ; <i32> [#uses=0]
- ret void
-}
-
-declare i32 @llvm.eh.selector(i8*, i8*, ...)
-
-declare i32 @__gnat_eh_personality(...)
diff --git a/release_23/test/CodeGen/Generic/2007-04-17-lsr-crash.ll b/release_23/test/CodeGen/Generic/2007-04-17-lsr-crash.ll
deleted file mode 100644
index 4257e9f4c2dc..000000000000
--- a/release_23/test/CodeGen/Generic/2007-04-17-lsr-crash.ll
+++ /dev/null
@@ -1,35 +0,0 @@
-; RUN: llvm-as < %s | llc
-
-define void @foo(i32 %inTextSize) {
-entry:
- br label %bb236.outer
-
-cond_next193: ; preds = %bb236
- %tmp211 = add i32 %inTextSize_addr.1.ph17, -2 ; <i32> [#uses=1]
- br i1 false, label %cond_next232, label %cond_true227
-
-cond_true227: ; preds = %cond_next193
- ret void
-
-cond_next232: ; preds = %cond_next193
- %indvar.next49 = add i32 %indvar48, 1 ; <i32> [#uses=1]
- br label %bb236.outer
-
-bb236.outer: ; preds = %cond_next232, %entry
- %indvar48 = phi i32 [ %indvar.next49, %cond_next232 ], [ 0, %entry ] ; <i32> [#uses=2]
- %inTextSize_addr.1.ph17 = phi i32 [ %tmp211, %cond_next232 ], [ %inTextSize, %entry ] ; <i32> [#uses=3]
- %tmp.50 = sub i32 0, %indvar48 ; <i32> [#uses=1]
- %tmp219 = icmp eq i32 %tmp.50, 0 ; <i1> [#uses=1]
- br i1 %tmp219, label %bb236.us, label %bb236
-
-bb236.us: ; preds = %bb236.outer
- %inTextSize_addr.1.us = add i32 0, %inTextSize_addr.1.ph17 ; <i32> [#uses=0]
- ret void
-
-bb236: ; preds = %bb236.outer
- %tmp238 = icmp eq i32 %inTextSize_addr.1.ph17, 0 ; <i1> [#uses=1]
- br i1 %tmp238, label %exit, label %cond_next193
-
-exit: ; preds = %bb236
- ret void
-}
diff --git a/release_23/test/CodeGen/Generic/2007-04-27-BitTestsBadMask.ll b/release_23/test/CodeGen/Generic/2007-04-27-BitTestsBadMask.ll
deleted file mode 100644
index 16d7a1654d93..000000000000
--- a/release_23/test/CodeGen/Generic/2007-04-27-BitTestsBadMask.ll
+++ /dev/null
@@ -1,18 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 | grep je | count 3
-; RUN: llvm-as < %s | llc -march=x86-64 | grep 4297064449
-; PR 1325+
-
-define i32 @foo(i8 %bar) {
-entry:
- switch i8 %bar, label %bb1203 [
- i8 117, label %bb1204
- i8 85, label %bb1204
- i8 106, label %bb1204
- ]
-
-bb1203: ; preds = %entry
- ret i32 1
-
-bb1204: ; preds = %entry, %entry, %entry
- ret i32 2
-}
diff --git a/release_23/test/CodeGen/Generic/2007-04-27-InlineAsm-X-Dest.ll b/release_23/test/CodeGen/Generic/2007-04-27-InlineAsm-X-Dest.ll
deleted file mode 100644
index 6f8fbaee7050..000000000000
--- a/release_23/test/CodeGen/Generic/2007-04-27-InlineAsm-X-Dest.ll
+++ /dev/null
@@ -1,10 +0,0 @@
-; RUN: llvm-as < %s | llc
-; XFAIL: sparc-sun-solaris2
-; PR1557
-
-; Test that we can have an "X" output constraint.
-
-define void @test(i16 * %t) {
- call void asm sideeffect "foo $0", "=*X,~{dirflag},~{fpsr},~{flags},~{memory}"( i16* %t )
- ret void
-}
diff --git a/release_23/test/CodeGen/Generic/2007-04-27-LargeMemObject.ll b/release_23/test/CodeGen/Generic/2007-04-27-LargeMemObject.ll
deleted file mode 100644
index cd724954aa1b..000000000000
--- a/release_23/test/CodeGen/Generic/2007-04-27-LargeMemObject.ll
+++ /dev/null
@@ -1,15 +0,0 @@
-; RUN: llvm-as < %s | llc
-; XFAIL: sparc-sun-solaris2
-; PR1557
-
- %struct..0anon = type { [100 x i32] }
-
-define void @test() {
-entry:
- %currfpu = alloca %struct..0anon, align 16 ; <%struct..0anon*> [#uses=2]
- %mxcsr = alloca %struct..0anon, align 16 ; <%struct..0anon*> [#uses=1]
- call void asm sideeffect "fnstenv $0", "=*m,~{dirflag},~{fpsr},~{flags}"( %struct..0anon* %currfpu )
- call void asm sideeffect "$0 $1", "=*m,*m,~{dirflag},~{fpsr},~{flags}"( %struct..0anon* %mxcsr, %struct..0anon* %currfpu )
- ret void
-}
-
diff --git a/release_23/test/CodeGen/Generic/2007-04-30-LandingPadBranchFolding.ll b/release_23/test/CodeGen/Generic/2007-04-30-LandingPadBranchFolding.ll
deleted file mode 100644
index 71b4c857d079..000000000000
--- a/release_23/test/CodeGen/Generic/2007-04-30-LandingPadBranchFolding.ll
+++ /dev/null
@@ -1,59 +0,0 @@
-; RUN: llvm-as < %s | llc
-; PR1228
-
- "struct.std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Alloc_hider" = type { i8* }
- "struct.std::locale" = type { "struct.std::locale::_Impl"* }
- "struct.std::locale::_Impl" = type { i32, "struct.std::locale::facet"**, i32, "struct.std::locale::facet"**, i8** }
- "struct.std::locale::facet" = type { i32 (...)**, i32 }
- "struct.std::string" = type { "struct.std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Alloc_hider" }
-
-define void @_ZNKSt6locale4nameEv("struct.std::string"* %agg.result) {
-entry:
- %tmp105 = icmp eq i8* null, null ; <i1> [#uses=1]
- br i1 %tmp105, label %cond_true, label %cond_true222
-
-cond_true: ; preds = %entry
- invoke void @_ZNSs14_M_replace_auxEjjjc( )
- to label %cond_next1328 unwind label %cond_true1402
-
-cond_true222: ; preds = %cond_true222, %entry
- %tmp207 = call i32 @strcmp( ) ; <i32> [#uses=1]
- %tmp208 = icmp eq i32 %tmp207, 0 ; <i1> [#uses=2]
- %bothcond1480 = and i1 %tmp208, false ; <i1> [#uses=1]
- br i1 %bothcond1480, label %cond_true222, label %cond_next226.loopexit
-
-cond_next226.loopexit: ; preds = %cond_true222
- %phitmp = xor i1 %tmp208, true ; <i1> [#uses=1]
- br i1 %phitmp, label %cond_false280, label %cond_true235
-
-cond_true235: ; preds = %cond_next226.loopexit
- invoke void @_ZNSs6assignEPKcj( )
- to label %cond_next1328 unwind label %cond_true1402
-
-cond_false280: ; preds = %cond_next226.loopexit
- invoke void @_ZNSs7reserveEj( )
- to label %invcont282 unwind label %cond_true1402
-
-invcont282: ; preds = %cond_false280
- invoke void @_ZNSs6appendEPKcj( )
- to label %invcont317 unwind label %cond_true1402
-
-invcont317: ; preds = %invcont282
- ret void
-
-cond_next1328: ; preds = %cond_true235, %cond_true
- ret void
-
-cond_true1402: ; preds = %invcont282, %cond_false280, %cond_true235, %cond_true
- ret void
-}
-
-declare void @_ZNSs14_M_replace_auxEjjjc()
-
-declare i32 @strcmp()
-
-declare void @_ZNSs6assignEPKcj()
-
-declare void @_ZNSs7reserveEj()
-
-declare void @_ZNSs6appendEPKcj()
diff --git a/release_23/test/CodeGen/Generic/2007-05-03-EHTypeInfo.ll b/release_23/test/CodeGen/Generic/2007-05-03-EHTypeInfo.ll
deleted file mode 100644
index 8a427902f721..000000000000
--- a/release_23/test/CodeGen/Generic/2007-05-03-EHTypeInfo.ll
+++ /dev/null
@@ -1,12 +0,0 @@
-; RUN: llvm-as < %s | llc -enable-eh -march=x86
-
- %struct.exception = type { i8, i8, i32, i8*, i8*, i32, i8* }
-@program_error = external global %struct.exception ; <%struct.exception*> [#uses=1]
-
-define void @typeinfo() {
-entry:
- %eh_typeid = tail call i32 @llvm.eh.typeid.for.i32( i8* getelementptr (%struct.exception* @program_error, i32 0, i32 0) ) ; <i32> [#uses=0]
- ret void
-}
-
-declare i32 @llvm.eh.typeid.for.i32(i8*)
diff --git a/release_23/test/CodeGen/Generic/2007-05-05-Personality.ll b/release_23/test/CodeGen/Generic/2007-05-05-Personality.ll
deleted file mode 100644
index 0fa0e2ff6b22..000000000000
--- a/release_23/test/CodeGen/Generic/2007-05-05-Personality.ll
+++ /dev/null
@@ -1,35 +0,0 @@
-; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -enable-eh -o - | grep zPLR
-
-@error = external global i8 ; <i8*> [#uses=2]
-
-define void @_ada_x() {
-entry:
- invoke void @raise( )
- to label %eh_then unwind label %unwind
-
-unwind: ; preds = %entry
- %eh_ptr = tail call i8* @llvm.eh.exception( ) ; <i8*> [#uses=2]
- %eh_select = tail call i32 (i8*, i8*, ...)* @llvm.eh.selector.i32( i8* %eh_ptr, i8* bitcast (i32 (...)* @__gnat_eh_personality to i8*), i8* @error ) ; <i32> [#uses=1]
- %eh_typeid = tail call i32 @llvm.eh.typeid.for.i32( i8* @error ) ; <i32> [#uses=1]
- %tmp2 = icmp eq i32 %eh_select, %eh_typeid ; <i1> [#uses=1]
- br i1 %tmp2, label %eh_then, label %Unwind
-
-eh_then: ; preds = %unwind, %entry
- ret void
-
-Unwind: ; preds = %unwind
- tail call i32 (...)* @_Unwind_Resume( i8* %eh_ptr ) ; <i32>:0 [#uses=0]
- unreachable
-}
-
-declare void @raise()
-
-declare i8* @llvm.eh.exception()
-
-declare i32 @llvm.eh.selector.i32(i8*, i8*, ...)
-
-declare i32 @llvm.eh.typeid.for.i32(i8*)
-
-declare i32 @__gnat_eh_personality(...)
-
-declare i32 @_Unwind_Resume(...)
diff --git a/release_23/test/CodeGen/Generic/2007-05-15-InfiniteRecursion.ll b/release_23/test/CodeGen/Generic/2007-05-15-InfiniteRecursion.ll
deleted file mode 100644
index 74957952fe7b..000000000000
--- a/release_23/test/CodeGen/Generic/2007-05-15-InfiniteRecursion.ll
+++ /dev/null
@@ -1,90 +0,0 @@
-; RUN: llvm-as < %s | llc
-
- %struct.AVClass = type { i8*, i8* (i8*)*, %struct.AVOption* }
- %struct.AVCodec = type { i8*, i32, i32, i32, i32 (%struct.AVCodecContext*)*, i32 (%struct.AVCodecContext*, i8*, i32, i8*)*, i32 (%struct.AVCodecContext*)*, i32 (%struct.AVCodecContext*, i8*, i32*, i8*, i32)*, i32, %struct.AVCodec*, void (%struct.AVCodecContext*)*, %struct.AVRational*, i32* }
- %struct.AVCodecContext = type { %struct.AVClass*, i32, i32, i32, i32, i32, i8*, i32, %struct.AVRational, i32, i32, i32, i32, i32, void (%struct.AVCodecContext*, %struct.AVFrame*, i32*, i32, i32, i32)*, i32, i32, i32, i32, i32, i32, i32, float, float, i32, i32, i32, i32, float, i32, i32, i32, %struct.AVCodec*, i8*, i32, i32, void (%struct.AVCodecContext*, i8*, i32, i32)*, i32, i32, i32, i32, i32, i32, i32, i32, i32, i8*, [32 x i8], i32, i32, i32, i32, i32, i32, i32, float, i32, i32 (%struct.AVCodecContext*, %struct.AVFrame*)*, void (%struct.AVCodecContext*, %struct.AVFrame*)*, i32, i32, i32, i32, i8*, i8*, float, float, i32, %struct.RcOverride*, i32, i8*, i32, i32, i32, float, float, float, float, i32, float, float, float, float, float, i32, i32, i32, i32*, i32, i32, i32, i32, %struct.AVRational, %struct.AVFrame*, i32, i32, [4 x i64], i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 (%struct.AVCodecContext*, i32*)*, i32, i32, i32, i32, i32, i32, i8*, i32, i32, i32, i32, i32, i32, i16*, i16*, i32, i32, i32, i32, %struct.AVPaletteControl*, i32, i32 (%struct.AVCodecContext*, %struct.AVFrame*)*, i32, i32, i32, i32, i32, i32, i32, i32 (%struct.AVCodecContext*, i32 (%struct.AVCodecContext*, i8*)*, i8**, i32*, i32)*, i8*, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, float, i32, i32, i32, i32, i32, i32, i32, i32, float, i32, i32, i32, i32, i32, i32, float, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i64 }
- %struct.AVEvalExpr = type opaque
- %struct.AVFrame = type { [4 x i8*], [4 x i32], [4 x i8*], i32, i32, i64, i32, i32, i32, i32, i32, i8*, i32, i8*, [2 x [2 x i16]*], i32*, i8, i8*, [4 x i64], i32, i32, i32, i32, i32, %struct.AVPanScan*, i32, i32, i16*, [2 x i8*] }
- %struct.AVOption = type opaque
- %struct.AVPaletteControl = type { i32, [256 x i32] }
- %struct.AVPanScan = type { i32, i32, i32, [3 x [2 x i16]] }
- %struct.AVRational = type { i32, i32 }
- %struct.DSPContext = type { void (i16*, i8*, i32)*, void (i16*, i8*, i8*, i32)*, void (i16*, i8*, i32)*, void (i16*, i8*, i32)*, void (i16*, i8*, i32)*, void (i8*, i16*, i32)*, void (i8*, i16*, i32)*, void (i8*, i8*, i32, i32, i32, i32, i32)*, void (i8*, i8*, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32)*, void (i16*)*, i32 (i8*, i32)*, i32 (i8*, i32)*, [5 x i32 (i8*, i8*, i8*, i32, i32)*], [5 x i32 (i8*, i8*, i8*, i32, i32)*], [5 x i32 (i8*, i8*, i8*, i32, i32)*], [5 x i32 (i8*, i8*, i8*, i32, i32)*], [5 x i32 (i8*, i8*, i8*, i32, i32)*], [5 x i32 (i8*, i8*, i8*, i32, i32)*], [5 x i32 (i8*, i8*, i8*, i32, i32)*], [5 x i32 (i8*, i8*, i8*, i32, i32)*], [5 x i32 (i8*, i8*, i8*, i32, i32)*], [5 x i32 (i8*, i8*, i8*, i32, i32)*], [5 x i32 (i8*, i8*, i8*, i32, i32)*], [5 x i32 (i8*, i8*, i8*, i32, i32)*], [5 x i32 (i8*, i8*, i8*, i32, i32)*], [5 x i32 (i8*, i8*, i8*, i32, i32)*], [5 x i32 (i8*, i8*, i8*, i32, i32)*], [5 x i32 (i8*, i8*, i8*, i32, i32)*], [5 x i32 (i8*, i8*, i8*, i32, i32)*], [5 x i32 (i8*, i8*, i8*, i32, i32)*], [5 x i32 (i8*, i8*, i8*, i32, i32)*], [5 x i32 (i8*, i8*, i8*, i32, i32)*], i32 (i8*, i16*, i32)*, [4 x [4 x void (i8*, i8*, i32, i32)*]], [4 x [4 x void (i8*, i8*, i32, i32)*]], [4 x [4 x void (i8*, i8*, i32, i32)*]], [4 x [4 x void (i8*, i8*, i32, i32)*]], [2 x void (i8*, i8*, i8*, i32, i32)*], [11 x void (i8*, i8*, i32, i32, i32)*], [11 x void (i8*, i8*, i32, i32, i32)*], [2 x [16 x void (i8*, i8*, i32)*]], [2 x [16 x void (i8*, i8*, i32)*]], [2 x [16 x void (i8*, i8*, i32)*]], [2 x [16 x void (i8*, i8*, i32)*]], [8 x void (i8*, i8*, i32)*], [3 x void (i8*, i8*, i32, i32, i32, i32)*], [3 x void (i8*, i8*, i32, i32, i32, i32)*], [3 x void (i8*, i8*, i32, i32, i32, i32)*], [4 x [16 x void (i8*, i8*, i32)*]], [4 x [16 x void (i8*, i8*, i32)*]], [4 x [16 x void (i8*, i8*, i32)*]], [4 x [16 x void (i8*, i8*, i32)*]], [10 x void (i8*, i32, i32, i32, i32)*], [10 x void (i8*, i8*, i32, i32, i32, i32, i32)*], [2 x [16 x void (i8*, i8*, i32)*]], [2 x [16 x void (i8*, i8*, i32)*]], void (i8*, i32, i32, i32, i32, i32, i32)*, void (i8*, i32, i32, i32, i32, i32, i32)*, void (i8*, i32, i32, i32, i32, i32, i32)*, void (i8*, i32, i32, i32, i32, i32, i32)*, void (i8*, i16*, i32)*, [2 x [4 x i32 (i8*, i8*, i8*, i32, i32)*]], void (i8*, i8*, i32)*, void (i8*, i8*, i8*, i32)*, void (i8*, i8*, i8*, i32, i32*, i32*)*, void (i32*, i32*, i32)*, void (i8*, i32, i32, i32, i8*)*, void (i8*, i32, i32, i32, i8*)*, void (i8*, i32, i32, i32, i8*)*, void (i8*, i32, i32, i32, i8*)*, void (i8*, i32, i32, i32)*, void (i8*, i32, i32, i32)*, void ([4 x [4 x i16]]*, i8*, [40 x i8]*, [40 x [2 x i16]]*, i32, i32, i32, i32, i32)*, void (i8*, i32, i32)*, void (i8*, i32, i32)*, void (i8*, i32)*, void (float*, float*, i32)*, void (float*, float*, i32)*, void (float*, float*, float*, i32)*, void (float*, float*, float*, float*, i32, i32, i32)*, void (i16*, float*, i32)*, void (i16*)*, void (i16*)*, void (i16*)*, void (i8*, i32, i16*)*, void (i8*, i32, i16*)*, [64 x i8], i32, i32 (i16*, i16*, i16*, i32)*, void (i16*, i16*, i32)*, void (i8*, i16*, i32)*, void (i8*, i16*, i32)*, void (i8*, i16*, i32)*, void (i8*, i16*, i32)*, void ([4 x i16]*)*, void (i32*, i32*, i32*, i32*, i32*, i32*, i32)*, void (i32*, i32)*, void (i8*, i32, i8**, i32, i32, i32, i32, i32, %struct.slice_buffer*, i32, i8*)*, void (i8*, i32, i32)*, [4 x void (i8*, i32, i8*, i32, i32, i32)*], void (i16*)*, void (i16*, i32)*, void (i16*, i32)*, void (i16*, i32)*, void (i8*, i32)*, void (i8*, i32)*, [16 x void (i8*, i8*, i32, i32)*] }
- %struct.FILE = type { i32, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, %struct._IO_marker*, %struct.FILE*, i32, i32, i32, i16, i8, [1 x i8], i8*, i64, i8*, i8*, i8*, i8*, i32, i32, [40 x i8] }
- %struct.GetBitContext = type { i8*, i8*, i32*, i32, i32, i32, i32 }
- %struct.MJpegContext = type opaque
- %struct.MotionEstContext = type { %struct.AVCodecContext*, i32, [4 x [2 x i32]], [4 x [2 x i32]], i8*, i8*, [2 x i8*], i8*, i32, i32*, i32*, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, [4 x [4 x i8*]], [4 x [4 x i8*]], i32, i32, i32, i32, i32, [4 x void (i8*, i8*, i32, i32)*]*, [4 x void (i8*, i8*, i32, i32)*]*, [16 x void (i8*, i8*, i32)*]*, [16 x void (i8*, i8*, i32)*]*, [4097 x i8]*, i8*, i32 (%struct.MpegEncContext*, i32*, i32*, i32, i32, i32, i32, i32)* }
- %struct.MpegEncContext = type { %struct.AVCodecContext*, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, %struct.PutBitContext, i32, i32, i32, i32, i32, i32, i64, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, %struct.Picture*, %struct.Picture**, %struct.Picture**, i32, i32, [8 x %struct.MpegEncContext*], %struct.Picture, %struct.Picture, %struct.Picture, %struct.Picture, %struct.Picture*, %struct.Picture*, %struct.Picture*, [3 x i8*], [3 x i32], i16*, [3 x i16*], [20 x i16], i32, i32, i8*, i8*, i8*, i8*, i8*, [16 x i16]*, [3 x [16 x i16]*], i32, i8*, i32, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i32, i32, i32, i32, i32*, i32, i32, i32, i32, i32, i32, i32, [5 x i32], i32, i32, i32, i32, %struct.DSPContext, i32, i32, [2 x i16]*, [2 x i16]*, [2 x i16]*, [2 x i16]*, [2 x i16]*, [2 x i16]*, [2 x [2 x [2 x i16]*]], [2 x [2 x [2 x [2 x i16]*]]], [2 x i16]*, [2 x i16]*, [2 x i16]*, [2 x i16]*, [2 x i16]*, [2 x i16]*, [2 x [2 x [2 x i16]*]], [2 x [2 x [2 x [2 x i16]*]]], [2 x i8*], [2 x [2 x i8*]], i32, i32, i32, [2 x [4 x [2 x i32]]], [2 x [2 x i32]], [2 x [2 x [2 x i32]]], i8*, [2 x [64 x i16]], %struct.MotionEstContext, i32, i32, i32, i32, i32, i32, i16*, [6 x i32], [6 x i32], [3 x i8*], i32*, [64 x i16], [64 x i16], [64 x i16], [64 x i16], i32, i32, i32, i32, i32, i8*, i8*, i8*, i8*, i8*, i8*, [8 x i32], [64 x i32]*, [64 x i32]*, [2 x [64 x i16]]*, [2 x [64 x i16]]*, [12 x i32], %struct.ScanTable, %struct.ScanTable, %struct.ScanTable, %struct.ScanTable, [64 x i32]*, [2 x i32], [64 x i16]*, i8*, i64, i64, i32, i32, %struct.RateControlContext, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i8*, i32, i32, %struct.GetBitContext, i32, i32, i32, %struct.ParseContext, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i64, i64, i16, i16, i16, i16, i32, i32, i32, i32, i32, i32, i32, i32, i32, [2 x [2 x i32]], [2 x [2 x i32]], [2 x i32], i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, %struct.PutBitContext, %struct.PutBitContext, i32, i32, i32, i32, i32, i32, i8*, i32, i32, i32, i32, i32, [3 x i32], %struct.MJpegContext*, [3 x i32], [3 x i32], i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, [2 x [65 x [65 x [2 x i32]]]]*, i32, i32, %struct.GetBitContext, i32, i32, i32, i8*, i32, [2 x [2 x i32]], i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, [2 x i32], i32, i32, i32, i32, i8*, i32, [12 x i16*], [64 x i16]*, [8 x [64 x i16]]*, i32 (%struct.MpegEncContext*, [64 x i16]*)*, void (%struct.MpegEncContext*, i16*, i32, i32)*, void (%struct.MpegEncContext*, i16*, i32, i32)*, void (%struct.MpegEncContext*, i16*, i32, i32)*, void (%struct.MpegEncContext*, i16*, i32, i32)*, void (%struct.MpegEncContext*, i16*, i32, i32)*, void (%struct.MpegEncContext*, i16*, i32, i32)*, void (%struct.MpegEncContext*, i16*, i32, i32)*, void (%struct.MpegEncContext*, i16*, i32, i32)*, void (%struct.MpegEncContext*, i16*, i32, i32)*, void (%struct.MpegEncContext*, i16*, i32, i32)*, i32 (%struct.MpegEncContext*, i16*, i32, i32, i32*)*, i32 (%struct.MpegEncContext*, i16*, i32, i32, i32*)*, void (%struct.MpegEncContext*, i16*)* }
- %struct.ParseContext = type { i8*, i32, i32, i32, i32, i32, i32, i32 }
- %struct.Picture = type { [4 x i8*], [4 x i32], [4 x i8*], i32, i32, i64, i32, i32, i32, i32, i32, i8*, i32, i8*, [2 x [2 x i16]*], i32*, i8, i8*, [4 x i64], i32, i32, i32, i32, i32, %struct.AVPanScan*, i32, i32, i16*, [2 x i8*], [3 x i8*], [2 x [2 x i16]*], i32*, [2 x i32], i32, i32, i32, i32, [2 x [16 x i32]], [2 x i32], i32, i32, i16*, i16*, i8*, i32*, i32 }
- %struct.Predictor = type { double, double, double }
- %struct.PutBitContext = type { i32, i32, i8*, i8*, i8* }
- %struct.RateControlContext = type { %struct.FILE*, i32, %struct.RateControlEntry*, double, [5 x %struct.Predictor], double, double, double, double, double, [5 x double], i32, i32, [5 x i64], [5 x i64], [5 x i64], [5 x i64], [5 x i32], i32, i8*, float, i32, %struct.AVEvalExpr* }
- %struct.RateControlEntry = type { i32, float, i32, i32, i32, i32, i32, i64, i32, float, i32, i32, i32, i32, i32, i32 }
- %struct.RcOverride = type { i32, i32, i32, float }
- %struct.ScanTable = type { i8*, [64 x i8], [64 x i8] }
- %struct._IO_marker = type { %struct._IO_marker*, %struct.FILE*, i32 }
- %struct.slice_buffer = type opaque
-
-define float @ff_rate_estimate_qscale(%struct.MpegEncContext* %s, i32 %dry_run) {
-entry:
- br i1 false, label %cond_false163, label %cond_true135
-
-cond_true135: ; preds = %entry
- ret float 0.000000e+00
-
-cond_false163: ; preds = %entry
- br i1 false, label %cond_true203, label %cond_next211
-
-cond_true203: ; preds = %cond_false163
- ret float 0.000000e+00
-
-cond_next211: ; preds = %cond_false163
- br i1 false, label %cond_false243, label %cond_true220
-
-cond_true220: ; preds = %cond_next211
- br i1 false, label %cond_next237, label %cond_true225
-
-cond_true225: ; preds = %cond_true220
- ret float 0.000000e+00
-
-cond_next237: ; preds = %cond_true220
- br i1 false, label %cond_false785, label %cond_true735
-
-cond_false243: ; preds = %cond_next211
- ret float 0.000000e+00
-
-cond_true735: ; preds = %cond_next237
- ret float 0.000000e+00
-
-cond_false785: ; preds = %cond_next237
- br i1 false, label %cond_true356.i.preheader, label %bb359.i
-
-cond_true356.i.preheader: ; preds = %cond_false785
- %tmp116117.i = zext i8 0 to i32 ; <i32> [#uses=1]
- br i1 false, label %cond_false.i, label %cond_next159.i
-
-cond_false.i: ; preds = %cond_true356.i.preheader
- ret float 0.000000e+00
-
-cond_next159.i: ; preds = %cond_true356.i.preheader
- %tmp178.i = add i32 %tmp116117.i, -128 ; <i32> [#uses=2]
- %tmp181.i = mul i32 %tmp178.i, %tmp178.i ; <i32> [#uses=1]
- %tmp181182.i = sitofp i32 %tmp181.i to float ; <float> [#uses=1]
- %tmp199200.pn.in.i = mul float %tmp181182.i, 0.000000e+00 ; <float> [#uses=1]
- %tmp199200.pn.i = fpext float %tmp199200.pn.in.i to double ; <double> [#uses=1]
- %tmp201.pn.i = sub double 1.000000e+00, %tmp199200.pn.i ; <double> [#uses=1]
- %factor.2.in.i = mul double 0.000000e+00, %tmp201.pn.i ; <double> [#uses=1]
- %factor.2.i = fptrunc double %factor.2.in.i to float ; <float> [#uses=1]
- br i1 false, label %cond_next312.i, label %cond_false222.i
-
-cond_false222.i: ; preds = %cond_next159.i
- ret float 0.000000e+00
-
-cond_next312.i: ; preds = %cond_next159.i
- %tmp313314.i = fpext float %factor.2.i to double ; <double> [#uses=0]
- ret float 0.000000e+00
-
-bb359.i: ; preds = %cond_false785
- ret float 0.000000e+00
-}
diff --git a/release_23/test/CodeGen/Generic/2007-06-06-CriticalEdgeLandingPad.ll b/release_23/test/CodeGen/Generic/2007-06-06-CriticalEdgeLandingPad.ll
deleted file mode 100644
index 99e1f14ed570..000000000000
--- a/release_23/test/CodeGen/Generic/2007-06-06-CriticalEdgeLandingPad.ll
+++ /dev/null
@@ -1,2866 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -enable-eh -asm-verbose -o - | \
-; RUN: grep -A 3 {Llabel137.*Region start} | grep {3.*Action}
-; PR1422
-; PR1508
-
-target triple = "i686-pc-linux-gnu"
- %struct.exception = type { i8, i8, i32, i8*, i8*, i32, i8* }
- %struct.string___XUB = type { i32, i32 }
- %struct.string___XUP = type { i8*, %struct.string___XUB* }
- %struct.system__secondary_stack__mark_id = type { i8*, i32 }
-@weekS.154 = internal constant [28 x i8] c"SSUNSMONSTUESWEDSTHUSFRISSAT" ; <[28 x i8]*> [#uses=1]
-@weekN.179 = internal constant [8 x i8] c"\01\05\09\0D\11\15\19\1D" ; <[8 x i8]*> [#uses=1]
-@C.28.862 = internal constant %struct.string___XUB { i32 1, i32 85 } ; <%struct.string___XUB*> [#uses=1]
-@C.29.865 = internal constant %struct.string___XUB { i32 1, i32 7 } ; <%struct.string___XUB*> [#uses=1]
-@C.30.904 = internal constant %struct.string___XUB { i32 1, i32 30 } ; <%struct.string___XUB*> [#uses=1]
-@C.32.910 = internal constant %struct.string___XUB { i32 1, i32 28 } ; <%struct.string___XUB*> [#uses=1]
-@C.35.915 = internal constant %struct.string___XUB { i32 1, i32 24 } ; <%struct.string___XUB*> [#uses=1]
-@C.36.923 = internal constant %struct.string___XUB { i32 1, i32 29 } ; <%struct.string___XUB*> [#uses=1]
-@C.98.1466 = internal constant %struct.string___XUB { i32 1, i32 31 } ; <%struct.string___XUB*> [#uses=1]
-@C.101.1473 = internal constant %struct.string___XUB { i32 1, i32 46 } ; <%struct.string___XUB*> [#uses=1]
-@C.104.1478 = internal constant %struct.string___XUB { i32 1, i32 25 } ; <%struct.string___XUB*> [#uses=1]
-@C.124.1606 = internal constant %struct.string___XUB { i32 1, i32 18 } ; <%struct.string___XUB*> [#uses=1]
-@C.143.1720 = internal constant [2 x i32] [ i32 1, i32 2 ] ; <[2 x i32]*> [#uses=1]
-@C.146.1725 = internal constant %struct.string___XUB { i32 1, i32 37 } ; <%struct.string___XUB*> [#uses=1]
-@C.170.1990 = internal constant %struct.string___XUB { i32 1, i32 19 } ; <%struct.string___XUB*> [#uses=1]
-@C.178.2066 = internal constant %struct.string___XUB { i32 1, i32 27 } ; <%struct.string___XUB*> [#uses=1]
-@.str = internal constant [13 x i8] c"c36104b.adb\00\00" ; <[13 x i8]*> [#uses=1]
-@.str1 = internal constant [85 x i8] c"CONSTRAINT_ERROR IS RAISED OR NOT IN DYNAMIC DISCRETE_RANGES WITH EXPLICIT TYPE_MARKS" ; <[85 x i8]*> [#uses=1]
-@.str2 = internal constant [7 x i8] c"C36104B" ; <[7 x i8]*> [#uses=1]
-@constraint_error = external global %struct.exception ; <%struct.exception*> [#uses=18]
-@__gnat_others_value = external constant i32 ; <i32*> [#uses=37]
-@.str3 = internal constant [30 x i8] c"CONSTRAINT_ERROR NOT RAISED 1 " ; <[30 x i8]*> [#uses=1]
-@system__soft_links__abort_undefer = external global void ()* ; <void ()**> [#uses=30]
-@.str4 = internal constant [28 x i8] c"UNHANDLED EXCEPTION RAISED 1" ; <[28 x i8]*> [#uses=1]
-@.str5 = internal constant [24 x i8] c"WRONG EXCEPTION RAISED 1" ; <[24 x i8]*> [#uses=1]
-@.str6 = internal constant [29 x i8] c"CONSTRAINT_ERROR NOT RAISED 3" ; <[29 x i8]*> [#uses=1]
-@.str7 = internal constant [24 x i8] c"WRONG EXCEPTION RAISED 3" ; <[24 x i8]*> [#uses=1]
-@.str10 = internal constant [24 x i8] c"WRONG EXCEPTION RAISED 4" ; <[24 x i8]*> [#uses=1]
-@.str11 = internal constant [30 x i8] c"CONSTRAINT_ERROR NOT RAISED 7 " ; <[30 x i8]*> [#uses=1]
-@.str12 = internal constant [28 x i8] c"UNHANDLED EXCEPTION RAISED 7" ; <[28 x i8]*> [#uses=1]
-@.str13 = internal constant [24 x i8] c"WRONG EXCEPTION RAISED 7" ; <[24 x i8]*> [#uses=1]
-@.str14 = internal constant [30 x i8] c"CONSTRAINT_ERROR NOT RAISED 8 " ; <[30 x i8]*> [#uses=1]
-@.str15 = internal constant [28 x i8] c"UNHANDLED EXCEPTION RAISED 8" ; <[28 x i8]*> [#uses=1]
-@.str16 = internal constant [24 x i8] c"WRONG EXCEPTION RAISED 8" ; <[24 x i8]*> [#uses=1]
-@.str17 = internal constant [30 x i8] c"CONSTRAINT_ERROR NOT RAISED 9 " ; <[30 x i8]*> [#uses=1]
-@.str18 = internal constant [24 x i8] c"WRONG EXCEPTION RAISED 9" ; <[24 x i8]*> [#uses=1]
-@.str19 = internal constant [31 x i8] c"CONSTRAINT_ERROR NOT RAISED 10 " ; <[31 x i8]*> [#uses=1]
-@.str20 = internal constant [46 x i8] c"DID NOT RAISE CONSTRAINT_ERROR AT PROPER PLACE" ; <[46 x i8]*> [#uses=1]
-@.str21 = internal constant [25 x i8] c"WRONG EXCEPTION RAISED 10" ; <[25 x i8]*> [#uses=1]
-@.str22 = internal constant [31 x i8] c"CONSTRAINT_ERROR NOT RAISED 11 " ; <[31 x i8]*> [#uses=1]
-@.str23 = internal constant [25 x i8] c"WRONG EXCEPTION RAISED 11" ; <[25 x i8]*> [#uses=1]
-@.str24 = internal constant [30 x i8] c"'FIRST OF NULL ARRAY INCORRECT" ; <[30 x i8]*> [#uses=1]
-@.str25 = internal constant [18 x i8] c"EXCEPTION RAISED 1" ; <[18 x i8]*> [#uses=1]
-@.str26 = internal constant [18 x i8] c"EXCEPTION RAISED 3" ; <[18 x i8]*> [#uses=1]
-@.str27 = internal constant [31 x i8] c"'LENGTH OF NULL ARRAY INCORRECT" ; <[31 x i8]*> [#uses=1]
-@.str28 = internal constant [18 x i8] c"EXCEPTION RAISED 5" ; <[18 x i8]*> [#uses=1]
-@.str29 = internal constant [37 x i8] c"EVALUATION OF EXPRESSION IS INCORRECT" ; <[37 x i8]*> [#uses=1]
-@.str30 = internal constant [18 x i8] c"EXCEPTION RAISED 7" ; <[18 x i8]*> [#uses=1]
-@.str32 = internal constant [18 x i8] c"EXCEPTION RAISED 9" ; <[18 x i8]*> [#uses=1]
-@.str33 = internal constant [19 x i8] c"EXCEPTION RAISED 10" ; <[19 x i8]*> [#uses=1]
-@.str34 = internal constant [19 x i8] c"EXCEPTION RAISED 12" ; <[19 x i8]*> [#uses=1]
-@.str35 = internal constant [27 x i8] c"INCORRECT 'IN' EVALUATION 1" ; <[27 x i8]*> [#uses=1]
-@.str36 = internal constant [27 x i8] c"INCORRECT 'IN' EVALUATION 2" ; <[27 x i8]*> [#uses=1]
-@.str37 = internal constant [29 x i8] c"INCORRECT 'NOT IN' EVALUATION" ; <[29 x i8]*> [#uses=1]
-@.str38 = internal constant [19 x i8] c"EXCEPTION RAISED 52" ; <[19 x i8]*> [#uses=1]
-
-define void @_ada_c36104b() {
-entry:
- %tmp9 = alloca %struct.system__secondary_stack__mark_id, align 8 ; <%struct.system__secondary_stack__mark_id*> [#uses=3]
- %tmp12 = alloca %struct.string___XUP, align 8 ; <%struct.string___XUP*> [#uses=3]
- %tmp15 = alloca %struct.string___XUP, align 8 ; <%struct.string___XUP*> [#uses=3]
- %tmp31 = alloca %struct.system__secondary_stack__mark_id, align 8 ; <%struct.system__secondary_stack__mark_id*> [#uses=3]
- %tmp34 = alloca %struct.string___XUP, align 8 ; <%struct.string___XUP*> [#uses=3]
- %tmp37 = alloca %struct.string___XUP, align 8 ; <%struct.string___XUP*> [#uses=3]
- %tmp46 = alloca %struct.system__secondary_stack__mark_id, align 8 ; <%struct.system__secondary_stack__mark_id*> [#uses=3]
- %tmp49 = alloca %struct.string___XUP, align 8 ; <%struct.string___XUP*> [#uses=3]
- %tmp52 = alloca %struct.string___XUP, align 8 ; <%struct.string___XUP*> [#uses=3]
- %tmp55 = alloca %struct.system__secondary_stack__mark_id, align 8 ; <%struct.system__secondary_stack__mark_id*> [#uses=3]
- %tmp58 = alloca %struct.string___XUP, align 8 ; <%struct.string___XUP*> [#uses=3]
- %tmp61 = alloca %struct.string___XUP, align 8 ; <%struct.string___XUP*> [#uses=3]
- %tmp63 = alloca %struct.system__secondary_stack__mark_id, align 8 ; <%struct.system__secondary_stack__mark_id*> [#uses=3]
- %tmp66 = alloca %struct.string___XUP, align 8 ; <%struct.string___XUP*> [#uses=3]
- %tmp69 = alloca %struct.string___XUP, align 8 ; <%struct.string___XUP*> [#uses=3]
- %tmp72 = alloca %struct.system__secondary_stack__mark_id, align 8 ; <%struct.system__secondary_stack__mark_id*> [#uses=3]
- %tmp75 = alloca %struct.string___XUP, align 8 ; <%struct.string___XUP*> [#uses=3]
- %tmp78 = alloca %struct.string___XUP, align 8 ; <%struct.string___XUP*> [#uses=3]
- %tmp123 = call i32 @report__ident_int( i32 0 ) ; <i32> [#uses=3]
- %tmp125 = icmp ugt i32 %tmp123, 6 ; <i1> [#uses=1]
- br i1 %tmp125, label %cond_true, label %cond_next136
-
-cond_true: ; preds = %entry
- call void @__gnat_rcheck_10( i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0), i32 50 )
- unreachable
-
-cond_next136: ; preds = %entry
- %tmp137138 = trunc i32 %tmp123 to i8 ; <i8> [#uses=21]
- %tmp139 = icmp ugt i8 %tmp137138, 6 ; <i1> [#uses=1]
- br i1 %tmp139, label %bb, label %bb144
-
-bb: ; preds = %cond_next136
- call void @__gnat_rcheck_12( i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0), i32 50 )
- unreachable
-
-bb144: ; preds = %cond_next136
- %tmp150 = call i32 @report__ident_int( i32 1 ) ; <i32> [#uses=4]
- %tmp154 = icmp ugt i32 %tmp150, 6 ; <i1> [#uses=1]
- br i1 %tmp154, label %cond_true157, label %cond_next169
-
-cond_true157: ; preds = %bb144
- call void @__gnat_rcheck_10( i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0), i32 51 )
- unreachable
-
-cond_next169: ; preds = %bb144
- %tmp170171 = trunc i32 %tmp150 to i8 ; <i8> [#uses=34]
- %tmp172 = icmp ugt i8 %tmp170171, 6 ; <i1> [#uses=1]
- br i1 %tmp172, label %bb175, label %bb178
-
-bb175: ; preds = %cond_next169
- call void @__gnat_rcheck_12( i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0), i32 51 )
- unreachable
-
-bb178: ; preds = %cond_next169
- %tmp184 = call i32 @report__ident_int( i32 2 ) ; <i32> [#uses=3]
- %tmp188 = icmp ugt i32 %tmp184, 6 ; <i1> [#uses=1]
- br i1 %tmp188, label %cond_true191, label %cond_next203
-
-cond_true191: ; preds = %bb178
- call void @__gnat_rcheck_10( i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0), i32 52 )
- unreachable
-
-cond_next203: ; preds = %bb178
- %tmp204205 = trunc i32 %tmp184 to i8 ; <i8> [#uses=30]
- %tmp206 = icmp ugt i8 %tmp204205, 6 ; <i1> [#uses=3]
- br i1 %tmp206, label %bb209, label %bb212
-
-bb209: ; preds = %cond_next203
- call void @__gnat_rcheck_12( i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0), i32 52 )
- unreachable
-
-bb212: ; preds = %cond_next203
- %tmp218 = call i32 @report__ident_int( i32 3 ) ; <i32> [#uses=4]
- %tmp222 = icmp ugt i32 %tmp218, 6 ; <i1> [#uses=1]
- br i1 %tmp222, label %cond_true225, label %cond_next237
-
-cond_true225: ; preds = %bb212
- call void @__gnat_rcheck_10( i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0), i32 53 )
- unreachable
-
-cond_next237: ; preds = %bb212
- %tmp238239 = trunc i32 %tmp218 to i8 ; <i8> [#uses=34]
- %tmp240 = icmp ugt i8 %tmp238239, 6 ; <i1> [#uses=2]
- br i1 %tmp240, label %bb243, label %bb246
-
-bb243: ; preds = %cond_next237
- call void @__gnat_rcheck_12( i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0), i32 53 )
- unreachable
-
-bb246: ; preds = %cond_next237
- %tmp252 = call i32 @report__ident_int( i32 4 ) ; <i32> [#uses=3]
- %tmp256 = icmp ugt i32 %tmp252, 6 ; <i1> [#uses=1]
- br i1 %tmp256, label %cond_true259, label %cond_next271
-
-cond_true259: ; preds = %bb246
- call void @__gnat_rcheck_10( i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0), i32 54 )
- unreachable
-
-cond_next271: ; preds = %bb246
- %tmp272273 = trunc i32 %tmp252 to i8 ; <i8> [#uses=27]
- %tmp274 = icmp ugt i8 %tmp272273, 6 ; <i1> [#uses=4]
- br i1 %tmp274, label %bb277, label %bb280
-
-bb277: ; preds = %cond_next271
- call void @__gnat_rcheck_12( i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0), i32 54 )
- unreachable
-
-bb280: ; preds = %cond_next271
- %tmp286 = call i32 @report__ident_int( i32 5 ) ; <i32> [#uses=3]
- %tmp290 = icmp ugt i32 %tmp286, 6 ; <i1> [#uses=1]
- br i1 %tmp290, label %cond_true293, label %cond_next305
-
-cond_true293: ; preds = %bb280
- call void @__gnat_rcheck_10( i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0), i32 55 )
- unreachable
-
-cond_next305: ; preds = %bb280
- %tmp306307 = trunc i32 %tmp286 to i8 ; <i8> [#uses=16]
- %tmp308 = icmp ugt i8 %tmp306307, 6 ; <i1> [#uses=1]
- br i1 %tmp308, label %bb311, label %bb314
-
-bb311: ; preds = %cond_next305
- call void @__gnat_rcheck_12( i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0), i32 55 )
- unreachable
-
-bb314: ; preds = %cond_next305
- %tmp320 = call i32 @report__ident_int( i32 6 ) ; <i32> [#uses=2]
- %tmp324 = icmp ugt i32 %tmp320, 6 ; <i1> [#uses=1]
- br i1 %tmp324, label %cond_true327, label %cond_next339
-
-cond_true327: ; preds = %bb314
- call void @__gnat_rcheck_10( i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0), i32 56 )
- unreachable
-
-cond_next339: ; preds = %bb314
- %tmp340341 = trunc i32 %tmp320 to i8 ; <i8> [#uses=4]
- %tmp342 = icmp ugt i8 %tmp340341, 6 ; <i1> [#uses=1]
- br i1 %tmp342, label %bb345, label %bb348
-
-bb345: ; preds = %cond_next339
- call void @__gnat_rcheck_12( i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0), i32 56 )
- unreachable
-
-bb348: ; preds = %cond_next339
- %tmp364 = icmp ult i8 %tmp272273, %tmp204205 ; <i1> [#uses=2]
- br i1 %tmp364, label %cond_next383, label %cond_true367
-
-cond_true367: ; preds = %bb348
- %tmp370 = icmp ult i8 %tmp204205, %tmp170171 ; <i1> [#uses=1]
- %tmp374 = icmp ugt i8 %tmp272273, %tmp306307 ; <i1> [#uses=1]
- %tmp378 = or i1 %tmp374, %tmp370 ; <i1> [#uses=1]
- br i1 %tmp378, label %cond_true381, label %cond_next383
-
-cond_true381: ; preds = %cond_true367
- call void @__gnat_rcheck_12( i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0), i32 59 )
- unreachable
-
-cond_next383: ; preds = %cond_true367, %bb348
- %tmp384 = call i32 @report__ident_int( i32 -5 ) ; <i32> [#uses=15]
- %tmp388 = add i32 %tmp384, 10 ; <i32> [#uses=1]
- %tmp389 = icmp ugt i32 %tmp388, 20 ; <i1> [#uses=1]
- br i1 %tmp389, label %cond_true392, label %cond_next393
-
-cond_true392: ; preds = %cond_next383
- call void @__gnat_rcheck_12( i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0), i32 63 )
- unreachable
-
-cond_next393: ; preds = %cond_next383
- %tmp394 = call i32 @report__ident_int( i32 5 ) ; <i32> [#uses=18]
- %tmp398 = add i32 %tmp394, 10 ; <i32> [#uses=1]
- %tmp399 = icmp ugt i32 %tmp398, 20 ; <i1> [#uses=1]
- br i1 %tmp399, label %cond_true402, label %cond_next403
-
-cond_true402: ; preds = %cond_next393
- call void @__gnat_rcheck_12( i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0), i32 64 )
- unreachable
-
-cond_next403: ; preds = %cond_next393
- %tmp416 = icmp slt i32 %tmp394, %tmp384 ; <i1> [#uses=1]
- br i1 %tmp416, label %cond_next437, label %cond_true419
-
-cond_true419: ; preds = %cond_next403
- %tmp423 = icmp slt i32 %tmp384, -10 ; <i1> [#uses=1]
- %tmp428 = icmp sgt i32 %tmp394, 10 ; <i1> [#uses=1]
- %tmp432 = or i1 %tmp428, %tmp423 ; <i1> [#uses=1]
- br i1 %tmp432, label %cond_true435, label %cond_next437
-
-cond_true435: ; preds = %cond_true419
- call void @__gnat_rcheck_12( i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0), i32 63 )
- unreachable
-
-cond_next437: ; preds = %cond_true419, %cond_next403
- call void @report__test( i64 or (i64 zext (i32 ptrtoint ([7 x i8]* @.str2 to i32) to i64), i64 shl (i64 zext (i32 ptrtoint (%struct.string___XUB* @C.29.865 to i32) to i64), i64 32)), i64 or (i64 zext (i32 ptrtoint ([85 x i8]* @.str1 to i32) to i64), i64 shl (i64 zext (i32 ptrtoint (%struct.string___XUB* @C.28.862 to i32) to i64), i64 32)) )
- %tmp453 = icmp sgt i32 %tmp384, 0 ; <i1> [#uses=1]
- %tmp458 = icmp slt i32 %tmp394, 6 ; <i1> [#uses=1]
- %tmp462 = or i1 %tmp458, %tmp453 ; <i1> [#uses=3]
- br i1 %tmp462, label %cond_true465, label %cond_next467
-
-cond_true465: ; preds = %cond_next437
- invoke void @__gnat_rcheck_12( i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0), i32 80 )
- to label %UnifiedUnreachableBlock34 unwind label %unwind
-
-unwind: ; preds = %cleanup798, %unwind783, %cond_true465
- %eh_ptr = call i8* @llvm.eh.exception( ) ; <i8*> [#uses=3]
- %eh_select = call i32 (i8*, i8*, ...)* @llvm.eh.selector.i32( i8* %eh_ptr, i8* bitcast (i32 (...)* @__gnat_eh_personality to i8*), %struct.exception* @constraint_error, i32* @__gnat_others_value ) ; <i32> [#uses=2]
- %eh_typeid8065921 = call i32 @llvm.eh.typeid.for.i32( i8* getelementptr (%struct.exception* @constraint_error, i32 0, i32 0) ) ; <i32> [#uses=1]
- %tmp8085923 = icmp eq i32 %eh_select, %eh_typeid8065921 ; <i1> [#uses=1]
- br i1 %tmp8085923, label %eh_then809, label %eh_else823
-
-cond_next467: ; preds = %cond_next437
- invoke void @system__secondary_stack__ss_mark( %struct.system__secondary_stack__mark_id* %tmp9 sret )
- to label %invcont472 unwind label %unwind468
-
-unwind468: ; preds = %cleanup, %unwind480, %cond_next467
- %eh_ptr469 = call i8* @llvm.eh.exception( ) ; <i8*> [#uses=3]
- %eh_select471 = call i32 (i8*, i8*, ...)* @llvm.eh.selector.i32( i8* %eh_ptr469, i8* bitcast (i32 (...)* @__gnat_eh_personality to i8*), i32* @__gnat_others_value ) ; <i32> [#uses=2]
- %eh_typeid5928 = call i32 @llvm.eh.typeid.for.i32( i8* bitcast (i32* @__gnat_others_value to i8*) ) ; <i32> [#uses=1]
- %tmp7815929 = icmp eq i32 %eh_select471, %eh_typeid5928 ; <i1> [#uses=1]
- br i1 %tmp7815929, label %eh_then, label %cleanup805
-
-invcont472: ; preds = %cond_next467
- %tmp475 = getelementptr %struct.system__secondary_stack__mark_id* %tmp9, i32 0, i32 0 ; <i8**> [#uses=1]
- %tmp476 = load i8** %tmp475 ; <i8*> [#uses=2]
- %tmp478 = getelementptr %struct.system__secondary_stack__mark_id* %tmp9, i32 0, i32 1 ; <i32*> [#uses=1]
- %tmp479 = load i32* %tmp478 ; <i32> [#uses=2]
- %tmp485 = invoke i32 @report__ident_int( i32 1 )
- to label %invcont484 unwind label %unwind480 ; <i32> [#uses=2]
-
-unwind480: ; preds = %invcont734, %invcont717, %cond_next665, %cond_true663, %cond_next639, %cond_true637, %cond_next613, %cond_true611, %cond_next587, %cond_true585, %cond_next561, %cond_true559, %cond_next535, %cond_true533, %cond_next509, %cond_true507, %invcont472
- %eh_ptr481 = call i8* @llvm.eh.exception( ) ; <i8*> [#uses=3]
- %eh_select483 = call i32 (i8*, i8*, ...)* @llvm.eh.selector.i32( i8* %eh_ptr481, i8* bitcast (i32 (...)* @__gnat_eh_personality to i8*), i32* @__gnat_others_value ) ; <i32> [#uses=2]
- %tmp7685575 = ptrtoint i8* %tmp476 to i32 ; <i32> [#uses=1]
- %tmp76855755576 = zext i32 %tmp7685575 to i64 ; <i64> [#uses=1]
- %tmp7715572 = zext i32 %tmp479 to i64 ; <i64> [#uses=1]
- %tmp77155725573 = shl i64 %tmp7715572, 32 ; <i64> [#uses=1]
- %tmp77155725573.ins = or i64 %tmp77155725573, %tmp76855755576 ; <i64> [#uses=1]
- invoke void @system__secondary_stack__ss_release( i64 %tmp77155725573.ins )
- to label %cleanup779 unwind label %unwind468
-
-invcont484: ; preds = %invcont472
- %tmp492 = icmp slt i32 %tmp485, %tmp384 ; <i1> [#uses=1]
- %tmp500 = icmp sgt i32 %tmp485, %tmp394 ; <i1> [#uses=1]
- %tmp504 = or i1 %tmp492, %tmp500 ; <i1> [#uses=1]
- br i1 %tmp504, label %cond_true507, label %cond_next509
-
-cond_true507: ; preds = %invcont484
- invoke void @__gnat_rcheck_12( i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0), i32 86 )
- to label %UnifiedUnreachableBlock34 unwind label %unwind480
-
-cond_next509: ; preds = %invcont484
- %tmp511 = invoke i32 @report__ident_int( i32 1 )
- to label %invcont510 unwind label %unwind480 ; <i32> [#uses=3]
-
-invcont510: ; preds = %cond_next509
- %tmp518 = icmp slt i32 %tmp511, %tmp384 ; <i1> [#uses=1]
- %tmp526 = icmp sgt i32 %tmp511, %tmp394 ; <i1> [#uses=1]
- %tmp530 = or i1 %tmp518, %tmp526 ; <i1> [#uses=1]
- br i1 %tmp530, label %cond_true533, label %cond_next535
-
-cond_true533: ; preds = %invcont510
- invoke void @__gnat_rcheck_12( i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0), i32 86 )
- to label %UnifiedUnreachableBlock34 unwind label %unwind480
-
-cond_next535: ; preds = %invcont510
- %tmp537 = invoke i32 @report__ident_int( i32 1 )
- to label %invcont536 unwind label %unwind480 ; <i32> [#uses=2]
-
-invcont536: ; preds = %cond_next535
- %tmp544 = icmp slt i32 %tmp537, %tmp384 ; <i1> [#uses=1]
- %tmp552 = icmp sgt i32 %tmp537, %tmp394 ; <i1> [#uses=1]
- %tmp556 = or i1 %tmp544, %tmp552 ; <i1> [#uses=1]
- br i1 %tmp556, label %cond_true559, label %cond_next561
-
-cond_true559: ; preds = %invcont536
- invoke void @__gnat_rcheck_12( i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0), i32 86 )
- to label %UnifiedUnreachableBlock34 unwind label %unwind480
-
-cond_next561: ; preds = %invcont536
- %tmp563 = invoke i32 @report__ident_int( i32 1 )
- to label %invcont562 unwind label %unwind480 ; <i32> [#uses=2]
-
-invcont562: ; preds = %cond_next561
- %tmp570 = icmp slt i32 %tmp563, %tmp384 ; <i1> [#uses=1]
- %tmp578 = icmp sgt i32 %tmp563, %tmp394 ; <i1> [#uses=1]
- %tmp582 = or i1 %tmp570, %tmp578 ; <i1> [#uses=1]
- br i1 %tmp582, label %cond_true585, label %cond_next587
-
-cond_true585: ; preds = %invcont562
- invoke void @__gnat_rcheck_12( i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0), i32 86 )
- to label %UnifiedUnreachableBlock34 unwind label %unwind480
-
-cond_next587: ; preds = %invcont562
- %tmp589 = invoke i32 @report__ident_int( i32 1 )
- to label %invcont588 unwind label %unwind480 ; <i32> [#uses=2]
-
-invcont588: ; preds = %cond_next587
- %tmp596 = icmp slt i32 %tmp589, %tmp384 ; <i1> [#uses=1]
- %tmp604 = icmp sgt i32 %tmp589, %tmp394 ; <i1> [#uses=1]
- %tmp608 = or i1 %tmp596, %tmp604 ; <i1> [#uses=1]
- br i1 %tmp608, label %cond_true611, label %cond_next613
-
-cond_true611: ; preds = %invcont588
- invoke void @__gnat_rcheck_12( i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0), i32 86 )
- to label %UnifiedUnreachableBlock34 unwind label %unwind480
-
-cond_next613: ; preds = %invcont588
- %tmp615 = invoke i32 @report__ident_int( i32 1 )
- to label %invcont614 unwind label %unwind480 ; <i32> [#uses=2]
-
-invcont614: ; preds = %cond_next613
- %tmp622 = icmp slt i32 %tmp615, %tmp384 ; <i1> [#uses=1]
- %tmp630 = icmp sgt i32 %tmp615, %tmp394 ; <i1> [#uses=1]
- %tmp634 = or i1 %tmp622, %tmp630 ; <i1> [#uses=1]
- br i1 %tmp634, label %cond_true637, label %cond_next639
-
-cond_true637: ; preds = %invcont614
- invoke void @__gnat_rcheck_12( i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0), i32 86 )
- to label %UnifiedUnreachableBlock34 unwind label %unwind480
-
-cond_next639: ; preds = %invcont614
- %tmp641 = invoke i32 @report__ident_int( i32 1 )
- to label %invcont640 unwind label %unwind480 ; <i32> [#uses=2]
-
-invcont640: ; preds = %cond_next639
- %tmp648 = icmp slt i32 %tmp641, %tmp384 ; <i1> [#uses=1]
- %tmp656 = icmp sgt i32 %tmp641, %tmp394 ; <i1> [#uses=1]
- %tmp660 = or i1 %tmp648, %tmp656 ; <i1> [#uses=1]
- br i1 %tmp660, label %cond_true663, label %cond_next665
-
-cond_true663: ; preds = %invcont640
- invoke void @__gnat_rcheck_12( i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0), i32 86 )
- to label %UnifiedUnreachableBlock34 unwind label %unwind480
-
-cond_next665: ; preds = %invcont640
- invoke void @system__img_int__image_integer( %struct.string___XUP* %tmp12 sret , i32 %tmp511 )
- to label %invcont717 unwind label %unwind480
-
-invcont717: ; preds = %cond_next665
- %tmp719 = getelementptr %struct.string___XUP* %tmp12, i32 0, i32 0 ; <i8**> [#uses=1]
- %tmp720 = load i8** %tmp719 ; <i8*> [#uses=1]
- %tmp7205888 = ptrtoint i8* %tmp720 to i32 ; <i32> [#uses=1]
- %tmp72058885889 = zext i32 %tmp7205888 to i64 ; <i64> [#uses=1]
- %tmp722 = getelementptr %struct.string___XUP* %tmp12, i32 0, i32 1 ; <%struct.string___XUB**> [#uses=1]
- %tmp723 = load %struct.string___XUB** %tmp722 ; <%struct.string___XUB*> [#uses=1]
- %tmp7235884 = ptrtoint %struct.string___XUB* %tmp723 to i32 ; <i32> [#uses=1]
- %tmp72358845885 = zext i32 %tmp7235884 to i64 ; <i64> [#uses=1]
- %tmp723588458855886 = shl i64 %tmp72358845885, 32 ; <i64> [#uses=1]
- %tmp723588458855886.ins = or i64 %tmp723588458855886, %tmp72058885889 ; <i64> [#uses=1]
- invoke void @system__string_ops__str_concat( %struct.string___XUP* %tmp15 sret , i64 or (i64 zext (i32 ptrtoint ([30 x i8]* @.str3 to i32) to i64), i64 shl (i64 zext (i32 ptrtoint (%struct.string___XUB* @C.30.904 to i32) to i64), i64 32)), i64 %tmp723588458855886.ins )
- to label %invcont734 unwind label %unwind480
-
-invcont734: ; preds = %invcont717
- %tmp736 = getelementptr %struct.string___XUP* %tmp15, i32 0, i32 0 ; <i8**> [#uses=1]
- %tmp737 = load i8** %tmp736 ; <i8*> [#uses=1]
- %tmp7375876 = ptrtoint i8* %tmp737 to i32 ; <i32> [#uses=1]
- %tmp73758765877 = zext i32 %tmp7375876 to i64 ; <i64> [#uses=1]
- %tmp739 = getelementptr %struct.string___XUP* %tmp15, i32 0, i32 1 ; <%struct.string___XUB**> [#uses=1]
- %tmp740 = load %struct.string___XUB** %tmp739 ; <%struct.string___XUB*> [#uses=1]
- %tmp7405872 = ptrtoint %struct.string___XUB* %tmp740 to i32 ; <i32> [#uses=1]
- %tmp74058725873 = zext i32 %tmp7405872 to i64 ; <i64> [#uses=1]
- %tmp740587258735874 = shl i64 %tmp74058725873, 32 ; <i64> [#uses=1]
- %tmp740587258735874.ins = or i64 %tmp740587258735874, %tmp73758765877 ; <i64> [#uses=1]
- invoke void @report__failed( i64 %tmp740587258735874.ins )
- to label %cleanup unwind label %unwind480
-
-cleanup: ; preds = %invcont734
- %tmp7515581 = ptrtoint i8* %tmp476 to i32 ; <i32> [#uses=1]
- %tmp75155815582 = zext i32 %tmp7515581 to i64 ; <i64> [#uses=1]
- %tmp7545578 = zext i32 %tmp479 to i64 ; <i64> [#uses=1]
- %tmp75455785579 = shl i64 %tmp7545578, 32 ; <i64> [#uses=1]
- %tmp75455785579.ins = or i64 %tmp75455785579, %tmp75155815582 ; <i64> [#uses=1]
- invoke void @system__secondary_stack__ss_release( i64 %tmp75455785579.ins )
- to label %cond_true856 unwind label %unwind468
-
-cleanup779: ; preds = %unwind480
- %eh_typeid = call i32 @llvm.eh.typeid.for.i32( i8* bitcast (i32* @__gnat_others_value to i8*) ) ; <i32> [#uses=1]
- %tmp781 = icmp eq i32 %eh_select483, %eh_typeid ; <i1> [#uses=1]
- br i1 %tmp781, label %eh_then, label %cleanup805
-
-eh_then: ; preds = %cleanup779, %unwind468
- %eh_exception.35924.0 = phi i8* [ %eh_ptr469, %unwind468 ], [ %eh_ptr481, %cleanup779 ] ; <i8*> [#uses=3]
- invoke void @__gnat_begin_handler( i8* %eh_exception.35924.0 )
- to label %invcont787 unwind label %unwind783
-
-unwind783: ; preds = %invcont789, %invcont787, %eh_then
- %eh_ptr784 = call i8* @llvm.eh.exception( ) ; <i8*> [#uses=2]
- %eh_select786 = call i32 (i8*, i8*, ...)* @llvm.eh.selector.i32( i8* %eh_ptr784, i8* bitcast (i32 (...)* @__gnat_eh_personality to i8*), %struct.exception* @constraint_error, i32* @__gnat_others_value ) ; <i32> [#uses=1]
- invoke void @__gnat_end_handler( i8* %eh_exception.35924.0 )
- to label %cleanup805 unwind label %unwind
-
-invcont787: ; preds = %eh_then
- %tmp788 = load void ()** @system__soft_links__abort_undefer ; <void ()*> [#uses=1]
- invoke void %tmp788( )
- to label %invcont789 unwind label %unwind783
-
-invcont789: ; preds = %invcont787
- invoke void @report__failed( i64 or (i64 zext (i32 ptrtoint ([28 x i8]* @.str4 to i32) to i64), i64 shl (i64 zext (i32 ptrtoint (%struct.string___XUB* @C.32.910 to i32) to i64), i64 32)) )
- to label %cleanup798 unwind label %unwind783
-
-cleanup798: ; preds = %invcont789
- invoke void @__gnat_end_handler( i8* %eh_exception.35924.0 )
- to label %cond_true856 unwind label %unwind
-
-cleanup805: ; preds = %unwind783, %cleanup779, %unwind468
- %eh_selector.0 = phi i32 [ %eh_select471, %unwind468 ], [ %eh_select483, %cleanup779 ], [ %eh_select786, %unwind783 ] ; <i32> [#uses=2]
- %eh_exception.0 = phi i8* [ %eh_ptr469, %unwind468 ], [ %eh_ptr481, %cleanup779 ], [ %eh_ptr784, %unwind783 ] ; <i8*> [#uses=2]
- %eh_typeid806 = call i32 @llvm.eh.typeid.for.i32( i8* getelementptr (%struct.exception* @constraint_error, i32 0, i32 0) ) ; <i32> [#uses=1]
- %tmp808 = icmp eq i32 %eh_selector.0, %eh_typeid806 ; <i1> [#uses=1]
- br i1 %tmp808, label %eh_then809, label %eh_else823
-
-eh_then809: ; preds = %cleanup805, %unwind
- %eh_exception.05914.0 = phi i8* [ %eh_ptr, %unwind ], [ %eh_exception.0, %cleanup805 ] ; <i8*> [#uses=3]
- invoke void @__gnat_begin_handler( i8* %eh_exception.05914.0 )
- to label %invcont815 unwind label %unwind813
-
-unwind813: ; preds = %invcont815, %eh_then809
- %eh_ptr814 = call i8* @llvm.eh.exception( ) ; <i8*> [#uses=1]
- call void @__gnat_end_handler( i8* %eh_exception.05914.0 )
- call i32 (...)* @_Unwind_Resume( i8* %eh_ptr814 ) ; <i32>:0 [#uses=0]
- unreachable
-
-invcont815: ; preds = %eh_then809
- %tmp816 = load void ()** @system__soft_links__abort_undefer ; <void ()*> [#uses=1]
- invoke void %tmp816( )
- to label %cleanup819 unwind label %unwind813
-
-cleanup819: ; preds = %invcont815
- call void @__gnat_end_handler( i8* %eh_exception.05914.0 )
- %tmp8595931 = icmp ult i8 %tmp170171, %tmp204205 ; <i1> [#uses=1]
- %tmp8635932 = icmp ugt i8 %tmp170171, %tmp272273 ; <i1> [#uses=1]
- %tmp8675933 = or i1 %tmp8635932, %tmp8595931 ; <i1> [#uses=1]
- br i1 %tmp8675933, label %cond_true870, label %bb887
-
-eh_else823: ; preds = %cleanup805, %unwind
- %eh_selector.05912.1 = phi i32 [ %eh_select, %unwind ], [ %eh_selector.0, %cleanup805 ] ; <i32> [#uses=1]
- %eh_exception.05914.1 = phi i8* [ %eh_ptr, %unwind ], [ %eh_exception.0, %cleanup805 ] ; <i8*> [#uses=4]
- %eh_typeid824 = call i32 @llvm.eh.typeid.for.i32( i8* bitcast (i32* @__gnat_others_value to i8*) ) ; <i32> [#uses=1]
- %tmp826 = icmp eq i32 %eh_selector.05912.1, %eh_typeid824 ; <i1> [#uses=1]
- br i1 %tmp826, label %eh_then827, label %Unwind
-
-eh_then827: ; preds = %eh_else823
- invoke void @__gnat_begin_handler( i8* %eh_exception.05914.1 )
- to label %invcont833 unwind label %unwind831
-
-unwind831: ; preds = %invcont835, %invcont833, %eh_then827
- %eh_ptr832 = call i8* @llvm.eh.exception( ) ; <i8*> [#uses=1]
- call void @__gnat_end_handler( i8* %eh_exception.05914.1 )
- call i32 (...)* @_Unwind_Resume( i8* %eh_ptr832 ) ; <i32>:1 [#uses=0]
- unreachable
-
-invcont833: ; preds = %eh_then827
- %tmp834 = load void ()** @system__soft_links__abort_undefer ; <void ()*> [#uses=1]
- invoke void %tmp834( )
- to label %invcont835 unwind label %unwind831
-
-invcont835: ; preds = %invcont833
- invoke void @report__failed( i64 or (i64 zext (i32 ptrtoint ([24 x i8]* @.str5 to i32) to i64), i64 shl (i64 zext (i32 ptrtoint (%struct.string___XUB* @C.35.915 to i32) to i64), i64 32)) )
- to label %cleanup844 unwind label %unwind831
-
-cleanup844: ; preds = %invcont835
- call void @__gnat_end_handler( i8* %eh_exception.05914.1 )
- br label %cond_true856
-
-cond_true856: ; preds = %cleanup844, %cleanup798, %cleanup
- %tmp859 = icmp ult i8 %tmp170171, %tmp204205 ; <i1> [#uses=1]
- %tmp863 = icmp ugt i8 %tmp170171, %tmp272273 ; <i1> [#uses=1]
- %tmp867 = or i1 %tmp863, %tmp859 ; <i1> [#uses=1]
- br i1 %tmp867, label %cond_true870, label %bb887
-
-cond_true870: ; preds = %cond_true856, %cleanup819
- invoke void @__gnat_rcheck_12( i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0), i32 103 )
- to label %UnifiedUnreachableBlock34 unwind label %unwind871
-
-unwind871: ; preds = %cond_next905, %bb887, %cond_true870
- %sat.3 = phi i8 [ %tmp340341, %cond_true870 ], [ %sat.1, %bb887 ], [ %sat.0, %cond_next905 ] ; <i8> [#uses=2]
- %eh_ptr872 = call i8* @llvm.eh.exception( ) ; <i8*> [#uses=8]
- %eh_select874 = call i32 (i8*, i8*, ...)* @llvm.eh.selector.i32( i8* %eh_ptr872, i8* bitcast (i32 (...)* @__gnat_eh_personality to i8*), %struct.exception* @constraint_error, i32* @__gnat_others_value ) ; <i32> [#uses=2]
- %eh_typeid915 = call i32 @llvm.eh.typeid.for.i32( i8* getelementptr (%struct.exception* @constraint_error, i32 0, i32 0) ) ; <i32> [#uses=1]
- %tmp917 = icmp eq i32 %eh_select874, %eh_typeid915 ; <i1> [#uses=1]
- br i1 %tmp917, label %eh_then918, label %eh_else932
-
-bb887: ; preds = %cond_next901, %cond_true856, %cleanup819
- %indvar = phi i8 [ %indvar.next10, %cond_next901 ], [ 0, %cond_true856 ], [ 0, %cleanup819 ] ; <i8> [#uses=2]
- %sat.1 = phi i8 [ %sat.0, %cond_next901 ], [ %tmp340341, %cond_true856 ], [ %tmp340341, %cleanup819 ] ; <i8> [#uses=2]
- %tmp889 = invoke i8 @report__equal( i32 2, i32 2 )
- to label %invcont888 unwind label %unwind871 ; <i8> [#uses=1]
-
-invcont888: ; preds = %bb887
- %i.4 = add i8 %indvar, %tmp170171 ; <i8> [#uses=1]
- %tmp890 = icmp eq i8 %tmp889, 0 ; <i1> [#uses=1]
- %sat.0 = select i1 %tmp890, i8 %sat.1, i8 6 ; <i8> [#uses=3]
- %tmp897 = icmp eq i8 %i.4, %tmp170171 ; <i1> [#uses=1]
- br i1 %tmp897, label %cond_next905, label %cond_next901
-
-cond_next901: ; preds = %invcont888
- %indvar.next10 = add i8 %indvar, 1 ; <i8> [#uses=1]
- br label %bb887
-
-cond_next905: ; preds = %invcont888
- invoke void @report__failed( i64 or (i64 zext (i32 ptrtoint ([29 x i8]* @.str6 to i32) to i64), i64 shl (i64 zext (i32 ptrtoint (%struct.string___XUB* @C.36.923 to i32) to i64), i64 32)) )
- to label %finally913 unwind label %unwind871
-
-eh_then918: ; preds = %unwind871
- invoke void @__gnat_begin_handler( i8* %eh_ptr872 )
- to label %invcont924 unwind label %unwind922
-
-unwind922: ; preds = %invcont924, %eh_then918
- %eh_ptr923 = call i8* @llvm.eh.exception( ) ; <i8*> [#uses=1]
- call void @__gnat_end_handler( i8* %eh_ptr872 )
- call i32 (...)* @_Unwind_Resume( i8* %eh_ptr923 ) ; <i32>:2 [#uses=0]
- unreachable
-
-invcont924: ; preds = %eh_then918
- %tmp925 = load void ()** @system__soft_links__abort_undefer ; <void ()*> [#uses=1]
- invoke void %tmp925( )
- to label %cleanup928 unwind label %unwind922
-
-cleanup928: ; preds = %invcont924
- call void @__gnat_end_handler( i8* %eh_ptr872 )
- br i1 %tmp462, label %cond_true973, label %UnifiedReturnBlock35
-
-eh_else932: ; preds = %unwind871
- %eh_typeid933 = call i32 @llvm.eh.typeid.for.i32( i8* bitcast (i32* @__gnat_others_value to i8*) ) ; <i32> [#uses=1]
- %tmp935 = icmp eq i32 %eh_select874, %eh_typeid933 ; <i1> [#uses=1]
- br i1 %tmp935, label %eh_then936, label %Unwind
-
-eh_then936: ; preds = %eh_else932
- invoke void @__gnat_begin_handler( i8* %eh_ptr872 )
- to label %invcont942 unwind label %unwind940
-
-unwind940: ; preds = %invcont944, %invcont942, %eh_then936
- %eh_ptr941 = call i8* @llvm.eh.exception( ) ; <i8*> [#uses=1]
- call void @__gnat_end_handler( i8* %eh_ptr872 )
- call i32 (...)* @_Unwind_Resume( i8* %eh_ptr941 ) ; <i32>:3 [#uses=0]
- unreachable
-
-invcont942: ; preds = %eh_then936
- %tmp943 = load void ()** @system__soft_links__abort_undefer ; <void ()*> [#uses=1]
- invoke void %tmp943( )
- to label %invcont944 unwind label %unwind940
-
-invcont944: ; preds = %invcont942
- invoke void @report__failed( i64 or (i64 zext (i32 ptrtoint ([24 x i8]* @.str7 to i32) to i64), i64 shl (i64 zext (i32 ptrtoint (%struct.string___XUB* @C.35.915 to i32) to i64), i64 32)) )
- to label %cleanup953 unwind label %unwind940
-
-cleanup953: ; preds = %invcont944
- call void @__gnat_end_handler( i8* %eh_ptr872 )
- br label %finally913
-
-finally913: ; preds = %cleanup953, %cond_next905
- %sat.4 = phi i8 [ %sat.3, %cleanup953 ], [ %sat.0, %cond_next905 ] ; <i8> [#uses=1]
- br i1 %tmp462, label %cond_true973, label %UnifiedReturnBlock35
-
-cond_true973: ; preds = %finally913, %cleanup928
- %sat.45934.0 = phi i8 [ %sat.3, %cleanup928 ], [ %sat.4, %finally913 ] ; <i8> [#uses=9]
- invoke void @__gnat_rcheck_12( i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0), i32 119 )
- to label %UnifiedUnreachableBlock34 unwind label %unwind974
-
-unwind974: ; preds = %cond_true973
- %eh_ptr975 = call i8* @llvm.eh.exception( ) ; <i8*> [#uses=8]
- %eh_select977 = call i32 (i8*, i8*, ...)* @llvm.eh.selector.i32( i8* %eh_ptr975, i8* bitcast (i32 (...)* @__gnat_eh_personality to i8*), %struct.exception* @constraint_error, i32* @__gnat_others_value ) ; <i32> [#uses=2]
- %eh_typeid13135959 = call i32 @llvm.eh.typeid.for.i32( i8* getelementptr (%struct.exception* @constraint_error, i32 0, i32 0) ) ; <i32> [#uses=1]
- %tmp13155961 = icmp eq i32 %eh_select977, %eh_typeid13135959 ; <i1> [#uses=1]
- br i1 %tmp13155961, label %eh_then1316, label %eh_else1330
-
-eh_then1316: ; preds = %unwind974
- invoke void @__gnat_begin_handler( i8* %eh_ptr975 )
- to label %invcont1322 unwind label %unwind1320
-
-unwind1320: ; preds = %invcont1322, %eh_then1316
- %eh_ptr1321 = call i8* @llvm.eh.exception( ) ; <i8*> [#uses=1]
- call void @__gnat_end_handler( i8* %eh_ptr975 )
- call i32 (...)* @_Unwind_Resume( i8* %eh_ptr1321 ) ; <i32>:4 [#uses=0]
- unreachable
-
-invcont1322: ; preds = %eh_then1316
- %tmp1323 = load void ()** @system__soft_links__abort_undefer ; <void ()*> [#uses=1]
- invoke void %tmp1323( )
- to label %cleanup1326 unwind label %unwind1320
-
-cleanup1326: ; preds = %invcont1322
- call void @__gnat_end_handler( i8* %eh_ptr975 )
- br label %finally1311
-
-eh_else1330: ; preds = %unwind974
- %eh_typeid1331 = call i32 @llvm.eh.typeid.for.i32( i8* bitcast (i32* @__gnat_others_value to i8*) ) ; <i32> [#uses=1]
- %tmp1333 = icmp eq i32 %eh_select977, %eh_typeid1331 ; <i1> [#uses=1]
- br i1 %tmp1333, label %eh_then1334, label %Unwind
-
-eh_then1334: ; preds = %eh_else1330
- invoke void @__gnat_begin_handler( i8* %eh_ptr975 )
- to label %invcont1340 unwind label %unwind1338
-
-unwind1338: ; preds = %invcont1342, %invcont1340, %eh_then1334
- %eh_ptr1339 = call i8* @llvm.eh.exception( ) ; <i8*> [#uses=1]
- call void @__gnat_end_handler( i8* %eh_ptr975 )
- call i32 (...)* @_Unwind_Resume( i8* %eh_ptr1339 ) ; <i32>:5 [#uses=0]
- unreachable
-
-invcont1340: ; preds = %eh_then1334
- %tmp1341 = load void ()** @system__soft_links__abort_undefer ; <void ()*> [#uses=1]
- invoke void %tmp1341( )
- to label %invcont1342 unwind label %unwind1338
-
-invcont1342: ; preds = %invcont1340
- invoke void @report__failed( i64 or (i64 zext (i32 ptrtoint ([24 x i8]* @.str10 to i32) to i64), i64 shl (i64 zext (i32 ptrtoint (%struct.string___XUB* @C.35.915 to i32) to i64), i64 32)) )
- to label %cleanup1351 unwind label %unwind1338
-
-cleanup1351: ; preds = %invcont1342
- call void @__gnat_end_handler( i8* %eh_ptr975 )
- br label %finally1311
-
-finally1311: ; preds = %cleanup1351, %cleanup1326
- %tmp1356 = call i8* @llvm.stacksave( ) ; <i8*> [#uses=6]
- %tmp13571358 = and i32 %tmp184, 255 ; <i32> [#uses=11]
- %tmp13831384 = and i32 %tmp252, 255 ; <i32> [#uses=5]
- %tmp1387 = add i32 %tmp13571358, -1 ; <i32> [#uses=2]
- %tmp1388 = icmp sge i32 %tmp13831384, %tmp1387 ; <i1> [#uses=1]
- %max1389 = select i1 %tmp1388, i32 %tmp13831384, i32 %tmp1387 ; <i32> [#uses=1]
- %tmp1392 = sub i32 %max1389, %tmp13571358 ; <i32> [#uses=1]
- %tmp1393 = add i32 %tmp1392, 1 ; <i32> [#uses=2]
- %tmp1394 = icmp sgt i32 %tmp1393, -1 ; <i1> [#uses=1]
- %max1395 = select i1 %tmp1394, i32 %tmp1393, i32 0 ; <i32> [#uses=5]
- %tmp1397 = alloca i8, i32 %max1395 ; <i8*> [#uses=2]
- %tmp1401 = icmp ult i8 %tmp238239, %tmp170171 ; <i1> [#uses=2]
- br i1 %tmp1401, label %cond_next1425, label %cond_true1404
-
-cond_true1404: ; preds = %finally1311
- %tmp1407 = icmp ult i8 %tmp170171, %tmp204205 ; <i1> [#uses=1]
- %tmp1411 = icmp ugt i8 %tmp238239, %tmp272273 ; <i1> [#uses=1]
- %tmp1415 = or i1 %tmp1411, %tmp1407 ; <i1> [#uses=1]
- br i1 %tmp1415, label %cond_true1418, label %cond_next1425
-
-cond_true1418: ; preds = %cond_true1404
- invoke void @__gnat_rcheck_12( i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0), i32 144 )
- to label %UnifiedUnreachableBlock34 unwind label %unwind1419
-
-unwind1419: ; preds = %cleanup1702, %cleanup1686, %unwind1676, %cond_next1548, %cond_true1546, %cond_true1418
- %eh_ptr1420 = call i8* @llvm.eh.exception( ) ; <i8*> [#uses=3]
- %eh_select1422 = call i32 (i8*, i8*, ...)* @llvm.eh.selector.i32( i8* %eh_ptr1420, i8* bitcast (i32 (...)* @__gnat_eh_personality to i8*), %struct.exception* @constraint_error, i32* @__gnat_others_value ) ; <i32> [#uses=2]
- %eh_typeid17215981 = call i32 @llvm.eh.typeid.for.i32( i8* getelementptr (%struct.exception* @constraint_error, i32 0, i32 0) ) ; <i32> [#uses=1]
- %tmp17235983 = icmp eq i32 %eh_select1422, %eh_typeid17215981 ; <i1> [#uses=1]
- br i1 %tmp17235983, label %eh_then1724, label %eh_else1742
-
-cond_next1425: ; preds = %cond_true1404, %finally1311
- %tmp14281429 = and i32 %tmp150, 255 ; <i32> [#uses=3]
- %tmp14841485 = and i32 %tmp218, 255 ; <i32> [#uses=3]
- %tmp1488 = add i32 %tmp14281429, -1 ; <i32> [#uses=2]
- %tmp1489 = icmp sge i32 %tmp14841485, %tmp1488 ; <i1> [#uses=1]
- %max1490 = select i1 %tmp1489, i32 %tmp14841485, i32 %tmp1488 ; <i32> [#uses=1]
- %tmp1493 = sub i32 %max1490, %tmp14281429 ; <i32> [#uses=1]
- %tmp1494 = add i32 %tmp1493, 1 ; <i32> [#uses=2]
- %tmp1495 = icmp sgt i32 %tmp1494, -1 ; <i1> [#uses=1]
- %max1496 = select i1 %tmp1495, i32 %tmp1494, i32 0 ; <i32> [#uses=1]
- %tmp1497 = alloca i8, i32 %max1496 ; <i8*> [#uses=3]
- %tmp1504 = icmp ugt i8 %tmp170171, %tmp238239 ; <i1> [#uses=1]
- br i1 %tmp1504, label %cond_next1526, label %bb1509
-
-bb1509: ; preds = %cond_next1425
- store i8 %tmp238239, i8* %tmp1497
- %tmp1518 = icmp eq i8 %tmp238239, %tmp170171 ; <i1> [#uses=1]
- br i1 %tmp1518, label %cond_next1526, label %cond_next1522.preheader
-
-cond_next1522.preheader: ; preds = %bb1509
- %J64b.55984.8 = add i8 %tmp170171, 1 ; <i8> [#uses=1]
- br label %cond_next1522
-
-cond_next1522: ; preds = %cond_next1522, %cond_next1522.preheader
- %indvar6241 = phi i8 [ 0, %cond_next1522.preheader ], [ %indvar.next, %cond_next1522 ] ; <i8> [#uses=2]
- %tmp1524 = add i8 %J64b.55984.8, %indvar6241 ; <i8> [#uses=2]
- %tmp151015115988 = zext i8 %tmp1524 to i32 ; <i32> [#uses=1]
- %tmp15135989 = sub i32 %tmp151015115988, %tmp14281429 ; <i32> [#uses=1]
- %tmp15145990 = getelementptr i8* %tmp1497, i32 %tmp15135989 ; <i8*> [#uses=1]
- store i8 %tmp238239, i8* %tmp15145990
- %tmp15185992 = icmp eq i8 %tmp238239, %tmp1524 ; <i1> [#uses=1]
- %indvar.next = add i8 %indvar6241, 1 ; <i8> [#uses=1]
- br i1 %tmp15185992, label %cond_next1526, label %cond_next1522
-
-cond_next1526: ; preds = %cond_next1522, %bb1509, %cond_next1425
- %tmp15271528 = zext i8 %tmp272273 to i64 ; <i64> [#uses=1]
- %tmp15291530 = zext i8 %tmp204205 to i64 ; <i64> [#uses=1]
- %tmp1531 = sub i64 %tmp15271528, %tmp15291530 ; <i64> [#uses=1]
- %tmp1532 = add i64 %tmp1531, 1 ; <i64> [#uses=2]
- %tmp1533 = icmp sgt i64 %tmp1532, -1 ; <i1> [#uses=1]
- %max1534 = select i1 %tmp1533, i64 %tmp1532, i64 0 ; <i64> [#uses=1]
- %tmp15351536 = zext i8 %tmp238239 to i64 ; <i64> [#uses=1]
- %tmp15371538 = zext i8 %tmp170171 to i64 ; <i64> [#uses=1]
- %tmp1539 = sub i64 %tmp15351536, %tmp15371538 ; <i64> [#uses=1]
- %tmp1540 = add i64 %tmp1539, 1 ; <i64> [#uses=2]
- %tmp1541 = icmp sgt i64 %tmp1540, -1 ; <i1> [#uses=1]
- %max1542 = select i1 %tmp1541, i64 %tmp1540, i64 0 ; <i64> [#uses=1]
- %tmp1543 = icmp eq i64 %max1534, %max1542 ; <i1> [#uses=1]
- br i1 %tmp1543, label %cond_next1548, label %cond_true1546
-
-cond_true1546: ; preds = %cond_next1526
- invoke void @__gnat_rcheck_07( i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0), i32 144 )
- to label %UnifiedUnreachableBlock34 unwind label %unwind1419
-
-cond_next1548: ; preds = %cond_next1526
- call void @llvm.memcpy.i32( i8* %tmp1397, i8* %tmp1497, i32 %max1395, i32 1 )
- invoke void @system__secondary_stack__ss_mark( %struct.system__secondary_stack__mark_id* %tmp31 sret )
- to label %invcont1552 unwind label %unwind1419
-
-invcont1552: ; preds = %cond_next1548
- %tmp1555 = getelementptr %struct.system__secondary_stack__mark_id* %tmp31, i32 0, i32 0 ; <i8**> [#uses=1]
- %tmp1556 = load i8** %tmp1555 ; <i8*> [#uses=3]
- %tmp1558 = getelementptr %struct.system__secondary_stack__mark_id* %tmp31, i32 0, i32 1 ; <i32*> [#uses=1]
- %tmp1559 = load i32* %tmp1558 ; <i32> [#uses=3]
- %tmp1562 = icmp ult i8 %tmp238239, %tmp204205 ; <i1> [#uses=1]
- %tmp1566 = icmp ugt i8 %tmp238239, %tmp272273 ; <i1> [#uses=1]
- %tmp1570 = or i1 %tmp1566, %tmp1562 ; <i1> [#uses=1]
- br i1 %tmp1570, label %cond_true1573, label %cond_next1591
-
-cond_true1573: ; preds = %invcont1552
- invoke void @__gnat_rcheck_05( i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0), i32 148 )
- to label %UnifiedUnreachableBlock34 unwind label %unwind1574
-
-unwind1574: ; preds = %invcont1638, %invcont1621, %bb1607, %bb1605, %cond_true1573
- %eh_ptr1575 = call i8* @llvm.eh.exception( ) ; <i8*> [#uses=5]
- %eh_select1577 = call i32 (i8*, i8*, ...)* @llvm.eh.selector.i32( i8* %eh_ptr1575, i8* bitcast (i32 (...)* @__gnat_eh_personality to i8*), i32* @__gnat_others_value ) ; <i32> [#uses=2]
- %eh_typeid1652 = call i32 @llvm.eh.typeid.for.i32( i8* bitcast (i32* @__gnat_others_value to i8*) ) ; <i32> [#uses=1]
- %tmp1654 = icmp eq i32 %eh_select1577, %eh_typeid1652 ; <i1> [#uses=1]
- br i1 %tmp1654, label %eh_then1655, label %cleanup1686
-
-cond_next1591: ; preds = %invcont1552
- %tmp1595 = sub i32 %tmp14841485, %tmp13571358 ; <i32> [#uses=1]
- %tmp1596 = getelementptr i8* %tmp1397, i32 %tmp1595 ; <i8*> [#uses=1]
- %tmp1597 = load i8* %tmp1596 ; <i8> [#uses=2]
- %tmp1599 = icmp ugt i8 %tmp1597, 6 ; <i1> [#uses=1]
- br i1 %tmp1599, label %bb1605, label %bb1607
-
-bb1605: ; preds = %cond_next1591
- invoke void @__gnat_rcheck_06( i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0), i32 148 )
- to label %UnifiedUnreachableBlock34 unwind label %unwind1574
-
-bb1607: ; preds = %cond_next1591
- %tmp16151616 = zext i8 %tmp1597 to i32 ; <i32> [#uses=1]
- invoke void @system__img_enum__image_enumeration_8( %struct.string___XUP* %tmp34 sret , i32 %tmp16151616, i64 or (i64 zext (i32 ptrtoint ([28 x i8]* @weekS.154 to i32) to i64), i64 shl (i64 zext (i32 ptrtoint (%struct.string___XUB* @C.32.910 to i32) to i64), i64 32)), i8* getelementptr ([8 x i8]* @weekN.179, i32 0, i32 0) )
- to label %invcont1621 unwind label %unwind1574
-
-invcont1621: ; preds = %bb1607
- %tmp1623 = getelementptr %struct.string___XUP* %tmp34, i32 0, i32 0 ; <i8**> [#uses=1]
- %tmp1624 = load i8** %tmp1623 ; <i8*> [#uses=1]
- %tmp16245815 = ptrtoint i8* %tmp1624 to i32 ; <i32> [#uses=1]
- %tmp162458155816 = zext i32 %tmp16245815 to i64 ; <i64> [#uses=1]
- %tmp1626 = getelementptr %struct.string___XUP* %tmp34, i32 0, i32 1 ; <%struct.string___XUB**> [#uses=1]
- %tmp1627 = load %struct.string___XUB** %tmp1626 ; <%struct.string___XUB*> [#uses=1]
- %tmp16275811 = ptrtoint %struct.string___XUB* %tmp1627 to i32 ; <i32> [#uses=1]
- %tmp162758115812 = zext i32 %tmp16275811 to i64 ; <i64> [#uses=1]
- %tmp1627581158125813 = shl i64 %tmp162758115812, 32 ; <i64> [#uses=1]
- %tmp1627581158125813.ins = or i64 %tmp1627581158125813, %tmp162458155816 ; <i64> [#uses=1]
- invoke void @system__string_ops__str_concat( %struct.string___XUP* %tmp37 sret , i64 or (i64 zext (i32 ptrtoint ([30 x i8]* @.str11 to i32) to i64), i64 shl (i64 zext (i32 ptrtoint (%struct.string___XUB* @C.30.904 to i32) to i64), i64 32)), i64 %tmp1627581158125813.ins )
- to label %invcont1638 unwind label %unwind1574
-
-invcont1638: ; preds = %invcont1621
- %tmp1640 = getelementptr %struct.string___XUP* %tmp37, i32 0, i32 0 ; <i8**> [#uses=1]
- %tmp1641 = load i8** %tmp1640 ; <i8*> [#uses=1]
- %tmp16415803 = ptrtoint i8* %tmp1641 to i32 ; <i32> [#uses=1]
- %tmp164158035804 = zext i32 %tmp16415803 to i64 ; <i64> [#uses=1]
- %tmp1643 = getelementptr %struct.string___XUP* %tmp37, i32 0, i32 1 ; <%struct.string___XUB**> [#uses=1]
- %tmp1644 = load %struct.string___XUB** %tmp1643 ; <%struct.string___XUB*> [#uses=1]
- %tmp16445799 = ptrtoint %struct.string___XUB* %tmp1644 to i32 ; <i32> [#uses=1]
- %tmp164457995800 = zext i32 %tmp16445799 to i64 ; <i64> [#uses=1]
- %tmp1644579958005801 = shl i64 %tmp164457995800, 32 ; <i64> [#uses=1]
- %tmp1644579958005801.ins = or i64 %tmp1644579958005801, %tmp164158035804 ; <i64> [#uses=1]
- invoke void @report__failed( i64 %tmp1644579958005801.ins )
- to label %cleanup1702 unwind label %unwind1574
-
-eh_then1655: ; preds = %unwind1574
- invoke void @__gnat_begin_handler( i8* %eh_ptr1575 )
- to label %invcont1663 unwind label %unwind1659
-
-unwind1659: ; preds = %invcont1665, %invcont1663, %eh_then1655
- %eh_ptr1660 = call i8* @llvm.eh.exception( ) ; <i8*> [#uses=2]
- %eh_select1662 = call i32 (i8*, i8*, ...)* @llvm.eh.selector.i32( i8* %eh_ptr1660, i8* bitcast (i32 (...)* @__gnat_eh_personality to i8*), %struct.exception* @constraint_error, i32* @__gnat_others_value ) ; <i32> [#uses=1]
- invoke void @__gnat_end_handler( i8* %eh_ptr1575 )
- to label %cleanup1686 unwind label %unwind1676
-
-invcont1663: ; preds = %eh_then1655
- %tmp1664 = load void ()** @system__soft_links__abort_undefer ; <void ()*> [#uses=1]
- invoke void %tmp1664( )
- to label %invcont1665 unwind label %unwind1659
-
-invcont1665: ; preds = %invcont1663
- invoke void @report__failed( i64 or (i64 zext (i32 ptrtoint ([28 x i8]* @.str12 to i32) to i64), i64 shl (i64 zext (i32 ptrtoint (%struct.string___XUB* @C.32.910 to i32) to i64), i64 32)) )
- to label %cleanup1674 unwind label %unwind1659
-
-cleanup1674: ; preds = %invcont1665
- invoke void @__gnat_end_handler( i8* %eh_ptr1575 )
- to label %cleanup1702 unwind label %unwind1676
-
-unwind1676: ; preds = %cleanup1674, %unwind1659
- %eh_ptr1677 = call i8* @llvm.eh.exception( ) ; <i8*> [#uses=2]
- %eh_select1679 = call i32 (i8*, i8*, ...)* @llvm.eh.selector.i32( i8* %eh_ptr1677, i8* bitcast (i32 (...)* @__gnat_eh_personality to i8*), %struct.exception* @constraint_error, i32* @__gnat_others_value ) ; <i32> [#uses=1]
- %tmp169255575995 = ptrtoint i8* %tmp1556 to i32 ; <i32> [#uses=1]
- %tmp1692555755585996 = zext i32 %tmp169255575995 to i64 ; <i64> [#uses=1]
- %tmp169555545997 = zext i32 %tmp1559 to i64 ; <i64> [#uses=1]
- %tmp1695555455555998 = shl i64 %tmp169555545997, 32 ; <i64> [#uses=1]
- %tmp169555545555.ins5999 = or i64 %tmp1695555455555998, %tmp1692555755585996 ; <i64> [#uses=1]
- invoke void @system__secondary_stack__ss_release( i64 %tmp169555545555.ins5999 )
- to label %cleanup1720 unwind label %unwind1419
-
-cleanup1686: ; preds = %unwind1659, %unwind1574
- %eh_selector.18 = phi i32 [ %eh_select1577, %unwind1574 ], [ %eh_select1662, %unwind1659 ] ; <i32> [#uses=1]
- %eh_exception.18 = phi i8* [ %eh_ptr1575, %unwind1574 ], [ %eh_ptr1660, %unwind1659 ] ; <i8*> [#uses=1]
- %tmp16925557 = ptrtoint i8* %tmp1556 to i32 ; <i32> [#uses=1]
- %tmp169255575558 = zext i32 %tmp16925557 to i64 ; <i64> [#uses=1]
- %tmp16955554 = zext i32 %tmp1559 to i64 ; <i64> [#uses=1]
- %tmp169555545555 = shl i64 %tmp16955554, 32 ; <i64> [#uses=1]
- %tmp169555545555.ins = or i64 %tmp169555545555, %tmp169255575558 ; <i64> [#uses=1]
- invoke void @system__secondary_stack__ss_release( i64 %tmp169555545555.ins )
- to label %cleanup1720 unwind label %unwind1419
-
-cleanup1702: ; preds = %cleanup1674, %invcont1638
- %tmp17095551 = ptrtoint i8* %tmp1556 to i32 ; <i32> [#uses=1]
- %tmp170955515552 = zext i32 %tmp17095551 to i64 ; <i64> [#uses=1]
- %tmp17125548 = zext i32 %tmp1559 to i64 ; <i64> [#uses=1]
- %tmp171255485549 = shl i64 %tmp17125548, 32 ; <i64> [#uses=1]
- %tmp171255485549.ins = or i64 %tmp171255485549, %tmp170955515552 ; <i64> [#uses=1]
- invoke void @system__secondary_stack__ss_release( i64 %tmp171255485549.ins )
- to label %cleanup1773 unwind label %unwind1419
-
-cleanup1720: ; preds = %cleanup1686, %unwind1676
- %eh_selector.185993.1 = phi i32 [ %eh_select1679, %unwind1676 ], [ %eh_selector.18, %cleanup1686 ] ; <i32> [#uses=2]
- %eh_exception.185994.1 = phi i8* [ %eh_ptr1677, %unwind1676 ], [ %eh_exception.18, %cleanup1686 ] ; <i8*> [#uses=2]
- %eh_typeid1721 = call i32 @llvm.eh.typeid.for.i32( i8* getelementptr (%struct.exception* @constraint_error, i32 0, i32 0) ) ; <i32> [#uses=1]
- %tmp1723 = icmp eq i32 %eh_selector.185993.1, %eh_typeid1721 ; <i1> [#uses=1]
- br i1 %tmp1723, label %eh_then1724, label %eh_else1742
-
-eh_then1724: ; preds = %cleanup1720, %unwind1419
- %eh_exception.135974.0 = phi i8* [ %eh_ptr1420, %unwind1419 ], [ %eh_exception.185994.1, %cleanup1720 ] ; <i8*> [#uses=3]
- invoke void @__gnat_begin_handler( i8* %eh_exception.135974.0 )
- to label %invcont1730 unwind label %unwind1728
-
-unwind1728: ; preds = %invcont1730, %eh_then1724
- %eh_ptr1729 = call i8* @llvm.eh.exception( ) ; <i8*> [#uses=1]
- invoke void @__gnat_end_handler( i8* %eh_exception.135974.0 )
- to label %cleanup1771 unwind label %unwind1736
-
-invcont1730: ; preds = %eh_then1724
- %tmp1731 = load void ()** @system__soft_links__abort_undefer ; <void ()*> [#uses=1]
- invoke void %tmp1731( )
- to label %cleanup1734 unwind label %unwind1728
-
-cleanup1734: ; preds = %invcont1730
- invoke void @__gnat_end_handler( i8* %eh_exception.135974.0 )
- to label %cleanup1773 unwind label %unwind1736
-
-unwind1736: ; preds = %cleanup1763, %unwind1750, %cleanup1734, %unwind1728
- %eh_ptr1737 = call i8* @llvm.eh.exception( ) ; <i8*> [#uses=1]
- call void @llvm.stackrestore( i8* %tmp1356 )
- call void @llvm.stackrestore( i8* %tmp1356 )
- call i32 (...)* @_Unwind_Resume( i8* %eh_ptr1737 ) ; <i32>:6 [#uses=0]
- unreachable
-
-eh_else1742: ; preds = %cleanup1720, %unwind1419
- %eh_selector.135972.1 = phi i32 [ %eh_select1422, %unwind1419 ], [ %eh_selector.185993.1, %cleanup1720 ] ; <i32> [#uses=1]
- %eh_exception.135974.1 = phi i8* [ %eh_ptr1420, %unwind1419 ], [ %eh_exception.185994.1, %cleanup1720 ] ; <i8*> [#uses=4]
- %eh_typeid1743 = call i32 @llvm.eh.typeid.for.i32( i8* bitcast (i32* @__gnat_others_value to i8*) ) ; <i32> [#uses=1]
- %tmp1745 = icmp eq i32 %eh_selector.135972.1, %eh_typeid1743 ; <i1> [#uses=1]
- br i1 %tmp1745, label %eh_then1746, label %cleanup1771
-
-eh_then1746: ; preds = %eh_else1742
- invoke void @__gnat_begin_handler( i8* %eh_exception.135974.1 )
- to label %invcont1752 unwind label %unwind1750
-
-unwind1750: ; preds = %invcont1754, %invcont1752, %eh_then1746
- %eh_ptr1751 = call i8* @llvm.eh.exception( ) ; <i8*> [#uses=1]
- invoke void @__gnat_end_handler( i8* %eh_exception.135974.1 )
- to label %cleanup1771 unwind label %unwind1736
-
-invcont1752: ; preds = %eh_then1746
- %tmp1753 = load void ()** @system__soft_links__abort_undefer ; <void ()*> [#uses=1]
- invoke void %tmp1753( )
- to label %invcont1754 unwind label %unwind1750
-
-invcont1754: ; preds = %invcont1752
- invoke void @report__failed( i64 or (i64 zext (i32 ptrtoint ([24 x i8]* @.str13 to i32) to i64), i64 shl (i64 zext (i32 ptrtoint (%struct.string___XUB* @C.35.915 to i32) to i64), i64 32)) )
- to label %cleanup1763 unwind label %unwind1750
-
-cleanup1763: ; preds = %invcont1754
- invoke void @__gnat_end_handler( i8* %eh_exception.135974.1 )
- to label %cleanup1773 unwind label %unwind1736
-
-cleanup1771: ; preds = %unwind1750, %eh_else1742, %unwind1728
- %eh_exception.20 = phi i8* [ %eh_ptr1729, %unwind1728 ], [ %eh_exception.135974.1, %eh_else1742 ], [ %eh_ptr1751, %unwind1750 ] ; <i8*> [#uses=1]
- call void @llvm.stackrestore( i8* %tmp1356 )
- call void @llvm.stackrestore( i8* %tmp1356 )
- call i32 (...)* @_Unwind_Resume( i8* %eh_exception.20 ) ; <i32>:7 [#uses=0]
- unreachable
-
-cleanup1773: ; preds = %cleanup1763, %cleanup1734, %cleanup1702
- call void @llvm.stackrestore( i8* %tmp1356 )
- call void @llvm.stackrestore( i8* %tmp1356 )
- %tmp1780 = call i8* @llvm.stacksave( ) ; <i8*> [#uses=6]
- %tmp17811782 = and i32 %tmp150, 255 ; <i32> [#uses=4]
- %tmp18071808 = and i32 %tmp286, 255 ; <i32> [#uses=2]
- %tmp1811 = add i32 %tmp17811782, -1 ; <i32> [#uses=2]
- %tmp1812 = icmp sge i32 %tmp18071808, %tmp1811 ; <i1> [#uses=1]
- %max1813 = select i1 %tmp1812, i32 %tmp18071808, i32 %tmp1811 ; <i32> [#uses=1]
- %tmp1816 = sub i32 %max1813, %tmp17811782 ; <i32> [#uses=1]
- %tmp1817 = add i32 %tmp1816, 1 ; <i32> [#uses=2]
- %tmp1818 = icmp sgt i32 %tmp1817, -1 ; <i1> [#uses=1]
- %max1819 = select i1 %tmp1818, i32 %tmp1817, i32 0 ; <i32> [#uses=3]
- %tmp1821 = alloca i8, i32 %max1819 ; <i8*> [#uses=2]
- %tmp1863 = alloca i8, i32 %max1819 ; <i8*> [#uses=3]
- %tmp1870 = icmp ugt i8 %tmp170171, %tmp306307 ; <i1> [#uses=1]
- br i1 %tmp1870, label %cond_next1900, label %bb1875
-
-bb1875: ; preds = %cleanup1773
- store i8 %tmp238239, i8* %tmp1863
- %tmp1884 = icmp eq i8 %tmp306307, %tmp170171 ; <i1> [#uses=1]
- br i1 %tmp1884, label %cond_next1900, label %cond_next1888.preheader
-
-cond_next1888.preheader: ; preds = %bb1875
- %J77b.26000.2 = add i8 %tmp170171, 1 ; <i8> [#uses=1]
- br label %cond_next1888
-
-cond_next1888: ; preds = %cond_next1888, %cond_next1888.preheader
- %indvar6245 = phi i8 [ 0, %cond_next1888.preheader ], [ %indvar.next14, %cond_next1888 ] ; <i8> [#uses=2]
- %tmp1890 = add i8 %J77b.26000.2, %indvar6245 ; <i8> [#uses=2]
- %tmp187618776004 = zext i8 %tmp1890 to i32 ; <i32> [#uses=1]
- %tmp18796005 = sub i32 %tmp187618776004, %tmp17811782 ; <i32> [#uses=1]
- %tmp18806006 = getelementptr i8* %tmp1863, i32 %tmp18796005 ; <i8*> [#uses=1]
- store i8 %tmp238239, i8* %tmp18806006
- %tmp18846008 = icmp eq i8 %tmp306307, %tmp1890 ; <i1> [#uses=1]
- %indvar.next14 = add i8 %indvar6245, 1 ; <i8> [#uses=1]
- br i1 %tmp18846008, label %cond_next1900, label %cond_next1888
-
-unwind1895: ; preds = %cleanup2300, %cleanup2284, %unwind2274, %cond_next2149, %cond_true1946
- %eh_ptr1896 = call i8* @llvm.eh.exception( ) ; <i8*> [#uses=3]
- %eh_select1898 = call i32 (i8*, i8*, ...)* @llvm.eh.selector.i32( i8* %eh_ptr1896, i8* bitcast (i32 (...)* @__gnat_eh_personality to i8*), %struct.exception* @constraint_error, i32* @__gnat_others_value ) ; <i32> [#uses=2]
- %eh_typeid23196018 = call i32 @llvm.eh.typeid.for.i32( i8* getelementptr (%struct.exception* @constraint_error, i32 0, i32 0) ) ; <i32> [#uses=1]
- %tmp23216020 = icmp eq i32 %eh_select1898, %eh_typeid23196018 ; <i1> [#uses=1]
- br i1 %tmp23216020, label %eh_then2322, label %eh_else2340
-
-cond_next1900: ; preds = %cond_next1888, %bb1875, %cleanup1773
- call void @llvm.memcpy.i32( i8* %tmp1821, i8* %tmp1863, i32 %max1819, i32 1 )
- ret void
-
-cond_true1909: ; No predecessors!
- %tmp1912 = icmp ult i8 %tmp170171, %tmp204205 ; <i1> [#uses=1]
- %tmp1916 = icmp ugt i8 %tmp238239, %tmp272273 ; <i1> [#uses=1]
- %tmp1920 = or i1 %tmp1916, %tmp1912 ; <i1> [#uses=0]
- ret void
-
-cond_true1923: ; No predecessors!
- ret void
-
-cond_next1926: ; No predecessors!
- %tmp1929.not = icmp uge i8 %tmp238239, %tmp170171 ; <i1> [#uses=1]
- %tmp1939 = icmp ugt i8 %tmp238239, %tmp306307 ; <i1> [#uses=2]
- %bothcond = and i1 %tmp1939, %tmp1929.not ; <i1> [#uses=0]
- ret void
-
-cond_true1946: ; No predecessors!
- invoke void @__gnat_rcheck_12( i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0), i32 162 )
- to label %UnifiedUnreachableBlock34 unwind label %unwind1895
-
-cond_next2149: ; No predecessors!
- invoke void @system__secondary_stack__ss_mark( %struct.system__secondary_stack__mark_id* %tmp46 sret )
- to label %invcont2150 unwind label %unwind1895
-
-invcont2150: ; preds = %cond_next2149
- %tmp2153 = getelementptr %struct.system__secondary_stack__mark_id* %tmp46, i32 0, i32 0 ; <i8**> [#uses=1]
- %tmp2154 = load i8** %tmp2153 ; <i8*> [#uses=3]
- %tmp2156 = getelementptr %struct.system__secondary_stack__mark_id* %tmp46, i32 0, i32 1 ; <i32*> [#uses=1]
- %tmp2157 = load i32* %tmp2156 ; <i32> [#uses=3]
- %tmp2168 = or i1 %tmp1939, %tmp1401 ; <i1> [#uses=1]
- br i1 %tmp2168, label %cond_true2171, label %cond_next2189
-
-cond_true2171: ; preds = %invcont2150
- invoke void @__gnat_rcheck_05( i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0), i32 165 )
- to label %UnifiedUnreachableBlock34 unwind label %unwind2172
-
-unwind2172: ; preds = %invcont2236, %invcont2219, %bb2205, %bb2203, %cond_true2171
- %eh_ptr2173 = call i8* @llvm.eh.exception( ) ; <i8*> [#uses=5]
- %eh_select2175 = call i32 (i8*, i8*, ...)* @llvm.eh.selector.i32( i8* %eh_ptr2173, i8* bitcast (i32 (...)* @__gnat_eh_personality to i8*), i32* @__gnat_others_value ) ; <i32> [#uses=2]
- %eh_typeid2250 = call i32 @llvm.eh.typeid.for.i32( i8* bitcast (i32* @__gnat_others_value to i8*) ) ; <i32> [#uses=1]
- %tmp2252 = icmp eq i32 %eh_select2175, %eh_typeid2250 ; <i1> [#uses=1]
- br i1 %tmp2252, label %eh_then2253, label %cleanup2284
-
-cond_next2189: ; preds = %invcont2150
- %tmp21902191 = and i32 %tmp218, 255 ; <i32> [#uses=1]
- %tmp2193 = sub i32 %tmp21902191, %tmp17811782 ; <i32> [#uses=1]
- %tmp2194 = getelementptr i8* %tmp1821, i32 %tmp2193 ; <i8*> [#uses=1]
- %tmp2195 = load i8* %tmp2194 ; <i8> [#uses=2]
- %tmp2197 = icmp ugt i8 %tmp2195, 6 ; <i1> [#uses=1]
- br i1 %tmp2197, label %bb2203, label %bb2205
-
-bb2203: ; preds = %cond_next2189
- invoke void @__gnat_rcheck_06( i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0), i32 165 )
- to label %UnifiedUnreachableBlock34 unwind label %unwind2172
-
-bb2205: ; preds = %cond_next2189
- %tmp22132214 = zext i8 %tmp2195 to i32 ; <i32> [#uses=1]
- invoke void @system__img_enum__image_enumeration_8( %struct.string___XUP* %tmp49 sret , i32 %tmp22132214, i64 or (i64 zext (i32 ptrtoint ([28 x i8]* @weekS.154 to i32) to i64), i64 shl (i64 zext (i32 ptrtoint (%struct.string___XUB* @C.32.910 to i32) to i64), i64 32)), i8* getelementptr ([8 x i8]* @weekN.179, i32 0, i32 0) )
- to label %invcont2219 unwind label %unwind2172
-
-invcont2219: ; preds = %bb2205
- %tmp2221 = getelementptr %struct.string___XUP* %tmp49, i32 0, i32 0 ; <i8**> [#uses=1]
- %tmp2222 = load i8** %tmp2221 ; <i8*> [#uses=1]
- %tmp22225781 = ptrtoint i8* %tmp2222 to i32 ; <i32> [#uses=1]
- %tmp222257815782 = zext i32 %tmp22225781 to i64 ; <i64> [#uses=1]
- %tmp2224 = getelementptr %struct.string___XUP* %tmp49, i32 0, i32 1 ; <%struct.string___XUB**> [#uses=1]
- %tmp2225 = load %struct.string___XUB** %tmp2224 ; <%struct.string___XUB*> [#uses=1]
- %tmp22255777 = ptrtoint %struct.string___XUB* %tmp2225 to i32 ; <i32> [#uses=1]
- %tmp222557775778 = zext i32 %tmp22255777 to i64 ; <i64> [#uses=1]
- %tmp2225577757785779 = shl i64 %tmp222557775778, 32 ; <i64> [#uses=1]
- %tmp2225577757785779.ins = or i64 %tmp2225577757785779, %tmp222257815782 ; <i64> [#uses=1]
- invoke void @system__string_ops__str_concat( %struct.string___XUP* %tmp52 sret , i64 or (i64 zext (i32 ptrtoint ([30 x i8]* @.str14 to i32) to i64), i64 shl (i64 zext (i32 ptrtoint (%struct.string___XUB* @C.30.904 to i32) to i64), i64 32)), i64 %tmp2225577757785779.ins )
- to label %invcont2236 unwind label %unwind2172
-
-invcont2236: ; preds = %invcont2219
- %tmp2238 = getelementptr %struct.string___XUP* %tmp52, i32 0, i32 0 ; <i8**> [#uses=1]
- %tmp2239 = load i8** %tmp2238 ; <i8*> [#uses=1]
- %tmp22395769 = ptrtoint i8* %tmp2239 to i32 ; <i32> [#uses=1]
- %tmp223957695770 = zext i32 %tmp22395769 to i64 ; <i64> [#uses=1]
- %tmp2241 = getelementptr %struct.string___XUP* %tmp52, i32 0, i32 1 ; <%struct.string___XUB**> [#uses=1]
- %tmp2242 = load %struct.string___XUB** %tmp2241 ; <%struct.string___XUB*> [#uses=1]
- %tmp22425765 = ptrtoint %struct.string___XUB* %tmp2242 to i32 ; <i32> [#uses=1]
- %tmp224257655766 = zext i32 %tmp22425765 to i64 ; <i64> [#uses=1]
- %tmp2242576557665767 = shl i64 %tmp224257655766, 32 ; <i64> [#uses=1]
- %tmp2242576557665767.ins = or i64 %tmp2242576557665767, %tmp223957695770 ; <i64> [#uses=1]
- invoke void @report__failed( i64 %tmp2242576557665767.ins )
- to label %cleanup2300 unwind label %unwind2172
-
-eh_then2253: ; preds = %unwind2172
- invoke void @__gnat_begin_handler( i8* %eh_ptr2173 )
- to label %invcont2261 unwind label %unwind2257
-
-unwind2257: ; preds = %invcont2263, %invcont2261, %eh_then2253
- %eh_ptr2258 = call i8* @llvm.eh.exception( ) ; <i8*> [#uses=2]
- %eh_select2260 = call i32 (i8*, i8*, ...)* @llvm.eh.selector.i32( i8* %eh_ptr2258, i8* bitcast (i32 (...)* @__gnat_eh_personality to i8*), %struct.exception* @constraint_error, i32* @__gnat_others_value ) ; <i32> [#uses=1]
- invoke void @__gnat_end_handler( i8* %eh_ptr2173 )
- to label %cleanup2284 unwind label %unwind2274
-
-invcont2261: ; preds = %eh_then2253
- %tmp2262 = load void ()** @system__soft_links__abort_undefer ; <void ()*> [#uses=1]
- invoke void %tmp2262( )
- to label %invcont2263 unwind label %unwind2257
-
-invcont2263: ; preds = %invcont2261
- invoke void @report__failed( i64 or (i64 zext (i32 ptrtoint ([28 x i8]* @.str15 to i32) to i64), i64 shl (i64 zext (i32 ptrtoint (%struct.string___XUB* @C.32.910 to i32) to i64), i64 32)) )
- to label %cleanup2272 unwind label %unwind2257
-
-cleanup2272: ; preds = %invcont2263
- invoke void @__gnat_end_handler( i8* %eh_ptr2173 )
- to label %cleanup2300 unwind label %unwind2274
-
-unwind2274: ; preds = %cleanup2272, %unwind2257
- %eh_ptr2275 = call i8* @llvm.eh.exception( ) ; <i8*> [#uses=2]
- %eh_select2277 = call i32 (i8*, i8*, ...)* @llvm.eh.selector.i32( i8* %eh_ptr2275, i8* bitcast (i32 (...)* @__gnat_eh_personality to i8*), %struct.exception* @constraint_error, i32* @__gnat_others_value ) ; <i32> [#uses=1]
- %tmp229055456023 = ptrtoint i8* %tmp2154 to i32 ; <i32> [#uses=1]
- %tmp2290554555466024 = zext i32 %tmp229055456023 to i64 ; <i64> [#uses=1]
- %tmp229355426025 = zext i32 %tmp2157 to i64 ; <i64> [#uses=1]
- %tmp2293554255436026 = shl i64 %tmp229355426025, 32 ; <i64> [#uses=1]
- %tmp229355425543.ins6027 = or i64 %tmp2293554255436026, %tmp2290554555466024 ; <i64> [#uses=1]
- invoke void @system__secondary_stack__ss_release( i64 %tmp229355425543.ins6027 )
- to label %cleanup2318 unwind label %unwind1895
-
-cleanup2284: ; preds = %unwind2257, %unwind2172
- %eh_selector.24 = phi i32 [ %eh_select2175, %unwind2172 ], [ %eh_select2260, %unwind2257 ] ; <i32> [#uses=1]
- %eh_exception.26 = phi i8* [ %eh_ptr2173, %unwind2172 ], [ %eh_ptr2258, %unwind2257 ] ; <i8*> [#uses=1]
- %tmp22905545 = ptrtoint i8* %tmp2154 to i32 ; <i32> [#uses=1]
- %tmp229055455546 = zext i32 %tmp22905545 to i64 ; <i64> [#uses=1]
- %tmp22935542 = zext i32 %tmp2157 to i64 ; <i64> [#uses=1]
- %tmp229355425543 = shl i64 %tmp22935542, 32 ; <i64> [#uses=1]
- %tmp229355425543.ins = or i64 %tmp229355425543, %tmp229055455546 ; <i64> [#uses=1]
- invoke void @system__secondary_stack__ss_release( i64 %tmp229355425543.ins )
- to label %cleanup2318 unwind label %unwind1895
-
-cleanup2300: ; preds = %cleanup2272, %invcont2236
- %tmp23075539 = ptrtoint i8* %tmp2154 to i32 ; <i32> [#uses=1]
- %tmp230755395540 = zext i32 %tmp23075539 to i64 ; <i64> [#uses=1]
- %tmp23105536 = zext i32 %tmp2157 to i64 ; <i64> [#uses=1]
- %tmp231055365537 = shl i64 %tmp23105536, 32 ; <i64> [#uses=1]
- %tmp231055365537.ins = or i64 %tmp231055365537, %tmp230755395540 ; <i64> [#uses=1]
- invoke void @system__secondary_stack__ss_release( i64 %tmp231055365537.ins )
- to label %cleanup2371 unwind label %unwind1895
-
-cleanup2318: ; preds = %cleanup2284, %unwind2274
- %eh_selector.246021.1 = phi i32 [ %eh_select2277, %unwind2274 ], [ %eh_selector.24, %cleanup2284 ] ; <i32> [#uses=2]
- %eh_exception.266022.1 = phi i8* [ %eh_ptr2275, %unwind2274 ], [ %eh_exception.26, %cleanup2284 ] ; <i8*> [#uses=2]
- %eh_typeid2319 = call i32 @llvm.eh.typeid.for.i32( i8* getelementptr (%struct.exception* @constraint_error, i32 0, i32 0) ) ; <i32> [#uses=1]
- %tmp2321 = icmp eq i32 %eh_selector.246021.1, %eh_typeid2319 ; <i1> [#uses=1]
- br i1 %tmp2321, label %eh_then2322, label %eh_else2340
-
-eh_then2322: ; preds = %cleanup2318, %unwind1895
- %eh_exception.216011.0 = phi i8* [ %eh_ptr1896, %unwind1895 ], [ %eh_exception.266022.1, %cleanup2318 ] ; <i8*> [#uses=3]
- invoke void @__gnat_begin_handler( i8* %eh_exception.216011.0 )
- to label %invcont2328 unwind label %unwind2326
-
-unwind2326: ; preds = %invcont2328, %eh_then2322
- %eh_ptr2327 = call i8* @llvm.eh.exception( ) ; <i8*> [#uses=1]
- invoke void @__gnat_end_handler( i8* %eh_exception.216011.0 )
- to label %cleanup2369 unwind label %unwind2334
-
-invcont2328: ; preds = %eh_then2322
- %tmp2329 = load void ()** @system__soft_links__abort_undefer ; <void ()*> [#uses=1]
- invoke void %tmp2329( )
- to label %cleanup2332 unwind label %unwind2326
-
-cleanup2332: ; preds = %invcont2328
- invoke void @__gnat_end_handler( i8* %eh_exception.216011.0 )
- to label %cleanup2371 unwind label %unwind2334
-
-unwind2334: ; preds = %cleanup2361, %unwind2348, %cleanup2332, %unwind2326
- %eh_ptr2335 = call i8* @llvm.eh.exception( ) ; <i8*> [#uses=1]
- call void @llvm.stackrestore( i8* %tmp1780 )
- call void @llvm.stackrestore( i8* %tmp1780 )
- call i32 (...)* @_Unwind_Resume( i8* %eh_ptr2335 ) ; <i32>:8 [#uses=0]
- unreachable
-
-eh_else2340: ; preds = %cleanup2318, %unwind1895
- %eh_selector.196009.1 = phi i32 [ %eh_select1898, %unwind1895 ], [ %eh_selector.246021.1, %cleanup2318 ] ; <i32> [#uses=1]
- %eh_exception.216011.1 = phi i8* [ %eh_ptr1896, %unwind1895 ], [ %eh_exception.266022.1, %cleanup2318 ] ; <i8*> [#uses=4]
- %eh_typeid2341 = call i32 @llvm.eh.typeid.for.i32( i8* bitcast (i32* @__gnat_others_value to i8*) ) ; <i32> [#uses=1]
- %tmp2343 = icmp eq i32 %eh_selector.196009.1, %eh_typeid2341 ; <i1> [#uses=1]
- br i1 %tmp2343, label %eh_then2344, label %cleanup2369
-
-eh_then2344: ; preds = %eh_else2340
- invoke void @__gnat_begin_handler( i8* %eh_exception.216011.1 )
- to label %invcont2350 unwind label %unwind2348
-
-unwind2348: ; preds = %invcont2352, %invcont2350, %eh_then2344
- %eh_ptr2349 = call i8* @llvm.eh.exception( ) ; <i8*> [#uses=1]
- invoke void @__gnat_end_handler( i8* %eh_exception.216011.1 )
- to label %cleanup2369 unwind label %unwind2334
-
-invcont2350: ; preds = %eh_then2344
- %tmp2351 = load void ()** @system__soft_links__abort_undefer ; <void ()*> [#uses=1]
- invoke void %tmp2351( )
- to label %invcont2352 unwind label %unwind2348
-
-invcont2352: ; preds = %invcont2350
- invoke void @report__failed( i64 or (i64 zext (i32 ptrtoint ([24 x i8]* @.str16 to i32) to i64), i64 shl (i64 zext (i32 ptrtoint (%struct.string___XUB* @C.35.915 to i32) to i64), i64 32)) )
- to label %cleanup2361 unwind label %unwind2348
-
-cleanup2361: ; preds = %invcont2352
- invoke void @__gnat_end_handler( i8* %eh_exception.216011.1 )
- to label %cleanup2371 unwind label %unwind2334
-
-cleanup2369: ; preds = %unwind2348, %eh_else2340, %unwind2326
- %eh_exception.28 = phi i8* [ %eh_ptr2327, %unwind2326 ], [ %eh_exception.216011.1, %eh_else2340 ], [ %eh_ptr2349, %unwind2348 ] ; <i8*> [#uses=1]
- call void @llvm.stackrestore( i8* %tmp1780 )
- call void @llvm.stackrestore( i8* %tmp1780 )
- call i32 (...)* @_Unwind_Resume( i8* %eh_exception.28 ) ; <i32>:9 [#uses=0]
- unreachable
-
-cleanup2371: ; preds = %cleanup2361, %cleanup2332, %cleanup2300
- call void @llvm.stackrestore( i8* %tmp1780 )
- call void @llvm.stackrestore( i8* %tmp1780 )
- invoke void @system__secondary_stack__ss_mark( %struct.system__secondary_stack__mark_id* %tmp55 sret )
- to label %invcont2382 unwind label %unwind2378
-
-unwind2378: ; preds = %cleanup2371
- %eh_ptr2379 = call i8* @llvm.eh.exception( ) ; <i8*> [#uses=3]
- %eh_select2381 = call i32 (i8*, i8*, ...)* @llvm.eh.selector.i32( i8* %eh_ptr2379, i8* bitcast (i32 (...)* @__gnat_eh_personality to i8*), %struct.exception* @constraint_error, i32* @__gnat_others_value ) ; <i32> [#uses=2]
- %eh_typeid26496037 = call i32 @llvm.eh.typeid.for.i32( i8* getelementptr (%struct.exception* @constraint_error, i32 0, i32 0) ) ; <i32> [#uses=1]
- %tmp26516039 = icmp eq i32 %eh_select2381, %eh_typeid26496037 ; <i1> [#uses=1]
- br i1 %tmp26516039, label %eh_then2652, label %eh_else2666
-
-invcont2382: ; preds = %cleanup2371
- %tmp2385 = getelementptr %struct.system__secondary_stack__mark_id* %tmp55, i32 0, i32 0 ; <i8**> [#uses=1]
- %tmp2386 = load i8** %tmp2385 ; <i8*> [#uses=2]
- %tmp2388 = getelementptr %struct.system__secondary_stack__mark_id* %tmp55, i32 0, i32 1 ; <i32*> [#uses=1]
- %tmp2389 = load i32* %tmp2388 ; <i32> [#uses=2]
- %tmp2390 = call i8* @llvm.stacksave( ) ; <i8*> [#uses=3]
- %tmp2393 = icmp ult i8 %tmp306307, %tmp170171 ; <i1> [#uses=1]
- br i1 %tmp2393, label %cond_next2417, label %cond_true2396
-
-cond_true2396: ; preds = %invcont2382
- %tmp2399 = icmp ult i8 %tmp170171, %tmp204205 ; <i1> [#uses=1]
- %tmp2403 = icmp ugt i8 %tmp306307, %tmp272273 ; <i1> [#uses=1]
- %tmp2407 = or i1 %tmp2403, %tmp2399 ; <i1> [#uses=1]
- br i1 %tmp2407, label %cond_true2410, label %cond_next2417
-
-cond_true2410: ; preds = %cond_true2396
- invoke void @__gnat_rcheck_12( i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0), i32 177 )
- to label %UnifiedUnreachableBlock34 unwind label %unwind2411
-
-unwind2411: ; preds = %invcont2591, %invcont2574, %bb2560, %bb2558, %bb2524, %bb2506, %cond_true2410
- %eh_ptr2412 = call i8* @llvm.eh.exception( ) ; <i8*> [#uses=3]
- %eh_select2414 = call i32 (i8*, i8*, ...)* @llvm.eh.selector.i32( i8* %eh_ptr2412, i8* bitcast (i32 (...)* @__gnat_eh_personality to i8*), %struct.exception* @constraint_error, i32* @__gnat_others_value ) ; <i32> [#uses=2]
- %tmp26315527 = ptrtoint i8* %tmp2386 to i32 ; <i32> [#uses=1]
- %tmp263155275528 = zext i32 %tmp26315527 to i64 ; <i64> [#uses=1]
- %tmp26345524 = zext i32 %tmp2389 to i64 ; <i64> [#uses=1]
- %tmp263455245525 = shl i64 %tmp26345524, 32 ; <i64> [#uses=1]
- %tmp263455245525.ins = or i64 %tmp263455245525, %tmp263155275528 ; <i64> [#uses=1]
- invoke void @system__secondary_stack__ss_release( i64 %tmp263455245525.ins )
- to label %cleanup2644 unwind label %unwind2618
-
-cond_next2417: ; preds = %cond_true2396, %invcont2382
- %tmp2493 = icmp ugt i8 %tmp170171, %tmp238239 ; <i1> [#uses=1]
- %tmp2500 = icmp ugt i8 %tmp238239, %tmp306307 ; <i1> [#uses=1]
- %bothcond5903 = or i1 %tmp2500, %tmp2493 ; <i1> [#uses=1]
- br i1 %bothcond5903, label %bb2506, label %cond_next2515
-
-bb2506: ; preds = %cond_next2417
- invoke void @__gnat_rcheck_05( i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0), i32 180 )
- to label %UnifiedUnreachableBlock34 unwind label %unwind2411
-
-cond_next2515: ; preds = %cond_next2417
- br i1 %tmp240, label %bb2524, label %bb2526
-
-bb2524: ; preds = %cond_next2515
- invoke void @__gnat_rcheck_06( i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0), i32 180 )
- to label %UnifiedUnreachableBlock34 unwind label %unwind2411
-
-bb2526: ; preds = %cond_next2515
- br i1 %tmp274, label %bb2558, label %bb2560
-
-bb2558: ; preds = %bb2526
- invoke void @__gnat_rcheck_06( i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0), i32 182 )
- to label %UnifiedUnreachableBlock34 unwind label %unwind2411
-
-bb2560: ; preds = %bb2526
- invoke void @system__img_enum__image_enumeration_8( %struct.string___XUP* %tmp58 sret , i32 %tmp13831384, i64 or (i64 zext (i32 ptrtoint ([28 x i8]* @weekS.154 to i32) to i64), i64 shl (i64 zext (i32 ptrtoint (%struct.string___XUB* @C.32.910 to i32) to i64), i64 32)), i8* getelementptr ([8 x i8]* @weekN.179, i32 0, i32 0) )
- to label %invcont2574 unwind label %unwind2411
-
-invcont2574: ; preds = %bb2560
- %tmp2576 = getelementptr %struct.string___XUP* %tmp58, i32 0, i32 0 ; <i8**> [#uses=1]
- %tmp2577 = load i8** %tmp2576 ; <i8*> [#uses=1]
- %tmp25775747 = ptrtoint i8* %tmp2577 to i32 ; <i32> [#uses=1]
- %tmp257757475748 = zext i32 %tmp25775747 to i64 ; <i64> [#uses=1]
- %tmp2579 = getelementptr %struct.string___XUP* %tmp58, i32 0, i32 1 ; <%struct.string___XUB**> [#uses=1]
- %tmp2580 = load %struct.string___XUB** %tmp2579 ; <%struct.string___XUB*> [#uses=1]
- %tmp25805743 = ptrtoint %struct.string___XUB* %tmp2580 to i32 ; <i32> [#uses=1]
- %tmp258057435744 = zext i32 %tmp25805743 to i64 ; <i64> [#uses=1]
- %tmp2580574357445745 = shl i64 %tmp258057435744, 32 ; <i64> [#uses=1]
- %tmp2580574357445745.ins = or i64 %tmp2580574357445745, %tmp257757475748 ; <i64> [#uses=1]
- invoke void @system__string_ops__str_concat( %struct.string___XUP* %tmp61 sret , i64 or (i64 zext (i32 ptrtoint ([30 x i8]* @.str17 to i32) to i64), i64 shl (i64 zext (i32 ptrtoint (%struct.string___XUB* @C.30.904 to i32) to i64), i64 32)), i64 %tmp2580574357445745.ins )
- to label %invcont2591 unwind label %unwind2411
-
-invcont2591: ; preds = %invcont2574
- %tmp2593 = getelementptr %struct.string___XUP* %tmp61, i32 0, i32 0 ; <i8**> [#uses=1]
- %tmp2594 = load i8** %tmp2593 ; <i8*> [#uses=1]
- %tmp25945735 = ptrtoint i8* %tmp2594 to i32 ; <i32> [#uses=1]
- %tmp259457355736 = zext i32 %tmp25945735 to i64 ; <i64> [#uses=1]
- %tmp2596 = getelementptr %struct.string___XUP* %tmp61, i32 0, i32 1 ; <%struct.string___XUB**> [#uses=1]
- %tmp2597 = load %struct.string___XUB** %tmp2596 ; <%struct.string___XUB*> [#uses=1]
- %tmp25975731 = ptrtoint %struct.string___XUB* %tmp2597 to i32 ; <i32> [#uses=1]
- %tmp259757315732 = zext i32 %tmp25975731 to i64 ; <i64> [#uses=1]
- %tmp2597573157325733 = shl i64 %tmp259757315732, 32 ; <i64> [#uses=1]
- %tmp2597573157325733.ins = or i64 %tmp2597573157325733, %tmp259457355736 ; <i64> [#uses=1]
- invoke void @report__failed( i64 %tmp2597573157325733.ins )
- to label %cleanup2604 unwind label %unwind2411
-
-cleanup2604: ; preds = %invcont2591
- %tmp26105533 = ptrtoint i8* %tmp2386 to i32 ; <i32> [#uses=1]
- %tmp261055335534 = zext i32 %tmp26105533 to i64 ; <i64> [#uses=1]
- %tmp26135530 = zext i32 %tmp2389 to i64 ; <i64> [#uses=1]
- %tmp261355305531 = shl i64 %tmp26135530, 32 ; <i64> [#uses=1]
- %tmp261355305531.ins = or i64 %tmp261355305531, %tmp261055335534 ; <i64> [#uses=1]
- invoke void @system__secondary_stack__ss_release( i64 %tmp261355305531.ins )
- to label %cleanup2642 unwind label %unwind2618
-
-unwind2618: ; preds = %cleanup2604, %unwind2411
- %eh_ptr2619 = call i8* @llvm.eh.exception( ) ; <i8*> [#uses=3]
- %eh_select2621 = call i32 (i8*, i8*, ...)* @llvm.eh.selector.i32( i8* %eh_ptr2619, i8* bitcast (i32 (...)* @__gnat_eh_personality to i8*), %struct.exception* @constraint_error, i32* @__gnat_others_value ) ; <i32> [#uses=2]
- call void @llvm.stackrestore( i8* %tmp2390 )
- %eh_typeid26493 = call i32 @llvm.eh.typeid.for.i32( i8* getelementptr (%struct.exception* @constraint_error, i32 0, i32 0) ) ; <i32> [#uses=1]
- %tmp26514 = icmp eq i32 %eh_select2621, %eh_typeid26493 ; <i1> [#uses=1]
- br i1 %tmp26514, label %eh_then2652, label %eh_else2666
-
-cleanup2642: ; preds = %cleanup2604
- call void @llvm.stackrestore( i8* %tmp2390 )
- %tmp26946042 = icmp ult i8 %tmp238239, %tmp137138 ; <i1> [#uses=1]
- br i1 %tmp26946042, label %cond_next2718, label %cond_true2697
-
-cleanup2644: ; preds = %unwind2411
- call void @llvm.stackrestore( i8* %tmp2390 )
- %eh_typeid2649 = call i32 @llvm.eh.typeid.for.i32( i8* getelementptr (%struct.exception* @constraint_error, i32 0, i32 0) ) ; <i32> [#uses=1]
- %tmp2651 = icmp eq i32 %eh_select2414, %eh_typeid2649 ; <i1> [#uses=1]
- br i1 %tmp2651, label %eh_then2652, label %eh_else2666
-
-eh_then2652: ; preds = %cleanup2644, %unwind2618, %unwind2378
- %eh_exception.296030.0 = phi i8* [ %eh_ptr2379, %unwind2378 ], [ %eh_ptr2619, %unwind2618 ], [ %eh_ptr2412, %cleanup2644 ] ; <i8*> [#uses=3]
- invoke void @__gnat_begin_handler( i8* %eh_exception.296030.0 )
- to label %invcont2658 unwind label %unwind2656
-
-unwind2656: ; preds = %invcont2658, %eh_then2652
- %eh_ptr2657 = call i8* @llvm.eh.exception( ) ; <i8*> [#uses=1]
- call void @__gnat_end_handler( i8* %eh_exception.296030.0 )
- call i32 (...)* @_Unwind_Resume( i8* %eh_ptr2657 ) ; <i32>:10 [#uses=0]
- unreachable
-
-invcont2658: ; preds = %eh_then2652
- %tmp2659 = load void ()** @system__soft_links__abort_undefer ; <void ()*> [#uses=1]
- invoke void %tmp2659( )
- to label %cleanup2662 unwind label %unwind2656
-
-cleanup2662: ; preds = %invcont2658
- call void @__gnat_end_handler( i8* %eh_exception.296030.0 )
- %tmp26946043 = icmp ult i8 %tmp238239, %tmp137138 ; <i1> [#uses=1]
- br i1 %tmp26946043, label %cond_next2718, label %cond_true2697
-
-eh_else2666: ; preds = %cleanup2644, %unwind2618, %unwind2378
- %eh_selector.256028.1 = phi i32 [ %eh_select2381, %unwind2378 ], [ %eh_select2621, %unwind2618 ], [ %eh_select2414, %cleanup2644 ] ; <i32> [#uses=1]
- %eh_exception.296030.1 = phi i8* [ %eh_ptr2379, %unwind2378 ], [ %eh_ptr2619, %unwind2618 ], [ %eh_ptr2412, %cleanup2644 ] ; <i8*> [#uses=4]
- %eh_typeid2667 = call i32 @llvm.eh.typeid.for.i32( i8* bitcast (i32* @__gnat_others_value to i8*) ) ; <i32> [#uses=1]
- %tmp2669 = icmp eq i32 %eh_selector.256028.1, %eh_typeid2667 ; <i1> [#uses=1]
- br i1 %tmp2669, label %eh_then2670, label %Unwind
-
-eh_then2670: ; preds = %eh_else2666
- invoke void @__gnat_begin_handler( i8* %eh_exception.296030.1 )
- to label %invcont2676 unwind label %unwind2674
-
-unwind2674: ; preds = %invcont2678, %invcont2676, %eh_then2670
- %eh_ptr2675 = call i8* @llvm.eh.exception( ) ; <i8*> [#uses=1]
- call void @__gnat_end_handler( i8* %eh_exception.296030.1 )
- call i32 (...)* @_Unwind_Resume( i8* %eh_ptr2675 ) ; <i32>:11 [#uses=0]
- unreachable
-
-invcont2676: ; preds = %eh_then2670
- %tmp2677 = load void ()** @system__soft_links__abort_undefer ; <void ()*> [#uses=1]
- invoke void %tmp2677( )
- to label %invcont2678 unwind label %unwind2674
-
-invcont2678: ; preds = %invcont2676
- invoke void @report__failed( i64 or (i64 zext (i32 ptrtoint ([24 x i8]* @.str18 to i32) to i64), i64 shl (i64 zext (i32 ptrtoint (%struct.string___XUB* @C.35.915 to i32) to i64), i64 32)) )
- to label %cleanup2687 unwind label %unwind2674
-
-cleanup2687: ; preds = %invcont2678
- call void @__gnat_end_handler( i8* %eh_exception.296030.1 )
- %tmp2694 = icmp ult i8 %tmp238239, %tmp137138 ; <i1> [#uses=1]
- br i1 %tmp2694, label %cond_next2718, label %cond_true2697
-
-cond_true2697: ; preds = %cleanup2687, %cleanup2662, %cleanup2642
- %tmp2700 = icmp ult i8 %tmp137138, %tmp204205 ; <i1> [#uses=1]
- %tmp2704 = icmp ugt i8 %tmp238239, %tmp272273 ; <i1> [#uses=1]
- %tmp2708 = or i1 %tmp2704, %tmp2700 ; <i1> [#uses=1]
- br i1 %tmp2708, label %cond_true2711, label %cond_next2718
-
-cond_true2711: ; preds = %cond_true2697
- invoke void @__gnat_rcheck_12( i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0), i32 192 )
- to label %UnifiedUnreachableBlock34 unwind label %unwind2712
-
-unwind2712: ; preds = %cleanup2990, %unwind2975, %cond_true2711
- %eh_ptr2713 = call i8* @llvm.eh.exception( ) ; <i8*> [#uses=3]
- %eh_select2715 = call i32 (i8*, i8*, ...)* @llvm.eh.selector.i32( i8* %eh_ptr2713, i8* bitcast (i32 (...)* @__gnat_eh_personality to i8*), %struct.exception* @constraint_error, i32* @__gnat_others_value ) ; <i32> [#uses=2]
- %eh_typeid29996053 = call i32 @llvm.eh.typeid.for.i32( i8* getelementptr (%struct.exception* @constraint_error, i32 0, i32 0) ) ; <i32> [#uses=1]
- %tmp30016055 = icmp eq i32 %eh_select2715, %eh_typeid29996053 ; <i1> [#uses=1]
- br i1 %tmp30016055, label %eh_then3002, label %eh_else3016
-
-cond_next2718: ; preds = %cond_true2697, %cleanup2687, %cleanup2662, %cleanup2642
- invoke void @system__secondary_stack__ss_mark( %struct.system__secondary_stack__mark_id* %tmp63 sret )
- to label %invcont2766 unwind label %unwind2762
-
-unwind2762: ; preds = %cond_next2718
- %eh_ptr2763 = call i8* @llvm.eh.exception( ) ; <i8*> [#uses=3]
- %eh_select2765 = call i32 (i8*, i8*, ...)* @llvm.eh.selector.i32( i8* %eh_ptr2763, i8* bitcast (i32 (...)* @__gnat_eh_personality to i8*), i32* @__gnat_others_value ) ; <i32> [#uses=2]
- %eh_typeid29686060 = call i32 @llvm.eh.typeid.for.i32( i8* bitcast (i32* @__gnat_others_value to i8*) ) ; <i32> [#uses=1]
- %tmp29706061 = icmp eq i32 %eh_select2765, %eh_typeid29686060 ; <i1> [#uses=1]
- br i1 %tmp29706061, label %eh_then2971, label %cleanup2998
-
-invcont2766: ; preds = %cond_next2718
- %tmp2769 = getelementptr %struct.system__secondary_stack__mark_id* %tmp63, i32 0, i32 0 ; <i8**> [#uses=1]
- %tmp2770 = load i8** %tmp2769 ; <i8*> [#uses=2]
- %tmp2772 = getelementptr %struct.system__secondary_stack__mark_id* %tmp63, i32 0, i32 1 ; <i32*> [#uses=1]
- %tmp2773 = load i32* %tmp2772 ; <i32> [#uses=2]
- %tmp2774 = call i8* @llvm.stacksave( ) ; <i8*> [#uses=3]
- %tmp2808 = icmp ugt i8 %tmp137138, %tmp204205 ; <i1> [#uses=1]
- %tmp2815 = icmp ult i8 %tmp238239, %tmp204205 ; <i1> [#uses=1]
- %bothcond5904 = or i1 %tmp2815, %tmp2808 ; <i1> [#uses=1]
- br i1 %bothcond5904, label %bb2821, label %cond_next2834
-
-bb2821: ; preds = %invcont2766
- invoke void @__gnat_rcheck_05( i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0), i32 198 )
- to label %UnifiedUnreachableBlock34 unwind label %unwind2822
-
-unwind2822: ; preds = %invcont2910, %invcont2893, %bb2879, %bb2877, %bb2843, %bb2821
- %eh_ptr2823 = call i8* @llvm.eh.exception( ) ; <i8*> [#uses=3]
- %eh_select2825 = call i32 (i8*, i8*, ...)* @llvm.eh.selector.i32( i8* %eh_ptr2823, i8* bitcast (i32 (...)* @__gnat_eh_personality to i8*), i32* @__gnat_others_value ) ; <i32> [#uses=2]
- %tmp29295521 = ptrtoint i8* %tmp2770 to i32 ; <i32> [#uses=1]
- %tmp292955215522 = zext i32 %tmp29295521 to i64 ; <i64> [#uses=1]
- %tmp29325518 = zext i32 %tmp2773 to i64 ; <i64> [#uses=1]
- %tmp293255185519 = shl i64 %tmp29325518, 32 ; <i64> [#uses=1]
- %tmp293255185519.ins = or i64 %tmp293255185519, %tmp292955215522 ; <i64> [#uses=1]
- invoke void @system__secondary_stack__ss_release( i64 %tmp293255185519.ins )
- to label %cleanup2963 unwind label %unwind2937
-
-cond_next2834: ; preds = %invcont2766
- br i1 %tmp206, label %bb2843, label %bb2845
-
-bb2843: ; preds = %cond_next2834
- invoke void @__gnat_rcheck_06( i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0), i32 198 )
- to label %UnifiedUnreachableBlock34 unwind label %unwind2822
-
-bb2845: ; preds = %cond_next2834
- br i1 %tmp274, label %bb2877, label %bb2879
-
-bb2877: ; preds = %bb2845
- invoke void @__gnat_rcheck_06( i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0), i32 200 )
- to label %UnifiedUnreachableBlock34 unwind label %unwind2822
-
-bb2879: ; preds = %bb2845
- invoke void @system__img_enum__image_enumeration_8( %struct.string___XUP* %tmp66 sret , i32 %tmp13831384, i64 or (i64 zext (i32 ptrtoint ([28 x i8]* @weekS.154 to i32) to i64), i64 shl (i64 zext (i32 ptrtoint (%struct.string___XUB* @C.32.910 to i32) to i64), i64 32)), i8* getelementptr ([8 x i8]* @weekN.179, i32 0, i32 0) )
- to label %invcont2893 unwind label %unwind2822
-
-invcont2893: ; preds = %bb2879
- %tmp2895 = getelementptr %struct.string___XUP* %tmp66, i32 0, i32 0 ; <i8**> [#uses=1]
- %tmp2896 = load i8** %tmp2895 ; <i8*> [#uses=1]
- %tmp28965718 = ptrtoint i8* %tmp2896 to i32 ; <i32> [#uses=1]
- %tmp289657185719 = zext i32 %tmp28965718 to i64 ; <i64> [#uses=1]
- %tmp2898 = getelementptr %struct.string___XUP* %tmp66, i32 0, i32 1 ; <%struct.string___XUB**> [#uses=1]
- %tmp2899 = load %struct.string___XUB** %tmp2898 ; <%struct.string___XUB*> [#uses=1]
- %tmp28995714 = ptrtoint %struct.string___XUB* %tmp2899 to i32 ; <i32> [#uses=1]
- %tmp289957145715 = zext i32 %tmp28995714 to i64 ; <i64> [#uses=1]
- %tmp2899571457155716 = shl i64 %tmp289957145715, 32 ; <i64> [#uses=1]
- %tmp2899571457155716.ins = or i64 %tmp2899571457155716, %tmp289657185719 ; <i64> [#uses=1]
- invoke void @system__string_ops__str_concat( %struct.string___XUP* %tmp69 sret , i64 or (i64 zext (i32 ptrtoint ([31 x i8]* @.str19 to i32) to i64), i64 shl (i64 zext (i32 ptrtoint (%struct.string___XUB* @C.98.1466 to i32) to i64), i64 32)), i64 %tmp2899571457155716.ins )
- to label %invcont2910 unwind label %unwind2822
-
-invcont2910: ; preds = %invcont2893
- %tmp2912 = getelementptr %struct.string___XUP* %tmp69, i32 0, i32 0 ; <i8**> [#uses=1]
- %tmp2913 = load i8** %tmp2912 ; <i8*> [#uses=1]
- %tmp29135706 = ptrtoint i8* %tmp2913 to i32 ; <i32> [#uses=1]
- %tmp291357065707 = zext i32 %tmp29135706 to i64 ; <i64> [#uses=1]
- %tmp2915 = getelementptr %struct.string___XUP* %tmp69, i32 0, i32 1 ; <%struct.string___XUB**> [#uses=1]
- %tmp2916 = load %struct.string___XUB** %tmp2915 ; <%struct.string___XUB*> [#uses=1]
- %tmp29165702 = ptrtoint %struct.string___XUB* %tmp2916 to i32 ; <i32> [#uses=1]
- %tmp291657025703 = zext i32 %tmp29165702 to i64 ; <i64> [#uses=1]
- %tmp2916570257035704 = shl i64 %tmp291657025703, 32 ; <i64> [#uses=1]
- %tmp2916570257035704.ins = or i64 %tmp2916570257035704, %tmp291357065707 ; <i64> [#uses=1]
- invoke void @report__failed( i64 %tmp2916570257035704.ins )
- to label %cleanup2943 unwind label %unwind2822
-
-unwind2937: ; preds = %cleanup2943, %unwind2822
- %eh_ptr2938 = call i8* @llvm.eh.exception( ) ; <i8*> [#uses=3]
- %eh_select2940 = call i32 (i8*, i8*, ...)* @llvm.eh.selector.i32( i8* %eh_ptr2938, i8* bitcast (i32 (...)* @__gnat_eh_personality to i8*), i32* @__gnat_others_value ) ; <i32> [#uses=2]
- call void @llvm.stackrestore( i8* %tmp2774 )
- %eh_typeid29685 = call i32 @llvm.eh.typeid.for.i32( i8* bitcast (i32* @__gnat_others_value to i8*) ) ; <i32> [#uses=1]
- %tmp29706 = icmp eq i32 %eh_select2940, %eh_typeid29685 ; <i1> [#uses=1]
- br i1 %tmp29706, label %eh_then2971, label %cleanup2998
-
-cleanup2943: ; preds = %invcont2910
- %tmp29505515 = ptrtoint i8* %tmp2770 to i32 ; <i32> [#uses=1]
- %tmp295055155516 = zext i32 %tmp29505515 to i64 ; <i64> [#uses=1]
- %tmp29535512 = zext i32 %tmp2773 to i64 ; <i64> [#uses=1]
- %tmp295355125513 = shl i64 %tmp29535512, 32 ; <i64> [#uses=1]
- %tmp295355125513.ins = or i64 %tmp295355125513, %tmp295055155516 ; <i64> [#uses=1]
- invoke void @system__secondary_stack__ss_release( i64 %tmp295355125513.ins )
- to label %cleanup2961 unwind label %unwind2937
-
-cleanup2961: ; preds = %cleanup2943
- call void @llvm.stackrestore( i8* %tmp2774 )
- %tmp3044.not6066 = icmp uge i8 %tmp272273, %tmp170171 ; <i1> [#uses=1]
- %tmp30506067 = icmp ult i8 %tmp170171, %tmp204205 ; <i1> [#uses=1]
- %bothcond59056068 = and i1 %tmp3044.not6066, %tmp30506067 ; <i1> [#uses=1]
- br i1 %bothcond59056068, label %cond_true3061, label %cond_next3068
-
-cleanup2963: ; preds = %unwind2822
- call void @llvm.stackrestore( i8* %tmp2774 )
- %eh_typeid2968 = call i32 @llvm.eh.typeid.for.i32( i8* bitcast (i32* @__gnat_others_value to i8*) ) ; <i32> [#uses=1]
- %tmp2970 = icmp eq i32 %eh_select2825, %eh_typeid2968 ; <i1> [#uses=1]
- br i1 %tmp2970, label %eh_then2971, label %cleanup2998
-
-eh_then2971: ; preds = %cleanup2963, %unwind2937, %unwind2762
- %eh_exception.356056.0 = phi i8* [ %eh_ptr2763, %unwind2762 ], [ %eh_ptr2938, %unwind2937 ], [ %eh_ptr2823, %cleanup2963 ] ; <i8*> [#uses=3]
- invoke void @__gnat_begin_handler( i8* %eh_exception.356056.0 )
- to label %invcont2979 unwind label %unwind2975
-
-unwind2975: ; preds = %invcont2981, %invcont2979, %eh_then2971
- %eh_ptr2976 = call i8* @llvm.eh.exception( ) ; <i8*> [#uses=2]
- %eh_select2978 = call i32 (i8*, i8*, ...)* @llvm.eh.selector.i32( i8* %eh_ptr2976, i8* bitcast (i32 (...)* @__gnat_eh_personality to i8*), %struct.exception* @constraint_error, i32* @__gnat_others_value ) ; <i32> [#uses=1]
- invoke void @__gnat_end_handler( i8* %eh_exception.356056.0 )
- to label %cleanup2998 unwind label %unwind2712
-
-invcont2979: ; preds = %eh_then2971
- %tmp2980 = load void ()** @system__soft_links__abort_undefer ; <void ()*> [#uses=1]
- invoke void %tmp2980( )
- to label %invcont2981 unwind label %unwind2975
-
-invcont2981: ; preds = %invcont2979
- invoke void @report__failed( i64 or (i64 zext (i32 ptrtoint ([46 x i8]* @.str20 to i32) to i64), i64 shl (i64 zext (i32 ptrtoint (%struct.string___XUB* @C.101.1473 to i32) to i64), i64 32)) )
- to label %cleanup2990 unwind label %unwind2975
-
-cleanup2990: ; preds = %invcont2981
- invoke void @__gnat_end_handler( i8* %eh_exception.356056.0 )
- to label %finally2997 unwind label %unwind2712
-
-cleanup2998: ; preds = %unwind2975, %cleanup2963, %unwind2937, %unwind2762
- %eh_selector.29 = phi i32 [ %eh_select2765, %unwind2762 ], [ %eh_select2940, %unwind2937 ], [ %eh_select2825, %cleanup2963 ], [ %eh_select2978, %unwind2975 ] ; <i32> [#uses=2]
- %eh_exception.33 = phi i8* [ %eh_ptr2763, %unwind2762 ], [ %eh_ptr2938, %unwind2937 ], [ %eh_ptr2823, %cleanup2963 ], [ %eh_ptr2976, %unwind2975 ] ; <i8*> [#uses=2]
- %eh_typeid2999 = call i32 @llvm.eh.typeid.for.i32( i8* getelementptr (%struct.exception* @constraint_error, i32 0, i32 0) ) ; <i32> [#uses=1]
- %tmp3001 = icmp eq i32 %eh_selector.29, %eh_typeid2999 ; <i1> [#uses=1]
- br i1 %tmp3001, label %eh_then3002, label %eh_else3016
-
-eh_then3002: ; preds = %cleanup2998, %unwind2712
- %eh_exception.336046.0 = phi i8* [ %eh_ptr2713, %unwind2712 ], [ %eh_exception.33, %cleanup2998 ] ; <i8*> [#uses=3]
- invoke void @__gnat_begin_handler( i8* %eh_exception.336046.0 )
- to label %invcont3008 unwind label %unwind3006
-
-unwind3006: ; preds = %invcont3008, %eh_then3002
- %eh_ptr3007 = call i8* @llvm.eh.exception( ) ; <i8*> [#uses=1]
- call void @__gnat_end_handler( i8* %eh_exception.336046.0 )
- call i32 (...)* @_Unwind_Resume( i8* %eh_ptr3007 ) ; <i32>:12 [#uses=0]
- unreachable
-
-invcont3008: ; preds = %eh_then3002
- %tmp3009 = load void ()** @system__soft_links__abort_undefer ; <void ()*> [#uses=1]
- invoke void %tmp3009( )
- to label %cleanup3012 unwind label %unwind3006
-
-cleanup3012: ; preds = %invcont3008
- call void @__gnat_end_handler( i8* %eh_exception.336046.0 )
- %tmp3044.not6069 = icmp uge i8 %tmp272273, %tmp170171 ; <i1> [#uses=1]
- %tmp30506070 = icmp ult i8 %tmp170171, %tmp204205 ; <i1> [#uses=1]
- %bothcond59056071 = and i1 %tmp3044.not6069, %tmp30506070 ; <i1> [#uses=1]
- br i1 %bothcond59056071, label %cond_true3061, label %cond_next3068
-
-eh_else3016: ; preds = %cleanup2998, %unwind2712
- %eh_selector.296044.1 = phi i32 [ %eh_select2715, %unwind2712 ], [ %eh_selector.29, %cleanup2998 ] ; <i32> [#uses=1]
- %eh_exception.336046.1 = phi i8* [ %eh_ptr2713, %unwind2712 ], [ %eh_exception.33, %cleanup2998 ] ; <i8*> [#uses=4]
- %eh_typeid3017 = call i32 @llvm.eh.typeid.for.i32( i8* bitcast (i32* @__gnat_others_value to i8*) ) ; <i32> [#uses=1]
- %tmp3019 = icmp eq i32 %eh_selector.296044.1, %eh_typeid3017 ; <i1> [#uses=1]
- br i1 %tmp3019, label %eh_then3020, label %Unwind
-
-eh_then3020: ; preds = %eh_else3016
- invoke void @__gnat_begin_handler( i8* %eh_exception.336046.1 )
- to label %invcont3026 unwind label %unwind3024
-
-unwind3024: ; preds = %invcont3028, %invcont3026, %eh_then3020
- %eh_ptr3025 = call i8* @llvm.eh.exception( ) ; <i8*> [#uses=1]
- call void @__gnat_end_handler( i8* %eh_exception.336046.1 )
- call i32 (...)* @_Unwind_Resume( i8* %eh_ptr3025 ) ; <i32>:13 [#uses=0]
- unreachable
-
-invcont3026: ; preds = %eh_then3020
- %tmp3027 = load void ()** @system__soft_links__abort_undefer ; <void ()*> [#uses=1]
- invoke void %tmp3027( )
- to label %invcont3028 unwind label %unwind3024
-
-invcont3028: ; preds = %invcont3026
- invoke void @report__failed( i64 or (i64 zext (i32 ptrtoint ([25 x i8]* @.str21 to i32) to i64), i64 shl (i64 zext (i32 ptrtoint (%struct.string___XUB* @C.104.1478 to i32) to i64), i64 32)) )
- to label %cleanup3037 unwind label %unwind3024
-
-cleanup3037: ; preds = %invcont3028
- call void @__gnat_end_handler( i8* %eh_exception.336046.1 )
- br label %finally2997
-
-finally2997: ; preds = %cleanup3037, %cleanup2990
- %tmp3044.not = icmp uge i8 %tmp272273, %tmp170171 ; <i1> [#uses=1]
- %tmp3050 = icmp ult i8 %tmp170171, %tmp204205 ; <i1> [#uses=1]
- %bothcond5905 = and i1 %tmp3044.not, %tmp3050 ; <i1> [#uses=1]
- br i1 %bothcond5905, label %cond_true3061, label %cond_next3068
-
-cond_true3061: ; preds = %finally2997, %cleanup3012, %cleanup2961
- invoke void @__gnat_rcheck_12( i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0), i32 214 )
- to label %UnifiedUnreachableBlock34 unwind label %unwind3062
-
-unwind3062: ; preds = %cleanup3340, %unwind3325, %cond_true3061
- %eh_ptr3063 = call i8* @llvm.eh.exception( ) ; <i8*> [#uses=3]
- %eh_select3065 = call i32 (i8*, i8*, ...)* @llvm.eh.selector.i32( i8* %eh_ptr3063, i8* bitcast (i32 (...)* @__gnat_eh_personality to i8*), %struct.exception* @constraint_error, i32* @__gnat_others_value ) ; <i32> [#uses=2]
- %eh_typeid33496081 = call i32 @llvm.eh.typeid.for.i32( i8* getelementptr (%struct.exception* @constraint_error, i32 0, i32 0) ) ; <i32> [#uses=1]
- %tmp33516083 = icmp eq i32 %eh_select3065, %eh_typeid33496081 ; <i1> [#uses=1]
- br i1 %tmp33516083, label %eh_then3352, label %eh_else3366
-
-cond_next3068: ; preds = %finally2997, %cleanup3012, %cleanup2961
- invoke void @system__secondary_stack__ss_mark( %struct.system__secondary_stack__mark_id* %tmp72 sret )
- to label %invcont3116 unwind label %unwind3112
-
-unwind3112: ; preds = %cond_next3068
- %eh_ptr3113 = call i8* @llvm.eh.exception( ) ; <i8*> [#uses=3]
- %eh_select3115 = call i32 (i8*, i8*, ...)* @llvm.eh.selector.i32( i8* %eh_ptr3113, i8* bitcast (i32 (...)* @__gnat_eh_personality to i8*), i32* @__gnat_others_value ) ; <i32> [#uses=2]
- %eh_typeid33186088 = call i32 @llvm.eh.typeid.for.i32( i8* bitcast (i32* @__gnat_others_value to i8*) ) ; <i32> [#uses=1]
- %tmp33206089 = icmp eq i32 %eh_select3115, %eh_typeid33186088 ; <i1> [#uses=1]
- br i1 %tmp33206089, label %eh_then3321, label %cleanup3348
-
-invcont3116: ; preds = %cond_next3068
- %tmp3119 = getelementptr %struct.system__secondary_stack__mark_id* %tmp72, i32 0, i32 0 ; <i8**> [#uses=1]
- %tmp3120 = load i8** %tmp3119 ; <i8*> [#uses=2]
- %tmp3122 = getelementptr %struct.system__secondary_stack__mark_id* %tmp72, i32 0, i32 1 ; <i32*> [#uses=1]
- %tmp3123 = load i32* %tmp3122 ; <i32> [#uses=2]
- %tmp3124 = call i8* @llvm.stacksave( ) ; <i8*> [#uses=3]
- %tmp3158 = icmp ugt i8 %tmp170171, %tmp204205 ; <i1> [#uses=1]
- %bothcond5906 = or i1 %tmp364, %tmp3158 ; <i1> [#uses=1]
- br i1 %bothcond5906, label %bb3171, label %cond_next3184
-
-bb3171: ; preds = %invcont3116
- invoke void @__gnat_rcheck_05( i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0), i32 220 )
- to label %UnifiedUnreachableBlock34 unwind label %unwind3172
-
-unwind3172: ; preds = %invcont3260, %invcont3243, %bb3229, %bb3227, %bb3193, %bb3171
- %eh_ptr3173 = call i8* @llvm.eh.exception( ) ; <i8*> [#uses=3]
- %eh_select3175 = call i32 (i8*, i8*, ...)* @llvm.eh.selector.i32( i8* %eh_ptr3173, i8* bitcast (i32 (...)* @__gnat_eh_personality to i8*), i32* @__gnat_others_value ) ; <i32> [#uses=2]
- %tmp32795509 = ptrtoint i8* %tmp3120 to i32 ; <i32> [#uses=1]
- %tmp327955095510 = zext i32 %tmp32795509 to i64 ; <i64> [#uses=1]
- %tmp32825506 = zext i32 %tmp3123 to i64 ; <i64> [#uses=1]
- %tmp328255065507 = shl i64 %tmp32825506, 32 ; <i64> [#uses=1]
- %tmp328255065507.ins = or i64 %tmp328255065507, %tmp327955095510 ; <i64> [#uses=1]
- invoke void @system__secondary_stack__ss_release( i64 %tmp328255065507.ins )
- to label %cleanup3313 unwind label %unwind3287
-
-cond_next3184: ; preds = %invcont3116
- br i1 %tmp206, label %bb3193, label %bb3195
-
-bb3193: ; preds = %cond_next3184
- invoke void @__gnat_rcheck_06( i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0), i32 220 )
- to label %UnifiedUnreachableBlock34 unwind label %unwind3172
-
-bb3195: ; preds = %cond_next3184
- br i1 %tmp274, label %bb3227, label %bb3229
-
-bb3227: ; preds = %bb3195
- invoke void @__gnat_rcheck_06( i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0), i32 222 )
- to label %UnifiedUnreachableBlock34 unwind label %unwind3172
-
-bb3229: ; preds = %bb3195
- invoke void @system__img_enum__image_enumeration_8( %struct.string___XUP* %tmp75 sret , i32 %tmp13831384, i64 or (i64 zext (i32 ptrtoint ([28 x i8]* @weekS.154 to i32) to i64), i64 shl (i64 zext (i32 ptrtoint (%struct.string___XUB* @C.32.910 to i32) to i64), i64 32)), i8* getelementptr ([8 x i8]* @weekN.179, i32 0, i32 0) )
- to label %invcont3243 unwind label %unwind3172
-
-invcont3243: ; preds = %bb3229
- %tmp3245 = getelementptr %struct.string___XUP* %tmp75, i32 0, i32 0 ; <i8**> [#uses=1]
- %tmp3246 = load i8** %tmp3245 ; <i8*> [#uses=1]
- %tmp32465684 = ptrtoint i8* %tmp3246 to i32 ; <i32> [#uses=1]
- %tmp324656845685 = zext i32 %tmp32465684 to i64 ; <i64> [#uses=1]
- %tmp3248 = getelementptr %struct.string___XUP* %tmp75, i32 0, i32 1 ; <%struct.string___XUB**> [#uses=1]
- %tmp3249 = load %struct.string___XUB** %tmp3248 ; <%struct.string___XUB*> [#uses=1]
- %tmp32495680 = ptrtoint %struct.string___XUB* %tmp3249 to i32 ; <i32> [#uses=1]
- %tmp324956805681 = zext i32 %tmp32495680 to i64 ; <i64> [#uses=1]
- %tmp3249568056815682 = shl i64 %tmp324956805681, 32 ; <i64> [#uses=1]
- %tmp3249568056815682.ins = or i64 %tmp3249568056815682, %tmp324656845685 ; <i64> [#uses=1]
- invoke void @system__string_ops__str_concat( %struct.string___XUP* %tmp78 sret , i64 or (i64 zext (i32 ptrtoint ([31 x i8]* @.str22 to i32) to i64), i64 shl (i64 zext (i32 ptrtoint (%struct.string___XUB* @C.98.1466 to i32) to i64), i64 32)), i64 %tmp3249568056815682.ins )
- to label %invcont3260 unwind label %unwind3172
-
-invcont3260: ; preds = %invcont3243
- %tmp3262 = getelementptr %struct.string___XUP* %tmp78, i32 0, i32 0 ; <i8**> [#uses=1]
- %tmp3263 = load i8** %tmp3262 ; <i8*> [#uses=1]
- %tmp32635672 = ptrtoint i8* %tmp3263 to i32 ; <i32> [#uses=1]
- %tmp326356725673 = zext i32 %tmp32635672 to i64 ; <i64> [#uses=1]
- %tmp3265 = getelementptr %struct.string___XUP* %tmp78, i32 0, i32 1 ; <%struct.string___XUB**> [#uses=1]
- %tmp3266 = load %struct.string___XUB** %tmp3265 ; <%struct.string___XUB*> [#uses=1]
- %tmp32665668 = ptrtoint %struct.string___XUB* %tmp3266 to i32 ; <i32> [#uses=1]
- %tmp326656685669 = zext i32 %tmp32665668 to i64 ; <i64> [#uses=1]
- %tmp3266566856695670 = shl i64 %tmp326656685669, 32 ; <i64> [#uses=1]
- %tmp3266566856695670.ins = or i64 %tmp3266566856695670, %tmp326356725673 ; <i64> [#uses=1]
- invoke void @report__failed( i64 %tmp3266566856695670.ins )
- to label %cleanup3293 unwind label %unwind3172
-
-unwind3287: ; preds = %cleanup3293, %unwind3172
- %eh_ptr3288 = call i8* @llvm.eh.exception( ) ; <i8*> [#uses=3]
- %eh_select3290 = call i32 (i8*, i8*, ...)* @llvm.eh.selector.i32( i8* %eh_ptr3288, i8* bitcast (i32 (...)* @__gnat_eh_personality to i8*), i32* @__gnat_others_value ) ; <i32> [#uses=2]
- call void @llvm.stackrestore( i8* %tmp3124 )
- %eh_typeid33187 = call i32 @llvm.eh.typeid.for.i32( i8* bitcast (i32* @__gnat_others_value to i8*) ) ; <i32> [#uses=1]
- %tmp33208 = icmp eq i32 %eh_select3290, %eh_typeid33187 ; <i1> [#uses=1]
- br i1 %tmp33208, label %eh_then3321, label %cleanup3348
-
-cleanup3293: ; preds = %invcont3260
- %tmp33005503 = ptrtoint i8* %tmp3120 to i32 ; <i32> [#uses=1]
- %tmp330055035504 = zext i32 %tmp33005503 to i64 ; <i64> [#uses=1]
- %tmp33035500 = zext i32 %tmp3123 to i64 ; <i64> [#uses=1]
- %tmp330355005501 = shl i64 %tmp33035500, 32 ; <i64> [#uses=1]
- %tmp330355005501.ins = or i64 %tmp330355005501, %tmp330055035504 ; <i64> [#uses=1]
- invoke void @system__secondary_stack__ss_release( i64 %tmp330355005501.ins )
- to label %cleanup3311 unwind label %unwind3287
-
-cleanup3311: ; preds = %cleanup3293
- call void @llvm.stackrestore( i8* %tmp3124 )
- br label %finally3347
-
-cleanup3313: ; preds = %unwind3172
- call void @llvm.stackrestore( i8* %tmp3124 )
- %eh_typeid3318 = call i32 @llvm.eh.typeid.for.i32( i8* bitcast (i32* @__gnat_others_value to i8*) ) ; <i32> [#uses=1]
- %tmp3320 = icmp eq i32 %eh_select3175, %eh_typeid3318 ; <i1> [#uses=1]
- br i1 %tmp3320, label %eh_then3321, label %cleanup3348
-
-eh_then3321: ; preds = %cleanup3313, %unwind3287, %unwind3112
- %eh_exception.416084.0 = phi i8* [ %eh_ptr3113, %unwind3112 ], [ %eh_ptr3288, %unwind3287 ], [ %eh_ptr3173, %cleanup3313 ] ; <i8*> [#uses=3]
- invoke void @__gnat_begin_handler( i8* %eh_exception.416084.0 )
- to label %invcont3329 unwind label %unwind3325
-
-unwind3325: ; preds = %invcont3331, %invcont3329, %eh_then3321
- %eh_ptr3326 = call i8* @llvm.eh.exception( ) ; <i8*> [#uses=2]
- %eh_select3328 = call i32 (i8*, i8*, ...)* @llvm.eh.selector.i32( i8* %eh_ptr3326, i8* bitcast (i32 (...)* @__gnat_eh_personality to i8*), %struct.exception* @constraint_error, i32* @__gnat_others_value ) ; <i32> [#uses=1]
- invoke void @__gnat_end_handler( i8* %eh_exception.416084.0 )
- to label %cleanup3348 unwind label %unwind3062
-
-invcont3329: ; preds = %eh_then3321
- %tmp3330 = load void ()** @system__soft_links__abort_undefer ; <void ()*> [#uses=1]
- invoke void %tmp3330( )
- to label %invcont3331 unwind label %unwind3325
-
-invcont3331: ; preds = %invcont3329
- invoke void @report__failed( i64 or (i64 zext (i32 ptrtoint ([46 x i8]* @.str20 to i32) to i64), i64 shl (i64 zext (i32 ptrtoint (%struct.string___XUB* @C.101.1473 to i32) to i64), i64 32)) )
- to label %cleanup3340 unwind label %unwind3325
-
-cleanup3340: ; preds = %invcont3331
- invoke void @__gnat_end_handler( i8* %eh_exception.416084.0 )
- to label %finally3347 unwind label %unwind3062
-
-cleanup3348: ; preds = %unwind3325, %cleanup3313, %unwind3287, %unwind3112
- %eh_selector.35 = phi i32 [ %eh_select3115, %unwind3112 ], [ %eh_select3290, %unwind3287 ], [ %eh_select3175, %cleanup3313 ], [ %eh_select3328, %unwind3325 ] ; <i32> [#uses=2]
- %eh_exception.39 = phi i8* [ %eh_ptr3113, %unwind3112 ], [ %eh_ptr3288, %unwind3287 ], [ %eh_ptr3173, %cleanup3313 ], [ %eh_ptr3326, %unwind3325 ] ; <i8*> [#uses=2]
- %eh_typeid3349 = call i32 @llvm.eh.typeid.for.i32( i8* getelementptr (%struct.exception* @constraint_error, i32 0, i32 0) ) ; <i32> [#uses=1]
- %tmp3351 = icmp eq i32 %eh_selector.35, %eh_typeid3349 ; <i1> [#uses=1]
- br i1 %tmp3351, label %eh_then3352, label %eh_else3366
-
-eh_then3352: ; preds = %cleanup3348, %unwind3062
- %eh_exception.396074.0 = phi i8* [ %eh_ptr3063, %unwind3062 ], [ %eh_exception.39, %cleanup3348 ] ; <i8*> [#uses=3]
- invoke void @__gnat_begin_handler( i8* %eh_exception.396074.0 )
- to label %invcont3358 unwind label %unwind3356
-
-unwind3356: ; preds = %invcont3358, %eh_then3352
- %eh_ptr3357 = call i8* @llvm.eh.exception( ) ; <i8*> [#uses=1]
- call void @__gnat_end_handler( i8* %eh_exception.396074.0 )
- call i32 (...)* @_Unwind_Resume( i8* %eh_ptr3357 ) ; <i32>:14 [#uses=0]
- unreachable
-
-invcont3358: ; preds = %eh_then3352
- %tmp3359 = load void ()** @system__soft_links__abort_undefer ; <void ()*> [#uses=1]
- invoke void %tmp3359( )
- to label %cleanup3362 unwind label %unwind3356
-
-cleanup3362: ; preds = %invcont3358
- call void @__gnat_end_handler( i8* %eh_exception.396074.0 )
- br label %finally3347
-
-eh_else3366: ; preds = %cleanup3348, %unwind3062
- %eh_selector.356072.1 = phi i32 [ %eh_select3065, %unwind3062 ], [ %eh_selector.35, %cleanup3348 ] ; <i32> [#uses=1]
- %eh_exception.396074.1 = phi i8* [ %eh_ptr3063, %unwind3062 ], [ %eh_exception.39, %cleanup3348 ] ; <i8*> [#uses=4]
- %eh_typeid3367 = call i32 @llvm.eh.typeid.for.i32( i8* bitcast (i32* @__gnat_others_value to i8*) ) ; <i32> [#uses=1]
- %tmp3369 = icmp eq i32 %eh_selector.356072.1, %eh_typeid3367 ; <i1> [#uses=1]
- br i1 %tmp3369, label %eh_then3370, label %Unwind
-
-eh_then3370: ; preds = %eh_else3366
- invoke void @__gnat_begin_handler( i8* %eh_exception.396074.1 )
- to label %invcont3376 unwind label %unwind3374
-
-unwind3374: ; preds = %invcont3378, %invcont3376, %eh_then3370
- %eh_ptr3375 = call i8* @llvm.eh.exception( ) ; <i8*> [#uses=1]
- call void @__gnat_end_handler( i8* %eh_exception.396074.1 )
- call i32 (...)* @_Unwind_Resume( i8* %eh_ptr3375 ) ; <i32>:15 [#uses=0]
- unreachable
-
-invcont3376: ; preds = %eh_then3370
- %tmp3377 = load void ()** @system__soft_links__abort_undefer ; <void ()*> [#uses=1]
- invoke void %tmp3377( )
- to label %invcont3378 unwind label %unwind3374
-
-invcont3378: ; preds = %invcont3376
- invoke void @report__failed( i64 or (i64 zext (i32 ptrtoint ([25 x i8]* @.str23 to i32) to i64), i64 shl (i64 zext (i32 ptrtoint (%struct.string___XUB* @C.104.1478 to i32) to i64), i64 32)) )
- to label %cleanup3387 unwind label %unwind3374
-
-cleanup3387: ; preds = %invcont3378
- call void @__gnat_end_handler( i8* %eh_exception.396074.1 )
- br label %finally3347
-
-finally3347: ; preds = %cleanup3387, %cleanup3362, %cleanup3340, %cleanup3311
- %tmp3392 = call i8* @llvm.stacksave( ) ; <i8*> [#uses=2]
- %tmp3398 = invoke i32 @report__ident_int( i32 -5 )
- to label %invcont3397 unwind label %unwind3393 ; <i32> [#uses=4]
-
-unwind3393: ; preds = %cond_true3555, %cond_true3543, %cond_next3451, %cond_true3448, %cond_true3420, %finally3347
- %eh_ptr3394 = call i8* @llvm.eh.exception( ) ; <i8*> [#uses=5]
- %eh_select3396 = call i32 (i8*, i8*, ...)* @llvm.eh.selector.i32( i8* %eh_ptr3394, i8* bitcast (i32 (...)* @__gnat_eh_personality to i8*), i32* @__gnat_others_value ) ; <i32> [#uses=1]
- call void @llvm.stackrestore( i8* %tmp3392 )
- %eh_typeid3571 = call i32 @llvm.eh.typeid.for.i32( i8* bitcast (i32* @__gnat_others_value to i8*) ) ; <i32> [#uses=1]
- %tmp3573 = icmp eq i32 %eh_select3396, %eh_typeid3571 ; <i1> [#uses=1]
- br i1 %tmp3573, label %eh_then3574, label %Unwind
-
-invcont3397: ; preds = %finally3347
- %tmp3405 = icmp slt i32 %tmp3398, %tmp384 ; <i1> [#uses=2]
- %tmp3413 = icmp sgt i32 %tmp3398, %tmp394 ; <i1> [#uses=1]
- %tmp3417 = or i1 %tmp3405, %tmp3413 ; <i1> [#uses=1]
- br i1 %tmp3417, label %cond_true3420, label %cond_next3422
-
-cond_true3420: ; preds = %invcont3397
- invoke void @__gnat_rcheck_12( i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0), i32 238 )
- to label %UnifiedUnreachableBlock34 unwind label %unwind3393
-
-cond_next3422: ; preds = %invcont3397
- %tmp3426 = icmp slt i32 %tmp3398, -5 ; <i1> [#uses=1]
- br i1 %tmp3426, label %cond_true3429, label %cond_next3451
-
-cond_true3429: ; preds = %cond_next3422
- %tmp3441 = icmp slt i32 %tmp394, -6 ; <i1> [#uses=1]
- %tmp3445 = or i1 %tmp3405, %tmp3441 ; <i1> [#uses=1]
- br i1 %tmp3445, label %cond_true3448, label %cond_next3451
-
-cond_true3448: ; preds = %cond_true3429
- invoke void @__gnat_rcheck_12( i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0), i32 238 )
- to label %UnifiedUnreachableBlock34 unwind label %unwind3393
-
-cond_next3451: ; preds = %cond_true3429, %cond_next3422
- %tmp3521 = invoke i32 @report__ident_int( i32 -5 )
- to label %invcont3520 unwind label %unwind3393 ; <i32> [#uses=3]
-
-invcont3520: ; preds = %cond_next3451
- %tmp3528 = icmp slt i32 %tmp3521, %tmp384 ; <i1> [#uses=1]
- %tmp3536 = icmp sgt i32 %tmp3521, %tmp394 ; <i1> [#uses=1]
- %tmp3540 = or i1 %tmp3528, %tmp3536 ; <i1> [#uses=1]
- br i1 %tmp3540, label %cond_true3543, label %cond_next3545
-
-cond_true3543: ; preds = %invcont3520
- invoke void @__gnat_rcheck_12( i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0), i32 241 )
- to label %UnifiedUnreachableBlock34 unwind label %unwind3393
-
-cond_next3545: ; preds = %invcont3520
- %tmp3552 = icmp eq i32 %tmp3398, %tmp3521 ; <i1> [#uses=1]
- br i1 %tmp3552, label %cleanup3565, label %cond_true3555
-
-cond_true3555: ; preds = %cond_next3545
- invoke void @report__failed( i64 or (i64 zext (i32 ptrtoint ([30 x i8]* @.str24 to i32) to i64), i64 shl (i64 zext (i32 ptrtoint (%struct.string___XUB* @C.30.904 to i32) to i64), i64 32)) )
- to label %cleanup3565 unwind label %unwind3393
-
-cleanup3565: ; preds = %cond_true3555, %cond_next3545
- call void @llvm.stackrestore( i8* %tmp3392 )
- %tmp36006095 = icmp ult i8 %tmp137138, %sat.45934.0 ; <i1> [#uses=1]
- br i1 %tmp36006095, label %cond_next3624, label %cond_true3603
-
-eh_then3574: ; preds = %unwind3393
- invoke void @__gnat_begin_handler( i8* %eh_ptr3394 )
- to label %invcont3580 unwind label %unwind3578
-
-unwind3578: ; preds = %invcont3582, %invcont3580, %eh_then3574
- %eh_ptr3579 = call i8* @llvm.eh.exception( ) ; <i8*> [#uses=1]
- call void @__gnat_end_handler( i8* %eh_ptr3394 )
- call i32 (...)* @_Unwind_Resume( i8* %eh_ptr3579 ) ; <i32>:16 [#uses=0]
- unreachable
-
-invcont3580: ; preds = %eh_then3574
- %tmp3581 = load void ()** @system__soft_links__abort_undefer ; <void ()*> [#uses=1]
- invoke void %tmp3581( )
- to label %invcont3582 unwind label %unwind3578
-
-invcont3582: ; preds = %invcont3580
- invoke void @report__failed( i64 or (i64 zext (i32 ptrtoint ([18 x i8]* @.str25 to i32) to i64), i64 shl (i64 zext (i32 ptrtoint (%struct.string___XUB* @C.124.1606 to i32) to i64), i64 32)) )
- to label %cleanup3591 unwind label %unwind3578
-
-cleanup3591: ; preds = %invcont3582
- call void @__gnat_end_handler( i8* %eh_ptr3394 )
- %tmp3600 = icmp ult i8 %tmp137138, %sat.45934.0 ; <i1> [#uses=1]
- br i1 %tmp3600, label %cond_next3624, label %cond_true3603
-
-cond_true3603: ; preds = %cleanup3591, %cleanup3565
- %tmp3606 = icmp ult i8 %sat.45934.0, %tmp204205 ; <i1> [#uses=1]
- %tmp3610 = icmp ugt i8 %tmp137138, %tmp272273 ; <i1> [#uses=1]
- %tmp3614 = or i1 %tmp3606, %tmp3610 ; <i1> [#uses=1]
- br i1 %tmp3614, label %cond_true3617, label %cond_next3624
-
-cond_true3617: ; preds = %cond_true3603
- invoke void @__gnat_rcheck_12( i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0), i32 250 )
- to label %UnifiedUnreachableBlock34 unwind label %unwind3618
-
-unwind3618: ; preds = %bb3743, %cond_true3729, %bb3689, %cond_true3675, %bb3635, %cond_true3617
- %wed.3 = phi i8 [ %tmp238239, %cond_true3617 ], [ %wed.1, %bb3743 ], [ %tmp238239, %bb3689 ], [ %tmp238239, %bb3635 ], [ %tmp238239, %cond_true3675 ], [ %tmp238239, %cond_true3729 ] ; <i8> [#uses=1]
- %tue.3 = phi i8 [ %tmp204205, %cond_true3617 ], [ %tue.2, %bb3743 ], [ %tue.2, %bb3689 ], [ %tue.1, %bb3635 ], [ %tue.2, %cond_true3675 ], [ %tue.2, %cond_true3729 ] ; <i8> [#uses=1]
- %mon.3 = phi i8 [ %tmp170171, %cond_true3617 ], [ %mon.2, %bb3743 ], [ %mon.1, %bb3689 ], [ %tmp170171, %bb3635 ], [ %tmp170171, %cond_true3675 ], [ %mon.2, %cond_true3729 ] ; <i8> [#uses=1]
- %eh_ptr3619 = call i8* @llvm.eh.exception( ) ; <i8*> [#uses=5]
- %eh_select3621 = call i32 (i8*, i8*, ...)* @llvm.eh.selector.i32( i8* %eh_ptr3619, i8* bitcast (i32 (...)* @__gnat_eh_personality to i8*), i32* @__gnat_others_value ) ; <i32> [#uses=1]
- %eh_typeid3854 = call i32 @llvm.eh.typeid.for.i32( i8* bitcast (i32* @__gnat_others_value to i8*) ) ; <i32> [#uses=1]
- %tmp3856 = icmp eq i32 %eh_select3621, %eh_typeid3854 ; <i1> [#uses=1]
- br i1 %tmp3856, label %eh_then3857, label %Unwind
-
-cond_next3624: ; preds = %cond_true3603, %cleanup3591, %cleanup3565
- %tmp3629 = icmp ugt i8 %sat.45934.0, %tmp137138 ; <i1> [#uses=1]
- br i1 %tmp3629, label %cond_next3653, label %bb3635
-
-bb3635: ; preds = %cond_next3649, %cond_next3624
- %indvar6258 = phi i8 [ %indvar.next16, %cond_next3649 ], [ 0, %cond_next3624 ] ; <i8> [#uses=2]
- %tue.1 = phi i8 [ %tue.0, %cond_next3649 ], [ %tmp204205, %cond_next3624 ] ; <i8> [#uses=2]
- %tmp3637 = invoke i8 @report__equal( i32 2, i32 2 )
- to label %invcont3636 unwind label %unwind3618 ; <i8> [#uses=1]
-
-invcont3636: ; preds = %bb3635
- %i3633.4 = add i8 %indvar6258, %sat.45934.0 ; <i8> [#uses=1]
- %tmp3638 = icmp eq i8 %tmp3637, 0 ; <i1> [#uses=1]
- %tue.0 = select i1 %tmp3638, i8 %tue.1, i8 2 ; <i8> [#uses=2]
- %tmp3645 = icmp eq i8 %i3633.4, %tmp137138 ; <i1> [#uses=1]
- br i1 %tmp3645, label %cond_next3653, label %cond_next3649
-
-cond_next3649: ; preds = %invcont3636
- %indvar.next16 = add i8 %indvar6258, 1 ; <i8> [#uses=1]
- br label %bb3635
-
-cond_next3653: ; preds = %invcont3636, %cond_next3624
- %tue.2 = phi i8 [ %tmp204205, %cond_next3624 ], [ %tue.0, %invcont3636 ] ; <i8> [#uses=6]
- %tmp3658 = icmp ult i8 %tmp238239, %tmp306307 ; <i1> [#uses=1]
- br i1 %tmp3658, label %cond_next3678, label %cond_true3661
-
-cond_true3661: ; preds = %cond_next3653
- %tmp3664 = icmp ult i8 %tmp306307, %tmp204205 ; <i1> [#uses=1]
- %tmp3668 = icmp ugt i8 %tmp238239, %tmp272273 ; <i1> [#uses=1]
- %tmp3672 = or i1 %tmp3664, %tmp3668 ; <i1> [#uses=1]
- br i1 %tmp3672, label %cond_true3675, label %cond_next3678
-
-cond_true3675: ; preds = %cond_true3661
- invoke void @__gnat_rcheck_12( i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0), i32 257 )
- to label %UnifiedUnreachableBlock34 unwind label %unwind3618
-
-cond_next3678: ; preds = %cond_true3661, %cond_next3653
- %tmp3683 = icmp ugt i8 %tmp306307, %tmp238239 ; <i1> [#uses=1]
- br i1 %tmp3683, label %cond_next3707, label %bb3689
-
-bb3689: ; preds = %cond_next3703, %cond_next3678
- %indvar6261 = phi i8 [ %indvar.next18, %cond_next3703 ], [ 0, %cond_next3678 ] ; <i8> [#uses=2]
- %mon.1 = phi i8 [ %mon.0, %cond_next3703 ], [ %tmp170171, %cond_next3678 ] ; <i8> [#uses=2]
- %tmp3691 = invoke i8 @report__equal( i32 2, i32 2 )
- to label %invcont3690 unwind label %unwind3618 ; <i8> [#uses=1]
-
-invcont3690: ; preds = %bb3689
- %i3687.4 = add i8 %indvar6261, %tmp306307 ; <i8> [#uses=1]
- %tmp3692 = icmp eq i8 %tmp3691, 0 ; <i1> [#uses=1]
- %mon.0 = select i1 %tmp3692, i8 %mon.1, i8 1 ; <i8> [#uses=2]
- %tmp3699 = icmp eq i8 %i3687.4, %tmp238239 ; <i1> [#uses=1]
- br i1 %tmp3699, label %cond_next3707, label %cond_next3703
-
-cond_next3703: ; preds = %invcont3690
- %indvar.next18 = add i8 %indvar6261, 1 ; <i8> [#uses=1]
- br label %bb3689
-
-cond_next3707: ; preds = %invcont3690, %cond_next3678
- %mon.2 = phi i8 [ %tmp170171, %cond_next3678 ], [ %mon.0, %invcont3690 ] ; <i8> [#uses=8]
- %tmp3712 = icmp ult i8 %tmp137138, %mon.2 ; <i1> [#uses=1]
- br i1 %tmp3712, label %cond_next3732, label %cond_true3715
-
-cond_true3715: ; preds = %cond_next3707
- %tmp3718 = icmp ult i8 %mon.2, %tmp204205 ; <i1> [#uses=1]
- %tmp3722 = icmp ugt i8 %tmp137138, %tmp272273 ; <i1> [#uses=1]
- %tmp3726 = or i1 %tmp3718, %tmp3722 ; <i1> [#uses=1]
- br i1 %tmp3726, label %cond_true3729, label %cond_next3732
-
-cond_true3729: ; preds = %cond_true3715
- invoke void @__gnat_rcheck_12( i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0), i32 264 )
- to label %UnifiedUnreachableBlock34 unwind label %unwind3618
-
-cond_next3732: ; preds = %cond_true3715, %cond_next3707
- %tmp3737 = icmp ugt i8 %mon.2, %tmp137138 ; <i1> [#uses=1]
- br i1 %tmp3737, label %finally3852, label %bb3743
-
-bb3743: ; preds = %cond_next3757, %cond_next3732
- %indvar6265 = phi i8 [ %indvar.next20, %cond_next3757 ], [ 0, %cond_next3732 ] ; <i8> [#uses=2]
- %wed.1 = phi i8 [ %wed.0, %cond_next3757 ], [ %tmp238239, %cond_next3732 ] ; <i8> [#uses=2]
- %tmp3745 = invoke i8 @report__equal( i32 3, i32 3 )
- to label %invcont3744 unwind label %unwind3618 ; <i8> [#uses=1]
-
-invcont3744: ; preds = %bb3743
- %i3741.4 = add i8 %indvar6265, %mon.2 ; <i8> [#uses=1]
- %tmp3746 = icmp eq i8 %tmp3745, 0 ; <i1> [#uses=1]
- %wed.0 = select i1 %tmp3746, i8 %wed.1, i8 3 ; <i8> [#uses=2]
- %tmp3753 = icmp eq i8 %i3741.4, %tmp137138 ; <i1> [#uses=1]
- br i1 %tmp3753, label %finally3852, label %cond_next3757
-
-cond_next3757: ; preds = %invcont3744
- %indvar.next20 = add i8 %indvar6265, 1 ; <i8> [#uses=1]
- br label %bb3743
-
-eh_then3857: ; preds = %unwind3618
- invoke void @__gnat_begin_handler( i8* %eh_ptr3619 )
- to label %invcont3863 unwind label %unwind3861
-
-unwind3861: ; preds = %invcont3865, %invcont3863, %eh_then3857
- %eh_ptr3862 = call i8* @llvm.eh.exception( ) ; <i8*> [#uses=1]
- call void @__gnat_end_handler( i8* %eh_ptr3619 )
- call i32 (...)* @_Unwind_Resume( i8* %eh_ptr3862 ) ; <i32>:17 [#uses=0]
- unreachable
-
-invcont3863: ; preds = %eh_then3857
- %tmp3864 = load void ()** @system__soft_links__abort_undefer ; <void ()*> [#uses=1]
- invoke void %tmp3864( )
- to label %invcont3865 unwind label %unwind3861
-
-invcont3865: ; preds = %invcont3863
- invoke void @report__failed( i64 or (i64 zext (i32 ptrtoint ([18 x i8]* @.str26 to i32) to i64), i64 shl (i64 zext (i32 ptrtoint (%struct.string___XUB* @C.124.1606 to i32) to i64), i64 32)) )
- to label %cleanup3874 unwind label %unwind3861
-
-cleanup3874: ; preds = %invcont3865
- call void @__gnat_end_handler( i8* %eh_ptr3619 )
- br label %finally3852
-
-finally3852: ; preds = %cleanup3874, %invcont3744, %cond_next3732
- %wed.4 = phi i8 [ %wed.3, %cleanup3874 ], [ %tmp238239, %cond_next3732 ], [ %wed.0, %invcont3744 ] ; <i8> [#uses=4]
- %tue.4 = phi i8 [ %tue.3, %cleanup3874 ], [ %tue.2, %cond_next3732 ], [ %tue.2, %invcont3744 ] ; <i8> [#uses=13]
- %mon.4 = phi i8 [ %mon.3, %cleanup3874 ], [ %mon.2, %cond_next3732 ], [ %mon.2, %invcont3744 ] ; <i8> [#uses=18]
- %tmp3885 = invoke i32 @report__ident_int( i32 -5 )
- to label %invcont3884 unwind label %unwind3880 ; <i32> [#uses=4]
-
-unwind3880: ; preds = %cond_true4138, %invcont4122, %cond_next4120, %cond_true4117, %cond_true4027, %cond_next3938, %cond_true3935, %cond_true3907, %finally3852
- %eh_ptr3881 = call i8* @llvm.eh.exception( ) ; <i8*> [#uses=5]
- %eh_select3883 = call i32 (i8*, i8*, ...)* @llvm.eh.selector.i32( i8* %eh_ptr3881, i8* bitcast (i32 (...)* @__gnat_eh_personality to i8*), i32* @__gnat_others_value ) ; <i32> [#uses=1]
- %eh_typeid4149 = call i32 @llvm.eh.typeid.for.i32( i8* bitcast (i32* @__gnat_others_value to i8*) ) ; <i32> [#uses=1]
- %tmp4151 = icmp eq i32 %eh_select3883, %eh_typeid4149 ; <i1> [#uses=1]
- br i1 %tmp4151, label %eh_then4152, label %Unwind
-
-invcont3884: ; preds = %finally3852
- %tmp3892 = icmp slt i32 %tmp3885, %tmp384 ; <i1> [#uses=2]
- %tmp3900 = icmp sgt i32 %tmp3885, %tmp394 ; <i1> [#uses=1]
- %tmp3904 = or i1 %tmp3892, %tmp3900 ; <i1> [#uses=1]
- br i1 %tmp3904, label %cond_true3907, label %cond_next3909
-
-cond_true3907: ; preds = %invcont3884
- invoke void @__gnat_rcheck_12( i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0), i32 312 )
- to label %UnifiedUnreachableBlock34 unwind label %unwind3880
-
-cond_next3909: ; preds = %invcont3884
- %tmp3913 = icmp slt i32 %tmp3885, -5 ; <i1> [#uses=1]
- br i1 %tmp3913, label %cond_true3916, label %cond_next3938
-
-cond_true3916: ; preds = %cond_next3909
- %tmp3928 = icmp slt i32 %tmp394, -6 ; <i1> [#uses=1]
- %tmp3932 = or i1 %tmp3892, %tmp3928 ; <i1> [#uses=1]
- br i1 %tmp3932, label %cond_true3935, label %cond_next3938
-
-cond_true3935: ; preds = %cond_true3916
- invoke void @__gnat_rcheck_12( i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0), i32 312 )
- to label %UnifiedUnreachableBlock34 unwind label %unwind3880
-
-cond_next3938: ; preds = %cond_true3916, %cond_next3909
- %tmp4005 = invoke i32 @report__ident_int( i32 -5 )
- to label %invcont4004 unwind label %unwind3880 ; <i32> [#uses=6]
-
-invcont4004: ; preds = %cond_next3938
- %tmp4012 = icmp slt i32 %tmp4005, %tmp384 ; <i1> [#uses=2]
- %tmp4020 = icmp sgt i32 %tmp4005, %tmp394 ; <i1> [#uses=1]
- %tmp4024 = or i1 %tmp4012, %tmp4020 ; <i1> [#uses=1]
- br i1 %tmp4024, label %cond_true4027, label %cond_next4029
-
-cond_true4027: ; preds = %invcont4004
- invoke void @__gnat_rcheck_12( i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0), i32 313 )
- to label %UnifiedUnreachableBlock34 unwind label %unwind3880
-
-cond_next4029: ; preds = %invcont4004
- %tmp4071 = icmp sgt i32 %tmp4005, -6 ; <i1> [#uses=1]
- %tmp4078 = add i32 %tmp4005, 1073741823 ; <i32> [#uses=1]
- %iftmp.132.0 = select i1 %tmp4071, i32 %tmp4078, i32 1073741818 ; <i32> [#uses=1]
- %tmp4085 = sub i32 %iftmp.132.0, %tmp4005 ; <i32> [#uses=1]
- %tmp4086 = shl i32 %tmp4085, 2 ; <i32> [#uses=2]
- %tmp4087 = add i32 %tmp4086, 4 ; <i32> [#uses=1]
- %tmp4088 = icmp sgt i32 %tmp4087, -1 ; <i1> [#uses=1]
- %tmp4087.op = add i32 %tmp4086, 7 ; <i32> [#uses=1]
- %tmp4087.op.op = and i32 %tmp4087.op, -4 ; <i32> [#uses=1]
- %tmp4091 = select i1 %tmp4088, i32 %tmp4087.op.op, i32 0 ; <i32> [#uses=1]
- %tmp4095 = icmp slt i32 %tmp4005, -5 ; <i1> [#uses=1]
- br i1 %tmp4095, label %cond_true4098, label %cond_next4120
-
-cond_true4098: ; preds = %cond_next4029
- %tmp4110 = icmp slt i32 %tmp394, -6 ; <i1> [#uses=1]
- %tmp4114 = or i1 %tmp4012, %tmp4110 ; <i1> [#uses=1]
- br i1 %tmp4114, label %cond_true4117, label %cond_next4120
-
-cond_true4117: ; preds = %cond_true4098
- invoke void @__gnat_rcheck_12( i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0), i32 313 )
- to label %UnifiedUnreachableBlock34 unwind label %unwind3880
-
-cond_next4120: ; preds = %cond_true4098, %cond_next4029
- %tmp4123 = invoke i8* @__gnat_malloc( i32 %tmp4091 )
- to label %invcont4122 unwind label %unwind3880 ; <i8*> [#uses=0]
-
-invcont4122: ; preds = %cond_next4120
- %tmp41254128 = sext i32 %tmp3885 to i64 ; <i64> [#uses=1]
- %tmp4129 = sub i64 -5, %tmp41254128 ; <i64> [#uses=2]
- %tmp4134 = invoke i32 @report__ident_int( i32 0 )
- to label %invcont4133 unwind label %unwind3880 ; <i32> [#uses=1]
-
-invcont4133: ; preds = %invcont4122
- %tmp4130 = icmp sgt i64 %tmp4129, -1 ; <i1> [#uses=1]
- %tmp4129.cast = trunc i64 %tmp4129 to i32 ; <i32> [#uses=1]
- %max41314132 = select i1 %tmp4130, i32 %tmp4129.cast, i32 0 ; <i32> [#uses=1]
- %tmp4135 = icmp eq i32 %max41314132, %tmp4134 ; <i1> [#uses=1]
- br i1 %tmp4135, label %finally4147, label %cond_true4138
-
-cond_true4138: ; preds = %invcont4133
- invoke void @report__failed( i64 or (i64 zext (i32 ptrtoint ([31 x i8]* @.str27 to i32) to i64), i64 shl (i64 zext (i32 ptrtoint (%struct.string___XUB* @C.98.1466 to i32) to i64), i64 32)) )
- to label %finally4147 unwind label %unwind3880
-
-eh_then4152: ; preds = %unwind3880
- invoke void @__gnat_begin_handler( i8* %eh_ptr3881 )
- to label %invcont4158 unwind label %unwind4156
-
-unwind4156: ; preds = %invcont4160, %invcont4158, %eh_then4152
- %eh_ptr4157 = call i8* @llvm.eh.exception( ) ; <i8*> [#uses=1]
- call void @__gnat_end_handler( i8* %eh_ptr3881 )
- call i32 (...)* @_Unwind_Resume( i8* %eh_ptr4157 ) ; <i32>:18 [#uses=0]
- unreachable
-
-invcont4158: ; preds = %eh_then4152
- %tmp4159 = load void ()** @system__soft_links__abort_undefer ; <void ()*> [#uses=1]
- invoke void %tmp4159( )
- to label %invcont4160 unwind label %unwind4156
-
-invcont4160: ; preds = %invcont4158
- invoke void @report__failed( i64 or (i64 zext (i32 ptrtoint ([18 x i8]* @.str28 to i32) to i64), i64 shl (i64 zext (i32 ptrtoint (%struct.string___XUB* @C.124.1606 to i32) to i64), i64 32)) )
- to label %cleanup4169 unwind label %unwind4156
-
-cleanup4169: ; preds = %invcont4160
- call void @__gnat_end_handler( i8* %eh_ptr3881 )
- br label %finally4147
-
-finally4147: ; preds = %cleanup4169, %cond_true4138, %invcont4133
- %tmp4174 = call i8* @llvm.stacksave( ) ; <i8*> [#uses=3]
- %tmp4180 = invoke i32 @report__ident_int( i32 4 )
- to label %invcont4179 unwind label %unwind4175 ; <i32> [#uses=6]
-
-unwind4175: ; preds = %cond_true4292, %cond_true4187, %finally4147
- %eh_ptr4176 = call i8* @llvm.eh.exception( ) ; <i8*> [#uses=5]
- %eh_select4178 = call i32 (i8*, i8*, ...)* @llvm.eh.selector.i32( i8* %eh_ptr4176, i8* bitcast (i32 (...)* @__gnat_eh_personality to i8*), i32* @__gnat_others_value ) ; <i32> [#uses=1]
- %eh_typeid4304 = call i32 @llvm.eh.typeid.for.i32( i8* bitcast (i32* @__gnat_others_value to i8*) ) ; <i32> [#uses=1]
- %tmp4306 = icmp eq i32 %eh_select4178, %eh_typeid4304 ; <i1> [#uses=1]
- br i1 %tmp4306, label %eh_then4307, label %cleanup4334
-
-invcont4179: ; preds = %finally4147
- %tmp4184 = icmp slt i32 %tmp4180, 1 ; <i1> [#uses=1]
- br i1 %tmp4184, label %cond_true4187, label %cond_next4189
-
-cond_true4187: ; preds = %invcont4179
- invoke void @__gnat_rcheck_12( i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0), i32 329 )
- to label %UnifiedUnreachableBlock34 unwind label %unwind4175
-
-cond_next4189: ; preds = %invcont4179
- %tmp4231 = icmp sgt i32 %tmp4180, 2 ; <i1> [#uses=2]
- %tmp4238 = add i32 %tmp4180, 1073741823 ; <i32> [#uses=1]
- %iftmp.138.0 = select i1 %tmp4231, i32 %tmp4238, i32 2 ; <i32> [#uses=1]
- %tmp4245 = sub i32 %iftmp.138.0, %tmp4180 ; <i32> [#uses=1]
- %tmp4246 = shl i32 %tmp4245, 2 ; <i32> [#uses=2]
- %tmp4247 = add i32 %tmp4246, 4 ; <i32> [#uses=1]
- %tmp4248 = icmp sgt i32 %tmp4247, -1 ; <i1> [#uses=1]
- %tmp4247.op = add i32 %tmp4246, 7 ; <i32> [#uses=1]
- %tmp4247.op.op = and i32 %tmp4247.op, -4 ; <i32> [#uses=1]
- %tmp4251 = select i1 %tmp4248, i32 %tmp4247.op.op, i32 0 ; <i32> [#uses=1]
- %tmp4253 = alloca i8, i32 %tmp4251 ; <i8*> [#uses=2]
- %tmp42534254 = bitcast i8* %tmp4253 to i32* ; <i32*> [#uses=1]
- br i1 %tmp4231, label %bb4276, label %cond_next4266.preheader
-
-cond_next4266.preheader: ; preds = %cond_next4189
- %J152b.36147.3 = add i32 %tmp4180, 1 ; <i32> [#uses=1]
- br label %cond_next4266
-
-cond_next4266: ; preds = %cond_next4266, %cond_next4266.preheader
- %indvar6268 = phi i32 [ 0, %cond_next4266.preheader ], [ %indvar.next22, %cond_next4266 ] ; <i32> [#uses=3]
- %tmp4273 = getelementptr i32* %tmp42534254, i32 %indvar6268 ; <i32*> [#uses=1]
- store i32 5, i32* %tmp4273
- %tmp4275 = add i32 %J152b.36147.3, %indvar6268 ; <i32> [#uses=1]
- %tmp42626151 = icmp sgt i32 %tmp4275, 2 ; <i1> [#uses=1]
- %indvar.next22 = add i32 %indvar6268, 1 ; <i32> [#uses=1]
- br i1 %tmp42626151, label %bb4276, label %cond_next4266
-
-bb4276: ; preds = %cond_next4266, %cond_next4189
- %tmp4280 = sub i32 2, %tmp4180 ; <i32> [#uses=1]
- %tmp4281 = icmp eq i32 %tmp4280, 1 ; <i1> [#uses=1]
- br i1 %tmp4281, label %cond_true4284, label %cleanup4336
-
-cond_true4284: ; preds = %bb4276
- %tmp4288 = call i32 (i8*, i8*, i32, ...)* @memcmp( i8* %tmp4253, i8* bitcast ([2 x i32]* @C.143.1720 to i8*), i32 8 ) ; <i32> [#uses=1]
- %tmp4289 = icmp eq i32 %tmp4288, 0 ; <i1> [#uses=1]
- br i1 %tmp4289, label %cond_true4292, label %cleanup4336
-
-cond_true4292: ; preds = %cond_true4284
- invoke void @report__failed( i64 or (i64 zext (i32 ptrtoint ([37 x i8]* @.str29 to i32) to i64), i64 shl (i64 zext (i32 ptrtoint (%struct.string___XUB* @C.146.1725 to i32) to i64), i64 32)) )
- to label %cleanup4336 unwind label %unwind4175
-
-eh_then4307: ; preds = %unwind4175
- invoke void @__gnat_begin_handler( i8* %eh_ptr4176 )
- to label %invcont4313 unwind label %unwind4311
-
-unwind4311: ; preds = %invcont4315, %invcont4313, %eh_then4307
- %eh_ptr4312 = call i8* @llvm.eh.exception( ) ; <i8*> [#uses=1]
- invoke void @__gnat_end_handler( i8* %eh_ptr4176 )
- to label %cleanup4334 unwind label %unwind4326
-
-invcont4313: ; preds = %eh_then4307
- %tmp4314 = load void ()** @system__soft_links__abort_undefer ; <void ()*> [#uses=1]
- invoke void %tmp4314( )
- to label %invcont4315 unwind label %unwind4311
-
-invcont4315: ; preds = %invcont4313
- invoke void @report__failed( i64 or (i64 zext (i32 ptrtoint ([18 x i8]* @.str30 to i32) to i64), i64 shl (i64 zext (i32 ptrtoint (%struct.string___XUB* @C.124.1606 to i32) to i64), i64 32)) )
- to label %cleanup4324 unwind label %unwind4311
-
-cleanup4324: ; preds = %invcont4315
- invoke void @__gnat_end_handler( i8* %eh_ptr4176 )
- to label %cleanup4336 unwind label %unwind4326
-
-unwind4326: ; preds = %cleanup4324, %unwind4311
- %eh_ptr4327 = call i8* @llvm.eh.exception( ) ; <i8*> [#uses=1]
- call void @llvm.stackrestore( i8* %tmp4174 )
- call i32 (...)* @_Unwind_Resume( i8* %eh_ptr4327 ) ; <i32>:19 [#uses=0]
- unreachable
-
-cleanup4334: ; preds = %unwind4311, %unwind4175
- %eh_exception.50 = phi i8* [ %eh_ptr4176, %unwind4175 ], [ %eh_ptr4312, %unwind4311 ] ; <i8*> [#uses=1]
- call void @llvm.stackrestore( i8* %tmp4174 )
- call i32 (...)* @_Unwind_Resume( i8* %eh_exception.50 ) ; <i32>:20 [#uses=0]
- unreachable
-
-cleanup4336: ; preds = %cleanup4324, %cond_true4292, %cond_true4284, %bb4276
- call void @llvm.stackrestore( i8* %tmp4174 )
- %tmp4338 = call i8* @llvm.stacksave( ) ; <i8*> [#uses=6]
- %tmp4379 = alloca i8, i32 %max1395 ; <i8*> [#uses=9]
- %tmp4421 = alloca i8, i32 %max1395 ; <i8*> [#uses=3]
- %tmp4428 = icmp ugt i8 %tmp204205, %tmp272273 ; <i1> [#uses=1]
- br i1 %tmp4428, label %cond_next4458, label %bb4433
-
-bb4433: ; preds = %cleanup4336
- store i8 %wed.4, i8* %tmp4421
- %tmp4442 = icmp eq i8 %tmp272273, %tmp204205 ; <i1> [#uses=1]
- br i1 %tmp4442, label %cond_next4458, label %cond_next4446.preheader
-
-cond_next4446.preheader: ; preds = %bb4433
- %J161b.26152.2 = add i8 %tmp204205, 1 ; <i8> [#uses=1]
- br label %cond_next4446
-
-cond_next4446: ; preds = %cond_next4446, %cond_next4446.preheader
- %indvar6271 = phi i8 [ 0, %cond_next4446.preheader ], [ %indvar.next24, %cond_next4446 ] ; <i8> [#uses=2]
- %tmp4448 = add i8 %J161b.26152.2, %indvar6271 ; <i8> [#uses=2]
- %tmp443444356156 = zext i8 %tmp4448 to i32 ; <i32> [#uses=1]
- %tmp44376157 = sub i32 %tmp443444356156, %tmp13571358 ; <i32> [#uses=1]
- %tmp44386158 = getelementptr i8* %tmp4421, i32 %tmp44376157 ; <i8*> [#uses=1]
- store i8 %wed.4, i8* %tmp44386158
- %tmp44426160 = icmp eq i8 %tmp272273, %tmp4448 ; <i1> [#uses=1]
- %indvar.next24 = add i8 %indvar6271, 1 ; <i8> [#uses=1]
- br i1 %tmp44426160, label %cond_next4458, label %cond_next4446
-
-unwind4453: ; preds = %cond_true4609, %cond_true4504, %cond_true4481
- %eh_ptr4454 = call i8* @llvm.eh.exception( ) ; <i8*> [#uses=4]
- %eh_select4456 = call i32 (i8*, i8*, ...)* @llvm.eh.selector.i32( i8* %eh_ptr4454, i8* bitcast (i32 (...)* @__gnat_eh_personality to i8*), i32* @__gnat_others_value ) ; <i32> [#uses=1]
- %eh_typeid4710 = call i32 @llvm.eh.typeid.for.i32( i8* bitcast (i32* @__gnat_others_value to i8*) ) ; <i32> [#uses=1]
- %tmp4712 = icmp eq i32 %eh_select4456, %eh_typeid4710 ; <i1> [#uses=1]
- br i1 %tmp4712, label %eh_then4713, label %cleanup4740
-
-cond_next4458: ; preds = %cond_next4446, %bb4433, %cleanup4336
- call void @llvm.memcpy.i32( i8* %tmp4379, i8* %tmp4421, i32 %max1395, i32 1 )
- %tmp4464 = icmp ult i8 %tmp137138, %mon.4 ; <i1> [#uses=2]
- br i1 %tmp4464, label %cond_next4484, label %cond_true4467
-
-cond_true4467: ; preds = %cond_next4458
- %tmp4470 = icmp ult i8 %mon.4, %tmp204205 ; <i1> [#uses=1]
- %tmp4474 = icmp ugt i8 %tmp137138, %tmp272273 ; <i1> [#uses=1]
- %tmp4478 = or i1 %tmp4470, %tmp4474 ; <i1> [#uses=1]
- br i1 %tmp4478, label %cond_true4481, label %cond_next4484
-
-cond_true4481: ; preds = %cond_true4467
- invoke void @__gnat_rcheck_12( i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0), i32 340 )
- to label %UnifiedUnreachableBlock34 unwind label %unwind4453
-
-cond_next4484: ; preds = %cond_true4467, %cond_next4458
- %tmp4487 = icmp ult i8 %mon.4, %tue.4 ; <i1> [#uses=2]
- br i1 %tmp4487, label %cond_next4507, label %cond_true4490
-
-cond_true4490: ; preds = %cond_next4484
- %tmp4493 = icmp ult i8 %tue.4, %tmp204205 ; <i1> [#uses=1]
- %tmp4497 = icmp ugt i8 %mon.4, %tmp272273 ; <i1> [#uses=1]
- %tmp4501 = or i1 %tmp4497, %tmp4493 ; <i1> [#uses=1]
- br i1 %tmp4501, label %cond_true4504, label %cond_next4507
-
-cond_true4504: ; preds = %cond_true4490
- invoke void @__gnat_rcheck_12( i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0), i32 340 )
- to label %UnifiedUnreachableBlock34 unwind label %unwind4453
-
-cond_next4507: ; preds = %cond_true4490, %cond_next4484
- %tmp45904591 = zext i8 %mon.4 to i64 ; <i64> [#uses=3]
- %tmp45924593 = zext i8 %tue.4 to i64 ; <i64> [#uses=1]
- %tmp4594 = sub i64 %tmp45904591, %tmp45924593 ; <i64> [#uses=1]
- %tmp4595 = add i64 %tmp4594, 1 ; <i64> [#uses=2]
- %tmp4596 = icmp sgt i64 %tmp4595, -1 ; <i1> [#uses=1]
- %max4597 = select i1 %tmp4596, i64 %tmp4595, i64 0 ; <i64> [#uses=1]
- %tmp45984599 = zext i8 %tmp137138 to i64 ; <i64> [#uses=1]
- %tmp4602 = sub i64 %tmp45984599, %tmp45904591 ; <i64> [#uses=1]
- %tmp4603 = add i64 %tmp4602, 1 ; <i64> [#uses=3]
- %tmp4604 = icmp sgt i64 %tmp4603, -1 ; <i1> [#uses=2]
- %max4605 = select i1 %tmp4604, i64 %tmp4603, i64 0 ; <i64> [#uses=1]
- %tmp4606 = icmp eq i64 %max4597, %max4605 ; <i1> [#uses=1]
- br i1 %tmp4606, label %cond_next4611, label %cond_true4609
-
-cond_true4609: ; preds = %cond_next4507
- invoke void @__gnat_rcheck_07( i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0), i32 340 )
- to label %UnifiedUnreachableBlock34 unwind label %unwind4453
-
-cond_next4611: ; preds = %cond_next4507
- %tmp46124613 = zext i8 %tue.4 to i32 ; <i32> [#uses=1]
- %tmp4616 = sub i32 %tmp46124613, %tmp13571358 ; <i32> [#uses=2]
- %tmp46244625 = zext i8 %mon.4 to i32 ; <i32> [#uses=1]
- %tmp4628 = sub i32 %tmp46244625, %tmp13571358 ; <i32> [#uses=3]
- %tmp4636 = icmp slt i32 %tmp4628, %tmp4616 ; <i1> [#uses=1]
- %tmp4677 = icmp ugt i8 %tue.4, %mon.4 ; <i1> [#uses=2]
- br i1 %tmp4636, label %cond_false4673, label %cond_true4639
-
-cond_true4639: ; preds = %cond_next4611
- br i1 %tmp4677, label %cleanup4742, label %bb4648.preheader
-
-bb4648.preheader: ; preds = %cond_true4639
- %tmp46556217 = getelementptr i8* %tmp4379, i32 %tmp4628 ; <i8*> [#uses=1]
- %tmp46566218 = load i8* %tmp46556217 ; <i8> [#uses=1]
- %tmp46596220 = getelementptr i8* %tmp4379, i32 %tmp4616 ; <i8*> [#uses=1]
- store i8 %tmp46566218, i8* %tmp46596220
- %tmp46646223 = icmp eq i8 %tue.4, %mon.4 ; <i1> [#uses=1]
- br i1 %tmp46646223, label %cleanup4742, label %cond_next4668.preheader
-
-cond_next4668.preheader: ; preds = %bb4648.preheader
- %tmp46616222.in = add i8 %mon.4, 1 ; <i8> [#uses=1]
- %L174b.26213 = add i8 %tue.4, 1 ; <i8> [#uses=1]
- %tmp.27 = sub i8 %mon.4, %tue.4 ; <i8> [#uses=1]
- br label %cond_next4668
-
-cond_next4668: ; preds = %cond_next4668, %cond_next4668.preheader
- %indvar6275 = phi i8 [ 0, %cond_next4668.preheader ], [ %indvar.next26, %cond_next4668 ] ; <i8> [#uses=3]
- %tmp46616222 = add i8 %tmp46616222.in, %indvar6275 ; <i8> [#uses=1]
- %tmp4670 = add i8 %L174b.26213, %indvar6275 ; <i8> [#uses=1]
- %tmp46494650 = zext i8 %tmp4670 to i32 ; <i32> [#uses=1]
- %tmp46514652 = zext i8 %tmp46616222 to i32 ; <i32> [#uses=1]
- %tmp4654 = sub i32 %tmp46514652, %tmp13571358 ; <i32> [#uses=1]
- %tmp4655 = getelementptr i8* %tmp4379, i32 %tmp4654 ; <i8*> [#uses=1]
- %tmp4656 = load i8* %tmp4655 ; <i8> [#uses=1]
- %tmp4658 = sub i32 %tmp46494650, %tmp13571358 ; <i32> [#uses=1]
- %tmp4659 = getelementptr i8* %tmp4379, i32 %tmp4658 ; <i8*> [#uses=1]
- store i8 %tmp4656, i8* %tmp4659
- %indvar.next26 = add i8 %indvar6275, 1 ; <i8> [#uses=2]
- %exitcond28 = icmp eq i8 %indvar.next26, %tmp.27 ; <i1> [#uses=1]
- br i1 %exitcond28, label %cleanup4742, label %cond_next4668
-
-cond_false4673: ; preds = %cond_next4611
- br i1 %tmp4677, label %cleanup4742, label %bb4682.preheader
-
-bb4682.preheader: ; preds = %cond_false4673
- %tmp468546866228 = and i32 %tmp123, 255 ; <i32> [#uses=1]
- %tmp46886229 = sub i32 %tmp468546866228, %tmp13571358 ; <i32> [#uses=1]
- %tmp46896230 = getelementptr i8* %tmp4379, i32 %tmp46886229 ; <i8*> [#uses=1]
- %tmp46906231 = load i8* %tmp46896230 ; <i8> [#uses=1]
- %tmp46936233 = getelementptr i8* %tmp4379, i32 %tmp4628 ; <i8*> [#uses=1]
- store i8 %tmp46906231, i8* %tmp46936233
- %tmp46986236 = icmp eq i8 %mon.4, %tue.4 ; <i1> [#uses=1]
- br i1 %tmp46986236, label %cleanup4742, label %cond_next4702.preheader
-
-cond_next4702.preheader: ; preds = %bb4682.preheader
- %tmp46956235.in = add i8 %tmp137138, -1 ; <i8> [#uses=1]
- %L172b.26226 = add i8 %mon.4, -1 ; <i8> [#uses=1]
- %tmp.32 = sub i8 %mon.4, %tue.4 ; <i8> [#uses=1]
- br label %cond_next4702
-
-cond_next4702: ; preds = %cond_next4702, %cond_next4702.preheader
- %indvar6278 = phi i8 [ 0, %cond_next4702.preheader ], [ %indvar.next30, %cond_next4702 ] ; <i8> [#uses=3]
- %tmp46956235 = sub i8 %tmp46956235.in, %indvar6278 ; <i8> [#uses=1]
- %tmp4704 = sub i8 %L172b.26226, %indvar6278 ; <i8> [#uses=1]
- %tmp46834684 = zext i8 %tmp4704 to i32 ; <i32> [#uses=1]
- %tmp46854686 = zext i8 %tmp46956235 to i32 ; <i32> [#uses=1]
- %tmp4688 = sub i32 %tmp46854686, %tmp13571358 ; <i32> [#uses=1]
- %tmp4689 = getelementptr i8* %tmp4379, i32 %tmp4688 ; <i8*> [#uses=1]
- %tmp4690 = load i8* %tmp4689 ; <i8> [#uses=1]
- %tmp4692 = sub i32 %tmp46834684, %tmp13571358 ; <i32> [#uses=1]
- %tmp4693 = getelementptr i8* %tmp4379, i32 %tmp4692 ; <i8*> [#uses=1]
- store i8 %tmp4690, i8* %tmp4693
- %indvar.next30 = add i8 %indvar6278, 1 ; <i8> [#uses=2]
- %exitcond33 = icmp eq i8 %indvar.next30, %tmp.32 ; <i1> [#uses=1]
- br i1 %exitcond33, label %cleanup4742, label %cond_next4702
-
-eh_then4713: ; preds = %unwind4453
- invoke void @__gnat_begin_handler( i8* %eh_ptr4454 )
- to label %invcont4719 unwind label %unwind4717
-
-unwind4717: ; preds = %invcont4719, %eh_then4713
- %eh_ptr4718 = call i8* @llvm.eh.exception( ) ; <i8*> [#uses=1]
- invoke void @__gnat_end_handler( i8* %eh_ptr4454 )
- to label %cleanup4740 unwind label %unwind4732
-
-invcont4719: ; preds = %eh_then4713
- %tmp4720 = load void ()** @system__soft_links__abort_undefer ; <void ()*> [#uses=1]
- invoke void %tmp4720( )
- to label %UnifiedReturnBlock35 unwind label %unwind4717
-
-unwind4732: ; preds = %unwind4717
- %eh_ptr4733 = call i8* @llvm.eh.exception( ) ; <i8*> [#uses=1]
- call void @llvm.stackrestore( i8* %tmp4338 )
- call void @llvm.stackrestore( i8* %tmp4338 )
- call i32 (...)* @_Unwind_Resume( i8* %eh_ptr4733 ) ; <i32>:21 [#uses=0]
- unreachable
-
-cleanup4740: ; preds = %unwind4717, %unwind4453
- %eh_exception.53 = phi i8* [ %eh_ptr4454, %unwind4453 ], [ %eh_ptr4718, %unwind4717 ] ; <i8*> [#uses=1]
- call void @llvm.stackrestore( i8* %tmp4338 )
- call void @llvm.stackrestore( i8* %tmp4338 )
- call i32 (...)* @_Unwind_Resume( i8* %eh_exception.53 ) ; <i32>:22 [#uses=0]
- unreachable
-
-cleanup4742: ; preds = %cond_next4702, %bb4682.preheader, %cond_false4673, %cond_next4668, %bb4648.preheader, %cond_true4639
- call void @llvm.stackrestore( i8* %tmp4338 )
- call void @llvm.stackrestore( i8* %tmp4338 )
- %tmp4749 = call i8* @llvm.stacksave( ) ; <i8*> [#uses=2]
- br i1 %tmp4464, label %cond_next4776, label %UnifiedReturnBlock35
-
-unwind4770: ; preds = %cond_next4776
- %eh_ptr4771 = call i8* @llvm.eh.exception( ) ; <i8*> [#uses=5]
- %eh_select4773 = call i32 (i8*, i8*, ...)* @llvm.eh.selector.i32( i8* %eh_ptr4771, i8* bitcast (i32 (...)* @__gnat_eh_personality to i8*), i32* @__gnat_others_value ) ; <i32> [#uses=1]
- call void @llvm.stackrestore( i8* %tmp4749 )
- %eh_typeid4874 = call i32 @llvm.eh.typeid.for.i32( i8* bitcast (i32* @__gnat_others_value to i8*) ) ; <i32> [#uses=1]
- %tmp4876 = icmp eq i32 %eh_select4773, %eh_typeid4874 ; <i1> [#uses=1]
- br i1 %tmp4876, label %eh_then4877, label %Unwind
-
-cond_next4776: ; preds = %cleanup4742
- %tmp4856.cast = trunc i64 %tmp4603 to i32 ; <i32> [#uses=1]
- %max48584859 = select i1 %tmp4604, i32 %tmp4856.cast, i32 0 ; <i32> [#uses=1]
- %tmp4861 = invoke i8 @report__equal( i32 %max48584859, i32 0 )
- to label %invcont4860 unwind label %unwind4770 ; <i8> [#uses=1]
-
-invcont4860: ; preds = %cond_next4776
- %tmp4862 = icmp eq i8 %tmp4861, 0 ; <i1> [#uses=1]
- %tue.8 = select i1 %tmp4862, i8 %tue.4, i8 2 ; <i8> [#uses=3]
- call void @llvm.stackrestore( i8* %tmp4749 )
- %tmp49016170 = icmp ult i8 %mon.4, %tue.8 ; <i1> [#uses=1]
- br i1 %tmp49016170, label %cond_next4925, label %cond_true4904
-
-eh_then4877: ; preds = %unwind4770
- invoke void @__gnat_begin_handler( i8* %eh_ptr4771 )
- to label %invcont4883 unwind label %unwind4881
-
-unwind4881: ; preds = %invcont4885, %invcont4883, %eh_then4877
- %eh_ptr4882 = call i8* @llvm.eh.exception( ) ; <i8*> [#uses=1]
- call void @__gnat_end_handler( i8* %eh_ptr4771 )
- call i32 (...)* @_Unwind_Resume( i8* %eh_ptr4882 ) ; <i32>:23 [#uses=0]
- unreachable
-
-invcont4883: ; preds = %eh_then4877
- %tmp4884 = load void ()** @system__soft_links__abort_undefer ; <void ()*> [#uses=1]
- invoke void %tmp4884( )
- to label %invcont4885 unwind label %unwind4881
-
-invcont4885: ; preds = %invcont4883
- invoke void @report__failed( i64 or (i64 zext (i32 ptrtoint ([18 x i8]* @.str32 to i32) to i64), i64 shl (i64 zext (i32 ptrtoint (%struct.string___XUB* @C.124.1606 to i32) to i64), i64 32)) )
- to label %cleanup4894 unwind label %unwind4881
-
-cleanup4894: ; preds = %invcont4885
- call void @__gnat_end_handler( i8* %eh_ptr4771 )
- br i1 %tmp4487, label %cond_next4925, label %cond_true4904
-
-cond_true4904: ; preds = %cleanup4894, %invcont4860
- %tue.96161.0 = phi i8 [ %tue.8, %invcont4860 ], [ %tue.4, %cleanup4894 ] ; <i8> [#uses=3]
- %tmp4907 = icmp ult i8 %tue.96161.0, %tmp204205 ; <i1> [#uses=1]
- %tmp4911 = icmp ugt i8 %mon.4, %tmp272273 ; <i1> [#uses=1]
- %tmp4915 = or i1 %tmp4907, %tmp4911 ; <i1> [#uses=1]
- br i1 %tmp4915, label %cond_true4918, label %cond_next4925
-
-cond_true4918: ; preds = %cond_true4904
- invoke void @__gnat_rcheck_12( i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0), i32 361 )
- to label %UnifiedUnreachableBlock34 unwind label %unwind4919
-
-unwind4919: ; preds = %cond_next4925, %cond_true4918
- %tue.96161.2 = phi i8 [ %tue.96161.0, %cond_true4918 ], [ %tue.96161.1, %cond_next4925 ] ; <i8> [#uses=1]
- %eh_ptr4920 = call i8* @llvm.eh.exception( ) ; <i8*> [#uses=5]
- %eh_select4922 = call i32 (i8*, i8*, ...)* @llvm.eh.selector.i32( i8* %eh_ptr4920, i8* bitcast (i32 (...)* @__gnat_eh_personality to i8*), i32* @__gnat_others_value ) ; <i32> [#uses=1]
- %eh_typeid4987 = call i32 @llvm.eh.typeid.for.i32( i8* bitcast (i32* @__gnat_others_value to i8*) ) ; <i32> [#uses=1]
- %tmp4989 = icmp eq i32 %eh_select4922, %eh_typeid4987 ; <i1> [#uses=1]
- br i1 %tmp4989, label %eh_then4990, label %Unwind
-
-cond_next4925: ; preds = %cond_true4904, %cleanup4894, %invcont4860
- %tue.96161.1 = phi i8 [ %tue.8, %invcont4860 ], [ %tue.4, %cleanup4894 ], [ %tue.96161.0, %cond_true4904 ] ; <i8> [#uses=6]
- %tmp49714972 = zext i8 %tue.96161.1 to i64 ; <i64> [#uses=1]
- %tmp4973 = sub i64 %tmp45904591, %tmp49714972 ; <i64> [#uses=1]
- %tmp4974 = add i64 %tmp4973, 1 ; <i64> [#uses=2]
- %tmp4975 = icmp sgt i64 %tmp4974, -1 ; <i1> [#uses=1]
- %tmp4974.cast = trunc i64 %tmp4974 to i32 ; <i32> [#uses=1]
- %max49764977 = select i1 %tmp4975, i32 %tmp4974.cast, i32 0 ; <i32> [#uses=1]
- %tmp4979 = invoke i8 @report__equal( i32 %max49764977, i32 0 )
- to label %invcont4978 unwind label %unwind4919 ; <i8> [#uses=1]
-
-invcont4978: ; preds = %cond_next4925
- %tmp4980 = icmp eq i8 %tmp4979, 0 ; <i1> [#uses=1]
- br i1 %tmp4980, label %finally4985, label %cond_true4983
-
-cond_true4983: ; preds = %invcont4978
- %tmp50146178 = icmp ugt i8 %tue.96161.1, 1 ; <i1> [#uses=1]
- br i1 %tmp50146178, label %cond_next5038, label %cond_true5017
-
-eh_then4990: ; preds = %unwind4919
- invoke void @__gnat_begin_handler( i8* %eh_ptr4920 )
- to label %invcont4996 unwind label %unwind4994
-
-unwind4994: ; preds = %invcont4998, %invcont4996, %eh_then4990
- %eh_ptr4995 = call i8* @llvm.eh.exception( ) ; <i8*> [#uses=1]
- call void @__gnat_end_handler( i8* %eh_ptr4920 )
- call i32 (...)* @_Unwind_Resume( i8* %eh_ptr4995 ) ; <i32>:24 [#uses=0]
- unreachable
-
-invcont4996: ; preds = %eh_then4990
- %tmp4997 = load void ()** @system__soft_links__abort_undefer ; <void ()*> [#uses=1]
- invoke void %tmp4997( )
- to label %invcont4998 unwind label %unwind4994
-
-invcont4998: ; preds = %invcont4996
- invoke void @report__failed( i64 or (i64 zext (i32 ptrtoint ([19 x i8]* @.str33 to i32) to i64), i64 shl (i64 zext (i32 ptrtoint (%struct.string___XUB* @C.170.1990 to i32) to i64), i64 32)) )
- to label %cleanup5007 unwind label %unwind4994
-
-cleanup5007: ; preds = %invcont4998
- call void @__gnat_end_handler( i8* %eh_ptr4920 )
- br label %finally4985
-
-finally4985: ; preds = %cleanup5007, %invcont4978
- %tue.96161.3 = phi i8 [ %tue.96161.2, %cleanup5007 ], [ %tue.96161.1, %invcont4978 ] ; <i8> [#uses=3]
- %tmp5014 = icmp ult i8 %mon.4, %tue.96161.3 ; <i1> [#uses=1]
- br i1 %tmp5014, label %cond_next5038, label %cond_true5017
-
-cond_true5017: ; preds = %finally4985, %cond_true4983
- %tue.96161.4 = phi i8 [ %tue.96161.1, %cond_true4983 ], [ %tue.96161.3, %finally4985 ] ; <i8> [#uses=3]
- %mon.86171.0 = phi i8 [ 1, %cond_true4983 ], [ %mon.4, %finally4985 ] ; <i8> [#uses=3]
- %tmp5020 = icmp ult i8 %tue.96161.4, %tmp204205 ; <i1> [#uses=1]
- %tmp5024 = icmp ugt i8 %mon.86171.0, %tmp272273 ; <i1> [#uses=1]
- %tmp5028 = or i1 %tmp5024, %tmp5020 ; <i1> [#uses=1]
- br i1 %tmp5028, label %cond_true5031, label %cond_next5038
-
-cond_true5031: ; preds = %cond_true5017
- invoke void @__gnat_rcheck_12( i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0), i32 375 )
- to label %UnifiedUnreachableBlock34 unwind label %unwind5032
-
-unwind5032: ; preds = %cond_next5038, %cond_true5031
- %tue.96161.6 = phi i8 [ %tue.96161.4, %cond_true5031 ], [ %tue.96161.5, %cond_next5038 ] ; <i8> [#uses=1]
- %mon.86171.2 = phi i8 [ %mon.86171.0, %cond_true5031 ], [ %mon.86171.1, %cond_next5038 ] ; <i8> [#uses=1]
- %eh_ptr5033 = call i8* @llvm.eh.exception( ) ; <i8*> [#uses=5]
- %eh_select5035 = call i32 (i8*, i8*, ...)* @llvm.eh.selector.i32( i8* %eh_ptr5033, i8* bitcast (i32 (...)* @__gnat_eh_personality to i8*), i32* @__gnat_others_value ) ; <i32> [#uses=1]
- %eh_typeid5100 = call i32 @llvm.eh.typeid.for.i32( i8* bitcast (i32* @__gnat_others_value to i8*) ) ; <i32> [#uses=1]
- %tmp5102 = icmp eq i32 %eh_select5035, %eh_typeid5100 ; <i1> [#uses=1]
- br i1 %tmp5102, label %eh_then5103, label %Unwind
-
-cond_next5038: ; preds = %cond_true5017, %finally4985, %cond_true4983
- %tue.96161.5 = phi i8 [ %tue.96161.1, %cond_true4983 ], [ %tue.96161.3, %finally4985 ], [ %tue.96161.4, %cond_true5017 ] ; <i8> [#uses=4]
- %mon.86171.1 = phi i8 [ 1, %cond_true4983 ], [ %mon.4, %finally4985 ], [ %mon.86171.0, %cond_true5017 ] ; <i8> [#uses=4]
- %tmp50825083 = zext i8 %mon.86171.1 to i64 ; <i64> [#uses=1]
- %tmp50845085 = zext i8 %tue.96161.5 to i64 ; <i64> [#uses=1]
- %tmp5086 = sub i64 %tmp50825083, %tmp50845085 ; <i64> [#uses=1]
- %tmp5087 = add i64 %tmp5086, 1 ; <i64> [#uses=2]
- %tmp5088 = icmp sgt i64 %tmp5087, -1 ; <i1> [#uses=1]
- %tmp5087.cast = trunc i64 %tmp5087 to i32 ; <i32> [#uses=1]
- %max50895090 = select i1 %tmp5088, i32 %tmp5087.cast, i32 0 ; <i32> [#uses=1]
- %tmp5092 = invoke i8 @report__equal( i32 %max50895090, i32 0 )
- to label %invcont5091 unwind label %unwind5032 ; <i8> [#uses=1]
-
-invcont5091: ; preds = %cond_next5038
- %tmp5093 = icmp eq i8 %tmp5092, 0 ; <i1> [#uses=1]
- br i1 %tmp5093, label %finally5098, label %cond_true5096
-
-cond_true5096: ; preds = %invcont5091
- br label %finally5098
-
-eh_then5103: ; preds = %unwind5032
- invoke void @__gnat_begin_handler( i8* %eh_ptr5033 )
- to label %invcont5109 unwind label %unwind5107
-
-unwind5107: ; preds = %invcont5111, %invcont5109, %eh_then5103
- %eh_ptr5108 = call i8* @llvm.eh.exception( ) ; <i8*> [#uses=1]
- call void @__gnat_end_handler( i8* %eh_ptr5033 )
- call i32 (...)* @_Unwind_Resume( i8* %eh_ptr5108 ) ; <i32>:25 [#uses=0]
- unreachable
-
-invcont5109: ; preds = %eh_then5103
- %tmp5110 = load void ()** @system__soft_links__abort_undefer ; <void ()*> [#uses=1]
- invoke void %tmp5110( )
- to label %invcont5111 unwind label %unwind5107
-
-invcont5111: ; preds = %invcont5109
- invoke void @report__failed( i64 or (i64 zext (i32 ptrtoint ([19 x i8]* @.str34 to i32) to i64), i64 shl (i64 zext (i32 ptrtoint (%struct.string___XUB* @C.170.1990 to i32) to i64), i64 32)) )
- to label %cleanup5120 unwind label %unwind5107
-
-cleanup5120: ; preds = %invcont5111
- call void @__gnat_end_handler( i8* %eh_ptr5033 )
- br label %finally5098
-
-finally5098: ; preds = %cleanup5120, %cond_true5096, %invcont5091
- %tue.96161.7 = phi i8 [ %tue.96161.6, %cleanup5120 ], [ %tue.96161.5, %cond_true5096 ], [ %tue.96161.5, %invcont5091 ] ; <i8> [#uses=1]
- %mon.86171.3 = phi i8 [ %mon.86171.2, %cleanup5120 ], [ %mon.86171.1, %cond_true5096 ], [ %mon.86171.1, %invcont5091 ] ; <i8> [#uses=2]
- %wed.6 = phi i8 [ %wed.4, %cleanup5120 ], [ 3, %cond_true5096 ], [ %wed.4, %invcont5091 ] ; <i8> [#uses=5]
- %not.tmp5135 = icmp uge i8 %tmp137138, %sat.45934.0 ; <i1> [#uses=1]
- %tmp5151 = icmp uge i8 %sat.45934.0, %tmp306307 ; <i1> [#uses=1]
- %tmp5155 = icmp ule i8 %sat.45934.0, %wed.6 ; <i1> [#uses=1]
- %tmp5159 = and i1 %tmp5155, %tmp5151 ; <i1> [#uses=1]
- %tmp5177 = icmp ult i8 %wed.6, %tmp272273 ; <i1> [#uses=1]
- %tmp5184 = icmp ugt i8 %wed.6, %tue.96161.7 ; <i1> [#uses=1]
- %bothcond5907 = or i1 %tmp5177, %tmp5184 ; <i1> [#uses=2]
- %not.bothcond5907 = xor i1 %bothcond5907, true ; <i1> [#uses=1]
- %tmp5198 = icmp uge i8 %tmp272273, %mon.86171.3 ; <i1> [#uses=1]
- %tmp5202 = icmp ule i8 %tmp272273, %tmp137138 ; <i1> [#uses=1]
- %tmp5206 = and i1 %tmp5198, %tmp5202 ; <i1> [#uses=1]
- %not.bothcond5908 = icmp uge i8 %tmp306307, %sat.45934.0 ; <i1> [#uses=1]
- %tmp5244 = icmp uge i8 %wed.6, %tmp306307 ; <i1> [#uses=1]
- %tmp5248 = icmp ule i8 %wed.6, %mon.86171.3 ; <i1> [#uses=1]
- %tmp5252 = and i1 %tmp5244, %tmp5248 ; <i1> [#uses=1]
- %tmp5164 = or i1 %not.tmp5135, %not.bothcond5908 ; <i1> [#uses=1]
- %tmp5194 = or i1 %tmp5164, %tmp5206 ; <i1> [#uses=1]
- %tmp5210 = or i1 %tmp5194, %tmp5159 ; <i1> [#uses=1]
- %tmp5240 = or i1 %tmp5210, %not.bothcond5907 ; <i1> [#uses=1]
- %tmp5256 = or i1 %tmp5240, %tmp5252 ; <i1> [#uses=1]
- br i1 %tmp5256, label %cond_true5259, label %cond_next5271
-
-cond_true5259: ; preds = %finally5098
- invoke void @report__failed( i64 or (i64 zext (i32 ptrtoint ([27 x i8]* @.str35 to i32) to i64), i64 shl (i64 zext (i32 ptrtoint (%struct.string___XUB* @C.178.2066 to i32) to i64), i64 32)) )
- to label %cond_next5271 unwind label %unwind5266
-
-unwind5266: ; preds = %cond_true5462, %invcont5429, %cond_next5401, %cond_true5393, %cond_next5374, %bb5359, %cond_next5347, %invcont5330, %invcont5305, %invcont5303, %invcont5294, %bb5293, %cond_next5281, %cond_next5271, %cond_true5259
- %eh_ptr5267 = call i8* @llvm.eh.exception( ) ; <i8*> [#uses=5]
- %eh_select5269 = call i32 (i8*, i8*, ...)* @llvm.eh.selector.i32( i8* %eh_ptr5267, i8* bitcast (i32 (...)* @__gnat_eh_personality to i8*), i32* @__gnat_others_value ) ; <i32> [#uses=1]
- %eh_typeid5473 = call i32 @llvm.eh.typeid.for.i32( i8* bitcast (i32* @__gnat_others_value to i8*) ) ; <i32> [#uses=1]
- %tmp5475 = icmp eq i32 %eh_select5269, %eh_typeid5473 ; <i1> [#uses=1]
- br i1 %tmp5475, label %eh_then5476, label %Unwind
-
-cond_next5271: ; preds = %cond_true5259, %finally5098
- %tmp5273 = invoke i32 @report__ident_int( i32 0 )
- to label %invcont5272 unwind label %unwind5266 ; <i32> [#uses=2]
-
-invcont5272: ; preds = %cond_next5271
- %tmp5277 = icmp slt i32 %tmp5273, 10 ; <i1> [#uses=1]
- br i1 %tmp5277, label %bb5292, label %cond_next5281
-
-cond_next5281: ; preds = %invcont5272
- %tmp5283 = invoke i32 @report__ident_int( i32 -10 )
- to label %invcont5282 unwind label %unwind5266 ; <i32> [#uses=1]
-
-invcont5282: ; preds = %cond_next5281
- %tmp5287 = icmp sgt i32 %tmp5273, %tmp5283 ; <i1> [#uses=1]
- br i1 %tmp5287, label %bb5292, label %bb5293
-
-bb5292: ; preds = %invcont5282, %invcont5272
- br label %bb5293
-
-bb5293: ; preds = %bb5292, %invcont5282
- %iftmp.179.0 = phi i1 [ false, %bb5292 ], [ true, %invcont5282 ] ; <i1> [#uses=1]
- %tmp5295 = invoke i32 @report__ident_int( i32 10 )
- to label %invcont5294 unwind label %unwind5266 ; <i32> [#uses=1]
-
-invcont5294: ; preds = %bb5293
- %tmp5296 = icmp slt i32 %tmp5295, 1 ; <i1> [#uses=1]
- %tmp5304 = invoke i32 @report__ident_int( i32 0 )
- to label %invcont5303 unwind label %unwind5266 ; <i32> [#uses=2]
-
-invcont5303: ; preds = %invcont5294
- %tmp5306 = invoke i32 @report__ident_int( i32 -10 )
- to label %invcont5305 unwind label %unwind5266 ; <i32> [#uses=1]
-
-invcont5305: ; preds = %invcont5303
- %tmp5331 = invoke i32 @report__ident_int( i32 -20 )
- to label %invcont5330 unwind label %unwind5266 ; <i32> [#uses=1]
-
-invcont5330: ; preds = %invcont5305
- %tmp5310 = icmp slt i32 %tmp5304, %tmp5306 ; <i1> [#uses=1]
- %tmp5318 = icmp sgt i32 %tmp5304, -11 ; <i1> [#uses=1]
- %bothcond5909 = or i1 %tmp5310, %tmp5318 ; <i1> [#uses=1]
- %not.bothcond5909 = xor i1 %bothcond5909, true ; <i1> [#uses=1]
- %tmp5332 = icmp sgt i32 %tmp5331, -1 ; <i1> [#uses=1]
- %tmp5339 = invoke i32 @report__ident_int( i32 0 )
- to label %invcont5338 unwind label %unwind5266 ; <i32> [#uses=2]
-
-invcont5338: ; preds = %invcont5330
- %tmp5343 = icmp slt i32 %tmp5339, 6 ; <i1> [#uses=1]
- br i1 %tmp5343, label %bb5358, label %cond_next5347
-
-cond_next5347: ; preds = %invcont5338
- %tmp5349 = invoke i32 @report__ident_int( i32 5 )
- to label %invcont5348 unwind label %unwind5266 ; <i32> [#uses=1]
-
-invcont5348: ; preds = %cond_next5347
- %tmp5353 = icmp sgt i32 %tmp5339, %tmp5349 ; <i1> [#uses=1]
- br i1 %tmp5353, label %bb5358, label %bb5359
-
-bb5358: ; preds = %invcont5348, %invcont5338
- br label %bb5359
-
-bb5359: ; preds = %bb5358, %invcont5348
- %iftmp.181.0 = phi i1 [ false, %bb5358 ], [ true, %invcont5348 ] ; <i1> [#uses=1]
- %tmp5366 = invoke i32 @report__ident_int( i32 0 )
- to label %invcont5365 unwind label %unwind5266 ; <i32> [#uses=2]
-
-invcont5365: ; preds = %bb5359
- %tmp5370 = icmp slt i32 %tmp5366, 7 ; <i1> [#uses=1]
- br i1 %tmp5370, label %bb5385, label %cond_next5374
-
-cond_next5374: ; preds = %invcont5365
- %tmp5376 = invoke i32 @report__ident_int( i32 3 )
- to label %invcont5375 unwind label %unwind5266 ; <i32> [#uses=1]
-
-invcont5375: ; preds = %cond_next5374
- %tmp5380 = icmp sgt i32 %tmp5366, %tmp5376 ; <i1> [#uses=1]
- br i1 %tmp5380, label %bb5385, label %bb5386
-
-bb5385: ; preds = %invcont5375, %invcont5365
- br label %bb5386
-
-bb5386: ; preds = %bb5385, %invcont5375
- %iftmp.182.0 = phi i1 [ false, %bb5385 ], [ true, %invcont5375 ] ; <i1> [#uses=1]
- %tmp5301 = or i1 %tmp5296, %iftmp.179.0 ; <i1> [#uses=1]
- %tmp5328 = or i1 %tmp5301, %not.bothcond5909 ; <i1> [#uses=1]
- %tmp5336 = or i1 %tmp5328, %tmp5332 ; <i1> [#uses=1]
- %tmp5363 = or i1 %tmp5336, %iftmp.181.0 ; <i1> [#uses=1]
- %tmp5390 = or i1 %tmp5363, %iftmp.182.0 ; <i1> [#uses=1]
- br i1 %tmp5390, label %cond_true5393, label %cond_next5401
-
-cond_true5393: ; preds = %bb5386
- invoke void @report__failed( i64 or (i64 zext (i32 ptrtoint ([27 x i8]* @.str36 to i32) to i64), i64 shl (i64 zext (i32 ptrtoint (%struct.string___XUB* @C.178.2066 to i32) to i64), i64 32)) )
- to label %cond_next5401 unwind label %unwind5266
-
-cond_next5401: ; preds = %cond_true5393, %bb5386
- %tmp5430 = invoke i32 @report__ident_int( i32 0 )
- to label %invcont5429 unwind label %unwind5266 ; <i32> [#uses=2]
-
-invcont5429: ; preds = %cond_next5401
- %tmp5432 = invoke i32 @report__ident_int( i32 4 )
- to label %invcont5431 unwind label %unwind5266 ; <i32> [#uses=1]
-
-invcont5431: ; preds = %invcont5429
- %tmp5436 = icmp slt i32 %tmp5430, %tmp5432 ; <i1> [#uses=1]
- %tmp5444 = icmp sgt i32 %tmp5430, -4 ; <i1> [#uses=1]
- %bothcond5911 = or i1 %tmp5436, %tmp5444 ; <i1> [#uses=1]
- %tmp5457 = and i1 %bothcond5911, %bothcond5907 ; <i1> [#uses=1]
- br i1 %tmp5457, label %finally5471, label %cond_true5462
-
-cond_true5462: ; preds = %invcont5431
- invoke void @report__failed( i64 or (i64 zext (i32 ptrtoint ([29 x i8]* @.str37 to i32) to i64), i64 shl (i64 zext (i32 ptrtoint (%struct.string___XUB* @C.36.923 to i32) to i64), i64 32)) )
- to label %finally5471 unwind label %unwind5266
-
-eh_then5476: ; preds = %unwind5266
- invoke void @__gnat_begin_handler( i8* %eh_ptr5267 )
- to label %invcont5482 unwind label %unwind5480
-
-unwind5480: ; preds = %invcont5484, %invcont5482, %eh_then5476
- %eh_ptr5481 = call i8* @llvm.eh.exception( ) ; <i8*> [#uses=1]
- call void @__gnat_end_handler( i8* %eh_ptr5267 )
- call i32 (...)* @_Unwind_Resume( i8* %eh_ptr5481 ) ; <i32>:26 [#uses=0]
- unreachable
-
-invcont5482: ; preds = %eh_then5476
- %tmp5483 = load void ()** @system__soft_links__abort_undefer ; <void ()*> [#uses=1]
- invoke void %tmp5483( )
- to label %invcont5484 unwind label %unwind5480
-
-invcont5484: ; preds = %invcont5482
- invoke void @report__failed( i64 or (i64 zext (i32 ptrtoint ([19 x i8]* @.str38 to i32) to i64), i64 shl (i64 zext (i32 ptrtoint (%struct.string___XUB* @C.170.1990 to i32) to i64), i64 32)) )
- to label %cleanup5493 unwind label %unwind5480
-
-cleanup5493: ; preds = %invcont5484
- call void @__gnat_end_handler( i8* %eh_ptr5267 )
- call void @report__result( )
- ret void
-
-finally5471: ; preds = %cond_true5462, %invcont5431
- call void @report__result( )
- ret void
-
-Unwind: ; preds = %unwind5266, %unwind5032, %unwind4919, %unwind4770, %unwind3880, %unwind3618, %unwind3393, %eh_else3366, %eh_else3016, %eh_else2666, %eh_else1330, %eh_else932, %eh_else823
- %eh_exception.2 = phi i8* [ %eh_exception.05914.1, %eh_else823 ], [ %eh_ptr872, %eh_else932 ], [ %eh_ptr975, %eh_else1330 ], [ %eh_exception.296030.1, %eh_else2666 ], [ %eh_exception.336046.1, %eh_else3016 ], [ %eh_exception.396074.1, %eh_else3366 ], [ %eh_ptr3394, %unwind3393 ], [ %eh_ptr3619, %unwind3618 ], [ %eh_ptr3881, %unwind3880 ], [ %eh_ptr4771, %unwind4770 ], [ %eh_ptr4920, %unwind4919 ], [ %eh_ptr5033, %unwind5032 ], [ %eh_ptr5267, %unwind5266 ] ; <i8*> [#uses=1]
- call i32 (...)* @_Unwind_Resume( i8* %eh_exception.2 ) ; <i32>:27 [#uses=0]
- unreachable
-
-UnifiedUnreachableBlock34: ; preds = %cond_true5031, %cond_true4918, %cond_true4609, %cond_true4504, %cond_true4481, %cond_true4187, %cond_true4117, %cond_true4027, %cond_true3935, %cond_true3907, %cond_true3729, %cond_true3675, %cond_true3617, %cond_true3543, %cond_true3448, %cond_true3420, %bb3227, %bb3193, %bb3171, %cond_true3061, %bb2877, %bb2843, %bb2821, %cond_true2711, %bb2558, %bb2524, %bb2506, %cond_true2410, %bb2203, %cond_true2171, %cond_true1946, %bb1605, %cond_true1573, %cond_true1546, %cond_true1418, %cond_true973, %cond_true870, %cond_true663, %cond_true637, %cond_true611, %cond_true585, %cond_true559, %cond_true533, %cond_true507, %cond_true465
- unreachable
-
-UnifiedReturnBlock35: ; preds = %cleanup4742, %invcont4719, %finally913, %cleanup928
- ret void
-}
-
-declare i32 @report__ident_int(i32)
-
-declare void @__gnat_rcheck_10(i8*, i32)
-
-declare void @__gnat_rcheck_12(i8*, i32)
-
-declare void @report__test(i64, i64)
-
-declare i8* @llvm.eh.exception()
-
-declare i32 @llvm.eh.selector.i32(i8*, i8*, ...)
-
-declare i32 @llvm.eh.typeid.for.i32(i8*)
-
-declare i32 @__gnat_eh_personality(...)
-
-declare i32 @_Unwind_Resume(...)
-
-declare void @system__secondary_stack__ss_mark(%struct.system__secondary_stack__mark_id* sret )
-
-declare void @system__img_int__image_integer(%struct.string___XUP* sret , i32)
-
-declare void @system__string_ops__str_concat(%struct.string___XUP* sret , i64, i64)
-
-declare void @report__failed(i64)
-
-declare void @system__secondary_stack__ss_release(i64)
-
-declare void @__gnat_begin_handler(i8*)
-
-declare void @__gnat_end_handler(i8*)
-
-declare i8 @report__equal(i32, i32)
-
-declare i8* @llvm.stacksave()
-
-declare void @__gnat_rcheck_07(i8*, i32)
-
-declare i8* @__gnat_malloc(i32)
-
-declare void @llvm.stackrestore(i8*)
-
-declare void @llvm.memcpy.i32(i8*, i8*, i32, i32)
-
-declare void @__gnat_rcheck_05(i8*, i32)
-
-declare void @__gnat_rcheck_06(i8*, i32)
-
-declare void @system__img_enum__image_enumeration_8(%struct.string___XUP* sret , i32, i64, i8*)
-
-declare i32 @memcmp(i8*, i8*, i32, ...)
-
-declare void @report__result()
diff --git a/release_23/test/CodeGen/Generic/2007-11-21-UndeadIllegalNode.ll b/release_23/test/CodeGen/Generic/2007-11-21-UndeadIllegalNode.ll
deleted file mode 100644
index 1f4e5e197602..000000000000
--- a/release_23/test/CodeGen/Generic/2007-11-21-UndeadIllegalNode.ll
+++ /dev/null
@@ -1,161 +0,0 @@
-; RUN: llvm-as < %s | llc -o -
-; XFAIL: *
-; Un-XFAIL this once LegalizeDAGTypes is turned on.
-
-target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32"
-target triple = "i686-pc-linux-gnu"
- %struct.RETURN = type { i32, i32 }
- %struct.ada__finalization__controlled = type { %struct.system__finalization_root__root_controlled }
- %struct.ada__streams__root_stream_type = type { %struct.ada__tags__dispatch_table* }
- %struct.ada__strings__unbounded__string_access = type { i8*, %struct.RETURN* }
- %struct.ada__strings__unbounded__unbounded_string = type { %struct.ada__finalization__controlled, %struct.ada__strings__unbounded__string_access, i32 }
- %struct.ada__tags__dispatch_table = type { [1 x i32] }
- %struct.exception = type { i8, i8, i32, i8*, i8*, i32, i8* }
- %struct.system__finalization_root__root_controlled = type { %struct.ada__streams__root_stream_type, %struct.system__finalization_root__root_controlled*, %struct.system__finalization_root__root_controlled* }
- %struct.system__standard_library__exception_data = type { i8, i8, i32, i32, %struct.system__standard_library__exception_data*, i32, void ()* }
-@C.495.7639 = internal constant %struct.RETURN { i32 1, i32 16 } ; <%struct.RETURN*> [#uses=1]
-@ada__strings__index_error = external global %struct.exception ; <%struct.exception*> [#uses=1]
-@.str5 = internal constant [16 x i8] c"a-strunb.adb:690" ; <[16 x i8]*> [#uses=1]
-
-declare void @llvm.memcpy.i32(i8*, i8*, i32, i32)
-
-declare void @ada__strings__unbounded__realloc_for_chunk(%struct.ada__strings__unbounded__unbounded_string*, i32)
-
-declare void @__gnat_raise_exception(%struct.system__standard_library__exception_data*, i64)
-
-define void @ada__strings__unbounded__insert__2(%struct.ada__strings__unbounded__unbounded_string* %source, i32 %before, i64 %new_item.0.0) {
-entry:
- %tmp24636 = lshr i64 %new_item.0.0, 32 ; <i64> [#uses=1]
- %tmp24637 = trunc i64 %tmp24636 to i32 ; <i32> [#uses=1]
- %tmp24638 = inttoptr i32 %tmp24637 to %struct.RETURN* ; <%struct.RETURN*> [#uses=2]
- %tmp25 = getelementptr %struct.RETURN* %tmp24638, i32 0, i32 0 ; <i32*> [#uses=1]
- %tmp26 = load i32* %tmp25, align 4 ; <i32> [#uses=1]
- %tmp29 = getelementptr %struct.RETURN* %tmp24638, i32 0, i32 1 ; <i32*> [#uses=1]
- %tmp30 = load i32* %tmp29, align 4 ; <i32> [#uses=1]
- %tmp63 = getelementptr %struct.ada__strings__unbounded__unbounded_string* %source, i32 0, i32 1, i32 1 ; <%struct.RETURN**> [#uses=5]
- %tmp64 = load %struct.RETURN** %tmp63, align 4 ; <%struct.RETURN*> [#uses=1]
- %tmp65 = getelementptr %struct.RETURN* %tmp64, i32 0, i32 0 ; <i32*> [#uses=1]
- %tmp66 = load i32* %tmp65, align 4 ; <i32> [#uses=1]
- %tmp67 = icmp sgt i32 %tmp66, %before ; <i1> [#uses=1]
- br i1 %tmp67, label %bb77, label %bb
-
-bb: ; preds = %entry
- %tmp71 = getelementptr %struct.ada__strings__unbounded__unbounded_string* %source, i32 0, i32 2 ; <i32*> [#uses=4]
- %tmp72 = load i32* %tmp71, align 4 ; <i32> [#uses=1]
- %tmp73 = add i32 %tmp72, 1 ; <i32> [#uses=1]
- %tmp74 = icmp slt i32 %tmp73, %before ; <i1> [#uses=1]
- br i1 %tmp74, label %bb77, label %bb84
-
-bb77: ; preds = %bb, %entry
- tail call void @__gnat_raise_exception( %struct.system__standard_library__exception_data* bitcast (%struct.exception* @ada__strings__index_error to %struct.system__standard_library__exception_data*), i64 or (i64 zext (i32 ptrtoint ([16 x i8]* @.str5 to i32) to i64), i64 shl (i64 zext (i32 ptrtoint (%struct.RETURN* @C.495.7639 to i32) to i64), i64 32)) )
- unreachable
-
-bb84: ; preds = %bb
- %tmp93 = sub i32 %tmp30, %tmp26 ; <i32> [#uses=2]
- %tmp9394 = sext i32 %tmp93 to i36 ; <i36> [#uses=1]
- %tmp95 = shl i36 %tmp9394, 3 ; <i36> [#uses=1]
- %tmp96 = add i36 %tmp95, 8 ; <i36> [#uses=2]
- %tmp97 = icmp sgt i36 %tmp96, -1 ; <i1> [#uses=1]
- %tmp100 = select i1 %tmp97, i36 %tmp96, i36 0 ; <i36> [#uses=2]
- %tmp101 = icmp slt i36 %tmp100, 17179869177 ; <i1> [#uses=1]
- %tmp100.cast = trunc i36 %tmp100 to i32 ; <i32> [#uses=1]
- %min102 = select i1 %tmp101, i32 %tmp100.cast, i32 -8 ; <i32> [#uses=1]
- tail call void @ada__strings__unbounded__realloc_for_chunk( %struct.ada__strings__unbounded__unbounded_string* %source, i32 %min102 )
- %tmp148 = load i32* %tmp71, align 4 ; <i32> [#uses=4]
- %tmp152 = add i32 %tmp93, 1 ; <i32> [#uses=2]
- %tmp153 = icmp sgt i32 %tmp152, -1 ; <i1> [#uses=1]
- %max154 = select i1 %tmp153, i32 %tmp152, i32 0 ; <i32> [#uses=5]
- %tmp155 = add i32 %tmp148, %max154 ; <i32> [#uses=5]
- %tmp315 = getelementptr %struct.ada__strings__unbounded__unbounded_string* %source, i32 0, i32 1, i32 0 ; <i8**> [#uses=4]
- %tmp328 = load %struct.RETURN** %tmp63, align 4 ; <%struct.RETURN*> [#uses=1]
- %tmp329 = getelementptr %struct.RETURN* %tmp328, i32 0, i32 0 ; <i32*> [#uses=1]
- %tmp330 = load i32* %tmp329, align 4 ; <i32> [#uses=4]
- %tmp324 = add i32 %max154, %before ; <i32> [#uses=3]
- %tmp331 = sub i32 %tmp324, %tmp330 ; <i32> [#uses=1]
- %tmp349 = sub i32 %before, %tmp330 ; <i32> [#uses=1]
- %tmp356 = icmp sgt i32 %tmp331, %tmp349 ; <i1> [#uses=1]
- %tmp431 = icmp sgt i32 %tmp324, %tmp155 ; <i1> [#uses=2]
- br i1 %tmp356, label %bb420, label %bb359
-
-bb359: ; preds = %bb84
- br i1 %tmp431, label %bb481, label %bb382
-
-bb382: ; preds = %bb382, %bb359
- %indvar = phi i32 [ 0, %bb359 ], [ %indvar.next, %bb382 ] ; <i32> [#uses=2]
- %max379.pn = phi i32 [ %max154, %bb359 ], [ %L492b.0, %bb382 ] ; <i32> [#uses=1]
- %before.pn = phi i32 [ %before, %bb359 ], [ 1, %bb382 ] ; <i32> [#uses=1]
- %L492b.0 = add i32 %before.pn, %max379.pn ; <i32> [#uses=3]
- %tmp386 = load %struct.RETURN** %tmp63, align 4 ; <%struct.RETURN*> [#uses=1]
- %tmp387 = getelementptr %struct.RETURN* %tmp386, i32 0, i32 0 ; <i32*> [#uses=1]
- %tmp388 = load i32* %tmp387, align 4 ; <i32> [#uses=2]
- %tmp392 = load i8** %tmp315, align 4 ; <i8*> [#uses=2]
- %R493b.0 = add i32 %indvar, %before ; <i32> [#uses=1]
- %tmp405 = sub i32 %R493b.0, %tmp388 ; <i32> [#uses=1]
- %tmp406 = getelementptr i8* %tmp392, i32 %tmp405 ; <i8*> [#uses=1]
- %tmp407 = load i8* %tmp406, align 1 ; <i8> [#uses=1]
- %tmp408 = sub i32 %L492b.0, %tmp388 ; <i32> [#uses=1]
- %tmp409 = getelementptr i8* %tmp392, i32 %tmp408 ; <i8*> [#uses=1]
- store i8 %tmp407, i8* %tmp409, align 1
- %tmp414 = icmp eq i32 %L492b.0, %tmp155 ; <i1> [#uses=1]
- %indvar.next = add i32 %indvar, 1 ; <i32> [#uses=1]
- br i1 %tmp414, label %bb481, label %bb382
-
-bb420: ; preds = %bb84
- br i1 %tmp431, label %bb481, label %bb436.preheader
-
-bb436.preheader: ; preds = %bb420
- %tmp4468 = load i8** %tmp315, align 4 ; <i8*> [#uses=2]
- %tmp4599 = sub i32 %tmp148, %tmp330 ; <i32> [#uses=1]
- %tmp46010 = getelementptr i8* %tmp4468, i32 %tmp4599 ; <i8*> [#uses=1]
- %tmp46111 = load i8* %tmp46010, align 1 ; <i8> [#uses=1]
- %tmp46212 = sub i32 %tmp155, %tmp330 ; <i32> [#uses=1]
- %tmp46313 = getelementptr i8* %tmp4468, i32 %tmp46212 ; <i8*> [#uses=1]
- store i8 %tmp46111, i8* %tmp46313, align 1
- %exitcond14 = icmp eq i32 %tmp155, %tmp324 ; <i1> [#uses=1]
- br i1 %exitcond14, label %bb481, label %bb.nph
-
-bb.nph: ; preds = %bb436.preheader
- %tmp5 = sub i32 %tmp148, %before ; <i32> [#uses=1]
- br label %bb478
-
-bb478: ; preds = %bb478, %bb.nph
- %indvar6422 = phi i32 [ 0, %bb.nph ], [ %indvar.next643, %bb478 ] ; <i32> [#uses=1]
- %indvar.next643 = add i32 %indvar6422, 1 ; <i32> [#uses=4]
- %L490b.0 = sub i32 %tmp155, %indvar.next643 ; <i32> [#uses=1]
- %R491b.0 = sub i32 %tmp148, %indvar.next643 ; <i32> [#uses=1]
- %tmp440 = load %struct.RETURN** %tmp63, align 4 ; <%struct.RETURN*> [#uses=1]
- %tmp441 = getelementptr %struct.RETURN* %tmp440, i32 0, i32 0 ; <i32*> [#uses=1]
- %tmp442 = load i32* %tmp441, align 4 ; <i32> [#uses=2]
- %tmp446 = load i8** %tmp315, align 4 ; <i8*> [#uses=2]
- %tmp459 = sub i32 %R491b.0, %tmp442 ; <i32> [#uses=1]
- %tmp460 = getelementptr i8* %tmp446, i32 %tmp459 ; <i8*> [#uses=1]
- %tmp461 = load i8* %tmp460, align 1 ; <i8> [#uses=1]
- %tmp462 = sub i32 %L490b.0, %tmp442 ; <i32> [#uses=1]
- %tmp463 = getelementptr i8* %tmp446, i32 %tmp462 ; <i8*> [#uses=1]
- store i8 %tmp461, i8* %tmp463, align 1
- %exitcond = icmp eq i32 %indvar.next643, %tmp5 ; <i1> [#uses=1]
- br i1 %exitcond, label %bb481, label %bb478
-
-bb481: ; preds = %bb478, %bb436.preheader, %bb420, %bb382, %bb359
- %tmp577 = add i32 %before, -1 ; <i32> [#uses=3]
- %tmp578 = add i32 %max154, %tmp577 ; <i32> [#uses=2]
- %tmp581 = icmp sge i32 %tmp578, %tmp577 ; <i1> [#uses=1]
- %max582 = select i1 %tmp581, i32 %tmp578, i32 %tmp577 ; <i32> [#uses=1]
- %tmp584 = sub i32 %max582, %before ; <i32> [#uses=1]
- %tmp585 = add i32 %tmp584, 1 ; <i32> [#uses=2]
- %tmp586 = icmp sgt i32 %tmp585, -1 ; <i1> [#uses=1]
- %max587 = select i1 %tmp586, i32 %tmp585, i32 0 ; <i32> [#uses=1]
- %tmp591 = load %struct.RETURN** %tmp63, align 4 ; <%struct.RETURN*> [#uses=1]
- %tmp592 = getelementptr %struct.RETURN* %tmp591, i32 0, i32 0 ; <i32*> [#uses=1]
- %tmp593 = load i32* %tmp592, align 4 ; <i32> [#uses=1]
- %tmp597 = load i8** %tmp315, align 4 ; <i8*> [#uses=1]
- %tmp600621 = trunc i64 %new_item.0.0 to i32 ; <i32> [#uses=1]
- %tmp600622 = inttoptr i32 %tmp600621 to i8* ; <i8*> [#uses=1]
- %tmp601 = sub i32 %before, %tmp593 ; <i32> [#uses=1]
- %tmp602 = getelementptr i8* %tmp597, i32 %tmp601 ; <i8*> [#uses=1]
- tail call void @llvm.memcpy.i32( i8* %tmp602, i8* %tmp600622, i32 %max587, i32 1 )
- %tmp606 = load i32* %tmp71, align 4 ; <i32> [#uses=1]
- %tmp613 = add i32 %tmp606, %max154 ; <i32> [#uses=1]
- store i32 %tmp613, i32* %tmp71, align 4
- ret void
-}
diff --git a/release_23/test/CodeGen/Generic/2007-12-17-InvokeAsm.ll b/release_23/test/CodeGen/Generic/2007-12-17-InvokeAsm.ll
deleted file mode 100644
index 98871d0e3a45..000000000000
--- a/release_23/test/CodeGen/Generic/2007-12-17-InvokeAsm.ll
+++ /dev/null
@@ -1,15 +0,0 @@
-; RUN: llvm-as < %s | llc -enable-eh
-
-target triple = "i686-pc-linux-gnu"
-
-define fastcc void @bc__support__high_resolution_time__initialize_clock_rate() {
-entry:
- invoke void asm "rdtsc\0A\09movl %eax, $0\0A\09movl %edx, $1", "=*imr,=*imr,~{dirflag},~{fpsr},~{flags},~{dx},~{ax}"( i32* null, i32* null )
- to label %.noexc unwind label %cleanup144
-
-.noexc: ; preds = %entry
- ret void
-
-cleanup144: ; preds = %entry
- unwind
-}
diff --git a/release_23/test/CodeGen/Generic/2007-12-31-UnusedSelector.ll b/release_23/test/CodeGen/Generic/2007-12-31-UnusedSelector.ll
deleted file mode 100644
index 41fdb71ddf49..000000000000
--- a/release_23/test/CodeGen/Generic/2007-12-31-UnusedSelector.ll
+++ /dev/null
@@ -1,36 +0,0 @@
-; RUN: llvm-as < %s | llc -enable-eh
-; PR1833
-
-target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32"
-target triple = "i686-pc-linux-gnu"
- %struct.__class_type_info_pseudo = type { %struct.__type_info_pseudo }
- %struct.__type_info_pseudo = type { i8*, i8* }
-@_ZTI2e1 = external constant %struct.__class_type_info_pseudo ; <%struct.__class_type_info_pseudo*> [#uses=1]
-
-define void @_Z7ex_testv() {
-entry:
- invoke void @__cxa_throw( i8* null, i8* bitcast (%struct.__class_type_info_pseudo* @_ZTI2e1 to i8*), void (i8*)* null ) noreturn
- to label %UnifiedUnreachableBlock unwind label %lpad
-
-bb14: ; preds = %lpad
- unreachable
-
-lpad: ; preds = %entry
- invoke void @__cxa_end_catch( )
- to label %bb14 unwind label %lpad17
-
-lpad17: ; preds = %lpad
- %eh_select20 = tail call i32 (i8*, i8*, ...)* @llvm.eh.selector.i32( i8* null, i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*), i8* null ) ; <i32> [#uses=0]
- unreachable
-
-UnifiedUnreachableBlock: ; preds = %entry
- unreachable
-}
-
-declare void @__cxa_throw(i8*, i8*, void (i8*)*) noreturn
-
-declare i32 @llvm.eh.selector.i32(i8*, i8*, ...)
-
-declare void @__cxa_end_catch()
-
-declare i32 @__gxx_personality_v0(...)
diff --git a/release_23/test/CodeGen/Generic/2008-01-25-dag-combine-mul.ll b/release_23/test/CodeGen/Generic/2008-01-25-dag-combine-mul.ll
deleted file mode 100644
index 4b2544446939..000000000000
--- a/release_23/test/CodeGen/Generic/2008-01-25-dag-combine-mul.ll
+++ /dev/null
@@ -1,31 +0,0 @@
-; RUN: llvm-as < %s | llc
-; rdar://5707064
-
-define i32 @f(i16* %pc) {
-entry:
- %acc = alloca i64, align 8 ; <i64*> [#uses=4]
- %tmp97 = load i64* %acc, align 8 ; <i64> [#uses=1]
- %tmp98 = and i64 %tmp97, 4294967295 ; <i64> [#uses=1]
- %tmp99 = load i64* null, align 8 ; <i64> [#uses=1]
- %tmp100 = and i64 %tmp99, 4294967295 ; <i64> [#uses=1]
- %tmp101 = mul i64 %tmp98, %tmp100 ; <i64> [#uses=1]
- %tmp103 = lshr i64 %tmp101, 0 ; <i64> [#uses=1]
- %tmp104 = load i64* %acc, align 8 ; <i64> [#uses=1]
- %.cast105 = zext i32 32 to i64 ; <i64> [#uses=1]
- %tmp106 = lshr i64 %tmp104, %.cast105 ; <i64> [#uses=1]
- %tmp107 = load i64* null, align 8 ; <i64> [#uses=1]
- %tmp108 = and i64 %tmp107, 4294967295 ; <i64> [#uses=1]
- %tmp109 = mul i64 %tmp106, %tmp108 ; <i64> [#uses=1]
- %tmp112 = add i64 %tmp109, 0 ; <i64> [#uses=1]
- %tmp116 = add i64 %tmp112, 0 ; <i64> [#uses=1]
- %tmp117 = add i64 %tmp103, %tmp116 ; <i64> [#uses=1]
- %tmp118 = load i64* %acc, align 8 ; <i64> [#uses=1]
- %tmp120 = lshr i64 %tmp118, 0 ; <i64> [#uses=1]
- %tmp121 = load i64* null, align 8 ; <i64> [#uses=1]
- %tmp123 = lshr i64 %tmp121, 0 ; <i64> [#uses=1]
- %tmp124 = mul i64 %tmp120, %tmp123 ; <i64> [#uses=1]
- %tmp126 = shl i64 %tmp124, 0 ; <i64> [#uses=1]
- %tmp127 = add i64 %tmp117, %tmp126 ; <i64> [#uses=1]
- store i64 %tmp127, i64* %acc, align 8
- ret i32 0
-}
diff --git a/release_23/test/CodeGen/Generic/2008-01-30-LoadCrash.ll b/release_23/test/CodeGen/Generic/2008-01-30-LoadCrash.ll
deleted file mode 100644
index 8ed4139bd64f..000000000000
--- a/release_23/test/CodeGen/Generic/2008-01-30-LoadCrash.ll
+++ /dev/null
@@ -1,19 +0,0 @@
-; RUN: llvm-as < %s | llc
-
-@letters.3100 = external constant [63 x i8] ; <[63 x i8]*> [#uses=2]
-
-define i32 @mkstemps(i8* %pattern, i32 %suffix_len, i64 %tmp42.rle) nounwind {
-bb20:
- br label %bb41
-
-bb41: ; preds = %bb20
- %tmp8182 = trunc i64 %tmp42.rle to i32 ; <i32> [#uses=1]
- %tmp83 = getelementptr [63 x i8]* @letters.3100, i32 0, i32 %tmp8182 ; <i8*> [#uses=1]
- %tmp84 = load i8* %tmp83, align 1 ; <i8> [#uses=1]
- store i8 %tmp84, i8* null, align 1
- %tmp90 = urem i64 %tmp42.rle, 62 ; <i64> [#uses=1]
- %tmp9091 = trunc i64 %tmp90 to i32 ; <i32> [#uses=1]
- %tmp92 = getelementptr [63 x i8]* @letters.3100, i32 0, i32 %tmp9091 ; <i8*> [#uses=1]
- store i8* %tmp92, i8** null, align 1
- ret i32 -1
-}
diff --git a/release_23/test/CodeGen/Generic/2008-02-04-Ctlz.ll b/release_23/test/CodeGen/Generic/2008-02-04-Ctlz.ll
deleted file mode 100644
index 4639b6f97703..000000000000
--- a/release_23/test/CodeGen/Generic/2008-02-04-Ctlz.ll
+++ /dev/null
@@ -1,21 +0,0 @@
-; RUN: llvm-as < %s | llc
-
-@.str = internal constant [14 x i8] c"%lld %d %d %d\00"
-
-define i32 @main(i64 %arg) nounwind {
-entry:
- %tmp37 = tail call i64 @llvm.ctlz.i64( i64 %arg ) ; <i64> [#uses=1]
- %tmp47 = tail call i64 @llvm.cttz.i64( i64 %arg ) ; <i64> [#uses=1]
- %tmp57 = tail call i64 @llvm.ctpop.i64( i64 %arg ) ; <i64> [#uses=1]
- %tmp38 = trunc i64 %tmp37 to i32 ; <i32>:0 [#uses=1]
- %tmp48 = trunc i64 %tmp47 to i32 ; <i32>:0 [#uses=1]
- %tmp58 = trunc i64 %tmp57 to i32 ; <i32>:0 [#uses=1]
- %tmp40 = tail call i32 (i8*, ...)* @printf( i8* noalias getelementptr ([14 x i8]* @.str, i32 0, i32 0), i64 %arg, i32 %tmp38, i32 %tmp48, i32 %tmp58 ) nounwind ; <i32> [#uses=0]
- ret i32 0
-}
-
-declare i32 @printf(i8* noalias , ...) nounwind
-
-declare i64 @llvm.ctlz.i64(i64) nounwind readnone
-declare i64 @llvm.cttz.i64(i64) nounwind readnone
-declare i64 @llvm.ctpop.i64(i64) nounwind readnone
diff --git a/release_23/test/CodeGen/Generic/2008-02-04-ExtractSubvector.ll b/release_23/test/CodeGen/Generic/2008-02-04-ExtractSubvector.ll
deleted file mode 100644
index 1cf822b71190..000000000000
--- a/release_23/test/CodeGen/Generic/2008-02-04-ExtractSubvector.ll
+++ /dev/null
@@ -1,14 +0,0 @@
-; RUN: llvm-as < %s | llc
-
-define i32 @main() nounwind {
-entry:
- br label %bb15
-
-bb15: ; preds = %bb15, %entry
- %tmp21 = add <8 x double> zeroinitializer, zeroinitializer ; <<8 x double>> [#uses=1]
- br i1 false, label %bb30, label %bb15
-
-bb30: ; preds = %bb15
- store <8 x double> %tmp21, <8 x double>* null, align 64
- ret i32 0
-}
diff --git a/release_23/test/CodeGen/Generic/2008-02-20-MatchingMem.ll b/release_23/test/CodeGen/Generic/2008-02-20-MatchingMem.ll
deleted file mode 100644
index ef60f92fa05a..000000000000
--- a/release_23/test/CodeGen/Generic/2008-02-20-MatchingMem.ll
+++ /dev/null
@@ -1,9 +0,0 @@
-; RUN: llvm-as < %s | llc
-; PR1133
-define void @test(i32* %X) nounwind {
-entry:
- %tmp1 = getelementptr i32* %X, i32 10 ; <i32*> [#uses=2]
- tail call void asm sideeffect " $0 $1 ", "=*im,*im,~{memory}"( i32* %tmp1, i32* %tmp1 ) nounwind
- ret void
-}
-
diff --git a/release_23/test/CodeGen/Generic/2008-02-25-NegateZero.ll b/release_23/test/CodeGen/Generic/2008-02-25-NegateZero.ll
deleted file mode 100644
index e5a52748464b..000000000000
--- a/release_23/test/CodeGen/Generic/2008-02-25-NegateZero.ll
+++ /dev/null
@@ -1,14 +0,0 @@
-; RUN: llvm-as < %s | llc
-; rdar://5763967
-
-define void @test() {
-entry:
- %tmp98 = load float* null, align 4 ; <float> [#uses=1]
- %tmp106 = load float* null, align 4 ; <float> [#uses=1]
- %tmp113 = add float %tmp98, %tmp106 ; <float> [#uses=1]
- %tmp119 = sub float %tmp113, 0.000000e+00 ; <float> [#uses=1]
- call void (i32, ...)* @foo( i32 0, float 0.000000e+00, float %tmp119 ) nounwind
- ret void
-}
-
-declare void @foo(i32, ...)
diff --git a/release_23/test/CodeGen/Generic/2008-02-26-NegatableCrash.ll b/release_23/test/CodeGen/Generic/2008-02-26-NegatableCrash.ll
deleted file mode 100644
index 7fe19d925bed..000000000000
--- a/release_23/test/CodeGen/Generic/2008-02-26-NegatableCrash.ll
+++ /dev/null
@@ -1,50 +0,0 @@
-; RUN: llvm-as < %s | llc
-; PR2096
- %struct.AVClass = type { i8*, i8* (i8*)*, %struct.AVOption* }
- %struct.AVCodec = type { i8*, i32, i32, i32, i32 (%struct.AVCodecContext*)*, i32 (%struct.AVCodecContext*, i8*, i32, i8*)*, i32 (%struct.AVCodecContext*)*, i32 (%struct.AVCodecContext*, i8*, i32*, i8*, i32)*, i32, %struct.AVCodec*, void (%struct.AVCodecContext*)*, %struct.AVRational*, i32* }
- %struct.AVCodecContext = type { %struct.AVClass*, i32, i32, i32, i32, i32, i8*, i32, %struct.AVRational, i32, i32, i32, i32, i32, void (%struct.AVCodecContext*, %struct.AVFrame*, i32*, i32, i32, i32)*, i32, i32, i32, i32, i32, i32, i32, float, float, i32, i32, i32, i32, float, i32, i32, i32, %struct.AVCodec*, i8*, i32, i32, void (%struct.AVCodecContext*, i8*, i32, i32)*, i32, i32, i32, i32, i32, i32, i32, i32, i32, i8*, [32 x i8], i32, i32, i32, i32, i32, i32, i32, float, i32, i32 (%struct.AVCodecContext*, %struct.AVFrame*)*, void (%struct.AVCodecContext*, %struct.AVFrame*)*, i32, i32, i32, i32, i8*, i8*, float, float, i32, %struct.RcOverride*, i32, i8*, i32, i32, i32, float, float, float, float, i32, float, float, float, float, float, i32, i32, i32, i32*, i32, i32, i32, i32, %struct.AVRational, %struct.AVFrame*, i32, i32, [4 x i64], i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 (%struct.AVCodecContext*, i32*)*, i32, i32, i32, i32, i32, i32, i8*, i32, i32, i32, i32, i32, i32, i16*, i16*, i32, i32, i32, i32, %struct.AVPaletteControl*, i32, i32 (%struct.AVCodecContext*, %struct.AVFrame*)*, i32, i32, i32, i32, i32, i32, i32, i32 (%struct.AVCodecContext*, i32 (%struct.AVCodecContext*, i8*)*, i8**, i32*, i32)*, i8*, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, float, i32, i32, i32, i32, i32, i32, i32, i32, float, i32, i32, i32, i32, i32, i32, float, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i64, i32, float }
- %struct.AVFrame = type { [4 x i8*], [4 x i32], [4 x i8*], i32, i32, i64, i32, i32, i32, i32, i32, i8*, i32, i8*, [2 x [2 x i16]*], i32*, i8, i8*, [4 x i64], i32, i32, i32, i32, i32, %struct.AVPanScan*, i32, i32, i16*, [2 x i8*] }
- %struct.AVOption = type opaque
- %struct.AVPaletteControl = type { i32, [256 x i32] }
- %struct.AVPanScan = type { i32, i32, i32, [3 x [2 x i16]] }
- %struct.AVRational = type { i32, i32 }
- %struct.RcOverride = type { i32, i32, i32, float }
-
-define i32 @sonic_encode_frame(%struct.AVCodecContext* %avctx, i8* %buf, i32 %buf_size, i8* %data) {
-entry:
- switch i32 0, label %bb429 [
- i32 0, label %bb244.preheader
- i32 1, label %bb279.preheader
- ]
-
-bb279.preheader: ; preds = %entry
- ret i32 0
-
-bb244.preheader: ; preds = %entry
- ret i32 0
-
-bb429: ; preds = %entry
- br i1 false, label %bb.nph1770, label %bb627
-
-bb.nph1770: ; preds = %bb429
- br i1 false, label %bb471, label %bb505
-
-bb471: ; preds = %bb471, %bb.nph1770
- %tmp487 = add double 0.000000e+00, 0.000000e+00 ; <double> [#uses=1]
- br i1 false, label %bb505, label %bb471
-
-bb505: ; preds = %bb471, %bb.nph1770
- %xy.0.lcssa = phi double [ 0.000000e+00, %bb.nph1770 ], [ %tmp487, %bb471 ] ; <double> [#uses=1]
- %tmp507 = sub double -0.000000e+00, %xy.0.lcssa ; <double> [#uses=1]
- %tmp509 = fdiv double %tmp507, 0.000000e+00 ; <double> [#uses=1]
- %tmp510 = mul double %tmp509, 1.024000e+03 ; <double> [#uses=1]
- %tmp516 = fdiv double %tmp510, 0.000000e+00 ; <double> [#uses=1]
- %tmp517 = add double %tmp516, 5.000000e-01 ; <double> [#uses=1]
- %tmp518 = tail call double @floor( double %tmp517 ) nounwind readnone ; <double> [#uses=0]
- ret i32 0
-
-bb627: ; preds = %bb429
- ret i32 0
-}
-
-declare double @floor(double) nounwind readnone
diff --git a/release_23/test/CodeGen/Generic/BasicInstrs.ll b/release_23/test/CodeGen/Generic/BasicInstrs.ll
deleted file mode 100644
index e65cbf772fd9..000000000000
--- a/release_23/test/CodeGen/Generic/BasicInstrs.ll
+++ /dev/null
@@ -1,54 +0,0 @@
-; New testcase, this contains a bunch of simple instructions that should be
-; handled by a code generator.
-
-; RUN: llvm-as < %s | llc
-
-define i32 @add(i32 %A, i32 %B) {
- %R = add i32 %A, %B ; <i32> [#uses=1]
- ret i32 %R
-}
-
-define i32 @sub(i32 %A, i32 %B) {
- %R = sub i32 %A, %B ; <i32> [#uses=1]
- ret i32 %R
-}
-
-define i32 @mul(i32 %A, i32 %B) {
- %R = mul i32 %A, %B ; <i32> [#uses=1]
- ret i32 %R
-}
-
-define i32 @sdiv(i32 %A, i32 %B) {
- %R = sdiv i32 %A, %B ; <i32> [#uses=1]
- ret i32 %R
-}
-
-define i32 @udiv(i32 %A, i32 %B) {
- %R = udiv i32 %A, %B ; <i32> [#uses=1]
- ret i32 %R
-}
-
-define i32 @srem(i32 %A, i32 %B) {
- %R = srem i32 %A, %B ; <i32> [#uses=1]
- ret i32 %R
-}
-
-define i32 @urem(i32 %A, i32 %B) {
- %R = urem i32 %A, %B ; <i32> [#uses=1]
- ret i32 %R
-}
-
-define i32 @and(i32 %A, i32 %B) {
- %R = and i32 %A, %B ; <i32> [#uses=1]
- ret i32 %R
-}
-
-define i32 @or(i32 %A, i32 %B) {
- %R = or i32 %A, %B ; <i32> [#uses=1]
- ret i32 %R
-}
-
-define i32 @xor(i32 %A, i32 %B) {
- %R = xor i32 %A, %B ; <i32> [#uses=1]
- ret i32 %R
-}
diff --git a/release_23/test/CodeGen/Generic/BurgBadRegAlloc.ll b/release_23/test/CodeGen/Generic/BurgBadRegAlloc.ll
deleted file mode 100644
index 3ccc9a0aeb69..000000000000
--- a/release_23/test/CodeGen/Generic/BurgBadRegAlloc.ll
+++ /dev/null
@@ -1,829 +0,0 @@
-; RUN: llvm-as < %s | llc
-
-;; Register allocation is doing a very poor job on this routine from yyparse
-;; in Burg:
-;; -- at least two long-lived values are being allocated to %o? registers
-;; -- even worse, those registers are being saved and restored repeatedly
-;; at function calls, even though there are no intervening uses.
-;; -- outgoing args of some function calls have to be swapped, causing
-;; another write/read from stack to do the exchange (use -dregalloc=y).
-;;
-%Arity = type %struct.arity*
- %Binding = type %struct.binding*
- %DeltaCost = type [4 x i16]
- %Dimension = type %struct.dimension*
- %Index_Map = type { i32, %Item_Set* }
- %IntList = type %struct.intlist*
- %Item = type { %DeltaCost, %Rule }
- %ItemArray = type %Item*
- %Item_Set = type %struct.item_set*
- %List = type %struct.list*
- %Mapping = type %struct.mapping*
- %NonTerminal = type %struct.nonterminal*
- %Operator = type %struct.operator*
- %Pattern = type %struct.pattern*
- %PatternAST = type %struct.patternAST*
- %Plank = type %struct.plank*
- %PlankMap = type %struct.plankMap*
- %ReadFn = type i32 ()*
- %Rule = type %struct.rule*
- %RuleAST = type %struct.ruleAST*
- %StateMap = type %struct.stateMap*
- %StrTableElement = type %struct.strTableElement*
- %Symbol = type %struct.symbol*
- %Table = type %struct.table*
- %YYSTYPE = type { %IntList }
- %struct.arity = type { i32, %List }
- %struct.binding = type { i8*, i32 }
- %struct.dimension = type { i16*, %Index_Map, %Mapping, i32, %PlankMap }
- %struct.index_map = type { i32, %Item_Set* }
- %struct.intlist = type { i32, %IntList }
- %struct.item = type { %DeltaCost, %Rule }
- %struct.item_set = type { i32, i32, %Operator, [2 x %Item_Set], %Item_Set, i16*, %ItemArray, %ItemArray }
- %struct.list = type { i8*, %List }
- %struct.mapping = type { %List*, i32, i32, i32, %Item_Set* }
- %struct.nonterminal = type { i8*, i32, i32, i32, %PlankMap, %Rule }
- %struct.operator = type { i8*, i32, i32, i32, i32, i32, %Table }
- %struct.pattern = type { %NonTerminal, %Operator, [2 x %NonTerminal] }
- %struct.patternAST = type { %Symbol, i8*, %List }
- %struct.plank = type { i8*, %List, i32 }
- %struct.plankMap = type { %List, i32, %StateMap }
- %struct.rule = type { %DeltaCost, i32, i32, i32, %NonTerminal, %Pattern, i32 }
- %struct.ruleAST = type { i8*, %PatternAST, i32, %IntList, %Rule, %StrTableElement, %StrTableElement }
- %struct.stateMap = type { i8*, %Plank, i32, i16* }
- %struct.strTableElement = type { i8*, %IntList, i8* }
- %struct.symbol = type { i8*, i32, { %Operator } }
- %struct.table = type { %Operator, %List, i16*, [2 x %Dimension], %Item_Set* }
-@yylval = external global %YYSTYPE ; <%YYSTYPE*> [#uses=1]
-@yylhs = external global [25 x i16] ; <[25 x i16]*> [#uses=1]
-@yylen = external global [25 x i16] ; <[25 x i16]*> [#uses=1]
-@yydefred = external global [43 x i16] ; <[43 x i16]*> [#uses=1]
-@yydgoto = external global [12 x i16] ; <[12 x i16]*> [#uses=1]
-@yysindex = external global [43 x i16] ; <[43 x i16]*> [#uses=2]
-@yyrindex = external global [43 x i16] ; <[43 x i16]*> [#uses=1]
-@yygindex = external global [12 x i16] ; <[12 x i16]*> [#uses=1]
-@yytable = external global [263 x i16] ; <[263 x i16]*> [#uses=4]
-@yycheck = external global [263 x i16] ; <[263 x i16]*> [#uses=4]
-@yynerrs = external global i32 ; <i32*> [#uses=3]
-@yyerrflag = external global i32 ; <i32*> [#uses=6]
-@yychar = external global i32 ; <i32*> [#uses=15]
-@yyssp = external global i16* ; <i16**> [#uses=15]
-@yyvsp = external global %YYSTYPE* ; <%YYSTYPE**> [#uses=30]
-@yyval = external global %YYSTYPE ; <%YYSTYPE*> [#uses=1]
-@yyss = external global i16* ; <i16**> [#uses=3]
-@yysslim = external global i16* ; <i16**> [#uses=3]
-@yyvs = external global %YYSTYPE* ; <%YYSTYPE**> [#uses=1]
-@.LC01 = external global [13 x i8] ; <[13 x i8]*> [#uses=1]
-@.LC1 = external global [20 x i8] ; <[20 x i8]*> [#uses=1]
-
-define i32 @yyparse() {
-bb0:
- store i32 0, i32* @yynerrs
- store i32 0, i32* @yyerrflag
- store i32 -1, i32* @yychar
- %reg113 = load i16** @yyss ; <i16*> [#uses=1]
- %cond581 = icmp ne i16* %reg113, null ; <i1> [#uses=1]
- br i1 %cond581, label %bb3, label %bb2
-
-bb2: ; preds = %bb0
- %reg584 = call i32 @yygrowstack( ) ; <i32> [#uses=1]
- %cond584 = icmp ne i32 %reg584, 0 ; <i1> [#uses=1]
- br i1 %cond584, label %bb113, label %bb3
-
-bb3: ; preds = %bb2, %bb0
- %reg115 = load i16** @yyss ; <i16*> [#uses=1]
- store i16* %reg115, i16** @yyssp
- %reg116 = load %YYSTYPE** @yyvs ; <%YYSTYPE*> [#uses=1]
- store %YYSTYPE* %reg116, %YYSTYPE** @yyvsp
- %reg117 = load i16** @yyssp ; <i16*> [#uses=1]
- store i16 0, i16* %reg117
- br label %bb4
-
-bb4: ; preds = %bb112, %bb102, %bb35, %bb31, %bb15, %bb14, %bb3
- %reg458 = phi i32 [ %reg476, %bb112 ], [ 1, %bb102 ], [ %reg458, %bb35 ], [ %cast768, %bb31 ], [ %cast658, %bb15 ], [ %cast658, %bb14 ], [ 0, %bb3 ] ; <i32> [#uses=2]
- %reg458-idxcast = zext i32 %reg458 to i64 ; <i64> [#uses=3]
- %reg594 = getelementptr [43 x i16]* @yydefred, i64 0, i64 %reg458-idxcast ; <i16*> [#uses=1]
- %reg125 = load i16* %reg594 ; <i16> [#uses=1]
- %cast599 = sext i16 %reg125 to i32 ; <i32> [#uses=2]
- %cond600 = icmp ne i32 %cast599, 0 ; <i1> [#uses=1]
- br i1 %cond600, label %bb36, label %bb5
-
-bb5: ; preds = %bb4
- %reg127 = load i32* @yychar ; <i32> [#uses=1]
- %cond603 = icmp sge i32 %reg127, 0 ; <i1> [#uses=1]
- br i1 %cond603, label %bb8, label %bb6
-
-bb6: ; preds = %bb5
- %reg607 = call i32 @yylex( ) ; <i32> [#uses=1]
- store i32 %reg607, i32* @yychar
- %reg129 = load i32* @yychar ; <i32> [#uses=1]
- %cond609 = icmp sge i32 %reg129, 0 ; <i1> [#uses=1]
- br i1 %cond609, label %bb8, label %bb7
-
-bb7: ; preds = %bb6
- store i32 0, i32* @yychar
- br label %bb8
-
-bb8: ; preds = %bb7, %bb6, %bb5
- %reg615 = getelementptr [43 x i16]* @yysindex, i64 0, i64 %reg458-idxcast ; <i16*> [#uses=1]
- %reg137 = load i16* %reg615 ; <i16> [#uses=1]
- %cast620 = sext i16 %reg137 to i32 ; <i32> [#uses=2]
- %cond621 = icmp eq i32 %cast620, 0 ; <i1> [#uses=1]
- br i1 %cond621, label %bb16, label %bb9
-
-bb9: ; preds = %bb8
- %reg139 = load i32* @yychar ; <i32> [#uses=2]
- %reg460 = add i32 %cast620, %reg139 ; <i32> [#uses=3]
- %cond624 = icmp slt i32 %reg460, 0 ; <i1> [#uses=1]
- br i1 %cond624, label %bb16, label %bb10
-
-bb10: ; preds = %bb9
- %cond627 = icmp sgt i32 %reg460, 262 ; <i1> [#uses=1]
- br i1 %cond627, label %bb16, label %bb11
-
-bb11: ; preds = %bb10
- %reg460-idxcast = sext i32 %reg460 to i64 ; <i64> [#uses=2]
- %reg632 = getelementptr [263 x i16]* @yycheck, i64 0, i64 %reg460-idxcast ; <i16*> [#uses=1]
- %reg148 = load i16* %reg632 ; <i16> [#uses=1]
- %cast637 = sext i16 %reg148 to i32 ; <i32> [#uses=1]
- %cond639 = icmp ne i32 %cast637, %reg139 ; <i1> [#uses=1]
- br i1 %cond639, label %bb16, label %bb12
-
-bb12: ; preds = %bb11
- %reg150 = load i16** @yyssp ; <i16*> [#uses=1]
- %cast640 = bitcast i16* %reg150 to i8* ; <i8*> [#uses=1]
- %reg151 = load i16** @yysslim ; <i16*> [#uses=1]
- %cast641 = bitcast i16* %reg151 to i8* ; <i8*> [#uses=1]
- %cond642 = icmp ult i8* %cast640, %cast641 ; <i1> [#uses=1]
- br i1 %cond642, label %bb14, label %bb13
-
-bb13: ; preds = %bb12
- %reg644 = call i32 @yygrowstack( ) ; <i32> [#uses=1]
- %cond644 = icmp ne i32 %reg644, 0 ; <i1> [#uses=1]
- br i1 %cond644, label %bb113, label %bb14
-
-bb14: ; preds = %bb13, %bb12
- %reg153 = load i16** @yyssp ; <i16*> [#uses=1]
- %reg647 = getelementptr i16* %reg153, i64 1 ; <i16*> [#uses=2]
- store i16* %reg647, i16** @yyssp
- %reg653 = getelementptr [263 x i16]* @yytable, i64 0, i64 %reg460-idxcast ; <i16*> [#uses=1]
- %reg162 = load i16* %reg653 ; <i16> [#uses=2]
- %cast658 = sext i16 %reg162 to i32 ; <i32> [#uses=2]
- store i16 %reg162, i16* %reg647
- %reg164 = load %YYSTYPE** @yyvsp ; <%YYSTYPE*> [#uses=2]
- %reg661 = getelementptr %YYSTYPE* %reg164, i64 1 ; <%YYSTYPE*> [#uses=1]
- store %YYSTYPE* %reg661, %YYSTYPE** @yyvsp
- %reg167 = load %IntList* getelementptr (%YYSTYPE* @yylval, i64 0, i32 0) ; <%IntList> [#uses=1]
- %reg661.idx1 = getelementptr %YYSTYPE* %reg164, i64 1, i32 0 ; <%IntList*> [#uses=1]
- store %IntList %reg167, %IntList* %reg661.idx1
- store i32 -1, i32* @yychar
- %reg169 = load i32* @yyerrflag ; <i32> [#uses=2]
- %cond669 = icmp sle i32 %reg169, 0 ; <i1> [#uses=1]
- br i1 %cond669, label %bb4, label %bb15
-
-bb15: ; preds = %bb14
- %reg171 = add i32 %reg169, -1 ; <i32> [#uses=1]
- store i32 %reg171, i32* @yyerrflag
- br label %bb4
-
-bb16: ; preds = %bb11, %bb10, %bb9, %bb8
- %reg677 = getelementptr [43 x i16]* @yyrindex, i64 0, i64 %reg458-idxcast ; <i16*> [#uses=1]
- %reg178 = load i16* %reg677 ; <i16> [#uses=1]
- %cast682 = sext i16 %reg178 to i32 ; <i32> [#uses=2]
- %cond683 = icmp eq i32 %cast682, 0 ; <i1> [#uses=1]
- br i1 %cond683, label %bb21, label %bb17
-
-bb17: ; preds = %bb16
- %reg180 = load i32* @yychar ; <i32> [#uses=2]
- %reg463 = add i32 %cast682, %reg180 ; <i32> [#uses=3]
- %cond686 = icmp slt i32 %reg463, 0 ; <i1> [#uses=1]
- br i1 %cond686, label %bb21, label %bb18
-
-bb18: ; preds = %bb17
- %cond689 = icmp sgt i32 %reg463, 262 ; <i1> [#uses=1]
- br i1 %cond689, label %bb21, label %bb19
-
-bb19: ; preds = %bb18
- %reg463-idxcast = sext i32 %reg463 to i64 ; <i64> [#uses=2]
- %reg694 = getelementptr [263 x i16]* @yycheck, i64 0, i64 %reg463-idxcast ; <i16*> [#uses=1]
- %reg189 = load i16* %reg694 ; <i16> [#uses=1]
- %cast699 = sext i16 %reg189 to i32 ; <i32> [#uses=1]
- %cond701 = icmp ne i32 %cast699, %reg180 ; <i1> [#uses=1]
- br i1 %cond701, label %bb21, label %bb20
-
-bb20: ; preds = %bb19
- %reg704 = getelementptr [263 x i16]* @yytable, i64 0, i64 %reg463-idxcast ; <i16*> [#uses=1]
- %reg197 = load i16* %reg704 ; <i16> [#uses=1]
- %cast709 = sext i16 %reg197 to i32 ; <i32> [#uses=1]
- br label %bb36
-
-bb21: ; preds = %bb19, %bb18, %bb17, %bb16
- %reg198 = load i32* @yyerrflag ; <i32> [#uses=1]
- %cond711 = icmp ne i32 %reg198, 0 ; <i1> [#uses=1]
- br i1 %cond711, label %bb23, label %bb22
-
-bb22: ; preds = %bb21
- call void @yyerror( i8* getelementptr ([13 x i8]* @.LC01, i64 0, i64 0) )
- %reg200 = load i32* @yynerrs ; <i32> [#uses=1]
- %reg201 = add i32 %reg200, 1 ; <i32> [#uses=1]
- store i32 %reg201, i32* @yynerrs
- br label %bb23
-
-bb23: ; preds = %bb22, %bb21
- %reg202 = load i32* @yyerrflag ; <i32> [#uses=1]
- %cond719 = icmp sgt i32 %reg202, 2 ; <i1> [#uses=1]
- br i1 %cond719, label %bb34, label %bb24
-
-bb24: ; preds = %bb23
- store i32 3, i32* @yyerrflag
- %reg241 = load i16** @yyss ; <i16*> [#uses=1]
- %cast778 = bitcast i16* %reg241 to i8* ; <i8*> [#uses=1]
- br label %bb25
-
-bb25: ; preds = %bb33, %bb24
- %reg204 = load i16** @yyssp ; <i16*> [#uses=4]
- %reg206 = load i16* %reg204 ; <i16> [#uses=1]
- %reg206-idxcast = sext i16 %reg206 to i64 ; <i64> [#uses=1]
- %reg727 = getelementptr [43 x i16]* @yysindex, i64 0, i64 %reg206-idxcast ; <i16*> [#uses=1]
- %reg212 = load i16* %reg727 ; <i16> [#uses=2]
- %cast732 = sext i16 %reg212 to i32 ; <i32> [#uses=2]
- %cond733 = icmp eq i32 %cast732, 0 ; <i1> [#uses=1]
- br i1 %cond733, label %bb32, label %bb26
-
-bb26: ; preds = %bb25
- %reg466 = add i32 %cast732, 256 ; <i32> [#uses=2]
- %cond736 = icmp slt i32 %reg466, 0 ; <i1> [#uses=1]
- br i1 %cond736, label %bb32, label %bb27
-
-bb27: ; preds = %bb26
- %cond739 = icmp sgt i32 %reg466, 262 ; <i1> [#uses=1]
- br i1 %cond739, label %bb32, label %bb28
-
-bb28: ; preds = %bb27
- %reg212-idxcast = sext i16 %reg212 to i64 ; <i64> [#uses=1]
- %reg212-idxcast-offset = add i64 %reg212-idxcast, 256 ; <i64> [#uses=2]
- %reg744 = getelementptr [263 x i16]* @yycheck, i64 0, i64 %reg212-idxcast-offset ; <i16*> [#uses=1]
- %reg221 = load i16* %reg744 ; <i16> [#uses=1]
- %cond748 = icmp ne i16 %reg221, 256 ; <i1> [#uses=1]
- br i1 %cond748, label %bb32, label %bb29
-
-bb29: ; preds = %bb28
- %cast750 = bitcast i16* %reg204 to i8* ; <i8*> [#uses=1]
- %reg223 = load i16** @yysslim ; <i16*> [#uses=1]
- %cast751 = bitcast i16* %reg223 to i8* ; <i8*> [#uses=1]
- %cond752 = icmp ult i8* %cast750, %cast751 ; <i1> [#uses=1]
- br i1 %cond752, label %bb31, label %bb30
-
-bb30: ; preds = %bb29
- %reg754 = call i32 @yygrowstack( ) ; <i32> [#uses=1]
- %cond754 = icmp ne i32 %reg754, 0 ; <i1> [#uses=1]
- br i1 %cond754, label %bb113, label %bb31
-
-bb31: ; preds = %bb30, %bb29
- %reg225 = load i16** @yyssp ; <i16*> [#uses=1]
- %reg757 = getelementptr i16* %reg225, i64 1 ; <i16*> [#uses=2]
- store i16* %reg757, i16** @yyssp
- %reg763 = getelementptr [263 x i16]* @yytable, i64 0, i64 %reg212-idxcast-offset ; <i16*> [#uses=1]
- %reg234 = load i16* %reg763 ; <i16> [#uses=2]
- %cast768 = sext i16 %reg234 to i32 ; <i32> [#uses=1]
- store i16 %reg234, i16* %reg757
- %reg236 = load %YYSTYPE** @yyvsp ; <%YYSTYPE*> [#uses=2]
- %reg771 = getelementptr %YYSTYPE* %reg236, i64 1 ; <%YYSTYPE*> [#uses=1]
- store %YYSTYPE* %reg771, %YYSTYPE** @yyvsp
- %reg239 = load %IntList* getelementptr (%YYSTYPE* @yylval, i64 0, i32 0) ; <%IntList> [#uses=1]
- %reg771.idx1 = getelementptr %YYSTYPE* %reg236, i64 1, i32 0 ; <%IntList*> [#uses=1]
- store %IntList %reg239, %IntList* %reg771.idx1
- br label %bb4
-
-bb32: ; preds = %bb28, %bb27, %bb26, %bb25
- %cast777 = bitcast i16* %reg204 to i8* ; <i8*> [#uses=1]
- %cond779 = icmp ule i8* %cast777, %cast778 ; <i1> [#uses=1]
- br i1 %cond779, label %UnifiedExitNode, label %bb33
-
-bb33: ; preds = %bb32
- %reg781 = getelementptr i16* %reg204, i64 -1 ; <i16*> [#uses=1]
- store i16* %reg781, i16** @yyssp
- %reg244 = load %YYSTYPE** @yyvsp ; <%YYSTYPE*> [#uses=1]
- %reg786 = getelementptr %YYSTYPE* %reg244, i64 -1 ; <%YYSTYPE*> [#uses=1]
- store %YYSTYPE* %reg786, %YYSTYPE** @yyvsp
- br label %bb25
-
-bb34: ; preds = %bb23
- %reg246 = load i32* @yychar ; <i32> [#uses=1]
- %cond791 = icmp eq i32 %reg246, 0 ; <i1> [#uses=1]
- br i1 %cond791, label %UnifiedExitNode, label %bb35
-
-bb35: ; preds = %bb34
- store i32 -1, i32* @yychar
- br label %bb4
-
-bb36: ; preds = %bb20, %bb4
- %reg468 = phi i32 [ %cast709, %bb20 ], [ %cast599, %bb4 ] ; <i32> [#uses=31]
- %reg468-idxcast = sext i32 %reg468 to i64 ; <i64> [#uses=2]
- %reg796 = getelementptr [25 x i16]* @yylen, i64 0, i64 %reg468-idxcast ; <i16*> [#uses=1]
- %reg254 = load i16* %reg796 ; <i16> [#uses=2]
- %reg259 = load %YYSTYPE** @yyvsp ; <%YYSTYPE*> [#uses=1]
- %reg254-idxcast = sext i16 %reg254 to i64 ; <i64> [#uses=1]
- %reg254-idxcast-scale = mul i64 %reg254-idxcast, -1 ; <i64> [#uses=1]
- %reg254-idxcast-scale-offset = add i64 %reg254-idxcast-scale, 1 ; <i64> [#uses=1]
- %reg261.idx1 = getelementptr %YYSTYPE* %reg259, i64 %reg254-idxcast-scale-offset, i32 0 ; <%IntList*> [#uses=1]
- %reg261 = load %IntList* %reg261.idx1 ; <%IntList> [#uses=1]
- store %IntList %reg261, %IntList* getelementptr (%YYSTYPE* @yyval, i64 0, i32 0)
- %cond812 = icmp eq i32 %reg468, 13 ; <i1> [#uses=1]
- br i1 %cond812, label %bb85, label %bb37
-
-bb37: ; preds = %bb36
- %cond814 = icmp sgt i32 %reg468, 13 ; <i1> [#uses=1]
- br i1 %cond814, label %bb56, label %bb38
-
-bb38: ; preds = %bb37
- %cond817 = icmp eq i32 %reg468, 7 ; <i1> [#uses=1]
- br i1 %cond817, label %bb79, label %bb39
-
-bb39: ; preds = %bb38
- %cond819 = icmp sgt i32 %reg468, 7 ; <i1> [#uses=1]
- br i1 %cond819, label %bb48, label %bb40
-
-bb40: ; preds = %bb39
- %cond822 = icmp eq i32 %reg468, 4 ; <i1> [#uses=1]
- br i1 %cond822, label %bb76, label %bb41
-
-bb41: ; preds = %bb40
- %cond824 = icmp sgt i32 %reg468, 4 ; <i1> [#uses=1]
- br i1 %cond824, label %bb45, label %bb42
-
-bb42: ; preds = %bb41
- %cond827 = icmp eq i32 %reg468, 2 ; <i1> [#uses=1]
- br i1 %cond827, label %bb74, label %bb43
-
-bb43: ; preds = %bb42
- %cond829 = icmp eq i32 %reg468, 3 ; <i1> [#uses=1]
- br i1 %cond829, label %bb75, label %bb97
-
-bb45: ; preds = %bb41
- %cond831 = icmp eq i32 %reg468, 5 ; <i1> [#uses=1]
- br i1 %cond831, label %bb77, label %bb46
-
-bb46: ; preds = %bb45
- %cond833 = icmp eq i32 %reg468, 6 ; <i1> [#uses=1]
- br i1 %cond833, label %bb78, label %bb97
-
-bb48: ; preds = %bb39
- %cond835 = icmp eq i32 %reg468, 10 ; <i1> [#uses=1]
- br i1 %cond835, label %bb82, label %bb49
-
-bb49: ; preds = %bb48
- %cond837 = icmp sgt i32 %reg468, 10 ; <i1> [#uses=1]
- br i1 %cond837, label %bb53, label %bb50
-
-bb50: ; preds = %bb49
- %cond840 = icmp eq i32 %reg468, 8 ; <i1> [#uses=1]
- br i1 %cond840, label %bb80, label %bb51
-
-bb51: ; preds = %bb50
- %cond842 = icmp eq i32 %reg468, 9 ; <i1> [#uses=1]
- br i1 %cond842, label %bb81, label %bb97
-
-bb53: ; preds = %bb49
- %cond844 = icmp eq i32 %reg468, 11 ; <i1> [#uses=1]
- br i1 %cond844, label %bb83, label %bb54
-
-bb54: ; preds = %bb53
- %cond846 = icmp eq i32 %reg468, 12 ; <i1> [#uses=1]
- br i1 %cond846, label %bb84, label %bb97
-
-bb56: ; preds = %bb37
- %cond848 = icmp eq i32 %reg468, 19 ; <i1> [#uses=1]
- br i1 %cond848, label %bb91, label %bb57
-
-bb57: ; preds = %bb56
- %cond850 = icmp sgt i32 %reg468, 19 ; <i1> [#uses=1]
- br i1 %cond850, label %bb66, label %bb58
-
-bb58: ; preds = %bb57
- %cond853 = icmp eq i32 %reg468, 16 ; <i1> [#uses=1]
- br i1 %cond853, label %bb88, label %bb59
-
-bb59: ; preds = %bb58
- %cond855 = icmp sgt i32 %reg468, 16 ; <i1> [#uses=1]
- br i1 %cond855, label %bb63, label %bb60
-
-bb60: ; preds = %bb59
- %cond858 = icmp eq i32 %reg468, 14 ; <i1> [#uses=1]
- br i1 %cond858, label %bb86, label %bb61
-
-bb61: ; preds = %bb60
- %cond860 = icmp eq i32 %reg468, 15 ; <i1> [#uses=1]
- br i1 %cond860, label %bb87, label %bb97
-
-bb63: ; preds = %bb59
- %cond862 = icmp eq i32 %reg468, 17 ; <i1> [#uses=1]
- br i1 %cond862, label %bb89, label %bb64
-
-bb64: ; preds = %bb63
- %cond864 = icmp eq i32 %reg468, 18 ; <i1> [#uses=1]
- br i1 %cond864, label %bb90, label %bb97
-
-bb66: ; preds = %bb57
- %cond866 = icmp eq i32 %reg468, 22 ; <i1> [#uses=1]
- br i1 %cond866, label %bb94, label %bb67
-
-bb67: ; preds = %bb66
- %cond868 = icmp sgt i32 %reg468, 22 ; <i1> [#uses=1]
- br i1 %cond868, label %bb71, label %bb68
-
-bb68: ; preds = %bb67
- %cond871 = icmp eq i32 %reg468, 20 ; <i1> [#uses=1]
- br i1 %cond871, label %bb92, label %bb69
-
-bb69: ; preds = %bb68
- %cond873 = icmp eq i32 %reg468, 21 ; <i1> [#uses=1]
- br i1 %cond873, label %bb93, label %bb97
-
-bb71: ; preds = %bb67
- %cond875 = icmp eq i32 %reg468, 23 ; <i1> [#uses=1]
- br i1 %cond875, label %bb95, label %bb72
-
-bb72: ; preds = %bb71
- %cond877 = icmp eq i32 %reg468, 24 ; <i1> [#uses=1]
- br i1 %cond877, label %bb96, label %bb97
-
-bb74: ; preds = %bb42
- call void @yyfinished( )
- br label %bb97
-
-bb75: ; preds = %bb43
- %reg262 = load %YYSTYPE** @yyvsp ; <%YYSTYPE*> [#uses=2]
- %reg264.idx1 = getelementptr %YYSTYPE* %reg262, i64 -2, i32 0 ; <%IntList*> [#uses=1]
- %reg264 = load %IntList* %reg264.idx1 ; <%IntList> [#uses=1]
- %reg265.idx = getelementptr %YYSTYPE* %reg262, i64 0, i32 0 ; <%IntList*> [#uses=1]
- %reg265 = load %IntList* %reg265.idx ; <%IntList> [#uses=1]
- %cast889 = bitcast %IntList %reg265 to %List ; <%List> [#uses=1]
- %cast890 = bitcast %IntList %reg264 to %List ; <%List> [#uses=1]
- call void @doSpec( %List %cast890, %List %cast889 )
- br label %bb97
-
-bb76: ; preds = %bb40
- store %IntList null, %IntList* getelementptr (%YYSTYPE* @yyval, i64 0, i32 0)
- br label %bb97
-
-bb77: ; preds = %bb45
- %reg269 = load %YYSTYPE** @yyvsp ; <%YYSTYPE*> [#uses=2]
- %cast894 = getelementptr %YYSTYPE* %reg269, i64 0, i32 0 ; <%IntList*> [#uses=1]
- %reg271 = load %IntList* %cast894 ; <%IntList> [#uses=1]
- %reg271.upgrd.1 = bitcast %IntList %reg271 to i8* ; <i8*> [#uses=1]
- %reg272.idx1 = getelementptr %YYSTYPE* %reg269, i64 -1, i32 0 ; <%IntList*> [#uses=1]
- %reg272 = load %IntList* %reg272.idx1 ; <%IntList> [#uses=1]
- %cast901 = bitcast %IntList %reg272 to %List ; <%List> [#uses=1]
- %reg901 = call %List @newList( i8* %reg271.upgrd.1, %List %cast901 ) ; <%List> [#uses=1]
- bitcast %List %reg901 to %IntList ; <%IntList>:0 [#uses=1]
- store %IntList %0, %IntList* getelementptr (%YYSTYPE* @yyval, i64 0, i32 0)
- br label %bb97
-
-bb78: ; preds = %bb46
- %reg275 = load %YYSTYPE** @yyvsp ; <%YYSTYPE*> [#uses=1]
- %reg277.idx = getelementptr %YYSTYPE* %reg275, i64 0, i32 0 ; <%IntList*> [#uses=1]
- %reg277 = load %IntList* %reg277.idx ; <%IntList> [#uses=1]
- %cast907 = bitcast %IntList %reg277 to %List ; <%List> [#uses=1]
- %reg907 = call %Arity @newArity( i32 -1, %List %cast907 ) ; <%Arity> [#uses=1]
- bitcast %Arity %reg907 to %IntList ; <%IntList>:1 [#uses=1]
- store %IntList %1, %IntList* getelementptr (%YYSTYPE* @yyval, i64 0, i32 0)
- br label %bb97
-
-bb79: ; preds = %bb38
- store %IntList null, %IntList* getelementptr (%YYSTYPE* @yyval, i64 0, i32 0)
- %reg281 = load %YYSTYPE** @yyvsp ; <%YYSTYPE*> [#uses=1]
- %cast912 = getelementptr %YYSTYPE* %reg281, i64 0, i32 0 ; <%IntList*> [#uses=1]
- %reg282 = load %IntList* %cast912 ; <%IntList> [#uses=1]
- %reg282.upgrd.2 = bitcast %IntList %reg282 to %List ; <%List> [#uses=1]
- call void @doGram( %List %reg282.upgrd.2 )
- br label %bb97
-
-bb80: ; preds = %bb50
- store %IntList null, %IntList* getelementptr (%YYSTYPE* @yyval, i64 0, i32 0)
- %reg285 = load %YYSTYPE** @yyvsp ; <%YYSTYPE*> [#uses=1]
- %cast917 = getelementptr %YYSTYPE* %reg285, i64 0, i32 0 ; <%IntList*> [#uses=1]
- %reg286 = load %IntList* %cast917 ; <%IntList> [#uses=1]
- %reg286.upgrd.3 = bitcast %IntList %reg286 to i8* ; <i8*> [#uses=1]
- call void @doStart( i8* %reg286.upgrd.3 )
- br label %bb97
-
-bb81: ; preds = %bb51
- store %IntList null, %IntList* getelementptr (%YYSTYPE* @yyval, i64 0, i32 0)
- br label %bb97
-
-bb82: ; preds = %bb48
- %reg290 = load %YYSTYPE** @yyvsp ; <%YYSTYPE*> [#uses=2]
- %cast923 = getelementptr %YYSTYPE* %reg290, i64 0, i32 0 ; <%IntList*> [#uses=1]
- %reg292 = load %IntList* %cast923 ; <%IntList> [#uses=1]
- %reg292.upgrd.4 = bitcast %IntList %reg292 to i8* ; <i8*> [#uses=1]
- %reg293.idx1 = getelementptr %YYSTYPE* %reg290, i64 -1, i32 0 ; <%IntList*> [#uses=1]
- %reg293 = load %IntList* %reg293.idx1 ; <%IntList> [#uses=1]
- %cast930 = bitcast %IntList %reg293 to %List ; <%List> [#uses=1]
- %reg930 = call %List @newList( i8* %reg292.upgrd.4, %List %cast930 ) ; <%List> [#uses=1]
- bitcast %List %reg930 to %IntList ; <%IntList>:2 [#uses=1]
- store %IntList %2, %IntList* getelementptr (%YYSTYPE* @yyval, i64 0, i32 0)
- br label %bb97
-
-bb83: ; preds = %bb53
- store %IntList null, %IntList* getelementptr (%YYSTYPE* @yyval, i64 0, i32 0)
- br label %bb97
-
-bb84: ; preds = %bb54
- %reg298 = load %YYSTYPE** @yyvsp ; <%YYSTYPE*> [#uses=2]
- %cast936 = getelementptr %YYSTYPE* %reg298, i64 0, i32 0 ; <%IntList*> [#uses=1]
- %reg300 = load %IntList* %cast936 ; <%IntList> [#uses=1]
- %reg300.upgrd.5 = bitcast %IntList %reg300 to i8* ; <i8*> [#uses=1]
- %reg301.idx1 = getelementptr %YYSTYPE* %reg298, i64 -1, i32 0 ; <%IntList*> [#uses=1]
- %reg301 = load %IntList* %reg301.idx1 ; <%IntList> [#uses=1]
- %cast943 = bitcast %IntList %reg301 to %List ; <%List> [#uses=1]
- %reg943 = call %List @newList( i8* %reg300.upgrd.5, %List %cast943 ) ; <%List> [#uses=1]
- bitcast %List %reg943 to %IntList ; <%IntList>:3 [#uses=1]
- store %IntList %3, %IntList* getelementptr (%YYSTYPE* @yyval, i64 0, i32 0)
- br label %bb97
-
-bb85: ; preds = %bb36
- %reg304 = load %YYSTYPE** @yyvsp ; <%YYSTYPE*> [#uses=2]
- %cast9521 = getelementptr %YYSTYPE* %reg304, i64 -2, i32 0 ; <%IntList*> [#uses=1]
- %reg306 = load %IntList* %cast9521 ; <%IntList> [#uses=1]
- %reg306.upgrd.6 = bitcast %IntList %reg306 to i8* ; <i8*> [#uses=1]
- %cast953 = bitcast %YYSTYPE* %reg304 to i32* ; <i32*> [#uses=1]
- %reg307 = load i32* %cast953 ; <i32> [#uses=1]
- %reg955 = call %Binding @newBinding( i8* %reg306.upgrd.6, i32 %reg307 ) ; <%Binding> [#uses=1]
- bitcast %Binding %reg955 to %IntList ; <%IntList>:4 [#uses=1]
- store %IntList %4, %IntList* getelementptr (%YYSTYPE* @yyval, i64 0, i32 0)
- br label %bb97
-
-bb86: ; preds = %bb60
- store %IntList null, %IntList* getelementptr (%YYSTYPE* @yyval, i64 0, i32 0)
- br label %bb97
-
-bb87: ; preds = %bb61
- %reg312 = load %YYSTYPE** @yyvsp ; <%YYSTYPE*> [#uses=2]
- %cast961 = getelementptr %YYSTYPE* %reg312, i64 0, i32 0 ; <%IntList*> [#uses=1]
- %reg314 = load %IntList* %cast961 ; <%IntList> [#uses=1]
- %reg314.upgrd.7 = bitcast %IntList %reg314 to i8* ; <i8*> [#uses=1]
- %reg315.idx1 = getelementptr %YYSTYPE* %reg312, i64 -1, i32 0 ; <%IntList*> [#uses=1]
- %reg315 = load %IntList* %reg315.idx1 ; <%IntList> [#uses=1]
- %cast968 = bitcast %IntList %reg315 to %List ; <%List> [#uses=1]
- %reg968 = call %List @newList( i8* %reg314.upgrd.7, %List %cast968 ) ; <%List> [#uses=1]
- bitcast %List %reg968 to %IntList ; <%IntList>:5 [#uses=1]
- store %IntList %5, %IntList* getelementptr (%YYSTYPE* @yyval, i64 0, i32 0)
- br label %bb97
-
-bb88: ; preds = %bb58
- %reg318 = load %YYSTYPE** @yyvsp ; <%YYSTYPE*> [#uses=4]
- %cast9791 = getelementptr %YYSTYPE* %reg318, i64 -6, i32 0 ; <%IntList*> [#uses=1]
- %reg322 = load %IntList* %cast9791 ; <%IntList> [#uses=1]
- %reg322.upgrd.8 = bitcast %IntList %reg322 to i8* ; <i8*> [#uses=1]
- %reg323.idx1 = getelementptr %YYSTYPE* %reg318, i64 -4, i32 0 ; <%IntList*> [#uses=1]
- %reg323 = load %IntList* %reg323.idx1 ; <%IntList> [#uses=1]
- %reg987 = getelementptr %YYSTYPE* %reg318, i64 -2 ; <%YYSTYPE*> [#uses=1]
- %cast989 = bitcast %YYSTYPE* %reg987 to i32* ; <i32*> [#uses=1]
- %reg324 = load i32* %cast989 ; <i32> [#uses=1]
- %reg325.idx1 = getelementptr %YYSTYPE* %reg318, i64 -1, i32 0 ; <%IntList*> [#uses=1]
- %reg325 = load %IntList* %reg325.idx1 ; <%IntList> [#uses=1]
- %cast998 = bitcast %IntList %reg323 to %PatternAST ; <%PatternAST> [#uses=1]
- %reg996 = call %RuleAST @newRuleAST( i8* %reg322.upgrd.8, %PatternAST %cast998, i32 %reg324, %IntList %reg325 ) ; <%RuleAST> [#uses=1]
- bitcast %RuleAST %reg996 to %IntList ; <%IntList>:6 [#uses=1]
- store %IntList %6, %IntList* getelementptr (%YYSTYPE* @yyval, i64 0, i32 0)
- br label %bb97
-
-bb89: ; preds = %bb63
- %reg328 = load %YYSTYPE** @yyvsp ; <%YYSTYPE*> [#uses=1]
- %cast1002 = getelementptr %YYSTYPE* %reg328, i64 0, i32 0 ; <%IntList*> [#uses=1]
- %reg329 = load %IntList* %cast1002 ; <%IntList> [#uses=1]
- %reg329.upgrd.9 = bitcast %IntList %reg329 to i8* ; <i8*> [#uses=1]
- %reg1004 = call %PatternAST @newPatternAST( i8* %reg329.upgrd.9, %List null ) ; <%PatternAST> [#uses=1]
- bitcast %PatternAST %reg1004 to %IntList ; <%IntList>:7 [#uses=1]
- store %IntList %7, %IntList* getelementptr (%YYSTYPE* @yyval, i64 0, i32 0)
- br label %bb97
-
-bb90: ; preds = %bb64
- %reg333 = load %YYSTYPE** @yyvsp ; <%YYSTYPE*> [#uses=2]
- %cast10131 = getelementptr %YYSTYPE* %reg333, i64 -1, i32 0 ; <%IntList*> [#uses=1]
- %reg335 = load %IntList* %cast10131 ; <%IntList> [#uses=1]
- %reg335.upgrd.10 = bitcast %IntList %reg335 to i8* ; <i8*> [#uses=1]
- %reg1015 = call %List @newList( i8* %reg335.upgrd.10, %List null ) ; <%List> [#uses=1]
- %cast10211 = getelementptr %YYSTYPE* %reg333, i64 -3, i32 0 ; <%IntList*> [#uses=1]
- %reg338 = load %IntList* %cast10211 ; <%IntList> [#uses=1]
- %reg338.upgrd.11 = bitcast %IntList %reg338 to i8* ; <i8*> [#uses=1]
- %reg1023 = call %PatternAST @newPatternAST( i8* %reg338.upgrd.11, %List %reg1015 ) ; <%PatternAST> [#uses=1]
- bitcast %PatternAST %reg1023 to %IntList ; <%IntList>:8 [#uses=1]
- store %IntList %8, %IntList* getelementptr (%YYSTYPE* @yyval, i64 0, i32 0)
- br label %bb97
-
-bb91: ; preds = %bb56
- %reg341 = load %YYSTYPE** @yyvsp ; <%YYSTYPE*> [#uses=3]
- %cast10331 = getelementptr %YYSTYPE* %reg341, i64 -1, i32 0 ; <%IntList*> [#uses=1]
- %reg344 = load %IntList* %cast10331 ; <%IntList> [#uses=1]
- %reg344.upgrd.12 = bitcast %IntList %reg344 to i8* ; <i8*> [#uses=1]
- %reg1035 = call %List @newList( i8* %reg344.upgrd.12, %List null ) ; <%List> [#uses=1]
- %cast10411 = getelementptr %YYSTYPE* %reg341, i64 -3, i32 0 ; <%IntList*> [#uses=1]
- %reg347 = load %IntList* %cast10411 ; <%IntList> [#uses=1]
- %reg347.upgrd.13 = bitcast %IntList %reg347 to i8* ; <i8*> [#uses=1]
- %reg1043 = call %List @newList( i8* %reg347.upgrd.13, %List %reg1035 ) ; <%List> [#uses=1]
- %cast10491 = getelementptr %YYSTYPE* %reg341, i64 -5, i32 0 ; <%IntList*> [#uses=1]
- %reg349 = load %IntList* %cast10491 ; <%IntList> [#uses=1]
- %reg349.upgrd.14 = bitcast %IntList %reg349 to i8* ; <i8*> [#uses=1]
- %reg1051 = call %PatternAST @newPatternAST( i8* %reg349.upgrd.14, %List %reg1043 ) ; <%PatternAST> [#uses=1]
- bitcast %PatternAST %reg1051 to %IntList ; <%IntList>:9 [#uses=1]
- store %IntList %9, %IntList* getelementptr (%YYSTYPE* @yyval, i64 0, i32 0)
- br label %bb97
-
-bb92: ; preds = %bb68
- store %IntList null, %IntList* getelementptr (%YYSTYPE* @yyval, i64 0, i32 0)
- br label %bb97
-
-bb93: ; preds = %bb69
- %reg354 = load %YYSTYPE** @yyvsp ; <%YYSTYPE*> [#uses=2]
- %reg1059 = getelementptr %YYSTYPE* %reg354, i64 -2 ; <%YYSTYPE*> [#uses=1]
- %cast1061 = bitcast %YYSTYPE* %reg1059 to i32* ; <i32*> [#uses=1]
- %reg356 = load i32* %cast1061 ; <i32> [#uses=1]
- %reg357.idx1 = getelementptr %YYSTYPE* %reg354, i64 -1, i32 0 ; <%IntList*> [#uses=1]
- %reg357 = load %IntList* %reg357.idx1 ; <%IntList> [#uses=1]
- %reg1068 = call %IntList @newIntList( i32 %reg356, %IntList %reg357 ) ; <%IntList> [#uses=1]
- store %IntList %reg1068, %IntList* getelementptr (%YYSTYPE* @yyval, i64 0, i32 0)
- br label %bb97
-
-bb94: ; preds = %bb66
- store %IntList null, %IntList* getelementptr (%YYSTYPE* @yyval, i64 0, i32 0)
- br label %bb97
-
-bb95: ; preds = %bb71
- %reg362 = load %YYSTYPE** @yyvsp ; <%YYSTYPE*> [#uses=2]
- %reg1076 = getelementptr %YYSTYPE* %reg362, i64 -1 ; <%YYSTYPE*> [#uses=1]
- %cast1078 = bitcast %YYSTYPE* %reg1076 to i32* ; <i32*> [#uses=1]
- %reg364 = load i32* %cast1078 ; <i32> [#uses=1]
- %reg365.idx = getelementptr %YYSTYPE* %reg362, i64 0, i32 0 ; <%IntList*> [#uses=1]
- %reg365 = load %IntList* %reg365.idx ; <%IntList> [#uses=1]
- %reg1081 = call %IntList @newIntList( i32 %reg364, %IntList %reg365 ) ; <%IntList> [#uses=1]
- store %IntList %reg1081, %IntList* getelementptr (%YYSTYPE* @yyval, i64 0, i32 0)
- br label %bb97
-
-bb96: ; preds = %bb72
- %reg368 = load %YYSTYPE** @yyvsp ; <%YYSTYPE*> [#uses=2]
- %reg1088 = getelementptr %YYSTYPE* %reg368, i64 -1 ; <%YYSTYPE*> [#uses=1]
- %cast1090 = bitcast %YYSTYPE* %reg1088 to i32* ; <i32*> [#uses=1]
- %reg370 = load i32* %cast1090 ; <i32> [#uses=1]
- %reg371.idx = getelementptr %YYSTYPE* %reg368, i64 0, i32 0 ; <%IntList*> [#uses=1]
- %reg371 = load %IntList* %reg371.idx ; <%IntList> [#uses=1]
- %reg1093 = call %IntList @newIntList( i32 %reg370, %IntList %reg371 ) ; <%IntList> [#uses=1]
- store %IntList %reg1093, %IntList* getelementptr (%YYSTYPE* @yyval, i64 0, i32 0)
- br label %bb97
-
-bb97: ; preds = %bb96, %bb95, %bb94, %bb93, %bb92, %bb91, %bb90, %bb89, %bb88, %bb87, %bb86, %bb85, %bb84, %bb83, %bb82, %bb81, %bb80, %bb79, %bb78, %bb77, %bb76, %bb75, %bb74, %bb72, %bb69, %bb64, %bb61, %bb54, %bb51, %bb46, %bb43
- %cast1097 = sext i16 %reg254 to i64 ; <i64> [#uses=3]
- %reg375 = add i64 %cast1097, %cast1097 ; <i64> [#uses=1]
- %reg377 = load i16** @yyssp ; <i16*> [#uses=1]
- %cast379 = ptrtoint i16* %reg377 to i64 ; <i64> [#uses=1]
- %reg381 = sub i64 %cast379, %reg375 ; <i64> [#uses=1]
- %cast1099 = inttoptr i64 %reg381 to i16* ; <i16*> [#uses=1]
- store i16* %cast1099, i16** @yyssp
- %reg382 = load i16** @yyssp ; <i16*> [#uses=3]
- %reg383 = load i16* %reg382 ; <i16> [#uses=1]
- %cast1103 = sext i16 %reg383 to i32 ; <i32> [#uses=3]
- %reg385 = mul i64 %cast1097, 8 ; <i64> [#uses=1]
- %reg387 = load %YYSTYPE** @yyvsp ; <%YYSTYPE*> [#uses=1]
- %cast389 = ptrtoint %YYSTYPE* %reg387 to i64 ; <i64> [#uses=1]
- %reg391 = sub i64 %cast389, %reg385 ; <i64> [#uses=1]
- %cast1108 = inttoptr i64 %reg391 to %YYSTYPE* ; <%YYSTYPE*> [#uses=1]
- store %YYSTYPE* %cast1108, %YYSTYPE** @yyvsp
- %reg1111 = getelementptr [25 x i16]* @yylhs, i64 0, i64 %reg468-idxcast ; <i16*> [#uses=1]
- %reg398 = load i16* %reg1111 ; <i16> [#uses=2]
- %cast1116 = sext i16 %reg398 to i32 ; <i32> [#uses=1]
- %cond1117 = icmp ne i32 %cast1103, 0 ; <i1> [#uses=1]
- br i1 %cond1117, label %bb104, label %bb98
-
-bb98: ; preds = %bb97
- %cond1119 = icmp ne i32 %cast1116, 0 ; <i1> [#uses=1]
- br i1 %cond1119, label %bb104, label %bb99
-
-bb99: ; preds = %bb98
- %reg1122 = getelementptr i16* %reg382, i64 1 ; <i16*> [#uses=2]
- store i16* %reg1122, i16** @yyssp
- store i16 1, i16* %reg1122
- %reg403 = load %YYSTYPE** @yyvsp ; <%YYSTYPE*> [#uses=2]
- %reg1128 = getelementptr %YYSTYPE* %reg403, i64 1 ; <%YYSTYPE*> [#uses=1]
- store %YYSTYPE* %reg1128, %YYSTYPE** @yyvsp
- %reg406 = load %IntList* getelementptr (%YYSTYPE* @yyval, i64 0, i32 0) ; <%IntList> [#uses=1]
- %reg1128.idx1 = getelementptr %YYSTYPE* %reg403, i64 1, i32 0 ; <%IntList*> [#uses=1]
- store %IntList %reg406, %IntList* %reg1128.idx1
- %reg407 = load i32* @yychar ; <i32> [#uses=1]
- %cond1135 = icmp sge i32 %reg407, 0 ; <i1> [#uses=1]
- br i1 %cond1135, label %bb102, label %bb100
-
-bb100: ; preds = %bb99
- %reg1139 = call i32 @yylex( ) ; <i32> [#uses=1]
- store i32 %reg1139, i32* @yychar
- %reg409 = load i32* @yychar ; <i32> [#uses=1]
- %cond1141 = icmp sge i32 %reg409, 0 ; <i1> [#uses=1]
- br i1 %cond1141, label %bb102, label %bb101
-
-bb101: ; preds = %bb100
- store i32 0, i32* @yychar
- br label %bb102
-
-bb102: ; preds = %bb101, %bb100, %bb99
- %reg411 = load i32* @yychar ; <i32> [#uses=1]
- %cond1146 = icmp ne i32 %reg411, 0 ; <i1> [#uses=1]
- br i1 %cond1146, label %bb4, label %UnifiedExitNode
-
-bb104: ; preds = %bb98, %bb97
- %reg398-idxcast = sext i16 %reg398 to i64 ; <i64> [#uses=2]
- %reg1150 = getelementptr [12 x i16]* @yygindex, i64 0, i64 %reg398-idxcast ; <i16*> [#uses=1]
- %reg418 = load i16* %reg1150 ; <i16> [#uses=1]
- %cast1155 = sext i16 %reg418 to i32 ; <i32> [#uses=2]
- %cond1156 = icmp eq i32 %cast1155, 0 ; <i1> [#uses=1]
- br i1 %cond1156, label %bb109, label %bb105
-
-bb105: ; preds = %bb104
- %reg473 = add i32 %cast1155, %cast1103 ; <i32> [#uses=3]
- %cond1158 = icmp slt i32 %reg473, 0 ; <i1> [#uses=1]
- br i1 %cond1158, label %bb109, label %bb106
-
-bb106: ; preds = %bb105
- %cond1161 = icmp sgt i32 %reg473, 262 ; <i1> [#uses=1]
- br i1 %cond1161, label %bb109, label %bb107
-
-bb107: ; preds = %bb106
- %reg473-idxcast = sext i32 %reg473 to i64 ; <i64> [#uses=2]
- %reg1166 = getelementptr [263 x i16]* @yycheck, i64 0, i64 %reg473-idxcast ; <i16*> [#uses=1]
- %reg428 = load i16* %reg1166 ; <i16> [#uses=1]
- %cast1171 = sext i16 %reg428 to i32 ; <i32> [#uses=1]
- %cond1172 = icmp ne i32 %cast1171, %cast1103 ; <i1> [#uses=1]
- br i1 %cond1172, label %bb109, label %bb108
-
-bb108: ; preds = %bb107
- %reg1175 = getelementptr [263 x i16]* @yytable, i64 0, i64 %reg473-idxcast ; <i16*> [#uses=1]
- %reg435 = load i16* %reg1175 ; <i16> [#uses=1]
- %cast1180 = sext i16 %reg435 to i32 ; <i32> [#uses=1]
- br label %bb110
-
-bb109: ; preds = %bb107, %bb106, %bb105, %bb104
- %reg1183 = getelementptr [12 x i16]* @yydgoto, i64 0, i64 %reg398-idxcast ; <i16*> [#uses=1]
- %reg442 = load i16* %reg1183 ; <i16> [#uses=1]
- %cast1188 = sext i16 %reg442 to i32 ; <i32> [#uses=1]
- br label %bb110
-
-bb110: ; preds = %bb109, %bb108
- %reg476 = phi i32 [ %cast1188, %bb109 ], [ %cast1180, %bb108 ] ; <i32> [#uses=2]
- %cast1189 = bitcast i16* %reg382 to i8* ; <i8*> [#uses=1]
- %reg444 = load i16** @yysslim ; <i16*> [#uses=1]
- %cast1190 = bitcast i16* %reg444 to i8* ; <i8*> [#uses=1]
- %cond1191 = icmp ult i8* %cast1189, %cast1190 ; <i1> [#uses=1]
- br i1 %cond1191, label %bb112, label %bb111
-
-bb111: ; preds = %bb110
- %reg1193 = call i32 @yygrowstack( ) ; <i32> [#uses=1]
- %cond1193 = icmp ne i32 %reg1193, 0 ; <i1> [#uses=1]
- br i1 %cond1193, label %bb113, label %bb112
-
-bb112: ; preds = %bb111, %bb110
- %reg446 = load i16** @yyssp ; <i16*> [#uses=1]
- %reg1196 = getelementptr i16* %reg446, i64 1 ; <i16*> [#uses=2]
- store i16* %reg1196, i16** @yyssp
- %cast1357 = trunc i32 %reg476 to i16 ; <i16> [#uses=1]
- store i16 %cast1357, i16* %reg1196
- %reg449 = load %YYSTYPE** @yyvsp ; <%YYSTYPE*> [#uses=2]
- %reg1202 = getelementptr %YYSTYPE* %reg449, i64 1 ; <%YYSTYPE*> [#uses=1]
- store %YYSTYPE* %reg1202, %YYSTYPE** @yyvsp
- %reg452 = load %IntList* getelementptr (%YYSTYPE* @yyval, i64 0, i32 0) ; <%IntList> [#uses=1]
- %reg1202.idx1 = getelementptr %YYSTYPE* %reg449, i64 1, i32 0 ; <%IntList*> [#uses=1]
- store %IntList %reg452, %IntList* %reg1202.idx1
- br label %bb4
-
-bb113: ; preds = %bb111, %bb30, %bb13, %bb2
- call void @yyerror( i8* getelementptr ([20 x i8]* @.LC1, i64 0, i64 0) )
- br label %UnifiedExitNode
-
-UnifiedExitNode: ; preds = %bb113, %bb102, %bb34, %bb32
- %UnifiedRetVal = phi i32 [ 1, %bb113 ], [ 1, %bb34 ], [ 1, %bb32 ], [ 0, %bb102 ] ; <i32> [#uses=1]
- ret i32 %UnifiedRetVal
-}
-
-declare %List @newList(i8*, %List)
-
-declare %IntList @newIntList(i32, %IntList)
-
-declare void @doStart(i8*)
-
-declare void @yyerror(i8*)
-
-declare void @doSpec(%List, %List)
-
-declare %Arity @newArity(i32, %List)
-
-declare %Binding @newBinding(i8*, i32)
-
-declare %PatternAST @newPatternAST(i8*, %List)
-
-declare %RuleAST @newRuleAST(i8*, %PatternAST, i32, %IntList)
-
-declare void @yyfinished()
-
-declare i32 @yylex()
-
-declare void @doGram(%List)
-
-declare i32 @yygrowstack()
diff --git a/release_23/test/CodeGen/Generic/ConstantExprLowering.ll b/release_23/test/CodeGen/Generic/ConstantExprLowering.ll
deleted file mode 100644
index d26541596da5..000000000000
--- a/release_23/test/CodeGen/Generic/ConstantExprLowering.ll
+++ /dev/null
@@ -1,22 +0,0 @@
-; RUN: llvm-as < %s | llc
-
-@.str_1 = internal constant [16 x i8] c"%d %d %d %d %d\0A\00" ; <[16 x i8]*> [#uses=1]
-@XA = external global i32 ; <i32*> [#uses=1]
-@XB = external global i32 ; <i32*> [#uses=1]
-
-declare i32 @printf(i8*, ...)
-
-define void @test(i32 %A, i32 %B, i32 %C, i32 %D) {
-entry:
- %t1 = icmp slt i32 %A, 0 ; <i1> [#uses=1]
- br i1 %t1, label %less, label %not_less
-
-less: ; preds = %entry
- br label %not_less
-
-not_less: ; preds = %less, %entry
- %t2 = phi i32 [ sub (i32 ptrtoint (i32* @XA to i32), i32 ptrtoint (i32* @XB to i32)), %less ], [ sub (i32 ptrtoint (i32* @XA to i32), i32 ptrtoint (i32* @XB to i32)), %entry ] ; <i32> [#uses=1]
- %tmp.39 = call i32 (i8*, ...)* @printf( i8* getelementptr ([16 x i8]* @.str_1, i64 0, i64 0), i32 %t2 ) ; <i32> [#uses=0]
- ret void
-}
-
diff --git a/release_23/test/CodeGen/Generic/GC/alloc_loop.ll b/release_23/test/CodeGen/Generic/GC/alloc_loop.ll
deleted file mode 100644
index b1fee68abab8..000000000000
--- a/release_23/test/CodeGen/Generic/GC/alloc_loop.ll
+++ /dev/null
@@ -1,53 +0,0 @@
-; RUN: llvm-as < %s | llc
-
-
-declare i8* @llvm_gc_allocate(i32)
-declare void @llvm_gc_initialize(i32)
-
-declare void @llvm.gcroot(i8**, i8*)
-declare void @llvm.gcwrite(i8*, i8*, i8**)
-
-define i32 @main() gc "shadow-stack" {
-entry:
- %A = alloca i8*
- %B = alloca i8**
-
- call void @llvm_gc_initialize(i32 1048576) ; Start with 1MB heap
-
- ;; void *A;
- call void @llvm.gcroot(i8** %A, i8* null)
-
- ;; A = gcalloc(10);
- %Aptr = call i8* @llvm_gc_allocate(i32 10)
- store i8* %Aptr, i8** %A
-
- ;; void **B;
- %tmp.1 = bitcast i8*** %B to i8**
- call void @llvm.gcroot(i8** %tmp.1, i8* null)
-
- ;; B = gcalloc(4);
- %B.upgrd.1 = call i8* @llvm_gc_allocate(i32 8)
- %tmp.2 = bitcast i8* %B.upgrd.1 to i8**
- store i8** %tmp.2, i8*** %B
-
- ;; *B = A;
- %B.1 = load i8*** %B
- %A.1 = load i8** %A
- call void @llvm.gcwrite(i8* %A.1, i8* %B.upgrd.1, i8** %B.1)
-
- br label %AllocLoop
-
-AllocLoop:
- %i = phi i32 [ 0, %entry ], [ %indvar.next, %AllocLoop ]
- ;; Allocated mem: allocated memory is immediately dead.
- call i8* @llvm_gc_allocate(i32 100)
-
- %indvar.next = add i32 %i, 1
- %exitcond = icmp eq i32 %indvar.next, 10000000
- br i1 %exitcond, label %Exit, label %AllocLoop
-
-Exit:
- ret i32 0
-}
-
-declare void @__main()
diff --git a/release_23/test/CodeGen/Generic/GC/argpromotion.ll b/release_23/test/CodeGen/Generic/GC/argpromotion.ll
deleted file mode 100644
index 5df947a9fb12..000000000000
--- a/release_23/test/CodeGen/Generic/GC/argpromotion.ll
+++ /dev/null
@@ -1,19 +0,0 @@
-; RUN: llvm-as < %s | opt -anders-aa -argpromotion
-
-declare void @llvm.gcroot(i8**, i8*)
-
-define i32 @g() {
-entry:
- %var = alloca i32
- store i32 1, i32* %var
- %x = call i32 @f(i32* %var)
- ret i32 %x
-}
-
-define internal i32 @f(i32* %xp) gc "example" {
-entry:
- %var = alloca i8*
- call void @llvm.gcroot(i8** %var, i8* null)
- %x = load i32* %xp
- ret i32 %x
-}
diff --git a/release_23/test/CodeGen/Generic/GC/badreadproto.ll b/release_23/test/CodeGen/Generic/GC/badreadproto.ll
deleted file mode 100644
index 8568ba41d244..000000000000
--- a/release_23/test/CodeGen/Generic/GC/badreadproto.ll
+++ /dev/null
@@ -1,13 +0,0 @@
-; RUN: not llvm-as < %s
-
- %list = type { i32, %list* }
-
-; This usage is invalid now; instead, objects must be bitcast to i8* for input
-; to the gc intrinsics.
-declare %list* @llvm.gcread(%list*, %list**)
-
-define %list* @tl(%list* %l) gc "example" {
- %hd.ptr = getelementptr %list* %l, i32 0, i32 0
- %hd = call %list* @llvm.gcread(%list* %l, %list** %hd.ptr)
- ret i32 %tmp
-}
diff --git a/release_23/test/CodeGen/Generic/GC/badrootproto.ll b/release_23/test/CodeGen/Generic/GC/badrootproto.ll
deleted file mode 100644
index 1b9d856c5378..000000000000
--- a/release_23/test/CodeGen/Generic/GC/badrootproto.ll
+++ /dev/null
@@ -1,13 +0,0 @@
-; RUN: not llvm-as < %s
-
- %list = type { i32, %list* }
- %meta = type opaque
-
-; This usage is invalid now; instead, objects must be bitcast to i8* for input
-; to the gc intrinsics.
-declare void @llvm.gcroot(%list*, %meta*)
-
-define void @root() gc "example" {
- %x.var = alloca i8*
- call void @llvm.gcroot(i8** %x.var, %meta* null)
-}
diff --git a/release_23/test/CodeGen/Generic/GC/badwriteproto.ll b/release_23/test/CodeGen/Generic/GC/badwriteproto.ll
deleted file mode 100644
index 3682fc425b5b..000000000000
--- a/release_23/test/CodeGen/Generic/GC/badwriteproto.ll
+++ /dev/null
@@ -1,22 +0,0 @@
-; RUN: not llvm-as < %s
-
- %list = type { i32, %list* }
-
-; This usage is invalid now; instead, objects must be bitcast to i8* for input
-; to the gc intrinsics.
-declare void @llvm.gcwrite(%list*, %list*, %list**)
-
-define %list* @cons(i32 %hd, %list* %tl) gc "example" {
- %tmp = call i8* @gcalloc(i32 bitcast(%list* getelementptr(%list* null, i32 1) to i32))
- %cell = bitcast i8* %tmp to %list*
-
- %hd.ptr = getelementptr %list* %cell, i32 0, i32 0
- store i32 %hd, i32* %hd.ptr
-
- %tl.ptr = getelementptr %list* %cell, i32 0, i32 0
- call void @llvm.gcwrite(%list* %tl, %list* %cell, %list** %tl.ptr)
-
- ret %cell.2
-}
-
-declare i8* @gcalloc(i32)
diff --git a/release_23/test/CodeGen/Generic/GC/deadargelim.ll b/release_23/test/CodeGen/Generic/GC/deadargelim.ll
deleted file mode 100644
index c5a56f600dd0..000000000000
--- a/release_23/test/CodeGen/Generic/GC/deadargelim.ll
+++ /dev/null
@@ -1,16 +0,0 @@
-; RUN: llvm-as < %s | opt -deadargelim
-
-declare void @llvm.gcroot(i8**, i8*)
-
-define void @g() {
-entry:
- call void @f(i32 0)
- ret void
-}
-
-define internal void @f(i32 %unused) gc "example" {
-entry:
- %var = alloca i8*
- call void @llvm.gcroot(i8** %var, i8* null)
- ret void
-}
diff --git a/release_23/test/CodeGen/Generic/GC/dg.exp b/release_23/test/CodeGen/Generic/GC/dg.exp
deleted file mode 100644
index 879685ca879d..000000000000
--- a/release_23/test/CodeGen/Generic/GC/dg.exp
+++ /dev/null
@@ -1,3 +0,0 @@
-load_lib llvm.exp
-
-RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
diff --git a/release_23/test/CodeGen/Generic/GC/frame_size.ll b/release_23/test/CodeGen/Generic/GC/frame_size.ll
deleted file mode 100644
index 75626c18c5b1..000000000000
--- a/release_23/test/CodeGen/Generic/GC/frame_size.ll
+++ /dev/null
@@ -1,14 +0,0 @@
-; RUN: llvm-as < %s | llc -asm-verbose | grep {frame size} | grep -v 0x0
-
-declare void @llvm.gcroot(i8** %value, i8* %tag)
-declare void @g() gc "ocaml"
-
-define void @f(i8* %arg.0, void()* %arg.1) gc "ocaml" {
-entry:
- %gcroot.0 = alloca i8*
- call void @llvm.gcroot(i8** %gcroot.0, i8* null)
- store i8* %arg.0, i8** %gcroot.0
- call void @g()
- call void %arg.1()
- ret void
-}
diff --git a/release_23/test/CodeGen/Generic/GC/inline.ll b/release_23/test/CodeGen/Generic/GC/inline.ll
deleted file mode 100644
index 157e19d2d929..000000000000
--- a/release_23/test/CodeGen/Generic/GC/inline.ll
+++ /dev/null
@@ -1,23 +0,0 @@
-; RUN: llvm-as < %s | opt -inline | llvm-dis | grep example
-
- %IntArray = type { i32, [0 x i32*] }
-
-declare void @llvm.gcroot(i8**, i8*) nounwind
-
-define i32 @f() {
- %x = call i32 @g( ) ; <i32> [#uses=1]
- ret i32 %x
-}
-
-define internal i32 @g() gc "example" {
- %root = alloca i8* ; <i8**> [#uses=2]
- call void @llvm.gcroot( i8** %root, i8* null )
- %obj = call %IntArray* @h( ) ; <%IntArray*> [#uses=2]
- %obj.2 = bitcast %IntArray* %obj to i8* ; <i8*> [#uses=1]
- store i8* %obj.2, i8** %root
- %Length.ptr = getelementptr %IntArray* %obj, i32 0, i32 0 ; <i32*> [#uses=1]
- %Length = load i32* %Length.ptr ; <i32> [#uses=1]
- ret i32 %Length
-}
-
-declare %IntArray* @h()
diff --git a/release_23/test/CodeGen/Generic/GC/inline2.ll b/release_23/test/CodeGen/Generic/GC/inline2.ll
deleted file mode 100644
index b45ef7c47f52..000000000000
--- a/release_23/test/CodeGen/Generic/GC/inline2.ll
+++ /dev/null
@@ -1,24 +0,0 @@
-; RUN: llvm-as < %s | opt -inline | llvm-dis | grep sample
-; RUN: llvm-as < %s | opt -inline | llvm-dis | grep example
-
- %IntArray = type { i32, [0 x i32*] }
-
-declare void @llvm.gcroot(i8**, i8*) nounwind
-
-define i32 @f() gc "sample" {
- %x = call i32 @g( ) ; <i32> [#uses=1]
- ret i32 %x
-}
-
-define internal i32 @g() gc "example" {
- %root = alloca i8* ; <i8**> [#uses=2]
- call void @llvm.gcroot( i8** %root, i8* null )
- %obj = call %IntArray* @h( ) ; <%IntArray*> [#uses=2]
- %obj.2 = bitcast %IntArray* %obj to i8* ; <i8*> [#uses=1]
- store i8* %obj.2, i8** %root
- %Length.ptr = getelementptr %IntArray* %obj, i32 0, i32 0 ; <i32*> [#uses=1]
- %Length = load i32* %Length.ptr ; <i32> [#uses=1]
- ret i32 %Length
-}
-
-declare %IntArray* @h()
diff --git a/release_23/test/CodeGen/Generic/GC/lower_gcroot.ll b/release_23/test/CodeGen/Generic/GC/lower_gcroot.ll
deleted file mode 100644
index bd5a2bd14b4e..000000000000
--- a/release_23/test/CodeGen/Generic/GC/lower_gcroot.ll
+++ /dev/null
@@ -1,11 +0,0 @@
-; RUN: llvm-as < %s | llc
-
- %Env = type i8*
-
-define void @.main(%Env) gc "shadow-stack" {
- %Root = alloca %Env
- call void @llvm.gcroot( %Env* %Root, %Env null )
- unreachable
-}
-
-declare void @llvm.gcroot(%Env*, %Env)
diff --git a/release_23/test/CodeGen/Generic/GC/outside.ll b/release_23/test/CodeGen/Generic/GC/outside.ll
deleted file mode 100644
index 122bfe4a47bc..000000000000
--- a/release_23/test/CodeGen/Generic/GC/outside.ll
+++ /dev/null
@@ -1,10 +0,0 @@
-; RUN: not llvm-as < %s
-
-declare void @llvm.gcroot(i8**, i8*)
-
-define void @f(i8* %x) {
- %root = alloca i8*
- call void @llvm.gcroot(i8** %root, i8* null)
- store i8* %x, i8** %root
- ret void
-}
diff --git a/release_23/test/CodeGen/Generic/GC/redundant_init.ll b/release_23/test/CodeGen/Generic/GC/redundant_init.ll
deleted file mode 100644
index 44996034748b..000000000000
--- a/release_23/test/CodeGen/Generic/GC/redundant_init.ll
+++ /dev/null
@@ -1,17 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 | \
-; RUN: ignore grep {movl..0} | count 0
-
-%struct.obj = type { i8*, %struct.obj* }
-
-declare void @g() gc "shadow-stack"
-
-define void @f(i8* %o) gc "shadow-stack" {
-entry:
- %root = alloca i8*
- call void @llvm.gcroot(i8** %root, i8* null)
- store i8* %o, i8** %root
- call void @g()
- ret void
-}
-
-declare void @llvm.gcroot(i8**, i8*)
diff --git a/release_23/test/CodeGen/Generic/GC/simple_ocaml.ll b/release_23/test/CodeGen/Generic/GC/simple_ocaml.ll
deleted file mode 100644
index a33e0351f7fd..000000000000
--- a/release_23/test/CodeGen/Generic/GC/simple_ocaml.ll
+++ /dev/null
@@ -1,42 +0,0 @@
-; RUN: llvm-as < %s | llc | grep caml.*__frametable
-; RUN: llvm-as < %s | llc -march=x86 | grep {movl .0}
-
-%struct.obj = type { i8*, %struct.obj* }
-
-define %struct.obj* @fun(%struct.obj* %head) gc "ocaml" {
-entry:
- %gcroot.0 = alloca i8*
- %gcroot.1 = alloca i8*
-
- call void @llvm.gcroot(i8** %gcroot.0, i8* null)
- call void @llvm.gcroot(i8** %gcroot.1, i8* null)
-
- %local.0 = bitcast i8** %gcroot.0 to %struct.obj**
- %local.1 = bitcast i8** %gcroot.1 to %struct.obj**
-
- store %struct.obj* %head, %struct.obj** %local.0
- br label %bb.loop
-bb.loop:
- %t0 = load %struct.obj** %local.0
- %t1 = getelementptr %struct.obj* %t0, i32 0, i32 1
- %t2 = bitcast %struct.obj* %t0 to i8*
- %t3 = bitcast %struct.obj** %t1 to i8**
- %t4 = call i8* @llvm.gcread(i8* %t2, i8** %t3)
- %t5 = bitcast i8* %t4 to %struct.obj*
- %t6 = icmp eq %struct.obj* %t5, null
- br i1 %t6, label %bb.loop, label %bb.end
-bb.end:
- %t7 = malloc %struct.obj
- store %struct.obj* %t7, %struct.obj** %local.1
- %t8 = bitcast %struct.obj* %t7 to i8*
- %t9 = load %struct.obj** %local.0
- %t10 = getelementptr %struct.obj* %t9, i32 0, i32 1
- %t11 = bitcast %struct.obj* %t9 to i8*
- %t12 = bitcast %struct.obj** %t10 to i8**
- call void @llvm.gcwrite(i8* %t8, i8* %t11, i8** %t12)
- ret %struct.obj* %t7
-}
-
-declare void @llvm.gcroot(i8** %value, i8* %tag)
-declare void @llvm.gcwrite(i8* %value, i8* %obj, i8** %field)
-declare i8* @llvm.gcread(i8* %obj, i8** %field)
diff --git a/release_23/test/CodeGen/Generic/Makefile b/release_23/test/CodeGen/Generic/Makefile
deleted file mode 100644
index d228f69a8566..000000000000
--- a/release_23/test/CodeGen/Generic/Makefile
+++ /dev/null
@@ -1,23 +0,0 @@
-# Makefile for running ad-hoc custom LLVM tests
-#
-%.bc: %.ll
- llvm-as -f $<
-
-%.llc.s: %.bc
- llc -f $< -o $@
-
-%.gcc.s: %.c
- gcc -O0 -S $< -o $@
-
-%.nat: %.s
- gcc -O0 -lm $< -o $@
-
-%.cbe.out: %.cbe.nat
- ./$< > $@
-
-%.out: %.nat
- ./$< > $@
-
-%.clean:
- rm -f $(patsubst %.clean,%.bc,$@) $(patsubst %.clean,%.*.s,$@) \
- $(patsubst %.clean,%.*.nat,$@) $(patsubst %.clean,%.*.out,$@)
diff --git a/release_23/test/CodeGen/Generic/SwitchLowering.ll b/release_23/test/CodeGen/Generic/SwitchLowering.ll
deleted file mode 100644
index 9fdfd8d5f63e..000000000000
--- a/release_23/test/CodeGen/Generic/SwitchLowering.ll
+++ /dev/null
@@ -1,28 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 | grep cmp | count 1
-; PR964
-
-define i8* @FindChar(i8* %CurPtr) {
-entry:
- br label %bb
-
-bb: ; preds = %bb, %entry
- %indvar = phi i32 [ 0, %entry ], [ %indvar.next, %bb ] ; <i32> [#uses=3]
- %CurPtr_addr.0.rec = bitcast i32 %indvar to i32 ; <i32> [#uses=1]
- %gep.upgrd.1 = zext i32 %indvar to i64 ; <i64> [#uses=1]
- %CurPtr_addr.0 = getelementptr i8* %CurPtr, i64 %gep.upgrd.1 ; <i8*> [#uses=1]
- %tmp = load i8* %CurPtr_addr.0 ; <i8> [#uses=3]
- %tmp2.rec = add i32 %CurPtr_addr.0.rec, 1 ; <i32> [#uses=1]
- %tmp2 = getelementptr i8* %CurPtr, i32 %tmp2.rec ; <i8*> [#uses=1]
- %indvar.next = add i32 %indvar, 1 ; <i32> [#uses=1]
- switch i8 %tmp, label %bb [
- i8 0, label %bb7
- i8 120, label %bb7
- ]
-
-bb7: ; preds = %bb, %bb
- tail call void @foo( i8 %tmp )
- ret i8* %tmp2
-}
-
-declare void @foo(i8)
-
diff --git a/release_23/test/CodeGen/Generic/addc-fold2.ll b/release_23/test/CodeGen/Generic/addc-fold2.ll
deleted file mode 100644
index 8f3cdd0793d4..000000000000
--- a/release_23/test/CodeGen/Generic/addc-fold2.ll
+++ /dev/null
@@ -1,10 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 | grep add
-; RUN: llvm-as < %s | llc -march=x86 | not grep adc
-
-define i64 @test(i64 %A, i32 %B) {
- %tmp12 = zext i32 %B to i64 ; <i64> [#uses=1]
- %tmp3 = shl i64 %tmp12, 32 ; <i64> [#uses=1]
- %tmp5 = add i64 %tmp3, %A ; <i64> [#uses=1]
- ret i64 %tmp5
-}
-
diff --git a/release_23/test/CodeGen/Generic/asm-large-immediate.ll b/release_23/test/CodeGen/Generic/asm-large-immediate.ll
deleted file mode 100644
index 70649133712c..000000000000
--- a/release_23/test/CodeGen/Generic/asm-large-immediate.ll
+++ /dev/null
@@ -1,8 +0,0 @@
-; RUN: llvm-as < %s | llc | grep 68719476738
-
-define void @test() {
-entry:
- tail call void asm sideeffect "/* result: ${0:c} */", "i,~{dirflag},~{fpsr},~{flags}"( i64 68719476738 )
- ret void
-}
-
diff --git a/release_23/test/CodeGen/Generic/badCallArgLRLLVM.ll b/release_23/test/CodeGen/Generic/badCallArgLRLLVM.ll
deleted file mode 100644
index 56384748ac05..000000000000
--- a/release_23/test/CodeGen/Generic/badCallArgLRLLVM.ll
+++ /dev/null
@@ -1,31 +0,0 @@
-; RUN: llvm-as < %s | llc
-
-; This caused a problem because the argument of a call was defined by
-; the return value of another call that appears later in the code.
-; When processing the first call, the second call has not yet been processed
-; so no LiveRange has been created for its return value.
-;
-; llc dies in UltraSparcRegInfo::suggestRegs4CallArgs() with:
-; ERROR: In call instr, no LR for arg: 0x1009e0740
-;
-
-declare i32 @getInt(i32)
-
-define i32 @main(i32 %argc, i8** %argv) {
-bb0:
- br label %bb2
-
-bb1: ; preds = %bb2
- %reg222 = call i32 @getInt( i32 %reg218 ) ; <i32> [#uses=1]
- %reg110 = add i32 %reg222, 1 ; <i32> [#uses=2]
- %b = icmp sle i32 %reg110, 0 ; <i1> [#uses=1]
- br i1 %b, label %bb2, label %bb3
-
-bb2: ; preds = %bb1, %bb0
- %reg218 = call i32 @getInt( i32 %argc ) ; <i32> [#uses=1]
- br label %bb1
-
-bb3: ; preds = %bb1
- ret i32 %reg110
-}
-
diff --git a/release_23/test/CodeGen/Generic/badFoldGEP.ll b/release_23/test/CodeGen/Generic/badFoldGEP.ll
deleted file mode 100644
index 8de12512d145..000000000000
--- a/release_23/test/CodeGen/Generic/badFoldGEP.ll
+++ /dev/null
@@ -1,27 +0,0 @@
-; RUN: llvm-as < %s | llc
-
-;; GetMemInstArgs() folded the two getElementPtr instructions together,
-;; producing an illegal getElementPtr. That's because the type generated
-;; by the last index for the first one is a structure field, not an array
-;; element, and the second one indexes off that structure field.
-;; The code is legal but not type-safe and the two GEPs should not be folded.
-;;
-;; This code fragment is from Spec/CINT2000/197.parser/197.parser.bc,
-;; file post_process.c, function build_domain().
-;; (Modified to replace store with load and return load value.)
-;;
- %Domain = type { i8*, i32, i32*, i32, i32, i32*, %Domain* }
-@domain_array = external global [497 x %Domain] ; <[497 x %Domain]*> [#uses=2]
-
-declare void @opaque([497 x %Domain]*)
-
-define i32 @main(i32 %argc, i8** %argv) {
-bb0:
- call void @opaque( [497 x %Domain]* @domain_array )
- %cann-indvar-idxcast = sext i32 %argc to i64 ; <i64> [#uses=1]
- %reg841 = getelementptr [497 x %Domain]* @domain_array, i64 0, i64 %cann-indvar-idxcast, i32 3 ; <i32*> [#uses=1]
- %reg846 = getelementptr i32* %reg841, i64 1 ; <i32*> [#uses=1]
- %reg820 = load i32* %reg846 ; <i32> [#uses=1]
- ret i32 %reg820
-}
-
diff --git a/release_23/test/CodeGen/Generic/badarg6.ll b/release_23/test/CodeGen/Generic/badarg6.ll
deleted file mode 100644
index 1ff7df42a348..000000000000
--- a/release_23/test/CodeGen/Generic/badarg6.ll
+++ /dev/null
@@ -1,32 +0,0 @@
-; RUN: llvm-as < %s | llc
-
-; On this code, llc did not pass the sixth argument (%reg321) to printf.
-; It passed the first five in %o0 - %o4, but never initialized %o5.
-@.LC12 = internal global [44 x i8] c"\09\09M = %g, I = %g, V = %g\0A\09\09O = %g, E = %g\0A\0A\00" ; <[44 x i8]*> [#uses=1]
-
-declare i32 @printf(i8*, ...)
-
-declare double @opaque(double)
-
-define i32 @main(i32 %argc, i8** %argv) {
-bb25:
- %b = icmp sle i32 %argc, 2 ; <i1> [#uses=1]
- br i1 %b, label %bb42, label %bb43
-
-bb42: ; preds = %bb25
- %reg315 = call double @opaque( double 3.000000e+00 ) ; <double> [#uses=1]
- %reg316 = call double @opaque( double 3.100000e+00 ) ; <double> [#uses=1]
- %reg317 = call double @opaque( double 3.200000e+00 ) ; <double> [#uses=1]
- %reg318 = call double @opaque( double 3.300000e+00 ) ; <double> [#uses=1]
- %reg319 = call double @opaque( double 3.400000e+00 ) ; <double> [#uses=1]
- br label %bb43
-
-bb43: ; preds = %bb42, %bb25
- %reg321 = phi double [ 2.000000e-01, %bb25 ], [ %reg315, %bb42 ] ; <double> [#uses=1]
- %reg322 = phi double [ 6.000000e+00, %bb25 ], [ %reg316, %bb42 ] ; <double> [#uses=1]
- %reg323 = phi double [ -1.000000e+00, %bb25 ], [ %reg317, %bb42 ] ; <double> [#uses=1]
- %reg324 = phi double [ -1.000000e+00, %bb25 ], [ %reg318, %bb42 ] ; <double> [#uses=1]
- %reg325 = phi double [ 1.000000e+00, %bb25 ], [ %reg319, %bb42 ] ; <double> [#uses=1]
- %reg609 = call i32 (i8*, ...)* @printf( i8* getelementptr ([44 x i8]* @.LC12, i64 0, i64 0), double %reg325, double %reg324, double %reg323, double %reg322, double %reg321 ) ; <i32> [#uses=0]
- ret i32 0
-}
diff --git a/release_23/test/CodeGen/Generic/badlive.ll b/release_23/test/CodeGen/Generic/badlive.ll
deleted file mode 100644
index 0114fb0fa060..000000000000
--- a/release_23/test/CodeGen/Generic/badlive.ll
+++ /dev/null
@@ -1,28 +0,0 @@
-; RUN: llvm-as < %s | llc
-
-define i32 @main() {
-bb0:
- %reg109 = malloc i32, i32 100 ; <i32*> [#uses=2]
- br label %bb2
-
-bb2: ; preds = %bb2, %bb0
- %cann-indvar1 = phi i32 [ 0, %bb0 ], [ %add1-indvar1, %bb2 ] ; <i32> [#uses=2]
- %reg127 = mul i32 %cann-indvar1, 2 ; <i32> [#uses=1]
- %add1-indvar1 = add i32 %cann-indvar1, 1 ; <i32> [#uses=1]
- store i32 999, i32* %reg109
- %cond1015 = icmp sle i32 1, 99 ; <i1> [#uses=1]
- %reg128 = add i32 %reg127, 2 ; <i32> [#uses=0]
- br i1 %cond1015, label %bb2, label %bb4
-
-bb4: ; preds = %bb4, %bb2
- %cann-indvar = phi i32 [ %add1-indvar, %bb4 ], [ 0, %bb2 ] ; <i32> [#uses=1]
- %add1-indvar = add i32 %cann-indvar, 1 ; <i32> [#uses=2]
- store i32 333, i32* %reg109
- %reg131 = add i32 %add1-indvar, 3 ; <i32> [#uses=1]
- %cond1017 = icmp ule i32 %reg131, 99 ; <i1> [#uses=1]
- br i1 %cond1017, label %bb4, label %bb5
-
-bb5: ; preds = %bb4
- ret i32 0
-}
-
diff --git a/release_23/test/CodeGen/Generic/bit-intrinsics.ll b/release_23/test/CodeGen/Generic/bit-intrinsics.ll
deleted file mode 100644
index 95410114bf57..000000000000
--- a/release_23/test/CodeGen/Generic/bit-intrinsics.ll
+++ /dev/null
@@ -1,32 +0,0 @@
-; Make sure this testcase is supported by all code generators. Either the
-; intrinsic is supported natively or IntrinsicLowering provides it.
-; RUN: llvm-as < %s > %t.bc
-; RUN: lli --force-interpreter=true %t.bc
-
-declare i32 @llvm.part.set.i32.i32(i32 %x, i32 %rep, i32 %hi, i32 %lo)
-declare i16 @llvm.part.set.i16.i16(i16 %x, i16 %rep, i32 %hi, i32 %lo)
-define i32 @test_part_set(i32 %A, i16 %B) {
- %a = call i32 @llvm.part.set.i32.i32(i32 %A, i32 27, i32 8, i32 0)
- %b = call i16 @llvm.part.set.i16.i16(i16 %B, i16 27, i32 8, i32 0)
- %c = zext i16 %b to i32
- %d = add i32 %a, %c
- ret i32 %d
-}
-
-declare i32 @llvm.part.select.i32(i32 %x, i32 %hi, i32 %lo)
-declare i16 @llvm.part.select.i16(i16 %x, i32 %hi, i32 %lo)
-define i32 @test_part_select(i32 %A, i16 %B) {
- %a = call i32 @llvm.part.select.i32(i32 %A, i32 8, i32 0)
- %b = call i16 @llvm.part.select.i16(i16 %B, i32 8, i32 0)
- %c = zext i16 %b to i32
- %d = add i32 %a, %c
- ret i32 %d
-}
-
-define i32 @main(i32 %argc, i8** %argv) {
- %a = call i32 @test_part_set(i32 23, i16 57)
- %b = call i32 @test_part_select(i32 23, i16 57)
- %c = add i32 %a, %b
- %d = urem i32 %c, 1
- ret i32 %d
-}
diff --git a/release_23/test/CodeGen/Generic/bool-to-double.ll b/release_23/test/CodeGen/Generic/bool-to-double.ll
deleted file mode 100644
index d6c9e5239516..000000000000
--- a/release_23/test/CodeGen/Generic/bool-to-double.ll
+++ /dev/null
@@ -1,6 +0,0 @@
-; RUN: llvm-as < %s | llc
-define double @test(i1 %X) {
- %Y = uitofp i1 %X to double ; <double> [#uses=1]
- ret double %Y
-}
-
diff --git a/release_23/test/CodeGen/Generic/bool-vector.ll b/release_23/test/CodeGen/Generic/bool-vector.ll
deleted file mode 100644
index e0f2a70886a7..000000000000
--- a/release_23/test/CodeGen/Generic/bool-vector.ll
+++ /dev/null
@@ -1,11 +0,0 @@
-; RUN: llvm-as < %s | llc
-; PR1845
-
-define void @boolVectorSelect(<4 x i1>* %boolVectorPtr) {
-Body:
- %castPtr = bitcast <4 x i1>* %boolVectorPtr to <4 x i1>*
- %someBools = load <4 x i1>* %castPtr, align 1 ; <<4 x i1>>
- %internal = alloca <4 x i1>, align 16 ; <<4 x i1>*> [#uses=1]
- store <4 x i1> %someBools, <4 x i1>* %internal, align 1
- ret void
-}
diff --git a/release_23/test/CodeGen/Generic/call-ret0.ll b/release_23/test/CodeGen/Generic/call-ret0.ll
deleted file mode 100644
index 7ab966ba9070..000000000000
--- a/release_23/test/CodeGen/Generic/call-ret0.ll
+++ /dev/null
@@ -1,10 +0,0 @@
-; RUN: llvm-as < %s | llc
-define i32 @foo(i32 %x) {
- ret i32 %x
-}
-
-define i32 @main() {
- %r = call i32 @foo( i32 0 ) ; <i32> [#uses=1]
- ret i32 %r
-}
-
diff --git a/release_23/test/CodeGen/Generic/call-ret42.ll b/release_23/test/CodeGen/Generic/call-ret42.ll
deleted file mode 100644
index ac9bd9235794..000000000000
--- a/release_23/test/CodeGen/Generic/call-ret42.ll
+++ /dev/null
@@ -1,10 +0,0 @@
-; RUN: llvm-as < %s | llc
-
-define i32 @foo(i32 %x) {
- ret i32 42
-}
-
-define i32 @main() {
- %r = call i32 @foo( i32 15 ) ; <i32> [#uses=1]
- ret i32 %r
-}
diff --git a/release_23/test/CodeGen/Generic/call-void.ll b/release_23/test/CodeGen/Generic/call-void.ll
deleted file mode 100644
index b88268992396..000000000000
--- a/release_23/test/CodeGen/Generic/call-void.ll
+++ /dev/null
@@ -1,11 +0,0 @@
-; RUN: llvm-as < %s | llc
-
-define void @foo() {
- ret void
-}
-
-define i32 @main() {
- call void @foo( )
- ret i32 0
-}
-
diff --git a/release_23/test/CodeGen/Generic/call2-ret0.ll b/release_23/test/CodeGen/Generic/call2-ret0.ll
deleted file mode 100644
index 8c7e8920f259..000000000000
--- a/release_23/test/CodeGen/Generic/call2-ret0.ll
+++ /dev/null
@@ -1,16 +0,0 @@
-; RUN: llvm-as < %s | llc
-
-define i32 @bar(i32 %x) {
- ret i32 0
-}
-
-define i32 @foo(i32 %x) {
- %q = call i32 @bar( i32 1 ) ; <i32> [#uses=1]
- ret i32 %q
-}
-
-define i32 @main() {
- %r = call i32 @foo( i32 2 ) ; <i32> [#uses=1]
- ret i32 %r
-}
-
diff --git a/release_23/test/CodeGen/Generic/cast-fp.ll b/release_23/test/CodeGen/Generic/cast-fp.ll
deleted file mode 100644
index 5f05d85ea854..000000000000
--- a/release_23/test/CodeGen/Generic/cast-fp.ll
+++ /dev/null
@@ -1,33 +0,0 @@
-; RUN: llvm-as < %s | llc
-@a_fstr = internal constant [8 x i8] c"a = %f\0A\00" ; <[8 x i8]*> [#uses=1]
-@a_lstr = internal constant [10 x i8] c"a = %lld\0A\00" ; <[10 x i8]*> [#uses=1]
-@a_dstr = internal constant [8 x i8] c"a = %d\0A\00" ; <[8 x i8]*> [#uses=1]
-@b_dstr = internal constant [8 x i8] c"b = %d\0A\00" ; <[8 x i8]*> [#uses=1]
-@b_fstr = internal constant [8 x i8] c"b = %f\0A\00" ; <[8 x i8]*> [#uses=1]
-@A = global double 2.000000e+00 ; <double*> [#uses=1]
-@B = global i32 2 ; <i32*> [#uses=1]
-
-declare i32 @printf(i8*, ...)
-
-define i32 @main() {
- %a = load double* @A ; <double> [#uses=4]
- %a_fs = getelementptr [8 x i8]* @a_fstr, i64 0, i64 0 ; <i8*> [#uses=1]
- call i32 (i8*, ...)* @printf( i8* %a_fs, double %a ) ; <i32>:1 [#uses=0]
- %a_d2l = fptosi double %a to i64 ; <i64> [#uses=1]
- %a_ls = getelementptr [10 x i8]* @a_lstr, i64 0, i64 0 ; <i8*> [#uses=1]
- call i32 (i8*, ...)* @printf( i8* %a_ls, i64 %a_d2l ) ; <i32>:2 [#uses=0]
- %a_d2i = fptosi double %a to i32 ; <i32> [#uses=2]
- %a_ds = getelementptr [8 x i8]* @a_dstr, i64 0, i64 0 ; <i8*> [#uses=3]
- call i32 (i8*, ...)* @printf( i8* %a_ds, i32 %a_d2i ) ; <i32>:3 [#uses=0]
- %a_d2sb = fptosi double %a to i8 ; <i8> [#uses=1]
- call i32 (i8*, ...)* @printf( i8* %a_ds, i8 %a_d2sb ) ; <i32>:4 [#uses=0]
- %a_d2i2sb = trunc i32 %a_d2i to i8 ; <i8> [#uses=1]
- call i32 (i8*, ...)* @printf( i8* %a_ds, i8 %a_d2i2sb ) ; <i32>:5 [#uses=0]
- %b = load i32* @B ; <i32> [#uses=2]
- %b_ds = getelementptr [8 x i8]* @b_dstr, i64 0, i64 0 ; <i8*> [#uses=1]
- call i32 (i8*, ...)* @printf( i8* %b_ds, i32 %b ) ; <i32>:6 [#uses=0]
- %b_i2d = sitofp i32 %b to double ; <double> [#uses=1]
- %b_fs = getelementptr [8 x i8]* @b_fstr, i64 0, i64 0 ; <i8*> [#uses=1]
- call i32 (i8*, ...)* @printf( i8* %b_fs, double %b_i2d ) ; <i32>:7 [#uses=0]
- ret i32 0
-}
diff --git a/release_23/test/CodeGen/Generic/constindices.ll b/release_23/test/CodeGen/Generic/constindices.ll
deleted file mode 100644
index 6366fd59598f..000000000000
--- a/release_23/test/CodeGen/Generic/constindices.ll
+++ /dev/null
@@ -1,44 +0,0 @@
-; RUN: llvm-as < %s | llc
-
-; Test that a sequence of constant indices are folded correctly
-; into the equivalent offset at compile-time.
-
- %MixedA = type { float, [15 x i32], i8, float }
- %MixedB = type { float, %MixedA, float }
-@fmtArg = internal global [44 x i8] c"sqrt(2) = %g\0Aexp(1) = %g\0Api = %g\0Afive = %g\0A\00" ; <[44 x i8]*> [#uses=1]
-
-declare i32 @printf(i8*, ...)
-
-define i32 @main() {
- %ScalarA = alloca %MixedA ; <%MixedA*> [#uses=1]
- %ScalarB = alloca %MixedB ; <%MixedB*> [#uses=1]
- %ArrayA = alloca %MixedA, i32 4 ; <%MixedA*> [#uses=3]
- %ArrayB = alloca %MixedB, i32 3 ; <%MixedB*> [#uses=2]
- %I1 = getelementptr %MixedA* %ScalarA, i64 0, i32 0 ; <float*> [#uses=2]
- store float 0x3FF6A09020000000, float* %I1
- %I2 = getelementptr %MixedB* %ScalarB, i64 0, i32 1, i32 0 ; <float*> [#uses=2]
- store float 0x4005BF1420000000, float* %I2
- %fptrA = getelementptr %MixedA* %ArrayA, i64 1, i32 0 ; <float*> [#uses=1]
- %fptrB = getelementptr %MixedB* %ArrayB, i64 2, i32 1, i32 0 ; <float*> [#uses=1]
- store float 0x400921CAC0000000, float* %fptrA
- store float 5.000000e+00, float* %fptrB
-
- ;; Test that a sequence of GEPs with constant indices are folded right
- %fptrA1 = getelementptr %MixedA* %ArrayA, i64 3 ; <%MixedA*> [#uses=1]
- %fptrA2 = getelementptr %MixedA* %fptrA1, i64 0, i32 1 ; <[15 x i32]*> [#uses=1]
- %fptrA3 = getelementptr [15 x i32]* %fptrA2, i64 0, i64 8 ; <i32*> [#uses=1]
- store i32 5, i32* %fptrA3
- %sqrtTwo = load float* %I1 ; <float> [#uses=1]
- %exp = load float* %I2 ; <float> [#uses=1]
- %I3 = getelementptr %MixedA* %ArrayA, i64 1, i32 0 ; <float*> [#uses=1]
- %pi = load float* %I3 ; <float> [#uses=1]
- %I4 = getelementptr %MixedB* %ArrayB, i64 2, i32 1, i32 0 ; <float*> [#uses=1]
- %five = load float* %I4 ; <float> [#uses=1]
- %dsqrtTwo = fpext float %sqrtTwo to double ; <double> [#uses=1]
- %dexp = fpext float %exp to double ; <double> [#uses=1]
- %dpi = fpext float %pi to double ; <double> [#uses=1]
- %dfive = fpext float %five to double ; <double> [#uses=1]
- %castFmt = getelementptr [44 x i8]* @fmtArg, i64 0, i64 0 ; <i8*> [#uses=1]
- call i32 (i8*, ...)* @printf( i8* %castFmt, double %dsqrtTwo, double %dexp, double %dpi, double %dfive ) ; <i32>:1 [#uses=0]
- ret i32 0
-}
diff --git a/release_23/test/CodeGen/Generic/debug-info.ll b/release_23/test/CodeGen/Generic/debug-info.ll
deleted file mode 100644
index d1bb66d1529d..000000000000
--- a/release_23/test/CodeGen/Generic/debug-info.ll
+++ /dev/null
@@ -1,19 +0,0 @@
-; RUN: llvm-as < %s | llc
-
- %lldb.compile_unit = type { i32, i16, i16, i8*, i8*, i8*, { }* }
-@d.compile_unit7 = external global %lldb.compile_unit ; <%lldb.compile_unit*> [#uses=1]
-
-declare void @llvm.dbg.stoppoint(i32, i32, %lldb.compile_unit*)
-
-define void @rb_raise(i32, ...) {
-entry:
- br i1 false, label %strlen.exit, label %no_exit.i
-
-no_exit.i: ; preds = %entry
- ret void
-
-strlen.exit: ; preds = %entry
- call void @llvm.dbg.stoppoint( i32 4358, i32 0, %lldb.compile_unit* @d.compile_unit7 )
- unreachable
-}
-
diff --git a/release_23/test/CodeGen/Generic/dg.exp b/release_23/test/CodeGen/Generic/dg.exp
deleted file mode 100644
index 879685ca879d..000000000000
--- a/release_23/test/CodeGen/Generic/dg.exp
+++ /dev/null
@@ -1,3 +0,0 @@
-load_lib llvm.exp
-
-RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
diff --git a/release_23/test/CodeGen/Generic/div-neg-power-2.ll b/release_23/test/CodeGen/Generic/div-neg-power-2.ll
deleted file mode 100644
index 3bc4899d8fdd..000000000000
--- a/release_23/test/CodeGen/Generic/div-neg-power-2.ll
+++ /dev/null
@@ -1,7 +0,0 @@
-; RUN: llvm-as < %s | llc
-
-define i32 @test(i32 %X) {
- %Y = sdiv i32 %X, -2 ; <i32> [#uses=1]
- ret i32 %Y
-}
-
diff --git a/release_23/test/CodeGen/Generic/fneg-fabs.ll b/release_23/test/CodeGen/Generic/fneg-fabs.ll
deleted file mode 100644
index f9580b1f309b..000000000000
--- a/release_23/test/CodeGen/Generic/fneg-fabs.ll
+++ /dev/null
@@ -1,26 +0,0 @@
-; RUN: llvm-as < %s | llc
-
-define double @fneg(double %X) {
- %Y = sub double -0.000000e+00, %X ; <double> [#uses=1]
- ret double %Y
-}
-
-define float @fnegf(float %X) {
- %Y = sub float -0.000000e+00, %X ; <float> [#uses=1]
- ret float %Y
-}
-
-declare double @fabs(double)
-
-declare float @fabsf(float)
-
-define double @fabstest(double %X) {
- %Y = call double @fabs( double %X ) ; <double> [#uses=1]
- ret double %Y
-}
-
-define float @fabsftest(float %X) {
- %Y = call float @fabsf( float %X ) ; <float> [#uses=1]
- ret float %Y
-}
-
diff --git a/release_23/test/CodeGen/Generic/fp_to_int.ll b/release_23/test/CodeGen/Generic/fp_to_int.ll
deleted file mode 100644
index 609de6546cfd..000000000000
--- a/release_23/test/CodeGen/Generic/fp_to_int.ll
+++ /dev/null
@@ -1,81 +0,0 @@
-; RUN: llvm-as < %s | llc
-
-define i8 @test1(double %X) {
- %tmp.1 = fptosi double %X to i8 ; <i8> [#uses=1]
- ret i8 %tmp.1
-}
-
-define i16 @test2(double %X) {
- %tmp.1 = fptosi double %X to i16 ; <i16> [#uses=1]
- ret i16 %tmp.1
-}
-
-define i32 @test3(double %X) {
- %tmp.1 = fptosi double %X to i32 ; <i32> [#uses=1]
- ret i32 %tmp.1
-}
-
-define i64 @test4(double %X) {
- %tmp.1 = fptosi double %X to i64 ; <i64> [#uses=1]
- ret i64 %tmp.1
-}
-
-define i8 @test1u(double %X) {
- %tmp.1 = fptoui double %X to i8 ; <i8> [#uses=1]
- ret i8 %tmp.1
-}
-
-define i16 @test2u(double %X) {
- %tmp.1 = fptoui double %X to i16 ; <i16> [#uses=1]
- ret i16 %tmp.1
-}
-
-define i32 @test3u(double %X) {
- %tmp.1 = fptoui double %X to i32 ; <i32> [#uses=1]
- ret i32 %tmp.1
-}
-
-define i64 @test4u(double %X) {
- %tmp.1 = fptoui double %X to i64 ; <i64> [#uses=1]
- ret i64 %tmp.1
-}
-
-define i8 @test1f(float %X) {
- %tmp.1 = fptosi float %X to i8 ; <i8> [#uses=1]
- ret i8 %tmp.1
-}
-
-define i16 @test2f(float %X) {
- %tmp.1 = fptosi float %X to i16 ; <i16> [#uses=1]
- ret i16 %tmp.1
-}
-
-define i32 @test3f(float %X) {
- %tmp.1 = fptosi float %X to i32 ; <i32> [#uses=1]
- ret i32 %tmp.1
-}
-
-define i64 @test4f(float %X) {
- %tmp.1 = fptosi float %X to i64 ; <i64> [#uses=1]
- ret i64 %tmp.1
-}
-
-define i8 @test1uf(float %X) {
- %tmp.1 = fptoui float %X to i8 ; <i8> [#uses=1]
- ret i8 %tmp.1
-}
-
-define i16 @test2uf(float %X) {
- %tmp.1 = fptoui float %X to i16 ; <i16> [#uses=1]
- ret i16 %tmp.1
-}
-
-define i32 @test3uf(float %X) {
- %tmp.1 = fptoui float %X to i32 ; <i32> [#uses=1]
- ret i32 %tmp.1
-}
-
-define i64 @test4uf(float %X) {
- %tmp.1 = fptoui float %X to i64 ; <i64> [#uses=1]
- ret i64 %tmp.1
-}
diff --git a/release_23/test/CodeGen/Generic/fpowi-promote.ll b/release_23/test/CodeGen/Generic/fpowi-promote.ll
deleted file mode 100644
index 55c2d2ad0c6f..000000000000
--- a/release_23/test/CodeGen/Generic/fpowi-promote.ll
+++ /dev/null
@@ -1,12 +0,0 @@
-; RUN: llvm-as < %s | llc
-; RUN: llvm-as < %s | llc -march=x86 -mcpu=i386
-
-; PR1239
-
-define float @test(float %tmp23302331, i32 %tmp23282329 ) {
-
-%tmp2339 = call float @llvm.powi.f32( float %tmp23302331, i32 %tmp23282329 )
- ret float %tmp2339
-}
-
-declare float @llvm.powi.f32(float,i32)
diff --git a/release_23/test/CodeGen/Generic/fwdtwice.ll b/release_23/test/CodeGen/Generic/fwdtwice.ll
deleted file mode 100644
index 05e831af6be2..000000000000
--- a/release_23/test/CodeGen/Generic/fwdtwice.ll
+++ /dev/null
@@ -1,29 +0,0 @@
-; RUN: llvm-as < %s | llc
-
-;;
-;; Test the sequence:
-;; cast -> setle 0, %cast -> br %cond
-;; This sequence should cause the cast value to be forwarded twice,
-;; i.e., cast is forwarded to the setle and the setle is forwarded
-;; to the branch.
-;; register argument of the "branch-on-register" instruction, i.e.,
-;;
-;; This produces the bogus output instruction:
-;; brlez <NULL VALUE>, .L_SumArray_bb3.
-;; This came from %bb1 of sumarrray.ll generated from sumarray.c.
-
-define i32 @SumArray(i32 %Num) {
- %Num.upgrd.1 = alloca i32 ; <i32*> [#uses=2]
- br label %Top
-
-Top: ; preds = %Top, %0
- store i32 %Num, i32* %Num.upgrd.1
- %reg108 = load i32* %Num.upgrd.1 ; <i32> [#uses=1]
- %cast1006 = bitcast i32 %reg108 to i32 ; <i32> [#uses=1]
- %cond1001 = icmp ule i32 %cast1006, 0 ; <i1> [#uses=1]
- br i1 %cond1001, label %bb6, label %Top
-
-bb6: ; preds = %Top
- ret i32 42
-}
-
diff --git a/release_23/test/CodeGen/Generic/getresult-undef.ll b/release_23/test/CodeGen/Generic/getresult-undef.ll
deleted file mode 100644
index 7905ff52ef61..000000000000
--- a/release_23/test/CodeGen/Generic/getresult-undef.ll
+++ /dev/null
@@ -1,6 +0,0 @@
-; RUN: llvm-as < %s | llc
-
-define double @foo() {
- %t = getresult {double, double} undef, 1
- ret double %t
-}
diff --git a/release_23/test/CodeGen/Generic/global-ret0.ll b/release_23/test/CodeGen/Generic/global-ret0.ll
deleted file mode 100644
index 8fcef33a34d7..000000000000
--- a/release_23/test/CodeGen/Generic/global-ret0.ll
+++ /dev/null
@@ -1,8 +0,0 @@
-; RUN: llvm-as < %s | llc
-
-@g = global i32 0 ; <i32*> [#uses=1]
-
-define i32 @main() {
- %h = load i32* @g ; <i32> [#uses=1]
- ret i32 %h
-}
diff --git a/release_23/test/CodeGen/Generic/hello.ll b/release_23/test/CodeGen/Generic/hello.ll
deleted file mode 100644
index 705423f973cf..000000000000
--- a/release_23/test/CodeGen/Generic/hello.ll
+++ /dev/null
@@ -1,11 +0,0 @@
-; RUN: llvm-as < %s | llc
-
-@.str_1 = internal constant [7 x i8] c"hello\0A\00" ; <[7 x i8]*> [#uses=1]
-
-declare i32 @printf(i8*, ...)
-
-define i32 @main() {
- %s = getelementptr [7 x i8]* @.str_1, i64 0, i64 0 ; <i8*> [#uses=1]
- call i32 (i8*, ...)* @printf( i8* %s ) ; <i32>:1 [#uses=0]
- ret i32 0
-}
diff --git a/release_23/test/CodeGen/Generic/i128-addsub.ll b/release_23/test/CodeGen/Generic/i128-addsub.ll
deleted file mode 100644
index 10f0acc36308..000000000000
--- a/release_23/test/CodeGen/Generic/i128-addsub.ll
+++ /dev/null
@@ -1,39 +0,0 @@
-; RUN: llvm-as < %s | llc
-
-define void @test_add(i64 %AL, i64 %AH, i64 %BL, i64 %BH, i64* %RL, i64* %RH) {
-entry:
- %tmp1 = zext i64 %AL to i128 ; <i128> [#uses=1]
- %tmp23 = zext i64 %AH to i128 ; <i128> [#uses=1]
- %tmp4 = shl i128 %tmp23, 64 ; <i128> [#uses=1]
- %tmp5 = or i128 %tmp4, %tmp1 ; <i128> [#uses=1]
- %tmp67 = zext i64 %BL to i128 ; <i128> [#uses=1]
- %tmp89 = zext i64 %BH to i128 ; <i128> [#uses=1]
- %tmp11 = shl i128 %tmp89, 64 ; <i128> [#uses=1]
- %tmp12 = or i128 %tmp11, %tmp67 ; <i128> [#uses=1]
- %tmp15 = add i128 %tmp12, %tmp5 ; <i128> [#uses=2]
- %tmp1617 = trunc i128 %tmp15 to i64 ; <i64> [#uses=1]
- store i64 %tmp1617, i64* %RL
- %tmp21 = lshr i128 %tmp15, 64 ; <i128> [#uses=1]
- %tmp2122 = trunc i128 %tmp21 to i64 ; <i64> [#uses=1]
- store i64 %tmp2122, i64* %RH
- ret void
-}
-
-define void @test_sub(i64 %AL, i64 %AH, i64 %BL, i64 %BH, i64* %RL, i64* %RH) {
-entry:
- %tmp1 = zext i64 %AL to i128 ; <i128> [#uses=1]
- %tmp23 = zext i64 %AH to i128 ; <i128> [#uses=1]
- %tmp4 = shl i128 %tmp23, 64 ; <i128> [#uses=1]
- %tmp5 = or i128 %tmp4, %tmp1 ; <i128> [#uses=1]
- %tmp67 = zext i64 %BL to i128 ; <i128> [#uses=1]
- %tmp89 = zext i64 %BH to i128 ; <i128> [#uses=1]
- %tmp11 = shl i128 %tmp89, 64 ; <i128> [#uses=1]
- %tmp12 = or i128 %tmp11, %tmp67 ; <i128> [#uses=1]
- %tmp15 = sub i128 %tmp5, %tmp12 ; <i128> [#uses=2]
- %tmp1617 = trunc i128 %tmp15 to i64 ; <i64> [#uses=1]
- store i64 %tmp1617, i64* %RL
- %tmp21 = lshr i128 %tmp15, 64 ; <i128> [#uses=1]
- %tmp2122 = trunc i128 %tmp21 to i64 ; <i64> [#uses=1]
- store i64 %tmp2122, i64* %RH
- ret void
-}
diff --git a/release_23/test/CodeGen/Generic/i128-arith.ll b/release_23/test/CodeGen/Generic/i128-arith.ll
deleted file mode 100644
index 9a670847b575..000000000000
--- a/release_23/test/CodeGen/Generic/i128-arith.ll
+++ /dev/null
@@ -1,11 +0,0 @@
-; RUN: llvm-as < %s | llc
-
-define i64 @foo(i64 %x, i64 %y, i32 %amt) {
- %tmp0 = zext i64 %x to i128
- %tmp1 = sext i64 %y to i128
- %tmp2 = or i128 %tmp0, %tmp1
- %tmp7 = zext i32 13 to i128
- %tmp3 = lshr i128 %tmp2, %tmp7
- %tmp4 = trunc i128 %tmp3 to i64
- ret i64 %tmp4
-}
diff --git a/release_23/test/CodeGen/Generic/intrinsics.ll b/release_23/test/CodeGen/Generic/intrinsics.ll
deleted file mode 100644
index 373bec9adc05..000000000000
--- a/release_23/test/CodeGen/Generic/intrinsics.ll
+++ /dev/null
@@ -1,40 +0,0 @@
-; RUN: llvm-as < %s | llc
-
-;; SQRT
-declare float @llvm.sqrt.f32(float)
-
-declare double @llvm.sqrt.f64(double)
-
-define double @test_sqrt(float %F) {
- %G = call float @llvm.sqrt.f32( float %F ) ; <float> [#uses=1]
- %H = fpext float %G to double ; <double> [#uses=1]
- %I = call double @llvm.sqrt.f64( double %H ) ; <double> [#uses=1]
- ret double %I
-}
-
-
-; SIN
-declare float @sinf(float)
-
-declare double @sin(double)
-
-define double @test_sin(float %F) {
- %G = call float @sinf( float %F ) ; <float> [#uses=1]
- %H = fpext float %G to double ; <double> [#uses=1]
- %I = call double @sin( double %H ) ; <double> [#uses=1]
- ret double %I
-}
-
-
-; COS
-declare float @cosf(float)
-
-declare double @cos(double)
-
-define double @test_cos(float %F) {
- %G = call float @cosf( float %F ) ; <float> [#uses=1]
- %H = fpext float %G to double ; <double> [#uses=1]
- %I = call double @cos( double %H ) ; <double> [#uses=1]
- ret double %I
-}
-
diff --git a/release_23/test/CodeGen/Generic/invalid-memcpy.ll b/release_23/test/CodeGen/Generic/invalid-memcpy.ll
deleted file mode 100644
index e3acf0c2be13..000000000000
--- a/release_23/test/CodeGen/Generic/invalid-memcpy.ll
+++ /dev/null
@@ -1,19 +0,0 @@
-; RUN: llvm-as < %s | llc
-
-; This testcase is invalid (the alignment specified for memcpy is
-; greater than the alignment guaranteed for Qux or C.0.1173), but it
-; should compile, not crash the code generator.
-
-@C.0.1173 = external constant [33 x i8] ; <[33 x i8]*> [#uses=1]
-
-define void @Bork() {
-entry:
- %Qux = alloca [33 x i8] ; <[33 x i8]*> [#uses=1]
- %Qux1 = bitcast [33 x i8]* %Qux to i8* ; <i8*> [#uses=1]
- call void @llvm.memcpy.i64( i8* %Qux1, i8* getelementptr ([33 x i8]* @C.0.1173, i32 0, i32 0), i64 33, i32 8 )
- ret void
-}
-
-declare void @llvm.memcpy.i64(i8*, i8*, i64, i32)
-
-
diff --git a/release_23/test/CodeGen/Generic/isunord.ll b/release_23/test/CodeGen/Generic/isunord.ll
deleted file mode 100644
index 589f49611791..000000000000
--- a/release_23/test/CodeGen/Generic/isunord.ll
+++ /dev/null
@@ -1,10 +0,0 @@
-; RUN: llvm-as < %s | llc
-; XFAIL: ia64
-
-declare i1 @llvm.isunordered.f64(double, double)
-
-define i1 @test(double %X, double %Y) {
- %tmp27 = fcmp uno double %X, %Y ; <i1> [#uses=1]
- ret i1 %tmp27
-}
-
diff --git a/release_23/test/CodeGen/Generic/llvm-ct-intrinsics.ll b/release_23/test/CodeGen/Generic/llvm-ct-intrinsics.ll
deleted file mode 100644
index 66f409ed27d5..000000000000
--- a/release_23/test/CodeGen/Generic/llvm-ct-intrinsics.ll
+++ /dev/null
@@ -1,62 +0,0 @@
-; Make sure this testcase is supported by all code generators
-; RUN: llvm-as < %s | llc
-
-declare i64 @llvm.ctpop.i64(i64)
-
-declare i32 @llvm.ctpop.i32(i32)
-
-declare i16 @llvm.ctpop.i16(i16)
-
-declare i8 @llvm.ctpop.i8(i8)
-
-define void @ctpoptest(i8 %A, i16 %B, i32 %C, i64 %D, i8* %AP, i16* %BP, i32* %CP, i64* %DP) {
- %a = call i8 @llvm.ctpop.i8( i8 %A ) ; <i8> [#uses=1]
- %b = call i16 @llvm.ctpop.i16( i16 %B ) ; <i16> [#uses=1]
- %c = call i32 @llvm.ctpop.i32( i32 %C ) ; <i32> [#uses=1]
- %d = call i64 @llvm.ctpop.i64( i64 %D ) ; <i64> [#uses=1]
- store i8 %a, i8* %AP
- store i16 %b, i16* %BP
- store i32 %c, i32* %CP
- store i64 %d, i64* %DP
- ret void
-}
-
-declare i64 @llvm.ctlz.i64(i64)
-
-declare i32 @llvm.ctlz.i32(i32)
-
-declare i16 @llvm.ctlz.i16(i16)
-
-declare i8 @llvm.ctlz.i8(i8)
-
-define void @ctlztest(i8 %A, i16 %B, i32 %C, i64 %D, i8* %AP, i16* %BP, i32* %CP, i64* %DP) {
- %a = call i8 @llvm.ctlz.i8( i8 %A ) ; <i8> [#uses=1]
- %b = call i16 @llvm.ctlz.i16( i16 %B ) ; <i16> [#uses=1]
- %c = call i32 @llvm.ctlz.i32( i32 %C ) ; <i32> [#uses=1]
- %d = call i64 @llvm.ctlz.i64( i64 %D ) ; <i64> [#uses=1]
- store i8 %a, i8* %AP
- store i16 %b, i16* %BP
- store i32 %c, i32* %CP
- store i64 %d, i64* %DP
- ret void
-}
-
-declare i64 @llvm.cttz.i64(i64)
-
-declare i32 @llvm.cttz.i32(i32)
-
-declare i16 @llvm.cttz.i16(i16)
-
-declare i8 @llvm.cttz.i8(i8)
-
-define void @cttztest(i8 %A, i16 %B, i32 %C, i64 %D, i8* %AP, i16* %BP, i32* %CP, i64* %DP) {
- %a = call i8 @llvm.cttz.i8( i8 %A ) ; <i8> [#uses=1]
- %b = call i16 @llvm.cttz.i16( i16 %B ) ; <i16> [#uses=1]
- %c = call i32 @llvm.cttz.i32( i32 %C ) ; <i32> [#uses=1]
- %d = call i64 @llvm.cttz.i64( i64 %D ) ; <i64> [#uses=1]
- store i8 %a, i8* %AP
- store i16 %b, i16* %BP
- store i32 %c, i32* %CP
- store i64 %d, i64* %DP
- ret void
-}
diff --git a/release_23/test/CodeGen/Generic/multiple-return-values-cross-block-with-invoke.ll b/release_23/test/CodeGen/Generic/multiple-return-values-cross-block-with-invoke.ll
deleted file mode 100644
index f21b645615ad..000000000000
--- a/release_23/test/CodeGen/Generic/multiple-return-values-cross-block-with-invoke.ll
+++ /dev/null
@@ -1,18 +0,0 @@
-; RUN: llvm-as < %s | llc
-
-declare { i64, double } @wild()
-
-define void @foo(i64* %p, double* %q) nounwind {
- %t = invoke { i64, double } @wild() to label %normal unwind label %handler
-
-normal:
- %mrv_gr = getresult { i64, double } %t, 0
- store i64 %mrv_gr, i64* %p
- %mrv_gr12681 = getresult { i64, double } %t, 1
- store double %mrv_gr12681, double* %q
- ret void
-
-handler:
- ret void
-}
-
diff --git a/release_23/test/CodeGen/Generic/negintconst.ll b/release_23/test/CodeGen/Generic/negintconst.ll
deleted file mode 100644
index a2b3d69ee555..000000000000
--- a/release_23/test/CodeGen/Generic/negintconst.ll
+++ /dev/null
@@ -1,47 +0,0 @@
-; RUN: llvm-as < %s | llc
-
-; Test that a negative constant smaller than 64 bits (e.g., int)
-; is correctly implemented with sign-extension.
-; In particular, the current code generated is:
-;
-; main:
-; .L_main_LL_0:
-; save %o6, -224, %o6
-; setx .G_fmtArg_1, %o1, %o0
-; setuw 1, %o1 ! i = 1
-; setuw 4294967295, %o3 ! THE BUG: 0x00000000ffffffff
-; setsw 0, %i0
-; add %i6, 1999, %o2 ! fval
-; add %o1, %g0, %o1
-; add %o0, 0, %o0
-; mulx %o1, %o3, %o1 ! ERROR: 0xffffffff; should be -1
-; add %o1, 3, %o1 ! ERROR: 0x100000002; should be 0x2
-; mulx %o1, 12, %o3 !
-; add %o2, %o3, %o3 ! produces bad address!
-; call printf
-; nop
-; jmpl %i7+8, %g0
-; restore %g0, 0, %g0
-;
-; llc produces:
-; ioff = 2 fval = 0xffffffff7fffec90 &fval[2] = 0xb7fffeca8
-; instead of:
-; ioff = 2 fval = 0xffffffff7fffec90 &fval[2] = 0xffffffff7fffeca8
-;
- %Results = type { float, float, float }
-@fmtArg = internal global [39 x i8] c"ioff = %u\09fval = 0x%p\09&fval[2] = 0x%p\0A\00" ; <[39 x i8]*> [#uses=1]
-
-declare i32 @printf(i8*, ...)
-
-define i32 @main() {
- %fval = alloca %Results, i32 4 ; <%Results*> [#uses=2]
- %i = add i32 1, 0 ; <i32> [#uses=1]
- %iscale = mul i32 %i, -1 ; <i32> [#uses=1]
- %ioff = add i32 %iscale, 3 ; <i32> [#uses=2]
- %ioff.upgrd.1 = zext i32 %ioff to i64 ; <i64> [#uses=1]
- %fptr = getelementptr %Results* %fval, i64 %ioff.upgrd.1 ; <%Results*> [#uses=1]
- %castFmt = getelementptr [39 x i8]* @fmtArg, i64 0, i64 0 ; <i8*> [#uses=1]
- call i32 (i8*, ...)* @printf( i8* %castFmt, i32 %ioff, %Results* %fval, %Results* %fptr ) ; <i32>:1 [#uses=0]
- ret i32 0
-}
-
diff --git a/release_23/test/CodeGen/Generic/nested-select.ll b/release_23/test/CodeGen/Generic/nested-select.ll
deleted file mode 100644
index a723a4d74268..000000000000
--- a/release_23/test/CodeGen/Generic/nested-select.ll
+++ /dev/null
@@ -1,19 +0,0 @@
-; RUN: llvm-as < %s | llc -o /dev/null -f
-
-; Test that select of a select works
-
-%typedef.tree = type opaque
-
-define i32 @ic_test(double %p.0.2.0.val, double %p.0.2.1.val, double %p.0.2.2.val, %typedef.tree* %t) {
- %result.1.0 = zext i1 false to i32 ; <i32> [#uses=1]
- %tmp.55 = fcmp oge double 0.000000e+00, 1.000000e+00 ; <i1> [#uses=1]
- %tmp.66 = fdiv double 0.000000e+00, 0.000000e+00 ; <double> [#uses=1]
- br label %N
-
-N: ; preds = %0
- %result.1.1 = select i1 %tmp.55, i32 0, i32 %result.1.0 ; <i32> [#uses=1]
- %tmp.75 = fcmp oge double %tmp.66, 1.000000e+00 ; <i1> [#uses=1]
- %retval1 = select i1 %tmp.75, i32 0, i32 %result.1.1 ; <i32> [#uses=1]
- ret i32 %retval1
-}
-
diff --git a/release_23/test/CodeGen/Generic/phi-immediate-factoring.ll b/release_23/test/CodeGen/Generic/phi-immediate-factoring.ll
deleted file mode 100644
index e0f675976d91..000000000000
--- a/release_23/test/CodeGen/Generic/phi-immediate-factoring.ll
+++ /dev/null
@@ -1,54 +0,0 @@
-; PR1296
-; RUN: llvm-as < %s | llc -march=x86 | grep {movl \$1} | count 1
-
-target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64"
-target triple = "i686-apple-darwin8"
-
-define i32 @foo(i32 %A, i32 %B, i32 %C) {
-entry:
- switch i32 %A, label %out [
- i32 1, label %bb
- i32 0, label %bb13
- i32 2, label %bb35
- ]
-
-bb: ; preds = %cond_next, %entry
- %i.144.1 = phi i32 [ 0, %entry ], [ %tmp7, %cond_next ] ; <i32> [#uses=2]
- %tmp4 = and i32 %i.144.1, %B ; <i32> [#uses=1]
- icmp eq i32 %tmp4, 0 ; <i1>:0 [#uses=1]
- br i1 %0, label %cond_next, label %out
-
-cond_next: ; preds = %bb
- %tmp7 = add i32 %i.144.1, 1 ; <i32> [#uses=2]
- icmp slt i32 %tmp7, 1000 ; <i1>:1 [#uses=1]
- br i1 %1, label %bb, label %out
-
-bb13: ; preds = %cond_next18, %entry
- %i.248.1 = phi i32 [ 0, %entry ], [ %tmp20, %cond_next18 ] ; <i32> [#uses=2]
- %tmp16 = and i32 %i.248.1, %C ; <i32> [#uses=1]
- icmp eq i32 %tmp16, 0 ; <i1>:2 [#uses=1]
- br i1 %2, label %cond_next18, label %out
-
-cond_next18: ; preds = %bb13
- %tmp20 = add i32 %i.248.1, 1 ; <i32> [#uses=2]
- icmp slt i32 %tmp20, 1000 ; <i1>:3 [#uses=1]
- br i1 %3, label %bb13, label %out
-
-bb27: ; preds = %bb35
- %tmp30 = and i32 %i.3, %C ; <i32> [#uses=1]
- icmp eq i32 %tmp30, 0 ; <i1>:4 [#uses=1]
- br i1 %4, label %cond_next32, label %out
-
-cond_next32: ; preds = %bb27
- %indvar.next = add i32 %i.3, 1 ; <i32> [#uses=1]
- br label %bb35
-
-bb35: ; preds = %entry, %cond_next32
- %i.3 = phi i32 [ %indvar.next, %cond_next32 ], [ 0, %entry ] ; <i32> [#uses=3]
- icmp slt i32 %i.3, 1000 ; <i1>:5 [#uses=1]
- br i1 %5, label %bb27, label %out
-
-out: ; preds = %bb27, %bb35, %bb13, %cond_next18, %bb, %cond_next, %entry
- %result.0 = phi i32 [ 0, %entry ], [ 1, %bb ], [ 0, %cond_next ], [ 1, %bb13 ], [ 0, %cond_next18 ], [ 1, %bb27 ], [ 0, %bb35 ] ; <i32> [#uses=1]
- ret i32 %result.0
-}
diff --git a/release_23/test/CodeGen/Generic/print-add.ll b/release_23/test/CodeGen/Generic/print-add.ll
deleted file mode 100644
index 4f1cb5e736af..000000000000
--- a/release_23/test/CodeGen/Generic/print-add.ll
+++ /dev/null
@@ -1,18 +0,0 @@
-; RUN: llvm-as < %s | llc
-
-@.str_1 = internal constant [4 x i8] c"%d\0A\00" ; <[4 x i8]*> [#uses=1]
-
-declare i32 @printf(i8*, ...)
-
-define i32 @main() {
- %f = getelementptr [4 x i8]* @.str_1, i64 0, i64 0 ; <i8*> [#uses=3]
- %d = add i32 1, 0 ; <i32> [#uses=3]
- call i32 (i8*, ...)* @printf( i8* %f, i32 %d ) ; <i32>:1 [#uses=0]
- %e = add i32 38, 2 ; <i32> [#uses=2]
- call i32 (i8*, ...)* @printf( i8* %f, i32 %e ) ; <i32>:2 [#uses=0]
- %g = add i32 %d, %d ; <i32> [#uses=1]
- %h = add i32 %e, %g ; <i32> [#uses=1]
- call i32 (i8*, ...)* @printf( i8* %f, i32 %h ) ; <i32>:3 [#uses=0]
- ret i32 0
-}
-
diff --git a/release_23/test/CodeGen/Generic/print-arith-fp.ll b/release_23/test/CodeGen/Generic/print-arith-fp.ll
deleted file mode 100644
index 87aa1a0ba9f7..000000000000
--- a/release_23/test/CodeGen/Generic/print-arith-fp.ll
+++ /dev/null
@@ -1,61 +0,0 @@
-; RUN: llvm-as < %s | llc
-@a_str = internal constant [8 x i8] c"a = %f\0A\00" ; <[8 x i8]*> [#uses=1]
-@b_str = internal constant [8 x i8] c"b = %f\0A\00" ; <[8 x i8]*> [#uses=1]
-@add_str = internal constant [12 x i8] c"a + b = %f\0A\00" ; <[12 x i8]*> [#uses=1]
-@sub_str = internal constant [12 x i8] c"a - b = %f\0A\00" ; <[12 x i8]*> [#uses=1]
-@mul_str = internal constant [12 x i8] c"a * b = %f\0A\00" ; <[12 x i8]*> [#uses=1]
-@div_str = internal constant [12 x i8] c"b / a = %f\0A\00" ; <[12 x i8]*> [#uses=1]
-@rem_str = internal constant [13 x i8] c"b %% a = %f\0A\00" ; <[13 x i8]*> [#uses=1]
-@lt_str = internal constant [12 x i8] c"a < b = %d\0A\00" ; <[12 x i8]*> [#uses=1]
-@le_str = internal constant [13 x i8] c"a <= b = %d\0A\00" ; <[13 x i8]*> [#uses=1]
-@gt_str = internal constant [12 x i8] c"a > b = %d\0A\00" ; <[12 x i8]*> [#uses=1]
-@ge_str = internal constant [13 x i8] c"a >= b = %d\0A\00" ; <[13 x i8]*> [#uses=1]
-@eq_str = internal constant [13 x i8] c"a == b = %d\0A\00" ; <[13 x i8]*> [#uses=1]
-@ne_str = internal constant [13 x i8] c"a != b = %d\0A\00" ; <[13 x i8]*> [#uses=1]
-@A = global double 2.000000e+00 ; <double*> [#uses=1]
-@B = global double 5.000000e+00 ; <double*> [#uses=1]
-
-declare i32 @printf(i8*, ...)
-
-define i32 @main() {
- %a = load double* @A ; <double> [#uses=12]
- %b = load double* @B ; <double> [#uses=12]
- %a_s = getelementptr [8 x i8]* @a_str, i64 0, i64 0 ; <i8*> [#uses=1]
- %b_s = getelementptr [8 x i8]* @b_str, i64 0, i64 0 ; <i8*> [#uses=1]
- call i32 (i8*, ...)* @printf( i8* %a_s, double %a ) ; <i32>:1 [#uses=0]
- call i32 (i8*, ...)* @printf( i8* %b_s, double %b ) ; <i32>:2 [#uses=0]
- %add_r = add double %a, %b ; <double> [#uses=1]
- %sub_r = sub double %a, %b ; <double> [#uses=1]
- %mul_r = mul double %a, %b ; <double> [#uses=1]
- %div_r = fdiv double %b, %a ; <double> [#uses=1]
- %rem_r = frem double %b, %a ; <double> [#uses=1]
- %add_s = getelementptr [12 x i8]* @add_str, i64 0, i64 0 ; <i8*> [#uses=1]
- %sub_s = getelementptr [12 x i8]* @sub_str, i64 0, i64 0 ; <i8*> [#uses=1]
- %mul_s = getelementptr [12 x i8]* @mul_str, i64 0, i64 0 ; <i8*> [#uses=1]
- %div_s = getelementptr [12 x i8]* @div_str, i64 0, i64 0 ; <i8*> [#uses=1]
- %rem_s = getelementptr [13 x i8]* @rem_str, i64 0, i64 0 ; <i8*> [#uses=1]
- call i32 (i8*, ...)* @printf( i8* %add_s, double %add_r ) ; <i32>:3 [#uses=0]
- call i32 (i8*, ...)* @printf( i8* %sub_s, double %sub_r ) ; <i32>:4 [#uses=0]
- call i32 (i8*, ...)* @printf( i8* %mul_s, double %mul_r ) ; <i32>:5 [#uses=0]
- call i32 (i8*, ...)* @printf( i8* %div_s, double %div_r ) ; <i32>:6 [#uses=0]
- call i32 (i8*, ...)* @printf( i8* %rem_s, double %rem_r ) ; <i32>:7 [#uses=0]
- %lt_r = fcmp olt double %a, %b ; <i1> [#uses=1]
- %le_r = fcmp ole double %a, %b ; <i1> [#uses=1]
- %gt_r = fcmp ogt double %a, %b ; <i1> [#uses=1]
- %ge_r = fcmp oge double %a, %b ; <i1> [#uses=1]
- %eq_r = fcmp oeq double %a, %b ; <i1> [#uses=1]
- %ne_r = fcmp une double %a, %b ; <i1> [#uses=1]
- %lt_s = getelementptr [12 x i8]* @lt_str, i64 0, i64 0 ; <i8*> [#uses=1]
- %le_s = getelementptr [13 x i8]* @le_str, i64 0, i64 0 ; <i8*> [#uses=1]
- %gt_s = getelementptr [12 x i8]* @gt_str, i64 0, i64 0 ; <i8*> [#uses=1]
- %ge_s = getelementptr [13 x i8]* @ge_str, i64 0, i64 0 ; <i8*> [#uses=1]
- %eq_s = getelementptr [13 x i8]* @eq_str, i64 0, i64 0 ; <i8*> [#uses=1]
- %ne_s = getelementptr [13 x i8]* @ne_str, i64 0, i64 0 ; <i8*> [#uses=1]
- call i32 (i8*, ...)* @printf( i8* %lt_s, i1 %lt_r ) ; <i32>:8 [#uses=0]
- call i32 (i8*, ...)* @printf( i8* %le_s, i1 %le_r ) ; <i32>:9 [#uses=0]
- call i32 (i8*, ...)* @printf( i8* %gt_s, i1 %gt_r ) ; <i32>:10 [#uses=0]
- call i32 (i8*, ...)* @printf( i8* %ge_s, i1 %ge_r ) ; <i32>:11 [#uses=0]
- call i32 (i8*, ...)* @printf( i8* %eq_s, i1 %eq_r ) ; <i32>:12 [#uses=0]
- call i32 (i8*, ...)* @printf( i8* %ne_s, i1 %ne_r ) ; <i32>:13 [#uses=0]
- ret i32 0
-}
diff --git a/release_23/test/CodeGen/Generic/print-arith-int.ll b/release_23/test/CodeGen/Generic/print-arith-int.ll
deleted file mode 100644
index cf275151571e..000000000000
--- a/release_23/test/CodeGen/Generic/print-arith-int.ll
+++ /dev/null
@@ -1,84 +0,0 @@
-; RUN: llvm-as < %s | llc
-@a_str = internal constant [8 x i8] c"a = %d\0A\00" ; <[8 x i8]*> [#uses=1]
-@b_str = internal constant [8 x i8] c"b = %d\0A\00" ; <[8 x i8]*> [#uses=1]
-@add_str = internal constant [12 x i8] c"a + b = %d\0A\00" ; <[12 x i8]*> [#uses=1]
-@sub_str = internal constant [12 x i8] c"a - b = %d\0A\00" ; <[12 x i8]*> [#uses=1]
-@mul_str = internal constant [12 x i8] c"a * b = %d\0A\00" ; <[12 x i8]*> [#uses=1]
-@div_str = internal constant [12 x i8] c"b / a = %d\0A\00" ; <[12 x i8]*> [#uses=1]
-@rem_str = internal constant [13 x i8] c"b \5C% a = %d\0A\00" ; <[13 x i8]*> [#uses=1]
-@lt_str = internal constant [12 x i8] c"a < b = %d\0A\00" ; <[12 x i8]*> [#uses=1]
-@le_str = internal constant [13 x i8] c"a <= b = %d\0A\00" ; <[13 x i8]*> [#uses=1]
-@gt_str = internal constant [12 x i8] c"a > b = %d\0A\00" ; <[12 x i8]*> [#uses=1]
-@ge_str = internal constant [13 x i8] c"a >= b = %d\0A\00" ; <[13 x i8]*> [#uses=1]
-@eq_str = internal constant [13 x i8] c"a == b = %d\0A\00" ; <[13 x i8]*> [#uses=1]
-@ne_str = internal constant [13 x i8] c"a != b = %d\0A\00" ; <[13 x i8]*> [#uses=1]
-@and_str = internal constant [12 x i8] c"a & b = %d\0A\00" ; <[12 x i8]*> [#uses=1]
-@or_str = internal constant [12 x i8] c"a | b = %d\0A\00" ; <[12 x i8]*> [#uses=1]
-@xor_str = internal constant [12 x i8] c"a ^ b = %d\0A\00" ; <[12 x i8]*> [#uses=1]
-@shl_str = internal constant [13 x i8] c"b << a = %d\0A\00" ; <[13 x i8]*> [#uses=1]
-@shr_str = internal constant [13 x i8] c"b >> a = %d\0A\00" ; <[13 x i8]*> [#uses=1]
-@A = global i32 2 ; <i32*> [#uses=1]
-@B = global i32 5 ; <i32*> [#uses=1]
-
-declare i32 @printf(i8*, ...)
-
-define i32 @main() {
- %a = load i32* @A ; <i32> [#uses=16]
- %b = load i32* @B ; <i32> [#uses=17]
- %a_s = getelementptr [8 x i8]* @a_str, i64 0, i64 0 ; <i8*> [#uses=1]
- %b_s = getelementptr [8 x i8]* @b_str, i64 0, i64 0 ; <i8*> [#uses=1]
- call i32 (i8*, ...)* @printf( i8* %a_s, i32 %a ) ; <i32>:1 [#uses=0]
- call i32 (i8*, ...)* @printf( i8* %b_s, i32 %b ) ; <i32>:2 [#uses=0]
- %add_r = add i32 %a, %b ; <i32> [#uses=1]
- %sub_r = sub i32 %a, %b ; <i32> [#uses=1]
- %mul_r = mul i32 %a, %b ; <i32> [#uses=1]
- %div_r = sdiv i32 %b, %a ; <i32> [#uses=1]
- %rem_r = srem i32 %b, %a ; <i32> [#uses=1]
- %add_s = getelementptr [12 x i8]* @add_str, i64 0, i64 0 ; <i8*> [#uses=1]
- %sub_s = getelementptr [12 x i8]* @sub_str, i64 0, i64 0 ; <i8*> [#uses=1]
- %mul_s = getelementptr [12 x i8]* @mul_str, i64 0, i64 0 ; <i8*> [#uses=1]
- %div_s = getelementptr [12 x i8]* @div_str, i64 0, i64 0 ; <i8*> [#uses=1]
- %rem_s = getelementptr [13 x i8]* @rem_str, i64 0, i64 0 ; <i8*> [#uses=1]
- call i32 (i8*, ...)* @printf( i8* %add_s, i32 %add_r ) ; <i32>:3 [#uses=0]
- call i32 (i8*, ...)* @printf( i8* %sub_s, i32 %sub_r ) ; <i32>:4 [#uses=0]
- call i32 (i8*, ...)* @printf( i8* %mul_s, i32 %mul_r ) ; <i32>:5 [#uses=0]
- call i32 (i8*, ...)* @printf( i8* %div_s, i32 %div_r ) ; <i32>:6 [#uses=0]
- call i32 (i8*, ...)* @printf( i8* %rem_s, i32 %rem_r ) ; <i32>:7 [#uses=0]
- %lt_r = icmp slt i32 %a, %b ; <i1> [#uses=1]
- %le_r = icmp sle i32 %a, %b ; <i1> [#uses=1]
- %gt_r = icmp sgt i32 %a, %b ; <i1> [#uses=1]
- %ge_r = icmp sge i32 %a, %b ; <i1> [#uses=1]
- %eq_r = icmp eq i32 %a, %b ; <i1> [#uses=1]
- %ne_r = icmp ne i32 %a, %b ; <i1> [#uses=1]
- %lt_s = getelementptr [12 x i8]* @lt_str, i64 0, i64 0 ; <i8*> [#uses=1]
- %le_s = getelementptr [13 x i8]* @le_str, i64 0, i64 0 ; <i8*> [#uses=1]
- %gt_s = getelementptr [12 x i8]* @gt_str, i64 0, i64 0 ; <i8*> [#uses=1]
- %ge_s = getelementptr [13 x i8]* @ge_str, i64 0, i64 0 ; <i8*> [#uses=1]
- %eq_s = getelementptr [13 x i8]* @eq_str, i64 0, i64 0 ; <i8*> [#uses=1]
- %ne_s = getelementptr [13 x i8]* @ne_str, i64 0, i64 0 ; <i8*> [#uses=1]
- call i32 (i8*, ...)* @printf( i8* %lt_s, i1 %lt_r ) ; <i32>:8 [#uses=0]
- call i32 (i8*, ...)* @printf( i8* %le_s, i1 %le_r ) ; <i32>:9 [#uses=0]
- call i32 (i8*, ...)* @printf( i8* %gt_s, i1 %gt_r ) ; <i32>:10 [#uses=0]
- call i32 (i8*, ...)* @printf( i8* %ge_s, i1 %ge_r ) ; <i32>:11 [#uses=0]
- call i32 (i8*, ...)* @printf( i8* %eq_s, i1 %eq_r ) ; <i32>:12 [#uses=0]
- call i32 (i8*, ...)* @printf( i8* %ne_s, i1 %ne_r ) ; <i32>:13 [#uses=0]
- %and_r = and i32 %a, %b ; <i32> [#uses=1]
- %or_r = or i32 %a, %b ; <i32> [#uses=1]
- %xor_r = xor i32 %a, %b ; <i32> [#uses=1]
- %u = trunc i32 %a to i8 ; <i8> [#uses=2]
- %shift.upgrd.1 = zext i8 %u to i32 ; <i32> [#uses=1]
- %shl_r = shl i32 %b, %shift.upgrd.1 ; <i32> [#uses=1]
- %shift.upgrd.2 = zext i8 %u to i32 ; <i32> [#uses=1]
- %shr_r = ashr i32 %b, %shift.upgrd.2 ; <i32> [#uses=1]
- %and_s = getelementptr [12 x i8]* @and_str, i64 0, i64 0 ; <i8*> [#uses=1]
- %or_s = getelementptr [12 x i8]* @or_str, i64 0, i64 0 ; <i8*> [#uses=1]
- %xor_s = getelementptr [12 x i8]* @xor_str, i64 0, i64 0 ; <i8*> [#uses=1]
- %shl_s = getelementptr [13 x i8]* @shl_str, i64 0, i64 0 ; <i8*> [#uses=1]
- %shr_s = getelementptr [13 x i8]* @shr_str, i64 0, i64 0 ; <i8*> [#uses=1]
- call i32 (i8*, ...)* @printf( i8* %and_s, i32 %and_r ) ; <i32>:14 [#uses=0]
- call i32 (i8*, ...)* @printf( i8* %or_s, i32 %or_r ) ; <i32>:15 [#uses=0]
- call i32 (i8*, ...)* @printf( i8* %xor_s, i32 %xor_r ) ; <i32>:16 [#uses=0]
- call i32 (i8*, ...)* @printf( i8* %shl_s, i32 %shl_r ) ; <i32>:17 [#uses=0]
- call i32 (i8*, ...)* @printf( i8* %shr_s, i32 %shr_r ) ; <i32>:18 [#uses=0]
- ret i32 0
-}
diff --git a/release_23/test/CodeGen/Generic/print-int.ll b/release_23/test/CodeGen/Generic/print-int.ll
deleted file mode 100644
index 58f5047ceb79..000000000000
--- a/release_23/test/CodeGen/Generic/print-int.ll
+++ /dev/null
@@ -1,13 +0,0 @@
-; RUN: llvm-as < %s | llc
-
-@.str_1 = internal constant [4 x i8] c"%d\0A\00" ; <[4 x i8]*> [#uses=1]
-
-declare i32 @printf(i8*, ...)
-
-define i32 @main() {
- %f = getelementptr [4 x i8]* @.str_1, i64 0, i64 0 ; <i8*> [#uses=1]
- %d = add i32 0, 0 ; <i32> [#uses=1]
- %tmp.0 = call i32 (i8*, ...)* @printf( i8* %f, i32 %d ) ; <i32> [#uses=0]
- ret i32 0
-}
-
diff --git a/release_23/test/CodeGen/Generic/print-mul-exp.ll b/release_23/test/CodeGen/Generic/print-mul-exp.ll
deleted file mode 100644
index 06667754a323..000000000000
--- a/release_23/test/CodeGen/Generic/print-mul-exp.ll
+++ /dev/null
@@ -1,55 +0,0 @@
-; RUN: llvm-as < %s | llc
-
-@a_str = internal constant [8 x i8] c"a = %d\0A\00" ; <[8 x i8]*> [#uses=1]
-@a_mul_str = internal constant [13 x i8] c"a * %d = %d\0A\00" ; <[13 x i8]*> [#uses=1]
-@A = global i32 2 ; <i32*> [#uses=1]
-
-declare i32 @printf(i8*, ...)
-
-define i32 @main() {
- %a = load i32* @A ; <i32> [#uses=21]
- %a_s = getelementptr [8 x i8]* @a_str, i64 0, i64 0 ; <i8*> [#uses=1]
- %a_mul_s = getelementptr [13 x i8]* @a_mul_str, i64 0, i64 0 ; <i8*> [#uses=20]
- call i32 (i8*, ...)* @printf( i8* %a_s, i32 %a ) ; <i32>:1 [#uses=0]
- %r_0 = mul i32 %a, 0 ; <i32> [#uses=1]
- %r_1 = mul i32 %a, 1 ; <i32> [#uses=1]
- %r_2 = mul i32 %a, 2 ; <i32> [#uses=1]
- %r_3 = mul i32 %a, 3 ; <i32> [#uses=1]
- %r_4 = mul i32 %a, 4 ; <i32> [#uses=1]
- %r_5 = mul i32 %a, 5 ; <i32> [#uses=1]
- %r_6 = mul i32 %a, 6 ; <i32> [#uses=1]
- %r_7 = mul i32 %a, 7 ; <i32> [#uses=1]
- %r_8 = mul i32 %a, 8 ; <i32> [#uses=1]
- %r_9 = mul i32 %a, 9 ; <i32> [#uses=1]
- %r_10 = mul i32 %a, 10 ; <i32> [#uses=1]
- %r_11 = mul i32 %a, 11 ; <i32> [#uses=1]
- %r_12 = mul i32 %a, 12 ; <i32> [#uses=1]
- %r_13 = mul i32 %a, 13 ; <i32> [#uses=1]
- %r_14 = mul i32 %a, 14 ; <i32> [#uses=1]
- %r_15 = mul i32 %a, 15 ; <i32> [#uses=1]
- %r_16 = mul i32 %a, 16 ; <i32> [#uses=1]
- %r_17 = mul i32 %a, 17 ; <i32> [#uses=1]
- %r_18 = mul i32 %a, 18 ; <i32> [#uses=1]
- %r_19 = mul i32 %a, 19 ; <i32> [#uses=1]
- call i32 (i8*, ...)* @printf( i8* %a_mul_s, i32 0, i32 %r_0 ) ; <i32>:2 [#uses=0]
- call i32 (i8*, ...)* @printf( i8* %a_mul_s, i32 1, i32 %r_1 ) ; <i32>:3 [#uses=0]
- call i32 (i8*, ...)* @printf( i8* %a_mul_s, i32 2, i32 %r_2 ) ; <i32>:4 [#uses=0]
- call i32 (i8*, ...)* @printf( i8* %a_mul_s, i32 3, i32 %r_3 ) ; <i32>:5 [#uses=0]
- call i32 (i8*, ...)* @printf( i8* %a_mul_s, i32 4, i32 %r_4 ) ; <i32>:6 [#uses=0]
- call i32 (i8*, ...)* @printf( i8* %a_mul_s, i32 5, i32 %r_5 ) ; <i32>:7 [#uses=0]
- call i32 (i8*, ...)* @printf( i8* %a_mul_s, i32 6, i32 %r_6 ) ; <i32>:8 [#uses=0]
- call i32 (i8*, ...)* @printf( i8* %a_mul_s, i32 7, i32 %r_7 ) ; <i32>:9 [#uses=0]
- call i32 (i8*, ...)* @printf( i8* %a_mul_s, i32 8, i32 %r_8 ) ; <i32>:10 [#uses=0]
- call i32 (i8*, ...)* @printf( i8* %a_mul_s, i32 9, i32 %r_9 ) ; <i32>:11 [#uses=0]
- call i32 (i8*, ...)* @printf( i8* %a_mul_s, i32 10, i32 %r_10 ) ; <i32>:12 [#uses=0]
- call i32 (i8*, ...)* @printf( i8* %a_mul_s, i32 11, i32 %r_11 ) ; <i32>:13 [#uses=0]
- call i32 (i8*, ...)* @printf( i8* %a_mul_s, i32 12, i32 %r_12 ) ; <i32>:14 [#uses=0]
- call i32 (i8*, ...)* @printf( i8* %a_mul_s, i32 13, i32 %r_13 ) ; <i32>:15 [#uses=0]
- call i32 (i8*, ...)* @printf( i8* %a_mul_s, i32 14, i32 %r_14 ) ; <i32>:16 [#uses=0]
- call i32 (i8*, ...)* @printf( i8* %a_mul_s, i32 15, i32 %r_15 ) ; <i32>:17 [#uses=0]
- call i32 (i8*, ...)* @printf( i8* %a_mul_s, i32 16, i32 %r_16 ) ; <i32>:18 [#uses=0]
- call i32 (i8*, ...)* @printf( i8* %a_mul_s, i32 17, i32 %r_17 ) ; <i32>:19 [#uses=0]
- call i32 (i8*, ...)* @printf( i8* %a_mul_s, i32 18, i32 %r_18 ) ; <i32>:20 [#uses=0]
- call i32 (i8*, ...)* @printf( i8* %a_mul_s, i32 19, i32 %r_19 ) ; <i32>:21 [#uses=0]
- ret i32 0
-}
diff --git a/release_23/test/CodeGen/Generic/print-mul.ll b/release_23/test/CodeGen/Generic/print-mul.ll
deleted file mode 100644
index 1d9452a58434..000000000000
--- a/release_23/test/CodeGen/Generic/print-mul.ll
+++ /dev/null
@@ -1,32 +0,0 @@
-; RUN: llvm-as < %s | llc
-
-@a_str = internal constant [8 x i8] c"a = %d\0A\00" ; <[8 x i8]*> [#uses=1]
-@b_str = internal constant [8 x i8] c"b = %d\0A\00" ; <[8 x i8]*> [#uses=1]
-@a_mul_str = internal constant [13 x i8] c"a * %d = %d\0A\00" ; <[13 x i8]*> [#uses=1]
-@A = global i32 2 ; <i32*> [#uses=1]
-@B = global i32 5 ; <i32*> [#uses=1]
-
-declare i32 @printf(i8*, ...)
-
-define i32 @main() {
-entry:
- %a = load i32* @A ; <i32> [#uses=2]
- %b = load i32* @B ; <i32> [#uses=1]
- %a_s = getelementptr [8 x i8]* @a_str, i64 0, i64 0 ; <i8*> [#uses=1]
- %b_s = getelementptr [8 x i8]* @b_str, i64 0, i64 0 ; <i8*> [#uses=1]
- %a_mul_s = getelementptr [13 x i8]* @a_mul_str, i64 0, i64 0 ; <i8*> [#uses=1]
- call i32 (i8*, ...)* @printf( i8* %a_s, i32 %a ) ; <i32>:0 [#uses=0]
- call i32 (i8*, ...)* @printf( i8* %b_s, i32 %b ) ; <i32>:1 [#uses=0]
- br label %shl_test
-
-shl_test: ; preds = %shl_test, %entry
- %s = phi i32 [ 0, %entry ], [ %s_inc, %shl_test ] ; <i32> [#uses=4]
- %result = mul i32 %a, %s ; <i32> [#uses=1]
- call i32 (i8*, ...)* @printf( i8* %a_mul_s, i32 %s, i32 %result ) ; <i32>:2 [#uses=0]
- %s_inc = add i32 %s, 1 ; <i32> [#uses=1]
- %done = icmp eq i32 %s, 256 ; <i1> [#uses=1]
- br i1 %done, label %fini, label %shl_test
-
-fini: ; preds = %shl_test
- ret i32 0
-}
diff --git a/release_23/test/CodeGen/Generic/print-shift.ll b/release_23/test/CodeGen/Generic/print-shift.ll
deleted file mode 100644
index 8992e8df0c01..000000000000
--- a/release_23/test/CodeGen/Generic/print-shift.ll
+++ /dev/null
@@ -1,34 +0,0 @@
-; RUN: llvm-as < %s | llc
-
-@a_str = internal constant [8 x i8] c"a = %d\0A\00" ; <[8 x i8]*> [#uses=1]
-@b_str = internal constant [8 x i8] c"b = %d\0A\00" ; <[8 x i8]*> [#uses=1]
-@a_shl_str = internal constant [14 x i8] c"a << %d = %d\0A\00" ; <[14 x i8]*> [#uses=1]
-@A = global i32 2 ; <i32*> [#uses=1]
-@B = global i32 5 ; <i32*> [#uses=1]
-
-declare i32 @printf(i8*, ...)
-
-define i32 @main() {
-entry:
- %a = load i32* @A ; <i32> [#uses=2]
- %b = load i32* @B ; <i32> [#uses=1]
- %a_s = getelementptr [8 x i8]* @a_str, i64 0, i64 0 ; <i8*> [#uses=1]
- %b_s = getelementptr [8 x i8]* @b_str, i64 0, i64 0 ; <i8*> [#uses=1]
- %a_shl_s = getelementptr [14 x i8]* @a_shl_str, i64 0, i64 0 ; <i8*> [#uses=1]
- call i32 (i8*, ...)* @printf( i8* %a_s, i32 %a ) ; <i32>:0 [#uses=0]
- call i32 (i8*, ...)* @printf( i8* %b_s, i32 %b ) ; <i32>:1 [#uses=0]
- br label %shl_test
-
-shl_test: ; preds = %shl_test, %entry
- %s = phi i8 [ 0, %entry ], [ %s_inc, %shl_test ] ; <i8> [#uses=4]
- %shift.upgrd.1 = zext i8 %s to i32 ; <i32> [#uses=1]
- %result = shl i32 %a, %shift.upgrd.1 ; <i32> [#uses=1]
- call i32 (i8*, ...)* @printf( i8* %a_shl_s, i8 %s, i32 %result ) ; <i32>:2 [#uses=0]
- %s_inc = add i8 %s, 1 ; <i8> [#uses=1]
- %done = icmp eq i8 %s, 32 ; <i1> [#uses=1]
- br i1 %done, label %fini, label %shl_test
-
-fini: ; preds = %shl_test
- ret i32 0
-}
-
diff --git a/release_23/test/CodeGen/Generic/ret0.ll b/release_23/test/CodeGen/Generic/ret0.ll
deleted file mode 100644
index 489f31c3730d..000000000000
--- a/release_23/test/CodeGen/Generic/ret0.ll
+++ /dev/null
@@ -1,5 +0,0 @@
-; RUN: llvm-as < %s | llc
-
-define i32 @main() {
- ret i32 0
-}
diff --git a/release_23/test/CodeGen/Generic/ret42.ll b/release_23/test/CodeGen/Generic/ret42.ll
deleted file mode 100644
index 0cbe1763faad..000000000000
--- a/release_23/test/CodeGen/Generic/ret42.ll
+++ /dev/null
@@ -1,5 +0,0 @@
-; RUN: llvm-as < %s | llc
-
-define i32 @main() {
- ret i32 42
-}
diff --git a/release_23/test/CodeGen/Generic/sched.ll b/release_23/test/CodeGen/Generic/sched.ll
deleted file mode 100644
index 2b6746c7a725..000000000000
--- a/release_23/test/CodeGen/Generic/sched.ll
+++ /dev/null
@@ -1,27 +0,0 @@
-; RUN: llvm-as < %s | llc
-
-declare i32 @printf(i8*, i32, float)
-
-define i32 @testissue(i32 %i, float %x, float %y) {
- br label %bb1
-
-bb1: ; preds = %bb1, %0
- %x1 = mul float %x, %y ; <float> [#uses=1]
- %y1 = mul float %y, 7.500000e-01 ; <float> [#uses=1]
- %z1 = add float %x1, %y1 ; <float> [#uses=1]
- %x2 = mul float %x, 5.000000e-01 ; <float> [#uses=1]
- %y2 = mul float %y, 0x3FECCCCCC0000000 ; <float> [#uses=1]
- %z2 = add float %x2, %y2 ; <float> [#uses=1]
- %z3 = add float %z1, %z2 ; <float> [#uses=1]
- %i1 = shl i32 %i, 3 ; <i32> [#uses=1]
- %j1 = add i32 %i, 7 ; <i32> [#uses=1]
- %m1 = add i32 %i1, %j1 ; <i32> [#uses=2]
- %b = icmp sle i32 %m1, 6 ; <i1> [#uses=1]
- br i1 %b, label %bb1, label %bb2
-
-bb2: ; preds = %bb1
- %Msg = inttoptr i64 0 to i8* ; <i8*> [#uses=1]
- call i32 @printf( i8* %Msg, i32 %m1, float %z3 ) ; <i32>:1 [#uses=0]
- ret i32 0
-}
-
diff --git a/release_23/test/CodeGen/Generic/select.ll b/release_23/test/CodeGen/Generic/select.ll
deleted file mode 100644
index fc573f3282ce..000000000000
--- a/release_23/test/CodeGen/Generic/select.ll
+++ /dev/null
@@ -1,187 +0,0 @@
-; RUN: llvm-as < %s | llc
-
-%Domain = type { i8*, i32, i32*, i32, i32, i32*, %Domain* }
-@AConst = constant i32 123 ; <i32*> [#uses=1]
-
-; Test setting values of different constants in registers.
-;
-define void @testConsts(i32 %N, float %X) {
- %a = add i32 %N, 1 ; <i32> [#uses=0]
- %i = add i32 %N, 12345678 ; <i32> [#uses=0]
- %b = add i16 4, 3 ; <i16> [#uses=0]
- %c = add float %X, 0.000000e+00 ; <float> [#uses=0]
- %d = add float %X, 0x400921CAC0000000 ; <float> [#uses=0]
- %f = add i32 -1, 10 ; <i32> [#uses=0]
- %g = add i16 20, -1 ; <i16> [#uses=0]
- %j = add i16 -1, 30 ; <i16> [#uses=0]
- %h = add i8 40, -1 ; <i8> [#uses=0]
- %k = add i8 -1, 50 ; <i8> [#uses=0]
- ret void
-}
-
-; A SetCC whose result is used should produce instructions to
-; compute the boolean value in a register. One whose result
-; is unused will only generate the condition code but not
-; the boolean result.
-;
-define void @unusedBool(i32* %x, i32* %y) {
- icmp eq i32* %x, %y ; <i1>:1 [#uses=1]
- xor i1 %1, true ; <i1>:2 [#uses=0]
- icmp ne i32* %x, %y ; <i1>:3 [#uses=0]
- ret void
-}
-
-; A constant argument to a Phi produces a Cast instruction in the
-; corresponding predecessor basic block. This checks a few things:
-; -- phi arguments coming from the bottom of the same basic block
-; (they should not be forward substituted in the machine code!)
-; -- code generation for casts of various types
-; -- use of immediate fields for integral constants of different sizes
-; -- branch on a constant condition
-;
-define void @mergeConstants(i32* %x, i32* %y) {
-; <label>:0
- br label %Top
-
-Top: ; preds = %Next, %Top, %0
- phi i32 [ 0, %0 ], [ 1, %Top ], [ 524288, %Next ] ; <i32>:1 [#uses=0]
- phi float [ 0.000000e+00, %0 ], [ 1.000000e+00, %Top ], [ 2.000000e+00, %Next ] ; <float>:2 [#uses=0]
- phi double [ 5.000000e-01, %0 ], [ 1.500000e+00, %Top ], [ 2.500000e+00, %Next ]
- phi i1 [ true, %0 ], [ false, %Top ], [ true, %Next ] ; <i1>:4 [#uses=0]
- br i1 true, label %Top, label %Next
-
-Next: ; preds = %Top
- br label %Top
-}
-
-
-
-; A constant argument to a cast used only once should be forward substituted
-; and loaded where needed, which happens is:
-; -- User of cast has no immediate field
-; -- User of cast has immediate field but constant is too large to fit
-; or constant is not resolved until later (e.g., global address)
-; -- User of cast uses it as a call arg. or return value so it is an implicit
-; use but has to be loaded into a virtual register so that the reg.
-; allocator can allocate the appropriate phys. reg. for it
-;
-define i32* @castconst(float) {
- %castbig = trunc i64 99999999 to i32 ; <i32> [#uses=1]
- %castsmall = trunc i64 1 to i32 ; <i32> [#uses=1]
- %usebig = add i32 %castbig, %castsmall ; <i32> [#uses=0]
- %castglob = bitcast i32* @AConst to i64* ; <i64*> [#uses=1]
- %dummyl = load i64* %castglob ; <i64> [#uses=0]
- %castnull = inttoptr i64 0 to i32* ; <i32*> [#uses=1]
- ret i32* %castnull
-}
-
-; Test branch-on-comparison-with-zero, in two ways:
-; 1. can be folded
-; 2. cannot be folded because result of comparison is used twice
-;
-define void @testbool(i32 %A, i32 %B) {
- br label %Top
-
-Top: ; preds = %loop, %0
- %D = add i32 %A, %B ; <i32> [#uses=2]
- %E = sub i32 %D, -4 ; <i32> [#uses=1]
- %C = icmp sle i32 %E, 0 ; <i1> [#uses=1]
- br i1 %C, label %retlbl, label %loop
-
-loop: ; preds = %loop, %Top
- %F = add i32 %A, %B ; <i32> [#uses=0]
- %G = sub i32 %D, -4 ; <i32> [#uses=1]
- %D.upgrd.1 = icmp sle i32 %G, 0 ; <i1> [#uses=1]
- %E.upgrd.2 = xor i1 %D.upgrd.1, true ; <i1> [#uses=1]
- br i1 %E.upgrd.2, label %loop, label %Top
-
-retlbl: ; preds = %Top
- ret void
-}
-
-
-;; Test use of a boolean result in cast operations.
-;; Requires converting a condition code result into a 0/1 value in a reg.
-;;
-define i32 @castbool(i32 %A, i32 %B) {
-bb0:
- %cond213 = icmp slt i32 %A, %B ; <i1> [#uses=1]
- %cast110 = zext i1 %cond213 to i8 ; <i8> [#uses=1]
- %cast109 = zext i8 %cast110 to i32 ; <i32> [#uses=1]
- ret i32 %cast109
-}
-
-;; Test use of a boolean result in arithmetic and logical operations.
-;; Requires converting a condition code result into a 0/1 value in a reg.
-;;
-define i1 @boolexpr(i1 %b, i32 %N) {
- %b2 = icmp sge i32 %N, 0 ; <i1> [#uses=1]
- %b3 = and i1 %b, %b2 ; <i1> [#uses=1]
- ret i1 %b3
-}
-
-; Test branch on floating point comparison
-;
-define void @testfloatbool(float %x, float %y) {
- br label %Top
-
-Top: ; preds = %Top, %0
- %p = add float %x, %y ; <float> [#uses=1]
- %z = sub float %x, %y ; <float> [#uses=1]
- %b = fcmp ole float %p, %z ; <i1> [#uses=2]
- %c = xor i1 %b, true ; <i1> [#uses=0]
- br i1 %b, label %Top, label %goon
-
-goon: ; preds = %Top
- ret void
-}
-
-
-; Test cases where an LLVM instruction requires no machine
-; instructions (e.g., cast int* to long). But there are 2 cases:
-; 1. If the result register has only a single use and the use is in the
-; same basic block, the operand will be copy-propagated during
-; instruction selection.
-; 2. If the result register has multiple uses or is in a different
-; basic block, it cannot (or will not) be copy propagated during
-; instruction selection. It will generate a
-; copy instruction (add-with-0), but this copy should get coalesced
-; away by the register allocator.
-;
-define i32 @checkForward(i32 %N, i32* %A) {
-bb2:
- %reg114 = shl i32 %N, 2 ; <i32> [#uses=1]
- %cast115 = sext i32 %reg114 to i64 ; <i64> [#uses=1]
- %cast116 = ptrtoint i32* %A to i64 ; <i64> [#uses=1]
- %reg116 = add i64 %cast116, %cast115 ; <i64> [#uses=1]
- %castPtr = inttoptr i64 %reg116 to i32* ; <i32*> [#uses=1]
- %reg118 = load i32* %castPtr ; <i32> [#uses=1]
- %cast117 = sext i32 %reg118 to i64 ; <i64> [#uses=2]
- %reg159 = add i64 1234567, %cast117 ; <i64> [#uses=0]
- %reg160 = add i64 7654321, %cast117 ; <i64> [#uses=0]
- ret i32 0
-}
-
-
-; Test case for unary NOT operation constructed from XOR.
-;
-define void @checkNot(i1 %b, i32 %i) {
- %notB = xor i1 %b, true ; <i1> [#uses=1]
- %notI = xor i32 %i, -1 ; <i32> [#uses=2]
- %F = icmp sge i32 %notI, 100 ; <i1> [#uses=1]
- %J = add i32 %i, %i ; <i32> [#uses=1]
- %andNotB = and i1 %F, %notB ; <i1> [#uses=0]
- %andNotI = and i32 %J, %notI ; <i32> [#uses=0]
- %notB2 = xor i1 true, %b ; <i1> [#uses=0]
- %notI2 = xor i32 -1, %i ; <i32> [#uses=0]
- ret void
-}
-
-; Test case for folding getelementptr into a load/store
-;
-define i32 @checkFoldGEP(%Domain* %D, i64 %idx) {
- %reg841 = getelementptr %Domain* %D, i64 0, i32 1 ; <i32*> [#uses=1]
- %reg820 = load i32* %reg841 ; <i32> [#uses=1]
- ret i32 %reg820
-}
-
diff --git a/release_23/test/CodeGen/Generic/shift-int64.ll b/release_23/test/CodeGen/Generic/shift-int64.ll
deleted file mode 100644
index 31be2d634e99..000000000000
--- a/release_23/test/CodeGen/Generic/shift-int64.ll
+++ /dev/null
@@ -1,12 +0,0 @@
-; RUN: llvm-as < %s | llc
-
-define i64 @test_imm(i64 %X) {
- %Y = ashr i64 %X, 17 ; <i64> [#uses=1]
- ret i64 %Y
-}
-
-define i64 @test_variable(i64 %X, i8 %Amt) {
- %shift.upgrd.1 = zext i8 %Amt to i64 ; <i64> [#uses=1]
- %Y = ashr i64 %X, %shift.upgrd.1 ; <i64> [#uses=1]
- ret i64 %Y
-}
diff --git a/release_23/test/CodeGen/Generic/spillccr.ll b/release_23/test/CodeGen/Generic/spillccr.ll
deleted file mode 100644
index 120668aa7742..000000000000
--- a/release_23/test/CodeGen/Generic/spillccr.ll
+++ /dev/null
@@ -1,49 +0,0 @@
-; RUN: llvm-as < %s -o - | llc
-
-; July 6, 2002 -- LLC Regression test
-; This test case checks if the integer CC register %xcc (or %ccr)
-; is correctly spilled. The code fragment came from function
-; MakeGraph in Olden-mst.
-; The original code made all comparisons with 0, so that the %xcc
-; register is not needed for the branch in the first basic block.
-; Replace 0 with 1 in the first comparson so that the
-; branch-on-register instruction cannot be used directly, i.e.,
-; the %xcc register is needed for the first branch.
-;
-
- %Graph = type %struct.graph_st*
- %Hash = type %struct.hash*
- %HashEntry = type %struct.hash_entry*
- %Vertex = type %struct.vert_st*
- %struct.graph_st = type { [1 x %Vertex] }
- %struct.hash = type { %HashEntry*, i32 (i32)*, i32 }
- %struct.hash_entry = type { i32, i8*, %HashEntry }
- %struct.vert_st = type { i32, %Vertex, %Hash }
-@HashRange = external global i32 ; <i32*> [#uses=0]
-@.LC0 = internal global [13 x i8] c"Make phase 2\00" ; <[13 x i8]*> [#uses=0]
-@.LC1 = internal global [13 x i8] c"Make phase 3\00" ; <[13 x i8]*> [#uses=0]
-@.LC2 = internal global [13 x i8] c"Make phase 4\00" ; <[13 x i8]*> [#uses=0]
-@.LC3 = internal global [15 x i8] c"Make returning\00" ; <[15 x i8]*> [#uses=0]
-
-define %Graph @MakeGraph(i32 %numvert, i32 %numproc) {
-bb1:
- %reg111 = add i32 %numproc, -1 ; <i32> [#uses=2]
- %cond275 = icmp slt i32 %reg111, 1 ; <i1> [#uses=1]
- %cond276 = icmp sle i32 %reg111, 0 ; <i1> [#uses=1]
- %cond277 = icmp sge i32 %numvert, 0 ; <i1> [#uses=1]
- %reg162 = add i32 %numvert, 3 ; <i32> [#uses=0]
- br i1 %cond275, label %bb7, label %bb4
-
-bb4: ; preds = %bb1
- br i1 %cond276, label %bb7, label %bb5
-
-bb5: ; preds = %bb4
- br i1 %cond277, label %bb7, label %bb6
-
-bb6: ; preds = %bb5
- ret %Graph null
-
-bb7: ; preds = %bb5, %bb4, %bb1
- ret %Graph null
-}
-
diff --git a/release_23/test/CodeGen/Generic/stacksave-restore.ll b/release_23/test/CodeGen/Generic/stacksave-restore.ll
deleted file mode 100644
index fd3dd67298ed..000000000000
--- a/release_23/test/CodeGen/Generic/stacksave-restore.ll
+++ /dev/null
@@ -1,14 +0,0 @@
-; RUN: llvm-as < %s | llc
-
-declare i8* @llvm.stacksave()
-
-declare void @llvm.stackrestore(i8*)
-
-define i32* @test(i32 %N) {
- %tmp = call i8* @llvm.stacksave( ) ; <i8*> [#uses=1]
- %P = alloca i32, i32 %N ; <i32*> [#uses=1]
- call void @llvm.stackrestore( i8* %tmp )
- %Q = alloca i32, i32 %N ; <i32*> [#uses=0]
- ret i32* %P
-}
-
diff --git a/release_23/test/CodeGen/Generic/storetrunc-fp.ll b/release_23/test/CodeGen/Generic/storetrunc-fp.ll
deleted file mode 100644
index 710a9907e018..000000000000
--- a/release_23/test/CodeGen/Generic/storetrunc-fp.ll
+++ /dev/null
@@ -1,8 +0,0 @@
-; RUN: llvm-as < %s | llc
-
-define void @foo(double %a, double %b, float* %fp) {
- %c = add double %a, %b
- %d = fptrunc double %c to float
- store float %d, float* %fp
- ret void
-}
diff --git a/release_23/test/CodeGen/Generic/switch-crit-edge-constant.ll b/release_23/test/CodeGen/Generic/switch-crit-edge-constant.ll
deleted file mode 100644
index d71fe56eb49d..000000000000
--- a/release_23/test/CodeGen/Generic/switch-crit-edge-constant.ll
+++ /dev/null
@@ -1,52 +0,0 @@
-; PR925
-; RUN: llvm-as < %s | llc -march=x86 | \
-; RUN: grep mov.*str1 | count 1
-
-target datalayout = "e-p:32:32"
-target triple = "i686-apple-darwin8.7.2"
-@str1 = internal constant [5 x i8] c"bonk\00" ; <[5 x i8]*> [#uses=1]
-@str2 = internal constant [5 x i8] c"bork\00" ; <[5 x i8]*> [#uses=1]
-@str = internal constant [8 x i8] c"perfwap\00" ; <[8 x i8]*> [#uses=1]
-
-define void @foo(i32 %C) {
-entry:
- switch i32 %C, label %bb2 [
- i32 1, label %blahaha
- i32 2, label %blahaha
- i32 3, label %blahaha
- i32 4, label %blahaha
- i32 5, label %blahaha
- i32 6, label %blahaha
- i32 7, label %blahaha
- i32 8, label %blahaha
- i32 9, label %blahaha
- i32 10, label %blahaha
- ]
-
-bb2: ; preds = %entry
- %tmp5 = and i32 %C, 123 ; <i32> [#uses=1]
- %tmp = icmp eq i32 %tmp5, 0 ; <i1> [#uses=1]
- br i1 %tmp, label %blahaha, label %cond_true
-
-cond_true: ; preds = %bb2
- br label %blahaha
-
-blahaha: ; preds = %cond_true, %bb2, %entry, %entry, %entry, %entry, %entry, %entry, %entry, %entry, %entry, %entry
- %s.0 = phi i8* [ getelementptr ([8 x i8]* @str, i32 0, i64 0), %cond_true ], [ getelementptr ([5 x i8]* @str1, i32 0, i64 0), %entry ], [ getelementptr ([5 x i8]* @str1, i32 0, i64 0), %entry ], [ getelementptr ([5 x i8]* @str1, i32 0, i64 0), %entry ], [ getelementptr ([5 x i8]* @str1, i32 0, i64 0), %entry ], [ getelementptr ([5 x i8]* @str1, i32 0, i64 0), %entry ], [ getelementptr ([5 x i8]* @str1, i32 0, i64 0), %entry ], [ getelementptr ([5 x i8]* @str1, i32 0, i64 0), %entry ], [ getelementptr ([5 x i8]* @str1, i32 0, i64 0), %entry ], [ getelementptr ([5 x i8]* @str1, i32 0, i64 0), %entry ], [ getelementptr ([5 x i8]* @str1, i32 0, i64 0), %entry ], [ getelementptr ([5 x i8]* @str2, i32 0, i64 0), %bb2 ] ; <i8*> [#uses=13]
- %tmp8 = tail call i32 (i8*, ...)* @printf( i8* %s.0 ) ; <i32> [#uses=0]
- %tmp10 = tail call i32 (i8*, ...)* @printf( i8* %s.0 ) ; <i32> [#uses=0]
- %tmp12 = tail call i32 (i8*, ...)* @printf( i8* %s.0 ) ; <i32> [#uses=0]
- %tmp14 = tail call i32 (i8*, ...)* @printf( i8* %s.0 ) ; <i32> [#uses=0]
- %tmp16 = tail call i32 (i8*, ...)* @printf( i8* %s.0 ) ; <i32> [#uses=0]
- %tmp18 = tail call i32 (i8*, ...)* @printf( i8* %s.0 ) ; <i32> [#uses=0]
- %tmp20 = tail call i32 (i8*, ...)* @printf( i8* %s.0 ) ; <i32> [#uses=0]
- %tmp22 = tail call i32 (i8*, ...)* @printf( i8* %s.0 ) ; <i32> [#uses=0]
- %tmp24 = tail call i32 (i8*, ...)* @printf( i8* %s.0 ) ; <i32> [#uses=0]
- %tmp26 = tail call i32 (i8*, ...)* @printf( i8* %s.0 ) ; <i32> [#uses=0]
- %tmp28 = tail call i32 (i8*, ...)* @printf( i8* %s.0 ) ; <i32> [#uses=0]
- %tmp30 = tail call i32 (i8*, ...)* @printf( i8* %s.0 ) ; <i32> [#uses=0]
- %tmp32 = tail call i32 (i8*, ...)* @printf( i8* %s.0 ) ; <i32> [#uses=0]
- ret void
-}
-
-declare i32 @printf(i8*, ...)
diff --git a/release_23/test/CodeGen/Generic/switch-lower-feature-2.ll b/release_23/test/CodeGen/Generic/switch-lower-feature-2.ll
deleted file mode 100644
index 5e532a8db3ed..000000000000
--- a/release_23/test/CodeGen/Generic/switch-lower-feature-2.ll
+++ /dev/null
@@ -1,50 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -o %t -f
-; RUN: grep jb %t | count 1
-; RUN: grep \\\$6 %t | count 2
-; RUN: grep 1024 %t | count 1
-; RUN: grep 1023 %t | count 1
-; RUN: grep 119 %t | count 1
-; RUN: grep JTI %t | count 2
-; RUN: grep jg %t | count 1
-; RUN: grep ja %t | count 1
-; RUN: grep js %t | count 1
-
-target triple = "i686-pc-linux-gnu"
-
-define i32 @main(i32 %tmp158) {
-entry:
- switch i32 %tmp158, label %bb336 [
- i32 -2147483648, label %bb338
- i32 -2147483647, label %bb338
- i32 -2147483646, label %bb338
- i32 120, label %bb338
- i32 121, label %bb339
- i32 122, label %bb340
- i32 123, label %bb341
- i32 124, label %bb342
- i32 125, label %bb343
- i32 126, label %bb336
- i32 1024, label %bb338
- i32 0, label %bb338
- i32 1, label %bb338
- i32 2, label %bb338
- i32 3, label %bb338
- i32 4, label %bb338
- i32 5, label %bb338
- ]
-bb336:
- ret i32 10
-bb338:
- ret i32 11
-bb339:
- ret i32 12
-bb340:
- ret i32 13
-bb341:
- ret i32 14
-bb342:
- ret i32 15
-bb343:
- ret i32 18
-
-}
diff --git a/release_23/test/CodeGen/Generic/switch-lower-feature.ll b/release_23/test/CodeGen/Generic/switch-lower-feature.ll
deleted file mode 100644
index 989693cf3f22..000000000000
--- a/release_23/test/CodeGen/Generic/switch-lower-feature.ll
+++ /dev/null
@@ -1,29 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -o - | grep \$7 | count 1
-; RUN: llvm-as < %s | llc -march=x86 -o - | grep \$6 | count 1
-; RUN: llvm-as < %s | llc -march=x86 -o - | grep 1024 | count 1
-; RUN: llvm-as < %s | llc -march=x86 -o - | grep jb | count 2
-; RUN: llvm-as < %s | llc -march=x86 -o - | grep je | count 1
-
-define i32 @main(i32 %tmp158) {
-entry:
- switch i32 %tmp158, label %bb336 [
- i32 120, label %bb338
- i32 121, label %bb338
- i32 122, label %bb338
- i32 123, label %bb338
- i32 124, label %bb338
- i32 125, label %bb338
- i32 126, label %bb338
- i32 1024, label %bb338
- i32 0, label %bb338
- i32 1, label %bb338
- i32 2, label %bb338
- i32 3, label %bb338
- i32 4, label %bb338
- i32 5, label %bb338
- ]
-bb336:
- ret i32 10
-bb338:
- ret i32 11
-}
diff --git a/release_23/test/CodeGen/Generic/switch-lower.ll b/release_23/test/CodeGen/Generic/switch-lower.ll
deleted file mode 100644
index b1aad3f45140..000000000000
--- a/release_23/test/CodeGen/Generic/switch-lower.ll
+++ /dev/null
@@ -1,334 +0,0 @@
-; RUN: llvm-as < %s | llc
-; PR1197
-
-
-define void @exp_attr__expand_n_attribute_reference() {
-entry:
- br i1 false, label %cond_next954, label %cond_true924
-
-cond_true924: ; preds = %entry
- ret void
-
-cond_next954: ; preds = %entry
- switch i8 0, label %cleanup7419 [
- i8 1, label %bb956
- i8 2, label %bb1069
- i8 4, label %bb7328
- i8 5, label %bb1267
- i8 8, label %bb1348
- i8 9, label %bb7328
- i8 11, label %bb1439
- i8 12, label %bb1484
- i8 13, label %bb1706
- i8 14, label %bb1783
- i8 17, label %bb1925
- i8 18, label %bb1929
- i8 19, label %bb2240
- i8 25, label %bb2447
- i8 27, label %bb2480
- i8 29, label %bb2590
- i8 30, label %bb2594
- i8 31, label %bb2621
- i8 32, label %bb2664
- i8 33, label %bb2697
- i8 34, label %bb2735
- i8 37, label %bb2786
- i8 38, label %bb2849
- i8 39, label %bb3269
- i8 41, label %bb3303
- i8 42, label %bb3346
- i8 43, label %bb3391
- i8 44, label %bb3395
- i8 50, label %bb3673
- i8 52, label %bb3677
- i8 53, label %bb3693
- i8 54, label %bb7328
- i8 56, label %bb3758
- i8 57, label %bb3787
- i8 64, label %bb5019
- i8 68, label %cond_true4235
- i8 69, label %bb4325
- i8 70, label %bb4526
- i8 72, label %bb4618
- i8 73, label %bb4991
- i8 80, label %bb5012
- i8 82, label %bb5019
- i8 84, label %bb5518
- i8 86, label %bb5752
- i8 87, label %bb5953
- i8 89, label %bb6040
- i8 90, label %bb6132
- i8 92, label %bb6186
- i8 93, label %bb6151
- i8 94, label %bb6155
- i8 97, label %bb6355
- i8 98, label %bb5019
- i8 99, label %bb6401
- i8 101, label %bb5019
- i8 102, label %bb1484
- i8 104, label %bb7064
- i8 105, label %bb7068
- i8 106, label %bb7072
- i8 108, label %bb1065
- i8 109, label %bb1702
- i8 110, label %bb2200
- i8 111, label %bb2731
- i8 112, label %bb2782
- i8 113, label %bb2845
- i8 114, label %bb2875
- i8 115, label %bb3669
- i8 116, label %bb7316
- i8 117, label %bb7316
- i8 118, label %bb3875
- i8 119, label %bb4359
- i8 120, label %bb4987
- i8 121, label %bb5008
- i8 122, label %bb5786
- i8 123, label %bb6147
- i8 124, label %bb6916
- i8 125, label %bb6920
- i8 126, label %bb6955
- i8 127, label %bb6990
- i8 -128, label %bb7027
- i8 -127, label %bb3879
- i8 -126, label %bb4700
- i8 -125, label %bb7076
- i8 -124, label %bb2366
- i8 -123, label %bb2366
- i8 -122, label %bb5490
- ]
-
-bb956: ; preds = %cond_next954
- ret void
-
-bb1065: ; preds = %cond_next954
- ret void
-
-bb1069: ; preds = %cond_next954
- ret void
-
-bb1267: ; preds = %cond_next954
- ret void
-
-bb1348: ; preds = %cond_next954
- ret void
-
-bb1439: ; preds = %cond_next954
- ret void
-
-bb1484: ; preds = %cond_next954, %cond_next954
- ret void
-
-bb1702: ; preds = %cond_next954
- ret void
-
-bb1706: ; preds = %cond_next954
- ret void
-
-bb1783: ; preds = %cond_next954
- ret void
-
-bb1925: ; preds = %cond_next954
- ret void
-
-bb1929: ; preds = %cond_next954
- ret void
-
-bb2200: ; preds = %cond_next954
- ret void
-
-bb2240: ; preds = %cond_next954
- ret void
-
-bb2366: ; preds = %cond_next954, %cond_next954
- ret void
-
-bb2447: ; preds = %cond_next954
- ret void
-
-bb2480: ; preds = %cond_next954
- ret void
-
-bb2590: ; preds = %cond_next954
- ret void
-
-bb2594: ; preds = %cond_next954
- ret void
-
-bb2621: ; preds = %cond_next954
- ret void
-
-bb2664: ; preds = %cond_next954
- ret void
-
-bb2697: ; preds = %cond_next954
- ret void
-
-bb2731: ; preds = %cond_next954
- ret void
-
-bb2735: ; preds = %cond_next954
- ret void
-
-bb2782: ; preds = %cond_next954
- ret void
-
-bb2786: ; preds = %cond_next954
- ret void
-
-bb2845: ; preds = %cond_next954
- ret void
-
-bb2849: ; preds = %cond_next954
- ret void
-
-bb2875: ; preds = %cond_next954
- ret void
-
-bb3269: ; preds = %cond_next954
- ret void
-
-bb3303: ; preds = %cond_next954
- ret void
-
-bb3346: ; preds = %cond_next954
- ret void
-
-bb3391: ; preds = %cond_next954
- ret void
-
-bb3395: ; preds = %cond_next954
- ret void
-
-bb3669: ; preds = %cond_next954
- ret void
-
-bb3673: ; preds = %cond_next954
- ret void
-
-bb3677: ; preds = %cond_next954
- ret void
-
-bb3693: ; preds = %cond_next954
- ret void
-
-bb3758: ; preds = %cond_next954
- ret void
-
-bb3787: ; preds = %cond_next954
- ret void
-
-bb3875: ; preds = %cond_next954
- ret void
-
-bb3879: ; preds = %cond_next954
- ret void
-
-cond_true4235: ; preds = %cond_next954
- ret void
-
-bb4325: ; preds = %cond_next954
- ret void
-
-bb4359: ; preds = %cond_next954
- ret void
-
-bb4526: ; preds = %cond_next954
- ret void
-
-bb4618: ; preds = %cond_next954
- ret void
-
-bb4700: ; preds = %cond_next954
- ret void
-
-bb4987: ; preds = %cond_next954
- ret void
-
-bb4991: ; preds = %cond_next954
- ret void
-
-bb5008: ; preds = %cond_next954
- ret void
-
-bb5012: ; preds = %cond_next954
- ret void
-
-bb5019: ; preds = %cond_next954, %cond_next954, %cond_next954, %cond_next954
- ret void
-
-bb5490: ; preds = %cond_next954
- ret void
-
-bb5518: ; preds = %cond_next954
- ret void
-
-bb5752: ; preds = %cond_next954
- ret void
-
-bb5786: ; preds = %cond_next954
- ret void
-
-bb5953: ; preds = %cond_next954
- ret void
-
-bb6040: ; preds = %cond_next954
- ret void
-
-bb6132: ; preds = %cond_next954
- ret void
-
-bb6147: ; preds = %cond_next954
- ret void
-
-bb6151: ; preds = %cond_next954
- ret void
-
-bb6155: ; preds = %cond_next954
- ret void
-
-bb6186: ; preds = %cond_next954
- ret void
-
-bb6355: ; preds = %cond_next954
- ret void
-
-bb6401: ; preds = %cond_next954
- ret void
-
-bb6916: ; preds = %cond_next954
- ret void
-
-bb6920: ; preds = %cond_next954
- ret void
-
-bb6955: ; preds = %cond_next954
- ret void
-
-bb6990: ; preds = %cond_next954
- ret void
-
-bb7027: ; preds = %cond_next954
- ret void
-
-bb7064: ; preds = %cond_next954
- ret void
-
-bb7068: ; preds = %cond_next954
- ret void
-
-bb7072: ; preds = %cond_next954
- ret void
-
-bb7076: ; preds = %cond_next954
- ret void
-
-bb7316: ; preds = %cond_next954, %cond_next954
- ret void
-
-bb7328: ; preds = %cond_next954, %cond_next954, %cond_next954
- ret void
-
-cleanup7419: ; preds = %cond_next954
- ret void
-}
diff --git a/release_23/test/CodeGen/Generic/trap.ll b/release_23/test/CodeGen/Generic/trap.ll
deleted file mode 100644
index 4dfc1a6450b9..000000000000
--- a/release_23/test/CodeGen/Generic/trap.ll
+++ /dev/null
@@ -1,9 +0,0 @@
-; RUN: llvm-as < %s | llc
-define i32 @test() noreturn nounwind {
-entry:
- tail call void @llvm.trap( )
- unreachable
-}
-
-declare void @llvm.trap() nounwind
-
diff --git a/release_23/test/CodeGen/Generic/v-split.ll b/release_23/test/CodeGen/Generic/v-split.ll
deleted file mode 100644
index a3124924638f..000000000000
--- a/release_23/test/CodeGen/Generic/v-split.ll
+++ /dev/null
@@ -1,11 +0,0 @@
-; RUN: llvm-as < %s | llc
-%f8 = type <8 x float>
-
-define void @test_f8(%f8 *%P, %f8* %Q, %f8 *%S) {
- %p = load %f8* %P
- %q = load %f8* %Q
- %R = add %f8 %p, %q
- store %f8 %R, %f8 *%S
- ret void
-}
-
diff --git a/release_23/test/CodeGen/Generic/vector-constantexpr.ll b/release_23/test/CodeGen/Generic/vector-constantexpr.ll
deleted file mode 100644
index 441c4a0e71dc..000000000000
--- a/release_23/test/CodeGen/Generic/vector-constantexpr.ll
+++ /dev/null
@@ -1,7 +0,0 @@
-; RUN: llvm-as < %s | llc
-
-define void @""(float* %inregs, float* %outregs) {
- %a_addr.i = alloca <4 x float> ; <<4 x float>*> [#uses=1]
- store <4 x float> < float undef, float undef, float undef, float undef >, <4 x float>* %a_addr.i
- ret void
-}
diff --git a/release_23/test/CodeGen/Generic/vector-identity-shuffle.ll b/release_23/test/CodeGen/Generic/vector-identity-shuffle.ll
deleted file mode 100644
index 61b44af118b9..000000000000
--- a/release_23/test/CodeGen/Generic/vector-identity-shuffle.ll
+++ /dev/null
@@ -1,17 +0,0 @@
-; RUN: llvm-as < %s | llc
-
-
-define void @test(<4 x float>* %tmp2.i) {
- %tmp2.i.upgrd.1 = load <4 x float>* %tmp2.i ; <<4 x float>> [#uses=4]
- %xFloat0.48 = extractelement <4 x float> %tmp2.i.upgrd.1, i32 0 ; <float> [#uses=1]
- %inFloat0.49 = insertelement <4 x float> undef, float %xFloat0.48, i32 0 ; <<4 x float>> [#uses=1]
- %xFloat1.50 = extractelement <4 x float> %tmp2.i.upgrd.1, i32 1 ; <float> [#uses=1]
- %inFloat1.52 = insertelement <4 x float> %inFloat0.49, float %xFloat1.50, i32 1 ; <<4 x float>> [#uses=1]
- %xFloat2.53 = extractelement <4 x float> %tmp2.i.upgrd.1, i32 2 ; <float> [#uses=1]
- %inFloat2.55 = insertelement <4 x float> %inFloat1.52, float %xFloat2.53, i32 2 ; <<4 x float>> [#uses=1]
- %xFloat3.56 = extractelement <4 x float> %tmp2.i.upgrd.1, i32 3 ; <float> [#uses=1]
- %inFloat3.58 = insertelement <4 x float> %inFloat2.55, float %xFloat3.56, i32 3 ; <<4 x float>> [#uses=1]
- store <4 x float> %inFloat3.58, <4 x float>* %tmp2.i
- ret void
-}
-
diff --git a/release_23/test/CodeGen/Generic/vector.ll b/release_23/test/CodeGen/Generic/vector.ll
deleted file mode 100644
index 910575750e3e..000000000000
--- a/release_23/test/CodeGen/Generic/vector.ll
+++ /dev/null
@@ -1,154 +0,0 @@
-; Test that vectors are scalarized/lowered correctly.
-; RUN: llvm-as < %s | llc
-
-
-%d8 = type <8 x double>
-%f1 = type <1 x float>
-%f2 = type <2 x float>
-%f4 = type <4 x float>
-%f8 = type <8 x float>
-%i4 = type <4 x i32>
-
-;;; TEST HANDLING OF VARIOUS VECTOR SIZES
-
-define void @test_f1(%f1* %P, %f1* %Q, %f1* %S) {
- %p = load %f1* %P ; <%f1> [#uses=1]
- %q = load %f1* %Q ; <%f1> [#uses=1]
- %R = add %f1 %p, %q ; <%f1> [#uses=1]
- store %f1 %R, %f1* %S
- ret void
-}
-
-define void @test_f2(%f2* %P, %f2* %Q, %f2* %S) {
- %p = load %f2* %P ; <%f2> [#uses=1]
- %q = load %f2* %Q ; <%f2> [#uses=1]
- %R = add %f2 %p, %q ; <%f2> [#uses=1]
- store %f2 %R, %f2* %S
- ret void
-}
-
-define void @test_f4(%f4* %P, %f4* %Q, %f4* %S) {
- %p = load %f4* %P ; <%f4> [#uses=1]
- %q = load %f4* %Q ; <%f4> [#uses=1]
- %R = add %f4 %p, %q ; <%f4> [#uses=1]
- store %f4 %R, %f4* %S
- ret void
-}
-
-define void @test_f8(%f8* %P, %f8* %Q, %f8* %S) {
- %p = load %f8* %P ; <%f8> [#uses=1]
- %q = load %f8* %Q ; <%f8> [#uses=1]
- %R = add %f8 %p, %q ; <%f8> [#uses=1]
- store %f8 %R, %f8* %S
- ret void
-}
-
-define void @test_fmul(%f8* %P, %f8* %Q, %f8* %S) {
- %p = load %f8* %P ; <%f8> [#uses=1]
- %q = load %f8* %Q ; <%f8> [#uses=1]
- %R = mul %f8 %p, %q ; <%f8> [#uses=1]
- store %f8 %R, %f8* %S
- ret void
-}
-
-define void @test_div(%f8* %P, %f8* %Q, %f8* %S) {
- %p = load %f8* %P ; <%f8> [#uses=1]
- %q = load %f8* %Q ; <%f8> [#uses=1]
- %R = fdiv %f8 %p, %q ; <%f8> [#uses=1]
- store %f8 %R, %f8* %S
- ret void
-}
-
-;;; TEST VECTOR CONSTRUCTS
-
-
-define void @test_cst(%f4* %P, %f4* %S) {
- %p = load %f4* %P ; <%f4> [#uses=1]
- %R = add %f4 %p, < float 0x3FB99999A0000000, float 1.000000e+00, float 2.000000e+00, float 4.500000e+00 > ; <%f4> [#uses=1]
- store %f4 %R, %f4* %S
- ret void
-}
-
-define void @test_zero(%f4* %P, %f4* %S) {
- %p = load %f4* %P ; <%f4> [#uses=1]
- %R = add %f4 %p, zeroinitializer ; <%f4> [#uses=1]
- store %f4 %R, %f4* %S
- ret void
-}
-
-define void @test_undef(%f4* %P, %f4* %S) {
- %p = load %f4* %P ; <%f4> [#uses=1]
- %R = add %f4 %p, undef ; <%f4> [#uses=1]
- store %f4 %R, %f4* %S
- ret void
-}
-
-define void @test_constant_insert(%f4* %S) {
- %R = insertelement %f4 zeroinitializer, float 1.000000e+01, i32 0 ; <%f4> [#uses=1]
- store %f4 %R, %f4* %S
- ret void
-}
-
-define void @test_variable_buildvector(float %F, %f4* %S) {
- %R = insertelement %f4 zeroinitializer, float %F, i32 0 ; <%f4> [#uses=1]
- store %f4 %R, %f4* %S
- ret void
-}
-
-define void @test_scalar_to_vector(float %F, %f4* %S) {
- %R = insertelement %f4 undef, float %F, i32 0 ; <%f4> [#uses=1]
- store %f4 %R, %f4* %S
- ret void
-}
-
-define float @test_extract_elt(%f8* %P) {
- %p = load %f8* %P ; <%f8> [#uses=1]
- %R = extractelement %f8 %p, i32 3 ; <float> [#uses=1]
- ret float %R
-}
-
-define double @test_extract_elt2(%d8* %P) {
- %p = load %d8* %P ; <%d8> [#uses=1]
- %R = extractelement %d8 %p, i32 3 ; <double> [#uses=1]
- ret double %R
-}
-
-define void @test_cast_1(%f4* %b, %i4* %a) {
- %tmp = load %f4* %b ; <%f4> [#uses=1]
- %tmp2 = add %f4 %tmp, < float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00 > ; <%f4> [#uses=1]
- %tmp3 = bitcast %f4 %tmp2 to %i4 ; <%i4> [#uses=1]
- %tmp4 = add %i4 %tmp3, < i32 1, i32 2, i32 3, i32 4 > ; <%i4> [#uses=1]
- store %i4 %tmp4, %i4* %a
- ret void
-}
-
-define void @test_cast_2(%f8* %a, <8 x i32>* %b) {
- %T = load %f8* %a ; <%f8> [#uses=1]
- %T2 = bitcast %f8 %T to <8 x i32> ; <<8 x i32>> [#uses=1]
- store <8 x i32> %T2, <8 x i32>* %b
- ret void
-}
-
-;;; TEST IMPORTANT IDIOMS
-
-define void @splat(%f4* %P, %f4* %Q, float %X) {
- %tmp = insertelement %f4 undef, float %X, i32 0 ; <%f4> [#uses=1]
- %tmp2 = insertelement %f4 %tmp, float %X, i32 1 ; <%f4> [#uses=1]
- %tmp4 = insertelement %f4 %tmp2, float %X, i32 2 ; <%f4> [#uses=1]
- %tmp6 = insertelement %f4 %tmp4, float %X, i32 3 ; <%f4> [#uses=1]
- %q = load %f4* %Q ; <%f4> [#uses=1]
- %R = add %f4 %q, %tmp6 ; <%f4> [#uses=1]
- store %f4 %R, %f4* %P
- ret void
-}
-
-define void @splat_i4(%i4* %P, %i4* %Q, i32 %X) {
- %tmp = insertelement %i4 undef, i32 %X, i32 0 ; <%i4> [#uses=1]
- %tmp2 = insertelement %i4 %tmp, i32 %X, i32 1 ; <%i4> [#uses=1]
- %tmp4 = insertelement %i4 %tmp2, i32 %X, i32 2 ; <%i4> [#uses=1]
- %tmp6 = insertelement %i4 %tmp4, i32 %X, i32 3 ; <%i4> [#uses=1]
- %q = load %i4* %Q ; <%i4> [#uses=1]
- %R = add %i4 %q, %tmp6 ; <%i4> [#uses=1]
- store %i4 %R, %i4* %P
- ret void
-}
diff --git a/release_23/test/CodeGen/IA64/2005-08-22-LegalizerCrash.ll b/release_23/test/CodeGen/IA64/2005-08-22-LegalizerCrash.ll
deleted file mode 100644
index 05512901b6a5..000000000000
--- a/release_23/test/CodeGen/IA64/2005-08-22-LegalizerCrash.ll
+++ /dev/null
@@ -1,10 +0,0 @@
-; RUN: llvm-as < %s | llc -march=ia64
-
-@_ZN9__gnu_cxx16__stl_prime_listE = external global [28 x i32] ; <[28 x i32]*> [#uses=3]
-
-define fastcc i32* @_ZSt11lower_boundIPKmmET_S2_S2_RKT0_(i32 %__val.val) {
-entry:
- %retval = select i1 icmp slt (i32 ashr (i32 sub (i32 ptrtoint (i32* getelementptr ([28 x i32]* @_ZN9__gnu_cxx16__stl_prime_listE, i32 0, i32 28) to i32), i32 ptrtoint ([28 x i32]* @_ZN9__gnu_cxx16__stl_prime_listE to i32)), i32 2), i32 0), i32* null, i32* getelementptr ([28 x i32]* @_ZN9__gnu_cxx16__stl_prime_listE, i32 0, i32 0) ; <i32*> [#uses=1]
- ret i32* %retval
-}
-
diff --git a/release_23/test/CodeGen/IA64/2005-10-29-shladd.ll b/release_23/test/CodeGen/IA64/2005-10-29-shladd.ll
deleted file mode 100644
index 01ef68cc282b..000000000000
--- a/release_23/test/CodeGen/IA64/2005-10-29-shladd.ll
+++ /dev/null
@@ -1,9 +0,0 @@
-; this should turn into shladd
-; RUN: llvm-as < %s | llc -march=ia64 | grep shladd
-
-define i64 @bogglesmoggle(i64 %X, i64 %Y) {
- %A = shl i64 %X, 3 ; <i64> [#uses=1]
- %B = add i64 %A, %Y ; <i64> [#uses=1]
- ret i64 %B
-}
-
diff --git a/release_23/test/CodeGen/IA64/dg.exp b/release_23/test/CodeGen/IA64/dg.exp
deleted file mode 100644
index 32e44b4aec51..000000000000
--- a/release_23/test/CodeGen/IA64/dg.exp
+++ /dev/null
@@ -1,5 +0,0 @@
-load_lib llvm.exp
-
-if { [llvm_supports_target IA64] } {
- RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
-}
diff --git a/release_23/test/CodeGen/IA64/ret-0.ll b/release_23/test/CodeGen/IA64/ret-0.ll
deleted file mode 100644
index fa2aac3ebf61..000000000000
--- a/release_23/test/CodeGen/IA64/ret-0.ll
+++ /dev/null
@@ -1,5 +0,0 @@
-; RUN: llvm-as < %s | llc -march=ia64
-
-define double @test() {
- ret double 0.0
-}
diff --git a/release_23/test/CodeGen/PowerPC/2004-11-29-ShrCrash.ll b/release_23/test/CodeGen/PowerPC/2004-11-29-ShrCrash.ll
deleted file mode 100644
index 70f294a78d86..000000000000
--- a/release_23/test/CodeGen/PowerPC/2004-11-29-ShrCrash.ll
+++ /dev/null
@@ -1,6 +0,0 @@
-; RUN: llvm-as < %s | llc -march=ppc32
-define void @test() {
- %tr1 = lshr i32 1, 0 ; <i32> [#uses=0]
- ret void
-}
-
diff --git a/release_23/test/CodeGen/PowerPC/2004-11-30-shift-crash.ll b/release_23/test/CodeGen/PowerPC/2004-11-30-shift-crash.ll
deleted file mode 100644
index 93a91234b707..000000000000
--- a/release_23/test/CodeGen/PowerPC/2004-11-30-shift-crash.ll
+++ /dev/null
@@ -1,7 +0,0 @@
-; RUN: llvm-as < %s | llc -march=ppc32
-
-define void @main() {
- %tr4 = shl i64 1, 0 ; <i64> [#uses=0]
- ret void
-}
-
diff --git a/release_23/test/CodeGen/PowerPC/2004-11-30-shr-var-crash.ll b/release_23/test/CodeGen/PowerPC/2004-11-30-shr-var-crash.ll
deleted file mode 100644
index 1a1aca4b5d11..000000000000
--- a/release_23/test/CodeGen/PowerPC/2004-11-30-shr-var-crash.ll
+++ /dev/null
@@ -1,9 +0,0 @@
-; RUN: llvm-as < %s | llc -march=ppc32
-
-define void @main() {
- %shamt = add i8 0, 1 ; <i8> [#uses=1]
- %shift.upgrd.1 = zext i8 %shamt to i64 ; <i64> [#uses=1]
- %tr2 = ashr i64 1, %shift.upgrd.1 ; <i64> [#uses=0]
- ret void
-}
-
diff --git a/release_23/test/CodeGen/PowerPC/2004-12-12-ZeroSizeCommon.ll b/release_23/test/CodeGen/PowerPC/2004-12-12-ZeroSizeCommon.ll
deleted file mode 100644
index 3e490b1dc7a2..000000000000
--- a/release_23/test/CodeGen/PowerPC/2004-12-12-ZeroSizeCommon.ll
+++ /dev/null
@@ -1,4 +0,0 @@
-; RUN: llvm-as < %s | llc -march=ppc32 | not grep .comm.*X,0
-
-@X = linkonce global { } zeroinitializer ; <{ }*> [#uses=0]
-
diff --git a/release_23/test/CodeGen/PowerPC/2005-01-14-SetSelectCrash.ll b/release_23/test/CodeGen/PowerPC/2005-01-14-SetSelectCrash.ll
deleted file mode 100644
index f84caaf1d499..000000000000
--- a/release_23/test/CodeGen/PowerPC/2005-01-14-SetSelectCrash.ll
+++ /dev/null
@@ -1,8 +0,0 @@
-; RUN: llvm-as < %s | llc -march=ppc32
-
-define i32 @main() {
- %setle = icmp sle i64 1, 0 ; <i1> [#uses=1]
- %select = select i1 true, i1 %setle, i1 true ; <i1> [#uses=0]
- ret i32 0
-}
-
diff --git a/release_23/test/CodeGen/PowerPC/2005-01-14-UndefLong.ll b/release_23/test/CodeGen/PowerPC/2005-01-14-UndefLong.ll
deleted file mode 100644
index 7b3e9b4f092f..000000000000
--- a/release_23/test/CodeGen/PowerPC/2005-01-14-UndefLong.ll
+++ /dev/null
@@ -1,5 +0,0 @@
-; RUN: llvm-as < %s | llc -march=ppc32
-
-define i64 @test() {
- ret i64 undef
-}
diff --git a/release_23/test/CodeGen/PowerPC/2005-08-12-rlwimi-crash.ll b/release_23/test/CodeGen/PowerPC/2005-08-12-rlwimi-crash.ll
deleted file mode 100644
index 8e8fee2888fb..000000000000
--- a/release_23/test/CodeGen/PowerPC/2005-08-12-rlwimi-crash.ll
+++ /dev/null
@@ -1,13 +0,0 @@
-; this should not crash the ppc backend
-
-; RUN: llvm-as < %s | llc -march=ppc32
-
-
-define i32 @test(i32 %j.0.0.i) {
- %tmp.85.i = and i32 %j.0.0.i, 7 ; <i32> [#uses=1]
- %tmp.161278.i = bitcast i32 %tmp.85.i to i32 ; <i32> [#uses=1]
- %tmp.5.i77.i = lshr i32 %tmp.161278.i, 3 ; <i32> [#uses=1]
- ret i32 %tmp.5.i77.i
-}
-
-
diff --git a/release_23/test/CodeGen/PowerPC/2005-09-02-LegalizeDuplicatesCalls.ll b/release_23/test/CodeGen/PowerPC/2005-09-02-LegalizeDuplicatesCalls.ll
deleted file mode 100644
index 428dd0c3e3fd..000000000000
--- a/release_23/test/CodeGen/PowerPC/2005-09-02-LegalizeDuplicatesCalls.ll
+++ /dev/null
@@ -1,11 +0,0 @@
-; This function should have exactly one call to fixdfdi, no more!
-
-; RUN: llvm-as < %s | llc -march=ppc32 -mattr=-64bit | \
-; RUN: grep {bl .*fixdfdi} | count 1
-
-define double @test2(double %tmp.7705) {
- %mem_tmp.2.0.in = fptosi double %tmp.7705 to i64 ; <i64> [#uses=1]
- %mem_tmp.2.0 = sitofp i64 %mem_tmp.2.0.in to double ; <double> [#uses=1]
- ret double %mem_tmp.2.0
-}
-
diff --git a/release_23/test/CodeGen/PowerPC/2005-10-08-ArithmeticRotate.ll b/release_23/test/CodeGen/PowerPC/2005-10-08-ArithmeticRotate.ll
deleted file mode 100644
index 54f24c612660..000000000000
--- a/release_23/test/CodeGen/PowerPC/2005-10-08-ArithmeticRotate.ll
+++ /dev/null
@@ -1,11 +0,0 @@
-; This was erroneously being turned into an rlwinm instruction.
-; The sign bit does matter in this case.
-
-; RUN: llvm-as < %s | llc -march=ppc32 | grep srawi
-
-define i32 @test(i32 %X) {
- %Y = and i32 %X, -2 ; <i32> [#uses=1]
- %Z = ashr i32 %Y, 11 ; <i32> [#uses=1]
- ret i32 %Z
-}
-
diff --git a/release_23/test/CodeGen/PowerPC/2005-11-30-vastart-crash.ll b/release_23/test/CodeGen/PowerPC/2005-11-30-vastart-crash.ll
deleted file mode 100644
index d56cffcf4ab1..000000000000
--- a/release_23/test/CodeGen/PowerPC/2005-11-30-vastart-crash.ll
+++ /dev/null
@@ -1,18 +0,0 @@
-; RUN: llvm-as < %s | llc
-
-target datalayout = "E-p:32:32"
-target triple = "powerpc-apple-darwin8.2.0"
-
-define void @bar(i32 %G, i32 %E, i32 %F, i32 %A, i32 %B, i32 %C, i32 %D, i8* %fmt, ...) {
- %ap = alloca i8* ; <i8**> [#uses=2]
- %va.upgrd.1 = bitcast i8** %ap to i8* ; <i8*> [#uses=1]
- call void @llvm.va_start( i8* %va.upgrd.1 )
- %tmp.1 = load i8** %ap ; <i8*> [#uses=1]
- %tmp.0 = call double @foo( i8* %tmp.1 ) ; <double> [#uses=0]
- ret void
-}
-
-declare void @llvm.va_start(i8*)
-
-declare double @foo(i8*)
-
diff --git a/release_23/test/CodeGen/PowerPC/2006-01-11-darwin-fp-argument.ll b/release_23/test/CodeGen/PowerPC/2006-01-11-darwin-fp-argument.ll
deleted file mode 100644
index e2f06f5e69ae..000000000000
--- a/release_23/test/CodeGen/PowerPC/2006-01-11-darwin-fp-argument.ll
+++ /dev/null
@@ -1,10 +0,0 @@
-; RUN: llvm-as < %s | llc | not grep {, f1}
-
-target datalayout = "E-p:32:32"
-target triple = "powerpc-apple-darwin8.2.0"
-
-; Dead argument should reserve an FP register.
-define double @bar(double %DEAD, double %X, double %Y) {
- %tmp.2 = add double %X, %Y ; <double> [#uses=1]
- ret double %tmp.2
-}
diff --git a/release_23/test/CodeGen/PowerPC/2006-01-20-ShiftPartsCrash.ll b/release_23/test/CodeGen/PowerPC/2006-01-20-ShiftPartsCrash.ll
deleted file mode 100644
index 86ad71861773..000000000000
--- a/release_23/test/CodeGen/PowerPC/2006-01-20-ShiftPartsCrash.ll
+++ /dev/null
@@ -1,19 +0,0 @@
-; RUN: llvm-as < %s | llc
-
-define void @iterative_hash_host_wide_int() {
- %zero = alloca i32 ; <i32*> [#uses=2]
- %b = alloca i32 ; <i32*> [#uses=1]
- store i32 0, i32* %zero
- %tmp = load i32* %zero ; <i32> [#uses=1]
- %tmp5 = bitcast i32 %tmp to i32 ; <i32> [#uses=1]
- %tmp6.u = add i32 %tmp5, 32 ; <i32> [#uses=1]
- %tmp6 = bitcast i32 %tmp6.u to i32 ; <i32> [#uses=1]
- %tmp7 = load i64* null ; <i64> [#uses=1]
- %tmp6.upgrd.1 = trunc i32 %tmp6 to i8 ; <i8> [#uses=1]
- %shift.upgrd.2 = zext i8 %tmp6.upgrd.1 to i64 ; <i64> [#uses=1]
- %tmp8 = ashr i64 %tmp7, %shift.upgrd.2 ; <i64> [#uses=1]
- %tmp8.upgrd.3 = trunc i64 %tmp8 to i32 ; <i32> [#uses=1]
- store i32 %tmp8.upgrd.3, i32* %b
- unreachable
-}
-
diff --git a/release_23/test/CodeGen/PowerPC/2006-04-01-FloatDoubleExtend.ll b/release_23/test/CodeGen/PowerPC/2006-04-01-FloatDoubleExtend.ll
deleted file mode 100644
index 8500260fafce..000000000000
--- a/release_23/test/CodeGen/PowerPC/2006-04-01-FloatDoubleExtend.ll
+++ /dev/null
@@ -1,9 +0,0 @@
-; RUN: llvm-as < %s | llc -march=ppc32
-
-
-define double @CalcSpeed(float %tmp127) {
- %tmp145 = fpext float %tmp127 to double ; <double> [#uses=1]
- %tmp150 = call double asm "frsqrte $0,$1", "=f,f"( double %tmp145 ) ; <double> [#uses=1]
- ret double %tmp150
-}
-
diff --git a/release_23/test/CodeGen/PowerPC/2006-04-05-splat-ish.ll b/release_23/test/CodeGen/PowerPC/2006-04-05-splat-ish.ll
deleted file mode 100644
index a536fa162c03..000000000000
--- a/release_23/test/CodeGen/PowerPC/2006-04-05-splat-ish.ll
+++ /dev/null
@@ -1,11 +0,0 @@
-; RUN: llvm-as < %s | \
-; RUN: llc -march=ppc32 -mtriple=powerpc-apple-darwin8 -mcpu=g5 | \
-; RUN: grep {vspltish v.*, 10}
-
-define void @test(<8 x i16>* %P) {
- %tmp = load <8 x i16>* %P ; <<8 x i16>> [#uses=1]
- %tmp1 = add <8 x i16> %tmp, < i16 10, i16 10, i16 10, i16 10, i16 10, i16 10, i16 10, i16 10 > ; <<8 x i16>> [#uses=1]
- store <8 x i16> %tmp1, <8 x i16>* %P
- ret void
-}
-
diff --git a/release_23/test/CodeGen/PowerPC/2006-04-19-vmaddfp-crash.ll b/release_23/test/CodeGen/PowerPC/2006-04-19-vmaddfp-crash.ll
deleted file mode 100644
index b79cce2ead00..000000000000
--- a/release_23/test/CodeGen/PowerPC/2006-04-19-vmaddfp-crash.ll
+++ /dev/null
@@ -1,58 +0,0 @@
-; RUN: llvm-as < %s | llc -march=ppc32 -mcpu=g5
-; END.
-
-define void @test(i8* %stack) {
-entry:
- %tmp9 = icmp eq i32 0, 0 ; <i1> [#uses=1]
- %tmp30 = icmp eq i32 0, 0 ; <i1> [#uses=1]
- br i1 %tmp30, label %cond_next54, label %cond_true31
-cond_true860: ; preds = %bb855
- %tmp879 = tail call <4 x float> @llvm.ppc.altivec.vmaddfp( <4 x float> zeroinitializer, <4 x float> zeroinitializer, <4 x float> zeroinitializer ) ; <<4 x float>> [#uses=1]
- %tmp880 = bitcast <4 x float> %tmp879 to <4 x i32> ; <<4 x i32>> [#uses=2]
- %tmp883 = shufflevector <4 x i32> %tmp880, <4 x i32> undef, <4 x i32> < i32 1, i32 1, i32 1, i32 1 > ; <<4 x i32>> [#uses=1]
- %tmp883.upgrd.1 = bitcast <4 x i32> %tmp883 to <4 x float> ; <<4 x float>> [#uses=1]
- %tmp885 = shufflevector <4 x i32> %tmp880, <4 x i32> undef, <4 x i32> < i32 2, i32 2, i32 2, i32 2 > ; <<4 x i32>> [#uses=1]
- %tmp885.upgrd.2 = bitcast <4 x i32> %tmp885 to <4 x float> ; <<4 x float>> [#uses=1]
- br label %cond_next905
-cond_true31: ; preds = %entry
- ret void
-cond_next54: ; preds = %entry
- br i1 %tmp9, label %cond_false385, label %bb279
-bb279: ; preds = %cond_next54
- ret void
-cond_false385: ; preds = %cond_next54
- %tmp388 = icmp eq i32 0, 0 ; <i1> [#uses=1]
- br i1 %tmp388, label %cond_next463, label %cond_true389
-cond_true389: ; preds = %cond_false385
- ret void
-cond_next463: ; preds = %cond_false385
- %tmp1208107 = icmp ugt i8* null, %stack ; <i1> [#uses=1]
- br i1 %tmp1208107, label %cond_true1209.preheader, label %bb1212
-cond_true498: ; preds = %cond_true1209.preheader
- ret void
-cond_true519: ; preds = %cond_true1209.preheader
- %bothcond = or i1 false, false ; <i1> [#uses=1]
- br i1 %bothcond, label %bb855, label %bb980
-cond_false548: ; preds = %cond_true1209.preheader
- ret void
-bb855: ; preds = %cond_true519
- %tmp859 = icmp eq i32 0, 0 ; <i1> [#uses=1]
- br i1 %tmp859, label %cond_true860, label %cond_next905
-cond_next905: ; preds = %bb855, %cond_true860
- %vfpw2.4 = phi <4 x float> [ %tmp885.upgrd.2, %cond_true860 ], [ undef, %bb855 ] ; <<4 x float>> [#uses=0]
- %vfpw1.4 = phi <4 x float> [ %tmp883.upgrd.1, %cond_true860 ], [ undef, %bb855 ] ; <<4 x float>> [#uses=0]
- %tmp930 = bitcast <4 x float> zeroinitializer to <4 x i32> ; <<4 x i32>> [#uses=0]
- ret void
-bb980: ; preds = %cond_true519
- ret void
-cond_true1209.preheader: ; preds = %cond_next463
- %tmp496 = and i32 0, 12288 ; <i32> [#uses=1]
- switch i32 %tmp496, label %cond_false548 [
- i32 0, label %cond_true498
- i32 4096, label %cond_true519
- ]
-bb1212: ; preds = %cond_next463
- ret void
-}
-
-declare <4 x float> @llvm.ppc.altivec.vmaddfp(<4 x float>, <4 x float>, <4 x float>)
diff --git a/release_23/test/CodeGen/PowerPC/2006-05-12-rlwimi-crash.ll b/release_23/test/CodeGen/PowerPC/2006-05-12-rlwimi-crash.ll
deleted file mode 100644
index e1033c3f808a..000000000000
--- a/release_23/test/CodeGen/PowerPC/2006-05-12-rlwimi-crash.ll
+++ /dev/null
@@ -1,55 +0,0 @@
-; RUN: llvm-as < %s | llc -march=ppc32
-; END.
-
- %struct.attr_desc = type { i8*, %struct.attr_desc*, %struct.attr_value*, %struct.attr_value*, i32 }
- %struct.attr_value = type { %struct.rtx_def*, %struct.attr_value*, %struct.insn_ent*, i32, i32 }
- %struct.insn_def = type { %struct.insn_def*, %struct.rtx_def*, i32, i32, i32, i32, i32 }
- %struct.insn_ent = type { %struct.insn_ent*, %struct.insn_def* }
- %struct.rtx_def = type { i16, i8, i8, %struct.u }
- %struct.u = type { [1 x i64] }
-
-define void @find_attr() {
-entry:
- %tmp26 = icmp eq %struct.attr_desc* null, null ; <i1> [#uses=1]
- br i1 %tmp26, label %bb30, label %cond_true27
-cond_true27: ; preds = %entry
- ret void
-bb30: ; preds = %entry
- %tmp67 = icmp eq %struct.attr_desc* null, null ; <i1> [#uses=1]
- br i1 %tmp67, label %cond_next92, label %cond_true68
-cond_true68: ; preds = %bb30
- ret void
-cond_next92: ; preds = %bb30
- %tmp173 = getelementptr %struct.attr_desc* null, i32 0, i32 4 ; <i32*> [#uses=2]
- %tmp174 = load i32* %tmp173 ; <i32> [#uses=1]
- %tmp177 = and i32 %tmp174, -9 ; <i32> [#uses=1]
- store i32 %tmp177, i32* %tmp173
- %tmp180 = getelementptr %struct.attr_desc* null, i32 0, i32 4 ; <i32*> [#uses=1]
- %tmp181 = load i32* %tmp180 ; <i32> [#uses=1]
- %tmp185 = getelementptr %struct.attr_desc* null, i32 0, i32 4 ; <i32*> [#uses=2]
- %tmp186 = load i32* %tmp185 ; <i32> [#uses=1]
- %tmp183187 = shl i32 %tmp181, 1 ; <i32> [#uses=1]
- %tmp188 = and i32 %tmp183187, 16 ; <i32> [#uses=1]
- %tmp190 = and i32 %tmp186, -17 ; <i32> [#uses=1]
- %tmp191 = or i32 %tmp190, %tmp188 ; <i32> [#uses=1]
- store i32 %tmp191, i32* %tmp185
- %tmp193 = getelementptr %struct.attr_desc* null, i32 0, i32 4 ; <i32*> [#uses=1]
- %tmp194 = load i32* %tmp193 ; <i32> [#uses=1]
- %tmp198 = getelementptr %struct.attr_desc* null, i32 0, i32 4 ; <i32*> [#uses=2]
- %tmp199 = load i32* %tmp198 ; <i32> [#uses=1]
- %tmp196200 = shl i32 %tmp194, 2 ; <i32> [#uses=1]
- %tmp201 = and i32 %tmp196200, 64 ; <i32> [#uses=1]
- %tmp203 = and i32 %tmp199, -65 ; <i32> [#uses=1]
- %tmp204 = or i32 %tmp203, %tmp201 ; <i32> [#uses=1]
- store i32 %tmp204, i32* %tmp198
- %tmp206 = getelementptr %struct.attr_desc* null, i32 0, i32 4 ; <i32*> [#uses=1]
- %tmp207 = load i32* %tmp206 ; <i32> [#uses=1]
- %tmp211 = getelementptr %struct.attr_desc* null, i32 0, i32 4 ; <i32*> [#uses=2]
- %tmp212 = load i32* %tmp211 ; <i32> [#uses=1]
- %tmp209213 = shl i32 %tmp207, 1 ; <i32> [#uses=1]
- %tmp214 = and i32 %tmp209213, 128 ; <i32> [#uses=1]
- %tmp216 = and i32 %tmp212, -129 ; <i32> [#uses=1]
- %tmp217 = or i32 %tmp216, %tmp214 ; <i32> [#uses=1]
- store i32 %tmp217, i32* %tmp211
- ret void
-}
diff --git a/release_23/test/CodeGen/PowerPC/2006-07-07-ComputeMaskedBits.ll b/release_23/test/CodeGen/PowerPC/2006-07-07-ComputeMaskedBits.ll
deleted file mode 100644
index 33807ca012b5..000000000000
--- a/release_23/test/CodeGen/PowerPC/2006-07-07-ComputeMaskedBits.ll
+++ /dev/null
@@ -1,17 +0,0 @@
-; RUN: llvm-as < %s | llc -mtriple=powerpc64-apple-darwin | grep extsw | count 2
-
-@lens = external global i8* ; <i8**> [#uses=1]
-@vals = external global i32* ; <i32**> [#uses=1]
-
-define i32 @test(i32 %i) {
- %tmp = load i8** @lens ; <i8*> [#uses=1]
- %tmp1 = getelementptr i8* %tmp, i32 %i ; <i8*> [#uses=1]
- %tmp.upgrd.1 = load i8* %tmp1 ; <i8> [#uses=1]
- %tmp2 = zext i8 %tmp.upgrd.1 to i32 ; <i32> [#uses=1]
- %tmp3 = load i32** @vals ; <i32*> [#uses=1]
- %tmp5 = sub i32 1, %tmp2 ; <i32> [#uses=1]
- %tmp6 = getelementptr i32* %tmp3, i32 %tmp5 ; <i32*> [#uses=1]
- %tmp7 = load i32* %tmp6 ; <i32> [#uses=1]
- ret i32 %tmp7
-}
-
diff --git a/release_23/test/CodeGen/PowerPC/2006-07-19-stwbrx-crash.ll b/release_23/test/CodeGen/PowerPC/2006-07-19-stwbrx-crash.ll
deleted file mode 100644
index c25cf215bc34..000000000000
--- a/release_23/test/CodeGen/PowerPC/2006-07-19-stwbrx-crash.ll
+++ /dev/null
@@ -1,11 +0,0 @@
-; RUN: llvm-as < %s | llc -march=ppc32
-
-define void @img2buf(i32 %symbol_size_in_bytes, i16* %ui16) {
- %tmp93 = load i16* null ; <i16> [#uses=1]
- %tmp99 = call i16 @llvm.bswap.i16( i16 %tmp93 ) ; <i16> [#uses=1]
- store i16 %tmp99, i16* %ui16
- ret void
-}
-
-declare i16 @llvm.bswap.i16(i16)
-
diff --git a/release_23/test/CodeGen/PowerPC/2006-08-11-RetVector.ll b/release_23/test/CodeGen/PowerPC/2006-08-11-RetVector.ll
deleted file mode 100644
index 1043e45efb11..000000000000
--- a/release_23/test/CodeGen/PowerPC/2006-08-11-RetVector.ll
+++ /dev/null
@@ -1,8 +0,0 @@
-; RUN: llvm-as < %s | llc -march=ppc32 -mcpu=g5 | grep vsldoi
-; RUN: llvm-as < %s | llc -march=ppc32 -mcpu=g5 | not grep vor
-
-define <4 x float> @func(<4 x float> %fp0, <4 x float> %fp1) {
- %tmp76 = shufflevector <4 x float> %fp0, <4 x float> %fp1, <4 x i32> < i32 0, i32 1, i32 2, i32 7 > ; <<4 x float>> [#uses=1]
- ret <4 x float> %tmp76
-}
-
diff --git a/release_23/test/CodeGen/PowerPC/2006-08-15-SelectionCrash.ll b/release_23/test/CodeGen/PowerPC/2006-08-15-SelectionCrash.ll
deleted file mode 100644
index aff4edeba54b..000000000000
--- a/release_23/test/CodeGen/PowerPC/2006-08-15-SelectionCrash.ll
+++ /dev/null
@@ -1,30 +0,0 @@
-; RUN: llvm-as < %s | llc
-
- %struct..0anon = type { i32 }
- %struct.rtx_def = type { i16, i8, i8, [1 x %struct..0anon] }
-
-define fastcc void @immed_double_const(i32 %i0, i32 %i1) {
-entry:
- %tmp1 = load i32* null ; <i32> [#uses=1]
- switch i32 %tmp1, label %bb103 [
- i32 1, label %bb
- i32 3, label %bb
- ]
-bb: ; preds = %entry, %entry
- %tmp14 = icmp sgt i32 0, 31 ; <i1> [#uses=1]
- br i1 %tmp14, label %cond_next77, label %cond_next17
-cond_next17: ; preds = %bb
- ret void
-cond_next77: ; preds = %bb
- %tmp79.not = icmp ne i32 %i1, 0 ; <i1> [#uses=1]
- %tmp84 = icmp slt i32 %i0, 0 ; <i1> [#uses=2]
- %bothcond1 = or i1 %tmp79.not, %tmp84 ; <i1> [#uses=1]
- br i1 %bothcond1, label %bb88, label %bb99
-bb88: ; preds = %cond_next77
- %bothcond2 = and i1 false, %tmp84 ; <i1> [#uses=0]
- ret void
-bb99: ; preds = %cond_next77
- ret void
-bb103: ; preds = %entry
- ret void
-}
diff --git a/release_23/test/CodeGen/PowerPC/2006-09-28-shift_64.ll b/release_23/test/CodeGen/PowerPC/2006-09-28-shift_64.ll
deleted file mode 100644
index 5210dd1cb1a8..000000000000
--- a/release_23/test/CodeGen/PowerPC/2006-09-28-shift_64.ll
+++ /dev/null
@@ -1,25 +0,0 @@
-; RUN: llvm-as < %s | llc -march=ppc64
-
-target datalayout = "E-p:64:64"
-target triple = "powerpc64-apple-darwin8"
-
-define void @glArrayElement_CompExec() {
-entry:
- %tmp3 = and i64 0, -8388609 ; <i64> [#uses=1]
- br label %cond_true24
-cond_false: ; preds = %cond_true24
- ret void
-cond_true24: ; preds = %cond_true24, %entry
- %indvar.ph = phi i32 [ 0, %entry ], [ %indvar.next, %cond_true24 ] ; <i32> [#uses=1]
- %indvar = add i32 0, %indvar.ph ; <i32> [#uses=2]
- %code.0 = trunc i32 %indvar to i8 ; <i8> [#uses=1]
- %tmp5 = add i8 %code.0, 16 ; <i8> [#uses=1]
- %shift.upgrd.1 = zext i8 %tmp5 to i64 ; <i64> [#uses=1]
- %tmp7 = lshr i64 %tmp3, %shift.upgrd.1 ; <i64> [#uses=1]
- %tmp7.upgrd.2 = trunc i64 %tmp7 to i32 ; <i32> [#uses=1]
- %tmp8 = and i32 %tmp7.upgrd.2, 1 ; <i32> [#uses=1]
- %tmp8.upgrd.3 = icmp eq i32 %tmp8, 0 ; <i1> [#uses=1]
- %indvar.next = add i32 %indvar, 1 ; <i32> [#uses=1]
- br i1 %tmp8.upgrd.3, label %cond_false, label %cond_true24
-}
-
diff --git a/release_23/test/CodeGen/PowerPC/2006-10-11-combiner-aa-regression.ll b/release_23/test/CodeGen/PowerPC/2006-10-11-combiner-aa-regression.ll
deleted file mode 100644
index a58cd162b4e8..000000000000
--- a/release_23/test/CodeGen/PowerPC/2006-10-11-combiner-aa-regression.ll
+++ /dev/null
@@ -1,24 +0,0 @@
-; RUN: llvm-as < %s | \
-; RUN: llc -march=ppc32 -combiner-alias-analysis | grep f5
-
-target datalayout = "E-p:32:32"
-target triple = "powerpc-apple-darwin8.2.0"
- %struct.Point = type { double, double, double }
-
-define void @offset(%struct.Point* %pt, double %x, double %y, double %z) {
-entry:
- %tmp = getelementptr %struct.Point* %pt, i32 0, i32 0 ; <double*> [#uses=2]
- %tmp.upgrd.1 = load double* %tmp ; <double> [#uses=1]
- %tmp2 = add double %tmp.upgrd.1, %x ; <double> [#uses=1]
- store double %tmp2, double* %tmp
- %tmp6 = getelementptr %struct.Point* %pt, i32 0, i32 1 ; <double*> [#uses=2]
- %tmp7 = load double* %tmp6 ; <double> [#uses=1]
- %tmp9 = add double %tmp7, %y ; <double> [#uses=1]
- store double %tmp9, double* %tmp6
- %tmp13 = getelementptr %struct.Point* %pt, i32 0, i32 2 ; <double*> [#uses=2]
- %tmp14 = load double* %tmp13 ; <double> [#uses=1]
- %tmp16 = add double %tmp14, %z ; <double> [#uses=1]
- store double %tmp16, double* %tmp13
- ret void
-}
-
diff --git a/release_23/test/CodeGen/PowerPC/2006-10-13-Miscompile.ll b/release_23/test/CodeGen/PowerPC/2006-10-13-Miscompile.ll
deleted file mode 100644
index 6621cec7f43e..000000000000
--- a/release_23/test/CodeGen/PowerPC/2006-10-13-Miscompile.ll
+++ /dev/null
@@ -1,16 +0,0 @@
-; RUN: llvm-as < %s | llc -march=ppc32 | not grep IMPLICIT_DEF
-
-define void @foo(i64 %X) {
-entry:
- %tmp1 = and i64 %X, 3 ; <i64> [#uses=1]
- %tmp = icmp sgt i64 %tmp1, 2 ; <i1> [#uses=1]
- br i1 %tmp, label %UnifiedReturnBlock, label %cond_true
-cond_true: ; preds = %entry
- %tmp.upgrd.1 = tail call i32 (...)* @bar( ) ; <i32> [#uses=0]
- ret void
-UnifiedReturnBlock: ; preds = %entry
- ret void
-}
-
-declare i32 @bar(...)
-
diff --git a/release_23/test/CodeGen/PowerPC/2006-10-17-brcc-miscompile.ll b/release_23/test/CodeGen/PowerPC/2006-10-17-brcc-miscompile.ll
deleted file mode 100644
index 313568c1e4be..000000000000
--- a/release_23/test/CodeGen/PowerPC/2006-10-17-brcc-miscompile.ll
+++ /dev/null
@@ -1,20 +0,0 @@
-; RUN: llvm-as < %s | llc -march=ppc32 | grep xor
-
-target datalayout = "E-p:32:32"
-target triple = "powerpc-apple-darwin8.7.0"
-
-define void @foo(i32 %X) {
-entry:
- %tmp1 = and i32 %X, 3 ; <i32> [#uses=1]
- %tmp2 = xor i32 %tmp1, 1 ; <i32> [#uses=1]
- %tmp = icmp eq i32 %tmp2, 0 ; <i1> [#uses=1]
- br i1 %tmp, label %UnifiedReturnBlock, label %cond_true
-cond_true: ; preds = %entry
- tail call i32 (...)* @bar( ) ; <i32>:0 [#uses=0]
- ret void
-UnifiedReturnBlock: ; preds = %entry
- ret void
-}
-
-declare i32 @bar(...)
-
diff --git a/release_23/test/CodeGen/PowerPC/2006-10-17-ppc64-alloca.ll b/release_23/test/CodeGen/PowerPC/2006-10-17-ppc64-alloca.ll
deleted file mode 100644
index 6dc1ff037eb3..000000000000
--- a/release_23/test/CodeGen/PowerPC/2006-10-17-ppc64-alloca.ll
+++ /dev/null
@@ -1,7 +0,0 @@
-; RUN: llvm-as < %s | llc -march=ppc64
-
-define i32* @foo(i32 %n) {
- %A = alloca i32, i32 %n ; <i32*> [#uses=1]
- ret i32* %A
-}
-
diff --git a/release_23/test/CodeGen/PowerPC/2006-11-10-DAGCombineMiscompile.ll b/release_23/test/CodeGen/PowerPC/2006-11-10-DAGCombineMiscompile.ll
deleted file mode 100644
index 80ef479fb076..000000000000
--- a/release_23/test/CodeGen/PowerPC/2006-11-10-DAGCombineMiscompile.ll
+++ /dev/null
@@ -1,13 +0,0 @@
-; RUN: llvm-as < %s | llc -march=ppc32 | grep rlwimi
-
-define void @test(i16 %div.0.i.i.i.i, i32 %L_num.0.i.i.i.i, i32 %tmp1.i.i206.i.i, i16* %P) {
- %X = shl i16 %div.0.i.i.i.i, 1 ; <i16> [#uses=1]
- %tmp28.i.i.i.i = shl i32 %L_num.0.i.i.i.i, 1 ; <i32> [#uses=1]
- %tmp31.i.i.i.i = icmp slt i32 %tmp28.i.i.i.i, %tmp1.i.i206.i.i ; <i1> [#uses=1]
- %tmp31.i.i.i.i.upgrd.1 = zext i1 %tmp31.i.i.i.i to i16 ; <i16> [#uses=1]
- %tmp371.i.i.i.i1 = or i16 %tmp31.i.i.i.i.upgrd.1, %X ; <i16> [#uses=1]
- %div.0.be.i.i.i.i = xor i16 %tmp371.i.i.i.i1, 1 ; <i16> [#uses=1]
- store i16 %div.0.be.i.i.i.i, i16* %P
- ret void
-}
-
diff --git a/release_23/test/CodeGen/PowerPC/2006-11-29-AltivecFPSplat.ll b/release_23/test/CodeGen/PowerPC/2006-11-29-AltivecFPSplat.ll
deleted file mode 100644
index 7680c215c217..000000000000
--- a/release_23/test/CodeGen/PowerPC/2006-11-29-AltivecFPSplat.ll
+++ /dev/null
@@ -1,10 +0,0 @@
-; RUN: llvm-as < %s | llc -march=ppc32 -mcpu=g5
-
-define void @glgRunProcessor15() {
- %tmp26355.i = shufflevector <4 x float> zeroinitializer, <4 x float> < float 0x379FFFE000000000, float 0x379FFFE000000000, float 0x379FFFE000000000, float 0x379FFFE000000000 >, <4 x i32> < i32 0, i32 1, i32 2, i32 7 >; <<4 x float>> [#uses=1]
- %tmp3030030304.i = bitcast <4 x float> %tmp26355.i to <8 x i16> ; <<8 x i16>> [#uses=1]
- %tmp30305.i = shufflevector <8 x i16> zeroinitializer, <8 x i16> %tmp3030030304.i, <8 x i32> < i32 1, i32 3, i32 5, i32 7, i32 9, i32 11, i32 13, i32 15 > ; <<8 x i16>> [#uses=1]
- %tmp30305.i.upgrd.1 = bitcast <8 x i16> %tmp30305.i to <4 x i32> ; <<4 x i32>> [#uses=1]
- store <4 x i32> %tmp30305.i.upgrd.1, <4 x i32>* null
- ret void
-}
diff --git a/release_23/test/CodeGen/PowerPC/2006-12-07-LargeAlloca.ll b/release_23/test/CodeGen/PowerPC/2006-12-07-LargeAlloca.ll
deleted file mode 100644
index be3b86308f13..000000000000
--- a/release_23/test/CodeGen/PowerPC/2006-12-07-LargeAlloca.ll
+++ /dev/null
@@ -1,24 +0,0 @@
-; RUN: llvm-as < %s | llc -march=ppc64
-; RUN: llvm-as < %s | llc -march=ppc32
-; RUN: llvm-as < %s | llc
-
-define void @bitap() {
-entry:
- %RMask.i = alloca [256 x i32], align 16 ; <[256 x i32]*> [#uses=1]
- %buffer = alloca [147456 x i8], align 16 ; <[147456 x i8]*> [#uses=0]
- br i1 false, label %bb19, label %bb.preheader
-bb.preheader: ; preds = %entry
- ret void
-bb19: ; preds = %entry
- br i1 false, label %bb12.i, label %cond_next39
-bb12.i: ; preds = %bb12.i, %bb19
- %i.0.i = phi i32 [ %tmp11.i, %bb12.i ], [ 0, %bb19 ] ; <i32> [#uses=2]
- %gep.upgrd.1 = zext i32 %i.0.i to i64 ; <i64> [#uses=1]
- %tmp9.i = getelementptr [256 x i32]* %RMask.i, i32 0, i64 %gep.upgrd.1 ; <i32*> [#uses=1]
- store i32 0, i32* %tmp9.i
- %tmp11.i = add i32 %i.0.i, 1 ; <i32> [#uses=1]
- br label %bb12.i
-cond_next39: ; preds = %bb19
- ret void
-}
-
diff --git a/release_23/test/CodeGen/PowerPC/2006-12-07-SelectCrash.ll b/release_23/test/CodeGen/PowerPC/2006-12-07-SelectCrash.ll
deleted file mode 100644
index 058166ff93db..000000000000
--- a/release_23/test/CodeGen/PowerPC/2006-12-07-SelectCrash.ll
+++ /dev/null
@@ -1,22 +0,0 @@
-; RUN: llvm-as < %s | llc -march=ppc64
-; RUN: llvm-as < %s | llc -march=ppc32
-; RUN: llvm-as < %s | llc
-
-@qsz.b = external global i1 ; <i1*> [#uses=1]
-
-define fastcc void @qst() {
-entry:
- br i1 true, label %cond_next71, label %cond_true
-cond_true: ; preds = %entry
- ret void
-cond_next71: ; preds = %entry
- %tmp73.b = load i1* @qsz.b ; <i1> [#uses=1]
- %ii.4.ph = select i1 %tmp73.b, i64 4, i64 0 ; <i64> [#uses=1]
- br label %bb139
-bb82: ; preds = %bb139
- ret void
-bb139: ; preds = %bb139, %cond_next71
- %exitcond89 = icmp eq i64 0, %ii.4.ph ; <i1> [#uses=1]
- br i1 %exitcond89, label %bb82, label %bb139
-}
-
diff --git a/release_23/test/CodeGen/PowerPC/2007-01-04-ArgExtension.ll b/release_23/test/CodeGen/PowerPC/2007-01-04-ArgExtension.ll
deleted file mode 100644
index 19fedf9f5962..000000000000
--- a/release_23/test/CodeGen/PowerPC/2007-01-04-ArgExtension.ll
+++ /dev/null
@@ -1,10 +0,0 @@
-; RUN: llvm-as < %s | llc -march=ppc32 | grep extsb
-; RUN: llvm-as < %s | llc -march=ppc32 | grep extsh
-
-define i32 @p1(i8 %c, i16 %s) {
-entry:
- %tmp = sext i8 %c to i32 ; <i32> [#uses=1]
- %tmp1 = sext i16 %s to i32 ; <i32> [#uses=1]
- %tmp2 = add i32 %tmp1, %tmp ; <i32> [#uses=1]
- ret i32 %tmp2
-}
diff --git a/release_23/test/CodeGen/PowerPC/2007-01-15-AsmDialect.ll b/release_23/test/CodeGen/PowerPC/2007-01-15-AsmDialect.ll
deleted file mode 100644
index d9374edfe865..000000000000
--- a/release_23/test/CodeGen/PowerPC/2007-01-15-AsmDialect.ll
+++ /dev/null
@@ -1,27 +0,0 @@
-; RUN: llvm-as < %s | llc -march=ppc32 -mtriple=powerpc-apple-darwin8 | \
-; RUN: grep cntlzw
-
-define i32 @foo() {
-entry:
- %retval = alloca i32, align 4 ; <i32*> [#uses=2]
- %temp = alloca i32, align 4 ; <i32*> [#uses=2]
- %ctz_x = alloca i32, align 4 ; <i32*> [#uses=3]
- %ctz_c = alloca i32, align 4 ; <i32*> [#uses=2]
- "alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
- store i32 61440, i32* %ctz_x
- %tmp = load i32* %ctz_x ; <i32> [#uses=1]
- %tmp1 = sub i32 0, %tmp ; <i32> [#uses=1]
- %tmp2 = load i32* %ctz_x ; <i32> [#uses=1]
- %tmp3 = and i32 %tmp1, %tmp2 ; <i32> [#uses=1]
- %tmp4 = call i32 asm "$(cntlz$|cntlzw$) $0,$1", "=r,r,~{dirflag},~{fpsr},~{flags}"( i32 %tmp3 ) ; <i32> [#uses=1]
- store i32 %tmp4, i32* %ctz_c
- %tmp5 = load i32* %ctz_c ; <i32> [#uses=1]
- store i32 %tmp5, i32* %temp
- %tmp6 = load i32* %temp ; <i32> [#uses=1]
- store i32 %tmp6, i32* %retval
- br label %return
-
-return: ; preds = %entry
- %retval2 = load i32* %retval ; <i32> [#uses=1]
- ret i32 %retval2
-}
diff --git a/release_23/test/CodeGen/PowerPC/2007-01-29-lbrx-asm.ll b/release_23/test/CodeGen/PowerPC/2007-01-29-lbrx-asm.ll
deleted file mode 100644
index f2c951ec21d5..000000000000
--- a/release_23/test/CodeGen/PowerPC/2007-01-29-lbrx-asm.ll
+++ /dev/null
@@ -1,7 +0,0 @@
-; RUN: llvm-as < %s | llc -march=ppc32
-; RUN: llvm-as < %s | llc -march=ppc64
-
-define i16 @test(i8* %d1, i16* %d2) {
- %tmp237 = call i16 asm "lhbrx $0, $2, $1", "=r,r,bO,m"( i8* %d1, i32 0, i16* %d2 ) ; <i16> [#uses=1]
- ret i16 %tmp237
-}
diff --git a/release_23/test/CodeGen/PowerPC/2007-01-31-InlineAsmAddrMode.ll b/release_23/test/CodeGen/PowerPC/2007-01-31-InlineAsmAddrMode.ll
deleted file mode 100644
index d4764622af68..000000000000
--- a/release_23/test/CodeGen/PowerPC/2007-01-31-InlineAsmAddrMode.ll
+++ /dev/null
@@ -1,24 +0,0 @@
-; RUN: llvm-as < %s | llc -march=ppc32
-; RUN: llvm-as < %s | llc -march=ppc64
-
-; Test two things: 1) that a frameidx can be rewritten in an inline asm
-; 2) that inline asms can handle reg+imm addr modes.
-
- %struct.A = type { i32, i32 }
-
-
-define void @test1() {
-entry:
- %Out = alloca %struct.A, align 4 ; <%struct.A*> [#uses=1]
- %tmp2 = getelementptr %struct.A* %Out, i32 0, i32 1
- %tmp5 = call i32 asm "lwbrx $0, $1", "=r,m"(i32* %tmp2 )
- ret void
-}
-
-define void @test2() {
-entry:
- %Out = alloca %struct.A, align 4 ; <%struct.A*> [#uses=1]
- %tmp2 = getelementptr %struct.A* %Out, i32 0, i32 0 ; <i32*> [#uses=1]
- %tmp5 = call i32 asm "lwbrx $0, $2, $1", "=r,r,bO,m"( i8* null, i32 0, i32* %tmp2 ) ; <i32> [#uses=0]
- ret void
-}
diff --git a/release_23/test/CodeGen/PowerPC/2007-02-16-AlignPacked.ll b/release_23/test/CodeGen/PowerPC/2007-02-16-AlignPacked.ll
deleted file mode 100644
index 97f6a018b30b..000000000000
--- a/release_23/test/CodeGen/PowerPC/2007-02-16-AlignPacked.ll
+++ /dev/null
@@ -1,4 +0,0 @@
-; RUN: llvm-as < %s | llc -march=ppc32 -mtriple=powerpc-apple-darwin8.8.0 | \
-; RUN: grep align.*3
-
-@X = global <{i32, i32}> <{ i32 1, i32 123 }>
diff --git a/release_23/test/CodeGen/PowerPC/2007-02-16-InlineAsmNConstraint.ll b/release_23/test/CodeGen/PowerPC/2007-02-16-InlineAsmNConstraint.ll
deleted file mode 100644
index 5a3d3b5d9c1c..000000000000
--- a/release_23/test/CodeGen/PowerPC/2007-02-16-InlineAsmNConstraint.ll
+++ /dev/null
@@ -1,11 +0,0 @@
-; RUN: llvm-as < %s | llc
-
-target datalayout = "E-p:32:32"
-target triple = "powerpc-apple-darwin8.8.0"
-
-
-define void @blargh() {
-entry:
- %tmp4 = call i32 asm "rlwimi $0,$2,$3,$4,$5", "=r,0,r,n,n,n"( i32 0, i32 0, i32 0, i32 24, i32 31 ) ; <i32> [#uses=0]
- unreachable
-}
diff --git a/release_23/test/CodeGen/PowerPC/2007-02-23-lr-saved-twice.ll b/release_23/test/CodeGen/PowerPC/2007-02-23-lr-saved-twice.ll
deleted file mode 100644
index 3eef9c551b75..000000000000
--- a/release_23/test/CodeGen/PowerPC/2007-02-23-lr-saved-twice.ll
+++ /dev/null
@@ -1,14 +0,0 @@
-; RUN: llvm-as < %s | llc | grep mflr | count 1
-
-target datalayout = "e-p:32:32"
-target triple = "powerpc-apple-darwin8"
-@str = internal constant [18 x i8] c"hello world!, %d\0A\00" ; <[18 x i8]*> [#uses=1]
-
-
-define i32 @main() {
-entry:
- %tmp = tail call i32 (i8*, ...)* @printf( i8* getelementptr ([18 x i8]* @str, i32 0, i32 0) ) ; <i32> [#uses=0]
- ret i32 0
-}
-
-declare i32 @printf(i8*, ...)
diff --git a/release_23/test/CodeGen/PowerPC/2007-03-24-cntlzd.ll b/release_23/test/CodeGen/PowerPC/2007-03-24-cntlzd.ll
deleted file mode 100644
index 098e7484e173..000000000000
--- a/release_23/test/CodeGen/PowerPC/2007-03-24-cntlzd.ll
+++ /dev/null
@@ -1,12 +0,0 @@
-; RUN: llvm-as < %s | llc -march=ppc64 -mcpu=g5 | grep cntlzd
-
-define i32 @_ZNK4llvm5APInt17countLeadingZerosEv(i64 *%t) {
- %tmp19 = load i64* %t
- %tmp22 = tail call i64 @llvm.ctlz.i64( i64 %tmp19 ) ; <i64> [#uses=1]
- %tmp23 = trunc i64 %tmp22 to i32
- %tmp89 = add i32 %tmp23, -64 ; <i32> [#uses=1]
- %tmp90 = add i32 %tmp89, 0 ; <i32> [#uses=1]
- ret i32 %tmp90
-}
-
-declare i64 @llvm.ctlz.i64(i64)
diff --git a/release_23/test/CodeGen/PowerPC/2007-03-30-SpillerCrash.ll b/release_23/test/CodeGen/PowerPC/2007-03-30-SpillerCrash.ll
deleted file mode 100644
index 04ca3bbde1d3..000000000000
--- a/release_23/test/CodeGen/PowerPC/2007-03-30-SpillerCrash.ll
+++ /dev/null
@@ -1,1801 +0,0 @@
-; RUN: llvm-as < %s | llc -march=ppc32 -mcpu=g5
-
-define void @test(<4 x float>*, { { i16, i16, i32 } }*) {
-xOperationInitMasks.exit:
- %.sub7896 = getelementptr [4 x <4 x i32>]* null, i32 0, i32 0 ; <<4 x i32>*> [#uses=24]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 175, i32 3 ; <<4 x float>*>:2 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 174, i32 2 ; <<4 x float>*>:3 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 174, i32 3 ; <<4 x float>*>:4 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 173, i32 1 ; <<4 x float>*>:5 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 173, i32 2 ; <<4 x float>*>:6 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 173, i32 3 ; <<4 x float>*>:7 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 172, i32 1 ; <<4 x float>*>:8 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 172, i32 2 ; <<4 x float>*>:9 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 172, i32 3 ; <<4 x float>*>:10 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 171, i32 1 ; <<4 x float>*>:11 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 171, i32 2 ; <<4 x float>*>:12 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 171, i32 3 ; <<4 x float>*>:13 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 170, i32 1 ; <<4 x float>*>:14 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 170, i32 2 ; <<4 x float>*>:15 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 170, i32 3 ; <<4 x float>*>:16 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 169, i32 1 ; <<4 x float>*>:17 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 169, i32 2 ; <<4 x float>*>:18 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 169, i32 3 ; <<4 x float>*>:19 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 168, i32 1 ; <<4 x float>*>:20 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 168, i32 2 ; <<4 x float>*>:21 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 168, i32 3 ; <<4 x float>*>:22 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 167, i32 1 ; <<4 x float>*>:23 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 167, i32 2 ; <<4 x float>*>:24 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 167, i32 3 ; <<4 x float>*>:25 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 166, i32 1 ; <<4 x float>*>:26 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 166, i32 2 ; <<4 x float>*>:27 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 166, i32 3 ; <<4 x float>*>:28 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 165, i32 1 ; <<4 x float>*>:29 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 165, i32 2 ; <<4 x float>*>:30 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 165, i32 3 ; <<4 x float>*>:31 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 164, i32 1 ; <<4 x float>*>:32 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 164, i32 2 ; <<4 x float>*>:33 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 164, i32 3 ; <<4 x float>*>:34 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 163, i32 1 ; <<4 x float>*>:35 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 163, i32 2 ; <<4 x float>*>:36 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 163, i32 3 ; <<4 x float>*>:37 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 162, i32 1 ; <<4 x float>*>:38 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 162, i32 2 ; <<4 x float>*>:39 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 162, i32 3 ; <<4 x float>*>:40 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 161, i32 1 ; <<4 x float>*>:41 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 161, i32 2 ; <<4 x float>*>:42 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 161, i32 3 ; <<4 x float>*>:43 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 160, i32 1 ; <<4 x float>*>:44 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 160, i32 2 ; <<4 x float>*>:45 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 160, i32 3 ; <<4 x float>*>:46 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 159, i32 1 ; <<4 x float>*>:47 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 159, i32 2 ; <<4 x float>*>:48 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 159, i32 3 ; <<4 x float>*>:49 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 158, i32 1 ; <<4 x float>*>:50 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 158, i32 2 ; <<4 x float>*>:51 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 158, i32 3 ; <<4 x float>*>:52 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 157, i32 1 ; <<4 x float>*>:53 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 157, i32 2 ; <<4 x float>*>:54 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 157, i32 3 ; <<4 x float>*>:55 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 156, i32 1 ; <<4 x float>*>:56 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 156, i32 2 ; <<4 x float>*>:57 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 156, i32 3 ; <<4 x float>*>:58 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 155, i32 1 ; <<4 x float>*>:59 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 155, i32 2 ; <<4 x float>*>:60 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 155, i32 3 ; <<4 x float>*>:61 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 154, i32 1 ; <<4 x float>*>:62 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 154, i32 2 ; <<4 x float>*>:63 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 154, i32 3 ; <<4 x float>*>:64 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 153, i32 1 ; <<4 x float>*>:65 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 153, i32 2 ; <<4 x float>*>:66 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 153, i32 3 ; <<4 x float>*>:67 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 152, i32 1 ; <<4 x float>*>:68 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 152, i32 2 ; <<4 x float>*>:69 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 152, i32 3 ; <<4 x float>*>:70 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 151, i32 1 ; <<4 x float>*>:71 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 151, i32 2 ; <<4 x float>*>:72 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 151, i32 3 ; <<4 x float>*>:73 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 150, i32 1 ; <<4 x float>*>:74 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 150, i32 2 ; <<4 x float>*>:75 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 150, i32 3 ; <<4 x float>*>:76 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 149, i32 1 ; <<4 x float>*>:77 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 149, i32 2 ; <<4 x float>*>:78 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 149, i32 3 ; <<4 x float>*>:79 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 148, i32 1 ; <<4 x float>*>:80 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 148, i32 2 ; <<4 x float>*>:81 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 148, i32 3 ; <<4 x float>*>:82 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 147, i32 1 ; <<4 x float>*>:83 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 147, i32 2 ; <<4 x float>*>:84 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 147, i32 3 ; <<4 x float>*>:85 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 146, i32 1 ; <<4 x float>*>:86 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 146, i32 2 ; <<4 x float>*>:87 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 146, i32 3 ; <<4 x float>*>:88 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 145, i32 1 ; <<4 x float>*>:89 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 145, i32 2 ; <<4 x float>*>:90 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 145, i32 3 ; <<4 x float>*>:91 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 144, i32 1 ; <<4 x float>*>:92 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 144, i32 2 ; <<4 x float>*>:93 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 144, i32 3 ; <<4 x float>*>:94 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 143, i32 1 ; <<4 x float>*>:95 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 143, i32 2 ; <<4 x float>*>:96 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 143, i32 3 ; <<4 x float>*>:97 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 142, i32 1 ; <<4 x float>*>:98 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 142, i32 2 ; <<4 x float>*>:99 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 142, i32 3 ; <<4 x float>*>:100 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 141, i32 1 ; <<4 x float>*>:101 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 141, i32 2 ; <<4 x float>*>:102 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 141, i32 3 ; <<4 x float>*>:103 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 140, i32 1 ; <<4 x float>*>:104 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 140, i32 2 ; <<4 x float>*>:105 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 140, i32 3 ; <<4 x float>*>:106 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 139, i32 1 ; <<4 x float>*>:107 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 139, i32 2 ; <<4 x float>*>:108 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 139, i32 3 ; <<4 x float>*>:109 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 138, i32 1 ; <<4 x float>*>:110 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 138, i32 2 ; <<4 x float>*>:111 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 138, i32 3 ; <<4 x float>*>:112 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 137, i32 1 ; <<4 x float>*>:113 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 137, i32 2 ; <<4 x float>*>:114 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 137, i32 3 ; <<4 x float>*>:115 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 136, i32 1 ; <<4 x float>*>:116 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 136, i32 2 ; <<4 x float>*>:117 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 136, i32 3 ; <<4 x float>*>:118 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 135, i32 1 ; <<4 x float>*>:119 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 135, i32 2 ; <<4 x float>*>:120 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 135, i32 3 ; <<4 x float>*>:121 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 134, i32 1 ; <<4 x float>*>:122 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 134, i32 2 ; <<4 x float>*>:123 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 134, i32 3 ; <<4 x float>*>:124 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 133, i32 1 ; <<4 x float>*>:125 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 133, i32 2 ; <<4 x float>*>:126 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 133, i32 3 ; <<4 x float>*>:127 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 132, i32 1 ; <<4 x float>*>:128 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 132, i32 2 ; <<4 x float>*>:129 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 132, i32 3 ; <<4 x float>*>:130 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 131, i32 1 ; <<4 x float>*>:131 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 131, i32 2 ; <<4 x float>*>:132 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 131, i32 3 ; <<4 x float>*>:133 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 130, i32 1 ; <<4 x float>*>:134 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 130, i32 2 ; <<4 x float>*>:135 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 130, i32 3 ; <<4 x float>*>:136 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 129, i32 1 ; <<4 x float>*>:137 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 129, i32 2 ; <<4 x float>*>:138 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 129, i32 3 ; <<4 x float>*>:139 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 128, i32 1 ; <<4 x float>*>:140 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 128, i32 2 ; <<4 x float>*>:141 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 128, i32 3 ; <<4 x float>*>:142 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 127, i32 1 ; <<4 x float>*>:143 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 127, i32 2 ; <<4 x float>*>:144 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 127, i32 3 ; <<4 x float>*>:145 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 126, i32 1 ; <<4 x float>*>:146 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 126, i32 2 ; <<4 x float>*>:147 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 126, i32 3 ; <<4 x float>*>:148 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 125, i32 1 ; <<4 x float>*>:149 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 125, i32 2 ; <<4 x float>*>:150 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 125, i32 3 ; <<4 x float>*>:151 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 124, i32 1 ; <<4 x float>*>:152 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 124, i32 2 ; <<4 x float>*>:153 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 124, i32 3 ; <<4 x float>*>:154 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 123, i32 1 ; <<4 x float>*>:155 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 123, i32 2 ; <<4 x float>*>:156 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 123, i32 3 ; <<4 x float>*>:157 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 122, i32 1 ; <<4 x float>*>:158 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 122, i32 2 ; <<4 x float>*>:159 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 122, i32 3 ; <<4 x float>*>:160 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 121, i32 1 ; <<4 x float>*>:161 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 121, i32 2 ; <<4 x float>*>:162 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 121, i32 3 ; <<4 x float>*>:163 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 120, i32 1 ; <<4 x float>*>:164 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 120, i32 2 ; <<4 x float>*>:165 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 120, i32 3 ; <<4 x float>*>:166 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 119, i32 1 ; <<4 x float>*>:167 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 119, i32 2 ; <<4 x float>*>:168 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 119, i32 3 ; <<4 x float>*>:169 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 118, i32 1 ; <<4 x float>*>:170 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 118, i32 2 ; <<4 x float>*>:171 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 118, i32 3 ; <<4 x float>*>:172 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 117, i32 1 ; <<4 x float>*>:173 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 117, i32 2 ; <<4 x float>*>:174 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 117, i32 3 ; <<4 x float>*>:175 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 116, i32 1 ; <<4 x float>*>:176 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 116, i32 2 ; <<4 x float>*>:177 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 116, i32 3 ; <<4 x float>*>:178 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 115, i32 1 ; <<4 x float>*>:179 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 115, i32 2 ; <<4 x float>*>:180 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 115, i32 3 ; <<4 x float>*>:181 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 114, i32 1 ; <<4 x float>*>:182 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 114, i32 2 ; <<4 x float>*>:183 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 114, i32 3 ; <<4 x float>*>:184 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 113, i32 1 ; <<4 x float>*>:185 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 113, i32 2 ; <<4 x float>*>:186 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 113, i32 3 ; <<4 x float>*>:187 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 112, i32 1 ; <<4 x float>*>:188 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 112, i32 2 ; <<4 x float>*>:189 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 112, i32 3 ; <<4 x float>*>:190 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 111, i32 1 ; <<4 x float>*>:191 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 111, i32 2 ; <<4 x float>*>:192 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 111, i32 3 ; <<4 x float>*>:193 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 110, i32 1 ; <<4 x float>*>:194 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 110, i32 2 ; <<4 x float>*>:195 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 110, i32 3 ; <<4 x float>*>:196 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 109, i32 1 ; <<4 x float>*>:197 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 109, i32 2 ; <<4 x float>*>:198 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 109, i32 3 ; <<4 x float>*>:199 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 108, i32 1 ; <<4 x float>*>:200 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 108, i32 2 ; <<4 x float>*>:201 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 108, i32 3 ; <<4 x float>*>:202 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 107, i32 1 ; <<4 x float>*>:203 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 107, i32 2 ; <<4 x float>*>:204 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 107, i32 3 ; <<4 x float>*>:205 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 106, i32 1 ; <<4 x float>*>:206 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 106, i32 2 ; <<4 x float>*>:207 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 106, i32 3 ; <<4 x float>*>:208 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 105, i32 1 ; <<4 x float>*>:209 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 105, i32 2 ; <<4 x float>*>:210 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 105, i32 3 ; <<4 x float>*>:211 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 104, i32 1 ; <<4 x float>*>:212 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 104, i32 2 ; <<4 x float>*>:213 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 104, i32 3 ; <<4 x float>*>:214 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 103, i32 1 ; <<4 x float>*>:215 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 103, i32 2 ; <<4 x float>*>:216 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 103, i32 3 ; <<4 x float>*>:217 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 102, i32 1 ; <<4 x float>*>:218 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 102, i32 2 ; <<4 x float>*>:219 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 102, i32 3 ; <<4 x float>*>:220 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 101, i32 1 ; <<4 x float>*>:221 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 101, i32 2 ; <<4 x float>*>:222 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 101, i32 3 ; <<4 x float>*>:223 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 100, i32 1 ; <<4 x float>*>:224 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 100, i32 2 ; <<4 x float>*>:225 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 100, i32 3 ; <<4 x float>*>:226 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 99, i32 1 ; <<4 x float>*>:227 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 99, i32 2 ; <<4 x float>*>:228 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 99, i32 3 ; <<4 x float>*>:229 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 98, i32 1 ; <<4 x float>*>:230 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 98, i32 2 ; <<4 x float>*>:231 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 98, i32 3 ; <<4 x float>*>:232 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 97, i32 1 ; <<4 x float>*>:233 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 97, i32 2 ; <<4 x float>*>:234 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 97, i32 3 ; <<4 x float>*>:235 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 96, i32 1 ; <<4 x float>*>:236 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 96, i32 2 ; <<4 x float>*>:237 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 96, i32 3 ; <<4 x float>*>:238 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 95, i32 1 ; <<4 x float>*>:239 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 95, i32 2 ; <<4 x float>*>:240 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 95, i32 3 ; <<4 x float>*>:241 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 94, i32 1 ; <<4 x float>*>:242 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 94, i32 2 ; <<4 x float>*>:243 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 94, i32 3 ; <<4 x float>*>:244 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 93, i32 1 ; <<4 x float>*>:245 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 93, i32 2 ; <<4 x float>*>:246 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 93, i32 3 ; <<4 x float>*>:247 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 92, i32 1 ; <<4 x float>*>:248 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 92, i32 2 ; <<4 x float>*>:249 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 92, i32 3 ; <<4 x float>*>:250 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 91, i32 1 ; <<4 x float>*>:251 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 91, i32 2 ; <<4 x float>*>:252 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 91, i32 3 ; <<4 x float>*>:253 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 90, i32 1 ; <<4 x float>*>:254 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 90, i32 2 ; <<4 x float>*>:255 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 90, i32 3 ; <<4 x float>*>:256 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 89, i32 1 ; <<4 x float>*>:257 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 89, i32 2 ; <<4 x float>*>:258 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 89, i32 3 ; <<4 x float>*>:259 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 88, i32 1 ; <<4 x float>*>:260 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 88, i32 2 ; <<4 x float>*>:261 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 88, i32 3 ; <<4 x float>*>:262 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 87, i32 1 ; <<4 x float>*>:263 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 87, i32 2 ; <<4 x float>*>:264 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 87, i32 3 ; <<4 x float>*>:265 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 86, i32 1 ; <<4 x float>*>:266 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 86, i32 2 ; <<4 x float>*>:267 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 86, i32 3 ; <<4 x float>*>:268 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 85, i32 1 ; <<4 x float>*>:269 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 85, i32 2 ; <<4 x float>*>:270 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 85, i32 3 ; <<4 x float>*>:271 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 84, i32 1 ; <<4 x float>*>:272 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 84, i32 2 ; <<4 x float>*>:273 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 84, i32 3 ; <<4 x float>*>:274 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 83, i32 1 ; <<4 x float>*>:275 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 83, i32 2 ; <<4 x float>*>:276 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 83, i32 3 ; <<4 x float>*>:277 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 82, i32 1 ; <<4 x float>*>:278 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 82, i32 2 ; <<4 x float>*>:279 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 82, i32 3 ; <<4 x float>*>:280 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 81, i32 1 ; <<4 x float>*>:281 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 81, i32 2 ; <<4 x float>*>:282 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 81, i32 3 ; <<4 x float>*>:283 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 80, i32 1 ; <<4 x float>*>:284 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 80, i32 2 ; <<4 x float>*>:285 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 80, i32 3 ; <<4 x float>*>:286 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 79, i32 1 ; <<4 x float>*>:287 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 79, i32 2 ; <<4 x float>*>:288 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 79, i32 3 ; <<4 x float>*>:289 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 78, i32 1 ; <<4 x float>*>:290 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 78, i32 2 ; <<4 x float>*>:291 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 78, i32 3 ; <<4 x float>*>:292 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 77, i32 1 ; <<4 x float>*>:293 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 77, i32 2 ; <<4 x float>*>:294 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 77, i32 3 ; <<4 x float>*>:295 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 76, i32 1 ; <<4 x float>*>:296 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 76, i32 2 ; <<4 x float>*>:297 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 76, i32 3 ; <<4 x float>*>:298 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 75, i32 1 ; <<4 x float>*>:299 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 75, i32 2 ; <<4 x float>*>:300 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 75, i32 3 ; <<4 x float>*>:301 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 74, i32 1 ; <<4 x float>*>:302 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 74, i32 2 ; <<4 x float>*>:303 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 74, i32 3 ; <<4 x float>*>:304 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 73, i32 1 ; <<4 x float>*>:305 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 73, i32 2 ; <<4 x float>*>:306 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 73, i32 3 ; <<4 x float>*>:307 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 72, i32 1 ; <<4 x float>*>:308 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 72, i32 2 ; <<4 x float>*>:309 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 72, i32 3 ; <<4 x float>*>:310 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 71, i32 1 ; <<4 x float>*>:311 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 71, i32 2 ; <<4 x float>*>:312 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 71, i32 3 ; <<4 x float>*>:313 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 70, i32 1 ; <<4 x float>*>:314 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 70, i32 2 ; <<4 x float>*>:315 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 70, i32 3 ; <<4 x float>*>:316 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 69, i32 1 ; <<4 x float>*>:317 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 69, i32 2 ; <<4 x float>*>:318 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 69, i32 3 ; <<4 x float>*>:319 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 68, i32 1 ; <<4 x float>*>:320 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 68, i32 2 ; <<4 x float>*>:321 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 68, i32 3 ; <<4 x float>*>:322 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 67, i32 1 ; <<4 x float>*>:323 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 67, i32 2 ; <<4 x float>*>:324 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 67, i32 3 ; <<4 x float>*>:325 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 66, i32 1 ; <<4 x float>*>:326 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 66, i32 2 ; <<4 x float>*>:327 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 66, i32 3 ; <<4 x float>*>:328 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 65, i32 1 ; <<4 x float>*>:329 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 65, i32 2 ; <<4 x float>*>:330 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 65, i32 3 ; <<4 x float>*>:331 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 64, i32 1 ; <<4 x float>*>:332 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 64, i32 2 ; <<4 x float>*>:333 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 64, i32 3 ; <<4 x float>*>:334 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 63, i32 1 ; <<4 x float>*>:335 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 63, i32 2 ; <<4 x float>*>:336 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 63, i32 3 ; <<4 x float>*>:337 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 62, i32 1 ; <<4 x float>*>:338 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 62, i32 2 ; <<4 x float>*>:339 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 62, i32 3 ; <<4 x float>*>:340 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 61, i32 1 ; <<4 x float>*>:341 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 61, i32 2 ; <<4 x float>*>:342 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 61, i32 3 ; <<4 x float>*>:343 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 60, i32 1 ; <<4 x float>*>:344 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 60, i32 2 ; <<4 x float>*>:345 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 60, i32 3 ; <<4 x float>*>:346 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 59, i32 1 ; <<4 x float>*>:347 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 59, i32 2 ; <<4 x float>*>:348 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 59, i32 3 ; <<4 x float>*>:349 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 58, i32 1 ; <<4 x float>*>:350 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 58, i32 2 ; <<4 x float>*>:351 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 58, i32 3 ; <<4 x float>*>:352 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 57, i32 1 ; <<4 x float>*>:353 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 57, i32 2 ; <<4 x float>*>:354 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 57, i32 3 ; <<4 x float>*>:355 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 56, i32 1 ; <<4 x float>*>:356 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 56, i32 2 ; <<4 x float>*>:357 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 56, i32 3 ; <<4 x float>*>:358 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 55, i32 1 ; <<4 x float>*>:359 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 55, i32 2 ; <<4 x float>*>:360 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 55, i32 3 ; <<4 x float>*>:361 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 54, i32 1 ; <<4 x float>*>:362 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 54, i32 2 ; <<4 x float>*>:363 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 54, i32 3 ; <<4 x float>*>:364 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 53, i32 1 ; <<4 x float>*>:365 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 53, i32 2 ; <<4 x float>*>:366 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 53, i32 3 ; <<4 x float>*>:367 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 52, i32 1 ; <<4 x float>*>:368 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 52, i32 2 ; <<4 x float>*>:369 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 52, i32 3 ; <<4 x float>*>:370 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 51, i32 1 ; <<4 x float>*>:371 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 51, i32 2 ; <<4 x float>*>:372 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 51, i32 3 ; <<4 x float>*>:373 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 50, i32 1 ; <<4 x float>*>:374 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 50, i32 2 ; <<4 x float>*>:375 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 50, i32 3 ; <<4 x float>*>:376 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 49, i32 1 ; <<4 x float>*>:377 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 49, i32 2 ; <<4 x float>*>:378 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 49, i32 3 ; <<4 x float>*>:379 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 48, i32 1 ; <<4 x float>*>:380 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 48, i32 2 ; <<4 x float>*>:381 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 48, i32 3 ; <<4 x float>*>:382 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 47, i32 1 ; <<4 x float>*>:383 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 47, i32 2 ; <<4 x float>*>:384 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 47, i32 3 ; <<4 x float>*>:385 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 46, i32 1 ; <<4 x float>*>:386 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 46, i32 2 ; <<4 x float>*>:387 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 46, i32 3 ; <<4 x float>*>:388 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 45, i32 1 ; <<4 x float>*>:389 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 45, i32 2 ; <<4 x float>*>:390 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 45, i32 3 ; <<4 x float>*>:391 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 44, i32 1 ; <<4 x float>*>:392 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 44, i32 2 ; <<4 x float>*>:393 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 44, i32 3 ; <<4 x float>*>:394 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 43, i32 1 ; <<4 x float>*>:395 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 43, i32 2 ; <<4 x float>*>:396 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 43, i32 3 ; <<4 x float>*>:397 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 42, i32 1 ; <<4 x float>*>:398 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 42, i32 2 ; <<4 x float>*>:399 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 42, i32 3 ; <<4 x float>*>:400 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 41, i32 1 ; <<4 x float>*>:401 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 41, i32 2 ; <<4 x float>*>:402 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 41, i32 3 ; <<4 x float>*>:403 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 40, i32 1 ; <<4 x float>*>:404 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 40, i32 2 ; <<4 x float>*>:405 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 40, i32 3 ; <<4 x float>*>:406 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 39, i32 1 ; <<4 x float>*>:407 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 39, i32 2 ; <<4 x float>*>:408 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 39, i32 3 ; <<4 x float>*>:409 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 38, i32 1 ; <<4 x float>*>:410 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 38, i32 2 ; <<4 x float>*>:411 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 38, i32 3 ; <<4 x float>*>:412 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 37, i32 1 ; <<4 x float>*>:413 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 37, i32 2 ; <<4 x float>*>:414 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 37, i32 3 ; <<4 x float>*>:415 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 36, i32 1 ; <<4 x float>*>:416 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 36, i32 2 ; <<4 x float>*>:417 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 36, i32 3 ; <<4 x float>*>:418 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 35, i32 1 ; <<4 x float>*>:419 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 35, i32 2 ; <<4 x float>*>:420 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 35, i32 3 ; <<4 x float>*>:421 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 34, i32 1 ; <<4 x float>*>:422 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 34, i32 2 ; <<4 x float>*>:423 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 34, i32 3 ; <<4 x float>*>:424 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 33, i32 1 ; <<4 x float>*>:425 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 33, i32 2 ; <<4 x float>*>:426 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 33, i32 3 ; <<4 x float>*>:427 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 32, i32 1 ; <<4 x float>*>:428 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 32, i32 2 ; <<4 x float>*>:429 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 32, i32 3 ; <<4 x float>*>:430 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 31, i32 1 ; <<4 x float>*>:431 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 31, i32 2 ; <<4 x float>*>:432 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 31, i32 3 ; <<4 x float>*>:433 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 30, i32 1 ; <<4 x float>*>:434 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 30, i32 2 ; <<4 x float>*>:435 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 30, i32 3 ; <<4 x float>*>:436 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 29, i32 1 ; <<4 x float>*>:437 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 29, i32 2 ; <<4 x float>*>:438 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 29, i32 3 ; <<4 x float>*>:439 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 28, i32 1 ; <<4 x float>*>:440 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 28, i32 2 ; <<4 x float>*>:441 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 28, i32 3 ; <<4 x float>*>:442 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 27, i32 1 ; <<4 x float>*>:443 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 27, i32 2 ; <<4 x float>*>:444 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 27, i32 3 ; <<4 x float>*>:445 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 26, i32 1 ; <<4 x float>*>:446 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 26, i32 2 ; <<4 x float>*>:447 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 26, i32 3 ; <<4 x float>*>:448 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 25, i32 1 ; <<4 x float>*>:449 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 25, i32 2 ; <<4 x float>*>:450 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 25, i32 3 ; <<4 x float>*>:451 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 24, i32 1 ; <<4 x float>*>:452 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 24, i32 2 ; <<4 x float>*>:453 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 24, i32 3 ; <<4 x float>*>:454 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 23, i32 1 ; <<4 x float>*>:455 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 23, i32 2 ; <<4 x float>*>:456 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 23, i32 3 ; <<4 x float>*>:457 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 22, i32 1 ; <<4 x float>*>:458 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 22, i32 2 ; <<4 x float>*>:459 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 22, i32 3 ; <<4 x float>*>:460 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 21, i32 1 ; <<4 x float>*>:461 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 21, i32 2 ; <<4 x float>*>:462 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 21, i32 3 ; <<4 x float>*>:463 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 20, i32 1 ; <<4 x float>*>:464 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 20, i32 2 ; <<4 x float>*>:465 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 20, i32 3 ; <<4 x float>*>:466 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 19, i32 1 ; <<4 x float>*>:467 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 19, i32 2 ; <<4 x float>*>:468 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 19, i32 3 ; <<4 x float>*>:469 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 18, i32 1 ; <<4 x float>*>:470 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 18, i32 2 ; <<4 x float>*>:471 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 18, i32 3 ; <<4 x float>*>:472 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 17, i32 1 ; <<4 x float>*>:473 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 17, i32 2 ; <<4 x float>*>:474 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 17, i32 3 ; <<4 x float>*>:475 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 16, i32 1 ; <<4 x float>*>:476 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 16, i32 2 ; <<4 x float>*>:477 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 16, i32 3 ; <<4 x float>*>:478 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 15, i32 1 ; <<4 x float>*>:479 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 15, i32 2 ; <<4 x float>*>:480 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 15, i32 3 ; <<4 x float>*>:481 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 14, i32 1 ; <<4 x float>*>:482 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 14, i32 2 ; <<4 x float>*>:483 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 14, i32 3 ; <<4 x float>*>:484 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 4, i32 1 ; <<4 x float>*>:485 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 4, i32 2 ; <<4 x float>*>:486 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 4, i32 3 ; <<4 x float>*>:487 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 3, i32 1 ; <<4 x float>*>:488 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 3, i32 2 ; <<4 x float>*>:489 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 3, i32 3 ; <<4 x float>*>:490 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 180, i32 1 ; <<4 x float>*>:491 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 180, i32 2 ; <<4 x float>*>:492 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 180, i32 3 ; <<4 x float>*>:493 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 181, i32 1 ; <<4 x float>*>:494 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 181, i32 2 ; <<4 x float>*>:495 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 181, i32 3 ; <<4 x float>*>:496 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 182, i32 1 ; <<4 x float>*>:497 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 182, i32 2 ; <<4 x float>*>:498 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 182, i32 3 ; <<4 x float>*>:499 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 183, i32 1 ; <<4 x float>*>:500 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 183, i32 2 ; <<4 x float>*>:501 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 183, i32 3 ; <<4 x float>*>:502 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 184, i32 1 ; <<4 x float>*>:503 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 184, i32 2 ; <<4 x float>*>:504 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 184, i32 3 ; <<4 x float>*>:505 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 185, i32 1 ; <<4 x float>*>:506 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 185, i32 2 ; <<4 x float>*>:507 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 185, i32 3 ; <<4 x float>*>:508 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 190, i32 1 ; <<4 x float>*>:509 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 190, i32 2 ; <<4 x float>*>:510 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 190, i32 3 ; <<4 x float>*>:511 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 9, i32 1 ; <<4 x float>*>:512 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 9, i32 2 ; <<4 x float>*>:513 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 9, i32 3 ; <<4 x float>*>:514 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 10, i32 1 ; <<4 x float>*>:515 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 10, i32 2 ; <<4 x float>*>:516 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 10, i32 3 ; <<4 x float>*>:517 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 11, i32 1 ; <<4 x float>*>:518 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 11, i32 2 ; <<4 x float>*>:519 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 11, i32 3 ; <<4 x float>*>:520 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 12, i32 1 ; <<4 x float>*>:521 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 12, i32 2 ; <<4 x float>*>:522 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 12, i32 3 ; <<4 x float>*>:523 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 13, i32 1 ; <<4 x float>*>:524 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 13, i32 2 ; <<4 x float>*>:525 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 13, i32 3 ; <<4 x float>*>:526 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 5, i32 1 ; <<4 x float>*>:527 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 5, i32 2 ; <<4 x float>*>:528 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 5, i32 3 ; <<4 x float>*>:529 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 1, i32 1 ; <<4 x float>*>:530 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 1, i32 2 ; <<4 x float>*>:531 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 1, i32 3 ; <<4 x float>*>:532 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 2, i32 1 ; <<4 x float>*>:533 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 2, i32 2 ; <<4 x float>*>:534 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 2, i32 3 ; <<4 x float>*>:535 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 6, i32 1 ; <<4 x float>*>:536 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 6, i32 2 ; <<4 x float>*>:537 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 6, i32 3 ; <<4 x float>*>:538 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 7, i32 1 ; <<4 x float>*>:539 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 7, i32 2 ; <<4 x float>*>:540 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 7, i32 3 ; <<4 x float>*>:541 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 186, i32 1 ; <<4 x float>*>:542 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 186, i32 2 ; <<4 x float>*>:543 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 186, i32 3 ; <<4 x float>*>:544 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 187, i32 1 ; <<4 x float>*>:545 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 187, i32 2 ; <<4 x float>*>:546 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 187, i32 3 ; <<4 x float>*>:547 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 8, i32 1 ; <<4 x float>*>:548 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 8, i32 2 ; <<4 x float>*>:549 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 8, i32 3 ; <<4 x float>*>:550 [#uses=0]
- load <4 x float>* null ; <<4 x float>>:551 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 188, i32 1 ; <<4 x float>*>:552 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 188, i32 2 ; <<4 x float>*>:553 [#uses=1]
- load <4 x float>* %553 ; <<4 x float>>:554 [#uses=1]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 188, i32 3 ; <<4 x float>*>:555 [#uses=0]
- shufflevector <4 x float> %554, <4 x float> undef, <4 x i32> zeroinitializer ; <<4 x float>>:556 [#uses=1]
- call <4 x i32> @llvm.ppc.altivec.vcmpgtfp( <4 x float> zeroinitializer, <4 x float> %556 ) ; <<4 x i32>>:557 [#uses=0]
- bitcast <4 x i32> zeroinitializer to <4 x float> ; <<4 x float>>:558 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 189, i32 0 ; <<4 x float>*>:559 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 189, i32 2 ; <<4 x float>*>:560 [#uses=1]
- store <4 x float> zeroinitializer, <4 x float>* %560
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 189, i32 3 ; <<4 x float>*>:561 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 189, i32 1 ; <<4 x float>*>:562 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 189, i32 2 ; <<4 x float>*>:563 [#uses=0]
- load <4 x i32>* %.sub7896 ; <<4 x i32>>:564 [#uses=0]
- shufflevector <4 x float> zeroinitializer, <4 x float> zeroinitializer, <4 x i32> < i32 0, i32 5, i32 6, i32 7 > ; <<4 x float>>:565 [#uses=1]
- store <4 x float> %565, <4 x float>* null
- icmp eq i32 0, 0 ; <i1>:566 [#uses=1]
- br i1 %566, label %.critedge, label %xPIF.exit
-
-.critedge: ; preds = %xOperationInitMasks.exit
- getelementptr [4 x <4 x i32>]* null, i32 0, i32 3 ; <<4 x i32>*>:567 [#uses=0]
- and <4 x i32> zeroinitializer, zeroinitializer ; <<4 x i32>>:568 [#uses=0]
- or <4 x i32> zeroinitializer, zeroinitializer ; <<4 x i32>>:569 [#uses=0]
- icmp eq i32 0, 0 ; <i1>:570 [#uses=1]
- br i1 %570, label %.critedge7898, label %xPBRK.exit
-
-.critedge7898: ; preds = %.critedge
- br label %xPIF.exit
-
-xPIF.exit: ; preds = %.critedge7898, %xOperationInitMasks.exit
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 188, i32 1 ; <<4 x float>*>:571 [#uses=0]
- load <4 x float>* null ; <<4 x float>>:572 [#uses=0]
- shufflevector <4 x float> zeroinitializer, <4 x float> undef, <4 x i32> zeroinitializer ; <<4 x float>>:573 [#uses=0]
- icmp eq i32 0, 0 ; <i1>:574 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 3, i32 1 ; <<4 x float>*>:575 [#uses=0]
- load <4 x float>* %0 ; <<4 x float>>:576 [#uses=0]
- call i32 @llvm.ppc.altivec.vcmpequw.p( i32 0, <4 x i32> zeroinitializer, <4 x i32> zeroinitializer ) ; <i32>:577 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 2, i32 0 ; <<4 x float>*>:578 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 2, i32 1 ; <<4 x float>*>:579 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 2, i32 2 ; <<4 x float>*>:580 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 2, i32 3 ; <<4 x float>*>:581 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 1, i32 3 ; <<4 x float>*>:582 [#uses=0]
- load <4 x float>* null ; <<4 x float>>:583 [#uses=1]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 0, i32 1 ; <<4 x float>*>:584 [#uses=1]
- load <4 x float>* %584 ; <<4 x float>>:585 [#uses=1]
- load <4 x float>* null ; <<4 x float>>:586 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 0, i32 3 ; <<4 x float>*>:587 [#uses=1]
- load <4 x float>* %587 ; <<4 x float>>:588 [#uses=1]
- shufflevector <4 x float> %583, <4 x float> undef, <4 x i32> < i32 3, i32 3, i32 3, i32 3 > ; <<4 x float>>:589 [#uses=1]
- shufflevector <4 x float> %585, <4 x float> undef, <4 x i32> < i32 3, i32 3, i32 3, i32 3 > ; <<4 x float>>:590 [#uses=1]
- shufflevector <4 x float> %588, <4 x float> undef, <4 x i32> < i32 3, i32 3, i32 3, i32 3 > ; <<4 x float>>:591 [#uses=1]
- mul <4 x float> zeroinitializer, %589 ; <<4 x float>>:592 [#uses=0]
- mul <4 x float> zeroinitializer, %590 ; <<4 x float>>:593 [#uses=0]
- mul <4 x float> zeroinitializer, zeroinitializer ; <<4 x float>>:594 [#uses=1]
- mul <4 x float> zeroinitializer, %591 ; <<4 x float>>:595 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 4, i32 0 ; <<4 x float>*>:596 [#uses=2]
- load <4 x float>* %596 ; <<4 x float>>:597 [#uses=0]
- store <4 x float> zeroinitializer, <4 x float>* %596
- load <4 x float>* null ; <<4 x float>>:598 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 4, i32 2 ; <<4 x float>*>:599 [#uses=0]
- shufflevector <4 x float> %594, <4 x float> zeroinitializer, <4 x i32> < i32 0, i32 1, i32 2, i32 7 > ; <<4 x float>>:600 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 4, i32 3 ; <<4 x float>*>:601 [#uses=2]
- load <4 x float>* %601 ; <<4 x float>>:602 [#uses=0]
- store <4 x float> zeroinitializer, <4 x float>* %601
- load <4 x float>* null ; <<4 x float>>:603 [#uses=0]
- load <4 x float>* null ; <<4 x float>>:604 [#uses=1]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 4, i32 2 ; <<4 x float>*>:605 [#uses=1]
- load <4 x float>* %605 ; <<4 x float>>:606 [#uses=1]
- sub <4 x float> zeroinitializer, %604 ; <<4 x float>>:607 [#uses=2]
- sub <4 x float> zeroinitializer, %606 ; <<4 x float>>:608 [#uses=2]
- call i32 @llvm.ppc.altivec.vcmpequw.p( i32 0, <4 x i32> zeroinitializer, <4 x i32> zeroinitializer ) ; <i32>:609 [#uses=0]
- br i1 false, label %617, label %610
-
-; <label>:610 ; preds = %xPIF.exit
- load <4 x float>* null ; <<4 x float>>:611 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 0, i32 1 ; <<4 x float>*>:612 [#uses=2]
- load <4 x float>* %612 ; <<4 x float>>:613 [#uses=1]
- shufflevector <4 x float> %607, <4 x float> %613, <4 x i32> < i32 0, i32 1, i32 2, i32 7 > ; <<4 x float>>:614 [#uses=1]
- store <4 x float> %614, <4 x float>* %612
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 0, i32 3 ; <<4 x float>*>:615 [#uses=2]
- load <4 x float>* %615 ; <<4 x float>>:616 [#uses=0]
- store <4 x float> zeroinitializer, <4 x float>* %615
- br label %xST.exit400
-
-; <label>:617 ; preds = %xPIF.exit
- call i32 @llvm.ppc.altivec.vcmpequw.p( i32 0, <4 x i32> zeroinitializer, <4 x i32> zeroinitializer ) ; <i32>:618 [#uses=0]
- shufflevector <4 x i32> zeroinitializer, <4 x i32> undef, <4 x i32> < i32 1, i32 1, i32 1, i32 1 > ; <<4 x i32>>:619 [#uses=1]
- call i32 @llvm.ppc.altivec.vcmpequw.p( i32 0, <4 x i32> %619, <4 x i32> zeroinitializer ) ; <i32>:620 [#uses=1]
- icmp eq i32 %620, 0 ; <i1>:621 [#uses=1]
- br i1 %621, label %625, label %622
-
-; <label>:622 ; preds = %617
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 0, i32 1 ; <<4 x float>*>:623 [#uses=0]
- shufflevector <4 x float> %607, <4 x float> zeroinitializer, <4 x i32> < i32 0, i32 1, i32 2, i32 7 > ; <<4 x float>>:624 [#uses=0]
- br label %625
-
-; <label>:625 ; preds = %622, %617
- load <4 x i32>* %.sub7896 ; <<4 x i32>>:626 [#uses=0]
- call i32 @llvm.ppc.altivec.vcmpequw.p( i32 0, <4 x i32> zeroinitializer, <4 x i32> zeroinitializer ) ; <i32>:627 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 0, i32 2 ; <<4 x float>*>:628 [#uses=1]
- load <4 x float>* %628 ; <<4 x float>>:629 [#uses=0]
- load <4 x i32>* %.sub7896 ; <<4 x i32>>:630 [#uses=0]
- call i32 @llvm.ppc.altivec.vcmpequw.p( i32 0, <4 x i32> zeroinitializer, <4 x i32> zeroinitializer ) ; <i32>:631 [#uses=1]
- icmp eq i32 %631, 0 ; <i1>:632 [#uses=1]
- br i1 %632, label %xST.exit400, label %633
-
-; <label>:633 ; preds = %625
- load <4 x float>* null ; <<4 x float>>:634 [#uses=1]
- shufflevector <4 x float> zeroinitializer, <4 x float> %634, <4 x i32> < i32 0, i32 1, i32 2, i32 7 > ; <<4 x float>>:635 [#uses=1]
- store <4 x float> %635, <4 x float>* null
- br label %xST.exit400
-
-xST.exit400: ; preds = %633, %625, %610
- %.17218 = phi <4 x float> [ zeroinitializer, %610 ], [ %608, %633 ], [ %608, %625 ] ; <<4 x float>> [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 0, i32 0 ; <<4 x float>*>:636 [#uses=1]
- load <4 x float>* %636 ; <<4 x float>>:637 [#uses=0]
- load <4 x float>* null ; <<4 x float>>:638 [#uses=2]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 0, i32 2 ; <<4 x float>*>:639 [#uses=0]
- load <4 x float>* null ; <<4 x float>>:640 [#uses=2]
- mul <4 x float> %638, %638 ; <<4 x float>>:641 [#uses=1]
- mul <4 x float> zeroinitializer, zeroinitializer ; <<4 x float>>:642 [#uses=0]
- mul <4 x float> %640, %640 ; <<4 x float>>:643 [#uses=2]
- shufflevector <4 x float> zeroinitializer, <4 x float> undef, <4 x i32> < i32 1, i32 1, i32 1, i32 1 > ; <<4 x float>>:644 [#uses=0]
- shufflevector <4 x float> %643, <4 x float> undef, <4 x i32> < i32 1, i32 1, i32 1, i32 1 > ; <<4 x float>>:645 [#uses=1]
- add <4 x float> %645, %643 ; <<4 x float>>:646 [#uses=0]
- shufflevector <4 x float> zeroinitializer, <4 x float> undef, <4 x i32> < i32 2, i32 2, i32 2, i32 2 > ; <<4 x float>>:647 [#uses=1]
- shufflevector <4 x float> %641, <4 x float> undef, <4 x i32> < i32 2, i32 2, i32 2, i32 2 > ; <<4 x float>>:648 [#uses=1]
- add <4 x float> zeroinitializer, %647 ; <<4 x float>>:649 [#uses=2]
- add <4 x float> zeroinitializer, %648 ; <<4 x float>>:650 [#uses=0]
- add <4 x float> zeroinitializer, zeroinitializer ; <<4 x float>>:651 [#uses=2]
- call <4 x float> @llvm.ppc.altivec.vrsqrtefp( <4 x float> %649 ) ; <<4 x float>>:652 [#uses=1]
- mul <4 x float> %652, %649 ; <<4 x float>>:653 [#uses=1]
- call <4 x float> @llvm.ppc.altivec.vrsqrtefp( <4 x float> %651 ) ; <<4 x float>>:654 [#uses=1]
- mul <4 x float> %654, %651 ; <<4 x float>>:655 [#uses=0]
- icmp eq i32 0, 0 ; <i1>:656 [#uses=1]
- br i1 %656, label %665, label %657
-
-; <label>:657 ; preds = %xST.exit400
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 4, i32 0 ; <<4 x float>*>:658 [#uses=0]
- shufflevector <4 x float> %653, <4 x float> zeroinitializer, <4 x i32> < i32 0, i32 5, i32 6, i32 7 > ; <<4 x float>>:659 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 4, i32 1 ; <<4 x float>*>:660 [#uses=1]
- load <4 x float>* %660 ; <<4 x float>>:661 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 4, i32 2 ; <<4 x float>*>:662 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 4, i32 3 ; <<4 x float>*>:663 [#uses=0]
- shufflevector <4 x float> zeroinitializer, <4 x float> zeroinitializer, <4 x i32> < i32 0, i32 5, i32 6, i32 7 > ; <<4 x float>>:664 [#uses=0]
- br label %xST.exit402
-
-; <label>:665 ; preds = %xST.exit400
- call i32 @llvm.ppc.altivec.vcmpequw.p( i32 0, <4 x i32> zeroinitializer, <4 x i32> zeroinitializer ) ; <i32>:666 [#uses=0]
- br i1 false, label %669, label %667
-
-; <label>:667 ; preds = %665
- load <4 x float>* null ; <<4 x float>>:668 [#uses=0]
- br label %669
-
-; <label>:669 ; preds = %667, %665
- call i32 @llvm.ppc.altivec.vcmpequw.p( i32 0, <4 x i32> zeroinitializer, <4 x i32> zeroinitializer ) ; <i32>:670 [#uses=0]
- br label %xST.exit402
-
-xST.exit402: ; preds = %669, %657
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 1, i32 0 ; <<4 x float>*>:671 [#uses=0]
- load <4 x float>* null ; <<4 x float>>:672 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 1, i32 2 ; <<4 x float>*>:673 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 4, i32 1 ; <<4 x float>*>:674 [#uses=1]
- load <4 x float>* %674 ; <<4 x float>>:675 [#uses=1]
- load <4 x float>* null ; <<4 x float>>:676 [#uses=0]
- shufflevector <4 x float> zeroinitializer, <4 x float> undef, <4 x i32> zeroinitializer ; <<4 x float>>:677 [#uses=1]
- shufflevector <4 x float> %675, <4 x float> undef, <4 x i32> zeroinitializer ; <<4 x float>>:678 [#uses=1]
- mul <4 x float> zeroinitializer, %677 ; <<4 x float>>:679 [#uses=0]
- mul <4 x float> zeroinitializer, %678 ; <<4 x float>>:680 [#uses=0]
- mul <4 x float> zeroinitializer, zeroinitializer ; <<4 x float>>:681 [#uses=1]
- icmp eq i32 0, 0 ; <i1>:682 [#uses=1]
- br i1 %682, label %689, label %683
-
-; <label>:683 ; preds = %xST.exit402
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 5, i32 1 ; <<4 x float>*>:684 [#uses=1]
- load <4 x float>* %684 ; <<4 x float>>:685 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 5, i32 2 ; <<4 x float>*>:686 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 5, i32 3 ; <<4 x float>*>:687 [#uses=0]
- shufflevector <4 x float> %681, <4 x float> zeroinitializer, <4 x i32> < i32 0, i32 5, i32 6, i32 7 > ; <<4 x float>>:688 [#uses=0]
- br label %xST.exit405
-
-; <label>:689 ; preds = %xST.exit402
- shufflevector <4 x i32> zeroinitializer, <4 x i32> undef, <4 x i32> zeroinitializer ; <<4 x i32>>:690 [#uses=0]
- load <4 x i32>* %.sub7896 ; <<4 x i32>>:691 [#uses=1]
- shufflevector <4 x i32> %691, <4 x i32> undef, <4 x i32> < i32 3, i32 3, i32 3, i32 3 > ; <<4 x i32>>:692 [#uses=1]
- call i32 @llvm.ppc.altivec.vcmpequw.p( i32 0, <4 x i32> %692, <4 x i32> zeroinitializer ) ; <i32>:693 [#uses=1]
- icmp eq i32 %693, 0 ; <i1>:694 [#uses=0]
- br label %xST.exit405
-
-xST.exit405: ; preds = %689, %683
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 1, i32 3 ; <<4 x float>*>:695 [#uses=0]
- shufflevector <4 x float> zeroinitializer, <4 x float> undef, <4 x i32> zeroinitializer ; <<4 x float>>:696 [#uses=0]
- shufflevector <4 x float> zeroinitializer, <4 x float> undef, <4 x i32> zeroinitializer ; <<4 x float>>:697 [#uses=0]
- load <4 x float>* null ; <<4 x float>>:698 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 5, i32 2 ; <<4 x float>*>:699 [#uses=0]
- shufflevector <4 x float> zeroinitializer, <4 x float> undef, <4 x i32> zeroinitializer ; <<4 x float>>:700 [#uses=1]
- add <4 x float> zeroinitializer, %700 ; <<4 x float>>:701 [#uses=0]
- load <4 x i32>* %.sub7896 ; <<4 x i32>>:702 [#uses=1]
- call i32 @llvm.ppc.altivec.vcmpequw.p( i32 0, <4 x i32> %702, <4 x i32> zeroinitializer ) ; <i32>:703 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 1, i32 1 ; <<4 x float>*>:704 [#uses=2]
- load <4 x float>* %704 ; <<4 x float>>:705 [#uses=0]
- store <4 x float> zeroinitializer, <4 x float>* %704
- load <4 x float>* null ; <<4 x float>>:706 [#uses=0]
- store <4 x float> zeroinitializer, <4 x float>* null
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 1, i32 3 ; <<4 x float>*>:707 [#uses=2]
- load <4 x float>* %707 ; <<4 x float>>:708 [#uses=0]
- store <4 x float> zeroinitializer, <4 x float>* %707
- load <4 x float>* null ; <<4 x float>>:709 [#uses=0]
- load <4 x float>* null ; <<4 x float>>:710 [#uses=0]
- load <4 x float>* null ; <<4 x float>>:711 [#uses=1]
- shufflevector <4 x float> %711, <4 x float> undef, <4 x i32> < i32 2, i32 2, i32 2, i32 2 > ; <<4 x float>>:712 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 4, i32 1 ; <<4 x float>*>:713 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 4, i32 2 ; <<4 x float>*>:714 [#uses=1]
- load <4 x float>* %714 ; <<4 x float>>:715 [#uses=0]
- shufflevector <4 x float> zeroinitializer, <4 x float> undef, <4 x i32> zeroinitializer ; <<4 x float>>:716 [#uses=0]
- mul <4 x float> zeroinitializer, zeroinitializer ; <<4 x float>>:717 [#uses=1]
- load <4 x i32>* %.sub7896 ; <<4 x i32>>:718 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 5, i32 0 ; <<4 x float>*>:719 [#uses=1]
- store <4 x float> zeroinitializer, <4 x float>* %719
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 5, i32 1 ; <<4 x float>*>:720 [#uses=1]
- shufflevector <4 x float> %717, <4 x float> zeroinitializer, <4 x i32> < i32 0, i32 5, i32 6, i32 7 > ; <<4 x float>>:721 [#uses=1]
- store <4 x float> %721, <4 x float>* %720
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 5, i32 2 ; <<4 x float>*>:722 [#uses=1]
- load <4 x float>* %722 ; <<4 x float>>:723 [#uses=1]
- shufflevector <4 x float> zeroinitializer, <4 x float> %723, <4 x i32> < i32 0, i32 5, i32 6, i32 7 > ; <<4 x float>>:724 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 5, i32 3 ; <<4 x float>*>:725 [#uses=1]
- store <4 x float> zeroinitializer, <4 x float>* %725
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 5, i32 2 ; <<4 x float>*>:726 [#uses=1]
- load <4 x float>* %726 ; <<4 x float>>:727 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 5, i32 3 ; <<4 x float>*>:728 [#uses=1]
- load <4 x float>* %728 ; <<4 x float>>:729 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 4, i32 0 ; <<4 x float>*>:730 [#uses=1]
- load <4 x float>* %730 ; <<4 x float>>:731 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 4, i32 1 ; <<4 x float>*>:732 [#uses=1]
- load <4 x float>* %732 ; <<4 x float>>:733 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 4, i32 3 ; <<4 x float>*>:734 [#uses=0]
- shufflevector <4 x float> zeroinitializer, <4 x float> undef, <4 x i32> zeroinitializer ; <<4 x float>>:735 [#uses=1]
- mul <4 x float> zeroinitializer, zeroinitializer ; <<4 x float>>:736 [#uses=1]
- mul <4 x float> zeroinitializer, zeroinitializer ; <<4 x float>>:737 [#uses=1]
- mul <4 x float> zeroinitializer, %735 ; <<4 x float>>:738 [#uses=1]
- mul <4 x float> zeroinitializer, zeroinitializer ; <<4 x float>>:739 [#uses=1]
- call i32 @llvm.ppc.altivec.vcmpequw.p( i32 0, <4 x i32> zeroinitializer, <4 x i32> zeroinitializer ) ; <i32>:740 [#uses=1]
- icmp eq i32 %740, 0 ; <i1>:741 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 4, i32 0 ; <<4 x float>*>:742 [#uses=2]
- load <4 x float>* %742 ; <<4 x float>>:743 [#uses=1]
- shufflevector <4 x float> %736, <4 x float> %743, <4 x i32> < i32 0, i32 5, i32 6, i32 7 > ; <<4 x float>>:744 [#uses=1]
- store <4 x float> %744, <4 x float>* %742
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 4, i32 1 ; <<4 x float>*>:745 [#uses=1]
- load <4 x float>* %745 ; <<4 x float>>:746 [#uses=1]
- shufflevector <4 x float> %737, <4 x float> %746, <4 x i32> < i32 0, i32 5, i32 6, i32 7 > ; <<4 x float>>:747 [#uses=0]
- shufflevector <4 x float> %738, <4 x float> zeroinitializer, <4 x i32> < i32 0, i32 5, i32 6, i32 7 > ; <<4 x float>>:748 [#uses=1]
- store <4 x float> %748, <4 x float>* null
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 4, i32 3 ; <<4 x float>*>:749 [#uses=1]
- load <4 x float>* %749 ; <<4 x float>>:750 [#uses=1]
- shufflevector <4 x float> %739, <4 x float> %750, <4 x i32> < i32 0, i32 5, i32 6, i32 7 > ; <<4 x float>>:751 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 1, i32 0 ; <<4 x float>*>:752 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 1, i32 1 ; <<4 x float>*>:753 [#uses=1]
- load <4 x float>* %753 ; <<4 x float>>:754 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 1, i32 2 ; <<4 x float>*>:755 [#uses=0]
- load <4 x float>* null ; <<4 x float>>:756 [#uses=1]
- shufflevector <4 x float> zeroinitializer, <4 x float> undef, <4 x i32> zeroinitializer ; <<4 x float>>:757 [#uses=1]
- shufflevector <4 x float> %756, <4 x float> undef, <4 x i32> zeroinitializer ; <<4 x float>>:758 [#uses=1]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 4, i32 2 ; <<4 x float>*>:759 [#uses=1]
- load <4 x float>* %759 ; <<4 x float>>:760 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 4, i32 3 ; <<4 x float>*>:761 [#uses=0]
- shufflevector <4 x float> zeroinitializer, <4 x float> undef, <4 x i32> zeroinitializer ; <<4 x float>>:762 [#uses=0]
- shufflevector <4 x float> zeroinitializer, <4 x float> undef, <4 x i32> zeroinitializer ; <<4 x float>>:763 [#uses=1]
- add <4 x float> %757, zeroinitializer ; <<4 x float>>:764 [#uses=0]
- add <4 x float> %758, %763 ; <<4 x float>>:765 [#uses=0]
- mul <4 x float> zeroinitializer, zeroinitializer ; <<4 x float>>:766 [#uses=1]
- br i1 false, label %773, label %767
-
-; <label>:767 ; preds = %xST.exit405
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 0, i32 1 ; <<4 x float>*>:768 [#uses=0]
- load <4 x float>* null ; <<4 x float>>:769 [#uses=1]
- shufflevector <4 x float> zeroinitializer, <4 x float> %769, <4 x i32> < i32 0, i32 1, i32 2, i32 7 > ; <<4 x float>>:770 [#uses=1]
- store <4 x float> %770, <4 x float>* null
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 0, i32 3 ; <<4 x float>*>:771 [#uses=1]
- load <4 x float>* %771 ; <<4 x float>>:772 [#uses=0]
- br label %xST.exit422
-
-; <label>:773 ; preds = %xST.exit405
- br label %xST.exit422
-
-xST.exit422: ; preds = %773, %767
- %.07267 = phi <4 x float> [ %766, %767 ], [ undef, %773 ] ; <<4 x float>> [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 0, i32 3 ; <<4 x float>*>:774 [#uses=0]
- mul <4 x float> zeroinitializer, zeroinitializer ; <<4 x float>>:775 [#uses=0]
- icmp eq i32 0, 0 ; <i1>:776 [#uses=1]
- br i1 %776, label %780, label %777
-
-; <label>:777 ; preds = %xST.exit422
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 0, i32 2 ; <<4 x float>*>:778 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 0, i32 3 ; <<4 x float>*>:779 [#uses=0]
- br label %xST.exit431
-
-; <label>:780 ; preds = %xST.exit422
- load <4 x i32>* %.sub7896 ; <<4 x i32>>:781 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 0, i32 2 ; <<4 x float>*>:782 [#uses=2]
- load <4 x float>* %782 ; <<4 x float>>:783 [#uses=0]
- store <4 x float> zeroinitializer, <4 x float>* %782
- load <4 x i32>* %.sub7896 ; <<4 x i32>>:784 [#uses=1]
- shufflevector <4 x i32> %784, <4 x i32> undef, <4 x i32> < i32 3, i32 3, i32 3, i32 3 > ; <<4 x i32>>:785 [#uses=0]
- icmp eq i32 0, 0 ; <i1>:786 [#uses=0]
- br label %xST.exit431
-
-xST.exit431: ; preds = %780, %777
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 0, i32 2 ; <<4 x float>*>:787 [#uses=0]
- load <4 x float>* null ; <<4 x float>>:788 [#uses=0]
- load <4 x i32>* %.sub7896 ; <<4 x i32>>:789 [#uses=2]
- call i32 @llvm.ppc.altivec.vcmpequw.p( i32 0, <4 x i32> %789, <4 x i32> zeroinitializer ) ; <i32>:790 [#uses=1]
- icmp eq i32 %790, 0 ; <i1>:791 [#uses=0]
- shufflevector <4 x i32> %789, <4 x i32> undef, <4 x i32> zeroinitializer ; <<4 x i32>>:792 [#uses=1]
- call i32 @llvm.ppc.altivec.vcmpequw.p( i32 0, <4 x i32> %792, <4 x i32> zeroinitializer ) ; <i32>:793 [#uses=1]
- icmp eq i32 %793, 0 ; <i1>:794 [#uses=1]
- br i1 %794, label %797, label %795
-
-; <label>:795 ; preds = %xST.exit431
- load <4 x float>* null ; <<4 x float>>:796 [#uses=0]
- store <4 x float> zeroinitializer, <4 x float>* null
- br label %797
-
-; <label>:797 ; preds = %795, %xST.exit431
- %.07332 = phi <4 x float> [ zeroinitializer, %795 ], [ undef, %xST.exit431 ] ; <<4 x float>> [#uses=0]
- shufflevector <4 x i32> zeroinitializer, <4 x i32> undef, <4 x i32> < i32 1, i32 1, i32 1, i32 1 > ; <<4 x i32>>:798 [#uses=0]
- br i1 false, label %xST.exit434, label %799
-
-; <label>:799 ; preds = %797
- load <4 x float>* null ; <<4 x float>>:800 [#uses=0]
- store <4 x float> zeroinitializer, <4 x float>* null
- br label %xST.exit434
-
-xST.exit434: ; preds = %799, %797
- load <4 x i32>* %.sub7896 ; <<4 x i32>>:801 [#uses=1]
- shufflevector <4 x i32> %801, <4 x i32> undef, <4 x i32> < i32 2, i32 2, i32 2, i32 2 > ; <<4 x i32>>:802 [#uses=0]
- shufflevector <4 x i32> zeroinitializer, <4 x i32> undef, <4 x i32> < i32 3, i32 3, i32 3, i32 3 > ; <<4 x i32>>:803 [#uses=0]
- icmp eq i32 0, 0 ; <i1>:804 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 0, i32 0 ; <<4 x float>*>:805 [#uses=1]
- load <4 x float>* %805 ; <<4 x float>>:806 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 0, i32 1 ; <<4 x float>*>:807 [#uses=1]
- load <4 x float>* %807 ; <<4 x float>>:808 [#uses=0]
- load <4 x float>* null ; <<4 x float>>:809 [#uses=0]
- load <4 x float>* null ; <<4 x float>>:810 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 1, i32 0 ; <<4 x float>*>:811 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 1, i32 2 ; <<4 x float>*>:812 [#uses=1]
- load <4 x float>* %812 ; <<4 x float>>:813 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 1, i32 3 ; <<4 x float>*>:814 [#uses=1]
- load <4 x float>* %814 ; <<4 x float>>:815 [#uses=0]
- shufflevector <4 x float> zeroinitializer, <4 x float> undef, <4 x i32> zeroinitializer ; <<4 x float>>:816 [#uses=0]
- unreachable
-
-xPBRK.exit: ; preds = %.critedge
- store <4 x i32> < i32 -1, i32 -1, i32 -1, i32 -1 >, <4 x i32>* %.sub7896
- store <4 x i32> zeroinitializer, <4 x i32>* null
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 186, i32 1 ; <<4 x float>*>:817 [#uses=1]
- load <4 x float>* %817 ; <<4 x float>>:818 [#uses=1]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 186, i32 2 ; <<4 x float>*>:819 [#uses=1]
- load <4 x float>* %819 ; <<4 x float>>:820 [#uses=1]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 186, i32 3 ; <<4 x float>*>:821 [#uses=1]
- load <4 x float>* %821 ; <<4 x float>>:822 [#uses=1]
- shufflevector <4 x float> zeroinitializer, <4 x float> undef, <4 x i32> zeroinitializer ; <<4 x float>>:823 [#uses=1]
- shufflevector <4 x float> %818, <4 x float> undef, <4 x i32> zeroinitializer ; <<4 x float>>:824 [#uses=1]
- shufflevector <4 x float> %820, <4 x float> undef, <4 x i32> zeroinitializer ; <<4 x float>>:825 [#uses=1]
- shufflevector <4 x float> %822, <4 x float> undef, <4 x i32> zeroinitializer ; <<4 x float>>:826 [#uses=1]
- shufflevector <4 x float> %823, <4 x float> zeroinitializer, <4 x i32> < i32 0, i32 5, i32 6, i32 7 > ; <<4 x float>>:827 [#uses=0]
- shufflevector <4 x float> %824, <4 x float> zeroinitializer, <4 x i32> < i32 0, i32 5, i32 6, i32 7 > ; <<4 x float>>:828 [#uses=1]
- store <4 x float> %828, <4 x float>* null
- load <4 x float>* null ; <<4 x float>>:829 [#uses=1]
- shufflevector <4 x float> %825, <4 x float> %829, <4 x i32> < i32 0, i32 5, i32 6, i32 7 > ; <<4 x float>>:830 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 186, i32 3 ; <<4 x float>*>:831 [#uses=2]
- load <4 x float>* %831 ; <<4 x float>>:832 [#uses=1]
- shufflevector <4 x float> %826, <4 x float> %832, <4 x i32> < i32 0, i32 5, i32 6, i32 7 > ; <<4 x float>>:833 [#uses=1]
- store <4 x float> %833, <4 x float>* %831
- br label %xLS.exit449
-
-xLS.exit449: ; preds = %1215, %xPBRK.exit
- %.27464 = phi <4 x float> [ undef, %xPBRK.exit ], [ %.17463, %1215 ] ; <<4 x float>> [#uses=2]
- %.27469 = phi <4 x float> [ undef, %xPBRK.exit ], [ %.17468, %1215 ] ; <<4 x float>> [#uses=2]
- %.27474 = phi <4 x float> [ undef, %xPBRK.exit ], [ zeroinitializer, %1215 ] ; <<4 x float>> [#uses=1]
- %.17482 = phi <4 x float> [ undef, %xPBRK.exit ], [ zeroinitializer, %1215 ] ; <<4 x float>> [#uses=0]
- %.17486 = phi <4 x float> [ undef, %xPBRK.exit ], [ zeroinitializer, %1215 ] ; <<4 x float>> [#uses=0]
- %.17490 = phi <4 x float> [ undef, %xPBRK.exit ], [ %.07489, %1215 ] ; <<4 x float>> [#uses=2]
- %.17494 = phi <4 x float> [ undef, %xPBRK.exit ], [ zeroinitializer, %1215 ] ; <<4 x float>> [#uses=0]
- %.27504 = phi <4 x float> [ undef, %xPBRK.exit ], [ zeroinitializer, %1215 ] ; <<4 x float>> [#uses=0]
- %.17513 = phi <4 x float> [ undef, %xPBRK.exit ], [ zeroinitializer, %1215 ] ; <<4 x float>> [#uses=0]
- %.17517 = phi <4 x float> [ undef, %xPBRK.exit ], [ zeroinitializer, %1215 ] ; <<4 x float>> [#uses=0]
- %.17552 = phi <4 x float> [ undef, %xPBRK.exit ], [ %.07551, %1215 ] ; <<4 x float>> [#uses=2]
- %.17556 = phi <4 x float> [ undef, %xPBRK.exit ], [ %.07555, %1215 ] ; <<4 x float>> [#uses=2]
- %.17560 = phi <4 x float> [ undef, %xPBRK.exit ], [ zeroinitializer, %1215 ] ; <<4 x float>> [#uses=0]
- %.17583 = phi <4 x float> [ undef, %xPBRK.exit ], [ %.07582, %1215 ] ; <<4 x float>> [#uses=2]
- %.17591 = phi <4 x float> [ undef, %xPBRK.exit ], [ %.07590, %1215 ] ; <<4 x float>> [#uses=2]
- %.17599 = phi <4 x float> [ undef, %xPBRK.exit ], [ zeroinitializer, %1215 ] ; <<4 x float>> [#uses=0]
- %.17618 = phi <4 x float> [ undef, %xPBRK.exit ], [ %.07617, %1215 ] ; <<4 x float>> [#uses=2]
- %.17622 = phi <4 x float> [ undef, %xPBRK.exit ], [ %.07621, %1215 ] ; <<4 x float>> [#uses=2]
- %.17626 = phi <4 x float> [ undef, %xPBRK.exit ], [ zeroinitializer, %1215 ] ; <<4 x float>> [#uses=0]
- %.17653 = phi <4 x float> [ undef, %xPBRK.exit ], [ %.07652, %1215 ] ; <<4 x float>> [#uses=2]
- %.17657 = phi <4 x float> [ undef, %xPBRK.exit ], [ %.07656, %1215 ] ; <<4 x float>> [#uses=2]
- %.17661 = phi <4 x float> [ undef, %xPBRK.exit ], [ %.07660, %1215 ] ; <<4 x float>> [#uses=2]
- %.17665 = phi <4 x float> [ undef, %xPBRK.exit ], [ %.07664, %1215 ] ; <<4 x float>> [#uses=2]
- %.17723 = phi <4 x float> [ undef, %xPBRK.exit ], [ %.07722, %1215 ] ; <<4 x float>> [#uses=2]
- %.17727 = phi <4 x float> [ undef, %xPBRK.exit ], [ %.07726, %1215 ] ; <<4 x float>> [#uses=2]
- %.17731 = phi <4 x float> [ undef, %xPBRK.exit ], [ %.07730, %1215 ] ; <<4 x float>> [#uses=2]
- %.17735 = phi <4 x float> [ undef, %xPBRK.exit ], [ %.07734, %1215 ] ; <<4 x float>> [#uses=2]
- %.17770 = phi <4 x float> [ undef, %xPBRK.exit ], [ %.07769, %1215 ] ; <<4 x float>> [#uses=2]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 186, i32 0 ; <<4 x float>*>:834 [#uses=0]
- load <4 x float>* null ; <<4 x float>>:835 [#uses=1]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 186, i32 2 ; <<4 x float>*>:836 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 186, i32 3 ; <<4 x float>*>:837 [#uses=0]
- shufflevector <4 x float> zeroinitializer, <4 x float> undef, <4 x i32> zeroinitializer ; <<4 x float>>:838 [#uses=0]
- shufflevector <4 x float> %835, <4 x float> undef, <4 x i32> zeroinitializer ; <<4 x float>>:839 [#uses=1]
- getelementptr <4 x float>* null, i32 878 ; <<4 x float>*>:840 [#uses=1]
- load <4 x float>* %840 ; <<4 x float>>:841 [#uses=0]
- call <4 x float> @llvm.ppc.altivec.vcfsx( <4 x i32> zeroinitializer, i32 0 ) ; <<4 x float>>:842 [#uses=1]
- shufflevector <4 x float> %842, <4 x float> undef, <4 x i32> zeroinitializer ; <<4 x float>>:843 [#uses=2]
- call <4 x i32> @llvm.ppc.altivec.vcmpgtfp( <4 x float> %843, <4 x float> %839 ) ; <<4 x i32>>:844 [#uses=1]
- bitcast <4 x i32> %844 to <4 x float> ; <<4 x float>>:845 [#uses=1]
- call <4 x i32> @llvm.ppc.altivec.vcmpgtfp( <4 x float> %843, <4 x float> zeroinitializer ) ; <<4 x i32>>:846 [#uses=0]
- bitcast <4 x i32> zeroinitializer to <4 x float> ; <<4 x float>>:847 [#uses=1]
- icmp eq i32 0, 0 ; <i1>:848 [#uses=1]
- br i1 %848, label %854, label %849
-
-; <label>:849 ; preds = %xLS.exit449
- shufflevector <4 x float> zeroinitializer, <4 x float> zeroinitializer, <4 x i32> < i32 0, i32 5, i32 6, i32 7 > ; <<4 x float>>:850 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 189, i32 1 ; <<4 x float>*>:851 [#uses=1]
- store <4 x float> zeroinitializer, <4 x float>* %851
- shufflevector <4 x float> zeroinitializer, <4 x float> zeroinitializer, <4 x i32> < i32 0, i32 5, i32 6, i32 7 > ; <<4 x float>>:852 [#uses=1]
- store <4 x float> %852, <4 x float>* null
- shufflevector <4 x float> %847, <4 x float> zeroinitializer, <4 x i32> < i32 0, i32 5, i32 6, i32 7 > ; <<4 x float>>:853 [#uses=0]
- br label %xST.exit451
-
-; <label>:854 ; preds = %xLS.exit449
- call i32 @llvm.ppc.altivec.vcmpequw.p( i32 0, <4 x i32> zeroinitializer, <4 x i32> zeroinitializer ) ; <i32>:855 [#uses=0]
- br i1 false, label %859, label %856
-
-; <label>:856 ; preds = %854
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 189, i32 0 ; <<4 x float>*>:857 [#uses=2]
- load <4 x float>* %857 ; <<4 x float>>:858 [#uses=0]
- store <4 x float> zeroinitializer, <4 x float>* %857
- br label %859
-
-; <label>:859 ; preds = %856, %854
- call i32 @llvm.ppc.altivec.vcmpequw.p( i32 0, <4 x i32> zeroinitializer, <4 x i32> zeroinitializer ) ; <i32>:860 [#uses=0]
- br i1 false, label %864, label %861
-
-; <label>:861 ; preds = %859
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 189, i32 1 ; <<4 x float>*>:862 [#uses=1]
- shufflevector <4 x float> %845, <4 x float> zeroinitializer, <4 x i32> < i32 0, i32 5, i32 6, i32 7 > ; <<4 x float>>:863 [#uses=1]
- store <4 x float> %863, <4 x float>* %862
- br label %864
-
-; <label>:864 ; preds = %861, %859
- load <4 x i32>* %.sub7896 ; <<4 x i32>>:865 [#uses=1]
- shufflevector <4 x i32> %865, <4 x i32> undef, <4 x i32> < i32 2, i32 2, i32 2, i32 2 > ; <<4 x i32>>:866 [#uses=0]
- br i1 false, label %868, label %867
-
-; <label>:867 ; preds = %864
- store <4 x float> zeroinitializer, <4 x float>* null
- br label %868
-
-; <label>:868 ; preds = %867, %864
- shufflevector <4 x i32> zeroinitializer, <4 x i32> undef, <4 x i32> < i32 3, i32 3, i32 3, i32 3 > ; <<4 x i32>>:869 [#uses=0]
- br label %xST.exit451
-
-xST.exit451: ; preds = %868, %849
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 189, i32 0 ; <<4 x float>*>:870 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 189, i32 1 ; <<4 x float>*>:871 [#uses=0]
- load <4 x float>* null ; <<4 x float>>:872 [#uses=0]
- shufflevector <4 x float> zeroinitializer, <4 x float> undef, <4 x i32> zeroinitializer ; <<4 x float>>:873 [#uses=1]
- bitcast <4 x float> zeroinitializer to <4 x i32> ; <<4 x i32>>:874 [#uses=1]
- xor <4 x i32> %874, < i32 -1, i32 -1, i32 -1, i32 -1 > ; <<4 x i32>>:875 [#uses=0]
- bitcast <4 x float> %873 to <4 x i32> ; <<4 x i32>>:876 [#uses=1]
- xor <4 x i32> %876, < i32 -1, i32 -1, i32 -1, i32 -1 > ; <<4 x i32>>:877 [#uses=0]
- bitcast <4 x float> zeroinitializer to <4 x i32> ; <<4 x i32>>:878 [#uses=1]
- xor <4 x i32> %878, < i32 -1, i32 -1, i32 -1, i32 -1 > ; <<4 x i32>>:879 [#uses=1]
- bitcast <4 x i32> %879 to <4 x float> ; <<4 x float>>:880 [#uses=0]
- load <4 x i32>* %.sub7896 ; <<4 x i32>>:881 [#uses=1]
- icmp eq i32 0, 0 ; <i1>:882 [#uses=1]
- br i1 %882, label %888, label %883
-
-; <label>:883 ; preds = %xST.exit451
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 189, i32 0 ; <<4 x float>*>:884 [#uses=1]
- store <4 x float> zeroinitializer, <4 x float>* %884
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 189, i32 1 ; <<4 x float>*>:885 [#uses=0]
- shufflevector <4 x float> zeroinitializer, <4 x float> zeroinitializer, <4 x i32> < i32 0, i32 5, i32 6, i32 7 > ; <<4 x float>>:886 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 189, i32 3 ; <<4 x float>*>:887 [#uses=0]
- br label %xST.exit453
-
-; <label>:888 ; preds = %xST.exit451
- shufflevector <4 x i32> %881, <4 x i32> undef, <4 x i32> zeroinitializer ; <<4 x i32>>:889 [#uses=0]
- call i32 @llvm.ppc.altivec.vcmpequw.p( i32 0, <4 x i32> zeroinitializer, <4 x i32> zeroinitializer ) ; <i32>:890 [#uses=0]
- br i1 false, label %894, label %891
-
-; <label>:891 ; preds = %888
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 189, i32 1 ; <<4 x float>*>:892 [#uses=1]
- shufflevector <4 x float> zeroinitializer, <4 x float> zeroinitializer, <4 x i32> < i32 0, i32 5, i32 6, i32 7 > ; <<4 x float>>:893 [#uses=1]
- store <4 x float> %893, <4 x float>* %892
- br label %894
-
-; <label>:894 ; preds = %891, %888
- call i32 @llvm.ppc.altivec.vcmpequw.p( i32 0, <4 x i32> zeroinitializer, <4 x i32> zeroinitializer ) ; <i32>:895 [#uses=1]
- icmp eq i32 %895, 0 ; <i1>:896 [#uses=1]
- br i1 %896, label %898, label %897
-
-; <label>:897 ; preds = %894
- br label %898
-
-; <label>:898 ; preds = %897, %894
- load <4 x i32>* %.sub7896 ; <<4 x i32>>:899 [#uses=0]
- br i1 false, label %xST.exit453, label %900
-
-; <label>:900 ; preds = %898
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 189, i32 3 ; <<4 x float>*>:901 [#uses=1]
- load <4 x float>* %901 ; <<4 x float>>:902 [#uses=1]
- shufflevector <4 x float> zeroinitializer, <4 x float> %902, <4 x i32> < i32 0, i32 5, i32 6, i32 7 > ; <<4 x float>>:903 [#uses=0]
- br label %xST.exit453
-
-xST.exit453: ; preds = %900, %898, %883
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 189, i32 1 ; <<4 x float>*>:904 [#uses=0]
- load <4 x float>* null ; <<4 x float>>:905 [#uses=1]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 189, i32 3 ; <<4 x float>*>:906 [#uses=0]
- shufflevector <4 x float> zeroinitializer, <4 x float> undef, <4 x i32> zeroinitializer ; <<4 x float>>:907 [#uses=1]
- shufflevector <4 x float> %905, <4 x float> undef, <4 x i32> zeroinitializer ; <<4 x float>>:908 [#uses=1]
- bitcast <4 x float> zeroinitializer to <4 x i32> ; <<4 x i32>>:909 [#uses=0]
- bitcast <4 x float> %908 to <4 x i32> ; <<4 x i32>>:910 [#uses=0]
- bitcast <4 x float> %907 to <4 x i32> ; <<4 x i32>>:911 [#uses=0]
- bitcast <4 x float> zeroinitializer to <4 x i32> ; <<4 x i32>>:912 [#uses=0]
- load <4 x i32>* %.sub7896 ; <<4 x i32>>:913 [#uses=0]
- call i32 @llvm.ppc.altivec.vcmpequw.p( i32 2, <4 x i32> zeroinitializer, <4 x i32> zeroinitializer ) ; <i32>:914 [#uses=0]
- br i1 false, label %915, label %xPIF.exit455
-
-; <label>:915 ; preds = %xST.exit453
- load <4 x i32>* %.sub7896 ; <<4 x i32>>:916 [#uses=0]
- getelementptr [4 x <4 x i32>]* null, i32 0, i32 3 ; <<4 x i32>*>:917 [#uses=1]
- store <4 x i32> zeroinitializer, <4 x i32>* %917
- load <4 x i32>* %.sub7896 ; <<4 x i32>>:918 [#uses=1]
- and <4 x i32> %918, zeroinitializer ; <<4 x i32>>:919 [#uses=0]
- br label %.critedge7899
-
-.critedge7899: ; preds = %.critedge7899, %915
- or <4 x i32> zeroinitializer, zeroinitializer ; <<4 x i32>>:920 [#uses=1]
- br i1 false, label %.critedge7899, label %xPBRK.exit456
-
-xPBRK.exit456: ; preds = %.critedge7899
- call i32 @llvm.ppc.altivec.vcmpequw.p( i32 2, <4 x i32> %920, <4 x i32> zeroinitializer ) ; <i32>:921 [#uses=0]
- unreachable
-
-xPIF.exit455: ; preds = %xST.exit453
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 186, i32 0 ; <<4 x float>*>:922 [#uses=1]
- load <4 x float>* %922 ; <<4 x float>>:923 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 186, i32 1 ; <<4 x float>*>:924 [#uses=1]
- load <4 x float>* %924 ; <<4 x float>>:925 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 186, i32 2 ; <<4 x float>*>:926 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 186, i32 3 ; <<4 x float>*>:927 [#uses=0]
- shufflevector <4 x float> zeroinitializer, <4 x float> undef, <4 x i32> zeroinitializer ; <<4 x float>>:928 [#uses=0]
- bitcast { { i16, i16, i32 } }* %1 to <4 x float>* ; <<4 x float>*>:929 [#uses=0]
- bitcast <4 x float> zeroinitializer to <4 x i32> ; <<4 x i32>>:930 [#uses=0]
- load <4 x i32>* %.sub7896 ; <<4 x i32>>:931 [#uses=0]
- icmp eq i32 0, 0 ; <i1>:932 [#uses=1]
- br i1 %932, label %934, label %933
-
-; <label>:933 ; preds = %xPIF.exit455
- store <4 x float> zeroinitializer, <4 x float>* null
- br label %934
-
-; <label>:934 ; preds = %933, %xPIF.exit455
- shufflevector <4 x i32> zeroinitializer, <4 x i32> undef, <4 x i32> < i32 1, i32 1, i32 1, i32 1 > ; <<4 x i32>>:935 [#uses=0]
- icmp eq i32 0, 0 ; <i1>:936 [#uses=1]
- br i1 %936, label %xST.exit459, label %937
-
-; <label>:937 ; preds = %934
- br label %xST.exit459
-
-xST.exit459: ; preds = %937, %934
- shufflevector <4 x i32> zeroinitializer, <4 x i32> undef, <4 x i32> < i32 2, i32 2, i32 2, i32 2 > ; <<4 x i32>>:938 [#uses=1]
- call i32 @llvm.ppc.altivec.vcmpequw.p( i32 0, <4 x i32> %938, <4 x i32> zeroinitializer ) ; <i32>:939 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 188, i32 2 ; <<4 x float>*>:940 [#uses=1]
- store <4 x float> zeroinitializer, <4 x float>* %940
- load <4 x float>* null ; <<4 x float>>:941 [#uses=1]
- shufflevector <4 x float> zeroinitializer, <4 x float> %941, <4 x i32> < i32 0, i32 5, i32 6, i32 7 > ; <<4 x float>>:942 [#uses=1]
- store <4 x float> %942, <4 x float>* null
- shufflevector <4 x float> zeroinitializer, <4 x float> undef, <4 x i32> zeroinitializer ; <<4 x float>>:943 [#uses=0]
- load <4 x i32>* %.sub7896 ; <<4 x i32>>:944 [#uses=0]
- call i32 @llvm.ppc.altivec.vcmpequw.p( i32 0, <4 x i32> zeroinitializer, <4 x i32> zeroinitializer ) ; <i32>:945 [#uses=0]
- br i1 false, label %947, label %946
-
-; <label>:946 ; preds = %xST.exit459
- br label %947
-
-; <label>:947 ; preds = %946, %xST.exit459
- shufflevector <4 x i32> zeroinitializer, <4 x i32> undef, <4 x i32> < i32 1, i32 1, i32 1, i32 1 > ; <<4 x i32>>:948 [#uses=0]
- icmp eq i32 0, 0 ; <i1>:949 [#uses=1]
- br i1 %949, label %952, label %950
-
-; <label>:950 ; preds = %947
- shufflevector <4 x i32> zeroinitializer, <4 x i32> undef, <4 x i32> zeroinitializer ; <<4 x i32>>:951 [#uses=1]
- call void @llvm.ppc.altivec.stvewx( <4 x i32> %951, i8* null )
- br label %952
-
-; <label>:952 ; preds = %950, %947
- br i1 false, label %955, label %953
-
-; <label>:953 ; preds = %952
- getelementptr [4 x <4 x i32>]* null, i32 0, i32 2 ; <<4 x i32>*>:954 [#uses=0]
- br label %955
-
-; <label>:955 ; preds = %953, %952
- shufflevector <4 x i32> zeroinitializer, <4 x i32> undef, <4 x i32> < i32 3, i32 3, i32 3, i32 3 > ; <<4 x i32>>:956 [#uses=0]
- icmp eq i32 0, 0 ; <i1>:957 [#uses=1]
- br i1 %957, label %xStoreDestAddressWithMask.exit461, label %958
-
-; <label>:958 ; preds = %955
- shufflevector <4 x i32> zeroinitializer, <4 x i32> undef, <4 x i32> zeroinitializer ; <<4 x i32>>:959 [#uses=1]
- call void @llvm.ppc.altivec.stvewx( <4 x i32> %959, i8* null )
- br label %xStoreDestAddressWithMask.exit461
-
-xStoreDestAddressWithMask.exit461: ; preds = %958, %955
- load <4 x float>* %0 ; <<4 x float>>:960 [#uses=0]
- call i32 @llvm.ppc.altivec.vcmpequw.p( i32 0, <4 x i32> zeroinitializer, <4 x i32> zeroinitializer ) ; <i32>:961 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 3, i32 0 ; <<4 x float>*>:962 [#uses=0]
- br i1 false, label %968, label %xST.exit463
-
-xST.exit463: ; preds = %xStoreDestAddressWithMask.exit461
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 3, i32 1 ; <<4 x float>*>:963 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 3, i32 2 ; <<4 x float>*>:964 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 3, i32 3 ; <<4 x float>*>:965 [#uses=0]
- load <4 x float>* %0 ; <<4 x float>>:966 [#uses=3]
- call i32 @llvm.ppc.altivec.vcmpequw.p( i32 0, <4 x i32> zeroinitializer, <4 x i32> zeroinitializer ) ; <i32>:967 [#uses=0]
- br i1 false, label %972, label %969
-
-; <label>:968 ; preds = %xStoreDestAddressWithMask.exit461
- unreachable
-
-; <label>:969 ; preds = %xST.exit463
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 2, i32 1 ; <<4 x float>*>:970 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 2, i32 2 ; <<4 x float>*>:971 [#uses=1]
- store <4 x float> %966, <4 x float>* %971
- store <4 x float> %966, <4 x float>* null
- br label %xST.exit465
-
-; <label>:972 ; preds = %xST.exit463
- call <4 x i32> @llvm.ppc.altivec.vsel( <4 x i32> zeroinitializer, <4 x i32> zeroinitializer, <4 x i32> zeroinitializer ) ; <<4 x i32>>:973 [#uses=0]
- store <4 x float> zeroinitializer, <4 x float>* null
- store <4 x float> zeroinitializer, <4 x float>* null
- load <4 x float>* null ; <<4 x float>>:974 [#uses=0]
- bitcast <4 x float> %966 to <4 x i32> ; <<4 x i32>>:975 [#uses=1]
- call <4 x i32> @llvm.ppc.altivec.vsel( <4 x i32> zeroinitializer, <4 x i32> %975, <4 x i32> zeroinitializer ) ; <<4 x i32>>:976 [#uses=1]
- bitcast <4 x i32> %976 to <4 x float> ; <<4 x float>>:977 [#uses=1]
- store <4 x float> %977, <4 x float>* null
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 2, i32 3 ; <<4 x float>*>:978 [#uses=0]
- bitcast <4 x float> zeroinitializer to <4 x i32> ; <<4 x i32>>:979 [#uses=1]
- call <4 x i32> @llvm.ppc.altivec.vsel( <4 x i32> %979, <4 x i32> zeroinitializer, <4 x i32> zeroinitializer ) ; <<4 x i32>>:980 [#uses=1]
- bitcast <4 x i32> %980 to <4 x float> ; <<4 x float>>:981 [#uses=0]
- br label %xST.exit465
-
-xST.exit465: ; preds = %972, %969
- load <4 x float>* %0 ; <<4 x float>>:982 [#uses=3]
- icmp eq i32 0, 0 ; <i1>:983 [#uses=1]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 1, i32 0 ; <<4 x float>*>:984 [#uses=1]
- br i1 %983, label %989, label %985
-
-; <label>:985 ; preds = %xST.exit465
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 1, i32 1 ; <<4 x float>*>:986 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 1, i32 2 ; <<4 x float>*>:987 [#uses=1]
- store <4 x float> %982, <4 x float>* %987
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 1, i32 3 ; <<4 x float>*>:988 [#uses=0]
- br label %xST.exit467
-
-; <label>:989 ; preds = %xST.exit465
- bitcast <4 x float> %982 to <4 x i32> ; <<4 x i32>>:990 [#uses=0]
- shufflevector <4 x i32> zeroinitializer, <4 x i32> undef, <4 x i32> zeroinitializer ; <<4 x i32>>:991 [#uses=0]
- store <4 x float> zeroinitializer, <4 x float>* %984
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 1, i32 1 ; <<4 x float>*>:992 [#uses=0]
- load <4 x i32>* %.sub7896 ; <<4 x i32>>:993 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 1, i32 2 ; <<4 x float>*>:994 [#uses=0]
- bitcast <4 x i32> zeroinitializer to <4 x float> ; <<4 x float>>:995 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 1, i32 3 ; <<4 x float>*>:996 [#uses=0]
- bitcast <4 x float> zeroinitializer to <4 x i32> ; <<4 x i32>>:997 [#uses=1]
- bitcast <4 x float> %982 to <4 x i32> ; <<4 x i32>>:998 [#uses=1]
- shufflevector <4 x i32> zeroinitializer, <4 x i32> undef, <4 x i32> < i32 3, i32 3, i32 3, i32 3 > ; <<4 x i32>>:999 [#uses=1]
- call <4 x i32> @llvm.ppc.altivec.vsel( <4 x i32> %997, <4 x i32> %998, <4 x i32> %999 ) ; <<4 x i32>>:1000 [#uses=1]
- bitcast <4 x i32> %1000 to <4 x float> ; <<4 x float>>:1001 [#uses=0]
- br label %xST.exit467
-
-xST.exit467: ; preds = %989, %985
- load <4 x float>* %0 ; <<4 x float>>:1002 [#uses=5]
- load <4 x i32>* %.sub7896 ; <<4 x i32>>:1003 [#uses=2]
- call i32 @llvm.ppc.altivec.vcmpequw.p( i32 0, <4 x i32> %1003, <4 x i32> zeroinitializer ) ; <i32>:1004 [#uses=0]
- br i1 false, label %1011, label %1005
-
-; <label>:1005 ; preds = %xST.exit467
- load <4 x float>* null ; <<4 x float>>:1006 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 0, i32 1 ; <<4 x float>*>:1007 [#uses=1]
- load <4 x float>* %1007 ; <<4 x float>>:1008 [#uses=0]
- load <4 x float>* null ; <<4 x float>>:1009 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 0, i32 3 ; <<4 x float>*>:1010 [#uses=0]
- br label %xST.exit469
-
-; <label>:1011 ; preds = %xST.exit467
- shufflevector <4 x i32> %1003, <4 x i32> undef, <4 x i32> zeroinitializer ; <<4 x i32>>:1012 [#uses=0]
- icmp eq i32 0, 0 ; <i1>:1013 [#uses=1]
- br i1 %1013, label %1015, label %1014
-
-; <label>:1014 ; preds = %1011
- br label %1015
-
-; <label>:1015 ; preds = %1014, %1011
- %.07472 = phi <4 x float> [ %1002, %1014 ], [ %.27474, %1011 ] ; <<4 x float>> [#uses=0]
- call i32 @llvm.ppc.altivec.vcmpequw.p( i32 0, <4 x i32> zeroinitializer, <4 x i32> zeroinitializer ) ; <i32>:1016 [#uses=1]
- icmp eq i32 %1016, 0 ; <i1>:1017 [#uses=1]
- br i1 %1017, label %1021, label %1018
-
-; <label>:1018 ; preds = %1015
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 0, i32 1 ; <<4 x float>*>:1019 [#uses=0]
- shufflevector <4 x float> %1002, <4 x float> zeroinitializer, <4 x i32> < i32 0, i32 1, i32 2, i32 7 > ; <<4 x float>>:1020 [#uses=0]
- br label %1021
-
-; <label>:1021 ; preds = %1018, %1015
- %.07467 = phi <4 x float> [ %1002, %1018 ], [ %.27469, %1015 ] ; <<4 x float>> [#uses=2]
- icmp eq i32 0, 0 ; <i1>:1022 [#uses=1]
- br i1 %1022, label %1025, label %1023
-
-; <label>:1023 ; preds = %1021
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 0, i32 2 ; <<4 x float>*>:1024 [#uses=1]
- store <4 x float> zeroinitializer, <4 x float>* %1024
- br label %1025
-
-; <label>:1025 ; preds = %1023, %1021
- %.07462 = phi <4 x float> [ %1002, %1023 ], [ %.27464, %1021 ] ; <<4 x float>> [#uses=2]
- icmp eq i32 0, 0 ; <i1>:1026 [#uses=1]
- br i1 %1026, label %xST.exit469, label %1027
-
-; <label>:1027 ; preds = %1025
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 0, i32 3 ; <<4 x float>*>:1028 [#uses=0]
- br label %xST.exit469
-
-xST.exit469: ; preds = %1027, %1025, %1005
- %.17463 = phi <4 x float> [ %.27464, %1005 ], [ %.07462, %1027 ], [ %.07462, %1025 ] ; <<4 x float>> [#uses=1]
- %.17468 = phi <4 x float> [ %.27469, %1005 ], [ %.07467, %1027 ], [ %.07467, %1025 ] ; <<4 x float>> [#uses=1]
- %.07489 = phi <4 x float> [ %1002, %1005 ], [ %.17490, %1027 ], [ %.17490, %1025 ] ; <<4 x float>> [#uses=1]
- load <4 x float>* null ; <<4 x float>>:1029 [#uses=0]
- load <4 x float>* null ; <<4 x float>>:1030 [#uses=0]
- sub <4 x float> zeroinitializer, zeroinitializer ; <<4 x float>>:1031 [#uses=1]
- br i1 false, label %1037, label %1032
-
-; <label>:1032 ; preds = %xST.exit469
- load <4 x float>* null ; <<4 x float>>:1033 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 4, i32 2 ; <<4 x float>*>:1034 [#uses=1]
- load <4 x float>* %1034 ; <<4 x float>>:1035 [#uses=0]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 4, i32 3 ; <<4 x float>*>:1036 [#uses=0]
- br label %xST.exit472
-
-; <label>:1037 ; preds = %xST.exit469
- icmp eq i32 0, 0 ; <i1>:1038 [#uses=1]
- br i1 %1038, label %1040, label %1039
-
-; <label>:1039 ; preds = %1037
- br label %1040
-
-; <label>:1040 ; preds = %1039, %1037
- %.07507 = phi <4 x float> [ zeroinitializer, %1039 ], [ zeroinitializer, %1037 ] ; <<4 x float>> [#uses=0]
- icmp eq i32 0, 0 ; <i1>:1041 [#uses=1]
- br i1 %1041, label %1045, label %1042
-
-; <label>:1042 ; preds = %1040
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 4, i32 1 ; <<4 x float>*>:1043 [#uses=1]
- load <4 x float>* %1043 ; <<4 x float>>:1044 [#uses=0]
- br label %1045
-
-; <label>:1045 ; preds = %1042, %1040
- br i1 false, label %1048, label %1046
-
-; <label>:1046 ; preds = %1045
- shufflevector <4 x float> %1031, <4 x float> zeroinitializer, <4 x i32> < i32 0, i32 1, i32 2, i32 7 > ; <<4 x float>>:1047 [#uses=0]
- br label %1048
-
-; <label>:1048 ; preds = %1046, %1045
- icmp eq i32 0, 0 ; <i1>:1049 [#uses=1]
- br i1 %1049, label %xST.exit472, label %1050
-
-; <label>:1050 ; preds = %1048
- br label %xST.exit472
-
-xST.exit472: ; preds = %1050, %1048, %1032
- br i1 false, label %1052, label %1051
-
-; <label>:1051 ; preds = %xST.exit472
- br label %xST.exit474
-
-; <label>:1052 ; preds = %xST.exit472
- br i1 false, label %1054, label %1053
-
-; <label>:1053 ; preds = %1052
- br label %1054
-
-; <label>:1054 ; preds = %1053, %1052
- br i1 false, label %1056, label %1055
-
-; <label>:1055 ; preds = %1054
- br label %1056
-
-; <label>:1056 ; preds = %1055, %1054
- br i1 false, label %1058, label %1057
-
-; <label>:1057 ; preds = %1056
- br label %1058
-
-; <label>:1058 ; preds = %1057, %1056
- br i1 false, label %xST.exit474, label %1059
-
-; <label>:1059 ; preds = %1058
- br label %xST.exit474
-
-xST.exit474: ; preds = %1059, %1058, %1051
- load <4 x float>* null ; <<4 x float>>:1060 [#uses=1]
- mul <4 x float> zeroinitializer, zeroinitializer ; <<4 x float>>:1061 [#uses=1]
- mul <4 x float> %1060, zeroinitializer ; <<4 x float>>:1062 [#uses=2]
- br i1 false, label %1065, label %1063
-
-; <label>:1063 ; preds = %xST.exit474
- shufflevector <4 x float> %1062, <4 x float> zeroinitializer, <4 x i32> < i32 0, i32 1, i32 2, i32 7 > ; <<4 x float>>:1064 [#uses=1]
- store <4 x float> %1064, <4 x float>* null
- br label %xST.exit476
-
-; <label>:1065 ; preds = %xST.exit474
- br i1 false, label %1067, label %1066
-
-; <label>:1066 ; preds = %1065
- br label %1067
-
-; <label>:1067 ; preds = %1066, %1065
- shufflevector <4 x i32> zeroinitializer, <4 x i32> undef, <4 x i32> < i32 1, i32 1, i32 1, i32 1 > ; <<4 x i32>>:1068 [#uses=0]
- br i1 false, label %1070, label %1069
-
-; <label>:1069 ; preds = %1067
- br label %1070
-
-; <label>:1070 ; preds = %1069, %1067
- br i1 false, label %1072, label %1071
-
-; <label>:1071 ; preds = %1070
- br label %1072
-
-; <label>:1072 ; preds = %1071, %1070
- br i1 false, label %xST.exit476, label %1073
-
-; <label>:1073 ; preds = %1072
- br label %xST.exit476
-
-xST.exit476: ; preds = %1073, %1072, %1063
- %.07551 = phi <4 x float> [ %1062, %1063 ], [ %.17552, %1073 ], [ %.17552, %1072 ] ; <<4 x float>> [#uses=1]
- %.07555 = phi <4 x float> [ %1061, %1063 ], [ %.17556, %1073 ], [ %.17556, %1072 ] ; <<4 x float>> [#uses=1]
- br i1 false, label %1075, label %1074
-
-; <label>:1074 ; preds = %xST.exit476
- br label %xST.exit479
-
-; <label>:1075 ; preds = %xST.exit476
- br i1 false, label %1077, label %1076
-
-; <label>:1076 ; preds = %1075
- br label %1077
-
-; <label>:1077 ; preds = %1076, %1075
- br i1 false, label %1079, label %1078
-
-; <label>:1078 ; preds = %1077
- br label %1079
-
-; <label>:1079 ; preds = %1078, %1077
- br i1 false, label %1081, label %1080
-
-; <label>:1080 ; preds = %1079
- br label %1081
-
-; <label>:1081 ; preds = %1080, %1079
- br i1 false, label %xST.exit479, label %1082
-
-; <label>:1082 ; preds = %1081
- br label %xST.exit479
-
-xST.exit479: ; preds = %1082, %1081, %1074
- br i1 false, label %1084, label %1083
-
-; <label>:1083 ; preds = %xST.exit479
- br label %xST.exit482
-
-; <label>:1084 ; preds = %xST.exit479
- br i1 false, label %1086, label %1085
-
-; <label>:1085 ; preds = %1084
- br label %1086
-
-; <label>:1086 ; preds = %1085, %1084
- br i1 false, label %1088, label %1087
-
-; <label>:1087 ; preds = %1086
- br label %1088
-
-; <label>:1088 ; preds = %1087, %1086
- br i1 false, label %1090, label %1089
-
-; <label>:1089 ; preds = %1088
- br label %1090
-
-; <label>:1090 ; preds = %1089, %1088
- br i1 false, label %xST.exit482, label %1091
-
-; <label>:1091 ; preds = %1090
- br label %xST.exit482
-
-xST.exit482: ; preds = %1091, %1090, %1083
- br i1 false, label %1093, label %1092
-
-; <label>:1092 ; preds = %xST.exit482
- br label %xST.exit486
-
-; <label>:1093 ; preds = %xST.exit482
- br i1 false, label %1095, label %1094
-
-; <label>:1094 ; preds = %1093
- br label %1095
-
-; <label>:1095 ; preds = %1094, %1093
- br i1 false, label %1097, label %1096
-
-; <label>:1096 ; preds = %1095
- br label %1097
-
-; <label>:1097 ; preds = %1096, %1095
- br i1 false, label %1099, label %1098
-
-; <label>:1098 ; preds = %1097
- br label %1099
-
-; <label>:1099 ; preds = %1098, %1097
- br i1 false, label %xST.exit486, label %1100
-
-; <label>:1100 ; preds = %1099
- br label %xST.exit486
-
-xST.exit486: ; preds = %1100, %1099, %1092
- br i1 false, label %1102, label %1101
-
-; <label>:1101 ; preds = %xST.exit486
- br label %xST.exit489
-
-; <label>:1102 ; preds = %xST.exit486
- br i1 false, label %1104, label %1103
-
-; <label>:1103 ; preds = %1102
- br label %1104
-
-; <label>:1104 ; preds = %1103, %1102
- br i1 false, label %1106, label %1105
-
-; <label>:1105 ; preds = %1104
- br label %1106
-
-; <label>:1106 ; preds = %1105, %1104
- br i1 false, label %1108, label %1107
-
-; <label>:1107 ; preds = %1106
- br label %1108
-
-; <label>:1108 ; preds = %1107, %1106
- br i1 false, label %xST.exit489, label %1109
-
-; <label>:1109 ; preds = %1108
- br label %xST.exit489
-
-xST.exit489: ; preds = %1109, %1108, %1101
- br i1 false, label %1111, label %1110
-
-; <label>:1110 ; preds = %xST.exit489
- br label %xST.exit492
-
-; <label>:1111 ; preds = %xST.exit489
- br i1 false, label %1113, label %1112
-
-; <label>:1112 ; preds = %1111
- br label %1113
-
-; <label>:1113 ; preds = %1112, %1111
- br i1 false, label %1115, label %1114
-
-; <label>:1114 ; preds = %1113
- br label %1115
-
-; <label>:1115 ; preds = %1114, %1113
- br i1 false, label %1117, label %1116
-
-; <label>:1116 ; preds = %1115
- br label %1117
-
-; <label>:1117 ; preds = %1116, %1115
- br i1 false, label %xST.exit492, label %1118
-
-; <label>:1118 ; preds = %1117
- br label %xST.exit492
-
-xST.exit492: ; preds = %1118, %1117, %1110
- load <4 x float>* null ; <<4 x float>>:1119 [#uses=1]
- mul <4 x float> %1119, zeroinitializer ; <<4 x float>>:1120 [#uses=1]
- mul <4 x float> zeroinitializer, zeroinitializer ; <<4 x float>>:1121 [#uses=1]
- br i1 false, label %1123, label %1122
-
-; <label>:1122 ; preds = %xST.exit492
- br label %xST.exit495
-
-; <label>:1123 ; preds = %xST.exit492
- br i1 false, label %1125, label %1124
-
-; <label>:1124 ; preds = %1123
- br label %1125
-
-; <label>:1125 ; preds = %1124, %1123
- br i1 false, label %1127, label %1126
-
-; <label>:1126 ; preds = %1125
- br label %1127
-
-; <label>:1127 ; preds = %1126, %1125
- br i1 false, label %1129, label %1128
-
-; <label>:1128 ; preds = %1127
- br label %1129
-
-; <label>:1129 ; preds = %1128, %1127
- br i1 false, label %xST.exit495, label %1130
-
-; <label>:1130 ; preds = %1129
- br label %xST.exit495
-
-xST.exit495: ; preds = %1130, %1129, %1122
- %.07582 = phi <4 x float> [ %1121, %1122 ], [ %.17583, %1130 ], [ %.17583, %1129 ] ; <<4 x float>> [#uses=1]
- %.07590 = phi <4 x float> [ %1120, %1122 ], [ %.17591, %1130 ], [ %.17591, %1129 ] ; <<4 x float>> [#uses=1]
- load <4 x float>* null ; <<4 x float>>:1131 [#uses=1]
- add <4 x float> %1131, zeroinitializer ; <<4 x float>>:1132 [#uses=1]
- add <4 x float> zeroinitializer, zeroinitializer ; <<4 x float>>:1133 [#uses=1]
- br i1 false, label %1135, label %1134
-
-; <label>:1134 ; preds = %xST.exit495
- br label %xST.exit498
-
-; <label>:1135 ; preds = %xST.exit495
- br i1 false, label %1137, label %1136
-
-; <label>:1136 ; preds = %1135
- br label %1137
-
-; <label>:1137 ; preds = %1136, %1135
- br i1 false, label %1139, label %1138
-
-; <label>:1138 ; preds = %1137
- br label %1139
-
-; <label>:1139 ; preds = %1138, %1137
- br i1 false, label %1141, label %1140
-
-; <label>:1140 ; preds = %1139
- br label %1141
-
-; <label>:1141 ; preds = %1140, %1139
- br i1 false, label %xST.exit498, label %1142
-
-; <label>:1142 ; preds = %1141
- br label %xST.exit498
-
-xST.exit498: ; preds = %1142, %1141, %1134
- %.07617 = phi <4 x float> [ %1133, %1134 ], [ %.17618, %1142 ], [ %.17618, %1141 ] ; <<4 x float>> [#uses=1]
- %.07621 = phi <4 x float> [ %1132, %1134 ], [ %.17622, %1142 ], [ %.17622, %1141 ] ; <<4 x float>> [#uses=1]
- load <4 x float>* null ; <<4 x float>>:1143 [#uses=1]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 0, i32 2 ; <<4 x float>*>:1144 [#uses=1]
- load <4 x float>* %1144 ; <<4 x float>>:1145 [#uses=1]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 0, i32 3 ; <<4 x float>*>:1146 [#uses=1]
- load <4 x float>* %1146 ; <<4 x float>>:1147 [#uses=1]
- shufflevector <4 x float> %1143, <4 x float> undef, <4 x i32> zeroinitializer ; <<4 x float>>:1148 [#uses=1]
- shufflevector <4 x float> %1145, <4 x float> undef, <4 x i32> zeroinitializer ; <<4 x float>>:1149 [#uses=1]
- shufflevector <4 x float> %1147, <4 x float> undef, <4 x i32> zeroinitializer ; <<4 x float>>:1150 [#uses=1]
- mul <4 x float> zeroinitializer, zeroinitializer ; <<4 x float>>:1151 [#uses=1]
- mul <4 x float> zeroinitializer, %1148 ; <<4 x float>>:1152 [#uses=1]
- mul <4 x float> zeroinitializer, %1149 ; <<4 x float>>:1153 [#uses=1]
- mul <4 x float> zeroinitializer, %1150 ; <<4 x float>>:1154 [#uses=1]
- br i1 false, label %1156, label %1155
-
-; <label>:1155 ; preds = %xST.exit498
- br label %xST.exit501
-
-; <label>:1156 ; preds = %xST.exit498
- br i1 false, label %1158, label %1157
-
-; <label>:1157 ; preds = %1156
- br label %1158
-
-; <label>:1158 ; preds = %1157, %1156
- br i1 false, label %1160, label %1159
-
-; <label>:1159 ; preds = %1158
- br label %1160
-
-; <label>:1160 ; preds = %1159, %1158
- br i1 false, label %1162, label %1161
-
-; <label>:1161 ; preds = %1160
- br label %1162
-
-; <label>:1162 ; preds = %1161, %1160
- br i1 false, label %xST.exit501, label %1163
-
-; <label>:1163 ; preds = %1162
- br label %xST.exit501
-
-xST.exit501: ; preds = %1163, %1162, %1155
- %.07652 = phi <4 x float> [ %1154, %1155 ], [ %.17653, %1163 ], [ %.17653, %1162 ] ; <<4 x float>> [#uses=1]
- %.07656 = phi <4 x float> [ %1153, %1155 ], [ %.17657, %1163 ], [ %.17657, %1162 ] ; <<4 x float>> [#uses=1]
- %.07660 = phi <4 x float> [ %1152, %1155 ], [ %.17661, %1163 ], [ %.17661, %1162 ] ; <<4 x float>> [#uses=1]
- %.07664 = phi <4 x float> [ %1151, %1155 ], [ %.17665, %1163 ], [ %.17665, %1162 ] ; <<4 x float>> [#uses=1]
- load <4 x float>* null ; <<4 x float>>:1164 [#uses=1]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 0, i32 2 ; <<4 x float>*>:1165 [#uses=1]
- load <4 x float>* %1165 ; <<4 x float>>:1166 [#uses=1]
- getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 0, i32 3 ; <<4 x float>*>:1167 [#uses=1]
- load <4 x float>* %1167 ; <<4 x float>>:1168 [#uses=1]
- add <4 x float> zeroinitializer, zeroinitializer ; <<4 x float>>:1169 [#uses=1]
- add <4 x float> zeroinitializer, %1164 ; <<4 x float>>:1170 [#uses=1]
- add <4 x float> zeroinitializer, %1166 ; <<4 x float>>:1171 [#uses=1]
- add <4 x float> zeroinitializer, %1168 ; <<4 x float>>:1172 [#uses=1]
- br i1 false, label %1174, label %1173
-
-; <label>:1173 ; preds = %xST.exit501
- br label %xST.exit504
-
-; <label>:1174 ; preds = %xST.exit501
- br i1 false, label %1176, label %1175
-
-; <label>:1175 ; preds = %1174
- br label %1176
-
-; <label>:1176 ; preds = %1175, %1174
- br i1 false, label %1178, label %1177
-
-; <label>:1177 ; preds = %1176
- br label %1178
-
-; <label>:1178 ; preds = %1177, %1176
- br i1 false, label %1180, label %1179
-
-; <label>:1179 ; preds = %1178
- br label %1180
-
-; <label>:1180 ; preds = %1179, %1178
- br i1 false, label %xST.exit504, label %1181
-
-; <label>:1181 ; preds = %1180
- br label %xST.exit504
-
-xST.exit504: ; preds = %1181, %1180, %1173
- %.07722 = phi <4 x float> [ %1172, %1173 ], [ %.17723, %1181 ], [ %.17723, %1180 ] ; <<4 x float>> [#uses=1]
- %.07726 = phi <4 x float> [ %1171, %1173 ], [ %.17727, %1181 ], [ %.17727, %1180 ] ; <<4 x float>> [#uses=1]
- %.07730 = phi <4 x float> [ %1170, %1173 ], [ %.17731, %1181 ], [ %.17731, %1180 ] ; <<4 x float>> [#uses=1]
- %.07734 = phi <4 x float> [ %1169, %1173 ], [ %.17735, %1181 ], [ %.17735, %1180 ] ; <<4 x float>> [#uses=1]
- add <4 x float> zeroinitializer, zeroinitializer ; <<4 x float>>:1182 [#uses=1]
- br i1 false, label %1184, label %1183
-
-; <label>:1183 ; preds = %xST.exit504
- br label %xST.exit507
-
-; <label>:1184 ; preds = %xST.exit504
- br i1 false, label %1186, label %1185
-
-; <label>:1185 ; preds = %1184
- br label %1186
-
-; <label>:1186 ; preds = %1185, %1184
- br i1 false, label %1188, label %1187
-
-; <label>:1187 ; preds = %1186
- store <4 x float> zeroinitializer, <4 x float>* null
- br label %1188
-
-; <label>:1188 ; preds = %1187, %1186
- load <4 x i32>* %.sub7896 ; <<4 x i32>>:1189 [#uses=1]
- shufflevector <4 x i32> %1189, <4 x i32> undef, <4 x i32> < i32 2, i32 2, i32 2, i32 2 > ; <<4 x i32>>:1190 [#uses=1]
- call i32 @llvm.ppc.altivec.vcmpequw.p( i32 0, <4 x i32> %1190, <4 x i32> zeroinitializer ) ; <i32>:1191 [#uses=1]
- icmp eq i32 %1191, 0 ; <i1>:1192 [#uses=1]
- br i1 %1192, label %1196, label %1193
-
-; <label>:1193 ; preds = %1188
- load <4 x float>* null ; <<4 x float>>:1194 [#uses=1]
- shufflevector <4 x float> zeroinitializer, <4 x float> %1194, <4 x i32> < i32 0, i32 1, i32 2, i32 7 > ; <<4 x float>>:1195 [#uses=1]
- store <4 x float> %1195, <4 x float>* null
- br label %1196
-
-; <label>:1196 ; preds = %1193, %1188
- %.07742 = phi <4 x float> [ zeroinitializer, %1193 ], [ zeroinitializer, %1188 ] ; <<4 x float>> [#uses=0]
- load <4 x i32>* %.sub7896 ; <<4 x i32>>:1197 [#uses=1]
- shufflevector <4 x i32> %1197, <4 x i32> undef, <4 x i32> < i32 3, i32 3, i32 3, i32 3 > ; <<4 x i32>>:1198 [#uses=1]
- call i32 @llvm.ppc.altivec.vcmpequw.p( i32 0, <4 x i32> %1198, <4 x i32> zeroinitializer ) ; <i32>:1199 [#uses=1]
- icmp eq i32 %1199, 0 ; <i1>:1200 [#uses=1]
- br i1 %1200, label %xST.exit507, label %1201
-
-; <label>:1201 ; preds = %1196
- store <4 x float> zeroinitializer, <4 x float>* null
- br label %xST.exit507
-
-xST.exit507: ; preds = %1201, %1196, %1183
- %.07769 = phi <4 x float> [ %1182, %1183 ], [ %.17770, %1201 ], [ %.17770, %1196 ] ; <<4 x float>> [#uses=1]
- call i32 @llvm.ppc.altivec.vcmpequw.p( i32 0, <4 x i32> zeroinitializer, <4 x i32> zeroinitializer ) ; <i32>:1202 [#uses=1]
- icmp eq i32 %1202, 0 ; <i1>:1203 [#uses=1]
- br i1 %1203, label %1207, label %1204
-
-; <label>:1204 ; preds = %xST.exit507
- load <4 x float>* null ; <<4 x float>>:1205 [#uses=1]
- shufflevector <4 x float> zeroinitializer, <4 x float> %1205, <4 x i32> < i32 0, i32 5, i32 6, i32 7 > ; <<4 x float>>:1206 [#uses=1]
- store <4 x float> %1206, <4 x float>* null
- br label %1207
-
-; <label>:1207 ; preds = %1204, %xST.exit507
- load <4 x i32>* %.sub7896 ; <<4 x i32>>:1208 [#uses=1]
- shufflevector <4 x i32> %1208, <4 x i32> undef, <4 x i32> < i32 1, i32 1, i32 1, i32 1 > ; <<4 x i32>>:1209 [#uses=1]
- call i32 @llvm.ppc.altivec.vcmpequw.p( i32 0, <4 x i32> %1209, <4 x i32> zeroinitializer ) ; <i32>:1210 [#uses=1]
- icmp eq i32 %1210, 0 ; <i1>:1211 [#uses=1]
- br i1 %1211, label %1215, label %1212
-
-; <label>:1212 ; preds = %1207
- load <4 x float>* null ; <<4 x float>>:1213 [#uses=1]
- shufflevector <4 x float> zeroinitializer, <4 x float> %1213, <4 x i32> < i32 0, i32 5, i32 6, i32 7 > ; <<4 x float>>:1214 [#uses=1]
- store <4 x float> %1214, <4 x float>* null
- br label %1215
-
-; <label>:1215 ; preds = %1212, %1207
- store <4 x float> zeroinitializer, <4 x float>* null
- br label %xLS.exit449
-}
-
-declare <4 x i32> @llvm.ppc.altivec.vsel(<4 x i32>, <4 x i32>, <4 x i32>)
-
-declare void @llvm.ppc.altivec.stvewx(<4 x i32>, i8*)
-
-declare <4 x float> @llvm.ppc.altivec.vrsqrtefp(<4 x float>)
-
-declare <4 x float> @llvm.ppc.altivec.vcfsx(<4 x i32>, i32)
-
-declare i32 @llvm.ppc.altivec.vcmpequw.p(i32, <4 x i32>, <4 x i32>)
-
-declare <4 x i32> @llvm.ppc.altivec.vcmpgtfp(<4 x float>, <4 x float>)
diff --git a/release_23/test/CodeGen/PowerPC/2007-04-24-InlineAsm-I-Modifier.ll b/release_23/test/CodeGen/PowerPC/2007-04-24-InlineAsm-I-Modifier.ll
deleted file mode 100644
index 656b83192e00..000000000000
--- a/release_23/test/CodeGen/PowerPC/2007-04-24-InlineAsm-I-Modifier.ll
+++ /dev/null
@@ -1,14 +0,0 @@
-; RUN: llvm-as < %s | llc -march=ppc32 -mtriple=powerpc-apple-darwin8.8.0 | grep {foo r3, r4}
-; RUN: llvm-as < %s | llc -march=ppc32 -mtriple=powerpc-apple-darwin8.8.0 | grep {bari r3, 47}
-
-; PR1351
-
-define i32 @test1(i32 %Y, i32 %X) nounwind {
- %tmp1 = tail call i32 asm "foo${1:I} $0, $1", "=r,rI"( i32 %X )
- ret i32 %tmp1
-}
-
-define i32 @test2(i32 %Y, i32 %X) nounwind {
- %tmp1 = tail call i32 asm "bar${1:I} $0, $1", "=r,rI"( i32 47 )
- ret i32 %tmp1
-}
diff --git a/release_23/test/CodeGen/PowerPC/2007-04-30-InlineAsmEarlyClobber.ll b/release_23/test/CodeGen/PowerPC/2007-04-30-InlineAsmEarlyClobber.ll
deleted file mode 100644
index f43b87c76d62..000000000000
--- a/release_23/test/CodeGen/PowerPC/2007-04-30-InlineAsmEarlyClobber.ll
+++ /dev/null
@@ -1,27 +0,0 @@
-; RUN: llvm-as < %s | llc | grep {subfc r2,r5,r4}
-; RUN: llvm-as < %s | llc | grep {subfze r4,r3}
-
-; PR1357
-
-target datalayout = "E-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64"
-target triple = "powerpc-apple-darwin8.8.0"
-
-;long long test(int A, int B, int C) {
-; unsigned X, Y;
-; __asm__ ("subf%I3c %1,%4,%3\n\tsubfze %0,%2"
-; : "=r" (X), "=&r" (Y)
-; : "r" (A), "rI" (B), "r" (C));
-; return ((long long)Y << 32) | X;
-;}
-
-define i64 @test(i32 %A, i32 %B, i32 %C) {
-entry:
- %Y = alloca i32, align 4 ; <i32*> [#uses=2]
- %tmp4 = call i32 asm "subf${3:I}c $1,$4,$3\0A\09subfze $0,$2", "=r,=*&r,r,rI,r"( i32* %Y, i32 %A, i32 %B, i32 %C ) ; <i32> [#uses=1]
- %tmp5 = load i32* %Y ; <i32> [#uses=1]
- %tmp56 = zext i32 %tmp5 to i64 ; <i64> [#uses=1]
- %tmp7 = shl i64 %tmp56, 32 ; <i64> [#uses=1]
- %tmp89 = zext i32 %tmp4 to i64 ; <i64> [#uses=1]
- %tmp10 = or i64 %tmp7, %tmp89 ; <i64> [#uses=1]
- ret i64 %tmp10
-}
diff --git a/release_23/test/CodeGen/PowerPC/2007-05-03-InlineAsm-S-Constraint.ll b/release_23/test/CodeGen/PowerPC/2007-05-03-InlineAsm-S-Constraint.ll
deleted file mode 100644
index 989a7516aa4d..000000000000
--- a/release_23/test/CodeGen/PowerPC/2007-05-03-InlineAsm-S-Constraint.ll
+++ /dev/null
@@ -1,12 +0,0 @@
-; RUN: llvm-as < %s | llc
-; PR1382
-
-target datalayout = "E-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64"
-target triple = "powerpc-apple-darwin8.8.0"
-@x = global [2 x i32] [ i32 1, i32 2 ] ; <[2 x i32]*> [#uses=1]
-
-define void @foo() {
-entry:
- tail call void asm sideeffect "$0 $1", "s,i"( i8* bitcast (i32* getelementptr ([2 x i32]* @x, i32 0, i32 1) to i8*), i8* bitcast (i32* getelementptr ([2 x i32]* @x, i32 0, i32 1) to i8*) )
- ret void
-}
diff --git a/release_23/test/CodeGen/PowerPC/2007-05-14-InlineAsmSelectCrash.ll b/release_23/test/CodeGen/PowerPC/2007-05-14-InlineAsmSelectCrash.ll
deleted file mode 100644
index b64de683f837..000000000000
--- a/release_23/test/CodeGen/PowerPC/2007-05-14-InlineAsmSelectCrash.ll
+++ /dev/null
@@ -1,25 +0,0 @@
-; RUN: llvm-as < %s | llc -march=ppc32
-target datalayout = "E-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64"
-target triple = "powerpc-apple-darwin8.8.0"
- %struct..0anon = type { i32 }
- %struct.A = type { %struct.anon }
- %struct.anon = type <{ }>
-
-define void @bork(%struct.A* %In0P) {
-entry:
- %tmp56 = bitcast %struct.A* %In0P to float* ; <float*> [#uses=1]
- br label %bb
-
-bb: ; preds = %bb, %entry
- %i.035.0 = phi i32 [ 0, %entry ], [ %indvar.next, %bb ] ; <i32> [#uses=2]
- %tmp8 = getelementptr float* %tmp56, i32 %i.035.0 ; <float*> [#uses=2]
- %tmp101112 = bitcast float* %tmp8 to i8* ; <i8*> [#uses=1]
- %tmp1617 = bitcast float* %tmp8 to i32* ; <i32*> [#uses=1]
- %tmp21 = tail call i32 asm "lwbrx $0, $2, $1", "=r,r,bO,*m"( i8* %tmp101112, i32 0, i32* %tmp1617 ) ; <i32> [#uses=0]
- %indvar.next = add i32 %i.035.0, 1 ; <i32> [#uses=2]
- %exitcond = icmp eq i32 %indvar.next, 4 ; <i1> [#uses=1]
- br i1 %exitcond, label %return, label %bb
-
-return: ; preds = %bb
- ret void
-}
diff --git a/release_23/test/CodeGen/PowerPC/2007-05-22-tailmerge-3.ll b/release_23/test/CodeGen/PowerPC/2007-05-22-tailmerge-3.ll
deleted file mode 100644
index 5a86418f7cb7..000000000000
--- a/release_23/test/CodeGen/PowerPC/2007-05-22-tailmerge-3.ll
+++ /dev/null
@@ -1,68 +0,0 @@
-; RUN: llvm-as < %s | llc -march=ppc32 | grep bl.*baz | count 2
-; RUN: llvm-as < %s | llc -march=ppc32 | grep bl.*quux | count 2
-; RUN: llvm-as < %s | llc -march=ppc32 -enable-tail-merge | grep bl.*baz | count 1
-; RUN: llvm-as < %s | llc -march=ppc32 -enable-tail-merge=1 | grep bl.*quux | count 1
-; Check that tail merging is not the default on ppc, and that -enable-tail-merge works.
-
-; ModuleID = 'tail.c'
-target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64"
-target triple = "i686-apple-darwin8"
-
-define i32 @f(i32 %i, i32 %q) {
-entry:
- %i_addr = alloca i32 ; <i32*> [#uses=2]
- %q_addr = alloca i32 ; <i32*> [#uses=2]
- %retval = alloca i32, align 4 ; <i32*> [#uses=1]
- "alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
- store i32 %i, i32* %i_addr
- store i32 %q, i32* %q_addr
- %tmp = load i32* %i_addr ; <i32> [#uses=1]
- %tmp1 = icmp ne i32 %tmp, 0 ; <i1> [#uses=1]
- %tmp12 = zext i1 %tmp1 to i8 ; <i8> [#uses=1]
- %toBool = icmp ne i8 %tmp12, 0 ; <i1> [#uses=1]
- br i1 %toBool, label %cond_true, label %cond_false
-
-cond_true: ; preds = %entry
- %tmp3 = call i32 (...)* @bar( ) ; <i32> [#uses=0]
- %tmp4 = call i32 (...)* @baz( i32 5, i32 6 ) ; <i32> [#uses=0]
- %tmp7 = load i32* %q_addr ; <i32> [#uses=1]
- %tmp8 = icmp ne i32 %tmp7, 0 ; <i1> [#uses=1]
- %tmp89 = zext i1 %tmp8 to i8 ; <i8> [#uses=1]
- %toBool10 = icmp ne i8 %tmp89, 0 ; <i1> [#uses=1]
- br i1 %toBool10, label %cond_true11, label %cond_false15
-
-cond_false: ; preds = %entry
- %tmp5 = call i32 (...)* @foo( ) ; <i32> [#uses=0]
- %tmp6 = call i32 (...)* @baz( i32 5, i32 6 ) ; <i32> [#uses=0]
- %tmp27 = load i32* %q_addr ; <i32> [#uses=1]
- %tmp28 = icmp ne i32 %tmp27, 0 ; <i1> [#uses=1]
- %tmp289 = zext i1 %tmp28 to i8 ; <i8> [#uses=1]
- %toBool210 = icmp ne i8 %tmp289, 0 ; <i1> [#uses=1]
- br i1 %toBool210, label %cond_true11, label %cond_false15
-
-cond_true11: ; preds = %cond_next
- %tmp13 = call i32 (...)* @foo( ) ; <i32> [#uses=0]
- %tmp14 = call i32 (...)* @quux( i32 3, i32 4 ) ; <i32> [#uses=0]
- br label %cond_next18
-
-cond_false15: ; preds = %cond_next
- %tmp16 = call i32 (...)* @bar( ) ; <i32> [#uses=0]
- %tmp17 = call i32 (...)* @quux( i32 3, i32 4 ) ; <i32> [#uses=0]
- br label %cond_next18
-
-cond_next18: ; preds = %cond_false15, %cond_true11
- %tmp19 = call i32 (...)* @bar( ) ; <i32> [#uses=0]
- br label %return
-
-return: ; preds = %cond_next18
- %retval20 = load i32* %retval ; <i32> [#uses=1]
- ret i32 %retval20
-}
-
-declare i32 @bar(...)
-
-declare i32 @baz(...)
-
-declare i32 @foo(...)
-
-declare i32 @quux(...)
diff --git a/release_23/test/CodeGen/PowerPC/2007-05-30-dagcombine-miscomp.ll b/release_23/test/CodeGen/PowerPC/2007-05-30-dagcombine-miscomp.ll
deleted file mode 100644
index ae853f67e200..000000000000
--- a/release_23/test/CodeGen/PowerPC/2007-05-30-dagcombine-miscomp.ll
+++ /dev/null
@@ -1,14 +0,0 @@
-target datalayout = "E-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64"
-target triple = "powerpc-apple-darwin8.8.0"
-
-; RUN: llvm-as < %s | llc -march=ppc32 | grep {rlwinm r3, r3, 23, 30, 30}
-; PR1473
-
-define i8 @foo(i16 zeroext %a) zeroext {
- %tmp2 = lshr i16 %a, 10 ; <i16> [#uses=1]
- %tmp23 = trunc i16 %tmp2 to i8 ; <i8> [#uses=1]
- %tmp4 = shl i8 %tmp23, 1 ; <i8> [#uses=1]
- %tmp5 = and i8 %tmp4, 2 ; <i8> [#uses=1]
- ret i8 %tmp5
-}
-
diff --git a/release_23/test/CodeGen/PowerPC/2007-06-28-BCCISelBug.ll b/release_23/test/CodeGen/PowerPC/2007-06-28-BCCISelBug.ll
deleted file mode 100644
index 58260ec6b739..000000000000
--- a/release_23/test/CodeGen/PowerPC/2007-06-28-BCCISelBug.ll
+++ /dev/null
@@ -1,85 +0,0 @@
-; RUN: llvm-as < %s | llc -march=ppc32 -mattr=+altivec
-
- %struct.XATest = type { float, i16, i8, i8 }
- %struct.XArrayRange = type { i8, i8, i8, i8 }
- %struct.XBlendMode = type { i16, i16, i16, i16, %struct.GIC4, i16, i16, i8, i8, i8, i8 }
- %struct.XClearC = type { double, %struct.GIC4, %struct.GIC4, float, i32 }
- %struct.XClipPlane = type { i32, [6 x %struct.GIC4] }
- %struct.XCBuffer = type { i16, i16, [8 x i16] }
- %struct.XCMatrix = type { [16 x float]*, %struct.XICSS }
- %struct.XConvolution = type { %struct.GIC4, %struct.XICSS, i16, i16, float*, i32, i32 }
- %struct.XDepthTest = type { i16, i16, i8, i8, i8, i8, double, double }
- %struct.XFixedFunctionProgram = type { %struct.PPSToken* }
- %struct.XFogMode = type { %struct.GIC4, float, float, float, float, float, i16, i16, i16, i8, i8 }
- %struct.XFramebufferAttachment = type { i32, i32, i32, i32 }
- %struct.XHintMode = type { i16, i16, i16, i16, i16, i16, i16, i16, i16, i16 }
- %struct.XHistogram = type { %struct.XFramebufferAttachment*, i32, i16, i8, i8 }
- %struct.XICSS = type { %struct.GTCoord2, %struct.GTCoord2, %struct.GTCoord2, %struct.GTCoord2 }
- %struct.XISubset = type { %struct.XConvolution, %struct.XConvolution, %struct.XConvolution, %struct.XCMatrix, %struct.XMinmax, %struct.XHistogram, %struct.XICSS, %struct.XICSS, %struct.XICSS, %struct.XICSS, i32 }
- %struct.XLight = type { %struct.GIC4, %struct.GIC4, %struct.GIC4, %struct.GIC4, %struct.XPointLineLimits, float, float, float, float, float, %struct.XPointLineLimits, float, float, float, float, float }
- %struct.XLightModel = type { %struct.GIC4, [8 x %struct.XLight], [2 x %struct.XMaterial], i32, i16, i16, i16, i8, i8, i8, i8, i8, i8 }
- %struct.XLightProduct = type { %struct.GIC4, %struct.GIC4, %struct.GIC4 }
- %struct.XLineMode = type { float, i32, i16, i16, i8, i8, i8, i8 }
- %struct.XLogicOp = type { i16, i8, i8 }
- %struct.XMaskMode = type { i32, [3 x i32], i8, i8, i8, i8, i8, i8, i8, i8 }
- %struct.XMaterial = type { %struct.GIC4, %struct.GIC4, %struct.GIC4, %struct.GIC4, float, float, float, float, [8 x %struct.XLightProduct], %struct.GIC4, [6 x i32], [2 x i32] }
- %struct.XMinmax = type { %struct.XMinmaxTable*, i16, i8, i8 }
- %struct.XMinmaxTable = type { %struct.GIC4, %struct.GIC4 }
- %struct.XMipmaplevel = type { [4 x i32], [4 x i32], [4 x float], [4 x i32], i32, i32, float*, i8*, i16, i16, i16, i16, [2 x float] }
- %struct.XMultisample = type { float, i8, i8, i8, i8, i8, i8, i8, i8 }
- %struct.XPipelineProgramState = type { i8, i8, i8, i8, %struct.GIC4* }
- %struct.XPMap = type { i32*, float*, float*, float*, float*, float*, float*, float*, float*, i32*, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 }
- %struct.XPMode = type { float, float, %struct.XPStore, %struct.XPTransfer, %struct.XPMap, %struct.XISubset, i32, i32 }
- %struct.XPPack = type { i32, i32, i32, i32, i32, i32, i32, i32, i8, i8, i8, i8 }
- %struct.XPStore = type { %struct.XPPack, %struct.XPPack }
- %struct.XPTransfer = type { float, float, float, float, float, float, float, float, float, float, i32, i32, float, float, float, float, float, float, float, float, float, float, float, float }
- %struct.XPointLineLimits = type { float, float, float }
- %struct.XPointMode = type { float, float, float, float, %struct.XPointLineLimits, float, i8, i8, i8, i8, i16, i16, i32, i16, i16 }
- %struct.XPGMode = type { [128 x i8], float, float, i16, i16, i16, i16, i8, i8, i8, i8, i8, i8, i8, i8 }
- %struct.XRegisterCCs = type { i8, i8, i8, i8, i32, [2 x %struct.GIC4], [8 x %struct.XRegisterCCsPerStageState], %struct.XRegisterCCsFinalStageState }
- %struct.XRegisterCCsFinalStageState = type { i8, i8, i8, i8, [7 x %struct.XRegisterCCsPerVariableState] }
- %struct.XRegisterCCsPerPortionState = type { [4 x %struct.XRegisterCCsPerVariableState], i8, i8, i8, i8, i16, i16, i16, i16, i16, i16 }
- %struct.XRegisterCCsPerStageState = type { [2 x %struct.XRegisterCCsPerPortionState], [2 x %struct.GIC4] }
- %struct.XRegisterCCsPerVariableState = type { i16, i16, i16, i16 }
- %struct.XScissorTest = type { %struct.XFramebufferAttachment, i8, i8, i8, i8 }
- %struct.XState = type { i16, i16, i16, i16, i32, i32, [256 x %struct.GIC4], [128 x %struct.GIC4], %struct.XViewport, %struct.XXF, %struct.XLightModel, %struct.XATest, %struct.XBlendMode, %struct.XClearC, %struct.XCBuffer, %struct.XDepthTest, %struct.XArrayRange, %struct.XFogMode, %struct.XHintMode, %struct.XLineMode, %struct.XLogicOp, %struct.XMaskMode, %struct.XPMode, %struct.XPointMode, %struct.XPGMode, %struct.XScissorTest, i32, %struct.XStencilTest, [16 x %struct.XTMode], %struct.XArrayRange, [8 x %struct.XTCoordGen], %struct.XClipPlane, %struct.XMultisample, %struct.XRegisterCCs, %struct.XArrayRange, %struct.XArrayRange, [3 x %struct.XPipelineProgramState], %struct.XXFFeedback, i32*, %struct.XFixedFunctionProgram, [3 x i32] }
- %struct.XStencilTest = type { [3 x { i32, i32, i16, i16, i16, i16 }], i32, [4 x i8] }
- %struct.XTCoordGen = type { { i16, i16, %struct.GIC4, %struct.GIC4 }, { i16, i16, %struct.GIC4, %struct.GIC4 }, { i16, i16, %struct.GIC4, %struct.GIC4 }, { i16, i16, %struct.GIC4, %struct.GIC4 }, i8, i8, i8, i8 }
- %struct.XTGeomState = type { i16, i16, i16, i16, i16, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, [6 x i16], [6 x i16] }
- %struct.XTLevel = type { i32, i32, i16, i16, i16, i8, i8, i16, i16, i16, i16, i8* }
- %struct.XTMode = type { %struct.GIC4, i32, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, float, float, float, i16, i16, i16, i16, i16, i16, [4 x i16], i8, i8, i8, i8, [3 x float], [4 x float], float, float }
- %struct.XTParamState = type { i16, i16, i16, i16, i16, i16, %struct.GIC4, float, float, float, float, i16, i16, i16, i16, float, i16, i8, i8, i32, i8* }
- %struct.XTRec = type { %struct.XTState*, float, float, float, float, %struct.XMipmaplevel*, %struct.XMipmaplevel*, i32, i32, i32, i32, i32, i32, i32, [2 x %struct.PPSToken] }
- %struct.XTState = type { i16, i8, i8, i16, i16, float, i32, %struct.GISWRSurface*, %struct.XTParamState, %struct.XTGeomState, %struct.XTLevel, [6 x [15 x %struct.XTLevel]] }
- %struct.XXF = type { [24 x [16 x float]], [24 x [16 x float]], [16 x float], float, float, float, float, float, i8, i8, i8, i8, i32, i32, i32, i16, i16, i8, i8, i8, i8, i32 }
- %struct.XXFFeedback = type { i8, i8, i8, i8, [16 x i32], [16 x i32] }
- %struct.XViewport = type { float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, double, double, i32, i32, i32, i32, float, float, float, float }
- %struct.GIC4 = type { float, float, float, float }
- %struct.GISWRSurface = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i8*, i8*, i8*, [4 x i8*], i32 }
- %struct.GTCoord2 = type { float, float }
- %struct.GVMFPContext = type { float, i32, i32, i32, float, [3 x float] }
- %struct.GVMFPStack = type { [8 x i8*], i8*, i8*, i32, i32, { <4 x float> }, { <4 x float> }, <4 x i32> }
- %struct.GVMFGAttrib = type { <4 x float>, <4 x float>, <4 x float>, <4 x float>, <4 x float>, [8 x <4 x float>] }
- %struct.GVMTs = type { [16 x %struct.XTRec*] }
- %struct.PPSToken = type { { i16, i16, i32 } }
- %struct._GVMConstants = type { <4 x i32>, <4 x i32>, <4 x float>, <4 x float>, <4 x float>, <4 x float>, <4 x float>, <4 x float>, <4 x float>, <4 x float>, <4 x float>, <4 x float>, float, float, float, float, float, float, float, float, float, float, float, float, [256 x float], [528 x i8] }
-
-declare <4 x i32> @llvm.ppc.altivec.lvewx(i8*)
-
-declare i32 @llvm.ppc.altivec.vcmpequw.p(i32, <4 x i32>, <4 x i32>)
-
-define void @test(%struct.XState* %gldst, <4 x float>* %prgrm, <4 x float>** %buffs, %struct._GVMConstants* %cnstn, %struct.PPSToken* %pstrm, %struct.GVMFPContext* %vmctx, %struct.GVMTs* %txtrs, %struct.GVMFPStack* %fpstk, %struct.GVMFGAttrib* %start, %struct.GVMFGAttrib* %deriv, i32 %fragx, i32 %fragy) {
-bb58.i:
- %tmp3405.i = getelementptr %struct.XTRec* null, i32 0, i32 1 ; <float*> [#uses=1]
- %tmp34053406.i = bitcast float* %tmp3405.i to i8* ; <i8*> [#uses=1]
- %tmp3407.i = call <4 x i32> @llvm.ppc.altivec.lvewx( i8* %tmp34053406.i ) ; <<4 x i32>> [#uses=0]
- %tmp4146.i = call i32 @llvm.ppc.altivec.vcmpequw.p( i32 3, <4 x i32> zeroinitializer, <4 x i32> zeroinitializer ) ; <i32> [#uses=1]
- %tmp4147.i = icmp eq i32 %tmp4146.i, 0 ; <i1> [#uses=1]
- br i1 %tmp4147.i, label %bb8799.i, label %bb4150.i
-
-bb4150.i: ; preds = %bb58.i
- br label %bb8799.i
-
-bb8799.i: ; preds = %bb4150.i, %bb58.i
- ret void
-}
diff --git a/release_23/test/CodeGen/PowerPC/2007-08-04-CoalescerAssert.ll b/release_23/test/CodeGen/PowerPC/2007-08-04-CoalescerAssert.ll
deleted file mode 100644
index 34df7bb7d057..000000000000
--- a/release_23/test/CodeGen/PowerPC/2007-08-04-CoalescerAssert.ll
+++ /dev/null
@@ -1,28 +0,0 @@
-; RUN: llvm-as < %s | llc -march=ppc64
-; PR1596
-
- %struct._obstack_chunk = type { i8* }
- %struct.obstack = type { i8*, %struct._obstack_chunk* (i8*, i64)*, i8*, i8 }
-
-define i32 @_obstack_newchunk(%struct.obstack* %h, i32 %length) {
-entry:
- br i1 false, label %cond_false, label %cond_true
-
-cond_true: ; preds = %entry
- br i1 false, label %cond_true28, label %cond_next30
-
-cond_false: ; preds = %entry
- %tmp22 = tail call %struct._obstack_chunk* null( i64 undef ) ; <%struct._obstack_chunk*> [#uses=2]
- br i1 false, label %cond_true28, label %cond_next30
-
-cond_true28: ; preds = %cond_false, %cond_true
- %iftmp.0.043.0 = phi %struct._obstack_chunk* [ null, %cond_true ], [ %tmp22, %cond_false ] ; <%struct._obstack_chunk*> [#uses=1]
- tail call void null( )
- br label %cond_next30
-
-cond_next30: ; preds = %cond_true28, %cond_false, %cond_true
- %iftmp.0.043.1 = phi %struct._obstack_chunk* [ %iftmp.0.043.0, %cond_true28 ], [ null, %cond_true ], [ %tmp22, %cond_false ] ; <%struct._obstack_chunk*> [#uses=1]
- %tmp41 = getelementptr %struct._obstack_chunk* %iftmp.0.043.1, i32 0, i32 0 ; <i8**> [#uses=1]
- store i8* null, i8** %tmp41, align 8
- ret i32 undef
-}
diff --git a/release_23/test/CodeGen/PowerPC/2007-09-04-AltivecDST.ll b/release_23/test/CodeGen/PowerPC/2007-09-04-AltivecDST.ll
deleted file mode 100644
index 9c8fa97be967..000000000000
--- a/release_23/test/CodeGen/PowerPC/2007-09-04-AltivecDST.ll
+++ /dev/null
@@ -1,15 +0,0 @@
-; RUN: llvm-as < %s | llc -march=ppc64 | grep dst | count 4
-
-define hidden void @_Z4borkPc(i8* %image) {
-entry:
- tail call void @llvm.ppc.altivec.dst( i8* %image, i32 8, i32 0 )
- tail call void @llvm.ppc.altivec.dstt( i8* %image, i32 8, i32 0 )
- tail call void @llvm.ppc.altivec.dstst( i8* %image, i32 8, i32 0 )
- tail call void @llvm.ppc.altivec.dststt( i8* %image, i32 8, i32 0 )
- ret void
-}
-
-declare void @llvm.ppc.altivec.dst(i8*, i32, i32)
-declare void @llvm.ppc.altivec.dstt(i8*, i32, i32)
-declare void @llvm.ppc.altivec.dstst(i8*, i32, i32)
-declare void @llvm.ppc.altivec.dststt(i8*, i32, i32)
diff --git a/release_23/test/CodeGen/PowerPC/2007-09-07-LoadStoreIdxForms.ll b/release_23/test/CodeGen/PowerPC/2007-09-07-LoadStoreIdxForms.ll
deleted file mode 100644
index c5e7a4d38a00..000000000000
--- a/release_23/test/CodeGen/PowerPC/2007-09-07-LoadStoreIdxForms.ll
+++ /dev/null
@@ -1,16 +0,0 @@
-; RUN: llvm-as < %s | llc -march=ppc64 | grep lwzx
-
- %struct.__db_region = type { %struct.__mutex_t, [4 x i8], %struct.anon, i32, [1 x i32] }
- %struct.__mutex_t = type { i32 }
- %struct.anon = type { i64, i64 }
-
-define void @foo() {
-entry:
- %ttype = alloca i32, align 4 ; <i32*> [#uses=1]
- %regs = alloca [1024 x %struct.__db_region], align 16 ; <[1024 x %struct.__db_region]*> [#uses=0]
- %tmp = load i32* %ttype, align 4 ; <i32> [#uses=1]
- %tmp1 = call i32 (...)* @bork( i32 %tmp ) ; <i32> [#uses=0]
- ret void
-}
-
-declare i32 @bork(...)
diff --git a/release_23/test/CodeGen/PowerPC/2007-09-08-unaligned.ll b/release_23/test/CodeGen/PowerPC/2007-09-08-unaligned.ll
deleted file mode 100644
index f6bd3337aef7..000000000000
--- a/release_23/test/CodeGen/PowerPC/2007-09-08-unaligned.ll
+++ /dev/null
@@ -1,53 +0,0 @@
-; RUN: llvm-as < %s | llc | grep stfd | count 3
-; RUN: llvm-as < %s | llc | grep stfs | count 1
-; RUN: llvm-as < %s | llc | grep lfd | count 2
-; RUN: llvm-as < %s | llc | grep lfs | count 2
-; ModuleID = 'foo.c'
-target datalayout = "E-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f128:64:128"
-target triple = "powerpc-apple-darwin8"
- %struct.anon = type <{ i8, float }>
-@s = global %struct.anon <{ i8 3, float 0x4014666660000000 }> ; <%struct.anon*> [#uses=1]
-@u = global <{ i8, double }> <{ i8 3, double 5.100000e+00 }> ; <<{ i8, double }>*> [#uses=1]
-@t = weak global %struct.anon zeroinitializer ; <%struct.anon*> [#uses=2]
-@v = weak global <{ i8, double }> zeroinitializer ; <<{ i8, double }>*> [#uses=2]
-@.str = internal constant [8 x i8] c"%f %lf\0A\00" ; <[8 x i8]*> [#uses=1]
-
-define i32 @foo() {
-entry:
- %retval = alloca i32, align 4 ; <i32*> [#uses=1]
- %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
- %tmp = getelementptr %struct.anon* @s, i32 0, i32 1 ; <float*> [#uses=1]
- %tmp1 = load float* %tmp, align 1 ; <float> [#uses=1]
- %tmp2 = getelementptr %struct.anon* @t, i32 0, i32 1 ; <float*> [#uses=1]
- store float %tmp1, float* %tmp2, align 1
- %tmp3 = getelementptr <{ i8, double }>* @u, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp4 = load double* %tmp3, align 1 ; <double> [#uses=1]
- %tmp5 = getelementptr <{ i8, double }>* @v, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp4, double* %tmp5, align 1
- br label %return
-
-return: ; preds = %entry
- %retval6 = load i32* %retval ; <i32> [#uses=1]
- ret i32 %retval6
-}
-
-define i32 @main() {
-entry:
- %retval = alloca i32, align 4 ; <i32*> [#uses=1]
- %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
- %tmp = call i32 @foo( ) ; <i32> [#uses=0]
- %tmp1 = getelementptr %struct.anon* @t, i32 0, i32 1 ; <float*> [#uses=1]
- %tmp2 = load float* %tmp1, align 1 ; <float> [#uses=1]
- %tmp23 = fpext float %tmp2 to double ; <double> [#uses=1]
- %tmp4 = getelementptr <{ i8, double }>* @v, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp5 = load double* %tmp4, align 1 ; <double> [#uses=1]
- %tmp6 = getelementptr [8 x i8]* @.str, i32 0, i32 0 ; <i8*> [#uses=1]
- %tmp7 = call i32 (i8*, ...)* @printf( i8* %tmp6, double %tmp23, double %tmp5 ) ; <i32> [#uses=0]
- br label %return
-
-return: ; preds = %entry
- %retval8 = load i32* %retval ; <i32> [#uses=1]
- ret i32 %retval8
-}
-
-declare i32 @printf(i8*, ...)
diff --git a/release_23/test/CodeGen/PowerPC/2007-09-11-RegCoalescerAssert.ll b/release_23/test/CodeGen/PowerPC/2007-09-11-RegCoalescerAssert.ll
deleted file mode 100644
index bb7aba45a963..000000000000
--- a/release_23/test/CodeGen/PowerPC/2007-09-11-RegCoalescerAssert.ll
+++ /dev/null
@@ -1,9 +0,0 @@
-; RUN: llvm-as < %s | llc -march=ppc64
-
- %struct.TCMalloc_SpinLock = type { i32 }
-
-define void @_ZN17TCMalloc_SpinLock4LockEv(%struct.TCMalloc_SpinLock* %this) {
-entry:
- %tmp3 = call i32 asm sideeffect "1: lwarx $0, 0, $1\0A\09stwcx. $2, 0, $1\0A\09bne- 1b\0A\09isync", "=&r,=*r,r,1,~{dirflag},~{fpsr},~{flags},~{memory}"( i32** null, i32 1, i32* null ) ; <i32> [#uses=0]
- unreachable
-}
diff --git a/release_23/test/CodeGen/PowerPC/2007-09-12-LiveIntervalsAssert.ll b/release_23/test/CodeGen/PowerPC/2007-09-12-LiveIntervalsAssert.ll
deleted file mode 100644
index f4b87cf4517b..000000000000
--- a/release_23/test/CodeGen/PowerPC/2007-09-12-LiveIntervalsAssert.ll
+++ /dev/null
@@ -1,15 +0,0 @@
-; RUN: llvm-as < %s | llc -mtriple=powerpc64-apple-darwin
-
-declare void @cxa_atexit_check_1(i8*)
-
-define i32 @check_cxa_atexit(i32 (void (i8*)*, i8*, i8*)* %cxa_atexit, void (i8*)* %cxa_finalize) {
-entry:
- %tmp7 = call i32 null( void (i8*)* @cxa_atexit_check_1, i8* null, i8* null ) ; <i32> [#uses=0]
- br i1 false, label %cond_true, label %cond_next
-
-cond_true: ; preds = %entry
- ret i32 0
-
-cond_next: ; preds = %entry
- ret i32 0
-}
diff --git a/release_23/test/CodeGen/PowerPC/2007-10-16-InlineAsmFrameOffset.ll b/release_23/test/CodeGen/PowerPC/2007-10-16-InlineAsmFrameOffset.ll
deleted file mode 100644
index e71a8fb0f160..000000000000
--- a/release_23/test/CodeGen/PowerPC/2007-10-16-InlineAsmFrameOffset.ll
+++ /dev/null
@@ -1,14 +0,0 @@
-; RUN: llvm-as < %s | llc -march=ppc32
-; rdar://5538377
-
- %struct.disk_unsigned = type { i32 }
- %struct._StorePageMax = type { %struct.disk_unsigned, %struct.disk_unsigned, [65536 x i8] }
-
-define i32 @test() {
-entry:
- %data = alloca i32 ; <i32*> [#uses=1]
- %compressedPage = alloca %struct._StorePageMax ; <%struct._StorePageMax*> [#uses=0]
- %tmp107 = call i32 asm "lwbrx $0, $2, $1", "=r,r,bO,*m"( i8* null, i32 0, i32* %data ) ; <i32> [#uses=0]
- unreachable
-}
-
diff --git a/release_23/test/CodeGen/PowerPC/2007-10-18-PtrArithmetic.ll b/release_23/test/CodeGen/PowerPC/2007-10-18-PtrArithmetic.ll
deleted file mode 100644
index bd11b5d5b7b2..000000000000
--- a/release_23/test/CodeGen/PowerPC/2007-10-18-PtrArithmetic.ll
+++ /dev/null
@@ -1,22 +0,0 @@
-; RUN: llvm-as < %s | llc -march=ppc64 -mattr=+altivec
- %struct.inoutprops = type <{ i8, [3 x i8] }>
-
-define void @bork(float* %argA, float* %argB, float* %res, i8 %inoutspec.0) {
-entry:
- %.mask = and i8 %inoutspec.0, -16 ; <i8> [#uses=1]
- %tmp6 = icmp eq i8 %.mask, 16 ; <i1> [#uses=1]
- br i1 %tmp6, label %cond_true, label %UnifiedReturnBlock
-
-cond_true: ; preds = %entry
- %tmp89 = bitcast float* %res to <4 x i32>* ; <<4 x i32>*> [#uses=1]
- %tmp1011 = bitcast float* %argA to <4 x i32>* ; <<4 x i32>*> [#uses=1]
- %tmp14 = load <4 x i32>* %tmp1011, align 16 ; <<4 x i32>> [#uses=1]
- %tmp1516 = bitcast float* %argB to <4 x i32>* ; <<4 x i32>*> [#uses=1]
- %tmp18 = load <4 x i32>* %tmp1516, align 16 ; <<4 x i32>> [#uses=1]
- %tmp19 = sdiv <4 x i32> %tmp14, %tmp18 ; <<4 x i32>> [#uses=1]
- store <4 x i32> %tmp19, <4 x i32>* %tmp89, align 16
- ret void
-
-UnifiedReturnBlock: ; preds = %entry
- ret void
-}
diff --git a/release_23/test/CodeGen/PowerPC/2007-10-21-LocalRegAllocAssert.ll b/release_23/test/CodeGen/PowerPC/2007-10-21-LocalRegAllocAssert.ll
deleted file mode 100644
index bca6e5a8fbdb..000000000000
--- a/release_23/test/CodeGen/PowerPC/2007-10-21-LocalRegAllocAssert.ll
+++ /dev/null
@@ -1,27 +0,0 @@
-; RUN: llvm-as < %s | llc -mtriple=powerpc64-apple-darwin9 -regalloc=local -relocation-model=pic
-
- %struct.NSError = type opaque
- %struct.NSManagedObjectContext = type opaque
- %struct.NSPersistentStoreCoordinator = type opaque
- %struct.NSString = type opaque
- %struct.NSURL = type opaque
- %struct._message_ref_t = type { %struct.objc_object* (%struct.objc_object*, %struct._message_ref_t*, ...)*, %struct.objc_selector* }
- %struct.objc_object = type { }
- %struct.objc_selector = type opaque
-@"\01L_OBJC_MESSAGE_REF_2" = external global %struct._message_ref_t ; <%struct._message_ref_t*> [#uses=1]
-@"\01L_OBJC_MESSAGE_REF_6" = external global %struct._message_ref_t ; <%struct._message_ref_t*> [#uses=1]
-@NSXMLStoreType = external constant %struct.NSString* ; <%struct.NSString**> [#uses=1]
-@"\01L_OBJC_MESSAGE_REF_5" = external global %struct._message_ref_t ; <%struct._message_ref_t*> [#uses=2]
-@"\01L_OBJC_MESSAGE_REF_4" = external global %struct._message_ref_t ; <%struct._message_ref_t*> [#uses=1]
-
-define %struct.NSManagedObjectContext* @"+[ListGenerator(Private) managedObjectContextWithModelURL:storeURL:]"(%struct.objc_object* %self, %struct._message_ref_t* %_cmd, %struct.NSURL* %modelURL, %struct.NSURL* %storeURL) {
-entry:
- %storeCoordinator = alloca %struct.NSPersistentStoreCoordinator* ; <%struct.NSPersistentStoreCoordinator**> [#uses=0]
- %tmp29 = call %struct.objc_object* (%struct.objc_object*, %struct._message_ref_t*, ...)* null( %struct.objc_object* null, %struct._message_ref_t* @"\01L_OBJC_MESSAGE_REF_2" ) ; <%struct.objc_object*> [#uses=0]
- %tmp34 = load %struct.NSString** @NSXMLStoreType, align 8 ; <%struct.NSString*> [#uses=1]
- %tmp37 = load %struct.objc_object* (%struct.objc_object*, %struct._message_ref_t*, ...)** getelementptr (%struct._message_ref_t* @"\01L_OBJC_MESSAGE_REF_5", i32 0, i32 0), align 8 ; <%struct.objc_object* (%struct.objc_object*, %struct._message_ref_t*, ...)*> [#uses=1]
- %tmp42 = call %struct.objc_object* (%struct.objc_object*, %struct._message_ref_t*, ...)* null( %struct.objc_object* null, %struct._message_ref_t* @"\01L_OBJC_MESSAGE_REF_4", i32 1 ) ; <%struct.objc_object*> [#uses=1]
- %tmp45 = call %struct.objc_object* (%struct.objc_object*, %struct._message_ref_t*, ...)* %tmp37( %struct.objc_object* null, %struct._message_ref_t* @"\01L_OBJC_MESSAGE_REF_5", %struct.objc_object* %tmp42, %struct.NSString* null ) ; <%struct.objc_object*> [#uses=1]
- %tmp48 = call %struct.objc_object* (%struct.objc_object*, %struct._message_ref_t*, ...)* null( %struct.objc_object* null, %struct._message_ref_t* @"\01L_OBJC_MESSAGE_REF_6", %struct.NSString* %tmp34, i8* null, %struct.NSURL* null, %struct.objc_object* %tmp45, %struct.NSError** null ) ; <%struct.objc_object*> [#uses=0]
- unreachable
-}
diff --git a/release_23/test/CodeGen/PowerPC/2007-10-21-LocalRegAllocAssert2.ll b/release_23/test/CodeGen/PowerPC/2007-10-21-LocalRegAllocAssert2.ll
deleted file mode 100644
index 80ef6f19f727..000000000000
--- a/release_23/test/CodeGen/PowerPC/2007-10-21-LocalRegAllocAssert2.ll
+++ /dev/null
@@ -1,25 +0,0 @@
-; RUN: llvm-as < %s | llc -mtriple=powerpc64-apple-darwin9 -regalloc=local -relocation-model=pic
-
- %struct.NSError = type opaque
- %struct.NSManagedObjectContext = type opaque
- %struct.NSString = type opaque
- %struct.NSURL = type opaque
- %struct._message_ref_t = type { %struct.objc_object* (%struct.objc_object*, %struct._message_ref_t*, ...)*, %struct.objc_selector* }
- %struct.objc_object = type { }
- %struct.objc_selector = type opaque
-@"\01L_OBJC_MESSAGE_REF_2" = external global %struct._message_ref_t ; <%struct._message_ref_t*> [#uses=2]
-@"\01L_OBJC_MESSAGE_REF_6" = external global %struct._message_ref_t ; <%struct._message_ref_t*> [#uses=2]
-@NSXMLStoreType = external constant %struct.NSString* ; <%struct.NSString**> [#uses=1]
-@"\01L_OBJC_MESSAGE_REF_4" = external global %struct._message_ref_t ; <%struct._message_ref_t*> [#uses=2]
-
-define %struct.NSManagedObjectContext* @"+[ListGenerator(Private) managedObjectContextWithModelURL:storeURL:]"(%struct.objc_object* %self, %struct._message_ref_t* %_cmd, %struct.NSURL* %modelURL, %struct.NSURL* %storeURL) {
-entry:
- %tmp27 = load %struct.objc_object* (%struct.objc_object*, %struct._message_ref_t*, ...)** getelementptr (%struct._message_ref_t* @"\01L_OBJC_MESSAGE_REF_2", i32 0, i32 0), align 8 ; <%struct.objc_object* (%struct.objc_object*, %struct._message_ref_t*, ...)*> [#uses=1]
- %tmp29 = call %struct.objc_object* (%struct.objc_object*, %struct._message_ref_t*, ...)* %tmp27( %struct.objc_object* null, %struct._message_ref_t* @"\01L_OBJC_MESSAGE_REF_2" ) ; <%struct.objc_object*> [#uses=0]
- %tmp33 = load %struct.objc_object* (%struct.objc_object*, %struct._message_ref_t*, ...)** getelementptr (%struct._message_ref_t* @"\01L_OBJC_MESSAGE_REF_6", i32 0, i32 0), align 8 ; <%struct.objc_object* (%struct.objc_object*, %struct._message_ref_t*, ...)*> [#uses=1]
- %tmp34 = load %struct.NSString** @NSXMLStoreType, align 8 ; <%struct.NSString*> [#uses=1]
- %tmp40 = load %struct.objc_object* (%struct.objc_object*, %struct._message_ref_t*, ...)** getelementptr (%struct._message_ref_t* @"\01L_OBJC_MESSAGE_REF_4", i32 0, i32 0), align 8 ; <%struct.objc_object* (%struct.objc_object*, %struct._message_ref_t*, ...)*> [#uses=1]
- %tmp42 = call %struct.objc_object* (%struct.objc_object*, %struct._message_ref_t*, ...)* %tmp40( %struct.objc_object* null, %struct._message_ref_t* @"\01L_OBJC_MESSAGE_REF_4", i32 1 ) ; <%struct.objc_object*> [#uses=0]
- %tmp48 = call %struct.objc_object* (%struct.objc_object*, %struct._message_ref_t*, ...)* %tmp33( %struct.objc_object* null, %struct._message_ref_t* @"\01L_OBJC_MESSAGE_REF_6", %struct.NSString* %tmp34, i8* null, %struct.NSURL* null, %struct.objc_object* null, %struct.NSError** null ) ; <%struct.objc_object*> [#uses=0]
- unreachable
-}
diff --git a/release_23/test/CodeGen/PowerPC/2007-11-04-CoalescerCrash.ll b/release_23/test/CodeGen/PowerPC/2007-11-04-CoalescerCrash.ll
deleted file mode 100644
index e49d59acfe5f..000000000000
--- a/release_23/test/CodeGen/PowerPC/2007-11-04-CoalescerCrash.ll
+++ /dev/null
@@ -1,148 +0,0 @@
-; RUN: llvm-as < %s | llc -mtriple=powerpc-apple-darwin
-
- %struct.HDescriptor = type <{ i32, i32 }>
-
-declare void @bcopy(i8*, i8*, i32)
-
-define i32 @main(i32 %argc, i8** %argv) {
-entry:
- br i1 false, label %bb31, label %bb
-
-bb: ; preds = %entry
- ret i32 -6
-
-bb31: ; preds = %entry
- switch i32 0, label %bb189 [
- i32 73, label %cond_next209
- i32 74, label %bb74
- i32 77, label %bb57
- i32 78, label %cond_next209
- i32 85, label %cond_next209
- i32 97, label %cond_next209
- i32 100, label %cond_next209
- i32 107, label %cond_next209
- i32 109, label %bb57
- i32 112, label %bb43
- i32 115, label %cond_next209
- i32 117, label %bb51
- ]
-
-bb43: ; preds = %bb31
- br i1 false, label %cond_true48, label %cond_true200.critedge2117
-
-cond_true48: ; preds = %bb43
- br i1 false, label %cond_next372, label %AllDone
-
-bb51: ; preds = %bb31
- ret i32 0
-
-bb57: ; preds = %bb31, %bb31
- ret i32 0
-
-bb74: ; preds = %bb31
- ret i32 0
-
-bb189: ; preds = %bb31
- ret i32 0
-
-cond_true200.critedge2117: ; preds = %bb43
- ret i32 0
-
-cond_next209: ; preds = %bb31, %bb31, %bb31, %bb31, %bb31, %bb31, %bb31
- ret i32 0
-
-cond_next372: ; preds = %cond_true48
- switch i32 0, label %bb1728 [
- i32 73, label %bb1723
- i32 74, label %cond_true1700
- i32 78, label %bb1718
- i32 85, label %bb1713
- i32 97, label %bb1620
- i32 107, label %AllDone
- i32 112, label %cond_next423
- i32 117, label %cond_next1453
- ]
-
-cond_next423: ; preds = %cond_next372
- switch i16 0, label %cond_next691 [
- i16 18475, label %cond_next807
- i16 18520, label %cond_next807
- ]
-
-cond_next691: ; preds = %cond_next423
- ret i32 0
-
-cond_next807: ; preds = %cond_next423, %cond_next423
- switch i16 0, label %cond_true1192 [
- i16 18475, label %cond_next21.i
- i16 18520, label %cond_next21.i
- ]
-
-cond_next21.i: ; preds = %cond_next807, %cond_next807
- br i1 false, label %cond_next934, label %free.i
-
-free.i: ; preds = %cond_next21.i
- ret i32 0
-
-cond_next934: ; preds = %bb1005, %cond_next21.i
- %listsize.1 = phi i32 [ 0, %bb1005 ], [ 64, %cond_next21.i ] ; <i32> [#uses=1]
- %catalogExtents.2 = phi %struct.HDescriptor* [ %catalogExtents.1.reg2mem.1, %bb1005 ], [ null, %cond_next21.i ] ; <%struct.HDescriptor*> [#uses=3]
- br i1 false, label %cond_next942, label %Return1020
-
-cond_next942: ; preds = %cond_next934
- br i1 false, label %bb1005, label %bb947
-
-bb947: ; preds = %cond_next971, %cond_next942
- %indvar = phi i32 [ 0, %cond_next942 ], [ %indvar.next2140, %cond_next971 ] ; <i32> [#uses=2]
- %catalogExtents.1.reg2mem.0 = phi %struct.HDescriptor* [ %catalogExtents.2, %cond_next942 ], [ %tmp977978, %cond_next971 ] ; <%struct.HDescriptor*> [#uses=1]
- %extents.0.reg2mem.0 = phi %struct.HDescriptor* [ null, %cond_next942 ], [ %tmp977978, %cond_next971 ] ; <%struct.HDescriptor*> [#uses=1]
- br i1 false, label %cond_next971, label %Return1020
-
-cond_next971: ; preds = %bb947
- %tmp = shl i32 %indvar, 6 ; <i32> [#uses=1]
- %listsize.0.reg2mem.0 = add i32 %tmp, %listsize.1 ; <i32> [#uses=1]
- %tmp973 = add i32 %listsize.0.reg2mem.0, 64 ; <i32> [#uses=1]
- %tmp974975 = bitcast %struct.HDescriptor* %extents.0.reg2mem.0 to i8* ; <i8*> [#uses=1]
- %tmp977 = call i8* @realloc( i8* %tmp974975, i32 %tmp973 ) ; <i8*> [#uses=1]
- %tmp977978 = bitcast i8* %tmp977 to %struct.HDescriptor* ; <%struct.HDescriptor*> [#uses=3]
- call void @bcopy( i8* null, i8* null, i32 64 )
- %indvar.next2140 = add i32 %indvar, 1 ; <i32> [#uses=1]
- br i1 false, label %bb1005, label %bb947
-
-bb1005: ; preds = %cond_next971, %cond_next942
- %catalogExtents.1.reg2mem.1 = phi %struct.HDescriptor* [ %catalogExtents.2, %cond_next942 ], [ %tmp977978, %cond_next971 ] ; <%struct.HDescriptor*> [#uses=2]
- br i1 false, label %Return1020, label %cond_next934
-
-Return1020: ; preds = %bb1005, %bb947, %cond_next934
- %catalogExtents.3 = phi %struct.HDescriptor* [ %catalogExtents.1.reg2mem.0, %bb947 ], [ %catalogExtents.2, %cond_next934 ], [ %catalogExtents.1.reg2mem.1, %bb1005 ] ; <%struct.HDescriptor*> [#uses=0]
- ret i32 0
-
-cond_true1192: ; preds = %cond_next807
- ret i32 0
-
-cond_next1453: ; preds = %cond_next372
- ret i32 0
-
-bb1620: ; preds = %cond_next372
- ret i32 0
-
-cond_true1700: ; preds = %cond_next372
- ret i32 0
-
-bb1713: ; preds = %cond_next372
- ret i32 0
-
-bb1718: ; preds = %cond_next372
- ret i32 0
-
-bb1723: ; preds = %cond_next372
- ret i32 0
-
-bb1728: ; preds = %cond_next372
- ret i32 -6
-
-AllDone: ; preds = %cond_next372, %cond_true48
- ret i32 0
-}
-
-declare i8* @realloc(i8*, i32)
diff --git a/release_23/test/CodeGen/PowerPC/2007-11-16-landingpad-split.ll b/release_23/test/CodeGen/PowerPC/2007-11-16-landingpad-split.ll
deleted file mode 100644
index 3ac056dbc266..000000000000
--- a/release_23/test/CodeGen/PowerPC/2007-11-16-landingpad-split.ll
+++ /dev/null
@@ -1,133 +0,0 @@
-; RUN: llvm-as < %s | opt -std-compile-opts | llc -enable-eh
-;; Formerly crashed, see PR 1508
-; ModuleID = '5550437.c'
-target datalayout = "E-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f128:64:128"
-target triple = "powerpc64-apple-darwin8"
- %struct.Range = type { i64, i64 }
-
-define void @Bork(i64 %range.0.0, i64 %range.0.1, i64 %size) {
-entry:
- %range_addr = alloca %struct.Range ; <%struct.Range*> [#uses=5]
- %size_addr = alloca i64 ; <i64*> [#uses=2]
- %size.0 = alloca i64, align 8 ; <i64*> [#uses=6]
- %additionalKeys.5 = alloca i8** ; <i8***> [#uses=2]
- %saved_stack.7 = alloca i8* ; <i8**> [#uses=3]
- %eh_exception = alloca i8* ; <i8**> [#uses=3]
- %eh_selector = alloca i64 ; <i64*> [#uses=1]
- %effectiveRange = alloca %struct.Range, align 8 ; <%struct.Range*> [#uses=2]
- %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
- %tmp = bitcast %struct.Range* %range_addr to { [2 x i64] }* ; <{ [2 x i64] }*> [#uses=1]
- %tmp1 = getelementptr { [2 x i64] }* %tmp, i32 0, i32 0 ; <[2 x i64]*> [#uses=2]
- %tmp2 = getelementptr [2 x i64]* %tmp1, i32 0, i32 0 ; <i64*> [#uses=1]
- store i64 %range.0.0, i64* %tmp2
- %tmp3 = getelementptr [2 x i64]* %tmp1, i32 0, i32 1 ; <i64*> [#uses=1]
- store i64 %range.0.1, i64* %tmp3
- store i64 %size, i64* %size_addr
- %tmp4 = call i8* @llvm.stacksave( ) ; <i8*> [#uses=1]
- store i8* %tmp4, i8** %saved_stack.7, align 8
- %tmp5 = load i64* %size_addr, align 8 ; <i64> [#uses=1]
- store i64 %tmp5, i64* %size.0, align 8
- %tmp6 = load i64* %size.0, align 8 ; <i64> [#uses=1]
- %tmp7 = sub i64 %tmp6, 1 ; <i64> [#uses=0]
- %tmp8 = load i64* %size.0, align 8 ; <i64> [#uses=1]
- %tmp9 = mul i64 %tmp8, 64 ; <i64> [#uses=0]
- %tmp10 = load i64* %size.0, align 8 ; <i64> [#uses=1]
- %tmp11 = mul i64 %tmp10, 8 ; <i64> [#uses=0]
- %tmp12 = load i64* %size.0, align 8 ; <i64> [#uses=1]
- %tmp13 = mul i64 %tmp12, 64 ; <i64> [#uses=0]
- %tmp14 = load i64* %size.0, align 8 ; <i64> [#uses=1]
- %tmp15 = mul i64 %tmp14, 8 ; <i64> [#uses=1]
- %tmp1516 = trunc i64 %tmp15 to i32 ; <i32> [#uses=1]
- %tmp17 = alloca i8, i32 %tmp1516 ; <i8*> [#uses=1]
- %tmp1718 = bitcast i8* %tmp17 to i8** ; <i8**> [#uses=1]
- store i8** %tmp1718, i8*** %additionalKeys.5, align 8
- %tmp19 = load i8*** %additionalKeys.5, align 8 ; <i8**> [#uses=1]
- invoke void @Foo( i8** %tmp19 )
- to label %invcont unwind label %unwind
-
-unwind: ; preds = %bb, %entry
- %eh_ptr = call i8* @llvm.eh.exception( ) ; <i8*> [#uses=1]
- store i8* %eh_ptr, i8** %eh_exception
- %eh_ptr20 = load i8** %eh_exception ; <i8*> [#uses=1]
- %eh_select = call i64 (i8*, i8*, ...)* @llvm.eh.selector.i64( i8* %eh_ptr20, i8* bitcast (void ()* @__gxx_personality_v0 to i8*), i8* null ) ; <i64> [#uses=1]
- store i64 %eh_select, i64* %eh_selector
- br label %cleanup37
-
-invcont: ; preds = %entry
- br label %bb30
-
-bb: ; preds = %cond_true
- %tmp21 = getelementptr %struct.Range* %range_addr, i32 0, i32 0 ; <i64*> [#uses=1]
- %tmp22 = load i64* %tmp21, align 8 ; <i64> [#uses=1]
- invoke void @Bar( i64 %tmp22, %struct.Range* %effectiveRange )
- to label %invcont23 unwind label %unwind
-
-invcont23: ; preds = %bb
- %tmp24 = getelementptr %struct.Range* %range_addr, i32 0, i32 1 ; <i64*> [#uses=1]
- %tmp25 = load i64* %tmp24, align 8 ; <i64> [#uses=1]
- %tmp26 = getelementptr %struct.Range* %effectiveRange, i32 0, i32 1 ; <i64*> [#uses=1]
- %tmp27 = load i64* %tmp26, align 8 ; <i64> [#uses=1]
- %tmp28 = sub i64 %tmp25, %tmp27 ; <i64> [#uses=1]
- %tmp29 = getelementptr %struct.Range* %range_addr, i32 0, i32 1 ; <i64*> [#uses=1]
- store i64 %tmp28, i64* %tmp29, align 8
- br label %bb30
-
-bb30: ; preds = %invcont23, %invcont
- %tmp31 = getelementptr %struct.Range* %range_addr, i32 0, i32 1 ; <i64*> [#uses=1]
- %tmp32 = load i64* %tmp31, align 8 ; <i64> [#uses=1]
- %tmp33 = icmp ne i64 %tmp32, 0 ; <i1> [#uses=1]
- %tmp3334 = zext i1 %tmp33 to i8 ; <i8> [#uses=1]
- %toBool = icmp ne i8 %tmp3334, 0 ; <i1> [#uses=1]
- br i1 %toBool, label %cond_true, label %cond_false
-
-cond_true: ; preds = %bb30
- br label %bb
-
-cond_false: ; preds = %bb30
- br label %bb35
-
-cond_next: ; No predecessors!
- br label %bb35
-
-bb35: ; preds = %cond_next, %cond_false
- br label %cleanup
-
-cleanup: ; preds = %bb35
- %tmp36 = load i8** %saved_stack.7, align 8 ; <i8*> [#uses=1]
- call void @llvm.stackrestore( i8* %tmp36 )
- br label %finally
-
-cleanup37: ; preds = %unwind
- %tmp38 = load i8** %saved_stack.7, align 8 ; <i8*> [#uses=1]
- call void @llvm.stackrestore( i8* %tmp38 )
- br label %Unwind
-
-finally: ; preds = %cleanup
- br label %return
-
-return: ; preds = %finally
- ret void
-
-Unwind: ; preds = %cleanup37
- %eh_ptr39 = load i8** %eh_exception ; <i8*> [#uses=1]
- call void @_Unwind_Resume( i8* %eh_ptr39 )
- unreachable
-}
-
-declare i8* @llvm.stacksave()
-
-declare void @Foo(i8**)
-
-declare i8* @llvm.eh.exception()
-
-declare i64 @llvm.eh.selector.i64(i8*, i8*, ...)
-
-declare i64 @llvm.eh.typeid.for.i64(i8*)
-
-declare void @__gxx_personality_v0()
-
-declare void @_Unwind_Resume(i8*)
-
-declare void @Bar(i64, %struct.Range*)
-
-declare void @llvm.stackrestore(i8*)
diff --git a/release_23/test/CodeGen/PowerPC/2007-11-19-VectorSplitting.ll b/release_23/test/CodeGen/PowerPC/2007-11-19-VectorSplitting.ll
deleted file mode 100644
index 5cccd315535b..000000000000
--- a/release_23/test/CodeGen/PowerPC/2007-11-19-VectorSplitting.ll
+++ /dev/null
@@ -1,16 +0,0 @@
-; RUN: llvm-as < %s | llc
-; RUN: llvm-as < %s | llc -march=ppc32 -mcpu=g3
-; RUN: llvm-as < %s | llc -march=ppc32 -mcpu=g5
-; PR1811
-
-define void @execute_shader(<4 x float>* %OUT, <4 x float>* %IN, <4 x float>*
-%CONST) {
-entry:
- %input2 = load <4 x float>* null, align 16 ; <<4 x float>>
- %shuffle7 = shufflevector <4 x float> %input2, <4 x float> < float 0.000000e+00, float 1.000000e+00, float 0.000000e+00, float 1.000000e+00 >, <4 x i32> < i32 2, i32 2, i32 2, i32 2 > ; <<4 x float>> [#uses=1]
-
- %mul1 = mul <4 x float> %shuffle7, zeroinitializer ; <<4 x
- %add2 = add <4 x float> %mul1, %input2 ; <<4 x float>>
- store <4 x float> %add2, <4 x float>* null, align 16
- ret void
-}
diff --git a/release_23/test/CodeGen/PowerPC/2008-01-25-EmptyFunction.ll b/release_23/test/CodeGen/PowerPC/2008-01-25-EmptyFunction.ll
deleted file mode 100644
index 38ae87ce8c00..000000000000
--- a/release_23/test/CodeGen/PowerPC/2008-01-25-EmptyFunction.ll
+++ /dev/null
@@ -1,8 +0,0 @@
-; RUN: llvm-as < %s | llc -march=ppc32 | grep nop
-target triple = "powerpc-apple-darwin8"
-
-
-define void @bork() noreturn nounwind {
-entry:
- unreachable
-}
diff --git a/release_23/test/CodeGen/PowerPC/2008-02-05-LiveIntervalsAssert.ll b/release_23/test/CodeGen/PowerPC/2008-02-05-LiveIntervalsAssert.ll
deleted file mode 100644
index 5b9cd1d8408f..000000000000
--- a/release_23/test/CodeGen/PowerPC/2008-02-05-LiveIntervalsAssert.ll
+++ /dev/null
@@ -1,67 +0,0 @@
-; RUN: llvm-as < %s | llc -mtriple=powerpc-apple-darwin
-
- %struct.Handle = type { %struct.oopDesc** }
- %struct.JNI_ArgumentPusher = type { %struct.SignatureIterator, %struct.JavaCallArguments* }
- %struct.JNI_ArgumentPusherArray = type { %struct.JNI_ArgumentPusher, %struct.JvmtiEventEnabled* }
- %struct.JavaCallArguments = type { [9 x i32], [9 x i32], i32*, i32*, i32, i32, i32 }
- %struct.JvmtiEventEnabled = type { i64 }
- %struct.KlassHandle = type { %struct.Handle }
- %struct.SignatureIterator = type { i32 (...)**, %struct.KlassHandle, i32, i32, i32 }
- %struct.instanceOopDesc = type { %struct.oopDesc }
- %struct.oopDesc = type { %struct.instanceOopDesc*, %struct.instanceOopDesc* }
-@.str = external constant [44 x i8] ; <[44 x i8]*> [#uses=1]
-
-define void @_ZN23JNI_ArgumentPusherArray7iterateEy(%struct.JNI_ArgumentPusherArray* %this, i64 %fingerprint) nounwind {
-entry:
- br label %bb113
-
-bb22.preheader: ; preds = %bb113
- ret void
-
-bb32.preheader: ; preds = %bb113
- ret void
-
-bb42.preheader: ; preds = %bb113
- ret void
-
-bb52: ; preds = %bb113
- br label %bb113
-
-bb62.preheader: ; preds = %bb113
- ret void
-
-bb72.preheader: ; preds = %bb113
- ret void
-
-bb82: ; preds = %bb113
- br label %bb113
-
-bb93: ; preds = %bb113
- br label %bb113
-
-bb103.preheader: ; preds = %bb113
- ret void
-
-bb113: ; preds = %bb113, %bb93, %bb82, %bb52, %entry
- %fingerprint_addr.0.reg2mem.9 = phi i64 [ 0, %entry ], [ 0, %bb52 ], [ 0, %bb82 ], [ 0, %bb93 ], [ %tmp118, %bb113 ] ; <i64> [#uses=1]
- tail call void @_Z28report_should_not_reach_herePKci( i8* getelementptr ([44 x i8]* @.str, i32 0, i32 0), i32 817 ) nounwind
- %tmp118 = lshr i64 %fingerprint_addr.0.reg2mem.9, 4 ; <i64> [#uses=2]
- %tmp21158 = and i64 %tmp118, 15 ; <i64> [#uses=1]
- switch i64 %tmp21158, label %bb113 [
- i64 1, label %bb22.preheader
- i64 2, label %bb52
- i64 3, label %bb32.preheader
- i64 4, label %bb42.preheader
- i64 5, label %bb62.preheader
- i64 6, label %bb82
- i64 7, label %bb93
- i64 8, label %bb103.preheader
- i64 9, label %bb72.preheader
- i64 10, label %UnifiedReturnBlock
- ]
-
-UnifiedReturnBlock: ; preds = %bb113
- ret void
-}
-
-declare void @_Z28report_should_not_reach_herePKci(i8*, i32)
diff --git a/release_23/test/CodeGen/PowerPC/2008-02-09-LocalRegAllocAssert.ll b/release_23/test/CodeGen/PowerPC/2008-02-09-LocalRegAllocAssert.ll
deleted file mode 100644
index 5edf6b761fe8..000000000000
--- a/release_23/test/CodeGen/PowerPC/2008-02-09-LocalRegAllocAssert.ll
+++ /dev/null
@@ -1,10 +0,0 @@
-; RUN: llvm-as < %s | llc -mtriple=powerpc-apple-darwin -regalloc=local
-
-define i32 @bork(i64 %foo, i64 %bar) {
-entry:
- %tmp = load i64* null, align 8 ; <i64> [#uses=2]
- %tmp2 = icmp ule i64 %tmp, 0 ; <i1> [#uses=1]
- %min = select i1 %tmp2, i64 %tmp, i64 0 ; <i64> [#uses=1]
- store i64 %min, i64* null, align 8
- ret i32 0
-}
diff --git a/release_23/test/CodeGen/PowerPC/2008-03-05-RegScavengerAssert.ll b/release_23/test/CodeGen/PowerPC/2008-03-05-RegScavengerAssert.ll
deleted file mode 100644
index 8101a35a4fb4..000000000000
--- a/release_23/test/CodeGen/PowerPC/2008-03-05-RegScavengerAssert.ll
+++ /dev/null
@@ -1,18 +0,0 @@
-; RUN: llvm-as < %s | llc -mtriple=powerpc-apple-darwin -enable-ppc32-regscavenger
-
-declare i8* @bar(i32)
-
-define void @foo(i8* %pp) nounwind {
-entry:
- %tmp2 = tail call i8* @bar( i32 14 ) nounwind ; <i8*> [#uses=0]
- %tmp28 = bitcast i8* %pp to void ()** ; <void ()**> [#uses=1]
- %tmp38 = load void ()** %tmp28, align 4 ; <void ()*> [#uses=2]
- br i1 false, label %bb34, label %bb25
-bb25: ; preds = %entry
- %tmp30 = bitcast void ()* %tmp38 to void (i8*)* ; <void (i8*)*> [#uses=1]
- tail call void %tmp30( i8* null ) nounwind
- ret void
-bb34: ; preds = %entry
- tail call void %tmp38( ) nounwind
- ret void
-}
diff --git a/release_23/test/CodeGen/PowerPC/2008-03-06-KillInfo.ll b/release_23/test/CodeGen/PowerPC/2008-03-06-KillInfo.ll
deleted file mode 100644
index 919de33234b8..000000000000
--- a/release_23/test/CodeGen/PowerPC/2008-03-06-KillInfo.ll
+++ /dev/null
@@ -1,21 +0,0 @@
-; RUN: llvm-as < %s | llc -march=ppc64 -enable-ppc64-regscavenger
-@.str242 = external constant [3 x i8] ; <[3 x i8]*> [#uses=1]
-
-define fastcc void @ParseContent(i8* %buf, i32 %bufsize) {
-entry:
- %items = alloca [10000 x i8*], align 16 ; <[10000 x i8*]*> [#uses=0]
- %tmp86 = add i32 0, -1 ; <i32> [#uses=1]
- br i1 false, label %cond_true94, label %cond_next99
-cond_true94: ; preds = %entry
- %tmp98 = call i32 (i8*, ...)* @printf( i8* getelementptr ([3 x i8]* @.str242, i32 0, i32 0), i8* null ) ; <i32> [#uses=0]
- %tmp20971 = icmp sgt i32 %tmp86, 0 ; <i1> [#uses=1]
- br i1 %tmp20971, label %bb101, label %bb212
-cond_next99: ; preds = %entry
- ret void
-bb101: ; preds = %cond_true94
- ret void
-bb212: ; preds = %cond_true94
- ret void
-}
-
-declare i32 @printf(i8*, ...)
diff --git a/release_23/test/CodeGen/PowerPC/2008-03-17-RegScavengerCrash.ll b/release_23/test/CodeGen/PowerPC/2008-03-17-RegScavengerCrash.ll
deleted file mode 100644
index eaeccc5f27a4..000000000000
--- a/release_23/test/CodeGen/PowerPC/2008-03-17-RegScavengerCrash.ll
+++ /dev/null
@@ -1,31 +0,0 @@
-; RUN: llvm-as < %s | llc -march=ppc32 -enable-ppc32-regscavenger
-
- %struct._cpp_strbuf = type { i8*, i32, i32 }
- %struct.cpp_string = type { i32, i8* }
-
-declare fastcc void @emit_numeric_escape(i32, i32, %struct._cpp_strbuf*, i32) nounwind
-
-define i32 @cpp_interpret_string(i32 %pfile, %struct.cpp_string* %from, i32 %wide) nounwind {
-entry:
- %tmp61 = load i32* null, align 4 ; <i32> [#uses=1]
- %toBool = icmp eq i32 %wide, 0 ; <i1> [#uses=2]
- %iftmp.87.0 = select i1 %toBool, i32 %tmp61, i32 0 ; <i32> [#uses=2]
- %tmp69 = icmp ult i32 %iftmp.87.0, 33 ; <i1> [#uses=1]
- %min = select i1 %tmp69, i32 %iftmp.87.0, i32 32 ; <i32> [#uses=1]
- %tmp71 = icmp ugt i32 %min, 31 ; <i1> [#uses=1]
- br i1 %tmp71, label %bb79, label %bb75
-bb75: ; preds = %entry
- ret i32 0
-bb79: ; preds = %entry
- br i1 %toBool, label %bb103, label %bb94
-bb94: ; preds = %bb79
- br i1 false, label %bb729, label %bb130.preheader
-bb103: ; preds = %bb79
- ret i32 0
-bb130.preheader: ; preds = %bb94
- %tmp134 = getelementptr %struct.cpp_string* %from, i32 0, i32 1 ; <i8**> [#uses=0]
- ret i32 0
-bb729: ; preds = %bb94
- call fastcc void @emit_numeric_escape( i32 %pfile, i32 0, %struct._cpp_strbuf* null, i32 %wide ) nounwind
- ret i32 1
-}
diff --git a/release_23/test/CodeGen/PowerPC/2008-03-18-RegScavengerAssert.ll b/release_23/test/CodeGen/PowerPC/2008-03-18-RegScavengerAssert.ll
deleted file mode 100644
index 061c585c7476..000000000000
--- a/release_23/test/CodeGen/PowerPC/2008-03-18-RegScavengerAssert.ll
+++ /dev/null
@@ -1,6 +0,0 @@
-; RUN: llvm-as < %s | llc -march=ppc64 -enable-ppc64-regscavenger
-
-define i16 @test(i8* %d1, i16* %d2) {
- %tmp237 = call i16 asm "lhbrx $0, $2, $1", "=r,r,bO,m"( i8* %d1, i32 0, i16* %d2 )
- ret i16 %tmp237
-}
diff --git a/release_23/test/CodeGen/PowerPC/2008-03-24-AddressRegImm.ll b/release_23/test/CodeGen/PowerPC/2008-03-24-AddressRegImm.ll
deleted file mode 100644
index 395c986a8412..000000000000
--- a/release_23/test/CodeGen/PowerPC/2008-03-24-AddressRegImm.ll
+++ /dev/null
@@ -1,25 +0,0 @@
-; RUN: llvm-as < %s | llc -march=ppc64
-
-define fastcc i8* @page_rec_get_next(i8* %rec) nounwind {
-entry:
- %tmp2627 = ptrtoint i8* %rec to i64 ; <i64> [#uses=2]
- %tmp28 = and i64 %tmp2627, -16384 ; <i64> [#uses=2]
- %tmp2829 = inttoptr i64 %tmp28 to i8* ; <i8*> [#uses=1]
- %tmp37 = getelementptr i8* %tmp2829, i64 42 ; <i8*> [#uses=1]
- %tmp40 = load i8* %tmp37, align 1 ; <i8> [#uses=1]
- %tmp4041 = zext i8 %tmp40 to i64 ; <i64> [#uses=1]
- %tmp42 = shl i64 %tmp4041, 8 ; <i64> [#uses=1]
- %tmp47 = add i64 %tmp42, 0 ; <i64> [#uses=1]
- %tmp52 = and i64 %tmp47, 32768 ; <i64> [#uses=1]
- %tmp72 = icmp eq i64 %tmp52, 0 ; <i1> [#uses=1]
- br i1 %tmp72, label %bb91, label %bb
-bb: ; preds = %entry
- ret i8* null
-bb91: ; preds = %entry
- br i1 false, label %bb100, label %bb185
-bb100: ; preds = %bb91
- %tmp106 = sub i64 %tmp2627, %tmp28 ; <i64> [#uses=0]
- ret i8* null
-bb185: ; preds = %bb91
- ret i8* null
-}
diff --git a/release_23/test/CodeGen/PowerPC/2008-03-24-CoalescerBug.ll b/release_23/test/CodeGen/PowerPC/2008-03-24-CoalescerBug.ll
deleted file mode 100644
index 67c167aca127..000000000000
--- a/release_23/test/CodeGen/PowerPC/2008-03-24-CoalescerBug.ll
+++ /dev/null
@@ -1,30 +0,0 @@
-; RUN: llvm-as < %s | llc -march=ppc32
-
- %struct..0objc_object = type { %struct.objc_class* }
- %struct.NSArray = type { %struct..0objc_object }
- %struct.NSMutableArray = type { %struct.NSArray }
- %struct.PFTPersistentSymbols = type { %struct..0objc_object, %struct.VMUSymbolicator*, %struct.NSMutableArray*, %struct.__CFDictionary*, %struct.__CFDictionary*, %struct.__CFDictionary*, %struct.__CFDictionary*, %struct.NSMutableArray*, i8, %struct.pthread_mutex_t, %struct.NSMutableArray*, %struct.pthread_rwlock_t }
- %struct.VMUMachTaskContainer = type { %struct..0objc_object, i32, i32 }
- %struct.VMUSymbolicator = type { %struct..0objc_object, %struct.NSMutableArray*, %struct.NSArray*, %struct.NSArray*, %struct.VMUMachTaskContainer*, i8 }
- %struct.__CFDictionary = type opaque
- %struct.__builtin_CFString = type { i32*, i32, i8*, i32 }
- %struct.objc_class = type opaque
- %struct.objc_selector = type opaque
- %struct.pthread_mutex_t = type { i32, [40 x i8] }
- %struct.pthread_rwlock_t = type { i32, [124 x i8] }
-external constant %struct.__builtin_CFString ; <%struct.__builtin_CFString*>:0 [#uses=1]
-
-define void @"-[PFTPersistentSymbols saveSymbolWithName:address:path:lineNumber:flags:owner:]"(%struct.PFTPersistentSymbols* %self, %struct.objc_selector* %_cmd, %struct.NSArray* %name, i64 %address, %struct.NSArray* %path, i32 %lineNumber, i64 %flags, %struct..0objc_object* %owner) nounwind {
-entry:
- br i1 false, label %bb12, label %bb21
-bb12: ; preds = %entry
- %tmp17 = tail call i8 inttoptr (i64 4294901504 to i8 (%struct..0objc_object*, %struct.objc_selector*, %struct.NSArray*)*)( %struct..0objc_object* null, %struct.objc_selector* null, %struct.NSArray* bitcast (%struct.__builtin_CFString* @0 to %struct.NSArray*) ) signext nounwind ; <i8> [#uses=0]
- br i1 false, label %bb25, label %bb21
-bb21: ; preds = %bb12, %entry
- %tmp24 = or i64 %flags, 4 ; <i64> [#uses=1]
- br label %bb25
-bb25: ; preds = %bb21, %bb12
- %flags_addr.0 = phi i64 [ %tmp24, %bb21 ], [ %flags, %bb12 ] ; <i64> [#uses=1]
- %tmp3233 = trunc i64 %flags_addr.0 to i32 ; <i32> [#uses=0]
- ret void
-}
diff --git a/release_23/test/CodeGen/PowerPC/2008-03-26-CoalescerBug.ll b/release_23/test/CodeGen/PowerPC/2008-03-26-CoalescerBug.ll
deleted file mode 100644
index 0b748d20b7ca..000000000000
--- a/release_23/test/CodeGen/PowerPC/2008-03-26-CoalescerBug.ll
+++ /dev/null
@@ -1,28 +0,0 @@
-; RUN: llvm-as < %s | llc -mtriple=powerpc-apple-darwin
-
-define i32 @t(i64 %byteStart, i32 %activeIndex) nounwind {
-entry:
- %tmp50 = load i32* null, align 4 ; <i32> [#uses=1]
- %tmp5051 = zext i32 %tmp50 to i64 ; <i64> [#uses=3]
- %tmp53 = udiv i64 %byteStart, %tmp5051 ; <i64> [#uses=1]
- %tmp5354 = trunc i64 %tmp53 to i32 ; <i32> [#uses=1]
- %tmp62 = urem i64 %byteStart, %tmp5051 ; <i64> [#uses=1]
- %tmp94 = add i32 0, 1 ; <i32> [#uses=1]
- %tmp100 = urem i32 %tmp94, 0 ; <i32> [#uses=2]
- %tmp108 = add i32 0, %activeIndex ; <i32> [#uses=1]
- %tmp110 = sub i32 %tmp108, 0 ; <i32> [#uses=1]
- %tmp112 = urem i32 %tmp110, 0 ; <i32> [#uses=2]
- %tmp122 = icmp ult i32 %tmp112, %tmp100 ; <i1> [#uses=1]
- %iftmp.175.0 = select i1 %tmp122, i32 %tmp112, i32 %tmp100 ; <i32> [#uses=1]
- %tmp119 = add i32 %tmp5354, 0 ; <i32> [#uses=1]
- %tmp131 = add i32 %tmp119, %iftmp.175.0 ; <i32> [#uses=1]
- %tmp131132 = zext i32 %tmp131 to i64 ; <i64> [#uses=1]
- %tmp147 = mul i64 %tmp131132, %tmp5051 ; <i64> [#uses=1]
- br i1 false, label %bb164, label %bb190
-bb164: ; preds = %entry
- %tmp171172 = and i64 %tmp62, 4294967295 ; <i64> [#uses=1]
- %tmp173 = add i64 %tmp171172, %tmp147 ; <i64> [#uses=0]
- ret i32 0
-bb190: ; preds = %entry
- ret i32 0
-}
diff --git a/release_23/test/CodeGen/PowerPC/2008-04-10-LiveIntervalCrash.ll b/release_23/test/CodeGen/PowerPC/2008-04-10-LiveIntervalCrash.ll
deleted file mode 100644
index 410736d5872d..000000000000
--- a/release_23/test/CodeGen/PowerPC/2008-04-10-LiveIntervalCrash.ll
+++ /dev/null
@@ -1,100 +0,0 @@
-; RUN: llvm-as < %s | llc -mtriple=powerpc-apple-darwin
-
-define fastcc i64 @nonzero_bits1() nounwind {
-entry:
- switch i32 0, label %bb1385 [
- i32 28, label %bb235
- i32 35, label %bb153
- i32 37, label %bb951
- i32 40, label %bb289
- i32 44, label %bb1344
- i32 46, label %bb651
- i32 47, label %bb651
- i32 48, label %bb322
- i32 49, label %bb651
- i32 50, label %bb651
- i32 51, label %bb651
- i32 52, label %bb651
- i32 53, label %bb651
- i32 54, label %bb535
- i32 55, label %bb565
- i32 56, label %bb565
- i32 58, label %bb1100
- i32 59, label %bb1100
- i32 60, label %bb1100
- i32 61, label %bb1100
- i32 63, label %bb565
- i32 64, label %bb565
- i32 65, label %bb565
- i32 66, label %bb565
- i32 73, label %bb302
- i32 74, label %bb302
- i32 75, label %bb302
- i32 76, label %bb302
- i32 77, label %bb302
- i32 78, label %bb302
- i32 79, label %bb302
- i32 80, label %bb302
- i32 81, label %bb302
- i32 82, label %bb302
- i32 83, label %bb302
- i32 84, label %bb302
- i32 85, label %bb302
- i32 86, label %bb302
- i32 87, label %bb302
- i32 88, label %bb302
- i32 89, label %bb302
- i32 90, label %bb302
- i32 91, label %bb507
- i32 92, label %bb375
- i32 93, label %bb355
- i32 103, label %bb1277
- i32 104, label %bb1310
- i32 105, label %UnifiedReturnBlock
- i32 106, label %bb1277
- i32 107, label %bb1343
- ]
-bb153: ; preds = %entry
- ret i64 0
-bb235: ; preds = %entry
- br i1 false, label %bb245, label %UnifiedReturnBlock
-bb245: ; preds = %bb235
- ret i64 0
-bb289: ; preds = %entry
- ret i64 0
-bb302: ; preds = %entry, %entry, %entry, %entry, %entry, %entry, %entry, %entry, %entry, %entry, %entry, %entry, %entry, %entry, %entry, %entry, %entry, %entry
- ret i64 0
-bb322: ; preds = %entry
- ret i64 0
-bb355: ; preds = %entry
- ret i64 0
-bb375: ; preds = %entry
- ret i64 0
-bb507: ; preds = %entry
- ret i64 0
-bb535: ; preds = %entry
- ret i64 0
-bb565: ; preds = %entry, %entry, %entry, %entry, %entry, %entry
- ret i64 0
-bb651: ; preds = %entry, %entry, %entry, %entry, %entry, %entry, %entry
- ret i64 0
-bb951: ; preds = %entry
- ret i64 0
-bb1100: ; preds = %entry, %entry, %entry, %entry
- ret i64 0
-bb1277: ; preds = %entry, %entry
- br i1 false, label %UnifiedReturnBlock, label %bb1284
-bb1284: ; preds = %bb1277
- ret i64 0
-bb1310: ; preds = %entry
- ret i64 0
-bb1343: ; preds = %entry
- ret i64 1
-bb1344: ; preds = %entry
- ret i64 0
-bb1385: ; preds = %entry
- ret i64 0
-UnifiedReturnBlock: ; preds = %bb1277, %bb235, %entry
- %UnifiedRetVal = phi i64 [ 0, %bb235 ], [ undef, %bb1277 ], [ -1, %entry ] ; <i64> [#uses=1]
- ret i64 %UnifiedRetVal
-}
diff --git a/release_23/test/CodeGen/PowerPC/2008-04-16-CoalescerBug.ll b/release_23/test/CodeGen/PowerPC/2008-04-16-CoalescerBug.ll
deleted file mode 100644
index 357ab100d2d4..000000000000
--- a/release_23/test/CodeGen/PowerPC/2008-04-16-CoalescerBug.ll
+++ /dev/null
@@ -1,14 +0,0 @@
-; RUN: llvm-as < %s | llc -mtriple=powerpc-apple-darwin
-; Avoid reading memory that's already freed.
-
-@llvm.used = appending global [1 x i8*] [ i8* bitcast (i32 (i64)* @_Z13GetSectorSizey to i8*) ], section "llvm.metadata" ; <[1 x i8*]*> [#uses=0]
-
-define i32 @_Z13GetSectorSizey(i64 %Base) nounwind {
-entry:
- br i1 false, label %bb, label %UnifiedReturnBlock
-bb: ; preds = %entry
- %tmp10 = and i64 0, %Base ; <i64> [#uses=0]
- ret i32 0
-UnifiedReturnBlock: ; preds = %entry
- ret i32 131072
-}
diff --git a/release_23/test/CodeGen/PowerPC/2008-04-23-CoalescerCrash.ll b/release_23/test/CodeGen/PowerPC/2008-04-23-CoalescerCrash.ll
deleted file mode 100644
index a390e522686d..000000000000
--- a/release_23/test/CodeGen/PowerPC/2008-04-23-CoalescerCrash.ll
+++ /dev/null
@@ -1,89 +0,0 @@
-; RUN: llvm-as < %s | llc -mtriple=powerpc-apple-darwin
-
-@_ZL10DeviceCode = internal global i16 0 ; <i16*> [#uses=1]
-@.str19 = internal constant [64 x i8] c"unlock_then_erase_sector: failed to erase block (status= 0x%x)\0A\00" ; <[64 x i8]*> [#uses=1]
-@.str34 = internal constant [68 x i8] c"ProgramByWords - Erasing sector 0x%llx to 0x%llx (size 0x%x bytes)\0A\00" ; <[68 x i8]*> [#uses=1]
-@.str35 = internal constant [37 x i8] c"ProgramByWords - Done erasing flash\0A\00" ; <[37 x i8]*> [#uses=1]
-@.str36 = internal constant [48 x i8] c"ProgramByWords - Starting to write to FLASH...\0A\00" ; <[48 x i8]*> [#uses=1]
-
-declare void @IOLog(i8*, ...)
-
-declare void @IODelay(i32)
-
-define i32 @_Z14ProgramByWordsPvyy(i8* %buffer, i64 %Offset, i64 %bufferSize) nounwind {
-entry:
- volatile store i8 -1, i8* null, align 1
- %tmp28 = icmp eq i8 0, 0 ; <i1> [#uses=1]
- br i1 %tmp28, label %bb107, label %bb
-
-bb: ; preds = %entry
- %tmp9596430 = zext i32 0 to i64 ; <i64> [#uses=1]
- %tmp98431 = add i64 %tmp9596430, %Offset ; <i64> [#uses=1]
- %tmp100433 = icmp ugt i64 %tmp98431, %Offset ; <i1> [#uses=1]
- br i1 %tmp100433, label %bb31, label %bb103
-
-bb31: ; preds = %_Z24unlock_then_erase_sectory.exit, %bb
- %Pos.0.reg2mem.0 = phi i64 [ %tmp93, %_Z24unlock_then_erase_sectory.exit ], [ %Offset, %bb ] ; <i64> [#uses=3]
- %tmp35 = load i16* @_ZL10DeviceCode, align 2 ; <i16> [#uses=1]
- %tmp3536 = zext i16 %tmp35 to i32 ; <i32> [#uses=2]
- %tmp37 = and i32 %tmp3536, 65520 ; <i32> [#uses=1]
- %tmp38 = icmp eq i32 %tmp37, 35008 ; <i1> [#uses=1]
- %tmp34 = sub i64 %Pos.0.reg2mem.0, %Offset ; <i64> [#uses=2]
- br i1 %tmp38, label %bb41, label %bb68
-
-bb41: ; preds = %bb31
- %tmp43 = add i32 0, -1 ; <i32> [#uses=1]
- %tmp4344 = zext i32 %tmp43 to i64 ; <i64> [#uses=1]
- %tmp46 = and i64 %tmp4344, %tmp34 ; <i64> [#uses=0]
- %tmp49 = and i32 %tmp3536, 1 ; <i32> [#uses=0]
- ret i32 0
-
-bb68: ; preds = %bb31
- tail call void (i8*, ...)* @IOLog( i8* getelementptr ([68 x i8]* @.str34, i32 0, i32 0), i64 %tmp34, i64 0, i32 131072 ) nounwind
- %tmp2021.i = trunc i64 %Pos.0.reg2mem.0 to i32 ; <i32> [#uses=1]
- %tmp202122.i = inttoptr i32 %tmp2021.i to i8* ; <i8*> [#uses=1]
- tail call void @IODelay( i32 500 ) nounwind
- %tmp53.i = volatile load i16* null, align 2 ; <i16> [#uses=2]
- %tmp5455.i = zext i16 %tmp53.i to i32 ; <i32> [#uses=1]
- br i1 false, label %bb.i, label %bb65.i
-
-bb.i: ; preds = %bb68
- ret i32 0
-
-bb65.i: ; preds = %bb68
- %tmp67.i = icmp eq i16 %tmp53.i, 128 ; <i1> [#uses=1]
- br i1 %tmp67.i, label %_Z24unlock_then_erase_sectory.exit, label %bb70.i
-
-bb70.i: ; preds = %bb65.i
- tail call void (i8*, ...)* @IOLog( i8* getelementptr ([64 x i8]* @.str19, i32 0, i32 0), i32 %tmp5455.i ) nounwind
- ret i32 0
-
-_Z24unlock_then_erase_sectory.exit: ; preds = %bb65.i
- volatile store i8 -1, i8* %tmp202122.i, align 1
- %tmp93 = add i64 0, %Pos.0.reg2mem.0 ; <i64> [#uses=2]
- %tmp98 = add i64 0, %Offset ; <i64> [#uses=1]
- %tmp100 = icmp ugt i64 %tmp98, %tmp93 ; <i1> [#uses=1]
- br i1 %tmp100, label %bb31, label %bb103
-
-bb103: ; preds = %_Z24unlock_then_erase_sectory.exit, %bb
- tail call void (i8*, ...)* @IOLog( i8* getelementptr ([37 x i8]* @.str35, i32 0, i32 0) ) nounwind
- ret i32 0
-
-bb107: ; preds = %entry
- tail call void (i8*, ...)* @IOLog( i8* getelementptr ([48 x i8]* @.str36, i32 0, i32 0) ) nounwind
- %tmp114115 = bitcast i8* %buffer to i16* ; <i16*> [#uses=1]
- %tmp256 = lshr i64 %bufferSize, 1 ; <i64> [#uses=1]
- %tmp256257 = trunc i64 %tmp256 to i32 ; <i32> [#uses=1]
- %tmp258 = getelementptr i16* %tmp114115, i32 %tmp256257 ; <i16*> [#uses=0]
- ret i32 0
-}
-
-define i32 @_Z17program_64B_blockyPm(i64 %Base, i32* %pData) nounwind {
-entry:
- unreachable
-}
-
-define i32 @_Z15ProgramByBlocksyy(i64 %Offset, i64 %bufferSize) nounwind {
-entry:
- ret i32 0
-}
diff --git a/release_23/test/CodeGen/PowerPC/2008-05-01-ppc_fp128.ll b/release_23/test/CodeGen/PowerPC/2008-05-01-ppc_fp128.ll
deleted file mode 100644
index 5c40b9e0aed9..000000000000
--- a/release_23/test/CodeGen/PowerPC/2008-05-01-ppc_fp128.ll
+++ /dev/null
@@ -1,15 +0,0 @@
-; RUN: llvm-as < %s | llc -march=ppc32
-target triple = "powerpc-apple-darwin9.2.2"
-
-define i256 @func(ppc_fp128 %a, ppc_fp128 %b, ppc_fp128 %c, ppc_fp128 %d) nounwind readnone {
-entry:
- br i1 false, label %bb36, label %bb484
-
-bb36: ; preds = %entry
- %tmp124 = fcmp ord ppc_fp128 %b, 0xM00000000000000000000000000000000 ; <i1> [#uses=1]
- %tmp140 = and i1 %tmp124, fcmp une (ppc_fp128 0xM00000000000000000000000000000000, ppc_fp128 0xM00000000000000000000000000000000) ; <i1> [#uses=0]
- unreachable
-
-bb484: ; preds = %entry
- ret i256 0
-}
diff --git a/release_23/test/CodeGen/PowerPC/Frames-alloca.ll b/release_23/test/CodeGen/PowerPC/Frames-alloca.ll
deleted file mode 100644
index 45c13a7bfe41..000000000000
--- a/release_23/test/CodeGen/PowerPC/Frames-alloca.ll
+++ /dev/null
@@ -1,37 +0,0 @@
-; RUN: llvm-as < %s | llc -march=ppc32 -mtriple=powerpc-apple-darwin8 | \
-; RUN: grep {stw r31, 20(r1)}
-; RUN: llvm-as < %s | llc -march=ppc32 -mtriple=powerpc-apple-darwin8 -enable-ppc32-regscavenger | \
-; RUN: grep {stwu r1, -80(r1)}
-; RUN: llvm-as < %s | llc -march=ppc32 -mtriple=powerpc-apple-darwin8 | \
-; RUN: grep {lwz r1, 0(r1)}
-; RUN: llvm-as < %s | llc -march=ppc32 -mtriple=powerpc-apple-darwin8 | \
-; RUN: grep {lwz r31, 20(r1)}
-; RUN: llvm-as < %s | llc -march=ppc32 -mtriple=powerpc-apple-darwin8 -disable-fp-elim | \
-; RUN: grep {stw r31, 20(r1)}
-; RUN: llvm-as < %s | llc -march=ppc32 -mtriple=powerpc-apple-darwin8 -disable-fp-elim -enable-ppc32-regscavenger | \
-; RUN: grep {stwu r1, -80(r1)}
-; RUN: llvm-as < %s | llc -march=ppc32 -mtriple=powerpc-apple-darwin8 -disable-fp-elim | \
-; RUN: grep {lwz r1, 0(r1)}
-; RUN: llvm-as < %s | llc -march=ppc32 -mtriple=powerpc-apple-darwin8 -disable-fp-elim | \
-; RUN: grep {lwz r31, 20(r1)}
-; RUN: llvm-as < %s | llc -march=ppc64 -mtriple=powerpc-apple-darwin8 | \
-; RUN: grep {std r31, 40(r1)}
-; RUN: llvm-as < %s | llc -march=ppc64 -mtriple=powerpc-apple-darwin8 | \
-; RUN: grep {stdu r1, -112(r1)}
-; RUN: llvm-as < %s | llc -march=ppc64 -mtriple=powerpc-apple-darwin8 | \
-; RUN: grep {ld r1, 0(r1)}
-; RUN: llvm-as < %s | llc -march=ppc64 -mtriple=powerpc-apple-darwin8 | \
-; RUN: grep {ld r31, 40(r1)}
-; RUN: llvm-as < %s | llc -march=ppc64 -mtriple=powerpc-apple-darwin8 -disable-fp-elim | \
-; RUN: grep {std r31, 40(r1)}
-; RUN: llvm-as < %s | llc -march=ppc64 -mtriple=powerpc-apple-darwin8 -disable-fp-elim | \
-; RUN: grep {stdu r1, -112(r1)}
-; RUN: llvm-as < %s | llc -march=ppc64 -mtriple=powerpc-apple-darwin8 -disable-fp-elim | \
-; RUN: grep {ld r1, 0(r1)}
-; RUN: llvm-as < %s | llc -march=ppc64 -mtriple=powerpc-apple-darwin8 -disable-fp-elim | \
-; RUN: grep {ld r31, 40(r1)}
-
-define i32* @f1(i32 %n) {
- %tmp = alloca i32, i32 %n ; <i32*> [#uses=1]
- ret i32* %tmp
-}
diff --git a/release_23/test/CodeGen/PowerPC/Frames-large.ll b/release_23/test/CodeGen/PowerPC/Frames-large.ll
deleted file mode 100644
index 0a15d2233e79..000000000000
--- a/release_23/test/CodeGen/PowerPC/Frames-large.ll
+++ /dev/null
@@ -1,77 +0,0 @@
-; RUN: llvm-as < %s | \
-; RUN: llc -march=ppc32 -mtriple=powerpc-apple-darwin8 | \
-; RUN: not grep {stw r31, 20(r1)}
-; RUN: llvm-as < %s | \
-; RUN: llc -march=ppc32 -mtriple=powerpc-apple-darwin8 | grep {lis r0, -1}
-; RUN: llvm-as < %s | \
-; RUN: llc -march=ppc32 -mtriple=powerpc-apple-darwin8 | \
-; RUN: grep {ori r0, r0, 32704}
-; RUN: llvm-as < %s | \
-; RUN: llc -march=ppc32 -mtriple=powerpc-apple-darwin8 | \
-; RUN: grep {stwux r1, r1, r0}
-; RUN: llvm-as < %s | \
-; RUN: llc -march=ppc32 -mtriple=powerpc-apple-darwin8 | \
-; RUN: grep {lwz r1, 0(r1)}
-; RUN: llvm-as < %s | \
-; RUN: llc -march=ppc32 -mtriple=powerpc-apple-darwin8 | \
-; RUN: not grep {lwz r31, 20(r1)}
-; RUN: llvm-as < %s | \
-; RUN: llc -march=ppc32 -mtriple=powerpc-apple-darwin8 -disable-fp-elim | \
-; RUN: grep {stw r31, 20(r1)}
-; RUN: llvm-as < %s | \
-; RUN: llc -march=ppc32 -mtriple=powerpc-apple-darwin8 -disable-fp-elim | \
-; RUN: grep {lis r0, -1}
-; RUN: llvm-as < %s | \
-; RUN: llc -march=ppc32 -mtriple=powerpc-apple-darwin8 -disable-fp-elim | \
-; RUN: grep {ori r0, r0, 32704}
-; RUN: llvm-as < %s | \
-; RUN: llc -march=ppc32 -mtriple=powerpc-apple-darwin8 -disable-fp-elim | \
-; RUN: grep {stwux r1, r1, r0}
-; RUN: llvm-as < %s | \
-; RUN: llc -march=ppc32 -mtriple=powerpc-apple-darwin8 -disable-fp-elim | \
-; RUN: grep {lwz r1, 0(r1)}
-; RUN: llvm-as < %s | \
-; RUN: llc -march=ppc32 -mtriple=powerpc-apple-darwin8 -disable-fp-elim | \
-; RUN: grep {lwz r31, 20(r1)}
-; RUN: llvm-as < %s | \
-; RUN: llc -march=ppc64 -mtriple=powerpc-apple-darwin8 | \
-; RUN: not grep {std r31, 40(r1)}
-; RUN: llvm-as < %s | \
-; RUN: llc -march=ppc64 -mtriple=powerpc-apple-darwin8 | \
-; RUN: grep {lis r0, -1}
-; RUN: llvm-as < %s | \
-; RUN: llc -march=ppc64 -mtriple=powerpc-apple-darwin8 | \
-; RUN: grep {ori r0, r0, 32656}
-; RUN: llvm-as < %s | \
-; RUN: llc -march=ppc64 -mtriple=powerpc-apple-darwin8 | \
-; RUN: grep {stdux r1, r1, r0}
-; RUN: llvm-as < %s | \
-; RUN: llc -march=ppc64 -mtriple=powerpc-apple-darwin8 | \
-; RUN: grep {ld r1, 0(r1)}
-; RUN: llvm-as < %s | \
-; RUN: llc -march=ppc64 -mtriple=powerpc-apple-darwin8 | \
-; RUN: not grep {ld r31, 40(r1)}
-; RUN: llvm-as < %s | \
-; RUN: llc -march=ppc64 -mtriple=powerpc-apple-darwin8 -disable-fp-elim | \
-; RUN: grep {std r31, 40(r1)}
-; RUN: llvm-as < %s | \
-; RUN: llc -march=ppc64 -mtriple=powerpc-apple-darwin8 -disable-fp-elim | \
-; RUN: grep {lis r0, -1}
-; RUN: llvm-as < %s | \
-; RUN: llc -march=ppc64 -mtriple=powerpc-apple-darwin8 -disable-fp-elim | \
-; RUN: grep {ori r0, r0, 32656}
-; RUN: llvm-as < %s | \
-; RUN: llc -march=ppc64 -mtriple=powerpc-apple-darwin8 -disable-fp-elim | \
-; RUN: grep {stdux r1, r1, r0}
-; RUN: llvm-as < %s | \
-; RUN: llc -march=ppc64 -mtriple=powerpc-apple-darwin8 -disable-fp-elim | \
-; RUN: grep {ld r1, 0(r1)}
-; RUN: llvm-as < %s | \
-; RUN: llc -march=ppc64 -mtriple=powerpc-apple-darwin8 -disable-fp-elim | \
-; RUN: grep {ld r31, 40(r1)}
-
-define i32* @f1() {
- %tmp = alloca i32, i32 8191 ; <i32*> [#uses=1]
- ret i32* %tmp
-}
-
diff --git a/release_23/test/CodeGen/PowerPC/Frames-leaf.ll b/release_23/test/CodeGen/PowerPC/Frames-leaf.ll
deleted file mode 100644
index 11b64703ebd8..000000000000
--- a/release_23/test/CodeGen/PowerPC/Frames-leaf.ll
+++ /dev/null
@@ -1,37 +0,0 @@
-; RUN: llvm-as < %s | llc -march=ppc32 | \
-; RUN: not grep {stw r31, 20(r1)}
-; RUN: llvm-as < %s | llc -march=ppc32 | \
-; RUN: not grep {stwu r1, -.*(r1)}
-; RUN: llvm-as < %s | llc -march=ppc32 | \
-; RUN: not grep {addi r1, r1, }
-; RUN: llvm-as < %s | llc -march=ppc32 | \
-; RUN: not grep {lwz r31, 20(r1)}
-; RUN: llvm-as < %s | llc -march=ppc32 -disable-fp-elim | \
-; RUN: not grep {stw r31, 20(r1)}
-; RUN: llvm-as < %s | llc -march=ppc32 -disable-fp-elim | \
-; RUN: not grep {stwu r1, -.*(r1)}
-; RUN: llvm-as < %s | llc -march=ppc32 -disable-fp-elim | \
-; RUN: not grep {addi r1, r1, }
-; RUN: llvm-as < %s | llc -march=ppc32 -disable-fp-elim | \
-; RUN: not grep {lwz r31, 20(r1)}
-; RUN: llvm-as < %s | llc -march=ppc64 | \
-; RUN: not grep {std r31, 40(r1)}
-; RUN: llvm-as < %s | llc -march=ppc64 | \
-; RUN: not grep {stdu r1, -.*(r1)}
-; RUN: llvm-as < %s | llc -march=ppc64 | \
-; RUN: not grep {addi r1, r1, }
-; RUN: llvm-as < %s | llc -march=ppc64 | \
-; RUN: not grep {ld r31, 40(r1)}
-; RUN: llvm-as < %s | llc -march=ppc64 -disable-fp-elim | \
-; RUN: not grep {stw r31, 40(r1)}
-; RUN: llvm-as < %s | llc -march=ppc64 -disable-fp-elim | \
-; RUN: not grep {stdu r1, -.*(r1)}
-; RUN: llvm-as < %s | llc -march=ppc64 -disable-fp-elim | \
-; RUN: not grep {addi r1, r1, }
-; RUN: llvm-as < %s | llc -march=ppc64 -disable-fp-elim | \
-; RUN: not grep {ld r31, 40(r1)}
-
-define i32* @f1() {
- %tmp = alloca i32, i32 2 ; <i32*> [#uses=1]
- ret i32* %tmp
-}
diff --git a/release_23/test/CodeGen/PowerPC/Frames-small.ll b/release_23/test/CodeGen/PowerPC/Frames-small.ll
deleted file mode 100644
index 4ea3afba8831..000000000000
--- a/release_23/test/CodeGen/PowerPC/Frames-small.ll
+++ /dev/null
@@ -1,33 +0,0 @@
-; RUN: llvm-as < %s | \
-; RUN: llc -march=ppc32 -mtriple=powerpc-apple-darwin8 -o %t1 -f
-; RUN not grep {stw r31, 20(r1)} %t1
-; RUN: grep {stwu r1, -16448(r1)} %t1
-; RUN: grep {addi r1, r1, 16448} %t1
-; RUN: llvm-as < %s | \
-; RUN: not grep {lwz r31, 20(r1)}
-; RUN: llvm-as < %s | \
-; RUN: llc -march=ppc32 -mtriple=powerpc-apple-darwin8 -disable-fp-elim \
-; RUN: -o %t2 -f
-; RUN: grep {stw r31, 20(r1)} %t2
-; RUN: grep {stwu r1, -16448(r1)} %t2
-; RUN: grep {addi r1, r1, 16448} %t2
-; RUN: grep {lwz r31, 20(r1)} %t2
-; RUN: llvm-as < %s | \
-; RUN: llc -march=ppc64 -mtriple=powerpc-apple-darwin8 -o %t3 -f
-; RUN: not grep {std r31, 40(r1)} %t3
-; RUN: grep {stdu r1, -16496(r1)} %t3
-; RUN: grep {addi r1, r1, 16496} %t3
-; RUN: not grep {ld r31, 40(r1)} %t3
-; RUN: llvm-as < %s | \
-; RUN: llc -march=ppc64 -mtriple=powerpc-apple-darwin8 -disable-fp-elim \
-; RUN: -o %t4 -f
-; RUN: grep {std r31, 40(r1)} %t4
-; RUN: grep {stdu r1, -16496(r1)} %t4
-; RUN: grep {addi r1, r1, 16496} %t4
-; RUN: grep {ld r31, 40(r1)} %t4
-
-define i32* @f1() {
- %tmp = alloca i32, i32 4095 ; <i32*> [#uses=1]
- ret i32* %tmp
-}
-
diff --git a/release_23/test/CodeGen/PowerPC/LargeAbsoluteAddr.ll b/release_23/test/CodeGen/PowerPC/LargeAbsoluteAddr.ll
deleted file mode 100644
index 17053796bc79..000000000000
--- a/release_23/test/CodeGen/PowerPC/LargeAbsoluteAddr.ll
+++ /dev/null
@@ -1,17 +0,0 @@
-; RUN: llvm-as < %s | llc -march=ppc32 -mtriple=powerpc-apple-darwin | \
-; RUN: grep {stw r3, 32751}
-; RUN: llvm-as < %s | llc -march=ppc64 -mtriple=powerpc-apple-darwin | \
-; RUN: grep {stw r3, 32751}
-; RUN: llvm-as < %s | llc -march=ppc64 -mtriple=powerpc-apple-darwin | \
-; RUN: grep {std r2, 9024}
-
-define void @test() {
- store i32 0, i32* inttoptr (i64 48725999 to i32*)
- ret void
-}
-
-define void @test2() {
- store i64 0, i64* inttoptr (i64 74560 to i64*)
- ret void
-}
-
diff --git a/release_23/test/CodeGen/PowerPC/addc.ll b/release_23/test/CodeGen/PowerPC/addc.ll
deleted file mode 100644
index 406053bee27f..000000000000
--- a/release_23/test/CodeGen/PowerPC/addc.ll
+++ /dev/null
@@ -1,26 +0,0 @@
-; All of these should be codegen'd without loading immediates
-; RUN: llvm-as < %s | llc -march=ppc32 -o %t -f
-; RUN: grep addc %t | count 1
-; RUN: grep adde %t | count 1
-; RUN: grep addze %t | count 1
-; RUN: grep addme %t | count 1
-; RUN: grep addic %t | count 2
-
-define i64 @add_ll(i64 %a, i64 %b) {
-entry:
- %tmp.2 = add i64 %b, %a ; <i64> [#uses=1]
- ret i64 %tmp.2
-}
-
-define i64 @add_l_5(i64 %a) {
-entry:
- %tmp.1 = add i64 %a, 5 ; <i64> [#uses=1]
- ret i64 %tmp.1
-}
-
-define i64 @add_l_m5(i64 %a) {
-entry:
- %tmp.1 = add i64 %a, -5 ; <i64> [#uses=1]
- ret i64 %tmp.1
-}
-
diff --git a/release_23/test/CodeGen/PowerPC/addi-reassoc.ll b/release_23/test/CodeGen/PowerPC/addi-reassoc.ll
deleted file mode 100644
index bee8660a8a9e..000000000000
--- a/release_23/test/CodeGen/PowerPC/addi-reassoc.ll
+++ /dev/null
@@ -1,19 +0,0 @@
-; RUN: llvm-as < %s | llc -march=ppc32 | not grep addi
-
- %struct.X = type { [5 x i8] }
-
-define i32 @test1([4 x i32]* %P, i32 %i) {
- %tmp.2 = add i32 %i, 2 ; <i32> [#uses=1]
- %tmp.4 = getelementptr [4 x i32]* %P, i32 %tmp.2, i32 1 ; <i32*> [#uses=1]
- %tmp.5 = load i32* %tmp.4 ; <i32> [#uses=1]
- ret i32 %tmp.5
-}
-
-define i32 @test2(%struct.X* %P, i32 %i) {
- %tmp.2 = add i32 %i, 2 ; <i32> [#uses=1]
- %tmp.5 = getelementptr %struct.X* %P, i32 %tmp.2, i32 0, i32 1 ; <i8*> [#uses=1]
- %tmp.6 = load i8* %tmp.5 ; <i8> [#uses=1]
- %tmp.7 = sext i8 %tmp.6 to i32 ; <i32> [#uses=1]
- ret i32 %tmp.7
-}
-
diff --git a/release_23/test/CodeGen/PowerPC/align.ll b/release_23/test/CodeGen/PowerPC/align.ll
deleted file mode 100644
index 7ffbe3676704..000000000000
--- a/release_23/test/CodeGen/PowerPC/align.ll
+++ /dev/null
@@ -1,11 +0,0 @@
-; RUN: llvm-as < %s | llc -march=ppc32 | \
-; RUN: grep align.4 | count 1
-; RUN: llvm-as < %s | llc -march=ppc32 | \
-; RUN: grep align.2 | count 1
-; RUN: llvm-as < %s | llc -march=ppc32 | \
-; RUN: grep align.3 | count 1
-
-@A = global <4 x i32> < i32 10, i32 20, i32 30, i32 40 > ; <<4 x i32>*> [#uses=0]
-@B = global float 1.000000e+02 ; <float*> [#uses=0]
-@C = global double 2.000000e+03 ; <double*> [#uses=0]
-
diff --git a/release_23/test/CodeGen/PowerPC/and-branch.ll b/release_23/test/CodeGen/PowerPC/and-branch.ll
deleted file mode 100644
index f0bb5ea40157..000000000000
--- a/release_23/test/CodeGen/PowerPC/and-branch.ll
+++ /dev/null
@@ -1,17 +0,0 @@
-; RUN: llvm-as < %s | llc -march=ppc32 | not grep mfcr
-
-define void @foo(i32 %X, i32 %Y, i32 %Z) {
-entry:
- %tmp = icmp eq i32 %X, 0 ; <i1> [#uses=1]
- %tmp3 = icmp slt i32 %Y, 5 ; <i1> [#uses=1]
- %tmp4 = and i1 %tmp3, %tmp ; <i1> [#uses=1]
- br i1 %tmp4, label %cond_true, label %UnifiedReturnBlock
-cond_true: ; preds = %entry
- %tmp5 = tail call i32 (...)* @bar( ) ; <i32> [#uses=0]
- ret void
-UnifiedReturnBlock: ; preds = %entry
- ret void
-}
-
-declare i32 @bar(...)
-
diff --git a/release_23/test/CodeGen/PowerPC/and-elim.ll b/release_23/test/CodeGen/PowerPC/and-elim.ll
deleted file mode 100644
index eef8f51f7a19..000000000000
--- a/release_23/test/CodeGen/PowerPC/and-elim.ll
+++ /dev/null
@@ -1,18 +0,0 @@
-; RUN: llvm-as < %s | llc -march=ppc32 | not grep rlwin
-
-define void @test(i8* %P) {
- %W = load i8* %P
- %X = shl i8 %W, 1
- %Y = add i8 %X, 2
- %Z = and i8 %Y, 254 ; dead and
- store i8 %Z, i8* %P
- ret void
-}
-
-define i16 @test2(i16 zeroext %crc) zeroext {
- ; No and's should be needed for the i16s here.
- %tmp.1 = lshr i16 %crc, 1
- %tmp.7 = xor i16 %tmp.1, 40961
- ret i16 %tmp.7
-}
-
diff --git a/release_23/test/CodeGen/PowerPC/and-imm.ll b/release_23/test/CodeGen/PowerPC/and-imm.ll
deleted file mode 100644
index 9c806494be3b..000000000000
--- a/release_23/test/CodeGen/PowerPC/and-imm.ll
+++ /dev/null
@@ -1,14 +0,0 @@
-; RUN: llvm-as < %s | llc -march=ppc32 | not grep {ori\\|lis}
-
-; andi. r3, r3, 32769
-define i32 @test(i32 %X) {
- %Y = and i32 %X, 32769 ; <i32> [#uses=1]
- ret i32 %Y
-}
-
-; andis. r3, r3, 32769
-define i32 @test2(i32 %X) {
- %Y = and i32 %X, -2147418112 ; <i32> [#uses=1]
- ret i32 %Y
-}
-
diff --git a/release_23/test/CodeGen/PowerPC/and_add.ll b/release_23/test/CodeGen/PowerPC/and_add.ll
deleted file mode 100644
index f103e7c0df06..000000000000
--- a/release_23/test/CodeGen/PowerPC/and_add.ll
+++ /dev/null
@@ -1,15 +0,0 @@
-; RUN: llvm-as < %s | llc -march=ppc32 -o %t -f
-; RUN: grep slwi %t
-; RUN: not grep addi %t
-; RUN: not grep rlwinm %t
-
-define i32 @test(i32 %A) {
- ;; shift
- %B = mul i32 %A, 8 ; <i32> [#uses=1]
- ;; dead, no demanded bits.
- %C = add i32 %B, 7 ; <i32> [#uses=1]
- ;; dead once add is gone.
- %D = and i32 %C, -8 ; <i32> [#uses=1]
- ret i32 %D
-}
-
diff --git a/release_23/test/CodeGen/PowerPC/and_sext.ll b/release_23/test/CodeGen/PowerPC/and_sext.ll
deleted file mode 100644
index e0e498def057..000000000000
--- a/release_23/test/CodeGen/PowerPC/and_sext.ll
+++ /dev/null
@@ -1,28 +0,0 @@
-; These tests should not contain a sign extend.
-; RUN: llvm-as < %s | llc -march=ppc32 | not grep extsh
-; RUN: llvm-as < %s | llc -march=ppc32 | not grep extsb
-
-define i32 @test1(i32 %mode.0.i.0) {
- %tmp.79 = trunc i32 %mode.0.i.0 to i16
- %tmp.80 = sext i16 %tmp.79 to i32
- %tmp.81 = and i32 %tmp.80, 24
- ret i32 %tmp.81
-}
-
-define i16 @test2(i16 signext %X, i16 signext %x) signext {
- %tmp = sext i16 %X to i32
- %tmp1 = sext i16 %x to i32
- %tmp2 = add i32 %tmp, %tmp1
- %tmp4 = ashr i32 %tmp2, 1
- %tmp5 = trunc i32 %tmp4 to i16
- %tmp45 = sext i16 %tmp5 to i32
- %retval = trunc i32 %tmp45 to i16
- ret i16 %retval
-}
-
-define i16 @test3(i32 zeroext %X) signext {
- %tmp1 = lshr i32 %X, 16
- %tmp2 = trunc i32 %tmp1 to i16
- ret i16 %tmp2
-}
-
diff --git a/release_23/test/CodeGen/PowerPC/and_sra.ll b/release_23/test/CodeGen/PowerPC/and_sra.ll
deleted file mode 100644
index c780605c9753..000000000000
--- a/release_23/test/CodeGen/PowerPC/and_sra.ll
+++ /dev/null
@@ -1,27 +0,0 @@
-; Neither of these functions should contain algebraic right shifts
-; RUN: llvm-as < %s | llc -march=ppc32 | not grep srawi
-
-define i32 @test1(i32 %mode.0.i.0) {
- %tmp.79 = bitcast i32 %mode.0.i.0 to i32 ; <i32> [#uses=1]
- %tmp.80 = ashr i32 %tmp.79, 15 ; <i32> [#uses=1]
- %tmp.81 = and i32 %tmp.80, 24 ; <i32> [#uses=1]
- ret i32 %tmp.81
-}
-
-define i32 @test2(i32 %mode.0.i.0) {
- %tmp.79 = bitcast i32 %mode.0.i.0 to i32 ; <i32> [#uses=1]
- %tmp.80 = ashr i32 %tmp.79, 15 ; <i32> [#uses=1]
- %tmp.81 = lshr i32 %mode.0.i.0, 16 ; <i32> [#uses=1]
- %tmp.82 = bitcast i32 %tmp.81 to i32 ; <i32> [#uses=1]
- %tmp.83 = and i32 %tmp.80, %tmp.82 ; <i32> [#uses=1]
- ret i32 %tmp.83
-}
-
-define i32 @test3(i32 %specbits.6.1) {
- %tmp.2540 = ashr i32 %specbits.6.1, 11 ; <i32> [#uses=1]
- %tmp.2541 = bitcast i32 %tmp.2540 to i32 ; <i32> [#uses=1]
- %tmp.2542 = shl i32 %tmp.2541, 13 ; <i32> [#uses=1]
- %tmp.2543 = and i32 %tmp.2542, 8192 ; <i32> [#uses=1]
- ret i32 %tmp.2543
-}
-
diff --git a/release_23/test/CodeGen/PowerPC/atomic-1.ll b/release_23/test/CodeGen/PowerPC/atomic-1.ll
deleted file mode 100644
index 74b9c6a4f6eb..000000000000
--- a/release_23/test/CodeGen/PowerPC/atomic-1.ll
+++ /dev/null
@@ -1,27 +0,0 @@
-; RUN: llvm-as < %s | llc -march=ppc32 | grep lwarx | count 4
-; RUN: llvm-as < %s | llc -march=ppc32 | grep stwcx. | count 4
-
-define i32 @exchange_and_add(i32* %mem, i32 %val) nounwind {
- %tmp = call i32 @llvm.atomic.las.i32( i32* %mem, i32 %val )
- ret i32 %tmp
-}
-
-define i32 @exchange_and_cmp(i32* %mem) nounwind {
- %tmp = call i32 @llvm.atomic.lcs.i32( i32* %mem, i32 0, i32 1 )
- ret i32 %tmp
-}
-
-define i16 @exchange_and_cmp16(i16* %mem) nounwind {
- %tmp = call i16 @llvm.atomic.lcs.i16( i16* %mem, i16 0, i16 1 )
- ret i16 %tmp
-}
-
-define i32 @exchange(i32* %mem, i32 %val) nounwind {
- %tmp = call i32 @llvm.atomic.swap.i32( i32* %mem, i32 1 )
- ret i32 %tmp
-}
-
-declare i32 @llvm.atomic.las.i32(i32*, i32) nounwind
-declare i32 @llvm.atomic.lcs.i32(i32*, i32, i32) nounwind
-declare i16 @llvm.atomic.lcs.i16(i16*, i16, i16) nounwind
-declare i32 @llvm.atomic.swap.i32(i32*, i32) nounwind
diff --git a/release_23/test/CodeGen/PowerPC/atomic-2.ll b/release_23/test/CodeGen/PowerPC/atomic-2.ll
deleted file mode 100644
index 8e1ef1b0f875..000000000000
--- a/release_23/test/CodeGen/PowerPC/atomic-2.ll
+++ /dev/null
@@ -1,21 +0,0 @@
-; RUN: llvm-as < %s | llc -march=ppc64 | grep ldarx | count 3
-; RUN: llvm-as < %s | llc -march=ppc64 | grep stdcx. | count 3
-
-define i64 @exchange_and_add(i64* %mem, i64 %val) nounwind {
- %tmp = call i64 @llvm.atomic.las.i64( i64* %mem, i64 %val )
- ret i64 %tmp
-}
-
-define i64 @exchange_and_cmp(i64* %mem) nounwind {
- %tmp = call i64 @llvm.atomic.lcs.i64( i64* %mem, i64 0, i64 1 )
- ret i64 %tmp
-}
-
-define i64 @exchange(i64* %mem, i64 %val) nounwind {
- %tmp = call i64 @llvm.atomic.swap.i64( i64* %mem, i64 1 )
- ret i64 %tmp
-}
-
-declare i64 @llvm.atomic.las.i64(i64*, i64) nounwind
-declare i64 @llvm.atomic.lcs.i64(i64*, i64, i64) nounwind
-declare i64 @llvm.atomic.swap.i64(i64*, i64) nounwind
diff --git a/release_23/test/CodeGen/PowerPC/big-endian-actual-args.ll b/release_23/test/CodeGen/PowerPC/big-endian-actual-args.ll
deleted file mode 100644
index d23935756dc2..000000000000
--- a/release_23/test/CodeGen/PowerPC/big-endian-actual-args.ll
+++ /dev/null
@@ -1,9 +0,0 @@
-; RUN: llvm-as < %s | llc -march=ppc32 -mtriple=powerpc-unknown-linux-gnu | \
-; RUN: grep {addc 4, 4, 6}
-; RUN: llvm-as < %s | llc -march=ppc32 -mtriple=powerpc-unknown-linux-gnu | \
-; RUN: grep {adde 3, 3, 5}
-
-define i64 @foo(i64 %x, i64 %y) {
- %z = add i64 %x, %y
- ret i64 %z
-}
diff --git a/release_23/test/CodeGen/PowerPC/big-endian-call-result.ll b/release_23/test/CodeGen/PowerPC/big-endian-call-result.ll
deleted file mode 100644
index ab136f65d274..000000000000
--- a/release_23/test/CodeGen/PowerPC/big-endian-call-result.ll
+++ /dev/null
@@ -1,13 +0,0 @@
-; RUN: llvm-as < %s | llc -march=ppc32 -mtriple=powerpc-unknown-linux-gnu | \
-; RUN: grep {addic 4, 4, 1}
-; RUN: llvm-as < %s | llc -march=ppc32 -mtriple=powerpc-unknown-linux-gnu | \
-; RUN: grep {addze 3, 3}
-
-declare i64 @foo()
-
-define i64 @bar()
-{
- %t = call i64 @foo()
- %s = add i64 %t, 1
- ret i64 %s
-}
diff --git a/release_23/test/CodeGen/PowerPC/big-endian-formal-args.ll b/release_23/test/CodeGen/PowerPC/big-endian-formal-args.ll
deleted file mode 100644
index 08589f499965..000000000000
--- a/release_23/test/CodeGen/PowerPC/big-endian-formal-args.ll
+++ /dev/null
@@ -1,15 +0,0 @@
-; RUN: llvm-as < %s | llc -march=ppc32 -mtriple=powerpc-unknown-linux-gnu | \
-; RUN: grep {li 6, 3}
-; RUN: llvm-as < %s | llc -march=ppc32 -mtriple=powerpc-unknown-linux-gnu | \
-; RUN: grep {li 4, 2}
-; RUN: llvm-as < %s | llc -march=ppc32 -mtriple=powerpc-unknown-linux-gnu | \
-; RUN: grep {li 3, 0}
-; RUN: llvm-as < %s | llc -march=ppc32 -mtriple=powerpc-unknown-linux-gnu | \
-; RUN: grep {mr 5, 3}
-
-declare void @bar(i64 %x, i64 %y)
-
-define void @foo() {
- call void @bar(i64 2, i64 3)
- ret void
-}
diff --git a/release_23/test/CodeGen/PowerPC/branch-opt.ll b/release_23/test/CodeGen/PowerPC/branch-opt.ll
deleted file mode 100644
index 4aa55a39e5de..000000000000
--- a/release_23/test/CodeGen/PowerPC/branch-opt.ll
+++ /dev/null
@@ -1,71 +0,0 @@
-; RUN: llvm-as < %s | llc -march=ppc32 | \
-; RUN: grep {b LBB.*} | count 4
-
-target datalayout = "E-p:32:32"
-target triple = "powerpc-apple-darwin8.7.0"
-
-define void @foo(i32 %W, i32 %X, i32 %Y, i32 %Z) {
-entry:
- %tmp1 = and i32 %W, 1 ; <i32> [#uses=1]
- %tmp1.upgrd.1 = icmp eq i32 %tmp1, 0 ; <i1> [#uses=1]
- br i1 %tmp1.upgrd.1, label %cond_false, label %bb5
-bb: ; preds = %bb5, %bb
- %indvar77 = phi i32 [ %indvar.next78, %bb ], [ 0, %bb5 ] ; <i32> [#uses=1]
- %tmp2 = tail call i32 (...)* @bar( ) ; <i32> [#uses=0]
- %indvar.next78 = add i32 %indvar77, 1 ; <i32> [#uses=2]
- %exitcond79 = icmp eq i32 %indvar.next78, %X ; <i1> [#uses=1]
- br i1 %exitcond79, label %cond_next48, label %bb
-bb5: ; preds = %entry
- %tmp = icmp eq i32 %X, 0 ; <i1> [#uses=1]
- br i1 %tmp, label %cond_next48, label %bb
-cond_false: ; preds = %entry
- %tmp10 = and i32 %W, 2 ; <i32> [#uses=1]
- %tmp10.upgrd.2 = icmp eq i32 %tmp10, 0 ; <i1> [#uses=1]
- br i1 %tmp10.upgrd.2, label %cond_false20, label %bb16
-bb12: ; preds = %bb16, %bb12
- %indvar72 = phi i32 [ %indvar.next73, %bb12 ], [ 0, %bb16 ] ; <i32> [#uses=1]
- %tmp13 = tail call i32 (...)* @bar( ) ; <i32> [#uses=0]
- %indvar.next73 = add i32 %indvar72, 1 ; <i32> [#uses=2]
- %exitcond74 = icmp eq i32 %indvar.next73, %Y ; <i1> [#uses=1]
- br i1 %exitcond74, label %cond_next48, label %bb12
-bb16: ; preds = %cond_false
- %tmp18 = icmp eq i32 %Y, 0 ; <i1> [#uses=1]
- br i1 %tmp18, label %cond_next48, label %bb12
-cond_false20: ; preds = %cond_false
- %tmp23 = and i32 %W, 4 ; <i32> [#uses=1]
- %tmp23.upgrd.3 = icmp eq i32 %tmp23, 0 ; <i1> [#uses=1]
- br i1 %tmp23.upgrd.3, label %cond_false33, label %bb29
-bb25: ; preds = %bb29, %bb25
- %indvar67 = phi i32 [ %indvar.next68, %bb25 ], [ 0, %bb29 ] ; <i32> [#uses=1]
- %tmp26 = tail call i32 (...)* @bar( ) ; <i32> [#uses=0]
- %indvar.next68 = add i32 %indvar67, 1 ; <i32> [#uses=2]
- %exitcond69 = icmp eq i32 %indvar.next68, %Z ; <i1> [#uses=1]
- br i1 %exitcond69, label %cond_next48, label %bb25
-bb29: ; preds = %cond_false20
- %tmp31 = icmp eq i32 %Z, 0 ; <i1> [#uses=1]
- br i1 %tmp31, label %cond_next48, label %bb25
-cond_false33: ; preds = %cond_false20
- %tmp36 = and i32 %W, 8 ; <i32> [#uses=1]
- %tmp36.upgrd.4 = icmp eq i32 %tmp36, 0 ; <i1> [#uses=1]
- br i1 %tmp36.upgrd.4, label %cond_next48, label %bb42
-bb38: ; preds = %bb42
- %tmp39 = tail call i32 (...)* @bar( ) ; <i32> [#uses=0]
- %indvar.next = add i32 %indvar, 1 ; <i32> [#uses=1]
- br label %bb42
-bb42: ; preds = %bb38, %cond_false33
- %indvar = phi i32 [ %indvar.next, %bb38 ], [ 0, %cond_false33 ] ; <i32> [#uses=4]
- %W_addr.0 = sub i32 %W, %indvar ; <i32> [#uses=1]
- %exitcond = icmp eq i32 %indvar, %W ; <i1> [#uses=1]
- br i1 %exitcond, label %cond_next48, label %bb38
-cond_next48: ; preds = %bb42, %cond_false33, %bb29, %bb25, %bb16, %bb12, %bb5, %bb
- %W_addr.1 = phi i32 [ %W, %bb5 ], [ %W, %bb16 ], [ %W, %bb29 ], [ %W, %cond_false33 ], [ %W_addr.0, %bb42 ], [ %W, %bb25 ], [ %W, %bb12 ], [ %W, %bb ] ; <i32> [#uses=1]
- %tmp50 = icmp eq i32 %W_addr.1, 0 ; <i1> [#uses=1]
- br i1 %tmp50, label %UnifiedReturnBlock, label %cond_true51
-cond_true51: ; preds = %cond_next48
- %tmp52 = tail call i32 (...)* @bar( ) ; <i32> [#uses=0]
- ret void
-UnifiedReturnBlock: ; preds = %cond_next48
- ret void
-}
-
-declare i32 @bar(...)
diff --git a/release_23/test/CodeGen/PowerPC/bswap-load-store.ll b/release_23/test/CodeGen/PowerPC/bswap-load-store.ll
deleted file mode 100644
index e450eb8c2378..000000000000
--- a/release_23/test/CodeGen/PowerPC/bswap-load-store.ll
+++ /dev/null
@@ -1,45 +0,0 @@
-; RUN: llvm-as < %s | llc -march=ppc32 | \
-; RUN: grep {stwbrx\\|lwbrx\\|sthbrx\\|lhbrx} | count 4
-; RUN: llvm-as < %s | llc -march=ppc32 | not grep rlwinm
-; RUN: llvm-as < %s | llc -march=ppc32 | not grep rlwimi
-; RUN: llvm-as < %s | llc -march=ppc64 | \
-; RUN: grep {stwbrx\\|lwbrx\\|sthbrx\\|lhbrx} | count 4
-; RUN: llvm-as < %s | llc -march=ppc64 | not grep rlwinm
-; RUN: llvm-as < %s | llc -march=ppc64 | not grep rlwimi
-
-define void @STWBRX(i32 %i, i8* %ptr, i32 %off) {
- %tmp1 = getelementptr i8* %ptr, i32 %off ; <i8*> [#uses=1]
- %tmp1.upgrd.1 = bitcast i8* %tmp1 to i32* ; <i32*> [#uses=1]
- %tmp13 = tail call i32 @llvm.bswap.i32( i32 %i ) ; <i32> [#uses=1]
- store i32 %tmp13, i32* %tmp1.upgrd.1
- ret void
-}
-
-define i32 @LWBRX(i8* %ptr, i32 %off) {
- %tmp1 = getelementptr i8* %ptr, i32 %off ; <i8*> [#uses=1]
- %tmp1.upgrd.2 = bitcast i8* %tmp1 to i32* ; <i32*> [#uses=1]
- %tmp = load i32* %tmp1.upgrd.2 ; <i32> [#uses=1]
- %tmp14 = tail call i32 @llvm.bswap.i32( i32 %tmp ) ; <i32> [#uses=1]
- ret i32 %tmp14
-}
-
-define void @STHBRX(i16 %s, i8* %ptr, i32 %off) {
- %tmp1 = getelementptr i8* %ptr, i32 %off ; <i8*> [#uses=1]
- %tmp1.upgrd.3 = bitcast i8* %tmp1 to i16* ; <i16*> [#uses=1]
- %tmp5 = call i16 @llvm.bswap.i16( i16 %s ) ; <i16> [#uses=1]
- store i16 %tmp5, i16* %tmp1.upgrd.3
- ret void
-}
-
-define i16 @LHBRX(i8* %ptr, i32 %off) {
- %tmp1 = getelementptr i8* %ptr, i32 %off ; <i8*> [#uses=1]
- %tmp1.upgrd.4 = bitcast i8* %tmp1 to i16* ; <i16*> [#uses=1]
- %tmp = load i16* %tmp1.upgrd.4 ; <i16> [#uses=1]
- %tmp6 = call i16 @llvm.bswap.i16( i16 %tmp ) ; <i16> [#uses=1]
- ret i16 %tmp6
-}
-
-declare i32 @llvm.bswap.i32(i32)
-
-declare i16 @llvm.bswap.i16(i16)
-
diff --git a/release_23/test/CodeGen/PowerPC/buildvec_canonicalize.ll b/release_23/test/CodeGen/PowerPC/buildvec_canonicalize.ll
deleted file mode 100644
index 66428c77e45a..000000000000
--- a/release_23/test/CodeGen/PowerPC/buildvec_canonicalize.ll
+++ /dev/null
@@ -1,26 +0,0 @@
-; There should be exactly one vxor here.
-; RUN: llvm-as < %s | \
-; RUN: llc -march=ppc32 -mcpu=g5 --enable-unsafe-fp-math | \
-; RUN: grep vxor | count 1
-
-; There should be exactly one vsplti here.
-; RUN: llvm-as < %s | \
-; RUN: llc -march=ppc32 -mcpu=g5 --enable-unsafe-fp-math | \
-; RUN: grep vsplti | count 1
-
-define void @VXOR(<4 x float>* %P1, <4 x i32>* %P2, <4 x float>* %P3) {
- %tmp = load <4 x float>* %P3 ; <<4 x float>> [#uses=1]
- %tmp3 = load <4 x float>* %P1 ; <<4 x float>> [#uses=1]
- %tmp4 = mul <4 x float> %tmp, %tmp3 ; <<4 x float>> [#uses=1]
- store <4 x float> %tmp4, <4 x float>* %P3
- store <4 x float> zeroinitializer, <4 x float>* %P1
- store <4 x i32> zeroinitializer, <4 x i32>* %P2
- ret void
-}
-
-define void @VSPLTI(<4 x i32>* %P2, <8 x i16>* %P3) {
- store <4 x i32> bitcast (<16 x i8> < i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1 > to <4 x i32>), <4 x i32>* %P2
- store <8 x i16> < i16 -1, i16 -1, i16 -1, i16 -1, i16 -1, i16 -1, i16 -1, i16 -1 >, <8 x i16>* %P3
- ret void
-}
-
diff --git a/release_23/test/CodeGen/PowerPC/calls.ll b/release_23/test/CodeGen/PowerPC/calls.ll
deleted file mode 100644
index 034c14147a29..000000000000
--- a/release_23/test/CodeGen/PowerPC/calls.ll
+++ /dev/null
@@ -1,32 +0,0 @@
-; Test various forms of calls.
-
-; RUN: llvm-as < %s | llc -march=ppc32 | \
-; RUN: grep {bl } | count 2
-; RUN: llvm-as < %s | llc -march=ppc32 | \
-; RUN: grep {bctrl} | count 1
-; RUN: llvm-as < %s | llc -march=ppc32 | \
-; RUN: grep {bla } | count 1
-
-declare void @foo()
-
-define void @test_direct() {
- call void @foo( )
- ret void
-}
-
-define void @test_extsym(i8* %P) {
- free i8* %P
- ret void
-}
-
-define void @test_indirect(void ()* %fp) {
- call void %fp( )
- ret void
-}
-
-define void @test_abs() {
- %fp = inttoptr i32 400 to void ()* ; <void ()*> [#uses=1]
- call void %fp( )
- ret void
-}
-
diff --git a/release_23/test/CodeGen/PowerPC/cmp-cmp.ll b/release_23/test/CodeGen/PowerPC/cmp-cmp.ll
deleted file mode 100644
index 07964d5aa315..000000000000
--- a/release_23/test/CodeGen/PowerPC/cmp-cmp.ll
+++ /dev/null
@@ -1,13 +0,0 @@
-; RUN: llvm-as < %s | llc -march=ppc32 | not grep mfcr
-
-define void @test(i64 %X) {
- %tmp1 = and i64 %X, 3 ; <i64> [#uses=1]
- %tmp = icmp sgt i64 %tmp1, 2 ; <i1> [#uses=1]
- br i1 %tmp, label %UnifiedReturnBlock, label %cond_true
-cond_true: ; preds = %0
- tail call void @test( i64 0 )
- ret void
-UnifiedReturnBlock: ; preds = %0
- ret void
-}
-
diff --git a/release_23/test/CodeGen/PowerPC/compare-duplicate.ll b/release_23/test/CodeGen/PowerPC/compare-duplicate.ll
deleted file mode 100644
index df2dfdc17b64..000000000000
--- a/release_23/test/CodeGen/PowerPC/compare-duplicate.ll
+++ /dev/null
@@ -1,11 +0,0 @@
-; RUN: llvm-as < %s | llc -mtriple=powerpc-apple-darwin8 | not grep slwi
-
-define i32 @test(i32 %A, i32 %B) {
- %C = sub i32 %B, %A
- %D = icmp eq i32 %C, %A
- br i1 %D, label %T, label %F
-T:
- ret i32 19123
-F:
- ret i32 %C
-}
diff --git a/release_23/test/CodeGen/PowerPC/compare-fcmp-ord.ll b/release_23/test/CodeGen/PowerPC/compare-fcmp-ord.ll
deleted file mode 100644
index fd1eb5d44057..000000000000
--- a/release_23/test/CodeGen/PowerPC/compare-fcmp-ord.ll
+++ /dev/null
@@ -1,24 +0,0 @@
-; RUN: llvm-as < %s | llc -march=ppc32 | grep or | count 3
-; This should produce one 'or' or 'cror' instruction per function.
-
-define i32 @test(double %x, double %y) nounwind {
-entry:
- %tmp3 = fcmp ole double %x, %y ; <i1> [#uses=1]
- %tmp345 = zext i1 %tmp3 to i32 ; <i32> [#uses=1]
- ret i32 %tmp345
-}
-
-define i32 @test2(double %x, double %y) nounwind {
-entry:
- %tmp3 = fcmp one double %x, %y ; <i1> [#uses=1]
- %tmp345 = zext i1 %tmp3 to i32 ; <i32> [#uses=1]
- ret i32 %tmp345
-}
-
-define i32 @test3(double %x, double %y) nounwind {
-entry:
- %tmp3 = fcmp ugt double %x, %y ; <i1> [#uses=1]
- %tmp34 = zext i1 %tmp3 to i32 ; <i32> [#uses=1]
- ret i32 %tmp34
-}
-
diff --git a/release_23/test/CodeGen/PowerPC/compare-simm.ll b/release_23/test/CodeGen/PowerPC/compare-simm.ll
deleted file mode 100644
index b0ef2d3f9464..000000000000
--- a/release_23/test/CodeGen/PowerPC/compare-simm.ll
+++ /dev/null
@@ -1,14 +0,0 @@
-; RUN: llvm-as < %s | llc -march=ppc32 -mtriple=powerpc-apple-darwin8 | \
-; RUN: grep {cmpwi cr0, r3, -1}
-
-define i32 @test(i32 %x) {
- %c = icmp eq i32 %x, -1
- br i1 %c, label %T, label %F
-T:
- %A = call i32 @test(i32 123)
- %B = add i32 %A, 43
- ret i32 %B
-F:
- %G = add i32 %x, 1234
- ret i32 %G
-}
diff --git a/release_23/test/CodeGen/PowerPC/constants.ll b/release_23/test/CodeGen/PowerPC/constants.ll
deleted file mode 100644
index b58f59a7eb55..000000000000
--- a/release_23/test/CodeGen/PowerPC/constants.ll
+++ /dev/null
@@ -1,52 +0,0 @@
-; All of these routines should be perform optimal load of constants.
-; RUN: llvm-as < %s | llc -march=ppc32 | \
-; RUN: grep lis | count 5
-; RUN: llvm-as < %s | llc -march=ppc32 | \
-; RUN: grep ori | count 3
-; RUN: llvm-as < %s | llc -march=ppc32 | \
-; RUN: grep {li } | count 4
-
-define i32 @f1() {
-entry:
- ret i32 1
-}
-
-define i32 @f2() {
-entry:
- ret i32 -1
-}
-
-define i32 @f3() {
-entry:
- ret i32 0
-}
-
-define i32 @f4() {
-entry:
- ret i32 32767
-}
-
-define i32 @f5() {
-entry:
- ret i32 65535
-}
-
-define i32 @f6() {
-entry:
- ret i32 65536
-}
-
-define i32 @f7() {
-entry:
- ret i32 131071
-}
-
-define i32 @f8() {
-entry:
- ret i32 2147483647
-}
-
-define i32 @f9() {
-entry:
- ret i32 -2147483648
-}
diff --git a/release_23/test/CodeGen/PowerPC/cttz.ll b/release_23/test/CodeGen/PowerPC/cttz.ll
deleted file mode 100644
index 2c51e8afa558..000000000000
--- a/release_23/test/CodeGen/PowerPC/cttz.ll
+++ /dev/null
@@ -1,11 +0,0 @@
-; Make sure this testcase does not use ctpop
-; RUN: llvm-as < %s | llc -march=ppc32 | grep -i cntlzw
-
-declare i32 @llvm.cttz.i32(i32)
-
-define i32 @bar(i32 %x) {
-entry:
- %tmp.1 = call i32 @llvm.cttz.i32( i32 %x ) ; <i32> [#uses=1]
- ret i32 %tmp.1
-}
-
diff --git a/release_23/test/CodeGen/PowerPC/darwin-labels.ll b/release_23/test/CodeGen/PowerPC/darwin-labels.ll
deleted file mode 100644
index ceebc7099e4e..000000000000
--- a/release_23/test/CodeGen/PowerPC/darwin-labels.ll
+++ /dev/null
@@ -1,6 +0,0 @@
-; RUN: llvm-as < %s | llc | grep {foo bar":}
-
-target datalayout = "E-p:32:32"
-target triple = "powerpc-apple-darwin8.2.0"
-@"foo bar" = global i32 4 ; <i32*> [#uses=0]
-
diff --git a/release_23/test/CodeGen/PowerPC/dg.exp b/release_23/test/CodeGen/PowerPC/dg.exp
deleted file mode 100644
index 22b60bc721f9..000000000000
--- a/release_23/test/CodeGen/PowerPC/dg.exp
+++ /dev/null
@@ -1,5 +0,0 @@
-load_lib llvm.exp
-
-if { [llvm_supports_target PowerPC] } {
- RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
-}
diff --git a/release_23/test/CodeGen/PowerPC/div-2.ll b/release_23/test/CodeGen/PowerPC/div-2.ll
deleted file mode 100644
index 26e622178408..000000000000
--- a/release_23/test/CodeGen/PowerPC/div-2.ll
+++ /dev/null
@@ -1,30 +0,0 @@
-; RUN: llvm-as < %s | llc -march=ppc32 | not grep srawi
-; RUN: llvm-as < %s | llc -march=ppc32 | grep blr
-
-define i32 @test1(i32 %X) {
- %Y = and i32 %X, 15 ; <i32> [#uses=1]
- %Z = sdiv i32 %Y, 4 ; <i32> [#uses=1]
- ret i32 %Z
-}
-
-define i32 @test2(i32 %W) {
- %X = and i32 %W, 15 ; <i32> [#uses=1]
- %Y = sub i32 16, %X ; <i32> [#uses=1]
- %Z = sdiv i32 %Y, 4 ; <i32> [#uses=1]
- ret i32 %Z
-}
-
-define i32 @test3(i32 %W) {
- %X = and i32 %W, 15 ; <i32> [#uses=1]
- %Y = sub i32 15, %X ; <i32> [#uses=1]
- %Z = sdiv i32 %Y, 4 ; <i32> [#uses=1]
- ret i32 %Z
-}
-
-define i32 @test4(i32 %W) {
- %X = and i32 %W, 2 ; <i32> [#uses=1]
- %Y = sub i32 5, %X ; <i32> [#uses=1]
- %Z = sdiv i32 %Y, 2 ; <i32> [#uses=1]
- ret i32 %Z
-}
-
diff --git a/release_23/test/CodeGen/PowerPC/eqv-andc-orc-nor.ll b/release_23/test/CodeGen/PowerPC/eqv-andc-orc-nor.ll
deleted file mode 100644
index 7be8a34be7ef..000000000000
--- a/release_23/test/CodeGen/PowerPC/eqv-andc-orc-nor.ll
+++ /dev/null
@@ -1,93 +0,0 @@
-; RUN: llvm-as < %s | llc -march=ppc32 | \
-; RUN: grep eqv | count 3
-; RUN: llvm-as < %s | llc -march=ppc32 -mcpu=g5 | \
-; RUN: grep andc | count 3
-; RUN: llvm-as < %s | llc -march=ppc32 | \
-; RUN: grep orc | count 2
-; RUN: llvm-as < %s | llc -march=ppc32 -mcpu=g5 | \
-; RUN: grep nor | count 3
-; RUN: llvm-as < %s | llc -march=ppc32 | \
-; RUN: grep nand | count 1
-
-define i32 @EQV1(i32 %X, i32 %Y) {
- %A = xor i32 %X, %Y ; <i32> [#uses=1]
- %B = xor i32 %A, -1 ; <i32> [#uses=1]
- ret i32 %B
-}
-
-define i32 @EQV2(i32 %X, i32 %Y) {
- %A = xor i32 %X, -1 ; <i32> [#uses=1]
- %B = xor i32 %A, %Y ; <i32> [#uses=1]
- ret i32 %B
-}
-
-define i32 @EQV3(i32 %X, i32 %Y) {
- %A = xor i32 %X, -1 ; <i32> [#uses=1]
- %B = xor i32 %Y, %A ; <i32> [#uses=1]
- ret i32 %B
-}
-
-define i32 @ANDC1(i32 %X, i32 %Y) {
- %A = xor i32 %Y, -1 ; <i32> [#uses=1]
- %B = and i32 %X, %A ; <i32> [#uses=1]
- ret i32 %B
-}
-
-define i32 @ANDC2(i32 %X, i32 %Y) {
- %A = xor i32 %X, -1 ; <i32> [#uses=1]
- %B = and i32 %A, %Y ; <i32> [#uses=1]
- ret i32 %B
-}
-
-define i32 @ORC1(i32 %X, i32 %Y) {
- %A = xor i32 %Y, -1 ; <i32> [#uses=1]
- %B = or i32 %X, %A ; <i32> [#uses=1]
- ret i32 %B
-}
-
-define i32 @ORC2(i32 %X, i32 %Y) {
- %A = xor i32 %X, -1 ; <i32> [#uses=1]
- %B = or i32 %A, %Y ; <i32> [#uses=1]
- ret i32 %B
-}
-
-define i32 @NOR1(i32 %X) {
- %Y = xor i32 %X, -1 ; <i32> [#uses=1]
- ret i32 %Y
-}
-
-define i32 @NOR2(i32 %X, i32 %Y) {
- %Z = or i32 %X, %Y ; <i32> [#uses=1]
- %R = xor i32 %Z, -1 ; <i32> [#uses=1]
- ret i32 %R
-}
-
-define i32 @NAND1(i32 %X, i32 %Y) {
- %Z = and i32 %X, %Y ; <i32> [#uses=1]
- %W = xor i32 %Z, -1 ; <i32> [#uses=1]
- ret i32 %W
-}
-
-define void @VNOR(<4 x float>* %P, <4 x float>* %Q) {
- %tmp = load <4 x float>* %P ; <<4 x float>> [#uses=1]
- %tmp.upgrd.1 = bitcast <4 x float> %tmp to <4 x i32> ; <<4 x i32>> [#uses=1]
- %tmp2 = load <4 x float>* %Q ; <<4 x float>> [#uses=1]
- %tmp2.upgrd.2 = bitcast <4 x float> %tmp2 to <4 x i32> ; <<4 x i32>> [#uses=1]
- %tmp3 = or <4 x i32> %tmp.upgrd.1, %tmp2.upgrd.2 ; <<4 x i32>> [#uses=1]
- %tmp4 = xor <4 x i32> %tmp3, < i32 -1, i32 -1, i32 -1, i32 -1 > ; <<4 x i32>> [#uses=1]
- %tmp4.upgrd.3 = bitcast <4 x i32> %tmp4 to <4 x float> ; <<4 x float>> [#uses=1]
- store <4 x float> %tmp4.upgrd.3, <4 x float>* %P
- ret void
-}
-
-define void @VANDC(<4 x float>* %P, <4 x float>* %Q) {
- %tmp = load <4 x float>* %P ; <<4 x float>> [#uses=1]
- %tmp.upgrd.4 = bitcast <4 x float> %tmp to <4 x i32> ; <<4 x i32>> [#uses=1]
- %tmp2 = load <4 x float>* %Q ; <<4 x float>> [#uses=1]
- %tmp2.upgrd.5 = bitcast <4 x float> %tmp2 to <4 x i32> ; <<4 x i32>> [#uses=1]
- %tmp4 = xor <4 x i32> %tmp2.upgrd.5, < i32 -1, i32 -1, i32 -1, i32 -1 > ; <<4 x i32>> [#uses=1]
- %tmp3 = and <4 x i32> %tmp.upgrd.4, %tmp4 ; <<4 x i32>> [#uses=1]
- %tmp4.upgrd.6 = bitcast <4 x i32> %tmp3 to <4 x float> ; <<4 x float>> [#uses=1]
- store <4 x float> %tmp4.upgrd.6, <4 x float>* %P
- ret void
-}
diff --git a/release_23/test/CodeGen/PowerPC/extsh.ll b/release_23/test/CodeGen/PowerPC/extsh.ll
deleted file mode 100644
index 5eca8cea3606..000000000000
--- a/release_23/test/CodeGen/PowerPC/extsh.ll
+++ /dev/null
@@ -1,8 +0,0 @@
-; This should turn into a single extsh
-; RUN: llvm-as < %s | llc -march=ppc32 | grep extsh | count 1
-define i32 @test(i32 %X) {
- %tmp.81 = shl i32 %X, 16 ; <i32> [#uses=1]
- %tmp.82 = ashr i32 %tmp.81, 16 ; <i32> [#uses=1]
- ret i32 %tmp.82
-}
-
diff --git a/release_23/test/CodeGen/PowerPC/fabs.ll b/release_23/test/CodeGen/PowerPC/fabs.ll
deleted file mode 100644
index 54e49b009ace..000000000000
--- a/release_23/test/CodeGen/PowerPC/fabs.ll
+++ /dev/null
@@ -1,7 +0,0 @@
-; RUN: llvm-as < %s | llc -march=ppc32 -mtriple=powerpc-apple-darwin | grep {fabs f1, f1}
-
-define double @fabs(double %f) {
-entry:
- %tmp2 = tail call double @fabs( double %f ) ; <double> [#uses=1]
- ret double %tmp2
-}
diff --git a/release_23/test/CodeGen/PowerPC/fma.ll b/release_23/test/CodeGen/PowerPC/fma.ll
deleted file mode 100644
index fd9bd7400759..000000000000
--- a/release_23/test/CodeGen/PowerPC/fma.ll
+++ /dev/null
@@ -1,54 +0,0 @@
-; RUN: llvm-as < %s | llc -march=ppc32 | \
-; RUN: egrep {fn?madd|fn?msub} | count 8
-
-define double @test_FMADD1(double %A, double %B, double %C) {
- %D = mul double %A, %B ; <double> [#uses=1]
- %E = add double %D, %C ; <double> [#uses=1]
- ret double %E
-}
-
-define double @test_FMADD2(double %A, double %B, double %C) {
- %D = mul double %A, %B ; <double> [#uses=1]
- %E = add double %D, %C ; <double> [#uses=1]
- ret double %E
-}
-
-define double @test_FMSUB(double %A, double %B, double %C) {
- %D = mul double %A, %B ; <double> [#uses=1]
- %E = sub double %D, %C ; <double> [#uses=1]
- ret double %E
-}
-
-define double @test_FNMADD1(double %A, double %B, double %C) {
- %D = mul double %A, %B ; <double> [#uses=1]
- %E = add double %D, %C ; <double> [#uses=1]
- %F = sub double -0.000000e+00, %E ; <double> [#uses=1]
- ret double %F
-}
-
-define double @test_FNMADD2(double %A, double %B, double %C) {
- %D = mul double %A, %B ; <double> [#uses=1]
- %E = add double %C, %D ; <double> [#uses=1]
- %F = sub double -0.000000e+00, %E ; <double> [#uses=1]
- ret double %F
-}
-
-define double @test_FNMSUB1(double %A, double %B, double %C) {
- %D = mul double %A, %B ; <double> [#uses=1]
- %E = sub double %C, %D ; <double> [#uses=1]
- ret double %E
-}
-
-define double @test_FNMSUB2(double %A, double %B, double %C) {
- %D = mul double %A, %B ; <double> [#uses=1]
- %E = sub double %D, %C ; <double> [#uses=1]
- %F = sub double -0.000000e+00, %E ; <double> [#uses=1]
- ret double %F
-}
-
-define float @test_FNMSUBS(float %A, float %B, float %C) {
- %D = mul float %A, %B ; <float> [#uses=1]
- %E = sub float %D, %C ; <float> [#uses=1]
- %F = sub float -0.000000e+00, %E ; <float> [#uses=1]
- ret float %F
-}
diff --git a/release_23/test/CodeGen/PowerPC/fnabs.ll b/release_23/test/CodeGen/PowerPC/fnabs.ll
deleted file mode 100644
index b9517de28f9d..000000000000
--- a/release_23/test/CodeGen/PowerPC/fnabs.ll
+++ /dev/null
@@ -1,10 +0,0 @@
-; RUN: llvm-as < %s | llc -march=ppc32 | grep fnabs
-
-declare double @fabs(double)
-
-define double @test(double %X) {
- %Y = call double @fabs( double %X ) ; <double> [#uses=1]
- %Z = sub double -0.000000e+00, %Y ; <double> [#uses=1]
- ret double %Z
-}
-
diff --git a/release_23/test/CodeGen/PowerPC/fneg.ll b/release_23/test/CodeGen/PowerPC/fneg.ll
deleted file mode 100644
index a4f49f7625c7..000000000000
--- a/release_23/test/CodeGen/PowerPC/fneg.ll
+++ /dev/null
@@ -1,12 +0,0 @@
-; RUN: llvm-as < %s | llc -march=ppc32 | not grep fneg
-
-define double @test1(double %a, double %b, double %c, double %d) {
-entry:
- %tmp2 = sub double -0.000000e+00, %c ; <double> [#uses=1]
- %tmp4 = mul double %tmp2, %d ; <double> [#uses=1]
- %tmp7 = mul double %a, %b ; <double> [#uses=1]
- %tmp9 = sub double %tmp7, %tmp4 ; <double> [#uses=1]
- ret double %tmp9
-}
-
-
diff --git a/release_23/test/CodeGen/PowerPC/fnegsel.ll b/release_23/test/CodeGen/PowerPC/fnegsel.ll
deleted file mode 100644
index c223a496abdf..000000000000
--- a/release_23/test/CodeGen/PowerPC/fnegsel.ll
+++ /dev/null
@@ -1,9 +0,0 @@
-; RUN: llvm-as < %s | llc -march=ppc32 | not grep fneg
-
-define double @test_FNEG_sel(double %A, double %B, double %C) {
- %D = sub double -0.000000e+00, %A ; <double> [#uses=1]
- %Cond = fcmp ogt double %D, -0.000000e+00 ; <i1> [#uses=1]
- %E = select i1 %Cond, double %B, double %C ; <double> [#uses=1]
- ret double %E
-}
-
diff --git a/release_23/test/CodeGen/PowerPC/fold-li.ll b/release_23/test/CodeGen/PowerPC/fold-li.ll
deleted file mode 100644
index 2ac79f149131..000000000000
--- a/release_23/test/CodeGen/PowerPC/fold-li.ll
+++ /dev/null
@@ -1,15 +0,0 @@
-; RUN: llvm-as < %s | llc -march=ppc32 | \
-; RUN: grep -v align | not grep li
-
-;; Test that immediates are folded into these instructions correctly.
-
-define i32 @ADD(i32 %X) nounwind {
- %Y = add i32 %X, 65537 ; <i32> [#uses=1]
- ret i32 %Y
-}
-
-define i32 @SUB(i32 %X) nounwind {
- %Y = sub i32 %X, 65537 ; <i32> [#uses=1]
- ret i32 %Y
-}
-
diff --git a/release_23/test/CodeGen/PowerPC/fp-branch.ll b/release_23/test/CodeGen/PowerPC/fp-branch.ll
deleted file mode 100644
index 3db6ced572fe..000000000000
--- a/release_23/test/CodeGen/PowerPC/fp-branch.ll
+++ /dev/null
@@ -1,21 +0,0 @@
-; RUN: llvm-as < %s | llc -march=ppc32 | grep fcmp | count 1
-
-declare i1 @llvm.isunordered.f64(double, double)
-
-define i1 @intcoord_cond_next55(double %tmp48.reload) {
-newFuncRoot:
- br label %cond_next55
-
-bb72.exitStub: ; preds = %cond_next55
- ret i1 true
-
-cond_next62.exitStub: ; preds = %cond_next55
- ret i1 false
-
-cond_next55: ; preds = %newFuncRoot
- %tmp57 = fcmp oge double %tmp48.reload, 1.000000e+00 ; <i1> [#uses=1]
- %tmp58 = fcmp uno double %tmp48.reload, 1.000000e+00 ; <i1> [#uses=1]
- %tmp59 = or i1 %tmp57, %tmp58 ; <i1> [#uses=1]
- br i1 %tmp59, label %bb72.exitStub, label %cond_next62.exitStub
-}
-
diff --git a/release_23/test/CodeGen/PowerPC/fp-int-fp.ll b/release_23/test/CodeGen/PowerPC/fp-int-fp.ll
deleted file mode 100644
index 1b78b01e6c93..000000000000
--- a/release_23/test/CodeGen/PowerPC/fp-int-fp.ll
+++ /dev/null
@@ -1,27 +0,0 @@
-; RUN: llvm-as < %s | llc -march=ppc32 -mcpu=g5 | not grep r1
-
-define double @test1(double %X) {
- %Y = fptosi double %X to i64 ; <i64> [#uses=1]
- %Z = sitofp i64 %Y to double ; <double> [#uses=1]
- ret double %Z
-}
-
-define float @test2(double %X) {
- %Y = fptosi double %X to i64 ; <i64> [#uses=1]
- %Z = sitofp i64 %Y to float ; <float> [#uses=1]
- ret float %Z
-}
-
-define double @test3(float %X) {
- %Y = fptosi float %X to i64 ; <i64> [#uses=1]
- %Z = sitofp i64 %Y to double ; <double> [#uses=1]
- ret double %Z
-}
-
-define float @test4(float %X) {
- %Y = fptosi float %X to i64 ; <i64> [#uses=1]
- %Z = sitofp i64 %Y to float ; <float> [#uses=1]
- ret float %Z
-}
-
-
diff --git a/release_23/test/CodeGen/PowerPC/fp_to_uint.ll b/release_23/test/CodeGen/PowerPC/fp_to_uint.ll
deleted file mode 100644
index 43502bbb3ef0..000000000000
--- a/release_23/test/CodeGen/PowerPC/fp_to_uint.ll
+++ /dev/null
@@ -1,8 +0,0 @@
-; RUN: llvm-as < %s | llc -march=ppc32 | grep fctiwz | count 1
-
-define i16 @foo(float %a) {
-entry:
- %tmp.1 = fptoui float %a to i16 ; <i16> [#uses=1]
- ret i16 %tmp.1
-}
-
diff --git a/release_23/test/CodeGen/PowerPC/fpcopy.ll b/release_23/test/CodeGen/PowerPC/fpcopy.ll
deleted file mode 100644
index 7d8059645ad2..000000000000
--- a/release_23/test/CodeGen/PowerPC/fpcopy.ll
+++ /dev/null
@@ -1,7 +0,0 @@
-; RUN: llvm-as < %s | llc -march=ppc32 | not grep fmr
-
-define double @test(float %F) {
- %F.upgrd.1 = fpext float %F to double ; <double> [#uses=1]
- ret double %F.upgrd.1
-}
-
diff --git a/release_23/test/CodeGen/PowerPC/frounds.ll b/release_23/test/CodeGen/PowerPC/frounds.ll
deleted file mode 100644
index 0d8e621f354f..000000000000
--- a/release_23/test/CodeGen/PowerPC/frounds.ll
+++ /dev/null
@@ -1,19 +0,0 @@
-; RUN: llvm-as < %s | llc -march=ppc32
-
-define i32 @foo() {
-entry:
- %retval = alloca i32 ; <i32*> [#uses=2]
- %tmp = alloca i32 ; <i32*> [#uses=2]
- %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
- %tmp1 = call i32 @llvm.flt.rounds( ) ; <i32> [#uses=1]
- store i32 %tmp1, i32* %tmp, align 4
- %tmp2 = load i32* %tmp, align 4 ; <i32> [#uses=1]
- store i32 %tmp2, i32* %retval, align 4
- br label %return
-
-return: ; preds = %entry
- %retval3 = load i32* %retval ; <i32> [#uses=1]
- ret i32 %retval3
-}
-
-declare i32 @llvm.flt.rounds() nounwind
diff --git a/release_23/test/CodeGen/PowerPC/fsqrt.ll b/release_23/test/CodeGen/PowerPC/fsqrt.ll
deleted file mode 100644
index 1260c602f9d9..000000000000
--- a/release_23/test/CodeGen/PowerPC/fsqrt.ll
+++ /dev/null
@@ -1,23 +0,0 @@
-; fsqrt should be generated when the fsqrt feature is enabled, but not
-; otherwise.
-
-; RUN: llvm-as < %s | \
-; RUN: llc -march=ppc32 -mtriple=powerpc-apple-darwin8 -mattr=+fsqrt | \
-; RUN: grep {fsqrt f1, f1}
-; RUN: llvm-as < %s | \
-; RUN: llc -march=ppc32 -mtriple=powerpc-apple-darwin8 -mcpu=g5 | \
-; RUN: grep {fsqrt f1, f1}
-; RUN: llvm-as < %s | \
-; RUN: llc -march=ppc32 -mtriple=powerpc-apple-darwin8 -mattr=-fsqrt | \
-; RUN: not grep {fsqrt f1, f1}
-; RUN: llvm-as < %s | \
-; RUN: llc -march=ppc32 -mtriple=powerpc-apple-darwin8 -mcpu=g4 | \
-; RUN: not grep {fsqrt f1, f1}
-
-declare double @llvm.sqrt.f64(double)
-
-define double @X(double %Y) {
- %Z = call double @llvm.sqrt.f64( double %Y ) ; <double> [#uses=1]
- ret double %Z
-}
-
diff --git a/release_23/test/CodeGen/PowerPC/hello.ll b/release_23/test/CodeGen/PowerPC/hello.ll
deleted file mode 100644
index 1d7275f238bb..000000000000
--- a/release_23/test/CodeGen/PowerPC/hello.ll
+++ /dev/null
@@ -1,12 +0,0 @@
-; RUN: llvm-as < %s | llc -march=ppc32
-; RUN: llvm-as < %s | llc -march=ppc64
-; PR1399
-
-@.str = internal constant [13 x i8] c"Hello World!\00"
-
-define i32 @main() {
- %tmp2 = tail call i32 @puts( i8* getelementptr ([13 x i8]* @.str, i32 0, i64 0) )
- ret i32 0
-}
-
-declare i32 @puts(i8*)
diff --git a/release_23/test/CodeGen/PowerPC/i64_fp.ll b/release_23/test/CodeGen/PowerPC/i64_fp.ll
deleted file mode 100644
index 5ff2684d7b00..000000000000
--- a/release_23/test/CodeGen/PowerPC/i64_fp.ll
+++ /dev/null
@@ -1,26 +0,0 @@
-; fcfid and fctid should be generated when the 64bit feature is enabled, but not
-; otherwise.
-
-; RUN: llvm-as < %s | llc -march=ppc32 -mattr=+64bit | \
-; RUN: grep fcfid
-; RUN: llvm-as < %s | llc -march=ppc32 -mattr=+64bit | \
-; RUN: grep fctidz
-; RUN: llvm-as < %s | llc -march=ppc32 -mcpu=g5 | \
-; RUN: grep fcfid
-; RUN: llvm-as < %s | llc -march=ppc32 -mcpu=g5 | \
-; RUN: grep fctidz
-; RUN: llvm-as < %s | llc -march=ppc32 -mattr=-64bit | \
-; RUN: not grep fcfid
-; RUN: llvm-as < %s | llc -march=ppc32 -mattr=-64bit | \
-; RUN: not grep fctidz
-; RUN: llvm-as < %s | llc -march=ppc32 -mcpu=g4 | \
-; RUN: not grep fcfid
-; RUN: llvm-as < %s | llc -march=ppc32 -mcpu=g4 | \
-; RUN: not grep fctidz
-
-define double @X(double %Y) {
- %A = fptosi double %Y to i64 ; <i64> [#uses=1]
- %B = sitofp i64 %A to double ; <double> [#uses=1]
- ret double %B
-}
-
diff --git a/release_23/test/CodeGen/PowerPC/iabs.ll b/release_23/test/CodeGen/PowerPC/iabs.ll
deleted file mode 100644
index 677b41bb12e1..000000000000
--- a/release_23/test/CodeGen/PowerPC/iabs.ll
+++ /dev/null
@@ -1,15 +0,0 @@
-; RUN: llvm-as < %s | llc -march=ppc32 -stats |& \
-; RUN: grep {4 .*Number of machine instrs printed}
-
-;; Integer absolute value, should produce something as good as:
-;; srawi r2, r3, 31
-;; add r3, r3, r2
-;; xor r3, r3, r2
-;; blr
-define i32 @test(i32 %a) {
- %tmp1neg = sub i32 0, %a
- %b = icmp sgt i32 %a, -1
- %abs = select i1 %b, i32 %a, i32 %tmp1neg
- ret i32 %abs
-}
-
diff --git a/release_23/test/CodeGen/PowerPC/illegal-element-type.ll b/release_23/test/CodeGen/PowerPC/illegal-element-type.ll
deleted file mode 100644
index 54a06656b1b9..000000000000
--- a/release_23/test/CodeGen/PowerPC/illegal-element-type.ll
+++ /dev/null
@@ -1,23 +0,0 @@
-; RUN: llvm-as < %s | llc -march=ppc32 -mcpu=g3
-
-define void @foo() {
-entry:
- br label %bb
-
-bb: ; preds = %bb, %entry
- br i1 false, label %bb26, label %bb
-
-bb19: ; preds = %bb26
- ret void
-
-bb26: ; preds = %bb
- br i1 false, label %bb30, label %bb19
-
-bb30: ; preds = %bb26
- br label %bb45
-
-bb45: ; preds = %bb45, %bb30
- %V.0 = phi <8 x i16> [ %tmp42, %bb45 ], [ zeroinitializer, %bb30 ] ; <<8 x i16>> [#uses=1]
- %tmp42 = mul <8 x i16> zeroinitializer, %V.0 ; <<8 x i16>> [#uses=1]
- br label %bb45
-}
diff --git a/release_23/test/CodeGen/PowerPC/inlineasm-copy.ll b/release_23/test/CodeGen/PowerPC/inlineasm-copy.ll
deleted file mode 100644
index c0a397982adf..000000000000
--- a/release_23/test/CodeGen/PowerPC/inlineasm-copy.ll
+++ /dev/null
@@ -1,14 +0,0 @@
-; RUN: llvm-as < %s | llc -march=ppc32 | not grep mr
-
-define i32 @test(i32 %Y, i32 %X) {
-entry:
- %tmp = tail call i32 asm "foo $0", "=r"( ) ; <i32> [#uses=1]
- ret i32 %tmp
-}
-
-define i32 @test2(i32 %Y, i32 %X) {
-entry:
- %tmp1 = tail call i32 asm "foo $0, $1", "=r,r"( i32 %X ) ; <i32> [#uses=1]
- ret i32 %tmp1
-}
-
diff --git a/release_23/test/CodeGen/PowerPC/int-fp-conv-0.ll b/release_23/test/CodeGen/PowerPC/int-fp-conv-0.ll
deleted file mode 100644
index 82a182685143..000000000000
--- a/release_23/test/CodeGen/PowerPC/int-fp-conv-0.ll
+++ /dev/null
@@ -1,17 +0,0 @@
-; RUN: llvm-as < %s | llc -march=ppc64 > %t
-; RUN: grep __floattitf %t
-; RUN: grep __fixunstfti %t
-
-target datalayout = "E-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f128:64:128"
-target triple = "powerpc64-apple-darwin9.2.0"
-
-define ppc_fp128 @foo(i128 %a) nounwind {
-entry:
- %tmp2829 = uitofp i128 %a to ppc_fp128 ; <i64> [#uses=1]
- ret ppc_fp128 %tmp2829
-}
-define i128 @boo(ppc_fp128 %a) nounwind {
-entry:
- %tmp2829 = fptoui ppc_fp128 %a to i128 ; <i64> [#uses=1]
- ret i128 %tmp2829
-}
diff --git a/release_23/test/CodeGen/PowerPC/int-fp-conv-1.ll b/release_23/test/CodeGen/PowerPC/int-fp-conv-1.ll
deleted file mode 100644
index 3d6667539f24..000000000000
--- a/release_23/test/CodeGen/PowerPC/int-fp-conv-1.ll
+++ /dev/null
@@ -1,11 +0,0 @@
-; RUN: llvm-as < %s | llc -march=ppc64 | grep __floatditf
-
-define i64 @__fixunstfdi(ppc_fp128 %a) nounwind {
-entry:
- %tmp1213 = uitofp i64 0 to ppc_fp128 ; <ppc_fp128> [#uses=1]
- %tmp15 = sub ppc_fp128 %a, %tmp1213 ; <ppc_fp128> [#uses=1]
- %tmp2829 = fptoui ppc_fp128 %tmp15 to i32 ; <i32> [#uses=1]
- %tmp282930 = zext i32 %tmp2829 to i64 ; <i64> [#uses=1]
- %tmp32 = add i64 %tmp282930, 0 ; <i64> [#uses=1]
- ret i64 %tmp32
-}
diff --git a/release_23/test/CodeGen/PowerPC/invalid-memcpy.ll b/release_23/test/CodeGen/PowerPC/invalid-memcpy.ll
deleted file mode 100644
index 6df968dddae5..000000000000
--- a/release_23/test/CodeGen/PowerPC/invalid-memcpy.ll
+++ /dev/null
@@ -1,20 +0,0 @@
-; RUN: llvm-as < %s | llc -march=ppc32
-; RUN: llvm-as < %s | llc -march=ppc64
-
-; This testcase is invalid (the alignment specified for memcpy is
-; greater than the alignment guaranteed for Qux or C.0.1173, but it
-; should compile, not crash the code generator.
-
-@C.0.1173 = external constant [33 x i8] ; <[33 x i8]*> [#uses=1]
-
-define void @Bork() {
-entry:
- %Qux = alloca [33 x i8] ; <[33 x i8]*> [#uses=1]
- %Qux1 = bitcast [33 x i8]* %Qux to i8* ; <i8*> [#uses=1]
- call void @llvm.memcpy.i64( i8* %Qux1, i8* getelementptr ([33 x i8]* @C.0.1173, i32 0, i32 0), i64 33, i32 8 )
- ret void
-}
-
-declare void @llvm.memcpy.i64(i8*, i8*, i64, i32)
-
-
diff --git a/release_23/test/CodeGen/PowerPC/inverted-bool-compares.ll b/release_23/test/CodeGen/PowerPC/inverted-bool-compares.ll
deleted file mode 100644
index f8c5f11180ca..000000000000
--- a/release_23/test/CodeGen/PowerPC/inverted-bool-compares.ll
+++ /dev/null
@@ -1,13 +0,0 @@
-; RUN: llvm-as < %s | llc -march=ppc32 | not grep xori
-
-define i32 @test(i1 %B, i32* %P) {
- br i1 %B, label %T, label %F
-
-T: ; preds = %0
- store i32 123, i32* %P
- ret i32 0
-
-F: ; preds = %0
- ret i32 17
-}
-
diff --git a/release_23/test/CodeGen/PowerPC/ispositive.ll b/release_23/test/CodeGen/PowerPC/ispositive.ll
deleted file mode 100644
index 192d7384e953..000000000000
--- a/release_23/test/CodeGen/PowerPC/ispositive.ll
+++ /dev/null
@@ -1,10 +0,0 @@
-; RUN: llvm-as < %s | llc -march=ppc32 -mtriple=powerpc-apple-darwin8 | \
-; RUN: grep {srwi r3, r3, 31}
-
-define i32 @test1(i32 %X) {
-entry:
- icmp slt i32 %X, 0 ; <i1>:0 [#uses=1]
- zext i1 %0 to i32 ; <i32>:1 [#uses=1]
- ret i32 %1
-}
-
diff --git a/release_23/test/CodeGen/PowerPC/itofp128.ll b/release_23/test/CodeGen/PowerPC/itofp128.ll
deleted file mode 100644
index 91119e9e8ef5..000000000000
--- a/release_23/test/CodeGen/PowerPC/itofp128.ll
+++ /dev/null
@@ -1,14 +0,0 @@
-; RUN: llvm-as < %s | llc -march=ppc64
-
-target datalayout = "E-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f128:64:128"
-target triple = "powerpc64-apple-darwin9.2.0"
-
-define i128 @__fixunstfti(ppc_fp128 %a) nounwind {
-entry:
- %tmp1213 = uitofp i128 0 to ppc_fp128 ; <ppc_fp128> [#uses=1]
- %tmp15 = sub ppc_fp128 %a, %tmp1213 ; <ppc_fp128> [#uses=1]
- %tmp2829 = fptoui ppc_fp128 %tmp15 to i64 ; <i64> [#uses=1]
- %tmp282930 = zext i64 %tmp2829 to i128 ; <i128> [#uses=1]
- %tmp32 = add i128 %tmp282930, 0 ; <i128> [#uses=1]
- ret i128 %tmp32
-}
diff --git a/release_23/test/CodeGen/PowerPC/lha.ll b/release_23/test/CodeGen/PowerPC/lha.ll
deleted file mode 100644
index e8f73eea2e2e..000000000000
--- a/release_23/test/CodeGen/PowerPC/lha.ll
+++ /dev/null
@@ -1,8 +0,0 @@
-; RUN: llvm-as < %s | llc -march=ppc32 | grep lha
-
-define i32 @test(i16* %a) {
- %tmp.1 = load i16* %a ; <i16> [#uses=1]
- %tmp.2 = sext i16 %tmp.1 to i32 ; <i32> [#uses=1]
- ret i32 %tmp.2
-}
-
diff --git a/release_23/test/CodeGen/PowerPC/load-constant-addr.ll b/release_23/test/CodeGen/PowerPC/load-constant-addr.ll
deleted file mode 100644
index d2be04efd036..000000000000
--- a/release_23/test/CodeGen/PowerPC/load-constant-addr.ll
+++ /dev/null
@@ -1,9 +0,0 @@
-; Should fold the ori into the lfs.
-; RUN: llvm-as < %s | llc -march=ppc32 | grep lfs
-; RUN: llvm-as < %s | llc -march=ppc32 | not grep ori
-
-define float @test() {
- %tmp.i = load float* inttoptr (i32 186018016 to float*) ; <float> [#uses=1]
- ret float %tmp.i
-}
-
diff --git a/release_23/test/CodeGen/PowerPC/long-compare.ll b/release_23/test/CodeGen/PowerPC/long-compare.ll
deleted file mode 100644
index 7b907250e1fc..000000000000
--- a/release_23/test/CodeGen/PowerPC/long-compare.ll
+++ /dev/null
@@ -1,9 +0,0 @@
-; RUN: llvm-as < %s | llc -march=ppc32 | grep cntlzw
-; RUN: llvm-as < %s | llc -march=ppc32 | not grep xori
-; RUN: llvm-as < %s | llc -march=ppc32 | not grep {li }
-; RUN: llvm-as < %s | llc -march=ppc32 | not grep {mr }
-
-define i1 @test(i64 %x) {
- %tmp = icmp ult i64 %x, 4294967296
- ret i1 %tmp
-}
diff --git a/release_23/test/CodeGen/PowerPC/longdbl-truncate.ll b/release_23/test/CodeGen/PowerPC/longdbl-truncate.ll
deleted file mode 100644
index a87382405a5d..000000000000
--- a/release_23/test/CodeGen/PowerPC/longdbl-truncate.ll
+++ /dev/null
@@ -1,9 +0,0 @@
-; RUN: llvm-as < %s | llc
-target datalayout = "E-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f128:64:128"
-target triple = "powerpc-apple-darwin8"
-
-define double @SolveCubic(ppc_fp128 %X) {
-entry:
- %Y = fptrunc ppc_fp128 %X to double
- ret double %Y
-}
diff --git a/release_23/test/CodeGen/PowerPC/mask64.ll b/release_23/test/CodeGen/PowerPC/mask64.ll
deleted file mode 100644
index 69d2200212f9..000000000000
--- a/release_23/test/CodeGen/PowerPC/mask64.ll
+++ /dev/null
@@ -1,27 +0,0 @@
-; RUN: llvm-as < %s | llc
-
-target datalayout = "E-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f128:64:128"
-target triple = "powerpc64-apple-darwin9.2.0"
- %struct.re_pattern_buffer = type <{ i8*, i64, i8, [7 x i8] }>
-
-define i32 @xre_search_2(%struct.re_pattern_buffer* %bufp, i32 %range) nounwind {
-entry:
- br i1 false, label %bb16, label %bb49
-
-bb16: ; preds = %entry
- %tmp19 = load i8** null, align 1 ; <i8*> [#uses=1]
- %tmp21 = load i8* %tmp19, align 1 ; <i8> [#uses=1]
- switch i8 %tmp21, label %bb49 [
- i8 0, label %bb45
- i8 1, label %bb34
- ]
-
-bb34: ; preds = %bb16
- ret i32 0
-
-bb45: ; preds = %bb16
- ret i32 -1
-
-bb49: ; preds = %bb16, %entry
- ret i32 0
-}
diff --git a/release_23/test/CodeGen/PowerPC/mem-rr-addr-mode.ll b/release_23/test/CodeGen/PowerPC/mem-rr-addr-mode.ll
deleted file mode 100644
index d5484bd4b78d..000000000000
--- a/release_23/test/CodeGen/PowerPC/mem-rr-addr-mode.ll
+++ /dev/null
@@ -1,18 +0,0 @@
-; RUN: llvm-as < %s | llc -march=ppc32 -mcpu=g5 | grep li.*16
-; RUN: llvm-as < %s | llc -march=ppc32 -mcpu=g5 | not grep addi
-
-; Codegen lvx (R+16) as t = li 16, lvx t,R
-; This shares the 16 between the two loads.
-
-define void @func(<4 x float>* %a, <4 x float>* %b) {
- %tmp1 = getelementptr <4 x float>* %b, i32 1 ; <<4 x float>*> [#uses=1]
- %tmp = load <4 x float>* %tmp1 ; <<4 x float>> [#uses=1]
- %tmp3 = getelementptr <4 x float>* %a, i32 1 ; <<4 x float>*> [#uses=1]
- %tmp4 = load <4 x float>* %tmp3 ; <<4 x float>> [#uses=1]
- %tmp5 = mul <4 x float> %tmp, %tmp4 ; <<4 x float>> [#uses=1]
- %tmp8 = load <4 x float>* %b ; <<4 x float>> [#uses=1]
- %tmp9 = add <4 x float> %tmp5, %tmp8 ; <<4 x float>> [#uses=1]
- store <4 x float> %tmp9, <4 x float>* %a
- ret void
-}
-
diff --git a/release_23/test/CodeGen/PowerPC/mem_update.ll b/release_23/test/CodeGen/PowerPC/mem_update.ll
deleted file mode 100644
index a1527629980b..000000000000
--- a/release_23/test/CodeGen/PowerPC/mem_update.ll
+++ /dev/null
@@ -1,68 +0,0 @@
-; RUN: llvm-as < %s | llc -march=ppc32 -enable-ppc-preinc | \
-; RUN: not grep addi
-; RUN: llvm-as < %s | llc -march=ppc64 -enable-ppc-preinc | \
-; RUN: not grep addi
-
-@Glob = global i64 4 ; <i64*> [#uses=2]
-
-define i32* @test0(i32* %X, i32* %dest) {
- %Y = getelementptr i32* %X, i32 4 ; <i32*> [#uses=2]
- %A = load i32* %Y ; <i32> [#uses=1]
- store i32 %A, i32* %dest
- ret i32* %Y
-}
-
-define i32* @test1(i32* %X, i32* %dest) {
- %Y = getelementptr i32* %X, i32 4 ; <i32*> [#uses=2]
- %A = load i32* %Y ; <i32> [#uses=1]
- store i32 %A, i32* %dest
- ret i32* %Y
-}
-
-define i16* @test2(i16* %X, i32* %dest) {
- %Y = getelementptr i16* %X, i32 4 ; <i16*> [#uses=2]
- %A = load i16* %Y ; <i16> [#uses=1]
- %B = sext i16 %A to i32 ; <i32> [#uses=1]
- store i32 %B, i32* %dest
- ret i16* %Y
-}
-
-define i16* @test3(i16* %X, i32* %dest) {
- %Y = getelementptr i16* %X, i32 4 ; <i16*> [#uses=2]
- %A = load i16* %Y ; <i16> [#uses=1]
- %B = zext i16 %A to i32 ; <i32> [#uses=1]
- store i32 %B, i32* %dest
- ret i16* %Y
-}
-
-define i16* @test3a(i16* %X, i64* %dest) {
- %Y = getelementptr i16* %X, i32 4 ; <i16*> [#uses=2]
- %A = load i16* %Y ; <i16> [#uses=1]
- %B = sext i16 %A to i64 ; <i64> [#uses=1]
- store i64 %B, i64* %dest
- ret i16* %Y
-}
-
-define i64* @test4(i64* %X, i64* %dest) {
- %Y = getelementptr i64* %X, i32 4 ; <i64*> [#uses=2]
- %A = load i64* %Y ; <i64> [#uses=1]
- store i64 %A, i64* %dest
- ret i64* %Y
-}
-
-define i16* @test5(i16* %X) {
- %Y = getelementptr i16* %X, i32 4 ; <i16*> [#uses=2]
- store i16 7, i16* %Y
- ret i16* %Y
-}
-
-define i64* @test6(i64* %X, i64 %A) {
- %Y = getelementptr i64* %X, i32 4 ; <i64*> [#uses=2]
- store i64 %A, i64* %Y
- ret i64* %Y
-}
-
-define i64* @test7(i64* %X, i64 %A) {
- store i64 %A, i64* @Glob
- ret i64* @Glob
-}
diff --git a/release_23/test/CodeGen/PowerPC/mul-neg-power-2.ll b/release_23/test/CodeGen/PowerPC/mul-neg-power-2.ll
deleted file mode 100644
index 90446d707db7..000000000000
--- a/release_23/test/CodeGen/PowerPC/mul-neg-power-2.ll
+++ /dev/null
@@ -1,8 +0,0 @@
-; RUN: llvm-as < %s | llc -march=ppc32 | not grep mul
-
-define i32 @test1(i32 %a) {
- %tmp.1 = mul i32 %a, -2 ; <i32> [#uses=1]
- %tmp.2 = add i32 %tmp.1, 63 ; <i32> [#uses=1]
- ret i32 %tmp.2
-}
-
diff --git a/release_23/test/CodeGen/PowerPC/mulhs.ll b/release_23/test/CodeGen/PowerPC/mulhs.ll
deleted file mode 100644
index 3b0daad227e9..000000000000
--- a/release_23/test/CodeGen/PowerPC/mulhs.ll
+++ /dev/null
@@ -1,17 +0,0 @@
-; All of these ands and shifts should be folded into rlwimi's
-; RUN: llvm-as < %s | llc -march=ppc32 -o %t -f
-; RUN: not grep mulhwu %t
-; RUN: not grep srawi %t
-; RUN: not grep add %t
-; RUN: grep mulhw %t | count 1
-
-define i32 @mulhs(i32 %a, i32 %b) {
-entry:
- %tmp.1 = sext i32 %a to i64 ; <i64> [#uses=1]
- %tmp.3 = sext i32 %b to i64 ; <i64> [#uses=1]
- %tmp.4 = mul i64 %tmp.3, %tmp.1 ; <i64> [#uses=1]
- %tmp.6 = lshr i64 %tmp.4, 32 ; <i64> [#uses=1]
- %tmp.7 = trunc i64 %tmp.6 to i32 ; <i32> [#uses=1]
- ret i32 %tmp.7
-}
-
diff --git a/release_23/test/CodeGen/PowerPC/multiple-return-values.ll b/release_23/test/CodeGen/PowerPC/multiple-return-values.ll
deleted file mode 100644
index b72b148259dc..000000000000
--- a/release_23/test/CodeGen/PowerPC/multiple-return-values.ll
+++ /dev/null
@@ -1,17 +0,0 @@
-; RUN: llvm-as < %s | llc -march=ppc32
-; RUN: llvm-as < %s | llc -march=ppc64
-
-define {i64, float} @bar(i64 %a, float %b) {
- %y = add i64 %a, 7
- %z = add float %b, 7.0
- ret i64 %y, float %z
-}
-
-define i64 @foo() {
- %M = call {i64, float} @bar(i64 21, float 21.0)
- %N = getresult {i64, float} %M, 0
- %O = getresult {i64, float} %M, 1
- %P = fptosi float %O to i64
- %Q = add i64 %P, %N
- ret i64 %Q
-}
diff --git a/release_23/test/CodeGen/PowerPC/neg.ll b/release_23/test/CodeGen/PowerPC/neg.ll
deleted file mode 100644
index c13559903901..000000000000
--- a/release_23/test/CodeGen/PowerPC/neg.ll
+++ /dev/null
@@ -1,7 +0,0 @@
-; RUN: llvm-as < %s | llc -march=ppc32 | grep neg
-
-define i32 @test(i32 %X) {
- %Y = sub i32 0, %X ; <i32> [#uses=1]
- ret i32 %Y
-}
-
diff --git a/release_23/test/CodeGen/PowerPC/no-dead-strip.ll b/release_23/test/CodeGen/PowerPC/no-dead-strip.ll
deleted file mode 100644
index e7ceaaeab678..000000000000
--- a/release_23/test/CodeGen/PowerPC/no-dead-strip.ll
+++ /dev/null
@@ -1,8 +0,0 @@
-; RUN: llvm-as < %s | llc | grep {no_dead_strip.*_X}
-
-target datalayout = "E-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64"
-target triple = "powerpc-apple-darwin8.8.0"
-@X = weak global i32 0 ; <i32*> [#uses=1]
-@.str = internal constant [4 x i8] c"t.c\00", section "llvm.metadata" ; <[4 x i8]*> [#uses=1]
-@llvm.used = appending global [1 x i8*] [ i8* bitcast (i32* @X to i8*) ], section "llvm.metadata" ; <[1 x i8*]*> [#uses=0]
-
diff --git a/release_23/test/CodeGen/PowerPC/or-addressing-mode.ll b/release_23/test/CodeGen/PowerPC/or-addressing-mode.ll
deleted file mode 100644
index 9b6e9551bf04..000000000000
--- a/release_23/test/CodeGen/PowerPC/or-addressing-mode.ll
+++ /dev/null
@@ -1,22 +0,0 @@
-; RUN: llvm-as < %s | llc -mtriple=powerpc-apple-darwin8 | not grep ori
-; RUN: llvm-as < %s | llc -mtriple=powerpc-apple-darwin8 | not grep rlwimi
-
-define i32 @test1(i8* %P) {
- %tmp.2.i = ptrtoint i8* %P to i32 ; <i32> [#uses=2]
- %tmp.4.i = and i32 %tmp.2.i, -65536 ; <i32> [#uses=1]
- %tmp.10.i = lshr i32 %tmp.2.i, 5 ; <i32> [#uses=1]
- %tmp.11.i = and i32 %tmp.10.i, 2040 ; <i32> [#uses=1]
- %tmp.13.i = or i32 %tmp.11.i, %tmp.4.i ; <i32> [#uses=1]
- %tmp.14.i = inttoptr i32 %tmp.13.i to i32* ; <i32*> [#uses=1]
- %tmp.3 = load i32* %tmp.14.i ; <i32> [#uses=1]
- ret i32 %tmp.3
-}
-
-define i32 @test2(i32 %P) {
- %tmp.2 = shl i32 %P, 4 ; <i32> [#uses=1]
- %tmp.3 = or i32 %tmp.2, 2 ; <i32> [#uses=1]
- %tmp.4 = inttoptr i32 %tmp.3 to i32* ; <i32*> [#uses=1]
- %tmp.5 = load i32* %tmp.4 ; <i32> [#uses=1]
- ret i32 %tmp.5
-}
-
diff --git a/release_23/test/CodeGen/PowerPC/ppcf128-1-opt.ll b/release_23/test/CodeGen/PowerPC/ppcf128-1-opt.ll
deleted file mode 100644
index 5c059b4ea291..000000000000
--- a/release_23/test/CodeGen/PowerPC/ppcf128-1-opt.ll
+++ /dev/null
@@ -1,29 +0,0 @@
-; RUN: llvm-as < %s | llc > %t
-; ModuleID = '<stdin>'
-target datalayout = "E-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f128:64:128"
-target triple = "powerpc-apple-darwin8"
-
-define ppc_fp128 @plus(ppc_fp128 %x, ppc_fp128 %y) {
-entry:
- %tmp3 = add ppc_fp128 %x, %y ; <ppc_fp128> [#uses=1]
- ret ppc_fp128 %tmp3
-}
-
-define ppc_fp128 @minus(ppc_fp128 %x, ppc_fp128 %y) {
-entry:
- %tmp3 = sub ppc_fp128 %x, %y ; <ppc_fp128> [#uses=1]
- ret ppc_fp128 %tmp3
-}
-
-define ppc_fp128 @times(ppc_fp128 %x, ppc_fp128 %y) {
-entry:
- %tmp3 = mul ppc_fp128 %x, %y ; <ppc_fp128> [#uses=1]
- ret ppc_fp128 %tmp3
-}
-
-define ppc_fp128 @divide(ppc_fp128 %x, ppc_fp128 %y) {
-entry:
- %tmp3 = fdiv ppc_fp128 %x, %y ; <ppc_fp128> [#uses=1]
- ret ppc_fp128 %tmp3
-}
-
diff --git a/release_23/test/CodeGen/PowerPC/ppcf128-1.ll b/release_23/test/CodeGen/PowerPC/ppcf128-1.ll
deleted file mode 100644
index ea8dd37c97d8..000000000000
--- a/release_23/test/CodeGen/PowerPC/ppcf128-1.ll
+++ /dev/null
@@ -1,92 +0,0 @@
-; RUN: llvm-as < %s | opt -std-compile-opts | llc > %t
-; ModuleID = 'ld3.c'
-target datalayout = "E-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f128:64:128"
-target triple = "powerpc-apple-darwin8"
-
-define ppc_fp128 @plus(ppc_fp128 %x, ppc_fp128 %y) {
-entry:
- %x_addr = alloca ppc_fp128 ; <ppc_fp128*> [#uses=2]
- %y_addr = alloca ppc_fp128 ; <ppc_fp128*> [#uses=2]
- %retval = alloca ppc_fp128, align 16 ; <ppc_fp128*> [#uses=2]
- %tmp = alloca ppc_fp128, align 16 ; <ppc_fp128*> [#uses=2]
- %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
- store ppc_fp128 %x, ppc_fp128* %x_addr
- store ppc_fp128 %y, ppc_fp128* %y_addr
- %tmp1 = load ppc_fp128* %x_addr, align 16 ; <ppc_fp128> [#uses=1]
- %tmp2 = load ppc_fp128* %y_addr, align 16 ; <ppc_fp128> [#uses=1]
- %tmp3 = add ppc_fp128 %tmp1, %tmp2 ; <ppc_fp128> [#uses=1]
- store ppc_fp128 %tmp3, ppc_fp128* %tmp, align 16
- %tmp4 = load ppc_fp128* %tmp, align 16 ; <ppc_fp128> [#uses=1]
- store ppc_fp128 %tmp4, ppc_fp128* %retval, align 16
- br label %return
-
-return: ; preds = %entry
- %retval5 = load ppc_fp128* %retval ; <ppc_fp128> [#uses=1]
- ret ppc_fp128 %retval5
-}
-
-define ppc_fp128 @minus(ppc_fp128 %x, ppc_fp128 %y) {
-entry:
- %x_addr = alloca ppc_fp128 ; <ppc_fp128*> [#uses=2]
- %y_addr = alloca ppc_fp128 ; <ppc_fp128*> [#uses=2]
- %retval = alloca ppc_fp128, align 16 ; <ppc_fp128*> [#uses=2]
- %tmp = alloca ppc_fp128, align 16 ; <ppc_fp128*> [#uses=2]
- %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
- store ppc_fp128 %x, ppc_fp128* %x_addr
- store ppc_fp128 %y, ppc_fp128* %y_addr
- %tmp1 = load ppc_fp128* %x_addr, align 16 ; <ppc_fp128> [#uses=1]
- %tmp2 = load ppc_fp128* %y_addr, align 16 ; <ppc_fp128> [#uses=1]
- %tmp3 = sub ppc_fp128 %tmp1, %tmp2 ; <ppc_fp128> [#uses=1]
- store ppc_fp128 %tmp3, ppc_fp128* %tmp, align 16
- %tmp4 = load ppc_fp128* %tmp, align 16 ; <ppc_fp128> [#uses=1]
- store ppc_fp128 %tmp4, ppc_fp128* %retval, align 16
- br label %return
-
-return: ; preds = %entry
- %retval5 = load ppc_fp128* %retval ; <ppc_fp128> [#uses=1]
- ret ppc_fp128 %retval5
-}
-
-define ppc_fp128 @times(ppc_fp128 %x, ppc_fp128 %y) {
-entry:
- %x_addr = alloca ppc_fp128 ; <ppc_fp128*> [#uses=2]
- %y_addr = alloca ppc_fp128 ; <ppc_fp128*> [#uses=2]
- %retval = alloca ppc_fp128, align 16 ; <ppc_fp128*> [#uses=2]
- %tmp = alloca ppc_fp128, align 16 ; <ppc_fp128*> [#uses=2]
- %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
- store ppc_fp128 %x, ppc_fp128* %x_addr
- store ppc_fp128 %y, ppc_fp128* %y_addr
- %tmp1 = load ppc_fp128* %x_addr, align 16 ; <ppc_fp128> [#uses=1]
- %tmp2 = load ppc_fp128* %y_addr, align 16 ; <ppc_fp128> [#uses=1]
- %tmp3 = mul ppc_fp128 %tmp1, %tmp2 ; <ppc_fp128> [#uses=1]
- store ppc_fp128 %tmp3, ppc_fp128* %tmp, align 16
- %tmp4 = load ppc_fp128* %tmp, align 16 ; <ppc_fp128> [#uses=1]
- store ppc_fp128 %tmp4, ppc_fp128* %retval, align 16
- br label %return
-
-return: ; preds = %entry
- %retval5 = load ppc_fp128* %retval ; <ppc_fp128> [#uses=1]
- ret ppc_fp128 %retval5
-}
-
-define ppc_fp128 @divide(ppc_fp128 %x, ppc_fp128 %y) {
-entry:
- %x_addr = alloca ppc_fp128 ; <ppc_fp128*> [#uses=2]
- %y_addr = alloca ppc_fp128 ; <ppc_fp128*> [#uses=2]
- %retval = alloca ppc_fp128, align 16 ; <ppc_fp128*> [#uses=2]
- %tmp = alloca ppc_fp128, align 16 ; <ppc_fp128*> [#uses=2]
- %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
- store ppc_fp128 %x, ppc_fp128* %x_addr
- store ppc_fp128 %y, ppc_fp128* %y_addr
- %tmp1 = load ppc_fp128* %x_addr, align 16 ; <ppc_fp128> [#uses=1]
- %tmp2 = load ppc_fp128* %y_addr, align 16 ; <ppc_fp128> [#uses=1]
- %tmp3 = fdiv ppc_fp128 %tmp1, %tmp2 ; <ppc_fp128> [#uses=1]
- store ppc_fp128 %tmp3, ppc_fp128* %tmp, align 16
- %tmp4 = load ppc_fp128* %tmp, align 16 ; <ppc_fp128> [#uses=1]
- store ppc_fp128 %tmp4, ppc_fp128* %retval, align 16
- br label %return
-
-return: ; preds = %entry
- %retval5 = load ppc_fp128* %retval ; <ppc_fp128> [#uses=1]
- ret ppc_fp128 %retval5
-}
diff --git a/release_23/test/CodeGen/PowerPC/ppcf128-2.ll b/release_23/test/CodeGen/PowerPC/ppcf128-2.ll
deleted file mode 100644
index b4f61f89fb64..000000000000
--- a/release_23/test/CodeGen/PowerPC/ppcf128-2.ll
+++ /dev/null
@@ -1,14 +0,0 @@
-; RUN: llvm-as < %s | llc -march=ppc64
-
-define i64 @__fixtfdi(ppc_fp128 %a) nounwind {
-entry:
- br i1 false, label %bb, label %bb8
-bb: ; preds = %entry
- %tmp5 = sub ppc_fp128 0xM80000000000000000000000000000000, %a ; <ppc_fp128> [#uses=1]
- %tmp6 = tail call i64 @__fixunstfdi( ppc_fp128 %tmp5 ) nounwind ; <i64> [#uses=0]
- ret i64 0
-bb8: ; preds = %entry
- ret i64 0
-}
-
-declare i64 @__fixunstfdi(ppc_fp128)
diff --git a/release_23/test/CodeGen/PowerPC/ppcf128-3.ll b/release_23/test/CodeGen/PowerPC/ppcf128-3.ll
deleted file mode 100644
index 3a51f4d3dd60..000000000000
--- a/release_23/test/CodeGen/PowerPC/ppcf128-3.ll
+++ /dev/null
@@ -1,32 +0,0 @@
-; RUN: llvm-as < %s | llc -march=ppc32
- %struct.stp_sequence = type { double, double }
-
-define i32 @stp_sequence_set_short_data(%struct.stp_sequence* %sequence, i32 %count, i16* %data) {
-entry:
- %tmp1112 = sitofp i16 0 to ppc_fp128 ; <ppc_fp128> [#uses=1]
- %tmp13 = call i32 (...)* @__inline_isfinite( ppc_fp128 %tmp1112 ) nounwind ; <i32> [#uses=0]
- ret i32 0
-}
-
-define i32 @stp_sequence_set_short_data2(%struct.stp_sequence* %sequence, i32 %count, i16* %data) {
-entry:
- %tmp1112 = sitofp i8 0 to ppc_fp128 ; <ppc_fp128> [#uses=1]
- %tmp13 = call i32 (...)* @__inline_isfinite( ppc_fp128 %tmp1112 ) nounwind ; <i32> [#uses=0]
- ret i32 0
-}
-
-define i32 @stp_sequence_set_short_data3(%struct.stp_sequence* %sequence, i32 %count, i16* %data) {
-entry:
- %tmp1112 = uitofp i16 0 to ppc_fp128 ; <ppc_fp128> [#uses=1]
- %tmp13 = call i32 (...)* @__inline_isfinite( ppc_fp128 %tmp1112 ) nounwind ; <i32> [#uses=0]
- ret i32 0
-}
-
-define i32 @stp_sequence_set_short_data4(%struct.stp_sequence* %sequence, i32 %count, i16* %data) {
-entry:
- %tmp1112 = uitofp i8 0 to ppc_fp128 ; <ppc_fp128> [#uses=1]
- %tmp13 = call i32 (...)* @__inline_isfinite( ppc_fp128 %tmp1112 ) nounwind ; <i32> [#uses=0]
- ret i32 0
-}
-
-declare i32 @__inline_isfinite(...)
diff --git a/release_23/test/CodeGen/PowerPC/ppcf128-4.ll b/release_23/test/CodeGen/PowerPC/ppcf128-4.ll
deleted file mode 100644
index 8921dfcd5a0d..000000000000
--- a/release_23/test/CodeGen/PowerPC/ppcf128-4.ll
+++ /dev/null
@@ -1,10 +0,0 @@
-; RUN: llvm-as < %s | llc -march=ppc32
-
-define ppc_fp128 @__floatditf(i64 %u) nounwind {
-entry:
- %tmp6 = mul ppc_fp128 0xM00000000000000000000000000000000, 0xM41F00000000000000000000000000000
- %tmp78 = trunc i64 %u to i32
- %tmp789 = uitofp i32 %tmp78 to ppc_fp128
- %tmp11 = add ppc_fp128 %tmp789, %tmp6
- ret ppc_fp128 %tmp11
-}
diff --git a/release_23/test/CodeGen/PowerPC/reg-coalesce-simple.ll b/release_23/test/CodeGen/PowerPC/reg-coalesce-simple.ll
deleted file mode 100644
index b86ed1a6a76e..000000000000
--- a/release_23/test/CodeGen/PowerPC/reg-coalesce-simple.ll
+++ /dev/null
@@ -1,12 +0,0 @@
-; RUN: llvm-as < %s | llc -march=ppc32 | not grep or
-
-%struct.foo = type { i32, i32, [0 x i8] }
-
-define i32 @test(%struct.foo* %X) nounwind {
- %tmp1 = getelementptr %struct.foo* %X, i32 0, i32 2, i32 100 ; <i8*> [#uses=1]
- %tmp = load i8* %tmp1 ; <i8> [#uses=1]
- %tmp2 = zext i8 %tmp to i32 ; <i32> [#uses=1]
- ret i32 %tmp2
-}
-
-
diff --git a/release_23/test/CodeGen/PowerPC/retaddr.ll b/release_23/test/CodeGen/PowerPC/retaddr.ll
deleted file mode 100644
index f4cad34addad..000000000000
--- a/release_23/test/CodeGen/PowerPC/retaddr.ll
+++ /dev/null
@@ -1,15 +0,0 @@
-; RUN: llvm-as < %s | llc -march=ppc32 | grep mflr
-; RUN: llvm-as < %s | llc -march=ppc32 | grep lwz
-; RUN: llvm-as < %s | llc -march=ppc64 | grep {ld r., 16(r1)}
-
-target triple = "powerpc-apple-darwin8"
-
-define void @foo(i8** %X) {
-entry:
- %tmp = tail call i8* @llvm.returnaddress( i32 0 ) ; <i8*> [#uses=1]
- store i8* %tmp, i8** %X, align 4
- ret void
-}
-
-declare i8* @llvm.returnaddress(i32)
-
diff --git a/release_23/test/CodeGen/PowerPC/return-val-i128.ll b/release_23/test/CodeGen/PowerPC/return-val-i128.ll
deleted file mode 100644
index 6e68ee3c5203..000000000000
--- a/release_23/test/CodeGen/PowerPC/return-val-i128.ll
+++ /dev/null
@@ -1,36 +0,0 @@
-; RUN: llvm-as < %s | llc -march=ppc64
-
-define i128 @__fixsfdi(float %a) {
-entry:
- %a_addr = alloca float ; <float*> [#uses=4]
- %retval = alloca i128, align 16 ; <i128*> [#uses=2]
- %tmp = alloca i128, align 16 ; <i128*> [#uses=3]
- %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
- store float %a, float* %a_addr
- %tmp1 = load float* %a_addr, align 4 ; <float> [#uses=1]
- %tmp2 = fcmp olt float %tmp1, 0.000000e+00 ; <i1> [#uses=1]
- %tmp23 = zext i1 %tmp2 to i8 ; <i8> [#uses=1]
- %toBool = icmp ne i8 %tmp23, 0 ; <i1> [#uses=1]
- br i1 %toBool, label %bb, label %bb8
-bb: ; preds = %entry
- %tmp4 = load float* %a_addr, align 4 ; <float> [#uses=1]
- %tmp5 = sub float -0.000000e+00, %tmp4 ; <float> [#uses=1]
- %tmp6 = call i128 @__fixunssfDI( float %tmp5 ) nounwind ; <i128> [#uses=1]
- %tmp7 = sub i128 0, %tmp6 ; <i128> [#uses=1]
- store i128 %tmp7, i128* %tmp, align 16
- br label %bb11
-bb8: ; preds = %entry
- %tmp9 = load float* %a_addr, align 4 ; <float> [#uses=1]
- %tmp10 = call i128 @__fixunssfDI( float %tmp9 ) nounwind ; <i128> [#uses=1]
- store i128 %tmp10, i128* %tmp, align 16
- br label %bb11
-bb11: ; preds = %bb8, %bb
- %tmp12 = load i128* %tmp, align 16 ; <i128> [#uses=1]
- store i128 %tmp12, i128* %retval, align 16
- br label %return
-return: ; preds = %bb11
- %retval13 = load i128* %retval ; <i128> [#uses=1]
- ret i128 %retval13
-}
-
-declare i128 @__fixunssfDI(float)
diff --git a/release_23/test/CodeGen/PowerPC/rlwimi-commute.ll b/release_23/test/CodeGen/PowerPC/rlwimi-commute.ll
deleted file mode 100644
index f8a42b514203..000000000000
--- a/release_23/test/CodeGen/PowerPC/rlwimi-commute.ll
+++ /dev/null
@@ -1,34 +0,0 @@
-; RUN: llvm-as < %s | llc -march=ppc32 | grep rlwimi
-; RUN: llvm-as < %s | llc -march=ppc32 | not grep {or }
-
-; Make sure there is no register-register copies here.
-
-define void @test1(i32* %A, i32* %B, i32* %D, i32* %E) {
- %A.upgrd.1 = load i32* %A ; <i32> [#uses=2]
- %B.upgrd.2 = load i32* %B ; <i32> [#uses=1]
- %X = and i32 %A.upgrd.1, 15 ; <i32> [#uses=1]
- %Y = and i32 %B.upgrd.2, -16 ; <i32> [#uses=1]
- %Z = or i32 %X, %Y ; <i32> [#uses=1]
- store i32 %Z, i32* %D
- store i32 %A.upgrd.1, i32* %E
- ret void
-}
-
-define void @test2(i32* %A, i32* %B, i32* %D, i32* %E) {
- %A.upgrd.3 = load i32* %A ; <i32> [#uses=1]
- %B.upgrd.4 = load i32* %B ; <i32> [#uses=2]
- %X = and i32 %A.upgrd.3, 15 ; <i32> [#uses=1]
- %Y = and i32 %B.upgrd.4, -16 ; <i32> [#uses=1]
- %Z = or i32 %X, %Y ; <i32> [#uses=1]
- store i32 %Z, i32* %D
- store i32 %B.upgrd.4, i32* %E
- ret void
-}
-
-define i32 @test3(i32 %a, i32 %b) {
- %tmp.1 = and i32 %a, 15 ; <i32> [#uses=1]
- %tmp.3 = and i32 %b, 240 ; <i32> [#uses=1]
- %tmp.4 = or i32 %tmp.3, %tmp.1 ; <i32> [#uses=1]
- ret i32 %tmp.4
-}
-
diff --git a/release_23/test/CodeGen/PowerPC/rlwimi.ll b/release_23/test/CodeGen/PowerPC/rlwimi.ll
deleted file mode 100644
index 5e310bb6a6ef..000000000000
--- a/release_23/test/CodeGen/PowerPC/rlwimi.ll
+++ /dev/null
@@ -1,70 +0,0 @@
-; All of these ands and shifts should be folded into rlwimi's
-; RUN: llvm-as < %s | llc -march=ppc32 | not grep and
-; RUN: llvm-as < %s | llc -march=ppc32 | grep rlwimi | count 8
-
-define i32 @test1(i32 %x, i32 %y) {
-entry:
- %tmp.3 = shl i32 %x, 16 ; <i32> [#uses=1]
- %tmp.7 = and i32 %y, 65535 ; <i32> [#uses=1]
- %tmp.9 = or i32 %tmp.7, %tmp.3 ; <i32> [#uses=1]
- ret i32 %tmp.9
-}
-
-define i32 @test2(i32 %x, i32 %y) {
-entry:
- %tmp.7 = and i32 %x, 65535 ; <i32> [#uses=1]
- %tmp.3 = shl i32 %y, 16 ; <i32> [#uses=1]
- %tmp.9 = or i32 %tmp.7, %tmp.3 ; <i32> [#uses=1]
- ret i32 %tmp.9
-}
-
-define i32 @test3(i32 %x, i32 %y) {
-entry:
- %tmp.3 = lshr i32 %x, 16 ; <i32> [#uses=1]
- %tmp.6 = and i32 %y, -65536 ; <i32> [#uses=1]
- %tmp.7 = or i32 %tmp.6, %tmp.3 ; <i32> [#uses=1]
- ret i32 %tmp.7
-}
-
-define i32 @test4(i32 %x, i32 %y) {
-entry:
- %tmp.6 = and i32 %x, -65536 ; <i32> [#uses=1]
- %tmp.3 = lshr i32 %y, 16 ; <i32> [#uses=1]
- %tmp.7 = or i32 %tmp.6, %tmp.3 ; <i32> [#uses=1]
- ret i32 %tmp.7
-}
-
-define i32 @test5(i32 %x, i32 %y) {
-entry:
- %tmp.3 = shl i32 %x, 1 ; <i32> [#uses=1]
- %tmp.4 = and i32 %tmp.3, -65536 ; <i32> [#uses=1]
- %tmp.7 = and i32 %y, 65535 ; <i32> [#uses=1]
- %tmp.9 = or i32 %tmp.4, %tmp.7 ; <i32> [#uses=1]
- ret i32 %tmp.9
-}
-
-define i32 @test6(i32 %x, i32 %y) {
-entry:
- %tmp.7 = and i32 %x, 65535 ; <i32> [#uses=1]
- %tmp.3 = shl i32 %y, 1 ; <i32> [#uses=1]
- %tmp.4 = and i32 %tmp.3, -65536 ; <i32> [#uses=1]
- %tmp.9 = or i32 %tmp.4, %tmp.7 ; <i32> [#uses=1]
- ret i32 %tmp.9
-}
-
-define i32 @test7(i32 %x, i32 %y) {
-entry:
- %tmp.2 = and i32 %x, -65536 ; <i32> [#uses=1]
- %tmp.5 = and i32 %y, 65535 ; <i32> [#uses=1]
- %tmp.7 = or i32 %tmp.5, %tmp.2 ; <i32> [#uses=1]
- ret i32 %tmp.7
-}
-
-define i32 @test8(i32 %bar) {
-entry:
- %tmp.3 = shl i32 %bar, 1 ; <i32> [#uses=1]
- %tmp.4 = and i32 %tmp.3, 2 ; <i32> [#uses=1]
- %tmp.6 = and i32 %bar, -3 ; <i32> [#uses=1]
- %tmp.7 = or i32 %tmp.4, %tmp.6 ; <i32> [#uses=1]
- ret i32 %tmp.7
-}
diff --git a/release_23/test/CodeGen/PowerPC/rlwimi2.ll b/release_23/test/CodeGen/PowerPC/rlwimi2.ll
deleted file mode 100644
index 33eaacf8b4fa..000000000000
--- a/release_23/test/CodeGen/PowerPC/rlwimi2.ll
+++ /dev/null
@@ -1,29 +0,0 @@
-; All of these ands and shifts should be folded into rlwimi's
-; RUN: llvm-as < %s | llc -march=ppc32 -o %t -f
-; RUN: grep rlwimi %t | count 3
-; RUN: grep srwi %t | count 1
-; RUN: not grep slwi %t
-
-define i16 @test1(i32 %srcA, i32 %srcB, i32 %alpha) {
-entry:
- %tmp.1 = shl i32 %srcA, 15 ; <i32> [#uses=1]
- %tmp.4 = and i32 %tmp.1, 32505856 ; <i32> [#uses=1]
- %tmp.6 = and i32 %srcA, 31775 ; <i32> [#uses=1]
- %tmp.7 = or i32 %tmp.4, %tmp.6 ; <i32> [#uses=1]
- %tmp.9 = shl i32 %srcB, 15 ; <i32> [#uses=1]
- %tmp.12 = and i32 %tmp.9, 32505856 ; <i32> [#uses=1]
- %tmp.14 = and i32 %srcB, 31775 ; <i32> [#uses=1]
- %tmp.15 = or i32 %tmp.12, %tmp.14 ; <i32> [#uses=1]
- %tmp.18 = mul i32 %tmp.7, %alpha ; <i32> [#uses=1]
- %tmp.20 = sub i32 32, %alpha ; <i32> [#uses=1]
- %tmp.22 = mul i32 %tmp.15, %tmp.20 ; <i32> [#uses=1]
- %tmp.23 = add i32 %tmp.22, %tmp.18 ; <i32> [#uses=2]
- %tmp.27 = lshr i32 %tmp.23, 5 ; <i32> [#uses=1]
- %tmp.28 = trunc i32 %tmp.27 to i16 ; <i16> [#uses=1]
- %tmp.29 = and i16 %tmp.28, 31775 ; <i16> [#uses=1]
- %tmp.33 = lshr i32 %tmp.23, 20 ; <i32> [#uses=1]
- %tmp.34 = trunc i32 %tmp.33 to i16 ; <i16> [#uses=1]
- %tmp.35 = and i16 %tmp.34, 992 ; <i16> [#uses=1]
- %tmp.36 = or i16 %tmp.29, %tmp.35 ; <i16> [#uses=1]
- ret i16 %tmp.36
-}
diff --git a/release_23/test/CodeGen/PowerPC/rlwimi3.ll b/release_23/test/CodeGen/PowerPC/rlwimi3.ll
deleted file mode 100644
index fedcfbfdb2c5..000000000000
--- a/release_23/test/CodeGen/PowerPC/rlwimi3.ll
+++ /dev/null
@@ -1,25 +0,0 @@
-; RUN: llvm-as < %s | llc -march=ppc32 -stats |& \
-; RUN: grep {Number of machine instrs printed} | grep 12
-
-define i16 @Trans16Bit(i32 %srcA, i32 %srcB, i32 %alpha) {
- %tmp1 = shl i32 %srcA, 15 ; <i32> [#uses=1]
- %tmp2 = and i32 %tmp1, 32505856 ; <i32> [#uses=1]
- %tmp4 = and i32 %srcA, 31775 ; <i32> [#uses=1]
- %tmp5 = or i32 %tmp2, %tmp4 ; <i32> [#uses=1]
- %tmp7 = shl i32 %srcB, 15 ; <i32> [#uses=1]
- %tmp8 = and i32 %tmp7, 32505856 ; <i32> [#uses=1]
- %tmp10 = and i32 %srcB, 31775 ; <i32> [#uses=1]
- %tmp11 = or i32 %tmp8, %tmp10 ; <i32> [#uses=1]
- %tmp14 = mul i32 %tmp5, %alpha ; <i32> [#uses=1]
- %tmp16 = sub i32 32, %alpha ; <i32> [#uses=1]
- %tmp18 = mul i32 %tmp11, %tmp16 ; <i32> [#uses=1]
- %tmp19 = add i32 %tmp18, %tmp14 ; <i32> [#uses=2]
- %tmp21 = lshr i32 %tmp19, 5 ; <i32> [#uses=1]
- %tmp21.upgrd.1 = trunc i32 %tmp21 to i16 ; <i16> [#uses=1]
- %tmp = and i16 %tmp21.upgrd.1, 31775 ; <i16> [#uses=1]
- %tmp23 = lshr i32 %tmp19, 20 ; <i32> [#uses=1]
- %tmp23.upgrd.2 = trunc i32 %tmp23 to i16 ; <i16> [#uses=1]
- %tmp24 = and i16 %tmp23.upgrd.2, 992 ; <i16> [#uses=1]
- %tmp25 = or i16 %tmp, %tmp24 ; <i16> [#uses=1]
- ret i16 %tmp25
-}
diff --git a/release_23/test/CodeGen/PowerPC/rlwinm.ll b/release_23/test/CodeGen/PowerPC/rlwinm.ll
deleted file mode 100644
index 9d34865be5a2..000000000000
--- a/release_23/test/CodeGen/PowerPC/rlwinm.ll
+++ /dev/null
@@ -1,61 +0,0 @@
-; All of these ands and shifts should be folded into rlwimi's
-; RUN: llvm-as < %s | llc -march=ppc32 -o %t -f
-; RUN: not grep and %t
-; RUN: not grep srawi %t
-; RUN: not grep srwi %t
-; RUN: not grep slwi %t
-; RUN: grep rlwinm %t | count 8
-
-define i32 @test1(i32 %a) {
-entry:
- %tmp.1 = and i32 %a, 268431360 ; <i32> [#uses=1]
- ret i32 %tmp.1
-}
-
-define i32 @test2(i32 %a) {
-entry:
- %tmp.1 = and i32 %a, -268435441 ; <i32> [#uses=1]
- ret i32 %tmp.1
-}
-
-define i32 @test3(i32 %a) {
-entry:
- %tmp.2 = ashr i32 %a, 8 ; <i32> [#uses=1]
- %tmp.3 = and i32 %tmp.2, 255 ; <i32> [#uses=1]
- ret i32 %tmp.3
-}
-
-define i32 @test4(i32 %a) {
-entry:
- %tmp.3 = lshr i32 %a, 8 ; <i32> [#uses=1]
- %tmp.4 = and i32 %tmp.3, 255 ; <i32> [#uses=1]
- ret i32 %tmp.4
-}
-
-define i32 @test5(i32 %a) {
-entry:
- %tmp.2 = shl i32 %a, 8 ; <i32> [#uses=1]
- %tmp.3 = and i32 %tmp.2, -8388608 ; <i32> [#uses=1]
- ret i32 %tmp.3
-}
-
-define i32 @test6(i32 %a) {
-entry:
- %tmp.1 = and i32 %a, 65280 ; <i32> [#uses=1]
- %tmp.2 = ashr i32 %tmp.1, 8 ; <i32> [#uses=1]
- ret i32 %tmp.2
-}
-
-define i32 @test7(i32 %a) {
-entry:
- %tmp.1 = and i32 %a, 65280 ; <i32> [#uses=1]
- %tmp.2 = lshr i32 %tmp.1, 8 ; <i32> [#uses=1]
- ret i32 %tmp.2
-}
-
-define i32 @test8(i32 %a) {
-entry:
- %tmp.1 = and i32 %a, 16711680 ; <i32> [#uses=1]
- %tmp.2 = shl i32 %tmp.1, 8 ; <i32> [#uses=1]
- ret i32 %tmp.2
-}
diff --git a/release_23/test/CodeGen/PowerPC/rlwinm2.ll b/release_23/test/CodeGen/PowerPC/rlwinm2.ll
deleted file mode 100644
index 06ceaa2a9cdc..000000000000
--- a/release_23/test/CodeGen/PowerPC/rlwinm2.ll
+++ /dev/null
@@ -1,28 +0,0 @@
-; All of these ands and shifts should be folded into rlw[i]nm instructions
-; RUN: llvm-as < %s | llc -march=ppc32 -o %t -f
-; RUN: not grep and %t
-; RUN: not grep srawi %t
-; RUN: not grep srwi %t
-; RUN: not grep slwi %t
-; RUN: grep rlwnm %t | count 1
-; RUN: grep rlwinm %t | count 1
-
-define i32 @test1(i32 %X, i32 %Y) {
-entry:
- %tmp = trunc i32 %Y to i8 ; <i8> [#uses=2]
- %tmp1 = shl i32 %X, %Y ; <i32> [#uses=1]
- %tmp2 = sub i32 32, %Y ; <i8> [#uses=1]
- %tmp3 = lshr i32 %X, %tmp2 ; <i32> [#uses=1]
- %tmp4 = or i32 %tmp1, %tmp3 ; <i32> [#uses=1]
- %tmp6 = and i32 %tmp4, 127 ; <i32> [#uses=1]
- ret i32 %tmp6
-}
-
-define i32 @test2(i32 %X) {
-entry:
- %tmp1 = lshr i32 %X, 27 ; <i32> [#uses=1]
- %tmp2 = shl i32 %X, 5 ; <i32> [#uses=1]
- %tmp2.masked = and i32 %tmp2, 96 ; <i32> [#uses=1]
- %tmp5 = or i32 %tmp1, %tmp2.masked ; <i32> [#uses=1]
- ret i32 %tmp5
-}
diff --git a/release_23/test/CodeGen/PowerPC/rotl-2.ll b/release_23/test/CodeGen/PowerPC/rotl-2.ll
deleted file mode 100644
index df104599fe3e..000000000000
--- a/release_23/test/CodeGen/PowerPC/rotl-2.ll
+++ /dev/null
@@ -1,38 +0,0 @@
-; RUN: llvm-as < %s | llc -march=ppc32 | grep rlwinm | count 4
-; RUN: llvm-as < %s | llc -march=ppc32 | grep rlwnm | count 2
-; RUN: llvm-as < %s | llc -march=ppc32 | not grep or
-
-define i32 @rotl32(i32 %A, i8 %Amt) nounwind {
- %shift.upgrd.1 = zext i8 %Amt to i32 ; <i32> [#uses=1]
- %B = shl i32 %A, %shift.upgrd.1 ; <i32> [#uses=1]
- %Amt2 = sub i8 32, %Amt ; <i8> [#uses=1]
- %shift.upgrd.2 = zext i8 %Amt2 to i32 ; <i32> [#uses=1]
- %C = lshr i32 %A, %shift.upgrd.2 ; <i32> [#uses=1]
- %D = or i32 %B, %C ; <i32> [#uses=1]
- ret i32 %D
-}
-
-define i32 @rotr32(i32 %A, i8 %Amt) nounwind {
- %shift.upgrd.3 = zext i8 %Amt to i32 ; <i32> [#uses=1]
- %B = lshr i32 %A, %shift.upgrd.3 ; <i32> [#uses=1]
- %Amt2 = sub i8 32, %Amt ; <i8> [#uses=1]
- %shift.upgrd.4 = zext i8 %Amt2 to i32 ; <i32> [#uses=1]
- %C = shl i32 %A, %shift.upgrd.4 ; <i32> [#uses=1]
- %D = or i32 %B, %C ; <i32> [#uses=1]
- ret i32 %D
-}
-
-define i32 @rotli32(i32 %A) nounwind {
- %B = shl i32 %A, 5 ; <i32> [#uses=1]
- %C = lshr i32 %A, 27 ; <i32> [#uses=1]
- %D = or i32 %B, %C ; <i32> [#uses=1]
- ret i32 %D
-}
-
-define i32 @rotri32(i32 %A) nounwind {
- %B = lshr i32 %A, 5 ; <i32> [#uses=1]
- %C = shl i32 %A, 27 ; <i32> [#uses=1]
- %D = or i32 %B, %C ; <i32> [#uses=1]
- ret i32 %D
-}
-
diff --git a/release_23/test/CodeGen/PowerPC/rotl-64.ll b/release_23/test/CodeGen/PowerPC/rotl-64.ll
deleted file mode 100644
index 3963d9a9d71a..000000000000
--- a/release_23/test/CodeGen/PowerPC/rotl-64.ll
+++ /dev/null
@@ -1,20 +0,0 @@
-; RUN: llvm-as < %s | llc -march=ppc64 | grep rldicl
-; RUN: llvm-as < %s | llc -march=ppc64 | grep rldcl
-; PR1613
-
-define i64 @t1(i64 %A) {
- %tmp1 = lshr i64 %A, 57
- %tmp2 = shl i64 %A, 7
- %tmp3 = or i64 %tmp1, %tmp2
- ret i64 %tmp3
-}
-
-define i64 @t2(i64 %A, i8 zeroext %Amt) {
- %Amt1 = zext i8 %Amt to i64
- %tmp1 = lshr i64 %A, %Amt1
- %Amt2 = sub i8 64, %Amt
- %Amt3 = zext i8 %Amt2 to i64
- %tmp2 = shl i64 %A, %Amt3
- %tmp3 = or i64 %tmp1, %tmp2
- ret i64 %tmp3
-}
diff --git a/release_23/test/CodeGen/PowerPC/rotl.ll b/release_23/test/CodeGen/PowerPC/rotl.ll
deleted file mode 100644
index aab5c8316a3d..000000000000
--- a/release_23/test/CodeGen/PowerPC/rotl.ll
+++ /dev/null
@@ -1,37 +0,0 @@
-; RUN: llvm-as < %s | llc -march=ppc32 | grep rlwnm | count 2
-; RUN: llvm-as < %s | llc -march=ppc32 | grep rlwinm | count 2
-
-define i32 @rotlw(i32 %x, i32 %sh) {
-entry:
- %tmp.7 = sub i32 32, %sh ; <i32> [#uses=1]
- %tmp.10 = lshr i32 %x, %tmp.7 ; <i32> [#uses=2]
- %tmp.4 = shl i32 %x, %sh ; <i32> [#uses=1]
- %tmp.12 = or i32 %tmp.10, %tmp.4 ; <i32> [#uses=1]
- ret i32 %tmp.12
-}
-
-define i32 @rotrw(i32 %x, i32 %sh) {
-entry:
- %tmp.3 = trunc i32 %sh to i8 ; <i8> [#uses=1]
- %tmp.4 = lshr i32 %x, %sh ; <i32> [#uses=2]
- %tmp.7 = sub i32 32, %sh ; <i32> [#uses=1]
- %tmp.10 = shl i32 %x, %tmp.7 ; <i32> [#uses=1]
- %tmp.12 = or i32 %tmp.4, %tmp.10 ; <i32> [#uses=1]
- ret i32 %tmp.12
-}
-
-define i32 @rotlwi(i32 %x) {
-entry:
- %tmp.7 = lshr i32 %x, 27 ; <i32> [#uses=2]
- %tmp.3 = shl i32 %x, 5 ; <i32> [#uses=1]
- %tmp.9 = or i32 %tmp.3, %tmp.7 ; <i32> [#uses=1]
- ret i32 %tmp.9
-}
-
-define i32 @rotrwi(i32 %x) {
-entry:
- %tmp.3 = lshr i32 %x, 5 ; <i32> [#uses=2]
- %tmp.7 = shl i32 %x, 27 ; <i32> [#uses=1]
- %tmp.9 = or i32 %tmp.3, %tmp.7 ; <i32> [#uses=1]
- ret i32 %tmp.9
-}
diff --git a/release_23/test/CodeGen/PowerPC/select_lt0.ll b/release_23/test/CodeGen/PowerPC/select_lt0.ll
deleted file mode 100644
index 86eb201c5796..000000000000
--- a/release_23/test/CodeGen/PowerPC/select_lt0.ll
+++ /dev/null
@@ -1,50 +0,0 @@
-; RUN: llvm-as < %s | llc -march=ppc32 | not grep cmp
-
-define i32 @seli32_1(i32 %a) {
-entry:
- %tmp.1 = icmp slt i32 %a, 0 ; <i1> [#uses=1]
- %retval = select i1 %tmp.1, i32 5, i32 0 ; <i32> [#uses=1]
- ret i32 %retval
-}
-
-define i32 @seli32_2(i32 %a, i32 %b) {
-entry:
- %tmp.1 = icmp slt i32 %a, 0 ; <i1> [#uses=1]
- %retval = select i1 %tmp.1, i32 %b, i32 0 ; <i32> [#uses=1]
- ret i32 %retval
-}
-
-define i32 @seli32_3(i32 %a, i16 %b) {
-entry:
- %tmp.2 = sext i16 %b to i32 ; <i32> [#uses=1]
- %tmp.1 = icmp slt i32 %a, 0 ; <i1> [#uses=1]
- %retval = select i1 %tmp.1, i32 %tmp.2, i32 0 ; <i32> [#uses=1]
- ret i32 %retval
-}
-
-define i32 @seli32_4(i32 %a, i16 %b) {
-entry:
- %tmp.2 = zext i16 %b to i32 ; <i32> [#uses=1]
- %tmp.1 = icmp slt i32 %a, 0 ; <i1> [#uses=1]
- %retval = select i1 %tmp.1, i32 %tmp.2, i32 0 ; <i32> [#uses=1]
- ret i32 %retval
-}
-
-define i16 @seli16_1(i16 %a) {
-entry:
- %tmp.1 = icmp slt i16 %a, 0 ; <i1> [#uses=1]
- %retval = select i1 %tmp.1, i16 7, i16 0 ; <i16> [#uses=1]
- ret i16 %retval
-}
-
-define i16 @seli16_2(i32 %a, i16 %b) {
- %tmp.1 = icmp slt i32 %a, 0 ; <i1> [#uses=1]
- %retval = select i1 %tmp.1, i16 %b, i16 0 ; <i16> [#uses=1]
- ret i16 %retval
-}
-
-define i32 @seli32_a_a(i32 %a) {
- %tmp = icmp slt i32 %a, 1 ; <i1> [#uses=1]
- %min = select i1 %tmp, i32 %a, i32 0 ; <i32> [#uses=1]
- ret i32 %min
-}
diff --git a/release_23/test/CodeGen/PowerPC/setcc_no_zext.ll b/release_23/test/CodeGen/PowerPC/setcc_no_zext.ll
deleted file mode 100644
index c31f35ce9af3..000000000000
--- a/release_23/test/CodeGen/PowerPC/setcc_no_zext.ll
+++ /dev/null
@@ -1,9 +0,0 @@
-; RUN: llvm-as < %s | llc -march=ppc32 | not grep rlwinm
-
-define i32 @setcc_one_or_zero(i32* %a) {
-entry:
- %tmp.1 = icmp ne i32* %a, null ; <i1> [#uses=1]
- %inc.1 = zext i1 %tmp.1 to i32 ; <i32> [#uses=1]
- ret i32 %inc.1
-}
-
diff --git a/release_23/test/CodeGen/PowerPC/seteq-0.ll b/release_23/test/CodeGen/PowerPC/seteq-0.ll
deleted file mode 100644
index 0f0afe9e665a..000000000000
--- a/release_23/test/CodeGen/PowerPC/seteq-0.ll
+++ /dev/null
@@ -1,10 +0,0 @@
-; RUN: llvm-as < %s | \
-; RUN: llc -march=ppc32 -mtriple=powerpc-apple-darwin8 | \
-; RUN: grep {srwi r., r., 5}
-
-define i32 @eq0(i32 %a) {
- %tmp.1 = icmp eq i32 %a, 0 ; <i1> [#uses=1]
- %tmp.2 = zext i1 %tmp.1 to i32 ; <i32> [#uses=1]
- ret i32 %tmp.2
-}
-
diff --git a/release_23/test/CodeGen/PowerPC/shift128.ll b/release_23/test/CodeGen/PowerPC/shift128.ll
deleted file mode 100644
index cf5b3fc6ff0c..000000000000
--- a/release_23/test/CodeGen/PowerPC/shift128.ll
+++ /dev/null
@@ -1,14 +0,0 @@
-; RUN: llvm-as < %s | llc -march=ppc64 | grep sld | count 5
-
-define i128 @foo_lshr(i128 %x, i128 %y) {
- %r = lshr i128 %x, %y
- ret i128 %r
-}
-define i128 @foo_ashr(i128 %x, i128 %y) {
- %r = ashr i128 %x, %y
- ret i128 %r
-}
-define i128 @foo_shl(i128 %x, i128 %y) {
- %r = shl i128 %x, %y
- ret i128 %r
-}
diff --git a/release_23/test/CodeGen/PowerPC/shl_elim.ll b/release_23/test/CodeGen/PowerPC/shl_elim.ll
deleted file mode 100644
index 3dc47729860b..000000000000
--- a/release_23/test/CodeGen/PowerPC/shl_elim.ll
+++ /dev/null
@@ -1,11 +0,0 @@
-; RUN: llvm-as < %s | llc -march=ppc32 | not grep slwi
-
-define i32 @test1(i64 %a) {
- %tmp29 = lshr i64 %a, 24 ; <i64> [#uses=1]
- %tmp23 = trunc i64 %tmp29 to i32 ; <i32> [#uses=1]
- %tmp410 = lshr i32 %tmp23, 9 ; <i32> [#uses=1]
- %tmp45 = trunc i32 %tmp410 to i16 ; <i16> [#uses=1]
- %tmp456 = sext i16 %tmp45 to i32 ; <i32> [#uses=1]
- ret i32 %tmp456
-}
-
diff --git a/release_23/test/CodeGen/PowerPC/shl_sext.ll b/release_23/test/CodeGen/PowerPC/shl_sext.ll
deleted file mode 100644
index 61e5cdb11a42..000000000000
--- a/release_23/test/CodeGen/PowerPC/shl_sext.ll
+++ /dev/null
@@ -1,18 +0,0 @@
-; This test should not contain a sign extend
-; RUN: llvm-as < %s | llc -march=ppc32 | not grep extsb
-
-define i32 @test(i32 %mode.0.i.0) {
- %tmp.79 = trunc i32 %mode.0.i.0 to i8 ; <i8> [#uses=1]
- %tmp.80 = sext i8 %tmp.79 to i32 ; <i32> [#uses=1]
- %tmp.81 = shl i32 %tmp.80, 24 ; <i32> [#uses=1]
- ret i32 %tmp.81
-}
-
-define i32 @test2(i32 %mode.0.i.0) {
- %tmp.79 = trunc i32 %mode.0.i.0 to i8 ; <i8> [#uses=1]
- %tmp.80 = sext i8 %tmp.79 to i32 ; <i32> [#uses=1]
- %tmp.81 = shl i32 %tmp.80, 16 ; <i32> [#uses=1]
- %tmp.82 = and i32 %tmp.81, 16711680 ; <i32> [#uses=1]
- ret i32 %tmp.82
-}
-
diff --git a/release_23/test/CodeGen/PowerPC/sign_ext_inreg1.ll b/release_23/test/CodeGen/PowerPC/sign_ext_inreg1.ll
deleted file mode 100644
index 0e67f7703882..000000000000
--- a/release_23/test/CodeGen/PowerPC/sign_ext_inreg1.ll
+++ /dev/null
@@ -1,12 +0,0 @@
-; RUN: llvm-as < %s | llc -march=ppc32 | grep srwi
-; RUN: llvm-as < %s | llc -march=ppc32 | not grep rlwimi
-
-define i32 @baz(i64 %a) {
- %tmp29 = lshr i64 %a, 24 ; <i64> [#uses=1]
- %tmp23 = trunc i64 %tmp29 to i32 ; <i32> [#uses=1]
- %tmp410 = lshr i32 %tmp23, 9 ; <i32> [#uses=1]
- %tmp45 = trunc i32 %tmp410 to i16 ; <i16> [#uses=1]
- %tmp456 = sext i16 %tmp45 to i32 ; <i32> [#uses=1]
- ret i32 %tmp456
-}
-
diff --git a/release_23/test/CodeGen/PowerPC/small-arguments.ll b/release_23/test/CodeGen/PowerPC/small-arguments.ll
deleted file mode 100644
index e211e86875a2..000000000000
--- a/release_23/test/CodeGen/PowerPC/small-arguments.ll
+++ /dev/null
@@ -1,52 +0,0 @@
-; RUN: llvm-as < %s | llc -march=ppc32 | not grep {extsh\\|rlwinm}
-
-declare i16 @foo() signext
-
-define i32 @test1(i16 signext %X) {
- %Y = sext i16 %X to i32 ;; dead
- ret i32 %Y
-}
-
-define i32 @test2(i16 zeroext %X) {
- %Y = sext i16 %X to i32
- %Z = and i32 %Y, 65535 ;; dead
- ret i32 %Z
-}
-
-define void @test3() {
- %tmp.0 = call i16 @foo() signext ;; no extsh!
- %tmp.1 = icmp slt i16 %tmp.0, 1234
- br i1 %tmp.1, label %then, label %UnifiedReturnBlock
-
-then:
- call i32 @test1(i16 0 signext)
- ret void
-UnifiedReturnBlock:
- ret void
-}
-
-define i32 @test4(i16* %P) {
- %tmp.1 = load i16* %P
- %tmp.2 = zext i16 %tmp.1 to i32
- %tmp.3 = and i32 %tmp.2, 255
- ret i32 %tmp.3
-}
-
-define i32 @test5(i16* %P) {
- %tmp.1 = load i16* %P
- %tmp.2 = bitcast i16 %tmp.1 to i16
- %tmp.3 = zext i16 %tmp.2 to i32
- %tmp.4 = and i32 %tmp.3, 255
- ret i32 %tmp.4
-}
-
-define i32 @test6(i32* %P) {
- %tmp.1 = load i32* %P
- %tmp.2 = and i32 %tmp.1, 255
- ret i32 %tmp.2
-}
-
-define i16 @test7(float %a) zeroext {
- %tmp.1 = fptoui float %a to i16
- ret i16 %tmp.1
-}
diff --git a/release_23/test/CodeGen/PowerPC/stfiwx-2.ll b/release_23/test/CodeGen/PowerPC/stfiwx-2.ll
deleted file mode 100644
index 5c4a834be445..000000000000
--- a/release_23/test/CodeGen/PowerPC/stfiwx-2.ll
+++ /dev/null
@@ -1,11 +0,0 @@
-; This cannot be a stfiwx
-; RUN: llvm-as < %s | llc -march=ppc32 -mcpu=g5 | grep stb
-; RUN: llvm-as < %s | llc -march=ppc32 -mcpu=g5 | not grep stfiwx
-
-define void @test(float %F, i8* %P) {
- %I = fptosi float %F to i32
- %X = trunc i32 %I to i8
- store i8 %X, i8* %P
- ret void
-}
-
diff --git a/release_23/test/CodeGen/PowerPC/stfiwx.ll b/release_23/test/CodeGen/PowerPC/stfiwx.ll
deleted file mode 100644
index c4afb63531b1..000000000000
--- a/release_23/test/CodeGen/PowerPC/stfiwx.ll
+++ /dev/null
@@ -1,26 +0,0 @@
-; RUN: llvm-as < %s | \
-; RUN: llc -march=ppc32 -mtriple=powerpc-apple-darwin8 -mattr=stfiwx -o %t1 -f
-; RUN: grep stfiwx %t1
-; RUN: not grep r1 %t1
-; RUN: llvm-as < %s | \
-; RUN: llc -march=ppc32 -mtriple=powerpc-apple-darwin8 -mattr=-stfiwx \
-; RUN: -o %t2 -f
-; RUN: not grep stfiwx %t2
-; RUN: grep r1 %t2
-
-define void @test(float %a, i32* %b) {
- %tmp.2 = fptosi float %a to i32 ; <i32> [#uses=1]
- store i32 %tmp.2, i32* %b
- ret void
-}
-
-define void @test2(float %a, i32* %b, i32 %i) {
- %tmp.2 = getelementptr i32* %b, i32 1 ; <i32*> [#uses=1]
- %tmp.5 = getelementptr i32* %b, i32 %i ; <i32*> [#uses=1]
- %tmp.7 = fptosi float %a to i32 ; <i32> [#uses=3]
- store i32 %tmp.7, i32* %tmp.5
- store i32 %tmp.7, i32* %tmp.2
- store i32 %tmp.7, i32* %b
- ret void
-}
-
diff --git a/release_23/test/CodeGen/PowerPC/store-load-fwd.ll b/release_23/test/CodeGen/PowerPC/store-load-fwd.ll
deleted file mode 100644
index 5cc478448ff7..000000000000
--- a/release_23/test/CodeGen/PowerPC/store-load-fwd.ll
+++ /dev/null
@@ -1,8 +0,0 @@
-; RUN: llvm-as < %s | llc -march=ppc32 | not grep lwz
-
-define i32 @test(i32* %P) {
- store i32 1, i32* %P
- %V = load i32* %P ; <i32> [#uses=1]
- ret i32 %V
-}
-
diff --git a/release_23/test/CodeGen/PowerPC/subc.ll b/release_23/test/CodeGen/PowerPC/subc.ll
deleted file mode 100644
index 4ac95961f079..000000000000
--- a/release_23/test/CodeGen/PowerPC/subc.ll
+++ /dev/null
@@ -1,25 +0,0 @@
-; All of these should be codegen'd without loading immediates
-; RUN: llvm-as < %s | llc -march=ppc32 -o %t -f
-; RUN: grep subfc %t | count 1
-; RUN: grep subfe %t | count 1
-; RUN: grep subfze %t | count 1
-; RUN: grep subfme %t | count 1
-; RUN: grep subfic %t | count 2
-
-define i64 @sub_ll(i64 %a, i64 %b) {
-entry:
- %tmp.2 = sub i64 %a, %b ; <i64> [#uses=1]
- ret i64 %tmp.2
-}
-
-define i64 @sub_l_5(i64 %a) {
-entry:
- %tmp.1 = sub i64 5, %a ; <i64> [#uses=1]
- ret i64 %tmp.1
-}
-
-define i64 @sub_l_m5(i64 %a) {
-entry:
- %tmp.1 = sub i64 -5, %a ; <i64> [#uses=1]
- ret i64 %tmp.1
-}
diff --git a/release_23/test/CodeGen/PowerPC/tailcall1-64.ll b/release_23/test/CodeGen/PowerPC/tailcall1-64.ll
deleted file mode 100644
index f39b40bdab81..000000000000
--- a/release_23/test/CodeGen/PowerPC/tailcall1-64.ll
+++ /dev/null
@@ -1,11 +0,0 @@
-; RUN: llvm-as < %s | llc -march=ppc64 -tailcallopt | grep TC_RETURNd8
-define fastcc i32 @tailcallee(i32 %a1, i32 %a2, i32 %a3, i32 %a4) {
-entry:
- ret i32 %a3
-}
-
-define fastcc i32 @tailcaller(i32 %in1, i32 %in2) {
-entry:
- %tmp11 = tail call fastcc i32 @tailcallee( i32 %in1, i32 %in2, i32 %in1, i32 %in2 ) ; <i32> [#uses=1]
- ret i32 %tmp11
-}
diff --git a/release_23/test/CodeGen/PowerPC/tailcall1.ll b/release_23/test/CodeGen/PowerPC/tailcall1.ll
deleted file mode 100644
index 1fc4b94ddcf9..000000000000
--- a/release_23/test/CodeGen/PowerPC/tailcall1.ll
+++ /dev/null
@@ -1,11 +0,0 @@
-; RUN: llvm-as < %s | llc -march=ppc32 -tailcallopt | grep TC_RETURN
-define fastcc i32 @tailcallee(i32 %a1, i32 %a2, i32 %a3, i32 %a4) {
-entry:
- ret i32 %a3
-}
-
-define fastcc i32 @tailcaller(i32 %in1, i32 %in2) {
-entry:
- %tmp11 = tail call fastcc i32 @tailcallee( i32 %in1, i32 %in2, i32 %in1, i32 %in2 ) ; <i32> [#uses=1]
- ret i32 %tmp11
-}
diff --git a/release_23/test/CodeGen/PowerPC/tailcallpic1.ll b/release_23/test/CodeGen/PowerPC/tailcallpic1.ll
deleted file mode 100644
index 678d366fb6a6..000000000000
--- a/release_23/test/CodeGen/PowerPC/tailcallpic1.ll
+++ /dev/null
@@ -1,14 +0,0 @@
-; RUN: llvm-as < %s | llc -tailcallopt -mtriple=powerpc-apple-darwin -relocation-model=pic | grep TC_RETURN
-
-
-
-define protected fastcc i32 @tailcallee(i32 %a1, i32 %a2, i32 %a3, i32 %a4) {
-entry:
- ret i32 %a3
-}
-
-define fastcc i32 @tailcaller(i32 %in1, i32 %in2) {
-entry:
- %tmp11 = tail call fastcc i32 @tailcallee( i32 %in1, i32 %in2, i32 %in1, i32 %in2 ) ; <i32> [#uses=1]
- ret i32 %tmp11
-}
diff --git a/release_23/test/CodeGen/PowerPC/unsafe-math.ll b/release_23/test/CodeGen/PowerPC/unsafe-math.ll
deleted file mode 100644
index 3d52d0c9e7ed..000000000000
--- a/release_23/test/CodeGen/PowerPC/unsafe-math.ll
+++ /dev/null
@@ -1,10 +0,0 @@
-; RUN: llvm-as < %s | llc -march=ppc32 | grep fmul | count 2
-; RUN: llvm-as < %s | llc -march=ppc32 -enable-unsafe-fp-math | \
-; RUN: grep fmul | count 1
-
-define double @foo(double %X) {
- %tmp1 = mul double %X, 1.23
- %tmp2 = mul double %tmp1, 4.124
- ret double %tmp2
-}
-
diff --git a/release_23/test/CodeGen/PowerPC/vcmp-fold.ll b/release_23/test/CodeGen/PowerPC/vcmp-fold.ll
deleted file mode 100644
index 815bb0aedff5..000000000000
--- a/release_23/test/CodeGen/PowerPC/vcmp-fold.ll
+++ /dev/null
@@ -1,22 +0,0 @@
-; This should fold the "vcmpbfp." and "vcmpbfp" instructions into a single
-; "vcmpbfp.".
-; RUN: llvm-as < %s | llc -march=ppc32 -mcpu=g5 | grep vcmpbfp | count 1
-
-
-define void @test(<4 x float>* %x, <4 x float>* %y, i32* %P) {
-entry:
- %tmp = load <4 x float>* %x ; <<4 x float>> [#uses=1]
- %tmp2 = load <4 x float>* %y ; <<4 x float>> [#uses=1]
- %tmp.upgrd.1 = call i32 @llvm.ppc.altivec.vcmpbfp.p( i32 1, <4 x float> %tmp, <4 x float> %tmp2 ) ; <i32> [#uses=1]
- %tmp4 = load <4 x float>* %x ; <<4 x float>> [#uses=1]
- %tmp6 = load <4 x float>* %y ; <<4 x float>> [#uses=1]
- %tmp.upgrd.2 = call <4 x i32> @llvm.ppc.altivec.vcmpbfp( <4 x float> %tmp4, <4 x float> %tmp6 ) ; <<4 x i32>> [#uses=1]
- %tmp7 = bitcast <4 x i32> %tmp.upgrd.2 to <4 x float> ; <<4 x float>> [#uses=1]
- store <4 x float> %tmp7, <4 x float>* %x
- store i32 %tmp.upgrd.1, i32* %P
- ret void
-}
-
-declare i32 @llvm.ppc.altivec.vcmpbfp.p(i32, <4 x float>, <4 x float>)
-
-declare <4 x i32> @llvm.ppc.altivec.vcmpbfp(<4 x float>, <4 x float>)
diff --git a/release_23/test/CodeGen/PowerPC/vec_br_cmp.ll b/release_23/test/CodeGen/PowerPC/vec_br_cmp.ll
deleted file mode 100644
index 6d799676b77b..000000000000
--- a/release_23/test/CodeGen/PowerPC/vec_br_cmp.ll
+++ /dev/null
@@ -1,22 +0,0 @@
-; RUN: llvm-as < %s | llc -march=ppc32 -mcpu=g5 -o %t -f
-; RUN: grep vcmpeqfp. %t
-; RUN: not grep mfcr %t
-
-; A predicate compare used immediately by a branch should not generate an mfcr.
-
-define void @test(<4 x float>* %A, <4 x float>* %B) {
- %tmp = load <4 x float>* %A ; <<4 x float>> [#uses=1]
- %tmp3 = load <4 x float>* %B ; <<4 x float>> [#uses=1]
- %tmp.upgrd.1 = tail call i32 @llvm.ppc.altivec.vcmpeqfp.p( i32 1, <4 x float> %tmp, <4 x float> %tmp3 ) ; <i32> [#uses=1]
- %tmp.upgrd.2 = icmp eq i32 %tmp.upgrd.1, 0 ; <i1> [#uses=1]
- br i1 %tmp.upgrd.2, label %cond_true, label %UnifiedReturnBlock
-
-cond_true: ; preds = %0
- store <4 x float> zeroinitializer, <4 x float>* %B
- ret void
-
-UnifiedReturnBlock: ; preds = %0
- ret void
-}
-
-declare i32 @llvm.ppc.altivec.vcmpeqfp.p(i32, <4 x float>, <4 x float>)
diff --git a/release_23/test/CodeGen/PowerPC/vec_call.ll b/release_23/test/CodeGen/PowerPC/vec_call.ll
deleted file mode 100644
index 8e7a08ebb7d7..000000000000
--- a/release_23/test/CodeGen/PowerPC/vec_call.ll
+++ /dev/null
@@ -1,11 +0,0 @@
-; RUN: llvm-as < %s | llc -march=ppc32 -mcpu=g5
-
-define <4 x i32> @test_arg(<4 x i32> %A, <4 x i32> %B) {
- %C = add <4 x i32> %A, %B ; <<4 x i32>> [#uses=1]
- ret <4 x i32> %C
-}
-
-define <4 x i32> @foo() {
- %X = call <4 x i32> @test_arg( <4 x i32> zeroinitializer, <4 x i32> zeroinitializer ) ; <<4 x i32>> [#uses=1]
- ret <4 x i32> %X
-}
diff --git a/release_23/test/CodeGen/PowerPC/vec_constants.ll b/release_23/test/CodeGen/PowerPC/vec_constants.ll
deleted file mode 100644
index c4b42b9e9b8a..000000000000
--- a/release_23/test/CodeGen/PowerPC/vec_constants.ll
+++ /dev/null
@@ -1,40 +0,0 @@
-; RUN: llvm-as < %s | llc -march=ppc32 -mcpu=g5 | not grep CPI
-
-define void @test1(<4 x i32>* %P1, <4 x i32>* %P2, <4 x float>* %P3) {
- %tmp = load <4 x i32>* %P1 ; <<4 x i32>> [#uses=1]
- %tmp4 = and <4 x i32> %tmp, < i32 -2147483648, i32 -2147483648, i32 -2147483648, i32 -2147483648 > ; <<4 x i32>> [#uses=1]
- store <4 x i32> %tmp4, <4 x i32>* %P1
- %tmp7 = load <4 x i32>* %P2 ; <<4 x i32>> [#uses=1]
- %tmp9 = and <4 x i32> %tmp7, < i32 2147483647, i32 2147483647, i32 2147483647, i32 2147483647 > ; <<4 x i32>> [#uses=1]
- store <4 x i32> %tmp9, <4 x i32>* %P2
- %tmp.upgrd.1 = load <4 x float>* %P3 ; <<4 x float>> [#uses=1]
- %tmp11 = bitcast <4 x float> %tmp.upgrd.1 to <4 x i32> ; <<4 x i32>> [#uses=1]
- %tmp12 = and <4 x i32> %tmp11, < i32 2147483647, i32 2147483647, i32 2147483647, i32 2147483647 > ; <<4 x i32>> [#uses=1]
- %tmp13 = bitcast <4 x i32> %tmp12 to <4 x float> ; <<4 x float>> [#uses=1]
- store <4 x float> %tmp13, <4 x float>* %P3
- ret void
-}
-
-define <4 x i32> @test_30() {
- ret <4 x i32> < i32 30, i32 30, i32 30, i32 30 >
-}
-
-define <4 x i32> @test_29() {
- ret <4 x i32> < i32 29, i32 29, i32 29, i32 29 >
-}
-
-define <8 x i16> @test_n30() {
- ret <8 x i16> < i16 -30, i16 -30, i16 -30, i16 -30, i16 -30, i16 -30, i16 -30, i16 -30 >
-}
-
-define <16 x i8> @test_n104() {
- ret <16 x i8> < i8 -104, i8 -104, i8 -104, i8 -104, i8 -104, i8 -104, i8 -104, i8 -104, i8 -104, i8 -104, i8 -104, i8 -104, i8 -104, i8 -104, i8 -104, i8 -104 >
-}
-
-define <4 x i32> @test_vsldoi() {
- ret <4 x i32> < i32 512, i32 512, i32 512, i32 512 >
-}
-
-define <4 x i32> @test_rol() {
- ret <4 x i32> < i32 -11534337, i32 -11534337, i32 -11534337, i32 -11534337 >
-}
diff --git a/release_23/test/CodeGen/PowerPC/vec_fneg.ll b/release_23/test/CodeGen/PowerPC/vec_fneg.ll
deleted file mode 100644
index 2ef2099ddb97..000000000000
--- a/release_23/test/CodeGen/PowerPC/vec_fneg.ll
+++ /dev/null
@@ -1,8 +0,0 @@
-; RUN: llvm-as < %s | llc -march=ppc32 -mcpu=g5 | grep vsubfp
-
-define void @t(<4 x float>* %A) {
- %tmp2 = load <4 x float>* %A
- %tmp3 = sub <4 x float> < float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00 >, %tmp2
- store <4 x float> %tmp3, <4 x float>* %A
- ret void
-}
diff --git a/release_23/test/CodeGen/PowerPC/vec_insert.ll b/release_23/test/CodeGen/PowerPC/vec_insert.ll
deleted file mode 100644
index 04bbe6574f62..000000000000
--- a/release_23/test/CodeGen/PowerPC/vec_insert.ll
+++ /dev/null
@@ -1,8 +0,0 @@
-; RUN: llvm-as < %s | llc -march=ppc32 -mcpu=g5 | grep sth
-
-define <8 x i16> @insert(<8 x i16> %foo, i16 %a) nounwind {
-entry:
- %vecext = insertelement <8 x i16> %foo, i16 %a, i32 7 ; <i8> [#uses=1]
- ret <8 x i16> %vecext
-}
-
diff --git a/release_23/test/CodeGen/PowerPC/vec_misaligned.ll b/release_23/test/CodeGen/PowerPC/vec_misaligned.ll
deleted file mode 100644
index 15376caebefa..000000000000
--- a/release_23/test/CodeGen/PowerPC/vec_misaligned.ll
+++ /dev/null
@@ -1,37 +0,0 @@
-; RUN: llvm-as < %s | llc -march=ppc32 -mcpu=g5
-
-target datalayout = "E-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f128:64:128"
-target triple = "powerpc-apple-darwin8"
- %struct.S2203 = type { %struct.u16qi }
- %struct.u16qi = type { <16 x i8> }
-@s = weak global %struct.S2203 zeroinitializer ; <%struct.S2203*> [#uses=1]
-
-define void @foo(i32 %x, ...) {
-entry:
- %x_addr = alloca i32 ; <i32*> [#uses=1]
- %ap = alloca i8* ; <i8**> [#uses=3]
- %ap.0 = alloca i8* ; <i8**> [#uses=3]
- %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
- store i32 %x, i32* %x_addr
- %ap1 = bitcast i8** %ap to i8* ; <i8*> [#uses=1]
- call void @llvm.va_start( i8* %ap1 )
- %tmp = load i8** %ap, align 4 ; <i8*> [#uses=1]
- store i8* %tmp, i8** %ap.0, align 4
- %tmp2 = load i8** %ap.0, align 4 ; <i8*> [#uses=1]
- %tmp3 = getelementptr i8* %tmp2, i64 16 ; <i8*> [#uses=1]
- store i8* %tmp3, i8** %ap, align 4
- %tmp4 = load i8** %ap.0, align 4 ; <i8*> [#uses=1]
- %tmp45 = bitcast i8* %tmp4 to %struct.S2203* ; <%struct.S2203*> [#uses=1]
- %tmp6 = getelementptr %struct.S2203* @s, i32 0, i32 0 ; <%struct.u16qi*> [#uses=1]
- %tmp7 = getelementptr %struct.S2203* %tmp45, i32 0, i32 0 ; <%struct.u16qi*> [#uses=1]
- %tmp8 = getelementptr %struct.u16qi* %tmp6, i32 0, i32 0 ; <<16 x i8>*> [#uses=1]
- %tmp9 = getelementptr %struct.u16qi* %tmp7, i32 0, i32 0 ; <<16 x i8>*> [#uses=1]
- %tmp10 = load <16 x i8>* %tmp9, align 4 ; <<16 x i8>> [#uses=1]
- store <16 x i8> %tmp10, <16 x i8>* %tmp8, align 4
- br label %return
-
-return: ; preds = %entry
- ret void
-}
-
-declare void @llvm.va_start(i8*) nounwind
diff --git a/release_23/test/CodeGen/PowerPC/vec_mul.ll b/release_23/test/CodeGen/PowerPC/vec_mul.ll
deleted file mode 100644
index b061fa9a54ee..000000000000
--- a/release_23/test/CodeGen/PowerPC/vec_mul.ll
+++ /dev/null
@@ -1,23 +0,0 @@
-; RUN: llvm-as < %s | llc -march=ppc32 -mcpu=g5 | not grep mullw
-; RUN: llvm-as < %s | llc -march=ppc32 -mcpu=g5 | grep vmsumuhm
-
-define <4 x i32> @test_v4i32(<4 x i32>* %X, <4 x i32>* %Y) {
- %tmp = load <4 x i32>* %X ; <<4 x i32>> [#uses=1]
- %tmp2 = load <4 x i32>* %Y ; <<4 x i32>> [#uses=1]
- %tmp3 = mul <4 x i32> %tmp, %tmp2 ; <<4 x i32>> [#uses=1]
- ret <4 x i32> %tmp3
-}
-
-define <8 x i16> @test_v8i16(<8 x i16>* %X, <8 x i16>* %Y) {
- %tmp = load <8 x i16>* %X ; <<8 x i16>> [#uses=1]
- %tmp2 = load <8 x i16>* %Y ; <<8 x i16>> [#uses=1]
- %tmp3 = mul <8 x i16> %tmp, %tmp2 ; <<8 x i16>> [#uses=1]
- ret <8 x i16> %tmp3
-}
-
-define <16 x i8> @test_v16i8(<16 x i8>* %X, <16 x i8>* %Y) {
- %tmp = load <16 x i8>* %X ; <<16 x i8>> [#uses=1]
- %tmp2 = load <16 x i8>* %Y ; <<16 x i8>> [#uses=1]
- %tmp3 = mul <16 x i8> %tmp, %tmp2 ; <<16 x i8>> [#uses=1]
- ret <16 x i8> %tmp3
-}
diff --git a/release_23/test/CodeGen/PowerPC/vec_perf_shuffle.ll b/release_23/test/CodeGen/PowerPC/vec_perf_shuffle.ll
deleted file mode 100644
index 5bb1b6083417..000000000000
--- a/release_23/test/CodeGen/PowerPC/vec_perf_shuffle.ll
+++ /dev/null
@@ -1,36 +0,0 @@
-; RUN: llvm-as < %s | llc -march=ppc32 -mcpu=g5 | not grep vperm
-
-define <4 x float> @test_uu72(<4 x float>* %P1, <4 x float>* %P2) {
- %V1 = load <4 x float>* %P1 ; <<4 x float>> [#uses=1]
- %V2 = load <4 x float>* %P2 ; <<4 x float>> [#uses=1]
- %V3 = shufflevector <4 x float> %V1, <4 x float> %V2, <4 x i32> < i32 undef, i32 undef, i32 7, i32 2 > ; <<4 x float>> [#uses=1]
- ret <4 x float> %V3
-}
-
-define <4 x float> @test_30u5(<4 x float>* %P1, <4 x float>* %P2) {
- %V1 = load <4 x float>* %P1 ; <<4 x float>> [#uses=1]
- %V2 = load <4 x float>* %P2 ; <<4 x float>> [#uses=1]
- %V3 = shufflevector <4 x float> %V1, <4 x float> %V2, <4 x i32> < i32 3, i32 0, i32 undef, i32 5 > ; <<4 x float>> [#uses=1]
- ret <4 x float> %V3
-}
-
-define <4 x float> @test_3u73(<4 x float>* %P1, <4 x float>* %P2) {
- %V1 = load <4 x float>* %P1 ; <<4 x float>> [#uses=1]
- %V2 = load <4 x float>* %P2 ; <<4 x float>> [#uses=1]
- %V3 = shufflevector <4 x float> %V1, <4 x float> %V2, <4 x i32> < i32 3, i32 undef, i32 7, i32 3 > ; <<4 x float>> [#uses=1]
- ret <4 x float> %V3
-}
-
-define <4 x float> @test_3774(<4 x float>* %P1, <4 x float>* %P2) {
- %V1 = load <4 x float>* %P1 ; <<4 x float>> [#uses=1]
- %V2 = load <4 x float>* %P2 ; <<4 x float>> [#uses=1]
- %V3 = shufflevector <4 x float> %V1, <4 x float> %V2, <4 x i32> < i32 3, i32 7, i32 7, i32 4 > ; <<4 x float>> [#uses=1]
- ret <4 x float> %V3
-}
-
-define <4 x float> @test_4450(<4 x float>* %P1, <4 x float>* %P2) {
- %V1 = load <4 x float>* %P1 ; <<4 x float>> [#uses=1]
- %V2 = load <4 x float>* %P2 ; <<4 x float>> [#uses=1]
- %V3 = shufflevector <4 x float> %V1, <4 x float> %V2, <4 x i32> < i32 4, i32 4, i32 5, i32 0 > ; <<4 x float>> [#uses=1]
- ret <4 x float> %V3
-}
diff --git a/release_23/test/CodeGen/PowerPC/vec_shuffle.ll b/release_23/test/CodeGen/PowerPC/vec_shuffle.ll
deleted file mode 100644
index 1289dca2d211..000000000000
--- a/release_23/test/CodeGen/PowerPC/vec_shuffle.ll
+++ /dev/null
@@ -1,504 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | \
-; RUN: llc -march=ppc32 -mcpu=g5 | not grep vperm
-; RUN: llvm-as < %s | llc -march=ppc32 -mcpu=g5 > %t
-; RUN: grep vsldoi %t | count 2
-; RUN: grep vmrgh %t | count 7
-; RUN: grep vmrgl %t | count 6
-; RUN: grep vpkuhum %t | count 1
-; RUN: grep vpkuwum %t | count 1
-
-define void @VSLDOI_xy(<8 x i16>* %A, <8 x i16>* %B) {
-entry:
- %tmp = load <8 x i16>* %A ; <<8 x i16>> [#uses=1]
- %tmp2 = load <8 x i16>* %B ; <<8 x i16>> [#uses=1]
- %tmp.upgrd.1 = bitcast <8 x i16> %tmp to <16 x i8> ; <<16 x i8>> [#uses=11]
- %tmp2.upgrd.2 = bitcast <8 x i16> %tmp2 to <16 x i8> ; <<16 x i8>> [#uses=5]
- %tmp.upgrd.3 = extractelement <16 x i8> %tmp.upgrd.1, i32 5 ; <i8> [#uses=1]
- %tmp3 = extractelement <16 x i8> %tmp.upgrd.1, i32 6 ; <i8> [#uses=1]
- %tmp4 = extractelement <16 x i8> %tmp.upgrd.1, i32 7 ; <i8> [#uses=1]
- %tmp5 = extractelement <16 x i8> %tmp.upgrd.1, i32 8 ; <i8> [#uses=1]
- %tmp6 = extractelement <16 x i8> %tmp.upgrd.1, i32 9 ; <i8> [#uses=1]
- %tmp7 = extractelement <16 x i8> %tmp.upgrd.1, i32 10 ; <i8> [#uses=1]
- %tmp8 = extractelement <16 x i8> %tmp.upgrd.1, i32 11 ; <i8> [#uses=1]
- %tmp9 = extractelement <16 x i8> %tmp.upgrd.1, i32 12 ; <i8> [#uses=1]
- %tmp10 = extractelement <16 x i8> %tmp.upgrd.1, i32 13 ; <i8> [#uses=1]
- %tmp11 = extractelement <16 x i8> %tmp.upgrd.1, i32 14 ; <i8> [#uses=1]
- %tmp12 = extractelement <16 x i8> %tmp.upgrd.1, i32 15 ; <i8> [#uses=1]
- %tmp13 = extractelement <16 x i8> %tmp2.upgrd.2, i32 0 ; <i8> [#uses=1]
- %tmp14 = extractelement <16 x i8> %tmp2.upgrd.2, i32 1 ; <i8> [#uses=1]
- %tmp15 = extractelement <16 x i8> %tmp2.upgrd.2, i32 2 ; <i8> [#uses=1]
- %tmp16 = extractelement <16 x i8> %tmp2.upgrd.2, i32 3 ; <i8> [#uses=1]
- %tmp17 = extractelement <16 x i8> %tmp2.upgrd.2, i32 4 ; <i8> [#uses=1]
- %tmp18 = insertelement <16 x i8> undef, i8 %tmp.upgrd.3, i32 0 ; <<16 x i8>> [#uses=1]
- %tmp19 = insertelement <16 x i8> %tmp18, i8 %tmp3, i32 1 ; <<16 x i8>> [#uses=1]
- %tmp20 = insertelement <16 x i8> %tmp19, i8 %tmp4, i32 2 ; <<16 x i8>> [#uses=1]
- %tmp21 = insertelement <16 x i8> %tmp20, i8 %tmp5, i32 3 ; <<16 x i8>> [#uses=1]
- %tmp22 = insertelement <16 x i8> %tmp21, i8 %tmp6, i32 4 ; <<16 x i8>> [#uses=1]
- %tmp23 = insertelement <16 x i8> %tmp22, i8 %tmp7, i32 5 ; <<16 x i8>> [#uses=1]
- %tmp24 = insertelement <16 x i8> %tmp23, i8 %tmp8, i32 6 ; <<16 x i8>> [#uses=1]
- %tmp25 = insertelement <16 x i8> %tmp24, i8 %tmp9, i32 7 ; <<16 x i8>> [#uses=1]
- %tmp26 = insertelement <16 x i8> %tmp25, i8 %tmp10, i32 8 ; <<16 x i8>> [#uses=1]
- %tmp27 = insertelement <16 x i8> %tmp26, i8 %tmp11, i32 9 ; <<16 x i8>> [#uses=1]
- %tmp28 = insertelement <16 x i8> %tmp27, i8 %tmp12, i32 10 ; <<16 x i8>> [#uses=1]
- %tmp29 = insertelement <16 x i8> %tmp28, i8 %tmp13, i32 11 ; <<16 x i8>> [#uses=1]
- %tmp30 = insertelement <16 x i8> %tmp29, i8 %tmp14, i32 12 ; <<16 x i8>> [#uses=1]
- %tmp31 = insertelement <16 x i8> %tmp30, i8 %tmp15, i32 13 ; <<16 x i8>> [#uses=1]
- %tmp32 = insertelement <16 x i8> %tmp31, i8 %tmp16, i32 14 ; <<16 x i8>> [#uses=1]
- %tmp33 = insertelement <16 x i8> %tmp32, i8 %tmp17, i32 15 ; <<16 x i8>> [#uses=1]
- %tmp33.upgrd.4 = bitcast <16 x i8> %tmp33 to <8 x i16> ; <<8 x i16>> [#uses=1]
- store <8 x i16> %tmp33.upgrd.4, <8 x i16>* %A
- ret void
-}
-
-define void @VSLDOI_xx(<8 x i16>* %A, <8 x i16>* %B) {
- %tmp = load <8 x i16>* %A ; <<8 x i16>> [#uses=1]
- %tmp2 = load <8 x i16>* %A ; <<8 x i16>> [#uses=1]
- %tmp.upgrd.5 = bitcast <8 x i16> %tmp to <16 x i8> ; <<16 x i8>> [#uses=11]
- %tmp2.upgrd.6 = bitcast <8 x i16> %tmp2 to <16 x i8> ; <<16 x i8>> [#uses=5]
- %tmp.upgrd.7 = extractelement <16 x i8> %tmp.upgrd.5, i32 5 ; <i8> [#uses=1]
- %tmp3 = extractelement <16 x i8> %tmp.upgrd.5, i32 6 ; <i8> [#uses=1]
- %tmp4 = extractelement <16 x i8> %tmp.upgrd.5, i32 7 ; <i8> [#uses=1]
- %tmp5 = extractelement <16 x i8> %tmp.upgrd.5, i32 8 ; <i8> [#uses=1]
- %tmp6 = extractelement <16 x i8> %tmp.upgrd.5, i32 9 ; <i8> [#uses=1]
- %tmp7 = extractelement <16 x i8> %tmp.upgrd.5, i32 10 ; <i8> [#uses=1]
- %tmp8 = extractelement <16 x i8> %tmp.upgrd.5, i32 11 ; <i8> [#uses=1]
- %tmp9 = extractelement <16 x i8> %tmp.upgrd.5, i32 12 ; <i8> [#uses=1]
- %tmp10 = extractelement <16 x i8> %tmp.upgrd.5, i32 13 ; <i8> [#uses=1]
- %tmp11 = extractelement <16 x i8> %tmp.upgrd.5, i32 14 ; <i8> [#uses=1]
- %tmp12 = extractelement <16 x i8> %tmp.upgrd.5, i32 15 ; <i8> [#uses=1]
- %tmp13 = extractelement <16 x i8> %tmp2.upgrd.6, i32 0 ; <i8> [#uses=1]
- %tmp14 = extractelement <16 x i8> %tmp2.upgrd.6, i32 1 ; <i8> [#uses=1]
- %tmp15 = extractelement <16 x i8> %tmp2.upgrd.6, i32 2 ; <i8> [#uses=1]
- %tmp16 = extractelement <16 x i8> %tmp2.upgrd.6, i32 3 ; <i8> [#uses=1]
- %tmp17 = extractelement <16 x i8> %tmp2.upgrd.6, i32 4 ; <i8> [#uses=1]
- %tmp18 = insertelement <16 x i8> undef, i8 %tmp.upgrd.7, i32 0 ; <<16 x i8>> [#uses=1]
- %tmp19 = insertelement <16 x i8> %tmp18, i8 %tmp3, i32 1 ; <<16 x i8>> [#uses=1]
- %tmp20 = insertelement <16 x i8> %tmp19, i8 %tmp4, i32 2 ; <<16 x i8>> [#uses=1]
- %tmp21 = insertelement <16 x i8> %tmp20, i8 %tmp5, i32 3 ; <<16 x i8>> [#uses=1]
- %tmp22 = insertelement <16 x i8> %tmp21, i8 %tmp6, i32 4 ; <<16 x i8>> [#uses=1]
- %tmp23 = insertelement <16 x i8> %tmp22, i8 %tmp7, i32 5 ; <<16 x i8>> [#uses=1]
- %tmp24 = insertelement <16 x i8> %tmp23, i8 %tmp8, i32 6 ; <<16 x i8>> [#uses=1]
- %tmp25 = insertelement <16 x i8> %tmp24, i8 %tmp9, i32 7 ; <<16 x i8>> [#uses=1]
- %tmp26 = insertelement <16 x i8> %tmp25, i8 %tmp10, i32 8 ; <<16 x i8>> [#uses=1]
- %tmp27 = insertelement <16 x i8> %tmp26, i8 %tmp11, i32 9 ; <<16 x i8>> [#uses=1]
- %tmp28 = insertelement <16 x i8> %tmp27, i8 %tmp12, i32 10 ; <<16 x i8>> [#uses=1]
- %tmp29 = insertelement <16 x i8> %tmp28, i8 %tmp13, i32 11 ; <<16 x i8>> [#uses=1]
- %tmp30 = insertelement <16 x i8> %tmp29, i8 %tmp14, i32 12 ; <<16 x i8>> [#uses=1]
- %tmp31 = insertelement <16 x i8> %tmp30, i8 %tmp15, i32 13 ; <<16 x i8>> [#uses=1]
- %tmp32 = insertelement <16 x i8> %tmp31, i8 %tmp16, i32 14 ; <<16 x i8>> [#uses=1]
- %tmp33 = insertelement <16 x i8> %tmp32, i8 %tmp17, i32 15 ; <<16 x i8>> [#uses=1]
- %tmp33.upgrd.8 = bitcast <16 x i8> %tmp33 to <8 x i16> ; <<8 x i16>> [#uses=1]
- store <8 x i16> %tmp33.upgrd.8, <8 x i16>* %A
- ret void
-}
-
-define void @VPERM_promote(<8 x i16>* %A, <8 x i16>* %B) {
-entry:
- %tmp = load <8 x i16>* %A ; <<8 x i16>> [#uses=1]
- %tmp.upgrd.9 = bitcast <8 x i16> %tmp to <4 x i32> ; <<4 x i32>> [#uses=1]
- %tmp2 = load <8 x i16>* %B ; <<8 x i16>> [#uses=1]
- %tmp2.upgrd.10 = bitcast <8 x i16> %tmp2 to <4 x i32> ; <<4 x i32>> [#uses=1]
- %tmp3 = call <4 x i32> @llvm.ppc.altivec.vperm( <4 x i32> %tmp.upgrd.9, <4 x i32> %tmp2.upgrd.10, <16 x i8> < i8 14, i8 14, i8 14, i8 14, i8 14, i8 14, i8 14, i8 14, i8 14, i8 14, i8 14, i8 14, i8 14, i8 14, i8 14, i8 14 > ) ; <<4 x i32>> [#uses=1]
- %tmp3.upgrd.11 = bitcast <4 x i32> %tmp3 to <8 x i16> ; <<8 x i16>> [#uses=1]
- store <8 x i16> %tmp3.upgrd.11, <8 x i16>* %A
- ret void
-}
-
-declare <4 x i32> @llvm.ppc.altivec.vperm(<4 x i32>, <4 x i32>, <16 x i8>)
-
-define void @tb_l(<16 x i8>* %A, <16 x i8>* %B) {
-entry:
- %tmp = load <16 x i8>* %A ; <<16 x i8>> [#uses=8]
- %tmp2 = load <16 x i8>* %B ; <<16 x i8>> [#uses=8]
- %tmp.upgrd.12 = extractelement <16 x i8> %tmp, i32 8 ; <i8> [#uses=1]
- %tmp3 = extractelement <16 x i8> %tmp2, i32 8 ; <i8> [#uses=1]
- %tmp4 = extractelement <16 x i8> %tmp, i32 9 ; <i8> [#uses=1]
- %tmp5 = extractelement <16 x i8> %tmp2, i32 9 ; <i8> [#uses=1]
- %tmp6 = extractelement <16 x i8> %tmp, i32 10 ; <i8> [#uses=1]
- %tmp7 = extractelement <16 x i8> %tmp2, i32 10 ; <i8> [#uses=1]
- %tmp8 = extractelement <16 x i8> %tmp, i32 11 ; <i8> [#uses=1]
- %tmp9 = extractelement <16 x i8> %tmp2, i32 11 ; <i8> [#uses=1]
- %tmp10 = extractelement <16 x i8> %tmp, i32 12 ; <i8> [#uses=1]
- %tmp11 = extractelement <16 x i8> %tmp2, i32 12 ; <i8> [#uses=1]
- %tmp12 = extractelement <16 x i8> %tmp, i32 13 ; <i8> [#uses=1]
- %tmp13 = extractelement <16 x i8> %tmp2, i32 13 ; <i8> [#uses=1]
- %tmp14 = extractelement <16 x i8> %tmp, i32 14 ; <i8> [#uses=1]
- %tmp15 = extractelement <16 x i8> %tmp2, i32 14 ; <i8> [#uses=1]
- %tmp16 = extractelement <16 x i8> %tmp, i32 15 ; <i8> [#uses=1]
- %tmp17 = extractelement <16 x i8> %tmp2, i32 15 ; <i8> [#uses=1]
- %tmp18 = insertelement <16 x i8> undef, i8 %tmp.upgrd.12, i32 0 ; <<16 x i8>> [#uses=1]
- %tmp19 = insertelement <16 x i8> %tmp18, i8 %tmp3, i32 1 ; <<16 x i8>> [#uses=1]
- %tmp20 = insertelement <16 x i8> %tmp19, i8 %tmp4, i32 2 ; <<16 x i8>> [#uses=1]
- %tmp21 = insertelement <16 x i8> %tmp20, i8 %tmp5, i32 3 ; <<16 x i8>> [#uses=1]
- %tmp22 = insertelement <16 x i8> %tmp21, i8 %tmp6, i32 4 ; <<16 x i8>> [#uses=1]
- %tmp23 = insertelement <16 x i8> %tmp22, i8 %tmp7, i32 5 ; <<16 x i8>> [#uses=1]
- %tmp24 = insertelement <16 x i8> %tmp23, i8 %tmp8, i32 6 ; <<16 x i8>> [#uses=1]
- %tmp25 = insertelement <16 x i8> %tmp24, i8 %tmp9, i32 7 ; <<16 x i8>> [#uses=1]
- %tmp26 = insertelement <16 x i8> %tmp25, i8 %tmp10, i32 8 ; <<16 x i8>> [#uses=1]
- %tmp27 = insertelement <16 x i8> %tmp26, i8 %tmp11, i32 9 ; <<16 x i8>> [#uses=1]
- %tmp28 = insertelement <16 x i8> %tmp27, i8 %tmp12, i32 10 ; <<16 x i8>> [#uses=1]
- %tmp29 = insertelement <16 x i8> %tmp28, i8 %tmp13, i32 11 ; <<16 x i8>> [#uses=1]
- %tmp30 = insertelement <16 x i8> %tmp29, i8 %tmp14, i32 12 ; <<16 x i8>> [#uses=1]
- %tmp31 = insertelement <16 x i8> %tmp30, i8 %tmp15, i32 13 ; <<16 x i8>> [#uses=1]
- %tmp32 = insertelement <16 x i8> %tmp31, i8 %tmp16, i32 14 ; <<16 x i8>> [#uses=1]
- %tmp33 = insertelement <16 x i8> %tmp32, i8 %tmp17, i32 15 ; <<16 x i8>> [#uses=1]
- store <16 x i8> %tmp33, <16 x i8>* %A
- ret void
-}
-
-define void @th_l(<8 x i16>* %A, <8 x i16>* %B) {
-entry:
- %tmp = load <8 x i16>* %A ; <<8 x i16>> [#uses=4]
- %tmp2 = load <8 x i16>* %B ; <<8 x i16>> [#uses=4]
- %tmp.upgrd.13 = extractelement <8 x i16> %tmp, i32 4 ; <i16> [#uses=1]
- %tmp3 = extractelement <8 x i16> %tmp2, i32 4 ; <i16> [#uses=1]
- %tmp4 = extractelement <8 x i16> %tmp, i32 5 ; <i16> [#uses=1]
- %tmp5 = extractelement <8 x i16> %tmp2, i32 5 ; <i16> [#uses=1]
- %tmp6 = extractelement <8 x i16> %tmp, i32 6 ; <i16> [#uses=1]
- %tmp7 = extractelement <8 x i16> %tmp2, i32 6 ; <i16> [#uses=1]
- %tmp8 = extractelement <8 x i16> %tmp, i32 7 ; <i16> [#uses=1]
- %tmp9 = extractelement <8 x i16> %tmp2, i32 7 ; <i16> [#uses=1]
- %tmp10 = insertelement <8 x i16> undef, i16 %tmp.upgrd.13, i32 0 ; <<8 x i16>> [#uses=1]
- %tmp11 = insertelement <8 x i16> %tmp10, i16 %tmp3, i32 1 ; <<8 x i16>> [#uses=1]
- %tmp12 = insertelement <8 x i16> %tmp11, i16 %tmp4, i32 2 ; <<8 x i16>> [#uses=1]
- %tmp13 = insertelement <8 x i16> %tmp12, i16 %tmp5, i32 3 ; <<8 x i16>> [#uses=1]
- %tmp14 = insertelement <8 x i16> %tmp13, i16 %tmp6, i32 4 ; <<8 x i16>> [#uses=1]
- %tmp15 = insertelement <8 x i16> %tmp14, i16 %tmp7, i32 5 ; <<8 x i16>> [#uses=1]
- %tmp16 = insertelement <8 x i16> %tmp15, i16 %tmp8, i32 6 ; <<8 x i16>> [#uses=1]
- %tmp17 = insertelement <8 x i16> %tmp16, i16 %tmp9, i32 7 ; <<8 x i16>> [#uses=1]
- store <8 x i16> %tmp17, <8 x i16>* %A
- ret void
-}
-
-define void @tw_l(<4 x i32>* %A, <4 x i32>* %B) {
-entry:
- %tmp = load <4 x i32>* %A ; <<4 x i32>> [#uses=2]
- %tmp2 = load <4 x i32>* %B ; <<4 x i32>> [#uses=2]
- %tmp.upgrd.14 = extractelement <4 x i32> %tmp, i32 2 ; <i32> [#uses=1]
- %tmp3 = extractelement <4 x i32> %tmp2, i32 2 ; <i32> [#uses=1]
- %tmp4 = extractelement <4 x i32> %tmp, i32 3 ; <i32> [#uses=1]
- %tmp5 = extractelement <4 x i32> %tmp2, i32 3 ; <i32> [#uses=1]
- %tmp6 = insertelement <4 x i32> undef, i32 %tmp.upgrd.14, i32 0 ; <<4 x i32>> [#uses=1]
- %tmp7 = insertelement <4 x i32> %tmp6, i32 %tmp3, i32 1 ; <<4 x i32>> [#uses=1]
- %tmp8 = insertelement <4 x i32> %tmp7, i32 %tmp4, i32 2 ; <<4 x i32>> [#uses=1]
- %tmp9 = insertelement <4 x i32> %tmp8, i32 %tmp5, i32 3 ; <<4 x i32>> [#uses=1]
- store <4 x i32> %tmp9, <4 x i32>* %A
- ret void
-}
-
-define void @tb_h(<16 x i8>* %A, <16 x i8>* %B) {
-entry:
- %tmp = load <16 x i8>* %A ; <<16 x i8>> [#uses=8]
- %tmp2 = load <16 x i8>* %B ; <<16 x i8>> [#uses=8]
- %tmp.upgrd.15 = extractelement <16 x i8> %tmp, i32 0 ; <i8> [#uses=1]
- %tmp3 = extractelement <16 x i8> %tmp2, i32 0 ; <i8> [#uses=1]
- %tmp4 = extractelement <16 x i8> %tmp, i32 1 ; <i8> [#uses=1]
- %tmp5 = extractelement <16 x i8> %tmp2, i32 1 ; <i8> [#uses=1]
- %tmp6 = extractelement <16 x i8> %tmp, i32 2 ; <i8> [#uses=1]
- %tmp7 = extractelement <16 x i8> %tmp2, i32 2 ; <i8> [#uses=1]
- %tmp8 = extractelement <16 x i8> %tmp, i32 3 ; <i8> [#uses=1]
- %tmp9 = extractelement <16 x i8> %tmp2, i32 3 ; <i8> [#uses=1]
- %tmp10 = extractelement <16 x i8> %tmp, i32 4 ; <i8> [#uses=1]
- %tmp11 = extractelement <16 x i8> %tmp2, i32 4 ; <i8> [#uses=1]
- %tmp12 = extractelement <16 x i8> %tmp, i32 5 ; <i8> [#uses=1]
- %tmp13 = extractelement <16 x i8> %tmp2, i32 5 ; <i8> [#uses=1]
- %tmp14 = extractelement <16 x i8> %tmp, i32 6 ; <i8> [#uses=1]
- %tmp15 = extractelement <16 x i8> %tmp2, i32 6 ; <i8> [#uses=1]
- %tmp16 = extractelement <16 x i8> %tmp, i32 7 ; <i8> [#uses=1]
- %tmp17 = extractelement <16 x i8> %tmp2, i32 7 ; <i8> [#uses=1]
- %tmp18 = insertelement <16 x i8> undef, i8 %tmp.upgrd.15, i32 0 ; <<16 x i8>> [#uses=1]
- %tmp19 = insertelement <16 x i8> %tmp18, i8 %tmp3, i32 1 ; <<16 x i8>> [#uses=1]
- %tmp20 = insertelement <16 x i8> %tmp19, i8 %tmp4, i32 2 ; <<16 x i8>> [#uses=1]
- %tmp21 = insertelement <16 x i8> %tmp20, i8 %tmp5, i32 3 ; <<16 x i8>> [#uses=1]
- %tmp22 = insertelement <16 x i8> %tmp21, i8 %tmp6, i32 4 ; <<16 x i8>> [#uses=1]
- %tmp23 = insertelement <16 x i8> %tmp22, i8 %tmp7, i32 5 ; <<16 x i8>> [#uses=1]
- %tmp24 = insertelement <16 x i8> %tmp23, i8 %tmp8, i32 6 ; <<16 x i8>> [#uses=1]
- %tmp25 = insertelement <16 x i8> %tmp24, i8 %tmp9, i32 7 ; <<16 x i8>> [#uses=1]
- %tmp26 = insertelement <16 x i8> %tmp25, i8 %tmp10, i32 8 ; <<16 x i8>> [#uses=1]
- %tmp27 = insertelement <16 x i8> %tmp26, i8 %tmp11, i32 9 ; <<16 x i8>> [#uses=1]
- %tmp28 = insertelement <16 x i8> %tmp27, i8 %tmp12, i32 10 ; <<16 x i8>> [#uses=1]
- %tmp29 = insertelement <16 x i8> %tmp28, i8 %tmp13, i32 11 ; <<16 x i8>> [#uses=1]
- %tmp30 = insertelement <16 x i8> %tmp29, i8 %tmp14, i32 12 ; <<16 x i8>> [#uses=1]
- %tmp31 = insertelement <16 x i8> %tmp30, i8 %tmp15, i32 13 ; <<16 x i8>> [#uses=1]
- %tmp32 = insertelement <16 x i8> %tmp31, i8 %tmp16, i32 14 ; <<16 x i8>> [#uses=1]
- %tmp33 = insertelement <16 x i8> %tmp32, i8 %tmp17, i32 15 ; <<16 x i8>> [#uses=1]
- store <16 x i8> %tmp33, <16 x i8>* %A
- ret void
-}
-
-define void @th_h(<8 x i16>* %A, <8 x i16>* %B) {
-entry:
- %tmp = load <8 x i16>* %A ; <<8 x i16>> [#uses=4]
- %tmp2 = load <8 x i16>* %B ; <<8 x i16>> [#uses=4]
- %tmp.upgrd.16 = extractelement <8 x i16> %tmp, i32 0 ; <i16> [#uses=1]
- %tmp3 = extractelement <8 x i16> %tmp2, i32 0 ; <i16> [#uses=1]
- %tmp4 = extractelement <8 x i16> %tmp, i32 1 ; <i16> [#uses=1]
- %tmp5 = extractelement <8 x i16> %tmp2, i32 1 ; <i16> [#uses=1]
- %tmp6 = extractelement <8 x i16> %tmp, i32 2 ; <i16> [#uses=1]
- %tmp7 = extractelement <8 x i16> %tmp2, i32 2 ; <i16> [#uses=1]
- %tmp8 = extractelement <8 x i16> %tmp, i32 3 ; <i16> [#uses=1]
- %tmp9 = extractelement <8 x i16> %tmp2, i32 3 ; <i16> [#uses=1]
- %tmp10 = insertelement <8 x i16> undef, i16 %tmp.upgrd.16, i32 0 ; <<8 x i16>> [#uses=1]
- %tmp11 = insertelement <8 x i16> %tmp10, i16 %tmp3, i32 1 ; <<8 x i16>> [#uses=1]
- %tmp12 = insertelement <8 x i16> %tmp11, i16 %tmp4, i32 2 ; <<8 x i16>> [#uses=1]
- %tmp13 = insertelement <8 x i16> %tmp12, i16 %tmp5, i32 3 ; <<8 x i16>> [#uses=1]
- %tmp14 = insertelement <8 x i16> %tmp13, i16 %tmp6, i32 4 ; <<8 x i16>> [#uses=1]
- %tmp15 = insertelement <8 x i16> %tmp14, i16 %tmp7, i32 5 ; <<8 x i16>> [#uses=1]
- %tmp16 = insertelement <8 x i16> %tmp15, i16 %tmp8, i32 6 ; <<8 x i16>> [#uses=1]
- %tmp17 = insertelement <8 x i16> %tmp16, i16 %tmp9, i32 7 ; <<8 x i16>> [#uses=1]
- store <8 x i16> %tmp17, <8 x i16>* %A
- ret void
-}
-
-define void @tw_h(<4 x i32>* %A, <4 x i32>* %B) {
-entry:
- %tmp = load <4 x i32>* %A ; <<4 x i32>> [#uses=2]
- %tmp2 = load <4 x i32>* %B ; <<4 x i32>> [#uses=2]
- %tmp.upgrd.17 = extractelement <4 x i32> %tmp2, i32 0 ; <i32> [#uses=1]
- %tmp3 = extractelement <4 x i32> %tmp, i32 0 ; <i32> [#uses=1]
- %tmp4 = extractelement <4 x i32> %tmp2, i32 1 ; <i32> [#uses=1]
- %tmp5 = extractelement <4 x i32> %tmp, i32 1 ; <i32> [#uses=1]
- %tmp6 = insertelement <4 x i32> undef, i32 %tmp.upgrd.17, i32 0 ; <<4 x i32>> [#uses=1]
- %tmp7 = insertelement <4 x i32> %tmp6, i32 %tmp3, i32 1 ; <<4 x i32>> [#uses=1]
- %tmp8 = insertelement <4 x i32> %tmp7, i32 %tmp4, i32 2 ; <<4 x i32>> [#uses=1]
- %tmp9 = insertelement <4 x i32> %tmp8, i32 %tmp5, i32 3 ; <<4 x i32>> [#uses=1]
- store <4 x i32> %tmp9, <4 x i32>* %A
- ret void
-}
-
-define void @tw_h_flop(<4 x i32>* %A, <4 x i32>* %B) {
- %tmp = load <4 x i32>* %A ; <<4 x i32>> [#uses=2]
- %tmp2 = load <4 x i32>* %B ; <<4 x i32>> [#uses=2]
- %tmp.upgrd.18 = extractelement <4 x i32> %tmp, i32 0 ; <i32> [#uses=1]
- %tmp3 = extractelement <4 x i32> %tmp2, i32 0 ; <i32> [#uses=1]
- %tmp4 = extractelement <4 x i32> %tmp, i32 1 ; <i32> [#uses=1]
- %tmp5 = extractelement <4 x i32> %tmp2, i32 1 ; <i32> [#uses=1]
- %tmp6 = insertelement <4 x i32> undef, i32 %tmp.upgrd.18, i32 0 ; <<4 x i32>> [#uses=1]
- %tmp7 = insertelement <4 x i32> %tmp6, i32 %tmp3, i32 1 ; <<4 x i32>> [#uses=1]
- %tmp8 = insertelement <4 x i32> %tmp7, i32 %tmp4, i32 2 ; <<4 x i32>> [#uses=1]
- %tmp9 = insertelement <4 x i32> %tmp8, i32 %tmp5, i32 3 ; <<4 x i32>> [#uses=1]
- store <4 x i32> %tmp9, <4 x i32>* %A
- ret void
-}
-
-define void @VMRG_UNARY_tb_l(<16 x i8>* %A, <16 x i8>* %B) {
-entry:
- %tmp = load <16 x i8>* %A ; <<16 x i8>> [#uses=16]
- %tmp.upgrd.19 = extractelement <16 x i8> %tmp, i32 8 ; <i8> [#uses=1]
- %tmp3 = extractelement <16 x i8> %tmp, i32 8 ; <i8> [#uses=1]
- %tmp4 = extractelement <16 x i8> %tmp, i32 9 ; <i8> [#uses=1]
- %tmp5 = extractelement <16 x i8> %tmp, i32 9 ; <i8> [#uses=1]
- %tmp6 = extractelement <16 x i8> %tmp, i32 10 ; <i8> [#uses=1]
- %tmp7 = extractelement <16 x i8> %tmp, i32 10 ; <i8> [#uses=1]
- %tmp8 = extractelement <16 x i8> %tmp, i32 11 ; <i8> [#uses=1]
- %tmp9 = extractelement <16 x i8> %tmp, i32 11 ; <i8> [#uses=1]
- %tmp10 = extractelement <16 x i8> %tmp, i32 12 ; <i8> [#uses=1]
- %tmp11 = extractelement <16 x i8> %tmp, i32 12 ; <i8> [#uses=1]
- %tmp12 = extractelement <16 x i8> %tmp, i32 13 ; <i8> [#uses=1]
- %tmp13 = extractelement <16 x i8> %tmp, i32 13 ; <i8> [#uses=1]
- %tmp14 = extractelement <16 x i8> %tmp, i32 14 ; <i8> [#uses=1]
- %tmp15 = extractelement <16 x i8> %tmp, i32 14 ; <i8> [#uses=1]
- %tmp16 = extractelement <16 x i8> %tmp, i32 15 ; <i8> [#uses=1]
- %tmp17 = extractelement <16 x i8> %tmp, i32 15 ; <i8> [#uses=1]
- %tmp18 = insertelement <16 x i8> undef, i8 %tmp.upgrd.19, i32 0 ; <<16 x i8>> [#uses=1]
- %tmp19 = insertelement <16 x i8> %tmp18, i8 %tmp3, i32 1 ; <<16 x i8>> [#uses=1]
- %tmp20 = insertelement <16 x i8> %tmp19, i8 %tmp4, i32 2 ; <<16 x i8>> [#uses=1]
- %tmp21 = insertelement <16 x i8> %tmp20, i8 %tmp5, i32 3 ; <<16 x i8>> [#uses=1]
- %tmp22 = insertelement <16 x i8> %tmp21, i8 %tmp6, i32 4 ; <<16 x i8>> [#uses=1]
- %tmp23 = insertelement <16 x i8> %tmp22, i8 %tmp7, i32 5 ; <<16 x i8>> [#uses=1]
- %tmp24 = insertelement <16 x i8> %tmp23, i8 %tmp8, i32 6 ; <<16 x i8>> [#uses=1]
- %tmp25 = insertelement <16 x i8> %tmp24, i8 %tmp9, i32 7 ; <<16 x i8>> [#uses=1]
- %tmp26 = insertelement <16 x i8> %tmp25, i8 %tmp10, i32 8 ; <<16 x i8>> [#uses=1]
- %tmp27 = insertelement <16 x i8> %tmp26, i8 %tmp11, i32 9 ; <<16 x i8>> [#uses=1]
- %tmp28 = insertelement <16 x i8> %tmp27, i8 %tmp12, i32 10 ; <<16 x i8>> [#uses=1]
- %tmp29 = insertelement <16 x i8> %tmp28, i8 %tmp13, i32 11 ; <<16 x i8>> [#uses=1]
- %tmp30 = insertelement <16 x i8> %tmp29, i8 %tmp14, i32 12 ; <<16 x i8>> [#uses=1]
- %tmp31 = insertelement <16 x i8> %tmp30, i8 %tmp15, i32 13 ; <<16 x i8>> [#uses=1]
- %tmp32 = insertelement <16 x i8> %tmp31, i8 %tmp16, i32 14 ; <<16 x i8>> [#uses=1]
- %tmp33 = insertelement <16 x i8> %tmp32, i8 %tmp17, i32 15 ; <<16 x i8>> [#uses=1]
- store <16 x i8> %tmp33, <16 x i8>* %A
- ret void
-}
-
-define void @VMRG_UNARY_th_l(<8 x i16>* %A, <8 x i16>* %B) {
-entry:
- %tmp = load <8 x i16>* %A ; <<8 x i16>> [#uses=8]
- %tmp.upgrd.20 = extractelement <8 x i16> %tmp, i32 4 ; <i16> [#uses=1]
- %tmp3 = extractelement <8 x i16> %tmp, i32 4 ; <i16> [#uses=1]
- %tmp4 = extractelement <8 x i16> %tmp, i32 5 ; <i16> [#uses=1]
- %tmp5 = extractelement <8 x i16> %tmp, i32 5 ; <i16> [#uses=1]
- %tmp6 = extractelement <8 x i16> %tmp, i32 6 ; <i16> [#uses=1]
- %tmp7 = extractelement <8 x i16> %tmp, i32 6 ; <i16> [#uses=1]
- %tmp8 = extractelement <8 x i16> %tmp, i32 7 ; <i16> [#uses=1]
- %tmp9 = extractelement <8 x i16> %tmp, i32 7 ; <i16> [#uses=1]
- %tmp10 = insertelement <8 x i16> undef, i16 %tmp.upgrd.20, i32 0 ; <<8 x i16>> [#uses=1]
- %tmp11 = insertelement <8 x i16> %tmp10, i16 %tmp3, i32 1 ; <<8 x i16>> [#uses=1]
- %tmp12 = insertelement <8 x i16> %tmp11, i16 %tmp4, i32 2 ; <<8 x i16>> [#uses=1]
- %tmp13 = insertelement <8 x i16> %tmp12, i16 %tmp5, i32 3 ; <<8 x i16>> [#uses=1]
- %tmp14 = insertelement <8 x i16> %tmp13, i16 %tmp6, i32 4 ; <<8 x i16>> [#uses=1]
- %tmp15 = insertelement <8 x i16> %tmp14, i16 %tmp7, i32 5 ; <<8 x i16>> [#uses=1]
- %tmp16 = insertelement <8 x i16> %tmp15, i16 %tmp8, i32 6 ; <<8 x i16>> [#uses=1]
- %tmp17 = insertelement <8 x i16> %tmp16, i16 %tmp9, i32 7 ; <<8 x i16>> [#uses=1]
- store <8 x i16> %tmp17, <8 x i16>* %A
- ret void
-}
-
-define void @VMRG_UNARY_tw_l(<4 x i32>* %A, <4 x i32>* %B) {
-entry:
- %tmp = load <4 x i32>* %A ; <<4 x i32>> [#uses=4]
- %tmp.upgrd.21 = extractelement <4 x i32> %tmp, i32 2 ; <i32> [#uses=1]
- %tmp3 = extractelement <4 x i32> %tmp, i32 2 ; <i32> [#uses=1]
- %tmp4 = extractelement <4 x i32> %tmp, i32 3 ; <i32> [#uses=1]
- %tmp5 = extractelement <4 x i32> %tmp, i32 3 ; <i32> [#uses=1]
- %tmp6 = insertelement <4 x i32> undef, i32 %tmp.upgrd.21, i32 0 ; <<4 x i32>> [#uses=1]
- %tmp7 = insertelement <4 x i32> %tmp6, i32 %tmp3, i32 1 ; <<4 x i32>> [#uses=1]
- %tmp8 = insertelement <4 x i32> %tmp7, i32 %tmp4, i32 2 ; <<4 x i32>> [#uses=1]
- %tmp9 = insertelement <4 x i32> %tmp8, i32 %tmp5, i32 3 ; <<4 x i32>> [#uses=1]
- store <4 x i32> %tmp9, <4 x i32>* %A
- ret void
-}
-
-define void @VMRG_UNARY_tb_h(<16 x i8>* %A, <16 x i8>* %B) {
-entry:
- %tmp = load <16 x i8>* %A ; <<16 x i8>> [#uses=16]
- %tmp.upgrd.22 = extractelement <16 x i8> %tmp, i32 0 ; <i8> [#uses=1]
- %tmp3 = extractelement <16 x i8> %tmp, i32 0 ; <i8> [#uses=1]
- %tmp4 = extractelement <16 x i8> %tmp, i32 1 ; <i8> [#uses=1]
- %tmp5 = extractelement <16 x i8> %tmp, i32 1 ; <i8> [#uses=1]
- %tmp6 = extractelement <16 x i8> %tmp, i32 2 ; <i8> [#uses=1]
- %tmp7 = extractelement <16 x i8> %tmp, i32 2 ; <i8> [#uses=1]
- %tmp8 = extractelement <16 x i8> %tmp, i32 3 ; <i8> [#uses=1]
- %tmp9 = extractelement <16 x i8> %tmp, i32 3 ; <i8> [#uses=1]
- %tmp10 = extractelement <16 x i8> %tmp, i32 4 ; <i8> [#uses=1]
- %tmp11 = extractelement <16 x i8> %tmp, i32 4 ; <i8> [#uses=1]
- %tmp12 = extractelement <16 x i8> %tmp, i32 5 ; <i8> [#uses=1]
- %tmp13 = extractelement <16 x i8> %tmp, i32 5 ; <i8> [#uses=1]
- %tmp14 = extractelement <16 x i8> %tmp, i32 6 ; <i8> [#uses=1]
- %tmp15 = extractelement <16 x i8> %tmp, i32 6 ; <i8> [#uses=1]
- %tmp16 = extractelement <16 x i8> %tmp, i32 7 ; <i8> [#uses=1]
- %tmp17 = extractelement <16 x i8> %tmp, i32 7 ; <i8> [#uses=1]
- %tmp18 = insertelement <16 x i8> undef, i8 %tmp.upgrd.22, i32 0 ; <<16 x i8>> [#uses=1]
- %tmp19 = insertelement <16 x i8> %tmp18, i8 %tmp3, i32 1 ; <<16 x i8>> [#uses=1]
- %tmp20 = insertelement <16 x i8> %tmp19, i8 %tmp4, i32 2 ; <<16 x i8>> [#uses=1]
- %tmp21 = insertelement <16 x i8> %tmp20, i8 %tmp5, i32 3 ; <<16 x i8>> [#uses=1]
- %tmp22 = insertelement <16 x i8> %tmp21, i8 %tmp6, i32 4 ; <<16 x i8>> [#uses=1]
- %tmp23 = insertelement <16 x i8> %tmp22, i8 %tmp7, i32 5 ; <<16 x i8>> [#uses=1]
- %tmp24 = insertelement <16 x i8> %tmp23, i8 %tmp8, i32 6 ; <<16 x i8>> [#uses=1]
- %tmp25 = insertelement <16 x i8> %tmp24, i8 %tmp9, i32 7 ; <<16 x i8>> [#uses=1]
- %tmp26 = insertelement <16 x i8> %tmp25, i8 %tmp10, i32 8 ; <<16 x i8>> [#uses=1]
- %tmp27 = insertelement <16 x i8> %tmp26, i8 %tmp11, i32 9 ; <<16 x i8>> [#uses=1]
- %tmp28 = insertelement <16 x i8> %tmp27, i8 %tmp12, i32 10 ; <<16 x i8>> [#uses=1]
- %tmp29 = insertelement <16 x i8> %tmp28, i8 %tmp13, i32 11 ; <<16 x i8>> [#uses=1]
- %tmp30 = insertelement <16 x i8> %tmp29, i8 %tmp14, i32 12 ; <<16 x i8>> [#uses=1]
- %tmp31 = insertelement <16 x i8> %tmp30, i8 %tmp15, i32 13 ; <<16 x i8>> [#uses=1]
- %tmp32 = insertelement <16 x i8> %tmp31, i8 %tmp16, i32 14 ; <<16 x i8>> [#uses=1]
- %tmp33 = insertelement <16 x i8> %tmp32, i8 %tmp17, i32 15 ; <<16 x i8>> [#uses=1]
- store <16 x i8> %tmp33, <16 x i8>* %A
- ret void
-}
-
-define void @VMRG_UNARY_th_h(<8 x i16>* %A, <8 x i16>* %B) {
-entry:
- %tmp = load <8 x i16>* %A ; <<8 x i16>> [#uses=8]
- %tmp.upgrd.23 = extractelement <8 x i16> %tmp, i32 0 ; <i16> [#uses=1]
- %tmp3 = extractelement <8 x i16> %tmp, i32 0 ; <i16> [#uses=1]
- %tmp4 = extractelement <8 x i16> %tmp, i32 1 ; <i16> [#uses=1]
- %tmp5 = extractelement <8 x i16> %tmp, i32 1 ; <i16> [#uses=1]
- %tmp6 = extractelement <8 x i16> %tmp, i32 2 ; <i16> [#uses=1]
- %tmp7 = extractelement <8 x i16> %tmp, i32 2 ; <i16> [#uses=1]
- %tmp8 = extractelement <8 x i16> %tmp, i32 3 ; <i16> [#uses=1]
- %tmp9 = extractelement <8 x i16> %tmp, i32 3 ; <i16> [#uses=1]
- %tmp10 = insertelement <8 x i16> undef, i16 %tmp.upgrd.23, i32 0 ; <<8 x i16>> [#uses=1]
- %tmp11 = insertelement <8 x i16> %tmp10, i16 %tmp3, i32 1 ; <<8 x i16>> [#uses=1]
- %tmp12 = insertelement <8 x i16> %tmp11, i16 %tmp4, i32 2 ; <<8 x i16>> [#uses=1]
- %tmp13 = insertelement <8 x i16> %tmp12, i16 %tmp5, i32 3 ; <<8 x i16>> [#uses=1]
- %tmp14 = insertelement <8 x i16> %tmp13, i16 %tmp6, i32 4 ; <<8 x i16>> [#uses=1]
- %tmp15 = insertelement <8 x i16> %tmp14, i16 %tmp7, i32 5 ; <<8 x i16>> [#uses=1]
- %tmp16 = insertelement <8 x i16> %tmp15, i16 %tmp8, i32 6 ; <<8 x i16>> [#uses=1]
- %tmp17 = insertelement <8 x i16> %tmp16, i16 %tmp9, i32 7 ; <<8 x i16>> [#uses=1]
- store <8 x i16> %tmp17, <8 x i16>* %A
- ret void
-}
-
-define void @VMRG_UNARY_tw_h(<4 x i32>* %A, <4 x i32>* %B) {
-entry:
- %tmp = load <4 x i32>* %A ; <<4 x i32>> [#uses=4]
- %tmp.upgrd.24 = extractelement <4 x i32> %tmp, i32 0 ; <i32> [#uses=1]
- %tmp3 = extractelement <4 x i32> %tmp, i32 0 ; <i32> [#uses=1]
- %tmp4 = extractelement <4 x i32> %tmp, i32 1 ; <i32> [#uses=1]
- %tmp5 = extractelement <4 x i32> %tmp, i32 1 ; <i32> [#uses=1]
- %tmp6 = insertelement <4 x i32> undef, i32 %tmp.upgrd.24, i32 0 ; <<4 x i32>> [#uses=1]
- %tmp7 = insertelement <4 x i32> %tmp6, i32 %tmp3, i32 1 ; <<4 x i32>> [#uses=1]
- %tmp8 = insertelement <4 x i32> %tmp7, i32 %tmp4, i32 2 ; <<4 x i32>> [#uses=1]
- %tmp9 = insertelement <4 x i32> %tmp8, i32 %tmp5, i32 3 ; <<4 x i32>> [#uses=1]
- store <4 x i32> %tmp9, <4 x i32>* %A
- ret void
-}
-
-define void @VPCKUHUM_unary(<8 x i16>* %A, <8 x i16>* %B) {
-entry:
- %tmp = load <8 x i16>* %A ; <<8 x i16>> [#uses=2]
- %tmp.upgrd.25 = bitcast <8 x i16> %tmp to <16 x i8> ; <<16 x i8>> [#uses=8]
- %tmp3 = bitcast <8 x i16> %tmp to <16 x i8> ; <<16 x i8>> [#uses=8]
- %tmp.upgrd.26 = extractelement <16 x i8> %tmp.upgrd.25, i32 1 ; <i8> [#uses=1]
- %tmp4 = extractelement <16 x i8> %tmp.upgrd.25, i32 3 ; <i8> [#uses=1]
- %tmp5 = extractelement <16 x i8> %tmp.upgrd.25, i32 5 ; <i8> [#uses=1]
- %tmp6 = extractelement <16 x i8> %tmp.upgrd.25, i32 7 ; <i8> [#uses=1]
- %tmp7 = extractelement <16 x i8> %tmp.upgrd.25, i32 9 ; <i8> [#uses=1]
- %tmp8 = extractelement <16 x i8> %tmp.upgrd.25, i32 11 ; <i8> [#uses=1]
- %tmp9 = extractelement <16 x i8> %tmp.upgrd.25, i32 13 ; <i8> [#uses=1]
- %tmp10 = extractelement <16 x i8> %tmp.upgrd.25, i32 15 ; <i8> [#uses=1]
- %tmp11 = extractelement <16 x i8> %tmp3, i32 1 ; <i8> [#uses=1]
- %tmp12 = extractelement <16 x i8> %tmp3, i32 3 ; <i8> [#uses=1]
- %tmp13 = extractelement <16 x i8> %tmp3, i32 5 ; <i8> [#uses=1]
- %tmp14 = extractelement <16 x i8> %tmp3, i32 7 ; <i8> [#uses=1]
- %tmp15 = extractelement <16 x i8> %tmp3, i32 9 ; <i8> [#uses=1]
- %tmp16 = extractelement <16 x i8> %tmp3, i32 11 ; <i8> [#uses=1]
- %tmp17 = extractelement <16 x i8> %tmp3, i32 13 ; <i8> [#uses=1]
- %tmp18 = extractelement <16 x i8> %tmp3, i32 15 ; <i8> [#uses=1]
- %tmp19 = insertelement <16 x i8> undef, i8 %tmp.upgrd.26, i32 0 ; <<16 x i8>> [#uses=1]
- %tmp20 = insertelement <16 x i8> %tmp19, i8 %tmp4, i32 1 ; <<16 x i8>> [#uses=1]
- %tmp21 = insertelement <16 x i8> %tmp20, i8 %tmp5, i32 2 ; <<16 x i8>> [#uses=1]
- %tmp22 = insertelement <16 x i8> %tmp21, i8 %tmp6, i32 3 ; <<16 x i8>> [#uses=1]
- %tmp23 = insertelement <16 x i8> %tmp22, i8 %tmp7, i32 4 ; <<16 x i8>> [#uses=1]
- %tmp24 = insertelement <16 x i8> %tmp23, i8 %tmp8, i32 5 ; <<16 x i8>> [#uses=1]
- %tmp25 = insertelement <16 x i8> %tmp24, i8 %tmp9, i32 6 ; <<16 x i8>> [#uses=1]
- %tmp26 = insertelement <16 x i8> %tmp25, i8 %tmp10, i32 7 ; <<16 x i8>> [#uses=1]
- %tmp27 = insertelement <16 x i8> %tmp26, i8 %tmp11, i32 8 ; <<16 x i8>> [#uses=1]
- %tmp28 = insertelement <16 x i8> %tmp27, i8 %tmp12, i32 9 ; <<16 x i8>> [#uses=1]
- %tmp29 = insertelement <16 x i8> %tmp28, i8 %tmp13, i32 10 ; <<16 x i8>> [#uses=1]
- %tmp30 = insertelement <16 x i8> %tmp29, i8 %tmp14, i32 11 ; <<16 x i8>> [#uses=1]
- %tmp31 = insertelement <16 x i8> %tmp30, i8 %tmp15, i32 12 ; <<16 x i8>> [#uses=1]
- %tmp32 = insertelement <16 x i8> %tmp31, i8 %tmp16, i32 13 ; <<16 x i8>> [#uses=1]
- %tmp33 = insertelement <16 x i8> %tmp32, i8 %tmp17, i32 14 ; <<16 x i8>> [#uses=1]
- %tmp34 = insertelement <16 x i8> %tmp33, i8 %tmp18, i32 15 ; <<16 x i8>> [#uses=1]
- %tmp34.upgrd.27 = bitcast <16 x i8> %tmp34 to <8 x i16> ; <<8 x i16>> [#uses=1]
- store <8 x i16> %tmp34.upgrd.27, <8 x i16>* %A
- ret void
-}
-
-define void @VPCKUWUM_unary(<4 x i32>* %A, <4 x i32>* %B) {
-entry:
- %tmp = load <4 x i32>* %A ; <<4 x i32>> [#uses=2]
- %tmp.upgrd.28 = bitcast <4 x i32> %tmp to <8 x i16> ; <<8 x i16>> [#uses=4]
- %tmp3 = bitcast <4 x i32> %tmp to <8 x i16> ; <<8 x i16>> [#uses=4]
- %tmp.upgrd.29 = extractelement <8 x i16> %tmp.upgrd.28, i32 1 ; <i16> [#uses=1]
- %tmp4 = extractelement <8 x i16> %tmp.upgrd.28, i32 3 ; <i16> [#uses=1]
- %tmp5 = extractelement <8 x i16> %tmp.upgrd.28, i32 5 ; <i16> [#uses=1]
- %tmp6 = extractelement <8 x i16> %tmp.upgrd.28, i32 7 ; <i16> [#uses=1]
- %tmp7 = extractelement <8 x i16> %tmp3, i32 1 ; <i16> [#uses=1]
- %tmp8 = extractelement <8 x i16> %tmp3, i32 3 ; <i16> [#uses=1]
- %tmp9 = extractelement <8 x i16> %tmp3, i32 5 ; <i16> [#uses=1]
- %tmp10 = extractelement <8 x i16> %tmp3, i32 7 ; <i16> [#uses=1]
- %tmp11 = insertelement <8 x i16> undef, i16 %tmp.upgrd.29, i32 0 ; <<8 x i16>> [#uses=1]
- %tmp12 = insertelement <8 x i16> %tmp11, i16 %tmp4, i32 1 ; <<8 x i16>> [#uses=1]
- %tmp13 = insertelement <8 x i16> %tmp12, i16 %tmp5, i32 2 ; <<8 x i16>> [#uses=1]
- %tmp14 = insertelement <8 x i16> %tmp13, i16 %tmp6, i32 3 ; <<8 x i16>> [#uses=1]
- %tmp15 = insertelement <8 x i16> %tmp14, i16 %tmp7, i32 4 ; <<8 x i16>> [#uses=1]
- %tmp16 = insertelement <8 x i16> %tmp15, i16 %tmp8, i32 5 ; <<8 x i16>> [#uses=1]
- %tmp17 = insertelement <8 x i16> %tmp16, i16 %tmp9, i32 6 ; <<8 x i16>> [#uses=1]
- %tmp18 = insertelement <8 x i16> %tmp17, i16 %tmp10, i32 7 ; <<8 x i16>> [#uses=1]
- %tmp18.upgrd.30 = bitcast <8 x i16> %tmp18 to <4 x i32> ; <<4 x i32>> [#uses=1]
- store <4 x i32> %tmp18.upgrd.30, <4 x i32>* %A
- ret void
-}
diff --git a/release_23/test/CodeGen/PowerPC/vec_spat.ll b/release_23/test/CodeGen/PowerPC/vec_spat.ll
deleted file mode 100644
index 7a35d87dbecc..000000000000
--- a/release_23/test/CodeGen/PowerPC/vec_spat.ll
+++ /dev/null
@@ -1,71 +0,0 @@
-; Test that vectors are scalarized/lowered correctly.
-; RUN: llvm-as < %s | llc -march=ppc32 -mcpu=g3 | \
-; RUN: grep stfs | count 4
-; RUN: llvm-as < %s | llc -march=ppc32 -mcpu=g5 -o %t -f
-; RUN: grep vspltw %t | count 2
-; RUN: grep vsplti %t | count 3
-; RUN: grep vsplth %t | count 1
-
- %f4 = type <4 x float>
- %i4 = type <4 x i32>
-
-define void @splat(%f4* %P, %f4* %Q, float %X) {
- %tmp = insertelement %f4 undef, float %X, i32 0 ; <%f4> [#uses=1]
- %tmp2 = insertelement %f4 %tmp, float %X, i32 1 ; <%f4> [#uses=1]
- %tmp4 = insertelement %f4 %tmp2, float %X, i32 2 ; <%f4> [#uses=1]
- %tmp6 = insertelement %f4 %tmp4, float %X, i32 3 ; <%f4> [#uses=1]
- %q = load %f4* %Q ; <%f4> [#uses=1]
- %R = add %f4 %q, %tmp6 ; <%f4> [#uses=1]
- store %f4 %R, %f4* %P
- ret void
-}
-
-define void @splat_i4(%i4* %P, %i4* %Q, i32 %X) {
- %tmp = insertelement %i4 undef, i32 %X, i32 0 ; <%i4> [#uses=1]
- %tmp2 = insertelement %i4 %tmp, i32 %X, i32 1 ; <%i4> [#uses=1]
- %tmp4 = insertelement %i4 %tmp2, i32 %X, i32 2 ; <%i4> [#uses=1]
- %tmp6 = insertelement %i4 %tmp4, i32 %X, i32 3 ; <%i4> [#uses=1]
- %q = load %i4* %Q ; <%i4> [#uses=1]
- %R = add %i4 %q, %tmp6 ; <%i4> [#uses=1]
- store %i4 %R, %i4* %P
- ret void
-}
-
-define void @splat_imm_i32(%i4* %P, %i4* %Q, i32 %X) {
- %q = load %i4* %Q ; <%i4> [#uses=1]
- %R = add %i4 %q, < i32 -1, i32 -1, i32 -1, i32 -1 > ; <%i4> [#uses=1]
- store %i4 %R, %i4* %P
- ret void
-}
-
-define void @splat_imm_i16(%i4* %P, %i4* %Q, i32 %X) {
- %q = load %i4* %Q ; <%i4> [#uses=1]
- %R = add %i4 %q, < i32 65537, i32 65537, i32 65537, i32 65537 > ; <%i4> [#uses=1]
- store %i4 %R, %i4* %P
- ret void
-}
-
-define void @splat_h(i16 %tmp, <16 x i8>* %dst) {
- %tmp.upgrd.1 = insertelement <8 x i16> undef, i16 %tmp, i32 0
- %tmp72 = insertelement <8 x i16> %tmp.upgrd.1, i16 %tmp, i32 1
- %tmp73 = insertelement <8 x i16> %tmp72, i16 %tmp, i32 2
- %tmp74 = insertelement <8 x i16> %tmp73, i16 %tmp, i32 3
- %tmp75 = insertelement <8 x i16> %tmp74, i16 %tmp, i32 4
- %tmp76 = insertelement <8 x i16> %tmp75, i16 %tmp, i32 5
- %tmp77 = insertelement <8 x i16> %tmp76, i16 %tmp, i32 6
- %tmp78 = insertelement <8 x i16> %tmp77, i16 %tmp, i32 7
- %tmp78.upgrd.2 = bitcast <8 x i16> %tmp78 to <16 x i8>
- store <16 x i8> %tmp78.upgrd.2, <16 x i8>* %dst
- ret void
-}
-
-define void @spltish(<16 x i8>* %A, <16 x i8>* %B) {
- %tmp = load <16 x i8>* %B ; <<16 x i8>> [#uses=1]
- %tmp.s = bitcast <16 x i8> %tmp to <16 x i8> ; <<16 x i8>> [#uses=1]
- %tmp4 = sub <16 x i8> %tmp.s, bitcast (<8 x i16> < i16 15, i16 15, i16 15, i16 15, i16 15, i16
- 15, i16 15, i16 15 > to <16 x i8>) ; <<16 x i8>> [#uses=1]
- %tmp4.u = bitcast <16 x i8> %tmp4 to <16 x i8> ; <<16 x i8>> [#uses=1]
- store <16 x i8> %tmp4.u, <16 x i8>* %A
- ret void
-}
-
diff --git a/release_23/test/CodeGen/PowerPC/vec_vrsave.ll b/release_23/test/CodeGen/PowerPC/vec_vrsave.ll
deleted file mode 100644
index 06769f6bf0f8..000000000000
--- a/release_23/test/CodeGen/PowerPC/vec_vrsave.ll
+++ /dev/null
@@ -1,14 +0,0 @@
-; RUN: llvm-as < %s | llc -march=ppc32 -mcpu=g5 -o %t -f
-; RUN: grep vrlw %t
-; RUN: not grep spr %t
-; RUN: not grep vrsave %t
-
-define <4 x i32> @test_rol() {
- ret <4 x i32> < i32 -11534337, i32 -11534337, i32 -11534337, i32 -11534337 >
-}
-
-define <4 x i32> @test_arg(<4 x i32> %A, <4 x i32> %B) {
- %C = add <4 x i32> %A, %B ; <<4 x i32>> [#uses=1]
- ret <4 x i32> %C
-}
-
diff --git a/release_23/test/CodeGen/PowerPC/vec_zero.ll b/release_23/test/CodeGen/PowerPC/vec_zero.ll
deleted file mode 100644
index 8d06a7d94dac..000000000000
--- a/release_23/test/CodeGen/PowerPC/vec_zero.ll
+++ /dev/null
@@ -1,9 +0,0 @@
-; RUN: llvm-as < %s | llc -march=ppc32 -mcpu=g5 | grep vxor
-
-define void @foo(<4 x float>* %P) {
- %T = load <4 x float>* %P ; <<4 x float>> [#uses=1]
- %S = add <4 x float> zeroinitializer, %T ; <<4 x float>> [#uses=1]
- store <4 x float> %S, <4 x float>* %P
- ret void
-}
-
diff --git a/release_23/test/CodeGen/PowerPC/vector-identity-shuffle.ll b/release_23/test/CodeGen/PowerPC/vector-identity-shuffle.ll
deleted file mode 100644
index aefd2661a8bc..000000000000
--- a/release_23/test/CodeGen/PowerPC/vector-identity-shuffle.ll
+++ /dev/null
@@ -1,17 +0,0 @@
-; RUN: llvm-as < %s | llc -march=ppc32 -mcpu=g5 | grep test:
-; RUN: llvm-as < %s | llc -march=ppc32 -mcpu=g5 | not grep vperm
-
-define void @test(<4 x float>* %tmp2.i) {
- %tmp2.i.upgrd.1 = load <4 x float>* %tmp2.i ; <<4 x float>> [#uses=4]
- %xFloat0.48 = extractelement <4 x float> %tmp2.i.upgrd.1, i32 0 ; <float> [#uses=1]
- %inFloat0.49 = insertelement <4 x float> undef, float %xFloat0.48, i32 0 ; <<4 x float>> [#uses=1]
- %xFloat1.50 = extractelement <4 x float> %tmp2.i.upgrd.1, i32 1 ; <float> [#uses=1]
- %inFloat1.52 = insertelement <4 x float> %inFloat0.49, float %xFloat1.50, i32 1 ; <<4 x float>> [#uses=1]
- %xFloat2.53 = extractelement <4 x float> %tmp2.i.upgrd.1, i32 2 ; <float> [#uses=1]
- %inFloat2.55 = insertelement <4 x float> %inFloat1.52, float %xFloat2.53, i32 2 ; <<4 x float>> [#uses=1]
- %xFloat3.56 = extractelement <4 x float> %tmp2.i.upgrd.1, i32 3 ; <float> [#uses=1]
- %inFloat3.58 = insertelement <4 x float> %inFloat2.55, float %xFloat3.56, i32 3 ; <<4 x float>> [#uses=1]
- store <4 x float> %inFloat3.58, <4 x float>* %tmp2.i
- ret void
-}
-
diff --git a/release_23/test/CodeGen/PowerPC/vector.ll b/release_23/test/CodeGen/PowerPC/vector.ll
deleted file mode 100644
index f121306cb818..000000000000
--- a/release_23/test/CodeGen/PowerPC/vector.ll
+++ /dev/null
@@ -1,158 +0,0 @@
-; Test that vectors are scalarized/lowered correctly.
-; RUN: llvm-as < %s | llc -march=ppc32 -mcpu=g5
-; RUN: llvm-as < %s | llc -march=ppc32 -mcpu=g3
-
-%d8 = type <8 x double>
-%f1 = type <1 x float>
-%f2 = type <2 x float>
-%f4 = type <4 x float>
-%f8 = type <8 x float>
-%i4 = type <4 x i32>
-
-;;; TEST HANDLING OF VARIOUS VECTOR SIZES
-
-define void @test_f1(%f1* %P, %f1* %Q, %f1* %S) {
- %p = load %f1* %P ; <%f1> [#uses=1]
- %q = load %f1* %Q ; <%f1> [#uses=1]
- %R = add %f1 %p, %q ; <%f1> [#uses=1]
- store %f1 %R, %f1* %S
- ret void
-}
-
-define void @test_f2(%f2* %P, %f2* %Q, %f2* %S) {
- %p = load %f2* %P ; <%f2> [#uses=1]
- %q = load %f2* %Q ; <%f2> [#uses=1]
- %R = add %f2 %p, %q ; <%f2> [#uses=1]
- store %f2 %R, %f2* %S
- ret void
-}
-
-define void @test_f4(%f4* %P, %f4* %Q, %f4* %S) {
- %p = load %f4* %P ; <%f4> [#uses=1]
- %q = load %f4* %Q ; <%f4> [#uses=1]
- %R = add %f4 %p, %q ; <%f4> [#uses=1]
- store %f4 %R, %f4* %S
- ret void
-}
-
-define void @test_f8(%f8* %P, %f8* %Q, %f8* %S) {
- %p = load %f8* %P ; <%f8> [#uses=1]
- %q = load %f8* %Q ; <%f8> [#uses=1]
- %R = add %f8 %p, %q ; <%f8> [#uses=1]
- store %f8 %R, %f8* %S
- ret void
-}
-
-define void @test_fmul(%f8* %P, %f8* %Q, %f8* %S) {
- %p = load %f8* %P ; <%f8> [#uses=1]
- %q = load %f8* %Q ; <%f8> [#uses=1]
- %R = mul %f8 %p, %q ; <%f8> [#uses=1]
- store %f8 %R, %f8* %S
- ret void
-}
-
-define void @test_div(%f8* %P, %f8* %Q, %f8* %S) {
- %p = load %f8* %P ; <%f8> [#uses=1]
- %q = load %f8* %Q ; <%f8> [#uses=1]
- %R = fdiv %f8 %p, %q ; <%f8> [#uses=1]
- store %f8 %R, %f8* %S
- ret void
-}
-
-;;; TEST VECTOR CONSTRUCTS
-
-define void @test_cst(%f4* %P, %f4* %S) {
- %p = load %f4* %P ; <%f4> [#uses=1]
- %R = add %f4 %p, < float 0x3FB99999A0000000, float 1.000000e+00, float
- 2.000000e+00, float 4.500000e+00 > ; <%f4> [#uses=1]
- store %f4 %R, %f4* %S
- ret void
-}
-
-define void @test_zero(%f4* %P, %f4* %S) {
- %p = load %f4* %P ; <%f4> [#uses=1]
- %R = add %f4 %p, zeroinitializer ; <%f4> [#uses=1]
- store %f4 %R, %f4* %S
- ret void
-}
-
-define void @test_undef(%f4* %P, %f4* %S) {
- %p = load %f4* %P ; <%f4> [#uses=1]
- %R = add %f4 %p, undef ; <%f4> [#uses=1]
- store %f4 %R, %f4* %S
- ret void
-}
-
-define void @test_constant_insert(%f4* %S) {
- %R = insertelement %f4 zeroinitializer, float 1.000000e+01, i32 0
- ; <%f4> [#uses=1]
- store %f4 %R, %f4* %S
- ret void
-}
-
-define void @test_variable_buildvector(float %F, %f4* %S) {
- %R = insertelement %f4 zeroinitializer, float %F, i32 0
- store %f4 %R, %f4* %S
- ret void
-}
-
-define void @test_scalar_to_vector(float %F, %f4* %S) {
- %R = insertelement %f4 undef, float %F, i32 0
- store %f4 %R, %f4* %S
- ret void
-}
-
-define float @test_extract_elt(%f8* %P) {
- %p = load %f8* %P ; <%f8> [#uses=1]
- %R = extractelement %f8 %p, i32 3 ; <float> [#uses=1]
- ret float %R
-}
-
-define double @test_extract_elt2(%d8* %P) {
- %p = load %d8* %P ; <%d8> [#uses=1]
- %R = extractelement %d8 %p, i32 3 ; <double> [#uses=1]
- ret double %R
-}
-
-define void @test_cast_1(%f4* %b, %i4* %a) {
- %tmp = load %f4* %b ; <%f4> [#uses=1]
- %tmp2 = add %f4 %tmp, < float 1.000000e+00, float 2.000000e+00, float
-3.000000e+00, float 4.000000e+00 > ; <%f4> [#uses=1]
- %tmp3 = bitcast %f4 %tmp2 to %i4 ; <%i4> [#uses=1]
- %tmp4 = add %i4 %tmp3, < i32 1, i32 2, i32 3, i32 4 >
- store %i4 %tmp4, %i4* %a
- ret void
-}
-
-define void @test_cast_2(%f8* %a, <8 x i32>* %b) {
- %T = load %f8* %a ; <%f8> [#uses=1]
- %T2 = bitcast %f8 %T to <8 x i32>
- store <8 x i32> %T2, <8 x i32>* %b
- ret void
-}
-
-
-;;; TEST IMPORTANT IDIOMS
-
-define void @splat(%f4* %P, %f4* %Q, float %X) {
- %tmp = insertelement %f4 undef, float %X, i32 0
- %tmp2 = insertelement %f4 %tmp, float %X, i32 1
- %tmp4 = insertelement %f4 %tmp2, float %X, i32 2
- %tmp6 = insertelement %f4 %tmp4, float %X, i32 3
- %q = load %f4* %Q ; <%f4> [#uses=1]
- %R = add %f4 %q, %tmp6 ; <%f4> [#uses=1]
- store %f4 %R, %f4* %P
- ret void
-}
-
-define void @splat_i4(%i4* %P, %i4* %Q, i32 %X) {
- %tmp = insertelement %i4 undef, i32 %X, i32 0
- %tmp2 = insertelement %i4 %tmp, i32 %X, i32 1
- %tmp4 = insertelement %i4 %tmp2, i32 %X, i32 2
- %tmp6 = insertelement %i4 %tmp4, i32 %X, i32 3
- %q = load %i4* %Q ; <%i4> [#uses=1]
- %R = add %i4 %q, %tmp6 ; <%i4> [#uses=1]
- store %i4 %R, %i4* %P
- ret void
-}
-
diff --git a/release_23/test/CodeGen/SPARC/2006-01-22-BitConvertLegalize.ll b/release_23/test/CodeGen/SPARC/2006-01-22-BitConvertLegalize.ll
deleted file mode 100644
index 15af046618f6..000000000000
--- a/release_23/test/CodeGen/SPARC/2006-01-22-BitConvertLegalize.ll
+++ /dev/null
@@ -1,12 +0,0 @@
-; RUN: llvm-as < %s | llc -march=sparc
-
-define void @execute_list() {
- %tmp.33.i = fdiv float 0.000000e+00, 0.000000e+00 ; <float> [#uses=1]
- %tmp.37.i = mul float 0.000000e+00, %tmp.33.i ; <float> [#uses=1]
- %tmp.42.i = add float %tmp.37.i, 0.000000e+00 ; <float> [#uses=1]
- call void @gl_EvalCoord1f( float %tmp.42.i )
- ret void
-}
-
-declare void @gl_EvalCoord1f(float)
-
diff --git a/release_23/test/CodeGen/SPARC/2007-05-09-JumpTables.ll b/release_23/test/CodeGen/SPARC/2007-05-09-JumpTables.ll
deleted file mode 100644
index a014acefa904..000000000000
--- a/release_23/test/CodeGen/SPARC/2007-05-09-JumpTables.ll
+++ /dev/null
@@ -1,30 +0,0 @@
-; RUN: llvm-as < %s | llc -march=sparc
-
-; We cannot emit jump tables on Sparc, but we should correctly handle this case.
-
-target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64"
-
-define i32 @foo(i32 %f) {
-entry:
- switch i32 %f, label %bb14 [
- i32 0, label %UnifiedReturnBlock
- i32 1, label %bb4
- i32 2, label %bb7
- i32 3, label %bb10
- ]
-
-bb4: ; preds = %entry
- ret i32 2
-
-bb7: ; preds = %entry
- ret i32 5
-
-bb10: ; preds = %entry
- ret i32 9
-
-bb14: ; preds = %entry
- ret i32 0
-
-UnifiedReturnBlock: ; preds = %entry
- ret i32 1
-}
diff --git a/release_23/test/CodeGen/SPARC/2007-07-05-LiveIntervalAssert.ll b/release_23/test/CodeGen/SPARC/2007-07-05-LiveIntervalAssert.ll
deleted file mode 100644
index d1ca44dbb112..000000000000
--- a/release_23/test/CodeGen/SPARC/2007-07-05-LiveIntervalAssert.ll
+++ /dev/null
@@ -1,11 +0,0 @@
-; RUN: llvm-as < %s | llc -march=sparc
-; PR1540
-
-declare float @sinf(float)
-declare double @sin(double)
-define double @test_sin(float %F) {
- %G = call float @sinf( float %F ) ; <float> [#uses=1]
- %H = fpext float %G to double ; <double> [#uses=1]
- %I = call double @sin( double %H ) ; <double> [#uses=1]
- ret double %I
-}
diff --git a/release_23/test/CodeGen/SPARC/basictest.ll b/release_23/test/CodeGen/SPARC/basictest.ll
deleted file mode 100644
index 5c3e07543b9d..000000000000
--- a/release_23/test/CodeGen/SPARC/basictest.ll
+++ /dev/null
@@ -1,6 +0,0 @@
-; RUN: llvm-as < %s | llc -march=sparc
-
-define i32 @test(i32 %X) {
- %tmp.1 = add i32 %X, 1
- ret i32 %tmp.1
-}
diff --git a/release_23/test/CodeGen/SPARC/ctpop.ll b/release_23/test/CodeGen/SPARC/ctpop.ll
deleted file mode 100644
index d603baa465de..000000000000
--- a/release_23/test/CodeGen/SPARC/ctpop.ll
+++ /dev/null
@@ -1,14 +0,0 @@
-; RUN: llvm-as < %s | \
-; RUN: llc -march=sparc -mattr=v9 -enable-sparc-v9-insts
-; RUN: llvm-as < %s | llc -march=sparc -mattr=-v9 | \
-; RUN: not grep popc
-; RUN: llvm-as < %s | \
-; RUN: llc -march=sparc -mattr=v9 -enable-sparc-v9-insts | grep popc
-
-declare i32 @llvm.ctpop.i32(i32)
-
-define i32 @test(i32 %X) {
- %Y = call i32 @llvm.ctpop.i32( i32 %X ) ; <i32> [#uses=1]
- ret i32 %Y
-}
-
diff --git a/release_23/test/CodeGen/SPARC/dg.exp b/release_23/test/CodeGen/SPARC/dg.exp
deleted file mode 100644
index a1ce6a106127..000000000000
--- a/release_23/test/CodeGen/SPARC/dg.exp
+++ /dev/null
@@ -1,5 +0,0 @@
-load_lib llvm.exp
-
-if { [llvm_supports_target Sparc] } {
- RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
-}
diff --git a/release_23/test/CodeGen/SPARC/xnor.ll b/release_23/test/CodeGen/SPARC/xnor.ll
deleted file mode 100644
index 9d8994c00613..000000000000
--- a/release_23/test/CodeGen/SPARC/xnor.ll
+++ /dev/null
@@ -1,15 +0,0 @@
-; RUN: llvm-as < %s | llc -march=sparc | \
-; RUN: grep xnor | count 2
-
-define i32 @test1(i32 %X, i32 %Y) {
- %A = xor i32 %X, %Y ; <i32> [#uses=1]
- %B = xor i32 %A, -1 ; <i32> [#uses=1]
- ret i32 %B
-}
-
-define i32 @test2(i32 %X, i32 %Y) {
- %A = xor i32 %X, -1 ; <i32> [#uses=1]
- %B = xor i32 %A, %Y ; <i32> [#uses=1]
- ret i32 %B
-}
-
diff --git a/release_23/test/CodeGen/X86/2002-12-23-LocalRAProblem.ll b/release_23/test/CodeGen/X86/2002-12-23-LocalRAProblem.ll
deleted file mode 100644
index df4a8f52f0be..000000000000
--- a/release_23/test/CodeGen/X86/2002-12-23-LocalRAProblem.ll
+++ /dev/null
@@ -1,15 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -regalloc=simple
-
-define i32 @main() {
- ; %A = 0
- %A = add i32 0, 0 ; <i32> [#uses=1]
- ; %B = 1
- %B = add i32 0, 1 ; <i32> [#uses=2]
- br label %bb1
-bb1: ; preds = %0
- ; %X = 0*1 = 0
- %X = mul i32 %A, %B ; <i32> [#uses=0]
- ; %r = 0
- %R = sub i32 %B, 1 ; <i32> [#uses=1]
- ret i32 %R
-}
diff --git a/release_23/test/CodeGen/X86/2002-12-23-SubProblem.ll b/release_23/test/CodeGen/X86/2002-12-23-SubProblem.ll
deleted file mode 100644
index 68200ff2349e..000000000000
--- a/release_23/test/CodeGen/X86/2002-12-23-SubProblem.ll
+++ /dev/null
@@ -1,7 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -regalloc=simple
-
-define i32 @main(i32 %B) {
- ;%B = add i32 0, 1;
- %R = sub i32 %B, 1 ; %r = 0
- ret i32 %R
-}
diff --git a/release_23/test/CodeGen/X86/2003-08-03-CallArgLiveRanges.ll b/release_23/test/CodeGen/X86/2003-08-03-CallArgLiveRanges.ll
deleted file mode 100644
index 2b4242aaa15e..000000000000
--- a/release_23/test/CodeGen/X86/2003-08-03-CallArgLiveRanges.ll
+++ /dev/null
@@ -1,18 +0,0 @@
-; The old instruction selector used to load all arguments to a call up in
-; registers, then start pushing them all onto the stack. This is bad news as
-; it makes a ton of annoying overlapping live ranges. This code should not
-; cause spills!
-;
-; RUN: llvm-as < %s | llc -march=x86 -stats |& not grep spilled
-
-target datalayout = "e-p:32:32"
-
-define i32 @test(i32, i32, i32, i32, i32, i32, i32, i32, i32, i32) {
- ret i32 0
-}
-
-define i32 @main() {
- %X = call i32 @test( i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10 ) ; <i32> [#uses=1]
- ret i32 %X
-}
-
diff --git a/release_23/test/CodeGen/X86/2003-08-23-DeadBlockTest.ll b/release_23/test/CodeGen/X86/2003-08-23-DeadBlockTest.ll
deleted file mode 100644
index a4d558949e30..000000000000
--- a/release_23/test/CodeGen/X86/2003-08-23-DeadBlockTest.ll
+++ /dev/null
@@ -1,12 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86
-
-define i32 @test() {
-entry:
- ret i32 7
-Test: ; No predecessors!
- %A = call i32 @test( ) ; <i32> [#uses=1]
- %B = call i32 @test( ) ; <i32> [#uses=1]
- %C = add i32 %A, %B ; <i32> [#uses=1]
- ret i32 %C
-}
-
diff --git a/release_23/test/CodeGen/X86/2003-11-03-GlobalBool.ll b/release_23/test/CodeGen/X86/2003-11-03-GlobalBool.ll
deleted file mode 100644
index 4de3c79fdcbb..000000000000
--- a/release_23/test/CodeGen/X86/2003-11-03-GlobalBool.ll
+++ /dev/null
@@ -1,4 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 | \
-; RUN: not grep {.byte\[\[:space:\]\]*true}
-
-@X = global i1 true ; <i1*> [#uses=0]
diff --git a/release_23/test/CodeGen/X86/2004-02-12-Memcpy.ll b/release_23/test/CodeGen/X86/2004-02-12-Memcpy.ll
deleted file mode 100644
index 59364c1f6d65..000000000000
--- a/release_23/test/CodeGen/X86/2004-02-12-Memcpy.ll
+++ /dev/null
@@ -1,25 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -mtriple=i686-pc-linux-gnu | grep movs | count 3
-
-@A = global [32 x i32] zeroinitializer
-@B = global [32 x i32] zeroinitializer
-
-declare void @llvm.memcpy.i32(i8*, i8*, i32, i32)
-
-define void @main() {
- ; dword copy
- call void @llvm.memcpy.i32(i8* bitcast ([32 x i32]* @A to i8*),
- i8* bitcast ([32 x i32]* @B to i8*),
- i32 128, i32 4 )
-
- ; word copy
- call void @llvm.memcpy.i32( i8* bitcast ([32 x i32]* @A to i8*),
- i8* bitcast ([32 x i32]* @B to i8*),
- i32 128, i32 2 )
-
- ; byte copy
- call void @llvm.memcpy.i32( i8* bitcast ([32 x i32]* @A to i8*),
- i8* bitcast ([32 x i32]* @B to i8*),
- i32 128, i32 1 )
-
- ret void
-}
diff --git a/release_23/test/CodeGen/X86/2004-02-13-FrameReturnAddress.ll b/release_23/test/CodeGen/X86/2004-02-13-FrameReturnAddress.ll
deleted file mode 100644
index f48b1d3adf01..000000000000
--- a/release_23/test/CodeGen/X86/2004-02-13-FrameReturnAddress.ll
+++ /dev/null
@@ -1,16 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 | grep {(%esp}
-
-declare i8* @llvm.returnaddress(i32)
-
-declare i8* @llvm.frameaddress(i32)
-
-define i8* @test1() {
- %X = call i8* @llvm.returnaddress( i32 0 ) ; <i8*> [#uses=1]
- ret i8* %X
-}
-
-define i8* @test2() {
- %X = call i8* @llvm.frameaddress( i32 0 ) ; <i8*> [#uses=1]
- ret i8* %X
-}
-
diff --git a/release_23/test/CodeGen/X86/2004-02-14-InefficientStackPointer.ll b/release_23/test/CodeGen/X86/2004-02-14-InefficientStackPointer.ll
deleted file mode 100644
index b25dfaf5d90e..000000000000
--- a/release_23/test/CodeGen/X86/2004-02-14-InefficientStackPointer.ll
+++ /dev/null
@@ -1,5 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 | grep -i ESP | not grep sub
-
-define i32 @test(i32 %X) {
- ret i32 %X
-}
diff --git a/release_23/test/CodeGen/X86/2004-02-22-Casts.ll b/release_23/test/CodeGen/X86/2004-02-22-Casts.ll
deleted file mode 100644
index 40d5f39df642..000000000000
--- a/release_23/test/CodeGen/X86/2004-02-22-Casts.ll
+++ /dev/null
@@ -1,12 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86
-define i1 @test1(double %X) {
- %V = fcmp one double %X, 0.000000e+00 ; <i1> [#uses=1]
- ret i1 %V
-}
-
-define double @test2(i64 %X) {
- %V = uitofp i64 %X to double ; <double> [#uses=1]
- ret double %V
-}
-
-
diff --git a/release_23/test/CodeGen/X86/2004-03-30-Select-Max.ll b/release_23/test/CodeGen/X86/2004-03-30-Select-Max.ll
deleted file mode 100644
index 5021fd89dfe4..000000000000
--- a/release_23/test/CodeGen/X86/2004-03-30-Select-Max.ll
+++ /dev/null
@@ -1,8 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 | not grep {j\[lgbe\]}
-
-define i32 @max(i32 %A, i32 %B) {
- %gt = icmp sgt i32 %A, %B ; <i1> [#uses=1]
- %R = select i1 %gt, i32 %A, i32 %B ; <i32> [#uses=1]
- ret i32 %R
-}
-
diff --git a/release_23/test/CodeGen/X86/2004-04-09-SameValueCoalescing.ll b/release_23/test/CodeGen/X86/2004-04-09-SameValueCoalescing.ll
deleted file mode 100644
index 633a61564558..000000000000
--- a/release_23/test/CodeGen/X86/2004-04-09-SameValueCoalescing.ll
+++ /dev/null
@@ -1,13 +0,0 @@
-; Linear scan does not currently coalesce any two variables that have
-; overlapping live intervals. When two overlapping intervals have the same
-; value, they can be joined though.
-;
-; RUN: llvm-as < %s | llc -march=x86 -regalloc=linearscan | \
-; RUN: not grep {mov %\[A-Z\]\\\{2,3\\\}, %\[A-Z\]\\\{2,3\\\}}
-
-define i64 @test(i64 %x) {
-entry:
- %tmp.1 = mul i64 %x, 4294967297 ; <i64> [#uses=1]
- ret i64 %tmp.1
-}
-
diff --git a/release_23/test/CodeGen/X86/2004-04-13-FPCMOV-Crash.ll b/release_23/test/CodeGen/X86/2004-04-13-FPCMOV-Crash.ll
deleted file mode 100644
index 858605c231bc..000000000000
--- a/release_23/test/CodeGen/X86/2004-04-13-FPCMOV-Crash.ll
+++ /dev/null
@@ -1,7 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86
-
-define double @test(double %d) {
- %X = select i1 false, double %d, double %d ; <double> [#uses=1]
- ret double %X
-}
-
diff --git a/release_23/test/CodeGen/X86/2004-06-10-StackifierCrash.ll b/release_23/test/CodeGen/X86/2004-06-10-StackifierCrash.ll
deleted file mode 100644
index 1a51bee404d0..000000000000
--- a/release_23/test/CodeGen/X86/2004-06-10-StackifierCrash.ll
+++ /dev/null
@@ -1,6 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86
-
-define i1 @T(double %X) {
- %V = fcmp oeq double %X, %X ; <i1> [#uses=1]
- ret i1 %V
-}
diff --git a/release_23/test/CodeGen/X86/2004-10-08-SelectSetCCFold.ll b/release_23/test/CodeGen/X86/2004-10-08-SelectSetCCFold.ll
deleted file mode 100644
index 9ee773c91a24..000000000000
--- a/release_23/test/CodeGen/X86/2004-10-08-SelectSetCCFold.ll
+++ /dev/null
@@ -1,8 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86
-
-define i1 @test(i1 %C, i1 %D, i32 %X, i32 %Y) {
- %E = icmp slt i32 %X, %Y ; <i1> [#uses=1]
- %F = select i1 %C, i1 %D, i1 %E ; <i1> [#uses=1]
- ret i1 %F
-}
-
diff --git a/release_23/test/CodeGen/X86/2005-01-17-CycleInDAG.ll b/release_23/test/CodeGen/X86/2005-01-17-CycleInDAG.ll
deleted file mode 100644
index 37cff57f30e2..000000000000
--- a/release_23/test/CodeGen/X86/2005-01-17-CycleInDAG.ll
+++ /dev/null
@@ -1,17 +0,0 @@
-; This testcase was distilled from 132.ijpeg. Bsaically we cannot fold the
-; load into the sub instruction here as it induces a cycle in the dag, which
-; is invalid code (there is no correct way to order the instruction). Check
-; that we do not fold the load into the sub.
-
-; RUN: llvm-as < %s | llc -march=x86 | not grep sub.*GLOBAL
-
-@GLOBAL = external global i32 ; <i32*> [#uses=1]
-
-define i32 @test(i32* %P1, i32* %P2, i32* %P3) {
- %L = load i32* @GLOBAL ; <i32> [#uses=1]
- store i32 12, i32* %P2
- %Y = load i32* %P3 ; <i32> [#uses=1]
- %Z = sub i32 %Y, %L ; <i32> [#uses=1]
- ret i32 %Z
-}
-
diff --git a/release_23/test/CodeGen/X86/2005-02-14-IllegalAssembler.ll b/release_23/test/CodeGen/X86/2005-02-14-IllegalAssembler.ll
deleted file mode 100644
index 762047b7d8c4..000000000000
--- a/release_23/test/CodeGen/X86/2005-02-14-IllegalAssembler.ll
+++ /dev/null
@@ -1,5 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 | not grep 18446744073709551612
-
-@A = external global i32 ; <i32*> [#uses=1]
-@Y = global i32* getelementptr (i32* @A, i32 -1) ; <i32**> [#uses=0]
-
diff --git a/release_23/test/CodeGen/X86/2005-05-08-FPStackifierPHI.ll b/release_23/test/CodeGen/X86/2005-05-08-FPStackifierPHI.ll
deleted file mode 100644
index b5d215b2057a..000000000000
--- a/release_23/test/CodeGen/X86/2005-05-08-FPStackifierPHI.ll
+++ /dev/null
@@ -1,38 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -mcpu=generic
-; Make sure LLC doesn't crash in the stackifier due to FP PHI nodes.
-
-define void @radfg_() {
-entry:
- br i1 false, label %no_exit.16.preheader, label %loopentry.0
-loopentry.0: ; preds = %entry
- ret void
-no_exit.16.preheader: ; preds = %entry
- br label %no_exit.16
-no_exit.16: ; preds = %no_exit.16, %no_exit.16.preheader
- br i1 false, label %loopexit.16.loopexit, label %no_exit.16
-loopexit.16.loopexit: ; preds = %no_exit.16
- br label %no_exit.18
-no_exit.18: ; preds = %loopexit.20, %loopexit.16.loopexit
- %tmp.882 = add float 0.000000e+00, 0.000000e+00 ; <float> [#uses=2]
- br i1 false, label %loopexit.19, label %no_exit.19.preheader
-no_exit.19.preheader: ; preds = %no_exit.18
- ret void
-loopexit.19: ; preds = %no_exit.18
- br i1 false, label %loopexit.20, label %no_exit.20
-no_exit.20: ; preds = %loopexit.21, %loopexit.19
- %ai2.1122.tmp.3 = phi float [ %tmp.958, %loopexit.21 ], [ %tmp.882, %loopexit.19 ] ; <float> [#uses=1]
- %tmp.950 = mul float %tmp.882, %ai2.1122.tmp.3 ; <float> [#uses=1]
- %tmp.951 = sub float 0.000000e+00, %tmp.950 ; <float> [#uses=1]
- %tmp.958 = add float 0.000000e+00, 0.000000e+00 ; <float> [#uses=1]
- br i1 false, label %loopexit.21, label %no_exit.21.preheader
-no_exit.21.preheader: ; preds = %no_exit.20
- ret void
-loopexit.21: ; preds = %no_exit.20
- br i1 false, label %loopexit.20, label %no_exit.20
-loopexit.20: ; preds = %loopexit.21, %loopexit.19
- %ar2.1124.tmp.2 = phi float [ 0.000000e+00, %loopexit.19 ], [ %tmp.951, %loopexit.21 ] ; <float> [#uses=0]
- br i1 false, label %loopexit.18.loopexit, label %no_exit.18
-loopexit.18.loopexit: ; preds = %loopexit.20
- ret void
-}
-
diff --git a/release_23/test/CodeGen/X86/2006-01-19-ISelFoldingBug.ll b/release_23/test/CodeGen/X86/2006-01-19-ISelFoldingBug.ll
deleted file mode 100644
index 817b281243e7..000000000000
--- a/release_23/test/CodeGen/X86/2006-01-19-ISelFoldingBug.ll
+++ /dev/null
@@ -1,20 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 | \
-; RUN: grep shld | count 1
-;
-; Check that the isel does not fold the shld, which already folds a load
-; and has two uses, into a store.
-
-@A = external global i32 ; <i32*> [#uses=2]
-
-define i32 @test5(i32 %B, i8 %C) {
- %tmp.1 = load i32* @A ; <i32> [#uses=1]
- %shift.upgrd.1 = zext i8 %C to i32 ; <i32> [#uses=1]
- %tmp.2 = shl i32 %tmp.1, %shift.upgrd.1 ; <i32> [#uses=1]
- %tmp.3 = sub i8 32, %C ; <i8> [#uses=1]
- %shift.upgrd.2 = zext i8 %tmp.3 to i32 ; <i32> [#uses=1]
- %tmp.4 = lshr i32 %B, %shift.upgrd.2 ; <i32> [#uses=1]
- %tmp.5 = or i32 %tmp.4, %tmp.2 ; <i32> [#uses=2]
- store i32 %tmp.5, i32* @A
- ret i32 %tmp.5
-}
-
diff --git a/release_23/test/CodeGen/X86/2006-03-01-InstrSchedBug.ll b/release_23/test/CodeGen/X86/2006-03-01-InstrSchedBug.ll
deleted file mode 100644
index 51d2fb2fe27b..000000000000
--- a/release_23/test/CodeGen/X86/2006-03-01-InstrSchedBug.ll
+++ /dev/null
@@ -1,12 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 | not grep {subl.*%esp}
-
-define i32 @f(i32 %a, i32 %b) {
- %tmp.2 = mul i32 %a, %a ; <i32> [#uses=1]
- %tmp.5 = shl i32 %a, 1 ; <i32> [#uses=1]
- %tmp.6 = mul i32 %tmp.5, %b ; <i32> [#uses=1]
- %tmp.10 = mul i32 %b, %b ; <i32> [#uses=1]
- %tmp.7 = add i32 %tmp.10, %tmp.2 ; <i32> [#uses=1]
- %tmp.11 = add i32 %tmp.7, %tmp.6 ; <i32> [#uses=1]
- ret i32 %tmp.11
-}
-
diff --git a/release_23/test/CodeGen/X86/2006-03-02-InstrSchedBug.ll b/release_23/test/CodeGen/X86/2006-03-02-InstrSchedBug.ll
deleted file mode 100644
index c410c4668a9b..000000000000
--- a/release_23/test/CodeGen/X86/2006-03-02-InstrSchedBug.ll
+++ /dev/null
@@ -1,12 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -stats |& \
-; RUN: grep asm-printer | grep 7
-
-define i32 @g(i32 %a, i32 %b) nounwind {
- %tmp.1 = shl i32 %b, 1 ; <i32> [#uses=1]
- %tmp.3 = add i32 %tmp.1, %a ; <i32> [#uses=1]
- %tmp.5 = mul i32 %tmp.3, %a ; <i32> [#uses=1]
- %tmp.8 = mul i32 %b, %b ; <i32> [#uses=1]
- %tmp.9 = add i32 %tmp.5, %tmp.8 ; <i32> [#uses=1]
- ret i32 %tmp.9
-}
-
diff --git a/release_23/test/CodeGen/X86/2006-04-04-CrossBlockCrash.ll b/release_23/test/CodeGen/X86/2006-04-04-CrossBlockCrash.ll
deleted file mode 100644
index 743790cad033..000000000000
--- a/release_23/test/CodeGen/X86/2006-04-04-CrossBlockCrash.ll
+++ /dev/null
@@ -1,50 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -mcpu=yonah
-; END.
-
-target datalayout = "e-p:32:32"
-target triple = "i686-apple-darwin8.6.1"
- %struct.GLTColor4 = type { float, float, float, float }
- %struct.GLTCoord3 = type { float, float, float }
- %struct.__GLIContextRec = type { { %struct.anon, { [24 x [16 x float]], [24 x [16 x float]] }, %struct.GLTColor4, { float, float, float, float, %struct.GLTCoord3, float } }, { float, float, float, float, float, float, float, float, [4 x i32], [4 x i32], [4 x i32] } }
- %struct.__GLvertex = type { %struct.GLTColor4, %struct.GLTColor4, %struct.GLTColor4, %struct.GLTColor4, %struct.GLTColor4, %struct.GLTCoord3, float, %struct.GLTColor4, float, float, float, i8, i8, i8, i8, [4 x float], [2 x i8*], i32, i32, [16 x %struct.GLTColor4] }
- %struct.anon = type { float, float, float, float, float, float, float, float }
-
-declare <4 x float> @llvm.x86.sse.cmp.ps(<4 x float>, <4 x float>, i8)
-
-declare <4 x i32> @llvm.x86.sse2.packssdw.128(<4 x i32>, <4 x i32>)
-
-declare i32 @llvm.x86.sse2.pmovmskb.128(<16 x i8>)
-
-define void @gleLLVMVecInterpolateClip() {
-entry:
- br i1 false, label %cond_false, label %cond_false183
-cond_false: ; preds = %entry
- br i1 false, label %cond_false183, label %cond_true69
-cond_true69: ; preds = %cond_false
- ret void
-cond_false183: ; preds = %cond_false, %entry
- %vuizmsk.0.1 = phi <4 x i32> [ < i32 -1, i32 -1, i32 -1, i32 0 >, %entry ], [ < i32 -1, i32 0, i32 0, i32 0 >, %cond_false ] ; <<4 x i32>> [#uses=2]
- %tmp192 = extractelement <4 x i32> %vuizmsk.0.1, i32 2 ; <i32> [#uses=1]
- %tmp193 = extractelement <4 x i32> %vuizmsk.0.1, i32 3 ; <i32> [#uses=2]
- %tmp195 = insertelement <4 x i32> zeroinitializer, i32 %tmp192, i32 1 ; <<4 x i32>> [#uses=1]
- %tmp196 = insertelement <4 x i32> %tmp195, i32 %tmp193, i32 2 ; <<4 x i32>> [#uses=1]
- %tmp197 = insertelement <4 x i32> %tmp196, i32 %tmp193, i32 3 ; <<4 x i32>> [#uses=1]
- %tmp336 = and <4 x i32> zeroinitializer, %tmp197 ; <<4 x i32>> [#uses=1]
- %tmp337 = bitcast <4 x i32> %tmp336 to <4 x float> ; <<4 x float>> [#uses=1]
- %tmp378 = tail call <4 x float> @llvm.x86.sse.cmp.ps( <4 x float> %tmp337, <4 x float> zeroinitializer, i8 1 ) ; <<4 x float>> [#uses=1]
- %tmp379 = bitcast <4 x float> %tmp378 to <4 x i32> ; <<4 x i32>> [#uses=1]
- %tmp388 = tail call <4 x i32> @llvm.x86.sse2.packssdw.128( <4 x i32> zeroinitializer, <4 x i32> %tmp379 ) ; <<4 x i32>> [#uses=1]
- %tmp392 = bitcast <4 x i32> %tmp388 to <8 x i16> ; <<8 x i16>> [#uses=1]
- %tmp399 = extractelement <8 x i16> %tmp392, i32 7 ; <i16> [#uses=1]
- %tmp423 = insertelement <8 x i16> zeroinitializer, i16 %tmp399, i32 7 ; <<8 x i16>> [#uses=1]
- %tmp427 = bitcast <8 x i16> %tmp423 to <16 x i8> ; <<16 x i8>> [#uses=1]
- %tmp428 = tail call i32 @llvm.x86.sse2.pmovmskb.128( <16 x i8> %tmp427 ) ; <i32> [#uses=1]
- %tmp432 = trunc i32 %tmp428 to i8 ; <i8> [#uses=1]
- %tmp = and i8 %tmp432, 42 ; <i8> [#uses=1]
- %tmp436 = bitcast i8 %tmp to i8 ; <i8> [#uses=1]
- %tmp446 = zext i8 %tmp436 to i32 ; <i32> [#uses=1]
- %tmp447 = shl i32 %tmp446, 24 ; <i32> [#uses=1]
- %tmp449 = or i32 0, %tmp447 ; <i32> [#uses=1]
- store i32 %tmp449, i32* null
- ret void
-}
diff --git a/release_23/test/CodeGen/X86/2006-04-27-ISelFoldingBug.ll b/release_23/test/CodeGen/X86/2006-04-27-ISelFoldingBug.ll
deleted file mode 100644
index 1a72a20a4f2b..000000000000
--- a/release_23/test/CodeGen/X86/2006-04-27-ISelFoldingBug.ll
+++ /dev/null
@@ -1,32 +0,0 @@
-; RUN: llvm-as < %s | \
-; RUN: llc -march=x86 -mtriple=i686-apple-darwin8 -relocation-model=static | \
-; RUN: grep {movl _last} | count 1
-; RUN: llvm-as < %s | \
-; RUN: llc -march=x86 -mtriple=i686-apple-darwin8 -relocation-model=static | \
-; RUN: grep {cmpl.*_last} | count 1
-
-@block = external global i8* ; <i8**> [#uses=1]
-@last = external global i32 ; <i32*> [#uses=3]
-
-define i1 @loadAndRLEsource_no_exit_2E_1_label_2E_0(i32 %tmp.21.reload, i32 %tmp.8) {
-newFuncRoot:
- br label %label.0
-label.0.no_exit.1_crit_edge.exitStub: ; preds = %label.0
- ret i1 true
-codeRepl5.exitStub: ; preds = %label.0
- ret i1 false
-label.0: ; preds = %newFuncRoot
- %tmp.35 = load i32* @last ; <i32> [#uses=1]
- %inc.1 = add i32 %tmp.35, 1 ; <i32> [#uses=2]
- store i32 %inc.1, i32* @last
- %tmp.36 = load i8** @block ; <i8*> [#uses=1]
- %tmp.38 = getelementptr i8* %tmp.36, i32 %inc.1 ; <i8*> [#uses=1]
- %tmp.40 = trunc i32 %tmp.21.reload to i8 ; <i8> [#uses=1]
- store i8 %tmp.40, i8* %tmp.38
- %tmp.910 = load i32* @last ; <i32> [#uses=1]
- %tmp.1111 = icmp slt i32 %tmp.910, %tmp.8 ; <i1> [#uses=1]
- %tmp.1412 = icmp ne i32 %tmp.21.reload, 257 ; <i1> [#uses=1]
- %tmp.1613 = and i1 %tmp.1111, %tmp.1412 ; <i1> [#uses=1]
- br i1 %tmp.1613, label %label.0.no_exit.1_crit_edge.exitStub, label %codeRepl5.exitStub
-}
-
diff --git a/release_23/test/CodeGen/X86/2006-05-01-SchedCausingSpills.ll b/release_23/test/CodeGen/X86/2006-05-01-SchedCausingSpills.ll
deleted file mode 100644
index f28366699c3d..000000000000
--- a/release_23/test/CodeGen/X86/2006-05-01-SchedCausingSpills.ll
+++ /dev/null
@@ -1,76 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -mcpu=yonah -stats |& \
-; RUN: not grep {Number of register spills}
-; END.
-
-
-define i32 @foo(<4 x float>* %a, <4 x float>* %b, <4 x float>* %c, <4 x float>* %d) {
- %tmp44 = load <4 x float>* %a ; <<4 x float>> [#uses=9]
- %tmp46 = load <4 x float>* %b ; <<4 x float>> [#uses=1]
- %tmp48 = load <4 x float>* %c ; <<4 x float>> [#uses=1]
- %tmp50 = load <4 x float>* %d ; <<4 x float>> [#uses=1]
- %tmp51 = bitcast <4 x float> %tmp44 to <4 x i32> ; <<4 x i32>> [#uses=1]
- %tmp = shufflevector <4 x i32> %tmp51, <4 x i32> undef, <4 x i32> < i32 3, i32 3, i32 3, i32 3 > ; <<4 x i32>> [#uses=2]
- %tmp52 = bitcast <4 x i32> %tmp to <4 x float> ; <<4 x float>> [#uses=1]
- %tmp60 = xor <4 x i32> %tmp, < i32 -2147483648, i32 -2147483648, i32 -2147483648, i32 -2147483648 > ; <<4 x i32>> [#uses=1]
- %tmp61 = bitcast <4 x i32> %tmp60 to <4 x float> ; <<4 x float>> [#uses=1]
- %tmp74 = tail call <4 x float> @llvm.x86.sse.cmp.ps( <4 x float> %tmp52, <4 x float> %tmp44, i8 1 ) ; <<4 x float>> [#uses=1]
- %tmp75 = bitcast <4 x float> %tmp74 to <4 x i32> ; <<4 x i32>> [#uses=1]
- %tmp88 = tail call <4 x float> @llvm.x86.sse.cmp.ps( <4 x float> %tmp44, <4 x float> %tmp61, i8 1 ) ; <<4 x float>> [#uses=1]
- %tmp89 = bitcast <4 x float> %tmp88 to <4 x i32> ; <<4 x i32>> [#uses=1]
- %tmp98 = tail call <4 x i32> @llvm.x86.sse2.packssdw.128( <4 x i32> %tmp75, <4 x i32> %tmp89 ) ; <<4 x i32>> [#uses=1]
- %tmp102 = bitcast <4 x i32> %tmp98 to <8 x i16> ; <<8 x i16>> [#uses=1]
- %tmp.upgrd.1 = shufflevector <8 x i16> %tmp102, <8 x i16> undef, <8 x i32> < i32 0, i32 1, i32 2, i32 3, i32 6, i32 5, i32 4, i32 7 > ; <<8 x i16>> [#uses=1]
- %tmp105 = shufflevector <8 x i16> %tmp.upgrd.1, <8 x i16> undef, <8 x i32> < i32 2, i32 1, i32 0, i32 3, i32 4, i32 5, i32 6, i32 7 > ; <<8 x i16>> [#uses=1]
- %tmp105.upgrd.2 = bitcast <8 x i16> %tmp105 to <4 x float> ; <<4 x float>> [#uses=1]
- store <4 x float> %tmp105.upgrd.2, <4 x float>* %a
- %tmp108 = bitcast <4 x float> %tmp46 to <4 x i32> ; <<4 x i32>> [#uses=1]
- %tmp109 = shufflevector <4 x i32> %tmp108, <4 x i32> undef, <4 x i32> < i32 3, i32 3, i32 3, i32 3 > ; <<4 x i32>> [#uses=2]
- %tmp109.upgrd.3 = bitcast <4 x i32> %tmp109 to <4 x float> ; <<4 x float>> [#uses=1]
- %tmp119 = xor <4 x i32> %tmp109, < i32 -2147483648, i32 -2147483648, i32 -2147483648, i32 -2147483648 > ; <<4 x i32>> [#uses=1]
- %tmp120 = bitcast <4 x i32> %tmp119 to <4 x float> ; <<4 x float>> [#uses=1]
- %tmp133 = tail call <4 x float> @llvm.x86.sse.cmp.ps( <4 x float> %tmp109.upgrd.3, <4 x float> %tmp44, i8 1 ) ; <<4 x float>> [#uses=1]
- %tmp134 = bitcast <4 x float> %tmp133 to <4 x i32> ; <<4 x i32>> [#uses=1]
- %tmp147 = tail call <4 x float> @llvm.x86.sse.cmp.ps( <4 x float> %tmp44, <4 x float> %tmp120, i8 1 ) ; <<4 x float>> [#uses=1]
- %tmp148 = bitcast <4 x float> %tmp147 to <4 x i32> ; <<4 x i32>> [#uses=1]
- %tmp159 = tail call <4 x i32> @llvm.x86.sse2.packssdw.128( <4 x i32> %tmp134, <4 x i32> %tmp148 ) ; <<4 x i32>> [#uses=1]
- %tmp163 = bitcast <4 x i32> %tmp159 to <8 x i16> ; <<8 x i16>> [#uses=1]
- %tmp164 = shufflevector <8 x i16> %tmp163, <8 x i16> undef, <8 x i32> < i32 0, i32 1, i32 2, i32 3, i32 6, i32 5, i32 4, i32 7 > ; <<8 x i16>> [#uses=1]
- %tmp166 = shufflevector <8 x i16> %tmp164, <8 x i16> undef, <8 x i32> < i32 2, i32 1, i32 0, i32 3, i32 4, i32 5, i32 6, i32 7 > ; <<8 x i16>> [#uses=1]
- %tmp166.upgrd.4 = bitcast <8 x i16> %tmp166 to <4 x float> ; <<4 x float>> [#uses=1]
- store <4 x float> %tmp166.upgrd.4, <4 x float>* %b
- %tmp169 = bitcast <4 x float> %tmp48 to <4 x i32> ; <<4 x i32>> [#uses=1]
- %tmp170 = shufflevector <4 x i32> %tmp169, <4 x i32> undef, <4 x i32> < i32 3, i32 3, i32 3, i32 3 > ; <<4 x i32>> [#uses=2]
- %tmp170.upgrd.5 = bitcast <4 x i32> %tmp170 to <4 x float> ; <<4 x float>> [#uses=1]
- %tmp180 = xor <4 x i32> %tmp170, < i32 -2147483648, i32 -2147483648, i32 -2147483648, i32 -2147483648 > ; <<4 x i32>> [#uses=1]
- %tmp181 = bitcast <4 x i32> %tmp180 to <4 x float> ; <<4 x float>> [#uses=1]
- %tmp194 = tail call <4 x float> @llvm.x86.sse.cmp.ps( <4 x float> %tmp170.upgrd.5, <4 x float> %tmp44, i8 1 ) ; <<4 x float>> [#uses=1]
- %tmp195 = bitcast <4 x float> %tmp194 to <4 x i32> ; <<4 x i32>> [#uses=1]
- %tmp208 = tail call <4 x float> @llvm.x86.sse.cmp.ps( <4 x float> %tmp44, <4 x float> %tmp181, i8 1 ) ; <<4 x float>> [#uses=1]
- %tmp209 = bitcast <4 x float> %tmp208 to <4 x i32> ; <<4 x i32>> [#uses=1]
- %tmp220 = tail call <4 x i32> @llvm.x86.sse2.packssdw.128( <4 x i32> %tmp195, <4 x i32> %tmp209 ) ; <<4 x i32>> [#uses=1]
- %tmp224 = bitcast <4 x i32> %tmp220 to <8 x i16> ; <<8 x i16>> [#uses=1]
- %tmp225 = shufflevector <8 x i16> %tmp224, <8 x i16> undef, <8 x i32> < i32 0, i32 1, i32 2, i32 3, i32 6, i32 5, i32 4, i32 7 > ; <<8 x i16>> [#uses=1]
- %tmp227 = shufflevector <8 x i16> %tmp225, <8 x i16> undef, <8 x i32> < i32 2, i32 1, i32 0, i32 3, i32 4, i32 5, i32 6, i32 7 > ; <<8 x i16>> [#uses=1]
- %tmp227.upgrd.6 = bitcast <8 x i16> %tmp227 to <4 x float> ; <<4 x float>> [#uses=1]
- store <4 x float> %tmp227.upgrd.6, <4 x float>* %c
- %tmp230 = bitcast <4 x float> %tmp50 to <4 x i32> ; <<4 x i32>> [#uses=1]
- %tmp231 = shufflevector <4 x i32> %tmp230, <4 x i32> undef, <4 x i32> < i32 3, i32 3, i32 3, i32 3 > ; <<4 x i32>> [#uses=2]
- %tmp231.upgrd.7 = bitcast <4 x i32> %tmp231 to <4 x float> ; <<4 x float>> [#uses=1]
- %tmp241 = xor <4 x i32> %tmp231, < i32 -2147483648, i32 -2147483648, i32 -2147483648, i32 -2147483648 > ; <<4 x i32>> [#uses=1]
- %tmp242 = bitcast <4 x i32> %tmp241 to <4 x float> ; <<4 x float>> [#uses=1]
- %tmp255 = tail call <4 x float> @llvm.x86.sse.cmp.ps( <4 x float> %tmp231.upgrd.7, <4 x float> %tmp44, i8 1 ) ; <<4 x float>> [#uses=1]
- %tmp256 = bitcast <4 x float> %tmp255 to <4 x i32> ; <<4 x i32>> [#uses=1]
- %tmp269 = tail call <4 x float> @llvm.x86.sse.cmp.ps( <4 x float> %tmp44, <4 x float> %tmp242, i8 1 ) ; <<4 x float>> [#uses=1]
- %tmp270 = bitcast <4 x float> %tmp269 to <4 x i32> ; <<4 x i32>> [#uses=1]
- %tmp281 = tail call <4 x i32> @llvm.x86.sse2.packssdw.128( <4 x i32> %tmp256, <4 x i32> %tmp270 ) ; <<4 x i32>> [#uses=1]
- %tmp285 = bitcast <4 x i32> %tmp281 to <8 x i16> ; <<8 x i16>> [#uses=1]
- %tmp286 = shufflevector <8 x i16> %tmp285, <8 x i16> undef, <8 x i32> < i32 0, i32 1, i32 2, i32 3, i32 6, i32 5, i32 4, i32 7 > ; <<8 x i16>> [#uses=1]
- %tmp288 = shufflevector <8 x i16> %tmp286, <8 x i16> undef, <8 x i32> < i32 2, i32 1, i32 0, i32 3, i32 4, i32 5, i32 6, i32 7 > ; <<8 x i16>> [#uses=1]
- %tmp288.upgrd.8 = bitcast <8 x i16> %tmp288 to <4 x float> ; <<4 x float>> [#uses=1]
- store <4 x float> %tmp288.upgrd.8, <4 x float>* %d
- ret i32 0
-}
-
-declare <4 x float> @llvm.x86.sse.cmp.ps(<4 x float>, <4 x float>, i8)
-
-declare <4 x i32> @llvm.x86.sse2.packssdw.128(<4 x i32>, <4 x i32>)
diff --git a/release_23/test/CodeGen/X86/2006-05-02-InstrSched1.ll b/release_23/test/CodeGen/X86/2006-05-02-InstrSched1.ll
deleted file mode 100644
index 72dab39888f1..000000000000
--- a/release_23/test/CodeGen/X86/2006-05-02-InstrSched1.ll
+++ /dev/null
@@ -1,24 +0,0 @@
-; RUN: llvm-as < %s | \
-; RUN: llc -march=x86 -relocation-model=static -stats |& \
-; RUN: grep asm-printer | grep 14
-;
-@size20 = external global i32 ; <i32*> [#uses=1]
-@in5 = external global i8* ; <i8**> [#uses=1]
-
-define i32 @compare(i8* %a, i8* %b) nounwind {
- %tmp = bitcast i8* %a to i32* ; <i32*> [#uses=1]
- %tmp1 = bitcast i8* %b to i32* ; <i32*> [#uses=1]
- %tmp.upgrd.1 = load i32* @size20 ; <i32> [#uses=1]
- %tmp.upgrd.2 = load i8** @in5 ; <i8*> [#uses=2]
- %tmp3 = load i32* %tmp1 ; <i32> [#uses=1]
- %gep.upgrd.3 = zext i32 %tmp3 to i64 ; <i64> [#uses=1]
- %tmp4 = getelementptr i8* %tmp.upgrd.2, i64 %gep.upgrd.3 ; <i8*> [#uses=2]
- %tmp7 = load i32* %tmp ; <i32> [#uses=1]
- %gep.upgrd.4 = zext i32 %tmp7 to i64 ; <i64> [#uses=1]
- %tmp8 = getelementptr i8* %tmp.upgrd.2, i64 %gep.upgrd.4 ; <i8*> [#uses=2]
- %tmp.upgrd.5 = tail call i32 @memcmp( i8* %tmp8, i8* %tmp4, i32 %tmp.upgrd.1 ) ; <i32> [#uses=1]
- ret i32 %tmp.upgrd.5
-}
-
-declare i32 @memcmp(i8*, i8*, i32)
-
diff --git a/release_23/test/CodeGen/X86/2006-05-02-InstrSched2.ll b/release_23/test/CodeGen/X86/2006-05-02-InstrSched2.ll
deleted file mode 100644
index 48ed2b9cb498..000000000000
--- a/release_23/test/CodeGen/X86/2006-05-02-InstrSched2.ll
+++ /dev/null
@@ -1,24 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -stats |& \
-; RUN: grep asm-printer | grep 13
-
-define void @_ZN9__gnu_cxx9hashtableISt4pairIKPKciES3_NS_4hashIS3_EESt10_Select1stIS5_E5eqstrSaIiEE14find_or_insertERKS5__cond_true456.i(i8* %tmp435.i, i32* %tmp449.i.out) nounwind {
-newFuncRoot:
- br label %cond_true456.i
-bb459.i.exitStub: ; preds = %cond_true456.i
- store i32 %tmp449.i, i32* %tmp449.i.out
- ret void
-cond_true456.i: ; preds = %cond_true456.i, %newFuncRoot
- %__s441.2.4.i = phi i8* [ %tmp451.i.upgrd.1, %cond_true456.i ], [ %tmp435.i, %newFuncRoot ] ; <i8*> [#uses=2]
- %__h.2.4.i = phi i32 [ %tmp449.i, %cond_true456.i ], [ 0, %newFuncRoot ] ; <i32> [#uses=1]
- %tmp446.i = mul i32 %__h.2.4.i, 5 ; <i32> [#uses=1]
- %tmp.i = load i8* %__s441.2.4.i ; <i8> [#uses=1]
- %tmp448.i = sext i8 %tmp.i to i32 ; <i32> [#uses=1]
- %tmp449.i = add i32 %tmp448.i, %tmp446.i ; <i32> [#uses=2]
- %tmp450.i = ptrtoint i8* %__s441.2.4.i to i32 ; <i32> [#uses=1]
- %tmp451.i = add i32 %tmp450.i, 1 ; <i32> [#uses=1]
- %tmp451.i.upgrd.1 = inttoptr i32 %tmp451.i to i8* ; <i8*> [#uses=2]
- %tmp45435.i = load i8* %tmp451.i.upgrd.1 ; <i8> [#uses=1]
- %tmp45536.i = icmp eq i8 %tmp45435.i, 0 ; <i1> [#uses=1]
- br i1 %tmp45536.i, label %bb459.i.exitStub, label %cond_true456.i
-}
-
diff --git a/release_23/test/CodeGen/X86/2006-05-08-CoalesceSubRegClass.ll b/release_23/test/CodeGen/X86/2006-05-08-CoalesceSubRegClass.ll
deleted file mode 100644
index 900abe55cd21..000000000000
--- a/release_23/test/CodeGen/X86/2006-05-08-CoalesceSubRegClass.ll
+++ /dev/null
@@ -1,25 +0,0 @@
-; Coalescing from R32 to a subset R32_. Once another register coalescer bug is
-; fixed, the movb should go away as well.
-
-; RUN: llvm-as < %s | llc -march=x86 -relocation-model=static | \
-; RUN: grep movl
-
-@B = external global i32 ; <i32*> [#uses=2]
-@C = external global i16* ; <i16**> [#uses=2]
-
-define void @test(i32 %A) {
- %A.upgrd.1 = trunc i32 %A to i8 ; <i8> [#uses=1]
- %tmp2 = load i32* @B ; <i32> [#uses=1]
- %tmp3 = and i8 %A.upgrd.1, 16 ; <i8> [#uses=1]
- %shift.upgrd.2 = zext i8 %tmp3 to i32 ; <i32> [#uses=1]
- %tmp4 = shl i32 %tmp2, %shift.upgrd.2 ; <i32> [#uses=1]
- store i32 %tmp4, i32* @B
- %tmp6 = lshr i32 %A, 3 ; <i32> [#uses=1]
- %tmp = load i16** @C ; <i16*> [#uses=1]
- %tmp8 = ptrtoint i16* %tmp to i32 ; <i32> [#uses=1]
- %tmp9 = add i32 %tmp8, %tmp6 ; <i32> [#uses=1]
- %tmp9.upgrd.3 = inttoptr i32 %tmp9 to i16* ; <i16*> [#uses=1]
- store i16* %tmp9.upgrd.3, i16** @C
- ret void
-}
-
diff --git a/release_23/test/CodeGen/X86/2006-05-08-InstrSched.ll b/release_23/test/CodeGen/X86/2006-05-08-InstrSched.ll
deleted file mode 100644
index c39b377cc733..000000000000
--- a/release_23/test/CodeGen/X86/2006-05-08-InstrSched.ll
+++ /dev/null
@@ -1,26 +0,0 @@
-; RUN: llvm-as < %s | \
-; RUN: llc -march=x86 -relocation-model=static | not grep {subl.*%esp}
-
-@A = external global i16* ; <i16**> [#uses=1]
-@B = external global i32 ; <i32*> [#uses=1]
-@C = external global i32 ; <i32*> [#uses=2]
-
-define void @test() {
- %tmp = load i16** @A ; <i16*> [#uses=1]
- %tmp1 = getelementptr i16* %tmp, i32 1 ; <i16*> [#uses=1]
- %tmp.upgrd.1 = load i16* %tmp1 ; <i16> [#uses=1]
- %tmp3 = zext i16 %tmp.upgrd.1 to i32 ; <i32> [#uses=1]
- %tmp.upgrd.2 = load i32* @B ; <i32> [#uses=1]
- %tmp4 = and i32 %tmp.upgrd.2, 16 ; <i32> [#uses=1]
- %tmp5 = load i32* @C ; <i32> [#uses=1]
- %tmp6 = trunc i32 %tmp4 to i8 ; <i8> [#uses=2]
- %shift.upgrd.3 = zext i8 %tmp6 to i32 ; <i32> [#uses=1]
- %tmp7 = shl i32 %tmp5, %shift.upgrd.3 ; <i32> [#uses=1]
- %tmp9 = xor i8 %tmp6, 16 ; <i8> [#uses=1]
- %shift.upgrd.4 = zext i8 %tmp9 to i32 ; <i32> [#uses=1]
- %tmp11 = lshr i32 %tmp3, %shift.upgrd.4 ; <i32> [#uses=1]
- %tmp12 = or i32 %tmp11, %tmp7 ; <i32> [#uses=1]
- store i32 %tmp12, i32* @C
- ret void
-}
-
diff --git a/release_23/test/CodeGen/X86/2006-05-11-InstrSched.ll b/release_23/test/CodeGen/X86/2006-05-11-InstrSched.ll
deleted file mode 100644
index 9d1d324fcec3..000000000000
--- a/release_23/test/CodeGen/X86/2006-05-11-InstrSched.ll
+++ /dev/null
@@ -1,55 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 -stats -realign-stack=0 |&\
-; RUN: grep {asm-printer} | grep 32
-
-target datalayout = "e-p:32:32"
-define void @foo(i32* %mc, i32* %bp, i32* %ms, i32* %xmb, i32* %mpp, i32* %tpmm, i32* %ip, i32* %tpim, i32* %dpp, i32* %tpdm, i32* %bpi, i32 %M) nounwind {
-entry:
- %tmp9 = icmp slt i32 %M, 5 ; <i1> [#uses=1]
- br i1 %tmp9, label %return, label %cond_true
-
-cond_true: ; preds = %cond_true, %entry
- %indvar = phi i32 [ 0, %entry ], [ %indvar.next, %cond_true ] ; <i32> [#uses=2]
- %tmp. = shl i32 %indvar, 2 ; <i32> [#uses=1]
- %tmp.10 = add i32 %tmp., 1 ; <i32> [#uses=2]
- %k.0.0 = bitcast i32 %tmp.10 to i32 ; <i32> [#uses=2]
- %tmp31 = add i32 %k.0.0, -1 ; <i32> [#uses=4]
- %tmp32 = getelementptr i32* %mpp, i32 %tmp31 ; <i32*> [#uses=1]
- %tmp34 = bitcast i32* %tmp32 to i8* ; <i8*> [#uses=1]
- %tmp = tail call <16 x i8> @llvm.x86.sse2.loadu.dq( i8* %tmp34 ) ; <<16 x i8>> [#uses=1]
- %tmp42 = getelementptr i32* %tpmm, i32 %tmp31 ; <i32*> [#uses=1]
- %tmp42.upgrd.1 = bitcast i32* %tmp42 to <4 x i32>* ; <<4 x i32>*> [#uses=1]
- %tmp46 = load <4 x i32>* %tmp42.upgrd.1 ; <<4 x i32>> [#uses=1]
- %tmp54 = bitcast <16 x i8> %tmp to <4 x i32> ; <<4 x i32>> [#uses=1]
- %tmp55 = add <4 x i32> %tmp54, %tmp46 ; <<4 x i32>> [#uses=2]
- %tmp55.upgrd.2 = bitcast <4 x i32> %tmp55 to <2 x i64> ; <<2 x i64>> [#uses=1]
- %tmp62 = getelementptr i32* %ip, i32 %tmp31 ; <i32*> [#uses=1]
- %tmp65 = bitcast i32* %tmp62 to i8* ; <i8*> [#uses=1]
- %tmp66 = tail call <16 x i8> @llvm.x86.sse2.loadu.dq( i8* %tmp65 ) ; <<16 x i8>> [#uses=1]
- %tmp73 = getelementptr i32* %tpim, i32 %tmp31 ; <i32*> [#uses=1]
- %tmp73.upgrd.3 = bitcast i32* %tmp73 to <4 x i32>* ; <<4 x i32>*> [#uses=1]
- %tmp77 = load <4 x i32>* %tmp73.upgrd.3 ; <<4 x i32>> [#uses=1]
- %tmp87 = bitcast <16 x i8> %tmp66 to <4 x i32> ; <<4 x i32>> [#uses=1]
- %tmp88 = add <4 x i32> %tmp87, %tmp77 ; <<4 x i32>> [#uses=2]
- %tmp88.upgrd.4 = bitcast <4 x i32> %tmp88 to <2 x i64> ; <<2 x i64>> [#uses=1]
- %tmp99 = tail call <4 x i32> @llvm.x86.sse2.pcmpgt.d( <4 x i32> %tmp88, <4 x i32> %tmp55 ) ; <<4 x i32>> [#uses=1]
- %tmp99.upgrd.5 = bitcast <4 x i32> %tmp99 to <2 x i64> ; <<2 x i64>> [#uses=2]
- %tmp110 = xor <2 x i64> %tmp99.upgrd.5, < i64 -1, i64 -1 > ; <<2 x i64>> [#uses=1]
- %tmp111 = and <2 x i64> %tmp110, %tmp55.upgrd.2 ; <<2 x i64>> [#uses=1]
- %tmp121 = and <2 x i64> %tmp99.upgrd.5, %tmp88.upgrd.4 ; <<2 x i64>> [#uses=1]
- %tmp131 = or <2 x i64> %tmp121, %tmp111 ; <<2 x i64>> [#uses=1]
- %gep.upgrd.6 = zext i32 %tmp.10 to i64 ; <i64> [#uses=1]
- %tmp137 = getelementptr i32* %mc, i64 %gep.upgrd.6 ; <i32*> [#uses=1]
- %tmp137.upgrd.7 = bitcast i32* %tmp137 to <2 x i64>* ; <<2 x i64>*> [#uses=1]
- store <2 x i64> %tmp131, <2 x i64>* %tmp137.upgrd.7
- %tmp147 = add i32 %k.0.0, 8 ; <i32> [#uses=1]
- %tmp.upgrd.8 = icmp sgt i32 %tmp147, %M ; <i1> [#uses=1]
- %indvar.next = add i32 %indvar, 1 ; <i32> [#uses=1]
- br i1 %tmp.upgrd.8, label %return, label %cond_true
-
-return: ; preds = %cond_true, %entry
- ret void
-}
-
-declare <16 x i8> @llvm.x86.sse2.loadu.dq(i8*)
-
-declare <4 x i32> @llvm.x86.sse2.pcmpgt.d(<4 x i32>, <4 x i32>)
diff --git a/release_23/test/CodeGen/X86/2006-05-17-VectorArg.ll b/release_23/test/CodeGen/X86/2006-05-17-VectorArg.ll
deleted file mode 100644
index 217cbe1059f2..000000000000
--- a/release_23/test/CodeGen/X86/2006-05-17-VectorArg.ll
+++ /dev/null
@@ -1,15 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2
-
-define <4 x float> @opRSQ(<4 x float> %a) nounwind {
-entry:
- %tmp2 = extractelement <4 x float> %a, i32 3 ; <float> [#uses=2]
- %abscond = fcmp oge float %tmp2, -0.000000e+00 ; <i1> [#uses=1]
- %abs = select i1 %abscond, float %tmp2, float 0.000000e+00 ; <float> [#uses=1]
- %tmp3 = tail call float @llvm.sqrt.f32( float %abs ) ; <float> [#uses=1]
- %tmp4 = fdiv float 1.000000e+00, %tmp3 ; <float> [#uses=1]
- %tmp11 = insertelement <4 x float> zeroinitializer, float %tmp4, i32 3 ; <<4 x float>> [#uses=1]
- ret <4 x float> %tmp11
-}
-
-declare float @llvm.sqrt.f32(float)
-
diff --git a/release_23/test/CodeGen/X86/2006-05-22-FPSetEQ.ll b/release_23/test/CodeGen/X86/2006-05-22-FPSetEQ.ll
deleted file mode 100644
index ae18c90d8c17..000000000000
--- a/release_23/test/CodeGen/X86/2006-05-22-FPSetEQ.ll
+++ /dev/null
@@ -1,10 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 | grep setnp
-; RUN: llvm-as < %s | llc -march=x86 -enable-unsafe-fp-math | \
-; RUN: not grep setnp
-
-define i32 @test(float %f) {
- %tmp = fcmp oeq float %f, 0.000000e+00 ; <i1> [#uses=1]
- %tmp.upgrd.1 = zext i1 %tmp to i32 ; <i32> [#uses=1]
- ret i32 %tmp.upgrd.1
-}
-
diff --git a/release_23/test/CodeGen/X86/2006-05-25-CycleInDAG.ll b/release_23/test/CodeGen/X86/2006-05-25-CycleInDAG.ll
deleted file mode 100644
index c9a004965fd7..000000000000
--- a/release_23/test/CodeGen/X86/2006-05-25-CycleInDAG.ll
+++ /dev/null
@@ -1,20 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86
-
-define i32 @test() {
- br i1 false, label %cond_next33, label %cond_true12
-cond_true12: ; preds = %0
- ret i32 0
-cond_next33: ; preds = %0
- %tmp44.i = call double @foo( double 0.000000e+00, i32 32 ) ; <double> [#uses=1]
- %tmp61.i = load i8* null ; <i8> [#uses=1]
- %tmp61.i.upgrd.1 = zext i8 %tmp61.i to i32 ; <i32> [#uses=1]
- %tmp58.i = or i32 0, %tmp61.i.upgrd.1 ; <i32> [#uses=1]
- %tmp62.i = or i32 %tmp58.i, 0 ; <i32> [#uses=1]
- %tmp62.i.upgrd.2 = sitofp i32 %tmp62.i to double ; <double> [#uses=1]
- %tmp64.i = add double %tmp62.i.upgrd.2, %tmp44.i ; <double> [#uses=1]
- %tmp68.i = call double @foo( double %tmp64.i, i32 0 ) ; <double> [#uses=0]
- ret i32 0
-}
-
-declare double @foo(double, i32)
-
diff --git a/release_23/test/CodeGen/X86/2006-07-10-InlineAsmAConstraint.ll b/release_23/test/CodeGen/X86/2006-07-10-InlineAsmAConstraint.ll
deleted file mode 100644
index 760fe3650e90..000000000000
--- a/release_23/test/CodeGen/X86/2006-07-10-InlineAsmAConstraint.ll
+++ /dev/null
@@ -1,8 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86
-; PR825
-
-define i64 @test() {
- %tmp.i5 = call i64 asm sideeffect "rdtsc", "=A,~{dirflag},~{fpsr},~{flags}"( ) ; <i64> [#uses=1]
- ret i64 %tmp.i5
-}
-
diff --git a/release_23/test/CodeGen/X86/2006-07-12-InlineAsmQConstraint.ll b/release_23/test/CodeGen/X86/2006-07-12-InlineAsmQConstraint.ll
deleted file mode 100644
index 1db3921ecdb1..000000000000
--- a/release_23/test/CodeGen/X86/2006-07-12-InlineAsmQConstraint.ll
+++ /dev/null
@@ -1,12 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86
-; PR828
-
-target datalayout = "e-p:32:32"
-target triple = "i686-pc-linux-gnu"
-
-define void @_ZN5() {
-cond_true9:
- %tmp3.i.i = call i32 asm sideeffect "lock; cmpxchg $1,$2", "={ax},q,m,0,~{dirflag},~{fpsr},~{flags},~{memory}"( i32 0, i32* null, i32 0 ) ; <i32> [#uses=0]
- ret void
-}
-
diff --git a/release_23/test/CodeGen/X86/2006-07-19-ATTAsm.ll b/release_23/test/CodeGen/X86/2006-07-19-ATTAsm.ll
deleted file mode 100644
index 1724f2b2fffd..000000000000
--- a/release_23/test/CodeGen/X86/2006-07-19-ATTAsm.ll
+++ /dev/null
@@ -1,48 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -x86-asm-syntax=att
-; PR834
-; END.
-
-target datalayout = "e-p:32:32"
-target triple = "i386-unknown-freebsd6.1"
- %llvm.dbg.anchor.type = type { i32, i32 }
- %llvm.dbg.basictype.type = type { i32, { }*, i8*, { }*, i32, i64, i64, i64, i32, i32 }
- %llvm.dbg.compile_unit.type = type { i32, { }*, i32, i8*, i8*, i8* }
- %llvm.dbg.global_variable.type = type { i32, { }*, { }*, i8*, i8*, { }*, i32, { }*, i1, i1, { }* }
-@x = global i32 0 ; <i32*> [#uses=1]
-@llvm.dbg.global_variable = internal constant %llvm.dbg.global_variable.type {
- i32 327732,
- { }* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.global_variables to { }*),
- { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*),
- i8* getelementptr ([2 x i8]* @str, i64 0, i64 0),
- i8* null,
- { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*),
- i32 1,
- { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype to { }*),
- i1 false,
- i1 true,
- { }* bitcast (i32* @x to { }*) }, section "llvm.metadata" ; <%llvm.dbg.global_variable.type*> [#uses=0]
-@llvm.dbg.global_variables = linkonce constant %llvm.dbg.anchor.type { i32 327680, i32 52 }, section "llvm.metadata" ; <%llvm.dbg.anchor.type*> [#uses=1]
-@llvm.dbg.compile_unit = internal constant %llvm.dbg.compile_unit.type {
- i32 327697,
- { }* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.compile_units to { }*),
- i32 4,
- i8* getelementptr ([10 x i8]* @str1, i64 0, i64 0),
- i8* getelementptr ([32 x i8]* @str2, i64 0, i64 0),
- i8* getelementptr ([45 x i8]* @str3, i64 0, i64 0) }, section "llvm.metadata" ; <%llvm.dbg.compile_unit.type*> [#uses=1]
-@llvm.dbg.compile_units = linkonce constant %llvm.dbg.anchor.type { i32 327680, i32 17 }, section "llvm.metadata" ; <%llvm.dbg.anchor.type*> [#uses=1]
-@str1 = internal constant [10 x i8] c"testb.cpp\00", section "llvm.metadata" ; <[10 x i8]*> [#uses=1]
-@str2 = internal constant [32 x i8] c"/Sources/Projects/DwarfTesting/\00", section "llvm.metadata" ; <[32 x i8]*> [#uses=1]
-@str3 = internal constant [45 x i8] c"4.0.1 LLVM (Apple Computer, Inc. build 5400)\00", section "llvm.metadata" ; <[45 x i8]*> [#uses=1]
-@str = internal constant [2 x i8] c"x\00", section "llvm.metadata" ; <[2 x i8]*> [#uses=1]
-@llvm.dbg.basictype = internal constant %llvm.dbg.basictype.type {
- i32 327716,
- { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*),
- i8* getelementptr ([4 x i8]* @str4, i64 0, i64 0),
- { }* null,
- i32 0,
- i64 32,
- i64 32,
- i64 0,
- i32 0,
- i32 5 }, section "llvm.metadata" ; <%llvm.dbg.basictype.type*> [#uses=1]
-@str4 = internal constant [4 x i8] c"int\00", section "llvm.metadata" ; <[4 x i8]*> [#uses=1]
diff --git a/release_23/test/CodeGen/X86/2006-07-20-InlineAsm.ll b/release_23/test/CodeGen/X86/2006-07-20-InlineAsm.ll
deleted file mode 100644
index 08510a8a6528..000000000000
--- a/release_23/test/CodeGen/X86/2006-07-20-InlineAsm.ll
+++ /dev/null
@@ -1,23 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86
-; PR833
-
-@G = weak global i32 0 ; <i32*> [#uses=3]
-
-define i32 @foo(i32 %X) {
-entry:
- %X_addr = alloca i32 ; <i32*> [#uses=3]
- store i32 %X, i32* %X_addr
- call void asm sideeffect "xchg{l} {$0,$1|$1,$0}", "=*m,=*r,m,1,~{dirflag},~{fpsr},~{flags}"( i32* @G, i32* %X_addr, i32* @G, i32 %X )
- %tmp1 = load i32* %X_addr ; <i32> [#uses=1]
- ret i32 %tmp1
-}
-
-define i32 @foo2(i32 %X) {
-entry:
- %X_addr = alloca i32 ; <i32*> [#uses=3]
- store i32 %X, i32* %X_addr
- call void asm sideeffect "xchg{l} {$0,$1|$1,$0}", "=*m,=*r,1,~{dirflag},~{fpsr},~{flags}"( i32* @G, i32* %X_addr, i32 %X )
- %tmp1 = load i32* %X_addr ; <i32> [#uses=1]
- ret i32 %tmp1
-}
-
diff --git a/release_23/test/CodeGen/X86/2006-07-28-AsmPrint-Long-As-Pointer.ll b/release_23/test/CodeGen/X86/2006-07-28-AsmPrint-Long-As-Pointer.ll
deleted file mode 100644
index a82612b5a62a..000000000000
--- a/release_23/test/CodeGen/X86/2006-07-28-AsmPrint-Long-As-Pointer.ll
+++ /dev/null
@@ -1,5 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 | grep -- 4294967240
-; PR853
-
-@X = global i32* inttoptr (i64 -56 to i32*) ; <i32**> [#uses=0]
-
diff --git a/release_23/test/CodeGen/X86/2006-07-31-SingleRegClass.ll b/release_23/test/CodeGen/X86/2006-07-31-SingleRegClass.ll
deleted file mode 100644
index 561aff3307e1..000000000000
--- a/release_23/test/CodeGen/X86/2006-07-31-SingleRegClass.ll
+++ /dev/null
@@ -1,11 +0,0 @@
-; PR850
-; RUN: llvm-as < %s | llc -march=x86 -x86-asm-syntax=att | \
-; RUN: grep {movl 4(%eax),%ebp}
-; RUN: llvm-as < %s | llc -march=x86 -x86-asm-syntax=att | \
-; RUN: grep {movl 0(%eax), %ebx}
-
-define i32 @foo(i32 %__s.i.i, i32 %tmp5.i.i, i32 %tmp6.i.i, i32 %tmp7.i.i, i32 %tmp8.i.i) {
- %tmp9.i.i = call i32 asm sideeffect "push %ebp\0Apush %ebx\0Amovl 4($2),%ebp\0Amovl 0($2), %ebx\0Amovl $1,%eax\0Aint $$0x80\0Apop %ebx\0Apop %ebp", "={ax},i,0,{cx},{dx},{si},{di}"( i32 192, i32 %__s.i.i, i32 %tmp5.i.i, i32 %tmp6.i.i, i32 %tmp7.i.i, i32 %tmp8.i.i ) ; <i32> [#uses=1]
- ret i32 %tmp9.i.i
-}
-
diff --git a/release_23/test/CodeGen/X86/2006-08-07-CycleInDAG.ll b/release_23/test/CodeGen/X86/2006-08-07-CycleInDAG.ll
deleted file mode 100644
index 194cd6681bfa..000000000000
--- a/release_23/test/CodeGen/X86/2006-08-07-CycleInDAG.ll
+++ /dev/null
@@ -1,31 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2
- %struct.foo = type opaque
-
-define fastcc i32 @test(%struct.foo* %v, %struct.foo* %vi) {
- br i1 false, label %ilog2.exit, label %cond_true.i
-
-cond_true.i: ; preds = %0
- ret i32 0
-
-ilog2.exit: ; preds = %0
- %tmp24.i = load i32* null ; <i32> [#uses=1]
- %tmp13.i12.i = tail call double @ldexp( double 0.000000e+00, i32 0 ) ; <double> [#uses=1]
- %tmp13.i13.i = fptrunc double %tmp13.i12.i to float ; <float> [#uses=1]
- %tmp11.s = load i32* null ; <i32> [#uses=1]
- %tmp11.i = bitcast i32 %tmp11.s to i32 ; <i32> [#uses=1]
- %n.i = bitcast i32 %tmp24.i to i32 ; <i32> [#uses=1]
- %tmp13.i7 = mul i32 %tmp11.i, %n.i ; <i32> [#uses=1]
- %tmp.i8 = tail call i8* @calloc( i32 %tmp13.i7, i32 4 ) ; <i8*> [#uses=0]
- br i1 false, label %bb224.preheader.i, label %bb.i
-
-bb.i: ; preds = %ilog2.exit
- ret i32 0
-
-bb224.preheader.i: ; preds = %ilog2.exit
- %tmp165.i = fpext float %tmp13.i13.i to double ; <double> [#uses=0]
- ret i32 0
-}
-
-declare i8* @calloc(i32, i32)
-
-declare double @ldexp(double, i32)
diff --git a/release_23/test/CodeGen/X86/2006-08-16-CycleInDAG.ll b/release_23/test/CodeGen/X86/2006-08-16-CycleInDAG.ll
deleted file mode 100644
index f2a8855245cc..000000000000
--- a/release_23/test/CodeGen/X86/2006-08-16-CycleInDAG.ll
+++ /dev/null
@@ -1,23 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86
- %struct.expr = type { %struct.rtx_def*, i32, %struct.expr*, %struct.occr*, %struct.occr*, %struct.rtx_def* }
- %struct.hash_table = type { %struct.expr**, i32, i32, i32 }
- %struct.occr = type { %struct.occr*, %struct.rtx_def*, i8, i8 }
- %struct.rtx_def = type { i16, i8, i8, %struct.u }
- %struct.u = type { [1 x i64] }
-
-define void @test() {
- %tmp = load i32* null ; <i32> [#uses=1]
- %tmp8 = call i32 @hash_rtx( ) ; <i32> [#uses=1]
- %tmp11 = urem i32 %tmp8, %tmp ; <i32> [#uses=1]
- br i1 false, label %cond_next, label %return
-
-cond_next: ; preds = %0
- %gep.upgrd.1 = zext i32 %tmp11 to i64 ; <i64> [#uses=1]
- %tmp17 = getelementptr %struct.expr** null, i64 %gep.upgrd.1 ; <%struct.expr**> [#uses=0]
- ret void
-
-return: ; preds = %0
- ret void
-}
-
-declare i32 @hash_rtx()
diff --git a/release_23/test/CodeGen/X86/2006-08-21-ExtraMovInst.ll b/release_23/test/CodeGen/X86/2006-08-21-ExtraMovInst.ll
deleted file mode 100644
index c1d81d52b932..000000000000
--- a/release_23/test/CodeGen/X86/2006-08-21-ExtraMovInst.ll
+++ /dev/null
@@ -1,17 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -mcpu=i386 | \
-; RUN: not grep {movl %eax, %edx}
-
-define i32 @foo(i32 %t, i32 %C) {
-entry:
- br label %cond_true
-
-cond_true: ; preds = %cond_true, %entry
- %t_addr.0.0 = phi i32 [ %t, %entry ], [ %tmp7, %cond_true ] ; <i32> [#uses=2]
- %tmp7 = add i32 %t_addr.0.0, 1 ; <i32> [#uses=1]
- %tmp = icmp sgt i32 %C, 39 ; <i1> [#uses=1]
- br i1 %tmp, label %bb12, label %cond_true
-
-bb12: ; preds = %cond_true
- ret i32 %t_addr.0.0
-}
-
diff --git a/release_23/test/CodeGen/X86/2006-09-01-CycleInDAG.ll b/release_23/test/CodeGen/X86/2006-09-01-CycleInDAG.ll
deleted file mode 100644
index dd21c0455d6d..000000000000
--- a/release_23/test/CodeGen/X86/2006-09-01-CycleInDAG.ll
+++ /dev/null
@@ -1,131 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86
-target datalayout = "e-p:32:32"
-target triple = "i686-apple-darwin8"
- %struct.CUMULATIVE_ARGS = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 }
- %struct.FILE = type { i8*, i32, i32, i16, i16, %struct.__sbuf, i32, i8*, i32 (i8*)*, i32 (i8*, i8*, i32)*, i64 (i8*, i64, i32)*, i32 (i8*, i8*, i32)*, %struct.__sbuf, %struct.__sFILEX*, i32, [3 x i8], [1 x i8], %struct.__sbuf, i32, i64 }
- %struct.VEC_edge = type { i32, i32, [1 x %struct.edge_def*] }
- %struct.VEC_tree = type { i32, i32, [1 x %struct.tree_node*] }
- %struct.__sFILEX = type opaque
- %struct.__sbuf = type { i8*, i32 }
- %struct._obstack_chunk = type { i8*, %struct._obstack_chunk*, [4 x i8] }
- %struct._var_map = type { %struct.partition_def*, i32*, i32*, %struct.tree_node**, i32, i32, i32* }
- %struct.basic_block_def = type { %struct.rtx_def*, %struct.rtx_def*, %struct.tree_node*, %struct.VEC_edge*, %struct.VEC_edge*, %struct.bitmap_head_def*, %struct.bitmap_head_def*, i8*, %struct.loop*, [2 x %struct.et_node*], %struct.basic_block_def*, %struct.basic_block_def*, %struct.reorder_block_def*, %struct.bb_ann_d*, i64, i32, i32, i32, i32 }
- %struct.bb_ann_d = type { %struct.tree_node*, i8, %struct.edge_prediction* }
- %struct.bitmap_element_def = type { %struct.bitmap_element_def*, %struct.bitmap_element_def*, i32, [4 x i32] }
- %struct.bitmap_head_def = type { %struct.bitmap_element_def*, %struct.bitmap_element_def*, i32, %struct.bitmap_obstack* }
- %struct.bitmap_iterator = type { %struct.bitmap_element_def*, %struct.bitmap_element_def*, i32, i32 }
- %struct.bitmap_obstack = type { %struct.bitmap_element_def*, %struct.bitmap_head_def*, %struct.obstack }
- %struct.block_stmt_iterator = type { %struct.tree_stmt_iterator, %struct.basic_block_def* }
- %struct.coalesce_list_d = type { %struct._var_map*, %struct.partition_pair_d**, i1 }
- %struct.conflict_graph_def = type opaque
- %struct.dataflow_d = type { %struct.varray_head_tag*, [2 x %struct.tree_node*] }
- %struct.def_operand_ptr = type { %struct.tree_node** }
- %struct.def_optype_d = type { i32, [1 x %struct.def_operand_ptr] }
- %struct.die_struct = type opaque
- %struct.edge_def = type { %struct.basic_block_def*, %struct.basic_block_def*, %struct.edge_def_insns, i8*, %struct.__sbuf*, i32, i32, i64, i32 }
- %struct.edge_def_insns = type { %struct.rtx_def* }
- %struct.edge_iterator = type { i32, %struct.VEC_edge** }
- %struct.edge_prediction = type { %struct.edge_prediction*, %struct.edge_def*, i32, i32 }
- %struct.eh_status = type opaque
- %struct.elt_list = type opaque
- %struct.emit_status = type { i32, i32, %struct.rtx_def*, %struct.rtx_def*, %struct.sequence_stack*, i32, %struct.__sbuf, i32, i8*, %struct.rtx_def** }
- %struct.et_node = type opaque
- %struct.expr_status = type { i32, i32, i32, %struct.rtx_def*, %struct.rtx_def*, %struct.rtx_def* }
- %struct.function = type { %struct.eh_status*, %struct.expr_status*, %struct.emit_status*, %struct.varasm_status*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.function*, i32, i32, i32, i32, %struct.rtx_def*, %struct.CUMULATIVE_ARGS, %struct.rtx_def*, %struct.rtx_def*, %struct.initial_value_struct*, %struct.rtx_def*, %struct.rtx_def*, %struct.rtx_def*, %struct.rtx_def*, %struct.rtx_def*, %struct.rtx_def*, i8, i32, i64, %struct.tree_node*, %struct.tree_node*, %struct.rtx_def*, %struct.varray_head_tag*, %struct.temp_slot*, i32, %struct.var_refs_queue*, i32, i32, %struct.rtvec_def*, %struct.tree_node*, i32, i32, i32, %struct.machine_function*, i32, i32, i1, i1, %struct.language_function*, %struct.rtx_def*, i32, i32, i32, i32, %struct.__sbuf, %struct.varray_head_tag*, %struct.tree_node*, i8, i8, i8 }
- %struct.ht_identifier = type { i8*, i32, i32 }
- %struct.initial_value_struct = type opaque
- %struct.lang_decl = type opaque
- %struct.lang_type = type opaque
- %struct.language_function = type opaque
- %struct.location_t = type { i8*, i32 }
- %struct.loop = type opaque
- %struct.machine_function = type { i32, i32, i8*, i32, i32 }
- %struct.obstack = type { i32, %struct._obstack_chunk*, i8*, i8*, i8*, i32, i32, %struct._obstack_chunk* (i8*, i32)*, void (i8*, %struct._obstack_chunk*)*, i8*, i8 }
- %struct.partition_def = type { i32, [1 x %struct.partition_elem] }
- %struct.partition_elem = type { i32, %struct.partition_elem*, i32 }
- %struct.partition_pair_d = type { i32, i32, i32, %struct.partition_pair_d* }
- %struct.phi_arg_d = type { %struct.tree_node*, i1 }
- %struct.pointer_set_t = type opaque
- %struct.ptr_info_def = type { i8, %struct.bitmap_head_def*, %struct.tree_node* }
- %struct.real_value = type opaque
- %struct.reg_info_def = type opaque
- %struct.reorder_block_def = type { %struct.rtx_def*, %struct.rtx_def*, %struct.basic_block_def*, %struct.basic_block_def*, %struct.basic_block_def*, i32, i32, i32 }
- %struct.rtvec_def = type opaque
- %struct.rtx_def = type opaque
- %struct.sequence_stack = type { %struct.rtx_def*, %struct.rtx_def*, %struct.sequence_stack* }
- %struct.simple_bitmap_def = type { i32, i32, i32, [1 x i64] }
- %struct.ssa_op_iter = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, %struct.stmt_operands_d*, i1 }
- %struct.stmt_ann_d = type { %struct.tree_ann_common_d, i8, %struct.basic_block_def*, %struct.stmt_operands_d, %struct.dataflow_d*, %struct.bitmap_head_def*, i32 }
- %struct.stmt_operands_d = type { %struct.def_optype_d*, %struct.def_optype_d*, %struct.v_may_def_optype_d*, %struct.vuse_optype_d*, %struct.v_may_def_optype_d* }
- %struct.temp_slot = type opaque
- %struct.tree_ann_common_d = type { i32, i8*, %struct.tree_node* }
- %struct.tree_ann_d = type { %struct.stmt_ann_d }
- %struct.tree_binfo = type { %struct.tree_common, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.VEC_tree*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.VEC_tree }
- %struct.tree_block = type { %struct.tree_common, i8, [3 x i8], %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node* }
- %struct.tree_common = type { %struct.tree_node*, %struct.tree_node*, %struct.tree_ann_d*, i8, i8, i8, i8, i8 }
- %struct.tree_complex = type { %struct.tree_common, %struct.tree_node*, %struct.tree_node* }
- %struct.tree_decl = type { %struct.tree_common, %struct.__sbuf, i32, %struct.tree_node*, i8, i8, i8, i8, i8, i8, i8, i32, %struct.tree_decl_u1, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.rtx_def*, i32, %struct.tree_decl_u2, %struct.tree_node*, %struct.tree_node*, i64, %struct.lang_decl* }
- %struct.tree_decl_u1 = type { i64 }
- %struct.tree_decl_u1_a = type { i32 }
- %struct.tree_decl_u2 = type { %struct.function* }
- %struct.tree_exp = type { %struct.tree_common, %struct.__sbuf*, i32, %struct.tree_node*, [1 x %struct.tree_node*] }
- %struct.tree_identifier = type { %struct.tree_common, %struct.ht_identifier }
- %struct.tree_int_cst = type { %struct.tree_common, %struct.tree_int_cst_lowhi }
- %struct.tree_int_cst_lowhi = type { i64, i64 }
- %struct.tree_list = type { %struct.tree_common, %struct.tree_node*, %struct.tree_node* }
- %struct.tree_live_info_d = type { %struct._var_map*, %struct.bitmap_head_def*, %struct.bitmap_head_def**, i32, %struct.bitmap_head_def** }
- %struct.tree_node = type { %struct.tree_decl }
- %struct.tree_partition_associator_d = type { %struct.varray_head_tag*, %struct.varray_head_tag*, i32*, i32*, i32, i32, %struct._var_map* }
- %struct.tree_phi_node = type { %struct.tree_common, %struct.tree_node*, i32, i32, i32, %struct.basic_block_def*, %struct.dataflow_d*, [1 x %struct.phi_arg_d] }
- %struct.tree_real_cst = type { %struct.tree_common, %struct.real_value* }
- %struct.tree_ssa_name = type { %struct.tree_common, %struct.tree_node*, i32, %struct.ptr_info_def*, %struct.tree_node*, i8* }
- %struct.tree_statement_list = type { %struct.tree_common, %struct.tree_statement_list_node*, %struct.tree_statement_list_node* }
- %struct.tree_statement_list_node = type { %struct.tree_statement_list_node*, %struct.tree_statement_list_node*, %struct.tree_node* }
- %struct.tree_stmt_iterator = type { %struct.tree_statement_list_node*, %struct.tree_node* }
- %struct.tree_string = type { %struct.tree_common, i32, [1 x i8] }
- %struct.tree_type = type { %struct.tree_common, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, i32, i16, i8, i8, i32, %struct.tree_node*, %struct.tree_node*, %struct.tree_decl_u1_a, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, i64, %struct.lang_type* }
- %struct.tree_type_symtab = type { i32 }
- %struct.tree_value_handle = type { %struct.tree_common, %struct.value_set*, i32 }
- %struct.tree_vec = type { %struct.tree_common, i32, [1 x %struct.tree_node*] }
- %struct.tree_vector = type { %struct.tree_common, %struct.tree_node* }
- %struct.use_operand_ptr = type { %struct.tree_node** }
- %struct.use_optype_d = type { i32, [1 x %struct.def_operand_ptr] }
- %struct.v_def_use_operand_type_t = type { %struct.tree_node*, %struct.tree_node* }
- %struct.v_may_def_optype_d = type { i32, [1 x %struct.v_def_use_operand_type_t] }
- %struct.v_must_def_optype_d = type { i32, [1 x %struct.v_def_use_operand_type_t] }
- %struct.value_set = type opaque
- %struct.var_ann_d = type { %struct.tree_ann_common_d, i8, i8, %struct.tree_node*, %struct.varray_head_tag*, i32, i32, i32, %struct.tree_node*, %struct.tree_node* }
- %struct.var_refs_queue = type { %struct.rtx_def*, i32, i32, %struct.var_refs_queue* }
- %struct.varasm_status = type opaque
- %struct.varray_data = type { [1 x i64] }
- %struct.varray_head_tag = type { i32, i32, i32, i8*, %struct.varray_data }
- %struct.vuse_optype_d = type { i32, [1 x %struct.tree_node*] }
-@basic_block_info = external global %struct.varray_head_tag* ; <%struct.varray_head_tag**> [#uses=1]
-
-define void @calculate_live_on_entry_cond_true3632(%struct.varray_head_tag* %stack3023.6, i32* %tmp3629, %struct.VEC_edge*** %tmp3397.out) {
-newFuncRoot:
- br label %cond_true3632
-
-bb3502.exitStub: ; preds = %cond_true3632
- store %struct.VEC_edge** %tmp3397, %struct.VEC_edge*** %tmp3397.out
- ret void
-
-cond_true3632: ; preds = %newFuncRoot
- %tmp3378 = load i32* %tmp3629 ; <i32> [#uses=1]
- %tmp3379 = add i32 %tmp3378, -1 ; <i32> [#uses=1]
- %tmp3381 = getelementptr %struct.varray_head_tag* %stack3023.6, i32 0, i32 4 ; <%struct.varray_data*> [#uses=1]
- %tmp3382 = bitcast %struct.varray_data* %tmp3381 to [1 x i32]* ; <[1 x i32]*> [#uses=1]
- %gep.upgrd.1 = zext i32 %tmp3379 to i64 ; <i64> [#uses=1]
- %tmp3383 = getelementptr [1 x i32]* %tmp3382, i32 0, i64 %gep.upgrd.1 ; <i32*> [#uses=1]
- %tmp3384 = load i32* %tmp3383 ; <i32> [#uses=1]
- %tmp3387 = load i32* %tmp3629 ; <i32> [#uses=1]
- %tmp3388 = add i32 %tmp3387, -1 ; <i32> [#uses=1]
- store i32 %tmp3388, i32* %tmp3629
- %tmp3391 = load %struct.varray_head_tag** @basic_block_info ; <%struct.varray_head_tag*> [#uses=1]
- %tmp3393 = getelementptr %struct.varray_head_tag* %tmp3391, i32 0, i32 4 ; <%struct.varray_data*> [#uses=1]
- %tmp3394 = bitcast %struct.varray_data* %tmp3393 to [1 x %struct.basic_block_def*]* ; <[1 x %struct.basic_block_def*]*> [#uses=1]
- %tmp3395 = getelementptr [1 x %struct.basic_block_def*]* %tmp3394, i32 0, i32 %tmp3384 ; <%struct.basic_block_def**> [#uses=1]
- %tmp3396 = load %struct.basic_block_def** %tmp3395 ; <%struct.basic_block_def*> [#uses=1]
- %tmp3397 = getelementptr %struct.basic_block_def* %tmp3396, i32 0, i32 3 ; <%struct.VEC_edge**> [#uses=1]
- br label %bb3502.exitStub
-}
diff --git a/release_23/test/CodeGen/X86/2006-10-02-BoolRetCrash.ll b/release_23/test/CodeGen/X86/2006-10-02-BoolRetCrash.ll
deleted file mode 100644
index cc988f26618c..000000000000
--- a/release_23/test/CodeGen/X86/2006-10-02-BoolRetCrash.ll
+++ /dev/null
@@ -1,7 +0,0 @@
-; RUN: llvm-as < %s | llc
-; PR933
-
-define fastcc i1 @test() {
- ret i1 true
-}
-
diff --git a/release_23/test/CodeGen/X86/2006-10-07-ScalarSSEMiscompile.ll b/release_23/test/CodeGen/X86/2006-10-07-ScalarSSEMiscompile.ll
deleted file mode 100644
index e8055f5f901f..000000000000
--- a/release_23/test/CodeGen/X86/2006-10-07-ScalarSSEMiscompile.ll
+++ /dev/null
@@ -1,15 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -mattr=sse | grep movaps
-; Test that the load is NOT folded into the intrinsic, which would zero the top
-; elts of the loaded vector.
-
-target datalayout = "e-p:32:32"
-target triple = "i686-apple-darwin8.7.2"
-
-define <4 x float> @test(<4 x float> %A, <4 x float>* %B) {
- %BV = load <4 x float>* %B ; <<4 x float>> [#uses=1]
- %tmp28 = tail call <4 x float> @llvm.x86.sse.sub.ss( <4 x float> %A, <4 x float> %BV ) ; <<4 x float>> [#uses=1]
- ret <4 x float> %tmp28
-}
-
-declare <4 x float> @llvm.x86.sse.sub.ss(<4 x float>, <4 x float>)
-
diff --git a/release_23/test/CodeGen/X86/2006-10-09-CycleInDAG.ll b/release_23/test/CodeGen/X86/2006-10-09-CycleInDAG.ll
deleted file mode 100644
index d627d1bf214c..000000000000
--- a/release_23/test/CodeGen/X86/2006-10-09-CycleInDAG.ll
+++ /dev/null
@@ -1,11 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86
-
-define void @_ZN13QFSFileEngine4readEPcx() {
- %tmp201 = load i32* null ; <i32> [#uses=1]
- %tmp201.upgrd.1 = sext i32 %tmp201 to i64 ; <i64> [#uses=1]
- %tmp202 = load i64* null ; <i64> [#uses=1]
- %tmp203 = add i64 %tmp201.upgrd.1, %tmp202 ; <i64> [#uses=1]
- store i64 %tmp203, i64* null
- ret void
-}
-
diff --git a/release_23/test/CodeGen/X86/2006-10-10-FindModifiedNodeSlotBug.ll b/release_23/test/CodeGen/X86/2006-10-10-FindModifiedNodeSlotBug.ll
deleted file mode 100644
index 5dc1cb3d9a2d..000000000000
--- a/release_23/test/CodeGen/X86/2006-10-10-FindModifiedNodeSlotBug.ll
+++ /dev/null
@@ -1,28 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 | grep shrl
-; Bug in FindModifiedNodeSlot cause tmp14 load to become a zextload and shr 31
-; is then optimized away.
-@tree_code_type = external global [0 x i32] ; <[0 x i32]*> [#uses=1]
-
-define void @copy_if_shared_r() {
- %tmp = load i32* null ; <i32> [#uses=1]
- %tmp56 = and i32 %tmp, 255 ; <i32> [#uses=1]
- %gep.upgrd.1 = zext i32 %tmp56 to i64 ; <i64> [#uses=1]
- %tmp8 = getelementptr [0 x i32]* @tree_code_type, i32 0, i64 %gep.upgrd.1 ; <i32*> [#uses=1]
- %tmp9 = load i32* %tmp8 ; <i32> [#uses=1]
- %tmp10 = add i32 %tmp9, -1 ; <i32> [#uses=1]
- %tmp.upgrd.2 = icmp ugt i32 %tmp10, 2 ; <i1> [#uses=1]
- %tmp14 = load i32* null ; <i32> [#uses=1]
- %tmp15 = lshr i32 %tmp14, 31 ; <i32> [#uses=1]
- %tmp15.upgrd.3 = trunc i32 %tmp15 to i8 ; <i8> [#uses=1]
- %tmp16 = icmp ne i8 %tmp15.upgrd.3, 0 ; <i1> [#uses=1]
- br i1 %tmp.upgrd.2, label %cond_false25, label %cond_true
-cond_true: ; preds = %0
- br i1 %tmp16, label %cond_true17, label %cond_false
-cond_true17: ; preds = %cond_true
- ret void
-cond_false: ; preds = %cond_true
- ret void
-cond_false25: ; preds = %0
- ret void
-}
-
diff --git a/release_23/test/CodeGen/X86/2006-10-12-CycleInDAG.ll b/release_23/test/CodeGen/X86/2006-10-12-CycleInDAG.ll
deleted file mode 100644
index 31eb070e85b9..000000000000
--- a/release_23/test/CodeGen/X86/2006-10-12-CycleInDAG.ll
+++ /dev/null
@@ -1,41 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86
- %struct.function = type opaque
- %struct.lang_decl = type opaque
- %struct.location_t = type { i8*, i32 }
- %struct.rtx_def = type opaque
- %struct.tree_common = type { %struct.tree_node*, %struct.tree_node*, %union.tree_ann_d*, i8, i8, i8, i8, i8 }
- %struct.tree_decl = type { %struct.tree_common, %struct.location_t, i32, %struct.tree_node*, i8, i8, i8, i8, i8, i8, i8, i8, i32, %struct.tree_decl_u1, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.rtx_def*, i32, %struct.tree_decl_u2, %struct.tree_node*, %struct.tree_node*, i64, %struct.lang_decl* }
- %struct.tree_decl_u1 = type { i64 }
- %struct.tree_decl_u2 = type { %struct.function* }
- %struct.tree_node = type { %struct.tree_decl }
- %union.tree_ann_d = type opaque
-
-define void @check_format_arg() {
- br i1 false, label %cond_next196, label %bb12.preheader
-
-bb12.preheader: ; preds = %0
- ret void
-
-cond_next196: ; preds = %0
- br i1 false, label %cond_next330, label %cond_true304
-
-cond_true304: ; preds = %cond_next196
- ret void
-
-cond_next330: ; preds = %cond_next196
- br i1 false, label %cond_next472, label %bb441
-
-bb441: ; preds = %cond_next330
- ret void
-
-cond_next472: ; preds = %cond_next330
- %tmp490 = load %struct.tree_node** null ; <%struct.tree_node*> [#uses=1]
- %tmp492 = getelementptr %struct.tree_node* %tmp490, i32 0, i32 0, i32 0, i32 3 ; <i8*> [#uses=1]
- %tmp492.upgrd.1 = bitcast i8* %tmp492 to i32* ; <i32*> [#uses=1]
- %tmp493 = load i32* %tmp492.upgrd.1 ; <i32> [#uses=1]
- %tmp495 = trunc i32 %tmp493 to i8 ; <i8> [#uses=1]
- %tmp496 = icmp eq i8 %tmp495, 11 ; <i1> [#uses=1]
- %tmp496.upgrd.2 = zext i1 %tmp496 to i8 ; <i8> [#uses=1]
- store i8 %tmp496.upgrd.2, i8* null
- ret void
-}
diff --git a/release_23/test/CodeGen/X86/2006-10-13-CycleInDAG.ll b/release_23/test/CodeGen/X86/2006-10-13-CycleInDAG.ll
deleted file mode 100644
index 2b53f26f578e..000000000000
--- a/release_23/test/CodeGen/X86/2006-10-13-CycleInDAG.ll
+++ /dev/null
@@ -1,19 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86
-@str = external global [18 x i8] ; <[18 x i8]*> [#uses=1]
-
-define void @test() {
-bb.i:
- %tmp.i660 = load <4 x float>* null ; <<4 x float>> [#uses=1]
- call void (i32, ...)* @printf( i32 0, i8* getelementptr ([18 x i8]* @str, i32 0, i64 0), double 0.000000e+00, double 0.000000e+00, double 0.000000e+00, double 0.000000e+00 )
- %tmp152.i = load <4 x i32>* null ; <<4 x i32>> [#uses=1]
- %tmp156.i = bitcast <4 x i32> %tmp152.i to <4 x i32> ; <<4 x i32>> [#uses=1]
- %tmp175.i = bitcast <4 x float> %tmp.i660 to <4 x i32> ; <<4 x i32>> [#uses=1]
- %tmp176.i = xor <4 x i32> %tmp156.i, < i32 -1, i32 -1, i32 -1, i32 -1 > ; <<4 x i32>> [#uses=1]
- %tmp177.i = and <4 x i32> %tmp176.i, %tmp175.i ; <<4 x i32>> [#uses=1]
- %tmp190.i = or <4 x i32> %tmp177.i, zeroinitializer ; <<4 x i32>> [#uses=1]
- %tmp191.i = bitcast <4 x i32> %tmp190.i to <4 x float> ; <<4 x float>> [#uses=1]
- store <4 x float> %tmp191.i, <4 x float>* null
- ret void
-}
-
-declare void @printf(i32, ...)
diff --git a/release_23/test/CodeGen/X86/2006-10-19-SwitchUnnecessaryBranching.ll b/release_23/test/CodeGen/X86/2006-10-19-SwitchUnnecessaryBranching.ll
deleted file mode 100644
index e2977276b5d6..000000000000
--- a/release_23/test/CodeGen/X86/2006-10-19-SwitchUnnecessaryBranching.ll
+++ /dev/null
@@ -1,26 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 | %prcontext je 1 | \
-; RUN: grep BB1_1:
-
-@str = internal constant [14 x i8] c"Hello world!\0A\00" ; <[14 x i8]*> [#uses=1]
-@str.upgrd.1 = internal constant [13 x i8] c"Blah world!\0A\00" ; <[13 x i8]*> [#uses=1]
-
-define i32 @main(i32 %argc, i8** %argv) {
-entry:
- switch i32 %argc, label %UnifiedReturnBlock [
- i32 1, label %bb
- i32 2, label %bb2
- ]
-
-bb: ; preds = %entry
- %tmp1 = tail call i32 (i8*, ...)* @printf( i8* getelementptr ([14 x i8]* @str, i32 0, i64 0) ) ; <i32> [#uses=0]
- ret i32 0
-
-bb2: ; preds = %entry
- %tmp4 = tail call i32 (i8*, ...)* @printf( i8* getelementptr ([13 x i8]* @str.upgrd.1, i32 0, i64 0) ) ; <i32> [#uses=0]
- ret i32 0
-
-UnifiedReturnBlock: ; preds = %entry
- ret i32 0
-}
-
-declare i32 @printf(i8*, ...)
diff --git a/release_23/test/CodeGen/X86/2006-11-12-CSRetCC.ll b/release_23/test/CodeGen/X86/2006-11-12-CSRetCC.ll
deleted file mode 100644
index 1a92852f06fe..000000000000
--- a/release_23/test/CodeGen/X86/2006-11-12-CSRetCC.ll
+++ /dev/null
@@ -1,59 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 | grep {subl \$4, %esp}
-
-target triple = "i686-pc-linux-gnu"
-@str = internal constant [9 x i8] c"%f+%f*i\0A\00" ; <[9 x i8]*> [#uses=1]
-
-define i32 @main() {
-entry:
- %retval = alloca i32, align 4 ; <i32*> [#uses=1]
- %tmp = alloca { double, double }, align 16 ; <{ double, double }*> [#uses=4]
- %tmp1 = alloca { double, double }, align 16 ; <{ double, double }*> [#uses=4]
- %tmp2 = alloca { double, double }, align 16 ; <{ double, double }*> [#uses=3]
- %pi = alloca double, align 8 ; <double*> [#uses=2]
- %z = alloca { double, double }, align 16 ; <{ double, double }*> [#uses=4]
- %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
- store double 0x400921FB54442D18, double* %pi
- %tmp.upgrd.1 = load double* %pi ; <double> [#uses=1]
- %real = getelementptr { double, double }* %tmp1, i64 0, i32 0 ; <double*> [#uses=1]
- store double 0.000000e+00, double* %real
- %real3 = getelementptr { double, double }* %tmp1, i64 0, i32 1 ; <double*> [#uses=1]
- store double %tmp.upgrd.1, double* %real3
- %tmp.upgrd.2 = getelementptr { double, double }* %tmp, i64 0, i32 0 ; <double*> [#uses=1]
- %tmp4 = getelementptr { double, double }* %tmp1, i64 0, i32 0 ; <double*> [#uses=1]
- %tmp5 = load double* %tmp4 ; <double> [#uses=1]
- store double %tmp5, double* %tmp.upgrd.2
- %tmp6 = getelementptr { double, double }* %tmp, i64 0, i32 1 ; <double*> [#uses=1]
- %tmp7 = getelementptr { double, double }* %tmp1, i64 0, i32 1 ; <double*> [#uses=1]
- %tmp8 = load double* %tmp7 ; <double> [#uses=1]
- store double %tmp8, double* %tmp6
- %tmp.upgrd.3 = bitcast { double, double }* %tmp to { i64, i64 }* ; <{ i64, i64 }*> [#uses=1]
- %tmp.upgrd.4 = getelementptr { i64, i64 }* %tmp.upgrd.3, i64 0, i32 0 ; <i64*> [#uses=1]
- %tmp.upgrd.5 = load i64* %tmp.upgrd.4 ; <i64> [#uses=1]
- %tmp9 = bitcast { double, double }* %tmp to { i64, i64 }* ; <{ i64, i64 }*> [#uses=1]
- %tmp10 = getelementptr { i64, i64 }* %tmp9, i64 0, i32 1 ; <i64*> [#uses=1]
- %tmp11 = load i64* %tmp10 ; <i64> [#uses=1]
- call void @cexp( { double, double }* sret %tmp2, i64 %tmp.upgrd.5, i64 %tmp11 )
- %tmp12 = getelementptr { double, double }* %z, i64 0, i32 0 ; <double*> [#uses=1]
- %tmp13 = getelementptr { double, double }* %tmp2, i64 0, i32 0 ; <double*> [#uses=1]
- %tmp14 = load double* %tmp13 ; <double> [#uses=1]
- store double %tmp14, double* %tmp12
- %tmp15 = getelementptr { double, double }* %z, i64 0, i32 1 ; <double*> [#uses=1]
- %tmp16 = getelementptr { double, double }* %tmp2, i64 0, i32 1 ; <double*> [#uses=1]
- %tmp17 = load double* %tmp16 ; <double> [#uses=1]
- store double %tmp17, double* %tmp15
- %tmp18 = getelementptr { double, double }* %z, i64 0, i32 1 ; <double*> [#uses=1]
- %tmp19 = load double* %tmp18 ; <double> [#uses=1]
- %tmp20 = getelementptr { double, double }* %z, i64 0, i32 0 ; <double*> [#uses=1]
- %tmp21 = load double* %tmp20 ; <double> [#uses=1]
- %tmp.upgrd.6 = getelementptr [9 x i8]* @str, i32 0, i64 0 ; <i8*> [#uses=1]
- %tmp.upgrd.7 = call i32 (i8*, ...)* @printf( i8* %tmp.upgrd.6, double %tmp21, double %tmp19 ) ; <i32> [#uses=0]
- br label %return
-return: ; preds = %entry
- %retval.upgrd.8 = load i32* %retval ; <i32> [#uses=1]
- ret i32 %retval.upgrd.8
-}
-
-declare void @cexp({ double, double }* sret , i64, i64)
-
-declare i32 @printf(i8*, ...)
-
diff --git a/release_23/test/CodeGen/X86/2006-11-17-IllegalMove.ll b/release_23/test/CodeGen/X86/2006-11-17-IllegalMove.ll
deleted file mode 100644
index 530927af9350..000000000000
--- a/release_23/test/CodeGen/X86/2006-11-17-IllegalMove.ll
+++ /dev/null
@@ -1,43 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86-64 | \
-; RUN: grep movb | count 2
-; RUN: llvm-as < %s | llc -march=x86-64 | \
-; RUN: grep movzbw
-
-
-define void @handle_vector_size_attribute() {
-entry:
- %tmp69 = load i32* null ; <i32> [#uses=1]
- switch i32 %tmp69, label %bb84 [
- i32 2, label %bb77
- i32 1, label %bb77
- ]
-
-bb77: ; preds = %entry, %entry
- %tmp99 = udiv i64 0, 0 ; <i64> [#uses=1]
- %tmp = load i8* null ; <i8> [#uses=1]
- %tmp114 = icmp eq i64 0, 0 ; <i1> [#uses=1]
- br i1 %tmp114, label %cond_true115, label %cond_next136
-
-bb84: ; preds = %entry
- ret void
-
-cond_true115: ; preds = %bb77
- %tmp118 = load i8* null ; <i8> [#uses=1]
- br i1 false, label %cond_next129, label %cond_true120
-
-cond_true120: ; preds = %cond_true115
- %tmp127 = udiv i8 %tmp, %tmp118 ; <i8> [#uses=1]
- %tmp127.upgrd.1 = zext i8 %tmp127 to i64 ; <i64> [#uses=1]
- br label %cond_next129
-
-cond_next129: ; preds = %cond_true120, %cond_true115
- %iftmp.30.0 = phi i64 [ %tmp127.upgrd.1, %cond_true120 ], [ 0, %cond_true115 ] ; <i64> [#uses=1]
- %tmp132 = icmp eq i64 %iftmp.30.0, %tmp99 ; <i1> [#uses=1]
- br i1 %tmp132, label %cond_false148, label %cond_next136
-
-cond_next136: ; preds = %cond_next129, %bb77
- ret void
-
-cond_false148: ; preds = %cond_next129
- ret void
-}
diff --git a/release_23/test/CodeGen/X86/2006-11-27-SelectLegalize.ll b/release_23/test/CodeGen/X86/2006-11-27-SelectLegalize.ll
deleted file mode 100644
index 1222a3743686..000000000000
--- a/release_23/test/CodeGen/X86/2006-11-27-SelectLegalize.ll
+++ /dev/null
@@ -1,9 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 | grep test.*1
-; PR1016
-
-define i32 @test(i32 %A, i32 %B, i32 %C) {
- %a = trunc i32 %A to i1 ; <i1> [#uses=1]
- %D = select i1 %a, i32 %B, i32 %C ; <i32> [#uses=1]
- ret i32 %D
-}
-
diff --git a/release_23/test/CodeGen/X86/2006-11-28-Memcpy.ll b/release_23/test/CodeGen/X86/2006-11-28-Memcpy.ll
deleted file mode 100644
index e0edd2d45aae..000000000000
--- a/release_23/test/CodeGen/X86/2006-11-28-Memcpy.ll
+++ /dev/null
@@ -1,36 +0,0 @@
-; PR1022, PR1023
-; RUN: llvm-as < %s | llc -march=x86 | \
-; RUN: grep 3721182122 | count 2
-; RUN: llvm-as < %s | llc -march=x86 | \
-; RUN: grep -E {movl _?bytes2} | count 1
-
-@fmt = constant [4 x i8] c"%x\0A\00" ; <[4 x i8]*> [#uses=2]
-@bytes = constant [4 x i8] c"\AA\BB\CC\DD" ; <[4 x i8]*> [#uses=1]
-@bytes2 = global [4 x i8] c"\AA\BB\CC\DD" ; <[4 x i8]*> [#uses=1]
-
-define i32 @test1() {
- %y = alloca i32 ; <i32*> [#uses=2]
- %c = bitcast i32* %y to i8* ; <i8*> [#uses=1]
- %z = getelementptr [4 x i8]* @bytes, i32 0, i32 0 ; <i8*> [#uses=1]
- call void @llvm.memcpy.i32( i8* %c, i8* %z, i32 4, i32 1 )
- %r = load i32* %y ; <i32> [#uses=1]
- %t = bitcast [4 x i8]* @fmt to i8* ; <i8*> [#uses=1]
- %tmp = call i32 (i8*, ...)* @printf( i8* %t, i32 %r ) ; <i32> [#uses=0]
- ret i32 0
-}
-
-define void @test2() {
- %y = alloca i32 ; <i32*> [#uses=2]
- %c = bitcast i32* %y to i8* ; <i8*> [#uses=1]
- %z = getelementptr [4 x i8]* @bytes2, i32 0, i32 0 ; <i8*> [#uses=1]
- call void @llvm.memcpy.i32( i8* %c, i8* %z, i32 4, i32 1 )
- %r = load i32* %y ; <i32> [#uses=1]
- %t = bitcast [4 x i8]* @fmt to i8* ; <i8*> [#uses=1]
- %tmp = call i32 (i8*, ...)* @printf( i8* %t, i32 %r ) ; <i32> [#uses=0]
- ret void
-}
-
-declare void @llvm.memcpy.i32(i8*, i8*, i32, i32)
-
-declare i32 @printf(i8*, ...)
-
diff --git a/release_23/test/CodeGen/X86/2006-12-19-IntelSyntax.ll b/release_23/test/CodeGen/X86/2006-12-19-IntelSyntax.ll
deleted file mode 100644
index 17234b827e4c..000000000000
--- a/release_23/test/CodeGen/X86/2006-12-19-IntelSyntax.ll
+++ /dev/null
@@ -1,86 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -x86-asm-syntax=intel
-; PR1061
-target datalayout = "e-p:32:32"
-target triple = "i686-pc-linux-gnu"
-
-define void @bar(i32 %n) {
-entry:
- switch i32 %n, label %bb12 [
- i32 1, label %bb
- i32 2, label %bb6
- i32 4, label %bb7
- i32 5, label %bb8
- i32 6, label %bb10
- i32 7, label %bb1
- i32 8, label %bb3
- i32 9, label %bb4
- i32 10, label %bb9
- i32 11, label %bb2
- i32 12, label %bb5
- i32 13, label %bb11
- ]
-
-bb: ; preds = %entry
- call void (...)* @foo1( )
- ret void
-
-bb1: ; preds = %entry
- call void (...)* @foo2( )
- ret void
-
-bb2: ; preds = %entry
- call void (...)* @foo6( )
- ret void
-
-bb3: ; preds = %entry
- call void (...)* @foo3( )
- ret void
-
-bb4: ; preds = %entry
- call void (...)* @foo4( )
- ret void
-
-bb5: ; preds = %entry
- call void (...)* @foo5( )
- ret void
-
-bb6: ; preds = %entry
- call void (...)* @foo1( )
- ret void
-
-bb7: ; preds = %entry
- call void (...)* @foo2( )
- ret void
-
-bb8: ; preds = %entry
- call void (...)* @foo6( )
- ret void
-
-bb9: ; preds = %entry
- call void (...)* @foo3( )
- ret void
-
-bb10: ; preds = %entry
- call void (...)* @foo4( )
- ret void
-
-bb11: ; preds = %entry
- call void (...)* @foo5( )
- ret void
-
-bb12: ; preds = %entry
- call void (...)* @foo6( )
- ret void
-}
-
-declare void @foo1(...)
-
-declare void @foo2(...)
-
-declare void @foo6(...)
-
-declare void @foo3(...)
-
-declare void @foo4(...)
-
-declare void @foo5(...)
diff --git a/release_23/test/CodeGen/X86/2007-01-08-InstrSched.ll b/release_23/test/CodeGen/X86/2007-01-08-InstrSched.ll
deleted file mode 100644
index 811e9ac6d182..000000000000
--- a/release_23/test/CodeGen/X86/2007-01-08-InstrSched.ll
+++ /dev/null
@@ -1,14 +0,0 @@
-; PR1075
-; RUN: llvm-as < %s | llc -mtriple=x86_64-apple-darwin | \
-; RUN: %prcontext {mulss LCPI1_3} 1 | grep mulss | count 1
-
-define float @foo(float %x) {
- %tmp1 = mul float %x, 3.000000e+00
- %tmp3 = mul float %x, 5.000000e+00
- %tmp5 = mul float %x, 7.000000e+00
- %tmp7 = mul float %x, 1.100000e+01
- %tmp10 = add float %tmp1, %tmp3
- %tmp12 = add float %tmp10, %tmp5
- %tmp14 = add float %tmp12, %tmp7
- ret float %tmp14
-}
diff --git a/release_23/test/CodeGen/X86/2007-01-13-StackPtrIndex.ll b/release_23/test/CodeGen/X86/2007-01-13-StackPtrIndex.ll
deleted file mode 100644
index a9ba7dfd324f..000000000000
--- a/release_23/test/CodeGen/X86/2007-01-13-StackPtrIndex.ll
+++ /dev/null
@@ -1,461 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86-64 | grep leaq
-; RUN: llvm-as < %s | llc -march=x86-64 | not grep {,%rsp)}
-; PR1103
-
-target datalayout = "e-p:64:64"
-@i6000 = global [128 x i64] zeroinitializer, align 16
-
-
-define void @foo(i32* %a0, i32* %a1, i32* %a2, i32* %a3, i32* %a4, i32* %a5) {
-b:
- %r = load i32* %a0
- %r2 = load i32* %a1
- %r4 = load i32* %a2
- %r6 = load i32* %a3
- %r8 = load i32* %a4
- %r14 = load i32* %a5
- %rx = sext i32 %r2 to i64
- %r9 = sext i32 %r to i64
- %r11 = add i64 %rx, 0
- %ras = icmp slt i64 %r11, 0
- %r12 = select i1 %ras, i64 0, i64 %r11
- %r16 = sext i32 %r14 to i64
- %r17 = sext i32 %r8 to i64
- %r18 = sub i64 %r16, 0
- %r19 = add i64 %r18, 0
- %r20 = icmp slt i64 %r19, 0
- %r19h = add i64 %r18, 0
- %r22 = select i1 %r20, i64 1, i64 %r19h
- %r23 = mul i64 %r22, 0
- %r23a = trunc i64 %r23 to i32
- %r24 = shl i32 %r23a, 0
- %r25 = add i32 %r24, 0
- %ras2 = alloca i8, i32 %r25, align 16
- %r28 = getelementptr i8* %ras2, i32 0
- %r38 = shl i64 %r12, 0
- %s2013 = add i64 %r38, 0
- %c22012 = getelementptr i8* %ras2, i64 %s2013
- %r42 = shl i64 %r12, 0
- %s2011 = add i64 %r42, 16
- %c22010 = getelementptr i8* %ras2, i64 %s2011
- %r50 = add i64 %r16, 0
- %r51 = icmp slt i64 %r50, 0
- %r50sh = shl i64 %r50, 0
- %r50j = add i64 %r50sh, 0
- %r54 = select i1 %r51, i64 0, i64 %r50j
- %r56 = mul i64 %r54, %r12
- %r28s = add i64 %r56, 16
- %c2 = getelementptr i8* %ras2, i64 %r28s
- %r60 = sub i32 %r2, %r
- %r61 = icmp slt i32 %r60, 0
- br i1 %r61, label %a29b, label %b63
-a29b:
- %r155 = sub i32 %r6, %r4
- %r156 = icmp slt i32 %r155, 0
- br i1 %r156, label %a109b, label %b158
-b63:
- %r66 = sext i32 %r60 to i64
- %r67 = add i64 %r66, 0
- %r76 = mul i64 %r17, 0
- %r82 = add i64 %r76, 0
- %r84 = icmp slt i64 %r67, 0
- br i1 %r84, label %b85, label %a25b
-b85:
- %e641 = phi i64 [ 0, %b63 ], [ %r129, %a25b ]
- %r137 = icmp slt i64 %e641, 0
- br i1 %r137, label %a25b140q, label %a29b
-a25b140q:
- br label %a25b140
-a25b:
- %w1989 = phi i64 [ 0, %b63 ], [ %v1990, %a25b ]
- %e642 = shl i64 %w1989, 0
- %r129 = add i64 %e642, 0
- %r132 = add i64 %e642, 0
- %r134 = icmp slt i64 %r132, 0
- %v1990 = add i64 %w1989, 0
- br i1 %r134, label %b85, label %a25b
-a25b140:
- %w1982 = phi i64 [ 0, %a25b140q ], [ %v1983, %a25b140 ]
- %r145 = add i64 %r82, 0
- %v1983 = add i64 %w1982, 0
- %u1987 = icmp slt i64 %v1983, 0
- br i1 %u1987, label %a29b, label %a25b140
-b158:
- %r161 = sext i32 %r to i64
- %r163 = sext i32 %r4 to i64
- br label %a29b173
-a29b173:
- %w1964 = phi i64 [ 0, %b158 ], [ %v1973, %b1606 ]
- %b1974 = mul i64 %r163, 0
- %b1975 = add i64 %r161, 0
- %b1976 = mul i64 %w1964, 0
- %b1977 = add i64 %b1976, 0
- %s761 = bitcast i64 %b1977 to i64
- %b1980 = mul i64 %w1964, 0
- %s661 = add i64 %b1980, 0
- br i1 %r61, label %a33b, label %b179
-a33b:
- %r328 = icmp slt i32 %r14, 0
- %r335 = or i1 %r328, %r61
- br i1 %r335, label %a50b, label %b341
-b179:
- %r182 = sext i32 %r60 to i64
- %r183 = add i64 %r182, 0
- %r187 = icmp slt i64 %r183, 0
- br i1 %r187, label %b188, label %a30b
-b188:
- %e653 = phi i64 [ 0, %b179 ], [ %r283, %a30b ]
- %r291 = icmp slt i64 %e653, 0
- br i1 %r291, label %a30b294q, label %a33b
-a30b294q:
- br label %a30b294
-a30b:
- %w = phi i64 [ 0, %b179 ], [ %v, %a30b ]
- %b2 = shl i64 %w, 0
- %r283 = add i64 %b2, 0
- %r286 = add i64 %b2, 0
- %r288 = icmp slt i64 %r286, 0
- %v = add i64 %w, 0
- br i1 %r288, label %b188, label %a30b
-a30b294:
- %w1847 = phi i64 [ 0, %a30b294q ], [ %v1848, %a30b294 ]
- %v1848 = add i64 %w1847, 0
- %u = icmp slt i64 %v1848, 0
- br i1 %u, label %a33b, label %a30b294
-a50b:
- %r814 = add i32 %r14, 0
- %r815 = icmp slt i32 %r814, 0
- %r817 = or i1 %r61, %r815
- br i1 %r817, label %a57b, label %b820
-b341:
- %w1874 = phi i64 [ 0, %a33b ], [ %v1880, %b463 ]
- %d753 = bitcast i64 %w1874 to i64
- %r343 = add i64 %s661, 0
- %r346 = add i64 %r343, 0
- %r347 = getelementptr float* bitcast ([128 x i64]* @i6000 to float*), i64 %r346
- %r348 = load float* %r347
- %r352 = add i64 %r343, 0
- %r353 = getelementptr float* bitcast ([128 x i64]* @i6000 to float*), i64 %r352
- %r354 = load float* %r353
- %r362 = load float* bitcast ([128 x i64]* @i6000 to float*)
- %r363 = add float 0.000000e+00, %r362
- %r370 = load float* bitcast ([128 x i64]* @i6000 to float*)
- %r376 = icmp slt i64 %r16, 0
- br i1 %r376, label %b377, label %a35b
-b377:
- %d753p = phi i64 [ %d753, %b341 ], [ %r411, %a35b ]
- %s761p = phi i64 [ %s761, %b341 ], [ 322, %a35b ]
- %e784 = phi i64 [ 0, %b341 ], [ %r454, %a35b ]
- %s794 = add i64 %d753p, 0
- %r462 = icmp slt i64 %e784, 0
- br i1 %r462, label %a35b465, label %b463
-a35b:
- %w1865 = phi i64 [ 0, %b341 ], [ %v1866, %a35b ]
- %e785 = shl i64 %w1865, 0
- %b1877 = mul i64 %w1865, 0
- %s795 = add i64 %b1877, 0
- %r399 = add float %r354, 0.000000e+00
- %r402 = add float %r370, 0.000000e+00
- %r403 = add float %r348, 0.000000e+00
- %r411 = add i64 %s795, 0
- %r431 = add float %r362, 0.000000e+00
- %r454 = add i64 %e785, 0
- %r457 = add i64 %e785, 0
- %r459 = icmp slt i64 %r457, 0
- %v1866 = add i64 %w1865, 0
- br i1 %r459, label %b377, label %a35b
-b463:
- %r506 = add i64 %d753, 0
- %r511 = sext i32 %r60 to i64
- %r512 = add i64 %r511, 0
- %r513 = icmp slt i64 %r506, 0
- %v1880 = add i64 %w1874, 0
- br i1 %r513, label %b341, label %b514
-a35b465:
- %r469 = add i64 %s794, 0
- br label %b463
-b514:
- %r525 = mul i64 %r17, 0
- %r533 = add i64 %r525, 0
- br label %b535
-b535:
- %w1855 = phi i64 [ 0, %b514 ], [ %v1856, %b712 ]
- %s923 = phi i64 [ 0, %b514 ], [ %r799, %b712 ]
- %s933 = phi i64 [ %r533, %b514 ], [ %r795, %b712 ]
- %r538 = add i64 %w1855, 0
- %r539 = getelementptr float* bitcast ([128 x i64]* @i6000 to float*), i64 %r538
- %r540 = load float* %r539
- %r551 = load float* bitcast ([128 x i64]* @i6000 to float*)
- %r562 = sub i64 %s933, 0
- %r564 = icmp slt i64 %r512, 0
- br i1 %r564, label %b565, label %a45b
-b565:
- %e944 = phi i64 [ 0, %b535 ], [ %r703, %a45b ]
- %r711 = icmp slt i64 %e944, 0
- br i1 %r711, label %a45b714, label %b712
-a45b:
- %w1852 = phi i64 [ 0, %b535 ], [ %v1853, %a45b ]
- %e945 = shl i64 %w1852, 0
- %r609 = add i64 %r562, 0
- %r703 = add i64 %e945, 0
- %r706 = add i64 %e945, 0
- %r708 = icmp slt i64 %r706, 0
- %v1853 = add i64 %w1852, 0
- br i1 %r708, label %b565, label %a45b
-b712:
- %r795 = add i64 %rx, 0
- %r799 = add i64 %s923, 0
- %r802 = add i64 %w1855, 0
- %r807 = icmp slt i64 %r802, 0
- %v1856 = add i64 %w1855, 0
- br i1 %r807, label %b535, label %a50b
-a45b714:
- %r717 = add i64 %e944, 0
- %r720 = add i64 %r717, 0
- %r721 = getelementptr float* bitcast ([128 x i64]* @i6000 to float*), i64 %r720
- %r722 = load float* %r721
- %r726 = add i64 %r717, 0
- %r727 = getelementptr float* bitcast ([128 x i64]* @i6000 to float*), i64 %r726
- %r728 = load float* %r727
- %r732 = add i64 %r717, 0
- %r733 = getelementptr float* bitcast ([128 x i64]* @i6000 to float*), i64 %r732
- %r734 = load float* %r733
- %r738 = add i64 %r717, 0
- %r739 = getelementptr float* bitcast ([128 x i64]* @i6000 to float*), i64 %r738
- %r740 = load float* %r739
- %r744 = add i64 %r717, 0
- %r745 = getelementptr float* bitcast ([128 x i64]* @i6000 to float*), i64 %r744
- %r746 = load float* %r745
- %r750 = add i64 %r717, 0
- %r751 = getelementptr float* bitcast ([128 x i64]* @i6000 to float*), i64 %r750
- %r752 = load float* %r751
- %r753 = add float %r752, %r746
- %r754 = add float %r728, %r722
- %r755 = add float %r734, %r754
- %r756 = add float %r755, %r740
- %r757 = add float %r753, %r756
- %r759 = add float %r757, %r540
- %r770 = add i64 %r717, 0
- %r771 = getelementptr float* bitcast ([128 x i64]* @i6000 to float*), i64 %r770
- %r772 = load float* %r771
- %r776 = add i64 %r717, 0
- %r777 = getelementptr float* bitcast ([128 x i64]* @i6000 to float*), i64 %r776
- %r778 = load float* %r777
- %r781 = add float %r363, %r772
- %r782 = add float %r781, %r778
- %r783 = add float %r551, %r782
- br label %b712
-a57b:
- br i1 %r335, label %a66b, label %b1086
-b820:
- %r823 = sext i32 %r2 to i64
- %r834 = sext i32 %r8 to i64
- %r844 = add i64 %r16, 0
- %r846 = sext i32 %r60 to i64
- %r847 = add i64 %r846, 0
- %r851 = load float* bitcast ([128 x i64]* @i6000 to float*)
- %r856 = sub i64 %rx, 0
- br label %b858
-b858:
- %w1891 = phi i64 [ 0, %b820 ], [ %v1892, %b1016 ]
- %s1193 = phi i64 [ 0, %b820 ], [ %r1068, %b1016 ]
- %b1894 = mul i64 %r834, 0
- %b1896 = shl i64 %r823, 0
- %b1902 = mul i64 %w1891, 0
- %s1173 = add i64 %b1902, 0
- %r859 = add i64 %r856, 0
- %r862 = add i64 %w1891, 0
- %r863 = getelementptr float* bitcast ([128 x i64]* @i6000 to float*), i64 %r862
- %r864 = load float* %r863
- %r868 = add i64 %w1891, 0
- %r869 = getelementptr float* bitcast ([128 x i64]* @i6000 to float*), i64 %r868
- %r870 = load float* %r869
- %r873 = sub i64 %r859, 0
- %r876 = sub i64 %s1173, 0
- %r878 = icmp slt i64 %r847, 0
- br i1 %r878, label %b879, label %a53b
-b879:
- %e1204 = phi i64 [ 0, %b858 ], [ %r1007, %a53b ]
- %r1015 = icmp slt i64 %e1204, 0
- br i1 %r1015, label %a53b1019q, label %b1016
-a53b1019q:
- %b1888 = sub i64 %r846, 0
- %b1889 = add i64 %b1888, 0
- br label %a53b1019
-a53b:
- %w1881 = phi i64 [ 0, %b858 ], [ %v1882, %a53b ]
- %e1205 = shl i64 %w1881, 0
- %r1007 = add i64 %e1205, 0
- %r1010 = add i64 %e1205, 0
- %r1012 = icmp slt i64 %r1010, 0
- %v1882 = add i64 %w1881, 0
- br i1 %r1012, label %b879, label %a53b
-b1016:
- %r1068 = add i64 %s1193, 0
- %r1071 = add i64 %w1891, 0
- %r1073 = icmp slt i64 %r1071, %r844
- %v1892 = add i64 %w1891, 0
- br i1 %r1073, label %b858, label %a57b
-a53b1019:
- %w1885 = phi i64 [ 0, %a53b1019q ], [ %v1886, %a53b1019 ]
- %r1022 = add i64 %r876, 0
- %r1024 = bitcast i8* %c2 to float*
- %r1025 = add i64 %r1022, 0
- %r1026 = getelementptr float* %r1024, i64 %r1025
- %r1027 = load float* %r1026
- %r1032 = add i64 %r873, 0
- %r1033 = add i64 %r1032, 0
- %r1034 = getelementptr float* %r1024, i64 %r1033
- %r1035 = load float* %r1034
- %r1037 = bitcast i8* %c22010 to float*
- %r1040 = getelementptr float* %r1037, i64 %r1025
- %r1044 = add float %r864, %r1035
- %r1046 = add float %r870, %r1027
- %r1047 = add float %r1044, %r1046
- %r1048 = add float %r851, %r1047
- %v1886 = add i64 %w1885, 0
- %u1890 = icmp slt i64 %v1886, %b1889
- br i1 %u1890, label %b1016, label %a53b1019
-a66b:
- br i1 %r817, label %a93b, label %b1321
-b1086:
- %r1089 = sext i32 %r2 to i64
- %r1090 = add i64 %rx, 0
- %r1096 = mul i64 %r9, 0
- %r1101 = sext i32 %r8 to i64
- %r1104 = add i64 %r1096, 0
- %r1108 = sub i64 %r1104, 0
- %r1110 = sext i32 %r60 to i64
- %r1111 = add i64 %r1110, 0
- %r1113 = sext i32 %r14 to i64
- %r1114 = add i64 %r16, 0
- br label %b1117
-b1117:
- %w1915 = phi i64 [ 0, %b1086 ], [ %v1957, %b1263 ]
- %d1353 = bitcast i64 %w1915 to i64
- %r1120 = add i64 %s661, 0
- %r1121 = add i64 %r1120, 0
- %r1122 = getelementptr float* bitcast ([128 x i64]* @i6000 to float*), i64 %r1121
- %r1123 = load float* %r1122
- %r1132 = bitcast i8* %c22012 to float*
- %r1134 = getelementptr float* %r1132, i64 %w1915
- %r1135 = load float* %r1134
- %r1136 = add float %r1123, %r1135
- %r1138 = icmp slt i64 %r1114, 0
- br i1 %r1138, label %b1139, label %a63b
-b1139:
- %e1364 = phi i64 [ 0, %b1117 ], [ %r1254, %a63b ]
- %p1998 = phi i64 [ %s761, %b1117 ], [ %r1216, %a63b ]
- %r1108p = phi i64 [ %r1108, %b1117 ], [ %r1219, %a63b ]
- %p2004 = phi i64 [ %d1353, %b1117 ], [ %r1090, %a63b ]
- %s1374 = phi i64 [ 0, %b1117 ], [ %r1251, %a63b ]
- %s1384 = add i64 %r1108p, 0
- %s1394 = add i64 %p1998, 0
- %r1262 = icmp slt i64 %e1364, %r1114
- br i1 %r1262, label %a63b1266q, label %b1263
-a63b1266q:
- %b1947 = sub i64 %r1113, 0
- %b1948 = add i64 %b1947, 0
- br label %a63b1266
-a63b:
- %w1904 = phi i64 [ 0, %b1117 ], [ %v1905, %a63b ]
- %s1375 = phi i64 [ 0, %b1117 ], [ %r1251, %a63b ]
- %b1906 = add i64 %r1089, 0
- %b1907 = mul i64 %r1101, 0
- %b1929 = mul i64 %w1904, 0
- %s1395 = add i64 %b1929, 0
- %e1365 = shl i64 %w1904, 0
- %r1163 = add i64 %r1090, 0
- %r1167 = add i64 %s1375, 0
- %r1191 = add i64 %r1163, 0
- %r1195 = add i64 %r1167, 0
- %r1216 = add i64 %s1395, 0
- %r1219 = add i64 %r1191, 0
- %r1223 = add i64 %r1195, 0
- %r1251 = add i64 %r1223, 0
- %r1254 = add i64 %e1365, 0
- %r1257 = add i64 %e1365, 0
- %r1259 = icmp slt i64 %r1257, %r1114
- %v1905 = add i64 %w1904, 0
- br i1 %r1259, label %b1139, label %a63b
-b1263:
- %r1306 = add i64 %d1353, 0
- %r1308 = icmp slt i64 %r1306, %r1111
- %v1957 = add i64 %w1915, 0
- br i1 %r1308, label %b1117, label %a66b
-a63b1266:
- %w1944 = phi i64 [ 0, %a63b1266q ], [ %v1945, %a63b1266 ]
- %s1377 = phi i64 [ %s1374, %a63b1266q ], [ %r1297, %a63b1266 ]
- %r1282 = add float %r1136, 0.000000e+00
- %r1297 = add i64 %s1377, 0
- %v1945 = add i64 %w1944, 0
- %u1949 = icmp slt i64 %v1945, %b1948
- br i1 %u1949, label %b1263, label %a63b1266
-a93b:
- br i1 %r61, label %b1606, label %a97b
-b1321:
- %r1331 = mul i64 %r17, 0
- %r1339 = add i64 %r1331, 0
- br label %b1342
-b1342:
- %w1960 = phi i64 [ 0, %b1321 ], [ %v1961, %b1582 ]
- %s1523 = phi i64 [ %r1339, %b1321 ], [ %r1587, %b1582 ]
- %s1563 = phi i64 [ 0, %b1321 ], [ %r1591, %b1582 ]
- %d1533 = bitcast i64 %w1960 to i64
- %b1968 = mul i64 %w1960, 0
- %s1543 = add i64 %b1968, 0
- %r1345 = add i64 %s1523, 0
- %r1348 = sub i64 %r1345, 0
- %r1352 = add i64 %s1523, 0
- %r1355 = sub i64 %r1352, 0
- %r1370 = add i64 %d1533, 0
- %r1371 = getelementptr float* bitcast ([128 x i64]* @i6000 to float*), i64 %r1370
- %r1372 = load float* %r1371
- br label %a74b
-a74b:
- %w1958 = phi i64 [ 0, %b1342 ], [ %v1959, %a74b ]
- %r1379 = add i64 %s1543, 0
- %r1403 = add i64 %r1355, 0
- %r1422 = add i64 %r1348, 0
- %r1526 = add float %r1372, 0.000000e+00
- %r1573 = add i64 %w1958, 0
- %r1581 = icmp slt i64 %r1573, 0
- %v1959 = add i64 %w1958, 0
- br i1 %r1581, label %a74b, label %b1582
-b1582:
- %r1587 = add i64 %rx, 0
- %r1591 = add i64 %s1563, 0
- %r1596 = add i64 %d1533, 0
- %r1601 = icmp slt i64 %r1596, 0
- %v1961 = add i64 %w1960, 0
- br i1 %r1601, label %b1342, label %a93b
-b1606:
- %r1833 = add i64 %w1964, 0
- %r1840 = icmp slt i64 %r1833, 0
- %v1973 = add i64 %w1964, 0
- br i1 %r1840, label %a29b173, label %a109b
-a97b:
- %w1970 = phi i64 [ 0, %a93b ], [ %v1971, %a97b ]
- %r1613 = add i64 %w1964, 0
- %r1614 = mul i64 %r1613, 0
- %r1622 = add i64 %r1614, 0
- %r1754 = bitcast i8* %r28 to float*
- %r1756 = getelementptr float* %r1754, i64 %w1970
- %r1757 = load float* %r1756
- %r1761 = add i64 %r1622, 0
- %r1762 = getelementptr float* bitcast ([128 x i64]* @i6000 to float*), i64 %r1761
- %r1763 = load float* %r1762
- %r1767 = add i64 %r1622, 0
- %r1768 = getelementptr float* bitcast ([128 x i64]* @i6000 to float*), i64 %r1767
- %r1772 = add float %r1763, 0.000000e+00
- %r1773 = add float %r1772, 0.000000e+00
- %r1809 = add float %r1757, 0.000000e+00
- %r1810 = add float %r1773, %r1809
- store float %r1810, float* %r1768
- %r1818 = add i64 %w1970, 0
- %r1826 = icmp slt i64 %r1818, 0
- %v1971 = add i64 %w1970, 0
- br i1 %r1826, label %a97b, label %b1606
-a109b:
- ret void
-}
diff --git a/release_23/test/CodeGen/X86/2007-01-29-InlineAsm-ir.ll b/release_23/test/CodeGen/X86/2007-01-29-InlineAsm-ir.ll
deleted file mode 100644
index b1c86f4138a3..000000000000
--- a/release_23/test/CodeGen/X86/2007-01-29-InlineAsm-ir.ll
+++ /dev/null
@@ -1,7 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86
-; Test 'ri' constraint.
-
-define void @run_init_process() {
- %tmp = call i32 asm sideeffect "push %ebx ; movl $2,%ebx ; int $$0x80 ; pop %ebx", "={ax},0,ri,{cx},{dx},~{dirflag},~{fpsr},~{flags},~{memory}"( i32 11, i32 0, i32 0, i32 0 )
- unreachable
- }
diff --git a/release_23/test/CodeGen/X86/2007-02-04-OrAddrMode.ll b/release_23/test/CodeGen/X86/2007-02-04-OrAddrMode.ll
deleted file mode 100644
index 26d3e367195c..000000000000
--- a/release_23/test/CodeGen/X86/2007-02-04-OrAddrMode.ll
+++ /dev/null
@@ -1,21 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 | grep {orl \$1, %eax}
-; RUN: llvm-as < %s | llc -march=x86 | grep {leal 3(,%eax,8)}
-
-;; This example can't fold the or into an LEA.
-define i32 @test(float ** %tmp2, i32 %tmp12) {
- %tmp3 = load float** %tmp2
- %tmp132 = shl i32 %tmp12, 2 ; <i32> [#uses=1]
- %tmp4 = bitcast float* %tmp3 to i8* ; <i8*> [#uses=1]
- %ctg2 = getelementptr i8* %tmp4, i32 %tmp132 ; <i8*> [#uses=1]
- %tmp6 = ptrtoint i8* %ctg2 to i32 ; <i32> [#uses=1]
- %tmp14 = or i32 %tmp6, 1 ; <i32> [#uses=1]
- ret i32 %tmp14
-}
-
-
-;; This can!
-define i32 @test2(i32 %a, i32 %b) {
- %c = shl i32 %a, 3
- %d = or i32 %c, 3
- ret i32 %d
-}
diff --git a/release_23/test/CodeGen/X86/2007-02-19-LiveIntervalAssert.ll b/release_23/test/CodeGen/X86/2007-02-19-LiveIntervalAssert.ll
deleted file mode 100644
index 365768afe794..000000000000
--- a/release_23/test/CodeGen/X86/2007-02-19-LiveIntervalAssert.ll
+++ /dev/null
@@ -1,21 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -mtriple=i686-pc-linux-gnu -relocation-model=pic
-; PR1027
-
- %struct._IO_FILE = type { i32, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, %struct._IO_marker*, %struct._IO_FILE*, i32, i32, i32, i16, i8, [1 x i8], i8*, i64, i8*, i8*, i8*, i8*, i32, i32, [40 x i8] }
- %struct._IO_marker = type { %struct._IO_marker*, %struct._IO_FILE*, i32 }
-@stderr = external global %struct._IO_FILE*
-
-define void @__eprintf(i8* %string, i8* %expression, i32 %line, i8* %filename) {
- %tmp = load %struct._IO_FILE** @stderr
- %tmp5 = tail call i32 (%struct._IO_FILE*, i8*, ...)* @fprintf( %struct._IO_FILE* %tmp, i8* %string, i8* %expression, i32 %line, i8* %filename )
- %tmp6 = load %struct._IO_FILE** @stderr
- %tmp7 = tail call i32 @fflush( %struct._IO_FILE* %tmp6 )
- tail call void @abort( )
- unreachable
-}
-
-declare i32 @fprintf(%struct._IO_FILE*, i8*, ...)
-
-declare i32 @fflush(%struct._IO_FILE*)
-
-declare void @abort()
diff --git a/release_23/test/CodeGen/X86/2007-02-25-FastCCStack.ll b/release_23/test/CodeGen/X86/2007-02-25-FastCCStack.ll
deleted file mode 100644
index 3b1eb1fdb66b..000000000000
--- a/release_23/test/CodeGen/X86/2007-02-25-FastCCStack.ll
+++ /dev/null
@@ -1,5 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -mcpu=pentium3
-
-define internal fastcc double @ggc_rlimit_bound(double %limit) {
- ret double %limit
-}
diff --git a/release_23/test/CodeGen/X86/2007-03-01-SpillerCrash.ll b/release_23/test/CodeGen/X86/2007-03-01-SpillerCrash.ll
deleted file mode 100644
index 2d11bfb10f5d..000000000000
--- a/release_23/test/CodeGen/X86/2007-03-01-SpillerCrash.ll
+++ /dev/null
@@ -1,85 +0,0 @@
-; RUN: llvm-as < %s | llc -mtriple=x86_64-apple-darwin8 -mattr=+sse2
-
-define void @test() {
-test.exit:
- mul <4 x float> zeroinitializer, zeroinitializer ; <<4 x float>>:0 [#uses=4]
- load <4 x float>* null ; <<4 x float>>:1 [#uses=1]
- shufflevector <4 x float> %1, <4 x float> undef, <4 x i32> < i32 3, i32 3, i32 3, i32 3 > ; <<4 x float>>:2 [#uses=1]
- mul <4 x float> %0, %2 ; <<4 x float>>:3 [#uses=1]
- sub <4 x float> zeroinitializer, %3 ; <<4 x float>>:4 [#uses=1]
- mul <4 x float> %4, zeroinitializer ; <<4 x float>>:5 [#uses=2]
- bitcast <4 x float> zeroinitializer to <4 x i32> ; <<4 x i32>>:6 [#uses=1]
- and <4 x i32> %6, < i32 2147483647, i32 2147483647, i32 2147483647, i32 2147483647 > ; <<4 x i32>>:7 [#uses=1]
- bitcast <4 x i32> %7 to <4 x float> ; <<4 x float>>:8 [#uses=2]
- extractelement <4 x float> %8, i32 0 ; <float>:9 [#uses=1]
- extractelement <4 x float> %8, i32 1 ; <float>:10 [#uses=2]
- br i1 false, label %11, label %19
-
-; <label>:11 ; preds = %test.exit
- br i1 false, label %17, label %12
-
-; <label>:12 ; preds = %11
- br i1 false, label %19, label %13
-
-; <label>:13 ; preds = %12
- sub float -0.000000e+00, 0.000000e+00 ; <float>:14 [#uses=1]
- %tmp207 = extractelement <4 x float> zeroinitializer, i32 0 ; <float> [#uses=1]
- %tmp208 = extractelement <4 x float> zeroinitializer, i32 2 ; <float> [#uses=1]
- sub float -0.000000e+00, %tmp208 ; <float>:15 [#uses=1]
- %tmp155 = extractelement <4 x float> zeroinitializer, i32 0 ; <float> [#uses=1]
- %tmp156 = extractelement <4 x float> zeroinitializer, i32 2 ; <float> [#uses=1]
- sub float -0.000000e+00, %tmp156 ; <float>:16 [#uses=1]
- br label %19
-
-; <label>:17 ; preds = %11
- br i1 false, label %19, label %18
-
-; <label>:18 ; preds = %17
- br label %19
-
-; <label>:19 ; preds = %18, %17, %13, %12, %test.exit
- phi i32 [ 5, %18 ], [ 3, %13 ], [ 1, %test.exit ], [ 2, %12 ], [ 4, %17 ] ; <i32>:20 [#uses=0]
- phi float [ 0.000000e+00, %18 ], [ %16, %13 ], [ 0.000000e+00, %test.exit ], [ 0.000000e+00, %12 ], [ 0.000000e+00, %17 ] ; <float>:21 [#uses=1]
- phi float [ 0.000000e+00, %18 ], [ %tmp155, %13 ], [ 0.000000e+00, %test.exit ], [ 0.000000e+00, %12 ], [ 0.000000e+00, %17 ] ; <float>:22 [#uses=1]
- phi float [ 0.000000e+00, %18 ], [ %15, %13 ], [ 0.000000e+00, %test.exit ], [ 0.000000e+00, %12 ], [ 0.000000e+00, %17 ] ; <float>:23 [#uses=1]
- phi float [ 0.000000e+00, %18 ], [ %tmp207, %13 ], [ 0.000000e+00, %test.exit ], [ 0.000000e+00, %12 ], [ 0.000000e+00, %17 ] ; <float>:24 [#uses=1]
- phi float [ 0.000000e+00, %18 ], [ %10, %13 ], [ %9, %test.exit ], [ %10, %12 ], [ 0.000000e+00, %17 ] ; <float>:25 [#uses=2]
- phi float [ 0.000000e+00, %18 ], [ %14, %13 ], [ 0.000000e+00, %test.exit ], [ 0.000000e+00, %12 ], [ 0.000000e+00, %17 ] ; <float>:26 [#uses=1]
- phi float [ 0.000000e+00, %18 ], [ 0.000000e+00, %13 ], [ 0.000000e+00, %test.exit ], [ 0.000000e+00, %12 ], [ 0.000000e+00, %17 ] ; <float>:27 [#uses=1]
- insertelement <4 x float> undef, float %27, i32 0 ; <<4 x float>>:28 [#uses=1]
- insertelement <4 x float> %28, float %26, i32 1 ; <<4 x float>>:29 [#uses=0]
- insertelement <4 x float> undef, float %24, i32 0 ; <<4 x float>>:30 [#uses=1]
- insertelement <4 x float> %30, float %23, i32 1 ; <<4 x float>>:31 [#uses=1]
- insertelement <4 x float> %31, float %25, i32 2 ; <<4 x float>>:32 [#uses=1]
- insertelement <4 x float> %32, float %25, i32 3 ; <<4 x float>>:33 [#uses=1]
- fdiv <4 x float> %33, zeroinitializer ; <<4 x float>>:34 [#uses=1]
- mul <4 x float> %34, < float 5.000000e-01, float 5.000000e-01, float 5.000000e-01, float 5.000000e-01 > ; <<4 x float>>:35 [#uses=1]
- insertelement <4 x float> undef, float %22, i32 0 ; <<4 x float>>:36 [#uses=1]
- insertelement <4 x float> %36, float %21, i32 1 ; <<4 x float>>:37 [#uses=0]
- br i1 false, label %foo.exit, label %38
-
-; <label>:38 ; preds = %19
- extractelement <4 x float> %0, i32 0 ; <float>:39 [#uses=1]
- fcmp ogt float %39, 0.000000e+00 ; <i1>:40 [#uses=1]
- extractelement <4 x float> %0, i32 2 ; <float>:41 [#uses=1]
- extractelement <4 x float> %0, i32 1 ; <float>:42 [#uses=1]
- sub float -0.000000e+00, %42 ; <float>:43 [#uses=2]
- %tmp189 = extractelement <4 x float> %5, i32 2 ; <float> [#uses=1]
- br i1 %40, label %44, label %46
-
-; <label>:44 ; preds = %38
- sub float -0.000000e+00, %tmp189 ; <float>:45 [#uses=0]
- br label %foo.exit
-
-; <label>:46 ; preds = %38
- %tmp192 = extractelement <4 x float> %5, i32 1 ; <float> [#uses=1]
- sub float -0.000000e+00, %tmp192 ; <float>:47 [#uses=1]
- br label %foo.exit
-
-foo.exit: ; preds = %46, %44, %19
- phi float [ 0.000000e+00, %44 ], [ %47, %46 ], [ 0.000000e+00, %19 ] ; <float>:48 [#uses=0]
- phi float [ %43, %44 ], [ %43, %46 ], [ 0.000000e+00, %19 ] ; <float>:49 [#uses=0]
- phi float [ 0.000000e+00, %44 ], [ %41, %46 ], [ 0.000000e+00, %19 ] ; <float>:50 [#uses=0]
- shufflevector <4 x float> %35, <4 x float> zeroinitializer, <4 x i32> < i32 0, i32 4, i32 1, i32 5 > ; <<4 x float>>:51 [#uses=0]
- unreachable
-}
diff --git a/release_23/test/CodeGen/X86/2007-03-15-GEP-Idx-Sink.ll b/release_23/test/CodeGen/X86/2007-03-15-GEP-Idx-Sink.ll
deleted file mode 100644
index 4c69ec733dd4..000000000000
--- a/release_23/test/CodeGen/X86/2007-03-15-GEP-Idx-Sink.ll
+++ /dev/null
@@ -1,73 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -mtriple=i686-darwin | \
-; RUN: grep push | count 3
-
-define void @foo(i8** %buf, i32 %size, i32 %col, i8* %p) {
-entry:
- icmp sgt i32 %size, 0 ; <i1>:0 [#uses=1]
- br i1 %0, label %bb.preheader, label %return
-
-bb.preheader: ; preds = %entry
- %tmp5.sum72 = add i32 %col, 7 ; <i32> [#uses=1]
- %tmp5.sum71 = add i32 %col, 5 ; <i32> [#uses=1]
- %tmp5.sum70 = add i32 %col, 3 ; <i32> [#uses=1]
- %tmp5.sum69 = add i32 %col, 2 ; <i32> [#uses=1]
- %tmp5.sum68 = add i32 %col, 1 ; <i32> [#uses=1]
- %tmp5.sum66 = add i32 %col, 4 ; <i32> [#uses=1]
- %tmp5.sum = add i32 %col, 6 ; <i32> [#uses=1]
- br label %bb
-
-bb: ; preds = %bb, %bb.preheader
- %i.073.0 = phi i32 [ 0, %bb.preheader ], [ %indvar.next, %bb ] ; <i32> [#uses=3]
- %p_addr.076.0.rec = mul i32 %i.073.0, 9 ; <i32> [#uses=9]
- %p_addr.076.0 = getelementptr i8* %p, i32 %p_addr.076.0.rec ; <i8*> [#uses=1]
- %tmp2 = getelementptr i8** %buf, i32 %i.073.0 ; <i8**> [#uses=1]
- %tmp3 = load i8** %tmp2 ; <i8*> [#uses=8]
- %tmp5 = getelementptr i8* %tmp3, i32 %col ; <i8*> [#uses=1]
- %tmp7 = load i8* %p_addr.076.0 ; <i8> [#uses=1]
- store i8 %tmp7, i8* %tmp5
- %p_addr.076.0.sum93 = add i32 %p_addr.076.0.rec, 1 ; <i32> [#uses=1]
- %tmp11 = getelementptr i8* %p, i32 %p_addr.076.0.sum93 ; <i8*> [#uses=1]
- %tmp13 = load i8* %tmp11 ; <i8> [#uses=1]
- %tmp15 = getelementptr i8* %tmp3, i32 %tmp5.sum72 ; <i8*> [#uses=1]
- store i8 %tmp13, i8* %tmp15
- %p_addr.076.0.sum92 = add i32 %p_addr.076.0.rec, 2 ; <i32> [#uses=1]
- %tmp17 = getelementptr i8* %p, i32 %p_addr.076.0.sum92 ; <i8*> [#uses=1]
- %tmp19 = load i8* %tmp17 ; <i8> [#uses=1]
- %tmp21 = getelementptr i8* %tmp3, i32 %tmp5.sum71 ; <i8*> [#uses=1]
- store i8 %tmp19, i8* %tmp21
- %p_addr.076.0.sum91 = add i32 %p_addr.076.0.rec, 3 ; <i32> [#uses=1]
- %tmp23 = getelementptr i8* %p, i32 %p_addr.076.0.sum91 ; <i8*> [#uses=1]
- %tmp25 = load i8* %tmp23 ; <i8> [#uses=1]
- %tmp27 = getelementptr i8* %tmp3, i32 %tmp5.sum70 ; <i8*> [#uses=1]
- store i8 %tmp25, i8* %tmp27
- %p_addr.076.0.sum90 = add i32 %p_addr.076.0.rec, 4 ; <i32> [#uses=1]
- %tmp29 = getelementptr i8* %p, i32 %p_addr.076.0.sum90 ; <i8*> [#uses=1]
- %tmp31 = load i8* %tmp29 ; <i8> [#uses=1]
- %tmp33 = getelementptr i8* %tmp3, i32 %tmp5.sum69 ; <i8*> [#uses=2]
- store i8 %tmp31, i8* %tmp33
- %p_addr.076.0.sum89 = add i32 %p_addr.076.0.rec, 5 ; <i32> [#uses=1]
- %tmp35 = getelementptr i8* %p, i32 %p_addr.076.0.sum89 ; <i8*> [#uses=1]
- %tmp37 = load i8* %tmp35 ; <i8> [#uses=1]
- %tmp39 = getelementptr i8* %tmp3, i32 %tmp5.sum68 ; <i8*> [#uses=1]
- store i8 %tmp37, i8* %tmp39
- %p_addr.076.0.sum88 = add i32 %p_addr.076.0.rec, 6 ; <i32> [#uses=1]
- %tmp41 = getelementptr i8* %p, i32 %p_addr.076.0.sum88 ; <i8*> [#uses=1]
- %tmp43 = load i8* %tmp41 ; <i8> [#uses=1]
- store i8 %tmp43, i8* %tmp33
- %p_addr.076.0.sum87 = add i32 %p_addr.076.0.rec, 7 ; <i32> [#uses=1]
- %tmp47 = getelementptr i8* %p, i32 %p_addr.076.0.sum87 ; <i8*> [#uses=1]
- %tmp49 = load i8* %tmp47 ; <i8> [#uses=1]
- %tmp51 = getelementptr i8* %tmp3, i32 %tmp5.sum66 ; <i8*> [#uses=1]
- store i8 %tmp49, i8* %tmp51
- %p_addr.076.0.sum = add i32 %p_addr.076.0.rec, 8 ; <i32> [#uses=1]
- %tmp53 = getelementptr i8* %p, i32 %p_addr.076.0.sum ; <i8*> [#uses=1]
- %tmp55 = load i8* %tmp53 ; <i8> [#uses=1]
- %tmp57 = getelementptr i8* %tmp3, i32 %tmp5.sum ; <i8*> [#uses=1]
- store i8 %tmp55, i8* %tmp57
- %indvar.next = add i32 %i.073.0, 1 ; <i32> [#uses=2]
- icmp eq i32 %indvar.next, %size ; <i1>:1 [#uses=1]
- br i1 %1, label %return, label %bb
-
-return: ; preds = %bb, %entry
- ret void
-}
diff --git a/release_23/test/CodeGen/X86/2007-03-16-InlineAsm.ll b/release_23/test/CodeGen/X86/2007-03-16-InlineAsm.ll
deleted file mode 100644
index c98c89a537a3..000000000000
--- a/release_23/test/CodeGen/X86/2007-03-16-InlineAsm.ll
+++ /dev/null
@@ -1,27 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86
-
-; ModuleID = 'a.bc'
-
-define i32 @foo(i32 %A, i32 %B) {
-entry:
- %A_addr = alloca i32 ; <i32*> [#uses=2]
- %B_addr = alloca i32 ; <i32*> [#uses=1]
- %retval = alloca i32, align 4 ; <i32*> [#uses=2]
- %tmp = alloca i32, align 4 ; <i32*> [#uses=2]
- %ret = alloca i32, align 4 ; <i32*> [#uses=2]
- "alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
- store i32 %A, i32* %A_addr
- store i32 %B, i32* %B_addr
- %tmp1 = load i32* %A_addr ; <i32> [#uses=1]
- %tmp2 = call i32 asm "roll $1,$0", "=r,I,0,~{dirflag},~{fpsr},~{flags},~{cc}"( i32 7, i32 %tmp1 ) ; <i32> [#uses=1]
- store i32 %tmp2, i32* %ret
- %tmp3 = load i32* %ret ; <i32> [#uses=1]
- store i32 %tmp3, i32* %tmp
- %tmp4 = load i32* %tmp ; <i32> [#uses=1]
- store i32 %tmp4, i32* %retval
- br label %return
-
-return: ; preds = %entry
- %retval5 = load i32* %retval ; <i32> [#uses=1]
- ret i32 %retval5
-}
diff --git a/release_23/test/CodeGen/X86/2007-03-18-LiveIntervalAssert.ll b/release_23/test/CodeGen/X86/2007-03-18-LiveIntervalAssert.ll
deleted file mode 100644
index 6965849e3231..000000000000
--- a/release_23/test/CodeGen/X86/2007-03-18-LiveIntervalAssert.ll
+++ /dev/null
@@ -1,7 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86
-; PR1259
-
-define void @test() {
- %tmp2 = call i32 asm "...", "=r,~{dirflag},~{fpsr},~{flags},~{dx},~{cx},~{ax}"( )
- unreachable
-}
diff --git a/release_23/test/CodeGen/X86/2007-03-24-InlineAsmMultiRegConstraint.ll b/release_23/test/CodeGen/X86/2007-03-24-InlineAsmMultiRegConstraint.ll
deleted file mode 100644
index babcf6a0e805..000000000000
--- a/release_23/test/CodeGen/X86/2007-03-24-InlineAsmMultiRegConstraint.ll
+++ /dev/null
@@ -1,11 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86
-
-define i32 @test(i16 %tmp40414244) {
- %tmp48 = call i32 asm sideeffect "inl ${1:w}, $0", "={ax},N{dx},~{dirflag},~{fpsr},~{flags}"( i16 %tmp40414244 )
- ret i32 %tmp48
-}
-
-define i32 @test2(i16 %tmp40414244) {
- %tmp48 = call i32 asm sideeffect "inl ${1:w}, $0", "={ax},N{dx},~{dirflag},~{fpsr},~{flags}"( i16 14 )
- ret i32 %tmp48
-}
diff --git a/release_23/test/CodeGen/X86/2007-03-24-InlineAsmPModifier.ll b/release_23/test/CodeGen/X86/2007-03-24-InlineAsmPModifier.ll
deleted file mode 100644
index 9bdb2493508d..000000000000
--- a/release_23/test/CodeGen/X86/2007-03-24-InlineAsmPModifier.ll
+++ /dev/null
@@ -1,10 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 | grep {mov %gs:72, %eax}
-target datalayout = "e-p:32:32"
-target triple = "i686-apple-darwin9"
-
-define void @test() {
- %tmp1 = tail call i32* asm sideeffect "mov %gs:${1:P}, $0", "=r,i,~{dirflag},~{fpsr},~{flags}"( i32 72 ) ; <%struct._pthread*> [#uses=1]
- ret void
-}
-
-
diff --git a/release_23/test/CodeGen/X86/2007-03-24-InlineAsmVectorOp.ll b/release_23/test/CodeGen/X86/2007-03-24-InlineAsmVectorOp.ll
deleted file mode 100644
index 6e1adf834624..000000000000
--- a/release_23/test/CodeGen/X86/2007-03-24-InlineAsmVectorOp.ll
+++ /dev/null
@@ -1,11 +0,0 @@
-; RUN: llvm-as < %s | llc -mcpu=yonah -march=x86 | \
-; RUN: grep {cmpltsd %xmm0, %xmm0}
-target datalayout = "e-p:32:32"
-target triple = "i686-apple-darwin9"
-
-
-define void @acoshf() {
- %tmp19 = tail call <2 x double> asm sideeffect "pcmpeqd $0, $0 \0A\09 cmpltsd $0, $0", "=x,0,~{dirflag},~{fpsr},~{flags}"( <2 x double> zeroinitializer ) ; <<2 x double>> [#uses=0]
- ret void
-}
-
diff --git a/release_23/test/CodeGen/X86/2007-03-24-InlineAsmXConstraint.ll b/release_23/test/CodeGen/X86/2007-03-24-InlineAsmXConstraint.ll
deleted file mode 100644
index e440cdb6cfd7..000000000000
--- a/release_23/test/CodeGen/X86/2007-03-24-InlineAsmXConstraint.ll
+++ /dev/null
@@ -1,9 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 | grep {psrlw \$8, %xmm0}
-target datalayout = "e-p:32:32"
-target triple = "i686-apple-darwin9"
-
-define void @test() {
- tail call void asm sideeffect "psrlw $0, %xmm0", "X,~{dirflag},~{fpsr},~{flags}"( i32 8 )
- ret void
-}
-
diff --git a/release_23/test/CodeGen/X86/2007-03-26-CoalescerBug.ll b/release_23/test/CodeGen/X86/2007-03-26-CoalescerBug.ll
deleted file mode 100644
index 7ce0584c5450..000000000000
--- a/release_23/test/CodeGen/X86/2007-03-26-CoalescerBug.ll
+++ /dev/null
@@ -1,49 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86
-
-@data = external global [339 x i64]
-
-define void @foo(...) {
-bb1:
- %t43 = load i64* getelementptr ([339 x i64]* @data, i32 0, i64 212), align 4
- br i1 false, label %bb80, label %bb6
-bb6:
- br i1 false, label %bb38, label %bb265
-bb265:
- ret void
-bb38:
- br i1 false, label %bb80, label %bb49
-bb80:
- br i1 false, label %bb146, label %bb268
-bb49:
- ret void
-bb113:
- ret void
-bb268:
- %t1062 = shl i64 %t43, 3
- %t1066 = shl i64 0, 3
- br label %bb85
-bb85:
- %t1025 = phi i64 [ 0, %bb268 ], [ %t102.0, %bb234 ]
- %t1028 = phi i64 [ 0, %bb268 ], [ %t1066, %bb234 ]
- %t1031 = phi i64 [ 0, %bb268 ], [ %t103.0, %bb234 ]
- %t1034 = phi i64 [ 0, %bb268 ], [ %t1066, %bb234 ]
- %t102.0 = add i64 %t1028, %t1025
- %t103.0 = add i64 %t1034, %t1031
- br label %bb86
-bb86:
- %t108.0 = phi i64 [ %t102.0, %bb85 ], [ %t1139, %bb248 ]
- %t110.0 = phi i64 [ %t103.0, %bb85 ], [ %t1142, %bb248 ]
- br label %bb193
-bb193:
- %t1081 = add i64 %t110.0, -8
- %t1087 = add i64 %t108.0, -8
- br i1 false, label %bb193, label %bb248
-bb248:
- %t1139 = add i64 %t108.0, %t1062
- %t1142 = add i64 %t110.0, %t1062
- br i1 false, label %bb86, label %bb234
-bb234:
- br i1 false, label %bb85, label %bb113
-bb146:
- ret void
-}
diff --git a/release_23/test/CodeGen/X86/2007-04-08-InlineAsmCrash.ll b/release_23/test/CodeGen/X86/2007-04-08-InlineAsmCrash.ll
deleted file mode 100644
index 840fc7d513a0..000000000000
--- a/release_23/test/CodeGen/X86/2007-04-08-InlineAsmCrash.ll
+++ /dev/null
@@ -1,18 +0,0 @@
-; RUN: llvm-as < %s | llc
-; PR1314
-
-target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64"
-target triple = "x86_64-unknown-linux-gnu"
- %struct.CycleCount = type { i64, i64 }
- %struct.bc_struct = type { i32, i32, i32, i32, %struct.bc_struct*, i8*, i8* }
-@_programStartTime = external global %struct.CycleCount ; <%struct.CycleCount*> [#uses=1]
-
-define fastcc i32 @bc_divide(%struct.bc_struct* %n1, %struct.bc_struct* %n2, %struct.bc_struct** %quot, i32 %scale) {
-entry:
- %tmp7.i46 = tail call i64 asm sideeffect ".byte 0x0f,0x31", "={dx},=*{ax},~{dirflag},~{fpsr},~{flags}"( i64* getelementptr (%struct.CycleCount* @_programStartTime, i32 0, i32 1) ) ; <i64> [#uses=0]
- %tmp221 = sdiv i32 10, 0 ; <i32> [#uses=1]
- tail call fastcc void @_one_mult( i8* null, i32 0, i32 %tmp221, i8* null )
- ret i32 0
-}
-
-declare fastcc void @_one_mult(i8*, i32, i32, i8*)
diff --git a/release_23/test/CodeGen/X86/2007-04-11-InlineAsmVectorResult.ll b/release_23/test/CodeGen/X86/2007-04-11-InlineAsmVectorResult.ll
deleted file mode 100644
index ed5a1943a262..000000000000
--- a/release_23/test/CodeGen/X86/2007-04-11-InlineAsmVectorResult.ll
+++ /dev/null
@@ -1,21 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -mcpu=yonah
-target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64"
-target triple = "i686-apple-darwin8"
-
-define void @test(<4 x float> %tmp42i) {
- %tmp42 = call <4 x float> asm "movss $1, $0", "=x,m,~{dirflag},~{fpsr},~{flags}"( float* null ) ; <<4 x float>> [#uses=1]
- %tmp49 = shufflevector <4 x float> %tmp42, <4 x float> undef, <4 x i32> zeroinitializer ; <<4 x float>> [#uses=1]
- br label %bb
-
-bb: ; preds = %bb, %cond_true10
- %tmp52 = bitcast <4 x float> %tmp49 to <4 x i32> ; <<4 x i32>> [#uses=1]
- %tmp53 = call <4 x i32> @llvm.x86.sse2.psll.d( <4 x i32> %tmp52, <4 x i32> < i32 8, i32 undef, i32 undef, i32 undef > ) ; <<4 x i32>> [#uses=1]
- %tmp105 = bitcast <4 x i32> %tmp53 to <4 x float> ; <<4 x float>> [#uses=1]
- %tmp108 = sub <4 x float> zeroinitializer, %tmp105 ; <<4 x float>> [#uses=0]
- br label %bb
-
-return: ; preds = %entry
- ret void
-}
-
-declare <4 x i32> @llvm.x86.sse2.psll.d(<4 x i32>, <4 x i32>)
diff --git a/release_23/test/CodeGen/X86/2007-04-17-LiveIntervalAssert.ll b/release_23/test/CodeGen/X86/2007-04-17-LiveIntervalAssert.ll
deleted file mode 100644
index f9671a4daaed..000000000000
--- a/release_23/test/CodeGen/X86/2007-04-17-LiveIntervalAssert.ll
+++ /dev/null
@@ -1,42 +0,0 @@
-; RUN: llvm-as < %s | llc -mtriple=i686-apple-darwin -relocation-model=pic --disable-fp-elim
-
- %struct.FILE = type { i8*, i32, i32, i16, i16, %struct.__sbuf, i32, i8*, i32 (i8*)*, i32 (i8*, i8*, i32)*, i64 (i8*, i64, i32)*, i32 (i8*, i8*, i32)*, %struct.__sbuf, %struct.__sFILEX*, i32, [3 x i8], [1 x i8], %struct.__sbuf, i32, i64 }
- %struct.__sFILEX = type opaque
- %struct.__sbuf = type { i8*, i32 }
- %struct.partition_def = type { i32, [1 x %struct.partition_elem] }
- %struct.partition_elem = type { i32, %struct.partition_elem*, i32 }
-
-define void @partition_print(%struct.partition_def* %part) {
-entry:
- br i1 false, label %bb.preheader, label %bb99
-
-bb.preheader: ; preds = %entry
- br i1 false, label %cond_true, label %cond_next90
-
-cond_true: ; preds = %bb.preheader
- br i1 false, label %bb32, label %bb87.critedge
-
-bb32: ; preds = %bb32, %cond_true
- %i.2115.0 = phi i32 [ 0, %cond_true ], [ %indvar.next127, %bb32 ] ; <i32> [#uses=1]
- %c.2112.0 = phi i32 [ 0, %cond_true ], [ %tmp49, %bb32 ] ; <i32> [#uses=1]
- %tmp43 = getelementptr %struct.partition_def* %part, i32 0, i32 1, i32 %c.2112.0, i32 1 ; <%struct.partition_elem**> [#uses=1]
- %tmp44 = load %struct.partition_elem** %tmp43 ; <%struct.partition_elem*> [#uses=1]
- %tmp4445 = ptrtoint %struct.partition_elem* %tmp44 to i32 ; <i32> [#uses=1]
- %tmp48 = sub i32 %tmp4445, 0 ; <i32> [#uses=1]
- %tmp49 = sdiv i32 %tmp48, 12 ; <i32> [#uses=1]
- %indvar.next127 = add i32 %i.2115.0, 1 ; <i32> [#uses=2]
- %exitcond128 = icmp eq i32 %indvar.next127, 0 ; <i1> [#uses=1]
- br i1 %exitcond128, label %bb58, label %bb32
-
-bb58: ; preds = %bb32
- ret void
-
-bb87.critedge: ; preds = %cond_true
- ret void
-
-cond_next90: ; preds = %bb.preheader
- ret void
-
-bb99: ; preds = %entry
- ret void
-}
diff --git a/release_23/test/CodeGen/X86/2007-04-24-Huge-Stack.ll b/release_23/test/CodeGen/X86/2007-04-24-Huge-Stack.ll
deleted file mode 100644
index 74e6e72a4aa6..000000000000
--- a/release_23/test/CodeGen/X86/2007-04-24-Huge-Stack.ll
+++ /dev/null
@@ -1,19 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86-64 | not grep 4294967112
-; PR1348
-
- %struct.md5_ctx = type { i32, i32, i32, i32, [2 x i32], i32, [128 x i8], [4294967288 x i8] }
-
-define i8* @md5_buffer(i8* %buffer, i64 %len, i8* %resblock) {
-entry:
- %ctx = alloca %struct.md5_ctx, align 16 ; <%struct.md5_ctx*> [#uses=3]
- call void @md5_init_ctx( %struct.md5_ctx* %ctx )
- call void @md5_process_bytes( i8* %buffer, i64 %len, %struct.md5_ctx* %ctx )
- %tmp4 = call i8* @md5_finish_ctx( %struct.md5_ctx* %ctx, i8* %resblock ) ; <i8*> [#uses=1]
- ret i8* %tmp4
-}
-
-declare void @md5_init_ctx(%struct.md5_ctx*)
-
-declare i8* @md5_finish_ctx(%struct.md5_ctx*, i8*)
-
-declare void @md5_process_bytes(i8*, i64, %struct.md5_ctx*)
diff --git a/release_23/test/CodeGen/X86/2007-04-24-VectorCrash.ll b/release_23/test/CodeGen/X86/2007-04-24-VectorCrash.ll
deleted file mode 100644
index ce23da0b535f..000000000000
--- a/release_23/test/CodeGen/X86/2007-04-24-VectorCrash.ll
+++ /dev/null
@@ -1,63 +0,0 @@
-; RUN: llvm-as < %s | llc -mcpu=yonah
-target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64"
-target triple = "i686-apple-darwin8"
-
-declare <4 x float> @llvm.x86.sse.add.ss(<4 x float>, <4 x float>)
-
-define void @test(float* %P) {
-entry:
- or <4 x i32> zeroinitializer, and (<4 x i32> bitcast (<4 x float> shufflevector (<4 x float> undef, <4 x float> undef, <4 x i32> zeroinitializer) to <4 x i32>), <4 x i32> < i32 -2147483648, i32 -2147483648, i32 -2147483648, i32 -2147483648 >) ; <<4 x i32>>:0 [#uses=1]
- bitcast <4 x i32> %0 to <4 x float> ; <<4 x float>>:1 [#uses=1]
- sub <4 x float> %1, zeroinitializer ; <<4 x float>>:2 [#uses=1]
- sub <4 x float> shufflevector (<4 x float> undef, <4 x float> undef, <4 x i32> zeroinitializer), %2 ; <<4 x float>>:3 [#uses=1]
- shufflevector <4 x float> zeroinitializer, <4 x float> %3, <4 x i32> < i32 0, i32 5, i32 6, i32 7 > ; <<4 x float>>:4 [#uses=1]
- shufflevector <4 x float> zeroinitializer, <4 x float> %4, <4 x i32> < i32 0, i32 5, i32 6, i32 7 > ; <<4 x float>>:5 [#uses=1]
- shufflevector <4 x float> zeroinitializer, <4 x float> %5, <4 x i32> < i32 0, i32 1, i32 2, i32 7 > ; <<4 x float>>:6 [#uses=1]
- shufflevector <4 x float> %6, <4 x float> zeroinitializer, <4 x i32> < i32 0, i32 1, i32 2, i32 7 > ; <<4 x float>>:7 [#uses=1]
- shufflevector <4 x float> %7, <4 x float> zeroinitializer, <4 x i32> < i32 0, i32 1, i32 2, i32 7 > ; <<4 x float>>:8 [#uses=1]
- shufflevector <4 x float> zeroinitializer, <4 x float> %8, <4 x i32> < i32 0, i32 1, i32 2, i32 7 > ; <<4 x float>>:9 [#uses=1]
- shufflevector <4 x float> zeroinitializer, <4 x float> %9, <4 x i32> < i32 0, i32 1, i32 2, i32 7 > ; <<4 x float>>:10 [#uses=1]
- shufflevector <4 x float> zeroinitializer, <4 x float> %10, <4 x i32> < i32 0, i32 5, i32 6, i32 7 > ; <<4 x float>>:11 [#uses=1]
- shufflevector <4 x float> zeroinitializer, <4 x float> %11, <4 x i32> < i32 0, i32 5, i32 6, i32 7 > ; <<4 x float>>:12 [#uses=1]
- shufflevector <4 x float> %12, <4 x float> zeroinitializer, <4 x i32> < i32 0, i32 1, i32 2, i32 7 > ; <<4 x float>>:13 [#uses=1]
- shufflevector <4 x float> zeroinitializer, <4 x float> %13, <4 x i32> < i32 0, i32 1, i32 2, i32 7 > ; <<4 x float>>:14 [#uses=1]
- shufflevector <4 x float> zeroinitializer, <4 x float> %14, <4 x i32> < i32 0, i32 1, i32 2, i32 7 > ; <<4 x float>>:15 [#uses=1]
- shufflevector <4 x float> %15, <4 x float> zeroinitializer, <4 x i32> < i32 0, i32 1, i32 2, i32 7 > ; <<4 x float>>:16 [#uses=1]
- shufflevector <4 x float> zeroinitializer, <4 x float> %16, <4 x i32> < i32 0, i32 1, i32 2, i32 7 > ; <<4 x float>>:17 [#uses=1]
- shufflevector <4 x float> %17, <4 x float> zeroinitializer, <4 x i32> < i32 0, i32 1, i32 2, i32 7 > ; <<4 x float>>:18 [#uses=1]
- shufflevector <4 x float> %18, <4 x float> zeroinitializer, <4 x i32> < i32 0, i32 1, i32 2, i32 7 > ; <<4 x float>>:19 [#uses=1]
- shufflevector <4 x float> zeroinitializer, <4 x float> %19, <4 x i32> < i32 0, i32 1, i32 2, i32 7 > ; <<4 x float>>:20 [#uses=1]
- shufflevector <4 x float> %20, <4 x float> zeroinitializer, <4 x i32> < i32 0, i32 1, i32 2, i32 7 > ; <<4 x float>>:21 [#uses=1]
- shufflevector <4 x float> %21, <4 x float> zeroinitializer, <4 x i32> < i32 0, i32 1, i32 2, i32 7 > ; <<4 x float>>:22 [#uses=1]
- mul <4 x float> %22, zeroinitializer ; <<4 x float>>:23 [#uses=1]
- shufflevector <4 x float> %23, <4 x float> undef, <4 x i32> < i32 2, i32 2, i32 2, i32 2 > ; <<4 x float>>:24 [#uses=1]
- call <4 x float> @llvm.x86.sse.add.ss( <4 x float> zeroinitializer, <4 x float> %24 ) ; <<4 x float>>:25 [#uses=1]
- shufflevector <4 x float> %25, <4 x float> undef, <4 x i32> zeroinitializer ; <<4 x float>>:26 [#uses=1]
- shufflevector <4 x float> %26, <4 x float> zeroinitializer, <4 x i32> zeroinitializer ; <<4 x float>>:27 [#uses=1]
- shufflevector <4 x float> %27, <4 x float> zeroinitializer, <4 x i32> < i32 4, i32 1, i32 6, i32 7 > ; <<4 x float>>:28 [#uses=1]
- mul <4 x float> zeroinitializer, %28 ; <<4 x float>>:29 [#uses=1]
- add <4 x float> %29, zeroinitializer ; <<4 x float>>:30 [#uses=1]
- mul <4 x float> zeroinitializer, %30 ; <<4 x float>>:31 [#uses=1]
- shufflevector <4 x float> zeroinitializer, <4 x float> %31, <4 x i32> < i32 0, i32 5, i32 6, i32 7 > ; <<4 x float>>:32 [#uses=1]
- mul <4 x float> zeroinitializer, %32 ; <<4 x float>>:33 [#uses=1]
- shufflevector <4 x float> %33, <4 x float> zeroinitializer, <4 x i32> zeroinitializer ; <<4 x float>>:34 [#uses=1]
- mul <4 x float> zeroinitializer, %34 ; <<4 x float>>:35 [#uses=1]
- shufflevector <4 x float> zeroinitializer, <4 x float> %35, <4 x i32> < i32 0, i32 1, i32 6, i32 7 > ; <<4 x float>>:36 [#uses=1]
- shufflevector <4 x float> zeroinitializer, <4 x float> %36, <4 x i32> < i32 0, i32 5, i32 6, i32 7 > ; <<4 x float>>:37 [#uses=1]
- shufflevector <4 x float> zeroinitializer, <4 x float> %37, <4 x i32> < i32 0, i32 5, i32 6, i32 7 > ; <<4 x float>>:38 [#uses=1]
- shufflevector <4 x float> zeroinitializer, <4 x float> %38, <4 x i32> < i32 0, i32 5, i32 6, i32 7 > ; <<4 x float>>:39 [#uses=1]
- shufflevector <4 x float> zeroinitializer, <4 x float> %39, <4 x i32> < i32 0, i32 5, i32 6, i32 7 > ; <<4 x float>>:40 [#uses=1]
- shufflevector <4 x float> zeroinitializer, <4 x float> %40, <4 x i32> < i32 4, i32 1, i32 6, i32 7 > ; <<4 x float>>:41 [#uses=1]
- shufflevector <4 x float> zeroinitializer, <4 x float> %41, <4 x i32> < i32 4, i32 1, i32 6, i32 7 > ; <<4 x float>>:42 [#uses=1]
- shufflevector <4 x float> zeroinitializer, <4 x float> %42, <4 x i32> < i32 4, i32 1, i32 6, i32 7 > ; <<4 x float>>:43 [#uses=1]
- shufflevector <4 x float> zeroinitializer, <4 x float> %43, <4 x i32> < i32 4, i32 1, i32 6, i32 7 > ; <<4 x float>>:44 [#uses=1]
- shufflevector <4 x float> zeroinitializer, <4 x float> %44, <4 x i32> < i32 0, i32 5, i32 6, i32 7 > ; <<4 x float>>:45 [#uses=1]
- shufflevector <4 x float> zeroinitializer, <4 x float> %45, <4 x i32> < i32 0, i32 5, i32 6, i32 7 > ; <<4 x float>>:46 [#uses=1]
- shufflevector <4 x float> zeroinitializer, <4 x float> %46, <4 x i32> < i32 0, i32 5, i32 6, i32 7 > ; <<4 x float>>:47 [#uses=1]
- shufflevector <4 x float> zeroinitializer, <4 x float> %47, <4 x i32> < i32 0, i32 5, i32 6, i32 7 > ; <<4 x float>>:48 [#uses=1]
- shufflevector <4 x float> %48, <4 x float> undef, <4 x i32> < i32 1, i32 1, i32 1, i32 1 > ; <<4 x float>>:49 [#uses=1]
- add <4 x float> %49, zeroinitializer ; <<4 x float>>:50 [#uses=1]
- %tmp5845 = extractelement <4 x float> %50, i32 2 ; <float> [#uses=1]
- store float %tmp5845, float* %P
- ret void
-}
diff --git a/release_23/test/CodeGen/X86/2007-04-25-MMX-PADDQ.ll b/release_23/test/CodeGen/X86/2007-04-25-MMX-PADDQ.ll
deleted file mode 100644
index ac85a9d72bbd..000000000000
--- a/release_23/test/CodeGen/X86/2007-04-25-MMX-PADDQ.ll
+++ /dev/null
@@ -1,25 +0,0 @@
-; RUN: llvm-as < %s | llc -o - -march=x86 -mattr=+mmx | grep paddq | count 2
-; RUN: llvm-as < %s | llc -o - -march=x86 -mattr=+mmx | grep movq | count 2
-
-define <1 x i64> @unsigned_add3(<1 x i64>* %a, <1 x i64>* %b, i32 %count) {
-entry:
- %tmp2942 = icmp eq i32 %count, 0 ; <i1> [#uses=1]
- br i1 %tmp2942, label %bb31, label %bb26
-
-bb26: ; preds = %bb26, %entry
- %i.037.0 = phi i32 [ 0, %entry ], [ %tmp25, %bb26 ] ; <i32> [#uses=3]
- %sum.035.0 = phi <1 x i64> [ zeroinitializer, %entry ], [ %tmp22, %bb26 ] ; <<1 x i64>> [#uses=1]
- %tmp13 = getelementptr <1 x i64>* %b, i32 %i.037.0 ; <<1 x i64>*> [#uses=1]
- %tmp14 = load <1 x i64>* %tmp13 ; <<1 x i64>> [#uses=1]
- %tmp18 = getelementptr <1 x i64>* %a, i32 %i.037.0 ; <<1 x i64>*> [#uses=1]
- %tmp19 = load <1 x i64>* %tmp18 ; <<1 x i64>> [#uses=1]
- %tmp21 = add <1 x i64> %tmp19, %tmp14 ; <<1 x i64>> [#uses=1]
- %tmp22 = add <1 x i64> %tmp21, %sum.035.0 ; <<1 x i64>> [#uses=2]
- %tmp25 = add i32 %i.037.0, 1 ; <i32> [#uses=2]
- %tmp29 = icmp ult i32 %tmp25, %count ; <i1> [#uses=1]
- br i1 %tmp29, label %bb26, label %bb31
-
-bb31: ; preds = %bb26, %entry
- %sum.035.1 = phi <1 x i64> [ zeroinitializer, %entry ], [ %tmp22, %bb26 ] ; <<1 x i64>> [#uses=1]
- ret <1 x i64> %sum.035.1
-}
diff --git a/release_23/test/CodeGen/X86/2007-04-27-InlineAsm-IntMemInput.ll b/release_23/test/CodeGen/X86/2007-04-27-InlineAsm-IntMemInput.ll
deleted file mode 100644
index cbd6a73dbee7..000000000000
--- a/release_23/test/CodeGen/X86/2007-04-27-InlineAsm-IntMemInput.ll
+++ /dev/null
@@ -1,12 +0,0 @@
-; RUN: llvm-as < %s | llc | not grep {bsrl.*10}
-; PR1356
-
-target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64"
-target triple = "i686-apple-darwin8"
-
-define i32 @main() {
-entry:
- %tmp4 = tail call i32 asm "bsrl $1, $0", "=r,ro,~{dirflag},~{fpsr},~{flags},~{cc}"( i32 10 ) ; <i32> [#uses=1]
- ret i32 %tmp4
-}
-
diff --git a/release_23/test/CodeGen/X86/2007-05-05-VecCastExpand.ll b/release_23/test/CodeGen/X86/2007-05-05-VecCastExpand.ll
deleted file mode 100644
index b0bcf5c155aa..000000000000
--- a/release_23/test/CodeGen/X86/2007-05-05-VecCastExpand.ll
+++ /dev/null
@@ -1,21 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -mcpu=i386 -mattr=+sse
-; PR1371
-
-@str = external global [18 x i8] ; <[18 x i8]*> [#uses=1]
-
-define void @test() {
-bb.i:
- %tmp.i660 = load <4 x float>* null ; <<4 x float>> [#uses=1]
- call void (i32, ...)* @printf( i32 0, i8* getelementptr ([18 x i8]* @str, i32 0, i64 0), double 0.000000e+00, double 0.000000e+00, double 0.000000e+00, double 0.000000e+00 )
- %tmp152.i = load <4 x i32>* null ; <<4 x i32>> [#uses=1]
- %tmp156.i = bitcast <4 x i32> %tmp152.i to <4 x i32> ; <<4 x i32>> [#uses=1]
- %tmp175.i = bitcast <4 x float> %tmp.i660 to <4 x i32> ; <<4 x i32>> [#uses=1]
- %tmp176.i = xor <4 x i32> %tmp156.i, < i32 -1, i32 -1, i32 -1, i32 -1 > ; <<4 x i32>> [#uses=1]
- %tmp177.i = and <4 x i32> %tmp176.i, %tmp175.i ; <<4 x i32>> [#uses=1]
- %tmp190.i = or <4 x i32> %tmp177.i, zeroinitializer ; <<4 x i32>> [#uses=1]
- %tmp191.i = bitcast <4 x i32> %tmp190.i to <4 x float> ; <<4 x float>> [#uses=1]
- store <4 x float> %tmp191.i, <4 x float>* null
- ret void
-}
-
-declare void @printf(i32, ...)
diff --git a/release_23/test/CodeGen/X86/2007-05-07-InvokeSRet.ll b/release_23/test/CodeGen/X86/2007-05-07-InvokeSRet.ll
deleted file mode 100644
index ff7aac0239d8..000000000000
--- a/release_23/test/CodeGen/X86/2007-05-07-InvokeSRet.ll
+++ /dev/null
@@ -1,15 +0,0 @@
-; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -enable-eh -disable-fp-elim | not grep {addl .12, %esp}
-; PR1398
-
- %struct.S = type { i32, i32 }
-
-declare void @invokee(%struct.S* sret )
-
-define void @invoker(%struct.S* %name.0.0) {
-entry:
- invoke void @invokee( %struct.S* %name.0.0 sret )
- to label %return unwind label %return
-
-return: ; preds = %entry, %entry
- ret void
-}
diff --git a/release_23/test/CodeGen/X86/2007-05-14-LiveIntervalAssert.ll b/release_23/test/CodeGen/X86/2007-05-14-LiveIntervalAssert.ll
deleted file mode 100644
index 61f8b2ce58f2..000000000000
--- a/release_23/test/CodeGen/X86/2007-05-14-LiveIntervalAssert.ll
+++ /dev/null
@@ -1,27 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86-64
-
- %struct.XDesc = type <{ i32, %struct.OpaqueXDataStorageType** }>
- %struct.OpaqueXDataStorageType = type opaque
-
-declare i16 @GetParamDesc(%struct.XDesc*, i32, i32, %struct.XDesc*) signext
-
-declare void @r_raise(i64, i8*, ...)
-
-define i64 @app_send_event(i64 %self, i64 %event_class, i64 %event_id, i64 %params, i64 %need_retval) {
-entry:
- br i1 false, label %cond_true109, label %bb83.preheader
-
-bb83.preheader: ; preds = %entry
- ret i64 0
-
-cond_true109: ; preds = %entry
- br i1 false, label %cond_next164, label %cond_true239
-
-cond_next164: ; preds = %cond_true109
- %tmp176 = call i16 @GetParamDesc( %struct.XDesc* null, i32 1701999219, i32 1413830740, %struct.XDesc* null ) signext ; <i16> [#uses=0]
- call void (i64, i8*, ...)* @r_raise( i64 0, i8* null )
- unreachable
-
-cond_true239: ; preds = %cond_true109
- ret i64 0
-}
diff --git a/release_23/test/CodeGen/X86/2007-05-15-maskmovq.ll b/release_23/test/CodeGen/X86/2007-05-15-maskmovq.ll
deleted file mode 100644
index d9836e4a8d5d..000000000000
--- a/release_23/test/CodeGen/X86/2007-05-15-maskmovq.ll
+++ /dev/null
@@ -1,14 +0,0 @@
-; RUN: llvm-as < %s | llc -mcpu=yonah
-
-target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64"
-target triple = "i686-apple-darwin8"
-
-define void @test(<1 x i64> %c64, <1 x i64> %mask1, i8* %P) {
-entry:
- %tmp4 = bitcast <1 x i64> %mask1 to <8 x i8> ; <<8 x i8>> [#uses=1]
- %tmp6 = bitcast <1 x i64> %c64 to <8 x i8> ; <<8 x i8>> [#uses=1]
- tail call void @llvm.x86.mmx.maskmovq( <8 x i8> %tmp6, <8 x i8> %tmp4, i8* %P )
- ret void
-}
-
-declare void @llvm.x86.mmx.maskmovq(<8 x i8>, <8 x i8>, i8*)
diff --git a/release_23/test/CodeGen/X86/2007-05-17-ShuffleISelBug.ll b/release_23/test/CodeGen/X86/2007-05-17-ShuffleISelBug.ll
deleted file mode 100644
index 64ccef3917a3..000000000000
--- a/release_23/test/CodeGen/X86/2007-05-17-ShuffleISelBug.ll
+++ /dev/null
@@ -1,23 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | not grep punpckhwd
-
-declare <8 x i16> @llvm.x86.sse2.packuswb.128(<8 x i16>, <8 x i16>)
-
-declare <8 x i16> @llvm.x86.sse2.psrl.w(<8 x i16>, <8 x i16>)
-
-define fastcc void @test(i32* %src, i32 %sbpr, i32* %dst, i32 %dbpr, i32 %w, i32 %h, i32 %dstalpha, i32 %mask) {
- %tmp633 = shufflevector <8 x i16> zeroinitializer, <8 x i16> undef, <8 x i32> < i32 4, i32 4, i32 5, i32 5, i32 6, i32 6, i32 7, i32 7 >
- %tmp715 = mul <8 x i16> zeroinitializer, %tmp633
- %tmp776 = bitcast <8 x i16> %tmp715 to <4 x i32>
- %tmp777 = add <4 x i32> %tmp776, shufflevector (<4 x i32> < i32 65537, i32 0, i32 0, i32 0 >, <4 x i32> < i32 65537, i32 0, i32 0, i32 0 >, <4 x i32> zeroinitializer)
- %tmp805 = add <4 x i32> %tmp777, zeroinitializer
- %tmp832 = bitcast <4 x i32> %tmp805 to <8 x i16>
- %tmp838 = tail call <8 x i16> @llvm.x86.sse2.psrl.w( <8 x i16> %tmp832, <8 x i16> < i16 8, i16 undef, i16 undef, i16 undef, i16 undef, i16 undef, i16 undef, i16 undef > )
- %tmp1020 = tail call <8 x i16> @llvm.x86.sse2.packuswb.128( <8 x i16> zeroinitializer, <8 x i16> %tmp838 )
- %tmp1030 = bitcast <8 x i16> %tmp1020 to <4 x i32>
- %tmp1033 = add <4 x i32> zeroinitializer, %tmp1030
- %tmp1048 = bitcast <4 x i32> %tmp1033 to <2 x i64>
- %tmp1049 = or <2 x i64> %tmp1048, zeroinitializer
- store <2 x i64> %tmp1049, <2 x i64>* null
- ret void
-}
diff --git a/release_23/test/CodeGen/X86/2007-06-04-X86-64-CtorAsmBugs.ll b/release_23/test/CodeGen/X86/2007-06-04-X86-64-CtorAsmBugs.ll
deleted file mode 100644
index 5d090759092e..000000000000
--- a/release_23/test/CodeGen/X86/2007-06-04-X86-64-CtorAsmBugs.ll
+++ /dev/null
@@ -1,28 +0,0 @@
-; RUN: llvm-as < %s | llc -mtriple=x86_64-apple-darwin | not grep GOTPCREL
-; RUN: llvm-as < %s | llc -mtriple=x86_64-apple-darwin | grep ".align.*3"
-
- %struct.A = type { [1024 x i8] }
-@_ZN1A1aE = global %struct.A zeroinitializer, align 32 ; <%struct.A*> [#uses=1]
-@llvm.global_ctors = appending global [1 x { i32, void ()* }] [ { i32, void ()* } { i32 65535, void ()* @_GLOBAL__I__ZN1A1aE } ] ; <[1 x { i32, void ()* }]*> [#uses=0]
-
-define internal void @_GLOBAL__I__ZN1A1aE() section "__TEXT,__StaticInit,regular,pure_instructions" {
-entry:
- br label %bb.i
-
-bb.i: ; preds = %bb.i, %entry
- %i.1.i1.0 = phi i32 [ 0, %entry ], [ %indvar.next, %bb.i ] ; <i32> [#uses=2]
- %tmp1012.i = sext i32 %i.1.i1.0 to i64 ; <i64> [#uses=1]
- %tmp13.i = getelementptr %struct.A* @_ZN1A1aE, i32 0, i32 0, i64 %tmp1012.i ; <i8*> [#uses=1]
- store i8 0, i8* %tmp13.i
- %indvar.next = add i32 %i.1.i1.0, 1 ; <i32> [#uses=2]
- %exitcond = icmp eq i32 %indvar.next, 1024 ; <i1> [#uses=1]
- br i1 %exitcond, label %_Z41__static_initialization_and_destruction_0ii.exit, label %bb.i
-
-_Z41__static_initialization_and_destruction_0ii.exit: ; preds = %bb.i
- ret void
-}
-
-define i32 @main(i32 %argc, i8** %argv) {
-entry:
- ret i32 0
-}
diff --git a/release_23/test/CodeGen/X86/2007-06-04-tailmerge4.ll b/release_23/test/CodeGen/X86/2007-06-04-tailmerge4.ll
deleted file mode 100644
index 497a83aa34ad..000000000000
--- a/release_23/test/CodeGen/X86/2007-06-04-tailmerge4.ll
+++ /dev/null
@@ -1,454 +0,0 @@
-; RUN: llvm-as < %s | llc -enable-eh | grep invcont131
-; PR 1496: tail merge was incorrectly removing this block
-
-; ModuleID = 'report.1.bc'
-target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64"
-target triple = "i686-pc-linux-gnu"
- %struct.ALLOC = type { %struct.string___XUB, [2 x i8] }
- %struct.RETURN = type { i32, i32, i32, i64 }
- %struct.ada__streams__root_stream_type = type { %struct.ada__tags__dispatch_table* }
- %struct.ada__tags__dispatch_table = type { [1 x i8*] }
- %struct.ada__text_io__text_afcb = type { %struct.system__file_control_block__afcb, i32, i32, i32, i32, i32, %struct.ada__text_io__text_afcb*, i8, i8 }
- %struct.string___XUB = type { i32, i32 }
- %struct.string___XUP = type { i8*, %struct.string___XUB* }
- %struct.system__file_control_block__afcb = type { %struct.ada__streams__root_stream_type, i32, %struct.string___XUP, i32, %struct.string___XUP, i8, i8, i8, i8, i8, i8, i8, %struct.system__file_control_block__afcb*, %struct.system__file_control_block__afcb* }
- %struct.system__secondary_stack__mark_id = type { i8*, i32 }
- %struct.wide_string___XUP = type { i16*, %struct.string___XUB* }
-@report_E = global i8 0 ; <i8*> [#uses=0]
-@report__test_status = internal global i8 1 ; <i8*> [#uses=8]
-@report__test_name = internal global [15 x i8] zeroinitializer ; <[15 x i8]*> [#uses=10]
-@report__test_name_len = internal global i32 0 ; <i32*> [#uses=15]
-@.str = internal constant [12 x i8] c"report.adb\00\00" ; <[12 x i8]*> [#uses=1]
-@C.26.599 = internal constant %struct.string___XUB { i32 1, i32 1 } ; <%struct.string___XUB*> [#uses=1]
-@.str1 = internal constant [1 x i8] c":" ; <[1 x i8]*> [#uses=1]
-@.str2 = internal constant [1 x i8] c" " ; <[1 x i8]*> [#uses=1]
-@.str3 = internal constant [1 x i8] c"-" ; <[1 x i8]*> [#uses=1]
-@.str5 = internal constant [10 x i8] c"0123456789" ; <[10 x i8]*> [#uses=12]
-@C.59.855 = internal constant %struct.string___XUB { i32 1, i32 0 } ; <%struct.string___XUB*> [#uses=1]
-@C.69.876 = internal constant %struct.string___XUB { i32 1, i32 3 } ; <%struct.string___XUB*> [#uses=1]
-@C.70.879 = internal constant %struct.string___XUB { i32 1, i32 6 } ; <%struct.string___XUB*> [#uses=1]
-@C.81.900 = internal constant %struct.string___XUB { i32 1, i32 5 } ; <%struct.string___XUB*> [#uses=1]
-@.str6 = internal constant [0 x i8] zeroinitializer ; <[0 x i8]*> [#uses=1]
-@.str7 = internal constant [3 x i8] c"2.5" ; <[3 x i8]*> [#uses=1]
-@.str8 = internal constant [6 x i8] c"ACATS " ; <[6 x i8]*> [#uses=1]
-@.str9 = internal constant [5 x i8] c",.,. " ; <[5 x i8]*> [#uses=1]
-@.str10 = internal constant [1 x i8] c"." ; <[1 x i8]*> [#uses=1]
-@.str11 = internal constant [5 x i8] c"---- " ; <[5 x i8]*> [#uses=1]
-@.str12 = internal constant [5 x i8] c" - " ; <[5 x i8]*> [#uses=1]
-@.str13 = internal constant [5 x i8] c" * " ; <[5 x i8]*> [#uses=1]
-@.str14 = internal constant [5 x i8] c" + " ; <[5 x i8]*> [#uses=1]
-@.str15 = internal constant [5 x i8] c" ! " ; <[5 x i8]*> [#uses=1]
-@C.209.1380 = internal constant %struct.string___XUB { i32 1, i32 37 } ; <%struct.string___XUB*> [#uses=1]
-@.str16 = internal constant [37 x i8] c" PASSED ============================." ; <[37 x i8]*> [#uses=1]
-@.str17 = internal constant [5 x i8] c"==== " ; <[5 x i8]*> [#uses=1]
-@.str18 = internal constant [37 x i8] c" NOT-APPLICABLE ++++++++++++++++++++." ; <[37 x i8]*> [#uses=1]
-@.str19 = internal constant [5 x i8] c"++++ " ; <[5 x i8]*> [#uses=1]
-@.str20 = internal constant [37 x i8] c" TENTATIVELY PASSED !!!!!!!!!!!!!!!!." ; <[37 x i8]*> [#uses=1]
-@.str21 = internal constant [5 x i8] c"!!!! " ; <[5 x i8]*> [#uses=1]
-@.str22 = internal constant [37 x i8] c" SEE '!' COMMENTS FOR SPECIAL NOTES!!" ; <[37 x i8]*> [#uses=1]
-@.str23 = internal constant [37 x i8] c" FAILED ****************************." ; <[37 x i8]*> [#uses=1]
-@.str24 = internal constant [5 x i8] c"**** " ; <[5 x i8]*> [#uses=1]
-@__gnat_others_value = external constant i32 ; <i32*> [#uses=2]
-@system__soft_links__abort_undefer = external global void ()* ; <void ()**> [#uses=1]
-@C.320.1854 = internal constant %struct.string___XUB { i32 2, i32 6 } ; <%struct.string___XUB*> [#uses=1]
-
-declare void @report__put_msg(i64 %msg.0.0)
-
-declare void @__gnat_rcheck_05(i8*, i32)
-
-declare void @__gnat_rcheck_12(i8*, i32)
-
-declare %struct.ada__text_io__text_afcb* @ada__text_io__standard_output()
-
-declare void @ada__text_io__set_col(%struct.ada__text_io__text_afcb*, i32)
-
-declare void @ada__text_io__put_line(%struct.ada__text_io__text_afcb*, i64)
-
-declare void @report__time_stamp(%struct.string___XUP* sret %agg.result)
-
-declare i64 @ada__calendar__clock()
-
-declare void @ada__calendar__split(%struct.RETURN* sret , i64)
-
-declare void @system__string_ops_concat_5__str_concat_5(%struct.string___XUP* sret , i64, i64, i64, i64, i64)
-
-declare void @system__string_ops_concat_3__str_concat_3(%struct.string___XUP* sret , i64, i64, i64)
-
-declare i8* @system__secondary_stack__ss_allocate(i32)
-
-declare void @report__test(i64 %name.0.0, i64 %descr.0.0)
-
-declare void @system__secondary_stack__ss_mark(%struct.system__secondary_stack__mark_id* sret )
-
-declare i8* @llvm.eh.exception()
-
-declare i32 @llvm.eh.selector(i8*, i8*, ...)
-
-declare i32 @llvm.eh.typeid.for(i8*)
-
-declare i32 @__gnat_eh_personality(...)
-
-declare i32 @_Unwind_Resume(...)
-
-declare void @__gnat_rcheck_07(i8*, i32)
-
-declare void @system__secondary_stack__ss_release(i64)
-
-declare void @report__comment(i64 %descr.0.0)
-
-declare void @report__failed(i64 %descr.0.0)
-
-declare void @report__not_applicable(i64 %descr.0.0)
-
-declare void @report__special_action(i64 %descr.0.0)
-
-define void @report__result() {
-entry:
- %tmp = alloca %struct.system__secondary_stack__mark_id, align 8 ; <%struct.system__secondary_stack__mark_id*> [#uses=3]
- %A.210 = alloca %struct.string___XUB, align 8 ; <%struct.string___XUB*> [#uses=3]
- %tmp5 = alloca %struct.string___XUP, align 8 ; <%struct.string___XUP*> [#uses=3]
- %A.229 = alloca %struct.string___XUB, align 8 ; <%struct.string___XUB*> [#uses=3]
- %tmp10 = alloca %struct.string___XUP, align 8 ; <%struct.string___XUP*> [#uses=3]
- %A.248 = alloca %struct.string___XUB, align 8 ; <%struct.string___XUB*> [#uses=3]
- %tmp15 = alloca %struct.string___XUP, align 8 ; <%struct.string___XUP*> [#uses=3]
- %A.270 = alloca %struct.string___XUB, align 8 ; <%struct.string___XUB*> [#uses=3]
- %tmp20 = alloca %struct.string___XUP, align 8 ; <%struct.string___XUP*> [#uses=3]
- %A.284 = alloca %struct.string___XUB, align 8 ; <%struct.string___XUB*> [#uses=3]
- %tmp25 = alloca %struct.string___XUP, align 8 ; <%struct.string___XUP*> [#uses=3]
- call void @system__secondary_stack__ss_mark( %struct.system__secondary_stack__mark_id* %tmp sret )
- %tmp28 = getelementptr %struct.system__secondary_stack__mark_id* %tmp, i32 0, i32 0 ; <i8**> [#uses=1]
- %tmp29 = load i8** %tmp28 ; <i8*> [#uses=2]
- %tmp31 = getelementptr %struct.system__secondary_stack__mark_id* %tmp, i32 0, i32 1 ; <i32*> [#uses=1]
- %tmp32 = load i32* %tmp31 ; <i32> [#uses=2]
- %tmp33 = load i8* @report__test_status ; <i8> [#uses=1]
- switch i8 %tmp33, label %bb483 [
- i8 0, label %bb
- i8 2, label %bb143
- i8 3, label %bb261
- ]
-
-bb: ; preds = %entry
- %tmp34 = load i32* @report__test_name_len ; <i32> [#uses=4]
- %tmp35 = icmp sgt i32 %tmp34, 0 ; <i1> [#uses=2]
- %tmp40 = icmp sgt i32 %tmp34, 15 ; <i1> [#uses=1]
- %bothcond139 = and i1 %tmp35, %tmp40 ; <i1> [#uses=1]
- br i1 %bothcond139, label %cond_true43, label %cond_next44
-
-cond_true43: ; preds = %bb
- invoke void @__gnat_rcheck_12( i8* getelementptr ([12 x i8]* @.str, i32 0, i32 0), i32 212 )
- to label %UnifiedUnreachableBlock unwind label %unwind
-
-unwind: ; preds = %invcont589, %cond_next567, %bb555, %cond_true497, %invcont249, %cond_next227, %bb215, %cond_true157, %invcont131, %cond_next109, %bb97, %cond_true43
- %eh_ptr = call i8* @llvm.eh.exception( ) ; <i8*> [#uses=1]
- br label %cleanup717
-
-cond_next44: ; preds = %bb
- %tmp72 = getelementptr %struct.string___XUB* %A.210, i32 0, i32 0 ; <i32*> [#uses=1]
- store i32 1, i32* %tmp72
- %tmp73 = getelementptr %struct.string___XUB* %A.210, i32 0, i32 1 ; <i32*> [#uses=1]
- store i32 %tmp34, i32* %tmp73
- br i1 %tmp35, label %cond_true80, label %cond_next109
-
-cond_true80: ; preds = %cond_next44
- %tmp45.off = add i32 %tmp34, -1 ; <i32> [#uses=1]
- %bothcond = icmp ugt i32 %tmp45.off, 14 ; <i1> [#uses=1]
- br i1 %bothcond, label %bb97, label %cond_next109
-
-bb97: ; preds = %cond_true80
- invoke void @__gnat_rcheck_05( i8* getelementptr ([12 x i8]* @.str, i32 0, i32 0), i32 212 )
- to label %UnifiedUnreachableBlock unwind label %unwind
-
-cond_next109: ; preds = %cond_true80, %cond_next44
- %A.210128 = ptrtoint %struct.string___XUB* %A.210 to i32 ; <i32> [#uses=1]
- %A.210128129 = zext i32 %A.210128 to i64 ; <i64> [#uses=1]
- %A.210128129130 = shl i64 %A.210128129, 32 ; <i64> [#uses=1]
- %A.210128129130.ins = or i64 %A.210128129130, zext (i32 ptrtoint ([15 x i8]* @report__test_name to i32) to i64) ; <i64> [#uses=1]
- invoke void @system__string_ops_concat_3__str_concat_3( %struct.string___XUP* %tmp5 sret , i64 or (i64 zext (i32 ptrtoint ([5 x i8]* @.str17 to i32) to i64), i64 shl (i64 zext (i32 ptrtoint (%struct.string___XUB* @C.81.900 to i32) to i64), i64 32)), i64 %A.210128129130.ins, i64 or (i64 zext (i32 ptrtoint ([37 x i8]* @.str16 to i32) to i64), i64 shl (i64 zext (i32 ptrtoint (%struct.string___XUB* @C.209.1380 to i32) to i64), i64 32)) )
- to label %invcont131 unwind label %unwind
-
-invcont131: ; preds = %cond_next109
- %tmp133 = getelementptr %struct.string___XUP* %tmp5, i32 0, i32 0 ; <i8**> [#uses=1]
- %tmp134 = load i8** %tmp133 ; <i8*> [#uses=1]
- %tmp134120 = ptrtoint i8* %tmp134 to i32 ; <i32> [#uses=1]
- %tmp134120121 = zext i32 %tmp134120 to i64 ; <i64> [#uses=1]
- %tmp136 = getelementptr %struct.string___XUP* %tmp5, i32 0, i32 1 ; <%struct.string___XUB**> [#uses=1]
- %tmp137 = load %struct.string___XUB** %tmp136 ; <%struct.string___XUB*> [#uses=1]
- %tmp137116 = ptrtoint %struct.string___XUB* %tmp137 to i32 ; <i32> [#uses=1]
- %tmp137116117 = zext i32 %tmp137116 to i64 ; <i64> [#uses=1]
- %tmp137116117118 = shl i64 %tmp137116117, 32 ; <i64> [#uses=1]
- %tmp137116117118.ins = or i64 %tmp137116117118, %tmp134120121 ; <i64> [#uses=1]
- invoke fastcc void @report__put_msg( i64 %tmp137116117118.ins )
- to label %cond_next618 unwind label %unwind
-
-bb143: ; preds = %entry
- %tmp144 = load i32* @report__test_name_len ; <i32> [#uses=4]
- %tmp147 = icmp sgt i32 %tmp144, 0 ; <i1> [#uses=2]
- %tmp154 = icmp sgt i32 %tmp144, 15 ; <i1> [#uses=1]
- %bothcond140 = and i1 %tmp147, %tmp154 ; <i1> [#uses=1]
- br i1 %bothcond140, label %cond_true157, label %cond_next160
-
-cond_true157: ; preds = %bb143
- invoke void @__gnat_rcheck_12( i8* getelementptr ([12 x i8]* @.str, i32 0, i32 0), i32 215 )
- to label %UnifiedUnreachableBlock unwind label %unwind
-
-cond_next160: ; preds = %bb143
- %tmp189 = getelementptr %struct.string___XUB* %A.229, i32 0, i32 0 ; <i32*> [#uses=1]
- store i32 1, i32* %tmp189
- %tmp190 = getelementptr %struct.string___XUB* %A.229, i32 0, i32 1 ; <i32*> [#uses=1]
- store i32 %tmp144, i32* %tmp190
- br i1 %tmp147, label %cond_true197, label %cond_next227
-
-cond_true197: ; preds = %cond_next160
- %tmp161.off = add i32 %tmp144, -1 ; <i32> [#uses=1]
- %bothcond1 = icmp ugt i32 %tmp161.off, 14 ; <i1> [#uses=1]
- br i1 %bothcond1, label %bb215, label %cond_next227
-
-bb215: ; preds = %cond_true197
- invoke void @__gnat_rcheck_05( i8* getelementptr ([12 x i8]* @.str, i32 0, i32 0), i32 215 )
- to label %UnifiedUnreachableBlock unwind label %unwind
-
-cond_next227: ; preds = %cond_true197, %cond_next160
- %A.229105 = ptrtoint %struct.string___XUB* %A.229 to i32 ; <i32> [#uses=1]
- %A.229105106 = zext i32 %A.229105 to i64 ; <i64> [#uses=1]
- %A.229105106107 = shl i64 %A.229105106, 32 ; <i64> [#uses=1]
- %A.229105106107.ins = or i64 %A.229105106107, zext (i32 ptrtoint ([15 x i8]* @report__test_name to i32) to i64) ; <i64> [#uses=1]
- invoke void @system__string_ops_concat_3__str_concat_3( %struct.string___XUP* %tmp10 sret , i64 or (i64 zext (i32 ptrtoint ([5 x i8]* @.str19 to i32) to i64), i64 shl (i64 zext (i32 ptrtoint (%struct.string___XUB* @C.81.900 to i32) to i64), i64 32)), i64 %A.229105106107.ins, i64 or (i64 zext (i32 ptrtoint ([37 x i8]* @.str18 to i32) to i64), i64 shl (i64 zext (i32 ptrtoint (%struct.string___XUB* @C.209.1380 to i32) to i64), i64 32)) )
- to label %invcont249 unwind label %unwind
-
-invcont249: ; preds = %cond_next227
- %tmp251 = getelementptr %struct.string___XUP* %tmp10, i32 0, i32 0 ; <i8**> [#uses=1]
- %tmp252 = load i8** %tmp251 ; <i8*> [#uses=1]
- %tmp25297 = ptrtoint i8* %tmp252 to i32 ; <i32> [#uses=1]
- %tmp2529798 = zext i32 %tmp25297 to i64 ; <i64> [#uses=1]
- %tmp254 = getelementptr %struct.string___XUP* %tmp10, i32 0, i32 1 ; <%struct.string___XUB**> [#uses=1]
- %tmp255 = load %struct.string___XUB** %tmp254 ; <%struct.string___XUB*> [#uses=1]
- %tmp25593 = ptrtoint %struct.string___XUB* %tmp255 to i32 ; <i32> [#uses=1]
- %tmp2559394 = zext i32 %tmp25593 to i64 ; <i64> [#uses=1]
- %tmp255939495 = shl i64 %tmp2559394, 32 ; <i64> [#uses=1]
- %tmp255939495.ins = or i64 %tmp255939495, %tmp2529798 ; <i64> [#uses=1]
- invoke fastcc void @report__put_msg( i64 %tmp255939495.ins )
- to label %cond_next618 unwind label %unwind
-
-bb261: ; preds = %entry
- %tmp262 = call i8* @llvm.stacksave( ) ; <i8*> [#uses=2]
- %tmp263 = load i32* @report__test_name_len ; <i32> [#uses=4]
- %tmp266 = icmp sgt i32 %tmp263, 0 ; <i1> [#uses=2]
- %tmp273 = icmp sgt i32 %tmp263, 15 ; <i1> [#uses=1]
- %bothcond141 = and i1 %tmp266, %tmp273 ; <i1> [#uses=1]
- br i1 %bothcond141, label %cond_true276, label %cond_next281
-
-cond_true276: ; preds = %bb261
- invoke void @__gnat_rcheck_12( i8* getelementptr ([12 x i8]* @.str, i32 0, i32 0), i32 218 )
- to label %UnifiedUnreachableBlock unwind label %unwind277
-
-unwind277: ; preds = %invcont467, %cond_next442, %invcont370, %cond_next348, %bb336, %cond_true276
- %eh_ptr278 = call i8* @llvm.eh.exception( ) ; <i8*> [#uses=1]
- call void @llvm.stackrestore( i8* %tmp262 )
- br label %cleanup717
-
-cond_next281: ; preds = %bb261
- %tmp310 = getelementptr %struct.string___XUB* %A.248, i32 0, i32 0 ; <i32*> [#uses=1]
- store i32 1, i32* %tmp310
- %tmp311 = getelementptr %struct.string___XUB* %A.248, i32 0, i32 1 ; <i32*> [#uses=1]
- store i32 %tmp263, i32* %tmp311
- br i1 %tmp266, label %cond_true318, label %cond_next348
-
-cond_true318: ; preds = %cond_next281
- %tmp282.off = add i32 %tmp263, -1 ; <i32> [#uses=1]
- %bothcond2 = icmp ugt i32 %tmp282.off, 14 ; <i1> [#uses=1]
- br i1 %bothcond2, label %bb336, label %cond_next348
-
-bb336: ; preds = %cond_true318
- invoke void @__gnat_rcheck_05( i8* getelementptr ([12 x i8]* @.str, i32 0, i32 0), i32 218 )
- to label %UnifiedUnreachableBlock unwind label %unwind277
-
-cond_next348: ; preds = %cond_true318, %cond_next281
- %A.24882 = ptrtoint %struct.string___XUB* %A.248 to i32 ; <i32> [#uses=1]
- %A.2488283 = zext i32 %A.24882 to i64 ; <i64> [#uses=1]
- %A.248828384 = shl i64 %A.2488283, 32 ; <i64> [#uses=1]
- %A.248828384.ins = or i64 %A.248828384, zext (i32 ptrtoint ([15 x i8]* @report__test_name to i32) to i64) ; <i64> [#uses=1]
- invoke void @system__string_ops_concat_3__str_concat_3( %struct.string___XUP* %tmp15 sret , i64 or (i64 zext (i32 ptrtoint ([5 x i8]* @.str21 to i32) to i64), i64 shl (i64 zext (i32 ptrtoint (%struct.string___XUB* @C.81.900 to i32) to i64), i64 32)), i64 %A.248828384.ins, i64 or (i64 zext (i32 ptrtoint ([37 x i8]* @.str20 to i32) to i64), i64 shl (i64 zext (i32 ptrtoint (%struct.string___XUB* @C.209.1380 to i32) to i64), i64 32)) )
- to label %invcont370 unwind label %unwind277
-
-invcont370: ; preds = %cond_next348
- %tmp372 = getelementptr %struct.string___XUP* %tmp15, i32 0, i32 0 ; <i8**> [#uses=1]
- %tmp373 = load i8** %tmp372 ; <i8*> [#uses=1]
- %tmp37374 = ptrtoint i8* %tmp373 to i32 ; <i32> [#uses=1]
- %tmp3737475 = zext i32 %tmp37374 to i64 ; <i64> [#uses=1]
- %tmp375 = getelementptr %struct.string___XUP* %tmp15, i32 0, i32 1 ; <%struct.string___XUB**> [#uses=1]
- %tmp376 = load %struct.string___XUB** %tmp375 ; <%struct.string___XUB*> [#uses=1]
- %tmp37670 = ptrtoint %struct.string___XUB* %tmp376 to i32 ; <i32> [#uses=1]
- %tmp3767071 = zext i32 %tmp37670 to i64 ; <i64> [#uses=1]
- %tmp376707172 = shl i64 %tmp3767071, 32 ; <i64> [#uses=1]
- %tmp376707172.ins = or i64 %tmp376707172, %tmp3737475 ; <i64> [#uses=1]
- invoke fastcc void @report__put_msg( i64 %tmp376707172.ins )
- to label %invcont381 unwind label %unwind277
-
-invcont381: ; preds = %invcont370
- %tmp382 = load i32* @report__test_name_len ; <i32> [#uses=6]
- %tmp415 = icmp sgt i32 %tmp382, -1 ; <i1> [#uses=1]
- %max416 = select i1 %tmp415, i32 %tmp382, i32 0 ; <i32> [#uses=1]
- %tmp417 = alloca i8, i32 %max416 ; <i8*> [#uses=3]
- %tmp423 = icmp sgt i32 %tmp382, 0 ; <i1> [#uses=1]
- br i1 %tmp423, label %bb427, label %cond_next442
-
-bb427: ; preds = %invcont381
- store i8 32, i8* %tmp417
- %tmp434 = icmp eq i32 %tmp382, 1 ; <i1> [#uses=1]
- br i1 %tmp434, label %cond_next442, label %cond_next438.preheader
-
-cond_next438.preheader: ; preds = %bb427
- %tmp. = add i32 %tmp382, -1 ; <i32> [#uses=1]
- br label %cond_next438
-
-cond_next438: ; preds = %cond_next438, %cond_next438.preheader
- %indvar = phi i32 [ 0, %cond_next438.preheader ], [ %J130b.513.5, %cond_next438 ] ; <i32> [#uses=1]
- %J130b.513.5 = add i32 %indvar, 1 ; <i32> [#uses=3]
- %tmp43118 = getelementptr i8* %tmp417, i32 %J130b.513.5 ; <i8*> [#uses=1]
- store i8 32, i8* %tmp43118
- %exitcond = icmp eq i32 %J130b.513.5, %tmp. ; <i1> [#uses=1]
- br i1 %exitcond, label %cond_next442, label %cond_next438
-
-cond_next442: ; preds = %cond_next438, %bb427, %invcont381
- %tmp448 = getelementptr %struct.string___XUB* %A.270, i32 0, i32 0 ; <i32*> [#uses=1]
- store i32 1, i32* %tmp448
- %tmp449 = getelementptr %struct.string___XUB* %A.270, i32 0, i32 1 ; <i32*> [#uses=1]
- store i32 %tmp382, i32* %tmp449
- %tmp41762 = ptrtoint i8* %tmp417 to i32 ; <i32> [#uses=1]
- %tmp4176263 = zext i32 %tmp41762 to i64 ; <i64> [#uses=1]
- %A.27058 = ptrtoint %struct.string___XUB* %A.270 to i32 ; <i32> [#uses=1]
- %A.2705859 = zext i32 %A.27058 to i64 ; <i64> [#uses=1]
- %A.270585960 = shl i64 %A.2705859, 32 ; <i64> [#uses=1]
- %A.270585960.ins = or i64 %tmp4176263, %A.270585960 ; <i64> [#uses=1]
- invoke void @system__string_ops_concat_3__str_concat_3( %struct.string___XUP* %tmp20 sret , i64 or (i64 zext (i32 ptrtoint ([5 x i8]* @.str21 to i32) to i64), i64 shl (i64 zext (i32 ptrtoint (%struct.string___XUB* @C.81.900 to i32) to i64), i64 32)), i64 %A.270585960.ins, i64 or (i64 zext (i32 ptrtoint ([37 x i8]* @.str22 to i32) to i64), i64 shl (i64 zext (i32 ptrtoint (%struct.string___XUB* @C.209.1380 to i32) to i64), i64 32)) )
- to label %invcont467 unwind label %unwind277
-
-invcont467: ; preds = %cond_next442
- %tmp469 = getelementptr %struct.string___XUP* %tmp20, i32 0, i32 0 ; <i8**> [#uses=1]
- %tmp470 = load i8** %tmp469 ; <i8*> [#uses=1]
- %tmp47050 = ptrtoint i8* %tmp470 to i32 ; <i32> [#uses=1]
- %tmp4705051 = zext i32 %tmp47050 to i64 ; <i64> [#uses=1]
- %tmp472 = getelementptr %struct.string___XUP* %tmp20, i32 0, i32 1 ; <%struct.string___XUB**> [#uses=1]
- %tmp473 = load %struct.string___XUB** %tmp472 ; <%struct.string___XUB*> [#uses=1]
- %tmp47346 = ptrtoint %struct.string___XUB* %tmp473 to i32 ; <i32> [#uses=1]
- %tmp4734647 = zext i32 %tmp47346 to i64 ; <i64> [#uses=1]
- %tmp473464748 = shl i64 %tmp4734647, 32 ; <i64> [#uses=1]
- %tmp473464748.ins = or i64 %tmp473464748, %tmp4705051 ; <i64> [#uses=1]
- invoke fastcc void @report__put_msg( i64 %tmp473464748.ins )
- to label %cleanup unwind label %unwind277
-
-cleanup: ; preds = %invcont467
- call void @llvm.stackrestore( i8* %tmp262 )
- br label %cond_next618
-
-bb483: ; preds = %entry
- %tmp484 = load i32* @report__test_name_len ; <i32> [#uses=4]
- %tmp487 = icmp sgt i32 %tmp484, 0 ; <i1> [#uses=2]
- %tmp494 = icmp sgt i32 %tmp484, 15 ; <i1> [#uses=1]
- %bothcond142 = and i1 %tmp487, %tmp494 ; <i1> [#uses=1]
- br i1 %bothcond142, label %cond_true497, label %cond_next500
-
-cond_true497: ; preds = %bb483
- invoke void @__gnat_rcheck_12( i8* getelementptr ([12 x i8]* @.str, i32 0, i32 0), i32 223 )
- to label %UnifiedUnreachableBlock unwind label %unwind
-
-cond_next500: ; preds = %bb483
- %tmp529 = getelementptr %struct.string___XUB* %A.284, i32 0, i32 0 ; <i32*> [#uses=1]
- store i32 1, i32* %tmp529
- %tmp530 = getelementptr %struct.string___XUB* %A.284, i32 0, i32 1 ; <i32*> [#uses=1]
- store i32 %tmp484, i32* %tmp530
- br i1 %tmp487, label %cond_true537, label %cond_next567
-
-cond_true537: ; preds = %cond_next500
- %tmp501.off = add i32 %tmp484, -1 ; <i32> [#uses=1]
- %bothcond3 = icmp ugt i32 %tmp501.off, 14 ; <i1> [#uses=1]
- br i1 %bothcond3, label %bb555, label %cond_next567
-
-bb555: ; preds = %cond_true537
- invoke void @__gnat_rcheck_05( i8* getelementptr ([12 x i8]* @.str, i32 0, i32 0), i32 223 )
- to label %UnifiedUnreachableBlock unwind label %unwind
-
-cond_next567: ; preds = %cond_true537, %cond_next500
- %A.28435 = ptrtoint %struct.string___XUB* %A.284 to i32 ; <i32> [#uses=1]
- %A.2843536 = zext i32 %A.28435 to i64 ; <i64> [#uses=1]
- %A.284353637 = shl i64 %A.2843536, 32 ; <i64> [#uses=1]
- %A.284353637.ins = or i64 %A.284353637, zext (i32 ptrtoint ([15 x i8]* @report__test_name to i32) to i64) ; <i64> [#uses=1]
- invoke void @system__string_ops_concat_3__str_concat_3( %struct.string___XUP* %tmp25 sret , i64 or (i64 zext (i32 ptrtoint ([5 x i8]* @.str24 to i32) to i64), i64 shl (i64 zext (i32 ptrtoint (%struct.string___XUB* @C.81.900 to i32) to i64), i64 32)), i64 %A.284353637.ins, i64 or (i64 zext (i32 ptrtoint ([37 x i8]* @.str23 to i32) to i64), i64 shl (i64 zext (i32 ptrtoint (%struct.string___XUB* @C.209.1380 to i32) to i64), i64 32)) )
- to label %invcont589 unwind label %unwind
-
-invcont589: ; preds = %cond_next567
- %tmp591 = getelementptr %struct.string___XUP* %tmp25, i32 0, i32 0 ; <i8**> [#uses=1]
- %tmp592 = load i8** %tmp591 ; <i8*> [#uses=1]
- %tmp59228 = ptrtoint i8* %tmp592 to i32 ; <i32> [#uses=1]
- %tmp5922829 = zext i32 %tmp59228 to i64 ; <i64> [#uses=1]
- %tmp594 = getelementptr %struct.string___XUP* %tmp25, i32 0, i32 1 ; <%struct.string___XUB**> [#uses=1]
- %tmp595 = load %struct.string___XUB** %tmp594 ; <%struct.string___XUB*> [#uses=1]
- %tmp59524 = ptrtoint %struct.string___XUB* %tmp595 to i32 ; <i32> [#uses=1]
- %tmp5952425 = zext i32 %tmp59524 to i64 ; <i64> [#uses=1]
- %tmp595242526 = shl i64 %tmp5952425, 32 ; <i64> [#uses=1]
- %tmp595242526.ins = or i64 %tmp595242526, %tmp5922829 ; <i64> [#uses=1]
- invoke fastcc void @report__put_msg( i64 %tmp595242526.ins )
- to label %cond_next618 unwind label %unwind
-
-cond_next618: ; preds = %invcont589, %cleanup, %invcont249, %invcont131
- store i8 1, i8* @report__test_status
- store i32 7, i32* @report__test_name_len
- store i8 78, i8* getelementptr ([15 x i8]* @report__test_name, i32 0, i32 0)
- store i8 79, i8* getelementptr ([15 x i8]* @report__test_name, i32 0, i32 1)
- store i8 95, i8* getelementptr ([15 x i8]* @report__test_name, i32 0, i32 2)
- store i8 78, i8* getelementptr ([15 x i8]* @report__test_name, i32 0, i32 3)
- store i8 65, i8* getelementptr ([15 x i8]* @report__test_name, i32 0, i32 4)
- store i8 77, i8* getelementptr ([15 x i8]* @report__test_name, i32 0, i32 5)
- store i8 69, i8* getelementptr ([15 x i8]* @report__test_name, i32 0, i32 6)
- %CHAIN.310.0.0.0.val5.i = ptrtoint i8* %tmp29 to i32 ; <i32> [#uses=1]
- %CHAIN.310.0.0.0.val56.i = zext i32 %CHAIN.310.0.0.0.val5.i to i64 ; <i64> [#uses=1]
- %CHAIN.310.0.0.1.val2.i = zext i32 %tmp32 to i64 ; <i64> [#uses=1]
- %CHAIN.310.0.0.1.val23.i = shl i64 %CHAIN.310.0.0.1.val2.i, 32 ; <i64> [#uses=1]
- %CHAIN.310.0.0.1.val23.ins.i = or i64 %CHAIN.310.0.0.1.val23.i, %CHAIN.310.0.0.0.val56.i ; <i64> [#uses=1]
- call void @system__secondary_stack__ss_release( i64 %CHAIN.310.0.0.1.val23.ins.i )
- ret void
-
-cleanup717: ; preds = %unwind277, %unwind
- %eh_exception.0 = phi i8* [ %eh_ptr278, %unwind277 ], [ %eh_ptr, %unwind ] ; <i8*> [#uses=1]
- %CHAIN.310.0.0.0.val5.i8 = ptrtoint i8* %tmp29 to i32 ; <i32> [#uses=1]
- %CHAIN.310.0.0.0.val56.i9 = zext i32 %CHAIN.310.0.0.0.val5.i8 to i64 ; <i64> [#uses=1]
- %CHAIN.310.0.0.1.val2.i10 = zext i32 %tmp32 to i64 ; <i64> [#uses=1]
- %CHAIN.310.0.0.1.val23.i11 = shl i64 %CHAIN.310.0.0.1.val2.i10, 32 ; <i64> [#uses=1]
- %CHAIN.310.0.0.1.val23.ins.i12 = or i64 %CHAIN.310.0.0.1.val23.i11, %CHAIN.310.0.0.0.val56.i9 ; <i64> [#uses=1]
- call void @system__secondary_stack__ss_release( i64 %CHAIN.310.0.0.1.val23.ins.i12 )
- call i32 (...)* @_Unwind_Resume( i8* %eh_exception.0 ) ; <i32>:0 [#uses=0]
- unreachable
-
-UnifiedUnreachableBlock: ; preds = %bb555, %cond_true497, %bb336, %cond_true276, %bb215, %cond_true157, %bb97, %cond_true43
- unreachable
-}
-
-declare i8* @llvm.stacksave()
-
-declare void @llvm.stackrestore(i8*)
-
-declare i32 @report__ident_int(i32 %x)
-
-declare i8 @report__equal(i32 %x, i32 %y)
-
-declare i8 @report__ident_char(i8 zeroext %x)
-
-declare i16 @report__ident_wide_char(i16 zeroext %x)
-
-declare i8 @report__ident_bool(i8 %x)
-
-declare void @report__ident_str(%struct.string___XUP* sret %agg.result, i64 %x.0.0)
-
-declare void @llvm.memcpy.i32(i8*, i8*, i32, i32)
-
-declare void @report__ident_wide_str(%struct.wide_string___XUP* sret %agg.result, i64 %x.0.0)
-
-declare void @__gnat_begin_handler(i8*)
-
-declare void @__gnat_end_handler(i8*)
-
-declare void @report__legal_file_name(%struct.string___XUP* sret %agg.result, i32 %x, i64 %nam.0.0)
-
-declare void @__gnat_rcheck_06(i8*, i32)
-
-declare void @system__string_ops__str_concat_cs(%struct.string___XUP* sret , i8 zeroext , i64)
diff --git a/release_23/test/CodeGen/X86/2007-06-05-LSR-Dominator.ll b/release_23/test/CodeGen/X86/2007-06-05-LSR-Dominator.ll
deleted file mode 100644
index 3e7776a62ab1..000000000000
--- a/release_23/test/CodeGen/X86/2007-06-05-LSR-Dominator.ll
+++ /dev/null
@@ -1,129 +0,0 @@
-; PR1495
-; RUN: llvm-as < %s | llc -march=x86
-
-target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64"
-target triple = "i686-pc-linux-gnu"
- %struct.AVRational = type { i32, i32 }
- %struct.FFTComplex = type { float, float }
- %struct.FFTContext = type { i32, i32, i16*, %struct.FFTComplex*, %struct.FFTComplex*, void (%struct.FFTContext*, %struct.FFTComplex*)*, void (%struct.MDCTContext*, float*, float*, float*)* }
- %struct.MDCTContext = type { i32, i32, float*, float*, %struct.FFTContext }
- %struct.Minima = type { i32, i32, i32, i32 }
- %struct.codebook_t = type { i32, i8*, i32*, i32, float, float, i32, i32, i32*, float*, float* }
- %struct.floor_class_t = type { i32, i32, i32, i32* }
- %struct.floor_t = type { i32, i32*, i32, %struct.floor_class_t*, i32, i32, i32, %struct.Minima* }
- %struct.mapping_t = type { i32, i32*, i32*, i32*, i32, i32*, i32* }
- %struct.residue_t = type { i32, i32, i32, i32, i32, i32, [8 x i8]*, [2 x float]* }
- %struct.venc_context_t = type { i32, i32, [2 x i32], [2 x %struct.MDCTContext], [2 x float*], i32, float*, float*, float*, float*, float, i32, %struct.codebook_t*, i32, %struct.floor_t*, i32, %struct.residue_t*, i32, %struct.mapping_t*, i32, %struct.AVRational* }
-
-define fastcc i32 @put_main_header(%struct.venc_context_t* %venc, i8** %out) {
-entry:
- br i1 false, label %bb1820, label %bb288.bb148_crit_edge
-
-bb288.bb148_crit_edge: ; preds = %entry
- ret i32 0
-
-cond_next1712: ; preds = %bb1820.bb1680_crit_edge
- ret i32 0
-
-bb1817: ; preds = %bb1820.bb1680_crit_edge
- br label %bb1820
-
-bb1820: ; preds = %bb1817, %entry
- %pb.1.50 = phi i32 [ %tmp1693, %bb1817 ], [ 8, %entry ] ; <i32> [#uses=3]
- br i1 false, label %bb2093, label %bb1820.bb1680_crit_edge
-
-bb1820.bb1680_crit_edge: ; preds = %bb1820
- %tmp1693 = add i32 %pb.1.50, 8 ; <i32> [#uses=2]
- %tmp1702 = icmp slt i32 %tmp1693, 0 ; <i1> [#uses=1]
- br i1 %tmp1702, label %cond_next1712, label %bb1817
-
-bb2093: ; preds = %bb1820
- %tmp2102 = add i32 %pb.1.50, 65 ; <i32> [#uses=0]
- %tmp2236 = add i32 %pb.1.50, 72 ; <i32> [#uses=1]
- %tmp2237 = sdiv i32 %tmp2236, 8 ; <i32> [#uses=2]
- br i1 false, label %bb2543, label %bb2536.bb2396_crit_edge
-
-bb2536.bb2396_crit_edge: ; preds = %bb2093
- ret i32 0
-
-bb2543: ; preds = %bb2093
- br i1 false, label %cond_next2576, label %bb2690
-
-cond_next2576: ; preds = %bb2543
- ret i32 0
-
-bb2682: ; preds = %bb2690
- ret i32 0
-
-bb2690: ; preds = %bb2543
- br i1 false, label %bb2682, label %bb2698
-
-bb2698: ; preds = %bb2690
- br i1 false, label %cond_next2726, label %bb2831
-
-cond_next2726: ; preds = %bb2698
- ret i32 0
-
-bb2831: ; preds = %bb2698
- br i1 false, label %cond_next2859, label %bb2964
-
-cond_next2859: ; preds = %bb2831
- br i1 false, label %bb2943, label %cond_true2866
-
-cond_true2866: ; preds = %cond_next2859
- br i1 false, label %cond_true2874, label %cond_false2897
-
-cond_true2874: ; preds = %cond_true2866
- ret i32 0
-
-cond_false2897: ; preds = %cond_true2866
- ret i32 0
-
-bb2943: ; preds = %cond_next2859
- ret i32 0
-
-bb2964: ; preds = %bb2831
- br i1 false, label %cond_next2997, label %bb4589
-
-cond_next2997: ; preds = %bb2964
- ret i32 0
-
-bb3103: ; preds = %bb4589
- ret i32 0
-
-bb4589: ; preds = %bb2964
- br i1 false, label %bb3103, label %bb4597
-
-bb4597: ; preds = %bb4589
- br i1 false, label %cond_next4630, label %bb4744
-
-cond_next4630: ; preds = %bb4597
- br i1 false, label %bb4744, label %cond_true4724
-
-cond_true4724: ; preds = %cond_next4630
- br i1 false, label %bb4736, label %bb7531
-
-bb4736: ; preds = %cond_true4724
- ret i32 0
-
-bb4744: ; preds = %cond_next4630, %bb4597
- ret i32 0
-
-bb7531: ; preds = %cond_true4724
- %v_addr.023.0.i6 = add i32 %tmp2237, -255 ; <i32> [#uses=1]
- br label %bb.i14
-
-bb.i14: ; preds = %bb.i14, %bb7531
- %n.021.0.i8 = phi i32 [ 0, %bb7531 ], [ %indvar.next, %bb.i14 ] ; <i32> [#uses=2]
- %tmp..i9 = mul i32 %n.021.0.i8, -255 ; <i32> [#uses=1]
- %tmp5.i11 = add i32 %v_addr.023.0.i6, %tmp..i9 ; <i32> [#uses=1]
- %tmp10.i12 = icmp ugt i32 %tmp5.i11, 254 ; <i1> [#uses=1]
- %indvar.next = add i32 %n.021.0.i8, 1 ; <i32> [#uses=1]
- br i1 %tmp10.i12, label %bb.i14, label %bb12.loopexit.i18
-
-bb12.loopexit.i18: ; preds = %bb.i14
- call void @llvm.memcpy.i32( i8* null, i8* null, i32 %tmp2237, i32 1 )
- ret i32 0
-}
-
-declare void @llvm.memcpy.i32(i8*, i8*, i32, i32)
diff --git a/release_23/test/CodeGen/X86/2007-06-14-branchfold.ll b/release_23/test/CodeGen/X86/2007-06-14-branchfold.ll
deleted file mode 100644
index 7756d060ff25..000000000000
--- a/release_23/test/CodeGen/X86/2007-06-14-branchfold.ll
+++ /dev/null
@@ -1,133 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -mcpu=i686 | not grep jmp
-; check that branch folding understands FP_REG_KILL is not a branch
-
-target triple = "i686-pc-linux-gnu"
- %struct.FRAME.c34003a = type { float, float }
-@report_E = global i8 0 ; <i8*> [#uses=0]
-
-define void @main() {
-entry:
- %FRAME.31 = alloca %struct.FRAME.c34003a, align 8 ; <%struct.FRAME.c34003a*> [#uses=4]
- %tmp20 = call i32 @report__ident_int( i32 -50 ) ; <i32> [#uses=1]
- %tmp2021 = sitofp i32 %tmp20 to float ; <float> [#uses=5]
- %tmp23 = fcmp ult float %tmp2021, 0xC7EFFFFFE0000000 ; <i1> [#uses=1]
- %tmp26 = fcmp ugt float %tmp2021, 0x47EFFFFFE0000000 ; <i1> [#uses=1]
- %bothcond = or i1 %tmp23, %tmp26 ; <i1> [#uses=1]
- br i1 %bothcond, label %bb, label %bb30
-
-bb: ; preds = %entry
- unwind
-
-bb30: ; preds = %entry
- %tmp35 = call i32 @report__ident_int( i32 50 ) ; <i32> [#uses=1]
- %tmp3536 = sitofp i32 %tmp35 to float ; <float> [#uses=4]
- %tmp38 = fcmp ult float %tmp3536, 0xC7EFFFFFE0000000 ; <i1> [#uses=1]
- %tmp44 = fcmp ugt float %tmp3536, 0x47EFFFFFE0000000 ; <i1> [#uses=1]
- %bothcond226 = or i1 %tmp38, %tmp44 ; <i1> [#uses=1]
- br i1 %bothcond226, label %bb47, label %bb49
-
-bb47: ; preds = %bb30
- unwind
-
-bb49: ; preds = %bb30
- %tmp60 = fcmp ult float %tmp3536, %tmp2021 ; <i1> [#uses=1]
- %tmp60.not = xor i1 %tmp60, true ; <i1> [#uses=1]
- %tmp65 = fcmp olt float %tmp2021, 0xC7EFFFFFE0000000 ; <i1> [#uses=1]
- %bothcond227 = and i1 %tmp65, %tmp60.not ; <i1> [#uses=1]
- br i1 %bothcond227, label %cond_true68, label %cond_next70
-
-cond_true68: ; preds = %bb49
- unwind
-
-cond_next70: ; preds = %bb49
- %tmp71 = call i32 @report__ident_int( i32 -30 ) ; <i32> [#uses=1]
- %tmp7172 = sitofp i32 %tmp71 to float ; <float> [#uses=3]
- %tmp74 = fcmp ult float %tmp7172, 0xC7EFFFFFE0000000 ; <i1> [#uses=1]
- %tmp80 = fcmp ugt float %tmp7172, 0x47EFFFFFE0000000 ; <i1> [#uses=1]
- %bothcond228 = or i1 %tmp74, %tmp80 ; <i1> [#uses=1]
- br i1 %bothcond228, label %bb83, label %bb85
-
-bb83: ; preds = %cond_next70
- unwind
-
-bb85: ; preds = %cond_next70
- %tmp90 = getelementptr %struct.FRAME.c34003a* %FRAME.31, i32 0, i32 1 ; <float*> [#uses=3]
- store float %tmp7172, float* %tmp90
- %tmp92 = call i32 @report__ident_int( i32 30 ) ; <i32> [#uses=1]
- %tmp9293 = sitofp i32 %tmp92 to float ; <float> [#uses=7]
- %tmp95 = fcmp ult float %tmp9293, 0xC7EFFFFFE0000000 ; <i1> [#uses=1]
- %tmp101 = fcmp ugt float %tmp9293, 0x47EFFFFFE0000000 ; <i1> [#uses=1]
- %bothcond229 = or i1 %tmp95, %tmp101 ; <i1> [#uses=1]
- br i1 %bothcond229, label %bb104, label %bb106
-
-bb104: ; preds = %bb85
- unwind
-
-bb106: ; preds = %bb85
- %tmp111 = getelementptr %struct.FRAME.c34003a* %FRAME.31, i32 0, i32 0 ; <float*> [#uses=2]
- store float %tmp9293, float* %tmp111
- %tmp123 = load float* %tmp90 ; <float> [#uses=4]
- %tmp125 = fcmp ult float %tmp9293, %tmp123 ; <i1> [#uses=1]
- br i1 %tmp125, label %cond_next147, label %cond_true128
-
-cond_true128: ; preds = %bb106
- %tmp133 = fcmp olt float %tmp123, %tmp2021 ; <i1> [#uses=1]
- %tmp142 = fcmp ogt float %tmp9293, %tmp3536 ; <i1> [#uses=1]
- %bothcond230 = or i1 %tmp133, %tmp142 ; <i1> [#uses=1]
- br i1 %bothcond230, label %bb145, label %cond_next147
-
-bb145: ; preds = %cond_true128
- unwind
-
-cond_next147: ; preds = %cond_true128, %bb106
- %tmp157 = fcmp ugt float %tmp123, -3.000000e+01 ; <i1> [#uses=1]
- %tmp165 = fcmp ult float %tmp9293, -3.000000e+01 ; <i1> [#uses=1]
- %bothcond231 = or i1 %tmp157, %tmp165 ; <i1> [#uses=1]
- br i1 %bothcond231, label %bb168, label %bb169
-
-bb168: ; preds = %cond_next147
- unwind
-
-bb169: ; preds = %cond_next147
- %tmp176 = fcmp ugt float %tmp123, 3.000000e+01 ; <i1> [#uses=1]
- %tmp184 = fcmp ult float %tmp9293, 3.000000e+01 ; <i1> [#uses=1]
- %bothcond232 = or i1 %tmp176, %tmp184 ; <i1> [#uses=1]
- br i1 %bothcond232, label %bb187, label %bb188
-
-bb187: ; preds = %bb169
- unwind
-
-bb188: ; preds = %bb169
- %tmp192 = call fastcc float @c34003a__ident.154( %struct.FRAME.c34003a* %FRAME.31, float 3.000000e+01 ) ; <float> [#uses=2]
- %tmp194 = load float* %tmp90 ; <float> [#uses=1]
- %tmp196 = fcmp ugt float %tmp194, 0.000000e+00 ; <i1> [#uses=1]
- br i1 %tmp196, label %bb207, label %cond_next200
-
-cond_next200: ; preds = %bb188
- %tmp202 = load float* %tmp111 ; <float> [#uses=1]
- %tmp204 = fcmp ult float %tmp202, 0.000000e+00 ; <i1> [#uses=1]
- br i1 %tmp204, label %bb207, label %bb208
-
-bb207: ; preds = %cond_next200, %bb188
- unwind
-
-bb208: ; preds = %cond_next200
- %tmp212 = call fastcc float @c34003a__ident.154( %struct.FRAME.c34003a* %FRAME.31, float 0.000000e+00 ) ; <float> [#uses=1]
- %tmp214 = fcmp oge float %tmp212, %tmp192 ; <i1> [#uses=1]
- %tmp217 = fcmp oge float %tmp192, 1.000000e+02 ; <i1> [#uses=1]
- %tmp221 = or i1 %tmp214, %tmp217 ; <i1> [#uses=1]
- br i1 %tmp221, label %cond_true224, label %UnifiedReturnBlock
-
-cond_true224: ; preds = %bb208
- call void @abort( ) noreturn
- ret void
-
-UnifiedReturnBlock: ; preds = %bb208
- ret void
-}
-
-declare fastcc float @c34003a__ident.154(%struct.FRAME.c34003a* %CHAIN.32, float %x)
-
-declare i32 @report__ident_int(i32 %x)
-
-declare void @abort() noreturn
diff --git a/release_23/test/CodeGen/X86/2007-06-15-IntToMMX.ll b/release_23/test/CodeGen/X86/2007-06-15-IntToMMX.ll
deleted file mode 100644
index e608ac3ecb97..000000000000
--- a/release_23/test/CodeGen/X86/2007-06-15-IntToMMX.ll
+++ /dev/null
@@ -1,17 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86-64 -mattr=+mmx | grep paddusw
-@R = external global <1 x i64> ; <<1 x i64>*> [#uses=1]
-
-define void @foo(<1 x i64> %A, <1 x i64> %B) {
-entry:
- %tmp4 = bitcast <1 x i64> %B to <4 x i16> ; <<4 x i16>> [#uses=1]
- %tmp6 = bitcast <1 x i64> %A to <4 x i16> ; <<4 x i16>> [#uses=1]
- %tmp7 = tail call <4 x i16> @llvm.x86.mmx.paddus.w( <4 x i16> %tmp6, <4 x i16> %tmp4 ) ; <<4 x i16>> [#uses=1]
- %tmp8 = bitcast <4 x i16> %tmp7 to <1 x i64> ; <<1 x i64>> [#uses=1]
- store <1 x i64> %tmp8, <1 x i64>* @R
- tail call void @llvm.x86.mmx.emms( )
- ret void
-}
-
-declare <4 x i16> @llvm.x86.mmx.paddus.w(<4 x i16>, <4 x i16>)
-
-declare void @llvm.x86.mmx.emms()
diff --git a/release_23/test/CodeGen/X86/2007-06-28-X86-64-isel.ll b/release_23/test/CodeGen/X86/2007-06-28-X86-64-isel.ll
deleted file mode 100644
index 5c22f1476191..000000000000
--- a/release_23/test/CodeGen/X86/2007-06-28-X86-64-isel.ll
+++ /dev/null
@@ -1,16 +0,0 @@
-; RUN: llvm-as < %s | | llc -march=x86-64 -mattr=+sse2
-
-define void @test() {
- %tmp1 = call <8 x i16> @llvm.x86.sse2.pmins.w( <8 x i16> zeroinitializer, <8 x i16> bitcast (<4 x i32> < i32 7, i32 7, i32 7, i32 7 > to <8 x i16>) )
- %tmp2 = bitcast <8 x i16> %tmp1 to <4 x i32>
- br i1 false, label %bb1, label %bb2
-
-bb2:
- %tmp38007.i = extractelement <4 x i32> %tmp2, i32 3
- ret void
-
-bb1:
- ret void
-}
-
-declare <8 x i16> @llvm.x86.sse2.pmins.w(<8 x i16>, <8 x i16>)
diff --git a/release_23/test/CodeGen/X86/2007-06-29-DAGCombinerBug.ll b/release_23/test/CodeGen/X86/2007-06-29-DAGCombinerBug.ll
deleted file mode 100644
index eaedb52ac535..000000000000
--- a/release_23/test/CodeGen/X86/2007-06-29-DAGCombinerBug.ll
+++ /dev/null
@@ -1,50 +0,0 @@
-; RUN: llvm-as < %s | | llc -march=x86 -mattr=+sse2
-
-define void @test() {
-entry:
- br i1 false, label %bb13944.preheader, label %cond_true418
-
-cond_true418: ; preds = %entry
- ret void
-
-bb13944.preheader: ; preds = %entry
- br i1 false, label %bb3517, label %bb13968.preheader
-
-bb3517: ; preds = %bb13944.preheader
- br i1 false, label %cond_false7408, label %cond_next11422
-
-cond_false7408: ; preds = %bb3517
- switch i32 0, label %cond_false10578 [
- i32 7, label %cond_next11422
- i32 6, label %cond_true7828
- i32 1, label %cond_true10095
- i32 3, label %cond_true10095
- i32 5, label %cond_true10176
- i32 24, label %cond_true10176
- ]
-
-cond_true7828: ; preds = %cond_false7408
- br i1 false, label %cond_next8191, label %cond_true8045
-
-cond_true8045: ; preds = %cond_true7828
- ret void
-
-cond_next8191: ; preds = %cond_true7828
- %tmp8234 = sub <4 x i32> < i32 939524096, i32 939524096, i32 939524096, i32 939524096 >, zeroinitializer ; <<4 x i32>> [#uses=0]
- ret void
-
-cond_true10095: ; preds = %cond_false7408, %cond_false7408
- ret void
-
-cond_true10176: ; preds = %cond_false7408, %cond_false7408
- ret void
-
-cond_false10578: ; preds = %cond_false7408
- ret void
-
-cond_next11422: ; preds = %cond_false7408, %bb3517
- ret void
-
-bb13968.preheader: ; preds = %bb13944.preheader
- ret void
-}
diff --git a/release_23/test/CodeGen/X86/2007-06-29-VecFPConstantCSEBug.ll b/release_23/test/CodeGen/X86/2007-06-29-VecFPConstantCSEBug.ll
deleted file mode 100644
index 73ecf69ecdc9..000000000000
--- a/release_23/test/CodeGen/X86/2007-06-29-VecFPConstantCSEBug.ll
+++ /dev/null
@@ -1,11 +0,0 @@
-; RUN: llvm-as < %s | | llc -march=x86 -mattr=+sse2
-
-define void @test(<4 x float>* %arg) {
- %tmp89 = getelementptr <4 x float>* %arg, i64 3
- %tmp1144 = sub <4 x float> < float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00 >, zeroinitializer
- store <4 x float> %tmp1144, <4 x float>* null
- %tmp1149 = load <4 x float>* %tmp89
- %tmp1150 = sub <4 x float> < float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00 >, %tmp1149
- store <4 x float> %tmp1150, <4 x float>* %tmp89
- ret void
-}
diff --git a/release_23/test/CodeGen/X86/2007-07-03-GR64ToVR64.ll b/release_23/test/CodeGen/X86/2007-07-03-GR64ToVR64.ll
deleted file mode 100644
index 18850b135ccf..000000000000
--- a/release_23/test/CodeGen/X86/2007-07-03-GR64ToVR64.ll
+++ /dev/null
@@ -1,20 +0,0 @@
-; RUN: llvm-as < %s | llc -mtriple=x86_64-apple-darwin -mattr=+mmx | grep {movd %rsi, %mm0}
-; RUN: llvm-as < %s | llc -mtriple=x86_64-apple-darwin -mattr=+mmx | grep {movd %rdi, %mm1}
-; RUN: llvm-as < %s | llc -mtriple=x86_64-apple-darwin -mattr=+mmx | grep {paddusw %mm0, %mm1}
-
-@R = external global <1 x i64> ; <<1 x i64>*> [#uses=1]
-
-define void @foo(<1 x i64> %A, <1 x i64> %B) nounwind {
-entry:
- %tmp4 = bitcast <1 x i64> %B to <4 x i16> ; <<4 x i16>> [#uses=1]
- %tmp6 = bitcast <1 x i64> %A to <4 x i16> ; <<4 x i16>> [#uses=1]
- %tmp7 = tail call <4 x i16> @llvm.x86.mmx.paddus.w( <4 x i16> %tmp6, <4 x i16> %tmp4 ) ; <<4 x i16>> [#uses=1]
- %tmp8 = bitcast <4 x i16> %tmp7 to <1 x i64> ; <<1 x i64>> [#uses=1]
- store <1 x i64> %tmp8, <1 x i64>* @R
- tail call void @llvm.x86.mmx.emms( )
- ret void
-}
-
-declare <4 x i16> @llvm.x86.mmx.paddus.w(<4 x i16>, <4 x i16>)
-
-declare void @llvm.x86.mmx.emms()
diff --git a/release_23/test/CodeGen/X86/2007-07-10-StackerAssert.ll b/release_23/test/CodeGen/X86/2007-07-10-StackerAssert.ll
deleted file mode 100644
index 120284f80c5c..000000000000
--- a/release_23/test/CodeGen/X86/2007-07-10-StackerAssert.ll
+++ /dev/null
@@ -1,41 +0,0 @@
-; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -mcpu=athlon -relocation-model=pic
-; PR1545
-
-@.str97 = external constant [56 x i8] ; <[56 x i8]*> [#uses=1]
-
-declare void @PR_LogPrint(i8*, ...)
-
-define i32 @_ZN13nsPrintEngine19SetupToPrintContentEP16nsIDeviceContextP12nsIDOMWindow() {
-entry:
- br i1 false, label %cond_true122, label %cond_next453
-
-cond_true122: ; preds = %entry
- br i1 false, label %bb164, label %cond_true136
-
-cond_true136: ; preds = %cond_true122
- ret i32 0
-
-bb164: ; preds = %cond_true122
- br i1 false, label %bb383, label %cond_true354
-
-cond_true354: ; preds = %bb164
- ret i32 0
-
-bb383: ; preds = %bb164
- %tmp408 = load float* null ; <float> [#uses=2]
- br i1 false, label %cond_true425, label %cond_next443
-
-cond_true425: ; preds = %bb383
- %tmp430 = load float* null ; <float> [#uses=1]
- %tmp432 = sub float %tmp430, %tmp408 ; <float> [#uses=1]
- %tmp432433 = fpext float %tmp432 to double ; <double> [#uses=1]
- %tmp434435 = fpext float %tmp408 to double ; <double> [#uses=1]
- call void (i8*, ...)* @PR_LogPrint( i8* getelementptr ([56 x i8]* @.str97, i32 0, i32 0), double 0.000000e+00, double %tmp434435, double %tmp432433 )
- ret i32 0
-
-cond_next443: ; preds = %bb383
- ret i32 0
-
-cond_next453: ; preds = %entry
- ret i32 0
-}
diff --git a/release_23/test/CodeGen/X86/2007-07-18-Vector-Extract.ll b/release_23/test/CodeGen/X86/2007-07-18-Vector-Extract.ll
deleted file mode 100644
index c0bd282e0191..000000000000
--- a/release_23/test/CodeGen/X86/2007-07-18-Vector-Extract.ll
+++ /dev/null
@@ -1,15 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86-64 -mattr=+sse | grep {movq (%rdi), %rax}
-; RUN: llvm-as < %s | llc -march=x86-64 -mattr=+sse | grep {movq 8(%rdi), %rax}
-define i64 @foo_0(<2 x i64>* %val) {
-entry:
- %val12 = getelementptr <2 x i64>* %val, i32 0, i32 0 ; <i64*> [#uses=1]
- %tmp7 = load i64* %val12 ; <i64> [#uses=1]
- ret i64 %tmp7
-}
-
-define i64 @foo_1(<2 x i64>* %val) {
-entry:
- %tmp2.gep = getelementptr <2 x i64>* %val, i32 0, i32 1 ; <i64*> [#uses=1]
- %tmp4 = load i64* %tmp2.gep ; <i64> [#uses=1]
- ret i64 %tmp4
-}
diff --git a/release_23/test/CodeGen/X86/2007-07-25-EpilogueBug.ll b/release_23/test/CodeGen/X86/2007-07-25-EpilogueBug.ll
deleted file mode 100644
index ddac6ce217d5..000000000000
--- a/release_23/test/CodeGen/X86/2007-07-25-EpilogueBug.ll
+++ /dev/null
@@ -1,58 +0,0 @@
-; Verify that the addl comes before any popl.
-
-; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -mcpu=i386 | \
-; RUN: %prcontext ret 1 | grep popl
-; PR1573
-
- %struct.c34006f__TsB = type { i8, i32, i32, %struct.c34006f__TsB___b___XVN }
- %struct.c34006f__TsB___b___XVN = type { %struct.c34006f__TsB___b___XVN___O }
- %struct.c34006f__TsB___b___XVN___O = type { float }
-
-define fastcc i8 @c34006f__pkg__parentEQ.213(%struct.c34006f__TsB* %x, %struct.c34006f__TsB* %y) zeroext {
-entry:
- %tmp190 = icmp eq i8 0, 0 ; <i1> [#uses=1]
- %tmp207 = icmp eq i32 0, 0 ; <i1> [#uses=1]
- %bothcond = and i1 %tmp190, %tmp207 ; <i1> [#uses=1]
- %tmp224 = icmp eq i32 0, 0 ; <i1> [#uses=1]
- %bothcond1 = and i1 %bothcond, %tmp224 ; <i1> [#uses=1]
- br i1 %bothcond1, label %cond_next229, label %UnifiedReturnBlock
-
-cond_next229: ; preds = %entry
- %tmp234 = icmp eq i8 0, 0 ; <i1> [#uses=1]
- br i1 %tmp234, label %cond_false391, label %cond_true237
-
-cond_true237: ; preds = %cond_next229
- %tmp268 = icmp sgt i32 0, -1 ; <i1> [#uses=2]
- %max269 = select i1 %tmp268, i32 0, i32 0 ; <i32> [#uses=1]
- %tmp305.op = add i32 0, -1 ; <i32> [#uses=1]
- br i1 false, label %bb328, label %cond_next315
-
-cond_next315: ; preds = %cond_true237
- ret i8 0
-
-bb328: ; preds = %cond_true237
- %tmp337 = select i1 %tmp268, i32 %tmp305.op, i32 -1 ; <i32> [#uses=1]
- %tmp347 = icmp eq i32 %tmp337, 0 ; <i1> [#uses=1]
- br i1 %tmp347, label %cond_next351, label %UnifiedReturnBlock
-
-cond_next351: ; preds = %bb328
- %tmp354 = getelementptr %struct.c34006f__TsB* %y, i32 0, i32 3 ; <%struct.c34006f__TsB___b___XVN*> [#uses=1]
- %tmp354355 = bitcast %struct.c34006f__TsB___b___XVN* %tmp354 to i8* ; <i8*> [#uses=1]
- %tmp358 = getelementptr %struct.c34006f__TsB* %x, i32 0, i32 3 ; <%struct.c34006f__TsB___b___XVN*> [#uses=1]
- %tmp358359 = bitcast %struct.c34006f__TsB___b___XVN* %tmp358 to i8* ; <i8*> [#uses=1]
- %tmp360 = tail call i32 (i8*, i8*, i32, ...)* @memcmp( i8* %tmp358359, i8* %tmp354355, i32 %max269 ) ; <i32> [#uses=0]
- ret i8 0
-
-cond_false391: ; preds = %cond_next229
- %tmp1 = getelementptr %struct.c34006f__TsB* %y, i32 0, i32 3, i32 0, i32 0
- %tmp2 = load float* %tmp1
- %tmp400 = fcmp une float %tmp2, 0.000000e+00 ; <i1> [#uses=1]
- %not.tmp400 = xor i1 %tmp400, true ; <i1> [#uses=1]
- %retval = zext i1 %not.tmp400 to i8 ; <i8> [#uses=1]
- ret i8 %retval
-
-UnifiedReturnBlock: ; preds = %bb328, %entry
- ret i8 0
-}
-
-declare i32 @memcmp(i8*, i8*, i32, ...)
diff --git a/release_23/test/CodeGen/X86/2007-08-01-LiveVariablesBug.ll b/release_23/test/CodeGen/X86/2007-08-01-LiveVariablesBug.ll
deleted file mode 100644
index 8eda0ab9bc4e..000000000000
--- a/release_23/test/CodeGen/X86/2007-08-01-LiveVariablesBug.ll
+++ /dev/null
@@ -1,8 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 | not grep movl
-
-define i8 @t(i8 zeroext %x, i8 zeroext %y) zeroext {
- %tmp2 = add i8 %x, 2
- %tmp4 = add i8 %y, -2
- %tmp5 = mul i8 %tmp4, %tmp2
- ret i8 %tmp5
-}
diff --git a/release_23/test/CodeGen/X86/2007-08-09-IllegalX86-64Asm.ll b/release_23/test/CodeGen/X86/2007-08-09-IllegalX86-64Asm.ll
deleted file mode 100644
index e9ea843ba3c3..000000000000
--- a/release_23/test/CodeGen/X86/2007-08-09-IllegalX86-64Asm.ll
+++ /dev/null
@@ -1,235 +0,0 @@
-; RUN: llvm-as < %s | llc -mtriple=x86_64-apple-darwin | not grep "movb %ah, %r"
-
- %struct.FILE = type { i8*, i32, i32, i16, i16, %struct.__sbuf, i32, i8*, i32 (i8*)*, i32 (i8*, i8*, i32)*, i64 (i8*, i64, i32)*, i32 (i8*, i8*, i32)*, %struct.__sbuf, %struct.__sFILEX*, i32, [3 x i8], [1 x i8], %struct.__sbuf, i32, [4 x i8], i64 }
- %struct.PyBoolScalarObject = type { i64, %struct._typeobject*, i8 }
- %struct.PyBufferProcs = type { i64 (%struct.PyObject*, i64, i8**)*, i64 (%struct.PyObject*, i64, i8**)*, i64 (%struct.PyObject*, i64*)*, i64 (%struct.PyObject*, i64, i8**)* }
- %struct.PyGetSetDef = type { i8*, %struct.PyObject* (%struct.PyObject*, i8*)*, i32 (%struct.PyObject*, %struct.PyObject*, i8*)*, i8*, i8* }
- %struct.PyMappingMethods = type { i64 (%struct.PyObject*)*, %struct.PyObject* (%struct.PyObject*, %struct.PyObject*)*, i32 (%struct.PyObject*, %struct.PyObject*, %struct.PyObject*)* }
- %struct.PyMemberDef = type opaque
- %struct.PyMethodDef = type { i8*, %struct.PyObject* (%struct.PyObject*, %struct.PyObject*)*, i32, i8* }
- %struct.PyNumberMethods = type { %struct.PyObject* (%struct.PyObject*, %struct.PyObject*)*, %struct.PyObject* (%struct.PyObject*, %struct.PyObject*)*, %struct.PyObject* (%struct.PyObject*, %struct.PyObject*)*, %struct.PyObject* (%struct.PyObject*, %struct.PyObject*)*, %struct.PyObject* (%struct.PyObject*, %struct.PyObject*)*, %struct.PyObject* (%struct.PyObject*, %struct.PyObject*)*, %struct.PyObject* (%struct.PyObject*, %struct.PyObject*, %struct.PyObject*)*, %struct.PyObject* (%struct.PyObject*)*, %struct.PyObject* (%struct.PyObject*)*, %struct.PyObject* (%struct.PyObject*)*, i32 (%struct.PyObject*)*, %struct.PyObject* (%struct.PyObject*)*, %struct.PyObject* (%struct.PyObject*, %struct.PyObject*)*, %struct.PyObject* (%struct.PyObject*, %struct.PyObject*)*, %struct.PyObject* (%struct.PyObject*, %struct.PyObject*)*, %struct.PyObject* (%struct.PyObject*, %struct.PyObject*)*, %struct.PyObject* (%struct.PyObject*, %struct.PyObject*)*, i32 (%struct.PyObject**, %struct.PyObject**)*, %struct.PyObject* (%struct.PyObject*)*, %struct.PyObject* (%struct.PyObject*)*, %struct.PyObject* (%struct.PyObject*)*, %struct.PyObject* (%struct.PyObject*)*, %struct.PyObject* (%struct.PyObject*)*, %struct.PyObject* (%struct.PyObject*, %struct.PyObject*)*, %struct.PyObject* (%struct.PyObject*, %struct.PyObject*)*, %struct.PyObject* (%struct.PyObject*, %struct.PyObject*)*, %struct.PyObject* (%struct.PyObject*, %struct.PyObject*)*, %struct.PyObject* (%struct.PyObject*, %struct.PyObject*)*, %struct.PyObject* (%struct.PyObject*, %struct.PyObject*, %struct.PyObject*)*, %struct.PyObject* (%struct.PyObject*, %struct.PyObject*)*, %struct.PyObject* (%struct.PyObject*, %struct.PyObject*)*, %struct.PyObject* (%struct.PyObject*, %struct.PyObject*)*, %struct.PyObject* (%struct.PyObject*, %struct.PyObject*)*, %struct.PyObject* (%struct.PyObject*, %struct.PyObject*)*, %struct.PyObject* (%struct.PyObject*, %struct.PyObject*)*, %struct.PyObject* (%struct.PyObject*, %struct.PyObject*)*, %struct.PyObject* (%struct.PyObject*, %struct.PyObject*)*, %struct.PyObject* (%struct.PyObject*, %struct.PyObject*)*, %struct.PyObject* (%struct.PyObject*)* }
- %struct.PyObject = type { i64, %struct._typeobject* }
- %struct.PySequenceMethods = type { i64 (%struct.PyObject*)*, %struct.PyObject* (%struct.PyObject*, %struct.PyObject*)*, %struct.PyObject* (%struct.PyObject*, i64)*, %struct.PyObject* (%struct.PyObject*, i64)*, %struct.PyObject* (%struct.PyObject*, i64, i64)*, i32 (%struct.PyObject*, i64, %struct.PyObject*)*, i32 (%struct.PyObject*, i64, i64, %struct.PyObject*)*, i32 (%struct.PyObject*, %struct.PyObject*)*, %struct.PyObject* (%struct.PyObject*, %struct.PyObject*)*, %struct.PyObject* (%struct.PyObject*, i64)* }
- %struct.PyTupleObject = type { i64, %struct._typeobject*, i64, [1 x %struct.PyObject*] }
- %struct.__sFILEX = type opaque
- %struct.__sbuf = type { i8*, i32 }
- %struct._typeobject = type { i64, %struct._typeobject*, i64, i8*, i64, i64, void (%struct.PyObject*)*, i32 (%struct.PyObject*, %struct.FILE*, i32)*, %struct.PyObject* (%struct.PyObject*, i8*)*, i32 (%struct.PyObject*, i8*, %struct.PyObject*)*, i32 (%struct.PyObject*, %struct.PyObject*)*, %struct.PyObject* (%struct.PyObject*)*, %struct.PyNumberMethods*, %struct.PySequenceMethods*, %struct.PyMappingMethods*, i64 (%struct.PyObject*)*, %struct.PyObject* (%struct.PyObject*, %struct.PyObject*, %struct.PyObject*)*, %struct.PyObject* (%struct.PyObject*)*, %struct.PyObject* (%struct.PyObject*, %struct.PyObject*)*, i32 (%struct.PyObject*, %struct.PyObject*, %struct.PyObject*)*, %struct.PyBufferProcs*, i64, i8*, i32 (%struct.PyObject*, i32 (%struct.PyObject*, i8*)*, i8*)*, i32 (%struct.PyObject*)*, %struct.PyObject* (%struct.PyObject*, %struct.PyObject*, i32)*, i64, %struct.PyObject* (%struct.PyObject*)*, %struct.PyObject* (%struct.PyObject*)*, %struct.PyMethodDef*, %struct.PyMemberDef*, %struct.PyGetSetDef*, %struct._typeobject*, %struct.PyObject*, %struct.PyObject* (%struct.PyObject*, %struct.PyObject*, %struct.PyObject*)*, i32 (%struct.PyObject*, %struct.PyObject*, %struct.PyObject*)*, i64, i32 (%struct.PyObject*, %struct.PyObject*, %struct.PyObject*)*, %struct.PyObject* (%struct._typeobject*, i64)*, %struct.PyObject* (%struct._typeobject*, %struct.PyObject*, %struct.PyObject*)*, void (i8*)*, i32 (%struct.PyObject*)*, %struct.PyObject*, %struct.PyObject*, %struct.PyObject*, %struct.PyObject*, %struct.PyObject*, void (%struct.PyObject*)* }
-@PyArray_API = external global i8** ; <i8***> [#uses=4]
-@PyUFunc_API = external global i8** ; <i8***> [#uses=4]
-@.str5 = external constant [14 x i8] ; <[14 x i8]*> [#uses=1]
-
-define %struct.PyObject* @ubyte_divmod(%struct.PyObject* %a, %struct.PyObject* %b) {
-entry:
- %arg1 = alloca i8, align 1 ; <i8*> [#uses=3]
- %arg2 = alloca i8, align 1 ; <i8*> [#uses=3]
- %first = alloca i32, align 4 ; <i32*> [#uses=2]
- %bufsize = alloca i32, align 4 ; <i32*> [#uses=1]
- %errmask = alloca i32, align 4 ; <i32*> [#uses=2]
- %errobj = alloca %struct.PyObject*, align 8 ; <%struct.PyObject**> [#uses=2]
- %tmp3.i = call fastcc i32 @_ubyte_convert_to_ctype( %struct.PyObject* %a, i8* %arg1 ) ; <i32> [#uses=2]
- %tmp5.i = icmp slt i32 %tmp3.i, 0 ; <i1> [#uses=1]
- br i1 %tmp5.i, label %_ubyte_convert2_to_ctypes.exit, label %cond_next.i
-
-cond_next.i: ; preds = %entry
- %tmp11.i = call fastcc i32 @_ubyte_convert_to_ctype( %struct.PyObject* %b, i8* %arg2 ) ; <i32> [#uses=2]
- %tmp13.i = icmp slt i32 %tmp11.i, 0 ; <i1> [#uses=1]
- %retval.i = select i1 %tmp13.i, i32 %tmp11.i, i32 0 ; <i32> [#uses=1]
- switch i32 %retval.i, label %bb35 [
- i32 -2, label %bb17
- i32 -1, label %bb4
- ]
-
-_ubyte_convert2_to_ctypes.exit: ; preds = %entry
- switch i32 %tmp3.i, label %bb35 [
- i32 -2, label %bb17
- i32 -1, label %bb4
- ]
-
-bb4: ; preds = %_ubyte_convert2_to_ctypes.exit, %cond_next.i
- %tmp5 = load i8*** @PyArray_API, align 8 ; <i8**> [#uses=1]
- %tmp6 = getelementptr i8** %tmp5, i64 2 ; <i8**> [#uses=1]
- %tmp7 = load i8** %tmp6 ; <i8*> [#uses=1]
- %tmp78 = bitcast i8* %tmp7 to %struct._typeobject* ; <%struct._typeobject*> [#uses=1]
- %tmp9 = getelementptr %struct._typeobject* %tmp78, i32 0, i32 12 ; <%struct.PyNumberMethods**> [#uses=1]
- %tmp10 = load %struct.PyNumberMethods** %tmp9 ; <%struct.PyNumberMethods*> [#uses=1]
- %tmp11 = getelementptr %struct.PyNumberMethods* %tmp10, i32 0, i32 5 ; <%struct.PyObject* (%struct.PyObject*, %struct.PyObject*)**> [#uses=1]
- %tmp12 = load %struct.PyObject* (%struct.PyObject*, %struct.PyObject*)** %tmp11 ; <%struct.PyObject* (%struct.PyObject*, %struct.PyObject*)*> [#uses=1]
- %tmp15 = call %struct.PyObject* %tmp12( %struct.PyObject* %a, %struct.PyObject* %b ) ; <%struct.PyObject*> [#uses=1]
- ret %struct.PyObject* %tmp15
-
-bb17: ; preds = %_ubyte_convert2_to_ctypes.exit, %cond_next.i
- %tmp18 = call %struct.PyObject* @PyErr_Occurred( ) ; <%struct.PyObject*> [#uses=1]
- %tmp19 = icmp eq %struct.PyObject* %tmp18, null ; <i1> [#uses=1]
- br i1 %tmp19, label %cond_next, label %UnifiedReturnBlock
-
-cond_next: ; preds = %bb17
- %tmp22 = load i8*** @PyArray_API, align 8 ; <i8**> [#uses=1]
- %tmp23 = getelementptr i8** %tmp22, i64 10 ; <i8**> [#uses=1]
- %tmp24 = load i8** %tmp23 ; <i8*> [#uses=1]
- %tmp2425 = bitcast i8* %tmp24 to %struct._typeobject* ; <%struct._typeobject*> [#uses=1]
- %tmp26 = getelementptr %struct._typeobject* %tmp2425, i32 0, i32 12 ; <%struct.PyNumberMethods**> [#uses=1]
- %tmp27 = load %struct.PyNumberMethods** %tmp26 ; <%struct.PyNumberMethods*> [#uses=1]
- %tmp28 = getelementptr %struct.PyNumberMethods* %tmp27, i32 0, i32 5 ; <%struct.PyObject* (%struct.PyObject*, %struct.PyObject*)**> [#uses=1]
- %tmp29 = load %struct.PyObject* (%struct.PyObject*, %struct.PyObject*)** %tmp28 ; <%struct.PyObject* (%struct.PyObject*, %struct.PyObject*)*> [#uses=1]
- %tmp32 = call %struct.PyObject* %tmp29( %struct.PyObject* %a, %struct.PyObject* %b ) ; <%struct.PyObject*> [#uses=1]
- ret %struct.PyObject* %tmp32
-
-bb35: ; preds = %_ubyte_convert2_to_ctypes.exit, %cond_next.i
- %tmp36 = load i8*** @PyUFunc_API, align 8 ; <i8**> [#uses=1]
- %tmp37 = getelementptr i8** %tmp36, i64 27 ; <i8**> [#uses=1]
- %tmp38 = load i8** %tmp37 ; <i8*> [#uses=1]
- %tmp3839 = bitcast i8* %tmp38 to void ()* ; <void ()*> [#uses=1]
- call void %tmp3839( )
- %tmp40 = load i8* %arg2, align 1 ; <i8> [#uses=4]
- %tmp1.i = icmp eq i8 %tmp40, 0 ; <i1> [#uses=2]
- br i1 %tmp1.i, label %cond_true.i, label %cond_false.i
-
-cond_true.i: ; preds = %bb35
- %tmp3.i196 = call i32 @feraiseexcept( i32 4 ) ; <i32> [#uses=0]
- %tmp46207 = load i8* %arg2, align 1 ; <i8> [#uses=3]
- %tmp48208 = load i8* %arg1, align 1 ; <i8> [#uses=2]
- %tmp1.i197210 = icmp eq i8 %tmp48208, 0 ; <i1> [#uses=1]
- %tmp4.i212 = icmp eq i8 %tmp46207, 0 ; <i1> [#uses=1]
- %tmp7.i198213 = or i1 %tmp1.i197210, %tmp4.i212 ; <i1> [#uses=1]
- br i1 %tmp7.i198213, label %cond_true.i200, label %cond_next17.i
-
-cond_false.i: ; preds = %bb35
- %tmp42 = load i8* %arg1, align 1 ; <i8> [#uses=3]
- %tmp7.i = udiv i8 %tmp42, %tmp40 ; <i8> [#uses=2]
- %tmp1.i197 = icmp eq i8 %tmp42, 0 ; <i1> [#uses=1]
- %tmp7.i198 = or i1 %tmp1.i197, %tmp1.i ; <i1> [#uses=1]
- br i1 %tmp7.i198, label %cond_true.i200, label %cond_next17.i
-
-cond_true.i200: ; preds = %cond_false.i, %cond_true.i
- %out.0 = phi i8 [ 0, %cond_true.i ], [ %tmp7.i, %cond_false.i ] ; <i8> [#uses=2]
- %tmp46202.0 = phi i8 [ %tmp46207, %cond_true.i ], [ %tmp40, %cond_false.i ] ; <i8> [#uses=1]
- %tmp11.i199 = icmp eq i8 %tmp46202.0, 0 ; <i1> [#uses=1]
- br i1 %tmp11.i199, label %cond_true14.i, label %ubyte_ctype_remainder.exit
-
-cond_true14.i: ; preds = %cond_true.i200
- %tmp15.i = call i32 @feraiseexcept( i32 4 ) ; <i32> [#uses=0]
- br label %ubyte_ctype_remainder.exit
-
-cond_next17.i: ; preds = %cond_false.i, %cond_true.i
- %out.1 = phi i8 [ 0, %cond_true.i ], [ %tmp7.i, %cond_false.i ] ; <i8> [#uses=1]
- %tmp46202.1 = phi i8 [ %tmp46207, %cond_true.i ], [ %tmp40, %cond_false.i ] ; <i8> [#uses=1]
- %tmp48205.1 = phi i8 [ %tmp48208, %cond_true.i ], [ %tmp42, %cond_false.i ] ; <i8> [#uses=1]
- %tmp20.i = urem i8 %tmp48205.1, %tmp46202.1 ; <i8> [#uses=1]
- br label %ubyte_ctype_remainder.exit
-
-ubyte_ctype_remainder.exit: ; preds = %cond_next17.i, %cond_true14.i, %cond_true.i200
- %out2.0 = phi i8 [ %tmp20.i, %cond_next17.i ], [ 0, %cond_true14.i ], [ 0, %cond_true.i200 ] ; <i8> [#uses=1]
- %out.2 = phi i8 [ %out.1, %cond_next17.i ], [ %out.0, %cond_true14.i ], [ %out.0, %cond_true.i200 ] ; <i8> [#uses=1]
- %tmp52 = load i8*** @PyUFunc_API, align 8 ; <i8**> [#uses=1]
- %tmp53 = getelementptr i8** %tmp52, i64 28 ; <i8**> [#uses=1]
- %tmp54 = load i8** %tmp53 ; <i8*> [#uses=1]
- %tmp5455 = bitcast i8* %tmp54 to i32 ()* ; <i32 ()*> [#uses=1]
- %tmp56 = call i32 %tmp5455( ) ; <i32> [#uses=2]
- %tmp58 = icmp eq i32 %tmp56, 0 ; <i1> [#uses=1]
- br i1 %tmp58, label %cond_next89, label %cond_true61
-
-cond_true61: ; preds = %ubyte_ctype_remainder.exit
- %tmp62 = load i8*** @PyUFunc_API, align 8 ; <i8**> [#uses=1]
- %tmp63 = getelementptr i8** %tmp62, i64 25 ; <i8**> [#uses=1]
- %tmp64 = load i8** %tmp63 ; <i8*> [#uses=1]
- %tmp6465 = bitcast i8* %tmp64 to i32 (i8*, i32*, i32*, %struct.PyObject**)* ; <i32 (i8*, i32*, i32*, %struct.PyObject**)*> [#uses=1]
- %tmp67 = call i32 %tmp6465( i8* getelementptr ([14 x i8]* @.str5, i32 0, i64 0), i32* %bufsize, i32* %errmask, %struct.PyObject** %errobj ) ; <i32> [#uses=1]
- %tmp68 = icmp slt i32 %tmp67, 0 ; <i1> [#uses=1]
- br i1 %tmp68, label %UnifiedReturnBlock, label %cond_next73
-
-cond_next73: ; preds = %cond_true61
- store i32 1, i32* %first, align 4
- %tmp74 = load i8*** @PyUFunc_API, align 8 ; <i8**> [#uses=1]
- %tmp75 = getelementptr i8** %tmp74, i64 29 ; <i8**> [#uses=1]
- %tmp76 = load i8** %tmp75 ; <i8*> [#uses=1]
- %tmp7677 = bitcast i8* %tmp76 to i32 (i32, %struct.PyObject*, i32, i32*)* ; <i32 (i32, %struct.PyObject*, i32, i32*)*> [#uses=1]
- %tmp79 = load %struct.PyObject** %errobj, align 8 ; <%struct.PyObject*> [#uses=1]
- %tmp80 = load i32* %errmask, align 4 ; <i32> [#uses=1]
- %tmp82 = call i32 %tmp7677( i32 %tmp80, %struct.PyObject* %tmp79, i32 %tmp56, i32* %first ) ; <i32> [#uses=1]
- %tmp83 = icmp eq i32 %tmp82, 0 ; <i1> [#uses=1]
- br i1 %tmp83, label %cond_next89, label %UnifiedReturnBlock
-
-cond_next89: ; preds = %cond_next73, %ubyte_ctype_remainder.exit
- %tmp90 = call %struct.PyObject* @PyTuple_New( i64 2 ) ; <%struct.PyObject*> [#uses=9]
- %tmp92 = icmp eq %struct.PyObject* %tmp90, null ; <i1> [#uses=1]
- br i1 %tmp92, label %UnifiedReturnBlock, label %cond_next97
-
-cond_next97: ; preds = %cond_next89
- %tmp98 = load i8*** @PyArray_API, align 8 ; <i8**> [#uses=1]
- %tmp99 = getelementptr i8** %tmp98, i64 25 ; <i8**> [#uses=1]
- %tmp100 = load i8** %tmp99 ; <i8*> [#uses=1]
- %tmp100101 = bitcast i8* %tmp100 to %struct._typeobject* ; <%struct._typeobject*> [#uses=2]
- %tmp102 = getelementptr %struct._typeobject* %tmp100101, i32 0, i32 38 ; <%struct.PyObject* (%struct._typeobject*, i64)**> [#uses=1]
- %tmp103 = load %struct.PyObject* (%struct._typeobject*, i64)** %tmp102 ; <%struct.PyObject* (%struct._typeobject*, i64)*> [#uses=1]
- %tmp108 = call %struct.PyObject* %tmp103( %struct._typeobject* %tmp100101, i64 0 ) ; <%struct.PyObject*> [#uses=3]
- %tmp110 = icmp eq %struct.PyObject* %tmp108, null ; <i1> [#uses=1]
- br i1 %tmp110, label %cond_true113, label %cond_next135
-
-cond_true113: ; preds = %cond_next97
- %tmp115 = getelementptr %struct.PyObject* %tmp90, i32 0, i32 0 ; <i64*> [#uses=2]
- %tmp116 = load i64* %tmp115 ; <i64> [#uses=1]
- %tmp117 = add i64 %tmp116, -1 ; <i64> [#uses=2]
- store i64 %tmp117, i64* %tmp115
- %tmp123 = icmp eq i64 %tmp117, 0 ; <i1> [#uses=1]
- br i1 %tmp123, label %cond_true126, label %UnifiedReturnBlock
-
-cond_true126: ; preds = %cond_true113
- %tmp128 = getelementptr %struct.PyObject* %tmp90, i32 0, i32 1 ; <%struct._typeobject**> [#uses=1]
- %tmp129 = load %struct._typeobject** %tmp128 ; <%struct._typeobject*> [#uses=1]
- %tmp130 = getelementptr %struct._typeobject* %tmp129, i32 0, i32 6 ; <void (%struct.PyObject*)**> [#uses=1]
- %tmp131 = load void (%struct.PyObject*)** %tmp130 ; <void (%struct.PyObject*)*> [#uses=1]
- call void %tmp131( %struct.PyObject* %tmp90 )
- ret %struct.PyObject* null
-
-cond_next135: ; preds = %cond_next97
- %tmp136137 = bitcast %struct.PyObject* %tmp108 to %struct.PyBoolScalarObject* ; <%struct.PyBoolScalarObject*> [#uses=1]
- %tmp139 = getelementptr %struct.PyBoolScalarObject* %tmp136137, i32 0, i32 2 ; <i8*> [#uses=1]
- store i8 %out.2, i8* %tmp139
- %tmp140141 = bitcast %struct.PyObject* %tmp90 to %struct.PyTupleObject* ; <%struct.PyTupleObject*> [#uses=2]
- %tmp143 = getelementptr %struct.PyTupleObject* %tmp140141, i32 0, i32 3, i64 0 ; <%struct.PyObject**> [#uses=1]
- store %struct.PyObject* %tmp108, %struct.PyObject** %tmp143
- %tmp145 = load i8*** @PyArray_API, align 8 ; <i8**> [#uses=1]
- %tmp146 = getelementptr i8** %tmp145, i64 25 ; <i8**> [#uses=1]
- %tmp147 = load i8** %tmp146 ; <i8*> [#uses=1]
- %tmp147148 = bitcast i8* %tmp147 to %struct._typeobject* ; <%struct._typeobject*> [#uses=2]
- %tmp149 = getelementptr %struct._typeobject* %tmp147148, i32 0, i32 38 ; <%struct.PyObject* (%struct._typeobject*, i64)**> [#uses=1]
- %tmp150 = load %struct.PyObject* (%struct._typeobject*, i64)** %tmp149 ; <%struct.PyObject* (%struct._typeobject*, i64)*> [#uses=1]
- %tmp155 = call %struct.PyObject* %tmp150( %struct._typeobject* %tmp147148, i64 0 ) ; <%struct.PyObject*> [#uses=3]
- %tmp157 = icmp eq %struct.PyObject* %tmp155, null ; <i1> [#uses=1]
- br i1 %tmp157, label %cond_true160, label %cond_next182
-
-cond_true160: ; preds = %cond_next135
- %tmp162 = getelementptr %struct.PyObject* %tmp90, i32 0, i32 0 ; <i64*> [#uses=2]
- %tmp163 = load i64* %tmp162 ; <i64> [#uses=1]
- %tmp164 = add i64 %tmp163, -1 ; <i64> [#uses=2]
- store i64 %tmp164, i64* %tmp162
- %tmp170 = icmp eq i64 %tmp164, 0 ; <i1> [#uses=1]
- br i1 %tmp170, label %cond_true173, label %UnifiedReturnBlock
-
-cond_true173: ; preds = %cond_true160
- %tmp175 = getelementptr %struct.PyObject* %tmp90, i32 0, i32 1 ; <%struct._typeobject**> [#uses=1]
- %tmp176 = load %struct._typeobject** %tmp175 ; <%struct._typeobject*> [#uses=1]
- %tmp177 = getelementptr %struct._typeobject* %tmp176, i32 0, i32 6 ; <void (%struct.PyObject*)**> [#uses=1]
- %tmp178 = load void (%struct.PyObject*)** %tmp177 ; <void (%struct.PyObject*)*> [#uses=1]
- call void %tmp178( %struct.PyObject* %tmp90 )
- ret %struct.PyObject* null
-
-cond_next182: ; preds = %cond_next135
- %tmp183184 = bitcast %struct.PyObject* %tmp155 to %struct.PyBoolScalarObject* ; <%struct.PyBoolScalarObject*> [#uses=1]
- %tmp186 = getelementptr %struct.PyBoolScalarObject* %tmp183184, i32 0, i32 2 ; <i8*> [#uses=1]
- store i8 %out2.0, i8* %tmp186
- %tmp190 = getelementptr %struct.PyTupleObject* %tmp140141, i32 0, i32 3, i64 1 ; <%struct.PyObject**> [#uses=1]
- store %struct.PyObject* %tmp155, %struct.PyObject** %tmp190
- ret %struct.PyObject* %tmp90
-
-UnifiedReturnBlock: ; preds = %cond_true160, %cond_true113, %cond_next89, %cond_next73, %cond_true61, %bb17
- ret %struct.PyObject* null
-}
-
-declare i32 @feraiseexcept(i32)
-
-declare fastcc i32 @_ubyte_convert_to_ctype(%struct.PyObject*, i8*)
-
-declare %struct.PyObject* @PyErr_Occurred()
-
-declare %struct.PyObject* @PyTuple_New(i64)
diff --git a/release_23/test/CodeGen/X86/2007-08-10-SignExtSubreg.ll b/release_23/test/CodeGen/X86/2007-08-10-SignExtSubreg.ll
deleted file mode 100644
index b62d2c61bba7..000000000000
--- a/release_23/test/CodeGen/X86/2007-08-10-SignExtSubreg.ll
+++ /dev/null
@@ -1,10 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 | grep {movsbl}
-
-@X = global i32 0 ; <i32*> [#uses=1]
-
-define i8 @_Z3fooi(i32 %x) signext {
-entry:
- store i32 %x, i32* @X, align 4
- %retval67 = trunc i32 %x to i8 ; <i8> [#uses=1]
- ret i8 %retval67
-}
diff --git a/release_23/test/CodeGen/X86/2007-08-13-AppendingLinkage.ll b/release_23/test/CodeGen/X86/2007-08-13-AppendingLinkage.ll
deleted file mode 100644
index f6ed0fe7a5ff..000000000000
--- a/release_23/test/CodeGen/X86/2007-08-13-AppendingLinkage.ll
+++ /dev/null
@@ -1,12 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 | not grep drectve
-; PR1607
-
-%hlvm_programs_element = type { i8*, i32 (i32, i8**)* }
-@hlvm_programs = appending constant [1 x %hlvm_programs_element]
-zeroinitializer
-
-define %hlvm_programs_element* @hlvm_get_programs() {
-entry:
- ret %hlvm_programs_element* getelementptr([1 x %hlvm_programs_element]*
- @hlvm_programs, i32 0, i32 0)
-}
diff --git a/release_23/test/CodeGen/X86/2007-08-13-SpillerReuse.ll b/release_23/test/CodeGen/X86/2007-08-13-SpillerReuse.ll
deleted file mode 100644
index 8cc235ba6caa..000000000000
--- a/release_23/test/CodeGen/X86/2007-08-13-SpillerReuse.ll
+++ /dev/null
@@ -1,102 +0,0 @@
-; RUN: llvm-as < %s | llc -mtriple=i686-apple-darwin | grep "48(%esp)" | count 5
-
- %struct..0anon = type { i32 }
- %struct.rtvec_def = type { i32, [1 x %struct..0anon] }
- %struct.rtx_def = type { i16, i8, i8, [1 x %struct..0anon] }
-@rtx_format = external global [116 x i8*] ; <[116 x i8*]*> [#uses=1]
-@rtx_length = external global [117 x i32] ; <[117 x i32]*> [#uses=1]
-
-declare fastcc %struct.rtx_def* @fixup_memory_subreg(%struct.rtx_def*, %struct.rtx_def*, i32)
-
-define fastcc %struct.rtx_def* @walk_fixup_memory_subreg(%struct.rtx_def* %x, %struct.rtx_def* %insn) {
-entry:
- %tmp2 = icmp eq %struct.rtx_def* %x, null ; <i1> [#uses=1]
- br i1 %tmp2, label %UnifiedReturnBlock, label %cond_next
-
-cond_next: ; preds = %entry
- %tmp6 = getelementptr %struct.rtx_def* %x, i32 0, i32 0 ; <i16*> [#uses=1]
- %tmp7 = load i16* %tmp6 ; <i16> [#uses=2]
- %tmp78 = zext i16 %tmp7 to i32 ; <i32> [#uses=2]
- %tmp10 = icmp eq i16 %tmp7, 54 ; <i1> [#uses=1]
- br i1 %tmp10, label %cond_true13, label %cond_next32
-
-cond_true13: ; preds = %cond_next
- %tmp15 = getelementptr %struct.rtx_def* %x, i32 0, i32 3 ; <[1 x %struct..0anon]*> [#uses=1]
- %tmp1718 = bitcast [1 x %struct..0anon]* %tmp15 to %struct.rtx_def** ; <%struct.rtx_def**> [#uses=1]
- %tmp19 = load %struct.rtx_def** %tmp1718 ; <%struct.rtx_def*> [#uses=1]
- %tmp20 = getelementptr %struct.rtx_def* %tmp19, i32 0, i32 0 ; <i16*> [#uses=1]
- %tmp21 = load i16* %tmp20 ; <i16> [#uses=1]
- %tmp22 = icmp eq i16 %tmp21, 57 ; <i1> [#uses=1]
- br i1 %tmp22, label %cond_true25, label %cond_next32
-
-cond_true25: ; preds = %cond_true13
- %tmp29 = tail call fastcc %struct.rtx_def* @fixup_memory_subreg( %struct.rtx_def* %x, %struct.rtx_def* %insn, i32 1 ) ; <%struct.rtx_def*> [#uses=1]
- ret %struct.rtx_def* %tmp29
-
-cond_next32: ; preds = %cond_true13, %cond_next
- %tmp34 = getelementptr [116 x i8*]* @rtx_format, i32 0, i32 %tmp78 ; <i8**> [#uses=1]
- %tmp35 = load i8** %tmp34, align 4 ; <i8*> [#uses=1]
- %tmp37 = getelementptr [117 x i32]* @rtx_length, i32 0, i32 %tmp78 ; <i32*> [#uses=1]
- %tmp38 = load i32* %tmp37, align 4 ; <i32> [#uses=1]
- %i.011 = add i32 %tmp38, -1 ; <i32> [#uses=2]
- %tmp12513 = icmp sgt i32 %i.011, -1 ; <i1> [#uses=1]
- br i1 %tmp12513, label %bb, label %UnifiedReturnBlock
-
-bb: ; preds = %bb123, %cond_next32
- %indvar = phi i32 [ %indvar.next26, %bb123 ], [ 0, %cond_next32 ] ; <i32> [#uses=2]
- %i.01.0 = sub i32 %i.011, %indvar ; <i32> [#uses=5]
- %tmp42 = getelementptr i8* %tmp35, i32 %i.01.0 ; <i8*> [#uses=2]
- %tmp43 = load i8* %tmp42 ; <i8> [#uses=1]
- switch i8 %tmp43, label %bb123 [
- i8 101, label %cond_true47
- i8 69, label %bb105.preheader
- ]
-
-cond_true47: ; preds = %bb
- %tmp52 = getelementptr %struct.rtx_def* %x, i32 0, i32 3, i32 %i.01.0 ; <%struct..0anon*> [#uses=1]
- %tmp5354 = bitcast %struct..0anon* %tmp52 to %struct.rtx_def** ; <%struct.rtx_def**> [#uses=1]
- %tmp55 = load %struct.rtx_def** %tmp5354 ; <%struct.rtx_def*> [#uses=1]
- %tmp58 = tail call fastcc %struct.rtx_def* @walk_fixup_memory_subreg( %struct.rtx_def* %tmp55, %struct.rtx_def* %insn ) ; <%struct.rtx_def*> [#uses=1]
- %tmp62 = getelementptr %struct.rtx_def* %x, i32 0, i32 3, i32 %i.01.0, i32 0 ; <i32*> [#uses=1]
- %tmp58.c = ptrtoint %struct.rtx_def* %tmp58 to i32 ; <i32> [#uses=1]
- store i32 %tmp58.c, i32* %tmp62
- %tmp6816 = load i8* %tmp42 ; <i8> [#uses=1]
- %tmp6917 = icmp eq i8 %tmp6816, 69 ; <i1> [#uses=1]
- br i1 %tmp6917, label %bb105.preheader, label %bb123
-
-bb105.preheader: ; preds = %cond_true47, %bb
- %tmp11020 = getelementptr %struct.rtx_def* %x, i32 0, i32 3, i32 %i.01.0 ; <%struct..0anon*> [#uses=1]
- %tmp11111221 = bitcast %struct..0anon* %tmp11020 to %struct.rtvec_def** ; <%struct.rtvec_def**> [#uses=3]
- %tmp11322 = load %struct.rtvec_def** %tmp11111221 ; <%struct.rtvec_def*> [#uses=1]
- %tmp11423 = getelementptr %struct.rtvec_def* %tmp11322, i32 0, i32 0 ; <i32*> [#uses=1]
- %tmp11524 = load i32* %tmp11423 ; <i32> [#uses=1]
- %tmp11625 = icmp eq i32 %tmp11524, 0 ; <i1> [#uses=1]
- br i1 %tmp11625, label %bb123, label %bb73
-
-bb73: ; preds = %bb73, %bb105.preheader
- %j.019 = phi i32 [ %tmp104, %bb73 ], [ 0, %bb105.preheader ] ; <i32> [#uses=3]
- %tmp81 = load %struct.rtvec_def** %tmp11111221 ; <%struct.rtvec_def*> [#uses=2]
- %tmp92 = getelementptr %struct.rtvec_def* %tmp81, i32 0, i32 1, i32 %j.019 ; <%struct..0anon*> [#uses=1]
- %tmp9394 = bitcast %struct..0anon* %tmp92 to %struct.rtx_def** ; <%struct.rtx_def**> [#uses=1]
- %tmp95 = load %struct.rtx_def** %tmp9394 ; <%struct.rtx_def*> [#uses=1]
- %tmp98 = tail call fastcc %struct.rtx_def* @walk_fixup_memory_subreg( %struct.rtx_def* %tmp95, %struct.rtx_def* %insn ) ; <%struct.rtx_def*> [#uses=1]
- %tmp101 = getelementptr %struct.rtvec_def* %tmp81, i32 0, i32 1, i32 %j.019, i32 0 ; <i32*> [#uses=1]
- %tmp98.c = ptrtoint %struct.rtx_def* %tmp98 to i32 ; <i32> [#uses=1]
- store i32 %tmp98.c, i32* %tmp101
- %tmp104 = add i32 %j.019, 1 ; <i32> [#uses=2]
- %tmp113 = load %struct.rtvec_def** %tmp11111221 ; <%struct.rtvec_def*> [#uses=1]
- %tmp114 = getelementptr %struct.rtvec_def* %tmp113, i32 0, i32 0 ; <i32*> [#uses=1]
- %tmp115 = load i32* %tmp114 ; <i32> [#uses=1]
- %tmp116 = icmp ult i32 %tmp104, %tmp115 ; <i1> [#uses=1]
- br i1 %tmp116, label %bb73, label %bb123
-
-bb123: ; preds = %bb73, %bb105.preheader, %cond_true47, %bb
- %i.0 = add i32 %i.01.0, -1 ; <i32> [#uses=1]
- %tmp125 = icmp sgt i32 %i.0, -1 ; <i1> [#uses=1]
- %indvar.next26 = add i32 %indvar, 1 ; <i32> [#uses=1]
- br i1 %tmp125, label %bb, label %UnifiedReturnBlock
-
-UnifiedReturnBlock: ; preds = %bb123, %cond_next32, %entry
- %UnifiedRetVal = phi %struct.rtx_def* [ null, %entry ], [ %x, %cond_next32 ], [ %x, %bb123 ] ; <%struct.rtx_def*> [#uses=1]
- ret %struct.rtx_def* %UnifiedRetVal
-}
diff --git a/release_23/test/CodeGen/X86/2007-09-03-X86-64-EhSelector.ll b/release_23/test/CodeGen/X86/2007-09-03-X86-64-EhSelector.ll
deleted file mode 100644
index dac788007611..000000000000
--- a/release_23/test/CodeGen/X86/2007-09-03-X86-64-EhSelector.ll
+++ /dev/null
@@ -1,38 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86-64 -enable-eh
-; PR1632
-
-define void @_Z1fv() {
-entry:
- invoke void @_Z1gv( )
- to label %return unwind label %unwind
-
-unwind: ; preds = %entry
- br i1 false, label %eh_then, label %cleanup20
-
-eh_then: ; preds = %unwind
- invoke void @__cxa_end_catch( )
- to label %return unwind label %unwind10
-
-unwind10: ; preds = %eh_then
- %eh_select13 = tail call i64 (i8*, i8*, ...)* @llvm.eh.selector.i64( i8* null, i8* bitcast (void ()* @__gxx_personality_v0 to i8*), i32 1 ) ; <i32> [#uses=2]
- %tmp18 = icmp slt i64 %eh_select13, 0 ; <i1> [#uses=1]
- br i1 %tmp18, label %filter, label %cleanup20
-
-filter: ; preds = %unwind10
- unreachable
-
-cleanup20: ; preds = %unwind10, %unwind
- %eh_selector.0 = phi i64 [ 0, %unwind ], [ %eh_select13, %unwind10 ] ; <i32> [#uses=0]
- ret void
-
-return: ; preds = %eh_then, %entry
- ret void
-}
-
-declare void @_Z1gv()
-
-declare i64 @llvm.eh.selector.i64(i8*, i8*, ...)
-
-declare void @__gxx_personality_v0()
-
-declare void @__cxa_end_catch()
diff --git a/release_23/test/CodeGen/X86/2007-09-05-InvalidAsm.ll b/release_23/test/CodeGen/X86/2007-09-05-InvalidAsm.ll
deleted file mode 100644
index b6a5fc97b4bb..000000000000
--- a/release_23/test/CodeGen/X86/2007-09-05-InvalidAsm.ll
+++ /dev/null
@@ -1,49 +0,0 @@
-; RUN: llvm-as < %s | llc -mtriple=x86_64-apple-darwin -x86-asm-syntax=intel | not grep {lea\[\[:space:\]\]R}
-
- %struct.AGenericCall = type { %struct.AGenericManager*, %struct.ComponentParameters*, i32* }
- %struct.AGenericManager = type <{ i8 }>
- %struct.ComponentInstanceRecord = type opaque
- %struct.ComponentParameters = type { [1 x i64] }
-
-define i32 @_ZN12AGenericCall10MapIDPtrAtEsRP23ComponentInstanceRecord(%struct.AGenericCall* %this, i16 signext %param, %struct.ComponentInstanceRecord** %instance) {
-entry:
- %tmp4 = icmp slt i16 %param, 0 ; <i1> [#uses=1]
- br i1 %tmp4, label %cond_true, label %cond_next
-
-cond_true: ; preds = %entry
- %tmp1415 = shl i16 %param, 3 ; <i16> [#uses=1]
- %tmp17 = getelementptr %struct.AGenericCall* %this, i32 0, i32 1 ; <%struct.ComponentParameters**> [#uses=1]
- %tmp18 = load %struct.ComponentParameters** %tmp17, align 8 ; <%struct.ComponentParameters*> [#uses=1]
- %tmp1920 = bitcast %struct.ComponentParameters* %tmp18 to i8* ; <i8*> [#uses=1]
- %tmp212223 = sext i16 %tmp1415 to i64 ; <i64> [#uses=1]
- %tmp24 = getelementptr i8* %tmp1920, i64 %tmp212223 ; <i8*> [#uses=1]
- %tmp2425 = bitcast i8* %tmp24 to i64* ; <i64*> [#uses=1]
- %tmp28 = load i64* %tmp2425, align 8 ; <i64> [#uses=1]
- %tmp2829 = inttoptr i64 %tmp28 to i32* ; <i32*> [#uses=1]
- %tmp31 = getelementptr %struct.AGenericCall* %this, i32 0, i32 2 ; <i32**> [#uses=1]
- store i32* %tmp2829, i32** %tmp31, align 8
- br label %cond_next
-
-cond_next: ; preds = %cond_true, %entry
- %tmp4243 = shl i16 %param, 3 ; <i16> [#uses=1]
- %tmp46 = getelementptr %struct.AGenericCall* %this, i32 0, i32 1 ; <%struct.ComponentParameters**> [#uses=1]
- %tmp47 = load %struct.ComponentParameters** %tmp46, align 8 ; <%struct.ComponentParameters*> [#uses=1]
- %tmp4849 = bitcast %struct.ComponentParameters* %tmp47 to i8* ; <i8*> [#uses=1]
- %tmp505152 = sext i16 %tmp4243 to i64 ; <i64> [#uses=1]
- %tmp53 = getelementptr i8* %tmp4849, i64 %tmp505152 ; <i8*> [#uses=1]
- %tmp5354 = bitcast i8* %tmp53 to i64* ; <i64*> [#uses=1]
- %tmp58 = load i64* %tmp5354, align 8 ; <i64> [#uses=1]
- %tmp59 = icmp eq i64 %tmp58, 0 ; <i1> [#uses=1]
- br i1 %tmp59, label %UnifiedReturnBlock, label %cond_true63
-
-cond_true63: ; preds = %cond_next
- %tmp65 = getelementptr %struct.AGenericCall* %this, i32 0, i32 0 ; <%struct.AGenericManager**> [#uses=1]
- %tmp66 = load %struct.AGenericManager** %tmp65, align 8 ; <%struct.AGenericManager*> [#uses=1]
- %tmp69 = tail call i32 @_ZN15AGenericManager24DefaultComponentInstanceERP23ComponentInstanceRecord( %struct.AGenericManager* %tmp66, %struct.ComponentInstanceRecord** %instance ) ; <i32> [#uses=1]
- ret i32 %tmp69
-
-UnifiedReturnBlock: ; preds = %cond_next
- ret i32 undef
-}
-
-declare i32 @_ZN15AGenericManager24DefaultComponentInstanceERP23ComponentInstanceRecord(%struct.AGenericManager*, %struct.ComponentInstanceRecord**)
diff --git a/release_23/test/CodeGen/X86/2007-09-06-ExtWeakAliasee.ll b/release_23/test/CodeGen/X86/2007-09-06-ExtWeakAliasee.ll
deleted file mode 100644
index 4f95b7603bae..000000000000
--- a/release_23/test/CodeGen/X86/2007-09-06-ExtWeakAliasee.ll
+++ /dev/null
@@ -1,4 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 | grep weak | count 2
-@__gthrw_pthread_once = alias weak i32 (i32*, void ()*)* @pthread_once ; <i32 (i32*, void ()*)*> [#uses=0]
-
-declare extern_weak i32 @pthread_once(i32*, void ()*)
diff --git a/release_23/test/CodeGen/X86/2007-09-17-ObjcFrameEH.ll b/release_23/test/CodeGen/X86/2007-09-17-ObjcFrameEH.ll
deleted file mode 100644
index 6a313be18885..000000000000
--- a/release_23/test/CodeGen/X86/2007-09-17-ObjcFrameEH.ll
+++ /dev/null
@@ -1,65 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -mtriple=i686-apple-darwin -enable-eh | grep {isNullOrNil].eh"} | count 2
-
- %struct.NSString = type { }
- %struct._objc__method_prototype_list = type opaque
- %struct._objc_category = type { i8*, i8*, %struct._objc_method_list*, %struct._objc_method_list*, %struct._objc_protocol**, i32, %struct._prop_list_t* }
- %struct._objc_method = type { %struct.objc_selector*, i8*, i8* }
- %struct._objc_method_list = type opaque
- %struct._objc_module = type { i32, i32, i8*, %struct._objc_symtab* }
- %struct._objc_protocol = type { %struct._objc_protocol_extension*, i8*, %struct._objc_protocol**, %struct._objc__method_prototype_list*, %struct._objc__method_prototype_list* }
- %struct._objc_protocol_extension = type opaque
- %struct._objc_symtab = type { i32, %struct.objc_selector**, i16, i16, [1 x i8*] }
- %struct._prop_list_t = type opaque
- %struct.anon = type { %struct._objc__method_prototype_list*, i32, [1 x %struct._objc_method] }
- %struct.objc_selector = type opaque
-@"\01L_OBJC_SYMBOLS" = internal global { i32, i32, i16, i16, [1 x %struct._objc_category*] } {
- i32 0,
- i32 0,
- i16 0,
- i16 1,
- [1 x %struct._objc_category*] [ %struct._objc_category* bitcast ({ i8*, i8*, %struct._objc_method_list*, i32, i32, i32, i32 }* @"\01L_OBJC_CATEGORY_NSString_local" to %struct._objc_category*) ] }, section "__OBJC,__symbols,regular,no_dead_strip" ; <{ i32, i32, i16, i16, [1 x %struct._objc_category*] }*> [#uses=2]
-@"\01L_OBJC_CATEGORY_INSTANCE_METHODS_NSString_local" = internal global { i32, i32, [1 x %struct._objc_method] } {
- i32 0,
- i32 1,
- [1 x %struct._objc_method] [ %struct._objc_method {
- %struct.objc_selector* bitcast ([12 x i8]* @"\01L_OBJC_METH_VAR_NAME_0" to %struct.objc_selector*),
- i8* getelementptr ([7 x i8]* @"\01L_OBJC_METH_VAR_TYPE_0", i32 0, i32 0),
- i8* bitcast (i8 (%struct.NSString*, %struct.objc_selector*) signext * @"-[NSString(local) isNullOrNil]" to i8*) } ] }, section "__OBJC,__cat_inst_meth,regular,no_dead_strip" ; <{ i32, i32, [1 x %struct._objc_method] }*> [#uses=3]
-@"\01L_OBJC_CATEGORY_NSString_local" = internal global { i8*, i8*, %struct._objc_method_list*, i32, i32, i32, i32 } {
- i8* getelementptr ([6 x i8]* @"\01L_OBJC_CLASS_NAME_0", i32 0, i32 0),
- i8* getelementptr ([9 x i8]* @"\01L_OBJC_CLASS_NAME_1", i32 0, i32 0),
- %struct._objc_method_list* bitcast ({ i32, i32, [1 x %struct._objc_method] }* @"\01L_OBJC_CATEGORY_INSTANCE_METHODS_NSString_local" to %struct._objc_method_list*),
- i32 0,
- i32 0,
- i32 28,
- i32 0 }, section "__OBJC,__category,regular,no_dead_strip" ; <{ i8*, i8*, %struct._objc_method_list*, i32, i32, i32, i32 }*> [#uses=2]
-@"\01L_OBJC_IMAGE_INFO" = internal constant [2 x i32] zeroinitializer, section "__OBJC,__image_info,regular" ; <[2 x i32]*> [#uses=1]
-@"\01L_OBJC_MODULES" = internal global %struct._objc_module {
- i32 7,
- i32 16,
- i8* getelementptr ([1 x i8]* @"\01L_OBJC_CLASS_NAME_2", i32 0, i32 0),
- %struct._objc_symtab* bitcast ({ i32, i32, i16, i16, [1 x %struct._objc_category*] }* @"\01L_OBJC_SYMBOLS" to %struct._objc_symtab*) }, section "__OBJC,__module_info,regular,no_dead_strip" ; <%struct._objc_module*> [#uses=1]
-@"\01.objc_class_ref_NSString" = internal global i8* @"\01.objc_class_name_NSString" ; <i8**> [#uses=0]
-@"\01.objc_class_name_NSString" = external global i8 ; <i8*> [#uses=1]
-@"\01.objc_category_name_NSString_local" = constant i32 0 ; <i32*> [#uses=1]
-@"\01L_OBJC_CLASS_NAME_2" = internal global [1 x i8] zeroinitializer, section "__TEXT,__cstring,cstring_literals" ; <[1 x i8]*> [#uses=2]
-@"\01L_OBJC_CLASS_NAME_1" = internal global [9 x i8] c"NSString\00", section "__TEXT,__cstring,cstring_literals" ; <[9 x i8]*> [#uses=2]
-@"\01L_OBJC_CLASS_NAME_0" = internal global [6 x i8] c"local\00", section "__TEXT,__cstring,cstring_literals" ; <[6 x i8]*> [#uses=2]
-@"\01L_OBJC_METH_VAR_NAME_0" = internal global [12 x i8] c"isNullOrNil\00", section "__TEXT,__cstring,cstring_literals" ; <[12 x i8]*> [#uses=3]
-@"\01L_OBJC_METH_VAR_TYPE_0" = internal global [7 x i8] c"c8@0:4\00", section "__TEXT,__cstring,cstring_literals" ; <[7 x i8]*> [#uses=2]
-@llvm.used = appending global [11 x i8*] [ i8* bitcast ({ i32, i32, i16, i16, [1 x %struct._objc_category*] }* @"\01L_OBJC_SYMBOLS" to i8*), i8* bitcast ({ i32, i32, [1 x %struct._objc_method] }* @"\01L_OBJC_CATEGORY_INSTANCE_METHODS_NSString_local" to i8*), i8* bitcast ({ i8*, i8*, %struct._objc_method_list*, i32, i32, i32, i32 }* @"\01L_OBJC_CATEGORY_NSString_local" to i8*), i8* bitcast ([2 x i32]* @"\01L_OBJC_IMAGE_INFO" to i8*), i8* bitcast (%struct._objc_module* @"\01L_OBJC_MODULES" to i8*), i8* bitcast (i32* @"\01.objc_category_name_NSString_local" to i8*), i8* getelementptr ([1 x i8]* @"\01L_OBJC_CLASS_NAME_2", i32 0, i32 0), i8* getelementptr ([9 x i8]* @"\01L_OBJC_CLASS_NAME_1", i32 0, i32 0), i8* getelementptr ([6 x i8]* @"\01L_OBJC_CLASS_NAME_0", i32 0, i32 0), i8* getelementptr ([12 x i8]* @"\01L_OBJC_METH_VAR_NAME_0", i32 0, i32 0), i8* getelementptr ([7 x i8]* @"\01L_OBJC_METH_VAR_TYPE_0", i32 0, i32 0) ], section "llvm.metadata" ; <[11 x i8*]*> [#uses=0]
-
-define internal i8 @"-[NSString(local) isNullOrNil]"(%struct.NSString* %self, %struct.objc_selector* %_cmd) signext {
-entry:
- %self_addr = alloca %struct.NSString* ; <%struct.NSString**> [#uses=1]
- %_cmd_addr = alloca %struct.objc_selector* ; <%struct.objc_selector**> [#uses=1]
- %retval = alloca i8, align 1 ; <i8*> [#uses=1]
- %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
- store %struct.NSString* %self, %struct.NSString** %self_addr
- store %struct.objc_selector* %_cmd, %struct.objc_selector** %_cmd_addr
- br label %return
-
-return: ; preds = %entry
- %retval1 = load i8* %retval ; <i8> [#uses=1]
- ret i8 %retval1
-}
diff --git a/release_23/test/CodeGen/X86/2007-09-18-ShuffleXformBug.ll b/release_23/test/CodeGen/X86/2007-09-18-ShuffleXformBug.ll
deleted file mode 100644
index 142bcd334787..000000000000
--- a/release_23/test/CodeGen/X86/2007-09-18-ShuffleXformBug.ll
+++ /dev/null
@@ -1,30 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep 170
-
-define i16 @f(<4 x float>* %tmp116117.i1061.i) nounwind {
-entry:
- alloca [4 x <4 x float>] ; <[4 x <4 x float>]*>:0 [#uses=167]
- alloca [4 x <4 x float>] ; <[4 x <4 x float>]*>:1 [#uses=170]
- alloca [4 x <4 x i32>] ; <[4 x <4 x i32>]*>:2 [#uses=12]
- %.sub6235.i = getelementptr [4 x <4 x float>]* %0, i32 0, i32 0 ; <<4 x float>*> [#uses=76]
- %.sub.i = getelementptr [4 x <4 x float>]* %1, i32 0, i32 0 ; <<4 x float>*> [#uses=59]
-
- %tmp124.i1062.i = getelementptr <4 x float>* %tmp116117.i1061.i, i32 63 ; <<4 x float>*> [#uses=1]
- %tmp125.i1063.i = load <4 x float>* %tmp124.i1062.i ; <<4 x float>> [#uses=5]
- %tmp828.i1077.i = shufflevector <4 x float> %tmp125.i1063.i, <4 x float> undef, <4 x i32> < i32 1, i32 1, i32 1, i32 1 > ; <<4 x float>> [#uses=4]
- %tmp704.i1085.i = load <4 x float>* %.sub6235.i ; <<4 x float>> [#uses=1]
- %tmp712.i1086.i = call <4 x float> @llvm.x86.sse.max.ps( <4 x float> %tmp704.i1085.i, <4 x float> %tmp828.i1077.i ) ; <<4 x float>> [#uses=1]
- store <4 x float> %tmp712.i1086.i, <4 x float>* %.sub.i
-
- %tmp2587.i1145.gep.i = getelementptr [4 x <4 x float>]* %1, i32 0, i32 0, i32 2 ; <float*> [#uses=1]
- %tmp5334.i = load float* %tmp2587.i1145.gep.i ; <float> [#uses=5]
- %tmp2723.i1170.i = insertelement <4 x float> undef, float %tmp5334.i, i32 2 ; <<4 x float>> [#uses=5]
- store <4 x float> %tmp2723.i1170.i, <4 x float>* %.sub6235.i
-
- %tmp1406.i1367.i = shufflevector <4 x float> %tmp2723.i1170.i, <4 x float> undef, <4 x i32> < i32 2, i32 2, i32 2, i32 2 > ; <<4 x float>> [#uses=1]
- %tmp84.i1413.i = load <4 x float>* %.sub6235.i ; <<4 x float>> [#uses=1]
- %tmp89.i1415.i = mul <4 x float> %tmp84.i1413.i, %tmp1406.i1367.i ; <<4 x float>> [#uses=1]
- store <4 x float> %tmp89.i1415.i, <4 x float>* %.sub.i
- ret i16 0
-}
-
-declare <4 x float> @llvm.x86.sse.max.ps(<4 x float>, <4 x float>)
diff --git a/release_23/test/CodeGen/X86/2007-09-27-LDIntrinsics.ll b/release_23/test/CodeGen/X86/2007-09-27-LDIntrinsics.ll
deleted file mode 100644
index be51c04a3837..000000000000
--- a/release_23/test/CodeGen/X86/2007-09-27-LDIntrinsics.ll
+++ /dev/null
@@ -1,47 +0,0 @@
-; RUN: llvm-as < %s | llc | grep powixf2
-; RUN: llvm-as < %s | llc | grep fsqrt
-; ModuleID = 'yyy.c'
-target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
-target triple = "i686-apple-darwin8"
-
-define x86_fp80 @foo(x86_fp80 %x) {
-entry:
- %x_addr = alloca x86_fp80 ; <x86_fp80*> [#uses=2]
- %retval = alloca x86_fp80 ; <x86_fp80*> [#uses=2]
- %tmp = alloca x86_fp80 ; <x86_fp80*> [#uses=2]
- %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
- store x86_fp80 %x, x86_fp80* %x_addr
- %tmp1 = load x86_fp80* %x_addr, align 16 ; <x86_fp80> [#uses=1]
- %tmp2 = call x86_fp80 @llvm.sqrt.f80( x86_fp80 %tmp1 ) ; <x86_fp80> [#uses=1]
- store x86_fp80 %tmp2, x86_fp80* %tmp, align 16
- %tmp3 = load x86_fp80* %tmp, align 16 ; <x86_fp80> [#uses=1]
- store x86_fp80 %tmp3, x86_fp80* %retval, align 16
- br label %return
-
-return: ; preds = %entry
- %retval4 = load x86_fp80* %retval ; <x86_fp80> [#uses=1]
- ret x86_fp80 %retval4
-}
-
-declare x86_fp80 @llvm.sqrt.f80(x86_fp80)
-
-define x86_fp80 @bar(x86_fp80 %x) {
-entry:
- %x_addr = alloca x86_fp80 ; <x86_fp80*> [#uses=2]
- %retval = alloca x86_fp80 ; <x86_fp80*> [#uses=2]
- %tmp = alloca x86_fp80 ; <x86_fp80*> [#uses=2]
- %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
- store x86_fp80 %x, x86_fp80* %x_addr
- %tmp1 = load x86_fp80* %x_addr, align 16 ; <x86_fp80> [#uses=1]
- %tmp2 = call x86_fp80 @llvm.powi.f80( x86_fp80 %tmp1, i32 3 ) ; <x86_fp80> [#uses=1]
- store x86_fp80 %tmp2, x86_fp80* %tmp, align 16
- %tmp3 = load x86_fp80* %tmp, align 16 ; <x86_fp80> [#uses=1]
- store x86_fp80 %tmp3, x86_fp80* %retval, align 16
- br label %return
-
-return: ; preds = %entry
- %retval4 = load x86_fp80* %retval ; <x86_fp80> [#uses=1]
- ret x86_fp80 %retval4
-}
-
-declare x86_fp80 @llvm.powi.f80(x86_fp80, i32)
diff --git a/release_23/test/CodeGen/X86/2007-10-04-AvoidEFLAGSCopy.ll b/release_23/test/CodeGen/X86/2007-10-04-AvoidEFLAGSCopy.ll
deleted file mode 100644
index 64c601e9bc6a..000000000000
--- a/release_23/test/CodeGen/X86/2007-10-04-AvoidEFLAGSCopy.ll
+++ /dev/null
@@ -1,20 +0,0 @@
-; RUN: llvm-as < %s | llc | not grep pushf
-
- %struct.gl_texture_image = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i8*, i8* }
- %struct.gl_texture_object = type { i32, i32, i32, float, [4 x i32], i32, i32, i32, i32, i32, float, [11 x %struct.gl_texture_image*], [1024 x i8], i32, i32, i32, i8, i8*, i8, void (%struct.gl_texture_object*, i32, float*, float*, float*, float*, i8*, i8*, i8*, i8*)*, %struct.gl_texture_object* }
-
-define fastcc void @sample_3d_linear(%struct.gl_texture_object* %tObj, %struct.gl_texture_image* %img, float %s, float %t, float %r, i8* %red, i8* %green, i8* %blue, i8* %alpha) {
-entry:
- %tmp15 = load i32* null, align 4 ; <i32> [#uses=1]
- %tmp16 = icmp eq i32 %tmp15, 10497 ; <i1> [#uses=1]
- %tmp2152 = call float @floorf( float 0.000000e+00 ) ; <float> [#uses=0]
- br i1 %tmp16, label %cond_true, label %cond_false
-
-cond_true: ; preds = %entry
- ret void
-
-cond_false: ; preds = %entry
- ret void
-}
-
-declare float @floorf(float)
diff --git a/release_23/test/CodeGen/X86/2007-10-05-3AddrConvert.ll b/release_23/test/CodeGen/X86/2007-10-05-3AddrConvert.ll
deleted file mode 100644
index 2cc9124727f7..000000000000
--- a/release_23/test/CodeGen/X86/2007-10-05-3AddrConvert.ll
+++ /dev/null
@@ -1,32 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 | grep lea
-
- %struct.anon = type { [3 x double], double, %struct.node*, [64 x %struct.bnode*], [64 x %struct.bnode*] }
- %struct.bnode = type { i16, double, [3 x double], i32, i32, [3 x double], [3 x double], [3 x double], double, %struct.bnode*, %struct.bnode* }
- %struct.node = type { i16, double, [3 x double], i32, i32 }
-
-define fastcc void @old_main() {
-entry:
- %tmp44 = malloc %struct.anon ; <%struct.anon*> [#uses=2]
- store double 4.000000e+00, double* null, align 4
- br label %bb41
-
-bb41: ; preds = %uniform_testdata.exit, %entry
- %i.0110 = phi i32 [ 0, %entry ], [ %tmp48, %uniform_testdata.exit ] ; <i32> [#uses=2]
- %tmp48 = add i32 %i.0110, 1 ; <i32> [#uses=1]
- br i1 false, label %uniform_testdata.exit, label %bb33.preheader.i
-
-bb33.preheader.i: ; preds = %bb41
- ret void
-
-uniform_testdata.exit: ; preds = %bb41
- %tmp57 = getelementptr %struct.anon* %tmp44, i32 0, i32 3, i32 %i.0110 ; <%struct.bnode**> [#uses=1]
- store %struct.bnode* null, %struct.bnode** %tmp57, align 4
- br i1 false, label %bb154, label %bb41
-
-bb154: ; preds = %bb154, %uniform_testdata.exit
- br i1 false, label %bb166, label %bb154
-
-bb166: ; preds = %bb154
- %tmp169 = getelementptr %struct.anon* %tmp44, i32 0, i32 3, i32 0 ; <%struct.bnode**> [#uses=0]
- ret void
-}
diff --git a/release_23/test/CodeGen/X86/2007-10-12-CoalesceExtSubReg.ll b/release_23/test/CodeGen/X86/2007-10-12-CoalesceExtSubReg.ll
deleted file mode 100644
index e2fdbb32bde3..000000000000
--- a/release_23/test/CodeGen/X86/2007-10-12-CoalesceExtSubReg.ll
+++ /dev/null
@@ -1,35 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 | not grep movb
-
-define i16 @f(i32* %bp, i32* %ss) signext {
-entry:
- br label %cond_next127
-
-cond_next127: ; preds = %cond_next391, %entry
- %v.1 = phi i32 [ undef, %entry ], [ %tmp411, %cond_next391 ] ; <i32> [#uses=1]
- %tmp149 = mul i32 0, %v.1 ; <i32> [#uses=0]
- %tmp254 = and i32 0, 15 ; <i32> [#uses=1]
- %tmp256 = and i32 0, 15 ; <i32> [#uses=2]
- br i1 false, label %cond_true267, label %cond_next391
-
-cond_true267: ; preds = %cond_next127
- ret i16 0
-
-cond_next391: ; preds = %cond_next127
- %tmp393 = load i32* %ss, align 4 ; <i32> [#uses=1]
- %tmp395 = load i32* %bp, align 4 ; <i32> [#uses=2]
- %tmp396 = shl i32 %tmp393, %tmp395 ; <i32> [#uses=2]
- %tmp398 = sub i32 32, %tmp256 ; <i32> [#uses=2]
- %tmp399 = lshr i32 %tmp396, %tmp398 ; <i32> [#uses=1]
- %tmp405 = lshr i32 %tmp396, 31 ; <i32> [#uses=1]
- %tmp406 = add i32 %tmp405, -1 ; <i32> [#uses=1]
- %tmp409 = lshr i32 %tmp406, %tmp398 ; <i32> [#uses=1]
- %tmp411 = sub i32 %tmp399, %tmp409 ; <i32> [#uses=1]
- %tmp422445 = add i32 %tmp254, 0 ; <i32> [#uses=1]
- %tmp426447 = add i32 %tmp395, %tmp256 ; <i32> [#uses=1]
- store i32 %tmp426447, i32* %bp, align 4
- %tmp429448 = icmp ult i32 %tmp422445, 63 ; <i1> [#uses=1]
- br i1 %tmp429448, label %cond_next127, label %UnifiedReturnBlock
-
-UnifiedReturnBlock: ; preds = %cond_next391
- ret i16 0
-}
diff --git a/release_23/test/CodeGen/X86/2007-10-12-SpillerUnfold1.ll b/release_23/test/CodeGen/X86/2007-10-12-SpillerUnfold1.ll
deleted file mode 100644
index 3a3c11377380..000000000000
--- a/release_23/test/CodeGen/X86/2007-10-12-SpillerUnfold1.ll
+++ /dev/null
@@ -1,45 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep addss | not grep esp
-
-define fastcc void @fht(float* %fz, i16 signext %n) {
-entry:
- br i1 true, label %bb171.preheader, label %bb431
-
-bb171.preheader: ; preds = %entry
- %tmp176 = add float 0.000000e+00, 1.000000e+00 ; <float> [#uses=2]
- %gi.1 = getelementptr float* %fz, i32 0 ; <float*> [#uses=2]
- %tmp240 = load float* %gi.1, align 4 ; <float> [#uses=1]
- %tmp242 = sub float %tmp240, 0.000000e+00 ; <float> [#uses=2]
- %tmp251 = getelementptr float* %fz, i32 0 ; <float*> [#uses=1]
- %tmp252 = load float* %tmp251, align 4 ; <float> [#uses=1]
- %tmp258 = getelementptr float* %fz, i32 0 ; <float*> [#uses=2]
- %tmp259 = load float* %tmp258, align 4 ; <float> [#uses=2]
- %tmp261 = mul float %tmp259, %tmp176 ; <float> [#uses=1]
- %tmp262 = sub float 0.000000e+00, %tmp261 ; <float> [#uses=2]
- %tmp269 = mul float %tmp252, %tmp176 ; <float> [#uses=1]
- %tmp276 = mul float %tmp259, 0.000000e+00 ; <float> [#uses=1]
- %tmp277 = add float %tmp269, %tmp276 ; <float> [#uses=2]
- %tmp281 = getelementptr float* %fz, i32 0 ; <float*> [#uses=1]
- %tmp282 = load float* %tmp281, align 4 ; <float> [#uses=2]
- %tmp284 = sub float %tmp282, %tmp277 ; <float> [#uses=1]
- %tmp291 = add float %tmp282, %tmp277 ; <float> [#uses=1]
- %tmp298 = sub float 0.000000e+00, %tmp262 ; <float> [#uses=1]
- %tmp305 = add float 0.000000e+00, %tmp262 ; <float> [#uses=1]
- %tmp315 = mul float 0.000000e+00, %tmp291 ; <float> [#uses=1]
- %tmp318 = mul float 0.000000e+00, %tmp298 ; <float> [#uses=1]
- %tmp319 = add float %tmp315, %tmp318 ; <float> [#uses=1]
- %tmp329 = add float 0.000000e+00, %tmp319 ; <float> [#uses=1]
- store float %tmp329, float* null, align 4
- %tmp336 = sub float %tmp242, 0.000000e+00 ; <float> [#uses=1]
- store float %tmp336, float* %tmp258, align 4
- %tmp343 = add float %tmp242, 0.000000e+00 ; <float> [#uses=1]
- store float %tmp343, float* null, align 4
- %tmp355 = mul float 0.000000e+00, %tmp305 ; <float> [#uses=1]
- %tmp358 = mul float 0.000000e+00, %tmp284 ; <float> [#uses=1]
- %tmp359 = add float %tmp355, %tmp358 ; <float> [#uses=1]
- %tmp369 = add float 0.000000e+00, %tmp359 ; <float> [#uses=1]
- store float %tmp369, float* %gi.1, align 4
- ret void
-
-bb431: ; preds = %entry
- ret void
-}
diff --git a/release_23/test/CodeGen/X86/2007-10-12-SpillerUnfold2.ll b/release_23/test/CodeGen/X86/2007-10-12-SpillerUnfold2.ll
deleted file mode 100644
index 3016a013f2c9..000000000000
--- a/release_23/test/CodeGen/X86/2007-10-12-SpillerUnfold2.ll
+++ /dev/null
@@ -1,57 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 | grep sarl | not grep esp
-
-define i16 @t(i16* %qmatrix, i16* %dct, i16* %acBaseTable, i16* %acExtTable, i16 signext %acBaseRes, i16 signext %acMaskRes, i16 signext %acExtRes, i32* %bitptr, i32* %source, i32 %markerPrefix, i8** %byteptr, i32 %scale, i32 %round, i32 %bits) signext {
-entry:
- br label %cond_next127
-
-cond_next127: ; preds = %cond_next391, %entry
- %tmp151 = add i32 0, %round ; <i32> [#uses=1]
- %tmp153 = ashr i32 %tmp151, %scale ; <i32> [#uses=1]
- %tmp158 = xor i32 0, %tmp153 ; <i32> [#uses=1]
- %tmp160 = or i32 %tmp158, 0 ; <i32> [#uses=1]
- %tmp180181 = sext i16 0 to i32 ; <i32> [#uses=1]
- %tmp183 = add i32 %tmp160, 1 ; <i32> [#uses=1]
- br i1 false, label %cond_true188, label %cond_next245
-
-cond_true188: ; preds = %cond_next127
- ret i16 0
-
-cond_next245: ; preds = %cond_next127
- %tmp253444 = lshr i32 %tmp180181, 4 ; <i32> [#uses=1]
- %tmp254 = and i32 %tmp253444, 15 ; <i32> [#uses=1]
- br i1 false, label %cond_true267, label %cond_next391
-
-cond_true267: ; preds = %cond_next245
- %tmp269 = load i8** %byteptr, align 4 ; <i8*> [#uses=3]
- %tmp270 = load i8* %tmp269, align 1 ; <i8> [#uses=1]
- %tmp270271 = zext i8 %tmp270 to i32 ; <i32> [#uses=1]
- %tmp272 = getelementptr i8* %tmp269, i32 1 ; <i8*> [#uses=2]
- store i8* %tmp272, i8** %byteptr, align 4
- %tmp276 = load i8* %tmp272, align 1 ; <i8> [#uses=1]
- %tmp278 = getelementptr i8* %tmp269, i32 2 ; <i8*> [#uses=1]
- store i8* %tmp278, i8** %byteptr, align 4
- %tmp286 = icmp eq i32 %tmp270271, %markerPrefix ; <i1> [#uses=1]
- %cond = icmp eq i8 %tmp276, 0 ; <i1> [#uses=1]
- %bothcond = and i1 %tmp286, %cond ; <i1> [#uses=1]
- br i1 %bothcond, label %cond_true294, label %cond_next327
-
-cond_true294: ; preds = %cond_true267
- ret i16 0
-
-cond_next327: ; preds = %cond_true267
- br i1 false, label %cond_true343, label %cond_next391
-
-cond_true343: ; preds = %cond_next327
- %tmp345 = load i8** %byteptr, align 4 ; <i8*> [#uses=1]
- store i8* null, i8** %byteptr, align 4
- store i8* %tmp345, i8** %byteptr, align 4
- br label %cond_next391
-
-cond_next391: ; preds = %cond_true343, %cond_next327, %cond_next245
- %tmp422445 = add i32 %tmp254, %tmp183 ; <i32> [#uses=1]
- %tmp429448 = icmp ult i32 %tmp422445, 63 ; <i1> [#uses=1]
- br i1 %tmp429448, label %cond_next127, label %UnifiedReturnBlock
-
-UnifiedReturnBlock: ; preds = %cond_next391
- ret i16 0
-}
diff --git a/release_23/test/CodeGen/X86/2007-10-14-CoalescerCrash.ll b/release_23/test/CodeGen/X86/2007-10-14-CoalescerCrash.ll
deleted file mode 100644
index 6cac558e427d..000000000000
--- a/release_23/test/CodeGen/X86/2007-10-14-CoalescerCrash.ll
+++ /dev/null
@@ -1,28 +0,0 @@
-; RUN: llvm-as < %s | llc -mtriple=x86_64-apple-darwin
-
- %struct._Unwind_Context = type { }
-
-define i32 @execute_stack_op(i8* %op_ptr, i8* %op_end, %struct._Unwind_Context* %context, i64 %initial) {
-entry:
- br i1 false, label %bb, label %return
-
-bb: ; preds = %bb31, %entry
- br i1 false, label %bb6, label %bb31
-
-bb6: ; preds = %bb
- %tmp10 = load i64* null, align 8 ; <i64> [#uses=1]
- %tmp16 = load i64* null, align 8 ; <i64> [#uses=1]
- br i1 false, label %bb23, label %bb31
-
-bb23: ; preds = %bb6
- %tmp2526.cast = and i64 %tmp16, 4294967295 ; <i64> [#uses=1]
- %tmp27 = ashr i64 %tmp10, %tmp2526.cast ; <i64> [#uses=1]
- br label %bb31
-
-bb31: ; preds = %bb23, %bb6, %bb
- %result.0 = phi i64 [ %tmp27, %bb23 ], [ 0, %bb ], [ 0, %bb6 ] ; <i64> [#uses=0]
- br i1 false, label %bb, label %return
-
-return: ; preds = %bb31, %entry
- ret i32 undef
-}
diff --git a/release_23/test/CodeGen/X86/2007-10-15-CoalescerCrash.ll b/release_23/test/CodeGen/X86/2007-10-15-CoalescerCrash.ll
deleted file mode 100644
index 4ea42440e1e2..000000000000
--- a/release_23/test/CodeGen/X86/2007-10-15-CoalescerCrash.ll
+++ /dev/null
@@ -1,400 +0,0 @@
-; RUN: llvm-as < %s | llc -mtriple=x86_64-linux-gnu
-; PR1729
-
- %struct.CUMULATIVE_ARGS = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 }
- %struct.VEC_edge = type { i32, i32, [1 x %struct.edge_def*] }
- %struct.VEC_tree = type { i32, i32, [1 x %struct.tree_node*] }
- %struct._IO_FILE = type { i32, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, %struct._IO_marker*, %struct._IO_FILE*, i32, i32, i64, i16, i8, [1 x i8], i8*, i64, i8*, i8*, i8*, i8*, i64, i32, [20 x i8] }
- %struct._IO_marker = type { %struct._IO_marker*, %struct._IO_FILE*, i32 }
- %struct._obstack_chunk = type { i8*, %struct._obstack_chunk*, [4 x i8] }
- %struct.addr_diff_vec_flags = type <{ i8, i8, i8, i8 }>
- %struct.alloc_pool_def = type { i8*, i64, i64, %struct.alloc_pool_list_def*, i64, i64, i64, %struct.alloc_pool_list_def*, i64, i64 }
- %struct.alloc_pool_list_def = type { %struct.alloc_pool_list_def* }
- %struct.basic_block_def = type { %struct.rtx_def*, %struct.rtx_def*, %struct.tree_node*, %struct.VEC_edge*, %struct.VEC_edge*, %struct.bitmap_head_def*, %struct.bitmap_head_def*, i8*, %struct.loop*, [2 x %struct.et_node*], %struct.basic_block_def*, %struct.basic_block_def*, %struct.reorder_block_def*, %struct.bb_ann_d*, i64, i32, i32, i32, i32 }
- %struct.bb_ann_d = type opaque
- %struct.bitmap_element_def = type { %struct.bitmap_element_def*, %struct.bitmap_element_def*, i32, [2 x i64] }
- %struct.bitmap_head_def = type { %struct.bitmap_element_def*, %struct.bitmap_element_def*, i32, %struct.bitmap_obstack* }
- %struct.bitmap_obstack = type { %struct.bitmap_element_def*, %struct.bitmap_head_def*, %struct.obstack }
- %struct.cselib_val_struct = type opaque
- %struct.dataflow_d = type opaque
- %struct.die_struct = type opaque
- %struct.edge_def = type { %struct.basic_block_def*, %struct.basic_block_def*, %struct.edge_def_insns, i8*, %struct.location_t*, i32, i32, i64, i32 }
- %struct.edge_def_insns = type { %struct.rtx_def* }
- %struct.edge_iterator = type { i32, %struct.VEC_edge** }
- %struct.eh_status = type opaque
- %struct.elt_list = type opaque
- %struct.emit_status = type { i32, i32, %struct.rtx_def*, %struct.rtx_def*, %struct.sequence_stack*, i32, %struct.location_t, i32, i8*, %struct.rtx_def** }
- %struct.et_node = type opaque
- %struct.expr_status = type { i32, i32, i32, %struct.rtx_def*, %struct.rtx_def*, %struct.rtx_def* }
- %struct.function = type { %struct.eh_status*, %struct.expr_status*, %struct.emit_status*, %struct.varasm_status*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.function*, i32, i32, i32, i32, %struct.rtx_def*, %struct.CUMULATIVE_ARGS, %struct.rtx_def*, %struct.rtx_def*, %struct.initial_value_struct*, %struct.rtx_def*, %struct.rtx_def*, %struct.rtx_def*, %struct.rtx_def*, %struct.rtx_def*, %struct.rtx_def*, i8, i32, i64, %struct.tree_node*, %struct.tree_node*, %struct.rtx_def*, %struct.varray_head_tag*, %struct.temp_slot*, i32, %struct.var_refs_queue*, i32, i32, %struct.rtvec_def*, %struct.tree_node*, i32, i32, i32, %struct.machine_function*, i32, i32, i8, i8, %struct.language_function*, %struct.rtx_def*, i32, i32, i32, i32, %struct.location_t, %struct.varray_head_tag*, %struct.tree_node*, %struct.tree_node*, i8, i8, i8 }
- %struct.ht_identifier = type { i8*, i32, i32 }
- %struct.initial_value_struct = type opaque
- %struct.lang_decl = type opaque
- %struct.lang_type = type opaque
- %struct.language_function = type opaque
- %struct.location_t = type { i8*, i32 }
- %struct.loop = type opaque
- %struct.machine_function = type { %struct.stack_local_entry*, i8*, %struct.rtx_def*, i32, i32, i32, i32, i32 }
- %struct.mem_attrs = type { i64, %struct.tree_node*, %struct.rtx_def*, %struct.rtx_def*, i32 }
- %struct.obstack = type { i64, %struct._obstack_chunk*, i8*, i8*, i8*, i64, i32, %struct._obstack_chunk* (i8*, i64)*, void (i8*, %struct._obstack_chunk*)*, i8*, i8 }
- %struct.phi_arg_d = type { %struct.tree_node*, i8 }
- %struct.ptr_info_def = type opaque
- %struct.real_value = type opaque
- %struct.reg_attrs = type { %struct.tree_node*, i64 }
- %struct.reg_info_def = type { i32, i32, i32, i32, i32, i32, i32, i32, i32 }
- %struct.reorder_block_def = type { %struct.rtx_def*, %struct.rtx_def*, %struct.basic_block_def*, %struct.basic_block_def*, %struct.basic_block_def*, i32, i32, i32 }
- %struct.rtunion = type { i8* }
- %struct.rtvec_def = type { i32, [1 x %struct.rtx_def*] }
- %struct.rtx_def = type { i16, i8, i8, %struct.u }
- %struct.sequence_stack = type { %struct.rtx_def*, %struct.rtx_def*, %struct.sequence_stack* }
- %struct.simple_bitmap_def = type { i32, i32, i32, [1 x i64] }
- %struct.stack_local_entry = type opaque
- %struct.temp_slot = type opaque
- %struct.tree_binfo = type { %struct.tree_common, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.VEC_tree*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.VEC_tree }
- %struct.tree_block = type { %struct.tree_common, i32, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node* }
- %struct.tree_common = type { %struct.tree_node*, %struct.tree_node*, %union.tree_ann_d*, i8, i8, i8, i8, i8 }
- %struct.tree_complex = type { %struct.tree_common, %struct.tree_node*, %struct.tree_node* }
- %struct.tree_decl = type { %struct.tree_common, %struct.location_t, i32, %struct.tree_node*, i8, i8, i8, i8, i8, i8, i8, i8, i32, %struct.tree_decl_u1, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.rtx_def*, i32, %struct.tree_decl_u2, %struct.tree_node*, %struct.tree_node*, i64, %struct.lang_decl* }
- %struct.tree_decl_u1 = type { i64 }
- %struct.tree_decl_u1_a = type <{ i32 }>
- %struct.tree_decl_u2 = type { %struct.function* }
- %struct.tree_exp = type { %struct.tree_common, %struct.location_t*, i32, %struct.tree_node*, [1 x %struct.tree_node*] }
- %struct.tree_identifier = type { %struct.tree_common, %struct.ht_identifier }
- %struct.tree_int_cst = type { %struct.tree_common, %struct.tree_int_cst_lowhi }
- %struct.tree_int_cst_lowhi = type { i64, i64 }
- %struct.tree_list = type { %struct.tree_common, %struct.tree_node*, %struct.tree_node* }
- %struct.tree_node = type { %struct.tree_decl }
- %struct.tree_phi_node = type { %struct.tree_common, %struct.tree_node*, i32, i32, i32, %struct.basic_block_def*, %struct.dataflow_d*, [1 x %struct.phi_arg_d] }
- %struct.tree_real_cst = type { %struct.tree_common, %struct.real_value* }
- %struct.tree_ssa_name = type { %struct.tree_common, %struct.tree_node*, i32, %struct.ptr_info_def*, %struct.tree_node*, i8* }
- %struct.tree_statement_list = type { %struct.tree_common, %struct.tree_statement_list_node*, %struct.tree_statement_list_node* }
- %struct.tree_statement_list_node = type { %struct.tree_statement_list_node*, %struct.tree_statement_list_node*, %struct.tree_node* }
- %struct.tree_string = type { %struct.tree_common, i32, [1 x i8] }
- %struct.tree_type = type { %struct.tree_common, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, i32, i16, i8, i8, i32, %struct.tree_node*, %struct.tree_node*, %struct.rtunion, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, i64, %struct.lang_type* }
- %struct.tree_type_symtab = type { i8* }
- %struct.tree_value_handle = type { %struct.tree_common, %struct.value_set*, i32 }
- %struct.tree_vec = type { %struct.tree_common, i32, [1 x %struct.tree_node*] }
- %struct.tree_vector = type { %struct.tree_common, %struct.tree_node* }
- %struct.u = type { [1 x %struct.rtunion] }
- %struct.value_set = type opaque
- %struct.var_refs_queue = type { %struct.rtx_def*, i32, i32, %struct.var_refs_queue* }
- %struct.varasm_status = type opaque
- %struct.varray_data = type { [1 x i64] }
- %struct.varray_head_tag = type { i64, i64, i32, i8*, %struct.varray_data }
- %union.tree_ann_d = type opaque
-@first_edge_aux_obj = external global i8* ; <i8**> [#uses=0]
-@first_block_aux_obj = external global i8* ; <i8**> [#uses=0]
-@n_edges = external global i32 ; <i32*> [#uses=0]
-@ENTRY_BLOCK_PTR = external global %struct.basic_block_def* ; <%struct.basic_block_def**> [#uses=0]
-@EXIT_BLOCK_PTR = external global %struct.basic_block_def* ; <%struct.basic_block_def**> [#uses=0]
-@n_basic_blocks = external global i32 ; <i32*> [#uses=0]
-@.str = external constant [9 x i8] ; <[9 x i8]*> [#uses=0]
-@rbi_pool = external global %struct.alloc_pool_def* ; <%struct.alloc_pool_def**> [#uses=0]
-@__FUNCTION__.19643 = external constant [18 x i8] ; <[18 x i8]*> [#uses=0]
-@.str1 = external constant [20 x i8] ; <[20 x i8]*> [#uses=0]
-@__FUNCTION__.19670 = external constant [15 x i8] ; <[15 x i8]*> [#uses=0]
-@basic_block_info = external global %struct.varray_head_tag* ; <%struct.varray_head_tag**> [#uses=0]
-@last_basic_block = external global i32 ; <i32*> [#uses=0]
-@__FUNCTION__.19696 = external constant [14 x i8] ; <[14 x i8]*> [#uses=0]
-@__FUNCTION__.20191 = external constant [20 x i8] ; <[20 x i8]*> [#uses=0]
-@block_aux_obstack = external global %struct.obstack ; <%struct.obstack*> [#uses=0]
-@__FUNCTION__.20301 = external constant [20 x i8] ; <[20 x i8]*> [#uses=0]
-@__FUNCTION__.20316 = external constant [19 x i8] ; <[19 x i8]*> [#uses=0]
-@edge_aux_obstack = external global %struct.obstack ; <%struct.obstack*> [#uses=0]
-@stderr = external global %struct._IO_FILE* ; <%struct._IO_FILE**> [#uses=0]
-@__FUNCTION__.20463 = external constant [11 x i8] ; <[11 x i8]*> [#uses=0]
-@.str2 = external constant [7 x i8] ; <[7 x i8]*> [#uses=0]
-@.str3 = external constant [6 x i8] ; <[6 x i8]*> [#uses=0]
-@.str4 = external constant [4 x i8] ; <[4 x i8]*> [#uses=0]
-@.str5 = external constant [11 x i8] ; <[11 x i8]*> [#uses=0]
-@.str6 = external constant [8 x i8] ; <[8 x i8]*> [#uses=0]
-@.str7 = external constant [4 x i8] ; <[4 x i8]*> [#uses=0]
-@bitnames.20157 = external constant [13 x i8*] ; <[13 x i8*]*> [#uses=0]
-@.str8 = external constant [9 x i8] ; <[9 x i8]*> [#uses=0]
-@.str9 = external constant [3 x i8] ; <[3 x i8]*> [#uses=0]
-@.str10 = external constant [7 x i8] ; <[7 x i8]*> [#uses=0]
-@.str11 = external constant [3 x i8] ; <[3 x i8]*> [#uses=0]
-@.str12 = external constant [5 x i8] ; <[5 x i8]*> [#uses=0]
-@.str13 = external constant [9 x i8] ; <[9 x i8]*> [#uses=0]
-@.str14 = external constant [13 x i8] ; <[13 x i8]*> [#uses=0]
-@.str15 = external constant [12 x i8] ; <[12 x i8]*> [#uses=0]
-@.str16 = external constant [8 x i8] ; <[8 x i8]*> [#uses=0]
-@.str17 = external constant [10 x i8] ; <[10 x i8]*> [#uses=0]
-@.str18 = external constant [5 x i8] ; <[5 x i8]*> [#uses=0]
-@.str19 = external constant [6 x i8] ; <[6 x i8]*> [#uses=0]
-@.str20 = external constant [5 x i8] ; <[5 x i8]*> [#uses=0]
-@.str21 = external constant [3 x i8] ; <[3 x i8]*> [#uses=0]
-@.str22 = external constant [3 x i8] ; <[3 x i8]*> [#uses=0]
-@__FUNCTION__.19709 = external constant [20 x i8] ; <[20 x i8]*> [#uses=0]
-@.str23 = external constant [5 x i8] ; <[5 x i8]*> [#uses=0]
-@.str24 = external constant [10 x i8] ; <[10 x i8]*> [#uses=0]
-@__FUNCTION__.19813 = external constant [19 x i8] ; <[19 x i8]*> [#uses=0]
-@.str25 = external constant [7 x i8] ; <[7 x i8]*> [#uses=0]
-@.str26 = external constant [6 x i8] ; <[6 x i8]*> [#uses=0]
-@initialized.20241.b = external global i1 ; <i1*> [#uses=0]
-@__FUNCTION__.20244 = external constant [21 x i8] ; <[21 x i8]*> [#uses=0]
-@__FUNCTION__.19601 = external constant [12 x i8] ; <[12 x i8]*> [#uses=0]
-@__FUNCTION__.14571 = external constant [8 x i8] ; <[8 x i8]*> [#uses=0]
-@__FUNCTION__.14535 = external constant [13 x i8] ; <[13 x i8]*> [#uses=0]
-@.str27 = external constant [28 x i8] ; <[28 x i8]*> [#uses=0]
-@__FUNCTION__.14589 = external constant [8 x i8] ; <[8 x i8]*> [#uses=0]
-@__FUNCTION__.19792 = external constant [12 x i8] ; <[12 x i8]*> [#uses=0]
-@__FUNCTION__.19851 = external constant [19 x i8] ; <[19 x i8]*> [#uses=0]
-@profile_status = external global i32 ; <i32*> [#uses=0]
-@.str29 = external constant [46 x i8] ; <[46 x i8]*> [#uses=0]
-@.str30 = external constant [49 x i8] ; <[49 x i8]*> [#uses=0]
-@.str31 = external constant [54 x i8] ; <[54 x i8]*> [#uses=0]
-@.str32 = external constant [49 x i8] ; <[49 x i8]*> [#uses=1]
-@__FUNCTION__.19948 = external constant [15 x i8] ; <[15 x i8]*> [#uses=0]
-@reg_n_info = external global %struct.varray_head_tag* ; <%struct.varray_head_tag**> [#uses=0]
-@reload_completed = external global i32 ; <i32*> [#uses=0]
-@.str33 = external constant [15 x i8] ; <[15 x i8]*> [#uses=0]
-@.str34 = external constant [43 x i8] ; <[43 x i8]*> [#uses=0]
-@.str35 = external constant [13 x i8] ; <[13 x i8]*> [#uses=0]
-@.str36 = external constant [1 x i8] ; <[1 x i8]*> [#uses=0]
-@.str37 = external constant [2 x i8] ; <[2 x i8]*> [#uses=0]
-@.str38 = external constant [16 x i8] ; <[16 x i8]*> [#uses=0]
-@cfun = external global %struct.function* ; <%struct.function**> [#uses=0]
-@.str39 = external constant [14 x i8] ; <[14 x i8]*> [#uses=0]
-@.str40 = external constant [11 x i8] ; <[11 x i8]*> [#uses=0]
-@.str41 = external constant [20 x i8] ; <[20 x i8]*> [#uses=0]
-@.str42 = external constant [17 x i8] ; <[17 x i8]*> [#uses=0]
-@.str43 = external constant [19 x i8] ; <[19 x i8]*> [#uses=0]
-@mode_size = external global [48 x i8] ; <[48 x i8]*> [#uses=0]
-@target_flags = external global i32 ; <i32*> [#uses=0]
-@.str44 = external constant [11 x i8] ; <[11 x i8]*> [#uses=0]
-@reg_class_names = external global [0 x i8*] ; <[0 x i8*]*> [#uses=0]
-@.str45 = external constant [10 x i8] ; <[10 x i8]*> [#uses=0]
-@.str46 = external constant [13 x i8] ; <[13 x i8]*> [#uses=0]
-@.str47 = external constant [19 x i8] ; <[19 x i8]*> [#uses=0]
-@.str48 = external constant [12 x i8] ; <[12 x i8]*> [#uses=0]
-@.str49 = external constant [10 x i8] ; <[10 x i8]*> [#uses=0]
-@.str50 = external constant [3 x i8] ; <[3 x i8]*> [#uses=0]
-@.str51 = external constant [29 x i8] ; <[29 x i8]*> [#uses=0]
-@.str52 = external constant [17 x i8] ; <[17 x i8]*> [#uses=0]
-@.str53 = external constant [19 x i8] ; <[19 x i8]*> [#uses=0]
-@.str54 = external constant [22 x i8] ; <[22 x i8]*> [#uses=0]
-@.str55 = external constant [10 x i8] ; <[10 x i8]*> [#uses=0]
-@.str56 = external constant [12 x i8] ; <[12 x i8]*> [#uses=0]
-@.str57 = external constant [26 x i8] ; <[26 x i8]*> [#uses=0]
-@.str58 = external constant [15 x i8] ; <[15 x i8]*> [#uses=0]
-@.str59 = external constant [14 x i8] ; <[14 x i8]*> [#uses=0]
-@.str60 = external constant [26 x i8] ; <[26 x i8]*> [#uses=0]
-@.str61 = external constant [24 x i8] ; <[24 x i8]*> [#uses=0]
-@initialized.20366.b = external global i1 ; <i1*> [#uses=0]
-@__FUNCTION__.20369 = external constant [20 x i8] ; <[20 x i8]*> [#uses=0]
-@__FUNCTION__.20442 = external constant [19 x i8] ; <[19 x i8]*> [#uses=0]
-@bb_bitnames.20476 = external constant [6 x i8*] ; <[6 x i8*]*> [#uses=0]
-@.str62 = external constant [6 x i8] ; <[6 x i8]*> [#uses=0]
-@.str63 = external constant [4 x i8] ; <[4 x i8]*> [#uses=0]
-@.str64 = external constant [10 x i8] ; <[10 x i8]*> [#uses=0]
-@.str65 = external constant [8 x i8] ; <[8 x i8]*> [#uses=0]
-@.str66 = external constant [17 x i8] ; <[17 x i8]*> [#uses=0]
-@.str67 = external constant [11 x i8] ; <[11 x i8]*> [#uses=0]
-@.str68 = external constant [15 x i8] ; <[15 x i8]*> [#uses=0]
-@.str69 = external constant [3 x i8] ; <[3 x i8]*> [#uses=0]
-@.str70 = external constant [3 x i8] ; <[3 x i8]*> [#uses=0]
-@__FUNCTION__.20520 = external constant [32 x i8] ; <[32 x i8]*> [#uses=0]
-@dump_file = external global %struct._IO_FILE* ; <%struct._IO_FILE**> [#uses=0]
-@.str71 = external constant [86 x i8] ; <[86 x i8]*> [#uses=0]
-@.str72 = external constant [94 x i8] ; <[94 x i8]*> [#uses=0]
-@reg_obstack = external global %struct.bitmap_obstack ; <%struct.bitmap_obstack*> [#uses=0]
-
-declare void @init_flow()
-
-declare i8* @ggc_alloc_cleared_stat(i64)
-
-declare fastcc void @free_edge(%struct.edge_def*)
-
-declare void @ggc_free(i8*)
-
-declare %struct.basic_block_def* @alloc_block()
-
-declare void @alloc_rbi_pool()
-
-declare %struct.alloc_pool_def* @create_alloc_pool(i8*, i64, i64)
-
-declare void @free_rbi_pool()
-
-declare void @free_alloc_pool(%struct.alloc_pool_def*)
-
-declare void @initialize_bb_rbi(%struct.basic_block_def*)
-
-declare void @fancy_abort(i8*, i32, i8*)
-
-declare i8* @pool_alloc(%struct.alloc_pool_def*)
-
-declare void @llvm.memset.i64(i8*, i8, i64, i32)
-
-declare void @link_block(%struct.basic_block_def*, %struct.basic_block_def*)
-
-declare void @unlink_block(%struct.basic_block_def*)
-
-declare void @compact_blocks()
-
-declare void @varray_check_failed(%struct.varray_head_tag*, i64, i8*, i32, i8*)
-
-declare void @expunge_block(%struct.basic_block_def*)
-
-declare void @clear_bb_flags()
-
-declare void @alloc_aux_for_block(%struct.basic_block_def*, i32)
-
-declare void @_obstack_newchunk(%struct.obstack*, i32)
-
-declare void @clear_aux_for_blocks()
-
-declare void @free_aux_for_blocks()
-
-declare void @obstack_free(%struct.obstack*, i8*)
-
-declare void @alloc_aux_for_edge(%struct.edge_def*, i32)
-
-declare void @debug_bb(%struct.basic_block_def*)
-
-declare void @dump_bb(%struct.basic_block_def*, %struct._IO_FILE*, i32)
-
-declare %struct.basic_block_def* @debug_bb_n(i32)
-
-declare void @dump_edge_info(%struct._IO_FILE*, %struct.edge_def*, i32)
-
-declare i32 @fputs_unlocked(i8* noalias , %struct._IO_FILE* noalias )
-
-declare i32 @fprintf(%struct._IO_FILE* noalias , i8* noalias , ...)
-
-declare i64 @fwrite(i8*, i64, i64, i8*)
-
-declare i32 @__overflow(%struct._IO_FILE*, i32)
-
-declare %struct.edge_def* @unchecked_make_edge(%struct.basic_block_def*, %struct.basic_block_def*, i32)
-
-declare i8* @vec_gc_p_reserve(i8*, i32)
-
-declare void @vec_assert_fail(i8*, i8*, i8*, i32, i8*)
-
-declare void @execute_on_growing_pred(%struct.edge_def*)
-
-declare %struct.edge_def* @make_edge(%struct.basic_block_def*, %struct.basic_block_def*, i32)
-
-declare %struct.edge_def* @find_edge(%struct.basic_block_def*, %struct.basic_block_def*)
-
-declare %struct.edge_def* @make_single_succ_edge(%struct.basic_block_def*, %struct.basic_block_def*, i32)
-
-declare %struct.edge_def* @cached_make_edge(%struct.simple_bitmap_def**, %struct.basic_block_def*, %struct.basic_block_def*, i32)
-
-declare void @redirect_edge_succ(%struct.edge_def*, %struct.basic_block_def*)
-
-declare void @execute_on_shrinking_pred(%struct.edge_def*)
-
-declare void @alloc_aux_for_blocks(i32)
-
-declare i8* @xmalloc(i64)
-
-declare i32 @_obstack_begin(%struct.obstack*, i32, i32, i8* (i64)*, void (i8*)*)
-
-declare void @free(i8*)
-
-declare void @clear_edges()
-
-declare void @remove_edge(%struct.edge_def*)
-
-declare %struct.edge_def* @redirect_edge_succ_nodup(%struct.edge_def*, %struct.basic_block_def*)
-
-declare void @redirect_edge_pred(%struct.edge_def*, %struct.basic_block_def*)
-
-define void @check_bb_profile(%struct.basic_block_def* %bb, %struct._IO_FILE* %file) {
-entry:
- br i1 false, label %cond_false759.preheader, label %cond_false149.preheader
-
-cond_false149.preheader: ; preds = %entry
- ret void
-
-cond_false759.preheader: ; preds = %entry
- br i1 false, label %cond_next873, label %cond_true794
-
-bb644: ; preds = %cond_next873
- ret void
-
-cond_true794: ; preds = %cond_false759.preheader
- ret void
-
-cond_next873: ; preds = %cond_false759.preheader
- br i1 false, label %bb882, label %bb644
-
-bb882: ; preds = %cond_next873
- br i1 false, label %cond_true893, label %cond_next901
-
-cond_true893: ; preds = %bb882
- br label %cond_false1036
-
-cond_next901: ; preds = %bb882
- ret void
-
-bb929: ; preds = %cond_next1150
- %tmp934 = add i64 0, %lsum.11225.0 ; <i64> [#uses=1]
- br i1 false, label %cond_next979, label %cond_true974
-
-cond_true974: ; preds = %bb929
- ret void
-
-cond_next979: ; preds = %bb929
- br label %cond_false1036
-
-cond_false1036: ; preds = %cond_next979, %cond_true893
- %lsum.11225.0 = phi i64 [ 0, %cond_true893 ], [ %tmp934, %cond_next979 ] ; <i64> [#uses=2]
- br i1 false, label %cond_next1056, label %cond_true1051
-
-cond_true1051: ; preds = %cond_false1036
- ret void
-
-cond_next1056: ; preds = %cond_false1036
- br i1 false, label %cond_next1150, label %cond_true1071
-
-cond_true1071: ; preds = %cond_next1056
- ret void
-
-cond_next1150: ; preds = %cond_next1056
- %tmp1156 = icmp eq %struct.edge_def* null, null ; <i1> [#uses=1]
- br i1 %tmp1156, label %bb1159, label %bb929
-
-bb1159: ; preds = %cond_next1150
- br i1 false, label %cond_true1169, label %UnifiedReturnBlock
-
-cond_true1169: ; preds = %bb1159
- %tmp11741175 = trunc i64 %lsum.11225.0 to i32 ; <i32> [#uses=1]
- %tmp1178 = tail call i32 (%struct._IO_FILE* noalias , i8* noalias , ...)* @fprintf( %struct._IO_FILE* %file noalias , i8* getelementptr ([49 x i8]* @.str32, i32 0, i64 0) noalias , i32 %tmp11741175, i32 0 ) ; <i32> [#uses=0]
- ret void
-
-UnifiedReturnBlock: ; preds = %bb1159
- ret void
-}
-
-declare void @dump_flow_info(%struct._IO_FILE*)
-
-declare i32 @max_reg_num()
-
-declare void @rtl_check_failed_flag(i8*, %struct.rtx_def*, i8*, i32, i8*)
-
-declare i32 @reg_preferred_class(i32)
-
-declare i32 @reg_alternate_class(i32)
-
-declare i8 @maybe_hot_bb_p(%struct.basic_block_def*) zeroext
-
-declare i8 @probably_never_executed_bb_p(%struct.basic_block_def*) zeroext
-
-declare void @dump_regset(%struct.bitmap_head_def*, %struct._IO_FILE*)
-
-declare void @debug_flow_info()
-
-declare void @alloc_aux_for_edges(i32)
-
-declare void @clear_aux_for_edges()
-
-declare void @free_aux_for_edges()
-
-declare void @brief_dump_cfg(%struct._IO_FILE*)
-
-declare i32 @fputc(i32, i8*)
-
-declare void @update_bb_profile_for_threading(%struct.basic_block_def*, i32, i64, %struct.edge_def*)
diff --git a/release_23/test/CodeGen/X86/2007-10-16-CoalescerCrash.ll b/release_23/test/CodeGen/X86/2007-10-16-CoalescerCrash.ll
deleted file mode 100644
index a414ef0d8626..000000000000
--- a/release_23/test/CodeGen/X86/2007-10-16-CoalescerCrash.ll
+++ /dev/null
@@ -1,31 +0,0 @@
-; RUN: llvm-as < %s | llc -mtriple=x86_64-apple-darwin
-
-define i64 @__ashldi3(i64 %u, i64 %b) {
-entry:
- br i1 false, label %UnifiedReturnBlock, label %cond_next
-
-cond_next: ; preds = %entry
- %tmp9 = sub i64 32, %b ; <i64> [#uses=2]
- %tmp11 = icmp slt i64 %tmp9, 1 ; <i1> [#uses=1]
- %tmp2180 = trunc i64 %u to i32 ; <i32> [#uses=2]
- %tmp2223 = trunc i64 %tmp9 to i32 ; <i32> [#uses=2]
- br i1 %tmp11, label %cond_true14, label %cond_false
-
-cond_true14: ; preds = %cond_next
- %tmp24 = sub i32 0, %tmp2223 ; <i32> [#uses=1]
- %tmp25 = shl i32 %tmp2180, %tmp24 ; <i32> [#uses=1]
- %tmp2569 = zext i32 %tmp25 to i64 ; <i64> [#uses=1]
- %tmp256970 = shl i64 %tmp2569, 32 ; <i64> [#uses=1]
- ret i64 %tmp256970
-
-cond_false: ; preds = %cond_next
- %tmp35 = lshr i32 %tmp2180, %tmp2223 ; <i32> [#uses=1]
- %tmp54 = or i32 %tmp35, 0 ; <i32> [#uses=1]
- %tmp5464 = zext i32 %tmp54 to i64 ; <i64> [#uses=1]
- %tmp546465 = shl i64 %tmp5464, 32 ; <i64> [#uses=1]
- %tmp546465.ins = or i64 %tmp546465, 0 ; <i64> [#uses=1]
- ret i64 %tmp546465.ins
-
-UnifiedReturnBlock:
- ret i64 %u
-}
diff --git a/release_23/test/CodeGen/X86/2007-10-16-IllegalAsm.ll b/release_23/test/CodeGen/X86/2007-10-16-IllegalAsm.ll
deleted file mode 100644
index 5332fa1007ed..000000000000
--- a/release_23/test/CodeGen/X86/2007-10-16-IllegalAsm.ll
+++ /dev/null
@@ -1,272 +0,0 @@
-; RUN: llvm-as < %s | llc -mtriple=x86_64-linux-gnu | grep movb | not grep x
-; PR1734
-
- %struct.CUMULATIVE_ARGS = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 }
- %struct.eh_status = type opaque
- %struct.emit_status = type { i32, i32, %struct.rtx_def*, %struct.rtx_def*, %struct.sequence_stack*, i32, %struct.location_t, i32, i8*, %struct.rtx_def** }
- %struct.expr_status = type { i32, i32, i32, %struct.rtx_def*, %struct.rtx_def*, %struct.rtx_def* }
- %struct.function = type { %struct.eh_status*, %struct.expr_status*, %struct.emit_status*, %struct.varasm_status*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.function*, i32, i32, i32, i32, %struct.rtx_def*, %struct.CUMULATIVE_ARGS, %struct.rtx_def*, %struct.rtx_def*, %struct.initial_value_struct*, %struct.rtx_def*, %struct.rtx_def*, %struct.rtx_def*, %struct.rtx_def*, %struct.rtx_def*, %struct.rtx_def*, i8, i32, i64, %struct.tree_node*, %struct.tree_node*, %struct.rtx_def*, %struct.varray_head_tag*, %struct.temp_slot*, i32, %struct.var_refs_queue*, i32, i32, %struct.rtvec_def*, %struct.tree_node*, i32, i32, i32, %struct.machine_function*, i32, i32, i8, i8, %struct.language_function*, %struct.rtx_def*, i32, i32, i32, i32, %struct.location_t, %struct.varray_head_tag*, %struct.tree_node*, %struct.tree_node*, i8, i8, i8 }
- %struct.initial_value_struct = type opaque
- %struct.lang_decl = type opaque
- %struct.lang_type = type opaque
- %struct.language_function = type opaque
- %struct.location_t = type { i8*, i32 }
- %struct.machine_function = type { %struct.stack_local_entry*, i8*, %struct.rtx_def*, i32, i32, i32, i32, i32 }
- %struct.rtunion = type { i8* }
- %struct.rtvec_def = type { i32, [1 x %struct.rtx_def*] }
- %struct.rtx_def = type { i16, i8, i8, %struct.u }
- %struct.sequence_stack = type { %struct.rtx_def*, %struct.rtx_def*, %struct.sequence_stack* }
- %struct.stack_local_entry = type opaque
- %struct.temp_slot = type opaque
- %struct.tree_common = type { %struct.tree_node*, %struct.tree_node*, %union.tree_ann_d*, i8, i8, i8, i8, i8 }
- %struct.tree_decl = type { %struct.tree_common, %struct.location_t, i32, %struct.tree_node*, i8, i8, i8, i8, i8, i8, i8, i8, i32, %struct.tree_decl_u1, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.rtx_def*, i32, %struct.tree_decl_u2, %struct.tree_node*, %struct.tree_node*, i64, %struct.lang_decl* }
- %struct.tree_decl_u1 = type { i64 }
- %struct.tree_decl_u2 = type { %struct.function* }
- %struct.tree_node = type { %struct.tree_decl }
- %struct.tree_type = type { %struct.tree_common, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, i32, i16, i8, i8, i32, %struct.tree_node*, %struct.tree_node*, %struct.rtunion, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, i64, %struct.lang_type* }
- %struct.u = type { [1 x %struct.rtunion] }
- %struct.var_refs_queue = type { %struct.rtx_def*, i32, i32, %struct.var_refs_queue* }
- %struct.varasm_status = type opaque
- %struct.varray_data = type { [1 x i64] }
- %struct.varray_head_tag = type { i64, i64, i32, i8*, %struct.varray_data }
- %union.tree_ann_d = type opaque
-@.str = external constant [28 x i8] ; <[28 x i8]*> [#uses=1]
-@tree_code_type = external constant [0 x i32] ; <[0 x i32]*> [#uses=5]
-@global_trees = external global [47 x %struct.tree_node*] ; <[47 x %struct.tree_node*]*> [#uses=1]
-@mode_size = external global [48 x i8] ; <[48 x i8]*> [#uses=1]
-@__FUNCTION__.22683 = external constant [12 x i8] ; <[12 x i8]*> [#uses=1]
-
-define void @layout_type(%struct.tree_node* %type) {
-entry:
- %tmp15 = icmp eq %struct.tree_node* %type, null ; <i1> [#uses=1]
- br i1 %tmp15, label %cond_true, label %cond_false
-
-cond_true: ; preds = %entry
- tail call void @fancy_abort( i8* getelementptr ([28 x i8]* @.str, i32 0, i64 0), i32 1713, i8* getelementptr ([12 x i8]* @__FUNCTION__.22683, i32 0, i32 0) )
- unreachable
-
-cond_false: ; preds = %entry
- %tmp19 = load %struct.tree_node** getelementptr ([47 x %struct.tree_node*]* @global_trees, i32 0, i64 0), align 8 ; <%struct.tree_node*> [#uses=1]
- %tmp21 = icmp eq %struct.tree_node* %tmp19, %type ; <i1> [#uses=1]
- br i1 %tmp21, label %UnifiedReturnBlock, label %cond_next25
-
-cond_next25: ; preds = %cond_false
- %tmp30 = getelementptr %struct.tree_node* %type, i32 0, i32 0, i32 0, i32 3 ; <i8*> [#uses=1]
- %tmp3031 = bitcast i8* %tmp30 to i32* ; <i32*> [#uses=6]
- %tmp32 = load i32* %tmp3031, align 8 ; <i32> [#uses=3]
- %tmp3435 = trunc i32 %tmp32 to i8 ; <i8> [#uses=3]
- %tmp34353637 = zext i8 %tmp3435 to i64 ; <i64> [#uses=1]
- %tmp38 = getelementptr [0 x i32]* @tree_code_type, i32 0, i64 %tmp34353637 ; <i32*> [#uses=1]
- %tmp39 = load i32* %tmp38, align 4 ; <i32> [#uses=1]
- %tmp40 = icmp eq i32 %tmp39, 2 ; <i1> [#uses=4]
- br i1 %tmp40, label %cond_next46, label %cond_true43
-
-cond_true43: ; preds = %cond_next25
- tail call void @tree_class_check_failed( %struct.tree_node* %type, i32 2, i8* getelementptr ([28 x i8]* @.str, i32 0, i64 0), i32 1719, i8* getelementptr ([12 x i8]* @__FUNCTION__.22683, i32 0, i32 0) )
- unreachable
-
-cond_next46: ; preds = %cond_next25
- %tmp4950 = bitcast %struct.tree_node* %type to %struct.tree_type* ; <%struct.tree_type*> [#uses=2]
- %tmp51 = getelementptr %struct.tree_type* %tmp4950, i32 0, i32 2 ; <%struct.tree_node**> [#uses=2]
- %tmp52 = load %struct.tree_node** %tmp51, align 8 ; <%struct.tree_node*> [#uses=1]
- %tmp53 = icmp eq %struct.tree_node* %tmp52, null ; <i1> [#uses=1]
- br i1 %tmp53, label %cond_next57, label %UnifiedReturnBlock
-
-cond_next57: ; preds = %cond_next46
- %tmp65 = and i32 %tmp32, 255 ; <i32> [#uses=1]
- switch i32 %tmp65, label %UnifiedReturnBlock [
- i32 6, label %bb140
- i32 7, label %bb69
- i32 8, label %bb140
- i32 13, label %bb478
- i32 23, label %bb
- ]
-
-bb: ; preds = %cond_next57
- tail call void @fancy_abort( i8* getelementptr ([28 x i8]* @.str, i32 0, i64 0), i32 1727, i8* getelementptr ([12 x i8]* @__FUNCTION__.22683, i32 0, i32 0) )
- unreachable
-
-bb69: ; preds = %cond_next57
- br i1 %tmp40, label %cond_next91, label %cond_true88
-
-cond_true88: ; preds = %bb69
- tail call void @tree_class_check_failed( %struct.tree_node* %type, i32 2, i8* getelementptr ([28 x i8]* @.str, i32 0, i64 0), i32 1730, i8* getelementptr ([12 x i8]* @__FUNCTION__.22683, i32 0, i32 0) )
- unreachable
-
-cond_next91: ; preds = %bb69
- %tmp96 = getelementptr %struct.tree_node* %type, i32 0, i32 0, i32 8 ; <i8*> [#uses=1]
- %tmp9697 = bitcast i8* %tmp96 to i32* ; <i32*> [#uses=2]
- %tmp98 = load i32* %tmp9697, align 8 ; <i32> [#uses=2]
- %tmp100101552 = and i32 %tmp98, 511 ; <i32> [#uses=1]
- %tmp102 = icmp eq i32 %tmp100101552, 0 ; <i1> [#uses=1]
- br i1 %tmp102, label %cond_true105, label %bb140
-
-cond_true105: ; preds = %cond_next91
- br i1 %tmp40, label %cond_next127, label %cond_true124
-
-cond_true124: ; preds = %cond_true105
- tail call void @tree_class_check_failed( %struct.tree_node* %type, i32 2, i8* getelementptr ([28 x i8]* @.str, i32 0, i64 0), i32 1731, i8* getelementptr ([12 x i8]* @__FUNCTION__.22683, i32 0, i32 0) )
- unreachable
-
-cond_next127: ; preds = %cond_true105
- %tmp136 = or i32 %tmp98, 1 ; <i32> [#uses=1]
- %tmp137 = and i32 %tmp136, -511 ; <i32> [#uses=1]
- store i32 %tmp137, i32* %tmp9697, align 8
- br label %bb140
-
-bb140: ; preds = %cond_next127, %cond_next91, %cond_next57, %cond_next57
- switch i8 %tmp3435, label %cond_true202 [
- i8 6, label %cond_next208
- i8 9, label %cond_next208
- i8 7, label %cond_next208
- i8 8, label %cond_next208
- i8 10, label %cond_next208
- ]
-
-cond_true202: ; preds = %bb140
- tail call void (%struct.tree_node*, i8*, i32, i8*, ...)* @tree_check_failed( %struct.tree_node* %type, i8* getelementptr ([28 x i8]* @.str, i32 0, i64 0), i32 1738, i8* getelementptr ([12 x i8]* @__FUNCTION__.22683, i32 0, i32 0), i32 9, i32 6, i32 7, i32 8, i32 10, i32 0 )
- unreachable
-
-cond_next208: ; preds = %bb140, %bb140, %bb140, %bb140, %bb140
- %tmp213 = getelementptr %struct.tree_type* %tmp4950, i32 0, i32 14 ; <%struct.tree_node**> [#uses=1]
- %tmp214 = load %struct.tree_node** %tmp213, align 8 ; <%struct.tree_node*> [#uses=2]
- %tmp217 = getelementptr %struct.tree_node* %tmp214, i32 0, i32 0, i32 0, i32 3 ; <i8*> [#uses=1]
- %tmp217218 = bitcast i8* %tmp217 to i32* ; <i32*> [#uses=1]
- %tmp219 = load i32* %tmp217218, align 8 ; <i32> [#uses=1]
- %tmp221222 = trunc i32 %tmp219 to i8 ; <i8> [#uses=1]
- %tmp223 = icmp eq i8 %tmp221222, 24 ; <i1> [#uses=1]
- br i1 %tmp223, label %cond_true226, label %cond_next340
-
-cond_true226: ; preds = %cond_next208
- switch i8 %tmp3435, label %cond_true288 [
- i8 6, label %cond_next294
- i8 9, label %cond_next294
- i8 7, label %cond_next294
- i8 8, label %cond_next294
- i8 10, label %cond_next294
- ]
-
-cond_true288: ; preds = %cond_true226
- tail call void (%struct.tree_node*, i8*, i32, i8*, ...)* @tree_check_failed( %struct.tree_node* %type, i8* getelementptr ([28 x i8]* @.str, i32 0, i64 0), i32 1739, i8* getelementptr ([12 x i8]* @__FUNCTION__.22683, i32 0, i32 0), i32 9, i32 6, i32 7, i32 8, i32 10, i32 0 )
- unreachable
-
-cond_next294: ; preds = %cond_true226, %cond_true226, %cond_true226, %cond_true226, %cond_true226
- %tmp301 = tail call i32 @tree_int_cst_sgn( %struct.tree_node* %tmp214 ) ; <i32> [#uses=1]
- %tmp302 = icmp sgt i32 %tmp301, -1 ; <i1> [#uses=1]
- br i1 %tmp302, label %cond_true305, label %cond_next340
-
-cond_true305: ; preds = %cond_next294
- %tmp313 = load i32* %tmp3031, align 8 ; <i32> [#uses=2]
- %tmp315316 = trunc i32 %tmp313 to i8 ; <i8> [#uses=1]
- %tmp315316317318 = zext i8 %tmp315316 to i64 ; <i64> [#uses=1]
- %tmp319 = getelementptr [0 x i32]* @tree_code_type, i32 0, i64 %tmp315316317318 ; <i32*> [#uses=1]
- %tmp320 = load i32* %tmp319, align 4 ; <i32> [#uses=1]
- %tmp321 = icmp eq i32 %tmp320, 2 ; <i1> [#uses=1]
- br i1 %tmp321, label %cond_next327, label %cond_true324
-
-cond_true324: ; preds = %cond_true305
- tail call void @tree_class_check_failed( %struct.tree_node* %type, i32 2, i8* getelementptr ([28 x i8]* @.str, i32 0, i64 0), i32 1740, i8* getelementptr ([12 x i8]* @__FUNCTION__.22683, i32 0, i32 0) )
- unreachable
-
-cond_next327: ; preds = %cond_true305
- %tmp338 = or i32 %tmp313, 8192 ; <i32> [#uses=1]
- store i32 %tmp338, i32* %tmp3031, align 8
- br label %cond_next340
-
-cond_next340: ; preds = %cond_next327, %cond_next294, %cond_next208
- %tmp348 = load i32* %tmp3031, align 8 ; <i32> [#uses=1]
- %tmp350351 = trunc i32 %tmp348 to i8 ; <i8> [#uses=1]
- %tmp350351352353 = zext i8 %tmp350351 to i64 ; <i64> [#uses=1]
- %tmp354 = getelementptr [0 x i32]* @tree_code_type, i32 0, i64 %tmp350351352353 ; <i32*> [#uses=1]
- %tmp355 = load i32* %tmp354, align 4 ; <i32> [#uses=1]
- %tmp356 = icmp eq i32 %tmp355, 2 ; <i1> [#uses=1]
- br i1 %tmp356, label %cond_next385, label %cond_true359
-
-cond_true359: ; preds = %cond_next340
- tail call void @tree_class_check_failed( %struct.tree_node* %type, i32 2, i8* getelementptr ([28 x i8]* @.str, i32 0, i64 0), i32 1742, i8* getelementptr ([12 x i8]* @__FUNCTION__.22683, i32 0, i32 0) )
- unreachable
-
-cond_next385: ; preds = %cond_next340
- %tmp390 = getelementptr %struct.tree_node* %type, i32 0, i32 0, i32 8 ; <i8*> [#uses=1]
- %tmp390391 = bitcast i8* %tmp390 to i32* ; <i32*> [#uses=3]
- %tmp392 = load i32* %tmp390391, align 8 ; <i32> [#uses=1]
- %tmp394 = and i32 %tmp392, 511 ; <i32> [#uses=1]
- %tmp397 = tail call i32 @smallest_mode_for_size( i32 %tmp394, i32 2 ) ; <i32> [#uses=1]
- %tmp404 = load i32* %tmp390391, align 8 ; <i32> [#uses=1]
- %tmp397398405 = shl i32 %tmp397, 9 ; <i32> [#uses=1]
- %tmp407 = and i32 %tmp397398405, 65024 ; <i32> [#uses=1]
- %tmp408 = and i32 %tmp404, -65025 ; <i32> [#uses=1]
- %tmp409 = or i32 %tmp408, %tmp407 ; <i32> [#uses=2]
- store i32 %tmp409, i32* %tmp390391, align 8
- %tmp417 = load i32* %tmp3031, align 8 ; <i32> [#uses=1]
- %tmp419420 = trunc i32 %tmp417 to i8 ; <i8> [#uses=1]
- %tmp419420421422 = zext i8 %tmp419420 to i64 ; <i64> [#uses=1]
- %tmp423 = getelementptr [0 x i32]* @tree_code_type, i32 0, i64 %tmp419420421422 ; <i32*> [#uses=1]
- %tmp424 = load i32* %tmp423, align 4 ; <i32> [#uses=1]
- %tmp425 = icmp eq i32 %tmp424, 2 ; <i1> [#uses=1]
- br i1 %tmp425, label %cond_next454, label %cond_true428
-
-cond_true428: ; preds = %cond_next385
- tail call void @tree_class_check_failed( %struct.tree_node* %type, i32 2, i8* getelementptr ([28 x i8]* @.str, i32 0, i64 0), i32 1744, i8* getelementptr ([12 x i8]* @__FUNCTION__.22683, i32 0, i32 0) )
- unreachable
-
-cond_next454: ; preds = %cond_next385
- lshr i32 %tmp409, 9 ; <i32>:0 [#uses=1]
- trunc i32 %0 to i8 ; <i8>:1 [#uses=1]
- %tmp463464 = and i8 %1, 127 ; <i8> [#uses=1]
- %tmp463464465466 = zext i8 %tmp463464 to i64 ; <i64> [#uses=1]
- %tmp467 = getelementptr [48 x i8]* @mode_size, i32 0, i64 %tmp463464465466 ; <i8*> [#uses=1]
- %tmp468 = load i8* %tmp467, align 1 ; <i8> [#uses=1]
- %tmp468469553 = zext i8 %tmp468 to i16 ; <i16> [#uses=1]
- %tmp470471 = shl i16 %tmp468469553, 3 ; <i16> [#uses=1]
- %tmp470471472 = zext i16 %tmp470471 to i64 ; <i64> [#uses=1]
- %tmp473 = tail call %struct.tree_node* @size_int_kind( i64 %tmp470471472, i32 2 ) ; <%struct.tree_node*> [#uses=1]
- store %struct.tree_node* %tmp473, %struct.tree_node** %tmp51, align 8
- ret void
-
-bb478: ; preds = %cond_next57
- br i1 %tmp40, label %cond_next500, label %cond_true497
-
-cond_true497: ; preds = %bb478
- tail call void @tree_class_check_failed( %struct.tree_node* %type, i32 2, i8* getelementptr ([28 x i8]* @.str, i32 0, i64 0), i32 1755, i8* getelementptr ([12 x i8]* @__FUNCTION__.22683, i32 0, i32 0) )
- unreachable
-
-cond_next500: ; preds = %bb478
- %tmp506 = getelementptr %struct.tree_node* %type, i32 0, i32 0, i32 0, i32 1 ; <%struct.tree_node**> [#uses=1]
- %tmp507 = load %struct.tree_node** %tmp506, align 8 ; <%struct.tree_node*> [#uses=2]
- %tmp511 = getelementptr %struct.tree_node* %tmp507, i32 0, i32 0, i32 0, i32 3 ; <i8*> [#uses=1]
- %tmp511512 = bitcast i8* %tmp511 to i32* ; <i32*> [#uses=1]
- %tmp513 = load i32* %tmp511512, align 8 ; <i32> [#uses=2]
- %tmp515516 = trunc i32 %tmp513 to i8 ; <i8> [#uses=1]
- %tmp515516517518 = zext i8 %tmp515516 to i64 ; <i64> [#uses=1]
- %tmp519 = getelementptr [0 x i32]* @tree_code_type, i32 0, i64 %tmp515516517518 ; <i32*> [#uses=1]
- %tmp520 = load i32* %tmp519, align 4 ; <i32> [#uses=1]
- %tmp521 = icmp eq i32 %tmp520, 2 ; <i1> [#uses=1]
- br i1 %tmp521, label %cond_next527, label %cond_true524
-
-cond_true524: ; preds = %cond_next500
- tail call void @tree_class_check_failed( %struct.tree_node* %tmp507, i32 2, i8* getelementptr ([28 x i8]* @.str, i32 0, i64 0), i32 1755, i8* getelementptr ([12 x i8]* @__FUNCTION__.22683, i32 0, i32 0) )
- unreachable
-
-cond_next527: ; preds = %cond_next500
- %tmp545 = and i32 %tmp513, 8192 ; <i32> [#uses=1]
- %tmp547 = and i32 %tmp32, -8193 ; <i32> [#uses=1]
- %tmp548 = or i32 %tmp547, %tmp545 ; <i32> [#uses=1]
- store i32 %tmp548, i32* %tmp3031, align 8
- ret void
-
-UnifiedReturnBlock: ; preds = %cond_next57, %cond_next46, %cond_false
- ret void
-}
-
-declare void @fancy_abort(i8*, i32, i8*)
-
-declare void @tree_class_check_failed(%struct.tree_node*, i32, i8*, i32, i8*)
-
-declare i32 @smallest_mode_for_size(i32, i32)
-
-declare %struct.tree_node* @size_int_kind(i64, i32)
-
-declare void @tree_check_failed(%struct.tree_node*, i8*, i32, i8*, ...)
-
-declare i32 @tree_int_cst_sgn(%struct.tree_node*)
diff --git a/release_23/test/CodeGen/X86/2007-10-16-fp80_select.ll b/release_23/test/CodeGen/X86/2007-10-16-fp80_select.ll
deleted file mode 100644
index 2fcf76be5c78..000000000000
--- a/release_23/test/CodeGen/X86/2007-10-16-fp80_select.ll
+++ /dev/null
@@ -1,19 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86
-; ModuleID = 'bugpoint-reduced-simplified.bc'
-target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
-target triple = "i686-apple-darwin9"
- %struct.wxPoint2DInt = type { i32, i32 }
-
-define x86_fp80 @_ZNK12wxPoint2DInt14GetVectorAngleEv(%struct.wxPoint2DInt* %this) {
-entry:
- br i1 false, label %cond_true, label %UnifiedReturnBlock
-
-cond_true: ; preds = %entry
- %tmp8 = load i32* null, align 4 ; <i32> [#uses=1]
- %tmp9 = icmp sgt i32 %tmp8, -1 ; <i1> [#uses=1]
- %retval = select i1 %tmp9, x86_fp80 0xK4005B400000000000000, x86_fp80 0xK40078700000000000000 ; <x86_fp80> [#uses=1]
- ret x86_fp80 %retval
-
-UnifiedReturnBlock: ; preds = %entry
- ret x86_fp80 0xK4005B400000000000000
-}
diff --git a/release_23/test/CodeGen/X86/2007-10-17-IllegalAsm.ll b/release_23/test/CodeGen/X86/2007-10-17-IllegalAsm.ll
deleted file mode 100644
index f3cdfee7545f..000000000000
--- a/release_23/test/CodeGen/X86/2007-10-17-IllegalAsm.ll
+++ /dev/null
@@ -1,87 +0,0 @@
-; RUN: llvm-as < %s | llc -mtriple=x86_64-linux-gnu | grep addb | not grep x
-; RUN: llvm-as < %s | llc -mtriple=x86_64-linux-gnu | grep cmpb | not grep x
-; PR1734
-
-target triple = "x86_64-unknown-linux-gnu"
- %struct.CUMULATIVE_ARGS = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 }
- %struct.eh_status = type opaque
- %struct.emit_status = type { i32, i32, %struct.rtx_def*, %struct.rtx_def*, %struct.sequence_stack*, i32, %struct.location_t, i32, i8*, %struct.rtx_def** }
- %struct.expr_status = type { i32, i32, i32, %struct.rtx_def*, %struct.rtx_def*, %struct.rtx_def* }
- %struct.function = type { %struct.eh_status*, %struct.expr_status*, %struct.emit_status*, %struct.varasm_status*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.function*, i32, i32, i32, i32, %struct.rtx_def*, %struct.CUMULATIVE_ARGS, %struct.rtx_def*, %struct.rtx_def*, %struct.initial_value_struct*, %struct.rtx_def*, %struct.rtx_def*, %struct.rtx_def*, %struct.rtx_def*, %struct.rtx_def*, %struct.rtx_def*, i8, i32, i64, %struct.tree_node*, %struct.tree_node*, %struct.rtx_def*, %struct.varray_head_tag*, %struct.temp_slot*, i32, %struct.var_refs_queue*, i32, i32, %struct.rtvec_def*, %struct.tree_node*, i32, i32, i32, %struct.machine_function*, i32, i32, i8, i8, %struct.language_function*, %struct.rtx_def*, i32, i32, i32, i32, %struct.location_t, %struct.varray_head_tag*, %struct.tree_node*, %struct.tree_node*, i8, i8, i8 }
- %struct.initial_value_struct = type opaque
- %struct.lang_decl = type opaque
- %struct.language_function = type opaque
- %struct.location_t = type { i8*, i32 }
- %struct.machine_function = type { %struct.stack_local_entry*, i8*, %struct.rtx_def*, i32, i32, i32, i32, i32 }
- %struct.rtunion = type { i8* }
- %struct.rtvec_def = type { i32, [1 x %struct.rtx_def*] }
- %struct.rtx_def = type { i16, i8, i8, %struct.u }
- %struct.sequence_stack = type { %struct.rtx_def*, %struct.rtx_def*, %struct.sequence_stack* }
- %struct.stack_local_entry = type opaque
- %struct.temp_slot = type opaque
- %struct.tree_common = type { %struct.tree_node*, %struct.tree_node*, %union.tree_ann_d*, i8, i8, i8, i8, i8 }
- %struct.tree_decl = type { %struct.tree_common, %struct.location_t, i32, %struct.tree_node*, i8, i8, i8, i8, i8, i8, i8, i8, i32, %struct.tree_decl_u1, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.rtx_def*, i32, %struct.tree_decl_u2, %struct.tree_node*, %struct.tree_node*, i64, %struct.lang_decl* }
- %struct.tree_decl_u1 = type { i64 }
- %struct.tree_decl_u2 = type { %struct.function* }
- %struct.tree_node = type { %struct.tree_decl }
- %struct.u = type { [1 x %struct.rtunion] }
- %struct.var_refs_queue = type { %struct.rtx_def*, i32, i32, %struct.var_refs_queue* }
- %struct.varasm_status = type opaque
- %struct.varray_data = type { [1 x i64] }
- %struct.varray_head_tag = type { i64, i64, i32, i8*, %struct.varray_data }
- %union.tree_ann_d = type opaque
-
-define void @layout_type(%struct.tree_node* %type) {
-entry:
- %tmp32 = load i32* null, align 8 ; <i32> [#uses=3]
- %tmp3435 = trunc i32 %tmp32 to i8 ; <i8> [#uses=1]
- %tmp53 = icmp eq %struct.tree_node* null, null ; <i1> [#uses=1]
- br i1 %tmp53, label %cond_next57, label %UnifiedReturnBlock
-
-cond_next57: ; preds = %entry
- %tmp65 = and i32 %tmp32, 255 ; <i32> [#uses=1]
- switch i32 %tmp65, label %UnifiedReturnBlock [
- i32 6, label %bb140
- i32 7, label %bb140
- i32 8, label %bb140
- i32 13, label %bb478
- ]
-
-bb140: ; preds = %cond_next57, %cond_next57, %cond_next57
- %tmp219 = load i32* null, align 8 ; <i32> [#uses=1]
- %tmp221222 = trunc i32 %tmp219 to i8 ; <i8> [#uses=1]
- %tmp223 = icmp eq i8 %tmp221222, 24 ; <i1> [#uses=1]
- br i1 %tmp223, label %cond_true226, label %cond_next340
-
-cond_true226: ; preds = %bb140
- switch i8 %tmp3435, label %cond_true288 [
- i8 6, label %cond_next340
- i8 9, label %cond_next340
- i8 7, label %cond_next340
- i8 8, label %cond_next340
- i8 10, label %cond_next340
- ]
-
-cond_true288: ; preds = %cond_true226
- unreachable
-
-cond_next340: ; preds = %cond_true226, %cond_true226, %cond_true226, %cond_true226, %cond_true226, %bb140
- ret void
-
-bb478: ; preds = %cond_next57
- br i1 false, label %cond_next500, label %cond_true497
-
-cond_true497: ; preds = %bb478
- unreachable
-
-cond_next500: ; preds = %bb478
- %tmp513 = load i32* null, align 8 ; <i32> [#uses=1]
- %tmp545 = and i32 %tmp513, 8192 ; <i32> [#uses=1]
- %tmp547 = and i32 %tmp32, -8193 ; <i32> [#uses=1]
- %tmp548 = or i32 %tmp547, %tmp545 ; <i32> [#uses=1]
- store i32 %tmp548, i32* null, align 8
- ret void
-
-UnifiedReturnBlock: ; preds = %cond_next57, %entry
- ret void
-}
diff --git a/release_23/test/CodeGen/X86/2007-10-19-SpillerUnfold.ll b/release_23/test/CodeGen/X86/2007-10-19-SpillerUnfold.ll
deleted file mode 100644
index e649999bb0a8..000000000000
--- a/release_23/test/CodeGen/X86/2007-10-19-SpillerUnfold.ll
+++ /dev/null
@@ -1,84 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -x86-asm-syntax=intel | grep inc | not grep PTR
-
-define i16 @t(i32* %bitptr, i32* %source, i8** %byteptr, i32 %scale, i32 %round) signext {
-entry:
- br label %bb
-
-bb: ; preds = %cond_next391, %entry
- %cnt.0 = phi i32 [ 0, %entry ], [ %tmp422445, %cond_next391 ] ; <i32> [#uses=1]
- %v.1 = phi i32 [ undef, %entry ], [ %tmp411, %cond_next391 ] ; <i32> [#uses=0]
- br i1 false, label %cond_true, label %cond_next127
-
-cond_true: ; preds = %bb
- store i8* null, i8** %byteptr, align 4
- store i8* null, i8** %byteptr, align 4
- br label %cond_next127
-
-cond_next127: ; preds = %cond_true, %bb
- %tmp151 = add i32 0, %round ; <i32> [#uses=1]
- %tmp153 = ashr i32 %tmp151, %scale ; <i32> [#uses=2]
- %tmp154155 = trunc i32 %tmp153 to i16 ; <i16> [#uses=1]
- %tmp154155156 = sext i16 %tmp154155 to i32 ; <i32> [#uses=1]
- %tmp158 = xor i32 %tmp154155156, %tmp153 ; <i32> [#uses=1]
- %tmp160 = or i32 %tmp158, %cnt.0 ; <i32> [#uses=1]
- %tmp171 = load i32* %bitptr, align 4 ; <i32> [#uses=1]
- %tmp180181 = sext i16 0 to i32 ; <i32> [#uses=3]
- %tmp183 = add i32 %tmp160, 1 ; <i32> [#uses=1]
- br i1 false, label %cond_true188, label %cond_next245
-
-cond_true188: ; preds = %cond_next127
- ret i16 0
-
-cond_next245: ; preds = %cond_next127
- %tmp249 = ashr i32 %tmp180181, 8 ; <i32> [#uses=1]
- %tmp250 = add i32 %tmp171, %tmp249 ; <i32> [#uses=1]
- %tmp253444 = lshr i32 %tmp180181, 4 ; <i32> [#uses=1]
- %tmp254 = and i32 %tmp253444, 15 ; <i32> [#uses=1]
- %tmp256 = and i32 %tmp180181, 15 ; <i32> [#uses=2]
- %tmp264 = icmp ugt i32 %tmp250, 15 ; <i1> [#uses=1]
- br i1 %tmp264, label %cond_true267, label %cond_next391
-
-cond_true267: ; preds = %cond_next245
- store i8* null, i8** %byteptr, align 4
- store i8* null, i8** %byteptr, align 4
- br i1 false, label %cond_true289, label %cond_next327
-
-cond_true289: ; preds = %cond_true267
- ret i16 0
-
-cond_next327: ; preds = %cond_true267
- br i1 false, label %cond_true343, label %cond_next385
-
-cond_true343: ; preds = %cond_next327
- %tmp345 = load i8** %byteptr, align 4 ; <i8*> [#uses=1]
- store i8* null, i8** %byteptr, align 4
- br i1 false, label %cond_next385, label %cond_true352
-
-cond_true352: ; preds = %cond_true343
- store i8* %tmp345, i8** %byteptr, align 4
- br i1 false, label %cond_true364, label %cond_next385
-
-cond_true364: ; preds = %cond_true352
- ret i16 0
-
-cond_next385: ; preds = %cond_true352, %cond_true343, %cond_next327
- br label %cond_next391
-
-cond_next391: ; preds = %cond_next385, %cond_next245
- %tmp393 = load i32* %source, align 4 ; <i32> [#uses=1]
- %tmp395 = load i32* %bitptr, align 4 ; <i32> [#uses=2]
- %tmp396 = shl i32 %tmp393, %tmp395 ; <i32> [#uses=1]
- %tmp398 = sub i32 32, %tmp256 ; <i32> [#uses=1]
- %tmp405 = lshr i32 %tmp396, 31 ; <i32> [#uses=1]
- %tmp406 = add i32 %tmp405, -1 ; <i32> [#uses=1]
- %tmp409 = lshr i32 %tmp406, %tmp398 ; <i32> [#uses=1]
- %tmp411 = sub i32 0, %tmp409 ; <i32> [#uses=1]
- %tmp422445 = add i32 %tmp254, %tmp183 ; <i32> [#uses=2]
- %tmp426447 = add i32 %tmp395, %tmp256 ; <i32> [#uses=1]
- store i32 %tmp426447, i32* %bitptr, align 4
- %tmp429448 = icmp ult i32 %tmp422445, 63 ; <i1> [#uses=1]
- br i1 %tmp429448, label %bb, label %UnifiedReturnBlock
-
-UnifiedReturnBlock: ; preds = %cond_next391
- ret i16 0
-}
diff --git a/release_23/test/CodeGen/X86/2007-10-28-inlineasm-q-modifier.ll b/release_23/test/CodeGen/X86/2007-10-28-inlineasm-q-modifier.ll
deleted file mode 100644
index 450911ae8199..000000000000
--- a/release_23/test/CodeGen/X86/2007-10-28-inlineasm-q-modifier.ll
+++ /dev/null
@@ -1,11 +0,0 @@
-; RUN: llvm-as < %s | llc
-; PR1748
-target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128"
-target triple = "x86_64-unknown-linux-gnu"
-
-define i32 @kernel_init(i8* %unused) {
-entry:
- call void asm sideeffect "foo ${0:q}", "=*imr"( i64* null )
- ret i32 0
-}
-
diff --git a/release_23/test/CodeGen/X86/2007-10-29-ExtendSetCC.ll b/release_23/test/CodeGen/X86/2007-10-29-ExtendSetCC.ll
deleted file mode 100644
index 9013e9020efa..000000000000
--- a/release_23/test/CodeGen/X86/2007-10-29-ExtendSetCC.ll
+++ /dev/null
@@ -1,17 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 | grep mov | count 1
-
-define i16 @t() signext {
-entry:
- %tmp180 = load i16* null, align 2 ; <i16> [#uses=3]
- %tmp180181 = sext i16 %tmp180 to i32 ; <i32> [#uses=1]
- %tmp185 = icmp slt i16 %tmp180, 0 ; <i1> [#uses=1]
- br i1 %tmp185, label %cond_true188, label %cond_next245
-
-cond_true188: ; preds = %entry
- %tmp195196 = trunc i16 %tmp180 to i8 ; <i8> [#uses=0]
- ret i16 0
-
-cond_next245: ; preds = %entry
- %tmp256 = and i32 %tmp180181, 15 ; <i32> [#uses=0]
- ret i16 0
-}
diff --git a/release_23/test/CodeGen/X86/2007-10-30-LSRCrash.ll b/release_23/test/CodeGen/X86/2007-10-30-LSRCrash.ll
deleted file mode 100644
index 1c912a014049..000000000000
--- a/release_23/test/CodeGen/X86/2007-10-30-LSRCrash.ll
+++ /dev/null
@@ -1,48 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86
-
-define i32 @unique(i8* %full, i32 %p, i32 %len, i32 %mode, i32 %verbos, i32 %flags) {
-entry:
- br i1 false, label %cond_true15, label %cond_next107
-
-cond_true15: ; preds = %entry
- br i1 false, label %bb98.preheader, label %bb
-
-bb: ; preds = %cond_true15
- ret i32 0
-
-bb98.preheader: ; preds = %cond_true15
- br i1 false, label %bb103, label %bb69.outer
-
-bb76.split: ; preds = %bb69.outer.split.split, %bb69.us208
- br i1 false, label %bb103, label %bb69.outer
-
-bb69.outer: ; preds = %bb76.split, %bb98.preheader
- %from.0.reg2mem.0.ph.rec = phi i32 [ %tmp75.rec, %bb76.split ], [ 0, %bb98.preheader ] ; <i32> [#uses=1]
- %tmp75.rec = add i32 %from.0.reg2mem.0.ph.rec, 1 ; <i32> [#uses=2]
- %tmp75 = getelementptr i8* null, i32 %tmp75.rec ; <i8*> [#uses=6]
- br i1 false, label %bb69.us208, label %bb69.outer.split.split
-
-bb69.us208: ; preds = %bb69.outer
- switch i32 0, label %bb76.split [
- i32 47, label %bb89
- i32 58, label %bb89
- i32 92, label %bb89
- ]
-
-bb69.outer.split.split: ; preds = %bb69.outer
- switch i8 0, label %bb76.split [
- i8 47, label %bb89
- i8 58, label %bb89
- i8 92, label %bb89
- ]
-
-bb89: ; preds = %bb69.outer.split.split, %bb69.outer.split.split, %bb69.outer.split.split, %bb69.us208, %bb69.us208, %bb69.us208
- %tmp75.lcssa189 = phi i8* [ %tmp75, %bb69.us208 ], [ %tmp75, %bb69.us208 ], [ %tmp75, %bb69.us208 ], [ %tmp75, %bb69.outer.split.split ], [ %tmp75, %bb69.outer.split.split ], [ %tmp75, %bb69.outer.split.split ] ; <i8*> [#uses=0]
- ret i32 0
-
-bb103: ; preds = %bb76.split, %bb98.preheader
- ret i32 0
-
-cond_next107: ; preds = %entry
- ret i32 0
-}
diff --git a/release_23/test/CodeGen/X86/2007-10-31-extractelement-i64.ll b/release_23/test/CodeGen/X86/2007-10-31-extractelement-i64.ll
deleted file mode 100644
index f73a9105cef4..000000000000
--- a/release_23/test/CodeGen/X86/2007-10-31-extractelement-i64.ll
+++ /dev/null
@@ -1,82 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -mattr=sse2
-; ModuleID = 'yyy.c'
-target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
-target triple = "i686-apple-darwin8"
-
-define <1 x i64> @a(<2 x i64> %__A) {
-entry:
- %__A_addr = alloca <2 x i64> ; <<2 x i64>*> [#uses=2]
- %retval = alloca <1 x i64>, align 8 ; <<1 x i64>*> [#uses=3]
- %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
- store <2 x i64> %__A, <2 x i64>* %__A_addr
- %tmp = load <2 x i64>* %__A_addr, align 16 ; <<2 x i64>> [#uses=1]
- %tmp1 = bitcast <2 x i64> %tmp to <2 x i64> ; <<2 x i64>> [#uses=1]
- %tmp2 = extractelement <2 x i64> %tmp1, i32 0 ; <i64> [#uses=1]
- %tmp3 = bitcast i64 %tmp2 to <1 x i64> ; <<1 x i64>> [#uses=1]
- store <1 x i64> %tmp3, <1 x i64>* %retval, align 8
- %tmp4 = load <1 x i64>* %retval, align 8 ; <<1 x i64>> [#uses=0]
- br label %return
-
-return: ; preds = %entry
- %retval5 = load <1 x i64>* %retval ; <<1 x i64>> [#uses=1]
- ret <1 x i64> %retval5
-}
-
-define <1 x i64> @b(<2 x i64> %__A) {
-entry:
- %__A_addr = alloca <2 x i64> ; <<2 x i64>*> [#uses=2]
- %retval = alloca <1 x i64>, align 8 ; <<1 x i64>*> [#uses=3]
- %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
- store <2 x i64> %__A, <2 x i64>* %__A_addr
- %tmp = load <2 x i64>* %__A_addr, align 16 ; <<2 x i64>> [#uses=1]
- %tmp1 = bitcast <2 x i64> %tmp to <2 x i64> ; <<2 x i64>> [#uses=1]
- %tmp2 = extractelement <2 x i64> %tmp1, i32 1 ; <i64> [#uses=1]
- %tmp3 = bitcast i64 %tmp2 to <1 x i64> ; <<1 x i64>> [#uses=1]
- store <1 x i64> %tmp3, <1 x i64>* %retval, align 8
- %tmp4 = load <1 x i64>* %retval, align 8 ; <<1 x i64>> [#uses=0]
- br label %return
-
-return: ; preds = %entry
- %retval5 = load <1 x i64>* %retval ; <<1 x i64>> [#uses=1]
- ret <1 x i64> %retval5
-}
-
-define i64 @c(<2 x i64> %__A) {
-entry:
- %__A_addr = alloca <2 x i64> ; <<2 x i64>*> [#uses=2]
- %retval = alloca i64, align 8 ; <i64*> [#uses=2]
- %tmp = alloca i64, align 8 ; <i64*> [#uses=2]
- %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
- store <2 x i64> %__A, <2 x i64>* %__A_addr
- %tmp1 = load <2 x i64>* %__A_addr, align 16 ; <<2 x i64>> [#uses=1]
- %tmp2 = bitcast <2 x i64> %tmp1 to <2 x i64> ; <<2 x i64>> [#uses=1]
- %tmp3 = extractelement <2 x i64> %tmp2, i32 0 ; <i64> [#uses=1]
- store i64 %tmp3, i64* %tmp, align 8
- %tmp4 = load i64* %tmp, align 8 ; <i64> [#uses=1]
- store i64 %tmp4, i64* %retval, align 8
- br label %return
-
-return: ; preds = %entry
- %retval5 = load i64* %retval ; <i64> [#uses=1]
- ret i64 %retval5
-}
-
-define i64 @d(<2 x i64> %__A) {
-entry:
- %__A_addr = alloca <2 x i64> ; <<2 x i64>*> [#uses=2]
- %retval = alloca i64, align 8 ; <i64*> [#uses=2]
- %tmp = alloca i64, align 8 ; <i64*> [#uses=2]
- %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
- store <2 x i64> %__A, <2 x i64>* %__A_addr
- %tmp1 = load <2 x i64>* %__A_addr, align 16 ; <<2 x i64>> [#uses=1]
- %tmp2 = bitcast <2 x i64> %tmp1 to <2 x i64> ; <<2 x i64>> [#uses=1]
- %tmp3 = extractelement <2 x i64> %tmp2, i32 1 ; <i64> [#uses=1]
- store i64 %tmp3, i64* %tmp, align 8
- %tmp4 = load i64* %tmp, align 8 ; <i64> [#uses=1]
- store i64 %tmp4, i64* %retval, align 8
- br label %return
-
-return: ; preds = %entry
- %retval5 = load i64* %retval ; <i64> [#uses=1]
- ret i64 %retval5
-}
diff --git a/release_23/test/CodeGen/X86/2007-11-01-ISelCrash.ll b/release_23/test/CodeGen/X86/2007-11-01-ISelCrash.ll
deleted file mode 100644
index 704efd0ef800..000000000000
--- a/release_23/test/CodeGen/X86/2007-11-01-ISelCrash.ll
+++ /dev/null
@@ -1,12 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86
-
- %"struct.K::JL" = type <{ i8 }>
- %struct.jv = type { i64 }
-
-declare fastcc i64 @f(i32, %"struct.K::JL"*, i8*, i8*, %struct.jv*)
-
-define void @t(%"struct.K::JL"* %obj, i8* %name, i8* %sig, %struct.jv* %args) {
-entry:
- %tmp5 = tail call fastcc i64 @f( i32 1, %"struct.K::JL"* %obj, i8* %name, i8* %sig, %struct.jv* %args ) ; <i64> [#uses=0]
- ret void
-}
diff --git a/release_23/test/CodeGen/X86/2007-11-02-BadAsm.ll b/release_23/test/CodeGen/X86/2007-11-02-BadAsm.ll
deleted file mode 100644
index 7fe8eaf3abc7..000000000000
--- a/release_23/test/CodeGen/X86/2007-11-02-BadAsm.ll
+++ /dev/null
@@ -1,144 +0,0 @@
-; RUN: llvm-as < %s | llc -mtriple=x86_64-apple-darwin | grep movl | not grep rax
-
- %struct.color_sample = type { i64 }
- %struct.gs_matrix = type { float, i64, float, i64, float, i64, float, i64, float, i64, float, i64 }
- %struct.ref = type { %struct.color_sample, i16, i16 }
- %struct.status = type { %struct.gs_matrix, i8*, i32, i32, i8*, i32, i32, i32, i32, i32, i32, i32 }
-
-define i32 @ztype1imagepath(%struct.ref* %op) {
-entry:
- br i1 false, label %cond_next, label %UnifiedReturnBlock
-
-cond_next: ; preds = %entry
- br i1 false, label %cond_next68, label %UnifiedReturnBlock
-
-cond_next68: ; preds = %cond_next
- %tmp5.i.i = malloc i8, i32 0 ; <i8*> [#uses=2]
- br i1 false, label %bb81.outer.i, label %xit.i
-
-bb81.outer.i: ; preds = %bb87.i, %cond_next68
- %tmp67.i = add i32 0, 1 ; <i32> [#uses=1]
- br label %bb81.i
-
-bb61.i: ; preds = %bb81.i
- %tmp71.i = getelementptr i8* %tmp5.i.i, i64 0 ; <i8*> [#uses=1]
- %tmp72.i = load i8* %tmp71.i, align 1 ; <i8> [#uses=1]
- %tmp73.i = icmp eq i8 %tmp72.i, 0 ; <i1> [#uses=1]
- br i1 %tmp73.i, label %bb81.i, label %xit.i
-
-bb81.i: ; preds = %bb61.i, %bb81.outer.i
- br i1 false, label %bb87.i, label %bb61.i
-
-bb87.i: ; preds = %bb81.i
- br i1 false, label %bb81.outer.i, label %xit.i
-
-xit.i: ; preds = %bb87.i, %bb61.i, %cond_next68
- %lsbx.0.reg2mem.1.i = phi i32 [ 0, %cond_next68 ], [ 0, %bb61.i ], [ %tmp67.i, %bb87.i ] ; <i32> [#uses=1]
- %tmp6162.i.i = fptrunc double 0.000000e+00 to float ; <float> [#uses=1]
- %tmp67.i15.i = fptrunc double 0.000000e+00 to float ; <float> [#uses=1]
- %tmp24.i27.i = icmp eq i64 0, 0 ; <i1> [#uses=1]
- br i1 %tmp24.i27.i, label %cond_next.i79.i, label %cond_true.i34.i
-
-cond_true.i34.i: ; preds = %xit.i
- ret i32 0
-
-cond_next.i79.i: ; preds = %xit.i
- %phitmp167.i = fptosi double 0.000000e+00 to i64 ; <i64> [#uses=1]
- %tmp142143.i = fpext float %tmp6162.i.i to double ; <double> [#uses=1]
- %tmp2.i139.i = add double %tmp142143.i, 5.000000e-01 ; <double> [#uses=1]
- %tmp23.i140.i = fptosi double %tmp2.i139.i to i64 ; <i64> [#uses=1]
- br i1 false, label %cond_true.i143.i, label %round_coord.exit148.i
-
-cond_true.i143.i: ; preds = %cond_next.i79.i
- %tmp8.i142.i = icmp sgt i64 %tmp23.i140.i, -32768 ; <i1> [#uses=1]
- br i1 %tmp8.i142.i, label %cond_true11.i145.i, label %round_coord.exit148.i
-
-cond_true11.i145.i: ; preds = %cond_true.i143.i
- ret i32 0
-
-round_coord.exit148.i: ; preds = %cond_true.i143.i, %cond_next.i79.i
- %tmp144149.i = phi i32 [ 32767, %cond_next.i79.i ], [ -32767, %cond_true.i143.i ] ; <i32> [#uses=1]
- store i32 %tmp144149.i, i32* null, align 8
- %tmp147148.i = fpext float %tmp67.i15.i to double ; <double> [#uses=1]
- %tmp2.i128.i = add double %tmp147148.i, 5.000000e-01 ; <double> [#uses=1]
- %tmp23.i129.i = fptosi double %tmp2.i128.i to i64 ; <i64> [#uses=2]
- %tmp5.i130.i = icmp slt i64 %tmp23.i129.i, 32768 ; <i1> [#uses=1]
- br i1 %tmp5.i130.i, label %cond_true.i132.i, label %round_coord.exit137.i
-
-cond_true.i132.i: ; preds = %round_coord.exit148.i
- %tmp8.i131.i = icmp sgt i64 %tmp23.i129.i, -32768 ; <i1> [#uses=1]
- br i1 %tmp8.i131.i, label %cond_true11.i134.i, label %round_coord.exit137.i
-
-cond_true11.i134.i: ; preds = %cond_true.i132.i
- br label %round_coord.exit137.i
-
-round_coord.exit137.i: ; preds = %cond_true11.i134.i, %cond_true.i132.i, %round_coord.exit148.i
- %tmp149138.i = phi i32 [ 0, %cond_true11.i134.i ], [ 32767, %round_coord.exit148.i ], [ -32767, %cond_true.i132.i ] ; <i32> [#uses=1]
- br i1 false, label %cond_true.i121.i, label %round_coord.exit126.i
-
-cond_true.i121.i: ; preds = %round_coord.exit137.i
- br i1 false, label %cond_true11.i123.i, label %round_coord.exit126.i
-
-cond_true11.i123.i: ; preds = %cond_true.i121.i
- br label %round_coord.exit126.i
-
-round_coord.exit126.i: ; preds = %cond_true11.i123.i, %cond_true.i121.i, %round_coord.exit137.i
- %tmp153127.i = phi i32 [ 0, %cond_true11.i123.i ], [ 32767, %round_coord.exit137.i ], [ -32767, %cond_true.i121.i ] ; <i32> [#uses=1]
- br i1 false, label %cond_true.i110.i, label %round_coord.exit115.i
-
-cond_true.i110.i: ; preds = %round_coord.exit126.i
- br i1 false, label %cond_true11.i112.i, label %round_coord.exit115.i
-
-cond_true11.i112.i: ; preds = %cond_true.i110.i
- br label %round_coord.exit115.i
-
-round_coord.exit115.i: ; preds = %cond_true11.i112.i, %cond_true.i110.i, %round_coord.exit126.i
- %tmp157116.i = phi i32 [ 0, %cond_true11.i112.i ], [ 32767, %round_coord.exit126.i ], [ -32767, %cond_true.i110.i ] ; <i32> [#uses=2]
- br i1 false, label %cond_true.i99.i, label %round_coord.exit104.i
-
-cond_true.i99.i: ; preds = %round_coord.exit115.i
- br i1 false, label %cond_true11.i101.i, label %round_coord.exit104.i
-
-cond_true11.i101.i: ; preds = %cond_true.i99.i
- %tmp1213.i100.i = trunc i64 %phitmp167.i to i32 ; <i32> [#uses=1]
- br label %cond_next172.i
-
-round_coord.exit104.i: ; preds = %cond_true.i99.i, %round_coord.exit115.i
- %UnifiedRetVal.i102.i = phi i32 [ 32767, %round_coord.exit115.i ], [ -32767, %cond_true.i99.i ] ; <i32> [#uses=1]
- %tmp164.i = call fastcc i32 @put_int( %struct.status* null, i32 %tmp157116.i ) ; <i32> [#uses=0]
- br label %cond_next172.i
-
-cond_next172.i: ; preds = %round_coord.exit104.i, %cond_true11.i101.i
- %tmp161105.reg2mem.0.i = phi i32 [ %tmp1213.i100.i, %cond_true11.i101.i ], [ %UnifiedRetVal.i102.i, %round_coord.exit104.i ] ; <i32> [#uses=1]
- %tmp174.i = icmp eq i32 %tmp153127.i, 0 ; <i1> [#uses=1]
- %bothcond.i = and i1 false, %tmp174.i ; <i1> [#uses=1]
- %tmp235.i = call fastcc i32 @put_int( %struct.status* null, i32 %tmp149138.i ) ; <i32> [#uses=0]
- %tmp245.i = load i8** null, align 8 ; <i8*> [#uses=2]
- %tmp246.i = getelementptr i8* %tmp245.i, i64 1 ; <i8*> [#uses=1]
- br i1 %bothcond.i, label %cond_next254.i, label %bb259.i
-
-cond_next254.i: ; preds = %cond_next172.i
- store i8 13, i8* %tmp245.i, align 1
- br label %bb259.i
-
-bb259.i: ; preds = %cond_next254.i, %cond_next172.i
- %storemerge.i = phi i8* [ %tmp246.i, %cond_next254.i ], [ null, %cond_next172.i ] ; <i8*> [#uses=0]
- %tmp261.i = shl i32 %lsbx.0.reg2mem.1.i, 2 ; <i32> [#uses=1]
- store i32 %tmp261.i, i32* null, align 8
- %tmp270.i = add i32 0, %tmp157116.i ; <i32> [#uses=1]
- store i32 %tmp270.i, i32* null, align 8
- %tmp275.i = add i32 0, %tmp161105.reg2mem.0.i ; <i32> [#uses=0]
- br i1 false, label %trace_cells.exit.i, label %bb.preheader.i.i
-
-bb.preheader.i.i: ; preds = %bb259.i
- ret i32 0
-
-trace_cells.exit.i: ; preds = %bb259.i
- free i8* %tmp5.i.i
- ret i32 0
-
-UnifiedReturnBlock: ; preds = %cond_next, %entry
- ret i32 -20
-}
-
-declare fastcc i32 @put_int(%struct.status*, i32)
diff --git a/release_23/test/CodeGen/X86/2007-11-03-x86-64-q-constraint.ll b/release_23/test/CodeGen/X86/2007-11-03-x86-64-q-constraint.ll
deleted file mode 100644
index ffa6e44d1cb6..000000000000
--- a/release_23/test/CodeGen/X86/2007-11-03-x86-64-q-constraint.ll
+++ /dev/null
@@ -1,9 +0,0 @@
-; RUN: llvm-as < %s | llc
-; PR1763
-target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128"
-target triple = "x86_64-unknown-linux-gnu"
-
-define void @yield() {
- %tmp9 = call i64 asm sideeffect "xchgb ${0:b},$1", "=q,*m,0,~{dirflag},~{fpsr},~{flags},~{memory}"( i64* null, i64 0 ) ; <i64>
- ret void
-}
diff --git a/release_23/test/CodeGen/X86/2007-11-04-LiveIntervalCrash.ll b/release_23/test/CodeGen/X86/2007-11-04-LiveIntervalCrash.ll
deleted file mode 100644
index 889b122bb066..000000000000
--- a/release_23/test/CodeGen/X86/2007-11-04-LiveIntervalCrash.ll
+++ /dev/null
@@ -1,37 +0,0 @@
-; RUN: llvm-as < %s | llc -mtriple=x86_64-unknown-linux-gnu
-; PR1766
-
- %struct.dentry = type { %struct.dentry_operations* }
- %struct.dentry_operations = type { i32 (%struct.dentry*, %struct.qstr*)* }
- %struct.qstr = type { i32, i32, i8* }
-
-define %struct.dentry* @d_hash_and_lookup(%struct.dentry* %dir, %struct.qstr* %name) {
-entry:
- br i1 false, label %bb37, label %bb
-
-bb: ; preds = %bb, %entry
- %name8.0.reg2mem.0.rec = phi i64 [ %indvar.next, %bb ], [ 0, %entry ] ; <i64> [#uses=1]
- %hash.0.reg2mem.0 = phi i64 [ %tmp27, %bb ], [ 0, %entry ] ; <i64> [#uses=1]
- %tmp13 = load i8* null, align 1 ; <i8> [#uses=1]
- %tmp1314 = zext i8 %tmp13 to i64 ; <i64> [#uses=1]
- %tmp25 = lshr i64 %tmp1314, 4 ; <i64> [#uses=1]
- %tmp22 = add i64 %tmp25, %hash.0.reg2mem.0 ; <i64> [#uses=1]
- %tmp26 = add i64 %tmp22, 0 ; <i64> [#uses=1]
- %tmp27 = mul i64 %tmp26, 11 ; <i64> [#uses=2]
- %indvar.next = add i64 %name8.0.reg2mem.0.rec, 1 ; <i64> [#uses=2]
- %exitcond = icmp eq i64 %indvar.next, 0 ; <i1> [#uses=1]
- br i1 %exitcond, label %bb37.loopexit, label %bb
-
-bb37.loopexit: ; preds = %bb
- %phitmp = trunc i64 %tmp27 to i32 ; <i32> [#uses=1]
- br label %bb37
-
-bb37: ; preds = %bb37.loopexit, %entry
- %hash.0.reg2mem.1 = phi i32 [ %phitmp, %bb37.loopexit ], [ 0, %entry ] ; <i32> [#uses=1]
- store i32 %hash.0.reg2mem.1, i32* null, align 8
- %tmp75 = tail call i32 null( %struct.dentry* %dir, %struct.qstr* %name ) ; <i32> [#uses=0]
- %tmp84 = tail call i32 (...)* @d_lookup( %struct.dentry* %dir, %struct.qstr* %name ) ; <i32> [#uses=0]
- ret %struct.dentry* null
-}
-
-declare i32 @d_lookup(...)
diff --git a/release_23/test/CodeGen/X86/2007-11-04-LiveVariablesBug.ll b/release_23/test/CodeGen/X86/2007-11-04-LiveVariablesBug.ll
deleted file mode 100644
index 7e41f3679063..000000000000
--- a/release_23/test/CodeGen/X86/2007-11-04-LiveVariablesBug.ll
+++ /dev/null
@@ -1,16 +0,0 @@
-; RUN: llvm-as < %s | llc -mtriple=x86_64-unknown-linux-gnu
-; PR1767
-
-define void @xor_sse_2(i64 %bytes, i64* %p1, i64* %p2) {
-entry:
- %p2_addr = alloca i64* ; <i64**> [#uses=2]
- %lines = alloca i32 ; <i32*> [#uses=2]
- store i64* %p2, i64** %p2_addr, align 8
- %tmp1 = lshr i64 %bytes, 8 ; <i64> [#uses=1]
- %tmp12 = trunc i64 %tmp1 to i32 ; <i32> [#uses=2]
- store i32 %tmp12, i32* %lines, align 4
- %tmp6 = call i64* asm sideeffect "foo",
-"=r,=*r,=*r,r,0,1,2,~{dirflag},~{fpsr},~{flags},~{memory}"( i64** %p2_addr,
-i32* %lines, i64 256, i64* %p1, i64* %p2, i32 %tmp12 ) ; <i64*> [#uses=0]
- ret void
-}
diff --git a/release_23/test/CodeGen/X86/2007-11-04-rip-immediate-constant.ll b/release_23/test/CodeGen/X86/2007-11-04-rip-immediate-constant.ll
deleted file mode 100644
index de33c617d050..000000000000
--- a/release_23/test/CodeGen/X86/2007-11-04-rip-immediate-constant.ll
+++ /dev/null
@@ -1,11 +0,0 @@
-; RUN: llvm-as < %s | llc -relocation-model=static | grep {foo _str$}
-; PR1761
-target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128"
-target triple = "x86_64-apple-darwin8"
-@str = internal constant [12 x i8] c"init/main.c\00" ; <[12 x i8]*> [#uses=1]
-
-define i32 @unknown_bootoption() {
-entry:
- tail call void asm sideeffect "foo ${0:c}\0A", "i,~{dirflag},~{fpsr},~{flags}"( i8* getelementptr ([12 x i8]* @str, i32 0, i64 0) )
- ret i32 undef
-}
diff --git a/release_23/test/CodeGen/X86/2007-11-06-InstrSched.ll b/release_23/test/CodeGen/X86/2007-11-06-InstrSched.ll
deleted file mode 100644
index f2542ea5ef58..000000000000
--- a/release_23/test/CodeGen/X86/2007-11-06-InstrSched.ll
+++ /dev/null
@@ -1,25 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | not grep lea
-
-define float @foo(i32* %x, float* %y, i32 %c) {
-entry:
- %tmp2132 = icmp eq i32 %c, 0 ; <i1> [#uses=1]
- br i1 %tmp2132, label %bb23, label %bb18
-
-bb18: ; preds = %bb18, %entry
- %i.0.reg2mem.0 = phi i32 [ 0, %entry ], [ %tmp17, %bb18 ] ; <i32> [#uses=3]
- %res.0.reg2mem.0 = phi float [ 0.000000e+00, %entry ], [ %tmp14, %bb18 ] ; <float> [#uses=1]
- %tmp3 = getelementptr i32* %x, i32 %i.0.reg2mem.0 ; <i32*> [#uses=1]
- %tmp4 = load i32* %tmp3, align 4 ; <i32> [#uses=1]
- %tmp45 = sitofp i32 %tmp4 to float ; <float> [#uses=1]
- %tmp8 = getelementptr float* %y, i32 %i.0.reg2mem.0 ; <float*> [#uses=1]
- %tmp9 = load float* %tmp8, align 4 ; <float> [#uses=1]
- %tmp11 = mul float %tmp9, %tmp45 ; <float> [#uses=1]
- %tmp14 = add float %tmp11, %res.0.reg2mem.0 ; <float> [#uses=2]
- %tmp17 = add i32 %i.0.reg2mem.0, 1 ; <i32> [#uses=2]
- %tmp21 = icmp ult i32 %tmp17, %c ; <i1> [#uses=1]
- br i1 %tmp21, label %bb18, label %bb23
-
-bb23: ; preds = %bb18, %entry
- %res.0.reg2mem.1 = phi float [ 0.000000e+00, %entry ], [ %tmp14, %bb18 ] ; <float> [#uses=1]
- ret float %res.0.reg2mem.1
-}
diff --git a/release_23/test/CodeGen/X86/2007-11-07-MulBy4.ll b/release_23/test/CodeGen/X86/2007-11-07-MulBy4.ll
deleted file mode 100644
index d7fb684a6ba4..000000000000
--- a/release_23/test/CodeGen/X86/2007-11-07-MulBy4.ll
+++ /dev/null
@@ -1,129 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 | not grep imul
-
- %struct.eebb = type { %struct.eebb*, i16* }
- %struct.hf = type { %struct.hf*, i16*, i8*, i32, i32, %struct.eebb*, i32, i32, i8*, i8*, i8*, i8*, i16*, i8*, i16*, %struct.ri, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, [30 x i32], %struct.eebb, i32, i8* }
- %struct.foo_data = type { i32, i32, i32, i32*, i32, i32, i8*, i8*, i32, i32, i32, i32, i32, i32, i32, i32, i8*, i16*, i16*, i16*, i16*, i32, i32, i32, %struct.ri*, i8*, %struct.hf* }
- %struct.ri = type { %struct.ri*, i32, i8*, i16*, i32*, i32 }
-
-define fastcc i32 @foo(i16* %eptr, i8* %ecode, %struct.foo_data* %md, i32 %ims) {
-entry:
- %tmp36 = load i32* null, align 4 ; <i32> [#uses=1]
- %tmp37 = icmp ult i32 0, %tmp36 ; <i1> [#uses=1]
- br i1 %tmp37, label %cond_next79, label %cond_true
-
-cond_true: ; preds = %entry
- ret i32 0
-
-cond_next79: ; preds = %entry
- %tmp85 = load i32* null, align 4 ; <i32> [#uses=1]
- %tmp86 = icmp ult i32 0, %tmp85 ; <i1> [#uses=1]
- br i1 %tmp86, label %cond_next130, label %cond_true89
-
-cond_true89: ; preds = %cond_next79
- ret i32 0
-
-cond_next130: ; preds = %cond_next79
- %tmp173 = icmp eq i32 0, 0 ; <i1> [#uses=1]
- br i1 %tmp173, label %cond_next201, label %cond_true176
-
-cond_true176: ; preds = %cond_next130
- ret i32 0
-
-cond_next201: ; preds = %cond_next130
- switch i32 0, label %bb19955 [
- i32 0, label %bb1266
- i32 1, label %bb5018
- i32 2, label %bb5075
- i32 3, label %cond_true5534
- i32 4, label %cond_true5534
- i32 5, label %bb6039
- i32 6, label %bb6181
- i32 7, label %bb6323
- i32 8, label %bb6463
- i32 9, label %bb6605
- i32 10, label %bb6746
- i32 11, label %cond_next5871
- i32 16, label %bb5452
- i32 17, label %bb5395
- i32 19, label %bb4883
- i32 20, label %bb5136
- i32 23, label %bb12899
- i32 64, label %bb2162
- i32 69, label %bb1447
- i32 70, label %bb1737
- i32 71, label %bb1447
- i32 72, label %bb1737
- i32 73, label %cond_true1984
- i32 75, label %bb740
- i32 80, label %bb552
- ]
-
-bb552: ; preds = %cond_next201
- ret i32 0
-
-bb740: ; preds = %cond_next201
- ret i32 0
-
-bb1266: ; preds = %cond_next201
- ret i32 0
-
-bb1447: ; preds = %cond_next201, %cond_next201
- ret i32 0
-
-bb1737: ; preds = %cond_next201, %cond_next201
- ret i32 0
-
-cond_true1984: ; preds = %cond_next201
- ret i32 0
-
-bb2162: ; preds = %cond_next201
- ret i32 0
-
-bb4883: ; preds = %cond_next201
- ret i32 0
-
-bb5018: ; preds = %cond_next201
- ret i32 0
-
-bb5075: ; preds = %cond_next201
- ret i32 0
-
-bb5136: ; preds = %cond_next201
- ret i32 0
-
-bb5395: ; preds = %cond_next201
- ret i32 0
-
-bb5452: ; preds = %cond_next201
- ret i32 0
-
-cond_true5534: ; preds = %cond_next201, %cond_next201
- ret i32 0
-
-cond_next5871: ; preds = %cond_next201
- ret i32 0
-
-bb6039: ; preds = %cond_next201
- ret i32 0
-
-bb6181: ; preds = %cond_next201
- ret i32 0
-
-bb6323: ; preds = %cond_next201
- ret i32 0
-
-bb6463: ; preds = %cond_next201
- ret i32 0
-
-bb6605: ; preds = %cond_next201
- ret i32 0
-
-bb6746: ; preds = %cond_next201
- ret i32 0
-
-bb12899: ; preds = %cond_next201
- ret i32 0
-
-bb19955: ; preds = %cond_next201
- ret i32 0
-}
diff --git a/release_23/test/CodeGen/X86/2007-11-14-Coalescer-Bug.ll b/release_23/test/CodeGen/X86/2007-11-14-Coalescer-Bug.ll
deleted file mode 100644
index 5a8e4e4a6681..000000000000
--- a/release_23/test/CodeGen/X86/2007-11-14-Coalescer-Bug.ll
+++ /dev/null
@@ -1,67 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -x86-asm-syntax=att | grep movl | count 4
-
- %struct.double_int = type { i64, i64 }
- %struct.tree_common = type <{ i8, [3 x i8] }>
- %struct.tree_int_cst = type { %struct.tree_common, %struct.double_int }
- %struct.tree_node = type { %struct.tree_int_cst }
-@tree_code_type = external constant [0 x i32] ; <[0 x i32]*> [#uses=1]
-
-define i32 @simple_cst_equal(%struct.tree_node* %t1, %struct.tree_node* %t2) {
-entry:
- %tmp2526 = bitcast %struct.tree_node* %t1 to i32* ; <i32*> [#uses=1]
- br i1 false, label %UnifiedReturnBlock, label %bb21
-
-bb21: ; preds = %entry
- %tmp27 = load i32* %tmp2526, align 4 ; <i32> [#uses=1]
- %tmp29 = and i32 %tmp27, 255 ; <i32> [#uses=3]
- %tmp2930 = trunc i32 %tmp29 to i8 ; <i8> [#uses=1]
- %tmp37 = load i32* null, align 4 ; <i32> [#uses=1]
- %tmp39 = and i32 %tmp37, 255 ; <i32> [#uses=2]
- %tmp3940 = trunc i32 %tmp39 to i8 ; <i8> [#uses=1]
- %tmp43 = add i32 %tmp29, -3 ; <i32> [#uses=1]
- %tmp44 = icmp ult i32 %tmp43, 3 ; <i1> [#uses=1]
- br i1 %tmp44, label %bb47.split, label %bb76
-
-bb47.split: ; preds = %bb21
- ret i32 0
-
-bb76: ; preds = %bb21
- br i1 false, label %bb82, label %bb146.split
-
-bb82: ; preds = %bb76
- %tmp94 = getelementptr [0 x i32]* @tree_code_type, i32 0, i32 %tmp39 ; <i32*> [#uses=1]
- %tmp95 = load i32* %tmp94, align 4 ; <i32> [#uses=1]
- %tmp9596 = trunc i32 %tmp95 to i8 ; <i8> [#uses=1]
- %tmp98 = add i8 %tmp9596, -4 ; <i8> [#uses=1]
- %tmp99 = icmp ugt i8 %tmp98, 5 ; <i1> [#uses=1]
- br i1 %tmp99, label %bb102, label %bb106
-
-bb102: ; preds = %bb82
- ret i32 0
-
-bb106: ; preds = %bb82
- ret i32 0
-
-bb146.split: ; preds = %bb76
- %tmp149 = icmp eq i8 %tmp2930, %tmp3940 ; <i1> [#uses=1]
- br i1 %tmp149, label %bb153, label %UnifiedReturnBlock
-
-bb153: ; preds = %bb146.split
- switch i32 %tmp29, label %UnifiedReturnBlock [
- i32 0, label %bb155
- i32 1, label %bb187
- ]
-
-bb155: ; preds = %bb153
- ret i32 0
-
-bb187: ; preds = %bb153
- %tmp198 = icmp eq %struct.tree_node* %t1, %t2 ; <i1> [#uses=1]
- br i1 %tmp198, label %bb201, label %UnifiedReturnBlock
-
-bb201: ; preds = %bb187
- ret i32 0
-
-UnifiedReturnBlock: ; preds = %bb187, %bb153, %bb146.split, %entry
- ret i32 0
-}
diff --git a/release_23/test/CodeGen/X86/2007-11-30-LoadFolding-Bug.ll b/release_23/test/CodeGen/X86/2007-11-30-LoadFolding-Bug.ll
deleted file mode 100644
index c123eccef30a..000000000000
--- a/release_23/test/CodeGen/X86/2007-11-30-LoadFolding-Bug.ll
+++ /dev/null
@@ -1,81 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 -stats |& \
-; RUN: grep {1 .*folded into instructions}
-
-declare fastcc void @rdft(i32, i32, double*, i32*, double*)
-
-define fastcc void @mp_sqrt(i32 %n, i32 %radix, i32* %in, i32* %out, i32* %tmp1, i32* %tmp2, i32 %nfft, double* %tmp1fft, double* %tmp2fft, i32* %ip, double* %w) {
-entry:
- br label %bb.i5
-
-bb.i5: ; preds = %bb.i5, %entry
- %nfft_init.0.i = phi i32 [ 1, %entry ], [ %tmp7.i3, %bb.i5 ] ; <i32> [#uses=1]
- %tmp7.i3 = shl i32 %nfft_init.0.i, 1 ; <i32> [#uses=2]
- br i1 false, label %bb.i5, label %mp_unexp_mp2d.exit.i
-
-mp_unexp_mp2d.exit.i: ; preds = %bb.i5
- br i1 false, label %cond_next.i, label %cond_true.i
-
-cond_true.i: ; preds = %mp_unexp_mp2d.exit.i
- ret void
-
-cond_next.i: ; preds = %mp_unexp_mp2d.exit.i
- %tmp22.i = sdiv i32 0, 2 ; <i32> [#uses=2]
- br i1 false, label %cond_true29.i, label %cond_next36.i
-
-cond_true29.i: ; preds = %cond_next.i
- ret void
-
-cond_next36.i: ; preds = %cond_next.i
- store i32 %tmp22.i, i32* null, align 4
- %tmp8.i14.i = select i1 false, i32 1, i32 0 ; <i32> [#uses=1]
- br label %bb.i28.i
-
-bb.i28.i: ; preds = %bb.i28.i, %cond_next36.i
- %j.0.reg2mem.0.i16.i = phi i32 [ 0, %cond_next36.i ], [ %indvar.next39.i, %bb.i28.i ] ; <i32> [#uses=2]
- %din_addr.1.reg2mem.0.i17.i = phi double [ 0.000000e+00, %cond_next36.i ], [ %tmp16.i25.i, %bb.i28.i ] ; <double> [#uses=1]
- %tmp1.i18.i = fptosi double %din_addr.1.reg2mem.0.i17.i to i32 ; <i32> [#uses=2]
- %tmp4.i19.i = icmp slt i32 %tmp1.i18.i, %radix ; <i1> [#uses=1]
- %x.0.i21.i = select i1 %tmp4.i19.i, i32 %tmp1.i18.i, i32 0 ; <i32> [#uses=1]
- %tmp41.sum.i = add i32 %j.0.reg2mem.0.i16.i, 2 ; <i32> [#uses=0]
- %tmp1213.i23.i = sitofp i32 %x.0.i21.i to double ; <double> [#uses=1]
- %tmp15.i24.i = sub double 0.000000e+00, %tmp1213.i23.i ; <double> [#uses=1]
- %tmp16.i25.i = mul double 0.000000e+00, %tmp15.i24.i ; <double> [#uses=1]
- %indvar.next39.i = add i32 %j.0.reg2mem.0.i16.i, 1 ; <i32> [#uses=2]
- %exitcond40.i = icmp eq i32 %indvar.next39.i, %tmp8.i14.i ; <i1> [#uses=1]
- br i1 %exitcond40.i, label %mp_unexp_d2mp.exit29.i, label %bb.i28.i
-
-mp_unexp_d2mp.exit29.i: ; preds = %bb.i28.i
- %tmp46.i = sub i32 0, %tmp22.i ; <i32> [#uses=1]
- store i32 %tmp46.i, i32* null, align 4
- br i1 false, label %bb.i.i, label %mp_sqrt_init.exit
-
-bb.i.i: ; preds = %bb.i.i, %mp_unexp_d2mp.exit29.i
- br label %bb.i.i
-
-mp_sqrt_init.exit: ; preds = %mp_unexp_d2mp.exit29.i
- tail call fastcc void @mp_mul_csqu( i32 0, double* %tmp1fft )
- tail call fastcc void @rdft( i32 0, i32 -1, double* null, i32* %ip, double* %w )
- tail call fastcc void @mp_mul_d2i( i32 0, i32 %radix, i32 0, double* %tmp1fft, i32* %tmp2 )
- br i1 false, label %cond_false.i, label %cond_true36.i
-
-cond_true36.i: ; preds = %mp_sqrt_init.exit
- ret void
-
-cond_false.i: ; preds = %mp_sqrt_init.exit
- tail call fastcc void @mp_round( i32 0, i32 %radix, i32 0, i32* %out )
- tail call fastcc void @mp_add( i32 0, i32 %radix, i32* %tmp1, i32* %tmp2, i32* %tmp1 )
- tail call fastcc void @mp_sub( i32 0, i32 %radix, i32* %in, i32* %tmp2, i32* %tmp2 )
- tail call fastcc void @mp_round( i32 0, i32 %radix, i32 0, i32* %tmp1 )
- tail call fastcc void @mp_mul_d2i( i32 0, i32 %radix, i32 %tmp7.i3, double* %tmp2fft, i32* %tmp2 )
- ret void
-}
-
-declare fastcc void @mp_add(i32, i32, i32*, i32*, i32*)
-
-declare fastcc void @mp_sub(i32, i32, i32*, i32*, i32*)
-
-declare fastcc void @mp_round(i32, i32, i32, i32*)
-
-declare fastcc void @mp_mul_csqu(i32, double*)
-
-declare fastcc void @mp_mul_d2i(i32, i32, i32, double*, i32*)
diff --git a/release_23/test/CodeGen/X86/2007-11-30-TestLoadFolding.ll b/release_23/test/CodeGen/X86/2007-11-30-TestLoadFolding.ll
deleted file mode 100644
index f2e0cc5940ad..000000000000
--- a/release_23/test/CodeGen/X86/2007-11-30-TestLoadFolding.ll
+++ /dev/null
@@ -1,58 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -stats |& \
-; RUN: grep {1 .*folded into instructions}
-; RUN: llvm-as < %s | llc -march=x86 | grep cmp | count 3
-
- %struct.quad_struct = type { i32, i32, %struct.quad_struct*, %struct.quad_struct*, %struct.quad_struct*, %struct.quad_struct*, %struct.quad_struct* }
-
-define fastcc i32 @perimeter(%struct.quad_struct* %tree, i32 %size) {
-entry:
- %tree.idx7.val = load %struct.quad_struct** null ; <%struct.quad_struct*> [#uses=1]
- %tmp8.i51 = icmp eq %struct.quad_struct* %tree.idx7.val, null ; <i1> [#uses=2]
- br i1 %tmp8.i51, label %cond_next, label %cond_next.i52
-
-cond_next.i52: ; preds = %entry
- ret i32 0
-
-cond_next: ; preds = %entry
- %tmp59 = load i32* null, align 4 ; <i32> [#uses=1]
- %tmp70 = icmp eq i32 %tmp59, 2 ; <i1> [#uses=1]
- br i1 %tmp70, label %cond_true.i35, label %bb80
-
-cond_true.i35: ; preds = %cond_next
- %tmp14.i.i37 = load %struct.quad_struct** null, align 4 ; <%struct.quad_struct*> [#uses=1]
- %tmp3.i160 = load i32* null, align 4 ; <i32> [#uses=1]
- %tmp4.i161 = icmp eq i32 %tmp3.i160, 2 ; <i1> [#uses=1]
- br i1 %tmp4.i161, label %cond_true.i163, label %cond_false.i178
-
-cond_true.i163: ; preds = %cond_true.i35
- %tmp7.i162 = sdiv i32 %size, 4 ; <i32> [#uses=2]
- %tmp13.i168 = tail call fastcc i32 @sum_adjacent( %struct.quad_struct* null, i32 3, i32 2, i32 %tmp7.i162 ) ; <i32> [#uses=1]
- %tmp18.i11.i170 = getelementptr %struct.quad_struct* %tmp14.i.i37, i32 0, i32 4 ; <%struct.quad_struct**> [#uses=1]
- %tmp19.i12.i171 = load %struct.quad_struct** %tmp18.i11.i170, align 4 ; <%struct.quad_struct*> [#uses=1]
- %tmp21.i173 = tail call fastcc i32 @sum_adjacent( %struct.quad_struct* %tmp19.i12.i171, i32 3, i32 2, i32 %tmp7.i162 ) ; <i32> [#uses=1]
- %tmp22.i174 = add i32 %tmp21.i173, %tmp13.i168 ; <i32> [#uses=1]
- br i1 false, label %cond_true.i141, label %cond_false.i156
-
-cond_false.i178: ; preds = %cond_true.i35
- ret i32 0
-
-cond_true.i141: ; preds = %cond_true.i163
- %tmp7.i140 = sdiv i32 %size, 4 ; <i32> [#uses=1]
- %tmp21.i151 = tail call fastcc i32 @sum_adjacent( %struct.quad_struct* null, i32 3, i32 2, i32 %tmp7.i140 ) ; <i32> [#uses=0]
- ret i32 0
-
-cond_false.i156: ; preds = %cond_true.i163
- %tmp22.i44 = add i32 0, %tmp22.i174 ; <i32> [#uses=0]
- br i1 %tmp8.i51, label %bb22.i, label %cond_next.i
-
-bb80: ; preds = %cond_next
- ret i32 0
-
-cond_next.i: ; preds = %cond_false.i156
- ret i32 0
-
-bb22.i: ; preds = %cond_false.i156
- ret i32 0
-}
-
-declare fastcc i32 @sum_adjacent(%struct.quad_struct*, i32, i32, i32)
diff --git a/release_23/test/CodeGen/X86/2007-12-11-FoldImpDefSpill.ll b/release_23/test/CodeGen/X86/2007-12-11-FoldImpDefSpill.ll
deleted file mode 100644
index 84229cf49128..000000000000
--- a/release_23/test/CodeGen/X86/2007-12-11-FoldImpDefSpill.ll
+++ /dev/null
@@ -1,680 +0,0 @@
-; RUN: llvm-as < %s | llc -mtriple=i686-apple-darwin | not grep IMPLICIT_DEF
-
- %struct.__sbuf = type { i8*, i32 }
- %struct.ggBRDF = type { i32 (...)** }
- %"struct.ggBST<ggMaterial>" = type { %"struct.ggBSTNode<ggMaterial>"*, i32 }
- %"struct.ggBST<ggRasterSurfaceTexture>" = type { %"struct.ggBSTNode<ggRasterSurfaceTexture>"*, i32 }
- %"struct.ggBST<ggSolidTexture>" = type { %"struct.ggBSTNode<ggSolidTexture>"*, i32 }
- %"struct.ggBST<ggSpectrum>" = type { %"struct.ggBSTNode<ggSpectrum>"*, i32 }
- %"struct.ggBST<mrObjectRecord>" = type { %"struct.ggBSTNode<mrObjectRecord>"*, i32 }
- %"struct.ggBSTNode<ggMaterial>" = type { %"struct.ggBSTNode<ggMaterial>"*, %"struct.ggBSTNode<ggMaterial>"*, %struct.ggString, %struct.ggMaterial* }
- %"struct.ggBSTNode<ggRasterSurfaceTexture>" = type { %"struct.ggBSTNode<ggRasterSurfaceTexture>"*, %"struct.ggBSTNode<ggRasterSurfaceTexture>"*, %struct.ggString, %struct.ggRasterSurfaceTexture* }
- %"struct.ggBSTNode<ggSolidTexture>" = type { %"struct.ggBSTNode<ggSolidTexture>"*, %"struct.ggBSTNode<ggSolidTexture>"*, %struct.ggString, %struct.ggBRDF* }
- %"struct.ggBSTNode<ggSpectrum>" = type { %"struct.ggBSTNode<ggSpectrum>"*, %"struct.ggBSTNode<ggSpectrum>"*, %struct.ggString, %struct.ggSpectrum* }
- %"struct.ggBSTNode<mrObjectRecord>" = type { %"struct.ggBSTNode<mrObjectRecord>"*, %"struct.ggBSTNode<mrObjectRecord>"*, %struct.ggString, %struct.mrObjectRecord* }
- %"struct.ggDictionary<ggMaterial>" = type { %"struct.ggBST<ggMaterial>" }
- %"struct.ggDictionary<ggRasterSurfaceTexture>" = type { %"struct.ggBST<ggRasterSurfaceTexture>" }
- %"struct.ggDictionary<ggSolidTexture>" = type { %"struct.ggBST<ggSolidTexture>" }
- %"struct.ggDictionary<ggSpectrum>" = type { %"struct.ggBST<ggSpectrum>" }
- %"struct.ggDictionary<mrObjectRecord>" = type { %"struct.ggBST<mrObjectRecord>" }
- %struct.ggHAffineMatrix3 = type { %struct.ggHMatrix3 }
- %struct.ggHBoxMatrix3 = type { %struct.ggHAffineMatrix3 }
- %struct.ggHMatrix3 = type { [4 x [4 x double]] }
- %struct.ggMaterial = type { i32 (...)**, %struct.ggBRDF* }
- %struct.ggPoint3 = type { [3 x double] }
- %"struct.ggRGBPixel<char>" = type { [3 x i8], i8 }
- %"struct.ggRaster<ggRGBPixel<unsigned char> >" = type { i32, i32, %"struct.ggRGBPixel<char>"* }
- %struct.ggRasterSurfaceTexture = type { %"struct.ggRaster<ggRGBPixel<unsigned char> >"* }
- %struct.ggSolidNoise3 = type { i32, [256 x %struct.ggPoint3], [256 x i32] }
- %struct.ggSpectrum = type { [8 x float] }
- %struct.ggString = type { %"struct.ggString::StringRep"* }
- %"struct.ggString::StringRep" = type { i32, i32, [1 x i8] }
- %"struct.ggTrain<mrPixelRenderer*>" = type { %struct.ggBRDF**, i32, i32 }
- %struct.mrObjectRecord = type { %struct.ggHBoxMatrix3, %struct.ggHBoxMatrix3, %struct.mrSurfaceList, %struct.ggMaterial*, i32, %struct.ggRasterSurfaceTexture*, %struct.ggBRDF*, i32, i32 }
- %struct.mrScene = type { %struct.ggSpectrum, %struct.ggSpectrum, %struct.ggBRDF*, %struct.ggBRDF*, %struct.ggBRDF*, i32, double, %"struct.ggDictionary<mrObjectRecord>", %"struct.ggDictionary<ggRasterSurfaceTexture>", %"struct.ggDictionary<ggSolidTexture>", %"struct.ggDictionary<ggSpectrum>", %"struct.ggDictionary<ggMaterial>" }
- %struct.mrSurfaceList = type { %struct.ggBRDF, %"struct.ggTrain<mrPixelRenderer*>" }
- %"struct.std::__codecvt_abstract_base<char,char,__mbstate_t>" = type { %"struct.std::locale::facet" }
- %"struct.std::basic_ios<char,std::char_traits<char> >" = type { %"struct.std::ios_base", %"struct.std::basic_ostream<char,std::char_traits<char> >"*, i8, i8, %"struct.std::basic_streambuf<char,std::char_traits<char> >"*, %"struct.std::ctype<char>"*, %"struct.std::__codecvt_abstract_base<char,char,__mbstate_t>"*, %"struct.std::__codecvt_abstract_base<char,char,__mbstate_t>"* }
- %"struct.std::basic_istream<char,std::char_traits<char> >" = type { i32 (...)**, i32, %"struct.std::basic_ios<char,std::char_traits<char> >" }
- %"struct.std::basic_ostream<char,std::char_traits<char> >" = type { i32 (...)**, %"struct.std::basic_ios<char,std::char_traits<char> >" }
- %"struct.std::basic_streambuf<char,std::char_traits<char> >" = type { i32 (...)**, i8*, i8*, i8*, i8*, i8*, i8*, %"struct.std::locale" }
- %"struct.std::ctype<char>" = type { %"struct.std::locale::facet", i32*, i8, i32*, i32*, i32*, i8, [256 x i8], [256 x i8], i8 }
- %"struct.std::ios_base" = type { i32 (...)**, i32, i32, i32, i32, i32, %"struct.std::ios_base::_Callback_list"*, %struct.__sbuf, [8 x %struct.__sbuf], i32, %struct.__sbuf*, %"struct.std::locale" }
- %"struct.std::ios_base::_Callback_list" = type { %"struct.std::ios_base::_Callback_list"*, void (i32, %"struct.std::ios_base"*, i32)*, i32, i32 }
- %"struct.std::locale" = type { %"struct.std::locale::_Impl"* }
- %"struct.std::locale::_Impl" = type { i32, %"struct.std::locale::facet"**, i32, %"struct.std::locale::facet"**, i8** }
- %"struct.std::locale::facet" = type { i32 (...)**, i32 }
-@.str80 = external constant [7 x i8] ; <[7 x i8]*> [#uses=1]
-@.str81 = external constant [11 x i8] ; <[11 x i8]*> [#uses=1]
-
-define fastcc void @_ZN7mrScene4ReadERSi(%struct.mrScene* %this, %"struct.std::basic_istream<char,std::char_traits<char> >"* %surfaces) {
-entry:
- %tmp6.i.i8288 = invoke i8* @_Znam( i32 12 )
- to label %_ZN8ggStringC1Ei.exit unwind label %lpad ; <i8*> [#uses=0]
-
-_ZN8ggStringC1Ei.exit: ; preds = %entry
- %tmp6.i.i8995 = invoke i8* @_Znam( i32 12 )
- to label %_ZN8ggStringC1Ei.exit96 unwind label %lpad3825 ; <i8*> [#uses=0]
-
-_ZN8ggStringC1Ei.exit96: ; preds = %_ZN8ggStringC1Ei.exit
- %tmp6.i.i97103 = invoke i8* @_Znam( i32 12 )
- to label %_ZN8ggStringC1Ei.exit104 unwind label %lpad3829 ; <i8*> [#uses=0]
-
-_ZN8ggStringC1Ei.exit104: ; preds = %_ZN8ggStringC1Ei.exit96
- %tmp6.i.i105111 = invoke i8* @_Znam( i32 12 )
- to label %_ZN8ggStringC1Ei.exit112 unwind label %lpad3833 ; <i8*> [#uses=0]
-
-_ZN8ggStringC1Ei.exit112: ; preds = %_ZN8ggStringC1Ei.exit104
- %tmp6.i.i122128 = invoke i8* @_Znam( i32 12 )
- to label %_ZN8ggStringC1Ei.exit129 unwind label %lpad3837 ; <i8*> [#uses=0]
-
-_ZN8ggStringC1Ei.exit129: ; preds = %_ZN8ggStringC1Ei.exit112
- %tmp6.i.i132138 = invoke i8* @_Znam( i32 12 )
- to label %_ZN8ggStringC1Ei.exit139 unwind label %lpad3841 ; <i8*> [#uses=0]
-
-_ZN8ggStringC1Ei.exit139: ; preds = %_ZN8ggStringC1Ei.exit129
- %tmp295 = invoke i8* @_Znwm( i32 16 )
- to label %invcont294 unwind label %lpad3845 ; <i8*> [#uses=0]
-
-invcont294: ; preds = %_ZN8ggStringC1Ei.exit139
- %tmp10.i.i141 = invoke i8* @_Znam( i32 16 )
- to label %_ZN13mrSurfaceListC1Ev.exit unwind label %lpad3849 ; <i8*> [#uses=0]
-
-_ZN13mrSurfaceListC1Ev.exit: ; preds = %invcont294
- %tmp3.i148 = invoke %"struct.std::basic_istream<char,std::char_traits<char> >"* @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_PS3_( %"struct.std::basic_istream<char,std::char_traits<char> >"* %surfaces, i8* null )
- to label %tmp3.i.noexc unwind label %lpad3845 ; <%"struct.std::basic_istream<char,std::char_traits<char> >"*> [#uses=0]
-
-tmp3.i.noexc: ; preds = %_ZN13mrSurfaceListC1Ev.exit
- %tmp15.i149 = invoke i8* @_ZNKSt9basic_iosIcSt11char_traitsIcEEcvPvEv( %"struct.std::basic_ios<char,std::char_traits<char> >"* null )
- to label %tmp15.i.noexc unwind label %lpad3845 ; <i8*> [#uses=0]
-
-tmp15.i.noexc: ; preds = %tmp3.i.noexc
- br i1 false, label %bb308, label %bb.i
-
-bb.i: ; preds = %tmp15.i.noexc
- ret void
-
-bb308: ; preds = %tmp15.i.noexc
- br i1 false, label %bb3743.preheader, label %bb315
-
-bb3743.preheader: ; preds = %bb308
- %tmp16.i3862 = getelementptr %struct.ggPoint3* null, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp16.i3859 = getelementptr %struct.ggPoint3* null, i32 0, i32 0, i32 0 ; <double*> [#uses=3]
- br label %bb3743
-
-bb315: ; preds = %bb308
- ret void
-
-bb333: ; preds = %invcont3758, %invcont335
- %tmp3.i167180 = invoke %"struct.std::basic_istream<char,std::char_traits<char> >"* @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_PS3_( %"struct.std::basic_istream<char,std::char_traits<char> >"* %surfaces, i8* null )
- to label %tmp3.i167.noexc unwind label %lpad3845 ; <%"struct.std::basic_istream<char,std::char_traits<char> >"*> [#uses=0]
-
-tmp3.i167.noexc: ; preds = %bb333
- %tmp15.i182 = invoke i8* @_ZNKSt9basic_iosIcSt11char_traitsIcEEcvPvEv( %"struct.std::basic_ios<char,std::char_traits<char> >"* null )
- to label %tmp15.i.noexc181 unwind label %lpad3845 ; <i8*> [#uses=0]
-
-tmp15.i.noexc181: ; preds = %tmp3.i167.noexc
- br i1 false, label %invcont335, label %bb.i178
-
-bb.i178: ; preds = %tmp15.i.noexc181
- ret void
-
-invcont335: ; preds = %tmp15.i.noexc181
- br i1 false, label %bb3743, label %bb333
-
-bb345: ; preds = %invcont3758
- br i1 false, label %bb353, label %bb360
-
-bb353: ; preds = %bb345
- %tmp356 = invoke %"struct.std::basic_istream<char,std::char_traits<char> >"* @_ZNSirsERd( %"struct.std::basic_istream<char,std::char_traits<char> >"* %surfaces, double* null )
- to label %bb3743 unwind label %lpad3845 ; <%"struct.std::basic_istream<char,std::char_traits<char> >"*> [#uses=0]
-
-bb360: ; preds = %bb345
- br i1 false, label %bb368, label %bb374
-
-bb368: ; preds = %bb360
- %tmp373 = invoke %"struct.std::basic_istream<char,std::char_traits<char> >"* @_ZNSirsERd( %"struct.std::basic_istream<char,std::char_traits<char> >"* %surfaces, double* null )
- to label %bb3743 unwind label %lpad3845 ; <%"struct.std::basic_istream<char,std::char_traits<char> >"*> [#uses=0]
-
-bb374: ; preds = %bb360
- br i1 false, label %bb396, label %bb421
-
-bb396: ; preds = %bb374
- ret void
-
-bb421: ; preds = %bb374
- br i1 false, label %bb429, label %bb530
-
-bb429: ; preds = %bb421
- ret void
-
-bb530: ; preds = %bb421
- br i1 false, label %bb538, label %bb673
-
-bb538: ; preds = %bb530
- ret void
-
-bb673: ; preds = %bb530
- br i1 false, label %bb681, label %bb778
-
-bb681: ; preds = %bb673
- ret void
-
-bb778: ; preds = %bb673
- br i1 false, label %bb786, label %bb891
-
-bb786: ; preds = %bb778
- ret void
-
-bb891: ; preds = %bb778
- br i1 false, label %bb899, label %bb998
-
-bb899: ; preds = %bb891
- ret void
-
-bb998: ; preds = %bb891
- br i1 false, label %bb1168, label %bb1190
-
-bb1168: ; preds = %bb998
- ret void
-
-bb1190: ; preds = %bb998
- br i1 false, label %bb1198, label %bb1220
-
-bb1198: ; preds = %bb1190
- ret void
-
-bb1220: ; preds = %bb1190
- br i1 false, label %bb1228, label %bb1250
-
-bb1228: ; preds = %bb1220
- ret void
-
-bb1250: ; preds = %bb1220
- br i1 false, label %bb1258, label %bb1303
-
-bb1258: ; preds = %bb1250
- ret void
-
-bb1303: ; preds = %bb1250
- br i1 false, label %bb1311, label %bb1366
-
-bb1311: ; preds = %bb1303
- ret void
-
-bb1366: ; preds = %bb1303
- br i1 false, label %bb1374, label %bb1432
-
-bb1374: ; preds = %bb1366
- ret void
-
-bb1432: ; preds = %bb1366
- br i1 false, label %bb1440, label %bb1495
-
-bb1440: ; preds = %bb1432
- ret void
-
-bb1495: ; preds = %bb1432
- br i1 false, label %bb1503, label %bb1561
-
-bb1503: ; preds = %bb1495
- ret void
-
-bb1561: ; preds = %bb1495
- br i1 false, label %bb1569, label %bb1624
-
-bb1569: ; preds = %bb1561
- ret void
-
-bb1624: ; preds = %bb1561
- br i1 false, label %bb1632, label %bb1654
-
-bb1632: ; preds = %bb1624
- store double 0.000000e+00, double* %tmp16.i3859, align 8
- %tmp3.i38383852 = invoke %"struct.std::basic_istream<char,std::char_traits<char> >"* @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_PS3_( %"struct.std::basic_istream<char,std::char_traits<char> >"* %surfaces, i8* null )
- to label %tmp3.i3838.noexc unwind label %lpad3845 ; <%"struct.std::basic_istream<char,std::char_traits<char> >"*> [#uses=0]
-
-tmp3.i3838.noexc: ; preds = %bb1632
- %tmp15.i38473853 = invoke i8* @_ZNKSt9basic_iosIcSt11char_traitsIcEEcvPvEv( %"struct.std::basic_ios<char,std::char_traits<char> >"* null )
- to label %tmp15.i3847.noexc unwind label %lpad3845 ; <i8*> [#uses=0]
-
-tmp15.i3847.noexc: ; preds = %tmp3.i3838.noexc
- br i1 false, label %invcont1634, label %bb.i3850
-
-bb.i3850: ; preds = %tmp15.i3847.noexc
- ret void
-
-invcont1634: ; preds = %tmp15.i3847.noexc
- %tmp3.i38173831 = invoke %"struct.std::basic_istream<char,std::char_traits<char> >"* @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_PS3_( %"struct.std::basic_istream<char,std::char_traits<char> >"* %surfaces, i8* null )
- to label %tmp3.i3817.noexc unwind label %lpad3845 ; <%"struct.std::basic_istream<char,std::char_traits<char> >"*> [#uses=0]
-
-tmp3.i3817.noexc: ; preds = %invcont1634
- %tmp15.i38263832 = invoke i8* @_ZNKSt9basic_iosIcSt11char_traitsIcEEcvPvEv( %"struct.std::basic_ios<char,std::char_traits<char> >"* null )
- to label %tmp15.i3826.noexc unwind label %lpad3845 ; <i8*> [#uses=0]
-
-tmp15.i3826.noexc: ; preds = %tmp3.i3817.noexc
- br i1 false, label %invcont1636, label %bb.i3829
-
-bb.i3829: ; preds = %tmp15.i3826.noexc
- ret void
-
-invcont1636: ; preds = %tmp15.i3826.noexc
- %tmp8.i38083811 = invoke %"struct.std::basic_istream<char,std::char_traits<char> >"* @_ZNSirsERd( %"struct.std::basic_istream<char,std::char_traits<char> >"* %surfaces, double* %tmp16.i3862 )
- to label %tmp8.i3808.noexc unwind label %lpad3845 ; <%"struct.std::basic_istream<char,std::char_traits<char> >"*> [#uses=1]
-
-tmp8.i3808.noexc: ; preds = %invcont1636
- %tmp9.i38093812 = invoke %"struct.std::basic_istream<char,std::char_traits<char> >"* @_ZNSirsERd( %"struct.std::basic_istream<char,std::char_traits<char> >"* %tmp8.i38083811, double* null )
- to label %tmp9.i3809.noexc unwind label %lpad3845 ; <%"struct.std::basic_istream<char,std::char_traits<char> >"*> [#uses=1]
-
-tmp9.i3809.noexc: ; preds = %tmp8.i3808.noexc
- %tmp10.i38103813 = invoke %"struct.std::basic_istream<char,std::char_traits<char> >"* @_ZNSirsERd( %"struct.std::basic_istream<char,std::char_traits<char> >"* %tmp9.i38093812, double* null )
- to label %invcont1638 unwind label %lpad3845 ; <%"struct.std::basic_istream<char,std::char_traits<char> >"*> [#uses=0]
-
-invcont1638: ; preds = %tmp9.i3809.noexc
- %tmp8.i37983801 = invoke %"struct.std::basic_istream<char,std::char_traits<char> >"* @_ZNSirsERd( %"struct.std::basic_istream<char,std::char_traits<char> >"* %surfaces, double* %tmp16.i3859 )
- to label %tmp8.i3798.noexc unwind label %lpad3845 ; <%"struct.std::basic_istream<char,std::char_traits<char> >"*> [#uses=1]
-
-tmp8.i3798.noexc: ; preds = %invcont1638
- %tmp9.i37993802 = invoke %"struct.std::basic_istream<char,std::char_traits<char> >"* @_ZNSirsERd( %"struct.std::basic_istream<char,std::char_traits<char> >"* %tmp8.i37983801, double* null )
- to label %tmp9.i3799.noexc unwind label %lpad3845 ; <%"struct.std::basic_istream<char,std::char_traits<char> >"*> [#uses=1]
-
-tmp9.i3799.noexc: ; preds = %tmp8.i3798.noexc
- %tmp10.i38003803 = invoke %"struct.std::basic_istream<char,std::char_traits<char> >"* @_ZNSirsERd( %"struct.std::basic_istream<char,std::char_traits<char> >"* %tmp9.i37993802, double* null )
- to label %invcont1640 unwind label %lpad3845 ; <%"struct.std::basic_istream<char,std::char_traits<char> >"*> [#uses=0]
-
-invcont1640: ; preds = %tmp9.i3799.noexc
- %tmp3.i3778 = load double* %tmp16.i3859, align 8 ; <double> [#uses=1]
- %tmp1643 = invoke i8* @_Znwm( i32 76 )
- to label %invcont1642 unwind label %lpad3845 ; <i8*> [#uses=0]
-
-invcont1642: ; preds = %invcont1640
- %tmp18.i3770 = sub double %tmp3.i3778, 0.000000e+00 ; <double> [#uses=0]
- invoke fastcc void @_ZN7mrScene9AddObjectEP9mrSurfaceRK8ggStringS4_i( %struct.mrScene* %this, %struct.ggBRDF* null, %struct.ggString* null, %struct.ggString* null, i32 0 )
- to label %bb3743 unwind label %lpad3845
-
-bb1654: ; preds = %bb1624
- br i1 false, label %bb1662, label %bb1693
-
-bb1662: ; preds = %bb1654
- %tmp3.i37143728 = invoke %"struct.std::basic_istream<char,std::char_traits<char> >"* @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_PS3_( %"struct.std::basic_istream<char,std::char_traits<char> >"* %surfaces, i8* null )
- to label %tmp3.i3714.noexc unwind label %lpad3845 ; <%"struct.std::basic_istream<char,std::char_traits<char> >"*> [#uses=0]
-
-tmp3.i3714.noexc: ; preds = %bb1662
- %tmp15.i37233729 = invoke i8* @_ZNKSt9basic_iosIcSt11char_traitsIcEEcvPvEv( %"struct.std::basic_ios<char,std::char_traits<char> >"* null )
- to label %tmp15.i3723.noexc unwind label %lpad3845 ; <i8*> [#uses=0]
-
-tmp15.i3723.noexc: ; preds = %tmp3.i3714.noexc
- ret void
-
-bb1693: ; preds = %bb1654
- br i1 false, label %bb1701, label %bb1745
-
-bb1701: ; preds = %bb1693
- %tmp3.i36493663 = invoke %"struct.std::basic_istream<char,std::char_traits<char> >"* @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_PS3_( %"struct.std::basic_istream<char,std::char_traits<char> >"* %surfaces, i8* null )
- to label %tmp3.i3649.noexc unwind label %lpad3845 ; <%"struct.std::basic_istream<char,std::char_traits<char> >"*> [#uses=0]
-
-tmp3.i3649.noexc: ; preds = %bb1701
- ret void
-
-bb1745: ; preds = %bb1693
- br i1 false, label %bb1753, label %bb1797
-
-bb1753: ; preds = %bb1745
- ret void
-
-bb1797: ; preds = %bb1745
- br i1 false, label %bb1805, label %bb1847
-
-bb1805: ; preds = %bb1797
- ret void
-
-bb1847: ; preds = %bb1797
- br i1 false, label %bb1855, label %bb1897
-
-bb1855: ; preds = %bb1847
- %tmp3.i34633477 = invoke %"struct.std::basic_istream<char,std::char_traits<char> >"* @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_PS3_( %"struct.std::basic_istream<char,std::char_traits<char> >"* %surfaces, i8* null )
- to label %tmp3.i3463.noexc unwind label %lpad3845 ; <%"struct.std::basic_istream<char,std::char_traits<char> >"*> [#uses=0]
-
-tmp3.i3463.noexc: ; preds = %bb1855
- %tmp15.i34723478 = invoke i8* @_ZNKSt9basic_iosIcSt11char_traitsIcEEcvPvEv( %"struct.std::basic_ios<char,std::char_traits<char> >"* null )
- to label %tmp15.i3472.noexc unwind label %lpad3845 ; <i8*> [#uses=0]
-
-tmp15.i3472.noexc: ; preds = %tmp3.i3463.noexc
- br i1 false, label %invcont1857, label %bb.i3475
-
-bb.i3475: ; preds = %tmp15.i3472.noexc
- invoke fastcc void @_ZN8ggStringaSEPKc( %struct.ggString* null, i8* null )
- to label %invcont1857 unwind label %lpad3845
-
-invcont1857: ; preds = %bb.i3475, %tmp15.i3472.noexc
- %tmp1860 = invoke %"struct.std::basic_istream<char,std::char_traits<char> >"* @_ZNSirsERd( %"struct.std::basic_istream<char,std::char_traits<char> >"* %surfaces, double* null )
- to label %invcont1859 unwind label %lpad3845 ; <%"struct.std::basic_istream<char,std::char_traits<char> >"*> [#uses=1]
-
-invcont1859: ; preds = %invcont1857
- %tmp1862 = invoke %"struct.std::basic_istream<char,std::char_traits<char> >"* @_ZNSirsERd( %"struct.std::basic_istream<char,std::char_traits<char> >"* %tmp1860, double* null )
- to label %invcont1861 unwind label %lpad3845 ; <%"struct.std::basic_istream<char,std::char_traits<char> >"*> [#uses=1]
-
-invcont1861: ; preds = %invcont1859
- %tmp1864 = invoke %"struct.std::basic_istream<char,std::char_traits<char> >"* @_ZNSirsERd( %"struct.std::basic_istream<char,std::char_traits<char> >"* %tmp1862, double* null )
- to label %invcont1863 unwind label %lpad3845 ; <%"struct.std::basic_istream<char,std::char_traits<char> >"*> [#uses=1]
-
-invcont1863: ; preds = %invcont1861
- %tmp1866 = invoke %"struct.std::basic_istream<char,std::char_traits<char> >"* @_ZNSirsERd( %"struct.std::basic_istream<char,std::char_traits<char> >"* %tmp1864, double* null )
- to label %invcont1865 unwind label %lpad3845 ; <%"struct.std::basic_istream<char,std::char_traits<char> >"*> [#uses=1]
-
-invcont1865: ; preds = %invcont1863
- %tmp1868 = invoke %"struct.std::basic_istream<char,std::char_traits<char> >"* @_ZNSirsERd( %"struct.std::basic_istream<char,std::char_traits<char> >"* %tmp1866, double* null )
- to label %invcont1867 unwind label %lpad3845 ; <%"struct.std::basic_istream<char,std::char_traits<char> >"*> [#uses=0]
-
-invcont1867: ; preds = %invcont1865
- %tmp1881 = invoke i8 @_ZNKSt9basic_iosIcSt11char_traitsIcEE4goodEv( %"struct.std::basic_ios<char,std::char_traits<char> >"* null ) zeroext
- to label %invcont1880 unwind label %lpad3845 ; <i8> [#uses=0]
-
-invcont1880: ; preds = %invcont1867
- %tmp1883 = invoke i8* @_Znwm( i32 24 )
- to label %invcont1882 unwind label %lpad3845 ; <i8*> [#uses=0]
-
-invcont1882: ; preds = %invcont1880
- invoke fastcc void @_ZN7mrScene9AddObjectEP9mrSurfaceRK8ggStringS4_i( %struct.mrScene* %this, %struct.ggBRDF* null, %struct.ggString* null, %struct.ggString* null, i32 0 )
- to label %bb3743 unwind label %lpad3845
-
-bb1897: ; preds = %bb1847
- br i1 false, label %bb1905, label %bb1947
-
-bb1905: ; preds = %bb1897
- ret void
-
-bb1947: ; preds = %bb1897
- br i1 false, label %bb1955, label %bb2000
-
-bb1955: ; preds = %bb1947
- ret void
-
-bb2000: ; preds = %bb1947
- br i1 false, label %bb2008, label %bb2053
-
-bb2008: ; preds = %bb2000
- ret void
-
-bb2053: ; preds = %bb2000
- br i1 false, label %bb2061, label %bb2106
-
-bb2061: ; preds = %bb2053
- %tmp3.i32433257 = invoke %"struct.std::basic_istream<char,std::char_traits<char> >"* @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_PS3_( %"struct.std::basic_istream<char,std::char_traits<char> >"* %surfaces, i8* null )
- to label %tmp3.i3243.noexc unwind label %lpad3845 ; <%"struct.std::basic_istream<char,std::char_traits<char> >"*> [#uses=0]
-
-tmp3.i3243.noexc: ; preds = %bb2061
- %tmp15.i32523258 = invoke i8* @_ZNKSt9basic_iosIcSt11char_traitsIcEEcvPvEv( %"struct.std::basic_ios<char,std::char_traits<char> >"* null )
- to label %bb.i3255 unwind label %lpad3845 ; <i8*> [#uses=0]
-
-bb.i3255: ; preds = %tmp3.i3243.noexc
- invoke fastcc void @_ZN8ggStringaSEPKc( %struct.ggString* null, i8* null )
- to label %invcont2063 unwind label %lpad3845
-
-invcont2063: ; preds = %bb.i3255
- ret void
-
-bb2106: ; preds = %bb2053
- %tmp7.i3214 = call i32 @strcmp( i8* %tmp5.i161, i8* getelementptr ([7 x i8]* @.str80, i32 0, i32 0) ) nounwind readonly ; <i32> [#uses=0]
- br i1 false, label %bb2114, label %bb2136
-
-bb2114: ; preds = %bb2106
- %tmp3.i31923206 = invoke %"struct.std::basic_istream<char,std::char_traits<char> >"* @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_PS3_( %"struct.std::basic_istream<char,std::char_traits<char> >"* %surfaces, i8* null )
- to label %tmp3.i3192.noexc unwind label %lpad3845 ; <%"struct.std::basic_istream<char,std::char_traits<char> >"*> [#uses=0]
-
-tmp3.i3192.noexc: ; preds = %bb2114
- %tmp15.i32013207 = invoke i8* @_ZNKSt9basic_iosIcSt11char_traitsIcEEcvPvEv( %"struct.std::basic_ios<char,std::char_traits<char> >"* null )
- to label %tmp15.i3201.noexc unwind label %lpad3845 ; <i8*> [#uses=0]
-
-tmp15.i3201.noexc: ; preds = %tmp3.i3192.noexc
- br i1 false, label %invcont2116, label %bb.i3204
-
-bb.i3204: ; preds = %tmp15.i3201.noexc
- ret void
-
-invcont2116: ; preds = %tmp15.i3201.noexc
- %tmp3.i31713185 = invoke %"struct.std::basic_istream<char,std::char_traits<char> >"* @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_PS3_( %"struct.std::basic_istream<char,std::char_traits<char> >"* %surfaces, i8* null )
- to label %tmp3.i3171.noexc unwind label %lpad3845 ; <%"struct.std::basic_istream<char,std::char_traits<char> >"*> [#uses=0]
-
-tmp3.i3171.noexc: ; preds = %invcont2116
- %tmp15.i31803186 = invoke i8* @_ZNKSt9basic_iosIcSt11char_traitsIcEEcvPvEv( %"struct.std::basic_ios<char,std::char_traits<char> >"* null )
- to label %tmp15.i3180.noexc unwind label %lpad3845 ; <i8*> [#uses=0]
-
-tmp15.i3180.noexc: ; preds = %tmp3.i3171.noexc
- br i1 false, label %invcont2118, label %bb.i3183
-
-bb.i3183: ; preds = %tmp15.i3180.noexc
- ret void
-
-invcont2118: ; preds = %tmp15.i3180.noexc
- %tmp8.i31623165 = invoke %"struct.std::basic_istream<char,std::char_traits<char> >"* @_ZNSirsERd( %"struct.std::basic_istream<char,std::char_traits<char> >"* %surfaces, double* null )
- to label %tmp8.i3162.noexc unwind label %lpad3845 ; <%"struct.std::basic_istream<char,std::char_traits<char> >"*> [#uses=1]
-
-tmp8.i3162.noexc: ; preds = %invcont2118
- %tmp9.i31633166 = invoke %"struct.std::basic_istream<char,std::char_traits<char> >"* @_ZNSirsERd( %"struct.std::basic_istream<char,std::char_traits<char> >"* %tmp8.i31623165, double* null )
- to label %tmp9.i3163.noexc unwind label %lpad3845 ; <%"struct.std::basic_istream<char,std::char_traits<char> >"*> [#uses=1]
-
-tmp9.i3163.noexc: ; preds = %tmp8.i3162.noexc
- %tmp10.i31643167 = invoke %"struct.std::basic_istream<char,std::char_traits<char> >"* @_ZNSirsERd( %"struct.std::basic_istream<char,std::char_traits<char> >"* %tmp9.i31633166, double* null )
- to label %invcont2120 unwind label %lpad3845 ; <%"struct.std::basic_istream<char,std::char_traits<char> >"*> [#uses=0]
-
-invcont2120: ; preds = %tmp9.i3163.noexc
- %tmp2123 = invoke %"struct.std::basic_istream<char,std::char_traits<char> >"* @_ZNSirsERd( %"struct.std::basic_istream<char,std::char_traits<char> >"* %surfaces, double* null )
- to label %invcont2122 unwind label %lpad3845 ; <%"struct.std::basic_istream<char,std::char_traits<char> >"*> [#uses=0]
-
-invcont2122: ; preds = %invcont2120
- %tmp2125 = invoke i8* @_Znwm( i32 36 )
- to label %invcont2124 unwind label %lpad3845 ; <i8*> [#uses=0]
-
-invcont2124: ; preds = %invcont2122
- invoke fastcc void @_ZN7mrScene9AddObjectEP9mrSurfaceRK8ggStringS4_i( %struct.mrScene* %this, %struct.ggBRDF* null, %struct.ggString* null, %struct.ggString* null, i32 0 )
- to label %bb3743 unwind label %lpad3845
-
-bb2136: ; preds = %bb2106
- %tmp7.i3128 = call i32 @strcmp( i8* %tmp5.i161, i8* getelementptr ([11 x i8]* @.str81, i32 0, i32 0) ) nounwind readonly ; <i32> [#uses=0]
- br i1 false, label %bb2144, label %bb3336
-
-bb2144: ; preds = %bb2136
- %tmp6.i.i31173123 = invoke i8* @_Znam( i32 12 )
- to label %_ZN8ggStringC1Ei.exit3124 unwind label %lpad3845 ; <i8*> [#uses=0]
-
-_ZN8ggStringC1Ei.exit3124: ; preds = %bb2144
- %tmp3.i30983112 = invoke %"struct.std::basic_istream<char,std::char_traits<char> >"* @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_PS3_( %"struct.std::basic_istream<char,std::char_traits<char> >"* %surfaces, i8* null )
- to label %tmp3.i3098.noexc unwind label %lpad3921 ; <%"struct.std::basic_istream<char,std::char_traits<char> >"*> [#uses=0]
-
-tmp3.i3098.noexc: ; preds = %_ZN8ggStringC1Ei.exit3124
- %tmp15.i31073113 = invoke i8* @_ZNKSt9basic_iosIcSt11char_traitsIcEEcvPvEv( %"struct.std::basic_ios<char,std::char_traits<char> >"* null )
- to label %tmp15.i3107.noexc unwind label %lpad3921 ; <i8*> [#uses=0]
-
-tmp15.i3107.noexc: ; preds = %tmp3.i3098.noexc
- br i1 false, label %invcont2147, label %bb.i3110
-
-bb.i3110: ; preds = %tmp15.i3107.noexc
- ret void
-
-invcont2147: ; preds = %tmp15.i3107.noexc
- %tmp2161 = invoke i8 @_ZNKSt9basic_iosIcSt11char_traitsIcEE4goodEv( %"struct.std::basic_ios<char,std::char_traits<char> >"* null ) zeroext
- to label %invcont2160 unwind label %lpad3921 ; <i8> [#uses=0]
-
-invcont2160: ; preds = %invcont2147
- %tmp4.i30933094 = invoke fastcc %struct.ggSpectrum* @_ZN5ggBSTI10ggSpectrumE4findERK8ggString3( %"struct.ggBSTNode<ggSpectrum>"* null, %struct.ggString* null )
- to label %invcont2164 unwind label %lpad3921 ; <%struct.ggSpectrum*> [#uses=0]
-
-invcont2164: ; preds = %invcont2160
- br i1 false, label %bb2170, label %bb2181
-
-bb2170: ; preds = %invcont2164
- ret void
-
-bb2181: ; preds = %invcont2164
- invoke fastcc void @_ZN8ggStringD1Ev( %struct.ggString* null )
- to label %bb3743 unwind label %lpad3845
-
-bb3336: ; preds = %bb2136
- br i1 false, label %bb3344, label %bb3734
-
-bb3344: ; preds = %bb3336
- %tmp6.i.i773779 = invoke i8* @_Znam( i32 12 )
- to label %_ZN8ggStringC1Ei.exit780 unwind label %lpad3845 ; <i8*> [#uses=0]
-
-_ZN8ggStringC1Ei.exit780: ; preds = %bb3344
- %tmp6.i.i765771 = invoke i8* @_Znam( i32 12 )
- to label %_ZN8ggStringC1Ei.exit772 unwind label %lpad4025 ; <i8*> [#uses=0]
-
-_ZN8ggStringC1Ei.exit772: ; preds = %_ZN8ggStringC1Ei.exit780
- %tmp3.i746760 = invoke %"struct.std::basic_istream<char,std::char_traits<char> >"* @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_PS3_( %"struct.std::basic_istream<char,std::char_traits<char> >"* %surfaces, i8* null )
- to label %tmp3.i746.noexc unwind label %lpad4029 ; <%"struct.std::basic_istream<char,std::char_traits<char> >"*> [#uses=0]
-
-tmp3.i746.noexc: ; preds = %_ZN8ggStringC1Ei.exit772
- %tmp15.i755761 = invoke i8* @_ZNKSt9basic_iosIcSt11char_traitsIcEEcvPvEv( %"struct.std::basic_ios<char,std::char_traits<char> >"* null )
- to label %tmp15.i755.noexc unwind label %lpad4029 ; <i8*> [#uses=0]
-
-tmp15.i755.noexc: ; preds = %tmp3.i746.noexc
- br i1 false, label %invcont3348, label %bb.i758
-
-bb.i758: ; preds = %tmp15.i755.noexc
- ret void
-
-invcont3348: ; preds = %tmp15.i755.noexc
- %tmp3.i726740 = invoke %"struct.std::basic_istream<char,std::char_traits<char> >"* @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_PS3_( %"struct.std::basic_istream<char,std::char_traits<char> >"* %surfaces, i8* null )
- to label %tmp3.i726.noexc unwind label %lpad4029 ; <%"struct.std::basic_istream<char,std::char_traits<char> >"*> [#uses=0]
-
-tmp3.i726.noexc: ; preds = %invcont3348
- %tmp15.i735741 = invoke i8* @_ZNKSt9basic_iosIcSt11char_traitsIcEEcvPvEv( %"struct.std::basic_ios<char,std::char_traits<char> >"* null )
- to label %tmp15.i735.noexc unwind label %lpad4029 ; <i8*> [#uses=0]
-
-tmp15.i735.noexc: ; preds = %tmp3.i726.noexc
- br i1 false, label %bb3458, label %bb.i738
-
-bb.i738: ; preds = %tmp15.i735.noexc
- ret void
-
-bb3458: ; preds = %tmp15.i735.noexc
- br i1 false, label %bb3466, label %bb3491
-
-bb3466: ; preds = %bb3458
- %tmp3469 = invoke %"struct.std::basic_istream<char,std::char_traits<char> >"* @_ZNSirsERd( %"struct.std::basic_istream<char,std::char_traits<char> >"* %surfaces, double* null )
- to label %invcont3468 unwind label %lpad4029 ; <%"struct.std::basic_istream<char,std::char_traits<char> >"*> [#uses=1]
-
-invcont3468: ; preds = %bb3466
- %tmp3471 = invoke %"struct.std::basic_istream<char,std::char_traits<char> >"* @_ZNSirsERd( %"struct.std::basic_istream<char,std::char_traits<char> >"* %tmp3469, double* null )
- to label %invcont3470 unwind label %lpad4029 ; <%"struct.std::basic_istream<char,std::char_traits<char> >"*> [#uses=1]
-
-invcont3470: ; preds = %invcont3468
- %tmp3473 = invoke %"struct.std::basic_istream<char,std::char_traits<char> >"* @_ZNSirsERi( %"struct.std::basic_istream<char,std::char_traits<char> >"* %tmp3471, i32* null )
- to label %invcont3472 unwind label %lpad4029 ; <%"struct.std::basic_istream<char,std::char_traits<char> >"*> [#uses=0]
-
-invcont3472: ; preds = %invcont3470
- %tmp3475 = invoke i8* @_Znwm( i32 7196 )
- to label %invcont3474 unwind label %lpad4029 ; <i8*> [#uses=1]
-
-invcont3474: ; preds = %invcont3472
- invoke fastcc void @_ZN13ggSolidNoise3C1Ev( %struct.ggSolidNoise3* null )
- to label %_ZN22ggCoverageSolidTextureC1Eddi.exit unwind label %lpad4045
-
-_ZN22ggCoverageSolidTextureC1Eddi.exit: ; preds = %invcont3474
- %tmp34823483 = bitcast i8* %tmp3475 to %struct.ggBRDF* ; <%struct.ggBRDF*> [#uses=2]
- invoke fastcc void @_ZN5ggBSTI14ggSolidTextureE17InsertIntoSubtreeERK8ggStringPS0_RP9ggBSTNodeIS0_E( %"struct.ggBST<ggSolidTexture>"* null, %struct.ggString* null, %struct.ggBRDF* %tmp34823483, %"struct.ggBSTNode<ggSolidTexture>"** null )
- to label %bb3662 unwind label %lpad4029
-
-bb3491: ; preds = %bb3458
- ret void
-
-bb3662: ; preds = %_ZN22ggCoverageSolidTextureC1Eddi.exit
- invoke fastcc void @_ZN8ggStringD1Ev( %struct.ggString* null )
- to label %invcont3663 unwind label %lpad4025
-
-invcont3663: ; preds = %bb3662
- invoke fastcc void @_ZN8ggStringD1Ev( %struct.ggString* null )
- to label %bb3743 unwind label %lpad3845
-
-bb3734: ; preds = %bb3336
- ret void
-
-bb3743: ; preds = %invcont3663, %bb2181, %invcont2124, %invcont1882, %invcont1642, %bb368, %bb353, %invcont335, %bb3743.preheader
- %tex1.3 = phi %struct.ggBRDF* [ undef, %bb3743.preheader ], [ %tex1.3, %bb368 ], [ %tex1.3, %invcont1642 ], [ %tex1.3, %invcont1882 ], [ %tex1.3, %invcont2124 ], [ %tex1.3, %bb2181 ], [ %tex1.3, %invcont335 ], [ %tmp34823483, %invcont3663 ], [ %tex1.3, %bb353 ] ; <%struct.ggBRDF*> [#uses=7]
- %tmp3.i312325 = invoke %"struct.std::basic_istream<char,std::char_traits<char> >"* @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_PS3_( %"struct.std::basic_istream<char,std::char_traits<char> >"* %surfaces, i8* null )
- to label %tmp3.i312.noexc unwind label %lpad3845 ; <%"struct.std::basic_istream<char,std::char_traits<char> >"*> [#uses=0]
-
-tmp3.i312.noexc: ; preds = %bb3743
- %tmp15.i327 = invoke i8* @_ZNKSt9basic_iosIcSt11char_traitsIcEEcvPvEv( %"struct.std::basic_ios<char,std::char_traits<char> >"* null )
- to label %tmp15.i.noexc326 unwind label %lpad3845 ; <i8*> [#uses=0]
-
-tmp15.i.noexc326: ; preds = %tmp3.i312.noexc
- br i1 false, label %invcont3745, label %bb.i323
-
-bb.i323: ; preds = %tmp15.i.noexc326
- ret void
-
-invcont3745: ; preds = %tmp15.i.noexc326
- %tmp3759 = invoke i8* @_ZNKSt9basic_iosIcSt11char_traitsIcEEcvPvEv( %"struct.std::basic_ios<char,std::char_traits<char> >"* null )
- to label %invcont3758 unwind label %lpad3845 ; <i8*> [#uses=0]
-
-invcont3758: ; preds = %invcont3745
- %tmp5.i161 = getelementptr %"struct.ggString::StringRep"* null, i32 0, i32 2, i32 0 ; <i8*> [#uses=2]
- br i1 false, label %bb333, label %bb345
-
-lpad: ; preds = %entry
- ret void
-
-lpad3825: ; preds = %_ZN8ggStringC1Ei.exit
- ret void
-
-lpad3829: ; preds = %_ZN8ggStringC1Ei.exit96
- ret void
-
-lpad3833: ; preds = %_ZN8ggStringC1Ei.exit104
- ret void
-
-lpad3837: ; preds = %_ZN8ggStringC1Ei.exit112
- ret void
-
-lpad3841: ; preds = %_ZN8ggStringC1Ei.exit129
- ret void
-
-lpad3845: ; preds = %invcont3745, %tmp3.i312.noexc, %bb3743, %invcont3663, %bb3344, %bb2181, %bb2144, %invcont2124, %invcont2122, %invcont2120, %tmp9.i3163.noexc, %tmp8.i3162.noexc, %invcont2118, %tmp3.i3171.noexc, %invcont2116, %tmp3.i3192.noexc, %bb2114, %bb.i3255, %tmp3.i3243.noexc, %bb2061, %invcont1882, %invcont1880, %invcont1867, %invcont1865, %invcont1863, %invcont1861, %invcont1859, %invcont1857, %bb.i3475, %tmp3.i3463.noexc, %bb1855, %bb1701, %tmp3.i3714.noexc, %bb1662, %invcont1642, %invcont1640, %tmp9.i3799.noexc, %tmp8.i3798.noexc, %invcont1638, %tmp9.i3809.noexc, %tmp8.i3808.noexc, %invcont1636, %tmp3.i3817.noexc, %invcont1634, %tmp3.i3838.noexc, %bb1632, %bb368, %bb353, %tmp3.i167.noexc, %bb333, %tmp3.i.noexc, %_ZN13mrSurfaceListC1Ev.exit, %_ZN8ggStringC1Ei.exit139
- ret void
-
-lpad3849: ; preds = %invcont294
- ret void
-
-lpad3921: ; preds = %invcont2160, %invcont2147, %tmp3.i3098.noexc, %_ZN8ggStringC1Ei.exit3124
- ret void
-
-lpad4025: ; preds = %bb3662, %_ZN8ggStringC1Ei.exit780
- ret void
-
-lpad4029: ; preds = %_ZN22ggCoverageSolidTextureC1Eddi.exit, %invcont3472, %invcont3470, %invcont3468, %bb3466, %tmp3.i726.noexc, %invcont3348, %tmp3.i746.noexc, %_ZN8ggStringC1Ei.exit772
- ret void
-
-lpad4045: ; preds = %invcont3474
- ret void
-}
-
-declare fastcc void @_ZN8ggStringD1Ev(%struct.ggString*)
-
-declare i8* @_Znam(i32)
-
-declare fastcc void @_ZN8ggStringaSEPKc(%struct.ggString*, i8*)
-
-declare i32 @strcmp(i8*, i8*) nounwind readonly
-
-declare %"struct.std::basic_istream<char,std::char_traits<char> >"* @_ZNSirsERi(%"struct.std::basic_istream<char,std::char_traits<char> >"*, i32*)
-
-declare i8* @_Znwm(i32)
-
-declare i8* @_ZNKSt9basic_iosIcSt11char_traitsIcEEcvPvEv(%"struct.std::basic_ios<char,std::char_traits<char> >"*)
-
-declare %"struct.std::basic_istream<char,std::char_traits<char> >"* @_ZNSirsERd(%"struct.std::basic_istream<char,std::char_traits<char> >"*, double*)
-
-declare %"struct.std::basic_istream<char,std::char_traits<char> >"* @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_PS3_(%"struct.std::basic_istream<char,std::char_traits<char> >"*, i8*)
-
-declare fastcc void @_ZN13ggSolidNoise3C1Ev(%struct.ggSolidNoise3*)
-
-declare i8 @_ZNKSt9basic_iosIcSt11char_traitsIcEE4goodEv(%"struct.std::basic_ios<char,std::char_traits<char> >"*) zeroext
-
-declare fastcc %struct.ggSpectrum* @_ZN5ggBSTI10ggSpectrumE4findERK8ggString3(%"struct.ggBSTNode<ggSpectrum>"*, %struct.ggString*)
-
-declare fastcc void @_ZN5ggBSTI14ggSolidTextureE17InsertIntoSubtreeERK8ggStringPS0_RP9ggBSTNodeIS0_E(%"struct.ggBST<ggSolidTexture>"*, %struct.ggString*, %struct.ggBRDF*, %"struct.ggBSTNode<ggSolidTexture>"**)
-
-declare fastcc void @_ZN7mrScene9AddObjectEP9mrSurfaceRK8ggStringS4_i(%struct.mrScene*, %struct.ggBRDF*, %struct.ggString*, %struct.ggString*, i32)
diff --git a/release_23/test/CodeGen/X86/2007-12-16-BURRSchedCrash.ll b/release_23/test/CodeGen/X86/2007-12-16-BURRSchedCrash.ll
deleted file mode 100644
index 8ad77051bedd..000000000000
--- a/release_23/test/CodeGen/X86/2007-12-16-BURRSchedCrash.ll
+++ /dev/null
@@ -1,35 +0,0 @@
-; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu
-; PR1799
-
- %struct.c34007g__designated___XUB = type { i32, i32, i32, i32 }
- %struct.c34007g__pkg__parent = type { i32*, %struct.c34007g__designated___XUB* }
-
-define void @_ada_c34007g() {
-entry:
- %x8 = alloca %struct.c34007g__pkg__parent, align 8 ; <%struct.c34007g__pkg__parent*> [#uses=2]
- br i1 true, label %bb1271, label %bb848
-
-bb848: ; preds = %entry
- ret void
-
-bb1271: ; preds = %bb898
- %tmp1272 = getelementptr %struct.c34007g__pkg__parent* %x8, i32 0, i32 0 ; <i32**> [#uses=1]
- %x82167 = bitcast %struct.c34007g__pkg__parent* %x8 to i64* ; <i64*> [#uses=1]
- br i1 true, label %bb4668, label %bb848
-
-bb4668: ; preds = %bb4648
- %tmp5464 = load i64* %x82167, align 8 ; <i64> [#uses=1]
- %tmp5467 = icmp ne i64 0, %tmp5464 ; <i1> [#uses=1]
- %tmp5470 = load i32** %tmp1272, align 8 ; <i32*> [#uses=1]
- %tmp5471 = icmp eq i32* %tmp5470, null ; <i1> [#uses=1]
- call fastcc void @c34007g__pkg__create.311( %struct.c34007g__pkg__parent* null, i32 7, i32 9, i32 2, i32 4, i32 1 )
- %tmp5475 = or i1 %tmp5471, %tmp5467 ; <i1> [#uses=1]
- %tmp5497 = or i1 %tmp5475, false ; <i1> [#uses=1]
- br i1 %tmp5497, label %bb848, label %bb5507
-
-bb5507: ; preds = %bb4668
- ret void
-
-}
-
-declare fastcc void @c34007g__pkg__create.311(%struct.c34007g__pkg__parent*, i32, i32, i32, i32, i32)
diff --git a/release_23/test/CodeGen/X86/2007-12-18-LoadCSEBug.ll b/release_23/test/CodeGen/X86/2007-12-18-LoadCSEBug.ll
deleted file mode 100644
index 6309f3c51052..000000000000
--- a/release_23/test/CodeGen/X86/2007-12-18-LoadCSEBug.ll
+++ /dev/null
@@ -1,28 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 | grep {(%esp)} | count 2
-; PR1872
-
- %struct.c34007g__designated___XUB = type { i32, i32, i32, i32 }
- %struct.c34007g__pkg__parent = type { i32*, %struct.c34007g__designated___XUB* }
-
-define void @_ada_c34007g() {
-entry:
- %x8 = alloca %struct.c34007g__pkg__parent, align 8 ; <%struct.c34007g__pkg__parent*> [#uses=2]
- %tmp1272 = getelementptr %struct.c34007g__pkg__parent* %x8, i32 0, i32 0 ; <i32**> [#uses=1]
- %x82167 = bitcast %struct.c34007g__pkg__parent* %x8 to i64* ; <i64*> [#uses=1]
- br i1 true, label %bb4668, label %bb848
-
-bb4668: ; preds = %bb4648
- %tmp5464 = load i64* %x82167, align 8 ; <i64> [#uses=1]
- %tmp5467 = icmp ne i64 0, %tmp5464 ; <i1> [#uses=1]
- %tmp5470 = load i32** %tmp1272, align 8 ; <i32*> [#uses=1]
- %tmp5471 = icmp eq i32* %tmp5470, null ; <i1> [#uses=1]
- %tmp5475 = or i1 %tmp5471, %tmp5467 ; <i1> [#uses=1]
- %tmp5497 = or i1 %tmp5475, false ; <i1> [#uses=1]
- br i1 %tmp5497, label %bb848, label %bb5507
-
-bb848: ; preds = %entry
- ret void
-
-bb5507: ; preds = %bb4668
- ret void
-}
diff --git a/release_23/test/CodeGen/X86/2008-01-08-IllegalCMP.ll b/release_23/test/CodeGen/X86/2008-01-08-IllegalCMP.ll
deleted file mode 100644
index fddfd4f3a486..000000000000
--- a/release_23/test/CodeGen/X86/2008-01-08-IllegalCMP.ll
+++ /dev/null
@@ -1,17 +0,0 @@
-; RUN: llvm-as < %s | llc
-
-target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32"
-target triple = "i686-pc-linux-gnu"
-
-define i64 @__absvdi2(i64 %a) nounwind {
-entry:
- %w.0 = select i1 false, i64 0, i64 %a ; <i64> [#uses=2]
- %tmp9 = icmp slt i64 %w.0, 0 ; <i1> [#uses=1]
- br i1 %tmp9, label %bb12, label %bb13
-
-bb12: ; preds = %entry
- unreachable
-
-bb13: ; preds = %entry
- ret i64 %w.0
-}
diff --git a/release_23/test/CodeGen/X86/2008-01-08-SchedulerCrash.ll b/release_23/test/CodeGen/X86/2008-01-08-SchedulerCrash.ll
deleted file mode 100644
index 8a1520c1fe41..000000000000
--- a/release_23/test/CodeGen/X86/2008-01-08-SchedulerCrash.ll
+++ /dev/null
@@ -1,32 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 | not grep pushf
-
- %struct.indexentry = type { i32, i8*, i8*, i8*, i8*, i8* }
-
-define i32 @_bfd_stab_section_find_nearest_line(i32 %offset) nounwind {
-entry:
- %tmp910 = add i32 0, %offset ; <i32> [#uses=1]
- br i1 true, label %bb951, label %bb917
-
-bb917: ; preds = %entry
- ret i32 0
-
-bb951: ; preds = %bb986, %entry
- %tmp955 = sdiv i32 0, 2 ; <i32> [#uses=3]
- %tmp961 = getelementptr %struct.indexentry* null, i32 %tmp955, i32 0 ; <i32*> [#uses=1]
- br i1 true, label %bb986, label %bb967
-
-bb967: ; preds = %bb951
- ret i32 0
-
-bb986: ; preds = %bb951
- %tmp993 = load i32* %tmp961, align 4 ; <i32> [#uses=1]
- %tmp995 = icmp ugt i32 %tmp993, %tmp910 ; <i1> [#uses=2]
- %tmp1002 = add i32 %tmp955, 1 ; <i32> [#uses=1]
- %low.0 = select i1 %tmp995, i32 0, i32 %tmp1002 ; <i32> [#uses=1]
- %high.0 = select i1 %tmp995, i32 %tmp955, i32 0 ; <i32> [#uses=1]
- %tmp1006 = icmp eq i32 %low.0, %high.0 ; <i1> [#uses=1]
- br i1 %tmp1006, label %UnifiedReturnBlock, label %bb951
-
-UnifiedReturnBlock: ; preds = %bb986
- ret i32 1
-}
diff --git a/release_23/test/CodeGen/X86/2008-01-09-LongDoubleSin.ll b/release_23/test/CodeGen/X86/2008-01-09-LongDoubleSin.ll
deleted file mode 100644
index 962d6ecc24e9..000000000000
--- a/release_23/test/CodeGen/X86/2008-01-09-LongDoubleSin.ll
+++ /dev/null
@@ -1,11 +0,0 @@
-; RUN: llvm-as < %s | llc -o - | grep sinl
-
-target triple = "i686-pc-linux-gnu"
-
-define x86_fp80 @f(x86_fp80 %x) nounwind {
-entry:
- %tmp2 = tail call x86_fp80 @sinl( x86_fp80 %x ) nounwind readonly ; <x86_fp80> [#uses=1]
- ret x86_fp80 %tmp2
-}
-
-declare x86_fp80 @sinl(x86_fp80) nounwind readonly
diff --git a/release_23/test/CodeGen/X86/2008-01-16-FPStackifierAssert.ll b/release_23/test/CodeGen/X86/2008-01-16-FPStackifierAssert.ll
deleted file mode 100644
index 83ca3e3ac720..000000000000
--- a/release_23/test/CodeGen/X86/2008-01-16-FPStackifierAssert.ll
+++ /dev/null
@@ -1,35 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 -regalloc=local
-
-define void @SolveCubic(double %a, double %b, double %c, double %d, i32* %solutions, double* %x) {
-entry:
- %tmp71 = load x86_fp80* null, align 16 ; <x86_fp80> [#uses=1]
- %tmp72 = fdiv x86_fp80 %tmp71, 0xKC000C000000000000000 ; <x86_fp80> [#uses=1]
- %tmp73 = add x86_fp80 0xK00000000000000000000, %tmp72 ; <x86_fp80> [#uses=1]
- %tmp7374 = fptrunc x86_fp80 %tmp73 to double ; <double> [#uses=1]
- store double %tmp7374, double* null, align 8
- %tmp81 = load double* null, align 8 ; <double> [#uses=1]
- %tmp82 = add double %tmp81, 0x401921FB54442D18 ; <double> [#uses=1]
- %tmp83 = fdiv double %tmp82, 3.000000e+00 ; <double> [#uses=1]
- %tmp84 = call double @cos( double %tmp83 ) ; <double> [#uses=1]
- %tmp85 = mul double 0.000000e+00, %tmp84 ; <double> [#uses=1]
- %tmp8586 = fpext double %tmp85 to x86_fp80 ; <x86_fp80> [#uses=1]
- %tmp87 = load x86_fp80* null, align 16 ; <x86_fp80> [#uses=1]
- %tmp88 = fdiv x86_fp80 %tmp87, 0xKC000C000000000000000 ; <x86_fp80> [#uses=1]
- %tmp89 = add x86_fp80 %tmp8586, %tmp88 ; <x86_fp80> [#uses=1]
- %tmp8990 = fptrunc x86_fp80 %tmp89 to double ; <double> [#uses=1]
- store double %tmp8990, double* null, align 8
- %tmp97 = load double* null, align 8 ; <double> [#uses=1]
- %tmp98 = add double %tmp97, 0x402921FB54442D18 ; <double> [#uses=1]
- %tmp99 = fdiv double %tmp98, 3.000000e+00 ; <double> [#uses=1]
- %tmp100 = call double @cos( double %tmp99 ) ; <double> [#uses=1]
- %tmp101 = mul double 0.000000e+00, %tmp100 ; <double> [#uses=1]
- %tmp101102 = fpext double %tmp101 to x86_fp80 ; <x86_fp80> [#uses=1]
- %tmp103 = load x86_fp80* null, align 16 ; <x86_fp80> [#uses=1]
- %tmp104 = fdiv x86_fp80 %tmp103, 0xKC000C000000000000000 ; <x86_fp80> [#uses=1]
- %tmp105 = add x86_fp80 %tmp101102, %tmp104 ; <x86_fp80> [#uses=1]
- %tmp105106 = fptrunc x86_fp80 %tmp105 to double ; <double> [#uses=1]
- store double %tmp105106, double* null, align 8
- ret void
-}
-
-declare double @cos(double)
diff --git a/release_23/test/CodeGen/X86/2008-01-16-InvalidDAGCombineXform.ll b/release_23/test/CodeGen/X86/2008-01-16-InvalidDAGCombineXform.ll
deleted file mode 100644
index 4feb078671fb..000000000000
--- a/release_23/test/CodeGen/X86/2008-01-16-InvalidDAGCombineXform.ll
+++ /dev/null
@@ -1,30 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 | not grep IMPLICIT_DEF
-
- %struct.node_t = type { double*, %struct.node_t*, %struct.node_t**, double**, double*, i32, i32 }
-
-define void @localize_local_bb19_bb(%struct.node_t** %cur_node) {
-newFuncRoot:
- %tmp1 = load %struct.node_t** %cur_node, align 4 ; <%struct.node_t*> [#uses=1]
- %tmp2 = getelementptr %struct.node_t* %tmp1, i32 0, i32 4 ; <double**> [#uses=1]
- %tmp3 = load double** %tmp2, align 4 ; <double*> [#uses=1]
- %tmp4 = load %struct.node_t** %cur_node, align 4 ; <%struct.node_t*> [#uses=1]
- %tmp5 = getelementptr %struct.node_t* %tmp4, i32 0, i32 4 ; <double**> [#uses=1]
- store double* %tmp3, double** %tmp5, align 4
- %tmp6 = load %struct.node_t** %cur_node, align 4 ; <%struct.node_t*> [#uses=1]
- %tmp7 = getelementptr %struct.node_t* %tmp6, i32 0, i32 3 ; <double***> [#uses=1]
- %tmp8 = load double*** %tmp7, align 4 ; <double**> [#uses=1]
- %tmp9 = load %struct.node_t** %cur_node, align 4 ; <%struct.node_t*> [#uses=1]
- %tmp10 = getelementptr %struct.node_t* %tmp9, i32 0, i32 3 ; <double***> [#uses=1]
- store double** %tmp8, double*** %tmp10, align 4
- %tmp11 = load %struct.node_t** %cur_node, align 4 ; <%struct.node_t*> [#uses=1]
- %tmp12 = getelementptr %struct.node_t* %tmp11, i32 0, i32 0 ; <double**> [#uses=1]
- %tmp13 = load double** %tmp12, align 4 ; <double*> [#uses=1]
- %tmp14 = load %struct.node_t** %cur_node, align 4 ; <%struct.node_t*> [#uses=1]
- %tmp15 = getelementptr %struct.node_t* %tmp14, i32 0, i32 0 ; <double**> [#uses=1]
- store double* %tmp13, double** %tmp15, align 4
- %tmp16 = load %struct.node_t** %cur_node, align 4 ; <%struct.node_t*> [#uses=1]
- %tmp17 = getelementptr %struct.node_t* %tmp16, i32 0, i32 1 ; <%struct.node_t**> [#uses=1]
- %tmp18 = load %struct.node_t** %tmp17, align 4 ; <%struct.node_t*> [#uses=1]
- store %struct.node_t* %tmp18, %struct.node_t** %cur_node, align 4
- ret void
-}
diff --git a/release_23/test/CodeGen/X86/2008-01-16-Trampoline.ll b/release_23/test/CodeGen/X86/2008-01-16-Trampoline.ll
deleted file mode 100644
index 4510edb9d7db..000000000000
--- a/release_23/test/CodeGen/X86/2008-01-16-Trampoline.ll
+++ /dev/null
@@ -1,14 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86
-; RUN: llvm-as < %s | llc -march=x86-64
-
- %struct.FRAME.gnat__perfect_hash_generators__select_char_position__build_identical_keys_sets = type { i32, i32, void (i32, i32)*, i8 (i32, i32)* }
-
-define fastcc i32 @gnat__perfect_hash_generators__select_char_position__build_identical_keys_sets.5146(i64 %table.0.0, i64 %table.0.1, i32 %last, i32 %pos) {
-entry:
- %tramp22 = call i8* @llvm.init.trampoline( i8* null, i8* bitcast (void (%struct.FRAME.gnat__perfect_hash_generators__select_char_position__build_identical_keys_sets*, i32, i32)* @gnat__perfect_hash_generators__select_char_position__build_identical_keys_sets__move.5177 to i8*), i8* null ) ; <i8*> [#uses=0]
- unreachable
-}
-
-declare void @gnat__perfect_hash_generators__select_char_position__build_identical_keys_sets__move.5177(%struct.FRAME.gnat__perfect_hash_generators__select_char_position__build_identical_keys_sets* nest , i32, i32) nounwind
-
-declare i8* @llvm.init.trampoline(i8*, i8*, i8*) nounwind
diff --git a/release_23/test/CodeGen/X86/2008-01-25-EmptyFunction.ll b/release_23/test/CodeGen/X86/2008-01-25-EmptyFunction.ll
deleted file mode 100644
index ffb82ae7f2b8..000000000000
--- a/release_23/test/CodeGen/X86/2008-01-25-EmptyFunction.ll
+++ /dev/null
@@ -1,8 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 | grep nop
-target triple = "i686-apple-darwin8"
-
-
-define void @bork() noreturn nounwind {
-entry:
- unreachable
-}
diff --git a/release_23/test/CodeGen/X86/2008-02-05-ISelCrash.ll b/release_23/test/CodeGen/X86/2008-02-05-ISelCrash.ll
deleted file mode 100644
index 6885cf14cf11..000000000000
--- a/release_23/test/CodeGen/X86/2008-02-05-ISelCrash.ll
+++ /dev/null
@@ -1,12 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86
-; PR1975
-
-@nodes = external global i64 ; <i64*> [#uses=2]
-
-define fastcc i32 @ab(i32 %alpha, i32 %beta) nounwind {
-entry:
- %tmp1 = load i64* @nodes, align 8 ; <i64> [#uses=1]
- %tmp2 = add i64 %tmp1, 1 ; <i64> [#uses=1]
- store i64 %tmp2, i64* @nodes, align 8
- ret i32 0
-}
diff --git a/release_23/test/CodeGen/X86/2008-02-06-LoadFoldingBug.ll b/release_23/test/CodeGen/X86/2008-02-06-LoadFoldingBug.ll
deleted file mode 100644
index f1300fa3d79e..000000000000
--- a/release_23/test/CodeGen/X86/2008-02-06-LoadFoldingBug.ll
+++ /dev/null
@@ -1,20 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep xor | grep CPI
-
-define void @casin({ double, double }* sret %agg.result, double %z.0, double %z.1) nounwind {
-entry:
- %memtmp = alloca { double, double }, align 8 ; <{ double, double }*> [#uses=3]
- %tmp4 = sub double -0.000000e+00, %z.1 ; <double> [#uses=1]
- call void @casinh( { double, double }* sret %memtmp, double %tmp4, double %z.0 ) nounwind
- %tmp19 = getelementptr { double, double }* %memtmp, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp20 = load double* %tmp19, align 8 ; <double> [#uses=1]
- %tmp22 = getelementptr { double, double }* %memtmp, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp23 = load double* %tmp22, align 8 ; <double> [#uses=1]
- %tmp32 = sub double -0.000000e+00, %tmp20 ; <double> [#uses=1]
- %tmp37 = getelementptr { double, double }* %agg.result, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp23, double* %tmp37, align 8
- %tmp40 = getelementptr { double, double }* %agg.result, i32 0, i32 1 ; <double*> [#uses=1]
- store double %tmp32, double* %tmp40, align 8
- ret void
-}
-
-declare void @casinh({ double, double }* sret , double, double) nounwind
diff --git a/release_23/test/CodeGen/X86/2008-02-08-LoadFoldingBug.ll b/release_23/test/CodeGen/X86/2008-02-08-LoadFoldingBug.ll
deleted file mode 100644
index b3fe9abd52a3..000000000000
--- a/release_23/test/CodeGen/X86/2008-02-08-LoadFoldingBug.ll
+++ /dev/null
@@ -1,99 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep andpd | not grep esp
-
-declare double @llvm.sqrt.f64(double) nounwind readnone
-
-declare fastcc void @ApplyGivens(double**, double, double, i32, i32, i32, i32) nounwind
-
-declare double @fabs(double)
-
-define void @main_bb114_2E_outer_2E_i_bb3_2E_i27(double** %tmp12.sub.i.i, [51 x double*]* %tmp12.i.i.i, i32 %i.0.reg2mem.0.ph.i, i32 %tmp11688.i, i32 %tmp19.i, i32 %tmp24.i, [51 x double*]* %tmp12.i.i) {
-newFuncRoot:
- br label %bb3.i27
-
-bb111.i77.bb121.i_crit_edge.exitStub: ; preds = %bb111.i77
- ret void
-
-bb3.i27: ; preds = %bb111.i77.bb3.i27_crit_edge, %newFuncRoot
- %indvar94.i = phi i32 [ 0, %newFuncRoot ], [ %tmp113.i76, %bb111.i77.bb3.i27_crit_edge ] ; <i32> [#uses=6]
- %tmp6.i20 = getelementptr [51 x double*]* %tmp12.i.i, i32 0, i32 %indvar94.i ; <double**> [#uses=1]
- %tmp7.i21 = load double** %tmp6.i20, align 4 ; <double*> [#uses=2]
- %tmp10.i = add i32 %indvar94.i, %i.0.reg2mem.0.ph.i ; <i32> [#uses=5]
- %tmp11.i22 = getelementptr double* %tmp7.i21, i32 %tmp10.i ; <double*> [#uses=1]
- %tmp12.i23 = load double* %tmp11.i22, align 8 ; <double> [#uses=4]
- %tmp20.i24 = add i32 %tmp19.i, %indvar94.i ; <i32> [#uses=3]
- %tmp21.i = getelementptr double* %tmp7.i21, i32 %tmp20.i24 ; <double*> [#uses=1]
- %tmp22.i25 = load double* %tmp21.i, align 8 ; <double> [#uses=3]
- %tmp1.i.i26 = fcmp oeq double %tmp12.i23, 0.000000e+00 ; <i1> [#uses=1]
- br i1 %tmp1.i.i26, label %bb3.i27.Givens.exit.i49_crit_edge, label %bb5.i.i31
-
-bb5.i.i31: ; preds = %bb3.i27
- %tmp7.i.i28 = call double @fabs( double %tmp12.i23 ) nounwind ; <double> [#uses=1]
- %tmp9.i.i29 = call double @fabs( double %tmp22.i25 ) nounwind ; <double> [#uses=1]
- %tmp10.i.i30 = fcmp ogt double %tmp7.i.i28, %tmp9.i.i29 ; <i1> [#uses=1]
- br i1 %tmp10.i.i30, label %bb13.i.i37, label %bb30.i.i43
-
-bb13.i.i37: ; preds = %bb5.i.i31
- %tmp15.i.i32 = sub double -0.000000e+00, %tmp22.i25 ; <double> [#uses=1]
- %tmp17.i.i33 = fdiv double %tmp15.i.i32, %tmp12.i23 ; <double> [#uses=3]
- %tmp20.i4.i = mul double %tmp17.i.i33, %tmp17.i.i33 ; <double> [#uses=1]
- %tmp21.i.i34 = add double %tmp20.i4.i, 1.000000e+00 ; <double> [#uses=1]
- %tmp22.i.i35 = call double @llvm.sqrt.f64( double %tmp21.i.i34 ) nounwind ; <double> [#uses=1]
- %tmp23.i5.i = fdiv double 1.000000e+00, %tmp22.i.i35 ; <double> [#uses=2]
- %tmp28.i.i36 = mul double %tmp23.i5.i, %tmp17.i.i33 ; <double> [#uses=1]
- br label %Givens.exit.i49
-
-bb30.i.i43: ; preds = %bb5.i.i31
- %tmp32.i.i38 = sub double -0.000000e+00, %tmp12.i23 ; <double> [#uses=1]
- %tmp34.i.i39 = fdiv double %tmp32.i.i38, %tmp22.i25 ; <double> [#uses=3]
- %tmp37.i6.i = mul double %tmp34.i.i39, %tmp34.i.i39 ; <double> [#uses=1]
- %tmp38.i.i40 = add double %tmp37.i6.i, 1.000000e+00 ; <double> [#uses=1]
- %tmp39.i7.i = call double @llvm.sqrt.f64( double %tmp38.i.i40 ) nounwind ; <double> [#uses=1]
- %tmp40.i.i41 = fdiv double 1.000000e+00, %tmp39.i7.i ; <double> [#uses=2]
- %tmp45.i.i42 = mul double %tmp40.i.i41, %tmp34.i.i39 ; <double> [#uses=1]
- br label %Givens.exit.i49
-
-Givens.exit.i49: ; preds = %bb3.i27.Givens.exit.i49_crit_edge, %bb30.i.i43, %bb13.i.i37
- %s.0.i44 = phi double [ %tmp45.i.i42, %bb30.i.i43 ], [ %tmp23.i5.i, %bb13.i.i37 ], [ 0.000000e+00, %bb3.i27.Givens.exit.i49_crit_edge ] ; <double> [#uses=2]
- %c.0.i45 = phi double [ %tmp40.i.i41, %bb30.i.i43 ], [ %tmp28.i.i36, %bb13.i.i37 ], [ 1.000000e+00, %bb3.i27.Givens.exit.i49_crit_edge ] ; <double> [#uses=2]
- %tmp26.i46 = add i32 %tmp24.i, %indvar94.i ; <i32> [#uses=2]
- %tmp27.i47 = icmp slt i32 %tmp26.i46, 51 ; <i1> [#uses=1]
- %min.i48 = select i1 %tmp27.i47, i32 %tmp26.i46, i32 50 ; <i32> [#uses=1]
- call fastcc void @ApplyGivens( double** %tmp12.sub.i.i, double %s.0.i44, double %c.0.i45, i32 %tmp20.i24, i32 %tmp10.i, i32 %indvar94.i, i32 %min.i48 ) nounwind
- br label %codeRepl
-
-codeRepl: ; preds = %Givens.exit.i49
- call void @main_bb114_2E_outer_2E_i_bb3_2E_i27_bb_2E_i48_2E_i( i32 %tmp10.i, i32 %tmp20.i24, double %s.0.i44, double %c.0.i45, [51 x double*]* %tmp12.i.i.i )
- br label %ApplyRGivens.exit49.i
-
-ApplyRGivens.exit49.i: ; preds = %codeRepl
- %tmp10986.i = icmp sgt i32 %tmp11688.i, %tmp10.i ; <i1> [#uses=1]
- br i1 %tmp10986.i, label %ApplyRGivens.exit49.i.bb52.i57_crit_edge, label %ApplyRGivens.exit49.i.bb111.i77_crit_edge
-
-codeRepl1: ; preds = %ApplyRGivens.exit49.i.bb52.i57_crit_edge
- call void @main_bb114_2E_outer_2E_i_bb3_2E_i27_bb52_2E_i57( i32 %tmp10.i, double** %tmp12.sub.i.i, [51 x double*]* %tmp12.i.i.i, i32 %i.0.reg2mem.0.ph.i, i32 %tmp11688.i, i32 %tmp19.i, i32 %tmp24.i, [51 x double*]* %tmp12.i.i )
- br label %bb105.i.bb111.i77_crit_edge
-
-bb111.i77: ; preds = %bb105.i.bb111.i77_crit_edge, %ApplyRGivens.exit49.i.bb111.i77_crit_edge
- %tmp113.i76 = add i32 %indvar94.i, 1 ; <i32> [#uses=2]
- %tmp118.i = icmp sgt i32 %tmp11688.i, %tmp113.i76 ; <i1> [#uses=1]
- br i1 %tmp118.i, label %bb111.i77.bb3.i27_crit_edge, label %bb111.i77.bb121.i_crit_edge.exitStub
-
-bb3.i27.Givens.exit.i49_crit_edge: ; preds = %bb3.i27
- br label %Givens.exit.i49
-
-ApplyRGivens.exit49.i.bb52.i57_crit_edge: ; preds = %ApplyRGivens.exit49.i
- br label %codeRepl1
-
-ApplyRGivens.exit49.i.bb111.i77_crit_edge: ; preds = %ApplyRGivens.exit49.i
- br label %bb111.i77
-
-bb105.i.bb111.i77_crit_edge: ; preds = %codeRepl1
- br label %bb111.i77
-
-bb111.i77.bb3.i27_crit_edge: ; preds = %bb111.i77
- br label %bb3.i27
-}
-
-declare void @main_bb114_2E_outer_2E_i_bb3_2E_i27_bb_2E_i48_2E_i(i32, i32, double, double, [51 x double*]*)
-
-declare void @main_bb114_2E_outer_2E_i_bb3_2E_i27_bb52_2E_i57(i32, double**, [51 x double*]*, i32, i32, i32, i32, [51 x double*]*)
diff --git a/release_23/test/CodeGen/X86/2008-02-14-BitMiscompile.ll b/release_23/test/CodeGen/X86/2008-02-14-BitMiscompile.ll
deleted file mode 100644
index 5bf84560a37c..000000000000
--- a/release_23/test/CodeGen/X86/2008-02-14-BitMiscompile.ll
+++ /dev/null
@@ -1,8 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 | grep and
-define i32 @test(i1 %A) {
- %B = zext i1 %A to i32 ; <i32> [#uses=1]
- %C = sub i32 0, %B ; <i32> [#uses=1]
- %D = and i32 %C, 255 ; <i32> [#uses=1]
- ret i32 %D
-}
-
diff --git a/release_23/test/CodeGen/X86/2008-02-18-TailMergingBug.ll b/release_23/test/CodeGen/X86/2008-02-18-TailMergingBug.ll
deleted file mode 100644
index 45ff802bb387..000000000000
--- a/release_23/test/CodeGen/X86/2008-02-18-TailMergingBug.ll
+++ /dev/null
@@ -1,219 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -mcpu=yonah -stats |& grep {Number of block tails merged} | grep 6
-; PR1909
-
-@.str = internal constant [48 x i8] c"transformed bounds: (%.2f, %.2f), (%.2f, %.2f)\0A\00" ; <[48 x i8]*> [#uses=1]
-
-define void @minmax(float* %result) nounwind {
-entry:
- %tmp2 = load float* %result, align 4 ; <float> [#uses=6]
- %tmp4 = getelementptr float* %result, i32 2 ; <float*> [#uses=5]
- %tmp5 = load float* %tmp4, align 4 ; <float> [#uses=10]
- %tmp7 = getelementptr float* %result, i32 4 ; <float*> [#uses=5]
- %tmp8 = load float* %tmp7, align 4 ; <float> [#uses=8]
- %tmp10 = getelementptr float* %result, i32 6 ; <float*> [#uses=3]
- %tmp11 = load float* %tmp10, align 4 ; <float> [#uses=8]
- %tmp12 = fcmp olt float %tmp8, %tmp11 ; <i1> [#uses=5]
- br i1 %tmp12, label %bb, label %bb21
-
-bb: ; preds = %entry
- %tmp23469 = fcmp olt float %tmp5, %tmp8 ; <i1> [#uses=1]
- br i1 %tmp23469, label %bb26, label %bb30
-
-bb21: ; preds = %entry
- %tmp23 = fcmp olt float %tmp5, %tmp11 ; <i1> [#uses=1]
- br i1 %tmp23, label %bb26, label %bb30
-
-bb26: ; preds = %bb21, %bb
- %tmp52471 = fcmp olt float %tmp2, %tmp5 ; <i1> [#uses=1]
- br i1 %tmp52471, label %bb111, label %bb59
-
-bb30: ; preds = %bb21, %bb
- br i1 %tmp12, label %bb40, label %bb50
-
-bb40: ; preds = %bb30
- %tmp52473 = fcmp olt float %tmp2, %tmp8 ; <i1> [#uses=1]
- br i1 %tmp52473, label %bb111, label %bb59
-
-bb50: ; preds = %bb30
- %tmp52 = fcmp olt float %tmp2, %tmp11 ; <i1> [#uses=1]
- br i1 %tmp52, label %bb111, label %bb59
-
-bb59: ; preds = %bb50, %bb40, %bb26
- br i1 %tmp12, label %bb72, label %bb80
-
-bb72: ; preds = %bb59
- %tmp82475 = fcmp olt float %tmp5, %tmp8 ; <i1> [#uses=2]
- %brmerge786 = or i1 %tmp82475, %tmp12 ; <i1> [#uses=1]
- %tmp4.mux787 = select i1 %tmp82475, float* %tmp4, float* %tmp7 ; <float*> [#uses=1]
- br i1 %brmerge786, label %bb111, label %bb103
-
-bb80: ; preds = %bb59
- %tmp82 = fcmp olt float %tmp5, %tmp11 ; <i1> [#uses=2]
- %brmerge = or i1 %tmp82, %tmp12 ; <i1> [#uses=1]
- %tmp4.mux = select i1 %tmp82, float* %tmp4, float* %tmp7 ; <float*> [#uses=1]
- br i1 %brmerge, label %bb111, label %bb103
-
-bb103: ; preds = %bb80, %bb72
- br label %bb111
-
-bb111: ; preds = %bb103, %bb80, %bb72, %bb50, %bb40, %bb26
- %iftmp.0.0.in = phi float* [ %tmp10, %bb103 ], [ %result, %bb26 ], [ %result, %bb40 ], [ %result, %bb50 ], [ %tmp4.mux, %bb80 ], [ %tmp4.mux787, %bb72 ] ; <float*> [#uses=1]
- %iftmp.0.0 = load float* %iftmp.0.0.in ; <float> [#uses=1]
- %tmp125 = fcmp ogt float %tmp8, %tmp11 ; <i1> [#uses=5]
- br i1 %tmp125, label %bb128, label %bb136
-
-bb128: ; preds = %bb111
- %tmp138477 = fcmp ogt float %tmp5, %tmp8 ; <i1> [#uses=1]
- br i1 %tmp138477, label %bb141, label %bb145
-
-bb136: ; preds = %bb111
- %tmp138 = fcmp ogt float %tmp5, %tmp11 ; <i1> [#uses=1]
- br i1 %tmp138, label %bb141, label %bb145
-
-bb141: ; preds = %bb136, %bb128
- %tmp167479 = fcmp ogt float %tmp2, %tmp5 ; <i1> [#uses=1]
- br i1 %tmp167479, label %bb226, label %bb174
-
-bb145: ; preds = %bb136, %bb128
- br i1 %tmp125, label %bb155, label %bb165
-
-bb155: ; preds = %bb145
- %tmp167481 = fcmp ogt float %tmp2, %tmp8 ; <i1> [#uses=1]
- br i1 %tmp167481, label %bb226, label %bb174
-
-bb165: ; preds = %bb145
- %tmp167 = fcmp ogt float %tmp2, %tmp11 ; <i1> [#uses=1]
- br i1 %tmp167, label %bb226, label %bb174
-
-bb174: ; preds = %bb165, %bb155, %bb141
- br i1 %tmp125, label %bb187, label %bb195
-
-bb187: ; preds = %bb174
- %tmp197483 = fcmp ogt float %tmp5, %tmp8 ; <i1> [#uses=2]
- %brmerge790 = or i1 %tmp197483, %tmp125 ; <i1> [#uses=1]
- %tmp4.mux791 = select i1 %tmp197483, float* %tmp4, float* %tmp7 ; <float*> [#uses=1]
- br i1 %brmerge790, label %bb226, label %bb218
-
-bb195: ; preds = %bb174
- %tmp197 = fcmp ogt float %tmp5, %tmp11 ; <i1> [#uses=2]
- %brmerge788 = or i1 %tmp197, %tmp125 ; <i1> [#uses=1]
- %tmp4.mux789 = select i1 %tmp197, float* %tmp4, float* %tmp7 ; <float*> [#uses=1]
- br i1 %brmerge788, label %bb226, label %bb218
-
-bb218: ; preds = %bb195, %bb187
- br label %bb226
-
-bb226: ; preds = %bb218, %bb195, %bb187, %bb165, %bb155, %bb141
- %iftmp.7.0.in = phi float* [ %tmp10, %bb218 ], [ %result, %bb141 ], [ %result, %bb155 ], [ %result, %bb165 ], [ %tmp4.mux789, %bb195 ], [ %tmp4.mux791, %bb187 ] ; <float*> [#uses=1]
- %iftmp.7.0 = load float* %iftmp.7.0.in ; <float> [#uses=1]
- %tmp229 = getelementptr float* %result, i32 1 ; <float*> [#uses=7]
- %tmp230 = load float* %tmp229, align 4 ; <float> [#uses=6]
- %tmp232 = getelementptr float* %result, i32 3 ; <float*> [#uses=5]
- %tmp233 = load float* %tmp232, align 4 ; <float> [#uses=10]
- %tmp235 = getelementptr float* %result, i32 5 ; <float*> [#uses=5]
- %tmp236 = load float* %tmp235, align 4 ; <float> [#uses=8]
- %tmp238 = getelementptr float* %result, i32 7 ; <float*> [#uses=3]
- %tmp239 = load float* %tmp238, align 4 ; <float> [#uses=8]
- %tmp240 = fcmp olt float %tmp236, %tmp239 ; <i1> [#uses=5]
- br i1 %tmp240, label %bb243, label %bb251
-
-bb243: ; preds = %bb226
- %tmp253485 = fcmp olt float %tmp233, %tmp236 ; <i1> [#uses=1]
- br i1 %tmp253485, label %bb256, label %bb260
-
-bb251: ; preds = %bb226
- %tmp253 = fcmp olt float %tmp233, %tmp239 ; <i1> [#uses=1]
- br i1 %tmp253, label %bb256, label %bb260
-
-bb256: ; preds = %bb251, %bb243
- %tmp282487 = fcmp olt float %tmp230, %tmp233 ; <i1> [#uses=1]
- br i1 %tmp282487, label %bb341, label %bb289
-
-bb260: ; preds = %bb251, %bb243
- br i1 %tmp240, label %bb270, label %bb280
-
-bb270: ; preds = %bb260
- %tmp282489 = fcmp olt float %tmp230, %tmp236 ; <i1> [#uses=1]
- br i1 %tmp282489, label %bb341, label %bb289
-
-bb280: ; preds = %bb260
- %tmp282 = fcmp olt float %tmp230, %tmp239 ; <i1> [#uses=1]
- br i1 %tmp282, label %bb341, label %bb289
-
-bb289: ; preds = %bb280, %bb270, %bb256
- br i1 %tmp240, label %bb302, label %bb310
-
-bb302: ; preds = %bb289
- %tmp312491 = fcmp olt float %tmp233, %tmp236 ; <i1> [#uses=2]
- %brmerge793 = or i1 %tmp312491, %tmp240 ; <i1> [#uses=1]
- %tmp232.mux794 = select i1 %tmp312491, float* %tmp232, float* %tmp235 ; <float*> [#uses=1]
- br i1 %brmerge793, label %bb341, label %bb333
-
-bb310: ; preds = %bb289
- %tmp312 = fcmp olt float %tmp233, %tmp239 ; <i1> [#uses=2]
- %brmerge792 = or i1 %tmp312, %tmp240 ; <i1> [#uses=1]
- %tmp232.mux = select i1 %tmp312, float* %tmp232, float* %tmp235 ; <float*> [#uses=1]
- br i1 %brmerge792, label %bb341, label %bb333
-
-bb333: ; preds = %bb310, %bb302
- br label %bb341
-
-bb341: ; preds = %bb333, %bb310, %bb302, %bb280, %bb270, %bb256
- %iftmp.14.0.in = phi float* [ %tmp238, %bb333 ], [ %tmp229, %bb280 ], [ %tmp229, %bb270 ], [ %tmp229, %bb256 ], [ %tmp232.mux, %bb310 ], [ %tmp232.mux794, %bb302 ] ; <float*> [#uses=1]
- %iftmp.14.0 = load float* %iftmp.14.0.in ; <float> [#uses=1]
- %tmp355 = fcmp ogt float %tmp236, %tmp239 ; <i1> [#uses=5]
- br i1 %tmp355, label %bb358, label %bb366
-
-bb358: ; preds = %bb341
- %tmp368493 = fcmp ogt float %tmp233, %tmp236 ; <i1> [#uses=1]
- br i1 %tmp368493, label %bb371, label %bb375
-
-bb366: ; preds = %bb341
- %tmp368 = fcmp ogt float %tmp233, %tmp239 ; <i1> [#uses=1]
- br i1 %tmp368, label %bb371, label %bb375
-
-bb371: ; preds = %bb366, %bb358
- %tmp397495 = fcmp ogt float %tmp230, %tmp233 ; <i1> [#uses=1]
- br i1 %tmp397495, label %bb456, label %bb404
-
-bb375: ; preds = %bb366, %bb358
- br i1 %tmp355, label %bb385, label %bb395
-
-bb385: ; preds = %bb375
- %tmp397497 = fcmp ogt float %tmp230, %tmp236 ; <i1> [#uses=1]
- br i1 %tmp397497, label %bb456, label %bb404
-
-bb395: ; preds = %bb375
- %tmp397 = fcmp ogt float %tmp230, %tmp239 ; <i1> [#uses=1]
- br i1 %tmp397, label %bb456, label %bb404
-
-bb404: ; preds = %bb395, %bb385, %bb371
- br i1 %tmp355, label %bb417, label %bb425
-
-bb417: ; preds = %bb404
- %tmp427499 = fcmp ogt float %tmp233, %tmp236 ; <i1> [#uses=2]
- %brmerge797 = or i1 %tmp427499, %tmp355 ; <i1> [#uses=1]
- %tmp232.mux798 = select i1 %tmp427499, float* %tmp232, float* %tmp235 ; <float*> [#uses=1]
- br i1 %brmerge797, label %bb456, label %bb448
-
-bb425: ; preds = %bb404
- %tmp427 = fcmp ogt float %tmp233, %tmp239 ; <i1> [#uses=2]
- %brmerge795 = or i1 %tmp427, %tmp355 ; <i1> [#uses=1]
- %tmp232.mux796 = select i1 %tmp427, float* %tmp232, float* %tmp235 ; <float*> [#uses=1]
- br i1 %brmerge795, label %bb456, label %bb448
-
-bb448: ; preds = %bb425, %bb417
- br label %bb456
-
-bb456: ; preds = %bb448, %bb425, %bb417, %bb395, %bb385, %bb371
- %iftmp.21.0.in = phi float* [ %tmp238, %bb448 ], [ %tmp229, %bb395 ], [ %tmp229, %bb385 ], [ %tmp229, %bb371 ], [ %tmp232.mux796, %bb425 ], [ %tmp232.mux798, %bb417 ] ; <float*> [#uses=1]
- %iftmp.21.0 = load float* %iftmp.21.0.in ; <float> [#uses=1]
- %tmp458459 = fpext float %iftmp.21.0 to double ; <double> [#uses=1]
- %tmp460461 = fpext float %iftmp.7.0 to double ; <double> [#uses=1]
- %tmp462463 = fpext float %iftmp.14.0 to double ; <double> [#uses=1]
- %tmp464465 = fpext float %iftmp.0.0 to double ; <double> [#uses=1]
- %tmp467 = tail call i32 (i8*, ...)* @printf( i8* getelementptr ([48 x i8]* @.str, i32 0, i32 0), double %tmp464465, double %tmp462463, double %tmp460461, double %tmp458459 ) nounwind ; <i32> [#uses=0]
- ret void
-}
-
-declare i32 @printf(i8*, ...) nounwind
diff --git a/release_23/test/CodeGen/X86/2008-02-20-InlineAsmClobber.ll b/release_23/test/CodeGen/X86/2008-02-20-InlineAsmClobber.ll
deleted file mode 100644
index d49d5bf9f9be..000000000000
--- a/release_23/test/CodeGen/X86/2008-02-20-InlineAsmClobber.ll
+++ /dev/null
@@ -1,24 +0,0 @@
-; RUN: llvm-as < %s | llc | grep {a: %ecx %ecx}
-; RUN: llvm-as < %s | llc | grep {b: %ecx %edx %ecx}
-; PR2078
-; The clobber list says that "ax" is clobbered. Make sure that eax isn't
-; allocated to the input/output register.
-target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
-target triple = "i386-apple-darwin8"
-@pixels = weak global i32 0 ; <i32*> [#uses=2]
-
-define void @test() nounwind {
-entry:
- %tmp = load i32* @pixels, align 4 ; <i32> [#uses=1]
- %tmp1 = tail call i32 asm sideeffect "a: $0 $1", "=r,0,~{dirflag},~{fpsr},~{flags},~{ax}"( i32 %tmp ) nounwind ; <i32> [#uses=1]
- store i32 %tmp1, i32* @pixels, align 4
- ret void
-}
-
-define void @test2(i16* %block, i8* %pixels, i32 %line_size) nounwind {
-entry:
- %tmp1 = getelementptr i16* %block, i32 64 ; <i16*> [#uses=1]
- %tmp3 = tail call i8* asm sideeffect "b: $0 $1 $2", "=r,r,0,~{dirflag},~{fpsr},~{flags},~{ax}"( i16* %tmp1, i8* %pixels ) nounwind ; <i8*> [#uses=0]
- ret void
-}
-
diff --git a/release_23/test/CodeGen/X86/2008-02-22-LocalRegAllocBug.ll b/release_23/test/CodeGen/X86/2008-02-22-LocalRegAllocBug.ll
deleted file mode 100644
index 8cf36425f22d..000000000000
--- a/release_23/test/CodeGen/X86/2008-02-22-LocalRegAllocBug.ll
+++ /dev/null
@@ -1,55 +0,0 @@
-; RUN: llvm-as < %s | llc -regalloc=local -march=x86 -mattr=+mmx | grep esi
-; PR2082
-; Local register allocator was refusing to use ESI, EDI, and EBP so it ran out of
-; registers.
-define void @transpose4x4(i8* %dst, i8* %src, i32 %dst_stride, i32 %src_stride) {
-entry:
- %dst_addr = alloca i8* ; <i8**> [#uses=5]
- %src_addr = alloca i8* ; <i8**> [#uses=5]
- %dst_stride_addr = alloca i32 ; <i32*> [#uses=4]
- %src_stride_addr = alloca i32 ; <i32*> [#uses=4]
- %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
- store i8* %dst, i8** %dst_addr
- store i8* %src, i8** %src_addr
- store i32 %dst_stride, i32* %dst_stride_addr
- store i32 %src_stride, i32* %src_stride_addr
- %tmp = load i8** %dst_addr, align 4 ; <i8*> [#uses=1]
- %tmp1 = getelementptr i8* %tmp, i32 0 ; <i8*> [#uses=1]
- %tmp12 = bitcast i8* %tmp1 to i32* ; <i32*> [#uses=1]
- %tmp3 = load i8** %dst_addr, align 4 ; <i8*> [#uses=1]
- %tmp4 = load i32* %dst_stride_addr, align 4 ; <i32> [#uses=1]
- %tmp5 = getelementptr i8* %tmp3, i32 %tmp4 ; <i8*> [#uses=1]
- %tmp56 = bitcast i8* %tmp5 to i32* ; <i32*> [#uses=1]
- %tmp7 = load i32* %dst_stride_addr, align 4 ; <i32> [#uses=1]
- %tmp8 = mul i32 %tmp7, 2 ; <i32> [#uses=1]
- %tmp9 = load i8** %dst_addr, align 4 ; <i8*> [#uses=1]
- %tmp10 = getelementptr i8* %tmp9, i32 %tmp8 ; <i8*> [#uses=1]
- %tmp1011 = bitcast i8* %tmp10 to i32* ; <i32*> [#uses=1]
- %tmp13 = load i32* %dst_stride_addr, align 4 ; <i32> [#uses=1]
- %tmp14 = mul i32 %tmp13, 3 ; <i32> [#uses=1]
- %tmp15 = load i8** %dst_addr, align 4 ; <i8*> [#uses=1]
- %tmp16 = getelementptr i8* %tmp15, i32 %tmp14 ; <i8*> [#uses=1]
- %tmp1617 = bitcast i8* %tmp16 to i32* ; <i32*> [#uses=1]
- %tmp18 = load i8** %src_addr, align 4 ; <i8*> [#uses=1]
- %tmp19 = getelementptr i8* %tmp18, i32 0 ; <i8*> [#uses=1]
- %tmp1920 = bitcast i8* %tmp19 to i32* ; <i32*> [#uses=1]
- %tmp21 = load i8** %src_addr, align 4 ; <i8*> [#uses=1]
- %tmp22 = load i32* %src_stride_addr, align 4 ; <i32> [#uses=1]
- %tmp23 = getelementptr i8* %tmp21, i32 %tmp22 ; <i8*> [#uses=1]
- %tmp2324 = bitcast i8* %tmp23 to i32* ; <i32*> [#uses=1]
- %tmp25 = load i32* %src_stride_addr, align 4 ; <i32> [#uses=1]
- %tmp26 = mul i32 %tmp25, 2 ; <i32> [#uses=1]
- %tmp27 = load i8** %src_addr, align 4 ; <i8*> [#uses=1]
- %tmp28 = getelementptr i8* %tmp27, i32 %tmp26 ; <i8*> [#uses=1]
- %tmp2829 = bitcast i8* %tmp28 to i32* ; <i32*> [#uses=1]
- %tmp30 = load i32* %src_stride_addr, align 4 ; <i32> [#uses=1]
- %tmp31 = mul i32 %tmp30, 3 ; <i32> [#uses=1]
- %tmp32 = load i8** %src_addr, align 4 ; <i8*> [#uses=1]
- %tmp33 = getelementptr i8* %tmp32, i32 %tmp31 ; <i8*> [#uses=1]
- %tmp3334 = bitcast i8* %tmp33 to i32* ; <i32*> [#uses=1]
- call void asm sideeffect "movd $4, %mm0 \0A\09movd $5, %mm1 \0A\09movd $6, %mm2 \0A\09movd $7, %mm3 \0A\09punpcklbw %mm1, %mm0 \0A\09punpcklbw %mm3, %mm2 \0A\09movq %mm0, %mm1 \0A\09punpcklwd %mm2, %mm0 \0A\09punpckhwd %mm2, %mm1 \0A\09movd %mm0, $0 \0A\09punpckhdq %mm0, %mm0 \0A\09movd %mm0, $1 \0A\09movd %mm1, $2 \0A\09punpckhdq %mm1, %mm1 \0A\09movd %mm1, $3 \0A\09", "=*m,=*m,=*m,=*m,*m,*m,*m,*m,~{dirflag},~{fpsr},~{flags}"( i32* %tmp12, i32* %tmp56, i32* %tmp1011, i32* %tmp1617, i32* %tmp1920, i32* %tmp2324, i32* %tmp2829, i32* %tmp3334 ) nounwind
- br label %return
-
-return: ; preds = %entry
- ret void
-}
diff --git a/release_23/test/CodeGen/X86/2008-02-22-ReMatBug.ll b/release_23/test/CodeGen/X86/2008-02-22-ReMatBug.ll
deleted file mode 100644
index fd97b61364d4..000000000000
--- a/release_23/test/CodeGen/X86/2008-02-22-ReMatBug.ll
+++ /dev/null
@@ -1,50 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -stats |& grep {Number of re-materialization} | grep 3
-; RUN: llvm-as < %s | llc -march=x86 -stats |& grep {Number of dead spill slots removed}
-; rdar://5761454
-
- %struct.quad_struct = type { i32, i32, %struct.quad_struct*, %struct.quad_struct*, %struct.quad_struct*, %struct.quad_struct*, %struct.quad_struct* }
-
-define fastcc %struct.quad_struct* @MakeTree(i32 %size, i32 %center_x, i32 %center_y, i32 %lo_proc, i32 %hi_proc, %struct.quad_struct* %parent, i32 %ct, i32 %level) nounwind {
-entry:
- br i1 true, label %bb43.i, label %bb.i
-
-bb.i: ; preds = %entry
- ret %struct.quad_struct* null
-
-bb43.i: ; preds = %entry
- br i1 true, label %CheckOutside.exit40.i, label %bb11.i38.i
-
-bb11.i38.i: ; preds = %bb43.i
- ret %struct.quad_struct* null
-
-CheckOutside.exit40.i: ; preds = %bb43.i
- br i1 true, label %CheckOutside.exit30.i, label %bb11.i28.i
-
-bb11.i28.i: ; preds = %CheckOutside.exit40.i
- ret %struct.quad_struct* null
-
-CheckOutside.exit30.i: ; preds = %CheckOutside.exit40.i
- br i1 true, label %CheckOutside.exit20.i, label %bb11.i18.i
-
-bb11.i18.i: ; preds = %CheckOutside.exit30.i
- ret %struct.quad_struct* null
-
-CheckOutside.exit20.i: ; preds = %CheckOutside.exit30.i
- br i1 true, label %bb34, label %bb11.i8.i
-
-bb11.i8.i: ; preds = %CheckOutside.exit20.i
- ret %struct.quad_struct* null
-
-bb34: ; preds = %CheckOutside.exit20.i
- %tmp15.reg2mem.0 = sdiv i32 %size, 2 ; <i32> [#uses=7]
- %tmp85 = sub i32 %center_y, %tmp15.reg2mem.0 ; <i32> [#uses=2]
- %tmp88 = sub i32 %center_x, %tmp15.reg2mem.0 ; <i32> [#uses=2]
- %tmp92 = tail call fastcc %struct.quad_struct* @MakeTree( i32 %tmp15.reg2mem.0, i32 %tmp88, i32 %tmp85, i32 0, i32 %hi_proc, %struct.quad_struct* null, i32 2, i32 0 ) nounwind ; <%struct.quad_struct*> [#uses=0]
- %tmp99 = add i32 0, %hi_proc ; <i32> [#uses=1]
- %tmp100 = sdiv i32 %tmp99, 2 ; <i32> [#uses=1]
- %tmp110 = tail call fastcc %struct.quad_struct* @MakeTree( i32 %tmp15.reg2mem.0, i32 0, i32 %tmp85, i32 0, i32 %tmp100, %struct.quad_struct* null, i32 3, i32 0 ) nounwind ; <%struct.quad_struct*> [#uses=0]
- %tmp122 = add i32 %tmp15.reg2mem.0, %center_y ; <i32> [#uses=2]
- %tmp129 = tail call fastcc %struct.quad_struct* @MakeTree( i32 %tmp15.reg2mem.0, i32 0, i32 %tmp122, i32 0, i32 0, %struct.quad_struct* null, i32 1, i32 0 ) nounwind ; <%struct.quad_struct*> [#uses=0]
- %tmp147 = tail call fastcc %struct.quad_struct* @MakeTree( i32 %tmp15.reg2mem.0, i32 %tmp88, i32 %tmp122, i32 %lo_proc, i32 0, %struct.quad_struct* null, i32 0, i32 0 ) nounwind ; <%struct.quad_struct*> [#uses=0]
- unreachable
-}
diff --git a/release_23/test/CodeGen/X86/2008-02-25-InlineAsmBug.ll b/release_23/test/CodeGen/X86/2008-02-25-InlineAsmBug.ll
deleted file mode 100644
index ff7cf5e94e25..000000000000
--- a/release_23/test/CodeGen/X86/2008-02-25-InlineAsmBug.ll
+++ /dev/null
@@ -1,33 +0,0 @@
-; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -mattr=+sse2
-; PR2076
-
-define void @h264_h_loop_filter_luma_mmx2(i8* %pix, i32 %stride, i32 %alpha, i32 %beta, i8* %tc0) nounwind {
-entry:
- %tmp164 = getelementptr [16 x i32]* null, i32 0, i32 11 ; <i32*> [#uses=1]
- %tmp169 = getelementptr [16 x i32]* null, i32 0, i32 13 ; <i32*> [#uses=1]
- %tmp174 = getelementptr [16 x i32]* null, i32 0, i32 15 ; <i32*> [#uses=1]
- %tmp154.sum317 = add i32 0, %stride ; <i32> [#uses=1]
- %tmp154.sum315 = mul i32 %stride, 6 ; <i32> [#uses=1]
- %tmp154.sum = mul i32 %stride, 7 ; <i32> [#uses=1]
- %pix_addr.0327.rec = mul i32 0, 0 ; <i32> [#uses=4]
- br i1 false, label %bb292, label %bb32
-
-bb32: ; preds = %entry
- %pix_addr.0327.sum340 = add i32 %pix_addr.0327.rec, 0 ; <i32> [#uses=1]
- %tmp154 = getelementptr i8* %pix, i32 %pix_addr.0327.sum340 ; <i8*> [#uses=1]
- %tmp177178 = bitcast i8* %tmp154 to i32* ; <i32*> [#uses=1]
- %pix_addr.0327.sum339 = add i32 %pix_addr.0327.rec, %tmp154.sum317 ; <i32> [#uses=1]
- %tmp181 = getelementptr i8* %pix, i32 %pix_addr.0327.sum339 ; <i8*> [#uses=1]
- %tmp181182 = bitcast i8* %tmp181 to i32* ; <i32*> [#uses=1]
- %pix_addr.0327.sum338 = add i32 %pix_addr.0327.rec, %tmp154.sum315 ; <i32> [#uses=1]
- %tmp186 = getelementptr i8* %pix, i32 %pix_addr.0327.sum338 ; <i8*> [#uses=1]
- %tmp186187 = bitcast i8* %tmp186 to i32* ; <i32*> [#uses=1]
- %pix_addr.0327.sum337 = add i32 %pix_addr.0327.rec, %tmp154.sum ; <i32> [#uses=1]
- %tmp191 = getelementptr i8* %pix, i32 %pix_addr.0327.sum337 ; <i8*> [#uses=1]
- %tmp191192 = bitcast i8* %tmp191 to i32* ; <i32*> [#uses=1]
- call void asm sideeffect "movd $4, %mm0 \0A\09movd $5, %mm1 \0A\09movd $6, %mm2 \0A\09movd $7, %mm3 \0A\09punpcklbw %mm1, %mm0 \0A\09punpcklbw %mm3, %mm2 \0A\09movq %mm0, %mm1 \0A\09punpcklwd %mm2, %mm0 \0A\09punpckhwd %mm2, %mm1 \0A\09movd %mm0, $0 \0A\09punpckhdq %mm0, %mm0 \0A\09movd %mm0, $1 \0A\09movd %mm1, $2 \0A\09punpckhdq %mm1, %mm1 \0A\09movd %mm1, $3 \0A\09", "=*m,=*m,=*m,=*m,*m,*m,*m,*m,~{dirflag},~{fpsr},~{flags}"( i32* null, i32* %tmp164, i32* %tmp169, i32* %tmp174, i32* %tmp177178, i32* %tmp181182, i32* %tmp186187, i32* %tmp191192 ) nounwind
- unreachable
-
-bb292: ; preds = %entry
- ret void
-}
diff --git a/release_23/test/CodeGen/X86/2008-02-25-X86-64-CoalescerBug.ll b/release_23/test/CodeGen/X86/2008-02-25-X86-64-CoalescerBug.ll
deleted file mode 100644
index 5d60bde85614..000000000000
--- a/release_23/test/CodeGen/X86/2008-02-25-X86-64-CoalescerBug.ll
+++ /dev/null
@@ -1,55 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86-64
-
- %struct.XX = type <{ i8 }>
- %struct.YY = type { i64 }
- %struct.ZZ = type opaque
-
-define i8 @f(%struct.XX*** %fontMap, %struct.XX* %uen) signext {
-entry:
- %tmp45 = add i16 0, 1 ; <i16> [#uses=2]
- br i1 false, label %bb124, label %bb53
-
-bb53: ; preds = %entry
- %tmp55 = call %struct.YY** @AA( i64 1, %struct.XX* %uen ) ; <%struct.YY**> [#uses=3]
- %tmp2728128 = load %struct.XX** null ; <%struct.XX*> [#uses=1]
- %tmp61 = load %struct.YY** %tmp55, align 8 ; <%struct.YY*> [#uses=1]
- %tmp62 = getelementptr %struct.YY* %tmp61, i32 0, i32 0 ; <i64*> [#uses=1]
- %tmp63 = load i64* %tmp62, align 8 ; <i64> [#uses=1]
- %tmp6566 = zext i16 %tmp45 to i64 ; <i64> [#uses=1]
- %tmp67 = shl i64 %tmp6566, 1 ; <i64> [#uses=1]
- call void @BB( %struct.YY** %tmp55, i64 %tmp67, i8 signext 0, %struct.XX* %uen )
- %tmp121131 = icmp eq i16 %tmp45, 1 ; <i1> [#uses=1]
- br i1 %tmp121131, label %bb124, label %bb70.preheader
-
-bb70.preheader: ; preds = %bb53
- %tmp72 = bitcast %struct.XX* %tmp2728128 to %struct.ZZ*** ; <%struct.ZZ***> [#uses=1]
- br label %bb70
-
-bb70: ; preds = %bb119, %bb70.preheader
- %indvar133 = phi i32 [ %indvar.next134, %bb119 ], [ 0, %bb70.preheader ] ; <i32> [#uses=2]
- %tmp.135 = trunc i64 %tmp63 to i32 ; <i32> [#uses=1]
- %tmp136 = shl i32 %indvar133, 1 ; <i32> [#uses=1]
- %DD = add i32 %tmp136, %tmp.135 ; <i32> [#uses=1]
- %tmp73 = load %struct.ZZ*** %tmp72, align 8 ; <%struct.ZZ**> [#uses=0]
- br i1 false, label %bb119, label %bb77
-
-bb77: ; preds = %bb70
- %tmp8384 = trunc i32 %DD to i16 ; <i16> [#uses=1]
- %tmp85 = sub i16 0, %tmp8384 ; <i16> [#uses=1]
- store i16 %tmp85, i16* null, align 8
- call void @CC( %struct.YY** %tmp55, i64 0, i64 2, i8* null, %struct.XX* %uen )
- ret i8 0
-
-bb119: ; preds = %bb70
- %indvar.next134 = add i32 %indvar133, 1 ; <i32> [#uses=1]
- br label %bb70
-
-bb124: ; preds = %bb53, %entry
- ret i8 undef
-}
-
-declare %struct.YY** @AA(i64, %struct.XX*)
-
-declare void @BB(%struct.YY**, i64, i8 signext , %struct.XX*)
-
-declare void @CC(%struct.YY**, i64, i64, i8*, %struct.XX*)
diff --git a/release_23/test/CodeGen/X86/2008-02-26-AsmDirectMemOp.ll b/release_23/test/CodeGen/X86/2008-02-26-AsmDirectMemOp.ll
deleted file mode 100644
index 3ba31f4ad900..000000000000
--- a/release_23/test/CodeGen/X86/2008-02-26-AsmDirectMemOp.ll
+++ /dev/null
@@ -1,17 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86
-
-target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32"
-target triple = "i386-pc-linux-gnu"
-
-define void @dct_unquantize_h263_intra_mmx(i16* %block, i32 %n, i32 %qscale) nounwind {
-entry:
- %tmp1 = shl i32 %qscale, 1 ; <i32> [#uses=1]
- br i1 false, label %bb46, label %bb59
-
-bb46: ; preds = %entry
- ret void
-
-bb59: ; preds = %entry
- tail call void asm sideeffect "movd $1, %mm6 \0A\09packssdw %mm6, %mm6 \0A\09packssdw %mm6, %mm6 \0A\09movd $2, %mm5 \0A\09pxor %mm7, %mm7 \0A\09packssdw %mm5, %mm5 \0A\09packssdw %mm5, %mm5 \0A\09psubw %mm5, %mm7 \0A\09pxor %mm4, %mm4 \0A\09.align 1<<4\0A\091: \0A\09movq ($0, $3), %mm0 \0A\09movq 8($0, $3), %mm1 \0A\09pmullw %mm6, %mm0 \0A\09pmullw %mm6, %mm1 \0A\09movq ($0, $3), %mm2 \0A\09movq 8($0, $3), %mm3 \0A\09pcmpgtw %mm4, %mm2 \0A\09pcmpgtw %mm4, %mm3 \0A\09pxor %mm2, %mm0 \0A\09pxor %mm3, %mm1 \0A\09paddw %mm7, %mm0 \0A\09paddw %mm7, %mm1 \0A\09pxor %mm0, %mm2 \0A\09pxor %mm1, %mm3 \0A\09pcmpeqw %mm7, %mm0 \0A\09pcmpeqw %mm7, %mm1 \0A\09pandn %mm2, %mm0 \0A\09pandn %mm3, %mm1 \0A\09movq %mm0, ($0, $3) \0A\09movq %mm1, 8($0, $3) \0A\09add $$16, $3 \0A\09jng 1b \0A\09", "r,imr,imr,r,~{dirflag},~{fpsr},~{flags},~{memory}"( i16* null, i32 %tmp1, i32 0, i32 0 ) nounwind
- ret void
-}
diff --git a/release_23/test/CodeGen/X86/2008-02-27-DeadSlotElimBug.ll b/release_23/test/CodeGen/X86/2008-02-27-DeadSlotElimBug.ll
deleted file mode 100644
index 96ac7a7608c8..000000000000
--- a/release_23/test/CodeGen/X86/2008-02-27-DeadSlotElimBug.ll
+++ /dev/null
@@ -1,66 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86
-
- %struct.CompAtom = type <{ %struct.Position, float, i32 }>
- %struct.Lattice = type { %struct.Position, %struct.Position, %struct.Position, %struct.Position, %struct.Position, %struct.Position, %struct.Position, i32, i32, i32 }
- %struct.Position = type { double, double, double }
-
-define fastcc %struct.CompAtom* @_ZNK7Lattice6createEP8CompAtomii(%struct.Lattice* %this, %struct.CompAtom* %d, i32 %n, i32 %i) {
-entry:
- %tmp18 = tail call i8* @_Znam( i32 0 ) ; <i8*> [#uses=1]
- %tmp1819 = bitcast i8* %tmp18 to %struct.CompAtom* ; <%struct.CompAtom*> [#uses=4]
- %tmp3286 = icmp eq i32 %n, 0 ; <i1> [#uses=1]
- br i1 %tmp3286, label %bb35, label %bb24
-
-bb24: ; preds = %bb24, %entry
- %tmp9.0.reg2mem.0.rec = phi i32 [ %indvar.next, %bb24 ], [ 0, %entry ] ; <i32> [#uses=3]
- %tmp3.i.i = getelementptr %struct.CompAtom* %tmp1819, i32 %tmp9.0.reg2mem.0.rec, i32 0, i32 1 ; <double*> [#uses=0]
- %tmp5.i.i = getelementptr %struct.CompAtom* %tmp1819, i32 %tmp9.0.reg2mem.0.rec, i32 0, i32 2 ; <double*> [#uses=1]
- store double -9.999900e+04, double* %tmp5.i.i, align 4
- %indvar.next = add i32 %tmp9.0.reg2mem.0.rec, 1 ; <i32> [#uses=2]
- %exitcond = icmp eq i32 %indvar.next, %n ; <i1> [#uses=1]
- br i1 %exitcond, label %bb35, label %bb24
-
-bb35: ; preds = %bb24, %entry
- %tmp42 = sdiv i32 %i, 9 ; <i32> [#uses=1]
- %tmp43 = add i32 %tmp42, -1 ; <i32> [#uses=1]
- %tmp4344 = sitofp i32 %tmp43 to double ; <double> [#uses=1]
- %tmp17.i76 = mul double %tmp4344, 0.000000e+00 ; <double> [#uses=1]
- %tmp48 = sdiv i32 %i, 3 ; <i32> [#uses=1]
- %tmp49 = srem i32 %tmp48, 3 ; <i32> [#uses=1]
- %tmp50 = add i32 %tmp49, -1 ; <i32> [#uses=1]
- %tmp5051 = sitofp i32 %tmp50 to double ; <double> [#uses=1]
- %tmp17.i63 = mul double %tmp5051, 0.000000e+00 ; <double> [#uses=1]
- %tmp55 = srem i32 %i, 3 ; <i32> [#uses=1]
- %tmp56 = add i32 %tmp55, -1 ; <i32> [#uses=1]
- %tmp5657 = sitofp i32 %tmp56 to double ; <double> [#uses=1]
- %tmp15.i49 = getelementptr %struct.Lattice* %this, i32 0, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp16.i50 = load double* %tmp15.i49, align 4 ; <double> [#uses=1]
- %tmp17.i = mul double %tmp5657, %tmp16.i50 ; <double> [#uses=1]
- %tmp20.i39 = add double %tmp17.i, %tmp17.i63 ; <double> [#uses=1]
- %tmp20.i23 = add double %tmp20.i39, %tmp17.i76 ; <double> [#uses=1]
- br i1 false, label %bb58.preheader, label %bb81
-
-bb58.preheader: ; preds = %bb35
- %smax = select i1 false, i32 1, i32 %n ; <i32> [#uses=1]
- br label %bb58
-
-bb58: ; preds = %bb58, %bb58.preheader
- %tmp20.i7 = getelementptr %struct.CompAtom* %d, i32 0, i32 2 ; <i32*> [#uses=2]
- %tmp25.i = getelementptr %struct.CompAtom* %tmp1819, i32 0, i32 2 ; <i32*> [#uses=2]
- %tmp74.i = load i32* %tmp20.i7, align 1 ; <i32> [#uses=1]
- %tmp82.i = and i32 %tmp74.i, 134217728 ; <i32> [#uses=1]
- %tmp85.i = or i32 0, %tmp82.i ; <i32> [#uses=1]
- store i32 %tmp85.i, i32* %tmp25.i, align 1
- %tmp88.i = load i32* %tmp20.i7, align 1 ; <i32> [#uses=1]
- %tmp95.i = and i32 %tmp88.i, -268435456 ; <i32> [#uses=1]
- %tmp97.i = or i32 0, %tmp95.i ; <i32> [#uses=1]
- store i32 %tmp97.i, i32* %tmp25.i, align 1
- %tmp6.i = add double 0.000000e+00, %tmp20.i23 ; <double> [#uses=0]
- %exitcond96 = icmp eq i32 0, %smax ; <i1> [#uses=1]
- br i1 %exitcond96, label %bb81, label %bb58
-
-bb81: ; preds = %bb58, %bb35
- ret %struct.CompAtom* %tmp1819
-}
-
-declare i8* @_Znam(i32)
diff --git a/release_23/test/CodeGen/X86/2008-02-27-PEICrash.ll b/release_23/test/CodeGen/X86/2008-02-27-PEICrash.ll
deleted file mode 100644
index b644d8f5863a..000000000000
--- a/release_23/test/CodeGen/X86/2008-02-27-PEICrash.ll
+++ /dev/null
@@ -1,33 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2
-
-define i64 @__divsc3(float %a, float %b, float %c, float %d) nounwind readnone {
-entry:
- br i1 false, label %bb56, label %bb33
-
-bb33: ; preds = %entry
- br label %bb56
-
-bb56: ; preds = %bb33, %entry
- %tmp36.pn = phi float [ 0.000000e+00, %bb33 ], [ 0.000000e+00, %entry ] ; <float> [#uses=1]
- %b.pn509 = phi float [ %b, %bb33 ], [ %a, %entry ] ; <float> [#uses=1]
- %a.pn = phi float [ %a, %bb33 ], [ %b, %entry ] ; <float> [#uses=1]
- %tmp41.pn508 = phi float [ 0.000000e+00, %bb33 ], [ 0.000000e+00, %entry ] ; <float> [#uses=1]
- %tmp51.pn = phi float [ 0.000000e+00, %bb33 ], [ %a, %entry ] ; <float> [#uses=1]
- %tmp44.pn = mul float %tmp36.pn, %b.pn509 ; <float> [#uses=1]
- %tmp46.pn = add float %tmp44.pn, %a.pn ; <float> [#uses=1]
- %tmp53.pn = sub float 0.000000e+00, %tmp51.pn ; <float> [#uses=1]
- %x.0 = fdiv float %tmp46.pn, %tmp41.pn508 ; <float> [#uses=1]
- %y.0 = fdiv float %tmp53.pn, 0.000000e+00 ; <float> [#uses=1]
- br i1 false, label %bb433, label %bb98
-
-bb98: ; preds = %bb56
- %tmp102 = mul float 0.000000e+00, %a ; <float> [#uses=1]
- %tmp106 = mul float 0.000000e+00, %b ; <float> [#uses=1]
- br label %bb433
-
-bb433: ; preds = %bb98, %bb56
- %x.1 = phi float [ %tmp102, %bb98 ], [ %x.0, %bb56 ] ; <float> [#uses=0]
- %y.1 = phi float [ %tmp106, %bb98 ], [ %y.0, %bb56 ] ; <float> [#uses=1]
- %tmp460 = add float %y.1, 0.000000e+00 ; <float> [#uses=0]
- ret i64 0
-}
diff --git a/release_23/test/CodeGen/X86/2008-03-06-frem-fpstack.ll b/release_23/test/CodeGen/X86/2008-03-06-frem-fpstack.ll
deleted file mode 100644
index 2d7182e733fb..000000000000
--- a/release_23/test/CodeGen/X86/2008-03-06-frem-fpstack.ll
+++ /dev/null
@@ -1,7 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -mcpu=i386
-; PR2122
-define float @func(float %a, float %b) nounwind {
-entry:
- %tmp3 = frem float %a, %b ; <float> [#uses=1]
- ret float %tmp3
-}
diff --git a/release_23/test/CodeGen/X86/2008-03-07-APIntBug.ll b/release_23/test/CodeGen/X86/2008-03-07-APIntBug.ll
deleted file mode 100644
index 5d1ccad745ad..000000000000
--- a/release_23/test/CodeGen/X86/2008-03-07-APIntBug.ll
+++ /dev/null
@@ -1,94 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -mcpu=i386 | not grep 255
-
- %struct.CONSTRAINT = type { i32, i32, i32, i32 }
- %struct.FIRST_UNION = type { %struct.anon }
- %struct.FOURTH_UNION = type { %struct.CONSTRAINT }
- %struct.LIST = type { %struct.rec*, %struct.rec* }
- %struct.SECOND_UNION = type { { i16, i8, i8 } }
- %struct.THIRD_UNION = type { { [2 x i32], [2 x i32] } }
- %struct.anon = type { i8, i8, i32 }
- %struct.head_type = type { [2 x %struct.LIST], %struct.FIRST_UNION, %struct.SECOND_UNION, %struct.THIRD_UNION, %struct.FOURTH_UNION, %struct.rec*, { %struct.rec* }, %struct.rec*, %struct.rec*, %struct.rec*, %struct.rec*, %struct.rec*, %struct.rec*, %struct.rec*, %struct.rec*, i32 }
- %struct.rec = type { %struct.head_type }
- %struct.symbol_type = type <{ [2 x %struct.LIST], %struct.FIRST_UNION, %struct.SECOND_UNION, %struct.rec*, %struct.rec*, %struct.rec*, %struct.rec*, %struct.rec*, %struct.rec*, %struct.rec*, %struct.rec*, %struct.rec*, i16, i16, i8, i8, i8, i8 }>
- %struct.word_type = type { [2 x %struct.LIST], %struct.FIRST_UNION, %struct.SECOND_UNION, %struct.THIRD_UNION, [4 x i8] }
-
-define void @InsertSym_bb1163(%struct.rec** %s) {
-newFuncRoot:
- br label %bb1163
-bb1233.exitStub: ; preds = %bb1163
- ret void
-bb1163: ; preds = %newFuncRoot
- %tmp1164 = load %struct.rec** %s, align 4 ; <%struct.rec*> [#uses=1]
- %tmp1165 = getelementptr %struct.rec* %tmp1164, i32 0, i32 0 ; <%struct.head_type*> [#uses=1]
- %tmp11651166 = bitcast %struct.head_type* %tmp1165 to %struct.symbol_type* ; <%struct.symbol_type*> [#uses=1]
- %tmp1167 = getelementptr %struct.symbol_type* %tmp11651166, i32 0, i32 3 ; <%struct.rec**> [#uses=1]
- %tmp1168 = load %struct.rec** %tmp1167, align 1 ; <%struct.rec*> [#uses=2]
- %tmp1169 = load %struct.rec** %s, align 4 ; <%struct.rec*> [#uses=1]
- %tmp1170 = getelementptr %struct.rec* %tmp1169, i32 0, i32 0 ; <%struct.head_type*> [#uses=1]
- %tmp11701171 = bitcast %struct.head_type* %tmp1170 to %struct.symbol_type* ; <%struct.symbol_type*> [#uses=1]
- %tmp1172 = getelementptr %struct.symbol_type* %tmp11701171, i32 0, i32 3 ; <%struct.rec**> [#uses=1]
- %tmp1173 = load %struct.rec** %tmp1172, align 1 ; <%struct.rec*> [#uses=2]
- %tmp1174 = getelementptr %struct.rec* %tmp1173, i32 0, i32 0 ; <%struct.head_type*> [#uses=1]
- %tmp11741175 = bitcast %struct.head_type* %tmp1174 to %struct.word_type* ; <%struct.word_type*> [#uses=1]
- %tmp1176 = getelementptr %struct.word_type* %tmp11741175, i32 0, i32 2 ; <%struct.SECOND_UNION*> [#uses=1]
- %tmp1177 = getelementptr %struct.SECOND_UNION* %tmp1176, i32 0, i32 0 ; <{ i16, i8, i8 }*> [#uses=1]
- %tmp11771178 = bitcast { i16, i8, i8 }* %tmp1177 to <{ i8, i8, i8, i8 }>* ; <<{ i8, i8, i8, i8 }>*> [#uses=1]
- %tmp1179 = getelementptr <{ i8, i8, i8, i8 }>* %tmp11771178, i32 0, i32 2 ; <i8*> [#uses=2]
- %mask1180 = and i8 1, 1 ; <i8> [#uses=2]
- %tmp1181 = load i8* %tmp1179, align 1 ; <i8> [#uses=1]
- %tmp1182 = shl i8 %mask1180, 7 ; <i8> [#uses=1]
- %tmp1183 = and i8 %tmp1181, 127 ; <i8> [#uses=1]
- %tmp1184 = or i8 %tmp1183, %tmp1182 ; <i8> [#uses=1]
- store i8 %tmp1184, i8* %tmp1179, align 1
- %mask1185 = and i8 %mask1180, 1 ; <i8> [#uses=0]
- %tmp1186 = getelementptr %struct.rec* %tmp1173, i32 0, i32 0 ; <%struct.head_type*> [#uses=1]
- %tmp11861187 = bitcast %struct.head_type* %tmp1186 to %struct.word_type* ; <%struct.word_type*> [#uses=1]
- %tmp1188 = getelementptr %struct.word_type* %tmp11861187, i32 0, i32 2 ; <%struct.SECOND_UNION*> [#uses=1]
- %tmp1189 = getelementptr %struct.SECOND_UNION* %tmp1188, i32 0, i32 0 ; <{ i16, i8, i8 }*> [#uses=1]
- %tmp11891190 = bitcast { i16, i8, i8 }* %tmp1189 to <{ i8, i8, i8, i8 }>* ; <<{ i8, i8, i8, i8 }>*> [#uses=1]
- %tmp1191 = getelementptr <{ i8, i8, i8, i8 }>* %tmp11891190, i32 0, i32 2 ; <i8*> [#uses=1]
- %tmp1192 = load i8* %tmp1191, align 1 ; <i8> [#uses=1]
- %tmp1193 = lshr i8 %tmp1192, 7 ; <i8> [#uses=1]
- %mask1194 = and i8 %tmp1193, 1 ; <i8> [#uses=2]
- %mask1195 = and i8 %mask1194, 1 ; <i8> [#uses=0]
- %tmp1196 = getelementptr %struct.rec* %tmp1168, i32 0, i32 0 ; <%struct.head_type*> [#uses=1]
- %tmp11961197 = bitcast %struct.head_type* %tmp1196 to %struct.word_type* ; <%struct.word_type*> [#uses=1]
- %tmp1198 = getelementptr %struct.word_type* %tmp11961197, i32 0, i32 2 ; <%struct.SECOND_UNION*> [#uses=1]
- %tmp1199 = getelementptr %struct.SECOND_UNION* %tmp1198, i32 0, i32 0 ; <{ i16, i8, i8 }*> [#uses=1]
- %tmp11991200 = bitcast { i16, i8, i8 }* %tmp1199 to <{ i8, i8, i8, i8 }>* ; <<{ i8, i8, i8, i8 }>*> [#uses=1]
- %tmp1201 = getelementptr <{ i8, i8, i8, i8 }>* %tmp11991200, i32 0, i32 1 ; <i8*> [#uses=2]
- %mask1202 = and i8 %mask1194, 1 ; <i8> [#uses=2]
- %tmp1203 = load i8* %tmp1201, align 1 ; <i8> [#uses=1]
- %tmp1204 = shl i8 %mask1202, 1 ; <i8> [#uses=1]
- %tmp1205 = and i8 %tmp1204, 2 ; <i8> [#uses=1]
- %tmp1206 = and i8 %tmp1203, -3 ; <i8> [#uses=1]
- %tmp1207 = or i8 %tmp1206, %tmp1205 ; <i8> [#uses=1]
- store i8 %tmp1207, i8* %tmp1201, align 1
- %mask1208 = and i8 %mask1202, 1 ; <i8> [#uses=0]
- %tmp1209 = getelementptr %struct.rec* %tmp1168, i32 0, i32 0 ; <%struct.head_type*> [#uses=1]
- %tmp12091210 = bitcast %struct.head_type* %tmp1209 to %struct.word_type* ; <%struct.word_type*> [#uses=1]
- %tmp1211 = getelementptr %struct.word_type* %tmp12091210, i32 0, i32 2 ; <%struct.SECOND_UNION*> [#uses=1]
- %tmp1212 = getelementptr %struct.SECOND_UNION* %tmp1211, i32 0, i32 0 ; <{ i16, i8, i8 }*> [#uses=1]
- %tmp12121213 = bitcast { i16, i8, i8 }* %tmp1212 to <{ i8, i8, i8, i8 }>* ; <<{ i8, i8, i8, i8 }>*> [#uses=1]
- %tmp1214 = getelementptr <{ i8, i8, i8, i8 }>* %tmp12121213, i32 0, i32 1 ; <i8*> [#uses=1]
- %tmp1215 = load i8* %tmp1214, align 1 ; <i8> [#uses=1]
- %tmp1216 = shl i8 %tmp1215, 6 ; <i8> [#uses=1]
- %tmp1217 = lshr i8 %tmp1216, 7 ; <i8> [#uses=1]
- %mask1218 = and i8 %tmp1217, 1 ; <i8> [#uses=2]
- %mask1219 = and i8 %mask1218, 1 ; <i8> [#uses=0]
- %tmp1220 = load %struct.rec** %s, align 4 ; <%struct.rec*> [#uses=1]
- %tmp1221 = getelementptr %struct.rec* %tmp1220, i32 0, i32 0 ; <%struct.head_type*> [#uses=1]
- %tmp12211222 = bitcast %struct.head_type* %tmp1221 to %struct.word_type* ; <%struct.word_type*> [#uses=1]
- %tmp1223 = getelementptr %struct.word_type* %tmp12211222, i32 0, i32 2 ; <%struct.SECOND_UNION*> [#uses=1]
- %tmp1224 = getelementptr %struct.SECOND_UNION* %tmp1223, i32 0, i32 0 ; <{ i16, i8, i8 }*> [#uses=1]
- %tmp12241225 = bitcast { i16, i8, i8 }* %tmp1224 to <{ i8, i8, i8, i8 }>* ; <<{ i8, i8, i8, i8 }>*> [#uses=1]
- %tmp1226 = getelementptr <{ i8, i8, i8, i8 }>* %tmp12241225, i32 0, i32 1 ; <i8*> [#uses=2]
- %mask1227 = and i8 %mask1218, 1 ; <i8> [#uses=2]
- %tmp1228 = load i8* %tmp1226, align 1 ; <i8> [#uses=1]
- %tmp1229 = and i8 %mask1227, 1 ; <i8> [#uses=1]
- %tmp1230 = and i8 %tmp1228, -2 ; <i8> [#uses=1]
- %tmp1231 = or i8 %tmp1230, %tmp1229 ; <i8> [#uses=1]
- store i8 %tmp1231, i8* %tmp1226, align 1
- %mask1232 = and i8 %mask1227, 1 ; <i8> [#uses=0]
- br label %bb1233.exitStub
-}
diff --git a/release_23/test/CodeGen/X86/2008-03-10-RegAllocInfLoop.ll b/release_23/test/CodeGen/X86/2008-03-10-RegAllocInfLoop.ll
deleted file mode 100644
index 10989885f0f1..000000000000
--- a/release_23/test/CodeGen/X86/2008-03-10-RegAllocInfLoop.ll
+++ /dev/null
@@ -1,15 +0,0 @@
-; RUN: llvm-as < %s | llc -mtriple=i386-pc-linux-gnu -relocation-model=pic -disable-fp-elim
-; RUN: llvm-as < %s | llc -mtriple=i386-pc-linux-gnu -relocation-model=pic -disable-fp-elim -schedule-livein-copies | not grep {Number of register spills}
-; PR2134
-
-declare fastcc i8* @w_addchar(i8*, i32*, i32*, i8 signext ) nounwind
-
-define x86_stdcallcc i32 @parse_backslash(i8** inreg %word, i32* inreg %word_length, i32* inreg %max_length) nounwind {
-entry:
- %tmp6 = load i8* null, align 1 ; <i8> [#uses=1]
- br label %bb13
-bb13: ; preds = %entry
- %tmp26 = call fastcc i8* @w_addchar( i8* null, i32* %word_length, i32* %max_length, i8 signext %tmp6 ) nounwind ; <i8*> [#uses=1]
- store i8* %tmp26, i8** %word, align 4
- ret i32 0
-}
diff --git a/release_23/test/CodeGen/X86/2008-03-12-ThreadLocalAlias.ll b/release_23/test/CodeGen/X86/2008-03-12-ThreadLocalAlias.ll
deleted file mode 100644
index 0f83b399ad7c..000000000000
--- a/release_23/test/CodeGen/X86/2008-03-12-ThreadLocalAlias.ll
+++ /dev/null
@@ -1,37 +0,0 @@
-; RUN: llvm-as < %s | llc -relocation-model=pic | grep TLSGD | count 2
-; PR2137
-
-; ModuleID = '1.c'
-target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32"
-target triple = "i386-pc-linux-gnu"
- %struct.__res_state = type { i32 }
-@__resp = thread_local global %struct.__res_state* @_res ; <%struct.__res_state**> [#uses=1]
-@_res = global %struct.__res_state zeroinitializer, section ".bss" ; <%struct.__res_state*> [#uses=1]
-
-@__libc_resp = hidden alias %struct.__res_state** @__resp ; <%struct.__res_state**> [#uses=2]
-
-define i32 @foo() {
-entry:
- %retval = alloca i32 ; <i32*> [#uses=1]
- %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
- %tmp = load %struct.__res_state** @__libc_resp, align 4 ; <%struct.__res_state*> [#uses=1]
- %tmp1 = getelementptr %struct.__res_state* %tmp, i32 0, i32 0 ; <i32*> [#uses=1]
- store i32 0, i32* %tmp1, align 4
- br label %return
-return: ; preds = %entry
- %retval2 = load i32* %retval ; <i32> [#uses=1]
- ret i32 %retval2
-}
-
-define i32 @bar() {
-entry:
- %retval = alloca i32 ; <i32*> [#uses=1]
- %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
- %tmp = load %struct.__res_state** @__libc_resp, align 4 ; <%struct.__res_state*> [#uses=1]
- %tmp1 = getelementptr %struct.__res_state* %tmp, i32 0, i32 0 ; <i32*> [#uses=1]
- store i32 1, i32* %tmp1, align 4
- br label %return
-return: ; preds = %entry
- %retval2 = load i32* %retval ; <i32> [#uses=1]
- ret i32 %retval2
-}
diff --git a/release_23/test/CodeGen/X86/2008-03-13-TwoAddrPassCrash.ll b/release_23/test/CodeGen/X86/2008-03-13-TwoAddrPassCrash.ll
deleted file mode 100644
index 4a896e9f33e1..000000000000
--- a/release_23/test/CodeGen/X86/2008-03-13-TwoAddrPassCrash.ll
+++ /dev/null
@@ -1,68 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86
-
-define i16 @t(i32 %depth) signext nounwind {
-entry:
- br i1 false, label %bb74, label %bb
-bb: ; preds = %entry
- ret i16 0
-bb74: ; preds = %entry
- switch i32 0, label %bail [
- i32 17, label %bb84
- i32 18, label %bb81
- i32 33, label %bb80
- i32 34, label %bb84
- ]
-bb80: ; preds = %bb74
- switch i32 %depth, label %bb103 [
- i32 16, label %bb96
- i32 32, label %bb91
- i32 846624121, label %bb96
- i32 1094862674, label %bb91
- i32 1096368963, label %bb91
- i32 1111970369, label %bb91
- i32 1278555445, label %bb96
- i32 1278555701, label %bb96
- i32 1380401729, label %bb91
- i32 1668118891, label %bb91
- i32 1916022840, label %bb91
- i32 1983131704, label %bb91
- i32 2037741171, label %bb96
- i32 2037741173, label %bb96
- ]
-bb81: ; preds = %bb74
- ret i16 0
-bb84: ; preds = %bb74, %bb74
- switch i32 %depth, label %bb103 [
- i32 16, label %bb96
- i32 32, label %bb91
- i32 846624121, label %bb96
- i32 1094862674, label %bb91
- i32 1096368963, label %bb91
- i32 1111970369, label %bb91
- i32 1278555445, label %bb96
- i32 1278555701, label %bb96
- i32 1380401729, label %bb91
- i32 1668118891, label %bb91
- i32 1916022840, label %bb91
- i32 1983131704, label %bb91
- i32 2037741171, label %bb96
- i32 2037741173, label %bb96
- ]
-bb91: ; preds = %bb84, %bb84, %bb84, %bb84, %bb84, %bb84, %bb84, %bb84, %bb80, %bb80, %bb80, %bb80, %bb80, %bb80, %bb80, %bb80
- %wMB.0.reg2mem.0 = phi i16 [ 16, %bb80 ], [ 16, %bb80 ], [ 16, %bb80 ], [ 16, %bb80 ], [ 16, %bb80 ], [ 16, %bb80 ], [ 16, %bb80 ], [ 16, %bb80 ], [ 0, %bb84 ], [ 0, %bb84 ], [ 0, %bb84 ], [ 0, %bb84 ], [ 0, %bb84 ], [ 0, %bb84 ], [ 0, %bb84 ], [ 0, %bb84 ] ; <i16> [#uses=2]
- %tmp941478 = shl i16 %wMB.0.reg2mem.0, 2 ; <i16> [#uses=1]
- br label %bb103
-bb96: ; preds = %bb84, %bb84, %bb84, %bb84, %bb84, %bb84, %bb80, %bb80, %bb80, %bb80, %bb80, %bb80
- ret i16 0
-bb103: ; preds = %bb91, %bb84, %bb80
- %wMB.0.reg2mem.2 = phi i16 [ %wMB.0.reg2mem.0, %bb91 ], [ 16, %bb80 ], [ 0, %bb84 ] ; <i16> [#uses=1]
- %bBump.0 = phi i16 [ %tmp941478, %bb91 ], [ 16, %bb80 ], [ 0, %bb84 ] ; <i16> [#uses=0]
- br i1 false, label %bb164, label %UnifiedReturnBlock
-bb164: ; preds = %bb103
- %tmp167168 = sext i16 %wMB.0.reg2mem.2 to i32 ; <i32> [#uses=0]
- ret i16 0
-bail: ; preds = %bb74
- ret i16 0
-UnifiedReturnBlock: ; preds = %bb103
- ret i16 0
-}
diff --git a/release_23/test/CodeGen/X86/2008-03-14-SpillerCrash.ll b/release_23/test/CodeGen/X86/2008-03-14-SpillerCrash.ll
deleted file mode 100644
index 544c9b5819ec..000000000000
--- a/release_23/test/CodeGen/X86/2008-03-14-SpillerCrash.ll
+++ /dev/null
@@ -1,48 +0,0 @@
-; RUN: llvm-as < %s | llc -mtriple=i386-pc-linux-gnu
-; PR2138
-
- %struct.__locale_struct = type { [13 x %struct.locale_data*], i16*, i32*, i32*, [13 x i8*] }
- %struct.anon = type { i8* }
- %struct.locale_data = type { i8*, i8*, i32, i32, { void (%struct.locale_data*)*, %struct.anon }, i32, i32, i32, [0 x %struct.locale_data_value] }
- %struct.locale_data_value = type { i32* }
-
-@wcstoll_l = alias i64 (i32*, i32**, i32, %struct.__locale_struct*)* @__wcstoll_l ; <i64 (i32*, i32**, i32, %struct.__locale_struct*)*> [#uses=0]
-
-define i64 @____wcstoll_l_internal(i32* %nptr, i32** %endptr, i32 %base, i32 %group, %struct.__locale_struct* %loc) nounwind {
-entry:
- %tmp27 = load i32* null, align 4 ; <i32> [#uses=1]
- %tmp83 = getelementptr i32* %nptr, i32 1 ; <i32*> [#uses=1]
- %tmp233 = add i32 0, -48 ; <i32> [#uses=1]
- br label %bb271.us
-bb271.us: ; preds = %entry
- br label %bb374.outer
-bb311.split: ; preds = %bb305.us
- %tmp313 = add i32 %tmp378.us, -48 ; <i32> [#uses=1]
- br i1 false, label %bb374.outer, label %bb383
-bb327.split: ; preds = %bb314.us
- ret i64 0
-bb374.outer: ; preds = %bb311.split, %bb271.us
- %tmp370371552.pn.in = phi i32 [ %tmp233, %bb271.us ], [ %tmp313, %bb311.split ] ; <i32> [#uses=1]
- %tmp278279.pn = phi i64 [ 0, %bb271.us ], [ %tmp373.reg2mem.0.ph, %bb311.split ] ; <i64> [#uses=1]
- %s.5.ph = phi i32* [ null, %bb271.us ], [ %tmp376.us, %bb311.split ] ; <i32*> [#uses=1]
- %tmp366367550.pn = sext i32 %base to i64 ; <i64> [#uses=1]
- %tmp370371552.pn = zext i32 %tmp370371552.pn.in to i64 ; <i64> [#uses=1]
- %tmp369551.pn = mul i64 %tmp278279.pn, %tmp366367550.pn ; <i64> [#uses=1]
- %tmp373.reg2mem.0.ph = add i64 %tmp370371552.pn, %tmp369551.pn ; <i64> [#uses=1]
- br label %bb374.us
-bb374.us: ; preds = %bb314.us, %bb374.outer
- %tmp376.us = getelementptr i32* %s.5.ph, i32 0 ; <i32*> [#uses=3]
- %tmp378.us = load i32* %tmp376.us, align 4 ; <i32> [#uses=2]
- %tmp302.us = icmp eq i32* %tmp376.us, %tmp83 ; <i1> [#uses=1]
- %bothcond484.us = or i1 false, %tmp302.us ; <i1> [#uses=1]
- br i1 %bothcond484.us, label %bb383, label %bb305.us
-bb305.us: ; preds = %bb374.us
- br i1 false, label %bb311.split, label %bb314.us
-bb314.us: ; preds = %bb305.us
- %tmp320.us = icmp eq i32 %tmp378.us, %tmp27 ; <i1> [#uses=1]
- br i1 %tmp320.us, label %bb374.us, label %bb327.split
-bb383: ; preds = %bb374.us, %bb311.split
- ret i64 0
-}
-
-declare i64 @__wcstoll_l(i32*, i32**, i32, %struct.__locale_struct*) nounwind
diff --git a/release_23/test/CodeGen/X86/2008-03-18-CoalescerBug.ll b/release_23/test/CodeGen/X86/2008-03-18-CoalescerBug.ll
deleted file mode 100644
index c3b4a257353a..000000000000
--- a/release_23/test/CodeGen/X86/2008-03-18-CoalescerBug.ll
+++ /dev/null
@@ -1,51 +0,0 @@
-; RUN: llvm-as < %s | llc -mtriple=i386-apple-darwin -mattr=+sse2 -disable-fp-elim | grep movss | count 1
-; RUN: llvm-as < %s | llc -mtriple=i386-apple-darwin -mattr=+sse2 -disable-fp-elim -stats |& grep {Number of re-materialization} | grep 1
-
- %struct..0objc_object = type opaque
- %struct.OhBoy = type { }
- %struct.BooHoo = type { i32 }
- %struct.objc_selector = type opaque
-@llvm.used = appending global [1 x i8*] [ i8* bitcast (void (%struct.OhBoy*, %struct.objc_selector*, i32, %struct.BooHoo*)* @"-[MessageHeaderDisplay adjustFontSizeBy:viewingState:]" to i8*) ], section "llvm.metadata" ; <[1 x i8*]*> [#uses=0]
-
-define void @"-[MessageHeaderDisplay adjustFontSizeBy:viewingState:]"(%struct.OhBoy* %self, %struct.objc_selector* %_cmd, i32 %delta, %struct.BooHoo* %viewingState) nounwind {
-entry:
- %tmp19 = load i32* null, align 4 ; <i32> [#uses=1]
- %tmp24 = tail call float bitcast (void (%struct..0objc_object*, ...)* @objc_msgSend_fpret to float (%struct..0objc_object*, %struct.objc_selector*)*)( %struct..0objc_object* null, %struct.objc_selector* null ) nounwind ; <float> [#uses=2]
- %tmp30 = icmp sgt i32 %delta, 0 ; <i1> [#uses=1]
- br i1 %tmp30, label %bb33, label %bb87.preheader
-bb33: ; preds = %entry
- %tmp28 = add float 0.000000e+00, %tmp24 ; <float> [#uses=1]
- %tmp35 = fcmp ogt float %tmp28, 1.800000e+01 ; <i1> [#uses=1]
- br i1 %tmp35, label %bb38, label %bb87.preheader
-bb38: ; preds = %bb33
- %tmp53 = add i32 %tmp19, %delta ; <i32> [#uses=2]
- br i1 false, label %bb50, label %bb43
-bb43: ; preds = %bb38
- store i32 %tmp53, i32* null, align 4
- ret void
-bb50: ; preds = %bb38
- %tmp56 = sub float 1.800000e+01, %tmp24 ; <float> [#uses=1]
- %tmp57 = fcmp ugt float 0.000000e+00, %tmp56 ; <i1> [#uses=1]
- br i1 %tmp57, label %bb64, label %bb87.preheader
-bb64: ; preds = %bb50
- ret void
-bb87.preheader: ; preds = %bb50, %bb33, %entry
- %usableDelta.0 = phi i32 [ %delta, %entry ], [ %delta, %bb33 ], [ %tmp53, %bb50 ] ; <i32> [#uses=1]
- %tmp100 = tail call %struct..0objc_object* (%struct..0objc_object*, %struct.objc_selector*, ...)* @objc_msgSend( %struct..0objc_object* null, %struct.objc_selector* null, %struct..0objc_object* null ) nounwind ; <%struct..0objc_object*> [#uses=2]
- %tmp106 = tail call %struct..0objc_object* (%struct..0objc_object*, %struct.objc_selector*, ...)* @objc_msgSend( %struct..0objc_object* %tmp100, %struct.objc_selector* null ) nounwind ; <%struct..0objc_object*> [#uses=0]
- %umax = select i1 false, i32 1, i32 0 ; <i32> [#uses=1]
- br label %bb108
-bb108: ; preds = %bb108, %bb87.preheader
- %attachmentIndex.0.reg2mem.0 = phi i32 [ 0, %bb87.preheader ], [ %indvar.next, %bb108 ] ; <i32> [#uses=2]
- %tmp114 = tail call %struct..0objc_object* (%struct..0objc_object*, %struct.objc_selector*, ...)* @objc_msgSend( %struct..0objc_object* %tmp100, %struct.objc_selector* null, i32 %attachmentIndex.0.reg2mem.0 ) nounwind ; <%struct..0objc_object*> [#uses=1]
- %tmp121 = tail call %struct..0objc_object* (%struct..0objc_object*, %struct.objc_selector*, ...)* @objc_msgSend( %struct..0objc_object* %tmp114, %struct.objc_selector* null, i32 %usableDelta.0 ) nounwind ; <%struct..0objc_object*> [#uses=0]
- %indvar.next = add i32 %attachmentIndex.0.reg2mem.0, 1 ; <i32> [#uses=2]
- %exitcond = icmp eq i32 %indvar.next, %umax ; <i1> [#uses=1]
- br i1 %exitcond, label %bb130, label %bb108
-bb130: ; preds = %bb108
- ret void
-}
-
-declare %struct..0objc_object* @objc_msgSend(%struct..0objc_object*, %struct.objc_selector*, ...)
-
-declare void @objc_msgSend_fpret(%struct..0objc_object*, ...)
diff --git a/release_23/test/CodeGen/X86/2008-03-19-DAGCombinerBug.ll b/release_23/test/CodeGen/X86/2008-03-19-DAGCombinerBug.ll
deleted file mode 100644
index 2fad32a36c3f..000000000000
--- a/release_23/test/CodeGen/X86/2008-03-19-DAGCombinerBug.ll
+++ /dev/null
@@ -1,14 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86
-
-define i32 @t() nounwind {
-entry:
- %tmp54 = add i32 0, 1 ; <i32> [#uses=1]
- br i1 false, label %bb71, label %bb77
-bb71: ; preds = %entry
- %tmp74 = shl i32 %tmp54, 1 ; <i32> [#uses=1]
- %tmp76 = ashr i32 %tmp74, 3 ; <i32> [#uses=1]
- br label %bb77
-bb77: ; preds = %bb71, %entry
- %payLoadSize.0 = phi i32 [ %tmp76, %bb71 ], [ 0, %entry ] ; <i32> [#uses=0]
- unreachable
-}
diff --git a/release_23/test/CodeGen/X86/2008-03-23-DarwinAsmComments.ll b/release_23/test/CodeGen/X86/2008-03-23-DarwinAsmComments.ll
deleted file mode 100644
index 3d5a86cd243a..000000000000
--- a/release_23/test/CodeGen/X86/2008-03-23-DarwinAsmComments.ll
+++ /dev/null
@@ -1,49 +0,0 @@
-; RUN: llvm-as < %s | llc -mtriple=i386-apple-darwin | grep {#} | not grep -v {##}
-
- %struct.AGenericCall = type { %struct.AGenericManager*, %struct.ComponentParameters*, i32* }
- %struct.AGenericManager = type <{ i8 }>
- %struct.ComponentInstanceRecord = type opaque
- %struct.ComponentParameters = type { [1 x i64] }
-
-define i32 @_ZN12AGenericCall10MapIDPtrAtEsRP23ComponentInstanceRecord(%struct.AGenericCall* %this, i16 signext %param, %struct.ComponentInstanceRecord** %instance) {
-entry:
- %tmp4 = icmp slt i16 %param, 0 ; <i1> [#uses=1]
- br i1 %tmp4, label %cond_true, label %cond_next
-
-cond_true: ; preds = %entry
- %tmp1415 = shl i16 %param, 3 ; <i16> [#uses=1]
- %tmp17 = getelementptr %struct.AGenericCall* %this, i32 0, i32 1 ; <%struct.ComponentParameters**> [#uses=1]
- %tmp18 = load %struct.ComponentParameters** %tmp17, align 8 ; <%struct.ComponentParameters*> [#uses=1]
- %tmp1920 = bitcast %struct.ComponentParameters* %tmp18 to i8* ; <i8*> [#uses=1]
- %tmp212223 = sext i16 %tmp1415 to i64 ; <i64> [#uses=1]
- %tmp24 = getelementptr i8* %tmp1920, i64 %tmp212223 ; <i8*> [#uses=1]
- %tmp2425 = bitcast i8* %tmp24 to i64* ; <i64*> [#uses=1]
- %tmp28 = load i64* %tmp2425, align 8 ; <i64> [#uses=1]
- %tmp2829 = inttoptr i64 %tmp28 to i32* ; <i32*> [#uses=1]
- %tmp31 = getelementptr %struct.AGenericCall* %this, i32 0, i32 2 ; <i32**> [#uses=1]
- store i32* %tmp2829, i32** %tmp31, align 8
- br label %cond_next
-
-cond_next: ; preds = %cond_true, %entry
- %tmp4243 = shl i16 %param, 3 ; <i16> [#uses=1]
- %tmp46 = getelementptr %struct.AGenericCall* %this, i32 0, i32 1 ; <%struct.ComponentParameters**> [#uses=1]
- %tmp47 = load %struct.ComponentParameters** %tmp46, align 8 ; <%struct.ComponentParameters*> [#uses=1]
- %tmp4849 = bitcast %struct.ComponentParameters* %tmp47 to i8* ; <i8*> [#uses=1]
- %tmp505152 = sext i16 %tmp4243 to i64 ; <i64> [#uses=1]
- %tmp53 = getelementptr i8* %tmp4849, i64 %tmp505152 ; <i8*> [#uses=1]
- %tmp5354 = bitcast i8* %tmp53 to i64* ; <i64*> [#uses=1]
- %tmp58 = load i64* %tmp5354, align 8 ; <i64> [#uses=1]
- %tmp59 = icmp eq i64 %tmp58, 0 ; <i1> [#uses=1]
- br i1 %tmp59, label %UnifiedReturnBlock, label %cond_true63
-
-cond_true63: ; preds = %cond_next
- %tmp65 = getelementptr %struct.AGenericCall* %this, i32 0, i32 0 ; <%struct.AGenericManager**> [#uses=1]
- %tmp66 = load %struct.AGenericManager** %tmp65, align 8 ; <%struct.AGenericManager*> [#uses=1]
- %tmp69 = tail call i32 @_ZN15AGenericManager24DefaultComponentInstanceERP23ComponentInstanceRecord( %struct.AGenericManager* %tmp66, %struct.ComponentInstanceRecord** %instance ) ; <i32> [#uses=1]
- ret i32 %tmp69
-
-UnifiedReturnBlock: ; preds = %cond_next
- ret i32 undef
-}
-
-declare i32 @_ZN15AGenericManager24DefaultComponentInstanceERP23ComponentInstanceRecord(%struct.AGenericManager*, %struct.ComponentInstanceRecord**)
diff --git a/release_23/test/CodeGen/X86/2008-03-25-TwoAddrPassBug.ll b/release_23/test/CodeGen/X86/2008-03-25-TwoAddrPassBug.ll
deleted file mode 100644
index 1e5ab99a9c88..000000000000
--- a/release_23/test/CodeGen/X86/2008-03-25-TwoAddrPassBug.ll
+++ /dev/null
@@ -1,24 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2
-
-define void @t() {
-entry:
- %tmp455 = shufflevector <4 x float> zeroinitializer, <4 x float> undef, <4 x i32> < i32 1, i32 0, i32 3, i32 2 > ; <<4 x float>> [#uses=1]
- %tmp457 = mul <4 x float> zeroinitializer, %tmp455 ; <<4 x float>> [#uses=2]
- %tmp461 = shufflevector <4 x float> %tmp457, <4 x float> undef, <4 x i32> zeroinitializer ; <<4 x float>> [#uses=1]
- %tmp465 = shufflevector <4 x float> %tmp457, <4 x float> undef, <4 x i32> < i32 1, i32 1, i32 1, i32 1 > ; <<4 x float>> [#uses=1]
- %tmp466 = sub <4 x float> %tmp461, %tmp465 ; <<4 x float>> [#uses=1]
- %tmp536 = shufflevector <4 x float> zeroinitializer, <4 x float> %tmp466, <4 x i32> < i32 0, i32 4, i32 1, i32 5 > ; <<4 x float>> [#uses=1]
- %tmp542 = shufflevector <4 x float> %tmp536, <4 x float> zeroinitializer, <4 x i32> < i32 6, i32 7, i32 2, i32 3 > ; <<4 x float>> [#uses=1]
- %tmp580 = bitcast <4 x float> %tmp542 to <4 x i32> ; <<4 x i32>> [#uses=1]
- %tmp582 = and <4 x i32> %tmp580, zeroinitializer ; <<4 x i32>> [#uses=1]
- %tmp591 = or <4 x i32> %tmp582, zeroinitializer ; <<4 x i32>> [#uses=1]
- %tmp592 = bitcast <4 x i32> %tmp591 to <4 x float> ; <<4 x float>> [#uses=1]
- %tmp609 = fdiv <4 x float> < float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00 >, %tmp592 ; <<4 x float>> [#uses=1]
- %tmp652 = shufflevector <4 x float> %tmp609, <4 x float> undef, <4 x i32> < i32 3, i32 3, i32 3, i32 3 > ; <<4 x float>> [#uses=1]
- %tmp662 = mul <4 x float> zeroinitializer, %tmp652 ; <<4 x float>> [#uses=1]
- %tmp678 = shufflevector <4 x float> %tmp662, <4 x float> undef, <4 x i32> < i32 1, i32 1, i32 1, i32 1 > ; <<4 x float>> [#uses=1]
- %tmp753 = mul <4 x float> zeroinitializer, %tmp678 ; <<4 x float>> [#uses=1]
- %tmp754 = sub <4 x float> zeroinitializer, %tmp753 ; <<4 x float>> [#uses=1]
- store <4 x float> %tmp754, <4 x float>* null, align 16
- unreachable
-}
diff --git a/release_23/test/CodeGen/X86/2008-03-31-SpillerFoldingBug.ll b/release_23/test/CodeGen/X86/2008-03-31-SpillerFoldingBug.ll
deleted file mode 100644
index 83e1d60fcbaf..000000000000
--- a/release_23/test/CodeGen/X86/2008-03-31-SpillerFoldingBug.ll
+++ /dev/null
@@ -1,40 +0,0 @@
-; RUN: llvm-as < %s | llc -mtriple=i386-apple-darwin -relocation-model=pic -disable-fp-elim | grep add | grep 12 | not grep non_lazy_ptr
-; Don't fold re-materialized load into a two address instruction
-
- %"struct.Smarts::Runnable" = type { i32 (...)**, i32 }
- %struct.__sbuf = type { i8*, i32 }
- %"struct.std::ios_base" = type { i32 (...)**, i32, i32, i32, i32, i32, %"struct.std::ios_base::_Callback_list"*, %struct.__sbuf, [8 x %struct.__sbuf], i32, %struct.__sbuf*, %"struct.std::locale" }
- %"struct.std::ios_base::_Callback_list" = type { %"struct.std::ios_base::_Callback_list"*, void (i32, %"struct.std::ios_base"*, i32)*, i32, i32 }
- %"struct.std::locale" = type { %"struct.std::locale::_Impl"* }
- %"struct.std::locale::_Impl" = type { i32, %"struct.Smarts::Runnable"**, i32, %"struct.Smarts::Runnable"**, i8** }
-@_ZTVSt9basic_iosIcSt11char_traitsIcEE = external constant [4 x i32 (...)*] ; <[4 x i32 (...)*]*> [#uses=1]
-@_ZTTSt19basic_ostringstreamIcSt11char_traitsIcESaIcEE = external constant [4 x i8*] ; <[4 x i8*]*> [#uses=1]
-@_ZTVSt19basic_ostringstreamIcSt11char_traitsIcESaIcEE = external constant [10 x i32 (...)*] ; <[10 x i32 (...)*]*> [#uses=2]
-@_ZTVSt15basic_streambufIcSt11char_traitsIcEE = external constant [16 x i32 (...)*] ; <[16 x i32 (...)*]*> [#uses=1]
-@_ZTVSt15basic_stringbufIcSt11char_traitsIcESaIcEE = external constant [16 x i32 (...)*] ; <[16 x i32 (...)*]*> [#uses=1]
-
-define void @_GLOBAL__I__ZN5Pooma5pinfoE() nounwind {
-entry:
- store i32 (...)** getelementptr ([10 x i32 (...)*]* @_ZTVSt19basic_ostringstreamIcSt11char_traitsIcESaIcEE, i32 0, i32 8), i32 (...)*** null, align 4
- %tmp96.i.i142.i = call i8* @_Znwm( i32 180 ) nounwind ; <i8*> [#uses=2]
- call void @_ZNSt8ios_baseC2Ev( %"struct.std::ios_base"* null ) nounwind
- store i32 (...)** getelementptr ([4 x i32 (...)*]* @_ZTVSt9basic_iosIcSt11char_traitsIcEE, i32 0, i32 2), i32 (...)*** null, align 4
- store i32 (...)** null, i32 (...)*** null, align 4
- %ctg2242.i.i163.i = getelementptr i8* %tmp96.i.i142.i, i32 0 ; <i8*> [#uses=1]
- %tmp150.i.i164.i = load i8** getelementptr ([4 x i8*]* @_ZTTSt19basic_ostringstreamIcSt11char_traitsIcESaIcEE, i32 0, i64 2), align 4 ; <i8*> [#uses=1]
- %tmp150151.i.i165.i = bitcast i8* %tmp150.i.i164.i to i32 (...)** ; <i32 (...)**> [#uses=1]
- %tmp153.i.i166.i = bitcast i8* %ctg2242.i.i163.i to i32 (...)*** ; <i32 (...)***> [#uses=1]
- store i32 (...)** %tmp150151.i.i165.i, i32 (...)*** %tmp153.i.i166.i, align 4
- %tmp159.i.i167.i = bitcast i8* %tmp96.i.i142.i to i32 (...)*** ; <i32 (...)***> [#uses=1]
- store i32 (...)** getelementptr ([10 x i32 (...)*]* @_ZTVSt19basic_ostringstreamIcSt11char_traitsIcESaIcEE, i32 0, i32 3), i32 (...)*** %tmp159.i.i167.i, align 4
- store i32 (...)** getelementptr ([16 x i32 (...)*]* @_ZTVSt15basic_streambufIcSt11char_traitsIcEE, i32 0, i32 2), i32 (...)*** null, align 4
- call void @_ZNSt6localeC1Ev( %"struct.std::locale"* null ) nounwind
- store i32 (...)** getelementptr ([16 x i32 (...)*]* @_ZTVSt15basic_stringbufIcSt11char_traitsIcESaIcEE, i32 0, i32 2), i32 (...)*** null, align 4
- unreachable
-}
-
-declare i8* @_Znwm(i32)
-
-declare void @_ZNSt8ios_baseC2Ev(%"struct.std::ios_base"*)
-
-declare void @_ZNSt6localeC1Ev(%"struct.std::locale"*) nounwind
diff --git a/release_23/test/CodeGen/X86/2008-04-02-unnamedEH.ll b/release_23/test/CodeGen/X86/2008-04-02-unnamedEH.ll
deleted file mode 100644
index fff75ff660a7..000000000000
--- a/release_23/test/CodeGen/X86/2008-04-02-unnamedEH.ll
+++ /dev/null
@@ -1,27 +0,0 @@
-; RUN: llvm-as < %s | llc | grep unnamed_1_0.eh
-; ModuleID = '<stdin>'
-target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
-target triple = "i386-apple-darwin8"
-
-define void @_Z3bazv() {
- call i32 @0( ) ; <i32>:1 [#uses=0]
- br label %2
-; <label>:2 ; preds = %0
- ret void
-}
-
-define internal i32 @""() {
- alloca i32 ; <i32*>:1 [#uses=2]
- alloca i32 ; <i32*>:2 [#uses=2]
- bitcast i32 0 to i32 ; <i32>:3 [#uses=0]
- call i32 @_Z3barv( ) ; <i32>:4 [#uses=1]
- store i32 %4, i32* %2, align 4
- load i32* %2, align 4 ; <i32>:5 [#uses=1]
- store i32 %5, i32* %1, align 4
- br label %6
-; <label>:6 ; preds = %0
- load i32* %1 ; <i32>:7 [#uses=1]
- ret i32 %7
-}
-
-declare i32 @_Z3barv()
diff --git a/release_23/test/CodeGen/X86/2008-04-08-CoalescerCrash.ll b/release_23/test/CodeGen/X86/2008-04-08-CoalescerCrash.ll
deleted file mode 100644
index f5de113b9ea9..000000000000
--- a/release_23/test/CodeGen/X86/2008-04-08-CoalescerCrash.ll
+++ /dev/null
@@ -1,19 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+mmx
-
-define i32 @t2() nounwind {
-entry:
- tail call void asm sideeffect "# top of block", "~{dirflag},~{fpsr},~{flags},~{di},~{si},~{dx},~{cx},~{ax}"( ) nounwind
- tail call void asm sideeffect ".file \224443946.c\22", "~{dirflag},~{fpsr},~{flags}"( ) nounwind
- tail call void asm sideeffect ".line 8", "~{dirflag},~{fpsr},~{flags}"( ) nounwind
- %tmp1 = tail call <2 x i32> asm sideeffect "movd $1, $0", "=={mm4},{bp},~{dirflag},~{fpsr},~{flags},~{memory}"( i32 undef ) nounwind ; <<2 x i32>> [#uses=1]
- tail call void asm sideeffect ".file \224443946.c\22", "~{dirflag},~{fpsr},~{flags}"( ) nounwind
- tail call void asm sideeffect ".line 9", "~{dirflag},~{fpsr},~{flags}"( ) nounwind
- %tmp3 = tail call i32 asm sideeffect "movd $1, $0", "=={bp},{mm3},~{dirflag},~{fpsr},~{flags},~{memory}"( <2 x i32> undef ) nounwind ; <i32> [#uses=1]
- tail call void asm sideeffect ".file \224443946.c\22", "~{dirflag},~{fpsr},~{flags}"( ) nounwind
- tail call void asm sideeffect ".line 10", "~{dirflag},~{fpsr},~{flags}"( ) nounwind
- tail call void asm sideeffect "movntq $0, 0($1,$2)", "{mm0},{di},{bp},~{dirflag},~{fpsr},~{flags},~{memory}"( <2 x i32> undef, i32 undef, i32 %tmp3 ) nounwind
- tail call void asm sideeffect ".file \224443946.c\22", "~{dirflag},~{fpsr},~{flags}"( ) nounwind
- tail call void asm sideeffect ".line 11", "~{dirflag},~{fpsr},~{flags}"( ) nounwind
- %tmp8 = tail call i32 asm sideeffect "movd $1, $0", "=={bp},{mm4},~{dirflag},~{fpsr},~{flags},~{memory}"( <2 x i32> %tmp1 ) nounwind ; <i32> [#uses=0]
- ret i32 undef
-}
diff --git a/release_23/test/CodeGen/X86/2008-04-09-BranchFolding.ll b/release_23/test/CodeGen/X86/2008-04-09-BranchFolding.ll
deleted file mode 100644
index fea54c4e5ecf..000000000000
--- a/release_23/test/CodeGen/X86/2008-04-09-BranchFolding.ll
+++ /dev/null
@@ -1,48 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 | not grep jmp
-
- %struct..0anon = type { i32 }
- %struct.binding_level = type { %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.binding_level*, i8, i8, i8, i8, i8, i32, %struct.tree_node* }
- %struct.lang_decl = type opaque
- %struct.rtx_def = type { i16, i8, i8, [1 x %struct..0anon] }
- %struct.tree_decl = type { [12 x i8], i8*, i32, %struct.tree_node*, i32, i8, i8, i8, i8, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.rtx_def*, %struct..0anon, { %struct.rtx_def* }, %struct.tree_node*, %struct.lang_decl* }
- %struct.tree_node = type { %struct.tree_decl }
-
-define fastcc %struct.tree_node* @pushdecl(%struct.tree_node* %x) nounwind {
-entry:
- %tmp3.i40 = icmp eq %struct.binding_level* null, null ; <i1> [#uses=2]
- br i1 false, label %bb143, label %bb140
-bb140: ; preds = %entry
- br i1 %tmp3.i40, label %bb160, label %bb17.i
-bb17.i: ; preds = %bb140
- ret %struct.tree_node* null
-bb143: ; preds = %entry
- %tmp8.i43 = load %struct.tree_node** null, align 4 ; <%struct.tree_node*> [#uses=1]
- br i1 %tmp3.i40, label %bb160, label %bb9.i48
-bb9.i48: ; preds = %bb143
- ret %struct.tree_node* null
-bb160: ; preds = %bb143, %bb140
- %t.0.reg2mem.0 = phi %struct.tree_node* [ null, %bb140 ], [ %tmp8.i43, %bb143 ] ; <%struct.tree_node*> [#uses=1]
- %tmp162 = icmp eq %struct.tree_node* %t.0.reg2mem.0, null ; <i1> [#uses=2]
- br i1 %tmp162, label %bb174, label %bb165
-bb165: ; preds = %bb160
- br label %bb174
-bb174: ; preds = %bb165, %bb160
- %line.0 = phi i32 [ 0, %bb165 ], [ undef, %bb160 ] ; <i32> [#uses=1]
- %file.0 = phi i8* [ null, %bb165 ], [ undef, %bb160 ] ; <i8*> [#uses=1]
- br i1 %tmp162, label %bb344, label %bb73.i
-bb73.i: ; preds = %bb174
- br i1 false, label %bb226.i, label %bb220.i
-bb220.i: ; preds = %bb73.i
- ret %struct.tree_node* null
-bb226.i: ; preds = %bb73.i
- br i1 false, label %bb260, label %bb273.i
-bb273.i: ; preds = %bb226.i
- ret %struct.tree_node* null
-bb260: ; preds = %bb226.i
- tail call void (i8*, i32, ...)* @pedwarn_with_file_and_line( i8* %file.0, i32 %line.0, i8* null ) nounwind
- ret %struct.tree_node* null
-bb344: ; preds = %bb174
- ret %struct.tree_node* null
-}
-
-declare void @pedwarn_with_file_and_line(i8*, i32, ...) nounwind
diff --git a/release_23/test/CodeGen/X86/2008-04-15-LiveVariableBug.ll b/release_23/test/CodeGen/X86/2008-04-15-LiveVariableBug.ll
deleted file mode 100644
index 8cdff563a3bf..000000000000
--- a/release_23/test/CodeGen/X86/2008-04-15-LiveVariableBug.ll
+++ /dev/null
@@ -1,49 +0,0 @@
-; RUN: llvm-as < %s | llc -mtriple=x86_64-apple-darwin
-; RUN: llvm-as < %s | llc -mtriple=x86_64-apple-darwin -relocation-model=pic -disable-fp-elim -fast -regalloc=local
-
- %struct.CGPoint = type { double, double }
- %struct.NSArray = type { %struct.NSObject }
- %struct.NSAssertionHandler = type { %struct.NSObject, i8* }
- %struct.NSDockTile = type { %struct.NSObject, %struct.NSObject*, i8*, %struct.NSView*, %struct.NSView*, %struct.NSView*, %struct.NSArray*, %struct._SPFlags, %struct.CGPoint, [5 x %struct.NSObject*] }
- %struct.NSDocument = type { %struct.NSObject, %struct.NSWindow*, %struct.NSObject*, %struct.NSURL*, %struct.NSArray*, %struct.NSPrintInfo*, i64, %struct.NSView*, %struct.NSObject*, %struct.NSObject*, %struct.NSUndoManager*, %struct._BCFlags2, %struct.NSArray* }
- %struct.AA = type { %struct.NSObject, %struct.NSDocument*, %struct.NSURL*, %struct.NSArray*, %struct.NSArray* }
- %struct.NSError = type { %struct.NSObject, i8*, i64, %struct.NSArray*, %struct.NSArray* }
- %struct.NSImage = type { %struct.NSObject, %struct.NSArray*, %struct.CGPoint, %struct._BCFlags2, %struct.NSObject*, %struct._NSImageAuxiliary* }
- %struct.NSMutableArray = type { %struct.NSArray }
- %struct.NSObject = type { %struct.NSObject* }
- %struct.NSPrintInfo = type { %struct.NSObject, %struct.NSMutableArray*, %struct.NSObject* }
- %struct.NSRect = type { %struct.CGPoint, %struct.CGPoint }
- %struct.NSRegion = type opaque
- %struct.NSResponder = type { %struct.NSObject, %struct.NSObject* }
- %struct.NSToolbar = type { %struct.NSObject, %struct.NSArray*, %struct.NSMutableArray*, %struct.NSMutableArray*, %struct.NSArray*, %struct.NSObject*, %struct.NSArray*, i8*, %struct.NSObject*, %struct.NSWindow*, %struct.NSObject*, %struct.NSObject*, i64, %struct._BCFlags2, i64, %struct.NSObject* }
- %struct.NSURL = type { %struct.NSObject, %struct.NSArray*, %struct.NSURL*, i8*, i8* }
- %struct.NSUndoManager = type { %struct.NSObject, %struct.NSObject*, %struct.NSObject*, %struct.NSArray*, i64, %struct._SPFlags, %struct.NSObject*, i8*, i8*, i8* }
- %struct.NSView = type { %struct.NSResponder, %struct.NSRect, %struct.NSRect, %struct.NSObject*, %struct.NSObject*, %struct.NSWindow*, %struct.NSObject*, %struct.NSObject*, %struct.NSObject*, %struct.NSObject*, %struct._NSViewAuxiliary*, %struct._BCFlags, %struct._SPFlags }
- %struct.NSWindow = type { %struct.NSResponder, %struct.NSRect, %struct.NSObject*, %struct.NSObject*, %struct.NSResponder*, %struct.NSView*, %struct.NSView*, %struct.NSObject*, %struct.NSObject*, i32, i64, i32, %struct.NSArray*, %struct.NSObject*, i8, i8, i8, i8, i8*, i8*, %struct.NSImage*, i32, %struct.NSMutableArray*, %struct.NSURL*, %struct.CGPoint*, %struct.NSArray*, %struct.NSArray*, %struct.__wFlags, %struct.NSObject*, %struct.NSView*, %struct.NSWindowAuxiliary* }
- %struct.NSWindowAuxiliary = type { %struct.NSObject, %struct.NSArray*, %struct.NSDockTile*, %struct._NSWindowAnimator*, %struct.NSRect, i32, %struct.NSAssertionHandler*, %struct.NSUndoManager*, %struct.NSWindowController*, %struct.NSAssertionHandler*, %struct.NSObject*, i32, %struct.__CFRunLoopObserver*, %struct.__CFRunLoopObserver*, %struct.NSArray*, %struct.NSArray*, %struct.NSView*, %struct.NSRegion*, %struct.NSWindow*, %struct.NSWindow*, %struct.NSArray*, %struct.NSMutableArray*, %struct.NSArray*, %struct.NSWindow*, %struct.CGPoint, %struct.NSObject*, i8*, i8*, i32, %struct.NSObject*, %struct.NSArray*, double, %struct.CGPoint, %struct.NSArray*, %struct.NSMutableArray*, %struct.NSMutableArray*, %struct.NSWindow*, %struct.NSView*, %struct.NSArray*, %struct.__auxWFlags, i32, i8*, double, %struct.NSObject*, %struct.NSObject*, %struct.__CFArray*, %struct.NSRegion*, %struct.NSArray*, %struct.NSRect, %struct.NSToolbar*, %struct.NSRect, %struct.NSMutableArray* }
- %struct.NSWindowController = type { %struct.NSResponder, %struct.NSWindow*, %struct.NSArray*, %struct.NSDocument*, %struct.NSArray*, %struct.NSObject*, %struct._SPFlags, %struct.NSArray*, %struct.NSObject* }
- %struct._BCFlags = type <{ i8, i8, i8, i8 }>
- %struct._BCFlags2 = type <{ i8, [3 x i8] }>
- %struct._NSImageAuxiliary = type opaque
- %struct._NSViewAuxiliary = type opaque
- %struct._NSWindowAnimator = type opaque
- %struct._SPFlags = type <{ i32 }>
- %struct.__CFArray = type opaque
- %struct.__CFRunLoopObserver = type opaque
- %struct.__auxWFlags = type { i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i32, i16 }
- %struct.__wFlags = type <{ i8, i8, i8, i8, i8, i8, i8, i8 }>
- %struct._message_ref_t = type { %struct.NSObject* (%struct.NSObject*, %struct._message_ref_t*, ...)*, %struct.objc_selector* }
- %struct.objc_selector = type opaque
-@"\01L_OBJC_MESSAGE_REF_228" = internal global %struct._message_ref_t zeroinitializer ; <%struct._message_ref_t*> [#uses=1]
-@llvm.used1 = appending global [1 x i8*] [ i8* bitcast (void (%struct.AA*, %struct._message_ref_t*, %struct.NSError*, i64, %struct.NSObject*, %struct.objc_selector*, i8*)* @"-[AA BB:optionIndex:delegate:CC:contextInfo:]" to i8*) ], section "llvm.metadata" ; <[1 x i8*]*> [#uses=0]
-
-define void @"-[AA BB:optionIndex:delegate:CC:contextInfo:]"(%struct.AA* %self, %struct._message_ref_t* %_cmd, %struct.NSError* %inError, i64 %inOptionIndex, %struct.NSObject* %inDelegate, %struct.objc_selector* %inDidRecoverSelector, i8* %inContextInfo) {
-entry:
- %tmp105 = load %struct.NSArray** null, align 8 ; <%struct.NSArray*> [#uses=1]
- %tmp107 = load %struct.NSObject** null, align 8 ; <%struct.NSObject*> [#uses=1]
- call void null( %struct.NSObject* %tmp107, %struct._message_ref_t* @"\01L_OBJC_MESSAGE_REF_228", %struct.NSArray* %tmp105, i8 signext 0 )
- %tmp111 = call %struct.NSObject* (%struct.NSObject*, %struct.objc_selector*, ...)* @objc_msgSend( %struct.NSObject* null, %struct.objc_selector* null, i32 0, i8* null ) ; <%struct.NSObject*> [#uses=0]
- ret void
-}
-
-declare %struct.NSObject* @objc_msgSend(%struct.NSObject*, %struct.objc_selector*, ...)
diff --git a/release_23/test/CodeGen/X86/2008-04-16-CoalescerBug.ll b/release_23/test/CodeGen/X86/2008-04-16-CoalescerBug.ll
deleted file mode 100644
index 30accad5863b..000000000000
--- a/release_23/test/CodeGen/X86/2008-04-16-CoalescerBug.ll
+++ /dev/null
@@ -1,33 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86
-
-define void @Hubba(i8* %saveunder, i32 %firstBlob, i32 %select) nounwind {
-entry:
- br i1 false, label %bb53.us, label %bb53
-bb53.us: ; preds = %bb94.us, %bb53.us, %entry
- switch i8 1, label %bb71.us [
- i8 0, label %bb53.us
- i8 1, label %bb94.us
- ]
-bb94.us: ; preds = %bb71.us, %bb53.us
- %result.0.us = phi i32 [ %tmp93.us, %bb71.us ], [ 0, %bb53.us ] ; <i32> [#uses=2]
- %tmp101.us = lshr i32 %result.0.us, 3 ; <i32> [#uses=1]
- %result.0163.us = trunc i32 %result.0.us to i16 ; <i16> [#uses=2]
- shl i16 %result.0163.us, 7 ; <i16>:0 [#uses=1]
- %tmp106.us = and i16 %0, -1024 ; <i16> [#uses=1]
- shl i16 %result.0163.us, 2 ; <i16>:1 [#uses=1]
- %tmp109.us = and i16 %1, -32 ; <i16> [#uses=1]
- %tmp111112.us = trunc i32 %tmp101.us to i16 ; <i16> [#uses=1]
- %tmp110.us = or i16 %tmp109.us, %tmp111112.us ; <i16> [#uses=1]
- %tmp113.us = or i16 %tmp110.us, %tmp106.us ; <i16> [#uses=1]
- store i16 %tmp113.us, i16* null, align 2
- br label %bb53.us
-bb71.us: ; preds = %bb53.us
- %tmp80.us = load i8* null, align 1 ; <i8> [#uses=1]
- %tmp8081.us = zext i8 %tmp80.us to i32 ; <i32> [#uses=1]
- %tmp87.us = mul i32 %tmp8081.us, 0 ; <i32> [#uses=1]
- %tmp92.us = add i32 0, %tmp87.us ; <i32> [#uses=1]
- %tmp93.us = udiv i32 %tmp92.us, 255 ; <i32> [#uses=1]
- br label %bb94.us
-bb53: ; preds = %entry
- ret void
-}
diff --git a/release_23/test/CodeGen/X86/2008-04-16-ReMatBug.ll b/release_23/test/CodeGen/X86/2008-04-16-ReMatBug.ll
deleted file mode 100644
index 3e0662aed88d..000000000000
--- a/release_23/test/CodeGen/X86/2008-04-16-ReMatBug.ll
+++ /dev/null
@@ -1,46 +0,0 @@
-; RUN: llvm-as < %s | llc -mtriple=i386-apple-darwin | grep movw | not grep {, %e}
-
- %struct.DBC_t = type { i32, i8*, i16, %struct.DBC_t*, i8*, i8*, i8*, i8*, i8*, %struct.DBC_t*, i32, i32, i32, i32, i8*, i8*, i8*, i8*, i8*, i32, i32, i32, i32, i32, i32, i32, i32, i16, i16, i32*, i8, i16, %struct.DRVOPT*, i16 }
- %struct.DRVOPT = type { i16, i32, i8, %struct.DRVOPT* }
- %struct.GENV_t = type { i32, i8*, i16, i8*, i8*, i32, i32, i32, i32, %struct.DBC_t*, i16 }
- %struct.pthread_mutex_t = type { i32, [40 x i8] }
-@iodbcdm_global_lock = external global %struct.pthread_mutex_t ; <%struct.pthread_mutex_t*> [#uses=1]
-
-define i16 @SQLDriversW(i8* %henv, i16 zeroext %fDir, i32* %szDrvDesc, i16 signext %cbDrvDescMax, i16* %pcbDrvDesc, i32* %szDrvAttr, i16 signext %cbDrvAttrMax, i16* %pcbDrvAttr) signext nounwind {
-entry:
- %tmp12 = bitcast i8* %henv to %struct.GENV_t* ; <%struct.GENV_t*> [#uses=1]
- br i1 true, label %bb28, label %bb
-bb: ; preds = %entry
- ret i16 0
-bb28: ; preds = %entry
- br i1 false, label %bb37, label %done
-bb37: ; preds = %bb28
- %tmp46 = getelementptr %struct.GENV_t* %tmp12, i32 0, i32 10 ; <i16*> [#uses=1]
- store i16 0, i16* %tmp46, align 4
- br i1 false, label %bb74, label %bb92
-bb74: ; preds = %bb37
- br label %bb92
-bb92: ; preds = %bb74, %bb37
- %tmp95180 = shl i16 %cbDrvAttrMax, 2 ; <i16> [#uses=1]
- %tmp100178 = shl i16 %cbDrvDescMax, 2 ; <i16> [#uses=1]
- %tmp113 = tail call i16 @SQLDrivers_Internal( i8* %henv, i16 zeroext %fDir, i8* null, i16 signext %tmp100178, i16* %pcbDrvDesc, i8* null, i16 signext %tmp95180, i16* %pcbDrvAttr, i8 zeroext 87 ) signext nounwind ; <i16> [#uses=1]
- br i1 false, label %done, label %bb137
-bb137: ; preds = %bb92
- ret i16 0
-done: ; preds = %bb92, %bb28
- %retcode.0 = phi i16 [ -2, %bb28 ], [ %tmp113, %bb92 ] ; <i16> [#uses=2]
- br i1 false, label %bb167, label %bb150
-bb150: ; preds = %done
- %tmp157158 = sext i16 %retcode.0 to i32 ; <i32> [#uses=1]
- tail call void @trace_SQLDriversW( i32 1, i32 %tmp157158, i8* %henv, i16 zeroext %fDir, i32* %szDrvDesc, i16 signext %cbDrvDescMax, i16* %pcbDrvDesc, i32* %szDrvAttr, i16 signext %cbDrvAttrMax, i16* %pcbDrvAttr ) nounwind
- ret i16 0
-bb167: ; preds = %done
- %tmp168 = tail call i32 @pthread_mutex_unlock( %struct.pthread_mutex_t* @iodbcdm_global_lock ) nounwind ; <i32> [#uses=0]
- ret i16 %retcode.0
-}
-
-declare i32 @pthread_mutex_unlock(%struct.pthread_mutex_t*)
-
-declare i16 @SQLDrivers_Internal(i8*, i16 zeroext , i8*, i16 signext , i16*, i8*, i16 signext , i16*, i8 zeroext ) signext nounwind
-
-declare void @trace_SQLDriversW(i32, i32, i8*, i16 zeroext , i32*, i16 signext , i16*, i32*, i16 signext , i16*)
diff --git a/release_23/test/CodeGen/X86/2008-04-17-CoalescerBug.ll b/release_23/test/CodeGen/X86/2008-04-17-CoalescerBug.ll
deleted file mode 100644
index cd7c29bae52e..000000000000
--- a/release_23/test/CodeGen/X86/2008-04-17-CoalescerBug.ll
+++ /dev/null
@@ -1,171 +0,0 @@
-; RUN: llvm-as < %s | llc -mtriple=i386-apple-darwin | grep xorl | grep {%e}
-; Make sure xorl operands are 32-bit registers.
-
- %struct.tm = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i8* }
- %struct.wxDateTime = type { %struct.wxLongLong }
- %"struct.wxDateTime::TimeZone" = type { i32 }
- %struct.wxLongLong = type { i64 }
- %struct.wxString = type { %struct.wxStringBase }
- %struct.wxStringBase = type { i32* }
-@.str = external constant [27 x i32] ; <[27 x i32]*> [#uses=1]
-@.str4 = external constant [14 x i32] ; <[14 x i32]*> [#uses=1]
-@_ZZNK10wxDateTime5GetTmERKNS_8TimeZoneEE12__FUNCTION__ = external constant [6 x i8] ; <[6 x i8]*> [#uses=1]
-@.str33 = external constant [29 x i32] ; <[29 x i32]*> [#uses=1]
-@.str89 = external constant [5 x i32] ; <[5 x i32]*> [#uses=1]
-
-define void @_ZNK10wxDateTime6FormatEPKwRKNS_8TimeZoneE(%struct.wxString* noalias sret %agg.result, %struct.wxDateTime* %this, i32* %format, %"struct.wxDateTime::TimeZone"* %tz) {
-entry:
- br i1 false, label %bb116.i, label %bb115.critedge.i
-bb115.critedge.i: ; preds = %entry
- ret void
-bb116.i: ; preds = %entry
- br i1 false, label %bb52.i.i, label %bb3118
-bb3118: ; preds = %bb116.i
- ret void
-bb52.i.i: ; preds = %bb116.i
- br i1 false, label %bb142.i, label %bb115.critedge.i.i
-bb115.critedge.i.i: ; preds = %bb52.i.i
- ret void
-bb142.i: ; preds = %bb52.i.i
- br i1 false, label %bb161.i, label %bb182.i
-bb161.i: ; preds = %bb142.i
- br label %bb3261
-bb182.i: ; preds = %bb142.i
- ret void
-bb3261: ; preds = %bb7834, %bb161.i
- %tmp3263 = load i32* null, align 4 ; <i32> [#uses=1]
- %tmp3264 = icmp eq i32 %tmp3263, 37 ; <i1> [#uses=1]
- br i1 %tmp3264, label %bb3306, label %bb3267
-bb3267: ; preds = %bb3261
- ret void
-bb3306: ; preds = %bb3261
- %tmp3310 = invoke %struct.wxStringBase* @_ZN12wxStringBaseaSEPKw( %struct.wxStringBase* null, i32* getelementptr ([5 x i32]* @.str89, i32 0, i32 0) )
- to label %bb3314 unwind label %lpad ; <%struct.wxStringBase*> [#uses=0]
-bb3314: ; preds = %bb3306
- %tmp3316 = load i32* null, align 4 ; <i32> [#uses=1]
- switch i32 %tmp3316, label %bb7595 [
- i32 0, label %bb7819
- i32 37, label %bb7806
- i32 66, label %bb3477
- i32 72, label %bb5334
- i32 73, label %bb5484
- i32 77, label %bb6118
- i32 83, label %bb6406
- i32 85, label %bb6556
- i32 87, label %bb6708
- i32 89, label %bb7308
- i32 98, label %bb3477
- i32 99, label %bb3626
- i32 100, label %bb5184
- i32 106, label %bb5657
- i32 108, label %bb5809
- i32 109, label %bb5968
- i32 119, label %bb6860
- i32 120, label %bb3626
- i32 121, label %bb7158
- ]
-bb3477: ; preds = %bb3314, %bb3314
- ret void
-bb3626: ; preds = %bb3314, %bb3314
- ret void
-bb5184: ; preds = %bb3314
- ret void
-bb5334: ; preds = %bb3314
- ret void
-bb5484: ; preds = %bb3314
- ret void
-bb5657: ; preds = %bb3314
- %tmp5661 = invoke i16 @_ZNK10wxDateTime12GetDayOfYearERKNS_8TimeZoneE( %struct.wxDateTime* %this, %"struct.wxDateTime::TimeZone"* %tz ) zeroext
- to label %invcont5660 unwind label %lpad ; <i16> [#uses=0]
-invcont5660: ; preds = %bb5657
- ret void
-bb5809: ; preds = %bb3314
- %tmp61.i.i8486 = icmp sgt i64 0, -1 ; <i1> [#uses=1]
- %tmp95.i.i8490 = icmp slt i64 0, 2147483647000 ; <i1> [#uses=1]
- %bothcond9308 = and i1 %tmp61.i.i8486, %tmp95.i.i8490 ; <i1> [#uses=1]
- br i1 %bothcond9308, label %bb91.i8504, label %bb115.critedge.i.i8492
-bb115.critedge.i.i8492: ; preds = %bb5809
- ret void
-bb91.i8504: ; preds = %bb5809
- br i1 false, label %bb155.i8541, label %bb182.i8560
-bb155.i8541: ; preds = %bb91.i8504
- %tmp156.i85398700 = invoke %struct.tm* @gmtime_r( i32* null, %struct.tm* null )
- to label %bb182.i8560 unwind label %lpad ; <%struct.tm*> [#uses=1]
-bb182.i8560: ; preds = %bb155.i8541, %bb91.i8504
- %tm48.0.i8558 = phi %struct.tm* [ null, %bb91.i8504 ], [ %tmp156.i85398700, %bb155.i8541 ] ; <%struct.tm*> [#uses=0]
- br i1 false, label %bb278.i8617, label %bb187.i8591
-bb187.i8591: ; preds = %bb182.i8560
- %tmp245.i8588 = srem i64 0, 86400000 ; <i64> [#uses=1]
- br i1 false, label %bb264.i8592, label %bb265.i8606
-bb264.i8592: ; preds = %bb187.i8591
- ret void
-bb265.i8606: ; preds = %bb187.i8591
- %tmp268269.i8593 = trunc i64 %tmp245.i8588 to i32 ; <i32> [#uses=1]
- %tmp273.i8594 = srem i32 %tmp268269.i8593, 1000 ; <i32> [#uses=1]
- %tmp273274.i8595 = trunc i32 %tmp273.i8594 to i16 ; <i16> [#uses=1]
- br label %invcont5814
-bb278.i8617: ; preds = %bb182.i8560
- %timeOnly50.0.i8622 = add i32 0, 0 ; <i32> [#uses=1]
- br i1 false, label %bb440.i8663, label %bb448.i8694
-bb440.i8663: ; preds = %bb278.i8617
- invoke void @_Z10wxOnAssertPKwiPKcS0_S0_( i32* getelementptr ([27 x i32]* @.str, i32 0, i32 0), i32 1717, i8* getelementptr ([6 x i8]* @_ZZNK10wxDateTime5GetTmERKNS_8TimeZoneEE12__FUNCTION__, i32 0, i32 0), i32* getelementptr ([29 x i32]* @.str33, i32 0, i32 0), i32* getelementptr ([14 x i32]* @.str4, i32 0, i32 0) )
- to label %bb448.i8694 unwind label %lpad
-bb448.i8694: ; preds = %bb440.i8663, %bb278.i8617
- %tmp477.i8669 = srem i32 %timeOnly50.0.i8622, 1000 ; <i32> [#uses=1]
- %tmp477478.i8670 = trunc i32 %tmp477.i8669 to i16 ; <i16> [#uses=1]
- br label %invcont5814
-invcont5814: ; preds = %bb448.i8694, %bb265.i8606
- %tmp812.0.0 = phi i16 [ %tmp477478.i8670, %bb448.i8694 ], [ %tmp273274.i8595, %bb265.i8606 ] ; <i16> [#uses=1]
- %tmp58165817 = zext i16 %tmp812.0.0 to i32 ; <i32> [#uses=1]
- invoke void (%struct.wxString*, i32*, ...)* @_ZN8wxString6FormatEPKwz( %struct.wxString* noalias sret null, i32* null, i32 %tmp58165817 )
- to label %invcont5831 unwind label %lpad
-invcont5831: ; preds = %invcont5814
- %tmp5862 = invoke i8 @_ZN12wxStringBase10ConcatSelfEmPKwm( %struct.wxStringBase* null, i32 0, i32* null, i32 0 ) zeroext
- to label %bb7834 unwind label %lpad8185 ; <i8> [#uses=0]
-bb5968: ; preds = %bb3314
- invoke void (%struct.wxString*, i32*, ...)* @_ZN8wxString6FormatEPKwz( %struct.wxString* noalias sret null, i32* null, i32 0 )
- to label %invcont5981 unwind label %lpad
-invcont5981: ; preds = %bb5968
- ret void
-bb6118: ; preds = %bb3314
- ret void
-bb6406: ; preds = %bb3314
- ret void
-bb6556: ; preds = %bb3314
- ret void
-bb6708: ; preds = %bb3314
- ret void
-bb6860: ; preds = %bb3314
- ret void
-bb7158: ; preds = %bb3314
- ret void
-bb7308: ; preds = %bb3314
- ret void
-bb7595: ; preds = %bb3314
- ret void
-bb7806: ; preds = %bb3314
- %tmp7814 = invoke %struct.wxStringBase* @_ZN12wxStringBase6appendEmw( %struct.wxStringBase* null, i32 1, i32 0 )
- to label %bb7834 unwind label %lpad ; <%struct.wxStringBase*> [#uses=0]
-bb7819: ; preds = %bb3314
- ret void
-bb7834: ; preds = %bb7806, %invcont5831
- br label %bb3261
-lpad: ; preds = %bb7806, %bb5968, %invcont5814, %bb440.i8663, %bb155.i8541, %bb5657, %bb3306
- ret void
-lpad8185: ; preds = %invcont5831
- ret void
-}
-
-declare void @_Z10wxOnAssertPKwiPKcS0_S0_(i32*, i32, i8*, i32*, i32*)
-
-declare i8 @_ZN12wxStringBase10ConcatSelfEmPKwm(%struct.wxStringBase*, i32, i32*, i32) zeroext
-
-declare %struct.tm* @gmtime_r(i32*, %struct.tm*)
-
-declare i16 @_ZNK10wxDateTime12GetDayOfYearERKNS_8TimeZoneE(%struct.wxDateTime*, %"struct.wxDateTime::TimeZone"*) zeroext
-
-declare %struct.wxStringBase* @_ZN12wxStringBase6appendEmw(%struct.wxStringBase*, i32, i32)
-
-declare %struct.wxStringBase* @_ZN12wxStringBaseaSEPKw(%struct.wxStringBase*, i32*)
-
-declare void @_ZN8wxString6FormatEPKwz(%struct.wxString* noalias sret , i32*, ...)
diff --git a/release_23/test/CodeGen/X86/2008-04-24-MemCpyBug.ll b/release_23/test/CodeGen/X86/2008-04-24-MemCpyBug.ll
deleted file mode 100644
index 09fdc707b854..000000000000
--- a/release_23/test/CodeGen/X86/2008-04-24-MemCpyBug.ll
+++ /dev/null
@@ -1,12 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 | not grep 120
-; Don't accidentally add the offset twice for trailing bytes.
-
- %struct.S63 = type { [63 x i8] }
-@g1s63 = external global %struct.S63 ; <%struct.S63*> [#uses=1]
-
-declare void @test63(%struct.S63* byval align 4 ) nounwind
-
-define void @testit63_entry_2E_ce() nounwind {
- tail call void @test63( %struct.S63* byval align 4 @g1s63 ) nounwind
- ret void
-}
diff --git a/release_23/test/CodeGen/X86/2008-04-24-pblendw-fold-crash.ll b/release_23/test/CodeGen/X86/2008-04-24-pblendw-fold-crash.ll
deleted file mode 100644
index 838c2ea57987..000000000000
--- a/release_23/test/CodeGen/X86/2008-04-24-pblendw-fold-crash.ll
+++ /dev/null
@@ -1,15 +0,0 @@
-; RUN: llvm-as < %s | llc -mattr=+sse41
-; rdar://5886601
-; gcc testsuite: gcc.target/i386/sse4_1-pblendw.c
-target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
-target triple = "i386-apple-darwin8"
-
-define i32 @main() nounwind {
-entry:
- %tmp122 = load <2 x i64>* null, align 16 ; <<2 x i64>> [#uses=1]
- %tmp126 = bitcast <2 x i64> %tmp122 to <8 x i16> ; <<8 x i16>> [#uses=1]
- %tmp129 = call <8 x i16> @llvm.x86.sse41.pblendw( <8 x i16> zeroinitializer, <8 x i16> %tmp126, i32 2 ) nounwind ; <<8 x i16>> [#uses=0]
- ret i32 0
-}
-
-declare <8 x i16> @llvm.x86.sse41.pblendw(<8 x i16>, <8 x i16>, i32) nounwind
diff --git a/release_23/test/CodeGen/X86/2008-04-26-Asm-Optimize-Imm.ll b/release_23/test/CodeGen/X86/2008-04-26-Asm-Optimize-Imm.ll
deleted file mode 100644
index 82721a53b8b4..000000000000
--- a/release_23/test/CodeGen/X86/2008-04-26-Asm-Optimize-Imm.ll
+++ /dev/null
@@ -1,11 +0,0 @@
-; RUN: llvm-as < %s | llc | grep {1 \$2 3}
-; rdar://5720231
-target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
-target triple = "i386-apple-darwin8"
-
-define void @test() nounwind {
-entry:
- tail call void asm sideeffect " ${0:c} $1 ${2:c} ", "imr,imr,i,~{dirflag},~{fpsr},~{flags}"( i32 1, i32 2, i32 3 ) nounwind
- ret void
-}
-
diff --git a/release_23/test/CodeGen/X86/2008-04-28-CoalescerBug.ll b/release_23/test/CodeGen/X86/2008-04-28-CoalescerBug.ll
deleted file mode 100644
index e970a4267dfa..000000000000
--- a/release_23/test/CodeGen/X86/2008-04-28-CoalescerBug.ll
+++ /dev/null
@@ -1,166 +0,0 @@
-; RUN: llvm-as < %s | llc -mtriple=x86_64-apple-darwin | grep movl | not grep {r\[abcd\]x}
-; RUN: llvm-as < %s | llc -mtriple=x86_64-apple-darwin | grep movl | not grep {r\[ds\]i}
-; RUN: llvm-as < %s | llc -mtriple=x86_64-apple-darwin | grep movl | not grep {r\[bs\]p}
-
- %struct.BITMAP = type { i16, i16, i32, i32, i32, i32, i32, i32, i8*, i8* }
- %struct.BltData = type { float, float, float, float }
- %struct.BltDepth = type { i32, i8**, i32, %struct.BITMAP* (%struct.BltDepth**, %struct.BITMAP*, i32, i32, float*, float, i32)*, i32 (%struct.BltDepth**, %struct.BltOp*)*, i32 (%struct.BltDepth**, %struct.BltOp*, %struct.BltImg*)*, i32 (%struct.BltDepth**, %struct.BltOp*, %struct.BltSh*)*, [28 x [2 x [2 x i32]]]*, %struct.BltData* }
- %struct.BltImg = type { i32, i8, i8, i8, float, float*, float*, i32, i32, float*, i32 (i8*, i8*, i8**, i32*, i8**, i32*)*, i8* }
- %struct.BltOp = type { i8, i8, i8, i8, i32, i32, i32, i32, i32, i32, i32, i32, i8*, i8*, i32, i32, i32, i32, i32, i32, i32, i8*, i8*, i32, i32, i32, i32, i32, i32, i32, i8* }
- %struct.BltSh = type { i8, i8, i8, i8, float, float*, float*, float*, float*, i32, i32, float*, float*, float* }
-
-define void @t(%struct.BltDepth* %depth, %struct.BltOp* %bop, i32 %mode) nounwind {
-entry:
- switch i32 %mode, label %return [
- i32 1, label %bb2898.us
- i32 18, label %bb13086.preheader
- ]
-
-bb13086.preheader: ; preds = %entry
- %tmp13098 = icmp eq i32 0, 0 ; <i1> [#uses=1]
- %tmp13238 = icmp eq i32 0, 0 ; <i1> [#uses=1]
- br label %bb13088
-
-bb2898.us: ; preds = %bb2898.us, %entry
- br label %bb2898.us
-
-bb13088: ; preds = %bb13572, %bb13567, %bb13107, %bb13086.preheader
- br i1 %tmp13098, label %bb13107, label %bb13101
-
-bb13101: ; preds = %bb13088
- br label %bb13107
-
-bb13107: ; preds = %bb13101, %bb13088
- %iftmp.684.0 = phi i32 [ 0, %bb13101 ], [ 65535, %bb13088 ] ; <i32> [#uses=2]
- %tmp13111 = load i64* null, align 8 ; <i64> [#uses=3]
- %tmp13116 = lshr i64 %tmp13111, 16 ; <i64> [#uses=1]
- %tmp1311613117 = trunc i64 %tmp13116 to i32 ; <i32> [#uses=1]
- %tmp13118 = and i32 %tmp1311613117, 65535 ; <i32> [#uses=1]
- %tmp13120 = lshr i64 %tmp13111, 32 ; <i64> [#uses=1]
- %tmp1312013121 = trunc i64 %tmp13120 to i32 ; <i32> [#uses=1]
- %tmp13122 = and i32 %tmp1312013121, 65535 ; <i32> [#uses=2]
- %tmp13124 = lshr i64 %tmp13111, 48 ; <i64> [#uses=1]
- %tmp1312413125 = trunc i64 %tmp13124 to i32 ; <i32> [#uses=2]
- %tmp1314013141not = xor i16 0, -1 ; <i16> [#uses=1]
- %tmp1314013141not13142 = zext i16 %tmp1314013141not to i32 ; <i32> [#uses=3]
- %tmp13151 = mul i32 %tmp13122, %tmp1314013141not13142 ; <i32> [#uses=1]
- %tmp13154 = mul i32 %tmp1312413125, %tmp1314013141not13142 ; <i32> [#uses=1]
- %tmp13157 = mul i32 %iftmp.684.0, %tmp1314013141not13142 ; <i32> [#uses=1]
- %tmp13171 = add i32 %tmp13151, 1 ; <i32> [#uses=1]
- %tmp13172 = add i32 %tmp13171, 0 ; <i32> [#uses=1]
- %tmp13176 = add i32 %tmp13154, 1 ; <i32> [#uses=1]
- %tmp13177 = add i32 %tmp13176, 0 ; <i32> [#uses=1]
- %tmp13181 = add i32 %tmp13157, 1 ; <i32> [#uses=1]
- %tmp13182 = add i32 %tmp13181, 0 ; <i32> [#uses=1]
- %tmp13188 = lshr i32 %tmp13172, 16 ; <i32> [#uses=1]
- %tmp13190 = lshr i32 %tmp13177, 16 ; <i32> [#uses=1]
- %tmp13192 = lshr i32 %tmp13182, 16 ; <i32> [#uses=1]
- %tmp13198 = sub i32 %tmp13118, 0 ; <i32> [#uses=1]
- %tmp13201 = sub i32 %tmp13122, %tmp13188 ; <i32> [#uses=1]
- %tmp13204 = sub i32 %tmp1312413125, %tmp13190 ; <i32> [#uses=1]
- %tmp13207 = sub i32 %iftmp.684.0, %tmp13192 ; <i32> [#uses=1]
- %tmp1320813209 = zext i32 %tmp13204 to i64 ; <i64> [#uses=1]
- %tmp13211 = shl i64 %tmp1320813209, 48 ; <i64> [#uses=1]
- %tmp1321213213 = zext i32 %tmp13201 to i64 ; <i64> [#uses=1]
- %tmp13214 = shl i64 %tmp1321213213, 32 ; <i64> [#uses=1]
- %tmp13215 = and i64 %tmp13214, 281470681743360 ; <i64> [#uses=1]
- %tmp1321713218 = zext i32 %tmp13198 to i64 ; <i64> [#uses=1]
- %tmp13219 = shl i64 %tmp1321713218, 16 ; <i64> [#uses=1]
- %tmp13220 = and i64 %tmp13219, 4294901760 ; <i64> [#uses=1]
- %tmp13216 = or i64 %tmp13211, 0 ; <i64> [#uses=1]
- %tmp13221 = or i64 %tmp13216, %tmp13215 ; <i64> [#uses=1]
- %tmp13225 = or i64 %tmp13221, %tmp13220 ; <i64> [#uses=4]
- %tmp1322713228 = trunc i32 %tmp13207 to i16 ; <i16> [#uses=4]
- %tmp13233 = icmp eq i16 %tmp1322713228, 0 ; <i1> [#uses=1]
- br i1 %tmp13233, label %bb13088, label %bb13236
-
-bb13236: ; preds = %bb13107
- br i1 false, label %bb13567, label %bb13252
-
-bb13252: ; preds = %bb13236
- %tmp1329013291 = zext i16 %tmp1322713228 to i64 ; <i64> [#uses=8]
- %tmp13296 = lshr i64 %tmp13225, 16 ; <i64> [#uses=1]
- %tmp13297 = and i64 %tmp13296, 65535 ; <i64> [#uses=1]
- %tmp13299 = lshr i64 %tmp13225, 32 ; <i64> [#uses=1]
- %tmp13300 = and i64 %tmp13299, 65535 ; <i64> [#uses=1]
- %tmp13302 = lshr i64 %tmp13225, 48 ; <i64> [#uses=1]
- %tmp13306 = sub i64 %tmp1329013291, 0 ; <i64> [#uses=0]
- %tmp13309 = sub i64 %tmp1329013291, %tmp13297 ; <i64> [#uses=1]
- %tmp13312 = sub i64 %tmp1329013291, %tmp13300 ; <i64> [#uses=1]
- %tmp13315 = sub i64 %tmp1329013291, %tmp13302 ; <i64> [#uses=1]
- %tmp13318 = mul i64 %tmp1329013291, %tmp1329013291 ; <i64> [#uses=1]
- br i1 false, label %bb13339, label %bb13324
-
-bb13324: ; preds = %bb13252
- br i1 false, label %bb13339, label %bb13330
-
-bb13330: ; preds = %bb13324
- %tmp13337 = sdiv i64 0, 0 ; <i64> [#uses=1]
- br label %bb13339
-
-bb13339: ; preds = %bb13330, %bb13324, %bb13252
- %r0120.0 = phi i64 [ %tmp13337, %bb13330 ], [ 0, %bb13252 ], [ 4294836225, %bb13324 ] ; <i64> [#uses=1]
- br i1 false, label %bb13360, label %bb13345
-
-bb13345: ; preds = %bb13339
- br i1 false, label %bb13360, label %bb13351
-
-bb13351: ; preds = %bb13345
- %tmp13354 = mul i64 0, %tmp13318 ; <i64> [#uses=1]
- %tmp13357 = sub i64 %tmp1329013291, %tmp13309 ; <i64> [#uses=1]
- %tmp13358 = sdiv i64 %tmp13354, %tmp13357 ; <i64> [#uses=1]
- br label %bb13360
-
-bb13360: ; preds = %bb13351, %bb13345, %bb13339
- %r1121.0 = phi i64 [ %tmp13358, %bb13351 ], [ 0, %bb13339 ], [ 4294836225, %bb13345 ] ; <i64> [#uses=1]
- br i1 false, label %bb13402, label %bb13387
-
-bb13387: ; preds = %bb13360
- br label %bb13402
-
-bb13402: ; preds = %bb13387, %bb13360
- %r3123.0 = phi i64 [ 0, %bb13360 ], [ 4294836225, %bb13387 ] ; <i64> [#uses=1]
- %tmp13404 = icmp eq i16 %tmp1322713228, -1 ; <i1> [#uses=1]
- br i1 %tmp13404, label %bb13435, label %bb13407
-
-bb13407: ; preds = %bb13402
- br label %bb13435
-
-bb13435: ; preds = %bb13407, %bb13402
- %r0120.1 = phi i64 [ 0, %bb13407 ], [ %r0120.0, %bb13402 ] ; <i64> [#uses=0]
- %r1121.1 = phi i64 [ 0, %bb13407 ], [ %r1121.0, %bb13402 ] ; <i64> [#uses=0]
- %r3123.1 = phi i64 [ 0, %bb13407 ], [ %r3123.0, %bb13402 ] ; <i64> [#uses=0]
- %tmp13450 = mul i64 0, %tmp13312 ; <i64> [#uses=0]
- %tmp13455 = mul i64 0, %tmp13315 ; <i64> [#uses=0]
- %tmp13461 = add i64 0, %tmp1329013291 ; <i64> [#uses=1]
- %tmp13462 = mul i64 %tmp13461, 65535 ; <i64> [#uses=1]
- %tmp13466 = sub i64 %tmp13462, 0 ; <i64> [#uses=1]
- %tmp13526 = add i64 %tmp13466, 1 ; <i64> [#uses=1]
- %tmp13527 = add i64 %tmp13526, 0 ; <i64> [#uses=1]
- %tmp13528 = ashr i64 %tmp13527, 16 ; <i64> [#uses=4]
- %tmp13536 = sub i64 %tmp13528, 0 ; <i64> [#uses=1]
- %tmp13537 = shl i64 %tmp13536, 32 ; <i64> [#uses=1]
- %tmp13538 = and i64 %tmp13537, 281470681743360 ; <i64> [#uses=1]
- %tmp13542 = sub i64 %tmp13528, 0 ; <i64> [#uses=1]
- %tmp13543 = shl i64 %tmp13542, 16 ; <i64> [#uses=1]
- %tmp13544 = and i64 %tmp13543, 4294901760 ; <i64> [#uses=1]
- %tmp13548 = sub i64 %tmp13528, 0 ; <i64> [#uses=1]
- %tmp13549 = and i64 %tmp13548, 65535 ; <i64> [#uses=1]
- %tmp13539 = or i64 %tmp13538, 0 ; <i64> [#uses=1]
- %tmp13545 = or i64 %tmp13539, %tmp13549 ; <i64> [#uses=1]
- %tmp13550 = or i64 %tmp13545, %tmp13544 ; <i64> [#uses=1]
- %tmp1355213553 = trunc i64 %tmp13528 to i16 ; <i16> [#uses=1]
- br label %bb13567
-
-bb13567: ; preds = %bb13435, %bb13236
- %tsp1040.0.0 = phi i64 [ %tmp13550, %bb13435 ], [ %tmp13225, %bb13236 ] ; <i64> [#uses=0]
- %tsp1040.1.0 = phi i16 [ %tmp1355213553, %bb13435 ], [ %tmp1322713228, %bb13236 ] ; <i16> [#uses=1]
- br i1 %tmp13238, label %bb13088, label %bb13572
-
-bb13572: ; preds = %bb13567
- store i16 %tsp1040.1.0, i16* null, align 2
- br label %bb13088
-
-return: ; preds = %entry
- ret void
-}
diff --git a/release_23/test/CodeGen/X86/2008-04-28-CyclicSchedUnit.ll b/release_23/test/CodeGen/X86/2008-04-28-CyclicSchedUnit.ll
deleted file mode 100644
index 6613fafcce82..000000000000
--- a/release_23/test/CodeGen/X86/2008-04-28-CyclicSchedUnit.ll
+++ /dev/null
@@ -1,6 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86
-
-define i64 @t(i64 %maxIdleDuration) nounwind {
- call void asm sideeffect "wrmsr", "{cx},A,~{dirflag},~{fpsr},~{flags}"( i32 416, i64 0 ) nounwind
- unreachable
-}
diff --git a/release_23/test/CodeGen/X86/2008-05-01-InvalidOrdCompare.ll b/release_23/test/CodeGen/X86/2008-05-01-InvalidOrdCompare.ll
deleted file mode 100644
index d7b5f25de6c9..000000000000
--- a/release_23/test/CodeGen/X86/2008-05-01-InvalidOrdCompare.ll
+++ /dev/null
@@ -1,15 +0,0 @@
-; RUN: llvm-as < %s | llc -enable-unsafe-fp-math -march=x86 | grep jnp
-; rdar://5902801
-
-declare void @test2()
-
-define i32 @test(double %p) nounwind {
- %tmp5 = fcmp uno double %p, 0.000000e+00
- br i1 %tmp5, label %bb, label %UnifiedReturnBlock
-bb:
- call void @test2()
- ret i32 17
-UnifiedReturnBlock:
- ret i32 42
-}
-
diff --git a/release_23/test/CodeGen/X86/2008-05-06-SpillerBug.ll b/release_23/test/CodeGen/X86/2008-05-06-SpillerBug.ll
deleted file mode 100644
index 19231e9de8af..000000000000
--- a/release_23/test/CodeGen/X86/2008-05-06-SpillerBug.ll
+++ /dev/null
@@ -1,37 +0,0 @@
-; RUN: llvm-as < %s | llc -mtriple=i386-apple-darwin -relocation-model=pic -disable-fp-elim | grep addb | grep ebp
-
- %struct.rc4_state = type { i32, i32, [256 x i32] }
-@.str1 = internal constant [65 x i8] c"m[%d] = 0x%02x, m[%d] = 0x%02x, 0x%02x, k = %d, key[k] = 0x%02x\0A\00" ; <[65 x i8]*> [#uses=1]
-@keys = internal constant [7 x [30 x i8]] [ [30 x i8] c"\08\01#Eg\89\AB\CD\EF\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00", [30 x i8] c"\08\01#Eg\89\AB\CD\EF\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00", [30 x i8] c"\08\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00", [30 x i8] c"\04\EF\01#E\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00", [30 x i8] c"\08\01#Eg\89\AB\CD\EF\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00", [30 x i8] c"\04\EF\01#E\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00", [30 x i8] zeroinitializer ] ; <[7 x [30 x i8]]*> [#uses=1]
-
-declare i32 @printf(i8*, ...) nounwind
-
-define i32 @main(i32 %argc, i8** %argv) nounwind {
-entry:
- br label %bb25
-
-bb25: ; preds = %bb25, %entry
- br i1 false, label %bb.i, label %bb25
-
-bb.i: ; preds = %bb.i, %bb25
- br i1 false, label %bb21.i, label %bb.i
-
-bb21.i: ; preds = %bb21.i, %bb.i
- %k.0.reg2mem.0.i = phi i32 [ %k.1.i, %bb21.i ], [ 0, %bb.i ] ; <i32> [#uses=2]
- %j.0.reg2mem.0.i = phi i8 [ %tmp35.i, %bb21.i ], [ 0, %bb.i ] ; <i8> [#uses=1]
- %tmp25.i = load i32* null, align 4 ; <i32> [#uses=4]
- %tmp2829.i = trunc i32 %tmp25.i to i8 ; <i8> [#uses=1]
- %.sum = add i32 %k.0.reg2mem.0.i, 1 ; <i32> [#uses=3]
- %tmp33.i = getelementptr [7 x [30 x i8]]* @keys, i32 0, i32 0, i32 %.sum ; <i8*> [#uses=1]
- %tmp34.i = load i8* %tmp33.i, align 1 ; <i8> [#uses=1]
- %tmp30.i = add i8 %tmp2829.i, %j.0.reg2mem.0.i ; <i8> [#uses=1]
- %tmp35.i = add i8 %tmp30.i, %tmp34.i ; <i8> [#uses=2]
- %tmp3536.i = zext i8 %tmp35.i to i32 ; <i32> [#uses=2]
- %tmp39.i = getelementptr %struct.rc4_state* null, i32 0, i32 2, i32 %tmp3536.i ; <i32*> [#uses=1]
- store i32 %tmp25.i, i32* %tmp39.i, align 4
- %tmp60.i = load i32* null, align 4 ; <i32> [#uses=1]
- %tmp65.i = call i32 (i8*, ...)* @printf( i8* getelementptr ([65 x i8]* @.str1, i32 0, i32 0), i32 0, i32 %tmp60.i, i32 %tmp3536.i, i32 %tmp25.i, i32 %tmp25.i, i32 %k.0.reg2mem.0.i, i32 0 ) nounwind ; <i32> [#uses=0]
- %tmp70.i = icmp slt i32 %.sum, 8 ; <i1> [#uses=1]
- %k.1.i = select i1 %tmp70.i, i32 %.sum, i32 0 ; <i32> [#uses=1]
- br label %bb21.i
-}
diff --git a/release_23/test/CodeGen/X86/2008-05-09-PHIElimBug.ll b/release_23/test/CodeGen/X86/2008-05-09-PHIElimBug.ll
deleted file mode 100644
index c0b196113137..000000000000
--- a/release_23/test/CodeGen/X86/2008-05-09-PHIElimBug.ll
+++ /dev/null
@@ -1,25 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86
-
- %struct.V = type { <4 x float>, <4 x float>, <4 x float>, <4 x float>, <4 x float>, <4 x float>, <4 x float>, <4 x i32>, float*, float*, float*, float*, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, i32, i32, i32, i32, i32, i32, i32, i32 }
-
-define fastcc void @t() nounwind {
-entry:
- br i1 false, label %bb23816.preheader, label %bb23821
-
-bb23816.preheader: ; preds = %entry
- %tmp23735 = and i32 0, 2 ; <i32> [#uses=0]
- br label %bb23830
-
-bb23821: ; preds = %entry
- br i1 false, label %bb23830, label %bb23827
-
-bb23827: ; preds = %bb23821
- %tmp23829 = getelementptr %struct.V* null, i32 0, i32 42 ; <i32*> [#uses=0]
- br label %bb23830
-
-bb23830: ; preds = %bb23827, %bb23821, %bb23816.preheader
- %scaledInDst.2.reg2mem.5 = phi i8 [ undef, %bb23827 ], [ undef, %bb23821 ], [ undef, %bb23816.preheader ] ; <i8> [#uses=1]
- %toBool35047 = icmp eq i8 %scaledInDst.2.reg2mem.5, 0 ; <i1> [#uses=1]
- %bothcond39107 = or i1 %toBool35047, false ; <i1> [#uses=0]
- unreachable
-}
diff --git a/release_23/test/CodeGen/X86/2008-05-09-ShuffleLoweringBug.ll b/release_23/test/CodeGen/X86/2008-05-09-ShuffleLoweringBug.ll
deleted file mode 100644
index 9bcd1f374dd6..000000000000
--- a/release_23/test/CodeGen/X86/2008-05-09-ShuffleLoweringBug.ll
+++ /dev/null
@@ -1,10 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2
-
-define fastcc void @glgVectorFloatConversion() nounwind {
- %tmp12745 = load <4 x float>* null, align 16 ; <<4 x float>> [#uses=1]
- %tmp12773 = insertelement <4 x float> %tmp12745, float 1.000000e+00, i32 1 ; <<4 x float>> [#uses=1]
- %tmp12774 = insertelement <4 x float> %tmp12773, float 0.000000e+00, i32 2 ; <<4 x float>> [#uses=1]
- %tmp12775 = insertelement <4 x float> %tmp12774, float 1.000000e+00, i32 3 ; <<4 x float>> [#uses=1]
- store <4 x float> %tmp12775, <4 x float>* null, align 16
- unreachable
-}
diff --git a/release_23/test/CodeGen/X86/aliases.ll b/release_23/test/CodeGen/X86/aliases.ll
deleted file mode 100644
index 3578c96c65c3..000000000000
--- a/release_23/test/CodeGen/X86/aliases.ll
+++ /dev/null
@@ -1,38 +0,0 @@
-; RUN: llvm-as < %s | \
-; RUN: llc -mtriple=i686-pc-linux-gnu -o %t -f
-; RUN: grep set %t | count 7
-; RUN: grep globl %t | count 6
-; RUN: grep weak %t | count 1
-; RUN: grep hidden %t | count 1
-; RUN: grep protected %t | count 1
-
-@bar = external global i32
-@foo1 = alias i32* @bar
-@foo2 = alias i32* @bar
-
-%FunTy = type i32()
-
-declare i32 @foo_f()
-@bar_f = alias weak %FunTy* @foo_f
-
-@bar_i = alias internal i32* @bar
-
-@A = alias bitcast (i32* @bar to i64*)
-
-@bar_h = hidden alias i32* @bar
-
-@bar_p = protected alias i32* @bar
-
-define i32 @test() {
-entry:
- %tmp = load i32* @foo1
- %tmp1 = load i32* @foo2
- %tmp0 = load i32* @bar_i
- %tmp2 = call i32 @foo_f()
- %tmp3 = add i32 %tmp, %tmp2
- %tmp4 = call %FunTy* @bar_f()
- %tmp5 = add i32 %tmp3, %tmp4
- %tmp6 = add i32 %tmp1, %tmp5
- %tmp7 = add i32 %tmp6, %tmp0
- ret i32 %tmp7
-}
diff --git a/release_23/test/CodeGen/X86/aligned-comm.ll b/release_23/test/CodeGen/X86/aligned-comm.ll
deleted file mode 100644
index 10c68d827504..000000000000
--- a/release_23/test/CodeGen/X86/aligned-comm.ll
+++ /dev/null
@@ -1,8 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86
-; RUN: llvm-as < %s | llc -mtriple=i386-apple-darwin10 | grep {array,16512,7}
-; RUN: llvm-as < %s | llc -mtriple=i386-apple-darwin9 | grep {array,16512,7}
-; RUN: llvm-as < %s | llc -mtriple=i386-apple-darwin8 | not grep {7}
-
-; Darwin 9+ should get alignment on common symbols. Darwin8 does
-; not support this.
-@array = weak global [4128 x i32] zeroinitializer, align 128
diff --git a/release_23/test/CodeGen/X86/all-ones-vector.ll b/release_23/test/CodeGen/X86/all-ones-vector.ll
deleted file mode 100644
index 5709d7951f5d..000000000000
--- a/release_23/test/CodeGen/X86/all-ones-vector.ll
+++ /dev/null
@@ -1,14 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -mattr=sse2 | grep pcmpeqd | count 4
-
-define <4 x i32> @ioo() {
- ret <4 x i32> <i32 -1, i32 -1, i32 -1, i32 -1>
-}
-define <2 x i64> @loo() {
- ret <2 x i64> <i64 -1, i64 -1>
-}
-define <2 x double> @doo() {
- ret <2 x double> <double 0xffffffffffffffff, double 0xffffffffffffffff>
-}
-define <4 x float> @foo() {
- ret <4 x float> <float 0xffffffffe0000000, float 0xffffffffe0000000, float 0xffffffffe0000000, float 0xffffffffe0000000>
-}
diff --git a/release_23/test/CodeGen/X86/alloca-align-rounding.ll b/release_23/test/CodeGen/X86/alloca-align-rounding.ll
deleted file mode 100644
index af3fe905d69e..000000000000
--- a/release_23/test/CodeGen/X86/alloca-align-rounding.ll
+++ /dev/null
@@ -1,16 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -mtriple=i686-apple-darwin | grep and | count 1
-; RUN: llvm-as < %s | llc -march=x86-64 -mtriple=i686-pc-linux | grep and | count 3
-
-declare void @bar(<2 x i64>* %n)
-
-define void @foo(i32 %h) {
- %p = alloca <2 x i64>, i32 %h
- call void @bar(<2 x i64>* %p)
- ret void
-}
-
-define void @foo2(i32 %h) {
- %p = alloca <2 x i64>, i32 %h, align 32
- call void @bar(<2 x i64>* %p)
- ret void
-}
diff --git a/release_23/test/CodeGen/X86/and-or-fold.ll b/release_23/test/CodeGen/X86/and-or-fold.ll
deleted file mode 100644
index 3501047abc16..000000000000
--- a/release_23/test/CodeGen/X86/and-or-fold.ll
+++ /dev/null
@@ -1,14 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 | grep and | count 1
-
-; The dag combiner should fold together (x&127)|(y&16711680) -> (x|y)&c1
-; in this case.
-
-define i32 @test6(i32 %x, i16 %y) {
- %tmp1 = zext i16 %y to i32 ; <i32> [#uses=1]
- %tmp2 = and i32 %tmp1, 127 ; <i32> [#uses=1]
- %tmp4 = shl i32 %x, 16 ; <i32> [#uses=1]
- %tmp5 = and i32 %tmp4, 16711680 ; <i32> [#uses=1]
- %tmp6 = or i32 %tmp2, %tmp5 ; <i32> [#uses=1]
- ret i32 %tmp6
-}
-
diff --git a/release_23/test/CodeGen/X86/arg-cast.ll b/release_23/test/CodeGen/X86/arg-cast.ll
deleted file mode 100644
index 2e2bc3cc8f21..000000000000
--- a/release_23/test/CodeGen/X86/arg-cast.ll
+++ /dev/null
@@ -1,18 +0,0 @@
-; This should compile to movl $2147483647, %eax + andl only.
-; RUN: llvm-as < %s | llc | grep andl
-; RUN: llvm-as < %s | llc | not grep movsd
-; RUN: llvm-as < %s | llc | grep esp | not grep add
-; rdar://5736574
-
-target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
-target triple = "i686-apple-darwin8"
-
-define i32 @foo(double %x) nounwind {
-entry:
- %x15 = bitcast double %x to i64 ; <i64> [#uses=1]
- %tmp713 = lshr i64 %x15, 32 ; <i64> [#uses=1]
- %tmp714 = trunc i64 %tmp713 to i32 ; <i32> [#uses=1]
- %tmp8 = and i32 %tmp714, 2147483647 ; <i32> [#uses=1]
- ret i32 %tmp8
-}
-
diff --git a/release_23/test/CodeGen/X86/asm-block-labels.ll b/release_23/test/CodeGen/X86/asm-block-labels.ll
deleted file mode 100644
index 284a9fb00fde..000000000000
--- a/release_23/test/CodeGen/X86/asm-block-labels.ll
+++ /dev/null
@@ -1,41 +0,0 @@
-; RUN: llvm-as < %s | opt -std-compile-opts | llc
-; ModuleID = 'block12.c'
-target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
-target triple = "i686-apple-darwin8"
-
-define void @bar() {
-entry:
- br label %"LASM$foo"
-
-"LASM$foo": ; preds = %entry
- call void asm sideeffect ".file \22block12.c\22", "~{dirflag},~{fpsr},~{flags}"( )
- call void asm sideeffect ".line 1", "~{dirflag},~{fpsr},~{flags}"( )
- call void asm sideeffect "int $$1", "~{dirflag},~{fpsr},~{flags},~{memory}"( )
- call void asm sideeffect ".file \22block12.c\22", "~{dirflag},~{fpsr},~{flags}"( )
- call void asm sideeffect ".line 2", "~{dirflag},~{fpsr},~{flags}"( )
- call void asm sideeffect "brl ${0:l}", "X,~{dirflag},~{fpsr},~{flags},~{memory}"( label %"LASM$foo" )
- br label %return
-
-return: ; preds = %"LASM$foo"
- ret void
-}
-
-define void @baz() {
-entry:
- call void asm sideeffect ".file \22block12.c\22", "~{dirflag},~{fpsr},~{flags}"( )
- call void asm sideeffect ".line 3", "~{dirflag},~{fpsr},~{flags}"( )
- call void asm sideeffect "brl ${0:l}", "X,~{dirflag},~{fpsr},~{flags},~{memory}"( label %"LASM$foo" )
- call void asm sideeffect ".file \22block12.c\22", "~{dirflag},~{fpsr},~{flags}"( )
- call void asm sideeffect ".line 4", "~{dirflag},~{fpsr},~{flags}"( )
- call void asm sideeffect "int $$1", "~{dirflag},~{fpsr},~{flags},~{memory}"( )
- br label %"LASM$foo"
-
-"LASM$foo": ; preds = %entry
- call void asm sideeffect ".file \22block12.c\22", "~{dirflag},~{fpsr},~{flags}"( )
- call void asm sideeffect ".line 5", "~{dirflag},~{fpsr},~{flags}"( )
- call void asm sideeffect "int $$1", "~{dirflag},~{fpsr},~{flags},~{memory}"( )
- br label %return
-
-return: ; preds = %"LASM$foo"
- ret void
-}
diff --git a/release_23/test/CodeGen/X86/asm-global-imm.ll b/release_23/test/CodeGen/X86/asm-global-imm.ll
deleted file mode 100644
index 333c7689ab4a..000000000000
--- a/release_23/test/CodeGen/X86/asm-global-imm.ll
+++ /dev/null
@@ -1,23 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -relocation-model=static | \
-; RUN: grep {test1 \$_GV}
-; RUN: llvm-as < %s | llc -march=x86 -relocation-model=static | \
-; RUN: grep {test2 _GV}
-; PR882
-
-target datalayout = "e-p:32:32"
-target triple = "i686-apple-darwin9.0.0d2"
-@GV = weak global i32 0 ; <i32*> [#uses=2]
-@str = external global [12 x i8] ; <[12 x i8]*> [#uses=1]
-
-define void @foo() {
-entry:
- tail call void asm sideeffect "test1 $0", "i,~{dirflag},~{fpsr},~{flags}"( i32* @GV )
- tail call void asm sideeffect "test2 ${0:c}", "i,~{dirflag},~{fpsr},~{flags}"( i32* @GV )
- ret void
-}
-
-define void @unknown_bootoption() {
-entry:
- call void asm sideeffect "ud2\0A\09.word ${0:c}\0A\09.long ${1:c}\0A", "i,i,~{dirflag},~{fpsr},~{flags}"( i32 235, i8* getelementptr ([12 x i8]* @str, i32 0, i64 0) )
- ret void
-}
diff --git a/release_23/test/CodeGen/X86/atomic_op.ll b/release_23/test/CodeGen/X86/atomic_op.ll
deleted file mode 100644
index 4687da111715..000000000000
--- a/release_23/test/CodeGen/X86/atomic_op.ll
+++ /dev/null
@@ -1,93 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -o %t1 -f
-; RUN: grep "lock xaddl" %t1 | count 4
-; RUN: grep "lock cmpxchgl" %t1 | count 13
-; RUN: grep "xchgl" %t1 | count 14
-; RUN: grep "cmova" %t1 | count 2
-; RUN: grep "cmovb" %t1 | count 2
-; RUN: grep "cmovg" %t1 | count 2
-; RUN: grep "cmovl" %t1 | count 2
-
-target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
-
-define void @main(i32 %argc, i8** %argv) {
-entry:
- %argc.addr = alloca i32 ; <i32*> [#uses=1]
- %argv.addr = alloca i8** ; <i8***> [#uses=1]
- %val1 = alloca i32 ; <i32*> [#uses=2]
- %val2 = alloca i32 ; <i32*> [#uses=15]
- %andt = alloca i32 ; <i32*> [#uses=2]
- %ort = alloca i32 ; <i32*> [#uses=2]
- %xort = alloca i32 ; <i32*> [#uses=2]
- %old = alloca i32 ; <i32*> [#uses=18]
- %temp = alloca i32 ; <i32*> [#uses=2]
- store i32 %argc, i32* %argc.addr
- store i8** %argv, i8*** %argv.addr
- store i32 0, i32* %val1
- store i32 31, i32* %val2
- store i32 3855, i32* %andt
- store i32 3855, i32* %ort
- store i32 3855, i32* %xort
- store i32 4, i32* %temp
- %tmp = load i32* %temp ; <i32> [#uses=1]
- call i32 @llvm.atomic.las.i32( i32* %val1, i32 %tmp ) ; <i32>:0 [#uses=1]
- store i32 %0, i32* %old
- call i32 @llvm.atomic.lss.i32( i32* %val2, i32 30 ) ; <i32>:1 [#uses=1]
- store i32 %1, i32* %old
- call i32 @llvm.atomic.las.i32( i32* %val2, i32 1 ) ; <i32>:2 [#uses=1]
- store i32 %2, i32* %old
- call i32 @llvm.atomic.lss.i32( i32* %val2, i32 1 ) ; <i32>:3 [#uses=1]
- store i32 %3, i32* %old
- call i32 @llvm.atomic.load.and.i32( i32* %andt, i32 4080 ) ; <i32>:4 [#uses=1]
- store i32 %4, i32* %old
- call i32 @llvm.atomic.load.or.i32( i32* %ort, i32 4080 ) ; <i32>:5 [#uses=1]
- store i32 %5, i32* %old
- call i32 @llvm.atomic.load.xor.i32( i32* %xort, i32 4080 ) ; <i32>:6 [#uses=1]
- store i32 %6, i32* %old
- call i32 @llvm.atomic.load.min.i32( i32* %val2, i32 16 ) ; <i32>:7 [#uses=1]
- store i32 %7, i32* %old
- %neg = sub i32 0, 1 ; <i32> [#uses=1]
- call i32 @llvm.atomic.load.min.i32( i32* %val2, i32 %neg ) ; <i32>:8 [#uses=1]
- store i32 %8, i32* %old
- call i32 @llvm.atomic.load.max.i32( i32* %val2, i32 1 ) ; <i32>:9 [#uses=1]
- store i32 %9, i32* %old
- call i32 @llvm.atomic.load.max.i32( i32* %val2, i32 0 ) ; <i32>:10 [#uses=1]
- store i32 %10, i32* %old
- call i32 @llvm.atomic.load.umax.i32( i32* %val2, i32 65535 ) ; <i32>:11 [#uses=1]
- store i32 %11, i32* %old
- call i32 @llvm.atomic.load.umax.i32( i32* %val2, i32 10 ) ; <i32>:12 [#uses=1]
- store i32 %12, i32* %old
- call i32 @llvm.atomic.load.umin.i32( i32* %val2, i32 1 ) ; <i32>:13 [#uses=1]
- store i32 %13, i32* %old
- call i32 @llvm.atomic.load.umin.i32( i32* %val2, i32 10 ) ; <i32>:14 [#uses=1]
- store i32 %14, i32* %old
- call i32 @llvm.atomic.swap.i32( i32* %val2, i32 1976 ) ; <i32>:15 [#uses=1]
- store i32 %15, i32* %old
- %neg1 = sub i32 0, 10 ; <i32> [#uses=1]
- call i32 @llvm.atomic.lcs.i32( i32* %val2, i32 %neg1, i32 1 ) ; <i32>:16 [#uses=1]
- store i32 %16, i32* %old
- call i32 @llvm.atomic.lcs.i32( i32* %val2, i32 1976, i32 1 ) ; <i32>:17 [#uses=1]
- store i32 %17, i32* %old
- ret void
-}
-
-declare i32 @llvm.atomic.las.i32(i32*, i32) nounwind
-
-declare i32 @llvm.atomic.lss.i32(i32*, i32) nounwind
-
-declare i32 @llvm.atomic.load.and.i32(i32*, i32) nounwind
-
-declare i32 @llvm.atomic.load.or.i32(i32*, i32) nounwind
-
-declare i32 @llvm.atomic.load.xor.i32(i32*, i32) nounwind
-
-declare i32 @llvm.atomic.load.min.i32(i32*, i32) nounwind
-
-declare i32 @llvm.atomic.load.max.i32(i32*, i32) nounwind
-
-declare i32 @llvm.atomic.load.umax.i32(i32*, i32) nounwind
-
-declare i32 @llvm.atomic.load.umin.i32(i32*, i32) nounwind
-
-declare i32 @llvm.atomic.swap.i32(i32*, i32) nounwind
-
-declare i32 @llvm.atomic.lcs.i32(i32*, i32, i32) nounwind
diff --git a/release_23/test/CodeGen/X86/bitcast-int-to-vector.ll b/release_23/test/CodeGen/X86/bitcast-int-to-vector.ll
deleted file mode 100644
index 370bec09848f..000000000000
--- a/release_23/test/CodeGen/X86/bitcast-int-to-vector.ll
+++ /dev/null
@@ -1,10 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86
-
-define i1 @foo(i64 %a)
-{
- %t = bitcast i64 %a to <2 x float>
- %r = extractelement <2 x float> %t, i32 0
- %s = extractelement <2 x float> %t, i32 1
- %b = fcmp uno float %r, %s
- ret i1 %b
-}
diff --git a/release_23/test/CodeGen/X86/bitcast.ll b/release_23/test/CodeGen/X86/bitcast.ll
deleted file mode 100644
index f575409f2149..000000000000
--- a/release_23/test/CodeGen/X86/bitcast.ll
+++ /dev/null
@@ -1,24 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86
-; RUN: llvm-as < %s | llc -march=x86-64
-; PR1033
-
-define i64 @test1(double %t) {
- %u = bitcast double %t to i64 ; <i64> [#uses=1]
- ret i64 %u
-}
-
-define double @test2(i64 %t) {
- %u = bitcast i64 %t to double ; <double> [#uses=1]
- ret double %u
-}
-
-define i32 @test3(float %t) {
- %u = bitcast float %t to i32 ; <i32> [#uses=1]
- ret i32 %u
-}
-
-define float @test4(i32 %t) {
- %u = bitcast i32 %t to float ; <float> [#uses=1]
- ret float %u
-}
-
diff --git a/release_23/test/CodeGen/X86/bitcast2.ll b/release_23/test/CodeGen/X86/bitcast2.ll
deleted file mode 100644
index 3e2693157802..000000000000
--- a/release_23/test/CodeGen/X86/bitcast2.ll
+++ /dev/null
@@ -1,13 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86-64 | grep movd | count 2
-; RUN: llvm-as < %s | llc -march=x86-64 | not grep rsp
-
-define i64 @test1(double %A) {
- %B = bitcast double %A to i64
- ret i64 %B
-}
-
-define double @test2(i64 %A) {
- %B = bitcast i64 %A to double
- ret double %B
-}
-
diff --git a/release_23/test/CodeGen/X86/bswap.ll b/release_23/test/CodeGen/X86/bswap.ll
deleted file mode 100644
index 592e25bae331..000000000000
--- a/release_23/test/CodeGen/X86/bswap.ll
+++ /dev/null
@@ -1,27 +0,0 @@
-; bswap should be constant folded when it is passed a constant argument
-
-; RUN: llvm-as < %s | llc -march=x86 | \
-; RUN: grep bswapl | count 3
-; RUN: llvm-as < %s | llc -march=x86 | grep rolw | count 1
-
-declare i16 @llvm.bswap.i16(i16)
-
-declare i32 @llvm.bswap.i32(i32)
-
-declare i64 @llvm.bswap.i64(i64)
-
-define i16 @W(i16 %A) {
- %Z = call i16 @llvm.bswap.i16( i16 %A ) ; <i16> [#uses=1]
- ret i16 %Z
-}
-
-define i32 @X(i32 %A) {
- %Z = call i32 @llvm.bswap.i32( i32 %A ) ; <i32> [#uses=1]
- ret i32 %Z
-}
-
-define i64 @Y(i64 %A) {
- %Z = call i64 @llvm.bswap.i64( i64 %A ) ; <i64> [#uses=1]
- ret i64 %Z
-}
-
diff --git a/release_23/test/CodeGen/X86/byval.ll b/release_23/test/CodeGen/X86/byval.ll
deleted file mode 100644
index a75214a6b084..000000000000
--- a/release_23/test/CodeGen/X86/byval.ll
+++ /dev/null
@@ -1,13 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86-64 | grep {movq 8(%rsp), %rax}
-; RUN: llvm-as < %s | llc -march=x86 > %t
-; RUN: grep {movl 8(%esp), %edx} %t
-; RUN: grep {movl 4(%esp), %eax} %t
-
-%struct.s = type { i64, i64, i64 }
-
-define i64 @f(%struct.s* byval %a) {
-entry:
- %tmp2 = getelementptr %struct.s* %a, i32 0, i32 0
- %tmp3 = load i64* %tmp2, align 8
- ret i64 %tmp3
-}
diff --git a/release_23/test/CodeGen/X86/byval2.ll b/release_23/test/CodeGen/X86/byval2.ll
deleted file mode 100644
index f85c8ffbe4fe..000000000000
--- a/release_23/test/CodeGen/X86/byval2.ll
+++ /dev/null
@@ -1,22 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86-64 | grep rep.movsq | count 2
-; RUN: llvm-as < %s | llc -march=x86 | grep rep.movsl | count 2
-
-%struct.s = type { i64, i64, i64, i64, i64, i64, i64, i64,
- i64, i64, i64, i64, i64, i64, i64, i64,
- i64 }
-
-define void @g(i64 %a, i64 %b, i64 %c) {
-entry:
- %d = alloca %struct.s, align 16
- %tmp = getelementptr %struct.s* %d, i32 0, i32 0
- store i64 %a, i64* %tmp, align 16
- %tmp2 = getelementptr %struct.s* %d, i32 0, i32 1
- store i64 %b, i64* %tmp2, align 16
- %tmp4 = getelementptr %struct.s* %d, i32 0, i32 2
- store i64 %c, i64* %tmp4, align 16
- call void @f( %struct.s* %d byval)
- call void @f( %struct.s* %d byval)
- ret void
-}
-
-declare void @f(%struct.s* byval)
diff --git a/release_23/test/CodeGen/X86/byval3.ll b/release_23/test/CodeGen/X86/byval3.ll
deleted file mode 100644
index 074bab4c0a9e..000000000000
--- a/release_23/test/CodeGen/X86/byval3.ll
+++ /dev/null
@@ -1,30 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86-64 | grep rep.movsl | count 2
-; RUN: llvm-as < %s | llc -march=x86 | grep rep.movsl | count 2
-
-%struct.s = type { i32, i32, i32, i32, i32, i32, i32, i32,
- i32, i32, i32, i32, i32, i32, i32, i32,
- i32, i32, i32, i32, i32, i32, i32, i32,
- i32, i32, i32, i32, i32, i32, i32, i32,
- i32 }
-
-define void @g(i32 %a1, i32 %a2, i32 %a3, i32 %a4, i32 %a5, i32 %a6) {
-entry:
- %d = alloca %struct.s, align 16
- %tmp = getelementptr %struct.s* %d, i32 0, i32 0
- store i32 %a1, i32* %tmp, align 16
- %tmp2 = getelementptr %struct.s* %d, i32 0, i32 1
- store i32 %a2, i32* %tmp2, align 16
- %tmp4 = getelementptr %struct.s* %d, i32 0, i32 2
- store i32 %a3, i32* %tmp4, align 16
- %tmp6 = getelementptr %struct.s* %d, i32 0, i32 3
- store i32 %a4, i32* %tmp6, align 16
- %tmp8 = getelementptr %struct.s* %d, i32 0, i32 4
- store i32 %a5, i32* %tmp8, align 16
- %tmp10 = getelementptr %struct.s* %d, i32 0, i32 5
- store i32 %a6, i32* %tmp10, align 16
- call void @f( %struct.s* %d byval)
- call void @f( %struct.s* %d byval)
- ret void
-}
-
-declare void @f(%struct.s* byval)
diff --git a/release_23/test/CodeGen/X86/byval4.ll b/release_23/test/CodeGen/X86/byval4.ll
deleted file mode 100644
index d2fa9e289e79..000000000000
--- a/release_23/test/CodeGen/X86/byval4.ll
+++ /dev/null
@@ -1,36 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86-64 | grep rep.movsw | count 2
-; RUN: llvm-as < %s | llc -march=x86 | grep rep.movsl | count 2
-
-%struct.s = type { i16, i16, i16, i16, i16, i16, i16, i16,
- i16, i16, i16, i16, i16, i16, i16, i16,
- i16, i16, i16, i16, i16, i16, i16, i16,
- i16, i16, i16, i16, i16, i16, i16, i16,
- i16, i16, i16, i16, i16, i16, i16, i16,
- i16, i16, i16, i16, i16, i16, i16, i16,
- i16, i16, i16, i16, i16, i16, i16, i16,
- i16, i16, i16, i16, i16, i16, i16, i16,
- i16 }
-
-
-define void @g(i16 signext %a1, i16 signext %a2, i16 signext %a3,
- i16 signext %a4, i16 signext %a5, i16 signext %a6) {
-entry:
- %a = alloca %struct.s, align 16
- %tmp = getelementptr %struct.s* %a, i32 0, i32 0
- store i16 %a1, i16* %tmp, align 16
- %tmp2 = getelementptr %struct.s* %a, i32 0, i32 1
- store i16 %a2, i16* %tmp2, align 16
- %tmp4 = getelementptr %struct.s* %a, i32 0, i32 2
- store i16 %a3, i16* %tmp4, align 16
- %tmp6 = getelementptr %struct.s* %a, i32 0, i32 3
- store i16 %a4, i16* %tmp6, align 16
- %tmp8 = getelementptr %struct.s* %a, i32 0, i32 4
- store i16 %a5, i16* %tmp8, align 16
- %tmp10 = getelementptr %struct.s* %a, i32 0, i32 5
- store i16 %a6, i16* %tmp10, align 16
- call void @f( %struct.s* %a byval )
- call void @f( %struct.s* %a byval )
- ret void
-}
-
-declare void @f(%struct.s* byval)
diff --git a/release_23/test/CodeGen/X86/byval5.ll b/release_23/test/CodeGen/X86/byval5.ll
deleted file mode 100644
index fd9c197bbfd9..000000000000
--- a/release_23/test/CodeGen/X86/byval5.ll
+++ /dev/null
@@ -1,44 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86-64 | grep rep.movsb | count 2
-; RUN: llvm-as < %s | llc -march=x86 | grep rep.movsl | count 2
-
-%struct.s = type { i8, i8, i8, i8, i8, i8, i8, i8,
- i8, i8, i8, i8, i8, i8, i8, i8,
- i8, i8, i8, i8, i8, i8, i8, i8,
- i8, i8, i8, i8, i8, i8, i8, i8,
- i8, i8, i8, i8, i8, i8, i8, i8,
- i8, i8, i8, i8, i8, i8, i8, i8,
- i8, i8, i8, i8, i8, i8, i8, i8,
- i8, i8, i8, i8, i8, i8, i8, i8,
- i8, i8, i8, i8, i8, i8, i8, i8,
- i8, i8, i8, i8, i8, i8, i8, i8,
- i8, i8, i8, i8, i8, i8, i8, i8,
- i8, i8, i8, i8, i8, i8, i8, i8,
- i8, i8, i8, i8, i8, i8, i8, i8,
- i8, i8, i8, i8, i8, i8, i8, i8,
- i8, i8, i8, i8, i8, i8, i8, i8,
- i8, i8, i8, i8, i8, i8, i8, i8,
- i8 }
-
-
-define void @g(i8 signext %a1, i8 signext %a2, i8 signext %a3,
- i8 signext %a4, i8 signext %a5, i8 signext %a6) {
-entry:
- %a = alloca %struct.s
- %tmp = getelementptr %struct.s* %a, i32 0, i32 0
- store i8 %a1, i8* %tmp, align 8
- %tmp2 = getelementptr %struct.s* %a, i32 0, i32 1
- store i8 %a2, i8* %tmp2, align 8
- %tmp4 = getelementptr %struct.s* %a, i32 0, i32 2
- store i8 %a3, i8* %tmp4, align 8
- %tmp6 = getelementptr %struct.s* %a, i32 0, i32 3
- store i8 %a4, i8* %tmp6, align 8
- %tmp8 = getelementptr %struct.s* %a, i32 0, i32 4
- store i8 %a5, i8* %tmp8, align 8
- %tmp10 = getelementptr %struct.s* %a, i32 0, i32 5
- store i8 %a6, i8* %tmp10, align 8
- call void @f( %struct.s* %a byval )
- call void @f( %struct.s* %a byval )
- ret void
-}
-
-declare void @f(%struct.s* byval)
diff --git a/release_23/test/CodeGen/X86/byval6.ll b/release_23/test/CodeGen/X86/byval6.ll
deleted file mode 100644
index 47269d21d930..000000000000
--- a/release_23/test/CodeGen/X86/byval6.ll
+++ /dev/null
@@ -1,16 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 | grep add | not grep 16
-
- %struct.W = type { x86_fp80, x86_fp80 }
-@B = global %struct.W { x86_fp80 0xK4001A000000000000000, x86_fp80 0xK4001C000000000000000 }, align 32
-@.cpx = internal constant %struct.W { x86_fp80 0xK4001E000000000000000, x86_fp80 0xK40028000000000000000 }
-
-define i32 @main() nounwind {
-entry:
- tail call void (i32, ...)* @bar( i32 3, %struct.W* byval @.cpx ) nounwind
- tail call void (i32, ...)* @baz( i32 3, %struct.W* byval @B ) nounwind
- ret i32 undef
-}
-
-declare void @bar(i32, ...)
-
-declare void @baz(i32, ...)
diff --git a/release_23/test/CodeGen/X86/byval7.ll b/release_23/test/CodeGen/X86/byval7.ll
deleted file mode 100644
index fcbc59b838ab..000000000000
--- a/release_23/test/CodeGen/X86/byval7.ll
+++ /dev/null
@@ -1,15 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -mcpu=yonah | grep add | grep 16
-
- %struct.S = type { <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>,
- <2 x i64> }
-
-define i32 @main() nounwind {
-entry:
- %s = alloca %struct.S ; <%struct.S*> [#uses=2]
- %tmp15 = getelementptr %struct.S* %s, i32 0, i32 0 ; <<2 x i64>*> [#uses=1]
- store <2 x i64> < i64 8589934595, i64 1 >, <2 x i64>* %tmp15, align 16
- call void @t( i32 1, %struct.S* byval %s ) nounwind
- ret i32 0
-}
-
-declare void @t(i32, %struct.S* byval )
diff --git a/release_23/test/CodeGen/X86/call-push.ll b/release_23/test/CodeGen/X86/call-push.ll
deleted file mode 100644
index ad9b796a85d0..000000000000
--- a/release_23/test/CodeGen/X86/call-push.ll
+++ /dev/null
@@ -1,24 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -disable-fp-elim | grep subl | count 1
-
- %struct.decode_t = type { i8, i8, i8, i8, i16, i8, i8, %struct.range_t** }
- %struct.range_t = type { float, float, i32, i32, i32, [0 x i8] }
-
-define i32 @decode_byte(%struct.decode_t* %decode) {
-entry:
- %tmp2 = getelementptr %struct.decode_t* %decode, i32 0, i32 4 ; <i16*> [#uses=1]
- %tmp23 = bitcast i16* %tmp2 to i32* ; <i32*> [#uses=1]
- %tmp4 = load i32* %tmp23 ; <i32> [#uses=1]
- %tmp514 = lshr i32 %tmp4, 24 ; <i32> [#uses=1]
- %tmp56 = trunc i32 %tmp514 to i8 ; <i8> [#uses=1]
- %tmp7 = icmp eq i8 %tmp56, 0 ; <i1> [#uses=1]
- br i1 %tmp7, label %UnifiedReturnBlock, label %cond_true
-
-cond_true: ; preds = %entry
- %tmp10 = tail call i32 @f( %struct.decode_t* %decode ) ; <i32> [#uses=1]
- ret i32 %tmp10
-
-UnifiedReturnBlock: ; preds = %entry
- ret i32 0
-}
-
-declare i32 @f(%struct.decode_t*)
diff --git a/release_23/test/CodeGen/X86/clz.ll b/release_23/test/CodeGen/X86/clz.ll
deleted file mode 100644
index c3b3b412f2a9..000000000000
--- a/release_23/test/CodeGen/X86/clz.ll
+++ /dev/null
@@ -1,26 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 | grep bsr | count 2
-; RUN: llvm-as < %s | llc -march=x86 | grep bsf
-; RUN: llvm-as < %s | llc -march=x86 | grep cmov | count 3
-
-define i32 @t1(i32 %x) nounwind {
- %tmp = tail call i32 @llvm.ctlz.i32( i32 %x )
- ret i32 %tmp
-}
-
-declare i32 @llvm.ctlz.i32(i32) nounwind readnone
-
-define i32 @t2(i32 %x) nounwind {
- %tmp = tail call i32 @llvm.cttz.i32( i32 %x )
- ret i32 %tmp
-}
-
-declare i32 @llvm.cttz.i32(i32) nounwind readnone
-
-define i16 @t3(i16 %x, i16 %y) nounwind {
-entry:
- %tmp1 = add i16 %x, %y
- %tmp2 = tail call i16 @llvm.ctlz.i16( i16 %tmp1 ) ; <i16> [#uses=1]
- ret i16 %tmp2
-}
-
-declare i16 @llvm.ctlz.i16(i16) nounwind readnone
diff --git a/release_23/test/CodeGen/X86/cmp-test.ll b/release_23/test/CodeGen/X86/cmp-test.ll
deleted file mode 100644
index 91c8a87ea541..000000000000
--- a/release_23/test/CodeGen/X86/cmp-test.ll
+++ /dev/null
@@ -1,27 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 | grep cmp | count 1
-; RUN: llvm-as < %s | llc -march=x86 | grep test | count 1
-
-define i32 @f1(i32 %X, i32* %y) {
- %tmp = load i32* %y ; <i32> [#uses=1]
- %tmp.upgrd.1 = icmp eq i32 %tmp, 0 ; <i1> [#uses=1]
- br i1 %tmp.upgrd.1, label %ReturnBlock, label %cond_true
-
-cond_true: ; preds = %0
- ret i32 1
-
-ReturnBlock: ; preds = %0
- ret i32 0
-}
-
-define i32 @f2(i32 %X, i32* %y) {
- %tmp = load i32* %y ; <i32> [#uses=1]
- %tmp1 = shl i32 %tmp, 3 ; <i32> [#uses=1]
- %tmp1.upgrd.2 = icmp eq i32 %tmp1, 0 ; <i1> [#uses=1]
- br i1 %tmp1.upgrd.2, label %ReturnBlock, label %cond_true
-
-cond_true: ; preds = %0
- ret i32 1
-
-ReturnBlock: ; preds = %0
- ret i32 0
-}
diff --git a/release_23/test/CodeGen/X86/cmp0.ll b/release_23/test/CodeGen/X86/cmp0.ll
deleted file mode 100644
index f66f90c0b0f3..000000000000
--- a/release_23/test/CodeGen/X86/cmp0.ll
+++ /dev/null
@@ -1,7 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86-64 | grep -v cmp
-
-define i64 @foo(i64 %x) {
- %t = icmp eq i64 %x, 0
- %r = zext i1 %t to i64
- ret i64 %r
-}
diff --git a/release_23/test/CodeGen/X86/cmp1.ll b/release_23/test/CodeGen/X86/cmp1.ll
deleted file mode 100644
index 241618c531ab..000000000000
--- a/release_23/test/CodeGen/X86/cmp1.ll
+++ /dev/null
@@ -1,7 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86-64 | grep -v cmp
-
-define i64 @foo(i64 %x) {
- %t = icmp slt i64 %x, 1
- %r = zext i1 %t to i64
- ret i64 %r
-}
diff --git a/release_23/test/CodeGen/X86/coalescer-commute1.ll b/release_23/test/CodeGen/X86/coalescer-commute1.ll
deleted file mode 100644
index 0fae2a659466..000000000000
--- a/release_23/test/CodeGen/X86/coalescer-commute1.ll
+++ /dev/null
@@ -1,26 +0,0 @@
-; RUN: llvm-as < %s | llc -mtriple=i686-apple-darwin -mattr=+sse2 | not grep movaps
-; PR1877
-
-@NNTOT = weak global i32 0 ; <i32*> [#uses=1]
-@G = weak global float 0.000000e+00 ; <float*> [#uses=1]
-
-define void @runcont(i32* %source) nounwind {
-entry:
- %tmp10 = load i32* @NNTOT, align 4 ; <i32> [#uses=1]
- br label %bb
-
-bb: ; preds = %bb, %entry
- %neuron.0 = phi i32 [ 0, %entry ], [ %indvar.next, %bb ] ; <i32> [#uses=2]
- %thesum.0 = phi float [ 0.000000e+00, %entry ], [ %tmp6, %bb ] ; <float> [#uses=1]
- %tmp2 = getelementptr i32* %source, i32 %neuron.0 ; <i32*> [#uses=1]
- %tmp3 = load i32* %tmp2, align 4 ; <i32> [#uses=1]
- %tmp34 = sitofp i32 %tmp3 to float ; <float> [#uses=1]
- %tmp6 = add float %tmp34, %thesum.0 ; <float> [#uses=2]
- %indvar.next = add i32 %neuron.0, 1 ; <i32> [#uses=2]
- %exitcond = icmp eq i32 %indvar.next, %tmp10 ; <i1> [#uses=1]
- br i1 %exitcond, label %bb13, label %bb
-
-bb13: ; preds = %bb
- volatile store float %tmp6, float* @G, align 4
- ret void
-}
diff --git a/release_23/test/CodeGen/X86/coalescer-commute2.ll b/release_23/test/CodeGen/X86/coalescer-commute2.ll
deleted file mode 100644
index ce4abf1d31ab..000000000000
--- a/release_23/test/CodeGen/X86/coalescer-commute2.ll
+++ /dev/null
@@ -1,34 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86-64 | grep paddw | count 2
-; RUN: llvm-as < %s | llc -march=x86-64 | not grep mov
-
-; The 2-addr pass should ensure that identical code is produced for these functions
-; no extra copy should be generated.
-
-define <2 x i64> @test1(<2 x i64> %x, <2 x i64> %y) nounwind {
-entry:
- %tmp6 = bitcast <2 x i64> %y to <8 x i16> ; <<8 x i16>> [#uses=1]
- %tmp8 = bitcast <2 x i64> %x to <8 x i16> ; <<8 x i16>> [#uses=1]
- %tmp9 = add <8 x i16> %tmp8, %tmp6 ; <<8 x i16>> [#uses=1]
- %tmp10 = bitcast <8 x i16> %tmp9 to <2 x i64> ; <<2 x i64>> [#uses=1]
- ret <2 x i64> %tmp10
-}
-
-define <2 x i64> @test2(<2 x i64> %x, <2 x i64> %y) nounwind {
-entry:
- %tmp6 = bitcast <2 x i64> %x to <8 x i16> ; <<8 x i16>> [#uses=1]
- %tmp8 = bitcast <2 x i64> %y to <8 x i16> ; <<8 x i16>> [#uses=1]
- %tmp9 = add <8 x i16> %tmp8, %tmp6 ; <<8 x i16>> [#uses=1]
- %tmp10 = bitcast <8 x i16> %tmp9 to <2 x i64> ; <<2 x i64>> [#uses=1]
- ret <2 x i64> %tmp10
-}
-
-
-; The coalescer should commute the add to avoid a copy.
-define <4 x float> @test3(<4 x float> %V) {
-entry:
- %tmp8 = shufflevector <4 x float> %V, <4 x float> undef,
- <4 x i32> < i32 3, i32 2, i32 1, i32 0 >
- %add = add <4 x float> %tmp8, %V
- ret <4 x float> %add
-}
-
diff --git a/release_23/test/CodeGen/X86/coalescer-commute3.ll b/release_23/test/CodeGen/X86/coalescer-commute3.ll
deleted file mode 100644
index ea7563722536..000000000000
--- a/release_23/test/CodeGen/X86/coalescer-commute3.ll
+++ /dev/null
@@ -1,24 +0,0 @@
-; RUN: llvm-as < %s | llc -mtriple=i686-apple-darwin -mattr=+sse2 | grep mov | count 6
-
- %struct.quad_struct = type { i32, i32, %struct.quad_struct*, %struct.quad_struct*, %struct.quad_struct*, %struct.quad_struct*, %struct.quad_struct* }
-
-define fastcc i32 @perimeter(%struct.quad_struct* %tree, i32 %size) nounwind {
-entry:
- switch i32 %size, label %UnifiedReturnBlock [
- i32 2, label %bb
- i32 0, label %bb50
- ]
-
-bb: ; preds = %entry
- %tmp31 = tail call fastcc i32 @perimeter( %struct.quad_struct* null, i32 0 ) nounwind ; <i32> [#uses=1]
- %tmp40 = tail call fastcc i32 @perimeter( %struct.quad_struct* null, i32 0 ) nounwind ; <i32> [#uses=1]
- %tmp33 = add i32 0, %tmp31 ; <i32> [#uses=1]
- %tmp42 = add i32 %tmp33, %tmp40 ; <i32> [#uses=1]
- ret i32 %tmp42
-
-bb50: ; preds = %entry
- ret i32 0
-
-UnifiedReturnBlock: ; preds = %entry
- ret i32 0
-}
diff --git a/release_23/test/CodeGen/X86/coalescer-commute4.ll b/release_23/test/CodeGen/X86/coalescer-commute4.ll
deleted file mode 100644
index 7299aca3e0b3..000000000000
--- a/release_23/test/CodeGen/X86/coalescer-commute4.ll
+++ /dev/null
@@ -1,30 +0,0 @@
-; RUN: llvm-as < %s | llc -mtriple=i686-apple-darwin -mattr=+sse2 | not grep movaps
-; PR1501
-
-define float @foo(i32* %x, float* %y, i32 %c) nounwind {
-entry:
- %tmp2132 = icmp eq i32 %c, 0 ; <i1> [#uses=2]
- br i1 %tmp2132, label %bb23, label %bb.preheader
-
-bb.preheader: ; preds = %entry
- %umax = select i1 %tmp2132, i32 1, i32 %c ; <i32> [#uses=1]
- br label %bb
-
-bb: ; preds = %bb, %bb.preheader
- %i.0.reg2mem.0 = phi i32 [ 0, %bb.preheader ], [ %indvar.next, %bb ] ; <i32> [#uses=3]
- %res.0.reg2mem.0 = phi float [ 0.000000e+00, %bb.preheader ], [ %tmp14, %bb ] ; <float> [#uses=1]
- %tmp3 = getelementptr i32* %x, i32 %i.0.reg2mem.0 ; <i32*> [#uses=1]
- %tmp4 = load i32* %tmp3, align 4 ; <i32> [#uses=1]
- %tmp45 = sitofp i32 %tmp4 to float ; <float> [#uses=1]
- %tmp8 = getelementptr float* %y, i32 %i.0.reg2mem.0 ; <float*> [#uses=1]
- %tmp9 = load float* %tmp8, align 4 ; <float> [#uses=1]
- %tmp11 = mul float %tmp9, %tmp45 ; <float> [#uses=1]
- %tmp14 = add float %tmp11, %res.0.reg2mem.0 ; <float> [#uses=2]
- %indvar.next = add i32 %i.0.reg2mem.0, 1 ; <i32> [#uses=2]
- %exitcond = icmp eq i32 %indvar.next, %umax ; <i1> [#uses=1]
- br i1 %exitcond, label %bb23, label %bb
-
-bb23: ; preds = %bb, %entry
- %res.0.reg2mem.1 = phi float [ 0.000000e+00, %entry ], [ %tmp14, %bb ] ; <float> [#uses=1]
- ret float %res.0.reg2mem.1
-}
diff --git a/release_23/test/CodeGen/X86/coalescer-commute5.ll b/release_23/test/CodeGen/X86/coalescer-commute5.ll
deleted file mode 100644
index c730ea76e983..000000000000
--- a/release_23/test/CodeGen/X86/coalescer-commute5.ll
+++ /dev/null
@@ -1,21 +0,0 @@
-; RUN: llvm-as < %s | llc -mtriple=i686-apple-darwin -mattr=+sse2 | not grep movaps
-
-define i32 @t() {
-entry:
- br i1 true, label %bb1664, label %bb1656
-bb1656: ; preds = %entry
- ret i32 0
-bb1664: ; preds = %entry
- %tmp4297 = bitcast <16 x i8> zeroinitializer to <2 x i64> ; <<2 x i64>> [#uses=2]
- %tmp4351 = call <16 x i8> @llvm.x86.sse2.pcmpeq.b( <16 x i8> zeroinitializer, <16 x i8> zeroinitializer ) nounwind readnone ; <<16 x i8>> [#uses=0]
- br i1 false, label %bb5310, label %bb4743
-bb4743: ; preds = %bb1664
- %tmp4360.not28 = or <2 x i64> zeroinitializer, %tmp4297 ; <<2 x i64>> [#uses=1]
- br label %bb5310
-bb5310: ; preds = %bb4743, %bb1664
- %tmp4360.not28.pn = phi <2 x i64> [ %tmp4360.not28, %bb4743 ], [ %tmp4297, %bb1664 ] ; <<2 x i64>> [#uses=1]
- %tmp4415.not.pn = or <2 x i64> zeroinitializer, %tmp4360.not28.pn ; <<2 x i64>> [#uses=0]
- ret i32 0
-}
-
-declare <16 x i8> @llvm.x86.sse2.pcmpeq.b(<16 x i8>, <16 x i8>) nounwind readnone
diff --git a/release_23/test/CodeGen/X86/commute-two-addr.ll b/release_23/test/CodeGen/X86/commute-two-addr.ll
deleted file mode 100644
index 224f5d5e5c54..000000000000
--- a/release_23/test/CodeGen/X86/commute-two-addr.ll
+++ /dev/null
@@ -1,25 +0,0 @@
-; The register allocator can commute two-address instructions to avoid
-; insertion of register-register copies.
-
-; Make sure there are only 3 mov's for each testcase
-; RUN: llvm-as < %s | llc -march=x86 -x86-asm-syntax=intel | \
-; RUN: grep {\\\<mov\\\>} | count 6
-
-
-target triple = "i686-pc-linux-gnu"
-@G = external global i32 ; <i32*> [#uses=2]
-
-declare void @ext(i32)
-
-define i32 @add_test(i32 %X, i32 %Y) {
- %Z = add i32 %X, %Y ; <i32> [#uses=1]
- store i32 %Z, i32* @G
- ret i32 %X
-}
-
-define i32 @xor_test(i32 %X, i32 %Y) {
- %Z = xor i32 %X, %Y ; <i32> [#uses=1]
- store i32 %Z, i32* @G
- ret i32 %X
-}
-
diff --git a/release_23/test/CodeGen/X86/compare-add.ll b/release_23/test/CodeGen/X86/compare-add.ll
deleted file mode 100644
index aa69a31a48fc..000000000000
--- a/release_23/test/CodeGen/X86/compare-add.ll
+++ /dev/null
@@ -1,8 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 | not grep add
-
-define i1 @X(i32 %X) {
- %Y = add i32 %X, 14 ; <i32> [#uses=1]
- %Z = icmp ne i32 %Y, 12345 ; <i1> [#uses=1]
- ret i1 %Z
-}
-
diff --git a/release_23/test/CodeGen/X86/compare_folding.ll b/release_23/test/CodeGen/X86/compare_folding.ll
deleted file mode 100644
index c6cda4a5b979..000000000000
--- a/release_23/test/CodeGen/X86/compare_folding.ll
+++ /dev/null
@@ -1,11 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -mcpu=yonah | \
-; RUN: grep movsd | count 1
-; RUN: llvm-as < %s | llc -march=x86 -mcpu=yonah | \
-; RUN: grep ucomisd
-declare i1 @llvm.isunordered.f64(double, double)
-
-define i1 @test1(double %X, double %Y) {
- %COM = fcmp uno double %X, %Y ; <i1> [#uses=1]
- ret i1 %COM
-}
-
diff --git a/release_23/test/CodeGen/X86/constant-pool-remat-0.ll b/release_23/test/CodeGen/X86/constant-pool-remat-0.ll
deleted file mode 100644
index 144d442d50d3..000000000000
--- a/release_23/test/CodeGen/X86/constant-pool-remat-0.ll
+++ /dev/null
@@ -1,13 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86-64 | grep LCPI | count 3
-; RUN: llvm-as < %s | llc -march=x86-64 -stats -info-output-file - | grep asm-printer | grep 6
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep LCPI | count 3
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 -stats -info-output-file - | grep asm-printer | grep 8
-
-declare fastcc float @qux(float %y)
-
-define fastcc float @array(float %a) nounwind {
- %n = mul float %a, 9.0
- %m = call fastcc float @qux(float %n)
- %o = mul float %m, 9.0
- ret float %o
-}
diff --git a/release_23/test/CodeGen/X86/copysign-zero.ll b/release_23/test/CodeGen/X86/copysign-zero.ll
deleted file mode 100644
index a08fa6519d71..000000000000
--- a/release_23/test/CodeGen/X86/copysign-zero.ll
+++ /dev/null
@@ -1,14 +0,0 @@
-; RUN: llvm-as < %s | llc | not grep orpd
-; RUN: llvm-as < %s | llc | grep andpd | count 1
-
-target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128"
-target triple = "x86_64-apple-darwin8"
-
-define double @test(double %X) nounwind {
-entry:
- %tmp2 = tail call double @copysign( double 0.000000e+00, double %X ) nounwind readnone ; <double> [#uses=1]
- ret double %tmp2
-}
-
-declare double @copysign(double, double) nounwind readnone
-
diff --git a/release_23/test/CodeGen/X86/dagcombine-cse.ll b/release_23/test/CodeGen/X86/dagcombine-cse.ll
deleted file mode 100644
index a673ebf47de5..000000000000
--- a/release_23/test/CodeGen/X86/dagcombine-cse.ll
+++ /dev/null
@@ -1,27 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 -mtriple=i386-apple-darwin -stats |& grep asm-printer | grep 14
-
-define i32 @t(i8* %ref_frame_ptr, i32 %ref_frame_stride, i32 %idxX, i32 %idxY) nounwind {
-entry:
- %tmp7 = mul i32 %idxY, %ref_frame_stride ; <i32> [#uses=2]
- %tmp9 = add i32 %tmp7, %idxX ; <i32> [#uses=1]
- %tmp11 = getelementptr i8* %ref_frame_ptr, i32 %tmp9 ; <i8*> [#uses=1]
- %tmp1112 = bitcast i8* %tmp11 to i32* ; <i32*> [#uses=1]
- %tmp13 = load i32* %tmp1112, align 4 ; <i32> [#uses=1]
- %tmp18 = add i32 %idxX, 4 ; <i32> [#uses=1]
- %tmp20.sum = add i32 %tmp18, %tmp7 ; <i32> [#uses=1]
- %tmp21 = getelementptr i8* %ref_frame_ptr, i32 %tmp20.sum ; <i8*> [#uses=1]
- %tmp2122 = bitcast i8* %tmp21 to i16* ; <i16*> [#uses=1]
- %tmp23 = load i16* %tmp2122, align 2 ; <i16> [#uses=1]
- %tmp2425 = zext i16 %tmp23 to i64 ; <i64> [#uses=1]
- %tmp26 = shl i64 %tmp2425, 32 ; <i64> [#uses=1]
- %tmp2728 = zext i32 %tmp13 to i64 ; <i64> [#uses=1]
- %tmp29 = or i64 %tmp26, %tmp2728 ; <i64> [#uses=1]
- %tmp3454 = bitcast i64 %tmp29 to double ; <double> [#uses=1]
- %tmp35 = insertelement <2 x double> undef, double %tmp3454, i32 0 ; <<2 x double>> [#uses=1]
- %tmp36 = insertelement <2 x double> %tmp35, double 0.000000e+00, i32 1 ; <<2 x double>> [#uses=1]
- %tmp42 = bitcast <2 x double> %tmp36 to <8 x i16> ; <<8 x i16>> [#uses=1]
- %tmp43 = shufflevector <8 x i16> %tmp42, <8 x i16> undef, <8 x i32> < i32 0, i32 1, i32 1, i32 2, i32 4, i32 5, i32 6, i32 7 > ; <<8 x i16>> [#uses=1]
- %tmp47 = bitcast <8 x i16> %tmp43 to <4 x i32> ; <<4 x i32>> [#uses=1]
- %tmp48 = extractelement <4 x i32> %tmp47, i32 0 ; <i32> [#uses=1]
- ret i32 %tmp48
-}
diff --git a/release_23/test/CodeGen/X86/darwin-bzero.ll b/release_23/test/CodeGen/X86/darwin-bzero.ll
deleted file mode 100644
index c292140e108d..000000000000
--- a/release_23/test/CodeGen/X86/darwin-bzero.ll
+++ /dev/null
@@ -1,8 +0,0 @@
-; RUN: llvm-as < %s | llc -mtriple=i386-apple-darwin10 | grep __bzero
-
-declare void @llvm.memset.i32(i8*, i8, i32, i32)
-
-define void @foo(i8* %p, i32 %len) {
- call void @llvm.memset.i32(i8* %p, i8 0, i32 %len, i32 1);
- ret void
-}
diff --git a/release_23/test/CodeGen/X86/darwin-no-dead-strip.ll b/release_23/test/CodeGen/X86/darwin-no-dead-strip.ll
deleted file mode 100644
index 63325b7a6ae0..000000000000
--- a/release_23/test/CodeGen/X86/darwin-no-dead-strip.ll
+++ /dev/null
@@ -1,7 +0,0 @@
-; RUN: llvm-as < %s | llc | grep no_dead_strip
-
-target datalayout = "e-p:32:32"
-target triple = "i686-apple-darwin8.7.2"
-@x = weak global i32 0 ; <i32*> [#uses=1]
-@llvm.used = appending global [1 x i8*] [ i8* bitcast (i32* @x to i8*) ] ; <[1 x i8*]*> [#uses=0]
-
diff --git a/release_23/test/CodeGen/X86/dg.exp b/release_23/test/CodeGen/X86/dg.exp
deleted file mode 100644
index 161fccceb090..000000000000
--- a/release_23/test/CodeGen/X86/dg.exp
+++ /dev/null
@@ -1,5 +0,0 @@
-load_lib llvm.exp
-
-if { [llvm_supports_target X86] } {
- RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
-}
diff --git a/release_23/test/CodeGen/X86/div_const.ll b/release_23/test/CodeGen/X86/div_const.ll
deleted file mode 100644
index aa690f7f4857..000000000000
--- a/release_23/test/CodeGen/X86/div_const.ll
+++ /dev/null
@@ -1,7 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 | grep 365384439
-
-define i32 @f9188_mul365384439_shift27(i32 %A) {
- %tmp1 = udiv i32 %A, 1577682821 ; <i32> [#uses=1]
- ret i32 %tmp1
-}
-
diff --git a/release_23/test/CodeGen/X86/divrem.ll b/release_23/test/CodeGen/X86/divrem.ll
deleted file mode 100644
index a611eddc7682..000000000000
--- a/release_23/test/CodeGen/X86/divrem.ll
+++ /dev/null
@@ -1,58 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86-64 | grep div | count 8
-
-define void @si64(i64 %x, i64 %y, i64* %p, i64* %q) {
- %r = sdiv i64 %x, %y
- %t = srem i64 %x, %y
- store i64 %r, i64* %p
- store i64 %t, i64* %q
- ret void
-}
-define void @si32(i32 %x, i32 %y, i32* %p, i32* %q) {
- %r = sdiv i32 %x, %y
- %t = srem i32 %x, %y
- store i32 %r, i32* %p
- store i32 %t, i32* %q
- ret void
-}
-define void @si16(i16 %x, i16 %y, i16* %p, i16* %q) {
- %r = sdiv i16 %x, %y
- %t = srem i16 %x, %y
- store i16 %r, i16* %p
- store i16 %t, i16* %q
- ret void
-}
-define void @si8(i8 %x, i8 %y, i8* %p, i8* %q) {
- %r = sdiv i8 %x, %y
- %t = srem i8 %x, %y
- store i8 %r, i8* %p
- store i8 %t, i8* %q
- ret void
-}
-define void @ui64(i64 %x, i64 %y, i64* %p, i64* %q) {
- %r = udiv i64 %x, %y
- %t = urem i64 %x, %y
- store i64 %r, i64* %p
- store i64 %t, i64* %q
- ret void
-}
-define void @ui32(i32 %x, i32 %y, i32* %p, i32* %q) {
- %r = udiv i32 %x, %y
- %t = urem i32 %x, %y
- store i32 %r, i32* %p
- store i32 %t, i32* %q
- ret void
-}
-define void @ui16(i16 %x, i16 %y, i16* %p, i16* %q) {
- %r = udiv i16 %x, %y
- %t = urem i16 %x, %y
- store i16 %r, i16* %p
- store i16 %t, i16* %q
- ret void
-}
-define void @ui8(i8 %x, i8 %y, i8* %p, i8* %q) {
- %r = udiv i8 %x, %y
- %t = urem i8 %x, %y
- store i8 %r, i8* %p
- store i8 %t, i8* %q
- ret void
-}
diff --git a/release_23/test/CodeGen/X86/dollar-name.ll b/release_23/test/CodeGen/X86/dollar-name.ll
deleted file mode 100644
index 0573056f5ef9..000000000000
--- a/release_23/test/CodeGen/X86/dollar-name.ll
+++ /dev/null
@@ -1,17 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -x86-asm-syntax=att | grep (\$bar) | count 1
-; RUN: llvm-as < %s | llc -march=x86 -x86-asm-syntax=att | grep (\$qux) | count 1
-; RUN: llvm-as < %s | llc -march=x86 -x86-asm-syntax=att | grep (\$hen) | count 1
-; PR1339
-
-@"$bar" = global i32 zeroinitializer
-@"$qux" = external global i32
-
-define i32 @"$foo"() {
- %m = load i32* @"$bar"
- %n = load i32* @"$qux"
- %t = add i32 %m, %n
- %u = call i32 @"$hen"(i32 %t)
- ret i32 %u
-}
-
-declare i32 @"$hen"(i32 %a)
diff --git a/release_23/test/CodeGen/X86/dyn-stackalloc.ll b/release_23/test/CodeGen/X86/dyn-stackalloc.ll
deleted file mode 100644
index 12cd754a6626..000000000000
--- a/release_23/test/CodeGen/X86/dyn-stackalloc.ll
+++ /dev/null
@@ -1,16 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 | not grep 4294967289
-; RUN: llvm-as < %s | llc -march=x86 | grep 4294967280
-; RUN: llvm-as < %s | llc -march=x86-64 | grep {\\-16}
-
-define void @t() {
-A:
- br label %entry
-
-entry:
- %m1 = alloca i32, align 4
- %m2 = alloca [7 x i8], align 16
- call void @s( i32* %m1, [7 x i8]* %m2 )
- ret void
-}
-
-declare void @s(i32*, [7 x i8]*)
diff --git a/release_23/test/CodeGen/X86/epilogue.ll b/release_23/test/CodeGen/X86/epilogue.ll
deleted file mode 100644
index 5a378e19c49a..000000000000
--- a/release_23/test/CodeGen/X86/epilogue.ll
+++ /dev/null
@@ -1,11 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 | not grep lea
-; RUN: llvm-as < %s | llc -march=x86 | grep {movl %ebp}
-
-declare void @bar(<2 x i64>* %n)
-
-define void @foo(i64 %h) {
- %k = trunc i64 %h to i32
- %p = alloca <2 x i64>, i32 %k
- call void @bar(<2 x i64>* %p)
- ret void
-}
diff --git a/release_23/test/CodeGen/X86/extend.ll b/release_23/test/CodeGen/X86/extend.ll
deleted file mode 100644
index a54b6f112d88..000000000000
--- a/release_23/test/CodeGen/X86/extend.ll
+++ /dev/null
@@ -1,18 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -x86-asm-syntax=intel | grep movzx | count 1
-; RUN: llvm-as < %s | llc -march=x86 -x86-asm-syntax=intel | grep movsx | count 1
-
-@G1 = internal global i8 0 ; <i8*> [#uses=1]
-@G2 = internal global i8 0 ; <i8*> [#uses=1]
-
-define i16 @test1() {
- %tmp.0 = load i8* @G1 ; <i8> [#uses=1]
- %tmp.3 = zext i8 %tmp.0 to i16 ; <i16> [#uses=1]
- ret i16 %tmp.3
-}
-
-define i16 @test2() {
- %tmp.0 = load i8* @G2 ; <i8> [#uses=1]
- %tmp.3 = sext i8 %tmp.0 to i16 ; <i16> [#uses=1]
- ret i16 %tmp.3
-}
-
diff --git a/release_23/test/CodeGen/X86/extern_weak.ll b/release_23/test/CodeGen/X86/extern_weak.ll
deleted file mode 100644
index 0cc56302b70f..000000000000
--- a/release_23/test/CodeGen/X86/extern_weak.ll
+++ /dev/null
@@ -1,13 +0,0 @@
-; RUN: llvm-as < %s | llc -mtriple=i686-apple-darwin | grep weak_reference | count 2
-
-@Y = global i32 (i8*)* @X ; <i32 (i8*)**> [#uses=0]
-
-declare extern_weak i32 @X(i8*)
-
-define void @bar() {
- tail call void (...)* @foo( )
- ret void
-}
-
-declare extern_weak void @foo(...)
-
diff --git a/release_23/test/CodeGen/X86/extmul128.ll b/release_23/test/CodeGen/X86/extmul128.ll
deleted file mode 100644
index df487659edb5..000000000000
--- a/release_23/test/CodeGen/X86/extmul128.ll
+++ /dev/null
@@ -1,14 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86-64 | grep mul | count 2
-
-define i128 @i64_sext_i128(i64 %a, i64 %b) {
- %aa = sext i64 %a to i128
- %bb = sext i64 %b to i128
- %cc = mul i128 %aa, %bb
- ret i128 %cc
-}
-define i128 @i64_zext_i128(i64 %a, i64 %b) {
- %aa = zext i64 %a to i128
- %bb = zext i64 %b to i128
- %cc = mul i128 %aa, %bb
- ret i128 %cc
-}
diff --git a/release_23/test/CodeGen/X86/extmul64.ll b/release_23/test/CodeGen/X86/extmul64.ll
deleted file mode 100644
index 635da48133b6..000000000000
--- a/release_23/test/CodeGen/X86/extmul64.ll
+++ /dev/null
@@ -1,14 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 | grep mul | count 2
-
-define i64 @i32_sext_i64(i32 %a, i32 %b) {
- %aa = sext i32 %a to i64
- %bb = sext i32 %b to i64
- %cc = mul i64 %aa, %bb
- ret i64 %cc
-}
-define i64 @i32_zext_i64(i32 %a, i32 %b) {
- %aa = zext i32 %a to i64
- %bb = zext i32 %b to i64
- %cc = mul i64 %aa, %bb
- ret i64 %cc
-}
diff --git a/release_23/test/CodeGen/X86/extractelement-from-arg.ll b/release_23/test/CodeGen/X86/extractelement-from-arg.ll
deleted file mode 100644
index d28f016dbae4..000000000000
--- a/release_23/test/CodeGen/X86/extractelement-from-arg.ll
+++ /dev/null
@@ -1,7 +0,0 @@
-; RUN: llvm-as %s -o - | llc -march=x86-64
-
-define void @test(float* %R, <4 x float> %X) {
- %tmp = extractelement <4 x float> %X, i32 3
- store float %tmp, float* %R
- ret void
-}
diff --git a/release_23/test/CodeGen/X86/fabs.ll b/release_23/test/CodeGen/X86/fabs.ll
deleted file mode 100644
index 0646a7963ad3..000000000000
--- a/release_23/test/CodeGen/X86/fabs.ll
+++ /dev/null
@@ -1,29 +0,0 @@
-; Make sure this testcase codegens to the fabs instruction, not a call to fabsf
-; RUN: llvm-as < %s | llc -march=x86 -mattr=-sse2,-sse3,-sse | grep fabs\$ | \
-; RUN: count 2
-; RUN: llvm-as < %s | \
-; RUN: llc -march=x86 -mattr=-sse,-sse2,-sse3 -enable-unsafe-fp-math | \
-; RUN: grep fabs\$ | count 3
-
-declare float @fabsf(float)
-
-declare x86_fp80 @fabsl(x86_fp80)
-
-define float @test1(float %X) {
- %Y = call float @fabsf(float %X)
- ret float %Y
-}
-
-define double @test2(double %X) {
- %Y = fcmp oge double %X, -0.0
- %Z = sub double -0.0, %X
- %Q = select i1 %Y, double %X, double %Z
- ret double %Q
-}
-
-define x86_fp80 @test3(x86_fp80 %X) {
- %Y = call x86_fp80 @fabsl(x86_fp80 %X)
- ret x86_fp80 %Y
-}
-
-
diff --git a/release_23/test/CodeGen/X86/fast-cc-callee-pops.ll b/release_23/test/CodeGen/X86/fast-cc-callee-pops.ll
deleted file mode 100644
index 9b03634b853b..000000000000
--- a/release_23/test/CodeGen/X86/fast-cc-callee-pops.ll
+++ /dev/null
@@ -1,8 +0,0 @@
-; RUN: llvm-as < %s | \
-; RUN: llc -march=x86 -x86-asm-syntax=intel -mcpu=yonah | grep {ret 20}
-
-; Check that a fastcc function pops its stack variables before returning.
-
-define x86_fastcallcc void @func(i64 %X, i64 %Y, float %G, double %Z) {
- ret void
-}
diff --git a/release_23/test/CodeGen/X86/fast-cc-merge-stack-adj.ll b/release_23/test/CodeGen/X86/fast-cc-merge-stack-adj.ll
deleted file mode 100644
index 3f3aa468675b..000000000000
--- a/release_23/test/CodeGen/X86/fast-cc-merge-stack-adj.ll
+++ /dev/null
@@ -1,13 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -x86-asm-syntax=intel | \
-; RUN: grep {add ESP, 8}
-
-target triple = "i686-pc-linux-gnu"
-
-declare x86_fastcallcc void @func(i32*, i64)
-
-define x86_fastcallcc void @caller(i32, i64) {
- %X = alloca i32 ; <i32*> [#uses=1]
- call x86_fastcallcc void @func( i32* %X, i64 0 )
- ret void
-}
-
diff --git a/release_23/test/CodeGen/X86/fast-cc-pass-in-regs.ll b/release_23/test/CodeGen/X86/fast-cc-pass-in-regs.ll
deleted file mode 100644
index c8621a7780bd..000000000000
--- a/release_23/test/CodeGen/X86/fast-cc-pass-in-regs.ll
+++ /dev/null
@@ -1,15 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -x86-asm-syntax=intel | \
-; RUN: grep {mov EDX, 1}
-; check that fastcc is passing stuff in regs.
-
-declare x86_fastcallcc i64 @callee(i64)
-
-define i64 @caller() {
- %X = call x86_fastcallcc i64 @callee( i64 4294967299 ) ; <i64> [#uses=1]
- ret i64 %X
-}
-
-define x86_fastcallcc i64 @caller2(i64 %X) {
- ret i64 %X
-}
-
diff --git a/release_23/test/CodeGen/X86/fastcall-correct-mangling.ll b/release_23/test/CodeGen/X86/fastcall-correct-mangling.ll
deleted file mode 100644
index d2db2795512d..000000000000
--- a/release_23/test/CodeGen/X86/fastcall-correct-mangling.ll
+++ /dev/null
@@ -1,9 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -mtriple=mingw32 | \
-; RUN: grep {@12}
-
-; Check that a fastcall function gets correct mangling
-
-define x86_fastcallcc void @func(i64 %X, i8 %Y, i8 %G, i16 %Z) {
- ret void
-}
-
diff --git a/release_23/test/CodeGen/X86/field-extract-use-trunc.ll b/release_23/test/CodeGen/X86/field-extract-use-trunc.ll
deleted file mode 100644
index c4f9587335e7..000000000000
--- a/release_23/test/CodeGen/X86/field-extract-use-trunc.ll
+++ /dev/null
@@ -1,39 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 | grep sar | count 1
-; RUN: llvm-as < %s | llc -march=x86-64 | not grep sar
-
-define i32 @test(i32 %f12) {
- %tmp7.25 = lshr i32 %f12, 16
- %tmp7.26 = trunc i32 %tmp7.25 to i8
- %tmp78.2 = sext i8 %tmp7.26 to i32
- ret i32 %tmp78.2
-}
-
-define i32 @test2(i32 %f12) {
- %f11 = shl i32 %f12, 8
- %tmp7.25 = ashr i32 %f11, 24
- ret i32 %tmp7.25
-}
-
-define i32 @test3(i32 %f12) {
- %f11 = shl i32 %f12, 13
- %tmp7.25 = ashr i32 %f11, 24
- ret i32 %tmp7.25
-}
-
-define i64 @test4(i64 %f12) {
- %f11 = shl i64 %f12, 32
- %tmp7.25 = ashr i64 %f11, 32
- ret i64 %tmp7.25
-}
-
-define i16 @test5(i16 %f12) {
- %f11 = shl i16 %f12, 2
- %tmp7.25 = ashr i16 %f11, 8
- ret i16 %tmp7.25
-}
-
-define i16 @test6(i16 %f12) {
- %f11 = shl i16 %f12, 8
- %tmp7.25 = ashr i16 %f11, 8
- ret i16 %tmp7.25
-}
diff --git a/release_23/test/CodeGen/X86/fildll.ll b/release_23/test/CodeGen/X86/fildll.ll
deleted file mode 100644
index 65944fdaee4c..000000000000
--- a/release_23/test/CodeGen/X86/fildll.ll
+++ /dev/null
@@ -1,12 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -x86-asm-syntax=att -mattr=-sse2 | grep fildll | count 2
-
-define fastcc double @sint64_to_fp(i64 %X) {
- %R = sitofp i64 %X to double ; <double> [#uses=1]
- ret double %R
-}
-
-define fastcc double @uint64_to_fp(i64 %X) {
- %R = uitofp i64 %X to double ; <double> [#uses=1]
- ret double %R
-}
-
diff --git a/release_23/test/CodeGen/X86/fold-and-shift.ll b/release_23/test/CodeGen/X86/fold-and-shift.ll
deleted file mode 100644
index 705b79549644..000000000000
--- a/release_23/test/CodeGen/X86/fold-and-shift.ll
+++ /dev/null
@@ -1,21 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 | not grep and
-
-define i32 @t1(i8* %X, i32 %i) {
-entry:
- %tmp2 = shl i32 %i, 2 ; <i32> [#uses=1]
- %tmp4 = and i32 %tmp2, 1020 ; <i32> [#uses=1]
- %tmp7 = getelementptr i8* %X, i32 %tmp4 ; <i8*> [#uses=1]
- %tmp78 = bitcast i8* %tmp7 to i32* ; <i32*> [#uses=1]
- %tmp9 = load i32* %tmp78, align 4 ; <i32> [#uses=1]
- ret i32 %tmp9
-}
-
-define i32 @t2(i16* %X, i32 %i) {
-entry:
- %tmp2 = shl i32 %i, 1 ; <i32> [#uses=1]
- %tmp4 = and i32 %tmp2, 131070 ; <i32> [#uses=1]
- %tmp7 = getelementptr i16* %X, i32 %tmp4 ; <i16*> [#uses=1]
- %tmp78 = bitcast i16* %tmp7 to i32* ; <i32*> [#uses=1]
- %tmp9 = load i32* %tmp78, align 4 ; <i32> [#uses=1]
- ret i32 %tmp9
-}
diff --git a/release_23/test/CodeGen/X86/fold-load.ll b/release_23/test/CodeGen/X86/fold-load.ll
deleted file mode 100644
index 6d24113c9bb7..000000000000
--- a/release_23/test/CodeGen/X86/fold-load.ll
+++ /dev/null
@@ -1,27 +0,0 @@
-; RUN: llvm-as < %s | llc
- %struct._obstack_chunk = type { i8*, %struct._obstack_chunk*, [4 x i8] }
- %struct.obstack = type { i32, %struct._obstack_chunk*, i8*, i8*, i8*, i32, i32, %struct._obstack_chunk* (...)*, void (...)*, i8*, i8 }
-@stmt_obstack = external global %struct.obstack ; <%struct.obstack*> [#uses=1]
-
-define void @expand_start_bindings() {
-entry:
- br i1 false, label %cond_true, label %cond_next
-
-cond_true: ; preds = %entry
- %new_size.0.i = select i1 false, i32 0, i32 0 ; <i32> [#uses=1]
- %tmp.i = load i32* bitcast (i8* getelementptr (%struct.obstack* @stmt_obstack, i32 0, i32 10) to i32*) ; <i32> [#uses=1]
- %tmp.i.upgrd.1 = trunc i32 %tmp.i to i8 ; <i8> [#uses=1]
- %tmp21.i = and i8 %tmp.i.upgrd.1, 1 ; <i8> [#uses=1]
- %tmp22.i = icmp eq i8 %tmp21.i, 0 ; <i1> [#uses=1]
- br i1 %tmp22.i, label %cond_false30.i, label %cond_true23.i
-
-cond_true23.i: ; preds = %cond_true
- ret void
-
-cond_false30.i: ; preds = %cond_true
- %tmp35.i = tail call %struct._obstack_chunk* null( i32 %new_size.0.i ) ; <%struct._obstack_chunk*> [#uses=0]
- ret void
-
-cond_next: ; preds = %entry
- ret void
-}
diff --git a/release_23/test/CodeGen/X86/fold-mul-lohi.ll b/release_23/test/CodeGen/X86/fold-mul-lohi.ll
deleted file mode 100644
index abd8ddd92c11..000000000000
--- a/release_23/test/CodeGen/X86/fold-mul-lohi.ll
+++ /dev/null
@@ -1,30 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 | not grep lea
-; RUN: llvm-as < %s | llc -march=x86-64 | not grep lea
-
-@B = external global [1000 x i8], align 32
-@A = external global [1000 x i8], align 32
-@P = external global [1000 x i8], align 32
-
-define void @foo(i32 %m) {
-entry:
- %tmp1 = icmp sgt i32 %m, 0
- br i1 %tmp1, label %bb, label %return
-
-bb:
- %i.019.0 = phi i32 [ %indvar.next, %bb ], [ 0, %entry ]
- %tmp2 = getelementptr [1000 x i8]* @B, i32 0, i32 %i.019.0
- %tmp3 = load i8* %tmp2, align 4
- %tmp4 = mul i8 %tmp3, 2
- %tmp5 = getelementptr [1000 x i8]* @A, i32 0, i32 %i.019.0
- store i8 %tmp4, i8* %tmp5, align 4
- %tmp8 = mul i32 %i.019.0, 9
- %tmp10 = getelementptr [1000 x i8]* @P, i32 0, i32 %tmp8
- store i8 17, i8* %tmp10, align 4
- %indvar.next = add i32 %i.019.0, 1
- %exitcond = icmp eq i32 %indvar.next, %m
- br i1 %exitcond, label %return, label %bb
-
-return:
- ret void
-}
-
diff --git a/release_23/test/CodeGen/X86/fp-immediate-shorten.ll b/release_23/test/CodeGen/X86/fp-immediate-shorten.ll
deleted file mode 100644
index 32ba2171450b..000000000000
--- a/release_23/test/CodeGen/X86/fp-immediate-shorten.ll
+++ /dev/null
@@ -1,9 +0,0 @@
-;; Test that this FP immediate is stored in the constant pool as a float.
-
-; RUN: llvm-as < %s | llc -march=x86 -mattr=-sse2,-sse3 | \
-; RUN: grep {.long.1123418112}
-
-define double @D() {
- ret double 1.230000e+02
-}
-
diff --git a/release_23/test/CodeGen/X86/fp-in-intregs.ll b/release_23/test/CodeGen/X86/fp-in-intregs.ll
deleted file mode 100644
index 1e3ea8918dc4..000000000000
--- a/release_23/test/CodeGen/X86/fp-in-intregs.ll
+++ /dev/null
@@ -1,21 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -mcpu=yonah | not egrep {\(\(xor\|and\)ps\|movd\)}
-
-; These operations should be done in integer registers, eliminating constant
-; pool loads, movd's etc.
-
-define i32 @test1(float %x) nounwind {
-entry:
- %tmp2 = sub float -0.000000e+00, %x ; <float> [#uses=1]
- %tmp210 = bitcast float %tmp2 to i32 ; <i32> [#uses=1]
- ret i32 %tmp210
-}
-
-define i32 @test2(float %x) nounwind {
-entry:
- %tmp2 = tail call float @copysignf( float 1.000000e+00, float %x ) nounwind readnone ; <float> [#uses=1]
- %tmp210 = bitcast float %tmp2 to i32 ; <i32> [#uses=1]
- ret i32 %tmp210
-}
-
-declare float @copysignf(float, float) nounwind readnone
-
diff --git a/release_23/test/CodeGen/X86/fp-stack-2results.ll b/release_23/test/CodeGen/X86/fp-stack-2results.ll
deleted file mode 100644
index f47fd7472ecb..000000000000
--- a/release_23/test/CodeGen/X86/fp-stack-2results.ll
+++ /dev/null
@@ -1,60 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 | grep fldz
-; RUN: llvm-as < %s | llc -march=x86-64 | grep fld1
-
-; This is basically this code on x86-64:
-; _Complex long double test() { return 1.0; }
-define {x86_fp80, x86_fp80} @test() {
- %A = fpext double 1.0 to x86_fp80
- %B = fpext double 0.0 to x86_fp80
- ret x86_fp80 %A, x86_fp80 %B
-}
-
-
-;_test2:
-; fld1
-; fld %st(0)
-; ret
-define {x86_fp80, x86_fp80} @test2() {
- %A = fpext double 1.0 to x86_fp80
- ret x86_fp80 %A, x86_fp80 %A
-}
-
-; Uses both values.
-define void @call1(x86_fp80 *%P1, x86_fp80 *%P2) {
- %a = call {x86_fp80,x86_fp80} @test()
- %b = getresult {x86_fp80,x86_fp80} %a, 0
- store x86_fp80 %b, x86_fp80* %P1
-
- %c = getresult {x86_fp80,x86_fp80} %a, 1
- store x86_fp80 %c, x86_fp80* %P2
- ret void
-}
-
-; Uses both values, requires fxch
-define void @call2(x86_fp80 *%P1, x86_fp80 *%P2) {
- %a = call {x86_fp80,x86_fp80} @test()
- %b = getresult {x86_fp80,x86_fp80} %a, 1
- store x86_fp80 %b, x86_fp80* %P1
-
- %c = getresult {x86_fp80,x86_fp80} %a, 0
- store x86_fp80 %c, x86_fp80* %P2
- ret void
-}
-
-; Uses ST(0), ST(1) is dead but must be popped.
-define void @call3(x86_fp80 *%P1, x86_fp80 *%P2) {
- %a = call {x86_fp80,x86_fp80} @test()
- %b = getresult {x86_fp80,x86_fp80} %a, 0
- store x86_fp80 %b, x86_fp80* %P1
- ret void
-}
-
-; Uses ST(1), ST(0) is dead and must be popped.
-define void @call4(x86_fp80 *%P1, x86_fp80 *%P2) {
- %a = call {x86_fp80,x86_fp80} @test()
-
- %c = getresult {x86_fp80,x86_fp80} %a, 1
- store x86_fp80 %c, x86_fp80* %P2
- ret void
-}
-
diff --git a/release_23/test/CodeGen/X86/fp-stack-compare.ll b/release_23/test/CodeGen/X86/fp-stack-compare.ll
deleted file mode 100644
index 383549ac43d0..000000000000
--- a/release_23/test/CodeGen/X86/fp-stack-compare.ll
+++ /dev/null
@@ -1,12 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -mcpu=i386 | \
-; RUN: grep {fucomi.*st.\[12\]}
-; PR1012
-
-define float @foo(float* %col.2.0) {
- %tmp = load float* %col.2.0 ; <float> [#uses=3]
- %tmp16 = fcmp olt float %tmp, 0.000000e+00 ; <i1> [#uses=1]
- %tmp20 = sub float -0.000000e+00, %tmp ; <float> [#uses=1]
- %iftmp.2.0 = select i1 %tmp16, float %tmp20, float %tmp ; <float> [#uses=1]
- ret float %iftmp.2.0
-}
-
diff --git a/release_23/test/CodeGen/X86/fp-stack-direct-ret.ll b/release_23/test/CodeGen/X86/fp-stack-direct-ret.ll
deleted file mode 100644
index 78be2a39defb..000000000000
--- a/release_23/test/CodeGen/X86/fp-stack-direct-ret.ll
+++ /dev/null
@@ -1,11 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 | not grep fstp
-; RUN: llvm-as < %s | llc -march=x86 -mcpu=yonah | not grep movsd
-
-declare double @foo()
-
-define double @bar() {
-entry:
- %tmp5 = tail call double @foo()
- ret double %tmp5
-}
-
diff --git a/release_23/test/CodeGen/X86/fp-stack-ret-conv.ll b/release_23/test/CodeGen/X86/fp-stack-ret-conv.ll
deleted file mode 100644
index 5254e1c89f61..000000000000
--- a/release_23/test/CodeGen/X86/fp-stack-ret-conv.ll
+++ /dev/null
@@ -1,17 +0,0 @@
-; RUN: llvm-as < %s | llc -mcpu=yonah | grep cvtss2sd
-; RUN: llvm-as < %s | llc -mcpu=yonah | grep fstps
-; RUN: llvm-as < %s | llc -mcpu=yonah | not grep cvtsd2ss
-
-target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64"
-target triple = "i686-apple-darwin8"
-
-define void @test(double *%b) {
-entry:
- %tmp13 = tail call double @foo()
- %tmp1314 = fptrunc double %tmp13 to float ; <float> [#uses=1]
- %tmp3940 = fpext float %tmp1314 to double ; <double> [#uses=1]
- volatile store double %tmp3940, double* %b
- ret void
-}
-
-declare double @foo()
diff --git a/release_23/test/CodeGen/X86/fp-stack-ret-store.ll b/release_23/test/CodeGen/X86/fp-stack-ret-store.ll
deleted file mode 100644
index 56392deb300d..000000000000
--- a/release_23/test/CodeGen/X86/fp-stack-ret-store.ll
+++ /dev/null
@@ -1,26 +0,0 @@
-; RUN: llvm-as < %s | llc -mcpu=yonah | not grep movss
-target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
-target triple = "i686-apple-darwin8"
-
-; This should store directly into P from the FP stack. It should not
-; go through a stack slot to get there.
-
-define void @bar(double* %P) {
-entry:
- %tmp = tail call double (...)* @foo( ) ; <double> [#uses=1]
- store double %tmp, double* %P, align 8
- ret void
-}
-
-declare double @foo(...)
-
-define void @bar2(float* %P) {
-entry:
- %tmp = tail call double (...)* @foo2( ) ; <double> [#uses=1]
- %tmp1 = fptrunc double %tmp to float ; <float> [#uses=1]
- store float %tmp1, float* %P, align 4
- ret void
-}
-
-declare double @foo2(...)
-
diff --git a/release_23/test/CodeGen/X86/fp-stack-ret.ll b/release_23/test/CodeGen/X86/fp-stack-ret.ll
deleted file mode 100644
index 3e6ad54e73b3..000000000000
--- a/release_23/test/CodeGen/X86/fp-stack-ret.ll
+++ /dev/null
@@ -1,26 +0,0 @@
-; RUN: llvm-as < %s | \
-; RUN: llc -mtriple=i686-apple-darwin8 -mcpu=yonah -march=x86 > %t
-; RUN: grep fldl %t | count 1
-; RUN: not grep xmm %t
-; RUN: grep {sub.*esp} %t | count 1
-
-; These testcases shouldn't require loading into an XMM register then storing
-; to memory, then reloading into an FPStack reg.
-
-define double @test1(double *%P) {
- %A = load double* %P
- ret double %A
-}
-
-; fastcc should return a value
-define fastcc double @test2(<2 x double> %A) {
- %B = extractelement <2 x double> %A, i32 0
- ret double %B
-}
-
-define fastcc double @test3(<4 x float> %A) {
- %B = bitcast <4 x float> %A to <2 x double>
- %C = call fastcc double @test2(<2 x double> %B)
- ret double %C
-}
-
diff --git a/release_23/test/CodeGen/X86/fp-stack-retcopy.ll b/release_23/test/CodeGen/X86/fp-stack-retcopy.ll
deleted file mode 100644
index 997f8df20fea..000000000000
--- a/release_23/test/CodeGen/X86/fp-stack-retcopy.ll
+++ /dev/null
@@ -1,12 +0,0 @@
-; This should not copy the result of foo into an xmm register.
-; RUN: llvm-as < %s | llc -march=x86 -mcpu=yonah -mtriple=i686-apple-darwin9 | not grep xmm
-; rdar://5689903
-
-declare double @foo()
-
-define double @carg({ double, double }* byval %z) nounwind {
-entry:
- %tmp5 = tail call double @foo() nounwind ; <double> [#uses=1]
- ret double %tmp5
-}
-
diff --git a/release_23/test/CodeGen/X86/fp2sint.ll b/release_23/test/CodeGen/X86/fp2sint.ll
deleted file mode 100644
index 80f7efbe4dec..000000000000
--- a/release_23/test/CodeGen/X86/fp2sint.ll
+++ /dev/null
@@ -1,18 +0,0 @@
-;; LowerFP_TO_SINT should not create a stack object if it's not needed.
-
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | not grep add
-
-define i32 @main(i32 %argc, i8** %argv) {
-cond_false.i.i.i: ; preds = %bb.i5
- %tmp35.i = load double* null, align 8 ; <double> [#uses=1]
- %tmp3536.i = fptosi double %tmp35.i to i32 ; <i32> [#uses=1]
- %tmp3536140.i = zext i32 %tmp3536.i to i64 ; <i64> [#uses=1]
- %tmp39.i = load double* null, align 4 ; <double> [#uses=1]
- %tmp3940.i = fptosi double %tmp39.i to i32 ; <i32> [#uses=1]
- %tmp3940137.i = zext i32 %tmp3940.i to i64 ; <i64> [#uses=1]
- %tmp3940137138.i = shl i64 %tmp3940137.i, 32 ; <i64> [#uses=1]
- %tmp3940137138.ins.i = or i64 %tmp3940137138.i, %tmp3536140.i ; <i64> [#uses=1]
- %tmp95.i.i = trunc i64 %tmp3940137138.ins.i to i32 ; <i32> [#uses=1]
- store i32 %tmp95.i.i, i32* null, align 4
- ret i32 0
-}
diff --git a/release_23/test/CodeGen/X86/fp_constant_op.ll b/release_23/test/CodeGen/X86/fp_constant_op.ll
deleted file mode 100644
index ed02c6a8f72a..000000000000
--- a/release_23/test/CodeGen/X86/fp_constant_op.ll
+++ /dev/null
@@ -1,35 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -x86-asm-syntax=intel -mcpu=i486 | \
-; RUN: grep {fadd\\|fsub\\|fdiv\\|fmul} | not grep -i ST
-
-; Test that the load of the constant is folded into the operation.
-
-
-define double @foo_add(double %P) {
- %tmp.1 = add double %P, 1.230000e+02 ; <double> [#uses=1]
- ret double %tmp.1
-}
-
-define double @foo_mul(double %P) {
- %tmp.1 = mul double %P, 1.230000e+02 ; <double> [#uses=1]
- ret double %tmp.1
-}
-
-define double @foo_sub(double %P) {
- %tmp.1 = sub double %P, 1.230000e+02 ; <double> [#uses=1]
- ret double %tmp.1
-}
-
-define double @foo_subr(double %P) {
- %tmp.1 = sub double 1.230000e+02, %P ; <double> [#uses=1]
- ret double %tmp.1
-}
-
-define double @foo_div(double %P) {
- %tmp.1 = fdiv double %P, 1.230000e+02 ; <double> [#uses=1]
- ret double %tmp.1
-}
-
-define double @foo_divr(double %P) {
- %tmp.1 = fdiv double 1.230000e+02, %P ; <double> [#uses=1]
- ret double %tmp.1
-}
diff --git a/release_23/test/CodeGen/X86/fp_load_cast_fold.ll b/release_23/test/CodeGen/X86/fp_load_cast_fold.ll
deleted file mode 100644
index 54523265e91e..000000000000
--- a/release_23/test/CodeGen/X86/fp_load_cast_fold.ll
+++ /dev/null
@@ -1,20 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 | grep fild | not grep ESP
-
-define double @short(i16* %P) {
- %V = load i16* %P ; <i16> [#uses=1]
- %V2 = sitofp i16 %V to double ; <double> [#uses=1]
- ret double %V2
-}
-
-define double @int(i32* %P) {
- %V = load i32* %P ; <i32> [#uses=1]
- %V2 = sitofp i32 %V to double ; <double> [#uses=1]
- ret double %V2
-}
-
-define double @long(i64* %P) {
- %V = load i64* %P ; <i64> [#uses=1]
- %V2 = sitofp i64 %V to double ; <double> [#uses=1]
- ret double %V2
-}
-
diff --git a/release_23/test/CodeGen/X86/fp_load_fold.ll b/release_23/test/CodeGen/X86/fp_load_fold.ll
deleted file mode 100644
index 7c33cb32bc6d..000000000000
--- a/release_23/test/CodeGen/X86/fp_load_fold.ll
+++ /dev/null
@@ -1,40 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -x86-asm-syntax=intel | \
-; RUN: grep -i ST | not grep {fadd\\|fsub\\|fdiv\\|fmul}
-
-; Test that the load of the memory location is folded into the operation.
-
-define double @test_add(double %X, double* %P) {
- %Y = load double* %P ; <double> [#uses=1]
- %R = add double %X, %Y ; <double> [#uses=1]
- ret double %R
-}
-
-define double @test_mul(double %X, double* %P) {
- %Y = load double* %P ; <double> [#uses=1]
- %R = mul double %X, %Y ; <double> [#uses=1]
- ret double %R
-}
-
-define double @test_sub(double %X, double* %P) {
- %Y = load double* %P ; <double> [#uses=1]
- %R = sub double %X, %Y ; <double> [#uses=1]
- ret double %R
-}
-
-define double @test_subr(double %X, double* %P) {
- %Y = load double* %P ; <double> [#uses=1]
- %R = sub double %Y, %X ; <double> [#uses=1]
- ret double %R
-}
-
-define double @test_div(double %X, double* %P) {
- %Y = load double* %P ; <double> [#uses=1]
- %R = fdiv double %X, %Y ; <double> [#uses=1]
- ret double %R
-}
-
-define double @test_divr(double %X, double* %P) {
- %Y = load double* %P ; <double> [#uses=1]
- %R = fdiv double %Y, %X ; <double> [#uses=1]
- ret double %R
-}
diff --git a/release_23/test/CodeGen/X86/fsxor-alignment.ll b/release_23/test/CodeGen/X86/fsxor-alignment.ll
deleted file mode 100644
index 71007dcc0533..000000000000
--- a/release_23/test/CodeGen/X86/fsxor-alignment.ll
+++ /dev/null
@@ -1,14 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 -enable-unsafe-fp-math | \
-; RUN: grep -v sp | grep xorps | count 2
-
-; Don't fold the incoming stack arguments into the xorps instructions used
-; to do floating-point negations, because the arguments aren't vectors
-; and aren't vector-aligned.
-
-define void @foo(float* %p, float* %q, float %s, float %y) {
- %ss = sub float -0.0, %s
- %yy = sub float -0.0, %y
- store float %ss, float* %p
- store float %yy, float* %q
- ret void
-}
diff --git a/release_23/test/CodeGen/X86/hidden-vis.ll b/release_23/test/CodeGen/X86/hidden-vis.ll
deleted file mode 100644
index 058850c7b75c..000000000000
--- a/release_23/test/CodeGen/X86/hidden-vis.ll
+++ /dev/null
@@ -1,20 +0,0 @@
-; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu | \
-; RUN: grep .hidden | count 2
-; RUN: llvm-as < %s | llc -mtriple=i686-apple-darwin8.8.0 | \
-; RUN: grep .private_extern | count 2
-
-%struct.Person = type { i32 }
-@a = hidden global i32 0
-@b = external global i32
-
-
-define weak hidden void @_ZN6Person13privateMethodEv(%struct.Person* %this) {
- ret void
-}
-
-declare void @function(i32)
-
-define weak void @_ZN6PersonC1Ei(%struct.Person* %this, i32 %_c) {
- ret void
-}
-
diff --git a/release_23/test/CodeGen/X86/i128-immediate.ll b/release_23/test/CodeGen/X86/i128-immediate.ll
deleted file mode 100644
index 69399336e30e..000000000000
--- a/release_23/test/CodeGen/X86/i128-immediate.ll
+++ /dev/null
@@ -1,5 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86-64 | grep movq | count 2
-
-define i128 @__addvti3() {
- ret i128 -1
-}
diff --git a/release_23/test/CodeGen/X86/i128-mul.ll b/release_23/test/CodeGen/X86/i128-mul.ll
deleted file mode 100644
index f8c732ec68e4..000000000000
--- a/release_23/test/CodeGen/X86/i128-mul.ll
+++ /dev/null
@@ -1,12 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86-64
-; PR1198
-
-define i64 @foo(i64 %x, i64 %y) {
- %tmp0 = zext i64 %x to i128
- %tmp1 = zext i64 %y to i128
- %tmp2 = mul i128 %tmp0, %tmp1
- %tmp7 = zext i32 64 to i128
- %tmp3 = lshr i128 %tmp2, %tmp7
- %tmp4 = trunc i128 %tmp3 to i64
- ret i64 %tmp4
-}
diff --git a/release_23/test/CodeGen/X86/i128-ret.ll b/release_23/test/CodeGen/X86/i128-ret.ll
deleted file mode 100644
index 179a0134331b..000000000000
--- a/release_23/test/CodeGen/X86/i128-ret.ll
+++ /dev/null
@@ -1,8 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86-64 | grep {movq 8(%rdi), %rdx}
-; RUN: llvm-as < %s | llc -march=x86-64 | grep {movq (%rdi), %rax}
-
-define i128 @test(i128 *%P) {
- %A = load i128* %P
- ret i128 %A
-}
-
diff --git a/release_23/test/CodeGen/X86/iabs.ll b/release_23/test/CodeGen/X86/iabs.ll
deleted file mode 100644
index ca751ae1d2e4..000000000000
--- a/release_23/test/CodeGen/X86/iabs.ll
+++ /dev/null
@@ -1,17 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86-64 -stats |& \
-; RUN: grep {6 .*Number of machine instrs printed}
-
-;; Integer absolute value, should produce something at least as good as:
-;; movl %edi, %eax
-;; sarl $31, %eax
-;; addl %eax, %edi
-;; xorl %eax, %edi
-;; movl %edi, %eax
-;; ret
-define i32 @test(i32 %a) nounwind {
- %tmp1neg = sub i32 0, %a
- %b = icmp sgt i32 %a, -1
- %abs = select i1 %b, i32 %a, i32 %tmp1neg
- ret i32 %abs
-}
-
diff --git a/release_23/test/CodeGen/X86/illegal-insert.ll b/release_23/test/CodeGen/X86/illegal-insert.ll
deleted file mode 100644
index 59773b249104..000000000000
--- a/release_23/test/CodeGen/X86/illegal-insert.ll
+++ /dev/null
@@ -1,18 +0,0 @@
-; RUN: llvm-as %s -o - | llc -march=x86-64
-
-define <4 x double> @foo0(<4 x double> %t) {
- %r = insertelement <4 x double> %t, double 2.3, i32 0
- ret <4 x double> %r
-}
-define <4 x double> @foo1(<4 x double> %t) {
- %r = insertelement <4 x double> %t, double 2.3, i32 1
- ret <4 x double> %r
-}
-define <4 x double> @foo2(<4 x double> %t) {
- %r = insertelement <4 x double> %t, double 2.3, i32 2
- ret <4 x double> %r
-}
-define <4 x double> @foo3(<4 x double> %t) {
- %r = insertelement <4 x double> %t, double 2.3, i32 3
- ret <4 x double> %r
-}
diff --git a/release_23/test/CodeGen/X86/illegal-vector-args-return.ll b/release_23/test/CodeGen/X86/illegal-vector-args-return.ll
deleted file mode 100644
index 8fb6db356ced..000000000000
--- a/release_23/test/CodeGen/X86/illegal-vector-args-return.ll
+++ /dev/null
@@ -1,14 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep {mulpd %xmm3, %xmm1}
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep {mulpd %xmm2, %xmm0}
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep {addps %xmm3, %xmm1}
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep {addps %xmm2, %xmm0}
-
-define <4 x double> @foo(<4 x double> %x, <4 x double> %z) {
- %y = mul <4 x double> %x, %z
- ret <4 x double> %y
-}
-
-define <8 x float> @bar(<8 x float> %x, <8 x float> %z) {
- %y = add <8 x float> %x, %z
- ret <8 x float> %y
-}
diff --git a/release_23/test/CodeGen/X86/imp-def-copies.ll b/release_23/test/CodeGen/X86/imp-def-copies.ll
deleted file mode 100644
index 3d2f65653e7a..000000000000
--- a/release_23/test/CodeGen/X86/imp-def-copies.ll
+++ /dev/null
@@ -1,29 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 | not grep mov
-
- %struct.active_line = type { %struct.gs_fixed_point, %struct.gs_fixed_point, i32, i32, i32, %struct.line_segment*, i32, i16, i16, %struct.active_line*, %struct.active_line* }
- %struct.gs_fixed_point = type { i32, i32 }
- %struct.line_list = type { %struct.active_line*, i32, i16, %struct.active_line*, %struct.active_line*, %struct.active_line*, %struct.active_line, i32 }
- %struct.line_segment = type { %struct.line_segment*, %struct.line_segment*, i32, %struct.gs_fixed_point }
- %struct.subpath = type { %struct.line_segment*, %struct.line_segment*, i32, %struct.gs_fixed_point, %struct.line_segment*, i32, i32, i8 }
-
-define fastcc void @add_y_list(%struct.subpath* %ppath.0.4.val, i16 signext %tag, %struct.line_list* %ll, i32 %pbox.0.0.1.val, i32 %pbox.0.1.0.val, i32 %pbox.0.1.1.val) nounwind {
-entry:
- br i1 false, label %return, label %bb
-bb: ; preds = %bb280, %entry
- %psub.1.reg2mem.0 = phi %struct.subpath* [ %psub.0.reg2mem.0, %bb280 ], [ undef, %entry ] ; <%struct.subpath*> [#uses=1]
- %plast.1.reg2mem.0 = phi %struct.line_segment* [ %plast.0.reg2mem.0, %bb280 ], [ undef, %entry ] ; <%struct.line_segment*> [#uses=1]
- %prev_dir.0.reg2mem.0 = phi i32 [ %dir.0.reg2mem.0, %bb280 ], [ undef, %entry ] ; <i32> [#uses=1]
- br i1 false, label %bb280, label %bb109
-bb109: ; preds = %bb
- %tmp113 = icmp sgt i32 0, %prev_dir.0.reg2mem.0 ; <i1> [#uses=1]
- br i1 %tmp113, label %bb116, label %bb280
-bb116: ; preds = %bb109
- ret void
-bb280: ; preds = %bb109, %bb
- %psub.0.reg2mem.0 = phi %struct.subpath* [ null, %bb ], [ %psub.1.reg2mem.0, %bb109 ] ; <%struct.subpath*> [#uses=1]
- %plast.0.reg2mem.0 = phi %struct.line_segment* [ null, %bb ], [ %plast.1.reg2mem.0, %bb109 ] ; <%struct.line_segment*> [#uses=1]
- %dir.0.reg2mem.0 = phi i32 [ 0, %bb ], [ 0, %bb109 ] ; <i32> [#uses=1]
- br i1 false, label %return, label %bb
-return: ; preds = %bb280, %entry
- ret void
-}
diff --git a/release_23/test/CodeGen/X86/imul-lea.ll b/release_23/test/CodeGen/X86/imul-lea.ll
deleted file mode 100644
index 6403a2668a39..000000000000
--- a/release_23/test/CodeGen/X86/imul-lea.ll
+++ /dev/null
@@ -1,10 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 | grep lea
-
-declare i32 @foo()
-
-define i32 @test() {
- %tmp.0 = tail call i32 @foo( ) ; <i32> [#uses=1]
- %tmp.1 = mul i32 %tmp.0, 9 ; <i32> [#uses=1]
- ret i32 %tmp.1
-}
-
diff --git a/release_23/test/CodeGen/X86/inline-asm-fpstack.ll b/release_23/test/CodeGen/X86/inline-asm-fpstack.ll
deleted file mode 100644
index 91f2f2fb9330..000000000000
--- a/release_23/test/CodeGen/X86/inline-asm-fpstack.ll
+++ /dev/null
@@ -1,43 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86
-
-define x86_fp80 @test1() {
- %tmp85 = call x86_fp80 asm sideeffect "fld0", "={st(0)}"()
- ret x86_fp80 %tmp85
-}
-
-define double @test2() {
- %tmp85 = call double asm sideeffect "fld0", "={st(0)}"()
- ret double %tmp85
-}
-
-define void @test3(x86_fp80 %X) {
- call void asm sideeffect "frob ", "{st(0)},~{dirflag},~{fpsr},~{flags}"( x86_fp80 %X)
- ret void
-}
-
-define void @test4(double %X) {
- call void asm sideeffect "frob ", "{st(0)},~{dirflag},~{fpsr},~{flags}"( double %X)
- ret void
-}
-
-define void @test5(double %X) {
- %Y = add double %X, 123.0
- call void asm sideeffect "frob ", "{st(0)},~{dirflag},~{fpsr},~{flags}"( double %Y)
- ret void
-}
-
-define void @test6(double %A, double %B, double %C,
- double %D, double %E) nounwind {
-entry:
- ; Uses the same value twice, should have one fstp after the asm.
- tail call void asm sideeffect "foo $0 $1", "f,f,~{dirflag},~{fpsr},~{flags}"( double %A, double %A ) nounwind
- ; Uses two different values, should be in st(0)/st(1) and both be popped.
- tail call void asm sideeffect "bar $0 $1", "f,f,~{dirflag},~{fpsr},~{flags}"( double %B, double %C ) nounwind
- ; Uses two different values, one of which isn't killed in this asm, it
- ; should not be popped after the asm.
- tail call void asm sideeffect "baz $0 $1", "f,f,~{dirflag},~{fpsr},~{flags}"( double %D, double %E ) nounwind
- ; This is the last use of %D, so it should be popped after.
- tail call void asm sideeffect "baz $0", "f,~{dirflag},~{fpsr},~{flags}"( double %D ) nounwind
- ret void
-}
-
diff --git a/release_23/test/CodeGen/X86/inline-asm-mrv.ll b/release_23/test/CodeGen/X86/inline-asm-mrv.ll
deleted file mode 100644
index f679c7f58ba1..000000000000
--- a/release_23/test/CodeGen/X86/inline-asm-mrv.ll
+++ /dev/null
@@ -1,35 +0,0 @@
-; PR2094
-; RUN: llvm-as < %s | llc -march=x86-64 | grep movslq
-; RUN: llvm-as < %s | llc -march=x86-64 | grep addps
-; RUN: llvm-as < %s | llc -march=x86-64 | grep paddd
-; RUN: llvm-as < %s | llc -march=x86-64 | not grep movq
-
-target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128"
-target triple = "x86_64-apple-darwin8"
-
-define i32 @test1(i8* %v, i8* %blk2, i8* %blk1, i32 %stride, i32 %h) nounwind {
- %tmp12 = sext i32 %stride to i64 ; <i64> [#uses=1]
- %mrv = call {i32, i8*, i8*} asm sideeffect "$0 $1 $2 $3 $4 $5 $6",
- "=r,=r,=r,r,r,r,r"( i64 %tmp12, i32 %h, i8* %blk1, i8* %blk2 ) nounwind
- %tmp6 = getresult {i32, i8*, i8*} %mrv, 0
- %tmp7 = call i32 asm sideeffect "set $0",
- "=r,~{dirflag},~{fpsr},~{flags}"( ) nounwind
- ret i32 %tmp7
-}
-
-define <4 x float> @test2() nounwind {
- %mrv = call {<4 x float>, <4 x float>} asm "set $0, $1", "=x,=x"()
- %a = getresult {<4 x float>, <4 x float>} %mrv, 0
- %b = getresult {<4 x float>, <4 x float>} %mrv, 1
- %c = add <4 x float> %a, %b
- ret <4 x float> %c
-}
-
-define <4 x i32> @test3() nounwind {
- %mrv = call {<4 x i32>, <4 x i32>} asm "set $0, $1", "=x,=x"()
- %a = getresult {<4 x i32>, <4 x i32>} %mrv, 0
- %b = getresult {<4 x i32>, <4 x i32>} %mrv, 1
- %c = add <4 x i32> %a, %b
- ret <4 x i32> %c
-}
-
diff --git a/release_23/test/CodeGen/X86/inline-asm-x-scalar.ll b/release_23/test/CodeGen/X86/inline-asm-x-scalar.ll
deleted file mode 100644
index d1bac0c3b27d..000000000000
--- a/release_23/test/CodeGen/X86/inline-asm-x-scalar.ll
+++ /dev/null
@@ -1,24 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -mcpu=yonah
-
-define void @test1() {
- tail call void asm sideeffect "ucomiss $0", "x"( float 0x41E0000000000000)
- ret void
-}
-
-define void @test2() {
- %tmp53 = tail call i32 asm "ucomiss $1, $3\0Acmovae $2, $0 ", "=r,mx,mr,x,0,~{dirflag},~{fpsr},~{flags},~{cc}"( float 0x41E0000000000000, i32 2147483647, float 0.000000e+00, i32 0 ) ; <i32> [#uses
- unreachable
-}
-
-define void @test3() {
- tail call void asm sideeffect "ucomiss $0, $1", "mx,x,~{dirflag},~{fpsr},~{flags},~{cc}"( float 0x41E0000000000000, i32 65536 )
- ret void
-}
-
-define void @test4() {
- %tmp1 = tail call float asm "", "=x,0,~{dirflag},~{fpsr},~{flags}"( float 0x47EFFFFFE0000000 ); <float> [#uses=1]
- %tmp4 = sub float %tmp1, 0x3810000000000000 ; <float> [#uses=1]
- tail call void asm sideeffect "", "x,~{dirflag},~{fpsr},~{flags}"( float %tmp4 )
- ret void
-}
-
diff --git a/release_23/test/CodeGen/X86/inline-asm.ll b/release_23/test/CodeGen/X86/inline-asm.ll
deleted file mode 100644
index 54dfe76478ae..000000000000
--- a/release_23/test/CodeGen/X86/inline-asm.ll
+++ /dev/null
@@ -1,21 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86
-
-define i32 @test1() {
- ; Dest is AX, dest type = i32.
- %tmp4 = call i32 asm sideeffect "FROB $0", "={ax}"()
- ret i32 %tmp4
-}
-
-define void @test2(i32 %V) {
- ; input is AX, in type = i32.
- call void asm sideeffect "FROB $0", "{ax}"(i32 %V)
- ret void
-}
-
-define void @test3() {
- ; FP constant as a memory operand.
- tail call void asm sideeffect "frob $0", "m"( float 0x41E0000000000000)
- ret void
-}
-
-
diff --git a/release_23/test/CodeGen/X86/ins_subreg_coalesce-1.ll b/release_23/test/CodeGen/X86/ins_subreg_coalesce-1.ll
deleted file mode 100644
index 863cda94c5fc..000000000000
--- a/release_23/test/CodeGen/X86/ins_subreg_coalesce-1.ll
+++ /dev/null
@@ -1,24 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 | grep mov | count 2
-
-define fastcc i32 @sqlite3ExprResolveNames() nounwind {
-entry:
- br i1 false, label %UnifiedReturnBlock, label %bb4
-bb4: ; preds = %entry
- br i1 false, label %bb17, label %bb22
-bb17: ; preds = %bb4
- ret i32 1
-bb22: ; preds = %bb4
- br i1 true, label %walkExprTree.exit, label %bb4.i
-bb4.i: ; preds = %bb22
- ret i32 0
-walkExprTree.exit: ; preds = %bb22
- %tmp83 = load i16* null, align 4 ; <i16> [#uses=1]
- %tmp84 = or i16 %tmp83, 2 ; <i16> [#uses=2]
- store i16 %tmp84, i16* null, align 4
- %tmp98993 = zext i16 %tmp84 to i32 ; <i32> [#uses=1]
- %tmp1004 = lshr i32 %tmp98993, 3 ; <i32> [#uses=1]
- %tmp100.lobit5 = and i32 %tmp1004, 1 ; <i32> [#uses=1]
- ret i32 %tmp100.lobit5
-UnifiedReturnBlock: ; preds = %entry
- ret i32 0
-}
diff --git a/release_23/test/CodeGen/X86/ins_subreg_coalesce-2.ll b/release_23/test/CodeGen/X86/ins_subreg_coalesce-2.ll
deleted file mode 100644
index 5c0b0d3d3e95..000000000000
--- a/release_23/test/CodeGen/X86/ins_subreg_coalesce-2.ll
+++ /dev/null
@@ -1,7 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86-64 | not grep movw
-
-define i16 @test5(i16 %f12) nounwind {
- %f11 = shl i16 %f12, 2 ; <i16> [#uses=1]
- %tmp7.25 = ashr i16 %f11, 8 ; <i16> [#uses=1]
- ret i16 %tmp7.25
-}
diff --git a/release_23/test/CodeGen/X86/ins_subreg_coalesce-3.ll b/release_23/test/CodeGen/X86/ins_subreg_coalesce-3.ll
deleted file mode 100644
index ead920a482a9..000000000000
--- a/release_23/test/CodeGen/X86/ins_subreg_coalesce-3.ll
+++ /dev/null
@@ -1,93 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86-64 | grep mov | count 9
-
- %struct.COMPOSITE = type { i8, i16, i16 }
- %struct.FILE = type { i8*, i32, i32, i16, i16, %struct.__sbuf, i32, i8*, i32 (i8*)*, i32 (i8*, i8*, i32)*, i64 (i8*, i64, i32)*, i32 (i8*, i8*, i32)*, %struct.__sbuf, %struct.__sFILEX*, i32, [3 x i8], [1 x i8], %struct.__sbuf, i32, i64 }
- %struct.FILE_POS = type { i8, i8, i16, i32 }
- %struct.FIRST_UNION = type { %struct.FILE_POS }
- %struct.FONT_INFO = type { %struct.metrics*, i8*, i16*, %struct.COMPOSITE*, i32, %struct.rec*, %struct.rec*, i16, i16, i16*, i8*, i8*, i16* }
- %struct.FOURTH_UNION = type { %struct.STYLE }
- %struct.GAP = type { i8, i8, i16 }
- %struct.LIST = type { %struct.rec*, %struct.rec* }
- %struct.SECOND_UNION = type { { i16, i8, i8 } }
- %struct.STYLE = type { { %struct.GAP }, { %struct.GAP }, i16, i16, i32 }
- %struct.THIRD_UNION = type { %struct.FILE*, [8 x i8] }
- %struct.__sFILEX = type opaque
- %struct.__sbuf = type { i8*, i32 }
- %struct.head_type = type { [2 x %struct.LIST], %struct.FIRST_UNION, %struct.SECOND_UNION, %struct.THIRD_UNION, %struct.FOURTH_UNION, %struct.rec*, { %struct.rec* }, %struct.rec*, %struct.rec*, %struct.rec*, %struct.rec*, %struct.rec*, %struct.rec*, %struct.rec*, %struct.rec*, i32 }
- %struct.metrics = type { i16, i16, i16, i16, i16 }
- %struct.rec = type { %struct.head_type }
-
-define void @FontChange() {
-entry:
- br i1 false, label %bb298, label %bb49
-bb49: ; preds = %entry
- ret void
-bb298: ; preds = %entry
- br i1 false, label %bb304, label %bb366
-bb304: ; preds = %bb298
- br i1 false, label %bb330, label %bb428
-bb330: ; preds = %bb366, %bb304
- br label %bb366
-bb366: ; preds = %bb330, %bb298
- br i1 false, label %bb330, label %bb428
-bb428: ; preds = %bb366, %bb304
- br i1 false, label %bb650, label %bb433
-bb433: ; preds = %bb428
- ret void
-bb650: ; preds = %bb650, %bb428
- %tmp658 = load i8* null, align 8 ; <i8> [#uses=1]
- %tmp659 = icmp eq i8 %tmp658, 0 ; <i1> [#uses=1]
- br i1 %tmp659, label %bb650, label %bb662
-bb662: ; preds = %bb650
- %tmp685 = icmp eq %struct.rec* null, null ; <i1> [#uses=1]
- br i1 %tmp685, label %bb761, label %bb688
-bb688: ; preds = %bb662
- ret void
-bb761: ; preds = %bb662
- %tmp487248736542 = load i32* null, align 4 ; <i32> [#uses=2]
- %tmp487648776541 = and i32 %tmp487248736542, 57344 ; <i32> [#uses=1]
- %tmp4881 = icmp eq i32 %tmp487648776541, 8192 ; <i1> [#uses=1]
- br i1 %tmp4881, label %bb4884, label %bb4897
-bb4884: ; preds = %bb761
- %tmp488948906540 = and i32 %tmp487248736542, 7168 ; <i32> [#uses=1]
- %tmp4894 = icmp eq i32 %tmp488948906540, 1024 ; <i1> [#uses=1]
- br i1 %tmp4894, label %bb4932, label %bb4897
-bb4897: ; preds = %bb4884, %bb761
- ret void
-bb4932: ; preds = %bb4884
- %tmp4933 = load i32* null, align 4 ; <i32> [#uses=1]
- br i1 false, label %bb5054, label %bb4940
-bb4940: ; preds = %bb4932
- %tmp4943 = load i32* null, align 4 ; <i32> [#uses=2]
- switch i32 %tmp4933, label %bb5054 [
- i32 159, label %bb4970
- i32 160, label %bb5002
- ]
-bb4970: ; preds = %bb4940
- %tmp49746536 = trunc i32 %tmp4943 to i16 ; <i16> [#uses=1]
- %tmp49764977 = and i16 %tmp49746536, 4095 ; <i16> [#uses=1]
- %mask498049814982 = zext i16 %tmp49764977 to i64 ; <i64> [#uses=1]
- %tmp4984 = getelementptr %struct.FONT_INFO* null, i64 %mask498049814982, i32 5 ; <%struct.rec**> [#uses=1]
- %tmp4985 = load %struct.rec** %tmp4984, align 8 ; <%struct.rec*> [#uses=1]
- %tmp4988 = getelementptr %struct.rec* %tmp4985, i64 0, i32 0, i32 3 ; <%struct.THIRD_UNION*> [#uses=1]
- %tmp4991 = bitcast %struct.THIRD_UNION* %tmp4988 to i32* ; <i32*> [#uses=1]
- %tmp4992 = load i32* %tmp4991, align 8 ; <i32> [#uses=1]
- %tmp49924993 = trunc i32 %tmp4992 to i16 ; <i16> [#uses=1]
- %tmp4996 = add i16 %tmp49924993, 0 ; <i16> [#uses=1]
- br label %bb5054
-bb5002: ; preds = %bb4940
- %tmp50066537 = trunc i32 %tmp4943 to i16 ; <i16> [#uses=1]
- %tmp50085009 = and i16 %tmp50066537, 4095 ; <i16> [#uses=1]
- %mask501250135014 = zext i16 %tmp50085009 to i64 ; <i64> [#uses=1]
- %tmp5016 = getelementptr %struct.FONT_INFO* null, i64 %mask501250135014, i32 5 ; <%struct.rec**> [#uses=1]
- %tmp5017 = load %struct.rec** %tmp5016, align 8 ; <%struct.rec*> [#uses=1]
- %tmp5020 = getelementptr %struct.rec* %tmp5017, i64 0, i32 0, i32 3 ; <%struct.THIRD_UNION*> [#uses=1]
- %tmp5023 = bitcast %struct.THIRD_UNION* %tmp5020 to i32* ; <i32*> [#uses=1]
- %tmp5024 = load i32* %tmp5023, align 8 ; <i32> [#uses=1]
- %tmp50245025 = trunc i32 %tmp5024 to i16 ; <i16> [#uses=1]
- %tmp5028 = sub i16 %tmp50245025, 0 ; <i16> [#uses=1]
- br label %bb5054
-bb5054: ; preds = %bb5002, %bb4970, %bb4940, %bb4932
- %flen.0.reg2mem.0 = phi i16 [ %tmp4996, %bb4970 ], [ %tmp5028, %bb5002 ], [ 0, %bb4932 ], [ undef, %bb4940 ] ; <i16> [#uses=0]
- ret void
-}
diff --git a/release_23/test/CodeGen/X86/insertelement-copytoregs.ll b/release_23/test/CodeGen/X86/insertelement-copytoregs.ll
deleted file mode 100644
index 0eef5173b858..000000000000
--- a/release_23/test/CodeGen/X86/insertelement-copytoregs.ll
+++ /dev/null
@@ -1,11 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86-64 | grep -v IMPLICIT_DEF
-
-define void @foo(<2 x float>* %p) {
- %t = insertelement <2 x float> undef, float 0.0, i32 0
- %v = insertelement <2 x float> %t, float 0.0, i32 1
- br label %bb8
-
-bb8:
- store <2 x float> %v, <2 x float>* %p
- ret void
-}
diff --git a/release_23/test/CodeGen/X86/invalid-shift-immediate.ll b/release_23/test/CodeGen/X86/invalid-shift-immediate.ll
deleted file mode 100644
index 5c47f5ee685f..000000000000
--- a/release_23/test/CodeGen/X86/invalid-shift-immediate.ll
+++ /dev/null
@@ -1,30 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86
-; PR2098
-
-target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
-target triple = "i386-apple-darwin8"
-
-define void @foo(i32 %x) {
-entry:
- %x_addr = alloca i32 ; <i32*> [#uses=2]
- %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
- store i32 %x, i32* %x_addr
- %tmp = load i32* %x_addr, align 4 ; <i32> [#uses=1]
- %tmp1 = ashr i32 %tmp, -2 ; <i32> [#uses=1]
- %tmp2 = and i32 %tmp1, 1 ; <i32> [#uses=1]
- %tmp23 = trunc i32 %tmp2 to i8 ; <i8> [#uses=1]
- %toBool = icmp ne i8 %tmp23, 0 ; <i1> [#uses=1]
- br i1 %toBool, label %bb, label %bb5
-
-bb: ; preds = %entry
- %tmp4 = call i32 (...)* @bar( ) nounwind ; <i32> [#uses=0]
- br label %bb5
-
-bb5: ; preds = %bb, %entry
- br label %return
-
-return: ; preds = %bb5
- ret void
-}
-
-declare i32 @bar(...)
diff --git a/release_23/test/CodeGen/X86/isel-sink.ll b/release_23/test/CodeGen/X86/isel-sink.ll
deleted file mode 100644
index 4e68b7757ff5..000000000000
--- a/release_23/test/CodeGen/X86/isel-sink.ll
+++ /dev/null
@@ -1,18 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 | not grep lea
-; RUN: llvm-as < %s | llc -march=x86 -mtriple=i686-apple-darwin8 | \
-; RUN: grep {movl \$4, (.*,.*,4)}
-
-define i32 @test(i32* %X, i32 %B) {
- ; This gep should be sunk out of this block into the load/store users.
- %P = getelementptr i32* %X, i32 %B
- %G = icmp ult i32 %B, 1234
- br i1 %G, label %T, label %F
-T:
- store i32 4, i32* %P
- ret i32 141
-F:
- %V = load i32* %P
- ret i32 %V
-}
-
-
diff --git a/release_23/test/CodeGen/X86/isnan.ll b/release_23/test/CodeGen/X86/isnan.ll
deleted file mode 100644
index 18fe29a883e0..000000000000
--- a/release_23/test/CodeGen/X86/isnan.ll
+++ /dev/null
@@ -1,11 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -mcpu=yonah | not grep pxor
-
-; This should not need to materialize 0.0 to evaluate the condition.
-
-define i32 @test(double %X) nounwind {
-entry:
- %tmp6 = fcmp uno double %X, 0.000000e+00 ; <i1> [#uses=1]
- %tmp67 = zext i1 %tmp6 to i32 ; <i32> [#uses=1]
- ret i32 %tmp67
-}
-
diff --git a/release_23/test/CodeGen/X86/isnan.llx b/release_23/test/CodeGen/X86/isnan.llx
deleted file mode 100644
index 65916ff57724..000000000000
--- a/release_23/test/CodeGen/X86/isnan.llx
+++ /dev/null
@@ -1,9 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 | not grep call
-
-declare i1 @llvm.isunordered.f64(double)
-
-define i1 @test_isnan(double %X) {
- %R = fcmp uno double %X, %X ; <i1> [#uses=1]
- ret i1 %R
-}
-
diff --git a/release_23/test/CodeGen/X86/ispositive.ll b/release_23/test/CodeGen/X86/ispositive.ll
deleted file mode 100644
index 3799b9c70b07..000000000000
--- a/release_23/test/CodeGen/X86/ispositive.ll
+++ /dev/null
@@ -1,9 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 | grep {shrl.*31}
-
-define i32 @test1(i32 %X) {
-entry:
- icmp slt i32 %X, 0 ; <i1>:0 [#uses=1]
- zext i1 %0 to i32 ; <i32>:1 [#uses=1]
- ret i32 %1
-}
-
diff --git a/release_23/test/CodeGen/X86/jump_sign.ll b/release_23/test/CodeGen/X86/jump_sign.ll
deleted file mode 100644
index cb7d6271f958..000000000000
--- a/release_23/test/CodeGen/X86/jump_sign.ll
+++ /dev/null
@@ -1,20 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 | grep jns
-
-define i32 @f(i32 %X) {
-entry:
- %tmp1 = add i32 %X, 1 ; <i32> [#uses=1]
- %tmp = icmp slt i32 %tmp1, 0 ; <i1> [#uses=1]
- br i1 %tmp, label %cond_true, label %cond_next
-
-cond_true: ; preds = %entry
- %tmp2 = tail call i32 (...)* @bar( ) ; <i32> [#uses=0]
- br label %cond_next
-
-cond_next: ; preds = %cond_true, %entry
- %tmp3 = tail call i32 (...)* @baz( ) ; <i32> [#uses=0]
- ret i32 undef
-}
-
-declare i32 @bar(...)
-
-declare i32 @baz(...)
diff --git a/release_23/test/CodeGen/X86/ldzero.ll b/release_23/test/CodeGen/X86/ldzero.ll
deleted file mode 100644
index 2db78a2145b6..000000000000
--- a/release_23/test/CodeGen/X86/ldzero.ll
+++ /dev/null
@@ -1,43 +0,0 @@
-; RUN: llvm-as < %s | llc
-; verify PR 1700 is still fixed
-; ModuleID = 'hh.c'
-target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
-target triple = "i686-apple-darwin8"
-
-define x86_fp80 @x() {
-entry:
- %retval = alloca x86_fp80, align 16 ; <x86_fp80*> [#uses=2]
- %tmp = alloca x86_fp80, align 16 ; <x86_fp80*> [#uses=2]
- %d = alloca double, align 8 ; <double*> [#uses=2]
- %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
- store double 0.000000e+00, double* %d, align 8
- %tmp1 = load double* %d, align 8 ; <double> [#uses=1]
- %tmp12 = fpext double %tmp1 to x86_fp80 ; <x86_fp80> [#uses=1]
- store x86_fp80 %tmp12, x86_fp80* %tmp, align 16
- %tmp3 = load x86_fp80* %tmp, align 16 ; <x86_fp80> [#uses=1]
- store x86_fp80 %tmp3, x86_fp80* %retval, align 16
- br label %return
-
-return: ; preds = %entry
- %retval4 = load x86_fp80* %retval ; <x86_fp80> [#uses=1]
- ret x86_fp80 %retval4
-}
-
-define double @y() {
-entry:
- %retval = alloca double, align 8 ; <double*> [#uses=2]
- %tmp = alloca double, align 8 ; <double*> [#uses=2]
- %ld = alloca x86_fp80, align 16 ; <x86_fp80*> [#uses=2]
- %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
- store x86_fp80 0xK00000000000000000000, x86_fp80* %ld, align 16
- %tmp1 = load x86_fp80* %ld, align 16 ; <x86_fp80> [#uses=1]
- %tmp12 = fptrunc x86_fp80 %tmp1 to double ; <double> [#uses=1]
- store double %tmp12, double* %tmp, align 8
- %tmp3 = load double* %tmp, align 8 ; <double> [#uses=1]
- store double %tmp3, double* %retval, align 8
- br label %return
-
-return: ; preds = %entry
- %retval4 = load double* %retval ; <double> [#uses=1]
- ret double %retval4
-}
diff --git a/release_23/test/CodeGen/X86/lea-2.ll b/release_23/test/CodeGen/X86/lea-2.ll
deleted file mode 100644
index a33b71c851ec..000000000000
--- a/release_23/test/CodeGen/X86/lea-2.ll
+++ /dev/null
@@ -1,13 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -x86-asm-syntax=intel | \
-; RUN: grep {lea EAX, DWORD PTR \\\[... + 4\\*... - 5\\\]}
-; RUN: llvm-as < %s | llc -march=x86 -x86-asm-syntax=intel | \
-; RUN: not grep add
-
-define i32 @test1(i32 %A, i32 %B) {
- %tmp1 = shl i32 %A, 2 ; <i32> [#uses=1]
- %tmp3 = add i32 %B, -5 ; <i32> [#uses=1]
- %tmp4 = add i32 %tmp3, %tmp1 ; <i32> [#uses=1]
- ret i32 %tmp4
-}
-
-
diff --git a/release_23/test/CodeGen/X86/lea-3.ll b/release_23/test/CodeGen/X86/lea-3.ll
deleted file mode 100644
index 8b4faf221ab0..000000000000
--- a/release_23/test/CodeGen/X86/lea-3.ll
+++ /dev/null
@@ -1,20 +0,0 @@
-
-; RUN: llvm-as < %s | llc -march=x86-64 | grep {leal (%rdi,%rdi,2), %eax}
-define i32 @test(i32 %a) {
- %tmp2 = mul i32 %a, 3 ; <i32> [#uses=1]
- ret i32 %tmp2
-}
-
-; RUN: llvm-as < %s | llc -march=x86-64 | grep {leaq (,%rdi,4), %rax}
-define i64 @test2(i64 %a) {
- %tmp2 = shl i64 %a, 2
- %tmp3 = or i64 %tmp2, %a
- ret i64 %tmp3
-}
-
-;; TODO! LEA instead of shift + copy.
-define i64 @test3(i64 %a) {
- %tmp2 = shl i64 %a, 3
- ret i64 %tmp2
-}
-
diff --git a/release_23/test/CodeGen/X86/lea-recursion.ll b/release_23/test/CodeGen/X86/lea-recursion.ll
deleted file mode 100644
index 390e35adfaf5..000000000000
--- a/release_23/test/CodeGen/X86/lea-recursion.ll
+++ /dev/null
@@ -1,47 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86-64 | grep lea | count 12
-
-; This testcase was written to demonstrate an instruction-selection problem,
-; however it also happens to expose a limitation in the DAGCombiner's
-; expression reassociation which causes it to miss opportunities for
-; constant folding due to the intermediate adds having multiple uses.
-; The Reassociate pass has similar limitations. If these limitations are
-; fixed, the test commands above will need to be updated to expect fewer
-; lea instructions.
-
-@g0 = weak global [1000 x i32] zeroinitializer, align 32 ; <[1000 x i32]*> [#uses=8]
-@g1 = weak global [1000 x i32] zeroinitializer, align 32 ; <[1000 x i32]*> [#uses=7]
-
-define void @foo() {
-entry:
- %tmp4 = load i32* getelementptr ([1000 x i32]* @g0, i32 0, i32 0) ; <i32> [#uses=1]
- %tmp8 = load i32* getelementptr ([1000 x i32]* @g1, i32 0, i32 0) ; <i32> [#uses=1]
- %tmp9 = add i32 %tmp4, 1 ; <i32> [#uses=1]
- %tmp10 = add i32 %tmp9, %tmp8 ; <i32> [#uses=2]
- store i32 %tmp10, i32* getelementptr ([1000 x i32]* @g0, i32 0, i32 1)
- %tmp8.1 = load i32* getelementptr ([1000 x i32]* @g1, i32 0, i32 1) ; <i32> [#uses=1]
- %tmp9.1 = add i32 %tmp10, 1 ; <i32> [#uses=1]
- %tmp10.1 = add i32 %tmp9.1, %tmp8.1 ; <i32> [#uses=2]
- store i32 %tmp10.1, i32* getelementptr ([1000 x i32]* @g0, i32 0, i32 2)
- %tmp8.2 = load i32* getelementptr ([1000 x i32]* @g1, i32 0, i32 2) ; <i32> [#uses=1]
- %tmp9.2 = add i32 %tmp10.1, 1 ; <i32> [#uses=1]
- %tmp10.2 = add i32 %tmp9.2, %tmp8.2 ; <i32> [#uses=2]
- store i32 %tmp10.2, i32* getelementptr ([1000 x i32]* @g0, i32 0, i32 3)
- %tmp8.3 = load i32* getelementptr ([1000 x i32]* @g1, i32 0, i32 3) ; <i32> [#uses=1]
- %tmp9.3 = add i32 %tmp10.2, 1 ; <i32> [#uses=1]
- %tmp10.3 = add i32 %tmp9.3, %tmp8.3 ; <i32> [#uses=2]
- store i32 %tmp10.3, i32* getelementptr ([1000 x i32]* @g0, i32 0, i32 4)
- %tmp8.4 = load i32* getelementptr ([1000 x i32]* @g1, i32 0, i32 4) ; <i32> [#uses=1]
- %tmp9.4 = add i32 %tmp10.3, 1 ; <i32> [#uses=1]
- %tmp10.4 = add i32 %tmp9.4, %tmp8.4 ; <i32> [#uses=2]
- store i32 %tmp10.4, i32* getelementptr ([1000 x i32]* @g0, i32 0, i32 5)
- %tmp8.5 = load i32* getelementptr ([1000 x i32]* @g1, i32 0, i32 5) ; <i32> [#uses=1]
- %tmp9.5 = add i32 %tmp10.4, 1 ; <i32> [#uses=1]
- %tmp10.5 = add i32 %tmp9.5, %tmp8.5 ; <i32> [#uses=2]
- store i32 %tmp10.5, i32* getelementptr ([1000 x i32]* @g0, i32 0, i32 6)
- %tmp8.6 = load i32* getelementptr ([1000 x i32]* @g1, i32 0, i32 6) ; <i32> [#uses=1]
- %tmp9.6 = add i32 %tmp10.5, 1 ; <i32> [#uses=1]
- %tmp10.6 = add i32 %tmp9.6, %tmp8.6 ; <i32> [#uses=1]
- store i32 %tmp10.6, i32* getelementptr ([1000 x i32]* @g0, i32 0, i32 7)
- ret void
-}
-
diff --git a/release_23/test/CodeGen/X86/lea.ll b/release_23/test/CodeGen/X86/lea.ll
deleted file mode 100644
index 30a477ad120c..000000000000
--- a/release_23/test/CodeGen/X86/lea.ll
+++ /dev/null
@@ -1,9 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86
-; RUN: llvm-as < %s | llc -march=x86 | not grep orl
-
-define i32 @test(i32 %x) {
- %tmp1 = shl i32 %x, 3 ; <i32> [#uses=1]
- %tmp2 = add i32 %tmp1, 7 ; <i32> [#uses=1]
- ret i32 %tmp2
-}
-
diff --git a/release_23/test/CodeGen/X86/lfence.ll b/release_23/test/CodeGen/X86/lfence.ll
deleted file mode 100644
index 0721d7305440..000000000000
--- a/release_23/test/CodeGen/X86/lfence.ll
+++ /dev/null
@@ -1,8 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep lfence
-
-declare void @llvm.memory.barrier( i1 , i1 , i1 , i1 , i1)
-
-define void @test() {
- call void @llvm.memory.barrier( i1 true, i1 false, i1 false, i1 false, i1 true)
- ret void
-}
diff --git a/release_23/test/CodeGen/X86/long-setcc.ll b/release_23/test/CodeGen/X86/long-setcc.ll
deleted file mode 100644
index 55e7c86891af..000000000000
--- a/release_23/test/CodeGen/X86/long-setcc.ll
+++ /dev/null
@@ -1,18 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 | grep cmp | count 1
-; RUN: llvm-as < %s | llc -march=x86 | grep shr | count 1
-; RUN: llvm-as < %s | llc -march=x86 | grep xor | count 1
-
-define i1 @t1(i64 %x) {
- %B = icmp slt i64 %x, 0
- ret i1 %B
-}
-
-define i1 @t2(i64 %x) {
- %tmp = icmp ult i64 %x, 4294967296
- ret i1 %tmp
-}
-
-define i1 @t3(i32 %x) {
- %tmp = icmp ugt i32 %x, -1
- ret i1 %tmp
-}
diff --git a/release_23/test/CodeGen/X86/longlong-deadload.ll b/release_23/test/CodeGen/X86/longlong-deadload.ll
deleted file mode 100644
index a8e2c31d9481..000000000000
--- a/release_23/test/CodeGen/X86/longlong-deadload.ll
+++ /dev/null
@@ -1,11 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 | not grep '4{(%...)}
-; This should not load or store the top part of *P.
-
-define void @test(i64* %P) nounwind {
-entry:
- %tmp1 = load i64* %P, align 8 ; <i64> [#uses=1]
- %tmp2 = xor i64 %tmp1, 1 ; <i64> [#uses=1]
- store i64 %tmp2, i64* %P, align 8
- ret void
-}
-
diff --git a/release_23/test/CodeGen/X86/loop-hoist.ll b/release_23/test/CodeGen/X86/loop-hoist.ll
deleted file mode 100644
index 95edb3d13b20..000000000000
--- a/release_23/test/CodeGen/X86/loop-hoist.ll
+++ /dev/null
@@ -1,26 +0,0 @@
-; RUN: llvm-as < %s | \
-; RUN: llc -relocation-model=dynamic-no-pic -mtriple=i686-apple-darwin8.7.2 |\
-; RUN: grep L_Arr.non_lazy_ptr
-; RUN: llvm-as < %s | \
-; RUN: llc -relocation-model=dynamic-no-pic -mtriple=i686-apple-darwin8.7.2 |\
-; RUN: %prcontext L_Arr.non_lazy_ptr 1 | grep {4(%esp)}
-
-@Arr = external global [0 x i32] ; <[0 x i32]*> [#uses=1]
-
-define void @foo(i32 %N.in, i32 %x) {
-entry:
- %N = bitcast i32 %N.in to i32 ; <i32> [#uses=1]
- br label %cond_true
-
-cond_true: ; preds = %cond_true, %entry
- %indvar = phi i32 [ %x, %entry ], [ %indvar.next, %cond_true ] ; <i32> [#uses=2]
- %i.0.0 = bitcast i32 %indvar to i32 ; <i32> [#uses=2]
- %tmp = getelementptr [0 x i32]* @Arr, i32 0, i32 %i.0.0 ; <i32*> [#uses=1]
- store i32 %i.0.0, i32* %tmp
- %indvar.next = add i32 %indvar, 1 ; <i32> [#uses=2]
- %exitcond = icmp eq i32 %indvar.next, %N ; <i1> [#uses=1]
- br i1 %exitcond, label %return, label %cond_true
-
-return: ; preds = %cond_true
- ret void
-}
diff --git a/release_23/test/CodeGen/X86/loop-strength-reduce.ll b/release_23/test/CodeGen/X86/loop-strength-reduce.ll
deleted file mode 100644
index 7cdc4492ab38..000000000000
--- a/release_23/test/CodeGen/X86/loop-strength-reduce.ll
+++ /dev/null
@@ -1,29 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 | \
-; RUN: grep {A(} | count 1
-;
-; Make sure the common loop invariant _A(reg) is hoisted up to preheader.
-
-@A = internal global [16 x [16 x i32]] zeroinitializer, align 32 ; <[16 x [16 x i32]]*> [#uses=2]
-
-define void @test(i32 %row, i32 %N.in) {
-entry:
- %N = bitcast i32 %N.in to i32 ; <i32> [#uses=1]
- %tmp5 = icmp sgt i32 %N.in, 0 ; <i1> [#uses=1]
- br i1 %tmp5, label %cond_true, label %return
-
-cond_true: ; preds = %cond_true, %entry
- %indvar = phi i32 [ 0, %entry ], [ %indvar.next, %cond_true ] ; <i32> [#uses=2]
- %i.0.0 = bitcast i32 %indvar to i32 ; <i32> [#uses=2]
- %tmp2 = add i32 %i.0.0, 1 ; <i32> [#uses=1]
- %tmp = getelementptr [16 x [16 x i32]]* @A, i32 0, i32 %row, i32 %tmp2 ; <i32*> [#uses=1]
- store i32 4, i32* %tmp
- %tmp5.upgrd.1 = add i32 %i.0.0, 2 ; <i32> [#uses=1]
- %tmp7 = getelementptr [16 x [16 x i32]]* @A, i32 0, i32 %row, i32 %tmp5.upgrd.1 ; <i32*> [#uses=1]
- store i32 5, i32* %tmp7
- %indvar.next = add i32 %indvar, 1 ; <i32> [#uses=2]
- %exitcond = icmp eq i32 %indvar.next, %N ; <i1> [#uses=1]
- br i1 %exitcond, label %return, label %cond_true
-
-return: ; preds = %cond_true, %entry
- ret void
-}
diff --git a/release_23/test/CodeGen/X86/loop-strength-reduce2.ll b/release_23/test/CodeGen/X86/loop-strength-reduce2.ll
deleted file mode 100644
index 839b295d4073..000000000000
--- a/release_23/test/CodeGen/X86/loop-strength-reduce2.ll
+++ /dev/null
@@ -1,29 +0,0 @@
-; RUN: llvm-as < %s | llc -mtriple=i686-apple-darwin -relocation-model=pic | grep '\$pb' | grep mov
-;
-; Make sure the PIC label flags2-"L1$pb" is not moved up to the preheader.
-
-@flags2 = internal global [8193 x i8] zeroinitializer, align 32 ; <[8193 x i8]*> [#uses=1]
-
-define void @test(i32 %k, i32 %i) {
-entry:
- %k_addr.012 = shl i32 %i, 1 ; <i32> [#uses=1]
- %tmp14 = icmp sgt i32 %k_addr.012, 8192 ; <i1> [#uses=1]
- br i1 %tmp14, label %return, label %bb
-
-bb: ; preds = %bb, %entry
- %indvar = phi i32 [ 0, %entry ], [ %indvar.next, %bb ] ; <i32> [#uses=2]
- %tmp. = shl i32 %i, 1 ; <i32> [#uses=1]
- %tmp.15 = mul i32 %indvar, %i ; <i32> [#uses=1]
- %tmp.16 = add i32 %tmp.15, %tmp. ; <i32> [#uses=2]
- %k_addr.0.0 = bitcast i32 %tmp.16 to i32 ; <i32> [#uses=1]
- %gep.upgrd.1 = zext i32 %tmp.16 to i64 ; <i64> [#uses=1]
- %tmp = getelementptr [8193 x i8]* @flags2, i32 0, i64 %gep.upgrd.1 ; <i8*> [#uses=1]
- store i8 0, i8* %tmp
- %k_addr.0 = add i32 %k_addr.0.0, %i ; <i32> [#uses=1]
- %tmp.upgrd.2 = icmp sgt i32 %k_addr.0, 8192 ; <i1> [#uses=1]
- %indvar.next = add i32 %indvar, 1 ; <i32> [#uses=1]
- br i1 %tmp.upgrd.2, label %return, label %bb
-
-return: ; preds = %bb, %entry
- ret void
-}
diff --git a/release_23/test/CodeGen/X86/loop-strength-reduce3.ll b/release_23/test/CodeGen/X86/loop-strength-reduce3.ll
deleted file mode 100644
index 4e95bdddb5b2..000000000000
--- a/release_23/test/CodeGen/X86/loop-strength-reduce3.ll
+++ /dev/null
@@ -1,37 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 | grep cmp | grep 240
-; RUN: llvm-as < %s | llc -march=x86 | grep inc | count 1
-
-define i32 @foo(i32 %A, i32 %B, i32 %C, i32 %D) {
-entry:
- %tmp2955 = icmp sgt i32 %C, 0 ; <i1> [#uses=1]
- br i1 %tmp2955, label %bb26.outer.us, label %bb40.split
-
-bb26.outer.us: ; preds = %bb26.bb32_crit_edge.us, %entry
- %i.044.0.ph.us = phi i32 [ 0, %entry ], [ %indvar.next57, %bb26.bb32_crit_edge.us ] ; <i32> [#uses=2]
- %k.1.ph.us = phi i32 [ 0, %entry ], [ %k.0.us, %bb26.bb32_crit_edge.us ] ; <i32> [#uses=1]
- %tmp3.us = mul i32 %i.044.0.ph.us, 6 ; <i32> [#uses=1]
- br label %bb1.us
-
-bb1.us: ; preds = %bb1.us, %bb26.outer.us
- %j.053.us = phi i32 [ 0, %bb26.outer.us ], [ %tmp25.us, %bb1.us ] ; <i32> [#uses=2]
- %k.154.us = phi i32 [ %k.1.ph.us, %bb26.outer.us ], [ %k.0.us, %bb1.us ] ; <i32> [#uses=1]
- %tmp5.us = add i32 %tmp3.us, %j.053.us ; <i32> [#uses=1]
- %tmp7.us = shl i32 %D, %tmp5.us ; <i32> [#uses=2]
- %tmp9.us = icmp eq i32 %tmp7.us, %B ; <i1> [#uses=1]
- %tmp910.us = zext i1 %tmp9.us to i32 ; <i32> [#uses=1]
- %tmp12.us = and i32 %tmp7.us, %A ; <i32> [#uses=1]
- %tmp19.us = and i32 %tmp12.us, %tmp910.us ; <i32> [#uses=1]
- %k.0.us = add i32 %tmp19.us, %k.154.us ; <i32> [#uses=3]
- %tmp25.us = add i32 %j.053.us, 1 ; <i32> [#uses=2]
- %tmp29.us = icmp slt i32 %tmp25.us, %C ; <i1> [#uses=1]
- br i1 %tmp29.us, label %bb1.us, label %bb26.bb32_crit_edge.us
-
-bb26.bb32_crit_edge.us: ; preds = %bb1.us
- %indvar.next57 = add i32 %i.044.0.ph.us, 1 ; <i32> [#uses=2]
- %exitcond = icmp eq i32 %indvar.next57, 40 ; <i1> [#uses=1]
- br i1 %exitcond, label %bb40.split, label %bb26.outer.us
-
-bb40.split: ; preds = %bb26.bb32_crit_edge.us, %entry
- %k.1.lcssa.lcssa.us-lcssa = phi i32 [ %k.0.us, %bb26.bb32_crit_edge.us ], [ 0, %entry ] ; <i32> [#uses=1]
- ret i32 %k.1.lcssa.lcssa.us-lcssa
-}
diff --git a/release_23/test/CodeGen/X86/loop-strength-reduce4.ll b/release_23/test/CodeGen/X86/loop-strength-reduce4.ll
deleted file mode 100644
index 711f223749ce..000000000000
--- a/release_23/test/CodeGen/X86/loop-strength-reduce4.ll
+++ /dev/null
@@ -1,49 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 | grep cmp | grep 64
-; RUN: llvm-as < %s | llc -march=x86 | not grep inc
-
-@state = external global [0 x i32] ; <[0 x i32]*> [#uses=4]
-@S = external global [0 x i32] ; <[0 x i32]*> [#uses=4]
-
-define i32 @foo() {
-entry:
- br label %bb
-
-bb: ; preds = %bb, %entry
- %indvar = phi i32 [ 0, %entry ], [ %indvar.next, %bb ] ; <i32> [#uses=2]
- %t.063.0 = phi i32 [ 0, %entry ], [ %tmp47, %bb ] ; <i32> [#uses=1]
- %j.065.0 = shl i32 %indvar, 2 ; <i32> [#uses=4]
- %tmp3 = getelementptr [0 x i32]* @state, i32 0, i32 %j.065.0 ; <i32*> [#uses=2]
- %tmp4 = load i32* %tmp3, align 4 ; <i32> [#uses=1]
- %tmp6 = getelementptr [0 x i32]* @S, i32 0, i32 %t.063.0 ; <i32*> [#uses=1]
- %tmp7 = load i32* %tmp6, align 4 ; <i32> [#uses=1]
- %tmp8 = xor i32 %tmp7, %tmp4 ; <i32> [#uses=2]
- store i32 %tmp8, i32* %tmp3, align 4
- %tmp1378 = or i32 %j.065.0, 1 ; <i32> [#uses=1]
- %tmp16 = getelementptr [0 x i32]* @state, i32 0, i32 %tmp1378 ; <i32*> [#uses=2]
- %tmp17 = load i32* %tmp16, align 4 ; <i32> [#uses=1]
- %tmp19 = getelementptr [0 x i32]* @S, i32 0, i32 %tmp8 ; <i32*> [#uses=1]
- %tmp20 = load i32* %tmp19, align 4 ; <i32> [#uses=1]
- %tmp21 = xor i32 %tmp20, %tmp17 ; <i32> [#uses=2]
- store i32 %tmp21, i32* %tmp16, align 4
- %tmp2680 = or i32 %j.065.0, 2 ; <i32> [#uses=1]
- %tmp29 = getelementptr [0 x i32]* @state, i32 0, i32 %tmp2680 ; <i32*> [#uses=2]
- %tmp30 = load i32* %tmp29, align 4 ; <i32> [#uses=1]
- %tmp32 = getelementptr [0 x i32]* @S, i32 0, i32 %tmp21 ; <i32*> [#uses=1]
- %tmp33 = load i32* %tmp32, align 4 ; <i32> [#uses=1]
- %tmp34 = xor i32 %tmp33, %tmp30 ; <i32> [#uses=2]
- store i32 %tmp34, i32* %tmp29, align 4
- %tmp3982 = or i32 %j.065.0, 3 ; <i32> [#uses=1]
- %tmp42 = getelementptr [0 x i32]* @state, i32 0, i32 %tmp3982 ; <i32*> [#uses=2]
- %tmp43 = load i32* %tmp42, align 4 ; <i32> [#uses=1]
- %tmp45 = getelementptr [0 x i32]* @S, i32 0, i32 %tmp34 ; <i32*> [#uses=1]
- %tmp46 = load i32* %tmp45, align 4 ; <i32> [#uses=1]
- %tmp47 = xor i32 %tmp46, %tmp43 ; <i32> [#uses=3]
- store i32 %tmp47, i32* %tmp42, align 4
- %indvar.next = add i32 %indvar, 1 ; <i32> [#uses=2]
- %exitcond = icmp eq i32 %indvar.next, 4 ; <i1> [#uses=1]
- br i1 %exitcond, label %bb57, label %bb
-
-bb57: ; preds = %bb
- %tmp59 = and i32 %tmp47, 255 ; <i32> [#uses=1]
- ret i32 %tmp59
-}
diff --git a/release_23/test/CodeGen/X86/loop-strength-reduce5.ll b/release_23/test/CodeGen/X86/loop-strength-reduce5.ll
deleted file mode 100644
index 6e037e2aca31..000000000000
--- a/release_23/test/CodeGen/X86/loop-strength-reduce5.ll
+++ /dev/null
@@ -1,23 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 | grep inc | count 1
-
-@X = weak global i16 0 ; <i16*> [#uses=1]
-@Y = weak global i16 0 ; <i16*> [#uses=1]
-
-define void @foo(i32 %N) {
-entry:
- %tmp1019 = icmp sgt i32 %N, 0 ; <i1> [#uses=1]
- br i1 %tmp1019, label %bb, label %return
-
-bb: ; preds = %bb, %entry
- %i.014.0 = phi i32 [ 0, %entry ], [ %indvar.next, %bb ] ; <i32> [#uses=2]
- %tmp1 = trunc i32 %i.014.0 to i16 ; <i16> [#uses=2]
- volatile store i16 %tmp1, i16* @X, align 2
- %tmp34 = shl i16 %tmp1, 2 ; <i16> [#uses=1]
- volatile store i16 %tmp34, i16* @Y, align 2
- %indvar.next = add i32 %i.014.0, 1 ; <i32> [#uses=2]
- %exitcond = icmp eq i32 %indvar.next, %N ; <i1> [#uses=1]
- br i1 %exitcond, label %return, label %bb
-
-return: ; preds = %bb, %entry
- ret void
-}
diff --git a/release_23/test/CodeGen/X86/loop-strength-reduce6.ll b/release_23/test/CodeGen/X86/loop-strength-reduce6.ll
deleted file mode 100644
index fa8b57aababb..000000000000
--- a/release_23/test/CodeGen/X86/loop-strength-reduce6.ll
+++ /dev/null
@@ -1,66 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86-64 | not grep inc
-
-define fastcc i32 @decodeMP3(i32 %isize, i32* %done) {
-entry:
- br i1 false, label %cond_next191, label %cond_true189
-
-cond_true189: ; preds = %entry
- ret i32 0
-
-cond_next191: ; preds = %entry
- br i1 false, label %cond_next37.i, label %cond_false.i9
-
-cond_false.i9: ; preds = %cond_next191
- ret i32 0
-
-cond_next37.i: ; preds = %cond_next191
- br i1 false, label %cond_false50.i, label %cond_true44.i
-
-cond_true44.i: ; preds = %cond_next37.i
- br i1 false, label %cond_true11.i.i, label %bb414.preheader.i
-
-cond_true11.i.i: ; preds = %cond_true44.i
- ret i32 0
-
-cond_false50.i: ; preds = %cond_next37.i
- ret i32 0
-
-bb414.preheader.i: ; preds = %cond_true44.i
- br i1 false, label %bb.i18, label %do_layer3.exit
-
-bb.i18: ; preds = %bb414.preheader.i
- br i1 false, label %bb358.i, label %cond_true79.i
-
-cond_true79.i: ; preds = %bb.i18
- ret i32 0
-
-bb331.i: ; preds = %bb358.i, %cond_true.i149.i
- br i1 false, label %cond_true.i149.i, label %cond_false.i151.i
-
-cond_true.i149.i: ; preds = %bb331.i
- br i1 false, label %bb178.preheader.i.i, label %bb331.i
-
-cond_false.i151.i: ; preds = %bb331.i
- ret i32 0
-
-bb163.i.i: ; preds = %bb178.preheader.i.i, %bb163.i.i
- %rawout2.451.rec.i.i = phi i64 [ 0, %bb178.preheader.i.i ], [ %indvar.next260.i, %bb163.i.i ] ; <i64> [#uses=2]
- %i.052.i.i = trunc i64 %rawout2.451.rec.i.i to i32 ; <i32> [#uses=1]
- %tmp165.i144.i = shl i32 %i.052.i.i, 5 ; <i32> [#uses=1]
- %tmp165169.i.i = sext i32 %tmp165.i144.i to i64 ; <i64> [#uses=0]
- %indvar.next260.i = add i64 %rawout2.451.rec.i.i, 1 ; <i64> [#uses=2]
- %exitcond261.i = icmp eq i64 %indvar.next260.i, 18 ; <i1> [#uses=1]
- br i1 %exitcond261.i, label %bb178.preheader.i.i, label %bb163.i.i
-
-bb178.preheader.i.i: ; preds = %bb163.i.i, %cond_true.i149.i
- br label %bb163.i.i
-
-bb358.i: ; preds = %bb.i18
- br i1 false, label %bb331.i, label %bb406.i
-
-bb406.i: ; preds = %bb358.i
- ret i32 0
-
-do_layer3.exit: ; preds = %bb414.preheader.i
- ret i32 0
-}
diff --git a/release_23/test/CodeGen/X86/lsr-negative-stride.ll b/release_23/test/CodeGen/X86/lsr-negative-stride.ll
deleted file mode 100644
index 7e906fc57a29..000000000000
--- a/release_23/test/CodeGen/X86/lsr-negative-stride.ll
+++ /dev/null
@@ -1,49 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 | not grep neg
-; RUN: llvm-as < %s | llc -march=x86 | not grep sub.*esp
-; RUN: llvm-as < %s | llc -march=x86 | not grep esi
-
-; This corresponds to:
-;int t(int a, int b) {
-; while (a != b) {
-; if (a > b)
-; a -= b;
-; else
-; b -= a;
-; }
-; return a;
-;}
-
-
-define i32 @t(i32 %a, i32 %b) {
-entry:
- %tmp1434 = icmp eq i32 %a, %b ; <i1> [#uses=1]
- br i1 %tmp1434, label %bb17, label %bb.outer
-
-bb.outer: ; preds = %cond_false, %entry
- %b_addr.021.0.ph = phi i32 [ %b, %entry ], [ %tmp10, %cond_false ] ; <i32> [#uses=5]
- %a_addr.026.0.ph = phi i32 [ %a, %entry ], [ %a_addr.026.0, %cond_false ] ; <i32> [#uses=1]
- br label %bb
-
-bb: ; preds = %cond_true, %bb.outer
- %indvar = phi i32 [ 0, %bb.outer ], [ %indvar.next, %cond_true ] ; <i32> [#uses=2]
- %tmp. = sub i32 0, %b_addr.021.0.ph ; <i32> [#uses=1]
- %tmp.40 = mul i32 %indvar, %tmp. ; <i32> [#uses=1]
- %a_addr.026.0 = add i32 %tmp.40, %a_addr.026.0.ph ; <i32> [#uses=6]
- %tmp3 = icmp sgt i32 %a_addr.026.0, %b_addr.021.0.ph ; <i1> [#uses=1]
- br i1 %tmp3, label %cond_true, label %cond_false
-
-cond_true: ; preds = %bb
- %tmp7 = sub i32 %a_addr.026.0, %b_addr.021.0.ph ; <i32> [#uses=2]
- %tmp1437 = icmp eq i32 %tmp7, %b_addr.021.0.ph ; <i1> [#uses=1]
- %indvar.next = add i32 %indvar, 1 ; <i32> [#uses=1]
- br i1 %tmp1437, label %bb17, label %bb
-
-cond_false: ; preds = %bb
- %tmp10 = sub i32 %b_addr.021.0.ph, %a_addr.026.0 ; <i32> [#uses=2]
- %tmp14 = icmp eq i32 %a_addr.026.0, %tmp10 ; <i1> [#uses=1]
- br i1 %tmp14, label %bb17, label %bb.outer
-
-bb17: ; preds = %cond_false, %cond_true, %entry
- %a_addr.026.1 = phi i32 [ %a, %entry ], [ %tmp7, %cond_true ], [ %a_addr.026.0, %cond_false ] ; <i32> [#uses=1]
- ret i32 %a_addr.026.1
-}
diff --git a/release_23/test/CodeGen/X86/memcpy.ll b/release_23/test/CodeGen/X86/memcpy.ll
deleted file mode 100644
index 97a2dd57c710..000000000000
--- a/release_23/test/CodeGen/X86/memcpy.ll
+++ /dev/null
@@ -1,17 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86-64 | grep call.*memcpy | count 2
-
-declare void @llvm.memcpy.i64(i8*, i8*, i64, i32)
-
-define i8* @my_memcpy(i8* %a, i8* %b, i64 %n) {
-entry:
- tail call void @llvm.memcpy.i64( i8* %a, i8* %b, i64 %n, i32 1 )
- ret i8* %a
-}
-
-define i8* @my_memcpy2(i64* %a, i64* %b, i64 %n) {
-entry:
- %tmp14 = bitcast i64* %a to i8*
- %tmp25 = bitcast i64* %b to i8*
- tail call void @llvm.memcpy.i64(i8* %tmp14, i8* %tmp25, i64 %n, i32 8 )
- ret i8* %tmp14
-}
diff --git a/release_23/test/CodeGen/X86/memmove-0.ll b/release_23/test/CodeGen/X86/memmove-0.ll
deleted file mode 100644
index a2b452dbdfc5..000000000000
--- a/release_23/test/CodeGen/X86/memmove-0.ll
+++ /dev/null
@@ -1,9 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -mtriple=i686-pc-linux-gnu | grep {call memcpy}
-
-declare void @llvm.memmove.i64(i8* %d, i8* %s, i64 %l, i32 %a)
-
-define void @foo(i8* noalias %d, i8* noalias %s, i64 %l)
-{
- call void @llvm.memmove.i64(i8* %d, i8* %s, i64 %l, i32 1)
- ret void
-}
diff --git a/release_23/test/CodeGen/X86/memmove-1.ll b/release_23/test/CodeGen/X86/memmove-1.ll
deleted file mode 100644
index 3b2debc247dd..000000000000
--- a/release_23/test/CodeGen/X86/memmove-1.ll
+++ /dev/null
@@ -1,9 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -mtriple=i686-pc-linux-gnu | grep {call memmove}
-
-declare void @llvm.memmove.i64(i8* %d, i8* %s, i64 %l, i32 %a)
-
-define void @foo(i8* %d, i8* %s, i64 %l)
-{
- call void @llvm.memmove.i64(i8* %d, i8* %s, i64 %l, i32 1)
- ret void
-}
diff --git a/release_23/test/CodeGen/X86/memmove-2.ll b/release_23/test/CodeGen/X86/memmove-2.ll
deleted file mode 100644
index 37bbe0b54133..000000000000
--- a/release_23/test/CodeGen/X86/memmove-2.ll
+++ /dev/null
@@ -1,9 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -mtriple=i686-pc-linux-gnu | not grep call
-
-declare void @llvm.memmove.i64(i8* %d, i8* %s, i64 %l, i32 %a)
-
-define void @foo(i8* noalias %d, i8* noalias %s)
-{
- call void @llvm.memmove.i64(i8* %d, i8* %s, i64 32, i32 1)
- ret void
-}
diff --git a/release_23/test/CodeGen/X86/memmove-3.ll b/release_23/test/CodeGen/X86/memmove-3.ll
deleted file mode 100644
index 2e692c7f60b7..000000000000
--- a/release_23/test/CodeGen/X86/memmove-3.ll
+++ /dev/null
@@ -1,9 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -mtriple=i686-pc-linux-gnu | grep {call memmove}
-
-declare void @llvm.memmove.i64(i8* %d, i8* %s, i64 %l, i32 %a)
-
-define void @foo(i8* %d, i8* %s)
-{
- call void @llvm.memmove.i64(i8* %d, i8* %s, i64 32, i32 1)
- ret void
-}
diff --git a/release_23/test/CodeGen/X86/memset64-on-x86-32.ll b/release_23/test/CodeGen/X86/memset64-on-x86-32.ll
deleted file mode 100644
index 7045c0faf0b9..000000000000
--- a/release_23/test/CodeGen/X86/memset64-on-x86-32.ll
+++ /dev/null
@@ -1,13 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 | grep stosb
-
-target triple = "i386-apple-darwin9"
- %struct.S = type { [80 x i8] }
-
-define %struct.S* @bork() {
-entry:
- call void @llvm.memset.i64( i8* null, i8 0, i64 80, i32 1 )
- ret %struct.S* null
-}
-
-declare void @llvm.memset.i64(i8*, i8, i64, i32) nounwind
-
diff --git a/release_23/test/CodeGen/X86/mfence.ll b/release_23/test/CodeGen/X86/mfence.ll
deleted file mode 100644
index 6abdbcedf266..000000000000
--- a/release_23/test/CodeGen/X86/mfence.ll
+++ /dev/null
@@ -1,20 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | not grep sfence
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | not grep lfence
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep mfence
-
-
-declare void @llvm.memory.barrier( i1 , i1 , i1 , i1 , i1)
-
-define void @test() {
- call void @llvm.memory.barrier( i1 true, i1 true, i1 false, i1 false, i1 true)
- call void @llvm.memory.barrier( i1 true, i1 false, i1 true, i1 false, i1 true)
- call void @llvm.memory.barrier( i1 true, i1 false, i1 false, i1 true, i1 true)
-
- call void @llvm.memory.barrier( i1 true, i1 true, i1 true, i1 false, i1 true)
- call void @llvm.memory.barrier( i1 true, i1 true, i1 false, i1 true, i1 true)
- call void @llvm.memory.barrier( i1 true, i1 false, i1 true, i1 true, i1 true)
-
- call void @llvm.memory.barrier( i1 true, i1 true, i1 true, i1 true , i1 true)
- call void @llvm.memory.barrier( i1 false, i1 false, i1 false, i1 false , i1 true)
- ret void
-}
diff --git a/release_23/test/CodeGen/X86/mingw-alloca.ll b/release_23/test/CodeGen/X86/mingw-alloca.ll
deleted file mode 100644
index a1ad936fa9de..000000000000
--- a/release_23/test/CodeGen/X86/mingw-alloca.ll
+++ /dev/null
@@ -1,27 +0,0 @@
-; RUN: llvm-as < %s | llc -o %t -f
-; RUN: grep __alloca %t | count 2
-; RUN: grep 4294967288 %t
-; RUN: grep {pushl %eax} %t
-; RUN: grep 8012 %t | count 2
-
-target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64"
-target triple = "i386-mingw32"
-
-define void @foo1(i32 %N) {
-entry:
- %tmp14 = alloca i32, i32 %N ; <i32*> [#uses=1]
- call void @bar1( i32* %tmp14 )
- ret void
-}
-
-declare void @bar1(i32*)
-
-define void @foo2(i32 inreg %N) {
-entry:
- %A2 = alloca [2000 x i32], align 16 ; <[2000 x i32]*> [#uses=1]
- %A2.sub = getelementptr [2000 x i32]* %A2, i32 0, i32 0 ; <i32*> [#uses=1]
- call void @bar2( i32* %A2.sub, i32 %N )
- ret void
-}
-
-declare void @bar2(i32*, i32)
diff --git a/release_23/test/CodeGen/X86/mmx-arg-passing.ll b/release_23/test/CodeGen/X86/mmx-arg-passing.ll
deleted file mode 100644
index 9496cbb8bbb8..000000000000
--- a/release_23/test/CodeGen/X86/mmx-arg-passing.ll
+++ /dev/null
@@ -1,24 +0,0 @@
-; RUN: llvm-as < %s | llc -mtriple=i386-apple-darwin -mattr=+mmx | grep mm0 | count 3
-; RUN: llvm-as < %s | llc -mtriple=i386-apple-darwin -mattr=+mmx | grep esp | count 1
-; RUN: llvm-as < %s | llc -mtriple=x86_64-apple-darwin -mattr=+mmx,+sse2 | grep xmm0
-; RUN: llvm-as < %s | llc -mtriple=x86_64-apple-darwin -mattr=+mmx,+sse2 | grep rdi
-; RUN: llvm-as < %s | llc -mtriple=x86_64-apple-darwin -mattr=+mmx,+sse2 | not grep movups
-;
-; On Darwin x86-32, v8i8, v4i16, v2i32 values are passed in MM[0-2].
-; On Darwin x86-32, v1i64 values are passed in memory.
-; On Darwin x86-64, v8i8, v4i16, v2i32 values are passed in XMM[0-7].
-; On Darwin x86-64, v1i64 values are passed in 64-bit GPRs.
-
-@u1 = external global <8 x i8>
-
-define void @t1(<8 x i8> %v1) nounwind {
- store <8 x i8> %v1, <8 x i8>* @u1, align 8
- ret void
-}
-
-@u2 = external global <1 x i64>
-
-define void @t2(<1 x i64> %v1) nounwind {
- store <1 x i64> %v1, <1 x i64>* @u2, align 8
- ret void
-}
diff --git a/release_23/test/CodeGen/X86/mmx-arg-passing2.ll b/release_23/test/CodeGen/X86/mmx-arg-passing2.ll
deleted file mode 100644
index aac614aa7b11..000000000000
--- a/release_23/test/CodeGen/X86/mmx-arg-passing2.ll
+++ /dev/null
@@ -1,24 +0,0 @@
-; RUN: llvm-as < %s | llc -mtriple=x86_64-apple-darwin -mattr=+mmx,+sse2 | grep movq2dq | count 1
-; RUN: llvm-as < %s | llc -mtriple=x86_64-apple-darwin -mattr=+mmx,+sse2 | grep movdq2q | count 2
-
-@g_v8qi = external global <8 x i8>
-
-define void @t1() nounwind {
- %tmp3 = load <8 x i8>* @g_v8qi, align 8
- %tmp4 = tail call i32 (...)* @pass_v8qi( <8 x i8> %tmp3 ) nounwind
- ret void
-}
-
-define void @t2(<8 x i8> %v1, <8 x i8> %v2) nounwind {
- %tmp3 = add <8 x i8> %v1, %v2
- %tmp4 = tail call i32 (...)* @pass_v8qi( <8 x i8> %tmp3 ) nounwind
- ret void
-}
-
-define void @t3() nounwind {
- call void @pass_v1di( <1 x i64> zeroinitializer )
- ret void
-}
-
-declare i32 @pass_v8qi(...)
-declare void @pass_v1di(<1 x i64>)
diff --git a/release_23/test/CodeGen/X86/mmx-arith.ll b/release_23/test/CodeGen/X86/mmx-arith.ll
deleted file mode 100644
index 501786ebc225..000000000000
--- a/release_23/test/CodeGen/X86/mmx-arith.ll
+++ /dev/null
@@ -1,131 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+mmx
-
-;; A basic sanity check to make sure that MMX arithmetic actually compiles.
-
-define void @foo(<8 x i8>* %A, <8 x i8>* %B) {
-entry:
- %tmp1 = load <8 x i8>* %A ; <<8 x i8>> [#uses=1]
- %tmp3 = load <8 x i8>* %B ; <<8 x i8>> [#uses=1]
- %tmp4 = add <8 x i8> %tmp1, %tmp3 ; <<8 x i8>> [#uses=2]
- store <8 x i8> %tmp4, <8 x i8>* %A
- %tmp7 = load <8 x i8>* %B ; <<8 x i8>> [#uses=1]
- %tmp12 = tail call <8 x i8> @llvm.x86.mmx.padds.b( <8 x i8> %tmp4, <8 x i8> %tmp7 ) ; <<8 x i8>> [#uses=2]
- store <8 x i8> %tmp12, <8 x i8>* %A
- %tmp16 = load <8 x i8>* %B ; <<8 x i8>> [#uses=1]
- %tmp21 = tail call <8 x i8> @llvm.x86.mmx.paddus.b( <8 x i8> %tmp12, <8 x i8> %tmp16 ) ; <<8 x i8>> [#uses=2]
- store <8 x i8> %tmp21, <8 x i8>* %A
- %tmp27 = load <8 x i8>* %B ; <<8 x i8>> [#uses=1]
- %tmp28 = sub <8 x i8> %tmp21, %tmp27 ; <<8 x i8>> [#uses=2]
- store <8 x i8> %tmp28, <8 x i8>* %A
- %tmp31 = load <8 x i8>* %B ; <<8 x i8>> [#uses=1]
- %tmp36 = tail call <8 x i8> @llvm.x86.mmx.psubs.b( <8 x i8> %tmp28, <8 x i8> %tmp31 ) ; <<8 x i8>> [#uses=2]
- store <8 x i8> %tmp36, <8 x i8>* %A
- %tmp40 = load <8 x i8>* %B ; <<8 x i8>> [#uses=1]
- %tmp45 = tail call <8 x i8> @llvm.x86.mmx.psubus.b( <8 x i8> %tmp36, <8 x i8> %tmp40 ) ; <<8 x i8>> [#uses=2]
- store <8 x i8> %tmp45, <8 x i8>* %A
- %tmp51 = load <8 x i8>* %B ; <<8 x i8>> [#uses=1]
- %tmp52 = mul <8 x i8> %tmp45, %tmp51 ; <<8 x i8>> [#uses=2]
- store <8 x i8> %tmp52, <8 x i8>* %A
- %tmp57 = load <8 x i8>* %B ; <<8 x i8>> [#uses=1]
- %tmp58 = and <8 x i8> %tmp52, %tmp57 ; <<8 x i8>> [#uses=2]
- store <8 x i8> %tmp58, <8 x i8>* %A
- %tmp63 = load <8 x i8>* %B ; <<8 x i8>> [#uses=1]
- %tmp64 = or <8 x i8> %tmp58, %tmp63 ; <<8 x i8>> [#uses=2]
- store <8 x i8> %tmp64, <8 x i8>* %A
- %tmp69 = load <8 x i8>* %B ; <<8 x i8>> [#uses=1]
- %tmp70 = xor <8 x i8> %tmp64, %tmp69 ; <<8 x i8>> [#uses=1]
- store <8 x i8> %tmp70, <8 x i8>* %A
- tail call void @llvm.x86.mmx.emms( )
- ret void
-}
-
-define void @baz(<2 x i32>* %A, <2 x i32>* %B) {
-entry:
- %tmp1 = load <2 x i32>* %A ; <<2 x i32>> [#uses=1]
- %tmp3 = load <2 x i32>* %B ; <<2 x i32>> [#uses=1]
- %tmp4 = add <2 x i32> %tmp1, %tmp3 ; <<2 x i32>> [#uses=2]
- store <2 x i32> %tmp4, <2 x i32>* %A
- %tmp9 = load <2 x i32>* %B ; <<2 x i32>> [#uses=1]
- %tmp10 = sub <2 x i32> %tmp4, %tmp9 ; <<2 x i32>> [#uses=2]
- store <2 x i32> %tmp10, <2 x i32>* %A
- %tmp15 = load <2 x i32>* %B ; <<2 x i32>> [#uses=1]
- %tmp16 = mul <2 x i32> %tmp10, %tmp15 ; <<2 x i32>> [#uses=2]
- store <2 x i32> %tmp16, <2 x i32>* %A
- %tmp21 = load <2 x i32>* %B ; <<2 x i32>> [#uses=1]
- %tmp22 = and <2 x i32> %tmp16, %tmp21 ; <<2 x i32>> [#uses=2]
- store <2 x i32> %tmp22, <2 x i32>* %A
- %tmp27 = load <2 x i32>* %B ; <<2 x i32>> [#uses=1]
- %tmp28 = or <2 x i32> %tmp22, %tmp27 ; <<2 x i32>> [#uses=2]
- store <2 x i32> %tmp28, <2 x i32>* %A
- %tmp33 = load <2 x i32>* %B ; <<2 x i32>> [#uses=1]
- %tmp34 = xor <2 x i32> %tmp28, %tmp33 ; <<2 x i32>> [#uses=1]
- store <2 x i32> %tmp34, <2 x i32>* %A
- tail call void @llvm.x86.mmx.emms( )
- ret void
-}
-
-define void @bar(<4 x i16>* %A, <4 x i16>* %B) {
-entry:
- %tmp1 = load <4 x i16>* %A ; <<4 x i16>> [#uses=1]
- %tmp3 = load <4 x i16>* %B ; <<4 x i16>> [#uses=1]
- %tmp4 = add <4 x i16> %tmp1, %tmp3 ; <<4 x i16>> [#uses=2]
- store <4 x i16> %tmp4, <4 x i16>* %A
- %tmp7 = load <4 x i16>* %B ; <<4 x i16>> [#uses=1]
- %tmp12 = tail call <4 x i16> @llvm.x86.mmx.padds.w( <4 x i16> %tmp4, <4 x i16> %tmp7 ) ; <<4 x i16>> [#uses=2]
- store <4 x i16> %tmp12, <4 x i16>* %A
- %tmp16 = load <4 x i16>* %B ; <<4 x i16>> [#uses=1]
- %tmp21 = tail call <4 x i16> @llvm.x86.mmx.paddus.w( <4 x i16> %tmp12, <4 x i16> %tmp16 ) ; <<4 x i16>> [#uses=2]
- store <4 x i16> %tmp21, <4 x i16>* %A
- %tmp27 = load <4 x i16>* %B ; <<4 x i16>> [#uses=1]
- %tmp28 = sub <4 x i16> %tmp21, %tmp27 ; <<4 x i16>> [#uses=2]
- store <4 x i16> %tmp28, <4 x i16>* %A
- %tmp31 = load <4 x i16>* %B ; <<4 x i16>> [#uses=1]
- %tmp36 = tail call <4 x i16> @llvm.x86.mmx.psubs.w( <4 x i16> %tmp28, <4 x i16> %tmp31 ) ; <<4 x i16>> [#uses=2]
- store <4 x i16> %tmp36, <4 x i16>* %A
- %tmp40 = load <4 x i16>* %B ; <<4 x i16>> [#uses=1]
- %tmp45 = tail call <4 x i16> @llvm.x86.mmx.psubus.w( <4 x i16> %tmp36, <4 x i16> %tmp40 ) ; <<4 x i16>> [#uses=2]
- store <4 x i16> %tmp45, <4 x i16>* %A
- %tmp51 = load <4 x i16>* %B ; <<4 x i16>> [#uses=1]
- %tmp52 = mul <4 x i16> %tmp45, %tmp51 ; <<4 x i16>> [#uses=2]
- store <4 x i16> %tmp52, <4 x i16>* %A
- %tmp55 = load <4 x i16>* %B ; <<4 x i16>> [#uses=1]
- %tmp60 = tail call <4 x i16> @llvm.x86.mmx.pmulh.w( <4 x i16> %tmp52, <4 x i16> %tmp55 ) ; <<4 x i16>> [#uses=2]
- store <4 x i16> %tmp60, <4 x i16>* %A
- %tmp64 = load <4 x i16>* %B ; <<4 x i16>> [#uses=1]
- %tmp69 = tail call <2 x i32> @llvm.x86.mmx.pmadd.wd( <4 x i16> %tmp60, <4 x i16> %tmp64 ) ; <<2 x i32>> [#uses=1]
- %tmp70 = bitcast <2 x i32> %tmp69 to <4 x i16> ; <<4 x i16>> [#uses=2]
- store <4 x i16> %tmp70, <4 x i16>* %A
- %tmp75 = load <4 x i16>* %B ; <<4 x i16>> [#uses=1]
- %tmp76 = and <4 x i16> %tmp70, %tmp75 ; <<4 x i16>> [#uses=2]
- store <4 x i16> %tmp76, <4 x i16>* %A
- %tmp81 = load <4 x i16>* %B ; <<4 x i16>> [#uses=1]
- %tmp82 = or <4 x i16> %tmp76, %tmp81 ; <<4 x i16>> [#uses=2]
- store <4 x i16> %tmp82, <4 x i16>* %A
- %tmp87 = load <4 x i16>* %B ; <<4 x i16>> [#uses=1]
- %tmp88 = xor <4 x i16> %tmp82, %tmp87 ; <<4 x i16>> [#uses=1]
- store <4 x i16> %tmp88, <4 x i16>* %A
- tail call void @llvm.x86.mmx.emms( )
- ret void
-}
-
-declare <8 x i8> @llvm.x86.mmx.padds.b(<8 x i8>, <8 x i8>)
-
-declare <8 x i8> @llvm.x86.mmx.paddus.b(<8 x i8>, <8 x i8>)
-
-declare <8 x i8> @llvm.x86.mmx.psubs.b(<8 x i8>, <8 x i8>)
-
-declare <8 x i8> @llvm.x86.mmx.psubus.b(<8 x i8>, <8 x i8>)
-
-declare <4 x i16> @llvm.x86.mmx.padds.w(<4 x i16>, <4 x i16>)
-
-declare <4 x i16> @llvm.x86.mmx.paddus.w(<4 x i16>, <4 x i16>)
-
-declare <4 x i16> @llvm.x86.mmx.psubs.w(<4 x i16>, <4 x i16>)
-
-declare <4 x i16> @llvm.x86.mmx.psubus.w(<4 x i16>, <4 x i16>)
-
-declare <4 x i16> @llvm.x86.mmx.pmulh.w(<4 x i16>, <4 x i16>)
-
-declare <2 x i32> @llvm.x86.mmx.pmadd.wd(<4 x i16>, <4 x i16>)
-
-declare void @llvm.x86.mmx.emms()
diff --git a/release_23/test/CodeGen/X86/mmx-bitcast-to-i64.ll b/release_23/test/CodeGen/X86/mmx-bitcast-to-i64.ll
deleted file mode 100644
index c6bb48927b69..000000000000
--- a/release_23/test/CodeGen/X86/mmx-bitcast-to-i64.ll
+++ /dev/null
@@ -1,26 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86-64 | grep movd | count 4
-
-define i64 @foo(<1 x i64>* %p) {
- %t = load <1 x i64>* %p
- %u = add <1 x i64> %t, %t
- %s = bitcast <1 x i64> %u to i64
- ret i64 %s
-}
-define i64 @goo(<2 x i32>* %p) {
- %t = load <2 x i32>* %p
- %u = add <2 x i32> %t, %t
- %s = bitcast <2 x i32> %u to i64
- ret i64 %s
-}
-define i64 @hoo(<4 x i16>* %p) {
- %t = load <4 x i16>* %p
- %u = add <4 x i16> %t, %t
- %s = bitcast <4 x i16> %u to i64
- ret i64 %s
-}
-define i64 @ioo(<8 x i8>* %p) {
- %t = load <8 x i8>* %p
- %u = add <8 x i8> %t, %t
- %s = bitcast <8 x i8> %u to i64
- ret i64 %s
-}
diff --git a/release_23/test/CodeGen/X86/mmx-copy-gprs.ll b/release_23/test/CodeGen/X86/mmx-copy-gprs.ll
deleted file mode 100644
index da17a04a466c..000000000000
--- a/release_23/test/CodeGen/X86/mmx-copy-gprs.ll
+++ /dev/null
@@ -1,15 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86-64 | grep {movq.*(%rsi), %rax}
-; RUN: llvm-as < %s | llc -march=x86 | grep {movl.*4(%eax),}
-
-; This test should use GPRs to copy the mmx value, not MMX regs. Using mmx regs,
-; increases the places that need to use emms.
-
-; rdar://5741668
-target triple = "x86_64-apple-darwin8"
-
-define void @foo(<1 x i64>* %x, <1 x i64>* %y) nounwind {
-entry:
- %tmp1 = load <1 x i64>* %y, align 8 ; <<1 x i64>> [#uses=1]
- store <1 x i64> %tmp1, <1 x i64>* %x, align 8
- ret void
-}
diff --git a/release_23/test/CodeGen/X86/mmx-emms.ll b/release_23/test/CodeGen/X86/mmx-emms.ll
deleted file mode 100644
index 60ba84d8728d..000000000000
--- a/release_23/test/CodeGen/X86/mmx-emms.ll
+++ /dev/null
@@ -1,11 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+mmx | grep emms
-define void @foo() {
-entry:
- call void @llvm.x86.mmx.emms( )
- br label %return
-
-return: ; preds = %entry
- ret void
-}
-
-declare void @llvm.x86.mmx.emms()
diff --git a/release_23/test/CodeGen/X86/mmx-insert-element.ll b/release_23/test/CodeGen/X86/mmx-insert-element.ll
deleted file mode 100644
index dc488363e7f5..000000000000
--- a/release_23/test/CodeGen/X86/mmx-insert-element.ll
+++ /dev/null
@@ -1,23 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+mmx | grep movq | count 3
-
-; FIXME: This code outputs:
-;
-; subl $28, %esp
-; movl 32(%esp), %eax
-; movd %eax, %mm0
-; movq %mm0, (%esp)
-; movl (%esp), %eax
-; movl %eax, 20(%esp)
-; movq %mm0, 8(%esp)
-; movl 12(%esp), %eax
-; movl %eax, 16(%esp)
-; movq 16(%esp), %mm0
-; addl $28, %esp
-;
-; Which is ugly. We need to fix this.
-
-define <2 x i32> @qux(i32 %A) nounwind {
-entry:
- %tmp3 = insertelement <2 x i32> < i32 0, i32 undef >, i32 %A, i32 1 ; <<2 x i32>> [#uses=1]
- ret <2 x i32> %tmp3
-}
diff --git a/release_23/test/CodeGen/X86/mmx-punpckhdq.ll b/release_23/test/CodeGen/X86/mmx-punpckhdq.ll
deleted file mode 100644
index 126fc9d13be9..000000000000
--- a/release_23/test/CodeGen/X86/mmx-punpckhdq.ll
+++ /dev/null
@@ -1,14 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+mmx | grep punpckhdq | count 1
-
-define void @bork(<1 x i64>* %x) {
-entry:
- %tmp2 = load <1 x i64>* %x ; <<1 x i64>> [#uses=1]
- %tmp6 = bitcast <1 x i64> %tmp2 to <2 x i32> ; <<2 x i32>> [#uses=1]
- %tmp9 = shufflevector <2 x i32> %tmp6, <2 x i32> undef, <2 x i32> < i32 1, i32 1 > ; <<2 x i32>> [#uses=1]
- %tmp10 = bitcast <2 x i32> %tmp9 to <1 x i64> ; <<1 x i64>> [#uses=1]
- store <1 x i64> %tmp10, <1 x i64>* %x
- tail call void @llvm.x86.mmx.emms( )
- ret void
-}
-
-declare void @llvm.x86.mmx.emms()
diff --git a/release_23/test/CodeGen/X86/mmx-shift.ll b/release_23/test/CodeGen/X86/mmx-shift.ll
deleted file mode 100644
index 277cf075cb93..000000000000
--- a/release_23/test/CodeGen/X86/mmx-shift.ll
+++ /dev/null
@@ -1,32 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+mmx | grep psllq | grep 32
-; RUN: llvm-as < %s | llc -march=x86-64 -mattr=+mmx | grep psllq | grep 32
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+mmx | grep psrad
-; RUN: llvm-as < %s | llc -march=x86-64 -mattr=+mmx | grep psrlw
-
-define i64 @t1(<1 x i64> %mm1) nounwind {
-entry:
- %tmp6 = tail call <1 x i64> @llvm.x86.mmx.pslli.q( <1 x i64> %mm1, i32 32 ) ; <<1 x i64>> [#uses=1]
- %retval1112 = bitcast <1 x i64> %tmp6 to i64 ; <i64> [#uses=1]
- ret i64 %retval1112
-}
-
-declare <1 x i64> @llvm.x86.mmx.pslli.q(<1 x i64>, i32) nounwind readnone
-
-define i64 @t2(<2 x i32> %mm1, <2 x i32> %mm2) nounwind {
-entry:
- %tmp7 = tail call <2 x i32> @llvm.x86.mmx.psra.d( <2 x i32> %mm1, <2 x i32> %mm2 ) nounwind readnone ; <<2 x i32>> [#uses=1]
- %retval1112 = bitcast <2 x i32> %tmp7 to i64 ; <i64> [#uses=1]
- ret i64 %retval1112
-}
-
-declare <2 x i32> @llvm.x86.mmx.psra.d(<2 x i32>, <2 x i32>) nounwind readnone
-
-define i64 @t3(<1 x i64> %mm1, i32 %bits) nounwind {
-entry:
- %tmp6 = bitcast <1 x i64> %mm1 to <4 x i16> ; <<4 x i16>> [#uses=1]
- %tmp8 = tail call <4 x i16> @llvm.x86.mmx.psrli.w( <4 x i16> %tmp6, i32 %bits ) nounwind readnone ; <<4 x i16>> [#uses=1]
- %retval1314 = bitcast <4 x i16> %tmp8 to i64 ; <i64> [#uses=1]
- ret i64 %retval1314
-}
-
-declare <4 x i16> @llvm.x86.mmx.psrli.w(<4 x i16>, i32) nounwind readnone
diff --git a/release_23/test/CodeGen/X86/mmx-shuffle.ll b/release_23/test/CodeGen/X86/mmx-shuffle.ll
deleted file mode 100644
index 4b91cb901939..000000000000
--- a/release_23/test/CodeGen/X86/mmx-shuffle.ll
+++ /dev/null
@@ -1,29 +0,0 @@
-; RUN: llvm-as < %s | llc -mcpu=yonah
-; PR1427
-
-target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64"
-target triple = "i686-pc-linux-gnu"
- %struct.DrawHelper = type { void (i32, %struct.QT_FT_Span*, i8*)*, void (i32, %struct.QT_FT_Span*, i8*)*, void (%struct.QRasterBuffer*, i32, i32, i32, i8*, i32, i32, i32)*, void (%struct.QRasterBuffer*, i32, i32, i32, i8*, i32, i32, i32)*, void (%struct.QRasterBuffer*, i32, i32, i32, i32, i32)* }
- %struct.QBasicAtomic = type { i32 }
- %struct.QClipData = type { i32, "struct.QClipData::ClipLine"*, i32, i32, %struct.QT_FT_Span*, i32, i32, i32, i32 }
- "struct.QClipData::ClipLine" = type { i32, %struct.QT_FT_Span* }
- %struct.QRasterBuffer = type { %struct.QRect, %struct.QRegion, %struct.QClipData*, %struct.QClipData*, i8, i32, i32, %struct.DrawHelper*, i32, i32, i32, i8* }
- %struct.QRect = type { i32, i32, i32, i32 }
- %struct.QRegion = type { "struct.QRegion::QRegionData"* }
- "struct.QRegion::QRegionData" = type { %struct.QBasicAtomic, %struct._XRegion*, i8*, %struct.QRegionPrivate* }
- %struct.QRegionPrivate = type opaque
- %struct.QT_FT_Span = type { i16, i16, i16, i8 }
- %struct._XRegion = type opaque
-
-define void @_Z19qt_bitmapblit16_sseP13QRasterBufferiijPKhiii(%struct.QRasterBuffer* %rasterBuffer, i32 %x, i32 %y, i32 %color, i8* %src, i32 %width, i32 %height, i32 %stride) {
-entry:
- %tmp528 = bitcast <8 x i8> zeroinitializer to <2 x i32> ; <<2 x i32>> [#uses=1]
- %tmp529 = and <2 x i32> %tmp528, bitcast (<4 x i16> < i16 -32640, i16 16448, i16 8224, i16 4112 > to <2 x i32>) ; <<2 x i32>> [#uses=1]
- %tmp542 = bitcast <2 x i32> %tmp529 to <4 x i16> ; <<4 x i16>> [#uses=1]
- %tmp543 = add <4 x i16> %tmp542, < i16 0, i16 16448, i16 24672, i16 28784 > ; <<4 x i16>> [#uses=1]
- %tmp555 = bitcast <4 x i16> %tmp543 to <8 x i8> ; <<8 x i8>> [#uses=1]
- tail call void @llvm.x86.mmx.maskmovq( <8 x i8> zeroinitializer, <8 x i8> %tmp555, i8* null )
- ret void
-}
-
-declare void @llvm.x86.mmx.maskmovq(<8 x i8>, <8 x i8>, i8*)
diff --git a/release_23/test/CodeGen/X86/mul-legalize.ll b/release_23/test/CodeGen/X86/mul-legalize.ll
deleted file mode 100644
index b3f9cd8bb351..000000000000
--- a/release_23/test/CodeGen/X86/mul-legalize.ll
+++ /dev/null
@@ -1,27 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 | grep cmov | count 1
-; PR2135
-
-target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32"
-target triple = "i386-pc-linux-gnu"
-@.str = constant [13 x i8] c"c45531m.adb\00\00"
-
-define void @main() {
-entry:
- %tmp1 = call i1 @report__equal( i32 3, i32 3 )
- %b.0 = select i1 %tmp1, i64 35184372088832, i64 0
- %tmp7 = mul i64 3, %b.0
- %tmp32 = icmp eq i64 %tmp7, 105553116266496
- br i1 %tmp32, label %return, label %bb35
-bb35:
- call void @abort( )
- unreachable
-return:
- ret void
-}
-
-define i1 @report__equal(i32 %x, i32 %y) {
- %tmp = icmp eq i32 %x, %y
- ret i1 %tmp
-}
-
-declare void @abort()
diff --git a/release_23/test/CodeGen/X86/mul-remat.ll b/release_23/test/CodeGen/X86/mul-remat.ll
deleted file mode 100644
index ffc8cc0ba6bc..000000000000
--- a/release_23/test/CodeGen/X86/mul-remat.ll
+++ /dev/null
@@ -1,8 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 | grep mov | count 1
-; PR1874
-
-define i32 @test(i32 %a, i32 %b) {
-entry:
- %tmp3 = mul i32 %b, %a
- ret i32 %tmp3
-}
diff --git a/release_23/test/CodeGen/X86/mul-shift-reassoc.ll b/release_23/test/CodeGen/X86/mul-shift-reassoc.ll
deleted file mode 100644
index f0ecb5bd08ee..000000000000
--- a/release_23/test/CodeGen/X86/mul-shift-reassoc.ll
+++ /dev/null
@@ -1,12 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 | grep lea
-; RUN: llvm-as < %s | llc -march=x86 | not grep add
-
-define i32 @test(i32 %X, i32 %Y) {
- ; Push the shl through the mul to allow an LEA to be formed, instead
- ; of using a shift and add separately.
- %tmp.2 = shl i32 %X, 1 ; <i32> [#uses=1]
- %tmp.3 = mul i32 %tmp.2, %Y ; <i32> [#uses=1]
- %tmp.5 = add i32 %tmp.3, %Y ; <i32> [#uses=1]
- ret i32 %tmp.5
-}
-
diff --git a/release_23/test/CodeGen/X86/mul128.ll b/release_23/test/CodeGen/X86/mul128.ll
deleted file mode 100644
index c0ce6b309315..000000000000
--- a/release_23/test/CodeGen/X86/mul128.ll
+++ /dev/null
@@ -1,6 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86-64 | grep mul | count 3
-
-define i128 @foo(i128 %t, i128 %u) {
- %k = mul i128 %t, %u
- ret i128 %k
-}
diff --git a/release_23/test/CodeGen/X86/mul64.ll b/release_23/test/CodeGen/X86/mul64.ll
deleted file mode 100644
index cd0f802a711e..000000000000
--- a/release_23/test/CodeGen/X86/mul64.ll
+++ /dev/null
@@ -1,6 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 | grep mul | count 3
-
-define i64 @foo(i64 %t, i64 %u) {
- %k = mul i64 %t, %u
- ret i64 %k
-}
diff --git a/release_23/test/CodeGen/X86/multiple-return-values-cross-block.ll b/release_23/test/CodeGen/X86/multiple-return-values-cross-block.ll
deleted file mode 100644
index f632b8744335..000000000000
--- a/release_23/test/CodeGen/X86/multiple-return-values-cross-block.ll
+++ /dev/null
@@ -1,15 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86
-
-declare {x86_fp80, x86_fp80} @test()
-
-define void @call2(x86_fp80 *%P1, x86_fp80 *%P2) {
- %a = call {x86_fp80,x86_fp80} @test()
- %b = getresult {x86_fp80,x86_fp80} %a, 1
- store x86_fp80 %b, x86_fp80* %P1
-br label %L
-
-L:
- %c = getresult {x86_fp80,x86_fp80} %a, 0
- store x86_fp80 %c, x86_fp80* %P2
- ret void
-}
diff --git a/release_23/test/CodeGen/X86/multiple-return-values.ll b/release_23/test/CodeGen/X86/multiple-return-values.ll
deleted file mode 100644
index 2e754a8febc2..000000000000
--- a/release_23/test/CodeGen/X86/multiple-return-values.ll
+++ /dev/null
@@ -1,16 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86
-
-define {i64, float} @bar(i64 %a, float %b) {
- %y = add i64 %a, 7
- %z = add float %b, 7.0
- ret i64 %y, float %z
-}
-
-define i64 @foo() {
- %M = call {i64, float} @bar(i64 21, float 21.0)
- %N = getresult {i64, float} %M, 0
- %O = getresult {i64, float} %M, 1
- %P = fptosi float %O to i64
- %Q = add i64 %P, %N
- ret i64 %Q
-}
diff --git a/release_23/test/CodeGen/X86/nancvt.ll b/release_23/test/CodeGen/X86/nancvt.ll
deleted file mode 100644
index 9e5b73d6f320..000000000000
--- a/release_23/test/CodeGen/X86/nancvt.ll
+++ /dev/null
@@ -1,180 +0,0 @@
-; RUN: llvm-as < %s | opt -std-compile-opts | llc | grep 2147027116 | count 3
-; RUN: llvm-as < %s | opt -std-compile-opts | llc | grep 2147228864 | count 3
-; RUN: llvm-as < %s | opt -std-compile-opts | llc | grep 2146502828 | count 3
-; RUN: llvm-as < %s | opt -std-compile-opts | llc | grep 2143034560 | count 3
-; Compile time conversions of NaNs.
-; ModuleID = 'nan2.c'
-target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
-target triple = "i686-apple-darwin8"
- %struct..0anon = type { float }
- %struct..1anon = type { double }
-@fnan = constant [3 x i32] [ i32 2143831397, i32 2143831396, i32 2143831398 ] ; <[3 x i32]*> [#uses=1]
-@dnan = constant [3 x i64] [ i64 9223235251041752696, i64 9223235251041752697, i64 9223235250773317239 ], align 8 ; <[3 x i64]*> [#uses=1]
-@fsnan = constant [3 x i32] [ i32 2139637093, i32 2139637092, i32 2139637094 ] ; <[3 x i32]*> [#uses=1]
-@dsnan = constant [3 x i64] [ i64 9220983451228067448, i64 9220983451228067449, i64 9220983450959631991 ], align 8 ; <[3 x i64]*> [#uses=1]
-@.str = internal constant [10 x i8] c"%08x%08x\0A\00" ; <[10 x i8]*> [#uses=2]
-@.str1 = internal constant [6 x i8] c"%08x\0A\00" ; <[6 x i8]*> [#uses=2]
-
-define i32 @main() {
-entry:
- %retval = alloca i32, align 4 ; <i32*> [#uses=1]
- %i = alloca i32, align 4 ; <i32*> [#uses=20]
- %uf = alloca %struct..0anon, align 4 ; <%struct..0anon*> [#uses=8]
- %ud = alloca %struct..1anon, align 8 ; <%struct..1anon*> [#uses=10]
- %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
- store i32 0, i32* %i, align 4
- br label %bb23
-
-bb: ; preds = %bb23
- %tmp = load i32* %i, align 4 ; <i32> [#uses=1]
- %tmp1 = getelementptr [3 x i32]* @fnan, i32 0, i32 %tmp ; <i32*> [#uses=1]
- %tmp2 = load i32* %tmp1, align 4 ; <i32> [#uses=1]
- %tmp3 = getelementptr %struct..0anon* %uf, i32 0, i32 0 ; <float*> [#uses=1]
- %tmp34 = bitcast float* %tmp3 to i32* ; <i32*> [#uses=1]
- store i32 %tmp2, i32* %tmp34, align 4
- %tmp5 = getelementptr %struct..0anon* %uf, i32 0, i32 0 ; <float*> [#uses=1]
- %tmp6 = load float* %tmp5, align 4 ; <float> [#uses=1]
- %tmp67 = fpext float %tmp6 to double ; <double> [#uses=1]
- %tmp8 = getelementptr %struct..1anon* %ud, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp67, double* %tmp8, align 8
- %tmp9 = getelementptr %struct..1anon* %ud, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp910 = bitcast double* %tmp9 to i64* ; <i64*> [#uses=1]
- %tmp11 = load i64* %tmp910, align 8 ; <i64> [#uses=1]
- %tmp1112 = trunc i64 %tmp11 to i32 ; <i32> [#uses=1]
- %tmp13 = and i32 %tmp1112, -1 ; <i32> [#uses=1]
- %tmp14 = getelementptr %struct..1anon* %ud, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp1415 = bitcast double* %tmp14 to i64* ; <i64*> [#uses=1]
- %tmp16 = load i64* %tmp1415, align 8 ; <i64> [#uses=1]
- %.cast = zext i32 32 to i64 ; <i64> [#uses=1]
- %tmp17 = ashr i64 %tmp16, %.cast ; <i64> [#uses=1]
- %tmp1718 = trunc i64 %tmp17 to i32 ; <i32> [#uses=1]
- %tmp19 = getelementptr [10 x i8]* @.str, i32 0, i32 0 ; <i8*> [#uses=1]
- %tmp20 = call i32 (i8*, ...)* @printf( i8* %tmp19, i32 %tmp1718, i32 %tmp13 ) ; <i32> [#uses=0]
- %tmp21 = load i32* %i, align 4 ; <i32> [#uses=1]
- %tmp22 = add i32 %tmp21, 1 ; <i32> [#uses=1]
- store i32 %tmp22, i32* %i, align 4
- br label %bb23
-
-bb23: ; preds = %bb, %entry
- %tmp24 = load i32* %i, align 4 ; <i32> [#uses=1]
- %tmp25 = icmp sle i32 %tmp24, 2 ; <i1> [#uses=1]
- %tmp2526 = zext i1 %tmp25 to i8 ; <i8> [#uses=1]
- %toBool = icmp ne i8 %tmp2526, 0 ; <i1> [#uses=1]
- br i1 %toBool, label %bb, label %bb27
-
-bb27: ; preds = %bb23
- store i32 0, i32* %i, align 4
- br label %bb46
-
-bb28: ; preds = %bb46
- %tmp29 = load i32* %i, align 4 ; <i32> [#uses=1]
- %tmp30 = getelementptr [3 x i64]* @dnan, i32 0, i32 %tmp29 ; <i64*> [#uses=1]
- %tmp31 = load i64* %tmp30, align 8 ; <i64> [#uses=1]
- %tmp32 = getelementptr %struct..1anon* %ud, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp3233 = bitcast double* %tmp32 to i64* ; <i64*> [#uses=1]
- store i64 %tmp31, i64* %tmp3233, align 8
- %tmp35 = getelementptr %struct..1anon* %ud, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp36 = load double* %tmp35, align 8 ; <double> [#uses=1]
- %tmp3637 = fptrunc double %tmp36 to float ; <float> [#uses=1]
- %tmp38 = getelementptr %struct..0anon* %uf, i32 0, i32 0 ; <float*> [#uses=1]
- store float %tmp3637, float* %tmp38, align 4
- %tmp39 = getelementptr %struct..0anon* %uf, i32 0, i32 0 ; <float*> [#uses=1]
- %tmp3940 = bitcast float* %tmp39 to i32* ; <i32*> [#uses=1]
- %tmp41 = load i32* %tmp3940, align 4 ; <i32> [#uses=1]
- %tmp42 = getelementptr [6 x i8]* @.str1, i32 0, i32 0 ; <i8*> [#uses=1]
- %tmp43 = call i32 (i8*, ...)* @printf( i8* %tmp42, i32 %tmp41 ) ; <i32> [#uses=0]
- %tmp44 = load i32* %i, align 4 ; <i32> [#uses=1]
- %tmp45 = add i32 %tmp44, 1 ; <i32> [#uses=1]
- store i32 %tmp45, i32* %i, align 4
- br label %bb46
-
-bb46: ; preds = %bb28, %bb27
- %tmp47 = load i32* %i, align 4 ; <i32> [#uses=1]
- %tmp48 = icmp sle i32 %tmp47, 2 ; <i1> [#uses=1]
- %tmp4849 = zext i1 %tmp48 to i8 ; <i8> [#uses=1]
- %toBool50 = icmp ne i8 %tmp4849, 0 ; <i1> [#uses=1]
- br i1 %toBool50, label %bb28, label %bb51
-
-bb51: ; preds = %bb46
- store i32 0, i32* %i, align 4
- br label %bb78
-
-bb52: ; preds = %bb78
- %tmp53 = load i32* %i, align 4 ; <i32> [#uses=1]
- %tmp54 = getelementptr [3 x i32]* @fsnan, i32 0, i32 %tmp53 ; <i32*> [#uses=1]
- %tmp55 = load i32* %tmp54, align 4 ; <i32> [#uses=1]
- %tmp56 = getelementptr %struct..0anon* %uf, i32 0, i32 0 ; <float*> [#uses=1]
- %tmp5657 = bitcast float* %tmp56 to i32* ; <i32*> [#uses=1]
- store i32 %tmp55, i32* %tmp5657, align 4
- %tmp58 = getelementptr %struct..0anon* %uf, i32 0, i32 0 ; <float*> [#uses=1]
- %tmp59 = load float* %tmp58, align 4 ; <float> [#uses=1]
- %tmp5960 = fpext float %tmp59 to double ; <double> [#uses=1]
- %tmp61 = getelementptr %struct..1anon* %ud, i32 0, i32 0 ; <double*> [#uses=1]
- store double %tmp5960, double* %tmp61, align 8
- %tmp62 = getelementptr %struct..1anon* %ud, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp6263 = bitcast double* %tmp62 to i64* ; <i64*> [#uses=1]
- %tmp64 = load i64* %tmp6263, align 8 ; <i64> [#uses=1]
- %tmp6465 = trunc i64 %tmp64 to i32 ; <i32> [#uses=1]
- %tmp66 = and i32 %tmp6465, -1 ; <i32> [#uses=1]
- %tmp68 = getelementptr %struct..1anon* %ud, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp6869 = bitcast double* %tmp68 to i64* ; <i64*> [#uses=1]
- %tmp70 = load i64* %tmp6869, align 8 ; <i64> [#uses=1]
- %.cast71 = zext i32 32 to i64 ; <i64> [#uses=1]
- %tmp72 = ashr i64 %tmp70, %.cast71 ; <i64> [#uses=1]
- %tmp7273 = trunc i64 %tmp72 to i32 ; <i32> [#uses=1]
- %tmp74 = getelementptr [10 x i8]* @.str, i32 0, i32 0 ; <i8*> [#uses=1]
- %tmp75 = call i32 (i8*, ...)* @printf( i8* %tmp74, i32 %tmp7273, i32 %tmp66 ) ; <i32> [#uses=0]
- %tmp76 = load i32* %i, align 4 ; <i32> [#uses=1]
- %tmp77 = add i32 %tmp76, 1 ; <i32> [#uses=1]
- store i32 %tmp77, i32* %i, align 4
- br label %bb78
-
-bb78: ; preds = %bb52, %bb51
- %tmp79 = load i32* %i, align 4 ; <i32> [#uses=1]
- %tmp80 = icmp sle i32 %tmp79, 2 ; <i1> [#uses=1]
- %tmp8081 = zext i1 %tmp80 to i8 ; <i8> [#uses=1]
- %toBool82 = icmp ne i8 %tmp8081, 0 ; <i1> [#uses=1]
- br i1 %toBool82, label %bb52, label %bb83
-
-bb83: ; preds = %bb78
- store i32 0, i32* %i, align 4
- br label %bb101
-
-bb84: ; preds = %bb101
- %tmp85 = load i32* %i, align 4 ; <i32> [#uses=1]
- %tmp86 = getelementptr [3 x i64]* @dsnan, i32 0, i32 %tmp85 ; <i64*> [#uses=1]
- %tmp87 = load i64* %tmp86, align 8 ; <i64> [#uses=1]
- %tmp88 = getelementptr %struct..1anon* %ud, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp8889 = bitcast double* %tmp88 to i64* ; <i64*> [#uses=1]
- store i64 %tmp87, i64* %tmp8889, align 8
- %tmp90 = getelementptr %struct..1anon* %ud, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp91 = load double* %tmp90, align 8 ; <double> [#uses=1]
- %tmp9192 = fptrunc double %tmp91 to float ; <float> [#uses=1]
- %tmp93 = getelementptr %struct..0anon* %uf, i32 0, i32 0 ; <float*> [#uses=1]
- store float %tmp9192, float* %tmp93, align 4
- %tmp94 = getelementptr %struct..0anon* %uf, i32 0, i32 0 ; <float*> [#uses=1]
- %tmp9495 = bitcast float* %tmp94 to i32* ; <i32*> [#uses=1]
- %tmp96 = load i32* %tmp9495, align 4 ; <i32> [#uses=1]
- %tmp97 = getelementptr [6 x i8]* @.str1, i32 0, i32 0 ; <i8*> [#uses=1]
- %tmp98 = call i32 (i8*, ...)* @printf( i8* %tmp97, i32 %tmp96 ) ; <i32> [#uses=0]
- %tmp99 = load i32* %i, align 4 ; <i32> [#uses=1]
- %tmp100 = add i32 %tmp99, 1 ; <i32> [#uses=1]
- store i32 %tmp100, i32* %i, align 4
- br label %bb101
-
-bb101: ; preds = %bb84, %bb83
- %tmp102 = load i32* %i, align 4 ; <i32> [#uses=1]
- %tmp103 = icmp sle i32 %tmp102, 2 ; <i1> [#uses=1]
- %tmp103104 = zext i1 %tmp103 to i8 ; <i8> [#uses=1]
- %toBool105 = icmp ne i8 %tmp103104, 0 ; <i1> [#uses=1]
- br i1 %toBool105, label %bb84, label %bb106
-
-bb106: ; preds = %bb101
- br label %return
-
-return: ; preds = %bb106
- %retval107 = load i32* %retval ; <i32> [#uses=1]
- ret i32 %retval107
-}
-
-declare i32 @printf(i8*, ...)
diff --git a/release_23/test/CodeGen/X86/negative-sin.ll b/release_23/test/CodeGen/X86/negative-sin.ll
deleted file mode 100644
index 39c62973def9..000000000000
--- a/release_23/test/CodeGen/X86/negative-sin.ll
+++ /dev/null
@@ -1,12 +0,0 @@
-; RUN: llvm-as < %s | llc -enable-unsafe-fp-math -march=x86-64 | \
-; RUN: not egrep {addsd|subsd|xor}
-
-declare double @sin(double %f)
-
-define double @foo(double %e)
-{
- %f = sub double 0.0, %e
- %g = call double @sin(double %f)
- %h = sub double 0.0, %g
- ret double %h
-}
diff --git a/release_23/test/CodeGen/X86/negative_zero.ll b/release_23/test/CodeGen/X86/negative_zero.ll
deleted file mode 100644
index 3c47b8f1fddd..000000000000
--- a/release_23/test/CodeGen/X86/negative_zero.ll
+++ /dev/null
@@ -1,6 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -mattr=-sse2,-sse3 | grep fchs
-
-
-define double @T() {
- ret double -1.0 ;; codegen as fld1/fchs, not as a load from cst pool
-}
diff --git a/release_23/test/CodeGen/X86/nofence.ll b/release_23/test/CodeGen/X86/nofence.ll
deleted file mode 100644
index 132ac9437da9..000000000000
--- a/release_23/test/CodeGen/X86/nofence.ll
+++ /dev/null
@@ -1,27 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | not grep fence
-
-declare void @llvm.memory.barrier( i1 , i1 , i1 , i1 , i1)
-
-define void @test() {
- call void @llvm.memory.barrier( i1 true, i1 false, i1 false, i1 false, i1 false)
- call void @llvm.memory.barrier( i1 false, i1 true, i1 false, i1 false, i1 false)
- call void @llvm.memory.barrier( i1 false, i1 false, i1 true, i1 false, i1 false)
- call void @llvm.memory.barrier( i1 false, i1 false, i1 false, i1 true, i1 false)
-
- call void @llvm.memory.barrier( i1 true, i1 true, i1 false, i1 false, i1 false)
- call void @llvm.memory.barrier( i1 true, i1 false, i1 true, i1 false, i1 false)
- call void @llvm.memory.barrier( i1 true, i1 false, i1 false, i1 true, i1 false)
- call void @llvm.memory.barrier( i1 false, i1 true, i1 true, i1 false, i1 false)
- call void @llvm.memory.barrier( i1 false, i1 true, i1 false, i1 true, i1 false)
- call void @llvm.memory.barrier( i1 false, i1 false, i1 true, i1 true, i1 false)
-
- call void @llvm.memory.barrier( i1 true, i1 true, i1 true, i1 false, i1 false)
- call void @llvm.memory.barrier( i1 true, i1 true, i1 false, i1 true, i1 false)
- call void @llvm.memory.barrier( i1 true, i1 false, i1 true, i1 true, i1 false)
- call void @llvm.memory.barrier( i1 false, i1 true, i1 true, i1 true, i1 false)
-
-
- call void @llvm.memory.barrier( i1 true, i1 true, i1 true, i1 true , i1 false)
- call void @llvm.memory.barrier( i1 false, i1 false, i1 false, i1 false , i1 false)
- ret void
-}
diff --git a/release_23/test/CodeGen/X86/opt-ext-uses.ll b/release_23/test/CodeGen/X86/opt-ext-uses.ll
deleted file mode 100644
index 322850c5523f..000000000000
--- a/release_23/test/CodeGen/X86/opt-ext-uses.ll
+++ /dev/null
@@ -1,19 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 | grep movw | count 1
-
-define i16 @t() signext {
-entry:
- %tmp180 = load i16* null, align 2 ; <i16> [#uses=3]
- %tmp180181 = sext i16 %tmp180 to i32 ; <i32> [#uses=1]
- %tmp182 = add i16 %tmp180, 10
- %tmp185 = icmp slt i16 %tmp182, 0 ; <i1> [#uses=1]
- br i1 %tmp185, label %cond_true188, label %cond_next245
-
-cond_true188: ; preds = %entry
- %tmp195196 = trunc i16 %tmp180 to i8 ; <i8> [#uses=0]
- ret i16 %tmp180
-
-cond_next245: ; preds = %entry
- %tmp256 = and i32 %tmp180181, 15 ; <i32> [#uses=0]
- %tmp3 = trunc i32 %tmp256 to i16
- ret i16 %tmp3
-}
diff --git a/release_23/test/CodeGen/X86/or-branch.ll b/release_23/test/CodeGen/X86/or-branch.ll
deleted file mode 100644
index 20886d5793ca..000000000000
--- a/release_23/test/CodeGen/X86/or-branch.ll
+++ /dev/null
@@ -1,19 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 | not grep set
-
-define void @foo(i32 %X, i32 %Y, i32 %Z) nounwind {
-entry:
- %tmp = tail call i32 (...)* @bar( ) ; <i32> [#uses=0]
- %tmp.upgrd.1 = icmp eq i32 %X, 0 ; <i1> [#uses=1]
- %tmp3 = icmp slt i32 %Y, 5 ; <i1> [#uses=1]
- %tmp4 = or i1 %tmp3, %tmp.upgrd.1 ; <i1> [#uses=1]
- br i1 %tmp4, label %cond_true, label %UnifiedReturnBlock
-
-cond_true: ; preds = %entry
- %tmp5 = tail call i32 (...)* @bar( ) ; <i32> [#uses=0]
- ret void
-
-UnifiedReturnBlock: ; preds = %entry
- ret void
-}
-
-declare i32 @bar(...)
diff --git a/release_23/test/CodeGen/X86/overlap-shift.ll b/release_23/test/CodeGen/X86/overlap-shift.ll
deleted file mode 100644
index 7584a70b5a7d..000000000000
--- a/release_23/test/CodeGen/X86/overlap-shift.ll
+++ /dev/null
@@ -1,19 +0,0 @@
-;; X's live range extends beyond the shift, so the register allocator
-;; cannot coalesce it with Y. Because of this, a copy needs to be
-;; emitted before the shift to save the register value before it is
-;; clobbered. However, this copy is not needed if the register
-;; allocator turns the shift into an LEA. This also occurs for ADD.
-
-; Check that the shift gets turned into an LEA.
-
-; RUN: llvm-as < %s | llc -march=x86 -x86-asm-syntax=intel | \
-; RUN: not grep {mov E.X, E.X}
-
-@G = external global i32 ; <i32*> [#uses=1]
-
-define i32 @test1(i32 %X) {
- %Z = shl i32 %X, 2 ; <i32> [#uses=1]
- volatile store i32 %Z, i32* @G
- ret i32 %X
-}
-
diff --git a/release_23/test/CodeGen/X86/packed_struct.ll b/release_23/test/CodeGen/X86/packed_struct.ll
deleted file mode 100644
index aea631896a8c..000000000000
--- a/release_23/test/CodeGen/X86/packed_struct.ll
+++ /dev/null
@@ -1,33 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 | grep foos+5
-; RUN: llvm-as < %s | llc -march=x86 | grep foos+1
-; RUN: llvm-as < %s | llc -march=x86 | grep foos+9
-; RUN: llvm-as < %s | llc -march=x86 | grep bara+19
-; RUN: llvm-as < %s | llc -march=x86 | grep bara+4
-
-; make sure we compute the correct offset for a packed structure
-
-;Note: codegen for this could change rendering the above checks wrong
-
-target datalayout = "e-p:32:32"
-target triple = "i686-pc-linux-gnu"
- %struct.anon = type <{ i8, i32, i32, i32 }>
-@foos = external global %struct.anon ; <%struct.anon*> [#uses=3]
-@bara = weak global [4 x <{ i32, i8 }>] zeroinitializer ; <[4 x <{ i32, i8 }>]*> [#uses=2]
-
-define i32 @foo() {
-entry:
- %tmp = load i32* getelementptr (%struct.anon* @foos, i32 0, i32 1) ; <i32> [#uses=1]
- %tmp3 = load i32* getelementptr (%struct.anon* @foos, i32 0, i32 2) ; <i32> [#uses=1]
- %tmp6 = load i32* getelementptr (%struct.anon* @foos, i32 0, i32 3) ; <i32> [#uses=1]
- %tmp4 = add i32 %tmp3, %tmp ; <i32> [#uses=1]
- %tmp7 = add i32 %tmp4, %tmp6 ; <i32> [#uses=1]
- ret i32 %tmp7
-}
-
-define i8 @bar() {
-entry:
- %tmp = load i8* getelementptr ([4 x <{ i32, i8 }>]* @bara, i32 0, i32 0, i32 1) ; <i8> [#uses=1]
- %tmp4 = load i8* getelementptr ([4 x <{ i32, i8 }>]* @bara, i32 0, i32 3, i32 1) ; <i8> [#uses=1]
- %tmp5 = add i8 %tmp4, %tmp ; <i8> [#uses=1]
- ret i8 %tmp5
-}
diff --git a/release_23/test/CodeGen/X86/peep-vector-extract-concat.ll b/release_23/test/CodeGen/X86/peep-vector-extract-concat.ll
deleted file mode 100644
index e6c88bbff9d5..000000000000
--- a/release_23/test/CodeGen/X86/peep-vector-extract-concat.ll
+++ /dev/null
@@ -1,6 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86-64 -mattr=+sse2,-sse41 | grep {pshufd \$3, %xmm0, %xmm0}
-
-define float @foo(<8 x float> %a) nounwind {
- %c = extractelement <8 x float> %a, i32 3
- ret float %c
-}
diff --git a/release_23/test/CodeGen/X86/peep-vector-extract-insert.ll b/release_23/test/CodeGen/X86/peep-vector-extract-insert.ll
deleted file mode 100644
index 77332d02a933..000000000000
--- a/release_23/test/CodeGen/X86/peep-vector-extract-insert.ll
+++ /dev/null
@@ -1,12 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86-64 | grep {pxor %xmm0, %xmm0} | count 2
-
-define float @foo(<4 x float> %a) {
- %b = insertelement <4 x float> %a, float 0.0, i32 3
- %c = extractelement <4 x float> %b, i32 3
- ret float %c
-}
-define float @bar(float %a) {
- %b = insertelement <4 x float> <float 0x400B333340000000, float 4.5, float 0.0, float 0x4022666660000000>, float %a, i32 3
- %c = extractelement <4 x float> %b, i32 2
- ret float %c
-}
diff --git a/release_23/test/CodeGen/X86/pic-1.ll b/release_23/test/CodeGen/X86/pic-1.ll
deleted file mode 100644
index ab07718ad237..000000000000
--- a/release_23/test/CodeGen/X86/pic-1.ll
+++ /dev/null
@@ -1,19 +0,0 @@
-; RUN: llvm-as < %s | \
-; RUN: llc -mtriple=i686-pc-linux-gnu -relocation-model=pic -o %t -f
-; RUN: grep _GLOBAL_OFFSET_TABLE_ %t
-; RUN: grep piclabel %t | count 3
-; RUN: grep GOT %t | count 3
-; RUN: not grep GOTOFF %t
-
-@ptr = external global i32*
-@dst = external global i32
-@src = external global i32
-
-define void @foo() {
-entry:
- store i32* @dst, i32** @ptr
- %tmp.s = load i32* @src
- store i32 %tmp.s, i32* @dst
- ret void
-}
-
diff --git a/release_23/test/CodeGen/X86/pic-2.ll b/release_23/test/CodeGen/X86/pic-2.ll
deleted file mode 100644
index 40899b35b8a9..000000000000
--- a/release_23/test/CodeGen/X86/pic-2.ll
+++ /dev/null
@@ -1,18 +0,0 @@
-; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic \
-; RUN: -o %t -f
-; RUN: grep _GLOBAL_OFFSET_TABLE_ %t
-; RUN: grep piclabel %t | count 3
-; RUN: grep GOTOFF %t | count 4
-
-@ptr = internal global i32* null
-@dst = internal global i32 0
-@src = internal global i32 0
-
-define void @foo() {
-entry:
- store i32* @dst, i32** @ptr
- %tmp.s = load i32* @src
- store i32 %tmp.s, i32* @dst
- ret void
-}
-
diff --git a/release_23/test/CodeGen/X86/pic-3.ll b/release_23/test/CodeGen/X86/pic-3.ll
deleted file mode 100644
index bbec68209ba1..000000000000
--- a/release_23/test/CodeGen/X86/pic-3.ll
+++ /dev/null
@@ -1,15 +0,0 @@
-; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic \
-; RUN: -o %t -f
-; RUN: grep _GLOBAL_OFFSET_TABLE_ %t
-; RUN: grep piclabel %t | count 3
-; RUN: grep PLT %t | count 1
-
-define void @bar() {
-entry:
- call void(...)* @foo()
- br label %return
-return:
- ret void
-}
-
-declare void @foo(...)
diff --git a/release_23/test/CodeGen/X86/pic-4.ll b/release_23/test/CodeGen/X86/pic-4.ll
deleted file mode 100644
index 49b9000f1272..000000000000
--- a/release_23/test/CodeGen/X86/pic-4.ll
+++ /dev/null
@@ -1,22 +0,0 @@
-; RUN: llvm-as < %s | \
-; RUN: llc -mtriple=i686-pc-linux-gnu -relocation-model=pic -o %t -f
-; RUN: grep _GLOBAL_OFFSET_TABLE_ %t
-; RUN: grep piclabel %t | count 3
-; RUN: grep PLT %t | count 1
-; RUN: grep GOT %t | count 1
-; RUN: not grep GOTOFF %t
-
-@pfoo = external global void(...)*
-
-define void @bar() {
-entry:
- %tmp = call void(...)*(...)* @afoo()
- store void(...)* %tmp, void(...)** @pfoo
- %tmp1 = load void(...)** @pfoo
- call void(...)* %tmp1()
- br label %return
-return:
- ret void
-}
-
-declare void(...)* @afoo(...)
diff --git a/release_23/test/CodeGen/X86/pic-5.ll b/release_23/test/CodeGen/X86/pic-5.ll
deleted file mode 100644
index 3f7e16934db9..000000000000
--- a/release_23/test/CodeGen/X86/pic-5.ll
+++ /dev/null
@@ -1,14 +0,0 @@
-; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic \
-; RUN: -o %t -f
-; RUN: grep _GLOBAL_OFFSET_TABLE_ %t
-; RUN: grep piclabel %t | count 3
-; RUN: grep PLT %t | count 1
-
-@ptr = external global i32*
-
-define void @foo() {
-entry:
- %ptr = malloc i32, i32 10
- ret void
-}
-
diff --git a/release_23/test/CodeGen/X86/pic-6.ll b/release_23/test/CodeGen/X86/pic-6.ll
deleted file mode 100644
index d55da1f4c6af..000000000000
--- a/release_23/test/CodeGen/X86/pic-6.ll
+++ /dev/null
@@ -1,18 +0,0 @@
-; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic \
-; RUN: -o %t -f
-; RUN: grep _GLOBAL_OFFSET_TABLE_ %t
-; RUN: grep piclabel %t | count 3
-; RUN: grep GOT %t | count 3
-
-@ptr = global i32* null
-@dst = global i32 0
-@src = global i32 0
-
-define void @foo() {
-entry:
- store i32* @dst, i32** @ptr
- %tmp.s = load i32* @src
- store i32 %tmp.s, i32* @dst
- ret void
-}
-
diff --git a/release_23/test/CodeGen/X86/pic-cpool.ll b/release_23/test/CodeGen/X86/pic-cpool.ll
deleted file mode 100644
index cac31ed2ad74..000000000000
--- a/release_23/test/CodeGen/X86/pic-cpool.ll
+++ /dev/null
@@ -1,14 +0,0 @@
-; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic \
-; RUN: -o %t -f
-; RUN: grep _GLOBAL_OFFSET_TABLE_ %t
-; RUN: grep piclabel %t | count 3
-; RUN: grep GOTOFF %t | count 2
-; RUN: grep CPI %t | count 4
-
-define double @foo(i32 %a.u) {
-entry:
- %tmp = icmp eq i32 %a.u,0
- %retval = select i1 %tmp, double 4.561230e+02, double 1.234560e+02
- ret double %retval
-}
-
diff --git a/release_23/test/CodeGen/X86/pic-jtbl.ll b/release_23/test/CodeGen/X86/pic-jtbl.ll
deleted file mode 100644
index e23f7c1a9fc2..000000000000
--- a/release_23/test/CodeGen/X86/pic-jtbl.ll
+++ /dev/null
@@ -1,58 +0,0 @@
-; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic \
-; RUN: -o %t -f
-; RUN: grep _GLOBAL_OFFSET_TABLE_ %t
-; RUN: grep piclabel %t | count 3
-; RUN: grep PLT %t | count 6
-; RUN: grep GOTOFF %t | count 14
-; RUN: grep JTI %t | count 2
-
-define void @bar(i32 %n.u) {
-entry:
- switch i32 %n.u, label %bb12 [i32 1, label %bb i32 2, label %bb6 i32 4, label %bb7 i32 5, label %bb8 i32 6, label %bb10 i32 7, label %bb1 i32 8, label %bb3 i32 9, label %bb4 i32 10, label %bb9 i32 11, label %bb2 i32 12, label %bb5 i32 13, label %bb11 ]
-bb:
- tail call void(...)* @foo1()
- ret void
-bb1:
- tail call void(...)* @foo2()
- ret void
-bb2:
- tail call void(...)* @foo6()
- ret void
-bb3:
- tail call void(...)* @foo3()
- ret void
-bb4:
- tail call void(...)* @foo4()
- ret void
-bb5:
- tail call void(...)* @foo5()
- ret void
-bb6:
- tail call void(...)* @foo1()
- ret void
-bb7:
- tail call void(...)* @foo2()
- ret void
-bb8:
- tail call void(...)* @foo6()
- ret void
-bb9:
- tail call void(...)* @foo3()
- ret void
-bb10:
- tail call void(...)* @foo4()
- ret void
-bb11:
- tail call void(...)* @foo5()
- ret void
-bb12:
- tail call void(...)* @foo6()
- ret void
-}
-
-declare void @foo1(...)
-declare void @foo2(...)
-declare void @foo6(...)
-declare void @foo3(...)
-declare void @foo4(...)
-declare void @foo5(...)
diff --git a/release_23/test/CodeGen/X86/pic-load-remat.ll b/release_23/test/CodeGen/X86/pic-load-remat.ll
deleted file mode 100644
index cb4e64044ded..000000000000
--- a/release_23/test/CodeGen/X86/pic-load-remat.ll
+++ /dev/null
@@ -1,47 +0,0 @@
-; RUN: llvm-as < %s | llc -mtriple=i686-apple-darwin -mattr=+sse2 -relocation-model=pic | grep psllw | grep pb
-
-define void @f() nounwind {
-entry:
- br label %bb
-
-bb: ; preds = %bb, %entry
- %tmp4403 = tail call <8 x i16> @llvm.x86.sse2.psubs.w( <8 x i16> zeroinitializer, <8 x i16> zeroinitializer ) nounwind readnone ; <<8 x i16>> [#uses=2]
- %tmp4443 = tail call <8 x i16> @llvm.x86.sse2.padds.w( <8 x i16> zeroinitializer, <8 x i16> zeroinitializer ) nounwind readnone ; <<8 x i16>> [#uses=1]
- %tmp4609 = tail call <8 x i16> @llvm.x86.sse2.psll.w( <8 x i16> zeroinitializer, <8 x i16> bitcast (<4 x i32> < i32 3, i32 5, i32 6, i32 9 > to <8 x i16>) ) ; <<8 x i16>> [#uses=1]
- %tmp4651 = add <8 x i16> %tmp4609, < i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1 > ; <<8 x i16>> [#uses=1]
- %tmp4658 = tail call <8 x i16> @llvm.x86.sse2.psll.w( <8 x i16> %tmp4651, <8 x i16> bitcast (<4 x i32> < i32 4, i32 1, i32 2, i32 3 > to <8 x i16>) ) ; <<8 x i16>> [#uses=1]
- %tmp4669 = tail call <8 x i16> @llvm.x86.sse2.pavg.w( <8 x i16> < i16 -23170, i16 -23170, i16 -23170, i16 -23170, i16 -23170, i16 -23170, i16 -23170, i16 -23170 >, <8 x i16> %tmp4443 ) nounwind readnone ; <<8 x i16>> [#uses=2]
- %tmp4679 = tail call <8 x i16> @llvm.x86.sse2.padds.w( <8 x i16> %tmp4669, <8 x i16> %tmp4669 ) nounwind readnone ; <<8 x i16>> [#uses=1]
- %tmp4689 = add <8 x i16> %tmp4679, %tmp4658 ; <<8 x i16>> [#uses=1]
- %tmp4700 = tail call <8 x i16> @llvm.x86.sse2.padds.w( <8 x i16> %tmp4689, <8 x i16> zeroinitializer ) nounwind readnone ; <<8 x i16>> [#uses=1]
- %tmp4708 = bitcast <8 x i16> %tmp4700 to <2 x i64> ; <<2 x i64>> [#uses=1]
- %tmp4772 = add <8 x i16> zeroinitializer, < i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1 > ; <<8 x i16>> [#uses=1]
- %tmp4779 = tail call <8 x i16> @llvm.x86.sse2.psll.w( <8 x i16> %tmp4772, <8 x i16> bitcast (<4 x i32> < i32 3, i32 5, i32 undef, i32 7 > to <8 x i16>) ) ; <<8 x i16>> [#uses=1]
- %tmp4810 = add <8 x i16> zeroinitializer, %tmp4779 ; <<8 x i16>> [#uses=1]
- %tmp4821 = tail call <8 x i16> @llvm.x86.sse2.padds.w( <8 x i16> %tmp4810, <8 x i16> zeroinitializer ) nounwind readnone ; <<8 x i16>> [#uses=1]
- %tmp4829 = bitcast <8 x i16> %tmp4821 to <2 x i64> ; <<2 x i64>> [#uses=1]
- %tmp4900 = tail call <8 x i16> @llvm.x86.sse2.psll.w( <8 x i16> zeroinitializer, <8 x i16> bitcast (<4 x i32> < i32 1, i32 1, i32 2, i32 2 > to <8 x i16>) ) ; <<8 x i16>> [#uses=1]
- %tmp4911 = tail call <8 x i16> @llvm.x86.sse2.pavg.w( <8 x i16> < i16 -23170, i16 -23170, i16 -23170, i16 -23170, i16 -23170, i16 -23170, i16 -23170, i16 -23170 >, <8 x i16> zeroinitializer ) nounwind readnone ; <<8 x i16>> [#uses=2]
- %tmp4921 = tail call <8 x i16> @llvm.x86.sse2.padds.w( <8 x i16> %tmp4911, <8 x i16> %tmp4911 ) nounwind readnone ; <<8 x i16>> [#uses=1]
- %tmp4931 = add <8 x i16> %tmp4921, %tmp4900 ; <<8 x i16>> [#uses=1]
- %tmp4942 = tail call <8 x i16> @llvm.x86.sse2.padds.w( <8 x i16> %tmp4931, <8 x i16> zeroinitializer ) nounwind readnone ; <<8 x i16>> [#uses=1]
- %tmp4950 = bitcast <8 x i16> %tmp4942 to <2 x i64> ; <<2 x i64>> [#uses=1]
- %tmp4957 = tail call <8 x i16> @llvm.x86.sse2.padds.w( <8 x i16> %tmp4403, <8 x i16> zeroinitializer ) nounwind readnone ; <<8 x i16>> [#uses=1]
- %tmp4958 = bitcast <8 x i16> %tmp4957 to <2 x i64> ; <<2 x i64>> [#uses=1]
- %tmp4967 = tail call <8 x i16> @llvm.x86.sse2.psubs.w( <8 x i16> %tmp4403, <8 x i16> zeroinitializer ) nounwind readnone ; <<8 x i16>> [#uses=1]
- %tmp4968 = bitcast <8 x i16> %tmp4967 to <2 x i64> ; <<2 x i64>> [#uses=1]
- store <2 x i64> %tmp4829, <2 x i64>* null, align 16
- store <2 x i64> %tmp4958, <2 x i64>* null, align 16
- store <2 x i64> %tmp4968, <2 x i64>* null, align 16
- store <2 x i64> %tmp4950, <2 x i64>* null, align 16
- store <2 x i64> %tmp4708, <2 x i64>* null, align 16
- br label %bb
-}
-
-declare <8 x i16> @llvm.x86.sse2.psll.w(<8 x i16>, <8 x i16>) nounwind readnone
-
-declare <8 x i16> @llvm.x86.sse2.pavg.w(<8 x i16>, <8 x i16>) nounwind readnone
-
-declare <8 x i16> @llvm.x86.sse2.padds.w(<8 x i16>, <8 x i16>) nounwind readnone
-
-declare <8 x i16> @llvm.x86.sse2.psubs.w(<8 x i16>, <8 x i16>) nounwind readnone
diff --git a/release_23/test/CodeGen/X86/pic_jumptable.ll b/release_23/test/CodeGen/X86/pic_jumptable.ll
deleted file mode 100644
index 553021dc90dc..000000000000
--- a/release_23/test/CodeGen/X86/pic_jumptable.ll
+++ /dev/null
@@ -1,76 +0,0 @@
-; RUN: llvm-as < %s | llc -relocation-model=pic -mtriple=i386-linux-gnu | not grep -F .text
-; RUN: llvm-as < %s | llc -relocation-model=pic -mtriple=i686-apple-darwin | not grep lea
-; RUN: llvm-as < %s | llc -relocation-model=pic -mtriple=i686-apple-darwin | grep add | count 2
-
-declare void @_Z3bari(i32)
-
-define linkonce void @_Z3fooILi1EEvi(i32 %Y) {
-entry:
- %Y_addr = alloca i32 ; <i32*> [#uses=2]
- %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
- store i32 %Y, i32* %Y_addr
- %tmp = load i32* %Y_addr ; <i32> [#uses=1]
- switch i32 %tmp, label %bb10 [
- i32 0, label %bb3
- i32 1, label %bb
- i32 2, label %bb
- i32 3, label %bb
- i32 4, label %bb
- i32 5, label %bb
- i32 6, label %bb
- i32 7, label %bb
- i32 8, label %bb
- i32 9, label %bb
- i32 10, label %bb
- i32 12, label %bb1
- i32 13, label %bb5
- i32 14, label %bb6
- i32 16, label %bb2
- i32 17, label %bb4
- i32 23, label %bb8
- i32 27, label %bb7
- i32 34, label %bb9
- ]
-
-bb: ; preds = %entry, %entry, %entry, %entry, %entry, %entry, %entry, %entry, %entry, %entry
- br label %bb1
-
-bb1: ; preds = %bb, %entry
- br label %bb2
-
-bb2: ; preds = %bb1, %entry
- call void @_Z3bari( i32 1 )
- br label %bb11
-
-bb3: ; preds = %entry
- br label %bb4
-
-bb4: ; preds = %bb3, %entry
- br label %bb5
-
-bb5: ; preds = %bb4, %entry
- br label %bb6
-
-bb6: ; preds = %bb5, %entry
- call void @_Z3bari( i32 2 )
- br label %bb11
-
-bb7: ; preds = %entry
- br label %bb8
-
-bb8: ; preds = %bb7, %entry
- br label %bb9
-
-bb9: ; preds = %bb8, %entry
- call void @_Z3bari( i32 3 )
- br label %bb11
-
-bb10: ; preds = %entry
- br label %bb11
-
-bb11: ; preds = %bb10, %bb9, %bb6, %bb2
- br label %return
-
-return: ; preds = %bb11
- ret void
-}
diff --git a/release_23/test/CodeGen/X86/postalloc-coalescing.ll b/release_23/test/CodeGen/X86/postalloc-coalescing.ll
deleted file mode 100644
index 9c44a5a7075d..000000000000
--- a/release_23/test/CodeGen/X86/postalloc-coalescing.ll
+++ /dev/null
@@ -1,35 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 | grep mov | count 3
-
-define fastcc i32 @_Z18yy_get_next_bufferv() {
-entry:
- br label %bb131
-
-bb116: ; preds = %bb131
- %tmp125126 = trunc i32 %c.1 to i8 ; <i8> [#uses=1]
- store i8 %tmp125126, i8* null, align 1
- br label %bb131
-
-bb131: ; preds = %bb116, %entry
- %c.2 = phi i32 [ %c.1, %bb116 ], [ 42, %entry ] ; <i32> [#uses=1]
- %c.1 = select i1 false, i32 0, i32 %c.2 ; <i32> [#uses=4]
- %tmp181 = icmp eq i32 %c.1, -1 ; <i1> [#uses=1]
- br i1 %tmp181, label %bb158, label %bb116
-
-bb158: ; preds = %bb131
- br i1 true, label %cond_true163, label %cond_next178
-
-cond_true163: ; preds = %bb158
- %tmp172173 = trunc i32 %c.1 to i8 ; <i8> [#uses=1]
- store i8 %tmp172173, i8* null, align 1
- br label %cond_next178
-
-cond_next178: ; preds = %cond_true163, %bb158
- %tmp180 = icmp eq i32 %c.1, -1 ; <i1> [#uses=1]
- br i1 %tmp180, label %cond_next184, label %cond_next199
-
-cond_next184: ; preds = %cond_next178
- ret i32 0
-
-cond_next199: ; preds = %cond_next178
- ret i32 0
-}
diff --git a/release_23/test/CodeGen/X86/pr1462.ll b/release_23/test/CodeGen/X86/pr1462.ll
deleted file mode 100644
index 7f9037a137df..000000000000
--- a/release_23/test/CodeGen/X86/pr1462.ll
+++ /dev/null
@@ -1,25 +0,0 @@
-; RUN: llvm-as < %s | llc
-; PR1462
-
-target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-
-v64:64:64-v128:128:128-a0:0:64"
-target triple = "x86_64-unknown-linux-gnu"
-
-define hidden i128 @__addvti3(i128 %a1, i128 %b2) {
-entry:
- %tmp8 = add i128 %b2, %a1 ; <i128> [#uses=3]
- %tmp10 = icmp sgt i128 %b2, -1 ; <i1> [#uses=1]
- %tmp18 = icmp sgt i128 %tmp8, %a1 ; <i1> [#uses=1]
- %tmp14 = icmp slt i128 %tmp8, %a1 ; <i1> [#uses=1]
- %iftmp.0.0.in = select i1 %tmp10, i1 %tmp14, i1 %tmp18 ; <i1> [#uses=1]
- br i1 %iftmp.0.0.in, label %cond_true22, label %cond_next23
-
-cond_true22: ; preds = %entry
- tail call void @abort( )
- unreachable
-
-cond_next23: ; preds = %entry
- ret i128 %tmp8
-}
-
-declare void @abort()
diff --git a/release_23/test/CodeGen/X86/pr1489.ll b/release_23/test/CodeGen/X86/pr1489.ll
deleted file mode 100644
index a7f3e795c697..000000000000
--- a/release_23/test/CodeGen/X86/pr1489.ll
+++ /dev/null
@@ -1,55 +0,0 @@
-; RUN: llvm-as < %s | llc -disable-fp-elim -fast -mcpu=i486 | grep 1082126238 | count 3
-; RUN: llvm-as < %s | llc -disable-fp-elim -fast -mcpu=i486 | grep 3058016715 | count 1
-;; magic constants are 3.999f and half of 3.999
-; ModuleID = '1489.c'
-target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64"
-target triple = "i686-apple-darwin8"
-@.str = internal constant [13 x i8] c"%d %d %d %d\0A\00" ; <[13 x i8]*> [#uses=1]
-
-define i32 @quux() {
-entry:
- %tmp1 = tail call i32 @lrintf( float 0x400FFDF3C0000000 ) ; <i32> [#uses=1]
- %tmp2 = icmp slt i32 %tmp1, 1 ; <i1> [#uses=1]
- %tmp23 = zext i1 %tmp2 to i32 ; <i32> [#uses=1]
- ret i32 %tmp23
-}
-
-declare i32 @lrintf(float)
-
-define i32 @foo() {
-entry:
- %tmp1 = tail call i32 @lrint( double 3.999000e+00 ) ; <i32> [#uses=1]
- %tmp2 = icmp slt i32 %tmp1, 1 ; <i1> [#uses=1]
- %tmp23 = zext i1 %tmp2 to i32 ; <i32> [#uses=1]
- ret i32 %tmp23
-}
-
-declare i32 @lrint(double)
-
-define i32 @bar() {
-entry:
- %tmp1 = tail call i32 @lrintf( float 0x400FFDF3C0000000 ) ; <i32> [#uses=1]
- %tmp2 = icmp slt i32 %tmp1, 1 ; <i1> [#uses=1]
- %tmp23 = zext i1 %tmp2 to i32 ; <i32> [#uses=1]
- ret i32 %tmp23
-}
-
-define i32 @baz() {
-entry:
- %tmp1 = tail call i32 @lrintf( float 0x400FFDF3C0000000 ) ; <i32> [#uses=1]
- %tmp2 = icmp slt i32 %tmp1, 1 ; <i1> [#uses=1]
- %tmp23 = zext i1 %tmp2 to i32 ; <i32> [#uses=1]
- ret i32 %tmp23
-}
-
-define i32 @main() {
-entry:
- %tmp = tail call i32 @baz( ) ; <i32> [#uses=1]
- %tmp1 = tail call i32 @bar( ) ; <i32> [#uses=1]
- %tmp2 = tail call i32 @foo( ) ; <i32> [#uses=1]
- %tmp3 = tail call i32 @quux( ) ; <i32> [#uses=1]
- %tmp5 = tail call i32 (i8*, ...)* @printf( i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0), i32 %tmp3, i32 %tmp2, i32 %tmp1, i32 %tmp ) ; <i32> [#uses=0]
- ret i32 undef
-}
-
-declare i32 @printf(i8*, ...)
diff --git a/release_23/test/CodeGen/X86/pr1505.ll b/release_23/test/CodeGen/X86/pr1505.ll
deleted file mode 100644
index e9e3d9060958..000000000000
--- a/release_23/test/CodeGen/X86/pr1505.ll
+++ /dev/null
@@ -1,12 +0,0 @@
-; RUN: llvm-as < %s | llc -mcpu=i486 | not grep fldl
-; PR1505
-
-target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64"
-target triple = "i686-apple-darwin8"
-@G = weak global float 0.000000e+00 ; <float*> [#uses=1]
-
-define void @t1(float %F) {
-entry:
- store float %F, float* @G
- ret void
-}
diff --git a/release_23/test/CodeGen/X86/pr1505b.ll b/release_23/test/CodeGen/X86/pr1505b.ll
deleted file mode 100644
index c70e32760216..000000000000
--- a/release_23/test/CodeGen/X86/pr1505b.ll
+++ /dev/null
@@ -1,59 +0,0 @@
-; RUN: llvm-as < %s | llc -mcpu=i486 | grep fstpl | count 4
-; RUN: llvm-as < %s | llc -mcpu=i486 | grep fstps | count 3
-; PR1505
-
-target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64"
-target triple = "i686-apple-darwin8"
- %"struct.std::basic_ios<char,std::char_traits<char> >" = type { %"struct.std::ios_base", %"struct.std::basic_ostream<char,std::char_traits<char> >"*, i8, i8, %"struct.std::basic_streambuf<char,std::char_traits<char> >"*, %"struct.std::ctype<char>"*, %"struct.std::num_get<char,std::istreambuf_iterator<char, std::char_traits<char> > >"*, %"struct.std::num_get<char,std::istreambuf_iterator<char, std::char_traits<char> > >"* }
- %"struct.std::basic_ostream<char,std::char_traits<char> >" = type { i32 (...)**, %"struct.std::basic_ios<char,std::char_traits<char> >" }
- %"struct.std::basic_streambuf<char,std::char_traits<char> >" = type { i32 (...)**, i8*, i8*, i8*, i8*, i8*, i8*, %"struct.std::locale" }
- %"struct.std::ctype<char>" = type { %"struct.std::locale::facet", i32*, i8, i32*, i32*, i32*, i8, [256 x i8], [256 x i8], i8 }
- %"struct.std::ctype_base" = type <{ i8 }>
- %"struct.std::ios_base" = type { i32 (...)**, i32, i32, i32, i32, i32, %"struct.std::ios_base::_Callback_list"*, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, %"struct.std::ios_base::_Words"*, %"struct.std::locale" }
- %"struct.std::ios_base::_Callback_list" = type { %"struct.std::ios_base::_Callback_list"*, void (i32, %"struct.std::ios_base"*, i32)*, i32, i32 }
- %"struct.std::ios_base::_Words" = type { i8*, i32 }
- %"struct.std::locale" = type { %"struct.std::locale::_Impl"* }
- %"struct.std::locale::_Impl" = type { i32, %"struct.std::locale::facet"**, i32, %"struct.std::locale::facet"**, i8** }
- %"struct.std::locale::facet" = type { i32 (...)**, i32 }
- %"struct.std::num_get<char,std::istreambuf_iterator<char, std::char_traits<char> > >" = type { %"struct.std::locale::facet" }
-@a = global float 0x3FD3333340000000 ; <float*> [#uses=1]
-@b = global double 6.000000e-01, align 8 ; <double*> [#uses=1]
-@_ZSt8__ioinit = internal global %"struct.std::ctype_base" zeroinitializer ; <%"struct.std::ctype_base"*> [#uses=2]
-@__dso_handle = external global i8* ; <i8**> [#uses=1]
-@_ZSt4cout = external global %"struct.std::basic_ostream<char,std::char_traits<char> >" ; <%"struct.std::basic_ostream<char,std::char_traits<char> >"*> [#uses=2]
-@.str = internal constant [12 x i8] c"tan float: \00" ; <[12 x i8]*> [#uses=1]
-@.str1 = internal constant [13 x i8] c"tan double: \00" ; <[13 x i8]*> [#uses=1]
-
-declare void @_ZNSt8ios_base4InitD1Ev(%"struct.std::ctype_base"*)
-
-declare void @_ZNSt8ios_base4InitC1Ev(%"struct.std::ctype_base"*)
-
-declare i32 @__cxa_atexit(void (i8*)*, i8*, i8*)
-
-define i32 @main() {
-entry:
- %tmp6 = volatile load float* @a ; <float> [#uses=1]
- %tmp9 = tail call float @tanf( float %tmp6 ) ; <float> [#uses=1]
- %tmp12 = volatile load double* @b ; <double> [#uses=1]
- %tmp13 = tail call double @tan( double %tmp12 ) ; <double> [#uses=1]
- %tmp1314 = fptrunc double %tmp13 to float ; <float> [#uses=1]
- %tmp16 = tail call %"struct.std::basic_ostream<char,std::char_traits<char> >"* @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc( %"struct.std::basic_ostream<char,std::char_traits<char> >"* @_ZSt4cout, i8* getelementptr ([12 x i8]* @.str, i32 0, i32 0) ) ; <%"struct.std::basic_ostream<char,std::char_traits<char> >"*> [#uses=1]
- %tmp1920 = fpext float %tmp9 to double ; <double> [#uses=1]
- %tmp22 = tail call %"struct.std::basic_ostream<char,std::char_traits<char> >"* @_ZNSolsEd( %"struct.std::basic_ostream<char,std::char_traits<char> >"* %tmp16, double %tmp1920 ) ; <%"struct.std::basic_ostream<char,std::char_traits<char> >"*> [#uses=1]
- %tmp30 = tail call %"struct.std::basic_ostream<char,std::char_traits<char> >"* @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_( %"struct.std::basic_ostream<char,std::char_traits<char> >"* %tmp22 ) ; <%"struct.std::basic_ostream<char,std::char_traits<char> >"*> [#uses=0]
- %tmp34 = tail call %"struct.std::basic_ostream<char,std::char_traits<char> >"* @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc( %"struct.std::basic_ostream<char,std::char_traits<char> >"* @_ZSt4cout, i8* getelementptr ([13 x i8]* @.str1, i32 0, i32 0) ) ; <%"struct.std::basic_ostream<char,std::char_traits<char> >"*> [#uses=1]
- %tmp3940 = fpext float %tmp1314 to double ; <double> [#uses=1]
- %tmp42 = tail call %"struct.std::basic_ostream<char,std::char_traits<char> >"* @_ZNSolsEd( %"struct.std::basic_ostream<char,std::char_traits<char> >"* %tmp34, double %tmp3940 ) ; <%"struct.std::basic_ostream<char,std::char_traits<char> >"*> [#uses=1]
- %tmp51 = tail call %"struct.std::basic_ostream<char,std::char_traits<char> >"* @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_( %"struct.std::basic_ostream<char,std::char_traits<char> >"* %tmp42 ) ; <%"struct.std::basic_ostream<char,std::char_traits<char> >"*> [#uses=0]
- ret i32 0
-}
-
-declare float @tanf(float)
-
-declare double @tan(double)
-
-declare %"struct.std::basic_ostream<char,std::char_traits<char> >"* @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(%"struct.std::basic_ostream<char,std::char_traits<char> >"*, i8*)
-
-declare %"struct.std::basic_ostream<char,std::char_traits<char> >"* @_ZNSolsEd(%"struct.std::basic_ostream<char,std::char_traits<char> >"*, double)
-
-declare %"struct.std::basic_ostream<char,std::char_traits<char> >"* @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(%"struct.std::basic_ostream<char,std::char_traits<char> >"*)
diff --git a/release_23/test/CodeGen/X86/pr2177.ll b/release_23/test/CodeGen/X86/pr2177.ll
deleted file mode 100644
index b03c99095725..000000000000
--- a/release_23/test/CodeGen/X86/pr2177.ll
+++ /dev/null
@@ -1,35 +0,0 @@
-; RUN: llvm-as < %s | llc
-; PR2177
-
-target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128"
-target triple = "x86_64-apple-darwin9.1.0"
- %struct.S2259 = type { <4 x i16>, i8, i64 }
-
-define void @check2259va(i32 %z, ...) {
-entry:
- br i1 false, label %bb5, label %return
-bb5: ; preds = %entry
- switch i32 0, label %bb155 [
- i32 16, label %bb10
- i32 17, label %bb118
- i32 18, label %bb54
- i32 32, label %bb118
- i32 33, label %bb118
- i32 36, label %bb118
- ]
-bb10: ; preds = %bb5
- ret void
-bb54: ; preds = %bb5
- ret void
-bb118: ; preds = %bb5, %bb5, %bb5, %bb5
- %tmp125 = load i8** null, align 8 ; <i8*> [#uses=1]
- %tmp125126 = bitcast i8* %tmp125 to %struct.S2259* ; <%struct.S2259*> [#uses=1]
- %tmp128 = getelementptr %struct.S2259* %tmp125126, i32 0, i32 0 ; <<4 x i16>*> [#uses=1]
- %tmp129 = load <4 x i16>* %tmp128, align 8 ; <<4 x i16>> [#uses=1]
- store <4 x i16> %tmp129, <4 x i16>* null, align 8
- ret void
-bb155: ; preds = %bb5
- ret void
-return: ; preds = %entry
- ret void
-}
diff --git a/release_23/test/CodeGen/X86/pr2182.ll b/release_23/test/CodeGen/X86/pr2182.ll
deleted file mode 100644
index f65725db8bdc..000000000000
--- a/release_23/test/CodeGen/X86/pr2182.ll
+++ /dev/null
@@ -1,24 +0,0 @@
-; RUN: llvm-as < %s | llc | grep {addl \$3, (%eax)} | count 4
-; PR2182
-
-target datalayout =
-"e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
-target triple = "i386-apple-darwin8"
-@x = weak global i32 0 ; <i32*> [#uses=8]
-
-define void @loop_2() nounwind {
-entry:
- %tmp = volatile load i32* @x, align 4 ; <i32> [#uses=1]
- %tmp1 = add i32 %tmp, 3 ; <i32> [#uses=1]
- volatile store i32 %tmp1, i32* @x, align 4
- %tmp.1 = volatile load i32* @x, align 4 ; <i32> [#uses=1]
- %tmp1.1 = add i32 %tmp.1, 3 ; <i32> [#uses=1]
- volatile store i32 %tmp1.1, i32* @x, align 4
- %tmp.2 = volatile load i32* @x, align 4 ; <i32> [#uses=1]
- %tmp1.2 = add i32 %tmp.2, 3 ; <i32> [#uses=1]
- volatile store i32 %tmp1.2, i32* @x, align 4
- %tmp.3 = volatile load i32* @x, align 4 ; <i32> [#uses=1]
- %tmp1.3 = add i32 %tmp.3, 3 ; <i32> [#uses=1]
- volatile store i32 %tmp1.3, i32* @x, align 4
- ret void
-}
diff --git a/release_23/test/CodeGen/X86/prefetch.ll b/release_23/test/CodeGen/X86/prefetch.ll
deleted file mode 100644
index 003ce33fecee..000000000000
--- a/release_23/test/CodeGen/X86/prefetch.ll
+++ /dev/null
@@ -1,15 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse | grep prefetchnta
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse | grep prefetcht0
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse | grep prefetcht1
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse | grep prefetcht2
-
-define void @t(i8* %ptr) nounwind {
-entry:
- tail call void @llvm.prefetch( i8* %ptr, i32 0, i32 1 )
- tail call void @llvm.prefetch( i8* %ptr, i32 0, i32 2 )
- tail call void @llvm.prefetch( i8* %ptr, i32 0, i32 3 )
- tail call void @llvm.prefetch( i8* %ptr, i32 0, i32 0 )
- ret void
-}
-
-declare void @llvm.prefetch(i8*, i32, i32) nounwind
diff --git a/release_23/test/CodeGen/X86/rdtsc.ll b/release_23/test/CodeGen/X86/rdtsc.ll
deleted file mode 100644
index f5d947fcbabb..000000000000
--- a/release_23/test/CodeGen/X86/rdtsc.ll
+++ /dev/null
@@ -1,8 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 | grep rdtsc
-; RUN: llvm-as < %s | llc -march=x86-64 | grep rdtsc
-declare i64 @llvm.readcyclecounter()
-
-define i64 @foo() {
- %tmp.1 = call i64 @llvm.readcyclecounter( ) ; <i64> [#uses=1]
- ret i64 %tmp.1
-}
diff --git a/release_23/test/CodeGen/X86/regpressure.ll b/release_23/test/CodeGen/X86/regpressure.ll
deleted file mode 100644
index 6d8cfbb781f9..000000000000
--- a/release_23/test/CodeGen/X86/regpressure.ll
+++ /dev/null
@@ -1,114 +0,0 @@
-;; Both functions in this testcase should codegen to the same function, and
-;; neither of them should require spilling anything to the stack.
-
-; RUN: llvm-as < %s | llc -march=x86 -stats |& \
-; RUN: not grep {Number of register spills}
-
-;; This can be compiled to use three registers if the loads are not
-;; folded into the multiplies, 2 registers otherwise.
-
-define i32 @regpressure1(i32* %P) {
- %A = load i32* %P ; <i32> [#uses=1]
- %Bp = getelementptr i32* %P, i32 1 ; <i32*> [#uses=1]
- %B = load i32* %Bp ; <i32> [#uses=1]
- %s1 = mul i32 %A, %B ; <i32> [#uses=1]
- %Cp = getelementptr i32* %P, i32 2 ; <i32*> [#uses=1]
- %C = load i32* %Cp ; <i32> [#uses=1]
- %s2 = mul i32 %s1, %C ; <i32> [#uses=1]
- %Dp = getelementptr i32* %P, i32 3 ; <i32*> [#uses=1]
- %D = load i32* %Dp ; <i32> [#uses=1]
- %s3 = mul i32 %s2, %D ; <i32> [#uses=1]
- %Ep = getelementptr i32* %P, i32 4 ; <i32*> [#uses=1]
- %E = load i32* %Ep ; <i32> [#uses=1]
- %s4 = mul i32 %s3, %E ; <i32> [#uses=1]
- %Fp = getelementptr i32* %P, i32 5 ; <i32*> [#uses=1]
- %F = load i32* %Fp ; <i32> [#uses=1]
- %s5 = mul i32 %s4, %F ; <i32> [#uses=1]
- %Gp = getelementptr i32* %P, i32 6 ; <i32*> [#uses=1]
- %G = load i32* %Gp ; <i32> [#uses=1]
- %s6 = mul i32 %s5, %G ; <i32> [#uses=1]
- %Hp = getelementptr i32* %P, i32 7 ; <i32*> [#uses=1]
- %H = load i32* %Hp ; <i32> [#uses=1]
- %s7 = mul i32 %s6, %H ; <i32> [#uses=1]
- %Ip = getelementptr i32* %P, i32 8 ; <i32*> [#uses=1]
- %I = load i32* %Ip ; <i32> [#uses=1]
- %s8 = mul i32 %s7, %I ; <i32> [#uses=1]
- %Jp = getelementptr i32* %P, i32 9 ; <i32*> [#uses=1]
- %J = load i32* %Jp ; <i32> [#uses=1]
- %s9 = mul i32 %s8, %J ; <i32> [#uses=1]
- ret i32 %s9
-}
-
-define i32 @regpressure2(i32* %P) {
- %A = load i32* %P ; <i32> [#uses=1]
- %Bp = getelementptr i32* %P, i32 1 ; <i32*> [#uses=1]
- %B = load i32* %Bp ; <i32> [#uses=1]
- %Cp = getelementptr i32* %P, i32 2 ; <i32*> [#uses=1]
- %C = load i32* %Cp ; <i32> [#uses=1]
- %Dp = getelementptr i32* %P, i32 3 ; <i32*> [#uses=1]
- %D = load i32* %Dp ; <i32> [#uses=1]
- %Ep = getelementptr i32* %P, i32 4 ; <i32*> [#uses=1]
- %E = load i32* %Ep ; <i32> [#uses=1]
- %Fp = getelementptr i32* %P, i32 5 ; <i32*> [#uses=1]
- %F = load i32* %Fp ; <i32> [#uses=1]
- %Gp = getelementptr i32* %P, i32 6 ; <i32*> [#uses=1]
- %G = load i32* %Gp ; <i32> [#uses=1]
- %Hp = getelementptr i32* %P, i32 7 ; <i32*> [#uses=1]
- %H = load i32* %Hp ; <i32> [#uses=1]
- %Ip = getelementptr i32* %P, i32 8 ; <i32*> [#uses=1]
- %I = load i32* %Ip ; <i32> [#uses=1]
- %Jp = getelementptr i32* %P, i32 9 ; <i32*> [#uses=1]
- %J = load i32* %Jp ; <i32> [#uses=1]
- %s1 = mul i32 %A, %B ; <i32> [#uses=1]
- %s2 = mul i32 %s1, %C ; <i32> [#uses=1]
- %s3 = mul i32 %s2, %D ; <i32> [#uses=1]
- %s4 = mul i32 %s3, %E ; <i32> [#uses=1]
- %s5 = mul i32 %s4, %F ; <i32> [#uses=1]
- %s6 = mul i32 %s5, %G ; <i32> [#uses=1]
- %s7 = mul i32 %s6, %H ; <i32> [#uses=1]
- %s8 = mul i32 %s7, %I ; <i32> [#uses=1]
- %s9 = mul i32 %s8, %J ; <i32> [#uses=1]
- ret i32 %s9
-}
-
-define i32 @regpressure3(i16* %P, i1 %Cond, i32* %Other) {
- %A = load i16* %P ; <i16> [#uses=1]
- %Bp = getelementptr i16* %P, i32 1 ; <i16*> [#uses=1]
- %B = load i16* %Bp ; <i16> [#uses=1]
- %Cp = getelementptr i16* %P, i32 2 ; <i16*> [#uses=1]
- %C = load i16* %Cp ; <i16> [#uses=1]
- %Dp = getelementptr i16* %P, i32 3 ; <i16*> [#uses=1]
- %D = load i16* %Dp ; <i16> [#uses=1]
- %Ep = getelementptr i16* %P, i32 4 ; <i16*> [#uses=1]
- %E = load i16* %Ep ; <i16> [#uses=1]
- %Fp = getelementptr i16* %P, i32 5 ; <i16*> [#uses=1]
- %F = load i16* %Fp ; <i16> [#uses=1]
- %Gp = getelementptr i16* %P, i32 6 ; <i16*> [#uses=1]
- %G = load i16* %Gp ; <i16> [#uses=1]
- %Hp = getelementptr i16* %P, i32 7 ; <i16*> [#uses=1]
- %H = load i16* %Hp ; <i16> [#uses=1]
- %Ip = getelementptr i16* %P, i32 8 ; <i16*> [#uses=1]
- %I = load i16* %Ip ; <i16> [#uses=1]
- %Jp = getelementptr i16* %P, i32 9 ; <i16*> [#uses=1]
- %J = load i16* %Jp ; <i16> [#uses=1]
- %A.upgrd.1 = sext i16 %A to i32 ; <i32> [#uses=1]
- %B.upgrd.2 = sext i16 %B to i32 ; <i32> [#uses=1]
- %D.upgrd.3 = sext i16 %D to i32 ; <i32> [#uses=1]
- %C.upgrd.4 = sext i16 %C to i32 ; <i32> [#uses=1]
- %E.upgrd.5 = sext i16 %E to i32 ; <i32> [#uses=1]
- %F.upgrd.6 = sext i16 %F to i32 ; <i32> [#uses=1]
- %G.upgrd.7 = sext i16 %G to i32 ; <i32> [#uses=1]
- %H.upgrd.8 = sext i16 %H to i32 ; <i32> [#uses=1]
- %I.upgrd.9 = sext i16 %I to i32 ; <i32> [#uses=1]
- %J.upgrd.10 = sext i16 %J to i32 ; <i32> [#uses=1]
- %s1 = add i32 %A.upgrd.1, %B.upgrd.2 ; <i32> [#uses=1]
- %s2 = add i32 %C.upgrd.4, %s1 ; <i32> [#uses=1]
- %s3 = add i32 %D.upgrd.3, %s2 ; <i32> [#uses=1]
- %s4 = add i32 %E.upgrd.5, %s3 ; <i32> [#uses=1]
- %s5 = add i32 %F.upgrd.6, %s4 ; <i32> [#uses=1]
- %s6 = add i32 %G.upgrd.7, %s5 ; <i32> [#uses=1]
- %s7 = add i32 %H.upgrd.8, %s6 ; <i32> [#uses=1]
- %s8 = add i32 %I.upgrd.9, %s7 ; <i32> [#uses=1]
- %s9 = add i32 %J.upgrd.10, %s8 ; <i32> [#uses=1]
- ret i32 %s9
-}
diff --git a/release_23/test/CodeGen/X86/rem.ll b/release_23/test/CodeGen/X86/rem.ll
deleted file mode 100644
index bba1f9b96bb4..000000000000
--- a/release_23/test/CodeGen/X86/rem.ll
+++ /dev/null
@@ -1,22 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 | not grep div
-
-define i32 @test1(i32 %X) {
- %tmp1 = srem i32 %X, 255 ; <i32> [#uses=1]
- ret i32 %tmp1
-}
-
-define i32 @test2(i32 %X) {
- %tmp1 = srem i32 %X, 256 ; <i32> [#uses=1]
- ret i32 %tmp1
-}
-
-define i32 @test3(i32 %X) {
- %tmp1 = urem i32 %X, 255 ; <i32> [#uses=1]
- ret i32 %tmp1
-}
-
-define i32 @test4(i32 %X) {
- %tmp1 = urem i32 %X, 256 ; <i32> [#uses=1]
- ret i32 %tmp1
-}
-
diff --git a/release_23/test/CodeGen/X86/rotate.ll b/release_23/test/CodeGen/X86/rotate.ll
deleted file mode 100644
index c567c0d33cf2..000000000000
--- a/release_23/test/CodeGen/X86/rotate.ll
+++ /dev/null
@@ -1,100 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -x86-asm-syntax=intel | \
-; RUN: grep {ro\[rl\]} | count 12
-
-define i32 @rotl32(i32 %A, i8 %Amt) {
- %shift.upgrd.1 = zext i8 %Amt to i32 ; <i32> [#uses=1]
- %B = shl i32 %A, %shift.upgrd.1 ; <i32> [#uses=1]
- %Amt2 = sub i8 32, %Amt ; <i8> [#uses=1]
- %shift.upgrd.2 = zext i8 %Amt2 to i32 ; <i32> [#uses=1]
- %C = lshr i32 %A, %shift.upgrd.2 ; <i32> [#uses=1]
- %D = or i32 %B, %C ; <i32> [#uses=1]
- ret i32 %D
-}
-
-define i32 @rotr32(i32 %A, i8 %Amt) {
- %shift.upgrd.3 = zext i8 %Amt to i32 ; <i32> [#uses=1]
- %B = lshr i32 %A, %shift.upgrd.3 ; <i32> [#uses=1]
- %Amt2 = sub i8 32, %Amt ; <i8> [#uses=1]
- %shift.upgrd.4 = zext i8 %Amt2 to i32 ; <i32> [#uses=1]
- %C = shl i32 %A, %shift.upgrd.4 ; <i32> [#uses=1]
- %D = or i32 %B, %C ; <i32> [#uses=1]
- ret i32 %D
-}
-
-define i32 @rotli32(i32 %A) {
- %B = shl i32 %A, 5 ; <i32> [#uses=1]
- %C = lshr i32 %A, 27 ; <i32> [#uses=1]
- %D = or i32 %B, %C ; <i32> [#uses=1]
- ret i32 %D
-}
-
-define i32 @rotri32(i32 %A) {
- %B = lshr i32 %A, 5 ; <i32> [#uses=1]
- %C = shl i32 %A, 27 ; <i32> [#uses=1]
- %D = or i32 %B, %C ; <i32> [#uses=1]
- ret i32 %D
-}
-
-define i16 @rotl16(i16 %A, i8 %Amt) {
- %shift.upgrd.5 = zext i8 %Amt to i16 ; <i16> [#uses=1]
- %B = shl i16 %A, %shift.upgrd.5 ; <i16> [#uses=1]
- %Amt2 = sub i8 16, %Amt ; <i8> [#uses=1]
- %shift.upgrd.6 = zext i8 %Amt2 to i16 ; <i16> [#uses=1]
- %C = lshr i16 %A, %shift.upgrd.6 ; <i16> [#uses=1]
- %D = or i16 %B, %C ; <i16> [#uses=1]
- ret i16 %D
-}
-
-define i16 @rotr16(i16 %A, i8 %Amt) {
- %shift.upgrd.7 = zext i8 %Amt to i16 ; <i16> [#uses=1]
- %B = lshr i16 %A, %shift.upgrd.7 ; <i16> [#uses=1]
- %Amt2 = sub i8 16, %Amt ; <i8> [#uses=1]
- %shift.upgrd.8 = zext i8 %Amt2 to i16 ; <i16> [#uses=1]
- %C = shl i16 %A, %shift.upgrd.8 ; <i16> [#uses=1]
- %D = or i16 %B, %C ; <i16> [#uses=1]
- ret i16 %D
-}
-
-define i16 @rotli16(i16 %A) {
- %B = shl i16 %A, 5 ; <i16> [#uses=1]
- %C = lshr i16 %A, 11 ; <i16> [#uses=1]
- %D = or i16 %B, %C ; <i16> [#uses=1]
- ret i16 %D
-}
-
-define i16 @rotri16(i16 %A) {
- %B = lshr i16 %A, 5 ; <i16> [#uses=1]
- %C = shl i16 %A, 11 ; <i16> [#uses=1]
- %D = or i16 %B, %C ; <i16> [#uses=1]
- ret i16 %D
-}
-
-define i8 @rotl8(i8 %A, i8 %Amt) {
- %B = shl i8 %A, %Amt ; <i8> [#uses=1]
- %Amt2 = sub i8 8, %Amt ; <i8> [#uses=1]
- %C = lshr i8 %A, %Amt2 ; <i8> [#uses=1]
- %D = or i8 %B, %C ; <i8> [#uses=1]
- ret i8 %D
-}
-
-define i8 @rotr8(i8 %A, i8 %Amt) {
- %B = lshr i8 %A, %Amt ; <i8> [#uses=1]
- %Amt2 = sub i8 8, %Amt ; <i8> [#uses=1]
- %C = shl i8 %A, %Amt2 ; <i8> [#uses=1]
- %D = or i8 %B, %C ; <i8> [#uses=1]
- ret i8 %D
-}
-
-define i8 @rotli8(i8 %A) {
- %B = shl i8 %A, 5 ; <i8> [#uses=1]
- %C = lshr i8 %A, 3 ; <i8> [#uses=1]
- %D = or i8 %B, %C ; <i8> [#uses=1]
- ret i8 %D
-}
-
-define i8 @rotri8(i8 %A) {
- %B = lshr i8 %A, 5 ; <i8> [#uses=1]
- %C = shl i8 %A, 3 ; <i8> [#uses=1]
- %D = or i8 %B, %C ; <i8> [#uses=1]
- ret i8 %D
-}
diff --git a/release_23/test/CodeGen/X86/rotate2.ll b/release_23/test/CodeGen/X86/rotate2.ll
deleted file mode 100644
index 40e954cbdd01..000000000000
--- a/release_23/test/CodeGen/X86/rotate2.ll
+++ /dev/null
@@ -1,19 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86-64 | grep rol | count 2
-
-define i64 @test1(i64 %x) nounwind {
-entry:
- %tmp2 = lshr i64 %x, 55 ; <i64> [#uses=1]
- %tmp4 = shl i64 %x, 9 ; <i64> [#uses=1]
- %tmp5 = or i64 %tmp2, %tmp4 ; <i64> [#uses=1]
- ret i64 %tmp5
-}
-
-define i64 @test2(i32 %x) nounwind {
-entry:
- %tmp2 = lshr i32 %x, 22 ; <i32> [#uses=1]
- %tmp4 = shl i32 %x, 10 ; <i32> [#uses=1]
- %tmp5 = or i32 %tmp2, %tmp4 ; <i32> [#uses=1]
- %tmp56 = zext i32 %tmp5 to i64 ; <i64> [#uses=1]
- ret i64 %tmp56
-}
-
diff --git a/release_23/test/CodeGen/X86/scalar-min-max-fill-operand.ll b/release_23/test/CodeGen/X86/scalar-min-max-fill-operand.ll
deleted file mode 100644
index 6a6283a10dab..000000000000
--- a/release_23/test/CodeGen/X86/scalar-min-max-fill-operand.ll
+++ /dev/null
@@ -1,20 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86-64 | grep min | count 1
-; RUN: llvm-as < %s | llc -march=x86-64 | grep max | count 1
-; RUN: llvm-as < %s | llc -march=x86-64 | grep mov | count 2
-
-declare float @bar()
-
-define float @foo(float %a)
-{
- %s = call float @bar()
- %t = fcmp olt float %s, %a
- %u = select i1 %t, float %s, float %a
- ret float %u
-}
-define float @hem(float %a)
-{
- %s = call float @bar()
- %t = fcmp uge float %s, %a
- %u = select i1 %t, float %s, float %a
- ret float %u
-}
diff --git a/release_23/test/CodeGen/X86/scalar_sse_minmax.ll b/release_23/test/CodeGen/X86/scalar_sse_minmax.ll
deleted file mode 100644
index c8c899b4f546..000000000000
--- a/release_23/test/CodeGen/X86/scalar_sse_minmax.ll
+++ /dev/null
@@ -1,44 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse1,+sse2 | \
-; RUN: grep mins | count 3
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse1,+sse2 | \
-; RUN: grep maxs | count 2
-
-declare i1 @llvm.isunordered.f64(double, double)
-
-declare i1 @llvm.isunordered.f32(float, float)
-
-define float @min1(float %x, float %y) {
- %tmp = fcmp olt float %x, %y ; <i1> [#uses=1]
- %retval = select i1 %tmp, float %x, float %y ; <float> [#uses=1]
- ret float %retval
-}
-
-define double @min2(double %x, double %y) {
- %tmp = fcmp olt double %x, %y ; <i1> [#uses=1]
- %retval = select i1 %tmp, double %x, double %y ; <double> [#uses=1]
- ret double %retval
-}
-
-define float @max1(float %x, float %y) {
- %tmp = fcmp oge float %x, %y ; <i1> [#uses=1]
- %tmp2 = fcmp uno float %x, %y ; <i1> [#uses=1]
- %tmp3 = or i1 %tmp2, %tmp ; <i1> [#uses=1]
- %retval = select i1 %tmp3, float %x, float %y ; <float> [#uses=1]
- ret float %retval
-}
-
-define double @max2(double %x, double %y) {
- %tmp = fcmp oge double %x, %y ; <i1> [#uses=1]
- %tmp2 = fcmp uno double %x, %y ; <i1> [#uses=1]
- %tmp3 = or i1 %tmp2, %tmp ; <i1> [#uses=1]
- %retval = select i1 %tmp3, double %x, double %y ; <double> [#uses=1]
- ret double %retval
-}
-
-define <4 x float> @min3(float %tmp37) {
- %tmp375 = insertelement <4 x float> undef, float %tmp37, i32 0 ; <<4 x float>> [#uses=1]
- %tmp48 = tail call <4 x float> @llvm.x86.sse.min.ss( <4 x float> %tmp375, <4 x float> < float 6.553500e+04, float undef, float undef, float undef > ) ; <<4 x float>> [#uses=1]
- ret <4 x float> %tmp48
-}
-
-declare <4 x float> @llvm.x86.sse.min.ss(<4 x float>, <4 x float>)
diff --git a/release_23/test/CodeGen/X86/select-zero-one.ll b/release_23/test/CodeGen/X86/select-zero-one.ll
deleted file mode 100644
index 70785e9978fb..000000000000
--- a/release_23/test/CodeGen/X86/select-zero-one.ll
+++ /dev/null
@@ -1,25 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | not grep cmov
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | not grep xor
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep movzbl | count 1
-
-@r1 = weak global i32 0
-
-define void @t1(i32 %a, double %b) {
- %tmp114 = fcmp ugt double %b, 1.000000e-09
- %tmp120 = icmp eq i32 %a, 0 ; <i1> [#uses=1]
- %bothcond = or i1 %tmp114, %tmp120 ; <i1> [#uses=1]
- %storemerge = select i1 %bothcond, i32 0, i32 1 ; <i32> [#uses=2]
- store i32 %storemerge, i32* @r1, align 4
- ret void
-}
-
-@r2 = weak global i8 0
-
-define void @t2(i32 %a, double %b) {
- %tmp114 = fcmp ugt double %b, 1.000000e-09
- %tmp120 = icmp eq i32 %a, 0 ; <i1> [#uses=1]
- %bothcond = or i1 %tmp114, %tmp120 ; <i1> [#uses=1]
- %storemerge = select i1 %bothcond, i8 0, i8 1 ; <i32> [#uses=2]
- store i8 %storemerge, i8* @r2, align 4
- ret void
-}
diff --git a/release_23/test/CodeGen/X86/select.ll b/release_23/test/CodeGen/X86/select.ll
deleted file mode 100644
index e5d610125372..000000000000
--- a/release_23/test/CodeGen/X86/select.ll
+++ /dev/null
@@ -1,63 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -mcpu=pentium
-; RUN: llvm-as < %s | llc -march=x86 -mcpu=yonah
-; RUN: llvm-as < %s | llc -march=x86 -mcpu=yonah | not grep set
-
-define i1 @boolSel(i1 %A, i1 %B, i1 %C) nounwind {
- %X = select i1 %A, i1 %B, i1 %C ; <i1> [#uses=1]
- ret i1 %X
-}
-
-define i8 @byteSel(i1 %A, i8 %B, i8 %C) nounwind {
- %X = select i1 %A, i8 %B, i8 %C ; <i8> [#uses=1]
- ret i8 %X
-}
-
-define i16 @shortSel(i1 %A, i16 %B, i16 %C) nounwind {
- %X = select i1 %A, i16 %B, i16 %C ; <i16> [#uses=1]
- ret i16 %X
-}
-
-define i32 @intSel(i1 %A, i32 %B, i32 %C) nounwind {
- %X = select i1 %A, i32 %B, i32 %C ; <i32> [#uses=1]
- ret i32 %X
-}
-
-define i64 @longSel(i1 %A, i64 %B, i64 %C) nounwind {
- %X = select i1 %A, i64 %B, i64 %C ; <i64> [#uses=1]
- ret i64 %X
-}
-
-define double @doubleSel(i1 %A, double %B, double %C) nounwind {
- %X = select i1 %A, double %B, double %C ; <double> [#uses=1]
- ret double %X
-}
-
-define i8 @foldSel(i1 %A, i8 %B, i8 %C) nounwind {
- %Cond = icmp slt i8 %B, %C ; <i1> [#uses=1]
- %X = select i1 %Cond, i8 %B, i8 %C ; <i8> [#uses=1]
- ret i8 %X
-}
-
-define i32 @foldSel2(i1 %A, i32 %B, i32 %C) nounwind {
- %Cond = icmp eq i32 %B, %C ; <i1> [#uses=1]
- %X = select i1 %Cond, i32 %B, i32 %C ; <i32> [#uses=1]
- ret i32 %X
-}
-
-define i32 @foldSel2a(i1 %A, i32 %B, i32 %C, double %X, double %Y) nounwind {
- %Cond = fcmp olt double %X, %Y ; <i1> [#uses=1]
- %X.upgrd.1 = select i1 %Cond, i32 %B, i32 %C ; <i32> [#uses=1]
- ret i32 %X.upgrd.1
-}
-
-define float @foldSel3(i1 %A, float %B, float %C, i32 %X, i32 %Y) nounwind {
- %Cond = icmp ult i32 %X, %Y ; <i1> [#uses=1]
- %X.upgrd.2 = select i1 %Cond, float %B, float %C ; <float> [#uses=1]
- ret float %X.upgrd.2
-}
-
-define float @nofoldSel4(i1 %A, float %B, float %C, i32 %X, i32 %Y) nounwind {
- %Cond = icmp slt i32 %X, %Y ; <i1> [#uses=1]
- %X.upgrd.3 = select i1 %Cond, float %B, float %C ; <float> [#uses=1]
- ret float %X.upgrd.3
-}
diff --git a/release_23/test/CodeGen/X86/setuge.ll b/release_23/test/CodeGen/X86/setuge.ll
deleted file mode 100644
index 3f1d882754ee..000000000000
--- a/release_23/test/CodeGen/X86/setuge.ll
+++ /dev/null
@@ -1,13 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 | not grep set
-
-declare i1 @llvm.isunordered.f32(float, float)
-
-define float @cmp(float %A, float %B, float %C, float %D) nounwind {
-entry:
- %tmp.1 = fcmp uno float %A, %B ; <i1> [#uses=1]
- %tmp.2 = fcmp oge float %A, %B ; <i1> [#uses=1]
- %tmp.3 = or i1 %tmp.1, %tmp.2 ; <i1> [#uses=1]
- %tmp.4 = select i1 %tmp.3, float %C, float %D ; <float> [#uses=1]
- ret float %tmp.4
-}
-
diff --git a/release_23/test/CodeGen/X86/sext-load.ll b/release_23/test/CodeGen/X86/sext-load.ll
deleted file mode 100644
index a6d1080bd84a..000000000000
--- a/release_23/test/CodeGen/X86/sext-load.ll
+++ /dev/null
@@ -1,9 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 | grep movsbl
-
-define i32 @foo(i32 %X) nounwind {
-entry:
- %tmp12 = trunc i32 %X to i8 ; <i8> [#uses=1]
- %tmp123 = sext i8 %tmp12 to i32 ; <i32> [#uses=1]
- ret i32 %tmp123
-}
-
diff --git a/release_23/test/CodeGen/X86/sext-select.ll b/release_23/test/CodeGen/X86/sext-select.ll
deleted file mode 100644
index 839ebc2b6c17..000000000000
--- a/release_23/test/CodeGen/X86/sext-select.ll
+++ /dev/null
@@ -1,23 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 | grep movsw
-; PR2139
-
-declare void @abort()
-
-define i32 @main() {
-entry:
- %tmp73 = tail call i1 @return_false() ; <i8> [#uses=1]
- %g.0 = select i1 %tmp73, i16 0, i16 -480 ; <i16> [#uses=2]
- %tmp7778 = sext i16 %g.0 to i32 ; <i32> [#uses=1]
- %tmp80 = shl i32 %tmp7778, 3 ; <i32> [#uses=2]
- %tmp87 = icmp sgt i32 %tmp80, 32767 ; <i1> [#uses=1]
- br i1 %tmp87, label %bb90, label %bb91
-bb90: ; preds = %bb84, %bb72
- tail call void @abort()
- unreachable
-bb91: ; preds = %bb84
- ret i32 0
-}
-
-define i1 @return_false() {
- ret i1 0
-}
diff --git a/release_23/test/CodeGen/X86/sfence.ll b/release_23/test/CodeGen/X86/sfence.ll
deleted file mode 100644
index fc75ccbcb629..000000000000
--- a/release_23/test/CodeGen/X86/sfence.ll
+++ /dev/null
@@ -1,8 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep sfence
-
-declare void @llvm.memory.barrier( i1 , i1 , i1 , i1 , i1)
-
-define void @test() {
- call void @llvm.memory.barrier( i1 false, i1 false, i1 false, i1 true, i1 true)
- ret void
-}
diff --git a/release_23/test/CodeGen/X86/shift-coalesce.ll b/release_23/test/CodeGen/X86/shift-coalesce.ll
deleted file mode 100644
index 4662628b672e..000000000000
--- a/release_23/test/CodeGen/X86/shift-coalesce.ll
+++ /dev/null
@@ -1,15 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -x86-asm-syntax=intel | \
-; RUN: grep {shld.*CL}
-; RUN: llvm-as < %s | llc -march=x86 -x86-asm-syntax=intel | \
-; RUN: not grep {mov CL, BL}
-
-; PR687
-
-define i64 @foo(i64 %x, i64* %X) {
- %tmp.1 = load i64* %X ; <i64> [#uses=1]
- %tmp.3 = trunc i64 %tmp.1 to i8 ; <i8> [#uses=1]
- %shift.upgrd.1 = zext i8 %tmp.3 to i64 ; <i64> [#uses=1]
- %tmp.4 = shl i64 %x, %shift.upgrd.1 ; <i64> [#uses=1]
- ret i64 %tmp.4
-}
-
diff --git a/release_23/test/CodeGen/X86/shift-codegen.ll b/release_23/test/CodeGen/X86/shift-codegen.ll
deleted file mode 100644
index deb4ed1f309b..000000000000
--- a/release_23/test/CodeGen/X86/shift-codegen.ll
+++ /dev/null
@@ -1,27 +0,0 @@
-; RUN: llvm-as < %s | llc -relocation-model=static -march=x86 | \
-; RUN: grep {shll \$3} | count 2
-
-; This should produce two shll instructions, not any lea's.
-
-target triple = "i686-apple-darwin8"
-@Y = weak global i32 0 ; <i32*> [#uses=1]
-@X = weak global i32 0 ; <i32*> [#uses=2]
-
-
-define void @fn1() {
-entry:
- %tmp = load i32* @Y ; <i32> [#uses=1]
- %tmp1 = shl i32 %tmp, 3 ; <i32> [#uses=1]
- %tmp2 = load i32* @X ; <i32> [#uses=1]
- %tmp3 = or i32 %tmp1, %tmp2 ; <i32> [#uses=1]
- store i32 %tmp3, i32* @X
- ret void
-}
-
-define i32 @fn2(i32 %X, i32 %Y) {
-entry:
- %tmp2 = shl i32 %Y, 3 ; <i32> [#uses=1]
- %tmp4 = or i32 %tmp2, %X ; <i32> [#uses=1]
- ret i32 %tmp4
-}
-
diff --git a/release_23/test/CodeGen/X86/shift-combine.ll b/release_23/test/CodeGen/X86/shift-combine.ll
deleted file mode 100644
index 543bb2237875..000000000000
--- a/release_23/test/CodeGen/X86/shift-combine.ll
+++ /dev/null
@@ -1,15 +0,0 @@
-; RUN: llvm-as < %s | llc | not grep shrl
-
-target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
-target triple = "i686-apple-darwin8"
-@array = weak global [4 x i32] zeroinitializer ; <[4 x i32]*> [#uses=1]
-
-define i32 @foo(i32 %x) {
-entry:
- %tmp2 = lshr i32 %x, 2 ; <i32> [#uses=1]
- %tmp3 = and i32 %tmp2, 3 ; <i32> [#uses=1]
- %tmp4 = getelementptr [4 x i32]* @array, i32 0, i32 %tmp3 ; <i32*> [#uses=1]
- %tmp5 = load i32* %tmp4, align 4 ; <i32> [#uses=1]
- ret i32 %tmp5
-}
-
diff --git a/release_23/test/CodeGen/X86/shift-double.ll b/release_23/test/CodeGen/X86/shift-double.ll
deleted file mode 100644
index 24017fe2178a..000000000000
--- a/release_23/test/CodeGen/X86/shift-double.ll
+++ /dev/null
@@ -1,41 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -x86-asm-syntax=intel | \
-; RUN: grep {sh\[lr\]d} | count 5
-
-define i64 @test1(i64 %X, i8 %C) {
- %shift.upgrd.1 = zext i8 %C to i64 ; <i64> [#uses=1]
- %Y = shl i64 %X, %shift.upgrd.1 ; <i64> [#uses=1]
- ret i64 %Y
-}
-
-define i64 @test2(i64 %X, i8 %C) {
- %shift.upgrd.2 = zext i8 %C to i64 ; <i64> [#uses=1]
- %Y = ashr i64 %X, %shift.upgrd.2 ; <i64> [#uses=1]
- ret i64 %Y
-}
-
-define i64 @test3(i64 %X, i8 %C) {
- %shift.upgrd.3 = zext i8 %C to i64 ; <i64> [#uses=1]
- %Y = lshr i64 %X, %shift.upgrd.3 ; <i64> [#uses=1]
- ret i64 %Y
-}
-
-define i32 @test4(i32 %A, i32 %B, i8 %C) {
- %shift.upgrd.4 = zext i8 %C to i32 ; <i32> [#uses=1]
- %X = shl i32 %A, %shift.upgrd.4 ; <i32> [#uses=1]
- %Cv = sub i8 32, %C ; <i8> [#uses=1]
- %shift.upgrd.5 = zext i8 %Cv to i32 ; <i32> [#uses=1]
- %Y = lshr i32 %B, %shift.upgrd.5 ; <i32> [#uses=1]
- %Z = or i32 %Y, %X ; <i32> [#uses=1]
- ret i32 %Z
-}
-
-define i16 @test5(i16 %A, i16 %B, i8 %C) {
- %shift.upgrd.6 = zext i8 %C to i16 ; <i16> [#uses=1]
- %X = shl i16 %A, %shift.upgrd.6 ; <i16> [#uses=1]
- %Cv = sub i8 16, %C ; <i8> [#uses=1]
- %shift.upgrd.7 = zext i8 %Cv to i16 ; <i16> [#uses=1]
- %Y = lshr i16 %B, %shift.upgrd.7 ; <i16> [#uses=1]
- %Z = or i16 %Y, %X ; <i16> [#uses=1]
- ret i16 %Z
-}
-
diff --git a/release_23/test/CodeGen/X86/shift-folding.ll b/release_23/test/CodeGen/X86/shift-folding.ll
deleted file mode 100644
index d26823220ff8..000000000000
--- a/release_23/test/CodeGen/X86/shift-folding.ll
+++ /dev/null
@@ -1,23 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 | \
-; RUN: grep {s\[ah\]\[rl\]l} | count 1
-
-define i32* @test1(i32* %P, i32 %X) {
- %Y = lshr i32 %X, 2 ; <i32> [#uses=1]
- %gep.upgrd.1 = zext i32 %Y to i64 ; <i64> [#uses=1]
- %P2 = getelementptr i32* %P, i64 %gep.upgrd.1 ; <i32*> [#uses=1]
- ret i32* %P2
-}
-
-define i32* @test2(i32* %P, i32 %X) {
- %Y = shl i32 %X, 2 ; <i32> [#uses=1]
- %gep.upgrd.2 = zext i32 %Y to i64 ; <i64> [#uses=1]
- %P2 = getelementptr i32* %P, i64 %gep.upgrd.2 ; <i32*> [#uses=1]
- ret i32* %P2
-}
-
-define i32* @test3(i32* %P, i32 %X) {
- %Y = ashr i32 %X, 2 ; <i32> [#uses=1]
- %P2 = getelementptr i32* %P, i32 %Y ; <i32*> [#uses=1]
- ret i32* %P2
-}
-
diff --git a/release_23/test/CodeGen/X86/shift-one.ll b/release_23/test/CodeGen/X86/shift-one.ll
deleted file mode 100644
index dd49b7e04cf1..000000000000
--- a/release_23/test/CodeGen/X86/shift-one.ll
+++ /dev/null
@@ -1,10 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 | not grep leal
-
-@x = external global i32 ; <i32*> [#uses=1]
-
-define i32 @test() {
- %tmp.0 = load i32* @x ; <i32> [#uses=1]
- %tmp.1 = shl i32 %tmp.0, 1 ; <i32> [#uses=1]
- ret i32 %tmp.1
-}
-
diff --git a/release_23/test/CodeGen/X86/shl_elim.ll b/release_23/test/CodeGen/X86/shl_elim.ll
deleted file mode 100644
index d3616f4ac5de..000000000000
--- a/release_23/test/CodeGen/X86/shl_elim.ll
+++ /dev/null
@@ -1,13 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 | grep {movl 8(.esp), %eax}
-; RUN: llvm-as < %s | llc -march=x86 | grep {shrl .eax}
-; RUN: llvm-as < %s | llc -march=x86 | grep {movswl .ax, .eax}
-
-define i32 @test1(i64 %a) {
- %tmp29 = lshr i64 %a, 24 ; <i64> [#uses=1]
- %tmp23 = trunc i64 %tmp29 to i32 ; <i32> [#uses=1]
- %tmp410 = lshr i32 %tmp23, 9 ; <i32> [#uses=1]
- %tmp45 = trunc i32 %tmp410 to i16 ; <i16> [#uses=1]
- %tmp456 = sext i16 %tmp45 to i32 ; <i32> [#uses=1]
- ret i32 %tmp456
-}
-
diff --git a/release_23/test/CodeGen/X86/shrink-fp-const1.ll b/release_23/test/CodeGen/X86/shrink-fp-const1.ll
deleted file mode 100644
index 966e69ec7798..000000000000
--- a/release_23/test/CodeGen/X86/shrink-fp-const1.ll
+++ /dev/null
@@ -1,7 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86-64 -mattr=+sse2 | not grep cvtss2sd
-; PR1264
-
-define double @foo(double %x) {
- %y = mul double %x, 5.000000e-01
- ret double %y
-}
diff --git a/release_23/test/CodeGen/X86/shrink-fp-const2.ll b/release_23/test/CodeGen/X86/shrink-fp-const2.ll
deleted file mode 100644
index 7e48b1bba8f1..000000000000
--- a/release_23/test/CodeGen/X86/shrink-fp-const2.ll
+++ /dev/null
@@ -1,7 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 | grep flds
-; This should be a flds, not fldt.
-define x86_fp80 @test2() nounwind {
-entry:
- ret x86_fp80 0xK3FFFC000000000000000
-}
-
diff --git a/release_23/test/CodeGen/X86/sincos.ll b/release_23/test/CodeGen/X86/sincos.ll
deleted file mode 100644
index 27215956b64d..000000000000
--- a/release_23/test/CodeGen/X86/sincos.ll
+++ /dev/null
@@ -1,50 +0,0 @@
-; Make sure this testcase codegens to the sin and cos instructions, not calls
-; RUN: llvm-as < %s | \
-; RUN: llc -march=x86 -mattr=-sse,-sse2,-sse3 -enable-unsafe-fp-math | \
-; RUN: grep sin\$ | count 3
-; RUN: llvm-as < %s | \
-; RUN: llc -march=x86 -mattr=-sse,-sse2,-sse3 -enable-unsafe-fp-math | \
-; RUN: grep cos\$ | count 3
-
-declare float @sinf(float)
-
-declare double @sin(double)
-
-declare x86_fp80 @sinl(x86_fp80)
-
-define float @test1(float %X) {
- %Y = call float @sinf(float %X)
- ret float %Y
-}
-
-define double @test2(double %X) {
- %Y = call double @sin(double %X)
- ret double %Y
-}
-
-define x86_fp80 @test3(x86_fp80 %X) {
- %Y = call x86_fp80 @sinl(x86_fp80 %X)
- ret x86_fp80 %Y
-}
-
-declare float @cosf(float)
-
-declare double @cos(double)
-
-declare x86_fp80 @cosl(x86_fp80)
-
-define float @test4(float %X) {
- %Y = call float @cosf(float %X)
- ret float %Y
-}
-
-define double @test5(double %X) {
- %Y = call double @cos(double %X)
- ret double %Y
-}
-
-define x86_fp80 @test6(x86_fp80 %X) {
- %Y = call x86_fp80 @cosl(x86_fp80 %X)
- ret x86_fp80 %Y
-}
-
diff --git a/release_23/test/CodeGen/X86/small-byval-memcpy.ll b/release_23/test/CodeGen/X86/small-byval-memcpy.ll
deleted file mode 100644
index dedd948c297b..000000000000
--- a/release_23/test/CodeGen/X86/small-byval-memcpy.ll
+++ /dev/null
@@ -1,22 +0,0 @@
-; RUN: llvm-as < %s | llc | not grep movs
-
-target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
-target triple = "i386-apple-darwin8"
-
-define void @ccosl({ x86_fp80, x86_fp80 }* noalias sret %agg.result, { x86_fp80, x86_fp80 }* byval align 4 %z) nounwind {
-entry:
- %iz = alloca { x86_fp80, x86_fp80 } ; <{ x86_fp80, x86_fp80 }*> [#uses=3]
- %tmp1 = getelementptr { x86_fp80, x86_fp80 }* %z, i32 0, i32 1 ; <x86_fp80*> [#uses=1]
- %tmp2 = load x86_fp80* %tmp1, align 16 ; <x86_fp80> [#uses=1]
- %tmp3 = sub x86_fp80 0xK80000000000000000000, %tmp2 ; <x86_fp80> [#uses=1]
- %tmp4 = getelementptr { x86_fp80, x86_fp80 }* %iz, i32 0, i32 1 ; <x86_fp80*> [#uses=1]
- %real = getelementptr { x86_fp80, x86_fp80 }* %iz, i32 0, i32 0 ; <x86_fp80*> [#uses=1]
- %tmp6 = getelementptr { x86_fp80, x86_fp80 }* %z, i32 0, i32 0 ; <x86_fp80*> [#uses=1]
- %tmp7 = load x86_fp80* %tmp6, align 16 ; <x86_fp80> [#uses=1]
- store x86_fp80 %tmp3, x86_fp80* %real, align 16
- store x86_fp80 %tmp7, x86_fp80* %tmp4, align 16
- call void @ccoshl( { x86_fp80, x86_fp80 }* noalias sret %agg.result, { x86_fp80, x86_fp80 }* byval align 4 %iz ) nounwind
- ret void
-}
-
-declare void @ccoshl({ x86_fp80, x86_fp80 }* noalias sret , { x86_fp80, x86_fp80 }* byval align 4 ) nounwind
diff --git a/release_23/test/CodeGen/X86/split-select.ll b/release_23/test/CodeGen/X86/split-select.ll
deleted file mode 100644
index 6e2f6e665deb..000000000000
--- a/release_23/test/CodeGen/X86/split-select.ll
+++ /dev/null
@@ -1,7 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86-64 | grep test | count 1
-
-define void @foo(i1 %c, <2 x float> %a, <2 x float> %b, <2 x float>* %p) {
- %x = select i1 %c, <2 x float> %a, <2 x float> %b
- store <2 x float> %x, <2 x float>* %p
- ret void
-}
diff --git a/release_23/test/CodeGen/X86/split-vector-rem.ll b/release_23/test/CodeGen/X86/split-vector-rem.ll
deleted file mode 100644
index 8c88769be78f..000000000000
--- a/release_23/test/CodeGen/X86/split-vector-rem.ll
+++ /dev/null
@@ -1,15 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86-64 | grep div | count 16
-; RUN: llvm-as < %s | llc -march=x86-64 | grep fmodf | count 8
-
-define <8 x i32> @foo(<8 x i32> %t, <8 x i32> %u) {
- %m = srem <8 x i32> %t, %u
- ret <8 x i32> %m
-}
-define <8 x i32> @bar(<8 x i32> %t, <8 x i32> %u) {
- %m = urem <8 x i32> %t, %u
- ret <8 x i32> %m
-}
-define <8 x float> @qux(<8 x float> %t, <8 x float> %u) {
- %m = frem <8 x float> %t, %u
- ret <8 x float> %m
-}
diff --git a/release_23/test/CodeGen/X86/sse-align-0.ll b/release_23/test/CodeGen/X86/sse-align-0.ll
deleted file mode 100644
index 39debaa3257f..000000000000
--- a/release_23/test/CodeGen/X86/sse-align-0.ll
+++ /dev/null
@@ -1,12 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86-64 | not grep mov
-
-define <4 x float> @foo(<4 x float>* %p, <4 x float> %x) nounwind {
- %t = load <4 x float>* %p
- %z = mul <4 x float> %t, %x
- ret <4 x float> %z
-}
-define <2 x double> @bar(<2 x double>* %p, <2 x double> %x) nounwind {
- %t = load <2 x double>* %p
- %z = mul <2 x double> %t, %x
- ret <2 x double> %z
-}
diff --git a/release_23/test/CodeGen/X86/sse-align-1.ll b/release_23/test/CodeGen/X86/sse-align-1.ll
deleted file mode 100644
index 0edc6e094580..000000000000
--- a/release_23/test/CodeGen/X86/sse-align-1.ll
+++ /dev/null
@@ -1,10 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86-64 | grep movap | count 2
-
-define <4 x float> @foo(<4 x float>* %p) nounwind {
- %t = load <4 x float>* %p
- ret <4 x float> %t
-}
-define <2 x double> @bar(<2 x double>* %p) nounwind {
- %t = load <2 x double>* %p
- ret <2 x double> %t
-}
diff --git a/release_23/test/CodeGen/X86/sse-align-10.ll b/release_23/test/CodeGen/X86/sse-align-10.ll
deleted file mode 100644
index 1a23eb2ae3d1..000000000000
--- a/release_23/test/CodeGen/X86/sse-align-10.ll
+++ /dev/null
@@ -1,6 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86-64 | grep movups | count 1
-
-define <2 x i64> @bar(<2 x i64>* %p) nounwind {
- %t = load <2 x i64>* %p, align 8
- ret <2 x i64> %t
-}
diff --git a/release_23/test/CodeGen/X86/sse-align-11.ll b/release_23/test/CodeGen/X86/sse-align-11.ll
deleted file mode 100644
index a10b102c6b95..000000000000
--- a/release_23/test/CodeGen/X86/sse-align-11.ll
+++ /dev/null
@@ -1,12 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -mcpu=yonah -mtriple=i686-apple-darwin8 | grep movaps
-; RUN: llvm-as < %s | llc -march=x86 -mcpu=yonah -mtriple=linux | grep movups
-
-define <4 x float> @foo(float %a, float %b, float %c, float %d) nounwind {
-entry:
- %tmp6 = insertelement <4 x float> undef, float %a, i32 0
- %tmp7 = insertelement <4 x float> %tmp6, float %b, i32 1
- %tmp8 = insertelement <4 x float> %tmp7, float %c, i32 2
- %tmp9 = insertelement <4 x float> %tmp8, float %d, i32 3
- ret <4 x float> %tmp9
-}
-
diff --git a/release_23/test/CodeGen/X86/sse-align-12.ll b/release_23/test/CodeGen/X86/sse-align-12.ll
deleted file mode 100644
index 7ff6b1e3ed39..000000000000
--- a/release_23/test/CodeGen/X86/sse-align-12.ll
+++ /dev/null
@@ -1,48 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86-64 | grep unpck | count 2
-; RUN: llvm-as < %s | llc -march=x86-64 | grep shuf | count 2
-; RUN: llvm-as < %s | llc -march=x86-64 | grep ps | count 4
-; RUN: llvm-as < %s | llc -march=x86-64 | grep pd | count 4
-; RUN: llvm-as < %s | llc -march=x86-64 | grep movup | count 4
-
-define <4 x float> @a(<4 x float>* %y) nounwind {
- %x = load <4 x float>* %y, align 4
- %a = extractelement <4 x float> %x, i32 0
- %b = extractelement <4 x float> %x, i32 1
- %c = extractelement <4 x float> %x, i32 2
- %d = extractelement <4 x float> %x, i32 3
- %p = insertelement <4 x float> undef, float %d, i32 0
- %q = insertelement <4 x float> %p, float %c, i32 1
- %r = insertelement <4 x float> %q, float %b, i32 2
- %s = insertelement <4 x float> %r, float %a, i32 3
- ret <4 x float> %s
-}
-define <4 x float> @b(<4 x float>* %y, <4 x float> %z) nounwind {
- %x = load <4 x float>* %y, align 4
- %a = extractelement <4 x float> %x, i32 2
- %b = extractelement <4 x float> %x, i32 3
- %c = extractelement <4 x float> %z, i32 2
- %d = extractelement <4 x float> %z, i32 3
- %p = insertelement <4 x float> undef, float %c, i32 0
- %q = insertelement <4 x float> %p, float %a, i32 1
- %r = insertelement <4 x float> %q, float %d, i32 2
- %s = insertelement <4 x float> %r, float %b, i32 3
- ret <4 x float> %s
-}
-define <2 x double> @c(<2 x double>* %y)
-{
- %x = load <2 x double>* %y, align 8
- %a = extractelement <2 x double> %x, i32 0
- %c = extractelement <2 x double> %x, i32 1
- %p = insertelement <2 x double> undef, double %c, i32 0
- %r = insertelement <2 x double> %p, double %a, i32 1
- ret <2 x double> %r
-}
-define <2 x double> @d(<2 x double>* %y, <2 x double> %z)
-{
- %x = load <2 x double>* %y, align 8
- %a = extractelement <2 x double> %x, i32 1
- %c = extractelement <2 x double> %z, i32 1
- %p = insertelement <2 x double> undef, double %c, i32 0
- %r = insertelement <2 x double> %p, double %a, i32 1
- ret <2 x double> %r
-}
diff --git a/release_23/test/CodeGen/X86/sse-align-2.ll b/release_23/test/CodeGen/X86/sse-align-2.ll
deleted file mode 100644
index b5b261d20ab4..000000000000
--- a/release_23/test/CodeGen/X86/sse-align-2.ll
+++ /dev/null
@@ -1,12 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86-64 | grep movup | count 2
-
-define <4 x float> @foo(<4 x float>* %p, <4 x float> %x) nounwind {
- %t = load <4 x float>* %p, align 4
- %z = mul <4 x float> %t, %x
- ret <4 x float> %z
-}
-define <2 x double> @bar(<2 x double>* %p, <2 x double> %x) nounwind {
- %t = load <2 x double>* %p, align 8
- %z = mul <2 x double> %t, %x
- ret <2 x double> %z
-}
diff --git a/release_23/test/CodeGen/X86/sse-align-3.ll b/release_23/test/CodeGen/X86/sse-align-3.ll
deleted file mode 100644
index 5bbcd59e0e9f..000000000000
--- a/release_23/test/CodeGen/X86/sse-align-3.ll
+++ /dev/null
@@ -1,10 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86-64 | grep movap | count 2
-
-define void @foo(<4 x float>* %p, <4 x float> %x) nounwind {
- store <4 x float> %x, <4 x float>* %p
- ret void
-}
-define void @bar(<2 x double>* %p, <2 x double> %x) nounwind {
- store <2 x double> %x, <2 x double>* %p
- ret void
-}
diff --git a/release_23/test/CodeGen/X86/sse-align-4.ll b/release_23/test/CodeGen/X86/sse-align-4.ll
deleted file mode 100644
index f7e5fe3d684b..000000000000
--- a/release_23/test/CodeGen/X86/sse-align-4.ll
+++ /dev/null
@@ -1,10 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86-64 | grep movup | count 2
-
-define void @foo(<4 x float>* %p, <4 x float> %x) nounwind {
- store <4 x float> %x, <4 x float>* %p, align 4
- ret void
-}
-define void @bar(<2 x double>* %p, <2 x double> %x) nounwind {
- store <2 x double> %x, <2 x double>* %p, align 8
- ret void
-}
diff --git a/release_23/test/CodeGen/X86/sse-align-5.ll b/release_23/test/CodeGen/X86/sse-align-5.ll
deleted file mode 100644
index 19e0eaf8fff8..000000000000
--- a/release_23/test/CodeGen/X86/sse-align-5.ll
+++ /dev/null
@@ -1,6 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86-64 | grep movaps | count 1
-
-define <2 x i64> @bar(<2 x i64>* %p) nounwind {
- %t = load <2 x i64>* %p
- ret <2 x i64> %t
-}
diff --git a/release_23/test/CodeGen/X86/sse-align-6.ll b/release_23/test/CodeGen/X86/sse-align-6.ll
deleted file mode 100644
index dace291730f7..000000000000
--- a/release_23/test/CodeGen/X86/sse-align-6.ll
+++ /dev/null
@@ -1,7 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86-64 | grep movups | count 1
-
-define <2 x i64> @bar(<2 x i64>* %p, <2 x i64> %x) nounwind {
- %t = load <2 x i64>* %p, align 8
- %z = mul <2 x i64> %t, %x
- ret <2 x i64> %z
-}
diff --git a/release_23/test/CodeGen/X86/sse-align-7.ll b/release_23/test/CodeGen/X86/sse-align-7.ll
deleted file mode 100644
index 7fb65b5f9e85..000000000000
--- a/release_23/test/CodeGen/X86/sse-align-7.ll
+++ /dev/null
@@ -1,6 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86-64 | grep movaps | count 1
-
-define void @bar(<2 x i64>* %p, <2 x i64> %x) nounwind {
- store <2 x i64> %x, <2 x i64>* %p
- ret void
-}
diff --git a/release_23/test/CodeGen/X86/sse-align-8.ll b/release_23/test/CodeGen/X86/sse-align-8.ll
deleted file mode 100644
index 17a3d2987fff..000000000000
--- a/release_23/test/CodeGen/X86/sse-align-8.ll
+++ /dev/null
@@ -1,6 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86-64 | grep movups | count 1
-
-define void @bar(<2 x i64>* %p, <2 x i64> %x) nounwind {
- store <2 x i64> %x, <2 x i64>* %p, align 8
- ret void
-}
diff --git a/release_23/test/CodeGen/X86/sse-align-9.ll b/release_23/test/CodeGen/X86/sse-align-9.ll
deleted file mode 100644
index 24b437ab3534..000000000000
--- a/release_23/test/CodeGen/X86/sse-align-9.ll
+++ /dev/null
@@ -1,10 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86-64 | grep movup | count 2
-
-define <4 x float> @foo(<4 x float>* %p) nounwind {
- %t = load <4 x float>* %p, align 4
- ret <4 x float> %t
-}
-define <2 x double> @bar(<2 x double>* %p) nounwind {
- %t = load <2 x double>* %p, align 8
- ret <2 x double> %t
-}
diff --git a/release_23/test/CodeGen/X86/sse-fcopysign.ll b/release_23/test/CodeGen/X86/sse-fcopysign.ll
deleted file mode 100644
index cff1f7fa86f6..000000000000
--- a/release_23/test/CodeGen/X86/sse-fcopysign.ll
+++ /dev/null
@@ -1,16 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | not grep test
-
-define float @tst1(float %a, float %b) {
- %tmp = tail call float @copysignf( float %b, float %a )
- ret float %tmp
-}
-
-define double @tst2(double %a, float %b, float %c) {
- %tmp1 = add float %b, %c
- %tmp2 = fpext float %tmp1 to double
- %tmp = tail call double @copysign( double %a, double %tmp2 )
- ret double %tmp
-}
-
-declare float @copysignf(float, float)
-declare double @copysign(double, double)
diff --git a/release_23/test/CodeGen/X86/sse-load-ret.ll b/release_23/test/CodeGen/X86/sse-load-ret.ll
deleted file mode 100644
index cbf3eb0e5f0d..000000000000
--- a/release_23/test/CodeGen/X86/sse-load-ret.ll
+++ /dev/null
@@ -1,21 +0,0 @@
-; RUN: llvm-as < %s | \
-; RUN: llc -march=x86 -mcpu=yonah | not grep movss
-; RUN: llvm-as < %s | \
-; RUN: llc -march=x86 -mcpu=yonah | not grep xmm
-
-define double @test1(double* %P) {
- %X = load double* %P ; <double> [#uses=1]
- ret double %X
-}
-
-define double @test2() {
- ret double 1.234560e+03
-}
-
-
-; FIXME: Todo
-;double %test3(bool %B) {
-; %C = select bool %B, double 123.412, double 523.01123123
-; ret double %C
-;}
-
diff --git a/release_23/test/CodeGen/X86/sse-varargs.ll b/release_23/test/CodeGen/X86/sse-varargs.ll
deleted file mode 100644
index 806126da2faf..000000000000
--- a/release_23/test/CodeGen/X86/sse-varargs.ll
+++ /dev/null
@@ -1,9 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep xmm | grep esp
-
-define i32 @t() nounwind {
-entry:
- tail call void (i32, ...)* @foo( i32 1, <4 x i32> < i32 10, i32 11, i32 12, i32 13 > ) nounwind
- ret i32 0
-}
-
-declare void @foo(i32, ...)
diff --git a/release_23/test/CodeGen/X86/sse41-extractps-bitcast-0.ll b/release_23/test/CodeGen/X86/sse41-extractps-bitcast-0.ll
deleted file mode 100644
index bcfaa7a0e5a2..000000000000
--- a/release_23/test/CodeGen/X86/sse41-extractps-bitcast-0.ll
+++ /dev/null
@@ -1,12 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -mattr=sse41 | grep extractps | count 2
-
-define i32 @foo(<4 x float> %v) {
- %s = extractelement <4 x float> %v, i32 3
- %i = bitcast float %s to i32
- ret i32 %i
-}
-define i32 @boo(<4 x float> %v) {
- %t = bitcast <4 x float> %v to <4 x i32>
- %s = extractelement <4 x i32> %t, i32 3
- ret i32 %s
-}
diff --git a/release_23/test/CodeGen/X86/sse41-extractps-bitcast-1.ll b/release_23/test/CodeGen/X86/sse41-extractps-bitcast-1.ll
deleted file mode 100644
index fc0df060623f..000000000000
--- a/release_23/test/CodeGen/X86/sse41-extractps-bitcast-1.ll
+++ /dev/null
@@ -1,19 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -mattr=sse41 | not grep extractps
-
-; The non-store form of extractps puts its result into a GPR.
-; This makes it suitable for an extract from a <4 x float> that
-; is bitcasted to i32, but unsuitable for much of anything else.
-
-define float @bar(<4 x float> %v) {
- %s = extractelement <4 x float> %v, i32 3
- %t = add float %s, 1.0
- ret float %t
-}
-define float @baz(<4 x float> %v) {
- %s = extractelement <4 x float> %v, i32 3
- ret float %s
-}
-define i32 @qux(<4 x i32> %v) {
- %i = extractelement <4 x i32> %v, i32 3
- ret i32 %i
-}
diff --git a/release_23/test/CodeGen/X86/sse_reload_fold.ll b/release_23/test/CodeGen/X86/sse_reload_fold.ll
deleted file mode 100644
index 1100eb7c4670..000000000000
--- a/release_23/test/CodeGen/X86/sse_reload_fold.ll
+++ /dev/null
@@ -1,124 +0,0 @@
-; RUN: llvm-as < %s | \
-; RUN: llc -march=x86-64 -mattr=+64bit,+sse3 -print-failed-fuse-candidates |& \
-; RUN: grep fail | count 1
-
-declare void @bar()
-declare <4 x float> @qux()
-declare <2 x double> @pin()
-declare float @llvm.sqrt.f32(float)
-declare double @llvm.sqrt.f64(double)
-
-declare <4 x float> @llvm.x86.sse.rsqrt.ps(<4 x float>)
-declare <4 x float> @llvm.x86.sse.sqrt.ps(<4 x float>)
-declare <4 x float> @llvm.x86.sse.rcp.ps(<4 x float>)
-declare <4 x float> @llvm.x86.sse.min.ps(<4 x float>, <4 x float>)
-declare <4 x float> @llvm.x86.sse.max.ps(<4 x float>, <4 x float>)
-declare <4 x float> @llvm.x86.sse.cmp.ps(<4 x float>, <4 x float>, i8)
-declare <4 x float> @llvm.x86.sse3.addsub.ps(<4 x float>, <4 x float>)
-declare <4 x float> @llvm.x86.sse3.hadd.ps(<4 x float>, <4 x float>)
-declare <4 x float> @llvm.x86.sse3.hsub.ps(<4 x float>, <4 x float>)
-declare <2 x double> @llvm.x86.sse2.sqrt.pd(<2 x double>)
-declare <2 x double> @llvm.x86.sse2.min.pd(<2 x double>, <2 x double>)
-declare <2 x double> @llvm.x86.sse2.max.pd(<2 x double>, <2 x double>)
-declare <2 x double> @llvm.x86.sse2.cmp.pd(<2 x double>, <2 x double>, i8)
-declare <2 x double> @llvm.x86.sse3.addsub.pd(<2 x double>, <2 x double>)
-declare <2 x double> @llvm.x86.sse3.hadd.pd(<2 x double>, <2 x double>)
-declare <2 x double> @llvm.x86.sse3.hsub.pd(<2 x double>, <2 x double>)
-
-define float @foo(float %f) {
- call void @bar()
- %t = call float @llvm.sqrt.f32(float %f)
- ret float %t
-}
-define double @doo(double %f) {
- call void @bar()
- %t = call double @llvm.sqrt.f64(double %f)
- ret double %t
-}
-define <4 x float> @a0(<4 x float> %f) {
- call void @bar()
- %t = call <4 x float> @llvm.x86.sse.rsqrt.ps(<4 x float> %f)
- ret <4 x float> %t
-}
-define <4 x float> @a1(<4 x float> %f) {
- call void @bar()
- %t = call <4 x float> @llvm.x86.sse.sqrt.ps(<4 x float> %f)
- ret <4 x float> %t
-}
-define <4 x float> @a2(<4 x float> %f) {
- call void @bar()
- %t = call <4 x float> @llvm.x86.sse.rcp.ps(<4 x float> %f)
- ret <4 x float> %t
-}
-define <4 x float> @b3(<4 x float> %f) {
- %y = call <4 x float> @qux()
- %t = call <4 x float> @llvm.x86.sse.min.ps(<4 x float> %y, <4 x float> %f)
- ret <4 x float> %t
-}
-define <4 x float> @b4(<4 x float> %f) {
- %y = call <4 x float> @qux()
- %t = call <4 x float> @llvm.x86.sse.max.ps(<4 x float> %y, <4 x float> %f)
- ret <4 x float> %t
-}
-define <4 x float> @b5(<4 x float> %f) {
- %y = call <4 x float> @qux()
- %t = call <4 x float> @llvm.x86.sse.cmp.ps(<4 x float> %y, <4 x float> %f, i8 7)
- ret <4 x float> %t
-}
-define <4 x float> @b6(<4 x float> %f) {
- %y = call <4 x float> @qux()
- %t = call <4 x float> @llvm.x86.sse3.addsub.ps(<4 x float> %y, <4 x float> %f)
- ret <4 x float> %t
-}
-define <4 x float> @b7(<4 x float> %f) {
- %y = call <4 x float> @qux()
- %t = call <4 x float> @llvm.x86.sse3.hadd.ps(<4 x float> %y, <4 x float> %f)
- ret <4 x float> %t
-}
-define <4 x float> @b8(<4 x float> %f) {
- %y = call <4 x float> @qux()
- %t = call <4 x float> @llvm.x86.sse3.hsub.ps(<4 x float> %y, <4 x float> %f)
- ret <4 x float> %t
-}
-define <2 x double> @c1(<2 x double> %f) {
- call void @bar()
- %t = call <2 x double> @llvm.x86.sse2.sqrt.pd(<2 x double> %f)
- ret <2 x double> %t
-}
-define <2 x double> @d3(<2 x double> %f) {
- %y = call <2 x double> @pin()
- %t = call <2 x double> @llvm.x86.sse2.min.pd(<2 x double> %y, <2 x double> %f)
- ret <2 x double> %t
-}
-define <2 x double> @d4(<2 x double> %f) {
- %y = call <2 x double> @pin()
- %t = call <2 x double> @llvm.x86.sse2.max.pd(<2 x double> %y, <2 x double> %f)
- ret <2 x double> %t
-}
-define <2 x double> @d5(<2 x double> %f) {
- %y = call <2 x double> @pin()
- %t = call <2 x double> @llvm.x86.sse2.cmp.pd(<2 x double> %y, <2 x double> %f, i8 7)
- ret <2 x double> %t
-}
-define <2 x double> @d6(<2 x double> %f) {
- %y = call <2 x double> @pin()
- %t = call <2 x double> @llvm.x86.sse3.addsub.pd(<2 x double> %y, <2 x double> %f)
- ret <2 x double> %t
-}
-define <2 x double> @d7(<2 x double> %f) {
- %y = call <2 x double> @pin()
- %t = call <2 x double> @llvm.x86.sse3.hadd.pd(<2 x double> %y, <2 x double> %f)
- ret <2 x double> %t
-}
-define <2 x double> @d8(<2 x double> %f) {
- %y = call <2 x double> @pin()
- %t = call <2 x double> @llvm.x86.sse3.hsub.pd(<2 x double> %y, <2 x double> %f)
- ret <2 x double> %t
-}
-
-; This one should fail to fuse.
-define <2 x double> @z0(<2 x double> %f) {
- %y = call <2 x double> @pin()
- %t = call <2 x double> @llvm.x86.sse3.hsub.pd(<2 x double> %f, <2 x double> %y)
- ret <2 x double> %t
-}
diff --git a/release_23/test/CodeGen/X86/stack-align.ll b/release_23/test/CodeGen/X86/stack-align.ll
deleted file mode 100644
index 1e6c2b2af060..000000000000
--- a/release_23/test/CodeGen/X86/stack-align.ll
+++ /dev/null
@@ -1,22 +0,0 @@
-; RUN: llvm-as < %s | llc -relocation-model=static -mcpu=yonah | grep {andpd.*4(%esp), %xmm}
-
-; The double argument is at 4(esp) which is 16-byte aligned, allowing us to
-; fold the load into the andpd.
-
-target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
-target triple = "i686-apple-darwin8"
-@G = external global double
-
-define void @test({ double, double }* byval %z, double* %P) {
-entry:
- %tmp = getelementptr { double, double }* %z, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp1 = load double* %tmp, align 8 ; <double> [#uses=1]
- %tmp2 = tail call double @fabs( double %tmp1 ) ; <double> [#uses=1]
- %tmp3 = load double* @G, align 16 ; <double> [#uses=1]
- %tmp4 = tail call double @fabs( double %tmp3 ) ; <double> [#uses=1]
- %tmp6 = add double %tmp4, %tmp2 ; <double> [#uses=1]
- store double %tmp6, double* %P, align 8
- ret void
-}
-
-declare double @fabs(double)
diff --git a/release_23/test/CodeGen/X86/store-fp-constant.ll b/release_23/test/CodeGen/X86/store-fp-constant.ll
deleted file mode 100644
index 70cb046600bc..000000000000
--- a/release_23/test/CodeGen/X86/store-fp-constant.ll
+++ /dev/null
@@ -1,19 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 | not grep rodata
-; RUN: llvm-as < %s | llc -march=x86 | not grep literal
-;
-; Check that no FP constants in this testcase ends up in the
-; constant pool.
-
-@G = external global float ; <float*> [#uses=1]
-
-declare void @extfloat(float)
-
-declare void @extdouble(double)
-
-define void @testfloatstore() {
- call void @extfloat( float 0x40934999A0000000 )
- call void @extdouble( double 0x409349A631F8A090 )
- store float 0x402A064C20000000, float* @G
- ret void
-}
-
diff --git a/release_23/test/CodeGen/X86/store-global-address.ll b/release_23/test/CodeGen/X86/store-global-address.ll
deleted file mode 100644
index 0695eee9a888..000000000000
--- a/release_23/test/CodeGen/X86/store-global-address.ll
+++ /dev/null
@@ -1,10 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 | grep movl | count 1
-
-@dst = global i32 0 ; <i32*> [#uses=1]
-@ptr = global i32* null ; <i32**> [#uses=1]
-
-define void @test() {
- store i32* @dst, i32** @ptr
- ret void
-}
-
diff --git a/release_23/test/CodeGen/X86/store_op_load_fold.ll b/release_23/test/CodeGen/X86/store_op_load_fold.ll
deleted file mode 100644
index acef17463878..000000000000
--- a/release_23/test/CodeGen/X86/store_op_load_fold.ll
+++ /dev/null
@@ -1,13 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 | not grep mov
-;
-; Test the add and load are folded into the store instruction.
-
-@X = internal global i16 0 ; <i16*> [#uses=2]
-
-define void @foo() {
- %tmp.0 = load i16* @X ; <i16> [#uses=1]
- %tmp.3 = add i16 %tmp.0, 329 ; <i16> [#uses=1]
- store i16 %tmp.3, i16* @X
- ret void
-}
-
diff --git a/release_23/test/CodeGen/X86/store_op_load_fold2.ll b/release_23/test/CodeGen/X86/store_op_load_fold2.ll
deleted file mode 100644
index 09aaba155d99..000000000000
--- a/release_23/test/CodeGen/X86/store_op_load_fold2.ll
+++ /dev/null
@@ -1,34 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -x86-asm-syntax=intel | \
-; RUN: grep {and DWORD PTR} | count 2
-
-target datalayout = "e-p:32:32"
- %struct.Macroblock = type { i32, i32, i32, i32, i32, [8 x i32], %struct.Macroblock*, %struct.Macroblock*, i32, [2 x [4 x [4 x [2 x i32]]]], [16 x i8], [16 x i8], i32, i64, [4 x i32], [4 x i32], i64, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i16, double, i32, i32, i32, i32, i32, i32, i32, i32, i32 }
-
-define internal fastcc i32 @dct_chroma(i32 %uv, i32 %cr_cbp) {
-entry:
- br i1 true, label %cond_true2732.preheader, label %cond_true129
-cond_true129: ; preds = %entry
- ret i32 0
-cond_true2732.preheader: ; preds = %entry
- %tmp2666 = getelementptr %struct.Macroblock* null, i32 0, i32 13 ; <i64*> [#uses=2]
- %tmp2674 = trunc i32 0 to i8 ; <i8> [#uses=1]
- br i1 true, label %cond_true2732.preheader.split.us, label %cond_true2732.preheader.split
-cond_true2732.preheader.split.us: ; preds = %cond_true2732.preheader
- br i1 true, label %cond_true2732.outer.us.us, label %cond_true2732.outer.us
-cond_true2732.outer.us.us: ; preds = %cond_true2732.preheader.split.us
- %tmp2667.us.us = load i64* %tmp2666 ; <i64> [#uses=1]
- %tmp2670.us.us = load i64* null ; <i64> [#uses=1]
- %shift.upgrd.1 = zext i8 %tmp2674 to i64 ; <i64> [#uses=1]
- %tmp2675.us.us = shl i64 %tmp2670.us.us, %shift.upgrd.1 ; <i64> [#uses=1]
- %tmp2675not.us.us = xor i64 %tmp2675.us.us, -1 ; <i64> [#uses=1]
- %tmp2676.us.us = and i64 %tmp2667.us.us, %tmp2675not.us.us ; <i64> [#uses=1]
- store i64 %tmp2676.us.us, i64* %tmp2666
- ret i32 0
-cond_true2732.outer.us: ; preds = %cond_true2732.preheader.split.us
- ret i32 0
-cond_true2732.preheader.split: ; preds = %cond_true2732.preheader
- ret i32 0
-cond_next2752: ; No predecessors!
- ret i32 0
-}
-
diff --git a/release_23/test/CodeGen/X86/storetrunc-fp.ll b/release_23/test/CodeGen/X86/storetrunc-fp.ll
deleted file mode 100644
index 655cbd68b37a..000000000000
--- a/release_23/test/CodeGen/X86/storetrunc-fp.ll
+++ /dev/null
@@ -1,8 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 | not grep flds
-
-define void @foo(x86_fp80 %a, x86_fp80 %b, float* %fp) {
- %c = add x86_fp80 %a, %b
- %d = fptrunc x86_fp80 %c to float
- store float %d, float* %fp
- ret void
-}
diff --git a/release_23/test/CodeGen/X86/stride-nine-with-base-reg.ll b/release_23/test/CodeGen/X86/stride-nine-with-base-reg.ll
deleted file mode 100644
index 4bd9924f2654..000000000000
--- a/release_23/test/CodeGen/X86/stride-nine-with-base-reg.ll
+++ /dev/null
@@ -1,34 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -relocation-model=static | grep lea | count 1
-; RUN: llvm-as < %s | llc -march=x86-64 | not grep lea
-
-; For x86 there's an lea above the loop. In both cases, there shouldn't
-; be any lea instructions inside the loop.
-
-@B = external global [1000 x i8], align 32
-@A = external global [1000 x i8], align 32
-@P = external global [1000 x i8], align 32
-
-define void @foo(i32 %m, i32 %p) {
-entry:
- %tmp1 = icmp sgt i32 %m, 0
- br i1 %tmp1, label %bb, label %return
-
-bb:
- %i.019.0 = phi i32 [ %indvar.next, %bb ], [ 0, %entry ]
- %tmp2 = getelementptr [1000 x i8]* @B, i32 0, i32 %i.019.0
- %tmp3 = load i8* %tmp2, align 4
- %tmp4 = mul i8 %tmp3, 2
- %tmp5 = getelementptr [1000 x i8]* @A, i32 0, i32 %i.019.0
- store i8 %tmp4, i8* %tmp5, align 4
- %tmp8 = mul i32 %i.019.0, 9
- %tmp0 = add i32 %tmp8, %p
- %tmp10 = getelementptr [1000 x i8]* @P, i32 0, i32 %tmp0
- store i8 17, i8* %tmp10, align 4
- %indvar.next = add i32 %i.019.0, 1
- %exitcond = icmp eq i32 %indvar.next, %m
- br i1 %exitcond, label %return, label %bb
-
-return:
- ret void
-}
-
diff --git a/release_23/test/CodeGen/X86/stride-reuse.ll b/release_23/test/CodeGen/X86/stride-reuse.ll
deleted file mode 100644
index 97f33d8adbcb..000000000000
--- a/release_23/test/CodeGen/X86/stride-reuse.ll
+++ /dev/null
@@ -1,30 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 | not grep lea
-; RUN: llvm-as < %s | llc -march=x86-64 | not grep lea
-
-@B = external global [1000 x float], align 32
-@A = external global [1000 x float], align 32
-@P = external global [1000 x i32], align 32
-
-define void @foo(i32 %m) {
-entry:
- %tmp1 = icmp sgt i32 %m, 0
- br i1 %tmp1, label %bb, label %return
-
-bb:
- %i.019.0 = phi i32 [ %indvar.next, %bb ], [ 0, %entry ]
- %tmp2 = getelementptr [1000 x float]* @B, i32 0, i32 %i.019.0
- %tmp3 = load float* %tmp2, align 4
- %tmp4 = mul float %tmp3, 2.000000e+00
- %tmp5 = getelementptr [1000 x float]* @A, i32 0, i32 %i.019.0
- store float %tmp4, float* %tmp5, align 4
- %tmp8 = shl i32 %i.019.0, 1
- %tmp9 = add i32 %tmp8, 64
- %tmp10 = getelementptr [1000 x i32]* @P, i32 0, i32 %i.019.0
- store i32 %tmp9, i32* %tmp10, align 4
- %indvar.next = add i32 %i.019.0, 1
- %exitcond = icmp eq i32 %indvar.next, %m
- br i1 %exitcond, label %return, label %bb
-
-return:
- ret void
-}
diff --git a/release_23/test/CodeGen/X86/tailcall1.ll b/release_23/test/CodeGen/X86/tailcall1.ll
deleted file mode 100644
index deedb86e95b8..000000000000
--- a/release_23/test/CodeGen/X86/tailcall1.ll
+++ /dev/null
@@ -1,11 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -tailcallopt | grep TAILCALL
-define fastcc i32 @tailcallee(i32 %a1, i32 %a2, i32 %a3, i32 %a4) {
-entry:
- ret i32 %a3
-}
-
-define fastcc i32 @tailcaller(i32 %in1, i32 %in2) {
-entry:
- %tmp11 = tail call fastcc i32 @tailcallee( i32 %in1, i32 %in2, i32 %in1, i32 %in2 ) ; <i32> [#uses=1]
- ret i32 %tmp11
-}
diff --git a/release_23/test/CodeGen/X86/tailcallbyval.ll b/release_23/test/CodeGen/X86/tailcallbyval.ll
deleted file mode 100644
index 9085b050ec54..000000000000
--- a/release_23/test/CodeGen/X86/tailcallbyval.ll
+++ /dev/null
@@ -1,19 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -tailcallopt | grep TAILCALL
-; check for the 2 byval moves
-; RUN: llvm-as < %s | llc -march=x86 -tailcallopt | grep rep | wc -l | grep 2
-%struct.s = type {i32, i32, i32, i32, i32, i32, i32, i32,
- i32, i32, i32, i32, i32, i32, i32, i32,
- i32, i32, i32, i32, i32, i32, i32, i32 }
-
-define fastcc i32 @tailcallee(%struct.s* byval %a) {
-entry:
- %tmp2 = getelementptr %struct.s* %a, i32 0, i32 0
- %tmp3 = load i32* %tmp2
- ret i32 %tmp3
-}
-
-define fastcc i32 @tailcaller(%struct.s* byval %a) {
-entry:
- %tmp4 = tail call fastcc i32 @tailcallee(%struct.s* %a byval)
- ret i32 %tmp4
-}
diff --git a/release_23/test/CodeGen/X86/tailcallbyval64.ll b/release_23/test/CodeGen/X86/tailcallbyval64.ll
deleted file mode 100644
index 7b65863f00b0..000000000000
--- a/release_23/test/CodeGen/X86/tailcallbyval64.ll
+++ /dev/null
@@ -1,29 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86-64 -tailcallopt | grep TAILCALL
-; Expect 2 rep;movs because of tail call byval lowering.
-; RUN: llvm-as < %s | llc -march=x86-64 -tailcallopt | grep rep | wc -l | grep 2
-; A sequence of copyto/copyfrom virtual registers is used to deal with byval
-; lowering appearing after moving arguments to registers. The following two
-; checks verify that the register allocator changes those sequences to direct
-; moves to argument register where it can (for registers that are not used in
-; byval lowering - not rsi, not rdi, not rcx).
-; Expect argument 4 to be moved directly to register edx.
-; RUN: llvm-as < %s | llc -march=x86-64 -tailcallopt | grep movl | grep {7} | grep edx
-; Expect argument 6 to be moved directly to register r8.
-; RUN: llvm-as < %s | llc -march=x86-64 -tailcallopt | grep movl | grep {17} | grep r8
-
-%struct.s = type { i64, i64, i64, i64, i64, i64, i64, i64,
- i64, i64, i64, i64, i64, i64, i64, i64,
- i64, i64, i64, i64, i64, i64, i64, i64 }
-
-declare fastcc i64 @tailcallee(%struct.s* byval %a, i64 %val, i64 %val2, i64 %val3, i64 %val4, i64 %val5)
-
-
-define fastcc i64 @tailcaller(i64 %b, %struct.s* byval %a) {
-entry:
- %tmp2 = getelementptr %struct.s* %a, i32 0, i32 1
- %tmp3 = load i64* %tmp2, align 8
- %tmp4 = tail call fastcc i64 @tailcallee(%struct.s* %a byval, i64 %tmp3, i64 %b, i64 7, i64 13, i64 17)
- ret i64 %tmp4
-}
-
-
diff --git a/release_23/test/CodeGen/X86/tailcallpic1.ll b/release_23/test/CodeGen/X86/tailcallpic1.ll
deleted file mode 100644
index 54074eb0ba2a..000000000000
--- a/release_23/test/CodeGen/X86/tailcallpic1.ll
+++ /dev/null
@@ -1,12 +0,0 @@
-; RUN: llvm-as < %s | llc -tailcallopt -mtriple=i686-pc-linux-gnu -relocation-model=pic | grep TAILCALL
-
-define protected fastcc i32 @tailcallee(i32 %a1, i32 %a2, i32 %a3, i32 %a4) {
-entry:
- ret i32 %a3
-}
-
-define fastcc i32 @tailcaller(i32 %in1, i32 %in2) {
-entry:
- %tmp11 = tail call fastcc i32 @tailcallee( i32 %in1, i32 %in2, i32 %in1, i32 %in2 ) ; <i32> [#uses=1]
- ret i32 %tmp11
-}
diff --git a/release_23/test/CodeGen/X86/tailcallpic2.ll b/release_23/test/CodeGen/X86/tailcallpic2.ll
deleted file mode 100644
index 60818e4f62c6..000000000000
--- a/release_23/test/CodeGen/X86/tailcallpic2.ll
+++ /dev/null
@@ -1,12 +0,0 @@
-; RUN: llvm-as < %s | llc -tailcallopt -mtriple=i686-pc-linux-gnu -relocation-model=pic | grep -v TAILCALL
-
-define fastcc i32 @tailcallee(i32 %a1, i32 %a2, i32 %a3, i32 %a4) {
-entry:
- ret i32 %a3
-}
-
-define fastcc i32 @tailcaller(i32 %in1, i32 %in2) {
-entry:
- %tmp11 = tail call fastcc i32 @tailcallee( i32 %in1, i32 %in2, i32 %in1, i32 %in2 ) ; <i32> [#uses=1]
- ret i32 %tmp11
-}
diff --git a/release_23/test/CodeGen/X86/tailcallstack64.ll b/release_23/test/CodeGen/X86/tailcallstack64.ll
deleted file mode 100644
index d734065c005c..000000000000
--- a/release_23/test/CodeGen/X86/tailcallstack64.ll
+++ /dev/null
@@ -1,21 +0,0 @@
-; RUN: llvm-as < %s | llc -tailcallopt -march=x86-64 | grep TAILCALL
-; Check that lowered arguments on the stack do not overwrite each other.
-; Move param %in1 to temp register (%eax).
-; RUN: llvm-as < %s | llc -tailcallopt -march=x86-64 -x86-asm-syntax=att | grep {movl 40(%rsp), %eax}
-; Add %in1 %p1 to another temporary register (%r9d).
-; RUN: llvm-as < %s | llc -tailcallopt -march=x86-64 -x86-asm-syntax=att | grep {movl %edi, %r9d}
-; RUN: llvm-as < %s | llc -tailcallopt -march=x86-64 -x86-asm-syntax=att | grep {addl 32(%rsp), %r9d}
-; Move result of addition to stack.
-; RUN: llvm-as < %s | llc -tailcallopt -march=x86-64 -x86-asm-syntax=att | grep {movl %r9d, 40(%rsp)}
-; Move param %in2 to stack.
-; RUN: llvm-as < %s | llc -tailcallopt -march=x86-64 -x86-asm-syntax=att | grep {movl %eax, 32(%rsp)}
-
-declare fastcc i32 @tailcallee(i32 %p1, i32 %p2, i32 %p3, i32 %p4, i32 %p5, i32 %a, i32 %b)
-
-define fastcc i32 @tailcaller(i32 %p1, i32 %p2, i32 %p3, i32 %p4, i32 %p5, i32 %in1, i32 %in2) {
-entry:
- %tmp = add i32 %in1, %p1
- %retval = tail call fastcc i32 @tailcallee(i32 %p1, i32 %p2, i32 %p3, i32 %p4, i32 %p5, i32 %in2,i32 %tmp)
- ret i32 %retval
-}
-
diff --git a/release_23/test/CodeGen/X86/test-nofold.ll b/release_23/test/CodeGen/X86/test-nofold.ll
deleted file mode 100644
index a24a9a0940a0..000000000000
--- a/release_23/test/CodeGen/X86/test-nofold.ll
+++ /dev/null
@@ -1,29 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -mcpu=yonah | grep {testl.*%e.x.*%e.x}
-; rdar://5752025
-
-; We don't want to fold the and into the test, because the and clobbers its
-; input forcing a copy. We want:
-; movl $15, %ecx
-; andl 4(%esp), %ecx
-; testl %ecx, %ecx
-; movl $42, %eax
-; cmove %ecx, %eax
-; ret
-;
-; Not:
-; movl 4(%esp), %eax
-; movl %eax, %ecx
-; andl $15, %ecx
-; testl $15, %eax
-; movl $42, %eax
-; cmove %ecx, %eax
-; ret
-
-define i32 @t1(i32 %X) nounwind {
-entry:
- %tmp2 = and i32 %X, 15 ; <i32> [#uses=2]
- %tmp4 = icmp eq i32 %tmp2, 0 ; <i1> [#uses=1]
- %retval = select i1 %tmp4, i32 %tmp2, i32 42 ; <i32> [#uses=1]
- ret i32 %retval
-}
-
diff --git a/release_23/test/CodeGen/X86/tls1.ll b/release_23/test/CodeGen/X86/tls1.ll
deleted file mode 100644
index c4025034bced..000000000000
--- a/release_23/test/CodeGen/X86/tls1.ll
+++ /dev/null
@@ -1,19 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -mtriple=i386-linux-gnu | \
-; RUN: grep {movl %gs:i@NTPOFF, %eax}
-; RUN: llvm-as < %s | llc -march=x86 -mtriple=i386-linux-gnu | \
-; RUN: grep {leal i@NTPOFF(%eax), %eax}
-; RUN: llvm-as < %s | llc -march=x86 -mtriple=i386-linux-gnu -relocation-model=pic | \
-; RUN: grep {leal i@TLSGD(,%ebx,1), %eax}
-
-@i = thread_local global i32 15 ; <i32*> [#uses=2]
-
-define i32 @f() {
-entry:
- %tmp1 = load i32* @i ; <i32> [#uses=1]
- ret i32 %tmp1
-}
-
-define i32* @g() {
-entry:
- ret i32* @i
-}
diff --git a/release_23/test/CodeGen/X86/tls2.ll b/release_23/test/CodeGen/X86/tls2.ll
deleted file mode 100644
index c9b73fba8c7d..000000000000
--- a/release_23/test/CodeGen/X86/tls2.ll
+++ /dev/null
@@ -1,19 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -mtriple=i386-linux-gnu | \
-; RUN: grep {movl %gs:(%eax), %eax}
-; RUN: llvm-as < %s | llc -march=x86 -mtriple=i386-linux-gnu | \
-; RUN: grep {addl i@INDNTPOFF, %eax}
-; RUN: llvm-as < %s | llc -march=x86 -mtriple=i386-linux-gnu -relocation-model=pic | \
-; RUN: grep {leal i@TLSGD(,%ebx,1), %eax}
-
-@i = external thread_local global i32 ; <i32*> [#uses=2]
-
-define i32 @f() {
-entry:
- %tmp1 = load i32* @i ; <i32> [#uses=1]
- ret i32 %tmp1
-}
-
-define i32* @g() {
-entry:
- ret i32* @i
-}
diff --git a/release_23/test/CodeGen/X86/trap.ll b/release_23/test/CodeGen/X86/trap.ll
deleted file mode 100644
index 9a013ffbe565..000000000000
--- a/release_23/test/CodeGen/X86/trap.ll
+++ /dev/null
@@ -1,9 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -mcpu=yonah | grep ud2
-define i32 @test() noreturn nounwind {
-entry:
- tail call void @llvm.trap( )
- unreachable
-}
-
-declare void @llvm.trap() nounwind
-
diff --git a/release_23/test/CodeGen/X86/trunc-to-bool.ll b/release_23/test/CodeGen/X86/trunc-to-bool.ll
deleted file mode 100644
index 9dd14252ace8..000000000000
--- a/release_23/test/CodeGen/X86/trunc-to-bool.ll
+++ /dev/null
@@ -1,60 +0,0 @@
-; An integer truncation to i1 should be done with an and instruction to make
-; sure only the LSBit survives. Test that this is the case both for a returned
-; value and as the operand of a branch.
-; RUN: llvm-as < %s | llc -march=x86 | grep {\\(and\\)\\|\\(test.*\\\$1\\)} | \
-; RUN: count 6
-
-define i1 @test1(i32 %X) zeroext {
- %Y = trunc i32 %X to i1
- ret i1 %Y
-}
-
-define i1 @test2(i32 %val, i32 %mask) {
-entry:
- %shifted = ashr i32 %val, %mask
- %anded = and i32 %shifted, 1
- %trunced = trunc i32 %anded to i1
- br i1 %trunced, label %ret_true, label %ret_false
-ret_true:
- ret i1 true
-ret_false:
- ret i1 false
-}
-
-define i32 @test3(i8* %ptr) {
- %val = load i8* %ptr
- %tmp = trunc i8 %val to i1
- br i1 %tmp, label %cond_true, label %cond_false
-cond_true:
- ret i32 21
-cond_false:
- ret i32 42
-}
-
-define i32 @test4(i8* %ptr) {
- %tmp = ptrtoint i8* %ptr to i1
- br i1 %tmp, label %cond_true, label %cond_false
-cond_true:
- ret i32 21
-cond_false:
- ret i32 42
-}
-
-define i32 @test5(float %f) {
- %tmp = fptoui float %f to i1
- br i1 %tmp, label %cond_true, label %cond_false
-cond_true:
- ret i32 21
-cond_false:
- ret i32 42
-}
-
-define i32 @test6(double %d) {
- %tmp = fptosi double %d to i1
- br i1 %tmp, label %cond_true, label %cond_false
-cond_true:
- ret i32 21
-cond_false:
- ret i32 42
-}
-
diff --git a/release_23/test/CodeGen/X86/twoaddr-pass-sink.ll b/release_23/test/CodeGen/X86/twoaddr-pass-sink.ll
deleted file mode 100644
index 765588059f75..000000000000
--- a/release_23/test/CodeGen/X86/twoaddr-pass-sink.ll
+++ /dev/null
@@ -1,29 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 -stats |& grep {Number of 3-address instructions sunk}
-
-define void @t2(<2 x i64>* %vDct, <2 x i64>* %vYp, i8* %skiplist, <2 x i64> %a1) nounwind {
-entry:
- %tmp25 = bitcast <2 x i64> %a1 to <8 x i16> ; <<8 x i16>> [#uses=1]
- br label %bb
-bb: ; preds = %bb, %entry
- %skiplist_addr.0.rec = phi i32 [ 0, %entry ], [ %indvar.next, %bb ] ; <i32> [#uses=3]
- %vYp_addr.0.rec = shl i32 %skiplist_addr.0.rec, 3 ; <i32> [#uses=3]
- %vDct_addr.0 = getelementptr <2 x i64>* %vDct, i32 %vYp_addr.0.rec ; <<2 x i64>*> [#uses=1]
- %vYp_addr.0 = getelementptr <2 x i64>* %vYp, i32 %vYp_addr.0.rec ; <<2 x i64>*> [#uses=1]
- %skiplist_addr.0 = getelementptr i8* %skiplist, i32 %skiplist_addr.0.rec ; <i8*> [#uses=1]
- %vDct_addr.0.sum43 = or i32 %vYp_addr.0.rec, 1 ; <i32> [#uses=1]
- %tmp7 = getelementptr <2 x i64>* %vDct, i32 %vDct_addr.0.sum43 ; <<2 x i64>*> [#uses=1]
- %tmp8 = load <2 x i64>* %tmp7, align 16 ; <<2 x i64>> [#uses=1]
- %tmp11 = load <2 x i64>* %vDct_addr.0, align 16 ; <<2 x i64>> [#uses=1]
- %tmp13 = bitcast <2 x i64> %tmp8 to <8 x i16> ; <<8 x i16>> [#uses=1]
- %tmp15 = bitcast <2 x i64> %tmp11 to <8 x i16> ; <<8 x i16>> [#uses=1]
- %tmp16 = shufflevector <8 x i16> %tmp15, <8 x i16> %tmp13, <8 x i32> < i32 0, i32 8, i32 1, i32 9, i32 2, i32 10, i32 3, i32 11 > ; <<8 x i16>> [#uses=1]
- %tmp26 = mul <8 x i16> %tmp25, %tmp16 ; <<8 x i16>> [#uses=1]
- %tmp27 = bitcast <8 x i16> %tmp26 to <2 x i64> ; <<2 x i64>> [#uses=1]
- store <2 x i64> %tmp27, <2 x i64>* %vYp_addr.0, align 16
- %tmp37 = load i8* %skiplist_addr.0, align 1 ; <i8> [#uses=1]
- %tmp38 = icmp eq i8 %tmp37, 0 ; <i1> [#uses=1]
- %indvar.next = add i32 %skiplist_addr.0.rec, 1 ; <i32> [#uses=1]
- br i1 %tmp38, label %return, label %bb
-return: ; preds = %bb
- ret void
-}
diff --git a/release_23/test/CodeGen/X86/urem-i8-constant.ll b/release_23/test/CodeGen/X86/urem-i8-constant.ll
deleted file mode 100644
index 8a433334f627..000000000000
--- a/release_23/test/CodeGen/X86/urem-i8-constant.ll
+++ /dev/null
@@ -1,6 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 | not grep mul
-
-define i8 @foo(i8 %tmp325) {
- %t546 = urem i8 %tmp325, 37
- ret i8 %t546
-}
diff --git a/release_23/test/CodeGen/X86/v4f32-immediate.ll b/release_23/test/CodeGen/X86/v4f32-immediate.ll
deleted file mode 100644
index bd6045c068e2..000000000000
--- a/release_23/test/CodeGen/X86/v4f32-immediate.ll
+++ /dev/null
@@ -1,5 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse | grep movaps
-
-define <4 x float> @foo() {
- ret <4 x float> <float 0x4009C9D0A0000000, float 0x4002666660000000, float 0x3FF3333340000000, float 0x3FB99999A0000000>
-}
diff --git a/release_23/test/CodeGen/X86/variable-sized-darwin-bzero.ll b/release_23/test/CodeGen/X86/variable-sized-darwin-bzero.ll
deleted file mode 100644
index b0cdf496d5fc..000000000000
--- a/release_23/test/CodeGen/X86/variable-sized-darwin-bzero.ll
+++ /dev/null
@@ -1,8 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -mtriple=i686-apple-darwin10 | grep __bzero
-
-declare void @llvm.memset.i64(i8*, i8, i64, i32)
-
-define void @foo(i8* %p, i64 %n) {
- call void @llvm.memset.i64(i8* %p, i8 0, i64 %n, i32 4)
- ret void
-}
diff --git a/release_23/test/CodeGen/X86/vec_add.ll b/release_23/test/CodeGen/X86/vec_add.ll
deleted file mode 100644
index b4154f63084e..000000000000
--- a/release_23/test/CodeGen/X86/vec_add.ll
+++ /dev/null
@@ -1,7 +0,0 @@
-; RUN: llvm-as < %s | | llc -march=x86 -mattr=+sse2
-
-define <2 x i64> @test(<2 x i64> %a, <2 x i64> %b) {
-entry:
- %tmp9 = add <2 x i64> %b, %a ; <<2 x i64>> [#uses=1]
- ret <2 x i64> %tmp9
-}
diff --git a/release_23/test/CodeGen/X86/vec_align.ll b/release_23/test/CodeGen/X86/vec_align.ll
deleted file mode 100644
index d88104d79e82..000000000000
--- a/release_23/test/CodeGen/X86/vec_align.ll
+++ /dev/null
@@ -1,35 +0,0 @@
-; RUN: llvm-as < %s | llc -mcpu=yonah -relocation-model=static | grep movaps | count 2
-
-target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
-target triple = "i686-apple-darwin8"
-
-%f4 = type <4 x float>
-
-@G = external global { float,float,float,float}, align 16
-
-define %f4 @test1(float %W, float %X, float %Y, float %Z) nounwind {
- %tmp = insertelement %f4 undef, float %W, i32 0
- %tmp2 = insertelement %f4 %tmp, float %X, i32 1
- %tmp4 = insertelement %f4 %tmp2, float %Y, i32 2
- %tmp6 = insertelement %f4 %tmp4, float %Z, i32 3
- ret %f4 %tmp6
-}
-
-define %f4 @test2() nounwind {
- %Wp = getelementptr { float,float,float,float}* @G, i32 0, i32 0
- %Xp = getelementptr { float,float,float,float}* @G, i32 0, i32 1
- %Yp = getelementptr { float,float,float,float}* @G, i32 0, i32 2
- %Zp = getelementptr { float,float,float,float}* @G, i32 0, i32 3
-
- %W = load float* %Wp
- %X = load float* %Xp
- %Y = load float* %Yp
- %Z = load float* %Zp
-
- %tmp = insertelement %f4 undef, float %W, i32 0
- %tmp2 = insertelement %f4 %tmp, float %X, i32 1
- %tmp4 = insertelement %f4 %tmp2, float %Y, i32 2
- %tmp6 = insertelement %f4 %tmp4, float %Z, i32 3
- ret %f4 %tmp6
-}
-
diff --git a/release_23/test/CodeGen/X86/vec_call.ll b/release_23/test/CodeGen/X86/vec_call.ll
deleted file mode 100644
index ebdac7d3de9b..000000000000
--- a/release_23/test/CodeGen/X86/vec_call.ll
+++ /dev/null
@@ -1,13 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 -mtriple=i686-apple-darwin8 | \
-; RUN: grep {subl.*60}
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 -mtriple=i686-apple-darwin8 | \
-; RUN: grep {movaps.*32}
-
-
-define void @test() {
- tail call void @xx( i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, <2 x i64> bitcast (<4 x i32> < i32 4, i32 3, i32 2, i32 1 > to <2 x i64>), <2 x i64> bitcast (<4 x i32> < i32 8, i32 7, i32 6, i32 5 > to <2 x i64>), <2 x i64> bitcast (<4 x i32> < i32 6, i32 4, i32 2, i32 0 > to <2 x i64>), <2 x i64> bitcast (<4 x i32> < i32 8, i32 4, i32 2, i32 1 > to <2 x i64>), <2 x i64> bitcast (<4 x i32> < i32 0, i32 1, i32 3, i32 9 > to <2 x i64>) )
- ret void
-}
-
-declare void @xx(i32, i32, i32, i32, i32, i32, i32, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>)
-
diff --git a/release_23/test/CodeGen/X86/vec_clear.ll b/release_23/test/CodeGen/X86/vec_clear.ll
deleted file mode 100644
index d4641294b456..000000000000
--- a/release_23/test/CodeGen/X86/vec_clear.ll
+++ /dev/null
@@ -1,10 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 -mtriple=i386-apple-darwin | not grep and
-
-define <4 x float> @test(<4 x float>* %v1) {
- %tmp = load <4 x float>* %v1 ; <<4 x float>> [#uses=1]
- %tmp15 = bitcast <4 x float> %tmp to <2 x i64> ; <<2 x i64>> [#uses=1]
- %tmp24 = and <2 x i64> %tmp15, bitcast (<4 x i32> < i32 0, i32 0, i32 -1, i32 -1 > to <2 x i64>) ; <<2 x i64>> [#uses=1]
- %tmp31 = bitcast <2 x i64> %tmp24 to <4 x float> ; <<4 x float>> [#uses=1]
- ret <4 x float> %tmp31
-}
-
diff --git a/release_23/test/CodeGen/X86/vec_ctbits.ll b/release_23/test/CodeGen/X86/vec_ctbits.ll
deleted file mode 100644
index bad8b2221ecb..000000000000
--- a/release_23/test/CodeGen/X86/vec_ctbits.ll
+++ /dev/null
@@ -1,18 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86-64
-
-declare <2 x i64> @llvm.cttz.v2i64(<2 x i64>)
-declare <2 x i64> @llvm.ctlz.v2i64(<2 x i64>)
-declare <2 x i64> @llvm.ctpop.v2i64(<2 x i64>)
-
-define <2 x i64> @footz(<2 x i64> %a) {
- %c = call <2 x i64> @llvm.cttz.v2i64(<2 x i64> %a)
- ret <2 x i64> %c
-}
-define <2 x i64> @foolz(<2 x i64> %a) {
- %c = call <2 x i64> @llvm.ctlz.v2i64(<2 x i64> %a)
- ret <2 x i64> %c
-}
-define <2 x i64> @foopop(<2 x i64> %a) {
- %c = call <2 x i64> @llvm.ctpop.v2i64(<2 x i64> %a)
- ret <2 x i64> %c
-}
diff --git a/release_23/test/CodeGen/X86/vec_extract-sse4.ll b/release_23/test/CodeGen/X86/vec_extract-sse4.ll
deleted file mode 100644
index 1ef5e8803ef4..000000000000
--- a/release_23/test/CodeGen/X86/vec_extract-sse4.ll
+++ /dev/null
@@ -1,30 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse41 -o %t -f
-; RUN: grep extractps %t | count 1
-; RUN: grep pextrd %t | count 2
-; RUN: grep pshufd %t | count 1
-
-define void @t1(float* %R, <4 x float>* %P1) {
- %X = load <4 x float>* %P1
- %tmp = extractelement <4 x float> %X, i32 3
- store float %tmp, float* %R
- ret void
-}
-
-define float @t2(<4 x float>* %P1) {
- %X = load <4 x float>* %P1
- %tmp = extractelement <4 x float> %X, i32 2
- ret float %tmp
-}
-
-define void @t3(i32* %R, <4 x i32>* %P1) {
- %X = load <4 x i32>* %P1
- %tmp = extractelement <4 x i32> %X, i32 3
- store i32 %tmp, i32* %R
- ret void
-}
-
-define i32 @t4(<4 x i32>* %P1) {
- %X = load <4 x i32>* %P1
- %tmp = extractelement <4 x i32> %X, i32 3
- ret i32 %tmp
-}
diff --git a/release_23/test/CodeGen/X86/vec_extract.ll b/release_23/test/CodeGen/X86/vec_extract.ll
deleted file mode 100644
index eddba87ba04c..000000000000
--- a/release_23/test/CodeGen/X86/vec_extract.ll
+++ /dev/null
@@ -1,36 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 -o %t -f
-; RUN: grep movss %t | count 3
-; RUN: grep movhlps %t | count 1
-; RUN: grep pshufd %t | count 1
-; RUN: grep unpckhpd %t | count 1
-
-define void @test1(<4 x float>* %F, float* %f) {
- %tmp = load <4 x float>* %F ; <<4 x float>> [#uses=2]
- %tmp7 = add <4 x float> %tmp, %tmp ; <<4 x float>> [#uses=1]
- %tmp2 = extractelement <4 x float> %tmp7, i32 0 ; <float> [#uses=1]
- store float %tmp2, float* %f
- ret void
-}
-
-define float @test2(<4 x float>* %F, float* %f) {
- %tmp = load <4 x float>* %F ; <<4 x float>> [#uses=2]
- %tmp7 = add <4 x float> %tmp, %tmp ; <<4 x float>> [#uses=1]
- %tmp2 = extractelement <4 x float> %tmp7, i32 2 ; <float> [#uses=1]
- ret float %tmp2
-}
-
-define void @test3(float* %R, <4 x float>* %P1) {
- %X = load <4 x float>* %P1 ; <<4 x float>> [#uses=1]
- %tmp = extractelement <4 x float> %X, i32 3 ; <float> [#uses=1]
- store float %tmp, float* %R
- ret void
-}
-
-define double @test4(double %A) {
- %tmp1 = call <2 x double> @foo( ) ; <<2 x double>> [#uses=1]
- %tmp2 = extractelement <2 x double> %tmp1, i32 1 ; <double> [#uses=1]
- %tmp3 = add double %tmp2, %A ; <double> [#uses=1]
- ret double %tmp3
-}
-
-declare <2 x double> @foo()
diff --git a/release_23/test/CodeGen/X86/vec_fneg.ll b/release_23/test/CodeGen/X86/vec_fneg.ll
deleted file mode 100644
index 0a057a4fd027..000000000000
--- a/release_23/test/CodeGen/X86/vec_fneg.ll
+++ /dev/null
@@ -1,11 +0,0 @@
-; RUN: llvm-as < %s | | llc -march=x86 -mattr=+sse2
-
-define <4 x float> @t1(<4 x float> %Q) {
- %tmp15 = sub <4 x float> < float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00 >, %Q
- ret <4 x float> %tmp15
-}
-
-define <4 x float> @t2(<4 x float> %Q) {
- %tmp15 = sub <4 x float> zeroinitializer, %Q
- ret <4 x float> %tmp15
-}
diff --git a/release_23/test/CodeGen/X86/vec_ins_extract.ll b/release_23/test/CodeGen/X86/vec_ins_extract.ll
deleted file mode 100644
index 86f13069de29..000000000000
--- a/release_23/test/CodeGen/X86/vec_ins_extract.ll
+++ /dev/null
@@ -1,51 +0,0 @@
-; RUN: llvm-as < %s | opt -scalarrepl -instcombine | \
-; RUN: llc -march=x86 -mcpu=yonah | not grep sub.*esp
-
-; This checks that various insert/extract idiom work without going to the
-; stack.
-
-define void @test(<4 x float>* %F, float %f) {
-entry:
- %tmp = load <4 x float>* %F ; <<4 x float>> [#uses=2]
- %tmp3 = add <4 x float> %tmp, %tmp ; <<4 x float>> [#uses=1]
- %tmp10 = insertelement <4 x float> %tmp3, float %f, i32 0 ; <<4 x float>> [#uses=2]
- %tmp6 = add <4 x float> %tmp10, %tmp10 ; <<4 x float>> [#uses=1]
- store <4 x float> %tmp6, <4 x float>* %F
- ret void
-}
-
-define void @test2(<4 x float>* %F, float %f) {
-entry:
- %G = alloca <4 x float>, align 16 ; <<4 x float>*> [#uses=3]
- %tmp = load <4 x float>* %F ; <<4 x float>> [#uses=2]
- %tmp3 = add <4 x float> %tmp, %tmp ; <<4 x float>> [#uses=1]
- store <4 x float> %tmp3, <4 x float>* %G
- %tmp.upgrd.1 = getelementptr <4 x float>* %G, i32 0, i32 2 ; <float*> [#uses=1]
- store float %f, float* %tmp.upgrd.1
- %tmp4 = load <4 x float>* %G ; <<4 x float>> [#uses=2]
- %tmp6 = add <4 x float> %tmp4, %tmp4 ; <<4 x float>> [#uses=1]
- store <4 x float> %tmp6, <4 x float>* %F
- ret void
-}
-
-define void @test3(<4 x float>* %F, float* %f) {
-entry:
- %G = alloca <4 x float>, align 16 ; <<4 x float>*> [#uses=2]
- %tmp = load <4 x float>* %F ; <<4 x float>> [#uses=2]
- %tmp3 = add <4 x float> %tmp, %tmp ; <<4 x float>> [#uses=1]
- store <4 x float> %tmp3, <4 x float>* %G
- %tmp.upgrd.2 = getelementptr <4 x float>* %G, i32 0, i32 2 ; <float*> [#uses=1]
- %tmp.upgrd.3 = load float* %tmp.upgrd.2 ; <float> [#uses=1]
- store float %tmp.upgrd.3, float* %f
- ret void
-}
-
-define void @test4(<4 x float>* %F, float* %f) {
-entry:
- %tmp = load <4 x float>* %F ; <<4 x float>> [#uses=2]
- %tmp5.lhs = extractelement <4 x float> %tmp, i32 0 ; <float> [#uses=1]
- %tmp5.rhs = extractelement <4 x float> %tmp, i32 0 ; <float> [#uses=1]
- %tmp5 = add float %tmp5.lhs, %tmp5.rhs ; <float> [#uses=1]
- store float %tmp5, float* %f
- ret void
-}
diff --git a/release_23/test/CodeGen/X86/vec_insert-2.ll b/release_23/test/CodeGen/X86/vec_insert-2.ll
deleted file mode 100644
index 369ac6cc94fd..000000000000
--- a/release_23/test/CodeGen/X86/vec_insert-2.ll
+++ /dev/null
@@ -1,26 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep '\$132,' | count 2
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep '\$2,' | count 2
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep shufps | count 4
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep pinsrw | count 1
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep movhpd | count 1
-; RUN: llvm-as < %s | llc -march=x86-64 -mattr=+sse2 | grep unpcklpd | count 1
-
-define <4 x float> @t1(float %s, <4 x float> %tmp) {
- %tmp1 = insertelement <4 x float> %tmp, float %s, i32 3
- ret <4 x float> %tmp1
-}
-
-define <4 x i32> @t2(i32 %s, <4 x i32> %tmp) {
- %tmp1 = insertelement <4 x i32> %tmp, i32 %s, i32 3
- ret <4 x i32> %tmp1
-}
-
-define <2 x double> @t3(double %s, <2 x double> %tmp) {
- %tmp1 = insertelement <2 x double> %tmp, double %s, i32 1
- ret <2 x double> %tmp1
-}
-
-define <8 x i16> @t4(i16 %s, <8 x i16> %tmp) {
- %tmp1 = insertelement <8 x i16> %tmp, i16 %s, i32 5
- ret <8 x i16> %tmp1
-}
diff --git a/release_23/test/CodeGen/X86/vec_insert-3.ll b/release_23/test/CodeGen/X86/vec_insert-3.ll
deleted file mode 100644
index 1d374b4b9c62..000000000000
--- a/release_23/test/CodeGen/X86/vec_insert-3.ll
+++ /dev/null
@@ -1,6 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86-64 -mattr=+sse2 | grep punpcklqdq | count 1
-
-define <2 x i64> @t1(i64 %s, <2 x i64> %tmp) {
- %tmp1 = insertelement <2 x i64> %tmp, i64 %s, i32 1
- ret <2 x i64> %tmp1
-}
diff --git a/release_23/test/CodeGen/X86/vec_insert.ll b/release_23/test/CodeGen/X86/vec_insert.ll
deleted file mode 100644
index c8c9f141ec1c..000000000000
--- a/release_23/test/CodeGen/X86/vec_insert.ll
+++ /dev/null
@@ -1,19 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep movss | count 1
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | not grep pinsrw
-
-define void @test(<4 x float>* %F, i32 %I) {
- %tmp = load <4 x float>* %F ; <<4 x float>> [#uses=1]
- %f = sitofp i32 %I to float ; <float> [#uses=1]
- %tmp1 = insertelement <4 x float> %tmp, float %f, i32 0 ; <<4 x float>> [#uses=2]
- %tmp18 = add <4 x float> %tmp1, %tmp1 ; <<4 x float>> [#uses=1]
- store <4 x float> %tmp18, <4 x float>* %F
- ret void
-}
-
-define void @test2(<4 x float>* %F, i32 %I, float %g) {
- %tmp = load <4 x float>* %F ; <<4 x float>> [#uses=1]
- %f = sitofp i32 %I to float ; <float> [#uses=1]
- %tmp1 = insertelement <4 x float> %tmp, float %f, i32 2 ; <<4 x float>> [#uses=1]
- store <4 x float> %tmp1, <4 x float>* %F
- ret void
-}
diff --git a/release_23/test/CodeGen/X86/vec_insert_4.ll b/release_23/test/CodeGen/X86/vec_insert_4.ll
deleted file mode 100644
index a0aa0c0bfea0..000000000000
--- a/release_23/test/CodeGen/X86/vec_insert_4.ll
+++ /dev/null
@@ -1,11 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -mcpu=yonah | grep 1084227584 | count 1
-
-; ModuleID = '<stdin>'
-target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
-target triple = "i686-apple-darwin9.2.2"
-
-define <8 x float> @f(<8 x float> %a, i32 %b) nounwind {
-entry:
- %vecins = insertelement <8 x float> %a, float 5.000000e+00, i32 %b ; <<4 x float>> [#uses=1]
- ret <8 x float> %vecins
-}
diff --git a/release_23/test/CodeGen/X86/vec_logical.ll b/release_23/test/CodeGen/X86/vec_logical.ll
deleted file mode 100644
index cf45a4a67091..000000000000
--- a/release_23/test/CodeGen/X86/vec_logical.ll
+++ /dev/null
@@ -1,42 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep xorps | count 2
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep andnps
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep movaps | count 2
-
-define void @t(<4 x float> %A) {
- %tmp1277 = sub <4 x float> < float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00 >, %A
- store <4 x float> %tmp1277, <4 x float>* null
- ret void
-}
-
-define <4 x float> @t1(<4 x float> %a, <4 x float> %b) {
-entry:
- %tmp9 = bitcast <4 x float> %a to <4 x i32> ; <<4 x i32>> [#uses=1]
- %tmp10 = bitcast <4 x float> %b to <4 x i32> ; <<4 x i32>> [#uses=1]
- %tmp11 = xor <4 x i32> %tmp9, %tmp10 ; <<4 x i32>> [#uses=1]
- %tmp13 = bitcast <4 x i32> %tmp11 to <4 x float> ; <<4 x float>> [#uses=1]
- ret <4 x float> %tmp13
-}
-
-define <2 x double> @t2(<2 x double> %a, <2 x double> %b) {
-entry:
- %tmp9 = bitcast <2 x double> %a to <2 x i64> ; <<2 x i64>> [#uses=1]
- %tmp10 = bitcast <2 x double> %b to <2 x i64> ; <<2 x i64>> [#uses=1]
- %tmp11 = and <2 x i64> %tmp9, %tmp10 ; <<2 x i64>> [#uses=1]
- %tmp13 = bitcast <2 x i64> %tmp11 to <2 x double> ; <<2 x double>> [#uses=1]
- ret <2 x double> %tmp13
-}
-
-define void @t3(<4 x float> %a, <4 x float> %b, <4 x float>* %c, <4 x float>* %d) {
-entry:
- %tmp3 = load <4 x float>* %c ; <<4 x float>> [#uses=1]
- %tmp11 = bitcast <4 x float> %a to <4 x i32> ; <<4 x i32>> [#uses=1]
- %tmp12 = bitcast <4 x float> %b to <4 x i32> ; <<4 x i32>> [#uses=1]
- %tmp13 = xor <4 x i32> %tmp11, < i32 -1, i32 -1, i32 -1, i32 -1 > ; <<4 x i32>> [#uses=1]
- %tmp14 = and <4 x i32> %tmp12, %tmp13 ; <<4 x i32>> [#uses=1]
- %tmp27 = bitcast <4 x float> %tmp3 to <4 x i32> ; <<4 x i32>> [#uses=1]
- %tmp28 = or <4 x i32> %tmp14, %tmp27 ; <<4 x i32>> [#uses=1]
- %tmp30 = bitcast <4 x i32> %tmp28 to <4 x float> ; <<4 x float>> [#uses=1]
- store <4 x float> %tmp30, <4 x float>* %d
- ret void
-}
diff --git a/release_23/test/CodeGen/X86/vec_return.ll b/release_23/test/CodeGen/X86/vec_return.ll
deleted file mode 100644
index ed1a15c8607b..000000000000
--- a/release_23/test/CodeGen/X86/vec_return.ll
+++ /dev/null
@@ -1,12 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep xorps | count 1
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep movaps | count 1
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | not grep shuf
-
-define <2 x double> @test() {
- ret <2 x double> zeroinitializer
-}
-
-define <4 x i32> @test2() nounwind {
- ret <4 x i32> < i32 0, i32 0, i32 1, i32 0 >
-}
diff --git a/release_23/test/CodeGen/X86/vec_select.ll b/release_23/test/CodeGen/X86/vec_select.ll
deleted file mode 100644
index ede7ab26700c..000000000000
--- a/release_23/test/CodeGen/X86/vec_select.ll
+++ /dev/null
@@ -1,12 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse
-
-define void @test(i32 %C, <4 x float>* %A, <4 x float>* %B) {
- %tmp = load <4 x float>* %A ; <<4 x float>> [#uses=1]
- %tmp3 = load <4 x float>* %B ; <<4 x float>> [#uses=2]
- %tmp9 = mul <4 x float> %tmp3, %tmp3 ; <<4 x float>> [#uses=1]
- %tmp.upgrd.1 = icmp eq i32 %C, 0 ; <i1> [#uses=1]
- %iftmp.38.0 = select i1 %tmp.upgrd.1, <4 x float> %tmp9, <4 x float> %tmp ; <<4 x float>> [#uses=1]
- store <4 x float> %iftmp.38.0, <4 x float>* %A
- ret void
-}
-
diff --git a/release_23/test/CodeGen/X86/vec_set-2.ll b/release_23/test/CodeGen/X86/vec_set-2.ll
deleted file mode 100644
index ae9530db8df5..000000000000
--- a/release_23/test/CodeGen/X86/vec_set-2.ll
+++ /dev/null
@@ -1,19 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep movss | count 1
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep movd | count 1
-
-define <4 x float> @test1(float %a) nounwind {
- %tmp = insertelement <4 x float> zeroinitializer, float %a, i32 0 ; <<4 x float>> [#uses=1]
- %tmp5 = insertelement <4 x float> %tmp, float 0.000000e+00, i32 1 ; <<4 x float>> [#uses=1]
- %tmp6 = insertelement <4 x float> %tmp5, float 0.000000e+00, i32 2 ; <<4 x float>> [#uses=1]
- %tmp7 = insertelement <4 x float> %tmp6, float 0.000000e+00, i32 3 ; <<4 x float>> [#uses=1]
- ret <4 x float> %tmp7
-}
-
-define <2 x i64> @test(i32 %a) nounwind {
- %tmp = insertelement <4 x i32> zeroinitializer, i32 %a, i32 0 ; <<8 x i16>> [#uses=1]
- %tmp6 = insertelement <4 x i32> %tmp, i32 0, i32 1 ; <<8 x i32>> [#uses=1]
- %tmp8 = insertelement <4 x i32> %tmp6, i32 0, i32 2 ; <<8 x i32>> [#uses=1]
- %tmp10 = insertelement <4 x i32> %tmp8, i32 0, i32 3 ; <<8 x i32>> [#uses=1]
- %tmp19 = bitcast <4 x i32> %tmp10 to <2 x i64> ; <<2 x i64>> [#uses=1]
- ret <2 x i64> %tmp19
-}
diff --git a/release_23/test/CodeGen/X86/vec_set-3.ll b/release_23/test/CodeGen/X86/vec_set-3.ll
deleted file mode 100644
index 546ca0bcf307..000000000000
--- a/release_23/test/CodeGen/X86/vec_set-3.ll
+++ /dev/null
@@ -1,17 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 -o %t -f
-; RUN: grep pshufd %t | count 2
-
-define <4 x float> @test(float %a) nounwind {
- %tmp = insertelement <4 x float> zeroinitializer, float %a, i32 1 ; <<4 x float>> [#uses=1]
- %tmp5 = insertelement <4 x float> %tmp, float 0.000000e+00, i32 2 ; <<4 x float>> [#uses=1]
- %tmp6 = insertelement <4 x float> %tmp5, float 0.000000e+00, i32 3 ; <<4 x float>> [#uses=1]
- ret <4 x float> %tmp6
-}
-
-define <2 x i64> @test2(i32 %a) nounwind {
- %tmp7 = insertelement <4 x i32> zeroinitializer, i32 %a, i32 2 ; <<4 x i32>> [#uses=1]
- %tmp9 = insertelement <4 x i32> %tmp7, i32 0, i32 3 ; <<4 x i32>> [#uses=1]
- %tmp10 = bitcast <4 x i32> %tmp9 to <2 x i64> ; <<2 x i64>> [#uses=1]
- ret <2 x i64> %tmp10
-}
-
diff --git a/release_23/test/CodeGen/X86/vec_set-4.ll b/release_23/test/CodeGen/X86/vec_set-4.ll
deleted file mode 100644
index da7ef80a3a5e..000000000000
--- a/release_23/test/CodeGen/X86/vec_set-4.ll
+++ /dev/null
@@ -1,24 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep pinsrw | count 2
-
-define <2 x i64> @test(i16 %a) nounwind {
-entry:
- %tmp10 = insertelement <8 x i16> zeroinitializer, i16 %a, i32 3 ; <<8 x i16>> [#uses=1]
- %tmp12 = insertelement <8 x i16> %tmp10, i16 0, i32 4 ; <<8 x i16>> [#uses=1]
- %tmp14 = insertelement <8 x i16> %tmp12, i16 0, i32 5 ; <<8 x i16>> [#uses=1]
- %tmp16 = insertelement <8 x i16> %tmp14, i16 0, i32 6 ; <<8 x i16>> [#uses=1]
- %tmp18 = insertelement <8 x i16> %tmp16, i16 0, i32 7 ; <<8 x i16>> [#uses=1]
- %tmp19 = bitcast <8 x i16> %tmp18 to <2 x i64> ; <<2 x i64>> [#uses=1]
- ret <2 x i64> %tmp19
-}
-
-define <2 x i64> @test2(i8 %a) nounwind {
-entry:
- %tmp24 = insertelement <16 x i8> zeroinitializer, i8 %a, i32 10 ; <<16 x i8>> [#uses=1]
- %tmp26 = insertelement <16 x i8> %tmp24, i8 0, i32 11 ; <<16 x i8>> [#uses=1]
- %tmp28 = insertelement <16 x i8> %tmp26, i8 0, i32 12 ; <<16 x i8>> [#uses=1]
- %tmp30 = insertelement <16 x i8> %tmp28, i8 0, i32 13 ; <<16 x i8>> [#uses=1]
- %tmp32 = insertelement <16 x i8> %tmp30, i8 0, i32 14 ; <<16 x i8>> [#uses=1]
- %tmp34 = insertelement <16 x i8> %tmp32, i8 0, i32 15 ; <<16 x i8>> [#uses=1]
- %tmp35 = bitcast <16 x i8> %tmp34 to <2 x i64> ; <<2 x i64>> [#uses=1]
- ret <2 x i64> %tmp35
-}
diff --git a/release_23/test/CodeGen/X86/vec_set-5.ll b/release_23/test/CodeGen/X86/vec_set-5.ll
deleted file mode 100644
index 4fc652c022ae..000000000000
--- a/release_23/test/CodeGen/X86/vec_set-5.ll
+++ /dev/null
@@ -1,29 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 -o %t -f
-; RUN: grep movlhps %t | count 1
-; RUN: grep movq %t | count 1
-; RUN: grep movsd %t | count 1
-
-define <4 x float> @test1(float %a, float %b) nounwind {
- %tmp = insertelement <4 x float> zeroinitializer, float %a, i32 0 ; <<4 x float>> [#uses=1]
- %tmp6 = insertelement <4 x float> %tmp, float 0.000000e+00, i32 1 ; <<4 x float>> [#uses=1]
- %tmp8 = insertelement <4 x float> %tmp6, float %b, i32 2 ; <<4 x float>> [#uses=1]
- %tmp9 = insertelement <4 x float> %tmp8, float 0.000000e+00, i32 3 ; <<4 x float>> [#uses=1]
- ret <4 x float> %tmp9
-}
-
-define <4 x float> @test2(float %a, float %b) nounwind {
- %tmp = insertelement <4 x float> zeroinitializer, float %a, i32 0 ; <<4 x float>> [#uses=1]
- %tmp7 = insertelement <4 x float> %tmp, float %b, i32 1 ; <<4 x float>> [#uses=1]
- %tmp8 = insertelement <4 x float> %tmp7, float 0.000000e+00, i32 2 ; <<4 x float>> [#uses=1]
- %tmp9 = insertelement <4 x float> %tmp8, float 0.000000e+00, i32 3 ; <<4 x float>> [#uses=1]
- ret <4 x float> %tmp9
-}
-
-define <2 x i64> @test3(i32 %a, i32 %b) nounwind {
- %tmp = insertelement <4 x i32> zeroinitializer, i32 %a, i32 0 ; <<4 x i32>> [#uses=1]
- %tmp6 = insertelement <4 x i32> %tmp, i32 %b, i32 1 ; <<4 x i32>> [#uses=1]
- %tmp8 = insertelement <4 x i32> %tmp6, i32 0, i32 2 ; <<4 x i32>> [#uses=1]
- %tmp10 = insertelement <4 x i32> %tmp8, i32 0, i32 3 ; <<4 x i32>> [#uses=1]
- %tmp11 = bitcast <4 x i32> %tmp10 to <2 x i64> ; <<2 x i64>> [#uses=1]
- ret <2 x i64> %tmp11
-}
diff --git a/release_23/test/CodeGen/X86/vec_set-6.ll b/release_23/test/CodeGen/X86/vec_set-6.ll
deleted file mode 100644
index 02df526cee81..000000000000
--- a/release_23/test/CodeGen/X86/vec_set-6.ll
+++ /dev/null
@@ -1,12 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 -o %t -f
-; RUN: grep movss %t | count 1
-; RUN: grep movups %t | count 1
-; RUN: grep shufps %t | count 1
-
-define <4 x float> @test(float %a, float %b, float %c) nounwind {
- %tmp = insertelement <4 x float> zeroinitializer, float %a, i32 1 ; <<4 x float>> [#uses=1]
- %tmp8 = insertelement <4 x float> %tmp, float %b, i32 2 ; <<4 x float>> [#uses=1]
- %tmp10 = insertelement <4 x float> %tmp8, float %c, i32 3 ; <<4 x float>> [#uses=1]
- ret <4 x float> %tmp10
-}
-
diff --git a/release_23/test/CodeGen/X86/vec_set-7.ll b/release_23/test/CodeGen/X86/vec_set-7.ll
deleted file mode 100644
index 6f98c510efca..000000000000
--- a/release_23/test/CodeGen/X86/vec_set-7.ll
+++ /dev/null
@@ -1,11 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep movsd | count 1
-
-define <2 x i64> @test(<2 x i64>* %p) nounwind {
- %tmp = bitcast <2 x i64>* %p to double*
- %tmp.upgrd.1 = load double* %tmp
- %tmp.upgrd.2 = insertelement <2 x double> undef, double %tmp.upgrd.1, i32 0
- %tmp5 = insertelement <2 x double> %tmp.upgrd.2, double 0.0, i32 1
- %tmp.upgrd.3 = bitcast <2 x double> %tmp5 to <2 x i64>
- ret <2 x i64> %tmp.upgrd.3
-}
-
diff --git a/release_23/test/CodeGen/X86/vec_set-8.ll b/release_23/test/CodeGen/X86/vec_set-8.ll
deleted file mode 100644
index cca436bf6433..000000000000
--- a/release_23/test/CodeGen/X86/vec_set-8.ll
+++ /dev/null
@@ -1,10 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86-64 | not grep movsd
-; RUN: llvm-as < %s | llc -march=x86-64 | grep {movd.*%rdi,.*%xmm0}
-
-define <2 x i64> @test(i64 %i) nounwind {
-entry:
- %tmp10 = insertelement <2 x i64> undef, i64 %i, i32 0
- %tmp11 = insertelement <2 x i64> %tmp10, i64 0, i32 1
- ret <2 x i64> %tmp11
-}
-
diff --git a/release_23/test/CodeGen/X86/vec_set-9.ll b/release_23/test/CodeGen/X86/vec_set-9.ll
deleted file mode 100644
index 38f729fbc892..000000000000
--- a/release_23/test/CodeGen/X86/vec_set-9.ll
+++ /dev/null
@@ -1,9 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86-64 | grep movd | count 1
-; RUN: llvm-as < %s | llc -march=x86-64 | grep {punpcklqdq.*%xmm0, %xmm0}
-
-define <2 x i64> @test3(i64 %A) nounwind {
-entry:
- %B = insertelement <2 x i64> undef, i64 %A, i32 1
- ret <2 x i64> %B
-}
-
diff --git a/release_23/test/CodeGen/X86/vec_set-A.ll b/release_23/test/CodeGen/X86/vec_set-A.ll
deleted file mode 100644
index f33263f1aef5..000000000000
--- a/release_23/test/CodeGen/X86/vec_set-A.ll
+++ /dev/null
@@ -1,6 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep {movl.*\$1, %}
-define <2 x i64> @test1() nounwind {
-entry:
- ret <2 x i64> < i64 1, i64 0 >
-}
-
diff --git a/release_23/test/CodeGen/X86/vec_set-B.ll b/release_23/test/CodeGen/X86/vec_set-B.ll
deleted file mode 100644
index d318964686c9..000000000000
--- a/release_23/test/CodeGen/X86/vec_set-B.ll
+++ /dev/null
@@ -1,24 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | not grep movaps
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep esp | count 2
-
-; These should both generate something like this:
-;_test3:
-; movl $1234567, %eax
-; andl 4(%esp), %eax
-; movd %eax, %xmm0
-; ret
-
-define <2 x i64> @test3(i64 %arg) nounwind {
-entry:
- %A = and i64 %arg, 1234567
- %B = insertelement <2 x i64> zeroinitializer, i64 %A, i32 0
- ret <2 x i64> %B
-}
-
-define <2 x i64> @test2(i64 %arg) nounwind {
-entry:
- %A = and i64 %arg, 1234567
- %B = insertelement <2 x i64> undef, i64 %A, i32 0
- ret <2 x i64> %B
-}
-
diff --git a/release_23/test/CodeGen/X86/vec_set-C.ll b/release_23/test/CodeGen/X86/vec_set-C.ll
deleted file mode 100644
index fc86853e10fd..000000000000
--- a/release_23/test/CodeGen/X86/vec_set-C.ll
+++ /dev/null
@@ -1,8 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep movq
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep mov | count 1
-; RUN: llvm-as < %s | llc -march=x86-64 -mattr=+sse2 | grep movd
-
-define <2 x i64> @t1(i64 %x) nounwind {
- %tmp8 = insertelement <2 x i64> zeroinitializer, i64 %x, i32 0
- ret <2 x i64> %tmp8
-}
diff --git a/release_23/test/CodeGen/X86/vec_set-D.ll b/release_23/test/CodeGen/X86/vec_set-D.ll
deleted file mode 100644
index 71bdd849953b..000000000000
--- a/release_23/test/CodeGen/X86/vec_set-D.ll
+++ /dev/null
@@ -1,7 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep movq
-
-define <4 x i32> @t(i32 %x, i32 %y) nounwind {
- %tmp1 = insertelement <4 x i32> zeroinitializer, i32 %x, i32 0
- %tmp2 = insertelement <4 x i32> %tmp1, i32 %y, i32 1
- ret <4 x i32> %tmp2
-}
diff --git a/release_23/test/CodeGen/X86/vec_set-E.ll b/release_23/test/CodeGen/X86/vec_set-E.ll
deleted file mode 100644
index ee63234cc978..000000000000
--- a/release_23/test/CodeGen/X86/vec_set-E.ll
+++ /dev/null
@@ -1,9 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep movq
-
-define <4 x float> @t(float %X) nounwind {
- %tmp11 = insertelement <4 x float> undef, float %X, i32 0
- %tmp12 = insertelement <4 x float> %tmp11, float %X, i32 1
- %tmp27 = insertelement <4 x float> %tmp12, float 0.000000e+00, i32 2
- %tmp28 = insertelement <4 x float> %tmp27, float 0.000000e+00, i32 3
- ret <4 x float> %tmp28
-}
diff --git a/release_23/test/CodeGen/X86/vec_set-F.ll b/release_23/test/CodeGen/X86/vec_set-F.ll
deleted file mode 100644
index db83eb2e8531..000000000000
--- a/release_23/test/CodeGen/X86/vec_set-F.ll
+++ /dev/null
@@ -1,19 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep movq
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep movsd
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep mov | count 3
-
-define <2 x i64> @t1(<2 x i64>* %ptr) nounwind {
- %tmp45 = bitcast <2 x i64>* %ptr to <2 x i32>*
- %tmp615 = load <2 x i32>* %tmp45
- %tmp7 = bitcast <2 x i32> %tmp615 to i64
- %tmp8 = insertelement <2 x i64> zeroinitializer, i64 %tmp7, i32 0
- ret <2 x i64> %tmp8
-}
-
-define <2 x i64> @t2(i64 %x) nounwind {
- %tmp717 = bitcast i64 %x to double
- %tmp8 = insertelement <2 x double> undef, double %tmp717, i32 0
- %tmp9 = insertelement <2 x double> %tmp8, double 0.000000e+00, i32 1
- %tmp11 = bitcast <2 x double> %tmp9 to <2 x i64>
- ret <2 x i64> %tmp11
-}
diff --git a/release_23/test/CodeGen/X86/vec_set-G.ll b/release_23/test/CodeGen/X86/vec_set-G.ll
deleted file mode 100644
index f81907cb69f2..000000000000
--- a/release_23/test/CodeGen/X86/vec_set-G.ll
+++ /dev/null
@@ -1,9 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep movss
-
-define fastcc void @t(<4 x float> %A) nounwind {
- %tmp41896 = extractelement <4 x float> %A, i32 0 ; <float> [#uses=1]
- %tmp14082 = insertelement <4 x float> < float 0.000000e+00, float undef, float undef, float undef >, float %tmp41896, i32 1 ; <<4 x float>> [#uses=1]
- %tmp14083 = insertelement <4 x float> %tmp14082, float 0.000000e+00, i32 2 ; <<4 x float>> [#uses=1]
- store <4 x float> %tmp14083, <4 x float>* null, align 16
- ret void
-}
diff --git a/release_23/test/CodeGen/X86/vec_set.ll b/release_23/test/CodeGen/X86/vec_set.ll
deleted file mode 100644
index 77636eda1c02..000000000000
--- a/release_23/test/CodeGen/X86/vec_set.ll
+++ /dev/null
@@ -1,15 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep punpckl | count 7
-
-define void @test(<8 x i16>* %b, i16 %a0, i16 %a1, i16 %a2, i16 %a3, i16 %a4, i16 %a5, i16 %a6, i16 %a7) nounwind {
- %tmp = insertelement <8 x i16> zeroinitializer, i16 %a0, i32 0 ; <<8 x i16>> [#uses=1]
- %tmp2 = insertelement <8 x i16> %tmp, i16 %a1, i32 1 ; <<8 x i16>> [#uses=1]
- %tmp4 = insertelement <8 x i16> %tmp2, i16 %a2, i32 2 ; <<8 x i16>> [#uses=1]
- %tmp6 = insertelement <8 x i16> %tmp4, i16 %a3, i32 3 ; <<8 x i16>> [#uses=1]
- %tmp8 = insertelement <8 x i16> %tmp6, i16 %a4, i32 4 ; <<8 x i16>> [#uses=1]
- %tmp10 = insertelement <8 x i16> %tmp8, i16 %a5, i32 5 ; <<8 x i16>> [#uses=1]
- %tmp12 = insertelement <8 x i16> %tmp10, i16 %a6, i32 6 ; <<8 x i16>> [#uses=1]
- %tmp14 = insertelement <8 x i16> %tmp12, i16 %a7, i32 7 ; <<8 x i16>> [#uses=1]
- store <8 x i16> %tmp14, <8 x i16>* %b
- ret void
-}
-
diff --git a/release_23/test/CodeGen/X86/vec_shift.ll b/release_23/test/CodeGen/X86/vec_shift.ll
deleted file mode 100644
index 9c595bc6ef06..000000000000
--- a/release_23/test/CodeGen/X86/vec_shift.ll
+++ /dev/null
@@ -1,34 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep psllw
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep psrlq
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep psraw
-
-define <2 x i64> @t1(<2 x i64> %b1, <2 x i64> %c) nounwind {
-entry:
- %tmp6 = bitcast <2 x i64> %c to <8 x i16> ; <<8 x i16>> [#uses=1]
- %tmp8 = bitcast <2 x i64> %b1 to <8 x i16> ; <<8 x i16>> [#uses=1]
- %tmp9 = tail call <8 x i16> @llvm.x86.sse2.psll.w( <8 x i16> %tmp8, <8 x i16> %tmp6 ) nounwind readnone ; <<8 x i16>> [#uses=1]
- %tmp10 = bitcast <8 x i16> %tmp9 to <2 x i64> ; <<2 x i64>> [#uses=1]
- ret <2 x i64> %tmp10
-}
-
-define <2 x i64> @t3(<2 x i64> %b1, i32 %c) nounwind {
-entry:
- %tmp2 = bitcast <2 x i64> %b1 to <8 x i16> ; <<8 x i16>> [#uses=1]
- %tmp4 = insertelement <4 x i32> undef, i32 %c, i32 0 ; <<4 x i32>> [#uses=1]
- %tmp8 = bitcast <4 x i32> %tmp4 to <8 x i16> ; <<8 x i16>> [#uses=1]
- %tmp9 = tail call <8 x i16> @llvm.x86.sse2.psra.w( <8 x i16> %tmp2, <8 x i16> %tmp8 ) ; <<8 x i16>> [#uses=1]
- %tmp11 = bitcast <8 x i16> %tmp9 to <2 x i64> ; <<2 x i64>> [#uses=1]
- ret <2 x i64> %tmp11
-}
-
-declare <8 x i16> @llvm.x86.sse2.psra.w(<8 x i16>, <8 x i16>) nounwind readnone
-
-define <2 x i64> @t2(<2 x i64> %b1, <2 x i64> %c) nounwind {
-entry:
- %tmp9 = tail call <2 x i64> @llvm.x86.sse2.psrl.q( <2 x i64> %b1, <2 x i64> %c ) nounwind readnone ; <<2 x i64>> [#uses=1]
- ret <2 x i64> %tmp9
-}
-
-declare <2 x i64> @llvm.x86.sse2.psrl.q(<2 x i64>, <2 x i64>) nounwind readnone
-
-declare <8 x i16> @llvm.x86.sse2.psll.w(<8 x i16>, <8 x i16>) nounwind readnone
diff --git a/release_23/test/CodeGen/X86/vec_shift2.ll b/release_23/test/CodeGen/X86/vec_shift2.ll
deleted file mode 100644
index b73f5f490006..000000000000
--- a/release_23/test/CodeGen/X86/vec_shift2.ll
+++ /dev/null
@@ -1,17 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | not grep CPI
-
-define <2 x i64> @t1(<2 x i64> %b1, <2 x i64> %c) nounwind {
- %tmp1 = bitcast <2 x i64> %b1 to <8 x i16>
- %tmp2 = tail call <8 x i16> @llvm.x86.sse2.psrl.w( <8 x i16> %tmp1, <8 x i16> bitcast (<4 x i32> < i32 14, i32 undef, i32 undef, i32 undef > to <8 x i16>) ) nounwind readnone
- %tmp3 = bitcast <8 x i16> %tmp2 to <2 x i64>
- ret <2 x i64> %tmp3
-}
-
-define <4 x i32> @t2(<2 x i64> %b1, <2 x i64> %c) nounwind {
- %tmp1 = bitcast <2 x i64> %b1 to <4 x i32>
- %tmp2 = tail call <4 x i32> @llvm.x86.sse2.psll.d( <4 x i32> %tmp1, <4 x i32> < i32 14, i32 undef, i32 undef, i32 undef > ) nounwind readnone
- ret <4 x i32> %tmp2
-}
-
-declare <8 x i16> @llvm.x86.sse2.psrl.w(<8 x i16>, <8 x i16>) nounwind readnone
-declare <4 x i32> @llvm.x86.sse2.psll.d(<4 x i32>, <4 x i32>) nounwind readnone
diff --git a/release_23/test/CodeGen/X86/vec_shift3.ll b/release_23/test/CodeGen/X86/vec_shift3.ll
deleted file mode 100644
index 2641c5d59674..000000000000
--- a/release_23/test/CodeGen/X86/vec_shift3.ll
+++ /dev/null
@@ -1,26 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep psllq
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep psraw
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep movd | count 2
-
-define <2 x i64> @t1(<2 x i64> %x1, i32 %bits) nounwind {
-entry:
- %tmp3 = tail call <2 x i64> @llvm.x86.sse2.pslli.q( <2 x i64> %x1, i32 %bits ) nounwind readnone ; <<2 x i64>> [#uses=1]
- ret <2 x i64> %tmp3
-}
-
-define <2 x i64> @t2(<2 x i64> %x1) nounwind {
-entry:
- %tmp3 = tail call <2 x i64> @llvm.x86.sse2.pslli.q( <2 x i64> %x1, i32 10 ) nounwind readnone ; <<2 x i64>> [#uses=1]
- ret <2 x i64> %tmp3
-}
-
-define <2 x i64> @t3(<2 x i64> %x1, i32 %bits) nounwind {
-entry:
- %tmp2 = bitcast <2 x i64> %x1 to <8 x i16> ; <<8 x i16>> [#uses=1]
- %tmp4 = tail call <8 x i16> @llvm.x86.sse2.psrai.w( <8 x i16> %tmp2, i32 %bits ) nounwind readnone ; <<8 x i16>> [#uses=1]
- %tmp5 = bitcast <8 x i16> %tmp4 to <2 x i64> ; <<2 x i64>> [#uses=1]
- ret <2 x i64> %tmp5
-}
-
-declare <8 x i16> @llvm.x86.sse2.psrai.w(<8 x i16>, i32) nounwind readnone
-declare <2 x i64> @llvm.x86.sse2.pslli.q(<2 x i64>, i32) nounwind readnone
diff --git a/release_23/test/CodeGen/X86/vec_shuffle-10.ll b/release_23/test/CodeGen/X86/vec_shuffle-10.ll
deleted file mode 100644
index 45789b04bb66..000000000000
--- a/release_23/test/CodeGen/X86/vec_shuffle-10.ll
+++ /dev/null
@@ -1,27 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | \
-; RUN: grep unpcklps | count 1
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | \
-; RUN: grep unpckhps | count 1
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | \
-; RUN: not grep {sub.*esp}
-
-define void @test(<4 x float>* %res, <4 x float>* %A, <4 x float>* %B) {
- %tmp = load <4 x float>* %B ; <<4 x float>> [#uses=2]
- %tmp3 = load <4 x float>* %A ; <<4 x float>> [#uses=2]
- %tmp.upgrd.1 = extractelement <4 x float> %tmp3, i32 0 ; <float> [#uses=1]
- %tmp7 = extractelement <4 x float> %tmp, i32 0 ; <float> [#uses=1]
- %tmp8 = extractelement <4 x float> %tmp3, i32 1 ; <float> [#uses=1]
- %tmp9 = extractelement <4 x float> %tmp, i32 1 ; <float> [#uses=1]
- %tmp10 = insertelement <4 x float> undef, float %tmp.upgrd.1, i32 0 ; <<4 x float>> [#uses=1]
- %tmp11 = insertelement <4 x float> %tmp10, float %tmp7, i32 1 ; <<4 x float>> [#uses=1]
- %tmp12 = insertelement <4 x float> %tmp11, float %tmp8, i32 2 ; <<4 x float>> [#uses=1]
- %tmp13 = insertelement <4 x float> %tmp12, float %tmp9, i32 3 ; <<4 x float>> [#uses=1]
- store <4 x float> %tmp13, <4 x float>* %res
- ret void
-}
-
-define void @test2(<4 x float> %X, <4 x float>* %res) {
- %tmp5 = shufflevector <4 x float> %X, <4 x float> undef, <4 x i32> < i32 2, i32 6, i32 3, i32 7 > ; <<4 x float>> [#uses=1]
- store <4 x float> %tmp5, <4 x float>* %res
- ret void
-}
diff --git a/release_23/test/CodeGen/X86/vec_shuffle-11.ll b/release_23/test/CodeGen/X86/vec_shuffle-11.ll
deleted file mode 100644
index 4cf0e0178a22..000000000000
--- a/release_23/test/CodeGen/X86/vec_shuffle-11.ll
+++ /dev/null
@@ -1,11 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 -mtriple=i386-apple-darwin | not grep mov
-
-define <4 x i32> @test() {
- %tmp131 = call <2 x i64> @llvm.x86.sse2.psrl.dq( <2 x i64> < i64 -1, i64 -1 >, i32 96 ) ; <<2 x i64>> [#uses=1]
- %tmp137 = bitcast <2 x i64> %tmp131 to <4 x i32> ; <<4 x i32>> [#uses=1]
- %tmp138 = and <4 x i32> %tmp137, bitcast (<2 x i64> < i64 -1, i64 -1 > to <4 x i32>) ; <<4 x i32>> [#uses=1]
- ret <4 x i32> %tmp138
-}
-
-declare <2 x i64> @llvm.x86.sse2.psrl.dq(<2 x i64>, i32)
diff --git a/release_23/test/CodeGen/X86/vec_shuffle-12.ll b/release_23/test/CodeGen/X86/vec_shuffle-12.ll
deleted file mode 100644
index 70c6a56d7341..000000000000
--- a/release_23/test/CodeGen/X86/vec_shuffle-12.ll
+++ /dev/null
@@ -1,28 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | not grep punpck
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep pextrw | count 4
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep pinsrw | count 6
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep pshuflw | count 3
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep pshufhw | count 2
-
-define <8 x i16> @t1(<8 x i16>* %A, <8 x i16>* %B) {
- %tmp1 = load <8 x i16>* %A
- %tmp2 = load <8 x i16>* %B
- %tmp3 = shufflevector <8 x i16> %tmp1, <8 x i16> %tmp2, <8 x i32> < i32 8, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7 >
- ret <8 x i16> %tmp3
-}
-
-define <8 x i16> @t2(<8 x i16> %A, <8 x i16> %B) {
- %tmp = shufflevector <8 x i16> %A, <8 x i16> %B, <8 x i32> < i32 9, i32 1, i32 2, i32 9, i32 4, i32 5, i32 6, i32 7 >
- ret <8 x i16> %tmp
-}
-
-define <8 x i16> @t3(<8 x i16> %A, <8 x i16> %B) {
- %tmp = shufflevector <8 x i16> %A, <8 x i16> %A, <8 x i32> < i32 8, i32 3, i32 2, i32 13, i32 7, i32 6, i32 5, i32 4 >
- ret <8 x i16> %tmp
-}
-
-define <8 x i16> @t4(<8 x i16> %A, <8 x i16> %B) {
- %tmp = shufflevector <8 x i16> %A, <8 x i16> %B, <8 x i32> < i32 0, i32 7, i32 2, i32 3, i32 1, i32 5, i32 6, i32 5 >
- ret <8 x i16> %tmp
-}
diff --git a/release_23/test/CodeGen/X86/vec_shuffle-13.ll b/release_23/test/CodeGen/X86/vec_shuffle-13.ll
deleted file mode 100644
index f889e8f279ec..000000000000
--- a/release_23/test/CodeGen/X86/vec_shuffle-13.ll
+++ /dev/null
@@ -1,21 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep movlhps | count 1
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep movss | count 1
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep pshufd | count 1
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep pshuflw | count 1
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep pshufhw | count 1
-
-define <8 x i16> @t1(<8 x i16> %A, <8 x i16> %B) nounwind {
- %tmp = shufflevector <8 x i16> %A, <8 x i16> %B, <8 x i32> < i32 8, i32 9, i32 0, i32 1, i32 10, i32 11, i32 2, i32 3 >
- ret <8 x i16> %tmp
-}
-
-define <8 x i16> @t2(<8 x i16> %A, <8 x i16> %B) nounwind {
- %tmp = shufflevector <8 x i16> %A, <8 x i16> %B, <8 x i32> < i32 8, i32 9, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7 >
- ret <8 x i16> %tmp
-}
-
-define <8 x i16> @t3(<8 x i16> %A, <8 x i16> %B) nounwind {
- %tmp = shufflevector <8 x i16> %A, <8 x i16> %B, <8 x i32> < i32 0, i32 0, i32 3, i32 2, i32 4, i32 6, i32 4, i32 7 >
- ret <8 x i16> %tmp
-}
diff --git a/release_23/test/CodeGen/X86/vec_shuffle-14.ll b/release_23/test/CodeGen/X86/vec_shuffle-14.ll
deleted file mode 100644
index 6e8d0b8077da..000000000000
--- a/release_23/test/CodeGen/X86/vec_shuffle-14.ll
+++ /dev/null
@@ -1,42 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep movd | count 1
-; RUN: llvm-as < %s | llc -march=x86-64 -mattr=+sse2 | grep movd | count 2
-; RUN: llvm-as < %s | llc -march=x86-64 -mattr=+sse2 | grep movq | count 3
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | not grep xor
-
-define <4 x i32> @t1(i32 %a) nounwind {
-entry:
- %tmp = insertelement <4 x i32> undef, i32 %a, i32 0
- %tmp6 = shufflevector <4 x i32> zeroinitializer, <4 x i32> %tmp, <4 x i32> < i32 4, i32 1, i32 2, i32 3 > ; <<4 x i32>> [#uses=1]
- ret <4 x i32> %tmp6
-}
-
-define <2 x i64> @t2(i64 %a) nounwind {
-entry:
- %tmp = insertelement <2 x i64> undef, i64 %a, i32 0
- %tmp6 = shufflevector <2 x i64> zeroinitializer, <2 x i64> %tmp, <2 x i32> < i32 2, i32 1 > ; <<4 x i32>> [#uses=1]
- ret <2 x i64> %tmp6
-}
-
-define <2 x i64> @t3(<2 x i64>* %a) nounwind {
-entry:
- %tmp4 = load <2 x i64>* %a, align 16 ; <<2 x i64>> [#uses=1]
- %tmp6 = bitcast <2 x i64> %tmp4 to <4 x i32> ; <<4 x i32>> [#uses=1]
- %tmp7 = shufflevector <4 x i32> zeroinitializer, <4 x i32> %tmp6, <4 x i32> < i32 4, i32 5, i32 2, i32 3 > ; <<4 x i32>> [#uses=1]
- %tmp8 = bitcast <4 x i32> %tmp7 to <2 x i64> ; <<2 x i64>> [#uses=1]
- ret <2 x i64> %tmp8
-}
-
-define <2 x i64> @t4(<2 x i64> %a) nounwind {
-entry:
- %tmp5 = bitcast <2 x i64> %a to <4 x i32> ; <<4 x i32>> [#uses=1]
- %tmp6 = shufflevector <4 x i32> zeroinitializer, <4 x i32> %tmp5, <4 x i32> < i32 4, i32 5, i32 2, i32 3 > ; <<4 x i32>> [#uses=1]
- %tmp7 = bitcast <4 x i32> %tmp6 to <2 x i64> ; <<2 x i64>> [#uses=1]
- ret <2 x i64> %tmp7
-}
-
-define <2 x i64> @t5(<2 x i64> %a) nounwind {
-entry:
- %tmp6 = shufflevector <2 x i64> zeroinitializer, <2 x i64> %a, <2 x i32> < i32 2, i32 1 > ; <<4 x i32>> [#uses=1]
- ret <2 x i64> %tmp6
-}
diff --git a/release_23/test/CodeGen/X86/vec_shuffle-15.ll b/release_23/test/CodeGen/X86/vec_shuffle-15.ll
deleted file mode 100644
index 062f77c279e4..000000000000
--- a/release_23/test/CodeGen/X86/vec_shuffle-15.ll
+++ /dev/null
@@ -1,81 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2
-
-define <2 x i64> @t00(<2 x i64> %a, <2 x i64> %b) nounwind {
- %tmp = shufflevector <2 x i64> %a, <2 x i64> %b, <2 x i32> < i32 0, i32 0 >
- ret <2 x i64> %tmp
-}
-
-define <2 x i64> @t01(<2 x i64> %a, <2 x i64> %b) nounwind {
- %tmp = shufflevector <2 x i64> %a, <2 x i64> %b, <2 x i32> < i32 0, i32 1 >
- ret <2 x i64> %tmp
-}
-
-define <2 x i64> @t02(<2 x i64> %a, <2 x i64> %b) nounwind {
- %tmp = shufflevector <2 x i64> %a, <2 x i64> %b, <2 x i32> < i32 0, i32 2 >
- ret <2 x i64> %tmp
-}
-
-define <2 x i64> @t03(<2 x i64> %a, <2 x i64> %b) nounwind {
- %tmp = shufflevector <2 x i64> %a, <2 x i64> %b, <2 x i32> < i32 0, i32 3 >
- ret <2 x i64> %tmp
-}
-
-define <2 x i64> @t10(<2 x i64> %a, <2 x i64> %b) nounwind {
- %tmp = shufflevector <2 x i64> %a, <2 x i64> %b, <2 x i32> < i32 1, i32 0 >
- ret <2 x i64> %tmp
-}
-
-define <2 x i64> @t11(<2 x i64> %a, <2 x i64> %b) nounwind {
- %tmp = shufflevector <2 x i64> %a, <2 x i64> %b, <2 x i32> < i32 1, i32 1 >
- ret <2 x i64> %tmp
-}
-
-define <2 x i64> @t12(<2 x i64> %a, <2 x i64> %b) nounwind {
- %tmp = shufflevector <2 x i64> %a, <2 x i64> %b, <2 x i32> < i32 1, i32 2 >
- ret <2 x i64> %tmp
-}
-
-define <2 x i64> @t13(<2 x i64> %a, <2 x i64> %b) nounwind {
- %tmp = shufflevector <2 x i64> %a, <2 x i64> %b, <2 x i32> < i32 1, i32 3 >
- ret <2 x i64> %tmp
-}
-
-define <2 x i64> @t20(<2 x i64> %a, <2 x i64> %b) nounwind {
- %tmp = shufflevector <2 x i64> %a, <2 x i64> %b, <2 x i32> < i32 2, i32 0 >
- ret <2 x i64> %tmp
-}
-
-define <2 x i64> @t21(<2 x i64> %a, <2 x i64> %b) nounwind {
- %tmp = shufflevector <2 x i64> %a, <2 x i64> %b, <2 x i32> < i32 2, i32 1 >
- ret <2 x i64> %tmp
-}
-
-define <2 x i64> @t22(<2 x i64> %a, <2 x i64> %b) nounwind {
- %tmp = shufflevector <2 x i64> %a, <2 x i64> %b, <2 x i32> < i32 2, i32 2 >
- ret <2 x i64> %tmp
-}
-
-define <2 x i64> @t23(<2 x i64> %a, <2 x i64> %b) nounwind {
- %tmp = shufflevector <2 x i64> %a, <2 x i64> %b, <2 x i32> < i32 2, i32 3 >
- ret <2 x i64> %tmp
-}
-
-define <2 x i64> @t30(<2 x i64> %a, <2 x i64> %b) nounwind {
- %tmp = shufflevector <2 x i64> %a, <2 x i64> %b, <2 x i32> < i32 3, i32 0 >
- ret <2 x i64> %tmp
-}
-
-define <2 x i64> @t31(<2 x i64> %a, <2 x i64> %b) nounwind {
- %tmp = shufflevector <2 x i64> %a, <2 x i64> %b, <2 x i32> < i32 3, i32 1 >
- ret <2 x i64> %tmp
-}
-
-define <2 x i64> @t32(<2 x i64> %a, <2 x i64> %b) nounwind {
- %tmp = shufflevector <2 x i64> %a, <2 x i64> %b, <2 x i32> < i32 3, i32 2 >
- ret <2 x i64> %tmp
-}
-
-define <2 x i64> @t33(<2 x i64> %a, <2 x i64> %b) nounwind {
- %tmp = shufflevector <2 x i64> %a, <2 x i64> %b, <2 x i32> < i32 3, i32 3 >
- ret <2 x i64> %tmp
-}
diff --git a/release_23/test/CodeGen/X86/vec_shuffle-16.ll b/release_23/test/CodeGen/X86/vec_shuffle-16.ll
deleted file mode 100644
index 79de903536d5..000000000000
--- a/release_23/test/CodeGen/X86/vec_shuffle-16.ll
+++ /dev/null
@@ -1,25 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse,-sse2 | grep shufps | count 4
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse,-sse2 -mtriple=i386-apple-darwin | grep mov | count 2
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep pshufd | count 4
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | not grep shufps
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 -mtriple=i386-apple-darwin | not grep mov
-
-define <4 x float> @t1(<4 x float> %a, <4 x float> %b) nounwind {
- %tmp1 = shufflevector <4 x float> %b, <4 x float> undef, <4 x i32> zeroinitializer
- ret <4 x float> %tmp1
-}
-
-define <4 x float> @t2(<4 x float> %A, <4 x float> %B) nounwind {
- %tmp = shufflevector <4 x float> %A, <4 x float> %B, <4 x i32> < i32 3, i32 3, i32 3, i32 3 >
- ret <4 x float> %tmp
-}
-
-define <4 x float> @t3(<4 x float> %A, <4 x float> %B) nounwind {
- %tmp = shufflevector <4 x float> %A, <4 x float> %B, <4 x i32> < i32 4, i32 4, i32 4, i32 4 >
- ret <4 x float> %tmp
-}
-
-define <4 x float> @t4(<4 x float> %A, <4 x float> %B) nounwind {
- %tmp = shufflevector <4 x float> %A, <4 x float> %B, <4 x i32> < i32 1, i32 3, i32 2, i32 0 >
- ret <4 x float> %tmp
-}
diff --git a/release_23/test/CodeGen/X86/vec_shuffle-17.ll b/release_23/test/CodeGen/X86/vec_shuffle-17.ll
deleted file mode 100644
index 992d79184b87..000000000000
--- a/release_23/test/CodeGen/X86/vec_shuffle-17.ll
+++ /dev/null
@@ -1,13 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86-64 | grep {movd.*%rdi, %xmm0}
-; RUN: llvm-as < %s | llc -march=x86-64 | not grep xor
-; PR2108
-
-define <2 x i64> @doload64(i64 %x) nounwind {
-entry:
- %tmp717 = bitcast i64 %x to double ; <double> [#uses=1]
- %tmp8 = insertelement <2 x double> undef, double %tmp717, i32 0 ; <<2 x double>> [#uses=1]
- %tmp9 = insertelement <2 x double> %tmp8, double 0.000000e+00, i32 1 ; <<2 x double>> [#uses=1]
- %tmp11 = bitcast <2 x double> %tmp9 to <2 x i64> ; <<2 x i64>> [#uses=1]
- ret <2 x i64> %tmp11
-}
-
diff --git a/release_23/test/CodeGen/X86/vec_shuffle-2.ll b/release_23/test/CodeGen/X86/vec_shuffle-2.ll
deleted file mode 100644
index ae698010681b..000000000000
--- a/release_23/test/CodeGen/X86/vec_shuffle-2.ll
+++ /dev/null
@@ -1,47 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 -o %t -f
-; RUN: grep pshufhw %t | count 1
-; RUN: grep pshuflw %t | count 1
-; RUN: grep movhps %t | count 1
-
-define void @test1(<2 x i64>* %res, <2 x i64>* %A) nounwind {
- %tmp = load <2 x i64>* %A ; <<2 x i64>> [#uses=1]
- %tmp.upgrd.1 = bitcast <2 x i64> %tmp to <8 x i16> ; <<8 x i16>> [#uses=8]
- %tmp0 = extractelement <8 x i16> %tmp.upgrd.1, i32 0 ; <i16> [#uses=1]
- %tmp1 = extractelement <8 x i16> %tmp.upgrd.1, i32 1 ; <i16> [#uses=1]
- %tmp2 = extractelement <8 x i16> %tmp.upgrd.1, i32 2 ; <i16> [#uses=1]
- %tmp3 = extractelement <8 x i16> %tmp.upgrd.1, i32 3 ; <i16> [#uses=1]
- %tmp4 = extractelement <8 x i16> %tmp.upgrd.1, i32 4 ; <i16> [#uses=1]
- %tmp5 = extractelement <8 x i16> %tmp.upgrd.1, i32 5 ; <i16> [#uses=1]
- %tmp6 = extractelement <8 x i16> %tmp.upgrd.1, i32 6 ; <i16> [#uses=1]
- %tmp7 = extractelement <8 x i16> %tmp.upgrd.1, i32 7 ; <i16> [#uses=1]
- %tmp8 = insertelement <8 x i16> undef, i16 %tmp2, i32 0 ; <<8 x i16>> [#uses=1]
- %tmp9 = insertelement <8 x i16> %tmp8, i16 %tmp1, i32 1 ; <<8 x i16>> [#uses=1]
- %tmp10 = insertelement <8 x i16> %tmp9, i16 %tmp0, i32 2 ; <<8 x i16>> [#uses=1]
- %tmp11 = insertelement <8 x i16> %tmp10, i16 %tmp3, i32 3 ; <<8 x i16>> [#uses=1]
- %tmp12 = insertelement <8 x i16> %tmp11, i16 %tmp6, i32 4 ; <<8 x i16>> [#uses=1]
- %tmp13 = insertelement <8 x i16> %tmp12, i16 %tmp5, i32 5 ; <<8 x i16>> [#uses=1]
- %tmp14 = insertelement <8 x i16> %tmp13, i16 %tmp4, i32 6 ; <<8 x i16>> [#uses=1]
- %tmp15 = insertelement <8 x i16> %tmp14, i16 %tmp7, i32 7 ; <<8 x i16>> [#uses=1]
- %tmp15.upgrd.2 = bitcast <8 x i16> %tmp15 to <2 x i64> ; <<2 x i64>> [#uses=1]
- store <2 x i64> %tmp15.upgrd.2, <2 x i64>* %res
- ret void
-}
-
-define void @test2(<4 x float>* %r, <2 x i32>* %A) nounwind {
- %tmp = load <4 x float>* %r ; <<4 x float>> [#uses=2]
- %tmp.upgrd.3 = bitcast <2 x i32>* %A to double* ; <double*> [#uses=1]
- %tmp.upgrd.4 = load double* %tmp.upgrd.3 ; <double> [#uses=1]
- %tmp.upgrd.5 = insertelement <2 x double> undef, double %tmp.upgrd.4, i32 0 ; <<2 x double>> [#uses=1]
- %tmp5 = insertelement <2 x double> %tmp.upgrd.5, double undef, i32 1 ; <<2 x double>> [#uses=1]
- %tmp6 = bitcast <2 x double> %tmp5 to <4 x float> ; <<4 x float>> [#uses=2]
- %tmp.upgrd.6 = extractelement <4 x float> %tmp, i32 0 ; <float> [#uses=1]
- %tmp7 = extractelement <4 x float> %tmp, i32 1 ; <float> [#uses=1]
- %tmp8 = extractelement <4 x float> %tmp6, i32 0 ; <float> [#uses=1]
- %tmp9 = extractelement <4 x float> %tmp6, i32 1 ; <float> [#uses=1]
- %tmp10 = insertelement <4 x float> undef, float %tmp.upgrd.6, i32 0 ; <<4 x float>> [#uses=1]
- %tmp11 = insertelement <4 x float> %tmp10, float %tmp7, i32 1 ; <<4 x float>> [#uses=1]
- %tmp12 = insertelement <4 x float> %tmp11, float %tmp8, i32 2 ; <<4 x float>> [#uses=1]
- %tmp13 = insertelement <4 x float> %tmp12, float %tmp9, i32 3 ; <<4 x float>> [#uses=1]
- store <4 x float> %tmp13, <4 x float>* %r
- ret void
-}
diff --git a/release_23/test/CodeGen/X86/vec_shuffle-3.ll b/release_23/test/CodeGen/X86/vec_shuffle-3.ll
deleted file mode 100644
index 6de103808066..000000000000
--- a/release_23/test/CodeGen/X86/vec_shuffle-3.ll
+++ /dev/null
@@ -1,21 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 -o %t -f
-; RUN: grep movlhps %t | count 1
-; RUN: grep movhlps %t | count 1
-
-define <4 x float> @test1(<4 x float>* %x, <4 x float>* %y) {
- %tmp = load <4 x float>* %y ; <<4 x float>> [#uses=2]
- %tmp5 = load <4 x float>* %x ; <<4 x float>> [#uses=2]
- %tmp9 = add <4 x float> %tmp5, %tmp ; <<4 x float>> [#uses=1]
- %tmp21 = sub <4 x float> %tmp5, %tmp ; <<4 x float>> [#uses=1]
- %tmp27 = shufflevector <4 x float> %tmp9, <4 x float> %tmp21, <4 x i32> < i32 0, i32 1, i32 4, i32 5 > ; <<4 x float>> [#uses=1]
- ret <4 x float> %tmp27
-}
-
-define <4 x float> @movhl(<4 x float>* %x, <4 x float>* %y) {
-entry:
- %tmp = load <4 x float>* %y ; <<4 x float>> [#uses=1]
- %tmp3 = load <4 x float>* %x ; <<4 x float>> [#uses=1]
- %tmp4 = shufflevector <4 x float> %tmp3, <4 x float> %tmp, <4 x i32> < i32 2, i32 3, i32 6, i32 7 > ; <<4 x float>> [#uses=1]
- ret <4 x float> %tmp4
-}
-
diff --git a/release_23/test/CodeGen/X86/vec_shuffle-4.ll b/release_23/test/CodeGen/X86/vec_shuffle-4.ll
deleted file mode 100644
index 3c03baa5062c..000000000000
--- a/release_23/test/CodeGen/X86/vec_shuffle-4.ll
+++ /dev/null
@@ -1,12 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 > %t
-; RUN: grep shuf %t | count 2
-; RUN: not grep unpck %t
-
-define void @test(<4 x float>* %res, <4 x float>* %A, <4 x float>* %B, <4 x float>* %C) {
- %tmp3 = load <4 x float>* %B ; <<4 x float>> [#uses=1]
- %tmp5 = load <4 x float>* %C ; <<4 x float>> [#uses=1]
- %tmp11 = shufflevector <4 x float> %tmp3, <4 x float> %tmp5, <4 x i32> < i32 1, i32 4, i32 1, i32 5 > ; <<4 x float>> [#uses=1]
- store <4 x float> %tmp11, <4 x float>* %res
- ret void
-}
-
diff --git a/release_23/test/CodeGen/X86/vec_shuffle-5.ll b/release_23/test/CodeGen/X86/vec_shuffle-5.ll
deleted file mode 100644
index 1acd73fcba39..000000000000
--- a/release_23/test/CodeGen/X86/vec_shuffle-5.ll
+++ /dev/null
@@ -1,13 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 -o %t -f
-; RUN: grep movhlps %t | count 1
-; RUN: grep shufps %t | count 1
-
-define void @test() nounwind {
- %tmp1 = load <4 x float>* null ; <<4 x float>> [#uses=2]
- %tmp2 = shufflevector <4 x float> %tmp1, <4 x float> < float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00 >, <4 x i32> < i32 0, i32 1, i32 6, i32 7 > ; <<4 x float>> [#uses=1]
- %tmp3 = shufflevector <4 x float> %tmp1, <4 x float> zeroinitializer, <4 x i32> < i32 2, i32 3, i32 6, i32 7 > ; <<4 x float>> [#uses=1]
- %tmp4 = add <4 x float> %tmp2, %tmp3 ; <<4 x float>> [#uses=1]
- store <4 x float> %tmp4, <4 x float>* null
- ret void
-}
-
diff --git a/release_23/test/CodeGen/X86/vec_shuffle-6.ll b/release_23/test/CodeGen/X86/vec_shuffle-6.ll
deleted file mode 100644
index f7c9f2daa39d..000000000000
--- a/release_23/test/CodeGen/X86/vec_shuffle-6.ll
+++ /dev/null
@@ -1,42 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 -o %t -f
-; RUN: grep movapd %t | count 1
-; RUN: grep movaps %t | count 1
-; RUN: grep movups %t | count 2
-
-target triple = "i686-apple-darwin"
-@x = global [4 x i32] [ i32 1, i32 2, i32 3, i32 4 ] ; <[4 x i32]*> [#uses=4]
-
-define <2 x i64> @test1() {
- %tmp = load i32* getelementptr ([4 x i32]* @x, i32 0, i32 0) ; <i32> [#uses=1]
- %tmp3 = load i32* getelementptr ([4 x i32]* @x, i32 0, i32 1) ; <i32> [#uses=1]
- %tmp5 = load i32* getelementptr ([4 x i32]* @x, i32 0, i32 2) ; <i32> [#uses=1]
- %tmp7 = load i32* getelementptr ([4 x i32]* @x, i32 0, i32 3) ; <i32> [#uses=1]
- %tmp.upgrd.1 = insertelement <4 x i32> undef, i32 %tmp, i32 0 ; <<4 x i32>> [#uses=1]
- %tmp13 = insertelement <4 x i32> %tmp.upgrd.1, i32 %tmp3, i32 1 ; <<4 x i32>> [#uses=1]
- %tmp14 = insertelement <4 x i32> %tmp13, i32 %tmp5, i32 2 ; <<4 x i32>> [#uses=1]
- %tmp15 = insertelement <4 x i32> %tmp14, i32 %tmp7, i32 3 ; <<4 x i32>> [#uses=1]
- %tmp16 = bitcast <4 x i32> %tmp15 to <2 x i64> ; <<2 x i64>> [#uses=1]
- ret <2 x i64> %tmp16
-}
-
-define <4 x float> @test2(i32 %dummy, float %a, float %b, float %c, float %d) {
- %tmp = insertelement <4 x float> undef, float %a, i32 0 ; <<4 x float>> [#uses=1]
- %tmp11 = insertelement <4 x float> %tmp, float %b, i32 1 ; <<4 x float>> [#uses=1]
- %tmp12 = insertelement <4 x float> %tmp11, float %c, i32 2 ; <<4 x float>> [#uses=1]
- %tmp13 = insertelement <4 x float> %tmp12, float %d, i32 3 ; <<4 x float>> [#uses=1]
- ret <4 x float> %tmp13
-}
-
-define <4 x float> @test3(float %a, float %b, float %c, float %d) {
- %tmp = insertelement <4 x float> undef, float %a, i32 0 ; <<4 x float>> [#uses=1]
- %tmp11 = insertelement <4 x float> %tmp, float %b, i32 1 ; <<4 x float>> [#uses=1]
- %tmp12 = insertelement <4 x float> %tmp11, float %c, i32 2 ; <<4 x float>> [#uses=1]
- %tmp13 = insertelement <4 x float> %tmp12, float %d, i32 3 ; <<4 x float>> [#uses=1]
- ret <4 x float> %tmp13
-}
-
-define <2 x double> @test4(double %a, double %b) {
- %tmp = insertelement <2 x double> undef, double %a, i32 0 ; <<2 x double>> [#uses=1]
- %tmp7 = insertelement <2 x double> %tmp, double %b, i32 1 ; <<2 x double>> [#uses=1]
- ret <2 x double> %tmp7
-}
diff --git a/release_23/test/CodeGen/X86/vec_shuffle-7.ll b/release_23/test/CodeGen/X86/vec_shuffle-7.ll
deleted file mode 100644
index fbcfac5b57a4..000000000000
--- a/release_23/test/CodeGen/X86/vec_shuffle-7.ll
+++ /dev/null
@@ -1,11 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 -o %t -f
-; RUN: grep xorps %t | count 1
-; RUN: not grep shufps %t
-
-define void @test() {
- bitcast <4 x i32> zeroinitializer to <4 x float> ; <<4 x float>>:1 [#uses=1]
- shufflevector <4 x float> %1, <4 x float> zeroinitializer, <4 x i32> zeroinitializer ; <<4 x float>>:2 [#uses=1]
- store <4 x float> %2, <4 x float>* null
- unreachable
-}
-
diff --git a/release_23/test/CodeGen/X86/vec_shuffle-8.ll b/release_23/test/CodeGen/X86/vec_shuffle-8.ll
deleted file mode 100644
index 73d75e63914d..000000000000
--- a/release_23/test/CodeGen/X86/vec_shuffle-8.ll
+++ /dev/null
@@ -1,10 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | \
-; RUN: not grep shufps
-
-define void @test(<4 x float>* %res, <4 x float>* %A) {
- %tmp1 = load <4 x float>* %A ; <<4 x float>> [#uses=1]
- %tmp2 = shufflevector <4 x float> %tmp1, <4 x float> undef, <4 x i32> < i32 0, i32 5, i32 6, i32 7 > ; <<4 x float>> [#uses=1]
- store <4 x float> %tmp2, <4 x float>* %res
- ret void
-}
-
diff --git a/release_23/test/CodeGen/X86/vec_shuffle-9.ll b/release_23/test/CodeGen/X86/vec_shuffle-9.ll
deleted file mode 100644
index 68577d455f75..000000000000
--- a/release_23/test/CodeGen/X86/vec_shuffle-9.ll
+++ /dev/null
@@ -1,20 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 -o %t -f
-; RUN: grep punpck %t | count 2
-; RUN: not grep pextrw %t
-
-define <4 x i32> @test(i8** %ptr) {
-entry:
- %tmp = load i8** %ptr ; <i8*> [#uses=1]
- %tmp.upgrd.1 = bitcast i8* %tmp to float* ; <float*> [#uses=1]
- %tmp.upgrd.2 = load float* %tmp.upgrd.1 ; <float> [#uses=1]
- %tmp.upgrd.3 = insertelement <4 x float> undef, float %tmp.upgrd.2, i32 0 ; <<4 x float>> [#uses=1]
- %tmp9 = insertelement <4 x float> %tmp.upgrd.3, float 0.000000e+00, i32 1 ; <<4 x float>> [#uses=1]
- %tmp10 = insertelement <4 x float> %tmp9, float 0.000000e+00, i32 2 ; <<4 x float>> [#uses=1]
- %tmp11 = insertelement <4 x float> %tmp10, float 0.000000e+00, i32 3 ; <<4 x float>> [#uses=1]
- %tmp21 = bitcast <4 x float> %tmp11 to <16 x i8> ; <<16 x i8>> [#uses=1]
- %tmp22 = shufflevector <16 x i8> %tmp21, <16 x i8> zeroinitializer, <16 x i32> < i32 0, i32 16, i32 1, i32 17, i32 2, i32 18, i32 3, i32 19, i32 4, i32 20, i32 5, i32 21, i32 6, i32 22, i32 7, i32 23 > ; <<16 x i8>> [#uses=1]
- %tmp31 = bitcast <16 x i8> %tmp22 to <8 x i16> ; <<8 x i16>> [#uses=1]
- %tmp.upgrd.4 = shufflevector <8 x i16> zeroinitializer, <8 x i16> %tmp31, <8 x i32> < i32 0, i32 8, i32 1, i32 9, i32 2, i32 10, i32 3, i32 11 > ; <<8 x i16>> [#uses=1]
- %tmp36 = bitcast <8 x i16> %tmp.upgrd.4 to <4 x i32> ; <<4 x i32>> [#uses=1]
- ret <4 x i32> %tmp36
-}
diff --git a/release_23/test/CodeGen/X86/vec_shuffle.ll b/release_23/test/CodeGen/X86/vec_shuffle.ll
deleted file mode 100644
index f39b9fe2dbae..000000000000
--- a/release_23/test/CodeGen/X86/vec_shuffle.ll
+++ /dev/null
@@ -1,44 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 -o %t -f
-; RUN: grep shufp %t | count 1
-; RUN: grep movupd %t | count 1
-; RUN: grep pshufhw %t | count 1
-
-define void @test_v4sf(<4 x float>* %P, float %X, float %Y) nounwind {
- %tmp = insertelement <4 x float> zeroinitializer, float %X, i32 0 ; <<4 x float>> [#uses=1]
- %tmp2 = insertelement <4 x float> %tmp, float %X, i32 1 ; <<4 x float>> [#uses=1]
- %tmp4 = insertelement <4 x float> %tmp2, float %Y, i32 2 ; <<4 x float>> [#uses=1]
- %tmp6 = insertelement <4 x float> %tmp4, float %Y, i32 3 ; <<4 x float>> [#uses=1]
- store <4 x float> %tmp6, <4 x float>* %P
- ret void
-}
-
-define void @test_v2sd(<2 x double>* %P, double %X, double %Y) nounwind {
- %tmp = insertelement <2 x double> zeroinitializer, double %X, i32 0 ; <<2 x double>> [#uses=1]
- %tmp2 = insertelement <2 x double> %tmp, double %Y, i32 1 ; <<2 x double>> [#uses=1]
- store <2 x double> %tmp2, <2 x double>* %P
- ret void
-}
-
-define void @test_v8i16(<2 x i64>* %res, <2 x i64>* %A) nounwind {
- %tmp = load <2 x i64>* %A ; <<2 x i64>> [#uses=1]
- %tmp.upgrd.1 = bitcast <2 x i64> %tmp to <8 x i16> ; <<8 x i16>> [#uses=8]
- %tmp.upgrd.2 = extractelement <8 x i16> %tmp.upgrd.1, i32 0 ; <i16> [#uses=1]
- %tmp1 = extractelement <8 x i16> %tmp.upgrd.1, i32 1 ; <i16> [#uses=1]
- %tmp2 = extractelement <8 x i16> %tmp.upgrd.1, i32 2 ; <i16> [#uses=1]
- %tmp3 = extractelement <8 x i16> %tmp.upgrd.1, i32 3 ; <i16> [#uses=1]
- %tmp4 = extractelement <8 x i16> %tmp.upgrd.1, i32 6 ; <i16> [#uses=1]
- %tmp5 = extractelement <8 x i16> %tmp.upgrd.1, i32 5 ; <i16> [#uses=1]
- %tmp6 = extractelement <8 x i16> %tmp.upgrd.1, i32 4 ; <i16> [#uses=1]
- %tmp7 = extractelement <8 x i16> %tmp.upgrd.1, i32 7 ; <i16> [#uses=1]
- %tmp8 = insertelement <8 x i16> undef, i16 %tmp.upgrd.2, i32 0 ; <<8 x i16>> [#uses=1]
- %tmp9 = insertelement <8 x i16> %tmp8, i16 %tmp1, i32 1 ; <<8 x i16>> [#uses=1]
- %tmp10 = insertelement <8 x i16> %tmp9, i16 %tmp2, i32 2 ; <<8 x i16>> [#uses=1]
- %tmp11 = insertelement <8 x i16> %tmp10, i16 %tmp3, i32 3 ; <<8 x i16>> [#uses=1]
- %tmp12 = insertelement <8 x i16> %tmp11, i16 %tmp4, i32 4 ; <<8 x i16>> [#uses=1]
- %tmp13 = insertelement <8 x i16> %tmp12, i16 %tmp5, i32 5 ; <<8 x i16>> [#uses=1]
- %tmp14 = insertelement <8 x i16> %tmp13, i16 %tmp6, i32 6 ; <<8 x i16>> [#uses=1]
- %tmp15 = insertelement <8 x i16> %tmp14, i16 %tmp7, i32 7 ; <<8 x i16>> [#uses=1]
- %tmp15.upgrd.3 = bitcast <8 x i16> %tmp15 to <2 x i64> ; <<2 x i64>> [#uses=1]
- store <2 x i64> %tmp15.upgrd.3, <2 x i64>* %res
- ret void
-}
diff --git a/release_23/test/CodeGen/X86/vec_splat-2.ll b/release_23/test/CodeGen/X86/vec_splat-2.ll
deleted file mode 100644
index c6e3dddd5fa6..000000000000
--- a/release_23/test/CodeGen/X86/vec_splat-2.ll
+++ /dev/null
@@ -1,26 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep pshufd | count 1
-
-define void @test(<2 x i64>* %P, i8 %x) nounwind {
- %tmp = insertelement <16 x i8> zeroinitializer, i8 %x, i32 0 ; <<16 x i8>> [#uses=1]
- %tmp36 = insertelement <16 x i8> %tmp, i8 %x, i32 1 ; <<16 x i8>> [#uses=1]
- %tmp38 = insertelement <16 x i8> %tmp36, i8 %x, i32 2 ; <<16 x i8>> [#uses=1]
- %tmp40 = insertelement <16 x i8> %tmp38, i8 %x, i32 3 ; <<16 x i8>> [#uses=1]
- %tmp42 = insertelement <16 x i8> %tmp40, i8 %x, i32 4 ; <<16 x i8>> [#uses=1]
- %tmp44 = insertelement <16 x i8> %tmp42, i8 %x, i32 5 ; <<16 x i8>> [#uses=1]
- %tmp46 = insertelement <16 x i8> %tmp44, i8 %x, i32 6 ; <<16 x i8>> [#uses=1]
- %tmp48 = insertelement <16 x i8> %tmp46, i8 %x, i32 7 ; <<16 x i8>> [#uses=1]
- %tmp50 = insertelement <16 x i8> %tmp48, i8 %x, i32 8 ; <<16 x i8>> [#uses=1]
- %tmp52 = insertelement <16 x i8> %tmp50, i8 %x, i32 9 ; <<16 x i8>> [#uses=1]
- %tmp54 = insertelement <16 x i8> %tmp52, i8 %x, i32 10 ; <<16 x i8>> [#uses=1]
- %tmp56 = insertelement <16 x i8> %tmp54, i8 %x, i32 11 ; <<16 x i8>> [#uses=1]
- %tmp58 = insertelement <16 x i8> %tmp56, i8 %x, i32 12 ; <<16 x i8>> [#uses=1]
- %tmp60 = insertelement <16 x i8> %tmp58, i8 %x, i32 13 ; <<16 x i8>> [#uses=1]
- %tmp62 = insertelement <16 x i8> %tmp60, i8 %x, i32 14 ; <<16 x i8>> [#uses=1]
- %tmp64 = insertelement <16 x i8> %tmp62, i8 %x, i32 15 ; <<16 x i8>> [#uses=1]
- %tmp68 = load <2 x i64>* %P ; <<2 x i64>> [#uses=1]
- %tmp71 = bitcast <2 x i64> %tmp68 to <16 x i8> ; <<16 x i8>> [#uses=1]
- %tmp73 = add <16 x i8> %tmp71, %tmp64 ; <<16 x i8>> [#uses=1]
- %tmp73.upgrd.1 = bitcast <16 x i8> %tmp73 to <2 x i64> ; <<2 x i64>> [#uses=1]
- store <2 x i64> %tmp73.upgrd.1, <2 x i64>* %P
- ret void
-}
diff --git a/release_23/test/CodeGen/X86/vec_splat.ll b/release_23/test/CodeGen/X86/vec_splat.ll
deleted file mode 100644
index 64222e40ff23..000000000000
--- a/release_23/test/CodeGen/X86/vec_splat.ll
+++ /dev/null
@@ -1,22 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep pshufd
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse3 | grep movddup
-
-define void @test_v4sf(<4 x float>* %P, <4 x float>* %Q, float %X) nounwind {
- %tmp = insertelement <4 x float> zeroinitializer, float %X, i32 0 ; <<4 x float>> [#uses=1]
- %tmp2 = insertelement <4 x float> %tmp, float %X, i32 1 ; <<4 x float>> [#uses=1]
- %tmp4 = insertelement <4 x float> %tmp2, float %X, i32 2 ; <<4 x float>> [#uses=1]
- %tmp6 = insertelement <4 x float> %tmp4, float %X, i32 3 ; <<4 x float>> [#uses=1]
- %tmp8 = load <4 x float>* %Q ; <<4 x float>> [#uses=1]
- %tmp10 = mul <4 x float> %tmp8, %tmp6 ; <<4 x float>> [#uses=1]
- store <4 x float> %tmp10, <4 x float>* %P
- ret void
-}
-
-define void @test_v2sd(<2 x double>* %P, <2 x double>* %Q, double %X) nounwind {
- %tmp = insertelement <2 x double> zeroinitializer, double %X, i32 0 ; <<2 x double>> [#uses=1]
- %tmp2 = insertelement <2 x double> %tmp, double %X, i32 1 ; <<2 x double>> [#uses=1]
- %tmp4 = load <2 x double>* %Q ; <<2 x double>> [#uses=1]
- %tmp6 = mul <2 x double> %tmp4, %tmp2 ; <<2 x double>> [#uses=1]
- store <2 x double> %tmp6, <2 x double>* %P
- ret void
-}
diff --git a/release_23/test/CodeGen/X86/vec_ss_load_fold.ll b/release_23/test/CodeGen/X86/vec_ss_load_fold.ll
deleted file mode 100644
index 0f15f923fea6..000000000000
--- a/release_23/test/CodeGen/X86/vec_ss_load_fold.ll
+++ /dev/null
@@ -1,41 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse,+sse2 -o %t -f
-; RUN: grep minss %t | grep CPI | count 2
-; RUN: grep CPI %t | not grep movss
-
-target datalayout = "e-p:32:32"
-target triple = "i686-apple-darwin8.7.2"
-
-define i16 @test1(float %f) nounwind {
- %tmp = insertelement <4 x float> undef, float %f, i32 0 ; <<4 x float>> [#uses=1]
- %tmp10 = insertelement <4 x float> %tmp, float 0.000000e+00, i32 1 ; <<4 x float>> [#uses=1]
- %tmp11 = insertelement <4 x float> %tmp10, float 0.000000e+00, i32 2 ; <<4 x float>> [#uses=1]
- %tmp12 = insertelement <4 x float> %tmp11, float 0.000000e+00, i32 3 ; <<4 x float>> [#uses=1]
- %tmp28 = tail call <4 x float> @llvm.x86.sse.sub.ss( <4 x float> %tmp12, <4 x float> < float 1.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00 > ) ; <<4 x float>> [#uses=1]
- %tmp37 = tail call <4 x float> @llvm.x86.sse.mul.ss( <4 x float> %tmp28, <4 x float> < float 5.000000e-01, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00 > ) ; <<4 x float>> [#uses=1]
- %tmp48 = tail call <4 x float> @llvm.x86.sse.min.ss( <4 x float> %tmp37, <4 x float> < float 6.553500e+04, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00 > ) ; <<4 x float>> [#uses=1]
- %tmp59 = tail call <4 x float> @llvm.x86.sse.max.ss( <4 x float> %tmp48, <4 x float> zeroinitializer ) ; <<4 x float>> [#uses=1]
- %tmp.upgrd.1 = tail call i32 @llvm.x86.sse.cvttss2si( <4 x float> %tmp59 ) ; <i32> [#uses=1]
- %tmp69 = trunc i32 %tmp.upgrd.1 to i16 ; <i16> [#uses=1]
- ret i16 %tmp69
-}
-
-define i16 @test2(float %f) nounwind {
- %tmp28 = sub float %f, 1.000000e+00 ; <float> [#uses=1]
- %tmp37 = mul float %tmp28, 5.000000e-01 ; <float> [#uses=1]
- %tmp375 = insertelement <4 x float> undef, float %tmp37, i32 0 ; <<4 x float>> [#uses=1]
- %tmp48 = tail call <4 x float> @llvm.x86.sse.min.ss( <4 x float> %tmp375, <4 x float> < float 6.553500e+04, float undef, float undef, float undef > ) ; <<4 x float>> [#uses=1]
- %tmp59 = tail call <4 x float> @llvm.x86.sse.max.ss( <4 x float> %tmp48, <4 x float> < float 0.000000e+00, float undef, float undef, float undef > ) ; <<4 x float>> [#uses=1]
- %tmp = tail call i32 @llvm.x86.sse.cvttss2si( <4 x float> %tmp59 ) ; <i32> [#uses=1]
- %tmp69 = trunc i32 %tmp to i16 ; <i16> [#uses=1]
- ret i16 %tmp69
-}
-
-declare <4 x float> @llvm.x86.sse.sub.ss(<4 x float>, <4 x float>)
-
-declare <4 x float> @llvm.x86.sse.mul.ss(<4 x float>, <4 x float>)
-
-declare <4 x float> @llvm.x86.sse.min.ss(<4 x float>, <4 x float>)
-
-declare <4 x float> @llvm.x86.sse.max.ss(<4 x float>, <4 x float>)
-
-declare i32 @llvm.x86.sse.cvttss2si(<4 x float>)
diff --git a/release_23/test/CodeGen/X86/vec_zero-2.ll b/release_23/test/CodeGen/X86/vec_zero-2.ll
deleted file mode 100644
index efdf5649a14b..000000000000
--- a/release_23/test/CodeGen/X86/vec_zero-2.ll
+++ /dev/null
@@ -1,24 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2
-
-define i32 @t() {
-entry:
- br i1 true, label %bb4743, label %bb1656
-bb1656: ; preds = %entry
- ret i32 0
-bb1664: ; preds = %entry
- br i1 false, label %bb5310, label %bb4743
-bb4743: ; preds = %bb1664
- %tmp5256 = bitcast <2 x i64> zeroinitializer to <8 x i16> ; <<8 x i16>> [#uses=1]
- %tmp5257 = sub <8 x i16> %tmp5256, zeroinitializer ; <<8 x i16>> [#uses=1]
- %tmp5258 = bitcast <8 x i16> %tmp5257 to <2 x i64> ; <<2 x i64>> [#uses=1]
- %tmp5265 = bitcast <2 x i64> %tmp5258 to <8 x i16> ; <<8 x i16>> [#uses=1]
- %tmp5266 = call <8 x i16> @llvm.x86.sse2.packuswb.128( <8 x i16> %tmp5265, <8 x i16> zeroinitializer ) nounwind readnone ; <<8 x i16>> [#uses=1]
- %tmp5267 = bitcast <8 x i16> %tmp5266 to <2 x i64> ; <<2 x i64>> [#uses=1]
- %tmp5294 = and <2 x i64> zeroinitializer, %tmp5267 ; <<2 x i64>> [#uses=1]
- br label %bb5310
-bb5310: ; preds = %bb4743, %bb1664
- %tmp5294.pn = phi <2 x i64> [ %tmp5294, %bb4743 ], [ zeroinitializer, %bb1664 ] ; <<2 x i64>> [#uses=0]
- ret i32 0
-}
-
-declare <8 x i16> @llvm.x86.sse2.packuswb.128(<8 x i16>, <8 x i16>) nounwind readnone
diff --git a/release_23/test/CodeGen/X86/vec_zero.ll b/release_23/test/CodeGen/X86/vec_zero.ll
deleted file mode 100644
index 17b378f39203..000000000000
--- a/release_23/test/CodeGen/X86/vec_zero.ll
+++ /dev/null
@@ -1,16 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep xorps | count 2
-
-define void @foo(<4 x float>* %P) {
- %T = load <4 x float>* %P ; <<4 x float>> [#uses=1]
- %S = add <4 x float> zeroinitializer, %T ; <<4 x float>> [#uses=1]
- store <4 x float> %S, <4 x float>* %P
- ret void
-}
-
-define void @bar(<4 x i32>* %P) {
- %T = load <4 x i32>* %P ; <<4 x i32>> [#uses=1]
- %S = add <4 x i32> zeroinitializer, %T ; <<4 x i32>> [#uses=1]
- store <4 x i32> %S, <4 x i32>* %P
- ret void
-}
-
diff --git a/release_23/test/CodeGen/X86/vec_zero_cse.ll b/release_23/test/CodeGen/X86/vec_zero_cse.ll
deleted file mode 100644
index 0ccf745e524e..000000000000
--- a/release_23/test/CodeGen/X86/vec_zero_cse.ll
+++ /dev/null
@@ -1,35 +0,0 @@
-; RUN: llvm-as < %s | llc -relocation-model=static -march=x86 -mcpu=yonah | grep pxor | count 1
-; RUN: llvm-as < %s | llc -relocation-model=static -march=x86 -mcpu=yonah | grep xorps | count 1
-; RUN: llvm-as < %s | llc -relocation-model=static -march=x86 -mcpu=yonah | grep pcmpeqd | count 2
-
-@M1 = external global <1 x i64>
-@M2 = external global <2 x i32>
-
-@S1 = external global <2 x i64>
-@S2 = external global <4 x i32>
-
-define void @test() {
- store <1 x i64> zeroinitializer, <1 x i64>* @M1
- store <2 x i32> zeroinitializer, <2 x i32>* @M2
- ret void
-}
-
-define void @test2() {
- store <1 x i64> < i64 -1 >, <1 x i64>* @M1
- store <2 x i32> < i32 -1, i32 -1 >, <2 x i32>* @M2
- ret void
-}
-
-define void @test3() {
- store <2 x i64> zeroinitializer, <2 x i64>* @S1
- store <4 x i32> zeroinitializer, <4 x i32>* @S2
- ret void
-}
-
-define void @test4() {
- store <2 x i64> < i64 -1, i64 -1>, <2 x i64>* @S1
- store <4 x i32> < i32 -1, i32 -1, i32 -1, i32 -1 >, <4 x i32>* @S2
- ret void
-}
-
-
diff --git a/release_23/test/CodeGen/X86/vector-intrinsics.ll b/release_23/test/CodeGen/X86/vector-intrinsics.ll
deleted file mode 100644
index 32916589879d..000000000000
--- a/release_23/test/CodeGen/X86/vector-intrinsics.ll
+++ /dev/null
@@ -1,27 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86-64 | grep call | count 16
-
-declare <4 x double> @llvm.sin.v4f64(<4 x double> %p)
-declare <4 x double> @llvm.cos.v4f64(<4 x double> %p)
-declare <4 x double> @llvm.pow.v4f64(<4 x double> %p, <4 x double> %q)
-declare <4 x double> @llvm.powi.v4f64(<4 x double> %p, i32)
-
-define <4 x double> @foo(<4 x double> %p)
-{
- %t = call <4 x double> @llvm.sin.v4f64(<4 x double> %p)
- ret <4 x double> %t
-}
-define <4 x double> @goo(<4 x double> %p)
-{
- %t = call <4 x double> @llvm.cos.v4f64(<4 x double> %p)
- ret <4 x double> %t
-}
-define <4 x double> @moo(<4 x double> %p, <4 x double> %q)
-{
- %t = call <4 x double> @llvm.pow.v4f64(<4 x double> %p, <4 x double> %q)
- ret <4 x double> %t
-}
-define <4 x double> @zoo(<4 x double> %p, i32 %q)
-{
- %t = call <4 x double> @llvm.powi.v4f64(<4 x double> %p, i32 %q)
- ret <4 x double> %t
-}
diff --git a/release_23/test/CodeGen/X86/vector-rem.ll b/release_23/test/CodeGen/X86/vector-rem.ll
deleted file mode 100644
index cfdd34ee1c9b..000000000000
--- a/release_23/test/CodeGen/X86/vector-rem.ll
+++ /dev/null
@@ -1,15 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86-64 | grep div | count 8
-; RUN: llvm-as < %s | llc -march=x86-64 | grep fmodf | count 4
-
-define <4 x i32> @foo(<4 x i32> %t, <4 x i32> %u) {
- %m = srem <4 x i32> %t, %u
- ret <4 x i32> %m
-}
-define <4 x i32> @bar(<4 x i32> %t, <4 x i32> %u) {
- %m = urem <4 x i32> %t, %u
- ret <4 x i32> %m
-}
-define <4 x float> @qux(<4 x float> %t, <4 x float> %u) {
- %m = frem <4 x float> %t, %u
- ret <4 x float> %m
-}
diff --git a/release_23/test/CodeGen/X86/vector.ll b/release_23/test/CodeGen/X86/vector.ll
deleted file mode 100644
index ab56c8ac5fc9..000000000000
--- a/release_23/test/CodeGen/X86/vector.ll
+++ /dev/null
@@ -1,156 +0,0 @@
-; Test that vectors are scalarized/lowered correctly.
-; RUN: llvm-as < %s | llc -march=x86 -mcpu=i386
-; RUN: llvm-as < %s | llc -march=x86 -mcpu=yonah
-
-%d8 = type <8 x double>
-%f1 = type <1 x float>
-%f2 = type <2 x float>
-%f4 = type <4 x float>
-%f8 = type <8 x float>
-%i4 = type <4 x i32>
-
-
-;;; TEST HANDLING OF VARIOUS VECTOR SIZES
-
-define void @test_f1(%f1* %P, %f1* %Q, %f1* %S) {
- %p = load %f1* %P ; <%f1> [#uses=1]
- %q = load %f1* %Q ; <%f1> [#uses=1]
- %R = add %f1 %p, %q ; <%f1> [#uses=1]
- store %f1 %R, %f1* %S
- ret void
-}
-
-define void @test_f2(%f2* %P, %f2* %Q, %f2* %S) {
- %p = load %f2* %P ; <%f2> [#uses=1]
- %q = load %f2* %Q ; <%f2> [#uses=1]
- %R = add %f2 %p, %q ; <%f2> [#uses=1]
- store %f2 %R, %f2* %S
- ret void
-}
-
-define void @test_f4(%f4* %P, %f4* %Q, %f4* %S) {
- %p = load %f4* %P ; <%f4> [#uses=1]
- %q = load %f4* %Q ; <%f4> [#uses=1]
- %R = add %f4 %p, %q ; <%f4> [#uses=1]
- store %f4 %R, %f4* %S
- ret void
-}
-
-define void @test_f8(%f8* %P, %f8* %Q, %f8* %S) {
- %p = load %f8* %P ; <%f8> [#uses=1]
- %q = load %f8* %Q ; <%f8> [#uses=1]
- %R = add %f8 %p, %q ; <%f8> [#uses=1]
- store %f8 %R, %f8* %S
- ret void
-}
-
-define void @test_fmul(%f8* %P, %f8* %Q, %f8* %S) {
- %p = load %f8* %P ; <%f8> [#uses=1]
- %q = load %f8* %Q ; <%f8> [#uses=1]
- %R = mul %f8 %p, %q ; <%f8> [#uses=1]
- store %f8 %R, %f8* %S
- ret void
-}
-
-define void @test_div(%f8* %P, %f8* %Q, %f8* %S) {
- %p = load %f8* %P ; <%f8> [#uses=1]
- %q = load %f8* %Q ; <%f8> [#uses=1]
- %R = fdiv %f8 %p, %q ; <%f8> [#uses=1]
- store %f8 %R, %f8* %S
- ret void
-}
-
-;;; TEST VECTOR CONSTRUCTS
-
-define void @test_cst(%f4* %P, %f4* %S) {
- %p = load %f4* %P ; <%f4> [#uses=1]
- %R = add %f4 %p, < float 0x3FB99999A0000000, float 1.000000e+00, float 2.000000e+00, float 4.500000e+00 > ; <%f4> [#uses=1]
- store %f4 %R, %f4* %S
- ret void
-}
-
-define void @test_zero(%f4* %P, %f4* %S) {
- %p = load %f4* %P ; <%f4> [#uses=1]
- %R = add %f4 %p, zeroinitializer ; <%f4> [#uses=1]
- store %f4 %R, %f4* %S
- ret void
-}
-
-define void @test_undef(%f4* %P, %f4* %S) {
- %p = load %f4* %P ; <%f4> [#uses=1]
- %R = add %f4 %p, undef ; <%f4> [#uses=1]
- store %f4 %R, %f4* %S
- ret void
-}
-
-define void @test_constant_insert(%f4* %S) {
- %R = insertelement %f4 zeroinitializer, float 1.000000e+01, i32 0 ; <%f4> [#uses
- store %f4 %R, %f4* %S
- ret void
-}
-
-define void @test_variable_buildvector(float %F, %f4* %S) {
- %R = insertelement %f4 zeroinitializer, float %F, i32 0 ; <%f4> [#uses=1]
- store %f4 %R, %f4* %S
- ret void
-}
-
-define void @test_scalar_to_vector(float %F, %f4* %S) {
- %R = insertelement %f4 undef, float %F, i32 0 ; <%f4> [#uses=1]
- store %f4 %R, %f4* %S
- ret void
-}
-
-define float @test_extract_elt(%f8* %P) {
- %p = load %f8* %P ; <%f8> [#uses=1]
- %R = extractelement %f8 %p, i32 3 ; <float> [#uses=1]
- ret float %R
-}
-
-define double @test_extract_elt2(%d8* %P) {
- %p = load %d8* %P ; <%d8> [#uses=1]
- %R = extractelement %d8 %p, i32 3 ; <double> [#uses=1]
- ret double %R
-}
-
-define void @test_cast_1(%f4* %b, %i4* %a) {
- %tmp = load %f4* %b ; <%f4> [#uses=1]
- %tmp2 = add %f4 %tmp, < float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00 > ; <%f4> [#uses=1]
- %tmp3 = bitcast %f4 %tmp2 to %i4 ; <%i4> [#uses=1]
- %tmp4 = add %i4 %tmp3, < i32 1, i32 2, i32 3, i32 4 > ; <%i4> [#uses=1]
- store %i4 %tmp4, %i4* %a
- ret void
-}
-
-define void @test_cast_2(%f8* %a, <8 x i32>* %b) {
- %T = load %f8* %a ; <%f8> [#uses=1]
- %T2 = bitcast %f8 %T to <8 x i32> ; <<8 x i32>> [#uses=1]
- store <8 x i32> %T2, <8 x i32>* %b
- ret void
-}
-
-
-;;; TEST IMPORTANT IDIOMS
-
-define void @splat(%f4* %P, %f4* %Q, float %X) {
- %tmp = insertelement %f4 undef, float %X, i32 0 ; <%f4> [#uses=1]
- %tmp2 = insertelement %f4 %tmp, float %X, i32 1 ; <%f4> [#uses=1]
- %tmp4 = insertelement %f4 %tmp2, float %X, i32 2 ; <%f4> [#uses=1]
- %tmp6 = insertelement %f4 %tmp4, float %X, i32 3 ; <%f4> [#uses=1]
- %q = load %f4* %Q ; <%f4> [#uses=1]
- %R = add %f4 %q, %tmp6 ; <%f4> [#uses=1]
- store %f4 %R, %f4* %P
- ret void
-}
-
-define void @splat_i4(%i4* %P, %i4* %Q, i32 %X) {
- %tmp = insertelement %i4 undef, i32 %X, i32 0 ; <%i4> [#uses=1]
- %tmp2 = insertelement %i4 %tmp, i32 %X, i32 1 ; <%i4> [#uses=1]
- %tmp4 = insertelement %i4 %tmp2, i32 %X, i32 2 ; <%i4> [#uses=1]
- %tmp6 = insertelement %i4 %tmp4, i32 %X, i32 3 ; <%i4> [#uses=1]
- %q = load %i4* %Q ; <%i4> [#uses=1]
- %R = add %i4 %q, %tmp6 ; <%i4> [#uses=1]
- store %i4 %R, %i4* %P
- ret void
-}
-
diff --git a/release_23/test/CodeGen/X86/weak.ll b/release_23/test/CodeGen/X86/weak.ll
deleted file mode 100644
index 28638afd57ef..000000000000
--- a/release_23/test/CodeGen/X86/weak.ll
+++ /dev/null
@@ -1,4 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86
-@a = extern_weak global i32 ; <i32*> [#uses=1]
-@b = global i32* @a ; <i32**> [#uses=0]
-
diff --git a/release_23/test/CodeGen/X86/x86-64-and-mask.ll b/release_23/test/CodeGen/X86/x86-64-and-mask.ll
deleted file mode 100644
index 3d61e5dbe5a7..000000000000
--- a/release_23/test/CodeGen/X86/x86-64-and-mask.ll
+++ /dev/null
@@ -1,12 +0,0 @@
-; RUN: llvm-as < %s | llc | grep {movl.*%edi, %eax}
-; This should be a single mov, not a load of immediate + andq.
-
-target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128"
-target triple = "x86_64-apple-darwin8"
-
-define i64 @test(i64 %x) nounwind {
-entry:
- %tmp123 = and i64 %x, 4294967295 ; <i64> [#uses=1]
- ret i64 %tmp123
-}
-
diff --git a/release_23/test/CodeGen/X86/x86-64-arg.ll b/release_23/test/CodeGen/X86/x86-64-arg.ll
deleted file mode 100644
index 22a095b0d9b5..000000000000
--- a/release_23/test/CodeGen/X86/x86-64-arg.ll
+++ /dev/null
@@ -1,15 +0,0 @@
-; RUN: llvm-as < %s | llc | grep {movl %edi, %eax}
-; The input value is already sign extended, don't re-extend it.
-; This testcase corresponds to:
-; int test(short X) { return (int)X; }
-
-target datalayout = "e-p:64:64"
-target triple = "x86_64-apple-darwin8"
-
-
-define i32 @test(i16 signext %X) {
-entry:
- %tmp12 = sext i16 %X to i32 ; <i32> [#uses=1]
- ret i32 %tmp12
-}
-
diff --git a/release_23/test/CodeGen/X86/x86-64-asm.ll b/release_23/test/CodeGen/X86/x86-64-asm.ll
deleted file mode 100644
index 8ccf8b67448b..000000000000
--- a/release_23/test/CodeGen/X86/x86-64-asm.ll
+++ /dev/null
@@ -1,12 +0,0 @@
-; RUN: llvm-as < %s | llc
-; PR1029
-
-target datalayout = "e-p:64:64"
-target triple = "x86_64-unknown-linux-gnu"
-
-define void @frame_dummy() {
-entry:
- %tmp1 = tail call void (i8*)* (void (i8*)*)* asm "", "=r,0,~{dirflag},~{fpsr},~{flags}"( void (i8*)* null ) ; <void (i8*)*> [#uses=0]
- ret void
-}
-
diff --git a/release_23/test/CodeGen/X86/x86-64-dead-stack-adjust.ll b/release_23/test/CodeGen/X86/x86-64-dead-stack-adjust.ll
deleted file mode 100644
index 15a30de21c6f..000000000000
--- a/release_23/test/CodeGen/X86/x86-64-dead-stack-adjust.ll
+++ /dev/null
@@ -1,12 +0,0 @@
-; RUN: llvm-as < %s | llc | not grep rsp
-; RUN: llvm-as < %s | llc | grep cvttsd2siq
-
-target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128"
-target triple = "x86_64-apple-darwin8"
-
-define double @a(double %b) nounwind {
-entry:
- %tmp12 = fptoui double %b to i32 ; <i32> [#uses=1]
- %tmp123 = uitofp i32 %tmp12 to double ; <double> [#uses=1]
- ret double %tmp123
-}
diff --git a/release_23/test/CodeGen/X86/x86-64-gv-offset.ll b/release_23/test/CodeGen/X86/x86-64-gv-offset.ll
deleted file mode 100644
index b89e1b95368d..000000000000
--- a/release_23/test/CodeGen/X86/x86-64-gv-offset.ll
+++ /dev/null
@@ -1,14 +0,0 @@
-; RUN: llvm-as < %s | llc -mtriple=x86_64-apple-darwin | not grep lea
-
- %struct.x = type { float, double }
-@X = global %struct.x { float 1.000000e+00, double 2.000000e+00 }, align 16 ; <%struct.x*> [#uses=2]
-
-define i32 @main() nounwind {
-entry:
- %tmp2 = load float* getelementptr (%struct.x* @X, i32 0, i32 0), align 16 ; <float> [#uses=1]
- %tmp4 = load double* getelementptr (%struct.x* @X, i32 0, i32 1), align 8 ; <double> [#uses=1]
- tail call void @t( float %tmp2, double %tmp4 ) nounwind
- ret i32 0
-}
-
-declare void @t(float, double)
diff --git a/release_23/test/CodeGen/X86/x86-64-mem.ll b/release_23/test/CodeGen/X86/x86-64-mem.ll
deleted file mode 100644
index 7497362a1546..000000000000
--- a/release_23/test/CodeGen/X86/x86-64-mem.ll
+++ /dev/null
@@ -1,37 +0,0 @@
-; RUN: llvm-as < %s | llc -mtriple=x86_64-apple-darwin -o %t1 -f
-; RUN: grep GOTPCREL %t1 | count 4
-; RUN: grep %%rip %t1 | count 6
-; RUN: grep movq %t1 | count 6
-; RUN: grep leaq %t1 | count 1
-; RUN: llvm-as < %s | \
-; RUN: llc -mtriple=x86_64-pc-linux -relocation-model=static -o %t2 -f
-; RUN: grep movl %t2 | count 2
-; RUN: grep movq %t2 | count 2
-
-@ptr = external global i32* ; <i32**> [#uses=1]
-@src = external global [0 x i32] ; <[0 x i32]*> [#uses=1]
-@dst = external global [0 x i32] ; <[0 x i32]*> [#uses=1]
-@lptr = internal global i32* null ; <i32**> [#uses=1]
-@ldst = internal global [500 x i32] zeroinitializer, align 32 ; <[500 x i32]*> [#uses=1]
-@lsrc = internal global [500 x i32] zeroinitializer, align 32 ; <[500 x i32]*> [#uses=0]
-@bsrc = internal global [500000 x i32] zeroinitializer, align 32 ; <[500000 x i32]*> [#uses=0]
-@bdst = internal global [500000 x i32] zeroinitializer, align 32 ; <[500000 x i32]*> [#uses=0]
-
-define void @test1() nounwind {
- %tmp = load i32* getelementptr ([0 x i32]* @src, i32 0, i32 0) ; <i32> [#uses=1]
- store i32 %tmp, i32* getelementptr ([0 x i32]* @dst, i32 0, i32 0)
- ret void
-}
-
-define void @test2() nounwind {
- store i32* getelementptr ([0 x i32]* @dst, i32 0, i32 0), i32** @ptr
- ret void
-}
-
-define void @test3() nounwind {
- store i32* getelementptr ([500 x i32]* @ldst, i32 0, i32 0), i32** @lptr
- br label %return
-
-return: ; preds = %0
- ret void
-}
diff --git a/release_23/test/CodeGen/X86/x86-64-ret0.ll b/release_23/test/CodeGen/X86/x86-64-ret0.ll
deleted file mode 100644
index d4252e7d6e44..000000000000
--- a/release_23/test/CodeGen/X86/x86-64-ret0.ll
+++ /dev/null
@@ -1,8 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86-64 | grep mov | count 1
-
-define i32 @f() nounwind {
- tail call void @t( i32 1 ) nounwind
- ret i32 0
-}
-
-declare void @t(i32)
diff --git a/release_23/test/CodeGen/X86/x86-64-shortint.ll b/release_23/test/CodeGen/X86/x86-64-shortint.ll
deleted file mode 100644
index 369527fd29cf..000000000000
--- a/release_23/test/CodeGen/X86/x86-64-shortint.ll
+++ /dev/null
@@ -1,12 +0,0 @@
-; RUN: llvm-as < %s | llc | grep movswl
-
-target datalayout = "e-p:64:64"
-target triple = "x86_64-apple-darwin8"
-
-
-define void @bar(i16 zeroext %A) {
- tail call void @foo( i16 %A signext )
- ret void
-}
-declare void @foo(i16 signext )
-
diff --git a/release_23/test/CodeGen/X86/x86-64-sret-return.ll b/release_23/test/CodeGen/X86/x86-64-sret-return.ll
deleted file mode 100644
index 9298661998b0..000000000000
--- a/release_23/test/CodeGen/X86/x86-64-sret-return.ll
+++ /dev/null
@@ -1,54 +0,0 @@
-; RUN: llvm-as < %s | llc | grep {movq %rdi, %rax}
-
-target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128"
-target triple = "x86_64-apple-darwin8"
- %struct.foo = type { [4 x i64] }
-
-define void @bar(%struct.foo* noalias sret %agg.result, %struct.foo* %d) nounwind {
-entry:
- %d_addr = alloca %struct.foo* ; <%struct.foo**> [#uses=2]
- %memtmp = alloca %struct.foo, align 8 ; <%struct.foo*> [#uses=1]
- %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
- store %struct.foo* %d, %struct.foo** %d_addr
- %tmp = load %struct.foo** %d_addr, align 8 ; <%struct.foo*> [#uses=1]
- %tmp1 = getelementptr %struct.foo* %agg.result, i32 0, i32 0 ; <[4 x i64]*> [#uses=4]
- %tmp2 = getelementptr %struct.foo* %tmp, i32 0, i32 0 ; <[4 x i64]*> [#uses=4]
- %tmp3 = getelementptr [4 x i64]* %tmp1, i32 0, i32 0 ; <i64*> [#uses=1]
- %tmp4 = getelementptr [4 x i64]* %tmp2, i32 0, i32 0 ; <i64*> [#uses=1]
- %tmp5 = load i64* %tmp4, align 8 ; <i64> [#uses=1]
- store i64 %tmp5, i64* %tmp3, align 8
- %tmp6 = getelementptr [4 x i64]* %tmp1, i32 0, i32 1 ; <i64*> [#uses=1]
- %tmp7 = getelementptr [4 x i64]* %tmp2, i32 0, i32 1 ; <i64*> [#uses=1]
- %tmp8 = load i64* %tmp7, align 8 ; <i64> [#uses=1]
- store i64 %tmp8, i64* %tmp6, align 8
- %tmp9 = getelementptr [4 x i64]* %tmp1, i32 0, i32 2 ; <i64*> [#uses=1]
- %tmp10 = getelementptr [4 x i64]* %tmp2, i32 0, i32 2 ; <i64*> [#uses=1]
- %tmp11 = load i64* %tmp10, align 8 ; <i64> [#uses=1]
- store i64 %tmp11, i64* %tmp9, align 8
- %tmp12 = getelementptr [4 x i64]* %tmp1, i32 0, i32 3 ; <i64*> [#uses=1]
- %tmp13 = getelementptr [4 x i64]* %tmp2, i32 0, i32 3 ; <i64*> [#uses=1]
- %tmp14 = load i64* %tmp13, align 8 ; <i64> [#uses=1]
- store i64 %tmp14, i64* %tmp12, align 8
- %tmp15 = getelementptr %struct.foo* %memtmp, i32 0, i32 0 ; <[4 x i64]*> [#uses=4]
- %tmp16 = getelementptr %struct.foo* %agg.result, i32 0, i32 0 ; <[4 x i64]*> [#uses=4]
- %tmp17 = getelementptr [4 x i64]* %tmp15, i32 0, i32 0 ; <i64*> [#uses=1]
- %tmp18 = getelementptr [4 x i64]* %tmp16, i32 0, i32 0 ; <i64*> [#uses=1]
- %tmp19 = load i64* %tmp18, align 8 ; <i64> [#uses=1]
- store i64 %tmp19, i64* %tmp17, align 8
- %tmp20 = getelementptr [4 x i64]* %tmp15, i32 0, i32 1 ; <i64*> [#uses=1]
- %tmp21 = getelementptr [4 x i64]* %tmp16, i32 0, i32 1 ; <i64*> [#uses=1]
- %tmp22 = load i64* %tmp21, align 8 ; <i64> [#uses=1]
- store i64 %tmp22, i64* %tmp20, align 8
- %tmp23 = getelementptr [4 x i64]* %tmp15, i32 0, i32 2 ; <i64*> [#uses=1]
- %tmp24 = getelementptr [4 x i64]* %tmp16, i32 0, i32 2 ; <i64*> [#uses=1]
- %tmp25 = load i64* %tmp24, align 8 ; <i64> [#uses=1]
- store i64 %tmp25, i64* %tmp23, align 8
- %tmp26 = getelementptr [4 x i64]* %tmp15, i32 0, i32 3 ; <i64*> [#uses=1]
- %tmp27 = getelementptr [4 x i64]* %tmp16, i32 0, i32 3 ; <i64*> [#uses=1]
- %tmp28 = load i64* %tmp27, align 8 ; <i64> [#uses=1]
- store i64 %tmp28, i64* %tmp26, align 8
- br label %return
-
-return: ; preds = %entry
- ret void
-}
diff --git a/release_23/test/CodeGen/X86/x86-64-varargs.ll b/release_23/test/CodeGen/X86/x86-64-varargs.ll
deleted file mode 100644
index 2964dd3969f0..000000000000
--- a/release_23/test/CodeGen/X86/x86-64-varargs.ll
+++ /dev/null
@@ -1,11 +0,0 @@
-; RUN: llvm-as < %s | llc -mtriple=x86_64-apple-darwin -code-model=large -relocation-model=static | grep call | not grep rax
-
-@.str = internal constant [26 x i8] c"%d, %f, %d, %lld, %d, %f\0A\00" ; <[26 x i8]*> [#uses=1]
-
-declare i32 @printf(i8*, ...) nounwind
-
-define i32 @main() nounwind {
-entry:
- %tmp10.i = tail call i32 (i8*, ...)* @printf( i8* getelementptr ([26 x i8]* @.str, i32 0, i64 0), i32 12, double 0x3FF3EB8520000000, i32 120, i64 123456677890, i32 -10, double 4.500000e+15 ) nounwind ; <i32> [#uses=0]
- ret i32 0
-}
diff --git a/release_23/test/CodeGen/X86/xmm-r64.ll b/release_23/test/CodeGen/X86/xmm-r64.ll
deleted file mode 100644
index f7d2143664ef..000000000000
--- a/release_23/test/CodeGen/X86/xmm-r64.ll
+++ /dev/null
@@ -1,12 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86-64
-
-define <4 x i32> @test() {
- %tmp1039 = call <4 x i32> @llvm.x86.sse2.psll.d( <4 x i32> zeroinitializer, <4 x i32> zeroinitializer ) ; <<4 x i32>> [#uses=1]
- %tmp1040 = bitcast <4 x i32> %tmp1039 to <2 x i64> ; <<2 x i64>> [#uses=1]
- %tmp1048 = add <2 x i64> %tmp1040, zeroinitializer ; <<2 x i64>> [#uses=1]
- %tmp1048.upgrd.1 = bitcast <2 x i64> %tmp1048 to <4 x i32> ; <<4 x i32>> [#uses=1]
- ret <4 x i32> %tmp1048.upgrd.1
-}
-
-declare <4 x i32> @llvm.x86.sse2.psll.d(<4 x i32>, <4 x i32>)
-
diff --git a/release_23/test/CodeGen/X86/xor-undef.ll b/release_23/test/CodeGen/X86/xor-undef.ll
deleted file mode 100644
index 0e60d4ef087e..000000000000
--- a/release_23/test/CodeGen/X86/xor-undef.ll
+++ /dev/null
@@ -1,11 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep xor | count 2
-
-define <4 x i32> @t1() {
- %tmp = xor <4 x i32> undef, undef
- ret <4 x i32> %tmp
-}
-
-define i32 @t2() {
- %tmp = xor i32 undef, undef
- ret i32 %tmp
-}
diff --git a/release_23/test/CodeGen/X86/xor_not.ll b/release_23/test/CodeGen/X86/xor_not.ll
deleted file mode 100644
index 1e89ca8e0530..000000000000
--- a/release_23/test/CodeGen/X86/xor_not.ll
+++ /dev/null
@@ -1,74 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 | grep {not\[lwb\]} | count 3
-; RUN: llvm-as < %s | llc -march=x86-64 | grep {not\[lwb\]} | count 4
-define i32 @test(i32 %a, i32 %b) nounwind {
-entry:
- %tmp1not = xor i32 %b, -2
- %tmp3 = and i32 %tmp1not, %a
- %tmp4 = lshr i32 %tmp3, 1
- ret i32 %tmp4
-}
-
-define i32 @sum32(i32 %a, i32 %b) nounwind {
-entry:
- br label %bb
-bb:
- %b_addr.0 = phi i32 [ %b, %entry ], [ %tmp8, %bb ]
- %a_addr.0 = phi i32 [ %a, %entry ], [ %tmp3, %bb ]
- %tmp3 = xor i32 %a_addr.0, %b_addr.0
- %tmp4not = xor i32 %tmp3, 2147483647
- %tmp6 = and i32 %tmp4not, %b_addr.0
- %tmp8 = shl i32 %tmp6, 1
- %tmp10 = icmp eq i32 %tmp8, 0
- br i1 %tmp10, label %bb12, label %bb
-bb12:
- ret i32 %tmp3
-}
-
-define i16 @sum16(i16 %a, i16 %b) nounwind {
-entry:
- br label %bb
-bb:
- %b_addr.0 = phi i16 [ %b, %entry ], [ %tmp8, %bb ]
- %a_addr.0 = phi i16 [ %a, %entry ], [ %tmp3, %bb ]
- %tmp3 = xor i16 %a_addr.0, %b_addr.0
- %tmp4not = xor i16 %tmp3, 32767
- %tmp6 = and i16 %tmp4not, %b_addr.0
- %tmp8 = shl i16 %tmp6, 1
- %tmp10 = icmp eq i16 %tmp8, 0
- br i1 %tmp10, label %bb12, label %bb
-bb12:
- ret i16 %tmp3
-}
-
-define i8 @sum8(i8 %a, i8 %b) nounwind {
-entry:
- br label %bb
-bb:
- %b_addr.0 = phi i8 [ %b, %entry ], [ %tmp8, %bb ]
- %a_addr.0 = phi i8 [ %a, %entry ], [ %tmp3, %bb ]
- %tmp3 = xor i8 %a_addr.0, %b_addr.0
- %tmp4not = xor i8 %tmp3, 127
- %tmp6 = and i8 %tmp4not, %b_addr.0
- %tmp8 = shl i8 %tmp6, 1
- %tmp10 = icmp eq i8 %tmp8, 0
- br i1 %tmp10, label %bb12, label %bb
-bb12:
- ret i8 %tmp3
-}
-
-define i32 @test2(i32 %a, i32 %b) nounwind {
-entry:
- br label %bb
-bb:
- %b_addr.0 = phi i32 [ %b, %entry ], [ %tmp8, %bb ]
- %a_addr.0 = phi i32 [ %a, %entry ], [ %tmp3, %bb ]
- %tmp3 = xor i32 %a_addr.0, %b_addr.0
- %tmp4not = xor i32 %tmp3, 2147483646
- %tmp6 = and i32 %tmp4not, %b_addr.0
- %tmp8 = shl i32 %tmp6, 1
- %tmp10 = icmp eq i32 %tmp8, 0
- br i1 %tmp10, label %bb12, label %bb
-bb12:
- ret i32 %tmp3
-}
-
diff --git a/release_23/test/CodeGen/X86/xorl.ll b/release_23/test/CodeGen/X86/xorl.ll
deleted file mode 100644
index def2f06d3997..000000000000
--- a/release_23/test/CodeGen/X86/xorl.ll
+++ /dev/null
@@ -1,85 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 | grep xorl | count 1
-
-target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
-target triple = "i386-apple-darwin9"
- %struct.block_symbol = type { [3 x %struct.cgraph_rtl_info], %struct.object_block*, i64 }
- %struct.rtx_def = type <{ i16, i8, i8, %struct.u }>
- %struct.u = type { %struct.block_symbol }
- %struct.cgraph_rtl_info = type { i32 }
- %struct.object_block = type { %struct.section*, i32, i64, %struct.VEC_rtx_gc*, %struct.VEC_rtx_gc* }
- %struct.section = type { %struct.unnamed_section }
- %struct.VEC_rtx_base = type { i32, i32, [1 x %struct.rtx_def*] }
- %struct.VEC_rtx_gc = type { %struct.VEC_rtx_base }
- %struct.tree_common = type <{ %struct.tree_node*, %struct.tree_node*, %union.tree_ann_d*, i8, i8, i8, i8, i8, [3 x i8] }>
- %struct.tree_complex = type { %struct.tree_common, %struct.tree_node*, %struct.tree_node* }
- %struct.tree_node = type { %struct.tree_complex, [116 x i8] }
- %struct.unnamed_section = type { %struct.cgraph_rtl_info, void (i8*)*, i8*, %struct.section* }
- %union.tree_ann_d = type opaque
-
-define %struct.rtx_def* @expand_call() nounwind {
-entry:
- br i1 false, label %bb216, label %bb171
-bb171: ; preds = %entry
- ret %struct.rtx_def* null
-bb216: ; preds = %entry
- br i1 false, label %bb336, label %bb222
-bb222: ; preds = %bb216
- ret %struct.rtx_def* null
-bb336: ; preds = %bb216
- br i1 false, label %bb429, label %bb417
-bb417: ; preds = %bb336
- ret %struct.rtx_def* null
-bb429: ; preds = %bb336
- br i1 false, label %bb713, label %bb493
-bb493: ; preds = %bb429
- ret %struct.rtx_def* null
-bb713: ; preds = %bb429
- br i1 false, label %bb810, label %bb797
-bb797: ; preds = %bb713
- ret %struct.rtx_def* null
-bb810: ; preds = %bb713
- br i1 false, label %bb822, label %bb815
-bb815: ; preds = %bb810
- ret %struct.rtx_def* null
-bb822: ; preds = %bb810
- br label %bb1652.preheader
-bb919: ; preds = %bb1652.preheader
- ret %struct.rtx_def* null
-bb1657: ; preds = %bb1652.preheader
- br i1 false, label %bb1666, label %bb1652.preheader
-bb1652.preheader: ; preds = %bb1657, %bb822
- br i1 false, label %bb1657, label %bb919
-bb1666: ; preds = %bb1657
- br i1 false, label %bb1815.preheader, label %bb1870
-bb1815.preheader: ; preds = %bb1666
- br i1 false, label %bb1693, label %bb1828
-bb1693: ; preds = %bb1815.preheader
- br i1 false, label %bb1718, label %bb1703
-bb1703: ; preds = %bb1693
- ret %struct.rtx_def* null
-bb1718: ; preds = %bb1693
- br i1 false, label %bb1741, label %bb1828
-bb1741: ; preds = %bb1718
- switch i8 0, label %bb1775 [
- i8 54, label %bb1798
- i8 58, label %bb1798
- i8 55, label %bb1798
- ]
-bb1775: ; preds = %bb1741
- ret %struct.rtx_def* null
-bb1798: ; preds = %bb1741, %bb1741, %bb1741
- %tmp1811 = add i32 0, 0 ; <i32> [#uses=1]
- br label %bb1828
-bb1828: ; preds = %bb1798, %bb1718, %bb1815.preheader
- %copy_to_evaluate_size.1.lcssa = phi i32 [ 0, %bb1815.preheader ], [ %tmp1811, %bb1798 ], [ 0, %bb1718 ] ; <i32> [#uses=1]
- %tmp1830 = shl i32 %copy_to_evaluate_size.1.lcssa, 1 ; <i32> [#uses=1]
- %tmp18301831 = sext i32 %tmp1830 to i64 ; <i64> [#uses=1]
- %tmp1835 = icmp slt i64 %tmp18301831, 0 ; <i1> [#uses=1]
- %tmp1835.not = xor i1 %tmp1835, true ; <i1> [#uses=1]
- %bothcond6193 = and i1 %tmp1835.not, false ; <i1> [#uses=1]
- br i1 %bothcond6193, label %bb1845, label %bb1870
-bb1845: ; preds = %bb1828
- ret %struct.rtx_def* null
-bb1870: ; preds = %bb1828, %bb1666
- ret %struct.rtx_def* null
-}
diff --git a/release_23/test/CodeGen/X86/zero-remat.ll b/release_23/test/CodeGen/X86/zero-remat.ll
deleted file mode 100644
index 7640ba5aca41..000000000000
--- a/release_23/test/CodeGen/X86/zero-remat.ll
+++ /dev/null
@@ -1,16 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86-64 | grep xor | count 4
-; RUN: llvm-as < %s | llc -march=x86-64 -stats -info-output-file - | grep asm-printer | grep 12
-; RUN: llvm-as < %s | llc -march=x86 | grep fldz
-; RUN: llvm-as < %s | llc -march=x86 | not grep fldl
-
-declare void @bar(double %x)
-declare void @barf(float %x)
-
-define double @foo() nounwind {
- call void @bar(double 0.0)
- ret double 0.0
-}
-define float @foof() nounwind {
- call void @barf(float 0.0)
- ret float 0.0
-}
diff --git a/release_23/test/DebugInfo/dg.exp b/release_23/test/DebugInfo/dg.exp
deleted file mode 100644
index 879685ca879d..000000000000
--- a/release_23/test/DebugInfo/dg.exp
+++ /dev/null
@@ -1,3 +0,0 @@
-load_lib llvm.exp
-
-RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
diff --git a/release_23/test/DebugInfo/funccall.ll b/release_23/test/DebugInfo/funccall.ll
deleted file mode 100644
index 47fe4c2498c5..000000000000
--- a/release_23/test/DebugInfo/funccall.ll
+++ /dev/null
@@ -1,147 +0,0 @@
-;; RUN: llvm-as < %s | llc
- %llvm.dbg.anchor.type = type { i32, i32 }
- %llvm.dbg.basictype.type = type { i32, { }*, i8*, { }*, i32, i64, i64, i64, i32, i32 }
- %llvm.dbg.compile_unit.type = type { i32, { }*, i32, i8*, i8*, i8* }
- %llvm.dbg.global_variable.type = type { i32, { }*, { }*, i8*, i8*, i8*, { }*, i32, { }*, i1, i1, { }* }
- %llvm.dbg.subprogram.type = type { i32, { }*, { }*, i8*, i8*, i8*, { }*, i32, { }*, i1, i1 }
- %llvm.dbg.variable.type = type { i32, { }*, i8*, { }*, i32, { }* }
-@llvm.dbg.subprograms = linkonce constant %llvm.dbg.anchor.type { i32 393216, i32 46 }, section "llvm.metadata" ; <%llvm.dbg.anchor.type*> [#uses=1]
-@llvm.dbg.compile_units = linkonce constant %llvm.dbg.anchor.type { i32 393216, i32 17 }, section "llvm.metadata" ; <%llvm.dbg.anchor.type*> [#uses=1]
-@llvm.dbg.global_variables = linkonce constant %llvm.dbg.anchor.type { i32 393216, i32 52 }, section "llvm.metadata" ; <%llvm.dbg.anchor.type*> [#uses=1]
-@llvm.dbg.subprogram = internal constant %llvm.dbg.subprogram.type {
- i32 393262,
- { }* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.subprograms to { }*),
- { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*),
- i8* getelementptr ([4 x i8]* @str, i32 0, i32 0),
- i8* getelementptr ([4 x i8]* @str, i32 0, i32 0),
- i8* null,
- { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*),
- i32 4,
- { }* null,
- i1 false,
- i1 true }, section "llvm.metadata" ; <%llvm.dbg.subprogram.type*> [#uses=1]
-@str = internal constant [4 x i8] c"foo\00", section "llvm.metadata" ; <[4 x i8]*> [#uses=1]
-@llvm.dbg.compile_unit = internal constant %llvm.dbg.compile_unit.type {
- i32 393233,
- { }* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.compile_units to { }*),
- i32 1,
- i8* getelementptr ([11 x i8]* @str1, i32 0, i32 0),
- i8* getelementptr ([50 x i8]* @str2, i32 0, i32 0),
- i8* getelementptr ([45 x i8]* @str3, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.compile_unit.type*> [#uses=1]
-@str1 = internal constant [11 x i8] c"funccall.c\00", section "llvm.metadata" ; <[11 x i8]*> [#uses=1]
-@str2 = internal constant [50 x i8] c"/Volumes/Big2/llvm/llvm/test/Regression/Debugger/\00", section "llvm.metadata" ; <[50 x i8]*> [#uses=1]
-@str3 = internal constant [45 x i8] c"4.0.1 LLVM (Apple Computer, Inc. build 5421)\00", section "llvm.metadata" ; <[45 x i8]*> [#uses=1]
-@llvm.dbg.variable = internal constant %llvm.dbg.variable.type {
- i32 393472,
- { }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram to { }*),
- i8* getelementptr ([2 x i8]* @str4, i32 0, i32 0),
- { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*),
- i32 5,
- { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype to { }*) }, section "llvm.metadata" ; <%llvm.dbg.variable.type*> [#uses=1]
-@str4 = internal constant [2 x i8] c"t\00", section "llvm.metadata" ; <[2 x i8]*> [#uses=1]
-@llvm.dbg.basictype = internal constant %llvm.dbg.basictype.type {
- i32 393252,
- { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*),
- i8* getelementptr ([4 x i8]* @str15, i32 0, i32 0),
- { }* null,
- i32 0,
- i64 32,
- i64 32,
- i64 0,
- i32 0,
- i32 5 }, section "llvm.metadata" ; <%llvm.dbg.basictype.type*> [#uses=1]
-@str15 = internal constant [4 x i8] c"int\00", section "llvm.metadata" ; <[4 x i8]*> [#uses=1]
-@llvm.dbg.subprogram2 = internal constant %llvm.dbg.subprogram.type {
- i32 393262,
- { }* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.subprograms to { }*),
- { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*),
- i8* getelementptr ([5 x i8]* @str6, i32 0, i32 0),
- i8* getelementptr ([5 x i8]* @str6, i32 0, i32 0),
- i8* null,
- { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*),
- i32 8,
- { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype to { }*),
- i1 false,
- i1 true }, section "llvm.metadata" ; <%llvm.dbg.subprogram.type*> [#uses=1]
-@str6 = internal constant [5 x i8] c"main\00", section "llvm.metadata" ; <[5 x i8]*> [#uses=1]
-@llvm.dbg.variable3 = internal constant %llvm.dbg.variable.type {
- i32 393474,
- { }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram2 to { }*),
- i8* getelementptr ([7 x i8]* @str7, i32 0, i32 0),
- { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*),
- i32 8,
- { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype to { }*) }, section "llvm.metadata" ; <%llvm.dbg.variable.type*> [#uses=1]
-@str7 = internal constant [7 x i8] c"retval\00", section "llvm.metadata" ; <[7 x i8]*> [#uses=1]
-@llvm.dbg.global_variable = internal constant %llvm.dbg.global_variable.type {
- i32 393268,
- { }* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.global_variables to { }*),
- { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*),
- i8* getelementptr ([2 x i8]* @str4, i32 0, i32 0),
- i8* getelementptr ([2 x i8]* @str4, i32 0, i32 0),
- i8* null,
- { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*),
- i32 2,
- { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype to { }*),
- i1 true,
- i1 true,
- { }* bitcast (i32* @q to { }*) }, section "llvm.metadata" ; <%llvm.dbg.global_variable.type*> [#uses=0]
-@str4.upgrd.1 = internal constant [2 x i8] c"q\00", section "llvm.metadata" ; <[2 x i8]*> [#uses=0]
-@q = internal global i32 0 ; <i32*> [#uses=7]
-
-declare void @llvm.dbg.func.start({ }*)
-
-declare void @llvm.dbg.stoppoint(i32, i32, { }*)
-
-declare void @llvm.dbg.declare({ }*, { }*)
-
-declare void @llvm.dbg.region.start({ }*)
-
-declare void @llvm.dbg.region.end({ }*)
-
-define void @foo() {
-entry:
- %t = alloca i32, align 4 ; <i32*> [#uses=3]
- %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
- call void @llvm.dbg.func.start( { }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram to { }*) )
- call void @llvm.dbg.stoppoint( i32 4, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*) )
- %t.upgrd.2 = bitcast i32* %t to { }* ; <{ }*> [#uses=1]
- call void @llvm.dbg.declare( { }* %t.upgrd.2, { }* bitcast (%llvm.dbg.variable.type* @llvm.dbg.variable to { }*) )
- call void @llvm.dbg.stoppoint( i32 5, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*) )
- %tmp = load i32* @q ; <i32> [#uses=1]
- store i32 %tmp, i32* %t
- call void @llvm.dbg.stoppoint( i32 6, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*) )
- %tmp1 = load i32* %t ; <i32> [#uses=1]
- %tmp2 = add i32 %tmp1, 1 ; <i32> [#uses=1]
- store i32 %tmp2, i32* @q
- call void @llvm.dbg.stoppoint( i32 7, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*) )
- call void @llvm.dbg.region.end( { }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram to { }*) )
- ret void
-}
-
-define i32 @main() {
-entry:
- %retval = alloca i32, align 4 ; <i32*> [#uses=3]
- %tmp = alloca i32, align 4 ; <i32*> [#uses=2]
- %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
- call void @llvm.dbg.func.start( { }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram2 to { }*) )
- call void @llvm.dbg.stoppoint( i32 8, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*) )
- %retval.upgrd.3 = bitcast i32* %retval to { }* ; <{ }*> [#uses=1]
- call void @llvm.dbg.declare( { }* %retval.upgrd.3, { }* bitcast (%llvm.dbg.variable.type* @llvm.dbg.variable3 to { }*) )
- call void @llvm.dbg.stoppoint( i32 9, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*) )
- store i32 0, i32* @q
- call void @llvm.dbg.stoppoint( i32 10, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*) )
- call void (...)* bitcast (void ()* @foo to void (...)*)( )
- call void @llvm.dbg.stoppoint( i32 11, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*) )
- %tmp.upgrd.4 = load i32* @q ; <i32> [#uses=1]
- %tmp1 = sub i32 %tmp.upgrd.4, 1 ; <i32> [#uses=1]
- store i32 %tmp1, i32* @q
- call void @llvm.dbg.stoppoint( i32 13, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*) )
- %tmp2 = load i32* @q ; <i32> [#uses=1]
- store i32 %tmp2, i32* %tmp
- %tmp3 = load i32* %tmp ; <i32> [#uses=1]
- store i32 %tmp3, i32* %retval
- %retval.upgrd.5 = load i32* %retval ; <i32> [#uses=1]
- call void @llvm.dbg.stoppoint( i32 14, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*) )
- call void @llvm.dbg.region.end( { }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram2 to { }*) )
- ret i32 %retval.upgrd.5
-}
diff --git a/release_23/test/DebugInfo/globalGetElementPtr.ll b/release_23/test/DebugInfo/globalGetElementPtr.ll
deleted file mode 100644
index 6e3674397857..000000000000
--- a/release_23/test/DebugInfo/globalGetElementPtr.ll
+++ /dev/null
@@ -1,264 +0,0 @@
-; RUN: llvm-as < %s | llc
-; ModuleID = 'foo.c'
-target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
-target triple = "i686-apple-darwin8"
- %llvm.dbg.anchor.type = type { i32, i32 }
- %llvm.dbg.basictype.type = type { i32, %struct.anon*, i8*, %struct.anon*, i32, i64, i64, i64, i32, i32 }
- %llvm.dbg.compile_unit.type = type { i32, %struct.anon*, i32, i8*, i8*, i8* }
- %llvm.dbg.compositetype.type = type { i32, %struct.anon*, i8*, %struct.anon*, i32, i64, i64, i64, i32, %struct.anon*, %struct.anon* }
- %llvm.dbg.derivedtype.type = type { i32, %struct.anon*, i8*, %struct.anon*, i32, i64, i64, i64, i32, %struct.anon* }
- %llvm.dbg.global_variable.type = type { i32, %struct.anon*, %struct.anon*, i8*, i8*, i8*, %struct.anon*, i32, %struct.anon*, i1, i1, %struct.anon* }
- %llvm.dbg.subprogram.type = type { i32, %struct.anon*, %struct.anon*, i8*, i8*, i8*, %struct.anon*, i32, %struct.anon*, i1, i1 }
- %llvm.dbg.subrange.type = type { i32, i64, i64 }
- %llvm.dbg.variable.type = type { i32, %struct.anon*, i8*, %struct.anon*, i32, %struct.anon* }
- %struct.S271 = type { [0 x %struct.anon], %struct.anon }
- %struct.anon = type { }
-@llvm.dbg.subprogram = internal constant %llvm.dbg.subprogram.type {
- i32 393262,
- %struct.anon* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.subprograms to %struct.anon*),
- %struct.anon* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %struct.anon*),
- i8* getelementptr ([4 x i8]* @.str3, i32 0, i32 0),
- i8* getelementptr ([4 x i8]* @.str3, i32 0, i32 0),
- i8* null,
- %struct.anon* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %struct.anon*),
- i32 2,
- %struct.anon* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype to %struct.anon*),
- i1 false,
- i1 true }, section "llvm.metadata" ; <%llvm.dbg.subprogram.type*> [#uses=1]
-@llvm.dbg.subprograms = linkonce constant %llvm.dbg.anchor.type { i32 393216, i32 46 }, section "llvm.metadata" ; <%llvm.dbg.anchor.type*> [#uses=1]
-@llvm.dbg.compile_unit = internal constant %llvm.dbg.compile_unit.type {
- i32 393233,
- %struct.anon* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.compile_units to %struct.anon*),
- i32 1,
- i8* getelementptr ([6 x i8]* @.str, i32 0, i32 0),
- i8* getelementptr ([23 x i8]* @.str1, i32 0, i32 0),
- i8* getelementptr ([52 x i8]* @.str2, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.compile_unit.type*> [#uses=1]
-@llvm.dbg.compile_units = linkonce constant %llvm.dbg.anchor.type { i32 393216, i32 17 }, section "llvm.metadata" ; <%llvm.dbg.anchor.type*> [#uses=1]
-@.str = internal constant [6 x i8] c"foo.c\00", section "llvm.metadata" ; <[6 x i8]*> [#uses=1]
-@.str1 = internal constant [23 x i8] c"/Volumes/MacOS9/tests/\00", section "llvm.metadata" ; <[23 x i8]*> [#uses=1]
-@.str2 = internal constant [52 x i8] c"4.2.1 (Based on Apple Inc. build 5546) (LLVM build)\00", section "llvm.metadata" ; <[52 x i8]*> [#uses=1]
-@.str3 = internal constant [4 x i8] c"var\00", section "llvm.metadata" ; <[4 x i8]*> [#uses=1]
-@llvm.dbg.derivedtype = internal constant %llvm.dbg.derivedtype.type {
- i32 393231,
- %struct.anon* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %struct.anon*),
- i8* null,
- %struct.anon* null,
- i32 0,
- i64 32,
- i64 32,
- i64 0,
- i32 0,
- %struct.anon* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype to %struct.anon*) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1]
-@llvm.dbg.basictype = internal constant %llvm.dbg.basictype.type {
- i32 393252,
- %struct.anon* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %struct.anon*),
- i8* getelementptr ([5 x i8]* @.str4, i32 0, i32 0),
- %struct.anon* null,
- i32 0,
- i64 8,
- i64 8,
- i64 0,
- i32 0,
- i32 6 }, section "llvm.metadata" ; <%llvm.dbg.basictype.type*> [#uses=1]
-@.str4 = internal constant [5 x i8] c"char\00", section "llvm.metadata" ; <[5 x i8]*> [#uses=1]
-@llvm.dbg.variable = internal constant %llvm.dbg.variable.type {
- i32 393474,
- %struct.anon* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram to %struct.anon*),
- i8* getelementptr ([7 x i8]* @.str5, i32 0, i32 0),
- %struct.anon* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %struct.anon*),
- i32 2,
- %struct.anon* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype to %struct.anon*) }, section "llvm.metadata" ; <%llvm.dbg.variable.type*> [#uses=1]
-@.str5 = internal constant [7 x i8] c"retval\00", section "llvm.metadata" ; <[7 x i8]*> [#uses=1]
-@a271 = weak global [0 x %struct.S271] zeroinitializer ; <[0 x %struct.S271]*> [#uses=3]
-@llvm.dbg.subprogram6 = internal constant %llvm.dbg.subprogram.type {
- i32 393262,
- %struct.anon* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.subprograms to %struct.anon*),
- %struct.anon* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %struct.anon*),
- i8* getelementptr ([5 x i8]* @.str7, i32 0, i32 0),
- i8* getelementptr ([5 x i8]* @.str7, i32 0, i32 0),
- i8* null,
- %struct.anon* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %struct.anon*),
- i32 3,
- %struct.anon* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype8 to %struct.anon*),
- i1 false,
- i1 true }, section "llvm.metadata" ; <%llvm.dbg.subprogram.type*> [#uses=1]
-@.str7 = internal constant [5 x i8] c"main\00", section "llvm.metadata" ; <[5 x i8]*> [#uses=1]
-@llvm.dbg.basictype8 = internal constant %llvm.dbg.basictype.type {
- i32 393252,
- %struct.anon* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %struct.anon*),
- i8* getelementptr ([4 x i8]* @.str9, i32 0, i32 0),
- %struct.anon* null,
- i32 0,
- i64 32,
- i64 32,
- i64 0,
- i32 0,
- i32 5 }, section "llvm.metadata" ; <%llvm.dbg.basictype.type*> [#uses=1]
-@.str9 = internal constant [4 x i8] c"int\00", section "llvm.metadata" ; <[4 x i8]*> [#uses=1]
-@llvm.dbg.variable10 = internal constant %llvm.dbg.variable.type {
- i32 393474,
- %struct.anon* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram6 to %struct.anon*),
- i8* getelementptr ([7 x i8]* @.str5, i32 0, i32 0),
- %struct.anon* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %struct.anon*),
- i32 3,
- %struct.anon* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype8 to %struct.anon*) }, section "llvm.metadata" ; <%llvm.dbg.variable.type*> [#uses=1]
-@llvm.dbg.global_variable = internal constant %llvm.dbg.global_variable.type {
- i32 393268,
- %struct.anon* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.global_variables to %struct.anon*),
- %struct.anon* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %struct.anon*),
- i8* getelementptr ([5 x i8]* @.str11, i32 0, i32 0),
- i8* getelementptr ([5 x i8]* @.str11, i32 0, i32 0),
- i8* null,
- %struct.anon* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %struct.anon*),
- i32 1,
- %struct.anon* bitcast (%llvm.dbg.compositetype.type* @llvm.dbg.compositetype to %struct.anon*),
- i1 false,
- i1 true,
- %struct.anon* getelementptr ([0 x %struct.S271]* @a271, i32 0, i32 0, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.global_variable.type*> [#uses=0]
-@llvm.dbg.global_variables = linkonce constant %llvm.dbg.anchor.type { i32 393216, i32 52 }, section "llvm.metadata" ; <%llvm.dbg.anchor.type*> [#uses=1]
-@.str11 = internal constant [5 x i8] c"a271\00", section "llvm.metadata" ; <[5 x i8]*> [#uses=1]
-@llvm.dbg.compositetype = internal constant %llvm.dbg.compositetype.type {
- i32 393217,
- %struct.anon* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %struct.anon*),
- i8* null,
- %struct.anon* null,
- i32 0,
- i64 0,
- i64 8,
- i64 0,
- i32 0,
- %struct.anon* bitcast (%llvm.dbg.compositetype.type* @llvm.dbg.compositetype12 to %struct.anon*),
- %struct.anon* bitcast ([1 x %struct.anon*]* @llvm.dbg.array25 to %struct.anon*) }, section "llvm.metadata" ; <%llvm.dbg.compositetype.type*> [#uses=1]
-@llvm.dbg.compositetype12 = internal constant %llvm.dbg.compositetype.type {
- i32 393235,
- %struct.anon* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %struct.anon*),
- i8* getelementptr ([5 x i8]* @.str13, i32 0, i32 0),
- %struct.anon* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %struct.anon*),
- i32 1,
- i64 0,
- i64 8,
- i64 0,
- i32 0,
- %struct.anon* null,
- %struct.anon* bitcast ([2 x %struct.anon*]* @llvm.dbg.array23 to %struct.anon*) }, section "llvm.metadata" ; <%llvm.dbg.compositetype.type*> [#uses=1]
-@.str13 = internal constant [5 x i8] c"S271\00", section "llvm.metadata" ; <[5 x i8]*> [#uses=1]
-@llvm.dbg.derivedtype14 = internal constant %llvm.dbg.derivedtype.type {
- i32 393229,
- %struct.anon* null,
- i8* getelementptr ([2 x i8]* @.str15, i32 0, i32 0),
- %struct.anon* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %struct.anon*),
- i32 1,
- i64 0,
- i64 8,
- i64 0,
- i32 0,
- %struct.anon* bitcast (%llvm.dbg.compositetype.type* @llvm.dbg.compositetype16 to %struct.anon*) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1]
-@.str15 = internal constant [2 x i8] c"a\00", section "llvm.metadata" ; <[2 x i8]*> [#uses=1]
-@llvm.dbg.compositetype16 = internal constant %llvm.dbg.compositetype.type {
- i32 393217,
- %struct.anon* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %struct.anon*),
- i8* null,
- %struct.anon* null,
- i32 0,
- i64 0,
- i64 8,
- i64 0,
- i32 0,
- %struct.anon* bitcast (%llvm.dbg.compositetype.type* @llvm.dbg.compositetype17 to %struct.anon*),
- %struct.anon* bitcast ([1 x %struct.anon*]* @llvm.dbg.array18 to %struct.anon*) }, section "llvm.metadata" ; <%llvm.dbg.compositetype.type*> [#uses=1]
-@llvm.dbg.compositetype17 = internal constant %llvm.dbg.compositetype.type {
- i32 393235,
- %struct.anon* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %struct.anon*),
- i8* null,
- %struct.anon* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %struct.anon*),
- i32 1,
- i64 0,
- i64 8,
- i64 0,
- i32 0,
- %struct.anon* null,
- %struct.anon* bitcast ([0 x %struct.anon*]* @llvm.dbg.array to %struct.anon*) }, section "llvm.metadata" ; <%llvm.dbg.compositetype.type*> [#uses=1]
-@llvm.dbg.array = internal constant [0 x %struct.anon*] zeroinitializer, section "llvm.metadata" ; <[0 x %struct.anon*]*> [#uses=1]
-@llvm.dbg.subrange = internal constant %llvm.dbg.subrange.type {
- i32 393249,
- i64 0,
- i64 4 }, section "llvm.metadata" ; <%llvm.dbg.subrange.type*> [#uses=1]
-@llvm.dbg.array18 = internal constant [1 x %struct.anon*] [ %struct.anon* bitcast (%llvm.dbg.subrange.type* @llvm.dbg.subrange to %struct.anon*) ], section "llvm.metadata" ; <[1 x %struct.anon*]*> [#uses=1]
-@llvm.dbg.derivedtype19 = internal constant %llvm.dbg.derivedtype.type {
- i32 393229,
- %struct.anon* null,
- i8* getelementptr ([2 x i8]* @.str20, i32 0, i32 0),
- %struct.anon* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %struct.anon*),
- i32 1,
- i64 0,
- i64 8,
- i64 0,
- i32 0,
- %struct.anon* bitcast (%llvm.dbg.compositetype.type* @llvm.dbg.compositetype21 to %struct.anon*) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1]
-@.str20 = internal constant [2 x i8] c"b\00", section "llvm.metadata" ; <[2 x i8]*> [#uses=1]
-@llvm.dbg.compositetype21 = internal constant %llvm.dbg.compositetype.type {
- i32 393235,
- %struct.anon* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %struct.anon*),
- i8* null,
- %struct.anon* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %struct.anon*),
- i32 1,
- i64 0,
- i64 8,
- i64 0,
- i32 0,
- %struct.anon* null,
- %struct.anon* bitcast ([0 x %struct.anon*]* @llvm.dbg.array22 to %struct.anon*) }, section "llvm.metadata" ; <%llvm.dbg.compositetype.type*> [#uses=1]
-@llvm.dbg.array22 = internal constant [0 x %struct.anon*] zeroinitializer, section "llvm.metadata" ; <[0 x %struct.anon*]*> [#uses=1]
-@llvm.dbg.array23 = internal constant [2 x %struct.anon*] [ %struct.anon* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype14 to %struct.anon*), %struct.anon* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype19 to %struct.anon*) ], section "llvm.metadata" ; <[2 x %struct.anon*]*> [#uses=1]
-@llvm.dbg.subrange24 = internal constant %llvm.dbg.subrange.type {
- i32 393249,
- i64 0,
- i64 4 }, section "llvm.metadata" ; <%llvm.dbg.subrange.type*> [#uses=1]
-@llvm.dbg.array25 = internal constant [1 x %struct.anon*] [ %struct.anon* bitcast (%llvm.dbg.subrange.type* @llvm.dbg.subrange24 to %struct.anon*) ], section "llvm.metadata" ; <[1 x %struct.anon*]*> [#uses=1]
-
-define i8* @var() {
-entry:
- %retval = alloca i8* ; <i8**> [#uses=3]
- %tmp = alloca i8* ; <i8**> [#uses=2]
- %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
- call void @llvm.dbg.func.start( %struct.anon* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram to %struct.anon*) )
- call void @llvm.dbg.stoppoint( i32 2, i32 0, %struct.anon* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %struct.anon*) )
- %retval1 = bitcast i8** %retval to %struct.anon* ; <%struct.anon*> [#uses=1]
- call void @llvm.dbg.declare( %struct.anon* %retval1, %struct.anon* bitcast (%llvm.dbg.variable.type* @llvm.dbg.variable to %struct.anon*) )
- bitcast %struct.S271* getelementptr ([0 x %struct.S271]* @a271, i32 0, i32 0) to i8* ; <i8*>:0 [#uses=0]
- store i8* bitcast ([0 x %struct.S271]* @a271 to i8*), i8** %tmp, align 4
- %tmp2 = load i8** %tmp, align 4 ; <i8*> [#uses=1]
- store i8* %tmp2, i8** %retval, align 4
- br label %return
-
-return: ; preds = %entry
- %retval3 = load i8** %retval ; <i8*> [#uses=1]
- call void @llvm.dbg.stoppoint( i32 2, i32 0, %struct.anon* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %struct.anon*) )
- call void @llvm.dbg.region.end( %struct.anon* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram to %struct.anon*) )
- ret i8* %retval3
-}
-
-declare void @llvm.dbg.func.start(%struct.anon*) nounwind
-
-declare void @llvm.dbg.stoppoint(i32, i32, %struct.anon*) nounwind
-
-declare void @llvm.dbg.declare(%struct.anon*, %struct.anon*) nounwind
-
-declare void @llvm.dbg.region.end(%struct.anon*) nounwind
-
-define i32 @main() {
-entry:
- %retval = alloca i32 ; <i32*> [#uses=2]
- %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
- call void @llvm.dbg.func.start( %struct.anon* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram6 to %struct.anon*) )
- call void @llvm.dbg.stoppoint( i32 3, i32 0, %struct.anon* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %struct.anon*) )
- %retval1 = bitcast i32* %retval to %struct.anon* ; <%struct.anon*> [#uses=1]
- call void @llvm.dbg.declare( %struct.anon* %retval1, %struct.anon* bitcast (%llvm.dbg.variable.type* @llvm.dbg.variable10 to %struct.anon*) )
- br label %return
-
-return: ; preds = %entry
- %retval2 = load i32* %retval ; <i32> [#uses=1]
- call void @llvm.dbg.stoppoint( i32 3, i32 0, %struct.anon* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %struct.anon*) )
- call void @llvm.dbg.region.end( %struct.anon* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram6 to %struct.anon*) )
- ret i32 %retval2
-}
diff --git a/release_23/test/ExecutionEngine/2002-12-16-ArgTest.ll b/release_23/test/ExecutionEngine/2002-12-16-ArgTest.ll
deleted file mode 100644
index 6a8d100e6761..000000000000
--- a/release_23/test/ExecutionEngine/2002-12-16-ArgTest.ll
+++ /dev/null
@@ -1,38 +0,0 @@
-; RUN: llvm-as < %s -f -o %t.bc
-; RUN: lli %t.bc > /dev/null
-
-@.LC0 = internal global [10 x i8] c"argc: %d\0A\00" ; <[10 x i8]*> [#uses=1]
-
-declare i32 @puts(i8*)
-
-define void @getoptions(i32* %argc) {
-bb0:
- ret void
-}
-
-declare i32 @printf(i8*, ...)
-
-define i32 @main(i32 %argc, i8** %argv) {
-bb0:
- call i32 (i8*, ...)* @printf( i8* getelementptr ([10 x i8]* @.LC0, i64 0, i64 0), i32 %argc ) ; <i32>:0 [#uses=0]
- %cast224 = bitcast i8** %argv to i8* ; <i8*> [#uses=1]
- %local = alloca i8* ; <i8**> [#uses=3]
- store i8* %cast224, i8** %local
- %cond226 = icmp sle i32 %argc, 0 ; <i1> [#uses=1]
- br i1 %cond226, label %bb3, label %bb2
-bb2: ; preds = %bb2, %bb0
- %cann-indvar = phi i32 [ 0, %bb0 ], [ %add1-indvar, %bb2 ] ; <i32> [#uses=2]
- %add1-indvar = add i32 %cann-indvar, 1 ; <i32> [#uses=2]
- %cann-indvar-idxcast = sext i32 %cann-indvar to i64 ; <i64> [#uses=1]
- %CT = bitcast i8** %local to i8*** ; <i8***> [#uses=1]
- %reg115 = load i8*** %CT ; <i8**> [#uses=1]
- %cast235 = getelementptr i8** %reg115, i64 %cann-indvar-idxcast ; <i8**> [#uses=1]
- %reg117 = load i8** %cast235 ; <i8*> [#uses=1]
- %reg236 = call i32 @puts( i8* %reg117 ) ; <i32> [#uses=0]
- %cond239 = icmp slt i32 %add1-indvar, %argc ; <i1> [#uses=1]
- br i1 %cond239, label %bb2, label %bb3
-bb3: ; preds = %bb2, %bb0
- %cast243 = bitcast i8** %local to i32* ; <i32*> [#uses=1]
- call void @getoptions( i32* %cast243 )
- ret i32 0
-}
diff --git a/release_23/test/ExecutionEngine/2003-01-04-ArgumentBug.ll b/release_23/test/ExecutionEngine/2003-01-04-ArgumentBug.ll
deleted file mode 100644
index 6a8f07bad5be..000000000000
--- a/release_23/test/ExecutionEngine/2003-01-04-ArgumentBug.ll
+++ /dev/null
@@ -1,14 +0,0 @@
-; RUN: llvm-as < %s -f -o %t.bc
-; RUN: lli %t.bc > /dev/null
-
-define i32 @foo(i32 %X, i32 %Y, double %A) {
- %cond212 = fcmp une double %A, 1.000000e+00 ; <i1> [#uses=1]
- %cast110 = zext i1 %cond212 to i32 ; <i32> [#uses=1]
- ret i32 %cast110
-}
-
-define i32 @main() {
- %reg212 = call i32 @foo( i32 0, i32 1, double 1.000000e+00 ) ; <i32> [#uses=1]
- ret i32 %reg212
-}
-
diff --git a/release_23/test/ExecutionEngine/2003-01-04-LoopTest.ll b/release_23/test/ExecutionEngine/2003-01-04-LoopTest.ll
deleted file mode 100644
index fce0b00a0442..000000000000
--- a/release_23/test/ExecutionEngine/2003-01-04-LoopTest.ll
+++ /dev/null
@@ -1,21 +0,0 @@
-; RUN: llvm-as < %s -o %t.bc -f
-; RUN: lli %t.bc > /dev/null
-
-define i32 @main() {
- call i32 @mylog( i32 4 ) ; <i32>:1 [#uses=0]
- ret i32 0
-}
-
-define internal i32 @mylog(i32 %num) {
-bb0:
- br label %bb2
-bb2: ; preds = %bb2, %bb0
- %reg112 = phi i32 [ 10, %bb2 ], [ 1, %bb0 ] ; <i32> [#uses=1]
- %cann-indvar = phi i32 [ %cann-indvar, %bb2 ], [ 0, %bb0 ] ; <i32> [#uses=1]
- %reg114 = add i32 %reg112, 1 ; <i32> [#uses=2]
- %cond222 = icmp slt i32 %reg114, %num ; <i1> [#uses=1]
- br i1 %cond222, label %bb2, label %bb3
-bb3: ; preds = %bb2
- ret i32 %reg114
-}
-
diff --git a/release_23/test/ExecutionEngine/2003-01-04-PhiTest.ll b/release_23/test/ExecutionEngine/2003-01-04-PhiTest.ll
deleted file mode 100644
index cadb19e7775a..000000000000
--- a/release_23/test/ExecutionEngine/2003-01-04-PhiTest.ll
+++ /dev/null
@@ -1,13 +0,0 @@
-; RUN: llvm-as < %s -f -o %t.bc
-; RUN: lli %t.bc > /dev/null
-
-define i32 @main() {
-; <label>:0
- br label %Loop
-Loop: ; preds = %Loop, %0
- %X = phi i32 [ 0, %0 ], [ 1, %Loop ] ; <i32> [#uses=1]
- br i1 true, label %Out, label %Loop
-Out: ; preds = %Loop
- ret i32 %X
-}
-
diff --git a/release_23/test/ExecutionEngine/2003-01-09-SARTest.ll b/release_23/test/ExecutionEngine/2003-01-09-SARTest.ll
deleted file mode 100644
index eeb432679244..000000000000
--- a/release_23/test/ExecutionEngine/2003-01-09-SARTest.ll
+++ /dev/null
@@ -1,12 +0,0 @@
-; RUN: llvm-as < %s -f -o %t.bc
-; RUN: lli %t.bc > /dev/null
-
-; We were accidentally inverting the signedness of right shifts. Whoops.
-
-define i32 @main() {
- %X = ashr i32 -1, 16 ; <i32> [#uses=1]
- %Y = ashr i32 %X, 16 ; <i32> [#uses=1]
- %Z = add i32 %Y, 1 ; <i32> [#uses=1]
- ret i32 %Z
-}
-
diff --git a/release_23/test/ExecutionEngine/2003-01-10-FUCOM.ll b/release_23/test/ExecutionEngine/2003-01-10-FUCOM.ll
deleted file mode 100644
index c45674c1bc91..000000000000
--- a/release_23/test/ExecutionEngine/2003-01-10-FUCOM.ll
+++ /dev/null
@@ -1,11 +0,0 @@
-; RUN: llvm-as < %s -f -o %t.bc
-; RUN: lli %t.bc > /dev/null
-
-define i32 @main() {
- %X = add double 0.000000e+00, 1.000000e+00 ; <double> [#uses=1]
- %Y = sub double 0.000000e+00, 1.000000e+00 ; <double> [#uses=2]
- %Z = fcmp oeq double %X, %Y ; <i1> [#uses=0]
- add double %Y, 0.000000e+00 ; <double>:1 [#uses=0]
- ret i32 0
-}
-
diff --git a/release_23/test/ExecutionEngine/2003-01-15-AlignmentTest.ll b/release_23/test/ExecutionEngine/2003-01-15-AlignmentTest.ll
deleted file mode 100644
index 02872f6958bc..000000000000
--- a/release_23/test/ExecutionEngine/2003-01-15-AlignmentTest.ll
+++ /dev/null
@@ -1,18 +0,0 @@
-; RUN: llvm-as < %s -f -o %t.bc
-; RUN: lli %t.bc > /dev/null
-
-define i32 @bar(i8* %X) {
- ; pointer should be 4 byte aligned!
- %P = alloca double ; <double*> [#uses=1]
- %R = ptrtoint double* %P to i32 ; <i32> [#uses=1]
- %A = and i32 %R, 3 ; <i32> [#uses=1]
- ret i32 %A
-}
-
-define i32 @main() {
- %SP = alloca i8 ; <i8*> [#uses=1]
- %X = add i32 0, 0 ; <i32> [#uses=1]
- alloca i8, i32 %X ; <i8*>:1 [#uses=0]
- call i32 @bar( i8* %SP ) ; <i32>:2 [#uses=1]
- ret i32 %2
-}
diff --git a/release_23/test/ExecutionEngine/2003-05-06-LivenessClobber.ll b/release_23/test/ExecutionEngine/2003-05-06-LivenessClobber.ll
deleted file mode 100644
index 57fe95b2d915..000000000000
--- a/release_23/test/ExecutionEngine/2003-05-06-LivenessClobber.ll
+++ /dev/null
@@ -1,19 +0,0 @@
-; This testcase shoudl return with an exit code of 1.
-;
-; RUN: llvm-as < %s | not lli
-
-@test = global i64 0 ; <i64*> [#uses=1]
-
-define internal i64 @test.upgrd.1() {
- %tmp.0 = load i64* @test ; <i64> [#uses=1]
- %tmp.1 = add i64 %tmp.0, 1 ; <i64> [#uses=1]
- ret i64 %tmp.1
-}
-
-define i32 @main() {
- %L = call i64 @test.upgrd.1( ) ; <i64> [#uses=1]
- %I = trunc i64 %L to i32 ; <i32> [#uses=1]
- ret i32 %I
-}
-
-
diff --git a/release_23/test/ExecutionEngine/2003-05-07-ArgumentTest.ll b/release_23/test/ExecutionEngine/2003-05-07-ArgumentTest.ll
deleted file mode 100644
index fa15d7110c32..000000000000
--- a/release_23/test/ExecutionEngine/2003-05-07-ArgumentTest.ll
+++ /dev/null
@@ -1,11 +0,0 @@
-; RUN: llvm-as < %s | lli - test
-
-declare i32 @puts(i8*)
-
-define i32 @main(i32 %argc.1, i8** %argv.1) {
- %tmp.5 = getelementptr i8** %argv.1, i64 1 ; <i8**> [#uses=1]
- %tmp.6 = load i8** %tmp.5 ; <i8*> [#uses=1]
- %tmp.0 = call i32 @puts( i8* %tmp.6 ) ; <i32> [#uses=0]
- ret i32 0
-}
-
diff --git a/release_23/test/ExecutionEngine/2003-05-11-PHIRegAllocBug.ll b/release_23/test/ExecutionEngine/2003-05-11-PHIRegAllocBug.ll
deleted file mode 100644
index 850654f2346b..000000000000
--- a/release_23/test/ExecutionEngine/2003-05-11-PHIRegAllocBug.ll
+++ /dev/null
@@ -1,16 +0,0 @@
-; RUN: llvm-as < %s -f -o %t.bc
-; RUN: lli %t.bc > /dev/null
-
-target datalayout = "e-p:32:32"
-
-define i32 @main() {
-entry:
- br label %endif
-then: ; No predecessors!
- br label %endif
-endif: ; preds = %then, %entry
- %x = phi i32 [ 4, %entry ], [ 27, %then ] ; <i32> [#uses=0]
- %result = phi i32 [ 32, %then ], [ 0, %entry ] ; <i32> [#uses=0]
- ret i32 0
-}
-
diff --git a/release_23/test/ExecutionEngine/2003-06-04-bzip2-bug.ll b/release_23/test/ExecutionEngine/2003-06-04-bzip2-bug.ll
deleted file mode 100644
index ff758cf14c62..000000000000
--- a/release_23/test/ExecutionEngine/2003-06-04-bzip2-bug.ll
+++ /dev/null
@@ -1,20 +0,0 @@
-; RUN: llvm-as < %s -f -o %t.bc
-; RUN: lli %t.bc > /dev/null
-
-; Testcase distilled from 256.bzip2.
-
-target datalayout = "e-p:32:32"
-
-define i32 @main() {
-entry:
- br label %loopentry.0
-loopentry.0: ; preds = %loopentry.0, %entry
- %h.0 = phi i32 [ %tmp.2, %loopentry.0 ], [ -1, %entry ] ; <i32> [#uses=1]
- %tmp.2 = add i32 %h.0, 1 ; <i32> [#uses=3]
- %tmp.4 = icmp ne i32 %tmp.2, 0 ; <i1> [#uses=1]
- br i1 %tmp.4, label %loopentry.0, label %loopentry.1
-loopentry.1: ; preds = %loopentry.0
- %h.1 = phi i32 [ %tmp.2, %loopentry.0 ] ; <i32> [#uses=1]
- ret i32 %h.1
-}
-
diff --git a/release_23/test/ExecutionEngine/2003-06-05-PHIBug.ll b/release_23/test/ExecutionEngine/2003-06-05-PHIBug.ll
deleted file mode 100644
index 3a55f72c97df..000000000000
--- a/release_23/test/ExecutionEngine/2003-06-05-PHIBug.ll
+++ /dev/null
@@ -1,18 +0,0 @@
-; RUN: llvm-as < %s -f -o %t.bc
-; RUN: lli %t.bc > /dev/null
-
-; Testcase distilled from 256.bzip2.
-
-target datalayout = "e-p:32:32"
-
-define i32 @main() {
-entry:
- %X = add i32 1, -1 ; <i32> [#uses=3]
- br label %Next
-Next: ; preds = %entry
- %A = phi i32 [ %X, %entry ] ; <i32> [#uses=0]
- %B = phi i32 [ %X, %entry ] ; <i32> [#uses=0]
- %C = phi i32 [ %X, %entry ] ; <i32> [#uses=1]
- ret i32 %C
-}
-
diff --git a/release_23/test/ExecutionEngine/2003-08-15-AllocaAssertion.ll b/release_23/test/ExecutionEngine/2003-08-15-AllocaAssertion.ll
deleted file mode 100644
index ce5e1ed3ad8e..000000000000
--- a/release_23/test/ExecutionEngine/2003-08-15-AllocaAssertion.ll
+++ /dev/null
@@ -1,12 +0,0 @@
-; RUN: llvm-as < %s -f -o %t.bc
-; RUN: lli %t.bc > /dev/null
-
-; This testcase failed to work because two variable sized allocas confused the
-; local register allocator.
-
-define i32 @main(i32 %X) {
- %A = alloca i32, i32 %X ; <i32*> [#uses=0]
- %B = alloca float, i32 %X ; <float*> [#uses=0]
- ret i32 0
-}
-
diff --git a/release_23/test/ExecutionEngine/2003-08-21-EnvironmentTest.ll b/release_23/test/ExecutionEngine/2003-08-21-EnvironmentTest.ll
deleted file mode 100644
index ec36a85d7d3a..000000000000
--- a/release_23/test/ExecutionEngine/2003-08-21-EnvironmentTest.ll
+++ /dev/null
@@ -1,22 +0,0 @@
-; RUN: llvm-as < %s -f -o %t.bc
-; RUN: lli %t.bc > /dev/null
-
-;
-; Regression Test: EnvironmentTest.ll
-;
-; Description:
-; This is a regression test that verifies that the JIT passes the
-; environment to the main() function.
-;
-
-
-declare i32 @strlen(i8*)
-
-define i32 @main(i32 %argc.1, i8** %argv.1, i8** %envp.1) {
- %tmp.2 = load i8** %envp.1 ; <i8*> [#uses=1]
- %tmp.3 = call i32 @strlen( i8* %tmp.2 ) ; <i32> [#uses=1]
- %T = icmp eq i32 %tmp.3, 0 ; <i1> [#uses=1]
- %R = zext i1 %T to i32 ; <i32> [#uses=1]
- ret i32 %R
-}
-
diff --git a/release_23/test/ExecutionEngine/2003-08-23-RegisterAllocatePhysReg.ll b/release_23/test/ExecutionEngine/2003-08-23-RegisterAllocatePhysReg.ll
deleted file mode 100644
index 42e8dc3b1314..000000000000
--- a/release_23/test/ExecutionEngine/2003-08-23-RegisterAllocatePhysReg.ll
+++ /dev/null
@@ -1,35 +0,0 @@
-; RUN: llvm-as < %s -f -o %t.bc
-; RUN: lli %t.bc > /dev/null
-
-; This testcase exposes a bug in the local register allocator where it runs out
-; of registers (due to too many overlapping live ranges), but then attempts to
-; use the ESP register (which is not allocatable) to hold a value.
-
-define i32 @main(i32 %A) {
- ; ESP gets used again...
- %Ap2 = alloca i32, i32 %A ; <i32*> [#uses=11]
- ; Produce lots of overlapping live ranges
- %B = add i32 %A, 1 ; <i32> [#uses=1]
- %C = add i32 %A, 2 ; <i32> [#uses=1]
- %D = add i32 %A, 3 ; <i32> [#uses=1]
- %E = add i32 %A, 4 ; <i32> [#uses=1]
- %F = add i32 %A, 5 ; <i32> [#uses=1]
- %G = add i32 %A, 6 ; <i32> [#uses=1]
- %H = add i32 %A, 7 ; <i32> [#uses=1]
- %I = add i32 %A, 8 ; <i32> [#uses=1]
- %J = add i32 %A, 9 ; <i32> [#uses=1]
- %K = add i32 %A, 10 ; <i32> [#uses=1]
- ; Uses of all of the values
- store i32 %A, i32* %Ap2
- store i32 %B, i32* %Ap2
- store i32 %C, i32* %Ap2
- store i32 %D, i32* %Ap2
- store i32 %E, i32* %Ap2
- store i32 %F, i32* %Ap2
- store i32 %G, i32* %Ap2
- store i32 %H, i32* %Ap2
- store i32 %I, i32* %Ap2
- store i32 %J, i32* %Ap2
- store i32 %K, i32* %Ap2
- ret i32 0
-}
diff --git a/release_23/test/ExecutionEngine/2003-10-18-PHINode-ConstantExpr-CondCode-Failure.ll b/release_23/test/ExecutionEngine/2003-10-18-PHINode-ConstantExpr-CondCode-Failure.ll
deleted file mode 100644
index 32d99d50516e..000000000000
--- a/release_23/test/ExecutionEngine/2003-10-18-PHINode-ConstantExpr-CondCode-Failure.ll
+++ /dev/null
@@ -1,24 +0,0 @@
-; RUN: llvm-as < %s -f -o %t.bc
-; RUN: lli %t.bc > /dev/null
-
-@A = global i32 0 ; <i32*> [#uses=1]
-
-define i32 @main() {
- %Ret = call i32 @test( i1 true, i32 0 ) ; <i32> [#uses=1]
- ret i32 %Ret
-}
-
-define i32 @test(i1 %c, i32 %A) {
- br i1 %c, label %Taken1, label %NotTaken
-Cont: ; preds = %Taken1, %NotTaken
- %V = phi i32 [ 0, %NotTaken ], [ sub (i32 ptrtoint (i32* @A to i32), i32 1234), %Taken1 ] ; <i32> [#uses=0]
- ret i32 0
-NotTaken: ; preds = %0
- br label %Cont
-Taken1: ; preds = %0
- %B = icmp eq i32 %A, 0 ; <i1> [#uses=1]
- br i1 %B, label %Cont, label %ExitError
-ExitError: ; preds = %Taken1
- ret i32 12
-}
-
diff --git a/release_23/test/ExecutionEngine/2004-12-04-LazyCompileFuncs.ll b/release_23/test/ExecutionEngine/2004-12-04-LazyCompileFuncs.ll
deleted file mode 100644
index 0e2cbcb0e22a..000000000000
--- a/release_23/test/ExecutionEngine/2004-12-04-LazyCompileFuncs.ll
+++ /dev/null
@@ -1,29 +0,0 @@
-; RUN: llvm-as < %s -f -o %t.bc
-; RUN: lli -debug-only=jit %t.bc |& not grep {Finished CodeGen of .*Function: F}
-@.str_1 = internal constant [7 x i8] c"IN F!\0A\00" ; <[7 x i8]*> [#uses=1]
-@.str_2 = internal constant [7 x i8] c"IN G!\0A\00" ; <[7 x i8]*> [#uses=1]
-@Ptrs = internal constant [2 x void (...)*] [ void (...)* bitcast (void ()* @F to void (...)*), void (...)* bitcast (void ()* @G to void (...)*) ] ; <[2 x void (...)*]*> [#uses=1]
-
-declare i32 @printf(i8*, ...)
-
-define internal void @F() {
-entry:
- %tmp.0 = call i32 (i8*, ...)* @printf( i8* getelementptr ([7 x i8]* @.str_1, i32 0, i32 0) ) ; <i32> [#uses=0]
- ret void
-}
-
-define internal void @G() {
-entry:
- %tmp.0 = call i32 (i8*, ...)* @printf( i8* getelementptr ([7 x i8]* @.str_2, i32 0, i32 0) ) ; <i32> [#uses=0]
- ret void
-}
-
-define i32 @main(i32 %argc, i8** %argv) {
-entry:
- %tmp.3 = and i32 %argc, 1 ; <i32> [#uses=1]
- %tmp.4 = getelementptr [2 x void (...)*]* @Ptrs, i32 0, i32 %tmp.3 ; <void (...)**> [#uses=1]
- %tmp.5 = load void (...)** %tmp.4 ; <void (...)*> [#uses=1]
- %tmp.5_c = bitcast void (...)* %tmp.5 to void ()* ; <void ()*> [#uses=1]
- call void %tmp.5_c( )
- ret i32 0
-}
diff --git a/release_23/test/ExecutionEngine/2005-12-02-TailCallBug.ll b/release_23/test/ExecutionEngine/2005-12-02-TailCallBug.ll
deleted file mode 100644
index 59a40ae81403..000000000000
--- a/release_23/test/ExecutionEngine/2005-12-02-TailCallBug.ll
+++ /dev/null
@@ -1,21 +0,0 @@
-; PR672
-; RUN: llvm-as < %s | lli
-
-define i32 @main() {
- %f = bitcast i32 (i32, i32*, i32)* @check_tail to i32* ; <i32*> [#uses=1]
- %res = tail call fastcc i32 @check_tail( i32 10, i32* %f, i32 10 ) ; <i32> [#uses=1]
- ret i32 %res
-}
-
-define fastcc i32 @check_tail(i32 %x, i32* %f, i32 %g) {
- %tmp1 = icmp sgt i32 %x, 0 ; <i1> [#uses=1]
- br i1 %tmp1, label %if-then, label %if-else
-if-then: ; preds = %0
- %fun_ptr = bitcast i32* %f to i32 (i32, i32*, i32)* ; <i32 (i32, i32*, i32)*> [#uses=1]
- %arg1 = add i32 %x, -1 ; <i32> [#uses=1]
- %res = tail call fastcc i32 %fun_ptr( i32 %arg1, i32* %f, i32 %g ) ; <i32> [#uses=1]
- ret i32 %res
-if-else: ; preds = %0
- ret i32 %x
-}
-
diff --git a/release_23/test/ExecutionEngine/2007-05-12-APInt-Shl.ll b/release_23/test/ExecutionEngine/2007-05-12-APInt-Shl.ll
deleted file mode 100644
index cbea4076ea1e..000000000000
--- a/release_23/test/ExecutionEngine/2007-05-12-APInt-Shl.ll
+++ /dev/null
@@ -1,30 +0,0 @@
-; RUN: llvm-as %s -f -o %t.bc
-; RUN: lli -force-interpreter=true %t.bc | tee %t.out | grep 10
-
-; Test that APInt shift left works when bitwidth > 64 and shiftamt == 0
-
-declare i32 @putchar(i32)
-
-define void @putBit(i65 %x, i65 %bitnum) {
- %tmp1 = shl i65 1, %bitnum
- %tmp2 = and i65 %x, %tmp1
- %cond = icmp ne i65 %tmp2, 0
- br i1 %cond, label %cond_true, label %cond_false
-
-cond_true:
- call i32 @putchar(i32 49)
- br label %cond_next
-
-cond_false:
- call i32 @putchar(i32 48)
- br label %cond_next
-
-cond_next:
- ret void
-}
-
-define i32 @main() {
- call void @putBit(i65 1, i65 0)
- call void @putBit(i65 0, i65 0)
- ret i32 0
-}
diff --git a/release_23/test/ExecutionEngine/2007-12-10-APIntLoadStore.ll b/release_23/test/ExecutionEngine/2007-12-10-APIntLoadStore.ll
deleted file mode 100644
index 7a337f90cb6c..000000000000
--- a/release_23/test/ExecutionEngine/2007-12-10-APIntLoadStore.ll
+++ /dev/null
@@ -1,19 +0,0 @@
-; RUN: llvm-as < %s -o - | lli -force-interpreter
-; PR1836
-
-define i32 @main() {
-entry:
- %retval = alloca i32 ; <i32*> [#uses=2]
- %tmp = alloca i32 ; <i32*> [#uses=2]
- %x = alloca i75, align 16 ; <i75*> [#uses=1]
- %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
- store i75 999, i75* %x, align 16
- store i32 0, i32* %tmp, align 4
- %tmp1 = load i32* %tmp, align 4 ; <i32> [#uses=1]
- store i32 %tmp1, i32* %retval, align 4
- br label %return
-
-return: ; preds = %entry
- %retval2 = load i32* %retval ; <i32> [#uses=1]
- ret i32 %retval2
-}
diff --git a/release_23/test/ExecutionEngine/2007-12-14-BigEndian.ll b/release_23/test/ExecutionEngine/2007-12-14-BigEndian.ll
deleted file mode 100644
index 68059fd59a26..000000000000
--- a/release_23/test/ExecutionEngine/2007-12-14-BigEndian.ll
+++ /dev/null
@@ -1,81 +0,0 @@
-; RUN: llvm-as < %s -o - | lli -force-interpreter
-
-target datalayout = "E"
-
-define i32 @main() {
-entry:
- %i = alloca i93
- store i93 18364758544493064720, i93* %i
- %i1 = load i93* %i
- %i2 = shl i93 %i1, 32
- %i3 = or i93 %i2, 3753679480
- store i93 %i3, i93* %i
- %i4 = load i93* %i
- %C = icmp eq i93 %i3, %i4
- br i1 %C, label %ok1, label %fail
-ok1:
- %b = bitcast i93* %i to [12 x i8]*
- %b0 = getelementptr [12 x i8]* %b, i32 0, i32 0
- %v0 = load i8* %b0
- %c0 = icmp eq i8 %v0, 30
- br i1 %c0, label %ok2, label %fail
-ok2:
- %b1 = getelementptr [12 x i8]* %b, i32 0, i32 1
- %v1 = load i8* %b1
- %c1 = icmp eq i8 %v1, 220
- br i1 %c1, label %ok3, label %fail
-ok3:
- %b2 = getelementptr [12 x i8]* %b, i32 0, i32 2
- %v2 = load i8* %b2
- %c2 = icmp eq i8 %v2, 186
- br i1 %c2, label %ok4, label %fail
-ok4:
- %b3 = getelementptr [12 x i8]* %b, i32 0, i32 3
- %v3 = load i8* %b3
- %c3 = icmp eq i8 %v3, 152
- br i1 %c3, label %ok5, label %fail
-ok5:
- %b4 = getelementptr [12 x i8]* %b, i32 0, i32 4
- %v4 = load i8* %b4
- %c4 = icmp eq i8 %v4, 118
- br i1 %c4, label %ok6, label %fail
-ok6:
- %b5 = getelementptr [12 x i8]* %b, i32 0, i32 5
- %v5 = load i8* %b5
- %c5 = icmp eq i8 %v5, 84
- br i1 %c5, label %ok7, label %fail
-ok7:
- %b6 = getelementptr [12 x i8]* %b, i32 0, i32 6
- %v6 = load i8* %b6
- %c6 = icmp eq i8 %v6, 50
- br i1 %c6, label %ok8, label %fail
-ok8:
- %b7 = getelementptr [12 x i8]* %b, i32 0, i32 7
- %v7 = load i8* %b7
- %c7 = icmp eq i8 %v7, 16
- br i1 %c7, label %ok9, label %fail
-ok9:
- %b8 = getelementptr [12 x i8]* %b, i32 0, i32 8
- %v8 = load i8* %b8
- %c8 = icmp eq i8 %v8, 223
- br i1 %c8, label %okA, label %fail
-okA:
- %b9 = getelementptr [12 x i8]* %b, i32 0, i32 9
- %v9 = load i8* %b9
- %c9 = icmp eq i8 %v9, 188
- br i1 %c9, label %okB, label %fail
-okB:
- %bA = getelementptr [12 x i8]* %b, i32 0, i32 10
- %vA = load i8* %bA
- %cA = icmp eq i8 %vA, 154
- br i1 %cA, label %okC, label %fail
-okC:
- %bB = getelementptr [12 x i8]* %b, i32 0, i32 11
- %vB = load i8* %bB
- %cB = icmp eq i8 %vB, 120
- br i1 %cB, label %okD, label %fail
-okD:
- ret i32 0
-fail:
- ret i32 1
-}
diff --git a/release_23/test/ExecutionEngine/2007-12-14-LittleEndian.ll b/release_23/test/ExecutionEngine/2007-12-14-LittleEndian.ll
deleted file mode 100644
index afaed5148b19..000000000000
--- a/release_23/test/ExecutionEngine/2007-12-14-LittleEndian.ll
+++ /dev/null
@@ -1,81 +0,0 @@
-; RUN: llvm-as < %s -o - | lli -force-interpreter
-
-target datalayout = "e"
-
-define i32 @main() {
-entry:
- %i = alloca i93
- store i93 18364758544493064720, i93* %i
- %i1 = load i93* %i
- %i2 = shl i93 %i1, 32
- %i3 = or i93 %i2, 3753679480
- store i93 %i3, i93* %i
- %i4 = load i93* %i
- %C = icmp eq i93 %i3, %i4
- br i1 %C, label %ok1, label %fail
-ok1:
- %b = bitcast i93* %i to [12 x i8]*
- %b0 = getelementptr [12 x i8]* %b, i32 0, i32 0
- %v0 = load i8* %b0
- %c0 = icmp eq i8 %v0, 120
- br i1 %c0, label %ok2, label %fail
-ok2:
- %b1 = getelementptr [12 x i8]* %b, i32 0, i32 1
- %v1 = load i8* %b1
- %c1 = icmp eq i8 %v1, 154
- br i1 %c1, label %ok3, label %fail
-ok3:
- %b2 = getelementptr [12 x i8]* %b, i32 0, i32 2
- %v2 = load i8* %b2
- %c2 = icmp eq i8 %v2, 188
- br i1 %c2, label %ok4, label %fail
-ok4:
- %b3 = getelementptr [12 x i8]* %b, i32 0, i32 3
- %v3 = load i8* %b3
- %c3 = icmp eq i8 %v3, 223
- br i1 %c3, label %ok5, label %fail
-ok5:
- %b4 = getelementptr [12 x i8]* %b, i32 0, i32 4
- %v4 = load i8* %b4
- %c4 = icmp eq i8 %v4, 16
- br i1 %c4, label %ok6, label %fail
-ok6:
- %b5 = getelementptr [12 x i8]* %b, i32 0, i32 5
- %v5 = load i8* %b5
- %c5 = icmp eq i8 %v5, 50
- br i1 %c5, label %ok7, label %fail
-ok7:
- %b6 = getelementptr [12 x i8]* %b, i32 0, i32 6
- %v6 = load i8* %b6
- %c6 = icmp eq i8 %v6, 84
- br i1 %c6, label %ok8, label %fail
-ok8:
- %b7 = getelementptr [12 x i8]* %b, i32 0, i32 7
- %v7 = load i8* %b7
- %c7 = icmp eq i8 %v7, 118
- br i1 %c7, label %ok9, label %fail
-ok9:
- %b8 = getelementptr [12 x i8]* %b, i32 0, i32 8
- %v8 = load i8* %b8
- %c8 = icmp eq i8 %v8, 152
- br i1 %c8, label %okA, label %fail
-okA:
- %b9 = getelementptr [12 x i8]* %b, i32 0, i32 9
- %v9 = load i8* %b9
- %c9 = icmp eq i8 %v9, 186
- br i1 %c9, label %okB, label %fail
-okB:
- %bA = getelementptr [12 x i8]* %b, i32 0, i32 10
- %vA = load i8* %bA
- %cA = icmp eq i8 %vA, 220
- br i1 %cA, label %okC, label %fail
-okC:
- %bB = getelementptr [12 x i8]* %b, i32 0, i32 11
- %vB = load i8* %bB
- %cB = icmp eq i8 %vB, 30
- br i1 %cB, label %okD, label %fail
-okD:
- ret i32 0
-fail:
- ret i32 1
-}
diff --git a/release_23/test/ExecutionEngine/dg.exp b/release_23/test/ExecutionEngine/dg.exp
deleted file mode 100644
index 879685ca879d..000000000000
--- a/release_23/test/ExecutionEngine/dg.exp
+++ /dev/null
@@ -1,3 +0,0 @@
-load_lib llvm.exp
-
-RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
diff --git a/release_23/test/ExecutionEngine/fpbitcast.ll b/release_23/test/ExecutionEngine/fpbitcast.ll
deleted file mode 100644
index 34ca129ead6f..000000000000
--- a/release_23/test/ExecutionEngine/fpbitcast.ll
+++ /dev/null
@@ -1,21 +0,0 @@
-; RUN: llvm-as < %s > %t.bc
-; RUN: lli -force-interpreter=true %t.bc | grep 40091eb8
-;
-define i32 @test(double %x) {
-entry:
- %x46.i = bitcast double %x to i64
- %tmp343.i = lshr i64 %x46.i, 32
- %tmp344.i = trunc i64 %tmp343.i to i32
- ret i32 %tmp344.i
-}
-
-define i32 @main()
-{
- %res = call i32 @test(double 3.14)
- %ptr = getelementptr [4 x i8]* @format, i32 0, i32 0
- call i32 (i8*,...)* @printf(i8* %ptr, i32 %res)
- ret i32 0
-}
-
-declare i32 @printf(i8*, ...)
-@format = internal constant [4 x i8] c"%x\0A\00"
diff --git a/release_23/test/ExecutionEngine/hello.ll b/release_23/test/ExecutionEngine/hello.ll
deleted file mode 100644
index a0c5e1a48de1..000000000000
--- a/release_23/test/ExecutionEngine/hello.ll
+++ /dev/null
@@ -1,12 +0,0 @@
-; RUN: llvm-as < %s -f -o %t.bc
-; RUN: lli %t.bc > /dev/null
-
-@.LC0 = internal global [12 x i8] c"Hello World\00" ; <[12 x i8]*> [#uses=1]
-
-declare i32 @puts(i8*)
-
-define i32 @main() {
- %reg210 = call i32 @puts( i8* getelementptr ([12 x i8]* @.LC0, i64 0, i64 0) ) ; <i32> [#uses=0]
- ret i32 0
-}
-
diff --git a/release_23/test/ExecutionEngine/hello2.ll b/release_23/test/ExecutionEngine/hello2.ll
deleted file mode 100644
index 772dc0493e5d..000000000000
--- a/release_23/test/ExecutionEngine/hello2.ll
+++ /dev/null
@@ -1,18 +0,0 @@
-; RUN: llvm-as < %s -f -o %t.bc
-; RUN: lli %t.bc > /dev/null
-
-@X = global i32 7 ; <i32*> [#uses=0]
-@msg = internal global [13 x i8] c"Hello World\0A\00" ; <[13 x i8]*> [#uses=1]
-
-declare void @printf([13 x i8]*, ...)
-
-define void @bar() {
- call void ([13 x i8]*, ...)* @printf( [13 x i8]* @msg )
- ret void
-}
-
-define i32 @main() {
- call void @bar( )
- ret i32 0
-}
-
diff --git a/release_23/test/ExecutionEngine/simplesttest.ll b/release_23/test/ExecutionEngine/simplesttest.ll
deleted file mode 100644
index 82e8a2dc869b..000000000000
--- a/release_23/test/ExecutionEngine/simplesttest.ll
+++ /dev/null
@@ -1,7 +0,0 @@
-; RUN: llvm-as < %s -f -o %t.bc
-; RUN: lli %t.bc > /dev/null
-
-define i32 @main() {
- ret i32 0
-}
-
diff --git a/release_23/test/ExecutionEngine/simpletest.ll b/release_23/test/ExecutionEngine/simpletest.ll
deleted file mode 100644
index cca3499db348..000000000000
--- a/release_23/test/ExecutionEngine/simpletest.ll
+++ /dev/null
@@ -1,12 +0,0 @@
-; RUN: llvm-as < %s -f -o %t.bc
-; RUN: lli %t.bc > /dev/null
-
-define i32 @bar() {
- ret i32 0
-}
-
-define i32 @main() {
- %r = call i32 @bar( ) ; <i32> [#uses=1]
- ret i32 %r
-}
-
diff --git a/release_23/test/ExecutionEngine/test-arith.ll b/release_23/test/ExecutionEngine/test-arith.ll
deleted file mode 100644
index d99e30f51740..000000000000
--- a/release_23/test/ExecutionEngine/test-arith.ll
+++ /dev/null
@@ -1,35 +0,0 @@
-; RUN: llvm-as %s -f -o %t.bc
-; RUN: lli %t.bc > /dev/null
-
-define i32 @main() {
- %A = add i8 0, 12 ; <i8> [#uses=1]
- %B = sub i8 %A, 1 ; <i8> [#uses=2]
- %C = mul i8 %B, %B ; <i8> [#uses=2]
- %D = sdiv i8 %C, %C ; <i8> [#uses=2]
- %E = srem i8 %D, %D ; <i8> [#uses=0]
- %F = udiv i8 5, 6 ; <i8> [#uses=0]
- %G = urem i8 6, 5 ; <i8> [#uses=0]
- %A.upgrd.1 = add i16 0, 12 ; <i16> [#uses=1]
- %B.upgrd.2 = sub i16 %A.upgrd.1, 1 ; <i16> [#uses=2]
- %C.upgrd.3 = mul i16 %B.upgrd.2, %B.upgrd.2 ; <i16> [#uses=2]
- %D.upgrd.4 = sdiv i16 %C.upgrd.3, %C.upgrd.3 ; <i16> [#uses=2]
- %E.upgrd.5 = srem i16 %D.upgrd.4, %D.upgrd.4 ; <i16> [#uses=0]
- %F.upgrd.6 = udiv i16 5, 6 ; <i16> [#uses=0]
- %G.upgrd.7 = urem i32 6, 5 ; <i32> [#uses=0]
- %A.upgrd.8 = add i32 0, 12 ; <i32> [#uses=1]
- %B.upgrd.9 = sub i32 %A.upgrd.8, 1 ; <i32> [#uses=2]
- %C.upgrd.10 = mul i32 %B.upgrd.9, %B.upgrd.9 ; <i32> [#uses=2]
- %D.upgrd.11 = sdiv i32 %C.upgrd.10, %C.upgrd.10 ; <i32> [#uses=2]
- %E.upgrd.12 = srem i32 %D.upgrd.11, %D.upgrd.11 ; <i32> [#uses=0]
- %F.upgrd.13 = udiv i32 5, 6 ; <i32> [#uses=0]
- %G1 = urem i32 6, 5 ; <i32> [#uses=0]
- %A.upgrd.14 = add i64 0, 12 ; <i64> [#uses=1]
- %B.upgrd.15 = sub i64 %A.upgrd.14, 1 ; <i64> [#uses=2]
- %C.upgrd.16 = mul i64 %B.upgrd.15, %B.upgrd.15 ; <i64> [#uses=2]
- %D.upgrd.17 = sdiv i64 %C.upgrd.16, %C.upgrd.16 ; <i64> [#uses=2]
- %E.upgrd.18 = srem i64 %D.upgrd.17, %D.upgrd.17 ; <i64> [#uses=0]
- %F.upgrd.19 = udiv i64 5, 6 ; <i64> [#uses=0]
- %G.upgrd.20 = urem i64 6, 5 ; <i64> [#uses=0]
- ret i32 0
-}
-
diff --git a/release_23/test/ExecutionEngine/test-branch.ll b/release_23/test/ExecutionEngine/test-branch.ll
deleted file mode 100644
index 55b7ef1d80c5..000000000000
--- a/release_23/test/ExecutionEngine/test-branch.ll
+++ /dev/null
@@ -1,13 +0,0 @@
-; RUN: llvm-as < %s -f -o %t.bc
-; RUN: lli %t.bc > /dev/null
-
-; test unconditional branch
-define i32 @main() {
- br label %Test
-Test: ; preds = %Test, %0
- %X = icmp eq i32 0, 4 ; <i1> [#uses=1]
- br i1 %X, label %Test, label %Label
-Label: ; preds = %Test
- ret i32 0
-}
-
diff --git a/release_23/test/ExecutionEngine/test-call.ll b/release_23/test/ExecutionEngine/test-call.ll
deleted file mode 100644
index 645396fe7585..000000000000
--- a/release_23/test/ExecutionEngine/test-call.ll
+++ /dev/null
@@ -1,22 +0,0 @@
-; RUN: llvm-as < %s -f -o %t.bc
-; RUN: lli %t.bc > /dev/null
-
-declare void @exit(i32)
-
-define i32 @test(i8 %C, i16 %S) {
- %X = trunc i16 %S to i8 ; <i8> [#uses=1]
- %Y = zext i8 %X to i32 ; <i32> [#uses=1]
- ret i32 %Y
-}
-
-define void @FP(void (i32)* %F) {
- %X = call i32 @test( i8 123, i16 1024 ) ; <i32> [#uses=1]
- call void %F( i32 %X )
- ret void
-}
-
-define i32 @main() {
- call void @FP( void (i32)* @exit )
- ret i32 1
-}
-
diff --git a/release_23/test/ExecutionEngine/test-cast.ll b/release_23/test/ExecutionEngine/test-cast.ll
deleted file mode 100644
index bc48716937ae..000000000000
--- a/release_23/test/ExecutionEngine/test-cast.ll
+++ /dev/null
@@ -1,110 +0,0 @@
-; RUN: llvm-as < %s -f -o %t.bc
-; RUN: lli %t.bc > /dev/null
-
-define i32 @foo() {
- ret i32 0
-}
-
-define i32 @main() {
- icmp ne i1 true, false ; <i1>:1 [#uses=0]
- zext i1 true to i8 ; <i8>:2 [#uses=0]
- zext i1 true to i8 ; <i8>:3 [#uses=0]
- zext i1 true to i16 ; <i16>:4 [#uses=0]
- zext i1 true to i16 ; <i16>:5 [#uses=0]
- zext i1 true to i32 ; <i32>:6 [#uses=0]
- zext i1 true to i32 ; <i32>:7 [#uses=0]
- zext i1 true to i64 ; <i64>:8 [#uses=0]
- zext i1 true to i64 ; <i64>:9 [#uses=0]
- uitofp i1 true to float ; <float>:10 [#uses=0]
- uitofp i1 true to double ; <double>:11 [#uses=0]
- icmp ne i8 0, 0 ; <i1>:12 [#uses=0]
- icmp ne i8 1, 0 ; <i1>:13 [#uses=0]
- bitcast i8 0 to i8 ; <i8>:14 [#uses=0]
- bitcast i8 -1 to i8 ; <i8>:15 [#uses=0]
- sext i8 4 to i16 ; <i16>:16 [#uses=0]
- sext i8 4 to i16 ; <i16>:17 [#uses=0]
- sext i8 4 to i64 ; <i64>:18 [#uses=0]
- sext i8 4 to i64 ; <i64>:19 [#uses=0]
- sitofp i8 4 to float ; <float>:20 [#uses=0]
- sitofp i8 4 to double ; <double>:21 [#uses=0]
- icmp ne i8 0, 0 ; <i1>:22 [#uses=0]
- icmp ne i8 1, 0 ; <i1>:23 [#uses=0]
- bitcast i8 0 to i8 ; <i8>:24 [#uses=0]
- bitcast i8 1 to i8 ; <i8>:25 [#uses=0]
- zext i8 4 to i16 ; <i16>:26 [#uses=0]
- zext i8 4 to i16 ; <i16>:27 [#uses=0]
- zext i8 4 to i64 ; <i64>:28 [#uses=0]
- zext i8 4 to i64 ; <i64>:29 [#uses=0]
- uitofp i8 0 to float ; <float>:30 [#uses=0]
- uitofp i8 0 to double ; <double>:31 [#uses=0]
- icmp ne i16 1, 0 ; <i1>:32 [#uses=0]
- trunc i16 -1 to i8 ; <i8>:33 [#uses=0]
- trunc i16 255 to i8 ; <i8>:34 [#uses=0]
- bitcast i16 0 to i16 ; <i16>:35 [#uses=0]
- bitcast i16 0 to i16 ; <i16>:36 [#uses=0]
- sext i16 0 to i64 ; <i64>:37 [#uses=0]
- sext i16 0 to i64 ; <i64>:38 [#uses=0]
- sitofp i16 0 to float ; <float>:39 [#uses=0]
- sitofp i16 0 to double ; <double>:40 [#uses=0]
- icmp ne i16 1, 0 ; <i1>:41 [#uses=0]
- trunc i16 1 to i8 ; <i8>:42 [#uses=0]
- trunc i16 255 to i8 ; <i8>:43 [#uses=0]
- bitcast i16 0 to i16 ; <i16>:44 [#uses=0]
- bitcast i16 0 to i16 ; <i16>:45 [#uses=0]
- zext i16 0 to i64 ; <i64>:46 [#uses=0]
- zext i16 0 to i64 ; <i64>:47 [#uses=0]
- uitofp i16 0 to float ; <float>:48 [#uses=0]
- uitofp i16 0 to double ; <double>:49 [#uses=0]
- icmp ne i32 6, 0 ; <i1>:50 [#uses=0]
- trunc i32 -6 to i8 ; <i8>:51 [#uses=0]
- trunc i32 6 to i8 ; <i8>:52 [#uses=0]
- trunc i32 6 to i16 ; <i16>:53 [#uses=0]
- bitcast i32 0 to i32 ; <i32>:54 [#uses=0]
- sext i32 0 to i64 ; <i64>:55 [#uses=0]
- sext i32 0 to i64 ; <i64>:56 [#uses=0]
- sitofp i32 0 to float ; <float>:57 [#uses=0]
- sitofp i32 0 to double ; <double>:58 [#uses=0]
- icmp ne i32 6, 0 ; <i1>:59 [#uses=0]
- trunc i32 7 to i8 ; <i8>:60 [#uses=0]
- trunc i32 8 to i8 ; <i8>:61 [#uses=0]
- trunc i32 9 to i16 ; <i16>:62 [#uses=0]
- bitcast i32 10 to i32 ; <i32>:63 [#uses=0]
- zext i32 0 to i64 ; <i64>:64 [#uses=0]
- zext i32 0 to i64 ; <i64>:65 [#uses=0]
- uitofp i32 0 to float ; <float>:66 [#uses=0]
- uitofp i32 0 to double ; <double>:67 [#uses=0]
- icmp ne i64 0, 0 ; <i1>:68 [#uses=0]
- trunc i64 0 to i8 ; <i8>:69 [#uses=0]
- trunc i64 0 to i8 ; <i8>:70 [#uses=0]
- trunc i64 0 to i16 ; <i16>:71 [#uses=0]
- trunc i64 0 to i16 ; <i16>:72 [#uses=0]
- trunc i64 0 to i32 ; <i32>:73 [#uses=0]
- trunc i64 0 to i32 ; <i32>:74 [#uses=0]
- bitcast i64 0 to i64 ; <i64>:75 [#uses=0]
- bitcast i64 0 to i64 ; <i64>:76 [#uses=0]
- sitofp i64 0 to float ; <float>:77 [#uses=0]
- sitofp i64 0 to double ; <double>:78 [#uses=0]
- icmp ne i64 1, 0 ; <i1>:79 [#uses=0]
- trunc i64 1 to i8 ; <i8>:80 [#uses=0]
- trunc i64 1 to i8 ; <i8>:81 [#uses=0]
- trunc i64 1 to i16 ; <i16>:82 [#uses=0]
- trunc i64 1 to i16 ; <i16>:83 [#uses=0]
- trunc i64 1 to i32 ; <i32>:84 [#uses=0]
- trunc i64 1 to i32 ; <i32>:85 [#uses=0]
- bitcast i64 1 to i64 ; <i64>:86 [#uses=0]
- bitcast i64 1 to i64 ; <i64>:87 [#uses=0]
- uitofp i64 1 to float ; <float>:88 [#uses=0]
- uitofp i64 0 to double ; <double>:89 [#uses=0]
- bitcast float 0.000000e+00 to float ; <float>:90 [#uses=0]
- fpext float 0.000000e+00 to double ; <double>:91 [#uses=0]
- fptosi double 0.000000e+00 to i8 ; <i8>:92 [#uses=0]
- fptoui double 0.000000e+00 to i8 ; <i8>:93 [#uses=0]
- fptosi double 0.000000e+00 to i16 ; <i16>:94 [#uses=0]
- fptoui double 0.000000e+00 to i16 ; <i16>:95 [#uses=0]
- fptosi double 0.000000e+00 to i32 ; <i32>:96 [#uses=0]
- fptoui double 0.000000e+00 to i32 ; <i32>:97 [#uses=0]
- fptosi double 0.000000e+00 to i64 ; <i64>:98 [#uses=0]
- fptrunc double 0.000000e+00 to float ; <float>:99 [#uses=0]
- bitcast double 0.000000e+00 to double ; <double>:100 [#uses=0]
- ret i32 0
-}
diff --git a/release_23/test/ExecutionEngine/test-constantexpr.ll b/release_23/test/ExecutionEngine/test-constantexpr.ll
deleted file mode 100644
index 2bf1949ead8e..000000000000
--- a/release_23/test/ExecutionEngine/test-constantexpr.ll
+++ /dev/null
@@ -1,13 +0,0 @@
-; RUN: llvm-as < %s -f -o %t.bc
-; RUN: lli %t.bc > /dev/null
-
-; This tests to make sure that we can evaluate weird constant expressions
-
-@A = global i32 5 ; <i32*> [#uses=1]
-@B = global i32 6 ; <i32*> [#uses=1]
-
-define i32 @main() {
- %A = or i1 false, icmp slt (i32* @A, i32* @B) ; <i1> [#uses=0]
- ret i32 0
-}
-
diff --git a/release_23/test/ExecutionEngine/test-fp.ll b/release_23/test/ExecutionEngine/test-fp.ll
deleted file mode 100644
index aa136ddf2d17..000000000000
--- a/release_23/test/ExecutionEngine/test-fp.ll
+++ /dev/null
@@ -1,24 +0,0 @@
-; RUN: llvm-as < %s -f -o %t.bc
-; RUN: lli %t.bc > /dev/null
-
-define double @test(double* %DP, double %Arg) {
- %D = load double* %DP ; <double> [#uses=1]
- %V = add double %D, 1.000000e+00 ; <double> [#uses=2]
- %W = sub double %V, %V ; <double> [#uses=3]
- %X = mul double %W, %W ; <double> [#uses=2]
- %Y = fdiv double %X, %X ; <double> [#uses=2]
- %Z = frem double %Y, %Y ; <double> [#uses=3]
- %Z1 = fdiv double %Z, %W ; <double> [#uses=0]
- %Q = add double %Z, %Arg ; <double> [#uses=1]
- %R = bitcast double %Q to double ; <double> [#uses=1]
- store double %R, double* %DP
- ret double %Z
-}
-
-define i32 @main() {
- %X = alloca double ; <double*> [#uses=2]
- store double 0.000000e+00, double* %X
- call double @test( double* %X, double 2.000000e+00 ) ; <double>:1 [#uses=0]
- ret i32 0
-}
-
diff --git a/release_23/test/ExecutionEngine/test-loadstore.ll b/release_23/test/ExecutionEngine/test-loadstore.ll
deleted file mode 100644
index ca2ecbfb0a18..000000000000
--- a/release_23/test/ExecutionEngine/test-loadstore.ll
+++ /dev/null
@@ -1,32 +0,0 @@
-; RUN: llvm-as < %s -f -o %t.bc
-; RUN: lli %t.bc > /dev/null
-
-define void @test(i8* %P, i16* %P.upgrd.1, i32* %P.upgrd.2, i64* %P.upgrd.3) {
- %V = load i8* %P ; <i8> [#uses=1]
- store i8 %V, i8* %P
- %V.upgrd.4 = load i16* %P.upgrd.1 ; <i16> [#uses=1]
- store i16 %V.upgrd.4, i16* %P.upgrd.1
- %V.upgrd.5 = load i32* %P.upgrd.2 ; <i32> [#uses=1]
- store i32 %V.upgrd.5, i32* %P.upgrd.2
- %V.upgrd.6 = load i64* %P.upgrd.3 ; <i64> [#uses=1]
- store i64 %V.upgrd.6, i64* %P.upgrd.3
- ret void
-}
-
-define i32 @varalloca(i32 %Size) {
- ;; Variable sized alloca
- %X = alloca i32, i32 %Size ; <i32*> [#uses=2]
- store i32 %Size, i32* %X
- %Y = load i32* %X ; <i32> [#uses=1]
- ret i32 %Y
-}
-
-define i32 @main() {
- %A = alloca i8 ; <i8*> [#uses=1]
- %B = alloca i16 ; <i16*> [#uses=1]
- %C = alloca i32 ; <i32*> [#uses=1]
- %D = alloca i64 ; <i64*> [#uses=1]
- call void @test( i8* %A, i16* %B, i32* %C, i64* %D )
- call i32 @varalloca( i32 7 ) ; <i32>:1 [#uses=0]
- ret i32 0
-}
diff --git a/release_23/test/ExecutionEngine/test-logical.ll b/release_23/test/ExecutionEngine/test-logical.ll
deleted file mode 100644
index 800de1fc8cab..000000000000
--- a/release_23/test/ExecutionEngine/test-logical.ll
+++ /dev/null
@@ -1,19 +0,0 @@
-; RUN: llvm-as < %s -f -o %t.bc
-; RUN: lli %t.bc > /dev/null
-
-define i32 @main() {
- %A = and i8 4, 8 ; <i8> [#uses=2]
- %B = or i8 %A, 7 ; <i8> [#uses=1]
- %C = xor i8 %B, %A ; <i8> [#uses=0]
- %A.upgrd.1 = and i16 4, 8 ; <i16> [#uses=2]
- %B.upgrd.2 = or i16 %A.upgrd.1, 7 ; <i16> [#uses=1]
- %C.upgrd.3 = xor i16 %B.upgrd.2, %A.upgrd.1 ; <i16> [#uses=0]
- %A.upgrd.4 = and i32 4, 8 ; <i32> [#uses=2]
- %B.upgrd.5 = or i32 %A.upgrd.4, 7 ; <i32> [#uses=1]
- %C.upgrd.6 = xor i32 %B.upgrd.5, %A.upgrd.4 ; <i32> [#uses=0]
- %A.upgrd.7 = and i64 4, 8 ; <i64> [#uses=2]
- %B.upgrd.8 = or i64 %A.upgrd.7, 7 ; <i64> [#uses=1]
- %C.upgrd.9 = xor i64 %B.upgrd.8, %A.upgrd.7 ; <i64> [#uses=0]
- ret i32 0
-}
-
diff --git a/release_23/test/ExecutionEngine/test-loop.ll b/release_23/test/ExecutionEngine/test-loop.ll
deleted file mode 100644
index d428adcddbd3..000000000000
--- a/release_23/test/ExecutionEngine/test-loop.ll
+++ /dev/null
@@ -1,15 +0,0 @@
-; RUN: llvm-as < %s -f -o %t.bc
-; RUN: lli %t.bc > /dev/null
-
-define i32 @main() {
-; <label>:0
- br label %Loop
-Loop: ; preds = %Loop, %0
- %I = phi i32 [ 0, %0 ], [ %i2, %Loop ] ; <i32> [#uses=1]
- %i2 = add i32 %I, 1 ; <i32> [#uses=2]
- %C = icmp eq i32 %i2, 10 ; <i1> [#uses=1]
- br i1 %C, label %Out, label %Loop
-Out: ; preds = %Loop
- ret i32 0
-}
-
diff --git a/release_23/test/ExecutionEngine/test-malloc.ll b/release_23/test/ExecutionEngine/test-malloc.ll
deleted file mode 100644
index 843a38989f2e..000000000000
--- a/release_23/test/ExecutionEngine/test-malloc.ll
+++ /dev/null
@@ -1,14 +0,0 @@
-; RUN: llvm-as < %s -f -o %t.bc
-; RUN: lli %t.bc > /dev/null
-
-define i32 @main() {
- %X = malloc i32 ; <i32*> [#uses=1]
- %Y = malloc i32, i32 100 ; <i32*> [#uses=1]
- %u = add i32 1, 2 ; <i32> [#uses=1]
- %Z = malloc i32, i32 %u ; <i32*> [#uses=1]
- free i32* %X
- free i32* %Y
- free i32* %Z
- ret i32 0
-}
-
diff --git a/release_23/test/ExecutionEngine/test-phi.ll b/release_23/test/ExecutionEngine/test-phi.ll
deleted file mode 100644
index 9ca1eb40bce9..000000000000
--- a/release_23/test/ExecutionEngine/test-phi.ll
+++ /dev/null
@@ -1,35 +0,0 @@
-; RUN: llvm-as < %s -f -o %t.bc
-; RUN: lli %t.bc > /dev/null
-
-; test phi node
-@Y = global i32 6 ; <i32*> [#uses=1]
-
-define void @blah(i32* %X) {
-; <label>:0
- br label %T
-T: ; preds = %Dead, %0
- phi i32* [ %X, %0 ], [ @Y, %Dead ] ; <i32*>:1 [#uses=0]
- ret void
-Dead: ; No predecessors!
- br label %T
-}
-
-define i32 @test(i1 %C) {
-; <label>:0
- br i1 %C, label %T, label %T
-T: ; preds = %0, %0
- %X = phi i32 [ 123, %0 ], [ 123, %0 ] ; <i32> [#uses=1]
- ret i32 %X
-}
-
-define i32 @main() {
-; <label>:0
- br label %Test
-Test: ; preds = %Dead, %0
- %X = phi i32 [ 0, %0 ], [ %Y, %Dead ] ; <i32> [#uses=1]
- ret i32 %X
-Dead: ; No predecessors!
- %Y = ashr i32 12, 4 ; <i32> [#uses=1]
- br label %Test
-}
-
diff --git a/release_23/test/ExecutionEngine/test-ret.ll b/release_23/test/ExecutionEngine/test-ret.ll
deleted file mode 100644
index 2d7994583e64..000000000000
--- a/release_23/test/ExecutionEngine/test-ret.ll
+++ /dev/null
@@ -1,47 +0,0 @@
-; RUN: llvm-as < %s -f -o %t.bc
-; RUN: lli %t.bc > /dev/null
-
-; test return instructions
-define void @test1() {
- ret void
-}
-
-define i8 @test2() {
- ret i8 1
-}
-
-define i8 @test3() {
- ret i8 1
-}
-
-define i16 @test4() {
- ret i16 -1
-}
-
-define i16 @test5() {
- ret i16 -1
-}
-
-define i32 @main() {
- ret i32 0
-}
-
-define i32 @test6() {
- ret i32 4
-}
-
-define i64 @test7() {
- ret i64 0
-}
-
-define i64 @test8() {
- ret i64 0
-}
-
-define float @test9() {
- ret float 1.000000e+00
-}
-
-define double @test10() {
- ret double 2.000000e+00
-}
diff --git a/release_23/test/ExecutionEngine/test-setcond-fp.ll b/release_23/test/ExecutionEngine/test-setcond-fp.ll
deleted file mode 100644
index 2f53e9018707..000000000000
--- a/release_23/test/ExecutionEngine/test-setcond-fp.ll
+++ /dev/null
@@ -1,25 +0,0 @@
-; RUN: llvm-as < %s -f -o %t.bc
-; RUN: lli %t.bc > /dev/null
-
-
-define i32 @main() {
- %double1 = add double 0.000000e+00, 0.000000e+00 ; <double> [#uses=6]
- %double2 = add double 0.000000e+00, 0.000000e+00 ; <double> [#uses=6]
- %float1 = add float 0.000000e+00, 0.000000e+00 ; <float> [#uses=6]
- %float2 = add float 0.000000e+00, 0.000000e+00 ; <float> [#uses=6]
- %test49 = fcmp oeq float %float1, %float2 ; <i1> [#uses=0]
- %test50 = fcmp oge float %float1, %float2 ; <i1> [#uses=0]
- %test51 = fcmp ogt float %float1, %float2 ; <i1> [#uses=0]
- %test52 = fcmp ole float %float1, %float2 ; <i1> [#uses=0]
- %test53 = fcmp olt float %float1, %float2 ; <i1> [#uses=0]
- %test54 = fcmp une float %float1, %float2 ; <i1> [#uses=0]
- %test55 = fcmp oeq double %double1, %double2 ; <i1> [#uses=0]
- %test56 = fcmp oge double %double1, %double2 ; <i1> [#uses=0]
- %test57 = fcmp ogt double %double1, %double2 ; <i1> [#uses=0]
- %test58 = fcmp ole double %double1, %double2 ; <i1> [#uses=0]
- %test59 = fcmp olt double %double1, %double2 ; <i1> [#uses=0]
- %test60 = fcmp une double %double1, %double2 ; <i1> [#uses=0]
- ret i32 0
-}
-
-
diff --git a/release_23/test/ExecutionEngine/test-setcond-int.ll b/release_23/test/ExecutionEngine/test-setcond-int.ll
deleted file mode 100644
index 5ec4ec936d7c..000000000000
--- a/release_23/test/ExecutionEngine/test-setcond-int.ll
+++ /dev/null
@@ -1,70 +0,0 @@
-; RUN: llvm-as < %s -f -o %t.bc
-; RUN: lli %t.bc > /dev/null
-
-define i32 @main() {
- %int1 = add i32 0, 0 ; <i32> [#uses=6]
- %int2 = add i32 0, 0 ; <i32> [#uses=6]
- %long1 = add i64 0, 0 ; <i64> [#uses=6]
- %long2 = add i64 0, 0 ; <i64> [#uses=6]
- %sbyte1 = add i8 0, 0 ; <i8> [#uses=6]
- %sbyte2 = add i8 0, 0 ; <i8> [#uses=6]
- %short1 = add i16 0, 0 ; <i16> [#uses=6]
- %short2 = add i16 0, 0 ; <i16> [#uses=6]
- %ubyte1 = add i8 0, 0 ; <i8> [#uses=6]
- %ubyte2 = add i8 0, 0 ; <i8> [#uses=6]
- %uint1 = add i32 0, 0 ; <i32> [#uses=6]
- %uint2 = add i32 0, 0 ; <i32> [#uses=6]
- %ulong1 = add i64 0, 0 ; <i64> [#uses=6]
- %ulong2 = add i64 0, 0 ; <i64> [#uses=6]
- %ushort1 = add i16 0, 0 ; <i16> [#uses=6]
- %ushort2 = add i16 0, 0 ; <i16> [#uses=6]
- %test1 = icmp eq i8 %ubyte1, %ubyte2 ; <i1> [#uses=0]
- %test2 = icmp uge i8 %ubyte1, %ubyte2 ; <i1> [#uses=0]
- %test3 = icmp ugt i8 %ubyte1, %ubyte2 ; <i1> [#uses=0]
- %test4 = icmp ule i8 %ubyte1, %ubyte2 ; <i1> [#uses=0]
- %test5 = icmp ult i8 %ubyte1, %ubyte2 ; <i1> [#uses=0]
- %test6 = icmp ne i8 %ubyte1, %ubyte2 ; <i1> [#uses=0]
- %test7 = icmp eq i16 %ushort1, %ushort2 ; <i1> [#uses=0]
- %test8 = icmp uge i16 %ushort1, %ushort2 ; <i1> [#uses=0]
- %test9 = icmp ugt i16 %ushort1, %ushort2 ; <i1> [#uses=0]
- %test10 = icmp ule i16 %ushort1, %ushort2 ; <i1> [#uses=0]
- %test11 = icmp ult i16 %ushort1, %ushort2 ; <i1> [#uses=0]
- %test12 = icmp ne i16 %ushort1, %ushort2 ; <i1> [#uses=0]
- %test13 = icmp eq i32 %uint1, %uint2 ; <i1> [#uses=0]
- %test14 = icmp uge i32 %uint1, %uint2 ; <i1> [#uses=0]
- %test15 = icmp ugt i32 %uint1, %uint2 ; <i1> [#uses=0]
- %test16 = icmp ule i32 %uint1, %uint2 ; <i1> [#uses=0]
- %test17 = icmp ult i32 %uint1, %uint2 ; <i1> [#uses=0]
- %test18 = icmp ne i32 %uint1, %uint2 ; <i1> [#uses=0]
- %test19 = icmp eq i64 %ulong1, %ulong2 ; <i1> [#uses=0]
- %test20 = icmp uge i64 %ulong1, %ulong2 ; <i1> [#uses=0]
- %test21 = icmp ugt i64 %ulong1, %ulong2 ; <i1> [#uses=0]
- %test22 = icmp ule i64 %ulong1, %ulong2 ; <i1> [#uses=0]
- %test23 = icmp ult i64 %ulong1, %ulong2 ; <i1> [#uses=0]
- %test24 = icmp ne i64 %ulong1, %ulong2 ; <i1> [#uses=0]
- %test25 = icmp eq i8 %sbyte1, %sbyte2 ; <i1> [#uses=0]
- %test26 = icmp sge i8 %sbyte1, %sbyte2 ; <i1> [#uses=0]
- %test27 = icmp sgt i8 %sbyte1, %sbyte2 ; <i1> [#uses=0]
- %test28 = icmp sle i8 %sbyte1, %sbyte2 ; <i1> [#uses=0]
- %test29 = icmp slt i8 %sbyte1, %sbyte2 ; <i1> [#uses=0]
- %test30 = icmp ne i8 %sbyte1, %sbyte2 ; <i1> [#uses=0]
- %test31 = icmp eq i16 %short1, %short2 ; <i1> [#uses=0]
- %test32 = icmp sge i16 %short1, %short2 ; <i1> [#uses=0]
- %test33 = icmp sgt i16 %short1, %short2 ; <i1> [#uses=0]
- %test34 = icmp sle i16 %short1, %short2 ; <i1> [#uses=0]
- %test35 = icmp slt i16 %short1, %short2 ; <i1> [#uses=0]
- %test36 = icmp ne i16 %short1, %short2 ; <i1> [#uses=0]
- %test37 = icmp eq i32 %int1, %int2 ; <i1> [#uses=0]
- %test38 = icmp sge i32 %int1, %int2 ; <i1> [#uses=0]
- %test39 = icmp sgt i32 %int1, %int2 ; <i1> [#uses=0]
- %test40 = icmp sle i32 %int1, %int2 ; <i1> [#uses=0]
- %test41 = icmp slt i32 %int1, %int2 ; <i1> [#uses=0]
- %test42 = icmp ne i32 %int1, %int2 ; <i1> [#uses=0]
- %test43 = icmp eq i64 %long1, %long2 ; <i1> [#uses=0]
- %test44 = icmp sge i64 %long1, %long2 ; <i1> [#uses=0]
- %test45 = icmp sgt i64 %long1, %long2 ; <i1> [#uses=0]
- %test46 = icmp sle i64 %long1, %long2 ; <i1> [#uses=0]
- %test47 = icmp slt i64 %long1, %long2 ; <i1> [#uses=0]
- %test48 = icmp ne i64 %long1, %long2 ; <i1> [#uses=0]
- ret i32 0
-}
diff --git a/release_23/test/ExecutionEngine/test-shift.ll b/release_23/test/ExecutionEngine/test-shift.ll
deleted file mode 100644
index ebb85d3e8aed..000000000000
--- a/release_23/test/ExecutionEngine/test-shift.ll
+++ /dev/null
@@ -1,33 +0,0 @@
-; RUN: llvm-as < %s -f -o %t.bc
-; RUN: lli %t.bc > /dev/null
-
-define i32 @main() {
- %shamt = add i8 0, 1 ; <i8> [#uses=8]
- %shift.upgrd.1 = zext i8 %shamt to i32 ; <i32> [#uses=1]
- %t1.s = shl i32 1, %shift.upgrd.1 ; <i32> [#uses=0]
- %t2.s = shl i32 1, 4 ; <i32> [#uses=0]
- %shift.upgrd.2 = zext i8 %shamt to i32 ; <i32> [#uses=1]
- %t1 = shl i32 1, %shift.upgrd.2 ; <i32> [#uses=0]
- %t2 = shl i32 1, 5 ; <i32> [#uses=0]
- %t2.s.upgrd.3 = shl i64 1, 4 ; <i64> [#uses=0]
- %t2.upgrd.4 = shl i64 1, 5 ; <i64> [#uses=0]
- %shift.upgrd.5 = zext i8 %shamt to i32 ; <i32> [#uses=1]
- %tr1.s = ashr i32 1, %shift.upgrd.5 ; <i32> [#uses=0]
- %tr2.s = ashr i32 1, 4 ; <i32> [#uses=0]
- %shift.upgrd.6 = zext i8 %shamt to i32 ; <i32> [#uses=1]
- %tr1 = lshr i32 1, %shift.upgrd.6 ; <i32> [#uses=0]
- %tr2 = lshr i32 1, 5 ; <i32> [#uses=0]
- %tr1.l = ashr i64 1, 4 ; <i64> [#uses=0]
- %shift.upgrd.7 = zext i8 %shamt to i64 ; <i64> [#uses=1]
- %tr2.l = ashr i64 1, %shift.upgrd.7 ; <i64> [#uses=0]
- %tr3.l = shl i64 1, 4 ; <i64> [#uses=0]
- %shift.upgrd.8 = zext i8 %shamt to i64 ; <i64> [#uses=1]
- %tr4.l = shl i64 1, %shift.upgrd.8 ; <i64> [#uses=0]
- %tr1.u = lshr i64 1, 5 ; <i64> [#uses=0]
- %shift.upgrd.9 = zext i8 %shamt to i64 ; <i64> [#uses=1]
- %tr2.u = lshr i64 1, %shift.upgrd.9 ; <i64> [#uses=0]
- %tr3.u = shl i64 1, 5 ; <i64> [#uses=0]
- %shift.upgrd.10 = zext i8 %shamt to i64 ; <i64> [#uses=1]
- %tr4.u = shl i64 1, %shift.upgrd.10 ; <i64> [#uses=0]
- ret i32 0
-}
diff --git a/release_23/test/Feature/README.txt b/release_23/test/Feature/README.txt
deleted file mode 100644
index 5947bb21f0b7..000000000000
--- a/release_23/test/Feature/README.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-This directory contains test cases for individual source features of LLVM.
-It is designed to make sure that the major components of LLVM support all of the
-features of LLVM, for very small examples. Entire programs should not go here.
-
-Regression tests for individual bug fixes should go into the test/Regression dir.
-
diff --git a/release_23/test/Feature/aliases.ll b/release_23/test/Feature/aliases.ll
deleted file mode 100644
index d44dff4c43c6..000000000000
--- a/release_23/test/Feature/aliases.ll
+++ /dev/null
@@ -1,32 +0,0 @@
-; RUN: llvm-as < %s | llvm-dis > %t1.ll
-; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
-; RUN: diff %t1.ll %t2.ll
-
-@bar = external global i32
-@foo1 = alias i32* @bar
-@foo2 = alias i32* @bar
-@foo3 = alias i32* @foo2
-
-%FunTy = type i32()
-
-declare i32 @foo_f()
-@bar_f = alias weak %FunTy* @foo_f
-@bar_ff = alias i32()* @bar_f
-
-@bar_i = alias internal i32* @bar
-
-@A = alias bitcast (i32* @bar to i64*)
-
-define i32 @test() {
-entry:
- %tmp = load i32* @foo1
- %tmp1 = load i32* @foo2
- %tmp0 = load i32* @bar_i
- %tmp2 = call i32 @foo_f()
- %tmp3 = add i32 %tmp, %tmp2
- %tmp4 = call %FunTy* @bar_f()
- %tmp5 = add i32 %tmp3, %tmp4
- %tmp6 = add i32 %tmp1, %tmp5
- %tmp7 = add i32 %tmp6, %tmp0
- ret i32 %tmp7
-}
diff --git a/release_23/test/Feature/alignment.ll b/release_23/test/Feature/alignment.ll
deleted file mode 100644
index 409efebe84ba..000000000000
--- a/release_23/test/Feature/alignment.ll
+++ /dev/null
@@ -1,21 +0,0 @@
-; RUN: llvm-as < %s | llvm-dis > %t1.ll
-; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
-; RUN: diff %t1.ll %t2.ll
-
-@X = global i32 4, align 16 ; <i32*> [#uses=0]
-
-define i32* @test() align 32 {
- %X = alloca i32, align 4 ; <i32*> [#uses=1]
- %Y = alloca i32, i32 42, align 16 ; <i32*> [#uses=0]
- %Z = alloca i32 ; <i32*> [#uses=0]
- ret i32* %X
-}
-
-define i32* @test2() {
- %X = malloc i32, align 4 ; <i32*> [#uses=1]
- %Y = malloc i32, i32 42, align 16 ; <i32*> [#uses=0]
- %Z = malloc i32 ; <i32*> [#uses=0]
- %T = malloc i32, align 256 ; <i32*> [#uses=0]
- ret i32* %X
-}
-
diff --git a/release_23/test/Feature/basictest.ll b/release_23/test/Feature/basictest.ll
deleted file mode 100644
index 2303b593ffea..000000000000
--- a/release_23/test/Feature/basictest.ll
+++ /dev/null
@@ -1,31 +0,0 @@
-; RUN: llvm-as < %s | llvm-dis > %t1.ll
-; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
-; RUN: diff %t1.ll %t2.ll
-
-; Test "stripped" format where nothing is symbolic... this is how the bytecode
-; format looks anyways (except for negative vs positive offsets)...
-;
-
-define void @void(i32, i32) {
- add i32 0, 0 ; <i32>:3 [#uses=2]
- sub i32 0, 4 ; <i32>:4 [#uses=2]
- br label %5
-
-; <label>:5 ; preds = %5, %2
- add i32 %0, %1 ; <i32>:6 [#uses=2]
- sub i32 %6, %4 ; <i32>:7 [#uses=1]
- icmp sle i32 %7, %3 ; <i1>:8 [#uses=1]
- br i1 %8, label %9, label %5
-
-; <label>:9 ; preds = %5
- add i32 %0, %1 ; <i32>:10 [#uses=0]
- sub i32 %6, %4 ; <i32>:11 [#uses=1]
- icmp sle i32 %11, %3 ; <i1>:12 [#uses=0]
- ret void
-}
-
-; This function always returns zero
-define i32 @zarro() {
-Startup:
- ret i32 0
-}
diff --git a/release_23/test/Feature/callingconventions.ll b/release_23/test/Feature/callingconventions.ll
deleted file mode 100644
index d2e9de404fba..000000000000
--- a/release_23/test/Feature/callingconventions.ll
+++ /dev/null
@@ -1,50 +0,0 @@
-; RUN: llvm-as < %s | llvm-dis > %t1.ll
-; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
-; RUN: diff %t1.ll %t2.ll
-
-define fastcc void @foo() {
- ret void
-}
-
-define coldcc void @bar() {
- call fastcc void @foo( )
- ret void
-}
-
-define void @structret({ i8 }* sret %P) {
- call void @structret( { i8 }* sret %P )
- ret void
-}
-
-define void @foo2() {
- ret void
-}
-
-define coldcc void @bar2() {
- call fastcc void @foo( )
- ret void
-}
-
-define cc42 void @bar3() {
- invoke fastcc void @foo( )
- to label %Ok unwind label %U
-
-Ok: ; preds = %0
- ret void
-
-U: ; preds = %0
- unwind
-}
-
-define void @bar4() {
- call cc42 void @bar( )
- invoke cc42 void @bar3( )
- to label %Ok unwind label %U
-
-Ok: ; preds = %0
- ret void
-
-U: ; preds = %0
- unwind
-}
-
diff --git a/release_23/test/Feature/calltest.ll b/release_23/test/Feature/calltest.ll
deleted file mode 100644
index feafd3cd2084..000000000000
--- a/release_23/test/Feature/calltest.ll
+++ /dev/null
@@ -1,32 +0,0 @@
-; RUN: llvm-as < %s | llvm-dis > %t1.ll
-; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
-; RUN: diff %t1.ll %t2.ll
-
-%FunTy = type i32 (i32)
-
-declare i32 @test(i32) ; Test forward declaration merging
-
-define void @invoke(%FunTy* %x) {
- %foo = call i32 %x( i32 123 ) ; <i32> [#uses=0]
- %foo2 = tail call i32 %x( i32 123 ) ; <i32> [#uses=0]
- ret void
-}
-
-define i32 @main(i32 %argc) {
- %retval = call i32 @test( i32 %argc ) ; <i32> [#uses=2]
- %two = add i32 %retval, %retval ; <i32> [#uses=1]
- %retval2 = invoke i32 @test( i32 %argc )
- to label %Next unwind label %Error ; <i32> [#uses=1]
-
-Next: ; preds = %0
- %two2 = add i32 %two, %retval2 ; <i32> [#uses=1]
- call void @invoke( %FunTy* @test )
- ret i32 %two2
-
-Error: ; preds = %0
- ret i32 -1
-}
-
-define i32 @test(i32 %i0) {
- ret i32 %i0
-}
diff --git a/release_23/test/Feature/casttest.ll b/release_23/test/Feature/casttest.ll
deleted file mode 100644
index d9c22ffd180b..000000000000
--- a/release_23/test/Feature/casttest.ll
+++ /dev/null
@@ -1,12 +0,0 @@
-; RUN: llvm-as < %s | llvm-dis > %t1.ll
-; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
-; RUN: diff %t1.ll %t2.ll
-
-define i16 @FunFunc(i64 %x, i8 %z) {
-bb0:
- %cast110 = sext i8 %z to i16 ; <i16> [#uses=1]
- %cast10 = trunc i64 %x to i16 ; <i16> [#uses=1]
- %reg109 = add i16 %cast110, %cast10 ; <i16> [#uses=1]
- ret i16 %reg109
-}
-
diff --git a/release_23/test/Feature/cfgstructures.ll b/release_23/test/Feature/cfgstructures.ll
deleted file mode 100644
index e667f6d7582f..000000000000
--- a/release_23/test/Feature/cfgstructures.ll
+++ /dev/null
@@ -1,53 +0,0 @@
-; RUN: llvm-as < %s | llvm-dis > %t1.ll
-; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
-; RUN: diff %t1.ll %t2.ll
-
-;; This is an irreducible flow graph
-define void @irreducible(i1 %cond) {
- br i1 %cond, label %X, label %Y
-
-X: ; preds = %Y, %0
- br label %Y
-
-Y: ; preds = %X, %0
- br label %X
-}
-
-;; This is a pair of loops that share the same header
-define void @sharedheader(i1 %cond) {
- br label %A
-
-A: ; preds = %Y, %X, %0
- br i1 %cond, label %X, label %Y
-
-X: ; preds = %A
- br label %A
-
-Y: ; preds = %A
- br label %A
-}
-
-
-;; This is a simple nested loop
-define void @nested(i1 %cond1, i1 %cond2, i1 %cond3) {
- br label %Loop1
-
-Loop1: ; preds = %L2Exit, %0
- br label %Loop2
-
-Loop2: ; preds = %L3Exit, %Loop1
- br label %Loop3
-
-Loop3: ; preds = %Loop3, %Loop2
- br i1 %cond3, label %Loop3, label %L3Exit
-
-L3Exit: ; preds = %Loop3
- br i1 %cond2, label %Loop2, label %L2Exit
-
-L2Exit: ; preds = %L3Exit
- br i1 %cond1, label %Loop1, label %L1Exit
-
-L1Exit: ; preds = %L2Exit
- ret void
-}
-
diff --git a/release_23/test/Feature/constexpr.ll b/release_23/test/Feature/constexpr.ll
deleted file mode 100644
index 13e6f365aabf..000000000000
--- a/release_23/test/Feature/constexpr.ll
+++ /dev/null
@@ -1,80 +0,0 @@
-; RUN: llvm-as < %s | llvm-dis > %t1.ll
-; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
-; RUN: diff %t1.ll %t2.ll
-
-; This testcase is for testing expressions constructed from
-; constant values, including constant pointers to globals.
-;
-
-;;-------------------------------
-;; Test constant cast expressions
-;;-------------------------------
-
-global i64 u0x00001 ; hexadecimal unsigned integer constants
-global i64 s0x0012312 ; hexadecimal signed integer constants
-
-@t2 = global i32* @t1 ;; Forward reference without cast
-@t3 = global i32* bitcast (i32* @t1 to i32*) ;; Forward reference with cast
-@t1 = global i32 4 ;; i32* @0
-@t4 = global i32** bitcast (i32** @t3 to i32**) ;; Cast of a previous cast
-@t5 = global i32** @t3 ;; Reference to a previous cast
-@t6 = global i32*** @t4 ;; Different ref. to a previous cast
-@t7 = global float* inttoptr (i32 12345678 to float*) ;; Cast ordinary value to ptr
-@t9 = global i32 bitcast (float bitcast (i32 8 to float) to i32) ;; Nested cast expression
-
-global i32* bitcast (float* @4 to i32*) ;; Forward numeric reference
-global float* @4 ;; Duplicate forward numeric reference
-global float 0.0
-
-
-;;---------------------------------------------------
-;; Test constant getelementpr expressions for arrays
-;;---------------------------------------------------
-
-@array = constant [2 x i32] [ i32 12, i32 52 ]
-@arrayPtr = global i32* getelementptr ([2 x i32]* @array, i64 0, i64 0) ;; i32* &@array[0][0]
-@arrayPtr5 = global i32** getelementptr (i32** @arrayPtr, i64 5) ;; i32* &@arrayPtr[5]
-
-@somestr = constant [11x i8] c"hello world"
-@char5 = global i8* getelementptr([11x i8]* @somestr, i64 0, i64 5)
-
-;; cast of getelementptr
-@char8a = global i32* bitcast (i8* getelementptr([11x i8]* @somestr, i64 0, i64 8) to i32*)
-
-;; getelementptr containing casts
-@char8b = global i8* getelementptr([11x i8]* @somestr, i64 sext (i8 0 to i64), i64 sext (i8 8 to i64))
-
-;;-------------------------------------------------------
-;; TODO: Test constant getelementpr expressions for structures
-;;-------------------------------------------------------
-
-%SType = type { i32 , {float, {i8} }, i64 } ;; struct containing struct
-%SAType = type { i32 , {[2x float], i64} } ;; struct containing array
-
-@S1 = global %SType* null ;; Global initialized to NULL
-@S2c = constant %SType { i32 1, {float,{i8}} {float 2.0, {i8} {i8 3}}, i64 4}
-
-@S3c = constant %SAType { i32 1, {[2x float], i64} {[2x float] [float 2.0, float 3.0], i64 4} }
-
-@S1ptr = global %SType** @S1 ;; Ref. to global S1
-@S2 = global %SType* @S2c ;; Ref. to constant S2
-@S3 = global %SAType* @S3c ;; Ref. to constant S3
-
- ;; Pointer to float (**@S1).1.0
-@S1fld1a = global float* getelementptr (%SType* @S2c, i64 0, i32 1, i32 0)
- ;; Another ptr to the same!
-@S1fld1b = global float* getelementptr (%SType* @S2c, i64 0, i32 1, i32 0)
-
-@S1fld1bptr = global float** @S1fld1b ;; Ref. to previous pointer
-
- ;; Pointer to i8 (**@S2).1.1.0
-@S2fld3 = global i8* getelementptr (%SType* @S2c, i64 0, i32 1, i32 1, i32 0)
-
- ;; Pointer to float (**@S2).1.0[0]
-;@S3fld3 = global float* getelementptr (%SAType** @S3, i64 0, i64 0, i32 1, i32 0, i64 0)
-
-;;---------------------------------------------------------
-;; TODO: Test constant expressions for unary and binary operators
-;;---------------------------------------------------------
-
-;;---------------------------------------------------
diff --git a/release_23/test/Feature/constpointer.ll b/release_23/test/Feature/constpointer.ll
deleted file mode 100644
index 5c1bed194bd0..000000000000
--- a/release_23/test/Feature/constpointer.ll
+++ /dev/null
@@ -1,31 +0,0 @@
-; RUN: llvm-as < %s | llvm-dis > %t1.ll
-; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
-; RUN: diff %t1.ll %t2.ll
-
-; This testcase is primarily used for testing that global values can be used as
-; constant pointer initializers. This is tricky because they can be forward
-; declared and involves an icky bytecode encoding. There is no meaningful
-; optimization that can be performed on this file, it is just here to test
-; assembly and disassembly.
-;
-
-
-@t3 = global i32* @t1 ;; Forward reference
-@t1 = global i32 4
-@t4 = global i32** @t3 ;; reference to reference
-
-@t2 = global i32* @t1
-
-global float * @2 ;; Forward numeric reference
-global float * @2 ;; Duplicate forward numeric reference
-global float 0.0
-global float * @2 ;; Numeric reference
-
-
-@fptr = global void() * @f ;; Forward ref method defn
-declare void @f() ;; External method
-
-@sptr1 = global [11x i8]* @somestr ;; Forward ref to a constant
-@somestr = constant [11x i8] c"hello world"
-@sptr2 = global [11x i8]* @somestr
-
diff --git a/release_23/test/Feature/dg.exp b/release_23/test/Feature/dg.exp
deleted file mode 100644
index 879685ca879d..000000000000
--- a/release_23/test/Feature/dg.exp
+++ /dev/null
@@ -1,3 +0,0 @@
-load_lib llvm.exp
-
-RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
diff --git a/release_23/test/Feature/escaped_label.ll b/release_23/test/Feature/escaped_label.ll
deleted file mode 100644
index 7f5f6197ebd4..000000000000
--- a/release_23/test/Feature/escaped_label.ll
+++ /dev/null
@@ -1,11 +0,0 @@
-; RUN: llvm-as < %s | llvm-dis > %t1.ll
-; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
-; RUN: diff %t1.ll %t2.ll
-
-define i32 @foo() {
- br label %"foo`~!@#$%^&*()-_=+{}[]\\\\|;:',<.>/?"
-
-"foo`~!@#$%^&*()-_=+{}[]\\\\|;:',<.>/?": ; preds = %0
- ret i32 17
-}
-
diff --git a/release_23/test/Feature/float.ll b/release_23/test/Feature/float.ll
deleted file mode 100644
index 632cfb741fa3..000000000000
--- a/release_23/test/Feature/float.ll
+++ /dev/null
@@ -1,6 +0,0 @@
-; RUN: llvm-as < %s | llvm-dis > t1.ll
-; RUN: llvm-as t1.ll -o - | llvm-dis > t2.ll
-; RUN: diff t1.ll t2.ll
-
-@F1 = global float 0x4010000000000000
-@D1 = global double 0x4010000000000000
diff --git a/release_23/test/Feature/fold-fpcast.ll b/release_23/test/Feature/fold-fpcast.ll
deleted file mode 100644
index cdf8da69f680..000000000000
--- a/release_23/test/Feature/fold-fpcast.ll
+++ /dev/null
@@ -1,18 +0,0 @@
-; RUN: llvm-as < %s | llvm-dis | not grep bitcast
-
-define i32 @test1() {
- ret i32 bitcast(float 0x400D9999A0000000 to i32)
-}
-
-define float @test2() {
- ret float bitcast(i32 17 to float)
-}
-
-define i64 @test3() {
- ret i64 bitcast (double 0x400921FB4D12D84A to i64)
-}
-
-define double @test4() {
- ret double bitcast (i64 42 to double)
-}
-
diff --git a/release_23/test/Feature/forwardreftest.ll b/release_23/test/Feature/forwardreftest.ll
deleted file mode 100644
index 26d214ae8835..000000000000
--- a/release_23/test/Feature/forwardreftest.ll
+++ /dev/null
@@ -1,29 +0,0 @@
-; RUN: llvm-as < %s | llvm-dis > %t1.ll
-; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
-; RUN: diff %t1.ll %t2.ll
-
-%myty = type i32
-%myfn = type float (i32,double,i32,i16)
-type i32(%myfn*)
-type i32(i32)
-type i32(i32(i32)*)
-
- %thisfuncty = type i32 (i32) *
-
-declare void @F(%thisfuncty, %thisfuncty, %thisfuncty)
-
-define i32 @zarro(i32 %Func) {
-Startup:
- add i32 0, 10 ; <i32>:0 [#uses=0]
- ret i32 0
-}
-
-define i32 @test(i32) {
- call void @F( %thisfuncty @zarro, %thisfuncty @test, %thisfuncty @foozball )
- ret i32 0
-}
-
-define i32 @foozball(i32) {
- ret i32 0
-}
-
diff --git a/release_23/test/Feature/global_section.ll b/release_23/test/Feature/global_section.ll
deleted file mode 100644
index b8f5eb1b666c..000000000000
--- a/release_23/test/Feature/global_section.ll
+++ /dev/null
@@ -1,10 +0,0 @@
-; RUN: llvm-as < %s | llvm-dis > %t1.ll
-; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
-; RUN: diff %t1.ll %t2.ll
-
-@X = global i32 4, section "foo", align 16 ; <i32*> [#uses=0]
-
-define void @test() section "bar" {
- ret void
-}
-
diff --git a/release_23/test/Feature/globalredefinition.ll b/release_23/test/Feature/globalredefinition.ll
deleted file mode 100644
index 42e2d1aeee7c..000000000000
--- a/release_23/test/Feature/globalredefinition.ll
+++ /dev/null
@@ -1,18 +0,0 @@
-; RUN: llvm-as < %s | llvm-dis > %t1.ll
-; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
-; RUN: diff %t1.ll %t2.ll
-
-; Test forward references and redefinitions of globals
-
-@A = global i32* @B ; <i32**> [#uses=0]
-@B = global i32 7 ; <i32*> [#uses=1]
-
-declare void @X()
-
-declare void @X()
-
-define void @X() {
- ret void
-}
-
-declare void @X()
diff --git a/release_23/test/Feature/globalredefinition3.ll b/release_23/test/Feature/globalredefinition3.ll
deleted file mode 100644
index d40d3e9056c9..000000000000
--- a/release_23/test/Feature/globalredefinition3.ll
+++ /dev/null
@@ -1,6 +0,0 @@
-; RUN: not llvm-as < %s -o /dev/null -f |& grep \
-; RUN: "Redefinition of global variable named 'B'"
-; END.
-
-@B = global i32 7
-@B = global i32 7
diff --git a/release_23/test/Feature/globalvars.ll b/release_23/test/Feature/globalvars.ll
deleted file mode 100644
index 9a23775269b1..000000000000
--- a/release_23/test/Feature/globalvars.ll
+++ /dev/null
@@ -1,18 +0,0 @@
-; RUN: llvm-as < %s | llvm-dis > %t1.ll
-; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
-; RUN: diff %t1.ll %t2.ll
-
-@MyVar = external global i32 ; <i32*> [#uses=1]
-@MyIntList = external global { \2*, i32 } ; <{ \2*, i32 }*> [#uses=1]
-external global i32 ; <i32*>:0 [#uses=0]
-@AConst = constant i32 123 ; <i32*> [#uses=0]
-@AString = constant [4 x i8] c"test" ; <[4 x i8]*> [#uses=0]
-@ZeroInit = global { [100 x i32], [40 x float] } zeroinitializer ; <{ [100 x i32], [40 x float] }*> [#uses=0]
-
-define i32 @foo(i32 %blah) {
- store i32 5, i32* @MyVar
- %idx = getelementptr { \2*, i32 }* @MyIntList, i64 0, i32 1 ; <i32*> [#uses=1]
- store i32 12, i32* %idx
- ret i32 %blah
-}
-
diff --git a/release_23/test/Feature/indirectcall.ll b/release_23/test/Feature/indirectcall.ll
deleted file mode 100644
index c1cf39f33746..000000000000
--- a/release_23/test/Feature/indirectcall.ll
+++ /dev/null
@@ -1,49 +0,0 @@
-; RUN: llvm-as < %s | llvm-dis > %t1.ll
-; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
-; RUN: diff %t1.ll %t2.ll
-
-declare i32 @atoi(i8*)
-
-define i64 @fib(i64 %n) {
- icmp ult i64 %n, 2 ; <i1>:1 [#uses=1]
- br i1 %1, label %BaseCase, label %RecurseCase
-
-BaseCase: ; preds = %0
- ret i64 1
-
-RecurseCase: ; preds = %0
- %n2 = sub i64 %n, 2 ; <i64> [#uses=1]
- %n1 = sub i64 %n, 1 ; <i64> [#uses=1]
- %f2 = call i64 @fib( i64 %n2 ) ; <i64> [#uses=1]
- %f1 = call i64 @fib( i64 %n1 ) ; <i64> [#uses=1]
- %result = add i64 %f2, %f1 ; <i64> [#uses=1]
- ret i64 %result
-}
-
-define i64 @realmain(i32 %argc, i8** %argv) {
-; <label>:0
- icmp eq i32 %argc, 2 ; <i1>:1 [#uses=1]
- br i1 %1, label %HasArg, label %Continue
-
-HasArg: ; preds = %0
- %n1 = add i32 1, 1 ; <i32> [#uses=1]
- br label %Continue
-
-Continue: ; preds = %HasArg, %0
- %n = phi i32 [ %n1, %HasArg ], [ 1, %0 ] ; <i32> [#uses=1]
- %N = sext i32 %n to i64 ; <i64> [#uses=1]
- %F = call i64 @fib( i64 %N ) ; <i64> [#uses=1]
- ret i64 %F
-}
-
-define i64 @trampoline(i64 %n, i64 (i64)* %fibfunc) {
- %F = call i64 %fibfunc( i64 %n ) ; <i64> [#uses=1]
- ret i64 %F
-}
-
-define i32 @main() {
- %Result = call i64 @trampoline( i64 10, i64 (i64)* @fib ) ; <i64> [#uses=1]
- %Result.upgrd.1 = trunc i64 %Result to i32 ; <i32> [#uses=1]
- ret i32 %Result.upgrd.1
-}
-
diff --git a/release_23/test/Feature/indirectcall2.ll b/release_23/test/Feature/indirectcall2.ll
deleted file mode 100644
index 1b949fc00e92..000000000000
--- a/release_23/test/Feature/indirectcall2.ll
+++ /dev/null
@@ -1,22 +0,0 @@
-; RUN: llvm-as < %s | llvm-dis > %t1.ll
-; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
-; RUN: diff %t1.ll %t2.ll
-
-define i64 @test(i64 %X) {
- ret i64 %X
-}
-
-define i64 @fib(i64 %n) {
-; <label>:0
- %T = icmp ult i64 %n, 2 ; <i1> [#uses=1]
- br i1 %T, label %BaseCase, label %RecurseCase
-
-RecurseCase: ; preds = %0
- %result = call i64 @test( i64 %n ) ; <i64> [#uses=0]
- br label %BaseCase
-
-BaseCase: ; preds = %RecurseCase, %0
- %X = phi i64 [ 1, %0 ], [ 2, %RecurseCase ] ; <i64> [#uses=1]
- ret i64 %X
-}
-
diff --git a/release_23/test/Feature/inlineasm.ll b/release_23/test/Feature/inlineasm.ll
deleted file mode 100644
index e4318f775b6b..000000000000
--- a/release_23/test/Feature/inlineasm.ll
+++ /dev/null
@@ -1,13 +0,0 @@
-; RUN: llvm-as < %s | llvm-dis > t1.ll
-; RUN: llvm-as t1.ll -o - | llvm-dis > t2.ll
-; RUN: diff t1.ll t2.ll
-
-module asm "this is an inline asm block"
-module asm "this is another inline asm block"
-
-define i32 @test() {
- %X = call i32 asm "tricky here $0, $1", "=r,r"( i32 4 ) ; <i32> [#uses=1]
- call void asm sideeffect "eieio", ""( )
- ret i32 %X
-}
-
diff --git a/release_23/test/Feature/instructions.ll b/release_23/test/Feature/instructions.ll
deleted file mode 100644
index d0c303d71914..000000000000
--- a/release_23/test/Feature/instructions.ll
+++ /dev/null
@@ -1,24 +0,0 @@
-; RUN: llvm-as < %s | llvm-dis > %t1.ll
-; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
-; RUN: diff %t1.ll %t2.ll
-
-define i32 @test_extractelement(<4 x i32> %V) {
- %R = extractelement <4 x i32> %V, i32 1 ; <i32> [#uses=1]
- ret i32 %R
-}
-
-define <4 x i32> @test_insertelement(<4 x i32> %V) {
- %R = insertelement <4 x i32> %V, i32 0, i32 0 ; <<4 x i32>> [#uses=1]
- ret <4 x i32> %R
-}
-
-define <4 x i32> @test_shufflevector_u(<4 x i32> %V) {
- %R = shufflevector <4 x i32> %V, <4 x i32> %V, <4 x i32> < i32 1, i32 undef, i32 7, i32 2 > ; <<4 x i32>> [#uses=1]
- ret <4 x i32> %R
-}
-
-define <4 x float> @test_shufflevector_f(<4 x float> %V) {
- %R = shufflevector <4 x float> %V, <4 x float> undef, <4 x i32> < i32 1, i32 undef, i32 7, i32 2 > ; <<4 x float>> [#uses=1]
- ret <4 x float> %R
-}
-
diff --git a/release_23/test/Feature/intrinsics.ll b/release_23/test/Feature/intrinsics.ll
deleted file mode 100644
index 2dd6b53e7c99..000000000000
--- a/release_23/test/Feature/intrinsics.ll
+++ /dev/null
@@ -1,62 +0,0 @@
-; RUN: llvm-as < %s | llvm-dis > %t1.ll
-; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
-; RUN: diff %t1.ll %t2.ll
-
-declare i1 @llvm.isunordered.f32(float, float)
-
-declare i1 @llvm.isunordered.f64(double, double)
-
-declare void @llvm.prefetch(i8*, i32, i32)
-
-declare i8 @llvm.ctpop.i8(i8)
-
-declare i16 @llvm.ctpop.i16(i16)
-
-declare i32 @llvm.ctpop.i32(i32)
-
-declare i64 @llvm.ctpop.i64(i64)
-
-declare i8 @llvm.cttz.i8(i8)
-
-declare i16 @llvm.cttz.i16(i16)
-
-declare i32 @llvm.cttz.i32(i32)
-
-declare i64 @llvm.cttz.i64(i64)
-
-declare i8 @llvm.ctlz.i8(i8)
-
-declare i16 @llvm.ctlz.i16(i16)
-
-declare i32 @llvm.ctlz.i32(i32)
-
-declare i64 @llvm.ctlz.i64(i64)
-
-declare float @llvm.sqrt.f32(float)
-
-declare double @llvm.sqrt.f64(double)
-
-; Test llvm intrinsics
-;
-define void @libm() {
- fcmp uno float 1.000000e+00, 2.000000e+00 ; <i1>:1 [#uses=0]
- fcmp uno double 3.000000e+00, 4.000000e+00 ; <i1>:2 [#uses=0]
- call void @llvm.prefetch( i8* null, i32 1, i32 3 )
- call float @llvm.sqrt.f32( float 5.000000e+00 ) ; <float>:3 [#uses=0]
- call double @llvm.sqrt.f64( double 6.000000e+00 ) ; <double>:4 [#uses=0]
- call i8 @llvm.ctpop.i8( i8 10 ) ; <i32>:5 [#uses=0]
- call i16 @llvm.ctpop.i16( i16 11 ) ; <i32>:6 [#uses=0]
- call i32 @llvm.ctpop.i32( i32 12 ) ; <i32>:7 [#uses=0]
- call i64 @llvm.ctpop.i64( i64 13 ) ; <i32>:8 [#uses=0]
- call i8 @llvm.ctlz.i8( i8 14 ) ; <i32>:9 [#uses=0]
- call i16 @llvm.ctlz.i16( i16 15 ) ; <i32>:10 [#uses=0]
- call i32 @llvm.ctlz.i32( i32 16 ) ; <i32>:11 [#uses=0]
- call i64 @llvm.ctlz.i64( i64 17 ) ; <i32>:12 [#uses=0]
- call i8 @llvm.cttz.i8( i8 18 ) ; <i32>:13 [#uses=0]
- call i16 @llvm.cttz.i16( i16 19 ) ; <i32>:14 [#uses=0]
- call i32 @llvm.cttz.i32( i32 20 ) ; <i32>:15 [#uses=0]
- call i64 @llvm.cttz.i64( i64 21 ) ; <i32>:16 [#uses=0]
- ret void
-}
-
-; FIXME: test ALL the intrinsics in this file.
diff --git a/release_23/test/Feature/llvm2cpp.exp b/release_23/test/Feature/llvm2cpp.exp
deleted file mode 100644
index b05d64a4a6ad..000000000000
--- a/release_23/test/Feature/llvm2cpp.exp
+++ /dev/null
@@ -1,3 +0,0 @@
-load_lib llvm2cpp.exp
-
-llvm2cpp-test [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx}]]
diff --git a/release_23/test/Feature/llvm2cpp.ll b/release_23/test/Feature/llvm2cpp.ll
deleted file mode 100644
index 651a65bbea92..000000000000
--- a/release_23/test/Feature/llvm2cpp.ll
+++ /dev/null
@@ -1,756 +0,0 @@
-; RUN: llvm-as < %s | llvm-dis > /dev/null
-; RUN: llvm-as < %s | llc -march=cpp -cppgen=program -o -
-
-@X = global i32 4, align 16 ; <i32*> [#uses=0]
-
-define i32* @test1012() align 32 {
- %X = alloca i32, align 4 ; <i32*> [#uses=1]
- %Y = alloca i32, i32 42, align 16 ; <i32*> [#uses=0]
- %Z = alloca i32 ; <i32*> [#uses=0]
- ret i32* %X
-}
-
-define i32* @test1013() {
- %X = malloc i32, align 4 ; <i32*> [#uses=1]
- %Y = malloc i32, i32 42, align 16 ; <i32*> [#uses=0]
- %Z = malloc i32 ; <i32*> [#uses=0]
- ret i32* %X
-}
-
-define void @void(i32, i32) {
- add i32 0, 0 ; <i32>:3 [#uses=2]
- sub i32 0, 4 ; <i32>:4 [#uses=2]
- br label %5
-
-; <label>:5 ; preds = %5, %2
- add i32 %0, %1 ; <i32>:6 [#uses=2]
- sub i32 %6, %4 ; <i32>:7 [#uses=1]
- icmp sle i32 %7, %3 ; <i1>:8 [#uses=1]
- br i1 %8, label %9, label %5
-
-; <label>:9 ; preds = %5
- add i32 %0, %1 ; <i32>:10 [#uses=0]
- sub i32 %6, %4 ; <i32>:11 [#uses=1]
- icmp sle i32 %11, %3 ; <i1>:12 [#uses=0]
- ret void
-}
-
-define i32 @zarro() {
-Startup:
- ret i32 0
-}
-
-define fastcc void @foo() {
- ret void
-}
-
-define coldcc void @bar() {
- call fastcc void @foo( )
- ret void
-}
-
-define void @structret({ i8 }* sret %P) {
- call void @structret( { i8 }* %P sret )
- ret void
-}
-
-define void @foo4() {
- ret void
-}
-
-define coldcc void @bar2() {
- call fastcc void @foo( )
- ret void
-}
-
-define cc42 void @bar3() {
- invoke fastcc void @foo( )
- to label %Ok unwind label %U
-
-Ok: ; preds = %0
- ret void
-
-U: ; preds = %0
- unwind
-}
-
-define void @bar4() {
- call cc42 void @bar( )
- invoke cc42 void @bar3( )
- to label %Ok unwind label %U
-
-Ok: ; preds = %0
- ret void
-
-U: ; preds = %0
- unwind
-}
-; ModuleID = 'calltest.ll'
- %FunTy = type i32 (i32)
-
-define i32 @test1000(i32 %i0) {
- ret i32 %i0
-}
-
-define void @invoke(%FunTy* %x) {
- %foo = call i32 %x( i32 123 ) ; <i32> [#uses=0]
- %foo2 = tail call i32 %x( i32 123 ) ; <i32> [#uses=0]
- ret void
-}
-
-define i32 @main(i32 %argc) {
- %retval = call i32 @test1000( i32 %argc ) ; <i32> [#uses=2]
- %two = add i32 %retval, %retval ; <i32> [#uses=1]
- %retval2 = invoke i32 @test1000( i32 %argc )
- to label %Next unwind label %Error ; <i32> [#uses=1]
-
-Next: ; preds = %0
- %two2 = add i32 %two, %retval2 ; <i32> [#uses=1]
- call void @invoke( %FunTy* @test1000 )
- ret i32 %two2
-
-Error: ; preds = %0
- ret i32 -1
-}
-; ModuleID = 'casttest.ll'
-
-define i16 @FunFunc(i64 %x, i8 %z) {
-bb0:
- %cast110 = sext i8 %z to i16 ; <i16> [#uses=1]
- %cast10 = trunc i64 %x to i16 ; <i16> [#uses=1]
- %reg109 = add i16 %cast110, %cast10 ; <i16> [#uses=1]
- ret i16 %reg109
-}
-; ModuleID = 'cfgstructures.ll'
-
-define void @irreducible(i1 %cond) {
- br i1 %cond, label %X, label %Y
-
-X: ; preds = %Y, %0
- br label %Y
-
-Y: ; preds = %X, %0
- br label %X
-}
-
-define void @sharedheader(i1 %cond) {
- br label %A
-
-A: ; preds = %Y, %X, %0
- br i1 %cond, label %X, label %Y
-
-X: ; preds = %A
- br label %A
-
-Y: ; preds = %A
- br label %A
-}
-
-define void @nested(i1 %cond1, i1 %cond2, i1 %cond3) {
- br label %Loop1
-
-Loop1: ; preds = %L2Exit, %0
- br label %Loop2
-
-Loop2: ; preds = %L3Exit, %Loop1
- br label %Loop3
-
-Loop3: ; preds = %Loop3, %Loop2
- br i1 %cond3, label %Loop3, label %L3Exit
-
-L3Exit: ; preds = %Loop3
- br i1 %cond2, label %Loop2, label %L2Exit
-
-L2Exit: ; preds = %L3Exit
- br i1 %cond1, label %Loop1, label %L1Exit
-
-L1Exit: ; preds = %L2Exit
- ret void
-}
-; ModuleID = 'constexpr.ll'
- %SAType = type { i32, { [2 x float], i64 } }
- %SType = type { i32, { float, { i8 } }, i64 }
-global i64 1 ; <i64*>:0 [#uses=0]
-global i64 74514 ; <i64*>:1 [#uses=0]
-@t2 = global i32* @t1 ; <i32**> [#uses=0]
-@t3 = global i32* @t1 ; <i32**> [#uses=2]
-@t1 = global i32 4 ; <i32*> [#uses=2]
-@t4 = global i32** @t3 ; <i32***> [#uses=1]
-@t5 = global i32** @t3 ; <i32***> [#uses=0]
-@t6 = global i32*** @t4 ; <i32****> [#uses=0]
-@t7 = global float* inttoptr (i32 12345678 to float*) ; <float**> [#uses=0]
-@t9 = global i32 8 ; <i32*> [#uses=0]
-global i32* bitcast (float* @4 to i32*) ; <i32**>:2 [#uses=0]
-global float* @4 ; <float**>:3 [#uses=0]
-global float 0.000000e+00 ; <float*>:4 [#uses=2]
-@array = constant [2 x i32] [ i32 12, i32 52 ] ; <[2 x i32]*> [#uses=1]
-@arrayPtr = global i32* getelementptr ([2 x i32]* @array, i64 0, i64 0) ; <i32**> [#uses=1]
-@arrayPtr5 = global i32** getelementptr (i32** @arrayPtr, i64 5) ; <i32***> [#uses=0]
-@somestr = constant [11 x i8] c"hello world" ; <[11 x i8]*> [#uses=2]
-@char5 = global i8* getelementptr ([11 x i8]* @somestr, i64 0, i64 5) ; <i8**> [#uses=0]
-@char8a = global i32* bitcast (i8* getelementptr ([11 x i8]* @somestr, i64 0, i64 8) to i32*) ; <i32**> [#uses=0]
-@char8b = global i8* getelementptr ([11 x i8]* @somestr, i64 0, i64 8) ; <i8**> [#uses=0]
-@S1 = global %SType* null ; <%SType**> [#uses=1]
-@S2c = constant %SType {
- i32 1,
- { float, { i8 } } { float 2.000000e+00, { i8 } { i8 3 } },
- i64 4 } ; <%SType*> [#uses=3]
-@S3c = constant %SAType { i32 1, { [2 x float], i64 } { [2 x float] [ float 2.000000e+00, float 3.000000e+00 ], i64 4 } } ; <%SAType*> [#uses=1]
-@S1ptr = global %SType** @S1 ; <%SType***> [#uses=0]
-@S2 = global %SType* @S2c ; <%SType**> [#uses=0]
-@S3 = global %SAType* @S3c ; <%SAType**> [#uses=0]
-@S1fld1a = global float* getelementptr (%SType* @S2c, i64 0, i32 1, i32 0) ; <float**> [#uses=0]
-@S1fld1b = global float* getelementptr (%SType* @S2c, i64 0, i32 1, i32 0) ; <float**> [#uses=1]
-@S1fld1bptr = global float** @S1fld1b ; <float***> [#uses=0]
-@S2fld3 = global i8* getelementptr (%SType* @S2c, i64 0, i32 1, i32 1, i32 0) ; <i8**> [#uses=0]
-
-; ModuleID = 'constpointer.ll'
-@cpt3 = global i32* @cpt1 ; <i32**> [#uses=1]
-@cpt1 = global i32 4 ; <i32*> [#uses=2]
-@cpt4 = global i32** @cpt3 ; <i32***> [#uses=0]
-@cpt2 = global i32* @cpt1 ; <i32**> [#uses=0]
-global float* @7 ; <float**>:0 [#uses=0]
-global float* @7 ; <float**>:1 [#uses=0]
-global float 0.000000e+00 ; <float*>:2 [#uses=3]
-global float* @7 ; <float**>:3 [#uses=0]
-@fptr = global void ()* @f ; <void ()**> [#uses=0]
-@sptr1 = global [11 x i8]* @somestr ; <[11 x i8]**> [#uses=0]
-@somestr2 = constant [11 x i8] c"hello world" ; <[11 x i8]*> [#uses=2]
-@sptr2 = global [11 x i8]* @somestr2 ; <[11 x i8]**> [#uses=0]
-
-declare void @f()
-; ModuleID = 'escaped_label.ll'
-
-define i32 @foo3() {
- br label "foo`~!@#$%^&*()-_=+{}[]\\|;:',<.>/?"
-
-"foo`~!@#$%^&*()-_=+{}[]\\|;:',<.>/?": ; preds = %0
- ret i32 17
-}
-; ModuleID = 'float.ll'
-@F1 = global float 4.000000e+00 ; <float*> [#uses=0]
-@D1 = global double 4.000000e+00 ; <double*> [#uses=0]
-; ModuleID = 'fold-fpcast.ll'
-
-define i32 @test1() {
- ret i32 1080872141
-}
-
-define float @test1002() {
- ret float 0x36E1000000000000
-}
-
-define i64 @test3() {
- ret i64 4614256656431372362
-}
-
-define double @test4() {
- ret double 2.075076e-322
-}
-; ModuleID = 'forwardreftest.ll'
- %myfn = type float (i32, double, i32, i16)
- %myty = type i32
- %thisfuncty = type i32 (i32)*
-
-declare void @F(%thisfuncty, %thisfuncty, %thisfuncty)
-
-define i32 @zarro2(i32 %Func) {
-Startup:
- add i32 0, 10 ; <i32>:0 [#uses=0]
- ret i32 0
-}
-
-define i32 @test1004(i32) {
- call void @F( %thisfuncty @zarro2, %thisfuncty @test1004, %thisfuncty @foozball )
- ret i32 0
-}
-
-define i32 @foozball(i32) {
- ret i32 0
-}
-
-; ModuleID = 'globalredefinition.ll'
-@A = global i32* @B ; <i32**> [#uses=0]
-@B = global i32 7 ; <i32*> [#uses=1]
-
-define void @X() {
- ret void
-}
-; ModuleID = 'global_section.ll'
-@GlobSec = global i32 4, section "foo", align 16
-
-define void @test1005() section "bar" {
- ret void
-}
-
-; ModuleID = 'globalvars.ll'
-@MyVar = external global i32 ; <i32*> [#uses=1]
-@MyIntList = external global { \2*, i32 } ; <{ \2*, i32 }*> [#uses=1]
-external global i32 ; <i32*>:0 [#uses=0]
-@AConst = constant i32 123 ; <i32*> [#uses=0]
-@AString = constant [4 x i8] c"test" ; <[4 x i8]*> [#uses=0]
-@ZeroInit = global { [100 x i32], [40 x float] } zeroinitializer ; <{ [100 x i32], [40 x float] }*> [#uses=0]
-
-define i32 @foo10015(i32 %blah) {
- store i32 5, i32* @MyVar
- %idx = getelementptr { \2*, i32 }* @MyIntList, i64 0, i32 1 ; <i32*> [#uses=1]
- store i32 12, i32* %idx
- ret i32 %blah
-}
-; ModuleID = 'indirectcall2.ll'
-
-define i64 @test1006(i64 %X) {
- ret i64 %X
-}
-
-define i64 @fib(i64 %n) {
-; <label>:0
- %T = icmp ult i64 %n, 2 ; <i1> [#uses=1]
- br i1 %T, label %BaseCase, label %RecurseCase
-
-RecurseCase: ; preds = %0
- %result = call i64 @test1006( i64 %n ) ; <i64> [#uses=0]
- br label %BaseCase
-
-BaseCase: ; preds = %RecurseCase, %0
- %X = phi i64 [ 1, %0 ], [ 2, %RecurseCase ] ; <i64> [#uses=1]
- ret i64 %X
-}
-; ModuleID = 'indirectcall.ll'
-
-declare i32 @atoi(i8*)
-
-define i64 @fibonacc(i64 %n) {
- icmp ult i64 %n, 2 ; <i1>:1 [#uses=1]
- br i1 %1, label %BaseCase, label %RecurseCase
-
-BaseCase: ; preds = %0
- ret i64 1
-
-RecurseCase: ; preds = %0
- %n2 = sub i64 %n, 2 ; <i64> [#uses=1]
- %n1 = sub i64 %n, 1 ; <i64> [#uses=1]
- %f2 = call i64 @fibonacc( i64 %n2 ) ; <i64> [#uses=1]
- %f1 = call i64 @fibonacc( i64 %n1 ) ; <i64> [#uses=1]
- %result = add i64 %f2, %f1 ; <i64> [#uses=1]
- ret i64 %result
-}
-
-define i64 @realmain(i32 %argc, i8** %argv) {
-; <label>:0
- icmp eq i32 %argc, 2 ; <i1>:1 [#uses=1]
- br i1 %1, label %HasArg, label %Continue
-
-HasArg: ; preds = %0
- %n1 = add i32 1, 1 ; <i32> [#uses=1]
- br label %Continue
-
-Continue: ; preds = %HasArg, %0
- %n = phi i32 [ %n1, %HasArg ], [ 1, %0 ] ; <i32> [#uses=1]
- %N = sext i32 %n to i64 ; <i64> [#uses=1]
- %F = call i64 @fib( i64 %N ) ; <i64> [#uses=1]
- ret i64 %F
-}
-
-define i64 @trampoline(i64 %n, i64 (i64)* %fibfunc) {
- %F = call i64 %fibfunc( i64 %n ) ; <i64> [#uses=1]
- ret i64 %F
-}
-
-define i32 @main2() {
- %Result = call i64 @trampoline( i64 10, i64 (i64)* @fib ) ; <i64> [#uses=1]
- %Result.upgrd.1 = trunc i64 %Result to i32 ; <i32> [#uses=1]
- ret i32 %Result.upgrd.1
-}
-; ModuleID = 'inlineasm.ll'
-module asm "this is an inline asm block"
-module asm "this is another inline asm block"
-
-define i32 @test1007() {
- %X = call i32 asm "tricky here $0, $1", "=r,r"( i32 4 ) ; <i32> [#uses=1]
- call void asm sideeffect "eieio", ""( )
- ret i32 %X
-}
-; ModuleID = 'instructions.ll'
-
-define i32 @test_extractelement(<4 x i32> %V) {
- %R = extractelement <4 x i32> %V, i32 1 ; <i32> [#uses=1]
- ret i32 %R
-}
-
-define <4 x i32> @test_insertelement(<4 x i32> %V) {
- %R = insertelement <4 x i32> %V, i32 0, i32 0 ; <<4 x i32>> [#uses=1]
- ret <4 x i32> %R
-}
-
-define <4 x i32> @test_shufflevector_u(<4 x i32> %V) {
- %R = shufflevector <4 x i32> %V, <4 x i32> %V, <4 x i32> < i32 1, i32 undef, i32 7, i32 2 > ; <<4 x i32>> [#uses=1]
- ret <4 x i32> %R
-}
-
-define <4 x float> @test_shufflevector_f(<4 x float> %V) {
- %R = shufflevector <4 x float> %V, <4 x float> undef, <4 x i32> < i32 1, i32 undef, i32 7, i32 2 > ; <<4 x float>> [#uses=1]
- ret <4 x float> %R
-}
-; ModuleID = 'intrinsics.ll'
-
-declare i1 @llvm.isunordered.f32(float, float)
-
-declare i1 @llvm.isunordered.f64(double, double)
-
-declare void @llvm.prefetch(i8*, i32, i32)
-
-declare float @llvm.sqrt.f32(float)
-
-declare double @llvm.sqrt.f64(double)
-
-define void @libm() {
- fcmp uno float 1.000000e+00, 2.000000e+00 ; <i1>:1 [#uses=0]
- fcmp uno double 3.000000e+00, 4.000000e+00 ; <i1>:2 [#uses=0]
- call void @llvm.prefetch( i8* null, i32 1, i32 3 )
- call float @llvm.sqrt.f32( float 5.000000e+00 ) ; <float>:3 [#uses=0]
- call double @llvm.sqrt.f64( double 6.000000e+00 ) ; <double>:4 [#uses=0]
- call i8 @llvm.ctpop.i8( i8 10 ) ; <i32>:5 [#uses=1]
- call i16 @llvm.ctpop.i16( i16 11 ) ; <i32>:7 [#uses=1]
- call i32 @llvm.ctpop.i32( i32 12 ) ; <i32>:9 [#uses=1]
- call i64 @llvm.ctpop.i64( i64 13 ) ; <i32>:11 [#uses=1]
- call i8 @llvm.ctlz.i8( i8 14 ) ; <i32>:13 [#uses=1]
- call i16 @llvm.ctlz.i16( i16 15 ) ; <i32>:15 [#uses=1]
- call i32 @llvm.ctlz.i32( i32 16 ) ; <i32>:17 [#uses=1]
- call i64 @llvm.ctlz.i64( i64 17 ) ; <i32>:19 [#uses=1]
- call i8 @llvm.cttz.i8( i8 18 ) ; <i32>:21 [#uses=1]
- call i16 @llvm.cttz.i16( i16 19 ) ; <i32>:23 [#uses=1]
- call i32 @llvm.cttz.i32( i32 20 ) ; <i32>:25 [#uses=1]
- call i64 @llvm.cttz.i64( i64 21 ) ; <i32>:27 [#uses=1]
- ret void
-}
-
-declare i8 @llvm.ctpop.i8(i8)
-
-declare i16 @llvm.ctpop.i16(i16)
-
-declare i32 @llvm.ctpop.i32(i32)
-
-declare i64 @llvm.ctpop.i64(i64)
-
-declare i8 @llvm.ctlz.i8(i8)
-
-declare i16 @llvm.ctlz.i16(i16)
-
-declare i32 @llvm.ctlz.i32(i32)
-
-declare i64 @llvm.ctlz.i64(i64)
-
-declare i8 @llvm.cttz.i8(i8)
-
-declare i16 @llvm.cttz.i16(i16)
-
-declare i32 @llvm.cttz.i32(i32)
-
-declare i64 @llvm.cttz.i64(i64)
-
-; ModuleID = 'packed.ll'
-@foo1 = external global <4 x float> ; <<4 x float>*> [#uses=2]
-@foo102 = external global <2 x i32> ; <<2 x i32>*> [#uses=2]
-
-define void @main3() {
- store <4 x float> < float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00 >, <4 x float>* @foo1
- store <2 x i32> < i32 4, i32 4 >, <2 x i32>* @foo102
- %l1 = load <4 x float>* @foo1 ; <<4 x float>> [#uses=0]
- %l2 = load <2 x i32>* @foo102 ; <<2 x i32>> [#uses=0]
- ret void
-}
-
-; ModuleID = 'properties.ll'
-target datalayout = "e-p:32:32"
-target triple = "proc-vend-sys"
-deplibs = [ "m", "c" ]
-; ModuleID = 'prototype.ll'
-
-declare i32 @bar1017(i32 %in)
-
-define i32 @foo1016(i32 %blah) {
- %xx = call i32 @bar1017( i32 %blah ) ; <i32> [#uses=1]
- ret i32 %xx
-}
-
-; ModuleID = 'recursivetype.ll'
- %list = type { %list*, i32 }
-
-declare i8* @malloc(i32)
-
-define void @InsertIntoListTail(%list** %L, i32 %Data) {
-bb1:
- %reg116 = load %list** %L ; <%list*> [#uses=1]
- %cast1004 = inttoptr i64 0 to %list* ; <%list*> [#uses=1]
- %cond1000 = icmp eq %list* %reg116, %cast1004 ; <i1> [#uses=1]
- br i1 %cond1000, label %bb3, label %bb2
-
-bb2: ; preds = %bb2, %bb1
- %reg117 = phi %list** [ %reg118, %bb2 ], [ %L, %bb1 ] ; <%list**> [#uses=1]
- %cast1010 = bitcast %list** %reg117 to %list*** ; <%list***> [#uses=1]
- %reg118 = load %list*** %cast1010 ; <%list**> [#uses=3]
- %reg109 = load %list** %reg118 ; <%list*> [#uses=1]
- %cast1005 = inttoptr i64 0 to %list* ; <%list*> [#uses=1]
- %cond1001 = icmp ne %list* %reg109, %cast1005 ; <i1> [#uses=1]
- br i1 %cond1001, label %bb2, label %bb3
-
-bb3: ; preds = %bb2, %bb1
- %reg119 = phi %list** [ %reg118, %bb2 ], [ %L, %bb1 ] ; <%list**> [#uses=1]
- %cast1006 = bitcast %list** %reg119 to i8** ; <i8**> [#uses=1]
- %reg111 = call i8* @malloc( i32 16 ) ; <i8*> [#uses=3]
- store i8* %reg111, i8** %cast1006
- %reg111.upgrd.1 = ptrtoint i8* %reg111 to i64 ; <i64> [#uses=1]
- %reg1002 = add i64 %reg111.upgrd.1, 8 ; <i64> [#uses=1]
- %reg1002.upgrd.2 = inttoptr i64 %reg1002 to i8* ; <i8*> [#uses=1]
- %cast1008 = bitcast i8* %reg1002.upgrd.2 to i32* ; <i32*> [#uses=1]
- store i32 %Data, i32* %cast1008
- %cast1003 = inttoptr i64 0 to i64* ; <i64*> [#uses=1]
- %cast1009 = bitcast i8* %reg111 to i64** ; <i64**> [#uses=1]
- store i64* %cast1003, i64** %cast1009
- ret void
-}
-
-define %list* @FindData(%list* %L, i32 %Data) {
-bb1:
- br label %bb2
-
-bb2: ; preds = %bb6, %bb1
- %reg115 = phi %list* [ %reg116, %bb6 ], [ %L, %bb1 ] ; <%list*> [#uses=4]
- %cast1014 = inttoptr i64 0 to %list* ; <%list*> [#uses=1]
- %cond1011 = icmp ne %list* %reg115, %cast1014 ; <i1> [#uses=1]
- br i1 %cond1011, label %bb4, label %bb3
-
-bb3: ; preds = %bb2
- ret %list* null
-
-bb4: ; preds = %bb2
- %idx = getelementptr %list* %reg115, i64 0, i32 1 ; <i32*> [#uses=1]
- %reg111 = load i32* %idx ; <i32> [#uses=1]
- %cond1013 = icmp ne i32 %reg111, %Data ; <i1> [#uses=1]
- br i1 %cond1013, label %bb6, label %bb5
-
-bb5: ; preds = %bb4
- ret %list* %reg115
-
-bb6: ; preds = %bb4
- %idx2 = getelementptr %list* %reg115, i64 0, i32 0 ; <%list**> [#uses=1]
- %reg116 = load %list** %idx2 ; <%list*> [#uses=1]
- br label %bb2
-}
-; ModuleID = 'simplecalltest.ll'
- %FunTy = type i32 (i32)
-
-define void @invoke1019(%FunTy* %x) {
- %foo = call i32 %x( i32 123 ) ; <i32> [#uses=0]
- ret void
-}
-
-define i32 @main4(i32 %argc, i8** %argv, i8** %envp) {
- %retval = call i32 @test1008( i32 %argc ) ; <i32> [#uses=2]
- %two = add i32 %retval, %retval ; <i32> [#uses=1]
- %retval2 = call i32 @test1008( i32 %argc ) ; <i32> [#uses=1]
- %two2 = add i32 %two, %retval2 ; <i32> [#uses=1]
- call void @invoke1019( %FunTy* @test1008 )
- ret i32 %two2
-}
-
-define i32 @test1008(i32 %i0) {
- ret i32 %i0
-}
-; ModuleID = 'smallest.ll'
-; ModuleID = 'small.ll'
- %x = type i32
-
-define i32 @foo1020(i32 %in) {
-label:
- ret i32 2
-}
-; ModuleID = 'testalloca.ll'
- %inners = type { float, { i8 } }
- %struct = type { i32, %inners, i64 }
-
-define i32 @testfunction(i32 %i0, i32 %j0) {
- alloca i8, i32 5 ; <i8*>:1 [#uses=0]
- %ptr = alloca i32 ; <i32*> [#uses=2]
- store i32 3, i32* %ptr
- %val = load i32* %ptr ; <i32> [#uses=0]
- %sptr = alloca %struct ; <%struct*> [#uses=2]
- %nsptr = getelementptr %struct* %sptr, i64 0, i32 1 ; <%inners*> [#uses=1]
- %ubsptr = getelementptr %inners* %nsptr, i64 0, i32 1 ; <{ i8 }*> [#uses=1]
- %idx = getelementptr { i8 }* %ubsptr, i64 0, i32 0 ; <i8*> [#uses=1]
- store i8 4, i8* %idx
- %fptr = getelementptr %struct* %sptr, i64 0, i32 1, i32 0 ; <float*> [#uses=1]
- store float 4.000000e+00, float* %fptr
- ret i32 3
-}
-; ModuleID = 'testconstants.ll'
-@somestr3 = constant [11 x i8] c"hello world"
-@array99 = constant [2 x i32] [ i32 12, i32 52 ]
-constant { i32, i32 } { i32 4, i32 3 } ; <{ i32, i32 }*>:0 [#uses=0]
-
-define [2 x i32]* @testfunction99(i32 %i0, i32 %j0) {
- ret [2 x i32]* @array
-}
-
-define i8* @otherfunc(i32, double) {
- %somestr = getelementptr [11 x i8]* @somestr3, i64 0, i64 0 ; <i8*> [#uses=1]
- ret i8* %somestr
-}
-
-define i8* @yetanotherfunc(i32, double) {
- ret i8* null
-}
-
-define i32 @negativeUnsigned() {
- ret i32 -1
-}
-
-define i32 @largeSigned() {
- ret i32 -394967296
-}
-; ModuleID = 'testlogical.ll'
-
-define i32 @simpleAdd(i32 %i0, i32 %j0) {
- %t1 = xor i32 %i0, %j0 ; <i32> [#uses=1]
- %t2 = or i32 %i0, %j0 ; <i32> [#uses=1]
- %t3 = and i32 %t1, %t2 ; <i32> [#uses=1]
- ret i32 %t3
-}
-; ModuleID = 'testmemory.ll'
- %complexty = type { i32, { [4 x i8*], float }, double }
- %struct = type { i32, { float, { i8 } }, i64 }
-
-define i32 @main6() {
- call i32 @testfunction98( i64 0, i64 1 )
- ret i32 0
-}
-
-define i32 @testfunction98(i64 %i0, i64 %j0) {
- %array0 = malloc [4 x i8] ; <[4 x i8]*> [#uses=2]
- %size = add i32 2, 2 ; <i32> [#uses=1]
- %array1 = malloc i8, i32 4 ; <i8*> [#uses=1]
- %array2 = malloc i8, i32 %size ; <i8*> [#uses=1]
- %idx = getelementptr [4 x i8]* %array0, i64 0, i64 2 ; <i8*> [#uses=1]
- store i8 123, i8* %idx
- free [4 x i8]* %array0
- free i8* %array1
- free i8* %array2
- %aa = alloca %complexty, i32 5 ; <%complexty*> [#uses=1]
- %idx2 = getelementptr %complexty* %aa, i64 %i0, i32 1, i32 0, i64 %j0 ; <i8**> [#uses=1]
- store i8* null, i8** %idx2
- %ptr = alloca i32 ; <i32*> [#uses=2]
- store i32 3, i32* %ptr
- %val = load i32* %ptr ; <i32> [#uses=0]
- %sptr = alloca %struct ; <%struct*> [#uses=1]
- %ubsptr = getelementptr %struct* %sptr, i64 0, i32 1, i32 1 ; <{ i8 }*> [#uses=1]
- %idx3 = getelementptr { i8 }* %ubsptr, i64 0, i32 0 ; <i8*> [#uses=1]
- store i8 4, i8* %idx3
- ret i32 3
-}
-; ModuleID = 'testswitch.ll'
- %int = type i32
-
-define i32 @squared(i32 %i0) {
- switch i32 %i0, label %Default [
- i32 1, label %Case1
- i32 2, label %Case2
- i32 4, label %Case4
- ]
-
-Default: ; preds = %0
- ret i32 -1
-
-Case1: ; preds = %0
- ret i32 1
-
-Case2: ; preds = %0
- ret i32 4
-
-Case4: ; preds = %0
- ret i32 16
-}
-; ModuleID = 'testvarargs.ll'
-
-declare i32 @printf(i8*, ...)
-
-define i32 @testvarar() {
- call i32 (i8*, ...)* @printf( i8* null, i32 12, i8 42 ) ; <i32>:1 [#uses=1]
- ret i32 %1
-}
-; ModuleID = 'undefined.ll'
-@X2 = global i32 undef ; <i32*> [#uses=0]
-
-declare i32 @atoi(i8*)
-
-define i32 @test1009() {
- ret i32 undef
-}
-
-define i32 @test1003() {
- %X = add i32 undef, 1 ; <i32> [#uses=1]
- ret i32 %X
-}
-; ModuleID = 'unreachable.ll'
-
-declare void @bar()
-
-define i32 @foo1021() {
- unreachable
-}
-
-define double @xyz() {
- call void @bar( )
- unreachable
-}
-; ModuleID = 'varargs.ll'
-
-declare void @llvm.va_start(i8* %ap)
-
-declare void @llvm.va_copy(i8* %aq, i8* %ap)
-
-declare void @llvm.va_end(i8* %ap)
-
-define i32 @test1010(i32 %X, ...) {
- %ap = alloca i8* ; <i8**> [#uses=4]
- %va.upgrd.1 = bitcast i8** %ap to i8* ; <i8*> [#uses=1]
- call void @llvm.va_start( i8* %va.upgrd.1 )
- %tmp = va_arg i8** %ap, i32 ; <i32> [#uses=1]
- %aq = alloca i8* ; <i8**> [#uses=2]
- %va0.upgrd.2 = bitcast i8** %aq to i8* ; <i8*> [#uses=1]
- %va1.upgrd.3 = bitcast i8** %ap to i8* ; <i8*> [#uses=1]
- call void @llvm.va_copy( i8* %va0.upgrd.2, i8* %va1.upgrd.3 )
- %va.upgrd.4 = bitcast i8** %aq to i8* ; <i8*> [#uses=1]
- call void @llvm.va_end( i8* %va.upgrd.4 )
- %va.upgrd.5 = bitcast i8** %ap to i8* ; <i8*> [#uses=1]
- call void @llvm.va_end( i8* %va.upgrd.5 )
- ret i32 %tmp
-}
-; ModuleID = 'varargs_new.ll'
-
-declare void @llvm.va_start(i8*)
-
-declare void @llvm.va_copy(i8*, i8*)
-
-declare void @llvm.va_end(i8*)
-
-define i32 @test1011(i32 %X, ...) {
- %ap = alloca i8* ; <i8**> [#uses=4]
- %aq = alloca i8* ; <i8**> [#uses=2]
- %va.upgrd.1 = bitcast i8** %ap to i8* ; <i8*> [#uses=1]
- call void @llvm.va_start( i8* %va.upgrd.1 )
- %tmp = va_arg i8** %ap, i32 ; <i32> [#uses=1]
- %apv = load i8** %ap ; <i8*> [#uses=1]
- %va0.upgrd.2 = bitcast i8** %aq to i8* ; <i8*> [#uses=1]
- %va1.upgrd.3 = bitcast i8* %apv to i8* ; <i8*> [#uses=1]
- call void @llvm.va_copy( i8* %va0.upgrd.2, i8* %va1.upgrd.3 )
- %va.upgrd.4 = bitcast i8** %aq to i8* ; <i8*> [#uses=1]
- call void @llvm.va_end( i8* %va.upgrd.4 )
- %va.upgrd.5 = bitcast i8** %ap to i8* ; <i8*> [#uses=1]
- call void @llvm.va_end( i8* %va.upgrd.5 )
- ret i32 %tmp
-}
-; ModuleID = 'weirdnames.ll'
- "&^ " = type { i32 }
-@"%.*+ foo" = global "&^ " { i32 5 } ; <"&^ "*> [#uses=0]
-@"0" = global float 0.000000e+00 ; <float*> [#uses=0]
diff --git a/release_23/test/Feature/load_module.ll b/release_23/test/Feature/load_module.ll
deleted file mode 100644
index 356eceb285ea..000000000000
--- a/release_23/test/Feature/load_module.ll
+++ /dev/null
@@ -1,10 +0,0 @@
-; PR1318
-; RUN: llvm-as < %s | opt -load=%llvmlibsdir/LLVMHello%shlibext -hello \
-; RUN: -disable-output - |& grep Hello
-
-@junk = global i32 0
-
-define i32* @somefunk() {
- ret i32* @junk
-}
-
diff --git a/release_23/test/Feature/newcasts.ll b/release_23/test/Feature/newcasts.ll
deleted file mode 100644
index 4cfc8bcf08e4..000000000000
--- a/release_23/test/Feature/newcasts.ll
+++ /dev/null
@@ -1,33 +0,0 @@
-; RUN: llvm-as < %s | llvm-dis > %t1.ll
-; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
-; RUN: diff %t1.ll %t2.ll
-
-define void @"NewCasts" (i16 %x) {
- %a = zext i16 %x to i32
- %b = sext i16 %x to i32
- %c = trunc i16 %x to i8
- %d = uitofp i16 %x to float
- %e = sitofp i16 %x to double
- %f = fptoui float %d to i16
- %g = fptosi double %e to i16
- %i = fpext float %d to double
- %j = fptrunc double %i to float
- %k = bitcast i32 %a to float
- %l = inttoptr i16 %x to i32*
- %m = ptrtoint i32* %l to i64
- %n = insertelement <4 x i32> undef, i32 %a, i32 0
- %o = sitofp <4 x i32> %n to <4 x float>
- %p = uitofp <4 x i32> %n to <4 x float>
- %q = fptosi <4 x float> %p to <4 x i32>
- %r = fptoui <4 x float> %p to <4 x i32>
- ret void
-}
-
-
-define i16 @"ZExtConst" () {
- ret i16 trunc ( i32 zext ( i16 42 to i32) to i16 )
-}
-
-define i16 @"SExtConst" () {
- ret i16 trunc (i32 sext (i16 42 to i32) to i16 )
-}
diff --git a/release_23/test/Feature/opaquetypes.ll b/release_23/test/Feature/opaquetypes.ll
deleted file mode 100644
index 2ca58a7922be..000000000000
--- a/release_23/test/Feature/opaquetypes.ll
+++ /dev/null
@@ -1,57 +0,0 @@
-; RUN: llvm-as < %s | llvm-dis > %t1.ll
-; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
-; RUN: diff %t1.ll %t2.ll
-
-; This test case is used to test opaque type processing, forward references,
-; and recursive types. Oh my.
-;
-
-%SQ1 = type { i32 }
-%ITy = type opaque
-%SQ2 = type { %ITy }
-%ITy = type i32
-
-
-%CCC = type { \2* }
-%BBB = type { \2*, \2 * }
-%AAA = type { \2*, {\2*}, [12x{\2*}], {[1x{\2*}]} }
-
-; Test numbered types
-type %CCC
-type %BBB
-%Composite = type { %0, %1 }
-
-; Test simple opaque type resolution...
-%intty = type opaque
-%intty = type i32
-
-; Perform a simple forward reference...
-%ty1 = type { %ty2, i32 }
-%ty2 = type float
-
-; Do a recursive type...
-%list = type { %list * }
-%listp = type { %listp } *
-
-; Do two mutually recursive types...
-%TyA = type { %ty2, %TyB * }
-%TyB = type { double, %TyA * }
-
-; A complex recursive type...
-%Y = type { {%Y*}, %Y* }
-%Z = type { { %Z * }, [12x%Z] *, {{{ %Z * }}} }
-
-; More ridiculous test cases...
-%A = type [ 123x %A*]
-%M = type %M (%M, %M) *
-%P = type %P*
-
-; Recursive ptrs
-%u = type %v*
-%v = type %u*
-
-; Test the parser for unnamed recursive types...
-%P1 = type \1 *
-%Y1 = type { { \3 * }, \2 * }
-%Z1 = type { { \3 * }, [12x\3] *, { { { \5 * } } } }
-
diff --git a/release_23/test/Feature/packed.ll b/release_23/test/Feature/packed.ll
deleted file mode 100644
index b86a22792b1d..000000000000
--- a/release_23/test/Feature/packed.ll
+++ /dev/null
@@ -1,15 +0,0 @@
-; RUN: llvm-as < %s | llvm-dis > %t1.ll
-; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
-; RUN: diff %t1.ll %t2.ll
-
-@foo1 = external global <4 x float> ; <<4 x float>*> [#uses=2]
-@foo2 = external global <2 x i32> ; <<2 x i32>*> [#uses=2]
-
-define void @main() {
- store <4 x float> < float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00 >, <4 x float>* @foo1
- store <2 x i32> < i32 4, i32 4 >, <2 x i32>* @foo2
- %l1 = load <4 x float>* @foo1 ; <<4 x float>> [#uses=0]
- %l2 = load <2 x i32>* @foo2 ; <<2 x i32>> [#uses=0]
- ret void
-}
-
diff --git a/release_23/test/Feature/packed_struct.ll b/release_23/test/Feature/packed_struct.ll
deleted file mode 100644
index 5bf609b7772b..000000000000
--- a/release_23/test/Feature/packed_struct.ll
+++ /dev/null
@@ -1,33 +0,0 @@
-; RUN: llvm-as < %s | llvm-dis > %t1.ll
-; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
-; RUN: diff %t1.ll %t2.ll
-; RUN: not grep cast %t2.ll
-; RUN: grep {\<\{} %t2.ll
-; END.
-
-%struct.anon = type <{ i8, i32, i32, i32 }>
-@foos = external global %struct.anon
-@bara = external global [2 x <{ i32, i8 }>]
-
-;initializers should work for packed and non-packed the same way
-@E1 = global <{i8, i32, i32}> <{i8 1, i32 2, i32 3}>
-@E2 = global {i8, i32, i32} {i8 4, i32 5, i32 6}
-
-
-define i32 @main()
-{
- %tmp = load i32* getelementptr (%struct.anon* @foos, i32 0, i32 1) ; <i32> [#uses=1]
- %tmp3 = load i32* getelementptr (%struct.anon* @foos, i32 0, i32 2) ; <i32> [#uses=1]
- %tmp6 = load i32* getelementptr (%struct.anon* @foos, i32 0, i32 3) ; <i32> [#uses=1]
- %tmp4 = add i32 %tmp3, %tmp ; <i32> [#uses=1]
- %tmp7 = add i32 %tmp4, %tmp6 ; <i32> [#uses=1]
- ret i32 %tmp7
-}
-
-define i32 @bar() {
-entry:
- %tmp = load i32* getelementptr([2 x <{ i32, i8 }>]* @bara, i32 0, i32 0, i32 0 ) ; <i32> [#uses=1]
- %tmp4 = load i32* getelementptr ([2 x <{ i32, i8 }>]* @bara, i32 0, i32 1, i32 0) ; <i32> [#uses=1]
- %tmp5 = add i32 %tmp4, %tmp ; <i32> [#uses=1]
- ret i32 %tmp5
-}
diff --git a/release_23/test/Feature/paramattrs.ll b/release_23/test/Feature/paramattrs.ll
deleted file mode 100644
index 3bee6177e0b6..000000000000
--- a/release_23/test/Feature/paramattrs.ll
+++ /dev/null
@@ -1,22 +0,0 @@
-; RUN: llvm-as < %s | llvm-dis > %t1.ll
-; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
-; RUN: diff %t1.ll %t2.ll
-
-%ZFunTy = type i32(i8 zeroext)
-%SFunTy = type i32(i8 signext)
-
-declare i16 @"test"(i16 signext %arg) signext
-declare i8 @"test2" (i16 zeroext %a2) zeroext
-
-declare i32 @"test3"(i32* noalias %p)
-
-declare void @exit(i32) noreturn nounwind
-
-define i32 @main(i32 inreg %argc, i8 ** inreg %argv) nounwind {
- %val = trunc i32 %argc to i16
- %res1 = call i16 (i16 signext) signext *@test(i16 signext %val) signext
- %two = add i16 %res1, %res1
- %res2 = call i8 @test2(i16 %two zeroext) zeroext
- %retVal = sext i16 %two to i32
- ret i32 %retVal
-}
diff --git a/release_23/test/Feature/ppcld.ll b/release_23/test/Feature/ppcld.ll
deleted file mode 100644
index f21eb437c6d0..000000000000
--- a/release_23/test/Feature/ppcld.ll
+++ /dev/null
@@ -1,26 +0,0 @@
-; RUN: llvm-as < %s | llvm-dis > %t
-; RUN: llvm-as < %t | llvm-dis > %t2
-; RUN: diff %t %t2
-; ModuleID = '<stdin>'
-target datalayout = "E-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64"
-target triple = "powerpc-apple-darwin8"
-@ld = external global ppc_fp128 ; <ppc_fp128*> [#uses=1]
-@d = global double 4.050000e+00, align 8 ; <double*> [#uses=1]
-@f = global float 0x4010333340000000 ; <float*> [#uses=1]
-
-define i32 @foo() {
-entry:
- %retval = alloca i32, align 4 ; <i32*> [#uses=1]
- %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
- %tmp = load float* @f ; <float> [#uses=1]
- %tmp1 = fpext float %tmp to double ; <double> [#uses=1]
- %tmp2 = load double* @d ; <double> [#uses=1]
- %tmp3 = mul double %tmp1, %tmp2 ; <double> [#uses=1]
- %tmp4 = fpext double %tmp3 to ppc_fp128 ; <ppc_fp128> [#uses=1]
- store ppc_fp128 %tmp4, ppc_fp128* @ld
- br label %return
-
-return: ; preds = %entry
- %retval4 = load i32* %retval ; <i32> [#uses=1]
- ret i32 %retval4
-}
diff --git a/release_23/test/Feature/properties.ll b/release_23/test/Feature/properties.ll
deleted file mode 100644
index c688d689be28..000000000000
--- a/release_23/test/Feature/properties.ll
+++ /dev/null
@@ -1,7 +0,0 @@
-; RUN: llvm-as < %s | llvm-dis > %t1.ll
-; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
-; RUN: diff %t1.ll %t2.ll
-
-target datalayout = "e-p:32:32"
-target triple = "proc-vend-sys"
-deplibs = [ "m", "c" ]
diff --git a/release_23/test/Feature/prototype.ll b/release_23/test/Feature/prototype.ll
deleted file mode 100644
index 3754a1d9596e..000000000000
--- a/release_23/test/Feature/prototype.ll
+++ /dev/null
@@ -1,11 +0,0 @@
-; RUN: llvm-as < %s | llvm-dis > %t1.ll
-; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
-; RUN: diff %t1.ll %t2.ll
-
-declare i32 @bar(i32)
-
-define i32 @foo(i32 %blah) {
- %xx = call i32 @bar( i32 %blah ) ; <i32> [#uses=1]
- ret i32 %xx
-}
-
diff --git a/release_23/test/Feature/recursivetype.ll b/release_23/test/Feature/recursivetype.ll
deleted file mode 100644
index 43db5f052c40..000000000000
--- a/release_23/test/Feature/recursivetype.ll
+++ /dev/null
@@ -1,103 +0,0 @@
-; RUN: llvm-as < %s | llvm-dis > %t1.ll
-; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
-; RUN: diff %t1.ll %t2.ll
-
-; This file contains the output from the following compiled C code:
-; typedef struct list {
-; struct list *Next;
-; int Data;
-; } list;
-;
-; // Iterative insert fn
-; void InsertIntoListTail(list **L, int Data) {
-; while (*L)
-; L = &(*L)->Next;
-; *L = (list*)malloc(sizeof(list));
-; (*L)->Data = Data;
-; (*L)->Next = 0;
-; }
-;
-; // Recursive list search fn
-; list *FindData(list *L, int Data) {
-; if (L == 0) return 0;
-; if (L->Data == Data) return L;
-; return FindData(L->Next, Data);
-; }
-;
-; void DoListStuff() {
-; list *MyList = 0;
-; InsertIntoListTail(&MyList, 100);
-; InsertIntoListTail(&MyList, 12);
-; InsertIntoListTail(&MyList, 42);
-; InsertIntoListTail(&MyList, 1123);
-; InsertIntoListTail(&MyList, 1213);
-;
-; if (FindData(MyList, 75)) foundIt();
-; if (FindData(MyList, 42)) foundIt();
-; if (FindData(MyList, 700)) foundIt();
-; }
-
-%list = type { %list*, i32 }
-
-declare i8* @malloc(i32)
-
-define void @InsertIntoListTail(%list** %L, i32 %Data) {
-bb1:
- %reg116 = load %list** %L ; <%list*> [#uses=1]
- %cast1004 = inttoptr i64 0 to %list* ; <%list*> [#uses=1]
- %cond1000 = icmp eq %list* %reg116, %cast1004 ; <i1> [#uses=1]
- br i1 %cond1000, label %bb3, label %bb2
-
-bb2: ; preds = %bb2, %bb1
- %reg117 = phi %list** [ %reg118, %bb2 ], [ %L, %bb1 ] ; <%list**> [#uses=1]
- %cast1010 = bitcast %list** %reg117 to %list*** ; <%list***> [#uses=1]
- %reg118 = load %list*** %cast1010 ; <%list**> [#uses=3]
- %reg109 = load %list** %reg118 ; <%list*> [#uses=1]
- %cast1005 = inttoptr i64 0 to %list* ; <%list*> [#uses=1]
- %cond1001 = icmp ne %list* %reg109, %cast1005 ; <i1> [#uses=1]
- br i1 %cond1001, label %bb2, label %bb3
-
-bb3: ; preds = %bb2, %bb1
- %reg119 = phi %list** [ %reg118, %bb2 ], [ %L, %bb1 ] ; <%list**> [#uses=1]
- %cast1006 = bitcast %list** %reg119 to i8** ; <i8**> [#uses=1]
- %reg111 = call i8* @malloc( i32 16 ) ; <i8*> [#uses=3]
- store i8* %reg111, i8** %cast1006
- %reg111.upgrd.1 = ptrtoint i8* %reg111 to i64 ; <i64> [#uses=1]
- %reg1002 = add i64 %reg111.upgrd.1, 8 ; <i64> [#uses=1]
- %reg1002.upgrd.2 = inttoptr i64 %reg1002 to i8* ; <i8*> [#uses=1]
- %cast1008 = bitcast i8* %reg1002.upgrd.2 to i32* ; <i32*> [#uses=1]
- store i32 %Data, i32* %cast1008
- %cast1003 = inttoptr i64 0 to i64* ; <i64*> [#uses=1]
- %cast1009 = bitcast i8* %reg111 to i64** ; <i64**> [#uses=1]
- store i64* %cast1003, i64** %cast1009
- ret void
-}
-
-define %list* @FindData(%list* %L, i32 %Data) {
-bb1:
- br label %bb2
-
-bb2: ; preds = %bb6, %bb1
- %reg115 = phi %list* [ %reg116, %bb6 ], [ %L, %bb1 ] ; <%list*> [#uses=4]
- %cast1014 = inttoptr i64 0 to %list* ; <%list*> [#uses=1]
- %cond1011 = icmp ne %list* %reg115, %cast1014 ; <i1> [#uses=1]
- br i1 %cond1011, label %bb4, label %bb3
-
-bb3: ; preds = %bb2
- ret %list* null
-
-bb4: ; preds = %bb2
- %idx = getelementptr %list* %reg115, i64 0, i32 1 ; <i32*> [#uses=1]
- %reg111 = load i32* %idx ; <i32> [#uses=1]
- %cond1013 = icmp ne i32 %reg111, %Data ; <i1> [#uses=1]
- br i1 %cond1013, label %bb6, label %bb5
-
-bb5: ; preds = %bb4
- ret %list* %reg115
-
-bb6: ; preds = %bb4
- %idx2 = getelementptr %list* %reg115, i64 0, i32 0 ; <%list**> [#uses=1]
- %reg116 = load %list** %idx2 ; <%list*> [#uses=1]
- br label %bb2
-}
-
diff --git a/release_23/test/Feature/simplecalltest.ll b/release_23/test/Feature/simplecalltest.ll
deleted file mode 100644
index 64522864d577..000000000000
--- a/release_23/test/Feature/simplecalltest.ll
+++ /dev/null
@@ -1,24 +0,0 @@
-; RUN: llvm-as < %s | llvm-dis > %t1.ll
-; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
-; RUN: diff %t1.ll %t2.ll
-
- %FunTy = type i32 (i32)
-
-define void @invoke(%FunTy* %x) {
- %foo = call i32 %x( i32 123 ) ; <i32> [#uses=0]
- ret void
-}
-
-define i32 @main(i32 %argc, i8** %argv, i8** %envp) {
- %retval = call i32 @test( i32 %argc ) ; <i32> [#uses=2]
- %two = add i32 %retval, %retval ; <i32> [#uses=1]
- %retval2 = call i32 @test( i32 %argc ) ; <i32> [#uses=1]
- %two2 = add i32 %two, %retval2 ; <i32> [#uses=1]
- call void @invoke( %FunTy* @test )
- ret i32 %two2
-}
-
-define i32 @test(i32 %i0) {
- ret i32 %i0
-}
-
diff --git a/release_23/test/Feature/small.ll b/release_23/test/Feature/small.ll
deleted file mode 100644
index 4644f6421bc2..000000000000
--- a/release_23/test/Feature/small.ll
+++ /dev/null
@@ -1,11 +0,0 @@
-; RUN: llvm-as < %s | llvm-dis > %t1.ll
-; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
-; RUN: diff %t1.ll %t2.ll
-
-%x = type i32
-
-define i32 @foo(i32 %in) {
-label:
- ret i32 2
-}
-
diff --git a/release_23/test/Feature/smallest.ll b/release_23/test/Feature/smallest.ll
deleted file mode 100644
index 5dd023cc602b..000000000000
--- a/release_23/test/Feature/smallest.ll
+++ /dev/null
@@ -1,4 +0,0 @@
-; RUN: llvm-as < %s | llvm-dis > %t1.ll
-; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
-; RUN: diff %t1.ll %t2.ll
-
diff --git a/release_23/test/Feature/sparcld.ll b/release_23/test/Feature/sparcld.ll
deleted file mode 100644
index 2e99bdae3262..000000000000
--- a/release_23/test/Feature/sparcld.ll
+++ /dev/null
@@ -1,24 +0,0 @@
-; RUN: llvm-as < %s | llvm-dis > %t
-; RUN: llvm-as < %t | llvm-dis > %t2
-; RUN: diff %t %t2
-; ModuleID = '<stdin>'
-@ld = external global fp128 ; <fp128*> [#uses=1]
-@d = global double 4.050000e+00, align 8 ; <double*> [#uses=1]
-@f = global float 0x4010333340000000 ; <float*> [#uses=1]
-
-define i32 @foo() {
-entry:
- %retval = alloca i32, align 4 ; <i32*> [#uses=1]
- %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
- %tmp = load float* @f ; <float> [#uses=1]
- %tmp1 = fpext float %tmp to double ; <double> [#uses=1]
- %tmp2 = load double* @d ; <double> [#uses=1]
- %tmp3 = mul double %tmp1, %tmp2 ; <double> [#uses=1]
- %tmp4 = fpext double %tmp3 to fp128 ; <fp128> [#uses=1]
- store fp128 %tmp4, fp128* @ld
- br label %return
-
-return: ; preds = %entry
- %retval4 = load i32* %retval ; <i32> [#uses=1]
- ret i32 %retval4
-}
diff --git a/release_23/test/Feature/testalloca.ll b/release_23/test/Feature/testalloca.ll
deleted file mode 100644
index 230b5a90dc4c..000000000000
--- a/release_23/test/Feature/testalloca.ll
+++ /dev/null
@@ -1,22 +0,0 @@
-; RUN: llvm-as < %s | llvm-dis > %t1.ll
-; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
-; RUN: diff %t1.ll %t2.ll
-
- %inners = type { float, { i8 } }
- %struct = type { i32, %inners, i64 }
-
-define i32 @testfunction(i32 %i0, i32 %j0) {
- alloca i8, i32 5 ; <i8*>:1 [#uses=0]
- %ptr = alloca i32 ; <i32*> [#uses=2]
- store i32 3, i32* %ptr
- %val = load i32* %ptr ; <i32> [#uses=0]
- %sptr = alloca %struct ; <%struct*> [#uses=2]
- %nsptr = getelementptr %struct* %sptr, i64 0, i32 1 ; <%inners*> [#uses=1]
- %ubsptr = getelementptr %inners* %nsptr, i64 0, i32 1 ; <{ i8 }*> [#uses=1]
- %idx = getelementptr { i8 }* %ubsptr, i64 0, i32 0 ; <i8*> [#uses=1]
- store i8 4, i8* %idx
- %fptr = getelementptr %struct* %sptr, i64 0, i32 1, i32 0 ; <float*> [#uses=1]
- store float 4.000000e+00, float* %fptr
- ret i32 3
-}
-
diff --git a/release_23/test/Feature/testconstants.ll b/release_23/test/Feature/testconstants.ll
deleted file mode 100644
index 6810f3de13d4..000000000000
--- a/release_23/test/Feature/testconstants.ll
+++ /dev/null
@@ -1,29 +0,0 @@
-; RUN: llvm-as < %s | llvm-dis > %t1.ll
-; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
-; RUN: diff %t1.ll %t2.ll
-
-@somestr = constant [11 x i8] c"hello world" ; <[11 x i8]*> [#uses=1]
-@array = constant [2 x i32] [ i32 12, i32 52 ] ; <[2 x i32]*> [#uses=1]
-constant { i32, i32 } { i32 4, i32 3 } ; <{ i32, i32 }*>:0 [#uses=0]
-
-define [2 x i32]* @testfunction(i32 %i0, i32 %j0) {
- ret [2 x i32]* @array
-}
-
-define i8* @otherfunc(i32, double) {
- %somestr = getelementptr [11 x i8]* @somestr, i64 0, i64 0 ; <i8*> [#uses=1]
- ret i8* %somestr
-}
-
-define i8* @yetanotherfunc(i32, double) {
- ret i8* null
-}
-
-define i32 @negativeUnsigned() {
- ret i32 -1
-}
-
-define i32 @largeSigned() {
- ret i32 -394967296
-}
-
diff --git a/release_23/test/Feature/testlogical.ll b/release_23/test/Feature/testlogical.ll
deleted file mode 100644
index a064869abfa7..000000000000
--- a/release_23/test/Feature/testlogical.ll
+++ /dev/null
@@ -1,11 +0,0 @@
-; RUN: llvm-as < %s | llvm-dis > %t1.ll
-; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
-; RUN: diff %t1.ll %t2.ll
-
-define i32 @simpleAdd(i32 %i0, i32 %j0) {
- %t1 = xor i32 %i0, %j0 ; <i32> [#uses=1]
- %t2 = or i32 %i0, %j0 ; <i32> [#uses=1]
- %t3 = and i32 %t1, %t2 ; <i32> [#uses=1]
- ret i32 %t3
-}
-
diff --git a/release_23/test/Feature/testmemory.ll b/release_23/test/Feature/testmemory.ll
deleted file mode 100644
index a9019f0bd3e8..000000000000
--- a/release_23/test/Feature/testmemory.ll
+++ /dev/null
@@ -1,36 +0,0 @@
-; RUN: llvm-as < %s | llvm-dis > %t1.ll
-; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
-; RUN: diff %t1.ll %t2.ll
-
-
- %complexty = type { i32, { [4 x i8*], float }, double }
- %struct = type { i32, { float, { i8 } }, i64 }
-
-define i32 @main() {
- call i32 @testfunction( i64 0, i64 1 ) ; <i32>:1 [#uses=0]
- ret i32 0
-}
-
-define i32 @testfunction(i64 %i0, i64 %j0) {
- %array0 = malloc [4 x i8] ; <[4 x i8]*> [#uses=2]
- %size = add i32 2, 2 ; <i32> [#uses=1]
- %array1 = malloc i8, i32 4 ; <i8*> [#uses=1]
- %array2 = malloc i8, i32 %size ; <i8*> [#uses=1]
- %idx = getelementptr [4 x i8]* %array0, i64 0, i64 2 ; <i8*> [#uses=1]
- store i8 123, i8* %idx
- free [4 x i8]* %array0
- free i8* %array1
- free i8* %array2
- %aa = alloca %complexty, i32 5 ; <%complexty*> [#uses=1]
- %idx2 = getelementptr %complexty* %aa, i64 %i0, i32 1, i32 0, i64 %j0 ; <i8**> [#uses=1]
- store i8* null, i8** %idx2
- %ptr = alloca i32 ; <i32*> [#uses=2]
- store i32 3, i32* %ptr
- %val = load i32* %ptr ; <i32> [#uses=0]
- %sptr = alloca %struct ; <%struct*> [#uses=1]
- %ubsptr = getelementptr %struct* %sptr, i64 0, i32 1, i32 1 ; <{ i8 }*> [#uses=1]
- %idx3 = getelementptr { i8 }* %ubsptr, i64 0, i32 0 ; <i8*> [#uses=1]
- store i8 4, i8* %idx3
- ret i32 3
-}
-
diff --git a/release_23/test/Feature/testswitch.ll b/release_23/test/Feature/testswitch.ll
deleted file mode 100644
index 417f56b58d0b..000000000000
--- a/release_23/test/Feature/testswitch.ll
+++ /dev/null
@@ -1,26 +0,0 @@
-; RUN: llvm-as < %s | llvm-dis > %t1.ll
-; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
-; RUN: diff %t1.ll %t2.ll
-
- %int = type i32
-
-define i32 @squared(i32 %i0) {
- switch i32 %i0, label %Default [
- i32 1, label %Case1
- i32 2, label %Case2
- i32 4, label %Case4
- ]
-
-Default: ; preds = %0
- ret i32 -1
-
-Case1: ; preds = %0
- ret i32 1
-
-Case2: ; preds = %0
- ret i32 4
-
-Case4: ; preds = %0
- ret i32 16
-}
-
diff --git a/release_23/test/Feature/testvarargs.ll b/release_23/test/Feature/testvarargs.ll
deleted file mode 100644
index a73b7ecd7d60..000000000000
--- a/release_23/test/Feature/testvarargs.ll
+++ /dev/null
@@ -1,12 +0,0 @@
-; RUN: llvm-as < %s | llvm-dis > %t1.ll
-; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
-; RUN: diff %t1.ll %t2.ll
-
-
-declare i32 @printf(i8*, ...) ;; Prototype for: int __builtin_printf(const char*, ...)
-
-define i32 @testvarar() {
- call i32 (i8*, ...)* @printf( i8* null, i32 12, i8 42 ) ; <i32>:1 [#uses=1]
- ret i32 %1
-}
-
diff --git a/release_23/test/Feature/undefined.ll b/release_23/test/Feature/undefined.ll
deleted file mode 100644
index e63ce41f681b..000000000000
--- a/release_23/test/Feature/undefined.ll
+++ /dev/null
@@ -1,17 +0,0 @@
-; RUN: llvm-as < %s | llvm-dis > %t1.ll
-; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
-; RUN: diff %t1.ll %t2.ll
-
-@X = global i32 undef ; <i32*> [#uses=0]
-
-declare i32 @atoi(i8*)
-
-define i32 @test() {
- ret i32 undef
-}
-
-define i32 @test2() {
- %X = add i32 undef, 1 ; <i32> [#uses=1]
- ret i32 %X
-}
-
diff --git a/release_23/test/Feature/unreachable.ll b/release_23/test/Feature/unreachable.ll
deleted file mode 100644
index 8bffb4c10e7f..000000000000
--- a/release_23/test/Feature/unreachable.ll
+++ /dev/null
@@ -1,15 +0,0 @@
-; RUN: llvm-as < %s | llvm-dis > %t1.ll
-; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
-; RUN: diff %t1.ll %t2.ll
-
-declare void @bar()
-
-define i32 @foo() {
- unreachable
-}
-
-define double @xyz() {
- call void @bar( )
- unreachable
-}
-
diff --git a/release_23/test/Feature/varargs.ll b/release_23/test/Feature/varargs.ll
deleted file mode 100644
index b9317df491af..000000000000
--- a/release_23/test/Feature/varargs.ll
+++ /dev/null
@@ -1,29 +0,0 @@
-; RUN: llvm-as < %s | llvm-dis > %t1.ll
-; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
-; RUN: diff %t1.ll %t2.ll
-
-; Demonstrate all of the variable argument handling intrinsic functions plus
-; the va_arg instruction.
-
-declare void @llvm.va_start(i8*)
-
-declare void @llvm.va_copy(i8*, i8*)
-
-declare void @llvm.va_end(i8*)
-
-define i32 @test(i32 %X, ...) {
- %ap = alloca i8* ; <i8**> [#uses=4]
- %va.upgrd.1 = bitcast i8** %ap to i8* ; <i8*> [#uses=1]
- call void @llvm.va_start( i8* %va.upgrd.1 )
- %tmp = va_arg i8** %ap, i32 ; <i32> [#uses=1]
- %aq = alloca i8* ; <i8**> [#uses=2]
- %va0.upgrd.2 = bitcast i8** %aq to i8* ; <i8*> [#uses=1]
- %va1.upgrd.3 = bitcast i8** %ap to i8* ; <i8*> [#uses=1]
- call void @llvm.va_copy( i8* %va0.upgrd.2, i8* %va1.upgrd.3 )
- %va.upgrd.4 = bitcast i8** %aq to i8* ; <i8*> [#uses=1]
- call void @llvm.va_end( i8* %va.upgrd.4 )
- %va.upgrd.5 = bitcast i8** %ap to i8* ; <i8*> [#uses=1]
- call void @llvm.va_end( i8* %va.upgrd.5 )
- ret i32 %tmp
-}
-
diff --git a/release_23/test/Feature/varargs_new.ll b/release_23/test/Feature/varargs_new.ll
deleted file mode 100644
index a46f270d86de..000000000000
--- a/release_23/test/Feature/varargs_new.ll
+++ /dev/null
@@ -1,38 +0,0 @@
-; RUN: llvm-as < %s | llvm-dis > %t1.ll
-; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
-; RUN: diff %t1.ll %t2.ll
-
-; Demonstrate all of the variable argument handling intrinsic functions plus
-; the va_arg instruction.
-
-declare void @llvm.va_start(i8*)
-
-declare void @llvm.va_copy(i8*, i8*)
-
-declare void @llvm.va_end(i8*)
-
-define i32 @test(i32 %X, ...) {
- ; Allocate two va_list items. On this target, va_list is of type sbyte*
- %ap = alloca i8* ; <i8**> [#uses=4]
- %aq = alloca i8* ; <i8**> [#uses=2]
-
- ; Initialize variable argument processing
- %va.upgrd.1 = bitcast i8** %ap to i8* ; <i8*> [#uses=1]
- call void @llvm.va_start( i8* %va.upgrd.1 )
-
- ; Read a single integer argument
- %tmp = va_arg i8** %ap, i32 ; <i32> [#uses=1]
-
- ; Demonstrate usage of llvm.va_copy and llvm_va_end
- %apv = load i8** %ap ; <i8*> [#uses=1]
- %va0.upgrd.2 = bitcast i8** %aq to i8* ; <i8*> [#uses=1]
- %va1.upgrd.3 = bitcast i8* %apv to i8* ; <i8*> [#uses=1]
- call void @llvm.va_copy( i8* %va0.upgrd.2, i8* %va1.upgrd.3 )
- %va.upgrd.4 = bitcast i8** %aq to i8* ; <i8*> [#uses=1]
- call void @llvm.va_end( i8* %va.upgrd.4 )
-
- ; Stop processing of arguments.
- %va.upgrd.5 = bitcast i8** %ap to i8* ; <i8*> [#uses=1]
- call void @llvm.va_end( i8* %va.upgrd.5 )
- ret i32 %tmp
-}
diff --git a/release_23/test/Feature/weirdnames.ll b/release_23/test/Feature/weirdnames.ll
deleted file mode 100644
index cc773cddcf71..000000000000
--- a/release_23/test/Feature/weirdnames.ll
+++ /dev/null
@@ -1,9 +0,0 @@
-; RUN: llvm-as < %s | llvm-dis > %t1.ll
-; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
-; RUN: diff %t1.ll %t2.ll
-
-; Test using double quotes to form names that are not legal in the % form
-%"&^ " = type { i32 }
-@"%.*+ foo" = global %"&^ " { i32 5 }
-@"0" = global float 0.000000e+00 ; This CANNOT be %0
-@"\\03foo" = global float 0x3FB99999A0000000 ; Make sure funny char gets round trip
diff --git a/release_23/test/Feature/x86ld.ll b/release_23/test/Feature/x86ld.ll
deleted file mode 100644
index 690400346e34..000000000000
--- a/release_23/test/Feature/x86ld.ll
+++ /dev/null
@@ -1,26 +0,0 @@
-; RUN: llvm-as < %s | llvm-dis > %t
-; RUN: llvm-as < %t | llvm-dis > %t2
-; RUN: diff %t %t2
-; ModuleID = '<stdin>'
-target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64"
-target triple = "i686-apple-darwin8"
-@ld = external global x86_fp80 ; <x86_fp80*> [#uses=1]
-@d = global double 4.050000e+00, align 8 ; <double*> [#uses=1]
-@f = global float 0x4010333340000000 ; <float*> [#uses=1]
-
-define i32 @foo() {
-entry:
- %retval = alloca i32, align 4 ; <i32*> [#uses=1]
- %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
- %tmp = load float* @f ; <float> [#uses=1]
- %tmp1 = fpext float %tmp to double ; <double> [#uses=1]
- %tmp2 = load double* @d ; <double> [#uses=1]
- %tmp3 = mul double %tmp1, %tmp2 ; <double> [#uses=1]
- %tmp4 = fpext double %tmp3 to x86_fp80 ; <x86_fp80> [#uses=1]
- store x86_fp80 %tmp4, x86_fp80* @ld
- br label %return
-
-return: ; preds = %entry
- %retval4 = load i32* %retval ; <i32> [#uses=1]
- ret i32 %retval4
-}
diff --git a/release_23/test/FrontendAda/Support/fat_fields.ads b/release_23/test/FrontendAda/Support/fat_fields.ads
deleted file mode 100644
index d3eab3e28668..000000000000
--- a/release_23/test/FrontendAda/Support/fat_fields.ads
+++ /dev/null
@@ -1,6 +0,0 @@
-package Fat_Fields is
- pragma Elaborate_Body;
- type A is array (Positive range <>) of Boolean;
- type A_Ptr is access A;
- P : A_Ptr := null;
-end;
diff --git a/release_23/test/FrontendAda/Support/global_constant.ads b/release_23/test/FrontendAda/Support/global_constant.ads
deleted file mode 100644
index cef4b11f684a..000000000000
--- a/release_23/test/FrontendAda/Support/global_constant.ads
+++ /dev/null
@@ -1,4 +0,0 @@
-package Global_Constant is
- pragma Elaborate_Body;
- An_Error : exception;
-end;
diff --git a/release_23/test/FrontendAda/Support/non_lvalue.ads b/release_23/test/FrontendAda/Support/non_lvalue.ads
deleted file mode 100644
index 7d4eeed8b8ec..000000000000
--- a/release_23/test/FrontendAda/Support/non_lvalue.ads
+++ /dev/null
@@ -1,11 +0,0 @@
-package Non_LValue is
- type T (Length : Natural) is record
- A : String (1 .. Length);
- B : String (1 .. Length);
- end record;
- type T_Ptr is access all T;
- type U is record
- X : T_Ptr;
- end record;
- function A (Y : U) return String;
-end;
diff --git a/release_23/test/FrontendAda/Support/unc_constructor.ads b/release_23/test/FrontendAda/Support/unc_constructor.ads
deleted file mode 100644
index d6f8db50d897..000000000000
--- a/release_23/test/FrontendAda/Support/unc_constructor.ads
+++ /dev/null
@@ -1,8 +0,0 @@
-package Unc_Constructor is
- type C is null record;
- type A is array (Positive range <>) of C;
- A0 : constant A;
- procedure P (X : A);
-private
- A0 : aliased constant A := (1 .. 0 => (null record));
-end;
diff --git a/release_23/test/FrontendAda/Support/var_offset.ads b/release_23/test/FrontendAda/Support/var_offset.ads
deleted file mode 100644
index 55d0eb21f7c4..000000000000
--- a/release_23/test/FrontendAda/Support/var_offset.ads
+++ /dev/null
@@ -1,9 +0,0 @@
-package Var_Offset is
- pragma Elaborate_Body;
- type T (L : Natural) is record
- Var_Len : String (1 .. L);
- Space : Integer;
- Small : Character;
- Bad_Field : Character;
- end record;
-end;
diff --git a/release_23/test/FrontendAda/Support/var_size.ads b/release_23/test/FrontendAda/Support/var_size.ads
deleted file mode 100644
index 6a570cba8bd1..000000000000
--- a/release_23/test/FrontendAda/Support/var_size.ads
+++ /dev/null
@@ -1,7 +0,0 @@
-package Var_Size is
- type T (Length : Natural) is record
- A : String (1 .. Length);
- B : String (1 .. Length);
- end record;
- function A (X : T) return String;
-end;
diff --git a/release_23/test/FrontendAda/array_constructor.adb b/release_23/test/FrontendAda/array_constructor.adb
deleted file mode 100644
index de64b45a1e3e..000000000000
--- a/release_23/test/FrontendAda/array_constructor.adb
+++ /dev/null
@@ -1,6 +0,0 @@
--- RUN: %llvmgcc -c %s
-procedure Array_Constructor is
- A : array (Integer range <>) of Boolean := (True, False);
-begin
- null;
-end;
diff --git a/release_23/test/FrontendAda/array_range_ref.adb b/release_23/test/FrontendAda/array_range_ref.adb
deleted file mode 100644
index ae9bdc6cfcdf..000000000000
--- a/release_23/test/FrontendAda/array_range_ref.adb
+++ /dev/null
@@ -1,7 +0,0 @@
--- RUN: %llvmgcc -c %s
-procedure Array_Range_Ref is
- A : String (1 .. 3);
- B : String := A (A'RANGE)(1 .. 3);
-begin
- null;
-end;
diff --git a/release_23/test/FrontendAda/array_ref.adb b/release_23/test/FrontendAda/array_ref.adb
deleted file mode 100644
index 9577e21ad70f..000000000000
--- a/release_23/test/FrontendAda/array_ref.adb
+++ /dev/null
@@ -1,11 +0,0 @@
--- RUN: %llvmgcc -c %s
-procedure Array_Ref is
- type A is array (Natural range <>, Natural range <>) of Boolean;
- type A_Access is access A;
- function Get (X : A_Access) return Boolean is
- begin
- return X (0, 0);
- end;
-begin
- null;
-end;
diff --git a/release_23/test/FrontendAda/array_size.adb b/release_23/test/FrontendAda/array_size.adb
deleted file mode 100644
index 2f07d0639082..000000000000
--- a/release_23/test/FrontendAda/array_size.adb
+++ /dev/null
@@ -1,10 +0,0 @@
--- RUN: %llvmgcc -c %s
-procedure Array_Size is
- subtype S is String (1 .. 2);
- type R is record
- A : S;
- end record;
- X : R;
-begin
- null;
-end;
diff --git a/release_23/test/FrontendAda/asm.adb b/release_23/test/FrontendAda/asm.adb
deleted file mode 100644
index 575617c08788..000000000000
--- a/release_23/test/FrontendAda/asm.adb
+++ /dev/null
@@ -1,6 +0,0 @@
--- RUN: %llvmgcc -c %s
-with System.Machine_Code;
-procedure Asm is
-begin
- System.Machine_Code.Asm ("");
-end;
diff --git a/release_23/test/FrontendAda/debug_var_size.ads b/release_23/test/FrontendAda/debug_var_size.ads
deleted file mode 100644
index ea966fbae0fe..000000000000
--- a/release_23/test/FrontendAda/debug_var_size.ads
+++ /dev/null
@@ -1,8 +0,0 @@
--- RUN: %llvmgcc -c -g %s
-package Debug_Var_Size is
- subtype Length_Type is Positive range 1 .. 64;
- type T (Length : Length_Type := 1) is record
- Varying_Length : String (1 .. Length);
- Fixed_Length : Boolean;
- end record;
-end;
diff --git a/release_23/test/FrontendAda/dg.exp b/release_23/test/FrontendAda/dg.exp
deleted file mode 100644
index 2307c3fdbe06..000000000000
--- a/release_23/test/FrontendAda/dg.exp
+++ /dev/null
@@ -1,6 +0,0 @@
-load_lib llvm.exp
-
-if [ llvm_gcc_supports ada ] then {
- RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{adb,ads}]]
-}
-
diff --git a/release_23/test/FrontendAda/emit_var.ads b/release_23/test/FrontendAda/emit_var.ads
deleted file mode 100644
index 35d45448cb6d..000000000000
--- a/release_23/test/FrontendAda/emit_var.ads
+++ /dev/null
@@ -1,5 +0,0 @@
--- RUN: %llvmgcc -c %s
-with Ada.Finalization;
-package Emit_Var is
- type Search_Type is new Ada.Finalization.Controlled with null record;
-end;
diff --git a/release_23/test/FrontendAda/fat_fields.adb b/release_23/test/FrontendAda/fat_fields.adb
deleted file mode 100644
index 510105f6840f..000000000000
--- a/release_23/test/FrontendAda/fat_fields.adb
+++ /dev/null
@@ -1,10 +0,0 @@
--- RUN: %llvmgcc -c %s -I%p/Support
--- RUN: %llvmgcc -c %s -I%p/Support -O2
-package body Fat_Fields is
- procedure Proc is
- begin
- if P = null then
- null;
- end if;
- end;
-end;
diff --git a/release_23/test/FrontendAda/field_order.ads b/release_23/test/FrontendAda/field_order.ads
deleted file mode 100644
index b49185d6dd80..000000000000
--- a/release_23/test/FrontendAda/field_order.ads
+++ /dev/null
@@ -1,7 +0,0 @@
--- RUN: %llvmgcc -c %s
-package Field_Order is
- type Tagged_Type is abstract tagged null record;
- type With_Discriminant (L : Positive) is new Tagged_Type with record
- S : String (1 .. L);
- end record;
-end;
diff --git a/release_23/test/FrontendAda/global_constant.adb b/release_23/test/FrontendAda/global_constant.adb
deleted file mode 100644
index ce9f406dba58..000000000000
--- a/release_23/test/FrontendAda/global_constant.adb
+++ /dev/null
@@ -1,5 +0,0 @@
--- RUN: %llvmgcc -c %s -I%p/Support
-package body Global_Constant is
-begin
- raise An_Error;
-end;
diff --git a/release_23/test/FrontendAda/init_size.ads b/release_23/test/FrontendAda/init_size.ads
deleted file mode 100644
index 1d76ba24f341..000000000000
--- a/release_23/test/FrontendAda/init_size.ads
+++ /dev/null
@@ -1,12 +0,0 @@
--- RUN: %llvmgcc -c %s
-package Init_Size is
- type T (B : Boolean := False) is record
- case B is
- when False =>
- I : Integer;
- when True =>
- J : Long_Long_Integer; -- Bigger than I
- end case;
- end record;
- A_T : constant T := (False, 0);
-end;
diff --git a/release_23/test/FrontendAda/non_bitfield.ads b/release_23/test/FrontendAda/non_bitfield.ads
deleted file mode 100644
index 8f5845adb431..000000000000
--- a/release_23/test/FrontendAda/non_bitfield.ads
+++ /dev/null
@@ -1,12 +0,0 @@
--- RUN: %llvmgcc -c %s
-package Non_Bitfield is
- type SP is access String;
- type E is (A, B, C);
- type T (D : E) is record
- case D is
- when A => X : Boolean;
- when B => Y : SP;
- when C => Z : String (1 .. 2);
- end case;
- end record;
-end;
diff --git a/release_23/test/FrontendAda/non_lvalue.adb b/release_23/test/FrontendAda/non_lvalue.adb
deleted file mode 100644
index 157f3ddd287f..000000000000
--- a/release_23/test/FrontendAda/non_lvalue.adb
+++ /dev/null
@@ -1,7 +0,0 @@
--- RUN: %llvmgcc -c %s -I%p/Support
-package body Non_LValue is
- function A (Y : U) return String is
- begin
- return Y.X.B;
- end;
-end;
diff --git a/release_23/test/FrontendAda/placeholder.adb b/release_23/test/FrontendAda/placeholder.adb
deleted file mode 100644
index f33c9a5ab89d..000000000000
--- a/release_23/test/FrontendAda/placeholder.adb
+++ /dev/null
@@ -1,12 +0,0 @@
--- RUN: %llvmgcc -c %s
-procedure Placeholder is
- subtype Bounded is Integer range 1 .. 5;
- type Vector is array (Bounded range <>) of Integer;
- type Interval (Length : Bounded := 1) is record
- Points : Vector (1 .. Length);
- end record;
- An_Interval : Interval := (Length => 1, Points => (1 => 1));
- generic The_Interval : Interval; package R is end;
- package body R is end;
- package S is new R (An_Interval);
-begin null; end;
diff --git a/release_23/test/FrontendAda/switch.adb b/release_23/test/FrontendAda/switch.adb
deleted file mode 100644
index f214bca2ec42..000000000000
--- a/release_23/test/FrontendAda/switch.adb
+++ /dev/null
@@ -1,12 +0,0 @@
--- RUN: %llvmgcc -c %s
-function Switch (N : Integer) return Integer is
-begin
- case N is
- when Integer'First .. -1 =>
- return -1;
- when 0 =>
- return 0;
- when others =>
- return 1;
- end case;
-end;
diff --git a/release_23/test/FrontendAda/unc_constructor.adb b/release_23/test/FrontendAda/unc_constructor.adb
deleted file mode 100644
index bc3002c6a95b..000000000000
--- a/release_23/test/FrontendAda/unc_constructor.adb
+++ /dev/null
@@ -1,9 +0,0 @@
--- RUN: %llvmgcc -c %s -I%p/Support
-package body Unc_Constructor is
- procedure P (X : A) is
- begin
- if X = A0 then
- null;
- end if;
- end;
-end;
diff --git a/release_23/test/FrontendAda/var_offset.adb b/release_23/test/FrontendAda/var_offset.adb
deleted file mode 100644
index 09f1c155a061..000000000000
--- a/release_23/test/FrontendAda/var_offset.adb
+++ /dev/null
@@ -1,7 +0,0 @@
--- RUN: %llvmgcc -c %s -I%p/Support
-package body Var_Offset is
- function F (X : T) return Character is
- begin
- return X.Bad_Field;
- end;
-end;
diff --git a/release_23/test/FrontendAda/var_size.adb b/release_23/test/FrontendAda/var_size.adb
deleted file mode 100644
index b3db9a36fe1b..000000000000
--- a/release_23/test/FrontendAda/var_size.adb
+++ /dev/null
@@ -1,7 +0,0 @@
--- RUN: %llvmgcc -c %s -I%p/Support
-package body Var_Size is
- function A (X : T) return String is
- begin
- return X.A;
- end;
-end;
diff --git a/release_23/test/FrontendAda/vce.adb b/release_23/test/FrontendAda/vce.adb
deleted file mode 100644
index f24045cbee3f..000000000000
--- a/release_23/test/FrontendAda/vce.adb
+++ /dev/null
@@ -1,7 +0,0 @@
--- RUN: %llvmgcc -c %s
-procedure VCE is
- S : String (1 .. 2);
- B : Character := 'B';
-begin
- S := 'A' & B;
-end;
diff --git a/release_23/test/FrontendAda/vce_lv.adb b/release_23/test/FrontendAda/vce_lv.adb
deleted file mode 100644
index 4ca4d5c8b542..000000000000
--- a/release_23/test/FrontendAda/vce_lv.adb
+++ /dev/null
@@ -1,9 +0,0 @@
--- RUN: %llvmgcc -c %s
-procedure VCE_LV is
- type P is access String ;
- type T is new P (5 .. 7);
- subtype U is String (5 .. 7);
- X : T := new U'(others => 'A');
-begin
- null;
-end;
diff --git a/release_23/test/FrontendObjC/2007-04-03-ObjcEH.m b/release_23/test/FrontendObjC/2007-04-03-ObjcEH.m
deleted file mode 100644
index 353323d325f1..000000000000
--- a/release_23/test/FrontendObjC/2007-04-03-ObjcEH.m
+++ /dev/null
@@ -1,29 +0,0 @@
-// RUN: %llvmgcc -c %s -o /dev/null
-
-@interface B
--(int)bar;
-@end
-
-@interface A
--(void) Foo:(int) state;
-@end
-
-@implementation A
-- (void) Foo:(int) state {
-
- int wasResponded = 0;
- @try {
- if (state) {
- B * b = 0;
- @try { }
- @finally {
- wasResponded = ![b bar];
- }
- }
- }
- @finally {
- }
-}
-@end
-
-
diff --git a/release_23/test/FrontendObjC/2007-05-02-Strong.m b/release_23/test/FrontendObjC/2007-05-02-Strong.m
deleted file mode 100644
index 3778fd29f436..000000000000
--- a/release_23/test/FrontendObjC/2007-05-02-Strong.m
+++ /dev/null
@@ -1,23 +0,0 @@
-// RUN: %llvmgcc -c %s -fobjc-gc -o /dev/null
-typedef int NSInteger;
-typedef struct _NSRect {
- int origin;
- int size;
-} NSRect;
-
-__attribute__((objc_gc(strong))) NSRect *_cachedRectArray;
-extern const NSRect NSZeroRect;
-@interface A{
-}
--(void)bar:(NSInteger *)rectCount;
-@end
-
-@implementation A
-
--(void)bar:(NSInteger *)rectCount {
- NSRect appendRect = NSZeroRect;
-
- _cachedRectArray[*rectCount - 1] = NSZeroRect;
-}
-
-@end
diff --git a/release_23/test/FrontendObjC/2007-09-25-EH.m b/release_23/test/FrontendObjC/2007-09-25-EH.m
deleted file mode 100644
index 5fa9cbb85d82..000000000000
--- a/release_23/test/FrontendObjC/2007-09-25-EH.m
+++ /dev/null
@@ -1,27 +0,0 @@
-// RUN: %llvmgcc -c -w -m64 -mmacosx-version-min=10.5 %s -o /dev/null
-// XFAIL: *
-// XTARGET: darwin
-@class NSDictionary, DSoBuffer, DSoDirectory, NSMutableArray;
-@interface NSException {}
-@end
-@interface DSoNode {
- DSoDirectory *mDirectory;
-}
-@end
-@implementation DSoNode
-- (void) _findRecordsOfTypes {
- DSoBuffer *dbData;
- void *recInfo;
- NSMutableArray *results;
- @try {
- dsGetRecordEntry([dbData dsDataBuffer], (void**)&recInfo);
- @try {
- [results addObject:37];
- } @finally {
- dsDeallocRecordEntry([mDirectory dsDirRef], recInfo);
- }
- } @catch(NSException * exception) {
- }
-}
-
-
diff --git a/release_23/test/FrontendObjC/2007-10-03-MetadataPointers.mm b/release_23/test/FrontendObjC/2007-10-03-MetadataPointers.mm
deleted file mode 100644
index ca5ff8588930..000000000000
--- a/release_23/test/FrontendObjC/2007-10-03-MetadataPointers.mm
+++ /dev/null
@@ -1,7 +0,0 @@
-// RUN: %llvmgcc -x objective-c++ -c %s -o /dev/null
-
-@class NSImage;
-void bork() {
- NSImage *nsimage;
- [nsimage release];
-}
diff --git a/release_23/test/FrontendObjC/2007-10-17-SJLJExceptions.m b/release_23/test/FrontendObjC/2007-10-17-SJLJExceptions.m
deleted file mode 100644
index 4bea6e98a8b2..000000000000
--- a/release_23/test/FrontendObjC/2007-10-17-SJLJExceptions.m
+++ /dev/null
@@ -1,24 +0,0 @@
-// RUN: %llvmgcc -x objective-c %s -pipe -std=gnu99 -O2 -fexceptions -S -o - | not grep Unwind_Resume
-#import <stdio.h>
-
-@interface Foo {
- char c;
- short s;
- int i;
- long l;
- float f;
- double d;
-}
--(Foo*)retain;
-@end
-
-struct Foo *bork(Foo *FooArray) {
- struct Foo *result = 0;
- @try {
- result = [FooArray retain];
- } @catch(id any) {
- printf("hello world\n");
- }
-
- return result;
-}
diff --git a/release_23/test/FrontendObjC/2007-10-18-ProDescriptor.m b/release_23/test/FrontendObjC/2007-10-18-ProDescriptor.m
deleted file mode 100644
index e87a43ffc979..000000000000
--- a/release_23/test/FrontendObjC/2007-10-18-ProDescriptor.m
+++ /dev/null
@@ -1,19 +0,0 @@
-// RUN: %llvmgcc -x objective-c -c %s -o /dev/null
-@protocol O
-@end
-@interface O < O > {
-}
-@end
-struct A {
-};
-@protocol AB
-- (unsigned) ver;
-@end
-@interface AGy:O < AB > {
-}
-@end
-@implementation AGy
-- (unsigned) ver {
-}
-@end
-
diff --git a/release_23/test/FrontendObjC/2007-10-23-GC-WriteBarrier.m b/release_23/test/FrontendObjC/2007-10-23-GC-WriteBarrier.m
deleted file mode 100644
index 866c3304887e..000000000000
--- a/release_23/test/FrontendObjC/2007-10-23-GC-WriteBarrier.m
+++ /dev/null
@@ -1,9 +0,0 @@
-// RUN: %llvmgcc -x objective-c -c %s -o /dev/null -fobjc-gc
-// rdar://5541393
-
-typedef unsigned int NSUInteger;
-__attribute__((objc_gc(strong))) float *_scores;
-
-void foo(int i, float f) {
- _scores[i] = f;
-}
diff --git a/release_23/test/FrontendObjC/dg.exp b/release_23/test/FrontendObjC/dg.exp
deleted file mode 100644
index 90100ddd94ef..000000000000
--- a/release_23/test/FrontendObjC/dg.exp
+++ /dev/null
@@ -1,7 +0,0 @@
-load_lib llvm.exp
-
-if [ llvm_gcc_supports objc ] then {
- RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{m}]]
- RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{mm}]]
-}
-
diff --git a/release_23/test/Integer/2007-01-19-TruncSext.ll b/release_23/test/Integer/2007-01-19-TruncSext.ll
deleted file mode 100644
index 3fee6bc8b6e3..000000000000
--- a/release_23/test/Integer/2007-01-19-TruncSext.ll
+++ /dev/null
@@ -1,29 +0,0 @@
-; RUN: llvm-as %s -o - | llvm-dis > %t1.ll
-; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
-; RUN: diff %t1.ll %t2.ll
-; RUN: llvm-as < %s | lli --force-interpreter=true | grep -- -255
-
-@ARRAY = global [ 20 x i17 ] zeroinitializer
-@FORMAT = constant [ 4 x i8 ] c"%d\0A\00"
-
-declare i32 @printf(i8* %format, ...)
-
-define void @multiply(i32 %index, i32 %X, i32 %Y) {
- %Z = mul i32 %X, %Y
- %P = getelementptr [20 x i17]* @ARRAY, i32 0, i32 %index
- %Result = trunc i32 %Z to i17
- store i17 %Result, i17* %P
- ret void
-}
-
-define i32 @main(i32 %argc, i8** %argv) {
- %i = bitcast i32 0 to i32
- call void @multiply(i32 %i, i32 -1, i32 255)
- %P = getelementptr [20 x i17]* @ARRAY, i32 0, i32 0
- %X = load i17* %P
- %result = sext i17 %X to i32
- %fmt = getelementptr [4 x i8]* @FORMAT, i32 0, i32 0
- call i32 (i8*,...)* @printf(i8* %fmt, i32 %result)
- ret i32 0
-}
-
diff --git a/release_23/test/Integer/BitArith.ll b/release_23/test/Integer/BitArith.ll
deleted file mode 100644
index 350a98499477..000000000000
--- a/release_23/test/Integer/BitArith.ll
+++ /dev/null
@@ -1,25 +0,0 @@
-; RUN: llvm-as %s -o - | llvm-dis > %t1.ll
-; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
-; RUN: diff %t1.ll %t2.ll
-
-
-declare void @"foo"(i31 %i, i63 %j, i10 %k)
-
-
-; foo test basic arith operations
-define void @"foo"(i31 %i, i63 %j, i10 %k)
-begin
- %t1 = trunc i63 %j to i31
- %t2 = add i31 %t1, %i
- %t20 = add i31 3, %t1
- %t3 = zext i31 %i to i63
- %t4 = sub i63 %t3, %j
- %t40 = sub i63 %j, -100
- %t5 = mul i10 %k, 7
- %t6 = sdiv i63 %j, -2
- %t7 = udiv i63 %j, %t3
- %t8 = urem i10 %k, 10
- %t9 = srem i10 %k, -10
- ret void
-end
-
diff --git a/release_23/test/Integer/BitBit.ll b/release_23/test/Integer/BitBit.ll
deleted file mode 100644
index 420bbe5a5fca..000000000000
--- a/release_23/test/Integer/BitBit.ll
+++ /dev/null
@@ -1,24 +0,0 @@
-; RUN: llvm-as %s -o - | llvm-dis > %t1.ll
-; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
-; RUN: diff %t1.ll %t2.ll
-
-declare void @"foo"(i31 %i, i33 %j)
-
-
-; foo test basic bitwise operations
-define void @"foo"(i31 %i, i33 %j)
-begin
- %t1 = trunc i33 %j to i31
- %t2 = and i31 %t1, %i
- %t3 = sext i31 %i to i33
- %t4 = or i33 %t3, %j
- %t5 = xor i31 %t2, 7
- %t6 = shl i31 %i, 2
- %t7 = trunc i31 %i to i8
- %t8 = shl i8 %t7, 3
- %t9 = lshr i33 %j, 31
- %t7z = zext i8 %t7 to i33
- %t10 = ashr i33 %j, %t7z
- ret void
-end
-
diff --git a/release_23/test/Integer/BitCast.ll b/release_23/test/Integer/BitCast.ll
deleted file mode 100644
index 0bef0230e95a..000000000000
--- a/release_23/test/Integer/BitCast.ll
+++ /dev/null
@@ -1,26 +0,0 @@
-; RUN: llvm-as %s -o - | llvm-dis > %t1.ll
-; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
-; RUN: diff %t1.ll %t2.ll
-
-declare void @"foo"(i31 %i, i1280 %j, i1 %k, float %f)
-
-
-; foo test basic arith operations
-define void @"foo"(i31 %i, i1280 %j, i1 %k, float %f)
-begin
- %t1 = trunc i1280 %j to i31
- %t2 = trunc i31 %t1 to i1
-
- %t3 = zext i31 %i to i1280
- %t4 = sext i31 %i to i1280
-
- %t5 = fptoui float 0x400921FA00000000 to i31
- %t6 = uitofp i31 %t5 to double
-
- %t7 = fptosi double 0xC0934A456D5CFAAD to i28
- %t8 = sitofp i8 -1 to double
- %t9 = uitofp i8 255 to double
-
- ret void
-end
-
diff --git a/release_23/test/Integer/BitIcmp.ll b/release_23/test/Integer/BitIcmp.ll
deleted file mode 100644
index c22461224d02..000000000000
--- a/release_23/test/Integer/BitIcmp.ll
+++ /dev/null
@@ -1,43 +0,0 @@
-; RUN: llvm-as %s -o - | llvm-dis > %t1.ll
-; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
-; RUN: diff %t1.ll %t2.ll
-
-
-define i55 @"simpleIcmp"(i55 %i0, i55 %j0)
-begin
- %t1 = icmp eq i55 %i0, %j0
- %t2 = icmp ne i55 %i0, %j0
- %t3 = icmp ult i55 %i0, %j0
- %t4 = icmp sgt i55 %i0, %j0
- %t5 = icmp ule i55 %i0, %j0
- %t6 = icmp sge i55 %i0, %j0
-
- %t7 = icmp eq i55 %i0, 1098765432
- %t8 = icmp ne i55 %i0, -31415926
-
- %t9 = icmp ult i55 10000, %j0
- %t10 = icmp sgt i55 -10000, %j0
-
- ret i55 %i0
-end
-
-define i31 @"phitest"(i12 %i)
-begin
-
-HasArg:
- %n1 = add i12 1, %i
- br label %Continue
-
-Continue:
- %n = phi i12 [%n1, %HasArg], [%next, %Continue]
- %next = add i12 1, %n
- br label %Continue
-end
-
-define i18 @"select"(i18 %i)
-begin
- %t = icmp sgt i18 %i, 100
- %k = select i1 %t, i18 %i, i18 999
- ret i18 %k
-end
-
diff --git a/release_23/test/Integer/BitMem.ll b/release_23/test/Integer/BitMem.ll
deleted file mode 100644
index 2c093bc9902f..000000000000
--- a/release_23/test/Integer/BitMem.ll
+++ /dev/null
@@ -1,29 +0,0 @@
-; RUN: llvm-as %s -o - | llvm-dis > %t1.ll
-; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
-; RUN: diff %t1.ll %t2.ll
-
-declare void @"foo"()
-
-
-; foo test basic arith operations
-define void @"foo"() {
- %t1 = malloc i31, i32 4
- %t2 = malloc i31, i32 7, align 1024
- %t3 = malloc [4 x i15]
-
- %idx = getelementptr [4 x i15]* %t3, i64 0, i64 2
- store i15 -123, i15* %idx
-
- free [4 x i15]* %t3
- free i31* %t2
- free i31* %t1
-
- %t4 = alloca i12, i32 100
- free i12* %t4
-
- %t5 = alloca i31
- store i31 -123, i31* %t5
-
- free i31* %t5
- ret void
-}
diff --git a/release_23/test/Integer/BitMisc.ll b/release_23/test/Integer/BitMisc.ll
deleted file mode 100644
index 8ce4d4add7dc..000000000000
--- a/release_23/test/Integer/BitMisc.ll
+++ /dev/null
@@ -1,24 +0,0 @@
-; RUN: llvm-as %s -o - | llvm-dis > %t1.ll
-; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
-; RUN: diff %t1.ll %t2.ll
-
-
-@MyVar = external global i19
-@MyIntList = external global { i39 *, i19 }
- external global i19 ; i19*:0
-
-@AConst = constant i19 -123
-
-@AString = constant [4 x i8] c"test"
-
-@ZeroInit = global { [100 x i19 ], [40 x float ] } { [100 x i19] zeroinitializer,
- [40 x float] zeroinitializer }
-
-
-define i19 @"foo"(i19 %blah)
-begin
- store i19 5, i19* @MyVar
- %idx = getelementptr { i39 *, i19 } * @MyIntList, i64 0, i32 1
- store i19 12, i19* %idx
- ret i19 %blah
-end
diff --git a/release_23/test/Integer/BitPacked.ll b/release_23/test/Integer/BitPacked.ll
deleted file mode 100644
index d363a81e7344..000000000000
--- a/release_23/test/Integer/BitPacked.ll
+++ /dev/null
@@ -1,21 +0,0 @@
-; RUN: llvm-as %s -o - | llvm-dis > %t1.ll
-; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
-; RUN: diff %t1.ll %t2.ll
-
-@foo1 = external global <4 x float>;
-@foo2 = external global <2 x i10>;
-
-
-define void @main()
-{
- store <4 x float> <float 1.0, float 2.0, float 3.0, float 4.0>, <4 x float>* @foo1
- store <2 x i10> <i10 4, i10 4>, <2 x i10>* @foo2
- %l1 = load <4 x float>* @foo1
- %l2 = load <2 x i10>* @foo2
- %r1 = extractelement <2 x i10> %l2, i32 1
- %r2 = extractelement <2 x i10> %l2, i32 0
- %t = mul i10 %r1, %r2
- %r3 = insertelement <2 x i10> %l2, i10 %t, i32 0
- store <2 x i10> %r3, <2 x i10>* @foo2
- ret void
-}
diff --git a/release_23/test/Integer/a1.ll b/release_23/test/Integer/a1.ll
deleted file mode 100644
index e63839867955..000000000000
--- a/release_23/test/Integer/a1.ll
+++ /dev/null
@@ -1,25 +0,0 @@
-; RUN: llvm-as %s -o - | llvm-dis > %t.ll
-; RUN: diff %t.ll %s.out
-
-; test 1 bit
-;
-@b = constant i1 add(i1 1 , i1 1)
-@c = constant i1 add(i1 -1, i1 1)
-@d = constant i1 add(i1 -1, i1 -1)
-@e = constant i1 sub(i1 -1, i1 1)
-@f = constant i1 sub(i1 1 , i1 -1)
-@g = constant i1 sub(i1 1 , i1 1)
-
-@h = constant i1 shl(i1 1 , i1 1) ; undefined
-@i = constant i1 shl(i1 1 , i1 0)
-@j = constant i1 lshr(i1 1, i1 1) ; undefined
-@m = constant i1 ashr(i1 1, i1 1) ; undefined
-
-@n = constant i1 mul(i1 -1, i1 1)
-@o = constant i1 sdiv(i1 -1, i1 1) ; overflow
-@p = constant i1 sdiv(i1 1 , i1 -1); overflow
-@q = constant i1 udiv(i1 -1, i1 1)
-@r = constant i1 udiv(i1 1, i1 -1)
-@s = constant i1 srem(i1 -1, i1 1) ; overflow
-@t = constant i1 urem(i1 -1, i1 1)
-@u = constant i1 srem(i1 1, i1 -1) ; overflow
diff --git a/release_23/test/Integer/a1.ll.out b/release_23/test/Integer/a1.ll.out
deleted file mode 100644
index 93ca11acd3ee..000000000000
--- a/release_23/test/Integer/a1.ll.out
+++ /dev/null
@@ -1,19 +0,0 @@
-; ModuleID = '<stdin>'
-@b = constant i1 false ; <i1*> [#uses=0]
-@c = constant i1 false ; <i1*> [#uses=0]
-@d = constant i1 false ; <i1*> [#uses=0]
-@e = constant i1 false ; <i1*> [#uses=0]
-@f = constant i1 false ; <i1*> [#uses=0]
-@g = constant i1 false ; <i1*> [#uses=0]
-@h = constant i1 undef ; <i1*> [#uses=0]
-@i = constant i1 true ; <i1*> [#uses=0]
-@j = constant i1 undef ; <i1*> [#uses=0]
-@m = constant i1 undef ; <i1*> [#uses=0]
-@n = constant i1 true ; <i1*> [#uses=0]
-@o = constant i1 true ; <i1*> [#uses=0]
-@p = constant i1 true ; <i1*> [#uses=0]
-@q = constant i1 true ; <i1*> [#uses=0]
-@r = constant i1 true ; <i1*> [#uses=0]
-@s = constant i1 false ; <i1*> [#uses=0]
-@t = constant i1 false ; <i1*> [#uses=0]
-@u = constant i1 false ; <i1*> [#uses=0]
diff --git a/release_23/test/Integer/a15.ll b/release_23/test/Integer/a15.ll
deleted file mode 100644
index 5c9dc3b1be0d..000000000000
--- a/release_23/test/Integer/a15.ll
+++ /dev/null
@@ -1,27 +0,0 @@
-; RUN: llvm-as %s -o - | llvm-dis > %t.ll
-; RUN: diff %t.ll %s.out
-
-; test 15 bits
-;
-@b = constant i15 add(i15 32767, i15 1)
-@c = constant i15 add(i15 32767, i15 32767)
-@d = constant i15 add(i15 32760, i15 8)
-@e = constant i15 sub(i15 0 , i15 1)
-@f = constant i15 sub(i15 0 , i15 32767)
-@g = constant i15 sub(i15 2 , i15 32767)
-
-@h = constant i15 shl(i15 1 , i15 15)
-@i = constant i15 shl(i15 1 , i15 14)
-@j = constant i15 lshr(i15 32767 , i15 14)
-@l = constant i15 ashr(i15 32767 , i15 14)
-
-@n = constant i15 mul(i15 32767, i15 2)
-@q = constant i15 mul(i15 -16383,i15 -3)
-@r = constant i15 sdiv(i15 -1, i15 16383)
-@s = constant i15 udiv(i15 -1, i15 16383)
-@t = constant i15 srem(i15 1, i15 32766)
-@u = constant i15 urem(i15 32767,i15 -1)
-@o = constant i15 trunc( i16 32768 to i15 )
-@p = constant i15 trunc( i16 32767 to i15 )
-@v = constant i15 srem(i15 -1, i15 768)
-
diff --git a/release_23/test/Integer/a15.ll.out b/release_23/test/Integer/a15.ll.out
deleted file mode 100644
index e9eb800b0bdf..000000000000
--- a/release_23/test/Integer/a15.ll.out
+++ /dev/null
@@ -1,20 +0,0 @@
-; ModuleID = '<stdin>'
-@b = constant i15 0 ; <i15*> [#uses=0]
-@c = constant i15 -2 ; <i15*> [#uses=0]
-@d = constant i15 0 ; <i15*> [#uses=0]
-@e = constant i15 -1 ; <i15*> [#uses=0]
-@f = constant i15 1 ; <i15*> [#uses=0]
-@g = constant i15 3 ; <i15*> [#uses=0]
-@h = constant i15 undef ; <i15*> [#uses=0]
-@i = constant i15 -16384 ; <i15*> [#uses=0]
-@j = constant i15 1 ; <i15*> [#uses=0]
-@l = constant i15 -1 ; <i15*> [#uses=0]
-@n = constant i15 -2 ; <i15*> [#uses=0]
-@q = constant i15 16381 ; <i15*> [#uses=0]
-@r = constant i15 0 ; <i15*> [#uses=0]
-@s = constant i15 2 ; <i15*> [#uses=0]
-@t = constant i15 1 ; <i15*> [#uses=0]
-@u = constant i15 0 ; <i15*> [#uses=0]
-@o = constant i15 0 ; <i15*> [#uses=0]
-@p = constant i15 -1 ; <i15*> [#uses=0]
-@v = constant i15 -1 ; <i15*> [#uses=0]
diff --git a/release_23/test/Integer/a17.ll b/release_23/test/Integer/a17.ll
deleted file mode 100644
index db03e7c6be0d..000000000000
--- a/release_23/test/Integer/a17.ll
+++ /dev/null
@@ -1,25 +0,0 @@
-; RUN: llvm-as %s -o - | llvm-dis > %t.ll
-; RUN: diff %t.ll %s.out
-
-; test 17 bits
-;
-@b = constant i17 add(i17 131071, i17 1)
-@c = constant i17 add(i17 131071, i17 131071)
-@d = constant i17 add(i17 131064, i17 8)
-@e = constant i17 sub(i17 0 , i17 1)
-@f = constant i17 sub(i17 0 , i17 131071)
-@g = constant i17 sub(i17 2 , i17 131071)
-
-@h = constant i17 shl(i17 1 , i17 17)
-@i = constant i17 shl(i17 1 , i17 16)
-@j = constant i17 lshr(i17 131071 , i17 16)
-@l = constant i17 ashr(i17 131071 , i17 16)
-
-@n = constant i17 mul(i17 131071, i17 2)
-@q = constant i17 sdiv(i17 -1, i17 65535)
-@r = constant i17 udiv(i17 -1, i17 65535)
-@s = constant i17 srem(i17 1, i17 131070)
-@t = constant i17 urem(i17 131071,i17 -1)
-@o = constant i17 trunc( i18 131072 to i17 )
-@p = constant i17 trunc( i18 131071 to i17 )
-@v = constant i17 srem(i17 -1, i17 15)
diff --git a/release_23/test/Integer/a17.ll.out b/release_23/test/Integer/a17.ll.out
deleted file mode 100644
index d24f62b63c31..000000000000
--- a/release_23/test/Integer/a17.ll.out
+++ /dev/null
@@ -1,19 +0,0 @@
-; ModuleID = '<stdin>'
-@b = constant i17 0 ; <i17*> [#uses=0]
-@c = constant i17 -2 ; <i17*> [#uses=0]
-@d = constant i17 0 ; <i17*> [#uses=0]
-@e = constant i17 -1 ; <i17*> [#uses=0]
-@f = constant i17 1 ; <i17*> [#uses=0]
-@g = constant i17 3 ; <i17*> [#uses=0]
-@h = constant i17 undef ; <i17*> [#uses=0]
-@i = constant i17 -65536 ; <i17*> [#uses=0]
-@j = constant i17 1 ; <i17*> [#uses=0]
-@l = constant i17 -1 ; <i17*> [#uses=0]
-@n = constant i17 -2 ; <i17*> [#uses=0]
-@q = constant i17 0 ; <i17*> [#uses=0]
-@r = constant i17 2 ; <i17*> [#uses=0]
-@s = constant i17 1 ; <i17*> [#uses=0]
-@t = constant i17 0 ; <i17*> [#uses=0]
-@o = constant i17 0 ; <i17*> [#uses=0]
-@p = constant i17 -1 ; <i17*> [#uses=0]
-@v = constant i17 -1 ; <i17*> [#uses=0]
diff --git a/release_23/test/Integer/a31.ll b/release_23/test/Integer/a31.ll
deleted file mode 100644
index c0c571f63068..000000000000
--- a/release_23/test/Integer/a31.ll
+++ /dev/null
@@ -1,25 +0,0 @@
-; RUN: llvm-as %s -o - | llvm-dis > %t.ll
-; RUN: diff %t.ll %s.out
-
-; test 31 bits
-;
-@b = constant i31 add(i31 2147483647, i31 1)
-@c = constant i31 add(i31 2147483647, i31 2147483647)
-@d = constant i31 add(i31 2147483640, i31 8)
-@e = constant i31 sub(i31 0 , i31 1)
-@f = constant i31 sub(i31 0 , i31 2147483647)
-@g = constant i31 sub(i31 2 , i31 2147483647)
-
-@h = constant i31 shl(i31 1 , i31 31)
-@i = constant i31 shl(i31 1 , i31 30)
-@j = constant i31 lshr(i31 2147483647 , i31 30)
-@l = constant i31 ashr(i31 2147483647 , i31 30)
-
-@n = constant i31 mul(i31 2147483647, i31 2)
-@q = constant i31 sdiv(i31 -1, i31 1073741823)
-@r = constant i31 udiv(i31 -1, i31 1073741823)
-@s = constant i31 srem(i31 1, i31 2147483646)
-@t = constant i31 urem(i31 2147483647,i31 -1)
-@o = constant i31 trunc( i32 2147483648 to i31 )
-@p = constant i31 trunc( i32 2147483647 to i31 )
-@u = constant i31 srem(i31 -3, i31 17)
diff --git a/release_23/test/Integer/a31.ll.out b/release_23/test/Integer/a31.ll.out
deleted file mode 100644
index fb8d250b4369..000000000000
--- a/release_23/test/Integer/a31.ll.out
+++ /dev/null
@@ -1,19 +0,0 @@
-; ModuleID = '<stdin>'
-@b = constant i31 0 ; <i31*> [#uses=0]
-@c = constant i31 -2 ; <i31*> [#uses=0]
-@d = constant i31 0 ; <i31*> [#uses=0]
-@e = constant i31 -1 ; <i31*> [#uses=0]
-@f = constant i31 1 ; <i31*> [#uses=0]
-@g = constant i31 3 ; <i31*> [#uses=0]
-@h = constant i31 undef ; <i31*> [#uses=0]
-@i = constant i31 -1073741824 ; <i31*> [#uses=0]
-@j = constant i31 1 ; <i31*> [#uses=0]
-@l = constant i31 -1 ; <i31*> [#uses=0]
-@n = constant i31 -2 ; <i31*> [#uses=0]
-@q = constant i31 0 ; <i31*> [#uses=0]
-@r = constant i31 2 ; <i31*> [#uses=0]
-@s = constant i31 1 ; <i31*> [#uses=0]
-@t = constant i31 0 ; <i31*> [#uses=0]
-@o = constant i31 0 ; <i31*> [#uses=0]
-@p = constant i31 -1 ; <i31*> [#uses=0]
-@u = constant i31 -3 ; <i31*> [#uses=0]
diff --git a/release_23/test/Integer/a33.ll b/release_23/test/Integer/a33.ll
deleted file mode 100644
index f328907b4608..000000000000
--- a/release_23/test/Integer/a33.ll
+++ /dev/null
@@ -1,26 +0,0 @@
-; RUN: llvm-as %s -o - | llvm-dis > %t.ll
-; RUN: diff %t.ll %s.out
-
-; test 33 bits
-;
-@b = constant i33 add(i33 8589934591, i33 1)
-@c = constant i33 add(i33 8589934591, i33 8589934591)
-@d = constant i33 add(i33 8589934584, i33 8)
-@e = constant i33 sub(i33 0 , i33 1)
-@f = constant i33 sub(i33 0 , i33 8589934591)
-@g = constant i33 sub(i33 2 , i33 8589934591)
-
-@h = constant i33 shl(i33 1 , i33 33)
-@i = constant i33 shl(i33 1 , i33 32)
-@j = constant i33 lshr(i33 8589934591 , i33 32)
-@l = constant i33 ashr(i33 8589934591 , i33 32)
-
-@n = constant i33 mul(i33 8589934591, i33 2)
-@q = constant i33 sdiv(i33 -1, i33 4294967295)
-@r = constant i33 udiv(i33 -1, i33 4294967295)
-@s = constant i33 srem(i33 1, i33 8589934590)
-@t = constant i33 urem(i33 8589934591,i33 -1)
-@o = constant i33 trunc( i34 8589934592 to i33 )
-@p = constant i33 trunc( i34 8589934591 to i33 )
-@u = constant i33 srem(i33 -1, i33 17)
-
diff --git a/release_23/test/Integer/a33.ll.out b/release_23/test/Integer/a33.ll.out
deleted file mode 100644
index f495d0dc9761..000000000000
--- a/release_23/test/Integer/a33.ll.out
+++ /dev/null
@@ -1,19 +0,0 @@
-; ModuleID = '<stdin>'
-@b = constant i33 0 ; <i33*> [#uses=0]
-@c = constant i33 -2 ; <i33*> [#uses=0]
-@d = constant i33 0 ; <i33*> [#uses=0]
-@e = constant i33 -1 ; <i33*> [#uses=0]
-@f = constant i33 1 ; <i33*> [#uses=0]
-@g = constant i33 3 ; <i33*> [#uses=0]
-@h = constant i33 undef ; <i33*> [#uses=0]
-@i = constant i33 -4294967296 ; <i33*> [#uses=0]
-@j = constant i33 1 ; <i33*> [#uses=0]
-@l = constant i33 -1 ; <i33*> [#uses=0]
-@n = constant i33 -2 ; <i33*> [#uses=0]
-@q = constant i33 0 ; <i33*> [#uses=0]
-@r = constant i33 2 ; <i33*> [#uses=0]
-@s = constant i33 1 ; <i33*> [#uses=0]
-@t = constant i33 0 ; <i33*> [#uses=0]
-@o = constant i33 0 ; <i33*> [#uses=0]
-@p = constant i33 -1 ; <i33*> [#uses=0]
-@u = constant i33 -1 ; <i33*> [#uses=0]
diff --git a/release_23/test/Integer/a63.ll b/release_23/test/Integer/a63.ll
deleted file mode 100644
index 052ecd585002..000000000000
--- a/release_23/test/Integer/a63.ll
+++ /dev/null
@@ -1,25 +0,0 @@
-; RUN: llvm-as %s -o - | llvm-dis > %t.ll
-; RUN: diff %t.ll %s.out
-
-; test 63 bits
-;
-@b = constant i63 add(i63 9223372036854775807, i63 1)
-@c = constant i63 add(i63 9223372036854775807, i63 9223372036854775807)
-@d = constant i63 add(i63 9223372036854775800, i63 8)
-@e = constant i63 sub(i63 0 , i63 1)
-@f = constant i63 sub(i63 0 , i63 9223372036854775807)
-@g = constant i63 sub(i63 2 , i63 9223372036854775807)
-
-@h = constant i63 shl(i63 1 , i63 63)
-@i = constant i63 shl(i63 1 , i63 62)
-@j = constant i63 lshr(i63 9223372036854775807 , i63 62)
-@l = constant i63 ashr(i63 9223372036854775807 , i63 62)
-
-@n = constant i63 mul(i63 9223372036854775807, i63 2)
-@q = constant i63 sdiv(i63 -1, i63 4611686018427387903)
-@u = constant i63 sdiv(i63 -1, i63 1)
-@r = constant i63 udiv(i63 -1, i63 4611686018427387903)
-@s = constant i63 srem(i63 3, i63 9223372036854775806)
-@t = constant i63 urem(i63 9223372036854775807,i63 -1)
-@o = constant i63 trunc( i64 9223372036854775808 to i63 )
-@p = constant i63 trunc( i64 9223372036854775807 to i63 )
diff --git a/release_23/test/Integer/a63.ll.out b/release_23/test/Integer/a63.ll.out
deleted file mode 100644
index c770608ed1e2..000000000000
--- a/release_23/test/Integer/a63.ll.out
+++ /dev/null
@@ -1,19 +0,0 @@
-; ModuleID = '<stdin>'
-@b = constant i63 0 ; <i63*> [#uses=0]
-@c = constant i63 -2 ; <i63*> [#uses=0]
-@d = constant i63 0 ; <i63*> [#uses=0]
-@e = constant i63 -1 ; <i63*> [#uses=0]
-@f = constant i63 1 ; <i63*> [#uses=0]
-@g = constant i63 3 ; <i63*> [#uses=0]
-@h = constant i63 undef ; <i63*> [#uses=0]
-@i = constant i63 -4611686018427387904 ; <i63*> [#uses=0]
-@j = constant i63 1 ; <i63*> [#uses=0]
-@l = constant i63 -1 ; <i63*> [#uses=0]
-@n = constant i63 -2 ; <i63*> [#uses=0]
-@q = constant i63 0 ; <i63*> [#uses=0]
-@u = constant i63 -1 ; <i63*> [#uses=0]
-@r = constant i63 2 ; <i63*> [#uses=0]
-@s = constant i63 1 ; <i63*> [#uses=0]
-@t = constant i63 0 ; <i63*> [#uses=0]
-@o = constant i63 0 ; <i63*> [#uses=0]
-@p = constant i63 -1 ; <i63*> [#uses=0]
diff --git a/release_23/test/Integer/a7.ll b/release_23/test/Integer/a7.ll
deleted file mode 100644
index 1edb35f9104b..000000000000
--- a/release_23/test/Integer/a7.ll
+++ /dev/null
@@ -1,31 +0,0 @@
-; RUN: llvm-as %s -o - | llvm-dis > %t.ll
-; RUN: diff %t.ll %s.out
-
-; test 7 bits
-;
-@b = constant i7 add(i7 127, i7 1)
-@q = constant i7 add(i7 -64, i7 -1)
-@c = constant i7 add(i7 127, i7 127)
-@d = constant i7 add(i7 120, i7 8)
-@e = constant i7 sub(i7 0 , i7 1)
-@f = constant i7 sub(i7 0 , i7 127)
-@g = constant i7 sub(i7 2 , i7 127)
-@r = constant i7 sub(i7 -3, i7 120)
-@s = constant i7 sub(i7 -3, i7 -8)
-
-@h = constant i7 shl(i7 1 , i7 7)
-@i = constant i7 shl(i7 1 , i7 6)
-@j = constant i7 lshr(i7 127 , i7 6)
-@l = constant i7 ashr(i7 127 , i7 6)
-@m2= constant i7 ashr(i7 -1 , i7 3)
-
-@n = constant i7 mul(i7 127, i7 2)
-@t = constant i7 mul(i7 -63, i7 -2)
-@u = constant i7 mul(i7 -32, i7 2)
-@v = constant i7 sdiv(i7 -1, i7 63)
-@w = constant i7 udiv(i7 -1, i7 63)
-@x = constant i7 srem(i7 1 , i7 126)
-@y = constant i7 urem(i7 127, i7 -1)
-@o = constant i7 trunc( i8 128 to i7 )
-@p = constant i7 trunc( i8 255 to i7 )
-
diff --git a/release_23/test/Integer/a7.ll.out b/release_23/test/Integer/a7.ll.out
deleted file mode 100644
index a6ed28816fff..000000000000
--- a/release_23/test/Integer/a7.ll.out
+++ /dev/null
@@ -1,24 +0,0 @@
-; ModuleID = '<stdin>'
-@b = constant i7 0 ; <i7*> [#uses=0]
-@q = constant i7 63 ; <i7*> [#uses=0]
-@c = constant i7 -2 ; <i7*> [#uses=0]
-@d = constant i7 0 ; <i7*> [#uses=0]
-@e = constant i7 -1 ; <i7*> [#uses=0]
-@f = constant i7 1 ; <i7*> [#uses=0]
-@g = constant i7 3 ; <i7*> [#uses=0]
-@r = constant i7 5 ; <i7*> [#uses=0]
-@s = constant i7 5 ; <i7*> [#uses=0]
-@h = constant i7 undef ; <i7*> [#uses=0]
-@i = constant i7 -64 ; <i7*> [#uses=0]
-@j = constant i7 1 ; <i7*> [#uses=0]
-@l = constant i7 -1 ; <i7*> [#uses=0]
-@m2 = constant i7 -1 ; <i7*> [#uses=0]
-@n = constant i7 -2 ; <i7*> [#uses=0]
-@t = constant i7 -2 ; <i7*> [#uses=0]
-@u = constant i7 -64 ; <i7*> [#uses=0]
-@v = constant i7 0 ; <i7*> [#uses=0]
-@w = constant i7 2 ; <i7*> [#uses=0]
-@x = constant i7 1 ; <i7*> [#uses=0]
-@y = constant i7 0 ; <i7*> [#uses=0]
-@o = constant i7 0 ; <i7*> [#uses=0]
-@p = constant i7 -1 ; <i7*> [#uses=0]
diff --git a/release_23/test/Integer/a9.ll b/release_23/test/Integer/a9.ll
deleted file mode 100644
index 711ec821c295..000000000000
--- a/release_23/test/Integer/a9.ll
+++ /dev/null
@@ -1,25 +0,0 @@
-; RUN: llvm-as %s -o - | llvm-dis > %t.ll
-; RUN: diff %t.ll %s.out
-
-; test 9 bits
-;
-@b = constant i9 add(i9 511, i9 1)
-@c = constant i9 add(i9 511, i9 511)
-@d = constant i9 add(i9 504, i9 8)
-@e = constant i9 sub(i9 0 , i9 1)
-@f = constant i9 sub(i9 0 , i9 511)
-@g = constant i9 sub(i9 2 , i9 511)
-
-@h = constant i9 shl(i9 1 , i9 9)
-@i = constant i9 shl(i9 1 , i9 8)
-@j = constant i9 lshr(i9 511 , i9 8)
-@l = constant i9 ashr(i9 511 , i9 8)
-
-@n = constant i9 mul(i9 511, i9 2)
-@q = constant i9 sdiv(i9 511, i9 2)
-@r = constant i9 udiv(i9 511, i9 2)
-@s = constant i9 urem(i9 511, i9 -1)
-@t = constant i9 srem(i9 1, i9 510)
-@o = constant i9 trunc( i10 512 to i9 )
-@p = constant i9 trunc( i10 511 to i9 )
-
diff --git a/release_23/test/Integer/a9.ll.out b/release_23/test/Integer/a9.ll.out
deleted file mode 100644
index 6525b9aad578..000000000000
--- a/release_23/test/Integer/a9.ll.out
+++ /dev/null
@@ -1,18 +0,0 @@
-; ModuleID = '<stdin>'
-@b = constant i9 0 ; <i9*> [#uses=0]
-@c = constant i9 -2 ; <i9*> [#uses=0]
-@d = constant i9 0 ; <i9*> [#uses=0]
-@e = constant i9 -1 ; <i9*> [#uses=0]
-@f = constant i9 1 ; <i9*> [#uses=0]
-@g = constant i9 3 ; <i9*> [#uses=0]
-@h = constant i9 undef ; <i9*> [#uses=0]
-@i = constant i9 -256 ; <i9*> [#uses=0]
-@j = constant i9 1 ; <i9*> [#uses=0]
-@l = constant i9 -1 ; <i9*> [#uses=0]
-@n = constant i9 -2 ; <i9*> [#uses=0]
-@q = constant i9 0 ; <i9*> [#uses=0]
-@r = constant i9 255 ; <i9*> [#uses=0]
-@s = constant i9 0 ; <i9*> [#uses=0]
-@t = constant i9 1 ; <i9*> [#uses=0]
-@o = constant i9 0 ; <i9*> [#uses=0]
-@p = constant i9 -1 ; <i9*> [#uses=0]
diff --git a/release_23/test/Integer/alignment_bt.ll b/release_23/test/Integer/alignment_bt.ll
deleted file mode 100644
index 635cb1f6b37f..000000000000
--- a/release_23/test/Integer/alignment_bt.ll
+++ /dev/null
@@ -1,21 +0,0 @@
-; RUN: llvm-as %s -o - | llvm-dis > %t1.ll
-; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
-; RUN: diff %t1.ll %t2.ll
-
-@X = global i19 4, align 16
-
-define i19 *@test() align 32 {
- %X = alloca i19, align 4
- %Y = alloca i51, i32 42, align 16
- %Z = alloca i32, align 0
- ret i19 *%X
-}
-
-define i19 *@test2() {
- %X = malloc i19, align 4
- %Y = malloc i51, i32 42, align 16
- %Z = malloc i32, align 0
- ret i19 *%X
-}
-
-
diff --git a/release_23/test/Integer/basictest_bt.ll b/release_23/test/Integer/basictest_bt.ll
deleted file mode 100644
index 5c98856d06b3..000000000000
--- a/release_23/test/Integer/basictest_bt.ll
+++ /dev/null
@@ -1,31 +0,0 @@
-; RUN: llvm-as %s -o - | llvm-dis > %t1.ll
-; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
-; RUN: diff %t1.ll %t2.ll
-
-
-; Test "stripped" format where nothing is symbolic... this is how the bytecode
-; format looks anyways (except for negative vs positive offsets)...
-;
-define void @void(i39, i39) {
- add i39 0, 0 ; <i39>:3 [#uses=2]
- sub i39 0, 4 ; <i39>:4 [#uses=2]
- br label %5
-
-; <label>:5 ; preds = %5, %2
- add i39 %0, %1 ; <i39>:6 [#uses=2]
- sub i39 %6, %4 ; <i39>:7 [#uses=1]
- icmp sle i39 %7, %3 ; <i1>:8 [#uses=1]
- br i1 %8, label %9, label %5
-
-; <label>:9 ; preds = %5
- add i39 %0, %1 ; <i39>:10 [#uses=0]
- sub i39 %6, %4 ; <i39>:11 [#uses=1]
- icmp sle i39 %11, %3 ; <i1>:12 [#uses=0]
- ret void
-}
-
-; This function always returns zero
-define i39 @zarro() {
-Startup:
- ret i39 0
-}
diff --git a/release_23/test/Integer/cfgstructures_bt.ll b/release_23/test/Integer/cfgstructures_bt.ll
deleted file mode 100644
index 09aec1fed219..000000000000
--- a/release_23/test/Integer/cfgstructures_bt.ll
+++ /dev/null
@@ -1,56 +0,0 @@
-; RUN: llvm-as %s -o - | llvm-dis > %t1.ll
-; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
-; RUN: diff %t1.ll %t2.ll
-
-
-;; This is an irreducible flow graph
-
-
-define void @"irreducible"(i1 %cond)
-begin
- br i1 %cond, label %X, label %Y
-
-X:
- br label %Y
-Y:
- br label %X
-end
-
-;; This is a pair of loops that share the same header
-
-define void @"sharedheader"(i1 %cond)
-begin
- br label %A
-A:
- br i1 %cond, label %X, label %Y
-
-X:
- br label %A
-Y:
- br label %A
-end
-
-;; This is a simple nested loop
-define void @"nested"(i1 %cond1, i1 %cond2, i1 %cond3)
-begin
- br label %Loop1
-
-Loop1:
- br label %Loop2
-
-Loop2:
- br label %Loop3
-
-Loop3:
- br i1 %cond3, label %Loop3, label %L3Exit
-
-L3Exit:
- br i1 %cond2, label %Loop2, label %L2Exit
-
-L2Exit:
- br i1 %cond1, label %Loop1, label %L1Exit
-
-L1Exit:
- ret void
-end
-
diff --git a/release_23/test/Integer/constexpr_bt.ll b/release_23/test/Integer/constexpr_bt.ll
deleted file mode 100644
index fc8b06d4f406..000000000000
--- a/release_23/test/Integer/constexpr_bt.ll
+++ /dev/null
@@ -1,84 +0,0 @@
-; RUN: llvm-as %s -o - | llvm-dis > %t1.ll
-; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
-; RUN: diff %t1.ll %t2.ll
-
-
-; This testcase is for testing expressions constructed from
-; constant values, including constant pointers to globals.
-;
-
-;;-------------------------------
-;; Test constant cast expressions
-;;-------------------------------
-
-global i63 u0x00001 ; hexadecimal unsigned integer constants
-global i63 s0x012312 ; hexadecimal signed integer constants
-
-@t2 = global i33* @t1 ;; Forward reference without cast
-@t3 = global i33* bitcast (i33* @t1 to i33*) ;; Forward reference with cast
-@t1 = global i33 4 ;; i32* @0
-@t4 = global i33** bitcast (i33** @t3 to i33**) ;; Cast of a previous cast
-@t5 = global i33** @t3 ;; Reference to a previous cast
-@t6 = global i33*** @t4
-@t7 = global float* inttoptr (i32 12345678 to float*) ;; Cast ordinary value to ptr
-@t9 = global i33 fptosi (float sitofp (i33 8 to float) to i33) ;; Nested cast expression
-
-
-global i32* bitcast (float* @4 to i32*) ;; Forward numeric reference
-global float* @4 ;; Duplicate forward numeric reference
-global float 0.0
-
-
-;;---------------------------------------------------
-;; Test constant getelementpr expressions for arrays
-;;---------------------------------------------------
-
-@array = constant [2 x i33] [ i33 12, i33 52 ]
-@arrayPtr = global i33* getelementptr ([2 x i33]* @array, i64 0, i64 0) ;; i33* &@array[0][0]
-@arrayPtr5 = global i33** getelementptr (i33** @arrayPtr, i64 5) ;; i33* &@arrayPtr[5]
-
-@somestr = constant [11x i8] c"hello world"
-@char5 = global i8* getelementptr([11x i8]* @somestr, i64 0, i64 5)
-
-;; cast of getelementptr
-@char8a = global i33* bitcast (i8* getelementptr([11x i8]* @somestr, i64 0, i64 8) to i33*)
-
-;; getelementptr containing casts
-@char8b = global i8* getelementptr([11x i8]* @somestr, i64 sext (i8 0 to i64), i64 sext (i8 8 to i64))
-
-;;-------------------------------------------------------
-;; TODO: Test constant getelementpr expressions for structures
-;;-------------------------------------------------------
-
-%SType = type { i33 , {float, {i8} }, i64 } ;; struct containing struct
-%SAType = type { i33 , {[2x float], i64} } ;; struct containing array
-
-@S1 = global %SType* null ;; Global initialized to NULL
-@S2c = constant %SType { i33 1, {float,{i8}} {float 2.0, {i8} {i8 3}}, i64 4}
-
-@S3c = constant %SAType { i33 1, {[2x float], i64} {[2x float] [float 2.0, float 3.0], i64 4} }
-
-@S1ptr = global %SType** @S1 ;; Ref. to global S1
-@S2 = global %SType* @S2c ;; Ref. to constant S2
-@S3 = global %SAType* @S3c ;; Ref. to constant S3
-
- ;; Pointer to float (**@S1).1.0
-@S1fld1a = global float* getelementptr (%SType* @S2c, i64 0, i32 1, i32 0)
- ;; Another ptr to the same!
-@S1fld1b = global float* getelementptr (%SType* @S2c, i64 0, i32 1, i32 0)
-
-@S1fld1bptr = global float** @S1fld1b ;; Ref. to previous pointer
-
- ;; Pointer to i8 (**@S2).1.1.0
-@S2fld3 = global i8* getelementptr (%SType* @S2c, i64 0, i32 1, i32 1, i32 0)
-
- ;; Pointer to float (**@S2).1.0[0]
-;@S3fld3 = global float* getelementptr (%SAType** @S3, i64 0, i64 0, i32 1, i32 0, i64 0)
-
-;;---------------------------------------------------------
-;; TODO: Test constant expressions for unary and binary operators
-;;---------------------------------------------------------
-
-;;---------------------------------------------------
-
-
diff --git a/release_23/test/Integer/constpointer_bt.ll b/release_23/test/Integer/constpointer_bt.ll
deleted file mode 100644
index 6be9ec336a3c..000000000000
--- a/release_23/test/Integer/constpointer_bt.ll
+++ /dev/null
@@ -1,32 +0,0 @@
-; RUN: llvm-as %s -o - | llvm-dis > %t1.ll
-; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
-; RUN: diff %t1.ll %t2.ll
-
-; This testcase is primarily used for testing that global values can be used as
-; constant pointer initializers. This is tricky because they can be forward
-; declared and involves an icky bytecode encoding. There is no meaningful
-; optimization that can be performed on this file, it is just here to test
-; assembly and disassembly.
-;
-
-
-@t3 = global i40 * @t1 ;; Forward reference
-@t1 = global i40 4
-@t4 = global i40 ** @t3 ;; reference to reference
-
-@t2 = global i40 * @t1
-
-global float * @2 ;; Forward numeric reference
-global float * @2 ;; Duplicate forward numeric reference
-global float 0.0
-global float * @2 ;; Numeric reference
-
-
-@fptr = global void() * @f ;; Forward ref method defn
-declare void @"f"() ;; External method
-
-@sptr1 = global [11x i8]* @somestr ;; Forward ref to a constant
-@somestr = constant [11x i8] c"hello world"
-@sptr2 = global [11x i8]* @somestr
-
-
diff --git a/release_23/test/Integer/dg.exp b/release_23/test/Integer/dg.exp
deleted file mode 100644
index 879685ca879d..000000000000
--- a/release_23/test/Integer/dg.exp
+++ /dev/null
@@ -1,3 +0,0 @@
-load_lib llvm.exp
-
-RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
diff --git a/release_23/test/Integer/fold-fpcast_bt.ll b/release_23/test/Integer/fold-fpcast_bt.ll
deleted file mode 100644
index 8e5f8386d775..000000000000
--- a/release_23/test/Integer/fold-fpcast_bt.ll
+++ /dev/null
@@ -1,33 +0,0 @@
-; RUN: llvm-as < %s | llvm-dis | not grep bitcast
-
-define i60 @test1() {
- ret i60 fptoui(float 0x400D9999A0000000 to i60)
-}
-
-define float @test2() {
- ret float uitofp(i60 17 to float)
-}
-
-define i64 @test3() {
- ret i64 bitcast (double 0x400921FB4D12D84A to i64)
-}
-
-define double @test4() {
- ret double bitcast (i64 42 to double)
-}
-
-define i30 @test5() {
- ret i30 fptoui(float 0x400D9999A0000000 to i30)
-}
-
-define float @test6() {
- ret float uitofp(i30 17 to float)
-}
-
-define i64 @test7() {
- ret i64 bitcast (double 0x400921FB4D12D84A to i64)
-}
-
-define double @test8() {
- ret double bitcast (i64 42 to double)
-}
diff --git a/release_23/test/Integer/forwardreftest_bt.ll b/release_23/test/Integer/forwardreftest_bt.ll
deleted file mode 100644
index 5d73eff2f5a9..000000000000
--- a/release_23/test/Integer/forwardreftest_bt.ll
+++ /dev/null
@@ -1,33 +0,0 @@
-; RUN: llvm-as %s -o - | llvm-dis > %t1.ll
-; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
-; RUN: diff %t1.ll %t2.ll
-
- %myty = type i55
- %myfn = type float (i55,double,i55,i16)
- type i55(%myfn*)
- type i55(i55)
- type i55(i55(i55)*)
-
- %thisfuncty = type i55 (i55) *
-
-declare void @F(%thisfuncty, %thisfuncty, %thisfuncty)
-
-; This function always returns zero
-define i55 @zarro(i55 %Func)
-begin
-Startup:
- add i55 0, 10
- ret i55 0
-end
-
-define i55 @test(i55)
-begin
- call void @F(%thisfuncty @zarro, %thisfuncty @test, %thisfuncty @foozball)
- ret i55 0
-end
-
-define i55 @foozball(i55)
-begin
- ret i55 0
-end
-
diff --git a/release_23/test/Integer/globalredefinition_bt.ll b/release_23/test/Integer/globalredefinition_bt.ll
deleted file mode 100644
index b369b2a5d800..000000000000
--- a/release_23/test/Integer/globalredefinition_bt.ll
+++ /dev/null
@@ -1,18 +0,0 @@
-; RUN: llvm-as %s -o - | llvm-dis > %t1.ll
-; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
-; RUN: diff %t1.ll %t2.ll
-
-; Test forward references and redefinitions of globals
-
-@A = global i17* @B
-@B = global i17 7
-
-declare void @X()
-
-declare void @X()
-
-define void @X() {
- ret void
-}
-
-declare void @X()
diff --git a/release_23/test/Integer/globalvars_bt.ll b/release_23/test/Integer/globalvars_bt.ll
deleted file mode 100644
index 5c43185574d6..000000000000
--- a/release_23/test/Integer/globalvars_bt.ll
+++ /dev/null
@@ -1,26 +0,0 @@
-; RUN: llvm-as %s -o - | llvm-dis > %t1.ll
-; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
-; RUN: diff %t1.ll %t2.ll
-
-
-
-@MyVar = external global i27
-@MyIntList = external global { \2 *, i27 }
- external global i27 ; i27*:0
-
-@AConst = constant i27 123
-
-@AString = constant [4 x i8] c"test"
-
-@ZeroInit = global { [100 x i27 ], [40 x float ] } { [100 x i27] zeroinitializer,
- [40 x float] zeroinitializer }
-
-
-define i27 @"foo"(i27 %blah)
-begin
- store i27 5, i27 *@MyVar
- %idx = getelementptr { \2 *, i27 } * @MyIntList, i64 0, i32 1
- store i27 12, i27* %idx
- ret i27 %blah
-end
-
diff --git a/release_23/test/Integer/indirectcall2_bt.ll b/release_23/test/Integer/indirectcall2_bt.ll
deleted file mode 100644
index 5b7c68df22c2..000000000000
--- a/release_23/test/Integer/indirectcall2_bt.ll
+++ /dev/null
@@ -1,24 +0,0 @@
-; RUN: llvm-as %s -o - | llvm-dis > %t1.ll
-; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
-; RUN: diff %t1.ll %t2.ll
-
-
-define i63 @"test"(i63 %X)
-begin
- ret i63 %X
-end
-
-define i63 @"fib"(i63 %n)
-begin
- %T = icmp ult i63 %n, 2 ; {i1}:0
- br i1 %T, label %BaseCase, label %RecurseCase
-
-RecurseCase:
- %result = call i63 @test(i63 %n)
- br label %BaseCase
-
-BaseCase:
- %X = phi i63 [1, %0], [2, %RecurseCase]
- ret i63 %X
-end
-
diff --git a/release_23/test/Integer/indirectcall_bt.ll b/release_23/test/Integer/indirectcall_bt.ll
deleted file mode 100644
index d586fca821f2..000000000000
--- a/release_23/test/Integer/indirectcall_bt.ll
+++ /dev/null
@@ -1,52 +0,0 @@
-; RUN: llvm-as %s -o - | llvm-dis > %t1.ll
-; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
-; RUN: diff %t1.ll %t2.ll
-
-
-declare i32 @"atoi"(i8 *)
-
-define i63 @"fib"(i63 %n)
-begin
- icmp ult i63 %n, 2 ; {i1}:1
- br i1 %1, label %BaseCase, label %RecurseCase
-
-BaseCase:
- ret i63 1
-
-RecurseCase:
- %n2 = sub i63 %n, 2
- %n1 = sub i63 %n, 1
- %f2 = call i63(i63) * @fib(i63 %n2)
- %f1 = call i63(i63) * @fib(i63 %n1)
- %result = add i63 %f2, %f1
- ret i63 %result
-end
-
-define i63 @"realmain"(i32 %argc, i8 ** %argv)
-begin
- icmp eq i32 %argc, 2 ; {i1}:1
- br i1 %1, label %HasArg, label %Continue
-HasArg:
- ; %n1 = atoi(argv[1])
- %n1 = add i32 1, 1
- br label %Continue
-
-Continue:
- %n = phi i32 [%n1, %HasArg], [1, %0]
- %N = sext i32 %n to i63
- %F = call i63(i63) *@fib(i63 %N)
- ret i63 %F
-end
-
-define i63 @"trampoline"(i63 %n, i63(i63)* %fibfunc)
-begin
- %F = call i63(i63) *%fibfunc(i63 %n)
- ret i63 %F
-end
-
-define i32 @"main"()
-begin
- %Result = call i63 @trampoline(i63 10, i63(i63) *@fib)
- %Result2 = trunc i63 %Result to i32
- ret i32 %Result2
-end
diff --git a/release_23/test/Integer/instructions_bt.ll b/release_23/test/Integer/instructions_bt.ll
deleted file mode 100644
index 7ca589035279..000000000000
--- a/release_23/test/Integer/instructions_bt.ll
+++ /dev/null
@@ -1,26 +0,0 @@
-; RUN: llvm-as %s -o - | llvm-dis > %t1.ll
-; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
-; RUN: diff %t1.ll %t2.ll
-
-
-define i39 @test_extractelement(<4 x i39> %V) {
- %R = extractelement <4 x i39> %V, i32 1
- ret i39 %R
-}
-
-define <4 x i39> @test_insertelement(<4 x i39> %V) {
- %R = insertelement <4 x i39> %V, i39 0, i32 0
- ret <4 x i39> %R
-}
-
-define <4 x i39> @test_shufflevector_u(<4 x i39> %V) {
- %R = shufflevector <4 x i39> %V, <4 x i39> %V,
- <4 x i32> < i32 1, i32 undef, i32 7, i32 2>
- ret <4 x i39> %R
-}
-
-define <4 x float> @test_shufflevector_f(<4 x float> %V) {
- %R = shufflevector <4 x float> %V, <4 x float> undef,
- <4 x i32> < i32 1, i32 undef, i32 7, i32 2>
- ret <4 x float> %R
-}
diff --git a/release_23/test/Integer/newcasts_bt.ll b/release_23/test/Integer/newcasts_bt.ll
deleted file mode 100644
index e2eee4f7f12e..000000000000
--- a/release_23/test/Integer/newcasts_bt.ll
+++ /dev/null
@@ -1,28 +0,0 @@
-; RUN: llvm-as %s -o - | llvm-dis > %t1.ll
-; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
-; RUN: diff %t1.ll %t2.ll
-
-define void @"NewCasts" (i17 %x) {
- %a = zext i17 %x to i32
- %b = sext i17 %x to i32
- %c = trunc i17 %x to i8
- %d = uitofp i17 %x to float
- %e = sitofp i17 %x to double
- %f = fptoui float %d to i17
- %g = fptosi double %e to i17
- %i = fpext float %d to double
- %j = fptrunc double %i to float
- %k = bitcast i32 %a to float
- %l = inttoptr i17 %x to i32*
- %m = ptrtoint i32* %l to i64
- ret void
-}
-
-
-define i17 @"ZExtConst" () {
- ret i17 trunc ( i32 zext ( i17 42 to i32) to i17 )
-}
-
-define i17 @"SExtConst" () {
- ret i17 trunc (i32 sext (i17 42 to i32) to i17 )
-}
diff --git a/release_23/test/Integer/opaquetypes_bt.ll b/release_23/test/Integer/opaquetypes_bt.ll
deleted file mode 100644
index a1ba799c2c26..000000000000
--- a/release_23/test/Integer/opaquetypes_bt.ll
+++ /dev/null
@@ -1,60 +0,0 @@
-; RUN: llvm-as %s -o - | llvm-dis > %t1.ll
-; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
-; RUN: diff %t1.ll %t2.ll
-
-; This test case is used to test opaque type processing, forward references,
-; and recursive types. Oh my.
-;
-
-%SQ1 = type { i31 }
-%ITy = type opaque
-%SQ2 = type { %ITy }
-%ITy = type i31
-
-
-%CCC = type { \2* }
-%BBB = type { \2*, \2 * }
-%AAA = type { \2*, {\2*}, [12x{\2*}], {[1x{\2*}]} }
-
-; Test numbered types
-type %CCC
-type %BBB
-%Composite = type { %0, %1 }
-
-; Test simple opaque type resolution...
-%i31ty = type opaque
-%i31ty = type i31
-
-; Perform a simple forward reference...
-%ty1 = type { %ty2, i31 }
-%ty2 = type float
-
-; Do a recursive type...
-%list = type { %list * }
-%listp = type { %listp } *
-
-; Do two mutually recursive types...
-%TyA = type { %ty2, %TyB * }
-%TyB = type { double, %TyA * }
-
-; A complex recursive type...
-%Y = type { {%Y*}, %Y* }
-%Z = type { { %Z * }, [12x%Z] *, {{{ %Z * }}} }
-
-; More ridiculous test cases...
-%A = type [ 123x %A*]
-%M = type %M (%M, %M) *
-%P = type %P*
-
-; Recursive ptrs
-%u = type %v*
-%v = type %u*
-
-; Test the parser for unnamed recursive types...
-%P1 = type \1 *
-%Y1 = type { { \3 * }, \2 * }
-%Z1 = type { { \3 * }, [12x\3] *, { { { \5 * } } } }
-
-
-
-
diff --git a/release_23/test/Integer/packed_bt.ll b/release_23/test/Integer/packed_bt.ll
deleted file mode 100644
index 5a2045d6a296..000000000000
--- a/release_23/test/Integer/packed_bt.ll
+++ /dev/null
@@ -1,16 +0,0 @@
-; RUN: llvm-as %s -o - | llvm-dis > %t1.ll
-; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
-; RUN: diff %t1.ll %t2.ll
-
-@foo1 = external global <4 x float>;
-@foo2 = external global <2 x i10>;
-
-
-define void @main()
-{
- store <4 x float> <float 1.0, float 2.0, float 3.0, float 4.0>, <4 x float>* @foo1
- store <2 x i10> <i10 4, i10 4>, <2 x i10>* @foo2
- %l1 = load <4 x float>* @foo1
- %l2 = load <2 x i10>* @foo2
- ret void
-}
diff --git a/release_23/test/Integer/packed_struct_bt.ll b/release_23/test/Integer/packed_struct_bt.ll
deleted file mode 100644
index 3713917ac972..000000000000
--- a/release_23/test/Integer/packed_struct_bt.ll
+++ /dev/null
@@ -1,33 +0,0 @@
-; RUN: llvm-as < %s | llvm-dis > %t1.ll
-; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
-; RUN: diff %t1.ll %t2.ll
-; RUN: not grep cast %t2.ll
-; RUN: grep {\<\{} %t2.ll
-; END.
-
-%struct.anon = type <{ i8, i35, i35, i35 }>
-@foos = external global %struct.anon
-@bara = external global [2 x <{ i35, i8 }>]
-
-;initializers should work for packed and non-packed the same way
-@E1 = global <{i8, i35, i35}> <{i8 1, i35 2, i35 3}>
-@E2 = global {i8, i35, i35} {i8 4, i35 5, i35 6}
-
-
-define i35 @main()
-{
- %tmp = load i35* getelementptr (%struct.anon* @foos, i32 0, i32 1) ; <i35> [#uses=1]
- %tmp3 = load i35* getelementptr (%struct.anon* @foos, i32 0, i32 2) ; <i35> [#uses=1]
- %tmp6 = load i35* getelementptr (%struct.anon* @foos, i32 0, i32 3) ; <i35> [#uses=1]
- %tmp4 = add i35 %tmp3, %tmp ; <i35> [#uses=1]
- %tmp7 = add i35 %tmp4, %tmp6 ; <i35> [#uses=1]
- ret i35 %tmp7
-}
-
-define i35 @bar() {
-entry:
- %tmp = load i35* getelementptr([2 x <{ i35, i8 }>]* @bara, i32 0, i32 0, i32 0 ) ; <i35> [#uses=1]
- %tmp4 = load i35* getelementptr ([2 x <{ i35, i8 }>]* @bara, i32 0, i32 1, i32 0) ; <i35> [#uses=1]
- %tmp5 = add i35 %tmp4, %tmp ; <i35> [#uses=1]
- ret i35 %tmp5
-}
diff --git a/release_23/test/Integer/paramattrs_bt.ll b/release_23/test/Integer/paramattrs_bt.ll
deleted file mode 100644
index 47ef7539b3e3..000000000000
--- a/release_23/test/Integer/paramattrs_bt.ll
+++ /dev/null
@@ -1,19 +0,0 @@
-; RUN: llvm-as < %s | llvm-dis > %t1.ll
-; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
-; RUN: diff %t1.ll %t2.ll
-
-%ZFunTy = type i33(i8 zeroext)
-%SFunTy = type i33(i8 signext)
-
-declare i16 @"test"(i16 signext %arg) signext
-declare i8 @"test2" (i16 zeroext %a2) zeroext
-
-
-define i33 @main(i33 %argc, i8 **%argv) {
- %val = trunc i33 %argc to i16
- %res = call i16 (i16 signext) signext *@test(i16 signext %val) signext
- %two = add i16 %res, %res
- %res2 = call i8 @test2(i16 %two zeroext) zeroext
- %retVal = sext i16 %two to i33
- ret i33 %retVal
-}
diff --git a/release_23/test/Integer/properties_bt.ll b/release_23/test/Integer/properties_bt.ll
deleted file mode 100644
index f24ddc2e80ef..000000000000
--- a/release_23/test/Integer/properties_bt.ll
+++ /dev/null
@@ -1,9 +0,0 @@
-; RUN: llvm-as %s -o - | llvm-dis > %t1.ll
-; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
-; RUN: diff %t1.ll %t2.ll
-
-
-target datalayout = "e-p:32:32"
-target triple = "proc-vend-sys"
-deplibs = [ "m", "c" ]
-
diff --git a/release_23/test/Integer/prototype_bt.ll b/release_23/test/Integer/prototype_bt.ll
deleted file mode 100644
index 2236e8bf38fc..000000000000
--- a/release_23/test/Integer/prototype_bt.ll
+++ /dev/null
@@ -1,13 +0,0 @@
-; RUN: llvm-as %s -o - | llvm-dis > %t1.ll
-; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
-; RUN: diff %t1.ll %t2.ll
-
-
-declare i31 @"bar"(i31 %in)
-
-define i31 @"foo"(i31 %blah)
-begin
- %xx = call i31 @bar(i31 %blah)
- ret i31 %xx
-end
-
diff --git a/release_23/test/Integer/recursivetype_bt.ll b/release_23/test/Integer/recursivetype_bt.ll
deleted file mode 100644
index d5ce3f5dd40d..000000000000
--- a/release_23/test/Integer/recursivetype_bt.ll
+++ /dev/null
@@ -1,108 +0,0 @@
-; RUN: llvm-as %s -o - | llvm-dis > %t1.ll
-; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
-; RUN: diff %t1.ll %t2.ll
-
-
-; This file contains the output from the following compiled C code:
-; typedef struct list {
-; struct list *Next;
-; i32 Data;
-; } list;
-;
-; // Iterative insert fn
-; void InsertIntoListTail(list **L, i32 Data) {
-; while (*L)
-; L = &(*L)->Next;
-; *L = (list*)malloc(sizeof(list));
-; (*L)->Data = Data;
-; (*L)->Next = 0;
-; }
-;
-; // Recursive list search fn
-; list *FindData(list *L, i32 Data) {
-; if (L == 0) return 0;
-; if (L->Data == Data) return L;
-; return FindData(L->Next, Data);
-; }
-;
-; void DoListStuff() {
-; list *MyList = 0;
-; InsertIntoListTail(&MyList, 100);
-; InsertIntoListTail(&MyList, 12);
-; InsertIntoListTail(&MyList, 42);
-; InsertIntoListTail(&MyList, 1123);
-; InsertIntoListTail(&MyList, 1213);
-;
-; if (FindData(MyList, 75)) foundIt();
-; if (FindData(MyList, 42)) foundIt();
-; if (FindData(MyList, 700)) foundIt();
-; }
-
-%list = type { %list*, i36 }
-
-declare i8 *@"malloc"(i32)
-
-;;**********************
-;;**********************
-
-define void @"InsertIntoListTail"(%list** %L, i36 %Data)
-begin
-bb1:
- %reg116 = load %list** %L ;;<%list*>
- %cast1004 = inttoptr i64 0 to %list* ;;<%list*>
- %cond1000 = icmp eq %list* %reg116, %cast1004 ;;<i1>
- br i1 %cond1000, label %bb3, label %bb2
-
-bb2:
- %reg117 = phi %list** [ %reg118, %bb2 ], [ %L, %bb1 ] ;;<%list**>
- %cast1010 = bitcast %list** %reg117 to %list*** ;;<%list***>
- %reg118 = load %list*** %cast1010 ;;<%list**>
- %reg109 = load %list** %reg118 ;;<%list*>
- %cast1005 = inttoptr i64 0 to %list* ;;<%list*>
- %cond1001 = icmp ne %list* %reg109, %cast1005 ;;<i1>
- br i1 %cond1001, label %bb2, label %bb3
-
-bb3:
- %reg119 = phi %list** [ %reg118, %bb2 ], [ %L, %bb1 ] ;;<%list**>
- %cast1006 = bitcast %list** %reg119 to i8** ;;<i8**>
- %reg111 = call i8* @malloc(i32 16) ;;<i8*>
- store i8* %reg111, i8** %cast1006 ;;<void>
- %reg112 = ptrtoint i8* %reg111 to i64
- %reg1002 = add i64 %reg112, 8
- %reg1005 = inttoptr i64 %reg1002 to i8* ;;<i8*>
- %cast1008 = bitcast i8* %reg1005 to i36* ;;<i36*>
- store i36 %Data, i36* %cast1008 ;;<void>
- %cast1003 = inttoptr i64 0 to i64* ;;<i64*>
- %cast1009 = bitcast i8* %reg111 to i64** ;;<i64**>
- store i64* %cast1003, i64** %cast1009 ;;<void>
- ret void
-end
-
-define %list* @"FindData"(%list* %L, i36 %Data)
-begin
-bb1:
- br label %bb2
-
-bb2:
- %reg115 = phi %list* [ %reg116, %bb6 ], [ %L, %bb1 ] ;;<%list*>
- %cast1014 = inttoptr i64 0 to %list* ;;<%list*>
- %cond1011 = icmp ne %list* %reg115, %cast1014 ;;<i1>
- br i1 %cond1011, label %bb4, label %bb3
-
-bb3:
- ret %list* null
-
-bb4:
- %idx = getelementptr %list* %reg115, i64 0, i32 1 ;;<i36>
- %reg111 = load i36* %idx
- %cond1013 = icmp ne i36 %reg111, %Data ;;<i1>
- br i1 %cond1013, label %bb6, label %bb5
-
-bb5:
- ret %list* %reg115
-
-bb6:
- %idx2 = getelementptr %list* %reg115, i64 0, i32 0 ;;<%list*>
- %reg116 = load %list** %idx2
- br label %bb2
-end
diff --git a/release_23/test/Integer/simplecalltest_bt.ll b/release_23/test/Integer/simplecalltest_bt.ll
deleted file mode 100644
index 45dc0f1aaca2..000000000000
--- a/release_23/test/Integer/simplecalltest_bt.ll
+++ /dev/null
@@ -1,28 +0,0 @@
-; RUN: llvm-as %s -o - | llvm-dis > %t1.ll
-; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
-; RUN: diff %t1.ll %t2.ll
-
-%FunTy = type i31(i31)
-
-
-define void @"invoke"(%FunTy *%x)
-begin
- %foo = call %FunTy* %x(i31 123)
- ret void
-end
-
-define i31 @"main"(i31 %argc, i8 **%argv, i8 **%envp)
-begin
- %retval = call i31 (i31) *@test(i31 %argc)
- %two = add i31 %retval, %retval
- %retval2 = call i31 @test(i31 %argc)
-
- %two2 = add i31 %two, %retval2
- call void @invoke (%FunTy* @test)
- ret i31 %two2
-end
-
-define i31 @"test"(i31 %i0)
-begin
- ret i31 %i0
-end
diff --git a/release_23/test/Integer/small_bt.ll b/release_23/test/Integer/small_bt.ll
deleted file mode 100644
index 00fcace0fbe6..000000000000
--- a/release_23/test/Integer/small_bt.ll
+++ /dev/null
@@ -1,13 +0,0 @@
-; RUN: llvm-as %s -o - | llvm-dis > %t1.ll
-; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
-; RUN: diff %t1.ll %t2.ll
-
-%x = type i19
-
-
-define i19 @"foo"(i19 %in)
-begin
-label:
- ret i19 2
-end
-
diff --git a/release_23/test/Integer/testalloca_bt.ll b/release_23/test/Integer/testalloca_bt.ll
deleted file mode 100644
index e8e73c50878d..000000000000
--- a/release_23/test/Integer/testalloca_bt.ll
+++ /dev/null
@@ -1,28 +0,0 @@
-; RUN: llvm-as %s -o - | llvm-dis > %t1.ll
-; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
-; RUN: diff %t1.ll %t2.ll
-
-
-%inners = type {float, {i8 } }
-%struct = type { i33 , {float, {i8 } } , i64 }
-
-
-define i33 @testfunction(i33 %i0, i33 %j0)
-begin
- alloca i8, i32 5
- %ptr = alloca i33 ; yields {i33*}:ptr
- store i33 3, i33* %ptr ; yields {void}
- %val = load i33* %ptr ; yields {i33}:val = i33 %3
-
- %sptr = alloca %struct ; yields {%struct*}:sptr
- %nsptr = getelementptr %struct * %sptr, i64 0, i32 1 ; yields {inners*}:nsptr
- %ubsptr = getelementptr %inners * %nsptr, i64 0, i32 1 ; yields {{i8}*}:ubsptr
- %idx = getelementptr {i8} * %ubsptr, i64 0, i32 0
- store i8 4, i8* %idx
-
- %fptr = getelementptr %struct * %sptr, i64 0, i32 1, i32 0 ; yields {float*}:fptr
- store float 4.0, float * %fptr
-
- ret i33 3
-end
-
diff --git a/release_23/test/Integer/testarith_bt.ll b/release_23/test/Integer/testarith_bt.ll
deleted file mode 100644
index 0820399a3092..000000000000
--- a/release_23/test/Integer/testarith_bt.ll
+++ /dev/null
@@ -1,21 +0,0 @@
-; RUN: llvm-as %s -o - | llvm-dis > %t1.ll
-; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
-; RUN: diff %t1.ll %t2.ll
-
-
-define i31 @"simpleArith"(i31 %i0, i31 %j0)
-begin
- %t1 = add i31 %i0, %j0
- %t2 = sub i31 %i0, %j0
- %t3 = mul i31 %t1, %t2
- %t4 = udiv i31 %t1, %t2
- %t5 = sdiv i31 %t1, %t2
- %t6 = urem i31 %t1, %t2
- %t7 = srem i31 %t1, %t2
- %t8 = shl i31 %t1, 9
- %t9 = lshr i31 %t1, 9
- %t10= ashr i31 %t1, 9
- %f1 = sitofp i31 %t1 to float
- %f2 = fdiv float 4.0, %f1
- ret i31 %t3
-end
diff --git a/release_23/test/Integer/testconstants_bt.ll b/release_23/test/Integer/testconstants_bt.ll
deleted file mode 100644
index 8ca49cf52426..000000000000
--- a/release_23/test/Integer/testconstants_bt.ll
+++ /dev/null
@@ -1,32 +0,0 @@
-; RUN: llvm-as %s -o - | llvm-dis > %t1.ll
-; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
-; RUN: diff %t1.ll %t2.ll
-
-@somestr = constant [11x i8] c"hello world"
-@array = constant [2 x i55] [ i55 12, i55 52 ]
- constant { i55, i55 } { i55 4, i55 3 }
-
-
-define [2 x i55]* @testfunction(i55 %i0, i55 %j0)
-begin
- ret [2x i55]* @array
-end
-
-define i8* @otherfunc(i55, double)
-begin
- %somestr = getelementptr [11x i8]* @somestr, i64 0, i64 0
- ret i8* %somestr
-end
-
-define i8* @yetanotherfunc(i55, double)
-begin
- ret i8* null ; Test null
-end
-
-define i55 @negativeUnsigned() {
- ret i55 -1
-}
-
-define i55 @largeSigned() {
- ret i55 3900000000
-}
diff --git a/release_23/test/Integer/testicmp_bt.ll b/release_23/test/Integer/testicmp_bt.ll
deleted file mode 100644
index 40a2465b5a4c..000000000000
--- a/release_23/test/Integer/testicmp_bt.ll
+++ /dev/null
@@ -1,23 +0,0 @@
-; RUN: llvm-as %s -o - | llvm-dis > %t1.ll
-; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
-; RUN: diff %t1.ll %t2.ll
-
-
-define i31 @"simpleIcmp"(i31 %i0, i31 %j0)
-begin
- %t1 = icmp eq i31 %i0, %j0
- %t2 = icmp ne i31 %i0, %j0
- %t3 = icmp ult i31 %i0, %j0
- %t4 = icmp sgt i31 %i0, %j0
- %t5 = icmp ule i31 %i0, %j0
- %t6 = icmp sge i31 %i0, %j0
-
- %t7 = icmp eq i31 %i0, 1098765432
- %t8 = icmp ne i31 %i0, -31415926
-
- %t9 = icmp ult i31 10000, %j0
- %t10 = icmp sgt i31 -10000, %j0
-
-
- ret i31 %i0
-end
diff --git a/release_23/test/Integer/testlogical_bt.ll b/release_23/test/Integer/testlogical_bt.ll
deleted file mode 100644
index a2c927d5d7f3..000000000000
--- a/release_23/test/Integer/testlogical_bt.ll
+++ /dev/null
@@ -1,13 +0,0 @@
-; RUN: llvm-as %s -o - | llvm-dis > %t1.ll
-; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
-; RUN: diff %t1.ll %t2.ll
-
-
-define i31 @"simpleAdd"(i31 %i0, i31 %j0)
-begin
- %t1 = xor i31 %i0, %j0
- %t2 = or i31 %i0, %j0
- %t3 = and i31 %t1, %t2
- ret i31 %t3
-end
-
diff --git a/release_23/test/Integer/testlogical_new_bt.ll b/release_23/test/Integer/testlogical_new_bt.ll
deleted file mode 100644
index 49a26dc07b07..000000000000
--- a/release_23/test/Integer/testlogical_new_bt.ll
+++ /dev/null
@@ -1,15 +0,0 @@
-; RUN: llvm-as %s -o - | llvm-dis > %t1.ll
-; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
-; RUN: diff %t1.ll %t2.ll
-
-
-define i31 @"simpleAdd"(i31 %i0, i31 %j0)
-begin
- %t1 = xor i31 %i0, %j0
- %t2 = or i31 %i0, %j0
- %t3 = and i31 %t1, %t2
- %t4 = shl i31 %i0, 2
- %t5 = ashr i31 %i0, 2
- %t6 = lshr i31 %j0, 22
- ret i31 %t3
-end
diff --git a/release_23/test/Integer/testmemory_bt.ll b/release_23/test/Integer/testmemory_bt.ll
deleted file mode 100644
index e503c56a33e6..000000000000
--- a/release_23/test/Integer/testmemory_bt.ll
+++ /dev/null
@@ -1,45 +0,0 @@
-; RUN: llvm-as %s -o - | llvm-dis > %t1.ll
-; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
-; RUN: diff %t1.ll %t2.ll
-
-
-%struct = type { i31 , {float, {i9 } } , i64 }
-%complexty = type {i31, {[4 x i9 *], float}, double}
-
-
-define i31 @"main"()
-begin
- call i31 @testfunction(i64 0, i64 1)
- ret i31 0
-end
-
-define i31 @"testfunction"(i64 %i0, i64 %j0)
-begin
- %array0 = malloc [4 x i9] ; yields {[4 x i9]*}:array0
- %size = add i32 2, 2 ; yields {i31}:size = i31 %4
- %array1 = malloc i9, i32 4 ; yields {i9*}:array1
- %array2 = malloc i9, i32 %size ; yields {i9*}:array2
-
- %idx = getelementptr [4 x i9]* %array0, i64 0, i64 2
- store i9 123, i9* %idx
- free [4x i9]* %array0
- free i9* %array1
- free i9* %array2
-
-
- %aa = alloca %complexty, i32 5
- %idx2 = getelementptr %complexty* %aa, i64 %i0, i32 1, i32 0, i64 %j0
- store i9 *null, i9** %idx2
-
- %ptr = alloca i31 ; yields {i31*}:ptr
- store i31 3, i31* %ptr ; yields {void}
- %val = load i31* %ptr ; yields {i31}:val = i31 %3
-
- %sptr = alloca %struct ; yields {%struct*}:sptr
- %ubsptr = getelementptr %struct * %sptr, i64 0, i32 1, i32 1 ; yields {{i9}*}:ubsptr
- %idx3 = getelementptr {i9} * %ubsptr, i64 0, i32 0
- store i9 4, i9* %idx3
-
- ret i31 3
-end
-
diff --git a/release_23/test/Integer/testswitch_bt.ll b/release_23/test/Integer/testswitch_bt.ll
deleted file mode 100644
index bf7cdc510d61..000000000000
--- a/release_23/test/Integer/testswitch_bt.ll
+++ /dev/null
@@ -1,24 +0,0 @@
-; RUN: llvm-as %s -o - | llvm-dis > %t1.ll
-; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
-; RUN: diff %t1.ll %t2.ll
-
- %i35 = type i35
-
-
-define i35 @"squared"(%i35 %i0)
-begin
- switch i35 %i0, label %Default [
- i35 1, label %Case1
- i35 2, label %Case2
- i35 4, label %Case4 ]
-
-Default:
- ret i35 -1 ; Unrecognized input value
-
-Case1:
- ret i35 1
-Case2:
- ret i35 4
-Case4:
- ret i35 16
-end
diff --git a/release_23/test/Integer/testvarargs_bt.ll b/release_23/test/Integer/testvarargs_bt.ll
deleted file mode 100644
index a645c84ef3e4..000000000000
--- a/release_23/test/Integer/testvarargs_bt.ll
+++ /dev/null
@@ -1,14 +0,0 @@
-; RUN: llvm-as %s -o - | llvm-dis > %t1.ll
-; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
-; RUN: diff %t1.ll %t2.ll
-
-
-declare i31 @"printf"(i8*, ...) ;; Prototype for: i32 __builtin_printf(const char*, ...)
-
-define i31 @"testvarar"()
-begin
- call i31(i8*, ...) *@printf(i8 * null, i31 12, i8 42);
- ret i31 %1
-end
-
-
diff --git a/release_23/test/Integer/undefined_bt.ll b/release_23/test/Integer/undefined_bt.ll
deleted file mode 100644
index 7eba59039b95..000000000000
--- a/release_23/test/Integer/undefined_bt.ll
+++ /dev/null
@@ -1,18 +0,0 @@
-; RUN: llvm-as %s -o - | llvm-dis > %t1.ll
-; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
-; RUN: diff %t1.ll %t2.ll
-
-
-@X = global i31 undef
-
-
-declare i32 @"atoi"(i8 *)
-
-define i63 @test() {
- ret i63 undef
-}
-
-define i31 @test2() {
- %X = add i31 undef, 1
- ret i31 %X
-}
diff --git a/release_23/test/Integer/unreachable_bt.ll b/release_23/test/Integer/unreachable_bt.ll
deleted file mode 100644
index cb65d4b9ec8a..000000000000
--- a/release_23/test/Integer/unreachable_bt.ll
+++ /dev/null
@@ -1,16 +0,0 @@
-; RUN: llvm-as %s -o - | llvm-dis > %t1.ll
-; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
-; RUN: diff %t1.ll %t2.ll
-
-
-
-declare void @bar()
-
-define i9 @foo() { ;; Calling this function has undefined behavior
- unreachable
-}
-
-define double @xyz() {
- call void @bar()
- unreachable ;; Bar must not return.
-}
diff --git a/release_23/test/Integer/varargs_bt.ll b/release_23/test/Integer/varargs_bt.ll
deleted file mode 100644
index e740fd36b47e..000000000000
--- a/release_23/test/Integer/varargs_bt.ll
+++ /dev/null
@@ -1,23 +0,0 @@
-; RUN: llvm-as %s -o - | llvm-dis > %t1.ll;
-; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
-; RUN: diff %t1.ll %t2.ll
-
-; Demonstrate all of the variable argument handling intrinsic functions plus
-; the va_arg instruction.
-
-declare void @llvm.va_start(i8** %ap)
-declare void @llvm.va_copy(i8** %aq, i8** %ap)
-declare void @llvm.va_end(i8** %ap)
-
-define i33 @test(i33 %X, ...) {
- %ap = alloca i8*
- call void @llvm.va_start(i8** %ap)
- %tmp = va_arg i8** %ap, i33
-
- %aq = alloca i8*
- call void @llvm.va_copy(i8** %aq, i8** %ap)
- call void @llvm.va_end(i8** %aq)
-
- call void @llvm.va_end(i8** %ap)
- ret i33 %tmp
-}
diff --git a/release_23/test/Integer/varargs_new_bt.ll b/release_23/test/Integer/varargs_new_bt.ll
deleted file mode 100644
index 59bb3f2969ef..000000000000
--- a/release_23/test/Integer/varargs_new_bt.ll
+++ /dev/null
@@ -1,32 +0,0 @@
-; RUN: llvm-as %s -o - | llvm-dis > %t1.ll
-; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
-; RUN: diff %t1.ll %t2.ll
-
-; Demonstrate all of the variable argument handling intrinsic functions plus
-; the va_arg instruction.
-
-declare void @llvm.va_start(i8**)
-declare void @llvm.va_copy(i8**, i8*)
-declare void @llvm.va_end(i8**)
-
-define i31 @test(i31 %X, ...) {
- ; Allocate two va_list items. On this target, va_list is of type i8*
- %ap = alloca i8* ; <i8**> [#uses=4]
- %aq = alloca i8* ; <i8**> [#uses=2]
-
- ; Initialize variable argument processing
- call void @llvm.va_start(i8** %ap)
-
- ; Read a single integer argument
- %tmp = va_arg i8** %ap, i31 ; <i31> [#uses=1]
-
- ; Demonstrate usage of llvm.va_copy and llvm_va_end
- %apv = load i8** %ap ; <i8*> [#uses=1]
- call void @llvm.va_copy(i8** %aq, i8* %apv)
- call void @llvm.va_end(i8** %aq)
-
- ; Stop processing of arguments.
- call void @llvm.va_end(i8** %ap)
- ret i31 %tmp
-
-}
diff --git a/release_23/test/LLVMC/dg.exp b/release_23/test/LLVMC/dg.exp
deleted file mode 100644
index a2e44b99859f..000000000000
--- a/release_23/test/LLVMC/dg.exp
+++ /dev/null
@@ -1,10 +0,0 @@
-load_lib llvm.exp
-
-if [ llvm_gcc_supports c ] then {
- RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{c}]]
-}
-
-if [ llvm_gcc_supports c++ ] then {
- RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{cpp}]]
-}
-
diff --git a/release_23/test/LLVMC/false.c b/release_23/test/LLVMC/false.c
deleted file mode 100644
index 4aa365d89a32..000000000000
--- a/release_23/test/LLVMC/false.c
+++ /dev/null
@@ -1,14 +0,0 @@
-// Test that we can compile .c files as C++ and vice versa
-// RUN: llvmc2 -x c++ %s -x c %p/test_data/false.cpp -x lisp -x whatnot -x none %p/test_data/false2.cpp -o %t
-// RUN: ./%t | grep hello
-
-#include <iostream>
-
-extern "C" void test();
-extern std::string test2();
-
-int main() {
- std::cout << "h";
- test();
- std::cout << test2() << '\n';
-}
diff --git a/release_23/test/LLVMC/hello.c b/release_23/test/LLVMC/hello.c
deleted file mode 100644
index bf917bcdea70..000000000000
--- a/release_23/test/LLVMC/hello.c
+++ /dev/null
@@ -1,12 +0,0 @@
-/*
- * Check that we can compile helloworld
- * RUN: llvmc2 %s -o %t
- * RUN: ./%t | grep hello
- */
-
-#include <stdio.h>
-
-int main() {
- printf("hello\n");
- return 0;
-}
diff --git a/release_23/test/LLVMC/hello.cpp b/release_23/test/LLVMC/hello.cpp
deleted file mode 100644
index a3148c3c164f..000000000000
--- a/release_23/test/LLVMC/hello.cpp
+++ /dev/null
@@ -1,8 +0,0 @@
-// Test that we can compile C++ code.
-// RUN: llvmc2 %s -o %t
-// RUN: ./%t | grep hello
-#include <iostream>
-
-int main() {
- std::cout << "hello" << '\n';
-}
diff --git a/release_23/test/LLVMC/test_data/false.cpp b/release_23/test/LLVMC/test_data/false.cpp
deleted file mode 100644
index d3a7102f8cca..000000000000
--- a/release_23/test/LLVMC/test_data/false.cpp
+++ /dev/null
@@ -1,17 +0,0 @@
-/* RUN: ignore */
-#include <stdio.h>
-
-/* Make this invalid C++ */
-typedef struct {
- int i;
- char c;
-} a;
-
-static a b = { .i = 65, .c = 'r'};
-
-void test() {
- b.i = 9;
- fflush(stdout);
- printf("el");
-}
-
diff --git a/release_23/test/LLVMC/test_data/false2.cpp b/release_23/test/LLVMC/test_data/false2.cpp
deleted file mode 100644
index a02051415ddd..000000000000
--- a/release_23/test/LLVMC/test_data/false2.cpp
+++ /dev/null
@@ -1,6 +0,0 @@
-// RUN: ignore
-#include <string>
-
-std::string test2() {
- return "lo";
-}
diff --git a/release_23/test/LLVMC/test_data/together.c b/release_23/test/LLVMC/test_data/together.c
deleted file mode 100644
index 1b9b5f67fba9..000000000000
--- a/release_23/test/LLVMC/test_data/together.c
+++ /dev/null
@@ -1,9 +0,0 @@
-/*
- * RUN: ignore
- */
-
-#include <stdio.h>
-
-void test() {
- printf("hello\n");
-}
diff --git a/release_23/test/LLVMC/together.cpp b/release_23/test/LLVMC/together.cpp
deleted file mode 100644
index 09f8d86379cb..000000000000
--- a/release_23/test/LLVMC/together.cpp
+++ /dev/null
@@ -1,9 +0,0 @@
-// Check that we can compile files of different types together.
-// RUN: llvmc2 %s %p/test_data/together.c -o %t
-// RUN: ./%t | grep hello
-
-extern "C" void test();
-
-int main() {
- test();
-}
diff --git a/release_23/test/Linker/2002-07-17-GlobalFail.ll b/release_23/test/Linker/2002-07-17-GlobalFail.ll
deleted file mode 100644
index d3283106f6ec..000000000000
--- a/release_23/test/Linker/2002-07-17-GlobalFail.ll
+++ /dev/null
@@ -1,8 +0,0 @@
-; RUN: llvm-as < %s > %t.bc
-; RUN: echo | llvm-as > %t.tmp.bc
-; RUN: llvm-link %t.tmp.bc %t.bc
-
-@X = constant i32 5 ; <i32*> [#uses=2]
-@Y = internal global [2 x i32*] [ i32* @X, i32* @X ] ; <[2 x i32*]*> [#uses=0]
-
-
diff --git a/release_23/test/Linker/2002-07-17-LinkTest2.ll b/release_23/test/Linker/2002-07-17-LinkTest2.ll
deleted file mode 100644
index fa986f157285..000000000000
--- a/release_23/test/Linker/2002-07-17-LinkTest2.ll
+++ /dev/null
@@ -1,10 +0,0 @@
-; This fails linking when it is linked with an empty file as the first object file
-
-; RUN: llvm-as > %t1.bc < /dev/null
-; RUN: llvm-as < %s > %t2.bc
-; RUN: llvm-link %t1.bc %t2.bc
-
-@work = global i32 (i32, i32)* @zip ; <i32 (i32, i32)**> [#uses=0]
-
-declare i32 @zip(i32, i32)
-
diff --git a/release_23/test/Linker/2002-08-20-ConstantExpr.ll b/release_23/test/Linker/2002-08-20-ConstantExpr.ll
deleted file mode 100644
index 5672014ff663..000000000000
--- a/release_23/test/Linker/2002-08-20-ConstantExpr.ll
+++ /dev/null
@@ -1,9 +0,0 @@
-; This fails linking when it is linked with an empty file as the first object file
-
-; RUN: llvm-as > %t.LinkTest.bc < /dev/null
-; RUN: llvm-as < %s > %t.bc
-; RUN: llvm-link %t.LinkTest.bc %t.bc
-
-@work = global i32 4 ; <i32*> [#uses=1]
-@test = global i32* getelementptr (i32* @work, i64 1) ; <i32**> [#uses=0]
-
diff --git a/release_23/test/Linker/2003-01-30-LinkerRename.ll b/release_23/test/Linker/2003-01-30-LinkerRename.ll
deleted file mode 100644
index c5f3bde4d639..000000000000
--- a/release_23/test/Linker/2003-01-30-LinkerRename.ll
+++ /dev/null
@@ -1,9 +0,0 @@
-; This fails because the linker renames the external symbol not the internal
-; one...
-
-; RUN: echo {define internal i32 @foo() \{ ret i32 7 \} } | llvm-as > %t.1.bc
-; RUN: llvm-as < %s -o %t.2.bc -f
-; RUN: llvm-link %t.1.bc %t.2.bc | llvm-dis | grep @foo() | grep -v internal
-
-define i32 @foo() { ret i32 0 }
-
diff --git a/release_23/test/Linker/2003-01-30-LinkerTypeRename.ll b/release_23/test/Linker/2003-01-30-LinkerTypeRename.ll
deleted file mode 100644
index 288daf1cba1c..000000000000
--- a/release_23/test/Linker/2003-01-30-LinkerTypeRename.ll
+++ /dev/null
@@ -1,9 +0,0 @@
-; This fails because the linker renames the non-opaque type not the opaque
-; one...
-
-; RUN: echo {%Ty = type opaque @GV = external global %Ty*} | llvm-as > %t.1.bc
-; RUN: llvm-as < %s > %t.2.bc
-; RUN: llvm-link %t.1.bc %t.2.bc | llvm-dis | grep {%Ty } | not grep opaque
-
-%Ty = type i32
-
diff --git a/release_23/test/Linker/2003-04-21-Linkage.ll b/release_23/test/Linker/2003-04-21-Linkage.ll
deleted file mode 100644
index 7e00943c28b8..000000000000
--- a/release_23/test/Linker/2003-04-21-Linkage.ll
+++ /dev/null
@@ -1,14 +0,0 @@
-; RUN: echo {@X = linkonce global i32 5 \
-; RUN: define linkonce i32 @foo() \{ ret i32 7 \} } | llvm-as > %t.1.bc
-; RUN: llvm-as < %s -o %t.2.bc -f
-; RUN: llvm-link %t.1.bc %t.2.bc
-@X = external global i32
-
-declare i32 @foo()
-
-define void @bar() {
- load i32* @X
- call i32 @foo()
- ret void
-}
-
diff --git a/release_23/test/Linker/2003-04-23-LinkOnceLost.ll b/release_23/test/Linker/2003-04-23-LinkOnceLost.ll
deleted file mode 100644
index cf63fb35cede..000000000000
--- a/release_23/test/Linker/2003-04-23-LinkOnceLost.ll
+++ /dev/null
@@ -1,10 +0,0 @@
-; This fails because the linker renames the non-opaque type not the opaque
-; one...
-
-; RUN: echo { define linkonce void @foo() \{ ret void \} } | \
-; RUN: llvm-as -o %t.2.bc -f
-; RUN: llvm-as < %s -o %t.1.bc -f
-; RUN: llvm-link %t.1.bc %t.2.bc | llvm-dis | grep foo | grep linkonce
-
-declare void @foo()
-
diff --git a/release_23/test/Linker/2003-04-26-NullPtrLinkProblem.ll b/release_23/test/Linker/2003-04-26-NullPtrLinkProblem.ll
deleted file mode 100644
index c384eadd57fe..000000000000
--- a/release_23/test/Linker/2003-04-26-NullPtrLinkProblem.ll
+++ /dev/null
@@ -1,17 +0,0 @@
-; This one fails because the LLVM runtime is allowing two null pointers of
-; the same type to be created!
-
-; RUN: echo {%T = type i32} | llvm-as > %t.2.bc
-; RUN: llvm-as < %s -f > %t.1.bc
-; RUN: llvm-link %t.1.bc %t.2.bc
-
-%T = type opaque
-
-declare %T* @create()
-
-define void @test() {
- %X = call %T* @create( ) ; <%T*> [#uses=1]
- %v = icmp eq %T* %X, null ; <i1> [#uses=0]
- ret void
-}
-
diff --git a/release_23/test/Linker/2003-05-15-TypeProblem.ll b/release_23/test/Linker/2003-05-15-TypeProblem.ll
deleted file mode 100644
index e914a69e34fb..000000000000
--- a/release_23/test/Linker/2003-05-15-TypeProblem.ll
+++ /dev/null
@@ -1,10 +0,0 @@
-; This one fails because the LLVM runtime is allowing two null pointers of
-; the same type to be created!
-
-; RUN: echo {%S = type \{ %T*\} %T = type opaque} | llvm-as > %t.2.bc
-; RUN: llvm-as < %s > %t.1.bc
-; RUN: llvm-link %t.1.bc %t.2.bc
-
-%S = type { i32* }
-%T = type i32
-
diff --git a/release_23/test/Linker/2003-05-31-LinkerRename.ll b/release_23/test/Linker/2003-05-31-LinkerRename.ll
deleted file mode 100644
index c3661ae9aa3b..000000000000
--- a/release_23/test/Linker/2003-05-31-LinkerRename.ll
+++ /dev/null
@@ -1,17 +0,0 @@
-; The funcresolve pass will (intentionally) llvm-link an _internal_ function
-; body with an external declaration. Because of this, if we LINK an internal
-; function body into a program that already has an external declaration for
-; the function name, we must rename the internal function to something that
-; does not conflict.
-
-; RUN: echo { define internal i32 @foo() \{ ret i32 7 \} } | llvm-as > %t.1.bc
-; RUN: llvm-as < %s > %t.2.bc
-; RUN: llvm-link %t.1.bc %t.2.bc | llvm-dis | grep internal | not grep @foo(
-
-declare i32 @foo()
-
-define i32 @test() {
- %X = call i32 @foo()
- ret i32 %X
-}
-
diff --git a/release_23/test/Linker/2003-06-02-TypeResolveProblem.ll b/release_23/test/Linker/2003-06-02-TypeResolveProblem.ll
deleted file mode 100644
index 86979f60d172..000000000000
--- a/release_23/test/Linker/2003-06-02-TypeResolveProblem.ll
+++ /dev/null
@@ -1,7 +0,0 @@
-; RUN: echo {%T = type opaque} | llvm-as > %t.2.bc
-; RUN: llvm-as < %s > %t.1.bc
-; RUN: llvm-link %t.1.bc %t.2.bc
-
-%T = type opaque
-@a = constant { %T* } zeroinitializer ; <{ %T* }*> [#uses=0]
-
diff --git a/release_23/test/Linker/2003-06-02-TypeResolveProblem2.ll b/release_23/test/Linker/2003-06-02-TypeResolveProblem2.ll
deleted file mode 100644
index 42cc0403ae77..000000000000
--- a/release_23/test/Linker/2003-06-02-TypeResolveProblem2.ll
+++ /dev/null
@@ -1,7 +0,0 @@
-; RUN: echo {%T = type i32} | llvm-as > %t.1.bc
-; RUN: llvm-as < %s > %t.2.bc
-; RUN: llvm-link %t.1.bc %t.2.bc
-
-%T = type opaque
-@X = constant { %T* } zeroinitializer ; <{ %T* }*> [#uses=0]
-
diff --git a/release_23/test/Linker/2003-08-20-OpaqueTypeResolve.ll b/release_23/test/Linker/2003-08-20-OpaqueTypeResolve.ll
deleted file mode 100644
index a4d4bd543abe..000000000000
--- a/release_23/test/Linker/2003-08-20-OpaqueTypeResolve.ll
+++ /dev/null
@@ -1,8 +0,0 @@
-; RUN: llvm-as < %s > %t.out1.bc
-; RUN: echo {%S = type \{ i32, i32* \} } | llvm-as > %t.out2.bc
-; RUN: llvm-link %t.out1.bc %t.out2.bc
-
-%S = type { i32, %T* }
-%T = type opaque
-
-;%X = global { int, %T* } { int 5, %T* null }
diff --git a/release_23/test/Linker/2003-08-23-GlobalVarLinking.ll b/release_23/test/Linker/2003-08-23-GlobalVarLinking.ll
deleted file mode 100644
index fd36d0422a69..000000000000
--- a/release_23/test/Linker/2003-08-23-GlobalVarLinking.ll
+++ /dev/null
@@ -1,10 +0,0 @@
-; RUN: llvm-as < %s > %t.out1.bc
-; RUN: echo {@S = external global \{ i32, opaque* \} declare void @F(opaque*)}\
-; RUN: | llvm-as > %t.out2.bc
-; RUN: llvm-link %t.out1.bc %t.out2.bc | llvm-dis | not grep opaque
-
-; After linking this testcase, there should be no opaque types left. The two
-; S's should cause the opaque type to be resolved to 'int'.
-@S = global { i32, i32* } { i32 5, i32* null } ; <{ i32, i32* }*> [#uses=0]
-
-declare void @F(i32*)
diff --git a/release_23/test/Linker/2003-08-23-RecursiveOpaqueTypeResolve.ll b/release_23/test/Linker/2003-08-23-RecursiveOpaqueTypeResolve.ll
deleted file mode 100644
index 5041467604ae..000000000000
--- a/release_23/test/Linker/2003-08-23-RecursiveOpaqueTypeResolve.ll
+++ /dev/null
@@ -1,9 +0,0 @@
-; It's a bad idea to go recursively traipsing through types without a safety
-; net.
-
-; RUN: llvm-as < %s > %t.out1.bc
-; RUN: echo "%S = type { %S*, i32* }" | llvm-as > %t.out2.bc
-; RUN: llvm-link %t.out1.bc %t.out2.bc
-
-%S = type { %S*, opaque* }
-
diff --git a/release_23/test/Linker/2003-08-24-InheritPtrSize.ll b/release_23/test/Linker/2003-08-24-InheritPtrSize.ll
deleted file mode 100644
index f93c054dec7b..000000000000
--- a/release_23/test/Linker/2003-08-24-InheritPtrSize.ll
+++ /dev/null
@@ -1,9 +0,0 @@
-; Linking a module with a specified pointer size to one without a
-; specified pointer size should not cause a warning!
-
-; RUN: llvm-as < %s > %t.out1.bc
-; RUN: echo {} | llvm-as > %t.out2.bc
-; RUN: llvm-link %t.out1.bc %t.out2.bc |& not grep warning
-
-target datalayout = "e-p:64:64"
-
diff --git a/release_23/test/Linker/2003-08-28-TypeResolvesGlobal.ll b/release_23/test/Linker/2003-08-28-TypeResolvesGlobal.ll
deleted file mode 100644
index 5526b87ce77d..000000000000
--- a/release_23/test/Linker/2003-08-28-TypeResolvesGlobal.ll
+++ /dev/null
@@ -1,12 +0,0 @@
-; RUN: llvm-as < %s > %t.out1.bc
-; RUN: echo "%S = type i32" | llvm-as > %t.out2.bc
-; RUN: llvm-link %t.out2.bc %t.out1.bc
-
-%S = type opaque
-
-define void @foo(i32* %V) {
- ret void
-}
-
-declare void @foo.upgrd.1(%S*)
-
diff --git a/release_23/test/Linker/2003-08-28-TypeResolvesGlobal2.ll b/release_23/test/Linker/2003-08-28-TypeResolvesGlobal2.ll
deleted file mode 100644
index 3f306b167b1d..000000000000
--- a/release_23/test/Linker/2003-08-28-TypeResolvesGlobal2.ll
+++ /dev/null
@@ -1,18 +0,0 @@
-; RUN: llvm-as < %s > %t.out1.bc
-; RUN: echo "%S = type i32" | llvm-as > %t.out2.bc
-; RUN: llvm-link %t.out2.bc %t.out1.bc
-
-%S = type opaque
-
-define void @foo(i32* %V) {
- ret void
-}
-
-declare void @foo.upgrd.1(%S*)
-
-define void @other() {
- call void @foo.upgrd.1( %S* null )
- call void @foo( i32* null )
- ret void
-}
-
diff --git a/release_23/test/Linker/2003-08-28-TypeResolvesGlobal3.ll b/release_23/test/Linker/2003-08-28-TypeResolvesGlobal3.ll
deleted file mode 100644
index 38b7851ab860..000000000000
--- a/release_23/test/Linker/2003-08-28-TypeResolvesGlobal3.ll
+++ /dev/null
@@ -1,15 +0,0 @@
-; RUN: llvm-as < %s > %t.out1.bc
-; RUN: echo "%S = type i32" | llvm-as > %t.out2.bc
-; RUN: llvm-link %t.out2.bc %t.out1.bc
-
-%S = type opaque
-
-; GLobal using the resolved function prototype
-global void (%S*)* @foo ; <void (%S*)**>:0 [#uses=0]
-
-define void @foo.upgrd.1(i32* %V) {
- ret void
-}
-
-declare void @foo(%S*)
-
diff --git a/release_23/test/Linker/2003-10-21-ConflictingTypesTolerance.ll b/release_23/test/Linker/2003-10-21-ConflictingTypesTolerance.ll
deleted file mode 100644
index b3e64da35b34..000000000000
--- a/release_23/test/Linker/2003-10-21-ConflictingTypesTolerance.ll
+++ /dev/null
@@ -1,7 +0,0 @@
-; RUN: llvm-as < %s > %t.out1.bc
-; RUN: echo { %S = type \[8 x i32\] external global %S } | llvm-as > %t.out2.bc
-; RUN: llvm-link %t.out1.bc %t.out2.bc | llvm-dis | grep %S | grep \{
-
-%S = type { i32 }
-
-
diff --git a/release_23/test/Linker/2003-10-27-LinkOncePromote.ll b/release_23/test/Linker/2003-10-27-LinkOncePromote.ll
deleted file mode 100644
index f2d465ed80ea..000000000000
--- a/release_23/test/Linker/2003-10-27-LinkOncePromote.ll
+++ /dev/null
@@ -1,8 +0,0 @@
-; The linker should merge link-once globals into strong external globals,
-; just like it does for weak symbols!
-
-; RUN: echo "@X = global i32 7" | llvm-as > %t.2.bc
-; RUN: llvm-as < %s > %t.1.bc
-; RUN: llvm-link %t.1.bc %t.2.bc
-
-@X = linkonce global i32 7
diff --git a/release_23/test/Linker/2003-11-18-TypeResolution.ll b/release_23/test/Linker/2003-11-18-TypeResolution.ll
deleted file mode 100644
index d3152eda8e98..000000000000
--- a/release_23/test/Linker/2003-11-18-TypeResolution.ll
+++ /dev/null
@@ -1,20 +0,0 @@
-; Linking these two translation units causes there to be two LLVM values in the
-; symbol table with the same name and same type. When this occurs, the symbol
-; table class is DROPPING one of the values, instead of renaming it like a nice
-; little symbol table. This is causing llvm-link to die, at no fault of its
-; own.
-
-; RUN: llvm-as < %s > %t.out2.bc
-; RUN: echo "%T1 = type opaque @GVar = external global %T1*" | llvm-as > %t.out1.bc
-; RUN: llvm-link %t.out1.bc %t.out2.bc
-
-%T1 = type opaque
-%T2 = type i32
-@GVar = global i32* null ; <i32**> [#uses=0]
-
-define void @foo(i32* %X) {
- %X.upgrd.1 = bitcast i32* %X to %T1* ; <%T1*> [#uses=0]
- ret void
-}
-
-
diff --git a/release_23/test/Linker/2004-02-17-WeakStrongLinkage.ll b/release_23/test/Linker/2004-02-17-WeakStrongLinkage.ll
deleted file mode 100644
index 0e970ddb489a..000000000000
--- a/release_23/test/Linker/2004-02-17-WeakStrongLinkage.ll
+++ /dev/null
@@ -1,7 +0,0 @@
-; RUN: llvm-as < %s > %t.out2.bc
-; RUN: echo "@me = global i32* null" | llvm-as > %t.out1.bc
-; RUN: llvm-link %t.out1.bc %t.out2.bc -o /dev/null -f
-
-@me = weak global i32* null ; <i32**> [#uses=0]
-
-
diff --git a/release_23/test/Linker/2004-05-07-TypeResolution1.ll b/release_23/test/Linker/2004-05-07-TypeResolution1.ll
deleted file mode 100644
index 970a6d2f0f21..000000000000
--- a/release_23/test/Linker/2004-05-07-TypeResolution1.ll
+++ /dev/null
@@ -1,35 +0,0 @@
-; RUN: llvm-as < %s -f -o %t1.bc
-; RUN: llvm-as < %p/2004-05-07-TypeResolution2.ll -o %t2.bc -f
-; RUN: llvm-link -f -o %t3.bc %t1.bc %t2.bc
-
-target datalayout = "e-p:32:32"
- %myint = type opaque
- %struct1 = type { i32, void (%struct2*)*, %myint*, i32 (i32*)* }
- %struct2 = type { %struct1 }
-@driver1 = global %struct1 zeroinitializer ; <%struct1*> [#uses=1]
-@m1 = external global [1 x i8]* ; <[1 x i8]**> [#uses=0]
-@str1 = constant [1 x i8] zeroinitializer ; <[1 x i8]*> [#uses=0]
-@str2 = constant [2 x i8] zeroinitializer ; <[2 x i8]*> [#uses=0]
-@str3 = constant [3 x i8] zeroinitializer ; <[3 x i8]*> [#uses=0]
-@str4 = constant [4 x i8] zeroinitializer ; <[4 x i8]*> [#uses=0]
-@str5 = constant [5 x i8] zeroinitializer ; <[5 x i8]*> [#uses=0]
-@str6 = constant [6 x i8] zeroinitializer ; <[6 x i8]*> [#uses=0]
-@str7 = constant [7 x i8] zeroinitializer ; <[7 x i8]*> [#uses=0]
-@str8 = constant [8 x i8] zeroinitializer ; <[8 x i8]*> [#uses=0]
-@str9 = constant [9 x i8] zeroinitializer ; <[9 x i8]*> [#uses=0]
-@stra = constant [10 x i8] zeroinitializer ; <[10 x i8]*> [#uses=0]
-@strb = constant [11 x i8] zeroinitializer ; <[11 x i8]*> [#uses=0]
-@strc = constant [12 x i8] zeroinitializer ; <[12 x i8]*> [#uses=0]
-@strd = constant [13 x i8] zeroinitializer ; <[13 x i8]*> [#uses=0]
-@stre = constant [14 x i8] zeroinitializer ; <[14 x i8]*> [#uses=0]
-@strf = constant [15 x i8] zeroinitializer ; <[15 x i8]*> [#uses=0]
-@strg = constant [16 x i8] zeroinitializer ; <[16 x i8]*> [#uses=0]
-@strh = constant [17 x i8] zeroinitializer ; <[17 x i8]*> [#uses=0]
-
-declare void @func(%struct2*)
-
-define void @tty_init() {
-entry:
- volatile store void (%struct2*)* @func, void (%struct2*)** getelementptr (%struct1* @driver1, i64 0, i32 1)
- ret void
-}
diff --git a/release_23/test/Linker/2004-05-07-TypeResolution2.ll b/release_23/test/Linker/2004-05-07-TypeResolution2.ll
deleted file mode 100644
index 74fe39f4d9f4..000000000000
--- a/release_23/test/Linker/2004-05-07-TypeResolution2.ll
+++ /dev/null
@@ -1,15 +0,0 @@
-; This file is used by testlink1.ll, so it doesn't actually do anything itself
-;
-; RUN: echo
-target datalayout = "e-p:32:32"
- %myint = type i16
- %struct1 = type { i32, void (%struct2*)*, i16*, i32 (i32*)* }
- %struct2 = type { %struct1 }
-
-define internal void @f1(%struct1* %tty) {
-loopentry.preheader:
- %tmp.2.i.i = getelementptr %struct1* %tty, i64 0, i32 1 ; <void (%struct2*)**> [#uses=1]
- %tmp.3.i.i = volatile load void (%struct2*)** %tmp.2.i.i ; <void (%struct2*)*> [#uses=0]
- ret void
-}
-
diff --git a/release_23/test/Linker/2004-12-03-DisagreeingType.ll b/release_23/test/Linker/2004-12-03-DisagreeingType.ll
deleted file mode 100644
index 63d851b1673b..000000000000
--- a/release_23/test/Linker/2004-12-03-DisagreeingType.ll
+++ /dev/null
@@ -1,9 +0,0 @@
-; RUN: echo {@G = weak global \{\{\{\{double\}\}\}\} zeroinitializer } | \
-; RUN: llvm-as > %t.out2.bc
-; RUN: llvm-as < %s > %t.out1.bc
-; RUN: llvm-link %t.out1.bc %t.out2.bc | llvm-dis | not grep {\}}
-
-; When linked, the global above should be eliminated, being merged with the
-; global below.
-
-@G = global double 1.0
diff --git a/release_23/test/Linker/2005-02-12-ConstantGlobals-2.ll b/release_23/test/Linker/2005-02-12-ConstantGlobals-2.ll
deleted file mode 100644
index bedeb5106950..000000000000
--- a/release_23/test/Linker/2005-02-12-ConstantGlobals-2.ll
+++ /dev/null
@@ -1,8 +0,0 @@
-; Test that a prototype can be marked const, and the definition is allowed
-; to be nonconst.
-
-; RUN: echo {@X = external constant i32} | llvm-as > %t.2.bc
-; RUN: llvm-as < %s > %t.1.bc
-; RUN: llvm-link %t.1.bc %t.2.bc | llvm-dis | grep {global i32 7}
-
-@X = global i32 7
diff --git a/release_23/test/Linker/2005-02-12-ConstantGlobals.ll b/release_23/test/Linker/2005-02-12-ConstantGlobals.ll
deleted file mode 100644
index 407737287369..000000000000
--- a/release_23/test/Linker/2005-02-12-ConstantGlobals.ll
+++ /dev/null
@@ -1,8 +0,0 @@
-; Test that a prototype can be marked const, and the definition is allowed
-; to be nonconst.
-
-; RUN: echo {@X = global i32 7} | llvm-as > %t.2.bc
-; RUN: llvm-as < %s > %t.1.bc
-; RUN: llvm-link %t.1.bc %t.2.bc | llvm-dis | grep {global i32 7}
-
-@X = external constant i32 ; <i32*> [#uses=0]
diff --git a/release_23/test/Linker/2005-12-06-AppendingZeroLengthArrays.ll b/release_23/test/Linker/2005-12-06-AppendingZeroLengthArrays.ll
deleted file mode 100644
index 2637da17f3f9..000000000000
--- a/release_23/test/Linker/2005-12-06-AppendingZeroLengthArrays.ll
+++ /dev/null
@@ -1,10 +0,0 @@
-; RUN: echo { @G = appending global \[0 x i32\] zeroinitializer } | \
-; RUN: llvm-as > %t.out2.bc
-; RUN: llvm-as < %s > %t.out1.bc
-; RUN: llvm-link %t.out1.bc %t.out2.bc | llvm-dis | grep {@G =}
-
-; When linked, the globals should be merged, and the result should still
-; be named '@G'.
-
-@G = appending global [1 x i32] zeroinitializer ; <[1 x i32]*> [#uses=0]
-
diff --git a/release_23/test/Linker/2006-01-19-ConstantPacked.ll b/release_23/test/Linker/2006-01-19-ConstantPacked.ll
deleted file mode 100644
index 1cb47497d014..000000000000
--- a/release_23/test/Linker/2006-01-19-ConstantPacked.ll
+++ /dev/null
@@ -1,13 +0,0 @@
-; RUN: llvm-as < %s -f -o %t1.bc
-; RUN: llvm-link -f -o %t2.bc %t1.bc
-
-target datalayout = "E-p:32:32"
-target triple = "powerpc-apple-darwin7.7.0"
-deplibs = [ "c", "crtend" ]
-@source = global <4 x i32> < i32 0, i32 1, i32 2, i32 3 > ; <<4 x i32>*> [#uses=0]
-
-define i32 @main() {
-entry:
- ret i32 0
-}
-
diff --git a/release_23/test/Linker/2006-06-15-GlobalVarAlignment.ll b/release_23/test/Linker/2006-06-15-GlobalVarAlignment.ll
deleted file mode 100644
index 6e6d56a039ec..000000000000
--- a/release_23/test/Linker/2006-06-15-GlobalVarAlignment.ll
+++ /dev/null
@@ -1,7 +0,0 @@
-; The linker should choose the largest alignment when linking.
-
-; RUN: echo {@X = global i32 7, align 8} | llvm-as > %t.2.bc
-; RUN: llvm-as < %s > %t.1.bc
-; RUN: llvm-link %t.1.bc %t.2.bc | llvm-dis | grep {align 8}
-
-@X = weak global i32 7, align 4
diff --git a/release_23/test/Linker/2008-03-05-AliasReference.ll b/release_23/test/Linker/2008-03-05-AliasReference.ll
deleted file mode 100644
index 1663b00845e5..000000000000
--- a/release_23/test/Linker/2008-03-05-AliasReference.ll
+++ /dev/null
@@ -1,17 +0,0 @@
-; PR2054
-; RUN: llvm-as %s -o %t1.bc -f
-; RUN: llvm-as %p/2008-03-05-AliasReference2.ll -o %t2.bc -f
-; RUN: llvm-link %t2.bc %t1.bc -f -o %t3.bc
-
-; ModuleID = 'bug.o'
-target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128"
-target triple = "x86_64-unknown-linux-gnu"
-@foo = weak global i32 0 ; <i32*> [#uses=1]
-
-@bar = alias weak i32* @foo ; <i32*> [#uses=1]
-
-define i32 @baz() nounwind {
-entry:
- %tmp1 = load i32* @bar, align 4 ; <i32> [#uses=1]
- ret i32 %tmp1
-}
diff --git a/release_23/test/Linker/2008-03-05-AliasReference2.ll b/release_23/test/Linker/2008-03-05-AliasReference2.ll
deleted file mode 100644
index 05c0a25bb9d9..000000000000
--- a/release_23/test/Linker/2008-03-05-AliasReference2.ll
+++ /dev/null
@@ -1,11 +0,0 @@
-; This file is used by 2008-03-05-AliasReference.ll
-; RUN: true
-
-; ModuleID = 'bug.o'
-target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128"
-target triple = "x86_64-unknown-linux-gnu"
-
-define i32 @baz1() nounwind {
-entry:
- ret i32 0
-}
diff --git a/release_23/test/Linker/2008-03-07-DroppedSection_a.ll b/release_23/test/Linker/2008-03-07-DroppedSection_a.ll
deleted file mode 100644
index 4458971eba07..000000000000
--- a/release_23/test/Linker/2008-03-07-DroppedSection_a.ll
+++ /dev/null
@@ -1,11 +0,0 @@
-; RUN: llvm-as < %s > %t.bc
-; RUN: llvm-as < %p/2008-03-07-DroppedSection_b.ll > %t2.bc
-; RUN: llvm-ld -r -disable-opt %t.bc %t2.bc -o %t3.bc
-; RUN: llvm-dis < %t3.bc | grep ".data.init_task"
-
-; ModuleID = 't.bc'
-target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32"
-target triple = "i686-pc-linux-gnu"
-
-@init_task_union = global i32 1, section ".data.init_task", align 32
-
diff --git a/release_23/test/Linker/2008-03-07-DroppedSection_b.ll b/release_23/test/Linker/2008-03-07-DroppedSection_b.ll
deleted file mode 100644
index 884bf0a27440..000000000000
--- a/release_23/test/Linker/2008-03-07-DroppedSection_b.ll
+++ /dev/null
@@ -1,10 +0,0 @@
-; RUN: llvm-as < %s > %t.bc
-; RUN: llvm-as < %p/2008-03-07-DroppedSection_a.ll > %t2.bc
-; RUN: llvm-ld -r -disable-opt %t.bc %t2.bc -o %t3.bc
-; RUN: llvm-dis < %t3.bc | grep ".data.init_task"
-
-; ModuleID = 'u.bc'
-target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32"
-target triple = "i686-pc-linux-gnu"
-@init_task_union = external global i32
-
diff --git a/release_23/test/Linker/AppendingLinkage.ll b/release_23/test/Linker/AppendingLinkage.ll
deleted file mode 100644
index da08ca098893..000000000000
--- a/release_23/test/Linker/AppendingLinkage.ll
+++ /dev/null
@@ -1,15 +0,0 @@
-; Test that appending linkage works correctly.
-
-; RUN: echo {@X = appending global \[1 x i32\] \[i32 8\] } | \
-; RUN: llvm-as > %t.2.bc
-; RUN: llvm-as < %s > %t.1.bc
-; RUN: llvm-link %t.1.bc %t.2.bc | llvm-dis | grep 7 | grep 4 | grep 8
-
-@X = appending global [2 x i32] [ i32 7, i32 4 ] ; <[2 x i32]*> [#uses=2]
-@Y = global i32* getelementptr ([2 x i32]* @X, i64 0, i64 0) ; <i32**> [#uses=0]
-
-define void @foo(i64 %V) {
- %Y = getelementptr [2 x i32]* @X, i64 0, i64 %V ; <i32*> [#uses=0]
- ret void
-}
-
diff --git a/release_23/test/Linker/AppendingLinkage2.ll b/release_23/test/Linker/AppendingLinkage2.ll
deleted file mode 100644
index fddc4941be97..000000000000
--- a/release_23/test/Linker/AppendingLinkage2.ll
+++ /dev/null
@@ -1,8 +0,0 @@
-; Test that appending linkage works correctly when arrays are the same size.
-
-; RUN: echo {@X = appending global \[1 x i32\] \[i32 8\] } | \
-; RUN: llvm-as > %t.2.bc
-; RUN: llvm-as < %s > %t.1.bc
-; RUN: llvm-link %t.1.bc %t.2.bc | llvm-dis | grep 7 | grep 8
-
-@X = appending global [1 x i32] [ i32 7 ] ; <[1 x i32]*> [#uses=0]
diff --git a/release_23/test/Linker/ConstantGlobals1.ll b/release_23/test/Linker/ConstantGlobals1.ll
deleted file mode 100644
index 5d42f4bf5483..000000000000
--- a/release_23/test/Linker/ConstantGlobals1.ll
+++ /dev/null
@@ -1,9 +0,0 @@
-; Test that appending linkage works correctly when arrays are the same size.
-
-; RUN: echo {@X = constant \[1 x i32\] \[i32 8\] } | \
-; RUN: llvm-as > %t.2.bc
-; RUN: llvm-as < %s > %t.1.bc
-; RUN: llvm-link %t.1.bc %t.2.bc | llvm-dis | grep constant
-
-@X = external global [1 x i32] ; <[1 x i32]*> [#uses=0]
-
diff --git a/release_23/test/Linker/ConstantGlobals2.ll b/release_23/test/Linker/ConstantGlobals2.ll
deleted file mode 100644
index 9cd6bdb8c49a..000000000000
--- a/release_23/test/Linker/ConstantGlobals2.ll
+++ /dev/null
@@ -1,9 +0,0 @@
-; Test that appending linkage works correctly when arrays are the same size.
-
-; RUN: echo {@X = external global \[1 x i32\] } | \
-; RUN: llvm-as > %t.2.bc
-; RUN: llvm-as < %s > %t.1.bc
-; RUN: llvm-link %t.1.bc %t.2.bc | llvm-dis | grep constant
-
-@X = constant [1 x i32] [ i32 12 ] ; <[1 x i32]*> [#uses=0]
-
diff --git a/release_23/test/Linker/ConstantGlobals3.ll b/release_23/test/Linker/ConstantGlobals3.ll
deleted file mode 100644
index f9aa07d1bc50..000000000000
--- a/release_23/test/Linker/ConstantGlobals3.ll
+++ /dev/null
@@ -1,8 +0,0 @@
-; Test that appending linkage works correctly when arrays are the same size.
-
-; RUN: echo {@X = external constant \[1 x i32\] } | \
-; RUN: llvm-as > %t.2.bc
-; RUN: llvm-as < %s > %t.1.bc
-; RUN: llvm-link %t.1.bc %t.2.bc | llvm-dis | grep constant
-
-@X = external global [1 x i32] ; <[1 x i32]*> [#uses=0]
diff --git a/release_23/test/Linker/LinkOnce.ll b/release_23/test/Linker/LinkOnce.ll
deleted file mode 100644
index 5befd77a4aaa..000000000000
--- a/release_23/test/Linker/LinkOnce.ll
+++ /dev/null
@@ -1,8 +0,0 @@
-; This fails because the linker renames the non-opaque type not the opaque
-; one...
-
-; RUN: echo "@X = linkonce global i32 8" | llvm-as > %t.2.bc
-; RUN: llvm-as < %s > %t.1.bc
-; RUN: llvm-link %t.1.bc %t.2.bc | llvm-dis
-
-@X = linkonce global i32 7 ; <i32*> [#uses=0]
diff --git a/release_23/test/Linker/basiclink.ll b/release_23/test/Linker/basiclink.ll
deleted file mode 100644
index 711a0f4715ed..000000000000
--- a/release_23/test/Linker/basiclink.ll
+++ /dev/null
@@ -1,13 +0,0 @@
-; Test linking two functions with different prototypes and two globals
-; in different modules. This is for PR411
-; RUN: llvm-as %s -o %t.bar.bc -f
-; RUN: echo {define i32* @foo(i32 %x) \{ ret i32* @baz \} \
-; RUN: @baz = external global i32 } | llvm-as -o %t.foo.bc -f
-; RUN: llvm-link %t.bar.bc %t.foo.bc -o %t.bc -f
-; RUN: llvm-link %t.foo.bc %t.bar.bc -o %t.bc -f
-declare i32* @foo(...)
-define i32* @bar() {
- %ret = call i32* (...)* @foo( i32 123 )
- ret i32* %ret
-}
-@baz = global i32 0
diff --git a/release_23/test/Linker/dg.exp b/release_23/test/Linker/dg.exp
deleted file mode 100644
index 879685ca879d..000000000000
--- a/release_23/test/Linker/dg.exp
+++ /dev/null
@@ -1,3 +0,0 @@
-load_lib llvm.exp
-
-RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
diff --git a/release_23/test/Linker/link-archive.ll b/release_23/test/Linker/link-archive.ll
deleted file mode 100644
index 43cf3f36ca33..000000000000
--- a/release_23/test/Linker/link-archive.ll
+++ /dev/null
@@ -1,15 +0,0 @@
-; Test linking of a bc file to an archive via llvm-ld.
-; PR1434
-; RUN: llvm-as %s -o %t.bar.bc -f
-; RUN: echo {define i32* @foo(i32 %x) \{ ret i32* @baz \} \
-; RUN: @baz = external global i32 } | llvm-as -o %t.foo.bc -f
-; RUN: llvm-ar rf %t.foo.a %t.foo.bc
-; RUN: llvm-ar rf %t.bar.a %t.bar.bc
-; RUN: llvm-ld -disable-opt %t.bar.bc %t.foo.a -o %t.bc
-; RUN: llvm-ld -disable-opt %t.foo.bc %t.bar.a -o %t.bc
-declare i32* @foo(...)
-define i32* @bar() {
- %ret = call i32* (...)* @foo( i32 123 )
- ret i32* %ret
-}
-@baz = global i32 0
diff --git a/release_23/test/Linker/link-messages.ll b/release_23/test/Linker/link-messages.ll
deleted file mode 100644
index 133caf7d9071..000000000000
--- a/release_23/test/Linker/link-messages.ll
+++ /dev/null
@@ -1,11 +0,0 @@
-; Test that linking two files with the same definition causes an error and
-; that error is printed out.
-; RUN: llvm-as %s -o %t.one.bc -f
-; RUN: llvm-as %s -o %t.two.bc -f
-; RUN: not llvm-ld -disable-opt -link-as-library %t.one.bc %t.two.bc \
-; RUN: -o %t.bc 2>%t.err
-; RUN: grep "Function is already defined" %t.err
-
-define i32 @bar() {
- ret i32 0
-}
diff --git a/release_23/test/Linker/redefinition.ll b/release_23/test/Linker/redefinition.ll
deleted file mode 100644
index 7be93234455d..000000000000
--- a/release_23/test/Linker/redefinition.ll
+++ /dev/null
@@ -1,10 +0,0 @@
-; Test linking two functions with different prototypes and two globals
-; in different modules.
-; RUN: llvm-as %s -o %t.foo1.bc -f
-; RUN: llvm-as %s -o %t.foo2.bc -f
-; RUN: echo {define void @foo(i32 %x) { ret void }} | llvm-as -o %t.foo3.bc -f
-; RUN: not llvm-link %t.foo1.bc %t.foo2.bc -o %t.bc |& \
-; RUN: grep {Function is already defined}
-; RUN: not llvm-link %t.foo1.bc %t.foo3.bc -o %t.bc |& \
-; RUN: grep {Function 'foo' defined as both}
-define void @foo() { ret void }
diff --git a/release_23/test/Linker/testlink1.ll b/release_23/test/Linker/testlink1.ll
deleted file mode 100644
index 4a9402576ef2..000000000000
--- a/release_23/test/Linker/testlink1.ll
+++ /dev/null
@@ -1,42 +0,0 @@
-; RUN: llvm-as < %s > %t.bc
-; RUN: llvm-as < %p/testlink2.ll > %t2.bc
-; RUN: llvm-link %t.bc %t2.bc
-
-@MyVar = external global i32 ; <i32*> [#uses=3]
-@MyIntList = global { \2*, i32 } { { \2*, i32 }* null, i32 17 } ; <{ \2*, i32 }*> [#uses=1]
-external global i32 ; <i32*>:0 [#uses=0]
-@Inte = global i32 1 ; <i32*> [#uses=0]
-@AConst = linkonce constant i32 123 ; <i32*> [#uses=0]
-@Intern1 = internal constant i32 42 ; <i32*> [#uses=0]
-@Intern2 = internal constant i32 792 ; <i32*> [#uses=0]
-@MyVarPtr = linkonce global { i32* } { i32* @MyVar } ; <{ i32* }*> [#uses=0]
-
-declare i32 @foo(i32)
-
-declare void @print(i32)
-
-define void @main() {
- %v1 = load i32* @MyVar ; <i32> [#uses=1]
- call void @print( i32 %v1 )
- %idx = getelementptr { \2*, i32 }* @MyIntList, i64 0, i32 1 ; <i32*> [#uses=2]
- %v2 = load i32* %idx ; <i32> [#uses=1]
- call void @print( i32 %v2 )
- call i32 @foo( i32 5 ) ; <i32>:1 [#uses=0]
- %v3 = load i32* @MyVar ; <i32> [#uses=1]
- call void @print( i32 %v3 )
- %v4 = load i32* %idx ; <i32> [#uses=1]
- call void @print( i32 %v4 )
- ret void
-}
-
-define internal void @testintern() {
- ret void
-}
-
-define internal void @Testintern() {
- ret void
-}
-
-define void @testIntern() {
- ret void
-}
diff --git a/release_23/test/Linker/testlink2.ll b/release_23/test/Linker/testlink2.ll
deleted file mode 100644
index d243e3c7d1a3..000000000000
--- a/release_23/test/Linker/testlink2.ll
+++ /dev/null
@@ -1,41 +0,0 @@
-; This file is used by testlink1.ll, so it doesn't actually do anything itself
-;
-; RUN: true
-
-@MyVar = global i32 4 ; <i32*> [#uses=2]
-@MyIntList = external global { \2*, i32 } ; <{ \2*, i32 }*> [#uses=2]
-@AConst = constant i32 123 ; <i32*> [#uses=0]
-
-;; Intern in both testlink[12].ll
-@Intern1 = internal constant i32 52 ; <i32*> [#uses=0]
-
-;; Intern in one but not in other
-@Intern2 = constant i32 12345 ; <i32*> [#uses=0]
-
-@MyIntListPtr = constant { { \2*, i32 }* } { { \2*, i32 }* @MyIntList } ; <{ { \2*, i32 }* }*> [#uses=0]
-@MyVarPtr = linkonce global { i32* } { i32* @MyVar } ; <{ i32* }*> [#uses=0]
-constant i32 412 ; <i32*>:0 [#uses=1]
-
-define i32 @foo(i32 %blah) {
- store i32 %blah, i32* @MyVar
- %idx = getelementptr { \2*, i32 }* @MyIntList, i64 0, i32 1 ; <i32*> [#uses=1]
- store i32 12, i32* %idx
- %ack = load i32* @0 ; <i32> [#uses=1]
- %fzo = add i32 %ack, %blah ; <i32> [#uses=1]
- ret i32 %fzo
-}
-
-declare void @unimp(float, double)
-
-define internal void @testintern() {
- ret void
-}
-
-define void @Testintern() {
- ret void
-}
-
-define internal void @testIntern() {
- ret void
-}
-
diff --git a/release_23/test/Linker/weakextern.ll b/release_23/test/Linker/weakextern.ll
deleted file mode 100644
index edb23bc4b707..000000000000
--- a/release_23/test/Linker/weakextern.ll
+++ /dev/null
@@ -1,11 +0,0 @@
-; RUN: llvm-as < %s > %t.bc
-; RUN: llvm-as < %p/testlink1.ll > %t2.bc
-; RUN: llvm-link %t.bc %t.bc %t2.bc -o %t1.bc -f
-; RUN: llvm-dis < %t1.bc | grep {kallsyms_names = extern_weak}
-; RUN: llvm-dis < %t1.bc | grep {MyVar = external global i32}
-; RUN: llvm-dis < %t1.bc | grep {Inte = global i32}
-
-@kallsyms_names = extern_weak global [0 x i8] ; <[0 x i8]*> [#uses=0]
-@MyVar = extern_weak global i32 ; <i32*> [#uses=0]
-@Inte = extern_weak global i32 ; <i32*> [#uses=0]
-
diff --git a/release_23/test/Makefile b/release_23/test/Makefile
deleted file mode 100644
index 67644ce66eec..000000000000
--- a/release_23/test/Makefile
+++ /dev/null
@@ -1,111 +0,0 @@
-#===- test/Makefile ----------------------------------------*- Makefile -*--===#
-#
-# The LLVM Compiler Infrastructure
-#
-# This file is distributed under the University of Illinois Open Source
-# License. See LICENSE.TXT for details.
-#
-#===------------------------------------------------------------------------===#
-
-LEVEL = ..
-DIRS =
-
-#
-# Make Dejagnu the default for testing
-#
-all:: check-local
-
-# Include other test rules
-include Makefile.tests
-
-#===------------------------------------------------------------------------===#
-# DejaGNU testing support
-#===------------------------------------------------------------------------===#
-
-ifdef VERBOSE
-RUNTESTFLAGS := $(VERBOSE)
-endif
-
-ifdef TESTSUITE
-CLEANED_TESTSUITE := $(patsubst %/,%,$(TESTSUITE))
-CLEANED_TESTSUITE := $(patsubst test/%,%,$(CLEANED_TESTSUITE))
-RUNTESTFLAGS += --tool $(CLEANED_TESTSUITE)
-endif
-
-IGNORE_TESTS :=
-
-ifndef RUNLLVM2CPP
-IGNORE_TESTS += llvm2cpp.exp
-endif
-
-IGNORE_TESTS += $(filter-out $(BINDINGS_TO_BUILD:=.exp),$(ALL_BINDINGS:=.exp))
-
-ifdef IGNORE_TESTS
-RUNTESTFLAGS += --ignore "$(strip $(IGNORE_TESTS))"
-endif
-
-ifneq ($(RUNTEST),)
-check-local:: site.exp
- ( ulimit -t 600 ; ulimit -d 512000 ; \
- PATH="$(LLVMToolDir):$(LLVM_SRC_ROOT)/test/Scripts:$(PATH)" \
- $(RUNTEST) $(RUNTESTFLAGS) )
-else
-check-local:: site.exp
- @echo "*** dejagnu not found. Make sure runtest is in your PATH, then reconfigure llvm."
-endif
-
-ifdef TESTONE
-CLEANED_TESTONE := $(patsubst %/,%,$(TESTONE))
-CLEANED_TESTONE := $(patsubst test/%,%,$(CLEANED_TESTONE))
-SUBDIR := $(shell dirname $(CLEANED_TESTONE))
-TESTPATH := $(LLVM_SRC_ROOT)/test/$(CLEANED_TESTONE)
-check-one: site.exp $(TCLSH)
- $(Verb)( echo "source $(LLVM_OBJ_ROOT)/test/site.exp" ; \
- echo "set subdir $(SUBDIR)" ; \
- echo "proc pass { msg } { puts \"PASS: \$$msg\" } "; \
- echo "proc fail { msg } { puts \"FAIL: \$$msg\" }" ; \
- echo "proc xfail { msg } { puts \"XFAIL: \$$msg\" }" ; \
- echo "proc xpass { msg } { puts \"XPASS: \$$msg\" }" ; \
- echo "proc verbose args { }" ; \
- echo "source $(LLVM_SRC_ROOT)/test/lib/llvm.exp" ; \
- echo "RunLLVMTests $(TESTPATH)" ) | \
- ( ulimit -t 600 ; ulimit -d 512000 ; \
- PATH="$(LLVMToolDir):$(LLVM_SRC_ROOT)/test/Scripts:$(PATH)" \
- $(TCLSH) )
-endif
-
-clean::
- $(RM) -rf `find $(LLVM_OBJ_ROOT)/test -name Output -type d -print`
-
-site.exp: Makefile $(LLVM_OBJ_ROOT)/Makefile.config
- @echo 'Making a new site.exp file...'
- @echo '## these variables are automatically generated by make ##' >site.tmp
- @echo '# Do not edit here. If you wish to override these values' >>site.tmp
- @echo '# edit the last section' >>site.tmp
- @echo 'set target_triplet "$(TARGET_TRIPLE)"' >> site.tmp
- @echo 'set TARGETS_TO_BUILD "$(TARGETS_TO_BUILD)"' >> site.tmp
- @echo 'set llvmgcc_langs "$(LLVMGCC_LANGS)"' >> site.tmp
- @echo 'set llvmgcc_version "$(LLVMGCC_VERSION)"' >> site.tmp
- @echo 'set prcontext "$(TCLSH) $(LLVM_SRC_ROOT)/test/Scripts/prcontext.tcl"' >> site.tmp
- @echo 'set llvmtoolsdir "$(ToolDir)"' >>site.tmp
- @echo 'set llvmlibsdir "$(LibDir)"' >>site.tmp
- @echo 'set srcroot "$(LLVM_SRC_ROOT)"' >>site.tmp
- @echo 'set objroot "$(LLVM_OBJ_ROOT)"' >>site.tmp
- @echo 'set srcdir "$(LLVM_SRC_ROOT)/test"' >>site.tmp
- @echo 'set objdir "$(LLVM_OBJ_ROOT)/test"' >>site.tmp
- @echo 'set gccpath "$(CC)"' >>site.tmp
- @echo 'set gxxpath "$(CXX)"' >>site.tmp
- @echo 'set compile_c "$(CC) $(CPP.Flags) $(CompileCommonOpts) -c "' >>site.tmp
- @echo 'set compile_cxx "$(CXX) $(CPP.Flags) $(CXX.Flags) $(CompileCommonOpts) -c"' >> site.tmp
- @echo 'set link "$(CXX) $(CPP.Flags) $(CXX.Flags) $(CompileCommonOpts) $(LD.Flags)"' >>site.tmp
- @echo 'set llvmgcc "$(LLVMGCC) $(EXTRA_OPTIONS)"' >> site.tmp
- @echo 'set llvmgxx "$(LLVMGCC) $(EXTRA_OPTIONS)"' >> site.tmp
- @echo 'set llvmgccmajvers "$(LLVMGCC_MAJVERS)"' >> site.tmp
- @echo 'set shlibext "$(SHLIBEXT)"' >> site.tmp
- @echo 'set ocamlc "$(OCAMLC) -cc $(CXX) -I $(LibDir)/ocaml"' >> site.tmp
- @echo '## All variables above are generated by configure. Do Not Edit ## ' >>site.tmp
- @test ! -f site.exp || \
- sed '1,/^## All variables above are.*##/ d' site.exp >> site.tmp
- @-rm -f site.bak
- @test ! -f site.exp || mv site.exp site.bak
- @mv site.tmp site.exp
diff --git a/release_23/test/Makefile.tests b/release_23/test/Makefile.tests
deleted file mode 100644
index ad9f2eabc7f1..000000000000
--- a/release_23/test/Makefile.tests
+++ /dev/null
@@ -1,80 +0,0 @@
-##----------------------------------------------------------*- Makefile -*-===##
-##
-## Common rules for generating, linking, and compiling via LLVM. This is
-## used to implement a robust testing framework for LLVM
-##
-##-------------------------------------------------------------------------===##
-
-# If the user specified a TEST= option on the command line, we do not want to do
-# the default testing type. Instead, we change the default target to be the
-# test:: target.
-#
-ifdef TEST
-test::
-endif
-
-# We do not want to make .d files for tests!
-DISABLE_AUTO_DEPENDENCIES=1
-
-include ${LEVEL}/Makefile.common
-
-# Specify ENABLE_STATS on the command line to enable -stats and -time-passes
-# output from gccas and gccld.
-ifdef ENABLE_STATS
-STATS = -stats -time-passes
-endif
-
-.PHONY: clean default
-
-# These files, which might be intermediate results, should not be deleted by
-# make
-.PRECIOUS: Output/%.bc Output/%.ll
-.PRECIOUS: Output/%.tbc Output/%.tll
-.PRECIOUS: Output/.dir
-.PRECIOUS: Output/%.llvm.bc
-.PRECIOUS: Output/%.llvm
-
-LCCFLAGS += -O2 -Wall
-LCXXFLAGS += -O2 -Wall
-LLCFLAGS =
-TESTRUNR = @echo Running test: $<; \
- PATH="$(LLVMTOOLCURRENT):$(LLVM_SRC_ROOT)/test/Scripts:$(PATH)" \
- $(LLVM_SRC_ROOT)/test/TestRunner.sh
-
-LLCLIBS := $(LLCLIBS) -lm
-
-clean::
- $(RM) -f a.out core
- $(RM) -rf Output/
-
-# Compile from X.c to Output/X.ll
-Output/%.ll: %.c $(LCC1) Output/.dir $(INCLUDES)
- -$(LLVMGCCWITHPATH) $(CPPFLAGS) $(LCCFLAGS) -S $< -o $@
-
-# Compile from X.cpp to Output/X.ll
-Output/%.ll: %.cpp $(LCC1XX) Output/.dir $(INCLUDES)
- -$(LLVMGXXWITHPATH) $(CPPFLAGS) $(LCXXFLAGS) -S $< -o $@
-
-# Compile from X.cc to Output/X.ll
-Output/%.ll: %.cc $(LCC1XX) Output/.dir $(INCLUDES)
- -$(LLVMGXXWITHPATH) $(CPPFLAGS) $(LCXXFLAGS) -S $< -o $@
-
-# LLVM Assemble from Output/X.ll to Output/X.bc. Output/X.ll must have come
-# from GCC output, so use GCCAS.
-#
-Output/%.bc: Output/%.ll $(LGCCAS)
- -$(LGCCAS) $(STATS) $< -o $@
-
-# LLVM Assemble from X.ll to Output/X.bc. Because we are coming directly from
-# LLVM source, use the non-transforming assembler.
-#
-Output/%.bc: %.ll $(LLVMAS) Output/.dir
- -$(LLVMAS) -f $< -o $@
-
-## Cancel built-in implicit rules that override above rules
-%: %.s
-
-%: %.c
-
-%.o: %.c
-
diff --git a/release_23/test/Other/2002-01-31-CallGraph.ll b/release_23/test/Other/2002-01-31-CallGraph.ll
deleted file mode 100644
index e09461dc2acb..000000000000
--- a/release_23/test/Other/2002-01-31-CallGraph.ll
+++ /dev/null
@@ -1,13 +0,0 @@
-; Call graph construction crash: Not handling indirect calls right
-;
-; RUN: llvm-as < %s | opt -analyze -callgraph
-;
-
- %FunTy = type i32 (i32)
-
-define void @invoke(%FunTy* %x) {
- %foo = call i32 %x( i32 123 ) ; <i32> [#uses=0]
- ret void
-}
-
-
diff --git a/release_23/test/Other/2002-02-24-InlineBrokePHINodes.ll b/release_23/test/Other/2002-02-24-InlineBrokePHINodes.ll
deleted file mode 100644
index cbb1a8969377..000000000000
--- a/release_23/test/Other/2002-02-24-InlineBrokePHINodes.ll
+++ /dev/null
@@ -1,23 +0,0 @@
-; Inlining used to break PHI nodes. This tests that they are correctly updated
-; when a node is split around the call instruction. The verifier caught the error.
-;
-; RUN: llvm-as < %s | opt -inline
-;
-
-define i64 @test(i64 %X) {
- ret i64 %X
-}
-
-define i64 @fib(i64 %n) {
-; <label>:0
- %T = icmp ult i64 %n, 2 ; <i1> [#uses=1]
- br i1 %T, label %BaseCase, label %RecurseCase
-
-RecurseCase: ; preds = %0
- %result = call i64 @test( i64 %n ) ; <i64> [#uses=0]
- br label %BaseCase
-
-BaseCase: ; preds = %RecurseCase, %0
- %X = phi i64 [ 1, %0 ], [ 2, %RecurseCase ] ; <i64> [#uses=1]
- ret i64 %X
-}
diff --git a/release_23/test/Other/2002-03-11-ConstPropCrash.ll b/release_23/test/Other/2002-03-11-ConstPropCrash.ll
deleted file mode 100644
index 90dc0026935c..000000000000
--- a/release_23/test/Other/2002-03-11-ConstPropCrash.ll
+++ /dev/null
@@ -1,24 +0,0 @@
-; When constant propogating terminator instructions, the basic block iterator
-; was not updated to refer to the final position of the new terminator. This
-; can be bad, f.e. because constproping a terminator can lead to the
-; destruction of PHI nodes, which invalidates the iterator!
-;
-; Fixed by adding new arguments to ConstantFoldTerminator
-;
-; RUN: llvm-as < %s | opt -constprop
-
-define void @build_tree(i32 %ml) {
-; <label>:0
- br label %bb2
-
-bb2: ; preds = %bb2, %0
- %reg137 = phi i32 [ %reg140, %bb2 ], [ 12, %0 ] ; <i32> [#uses=1]
- %reg138 = phi i32 [ %reg139, %bb2 ], [ 0, %0 ] ; <i32> [#uses=1]
- %reg139 = add i32 %reg138, 1 ; <i32> [#uses=1]
- %reg140 = add i32 %reg137, -1 ; <i32> [#uses=1]
- br i1 false, label %bb2, label %bb3
-
-bb3: ; preds = %bb2
- ret void
-}
-
diff --git a/release_23/test/Other/2003-02-19-LoopInfoNestingBug.ll b/release_23/test/Other/2003-02-19-LoopInfoNestingBug.ll
deleted file mode 100644
index 32390f49a20d..000000000000
--- a/release_23/test/Other/2003-02-19-LoopInfoNestingBug.ll
+++ /dev/null
@@ -1,29 +0,0 @@
-; LoopInfo is incorrectly calculating loop nesting! In this case it doesn't
-; figure out that loop "Inner" should be nested inside of leep "LoopHeader",
-; and instead nests it just inside loop "Top"
-;
-; RUN: llvm-as < %s | opt -analyze -loops | \
-; RUN: grep { Loop Containing:\[ \]*%Inner}
-;
-define void @test() {
- br label %Top
-
-Top: ; preds = %Out, %0
- br label %LoopHeader
-
-Next: ; preds = %LoopHeader
- br i1 false, label %Inner, label %Out
-
-Inner: ; preds = %Inner, %Next
- br i1 false, label %Inner, label %LoopHeader
-
-LoopHeader: ; preds = %Inner, %Top
- br label %Next
-
-Out: ; preds = %Next
- br i1 false, label %Top, label %Done
-
-Done: ; preds = %Out
- ret void
-}
-
diff --git a/release_23/test/Other/2004-08-16-PackedConstantInlineStore.ll b/release_23/test/Other/2004-08-16-PackedConstantInlineStore.ll
deleted file mode 100644
index 36ac4fd5af44..000000000000
--- a/release_23/test/Other/2004-08-16-PackedConstantInlineStore.ll
+++ /dev/null
@@ -1,8 +0,0 @@
-; RUN: llvm-as < %s | llvm-dis
-@bar = external global <2 x i32> ; <<2 x i32>*> [#uses=1]
-
-define void @main() {
- store <2 x i32> < i32 0, i32 1 >, <2 x i32>* @bar
- ret void
-}
-
diff --git a/release_23/test/Other/2004-08-16-PackedGlobalConstant.ll b/release_23/test/Other/2004-08-16-PackedGlobalConstant.ll
deleted file mode 100644
index 9130ccba1736..000000000000
--- a/release_23/test/Other/2004-08-16-PackedGlobalConstant.ll
+++ /dev/null
@@ -1,11 +0,0 @@
-; RUN: llvm-as < %s | llvm-dis
-
-@foo = global <2 x i32> < i32 0, i32 1 > ; <<2 x i32>*> [#uses=1]
-@bar = external global <2 x i32> ; <<2 x i32>*> [#uses=1]
-
-define void @main() {
- %t0 = load <2 x i32>* @foo ; <<2 x i32>> [#uses=1]
- store <2 x i32> %t0, <2 x i32>* @bar
- ret void
-}
-
diff --git a/release_23/test/Other/2004-08-16-PackedSelect.ll b/release_23/test/Other/2004-08-16-PackedSelect.ll
deleted file mode 100644
index 64383169d293..000000000000
--- a/release_23/test/Other/2004-08-16-PackedSelect.ll
+++ /dev/null
@@ -1,13 +0,0 @@
-; RUN: llvm-as < %s | llvm-dis
-
-@foo = external global <4 x float> ; <<4 x float>*> [#uses=1]
-@bar = external global <4 x float> ; <<4 x float>*> [#uses=1]
-
-define void @main() {
- %t0 = load <4 x float>* @foo ; <<4 x float>> [#uses=3]
- %t1 = add <4 x float> %t0, %t0 ; <<4 x float>> [#uses=1]
- %t2 = select i1 true, <4 x float> %t0, <4 x float> %t1 ; <<4 x float>> [#uses=1]
- store <4 x float> %t2, <4 x float>* @bar
- ret void
-}
-
diff --git a/release_23/test/Other/2004-08-16-PackedSimple.ll b/release_23/test/Other/2004-08-16-PackedSimple.ll
deleted file mode 100644
index 5bb8b7930009..000000000000
--- a/release_23/test/Other/2004-08-16-PackedSimple.ll
+++ /dev/null
@@ -1,13 +0,0 @@
-; RUN: llvm-as < %s | llvm-dis
-
-@foo = external global <4 x float> ; <<4 x float>*> [#uses=1]
-@bar = external global <4 x float> ; <<4 x float>*> [#uses=1]
-
-define void @main() {
- %t0 = load <4 x float>* @foo ; <<4 x float>> [#uses=3]
- %t2 = add <4 x float> %t0, %t0 ; <<4 x float>> [#uses=1]
- %t3 = select i1 false, <4 x float> %t0, <4 x float> %t2 ; <<4 x float>> [#uses=1]
- store <4 x float> %t3, <4 x float>* @bar
- ret void
-}
-
diff --git a/release_23/test/Other/2004-08-20-PackedControlFlow.ll b/release_23/test/Other/2004-08-20-PackedControlFlow.ll
deleted file mode 100644
index 49aa606adc04..000000000000
--- a/release_23/test/Other/2004-08-20-PackedControlFlow.ll
+++ /dev/null
@@ -1,22 +0,0 @@
-; RUN: llvm-as < %s | llvm-dis | llvm-as > /dev/null
-
- %v4f = type <4 x float>
-@foo = external global %v4f ; <%v4f*> [#uses=1]
-@bar = external global %v4f ; <%v4f*> [#uses=1]
-
-define void @main() {
- br label %A
-
-C: ; preds = %B
- store %v4f %t2, %v4f* @bar
- ret void
-
-B: ; preds = %A
- %t2 = add %v4f %t0, %t0 ; <%v4f> [#uses=1]
- br label %C
-
-A: ; preds = %0
- %t0 = load %v4f* @foo ; <%v4f> [#uses=2]
- br label %B
-}
-
diff --git a/release_23/test/Other/2006-02-05-PassManager.ll b/release_23/test/Other/2006-02-05-PassManager.ll
deleted file mode 100644
index 5d7b6801c847..000000000000
--- a/release_23/test/Other/2006-02-05-PassManager.ll
+++ /dev/null
@@ -1,5 +0,0 @@
-; RUN: llvm-as < %s | opt -domtree -gcse -domtree -constmerge -disable-output
-
-define i32 @test1() {
- unreachable
-}
diff --git a/release_23/test/Other/2007-04-24-eliminate-mostly-empty-blocks.ll b/release_23/test/Other/2007-04-24-eliminate-mostly-empty-blocks.ll
deleted file mode 100644
index 4ffcf96b0efe..000000000000
--- a/release_23/test/Other/2007-04-24-eliminate-mostly-empty-blocks.ll
+++ /dev/null
@@ -1,309 +0,0 @@
-;RUN: llvm-as < %s | opt -codegenprepare -disable-output
-
-define void @foo() {
-entry:
- br i1 false, label %cond_next31, label %cond_true
-
-cond_true: ; preds = %entry
- br i1 false, label %cond_true19, label %cond_next31
-
-cond_true19: ; preds = %cond_true
- br i1 false, label %bb510, label %cond_next31
-
-cond_next31: ; preds = %cond_true19, %cond_true, %entry
- br i1 false, label %cond_true61, label %cond_next78
-
-cond_true61: ; preds = %cond_next31
- br label %cond_next78
-
-cond_next78: ; preds = %cond_true61, %cond_next31
- br i1 false, label %cond_true93, label %bb.preheader
-
-cond_true93: ; preds = %cond_next78
- br label %bb.preheader
-
-bb.preheader: ; preds = %cond_true93, %cond_next78
- %iftmp.11.0.ph.ph = phi i16 [ 0, %cond_true93 ], [ 0, %cond_next78 ] ; <i16> [#uses=1]
- br label %bb
-
-bb: ; preds = %cond_next499, %bb.preheader
- %n.1 = phi i16 [ %iftmp.11.0.ph.ph, %cond_next499 ], [ 0, %bb.preheader ] ; <i16> [#uses=0]
- br i1 false, label %bb148.preheader, label %bb493
-
-bb148.preheader: ; preds = %bb
- br label %bb148
-
-bb148: ; preds = %cond_next475, %bb148.preheader
- br i1 false, label %cond_next175, label %bb184
-
-cond_next175: ; preds = %bb148
- br i1 false, label %bb184, label %bb185
-
-bb184: ; preds = %cond_next175, %bb148
- br label %bb185
-
-bb185: ; preds = %bb184, %cond_next175
- br i1 false, label %bb420.preheader, label %cond_true198
-
-bb420.preheader: ; preds = %bb185
- br label %bb420
-
-cond_true198: ; preds = %bb185
- br i1 false, label %bb294, label %cond_next208
-
-cond_next208: ; preds = %cond_true198
- br i1 false, label %cond_next249, label %cond_true214
-
-cond_true214: ; preds = %cond_next208
- br i1 false, label %bb294, label %cond_next262
-
-cond_next249: ; preds = %cond_next208
- br i1 false, label %bb294, label %cond_next262
-
-cond_next262: ; preds = %cond_next249, %cond_true214
- br label %bb269
-
-bb269: ; preds = %cond_next285, %cond_next262
- br i1 false, label %cond_next285, label %cond_true279
-
-cond_true279: ; preds = %bb269
- br label %cond_next285
-
-cond_next285: ; preds = %cond_true279, %bb269
- br i1 false, label %bb269, label %cond_next446.loopexit
-
-bb294: ; preds = %cond_next249, %cond_true214, %cond_true198
- br i1 false, label %cond_next336, label %cond_true301
-
-cond_true301: ; preds = %bb294
- br i1 false, label %cond_false398, label %cond_true344
-
-cond_next336: ; preds = %bb294
- br i1 false, label %cond_false398, label %cond_true344
-
-cond_true344: ; preds = %cond_next336, %cond_true301
- br i1 false, label %cond_false381, label %cond_true351
-
-cond_true351: ; preds = %cond_true344
- br label %cond_next387
-
-cond_false381: ; preds = %cond_true344
- br label %cond_next387
-
-cond_next387: ; preds = %cond_false381, %cond_true351
- br label %cond_next401
-
-cond_false398: ; preds = %cond_next336, %cond_true301
- br label %cond_next401
-
-cond_next401: ; preds = %cond_false398, %cond_next387
- br i1 false, label %cond_next475, label %cond_true453
-
-bb420: ; preds = %cond_next434, %bb420.preheader
- br i1 false, label %cond_next434, label %cond_true428
-
-cond_true428: ; preds = %bb420
- br label %cond_next434
-
-cond_next434: ; preds = %cond_true428, %bb420
- br i1 false, label %bb420, label %cond_next446.loopexit1
-
-cond_next446.loopexit: ; preds = %cond_next285
- br label %cond_next446
-
-cond_next446.loopexit1: ; preds = %cond_next434
- br label %cond_next446
-
-cond_next446: ; preds = %cond_next446.loopexit1, %cond_next446.loopexit
- br i1 false, label %cond_next475, label %cond_true453
-
-cond_true453: ; preds = %cond_next446, %cond_next401
- br i1 false, label %cond_true458, label %cond_next475
-
-cond_true458: ; preds = %cond_true453
- br label %cond_next475
-
-cond_next475: ; preds = %cond_true458, %cond_true453, %cond_next446, %cond_next401
- br i1 false, label %bb493.loopexit, label %bb148
-
-bb493.loopexit: ; preds = %cond_next475
- br label %bb493
-
-bb493: ; preds = %bb493.loopexit, %bb
- br i1 false, label %cond_next499, label %bb510.loopexit
-
-cond_next499: ; preds = %bb493
- br label %bb
-
-bb510.loopexit: ; preds = %bb493
- br label %bb510
-
-bb510: ; preds = %bb510.loopexit, %cond_true19
- br i1 false, label %cond_next524, label %cond_true517
-
-cond_true517: ; preds = %bb510
- br label %cond_next524
-
-cond_next524: ; preds = %cond_true517, %bb510
- br i1 false, label %cond_next540, label %cond_true533
-
-cond_true533: ; preds = %cond_next524
- br label %cond_next540
-
-cond_next540: ; preds = %cond_true533, %cond_next524
- br i1 false, label %cond_true554, label %cond_next560
-
-cond_true554: ; preds = %cond_next540
- br label %cond_next560
-
-cond_next560: ; preds = %cond_true554, %cond_next540
- br i1 false, label %cond_true566, label %cond_next572
-
-cond_true566: ; preds = %cond_next560
- br label %cond_next572
-
-cond_next572: ; preds = %cond_true566, %cond_next560
- br i1 false, label %bb608.preheader, label %bb791.preheader
-
-bb608.preheader: ; preds = %cond_next797.us, %cond_next572
- br label %bb608
-
-bb608: ; preds = %cond_next771, %bb608.preheader
- br i1 false, label %cond_false627, label %cond_true613
-
-cond_true613: ; preds = %bb608
- br label %cond_next640
-
-cond_false627: ; preds = %bb608
- br label %cond_next640
-
-cond_next640: ; preds = %cond_false627, %cond_true613
- br i1 false, label %cond_true653, label %cond_next671
-
-cond_true653: ; preds = %cond_next640
- br label %cond_next671
-
-cond_next671: ; preds = %cond_true653, %cond_next640
- br i1 false, label %cond_true683, label %cond_next724
-
-cond_true683: ; preds = %cond_next671
- br i1 false, label %cond_next724, label %L1
-
-cond_next724: ; preds = %cond_true683, %cond_next671
- br i1 false, label %cond_true735, label %L1
-
-cond_true735: ; preds = %cond_next724
- br label %L1
-
-L1: ; preds = %cond_true735, %cond_next724, %cond_true683
- br i1 false, label %cond_true745, label %cond_next771
-
-cond_true745: ; preds = %L1
- br label %cond_next771
-
-cond_next771: ; preds = %cond_true745, %L1
- br i1 false, label %bb608, label %bb791.preheader.loopexit
-
-bb791.preheader.loopexit: ; preds = %cond_next771
- br label %bb791.preheader
-
-bb791.preheader: ; preds = %bb791.preheader.loopexit, %cond_next572
- br i1 false, label %cond_next797.us, label %bb809.split
-
-cond_next797.us: ; preds = %bb791.preheader
- br label %bb608.preheader
-
-bb809.split: ; preds = %bb791.preheader
- br i1 false, label %cond_next827, label %cond_true820
-
-cond_true820: ; preds = %bb809.split
- br label %cond_next827
-
-cond_next827: ; preds = %cond_true820, %bb809.split
- br i1 false, label %cond_true833, label %cond_next840
-
-cond_true833: ; preds = %cond_next827
- br label %cond_next840
-
-cond_next840: ; preds = %cond_true833, %cond_next827
- br i1 false, label %bb866, label %bb1245
-
-bb866: ; preds = %bb1239, %cond_next840
- br i1 false, label %cond_true875, label %bb911
-
-cond_true875: ; preds = %bb866
- br label %cond_next1180
-
-bb911: ; preds = %bb866
- switch i32 0, label %bb1165 [
- i32 0, label %bb915
- i32 1, label %bb932
- i32 2, label %bb941
- i32 3, label %bb1029
- i32 4, label %bb1036
- i32 5, label %bb1069
- i32 6, label %L3
- ]
-
-bb915: ; preds = %cond_next1171, %bb911
- br i1 false, label %cond_next1171, label %cond_next1180
-
-bb932: ; preds = %cond_next1171, %bb911
- br label %L1970
-
-bb941: ; preds = %cond_next1171, %bb911
- br label %L1970
-
-L1970: ; preds = %bb941, %bb932
- br label %bb1165
-
-bb1029: ; preds = %cond_next1171, %bb911
- br label %L4
-
-bb1036: ; preds = %cond_next1171, %bb911
- br label %L4
-
-bb1069: ; preds = %cond_next1171, %bb911
- br i1 false, label %cond_next1121, label %cond_true1108
-
-L3: ; preds = %cond_next1171, %bb911
- br i1 false, label %cond_next1121, label %cond_true1108
-
-cond_true1108: ; preds = %L3, %bb1069
- br label %L4
-
-cond_next1121: ; preds = %L3, %bb1069
- br label %L4
-
-L4: ; preds = %cond_next1121, %cond_true1108, %bb1036, %bb1029
- br label %bb1165
-
-bb1165: ; preds = %cond_next1171, %L4, %L1970, %bb911
- br i1 false, label %cond_next1171, label %cond_next1180
-
-cond_next1171: ; preds = %bb1165, %bb915
- switch i32 0, label %bb1165 [
- i32 0, label %bb915
- i32 1, label %bb932
- i32 2, label %bb941
- i32 3, label %bb1029
- i32 4, label %bb1036
- i32 5, label %bb1069
- i32 6, label %L3
- ]
-
-cond_next1180: ; preds = %bb1165, %bb915, %cond_true875
- br label %bb1239
-
-bb1239: ; preds = %cond_next1251, %cond_next1180
- br i1 false, label %bb866, label %bb1245
-
-bb1245: ; preds = %bb1239, %cond_next840
- br i1 false, label %cond_next1251, label %bb1257
-
-cond_next1251: ; preds = %bb1245
- br label %bb1239
-
-bb1257: ; preds = %bb1245
- ret void
-}
diff --git a/release_23/test/Other/2007-06-05-PassID.ll b/release_23/test/Other/2007-06-05-PassID.ll
deleted file mode 100644
index 25923a5d86bf..000000000000
--- a/release_23/test/Other/2007-06-05-PassID.ll
+++ /dev/null
@@ -1,11 +0,0 @@
-;RUN: llvm-as < %s | opt -analyze -print-cfg-only -disable-output
-;PR 1497
-
-define void @foo() {
-entry:
- br label %return
-
-return: ; preds = %entry
- ret void
-}
-
diff --git a/release_23/test/Other/2007-06-16-Funcname.ll b/release_23/test/Other/2007-06-16-Funcname.ll
deleted file mode 100644
index 75b96e6c373f..000000000000
--- a/release_23/test/Other/2007-06-16-Funcname.ll
+++ /dev/null
@@ -1,7 +0,0 @@
-; RUN: llvm-as < %s | llc -march=cpp -cppfname=WAKKA | not grep makeLLVMModule
-; PR1515
-
-define void @foo() {
- ret void
-}
-
diff --git a/release_23/test/Other/2007-06-28-PassManager.ll b/release_23/test/Other/2007-06-28-PassManager.ll
deleted file mode 100644
index 5968d8c68bc2..000000000000
--- a/release_23/test/Other/2007-06-28-PassManager.ll
+++ /dev/null
@@ -1,7 +0,0 @@
-; RUN: llvm-as < %s | opt -analyze -inline -disable-output
-; PR 1526
-; RUN: llvm-as < %s | opt -analyze -indvars -disable-output
-; PR 1539
-define i32 @test1() {
- ret i32 0;
-}
diff --git a/release_23/test/Other/2007-09-10-PassManager.ll b/release_23/test/Other/2007-09-10-PassManager.ll
deleted file mode 100644
index 863be33b3f91..000000000000
--- a/release_23/test/Other/2007-09-10-PassManager.ll
+++ /dev/null
@@ -1,32 +0,0 @@
-; RUN: llvm-as < %s | opt -loop-unswitch -indvars -disable-output
-; Require SCEV before LCSSA.
-define void @foo() {
-entry:
- %i = alloca i32, align 4 ; <i32*> [#uses=5]
- %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
- store i32 0, i32* %i, align 4
- br label %bb3
-
-bb: ; preds = %bb3
- %tmp = load i32* %i, align 4 ; <i32> [#uses=1]
- call void @bar( i32 %tmp )
- %tmp1 = load i32* %i, align 4 ; <i32> [#uses=1]
- %tmp2 = add i32 %tmp1, 1 ; <i32> [#uses=1]
- store i32 %tmp2, i32* %i, align 4
- br label %bb3
-
-bb3: ; preds = %bb, %entry
- %tmp4 = load i32* %i, align 4 ; <i32> [#uses=1]
- %tmp5 = icmp sle i32 %tmp4, 9 ; <i1> [#uses=1]
- %tmp56 = zext i1 %tmp5 to i8 ; <i8> [#uses=1]
- %toBool = icmp ne i8 %tmp56, 0 ; <i1> [#uses=1]
- br i1 %toBool, label %bb, label %bb7
-
-bb7: ; preds = %bb3
- br label %return
-
-return: ; preds = %bb7
- ret void
-}
-
-declare void @bar(i32)
diff --git a/release_23/test/Other/2008-02-14-PassManager.ll b/release_23/test/Other/2008-02-14-PassManager.ll
deleted file mode 100644
index 985e1908ef08..000000000000
--- a/release_23/test/Other/2008-02-14-PassManager.ll
+++ /dev/null
@@ -1,5 +0,0 @@
-; RUN: llvm-as < %s | opt -loop-unroll -loop-rotate -simplifycfg -disable-output
-; PR 2028
-define i32 @test1() {
- ret i32 0;
-}
diff --git a/release_23/test/Other/2008-03-19-PassManager.ll b/release_23/test/Other/2008-03-19-PassManager.ll
deleted file mode 100644
index 832465ca9f5e..000000000000
--- a/release_23/test/Other/2008-03-19-PassManager.ll
+++ /dev/null
@@ -1,58 +0,0 @@
-; PR 2034
-; RUN: llvm-as < %s | opt -anders-aa -instcombine -gvn -disable-output
- %struct.FULL = type { i32, i32, [1000 x float*] }
-
-define i32 @sgesl(%struct.FULL* %a, i32* %ipvt, float* %b, i32 %job) {
-entry:
- %a_addr = alloca %struct.FULL* ; <%struct.FULL**> [#uses=1]
- %ipvt_addr = alloca i32* ; <i32**> [#uses=1]
- %b_addr = alloca float* ; <float**> [#uses=1]
- %job_addr = alloca i32 ; <i32*> [#uses=1]
- %akk = alloca float* ; <float**> [#uses=2]
- %k = alloca i32 ; <i32*> [#uses=1]
- %l = alloca i32 ; <i32*> [#uses=1]
- %n = alloca i32 ; <i32*> [#uses=1]
- %nm1 = alloca i32 ; <i32*> [#uses=1]
- %tmp5 = load i32* %job_addr, align 4 ; <i32> [#uses=1]
- %tmp6 = icmp eq i32 %tmp5, 0 ; <i1> [#uses=1]
- %tmp67 = zext i1 %tmp6 to i8 ; <i8> [#uses=1]
- %toBool = icmp ne i8 %tmp67, 0 ; <i1> [#uses=1]
- br i1 %toBool, label %cond_true, label %cond_next137
-
-cond_true: ; preds = %entry
- %tmp732 = load i32* %nm1, align 4 ; <i32> [#uses=1]
- %tmp743 = icmp slt i32 0, %tmp732 ; <i1> [#uses=1]
- %tmp74754 = zext i1 %tmp743 to i8 ; <i8> [#uses=1]
- %toBool765 = icmp ne i8 %tmp74754, 0 ; <i1> [#uses=1]
- br i1 %toBool765, label %bb, label %bb77
-
-bb: ; preds = %cond_true
- %tmp9 = load %struct.FULL** %a_addr, align 4 ; <%struct.FULL*> [#uses=1]
- %tmp10 = getelementptr %struct.FULL* %tmp9, i32 0, i32 2 ; <[1000 x float*]*> [#uses=1]
- %tmp11 = getelementptr [1000 x float*]* %tmp10, i32 0, i32 0 ; <float**> [#uses=1]
- %tmp12 = load float** %tmp11, align 4 ; <float*> [#uses=1]
- %tmp13 = load i32* %k, align 4 ; <i32> [#uses=1]
- %tmp14 = getelementptr float* %tmp12, i32 %tmp13 ; <float*> [#uses=1]
- store float* %tmp14, float** %akk, align 4
- %tmp17 = load float** %b_addr, align 4 ; <float*> [#uses=0]
- %tmp18 = load i32* %l, align 4 ; <i32> [#uses=0]
- ret i32 0
-
-bb77: ; preds = %cond_true
- ret i32 0
-
-cond_next137: ; preds = %entry
- %tmp18922 = load i32* %n, align 4 ; <i32> [#uses=1]
- %tmp19023 = icmp slt i32 0, %tmp18922 ; <i1> [#uses=1]
- %tmp19019124 = zext i1 %tmp19023 to i8 ; <i8> [#uses=1]
- %toBool19225 = icmp ne i8 %tmp19019124, 0 ; <i1> [#uses=1]
- br i1 %toBool19225, label %bb138, label %bb193
-
-bb138: ; preds = %cond_next137
- store float* null, float** %akk, align 4
- ret i32 0
-
-bb193: ; preds = %cond_next137
- %tmp196 = load i32** %ipvt_addr, align 4 ; <i32*> [#uses=0]
- ret i32 0
-}
diff --git a/release_23/test/Other/dg.exp b/release_23/test/Other/dg.exp
deleted file mode 100644
index 879685ca879d..000000000000
--- a/release_23/test/Other/dg.exp
+++ /dev/null
@@ -1,3 +0,0 @@
-load_lib llvm.exp
-
-RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
diff --git a/release_23/test/Other/invalid-commandline-option.ll b/release_23/test/Other/invalid-commandline-option.ll
deleted file mode 100644
index b74c49857e35..000000000000
--- a/release_23/test/Other/invalid-commandline-option.ll
+++ /dev/null
@@ -1,3 +0,0 @@
-; RUN: llvm-as < /dev/null | not opt --foo > /dev/null
-
-; there is no --foo
diff --git a/release_23/test/Scripts/README.txt b/release_23/test/Scripts/README.txt
deleted file mode 100644
index b0b11050375f..000000000000
--- a/release_23/test/Scripts/README.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-This directory contains scripts which are used by the TestRunner style
-tests, which allows them to be simpler and more direct.
diff --git a/release_23/test/Scripts/count b/release_23/test/Scripts/count
deleted file mode 100755
index cc0355208b71..000000000000
--- a/release_23/test/Scripts/count
+++ /dev/null
@@ -1,17 +0,0 @@
-#!/bin/sh
-#
-# Program: count
-#
-# Synopsis: Count the number of lines of input on stdin and test that it
-# matches the specified number.
-#
-# Syntax: count <number>
-
-set -e
-set -u
-input_lines=$(wc -l)
-if [ "$input_lines" -ne "$1" ]; then
- echo "count: expected $1 lines and got ${input_lines}."
- exit 1
-fi
-exit 0
diff --git a/release_23/test/Scripts/ignore b/release_23/test/Scripts/ignore
deleted file mode 100755
index 865ae4df1bd4..000000000000
--- a/release_23/test/Scripts/ignore
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/bin/sh
-#
-# Program: ignore
-#
-# Synopsis: Ignore the result code of the command and always return 0
-#
-# Syntax: ignore command <arguments>
-
-"$@" || exit 0 && exit 0
-exit 0
diff --git a/release_23/test/Scripts/not b/release_23/test/Scripts/not
deleted file mode 100755
index e3b1efe35c8d..000000000000
--- a/release_23/test/Scripts/not
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/bin/sh
-#
-# Program: not
-#
-# Synopsis: Inverse the output of the program specified on the command line
-#
-# Syntax: not command <arguments>
-
-if "$@"
-then exit 1
-else exit 0
-fi
diff --git a/release_23/test/Scripts/notcast b/release_23/test/Scripts/notcast
deleted file mode 100755
index 6d56580c8fc9..000000000000
--- a/release_23/test/Scripts/notcast
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/bin/sh
-#
-# Program: notcast
-#
-# Synopsis: Returns 0 if the input does not contain a cast operator
-#
-# Syntax: notcast tailexpr
-#
-# postpat - optionally allows a regular expression to go at the end
-# prepat - optionally allow a regular expression to go at the start
-#
-
-if grep "$2"'\(\([sz]ext\)\|\(trunc\)\|\(fpto[us]i\)\|\([us]itofp\)\|\(bitcast\)\|\(fpext\)\|\(fptrunc\)\|\(ptrtoint\)\|\(inttoptr\)\|\(cast\)\)'"$1"
-then exit 1
-else exit 0
-fi
diff --git a/release_23/test/Scripts/prcontext.tcl b/release_23/test/Scripts/prcontext.tcl
deleted file mode 100755
index 5ab0854b0b3f..000000000000
--- a/release_23/test/Scripts/prcontext.tcl
+++ /dev/null
@@ -1,36 +0,0 @@
-#!/usr/bin/tclsh
-#
-# Usage:
-# prcontext <pattern> <# lines of context>
-# (for platforms that don't have grep -C)
-
-
-#
-# Get the arguments
-#
-set pattern [lindex $argv 0]
-set num [lindex $argv 1]
-
-
-#
-# Get all of the lines in the file.
-#
-set lines [split [read stdin] \n]
-
-set index 0
-foreach line $lines {
- if { [regexp $pattern $line match matchline] } {
- if { [ expr [expr $index - $num] < 0 ] } {
- set bottom 0
- } else {
- set bottom [expr $index - $num]
- }
- set endLineNum [ expr [expr $index + $num] + 1]
- while {$bottom < $endLineNum} {
- set output [lindex $lines $bottom]
- puts $output
- set bottom [expr $bottom + 1]
- }
- }
- set index [expr $index + 1]
-} \ No newline at end of file
diff --git a/release_23/test/TableGen/2003-08-03-PassCode.td b/release_23/test/TableGen/2003-08-03-PassCode.td
deleted file mode 100644
index 71421865a588..000000000000
--- a/release_23/test/TableGen/2003-08-03-PassCode.td
+++ /dev/null
@@ -1,7 +0,0 @@
-// RUN: tblgen %s
-
-class test<code C> {
- code Code = C;
-}
-
-def foo : test<[{ hello world! }]>;
diff --git a/release_23/test/TableGen/2006-09-18-LargeInt.td b/release_23/test/TableGen/2006-09-18-LargeInt.td
deleted file mode 100644
index 0e441c5b4776..000000000000
--- a/release_23/test/TableGen/2006-09-18-LargeInt.td
+++ /dev/null
@@ -1,5 +0,0 @@
-// RUN: tblgen %s | grep -- -65536
-
-def X {
- int Y = 0xFFFF0000;
-}
diff --git a/release_23/test/TableGen/AnonDefinitionOnDemand.td b/release_23/test/TableGen/AnonDefinitionOnDemand.td
deleted file mode 100644
index d567fc807e85..000000000000
--- a/release_23/test/TableGen/AnonDefinitionOnDemand.td
+++ /dev/null
@@ -1,12 +0,0 @@
-// RUN: tblgen < %s
-
-class foo<int X> { int THEVAL = X; }
-def foo_imp : foo<1>;
-
-def x {
- foo Y = foo_imp; // This works.
-}
-
-def X {
- foo Y = foo<1>; // This should work too, synthesizing a new foo<1>.
-}
diff --git a/release_23/test/TableGen/BitsInitOverflow.td b/release_23/test/TableGen/BitsInitOverflow.td
deleted file mode 100644
index c0b5da90dd85..000000000000
--- a/release_23/test/TableGen/BitsInitOverflow.td
+++ /dev/null
@@ -1,5 +0,0 @@
-// RUN: not tblgen %s
-
-def {
- bits<2> X = 5; // bitfield is too small, reject
-}
diff --git a/release_23/test/TableGen/CStyleComment.td b/release_23/test/TableGen/CStyleComment.td
deleted file mode 100644
index 703ae6837eb8..000000000000
--- a/release_23/test/TableGen/CStyleComment.td
+++ /dev/null
@@ -1,14 +0,0 @@
-// Test that multiline, nested, comments work correctly.
-//
-// RUN: tblgen < %s
-
-/* Foo
- bar
- /*
- blah
- */
-
- stuff
- */
-
-def x;
diff --git a/release_23/test/TableGen/DagDefSubst.ll b/release_23/test/TableGen/DagDefSubst.ll
deleted file mode 100644
index e5eebe99e8c1..000000000000
--- a/release_23/test/TableGen/DagDefSubst.ll
+++ /dev/null
@@ -1,15 +0,0 @@
-// RUN: tblgen %s | grep {dag d = (X Y)}
-// RUN: tblgen %s | grep {dag e = (Y X)}
-def X;
-
-class yclass;
-def Y : yclass;
-
-class C<yclass N> {
- dag d = (X N);
- dag e = (N X);
-}
-
-def VAL : C<Y>;
-
-
diff --git a/release_23/test/TableGen/DagIntSubst.ll b/release_23/test/TableGen/DagIntSubst.ll
deleted file mode 100644
index 3c1291c3eca6..000000000000
--- a/release_23/test/TableGen/DagIntSubst.ll
+++ /dev/null
@@ -1,10 +0,0 @@
-// RUN: tblgen %s | grep {dag d = (X 13)}
-def X;
-
-class C<int N> {
- dag d = (X N);
-}
-
-def VAL : C<13>;
-
-
diff --git a/release_23/test/TableGen/ForwardRef.td b/release_23/test/TableGen/ForwardRef.td
deleted file mode 100644
index 2056b1faff35..000000000000
--- a/release_23/test/TableGen/ForwardRef.td
+++ /dev/null
@@ -1,15 +0,0 @@
-// RUN: tblgen %s -o -
-
-class bar {
- list<bar> x;
-}
-
-class foo;
-class foo;
-
-class baz { list<foo> y; }
-
-class foo {
-
-}
-
diff --git a/release_23/test/TableGen/GeneralList.td b/release_23/test/TableGen/GeneralList.td
deleted file mode 100644
index 7f099f286499..000000000000
--- a/release_23/test/TableGen/GeneralList.td
+++ /dev/null
@@ -1,8 +0,0 @@
-// RUN: tblgen %s
-//
-// Test to make sure that lists work with any data-type
-
-class foo {
- list<int> Test = [1, 2, 3];
- list<string> Test2 = ["abc", "xyz", "gtq"];
-}
diff --git a/release_23/test/TableGen/Include.inc b/release_23/test/TableGen/Include.inc
deleted file mode 100644
index 876bf47ca96a..000000000000
--- a/release_23/test/TableGen/Include.inc
+++ /dev/null
@@ -1,4 +0,0 @@
-// This is used by the Include.td test
-def InInclude;
-
-
diff --git a/release_23/test/TableGen/Include.td b/release_23/test/TableGen/Include.td
deleted file mode 100644
index 29ed5150c622..000000000000
--- a/release_23/test/TableGen/Include.td
+++ /dev/null
@@ -1,7 +0,0 @@
-// RUN: tblgen -I %p %s
-def BeforeInclude;
-
-include "Include.inc"
-
-def AfterInclude;
-
diff --git a/release_23/test/TableGen/IntBitInit.td b/release_23/test/TableGen/IntBitInit.td
deleted file mode 100644
index b949bfea7b13..000000000000
--- a/release_23/test/TableGen/IntBitInit.td
+++ /dev/null
@@ -1,5 +0,0 @@
-// RUN: tblgen %s
-def {
- bit A = 1;
- int B = A;
-}
diff --git a/release_23/test/TableGen/LazyChange.td b/release_23/test/TableGen/LazyChange.td
deleted file mode 100644
index 145fd0bb79f3..000000000000
--- a/release_23/test/TableGen/LazyChange.td
+++ /dev/null
@@ -1,11 +0,0 @@
-// RUN: tblgen %s | grep {int Y = 3}
-
-
-class C {
- int X = 4;
- int Y = X;
-}
-
-let X = 3 in
-def D : C; // Y should be 3 too!
-
diff --git a/release_23/test/TableGen/ListConversion.td b/release_23/test/TableGen/ListConversion.td
deleted file mode 100644
index 773ed6e4d114..000000000000
--- a/release_23/test/TableGen/ListConversion.td
+++ /dev/null
@@ -1,10 +0,0 @@
-// RUN: tblgen %s
-class A;
-class B : A;
-
-def b : B;
-
-def {
- list<B> X = [b];
- list<A> Y = X;
-}
diff --git a/release_23/test/TableGen/ListSlices.td b/release_23/test/TableGen/ListSlices.td
deleted file mode 100644
index be794cf2174a..000000000000
--- a/release_23/test/TableGen/ListSlices.td
+++ /dev/null
@@ -1,18 +0,0 @@
-// RUN: tblgen %s
-
-def A {
- list<int> B = [10, 20, 30, 4, 1, 1231, 20];
-}
-
-def B {
- list<int> X = [10, 20, 30, 4, 1, 1231, 20] [2-4,2,2,0-6];
-
- list<int> Y = X[4,5];
- int Z = X[4];
-
- list<int> C = A.B[1-4];
-
- list<list<int>> AA = [X, Y];
-
- int BB = AA[0][1];
-}
diff --git a/release_23/test/TableGen/MultiClass.td b/release_23/test/TableGen/MultiClass.td
deleted file mode 100644
index 52ba59c230f1..000000000000
--- a/release_23/test/TableGen/MultiClass.td
+++ /dev/null
@@ -1,25 +0,0 @@
-// RUN: tblgen %s | grep {zing = 4} | count 2
-
-class C1<int A, string B> {
- int bar = A;
- string thestr = B;
- int zing;
-}
-
-def T : C1<4, "blah">;
-
-multiclass t<int a> {
- def S1 : C1<a, "foo"> {
- int foo = 4;
- let bar = 1;
- }
- def S2 : C1<a, "bar">;
-}
-
-defm FOO : t<42>;
-
-def T4 : C1<6, "foo">;
-
-let zing = 4 in
- defm BAZ : t<3>;
-
diff --git a/release_23/test/TableGen/SuperSubclassSameName.td b/release_23/test/TableGen/SuperSubclassSameName.td
deleted file mode 100644
index 087df87124bf..000000000000
--- a/release_23/test/TableGen/SuperSubclassSameName.td
+++ /dev/null
@@ -1,20 +0,0 @@
-// RUN: tblgen < %s
-// Test for template arguments that have the same name as superclass template
-// arguments.
-
-
-class Arg { int a; }
-def TheArg : Arg { let a = 1; }
-
-
-class Super<Arg F> {
- int X = F.a;
-}
-class Sub<Arg F> : Super<F>;
-def inst : Sub<TheArg>;
-
-
-class Super2<int F> {
- int X = F;
-}
-class Sub2<int F> : Super2<F>;
diff --git a/release_23/test/TableGen/TargetInstrInfo.td b/release_23/test/TableGen/TargetInstrInfo.td
deleted file mode 100644
index 8299541e3c51..000000000000
--- a/release_23/test/TableGen/TargetInstrInfo.td
+++ /dev/null
@@ -1,148 +0,0 @@
-// This test describes how we eventually want to describe instructions in
-// the target independent code generators.
-// RUN: tblgen %s
-
-// Target indep stuff.
-class Instruction { // Would have other stuff eventually
- bit isTwoAddress = 0;
- string AssemblyString;
-}
-class RegisterClass;
-
-class RTLNode;
-
-def ops; // Marker for operand list.
-
-// Various expressions used in RTL descriptions.
-def imm8 : RTLNode;
-def imm32 : RTLNode;
-def addr : RTLNode;
-
-def set : RTLNode;
-def signext : RTLNode;
-def zeroext : RTLNode;
-def plus : RTLNode;
-def and : RTLNode;
-def xor : RTLNode;
-def shl : RTLNode;
-def load : RTLNode;
-def store : RTLNode;
-def unspec : RTLNode;
-
-// Start of X86 specific stuff.
-
-def R8 : RegisterClass;
-def R16 : RegisterClass;
-def R32 : RegisterClass;
-
-def CL; // As are currently defined
-def AL;
-def AX;
-def EDX;
-
-class Format<bits<5> val> {
- bits<5> Value = val;
-}
-
-def Pseudo : Format<0>; def RawFrm : Format<1>;
-def AddRegFrm : Format<2>; def MRMDestReg : Format<3>;
-def MRMDestMem : Format<4>; def MRMSrcReg : Format<5>;
-def MRMSrcMem : Format<6>;
-def MRM0r : Format<16>; def MRM1r : Format<17>; def MRM2r : Format<18>;
-def MRM3r : Format<19>; def MRM4r : Format<20>; def MRM5r : Format<21>;
-def MRM6r : Format<22>; def MRM7r : Format<23>;
-def MRM0m : Format<24>; def MRM1m : Format<25>; def MRM2m : Format<26>;
-def MRM3m : Format<27>; def MRM4m : Format<28>; def MRM5m : Format<29>;
-def MRM6m : Format<30>; def MRM7m : Format<31>;
-
-
-class Inst<dag opnds, string asmstr, bits<8> opcode,
- Format f, list<dag> rtl> : Instruction {
- dag Operands = opnds;
- string AssemblyString = asmstr;
- bits<8> Opcode = opcode;
- Format Format = f;
- list<dag> RTL = rtl;
-}
-
-
-// Start of instruction definitions, the real point of this file.
-//
-// Note that these patterns show a couple of important things:
-// 1. The order and contents of the operands of the MachineInstr are
-// described here. Eventually we can do away with this when everything
-// is generated from the description.
-// 2. The asm string is captured here, which makes it possible to get rid of
-// a ton of hacks in the various printers and a bunch of flags.
-// 3. Target specific properties (e.g. Format) can still be captured as
-// needed.
-// 4. We capture the behavior of the instruction with a simplified RTL-like
-// expression.
-// 5. The use/def properties for each operand are automatically inferred from
-// the pattern.
-// 6. Address expressions should become first-class entities.
-
-// Simple copy instruction. isMoveInstr could easily be inferred from this,
-// as could TargetRegisterInfo::copyRegToReg.
-def MOV8rr : Inst<(ops R8:$dst, R8:$src),
- "mov $dst, $src", 0x88, MRMDestReg,
- [(set R8:$dst, R8:$src)]>;
-
-// Simple immediate initialization.
-def MOV8ri : Inst<(ops R8:$dst, imm8:$src),
- "mov $dst, $src", 0xB0, AddRegFrm,
- [(set R8:$dst, imm8:$src)]>;
-
-// Two address instructions are described as three-addr instructions, with
-// the special target-independent isTwoAddress flag set. The asm pattern
-// should not refer to the $src1, this would be enforced by the
-// TargetInstrInfo tablegen backend.
-let isTwoAddress = 1 in
-def AND8rr : Inst<(ops R8:$dst, R8:$src1, R8:$src2),
- "and $dst, $src2", 0x20, MRMDestReg,
- [(set R8:$dst, (and R8:$src1, R8:$src2))]>;
-
-// Instructions that have explicit uses/defs make them explicit in the RTL.
-// Instructions that need extra stuff emitted in the assembly can, trivially.
-let isTwoAddress = 1 in
-def SHL32rCL : Inst<(ops R32:$dst, R32:$src),
- "shl $dst, CL", 0xD2, MRM4r,
- [(set R32:$dst, (shl R32:$src, CL))]>;
-
-// The RTL list is a list, allowing complex instructions to be defined easily.
-// Temporary 'internal' registers can be used to break instructions appart.
-let isTwoAddress = 1 in
-def XOR32mi : Inst<(ops addr:$addr, imm32:$imm),
- "xor $dst, $src2", 0x81, MRM6m,
- [(set R32:$tmp1, (load addr:$addr)),
- (set R32:$tmp2, (xor R32:$tmp1, imm32:$imm)),
- (store addr:$addr, R32:$tmp2)]>;
-
-// Alternatively, if each tmporary register is only used once, the instruction
-// can just be described in nested form. This would be the canonical
-// representation the target generator would convert the above into. Pick your
-// favorite indentation scheme.
-let isTwoAddress = 1 in
-def AND32mr : Inst<(ops addr:$addr, R32:$src),
- "xor $dst, $src2", 0x81, MRM6m,
- [(store addr:$addr,
- (and
- (load addr:$addr),
- R32:$src)
- )
- ]>;
-
-// Describing complex instructions is not too hard! Note how implicit uses/defs
-// become explicit here.
-def CBW : Inst<(ops),
- "cbw", 0x98, RawFrm,
- [(set AX, (signext AL))]>;
-
-// Noop, does nothing.
-def NOOP : Inst<(ops), "nop", 0x90, RawFrm, []>;
-
-
-// Instructions that don't expect optimization can use unspec.
-def IN8rr : Inst<(ops), "in AL, EDX", 0xEC, RawFrm,
- [(set AL, (unspec EDX))]>;
-
diff --git a/release_23/test/TableGen/TemplateArgRename.td b/release_23/test/TableGen/TemplateArgRename.td
deleted file mode 100644
index 535c2e430129..000000000000
--- a/release_23/test/TableGen/TemplateArgRename.td
+++ /dev/null
@@ -1,17 +0,0 @@
-// RUN: tblgen %s
-
-// Make sure there is no collision between XX and XX.
-def S;
-
-class Before<int XX>;
-class After : Before<4> {
- dag XX = (S);
-}
-
-
-
-class C1<int X> {
- int Y = X;
-}
-class C2<int Y, dag X> : C1<Y>;
-
diff --git a/release_23/test/TableGen/Tree.td b/release_23/test/TableGen/Tree.td
deleted file mode 100644
index f9f1f15139d2..000000000000
--- a/release_23/test/TableGen/Tree.td
+++ /dev/null
@@ -1,18 +0,0 @@
-// This tests to make sure we can parse tree patterns.
-// RUN: tblgen %s
-
-class TreeNode;
-class RegisterClass;
-
-def set : TreeNode;
-def plus : TreeNode;
-def imm : TreeNode;
-def R32 : RegisterClass;
-
-class Inst<dag T> {
- dag Pattern = T;
-}
-
-def ADDrr32 : Inst<(set R32, (plus R32, R32))>; // a = b + c
-def ADDri32 : Inst<(set R32, (plus R32, imm))>; // a = b + imm
-
diff --git a/release_23/test/TableGen/TreeNames.td b/release_23/test/TableGen/TreeNames.td
deleted file mode 100644
index 05a3298adb7f..000000000000
--- a/release_23/test/TableGen/TreeNames.td
+++ /dev/null
@@ -1,17 +0,0 @@
-// This tests to make sure we can parse tree patterns with names.
-// RUN: tblgen %s
-
-class TreeNode;
-class RegisterClass;
-
-def set : TreeNode;
-def plus : TreeNode;
-def imm : TreeNode;
-def R32 : RegisterClass;
-
-class Inst<dag T> {
- dag Pattern = T;
-}
-
-def ADDrr32 : Inst<(set R32, (plus R32:$A, R32:$def))>;
-
diff --git a/release_23/test/TableGen/UnterminatedComment.td b/release_23/test/TableGen/UnterminatedComment.td
deleted file mode 100644
index 7f449c4f8e5e..000000000000
--- a/release_23/test/TableGen/UnterminatedComment.td
+++ /dev/null
@@ -1,6 +0,0 @@
-// RUN: not tblgen < %s
-
-def x;
-
-/* /* /* */
-
diff --git a/release_23/test/TableGen/dg.exp b/release_23/test/TableGen/dg.exp
deleted file mode 100644
index f7d275ad8cb1..000000000000
--- a/release_23/test/TableGen/dg.exp
+++ /dev/null
@@ -1,3 +0,0 @@
-load_lib llvm.exp
-
-RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{td}]]
diff --git a/release_23/test/TableGen/nested-comment.td b/release_23/test/TableGen/nested-comment.td
deleted file mode 100644
index 68e29581bc7f..000000000000
--- a/release_23/test/TableGen/nested-comment.td
+++ /dev/null
@@ -1,12 +0,0 @@
-// RUN: tblgen < %s
-
-/* foo
-
-/ foo
-
- /*NoReg*/, baz
-
-
- */
-
-def X;
diff --git a/release_23/test/TableGen/strconcat.td b/release_23/test/TableGen/strconcat.td
deleted file mode 100644
index cdf3928f04d6..000000000000
--- a/release_23/test/TableGen/strconcat.td
+++ /dev/null
@@ -1,7 +0,0 @@
-// RUN: tblgen %s | grep fufoo
-
-class Y<string S> {
- string T = !strconcat(S, "foo");
-}
-
-def Z : Y<"fu">;
diff --git a/release_23/test/TestRunner.sh b/release_23/test/TestRunner.sh
deleted file mode 100755
index d93eda28aab0..000000000000
--- a/release_23/test/TestRunner.sh
+++ /dev/null
@@ -1,36 +0,0 @@
-#!/bin/sh
-#
-# TestRunner.sh - This script is used to run the deja-gnu tests exactly like
-# deja-gnu does, by executing the Tcl script specified in the test case's
-# RUN: lines. This is made possible by a simple make target supported by the
-# test/Makefile. All this script does is invoke that make target.
-#
-# Usage:
-# TestRunner.sh {script_names}
-#
-# This script is typically used by cd'ing to a test directory and then
-# running TestRunner.sh with a list of test file names you want to run.
-#
-TESTPATH=`pwd`
-SUBDIR=""
-if test `dirname $1` == "." ; then
- while test `basename $TESTPATH` != "test" -a ! -z "$TESTPATH" ; do
- tmp=`basename $TESTPATH`
- SUBDIR="$tmp/$SUBDIR"
- TESTPATH=`dirname $TESTPATH`
- done
-fi
-
-for TESTFILE in "$@" ; do
- if test `dirname $TESTFILE` == . ; then
- if test -d "$TESTPATH" ; then
- cd $TESTPATH
- make check-one TESTONE="$SUBDIR$TESTFILE"
- cd $PWD
- else
- echo "Can't find llvm/test directory in " `pwd`
- fi
- else
- make check-one TESTONE=$TESTFILE
- fi
-done
diff --git a/release_23/test/Transforms/ADCE/2002-01-31-UseStuckAround.ll b/release_23/test/Transforms/ADCE/2002-01-31-UseStuckAround.ll
deleted file mode 100644
index 893d82b9f5e0..000000000000
--- a/release_23/test/Transforms/ADCE/2002-01-31-UseStuckAround.ll
+++ /dev/null
@@ -1,13 +0,0 @@
-; RUN: llvm-as %s -o - | opt -adce
-
-define i32 @"main"(i32 %argc)
-begin
- br label %2
-
- %retval = phi i32 [ %argc, %2 ] ; <i32> [#uses=2]
- %two = add i32 %retval, %retval ; <i32> [#uses=1]
- ret i32 %two
-
- br label %1
-end
-
diff --git a/release_23/test/Transforms/ADCE/2002-05-22-PHITest.ll b/release_23/test/Transforms/ADCE/2002-05-22-PHITest.ll
deleted file mode 100644
index 04f0051af8dc..000000000000
--- a/release_23/test/Transforms/ADCE/2002-05-22-PHITest.ll
+++ /dev/null
@@ -1,16 +0,0 @@
-; It is illegal to remove BB1 because it will mess up the PHI node!
-;
-; RUN: llvm-as < %s | opt -adce | llvm-dis | grep BB1
-
-define i32 @test(i1 %C, i32 %A, i32 %B) {
-; <label>:0
- br i1 %C, label %BB1, label %BB2
-
-BB1: ; preds = %0
- br label %BB2
-
-BB2: ; preds = %BB1, %0
- %R = phi i32 [ %A, %0 ], [ %B, %BB1 ] ; <i32> [#uses=1]
- ret i32 %R
-}
-
diff --git a/release_23/test/Transforms/ADCE/2002-05-23-ZeroArgPHITest.ll b/release_23/test/Transforms/ADCE/2002-05-23-ZeroArgPHITest.ll
deleted file mode 100644
index 911f8e678b35..000000000000
--- a/release_23/test/Transforms/ADCE/2002-05-23-ZeroArgPHITest.ll
+++ /dev/null
@@ -1,32 +0,0 @@
-; This testcase contains a entire loop that should be removed. The only thing
-; left is the store instruction in BB0. The problem this testcase was running
-; into was that when the reg109 PHI was getting zero predecessors, it was
-; removed even though there were uses still around. Now the uses are filled
-; in with a dummy value before the PHI is deleted.
-;
-; RUN: llvm-as < %s | opt -adce
-
- %node_t = type { double*, %node_t*, %node_t**, double**, double*, i32, i32 }
-
-define void @localize_local(%node_t* %nodelist) {
-bb0:
- %nodelist.upgrd.1 = alloca %node_t* ; <%node_t**> [#uses=2]
- store %node_t* %nodelist, %node_t** %nodelist.upgrd.1
- br label %bb1
-
-bb1: ; preds = %bb0
- %reg107 = load %node_t** %nodelist.upgrd.1 ; <%node_t*> [#uses=2]
- %cond211 = icmp eq %node_t* %reg107, null ; <i1> [#uses=1]
- br i1 %cond211, label %bb3, label %bb2
-
-bb2: ; preds = %bb2, %bb1
- %reg109 = phi %node_t* [ %reg110, %bb2 ], [ %reg107, %bb1 ] ; <%node_t*> [#uses=1]
- %reg212 = getelementptr %node_t* %reg109, i64 0, i32 1 ; <%node_t**> [#uses=1]
- %reg110 = load %node_t** %reg212 ; <%node_t*> [#uses=2]
- %cond213 = icmp ne %node_t* %reg110, null ; <i1> [#uses=1]
- br i1 %cond213, label %bb2, label %bb3
-
-bb3: ; preds = %bb2, %bb1
- ret void
-}
-
diff --git a/release_23/test/Transforms/ADCE/2002-05-28-Crash-distilled.ll b/release_23/test/Transforms/ADCE/2002-05-28-Crash-distilled.ll
deleted file mode 100644
index 5d25ff13525e..000000000000
--- a/release_23/test/Transforms/ADCE/2002-05-28-Crash-distilled.ll
+++ /dev/null
@@ -1,17 +0,0 @@
-; This testcase is a distilled form of: 2002-05-28-Crash.ll
-
-; RUN: llvm-as < %s | opt -adce
-
-define float @test(i32 %i) {
- %F = sitofp i32 %i to float ; <float> [#uses=1]
- %I = bitcast i32 %i to i32 ; <i32> [#uses=1]
- br label %Loop
-
-Loop: ; preds = %Loop, %0
- %B = icmp ne i32 %I, 0 ; <i1> [#uses=1]
- br i1 %B, label %Out, label %Loop
-
-Out: ; preds = %Loop
- ret float %F
-}
-
diff --git a/release_23/test/Transforms/ADCE/2002-05-28-Crash.ll b/release_23/test/Transforms/ADCE/2002-05-28-Crash.ll
deleted file mode 100644
index 27c7205203c0..000000000000
--- a/release_23/test/Transforms/ADCE/2002-05-28-Crash.ll
+++ /dev/null
@@ -1,54 +0,0 @@
-; This testcase is distilled from the GNU rx package. The loop should be
-; removed but causes a problem when ADCE does. The source function is:
-; int rx_bitset_empty (int size, rx_Bitset set) {
-; int x;
-; RX_subset s;
-; s = set[0];
-; set[0] = 1;
-; for (x = rx_bitset_numb_subsets(size) - 1; !set[x]; --x)
-; ;
-; set[0] = s;
-; return !s;
-;}
-;
-; RUN: llvm-as < %s | opt -adce
-
-define i32 @rx_bitset_empty(i32 %size, i32* %set) {
-bb1:
- %reg110 = load i32* %set ; <i32> [#uses=2]
- store i32 1, i32* %set
- %cast112 = sext i32 %size to i64 ; <i64> [#uses=1]
- %reg113 = add i64 %cast112, 31 ; <i64> [#uses=1]
- %reg114 = lshr i64 %reg113, 5 ; <i64> [#uses=2]
- %cast109 = trunc i64 %reg114 to i32 ; <i32> [#uses=1]
- %reg129 = add i32 %cast109, -1 ; <i32> [#uses=1]
- %reg114-idxcast = trunc i64 %reg114 to i32 ; <i32> [#uses=1]
- %reg114-idxcast-offset = add i32 %reg114-idxcast, 1073741823 ; <i32> [#uses=1]
- %reg114-idxcast-offset.upgrd.1 = zext i32 %reg114-idxcast-offset to i64 ; <i64> [#uses=1]
- %reg124 = getelementptr i32* %set, i64 %reg114-idxcast-offset.upgrd.1 ; <i32*> [#uses=1]
- %reg125 = load i32* %reg124 ; <i32> [#uses=1]
- %cond232 = icmp ne i32 %reg125, 0 ; <i1> [#uses=1]
- br i1 %cond232, label %bb3, label %bb2
-
-bb2: ; preds = %bb2, %bb1
- %cann-indvar = phi i32 [ 0, %bb1 ], [ %add1-indvar, %bb2 ] ; <i32> [#uses=2]
- %reg130-scale = mul i32 %cann-indvar, -1 ; <i32> [#uses=1]
- %reg130 = add i32 %reg130-scale, %reg129 ; <i32> [#uses=1]
- %add1-indvar = add i32 %cann-indvar, 1 ; <i32> [#uses=1]
- %reg130-idxcast = bitcast i32 %reg130 to i32 ; <i32> [#uses=1]
- %reg130-idxcast-offset = add i32 %reg130-idxcast, 1073741823 ; <i32> [#uses=1]
- %reg130-idxcast-offset.upgrd.2 = zext i32 %reg130-idxcast-offset to i64 ; <i64> [#uses=1]
- %reg118 = getelementptr i32* %set, i64 %reg130-idxcast-offset.upgrd.2 ; <i32*> [#uses=1]
- %reg119 = load i32* %reg118 ; <i32> [#uses=1]
- %cond233 = icmp eq i32 %reg119, 0 ; <i1> [#uses=1]
- br i1 %cond233, label %bb2, label %bb3
-
-bb3: ; preds = %bb2, %bb1
- store i32 %reg110, i32* %set
- %cast126 = zext i32 %reg110 to i64 ; <i64> [#uses=1]
- %reg127 = add i64 %cast126, -1 ; <i64> [#uses=1]
- %reg128 = lshr i64 %reg127, 63 ; <i64> [#uses=1]
- %cast120 = trunc i64 %reg128 to i32 ; <i32> [#uses=1]
- ret i32 %cast120
-}
-
diff --git a/release_23/test/Transforms/ADCE/2002-07-17-AssertionFailure.ll b/release_23/test/Transforms/ADCE/2002-07-17-AssertionFailure.ll
deleted file mode 100644
index fb4fe4a8d279..000000000000
--- a/release_23/test/Transforms/ADCE/2002-07-17-AssertionFailure.ll
+++ /dev/null
@@ -1,13 +0,0 @@
-; This testcase fails because ADCE does not correctly delete the chain of
-; three instructions that are dead here. Ironically there were a dead basic
-; block in this function, it would work fine, but that would be the part we
-; have to fix now, wouldn't it....
-;
-; RUN: llvm-as < %s | opt -adce
-
-define void @foo(i8* %reg5481) {
- %cast611 = bitcast i8* %reg5481 to i8** ; <i8**> [#uses=1]
- %reg162 = load i8** %cast611 ; <i8*> [#uses=1]
- ptrtoint i8* %reg162 to i32 ; <i32>:1 [#uses=0]
- ret void
-}
diff --git a/release_23/test/Transforms/ADCE/2002-07-17-PHIAssertion.ll b/release_23/test/Transforms/ADCE/2002-07-17-PHIAssertion.ll
deleted file mode 100644
index 42a7e4dcde4a..000000000000
--- a/release_23/test/Transforms/ADCE/2002-07-17-PHIAssertion.ll
+++ /dev/null
@@ -1,48 +0,0 @@
-; This testcase was extracted from the gzip SPEC benchmark
-;
-; RUN: llvm-as < %s | opt -adce
-
-@bk = external global i32 ; <i32*> [#uses=2]
-@hufts = external global i32 ; <i32*> [#uses=1]
-
-define i32 @inflate() {
-bb0:
- br label %bb2
-
-bb2: ; preds = %bb6, %bb0
- %reg128 = phi i32 [ %reg130, %bb6 ], [ 0, %bb0 ] ; <i32> [#uses=2]
- br i1 true, label %bb4, label %bb3
-
-bb3: ; preds = %bb2
- br label %UnifiedExitNode
-
-bb4: ; preds = %bb2
- %reg117 = load i32* @hufts ; <i32> [#uses=2]
- %cond241 = icmp ule i32 %reg117, %reg128 ; <i1> [#uses=1]
- br i1 %cond241, label %bb6, label %bb5
-
-bb5: ; preds = %bb4
- br label %bb6
-
-bb6: ; preds = %bb5, %bb4
- %reg130 = phi i32 [ %reg117, %bb5 ], [ %reg128, %bb4 ] ; <i32> [#uses=1]
- br i1 false, label %bb2, label %bb7
-
-bb7: ; preds = %bb6
- %reg126 = load i32* @bk ; <i32> [#uses=1]
- %cond247 = icmp ule i32 %reg126, 7 ; <i1> [#uses=1]
- br i1 %cond247, label %bb9, label %bb8
-
-bb8: ; preds = %bb8, %bb7
- %reg119 = load i32* @bk ; <i32> [#uses=1]
- %cond256 = icmp ugt i32 %reg119, 7 ; <i1> [#uses=1]
- br i1 %cond256, label %bb8, label %bb9
-
-bb9: ; preds = %bb8, %bb7
- br label %UnifiedExitNode
-
-UnifiedExitNode: ; preds = %bb9, %bb3
- %UnifiedRetVal = phi i32 [ 7, %bb3 ], [ 0, %bb9 ] ; <i32> [#uses=1]
- ret i32 %UnifiedRetVal
-}
-
diff --git a/release_23/test/Transforms/ADCE/2002-07-29-Segfault.ll b/release_23/test/Transforms/ADCE/2002-07-29-Segfault.ll
deleted file mode 100644
index 1c65b3b54434..000000000000
--- a/release_23/test/Transforms/ADCE/2002-07-29-Segfault.ll
+++ /dev/null
@@ -1,9 +0,0 @@
-; RUN: llvm-as < %s | opt -adce
-
-define void @test() {
- br label %BB3
-
-BB3: ; preds = %BB3, %0
- br label %BB3
-}
-
diff --git a/release_23/test/Transforms/ADCE/2003-01-22-PredecessorProblem.ll b/release_23/test/Transforms/ADCE/2003-01-22-PredecessorProblem.ll
deleted file mode 100644
index 4ec900560705..000000000000
--- a/release_23/test/Transforms/ADCE/2003-01-22-PredecessorProblem.ll
+++ /dev/null
@@ -1,25 +0,0 @@
-; Testcase reduced from 197.parser by bugpoint
-; RUN: llvm-as < %s | opt -adce
-
-define void @conjunction_prune() {
-; <label>:0
- br label %bb19
-
-bb19: ; preds = %bb23, %bb22, %0
- %reg205 = phi i8* [ null, %bb22 ], [ null, %bb23 ], [ null, %0 ] ; <i8*> [#uses=1]
- br i1 false, label %bb21, label %bb22
-
-bb21: ; preds = %bb19
- %cast455 = bitcast i8* %reg205 to i8** ; <i8**> [#uses=0]
- br label %bb22
-
-bb22: ; preds = %bb21, %bb19
- br i1 false, label %bb19, label %bb23
-
-bb23: ; preds = %bb22
- br i1 false, label %bb19, label %bb28
-
-bb28: ; preds = %bb23
- ret void
-}
-
diff --git a/release_23/test/Transforms/ADCE/2003-04-25-PHIPostDominateProblem.ll b/release_23/test/Transforms/ADCE/2003-04-25-PHIPostDominateProblem.ll
deleted file mode 100644
index 603b14b537d5..000000000000
--- a/release_23/test/Transforms/ADCE/2003-04-25-PHIPostDominateProblem.ll
+++ /dev/null
@@ -1,35 +0,0 @@
-; THis testcase caused an assertion failure because a PHI node did not have
-; entries for it's postdominator. But I think this can only happen when the
-; PHI node is dead, so we just avoid patching up dead PHI nodes.
-
-; RUN: llvm-as < %s | opt -adce
-
-target datalayout = "e-p:32:32"
-
-define void @dead_test8() {
-entry:
- br label %loopentry
-
-loopentry: ; preds = %endif, %entry
- %k.1 = phi i32 [ %k.0, %endif ], [ 0, %entry ] ; <i32> [#uses=1]
- br i1 false, label %no_exit, label %return
-
-no_exit: ; preds = %loopentry
- br i1 false, label %then, label %else
-
-then: ; preds = %no_exit
- br label %endif
-
-else: ; preds = %no_exit
- %dec = add i32 %k.1, -1 ; <i32> [#uses=1]
- br label %endif
-
-endif: ; preds = %else, %then
- %k.0 = phi i32 [ %dec, %else ], [ 0, %then ] ; <i32> [#uses=1]
- store i32 2, i32* null
- br label %loopentry
-
-return: ; preds = %loopentry
- ret void
-}
-
diff --git a/release_23/test/Transforms/ADCE/2003-06-11-InvalidCFG.ll b/release_23/test/Transforms/ADCE/2003-06-11-InvalidCFG.ll
deleted file mode 100644
index a9657a7a37d1..000000000000
--- a/release_23/test/Transforms/ADCE/2003-06-11-InvalidCFG.ll
+++ /dev/null
@@ -1,28 +0,0 @@
-; RUN: llvm-as < %s | opt -adce -disable-output
-
-@G = external global i32* ; <i32**> [#uses=1]
-
-declare void @Fn(i32*)
-
-define i32 @main(i32 %argc.1, i8** %argv.1) {
-entry:
- br label %endif.42
-
-endif.42: ; preds = %shortcirc_done.12, %then.66, %endif.42, %entry
- br i1 false, label %endif.65, label %endif.42
-
-then.66: ; preds = %shortcirc_done.12
- call void @Fn( i32* %tmp.2846 )
- br label %endif.42
-
-endif.65: ; preds = %endif.42
- %tmp.2846 = load i32** @G ; <i32*> [#uses=1]
- br i1 false, label %shortcirc_next.12, label %shortcirc_done.12
-
-shortcirc_next.12: ; preds = %endif.65
- br label %shortcirc_done.12
-
-shortcirc_done.12: ; preds = %shortcirc_next.12, %endif.65
- br i1 false, label %then.66, label %endif.42
-}
-
diff --git a/release_23/test/Transforms/ADCE/2003-06-24-BadSuccessor.ll b/release_23/test/Transforms/ADCE/2003-06-24-BadSuccessor.ll
deleted file mode 100644
index e5dd0cc6d9a7..000000000000
--- a/release_23/test/Transforms/ADCE/2003-06-24-BadSuccessor.ll
+++ /dev/null
@@ -1,91 +0,0 @@
-; RUN: llvm-as < %s | opt -adce -disable-output
-target datalayout = "e-p:32:32"
- %struct..CppObjTypeDesc = type { i32, i16, i16 }
- %struct..TypeToken = type { i32, i16, i16 }
-
-define i32 @C_ReFaxToDb() {
-entry:
- br i1 false, label %endif.0, label %then.0
-
-then.0: ; preds = %entry
- ret i32 0
-
-endif.0: ; preds = %entry
- br i1 false, label %then.11, label %then.4
-
-then.4: ; preds = %endif.0
- ret i32 0
-
-then.11: ; preds = %endif.0
- br i1 false, label %loopentry.0, label %else.2
-
-loopentry.0: ; preds = %loopentry.1, %endif.14, %then.11
- br i1 false, label %endif.14, label %loopexit.0
-
-endif.14: ; preds = %loopentry.0
- br i1 false, label %loopentry.1, label %loopentry.0
-
-loopentry.1: ; preds = %then.53, %endif.14
- %SubArrays.10 = phi i32* [ %SubArrays.8, %then.53 ], [ null, %endif.14 ] ; <i32*> [#uses=3]
- br i1 false, label %no_exit.1, label %loopentry.0
-
-no_exit.1: ; preds = %loopentry.1
- switch i32 0, label %label.17 [
- i32 2, label %label.11
- i32 19, label %label.10
- ]
-
-label.10: ; preds = %no_exit.1
- br i1 false, label %then.43, label %endif.43
-
-then.43: ; preds = %label.10
- br i1 false, label %then.44, label %endif.44
-
-then.44: ; preds = %then.43
- br i1 false, label %shortcirc_next.4, label %endif.45
-
-shortcirc_next.4: ; preds = %then.44
- br i1 false, label %no_exit.2, label %loopexit.2
-
-no_exit.2: ; preds = %shortcirc_next.4
- %tmp.897 = getelementptr i32* %SubArrays.10, i64 0 ; <i32*> [#uses=1]
- %tmp.899 = load i32* %tmp.897 ; <i32> [#uses=1]
- store i32 %tmp.899, i32* null
- ret i32 0
-
-loopexit.2: ; preds = %shortcirc_next.4
- ret i32 0
-
-endif.45: ; preds = %then.44
- ret i32 0
-
-endif.44: ; preds = %then.43
- ret i32 0
-
-endif.43: ; preds = %label.10
- ret i32 0
-
-label.11: ; preds = %no_exit.1
- ret i32 0
-
-label.17: ; preds = %no_exit.1
- br i1 false, label %then.53, label %shortcirc_next.7
-
-shortcirc_next.7: ; preds = %label.17
- br i1 false, label %then.53, label %shortcirc_next.8
-
-shortcirc_next.8: ; preds = %shortcirc_next.7
- ret i32 0
-
-then.53: ; preds = %shortcirc_next.7, %label.17
- %SubArrays.8 = phi i32* [ %SubArrays.10, %shortcirc_next.7 ], [ %SubArrays.10, %label.17 ] ; <i32*> [#uses=1]
- %tmp.1023 = load i32* null ; <i32> [#uses=1]
- switch i32 %tmp.1023, label %loopentry.1 [
- ]
-
-loopexit.0: ; preds = %loopentry.0
- ret i32 0
-
-else.2: ; preds = %then.11
- ret i32 0
-}
diff --git a/release_23/test/Transforms/ADCE/2003-06-24-BasicFunctionality.ll b/release_23/test/Transforms/ADCE/2003-06-24-BasicFunctionality.ll
deleted file mode 100644
index 9c6764d56235..000000000000
--- a/release_23/test/Transforms/ADCE/2003-06-24-BasicFunctionality.ll
+++ /dev/null
@@ -1,41 +0,0 @@
-; RUN: llvm-as < %s | opt -adce -simplifycfg | llvm-dis | not grep then:
-
-define void @dead_test8(i32* %data.1, i32 %idx.1) {
-entry:
- %tmp.1 = load i32* %data.1 ; <i32> [#uses=2]
- %tmp.41 = icmp sgt i32 %tmp.1, 0 ; <i1> [#uses=1]
- br i1 %tmp.41, label %no_exit.preheader, label %return
-
-no_exit.preheader: ; preds = %entry
- %tmp.11 = getelementptr i32* %data.1, i64 1 ; <i32*> [#uses=1]
- %tmp.22-idxcast = sext i32 %idx.1 to i64 ; <i64> [#uses=1]
- %tmp.28 = getelementptr i32* %data.1, i64 %tmp.22-idxcast ; <i32*> [#uses=1]
- br label %no_exit
-
-no_exit: ; preds = %endif, %no_exit.preheader
- %k.1 = phi i32 [ %k.0, %endif ], [ 0, %no_exit.preheader ] ; <i32> [#uses=3]
- %i.0 = phi i32 [ %inc.1, %endif ], [ 0, %no_exit.preheader ] ; <i32> [#uses=1]
- %tmp.12 = load i32* %tmp.11 ; <i32> [#uses=1]
- %tmp.14 = sub i32 0, %tmp.12 ; <i32> [#uses=1]
- %tmp.161 = icmp ne i32 %k.1, %tmp.14 ; <i1> [#uses=1]
- br i1 %tmp.161, label %then, label %else
-
-then: ; preds = %no_exit
- %inc.0 = add i32 %k.1, 1 ; <i32> [#uses=1]
- br label %endif
-
-else: ; preds = %no_exit
- %dec = add i32 %k.1, -1 ; <i32> [#uses=1]
- br label %endif
-
-endif: ; preds = %else, %then
- %k.0 = phi i32 [ %dec, %else ], [ %inc.0, %then ] ; <i32> [#uses=1]
- store i32 2, i32* %tmp.28
- %inc.1 = add i32 %i.0, 1 ; <i32> [#uses=2]
- %tmp.4 = icmp slt i32 %inc.1, %tmp.1 ; <i1> [#uses=1]
- br i1 %tmp.4, label %no_exit, label %return
-
-return: ; preds = %endif, %entry
- ret void
-}
-
diff --git a/release_23/test/Transforms/ADCE/2003-09-10-UnwindInstFail.ll b/release_23/test/Transforms/ADCE/2003-09-10-UnwindInstFail.ll
deleted file mode 100644
index e6345c13eba3..000000000000
--- a/release_23/test/Transforms/ADCE/2003-09-10-UnwindInstFail.ll
+++ /dev/null
@@ -1,19 +0,0 @@
-; RUN: llvm-as < %s | opt -adce -disable-output
-
-define void @test() {
- br i1 false, label %then, label %endif
-
-then: ; preds = %0
- invoke void null( i8* null )
- to label %invoke_cont unwind label %invoke_catch
-
-invoke_catch: ; preds = %then
- unwind
-
-invoke_cont: ; preds = %then
- ret void
-
-endif: ; preds = %0
- ret void
-}
-
diff --git a/release_23/test/Transforms/ADCE/2003-09-15-InfLoopCrash.ll b/release_23/test/Transforms/ADCE/2003-09-15-InfLoopCrash.ll
deleted file mode 100644
index 37e077f21cb9..000000000000
--- a/release_23/test/Transforms/ADCE/2003-09-15-InfLoopCrash.ll
+++ /dev/null
@@ -1,9 +0,0 @@
-; RUN: llvm-as < %s | opt -adce -disable-output
-
-define i32 @main() {
- br label %loop
-
-loop: ; preds = %loop, %0
- br label %loop
-}
-
diff --git a/release_23/test/Transforms/ADCE/2003-11-16-MissingPostDominanceInfo.ll b/release_23/test/Transforms/ADCE/2003-11-16-MissingPostDominanceInfo.ll
deleted file mode 100644
index 6e9b17ed3131..000000000000
--- a/release_23/test/Transforms/ADCE/2003-11-16-MissingPostDominanceInfo.ll
+++ /dev/null
@@ -1,18 +0,0 @@
-; RUN: llvm-as < %s | opt -adce -simplifycfg | llvm-dis | grep call
-declare void @exit(i32)
-
-define i32 @main(i32 %argc) {
- %C = icmp eq i32 %argc, 1 ; <i1> [#uses=2]
- br i1 %C, label %Cond, label %Done
-
-Cond: ; preds = %0
- br i1 %C, label %Loop, label %Done
-
-Loop: ; preds = %Loop, %Cond
- call void @exit( i32 0 )
- br label %Loop
-
-Done: ; preds = %Cond, %0
- ret i32 1
-}
-
diff --git a/release_23/test/Transforms/ADCE/2003-12-19-MergeReturn.ll b/release_23/test/Transforms/ADCE/2003-12-19-MergeReturn.ll
deleted file mode 100644
index b2c294b1df00..000000000000
--- a/release_23/test/Transforms/ADCE/2003-12-19-MergeReturn.ll
+++ /dev/null
@@ -1,27 +0,0 @@
-; This testcase was failing because without merging the return blocks, ADCE
-; didn't know that it could get rid of the then.0 block.
-
-; RUN: llvm-as < %s | opt -adce | llvm-dis | not grep load
-
-
-define void @main(i32 %argc, i8** %argv) {
-entry:
- call void @__main( )
- %tmp.1 = icmp ule i32 %argc, 5 ; <i1> [#uses=1]
- br i1 %tmp.1, label %then.0, label %return
-
-then.0: ; preds = %entry
- %tmp.8 = load i8** %argv ; <i8*> [#uses=1]
- %tmp.10 = load i8* %tmp.8 ; <i8> [#uses=1]
- %tmp.11 = icmp eq i8 %tmp.10, 98 ; <i1> [#uses=1]
- br i1 %tmp.11, label %then.1, label %return
-
-then.1: ; preds = %then.0
- ret void
-
-return: ; preds = %then.0, %entry
- ret void
-}
-
-declare void @__main()
-
diff --git a/release_23/test/Transforms/ADCE/2004-05-04-UnreachableBlock.ll b/release_23/test/Transforms/ADCE/2004-05-04-UnreachableBlock.ll
deleted file mode 100644
index 87a1550e9d45..000000000000
--- a/release_23/test/Transforms/ADCE/2004-05-04-UnreachableBlock.ll
+++ /dev/null
@@ -1,16 +0,0 @@
-; RUN: llvm-as < %s | opt -adce -disable-output
-
-define void @test() {
-entry:
- br label %UnifiedReturnBlock
-
-UnifiedReturnBlock: ; preds = %invoke_catch.0, %entry
- ret void
-
-invoke_catch.0: ; No predecessors!
- br i1 false, label %UnifiedUnwindBlock, label %UnifiedReturnBlock
-
-UnifiedUnwindBlock: ; preds = %invoke_catch.0
- unwind
-}
-
diff --git a/release_23/test/Transforms/ADCE/2005-02-17-PHI-Invoke-Crash.ll b/release_23/test/Transforms/ADCE/2005-02-17-PHI-Invoke-Crash.ll
deleted file mode 100644
index 8ddbbbe2c50d..000000000000
--- a/release_23/test/Transforms/ADCE/2005-02-17-PHI-Invoke-Crash.ll
+++ /dev/null
@@ -1,45 +0,0 @@
-; RUN: llvm-as < %s | opt -adce -disable-output
-
-declare void @strlen()
-
-declare void @_ZN10QByteArray6resizeEi()
-
-declare void @q_atomic_decrement()
-
-define void @_ZNK10QByteArray13leftJustifiedEicb() {
-entry:
- invoke void @strlen( )
- to label %tmp.3.i.noexc unwind label %invoke_catch.0
-
-tmp.3.i.noexc: ; preds = %entry
- br i1 false, label %then.0, label %else.0
-
-invoke_catch.0: ; preds = %entry
- invoke void @q_atomic_decrement( )
- to label %tmp.1.i.i183.noexc unwind label %terminate
-
-tmp.1.i.i183.noexc: ; preds = %invoke_catch.0
- unwind
-
-then.0: ; preds = %tmp.3.i.noexc
- invoke void @_ZN10QByteArray6resizeEi( )
- to label %invoke_cont.1 unwind label %invoke_catch.1
-
-invoke_catch.1: ; preds = %then.0
- invoke void @q_atomic_decrement( )
- to label %tmp.1.i.i162.noexc unwind label %terminate
-
-tmp.1.i.i162.noexc: ; preds = %invoke_catch.1
- ret void
-
-invoke_cont.1: ; preds = %then.0
- ret void
-
-else.0: ; preds = %tmp.3.i.noexc
- ret void
-
-terminate: ; preds = %invoke_catch.1, %invoke_catch.0
- %dbg.0.1 = phi { }* [ null, %invoke_catch.1 ], [ null, %invoke_catch.0 ] ; <{ }*> [#uses=0]
- unreachable
-}
-
diff --git a/release_23/test/Transforms/ADCE/adcetest.ll b/release_23/test/Transforms/ADCE/adcetest.ll
deleted file mode 100644
index cb14eea9b3e1..000000000000
--- a/release_23/test/Transforms/ADCE/adcetest.ll
+++ /dev/null
@@ -1,36 +0,0 @@
-; This is the test case taken from Appel's book that illustrates a hard case
-; that SCCP gets right, and when followed by ADCE, is completely eliminated
-;
-; RUN: llvm-as < %s | opt -sccp -adce -simplifycfg | llvm-dis | not grep br
-
-define i32 @"test function"(i32 %i0, i32 %j0) {
-BB1:
- br label %BB2
-
-BB2: ; preds = %BB7, %BB1
- %j2 = phi i32 [ %j4, %BB7 ], [ 1, %BB1 ] ; <i32> [#uses=2]
- %k2 = phi i32 [ %k4, %BB7 ], [ 0, %BB1 ] ; <i32> [#uses=4]
- %kcond = icmp slt i32 %k2, 100 ; <i1> [#uses=1]
- br i1 %kcond, label %BB3, label %BB4
-
-BB3: ; preds = %BB2
- %jcond = icmp slt i32 %j2, 20 ; <i1> [#uses=1]
- br i1 %jcond, label %BB5, label %BB6
-
-BB4: ; preds = %BB2
- ret i32 %j2
-
-BB5: ; preds = %BB3
- %k3 = add i32 %k2, 1 ; <i32> [#uses=1]
- br label %BB7
-
-BB6: ; preds = %BB3
- %k5 = add i32 %k2, 1 ; <i32> [#uses=1]
- br label %BB7
-
-BB7: ; preds = %BB6, %BB5
- %j4 = phi i32 [ 1, %BB5 ], [ %k2, %BB6 ] ; <i32> [#uses=1]
- %k4 = phi i32 [ %k3, %BB5 ], [ %k5, %BB6 ] ; <i32> [#uses=1]
- br label %BB2
-}
-
diff --git a/release_23/test/Transforms/ADCE/basictest.ll b/release_23/test/Transforms/ADCE/basictest.ll
deleted file mode 100644
index 22ff0f753bec..000000000000
--- a/release_23/test/Transforms/ADCE/basictest.ll
+++ /dev/null
@@ -1,19 +0,0 @@
-; RUN: llvm-as < %s | opt -adce -simplifycfg | llvm-dis
-
-define i32 @Test(i32 %A, i32 %B) {
-BB1:
- br label %BB4
-
-BB2: ; No predecessors!
- br label %BB3
-
-BB3: ; preds = %BB4, %BB2
- %ret = phi i32 [ %X, %BB4 ], [ %B, %BB2 ] ; <i32> [#uses=1]
- ret i32 %ret
-
-BB4: ; preds = %BB1
- %X = phi i32 [ %A, %BB1 ] ; <i32> [#uses=1]
- br label %BB3
-}
-
-
diff --git a/release_23/test/Transforms/ADCE/basictest1.ll b/release_23/test/Transforms/ADCE/basictest1.ll
deleted file mode 100644
index 29f40deb9c7f..000000000000
--- a/release_23/test/Transforms/ADCE/basictest1.ll
+++ /dev/null
@@ -1,97 +0,0 @@
-; RUN: llvm-as < %s | opt -adce -simplifycfg | llvm-dis
-%FILE = type { i32, i8*, i8*, i8, i8, i32, i32, i32 }
- %spec_fd_t = type { i32, i32, i32, i8* }
-@__iob = external global [20 x %FILE] ; <[20 x %FILE]*> [#uses=1]
-@dbglvl = global i32 4 ; <i32*> [#uses=3]
-@spec_fd = external global [3 x %spec_fd_t] ; <[3 x %spec_fd_t]*> [#uses=4]
-@.LC9 = internal global [34 x i8] c"spec_read: fd=%d, > MAX_SPEC_FD!\0A\00" ; <[34 x i8]*> [#uses=1]
-@.LC10 = internal global [4 x i8] c"EOF\00" ; <[4 x i8]*> [#uses=1]
-@.LC11 = internal global [4 x i8] c"%d\0A\00" ; <[4 x i8]*> [#uses=1]
-@.LC12 = internal global [17 x i8] c"spec_getc: %d = \00" ; <[17 x i8]*> [#uses=1]
-
-declare i32 @fprintf(%FILE*, i8*, ...)
-
-declare void @exit(i32)
-
-declare i32 @remove(i8*)
-
-declare i32 @fputc(i32, %FILE*)
-
-declare i32 @fwrite(i8*, i32, i32, %FILE*)
-
-declare void @perror(i8*)
-
-define i32 @spec_getc(i32 %fd) {
- %reg109 = load i32* @dbglvl ; <i32> [#uses=1]
- %cond266 = icmp sle i32 %reg109, 4 ; <i1> [#uses=1]
- br i1 %cond266, label %bb3, label %bb2
-
-bb2: ; preds = %0
- %cast273 = getelementptr [17 x i8]* @.LC12, i64 0, i64 0 ; <i8*> [#uses=0]
- br label %bb3
-
-bb3: ; preds = %bb2, %0
- %cond267 = icmp sle i32 %fd, 3 ; <i1> [#uses=1]
- br i1 %cond267, label %bb5, label %bb4
-
-bb4: ; preds = %bb3
- %reg111 = getelementptr [20 x %FILE]* @__iob, i64 0, i64 1, i32 3 ; <i8*> [#uses=1]
- %cast274 = getelementptr [34 x i8]* @.LC9, i64 0, i64 0 ; <i8*> [#uses=0]
- %cast282 = bitcast i8* %reg111 to %FILE* ; <%FILE*> [#uses=0]
- call void @exit( i32 1 )
- br label %UnifiedExitNode
-
-bb5: ; preds = %bb3
- %reg107-idxcast1 = sext i32 %fd to i64 ; <i64> [#uses=2]
- %reg107-idxcast2 = sext i32 %fd to i64 ; <i64> [#uses=1]
- %reg1311 = getelementptr [3 x %spec_fd_t]* @spec_fd, i64 0, i64 %reg107-idxcast2 ; <%spec_fd_t*> [#uses=1]
- %idx1 = getelementptr [3 x %spec_fd_t]* @spec_fd, i64 0, i64 %reg107-idxcast1, i32 2 ; <i32*> [#uses=1]
- %reg1321 = load i32* %idx1 ; <i32> [#uses=3]
- %idx2 = getelementptr %spec_fd_t* %reg1311, i64 0, i32 1 ; <i32*> [#uses=1]
- %reg1331 = load i32* %idx2 ; <i32> [#uses=1]
- %cond270 = icmp slt i32 %reg1321, %reg1331 ; <i1> [#uses=1]
- br i1 %cond270, label %bb9, label %bb6
-
-bb6: ; preds = %bb5
- %reg134 = load i32* @dbglvl ; <i32> [#uses=1]
- %cond271 = icmp sle i32 %reg134, 4 ; <i1> [#uses=1]
- br i1 %cond271, label %bb8, label %bb7
-
-bb7: ; preds = %bb6
- %cast277 = getelementptr [4 x i8]* @.LC10, i64 0, i64 0 ; <i8*> [#uses=0]
- br label %bb8
-
-bb8: ; preds = %bb7, %bb6
- br label %UnifiedExitNode
-
-bb9: ; preds = %bb5
- %reg107-idxcast3 = sext i32 %fd to i64 ; <i64> [#uses=1]
- %idx3 = getelementptr [3 x %spec_fd_t]* @spec_fd, i64 0, i64 %reg107-idxcast3, i32 3 ; <i8**> [#uses=1]
- %reg1601 = load i8** %idx3 ; <i8*> [#uses=1]
- %reg132-idxcast1 = sext i32 %reg1321 to i64 ; <i64> [#uses=1]
- %idx4 = getelementptr i8* %reg1601, i64 %reg132-idxcast1 ; <i8*> [#uses=1]
- %reg1621 = load i8* %idx4 ; <i8> [#uses=2]
- %cast108 = zext i8 %reg1621 to i64 ; <i64> [#uses=0]
- %reg157 = add i32 %reg1321, 1 ; <i32> [#uses=1]
- %idx5 = getelementptr [3 x %spec_fd_t]* @spec_fd, i64 0, i64 %reg107-idxcast1, i32 2 ; <i32*> [#uses=1]
- store i32 %reg157, i32* %idx5
- %reg163 = load i32* @dbglvl ; <i32> [#uses=1]
- %cond272 = icmp sle i32 %reg163, 4 ; <i1> [#uses=1]
- br i1 %cond272, label %bb11, label %bb10
-
-bb10: ; preds = %bb9
- %cast279 = getelementptr [4 x i8]* @.LC11, i64 0, i64 0 ; <i8*> [#uses=0]
- br label %bb11
-
-bb11: ; preds = %bb10, %bb9
- %cast291 = zext i8 %reg1621 to i32 ; <i32> [#uses=1]
- br label %UnifiedExitNode
-
-UnifiedExitNode: ; preds = %bb11, %bb8, %bb4
- %UnifiedRetVal = phi i32 [ 42, %bb4 ], [ -1, %bb8 ], [ %cast291, %bb11 ] ; <i32> [#uses=1]
- ret i32 %UnifiedRetVal
-}
-
-declare i32 @puts(i8*)
-
-declare i32 @printf(i8*, ...)
diff --git a/release_23/test/Transforms/ADCE/basictest2.ll b/release_23/test/Transforms/ADCE/basictest2.ll
deleted file mode 100644
index 120e23352dd0..000000000000
--- a/release_23/test/Transforms/ADCE/basictest2.ll
+++ /dev/null
@@ -1,97 +0,0 @@
-; RUN: llvm-as < %s | opt -adce -simplifycfg | llvm-dis
- %FILE = type { i32, i8*, i8*, i8, i8, i32, i32, i32 }
- %spec_fd_t = type { i32, i32, i32, i8* }
-@__iob = external global [20 x %FILE] ; <[20 x %FILE]*> [#uses=1]
-@dbglvl = global i32 4 ; <i32*> [#uses=3]
-@spec_fd = external global [3 x %spec_fd_t] ; <[3 x %spec_fd_t]*> [#uses=4]
-@.LC9 = internal global [34 x i8] c"spec_read: fd=%d, > MAX_SPEC_FD!\0A\00" ; <[34 x i8]*> [#uses=1]
-@.LC10 = internal global [4 x i8] c"EOF\00" ; <[4 x i8]*> [#uses=1]
-@.LC11 = internal global [4 x i8] c"%d\0A\00" ; <[4 x i8]*> [#uses=1]
-@.LC12 = internal global [17 x i8] c"spec_getc: %d = \00" ; <[17 x i8]*> [#uses=1]
-
-declare i32 @fprintf(%FILE*, i8*, ...)
-
-declare void @exit(i32)
-
-declare i32 @remove(i8*)
-
-declare i32 @fputc(i32, %FILE*)
-
-declare i32 @fwrite(i8*, i32, i32, %FILE*)
-
-declare void @perror(i8*)
-
-define i32 @spec_getc(i32 %fd) {
- %reg109 = load i32* @dbglvl ; <i32> [#uses=1]
- %cond266 = icmp sle i32 %reg109, 4 ; <i1> [#uses=1]
- br i1 %cond266, label %bb3, label %bb2
-
-bb2: ; preds = %0
- %cast273 = getelementptr [17 x i8]* @.LC12, i64 0, i64 0 ; <i8*> [#uses=0]
- br label %bb3
-
-bb3: ; preds = %bb2, %0
- %cond267 = icmp sle i32 %fd, 3 ; <i1> [#uses=0]
- br label %bb5
-
-bb4: ; No predecessors!
- %reg111 = getelementptr [20 x %FILE]* @__iob, i64 0, i64 1, i32 3 ; <i8*> [#uses=1]
- %cast274 = getelementptr [34 x i8]* @.LC9, i64 0, i64 0 ; <i8*> [#uses=0]
- %cast282 = bitcast i8* %reg111 to %FILE* ; <%FILE*> [#uses=0]
- call void @exit( i32 1 )
- br label %UnifiedExitNode
-
-bb5: ; preds = %bb3
- %reg107-idxcast1 = sext i32 %fd to i64 ; <i64> [#uses=2]
- %reg107-idxcast2 = sext i32 %fd to i64 ; <i64> [#uses=1]
- %reg1311 = getelementptr [3 x %spec_fd_t]* @spec_fd, i64 0, i64 %reg107-idxcast2 ; <%spec_fd_t*> [#uses=1]
- %idx1 = getelementptr [3 x %spec_fd_t]* @spec_fd, i64 0, i64 %reg107-idxcast1, i32 2 ; <i32*> [#uses=1]
- %reg1321 = load i32* %idx1 ; <i32> [#uses=3]
- %idx2 = getelementptr %spec_fd_t* %reg1311, i64 0, i32 1 ; <i32*> [#uses=1]
- %reg1331 = load i32* %idx2 ; <i32> [#uses=1]
- %cond270 = icmp slt i32 %reg1321, %reg1331 ; <i1> [#uses=1]
- br i1 %cond270, label %bb9, label %bb6
-
-bb6: ; preds = %bb5
- %reg134 = load i32* @dbglvl ; <i32> [#uses=1]
- %cond271 = icmp sle i32 %reg134, 4 ; <i1> [#uses=1]
- br i1 %cond271, label %bb8, label %bb7
-
-bb7: ; preds = %bb6
- %cast277 = getelementptr [4 x i8]* @.LC10, i64 0, i64 0 ; <i8*> [#uses=0]
- br label %bb8
-
-bb8: ; preds = %bb7, %bb6
- br label %UnifiedExitNode
-
-bb9: ; preds = %bb5
- %reg107-idxcast3 = sext i32 %fd to i64 ; <i64> [#uses=1]
- %idx3 = getelementptr [3 x %spec_fd_t]* @spec_fd, i64 0, i64 %reg107-idxcast3, i32 3 ; <i8**> [#uses=1]
- %reg1601 = load i8** %idx3 ; <i8*> [#uses=1]
- %reg132-idxcast1 = sext i32 %reg1321 to i64 ; <i64> [#uses=1]
- %idx4 = getelementptr i8* %reg1601, i64 %reg132-idxcast1 ; <i8*> [#uses=1]
- %reg1621 = load i8* %idx4 ; <i8> [#uses=2]
- %cast108 = zext i8 %reg1621 to i64 ; <i64> [#uses=0]
- %reg157 = add i32 %reg1321, 1 ; <i32> [#uses=1]
- %idx5 = getelementptr [3 x %spec_fd_t]* @spec_fd, i64 0, i64 %reg107-idxcast1, i32 2 ; <i32*> [#uses=1]
- store i32 %reg157, i32* %idx5
- %reg163 = load i32* @dbglvl ; <i32> [#uses=1]
- %cond272 = icmp sle i32 %reg163, 4 ; <i1> [#uses=1]
- br i1 %cond272, label %bb11, label %bb10
-
-bb10: ; preds = %bb9
- %cast279 = getelementptr [4 x i8]* @.LC11, i64 0, i64 0 ; <i8*> [#uses=0]
- br label %bb11
-
-bb11: ; preds = %bb10, %bb9
- %cast291 = zext i8 %reg1621 to i32 ; <i32> [#uses=1]
- br label %UnifiedExitNode
-
-UnifiedExitNode: ; preds = %bb11, %bb8, %bb4
- %UnifiedRetVal = phi i32 [ 42, %bb4 ], [ -1, %bb8 ], [ %cast291, %bb11 ] ; <i32> [#uses=1]
- ret i32 %UnifiedRetVal
-}
-
-declare i32 @puts(i8*)
-
-declare i32 @printf(i8*, ...)
diff --git a/release_23/test/Transforms/ADCE/dce_pure_call.ll b/release_23/test/Transforms/ADCE/dce_pure_call.ll
deleted file mode 100644
index a7414e027ead..000000000000
--- a/release_23/test/Transforms/ADCE/dce_pure_call.ll
+++ /dev/null
@@ -1,8 +0,0 @@
-; RUN: llvm-as < %s | opt -adce | llvm-dis | not grep call
-
-declare i32 @strlen(i8*) readonly
-
-define void @test() {
- call i32 @strlen( i8* null ) readonly ; <i32>:1 [#uses=0]
- ret void
-}
diff --git a/release_23/test/Transforms/ADCE/dce_pure_invoke.ll b/release_23/test/Transforms/ADCE/dce_pure_invoke.ll
deleted file mode 100644
index bd28df2b5e75..000000000000
--- a/release_23/test/Transforms/ADCE/dce_pure_invoke.ll
+++ /dev/null
@@ -1,15 +0,0 @@
-; RUN: llvm-as < %s | opt -adce | llvm-dis | grep null
-
-declare i32 @strlen(i8*) readnone
-
-define i32 @test() {
- ; invoke of pure function should not be deleted!
- invoke i32 @strlen( i8* null ) readnone
- to label %Cont unwind label %Other ; <i32>:1 [#uses=0]
-
-Cont: ; preds = %0
- ret i32 0
-
-Other: ; preds = %0
- ret i32 1
-}
diff --git a/release_23/test/Transforms/ADCE/dead-phi-edge.ll b/release_23/test/Transforms/ADCE/dead-phi-edge.ll
deleted file mode 100644
index 844560181a22..000000000000
--- a/release_23/test/Transforms/ADCE/dead-phi-edge.ll
+++ /dev/null
@@ -1,17 +0,0 @@
-; RUN: llvm-as < %s | opt -adce | llvm-dis | not grep call
-
-; The call is not live just because the PHI uses the call retval!
-
-define i32 @test(i32 %X) {
-; <label>:0
- br label %Done
-
-DeadBlock: ; No predecessors!
- %Y = call i32 @test( i32 0 ) ; <i32> [#uses=1]
- br label %Done
-
-Done: ; preds = %DeadBlock, %0
- %Z = phi i32 [ %X, %0 ], [ %Y, %DeadBlock ] ; <i32> [#uses=1]
- ret i32 %Z
-}
-
diff --git a/release_23/test/Transforms/ADCE/dg.exp b/release_23/test/Transforms/ADCE/dg.exp
deleted file mode 100644
index 879685ca879d..000000000000
--- a/release_23/test/Transforms/ADCE/dg.exp
+++ /dev/null
@@ -1,3 +0,0 @@
-load_lib llvm.exp
-
-RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
diff --git a/release_23/test/Transforms/ADCE/unreachable-function.ll b/release_23/test/Transforms/ADCE/unreachable-function.ll
deleted file mode 100644
index 86c55f591688..000000000000
--- a/release_23/test/Transforms/ADCE/unreachable-function.ll
+++ /dev/null
@@ -1,5 +0,0 @@
-; RUN: llvm-as < %s | opt -adce -disable-output
-
-define void @test() {
- unreachable
-}
diff --git a/release_23/test/Transforms/ArgumentPromotion/2008-02-01-ReturnAttrs.ll b/release_23/test/Transforms/ArgumentPromotion/2008-02-01-ReturnAttrs.ll
deleted file mode 100644
index 67c061fc1ca6..000000000000
--- a/release_23/test/Transforms/ArgumentPromotion/2008-02-01-ReturnAttrs.ll
+++ /dev/null
@@ -1,15 +0,0 @@
-; RUN: llvm-as < %s | opt -argpromotion | llvm-dis | grep nounwind | count 2
-
-define internal i32 @deref(i32* %x) nounwind {
-entry:
- %tmp2 = load i32* %x, align 4 ; <i32> [#uses=1]
- ret i32 %tmp2
-}
-
-define i32 @f(i32 %x) {
-entry:
- %x_addr = alloca i32 ; <i32*> [#uses=2]
- store i32 %x, i32* %x_addr, align 4
- %tmp1 = call i32 @deref( i32* %x_addr ) nounwind ; <i32> [#uses=1]
- ret i32 %tmp1
-}
diff --git a/release_23/test/Transforms/ArgumentPromotion/aggregate-promote.ll b/release_23/test/Transforms/ArgumentPromotion/aggregate-promote.ll
deleted file mode 100644
index a74813f15fff..000000000000
--- a/release_23/test/Transforms/ArgumentPromotion/aggregate-promote.ll
+++ /dev/null
@@ -1,23 +0,0 @@
-; RUN: llvm-as < %s | opt -argpromotion -instcombine | not grep load
-
-%QuadTy = type { i32, i32, i32, i32 }
-@G = constant %QuadTy {
- i32 0,
- i32 0,
- i32 17,
- i32 25 } ; <%QuadTy*> [#uses=1]
-
-define internal i32 @test(%QuadTy* %P) {
- %A = getelementptr %QuadTy* %P, i64 0, i32 3 ; <i32*> [#uses=1]
- %B = getelementptr %QuadTy* %P, i64 0, i32 2 ; <i32*> [#uses=1]
- %a = load i32* %A ; <i32> [#uses=1]
- %b = load i32* %B ; <i32> [#uses=1]
- %V = add i32 %a, %b ; <i32> [#uses=1]
- ret i32 %V
-}
-
-define i32 @caller() {
- %V = call i32 @test( %QuadTy* @G ) ; <i32> [#uses=1]
- ret i32 %V
-}
-
diff --git a/release_23/test/Transforms/ArgumentPromotion/attrs.ll b/release_23/test/Transforms/ArgumentPromotion/attrs.ll
deleted file mode 100644
index 0fb38be1f0b2..000000000000
--- a/release_23/test/Transforms/ArgumentPromotion/attrs.ll
+++ /dev/null
@@ -1,25 +0,0 @@
-; RUN: llvm-as < %s | opt -argpromotion | llvm-dis | grep zeroext
-
- %struct.ss = type { i32, i64 }
-
-define internal void @f(%struct.ss* byval %b, i32* byval %X, i32 %i) nounwind {
-entry:
- %tmp = getelementptr %struct.ss* %b, i32 0, i32 0
- %tmp1 = load i32* %tmp, align 4
- %tmp2 = add i32 %tmp1, 1
- store i32 %tmp2, i32* %tmp, align 4
-
- store i32 0, i32* %X
- ret void
-}
-
-define i32 @test(i32* %X) {
-entry:
- %S = alloca %struct.ss ; <%struct.ss*> [#uses=4]
- %tmp1 = getelementptr %struct.ss* %S, i32 0, i32 0 ; <i32*> [#uses=1]
- store i32 1, i32* %tmp1, align 8
- %tmp4 = getelementptr %struct.ss* %S, i32 0, i32 1 ; <i64*> [#uses=1]
- store i64 2, i64* %tmp4, align 4
- call void @f( %struct.ss* byval %S, i32* byval %X, i32 zeroext 0)
- ret i32 0
-}
diff --git a/release_23/test/Transforms/ArgumentPromotion/basictest.ll b/release_23/test/Transforms/ArgumentPromotion/basictest.ll
deleted file mode 100644
index 99697f4c40d7..000000000000
--- a/release_23/test/Transforms/ArgumentPromotion/basictest.ll
+++ /dev/null
@@ -1,22 +0,0 @@
-; RUN: llvm-as < %s | opt -argpromotion -mem2reg | llvm-dis | not grep alloca
-define internal i32 @test(i32* %X, i32* %Y) {
- %A = load i32* %X ; <i32> [#uses=1]
- %B = load i32* %Y ; <i32> [#uses=1]
- %C = add i32 %A, %B ; <i32> [#uses=1]
- ret i32 %C
-}
-
-define internal i32 @caller(i32* %B) {
- %A = alloca i32 ; <i32*> [#uses=2]
- store i32 1, i32* %A
- %C = call i32 @test( i32* %A, i32* %B ) ; <i32> [#uses=1]
- ret i32 %C
-}
-
-define i32 @callercaller() {
- %B = alloca i32 ; <i32*> [#uses=2]
- store i32 2, i32* %B
- %X = call i32 @caller( i32* %B ) ; <i32> [#uses=1]
- ret i32 %X
-}
-
diff --git a/release_23/test/Transforms/ArgumentPromotion/byval-2.ll b/release_23/test/Transforms/ArgumentPromotion/byval-2.ll
deleted file mode 100644
index d6253574ca00..000000000000
--- a/release_23/test/Transforms/ArgumentPromotion/byval-2.ll
+++ /dev/null
@@ -1,26 +0,0 @@
-; RUN: llvm-as < %s | opt -argpromotion | llvm-dis | grep -F {i32* byval} | count 2
-; Argpromote + scalarrepl should change this to passing the two integers by value.
-
- %struct.ss = type { i32, i64 }
-
-define internal void @f(%struct.ss* byval %b, i32* byval %X) nounwind {
-entry:
- %tmp = getelementptr %struct.ss* %b, i32 0, i32 0
- %tmp1 = load i32* %tmp, align 4
- %tmp2 = add i32 %tmp1, 1
- store i32 %tmp2, i32* %tmp, align 4
-
- store i32 0, i32* %X
- ret void
-}
-
-define i32 @test(i32* %X) {
-entry:
- %S = alloca %struct.ss ; <%struct.ss*> [#uses=4]
- %tmp1 = getelementptr %struct.ss* %S, i32 0, i32 0 ; <i32*> [#uses=1]
- store i32 1, i32* %tmp1, align 8
- %tmp4 = getelementptr %struct.ss* %S, i32 0, i32 1 ; <i64*> [#uses=1]
- store i64 2, i64* %tmp4, align 4
- call void @f( %struct.ss* byval %S, i32* byval %X)
- ret i32 0
-}
diff --git a/release_23/test/Transforms/ArgumentPromotion/byval.ll b/release_23/test/Transforms/ArgumentPromotion/byval.ll
deleted file mode 100644
index 3a3458f3d941..000000000000
--- a/release_23/test/Transforms/ArgumentPromotion/byval.ll
+++ /dev/null
@@ -1,24 +0,0 @@
-; RUN: llvm-as < %s | opt -argpromotion -scalarrepl | llvm-dis | not grep load
-; Argpromote + scalarrepl should change this to passing the two integers by value.
-
- %struct.ss = type { i32, i64 }
-
-define internal void @f(%struct.ss* byval %b) nounwind {
-entry:
- %tmp = getelementptr %struct.ss* %b, i32 0, i32 0 ; <i32*> [#uses=2]
- %tmp1 = load i32* %tmp, align 4 ; <i32> [#uses=1]
- %tmp2 = add i32 %tmp1, 1 ; <i32> [#uses=1]
- store i32 %tmp2, i32* %tmp, align 4
- ret void
-}
-
-define i32 @main() nounwind {
-entry:
- %S = alloca %struct.ss ; <%struct.ss*> [#uses=4]
- %tmp1 = getelementptr %struct.ss* %S, i32 0, i32 0 ; <i32*> [#uses=1]
- store i32 1, i32* %tmp1, align 8
- %tmp4 = getelementptr %struct.ss* %S, i32 0, i32 1 ; <i64*> [#uses=1]
- store i64 2, i64* %tmp4, align 4
- call void @f( %struct.ss* byval %S ) nounwind
- ret i32 0
-}
diff --git a/release_23/test/Transforms/ArgumentPromotion/chained.ll b/release_23/test/Transforms/ArgumentPromotion/chained.ll
deleted file mode 100644
index de5f6e527063..000000000000
--- a/release_23/test/Transforms/ArgumentPromotion/chained.ll
+++ /dev/null
@@ -1,16 +0,0 @@
-; RUN: llvm-as < %s | opt -argpromotion -instcombine | llvm-dis | not grep load
-
-@G1 = constant i32 0 ; <i32*> [#uses=1]
-@G2 = constant i32* @G1 ; <i32**> [#uses=1]
-
-define internal i32 @test(i32** %X) {
- %Y = load i32** %X ; <i32*> [#uses=1]
- %X.upgrd.1 = load i32* %Y ; <i32> [#uses=1]
- ret i32 %X.upgrd.1
-}
-
-define i32 @caller(i32** %P) {
- %X = call i32 @test( i32** @G2 ) ; <i32> [#uses=1]
- ret i32 %X
-}
-
diff --git a/release_23/test/Transforms/ArgumentPromotion/control-flow.ll b/release_23/test/Transforms/ArgumentPromotion/control-flow.ll
deleted file mode 100644
index 76e8fd95030e..000000000000
--- a/release_23/test/Transforms/ArgumentPromotion/control-flow.ll
+++ /dev/null
@@ -1,19 +0,0 @@
-; RUN: llvm-as < %s | opt -argpromotion | llvm-dis | \
-; RUN: not grep {load i32\* null}
-
-define internal i32 @callee(i1 %C, i32* %P) {
- br i1 %C, label %T, label %F
-
-T: ; preds = %0
- ret i32 17
-
-F: ; preds = %0
- %X = load i32* %P ; <i32> [#uses=1]
- ret i32 %X
-}
-
-define i32 @foo() {
- %X = call i32 @callee( i1 true, i32* null ) ; <i32> [#uses=1]
- ret i32 %X
-}
-
diff --git a/release_23/test/Transforms/ArgumentPromotion/control-flow2.ll b/release_23/test/Transforms/ArgumentPromotion/control-flow2.ll
deleted file mode 100644
index 58750138567f..000000000000
--- a/release_23/test/Transforms/ArgumentPromotion/control-flow2.ll
+++ /dev/null
@@ -1,21 +0,0 @@
-; RUN: llvm-as < %s | opt -argpromotion | llvm-dis | \
-; RUN: grep {load i32\\* %A}
-
-define internal i32 @callee(i1 %C, i32* %P) {
- br i1 %C, label %T, label %F
-
-T: ; preds = %0
- ret i32 17
-
-F: ; preds = %0
- %X = load i32* %P ; <i32> [#uses=1]
- ret i32 %X
-}
-
-define i32 @foo() {
- %A = alloca i32 ; <i32*> [#uses=2]
- store i32 17, i32* %A
- %X = call i32 @callee( i1 false, i32* %A ) ; <i32> [#uses=1]
- ret i32 %X
-}
-
diff --git a/release_23/test/Transforms/ArgumentPromotion/dg.exp b/release_23/test/Transforms/ArgumentPromotion/dg.exp
deleted file mode 100644
index 879685ca879d..000000000000
--- a/release_23/test/Transforms/ArgumentPromotion/dg.exp
+++ /dev/null
@@ -1,3 +0,0 @@
-load_lib llvm.exp
-
-RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
diff --git a/release_23/test/Transforms/BlockPlacement/basictest.ll b/release_23/test/Transforms/BlockPlacement/basictest.ll
deleted file mode 100644
index c93d129ff2a1..000000000000
--- a/release_23/test/Transforms/BlockPlacement/basictest.ll
+++ /dev/null
@@ -1,15 +0,0 @@
-; RUN: llvm-as < %s | opt -block-placement -disable-output -print
-
-define i32 @test() {
- br i1 true, label %X, label %Y
-
-A: ; preds = %Y, %X
- ret i32 0
-
-X: ; preds = %0
- br label %A
-
-Y: ; preds = %0
- br label %A
-}
-
diff --git a/release_23/test/Transforms/BlockPlacement/dg.exp b/release_23/test/Transforms/BlockPlacement/dg.exp
deleted file mode 100644
index 879685ca879d..000000000000
--- a/release_23/test/Transforms/BlockPlacement/dg.exp
+++ /dev/null
@@ -1,3 +0,0 @@
-load_lib llvm.exp
-
-RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
diff --git a/release_23/test/Transforms/BranchFolding/2007-10-19-InlineAsmDirectives.ll b/release_23/test/Transforms/BranchFolding/2007-10-19-InlineAsmDirectives.ll
deleted file mode 100644
index 8afdcae50ae9..000000000000
--- a/release_23/test/Transforms/BranchFolding/2007-10-19-InlineAsmDirectives.ll
+++ /dev/null
@@ -1,18 +0,0 @@
-; RUN: llvm-as < %s | opt -std-compile-opts -o - | llc -o - | grep bork_directive | wc -l | grep 2
-
-;; We don't want branch folding to fold asm directives.
-
-define void @bork(i32 %param) {
-entry:
- %tmp = icmp eq i32 %param, 0
- br i1 %tmp, label %cond_true, label %cond_false
-
-cond_true:
- call void asm sideeffect ".bork_directive /* ${0:c}:${1:c} */", "i,i,~{dirflag},~{fpsr},~{flags}"( i32 37, i32 927 )
- ret void
-
-cond_false:
- call void asm sideeffect ".foo_directive ${0:c}:${1:c}", "i,i,~{dirflag},~{fpsr},~{flags}"( i32 37, i32 927 )
- call void asm sideeffect ".bork_directive /* ${0:c}:${1:c} */", "i,i,~{dirflag},~{fpsr},~{flags}"( i32 37, i32 927 )
- ret void
-}
diff --git a/release_23/test/Transforms/CodeExtractor/2004-03-13-LoopExtractorCrash.ll b/release_23/test/Transforms/CodeExtractor/2004-03-13-LoopExtractorCrash.ll
deleted file mode 100644
index aba35642e4dc..000000000000
--- a/release_23/test/Transforms/CodeExtractor/2004-03-13-LoopExtractorCrash.ll
+++ /dev/null
@@ -1,75 +0,0 @@
-; RUN: llvm-as < %s | opt -loop-extract -disable-output
-
-define void @solve() {
-entry:
- br label %loopentry.0
-
-loopentry.0: ; preds = %endif.0, %entry
- br i1 false, label %no_exit.0, label %loopexit.0
-
-no_exit.0: ; preds = %loopentry.0
- br i1 false, label %then.0, label %endif.0
-
-then.0: ; preds = %no_exit.0
- br i1 false, label %shortcirc_done, label %shortcirc_next
-
-shortcirc_next: ; preds = %then.0
- br label %shortcirc_done
-
-shortcirc_done: ; preds = %shortcirc_next, %then.0
- br i1 false, label %then.1, label %endif.1
-
-then.1: ; preds = %shortcirc_done
- br i1 false, label %cond_true, label %cond_false
-
-cond_true: ; preds = %then.1
- br label %cond_continue
-
-cond_false: ; preds = %then.1
- br label %cond_continue
-
-cond_continue: ; preds = %cond_false, %cond_true
- br label %return
-
-after_ret.0: ; No predecessors!
- br label %endif.1
-
-endif.1: ; preds = %after_ret.0, %shortcirc_done
- br label %endif.0
-
-endif.0: ; preds = %endif.1, %no_exit.0
- br label %loopentry.0
-
-loopexit.0: ; preds = %loopentry.0
- br i1 false, label %then.2, label %endif.2
-
-then.2: ; preds = %loopexit.0
- br i1 false, label %then.3, label %endif.3
-
-then.3: ; preds = %then.2
- br label %return
-
-after_ret.1: ; No predecessors!
- br label %endif.3
-
-endif.3: ; preds = %after_ret.1, %then.2
- br label %endif.2
-
-endif.2: ; preds = %endif.3, %loopexit.0
- br label %loopentry.1
-
-loopentry.1: ; preds = %no_exit.1, %endif.2
- br i1 false, label %no_exit.1, label %loopexit.1
-
-no_exit.1: ; preds = %loopentry.1
- br label %loopentry.1
-
-loopexit.1: ; preds = %loopentry.1
- br label %return
-
-after_ret.2: ; No predecessors!
- br label %return
-
-return: ; preds = %after_ret.2, %loopexit.1, %then.3, %cond_continue
- ret void
-}
diff --git a/release_23/test/Transforms/CodeExtractor/2004-03-14-DominanceProblem.ll b/release_23/test/Transforms/CodeExtractor/2004-03-14-DominanceProblem.ll
deleted file mode 100644
index a41430d45d3c..000000000000
--- a/release_23/test/Transforms/CodeExtractor/2004-03-14-DominanceProblem.ll
+++ /dev/null
@@ -1,33 +0,0 @@
-; RUN: llvm-as < %s | opt -loop-extract -disable-output
-; This testcase is failing the loop extractor because not all exit blocks
-; are dominated by all of the live-outs.
-
-define i32 @ab(i32 %alpha, i32 %beta) {
-entry:
- br label %loopentry.1.preheader
-
-loopentry.1.preheader: ; preds = %entry
- br label %loopentry.1
-
-loopentry.1: ; preds = %no_exit.1, %loopentry.1.preheader
- br i1 false, label %no_exit.1, label %loopexit.0.loopexit1
-
-no_exit.1: ; preds = %loopentry.1
- %tmp.53 = load i32* null ; <i32> [#uses=1]
- br i1 false, label %shortcirc_next.2, label %loopentry.1
-
-shortcirc_next.2: ; preds = %no_exit.1
- %tmp.563 = call i32 @wins( i32 0, i32 %tmp.53, i32 3 ) ; <i32> [#uses=0]
- ret i32 0
-
-loopexit.0.loopexit1: ; preds = %loopentry.1
- br label %loopexit.0
-
-loopexit.0: ; preds = %loopexit.0.loopexit1
- ret i32 0
-}
-
-declare i32 @wins(i32, i32, i32)
-
-declare i16 @ab_code()
-
diff --git a/release_23/test/Transforms/CodeExtractor/2004-03-14-NoSwitchSupport.ll b/release_23/test/Transforms/CodeExtractor/2004-03-14-NoSwitchSupport.ll
deleted file mode 100644
index ded821b702f5..000000000000
--- a/release_23/test/Transforms/CodeExtractor/2004-03-14-NoSwitchSupport.ll
+++ /dev/null
@@ -1,28 +0,0 @@
-; RUN: llvm-as < %s | opt -loop-extract-single -disable-output
-
-define void @ab() {
-entry:
- br label %codeReplTail
-
-then.1: ; preds = %codeReplTail
- br label %loopentry.1
-
-loopentry.1: ; preds = %no_exit.1, %then.1
- br i1 false, label %no_exit.1, label %loopexit.0.loopexit1
-
-no_exit.1: ; preds = %loopentry.1
- br label %loopentry.1
-
-loopexit.0.loopexit: ; preds = %codeReplTail
- ret void
-
-loopexit.0.loopexit1: ; preds = %loopentry.1
- ret void
-
-codeReplTail: ; preds = %codeReplTail, %entry
- switch i16 0, label %codeReplTail [
- i16 0, label %loopexit.0.loopexit
- i16 1, label %then.1
- ]
-}
-
diff --git a/release_23/test/Transforms/CodeExtractor/2004-03-17-MissedLiveIns.ll b/release_23/test/Transforms/CodeExtractor/2004-03-17-MissedLiveIns.ll
deleted file mode 100644
index e2030e2db987..000000000000
--- a/release_23/test/Transforms/CodeExtractor/2004-03-17-MissedLiveIns.ll
+++ /dev/null
@@ -1,47 +0,0 @@
-; RUN: llvm-as < %s | opt -loop-extract -disable-output
-
-define void @sendMTFValues() {
-entry:
- br i1 false, label %then.1, label %endif.1
-
-then.1: ; preds = %entry
- br i1 false, label %loopentry.6.preheader, label %else.0
-
-endif.1: ; preds = %entry
- ret void
-
-else.0: ; preds = %then.1
- ret void
-
-loopentry.6.preheader: ; preds = %then.1
- br i1 false, label %endif.7.preheader, label %loopexit.9
-
-endif.7.preheader: ; preds = %loopentry.6.preheader
- %tmp.183 = add i32 0, -1 ; <i32> [#uses=1]
- br label %endif.7
-
-endif.7: ; preds = %loopexit.15, %endif.7.preheader
- br i1 false, label %loopentry.10, label %loopentry.12
-
-loopentry.10: ; preds = %endif.7
- br label %loopentry.12
-
-loopentry.12: ; preds = %loopentry.10, %endif.7
- %ge.2.1 = phi i32 [ 0, %loopentry.10 ], [ %tmp.183, %endif.7 ] ; <i32> [#uses=0]
- br i1 false, label %loopexit.14, label %no_exit.11
-
-no_exit.11: ; preds = %loopentry.12
- ret void
-
-loopexit.14: ; preds = %loopentry.12
- br i1 false, label %loopexit.15, label %no_exit.14
-
-no_exit.14: ; preds = %loopexit.14
- ret void
-
-loopexit.15: ; preds = %loopexit.14
- br i1 false, label %endif.7, label %loopexit.9
-
-loopexit.9: ; preds = %loopexit.15, %loopentry.6.preheader
- ret void
-}
diff --git a/release_23/test/Transforms/CodeExtractor/2004-03-17-OutputMismatch.ll b/release_23/test/Transforms/CodeExtractor/2004-03-17-OutputMismatch.ll
deleted file mode 100644
index 9f4b273a61ea..000000000000
--- a/release_23/test/Transforms/CodeExtractor/2004-03-17-OutputMismatch.ll
+++ /dev/null
@@ -1,20 +0,0 @@
-; RUN: llvm-as < %s | opt -loop-extract -disable-output
-
-%struct.node_t = type { double*, %struct.node_t*, %struct.node_t**, double**, double*, i32, i32 }
-%struct.table_t = type { [1 x %struct.node_t**], [1 x %struct.node_t**] }
-
-define void @make_tables() {
-entry:
- %tmp.0.i = malloc %struct.node_t ; <%struct.node_t*> [#uses=1]
- br i1 false, label %no_exit.i, label %loopexit.i
-
-no_exit.i: ; preds = %no_exit.i, %entry
- %prev_node.0.i.1 = phi %struct.node_t* [ %tmp.16.i, %no_exit.i ], [ %tmp.0.i, %entry ] ; <%struct.node_t*> [#uses=0]
- %tmp.16.i = malloc %struct.node_t ; <%struct.node_t*> [#uses=2]
- br i1 false, label %no_exit.i, label %loopexit.i
-
-loopexit.i: ; preds = %no_exit.i, %entry
- %cur_node.0.i.0 = phi %struct.node_t* [ null, %entry ], [ %tmp.16.i, %no_exit.i ] ; <%struct.node_t*> [#uses=0]
- ret void
-}
-
diff --git a/release_23/test/Transforms/CodeExtractor/2004-03-17-UpdatePHIsOutsideRegion.ll b/release_23/test/Transforms/CodeExtractor/2004-03-17-UpdatePHIsOutsideRegion.ll
deleted file mode 100644
index b1b0324bca50..000000000000
--- a/release_23/test/Transforms/CodeExtractor/2004-03-17-UpdatePHIsOutsideRegion.ll
+++ /dev/null
@@ -1,23 +0,0 @@
-; RUN: llvm-as < %s | opt -loop-extract -disable-output
-
-define void @maketree() {
-entry:
- br i1 false, label %no_exit.1, label %loopexit.0
-
-no_exit.1: ; preds = %endif, %expandbox.entry, %entry
- br i1 false, label %endif, label %expandbox.entry
-
-expandbox.entry: ; preds = %no_exit.1
- br i1 false, label %loopexit.1, label %no_exit.1
-
-endif: ; preds = %no_exit.1
- br i1 false, label %loopexit.1, label %no_exit.1
-
-loopexit.1: ; preds = %endif, %expandbox.entry
- %ic.i.0.0.4 = phi i32 [ 0, %expandbox.entry ], [ 0, %endif ] ; <i32> [#uses=0]
- ret void
-
-loopexit.0: ; preds = %entry
- ret void
-}
-
diff --git a/release_23/test/Transforms/CodeExtractor/2004-03-18-InvokeHandling.ll b/release_23/test/Transforms/CodeExtractor/2004-03-18-InvokeHandling.ll
deleted file mode 100644
index 48e5a768e0e5..000000000000
--- a/release_23/test/Transforms/CodeExtractor/2004-03-18-InvokeHandling.ll
+++ /dev/null
@@ -1,194 +0,0 @@
-; RUN: llvm-as < %s | opt -loop-extract -disable-output
-
-declare i32 @_IO_getc()
-
-declare void @__errno_location()
-
-define void @yylex() {
-entry:
- switch i32 0, label %label.126 [
- i32 0, label %return
- i32 61, label %combine
- i32 33, label %combine
- i32 94, label %combine
- i32 37, label %combine
- i32 47, label %combine
- i32 42, label %combine
- i32 62, label %combine
- i32 60, label %combine
- i32 58, label %combine
- i32 124, label %combine
- i32 38, label %combine
- i32 45, label %combine
- i32 43, label %combine
- i32 34, label %string_constant
- i32 39, label %char_constant
- i32 46, label %loopexit.2
- i32 57, label %loopexit.2
- i32 56, label %loopexit.2
- i32 55, label %loopexit.2
- i32 54, label %loopexit.2
- i32 53, label %loopexit.2
- i32 52, label %loopexit.2
- i32 51, label %loopexit.2
- i32 50, label %loopexit.2
- i32 49, label %loopexit.2
- i32 48, label %loopexit.2
- i32 95, label %letter
- i32 122, label %letter
- i32 121, label %letter
- i32 120, label %letter
- i32 119, label %letter
- i32 118, label %letter
- i32 117, label %letter
- i32 116, label %letter
- i32 115, label %letter
- i32 114, label %letter
- i32 113, label %letter
- i32 112, label %letter
- i32 111, label %letter
- i32 110, label %letter
- i32 109, label %letter
- i32 108, label %letter
- i32 107, label %letter
- i32 106, label %letter
- i32 105, label %letter
- i32 104, label %letter
- i32 103, label %letter
- i32 102, label %letter
- i32 101, label %letter
- i32 100, label %letter
- i32 99, label %letter
- i32 98, label %letter
- i32 97, label %letter
- i32 90, label %letter
- i32 89, label %letter
- i32 88, label %letter
- i32 87, label %letter
- i32 86, label %letter
- i32 85, label %letter
- i32 84, label %letter
- i32 83, label %letter
- i32 82, label %letter
- i32 81, label %letter
- i32 80, label %letter
- i32 79, label %letter
- i32 78, label %letter
- i32 77, label %letter
- i32 75, label %letter
- i32 74, label %letter
- i32 73, label %letter
- i32 72, label %letter
- i32 71, label %letter
- i32 70, label %letter
- i32 69, label %letter
- i32 68, label %letter
- i32 67, label %letter
- i32 66, label %letter
- i32 65, label %letter
- i32 64, label %label.13
- i32 76, label %label.12
- i32 36, label %label.11
- i32 -1, label %label.10
- ]
-
-label.10: ; preds = %entry
- ret void
-
-label.11: ; preds = %entry
- ret void
-
-label.12: ; preds = %entry
- ret void
-
-label.13: ; preds = %entry
- ret void
-
-letter: ; preds = %entry, %entry, %entry, %entry, %entry, %entry, %entry, %entry, %entry, %entry, %entry, %entry, %entry, %entry, %entry, %entry, %entry, %entry, %entry, %entry, %entry, %entry, %entry, %entry, %entry, %entry, %entry, %entry, %entry, %entry, %entry, %entry, %entry, %entry, %entry, %entry, %entry, %entry, %entry, %entry, %entry, %entry, %entry, %entry, %entry, %entry, %entry, %entry, %entry, %entry, %entry, %entry
- ret void
-
-loopexit.2: ; preds = %entry, %entry, %entry, %entry, %entry, %entry, %entry, %entry, %entry, %entry, %entry
- switch i32 0, label %shortcirc_next.14 [
- i32 48, label %then.20
- i32 46, label %endif.38
- ]
-
-then.20: ; preds = %loopexit.2
- switch i32 0, label %else.4 [
- i32 120, label %then.21
- i32 88, label %then.21
- ]
-
-then.21: ; preds = %then.20, %then.20
- ret void
-
-else.4: ; preds = %then.20
- ret void
-
-shortcirc_next.14: ; preds = %loopexit.2
- ret void
-
-endif.38: ; preds = %loopexit.2
- br i1 false, label %then.40, label %then.39
-
-then.39: ; preds = %endif.38
- ret void
-
-then.40: ; preds = %endif.38
- invoke void @__errno_location( )
- to label %switchexit.2 unwind label %LongJmpBlkPre
-
-loopentry.6: ; preds = %endif.52
- switch i32 0, label %switchexit.2 [
- i32 73, label %label.82
- i32 105, label %label.82
- i32 76, label %label.80
- i32 108, label %label.80
- i32 70, label %label.78
- i32 102, label %label.78
- ]
-
-label.78: ; preds = %loopentry.6, %loopentry.6
- ret void
-
-label.80: ; preds = %loopentry.6, %loopentry.6
- ret void
-
-label.82: ; preds = %loopentry.6, %loopentry.6
- %c.0.15.5 = phi i32 [ %tmp.79417, %loopentry.6 ], [ %tmp.79417, %loopentry.6 ] ; <i32> [#uses=0]
- ret void
-
-switchexit.2: ; preds = %loopentry.6, %then.40
- br i1 false, label %endif.51, label %loopexit.6
-
-endif.51: ; preds = %switchexit.2
- br i1 false, label %endif.52, label %then.52
-
-then.52: ; preds = %endif.51
- ret void
-
-endif.52: ; preds = %endif.51
- %tmp.79417 = invoke i32 @_IO_getc( )
- to label %loopentry.6 unwind label %LongJmpBlkPre ; <i32> [#uses=2]
-
-loopexit.6: ; preds = %switchexit.2
- ret void
-
-char_constant: ; preds = %entry
- ret void
-
-string_constant: ; preds = %entry
- ret void
-
-combine: ; preds = %entry, %entry, %entry, %entry, %entry, %entry, %entry, %entry, %entry, %entry, %entry, %entry, %entry
- ret void
-
-label.126: ; preds = %entry
- ret void
-
-return: ; preds = %entry
- ret void
-
-LongJmpBlkPre: ; preds = %endif.52, %then.40
- ret void
-}
diff --git a/release_23/test/Transforms/CodeExtractor/2004-08-12-BlockExtractPHI.ll b/release_23/test/Transforms/CodeExtractor/2004-08-12-BlockExtractPHI.ll
deleted file mode 100644
index 0ab5498b0491..000000000000
--- a/release_23/test/Transforms/CodeExtractor/2004-08-12-BlockExtractPHI.ll
+++ /dev/null
@@ -1,26 +0,0 @@
-; RUN: llvm-as < %s | opt -extract-blocks -disable-output
-
-define void @test1() {
-no_exit.0.i:
- br i1 false, label %yylex.entry, label %yylex.entry
-
-yylex.entry: ; preds = %no_exit.0.i, %no_exit.0.i
- %tmp.1027 = phi i32 [ 0, %no_exit.0.i ], [ 0, %no_exit.0.i ] ; <i32> [#uses=0]
- ret void
-}
-
-define void @test2() {
-no_exit.0.i:
- switch i32 0, label %yylex.entry [
- i32 0, label %yylex.entry
- i32 1, label %foo
- ]
-
-yylex.entry: ; preds = %no_exit.0.i, %no_exit.0.i
- %tmp.1027 = phi i32 [ 0, %no_exit.0.i ], [ 0, %no_exit.0.i ] ; <i32> [#uses=0]
- ret void
-
-foo: ; preds = %no_exit.0.i
- ret void
-}
-
diff --git a/release_23/test/Transforms/CodeExtractor/2004-11-12-InvokeExtract.ll b/release_23/test/Transforms/CodeExtractor/2004-11-12-InvokeExtract.ll
deleted file mode 100644
index 8cd609482668..000000000000
--- a/release_23/test/Transforms/CodeExtractor/2004-11-12-InvokeExtract.ll
+++ /dev/null
@@ -1,15 +0,0 @@
-; RUN: llvm-as < %s | opt -extract-blocks -disable-output
-define i32 @foo() {
- br label %EB
-
-EB: ; preds = %0
- %V = invoke i32 @foo( )
- to label %Cont unwind label %Unw ; <i32> [#uses=1]
-
-Cont: ; preds = %EB
- ret i32 %V
-
-Unw: ; preds = %EB
- unwind
-}
-
diff --git a/release_23/test/Transforms/CodeExtractor/dg.exp b/release_23/test/Transforms/CodeExtractor/dg.exp
deleted file mode 100644
index 879685ca879d..000000000000
--- a/release_23/test/Transforms/CodeExtractor/dg.exp
+++ /dev/null
@@ -1,3 +0,0 @@
-load_lib llvm.exp
-
-RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
diff --git a/release_23/test/Transforms/CondProp/2006-08-14-SingleEntryPhiCrash.ll b/release_23/test/Transforms/CondProp/2006-08-14-SingleEntryPhiCrash.ll
deleted file mode 100644
index fa083799b9f2..000000000000
--- a/release_23/test/Transforms/CondProp/2006-08-14-SingleEntryPhiCrash.ll
+++ /dev/null
@@ -1,462 +0,0 @@
-; RUN: llvm-as < %s | opt -condprop -disable-output
-; PR877
-target datalayout = "E-p:32:32"
-target triple = "powerpc-apple-darwin9.0.0d1"
- %"struct.kc::impl_Ccode_option" = type { %"struct.kc::impl_abstract_phylum" }
- %"struct.kc::impl_ID" = type { %"struct.kc::impl_abstract_phylum", %"struct.kc::impl_Ccode_option"*, %"struct.kc::impl_casestring__Str"*, i32, %"struct.kc::impl_casestring__Str"* }
- %"struct.kc::impl_abstract_phylum" = type { i32 (...)** }
- %"struct.kc::impl_casestring__Str" = type { %"struct.kc::impl_abstract_phylum", i8* }
- %"struct.kc::impl_elem_patternrepresentation" = type { %"struct.kc::impl_abstract_phylum", i32, %"struct.kc::impl_casestring__Str"*, %"struct.kc::impl_ID"* }
- %"struct.kc::impl_outmostpatterns" = type { %"struct.kc::impl_Ccode_option", %"struct.kc::impl_elem_patternrepresentation"*, %"struct.kc::impl_outmostpatterns"* }
- %"struct.kc::impl_patternrepresentations" = type { %"struct.kc::impl_Ccode_option", %"struct.kc::impl_outmostpatterns"*, %"struct.kc::impl_patternrepresentations"* }
-
-define void @_ZN2kc16compare_patternsEPNS_26impl_patternrepresentationES1_PNS_27impl_patternrepresentationsE() {
-entry:
- br label %bb1269.outer.outer.outer.outer
-
-cond_true: ; preds = %cond_true1298
- br label %bb1269.outer69
-
-cond_false: ; preds = %cond_true1298
- br i1 false, label %cond_next, label %bb51
-
-cond_next: ; preds = %cond_false
- br i1 false, label %bb52, label %bb51
-
-bb51: ; preds = %cond_next, %cond_false
- br label %bb52
-
-bb52: ; preds = %bb51, %cond_next
- br i1 false, label %cond_false82, label %cond_true55
-
-cond_true55: ; preds = %bb52
- br i1 false, label %UnifiedReturnBlock, label %cond_true57
-
-cond_true57: ; preds = %cond_true55
- br label %UnifiedReturnBlock
-
-cond_false82: ; preds = %bb52
- br i1 false, label %cond_next97, label %bb113
-
-cond_next97: ; preds = %cond_false82
- br i1 false, label %bb114, label %bb113
-
-bb113: ; preds = %cond_next97, %cond_false82
- br label %bb114
-
-bb114: ; preds = %bb113, %cond_next97
- br i1 false, label %cond_false151, label %cond_true117
-
-cond_true117: ; preds = %bb114
- br i1 false, label %UnifiedReturnBlock, label %cond_true120
-
-cond_true120: ; preds = %cond_true117
- br label %UnifiedReturnBlock
-
-cond_false151: ; preds = %bb114
- br i1 false, label %cond_next166, label %bb182
-
-cond_next166: ; preds = %cond_false151
- br i1 false, label %bb183, label %bb182
-
-bb182: ; preds = %cond_next166, %cond_false151
- br label %bb183
-
-bb183: ; preds = %bb182, %cond_next166
- br i1 false, label %cond_false256, label %cond_true186
-
-cond_true186: ; preds = %bb183
- br i1 false, label %cond_true207, label %cond_false214
-
-cond_true207: ; preds = %cond_true186
- br label %bb1269.outer38.backedge
-
-bb1269.outer38.backedge: ; preds = %cond_true545, %cond_true432, %cond_true320, %cond_true207
- br label %bb1269.outer38
-
-cond_false214: ; preds = %cond_true186
- br i1 false, label %cond_true228, label %cond_false235
-
-cond_true228: ; preds = %cond_false214
- br label %bb1269.outer21.backedge
-
-bb1269.outer21.backedge: ; preds = %cond_true566, %cond_true453, %cond_true341, %cond_true228
- br label %bb1269.outer21
-
-cond_false235: ; preds = %cond_false214
- br i1 false, label %UnifiedReturnBlock, label %cond_false250
-
-cond_false250: ; preds = %cond_false235
- br label %UnifiedUnreachableBlock
-
-cond_false256: ; preds = %bb183
- br i1 false, label %cond_next271, label %bb287
-
-cond_next271: ; preds = %cond_false256
- br i1 false, label %bb288, label %bb287
-
-bb287: ; preds = %cond_next271, %cond_false256
- br label %bb288
-
-bb288: ; preds = %bb287, %cond_next271
- br i1 false, label %cond_false369, label %cond_true291
-
-cond_true291: ; preds = %bb288
- br i1 false, label %cond_true320, label %cond_false327
-
-cond_true320: ; preds = %cond_true291
- br label %bb1269.outer38.backedge
-
-cond_false327: ; preds = %cond_true291
- br i1 false, label %cond_true341, label %cond_false348
-
-cond_true341: ; preds = %cond_false327
- br label %bb1269.outer21.backedge
-
-cond_false348: ; preds = %cond_false327
- br i1 false, label %UnifiedReturnBlock, label %cond_false363
-
-cond_false363: ; preds = %cond_false348
- br label %UnifiedUnreachableBlock
-
-cond_false369: ; preds = %bb288
- br i1 false, label %cond_next384, label %bb400
-
-cond_next384: ; preds = %cond_false369
- br i1 false, label %bb401, label %bb400
-
-bb400: ; preds = %cond_next384, %cond_false369
- br label %bb401
-
-bb401: ; preds = %bb400, %cond_next384
- br i1 false, label %cond_false481, label %cond_true404
-
-cond_true404: ; preds = %bb401
- br i1 false, label %cond_true432, label %cond_false439
-
-cond_true432: ; preds = %cond_true404
- br label %bb1269.outer38.backedge
-
-cond_false439: ; preds = %cond_true404
- br i1 false, label %cond_true453, label %cond_false460
-
-cond_true453: ; preds = %cond_false439
- br label %bb1269.outer21.backedge
-
-cond_false460: ; preds = %cond_false439
- br i1 false, label %UnifiedReturnBlock, label %cond_false475
-
-cond_false475: ; preds = %cond_false460
- br label %UnifiedUnreachableBlock
-
-cond_false481: ; preds = %bb401
- br i1 false, label %cond_next496, label %bb512
-
-cond_next496: ; preds = %cond_false481
- br i1 false, label %bb513, label %bb512
-
-bb512: ; preds = %cond_next496, %cond_false481
- br label %bb513
-
-bb513: ; preds = %bb512, %cond_next496
- br i1 false, label %cond_false594, label %cond_true516
-
-cond_true516: ; preds = %bb513
- br i1 false, label %cond_true545, label %cond_false552
-
-cond_true545: ; preds = %cond_true516
- br label %bb1269.outer38.backedge
-
-cond_false552: ; preds = %cond_true516
- br i1 false, label %cond_true566, label %cond_false573
-
-cond_true566: ; preds = %cond_false552
- br label %bb1269.outer21.backedge
-
-cond_false573: ; preds = %cond_false552
- br i1 false, label %UnifiedReturnBlock, label %cond_false588
-
-cond_false588: ; preds = %cond_false573
- br label %UnifiedUnreachableBlock
-
-cond_false594: ; preds = %bb513
- br i1 false, label %cond_next609, label %bb625
-
-cond_next609: ; preds = %cond_false594
- br i1 false, label %bb626, label %bb625
-
-bb625: ; preds = %cond_next609, %cond_false594
- br label %bb626
-
-bb626: ; preds = %bb625, %cond_next609
- br i1 false, label %cond_false707, label %cond_true629
-
-cond_true629: ; preds = %bb626
- br i1 false, label %cond_true658, label %cond_false665
-
-cond_true658: ; preds = %cond_true629
- br label %bb1269.outer2.backedge
-
-bb1269.outer2.backedge: ; preds = %cond_true679, %cond_true658
- br label %bb1269.outer2
-
-cond_false665: ; preds = %cond_true629
- br i1 false, label %cond_true679, label %cond_false686
-
-cond_true679: ; preds = %cond_false665
- br label %bb1269.outer2.backedge
-
-cond_false686: ; preds = %cond_false665
- br i1 false, label %UnifiedReturnBlock, label %cond_false701
-
-cond_false701: ; preds = %cond_false686
- br label %UnifiedUnreachableBlock
-
-cond_false707: ; preds = %bb626
- br i1 false, label %cond_next722, label %bb738
-
-cond_next722: ; preds = %cond_false707
- br i1 false, label %bb739, label %bb738
-
-bb738: ; preds = %cond_next722, %cond_false707
- br label %bb739
-
-bb739: ; preds = %bb738, %cond_next722
- br i1 false, label %cond_false820, label %cond_true742
-
-cond_true742: ; preds = %bb739
- br i1 false, label %cond_true771, label %cond_false778
-
-cond_true771: ; preds = %cond_true742
- br label %bb1269.outer.backedge
-
-bb1269.outer.backedge: ; preds = %cond_true792, %cond_true771
- br label %bb1269.outer
-
-cond_false778: ; preds = %cond_true742
- br i1 false, label %cond_true792, label %cond_false799
-
-cond_true792: ; preds = %cond_false778
- br label %bb1269.outer.backedge
-
-cond_false799: ; preds = %cond_false778
- br i1 false, label %UnifiedReturnBlock, label %cond_false814
-
-cond_false814: ; preds = %cond_false799
- br label %UnifiedUnreachableBlock
-
-cond_false820: ; preds = %bb739
- br i1 false, label %cond_next835, label %bb851
-
-cond_next835: ; preds = %cond_false820
- br i1 false, label %bb852, label %bb851
-
-bb851: ; preds = %cond_next835, %cond_false820
- br label %bb852
-
-bb852: ; preds = %bb851, %cond_next835
- br i1 false, label %cond_false933, label %cond_true855
-
-cond_true855: ; preds = %bb852
- br i1 false, label %cond_true884, label %cond_false891
-
-cond_true884: ; preds = %cond_true855
- br label %bb1269.outer.outer.backedge
-
-bb1269.outer.outer.backedge: ; preds = %cond_true905, %cond_true884
- br label %bb1269.outer.outer
-
-cond_false891: ; preds = %cond_true855
- br i1 false, label %cond_true905, label %cond_false912
-
-cond_true905: ; preds = %cond_false891
- br label %bb1269.outer.outer.backedge
-
-cond_false912: ; preds = %cond_false891
- br i1 false, label %UnifiedReturnBlock, label %cond_false927
-
-cond_false927: ; preds = %cond_false912
- br label %UnifiedUnreachableBlock
-
-cond_false933: ; preds = %bb852
- br i1 false, label %cond_next948, label %bb964
-
-cond_next948: ; preds = %cond_false933
- br i1 false, label %bb965, label %bb964
-
-bb964: ; preds = %cond_next948, %cond_false933
- br label %bb965
-
-bb965: ; preds = %bb964, %cond_next948
- br i1 false, label %cond_false1046, label %cond_true968
-
-cond_true968: ; preds = %bb965
- br i1 false, label %cond_true997, label %cond_false1004
-
-cond_true997: ; preds = %cond_true968
- br label %bb1269.outer.outer.outer.backedge
-
-bb1269.outer.outer.outer.backedge: ; preds = %cond_true1018, %cond_true997
- br label %bb1269.outer.outer.outer
-
-cond_false1004: ; preds = %cond_true968
- br i1 false, label %cond_true1018, label %cond_false1025
-
-cond_true1018: ; preds = %cond_false1004
- br label %bb1269.outer.outer.outer.backedge
-
-cond_false1025: ; preds = %cond_false1004
- br i1 false, label %UnifiedReturnBlock, label %cond_false1040
-
-cond_false1040: ; preds = %cond_false1025
- br label %UnifiedUnreachableBlock
-
-cond_false1046: ; preds = %bb965
- br i1 false, label %cond_next1061, label %bb1077
-
-cond_next1061: ; preds = %cond_false1046
- br i1 false, label %bb1078, label %bb1077
-
-bb1077: ; preds = %cond_next1061, %cond_false1046
- br label %bb1078
-
-bb1078: ; preds = %bb1077, %cond_next1061
- %tmp1080 = phi i1 [ true, %bb1077 ], [ false, %cond_next1061 ] ; <i1> [#uses=1]
- br i1 %tmp1080, label %cond_false1159, label %cond_true1081
-
-cond_true1081: ; preds = %bb1078
- br i1 false, label %cond_true1110, label %cond_false1117
-
-cond_true1110: ; preds = %cond_true1081
- br label %bb1269.outer.outer.outer.outer.backedge
-
-bb1269.outer.outer.outer.outer.backedge: ; preds = %cond_true1131, %cond_true1110
- br label %bb1269.outer.outer.outer.outer
-
-cond_false1117: ; preds = %cond_true1081
- br i1 false, label %cond_true1131, label %cond_false1138
-
-cond_true1131: ; preds = %cond_false1117
- br label %bb1269.outer.outer.outer.outer.backedge
-
-cond_false1138: ; preds = %cond_false1117
- br i1 false, label %UnifiedReturnBlock, label %cond_false1153
-
-cond_false1153: ; preds = %cond_false1138
- br label %UnifiedUnreachableBlock
-
-cond_false1159: ; preds = %bb1078
- %tmp.i119.lcssa35.lcssa.lcssa.lcssa.lcssa.lcssa = phi %"struct.kc::impl_elem_patternrepresentation"* [ null, %bb1078 ] ; <%"struct.kc::impl_elem_patternrepresentation"*> [#uses=0]
- br i1 false, label %UnifiedReturnBlock, label %cond_false1174
-
-cond_false1174: ; preds = %cond_false1159
- br i1 false, label %UnifiedReturnBlock, label %cond_false1189
-
-cond_false1189: ; preds = %cond_false1174
- br i1 false, label %UnifiedReturnBlock, label %cond_false1204
-
-cond_false1204: ; preds = %cond_false1189
- br i1 false, label %UnifiedReturnBlock, label %cond_false1219
-
-cond_false1219: ; preds = %cond_false1204
- br i1 false, label %UnifiedReturnBlock, label %cond_true1222
-
-cond_true1222: ; preds = %cond_false1219
- br label %UnifiedReturnBlock
-
-bb1269.outer.outer.outer.outer: ; preds = %bb1269.outer.outer.outer.outer.backedge, %entry
- br label %bb1269.outer.outer.outer
-
-bb1269.outer.outer.outer: ; preds = %bb1269.outer.outer.outer.outer, %bb1269.outer.outer.outer.backedge
- br label %bb1269.outer.outer
-
-bb1269.outer.outer: ; preds = %bb1269.outer.outer.outer, %bb1269.outer.outer.backedge
- br label %bb1269.outer
-
-bb1269.outer: ; preds = %bb1269.outer.outer, %bb1269.outer.backedge
- br label %bb1269.outer2
-
-bb1269.outer2: ; preds = %bb1269.outer, %bb1269.outer2.backedge
- br label %bb1269.outer21
-
-bb1269.outer21: ; preds = %bb1269.outer2, %bb1269.outer21.backedge
- br label %bb1269.outer38
-
-bb1269.outer38: ; preds = %bb1269.outer21, %bb1269.outer38.backedge
- br label %bb1269.outer54
-
-bb1269.outer54: ; preds = %bb1269.outer38
- br label %bb1269.outer69
-
-bb1269.outer69: ; preds = %bb1269.outer54, %cond_true
- br label %bb1269
-
-bb1269: ; preds = %bb1269.outer69
- br i1 false, label %cond_next1281, label %bb1294
-
-cond_next1281: ; preds = %bb1269
- br i1 false, label %cond_true1298, label %bb1294
-
-bb1294: ; preds = %cond_next1281, %bb1269
- br i1 false, label %cond_true1331, label %cond_next1313
-
-cond_true1298: ; preds = %cond_next1281
- br i1 false, label %cond_false, label %cond_true
-
-cond_next1313: ; preds = %bb1294
- br i1 false, label %cond_true1331, label %cond_next1355
-
-cond_true1331: ; preds = %cond_next1313, %bb1294
- br i1 false, label %cond_false1346, label %cond_true1342
-
-cond_true1342: ; preds = %cond_true1331
- br label %cond_next1350
-
-cond_false1346: ; preds = %cond_true1331
- br label %cond_next1350
-
-cond_next1350: ; preds = %cond_false1346, %cond_true1342
- br label %bb.i
-
-bb.i: ; preds = %bb.i, %cond_next1350
- br i1 false, label %_ZN2kc18impl_abstract_list8freelistEv.exit, label %bb.i
-
-_ZN2kc18impl_abstract_list8freelistEv.exit: ; preds = %bb.i
- br label %cond_next1355
-
-cond_next1355: ; preds = %_ZN2kc18impl_abstract_list8freelistEv.exit, %cond_next1313
- br i1 false, label %cond_next1363, label %bb1388
-
-cond_next1363: ; preds = %cond_next1355
- br i1 false, label %UnifiedReturnBlock, label %cond_true1366
-
-cond_true1366: ; preds = %cond_next1363
- br label %UnifiedReturnBlock
-
-bb1388: ; preds = %cond_next1355
- br i1 false, label %UnifiedReturnBlock, label %bb1414.preheader
-
-bb1414.preheader: ; preds = %bb1388
- br label %bb1414
-
-bb1414: ; preds = %cond_true1426, %bb1414.preheader
- br i1 false, label %cond_true1426, label %bb1429
-
-cond_true1426: ; preds = %bb1414
- br label %bb1414
-
-bb1429: ; preds = %bb1414
- br i1 false, label %cond_true1431, label %UnifiedReturnBlock
-
-cond_true1431: ; preds = %bb1429
- br i1 false, label %UnifiedReturnBlock, label %cond_true1434
-
-cond_true1434: ; preds = %cond_true1431
- br label %UnifiedReturnBlock
-
-UnifiedUnreachableBlock: ; preds = %cond_false1153, %cond_false1040, %cond_false927, %cond_false814, %cond_false701, %cond_false588, %cond_false475, %cond_false363, %cond_false250
- unreachable
-
-UnifiedReturnBlock: ; preds = %cond_true1434, %cond_true1431, %bb1429, %bb1388, %cond_true1366, %cond_next1363, %cond_true1222, %cond_false1219, %cond_false1204, %cond_false1189, %cond_false1174, %cond_false1159, %cond_false1138, %cond_false1025, %cond_false912, %cond_false799, %cond_false686, %cond_false573, %cond_false460, %cond_false348, %cond_false235, %cond_true120, %cond_true117, %cond_true57, %cond_true55
- ret void
-}
diff --git a/release_23/test/Transforms/CondProp/2006-11-01-PhiNodeCrash.ll b/release_23/test/Transforms/CondProp/2006-11-01-PhiNodeCrash.ll
deleted file mode 100644
index 573ee6cadd39..000000000000
--- a/release_23/test/Transforms/CondProp/2006-11-01-PhiNodeCrash.ll
+++ /dev/null
@@ -1,1084 +0,0 @@
-; RUN: llvm-as < %s | opt -condprop -disable-output
-; PR979
-
-target datalayout = "e-p:32:32"
-target triple = "i686-pc-linux-gnu"
-deplibs = [ "c", "crtend" ]
- %struct.IO_APIC_reg_00 = type { i32 }
- %struct.Qdisc = type { i32 (%struct.sk_buff*, %struct.Qdisc*)*, %struct.sk_buff* (%struct.Qdisc*)*, i32, %struct.Qdisc_ops*, %struct.Qdisc*, i32, %struct.IO_APIC_reg_00, %struct.sk_buff_head, %struct.net_device*, %struct.tc_stats, i32 (%struct.sk_buff*, %struct.Qdisc*)*, %struct.Qdisc*, [1 x i8] }
- %struct.Qdisc_class_ops = type { i32 (%struct.Qdisc*, i32, %struct.Qdisc*, %struct.Qdisc**)*, %struct.Qdisc* (%struct.Qdisc*, i32)*, i32 (%struct.Qdisc*, i32)*, void (%struct.Qdisc*, i32)*, i32 (%struct.Qdisc*, i32, i32, %struct._agp_version**, i32*)*, i32 (%struct.Qdisc*, i32)*, void (%struct.Qdisc*, %struct.qdisc_walker*)*, %struct.tcf_proto** (%struct.Qdisc*, i32)*, i32 (%struct.Qdisc*, i32, i32)*, void (%struct.Qdisc*, i32)*, i32 (%struct.Qdisc*, i32, %struct.sk_buff*, %struct.tcmsg*)* }
- %struct.Qdisc_ops = type { %struct.Qdisc_ops*, %struct.Qdisc_class_ops*, [16 x i8], i32, i32 (%struct.sk_buff*, %struct.Qdisc*)*, %struct.sk_buff* (%struct.Qdisc*)*, i32 (%struct.sk_buff*, %struct.Qdisc*)*, i32 (%struct.Qdisc*)*, i32 (%struct.Qdisc*, %struct._agp_version*)*, void (%struct.Qdisc*)*, void (%struct.Qdisc*)*, i32 (%struct.Qdisc*, %struct._agp_version*)*, i32 (%struct.Qdisc*, %struct.sk_buff*)* }
- %struct.ViceFid = type { i32, i32, i32 }
- %struct.__wait_queue = type { i32, %struct.task_struct*, %struct.list_head }
- %struct.__wait_queue_head = type { %struct.IO_APIC_reg_00, %struct.list_head }
- %struct._agp_version = type { i16, i16 }
- %struct._drm_i810_overlay_t = type { i32, i32 }
- %struct.address_space = type { %struct.list_head, %struct.list_head, %struct.list_head, i32, %struct.address_space_operations*, %struct.inode*, %struct.vm_area_struct*, %struct.vm_area_struct*, %struct.IO_APIC_reg_00, i32 }
- %struct.address_space_operations = type { i32 (%struct.page*)*, i32 (%struct.file*, %struct.page*)*, i32 (%struct.page*)*, i32 (%struct.file*, %struct.page*, i32, i32)*, i32 (%struct.file*, %struct.page*, i32, i32)*, i32 (%struct.address_space*, i32)*, i32 (%struct.page*, i32)*, i32 (%struct.page*, i32)*, i32 (i32, %struct.inode*, %struct.kiobuf*, i32, i32)*, i32 (i32, %struct.file*, %struct.kiobuf*, i32, i32)*, void (%struct.page*)* }
- %struct.audio_buf_info = type { i32, i32, i32, i32 }
- %struct.autofs_packet_hdr = type { i32, i32 }
- %struct.block_device = type { %struct.list_head, %struct.IO_APIC_reg_00, %struct.inode*, i16, i32, %struct.block_device_operations*, %struct.semaphore, %struct.list_head }
- %struct.block_device_operations = type { i32 (%struct.inode*, %struct.file*)*, i32 (%struct.inode*, %struct.file*)*, i32 (%struct.inode*, %struct.file*, i32, i32)*, i32 (i16)*, i32 (i16)*, %struct.module* }
- %struct.bluez_skb_cb = type { i32 }
- %struct.buffer_head = type { %struct.buffer_head*, i32, i16, i16, i16, %struct.IO_APIC_reg_00, i16, i32, i32, %struct.buffer_head*, %struct.buffer_head*, %struct.buffer_head*, %struct.buffer_head*, %struct.buffer_head**, i8*, %struct.page*, void (%struct.buffer_head*, i32)*, i8*, i32, %struct.__wait_queue_head, %struct.list_head }
- %struct.char_device = type { %struct.list_head, %struct.IO_APIC_reg_00, i16, %struct.IO_APIC_reg_00, %struct.semaphore }
- %struct.completion = type { i32, %struct.__wait_queue_head }
- %struct.cramfs_info = type { i32, i32, i32, i32 }
- %struct.dentry = type { %struct.IO_APIC_reg_00, i32, %struct.inode*, %struct.dentry*, %struct.list_head, %struct.list_head, %struct.list_head, %struct.list_head, %struct.list_head, i32, %struct.qstr, i32, %struct.dentry_operations*, %struct.super_block*, i32, i8*, [16 x i8] }
- %struct.dentry_operations = type { i32 (%struct.dentry*, i32)*, i32 (%struct.dentry*, %struct.qstr*)*, i32 (%struct.dentry*, %struct.qstr*, %struct.qstr*)*, i32 (%struct.dentry*)*, void (%struct.dentry*)*, void (%struct.dentry*, %struct.inode*)* }
- %struct.dev_mc_list = type { %struct.dev_mc_list*, [8 x i8], i8, i32, i32 }
- %struct.dnotify_struct = type { %struct.dnotify_struct*, i32, i32, %struct.file*, %struct.files_struct* }
- %struct.dquot = type { %struct.list_head, %struct.list_head, %struct.list_head, %struct.__wait_queue_head, %struct.__wait_queue_head, i32, i32, %struct.super_block*, i32, i16, i64, i16, i16, i32, %struct.mem_dqblk }
- %struct.dquot_operations = type { void (%struct.inode*, i32)*, void (%struct.inode*)*, i32 (%struct.inode*, i64, i32)*, i32 (%struct.inode*, i32)*, void (%struct.inode*, i64)*, void (%struct.inode*, i32)*, i32 (%struct.inode*, %struct.iattr*)*, i32 (%struct.dquot*)* }
- %struct.drm_clip_rect = type { i16, i16, i16, i16 }
- %struct.drm_ctx_priv_map = type { i32, i8* }
- %struct.drm_mga_indices = type { i32, i32, i32, i32 }
- %struct.dst_entry = type { %struct.dst_entry*, %struct.IO_APIC_reg_00, i32, %struct.net_device*, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, %struct.neighbour*, %struct.hh_cache*, i32 (%struct.sk_buff*)*, i32 (%struct.sk_buff*)*, %struct.dst_ops*, [0 x i8] }
- %struct.dst_ops = type { i16, i16, i32, i32 ()*, %struct.dst_entry* (%struct.dst_entry*, i32)*, %struct.dst_entry* (%struct.dst_entry*, %struct.sk_buff*)*, void (%struct.dst_entry*)*, %struct.dst_entry* (%struct.dst_entry*)*, void (%struct.sk_buff*)*, i32, %struct.IO_APIC_reg_00, %struct.kmem_cache_s* }
- %struct.e820entry = type { i64, i64, i32 }
- %struct.exec_domain = type { i8*, void (i32, %struct.pt_regs*)*, i8, i8, i32*, i32*, %struct.map_segment*, %struct.map_segment*, %struct.map_segment*, %struct.map_segment*, %struct.module*, %struct.exec_domain* }
- %struct.ext2_inode_info = type { [15 x i32], i32, i32, i8, i8, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 }
- %struct.ext3_inode_info = type { [15 x i32], i32, i32, i32, i32, i32, i32, i32, i32, i32, %struct.list_head, i64, %struct.rw_semaphore }
- %struct.fasync_struct = type { i32, i32, %struct.fasync_struct*, %struct.file* }
- %struct.file = type { %struct.list_head, %struct.dentry*, %struct.vfsmount*, %struct.file_operations*, %struct.IO_APIC_reg_00, i32, i16, i64, i32, i32, i32, i32, i32, %struct.audio_buf_info, i32, i32, i32, i32, i8*, %struct.kiobuf*, i32 }
- %struct.file_lock = type { %struct.file_lock*, %struct.list_head, %struct.list_head, %struct.files_struct*, i32, %struct.__wait_queue_head, %struct.file*, i8, i8, i64, i64, void (%struct.file_lock*)*, void (%struct.file_lock*)*, void (%struct.file_lock*)*, %struct.fasync_struct*, i32, { %struct.nfs_lock_info } }
- %struct.file_operations = type { %struct.module*, i64 (%struct.file*, i64, i32)*, i32 (%struct.file*, i8*, i32, i64*)*, i32 (%struct.file*, i8*, i32, i64*)*, i32 (%struct.file*, i8*, i32 (i8*, i8*, i32, i64, i32, i32)*)*, i32 (%struct.file*, %struct.poll_table_struct*)*, i32 (%struct.inode*, %struct.file*, i32, i32)*, i32 (%struct.file*, %struct.vm_area_struct*)*, i32 (%struct.inode*, %struct.file*)*, i32 (%struct.file*)*, i32 (%struct.inode*, %struct.file*)*, i32 (%struct.file*, %struct.dentry*, i32)*, i32 (i32, %struct.file*, i32)*, i32 (%struct.file*, i32, %struct.file_lock*)*, i32 (%struct.file*, %struct.iovec*, i32, i64*)*, i32 (%struct.file*, %struct.iovec*, i32, i64*)*, i32 (%struct.file*, %struct.page*, i32, i32, i64*, i32)*, i32 (%struct.file*, i32, i32, i32, i32)* }
- %struct.file_system_type = type { i8*, i32, %struct.super_block* (%struct.super_block*, i8*, i32)*, %struct.module*, %struct.file_system_type*, %struct.list_head }
- %struct.files_struct = type { %struct.IO_APIC_reg_00, %typedef.rwlock_t, i32, i32, i32, %struct.file**, %typedef.__kernel_fd_set*, %typedef.__kernel_fd_set*, %typedef.__kernel_fd_set, %typedef.__kernel_fd_set, [32 x %struct.file*] }
- %struct.fs_disk_quota = type { i8, i8, i16, i32, i64, i64, i64, i64, i64, i64, i32, i32, i16, i16, i32, i64, i64, i64, i32, i16, i16, [8 x i8] }
- %struct.fs_quota_stat = type { i8, i16, i8, %struct.e820entry, %struct.e820entry, i32, i32, i32, i32, i16, i16 }
- %struct.fs_struct = type { %struct.IO_APIC_reg_00, %typedef.rwlock_t, i32, %struct.dentry*, %struct.dentry*, %struct.dentry*, %struct.vfsmount*, %struct.vfsmount*, %struct.vfsmount* }
- %struct.hh_cache = type { %struct.hh_cache*, %struct.IO_APIC_reg_00, i16, i32, i32 (%struct.sk_buff*)*, %typedef.rwlock_t, [32 x i32] }
- %struct.i387_fxsave_struct = type { i16, i16, i16, i16, i32, i32, i32, i32, i32, i32, [32 x i32], [32 x i32], [56 x i32] }
- %struct.iattr = type { i32, i16, i32, i32, i64, i32, i32, i32, i32 }
- %struct.if_dqblk = type { i64, i64, i64, i64, i64, i64, i64, i64, i32 }
- %struct.if_dqinfo = type { i64, i64, i32, i32 }
- %struct.ifmap = type { i32, i32, i16, i8, i8, i8 }
- %struct.ifreq = type { { [16 x i8] }, %typedef.dvd_authinfo }
- %struct.inode = type { %struct.list_head, %struct.list_head, %struct.list_head, %struct.list_head, %struct.list_head, i32, %struct.IO_APIC_reg_00, i16, i16, i16, i32, i32, i16, i64, i32, i32, i32, i32, i32, i32, i32, i16, %struct.semaphore, %struct.rw_semaphore, %struct.semaphore, %struct.inode_operations*, %struct.file_operations*, %struct.super_block*, %struct.__wait_queue_head, %struct.file_lock*, %struct.address_space*, %struct.address_space, [2 x %struct.dquot*], %struct.list_head, %struct.pipe_inode_info*, %struct.block_device*, %struct.char_device*, i32, %struct.dnotify_struct*, i32, i32, i8, %struct.IO_APIC_reg_00, i32, i32, { %struct.ext2_inode_info, %struct.ext3_inode_info, %struct.msdos_inode_info, %struct.iso_inode_info, %struct.nfs_inode_info, %struct._drm_i810_overlay_t, %struct.shmem_inode_info, %struct.proc_inode_info, %struct.socket, %struct.usbdev_inode_info, i8* } }
- %struct.inode_operations = type { i32 (%struct.inode*, %struct.dentry*, i32)*, %struct.dentry* (%struct.inode*, %struct.dentry*)*, i32 (%struct.dentry*, %struct.inode*, %struct.dentry*)*, i32 (%struct.inode*, %struct.dentry*)*, i32 (%struct.inode*, %struct.dentry*, i8*)*, i32 (%struct.inode*, %struct.dentry*, i32)*, i32 (%struct.inode*, %struct.dentry*)*, i32 (%struct.inode*, %struct.dentry*, i32, i32)*, i32 (%struct.inode*, %struct.dentry*, %struct.inode*, %struct.dentry*)*, i32 (%struct.dentry*, i8*, i32)*, i32 (%struct.dentry*, %struct.nameidata*)*, void (%struct.inode*)*, i32 (%struct.inode*, i32)*, i32 (%struct.dentry*)*, i32 (%struct.dentry*, %struct.iattr*)*, i32 (%struct.dentry*, %struct.iattr*)*, i32 (%struct.dentry*, i8*, i8*, i32, i32)*, i32 (%struct.dentry*, i8*, i8*, i32)*, i32 (%struct.dentry*, i8*, i32)*, i32 (%struct.dentry*, i8*)* }
- %struct.iovec = type { i8*, i32 }
- %struct.ip_options = type { i32, i8, i8, i8, i8, i8, i8, i8, i8, [0 x i8] }
- %struct.isapnp_dma = type { i8, i8, %struct.isapnp_resources*, %struct.isapnp_dma* }
- %struct.isapnp_irq = type { i16, i8, i8, %struct.isapnp_resources*, %struct.isapnp_irq* }
- %struct.isapnp_mem = type { i32, i32, i32, i32, i8, i8, %struct.isapnp_resources*, %struct.isapnp_mem* }
- %struct.isapnp_mem32 = type { [17 x i8], %struct.isapnp_resources*, %struct.isapnp_mem32* }
- %struct.isapnp_port = type { i16, i16, i8, i8, i8, i8, %struct.isapnp_resources*, %struct.isapnp_port* }
- %struct.isapnp_resources = type { i16, i16, %struct.isapnp_port*, %struct.isapnp_irq*, %struct.isapnp_dma*, %struct.isapnp_mem*, %struct.isapnp_mem32*, %struct.pci_dev*, %struct.isapnp_resources*, %struct.isapnp_resources* }
- %struct.iso_inode_info = type { i32, i8, [3 x i8], i32, i32 }
- %struct.iw_handler_def = type opaque
- %struct.iw_statistics = type opaque
- %struct.k_sigaction = type { %struct.sigaction }
- %struct.kern_ipc_perm = type { i32, i32, i32, i32, i32, i16, i32 }
- %struct.kiobuf = type { i32, i32, i32, i32, i32, %struct.page**, %struct.buffer_head**, i32*, %struct.IO_APIC_reg_00, i32, void (%struct.kiobuf*)*, %struct.__wait_queue_head }
- %struct.kmem_cache_s = type { %struct.list_head, %struct.list_head, %struct.list_head, i32, i32, i32, %struct.IO_APIC_reg_00, i32, i32, i32, i32, i32, i32, %struct.kmem_cache_s*, i32, i32, void (i8*, %struct.kmem_cache_s*, i32)*, void (i8*, %struct.kmem_cache_s*, i32)*, i32, [20 x i8], %struct.list_head, [32 x %struct._drm_i810_overlay_t*], i32 }
- %struct.linux_binfmt = type { %struct.linux_binfmt*, %struct.module*, i32 (%struct.linux_binprm*, %struct.pt_regs*)*, i32 (%struct.file*)*, i32 (i32, %struct.pt_regs*, %struct.file*)*, i32, i32 (%struct.linux_binprm*, i8*)* }
- %struct.linux_binprm = type { [128 x i8], [32 x %struct.page*], i32, i32, %struct.file*, i32, i32, i32, i32, i32, i32, i32, i8*, i32, i32 }
- %struct.list_head = type { %struct.list_head*, %struct.list_head* }
- %struct.llva_sigcontext = type { %typedef.llva_icontext_t, %typedef.llva_fp_state_t, i32, i32, i32, i32, [1 x i32], i8* }
- %struct.map_segment = type opaque
- %struct.mem_dqblk = type { i32, i32, i64, i32, i32, i32, i32, i32 }
- %struct.mem_dqinfo = type { %struct.quota_format_type*, i32, i32, i32, { %struct.ViceFid } }
- %struct.mm_struct = type { %struct.vm_area_struct*, %struct.rb_root_s, %struct.vm_area_struct*, %struct.IO_APIC_reg_00*, %struct.IO_APIC_reg_00, %struct.IO_APIC_reg_00, i32, %struct.rw_semaphore, %struct.IO_APIC_reg_00, %struct.list_head, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, %struct.iovec }
- %struct.module = type { i32, %struct.module*, i8*, i32, %struct.IO_APIC_reg_00, i32, i32, i32, %struct.drm_ctx_priv_map*, %struct.module_ref*, %struct.module_ref*, i32 ()*, void ()*, %struct._drm_i810_overlay_t*, %struct._drm_i810_overlay_t*, %struct.module_persist*, %struct.module_persist*, i32 ()*, i32, i8*, i8*, i8*, i8*, i8* }
- %struct.module_persist = type opaque
- %struct.module_ref = type { %struct.module*, %struct.module*, %struct.module_ref* }
- %struct.msdos_inode_info = type { i32, i32, i32, i32, i32, i32, %struct.inode*, %struct.list_head }
- %struct.msghdr = type { i8*, i32, %struct.iovec*, i32, i8*, i32, i32 }
- %struct.msq_setbuf = type { i32, i32, i32, i16 }
- %struct.nameidata = type { %struct.dentry*, %struct.vfsmount*, %struct.qstr, i32, i32 }
- %struct.namespace = type { %struct.IO_APIC_reg_00, %struct.vfsmount*, %struct.list_head, %struct.rw_semaphore }
- %struct.neigh_ops = type { i32, void (%struct.neighbour*)*, void (%struct.neighbour*, %struct.sk_buff*)*, void (%struct.neighbour*, %struct.sk_buff*)*, i32 (%struct.sk_buff*)*, i32 (%struct.sk_buff*)*, i32 (%struct.sk_buff*)*, i32 (%struct.sk_buff*)* }
- %struct.neigh_parms = type { %struct.neigh_parms*, i32 (%struct.neighbour*)*, %struct.neigh_table*, i32, i8*, i8*, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 }
- %struct.neigh_table = type { %struct.neigh_table*, i32, i32, i32, i32 (i8*, %struct.net_device*)*, i32 (%struct.neighbour*)*, i32 (%struct.pneigh_entry*)*, void (%struct.pneigh_entry*)*, void (%struct.sk_buff*)*, i8*, %struct.neigh_parms, i32, i32, i32, i32, i32, %struct.timer_list, %struct.timer_list, %struct.sk_buff_head, i32, %typedef.rwlock_t, i32, %struct.neigh_parms*, %struct.kmem_cache_s*, %struct.tasklet_struct, %struct.audio_buf_info, [32 x %struct.neighbour*], [16 x %struct.pneigh_entry*] }
- %struct.neighbour = type { %struct.neighbour*, %struct.neigh_table*, %struct.neigh_parms*, %struct.net_device*, i32, i32, i32, i8, i8, i8, i8, %struct.IO_APIC_reg_00, %typedef.rwlock_t, [8 x i8], %struct.hh_cache*, %struct.IO_APIC_reg_00, i32 (%struct.sk_buff*)*, %struct.sk_buff_head, %struct.timer_list, %struct.neigh_ops*, [0 x i8] }
- %struct.net_bridge_port = type opaque
- %struct.net_device = type { [16 x i8], i32, i32, i32, i32, i32, i32, i8, i8, i32, %struct.net_device*, i32 (%struct.net_device*)*, %struct.net_device*, i32, i32, %struct.net_device_stats* (%struct.net_device*)*, %struct.iw_statistics* (%struct.net_device*)*, %struct.iw_handler_def*, i32, i32, i16, i16, i16, i16, i32, i16, i16, i8*, %struct.net_device*, [8 x i8], [8 x i8], i8, %struct.dev_mc_list*, i32, i32, i32, i32, %struct.timer_list, i8*, i8*, i8*, i8*, i8*, %struct.list_head, i32, i32, %struct.Qdisc*, %struct.Qdisc*, %struct.Qdisc*, %struct.Qdisc*, i32, %struct.IO_APIC_reg_00, i32, %struct.IO_APIC_reg_00, %struct.IO_APIC_reg_00, i32, i32, void (%struct.net_device*)*, void (%struct.net_device*)*, i32 (%struct.net_device*)*, i32 (%struct.net_device*)*, i32 (%struct.sk_buff*, %struct.net_device*)*, i32 (%struct.net_device*, i32*)*, i32 (%struct.sk_buff*, %struct.net_device*, i16, i8*, i8*, i32)*, i32 (%struct.sk_buff*)*, void (%struct.net_device*)*, i32 (%struct.net_device*, i8*)*, i32 (%struct.net_device*, %struct.ifreq*, i32)*, i32 (%struct.net_device*, %struct.ifmap*)*, i32 (%struct.neighbour*, %struct.hh_cache*)*, void (%struct.hh_cache*, %struct.net_device*, i8*)*, i32 (%struct.net_device*, i32)*, void (%struct.net_device*)*, void (%struct.net_device*, %struct.vlan_group*)*, void (%struct.net_device*, i16)*, void (%struct.net_device*, i16)*, i32 (%struct.sk_buff*, i8*)*, i32 (%struct.net_device*, %struct.neigh_parms*)*, i32 (%struct.net_device*, %struct.dst_entry*)*, %struct.module*, %struct.net_bridge_port* }
- %struct.net_device_stats = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 }
- %struct.nf_conntrack = type { %struct.IO_APIC_reg_00, void (%struct.nf_conntrack*)* }
- %struct.nf_ct_info = type { %struct.nf_conntrack* }
- %struct.nfs_fh = type { i16, [64 x i8] }
- %struct.nfs_inode_info = type { i64, %struct.nfs_fh, i16, i32, i64, i64, i64, i32, i32, i32, [2 x i32], %struct.list_head, %struct.list_head, %struct.list_head, %struct.list_head, i32, i32, i32, i32, %struct.rpc_cred* }
- %struct.nfs_lock_info = type { i32, i32, %struct.nlm_host* }
- %struct.nlm_host = type opaque
- %struct.open_request = type { %struct.open_request*, i32, i32, i16, i16, i8, i8, i16, i32, i32, i32, i32, %struct.or_calltable*, %struct.sock*, { %struct.tcp_v4_open_req } }
- %struct.or_calltable = type { i32, i32 (%struct.sock*, %struct.open_request*, %struct.dst_entry*)*, void (%struct.sk_buff*, %struct.open_request*)*, void (%struct.open_request*)*, void (%struct.sk_buff*)* }
- %struct.page = type { %struct.list_head, %struct.address_space*, i32, %struct.page*, %struct.IO_APIC_reg_00, i32, %struct.list_head, %struct.page**, %struct.buffer_head* }
- %struct.pci_bus = type { %struct.list_head, %struct.pci_bus*, %struct.list_head, %struct.list_head, %struct.pci_dev*, [4 x %struct.resource*], %struct.pci_ops*, i8*, %struct.proc_dir_entry*, i8, i8, i8, i8, [48 x i8], i16, i16, i32, i8, i8, i8, i8 }
- %struct.pci_dev = type { %struct.list_head, %struct.list_head, %struct.pci_bus*, %struct.pci_bus*, i8*, %struct.proc_dir_entry*, i32, i16, i16, i16, i16, i32, i8, i8, %struct.pci_driver*, i8*, i64, i32, [4 x i16], [4 x i16], i32, [12 x %struct.resource], [2 x %struct.resource], [2 x %struct.resource], [90 x i8], [8 x i8], i32, i32, i16, i16, i32 (%struct.pci_dev*)*, i32 (%struct.pci_dev*)*, i32 (%struct.pci_dev*)* }
- %struct.pci_device_id = type { i32, i32, i32, i32, i32, i32, i32 }
- %struct.pci_driver = type { %struct.list_head, i8*, %struct.pci_device_id*, i32 (%struct.pci_dev*, %struct.pci_device_id*)*, void (%struct.pci_dev*)*, i32 (%struct.pci_dev*, i32)*, i32 (%struct.pci_dev*, i32)*, i32 (%struct.pci_dev*)*, i32 (%struct.pci_dev*, i32, i32)* }
- %struct.pci_ops = type { i32 (%struct.pci_dev*, i32, i8*)*, i32 (%struct.pci_dev*, i32, i16*)*, i32 (%struct.pci_dev*, i32, i32*)*, i32 (%struct.pci_dev*, i32, i8)*, i32 (%struct.pci_dev*, i32, i16)*, i32 (%struct.pci_dev*, i32, i32)* }
- %struct.pipe_inode_info = type { %struct.__wait_queue_head, i8*, i32, i32, i32, i32, i32, i32, i32, i32 }
- %struct.pneigh_entry = type { %struct.pneigh_entry*, %struct.net_device*, [0 x i8] }
- %struct.poll_table_entry = type { %struct.file*, %struct.__wait_queue, %struct.__wait_queue_head* }
- %struct.poll_table_page = type { %struct.poll_table_page*, %struct.poll_table_entry*, [0 x %struct.poll_table_entry] }
- %struct.poll_table_struct = type { i32, %struct.poll_table_page* }
- %struct.proc_dir_entry = type { i16, i16, i8*, i16, i16, i32, i32, i32, %struct.inode_operations*, %struct.file_operations*, i32 (i8*, i8**, i32, i32)*, %struct.module*, %struct.proc_dir_entry*, %struct.proc_dir_entry*, %struct.proc_dir_entry*, i8*, i32 (i8*, i8**, i32, i32, i32*, i8*)*, i32 (%struct.file*, i8*, i32, i8*)*, %struct.IO_APIC_reg_00, i32, i16 }
- %struct.proc_inode_info = type { %struct.task_struct*, i32, { i32 (%struct.task_struct*, i8*)* }, %struct.file* }
- %struct.proto = type { void (%struct.sock*, i32)*, i32 (%struct.sock*, %struct.sockaddr*, i32)*, i32 (%struct.sock*, i32)*, %struct.sock* (%struct.sock*, i32, i32*)*, i32 (%struct.sock*, i32, i32)*, i32 (%struct.sock*)*, i32 (%struct.sock*)*, void (%struct.sock*, i32)*, i32 (%struct.sock*, i32, i32, i8*, i32)*, i32 (%struct.sock*, i32, i32, i8*, i32*)*, i32 (%struct.sock*, %struct.msghdr*, i32)*, i32 (%struct.sock*, %struct.msghdr*, i32, i32, i32, i32*)*, i32 (%struct.sock*, %struct.sockaddr*, i32)*, i32 (%struct.sock*, %struct.sk_buff*)*, void (%struct.sock*)*, void (%struct.sock*)*, i32 (%struct.sock*, i16)*, [32 x i8], [32 x { i32, [28 x i8] }] }
- %struct.proto_ops = type { i32, i32 (%struct.socket*)*, i32 (%struct.socket*, %struct.sockaddr*, i32)*, i32 (%struct.socket*, %struct.sockaddr*, i32, i32)*, i32 (%struct.socket*, %struct.socket*)*, i32 (%struct.socket*, %struct.socket*, i32)*, i32 (%struct.socket*, %struct.sockaddr*, i32*, i32)*, i32 (%struct.file*, %struct.socket*, %struct.poll_table_struct*)*, i32 (%struct.socket*, i32, i32)*, i32 (%struct.socket*, i32)*, i32 (%struct.socket*, i32)*, i32 (%struct.socket*, i32, i32, i8*, i32)*, i32 (%struct.socket*, i32, i32, i8*, i32*)*, i32 (%struct.socket*, %struct.msghdr*, i32, %struct.scm_cookie*)*, i32 (%struct.socket*, %struct.msghdr*, i32, i32, %struct.scm_cookie*)*, i32 (%struct.file*, %struct.socket*, %struct.vm_area_struct*)*, i32 (%struct.socket*, %struct.page*, i32, i32, i32)* }
- %struct.pt_regs = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 }
- %struct.qdisc_walker = type { i32, i32, i32, i32 (%struct.Qdisc*, i32, %struct.qdisc_walker*)* }
- %struct.qstr = type { i8*, i32, i32 }
- %struct.quota_format_ops = type { i32 (%struct.super_block*, i32)*, i32 (%struct.super_block*, i32)*, i32 (%struct.super_block*, i32)*, i32 (%struct.super_block*, i32)*, i32 (%struct.dquot*)*, i32 (%struct.dquot*)* }
- %struct.quota_format_type = type { i32, %struct.quota_format_ops*, %struct.module*, %struct.quota_format_type* }
- %struct.quota_info = type { i32, %struct.semaphore, %struct.semaphore, [2 x %struct.file*], [2 x %struct.mem_dqinfo], [2 x %struct.quota_format_ops*] }
- %struct.quotactl_ops = type { i32 (%struct.super_block*, i32, i32, i8*)*, i32 (%struct.super_block*, i32)*, i32 (%struct.super_block*, i32)*, i32 (%struct.super_block*, i32, %struct.if_dqinfo*)*, i32 (%struct.super_block*, i32, %struct.if_dqinfo*)*, i32 (%struct.super_block*, i32, i32, %struct.if_dqblk*)*, i32 (%struct.super_block*, i32, i32, %struct.if_dqblk*)*, i32 (%struct.super_block*, %struct.fs_quota_stat*)*, i32 (%struct.super_block*, i32, i32)*, i32 (%struct.super_block*, i32, i32, %struct.fs_disk_quota*)*, i32 (%struct.super_block*, i32, i32, %struct.fs_disk_quota*)* }
- %struct.rb_node_s = type { %struct.rb_node_s*, i32, %struct.rb_node_s*, %struct.rb_node_s* }
- %struct.rb_root_s = type { %struct.rb_node_s* }
- %struct.resource = type { i8*, i32, i32, i32, %struct.resource*, %struct.resource*, %struct.resource* }
- %struct.revectored_struct = type { [8 x i32] }
- %struct.rpc_auth = type { [8 x %struct.rpc_cred*], i32, i32, i32, i32, i32, %struct.rpc_authops* }
- %struct.rpc_authops = type { i32, i8*, %struct.rpc_auth* (%struct.rpc_clnt*)*, void (%struct.rpc_auth*)*, %struct.rpc_cred* (i32)* }
- %struct.rpc_clnt = type { %struct.IO_APIC_reg_00, %struct.rpc_xprt*, %struct.rpc_procinfo*, i32, i8*, i8*, %struct.rpc_auth*, %struct.rpc_stat*, i32, i32, i32, %struct.rpc_rtt, %struct.msq_setbuf, %struct.rpc_wait_queue, i32, [32 x i8] }
- %struct.rpc_cred = type { %struct.rpc_cred*, %struct.rpc_auth*, %struct.rpc_credops*, i32, %struct.IO_APIC_reg_00, i16, i32, i32 }
- %struct.rpc_credops = type { void (%struct.rpc_cred*)*, i32 (%struct.rpc_cred*, i32)*, i32* (%struct.rpc_task*, i32*, i32)*, i32 (%struct.rpc_task*)*, i32* (%struct.rpc_task*, i32*)* }
- %struct.rpc_message = type { i32, i8*, i8*, %struct.rpc_cred* }
- %struct.rpc_procinfo = type { i8*, i32 (i8*, i32*, i8*)*, i32 (i8*, i32*, i8*)*, i32, i32, i32 }
- %struct.rpc_program = type { i8*, i32, i32, %struct.rpc_version**, %struct.rpc_stat* }
- %struct.rpc_rqst = type { %struct.rpc_xprt*, %struct.rpc_timeout, %struct.xdr_buf, %struct.xdr_buf, %struct.rpc_task*, i32, %struct.rpc_rqst*, i32, i32, %struct.list_head, %struct.xdr_buf, [2 x i32], i32, i32, i32, i32 }
- %struct.rpc_rtt = type { i32, [5 x i32], [5 x i32], %struct.IO_APIC_reg_00 }
- %struct.rpc_stat = type { %struct.rpc_program*, i32, i32, i32, i32, i32, i32, i32, i32, i32 }
- %struct.rpc_task = type { %struct.list_head, i32, %struct.list_head, %struct.rpc_clnt*, %struct.rpc_rqst*, i32, %struct.rpc_wait_queue*, %struct.rpc_message, i32*, i8, i8, i8, void (%struct.rpc_task*)*, void (%struct.rpc_task*)*, void (%struct.rpc_task*)*, void (%struct.rpc_task*)*, void (%struct.rpc_task*)*, i8*, %struct.timer_list, %struct.__wait_queue_head, i32, i16, i8, i32, i16 }
- %struct.rpc_timeout = type { i32, i32, i32, i32, i16, i8 }
- %struct.rpc_version = type { i32, i32, %struct.rpc_procinfo* }
- %struct.rpc_wait_queue = type { %struct.list_head, i8* }
- %struct.rpc_xprt = type { %struct.socket*, %struct.sock*, %struct.rpc_timeout, %struct.sockaddr_in, i32, i32, i32, i32, i32, %struct.rpc_wait_queue, %struct.rpc_wait_queue, %struct.rpc_wait_queue, %struct.rpc_wait_queue, %struct.rpc_rqst*, [16 x %struct.rpc_rqst], i32, i8, i32, i32, i32, i32, i32, i32, %struct.IO_APIC_reg_00, %struct.IO_APIC_reg_00, %struct.rpc_task*, %struct.list_head, void (%struct.sock*, i32)*, void (%struct.sock*)*, void (%struct.sock*)*, %struct.__wait_queue_head }
- %struct.rw_semaphore = type { i32, %struct.IO_APIC_reg_00, %struct.list_head }
- %struct.scm_cookie = type { %struct.ViceFid, %struct.scm_fp_list*, i32 }
- %struct.scm_fp_list = type { i32, [255 x %struct.file*] }
- %struct.sem_array = type { %struct.kern_ipc_perm, i32, i32, %struct._drm_i810_overlay_t*, %struct.sem_queue*, %struct.sem_queue**, %struct.sem_undo*, i32 }
- %struct.sem_queue = type { %struct.sem_queue*, %struct.sem_queue**, %struct.task_struct*, %struct.sem_undo*, i32, i32, %struct.sem_array*, i32, %struct.sembuf*, i32, i32 }
- %struct.sem_undo = type { %struct.sem_undo*, %struct.sem_undo*, i32, i16* }
- %struct.semaphore = type { %struct.IO_APIC_reg_00, i32, %struct.__wait_queue_head }
- %struct.sembuf = type { i16, i16, i16 }
- %struct.seq_file = type { i8*, i32, i32, i32, i64, %struct.semaphore, %struct.seq_operations*, i8* }
- %struct.seq_operations = type { i8* (%struct.seq_file*, i64*)*, void (%struct.seq_file*, i8*)*, i8* (%struct.seq_file*, i8*, i64*)*, i32 (%struct.seq_file*, i8*)* }
- %struct.shmem_inode_info = type { %struct.IO_APIC_reg_00, i32, [16 x %struct.IO_APIC_reg_00], i8**, i32, i32, %struct.list_head, %struct.inode* }
- %struct.sigaction = type { void (i32)*, i32, void ()*, %typedef.__kernel_fsid_t }
- %struct.siginfo = type { i32, i32, i32, { [29 x i32] } }
- %struct.signal_struct = type { %struct.IO_APIC_reg_00, [64 x %struct.k_sigaction], %struct.IO_APIC_reg_00 }
- %struct.sigpending = type { %struct.sigqueue*, %struct.sigqueue**, %typedef.__kernel_fsid_t }
- %struct.sigqueue = type { %struct.sigqueue*, %struct.siginfo }
- %struct.sk_buff = type { %struct.sk_buff*, %struct.sk_buff*, %struct.sk_buff_head*, %struct.sock*, %struct._drm_i810_overlay_t, %struct.net_device*, %struct.net_device*, { i8* }, { i8* }, { i8* }, %struct.dst_entry*, [48 x i8], i32, i32, i32, i8, i8, i8, i8, i32, %struct.IO_APIC_reg_00, i16, i16, i32, i8*, i8*, i8*, i8*, void (%struct.sk_buff*)*, i32, i32, %struct.nf_ct_info*, i32 }
- %struct.sk_buff_head = type { %struct.sk_buff*, %struct.sk_buff*, i32, %struct.IO_APIC_reg_00 }
- %struct.sock = type { i32, i32, i16, i16, i32, %struct.sock*, %struct.sock**, %struct.sock*, %struct.sock**, i8, i8, i16, i16, i8, i8, %struct.IO_APIC_reg_00, %struct.semaphore, i32, %struct.__wait_queue_head*, %struct.dst_entry*, %typedef.rwlock_t, %struct.IO_APIC_reg_00, %struct.sk_buff_head, %struct.IO_APIC_reg_00, %struct.sk_buff_head, %struct.IO_APIC_reg_00, i32, i32, i32, i32, i32, %struct.sock*, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i32, i32, i32, i32, %struct.sock*, { %struct.sk_buff*, %struct.sk_buff* }, %typedef.rwlock_t, %struct.sk_buff_head, %struct.proto*, { %struct.tcp_opt }, i32, i32, i16, i16, i32, i16, i8, i8, %struct.ViceFid, i32, i32, i32, { %struct.unix_opt }, %struct.timer_list, %struct._drm_i810_overlay_t, %struct.socket*, i8*, void (%struct.sock*)*, void (%struct.sock*, i32)*, void (%struct.sock*)*, void (%struct.sock*)*, i32 (%struct.sock*, %struct.sk_buff*)*, void (%struct.sock*)* }
- %struct.sockaddr = type { i16, [14 x i8] }
- %struct.sockaddr_in = type { i16, i16, %struct.IO_APIC_reg_00, [8 x i8] }
- %struct.sockaddr_un = type { i16, [108 x i8] }
- %struct.socket = type { i32, i32, %struct.proto_ops*, %struct.inode*, %struct.fasync_struct*, %struct.file*, %struct.sock*, %struct.__wait_queue_head, i16, i8 }
- %struct.statfs = type { i32, i32, i32, i32, i32, i32, i32, %typedef.__kernel_fsid_t, i32, [6 x i32] }
- %struct.super_block = type { %struct.list_head, i16, i32, i8, i8, i64, %struct.file_system_type*, %struct.super_operations*, %struct.dquot_operations*, %struct.quotactl_ops*, i32, i32, %struct.dentry*, %struct.rw_semaphore, %struct.semaphore, i32, %struct.IO_APIC_reg_00, %struct.list_head, %struct.list_head, %struct.list_head, %struct.block_device*, %struct.list_head, %struct.quota_info, { [115 x i32] }, %struct.semaphore, %struct.semaphore }
- %struct.super_operations = type { %struct.inode* (%struct.super_block*)*, void (%struct.inode*)*, void (%struct.inode*)*, void (%struct.inode*, i8*)*, void (%struct.inode*)*, void (%struct.inode*, i32)*, void (%struct.inode*)*, void (%struct.inode*)*, void (%struct.super_block*)*, void (%struct.super_block*)*, i32 (%struct.super_block*)*, void (%struct.super_block*)*, void (%struct.super_block*)*, i32 (%struct.super_block*, %struct.statfs*)*, i32 (%struct.super_block*, i32*, i8*)*, void (%struct.inode*)*, void (%struct.super_block*)*, %struct.dentry* (%struct.super_block*, i32*, i32, i32, i32)*, i32 (%struct.dentry*, i32*, i32*, i32)*, i32 (%struct.seq_file*, %struct.vfsmount*)* }
- %struct.task_struct = type { i32, i32, i32, %struct.IO_APIC_reg_00, %struct.exec_domain*, i32, i32, i32, i32, i32, i32, %struct.mm_struct*, i32, i32, i32, %struct.list_head, i32, %struct.task_struct*, %struct.task_struct*, %struct.mm_struct*, %struct.list_head, i32, i32, %struct.linux_binfmt*, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, %struct.task_struct*, %struct.task_struct*, %struct.task_struct*, %struct.task_struct*, %struct.task_struct*, %struct.list_head, %struct.task_struct*, %struct.task_struct**, %struct.__wait_queue_head, %struct.completion*, i32, i32, i32, i32, i32, i32, i32, %struct.timer_list, %struct.audio_buf_info, i32, [32 x i32], [32 x i32], i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, [32 x i32], i32, i32, i32, i32, %struct.user_struct*, [11 x %struct._drm_i810_overlay_t], i16, [16 x i8], i32, i32, %struct.tty_struct*, i32, %struct.sem_undo*, %struct.sem_queue*, %struct.thread_struct, %struct.fs_struct*, %struct.files_struct*, %struct.namespace*, %struct.IO_APIC_reg_00, %struct.signal_struct*, %typedef.__kernel_fsid_t, %struct.sigpending, i32, i32, i32 (i8*)*, i8*, %typedef.__kernel_fsid_t*, i32, i32, %struct.IO_APIC_reg_00, i8*, %struct.llva_sigcontext*, i32, %struct.task_struct*, i32, %typedef.llva_icontext_t, %typedef.llva_fp_state_t, i32*, i32, i8* }
- %struct.tasklet_struct = type { %struct.tasklet_struct*, i32, %struct.IO_APIC_reg_00, void (i32)*, i32 }
- %struct.tc_stats = type { i64, i32, i32, i32, i32, i32, i32, i32, %struct.IO_APIC_reg_00* }
- %struct.tcf_proto = type { %struct.tcf_proto*, i8*, i32 (%struct.sk_buff*, %struct.tcf_proto*, %struct._drm_i810_overlay_t*)*, i32, i32, i32, %struct.Qdisc*, i8*, %struct.tcf_proto_ops* }
- %struct.tcf_proto_ops = type { %struct.tcf_proto_ops*, [16 x i8], i32 (%struct.sk_buff*, %struct.tcf_proto*, %struct._drm_i810_overlay_t*)*, i32 (%struct.tcf_proto*)*, void (%struct.tcf_proto*)*, i32 (%struct.tcf_proto*, i32)*, void (%struct.tcf_proto*, i32)*, i32 (%struct.tcf_proto*, i32, i32, %struct._agp_version**, i32*)*, i32 (%struct.tcf_proto*, i32)*, void (%struct.tcf_proto*, %struct.tcf_walker*)*, i32 (%struct.tcf_proto*, i32, %struct.sk_buff*, %struct.tcmsg*)* }
- %struct.tcf_walker = type { i32, i32, i32, i32 (%struct.tcf_proto*, i32, %struct.tcf_walker*)* }
- %struct.tcmsg = type { i8, i8, i16, i32, i32, i32, i32 }
- %struct.tcp_func = type { i32 (%struct.sk_buff*)*, void (%struct.sock*, %struct.tcphdr*, i32, %struct.sk_buff*)*, i32 (%struct.sock*)*, i32 (%struct.sock*, %struct.sk_buff*)*, %struct.sock* (%struct.sock*, %struct.sk_buff*, %struct.open_request*, %struct.dst_entry*)*, i32 (%struct.sock*)*, i16, i32 (%struct.sock*, i32, i32, i8*, i32)*, i32 (%struct.sock*, i32, i32, i8*, i32*)*, void (%struct.sock*, %struct.sockaddr*)*, i32 }
- %struct.tcp_listen_opt = type { i8, i32, i32, i32, i32, [512 x %struct.open_request*] }
- %struct.tcp_opt = type { i32, i32, i32, i32, i32, i32, i32, i32, { i8, i8, i8, i8, i32, i32, i32, i16, i16 }, { %struct.sk_buff_head, %struct.task_struct*, %struct.iovec*, i32, i32 }, i32, i32, i32, i32, i16, i16, i16, i8, i8, i8, i8, i8, i8, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i16, i16, i32, i32, i32, %struct.timer_list, %struct.timer_list, %struct.sk_buff_head, %struct.tcp_func*, %struct.sk_buff*, %struct.page*, i32, i32, i32, i32, i32, i32, i8, i8, i8, i8, i8, i8, i8, i8, i32, i32, i32, i32, i16, i8, i8, [1 x %struct._drm_i810_overlay_t], [4 x %struct._drm_i810_overlay_t], i32, i32, i8, i8, i16, i8, i8, i16, i32, i32, i32, i32, i32, i32, i32, i32, i16, i8, i8, i32, %typedef.rwlock_t, %struct.tcp_listen_opt*, %struct.open_request*, %struct.open_request*, i32, i32, i32, i32, i32, i32, i32 }
- %struct.tcp_v4_open_req = type { i32, i32, %struct.ip_options* }
- %struct.tcphdr = type { i16, i16, i32, i32, i16, i16, i16, i16 }
- %struct.termios = type { i32, i32, i32, i32, i8, [19 x i8] }
- %struct.thread_struct = type { i32, i32, i32, i32, i32, [8 x i32], i32, i32, i32, %union.i387_union, %struct.vm86_struct*, i32, i32, i32, i32, i32, [33 x i32] }
- %struct.timer_list = type { %struct.list_head, i32, i32, void (i32)* }
- %struct.tq_struct = type { %struct.list_head, i32, void (i8*)*, i8* }
- %struct.tty_driver = type { i32, i8*, i8*, i32, i16, i16, i16, i16, i16, %struct.termios, i32, i32*, %struct.proc_dir_entry*, %struct.tty_driver*, %struct.tty_struct**, %struct.termios**, %struct.termios**, i8*, i32 (%struct.tty_struct*, %struct.file*)*, void (%struct.tty_struct*, %struct.file*)*, i32 (%struct.tty_struct*, i32, i8*, i32)*, void (%struct.tty_struct*, i8)*, void (%struct.tty_struct*)*, i32 (%struct.tty_struct*)*, i32 (%struct.tty_struct*)*, i32 (%struct.tty_struct*, %struct.file*, i32, i32)*, void (%struct.tty_struct*, %struct.termios*)*, void (%struct.tty_struct*)*, void (%struct.tty_struct*)*, void (%struct.tty_struct*)*, void (%struct.tty_struct*)*, void (%struct.tty_struct*)*, void (%struct.tty_struct*, i32)*, void (%struct.tty_struct*)*, void (%struct.tty_struct*)*, void (%struct.tty_struct*, i32)*, void (%struct.tty_struct*, i8)*, i32 (i8*, i8**, i32, i32, i32*, i8*)*, i32 (%struct.file*, i8*, i32, i8*)*, %struct.tty_driver*, %struct.tty_driver* }
- %struct.tty_flip_buffer = type { %struct.tq_struct, %struct.semaphore, i8*, i8*, i32, i32, [1024 x i8], [1024 x i8], [4 x i8] }
- %struct.tty_ldisc = type { i32, i8*, i32, i32, i32 (%struct.tty_struct*)*, void (%struct.tty_struct*)*, void (%struct.tty_struct*)*, i32 (%struct.tty_struct*)*, i32 (%struct.tty_struct*, %struct.file*, i8*, i32)*, i32 (%struct.tty_struct*, %struct.file*, i8*, i32)*, i32 (%struct.tty_struct*, %struct.file*, i32, i32)*, void (%struct.tty_struct*, %struct.termios*)*, i32 (%struct.tty_struct*, %struct.file*, %struct.poll_table_struct*)*, void (%struct.tty_struct*, i8*, i8*, i32)*, i32 (%struct.tty_struct*)*, void (%struct.tty_struct*)* }
- %struct.tty_struct = type { i32, %struct.tty_driver, %struct.tty_ldisc, %struct.termios*, %struct.termios*, i32, i32, i16, i32, i32, %struct.drm_clip_rect, i8, i8, %struct.tty_struct*, %struct.fasync_struct*, %struct.tty_flip_buffer, i32, i32, %struct.__wait_queue_head, %struct.__wait_queue_head, %struct.tq_struct, i8*, i8*, %struct.list_head, i32, i8, i16, i32, i32, [8 x i32], i8*, i32, i32, i32, [128 x i32], i32, i32, i32, %struct.semaphore, %struct.semaphore, %struct.IO_APIC_reg_00, %struct.tq_struct }
- %struct.unix_address = type { %struct.IO_APIC_reg_00, i32, i32, [0 x %struct.sockaddr_un] }
- %struct.unix_opt = type { %struct.unix_address*, %struct.dentry*, %struct.vfsmount*, %struct.semaphore, %struct.sock*, %struct.sock**, %struct.sock*, %struct.IO_APIC_reg_00, %typedef.rwlock_t, %struct.__wait_queue_head }
- %struct.usb_bus = type opaque
- %struct.usbdev_inode_info = type { %struct.list_head, %struct.list_head, { %struct.usb_bus* } }
- %struct.user_struct = type { %struct.IO_APIC_reg_00, %struct.IO_APIC_reg_00, %struct.IO_APIC_reg_00, %struct.user_struct*, %struct.user_struct**, i32 }
- %struct.vfsmount = type { %struct.list_head, %struct.vfsmount*, %struct.dentry*, %struct.dentry*, %struct.super_block*, %struct.list_head, %struct.list_head, %struct.IO_APIC_reg_00, i32, i8*, %struct.list_head }
- %struct.vlan_group = type opaque
- %struct.vm86_regs = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i16, i16, i32, i32, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16 }
- %struct.vm86_struct = type { %struct.vm86_regs, i32, i32, i32, %struct.revectored_struct, %struct.revectored_struct }
- %struct.vm_area_struct = type { %struct.mm_struct*, i32, i32, %struct.vm_area_struct*, %struct.IO_APIC_reg_00, i32, %struct.rb_node_s, %struct.vm_area_struct*, %struct.vm_area_struct**, %struct.vm_operations_struct*, i32, %struct.file*, i32, i8* }
- %struct.vm_operations_struct = type { void (%struct.vm_area_struct*)*, void (%struct.vm_area_struct*)*, %struct.page* (%struct.vm_area_struct*, i32, i32)* }
- %struct.xdr_buf = type { [1 x %struct.iovec], [1 x %struct.iovec], %struct.page**, i32, i32, i32 }
- %typedef.__kernel_fd_set = type { [32 x i32] }
- %typedef.__kernel_fsid_t = type { [2 x i32] }
- %typedef.dvd_authinfo = type { [2 x i64] }
- %typedef.llva_fp_state_t = type { [7 x i32], [20 x i32] }
- %typedef.llva_icontext_t = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32*, i32 }
- %typedef.rwlock_t = type { %struct.IO_APIC_reg_00, %struct.IO_APIC_reg_00, i32 }
- %typedef.sigset_t = type { [2 x i32] }
- %typedef.socket_lock_t = type { %struct.IO_APIC_reg_00, i32, %struct.__wait_queue_head }
- %union.i387_union = type { %struct.i387_fxsave_struct }
-
-define void @rs_init() {
-entry:
- br i1 false, label %loopentry.0.no_exit.0_crit_edge, label %loopentry.0.loopexit.0_crit_edge
-
-loopentry.0: ; No predecessors!
- unreachable
-
-loopentry.0.loopexit.0_crit_edge: ; preds = %entry
- br label %loopexit.0
-
-loopentry.0.no_exit.0_crit_edge: ; preds = %entry
- br label %no_exit.0
-
-no_exit.0: ; preds = %no_exit.0.no_exit.0_crit_edge, %loopentry.0.no_exit.0_crit_edge
- br i1 false, label %no_exit.0.no_exit.0_crit_edge, label %no_exit.0.loopexit.0_crit_edge
-
-no_exit.0.loopexit.0_crit_edge: ; preds = %no_exit.0
- br label %loopexit.0
-
-no_exit.0.no_exit.0_crit_edge: ; preds = %no_exit.0
- br label %no_exit.0
-
-loopexit.0: ; preds = %no_exit.0.loopexit.0_crit_edge, %loopentry.0.loopexit.0_crit_edge
- br i1 false, label %then.0, label %loopexit.0.endif.0_crit_edge
-
-loopexit.0.endif.0_crit_edge: ; preds = %loopexit.0
- br label %endif.0
-
-then.0: ; preds = %loopexit.0
- br i1 false, label %loopentry.1.no_exit.1_crit_edge, label %loopentry.1.loopexit.1_crit_edge
-
-loopentry.1: ; No predecessors!
- unreachable
-
-loopentry.1.loopexit.1_crit_edge: ; preds = %then.0
- br label %loopexit.1
-
-loopentry.1.no_exit.1_crit_edge: ; preds = %then.0
- br label %no_exit.1
-
-no_exit.1: ; preds = %no_exit.1.backedge, %loopentry.1.no_exit.1_crit_edge
- br i1 false, label %shortcirc_next.0, label %no_exit.1.shortcirc_done.0_crit_edge
-
-no_exit.1.shortcirc_done.0_crit_edge: ; preds = %no_exit.1
- br label %shortcirc_done.0
-
-shortcirc_next.0: ; preds = %no_exit.1
- br label %shortcirc_done.0
-
-shortcirc_done.0: ; preds = %shortcirc_next.0, %no_exit.1.shortcirc_done.0_crit_edge
- br i1 false, label %then.1, label %endif.1
-
-then.1: ; preds = %shortcirc_done.0
- br i1 false, label %then.1.no_exit.1_crit_edge, label %then.1.loopexit.1_crit_edge
-
-then.1.loopexit.1_crit_edge: ; preds = %then.1
- br label %loopexit.1
-
-then.1.no_exit.1_crit_edge: ; preds = %then.1
- br label %no_exit.1.backedge
-
-no_exit.1.backedge: ; preds = %endif.1.no_exit.1_crit_edge, %then.1.no_exit.1_crit_edge
- br label %no_exit.1
-
-endif.1: ; preds = %shortcirc_done.0
- br i1 false, label %endif.1.no_exit.1_crit_edge, label %endif.1.loopexit.1_crit_edge
-
-endif.1.loopexit.1_crit_edge: ; preds = %endif.1
- br label %loopexit.1
-
-endif.1.no_exit.1_crit_edge: ; preds = %endif.1
- br label %no_exit.1.backedge
-
-loopexit.1: ; preds = %endif.1.loopexit.1_crit_edge, %then.1.loopexit.1_crit_edge, %loopentry.1.loopexit.1_crit_edge
- br label %endif.0
-
-endif.0: ; preds = %loopexit.1, %loopexit.0.endif.0_crit_edge
- br i1 false, label %then.2, label %endif.0.endif.2_crit_edge
-
-endif.0.endif.2_crit_edge: ; preds = %endif.0
- br label %endif.2
-
-then.2: ; preds = %endif.0
- unreachable
-
-dead_block.0: ; No predecessors!
- br label %endif.2
-
-endif.2: ; preds = %dead_block.0, %endif.0.endif.2_crit_edge
- br i1 false, label %then.3, label %endif.2.endif.3_crit_edge
-
-endif.2.endif.3_crit_edge: ; preds = %endif.2
- br label %endif.3
-
-then.3: ; preds = %endif.2
- unreachable
-
-dead_block.1: ; No predecessors!
- br label %endif.3
-
-endif.3: ; preds = %dead_block.1, %endif.2.endif.3_crit_edge
- br label %loopentry.2
-
-loopentry.2: ; preds = %endif.6, %endif.3
- br i1 false, label %loopentry.2.no_exit.2_crit_edge, label %loopentry.2.loopexit.2_crit_edge
-
-loopentry.2.loopexit.2_crit_edge: ; preds = %loopentry.2
- br label %loopexit.2
-
-loopentry.2.no_exit.2_crit_edge: ; preds = %loopentry.2
- br label %no_exit.2
-
-no_exit.2: ; preds = %then.5.no_exit.2_crit_edge, %loopentry.2.no_exit.2_crit_edge
- br i1 false, label %then.4, label %no_exit.2.endif.4_crit_edge
-
-no_exit.2.endif.4_crit_edge: ; preds = %no_exit.2
- br label %endif.4
-
-then.4: ; preds = %no_exit.2
- br label %endif.4
-
-endif.4: ; preds = %then.4, %no_exit.2.endif.4_crit_edge
- br i1 false, label %shortcirc_next.1, label %endif.4.shortcirc_done.1_crit_edge
-
-endif.4.shortcirc_done.1_crit_edge: ; preds = %endif.4
- br label %shortcirc_done.1
-
-shortcirc_next.1: ; preds = %endif.4
- br i1 false, label %then.i21, label %endif.i
-
-then.i21: ; preds = %shortcirc_next.1
- br label %then.5
-
-then.i21.endif.5_crit_edge: ; No predecessors!
- unreachable
-
-then.i21.then.5_crit_edge: ; No predecessors!
- unreachable
-
-endif.i: ; preds = %shortcirc_next.1
- br label %shortcirc_done.1
-
-__check_region.exit: ; No predecessors!
- unreachable
-
-shortcirc_done.1: ; preds = %endif.i, %endif.4.shortcirc_done.1_crit_edge
- br i1 false, label %shortcirc_done.1.then.5_crit_edge, label %shortcirc_done.1.endif.5_crit_edge
-
-shortcirc_done.1.endif.5_crit_edge: ; preds = %shortcirc_done.1
- br label %endif.5
-
-shortcirc_done.1.then.5_crit_edge: ; preds = %shortcirc_done.1
- br label %then.5
-
-then.5: ; preds = %shortcirc_done.1.then.5_crit_edge, %then.i21
- br i1 false, label %then.5.no_exit.2_crit_edge, label %then.5.loopexit.2_crit_edge
-
-then.5.loopexit.2_crit_edge: ; preds = %then.5
- br label %loopexit.2
-
-then.5.no_exit.2_crit_edge: ; preds = %then.5
- br label %no_exit.2
-
-dead_block_after_continue.0: ; No predecessors!
- unreachable
-
-endif.5: ; preds = %shortcirc_done.1.endif.5_crit_edge
- br i1 false, label %then.6, label %endif.5.endif.6_crit_edge
-
-endif.5.endif.6_crit_edge: ; preds = %endif.5
- br label %endif.6
-
-then.6: ; preds = %endif.5
- br label %endif.6
-
-endif.6: ; preds = %then.6, %endif.5.endif.6_crit_edge
- br label %loopentry.2
-
-loopcont.2: ; No predecessors!
- unreachable
-
-loopexit.2: ; preds = %then.5.loopexit.2_crit_edge, %loopentry.2.loopexit.2_crit_edge
- br label %loopentry.3
-
-loopentry.3: ; preds = %endif.9, %loopexit.2
- br i1 false, label %loopentry.3.no_exit.3_crit_edge, label %loopentry.3.loopexit.3_crit_edge
-
-loopentry.3.loopexit.3_crit_edge: ; preds = %loopentry.3
- br label %loopexit.3
-
-loopentry.3.no_exit.3_crit_edge: ; preds = %loopentry.3
- br label %no_exit.3
-
-no_exit.3: ; preds = %then.7.no_exit.3_crit_edge, %loopentry.3.no_exit.3_crit_edge
- br i1 false, label %then.7, label %no_exit.3.endif.7_crit_edge
-
-no_exit.3.endif.7_crit_edge: ; preds = %no_exit.3
- br label %endif.7
-
-then.7: ; preds = %no_exit.3
- br i1 false, label %then.7.no_exit.3_crit_edge, label %then.7.loopexit.3_crit_edge
-
-then.7.loopexit.3_crit_edge: ; preds = %then.7
- br label %loopexit.3
-
-then.7.no_exit.3_crit_edge: ; preds = %then.7
- br label %no_exit.3
-
-dead_block_after_continue.1: ; No predecessors!
- unreachable
-
-endif.7: ; preds = %no_exit.3.endif.7_crit_edge
- br i1 false, label %shortcirc_next.2, label %endif.7.shortcirc_done.2_crit_edge
-
-endif.7.shortcirc_done.2_crit_edge: ; preds = %endif.7
- br label %shortcirc_done.2
-
-shortcirc_next.2: ; preds = %endif.7
- br label %shortcirc_done.2
-
-shortcirc_done.2: ; preds = %shortcirc_next.2, %endif.7.shortcirc_done.2_crit_edge
- br i1 false, label %shortcirc_next.3, label %shortcirc_done.2.shortcirc_done.3_crit_edge
-
-shortcirc_done.2.shortcirc_done.3_crit_edge: ; preds = %shortcirc_done.2
- br label %shortcirc_done.3
-
-shortcirc_next.3: ; preds = %shortcirc_done.2
- br i1 false, label %shortcirc_next.3.shortcirc_done.4_crit_edge, label %shortcirc_next.4
-
-shortcirc_next.3.shortcirc_done.4_crit_edge: ; preds = %shortcirc_next.3
- br label %shortcirc_done.4
-
-shortcirc_next.4: ; preds = %shortcirc_next.3
- br label %shortcirc_done.4
-
-shortcirc_done.4: ; preds = %shortcirc_next.4, %shortcirc_next.3.shortcirc_done.4_crit_edge
- br label %shortcirc_done.3
-
-shortcirc_done.3: ; preds = %shortcirc_done.4, %shortcirc_done.2.shortcirc_done.3_crit_edge
- br i1 false, label %then.8, label %shortcirc_done.3.endif.8_crit_edge
-
-shortcirc_done.3.endif.8_crit_edge: ; preds = %shortcirc_done.3
- br label %endif.8
-
-then.8: ; preds = %shortcirc_done.3
- br label %endif.8
-
-endif.8: ; preds = %then.8, %shortcirc_done.3.endif.8_crit_edge
- br i1 false, label %then.9, label %else
-
-then.9: ; preds = %endif.8
- br i1 false, label %cond_true.0, label %cond_false.0
-
-cond_true.0: ; preds = %then.9
- br label %cond_continue.0
-
-cond_false.0: ; preds = %then.9
- br label %cond_continue.0
-
-cond_continue.0: ; preds = %cond_false.0, %cond_true.0
- br label %endif.9
-
-else: ; preds = %endif.8
- br i1 false, label %cond_true.1, label %cond_false.1
-
-cond_true.1: ; preds = %else
- br label %cond_continue.1
-
-cond_false.1: ; preds = %else
- br label %cond_continue.1
-
-cond_continue.1: ; preds = %cond_false.1, %cond_true.1
- br label %endif.9
-
-endif.9: ; preds = %cond_continue.1, %cond_continue.0
- br label %loopentry.3
-
-loopcont.3: ; No predecessors!
- unreachable
-
-loopexit.3: ; preds = %then.7.loopexit.3_crit_edge, %loopentry.3.loopexit.3_crit_edge
- br i1 false, label %loopentry.i.i.i2.no_exit.i.i.i4_crit_edge, label %loopentry.i.i.i2.pci_register_driver.exit.i.i_crit_edge
-
-loopentry.i.i.i2: ; No predecessors!
- unreachable
-
-loopentry.i.i.i2.pci_register_driver.exit.i.i_crit_edge: ; preds = %loopexit.3
- br label %pci_register_driver.exit.i.i
-
-loopentry.i.i.i2.no_exit.i.i.i4_crit_edge: ; preds = %loopexit.3
- br label %no_exit.i.i.i4
-
-no_exit.i.i.i4: ; preds = %endif.i.i.i10.no_exit.i.i.i4_crit_edge, %loopentry.i.i.i2.no_exit.i.i.i4_crit_edge
- br i1 false, label %then.i.i.i6, label %no_exit.i.i.i4.endif.i.i.i10_crit_edge
-
-no_exit.i.i.i4.endif.i.i.i10_crit_edge: ; preds = %no_exit.i.i.i4
- br label %endif.i.i.i10
-
-then.i.i.i6: ; preds = %no_exit.i.i.i4
- br i1 false, label %then.0.i.i.i.i, label %else.i.i.i.i
-
-then.0.i.i.i.i: ; preds = %then.i.i.i6
- br i1 false, label %then.1.i.i.i.i, label %endif.1.i.i.i.i
-
-then.1.i.i.i.i: ; preds = %then.0.i.i.i.i
- br label %endif.i.i.i10
-
-endif.1.i.i.i.i: ; preds = %then.0.i.i.i.i
- br i1 false, label %endif.1.i.i.i.i.then.i.i.i.i.i.i_crit_edge, label %endif.1.i.i.i.i.endif.i.i.i.i.i.i_crit_edge
-
-endif.1.i.i.i.i.endif.i.i.i.i.i.i_crit_edge: ; preds = %endif.1.i.i.i.i
- br label %endif.i.i.i.i.i.i
-
-endif.1.i.i.i.i.then.i.i.i.i.i.i_crit_edge: ; preds = %endif.1.i.i.i.i
- br label %then.i.i.i.i.i.i
-
-else.i.i.i.i: ; preds = %then.i.i.i6
- br i1 false, label %endif.0.i.i.i.i.then.i.i.i.i.i.i_crit_edge, label %endif.0.i.i.i.i.endif.i.i.i.i.i.i_crit_edge
-
-endif.0.i.i.i.i: ; No predecessors!
- unreachable
-
-endif.0.i.i.i.i.endif.i.i.i.i.i.i_crit_edge: ; preds = %else.i.i.i.i
- br label %endif.i.i.i.i.i.i
-
-endif.0.i.i.i.i.then.i.i.i.i.i.i_crit_edge: ; preds = %else.i.i.i.i
- br label %then.i.i.i.i.i.i
-
-then.i.i.i.i.i.i: ; preds = %endif.0.i.i.i.i.then.i.i.i.i.i.i_crit_edge, %endif.1.i.i.i.i.then.i.i.i.i.i.i_crit_edge
- br i1 false, label %then.i.i.i.i.i.i.then.2.i.i.i.i_crit_edge, label %then.i.i.i.i.i.i.endif.2.i.i.i.i_crit_edge
-
-then.i.i.i.i.i.i.endif.2.i.i.i.i_crit_edge: ; preds = %then.i.i.i.i.i.i
- br label %endif.2.i.i.i.i
-
-then.i.i.i.i.i.i.then.2.i.i.i.i_crit_edge: ; preds = %then.i.i.i.i.i.i
- br label %then.2.i.i.i.i
-
-endif.i.i.i.i.i.i: ; preds = %endif.0.i.i.i.i.endif.i.i.i.i.i.i_crit_edge, %endif.1.i.i.i.i.endif.i.i.i.i.i.i_crit_edge
- br i1 false, label %dev_probe_lock.exit.i.i.i.i.then.2.i.i.i.i_crit_edge, label %dev_probe_lock.exit.i.i.i.i.endif.2.i.i.i.i_crit_edge
-
-dev_probe_lock.exit.i.i.i.i: ; No predecessors!
- unreachable
-
-dev_probe_lock.exit.i.i.i.i.endif.2.i.i.i.i_crit_edge: ; preds = %endif.i.i.i.i.i.i
- br label %endif.2.i.i.i.i
-
-dev_probe_lock.exit.i.i.i.i.then.2.i.i.i.i_crit_edge: ; preds = %endif.i.i.i.i.i.i
- br label %then.2.i.i.i.i
-
-then.2.i.i.i.i: ; preds = %dev_probe_lock.exit.i.i.i.i.then.2.i.i.i.i_crit_edge, %then.i.i.i.i.i.i.then.2.i.i.i.i_crit_edge
- br label %endif.2.i.i.i.i
-
-endif.2.i.i.i.i: ; preds = %then.2.i.i.i.i, %dev_probe_lock.exit.i.i.i.i.endif.2.i.i.i.i_crit_edge, %then.i.i.i.i.i.i.endif.2.i.i.i.i_crit_edge
- br i1 false, label %then.i.i2.i.i.i.i, label %endif.i.i3.i.i.i.i
-
-then.i.i2.i.i.i.i: ; preds = %endif.2.i.i.i.i
- br label %endif.i.i.i10
-
-endif.i.i3.i.i.i.i: ; preds = %endif.2.i.i.i.i
- br label %endif.i.i.i10
-
-dev_probe_unlock.exit.i.i.i.i: ; No predecessors!
- unreachable
-
-pci_announce_device.exit.i.i.i: ; No predecessors!
- unreachable
-
-endif.i.i.i10: ; preds = %endif.i.i3.i.i.i.i, %then.i.i2.i.i.i.i, %then.1.i.i.i.i, %no_exit.i.i.i4.endif.i.i.i10_crit_edge
- br i1 false, label %endif.i.i.i10.no_exit.i.i.i4_crit_edge, label %endif.i.i.i10.pci_register_driver.exit.i.i_crit_edge
-
-endif.i.i.i10.pci_register_driver.exit.i.i_crit_edge: ; preds = %endif.i.i.i10
- br label %pci_register_driver.exit.i.i
-
-endif.i.i.i10.no_exit.i.i.i4_crit_edge: ; preds = %endif.i.i.i10
- br label %no_exit.i.i.i4
-
-pci_register_driver.exit.i.i: ; preds = %endif.i.i.i10.pci_register_driver.exit.i.i_crit_edge, %loopentry.i.i.i2.pci_register_driver.exit.i.i_crit_edge
- br i1 false, label %then.0.i.i12, label %endif.0.i.i13
-
-then.0.i.i12: ; preds = %pci_register_driver.exit.i.i
- br label %probe_serial_pci.exit
-
-then.0.i.i12.probe_serial_pci.exit_crit_edge: ; No predecessors!
- unreachable
-
-then.0.i.i12.then.i_crit_edge: ; No predecessors!
- br label %then.i
-
-endif.0.i.i13: ; preds = %pci_register_driver.exit.i.i
- br i1 false, label %then.1.i.i14, label %endif.0.i.i13.endif.1.i.i15_crit_edge
-
-endif.0.i.i13.endif.1.i.i15_crit_edge: ; preds = %endif.0.i.i13
- br label %endif.1.i.i15
-
-then.1.i.i14: ; preds = %endif.0.i.i13
- br label %endif.1.i.i15
-
-endif.1.i.i15: ; preds = %then.1.i.i14, %endif.0.i.i13.endif.1.i.i15_crit_edge
- br i1 false, label %loopentry.i8.i.i.no_exit.i9.i.i_crit_edge, label %loopentry.i8.i.i.pci_unregister_driver.exit.i.i_crit_edge
-
-loopentry.i8.i.i: ; No predecessors!
- unreachable
-
-loopentry.i8.i.i.pci_unregister_driver.exit.i.i_crit_edge: ; preds = %endif.1.i.i15
- br label %pci_unregister_driver.exit.i.i
-
-loopentry.i8.i.i.no_exit.i9.i.i_crit_edge: ; preds = %endif.1.i.i15
- br label %no_exit.i9.i.i
-
-no_exit.i9.i.i: ; preds = %endif.0.i.i.i.no_exit.i9.i.i_crit_edge, %loopentry.i8.i.i.no_exit.i9.i.i_crit_edge
- br i1 false, label %then.0.i.i.i, label %no_exit.i9.i.i.endif.0.i.i.i_crit_edge
-
-no_exit.i9.i.i.endif.0.i.i.i_crit_edge: ; preds = %no_exit.i9.i.i
- br label %endif.0.i.i.i
-
-then.0.i.i.i: ; preds = %no_exit.i9.i.i
- br i1 false, label %then.1.i.i.i, label %then.0.i.i.i.endif.1.i.i.i_crit_edge
-
-then.0.i.i.i.endif.1.i.i.i_crit_edge: ; preds = %then.0.i.i.i
- br label %endif.1.i.i.i
-
-then.1.i.i.i: ; preds = %then.0.i.i.i
- br label %endif.1.i.i.i
-
-endif.1.i.i.i: ; preds = %then.1.i.i.i, %then.0.i.i.i.endif.1.i.i.i_crit_edge
- br label %endif.0.i.i.i
-
-endif.0.i.i.i: ; preds = %endif.1.i.i.i, %no_exit.i9.i.i.endif.0.i.i.i_crit_edge
- br i1 false, label %endif.0.i.i.i.no_exit.i9.i.i_crit_edge, label %endif.0.i.i.i.pci_unregister_driver.exit.i.i_crit_edge
-
-endif.0.i.i.i.pci_unregister_driver.exit.i.i_crit_edge: ; preds = %endif.0.i.i.i
- br label %pci_unregister_driver.exit.i.i
-
-endif.0.i.i.i.no_exit.i9.i.i_crit_edge: ; preds = %endif.0.i.i.i
- br label %no_exit.i9.i.i
-
-pci_unregister_driver.exit.i.i: ; preds = %endif.0.i.i.i.pci_unregister_driver.exit.i.i_crit_edge, %loopentry.i8.i.i.pci_unregister_driver.exit.i.i_crit_edge
- br i1 false, label %pci_module_init.exit.i.then.i_crit_edge, label %pci_module_init.exit.i.probe_serial_pci.exit_crit_edge
-
-pci_module_init.exit.i: ; No predecessors!
- unreachable
-
-pci_module_init.exit.i.probe_serial_pci.exit_crit_edge: ; preds = %pci_unregister_driver.exit.i.i
- br label %probe_serial_pci.exit
-
-pci_module_init.exit.i.then.i_crit_edge: ; preds = %pci_unregister_driver.exit.i.i
- br label %then.i
-
-then.i: ; preds = %pci_module_init.exit.i.then.i_crit_edge, %then.0.i.i12.then.i_crit_edge
- br label %probe_serial_pci.exit
-
-probe_serial_pci.exit: ; preds = %then.i, %pci_module_init.exit.i.probe_serial_pci.exit_crit_edge, %then.0.i.i12
- br i1 false, label %then.0.i, label %endif.0.i
-
-then.0.i: ; preds = %probe_serial_pci.exit
- ret void
-
-endif.0.i: ; preds = %probe_serial_pci.exit
- br i1 false, label %loopentry.0.i.no_exit.0.i_crit_edge, label %loopentry.0.i.loopexit.0.i_crit_edge
-
-loopentry.0.i: ; No predecessors!
- unreachable
-
-loopentry.0.i.loopexit.0.i_crit_edge: ; preds = %endif.0.i
- br label %loopexit.0.i
-
-loopentry.0.i.no_exit.0.i_crit_edge: ; preds = %endif.0.i
- br label %no_exit.0.i
-
-no_exit.0.i: ; preds = %loopcont.0.i.no_exit.0.i_crit_edge, %loopentry.0.i.no_exit.0.i_crit_edge
- br i1 false, label %then.1.i, label %endif.1.i
-
-then.1.i: ; preds = %no_exit.0.i
- br label %loopcont.0.i
-
-endif.1.i: ; preds = %no_exit.0.i
- br i1 false, label %loopentry.1.i.no_exit.1.i_crit_edge, label %loopentry.1.i.loopexit.1.i_crit_edge
-
-loopentry.1.i: ; No predecessors!
- unreachable
-
-loopentry.1.i.loopexit.1.i_crit_edge: ; preds = %endif.1.i
- br label %loopexit.1.i
-
-loopentry.1.i.no_exit.1.i_crit_edge: ; preds = %endif.1.i
- br label %no_exit.1.i
-
-no_exit.1.i: ; preds = %endif.2.i.no_exit.1.i_crit_edge, %loopentry.1.i.no_exit.1.i_crit_edge
- br i1 false, label %shortcirc_next.0.i, label %no_exit.1.i.shortcirc_done.0.i_crit_edge
-
-no_exit.1.i.shortcirc_done.0.i_crit_edge: ; preds = %no_exit.1.i
- br label %shortcirc_done.0.i
-
-shortcirc_next.0.i: ; preds = %no_exit.1.i
- br label %shortcirc_done.0.i
-
-shortcirc_done.0.i: ; preds = %shortcirc_next.0.i, %no_exit.1.i.shortcirc_done.0.i_crit_edge
- br i1 false, label %then.2.i, label %endif.2.i
-
-then.2.i: ; preds = %shortcirc_done.0.i
- br i1 false, label %then.2.i.then.3.i_crit_edge, label %then.2.i.else.i_crit_edge
-
-then.2.i.else.i_crit_edge: ; preds = %then.2.i
- br label %else.i
-
-then.2.i.then.3.i_crit_edge: ; preds = %then.2.i
- br label %then.3.i
-
-endif.2.i: ; preds = %shortcirc_done.0.i
- br i1 false, label %endif.2.i.no_exit.1.i_crit_edge, label %endif.2.i.loopexit.1.i_crit_edge
-
-endif.2.i.loopexit.1.i_crit_edge: ; preds = %endif.2.i
- br label %loopexit.1.i
-
-endif.2.i.no_exit.1.i_crit_edge: ; preds = %endif.2.i
- br label %no_exit.1.i
-
-loopexit.1.i: ; preds = %endif.2.i.loopexit.1.i_crit_edge, %loopentry.1.i.loopexit.1.i_crit_edge
- br i1 false, label %loopexit.1.i.then.3.i_crit_edge, label %loopexit.1.i.else.i_crit_edge
-
-loopexit.1.i.else.i_crit_edge: ; preds = %loopexit.1.i
- br label %else.i
-
-loopexit.1.i.then.3.i_crit_edge: ; preds = %loopexit.1.i
- br label %then.3.i
-
-then.3.i: ; preds = %loopexit.1.i.then.3.i_crit_edge, %then.2.i.then.3.i_crit_edge
- br i1 false, label %shortcirc_next.1.i, label %then.3.i.shortcirc_done.1.i_crit_edge
-
-then.3.i.shortcirc_done.1.i_crit_edge: ; preds = %then.3.i
- br label %shortcirc_done.1.i
-
-shortcirc_next.1.i: ; preds = %then.3.i
- br label %shortcirc_done.1.i
-
-shortcirc_done.1.i: ; preds = %shortcirc_next.1.i, %then.3.i.shortcirc_done.1.i_crit_edge
- br i1 false, label %then.4.i, label %endif.4.i
-
-then.4.i: ; preds = %shortcirc_done.1.i
- br label %endif.3.i
-
-endif.4.i: ; preds = %shortcirc_done.1.i
- br label %endif.3.i
-
-else.i: ; preds = %loopexit.1.i.else.i_crit_edge, %then.2.i.else.i_crit_edge
- br i1 false, label %shortcirc_next.0.i.i, label %else.i.shortcirc_done.0.i.i_crit_edge
-
-else.i.shortcirc_done.0.i.i_crit_edge: ; preds = %else.i
- br label %shortcirc_done.0.i.i
-
-shortcirc_next.0.i.i: ; preds = %else.i
- br label %shortcirc_done.0.i.i
-
-shortcirc_done.0.i.i: ; preds = %shortcirc_next.0.i.i, %else.i.shortcirc_done.0.i.i_crit_edge
- br i1 false, label %shortcirc_next.1.i.i, label %shortcirc_done.0.i.i.shortcirc_done.1.i.i_crit_edge
-
-shortcirc_done.0.i.i.shortcirc_done.1.i.i_crit_edge: ; preds = %shortcirc_done.0.i.i
- br label %shortcirc_done.1.i.i
-
-shortcirc_next.1.i.i: ; preds = %shortcirc_done.0.i.i
- br i1 false, label %loopentry.i.i2.i.no_exit.i.i3.i_crit_edge, label %loopentry.i.i2.i.loopexit.i.i.i_crit_edge
-
-loopentry.i.i2.i: ; No predecessors!
- unreachable
-
-loopentry.i.i2.i.loopexit.i.i.i_crit_edge: ; preds = %shortcirc_next.1.i.i
- br label %loopexit.i.i.i
-
-loopentry.i.i2.i.no_exit.i.i3.i_crit_edge: ; preds = %shortcirc_next.1.i.i
- br label %no_exit.i.i3.i
-
-no_exit.i.i3.i: ; preds = %endif.i.i.i.no_exit.i.i3.i_crit_edge, %loopentry.i.i2.i.no_exit.i.i3.i_crit_edge
- br i1 false, label %shortcirc_next.0.i.i.i, label %no_exit.i.i3.i.shortcirc_done.0.i.i.i_crit_edge
-
-no_exit.i.i3.i.shortcirc_done.0.i.i.i_crit_edge: ; preds = %no_exit.i.i3.i
- br label %shortcirc_done.0.i.i.i
-
-shortcirc_next.0.i.i.i: ; preds = %no_exit.i.i3.i
- br label %shortcirc_done.0.i.i.i
-
-shortcirc_done.0.i.i.i: ; preds = %shortcirc_next.0.i.i.i, %no_exit.i.i3.i.shortcirc_done.0.i.i.i_crit_edge
- br i1 false, label %shortcirc_next.1.i.i.i, label %shortcirc_done.0.i.i.i.shortcirc_done.1.i.i.i_crit_edge
-
-shortcirc_done.0.i.i.i.shortcirc_done.1.i.i.i_crit_edge: ; preds = %shortcirc_done.0.i.i.i
- br label %shortcirc_done.1.i.i.i
-
-shortcirc_next.1.i.i.i: ; preds = %shortcirc_done.0.i.i.i
- br label %shortcirc_done.1.i.i.i
-
-shortcirc_done.1.i.i.i: ; preds = %shortcirc_next.1.i.i.i, %shortcirc_done.0.i.i.i.shortcirc_done.1.i.i.i_crit_edge
- br i1 false, label %then.i.i.i, label %endif.i.i.i
-
-then.i.i.i: ; preds = %shortcirc_done.1.i.i.i
- br label %then.0.i.i
-
-then.i.i.i.endif.0.i.i_crit_edge: ; No predecessors!
- unreachable
-
-then.i.i.i.then.0.i.i_crit_edge: ; No predecessors!
- unreachable
-
-endif.i.i.i: ; preds = %shortcirc_done.1.i.i.i
- br i1 false, label %endif.i.i.i.no_exit.i.i3.i_crit_edge, label %endif.i.i.i.loopexit.i.i.i_crit_edge
-
-endif.i.i.i.loopexit.i.i.i_crit_edge: ; preds = %endif.i.i.i
- br label %loopexit.i.i.i
-
-endif.i.i.i.no_exit.i.i3.i_crit_edge: ; preds = %endif.i.i.i
- br label %no_exit.i.i3.i
-
-loopexit.i.i.i: ; preds = %endif.i.i.i.loopexit.i.i.i_crit_edge, %loopentry.i.i2.i.loopexit.i.i.i_crit_edge
- br label %shortcirc_done.1.i.i
-
-check_compatible_id.exit.i.i: ; No predecessors!
- unreachable
-
-shortcirc_done.1.i.i: ; preds = %loopexit.i.i.i, %shortcirc_done.0.i.i.shortcirc_done.1.i.i_crit_edge
- br i1 false, label %shortcirc_done.1.i.i.then.0.i.i_crit_edge, label %shortcirc_done.1.i.i.endif.0.i.i_crit_edge
-
-shortcirc_done.1.i.i.endif.0.i.i_crit_edge: ; preds = %shortcirc_done.1.i.i
- br label %endif.0.i.i
-
-shortcirc_done.1.i.i.then.0.i.i_crit_edge: ; preds = %shortcirc_done.1.i.i
- br label %then.0.i.i
-
-then.0.i.i: ; preds = %shortcirc_done.1.i.i.then.0.i.i_crit_edge, %then.i.i.i
- br label %then.5.i
-
-then.0.i.i.endif.5.i_crit_edge: ; No predecessors!
- unreachable
-
-then.0.i.i.then.5.i_crit_edge: ; No predecessors!
- unreachable
-
-endif.0.i.i: ; preds = %shortcirc_done.1.i.i.endif.0.i.i_crit_edge
- br i1 false, label %endif.0.i.i.shortcirc_done.2.i.i_crit_edge, label %shortcirc_next.2.i.i
-
-endif.0.i.i.shortcirc_done.2.i.i_crit_edge: ; preds = %endif.0.i.i
- br label %shortcirc_done.2.i.i
-
-shortcirc_next.2.i.i: ; preds = %endif.0.i.i
- br label %shortcirc_done.2.i.i
-
-shortcirc_done.2.i.i: ; preds = %shortcirc_next.2.i.i, %endif.0.i.i.shortcirc_done.2.i.i_crit_edge
- br i1 false, label %then.1.i.i, label %endif.1.i.i
-
-then.1.i.i: ; preds = %shortcirc_done.2.i.i
- br label %then.5.i
-
-then.1.i.i.endif.5.i_crit_edge: ; No predecessors!
- unreachable
-
-then.1.i.i.then.5.i_crit_edge: ; No predecessors!
- unreachable
-
-endif.1.i.i: ; preds = %shortcirc_done.2.i.i
- br i1 false, label %loopentry.0.i7.i.no_exit.0.i8.i_crit_edge, label %loopentry.0.i7.i.loopexit.0.i11.i_crit_edge
-
-loopentry.0.i7.i: ; No predecessors!
- unreachable
-
-loopentry.0.i7.i.loopexit.0.i11.i_crit_edge: ; preds = %endif.1.i.i
- br label %loopexit.0.i11.i
-
-loopentry.0.i7.i.no_exit.0.i8.i_crit_edge: ; preds = %endif.1.i.i
- br label %no_exit.0.i8.i
-
-no_exit.0.i8.i: ; preds = %loopexit.1.i.i.no_exit.0.i8.i_crit_edge, %loopentry.0.i7.i.no_exit.0.i8.i_crit_edge
- br i1 false, label %loopentry.1.i9.i.no_exit.1.i10.i_crit_edge, label %loopentry.1.i9.i.loopexit.1.i.i_crit_edge
-
-loopentry.1.i9.i: ; No predecessors!
- unreachable
-
-loopentry.1.i9.i.loopexit.1.i.i_crit_edge: ; preds = %no_exit.0.i8.i
- br label %loopexit.1.i.i
-
-loopentry.1.i9.i.no_exit.1.i10.i_crit_edge: ; preds = %no_exit.0.i8.i
- br label %no_exit.1.i10.i
-
-no_exit.1.i10.i: ; preds = %endif.2.i.i.no_exit.1.i10.i_crit_edge, %loopentry.1.i9.i.no_exit.1.i10.i_crit_edge
- br i1 false, label %shortcirc_next.3.i.i, label %no_exit.1.i10.i.shortcirc_done.3.i.i_crit_edge
-
-no_exit.1.i10.i.shortcirc_done.3.i.i_crit_edge: ; preds = %no_exit.1.i10.i
- br label %shortcirc_done.3.i.i
-
-shortcirc_next.3.i.i: ; preds = %no_exit.1.i10.i
- br i1 false, label %shortcirc_next.3.i.i.shortcirc_done.4.i.i_crit_edge, label %shortcirc_next.4.i.i
-
-shortcirc_next.3.i.i.shortcirc_done.4.i.i_crit_edge: ; preds = %shortcirc_next.3.i.i
- br label %shortcirc_done.4.i.i
-
-shortcirc_next.4.i.i: ; preds = %shortcirc_next.3.i.i
- br label %shortcirc_done.4.i.i
-
-shortcirc_done.4.i.i: ; preds = %shortcirc_next.4.i.i, %shortcirc_next.3.i.i.shortcirc_done.4.i.i_crit_edge
- br i1 false, label %shortcirc_done.4.i.i.shortcirc_done.5.i.i_crit_edge, label %shortcirc_next.5.i.i
-
-shortcirc_done.4.i.i.shortcirc_done.5.i.i_crit_edge: ; preds = %shortcirc_done.4.i.i
- br label %shortcirc_done.5.i.i
-
-shortcirc_next.5.i.i: ; preds = %shortcirc_done.4.i.i
- %tmp.68.i.i = icmp eq i16 0, 1000 ; <i1> [#uses=1]
- br label %shortcirc_done.5.i.i
-
-shortcirc_done.5.i.i: ; preds = %shortcirc_next.5.i.i, %shortcirc_done.4.i.i.shortcirc_done.5.i.i_crit_edge
- %shortcirc_val.4.i.i = phi i1 [ true, %shortcirc_done.4.i.i.shortcirc_done.5.i.i_crit_edge ], [ %tmp.68.i.i, %shortcirc_next.5.i.i ] ; <i1> [#uses=1]
- br label %shortcirc_done.3.i.i
-
-shortcirc_done.3.i.i: ; preds = %shortcirc_done.5.i.i, %no_exit.1.i10.i.shortcirc_done.3.i.i_crit_edge
- %shortcirc_val.5.i.i = phi i1 [ false, %no_exit.1.i10.i.shortcirc_done.3.i.i_crit_edge ], [ %shortcirc_val.4.i.i, %shortcirc_done.5.i.i ] ; <i1> [#uses=1]
- br i1 %shortcirc_val.5.i.i, label %then.2.i.i, label %endif.2.i.i
-
-then.2.i.i: ; preds = %shortcirc_done.3.i.i
- %port.2.i.i.8.lcssa20 = phi %struct.isapnp_port* [ null, %shortcirc_done.3.i.i ] ; <%struct.isapnp_port*> [#uses=0]
- br label %endif.5.i
-
-then.2.i.i.endif.5.i_crit_edge: ; No predecessors!
- unreachable
-
-then.2.i.i.then.5.i_crit_edge: ; No predecessors!
- unreachable
-
-endif.2.i.i: ; preds = %shortcirc_done.3.i.i
- br i1 false, label %endif.2.i.i.no_exit.1.i10.i_crit_edge, label %endif.2.i.i.loopexit.1.i.i_crit_edge
-
-endif.2.i.i.loopexit.1.i.i_crit_edge: ; preds = %endif.2.i.i
- br label %loopexit.1.i.i
-
-endif.2.i.i.no_exit.1.i10.i_crit_edge: ; preds = %endif.2.i.i
- br label %no_exit.1.i10.i
-
-loopexit.1.i.i: ; preds = %endif.2.i.i.loopexit.1.i.i_crit_edge, %loopentry.1.i9.i.loopexit.1.i.i_crit_edge
- br i1 false, label %loopexit.1.i.i.no_exit.0.i8.i_crit_edge, label %loopexit.1.i.i.loopexit.0.i11.i_crit_edge
-
-loopexit.1.i.i.loopexit.0.i11.i_crit_edge: ; preds = %loopexit.1.i.i
- br label %loopexit.0.i11.i
-
-loopexit.1.i.i.no_exit.0.i8.i_crit_edge: ; preds = %loopexit.1.i.i
- br label %no_exit.0.i8.i
-
-loopexit.0.i11.i: ; preds = %loopexit.1.i.i.loopexit.0.i11.i_crit_edge, %loopentry.0.i7.i.loopexit.0.i11.i_crit_edge
- br i1 false, label %serial_pnp_guess_board.exit.i.then.5.i_crit_edge, label %serial_pnp_guess_board.exit.i.endif.5.i_crit_edge
-
-serial_pnp_guess_board.exit.i: ; No predecessors!
- unreachable
-
-serial_pnp_guess_board.exit.i.endif.5.i_crit_edge: ; preds = %loopexit.0.i11.i
- br label %endif.5.i
-
-serial_pnp_guess_board.exit.i.then.5.i_crit_edge: ; preds = %loopexit.0.i11.i
- br label %then.5.i
-
-then.5.i: ; preds = %serial_pnp_guess_board.exit.i.then.5.i_crit_edge, %then.1.i.i, %then.0.i.i
- br label %loopcont.0.i
-
-endif.5.i: ; preds = %serial_pnp_guess_board.exit.i.endif.5.i_crit_edge, %then.2.i.i
- br label %endif.3.i
-
-endif.3.i: ; preds = %endif.5.i, %endif.4.i, %then.4.i
- br i1 false, label %then.6.i, label %endif.3.i.endif.6.i_crit_edge
-
-endif.3.i.endif.6.i_crit_edge: ; preds = %endif.3.i
- br label %endif.6.i
-
-then.6.i: ; preds = %endif.3.i
- br label %loopentry.0.i.i
-
-loopentry.0.i.i: ; preds = %endif.i.i, %then.6.i
- br i1 false, label %loopentry.0.i.i.no_exit.0.i.i_crit_edge, label %loopentry.0.i.i.loopexit.0.i.i_crit_edge
-
-loopentry.0.i.i.loopexit.0.i.i_crit_edge: ; preds = %loopentry.0.i.i
- br label %loopexit.0.i.i
-
-loopentry.0.i.i.no_exit.0.i.i_crit_edge: ; preds = %loopentry.0.i.i
- br label %no_exit.0.i.i
-
-no_exit.0.i.i: ; preds = %clear_bit195.exit.i.i.no_exit.0.i.i_crit_edge, %loopentry.0.i.i.no_exit.0.i.i_crit_edge
- br i1 false, label %then.i.i, label %endif.i.i
-
-then.i.i: ; preds = %no_exit.0.i.i
- br label %loopentry.i.i.i
-
-loopentry.i.i.i: ; preds = %no_exit.i.i.i, %then.i.i
- br i1 false, label %no_exit.i.i.i, label %clear_bit195.exit.i.i
-
-no_exit.i.i.i: ; preds = %loopentry.i.i.i
- br label %loopentry.i.i.i
-
-clear_bit195.exit.i.i: ; preds = %loopentry.i.i.i
- br i1 false, label %clear_bit195.exit.i.i.no_exit.0.i.i_crit_edge, label %clear_bit195.exit.i.i.loopexit.0.i.i_crit_edge
-
-clear_bit195.exit.i.i.loopexit.0.i.i_crit_edge: ; preds = %clear_bit195.exit.i.i
- br label %loopexit.0.i.i
-
-clear_bit195.exit.i.i.no_exit.0.i.i_crit_edge: ; preds = %clear_bit195.exit.i.i
- br label %no_exit.0.i.i
-
-endif.i.i: ; preds = %no_exit.0.i.i
- br label %loopentry.0.i.i
-
-loopexit.0.i.i: ; preds = %clear_bit195.exit.i.i.loopexit.0.i.i_crit_edge, %loopentry.0.i.i.loopexit.0.i.i_crit_edge
- br i1 false, label %loopentry.1.i.i.no_exit.1.i.i_crit_edge, label %loopentry.1.i.i.avoid_irq_share.exit.i_crit_edge
-
-loopentry.1.i.i: ; No predecessors!
- unreachable
-
-loopentry.1.i.i.avoid_irq_share.exit.i_crit_edge: ; preds = %loopexit.0.i.i
- br label %avoid_irq_share.exit.i
-
-loopentry.1.i.i.no_exit.1.i.i_crit_edge: ; preds = %loopexit.0.i.i
- br label %no_exit.1.i.i
-
-no_exit.1.i.i: ; preds = %loopexit.2.i.i.no_exit.1.i.i_crit_edge, %loopentry.1.i.i.no_exit.1.i.i_crit_edge
- br i1 false, label %loopentry.2.i.i.no_exit.2.i.i_crit_edge, label %loopentry.2.i.i.loopexit.2.i.i_crit_edge
-
-loopentry.2.i.i: ; No predecessors!
- unreachable
-
-loopentry.2.i.i.loopexit.2.i.i_crit_edge: ; preds = %no_exit.1.i.i
- br label %loopexit.2.i.i
-
-loopentry.2.i.i.no_exit.2.i.i_crit_edge: ; preds = %no_exit.1.i.i
- br label %no_exit.2.i.i
-
-no_exit.2.i.i: ; preds = %no_exit.2.i.i.no_exit.2.i.i_crit_edge, %loopentry.2.i.i.no_exit.2.i.i_crit_edge
- br i1 false, label %no_exit.2.i.i.no_exit.2.i.i_crit_edge, label %no_exit.2.i.i.loopexit.2.i.i_crit_edge
-
-no_exit.2.i.i.loopexit.2.i.i_crit_edge: ; preds = %no_exit.2.i.i
- br label %loopexit.2.i.i
-
-no_exit.2.i.i.no_exit.2.i.i_crit_edge: ; preds = %no_exit.2.i.i
- br label %no_exit.2.i.i
-
-loopexit.2.i.i: ; preds = %no_exit.2.i.i.loopexit.2.i.i_crit_edge, %loopentry.2.i.i.loopexit.2.i.i_crit_edge
- br i1 false, label %loopexit.2.i.i.no_exit.1.i.i_crit_edge, label %loopexit.2.i.i.avoid_irq_share.exit.i_crit_edge
-
-loopexit.2.i.i.avoid_irq_share.exit.i_crit_edge: ; preds = %loopexit.2.i.i
- br label %avoid_irq_share.exit.i
-
-loopexit.2.i.i.no_exit.1.i.i_crit_edge: ; preds = %loopexit.2.i.i
- br label %no_exit.1.i.i
-
-avoid_irq_share.exit.i: ; preds = %loopexit.2.i.i.avoid_irq_share.exit.i_crit_edge, %loopentry.1.i.i.avoid_irq_share.exit.i_crit_edge
- br label %endif.6.i
-
-endif.6.i: ; preds = %avoid_irq_share.exit.i, %endif.3.i.endif.6.i_crit_edge
- br label %loopcont.0.i
-
-loopcont.0.i: ; preds = %endif.6.i, %then.5.i, %then.1.i
- br i1 false, label %loopcont.0.i.no_exit.0.i_crit_edge, label %loopcont.0.i.loopexit.0.i_crit_edge
-
-loopcont.0.i.loopexit.0.i_crit_edge: ; preds = %loopcont.0.i
- br label %loopexit.0.i
-
-loopcont.0.i.no_exit.0.i_crit_edge: ; preds = %loopcont.0.i
- br label %no_exit.0.i
-
-loopexit.0.i: ; preds = %loopcont.0.i.loopexit.0.i_crit_edge, %loopentry.0.i.loopexit.0.i_crit_edge
- ret void
-
-probe_serial_pnp.exit: ; No predecessors!
- unreachable
-
-after_ret: ; No predecessors!
- ret void
-
-return: ; No predecessors!
- unreachable
-}
diff --git a/release_23/test/Transforms/CondProp/2007-08-01-InvalidRead.ll b/release_23/test/Transforms/CondProp/2007-08-01-InvalidRead.ll
deleted file mode 100644
index 1e1f8cbc63ff..000000000000
--- a/release_23/test/Transforms/CondProp/2007-08-01-InvalidRead.ll
+++ /dev/null
@@ -1,814 +0,0 @@
-; RUN: llvm-as < %s | opt -inline -tailduplicate -condprop -simplifycfg -disable-output
-; PR1575
-target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64"
-target triple = "i686-pc-linux-gnu"
- %struct.DCTtab = type { i8, i8, i8 }
- %struct.FILE = type { i32, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, %struct._IO_marker*, %struct.FILE*, i32, i32, i32, i16, i8, [1 x i8], i8*, i64, i8*, i8*, i8*, i8*, i32, i32, [40 x i8] }
- %struct.VLCtab = type { i8, i8 }
- %struct._IO_FILE = type { i32, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, %struct._IO_marker*, %struct.FILE*, i32, i32, i32, i16, i8, [1 x i8], i8*, i64, i8*, i8*, i8*, i8*, i32, i32, [40 x i8] }
- %struct._IO_marker = type { %struct._IO_marker*, %struct.FILE*, i32 }
- %struct.layer_data = type { i32, [2048 x i8], i8*, [16 x i8], i32, i8*, i32, i32, [64 x i32], [64 x i32], [64 x i32], [64 x i32], i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, [12 x [64 x i16]] }
-@ld = external global %struct.layer_data* ; <%struct.layer_data**> [#uses=1]
-@System_Stream_Flag = external global i32 ; <i32*> [#uses=0]
-@Fault_Flag = external global i32 ; <i32*> [#uses=2]
-@picture_coding_type = external global i32 ; <i32*> [#uses=1]
-@DCTtabnext = external global [12 x %struct.DCTtab] ; <[12 x %struct.DCTtab]*> [#uses=0]
-@DCTtab0 = external global [60 x %struct.DCTtab] ; <[60 x %struct.DCTtab]*> [#uses=0]
-@DCTtab1 = external global [8 x %struct.DCTtab] ; <[8 x %struct.DCTtab]*> [#uses=0]
-@DCTtab2 = external global [16 x %struct.DCTtab] ; <[16 x %struct.DCTtab]*> [#uses=0]
-@DCTtab3 = external global [16 x %struct.DCTtab] ; <[16 x %struct.DCTtab]*> [#uses=0]
-@DCTtab4 = external global [16 x %struct.DCTtab] ; <[16 x %struct.DCTtab]*> [#uses=0]
-@DCTtab5 = external global [16 x %struct.DCTtab] ; <[16 x %struct.DCTtab]*> [#uses=0]
-@DCTtab6 = external global [16 x %struct.DCTtab] ; <[16 x %struct.DCTtab]*> [#uses=0]
-@Quiet_Flag = external global i32 ; <i32*> [#uses=0]
-@.str = external constant [51 x i8] ; <[51 x i8]*> [#uses=0]
-@stderr = external global %struct.FILE* ; <%struct.FILE**> [#uses=0]
-@.str1 = external constant [43 x i8] ; <[43 x i8]*> [#uses=0]
-@scan = external global [2 x [64 x i8]] ; <[2 x [64 x i8]]*> [#uses=0]
-@DCTtabfirst = external global [12 x %struct.DCTtab] ; <[12 x %struct.DCTtab]*> [#uses=0]
-@.str2 = external constant [55 x i8] ; <[55 x i8]*> [#uses=0]
-@.str3 = external constant [43 x i8] ; <[43 x i8]*> [#uses=0]
-@base = external global %struct.layer_data ; <%struct.layer_data*> [#uses=1]
-@enhan = external global %struct.layer_data ; <%struct.layer_data*> [#uses=0]
-@chroma_format = external global i32 ; <i32*> [#uses=2]
-@intra_dc_precision = external global i32 ; <i32*> [#uses=0]
-@intra_vlc_format = external global i32 ; <i32*> [#uses=0]
-@DCTtab0a = external global [252 x %struct.DCTtab] ; <[252 x %struct.DCTtab]*> [#uses=0]
-@DCTtab1a = external global [8 x %struct.DCTtab] ; <[8 x %struct.DCTtab]*> [#uses=0]
-@.str4 = external constant [51 x i8] ; <[51 x i8]*> [#uses=0]
-@.str5 = external constant [45 x i8] ; <[45 x i8]*> [#uses=0]
-@.str6 = external constant [44 x i8] ; <[44 x i8]*> [#uses=0]
-@.str7 = external constant [55 x i8] ; <[55 x i8]*> [#uses=0]
-@.str8 = external constant [44 x i8] ; <[44 x i8]*> [#uses=0]
-@Temporal_Reference_Base = external global i32 ; <i32*> [#uses=0]
-@True_Framenum_max = external global i32 ; <i32*> [#uses=0]
-@Temporal_Reference_GOP_Reset.b = external global i1 ; <i1*> [#uses=0]
-@frame_rate_Table = external constant [16 x double] ; <[16 x double]*> [#uses=0]
-@.str9 = external constant [43 x i8] ; <[43 x i8]*> [#uses=0]
-@horizontal_size = external global i32 ; <i32*> [#uses=0]
-@vertical_size = external global i32 ; <i32*> [#uses=0]
-@aspect_ratio_information = external global i32 ; <i32*> [#uses=0]
-@frame_rate_code = external global i32 ; <i32*> [#uses=0]
-@bit_rate_value = external global i32 ; <i32*> [#uses=0]
-@.str110 = external constant [18 x i8] ; <[18 x i8]*> [#uses=0]
-@vbv_buffer_size = external global i32 ; <i32*> [#uses=0]
-@constrained_parameters_flag = external global i32 ; <i32*> [#uses=0]
-@default_intra_quantizer_matrix = external global [64 x i8] ; <[64 x i8]*> [#uses=0]
-@drop_flag = external global i32 ; <i32*> [#uses=0]
-@hour = external global i32 ; <i32*> [#uses=0]
-@minute = external global i32 ; <i32*> [#uses=0]
-@.str211 = external constant [27 x i8] ; <[27 x i8]*> [#uses=0]
-@sec = external global i32 ; <i32*> [#uses=0]
-@frame = external global i32 ; <i32*> [#uses=0]
-@closed_gop = external global i32 ; <i32*> [#uses=0]
-@broken_link = external global i32 ; <i32*> [#uses=0]
-@temporal_reference = external global i32 ; <i32*> [#uses=0]
-@vbv_delay = external global i32 ; <i32*> [#uses=0]
-@full_pel_forward_vector = external global i32 ; <i32*> [#uses=0]
-@forward_f_code = external global i32 ; <i32*> [#uses=0]
-@full_pel_backward_vector = external global i32 ; <i32*> [#uses=0]
-@backward_f_code = external global i32 ; <i32*> [#uses=1]
-@Non_Linear_quantizer_scale = external global [32 x i8] ; <[32 x i8]*> [#uses=0]
-@.str312 = external constant [37 x i8] ; <[37 x i8]*> [#uses=0]
-@layer_id = external global i32 ; <i32*> [#uses=0]
-@profile_and_level_indication = external global i32 ; <i32*> [#uses=0]
-@progressive_sequence = external global i32 ; <i32*> [#uses=0]
-@.str413 = external constant [19 x i8] ; <[19 x i8]*> [#uses=0]
-@low_delay = external global i32 ; <i32*> [#uses=0]
-@frame_rate_extension_n = external global i32 ; <i32*> [#uses=0]
-@frame_rate_extension_d = external global i32 ; <i32*> [#uses=0]
-@frame_rate = external global double ; <double*> [#uses=0]
-@profile = external global i32 ; <i32*> [#uses=0]
-@level = external global i32 ; <i32*> [#uses=0]
-@bit_rate = external global double ; <double*> [#uses=0]
-@video_format = external global i32 ; <i32*> [#uses=0]
-@color_description = external global i32 ; <i32*> [#uses=0]
-@color_primaries = external global i32 ; <i32*> [#uses=0]
-@transfer_characteristics = external global i32 ; <i32*> [#uses=0]
-@matrix_coefficients = external global i32 ; <i32*> [#uses=0]
-@display_horizontal_size = external global i32 ; <i32*> [#uses=0]
-@.str514 = external constant [27 x i8] ; <[27 x i8]*> [#uses=0]
-@display_vertical_size = external global i32 ; <i32*> [#uses=0]
-@lower_layer_prediction_horizontal_size = external global i32 ; <i32*> [#uses=0]
-@.str615 = external constant [30 x i8] ; <[30 x i8]*> [#uses=0]
-@lower_layer_prediction_vertical_size = external global i32 ; <i32*> [#uses=0]
-@horizontal_subsampling_factor_m = external global i32 ; <i32*> [#uses=0]
-@horizontal_subsampling_factor_n = external global i32 ; <i32*> [#uses=0]
-@vertical_subsampling_factor_m = external global i32 ; <i32*> [#uses=0]
-@vertical_subsampling_factor_n = external global i32 ; <i32*> [#uses=0]
-@.str716 = external constant [38 x i8] ; <[38 x i8]*> [#uses=0]
-@repeat_first_field = external global i32 ; <i32*> [#uses=0]
-@top_field_first = external global i32 ; <i32*> [#uses=0]
-@picture_structure = external global i32 ; <i32*> [#uses=0]
-@frame_center_horizontal_offset = external global [3 x i32] ; <[3 x i32]*> [#uses=0]
-@.str817 = external constant [44 x i8] ; <[44 x i8]*> [#uses=0]
-@frame_center_vertical_offset = external global [3 x i32] ; <[3 x i32]*> [#uses=0]
-@.str918 = external constant [45 x i8] ; <[45 x i8]*> [#uses=0]
-@f_code = external global [2 x [2 x i32]] ; <[2 x [2 x i32]]*> [#uses=0]
-@frame_pred_frame_dct = external global i32 ; <i32*> [#uses=0]
-@concealment_motion_vectors = external global i32 ; <i32*> [#uses=1]
-@chroma_420_type = external global i32 ; <i32*> [#uses=0]
-@progressive_frame = external global i32 ; <i32*> [#uses=0]
-@composite_display_flag = external global i32 ; <i32*> [#uses=0]
-@v_axis = external global i32 ; <i32*> [#uses=0]
-@field_sequence = external global i32 ; <i32*> [#uses=0]
-@sub_carrier = external global i32 ; <i32*> [#uses=0]
-@burst_amplitude = external global i32 ; <i32*> [#uses=0]
-@sub_carrier_phase = external global i32 ; <i32*> [#uses=0]
-@lower_layer_temporal_reference = external global i32 ; <i32*> [#uses=0]
-@.str10 = external constant [55 x i8] ; <[55 x i8]*> [#uses=0]
-@lower_layer_horizontal_offset = external global i32 ; <i32*> [#uses=0]
-@.str11 = external constant [56 x i8] ; <[56 x i8]*> [#uses=0]
-@lower_layer_vertical_offset = external global i32 ; <i32*> [#uses=0]
-@spatial_temporal_weight_code_table_index = external global i32 ; <i32*> [#uses=0]
-@lower_layer_progressive_frame = external global i32 ; <i32*> [#uses=0]
-@lower_layer_deinterlaced_field_select = external global i32 ; <i32*> [#uses=0]
-@.str12 = external constant [36 x i8] ; <[36 x i8]*> [#uses=0]
-@copyright_flag = external global i32 ; <i32*> [#uses=0]
-@copyright_identifier = external global i32 ; <i32*> [#uses=0]
-@original_or_copy = external global i32 ; <i32*> [#uses=0]
-@.str13 = external constant [40 x i8] ; <[40 x i8]*> [#uses=0]
-@copyright_number_1 = external global i32 ; <i32*> [#uses=0]
-@.str14 = external constant [41 x i8] ; <[41 x i8]*> [#uses=0]
-@copyright_number_2 = external global i32 ; <i32*> [#uses=0]
-@.str15 = external constant [40 x i8] ; <[40 x i8]*> [#uses=0]
-@copyright_number_3 = external global i32 ; <i32*> [#uses=0]
-@Verbose_Flag = external global i32 ; <i32*> [#uses=0]
-@.str16 = external constant [31 x i8] ; <[31 x i8]*> [#uses=0]
-@.str17 = external constant [22 x i8] ; <[22 x i8]*> [#uses=0]
-@.str18 = external constant [27 x i8] ; <[27 x i8]*> [#uses=0]
-@.str19 = external constant [46 x i8] ; <[46 x i8]*> [#uses=0]
-@.str20 = external constant [25 x i8] ; <[25 x i8]*> [#uses=0]
-@.str21 = external constant [25 x i8] ; <[25 x i8]*> [#uses=0]
-@.str22 = external constant [25 x i8] ; <[25 x i8]*> [#uses=0]
-@temporal_reference_old.2592 = external global i32 ; <i32*> [#uses=0]
-@temporal_reference_wrap.2591.b = external global i1 ; <i1*> [#uses=0]
-@True_Framenum = external global i32 ; <i32*> [#uses=0]
-@Second_Field = external global i32 ; <i32*> [#uses=0]
-@.str23 = external constant [29 x i8] ; <[29 x i8]*> [#uses=0]
-@Ersatz_Flag = external global i32 ; <i32*> [#uses=0]
-@mb_width = external global i32 ; <i32*> [#uses=0]
-@mb_height = external global i32 ; <i32*> [#uses=0]
-@Two_Streams = external global i32 ; <i32*> [#uses=0]
-@.str124 = external constant [32 x i8] ; <[32 x i8]*> [#uses=0]
-@stwc_table.2193 = external constant [3 x [4 x i8]] ; <[3 x [4 x i8]]*> [#uses=0]
-@stwclass_table.2194 = external constant [9 x i8] ; <[9 x i8]*> [#uses=0]
-@current_frame = external global [3 x i8*] ; <[3 x i8*]*> [#uses=0]
-@Coded_Picture_Width = external global i32 ; <i32*> [#uses=0]
-@Chroma_Width = external global i32 ; <i32*> [#uses=0]
-@Clip = external global i8* ; <i8**> [#uses=0]
-@.str225 = external constant [30 x i8] ; <[30 x i8]*> [#uses=0]
-@.str326 = external constant [27 x i8] ; <[27 x i8]*> [#uses=0]
-@block_count = external global i32 ; <i32*> [#uses=1]
-@auxframe = external global [3 x i8*] ; <[3 x i8*]*> [#uses=0]
-@forward_reference_frame = external global [3 x i8*] ; <[3 x i8*]*> [#uses=0]
-@backward_reference_frame = external global [3 x i8*] ; <[3 x i8*]*> [#uses=0]
-@.str427 = external constant [34 x i8] ; <[34 x i8]*> [#uses=0]
-@Newref_progressive_frame.2631 = external global i32 ; <i32*> [#uses=0]
-@Oldref_progressive_frame.2630 = external global i32 ; <i32*> [#uses=0]
-@Reference_IDCT_Flag = external global i32 ; <i32*> [#uses=0]
-@.str528 = external constant [43 x i8] ; <[43 x i8]*> [#uses=0]
-@.str629 = external constant [29 x i8] ; <[29 x i8]*> [#uses=0]
-@.str730 = external constant [38 x i8] ; <[38 x i8]*> [#uses=0]
-@.str831 = external constant [32 x i8] ; <[32 x i8]*> [#uses=0]
-@PMBtab0 = external constant [8 x %struct.VLCtab] ; <[8 x %struct.VLCtab]*> [#uses=0]
-@PMBtab1 = external constant [8 x %struct.VLCtab] ; <[8 x %struct.VLCtab]*> [#uses=0]
-@BMBtab0 = external constant [16 x %struct.VLCtab] ; <[16 x %struct.VLCtab]*> [#uses=0]
-@BMBtab1 = external constant [8 x %struct.VLCtab] ; <[8 x %struct.VLCtab]*> [#uses=0]
-@spIMBtab = external constant [16 x %struct.VLCtab] ; <[16 x %struct.VLCtab]*> [#uses=0]
-@spPMBtab0 = external constant [16 x %struct.VLCtab] ; <[16 x %struct.VLCtab]*> [#uses=0]
-@spPMBtab1 = external constant [16 x %struct.VLCtab] ; <[16 x %struct.VLCtab]*> [#uses=0]
-@spBMBtab0 = external constant [14 x %struct.VLCtab] ; <[14 x %struct.VLCtab]*> [#uses=0]
-@spBMBtab1 = external constant [12 x %struct.VLCtab] ; <[12 x %struct.VLCtab]*> [#uses=0]
-@spBMBtab2 = external constant [8 x %struct.VLCtab] ; <[8 x %struct.VLCtab]*> [#uses=0]
-@SNRMBtab = external constant [8 x %struct.VLCtab] ; <[8 x %struct.VLCtab]*> [#uses=0]
-@MVtab0 = external constant [8 x %struct.VLCtab] ; <[8 x %struct.VLCtab]*> [#uses=0]
-@MVtab1 = external constant [8 x %struct.VLCtab] ; <[8 x %struct.VLCtab]*> [#uses=0]
-@MVtab2 = external constant [12 x %struct.VLCtab] ; <[12 x %struct.VLCtab]*> [#uses=0]
-@CBPtab0 = external constant [32 x %struct.VLCtab] ; <[32 x %struct.VLCtab]*> [#uses=0]
-@CBPtab1 = external constant [64 x %struct.VLCtab] ; <[64 x %struct.VLCtab]*> [#uses=0]
-@CBPtab2 = external constant [8 x %struct.VLCtab] ; <[8 x %struct.VLCtab]*> [#uses=0]
-@MBAtab1 = external constant [16 x %struct.VLCtab] ; <[16 x %struct.VLCtab]*> [#uses=0]
-@MBAtab2 = external constant [104 x %struct.VLCtab] ; <[104 x %struct.VLCtab]*> [#uses=0]
-@DClumtab0 = external constant [32 x %struct.VLCtab] ; <[32 x %struct.VLCtab]*> [#uses=0]
-@DClumtab1 = external constant [16 x %struct.VLCtab] ; <[16 x %struct.VLCtab]*> [#uses=0]
-@DCchromtab0 = external constant [32 x %struct.VLCtab] ; <[32 x %struct.VLCtab]*> [#uses=0]
-@DCchromtab1 = external constant [32 x %struct.VLCtab] ; <[32 x %struct.VLCtab]*> [#uses=0]
-@.str32 = external constant [56 x i8] ; <[56 x i8]*> [#uses=0]
-@.str133 = external constant [29 x i8] ; <[29 x i8]*> [#uses=0]
-@global_pic = external global i32 ; <i32*> [#uses=0]
-@global_MBA = external global i32 ; <i32*> [#uses=0]
-@.str1648 = external constant [45 x i8] ; <[45 x i8]*> [#uses=0]
-@.str1749 = external constant [33 x i8] ; <[33 x i8]*> [#uses=0]
-@.str1850 = external constant [42 x i8] ; <[42 x i8]*> [#uses=0]
-@iclp = external global i16* ; <i16**> [#uses=0]
-@iclip = external global [1024 x i16] ; <[1024 x i16]*> [#uses=0]
-@c = external global [8 x [8 x double]] ; <[8 x [8 x double]]*> [#uses=0]
-@Version = external global [28 x i8] ; <[28 x i8]*> [#uses=0]
-@Author = external global [41 x i8] ; <[41 x i8]*> [#uses=0]
-@Inverse_Table_6_9 = external global [8 x [4 x i32]] ; <[8 x [4 x i32]]*> [#uses=0]
-@Main_Bitstream_Filename = external global i8* ; <i8**> [#uses=0]
-@.str51 = external constant [36 x i8] ; <[36 x i8]*> [#uses=0]
-@Error_Text = external global [256 x i8] ; <[256 x i8]*> [#uses=0]
-@.str152 = external constant [52 x i8] ; <[52 x i8]*> [#uses=0]
-@.str253 = external constant [33 x i8] ; <[33 x i8]*> [#uses=0]
-@Enhancement_Layer_Bitstream_Filename = external global i8* ; <i8**> [#uses=0]
-@.str354 = external constant [46 x i8] ; <[46 x i8]*> [#uses=0]
-@.str455 = external constant [22 x i8] ; <[22 x i8]*> [#uses=0]
-@.str556 = external constant [30 x i8] ; <[30 x i8]*> [#uses=0]
-@Coded_Picture_Height = external global i32 ; <i32*> [#uses=0]
-@Chroma_Height = external global i32 ; <i32*> [#uses=0]
-@Table_6_20.3737 = external constant [3 x i32] ; <[3 x i32]*> [#uses=0]
-@.str657 = external constant [42 x i8] ; <[42 x i8]*> [#uses=0]
-@.str758 = external constant [41 x i8] ; <[41 x i8]*> [#uses=0]
-@.str859 = external constant [26 x i8] ; <[26 x i8]*> [#uses=0]
-@substitute_frame = external global [3 x i8*] ; <[3 x i8*]*> [#uses=0]
-@.str960 = external constant [34 x i8] ; <[34 x i8]*> [#uses=0]
-@llframe0 = external global [3 x i8*] ; <[3 x i8*]*> [#uses=0]
-@.str1061 = external constant [24 x i8] ; <[24 x i8]*> [#uses=0]
-@llframe1 = external global [3 x i8*] ; <[3 x i8*]*> [#uses=0]
-@.str1162 = external constant [24 x i8] ; <[24 x i8]*> [#uses=0]
-@lltmp = external global i16* ; <i16**> [#uses=0]
-@.str1263 = external constant [21 x i8] ; <[21 x i8]*> [#uses=0]
-@.str1364 = external constant [3 x i8] ; <[3 x i8]*> [#uses=0]
-@.str1465 = external constant [9 x i8] ; <[9 x i8]*> [#uses=0]
-@.str1566 = external constant [1195 x i8] ; <[1195 x i8]*> [#uses=0]
-@Output_Type = external global i32 ; <i32*> [#uses=0]
-@Main_Bitstream_Flag = external global i32 ; <i32*> [#uses=0]
-@.str1667 = external constant [55 x i8] ; <[55 x i8]*> [#uses=0]
-@.str1768 = external constant [49 x i8] ; <[49 x i8]*> [#uses=0]
-@.str1869 = external constant [39 x i8] ; <[39 x i8]*> [#uses=0]
-@Frame_Store_Flag = external global i32 ; <i32*> [#uses=0]
-@Big_Picture_Flag = external global i32 ; <i32*> [#uses=0]
-@.str1970 = external constant [49 x i8] ; <[49 x i8]*> [#uses=0]
-@Spatial_Flag = external global i32 ; <i32*> [#uses=0]
-@.str2071 = external constant [39 x i8] ; <[39 x i8]*> [#uses=0]
-@Lower_Layer_Picture_Filename = external global i8* ; <i8**> [#uses=0]
-@Output_Picture_Filename = external global i8* ; <i8**> [#uses=0]
-@.str2172 = external constant [1 x i8] ; <[1 x i8]*> [#uses=0]
-@.str2273 = external constant [39 x i8] ; <[39 x i8]*> [#uses=0]
-@.str2374 = external constant [49 x i8] ; <[49 x i8]*> [#uses=0]
-@User_Data_Flag = external global i32 ; <i32*> [#uses=0]
-@.str24 = external constant [40 x i8] ; <[40 x i8]*> [#uses=0]
-@.str25 = external constant [39 x i8] ; <[39 x i8]*> [#uses=0]
-@Substitute_Picture_Filename = external global i8* ; <i8**> [#uses=0]
-@.str26 = external constant [47 x i8] ; <[47 x i8]*> [#uses=0]
-@.str27 = external constant [55 x i8] ; <[55 x i8]*> [#uses=0]
-@Display_Progressive_Flag = external global i32 ; <i32*> [#uses=0]
-@.str28 = external constant [21 x i8] ; <[21 x i8]*> [#uses=0]
-@.str29 = external constant [2 x i8] ; <[2 x i8]*> [#uses=0]
-@hiQdither = external global i32 ; <i32*> [#uses=0]
-@Trace_Flag = external global i32 ; <i32*> [#uses=0]
-@Verify_Flag = external global i32 ; <i32*> [#uses=0]
-@Stats_Flag = external global i32 ; <i32*> [#uses=0]
-@Decode_Layer = external global i32 ; <i32*> [#uses=0]
-@.str75 = external constant [20 x i8] ; <[20 x i8]*> [#uses=0]
-@C.53.2124 = external constant [3 x [3 x i8]] ; <[3 x [3 x i8]]*> [#uses=0]
-@.str76 = external constant [3 x i8] ; <[3 x i8]*> [#uses=0]
-@C.60.2169 = external constant [3 x [3 x i8]] ; <[3 x [3 x i8]]*> [#uses=0]
-@.str77 = external constant [5 x i8] ; <[5 x i8]*> [#uses=0]
-@.str178 = external constant [5 x i8] ; <[5 x i8]*> [#uses=0]
-@.str279 = external constant [5 x i8] ; <[5 x i8]*> [#uses=0]
-@.str380 = external constant [11 x i8] ; <[11 x i8]*> [#uses=0]
-@outfile = external global i32 ; <i32*> [#uses=0]
-@.str481 = external constant [20 x i8] ; <[20 x i8]*> [#uses=0]
-@optr = external global i8* ; <i8**> [#uses=0]
-@obfr = external global [4096 x i8] ; <[4096 x i8]*> [#uses=0]
-@.str582 = external constant [35 x i8] ; <[35 x i8]*> [#uses=0]
-@u422.3075 = external global i8* ; <i8**> [#uses=0]
-@v422.3076 = external global i8* ; <i8**> [#uses=0]
-@.str683 = external constant [14 x i8] ; <[14 x i8]*> [#uses=0]
-@.str784 = external constant [5 x i8] ; <[5 x i8]*> [#uses=0]
-@u444.3185 = external global i8* ; <i8**> [#uses=0]
-@v444.3186 = external global i8* ; <i8**> [#uses=0]
-@u422.3183 = external global i8* ; <i8**> [#uses=0]
-@v422.3184 = external global i8* ; <i8**> [#uses=0]
-@.str885 = external constant [5 x i8] ; <[5 x i8]*> [#uses=0]
-@.str986 = external constant [5 x i8] ; <[5 x i8]*> [#uses=0]
-@tga24.3181 = external constant [14 x i8] ; <[14 x i8]*> [#uses=0]
-@.str1087 = external constant [14 x i8] ; <[14 x i8]*> [#uses=0]
-@bgate.2952.b = external global i1 ; <i1*> [#uses=0]
-@previous_temporal_reference.2947 = external global i32 ; <i32*> [#uses=0]
-@previous_picture_coding_type.2951 = external global i32 ; <i32*> [#uses=0]
-@previous_anchor_temporal_reference.2949 = external global i32 ; <i32*> [#uses=0]
-@.str88 = external constant [40 x i8] ; <[40 x i8]*> [#uses=0]
-@.str189 = external constant [31 x i8] ; <[31 x i8]*> [#uses=0]
-@.str290 = external constant [5 x i8] ; <[5 x i8]*> [#uses=0]
-@.str391 = external constant [5 x i8] ; <[5 x i8]*> [#uses=0]
-@.str492 = external constant [5 x i8] ; <[5 x i8]*> [#uses=0]
-@.str593 = external constant [49 x i8] ; <[49 x i8]*> [#uses=0]
-@.str694 = external constant [3 x i8] ; <[3 x i8]*> [#uses=0]
-@.str795 = external constant [18 x i8] ; <[18 x i8]*> [#uses=0]
-@.str896 = external constant [42 x i8] ; <[42 x i8]*> [#uses=0]
-@.str97 = external constant [18 x i8] ; <[18 x i8]*> [#uses=0]
-@.str198 = external constant [24 x i8] ; <[24 x i8]*> [#uses=0]
-@.str299 = external constant [43 x i8] ; <[43 x i8]*> [#uses=0]
-
-declare void @Initialize_Buffer()
-
-declare void @Fill_Buffer()
-
-declare i32 @read(...)
-
-declare i32 @Get_Byte()
-
-declare i32 @Get_Word()
-
-declare i32 @Show_Bits(i32)
-
-declare i32 @Get_Bits1()
-
-declare void @Flush_Buffer(i32)
-
-declare void @Next_Packet()
-
-declare i32 @Get_Bits(i32)
-
-declare void @Decode_MPEG1_Intra_Block(i32, i32*)
-
-declare i32 @Get_Luma_DC_dct_diff()
-
-declare i32 @Get_Chroma_DC_dct_diff()
-
-declare i32 @puts(i8*)
-
-declare i32 @fwrite(i8*, i32, i32, i8*)
-
-declare void @Decode_MPEG1_Non_Intra_Block(i32)
-
-declare void @Decode_MPEG2_Intra_Block(i32, i32*)
-
-declare void @Decode_MPEG2_Non_Intra_Block(i32)
-
-declare i32 @Get_Hdr()
-
-declare i32 @Get_Bits32()
-
-declare i32 @fprintf(%struct.FILE*, i8*, ...)
-
-declare void @next_start_code()
-
-declare fastcc void @sequence_header()
-
-define internal fastcc void @group_of_pictures_header() {
-entry:
- ret void
-}
-
-define internal fastcc void @picture_header() {
-entry:
- unreachable
-}
-
-declare i32 @slice_header()
-
-declare fastcc void @extension_and_user_data()
-
-declare void @Flush_Buffer32()
-
-declare fastcc void @sequence_extension()
-
-declare fastcc void @sequence_display_extension()
-
-declare fastcc void @quant_matrix_extension()
-
-declare fastcc void @sequence_scalable_extension()
-
-declare void @Error(i8*)
-
-declare fastcc void @picture_display_extension()
-
-declare fastcc void @picture_coding_extension()
-
-declare fastcc void @picture_spatial_scalable_extension()
-
-declare fastcc void @picture_temporal_scalable_extension()
-
-declare fastcc void @extra_bit_information()
-
-declare void @marker_bit(i8*)
-
-declare fastcc void @user_data()
-
-declare fastcc void @copyright_extension()
-
-declare i32 @printf(i8*, ...)
-
-declare fastcc void @Update_Temporal_Reference_Tacking_Data()
-
-define void @Decode_Picture(i32 %bitstream_framenum, i32 %sequence_framenum) {
-entry:
- %tmp16 = icmp eq i32 0, 0 ; <i1> [#uses=1]
- br i1 %tmp16, label %bb43, label %bb22
-
-bb22: ; preds = %entry
- ret void
-
-bb43: ; preds = %entry
- call fastcc void @picture_data( )
- ret void
-}
-
-declare void @Substitute_Frame_Buffer(i32, i32)
-
-define void @Spatial_Prediction() {
-entry:
- ret void
-}
-
-define internal fastcc void @picture_data() {
-entry:
- %tmp4 = icmp eq i32 0, 3 ; <i1> [#uses=1]
- br i1 %tmp4, label %bb8, label %bb
-
-bb: ; preds = %entry
- ret void
-
-bb8: ; preds = %entry
- %tmp11 = call fastcc i32 @slice( i32 0 ) ; <i32> [#uses=0]
- ret void
-}
-
-define internal fastcc i32 @slice(i32 %MBAmax) {
-entry:
- %tmp6 = icmp eq i32 0, 1 ; <i1> [#uses=1]
- br i1 %tmp6, label %bb9, label %bb231
-
-bb9: ; preds = %entry
- %tmp11 = icmp eq i32 0, 0 ; <i1> [#uses=1]
- br i1 %tmp11, label %bb27, label %bb17
-
-bb17: ; preds = %bb9
- ret i32 0
-
-bb27: ; preds = %bb9
- %tmp31 = icmp slt i32 0, %MBAmax ; <i1> [#uses=1]
- br i1 %tmp31, label %bb110, label %bb231
-
-resync: ; preds = %bb139
- ret i32 0
-
-bb110: ; preds = %bb27
- %tmp113 = icmp slt i32 0, %MBAmax ; <i1> [#uses=1]
- br i1 %tmp113, label %bb131, label %bb119
-
-bb119: ; preds = %bb110
- ret i32 0
-
-bb131: ; preds = %bb110
- %tmp133 = icmp eq i32 0, 1 ; <i1> [#uses=1]
- br i1 %tmp133, label %bb139, label %bb166
-
-bb139: ; preds = %bb131
- %tmp144 = call fastcc i32 @decode_macroblock( i32* null, i32* null, i32* null, i32* null, i32* null, [2 x [2 x i32]]* null, i32* null, [2 x i32]* null, i32* null ) ; <i32> [#uses=1]
- switch i32 %tmp144, label %bb166 [
- i32 -1, label %bb231
- i32 0, label %resync
- ]
-
-bb166: ; preds = %bb139, %bb131
- ret i32 0
-
-bb231: ; preds = %bb139, %bb27, %entry
- ret i32 0
-}
-
-declare i32 @Get_macroblock_address_increment()
-
-declare fastcc void @macroblock_modes(i32*, i32*, i32*, i32*, i32*, i32*, i32*, i32*, i32*)
-
-declare i32 @Get_macroblock_type()
-
-declare fastcc void @Add_Block(i32, i32, i32, i32, i32)
-
-declare fastcc void @Decode_SNR_Macroblock(i32*, i32*, i32, i32, i32*)
-
-declare i32 @Get_coded_block_pattern()
-
-declare fastcc void @Clear_Block(i32)
-
-declare fastcc void @Sum_Block(i32)
-
-declare fastcc void @Saturate(i16*)
-
-declare fastcc void @Update_Picture_Buffers()
-
-declare void @Output_Last_Frame_of_Sequence(i32)
-
-declare void @Write_Frame(i8**, i32)
-
-declare fastcc void @frame_reorder(i32, i32)
-
-declare fastcc void @motion_compensation(i32, i32, i32, [2 x [2 x i32]]*, [2 x i32]*, i32*, i32, i32)
-
-declare void @form_predictions(i32, i32, i32, i32, [2 x [2 x i32]]*, [2 x i32]*, i32*, i32)
-
-declare void @Reference_IDCT(i16*)
-
-declare void @Fast_IDCT(i16*)
-
-declare fastcc void @skipped_macroblock(i32*, [2 x [2 x i32]]*, i32*, [2 x i32]*, i32*, i32*)
-
-declare fastcc i32 @start_of_slice(i32*, i32*, i32*, [2 x [2 x i32]]*)
-
-define internal fastcc i32 @decode_macroblock(i32* %macroblock_type, i32* %stwtype, i32* %stwclass, i32* %motion_type, i32* %dct_type, [2 x [2 x i32]]* %PMV, i32* %dc_dct_pred, [2 x i32]* %motion_vertical_field_select, i32* %dmvector) {
-entry:
- %tmp3 = icmp eq i32 0, 1 ; <i1> [#uses=1]
- br i1 %tmp3, label %bb, label %bb15
-
-bb: ; preds = %entry
- %tmp7 = icmp slt i32 0, 3 ; <i1> [#uses=1]
- br i1 %tmp7, label %bb13, label %bb14
-
-bb13: ; preds = %bb
- br label %bb15
-
-bb14: ; preds = %bb
- ret i32 0
-
-bb15: ; preds = %bb13, %entry
- %tmp21 = load i32* @Fault_Flag, align 4 ; <i32> [#uses=1]
- %tmp22 = icmp eq i32 %tmp21, 0 ; <i1> [#uses=1]
- br i1 %tmp22, label %bb29, label %bb630
-
-bb29: ; preds = %bb15
- %tmp33 = icmp eq i32 0, 0 ; <i1> [#uses=1]
- br i1 %tmp33, label %bb91, label %bb39
-
-bb39: ; preds = %bb29
- ret i32 0
-
-bb91: ; preds = %bb29
- %tmp94 = and i32 0, 8 ; <i32> [#uses=0]
- %tmp121 = load %struct.layer_data** @ld, align 4 ; <%struct.layer_data*> [#uses=0]
- %tmp123 = load i32* null ; <i32> [#uses=1]
- %tmp124 = icmp eq i32 %tmp123, 0 ; <i1> [#uses=1]
- br i1 %tmp124, label %bb146, label %bb130
-
-bb130: ; preds = %bb91
- call void @motion_vectors( [2 x [2 x i32]]* %PMV, i32* %dmvector, [2 x i32]* %motion_vertical_field_select, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0 )
- br label %bb157
-
-bb146: ; preds = %bb91
- br label %bb157
-
-bb157: ; preds = %bb146, %bb130
- %tmp159 = icmp eq i32 0, 0 ; <i1> [#uses=1]
- br i1 %tmp159, label %bb166, label %bb630
-
-bb166: ; preds = %bb157
- %tmp180 = icmp eq i32 0, 0 ; <i1> [#uses=1]
- br i1 %tmp180, label %bb201, label %bb186
-
-bb186: ; preds = %bb166
- br label %bb212
-
-bb201: ; preds = %bb166
- %tmp205 = load i32* @backward_f_code, align 4 ; <i32> [#uses=0]
- br label %bb212
-
-bb212: ; preds = %bb201, %bb186
- %tmp214 = icmp eq i32 0, 0 ; <i1> [#uses=1]
- br i1 %tmp214, label %bb221, label %bb630
-
-bb221: ; preds = %bb212
- %tmp22422511 = and i32 0, 1 ; <i32> [#uses=1]
- %toBool226 = icmp eq i32 %tmp22422511, 0 ; <i1> [#uses=1]
- br i1 %toBool226, label %bb239, label %bb230
-
-bb230: ; preds = %bb221
- ret i32 0
-
-bb239: ; preds = %bb221
- %tmp241 = load i32* getelementptr (%struct.layer_data* @base, i32 0, i32 17), align 4 ; <i32> [#uses=0]
- %tmp262 = icmp eq i32 0, 0 ; <i1> [#uses=1]
- br i1 %tmp262, label %bb296, label %bb268
-
-bb268: ; preds = %bb239
- %tmp270 = load i32* @chroma_format, align 4 ; <i32> [#uses=1]
- %tmp271 = icmp eq i32 %tmp270, 2 ; <i1> [#uses=1]
- br i1 %tmp271, label %bb277, label %bb282
-
-bb277: ; preds = %bb268
- br label %bb312
-
-bb282: ; preds = %bb268
- %tmp283 = load i32* @chroma_format, align 4 ; <i32> [#uses=0]
- br label %bb312
-
-bb296: ; preds = %bb239
- %tmp298 = load i32* %macroblock_type ; <i32> [#uses=1]
- %tmp2993009 = and i32 %tmp298, 1 ; <i32> [#uses=1]
- %toBool301 = icmp eq i32 %tmp2993009, 0 ; <i1> [#uses=1]
- br i1 %toBool301, label %bb312, label %bb305
-
-bb305: ; preds = %bb296
- %tmp306 = load i32* @block_count, align 4 ; <i32> [#uses=0]
- %tmp308 = add i32 0, -1 ; <i32> [#uses=0]
- br label %bb312
-
-bb312: ; preds = %bb305, %bb296, %bb282, %bb277
- %tmp313 = load i32* @Fault_Flag, align 4 ; <i32> [#uses=1]
- %tmp314 = icmp eq i32 %tmp313, 0 ; <i1> [#uses=1]
- br i1 %tmp314, label %bb398, label %bb630
-
-bb346: ; preds = %cond_true404
- %toBool351 = icmp eq i32 0, 0 ; <i1> [#uses=1]
- %tmp359 = icmp ne i32 0, 0 ; <i1> [#uses=2]
- br i1 %toBool351, label %bb372, label %bb355
-
-bb355: ; preds = %bb346
- br i1 %tmp359, label %bb365, label %bb368
-
-bb365: ; preds = %bb355
- br label %bb386
-
-bb368: ; preds = %bb355
- call void @Decode_MPEG1_Intra_Block( i32 0, i32* %dc_dct_pred )
- br label %bb386
-
-bb372: ; preds = %bb346
- br i1 %tmp359, label %bb382, label %bb384
-
-bb382: ; preds = %bb372
- br label %bb386
-
-bb384: ; preds = %bb372
- call void @Decode_MPEG1_Non_Intra_Block( i32 0 )
- br label %bb386
-
-bb386: ; preds = %bb384, %bb382, %bb368, %bb365
- %tmp388 = icmp eq i32 0, 0 ; <i1> [#uses=1]
- br i1 %tmp388, label %bb395, label %bb630
-
-bb395: ; preds = %cond_true404, %bb386
- %tmp397 = add i32 0, 1 ; <i32> [#uses=0]
- ret i32 0
-
-bb398: ; preds = %bb312
- %tmp401 = icmp slt i32 0, 0 ; <i1> [#uses=1]
- br i1 %tmp401, label %cond_true404, label %bb407
-
-cond_true404: ; preds = %bb398
- %tmp340341514 = and i32 0, 0 ; <i32> [#uses=1]
- %toBool342 = icmp eq i32 %tmp340341514, 0 ; <i1> [#uses=1]
- br i1 %toBool342, label %bb395, label %bb346
-
-bb407: ; preds = %bb398
- %tmp408 = load i32* @picture_coding_type, align 4 ; <i32> [#uses=0]
- %tmp419 = load i32* %macroblock_type ; <i32> [#uses=1]
- %tmp420 = and i32 %tmp419, 1 ; <i32> [#uses=1]
- %tmp421 = icmp eq i32 %tmp420, 0 ; <i1> [#uses=0]
- %tmp442 = load i32* %macroblock_type ; <i32> [#uses=1]
- %tmp4434447 = and i32 %tmp442, 1 ; <i32> [#uses=0]
- %tmp450 = load i32* @concealment_motion_vectors, align 4 ; <i32> [#uses=0]
- %tmp572 = icmp eq i32 0, 4 ; <i1> [#uses=1]
- br i1 %tmp572, label %bb578, label %bb630
-
-bb578: ; preds = %bb407
- %tmp613 = getelementptr [2 x [2 x i32]]* %PMV, i32 1, i32 1, i32 1 ; <i32*> [#uses=0]
- %tmp618 = getelementptr [2 x [2 x i32]]* %PMV, i32 1, i32 1, i32 0 ; <i32*> [#uses=0]
- %tmp623 = getelementptr [2 x [2 x i32]]* %PMV, i32 0, i32 1, i32 1 ; <i32*> [#uses=0]
- %tmp628 = getelementptr [2 x [2 x i32]]* %PMV, i32 0, i32 1, i32 0 ; <i32*> [#uses=0]
- ret i32 1
-
-bb630: ; preds = %bb407, %bb386, %bb312, %bb212, %bb157, %bb15
- %tmp.0 = phi i32 [ 0, %bb15 ], [ 0, %bb157 ], [ 0, %bb212 ], [ 0, %bb312 ], [ 0, %bb386 ], [ 1, %bb407 ] ; <i32> [#uses=1]
- ret i32 %tmp.0
-}
-
-declare void @motion_vectors([2 x [2 x i32]]*, i32*, [2 x i32]*, i32, i32, i32, i32, i32, i32, i32)
-
-declare void @motion_vector(i32*, i32*, i32, i32, i32, i32, i32)
-
-declare fastcc i32 @Get_I_macroblock_type()
-
-declare fastcc i32 @Get_P_macroblock_type()
-
-declare fastcc i32 @Get_B_macroblock_type()
-
-declare fastcc void @Get_D_macroblock_type()
-
-declare fastcc i32 @Get_I_Spatial_macroblock_type()
-
-declare fastcc i32 @Get_P_Spatial_macroblock_type()
-
-declare fastcc i32 @Get_B_Spatial_macroblock_type()
-
-declare fastcc i32 @Get_SNR_macroblock_type()
-
-declare i32 @Get_motion_code()
-
-declare i32 @Get_dmvector()
-
-declare fastcc void @idctrow(i16*)
-
-declare fastcc void @idctcol(i16*)
-
-declare void @Initialize_Fast_IDCT()
-
-declare void @Initialize_Reference_IDCT()
-
-declare double @cos(double)
-
-declare double @floor(double)
-
-declare fastcc void @decode_motion_vector(i32*, i32, i32, i32, i32)
-
-declare void @Dual_Prime_Arithmetic([2 x i32]*, i32*, i32, i32)
-
-declare i32 @main(i32, i8**)
-
-declare i32 @open(i8*, i32, ...)
-
-declare void @exit(i32)
-
-declare void @llvm.memcpy.i32(i8*, i8*, i32, i32)
-
-declare i32 @lseek(i32, i32, i32)
-
-declare i32 @sprintf(i8*, i8*, ...)
-
-declare i32 @close(i32)
-
-declare fastcc void @Initialize_Decoder()
-
-declare fastcc void @Initialize_Sequence()
-
-declare void @Print_Bits(i32, i32, i32)
-
-declare fastcc void @Process_Options(i32, i8**)
-
-declare i32 @toupper(i32)
-
-declare i32 @atoi(i8*)
-
-declare fastcc i32 @Headers()
-
-declare fastcc void @Decode_Bitstream()
-
-declare fastcc void @Deinitialize_Sequence()
-
-declare fastcc i32 @video_sequence(i32*)
-
-declare void @Clear_Options()
-
-declare fastcc void @form_prediction(i8**, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32)
-
-declare fastcc void @form_component_prediction(i8*, i8*, i32, i32, i32, i32, i32, i32, i32, i32, i32)
-
-declare fastcc void @Read_Lower_Layer_Component_Framewise(i32, i32, i32)
-
-declare i8* @strcat(i8*, i8*)
-
-declare %struct.FILE* @fopen(i8*, i8*)
-
-declare i32 @_IO_getc(%struct.FILE*)
-
-declare i32 @fclose(%struct.FILE*)
-
-declare fastcc void @Read_Lower_Layer_Component_Fieldwise(i32, i32, i32)
-
-declare fastcc void @Make_Spatial_Prediction_Frame(i32, i32, i8*, i8*, i16*, i8*, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32)
-
-declare fastcc void @Deinterlace(i8*, i8*, i32, i32, i32, i32)
-
-declare fastcc void @Subsample_Vertical(i8*, i16*, i32, i32, i32, i32, i32, i32, i32)
-
-declare fastcc void @Subsample_Horizontal(i16*, i8*, i32, i32, i32, i32, i32, i32, i32)
-
-declare fastcc void @store_one(i8*, i8**, i32, i32, i32)
-
-declare fastcc void @store_yuv(i8*, i8**, i32, i32, i32)
-
-declare fastcc void @store_yuv1(i8*, i8*, i32, i32, i32, i32)
-
-declare i32 @write(...)
-
-declare fastcc void @store_sif(i8*, i8**, i32, i32, i32)
-
-declare fastcc void @store_ppm_tga(i8*, i8**, i32, i32, i32, i32)
-
-declare fastcc void @putbyte(i32)
-
-declare fastcc void @putword(i32)
-
-declare fastcc void @conv422to444(i8*, i8*)
-
-declare fastcc void @conv420to422(i8*, i8*)
-
-declare fastcc void @Read_Frame(i8*, i8**, i32)
-
-declare fastcc i32 @Read_Components(i8*, i32)
-
-declare fastcc void @Read_Component(i8*, i8*, i32, i32)
-
-declare fastcc i32 @Extract_Components(i8*, i32)
-
-declare i32 @fseek(%struct.FILE*, i32, i32)
-
-declare i32 @fread(i8*, i32, i32, %struct.FILE*)
-
-declare fastcc void @Copy_Frame(i8*, i8*, i32, i32, i32, i32)
-
-declare i32 @Get_Long()
diff --git a/release_23/test/Transforms/CondProp/basictest.ll b/release_23/test/Transforms/CondProp/basictest.ll
deleted file mode 100644
index eda104d32839..000000000000
--- a/release_23/test/Transforms/CondProp/basictest.ll
+++ /dev/null
@@ -1,27 +0,0 @@
-; RUN: llvm-as < %s | opt -condprop | llvm-dis | \
-; RUN: not grep {br label}
-
-
-define i32 @test(i1 %C) {
- br i1 %C, label %T1, label %F1
-
-T1: ; preds = %0
- br label %Cont
-
-F1: ; preds = %0
- br label %Cont
-
-Cont: ; preds = %F1, %T1
- %C2 = phi i1 [ false, %F1 ], [ true, %T1 ] ; <i1> [#uses=1]
- br i1 %C2, label %T2, label %F2
-
-T2: ; preds = %Cont
- call void @bar( )
- ret i32 17
-
-F2: ; preds = %Cont
- ret i32 1
-}
-
-declare void @bar()
-
diff --git a/release_23/test/Transforms/CondProp/dg.exp b/release_23/test/Transforms/CondProp/dg.exp
deleted file mode 100644
index 39954d8a498d..000000000000
--- a/release_23/test/Transforms/CondProp/dg.exp
+++ /dev/null
@@ -1,3 +0,0 @@
-load_lib llvm.exp
-
-RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll}]]
diff --git a/release_23/test/Transforms/CondProp/phisimplify.ll b/release_23/test/Transforms/CondProp/phisimplify.ll
deleted file mode 100644
index 5b5a3042eb62..000000000000
--- a/release_23/test/Transforms/CondProp/phisimplify.ll
+++ /dev/null
@@ -1,43 +0,0 @@
-; RUN: llvm-as < %s | opt -condprop | llvm-dis | not grep phi
-
-define i32 @test(i32 %C, i1 %Val) {
- switch i32 %C, label %T1 [
- i32 4, label %T2
- i32 17, label %T3
- ]
-
-T1: ; preds = %0
- call void @a( )
- br label %Cont
-
-T2: ; preds = %0
- call void @b( )
- br label %Cont
-
-T3: ; preds = %0
- call void @c( )
- br label %Cont
-
-Cont: ; preds = %T3, %T2, %T1
- ;; PHI becomes dead after threading T2
- %C2 = phi i1 [ %Val, %T1 ], [ true, %T2 ], [ %Val, %T3 ] ; <i1> [#uses=1]
- br i1 %C2, label %L2, label %F2
-
-L2: ; preds = %Cont
- call void @d( )
- ret i32 17
-
-F2: ; preds = %Cont
- call void @e( )
- ret i32 1
-}
-
-declare void @a()
-
-declare void @b()
-
-declare void @c()
-
-declare void @d()
-
-declare void @e()
diff --git a/release_23/test/Transforms/CondProp/phisimplify2.ll b/release_23/test/Transforms/CondProp/phisimplify2.ll
deleted file mode 100644
index 03d12e3e4c97..000000000000
--- a/release_23/test/Transforms/CondProp/phisimplify2.ll
+++ /dev/null
@@ -1,46 +0,0 @@
-; RUN: llvm-as < %s | opt -condprop | llvm-dis | not grep phi
-
-declare i1 @foo()
-
-define i32 @test(i32 %C) {
- %Val = call i1 @foo( ) ; <i1> [#uses=2]
- switch i32 %C, label %T1 [
- i32 4, label %T2
- i32 17, label %T3
- ]
-
-T1: ; preds = %0
- call void @a( )
- br label %Cont
-
-T2: ; preds = %0
- call void @b( )
- br label %Cont
-
-T3: ; preds = %0
- call void @c( )
- br label %Cont
-
-Cont: ; preds = %T3, %T2, %T1
- ;; PHI becomes dead after threading T2
- %C2 = phi i1 [ %Val, %T1 ], [ true, %T2 ], [ %Val, %T3 ] ; <i1> [#uses=1]
- br i1 %C2, label %L2, label %F2
-
-L2: ; preds = %Cont
- call void @d( )
- ret i32 17
-
-F2: ; preds = %Cont
- call void @e( )
- ret i32 1
-}
-
-declare void @a()
-
-declare void @b()
-
-declare void @c()
-
-declare void @d()
-
-declare void @e()
diff --git a/release_23/test/Transforms/ConstProp/2002-05-03-DivideByZeroException.ll b/release_23/test/Transforms/ConstProp/2002-05-03-DivideByZeroException.ll
deleted file mode 100644
index 1a0845c52ac0..000000000000
--- a/release_23/test/Transforms/ConstProp/2002-05-03-DivideByZeroException.ll
+++ /dev/null
@@ -1,15 +0,0 @@
-; Make sure that the constant propogator doesn't divide by zero!
-;
-; RUN: llvm-as < %s | opt -constprop
-;
-
-define i32 @test() {
- %R = sdiv i32 12, 0 ; <i32> [#uses=1]
- ret i32 %R
-}
-
-define i32 @test2() {
- %R = srem i32 12, 0 ; <i32> [#uses=1]
- ret i32 %R
-}
-
diff --git a/release_23/test/Transforms/ConstProp/2002-05-03-NotOperator.ll b/release_23/test/Transforms/ConstProp/2002-05-03-NotOperator.ll
deleted file mode 100644
index 7a281aa04b67..000000000000
--- a/release_23/test/Transforms/ConstProp/2002-05-03-NotOperator.ll
+++ /dev/null
@@ -1,19 +0,0 @@
-; This bug has to do with the fact that constant propogation was implemented in
-; terms of _logical_ not (! in C) instead of _bitwise_ not (~ in C). This was
-; due to a spec change.
-
-; Fix #2: The unary not instruction now no longer exists. Change to xor.
-
-; RUN: llvm-as < $test | opt -constprop | llvm-dis | \
-; RUN: not grep {i32 0}
-
-define i32 @test1() {
- %R = xor i32 123, -1 ; <i32> [#uses=1]
- ret i32 %R
-}
-
-define i32 @test2() {
- %R = xor i32 -123, -1 ; <i32> [#uses=1]
- ret i32 %R
-}
-
diff --git a/release_23/test/Transforms/ConstProp/2002-09-03-SetCC-Bools.ll b/release_23/test/Transforms/ConstProp/2002-09-03-SetCC-Bools.ll
deleted file mode 100644
index 781d796506c8..000000000000
--- a/release_23/test/Transforms/ConstProp/2002-09-03-SetCC-Bools.ll
+++ /dev/null
@@ -1,20 +0,0 @@
-; SetCC on boolean values was not implemented!
-
-; RUN: llvm-as < %s | opt -constprop -die | llvm-dis | \
-; RUN: not grep set
-
-define i1 @test1() {
- %A = icmp ule i1 true, false ; <i1> [#uses=1]
- %B = icmp uge i1 true, false ; <i1> [#uses=1]
- %C = icmp ult i1 false, true ; <i1> [#uses=1]
- %D = icmp ugt i1 true, false ; <i1> [#uses=1]
- %E = icmp eq i1 false, false ; <i1> [#uses=1]
- %F = icmp ne i1 false, true ; <i1> [#uses=1]
- %G = and i1 %A, %B ; <i1> [#uses=1]
- %H = and i1 %C, %D ; <i1> [#uses=1]
- %I = and i1 %E, %F ; <i1> [#uses=1]
- %J = and i1 %G, %H ; <i1> [#uses=1]
- %K = and i1 %I, %J ; <i1> [#uses=1]
- ret i1 %K
-}
-
diff --git a/release_23/test/Transforms/ConstProp/2003-05-12-DivideError.ll b/release_23/test/Transforms/ConstProp/2003-05-12-DivideError.ll
deleted file mode 100644
index a3f239f95bd4..000000000000
--- a/release_23/test/Transforms/ConstProp/2003-05-12-DivideError.ll
+++ /dev/null
@@ -1,15 +0,0 @@
-; Make sure that the constant propagator doesn't cause a sigfpe
-;
-; RUN: llvm-as < %s | opt -constprop
-;
-
-define i32 @test() {
- %R = sdiv i32 -2147483648, -1 ; <i32> [#uses=1]
- ret i32 %R
-}
-
-define i32 @test2() {
- %R = srem i32 -2147483648, -1 ; <i32> [#uses=1]
- ret i32 %R
-}
-
diff --git a/release_23/test/Transforms/ConstProp/2005-01-28-SetCCGEP.ll b/release_23/test/Transforms/ConstProp/2005-01-28-SetCCGEP.ll
deleted file mode 100644
index 9ffbcd1b0ce1..000000000000
--- a/release_23/test/Transforms/ConstProp/2005-01-28-SetCCGEP.ll
+++ /dev/null
@@ -1,10 +0,0 @@
-; RUN: llvm-as < %s | opt -constprop | llvm-dis | \
-; RUN: not grep {ret i1 false}
-
-@b = external global [2 x { }] ; <[2 x { }]*> [#uses=2]
-
-define i1 @f() {
- %tmp.2 = icmp eq { }* getelementptr ([2 x { }]* @b, i32 0, i32 0), getelementptr ([2 x { }]* @b, i32 0, i32 1) ; <i1> [#uses=1]
- ret i1 %tmp.2
-}
-
diff --git a/release_23/test/Transforms/ConstProp/2006-11-30-vector-cast.ll b/release_23/test/Transforms/ConstProp/2006-11-30-vector-cast.ll
deleted file mode 100644
index 812cbcfa6277..000000000000
--- a/release_23/test/Transforms/ConstProp/2006-11-30-vector-cast.ll
+++ /dev/null
@@ -1,10 +0,0 @@
-; RUN: llvm-as < %s | opt -constprop | llvm-dis | \
-; RUN: grep {i32 -1}
-; RUN: llvm-as < %s | opt -constprop | llvm-dis | \
-; RUN: not grep zeroinitializer
-
-define <4 x i32> @test() {
- %tmp40 = bitcast <2 x i64> bitcast (<4 x i32> < i32 0, i32 0, i32 -1, i32 0 > to <2 x i64>) to <4 x i32>; <<4 x i32>> [#uses=1]
- ret <4 x i32> %tmp40
-}
-
diff --git a/release_23/test/Transforms/ConstProp/2006-12-01-TruncBoolBug.ll b/release_23/test/Transforms/ConstProp/2006-12-01-TruncBoolBug.ll
deleted file mode 100644
index 889ef56bf9c6..000000000000
--- a/release_23/test/Transforms/ConstProp/2006-12-01-TruncBoolBug.ll
+++ /dev/null
@@ -1,7 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \
-; RUN: grep {ret i1 false}
-define i1 @test() {
- %X = trunc i32 320 to i1 ; <i1> [#uses=1]
- ret i1 %X
-}
-
diff --git a/release_23/test/Transforms/ConstProp/2006-12-01-bool-casts.ll b/release_23/test/Transforms/ConstProp/2006-12-01-bool-casts.ll
deleted file mode 100644
index dd1e46d8c6fc..000000000000
--- a/release_23/test/Transforms/ConstProp/2006-12-01-bool-casts.ll
+++ /dev/null
@@ -1,15 +0,0 @@
-; RUN: llvm-as < %s | opt -constprop | llvm-dis | \
-; RUN: grep {ret i32 -1}
-; RUN: llvm-as < %s | opt -constprop | llvm-dis | \
-; RUN: grep {ret i32 1}
-
-define i32 @test1() {
- %A = sext i1 true to i32 ; <i32> [#uses=1]
- ret i32 %A
-}
-
-define i32 @test2() {
- %A = zext i1 true to i32 ; <i32> [#uses=1]
- ret i32 %A
-}
-
diff --git a/release_23/test/Transforms/ConstProp/2007-02-05-BitCast.ll b/release_23/test/Transforms/ConstProp/2007-02-05-BitCast.ll
deleted file mode 100644
index a1d7c3e0377c..000000000000
--- a/release_23/test/Transforms/ConstProp/2007-02-05-BitCast.ll
+++ /dev/null
@@ -1,7 +0,0 @@
-; RUN: llvm-as < %s | opt -constprop | llvm-dis | grep 1065353216
-
-define i32 @test() {
- %A = bitcast float 1.000000e+00 to i32 ; <i32> [#uses=1]
- ret i32 %A
-}
-
diff --git a/release_23/test/Transforms/ConstProp/2007-02-23-sdiv.ll b/release_23/test/Transforms/ConstProp/2007-02-23-sdiv.ll
deleted file mode 100644
index 721199fc7f14..000000000000
--- a/release_23/test/Transforms/ConstProp/2007-02-23-sdiv.ll
+++ /dev/null
@@ -1,5 +0,0 @@
-; RUN: llvm-as < %s | llvm-dis | grep {global i32 0}
-; PR1215
-
-@G = global i32 sdiv (i32 0, i32 -1)
-
diff --git a/release_23/test/Transforms/ConstProp/2007-11-23-cttz.ll b/release_23/test/Transforms/ConstProp/2007-11-23-cttz.ll
deleted file mode 100644
index 995ce2febf87..000000000000
--- a/release_23/test/Transforms/ConstProp/2007-11-23-cttz.ll
+++ /dev/null
@@ -1,8 +0,0 @@
-; RUN: llvm-as < %s | opt -constprop | llvm-dis | grep {ret i13 13}
-; PR1816
-declare i13 @llvm.cttz.i13(i13)
-
-define i13 @test() {
- %X = call i13 @llvm.cttz.i13(i13 0)
- ret i13 %X
-}
diff --git a/release_23/test/Transforms/ConstProp/basictest.ll b/release_23/test/Transforms/ConstProp/basictest.ll
deleted file mode 100644
index 56892d93186f..000000000000
--- a/release_23/test/Transforms/ConstProp/basictest.ll
+++ /dev/null
@@ -1,20 +0,0 @@
-; This is a basic sanity check for constant propogation. The add instruction
-; should be eliminated.
-
-; RUN: llvm-as < %s | opt -constprop -die | llvm-dis | not grep add
-
-define i32 @test(i1 %B) {
- br i1 %B, label %BB1, label %BB2
-
-BB1: ; preds = %0
- %Val = add i32 0, 0 ; <i32> [#uses=1]
- br label %BB3
-
-BB2: ; preds = %0
- br label %BB3
-
-BB3: ; preds = %BB2, %BB1
- %Ret = phi i32 [ %Val, %BB1 ], [ 1, %BB2 ] ; <i32> [#uses=1]
- ret i32 %Ret
-}
-
diff --git a/release_23/test/Transforms/ConstProp/bitcast.ll b/release_23/test/Transforms/ConstProp/bitcast.ll
deleted file mode 100644
index bf943c971f3a..000000000000
--- a/release_23/test/Transforms/ConstProp/bitcast.ll
+++ /dev/null
@@ -1,2 +0,0 @@
-; RUN: llvm-as < %s | llvm-dis | grep 0x36A0000000000000
-@A = global float 0x36A0000000000000 ; <float*> [#uses=0]
diff --git a/release_23/test/Transforms/ConstProp/bswap.ll b/release_23/test/Transforms/ConstProp/bswap.ll
deleted file mode 100644
index 49758271046e..000000000000
--- a/release_23/test/Transforms/ConstProp/bswap.ll
+++ /dev/null
@@ -1,25 +0,0 @@
-; bswap should be constant folded when it is passed a constant argument
-
-; RUN: llvm-as < %s | opt -constprop | llvm-dis | not grep call
-
-declare i16 @llvm.bswap.i16(i16)
-
-declare i32 @llvm.bswap.i32(i32)
-
-declare i64 @llvm.bswap.i64(i64)
-
-define i16 @W() {
- %Z = call i16 @llvm.bswap.i16( i16 1 ) ; <i16> [#uses=1]
- ret i16 %Z
-}
-
-define i32 @X() {
- %Z = call i32 @llvm.bswap.i32( i32 1 ) ; <i32> [#uses=1]
- ret i32 %Z
-}
-
-define i64 @Y() {
- %Z = call i64 @llvm.bswap.i64( i64 1 ) ; <i64> [#uses=1]
- ret i64 %Z
-}
-
diff --git a/release_23/test/Transforms/ConstProp/calls.ll b/release_23/test/Transforms/ConstProp/calls.ll
deleted file mode 100644
index 126db4ca2313..000000000000
--- a/release_23/test/Transforms/ConstProp/calls.ll
+++ /dev/null
@@ -1,30 +0,0 @@
-; RUN: llvm-as < %s | opt -constprop | llvm-dis | not grep call
-
-declare double @cos(double)
-
-declare double @sin(double)
-
-declare double @tan(double)
-
-declare double @sqrt(double)
-
-declare i1 @llvm.isunordered.f64(double, double)
-
-define double @T() {
- %A = call double @cos( double 0.000000e+00 ) ; <double> [#uses=1]
- %B = call double @sin( double 0.000000e+00 ) ; <double> [#uses=1]
- %a = add double %A, %B ; <double> [#uses=1]
- %C = call double @tan( double 0.000000e+00 ) ; <double> [#uses=1]
- %b = add double %a, %C ; <double> [#uses=1]
- %D = call double @sqrt( double 4.000000e+00 ) ; <double> [#uses=1]
- %c = add double %b, %D ; <double> [#uses=1]
- ret double %c
-}
-
-define i1 @TNAN() {
- %A = fcmp uno double 0x7FF8000000000000, 1.000000e+00 ; <i1> [#uses=1]
- %B = fcmp uno double 1.230000e+02, 1.000000e+00 ; <i1> [#uses=1]
- %C = or i1 %A, %B ; <i1> [#uses=1]
- ret i1 %C
-}
-
diff --git a/release_23/test/Transforms/ConstProp/dg.exp b/release_23/test/Transforms/ConstProp/dg.exp
deleted file mode 100644
index 879685ca879d..000000000000
--- a/release_23/test/Transforms/ConstProp/dg.exp
+++ /dev/null
@@ -1,3 +0,0 @@
-load_lib llvm.exp
-
-RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
diff --git a/release_23/test/Transforms/ConstProp/float-to-ptr-cast.ll b/release_23/test/Transforms/ConstProp/float-to-ptr-cast.ll
deleted file mode 100644
index cbf84f54f0a2..000000000000
--- a/release_23/test/Transforms/ConstProp/float-to-ptr-cast.ll
+++ /dev/null
@@ -1,12 +0,0 @@
-; RUN: llvm-as < %s | opt -constprop | llvm-dis | \
-; RUN: grep -F {ret i32* null} | count 2
-
-define i32* @test1() {
- %X = inttoptr i64 0 to i32* ; <i32*> [#uses=1]
- ret i32* %X
-}
-
-define i32* @test2() {
- ret i32* null
-}
-
diff --git a/release_23/test/Transforms/ConstProp/logicaltest.ll b/release_23/test/Transforms/ConstProp/logicaltest.ll
deleted file mode 100644
index 81bdb950e9fc..000000000000
--- a/release_23/test/Transforms/ConstProp/logicaltest.ll
+++ /dev/null
@@ -1,35 +0,0 @@
-; Ensure constant propogation of logical instructions is working correctly.
-
-; RUN: llvm-as < %s | opt -constprop -die | llvm-dis | \
-; RUN: not egrep {and|or|xor}
-
-define i32 @test1() {
- %R = and i32 4, 1234 ; <i32> [#uses=1]
- ret i32 %R
-}
-
-define i1 @test1.upgrd.1() {
- %R = and i1 true, false ; <i1> [#uses=1]
- ret i1 %R
-}
-
-define i32 @test2() {
- %R = or i32 4, 1234 ; <i32> [#uses=1]
- ret i32 %R
-}
-
-define i1 @test2.upgrd.2() {
- %R = or i1 true, false ; <i1> [#uses=1]
- ret i1 %R
-}
-
-define i32 @test3() {
- %R = xor i32 4, 1234 ; <i32> [#uses=1]
- ret i32 %R
-}
-
-define i1 @test3.upgrd.3() {
- %R = xor i1 true, false ; <i1> [#uses=1]
- ret i1 %R
-}
-
diff --git a/release_23/test/Transforms/ConstProp/nottest.ll b/release_23/test/Transforms/ConstProp/nottest.ll
deleted file mode 100644
index 41ea1b387304..000000000000
--- a/release_23/test/Transforms/ConstProp/nottest.ll
+++ /dev/null
@@ -1,19 +0,0 @@
-; Ensure constant propogation of 'not' instructions is working correctly.
-
-; RUN: llvm-as < %s | opt -constprop -die | llvm-dis | not grep xor
-
-define i32 @test1() {
- %R = xor i32 4, -1 ; <i32> [#uses=1]
- ret i32 %R
-}
-
-define i32 @test2() {
- %R = xor i32 -23, -1 ; <i32> [#uses=1]
- ret i32 %R
-}
-
-define i1 @test3() {
- %R = xor i1 true, true ; <i1> [#uses=1]
- ret i1 %R
-}
-
diff --git a/release_23/test/Transforms/ConstProp/phi.ll b/release_23/test/Transforms/ConstProp/phi.ll
deleted file mode 100644
index 858c0becb148..000000000000
--- a/release_23/test/Transforms/ConstProp/phi.ll
+++ /dev/null
@@ -1,17 +0,0 @@
-; This is a basic sanity check for constant propogation. The add instruction
-; should be eliminated.
-
-; RUN: llvm-as < %s | opt -constprop -die | llvm-dis | not grep phi
-
-define i32 @test(i1 %B) {
-BB0:
- br i1 %B, label %BB1, label %BB3
-
-BB1: ; preds = %BB0
- br label %BB3
-
-BB3: ; preds = %BB1, %BB0
- %Ret = phi i32 [ 1, %BB0 ], [ 1, %BB1 ] ; <i32> [#uses=1]
- ret i32 %Ret
-}
-
diff --git a/release_23/test/Transforms/ConstProp/remtest.ll b/release_23/test/Transforms/ConstProp/remtest.ll
deleted file mode 100644
index 11861a4e8093..000000000000
--- a/release_23/test/Transforms/ConstProp/remtest.ll
+++ /dev/null
@@ -1,24 +0,0 @@
-; Ensure constant propagation of remainder instructions is working correctly.
-
-; RUN: llvm-as < %s | opt -constprop -die | llvm-dis | not grep rem
-
-define i32 @test1() {
- %R = srem i32 4, 3 ; <i32> [#uses=1]
- ret i32 %R
-}
-
-define i32 @test2() {
- %R = srem i32 123, -23 ; <i32> [#uses=1]
- ret i32 %R
-}
-
-define float @test3() {
- %R = frem float 0x4028E66660000000, 0x405ECDA1C0000000 ; <float> [#uses=1]
- ret float %R
-}
-
-define double @test4() {
- %R = frem double 0x4073833BEE07AFF8, 0x4028AAABB2A0D19C ; <double> [#uses=1]
- ret double %R
-}
-
diff --git a/release_23/test/Transforms/ConstantMerge/2002-09-23-CPR-Update.ll b/release_23/test/Transforms/ConstantMerge/2002-09-23-CPR-Update.ll
deleted file mode 100644
index 658944de23f8..000000000000
--- a/release_23/test/Transforms/ConstantMerge/2002-09-23-CPR-Update.ll
+++ /dev/null
@@ -1,13 +0,0 @@
-; RUN: llvm-as < %s | opt -constmerge > /dev/null
-
-@foo.upgrd.1 = internal constant { i32 } { i32 7 } ; <{ i32 }*> [#uses=1]
-@bar = internal constant { i32 } { i32 7 } ; <{ i32 }*> [#uses=1]
-
-declare i32 @test(i32*)
-
-define void @foo() {
- call i32 @test( i32* getelementptr ({ i32 }* @foo.upgrd.1, i64 0, i32 0) ) ; <i32>:1 [#uses=0]
- call i32 @test( i32* getelementptr ({ i32 }* @bar, i64 0, i32 0) ) ; <i32>:2 [#uses=0]
- ret void
-}
-
diff --git a/release_23/test/Transforms/ConstantMerge/2003-10-28-MergeExternalConstants.ll b/release_23/test/Transforms/ConstantMerge/2003-10-28-MergeExternalConstants.ll
deleted file mode 100644
index 9a9c3ddf0ab1..000000000000
--- a/release_23/test/Transforms/ConstantMerge/2003-10-28-MergeExternalConstants.ll
+++ /dev/null
@@ -1,5 +0,0 @@
-; RUN: llvm-as < %s | opt -constmerge | llvm-dis | %prcontext foo 2 | grep bar
-
-@foo = constant i32 6 ; <i32*> [#uses=0]
-@bar = constant i32 6 ; <i32*> [#uses=0]
-
diff --git a/release_23/test/Transforms/ConstantMerge/2006-03-07-DontMergeDiffSections.ll b/release_23/test/Transforms/ConstantMerge/2006-03-07-DontMergeDiffSections.ll
deleted file mode 100644
index a621b594ca05..000000000000
--- a/release_23/test/Transforms/ConstantMerge/2006-03-07-DontMergeDiffSections.ll
+++ /dev/null
@@ -1,16 +0,0 @@
-; RUN: llvm-as < %s | opt -constmerge | llvm-dis | grep foo
-; RUN: llvm-as < %s | opt -constmerge | llvm-dis | grep bar
-
-; Don't merge constants in different sections.
-
-@G1 = internal constant i32 1, section "foo" ; <i32*> [#uses=1]
-@G2 = internal constant i32 1, section "bar" ; <i32*> [#uses=1]
-@G3 = internal constant i32 1, section "bar" ; <i32*> [#uses=1]
-
-define void @test(i32** %P1, i32** %P2, i32** %P3) {
- store i32* @G1, i32** %P1
- store i32* @G2, i32** %P2
- store i32* @G3, i32** %P3
- ret void
-}
-
diff --git a/release_23/test/Transforms/ConstantMerge/dg.exp b/release_23/test/Transforms/ConstantMerge/dg.exp
deleted file mode 100644
index 879685ca879d..000000000000
--- a/release_23/test/Transforms/ConstantMerge/dg.exp
+++ /dev/null
@@ -1,3 +0,0 @@
-load_lib llvm.exp
-
-RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
diff --git a/release_23/test/Transforms/DeadArgElim/2006-06-27-struct-ret.ll b/release_23/test/Transforms/DeadArgElim/2006-06-27-struct-ret.ll
deleted file mode 100644
index 0d86800c780a..000000000000
--- a/release_23/test/Transforms/DeadArgElim/2006-06-27-struct-ret.ll
+++ /dev/null
@@ -1,11 +0,0 @@
-; RUN: llvm-as < %s | opt -deadargelim -disable-output
-
-define internal void @build_delaunay({ i32 }* sret %agg.result) {
- ret void
-}
-
-define void @test() {
- call void @build_delaunay( { i32 }* sret null )
- ret void
-}
-
diff --git a/release_23/test/Transforms/DeadArgElim/2007-02-07-FuncRename.ll b/release_23/test/Transforms/DeadArgElim/2007-02-07-FuncRename.ll
deleted file mode 100644
index 2b3a2ea247a2..000000000000
--- a/release_23/test/Transforms/DeadArgElim/2007-02-07-FuncRename.ll
+++ /dev/null
@@ -1,11 +0,0 @@
-; RUN: llvm-as < %s | opt -deadargelim | llvm-dis | grep {@test(}
-; RUN: llvm-as < %s | opt -deadargelim | llvm-dis | not grep dead
-
-define internal i32 @test(i32 %X, i32 %dead) {
- ret i32 %X
-}
-
-define i32 @caller() {
- %A = call i32 @test(i32 123, i32 456)
- ret i32 %A
-}
diff --git a/release_23/test/Transforms/DeadArgElim/2007-10-18-VarargsReturn.ll b/release_23/test/Transforms/DeadArgElim/2007-10-18-VarargsReturn.ll
deleted file mode 100644
index 2a09b76c35b4..000000000000
--- a/release_23/test/Transforms/DeadArgElim/2007-10-18-VarargsReturn.ll
+++ /dev/null
@@ -1,12 +0,0 @@
-; RUN: llvm-as < %s | opt -deadargelim | llvm-dis | not grep {ret i32 0}
-; PR1735
-
-define internal i32 @test(i32 %A, ...) {
- ret i32 %A
-}
-
-define i32 @foo() {
- %A = call i32(i32, ...)* @test(i32 1)
- ret i32 %A
-}
-
diff --git a/release_23/test/Transforms/DeadArgElim/2007-12-20-ParamAttrs.ll b/release_23/test/Transforms/DeadArgElim/2007-12-20-ParamAttrs.ll
deleted file mode 100644
index bd30942633d2..000000000000
--- a/release_23/test/Transforms/DeadArgElim/2007-12-20-ParamAttrs.ll
+++ /dev/null
@@ -1,19 +0,0 @@
-; RUN: llvm-as < %s | opt -deadargelim | llvm-dis | grep nounwind | count 2
-; RUN: llvm-as < %s | opt -deadargelim | llvm-dis | grep signext | count 2
-; RUN: llvm-as < %s | opt -deadargelim | llvm-dis | not grep inreg
-; RUN: llvm-as < %s | opt -deadargelim | llvm-dis | not grep zeroext
-; RUN: llvm-as < %s | opt -deadargelim | llvm-dis | not grep byval
-
- %struct = type { }
-
-@g = global i8 0
-
-define internal i8 @foo(i8* inreg %p, i8 signext %y, ... ) zeroext nounwind {
- store i8 %y, i8* @g
- ret i8 0
-}
-
-define i32 @bar() {
- %A = call i8(i8*, i8, ...)* @foo(i8* inreg null, i8 signext 1, %struct* byval null ) zeroext nounwind
- ret i32 0
-}
diff --git a/release_23/test/Transforms/DeadArgElim/2008-01-16-VarargsParamAttrs.ll b/release_23/test/Transforms/DeadArgElim/2008-01-16-VarargsParamAttrs.ll
deleted file mode 100644
index 96cddf1fd3a1..000000000000
--- a/release_23/test/Transforms/DeadArgElim/2008-01-16-VarargsParamAttrs.ll
+++ /dev/null
@@ -1,31 +0,0 @@
-; RUN: llvm-as < %s | opt -deadargelim | llvm-dis | grep byval
-
- %struct.point = type { double, double }
-@pts = global [4 x %struct.point] [ %struct.point { double 1.000000e+00, double 2.000000e+00 }, %struct.point { double 3.000000e+00, double 4.000000e+00 }, %struct.point { double 5.000000e+00, double 6.000000e+00 }, %struct.point { double 7.000000e+00, double 8.000000e+00 } ], align 32 ; <[4 x %struct.point]*> [#uses=1]
-
-define internal i32 @va1(i32 %nargs, ...) {
-entry:
- %pi = alloca %struct.point ; <%struct.point*> [#uses=0]
- %args = alloca i8* ; <i8**> [#uses=2]
- %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
- %args1 = bitcast i8** %args to i8* ; <i8*> [#uses=1]
- call void @llvm.va_start( i8* %args1 )
- %args41 = bitcast i8** %args to i8* ; <i8*> [#uses=1]
- call void @llvm.va_end( i8* %args41 )
- ret i32 undef
-}
-
-declare void @llvm.va_start(i8*) nounwind
-
-declare void @llvm.va_end(i8*) nounwind
-
-define i32 @main() {
-entry:
- %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
- %tmp = getelementptr [4 x %struct.point]* @pts, i32 0, i32 0 ; <%struct.point*> [#uses=1]
- %tmp1 = call i32 (i32, ...)* @va1( i32 1, %struct.point* byval %tmp ) nounwind ; <i32> [#uses=0]
- call void @exit( i32 0 ) noreturn nounwind
- unreachable
-}
-
-declare void @exit(i32) noreturn nounwind
diff --git a/release_23/test/Transforms/DeadArgElim/basictest.ll b/release_23/test/Transforms/DeadArgElim/basictest.ll
deleted file mode 100644
index 5f68f9859652..000000000000
--- a/release_23/test/Transforms/DeadArgElim/basictest.ll
+++ /dev/null
@@ -1,36 +0,0 @@
-; RUN: llvm-as < %s | opt -deadargelim | llvm-dis | not grep DEADARG
-
-; test - an obviously dead argument
-define internal i32 @test(i32 %v, i32 %DEADARG1, i32* %p) {
- store i32 %v, i32* %p
- ret i32 %v
-}
-
-; hardertest - an argument which is only used by a call of a function with a
-; dead argument.
-define internal i32 @hardertest(i32 %DEADARG2) {
- %p = alloca i32 ; <i32*> [#uses=1]
- %V = call i32 @test( i32 5, i32 %DEADARG2, i32* %p ) ; <i32> [#uses=1]
- ret i32 %V
-}
-
-; evenhardertest - recursive dead argument...
-define internal void @evenhardertest(i32 %DEADARG3) {
- call void @evenhardertest( i32 %DEADARG3 )
- ret void
-}
-
-define internal void @needarg(i32 %TEST) {
- call i32 @needarg2( i32 %TEST ) ; <i32>:1 [#uses=0]
- ret void
-}
-
-define internal i32 @needarg2(i32 %TEST) {
- ret i32 %TEST
-}
-
-define internal void @needarg3(i32 %TEST3) {
- call void @needarg( i32 %TEST3 )
- ret void
-}
-
diff --git a/release_23/test/Transforms/DeadArgElim/dead_vaargs.ll b/release_23/test/Transforms/DeadArgElim/dead_vaargs.ll
deleted file mode 100644
index a4444bc102af..000000000000
--- a/release_23/test/Transforms/DeadArgElim/dead_vaargs.ll
+++ /dev/null
@@ -1,12 +0,0 @@
-; RUN: llvm-as < %s | opt -deadargelim | llvm-dis | not grep 47
-; RUN: llvm-as < %s | opt -deadargelim | llvm-dis | not grep 1.0
-
-define i32 @bar(i32 %A) {
- %tmp4 = tail call i32 (i32, ...)* @foo( i32 %A, i32 %A, i32 %A, i32 %A, i64 47, double 1.000000e+00 ) ; <i32> [#uses=1]
- ret i32 %tmp4
-}
-
-define internal i32 @foo(i32 %X, ...) {
- ret i32 %X
-}
-
diff --git a/release_23/test/Transforms/DeadArgElim/deadretval.ll b/release_23/test/Transforms/DeadArgElim/deadretval.ll
deleted file mode 100644
index 5395290978b1..000000000000
--- a/release_23/test/Transforms/DeadArgElim/deadretval.ll
+++ /dev/null
@@ -1,18 +0,0 @@
-; RUN: llvm-as < %s | opt -deadargelim | llvm-dis | not grep DEAD
-
-; Dead arg only used by dead retval
-define internal i32 @test(i32 %DEADARG) {
- ret i32 %DEADARG
-}
-
-define i32 @test2(i32 %A) {
- %DEAD = call i32 @test( i32 %A ) ; <i32> [#uses=0]
- ret i32 123
-}
-
-define i32 @test3() {
- %X = call i32 @test2( i32 3232 ) ; <i32> [#uses=1]
- %Y = add i32 %X, -123 ; <i32> [#uses=1]
- ret i32 %Y
-}
-
diff --git a/release_23/test/Transforms/DeadArgElim/deadretval2.ll b/release_23/test/Transforms/DeadArgElim/deadretval2.ll
deleted file mode 100644
index 76ce84dad87b..000000000000
--- a/release_23/test/Transforms/DeadArgElim/deadretval2.ll
+++ /dev/null
@@ -1,33 +0,0 @@
-; RUN: llvm-as < %s | opt -deadargelim -die | llvm-dis | not grep DEAD
-
-@P = external global i32 ; <i32*> [#uses=1]
-
-; Dead arg only used by dead retval
-define internal i32 @test(i32 %DEADARG) {
- ret i32 %DEADARG
-}
-
-define internal i32 @test2(i32 %DEADARG) {
- %DEADRETVAL = call i32 @test( i32 %DEADARG ) ; <i32> [#uses=1]
- ret i32 %DEADRETVAL
-}
-
-define void @test3(i32 %X) {
- %DEADRETVAL = call i32 @test2( i32 %X ) ; <i32> [#uses=0]
- ret void
-}
-
-define internal i32 @foo() {
- %DEAD = load i32* @P ; <i32> [#uses=1]
- ret i32 %DEAD
-}
-
-define internal i32 @id(i32 %X) {
- ret i32 %X
-}
-
-define void @test4() {
- %DEAD = call i32 @foo( ) ; <i32> [#uses=1]
- %DEAD2 = call i32 @id( i32 %DEAD ) ; <i32> [#uses=0]
- ret void
-}
diff --git a/release_23/test/Transforms/DeadArgElim/dg.exp b/release_23/test/Transforms/DeadArgElim/dg.exp
deleted file mode 100644
index 879685ca879d..000000000000
--- a/release_23/test/Transforms/DeadArgElim/dg.exp
+++ /dev/null
@@ -1,3 +0,0 @@
-load_lib llvm.exp
-
-RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
diff --git a/release_23/test/Transforms/DeadStoreElimination/2004-11-28-LiveStoreDeleted.ll b/release_23/test/Transforms/DeadStoreElimination/2004-11-28-LiveStoreDeleted.ll
deleted file mode 100644
index 54fa078a5916..000000000000
--- a/release_23/test/Transforms/DeadStoreElimination/2004-11-28-LiveStoreDeleted.ll
+++ /dev/null
@@ -1,14 +0,0 @@
-; RUN: llvm-as < %s | opt -dse -scalarrepl -instcombine | \
-; RUN: llvm-dis | not grep {ret i32 undef}
-
-define i32 @test(double %__x) {
- %__u = alloca { [3 x i32] } ; <{ [3 x i32] }*> [#uses=2]
- %tmp.1 = bitcast { [3 x i32] }* %__u to double* ; <double*> [#uses=1]
- store double %__x, double* %tmp.1
- %tmp.4 = getelementptr { [3 x i32] }* %__u, i32 0, i32 0, i32 1 ; <i32*> [#uses=1]
- %tmp.5 = load i32* %tmp.4 ; <i32> [#uses=1]
- %tmp.6 = icmp slt i32 %tmp.5, 0 ; <i1> [#uses=1]
- %tmp.7 = zext i1 %tmp.6 to i32 ; <i32> [#uses=1]
- ret i32 %tmp.7
-}
-
diff --git a/release_23/test/Transforms/DeadStoreElimination/2004-12-28-PartialStore.ll b/release_23/test/Transforms/DeadStoreElimination/2004-12-28-PartialStore.ll
deleted file mode 100644
index 3c40347f3094..000000000000
--- a/release_23/test/Transforms/DeadStoreElimination/2004-12-28-PartialStore.ll
+++ /dev/null
@@ -1,13 +0,0 @@
-; RUN: llvm-as < %s | opt -dse | llvm-dis | \
-; RUN: grep {store i32 1234567}
-
-; Do not delete stores that are only partially killed.
-
-define i32 @test() {
- %V = alloca i32 ; <i32*> [#uses=3]
- store i32 1234567, i32* %V
- %V2 = bitcast i32* %V to i8* ; <i8*> [#uses=1]
- store i8 0, i8* %V2
- %X = load i32* %V ; <i32> [#uses=1]
- ret i32 %X
-}
diff --git a/release_23/test/Transforms/DeadStoreElimination/2005-11-30-vaarg.ll b/release_23/test/Transforms/DeadStoreElimination/2005-11-30-vaarg.ll
deleted file mode 100644
index 58d678708794..000000000000
--- a/release_23/test/Transforms/DeadStoreElimination/2005-11-30-vaarg.ll
+++ /dev/null
@@ -1,9 +0,0 @@
-; RUN: llvm-as < %s | opt -dse | llvm-dis | grep store
-
-define double @foo(i8* %X) {
- %X_addr = alloca i8* ; <i8**> [#uses=2]
- store i8* %X, i8** %X_addr
- %tmp.0 = va_arg i8** %X_addr, double ; <double> [#uses=1]
- ret double %tmp.0
-}
-
diff --git a/release_23/test/Transforms/DeadStoreElimination/2006-06-27-AST-Remove.ll b/release_23/test/Transforms/DeadStoreElimination/2006-06-27-AST-Remove.ll
deleted file mode 100644
index 50dcf3278b89..000000000000
--- a/release_23/test/Transforms/DeadStoreElimination/2006-06-27-AST-Remove.ll
+++ /dev/null
@@ -1,1113 +0,0 @@
-; RUN: llvm-as < %s | opt -globalsmodref-aa -dse -disable-output
-target datalayout = "E-p:32:32"
-target triple = "powerpc-apple-darwin8"
- %struct.ECacheType = type { i32, i32, i32 }
- %struct.FILE = type { i8*, i32, i32, i16, i16, %struct.__sbuf, i32, i8*, i32 (i8*)*, i32 (i8*, i8*, i32)*, i64 (i8*, i64, i32)*, i32 (i8*, i8*, i32)*, %struct.__sbuf, %struct.__sFILEX*, i32, [3 x i8], [1 x i8], %struct.__sbuf, i32, i64 }
- %struct.QTType = type { i8, i8, i16, i32, i32, i32 }
- %struct.TType = type { i8, i8, i8, i8, i16, i32, i32, i32 }
- %struct._RuneEntry = type { i32, i32, i32, i32* }
- %struct._RuneLocale = type { [8 x i8], [32 x i8], i32 (i8*, i32, i8**)*, i32 (i32, i8*, i32, i8**)*, i32, [256 x i32], [256 x i32], [256 x i32], %struct._RuneRange, %struct._RuneRange, %struct._RuneRange, i8*, i32 }
- %struct._RuneRange = type { i32, %struct._RuneEntry* }
- %struct.__sFILEX = type opaque
- %struct.__sbuf = type { i8*, i32 }
- %struct.move_s = type { i32, i32, i32, i32, i32, i32 }
- %struct.move_x = type { i32, i32, i32, i32 }
- %struct.node_t = type { i8, i8, i8, i8, i32, i32, %struct.node_t**, %struct.node_t*, %struct.move_s }
- %struct.see_data = type { i32, i32 }
-@rook_o.2925 = internal global [4 x i32] [ i32 12, i32 -12, i32 1, i32 -1 ] ; <[4 x i32]*> [#uses=0]
-@bishop_o.2926 = internal global [4 x i32] [ i32 11, i32 -11, i32 13, i32 -13 ] ; <[4 x i32]*> [#uses=0]
-@knight_o.2927 = internal global [8 x i32] [ i32 10, i32 -10, i32 14, i32 -14, i32 23, i32 -23, i32 25, i32 -25 ] ; <[8 x i32]*> [#uses=0]
-@board = internal global [144 x i32] zeroinitializer ; <[144 x i32]*> [#uses=0]
-@holding = internal global [2 x [16 x i32]] zeroinitializer ; <[2 x [16 x i32]]*> [#uses=0]
-@hold_hash = internal global i32 0 ; <i32*> [#uses=0]
-@white_hand_eval = internal global i32 0 ; <i32*> [#uses=0]
-@black_hand_eval = internal global i32 0 ; <i32*> [#uses=0]
-@num_holding = internal global [2 x i32] zeroinitializer ; <[2 x i32]*> [#uses=0]
-@zobrist = internal global [14 x [144 x i32]] zeroinitializer ; <[14 x [144 x i32]]*> [#uses=0]
-@Variant = internal global i32 0 ; <i32*> [#uses=7]
-@userealholdings.b = internal global i1 false ; <i1*> [#uses=1]
-@realholdings = internal global [255 x i8] zeroinitializer ; <[255 x i8]*> [#uses=0]
-@comp_color = internal global i32 0 ; <i32*> [#uses=0]
-@C.97.3177 = internal global [13 x i32] [ i32 0, i32 2, i32 1, i32 4, i32 3, i32 0, i32 0, i32 8, i32 7, i32 10, i32 9, i32 12, i32 11 ] ; <[13 x i32]*> [#uses=0]
-@str = internal global [30 x i8] c"%s:%u: failed assertion `%s'\0A\00" ; <[30 x i8]*> [#uses=0]
-@str.upgrd.1 = internal global [81 x i8] c"/Volumes/Stuff/src/speccpu2006-091-llvm/benchspec//CPU2006/458.sjeng/src/crazy.c\00" ; <[81 x i8]*> [#uses=0]
-@str.upgrd.2 = internal global [32 x i8] c"piece > frame && piece < npiece\00" ; <[32 x i8]*> [#uses=0]
-@C.101.3190 = internal global [13 x i32] [ i32 0, i32 2, i32 1, i32 2, i32 1, i32 0, i32 0, i32 2, i32 1, i32 2, i32 1, i32 2, i32 1 ] ; <[13 x i32]*> [#uses=0]
-@hand_value = internal global [13 x i32] [ i32 0, i32 100, i32 -100, i32 210, i32 -210, i32 0, i32 0, i32 250, i32 -250, i32 450, i32 -450, i32 230, i32 -230 ] ; <[13 x i32]*> [#uses=0]
-@material = internal global [14 x i32] zeroinitializer ; <[14 x i32]*> [#uses=0]
-@Material = internal global i32 0 ; <i32*> [#uses=0]
-@str.upgrd.3 = internal global [23 x i8] c"holding[who][what] > 0\00" ; <[23 x i8]*> [#uses=0]
-@str.upgrd.4 = internal global [24 x i8] c"holding[who][what] < 20\00" ; <[24 x i8]*> [#uses=0]
-@fifty = internal global i32 0 ; <i32*> [#uses=0]
-@move_number = internal global i32 0 ; <i32*> [#uses=1]
-@ply = internal global i32 0 ; <i32*> [#uses=2]
-@hash_history = internal global [600 x i32] zeroinitializer ; <[600 x i32]*> [#uses=1]
-@hash = internal global i32 0 ; <i32*> [#uses=1]
-@ECacheSize.b = internal global i1 false ; <i1*> [#uses=1]
-@ECache = internal global %struct.ECacheType* null ; <%struct.ECacheType**> [#uses=1]
-@ECacheProbes = internal global i32 0 ; <i32*> [#uses=1]
-@ECacheHits = internal global i32 0 ; <i32*> [#uses=1]
-@str.upgrd.5 = internal global [34 x i8] c"Out of memory allocating ECache.\0A\00" ; <[34 x i8]*> [#uses=0]
-@rankoffsets.2930 = internal global [8 x i32] [ i32 110, i32 98, i32 86, i32 74, i32 62, i32 50, i32 38, i32 26 ] ; <[8 x i32]*> [#uses=0]
-@white_castled = internal global i32 0 ; <i32*> [#uses=0]
-@black_castled = internal global i32 0 ; <i32*> [#uses=0]
-@book_ply = internal global i32 0 ; <i32*> [#uses=0]
-@bking_loc = internal global i32 0 ; <i32*> [#uses=1]
-@wking_loc = internal global i32 0 ; <i32*> [#uses=1]
-@white_to_move = internal global i32 0 ; <i32*> [#uses=3]
-@moved = internal global [144 x i32] zeroinitializer ; <[144 x i32]*> [#uses=0]
-@ep_square = internal global i32 0 ; <i32*> [#uses=0]
-@_DefaultRuneLocale = external global %struct._RuneLocale ; <%struct._RuneLocale*> [#uses=0]
-@str.upgrd.6 = internal global [3 x i8] c"bm\00" ; <[3 x i8]*> [#uses=0]
-@str1 = internal global [3 x i8] c"am\00" ; <[3 x i8]*> [#uses=0]
-@str1.upgrd.7 = internal global [34 x i8] c"No best-move or avoid-move found!\00" ; <[34 x i8]*> [#uses=0]
-@str.upgrd.8 = internal global [25 x i8] c"\0AName of EPD testsuite: \00" ; <[25 x i8]*> [#uses=0]
-@__sF = external global [0 x %struct.FILE] ; <[0 x %struct.FILE]*> [#uses=0]
-@str.upgrd.9 = internal global [21 x i8] c"\0ATime per move (s): \00" ; <[21 x i8]*> [#uses=0]
-@str.upgrd.10 = internal global [2 x i8] c"\0A\00" ; <[2 x i8]*> [#uses=0]
-@str2 = internal global [2 x i8] c"r\00" ; <[2 x i8]*> [#uses=0]
-@root_to_move = internal global i32 0 ; <i32*> [#uses=1]
-@forcedwin.b = internal global i1 false ; <i1*> [#uses=2]
-@fixed_time = internal global i32 0 ; <i32*> [#uses=1]
-@nodes = internal global i32 0 ; <i32*> [#uses=1]
-@qnodes = internal global i32 0 ; <i32*> [#uses=1]
-@str.upgrd.11 = internal global [29 x i8] c"\0ANodes: %i (%0.2f%% qnodes)\0A\00" ; <[29 x i8]*> [#uses=0]
-@str.upgrd.12 = internal global [54 x i8] c"ECacheProbes : %u ECacheHits : %u HitRate : %f%%\0A\00" ; <[54 x i8]*> [#uses=0]
-@TTStores = internal global i32 0 ; <i32*> [#uses=1]
-@TTProbes = internal global i32 0 ; <i32*> [#uses=1]
-@TTHits = internal global i32 0 ; <i32*> [#uses=1]
-@str.upgrd.13 = internal global [60 x i8] c"TTStores : %u TTProbes : %u TTHits : %u HitRate : %f%%\0A\00" ; <[60 x i8]*> [#uses=0]
-@NTries = internal global i32 0 ; <i32*> [#uses=1]
-@NCuts = internal global i32 0 ; <i32*> [#uses=1]
-@TExt = internal global i32 0 ; <i32*> [#uses=1]
-@str.upgrd.14 = internal global [51 x i8] c"NTries : %u NCuts : %u CutRate : %f%% TExt: %u\0A\00" ; <[51 x i8]*> [#uses=0]
-@ext_check = internal global i32 0 ; <i32*> [#uses=1]
-@razor_drop = internal global i32 0 ; <i32*> [#uses=1]
-@razor_material = internal global i32 0 ; <i32*> [#uses=1]
-@str.upgrd.15 = internal global [61 x i8] c"Check extensions: %u Razor drops : %u Razor Material : %u\0A\00" ; <[61 x i8]*> [#uses=0]
-@FHF = internal global i32 0 ; <i32*> [#uses=1]
-@FH = internal global i32 0 ; <i32*> [#uses=1]
-@str.upgrd.16 = internal global [22 x i8] c"Move ordering : %f%%\0A\00" ; <[22 x i8]*> [#uses=0]
-@maxposdiff = internal global i32 0 ; <i32*> [#uses=1]
-@str.upgrd.17 = internal global [47 x i8] c"Material score: %d Eval : %d MaxPosDiff: %d\0A\00" ; <[47 x i8]*> [#uses=0]
-@str.upgrd.18 = internal global [17 x i8] c"Solution found.\0A\00" ; <[17 x i8]*> [#uses=0]
-@str3 = internal global [21 x i8] c"Solution not found.\0A\00" ; <[21 x i8]*> [#uses=0]
-@str.upgrd.19 = internal global [15 x i8] c"Solved: %d/%d\0A\00" ; <[15 x i8]*> [#uses=0]
-@str.upgrd.20 = internal global [9 x i8] c"EPD: %s\0A\00" ; <[9 x i8]*> [#uses=0]
-@str4 = internal global [21 x i8] c"Searching to %d ply\0A\00" ; <[21 x i8]*> [#uses=0]
-@maxdepth = internal global i32 0 ; <i32*> [#uses=0]
-@std_material = internal global [14 x i32] [ i32 0, i32 100, i32 -100, i32 310, i32 -310, i32 4000, i32 -4000, i32 500, i32 -500, i32 900, i32 -900, i32 325, i32 -325, i32 0 ] ; <[14 x i32]*> [#uses=0]
-@zh_material = internal global [14 x i32] [ i32 0, i32 100, i32 -100, i32 210, i32 -210, i32 4000, i32 -4000, i32 250, i32 -250, i32 450, i32 -450, i32 230, i32 -230, i32 0 ] ; <[14 x i32]*> [#uses=0]
-@suicide_material = internal global [14 x i32] [ i32 0, i32 15, i32 -15, i32 150, i32 -150, i32 500, i32 -500, i32 150, i32 -150, i32 50, i32 -50, i32 0, i32 0, i32 0 ] ; <[14 x i32]*> [#uses=0]
-@losers_material = internal global [14 x i32] [ i32 0, i32 80, i32 -80, i32 320, i32 -320, i32 1000, i32 -1000, i32 350, i32 -350, i32 400, i32 -400, i32 270, i32 -270, i32 0 ] ; <[14 x i32]*> [#uses=0]
-@Xfile = internal global [144 x i32] [ i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 0, i32 0, i32 0, i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 0, i32 0, i32 0, i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 0, i32 0, i32 0, i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 0, i32 0, i32 0, i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 0, i32 0, i32 0, i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 0, i32 0, i32 0, i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 0, i32 0, i32 0, i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0 ] ; <[144 x i32]*> [#uses=0]
-@Xrank = internal global [144 x i32] [ i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 0, i32 0, i32 0, i32 0, i32 2, i32 2, i32 2, i32 2, i32 2, i32 2, i32 2, i32 2, i32 0, i32 0, i32 0, i32 0, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 0, i32 0, i32 0, i32 0, i32 4, i32 4, i32 4, i32 4, i32 4, i32 4, i32 4, i32 4, i32 0, i32 0, i32 0, i32 0, i32 5, i32 5, i32 5, i32 5, i32 5, i32 5, i32 5, i32 5, i32 0, i32 0, i32 0, i32 0, i32 6, i32 6, i32 6, i32 6, i32 6, i32 6, i32 6, i32 6, i32 0, i32 0, i32 0, i32 0, i32 7, i32 7, i32 7, i32 7, i32 7, i32 7, i32 7, i32 7, i32 0, i32 0, i32 0, i32 0, i32 8, i32 8, i32 8, i32 8, i32 8, i32 8, i32 8, i32 8, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0 ] ; <[144 x i32]*> [#uses=0]
-@Xdiagl = internal global [144 x i32] [ i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 0, i32 0, i32 0, i32 0, i32 9, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 0, i32 0, i32 0, i32 0, i32 10, i32 9, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 0, i32 0, i32 0, i32 0, i32 11, i32 10, i32 9, i32 1, i32 2, i32 3, i32 4, i32 5, i32 0, i32 0, i32 0, i32 0, i32 12, i32 11, i32 10, i32 9, i32 1, i32 2, i32 3, i32 4, i32 0, i32 0, i32 0, i32 0, i32 13, i32 12, i32 11, i32 10, i32 9, i32 1, i32 2, i32 3, i32 0, i32 0, i32 0, i32 0, i32 14, i32 13, i32 12, i32 11, i32 10, i32 9, i32 1, i32 2, i32 0, i32 0, i32 0, i32 0, i32 15, i32 14, i32 13, i32 12, i32 11, i32 10, i32 9, i32 1, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0 ] ; <[144 x i32]*> [#uses=0]
-@Xdiagr = internal global [144 x i32] [ i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 15, i32 14, i32 13, i32 12, i32 11, i32 10, i32 9, i32 1, i32 0, i32 0, i32 0, i32 0, i32 14, i32 13, i32 12, i32 11, i32 10, i32 9, i32 1, i32 2, i32 0, i32 0, i32 0, i32 0, i32 13, i32 12, i32 11, i32 10, i32 9, i32 1, i32 2, i32 3, i32 0, i32 0, i32 0, i32 0, i32 12, i32 11, i32 10, i32 9, i32 1, i32 2, i32 3, i32 4, i32 0, i32 0, i32 0, i32 0, i32 11, i32 10, i32 9, i32 1, i32 2, i32 3, i32 4, i32 5, i32 0, i32 0, i32 0, i32 0, i32 10, i32 9, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 0, i32 0, i32 0, i32 0, i32 9, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 0, i32 0, i32 0, i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0 ] ; <[144 x i32]*> [#uses=0]
-@sqcolor = internal global [144 x i32] [ i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 0, i32 0, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 0, i32 0, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 0, i32 0, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0 ] ; <[144 x i32]*> [#uses=0]
-@pcsqbishop = internal global [144 x i32] [ i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 -5, i32 -5, i32 -10, i32 -5, i32 -5, i32 -10, i32 -5, i32 -5, i32 0, i32 0, i32 0, i32 0, i32 -5, i32 10, i32 5, i32 10, i32 10, i32 5, i32 10, i32 -5, i32 0, i32 0, i32 0, i32 0, i32 -5, i32 5, i32 6, i32 15, i32 15, i32 6, i32 5, i32 -5, i32 0, i32 0, i32 0, i32 0, i32 -5, i32 3, i32 15, i32 10, i32 10, i32 15, i32 3, i32 -5, i32 0, i32 0, i32 0, i32 0, i32 -5, i32 3, i32 15, i32 10, i32 10, i32 15, i32 3, i32 -5, i32 0, i32 0, i32 0, i32 0, i32 -5, i32 5, i32 6, i32 15, i32 15, i32 6, i32 5, i32 -5, i32 0, i32 0, i32 0, i32 0, i32 -5, i32 10, i32 5, i32 10, i32 10, i32 5, i32 10, i32 -5, i32 0, i32 0, i32 0, i32 0, i32 -5, i32 -5, i32 -10, i32 -5, i32 -5, i32 -10, i32 -5, i32 -5, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0 ] ; <[144 x i32]*> [#uses=0]
-@black_knight = internal global [144 x i32] [ i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 -20, i32 -10, i32 -10, i32 -10, i32 -10, i32 -10, i32 -10, i32 -20, i32 0, i32 0, i32 0, i32 0, i32 -10, i32 15, i32 25, i32 25, i32 25, i32 25, i32 15, i32 -10, i32 0, i32 0, i32 0, i32 0, i32 -10, i32 15, i32 25, i32 35, i32 35, i32 35, i32 15, i32 -10, i32 0, i32 0, i32 0, i32 0, i32 -10, i32 10, i32 25, i32 20, i32 25, i32 25, i32 10, i32 -10, i32 0, i32 0, i32 0, i32 0, i32 -10, i32 0, i32 20, i32 20, i32 20, i32 20, i32 0, i32 -10, i32 0, i32 0, i32 0, i32 0, i32 -10, i32 0, i32 15, i32 15, i32 15, i32 15, i32 0, i32 -10, i32 0, i32 0, i32 0, i32 0, i32 -10, i32 0, i32 0, i32 3, i32 3, i32 0, i32 0, i32 -10, i32 0, i32 0, i32 0, i32 0, i32 -20, i32 -35, i32 -10, i32 -10, i32 -10, i32 -10, i32 -35, i32 -20, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0 ] ; <[144 x i32]*> [#uses=0]
-@white_knight = internal global [144 x i32] [ i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 -20, i32 -35, i32 -10, i32 -10, i32 -10, i32 -10, i32 -35, i32 -20, i32 0, i32 0, i32 0, i32 0, i32 -10, i32 0, i32 0, i32 3, i32 3, i32 0, i32 0, i32 -10, i32 0, i32 0, i32 0, i32 0, i32 -10, i32 0, i32 15, i32 15, i32 15, i32 15, i32 0, i32 -10, i32 0, i32 0, i32 0, i32 0, i32 -10, i32 0, i32 20, i32 20, i32 20, i32 20, i32 0, i32 -10, i32 0, i32 0, i32 0, i32 0, i32 -10, i32 10, i32 25, i32 20, i32 25, i32 25, i32 10, i32 -10, i32 0, i32 0, i32 0, i32 0, i32 -10, i32 15, i32 25, i32 35, i32 35, i32 35, i32 15, i32 -10, i32 0, i32 0, i32 0, i32 0, i32 -10, i32 15, i32 25, i32 25, i32 25, i32 25, i32 15, i32 -10, i32 0, i32 0, i32 0, i32 0, i32 -20, i32 -10, i32 -10, i32 -10, i32 -10, i32 -10, i32 -10, i32 -20, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0 ] ; <[144 x i32]*> [#uses=0]
-@white_pawn = internal global [144 x i32] [ i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 25, i32 25, i32 35, i32 5, i32 5, i32 50, i32 45, i32 30, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 7, i32 7, i32 5, i32 5, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 14, i32 14, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 10, i32 20, i32 20, i32 10, i32 5, i32 5, i32 0, i32 0, i32 0, i32 0, i32 12, i32 18, i32 18, i32 27, i32 27, i32 18, i32 18, i32 18, i32 0, i32 0, i32 0, i32 0, i32 25, i32 30, i32 30, i32 35, i32 35, i32 35, i32 30, i32 25, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0 ] ; <[144 x i32]*> [#uses=0]
-@black_pawn = internal global [144 x i32] [ i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 30, i32 30, i32 30, i32 35, i32 35, i32 35, i32 30, i32 25, i32 0, i32 0, i32 0, i32 0, i32 12, i32 18, i32 18, i32 27, i32 27, i32 18, i32 18, i32 18, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 10, i32 20, i32 20, i32 10, i32 5, i32 5, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 14, i32 14, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 7, i32 7, i32 5, i32 5, i32 0, i32 0, i32 0, i32 0, i32 0, i32 25, i32 25, i32 35, i32 5, i32 5, i32 50, i32 45, i32 30, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0 ] ; <[144 x i32]*> [#uses=0]
-@white_king = internal global [144 x i32] [ i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 -100, i32 7, i32 4, i32 0, i32 10, i32 4, i32 7, i32 -100, i32 0, i32 0, i32 0, i32 0, i32 -250, i32 -200, i32 -150, i32 -100, i32 -100, i32 -150, i32 -200, i32 -250, i32 0, i32 0, i32 0, i32 0, i32 -350, i32 -300, i32 -300, i32 -250, i32 -250, i32 -300, i32 -300, i32 -350, i32 0, i32 0, i32 0, i32 0, i32 -400, i32 -400, i32 -400, i32 -350, i32 -350, i32 -400, i32 -400, i32 -400, i32 0, i32 0, i32 0, i32 0, i32 -450, i32 -450, i32 -450, i32 -450, i32 -450, i32 -450, i32 -450, i32 -450, i32 0, i32 0, i32 0, i32 0, i32 -500, i32 -500, i32 -500, i32 -500, i32 -500, i32 -500, i32 -500, i32 -500, i32 0, i32 0, i32 0, i32 0, i32 -500, i32 -500, i32 -500, i32 -500, i32 -500, i32 -500, i32 -500, i32 -500, i32 0, i32 0, i32 0, i32 0, i32 -500, i32 -500, i32 -500, i32 -500, i32 -500, i32 -500, i32 -500, i32 -500, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0 ] ; <[144 x i32]*> [#uses=0]
-@black_king = internal global [144 x i32] [ i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 -500, i32 -500, i32 -500, i32 -500, i32 -500, i32 -500, i32 -500, i32 -500, i32 0, i32 0, i32 0, i32 0, i32 -500, i32 -500, i32 -500, i32 -500, i32 -500, i32 -500, i32 -500, i32 -500, i32 0, i32 0, i32 0, i32 0, i32 -500, i32 -500, i32 -500, i32 -500, i32 -500, i32 -500, i32 -500, i32 -500, i32 0, i32 0, i32 0, i32 0, i32 -450, i32 -450, i32 -450, i32 -450, i32 -450, i32 -450, i32 -450, i32 -450, i32 0, i32 0, i32 0, i32 0, i32 -400, i32 -400, i32 -400, i32 -350, i32 -350, i32 -400, i32 -400, i32 -400, i32 0, i32 0, i32 0, i32 0, i32 -350, i32 -300, i32 -300, i32 -250, i32 -250, i32 -300, i32 -300, i32 -350, i32 0, i32 0, i32 0, i32 0, i32 -250, i32 -200, i32 -150, i32 -100, i32 -100, i32 -150, i32 -200, i32 -250, i32 0, i32 0, i32 0, i32 0, i32 -100, i32 7, i32 4, i32 0, i32 10, i32 4, i32 7, i32 -100, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0 ] ; <[144 x i32]*> [#uses=0]
-@black_queen = internal global [144 x i32] [ i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 5, i32 5, i32 5, i32 10, i32 10, i32 5, i32 5, i32 5, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 3, i32 3, i32 3, i32 3, i32 3, i32 0, i32 0, i32 0, i32 0, i32 0, i32 -30, i32 -30, i32 -30, i32 -30, i32 -30, i32 -30, i32 -30, i32 -30, i32 0, i32 0, i32 0, i32 0, i32 -60, i32 -40, i32 -40, i32 -60, i32 -60, i32 -40, i32 -40, i32 -60, i32 0, i32 0, i32 0, i32 0, i32 -40, i32 -40, i32 -40, i32 -40, i32 -40, i32 -40, i32 -40, i32 -40, i32 0, i32 0, i32 0, i32 0, i32 -15, i32 -15, i32 -15, i32 -10, i32 -10, i32 -15, i32 -15, i32 -15, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 7, i32 10, i32 5, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 5, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0 ] ; <[144 x i32]*> [#uses=0]
-@white_queen = internal global [144 x i32] [ i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 5, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 7, i32 10, i32 5, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 -15, i32 -15, i32 -15, i32 -10, i32 -10, i32 -15, i32 -15, i32 -15, i32 0, i32 0, i32 0, i32 0, i32 -40, i32 -40, i32 -40, i32 -40, i32 -40, i32 -40, i32 -40, i32 -40, i32 0, i32 0, i32 0, i32 0, i32 -60, i32 -40, i32 -40, i32 -60, i32 -60, i32 -40, i32 -40, i32 -60, i32 0, i32 0, i32 0, i32 0, i32 -30, i32 -30, i32 -30, i32 -30, i32 -30, i32 -30, i32 -30, i32 -30, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 3, i32 3, i32 3, i32 3, i32 3, i32 0, i32 0, i32 0, i32 0, i32 0, i32 5, i32 5, i32 5, i32 10, i32 10, i32 5, i32 5, i32 5, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0 ] ; <[144 x i32]*> [#uses=0]
-@black_rook = internal global [144 x i32] [ i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 10, i32 15, i32 20, i32 25, i32 25, i32 20, i32 15, i32 10, i32 0, i32 0, i32 0, i32 0, i32 0, i32 10, i32 15, i32 20, i32 20, i32 15, i32 10, i32 0, i32 0, i32 0, i32 0, i32 0, i32 -20, i32 -20, i32 -20, i32 -20, i32 -20, i32 -20, i32 -20, i32 -20, i32 0, i32 0, i32 0, i32 0, i32 -20, i32 -20, i32 -20, i32 -30, i32 -30, i32 -20, i32 -20, i32 -20, i32 0, i32 0, i32 0, i32 0, i32 -20, i32 -20, i32 -20, i32 -20, i32 -20, i32 -20, i32 -20, i32 -20, i32 0, i32 0, i32 0, i32 0, i32 -15, i32 -15, i32 -15, i32 -10, i32 -10, i32 -15, i32 -15, i32 -15, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 7, i32 10, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 2, i32 2, i32 2, i32 2, i32 2, i32 2, i32 2, i32 2, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0 ] ; <[144 x i32]*> [#uses=0]
-@white_rook = internal global [144 x i32] [ i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 2, i32 2, i32 2, i32 2, i32 2, i32 2, i32 2, i32 2, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 7, i32 10, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 -15, i32 -15, i32 -15, i32 -10, i32 -10, i32 -15, i32 -15, i32 -15, i32 0, i32 0, i32 0, i32 0, i32 -20, i32 -20, i32 -20, i32 -20, i32 -20, i32 -20, i32 -20, i32 -20, i32 0, i32 0, i32 0, i32 0, i32 -20, i32 -20, i32 -20, i32 -30, i32 -30, i32 -20, i32 -20, i32 -20, i32 0, i32 0, i32 0, i32 0, i32 -20, i32 -20, i32 -20, i32 -20, i32 -20, i32 -20, i32 -20, i32 -20, i32 0, i32 0, i32 0, i32 0, i32 0, i32 10, i32 15, i32 20, i32 20, i32 15, i32 10, i32 0, i32 0, i32 0, i32 0, i32 0, i32 10, i32 15, i32 20, i32 25, i32 25, i32 20, i32 15, i32 10, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0 ] ; <[144 x i32]*> [#uses=0]
-@upscale = internal global [64 x i32] [ i32 26, i32 27, i32 28, i32 29, i32 30, i32 31, i32 32, i32 33, i32 38, i32 39, i32 40, i32 41, i32 42, i32 43, i32 44, i32 45, i32 50, i32 51, i32 52, i32 53, i32 54, i32 55, i32 56, i32 57, i32 62, i32 63, i32 64, i32 65, i32 66, i32 67, i32 68, i32 69, i32 74, i32 75, i32 76, i32 77, i32 78, i32 79, i32 80, i32 81, i32 86, i32 87, i32 88, i32 89, i32 90, i32 91, i32 92, i32 93, i32 98, i32 99, i32 100, i32 101, i32 102, i32 103, i32 104, i32 105, i32 110, i32 111, i32 112, i32 113, i32 114, i32 115, i32 116, i32 117 ] ; <[64 x i32]*> [#uses=0]
-@pre_p_tropism = internal global [9 x i32] [ i32 9999, i32 40, i32 20, i32 10, i32 3, i32 1, i32 1, i32 0, i32 9999 ] ; <[9 x i32]*> [#uses=0]
-@pre_r_tropism = internal global [9 x i32] [ i32 9999, i32 50, i32 40, i32 15, i32 5, i32 1, i32 1, i32 0, i32 9999 ] ; <[9 x i32]*> [#uses=0]
-@pre_n_tropism = internal global [9 x i32] [ i32 9999, i32 50, i32 70, i32 35, i32 10, i32 2, i32 1, i32 0, i32 9999 ] ; <[9 x i32]*> [#uses=0]
-@pre_q_tropism = internal global [9 x i32] [ i32 9999, i32 100, i32 60, i32 20, i32 5, i32 2, i32 0, i32 0, i32 9999 ] ; <[9 x i32]*> [#uses=0]
-@pre_b_tropism = internal global [9 x i32] [ i32 9999, i32 50, i32 25, i32 15, i32 5, i32 2, i32 2, i32 2, i32 9999 ] ; <[9 x i32]*> [#uses=0]
-@rookdistance = internal global [144 x [144 x i32]] zeroinitializer ; <[144 x [144 x i32]]*> [#uses=0]
-@distance = internal global [144 x [144 x i32]] zeroinitializer ; <[144 x [144 x i32]]*> [#uses=0]
-@p_tropism = internal global [144 x [144 x i8]] zeroinitializer ; <[144 x [144 x i8]]*> [#uses=0]
-@b_tropism = internal global [144 x [144 x i8]] zeroinitializer ; <[144 x [144 x i8]]*> [#uses=0]
-@n_tropism = internal global [144 x [144 x i8]] zeroinitializer ; <[144 x [144 x i8]]*> [#uses=0]
-@r_tropism = internal global [144 x [144 x i8]] zeroinitializer ; <[144 x [144 x i8]]*> [#uses=0]
-@q_tropism = internal global [144 x [144 x i8]] zeroinitializer ; <[144 x [144 x i8]]*> [#uses=0]
-@cfg_devscale.b = internal global i1 false ; <i1*> [#uses=0]
-@pieces = internal global [62 x i32] zeroinitializer ; <[62 x i32]*> [#uses=0]
-@piece_count = internal global i32 0 ; <i32*> [#uses=1]
-@cfg_smarteval.b = internal global i1 false ; <i1*> [#uses=0]
-@lcentral = internal global [144 x i32] [ i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 -20, i32 -15, i32 -15, i32 -15, i32 -15, i32 -15, i32 -15, i32 -20, i32 0, i32 0, i32 0, i32 0, i32 -15, i32 0, i32 3, i32 5, i32 5, i32 3, i32 0, i32 -15, i32 0, i32 0, i32 0, i32 0, i32 -15, i32 0, i32 15, i32 15, i32 15, i32 15, i32 0, i32 -15, i32 0, i32 0, i32 0, i32 0, i32 -15, i32 0, i32 15, i32 30, i32 30, i32 15, i32 0, i32 -15, i32 0, i32 0, i32 0, i32 0, i32 -15, i32 0, i32 15, i32 30, i32 30, i32 15, i32 0, i32 -15, i32 0, i32 0, i32 0, i32 0, i32 -15, i32 0, i32 15, i32 15, i32 15, i32 15, i32 0, i32 -15, i32 0, i32 0, i32 0, i32 0, i32 -15, i32 0, i32 3, i32 5, i32 5, i32 3, i32 0, i32 -15, i32 0, i32 0, i32 0, i32 0, i32 -20, i32 -15, i32 -15, i32 -15, i32 -15, i32 -15, i32 -15, i32 -20, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0 ] ; <[144 x i32]*> [#uses=0]
-@str3.upgrd.21 = internal global [81 x i8] c"/Volumes/Stuff/src/speccpu2006-091-llvm/benchspec//CPU2006/458.sjeng/src/leval.c\00" ; <[81 x i8]*> [#uses=0]
-@str5 = internal global [21 x i8] c"(i > 0) && (i < 145)\00" ; <[21 x i8]*> [#uses=0]
-@kingcap.b = internal global i1 false ; <i1*> [#uses=0]
-@numb_moves = internal global i32 0 ; <i32*> [#uses=2]
-@genfor = internal global %struct.move_s* null ; <%struct.move_s**> [#uses=0]
-@captures = internal global i32 0 ; <i32*> [#uses=1]
-@fcaptures.b = internal global i1 false ; <i1*> [#uses=0]
-@gfrom = internal global i32 0 ; <i32*> [#uses=0]
-@Giveaway.b = internal global i1 false ; <i1*> [#uses=0]
-@path_x = internal global [300 x %struct.move_x] zeroinitializer ; <[300 x %struct.move_x]*> [#uses=0]
-@str7 = internal global [81 x i8] c"/Volumes/Stuff/src/speccpu2006-091-llvm/benchspec//CPU2006/458.sjeng/src/moves.c\00" ; <[81 x i8]*> [#uses=0]
-@str8 = internal global [15 x i8] c"find_slot < 63\00" ; <[15 x i8]*> [#uses=0]
-@is_promoted = internal global [62 x i32] zeroinitializer ; <[62 x i32]*> [#uses=0]
-@squares = internal global [144 x i32] zeroinitializer ; <[144 x i32]*> [#uses=0]
-@str.upgrd.22 = internal global [38 x i8] c"promoted > frame && promoted < npiece\00" ; <[38 x i8]*> [#uses=0]
-@str1.upgrd.23 = internal global [38 x i8] c"promoted < npiece && promoted > frame\00" ; <[38 x i8]*> [#uses=0]
-@evalRoutines = internal global [7 x i32 (i32, i32)*] [ i32 (i32, i32)* @ErrorIt, i32 (i32, i32)* @Pawn, i32 (i32, i32)* @Knight, i32 (i32, i32)* @King, i32 (i32, i32)* @Rook, i32 (i32, i32)* @Queen, i32 (i32, i32)* @Bishop ] ; <[7 x i32 (i32, i32)*]*> [#uses=0]
-@sbishop = internal global [144 x i32] [ i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 -2, i32 -2, i32 -2, i32 -2, i32 -2, i32 -2, i32 -2, i32 -2, i32 0, i32 0, i32 0, i32 0, i32 -2, i32 8, i32 5, i32 5, i32 5, i32 5, i32 8, i32 -2, i32 0, i32 0, i32 0, i32 0, i32 -2, i32 3, i32 3, i32 5, i32 5, i32 3, i32 3, i32 -2, i32 0, i32 0, i32 0, i32 0, i32 -2, i32 2, i32 5, i32 4, i32 4, i32 5, i32 2, i32 -2, i32 0, i32 0, i32 0, i32 0, i32 -2, i32 2, i32 5, i32 4, i32 4, i32 5, i32 2, i32 -2, i32 0, i32 0, i32 0, i32 0, i32 -2, i32 3, i32 3, i32 5, i32 5, i32 3, i32 3, i32 -2, i32 0, i32 0, i32 0, i32 0, i32 -2, i32 8, i32 5, i32 5, i32 5, i32 5, i32 8, i32 -2, i32 0, i32 0, i32 0, i32 0, i32 -2, i32 -2, i32 -2, i32 -2, i32 -2, i32 -2, i32 -2, i32 -2, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0 ] ; <[144 x i32]*> [#uses=0]
-@sknight = internal global [144 x i32] [ i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 -20, i32 -10, i32 -10, i32 -10, i32 -10, i32 -10, i32 -10, i32 -20, i32 0, i32 0, i32 0, i32 0, i32 -10, i32 0, i32 0, i32 3, i32 3, i32 0, i32 0, i32 -10, i32 0, i32 0, i32 0, i32 0, i32 -10, i32 0, i32 5, i32 5, i32 5, i32 5, i32 0, i32 -10, i32 0, i32 0, i32 0, i32 0, i32 -10, i32 0, i32 5, i32 10, i32 10, i32 5, i32 0, i32 -10, i32 0, i32 0, i32 0, i32 0, i32 -10, i32 0, i32 5, i32 10, i32 10, i32 5, i32 0, i32 -10, i32 0, i32 0, i32 0, i32 0, i32 -10, i32 0, i32 5, i32 5, i32 5, i32 5, i32 0, i32 -10, i32 0, i32 0, i32 0, i32 0, i32 -10, i32 0, i32 0, i32 3, i32 3, i32 0, i32 0, i32 -10, i32 0, i32 0, i32 0, i32 0, i32 -20, i32 -10, i32 -10, i32 -10, i32 -10, i32 -10, i32 -10, i32 -20, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0 ] ; <[144 x i32]*> [#uses=0]
-@swhite_pawn = internal global [144 x i32] [ i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 1, i32 2, i32 3, i32 10, i32 10, i32 3, i32 2, i32 1, i32 0, i32 0, i32 0, i32 0, i32 2, i32 4, i32 6, i32 12, i32 12, i32 6, i32 4, i32 2, i32 0, i32 0, i32 0, i32 0, i32 3, i32 6, i32 9, i32 14, i32 14, i32 9, i32 6, i32 3, i32 0, i32 0, i32 0, i32 0, i32 10, i32 12, i32 14, i32 16, i32 16, i32 14, i32 12, i32 10, i32 0, i32 0, i32 0, i32 0, i32 20, i32 22, i32 24, i32 26, i32 26, i32 24, i32 22, i32 20, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0 ] ; <[144 x i32]*> [#uses=0]
-@sblack_pawn = internal global [144 x i32] [ i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 20, i32 22, i32 24, i32 26, i32 26, i32 24, i32 22, i32 20, i32 0, i32 0, i32 0, i32 0, i32 10, i32 12, i32 14, i32 16, i32 16, i32 14, i32 12, i32 10, i32 0, i32 0, i32 0, i32 0, i32 3, i32 6, i32 9, i32 14, i32 14, i32 9, i32 6, i32 3, i32 0, i32 0, i32 0, i32 0, i32 2, i32 4, i32 6, i32 12, i32 12, i32 6, i32 4, i32 2, i32 0, i32 0, i32 0, i32 0, i32 1, i32 2, i32 3, i32 10, i32 10, i32 3, i32 2, i32 1, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0 ] ; <[144 x i32]*> [#uses=0]
-@swhite_king = internal global [144 x i32] [ i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 2, i32 14, i32 0, i32 0, i32 0, i32 9, i32 14, i32 2, i32 0, i32 0, i32 0, i32 0, i32 -3, i32 -5, i32 -6, i32 -6, i32 -6, i32 -6, i32 -5, i32 -3, i32 0, i32 0, i32 0, i32 0, i32 -5, i32 -5, i32 -8, i32 -8, i32 -8, i32 -8, i32 -5, i32 -5, i32 0, i32 0, i32 0, i32 0, i32 -8, i32 -8, i32 -13, i32 -13, i32 -13, i32 -13, i32 -8, i32 -8, i32 0, i32 0, i32 0, i32 0, i32 -13, i32 -13, i32 -21, i32 -21, i32 -21, i32 -21, i32 -13, i32 -13, i32 0, i32 0, i32 0, i32 0, i32 -21, i32 -21, i32 -34, i32 -34, i32 -34, i32 -34, i32 -21, i32 -21, i32 0, i32 0, i32 0, i32 0, i32 -34, i32 -34, i32 -55, i32 -55, i32 -55, i32 -55, i32 -34, i32 -34, i32 0, i32 0, i32 0, i32 0, i32 -55, i32 -55, i32 -89, i32 -89, i32 -89, i32 -89, i32 -55, i32 -55, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0 ] ; <[144 x i32]*> [#uses=0]
-@sblack_king = internal global [144 x i32] [ i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 -55, i32 -55, i32 -89, i32 -89, i32 -89, i32 -89, i32 -55, i32 -55, i32 0, i32 0, i32 0, i32 0, i32 -34, i32 -34, i32 -55, i32 -55, i32 -55, i32 -55, i32 -34, i32 -34, i32 0, i32 0, i32 0, i32 0, i32 -21, i32 -21, i32 -34, i32 -34, i32 -34, i32 -34, i32 -21, i32 -21, i32 0, i32 0, i32 0, i32 0, i32 -13, i32 -13, i32 -21, i32 -21, i32 -21, i32 -21, i32 -13, i32 -13, i32 0, i32 0, i32 0, i32 0, i32 -8, i32 -8, i32 -13, i32 -13, i32 -13, i32 -13, i32 -8, i32 -8, i32 0, i32 0, i32 0, i32 0, i32 -5, i32 -5, i32 -8, i32 -8, i32 -8, i32 -8, i32 -5, i32 -5, i32 0, i32 0, i32 0, i32 0, i32 -3, i32 -5, i32 -6, i32 -6, i32 -6, i32 -6, i32 -5, i32 -3, i32 0, i32 0, i32 0, i32 0, i32 2, i32 14, i32 0, i32 0, i32 0, i32 9, i32 14, i32 2, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0 ] ; <[144 x i32]*> [#uses=0]
-@send_king = internal global [144 x i32] [ i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 -5, i32 -3, i32 -1, i32 0, i32 0, i32 -1, i32 -3, i32 -5, i32 0, i32 0, i32 0, i32 0, i32 -3, i32 10, i32 10, i32 10, i32 10, i32 10, i32 10, i32 -3, i32 0, i32 0, i32 0, i32 0, i32 -1, i32 10, i32 25, i32 25, i32 25, i32 25, i32 10, i32 -1, i32 0, i32 0, i32 0, i32 0, i32 0, i32 10, i32 25, i32 50, i32 50, i32 25, i32 10, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 10, i32 25, i32 50, i32 50, i32 25, i32 10, i32 0, i32 0, i32 0, i32 0, i32 0, i32 -1, i32 10, i32 25, i32 25, i32 25, i32 25, i32 10, i32 -1, i32 0, i32 0, i32 0, i32 0, i32 -3, i32 10, i32 10, i32 10, i32 10, i32 10, i32 10, i32 -3, i32 0, i32 0, i32 0, i32 0, i32 -5, i32 -3, i32 -1, i32 0, i32 0, i32 -1, i32 -3, i32 -5, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0 ] ; <[144 x i32]*> [#uses=0]
-@srev_rank = internal global [9 x i32] [ i32 0, i32 8, i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1 ] ; <[9 x i32]*> [#uses=0]
-@std_p_tropism = internal global [8 x i32] [ i32 9999, i32 15, i32 10, i32 7, i32 2, i32 0, i32 0, i32 0 ] ; <[8 x i32]*> [#uses=0]
-@std_own_p_tropism = internal global [8 x i32] [ i32 9999, i32 30, i32 10, i32 2, i32 0, i32 0, i32 0, i32 0 ] ; <[8 x i32]*> [#uses=0]
-@std_r_tropism = internal global [16 x i32] [ i32 9999, i32 0, i32 15, i32 5, i32 2, i32 1, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0 ] ; <[16 x i32]*> [#uses=0]
-@std_n_tropism = internal global [8 x i32] [ i32 9999, i32 14, i32 9, i32 6, i32 1, i32 0, i32 0, i32 0 ] ; <[8 x i32]*> [#uses=0]
-@std_q_tropism = internal global [8 x i32] [ i32 9999, i32 200, i32 50, i32 15, i32 3, i32 2, i32 1, i32 0 ] ; <[8 x i32]*> [#uses=0]
-@std_b_tropism = internal global [8 x i32] [ i32 9999, i32 12, i32 7, i32 5, i32 0, i32 0, i32 0, i32 0 ] ; <[8 x i32]*> [#uses=0]
-@phase = internal global i32 0 ; <i32*> [#uses=1]
-@dir.3001 = internal global [4 x i32] [ i32 -13, i32 -11, i32 11, i32 13 ] ; <[4 x i32]*> [#uses=0]
-@dir.3021 = internal global [4 x i32] [ i32 -1, i32 1, i32 12, i32 -12 ] ; <[4 x i32]*> [#uses=0]
-@king_locs = internal global [2 x i32] zeroinitializer ; <[2 x i32]*> [#uses=0]
-@square_d1.3081 = internal global [2 x i32] [ i32 29, i32 113 ] ; <[2 x i32]*> [#uses=0]
-@wmat = internal global i32 0 ; <i32*> [#uses=0]
-@bmat = internal global i32 0 ; <i32*> [#uses=0]
-@str.upgrd.24 = internal global [35 x i8] c"Illegal piece detected sq=%i c=%i\0A\00" ; <[35 x i8]*> [#uses=0]
-@str10 = internal global [81 x i8] c"/Volumes/Stuff/src/speccpu2006-091-llvm/benchspec//CPU2006/458.sjeng/src/neval.c\00" ; <[81 x i8]*> [#uses=0]
-@std_hand_value = internal global [13 x i32] [ i32 0, i32 100, i32 -100, i32 210, i32 -210, i32 0, i32 0, i32 250, i32 -250, i32 450, i32 -450, i32 230, i32 -230 ] ; <[13 x i32]*> [#uses=0]
-@xb_mode = internal global i32 0 ; <i32*> [#uses=0]
-@str.upgrd.25 = internal global [69 x i8] c"tellics ptell Hello! I am Sjeng and hope you enjoy playing with me.\0A\00" ; <[69 x i8]*> [#uses=0]
-@str.upgrd.26 = internal global [76 x i8] c"tellics ptell For help on some commands that I understand, ptell me 'help'\0A\00" ; <[76 x i8]*> [#uses=0]
-@str12 = internal global [3 x i8] c"%s\00" ; <[3 x i8]*> [#uses=0]
-@my_partner = internal global [256 x i8] zeroinitializer ; <[256 x i8]*> [#uses=0]
-@str13 = internal global [25 x i8] c"tellics set f5 bughouse\0A\00" ; <[25 x i8]*> [#uses=0]
-@str.upgrd.27 = internal global [16 x i8] c"tellics unseek\0A\00" ; <[16 x i8]*> [#uses=0]
-@str.upgrd.28 = internal global [20 x i8] c"tellics set f5 1=1\0A\00" ; <[20 x i8]*> [#uses=0]
-@str.upgrd.29 = internal global [80 x i8] c"is...uh...what did you say?\0A\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00" ; <[80 x i8]*> [#uses=0]
-@str.upgrd.30 = internal global [5 x i8] c"help\00" ; <[5 x i8]*> [#uses=0]
-@str.upgrd.31 = internal global [147 x i8] c"tellics ptell Commands that I understand are : sit, go, fast, slow, abort, flag, +/++/+++/-/--/---{p,n,b,r,q,d,h,trades}, x, dead, formula, help.\0A\00" ; <[147 x i8]*> [#uses=0]
-@str.upgrd.32 = internal global [6 x i8] c"sorry\00" ; <[6 x i8]*> [#uses=0]
-@str.upgrd.33 = internal global [59 x i8] c"tellics ptell Sorry, but I'm not playing a bughouse game.\0A\00" ; <[59 x i8]*> [#uses=0]
-@str.upgrd.34 = internal global [4 x i8] c"sit\00" ; <[4 x i8]*> [#uses=0]
-@str.upgrd.35 = internal global [56 x i8] c"tellics ptell Ok, I sit next move. Tell me when to go.\0A\00" ; <[56 x i8]*> [#uses=0]
-@must_sit.b = internal global i1 false ; <i1*> [#uses=0]
-@str114 = internal global [3 x i8] c"go\00" ; <[3 x i8]*> [#uses=0]
-@str2.upgrd.36 = internal global [5 x i8] c"move\00" ; <[5 x i8]*> [#uses=0]
-@str.upgrd.37 = internal global [31 x i8] c"tellics ptell Ok, I'm moving.\0A\00" ; <[31 x i8]*> [#uses=0]
-@str3.upgrd.38 = internal global [5 x i8] c"fast\00" ; <[5 x i8]*> [#uses=0]
-@str4.upgrd.39 = internal global [5 x i8] c"time\00" ; <[5 x i8]*> [#uses=0]
-@str15 = internal global [35 x i8] c"tellics ptell Ok, I'm going FAST!\0A\00" ; <[35 x i8]*> [#uses=0]
-@go_fast.b = internal global i1 false ; <i1*> [#uses=0]
-@str5.upgrd.40 = internal global [5 x i8] c"slow\00" ; <[5 x i8]*> [#uses=0]
-@str16 = internal global [36 x i8] c"tellics ptell Ok, moving normally.\0A\00" ; <[36 x i8]*> [#uses=0]
-@str6 = internal global [6 x i8] c"abort\00" ; <[6 x i8]*> [#uses=0]
-@str7.upgrd.41 = internal global [35 x i8] c"tellics ptell Requesting abort...\0A\00" ; <[35 x i8]*> [#uses=0]
-@str17 = internal global [15 x i8] c"tellics abort\0A\00" ; <[15 x i8]*> [#uses=0]
-@str8.upgrd.42 = internal global [5 x i8] c"flag\00" ; <[5 x i8]*> [#uses=0]
-@str.upgrd.43 = internal global [27 x i8] c"tellics ptell Flagging...\0A\00" ; <[27 x i8]*> [#uses=0]
-@str.upgrd.44 = internal global [14 x i8] c"tellics flag\0A\00" ; <[14 x i8]*> [#uses=0]
-@str18 = internal global [2 x i8] c"+\00" ; <[2 x i8]*> [#uses=0]
-@str9 = internal global [6 x i8] c"trade\00" ; <[6 x i8]*> [#uses=0]
-@str10.upgrd.45 = internal global [35 x i8] c"tellics ptell Ok, trading is GOOD\0A\00" ; <[35 x i8]*> [#uses=0]
-@str11 = internal global [4 x i8] c"+++\00" ; <[4 x i8]*> [#uses=0]
-@str12.upgrd.46 = internal global [6 x i8] c"mates\00" ; <[6 x i8]*> [#uses=0]
-@str13.upgrd.47 = internal global [3 x i8] c"++\00" ; <[3 x i8]*> [#uses=0]
-@str.upgrd.48 = internal global [49 x i8] c"is VERY good (ptell me 'x' to play normal again)\00" ; <[49 x i8]*> [#uses=0]
-@str.upgrd.49 = internal global [44 x i8] c"is good (ptell me 'x' to play normal again)\00" ; <[44 x i8]*> [#uses=0]
-@str19 = internal global [29 x i8] c"tellics ptell Ok, Knight %s\0A\00" ; <[29 x i8]*> [#uses=0]
-@str14 = internal global [29 x i8] c"tellics ptell Ok, Bishop %s\0A\00" ; <[29 x i8]*> [#uses=0]
-@str15.upgrd.50 = internal global [27 x i8] c"tellics ptell Ok, Rook %s\0A\00" ; <[27 x i8]*> [#uses=0]
-@str.upgrd.51 = internal global [28 x i8] c"tellics ptell Ok, Queen %s\0A\00" ; <[28 x i8]*> [#uses=0]
-@str16.upgrd.52 = internal global [27 x i8] c"tellics ptell Ok, Pawn %s\0A\00" ; <[27 x i8]*> [#uses=0]
-@str17.upgrd.53 = internal global [31 x i8] c"tellics ptell Ok, Diagonal %s\0A\00" ; <[31 x i8]*> [#uses=0]
-@str18.upgrd.54 = internal global [28 x i8] c"tellics ptell Ok, Heavy %s\0A\00" ; <[28 x i8]*> [#uses=0]
-@str20 = internal global [34 x i8] c"tellics ptell Ok, trading is BAD\0A\00" ; <[34 x i8]*> [#uses=0]
-@str20.upgrd.55 = internal global [4 x i8] c"---\00" ; <[4 x i8]*> [#uses=0]
-@str.upgrd.56 = internal global [53 x i8] c"mates you (ptell me 'x' when it no longer mates you)\00" ; <[53 x i8]*> [#uses=0]
-@str21 = internal global [3 x i8] c"--\00" ; <[3 x i8]*> [#uses=0]
-@str.upgrd.57 = internal global [52 x i8] c"is VERY bad (ptell me 'x' when it is no longer bad)\00" ; <[52 x i8]*> [#uses=0]
-@str21.upgrd.58 = internal global [47 x i8] c"is bad (ptell me 'x' when it is no longer bad)\00" ; <[47 x i8]*> [#uses=0]
-@str23 = internal global [16 x i8] c"mate me anymore\00" ; <[16 x i8]*> [#uses=0]
-@str24 = internal global [6 x i8] c"never\00" ; <[6 x i8]*> [#uses=0]
-@str25 = internal global [5 x i8] c"mind\00" ; <[5 x i8]*> [#uses=0]
-@str22 = internal global [9 x i8] c"ptell me\00" ; <[9 x i8]*> [#uses=0]
-@str.upgrd.59 = internal global [55 x i8] c"tellics ptell Ok, reverting to STANDARD piece values!\0A\00" ; <[55 x i8]*> [#uses=0]
-@partnerdead.b = internal global i1 false ; <i1*> [#uses=0]
-@piecedead.b = internal global i1 false ; <i1*> [#uses=0]
-@str.upgrd.60 = internal global [26 x i8] c"i'll have to sit...(dead)\00" ; <[26 x i8]*> [#uses=0]
-@str27 = internal global [5 x i8] c"dead\00" ; <[5 x i8]*> [#uses=0]
-@str28 = internal global [27 x i8] c"i'll have to sit...(piece)\00" ; <[27 x i8]*> [#uses=0]
-@str29 = internal global [3 x i8] c"ok\00" ; <[3 x i8]*> [#uses=0]
-@str30 = internal global [3 x i8] c"hi\00" ; <[3 x i8]*> [#uses=0]
-@str31 = internal global [6 x i8] c"hello\00" ; <[6 x i8]*> [#uses=0]
-@str32 = internal global [26 x i8] c"tellics ptell Greetings.\0A\00" ; <[26 x i8]*> [#uses=0]
-@str.upgrd.61 = internal global [8 x i8] c"formula\00" ; <[8 x i8]*> [#uses=0]
-@str.upgrd.62 = internal global [87 x i8] c"tellics ptell Setting formula, if you are still interrupted, complain to my operator.\0A\00" ; <[87 x i8]*> [#uses=0]
-@str33 = internal global [59 x i8] c"tellics ptell Sorry, but I don't understand that command.\0A\00" ; <[59 x i8]*> [#uses=0]
-@pawnmated.3298 = internal global i32 0 ; <i32*> [#uses=0]
-@knightmated.3299 = internal global i32 0 ; <i32*> [#uses=0]
-@bishopmated.3300 = internal global i32 0 ; <i32*> [#uses=0]
-@rookmated.3301 = internal global i32 0 ; <i32*> [#uses=0]
-@queenmated.3302 = internal global i32 0 ; <i32*> [#uses=0]
-@str.upgrd.63 = internal global [41 x i8] c"tellics ptell p doesn't mate me anymore\0A\00" ; <[41 x i8]*> [#uses=0]
-@str34 = internal global [41 x i8] c"tellics ptell n doesn't mate me anymore\0A\00" ; <[41 x i8]*> [#uses=0]
-@str35 = internal global [41 x i8] c"tellics ptell b doesn't mate me anymore\0A\00" ; <[41 x i8]*> [#uses=0]
-@str36 = internal global [41 x i8] c"tellics ptell r doesn't mate me anymore\0A\00" ; <[41 x i8]*> [#uses=0]
-@str37 = internal global [41 x i8] c"tellics ptell q doesn't mate me anymore\0A\00" ; <[41 x i8]*> [#uses=0]
-@str38 = internal global [20 x i8] c"tellics ptell ---p\0A\00" ; <[20 x i8]*> [#uses=0]
-@str39 = internal global [20 x i8] c"tellics ptell ---n\0A\00" ; <[20 x i8]*> [#uses=0]
-@str40 = internal global [20 x i8] c"tellics ptell ---b\0A\00" ; <[20 x i8]*> [#uses=0]
-@str41 = internal global [20 x i8] c"tellics ptell ---r\0A\00" ; <[20 x i8]*> [#uses=0]
-@str42 = internal global [20 x i8] c"tellics ptell ---q\0A\00" ; <[20 x i8]*> [#uses=0]
-@str23.upgrd.64 = internal global [17 x i8] c"tellics ptell x\0A\00" ; <[17 x i8]*> [#uses=0]
-@str.upgrd.65 = internal global [18 x i8] c"tellics ptell go\0A\00" ; <[18 x i8]*> [#uses=0]
-@bufftop = internal global i32 0 ; <i32*> [#uses=2]
-@membuff = internal global i8* null ; <i8**> [#uses=3]
-@maxply = internal global i32 0 ; <i32*> [#uses=1]
-@forwards = internal global i32 0 ; <i32*> [#uses=1]
-@nodecount = internal global i32 0 ; <i32*> [#uses=1]
-@frees = internal global i32 0 ; <i32*> [#uses=0]
-@PBSize.b = internal global i1 false ; <i1*> [#uses=1]
-@alllosers.b = internal global i1 false ; <i1*> [#uses=1]
-@rootlosers = internal global [300 x i32] zeroinitializer ; <[300 x i32]*> [#uses=1]
-@pn_move = internal global %struct.move_s zeroinitializer ; <%struct.move_s*> [#uses=7]
-@iters = internal global i32 0 ; <i32*> [#uses=1]
-@kibitzed.b = internal global i1 false ; <i1*> [#uses=0]
-@str24.upgrd.66 = internal global [28 x i8] c"tellics kibitz Forced win!\0A\00" ; <[28 x i8]*> [#uses=0]
-@str25.upgrd.67 = internal global [34 x i8] c"tellics kibitz Forced win! (alt)\0A\00" ; <[34 x i8]*> [#uses=0]
-@pn_time = internal global i32 0 ; <i32*> [#uses=1]
-@post = internal global i32 0 ; <i32*> [#uses=0]
-@str.upgrd.68 = internal global [94 x i8] c"tellics whisper proof %d, disproof %d, %d losers, highest depth %d, primary %d, secondary %d\0A\00" ; <[94 x i8]*> [#uses=0]
-@str26 = internal global [30 x i8] c"tellics whisper Forced reply\0A\00" ; <[30 x i8]*> [#uses=0]
-@str27.upgrd.69 = internal global [60 x i8] c"P: %d D: %d N: %d S: %d Mem: %2.2fM Iters: %d MaxDepth: %d\0A\00" ; <[60 x i8]*> [#uses=0]
-@str.upgrd.70 = internal global [90 x i8] c"tellics whisper proof %d, disproof %d, %d nodes, %d forwards, %d iters, highest depth %d\0A\00" ; <[90 x i8]*> [#uses=0]
-@str.upgrd.71 = internal global [11 x i8] c"Time : %f\0A\00" ; <[11 x i8]*> [#uses=0]
-@str28.upgrd.72 = internal global [23 x i8] c"This position is WON.\0A\00" ; <[23 x i8]*> [#uses=0]
-@str29.upgrd.73 = internal global [5 x i8] c"PV: \00" ; <[5 x i8]*> [#uses=0]
-@str30.upgrd.74 = internal global [4 x i8] c"%s \00" ; <[4 x i8]*> [#uses=0]
-@str31.upgrd.75 = internal global [2 x i8] c" \00" ; <[2 x i8]*> [#uses=0]
-@str32.upgrd.76 = internal global [41 x i8] c"\0Atellics kibitz Forced win in %d moves.\0A\00" ; <[41 x i8]*> [#uses=0]
-@str33.upgrd.77 = internal global [20 x i8] c"\0A1-0 {White mates}\0A\00" ; <[20 x i8]*> [#uses=0]
-@result = internal global i32 0 ; <i32*> [#uses=4]
-@str1.upgrd.78 = internal global [20 x i8] c"\0A0-1 {Black mates}\0A\00" ; <[20 x i8]*> [#uses=0]
-@str35.upgrd.79 = internal global [24 x i8] c"This position is LOST.\0A\00" ; <[24 x i8]*> [#uses=0]
-@str36.upgrd.80 = internal global [27 x i8] c"This position is UNKNOWN.\0A\00" ; <[27 x i8]*> [#uses=0]
-@str37.upgrd.81 = internal global [47 x i8] c"P: %d D: %d N: %d S: %d Mem: %2.2fM Iters: %d\0A\00" ; <[47 x i8]*> [#uses=0]
-@s_threat.b = internal global i1 false ; <i1*> [#uses=0]
-@TTSize.b = internal global i1 false ; <i1*> [#uses=3]
-@cfg_razordrop.b = internal global i1 false ; <i1*> [#uses=0]
-@cfg_futprune.b = internal global i1 false ; <i1*> [#uses=0]
-@cfg_onerep.b = internal global i1 false ; <i1*> [#uses=0]
-@setcode = internal global [30 x i8] zeroinitializer ; <[30 x i8]*> [#uses=0]
-@str38.upgrd.82 = internal global [3 x i8] c"%u\00" ; <[3 x i8]*> [#uses=0]
-@searching_pv.b = internal global i1 false ; <i1*> [#uses=0]
-@pv = internal global [300 x [300 x %struct.move_s]] zeroinitializer ; <[300 x [300 x %struct.move_s]]*> [#uses=0]
-@i_depth = internal global i32 0 ; <i32*> [#uses=0]
-@history_h = internal global [144 x [144 x i32]] zeroinitializer ; <[144 x [144 x i32]]*> [#uses=0]
-@killer1 = internal global [300 x %struct.move_s] zeroinitializer ; <[300 x %struct.move_s]*> [#uses=0]
-@killer2 = internal global [300 x %struct.move_s] zeroinitializer ; <[300 x %struct.move_s]*> [#uses=0]
-@killer3 = internal global [300 x %struct.move_s] zeroinitializer ; <[300 x %struct.move_s]*> [#uses=0]
-@rootnodecount = internal global [512 x i32] zeroinitializer ; <[512 x i32]*> [#uses=0]
-@raw_nodes = internal global i32 0 ; <i32*> [#uses=0]
-@pv_length = internal global [300 x i32] zeroinitializer ; <[300 x i32]*> [#uses=0]
-@time_exit.b = internal global i1 false ; <i1*> [#uses=0]
-@time_for_move = internal global i32 0 ; <i32*> [#uses=3]
-@failed = internal global i32 0 ; <i32*> [#uses=0]
-@extendedtime.b = internal global i1 false ; <i1*> [#uses=1]
-@time_left = internal global i32 0 ; <i32*> [#uses=0]
-@str39.upgrd.83 = internal global [38 x i8] c"Extended from %d to %d, time left %d\0A\00" ; <[38 x i8]*> [#uses=0]
-@checks = internal global [300 x i32] zeroinitializer ; <[300 x i32]*> [#uses=0]
-@singular = internal global [300 x i32] zeroinitializer ; <[300 x i32]*> [#uses=0]
-@recaps = internal global [300 x i32] zeroinitializer ; <[300 x i32]*> [#uses=0]
-@ext_onerep = internal global i32 0 ; <i32*> [#uses=1]
-@FULL = internal global i32 0 ; <i32*> [#uses=1]
-@PVS = internal global i32 0 ; <i32*> [#uses=1]
-@PVSF = internal global i32 0 ; <i32*> [#uses=1]
-@killer_scores = internal global [300 x i32] zeroinitializer ; <[300 x i32]*> [#uses=0]
-@killer_scores2 = internal global [300 x i32] zeroinitializer ; <[300 x i32]*> [#uses=0]
-@killer_scores3 = internal global [300 x i32] zeroinitializer ; <[300 x i32]*> [#uses=0]
-@time_failure.b = internal global i1 false ; <i1*> [#uses=0]
-@cur_score = internal global i32 0 ; <i32*> [#uses=0]
-@legals = internal global i32 0 ; <i32*> [#uses=3]
-@movetotal = internal global i32 0 ; <i32*> [#uses=0]
-@searching_move = internal global [20 x i8] zeroinitializer ; <[20 x i8]*> [#uses=0]
-@is_pondering.b = internal global i1 false ; <i1*> [#uses=6]
-@true_i_depth = internal global i8 0 ; <i8*> [#uses=1]
-@is_analyzing.b = internal global i1 false ; <i1*> [#uses=0]
-@inc = internal global i32 0 ; <i32*> [#uses=1]
-@time_cushion = internal global i32 0 ; <i32*> [#uses=2]
-@str40.upgrd.84 = internal global [16 x i8] c"Opening phase.\0A\00" ; <[16 x i8]*> [#uses=1]
-@str.upgrd.85 = internal global [19 x i8] c"Middlegame phase.\0A\00" ; <[19 x i8]*> [#uses=1]
-@str1.upgrd.86 = internal global [16 x i8] c"Endgame phase.\0A\00" ; <[16 x i8]*> [#uses=1]
-@str43 = internal global [20 x i8] c"Time for move : %d\0A\00" ; <[20 x i8]*> [#uses=1]
-@postpv = internal global [256 x i8] zeroinitializer ; <[256 x i8]*> [#uses=0]
-@str44 = internal global [49 x i8] c"tellics whisper %d restart(s), ended up with %s\0A\00" ; <[49 x i8]*> [#uses=0]
-@moves_to_tc = internal global i32 0 ; <i32*> [#uses=0]
-@str45 = internal global [27 x i8] c"tellics kibitz Mate in %d\0A\00" ; <[27 x i8]*> [#uses=0]
-@str46 = internal global [52 x i8] c"tellics ptell Mate in %d, give him no more pieces.\0A\00" ; <[52 x i8]*> [#uses=0]
-@tradefreely.b = internal global i1 false ; <i1*> [#uses=0]
-@str.upgrd.87 = internal global [37 x i8] c"tellics ptell You can trade freely.\0A\00" ; <[37 x i8]*> [#uses=0]
-@str47 = internal global [25 x i8] c"tellics ptell ---trades\0A\00" ; <[25 x i8]*> [#uses=0]
-@str2.upgrd.88 = internal global [49 x i8] c"tellics kibitz Both players dead...resigning...\0A\00" ; <[49 x i8]*> [#uses=0]
-@str3.upgrd.89 = internal global [16 x i8] c"tellics resign\0A\00" ; <[16 x i8]*> [#uses=0]
-@str48 = internal global [81 x i8] c"tellics ptell I am forcedly mated (dead). Tell me 'go' to start moving into it.\0A\00" ; <[81 x i8]*> [#uses=0]
-@str.upgrd.90 = internal global [62 x i8] c"tellics ptell I'll have to sit...(lose piece that mates you)\0A\00" ; <[62 x i8]*> [#uses=0]
-@see_num_attackers = internal global [2 x i32] zeroinitializer ; <[2 x i32]*> [#uses=0]
-@see_attackers = internal global [2 x [16 x %struct.see_data]] zeroinitializer ; <[2 x [16 x %struct.see_data]]*> [#uses=0]
-@scentral = internal global [144 x i32] [ i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 -20, i32 -10, i32 -10, i32 -10, i32 -10, i32 -10, i32 -10, i32 -20, i32 0, i32 0, i32 0, i32 0, i32 -10, i32 0, i32 3, i32 5, i32 5, i32 3, i32 0, i32 -10, i32 0, i32 0, i32 0, i32 0, i32 -10, i32 2, i32 15, i32 15, i32 15, i32 15, i32 2, i32 -10, i32 0, i32 0, i32 0, i32 0, i32 -10, i32 7, i32 15, i32 25, i32 25, i32 15, i32 7, i32 -10, i32 0, i32 0, i32 0, i32 0, i32 -10, i32 7, i32 15, i32 25, i32 25, i32 15, i32 7, i32 -10, i32 0, i32 0, i32 0, i32 0, i32 -10, i32 2, i32 15, i32 15, i32 15, i32 15, i32 2, i32 -10, i32 0, i32 0, i32 0, i32 0, i32 -10, i32 0, i32 3, i32 5, i32 5, i32 3, i32 0, i32 -10, i32 0, i32 0, i32 0, i32 0, i32 -20, i32 -10, i32 -10, i32 -10, i32 -10, i32 -10, i32 -10, i32 -20, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0 ] ; <[144 x i32]*> [#uses=0]
-@str51 = internal global [81 x i8] c"/Volumes/Stuff/src/speccpu2006-091-llvm/benchspec//CPU2006/458.sjeng/src/seval.c\00" ; <[81 x i8]*> [#uses=0]
-@divider = internal global [50 x i8] c"-------------------------------------------------\00" ; <[50 x i8]*> [#uses=0]
-@min_per_game = internal global i32 0 ; <i32*> [#uses=0]
-@opp_rating = internal global i32 0 ; <i32*> [#uses=0]
-@my_rating = internal global i32 0 ; <i32*> [#uses=0]
-@str53 = internal global [15 x i8] c"SPEC Workload\0A\00" ; <[15 x i8]*> [#uses=0]
-@opening_history = internal global [256 x i8] zeroinitializer ; <[256 x i8]*> [#uses=0]
-@str60 = internal global [81 x i8] c"Material score: %d Eval : %d MaxPosDiff: %d White hand: %d Black hand : %d\0A\00" ; <[81 x i8]*> [#uses=0]
-@str61 = internal global [26 x i8] c"Hash : %X HoldHash : %X\0A\00" ; <[26 x i8]*> [#uses=0]
-@str62 = internal global [9 x i8] c"move %s\0A\00" ; <[9 x i8]*> [#uses=0]
-@str63 = internal global [5 x i8] c"\0A%s\0A\00" ; <[5 x i8]*> [#uses=0]
-@str64 = internal global [19 x i8] c"0-1 {Black Mates}\0A\00" ; <[19 x i8]*> [#uses=0]
-@str1.upgrd.91 = internal global [19 x i8] c"1-0 {White Mates}\0A\00" ; <[19 x i8]*> [#uses=0]
-@str65 = internal global [27 x i8] c"1/2-1/2 {Fifty move rule}\0A\00" ; <[27 x i8]*> [#uses=0]
-@str2.upgrd.92 = internal global [29 x i8] c"1/2-1/2 {3 fold repetition}\0A\00" ; <[29 x i8]*> [#uses=0]
-@str66 = internal global [16 x i8] c"1/2-1/2 {Draw}\0A\00" ; <[16 x i8]*> [#uses=0]
-@str68 = internal global [8 x i8] c"Sjeng: \00" ; <[8 x i8]*> [#uses=0]
-@str69 = internal global [18 x i8] c"Illegal move: %s\0A\00" ; <[18 x i8]*> [#uses=0]
-@str3.upgrd.93 = internal global [9 x i8] c"setboard\00" ; <[9 x i8]*> [#uses=0]
-@str470 = internal global [5 x i8] c"quit\00" ; <[5 x i8]*> [#uses=0]
-@str571 = internal global [5 x i8] c"exit\00" ; <[5 x i8]*> [#uses=0]
-@str6.upgrd.94 = internal global [8 x i8] c"diagram\00" ; <[8 x i8]*> [#uses=0]
-@str7.upgrd.95 = internal global [2 x i8] c"d\00" ; <[2 x i8]*> [#uses=0]
-@str72 = internal global [6 x i8] c"perft\00" ; <[6 x i8]*> [#uses=0]
-@str73 = internal global [3 x i8] c"%d\00" ; <[3 x i8]*> [#uses=0]
-@str74 = internal global [28 x i8] c"Raw nodes for depth %d: %i\0A\00" ; <[28 x i8]*> [#uses=0]
-@str.upgrd.96 = internal global [13 x i8] c"Time : %.2f\0A\00" ; <[13 x i8]*> [#uses=0]
-@str75 = internal global [4 x i8] c"new\00" ; <[4 x i8]*> [#uses=0]
-@str.upgrd.97 = internal global [40 x i8] c"tellics set 1 Sjeng SPEC 1.0 (SPEC/%s)\0A\00" ; <[40 x i8]*> [#uses=0]
-@str.upgrd.98 = internal global [7 x i8] c"xboard\00" ; <[7 x i8]*> [#uses=0]
-@str8.upgrd.99 = internal global [6 x i8] c"nodes\00" ; <[6 x i8]*> [#uses=0]
-@str77 = internal global [38 x i8] c"Number of nodes: %i (%0.2f%% qnodes)\0A\00" ; <[38 x i8]*> [#uses=0]
-@str9.upgrd.100 = internal global [5 x i8] c"post\00" ; <[5 x i8]*> [#uses=0]
-@str10.upgrd.101 = internal global [7 x i8] c"nopost\00" ; <[7 x i8]*> [#uses=0]
-@str11.upgrd.102 = internal global [7 x i8] c"random\00" ; <[7 x i8]*> [#uses=0]
-@str12.upgrd.103 = internal global [5 x i8] c"hard\00" ; <[5 x i8]*> [#uses=0]
-@str13.upgrd.104 = internal global [5 x i8] c"easy\00" ; <[5 x i8]*> [#uses=0]
-@str14.upgrd.105 = internal global [2 x i8] c"?\00" ; <[2 x i8]*> [#uses=0]
-@str15.upgrd.106 = internal global [6 x i8] c"white\00" ; <[6 x i8]*> [#uses=0]
-@str16.upgrd.107 = internal global [6 x i8] c"black\00" ; <[6 x i8]*> [#uses=0]
-@str17.upgrd.108 = internal global [6 x i8] c"force\00" ; <[6 x i8]*> [#uses=0]
-@str18.upgrd.109 = internal global [5 x i8] c"eval\00" ; <[5 x i8]*> [#uses=0]
-@str.upgrd.110 = internal global [10 x i8] c"Eval: %d\0A\00" ; <[10 x i8]*> [#uses=0]
-@str2178 = internal global [3 x i8] c"%i\00" ; <[3 x i8]*> [#uses=0]
-@str22.upgrd.111 = internal global [5 x i8] c"otim\00" ; <[5 x i8]*> [#uses=0]
-@opp_time = internal global i32 0 ; <i32*> [#uses=0]
-@str23.upgrd.112 = internal global [6 x i8] c"level\00" ; <[6 x i8]*> [#uses=0]
-@str.upgrd.113 = internal global [12 x i8] c"%i %i:%i %i\00" ; <[12 x i8]*> [#uses=0]
-@sec_per_game = internal global i32 0 ; <i32*> [#uses=0]
-@str24.upgrd.114 = internal global [9 x i8] c"%i %i %i\00" ; <[9 x i8]*> [#uses=0]
-@str25.upgrd.115 = internal global [7 x i8] c"rating\00" ; <[7 x i8]*> [#uses=0]
-@str26.upgrd.116 = internal global [6 x i8] c"%i %i\00" ; <[6 x i8]*> [#uses=0]
-@str27.upgrd.117 = internal global [8 x i8] c"holding\00" ; <[8 x i8]*> [#uses=0]
-@str28.upgrd.118 = internal global [8 x i8] c"variant\00" ; <[8 x i8]*> [#uses=0]
-@str29.upgrd.119 = internal global [7 x i8] c"normal\00" ; <[7 x i8]*> [#uses=0]
-@str79 = internal global [11 x i8] c"crazyhouse\00" ; <[11 x i8]*> [#uses=0]
-@str30.upgrd.120 = internal global [9 x i8] c"bughouse\00" ; <[9 x i8]*> [#uses=0]
-@str31.upgrd.121 = internal global [8 x i8] c"suicide\00" ; <[8 x i8]*> [#uses=0]
-@str32.upgrd.122 = internal global [9 x i8] c"giveaway\00" ; <[9 x i8]*> [#uses=0]
-@str33.upgrd.123 = internal global [7 x i8] c"losers\00" ; <[7 x i8]*> [#uses=0]
-@str34.upgrd.124 = internal global [8 x i8] c"analyze\00" ; <[8 x i8]*> [#uses=0]
-@str35.upgrd.125 = internal global [5 x i8] c"undo\00" ; <[5 x i8]*> [#uses=0]
-@str36.upgrd.126 = internal global [18 x i8] c"Move number : %d\0A\00" ; <[18 x i8]*> [#uses=0]
-@str37.upgrd.127 = internal global [7 x i8] c"remove\00" ; <[7 x i8]*> [#uses=0]
-@str38.upgrd.128 = internal global [5 x i8] c"edit\00" ; <[5 x i8]*> [#uses=0]
-@str41.upgrd.129 = internal global [2 x i8] c"#\00" ; <[2 x i8]*> [#uses=0]
-@str42.upgrd.130 = internal global [8 x i8] c"partner\00" ; <[8 x i8]*> [#uses=0]
-@str43.upgrd.131 = internal global [9 x i8] c"$partner\00" ; <[9 x i8]*> [#uses=0]
-@str44.upgrd.132 = internal global [6 x i8] c"ptell\00" ; <[6 x i8]*> [#uses=0]
-@str45.upgrd.133 = internal global [5 x i8] c"test\00" ; <[5 x i8]*> [#uses=0]
-@str46.upgrd.134 = internal global [3 x i8] c"st\00" ; <[3 x i8]*> [#uses=0]
-@str47.upgrd.135 = internal global [7 x i8] c"result\00" ; <[7 x i8]*> [#uses=0]
-@str48.upgrd.136 = internal global [6 x i8] c"prove\00" ; <[6 x i8]*> [#uses=0]
-@str49 = internal global [26 x i8] c"\0AMax time to search (s): \00" ; <[26 x i8]*> [#uses=0]
-@str50 = internal global [5 x i8] c"ping\00" ; <[5 x i8]*> [#uses=0]
-@str51.upgrd.137 = internal global [9 x i8] c"pong %d\0A\00" ; <[9 x i8]*> [#uses=0]
-@str52 = internal global [6 x i8] c"fritz\00" ; <[6 x i8]*> [#uses=0]
-@str53.upgrd.138 = internal global [6 x i8] c"reset\00" ; <[6 x i8]*> [#uses=0]
-@str54 = internal global [3 x i8] c"sd\00" ; <[3 x i8]*> [#uses=0]
-@str55 = internal global [26 x i8] c"New max depth set to: %d\0A\00" ; <[26 x i8]*> [#uses=0]
-@str56 = internal global [5 x i8] c"auto\00" ; <[5 x i8]*> [#uses=0]
-@str57 = internal global [9 x i8] c"protover\00" ; <[9 x i8]*> [#uses=0]
-@str.upgrd.139 = internal global [63 x i8] c"feature ping=0 setboard=1 playother=0 san=0 usermove=0 time=1\0A\00" ; <[63 x i8]*> [#uses=0]
-@str80 = internal global [53 x i8] c"feature draw=0 sigint=0 sigterm=0 reuse=1 analyze=0\0A\00" ; <[53 x i8]*> [#uses=0]
-@str.upgrd.140 = internal global [33 x i8] c"feature myname=\22Sjeng SPEC 1.0\22\0A\00" ; <[33 x i8]*> [#uses=0]
-@str.upgrd.141 = internal global [71 x i8] c"feature variants=\22normal,bughouse,crazyhouse,suicide,giveaway,losers\22\0A\00" ; <[71 x i8]*> [#uses=0]
-@str.upgrd.142 = internal global [46 x i8] c"feature colors=1 ics=0 name=0 pause=0 done=1\0A\00" ; <[46 x i8]*> [#uses=0]
-@str58 = internal global [9 x i8] c"accepted\00" ; <[9 x i8]*> [#uses=0]
-@str59 = internal global [9 x i8] c"rejected\00" ; <[9 x i8]*> [#uses=0]
-@str.upgrd.143 = internal global [65 x i8] c"Interface does not support a required feature...expect trouble.\0A\00" ; <[65 x i8]*> [#uses=0]
-@str61.upgrd.144 = internal global [6 x i8] c"\0A%s\0A\0A\00" ; <[6 x i8]*> [#uses=0]
-@str81 = internal global [41 x i8] c"diagram/d: toggle diagram display\0A\00" ; <[41 x i8]*> [#uses=0]
-@str82 = internal global [34 x i8] c"exit/quit: terminate Sjeng\0A\00" ; <[34 x i8]*> [#uses=0]
-@str62.upgrd.145 = internal global [51 x i8] c"go: make Sjeng play the side to move\0A\00" ; <[51 x i8]*> [#uses=0]
-@str83 = internal global [35 x i8] c"new: start a new game\0A\00" ; <[35 x i8]*> [#uses=0]
-@str84 = internal global [55 x i8] c"level <x>: the xboard style command to set time\0A\00" ; <[55 x i8]*> [#uses=0]
-@str85 = internal global [49 x i8] c" <x> should be in the form: <a> <b> <c> where:\0A\00" ; <[49 x i8]*> [#uses=0]
-@str63.upgrd.146 = internal global [49 x i8] c" a -> moves to TC (0 if using an ICS style TC)\0A\00" ; <[49 x i8]*> [#uses=0]
-@str86 = internal global [25 x i8] c" b -> minutes per game\0A\00" ; <[25 x i8]*> [#uses=0]
-@str64.upgrd.147 = internal global [29 x i8] c" c -> increment in seconds\0A\00" ; <[29 x i8]*> [#uses=0]
-@str65.upgrd.148 = internal global [55 x i8] c"nodes: outputs the number of nodes searched\0A\00" ; <[55 x i8]*> [#uses=0]
-@str87 = internal global [47 x i8] c"perft <x>: compute raw nodes to depth x\0A\00" ; <[47 x i8]*> [#uses=0]
-@str.upgrd.149 = internal global [42 x i8] c"post: toggles thinking output\0A\00" ; <[42 x i8]*> [#uses=0]
-@str.upgrd.150 = internal global [45 x i8] c"xboard: put Sjeng into xboard mode\0A\00" ; <[45 x i8]*> [#uses=0]
-@str.upgrd.151 = internal global [39 x i8] c"test: run an EPD testsuite\0A\00" ; <[39 x i8]*> [#uses=0]
-@str88 = internal global [52 x i8] c"speed: test movegen and evaluation speed\0A\00" ; <[52 x i8]*> [#uses=0]
-@str89 = internal global [59 x i8] c"proof: try to prove or disprove the current pos\0A\00" ; <[59 x i8]*> [#uses=0]
-@str90 = internal global [44 x i8] c"sd <x>: limit thinking to depth x\0A\00" ; <[44 x i8]*> [#uses=0]
-@str66.upgrd.152 = internal global [51 x i8] c"st <x>: limit thinking to x centiseconds\0A\00" ; <[51 x i8]*> [#uses=0]
-@str67 = internal global [54 x i8] c"setboard <FEN>: set board to a specified FEN string\0A\00" ; <[54 x i8]*> [#uses=0]
-@str68.upgrd.153 = internal global [38 x i8] c"undo: back up a half move\0A\00" ; <[38 x i8]*> [#uses=0]
-@str69.upgrd.154 = internal global [38 x i8] c"remove: back up a full move\0A\00" ; <[38 x i8]*> [#uses=0]
-@str70 = internal global [42 x i8] c"force: disable computer moving\0A\00" ; <[42 x i8]*> [#uses=0]
-@str71 = internal global [44 x i8] c"auto: computer plays both sides\0A\00" ; <[44 x i8]*> [#uses=0]
-@DP_TTable = internal global %struct.TType* null ; <%struct.TType**> [#uses=1]
-@AS_TTable = internal global %struct.TType* null ; <%struct.TType**> [#uses=1]
-@QS_TTable = internal global %struct.QTType* null ; <%struct.QTType**> [#uses=1]
-@str93 = internal global [38 x i8] c"Out of memory allocating hashtables.\0A\00" ; <[38 x i8]*> [#uses=0]
-@type_to_char.3058 = internal global [14 x i32] [ i32 70, i32 80, i32 80, i32 78, i32 78, i32 75, i32 75, i32 82, i32 82, i32 81, i32 81, i32 66, i32 66, i32 69 ] ; <[14 x i32]*> [#uses=0]
-@str94 = internal global [8 x i8] c"%c@%c%d\00" ; <[8 x i8]*> [#uses=0]
-@str95 = internal global [5 x i8] c"%c%d\00" ; <[5 x i8]*> [#uses=0]
-@str1.upgrd.155 = internal global [8 x i8] c"%c%d=%c\00" ; <[8 x i8]*> [#uses=0]
-@str2.upgrd.156 = internal global [8 x i8] c"%cx%c%d\00" ; <[8 x i8]*> [#uses=0]
-@str96 = internal global [11 x i8] c"%cx%c%d=%c\00" ; <[11 x i8]*> [#uses=0]
-@str97 = internal global [4 x i8] c"O-O\00" ; <[4 x i8]*> [#uses=0]
-@str98 = internal global [6 x i8] c"O-O-O\00" ; <[6 x i8]*> [#uses=0]
-@str99 = internal global [9 x i8] c"%c%c%c%d\00" ; <[9 x i8]*> [#uses=0]
-@str3100 = internal global [9 x i8] c"%c%d%c%d\00" ; <[9 x i8]*> [#uses=0]
-@str101 = internal global [10 x i8] c"%c%cx%c%d\00" ; <[10 x i8]*> [#uses=0]
-@str4.upgrd.157 = internal global [10 x i8] c"%c%dx%c%d\00" ; <[10 x i8]*> [#uses=0]
-@str102 = internal global [7 x i8] c"%c%c%d\00" ; <[7 x i8]*> [#uses=0]
-@str5103 = internal global [5 x i8] c"illg\00" ; <[5 x i8]*> [#uses=0]
-@type_to_char.3190 = internal global [14 x i32] [ i32 70, i32 80, i32 112, i32 78, i32 110, i32 75, i32 107, i32 82, i32 114, i32 81, i32 113, i32 66, i32 98, i32 69 ] ; <[14 x i32]*> [#uses=0]
-@str7.upgrd.158 = internal global [10 x i8] c"%c%d%c%dn\00" ; <[10 x i8]*> [#uses=0]
-@str8.upgrd.159 = internal global [10 x i8] c"%c%d%c%dr\00" ; <[10 x i8]*> [#uses=0]
-@str9.upgrd.160 = internal global [10 x i8] c"%c%d%c%db\00" ; <[10 x i8]*> [#uses=0]
-@str10.upgrd.161 = internal global [10 x i8] c"%c%d%c%dk\00" ; <[10 x i8]*> [#uses=0]
-@str11.upgrd.162 = internal global [10 x i8] c"%c%d%c%dq\00" ; <[10 x i8]*> [#uses=0]
-@C.88.3251 = internal global [14 x i8*] [ i8* getelementptr ([3 x i8]* @str105, i32 0, i32 0), i8* getelementptr ([3 x i8]* @str12106, i32 0, i32 0), i8* getelementptr ([3 x i8]* @str13107, i32 0, i32 0), i8* getelementptr ([3 x i8]* @str141, i32 0, i32 0), i8* getelementptr ([3 x i8]* @str152, i32 0, i32 0), i8* getelementptr ([3 x i8]* @str163, i32 0, i32 0), i8* getelementptr ([3 x i8]* @str174, i32 0, i32 0), i8* getelementptr ([3 x i8]* @str185, i32 0, i32 0), i8* getelementptr ([3 x i8]* @str19108, i32 0, i32 0), i8* getelementptr ([3 x i8]* @str206, i32 0, i32 0), i8* getelementptr ([3 x i8]* @str21109, i32 0, i32 0), i8* getelementptr ([3 x i8]* @str227, i32 0, i32 0), i8* getelementptr ([3 x i8]* @str238, i32 0, i32 0), i8* getelementptr ([3 x i8]* @str249, i32 0, i32 0) ] ; <[14 x i8*]*> [#uses=0]
-@str105 = internal global [3 x i8] c"!!\00" ; <[3 x i8]*> [#uses=1]
-@str12106 = internal global [3 x i8] c" P\00" ; <[3 x i8]*> [#uses=1]
-@str13107 = internal global [3 x i8] c"*P\00" ; <[3 x i8]*> [#uses=1]
-@str141 = internal global [3 x i8] c" N\00" ; <[3 x i8]*> [#uses=1]
-@str152 = internal global [3 x i8] c"*N\00" ; <[3 x i8]*> [#uses=1]
-@str163 = internal global [3 x i8] c" K\00" ; <[3 x i8]*> [#uses=1]
-@str174 = internal global [3 x i8] c"*K\00" ; <[3 x i8]*> [#uses=1]
-@str185 = internal global [3 x i8] c" R\00" ; <[3 x i8]*> [#uses=1]
-@str19108 = internal global [3 x i8] c"*R\00" ; <[3 x i8]*> [#uses=1]
-@str206 = internal global [3 x i8] c" Q\00" ; <[3 x i8]*> [#uses=1]
-@str21109 = internal global [3 x i8] c"*Q\00" ; <[3 x i8]*> [#uses=1]
-@str227 = internal global [3 x i8] c" B\00" ; <[3 x i8]*> [#uses=1]
-@str238 = internal global [3 x i8] c"*B\00" ; <[3 x i8]*> [#uses=1]
-@str249 = internal global [3 x i8] c" \00" ; <[3 x i8]*> [#uses=1]
-@str110 = internal global [42 x i8] c"+----+----+----+----+----+----+----+----+\00" ; <[42 x i8]*> [#uses=0]
-@str25.upgrd.163 = internal global [6 x i8] c" %s\0A\00" ; <[6 x i8]*> [#uses=0]
-@str26.upgrd.164 = internal global [5 x i8] c"%d |\00" ; <[5 x i8]*> [#uses=0]
-@str27.upgrd.165 = internal global [6 x i8] c" %s |\00" ; <[6 x i8]*> [#uses=0]
-@str28.upgrd.166 = internal global [7 x i8] c"\0A %s\0A\00" ; <[7 x i8]*> [#uses=0]
-@str111 = internal global [45 x i8] c"\0A a b c d e f g h\0A\0A\00" ; <[45 x i8]*> [#uses=0]
-@str29.upgrd.167 = internal global [45 x i8] c"\0A h g f e d c b a\0A\0A\00" ; <[45 x i8]*> [#uses=0]
-@str33.upgrd.168 = internal global [2 x i8] c"<\00" ; <[2 x i8]*> [#uses=0]
-@str34.upgrd.169 = internal global [3 x i8] c"> \00" ; <[3 x i8]*> [#uses=0]
-@str114.upgrd.170 = internal global [18 x i8] c"%2i %7i %5i %8i \00" ; <[18 x i8]*> [#uses=0]
-@str115 = internal global [20 x i8] c"%2i %c%1i.%02i %9i \00" ; <[20 x i8]*> [#uses=0]
-@str39.upgrd.171 = internal global [5 x i8] c"%s !\00" ; <[5 x i8]*> [#uses=0]
-@str40.upgrd.172 = internal global [6 x i8] c"%s !!\00" ; <[6 x i8]*> [#uses=0]
-@str41.upgrd.173 = internal global [6 x i8] c"%s ??\00" ; <[6 x i8]*> [#uses=0]
-@str124 = internal global [71 x i8] c"\0ASjeng version SPEC 1.0, Copyright (C) 2000-2005 Gian-Carlo Pascutto\0A\0A\00" ; <[71 x i8]*> [#uses=0]
-@state = internal global [625 x i32] zeroinitializer ; <[625 x i32]*> [#uses=0]
-
-declare fastcc i32 @calc_attackers(i32, i32)
-
-declare fastcc i32 @is_attacked(i32, i32)
-
-declare fastcc void @ProcessHoldings(i8*)
-
-declare void @llvm.memset.i32(i8*, i8, i32, i32)
-
-declare i8* @strncpy(i8*, i8*, i32)
-
-declare void @llvm.memcpy.i32(i8*, i8*, i32, i32)
-
-declare void @__eprintf(i8*, i8*, i32, i8*)
-
-declare fastcc void @addHolding(i32, i32)
-
-declare fastcc void @removeHolding(i32, i32)
-
-declare fastcc void @DropremoveHolding(i32, i32)
-
-declare i32 @printf(i8*, ...)
-
-declare fastcc i32 @is_draw()
-
-declare void @exit(i32)
-
-declare fastcc void @setup_epd_line(i8*)
-
-declare i32 @atoi(i8*)
-
-declare fastcc void @reset_piece_square()
-
-declare fastcc void @initialize_hash()
-
-declare i32 @__maskrune(i32, i32)
-
-declare fastcc void @comp_to_san(i64, i64, i64, i8*)
-
-declare i8* @strstr(i8*, i8*)
-
-declare i32 @atol(i8*)
-
-declare %struct.FILE* @fopen(i8*, i8*)
-
-declare fastcc void @display_board(i32)
-
-define internal void @think(%struct.move_s* sret %agg.result) {
-entry:
- %output.i = alloca [8 x i8], align 8 ; <[8 x i8]*> [#uses=0]
- %comp_move = alloca %struct.move_s, align 16 ; <%struct.move_s*> [#uses=7]
- %temp_move = alloca %struct.move_s, align 16 ; <%struct.move_s*> [#uses=6]
- %moves = alloca [512 x %struct.move_s], align 16 ; <[512 x %struct.move_s]*> [#uses=7]
- %output = alloca [8 x i8], align 8 ; <[8 x i8]*> [#uses=1]
- store i1 false, i1* @userealholdings.b
- %tmp = getelementptr [512 x %struct.move_s]* %moves, i32 0, i32 0 ; <%struct.move_s*> [#uses=3]
- %tmp362 = getelementptr %struct.move_s* %comp_move, i32 0, i32 0 ; <i32*> [#uses=0]
- %tmp365 = getelementptr %struct.move_s* %comp_move, i32 0, i32 1 ; <i32*> [#uses=0]
- %tmp368 = getelementptr %struct.move_s* %comp_move, i32 0, i32 2 ; <i32*> [#uses=0]
- %tmp371 = getelementptr %struct.move_s* %comp_move, i32 0, i32 3 ; <i32*> [#uses=0]
- %tmp374 = getelementptr %struct.move_s* %comp_move, i32 0, i32 4 ; <i32*> [#uses=0]
- %tmp377 = getelementptr %struct.move_s* %comp_move, i32 0, i32 5 ; <i32*> [#uses=0]
- %tmp.upgrd.174 = bitcast %struct.move_s* %comp_move to { i64, i64, i64 }* ; <{ i64, i64, i64 }*> [#uses=3]
- %tmp.upgrd.175 = getelementptr { i64, i64, i64 }* %tmp.upgrd.174, i32 0, i32 0 ; <i64*> [#uses=0]
- %tmp829 = getelementptr { i64, i64, i64 }* %tmp.upgrd.174, i32 0, i32 1 ; <i64*> [#uses=0]
- %tmp832 = getelementptr { i64, i64, i64 }* %tmp.upgrd.174, i32 0, i32 2 ; <i64*> [#uses=0]
- %output.upgrd.176 = getelementptr [8 x i8]* %output, i32 0, i32 0 ; <i8*> [#uses=0]
- %tmp573 = getelementptr %struct.move_s* %temp_move, i32 0, i32 0 ; <i32*> [#uses=0]
- %tmp576 = getelementptr %struct.move_s* %temp_move, i32 0, i32 1 ; <i32*> [#uses=0]
- %tmp579 = getelementptr %struct.move_s* %temp_move, i32 0, i32 2 ; <i32*> [#uses=0]
- %tmp582 = getelementptr %struct.move_s* %temp_move, i32 0, i32 3 ; <i32*> [#uses=0]
- %tmp585 = getelementptr %struct.move_s* %temp_move, i32 0, i32 4 ; <i32*> [#uses=0]
- %tmp588 = getelementptr %struct.move_s* %temp_move, i32 0, i32 5 ; <i32*> [#uses=0]
- %pn_restart.0.ph = bitcast i32 0 to i32 ; <i32> [#uses=2]
- %tmp21362 = icmp eq i32 0, 0 ; <i1> [#uses=2]
- %tmp216 = sitofp i32 %pn_restart.0.ph to float ; <float> [#uses=1]
- %tmp216.upgrd.177 = fpext float %tmp216 to double ; <double> [#uses=1]
- %tmp217 = add double %tmp216.upgrd.177, 1.000000e+00 ; <double> [#uses=1]
- %tmp835 = icmp sgt i32 %pn_restart.0.ph, 9 ; <i1> [#uses=0]
- store i32 0, i32* @nodes
- store i32 0, i32* @qnodes
- store i32 1, i32* @ply
- store i32 0, i32* @ECacheProbes
- store i32 0, i32* @ECacheHits
- store i32 0, i32* @TTProbes
- store i32 0, i32* @TTHits
- store i32 0, i32* @TTStores
- store i32 0, i32* @NCuts
- store i32 0, i32* @NTries
- store i32 0, i32* @TExt
- store i32 0, i32* @FH
- store i32 0, i32* @FHF
- store i32 0, i32* @PVS
- store i32 0, i32* @FULL
- store i32 0, i32* @PVSF
- store i32 0, i32* @ext_check
- store i32 0, i32* @ext_onerep
- store i32 0, i32* @razor_drop
- store i32 0, i32* @razor_material
- store i1 false, i1* @extendedtime.b
- store i1 false, i1* @forcedwin.b
- store i32 200, i32* @maxposdiff
- store i8 0, i8* @true_i_depth
- store i32 0, i32* @legals
- %tmp48 = load i32* @Variant ; <i32> [#uses=1]
- %tmp49 = icmp eq i32 %tmp48, 4 ; <i1> [#uses=1]
- %storemerge = zext i1 %tmp49 to i32 ; <i32> [#uses=1]
- store i32 %storemerge, i32* @captures
- call fastcc void @gen( %struct.move_s* %tmp )
- %tmp53 = load i32* @numb_moves ; <i32> [#uses=1]
- %tmp.i = load i32* @Variant ; <i32> [#uses=1]
- %tmp.i.upgrd.178 = icmp eq i32 %tmp.i, 3 ; <i1> [#uses=1]
- br i1 %tmp.i.upgrd.178, label %in_check.exit, label %cond_next.i
-
-cond_next.i: ; preds = %entry
- %tmp2.i5 = load i32* @white_to_move ; <i32> [#uses=1]
- %tmp3.i = icmp eq i32 %tmp2.i5, 1 ; <i1> [#uses=0]
- ret void
-
-in_check.exit: ; preds = %entry
- %tmp7637 = icmp sgt i32 %tmp53, 0 ; <i1> [#uses=1]
- br i1 %tmp7637, label %cond_true77, label %bb80
-
-cond_true77: ; preds = %in_check.exit
- %l.1.0 = bitcast i32 0 to i32 ; <i32> [#uses=2]
- call fastcc void @make( %struct.move_s* %tmp, i32 %l.1.0 )
- %tmp61 = call fastcc i32 @check_legal( %struct.move_s* %tmp, i32 %l.1.0, i32 0 ) ; <i32> [#uses=1]
- %tmp62 = icmp eq i32 %tmp61, 0 ; <i1> [#uses=0]
- ret void
-
-bb80: ; preds = %in_check.exit
- %tmp81 = load i32* @Variant ; <i32> [#uses=1]
- %tmp82 = icmp eq i32 %tmp81, 4 ; <i1> [#uses=1]
- br i1 %tmp82, label %cond_true83, label %cond_next118
-
-cond_true83: ; preds = %bb80
- %tmp84 = load i32* @legals ; <i32> [#uses=1]
- %tmp85 = icmp eq i32 %tmp84, 0 ; <i1> [#uses=0]
- ret void
-
-cond_next118: ; preds = %bb80
- %tmp119 = load i32* @Variant ; <i32> [#uses=1]
- %tmp120 = icmp eq i32 %tmp119, 1 ; <i1> [#uses=1]
- br i1 %tmp120, label %cond_next176, label %cond_true121
-
-cond_true121: ; preds = %cond_next118
- %tmp122.b = load i1* @is_pondering.b ; <i1> [#uses=1]
- br i1 %tmp122.b, label %cond_next176, label %cond_true124
-
-cond_true124: ; preds = %cond_true121
- %tmp125 = load i32* @legals ; <i32> [#uses=1]
- %tmp126 = icmp eq i32 %tmp125, 1 ; <i1> [#uses=1]
- br i1 %tmp126, label %cond_true127, label %cond_next176
-
-cond_true127: ; preds = %cond_true124
- %tmp128 = load i32* @inc ; <i32> [#uses=1]
- %tmp129 = mul i32 %tmp128, 100 ; <i32> [#uses=1]
- %tmp130 = load i32* @time_cushion ; <i32> [#uses=1]
- %tmp131 = add i32 %tmp129, %tmp130 ; <i32> [#uses=1]
- store i32 %tmp131, i32* @time_cushion
- %tmp134 = getelementptr %struct.move_s* %agg.result, i32 0, i32 0 ; <i32*> [#uses=1]
- %tmp135 = getelementptr [512 x %struct.move_s]* %moves, i32 0, i32 0, i32 0 ; <i32*> [#uses=1]
- %tmp136 = load i32* %tmp135 ; <i32> [#uses=1]
- store i32 %tmp136, i32* %tmp134
- %tmp137 = getelementptr %struct.move_s* %agg.result, i32 0, i32 1 ; <i32*> [#uses=1]
- %tmp138 = getelementptr [512 x %struct.move_s]* %moves, i32 0, i32 0, i32 1 ; <i32*> [#uses=1]
- %tmp139 = load i32* %tmp138 ; <i32> [#uses=1]
- store i32 %tmp139, i32* %tmp137
- %tmp140 = getelementptr %struct.move_s* %agg.result, i32 0, i32 2 ; <i32*> [#uses=1]
- %tmp141 = getelementptr [512 x %struct.move_s]* %moves, i32 0, i32 0, i32 2 ; <i32*> [#uses=1]
- %tmp142 = load i32* %tmp141 ; <i32> [#uses=1]
- store i32 %tmp142, i32* %tmp140
- %tmp143 = getelementptr %struct.move_s* %agg.result, i32 0, i32 3 ; <i32*> [#uses=1]
- %tmp144 = getelementptr [512 x %struct.move_s]* %moves, i32 0, i32 0, i32 3 ; <i32*> [#uses=1]
- %tmp145 = load i32* %tmp144 ; <i32> [#uses=1]
- store i32 %tmp145, i32* %tmp143
- %tmp146 = getelementptr %struct.move_s* %agg.result, i32 0, i32 4 ; <i32*> [#uses=1]
- %tmp147 = getelementptr [512 x %struct.move_s]* %moves, i32 0, i32 0, i32 4 ; <i32*> [#uses=1]
- %tmp148 = load i32* %tmp147 ; <i32> [#uses=1]
- store i32 %tmp148, i32* %tmp146
- %tmp149 = getelementptr %struct.move_s* %agg.result, i32 0, i32 5 ; <i32*> [#uses=1]
- %tmp150 = getelementptr [512 x %struct.move_s]* %moves, i32 0, i32 0, i32 5 ; <i32*> [#uses=1]
- %tmp151 = load i32* %tmp150 ; <i32> [#uses=1]
- store i32 %tmp151, i32* %tmp149
- ret void
-
-cond_next176: ; preds = %cond_true124, %cond_true121, %cond_next118
- call fastcc void @check_phase( )
- %tmp177 = load i32* @phase ; <i32> [#uses=1]
- switch i32 %tmp177, label %bb187 [
- i32 0, label %bb178
- i32 1, label %bb180
- i32 2, label %bb183
- ]
-
-bb178: ; preds = %cond_next176
- %tmp179 = call i32 (i8*, ...)* @printf( i8* getelementptr ([16 x i8]* @str40.upgrd.84, i32 0, i64 0) ) ; <i32> [#uses=0]
- %tmp18854.b = load i1* @is_pondering.b ; <i1> [#uses=1]
- br i1 %tmp18854.b, label %cond_false210, label %cond_true190
-
-bb180: ; preds = %cond_next176
- %tmp182 = call i32 (i8*, ...)* @printf( i8* getelementptr ([19 x i8]* @str.upgrd.85, i32 0, i64 0) ) ; <i32> [#uses=0]
- %tmp18856.b = load i1* @is_pondering.b ; <i1> [#uses=0]
- ret void
-
-bb183: ; preds = %cond_next176
- %tmp185 = call i32 (i8*, ...)* @printf( i8* getelementptr ([16 x i8]* @str1.upgrd.86, i32 0, i64 0) ) ; <i32> [#uses=0]
- %tmp18858.b = load i1* @is_pondering.b ; <i1> [#uses=0]
- ret void
-
-bb187: ; preds = %cond_next176
- %tmp188.b = load i1* @is_pondering.b ; <i1> [#uses=0]
- ret void
-
-cond_true190: ; preds = %bb178
- %tmp191 = load i32* @fixed_time ; <i32> [#uses=1]
- %tmp192 = icmp eq i32 %tmp191, 0 ; <i1> [#uses=0]
- ret void
-
-cond_false210: ; preds = %bb178
- store i32 999999, i32* @time_for_move
- br i1 %tmp21362, label %cond_true226.critedge, label %bb287.critedge
-
-cond_true226.critedge: ; preds = %cond_false210
- %tmp223.c = call i32 (i8*, ...)* @printf( i8* getelementptr ([20 x i8]* @str43, i32 0, i64 0), i32 999999 ) ; <i32> [#uses=0]
- %tmp.i.upgrd.179 = load %struct.TType** @DP_TTable ; <%struct.TType*> [#uses=1]
- %tmp.i7.b = load i1* @TTSize.b ; <i1> [#uses=1]
- %tmp1.i = select i1 %tmp.i7.b, i32 60000000, i32 0 ; <i32> [#uses=1]
- %tmp.i.sb = getelementptr %struct.TType* %tmp.i.upgrd.179, i32 0, i32 0 ; <i8*> [#uses=1]
- call void @llvm.memset.i32( i8* %tmp.i.sb, i8 0, i32 %tmp1.i, i32 4 )
- %tmp2.i = load %struct.TType** @AS_TTable ; <%struct.TType*> [#uses=1]
- %tmp3.i8.b = load i1* @TTSize.b ; <i1> [#uses=1]
- %tmp4.i = select i1 %tmp3.i8.b, i32 60000000, i32 0 ; <i32> [#uses=1]
- %tmp2.i.upgrd.180 = getelementptr %struct.TType* %tmp2.i, i32 0, i32 0 ; <i8*> [#uses=1]
- call void @llvm.memset.i32( i8* %tmp2.i.upgrd.180, i8 0, i32 %tmp4.i, i32 4 )
- %tmp.i.QTT = load %struct.QTType** @QS_TTable ; <%struct.QTType*> [#uses=1]
- %tmp5.i9.b = load i1* @TTSize.b ; <i1> [#uses=1]
- %tmp6.i10 = select i1 %tmp5.i9.b, i32 48000000, i32 0 ; <i32> [#uses=1]
- %tmp7.i = getelementptr %struct.QTType* %tmp.i.QTT, i32 0, i32 0 ; <i8*> [#uses=1]
- call void @llvm.memset.i32( i8* %tmp7.i, i8 0, i32 %tmp6.i10, i32 4 )
- %tmp.i.ECache = load %struct.ECacheType** @ECache ; <%struct.ECacheType*> [#uses=1]
- %tmp.i14.b = load i1* @ECacheSize.b ; <i1> [#uses=1]
- %tmp1.i16 = select i1 %tmp.i14.b, i32 12000000, i32 0 ; <i32> [#uses=1]
- %tmp.i17 = bitcast %struct.ECacheType* %tmp.i.ECache to i8* ; <i8*> [#uses=1]
- call void @llvm.memset.i32( i8* %tmp.i17, i8 0, i32 %tmp1.i16, i32 4 )
- call void @llvm.memset.i32( i8* bitcast ([300 x i32]* @rootlosers to i8*), i8 0, i32 1200, i32 4 )
- %tmp234.b = load i1* @is_pondering.b ; <i1> [#uses=1]
- br i1 %tmp234.b, label %bb263, label %cond_next238
-
-cond_next238: ; preds = %cond_true226.critedge
- %tmp239 = load i32* @Variant ; <i32> [#uses=2]
- switch i32 %tmp239, label %bb263 [
- i32 3, label %bb249
- i32 4, label %bb249
- ]
-
-bb249: ; preds = %cond_next238, %cond_next238
- %tmp250 = load i32* @piece_count ; <i32> [#uses=1]
- %tmp251 = icmp sgt i32 %tmp250, 3 ; <i1> [#uses=1]
- %tmp240.not = icmp ne i32 %tmp239, 3 ; <i1> [#uses=1]
- %brmerge = or i1 %tmp251, %tmp240.not ; <i1> [#uses=1]
- br i1 %brmerge, label %bb260, label %bb263
-
-bb260: ; preds = %bb249
- %tmp261 = load i32* @time_for_move ; <i32> [#uses=1]
- %tmp261.upgrd.181 = sitofp i32 %tmp261 to float ; <float> [#uses=1]
- %tmp261.upgrd.182 = fpext float %tmp261.upgrd.181 to double ; <double> [#uses=1]
- %tmp262 = fdiv double %tmp261.upgrd.182, 3.000000e+00 ; <double> [#uses=1]
- %tmp262.upgrd.183 = fptosi double %tmp262 to i32 ; <i32> [#uses=1]
- store i32 %tmp262.upgrd.183, i32* @pn_time
- %tmp1.b.i = load i1* @PBSize.b ; <i1> [#uses=1]
- %tmp1.i1 = select i1 %tmp1.b.i, i32 200000, i32 0 ; <i32> [#uses=1]
- %tmp.i2 = call i8* @calloc( i32 %tmp1.i1, i32 44 ) ; <i8*> [#uses=1]
- %tmp.i.ub = bitcast i8* %tmp.i2 to i8* ; <i8*> [#uses=1]
- store i8* %tmp.i.ub, i8** @membuff
- %tmp2.i3 = call i8* @calloc( i32 1, i32 44 ) ; <i8*> [#uses=3]
- %tmp2.i.upgrd.184 = bitcast i8* %tmp2.i3 to %struct.node_t* ; <%struct.node_t*> [#uses=6]
- %tmp.i.move_s = getelementptr [512 x %struct.move_s]* null, i32 0, i32 0 ; <%struct.move_s*> [#uses=3]
- call fastcc void @gen( %struct.move_s* %tmp.i.move_s )
- %tmp3.i4 = load i32* @numb_moves ; <i32> [#uses=4]
- %tmp3.i5 = bitcast i32 %tmp3.i4 to i32 ; <i32> [#uses=0]
- store i1 false, i1* @alllosers.b
- call void @llvm.memset.i32( i8* bitcast ([300 x i32]* @rootlosers to i8*), i8 0, i32 1200, i32 4 )
- %nodesspent.i = bitcast [512 x i32]* null to i8* ; <i8*> [#uses=1]
- call void @llvm.memset.i32( i8* %nodesspent.i, i8 0, i32 2048, i32 16 )
- store i32 0, i32* getelementptr (%struct.move_s* @pn_move, i64 0, i32 0)
- store i32 0, i32* getelementptr (%struct.move_s* @pn_move, i64 0, i32 1)
- store i32 0, i32* getelementptr (%struct.move_s* @pn_move, i64 0, i32 2)
- store i32 0, i32* getelementptr (%struct.move_s* @pn_move, i64 0, i32 3)
- store i32 0, i32* getelementptr (%struct.move_s* @pn_move, i64 0, i32 4)
- store i32 0, i32* getelementptr (%struct.move_s* @pn_move, i64 0, i32 5)
- %tmp.i.i = load i32* @Variant ; <i32> [#uses=1]
- %tmp.i.i.upgrd.185 = icmp eq i32 %tmp.i.i, 3 ; <i1> [#uses=1]
- br i1 %tmp.i.i.upgrd.185, label %in_check.exit.i, label %cond_next.i.i
-
-cond_next.i.i: ; preds = %bb260
- %tmp2.i.i = load i32* @white_to_move ; <i32> [#uses=1]
- %tmp3.i.i = icmp eq i32 %tmp2.i.i, 1 ; <i1> [#uses=1]
- br i1 %tmp3.i.i, label %cond_true4.i.i, label %cond_false12.i.i
-
-cond_true4.i.i: ; preds = %cond_next.i.i
- %tmp5.i.i = load i32* @wking_loc ; <i32> [#uses=1]
- %tmp6.i.i = call fastcc i32 @is_attacked( i32 %tmp5.i.i, i32 0 ) ; <i32> [#uses=1]
- %not.tmp7.i.i = icmp ne i32 %tmp6.i.i, 0 ; <i1> [#uses=1]
- %tmp217.i = zext i1 %not.tmp7.i.i to i32 ; <i32> [#uses=1]
- %tmp4219.i = icmp sgt i32 %tmp3.i4, 0 ; <i1> [#uses=1]
- br i1 %tmp4219.i, label %cond_true43.i, label %bb46.i
-
-cond_false12.i.i: ; preds = %cond_next.i.i
- %tmp13.i.i = load i32* @bking_loc ; <i32> [#uses=1]
- %tmp14.i.i = call fastcc i32 @is_attacked( i32 %tmp13.i.i, i32 1 ) ; <i32> [#uses=1]
- %not.tmp15.i.i = icmp ne i32 %tmp14.i.i, 0 ; <i1> [#uses=1]
- %tmp2120.i = zext i1 %not.tmp15.i.i to i32 ; <i32> [#uses=1]
- %tmp4222.i = icmp sgt i32 %tmp3.i4, 0 ; <i1> [#uses=1]
- br i1 %tmp4222.i, label %cond_true43.i, label %bb46.i
-
-in_check.exit.i: ; preds = %bb260
- %tmp4224.i = icmp sgt i32 %tmp3.i4, 0 ; <i1> [#uses=0]
- ret void
-
-cond_true43.i: ; preds = %cond_false12.i.i, %cond_true4.i.i
- %tmp21.0.ph.i = phi i32 [ %tmp217.i, %cond_true4.i.i ], [ %tmp2120.i, %cond_false12.i.i ] ; <i32> [#uses=1]
- %i.0.0.i = bitcast i32 0 to i32 ; <i32> [#uses=2]
- call fastcc void @make( %struct.move_s* %tmp.i.move_s, i32 %i.0.0.i )
- %tmp27.i = call fastcc i32 @check_legal( %struct.move_s* %tmp.i.move_s, i32 %i.0.0.i, i32 %tmp21.0.ph.i ) ; <i32> [#uses=1]
- %tmp.i6 = icmp eq i32 %tmp27.i, 0 ; <i1> [#uses=0]
- ret void
-
-bb46.i: ; preds = %cond_false12.i.i, %cond_true4.i.i
- %tmp48.i = icmp eq i32 0, 0 ; <i1> [#uses=1]
- br i1 %tmp48.i, label %cond_true49.i, label %cond_next53.i
-
-cond_true49.i: ; preds = %bb46.i
- store i32 0, i32* @bufftop
- %tmp50.i = load i8** @membuff ; <i8*> [#uses=1]
- free i8* %tmp50.i
- free i8* %tmp2.i3
- ret void
-
-cond_next53.i: ; preds = %bb46.i
- store i32 1, i32* @nodecount
- store i32 0, i32* @iters
- store i32 0, i32* @maxply
- store i32 0, i32* @forwards
- %tmp54.i = load i32* @move_number ; <i32> [#uses=1]
- %tmp55.i = load i32* @ply ; <i32> [#uses=1]
- %tmp56.i = add i32 %tmp54.i, -1 ; <i32> [#uses=1]
- %tmp57.i = add i32 %tmp56.i, %tmp55.i ; <i32> [#uses=1]
- %tmp58.i = load i32* @hash ; <i32> [#uses=1]
- %tmp.i.upgrd.186 = getelementptr [600 x i32]* @hash_history, i32 0, i32 %tmp57.i ; <i32*> [#uses=1]
- store i32 %tmp58.i, i32* %tmp.i.upgrd.186
- %tmp59.i = load i32* @white_to_move ; <i32> [#uses=1]
- %tmp60.i = icmp eq i32 %tmp59.i, 0 ; <i1> [#uses=1]
- %tmp60.i.upgrd.187 = zext i1 %tmp60.i to i32 ; <i32> [#uses=1]
- store i32 %tmp60.i.upgrd.187, i32* @root_to_move
- %tmp.i4.i = load i32* @Variant ; <i32> [#uses=2]
- %tmp.i5.i = icmp eq i32 %tmp.i4.i, 3 ; <i1> [#uses=1]
- br i1 %tmp.i5.i, label %cond_true.i.i, label %cond_false.i.i
-
-cond_true.i.i: ; preds = %cond_next53.i
- call fastcc void @suicide_pn_eval( %struct.node_t* %tmp2.i.upgrd.184 )
- %tmp6328.i = getelementptr %struct.node_t* %tmp2.i.upgrd.184, i32 0, i32 0 ; <i8*> [#uses=1]
- %tmp29.i = load i8* %tmp6328.i ; <i8> [#uses=1]
- %tmp6430.i = icmp eq i8 %tmp29.i, 1 ; <i1> [#uses=0]
- ret void
-
-cond_false.i.i: ; preds = %cond_next53.i
- %tmp2.i.i.upgrd.188 = icmp eq i32 %tmp.i4.i, 4 ; <i1> [#uses=1]
- %tmp63.i = getelementptr %struct.node_t* %tmp2.i.upgrd.184, i32 0, i32 0 ; <i8*> [#uses=2]
- br i1 %tmp2.i.i.upgrd.188, label %cond_true3.i.i, label %cond_false5.i.i
-
-cond_true3.i.i: ; preds = %cond_false.i.i
- call fastcc void @losers_pn_eval( %struct.node_t* %tmp2.i.upgrd.184 )
- %tmp31.i = load i8* %tmp63.i ; <i8> [#uses=1]
- %tmp6432.i = icmp eq i8 %tmp31.i, 1 ; <i1> [#uses=1]
- br i1 %tmp6432.i, label %bb75.i, label %cond_next67.i
-
-cond_false5.i.i: ; preds = %cond_false.i.i
- call fastcc void @std_pn_eval( %struct.node_t* %tmp2.i.upgrd.184 )
- %tmp.i.upgrd.189 = load i8* %tmp63.i ; <i8> [#uses=1]
- %tmp64.i = icmp eq i8 %tmp.i.upgrd.189, 1 ; <i1> [#uses=0]
- ret void
-
-cond_next67.i: ; preds = %cond_true3.i.i
- %tmp69.i = getelementptr %struct.node_t* %tmp2.i.upgrd.184, i32 0, i32 0 ; <i8*> [#uses=1]
- %tmp70.i = load i8* %tmp69.i ; <i8> [#uses=1]
- %tmp71.i = icmp eq i8 %tmp70.i, 0 ; <i1> [#uses=0]
- ret void
-
-bb75.i: ; preds = %cond_true3.i.i
- store i32 0, i32* @bufftop
- %tmp76.i = load i8** @membuff ; <i8*> [#uses=1]
- free i8* %tmp76.i
- free i8* %tmp2.i3
- store i32 0, i32* getelementptr (%struct.move_s* @pn_move, i64 0, i32 0)
- store i32 0, i32* getelementptr (%struct.move_s* @pn_move, i64 0, i32 1)
- store i32 0, i32* getelementptr (%struct.move_s* @pn_move, i64 0, i32 2)
- store i32 0, i32* getelementptr (%struct.move_s* @pn_move, i64 0, i32 3)
- store i32 0, i32* getelementptr (%struct.move_s* @pn_move, i64 0, i32 4)
- store i32 0, i32* getelementptr (%struct.move_s* @pn_move, i64 0, i32 5)
- %tmp28869 = load i32* @result ; <i32> [#uses=1]
- %tmp28970 = icmp eq i32 %tmp28869, 0 ; <i1> [#uses=1]
- br i1 %tmp28970, label %cond_next337, label %cond_true290
-
-bb263: ; preds = %bb249, %cond_next238, %cond_true226.critedge
- br i1 %tmp21362, label %cond_true266, label %bb287
-
-cond_true266: ; preds = %bb263
- store i32 0, i32* getelementptr (%struct.move_s* @pn_move, i64 0, i32 0)
- store i32 0, i32* getelementptr (%struct.move_s* @pn_move, i64 0, i32 1)
- store i32 0, i32* getelementptr (%struct.move_s* @pn_move, i64 0, i32 2)
- store i32 0, i32* getelementptr (%struct.move_s* @pn_move, i64 0, i32 3)
- store i32 0, i32* getelementptr (%struct.move_s* @pn_move, i64 0, i32 4)
- store i32 0, i32* getelementptr (%struct.move_s* @pn_move, i64 0, i32 5)
- %tmp28871 = load i32* @result ; <i32> [#uses=1]
- %tmp28972 = icmp eq i32 %tmp28871, 0 ; <i1> [#uses=0]
- ret void
-
-bb287.critedge: ; preds = %cond_false210
- %tmp218.c = fdiv double 1.999998e+06, %tmp217 ; <double> [#uses=1]
- %tmp218.c.upgrd.190 = fptosi double %tmp218.c to i32 ; <i32> [#uses=2]
- store i32 %tmp218.c.upgrd.190, i32* @time_for_move
- %tmp22367.c = call i32 (i8*, ...)* @printf( i8* getelementptr ([20 x i8]* @str43, i32 0, i64 0), i32 %tmp218.c.upgrd.190 ) ; <i32> [#uses=0]
- ret void
-
-bb287: ; preds = %bb263
- %tmp288 = load i32* @result ; <i32> [#uses=1]
- %tmp289 = icmp eq i32 %tmp288, 0 ; <i1> [#uses=0]
- ret void
-
-cond_true290: ; preds = %bb75.i
- %tmp292 = load i32* getelementptr (%struct.move_s* @pn_move, i32 0, i32 1) ; <i32> [#uses=1]
- %tmp295 = icmp eq i32 %tmp292, 0 ; <i1> [#uses=0]
- ret void
-
-cond_next337: ; preds = %bb75.i
- %tmp338.b = load i1* @forcedwin.b ; <i1> [#uses=1]
- br i1 %tmp338.b, label %bb348, label %cond_next342
-
-cond_next342: ; preds = %cond_next337
- %tmp343 = load i32* @result ; <i32> [#uses=1]
- %tmp344 = icmp eq i32 %tmp343, 0 ; <i1> [#uses=0]
- ret void
-
-bb348: ; preds = %cond_next337
- %tmp350 = load i32* getelementptr (%struct.move_s* @pn_move, i32 0, i32 1) ; <i32> [#uses=1]
- %tmp353 = icmp eq i32 %tmp350, 0 ; <i1> [#uses=0]
- ret void
-}
-
-declare fastcc i32 @eval(i32, i32)
-
-declare i8* @fgets(i8*, i32, %struct.FILE*)
-
-declare i32 @fclose(%struct.FILE*)
-
-declare fastcc i32 @losers_eval()
-
-declare fastcc i32 @l_bishop_mobility(i32)
-
-declare fastcc i32 @l_rook_mobility(i32)
-
-declare fastcc i32 @check_legal(%struct.move_s*, i32, i32)
-
-declare fastcc void @gen(%struct.move_s*)
-
-declare fastcc void @push_pawn(i32, i32)
-
-declare fastcc void @push_knighT(i32)
-
-declare fastcc void @push_slidE(i32)
-
-declare fastcc void @push_king(i32)
-
-declare fastcc i32 @f_in_check(%struct.move_s*, i32)
-
-declare fastcc void @make(%struct.move_s*, i32)
-
-declare fastcc void @add_capture(i32, i32, i32)
-
-declare fastcc void @unmake(%struct.move_s*, i32)
-
-declare i32 @ErrorIt(i32, i32)
-
-declare i32 @Pawn(i32, i32)
-
-declare i32 @Knight(i32, i32)
-
-declare i32 @King(i32, i32)
-
-declare i32 @Rook(i32, i32)
-
-declare i32 @Queen(i32, i32)
-
-declare i32 @Bishop(i32, i32)
-
-declare fastcc void @check_phase()
-
-declare fastcc i32 @bishop_mobility(i32)
-
-declare fastcc i32 @rook_mobility(i32)
-
-declare i32 @sscanf(i8*, i8*, ...)
-
-declare i32 @strncmp(i8*, i8*, i32)
-
-declare i8* @strchr(i8*, i32)
-
-declare fastcc void @CheckBadFlow(i32)
-
-declare fastcc void @suicide_pn_eval(%struct.node_t*)
-
-declare fastcc void @losers_pn_eval(%struct.node_t*)
-
-declare fastcc void @std_pn_eval(%struct.node_t*)
-
-declare fastcc %struct.node_t* @select_most_proving(%struct.node_t*)
-
-declare fastcc void @set_proof_and_disproof_numbers(%struct.node_t*)
-
-declare fastcc void @StoreTT(i32, i32, i32, i32, i32, i32)
-
-declare fastcc void @develop_node(%struct.node_t*)
-
-declare fastcc void @update_ancestors(%struct.node_t*)
-
-declare i8* @calloc(i32, i32)
-
-declare fastcc void @comp_to_coord(i64, i64, i64, i8*)
-
-declare i8* @strcat(i8*, i8*)
-
-declare i32 @sprintf(i8*, i8*, ...)
-
-declare fastcc void @order_moves(%struct.move_s*, i32*, i32*, i32, i32)
-
-declare fastcc i32 @see(i32, i32, i32)
-
-declare fastcc void @perft(i32)
-
-declare fastcc i32 @qsearch(i32, i32, i32)
-
-declare fastcc i32 @allocate_time()
-
-declare fastcc void @QStoreTT(i32, i32, i32, i32)
-
-declare fastcc i32 @search(i32, i32, i32, i32)
-
-declare fastcc i32 @ProbeTT(i32*, i32, i32*, i32*, i32*, i32)
-
-declare void @search_root(%struct.move_s* sret , i32, i32, i32)
-
-declare fastcc void @post_fh_thinking(i32, %struct.move_s*)
-
-declare fastcc void @post_thinking(i32)
-
-declare i32 @fprintf(%struct.FILE*, i8*, ...)
-
-declare fastcc i32 @s_bishop_mobility(i32)
-
-declare fastcc i32 @s_rook_mobility(i32)
-
-declare fastcc i32 @suicide_mid_eval()
-
-declare i32 @main(i32, i8**)
-
-declare fastcc void @init_game()
-
-declare void @setbuf(%struct.FILE*, i8*)
-
-declare i8* @strcpy(i8*, i8*)
-
-declare i32 @__tolower(i32)
-
-declare i32 @strcmp(i8*, i8*)
-
-declare void (i32)* @signal(i32, void (i32)*)
-
-declare fastcc void @hash_extract_pv(i32, i8*)
-
-declare double @difftime(i32, i32)
-
-declare i32 @getc(%struct.FILE*)
-
-declare i32 @strlen(i8*)
-
-declare i32 @fwrite(i8*, i32, i32, %struct.FILE*)
diff --git a/release_23/test/Transforms/DeadStoreElimination/PartialStore.ll b/release_23/test/Transforms/DeadStoreElimination/PartialStore.ll
deleted file mode 100644
index ce1965724f10..000000000000
--- a/release_23/test/Transforms/DeadStoreElimination/PartialStore.ll
+++ /dev/null
@@ -1,13 +0,0 @@
-; RUN: llvm-as < %s | opt -dse | llvm-dis | \
-; RUN: not grep {store i8}
-; Ensure that the dead store is deleted in this case. It is wholely
-; overwritten by the second store.
-define i32 @test() {
- %V = alloca i32 ; <i32*> [#uses=3]
- %V2 = bitcast i32* %V to i8* ; <i8*> [#uses=1]
- store i8 0, i8* %V2
- store i32 1234567, i32* %V
- %X = load i32* %V ; <i32> [#uses=1]
- ret i32 %X
-}
-
diff --git a/release_23/test/Transforms/DeadStoreElimination/alloca.ll b/release_23/test/Transforms/DeadStoreElimination/alloca.ll
deleted file mode 100644
index 7a2c94ffca62..000000000000
--- a/release_23/test/Transforms/DeadStoreElimination/alloca.ll
+++ /dev/null
@@ -1,9 +0,0 @@
-; RUN: llvm-as < %s | opt -dse | llvm-dis | not grep DEAD
-
-define void @test(i32* %Q) {
- %P = alloca i32 ; <i32*> [#uses=1]
- %DEAD = load i32* %Q ; <i32> [#uses=1]
- store i32 %DEAD, i32* %P
- ret void
-}
-
diff --git a/release_23/test/Transforms/DeadStoreElimination/byval.ll b/release_23/test/Transforms/DeadStoreElimination/byval.ll
deleted file mode 100644
index 08f69a40c579..000000000000
--- a/release_23/test/Transforms/DeadStoreElimination/byval.ll
+++ /dev/null
@@ -1,10 +0,0 @@
-; RUN: llvm-as < %s | opt -dse | llvm-dis | not grep store
-
-%struct.x = type { i32, i32, i32, i32 }
-
-define i32 @foo(%struct.x* byval %a) nounwind {
-entry:
- %tmp2 = getelementptr %struct.x* %a, i32 0, i32 0
- store i32 1, i32* %tmp2, align 4
- ret i32 1
-}
diff --git a/release_23/test/Transforms/DeadStoreElimination/context-sensitive.ll b/release_23/test/Transforms/DeadStoreElimination/context-sensitive.ll
deleted file mode 100644
index 266fdbc647ed..000000000000
--- a/release_23/test/Transforms/DeadStoreElimination/context-sensitive.ll
+++ /dev/null
@@ -1,14 +0,0 @@
-; RUN: llvm-as < %s | opt -dse | llvm-dis | not grep DEAD
-
-declare void @ext()
-
-define i32* @caller() {
- %P = malloc i32 ; <i32*> [#uses=4]
- %DEAD = load i32* %P ; <i32> [#uses=1]
- %DEAD2 = add i32 %DEAD, 1 ; <i32> [#uses=1]
- store i32 %DEAD2, i32* %P
- call void @ext( )
- store i32 0, i32* %P
- ret i32* %P
-}
-
diff --git a/release_23/test/Transforms/DeadStoreElimination/dg.exp b/release_23/test/Transforms/DeadStoreElimination/dg.exp
deleted file mode 100644
index 879685ca879d..000000000000
--- a/release_23/test/Transforms/DeadStoreElimination/dg.exp
+++ /dev/null
@@ -1,3 +0,0 @@
-load_lib llvm.exp
-
-RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
diff --git a/release_23/test/Transforms/DeadStoreElimination/free.ll b/release_23/test/Transforms/DeadStoreElimination/free.ll
deleted file mode 100644
index e0611d310b80..000000000000
--- a/release_23/test/Transforms/DeadStoreElimination/free.ll
+++ /dev/null
@@ -1,8 +0,0 @@
-; RUN: llvm-as < %s | opt -dse | llvm-dis | not grep DEAD
-
-define void @test(i32* %Q, i32* %P) {
- %DEAD = load i32* %Q ; <i32> [#uses=1]
- store i32 %DEAD, i32* %P
- free i32* %P
- ret void
-}
diff --git a/release_23/test/Transforms/DeadStoreElimination/memcpy.ll b/release_23/test/Transforms/DeadStoreElimination/memcpy.ll
deleted file mode 100644
index e96b2e8fb1ed..000000000000
--- a/release_23/test/Transforms/DeadStoreElimination/memcpy.ll
+++ /dev/null
@@ -1,52 +0,0 @@
-; RUN: llvm-as < %s | opt -dse | llvm-dis | not grep alloca
-; ModuleID = 'placeholder.adb'
-target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32"
-target triple = "i686-pc-linux-gnu"
- %struct.placeholder__T5b = type { i32, [1 x i32] }
- %struct.placeholder__an_interval___PAD = type { %struct.placeholder__interval, [4 x i32] }
- %struct.placeholder__interval = type { i32, i32 }
- %struct.placeholder__s__s__the_interval___PAD = type { %struct.placeholder__interval }
-
-define void @_ada_placeholder() nounwind {
-entry:
- %an_interval = alloca %struct.placeholder__an_interval___PAD ; <%struct.placeholder__an_interval___PAD*> [#uses=3]
- %tmp34 = bitcast %struct.placeholder__an_interval___PAD* %an_interval to %struct.placeholder__T5b* ; <%struct.placeholder__T5b*> [#uses=1]
- %tmp5 = getelementptr %struct.placeholder__an_interval___PAD* %an_interval, i32 0, i32 0, i32 0 ; <i32*> [#uses=2]
- store i32 1, i32* %tmp5, align 8
- %tmp10 = getelementptr %struct.placeholder__T5b* %tmp34, i32 0, i32 1, i32 0 ; <i32*> [#uses=1]
- store i32 1, i32* %tmp10, align 4
- %tmp82 = load i32* %tmp5, align 8 ; <i32> [#uses=5]
- %tmp83 = icmp slt i32 %tmp82, 6 ; <i1> [#uses=1]
- %min84 = select i1 %tmp83, i32 %tmp82, i32 5 ; <i32> [#uses=3]
- %tmp85 = icmp sgt i32 %min84, -1 ; <i1> [#uses=2]
- %min84.cast193 = zext i32 %min84 to i64 ; <i64> [#uses=1]
- %min84.cast193.op = shl i64 %min84.cast193, 33 ; <i64> [#uses=1]
- %tmp104 = icmp sgt i32 %tmp82, -1 ; <i1> [#uses=2]
- %tmp103.cast192 = zext i32 %tmp82 to i64 ; <i64> [#uses=1]
- %tmp103.cast192.op = shl i64 %tmp103.cast192, 33 ; <i64> [#uses=1]
- %min84.cast193.op.op = ashr i64 %min84.cast193.op, 28 ; <i64> [#uses=1]
- %sextr121 = select i1 %tmp85, i64 %min84.cast193.op.op, i64 0 ; <i64> [#uses=2]
- %tmp103.cast192.op.op = ashr i64 %tmp103.cast192.op, 28 ; <i64> [#uses=1]
- %sextr123 = select i1 %tmp104, i64 %tmp103.cast192.op.op, i64 0 ; <i64> [#uses=2]
- %tmp124 = icmp sle i64 %sextr121, %sextr123 ; <i1> [#uses=1]
- %min125 = select i1 %tmp124, i64 %sextr121, i64 %sextr123 ; <i64> [#uses=1]
- %sextr131194 = and i64 %min125, 34359738336 ; <i64> [#uses=1]
- %tmp134 = add i64 %sextr131194, 63 ; <i64> [#uses=1]
- lshr i64 %tmp134, 3 ; <i64>:0 [#uses=1]
- %tmp150188.shrunk = trunc i64 %0 to i32 ; <i32> [#uses=1]
- %tmp159 = and i32 %tmp150188.shrunk, -4 ; <i32> [#uses=1]
- %tmp161 = alloca i8, i32 %tmp159 ; <i8*> [#uses=1]
- %min167.op = shl i32 %min84, 2 ; <i32> [#uses=1]
- %tmp170 = select i1 %tmp85, i32 %min167.op, i32 0 ; <i32> [#uses=2]
- %tmp173.op = shl i32 %tmp82, 2 ; <i32> [#uses=1]
- %tmp176 = select i1 %tmp104, i32 %tmp173.op, i32 0 ; <i32> [#uses=2]
- %tmp177 = icmp sle i32 %tmp170, %tmp176 ; <i1> [#uses=1]
- %min178 = select i1 %tmp177, i32 %tmp170, i32 %tmp176 ; <i32> [#uses=1]
- %tmp179 = add i32 %min178, 7 ; <i32> [#uses=1]
- %tmp180 = and i32 %tmp179, -4 ; <i32> [#uses=1]
- %tmp183185 = bitcast %struct.placeholder__an_interval___PAD* %an_interval to i8* ; <i8*> [#uses=1]
- call void @llvm.memcpy.i32( i8* %tmp161, i8* %tmp183185, i32 %tmp180, i32 4 )
- ret void
-}
-
-declare void @llvm.memcpy.i32(i8*, i8*, i32, i32) nounwind
diff --git a/release_23/test/Transforms/DeadStoreElimination/simple.ll b/release_23/test/Transforms/DeadStoreElimination/simple.ll
deleted file mode 100644
index 594671d0f0f1..000000000000
--- a/release_23/test/Transforms/DeadStoreElimination/simple.ll
+++ /dev/null
@@ -1,9 +0,0 @@
-; RUN: llvm-as < %s | opt -dse | llvm-dis | not grep DEAD
-
-define void @test(i32* %Q, i32* %P) {
- %DEAD = load i32* %Q ; <i32> [#uses=1]
- store i32 %DEAD, i32* %P
- store i32 0, i32* %P
- ret void
-}
-
diff --git a/release_23/test/Transforms/DeadStoreElimination/volatile-load.ll b/release_23/test/Transforms/DeadStoreElimination/volatile-load.ll
deleted file mode 100644
index c458284dca76..000000000000
--- a/release_23/test/Transforms/DeadStoreElimination/volatile-load.ll
+++ /dev/null
@@ -1,8 +0,0 @@
-; RUN: llvm-as < %s | opt -dse | llvm-dis | grep {volatile load}
-
-@g_1 = global i32 0
-
-define void @foo() nounwind {
- %t = volatile load i32* @g_1
- ret void
-}
diff --git a/release_23/test/Transforms/GCSE/2002-05-14-OperandSwap.ll b/release_23/test/Transforms/GCSE/2002-05-14-OperandSwap.ll
deleted file mode 100644
index ca4ac201fed8..000000000000
--- a/release_23/test/Transforms/GCSE/2002-05-14-OperandSwap.ll
+++ /dev/null
@@ -1,17 +0,0 @@
-; This entire chain of computation should be optimized away, but
-; wasn't because the two multiplies were not detected as being identical.
-;
-; RUN: llvm-as < %s | opt -gcse -instcombine -dce | \
-; RUN: llvm-dis | not grep sub
-
-define i32 @vnum_test4(i32* %data) {
- %idx1 = getelementptr i32* %data, i64 1 ; <i32*> [#uses=1]
- %idx2 = getelementptr i32* %data, i64 3 ; <i32*> [#uses=1]
- %reg1101 = load i32* %idx1 ; <i32> [#uses=2]
- %reg1111 = load i32* %idx2 ; <i32> [#uses=2]
- %reg109 = mul i32 %reg1101, %reg1111 ; <i32> [#uses=1]
- %reg108 = mul i32 %reg1111, %reg1101 ; <i32> [#uses=1]
- %reg121 = sub i32 %reg108, %reg109 ; <i32> [#uses=1]
- ret i32 %reg121
-}
-
diff --git a/release_23/test/Transforms/GCSE/2002-05-21-NoSharedDominator.ll b/release_23/test/Transforms/GCSE/2002-05-21-NoSharedDominator.ll
deleted file mode 100644
index cf288b8171fc..000000000000
--- a/release_23/test/Transforms/GCSE/2002-05-21-NoSharedDominator.ll
+++ /dev/null
@@ -1,14 +0,0 @@
-; This testcase shows a bug where an common subexpression exists, but there
-; is no shared dominator block that the expression can be hoisted out to.
-;
-; RUN: llvm-as < %s | opt -gcse | llvm-dis
-
-define i32 @test(i32 %X, i32 %Y) {
- %Z = add i32 %X, %Y ; <i32> [#uses=1]
- ret i32 %Z
-
-Unreachable: ; No predecessors!
- %Q = add i32 %X, %Y ; <i32> [#uses=1]
- ret i32 %Q
-}
-
diff --git a/release_23/test/Transforms/GCSE/2003-06-13-LoadStoreEliminate.ll b/release_23/test/Transforms/GCSE/2003-06-13-LoadStoreEliminate.ll
deleted file mode 100644
index d4bdc3f5a05d..000000000000
--- a/release_23/test/Transforms/GCSE/2003-06-13-LoadStoreEliminate.ll
+++ /dev/null
@@ -1,11 +0,0 @@
-; This testcase shows a bug where an common subexpression exists, but there
-; is no shared dominator block that the expression can be hoisted out to.
-;
-; RUN: llvm-as < %s | opt -load-vn -gcse | llvm-dis | not grep load
-
-define i32 @test(i32* %P) {
- store i32 5, i32* %P
- %Z = load i32* %P ; <i32> [#uses=1]
- ret i32 %Z
-}
-
diff --git a/release_23/test/Transforms/GCSE/dg.exp b/release_23/test/Transforms/GCSE/dg.exp
deleted file mode 100644
index 879685ca879d..000000000000
--- a/release_23/test/Transforms/GCSE/dg.exp
+++ /dev/null
@@ -1,3 +0,0 @@
-load_lib llvm.exp
-
-RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
diff --git a/release_23/test/Transforms/GCSE/gcsetests.ll b/release_23/test/Transforms/GCSE/gcsetests.ll
deleted file mode 100644
index 6fb3057acb89..000000000000
--- a/release_23/test/Transforms/GCSE/gcsetests.ll
+++ /dev/null
@@ -1,46 +0,0 @@
-; Various test cases to ensure basic functionality is working for GCSE
-
-; RUN: llvm-as < %s | opt -gcse
-
-define void @testinsts(i32 %i, i32 %j, i32* %p) {
- %A = bitcast i32 %i to i32 ; <i32> [#uses=0]
- %B = bitcast i32 %i to i32 ; <i32> [#uses=0]
- %C = shl i32 %i, 1 ; <i32> [#uses=0]
- %D = shl i32 %i, 1 ; <i32> [#uses=0]
- %E = getelementptr i32* %p, i64 12 ; <i32*> [#uses=0]
- %F = getelementptr i32* %p, i64 12 ; <i32*> [#uses=0]
- %G = getelementptr i32* %p, i64 13 ; <i32*> [#uses=0]
- ret void
-}
-
-; Test different combinations of domination properties...
-define void @sameBBtest(i32 %i, i32 %j) {
- %A = add i32 %i, %j ; <i32> [#uses=1]
- %B = add i32 %i, %j ; <i32> [#uses=1]
- %C = xor i32 %A, -1 ; <i32> [#uses=0]
- %D = xor i32 %B, -1 ; <i32> [#uses=0]
- %E = xor i32 %j, -1 ; <i32> [#uses=0]
- ret void
-}
-
-define i32 @dominates(i32 %i, i32 %j) {
- %A = add i32 %i, %j ; <i32> [#uses=0]
- br label %BB2
-
-BB2: ; preds = %0
- %B = add i32 %i, %j ; <i32> [#uses=1]
- ret i32 %B
-}
-
-define i32 @hascommondominator(i32 %i, i32 %j) {
- br i1 true, label %BB1, label %BB2
-
-BB1: ; preds = %0
- %A = add i32 %i, %j ; <i32> [#uses=1]
- ret i32 %A
-
-BB2: ; preds = %0
- %B = add i32 %i, %j ; <i32> [#uses=1]
- ret i32 %B
-}
-
diff --git a/release_23/test/Transforms/GCSE/vectorops.ll b/release_23/test/Transforms/GCSE/vectorops.ll
deleted file mode 100644
index f52688e3acc2..000000000000
--- a/release_23/test/Transforms/GCSE/vectorops.ll
+++ /dev/null
@@ -1,24 +0,0 @@
-; RUN: llvm-as < %s | opt -gcse -instcombine | \
-; RUN: llvm-dis | not grep sub
-
-define i32 @test_extractelement(<4 x i32> %V) {
- %R = extractelement <4 x i32> %V, i32 1 ; <i32> [#uses=1]
- %R2 = extractelement <4 x i32> %V, i32 1 ; <i32> [#uses=1]
- %V.upgrd.1 = sub i32 %R, %R2 ; <i32> [#uses=1]
- ret i32 %V.upgrd.1
-}
-
-define <4 x i32> @test_insertelement(<4 x i32> %V) {
- %R = insertelement <4 x i32> %V, i32 0, i32 0 ; <<4 x i32>> [#uses=1]
- %R2 = insertelement <4 x i32> %V, i32 0, i32 0 ; <<4 x i32>> [#uses=1]
- %x = sub <4 x i32> %R, %R2 ; <<4 x i32>> [#uses=1]
- ret <4 x i32> %x
-}
-
-define <4 x i32> @test_shufflevector(<4 x i32> %V) {
- %R = shufflevector <4 x i32> %V, <4 x i32> %V, <4 x i32> < i32 1, i32 undef, i32 7, i32 2 > ; <<4 x i32>> [#uses=1]
- %R2 = shufflevector <4 x i32> %V, <4 x i32> %V, <4 x i32> < i32 1, i32 undef, i32 7, i32 2 > ; <<4 x i32>> [#uses=1]
- %x = sub <4 x i32> %R, %R2 ; <<4 x i32>> [#uses=1]
- ret <4 x i32> %x
-}
-
diff --git a/release_23/test/Transforms/GVN/2007-07-25-DominatedLoop.ll b/release_23/test/Transforms/GVN/2007-07-25-DominatedLoop.ll
deleted file mode 100644
index 7c10f970e084..000000000000
--- a/release_23/test/Transforms/GVN/2007-07-25-DominatedLoop.ll
+++ /dev/null
@@ -1,86 +0,0 @@
-; RUN: llvm-as < %s | opt -gvn | llvm-dis
-
- %struct.PerlInterpreter = type { i8 }
-@PL_sv_count = external global i32 ; <i32*> [#uses=2]
-
-define void @perl_destruct(%struct.PerlInterpreter* %sv_interp) {
-entry:
- br i1 false, label %cond_next25, label %cond_true16
-
-cond_true16: ; preds = %entry
- ret void
-
-cond_next25: ; preds = %entry
- br i1 false, label %cond_next33, label %cond_true32
-
-cond_true32: ; preds = %cond_next25
- ret void
-
-cond_next33: ; preds = %cond_next25
- br i1 false, label %cond_next61, label %cond_true.i46
-
-cond_true.i46: ; preds = %cond_next33
- ret void
-
-cond_next61: ; preds = %cond_next33
- br i1 false, label %cond_next69, label %cond_true66
-
-cond_true66: ; preds = %cond_next61
- ret void
-
-cond_next69: ; preds = %cond_next61
- br i1 false, label %Perl_safefree.exit52, label %cond_true.i50
-
-cond_true.i50: ; preds = %cond_next69
- ret void
-
-Perl_safefree.exit52: ; preds = %cond_next69
- br i1 false, label %cond_next80, label %cond_true77
-
-cond_true77: ; preds = %Perl_safefree.exit52
- ret void
-
-cond_next80: ; preds = %Perl_safefree.exit52
- br i1 false, label %Perl_safefree.exit56, label %cond_true.i54
-
-cond_true.i54: ; preds = %cond_next80
- ret void
-
-Perl_safefree.exit56: ; preds = %cond_next80
- br i1 false, label %Perl_safefree.exit60, label %cond_true.i58
-
-cond_true.i58: ; preds = %Perl_safefree.exit56
- ret void
-
-Perl_safefree.exit60: ; preds = %Perl_safefree.exit56
- br i1 false, label %Perl_safefree.exit64, label %cond_true.i62
-
-cond_true.i62: ; preds = %Perl_safefree.exit60
- ret void
-
-Perl_safefree.exit64: ; preds = %Perl_safefree.exit60
- br i1 false, label %Perl_safefree.exit68, label %cond_true.i66
-
-cond_true.i66: ; preds = %Perl_safefree.exit64
- ret void
-
-Perl_safefree.exit68: ; preds = %Perl_safefree.exit64
- br i1 false, label %cond_next150, label %cond_true23.i
-
-cond_true23.i: ; preds = %Perl_safefree.exit68
- ret void
-
-cond_next150: ; preds = %Perl_safefree.exit68
- %tmp16092 = load i32* @PL_sv_count, align 4 ; <i32> [#uses=0]
- br label %cond_next165
-
-bb157: ; preds = %cond_next165
- %tmp158 = load i32* @PL_sv_count, align 4 ; <i32> [#uses=0]
- br label %cond_next165
-
-cond_next165: ; preds = %bb157, %cond_next150
- br i1 false, label %bb171, label %bb157
-
-bb171: ; preds = %cond_next165
- ret void
-}
diff --git a/release_23/test/Transforms/GVN/2007-07-25-InfiniteLoop.ll b/release_23/test/Transforms/GVN/2007-07-25-InfiniteLoop.ll
deleted file mode 100644
index 442ba083749f..000000000000
--- a/release_23/test/Transforms/GVN/2007-07-25-InfiniteLoop.ll
+++ /dev/null
@@ -1,14 +0,0 @@
-; RUN: llvm-as < %s | opt -gvn | llvm-dis | not grep {tmp10 =}
-
- %struct.INT2 = type { i32, i32 }
-@blkshifts = external global %struct.INT2* ; <%struct.INT2**> [#uses=2]
-
-define i32 @xcompact() {
-entry:
- store %struct.INT2* null, %struct.INT2** @blkshifts, align 4
- br label %bb
-
-bb: ; preds = %bb, %entry
- %tmp10 = load %struct.INT2** @blkshifts, align 4 ; <%struct.INT2*> [#uses=0]
- br label %bb
-}
diff --git a/release_23/test/Transforms/GVN/2007-07-25-Loop.ll b/release_23/test/Transforms/GVN/2007-07-25-Loop.ll
deleted file mode 100644
index 2efacb55a204..000000000000
--- a/release_23/test/Transforms/GVN/2007-07-25-Loop.ll
+++ /dev/null
@@ -1,15 +0,0 @@
-; RUN: llvm-as < %s | opt -gvn | llvm-dis
-
- %struct.s_segment_inf = type { float, i32, i16, i16, float, float, i32, float, float }
-
-define void @print_arch(i8* %arch_file, i32 %route_type, i64 %det_routing_arch.0.0, i64 %det_routing_arch.0.1, i64 %det_routing_arch.0.2, i64 %det_routing_arch.0.3, i64 %det_routing_arch.0.4, %struct.s_segment_inf* %segment_inf, i64 %timing_inf.0.0, i64 %timing_inf.0.1, i64 %timing_inf.0.2, i64 %timing_inf.0.3, i64 %timing_inf.0.4, i32 %timing_inf.1) {
-entry:
- br i1 false, label %bb278, label %bb344
-
-bb278: ; preds = %bb278, %entry
- br i1 false, label %bb278, label %bb344
-
-bb344: ; preds = %bb278, %entry
- %tmp38758 = load i16* null, align 2 ; <i16> [#uses=0]
- ret void
-}
diff --git a/release_23/test/Transforms/GVN/2007-07-25-NestedLoop.ll b/release_23/test/Transforms/GVN/2007-07-25-NestedLoop.ll
deleted file mode 100644
index cebaaa39be08..000000000000
--- a/release_23/test/Transforms/GVN/2007-07-25-NestedLoop.ll
+++ /dev/null
@@ -1,38 +0,0 @@
-; RUN: llvm-as < %s | opt -gvn | llvm-dis
-
- %struct.TypHeader = type { i32, %struct.TypHeader**, [3 x i8], i8 }
-
-define %struct.TypHeader* @LtRec(%struct.TypHeader* %hdL, %struct.TypHeader* %hdR) {
-entry:
- br i1 false, label %bb556.preheader, label %bb534.preheader
-
-bb534.preheader: ; preds = %entry
- ret %struct.TypHeader* null
-
-bb556.preheader: ; preds = %entry
- %tmp56119 = getelementptr %struct.TypHeader* %hdR, i32 0, i32 0 ; <i32*> [#uses=1]
- %tmp56220 = load i32* %tmp56119 ; <i32> [#uses=0]
- br i1 false, label %bb.nph23, label %bb675.preheader
-
-bb.nph23: ; preds = %bb556.preheader
- ret %struct.TypHeader* null
-
-bb656: ; preds = %bb675.outer, %bb656
- %tmp678 = load i32* %tmp677 ; <i32> [#uses=0]
- br i1 false, label %bb684, label %bb656
-
-bb684: ; preds = %bb675.outer, %bb656
- br i1 false, label %bb924.preheader, label %bb675.outer
-
-bb675.outer: ; preds = %bb675.preheader, %bb684
- %tmp67812 = load i32* %tmp67711 ; <i32> [#uses=0]
- br i1 false, label %bb684, label %bb656
-
-bb675.preheader: ; preds = %bb556.preheader
- %tmp67711 = getelementptr %struct.TypHeader* %hdR, i32 0, i32 0 ; <i32*> [#uses=1]
- %tmp677 = getelementptr %struct.TypHeader* %hdR, i32 0, i32 0 ; <i32*> [#uses=1]
- br label %bb675.outer
-
-bb924.preheader: ; preds = %bb684
- ret %struct.TypHeader* null
-}
diff --git a/release_23/test/Transforms/GVN/2007-07-25-SinglePredecessor.ll b/release_23/test/Transforms/GVN/2007-07-25-SinglePredecessor.ll
deleted file mode 100644
index 10482d8be150..000000000000
--- a/release_23/test/Transforms/GVN/2007-07-25-SinglePredecessor.ll
+++ /dev/null
@@ -1,29 +0,0 @@
-; RUN: llvm-as < %s | opt -gvn | llvm-dis
-
- %struct.ggBRDF = type { i32 (...)** }
- %struct.ggBox3 = type { %struct.ggPoint3, %struct.ggPoint3 }
- %struct.ggMaterialRecord = type { %struct.ggPoint2, %struct.ggBox3, %struct.ggBox3, %struct.ggSpectrum, %struct.ggSpectrum, %struct.ggSpectrum, %struct.ggBRDF*, i32, i32, i32, i32 }
- %struct.ggONB3 = type { %struct.ggPoint3, %struct.ggPoint3, %struct.ggPoint3 }
- %struct.ggPoint2 = type { [2 x double] }
- %struct.ggPoint3 = type { [3 x double] }
- %struct.ggSpectrum = type { [8 x float] }
- %struct.mrViewingHitRecord = type { double, %struct.ggPoint3, %struct.ggONB3, %struct.ggPoint2, double, %struct.ggSpectrum, %struct.ggSpectrum, i32, i32, i32, i32 }
- %struct.mrXEllipticalCylinder = type { %struct.ggBRDF, float, float, float, float, float, float }
-
-define i32 @_ZNK21mrZEllipticalCylinder10viewingHitERK6ggRay3dddR18mrViewingHitRecordR16ggMaterialRecord(%struct.mrXEllipticalCylinder* %this, %struct.ggBox3* %ray, double %unnamed_arg, double %tmin, double %tmax, %struct.mrViewingHitRecord* %VHR, %struct.ggMaterialRecord* %unnamed_arg2) {
-entry:
- %tmp80.i = getelementptr %struct.mrViewingHitRecord* %VHR, i32 0, i32 1, i32 0, i32 0 ; <double*> [#uses=1]
- store double 0.000000e+00, double* %tmp80.i
- br i1 false, label %return, label %cond_next.i
-
-cond_next.i: ; preds = %entry
- br i1 false, label %return, label %cond_true
-
-cond_true: ; preds = %cond_next.i
- %tmp3.i8 = getelementptr %struct.mrViewingHitRecord* %VHR, i32 0, i32 1, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp46 = load double* %tmp3.i8 ; <double> [#uses=0]
- ret i32 1
-
-return: ; preds = %cond_next.i, %entry
- ret i32 0
-}
diff --git a/release_23/test/Transforms/GVN/2007-07-26-InterlockingLoops.ll b/release_23/test/Transforms/GVN/2007-07-26-InterlockingLoops.ll
deleted file mode 100644
index 1dd1479b4825..000000000000
--- a/release_23/test/Transforms/GVN/2007-07-26-InterlockingLoops.ll
+++ /dev/null
@@ -1,30 +0,0 @@
-; RUN: llvm-as < %s | opt -gvn | llvm-dis | not grep {tmp17625 =}
-; RUN: llvm-as < %s | opt -gvn | llvm-dis | not grep {tmp17631 =}
-
-@last = external global [65 x i32*] ; <[65 x i32*]*> [#uses=1]
-
-define i32 @NextRootMove(i32 %wtm) {
-cond_next95: ; preds = %cond_true85, %cond_true79, %cond_true73, %bb68
- %tmp17618 = load i32** getelementptr ([65 x i32*]* @last, i32 0, i32 1), align 4 ; <i32*> [#uses=0]
- br label %cond_true116
-
-cond_true116: ; preds = %cond_true111
- br i1 false, label %cond_true128, label %cond_true145
-
-cond_true128: ; preds = %cond_true121
- %tmp17625 = load i32** getelementptr ([65 x i32*]* @last, i32 0, i32 1), align 4 ; <i32*> [#uses=0]
- br i1 false, label %bb98.backedge, label %return.loopexit
-
-bb98.backedge: ; preds = %bb171, %cond_true145, %cond_true128
- br label %cond_true116
-
-cond_true145: ; preds = %cond_false
- %tmp17631 = load i32** getelementptr ([65 x i32*]* @last, i32 0, i32 1), align 4 ; <i32*> [#uses=0]
- br i1 false, label %bb98.backedge, label %return.loopexit
-
-return.loopexit: ; preds = %bb171, %cond_true145, %cond_true128
- br label %return
-
-return: ; preds = %return.loopexit, %cond_next95, %cond_true85
- ret i32 0
-}
diff --git a/release_23/test/Transforms/GVN/2007-07-26-NonRedundant.ll b/release_23/test/Transforms/GVN/2007-07-26-NonRedundant.ll
deleted file mode 100644
index 204803ad3728..000000000000
--- a/release_23/test/Transforms/GVN/2007-07-26-NonRedundant.ll
+++ /dev/null
@@ -1,16 +0,0 @@
-; RUN: llvm-as < %s | opt -gvn | llvm-dis
-
-@bsLive = external global i32 ; <i32*> [#uses=2]
-
-define i32 @bsR(i32 %n) {
-entry:
- br i1 false, label %cond_next, label %bb19
-
-cond_next: ; preds = %entry
- store i32 0, i32* @bsLive, align 4
- br label %bb19
-
-bb19: ; preds = %cond_next, %entry
- %tmp29 = load i32* @bsLive, align 4 ; <i32> [#uses=0]
- ret i32 0
-}
diff --git a/release_23/test/Transforms/GVN/2007-07-26-PhiErasure.ll b/release_23/test/Transforms/GVN/2007-07-26-PhiErasure.ll
deleted file mode 100644
index 52c5b8e7ec83..000000000000
--- a/release_23/test/Transforms/GVN/2007-07-26-PhiErasure.ll
+++ /dev/null
@@ -1,28 +0,0 @@
-; RUN: llvm-as < %s | opt -gvn | llvm-dis | not grep {tmp298316 =}
-
- %struct..0anon = type { i32 }
- %struct.FILE = type { i8*, i32, i32, i16, i16, %struct.__sbuf, i32, i8*, i32 (i8*)*, i32 (i8*, i8*, i32)*, i64 (i8*, i64, i32)*, i32 (i8*, i8*, i32)*, %struct.__sbuf, %struct.__sFILEX*, i32, [3 x i8], [1 x i8], %struct.__sbuf, i32, i64 }
- %struct.__sFILEX = type opaque
- %struct.__sbuf = type { i8*, i32 }
- %struct.rtx_def = type { i16, i8, i8, [1 x %struct..0anon] }
-@n_spills = external global i32 ; <i32*> [#uses=2]
-
-define i32 @reload(%struct.rtx_def* %first, i32 %global, %struct.FILE* %dumpfile) {
-cond_next2835.1: ; preds = %cond_next2861
- %tmp2922 = load i32* @n_spills, align 4 ; <i32> [#uses=0]
- br label %bb2928
-
-bb2928: ; preds = %cond_next2835.1, %cond_next2943
- br i1 false, label %cond_next2943, label %cond_true2935
-
-cond_true2935: ; preds = %bb2928
- br label %cond_next2943
-
-cond_next2943: ; preds = %cond_true2935, %bb2928
- br i1 false, label %bb2982.preheader, label %bb2928
-
-bb2982.preheader: ; preds = %cond_next2943
- %tmp298316 = load i32* @n_spills, align 4 ; <i32> [#uses=0]
- ret i32 0
-
-}
diff --git a/release_23/test/Transforms/GVN/2007-07-30-PredIDom.ll b/release_23/test/Transforms/GVN/2007-07-30-PredIDom.ll
deleted file mode 100644
index 1d1aec1146aa..000000000000
--- a/release_23/test/Transforms/GVN/2007-07-30-PredIDom.ll
+++ /dev/null
@@ -1,274 +0,0 @@
-; RUN: llvm-as < %s | opt -gvn | llvm-dis
-
- %"struct.Block::$_16" = type { i32 }
- %struct.Exp = type { %struct.Exp_*, i32, i32, i32, %struct.Exp*, %struct.Exp*, %"struct.Exp::$_10", %"struct.Block::$_16", %"struct.Exp::$_12" }
- %"struct.Exp::$_10" = type { %struct.Exp* }
- %"struct.Exp::$_12" = type { %struct.Exp** }
- %struct.Exp_ = type { i32, i32, i32, i32, %struct.Id* }
- %struct.Id = type { i8*, i32, i32, i32, %"struct.Id::$_13" }
- %"struct.Id::$_13" = type { double }
-
-define i8* @_ZN3Exp8toStringEj(%struct.Exp* %this, i32 %nextpc) {
-entry:
- switch i32 0, label %bb970 [
- i32 1, label %bb
- i32 2, label %bb39
- i32 3, label %bb195
- i32 4, label %bb270
- i32 5, label %bb418
- i32 6, label %bb633
- i32 7, label %bb810
- i32 8, label %bb882
- i32 9, label %bb925
- ]
-
-bb: ; preds = %entry
- store i8* null, i8** null
- br label %return
-
-bb39: ; preds = %entry
- br i1 false, label %cond_true, label %cond_false132
-
-cond_true: ; preds = %bb39
- br i1 false, label %cond_true73, label %cond_false
-
-cond_true73: ; preds = %cond_true
- br i1 false, label %cond_true108, label %cond_next
-
-cond_true108: ; preds = %cond_true73
- br label %cond_next
-
-cond_next: ; preds = %cond_true108, %cond_true73
- br label %cond_next131
-
-cond_false: ; preds = %cond_true
- br label %cond_next131
-
-cond_next131: ; preds = %cond_false, %cond_next
- br label %cond_next141
-
-cond_false132: ; preds = %bb39
- br label %cond_next141
-
-cond_next141: ; preds = %cond_false132, %cond_next131
- br i1 false, label %cond_true169, label %cond_false175
-
-cond_true169: ; preds = %cond_next141
- br label %cond_next181
-
-cond_false175: ; preds = %cond_next141
- br label %cond_next181
-
-cond_next181: ; preds = %cond_false175, %cond_true169
- br i1 false, label %cond_true189, label %cond_next191
-
-cond_true189: ; preds = %cond_next181
- br label %cond_next191
-
-cond_next191: ; preds = %cond_true189, %cond_next181
- store i8* null, i8** null
- br label %return
-
-bb195: ; preds = %entry
- br i1 false, label %cond_true248, label %cond_false250
-
-cond_true248: ; preds = %bb195
- br label %cond_next252
-
-cond_false250: ; preds = %bb195
- br label %cond_next252
-
-cond_next252: ; preds = %cond_false250, %cond_true248
- br i1 false, label %cond_true265, label %cond_next267
-
-cond_true265: ; preds = %cond_next252
- br label %cond_next267
-
-cond_next267: ; preds = %cond_true265, %cond_next252
- store i8* null, i8** null
- br label %return
-
-bb270: ; preds = %entry
- br i1 false, label %cond_true338, label %cond_false340
-
-cond_true338: ; preds = %bb270
- br label %cond_next342
-
-cond_false340: ; preds = %bb270
- br label %cond_next342
-
-cond_next342: ; preds = %cond_false340, %cond_true338
- br i1 false, label %cond_true362, label %cond_false364
-
-cond_true362: ; preds = %cond_next342
- br label %cond_next366
-
-cond_false364: ; preds = %cond_next342
- br label %cond_next366
-
-cond_next366: ; preds = %cond_false364, %cond_true362
- br i1 false, label %cond_true393, label %cond_next395
-
-cond_true393: ; preds = %cond_next366
- br label %cond_next395
-
-cond_next395: ; preds = %cond_true393, %cond_next366
- br i1 false, label %cond_true406, label %cond_next408
-
-cond_true406: ; preds = %cond_next395
- br label %cond_next408
-
-cond_next408: ; preds = %cond_true406, %cond_next395
- br i1 false, label %cond_true413, label %cond_next415
-
-cond_true413: ; preds = %cond_next408
- br label %cond_next415
-
-cond_next415: ; preds = %cond_true413, %cond_next408
- store i8* null, i8** null
- br label %return
-
-bb418: ; preds = %entry
- br i1 false, label %cond_true512, label %cond_false514
-
-cond_true512: ; preds = %bb418
- br label %cond_next516
-
-cond_false514: ; preds = %bb418
- br label %cond_next516
-
-cond_next516: ; preds = %cond_false514, %cond_true512
- br i1 false, label %cond_true536, label %cond_false538
-
-cond_true536: ; preds = %cond_next516
- br label %cond_next540
-
-cond_false538: ; preds = %cond_next516
- br label %cond_next540
-
-cond_next540: ; preds = %cond_false538, %cond_true536
- br i1 false, label %cond_true560, label %cond_false562
-
-cond_true560: ; preds = %cond_next540
- br label %cond_next564
-
-cond_false562: ; preds = %cond_next540
- br label %cond_next564
-
-cond_next564: ; preds = %cond_false562, %cond_true560
- br i1 false, label %cond_true597, label %cond_next599
-
-cond_true597: ; preds = %cond_next564
- br label %cond_next599
-
-cond_next599: ; preds = %cond_true597, %cond_next564
- br i1 false, label %cond_true614, label %cond_next616
-
-cond_true614: ; preds = %cond_next599
- br label %cond_next616
-
-cond_next616: ; preds = %cond_true614, %cond_next599
- br i1 false, label %cond_true621, label %cond_next623
-
-cond_true621: ; preds = %cond_next616
- br label %cond_next623
-
-cond_next623: ; preds = %cond_true621, %cond_next616
- br i1 false, label %cond_true628, label %cond_next630
-
-cond_true628: ; preds = %cond_next623
- br label %cond_next630
-
-cond_next630: ; preds = %cond_true628, %cond_next623
- store i8* null, i8** null
- br label %return
-
-bb633: ; preds = %entry
- br i1 false, label %cond_true667, label %cond_next669
-
-cond_true667: ; preds = %bb633
- br label %cond_next669
-
-cond_next669: ; preds = %cond_true667, %bb633
- br i1 false, label %cond_true678, label %cond_next791
-
-cond_true678: ; preds = %cond_next669
- br label %bb735
-
-bb679: ; preds = %bb735
- br i1 false, label %cond_true729, label %cond_next731
-
-cond_true729: ; preds = %bb679
- br label %cond_next731
-
-cond_next731: ; preds = %cond_true729, %bb679
- br label %bb735
-
-bb735: ; preds = %cond_next731, %cond_true678
- br i1 false, label %bb679, label %bb743
-
-bb743: ; preds = %bb735
- br i1 false, label %cond_true788, label %cond_next790
-
-cond_true788: ; preds = %bb743
- br label %cond_next790
-
-cond_next790: ; preds = %cond_true788, %bb743
- br label %cond_next791
-
-cond_next791: ; preds = %cond_next790, %cond_next669
- br i1 false, label %cond_true805, label %cond_next807
-
-cond_true805: ; preds = %cond_next791
- br label %cond_next807
-
-cond_next807: ; preds = %cond_true805, %cond_next791
- store i8* null, i8** null
- br label %return
-
-bb810: ; preds = %entry
- br i1 false, label %cond_true870, label %cond_next872
-
-cond_true870: ; preds = %bb810
- br label %cond_next872
-
-cond_next872: ; preds = %cond_true870, %bb810
- br i1 false, label %cond_true877, label %cond_next879
-
-cond_true877: ; preds = %cond_next872
- br label %cond_next879
-
-cond_next879: ; preds = %cond_true877, %cond_next872
- store i8* null, i8** null
- br label %return
-
-bb882: ; preds = %entry
- br i1 false, label %cond_true920, label %cond_next922
-
-cond_true920: ; preds = %bb882
- br label %cond_next922
-
-cond_next922: ; preds = %cond_true920, %bb882
- store i8* null, i8** null
- br label %return
-
-bb925: ; preds = %entry
- br i1 false, label %cond_true965, label %cond_next967
-
-cond_true965: ; preds = %bb925
- br label %cond_next967
-
-cond_next967: ; preds = %cond_true965, %bb925
- store i8* null, i8** null
- br label %return
-
-bb970: ; preds = %entry
- unreachable
- ; No predecessors!
- store i8* null, i8** null
- br label %return
-
-return: ; preds = %0, %cond_next967, %cond_next922, %cond_next879, %cond_next807, %cond_next630, %cond_next415, %cond_next267, %cond_next191, %bb
- %retval980 = load i8** null ; <i8*> [#uses=1]
- ret i8* %retval980
-}
diff --git a/release_23/test/Transforms/GVN/2007-07-31-NoDomInherit.ll b/release_23/test/Transforms/GVN/2007-07-31-NoDomInherit.ll
deleted file mode 100644
index 5dbd34c0cdec..000000000000
--- a/release_23/test/Transforms/GVN/2007-07-31-NoDomInherit.ll
+++ /dev/null
@@ -1,313 +0,0 @@
-; RUN: llvm-as < %s | opt -gvn | llvm-dis | grep tmp51.rle
-
- %struct.anon = type { i32 (i32, i32, i32)*, i32, i32, [3 x i32], i8*, i8*, i8* }
-@debug = external constant i32 ; <i32*> [#uses=0]
-@counters = external constant i32 ; <i32*> [#uses=1]
-@trialx = external global [17 x i32] ; <[17 x i32]*> [#uses=1]
-@dummy1 = external global [7 x i32] ; <[7 x i32]*> [#uses=0]
-@dummy2 = external global [4 x i32] ; <[4 x i32]*> [#uses=0]
-@unacceptable = external global i32 ; <i32*> [#uses=0]
-@isa = external global [13 x %struct.anon] ; <[13 x %struct.anon]*> [#uses=3]
-@.str = external constant [4 x i8] ; <[4 x i8]*> [#uses=0]
-@.str1 = external constant [3 x i8] ; <[3 x i8]*> [#uses=0]
-@.str2 = external constant [1 x i8] ; <[1 x i8]*> [#uses=0]
-@.str3 = external constant [4 x i8] ; <[4 x i8]*> [#uses=0]
-@.str4 = external constant [3 x i8] ; <[3 x i8]*> [#uses=0]
-@.str5 = external constant [4 x i8] ; <[4 x i8]*> [#uses=0]
-@.str6 = external constant [2 x i8] ; <[2 x i8]*> [#uses=0]
-@.str7 = external constant [4 x i8] ; <[4 x i8]*> [#uses=0]
-@.str8 = external constant [4 x i8] ; <[4 x i8]*> [#uses=0]
-@.str9 = external constant [4 x i8] ; <[4 x i8]*> [#uses=0]
-@.str10 = external constant [4 x i8] ; <[4 x i8]*> [#uses=0]
-@.str11 = external constant [2 x i8] ; <[2 x i8]*> [#uses=0]
-@.str12 = external constant [4 x i8] ; <[4 x i8]*> [#uses=0]
-@.str13 = external constant [2 x i8] ; <[2 x i8]*> [#uses=0]
-@.str14 = external constant [5 x i8] ; <[5 x i8]*> [#uses=0]
-@.str15 = external constant [5 x i8] ; <[5 x i8]*> [#uses=0]
-@.str16 = external constant [4 x i8] ; <[4 x i8]*> [#uses=0]
-@.str17 = external constant [4 x i8] ; <[4 x i8]*> [#uses=0]
-@.str18 = external constant [3 x i8] ; <[3 x i8]*> [#uses=0]
-@.str19 = external constant [4 x i8] ; <[4 x i8]*> [#uses=0]
-@.str20 = external constant [4 x i8] ; <[4 x i8]*> [#uses=0]
-@.str21 = external constant [4 x i8] ; <[4 x i8]*> [#uses=0]
-@.str22 = external constant [4 x i8] ; <[4 x i8]*> [#uses=0]
-@.str23 = external constant [5 x i8] ; <[5 x i8]*> [#uses=0]
-@.str24 = external constant [4 x i8] ; <[4 x i8]*> [#uses=0]
-@.str25 = external constant [6 x i8] ; <[6 x i8]*> [#uses=0]
-@.str26 = external constant [5 x i8] ; <[5 x i8]*> [#uses=0]
-@.str27 = external constant [6 x i8] ; <[6 x i8]*> [#uses=0]
-@r = external global [17 x i32] ; <[17 x i32]*> [#uses=0]
-@.str28 = external constant [3 x i8] ; <[3 x i8]*> [#uses=0]
-@.str29 = external constant [5 x i8] ; <[5 x i8]*> [#uses=0]
-@pgm = external global [5 x { i32, [3 x i32] }] ; <[5 x { i32, [3 x i32] }]*> [#uses=4]
-@.str30 = external constant [3 x i8] ; <[3 x i8]*> [#uses=0]
-@.str31 = external constant [13 x i8] ; <[13 x i8]*> [#uses=0]
-@.str32 = external constant [3 x i8] ; <[3 x i8]*> [#uses=0]
-@.str33 = external constant [4 x i8] ; <[4 x i8]*> [#uses=0]
-@.str34 = external constant [20 x i8] ; <[20 x i8]*> [#uses=0]
-@numi = external global i32 ; <i32*> [#uses=7]
-@.str35 = external constant [10 x i8] ; <[10 x i8]*> [#uses=0]
-@counter = external global [5 x i32] ; <[5 x i32]*> [#uses=2]
-@itrialx.2510 = external global i32 ; <i32*> [#uses=0]
-@.str36 = external constant [43 x i8] ; <[43 x i8]*> [#uses=0]
-@.str37 = external constant [42 x i8] ; <[42 x i8]*> [#uses=0]
-@corr_result = external global i32 ; <i32*> [#uses=0]
-@.str38 = external constant [3 x i8] ; <[3 x i8]*> [#uses=0]
-@.str39 = external constant [5 x i8] ; <[5 x i8]*> [#uses=0]
-@.str40 = external constant [47 x i8] ; <[47 x i8]*> [#uses=0]
-@correct_result = external global [17 x i32] ; <[17 x i32]*> [#uses=1]
-@.str41 = external constant [46 x i8] ; <[46 x i8]*> [#uses=0]
-@.str42 = external constant [32 x i8] ; <[32 x i8]*> [#uses=0]
-@.str43 = external constant [44 x i8] ; <[44 x i8]*> [#uses=1]
-@.str44 = external constant [21 x i8] ; <[21 x i8]*> [#uses=1]
-@.str45 = external constant [12 x i8] ; <[12 x i8]*> [#uses=1]
-@.str46 = external constant [5 x i8] ; <[5 x i8]*> [#uses=1]
-@.str47 = external constant [12 x i8] ; <[12 x i8]*> [#uses=1]
-
-declare i32 @neg(i32, i32, i32)
-
-declare i32 @Not(i32, i32, i32)
-
-declare i32 @pop(i32, i32, i32)
-
-declare i32 @nlz(i32, i32, i32)
-
-declare i32 @rev(i32, i32, i32)
-
-declare i32 @add(i32, i32, i32)
-
-declare i32 @sub(i32, i32, i32)
-
-declare i32 @mul(i32, i32, i32)
-
-declare i32 @divide(i32, i32, i32)
-
-declare i32 @divu(i32, i32, i32)
-
-declare i32 @And(i32, i32, i32)
-
-declare i32 @Or(i32, i32, i32)
-
-declare i32 @Xor(i32, i32, i32)
-
-declare i32 @rotl(i32, i32, i32)
-
-declare i32 @shl(i32, i32, i32)
-
-declare i32 @shr(i32, i32, i32)
-
-declare i32 @shrs(i32, i32, i32)
-
-declare i32 @cmpeq(i32, i32, i32)
-
-declare i32 @cmplt(i32, i32, i32)
-
-declare i32 @cmpltu(i32, i32, i32)
-
-declare i32 @seleq(i32, i32, i32)
-
-declare i32 @sellt(i32, i32, i32)
-
-declare i32 @selle(i32, i32, i32)
-
-declare void @print_expr(i32)
-
-declare i32 @printf(i8*, ...)
-
-declare i32 @putchar(i32)
-
-declare void @print_pgm()
-
-declare void @simulate_one_instruction(i32)
-
-declare i32 @check(i32)
-
-declare i32 @puts(i8*)
-
-declare void @fix_operands(i32)
-
-declare void @abort()
-
-declare i32 @increment()
-
-declare i32 @search()
-
-define i32 @main(i32 %argc, i8** %argv) {
-entry:
- %argc_addr = alloca i32 ; <i32*> [#uses=1]
- %argv_addr = alloca i8** ; <i8***> [#uses=1]
- %retval = alloca i32, align 4 ; <i32*> [#uses=2]
- %tmp = alloca i32, align 4 ; <i32*> [#uses=2]
- %i = alloca i32, align 4 ; <i32*> [#uses=21]
- %num_sol = alloca i32, align 4 ; <i32*> [#uses=4]
- %total = alloca i32, align 4 ; <i32*> [#uses=4]
- %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
- store i32 %argc, i32* %argc_addr
- store i8** %argv, i8*** %argv_addr
- store i32 0, i32* %num_sol
- store i32 1, i32* @numi
- br label %bb91
-
-bb: ; preds = %cond_next97
- %tmp1 = load i32* @numi ; <i32> [#uses=1]
- %tmp2 = getelementptr [44 x i8]* @.str43, i32 0, i32 0 ; <i8*> [#uses=1]
- %tmp3 = call i32 (i8*, ...)* @printf( i8* %tmp2, i32 %tmp1 ) ; <i32> [#uses=0]
- store i32 0, i32* %i
- br label %bb13
-
-bb4: ; preds = %bb13
- %tmp5 = load i32* %i ; <i32> [#uses=1]
- %tmp6 = load i32* %i ; <i32> [#uses=1]
- %tmp7 = getelementptr [17 x i32]* @trialx, i32 0, i32 %tmp6 ; <i32*> [#uses=1]
- %tmp8 = load i32* %tmp7 ; <i32> [#uses=1]
- %tmp9 = call i32 @userfun( i32 %tmp8 ) ; <i32> [#uses=1]
- %tmp10 = getelementptr [17 x i32]* @correct_result, i32 0, i32 %tmp5 ; <i32*> [#uses=1]
- store i32 %tmp9, i32* %tmp10
- %tmp11 = load i32* %i ; <i32> [#uses=1]
- %tmp12 = add i32 %tmp11, 1 ; <i32> [#uses=1]
- store i32 %tmp12, i32* %i
- br label %bb13
-
-bb13: ; preds = %bb4, %bb
- %tmp14 = load i32* %i ; <i32> [#uses=1]
- %tmp15 = icmp sle i32 %tmp14, 16 ; <i1> [#uses=1]
- %tmp1516 = zext i1 %tmp15 to i32 ; <i32> [#uses=1]
- %toBool = icmp ne i32 %tmp1516, 0 ; <i1> [#uses=1]
- br i1 %toBool, label %bb4, label %bb17
-
-bb17: ; preds = %bb13
- store i32 0, i32* %i
- br label %bb49
-
-bb18: ; preds = %bb49
- %tmp19 = load i32* %i ; <i32> [#uses=1]
- %tmp20 = getelementptr [5 x { i32, [3 x i32] }]* @pgm, i32 0, i32 %tmp19 ; <{ i32, [3 x i32] }*> [#uses=1]
- %tmp21 = getelementptr { i32, [3 x i32] }* %tmp20, i32 0, i32 0 ; <i32*> [#uses=1]
- store i32 0, i32* %tmp21
- %tmp22 = load i32* %i ; <i32> [#uses=1]
- %tmp23 = getelementptr [13 x %struct.anon]* @isa, i32 0, i32 0 ; <%struct.anon*> [#uses=1]
- %tmp24 = getelementptr %struct.anon* %tmp23, i32 0, i32 3 ; <[3 x i32]*> [#uses=1]
- %tmp25 = getelementptr [3 x i32]* %tmp24, i32 0, i32 0 ; <i32*> [#uses=1]
- %tmp26 = load i32* %tmp25 ; <i32> [#uses=1]
- %tmp27 = getelementptr [5 x { i32, [3 x i32] }]* @pgm, i32 0, i32 %tmp22 ; <{ i32, [3 x i32] }*> [#uses=1]
- %tmp28 = getelementptr { i32, [3 x i32] }* %tmp27, i32 0, i32 1 ; <[3 x i32]*> [#uses=1]
- %tmp29 = getelementptr [3 x i32]* %tmp28, i32 0, i32 0 ; <i32*> [#uses=1]
- store i32 %tmp26, i32* %tmp29
- %tmp30 = load i32* %i ; <i32> [#uses=1]
- %tmp31 = getelementptr [13 x %struct.anon]* @isa, i32 0, i32 0 ; <%struct.anon*> [#uses=1]
- %tmp32 = getelementptr %struct.anon* %tmp31, i32 0, i32 3 ; <[3 x i32]*> [#uses=1]
- %tmp33 = getelementptr [3 x i32]* %tmp32, i32 0, i32 1 ; <i32*> [#uses=1]
- %tmp34 = load i32* %tmp33 ; <i32> [#uses=1]
- %tmp35 = getelementptr [5 x { i32, [3 x i32] }]* @pgm, i32 0, i32 %tmp30 ; <{ i32, [3 x i32] }*> [#uses=1]
- %tmp36 = getelementptr { i32, [3 x i32] }* %tmp35, i32 0, i32 1 ; <[3 x i32]*> [#uses=1]
- %tmp37 = getelementptr [3 x i32]* %tmp36, i32 0, i32 1 ; <i32*> [#uses=1]
- store i32 %tmp34, i32* %tmp37
- %tmp38 = load i32* %i ; <i32> [#uses=1]
- %tmp39 = getelementptr [13 x %struct.anon]* @isa, i32 0, i32 0 ; <%struct.anon*> [#uses=1]
- %tmp40 = getelementptr %struct.anon* %tmp39, i32 0, i32 3 ; <[3 x i32]*> [#uses=1]
- %tmp41 = getelementptr [3 x i32]* %tmp40, i32 0, i32 2 ; <i32*> [#uses=1]
- %tmp42 = load i32* %tmp41 ; <i32> [#uses=1]
- %tmp43 = getelementptr [5 x { i32, [3 x i32] }]* @pgm, i32 0, i32 %tmp38 ; <{ i32, [3 x i32] }*> [#uses=1]
- %tmp44 = getelementptr { i32, [3 x i32] }* %tmp43, i32 0, i32 1 ; <[3 x i32]*> [#uses=1]
- %tmp45 = getelementptr [3 x i32]* %tmp44, i32 0, i32 2 ; <i32*> [#uses=1]
- store i32 %tmp42, i32* %tmp45
- %tmp46 = load i32* %i ; <i32> [#uses=1]
- call void @fix_operands( i32 %tmp46 )
- %tmp47 = load i32* %i ; <i32> [#uses=1]
- %tmp48 = add i32 %tmp47, 1 ; <i32> [#uses=1]
- store i32 %tmp48, i32* %i
- br label %bb49
-
-bb49: ; preds = %bb18, %bb17
- %tmp50 = load i32* @numi ; <i32> [#uses=1]
- %tmp51 = load i32* %i ; <i32> [#uses=1]
- %tmp52 = icmp slt i32 %tmp51, %tmp50 ; <i1> [#uses=1]
- %tmp5253 = zext i1 %tmp52 to i32 ; <i32> [#uses=1]
- %toBool54 = icmp ne i32 %tmp5253, 0 ; <i1> [#uses=1]
- br i1 %toBool54, label %bb18, label %bb55
-
-bb55: ; preds = %bb49
- %tmp56 = call i32 @search( ) ; <i32> [#uses=1]
- store i32 %tmp56, i32* %num_sol
- %tmp57 = getelementptr [21 x i8]* @.str44, i32 0, i32 0 ; <i8*> [#uses=1]
- %tmp58 = load i32* %num_sol ; <i32> [#uses=1]
- %tmp59 = call i32 (i8*, ...)* @printf( i8* %tmp57, i32 %tmp58 ) ; <i32> [#uses=0]
- %tmp60 = load i32* @counters ; <i32> [#uses=1]
- %tmp61 = icmp ne i32 %tmp60, 0 ; <i1> [#uses=1]
- %tmp6162 = zext i1 %tmp61 to i32 ; <i32> [#uses=1]
- %toBool63 = icmp ne i32 %tmp6162, 0 ; <i1> [#uses=1]
- br i1 %toBool63, label %cond_true, label %cond_next
-
-cond_true: ; preds = %bb55
- store i32 0, i32* %total
- %tmp64 = getelementptr [12 x i8]* @.str45, i32 0, i32 0 ; <i8*> [#uses=1]
- %tmp65 = call i32 (i8*, ...)* @printf( i8* %tmp64 ) ; <i32> [#uses=0]
- store i32 0, i32* %i
- br label %bb79
-
-bb66: ; preds = %bb79
- %tmp67 = load i32* %i ; <i32> [#uses=1]
- %tmp68 = getelementptr [5 x i32]* @counter, i32 0, i32 %tmp67 ; <i32*> [#uses=1]
- %tmp69 = load i32* %tmp68 ; <i32> [#uses=1]
- %tmp70 = getelementptr [5 x i8]* @.str46, i32 0, i32 0 ; <i8*> [#uses=1]
- %tmp71 = call i32 (i8*, ...)* @printf( i8* %tmp70, i32 %tmp69 ) ; <i32> [#uses=0]
- %tmp72 = load i32* %i ; <i32> [#uses=1]
- %tmp73 = getelementptr [5 x i32]* @counter, i32 0, i32 %tmp72 ; <i32*> [#uses=1]
- %tmp74 = load i32* %tmp73 ; <i32> [#uses=1]
- %tmp75 = load i32* %total ; <i32> [#uses=1]
- %tmp76 = add i32 %tmp74, %tmp75 ; <i32> [#uses=1]
- store i32 %tmp76, i32* %total
- %tmp77 = load i32* %i ; <i32> [#uses=1]
- %tmp78 = add i32 %tmp77, 1 ; <i32> [#uses=1]
- store i32 %tmp78, i32* %i
- br label %bb79
-
-bb79: ; preds = %bb66, %cond_true
- %tmp80 = load i32* @numi ; <i32> [#uses=1]
- %tmp81 = load i32* %i ; <i32> [#uses=1]
- %tmp82 = icmp slt i32 %tmp81, %tmp80 ; <i1> [#uses=1]
- %tmp8283 = zext i1 %tmp82 to i32 ; <i32> [#uses=1]
- %toBool84 = icmp ne i32 %tmp8283, 0 ; <i1> [#uses=1]
- br i1 %toBool84, label %bb66, label %bb85
-
-bb85: ; preds = %bb79
- %tmp86 = getelementptr [12 x i8]* @.str47, i32 0, i32 0 ; <i8*> [#uses=1]
- %tmp87 = load i32* %total ; <i32> [#uses=1]
- %tmp88 = call i32 (i8*, ...)* @printf( i8* %tmp86, i32 %tmp87 ) ; <i32> [#uses=0]
- br label %cond_next
-
-cond_next: ; preds = %bb85, %bb55
- %tmp89 = load i32* @numi ; <i32> [#uses=1]
- %tmp90 = add i32 %tmp89, 1 ; <i32> [#uses=1]
- store i32 %tmp90, i32* @numi
- br label %bb91
-
-bb91: ; preds = %cond_next, %entry
- %tmp92 = load i32* @numi ; <i32> [#uses=1]
- %tmp93 = icmp sgt i32 %tmp92, 5 ; <i1> [#uses=1]
- %tmp9394 = zext i1 %tmp93 to i32 ; <i32> [#uses=1]
- %toBool95 = icmp ne i32 %tmp9394, 0 ; <i1> [#uses=1]
- br i1 %toBool95, label %cond_true96, label %cond_next97
-
-cond_true96: ; preds = %bb91
- br label %bb102
-
-cond_next97: ; preds = %bb91
- %tmp98 = load i32* %num_sol ; <i32> [#uses=1]
- %tmp99 = icmp eq i32 %tmp98, 0 ; <i1> [#uses=1]
- %tmp99100 = zext i1 %tmp99 to i32 ; <i32> [#uses=1]
- %toBool101 = icmp ne i32 %tmp99100, 0 ; <i1> [#uses=1]
- br i1 %toBool101, label %bb, label %bb102
-
-bb102: ; preds = %cond_next97, %cond_true96
- store i32 0, i32* %tmp
- %tmp103 = load i32* %tmp ; <i32> [#uses=1]
- store i32 %tmp103, i32* %retval
- br label %return
-
-return: ; preds = %bb102
- %retval104 = load i32* %retval ; <i32> [#uses=1]
- ret i32 %retval104
-}
-
-declare i32 @userfun(i32)
diff --git a/release_23/test/Transforms/GVN/2007-07-31-RedundantPhi.ll b/release_23/test/Transforms/GVN/2007-07-31-RedundantPhi.ll
deleted file mode 100644
index a9ca71ac81d4..000000000000
--- a/release_23/test/Transforms/GVN/2007-07-31-RedundantPhi.ll
+++ /dev/null
@@ -1,22 +0,0 @@
-; RUN: llvm-as < %s | opt -gvn | llvm-dis | not grep {tmp701 =}
-
-@img_width = external global i16 ; <i16*> [#uses=2]
-
-define i32 @smpUMHEXBipredIntegerPelBlockMotionSearch(i16* %cur_pic, i16 signext %ref, i32 %list, i32 %pic_pix_x, i32 %pic_pix_y, i32 %blocktype, i16 signext %pred_mv_x1, i16 signext %pred_mv_y1, i16 signext %pred_mv_x2, i16 signext %pred_mv_y2, i16* %mv_x, i16* %mv_y, i16* %s_mv_x, i16* %s_mv_y, i32 %search_range, i32 %min_mcost, i32 %lambda_factor) {
-cond_next143: ; preds = %entry
- store i16 0, i16* @img_width, align 2
- br i1 false, label %cond_next449, label %cond_false434
-
-cond_false434: ; preds = %cond_true415
- br label %cond_next449
-
-cond_next449: ; preds = %cond_false434, %cond_true415
- br i1 false, label %cond_next698, label %cond_false470
-
-cond_false470: ; preds = %cond_next449
- br label %cond_next698
-
-cond_next698: ; preds = %cond_true492
- %tmp701 = load i16* @img_width, align 2 ; <i16> [#uses=0]
- ret i32 0
-}
diff --git a/release_23/test/Transforms/GVN/2008-02-12-UndefLoad.ll b/release_23/test/Transforms/GVN/2008-02-12-UndefLoad.ll
deleted file mode 100644
index 5ee3d6cbe643..000000000000
--- a/release_23/test/Transforms/GVN/2008-02-12-UndefLoad.ll
+++ /dev/null
@@ -1,20 +0,0 @@
-; RUN: llvm-as < %s | opt -gvn | llvm-dis | not grep load
-; PR1996
-
-%struct.anon = type { i32, i8, i8, i8, i8 }
-
-define i32 @a() {
-entry:
- %c = alloca %struct.anon ; <%struct.anon*> [#uses=2]
- %tmp = getelementptr %struct.anon* %c, i32 0, i32 0 ; <i32*> [#uses=1]
- %tmp1 = getelementptr i32* %tmp, i32 1 ; <i32*> [#uses=2]
- %tmp2 = load i32* %tmp1, align 4 ; <i32> [#uses=1]
- %tmp3 = or i32 %tmp2, 11 ; <i32> [#uses=1]
- %tmp4 = and i32 %tmp3, -21 ; <i32> [#uses=1]
- store i32 %tmp4, i32* %tmp1, align 4
- %call = call i32 (...)* @x( %struct.anon* %c ) ; <i32> [#uses=0]
- ret i32 undef
-}
-
-
-declare i32 @x(...)
diff --git a/release_23/test/Transforms/GVN/2008-02-13-NewPHI.ll b/release_23/test/Transforms/GVN/2008-02-13-NewPHI.ll
deleted file mode 100644
index d3e325146812..000000000000
--- a/release_23/test/Transforms/GVN/2008-02-13-NewPHI.ll
+++ /dev/null
@@ -1,22 +0,0 @@
-; RUN: llvm-as < %s | opt -anders-aa -gvn
-; PR2032
-
-define i32 @sscal(i32 %n, double %sa1, float* %sx, i32 %incx) {
-entry:
- %sx_addr = alloca float* ; <float**> [#uses=3]
- store float* %sx, float** %sx_addr, align 4
- br label %bb33
-
-bb: ; preds = %bb33
- %tmp27 = load float** %sx_addr, align 4 ; <float*> [#uses=1]
- store float 0.000000e+00, float* %tmp27, align 4
- store float* null, float** %sx_addr, align 4
- br label %bb33
-
-bb33: ; preds = %bb, %entry
- br i1 false, label %bb, label %return
-
-return: ; preds = %bb33
- %retval59 = load i32* null, align 4 ; <i32> [#uses=1]
- ret i32 %retval59
-}
diff --git a/release_23/test/Transforms/GVN/2008-02-24-NonDominatedMemcpy.ll b/release_23/test/Transforms/GVN/2008-02-24-NonDominatedMemcpy.ll
deleted file mode 100644
index 54a2201d2d7d..000000000000
--- a/release_23/test/Transforms/GVN/2008-02-24-NonDominatedMemcpy.ll
+++ /dev/null
@@ -1,25 +0,0 @@
-; RUN: llvm-as < %s | opt -gvn -dse | llvm-dis | grep {call.*memcpy} | count 1
-
-target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128"
-target triple = "x86_64-apple-darwin8"
- %struct.ggFrame3 = type { %struct.ggPoint3, %struct.ggONB3 }
- %struct.ggHMatrix3 = type { [4 x [4 x double]] }
- %struct.ggONB3 = type { %struct.ggPoint3, %struct.ggPoint3, %struct.ggPoint3 }
- %struct.ggPoint3 = type { [3 x double] }
- %struct.ggQuaternion = type { [4 x double], i32, %struct.ggHMatrix3 }
-
-declare void @llvm.memcpy.i64(i8*, i8*, i64, i32) nounwind
-
-define void @_Z10ggCRSplineRK8ggFrame3S1_S1_S1_d(%struct.ggFrame3* noalias sret %agg.result, %struct.ggFrame3* %f0, %struct.ggFrame3* %f1, %struct.ggFrame3* %f2, %struct.ggFrame3* %f3, double %t) nounwind {
-entry:
- %qresult = alloca %struct.ggQuaternion ; <%struct.ggQuaternion*> [#uses=1]
- %tmp = alloca %struct.ggONB3 ; <%struct.ggONB3*> [#uses=2]
- call void @_ZN12ggQuaternion7getONB3Ev( %struct.ggONB3* noalias sret %tmp, %struct.ggQuaternion* %qresult ) nounwind
- %tmp1.i = getelementptr %struct.ggFrame3* %agg.result, i32 0, i32 1 ; <%struct.ggONB3*> [#uses=1]
- %tmp13.i = bitcast %struct.ggONB3* %tmp1.i to i8* ; <i8*> [#uses=1]
- %tmp24.i = bitcast %struct.ggONB3* %tmp to i8* ; <i8*> [#uses=1]
- call void @llvm.memcpy.i64( i8* %tmp13.i, i8* %tmp24.i, i64 72, i32 8 ) nounwind
- ret void
-}
-
-declare void @_ZN12ggQuaternion7getONB3Ev(%struct.ggONB3* noalias sret , %struct.ggQuaternion*) nounwind
diff --git a/release_23/test/Transforms/GVN/2008-02-26-MemCpySize.ll b/release_23/test/Transforms/GVN/2008-02-26-MemCpySize.ll
deleted file mode 100644
index 92cac077711c..000000000000
--- a/release_23/test/Transforms/GVN/2008-02-26-MemCpySize.ll
+++ /dev/null
@@ -1,46 +0,0 @@
-; RUN: llvm-as < %s | opt -gvn -dse | llvm-dis | grep {call.*memcpy.*cell} | count 2
-; PR2099
-
-target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
-target triple = "i686-apple-darwin9"
- %struct.s = type { [11 x i8], i32 }
-@.str = internal constant [11 x i8] c"0123456789\00" ; <[11 x i8]*> [#uses=1]
-@cell = weak global %struct.s zeroinitializer ; <%struct.s*> [#uses=2]
-
-declare i32 @check(%struct.s* byval %p) nounwind
-
-declare i32 @strcmp(i8*, i8*) nounwind readonly
-
-define i32 @main() noreturn nounwind {
-entry:
- %p = alloca %struct.s, align 8 ; <%struct.s*> [#uses=2]
- store i32 99, i32* getelementptr (%struct.s* @cell, i32 0, i32 1), align 4
- call void @llvm.memcpy.i32( i8* getelementptr (%struct.s* @cell, i32 0, i32 0, i32 0), i8* getelementptr ([11 x i8]* @.str, i32 0, i32 0), i32 11, i32 1 )
- %tmp = getelementptr %struct.s* %p, i32 0, i32 0, i32 0 ; <i8*> [#uses=2]
- call void @llvm.memcpy.i64( i8* %tmp, i8* getelementptr (%struct.s* @cell, i32 0, i32 0, i32 0), i64 16, i32 8 )
- %tmp1.i = getelementptr %struct.s* %p, i32 0, i32 1 ; <i32*> [#uses=1]
- %tmp2.i = load i32* %tmp1.i, align 4 ; <i32> [#uses=1]
- %tmp3.i = icmp eq i32 %tmp2.i, 99 ; <i1> [#uses=1]
- br i1 %tmp3.i, label %bb5.i, label %bb
-
-bb5.i: ; preds = %entry
- %tmp91.i = call i32 @strcmp( i8* %tmp, i8* getelementptr ([11 x i8]* @.str, i32 0, i32 0) ) nounwind readonly ; <i32> [#uses=1]
- %tmp53 = icmp eq i32 %tmp91.i, 0 ; <i1> [#uses=1]
- br i1 %tmp53, label %bb7, label %bb
-
-bb: ; preds = %bb5.i, %entry
- call void @abort( ) noreturn nounwind
- unreachable
-
-bb7: ; preds = %bb5.i
- call void @exit( i32 0 ) noreturn nounwind
- unreachable
-}
-
-declare void @llvm.memcpy.i32(i8*, i8*, i32, i32) nounwind
-
-declare void @abort() noreturn nounwind
-
-declare void @exit(i32) noreturn nounwind
-
-declare void @llvm.memcpy.i64(i8*, i8*, i64, i32) nounwind
diff --git a/release_23/test/Transforms/GVN/basic.ll b/release_23/test/Transforms/GVN/basic.ll
deleted file mode 100644
index ebf5daaf9272..000000000000
--- a/release_23/test/Transforms/GVN/basic.ll
+++ /dev/null
@@ -1,10 +0,0 @@
-; RUN: llvm-as < %s | opt -gvn | llvm-dis | not grep {%z2 =}
-
-define i32 @main() {
-block1:
- %z1 = bitcast i32 0 to i32
- br label %block2
-block2:
- %z2 = bitcast i32 0 to i32
- ret i32 %z2
-}
diff --git a/release_23/test/Transforms/GVN/call.ll b/release_23/test/Transforms/GVN/call.ll
deleted file mode 100644
index 0a045c8bd50c..000000000000
--- a/release_23/test/Transforms/GVN/call.ll
+++ /dev/null
@@ -1,12 +0,0 @@
-; RUN: llvm-as < %s | opt -gvn | llvm-dis | not grep tmp2
-; PR2213
-
-define i32* @f(i8* %x) {
-entry:
- %tmp = call i8* @m( i32 12 ) ; <i8*> [#uses=2]
- %tmp1 = bitcast i8* %tmp to i32* ; <i32*> [#uses=0]
- %tmp2 = bitcast i8* %tmp to i32* ; <i32*> [#uses=0]
- ret i32* %tmp2
-}
-
-declare i8* @m(i32)
diff --git a/release_23/test/Transforms/GVN/dg.exp b/release_23/test/Transforms/GVN/dg.exp
deleted file mode 100644
index 879685ca879d..000000000000
--- a/release_23/test/Transforms/GVN/dg.exp
+++ /dev/null
@@ -1,3 +0,0 @@
-load_lib llvm.exp
-
-RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
diff --git a/release_23/test/Transforms/GVN/dominated.ll b/release_23/test/Transforms/GVN/dominated.ll
deleted file mode 100644
index d7c9417bcf75..000000000000
--- a/release_23/test/Transforms/GVN/dominated.ll
+++ /dev/null
@@ -1,20 +0,0 @@
-; RUN: llvm-as < %s | opt -gvn | llvm-dis | not grep DEAD
-
-define i32 @main(i32** %p) {
-block1:
- %z = load i32** %p
- br i1 true, label %block2, label %block3
-
-block2:
- %a = load i32** %p
- br label %block4
-
-block3:
- %b = load i32** %p
- br label %block4
-
-block4:
- %DEAD = load i32** %p
- %c = load i32* %DEAD
- ret i32 %c
-}
diff --git a/release_23/test/Transforms/GVN/mixed.ll b/release_23/test/Transforms/GVN/mixed.ll
deleted file mode 100644
index 0c4f65cf9651..000000000000
--- a/release_23/test/Transforms/GVN/mixed.ll
+++ /dev/null
@@ -1,13 +0,0 @@
-; RUN: llvm-as < %s | opt -gvn | llvm-dis | not grep DEADLOAD
-; RUN: llvm-as < %s | opt -gvn | llvm-dis | not grep DEADGEP
-
-define i32 @main(i32** %p) {
-block1:
- %z1 = load i32** %p
- %z2 = getelementptr i32* %z1, i32 0
- %z3 = load i32* %z2
- %DEADLOAD = load i32** %p
- %DEADGEP = getelementptr i32* %DEADLOAD, i32 0
- %DEADLOAD2 = load i32* %DEADGEP
- ret i32 %DEADLOAD2
-}
diff --git a/release_23/test/Transforms/GVN/nonlocal.ll b/release_23/test/Transforms/GVN/nonlocal.ll
deleted file mode 100644
index 1618d05efb5f..000000000000
--- a/release_23/test/Transforms/GVN/nonlocal.ll
+++ /dev/null
@@ -1,19 +0,0 @@
-; RUN: llvm-as < %s | opt -gvn | llvm-dis | not grep {DEAD =}
-
-define i32 @main(i32** %p) {
-block1:
- br i1 true, label %block2, label %block3
-
-block2:
- %a = load i32** %p
- br label %block4
-
-block3:
- %b = load i32** %p
- br label %block4
-
-block4:
- %DEAD = load i32** %p
- %c = load i32* %DEAD
- ret i32 %c
-}
diff --git a/release_23/test/Transforms/GVN/semidominated.ll b/release_23/test/Transforms/GVN/semidominated.ll
deleted file mode 100644
index 95ee56a39c01..000000000000
--- a/release_23/test/Transforms/GVN/semidominated.ll
+++ /dev/null
@@ -1,19 +0,0 @@
-; RUN: llvm-as < %s | opt -gvn | llvm-dis | not grep {DEAD =}
-
-define i32 @main(i32* %p) {
-block1:
- %z = load i32* %p
- br i1 true, label %block2, label %block3
-
-block2:
- br label %block4
-
-block3:
- %b = bitcast i32 0 to i32
- store i32 %b, i32* %p
- br label %block4
-
-block4:
- %DEAD = load i32* %p
- ret i32 %DEAD
-}
diff --git a/release_23/test/Transforms/GVNPRE/2007-06-12-NoExit.ll b/release_23/test/Transforms/GVNPRE/2007-06-12-NoExit.ll
deleted file mode 100644
index b93a956b2f15..000000000000
--- a/release_23/test/Transforms/GVNPRE/2007-06-12-NoExit.ll
+++ /dev/null
@@ -1,9 +0,0 @@
-; RUN: llvm-as < %s | opt -gvnpre | llvm-dis
-
-define void @_Z4sortI3Lit16LessThan_defaultIS0_EEvPT_iT0_() {
-entry:
- br label %cond_false
-
-cond_false: ; preds = %cond_false, %entry
- br label %cond_false
-}
diff --git a/release_23/test/Transforms/GVNPRE/2007-06-12-PhiTranslate.ll b/release_23/test/Transforms/GVNPRE/2007-06-12-PhiTranslate.ll
deleted file mode 100644
index 3a6ac679cbc9..000000000000
--- a/release_23/test/Transforms/GVNPRE/2007-06-12-PhiTranslate.ll
+++ /dev/null
@@ -1,19 +0,0 @@
-; RUN: llvm-as < %s | opt -gvnpre | llvm-dis
-
-define void @strength_test5(i32* %data) {
-entry:
- br i1 false, label %cond_next16.preheader, label %cond_true
-
-cond_true: ; preds = %entry
- %tmp12 = icmp sgt i32 0, 0 ; <i1> [#uses=1]
- br i1 %tmp12, label %return, label %cond_next16.preheader
-
-cond_next16.preheader: ; preds = %cond_true, %entry
- %i.01.1.ph = phi i32 [ 1, %entry ], [ 1, %cond_true ] ; <i32> [#uses=1]
- %i.01.1 = add i32 0, %i.01.1.ph ; <i32> [#uses=0]
- %indvar.next = add i32 0, 1 ; <i32> [#uses=0]
- ret void
-
-return: ; preds = %cond_true
- ret void
-}
diff --git a/release_23/test/Transforms/GVNPRE/2007-06-15-InvokeInst.ll b/release_23/test/Transforms/GVNPRE/2007-06-15-InvokeInst.ll
deleted file mode 100644
index 86187b291b87..000000000000
--- a/release_23/test/Transforms/GVNPRE/2007-06-15-InvokeInst.ll
+++ /dev/null
@@ -1,70 +0,0 @@
-; RUN: llvm-as < %s | opt -gvnpre | llvm-dis
-
-@.str1 = external constant [4 x i8] ; <[4 x i8]*> [#uses=1]
-@.str2 = external constant [5 x i8] ; <[5 x i8]*> [#uses=1]
-
-define i32 @main(i32 %argc, i8** %argv) {
-entry:
- br i1 false, label %cond_next, label %cond_true
-
-cond_true: ; preds = %entry
- ret i32 0
-
-cond_next: ; preds = %entry
- %tmp10 = invoke i16 @_ZN12token_stream4openEPKc( i8* null, i8* null ) signext
- to label %invcont unwind label %cleanup690 ; <i16> [#uses=0]
-
-invcont: ; preds = %cond_next
- %tmp15 = invoke i32 (i8*, ...)* @printf( i8* getelementptr ([4 x i8]* @.str1, i32 0, i32 0) )
- to label %invcont14 unwind label %cleanup685 ; <i32> [#uses=0]
-
-invcont14: ; preds = %invcont
- %tmp17 = invoke i8* @_ZN24lambda_expression_parser10expressionEPP11arglst_node( i8* null, i8** null )
- to label %cond_true22 unwind label %cleanup685
-
-cond_true22: ; preds = %invcont14
- %tmp35 = invoke i32 null( i8* null )
- to label %cond_next56 unwind label %cleanup685 ; <i32> [#uses=0]
-
-cond_next56: ; preds = %cond_true22
- %tmp59 = invoke i32 (i8*, ...)* @printf( i8* getelementptr ([5 x i8]* @.str2, i32 0, i32 0) )
- to label %invcont58 unwind label %cleanup685 ; <i32> [#uses=0]
-
-invcont58: ; preds = %cond_next56
- invoke void null( i8* null, i8* null, i32 0 )
- to label %invcont72 unwind label %cleanup685
-
-invcont72: ; preds = %invcont58
- %tmp143 = invoke i32 null( i8* null )
- to label %invcont142 unwind label %cleanup685 ; <i32> [#uses=0]
-
-invcont142: ; preds = %invcont72
- br i1 false, label %cond_false407, label %cond_true150
-
-cond_true150: ; preds = %invcont142
- ret i32 0
-
-cond_false407: ; preds = %invcont142
- %tmp431 = invoke i8* null( i8* null, i8* null, i32 0, i32* null )
- to label %bb432 unwind label %cleanup685
-
-bb432: ; preds = %bb432, %cond_false407
- %rexp413.7 = phi i8* [ %tmp431, %cond_false407 ], [ %rexp413.7, %bb432 ]
- %tmp434 = icmp eq i8* %rexp413.7, null ; <i1> [#uses=1]
- br i1 %tmp434, label %bb432, label %cond_true437
-
-cond_true437: ; preds = %bb432
- ret i32 0
-
-cleanup685: ; preds = %cond_false407, %invcont72, %invcont58, %cond_next56, %cond_true22, %invcont14, %invcont
- ret i32 0
-
-cleanup690: ; preds = %cond_next
- ret i32 0
-}
-
-declare i16 @_ZN12token_stream4openEPKc(i8*, i8*) signext
-
-declare i32 @printf(i8*, ...)
-
-declare i8* @_ZN24lambda_expression_parser10expressionEPP11arglst_node(i8*, i8**)
diff --git a/release_23/test/Transforms/GVNPRE/2007-06-15-Looping.ll b/release_23/test/Transforms/GVNPRE/2007-06-15-Looping.ll
deleted file mode 100644
index 92d2288f8969..000000000000
--- a/release_23/test/Transforms/GVNPRE/2007-06-15-Looping.ll
+++ /dev/null
@@ -1,22 +0,0 @@
-; RUN: llvm-as < %s | opt -gvnpre | llvm-dis
-
-define fastcc void @compute_max_score_1() {
-entry:
- %tmp7 = sub i32 0, 0 ; <i32> [#uses=0]
- br label %bb
-
-bb: ; preds = %bb212, %entry
- %indvar29 = phi i32 [ 0, %entry ], [ %indvar.next30, %bb212 ] ; <i32> [#uses=2]
- %j.01.0 = sub i32 %indvar29, 0 ; <i32> [#uses=0]
- br label %cond_next166
-
-cond_next166: ; preds = %cond_next166, %bb
- br i1 false, label %bb212, label %cond_next166
-
-bb212: ; preds = %cond_next166
- %indvar.next30 = add i32 %indvar29, 1 ; <i32> [#uses=1]
- br i1 false, label %return, label %bb
-
-return: ; preds = %bb212
- ret void
-}
diff --git a/release_23/test/Transforms/GVNPRE/2007-06-18-ConstantInPhi.ll b/release_23/test/Transforms/GVNPRE/2007-06-18-ConstantInPhi.ll
deleted file mode 100644
index b4cb5178c4ca..000000000000
--- a/release_23/test/Transforms/GVNPRE/2007-06-18-ConstantInPhi.ll
+++ /dev/null
@@ -1,22 +0,0 @@
-; RUN: llvm-as < %s | opt -gvnpre | llvm-dis
-
-define void @vorbis_lsp_to_curve() {
-entry:
- br i1 false, label %bb.nph, label %return
-
-bb.nph: ; preds = %entry
- br label %bb34
-
-bb34: ; preds = %bb34, %bb.nph
- %p.1 = phi float [ 0x3FE6A09E60000000, %bb.nph ], [ %tmp48, %bb34 ] ; <float> [#uses=1]
- %tmp44 = load float* null ; <float> [#uses=1]
- %tmp46 = sub float %tmp44, 0.000000e+00 ; <float> [#uses=1]
- %tmp48 = mul float %tmp46, %p.1 ; <float> [#uses=1]
- br i1 false, label %bb57, label %bb34
-
-bb57: ; preds = %bb34
- ret void
-
-return: ; preds = %entry
- ret void
-}
diff --git a/release_23/test/Transforms/GVNPRE/2007-06-18-EraseNumbering.ll b/release_23/test/Transforms/GVNPRE/2007-06-18-EraseNumbering.ll
deleted file mode 100644
index af51a032cab4..000000000000
--- a/release_23/test/Transforms/GVNPRE/2007-06-18-EraseNumbering.ll
+++ /dev/null
@@ -1,26 +0,0 @@
-; RUN: llvm-as < %s | opt -gvnpre | llvm-dis
-
-define i32 @TreeCCStreamFlush(i8* %stream) {
-entry:
- br i1 false, label %bb55.preheader, label %cond_true
-
-cond_true: ; preds = %entry
- ret i32 0
-
-bb55.preheader: ; preds = %entry
- %tmp57 = icmp eq i8* null, null ; <i1> [#uses=0]
- br i1 false, label %cond_next106, label %bb124
-
-cond_next106: ; preds = %bb55.preheader
- %tmp109 = load i8** null
- br i1 false, label %bb124, label %bb116
-
-bb116: ; preds = %cond_next106
- ret i32 0
-
-bb124: ; preds = %cond_next106, %bb55.preheader
- %buffer.4 = phi i8* [ null, %bb55.preheader ], [ %tmp109, %cond_next106 ]
- %tmp131 = icmp eq i8* %buffer.4, null
- %bothcond = or i1 %tmp131, false
- ret i32 0
-}
diff --git a/release_23/test/Transforms/GVNPRE/2007-07-03-PhiTranslateGEP.ll b/release_23/test/Transforms/GVNPRE/2007-07-03-PhiTranslateGEP.ll
deleted file mode 100644
index 65d70d95820e..000000000000
--- a/release_23/test/Transforms/GVNPRE/2007-07-03-PhiTranslateGEP.ll
+++ /dev/null
@@ -1,14 +0,0 @@
-; RUN: llvm-as < %s | opt -gvnpre | llvm-dis
-
-define i64 @foo({ i32, i32 }** %__v) {
-entry:
- br label %bb
-
-bb: ; preds = %bb, %entry
- %__x.066.0 = phi { i32, i32 }* [ null, %entry ], [ null, %bb ]
- %tmp2.i.i63 = getelementptr { i32, i32 }* %__x.066.0, i32 0, i32 1
- br i1 false, label %bb, label %cond_true
-
-cond_true: ; preds = %bb
- ret i64 0
-}
diff --git a/release_23/test/Transforms/GVNPRE/2007-07-04-CleanSelect.ll b/release_23/test/Transforms/GVNPRE/2007-07-04-CleanSelect.ll
deleted file mode 100644
index d72e2e1eb519..000000000000
--- a/release_23/test/Transforms/GVNPRE/2007-07-04-CleanSelect.ll
+++ /dev/null
@@ -1,9 +0,0 @@
-; RUN: llvm-as < %s | opt -gvnpre | llvm-dis
-
-define i32* @_ZN6Solver9propagateEv(i32* %this) {
-entry:
- %tmp15.i48 = load i8* null ; <i8> [#uses=2]
- %tmp64.i.i51 = sub i8 0, %tmp15.i48 ; <i8> [#uses=1]
- %tmp231.i52 = select i1 false, i8 %tmp15.i48, i8 %tmp64.i.i51 ; <i8> [#uses=0]
- ret i32* null
-}
diff --git a/release_23/test/Transforms/GVNPRE/2007-07-04-SelectInst.ll b/release_23/test/Transforms/GVNPRE/2007-07-04-SelectInst.ll
deleted file mode 100644
index 944a70059386..000000000000
--- a/release_23/test/Transforms/GVNPRE/2007-07-04-SelectInst.ll
+++ /dev/null
@@ -1,18 +0,0 @@
-; RUN: llvm-as < %s | opt -gvnpre | llvm-dis
-
-define void @set_depth_values(i32 %level) {
-cond_true90: ; preds = %cond_next84
- br i1 false, label %cond_true105, label %cond_true151
-
-cond_true105: ; preds = %cond_true90
- %tmp132 = add i32 %level, -3 ; <i32> [#uses=2]
- %tmp133 = icmp sgt i32 %tmp132, 0 ; <i1> [#uses=1]
- %max134 = select i1 %tmp133, i32 %tmp132, i32 1 ; <i32> [#uses=0]
- br label %cond_true151
-
-cond_true151: ; preds = %cond_true140, %cond_true105
- %tmp153 = add i32 %level, -3 ; <i32> [#uses=2]
- %tmp154 = icmp sgt i32 %tmp153, 0 ; <i1> [#uses=1]
- %max155 = select i1 %tmp154, i32 %tmp153, i32 1 ; <i32> [#uses=0]
- ret void
-}
diff --git a/release_23/test/Transforms/GVNPRE/2007-07-05-AvailabilityUpdating.ll b/release_23/test/Transforms/GVNPRE/2007-07-05-AvailabilityUpdating.ll
deleted file mode 100644
index 5510935ebbc4..000000000000
--- a/release_23/test/Transforms/GVNPRE/2007-07-05-AvailabilityUpdating.ll
+++ /dev/null
@@ -1,54 +0,0 @@
-; RUN: llvm-as < %s | opt -gvnpre | llvm-dis | grep tmp114115.gvnpre
-
- %struct.AV = type { %struct.XPVAV*, i32, i32 }
- %struct.CLONE_PARAMS = type { %struct.AV*, i32, %struct.PerlInterpreter* }
- %struct.HE = type { %struct.HE*, %struct.HEK*, %struct.SV* }
- %struct.HEK = type { i32, i32, [1 x i8] }
- %struct.HV = type { %struct.XPVHV*, i32, i32 }
- %struct.MAGIC = type { %struct.MAGIC*, %struct.MGVTBL*, i16, i8, i8, %struct.SV*, i8*, i32 }
- %struct.MGVTBL = type { i32 (%struct.SV*, %struct.MAGIC*)*, i32 (%struct.SV*, %struct.MAGIC*)*, i32 (%struct.SV*, %struct.MAGIC*)*, i32 (%struct.SV*, %struct.MAGIC*)*, i32 (%struct.SV*, %struct.MAGIC*)*, i32 (%struct.SV*, %struct.MAGIC*, %struct.SV*, i8*, i32)*, i32 (%struct.MAGIC*, %struct.CLONE_PARAMS*)* }
- %struct.OP = type { %struct.OP*, %struct.OP*, %struct.OP* ()*, i32, i16, i16, i8, i8 }
- %struct.PMOP = type { %struct.OP*, %struct.OP*, %struct.OP* ()*, i32, i16, i16, i8, i8, %struct.OP*, %struct.OP*, %struct.OP*, %struct.OP*, %struct.PMOP*, %struct.REGEXP*, i32, i32, i8, %struct.HV* }
- %struct.PerlInterpreter = type { i8 }
- %struct.REGEXP = type { i32*, i32*, %struct.regnode*, %struct.reg_substr_data*, i8*, %struct.reg_data*, i8*, i32*, i32, i32, i32, i32, i32, i32, i32, i32, [1 x %struct.regnode] }
- %struct.SV = type { i8*, i32, i32 }
- %struct.XPVAV = type { i8*, i32, i32, i32, double, %struct.MAGIC*, %struct.HV*, %struct.SV**, %struct.SV*, i8 }
- %struct.XPVHV = type { i8*, i32, i32, i32, double, %struct.MAGIC*, %struct.HV*, i32, %struct.HE*, %struct.PMOP*, i8* }
- %struct.reg_data = type { i32, i8*, [1 x i8*] }
- %struct.reg_substr_data = type { [3 x %struct.reg_substr_datum] }
- %struct.reg_substr_datum = type { i32, i32, %struct.SV*, %struct.SV* }
- %struct.regnode = type { i8, i8, i16 }
-
-define void @Perl_op_clear(%struct.OP* %o) {
-entry:
- switch i32 0, label %bb106 [
- i32 13, label %bb106
- i32 31, label %clear_pmop
- i32 32, label %clear_pmop
- i32 33, label %bb101
- ]
-
-bb101: ; preds = %entry
- %tmp102103 = bitcast %struct.OP* %o to %struct.PMOP* ; <%struct.PMOP*> [#uses=1]
- %tmp104 = getelementptr %struct.PMOP* %tmp102103, i32 0, i32 10 ; <%struct.OP**> [#uses=0]
- br i1 false, label %cond_next174, label %cond_true122
-
-bb106: ; preds = %entry, %entry
- %tmp107108 = bitcast %struct.OP* %o to %struct.PMOP* ; <%struct.PMOP*> [#uses=0]
- br label %clear_pmop
-
-clear_pmop: ; preds = %bb106, %entry, %entry
- %tmp114115 = bitcast %struct.OP* %o to %struct.PMOP* ; <%struct.PMOP*> [#uses=0]
- br label %cond_true122
-
-cond_true122: ; preds = %clear_pmop, %bb101
- br i1 false, label %cond_next174, label %cond_true129
-
-cond_true129: ; preds = %cond_true122
- ret void
-
-cond_next174: ; preds = %cond_true122, %bb101
- %tmp175176 = bitcast %struct.OP* %o to %struct.PMOP* ; <%struct.PMOP*> [#uses=1]
- %tmp177 = getelementptr %struct.PMOP* %tmp175176, i32 0, i32 10 ; <%struct.OP**> [#uses=0]
- ret void
-}
diff --git a/release_23/test/Transforms/GVNPRE/2007-07-07-AnticOutUnique.ll b/release_23/test/Transforms/GVNPRE/2007-07-07-AnticOutUnique.ll
deleted file mode 100644
index 2a7e49c6cd9e..000000000000
--- a/release_23/test/Transforms/GVNPRE/2007-07-07-AnticOutUnique.ll
+++ /dev/null
@@ -1,14 +0,0 @@
-; RUN: llvm-as < %s | opt -gvnpre | llvm-dis
- %"struct.ObjectArena<char>" = type { i32, i32, %"struct.ResizeArray<char*>", i8*, i8* }
- %"struct.ResizeArray<char*>" = type { i32 (...)**, %"struct.ResizeArrayRaw<char*>"* }
- %"struct.ResizeArrayRaw<char*>" = type { i8**, i8*, i32, i32, i32, float, i32 }
-
-define void @_ZN11ObjectArenaIcED1Ev(%"struct.ObjectArena<char>"* %this) {
-entry:
- br label %cond_true21
-
-cond_true21: ; preds = %cond_true21, %entry
- %tmp215.0 = phi %"struct.ResizeArray<char*>"* [ null, %entry ], [ null, %cond_true21 ] ; <%"struct.ResizeArray<char*>"*> [#uses=1]
- %tmp2.i2 = getelementptr %"struct.ResizeArray<char*>"* %tmp215.0, i32 0, i32 1 ; <%"struct.ResizeArrayRaw<char*>"**> [#uses=0]
- br label %cond_true21
-}
diff --git a/release_23/test/Transforms/GVNPRE/basic.ll b/release_23/test/Transforms/GVNPRE/basic.ll
deleted file mode 100644
index b74687394ac7..000000000000
--- a/release_23/test/Transforms/GVNPRE/basic.ll
+++ /dev/null
@@ -1,38 +0,0 @@
-; RUN: llvm-as < %s | opt -gvnpre | llvm-dis | not grep {%z3 =}
-; RUN: llvm-as < %s | opt -gvnpre | llvm-dis | not grep {%z9 =}
-
-define i32 @main() {
-block1:
- %z1 = bitcast i32 0 to i32 ; <i32> [#uses=5]
- br label %block2
-
-block2: ; preds = %block6, %block1
- %z2 = phi i32 [ %z1, %block1 ], [ %z3, %block6 ] ; <i32> [#uses=3]
- %z3 = add i32 %z2, 1 ; <i32> [#uses=5]
- br i1 false, label %block3, label %block7
-
-block3: ; preds = %block2
- br i1 true, label %block4, label %block5
-
-block4: ; preds = %block3
- %z4 = add i32 %z2, %z3 ; <i32> [#uses=1]
- %z5 = bitcast i32 %z4 to i32 ; <i32> [#uses=1]
- %z6 = add i32 %z1, %z5 ; <i32> [#uses=0]
- br label %block6
-
-block5: ; preds = %block3
- %z7 = add i32 %z3, 1 ; <i32> [#uses=1]
- br label %block6
-
-block6: ; preds = %block5, %block4
- %z8 = phi i32 [ %z1, %block4 ], [ %z7, %block5 ] ; <i32> [#uses=1]
- %z9 = add i32 %z2, %z3 ; <i32> [#uses=2]
- %z10 = add i32 %z9, %z8 ; <i32> [#uses=0]
- %z11 = bitcast i32 12 to i32 ; <i32> [#uses=1]
- %z12 = add i32 %z9, %z11 ; <i32> [#uses=1]
- %z13 = add i32 %z12, %z3 ; <i32> [#uses=0]
- br label %block2
-
-block7: ; preds = %block2
- ret i32 %z1
-}
diff --git a/release_23/test/Transforms/GVNPRE/cast.ll b/release_23/test/Transforms/GVNPRE/cast.ll
deleted file mode 100644
index 3536a14571fb..000000000000
--- a/release_23/test/Transforms/GVNPRE/cast.ll
+++ /dev/null
@@ -1,17 +0,0 @@
-; RUN: llvm-as < %s | opt -gvnpre | llvm-dis | grep b.gvnpre
-
-define i32 @extract() {
-entry: ; preds = %cond_false, %entry
- br i1 true, label %cond_true, label %cond_false
-
-cond_true:
- br label %end
-
-cond_false:
- %a = sext i16 0 to i32
- br label %end
-
-end:
- %b = sext i16 0 to i32
- ret i32 %b
-}
diff --git a/release_23/test/Transforms/GVNPRE/dg.exp b/release_23/test/Transforms/GVNPRE/dg.exp
deleted file mode 100644
index 879685ca879d..000000000000
--- a/release_23/test/Transforms/GVNPRE/dg.exp
+++ /dev/null
@@ -1,3 +0,0 @@
-load_lib llvm.exp
-
-RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
diff --git a/release_23/test/Transforms/GVNPRE/extractelement.ll b/release_23/test/Transforms/GVNPRE/extractelement.ll
deleted file mode 100644
index 7d05c8f1d6f3..000000000000
--- a/release_23/test/Transforms/GVNPRE/extractelement.ll
+++ /dev/null
@@ -1,18 +0,0 @@
-; RUN: llvm-as < %s | opt -gvnpre | llvm-dis | grep b.gvnpre
-
-define i32 @extract() {
-entry: ; preds = %cond_false, %entry
- %foo = add <2 x i32> < i32 1, i32 1 >, < i32 1, i32 1 >
- br i1 true, label %cond_true, label %cond_false
-
-cond_true:
- br label %end
-
-cond_false:
- %a = extractelement <2 x i32> %foo, i32 0
- br label %end
-
-end:
- %b = extractelement <2 x i32> %foo, i32 0
- ret i32 %b
-}
diff --git a/release_23/test/Transforms/GVNPRE/gep.ll b/release_23/test/Transforms/GVNPRE/gep.ll
deleted file mode 100644
index 34bc4c79ab12..000000000000
--- a/release_23/test/Transforms/GVNPRE/gep.ll
+++ /dev/null
@@ -1,17 +0,0 @@
-; RUN: llvm-as < %s | opt -gvnpre | llvm-dis | grep b.gvnpre
-
-define i32 @extract({ i32 }* %P) {
-entry: ; preds = %cond_false, %entry
- br i1 true, label %cond_true, label %cond_false
-
-cond_true:
- br label %end
-
-cond_false:
- %a = getelementptr { i32 }* %P, i32 0, i32 0
- br label %end
-
-end:
- %b = getelementptr { i32 }* %P, i32 0, i32 0
- ret i32 0
-}
diff --git a/release_23/test/Transforms/GVNPRE/insertelement.ll b/release_23/test/Transforms/GVNPRE/insertelement.ll
deleted file mode 100644
index caf8474bba7d..000000000000
--- a/release_23/test/Transforms/GVNPRE/insertelement.ll
+++ /dev/null
@@ -1,18 +0,0 @@
-; RUN: llvm-as < %s | opt -gvnpre | llvm-dis | grep b.gvnpre
-
-define i32 @extract() {
-entry: ; preds = %cond_false, %entry
- %foo = add <2 x i32> < i32 1, i32 1 >, < i32 1, i32 1 >
- br i1 true, label %cond_true, label %cond_false
-
-cond_true:
- br label %end
-
-cond_false:
- %a = insertelement <2 x i32> %foo, i32 0, i32 3
- br label %end
-
-end:
- %b = insertelement <2 x i32> %foo, i32 0, i32 3
- ret i32 0
-}
diff --git a/release_23/test/Transforms/GVNPRE/select.ll b/release_23/test/Transforms/GVNPRE/select.ll
deleted file mode 100644
index c73c8579db5d..000000000000
--- a/release_23/test/Transforms/GVNPRE/select.ll
+++ /dev/null
@@ -1,17 +0,0 @@
-; RUN: llvm-as < %s | opt -gvnpre | llvm-dis | grep b.gvnpre
-
-define i32 @extract() {
-entry: ; preds = %cond_false, %entry
- br i1 true, label %cond_true, label %cond_false
-
-cond_true:
- br label %end
-
-cond_false:
- %a = select i1 true, i32 0, i32 1
- br label %end
-
-end:
- %b = select i1 true, i32 0, i32 1
- ret i32 %b
-}
diff --git a/release_23/test/Transforms/GVNPRE/shufflevector.ll b/release_23/test/Transforms/GVNPRE/shufflevector.ll
deleted file mode 100644
index 9fc35925322c..000000000000
--- a/release_23/test/Transforms/GVNPRE/shufflevector.ll
+++ /dev/null
@@ -1,18 +0,0 @@
-; RUN: llvm-as < %s | opt -gvnpre | llvm-dis | grep b.gvnpre
-
-define i32 @extract() {
-entry: ; preds = %cond_false, %entry
- %foo = add <2 x i32> < i32 1, i32 1 >, < i32 1, i32 1 >
- br i1 true, label %cond_true, label %cond_false
-
-cond_true:
- br label %end
-
-cond_false:
- %a = shufflevector <2 x i32> %foo, <2 x i32> undef, <2 x i32> < i32 0, i32 1 >
- br label %end
-
-end:
- %b = shufflevector <2 x i32> %foo, <2 x i32> undef, <2 x i32> < i32 0, i32 1 >
- ret i32 0
-}
diff --git a/release_23/test/Transforms/GlobalDCE/2002-07-17-CastRef.ll b/release_23/test/Transforms/GlobalDCE/2002-07-17-CastRef.ll
deleted file mode 100644
index a79f6738f190..000000000000
--- a/release_23/test/Transforms/GlobalDCE/2002-07-17-CastRef.ll
+++ /dev/null
@@ -1,11 +0,0 @@
-; RUN: llvm-as < %s | opt -globaldce
-;
-define internal void @func() {
- ret void
-}
-
-define void @main() {
- %X = bitcast void ()* @func to i32* ; <i32*> [#uses=0]
- ret void
-}
-
diff --git a/release_23/test/Transforms/GlobalDCE/2002-07-17-ConstantRef.ll b/release_23/test/Transforms/GlobalDCE/2002-07-17-ConstantRef.ll
deleted file mode 100644
index 2a398468beec..000000000000
--- a/release_23/test/Transforms/GlobalDCE/2002-07-17-ConstantRef.ll
+++ /dev/null
@@ -1,13 +0,0 @@
-; RUN: llvm-as < %s | opt -globaldce
-;
-
-@X = global void ()* @func ; <void ()**> [#uses=0]
-
-; Not dead, can be reachable via X
-define internal void @func() {
- ret void
-}
-
-define void @main() {
- ret void
-}
diff --git a/release_23/test/Transforms/GlobalDCE/2002-08-17-FunctionDGE.ll b/release_23/test/Transforms/GlobalDCE/2002-08-17-FunctionDGE.ll
deleted file mode 100644
index dac81a39990a..000000000000
--- a/release_23/test/Transforms/GlobalDCE/2002-08-17-FunctionDGE.ll
+++ /dev/null
@@ -1,17 +0,0 @@
-; Make sure that functions are removed successfully if they are referred to by
-; a global that is dead. Make sure any globals they refer to die as well.
-
-; RUN: llvm-as < %s | opt -globaldce | llvm-dis | not grep foo
-
-;; Unused, kills %foo
-@b = internal global i32 ()* @foo ; <i32 ()**> [#uses=0]
-
-;; Should die when function %foo is killed
-@foo.upgrd.1 = internal global i32 7 ; <i32*> [#uses=1]
-
- ;; dies when %b dies.
-define internal i32 @foo() {
- %ret = load i32* @foo.upgrd.1 ; <i32> [#uses=1]
- ret i32 %ret
-}
-
diff --git a/release_23/test/Transforms/GlobalDCE/2002-08-17-WorkListTest.ll b/release_23/test/Transforms/GlobalDCE/2002-08-17-WorkListTest.ll
deleted file mode 100644
index d07f0140c46c..000000000000
--- a/release_23/test/Transforms/GlobalDCE/2002-08-17-WorkListTest.ll
+++ /dev/null
@@ -1,12 +0,0 @@
-; This testcase tests that a worklist is being used, and that globals can be
-; removed if they are the subject of a constexpr and ConstantPointerRef
-
-; RUN: llvm-as < %s | opt -globaldce | llvm-dis | not grep global
-
-@t0 = internal global [4 x i8] c"foo\00" ; <[4 x i8]*> [#uses=1]
-@t1 = internal global [4 x i8] c"bar\00" ; <[4 x i8]*> [#uses=1]
-@s1 = internal global [1 x i8*] [ i8* getelementptr ([4 x i8]* @t0, i32 0, i32 0) ] ; <[1 x i8*]*> [#uses=0]
-@s2 = internal global [1 x i8*] [ i8* getelementptr ([4 x i8]* @t1, i64 0, i64 0) ] ; <[1 x i8*]*> [#uses=0]
-@b = internal global i32* @a ; <i32**> [#uses=0]
-@a = internal global i32 7 ; <i32*> [#uses=1]
-
diff --git a/release_23/test/Transforms/GlobalDCE/2002-09-12-Redeletion.ll b/release_23/test/Transforms/GlobalDCE/2002-09-12-Redeletion.ll
deleted file mode 100644
index b49bfcc49403..000000000000
--- a/release_23/test/Transforms/GlobalDCE/2002-09-12-Redeletion.ll
+++ /dev/null
@@ -1,11 +0,0 @@
-; RUN: llvm-as < %s | opt -globaldce
-
-;; Should die when function %foo is killed
-@foo.upgrd.1 = internal global i32 7 ; <i32*> [#uses=3]
-@bar = internal global [2 x { i32*, i32 }] [ { i32*, i32 } { i32* @foo.upgrd.1, i32 7 }, { i32*, i32 } { i32* @foo.upgrd.1, i32 1 } ] ; <[2 x { i32*, i32 }]*> [#uses=0]
-
-define internal i32 @foo() {
- %ret = load i32* @foo.upgrd.1 ; <i32> [#uses=1]
- ret i32 %ret
-}
-
diff --git a/release_23/test/Transforms/GlobalDCE/2003-07-01-SelfReference.ll b/release_23/test/Transforms/GlobalDCE/2003-07-01-SelfReference.ll
deleted file mode 100644
index c6c51df94cf3..000000000000
--- a/release_23/test/Transforms/GlobalDCE/2003-07-01-SelfReference.ll
+++ /dev/null
@@ -1,11 +0,0 @@
-; distilled from 255.vortex
-; RUN: llvm-as < %s | opt -globaldce | llvm-dis | not grep testfunc
-
-declare i1 ()* @getfunc()
-
-define internal i1 @testfunc() {
- %F = call i1 ()* ()* @getfunc( ) ; <i1 ()*> [#uses=1]
- %c = icmp eq i1 ()* %F, @testfunc ; <i1> [#uses=1]
- ret i1 %c
-}
-
diff --git a/release_23/test/Transforms/GlobalDCE/2003-10-09-PreserveWeakGlobals.ll b/release_23/test/Transforms/GlobalDCE/2003-10-09-PreserveWeakGlobals.ll
deleted file mode 100644
index 12d4736d2749..000000000000
--- a/release_23/test/Transforms/GlobalDCE/2003-10-09-PreserveWeakGlobals.ll
+++ /dev/null
@@ -1,6 +0,0 @@
-; Weak variables should be preserved by global DCE!
-
-; RUN: llvm-as < %s | opt -globaldce | llvm-dis | grep @A
-
-
-@A = weak global i32 54
diff --git a/release_23/test/Transforms/GlobalDCE/basicvariabletest.ll b/release_23/test/Transforms/GlobalDCE/basicvariabletest.ll
deleted file mode 100644
index c883e58b84ce..000000000000
--- a/release_23/test/Transforms/GlobalDCE/basicvariabletest.ll
+++ /dev/null
@@ -1,5 +0,0 @@
-; RUN: llvm-as < %s | opt -globaldce | llvm-dis | not grep global
-
-@X = external global i32
-@Y = internal global i32 7
-
diff --git a/release_23/test/Transforms/GlobalDCE/dg.exp b/release_23/test/Transforms/GlobalDCE/dg.exp
deleted file mode 100644
index 879685ca879d..000000000000
--- a/release_23/test/Transforms/GlobalDCE/dg.exp
+++ /dev/null
@@ -1,3 +0,0 @@
-load_lib llvm.exp
-
-RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
diff --git a/release_23/test/Transforms/GlobalOpt/2004-10-10-CastStoreOnce.ll b/release_23/test/Transforms/GlobalOpt/2004-10-10-CastStoreOnce.ll
deleted file mode 100644
index 5f784e065fb1..000000000000
--- a/release_23/test/Transforms/GlobalOpt/2004-10-10-CastStoreOnce.ll
+++ /dev/null
@@ -1,17 +0,0 @@
-; RUN: llvm-as < %s | opt -globalopt
-
-@V = global float 1.200000e+01 ; <float*> [#uses=1]
-@G = internal global i32* null ; <i32**> [#uses=2]
-
-define i32 @user() {
- %P = load i32** @G ; <i32*> [#uses=1]
- %Q = load i32* %P ; <i32> [#uses=1]
- ret i32 %Q
-}
-
-define void @setter() {
- %Vi = bitcast float* @V to i32* ; <i32*> [#uses=1]
- store i32* %Vi, i32** @G
- ret void
-}
-
diff --git a/release_23/test/Transforms/GlobalOpt/2005-06-15-LocalizeConstExprCrash.ll b/release_23/test/Transforms/GlobalOpt/2005-06-15-LocalizeConstExprCrash.ll
deleted file mode 100644
index 80f824392492..000000000000
--- a/release_23/test/Transforms/GlobalOpt/2005-06-15-LocalizeConstExprCrash.ll
+++ /dev/null
@@ -1,10 +0,0 @@
-; RUN: llvm-as < %s | opt -globalopt -disable-output
-; PR579
-
-@g_40507551 = internal global i16 31038 ; <i16*> [#uses=1]
-
-define void @main() {
- %tmp.4.i.1 = load i8* getelementptr (i8* bitcast (i16* @g_40507551 to i8*), i32 1) ; <i8> [#uses=0]
- ret void
-}
-
diff --git a/release_23/test/Transforms/GlobalOpt/2005-09-27-Crash.ll b/release_23/test/Transforms/GlobalOpt/2005-09-27-Crash.ll
deleted file mode 100644
index 5eac431d9c64..000000000000
--- a/release_23/test/Transforms/GlobalOpt/2005-09-27-Crash.ll
+++ /dev/null
@@ -1,27 +0,0 @@
-; RUN: llvm-as < %s | opt -globalopt -disable-output
- %RPyString = type { i32, %arraytype.Char }
- %arraytype.Char = type { i32, [0 x i8] }
- %arraytype.Signed = type { i32, [0 x i32] }
- %functiontype.1 = type %RPyString* (i32)
- %structtype.test = type { i32, %arraytype.Signed }
-@structinstance.test = internal global { i32, { i32, [2 x i32] } } { i32 41, { i32, [2 x i32] } { i32 2, [2 x i32] [ i32 100, i32 101 ] } } ; <{ i32, { i32, [2 x i32] } }*> [#uses=1]
-
-define fastcc void @pypy_array_constant() {
-block0:
- %tmp.9 = getelementptr %structtype.test* bitcast ({ i32, { i32, [2 x i32] } }* @structinstance.test to %structtype.test*), i32 0, i32 0 ; <i32*> [#uses=0]
- ret void
-}
-
-define fastcc void @new.varsizestruct.rpy_string() {
- unreachable
-}
-
-define void @__entrypoint__pypy_array_constant() {
- call fastcc void @pypy_array_constant( )
- ret void
-}
-
-define void @__entrypoint__raised_LLVMException() {
- ret void
-}
-
diff --git a/release_23/test/Transforms/GlobalOpt/2006-07-07-InlineAsmCrash.ll b/release_23/test/Transforms/GlobalOpt/2006-07-07-InlineAsmCrash.ll
deleted file mode 100644
index 5559ef18b5b8..000000000000
--- a/release_23/test/Transforms/GlobalOpt/2006-07-07-InlineAsmCrash.ll
+++ /dev/null
@@ -1,135 +0,0 @@
-; RUN: llvm-as < %s | opt -globalopt -disable-output
-; PR820
-target datalayout = "e-p:32:32"
-target triple = "i686-pc-linux-gnu"
- %struct..0FileDescriptor = type { i32 }
- %"struct.FlagDescription<int32>" = type { i8*, i32*, i1, i1, i32, i8* }
- %"struct.FlagRegisterer<bool>" = type { i8 }
- %struct.MutexLock = type { %struct..0FileDescriptor* }
- %"struct.std::DisabledRangeMap" = type { %"struct.std::_Rb_tree<const char*,std::pair<const char* const, FlagDescription<bool> >,std::_Select1st<std::pair<const char* const, FlagDescription<bool> > >,StringCmp,std::allocator<std::pair<const char* const, FlagDescription<bool> > > >" }
- %"struct.std::_Rb_tree<const char*,std::pair<const char* const, FlagDescription<bool> >,std::_Select1st<std::pair<const char* const, FlagDescription<bool> > >,StringCmp,std::allocator<std::pair<const char* const, FlagDescription<bool> > > >" = type { %"struct.std::_Rb_tree<const char*,std::pair<const char* const, FlagDescription<bool> >,std::_Select1st<std::pair<const char* const, FlagDescription<bool> > >,StringCmp,std::allocator<std::pair<const char* const, FlagDescription<bool> > > >::_Rb_tree_impl<StringCmp,false>" }
- %"struct.std::_Rb_tree<const char*,std::pair<const char* const, FlagDescription<bool> >,std::_Select1st<std::pair<const char* const, FlagDescription<bool> > >,StringCmp,std::allocator<std::pair<const char* const, FlagDescription<bool> > > >::_Rb_tree_impl<StringCmp,false>" = type { %"struct.FlagRegisterer<bool>", %"struct.std::_Rb_tree_node_base", i32 }
- %"struct.std::_Rb_tree_const_iterator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >" = type { %"struct.std::_Rb_tree_node_base"* }
- %"struct.std::_Rb_tree_node_base" = type { i32, %"struct.std::_Rb_tree_node_base"*, %"struct.std::_Rb_tree_node_base"*, %"struct.std::_Rb_tree_node_base"* }
- %"struct.std::_Vector_base<int,std::allocator<int> >" = type { %"struct.std::_Vector_base<int,std::allocator<int> >::_Vector_impl" }
- %"struct.std::_Vector_base<int,std::allocator<int> >::_Vector_impl" = type { i32*, i32*, i32* }
- %"struct.std::vector<int,std::allocator<int> >" = type { %"struct.std::_Vector_base<int,std::allocator<int> >" }
-@registry_lock = external global %struct..0FileDescriptor ; <%struct..0FileDescriptor*> [#uses=0]
-@_ZN61FLAG__foo_int32_44FLAGS_E = external global %"struct.FlagRegisterer<bool>" ; <%"struct.FlagRegisterer<bool>"*> [#uses=0]
-@llvm.global_ctors = appending global [20 x { i32, void ()* }] [ { i32, void ()* } { i32 65535, void ()* @_GLOBAL__I__ZN62FLAG__foo_string_10FLAGS_E }, { i32, void ()* } { i32 65535, void ()* @_GLOBAL__I__ZN60FLAG__foo_bool_19FLAGS_E }, { i32, void ()* } { i32 65535, void ()* @_GLOBAL__I__ZNK5Bzh4Enum13is_contiguousEv }, { i32, void ()* } { i32 65535, void ()* @_GLOBAL__I__ZN62FLAG__foo_string_17FLAGS_E }, { i32, void ()* } { i32 65535, void ()* @_GLOBAL__I__ZN61FLAG__foo_int32_21FLAGS_E }, { i32, void ()* } { i32 65535, void ()* @_GLOBAL__I__ZN7ScannerC2Ev }, { i32, void ()* } { i32 65535, void ()* @_GLOBAL__I__Z11StripStringPSsPKcc }, { i32, void ()* } { i32 65535, void ()* @_GLOBAL__I__ZNK9__gnu_cxx4hashI11StringPieceEclERKS1_ }, { i32, void ()* } { i32 65535, void ()* @_GLOBAL__I__ZN8Hasher325ResetEj }, { i32, void ()* } { i32 65535, void ()* @_GLOBAL__I__Z25ACLRv }, { i32, void ()* } { i32 65535, void ()* @_GLOBAL__I__ZN61FLAG__foo_int64_25FLAGS_E }, { i32, void ()* } { i32 65535, void ()* @_GLOBAL__I__ZN61FLAG__foo_int32_7FLAGS_E }, { i32, void ()* } { i32 65535, void ()* @_GLOBAL__I__ZN62FLAG__foo_string_18FLAGS_E }, { i32, void ()* } { i32 65535, void ()* @_GLOBAL__I__ZN62FLAG__foo_string_17FLAGS_E }, { i32, void ()* } { i32 65535, void ()* @_GLOBAL__I__ZN61FLAG__foo_int32_25FLAGS_E }, { i32, void ()* } { i32 65535, void ()* @_GLOBAL__I_eventbuf }, { i32, void ()* } { i32 65535, void ()* @_GLOBAL__I__ZN61FLAG__foo_int32_26FLAGS_E }, { i32, void ()* } { i32 65535, void ()* @_GLOBAL__I__ZN62FLAG__foo_string_16FLAGS_E }, { i32, void ()* } { i32 65535, void ()* @_GLOBAL__I__ZN17InitializerC2EPKcS1_PFvvE }, { i32, void ()* } { i32 65535, void ()* @_GLOBAL__I__checker_bcad_variable } ] ; <[20 x { i32, void ()* }]*> [#uses=0]
-
-declare void @_GLOBAL__I__ZN62FLAG__foo_string_10FLAGS_E()
-
-declare void @_GLOBAL__I__ZN60FLAG__foo_bool_19FLAGS_E()
-
-declare void @_GLOBAL__I__ZNK5Bzh4Enum13is_contiguousEv()
-
-declare void @_GLOBAL__I__ZN62FLAG__foo_string_17FLAGS_E()
-
-declare void @_GLOBAL__I__ZN61FLAG__foo_int32_21FLAGS_E()
-
-define void @_ZN14FlagRegistererIiEC1EPKcRK15FlagDescriptionIiE() {
-entry:
- call void @_Z12RegisterFlagIiEvPKcRK15FlagDescriptionIT_E( )
- ret void
-}
-
-define void @_Z12RegisterFlagIiEvPKcRK15FlagDescriptionIT_E() {
-entry:
- call void @_ZN9MutexLockC1EP5Mutex( )
- ret void
-}
-
-declare void @_GLOBAL__I__ZN7ScannerC2Ev()
-
-declare void @_GLOBAL__I__Z11StripStringPSsPKcc()
-
-define void @_ZNSt6vectorIiSaIiEEC1ERKS0_() {
-entry:
- unreachable
-}
-
-declare void @_GLOBAL__I__ZNK9__gnu_cxx4hashI11StringPieceEclERKS1_()
-
-declare void @_GLOBAL__I__ZN8Hasher325ResetEj()
-
-declare void @_GLOBAL__I__Z25ACLRv()
-
-define void @_ZN9MutexLockC1EP5Mutex() {
-entry:
- call void @_ZN5Mutex4LockEv( )
- ret void
-}
-
-define void @_ZN5Mutex4LockEv() {
-entry:
- call void @_Z22Acquire_CASPViii( )
- ret void
-}
-
-define void @_ZNSt3mapIPKc15FlagDescriptionIiE9StringCmpSaISt4pairIKS1_S3_EEE3endEv(%"struct.std::_Rb_tree_const_iterator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >"* sret %agg.result) {
-entry:
- unreachable
-}
-
-declare void @_GLOBAL__I__ZN61FLAG__foo_int64_25FLAGS_E()
-
-define void @_Z14CASPViii() {
-entry:
- %tmp3 = call i32 asm sideeffect "lock; cmpxchg $1,$2", "={ax},q,m,0,~{dirflag},~{fpsr},~{flags},~{memory}"( i32 0, i32* null, i32 0 ) ; <i32> [#uses=0]
- unreachable
-}
-
-declare void @_GLOBAL__I__ZN61FLAG__foo_int32_7FLAGS_E()
-
-declare void @_GLOBAL__I__ZN62FLAG__foo_string_18FLAGS_E()
-
-define void @_Z22Acquire_CASPViii() {
-entry:
- call void @_Z14CASPViii( )
- unreachable
-}
-
-declare void @_GLOBAL__I__ZN61FLAG__foo_int32_25FLAGS_E()
-
-declare void @_GLOBAL__I_eventbuf()
-
-define void @_GLOBAL__I__ZN61FLAG__foo_int32_26FLAGS_E() {
-entry:
- call void @_Z41__static_initialization_and_destruction_0ii1662( i32 1, i32 65535 )
- ret void
-}
-
-define void @_Z41__static_initialization_and_destruction_0ii1662(i32 %__initialize_p, i32 %__priority) {
-entry:
- %__initialize_p_addr = alloca i32 ; <i32*> [#uses=2]
- %__priority_addr = alloca i32 ; <i32*> [#uses=2]
- store i32 %__initialize_p, i32* %__initialize_p_addr
- store i32 %__priority, i32* %__priority_addr
- %tmp = load i32* %__priority_addr ; <i32> [#uses=1]
- %tmp.upgrd.1 = icmp eq i32 %tmp, 65535 ; <i1> [#uses=1]
- br i1 %tmp.upgrd.1, label %cond_true, label %cond_next14
-
-cond_true: ; preds = %entry
- %tmp8 = load i32* %__initialize_p_addr ; <i32> [#uses=1]
- %tmp9 = icmp eq i32 %tmp8, 1 ; <i1> [#uses=1]
- br i1 %tmp9, label %cond_true10, label %cond_next14
-
-cond_true10: ; preds = %cond_true
- call void @_ZN14FlagRegistererIiEC1EPKcRK15FlagDescriptionIiE( )
- ret void
-
-cond_next14: ; preds = %cond_true, %entry
- ret void
-}
-
-declare void @_GLOBAL__I__ZN62FLAG__foo_string_16FLAGS_E()
-
-define void @_ZN9__gnu_cxx13new_allocatorIPNS_15_Hashtable_nodeIjEEEC2Ev() {
-entry:
- unreachable
-}
-
-declare void @_GLOBAL__I__ZN17InitializerC2EPKcS1_PFvvE()
-
-declare void @_GLOBAL__I__checker_bcad_variable()
diff --git a/release_23/test/Transforms/GlobalOpt/2006-11-01-ShrinkGlobalPhiCrash.ll b/release_23/test/Transforms/GlobalOpt/2006-11-01-ShrinkGlobalPhiCrash.ll
deleted file mode 100644
index 39be6c40413b..000000000000
--- a/release_23/test/Transforms/GlobalOpt/2006-11-01-ShrinkGlobalPhiCrash.ll
+++ /dev/null
@@ -1,33 +0,0 @@
-; RUN: llvm-as < %s | opt -globalopt -disable-output
-
- %struct._list = type { i32*, %struct._list* }
- %struct._play = type { i32, i32*, %struct._list*, %struct._play* }
-@nrow = internal global i32 0 ; <i32*> [#uses=2]
-
-define void @make_play() {
-entry:
- br label %cond_true16.i
-
-cond_true16.i: ; preds = %cond_true16.i, %entry
- %low.0.in.i.0 = phi i32* [ @nrow, %entry ], [ null, %cond_true16.i ] ; <i32*> [#uses=1]
- %low.0.i = load i32* %low.0.in.i.0 ; <i32> [#uses=0]
- br label %cond_true16.i
-}
-
-define void @make_wanted() {
-entry:
- unreachable
-}
-
-define void @get_good_move() {
-entry:
- ret void
-}
-
-define void @main() {
-entry:
- store i32 8, i32* @nrow
- tail call void @make_play( )
- ret void
-}
-
diff --git a/release_23/test/Transforms/GlobalOpt/2007-04-05-Crash.ll b/release_23/test/Transforms/GlobalOpt/2007-04-05-Crash.ll
deleted file mode 100644
index 1991d90b8fa6..000000000000
--- a/release_23/test/Transforms/GlobalOpt/2007-04-05-Crash.ll
+++ /dev/null
@@ -1,34 +0,0 @@
-; RUN: llvm-as < %s | opt -globalopt -disable-output
-
-target datalayout = "e-p:32:32:32-i1:8:32-i8:8:32-i16:16:32-i32:32:32-i64:32:32-f32:32:32-f64:32:32-v64:64:64-v128:128:128-a0:0:32"
-target triple = "thumb-apple-darwin8"
-@replacementUnichar = internal global i16 -3 ; <i16*> [#uses=2]
-@"L_OBJC_IMAGE_INFO" = internal global [2 x i32] zeroinitializer ; <[2 x i32]*> [#uses=1]
-@llvm.used = appending global [1 x i8*] [ i8* bitcast ([2 x i32]* @"L_OBJC_IMAGE_INFO" to i8*) ] ; <[1 x i8*]*> [#uses=0]
-
-define i16 @__NSCharToUnicharCFWrapper(i8 zeroext %ch) zeroext {
-entry:
- %iftmp.0.0.in.in = select i1 false, i16* @replacementUnichar, i16* null ; <i16*> [#uses=1]
- %iftmp.0.0.in = load i16* %iftmp.0.0.in.in ; <i16> [#uses=1]
- ret i16 %iftmp.0.0.in
-}
-
-define void @__NSASCIICharToUnichar() {
-entry:
- ret void
-}
-
-define void @_NSDefaultCStringEncoding() {
-entry:
- call void @__NSSetCStringCharToUnichar( )
- br i1 false, label %cond_true6, label %cond_next8
-
-cond_true6: ; preds = %entry
- store i16 -2, i16* @replacementUnichar
- ret void
-
-cond_next8: ; preds = %entry
- ret void
-}
-
-declare void @__NSSetCStringCharToUnichar()
diff --git a/release_23/test/Transforms/GlobalOpt/2007-05-13-Crash.ll b/release_23/test/Transforms/GlobalOpt/2007-05-13-Crash.ll
deleted file mode 100644
index 22fee779338c..000000000000
--- a/release_23/test/Transforms/GlobalOpt/2007-05-13-Crash.ll
+++ /dev/null
@@ -1,74 +0,0 @@
-; RUN: llvm-as < %s | opt -globalopt -disable-output
-
-target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64"
-target triple = "i686-apple-darwin8"
- %struct.SFLMutableListItem = type { i16 }
- %struct.__CFDictionary = type opaque
- %struct.__CFString = type opaque
- %struct.__builtin_CFString = type { i32*, i32, i8*, i32 }
-@_ZZ19SFLGetVisibilityKeyvE19_kSFLLVisibilityKey = internal global %struct.__CFString* null ; <%struct.__CFString**> [#uses=2]
-@_ZZ22SFLGetAlwaysVisibleKeyvE22_kSFLLAlwaysVisibleKey = internal global %struct.__CFString* null ; <%struct.__CFString**> [#uses=7]
-internal constant %struct.__builtin_CFString {
- i32* getelementptr ([0 x i32]* @__CFConstantStringClassReference, i32 0, i32 0),
- i32 1992,
- i8* getelementptr ([14 x i8]* @.str, i32 0, i32 0),
- i32 13 }, section "__DATA,__cfstring" ; <%struct.__builtin_CFString*>:0 [#uses=1]
-@__CFConstantStringClassReference = external global [0 x i32] ; <[0 x i32]*> [#uses=1]
-@.str = internal constant [14 x i8] c"AlwaysVisible\00" ; <[14 x i8]*> [#uses=1]
-@_ZZ21SFLGetNeverVisibleKeyvE21_kSFLLNeverVisibleKey = internal global %struct.__CFString* null ; <%struct.__CFString**> [#uses=2]
-
-define %struct.__CFString* @_Z19SFLGetVisibilityKeyv() {
-entry:
- %tmp1 = load %struct.__CFString** @_ZZ19SFLGetVisibilityKeyvE19_kSFLLVisibilityKey ; <%struct.__CFString*> [#uses=1]
- ret %struct.__CFString* %tmp1
-}
-
-define %struct.__CFString* @_Z22SFLGetAlwaysVisibleKeyv() {
-entry:
- %tmp1 = load %struct.__CFString** @_ZZ22SFLGetAlwaysVisibleKeyvE22_kSFLLAlwaysVisibleKey ; <%struct.__CFString*> [#uses=1]
- %tmp2 = icmp eq %struct.__CFString* %tmp1, null ; <i1> [#uses=1]
- br i1 %tmp2, label %cond_true, label %cond_next
-
-cond_true: ; preds = %entry
- store %struct.__CFString* bitcast (%struct.__builtin_CFString* @0 to %struct.__CFString*), %struct.__CFString** @_ZZ22SFLGetAlwaysVisibleKeyvE22_kSFLLAlwaysVisibleKey
- br label %cond_next
-
-cond_next: ; preds = %entry, %cond_true
- %tmp4 = load %struct.__CFString** @_ZZ22SFLGetAlwaysVisibleKeyvE22_kSFLLAlwaysVisibleKey ; <%struct.__CFString*> [#uses=1]
- ret %struct.__CFString* %tmp4
-}
-
-define %struct.__CFString* @_Z21SFLGetNeverVisibleKeyv() {
-entry:
- %tmp1 = load %struct.__CFString** @_ZZ21SFLGetNeverVisibleKeyvE21_kSFLLNeverVisibleKey ; <%struct.__CFString*> [#uses=1]
- ret %struct.__CFString* %tmp1
-}
-
-define %struct.__CFDictionary* @_ZN18SFLMutableListItem18GetPrefsDictionaryEv(%struct.SFLMutableListItem* %this) {
-entry:
- %tmp4 = getelementptr %struct.SFLMutableListItem* %this, i32 0, i32 0 ; <i16*> [#uses=1]
- %tmp5 = load i16* %tmp4 ; <i16> [#uses=1]
- %tmp6 = icmp eq i16 %tmp5, 0 ; <i1> [#uses=1]
- br i1 %tmp6, label %cond_next22, label %cond_true
-
-cond_true: ; preds = %entry
- %tmp9 = load %struct.__CFString** @_ZZ22SFLGetAlwaysVisibleKeyvE22_kSFLLAlwaysVisibleKey ; <%struct.__CFString*> [#uses=1]
- %tmp10 = icmp eq %struct.__CFString* %tmp9, null ; <i1> [#uses=1]
- br i1 %tmp10, label %cond_true13, label %cond_next22
-
-cond_true13: ; preds = %cond_true
- store %struct.__CFString* bitcast (%struct.__builtin_CFString* @0 to %struct.__CFString*), %struct.__CFString** @_ZZ22SFLGetAlwaysVisibleKeyvE22_kSFLLAlwaysVisibleKey
- br label %cond_next22
-
-cond_next22: ; preds = %entry, %cond_true13, %cond_true
- %iftmp.1.0.in = phi %struct.__CFString** [ @_ZZ22SFLGetAlwaysVisibleKeyvE22_kSFLLAlwaysVisibleKey, %cond_true ], [ @_ZZ22SFLGetAlwaysVisibleKeyvE22_kSFLLAlwaysVisibleKey, %cond_true13 ], [ @_ZZ21SFLGetNeverVisibleKeyvE21_kSFLLNeverVisibleKey, %entry ] ; <%struct.__CFString**> [#uses=1]
- %iftmp.1.0 = load %struct.__CFString** %iftmp.1.0.in ; <%struct.__CFString*> [#uses=1]
- %tmp24 = load %struct.__CFString** @_ZZ19SFLGetVisibilityKeyvE19_kSFLLVisibilityKey ; <%struct.__CFString*> [#uses=1]
- %tmp2728 = bitcast %struct.__CFString* %tmp24 to i8* ; <i8*> [#uses=1]
- %tmp2930 = bitcast %struct.__CFString* %iftmp.1.0 to i8* ; <i8*> [#uses=1]
- call void @_Z20CFDictionaryAddValuePKvS0_( i8* %tmp2728, i8* %tmp2930 )
- ret %struct.__CFDictionary* undef
-}
-
-declare void @_Z20CFDictionaryAddValuePKvS0_(i8*, i8*)
-
diff --git a/release_23/test/Transforms/GlobalOpt/2007-06-04-PackedStruct.ll b/release_23/test/Transforms/GlobalOpt/2007-06-04-PackedStruct.ll
deleted file mode 100644
index 7394f047f4fe..000000000000
--- a/release_23/test/Transforms/GlobalOpt/2007-06-04-PackedStruct.ll
+++ /dev/null
@@ -1,36 +0,0 @@
-; RUN: llvm-as < %s | opt -globalopt -disable-output
-; PR1491
-
-target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64"
-target triple = "i686-pc-linux-gnu"
- %"struct.__gnu_cxx::new_allocator<std::_Rb_tree_node<std::pair<const int, int> > >" = type <{ i8 }>
- %"struct.std::_Rb_tree<int,std::pair<const int, int>,std::_Select1st<std::pair<const int, int> >,std::less<int>,std::allocator<std::pair<const int, int> > >" = type { %"struct.std::_Rb_tree<int,std::pair<const int, int>,std::_Select1st<std::pair<const int, int> >,std::less<int>,std::allocator<std::pair<const int, int> > >::_Rb_tree_impl<std::less<int>,false>" }
- %"struct.std::_Rb_tree<int,std::pair<const int, int>,std::_Select1st<std::pair<const int, int> >,std::less<int>,std::allocator<std::pair<const int, int> > >::_Rb_tree_impl<std::less<int>,false>" = type { %"struct.__gnu_cxx::new_allocator<std::_Rb_tree_node<std::pair<const int, int> > >", %"struct.std::_Rb_tree_node_base", i32 }
- %"struct.std::_Rb_tree_node_base" = type { i32, %"struct.std::_Rb_tree_node_base"*, %"struct.std::_Rb_tree_node_base"*, %"struct.std::_Rb_tree_node_base"* }
- %"struct.std::map<int,int,std::less<int>,std::allocator<std::pair<const int, int> > >" = type { %"struct.std::_Rb_tree<int,std::pair<const int, int>,std::_Select1st<std::pair<const int, int> >,std::less<int>,std::allocator<std::pair<const int, int> > >" }
-@someMap = global %"struct.std::map<int,int,std::less<int>,std::allocator<std::pair<const int, int> > >" zeroinitializer ; <%"struct.std::map<int,int,std::less<int>,std::allocator<std::pair<const int, int> > >"*> [#uses=1]
-@llvm.global_ctors = appending global [1 x { i32, void ()* }] [ { i32, void ()* } { i32 65535, void ()* @_GLOBAL__I_someMap } ] ; <[1 x { i32, void ()* }]*> [#uses=0]
-@llvm.global_dtors = appending global [1 x { i32, void ()* }] [ { i32, void ()* } { i32 65535, void ()* @_GLOBAL__D_someMap } ] ; <[1 x { i32, void ()* }]*> [#uses=0]
-
-define void @_GLOBAL__I_someMap() {
-entry:
- call void @_Z41__static_initialization_and_destruction_0ii( i32 1, i32 65535 )
- ret void
-}
-
-declare void @_GLOBAL__D_someMap()
-
-define void @_Z41__static_initialization_and_destruction_0ii(i32 %__initialize_p, i32 %__priority) {
-entry:
- %tmp1 = icmp eq i32 %__priority, 65535 ; <i1> [#uses=1]
- %tmp4 = icmp eq i32 %__initialize_p, 1 ; <i1> [#uses=1]
- %tmp7 = and i1 %tmp1, %tmp4 ; <i1> [#uses=1]
- br i1 %tmp7, label %cond_true, label %cond_next
-
-cond_true: ; preds = %entry
- store i8 0, i8* getelementptr (%"struct.std::map<int,int,std::less<int>,std::allocator<std::pair<const int, int> > >"* @someMap, i32 0, i32 0, i32 0, i32 0, i32 0)
- ret void
-
-cond_next: ; preds = %entry
- ret void
-}
diff --git a/release_23/test/Transforms/GlobalOpt/2007-11-09-GEP-GEP-Crash.ll b/release_23/test/Transforms/GlobalOpt/2007-11-09-GEP-GEP-Crash.ll
deleted file mode 100644
index 0d7d0364029d..000000000000
--- a/release_23/test/Transforms/GlobalOpt/2007-11-09-GEP-GEP-Crash.ll
+++ /dev/null
@@ -1,19 +0,0 @@
-; RUN: llvm-as < %s | opt -globalopt -disable-output
-target datalayout = "E-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f128:64:128"
-target triple = "powerpc-apple-darwin8"
- %struct.empty0 = type { }
- %struct.es = type { %struct.empty0 }
- %struct.es1 = type { %struct.empty0 }
-@aaui1 = internal global [6 x [2 x i32]] [ [2 x i32] [ i32 1, i32 1 ], [2 x i32] [ i32 1, i32 1 ], [2 x i32] [ i32 1, i32 1 ], [2 x i32] [ i32 1, i32 1 ], [2 x i32] [ i32 1, i32 1 ], [2 x i32] [ i32 1, i32 1 ] ] ; <[6 x [2 x i32]]*> [#uses=1]
-@aaui0 = internal global [0 x [2 x i32]] zeroinitializer ; <[0 x [2 x i32]]*> [#uses=1]
-
-define i8 @func() {
-entry:
- %tmp10 = getelementptr [2 x i32]* getelementptr ([6 x [2 x i32]]* @aaui1, i32 0, i32 0), i32 5, i32 1 ; <i32*> [#uses=1]
- %tmp11 = load i32* %tmp10, align 4 ; <i32> [#uses=1]
- %tmp12 = call i32 (...)* @func3( i32* null, i32 0, i32 %tmp11 ) ; <i32> [#uses=0]
- ret i8 undef
-}
-
-declare i32 @func3(...)
-
diff --git a/release_23/test/Transforms/GlobalOpt/2008-01-03-Crash.ll b/release_23/test/Transforms/GlobalOpt/2008-01-03-Crash.ll
deleted file mode 100644
index 3d8c77db4f36..000000000000
--- a/release_23/test/Transforms/GlobalOpt/2008-01-03-Crash.ll
+++ /dev/null
@@ -1,26 +0,0 @@
-; RUN: llvm-as < %s | opt -globalopt | llvm-dis
-; PR1896
-
-@indirect1 = internal global void (i32)* null ; <void (i32)**> [#uses=2]
-
-declare void @indirectmarked(i32)
-
-define i32 @main() {
-entry:
- br i1 false, label %cond_next20.i, label %cond_true.i9
-
-cond_true.i9: ; preds = %entry
- ret i32 0
-
-cond_next20.i: ; preds = %entry
- store void (i32)* @indirectmarked, void (i32)** @indirect1, align 4
- br i1 false, label %cond_next21.i.i23.i, label %stack_restore
-
-stack_restore: ; preds = %cond_next20.i
- ret i32 0
-
-cond_next21.i.i23.i: ; preds = %cond_next20.i
- %tmp6.i4.i = load i32* bitcast (void (i32)** @indirect1 to i32*), align 4 ; <i32> [#uses=0]
- ret i32 0
-}
-
diff --git a/release_23/test/Transforms/GlobalOpt/2008-01-13-OutOfRangeSROA.ll b/release_23/test/Transforms/GlobalOpt/2008-01-13-OutOfRangeSROA.ll
deleted file mode 100644
index aace34654976..000000000000
--- a/release_23/test/Transforms/GlobalOpt/2008-01-13-OutOfRangeSROA.ll
+++ /dev/null
@@ -1,16 +0,0 @@
-; RUN: llvm-as < %s | opt -globalopt | llvm-dis | grep {16 x .31 x double.. zeroinitializer}
-
-; The 'X' indices could be larger than 31. Do not SROA the outer indices of this array.
-@mm = internal global [16 x [31 x double]] zeroinitializer, align 32
-
-define void @test(i32 %X) {
- %P = getelementptr [16 x [31 x double]]* @mm, i32 0, i32 0, i32 %X
- store double 1.0, double* %P
- ret void
-}
-
-define double @get(i32 %X) {
- %P = getelementptr [16 x [31 x double]]* @mm, i32 0, i32 0, i32 %X
- %V = load double* %P
- ret double %V
-}
diff --git a/release_23/test/Transforms/GlobalOpt/2008-01-29-VolatileGlobal.ll b/release_23/test/Transforms/GlobalOpt/2008-01-29-VolatileGlobal.ll
deleted file mode 100644
index 0a8dd499c656..000000000000
--- a/release_23/test/Transforms/GlobalOpt/2008-01-29-VolatileGlobal.ll
+++ /dev/null
@@ -1,9 +0,0 @@
-; RUN: llvm-as < %s | opt -globalopt | llvm-dis | grep {volatile load}
-@t0.1441 = internal global double 0x3FD5555555555555, align 8 ; <double*> [#uses=1]
-
-define double @foo() nounwind {
-entry:
- %tmp1 = volatile load double* @t0.1441, align 8 ; <double> [#uses=2]
- %tmp4 = mul double %tmp1, %tmp1 ; <double> [#uses=1]
- ret double %tmp4
-}
diff --git a/release_23/test/Transforms/GlobalOpt/2008-02-16-NestAttr.ll b/release_23/test/Transforms/GlobalOpt/2008-02-16-NestAttr.ll
deleted file mode 100644
index 59996c5a98bc..000000000000
--- a/release_23/test/Transforms/GlobalOpt/2008-02-16-NestAttr.ll
+++ /dev/null
@@ -1,57 +0,0 @@
-; RUN: llvm-as < %s | opt -globalopt | llvm-dis | grep { nest } | count 1
- %struct.FRAME.nest = type { i32, i32 (i32)* }
- %struct.__builtin_trampoline = type { [10 x i8] }
-@.str = internal constant [7 x i8] c"%d %d\0A\00" ; <[7 x i8]*> [#uses=1]
-
-define i32 @process(i32 (i32)* %func) nounwind {
-entry:
- %tmp2 = tail call i32 %func( i32 1 ) nounwind ; <i32> [#uses=1]
- ret i32 %tmp2
-}
-
-define internal fastcc i32 @g.1478(%struct.FRAME.nest* nest %CHAIN.1, i32 %m) nounwind {
-entry:
- %tmp3 = getelementptr %struct.FRAME.nest* %CHAIN.1, i32 0, i32 0 ; <i32*> [#uses=1]
- %tmp4 = load i32* %tmp3, align 4 ; <i32> [#uses=1]
- %tmp7 = icmp eq i32 %tmp4, %m ; <i1> [#uses=1]
- %tmp78 = zext i1 %tmp7 to i32 ; <i32> [#uses=1]
- ret i32 %tmp78
-}
-
-define internal i32 @f.1481(%struct.FRAME.nest* nest %CHAIN.2, i32 %m) nounwind {
-entry:
- %tmp4 = tail call fastcc i32 @g.1478( %struct.FRAME.nest* nest %CHAIN.2, i32 %m ) nounwind ; <i32> [#uses=1]
- %tmp6 = getelementptr %struct.FRAME.nest* %CHAIN.2, i32 0, i32 0 ; <i32*> [#uses=1]
- %tmp7 = load i32* %tmp6, align 4 ; <i32> [#uses=1]
- %tmp9 = icmp eq i32 %tmp4, %tmp7 ; <i1> [#uses=1]
- %tmp910 = zext i1 %tmp9 to i32 ; <i32> [#uses=1]
- ret i32 %tmp910
-}
-
-define i32 @nest(i32 %n) nounwind {
-entry:
- %TRAMP.316 = alloca [10 x i8] ; <[10 x i8]*> [#uses=1]
- %FRAME.0 = alloca %struct.FRAME.nest ; <%struct.FRAME.nest*> [#uses=3]
- %TRAMP.316.sub = getelementptr [10 x i8]* %TRAMP.316, i32 0, i32 0 ; <i8*> [#uses=1]
- %tmp3 = getelementptr %struct.FRAME.nest* %FRAME.0, i32 0, i32 0 ; <i32*> [#uses=1]
- store i32 %n, i32* %tmp3, align 8
- %FRAME.06 = bitcast %struct.FRAME.nest* %FRAME.0 to i8* ; <i8*> [#uses=1]
- %tramp = call i8* @llvm.init.trampoline( i8* %TRAMP.316.sub, i8* bitcast (i32 (%struct.FRAME.nest*, i32)* @f.1481 to i8*), i8* %FRAME.06 ) ; <i8*> [#uses=1]
- %tmp7 = getelementptr %struct.FRAME.nest* %FRAME.0, i32 0, i32 1 ; <i32 (i32)**> [#uses=1]
- %tmp89 = bitcast i8* %tramp to i32 (i32)* ; <i32 (i32)*> [#uses=2]
- store i32 (i32)* %tmp89, i32 (i32)** %tmp7, align 4
- %tmp13 = call i32 @process( i32 (i32)* %tmp89 ) nounwind ; <i32> [#uses=1]
- ret i32 %tmp13
-}
-
-declare i8* @llvm.init.trampoline(i8*, i8*, i8*) nounwind
-
-define i32 @main() nounwind {
-entry:
- %tmp = tail call i32 @nest( i32 2 ) nounwind ; <i32> [#uses=1]
- %tmp1 = tail call i32 @nest( i32 1 ) nounwind ; <i32> [#uses=1]
- %tmp3 = tail call i32 (i8*, ...)* @printf( i8* noalias getelementptr ([7 x i8]* @.str, i32 0, i32 0), i32 %tmp1, i32 %tmp ) nounwind ; <i32> [#uses=0]
- ret i32 undef
-}
-
-declare i32 @printf(i8*, ...) nounwind
diff --git a/release_23/test/Transforms/GlobalOpt/2008-04-26-SROA-Global-Align.ll b/release_23/test/Transforms/GlobalOpt/2008-04-26-SROA-Global-Align.ll
deleted file mode 100644
index 3464be901844..000000000000
--- a/release_23/test/Transforms/GlobalOpt/2008-04-26-SROA-Global-Align.ll
+++ /dev/null
@@ -1,32 +0,0 @@
-; Verify that when @G is SROA'd that the new globals have correct
-; alignments. Elements 0 and 2 must be 16-byte aligned, and element
-; 1 must be at least 8 byte aligned (but could be more).
-
-; RUN: llvm-as < %s | opt -globalopt | llvm-dis | grep {@G.0 = internal global .*align 16}
-; RUN: llvm-as < %s | opt -globalopt | llvm-dis | grep {@G.1 = internal global .*align 8}
-; RUN: llvm-as < %s | opt -globalopt | llvm-dis | grep {@G.2 = internal global .*align 16}
-; rdar://5891920
-
-target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:32:32-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128"
-target triple = "x86_64-apple-darwin8"
-
-%T = type { double, double, double }
-
-@G = internal global %T zeroinitializer, align 16
-
-
-define void @test() {
- store double 1.0, double* getelementptr (%T* @G, i32 0, i32 0), align 16
- store double 2.0, double* getelementptr (%T* @G, i32 0, i32 1), align 8
- store double 3.0, double* getelementptr (%T* @G, i32 0, i32 2), align 16
- ret void
-}
-
-define double @test2() {
- %V1 = load double* getelementptr (%T* @G, i32 0, i32 0), align 16
- %V2 = load double* getelementptr (%T* @G, i32 0, i32 1), align 8
- %V3 = load double* getelementptr (%T* @G, i32 0, i32 2), align 16
- %R = add double %V1, %V2
- %R2 = add double %R, %V3
- ret double %R2
-}
diff --git a/release_23/test/Transforms/GlobalOpt/basictest.ll b/release_23/test/Transforms/GlobalOpt/basictest.ll
deleted file mode 100644
index 1c3bdbbc495c..000000000000
--- a/release_23/test/Transforms/GlobalOpt/basictest.ll
+++ /dev/null
@@ -1,9 +0,0 @@
-; RUN: llvm-as < %s | opt -globalopt | llvm-dis | not grep global
-
-@X = internal global i32 4 ; <i32*> [#uses=1]
-
-define i32 @foo() {
- %V = load i32* @X ; <i32> [#uses=1]
- ret i32 %V
-}
-
diff --git a/release_23/test/Transforms/GlobalOpt/constantexpr-dangle.ll b/release_23/test/Transforms/GlobalOpt/constantexpr-dangle.ll
deleted file mode 100644
index 6e33ae0653d7..000000000000
--- a/release_23/test/Transforms/GlobalOpt/constantexpr-dangle.ll
+++ /dev/null
@@ -1,13 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine -globalopt | llvm-dis | \
-; RUN: grep {internal fastcc float @foo}
-
-define internal float @foo() {
- ret float 0.000000e+00
-}
-
-define float @bar() {
- %tmp1 = call float (...)* bitcast (float ()* @foo to float (...)*)( )
- %tmp2 = mul float %tmp1, 1.000000e+01 ; <float> [#uses=1]
- ret float %tmp2
-}
-
diff --git a/release_23/test/Transforms/GlobalOpt/ctor-list-opt.ll b/release_23/test/Transforms/GlobalOpt/ctor-list-opt.ll
deleted file mode 100644
index 56aeadb38613..000000000000
--- a/release_23/test/Transforms/GlobalOpt/ctor-list-opt.ll
+++ /dev/null
@@ -1,85 +0,0 @@
-; RUN: llvm-as < %s | opt -globalopt | llvm-dis | not grep CTOR
-@llvm.global_ctors = appending global [10 x { i32, void ()* }] [ { i32, void ()* } { i32 65535, void ()* @CTOR1 }, { i32, void ()* } { i32 65535, void ()* @CTOR1 }, { i32, void ()* } { i32 65535, void ()* @CTOR2 }, { i32, void ()* } { i32 65535, void ()* @CTOR3 }, { i32, void ()* } { i32 65535, void ()* @CTOR4 }, { i32, void ()* } { i32 65535, void ()* @CTOR5 }, { i32, void ()* } { i32 65535, void ()* @CTOR6 }, { i32, void ()* } { i32 65535, void ()* @CTOR7 }, { i32, void ()* } { i32 65535, void ()* @CTOR8 }, { i32, void ()* } { i32 2147483647, void ()* null } ] ; <[10 x { i32, void ()* }]*> [#uses=0]
-@G = global i32 0 ; <i32*> [#uses=1]
-@G2 = global i32 0 ; <i32*> [#uses=1]
-@G3 = global i32 -123 ; <i32*> [#uses=2]
-@X = global { i32, [2 x i32] } { i32 0, [2 x i32] [ i32 17, i32 21 ] } ; <{ i32, [2 x i32] }*> [#uses=2]
-@Y = global i32 -1 ; <i32*> [#uses=2]
-@Z = global i32 123 ; <i32*> [#uses=1]
-@D = global double 0.000000e+00 ; <double*> [#uses=1]
-@CTORGV = internal global i1 false ; <i1*> [#uses=2]
-
-define internal void @CTOR1() {
- ret void
-}
-
-define internal void @CTOR2() {
- %A = add i32 1, 23 ; <i32> [#uses=1]
- store i32 %A, i32* @G
- store i1 true, i1* @CTORGV
- ret void
-}
-
-define internal void @CTOR3() {
- %X = or i1 true, false ; <i1> [#uses=1]
- br label %Cont
-
-Cont: ; preds = %0
- br i1 %X, label %S, label %T
-
-S: ; preds = %Cont
- store i32 24, i32* @G2
- ret void
-
-T: ; preds = %Cont
- ret void
-}
-
-define internal void @CTOR4() {
- %X = load i32* @G3 ; <i32> [#uses=1]
- %Y = add i32 %X, 123 ; <i32> [#uses=1]
- store i32 %Y, i32* @G3
- ret void
-}
-
-define internal void @CTOR5() {
- %X.2p = getelementptr { i32, [2 x i32] }* @X, i32 0, i32 1, i32 0 ; <i32*> [#uses=2]
- %X.2 = load i32* %X.2p ; <i32> [#uses=1]
- %X.1p = getelementptr { i32, [2 x i32] }* @X, i32 0, i32 0 ; <i32*> [#uses=1]
- store i32 %X.2, i32* %X.1p
- store i32 42, i32* %X.2p
- ret void
-}
-
-define internal void @CTOR6() {
- %A = alloca i32 ; <i32*> [#uses=2]
- %y = load i32* @Y ; <i32> [#uses=1]
- store i32 %y, i32* %A
- %Av = load i32* %A ; <i32> [#uses=1]
- %Av1 = add i32 %Av, 1 ; <i32> [#uses=1]
- store i32 %Av1, i32* @Y
- ret void
-}
-
-define internal void @CTOR7() {
- call void @setto( i32* @Z, i32 0 )
- ret void
-}
-
-define void @setto(i32* %P, i32 %V) {
- store i32 %V, i32* %P
- ret void
-}
-
-declare double @cos(double)
-
-define internal void @CTOR8() {
- %X = call double @cos( double 1.000000e+00 ) ; <double> [#uses=1]
- store double %X, double* @D
- ret void
-}
-
-define i1 @accessor() {
- %V = load i1* @CTORGV ; <i1> [#uses=1]
- ret i1 %V
-}
diff --git a/release_23/test/Transforms/GlobalOpt/deadglobal-2.ll b/release_23/test/Transforms/GlobalOpt/deadglobal-2.ll
deleted file mode 100644
index def6a09d2781..000000000000
--- a/release_23/test/Transforms/GlobalOpt/deadglobal-2.ll
+++ /dev/null
@@ -1,11 +0,0 @@
-; RUN: llvm-as < %s | opt -globalopt | llvm-dis | not grep internal
-
-; This is a harder case to delete as the GEP has a variable index.
-
-@G = internal global [4 x i32] zeroinitializer
-
-define void @foo(i32 %X) {
- %Ptr = getelementptr [4 x i32]* @G, i32 0, i32 %X
- store i32 1, i32* %Ptr
- ret void
-}
diff --git a/release_23/test/Transforms/GlobalOpt/deadglobal.ll b/release_23/test/Transforms/GlobalOpt/deadglobal.ll
deleted file mode 100644
index 7a47b8ea30bb..000000000000
--- a/release_23/test/Transforms/GlobalOpt/deadglobal.ll
+++ /dev/null
@@ -1,9 +0,0 @@
-; RUN: llvm-as < %s | opt -globalopt | llvm-dis | not grep internal
-
-@G = internal global i32 123 ; <i32*> [#uses=1]
-
-define void @foo() {
- store i32 1, i32* @G
- ret void
-}
-
diff --git a/release_23/test/Transforms/GlobalOpt/dg.exp b/release_23/test/Transforms/GlobalOpt/dg.exp
deleted file mode 100644
index 879685ca879d..000000000000
--- a/release_23/test/Transforms/GlobalOpt/dg.exp
+++ /dev/null
@@ -1,3 +0,0 @@
-load_lib llvm.exp
-
-RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
diff --git a/release_23/test/Transforms/GlobalOpt/globalsra-partial.ll b/release_23/test/Transforms/GlobalOpt/globalsra-partial.ll
deleted file mode 100644
index e52e7feab169..000000000000
--- a/release_23/test/Transforms/GlobalOpt/globalsra-partial.ll
+++ /dev/null
@@ -1,23 +0,0 @@
-; In this case, the global can only be broken up by one level.
-
-; RUN: llvm-as < %s | opt -globalopt | llvm-dis | not grep 12345
-
-@G = internal global { i32, [4 x float] } zeroinitializer ; <{ i32, [4 x float] }*> [#uses=3]
-
-define void @onlystore() {
- store i32 12345, i32* getelementptr ({ i32, [4 x float] }* @G, i32 0, i32 0)
- ret void
-}
-
-define void @storeinit(i32 %i) {
- %Ptr = getelementptr { i32, [4 x float] }* @G, i32 0, i32 1, i32 %i ; <float*> [#uses=1]
- store float 1.000000e+00, float* %Ptr
- ret void
-}
-
-define float @readval(i32 %i) {
- %Ptr = getelementptr { i32, [4 x float] }* @G, i32 0, i32 1, i32 %i ; <float*> [#uses=1]
- %V = load float* %Ptr ; <float> [#uses=1]
- ret float %V
-}
-
diff --git a/release_23/test/Transforms/GlobalOpt/globalsra.ll b/release_23/test/Transforms/GlobalOpt/globalsra.ll
deleted file mode 100644
index 36235552ae82..000000000000
--- a/release_23/test/Transforms/GlobalOpt/globalsra.ll
+++ /dev/null
@@ -1,23 +0,0 @@
-; RUN: llvm-as < %s | opt -globalopt | llvm-dis | not grep global
-
-@G = internal global { i32, float, { double } } {
- i32 1,
- float 1.000000e+00,
- { double } { double 1.727000e+01 } } ; <{ i32, float, { double } }*> [#uses=3]
-
-define void @onlystore() {
- store i32 123, i32* getelementptr ({ i32, float, { double } }* @G, i32 0, i32 0)
- ret void
-}
-
-define float @storeinit() {
- store float 1.000000e+00, float* getelementptr ({ i32, float, { double } }* @G, i32 0, i32 1)
- %X = load float* getelementptr ({ i32, float, { double } }* @G, i32 0, i32 1) ; <float> [#uses=1]
- ret float %X
-}
-
-define double @constantize() {
- %X = load double* getelementptr ({ i32, float, { double } }* @G, i32 0, i32 2, i32 0) ; <double> [#uses=1]
- ret double %X
-}
-
diff --git a/release_23/test/Transforms/GlobalOpt/integer-bool.ll b/release_23/test/Transforms/GlobalOpt/integer-bool.ll
deleted file mode 100644
index 9fbbe357617d..000000000000
--- a/release_23/test/Transforms/GlobalOpt/integer-bool.ll
+++ /dev/null
@@ -1,23 +0,0 @@
-; RUN: llvm-as < %s | opt -globalopt -instcombine | \
-; RUN: llvm-dis | grep {ret i1 true}
-
-;; check that global opt turns integers that only hold 0 or 1 into bools.
-
-@G = internal global i32 0 ; <i32*> [#uses=3]
-
-define void @set1() {
- store i32 0, i32* @G
- ret void
-}
-
-define void @set2() {
- store i32 1, i32* @G
- ret void
-}
-
-define i1 @get() {
- %A = load i32* @G ; <i32> [#uses=1]
- %C = icmp slt i32 %A, 2 ; <i1> [#uses=1]
- ret i1 %C
-}
-
diff --git a/release_23/test/Transforms/GlobalOpt/iterate.ll b/release_23/test/Transforms/GlobalOpt/iterate.ll
deleted file mode 100644
index d764c5d31b4c..000000000000
--- a/release_23/test/Transforms/GlobalOpt/iterate.ll
+++ /dev/null
@@ -1,11 +0,0 @@
-; RUN: llvm-as < %s | opt -globalopt | llvm-dis | not grep %G
-
-@G = internal global i32 0 ; <i32*> [#uses=1]
-@H = internal global { i32* } { i32* @G } ; <{ i32* }*> [#uses=1]
-
-define i32 @loadg() {
- %G = load i32** getelementptr ({ i32* }* @H, i32 0, i32 0) ; <i32*> [#uses=1]
- %GV = load i32* %G ; <i32> [#uses=1]
- ret i32 %GV
-}
-
diff --git a/release_23/test/Transforms/GlobalOpt/load-store-global.ll b/release_23/test/Transforms/GlobalOpt/load-store-global.ll
deleted file mode 100644
index d89d2263955c..000000000000
--- a/release_23/test/Transforms/GlobalOpt/load-store-global.ll
+++ /dev/null
@@ -1,15 +0,0 @@
-; RUN: llvm-as < %s | opt -globalopt | llvm-dis | not grep G
-
-@G = internal global i32 17 ; <i32*> [#uses=3]
-
-define void @foo() {
- %V = load i32* @G ; <i32> [#uses=1]
- store i32 %V, i32* @G
- ret void
-}
-
-define i32 @bar() {
- %X = load i32* @G ; <i32> [#uses=1]
- ret i32 %X
-}
-
diff --git a/release_23/test/Transforms/GlobalOpt/malloc-promote-1.ll b/release_23/test/Transforms/GlobalOpt/malloc-promote-1.ll
deleted file mode 100644
index fea4dbdd65c3..000000000000
--- a/release_23/test/Transforms/GlobalOpt/malloc-promote-1.ll
+++ /dev/null
@@ -1,18 +0,0 @@
-; RUN: llvm-as < %s | opt -globalopt | llvm-dis | not grep global
-
-@G = internal global i32* null ; <i32**> [#uses=3]
-
-define void @init() {
- %P = malloc i32 ; <i32*> [#uses=1]
- store i32* %P, i32** @G
- %GV = load i32** @G ; <i32*> [#uses=1]
- store i32 0, i32* %GV
- ret void
-}
-
-define i32 @get() {
- %GV = load i32** @G ; <i32*> [#uses=1]
- %V = load i32* %GV ; <i32> [#uses=1]
- ret i32 %V
-}
-
diff --git a/release_23/test/Transforms/GlobalOpt/malloc-promote-2.ll b/release_23/test/Transforms/GlobalOpt/malloc-promote-2.ll
deleted file mode 100644
index 1b3363295421..000000000000
--- a/release_23/test/Transforms/GlobalOpt/malloc-promote-2.ll
+++ /dev/null
@@ -1,20 +0,0 @@
-; RUN: llvm-as < %s | opt -globalopt | llvm-dis | not grep malloc
-
-@G = internal global i32* null ; <i32**> [#uses=3]
-
-define void @init() {
- %P = malloc i32, i32 100 ; <i32*> [#uses=1]
- store i32* %P, i32** @G
- %GV = load i32** @G ; <i32*> [#uses=1]
- %GVe = getelementptr i32* %GV, i32 40 ; <i32*> [#uses=1]
- store i32 20, i32* %GVe
- ret void
-}
-
-define i32 @get() {
- %GV = load i32** @G ; <i32*> [#uses=1]
- %GVe = getelementptr i32* %GV, i32 40 ; <i32*> [#uses=1]
- %V = load i32* %GVe ; <i32> [#uses=1]
- ret i32 %V
-}
-
diff --git a/release_23/test/Transforms/GlobalOpt/malloc-promote-3.ll b/release_23/test/Transforms/GlobalOpt/malloc-promote-3.ll
deleted file mode 100644
index 26ce8fd6f855..000000000000
--- a/release_23/test/Transforms/GlobalOpt/malloc-promote-3.ll
+++ /dev/null
@@ -1,26 +0,0 @@
-; RUN: llvm-as < %s | opt -globalopt | llvm-dis | not grep malloc
-
-@G = internal global i32* null ; <i32**> [#uses=4]
-
-define void @init() {
- %P = malloc i32, i32 100 ; <i32*> [#uses=1]
- store i32* %P, i32** @G
- %GV = load i32** @G ; <i32*> [#uses=1]
- %GVe = getelementptr i32* %GV, i32 40 ; <i32*> [#uses=1]
- store i32 20, i32* %GVe
- ret void
-}
-
-define i32 @get() {
- %GV = load i32** @G ; <i32*> [#uses=1]
- %GVe = getelementptr i32* %GV, i32 40 ; <i32*> [#uses=1]
- %V = load i32* %GVe ; <i32> [#uses=1]
- ret i32 %V
-}
-
-define i1 @check() {
- %GV = load i32** @G ; <i32*> [#uses=1]
- %V = icmp eq i32* %GV, null ; <i1> [#uses=1]
- ret i1 %V
-}
-
diff --git a/release_23/test/Transforms/GlobalOpt/memcpy.ll b/release_23/test/Transforms/GlobalOpt/memcpy.ll
deleted file mode 100644
index b51aedb13fbb..000000000000
--- a/release_23/test/Transforms/GlobalOpt/memcpy.ll
+++ /dev/null
@@ -1,15 +0,0 @@
-; RUN: llvm-as < %s | opt -globalopt | llvm-dis | \
-; RUN: grep {G1 = internal constant}
-
-@G1 = internal global [58 x i8] c"asdlfkajsdlfkajsd;lfkajds;lfkjasd;flkajsd;lkfja;sdlkfjasd\00" ; <[58 x i8]*> [#uses=1]
-
-declare void @llvm.memcpy.i32(i8*, i8*, i32, i32)
-
-define void @foo() {
- %Blah = alloca [58 x i8] ; <[58 x i8]*> [#uses=1]
- %tmp.0 = getelementptr [58 x i8]* %Blah, i32 0, i32 0 ; <i8*> [#uses=1]
- call void @llvm.memcpy.i32( i8* %tmp.0, i8* getelementptr ([58 x i8]* @G1, i32 0, i32 0), i32 58, i32 1 )
- ret void
-}
-
-
diff --git a/release_23/test/Transforms/GlobalOpt/memset.ll b/release_23/test/Transforms/GlobalOpt/memset.ll
deleted file mode 100644
index 0ee851f40aef..000000000000
--- a/release_23/test/Transforms/GlobalOpt/memset.ll
+++ /dev/null
@@ -1,21 +0,0 @@
-; both globals are write only, delete them.
-
-; RUN: llvm-as < %s | opt -globalopt | llvm-dis | \
-; RUN: not grep internal
-
-@G0 = internal global [58 x i8] c"asdlfkajsdlfkajsd;lfkajds;lfkjasd;flkajsd;lkfja;sdlkfjasd\00" ; <[58 x i8]*> [#uses=1]
-@G1 = internal global [4 x i32] [ i32 1, i32 2, i32 3, i32 4 ] ; <[4 x i32]*> [#uses=1]
-
-declare void @llvm.memcpy.i32(i8*, i8*, i32, i32)
-
-declare void @llvm.memset.i32(i8*, i8, i32, i32)
-
-define void @foo() {
- %Blah = alloca [58 x i8] ; <[58 x i8]*> [#uses=1]
- %tmp3 = bitcast [58 x i8]* %Blah to i8* ; <i8*> [#uses=1]
- call void @llvm.memcpy.i32( i8* bitcast ([4 x i32]* @G1 to i8*), i8* %tmp3, i32 16, i32 1 )
- call void @llvm.memset.i32( i8* getelementptr ([58 x i8]* @G0, i32 0, i32 0), i8 17, i32 58, i32 1 )
- ret void
-}
-
-
diff --git a/release_23/test/Transforms/GlobalOpt/phi-select.ll b/release_23/test/Transforms/GlobalOpt/phi-select.ll
deleted file mode 100644
index da1314f76199..000000000000
--- a/release_23/test/Transforms/GlobalOpt/phi-select.ll
+++ /dev/null
@@ -1,31 +0,0 @@
-; Test that PHI nodes and select instructions do not necessarily make stuff
-; non-constant.
-
-; RUN: llvm-as < %s | opt -globalopt | llvm-dis | not grep global
-
-@X = internal global i32 4 ; <i32*> [#uses=2]
-@Y = internal global i32 5 ; <i32*> [#uses=2]
-
-define i32 @test1(i1 %C) {
- %P = select i1 %C, i32* @X, i32* @Y ; <i32*> [#uses=1]
- %V = load i32* %P ; <i32> [#uses=1]
- ret i32 %V
-}
-
-define i32 @test2(i1 %C) {
-; <label>:0
- br i1 %C, label %T, label %Cont
-
-T: ; preds = %0
- br label %Cont
-
-Cont: ; preds = %T, %0
- %P = phi i32* [ @X, %0 ], [ @Y, %T ] ; <i32*> [#uses=1]
- %V = load i32* %P ; <i32> [#uses=1]
- ret i32 %V
-}
-
-
-
-
-
diff --git a/release_23/test/Transforms/GlobalOpt/storepointer-compare.ll b/release_23/test/Transforms/GlobalOpt/storepointer-compare.ll
deleted file mode 100644
index 86eff5172526..000000000000
--- a/release_23/test/Transforms/GlobalOpt/storepointer-compare.ll
+++ /dev/null
@@ -1,30 +0,0 @@
-; RUN: llvm-as < %s | opt -globalopt | llvm-dis | \
-; RUN: grep {call void @Actual}
-
-; Check that a comparison does not prevent an indirect call from being made
-; direct. The global will still remain, but indirect call elim is still good.
-
-@G = internal global void ()* null ; <void ()**> [#uses=2]
-
-define internal void @Actual() {
- ret void
-}
-
-define void @init() {
- store void ()* @Actual, void ()** @G
- ret void
-}
-
-define void @doit() {
- %FP = load void ()** @G ; <void ()*> [#uses=2]
- %CC = icmp eq void ()* %FP, null ; <i1> [#uses=1]
- br i1 %CC, label %isNull, label %DoCall
-
-DoCall: ; preds = %0
- call void %FP( )
- ret void
-
-isNull: ; preds = %0
- ret void
-}
-
diff --git a/release_23/test/Transforms/GlobalOpt/storepointer.ll b/release_23/test/Transforms/GlobalOpt/storepointer.ll
deleted file mode 100644
index d57a6ac4fad9..000000000000
--- a/release_23/test/Transforms/GlobalOpt/storepointer.ll
+++ /dev/null
@@ -1,19 +0,0 @@
-; RUN: llvm-as < %s | opt -globalopt | llvm-dis | not grep global
-
-@G = internal global void ()* null ; <void ()**> [#uses=2]
-
-define internal void @Actual() {
- ret void
-}
-
-define void @init() {
- store void ()* @Actual, void ()** @G
- ret void
-}
-
-define void @doit() {
- %FP = load void ()** @G ; <void ()*> [#uses=1]
- call void %FP( )
- ret void
-}
-
diff --git a/release_23/test/Transforms/GlobalOpt/trivialstore.ll b/release_23/test/Transforms/GlobalOpt/trivialstore.ll
deleted file mode 100644
index a662565cd24f..000000000000
--- a/release_23/test/Transforms/GlobalOpt/trivialstore.ll
+++ /dev/null
@@ -1,19 +0,0 @@
-; RUN: llvm-as < %s | opt -globalopt | llvm-dis | not grep G
-
-@G = internal global i32 17 ; <i32*> [#uses=3]
-
-define void @foo() {
- store i32 17, i32* @G
- ret void
-}
-
-define i32 @bar() {
- %X = load i32* @G ; <i32> [#uses=1]
- ret i32 %X
-}
-
-define internal void @dead() {
- store i32 123, i32* @G
- ret void
-}
-
diff --git a/release_23/test/Transforms/GlobalOpt/undef-init.ll b/release_23/test/Transforms/GlobalOpt/undef-init.ll
deleted file mode 100644
index bb483fc37690..000000000000
--- a/release_23/test/Transforms/GlobalOpt/undef-init.ll
+++ /dev/null
@@ -1,17 +0,0 @@
-; RUN: llvm-as < %s | opt -globalopt | llvm-dis | not grep store
-
-@llvm.global_ctors = appending global [1 x { i32, void ()* }] [ { i32, void ()* } { i32 65535, void ()* @_GLOBAL__I__Z3foov } ] ; <[1 x { i32, void ()* }]*> [#uses=0]
-@X.0 = internal global i32 undef ; <i32*> [#uses=2]
-
-define i32 @_Z3foov() {
-entry:
- %tmp.1 = load i32* @X.0 ; <i32> [#uses=1]
- ret i32 %tmp.1
-}
-
-define internal void @_GLOBAL__I__Z3foov() {
-entry:
- store i32 1, i32* @X.0
- ret void
-}
-
diff --git a/release_23/test/Transforms/IPConstantProp/deadarg.ll b/release_23/test/Transforms/IPConstantProp/deadarg.ll
deleted file mode 100644
index 18b8f7da8443..000000000000
--- a/release_23/test/Transforms/IPConstantProp/deadarg.ll
+++ /dev/null
@@ -1,6 +0,0 @@
-; RUN: llvm-as < %s | opt -ipconstprop -disable-output
-define internal void @foo(i32 %X) {
- call void @foo( i32 %X )
- ret void
-}
-
diff --git a/release_23/test/Transforms/IPConstantProp/dg.exp b/release_23/test/Transforms/IPConstantProp/dg.exp
deleted file mode 100644
index 879685ca879d..000000000000
--- a/release_23/test/Transforms/IPConstantProp/dg.exp
+++ /dev/null
@@ -1,3 +0,0 @@
-load_lib llvm.exp
-
-RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
diff --git a/release_23/test/Transforms/IPConstantProp/recursion.ll b/release_23/test/Transforms/IPConstantProp/recursion.ll
deleted file mode 100644
index 27c381af3ab3..000000000000
--- a/release_23/test/Transforms/IPConstantProp/recursion.ll
+++ /dev/null
@@ -1,12 +0,0 @@
-; RUN: llvm-as < %s | opt -ipconstprop -deadargelim | llvm-dis | not grep %X
-define internal i32 @foo(i32 %X) {
- %Y = call i32 @foo( i32 %X ) ; <i32> [#uses=1]
- %Z = add i32 %Y, 1 ; <i32> [#uses=1]
- ret i32 %Z
-}
-
-define void @bar() {
- call i32 @foo( i32 17 ) ; <i32>:1 [#uses=0]
- ret void
-}
-
diff --git a/release_23/test/Transforms/IPConstantProp/return-constant.ll b/release_23/test/Transforms/IPConstantProp/return-constant.ll
deleted file mode 100644
index 82ad902f4217..000000000000
--- a/release_23/test/Transforms/IPConstantProp/return-constant.ll
+++ /dev/null
@@ -1,18 +0,0 @@
-; RUN: llvm-as < %s | opt -ipconstprop -instcombine | \
-; RUN: llvm-dis | grep {ret i1 true}
-define internal i32 @foo(i1 %C) {
- br i1 %C, label %T, label %F
-
-T: ; preds = %0
- ret i32 52
-
-F: ; preds = %0
- ret i32 52
-}
-
-define i1 @caller(i1 %C) {
- %X = call i32 @foo( i1 %C ) ; <i32> [#uses=1]
- %Y = icmp ne i32 %X, 0 ; <i1> [#uses=1]
- ret i1 %Y
-}
-
diff --git a/release_23/test/Transforms/IPConstantProp/return-constants.ll b/release_23/test/Transforms/IPConstantProp/return-constants.ll
deleted file mode 100644
index 40567f80bd85..000000000000
--- a/release_23/test/Transforms/IPConstantProp/return-constants.ll
+++ /dev/null
@@ -1,20 +0,0 @@
-; RUN: llvm-as < %s | opt -ipconstprop | llvm-dis | grep {add i32 21, 21}
-
-define internal {i32, i32} @foo(i1 %C) {
- br i1 %C, label %T, label %F
-
-T: ; preds = %0
- ret i32 21, i32 21
-
-F: ; preds = %0
- ret i32 21, i32 21
-}
-
-define i32 @caller(i1 %C) {
- %X = call {i32, i32} @foo( i1 %C )
- %A = getresult {i32, i32} %X, 0
- %B = getresult {i32, i32} %X, 1
- %Y = add i32 %A, %B
- ret i32 %Y
-}
-
diff --git a/release_23/test/Transforms/IndVarsSimplify/2002-09-09-PointerIndVar.ll b/release_23/test/Transforms/IndVarsSimplify/2002-09-09-PointerIndVar.ll
deleted file mode 100644
index 228772eb82cc..000000000000
--- a/release_23/test/Transforms/IndVarsSimplify/2002-09-09-PointerIndVar.ll
+++ /dev/null
@@ -1,17 +0,0 @@
-; Induction variable pass is doing bad things with pointer induction vars,
-; trying to do arithmetic on them directly.
-;
-; RUN: llvm-as < %s | opt -indvars
-;
-define void @test(i32 %A, i32 %S, i8* %S.upgrd.1) {
-; <label>:0
- br label %Loop
-
-Loop: ; preds = %Loop, %0
- %PIV = phi i8* [ %S.upgrd.1, %0 ], [ %PIVNext.upgrd.3, %Loop ] ; <i8*> [#uses=1]
- %PIV.upgrd.2 = ptrtoint i8* %PIV to i64 ; <i64> [#uses=1]
- %PIVNext = add i64 %PIV.upgrd.2, 8 ; <i64> [#uses=1]
- %PIVNext.upgrd.3 = inttoptr i64 %PIVNext to i8* ; <i8*> [#uses=1]
- br label %Loop
-}
-
diff --git a/release_23/test/Transforms/IndVarsSimplify/2003-04-16-ExprAnalysis.ll b/release_23/test/Transforms/IndVarsSimplify/2003-04-16-ExprAnalysis.ll
deleted file mode 100644
index 2487ea95e27d..000000000000
--- a/release_23/test/Transforms/IndVarsSimplify/2003-04-16-ExprAnalysis.ll
+++ /dev/null
@@ -1,17 +0,0 @@
-; This is a test case for the expression analysis code, not really indvars.
-; It was assuming any constant of int type was a ConstantInteger.
-;
-; RUN: llvm-as < %s | opt -indvars
-
-@X = global i32 7 ; <i32*> [#uses=1]
-
-define void @test(i32 %A) {
-; <label>:0
- br label %Loop
-
-Loop: ; preds = %Loop, %0
- %IV = phi i32 [ %A, %0 ], [ %IVNext, %Loop ] ; <i32> [#uses=1]
- %IVNext = add i32 %IV, ptrtoint (i32* @X to i32) ; <i32> [#uses=1]
- br label %Loop
-}
-
diff --git a/release_23/test/Transforms/IndVarsSimplify/2003-09-12-MultiplePred.ll b/release_23/test/Transforms/IndVarsSimplify/2003-09-12-MultiplePred.ll
deleted file mode 100644
index 96190991f73a..000000000000
--- a/release_23/test/Transforms/IndVarsSimplify/2003-09-12-MultiplePred.ll
+++ /dev/null
@@ -1,15 +0,0 @@
-; RUN: llvm-as < %s | opt -indvars | llvm-dis | grep indvar
-
-define i32 @test() {
-; <label>:0
- br i1 true, label %LoopHead, label %LoopHead
-
-LoopHead: ; preds = %LoopHead, %0, %0
- %A = phi i32 [ 7, %0 ], [ 7, %0 ], [ %B, %LoopHead ] ; <i32> [#uses=1]
- %B = add i32 %A, 1 ; <i32> [#uses=2]
- br i1 false, label %LoopHead, label %Out
-
-Out: ; preds = %LoopHead
- ret i32 %B
-}
-
diff --git a/release_23/test/Transforms/IndVarsSimplify/2003-09-23-NotAtTop.ll b/release_23/test/Transforms/IndVarsSimplify/2003-09-23-NotAtTop.ll
deleted file mode 100644
index da22cf2e5164..000000000000
--- a/release_23/test/Transforms/IndVarsSimplify/2003-09-23-NotAtTop.ll
+++ /dev/null
@@ -1,17 +0,0 @@
-; RUN: llvm-as < %s | opt -indvars | llvm-dis | %prcontext Loop: 1 | grep %indvar
-
-; The indvar simplification code should ensure that the first PHI in the block
-; is the canonical one!
-
-define i32 @test() {
-; <label>:0
- br label %Loop
-
-Loop: ; preds = %Loop, %0
- %NonIndvar = phi i32 [ 200, %0 ], [ %NonIndvarNext, %Loop ] ; <i32> [#uses=1]
- %Canonical = phi i32 [ 0, %0 ], [ %CanonicalNext, %Loop ] ; <i32> [#uses=1]
- %NonIndvarNext = sdiv i32 %NonIndvar, 2 ; <i32> [#uses=1]
- %CanonicalNext = add i32 %Canonical, 1 ; <i32> [#uses=1]
- br label %Loop
-}
-
diff --git a/release_23/test/Transforms/IndVarsSimplify/2003-12-10-IndVarDeadCode.ll b/release_23/test/Transforms/IndVarsSimplify/2003-12-10-IndVarDeadCode.ll
deleted file mode 100644
index bd9d1ef5cb9d..000000000000
--- a/release_23/test/Transforms/IndVarsSimplify/2003-12-10-IndVarDeadCode.ll
+++ /dev/null
@@ -1,25 +0,0 @@
-; The induction variable canonicalization pass shouldn't leave dead
-; instructions laying around!
-;
-; RUN: llvm-as < %s | opt -indvars | llvm-dis | \
-; RUN: not grep {#uses=0}
-
-define i32 @mul(i32 %x, i32 %y) {
-entry:
- br label %tailrecurse
-
-tailrecurse: ; preds = %endif, %entry
- %accumulator.tr = phi i32 [ %x, %entry ], [ %tmp.9, %endif ] ; <i32> [#uses=2]
- %y.tr = phi i32 [ %y, %entry ], [ %tmp.8, %endif ] ; <i32> [#uses=2]
- %tmp.1 = icmp eq i32 %y.tr, 0 ; <i1> [#uses=1]
- br i1 %tmp.1, label %return, label %endif
-
-endif: ; preds = %tailrecurse
- %tmp.8 = add i32 %y.tr, -1 ; <i32> [#uses=1]
- %tmp.9 = add i32 %accumulator.tr, %x ; <i32> [#uses=1]
- br label %tailrecurse
-
-return: ; preds = %tailrecurse
- ret i32 %accumulator.tr
-}
-
diff --git a/release_23/test/Transforms/IndVarsSimplify/2003-12-10-RemoveInstrCrash.ll b/release_23/test/Transforms/IndVarsSimplify/2003-12-10-RemoveInstrCrash.ll
deleted file mode 100644
index 11af997e83bd..000000000000
--- a/release_23/test/Transforms/IndVarsSimplify/2003-12-10-RemoveInstrCrash.ll
+++ /dev/null
@@ -1,18 +0,0 @@
-; RUN: llvm-as < %s | opt -indvars -disable-output
-
-define void @test() {
-entry:
- %inc.2 = add i32 1, 1 ; <i32> [#uses=1]
- br i1 false, label %no_exit, label %loopexit
-
-no_exit: ; preds = %no_exit, %entry
- %j.0.pn = phi i32 [ %inc.3, %no_exit ], [ %inc.2, %entry ] ; <i32> [#uses=1]
- %k.0.pn = phi i32 [ %inc.4, %no_exit ], [ 1, %entry ] ; <i32> [#uses=1]
- %inc.3 = add i32 %j.0.pn, 1 ; <i32> [#uses=1]
- %inc.4 = add i32 %k.0.pn, 1 ; <i32> [#uses=1]
- br i1 false, label %no_exit, label %loopexit
-
-loopexit: ; preds = %no_exit, %entry
- ret void
-}
-
diff --git a/release_23/test/Transforms/IndVarsSimplify/2003-12-15-Crash.ll b/release_23/test/Transforms/IndVarsSimplify/2003-12-15-Crash.ll
deleted file mode 100644
index b964d78d6952..000000000000
--- a/release_23/test/Transforms/IndVarsSimplify/2003-12-15-Crash.ll
+++ /dev/null
@@ -1,24 +0,0 @@
-; RUN: llvm-as < %s | opt -indvars -disable-output
-define void @_ZN17CoinFactorization7cleanupEv() {
-entry:
- br i1 false, label %loopexit.14, label %cond_continue.3
-
-cond_continue.3: ; preds = %entry
- ret void
-
-loopexit.14: ; preds = %entry
- %tmp.738 = sub i32 0, 0 ; <i32> [#uses=1]
- br i1 false, label %no_exit.15.preheader, label %loopexit.15
-
-no_exit.15.preheader: ; preds = %loopexit.14
- br label %no_exit.15
-
-no_exit.15: ; preds = %no_exit.15, %no_exit.15.preheader
- %highC.0 = phi i32 [ %tmp.738, %no_exit.15.preheader ], [ %dec.0, %no_exit.15 ] ; <i32> [#uses=1]
- %dec.0 = add i32 %highC.0, -1 ; <i32> [#uses=1]
- br i1 false, label %no_exit.15, label %loopexit.15
-
-loopexit.15: ; preds = %no_exit.15, %loopexit.14
- ret void
-}
-
diff --git a/release_23/test/Transforms/IndVarsSimplify/2003-12-21-IndVarSize.ll b/release_23/test/Transforms/IndVarsSimplify/2003-12-21-IndVarSize.ll
deleted file mode 100644
index cf8c80472dfe..000000000000
--- a/release_23/test/Transforms/IndVarsSimplify/2003-12-21-IndVarSize.ll
+++ /dev/null
@@ -1,15 +0,0 @@
-; RUN: llvm-as < %s | opt -indvars | llvm-dis | grep indvar | not grep i32
-
-@G = global i64 0 ; <i64*> [#uses=1]
-
-define void @test() {
-; <label>:0
- br label %Loop
-
-Loop: ; preds = %Loop, %0
- %X = phi i64 [ 1, %0 ], [ %X.next, %Loop ] ; <i64> [#uses=2]
- %X.next = add i64 %X, 1 ; <i64> [#uses=1]
- store i64 %X, i64* @G
- br label %Loop
-}
-
diff --git a/release_23/test/Transforms/IndVarsSimplify/2004-03-10-PHIInsertionBug.ll b/release_23/test/Transforms/IndVarsSimplify/2004-03-10-PHIInsertionBug.ll
deleted file mode 100644
index 248b29b32d2c..000000000000
--- a/release_23/test/Transforms/IndVarsSimplify/2004-03-10-PHIInsertionBug.ll
+++ /dev/null
@@ -1,26 +0,0 @@
-; RUN: llvm-as < %s | opt -indvars -disable-output
-
-define void @test() {
- br label %endif.0.i
-
-endif.0.i: ; preds = %0
- br i1 false, label %then.3.i, label %endif.3.i
-
-then.3.i: ; preds = %endif.0.i
- br label %endif.3.i
-
-endif.3.i: ; preds = %then.3.i, %endif.0.i
- %inxm.0.i = phi i32 [ 8, %then.3.i ], [ 0, %endif.0.i ] ; <i32> [#uses=1]
- %doinner.1.i = phi i32 [ 0, %then.3.i ], [ 0, %endif.0.i ] ; <i32> [#uses=0]
- br label %loopentry.2.i
-
-loopentry.2.i: ; preds = %no_exit.2.i, %endif.3.i
- %inxk.0.i = phi i32 [ %tmp.210.i, %no_exit.2.i ], [ 0, %endif.3.i ] ; <i32> [#uses=1]
- br label %no_exit.2.i
-
-no_exit.2.i: ; preds = %loopentry.2.i
- %tmp.210.i = sub i32 %inxk.0.i, %inxm.0.i ; <i32> [#uses=2]
- %tmp.213.i = add i32 %tmp.210.i, 0 ; <i32> [#uses=0]
- br label %loopentry.2.i
-}
-
diff --git a/release_23/test/Transforms/IndVarsSimplify/2004-04-05-InvokeCastCrash.ll b/release_23/test/Transforms/IndVarsSimplify/2004-04-05-InvokeCastCrash.ll
deleted file mode 100644
index 6933ee74967d..000000000000
--- a/release_23/test/Transforms/IndVarsSimplify/2004-04-05-InvokeCastCrash.ll
+++ /dev/null
@@ -1,283 +0,0 @@
-; RUN: llvm-as < %s | opt -indvars -disable-output
-; ModuleID = '2004-04-05-InvokeCastCrash.llx'
- %struct.__false_type = type { i8 }
- %"struct.__gnu_cxx::_Hashtable_node<const llvm::Constant*>" = type { %"struct.__gnu_cxx::_Hashtable_node<const llvm::Constant*>"*, %"struct.llvm::Constant"* }
- %"struct.__gnu_cxx::_Hashtable_node<std::pair<const llvm::Value* const, int> >" = type { %"struct.__gnu_cxx::_Hashtable_node<std::pair<const llvm::Value* const, int> >"*, %"struct.std::pair<const llvm::Value* const,int>" }
- %"struct.__gnu_cxx::hash_map<const llvm::Value*,int,__gnu_cxx::hash<const llvm::Value*>,std::equal_to<const llvm::Value*>,std::allocator<int> >" = type { %"struct.__gnu_cxx::hashtable<std::pair<const llvm::Value* const, int>,const llvm::Value*,__gnu_cxx::hash<const llvm::Value*>,std::_Select1st<std::pair<const llvm::Value* const, int> >,std::equal_to<const llvm::Value*>,std::allocator<int> >" }
- %"struct.__gnu_cxx::hash_set<const llvm::Constant*,__gnu_cxx::hash<const llvm::Constant*>,std::equal_to<const llvm::Constant*>,std::allocator<const llvm::Constant*> >" = type { %"struct.__gnu_cxx::hashtable<const llvm::Constant*,const llvm::Constant*,__gnu_cxx::hash<const llvm::Constant*>,std::_Identity<const llvm::Constant*>,std::equal_to<const llvm::Constant*>,std::allocator<const llvm::Constant*> >" }
- %"struct.__gnu_cxx::hashtable<const llvm::Constant*,const llvm::Constant*,__gnu_cxx::hash<const llvm::Constant*>,std::_Identity<const llvm::Constant*>,std::equal_to<const llvm::Constant*>,std::allocator<const llvm::Constant*> >" = type { %struct.__false_type, %struct.__false_type, %struct.__false_type, %struct.__false_type, %"struct.std::vector<__gnu_cxx::_Hashtable_node<const llvm::Constant*>*,std::allocator<const llvm::Constant*> >", i32 }
- %"struct.__gnu_cxx::hashtable<std::pair<const llvm::Value* const, int>,const llvm::Value*,__gnu_cxx::hash<const llvm::Value*>,std::_Select1st<std::pair<const llvm::Value* const, int> >,std::equal_to<const llvm::Value*>,std::allocator<int> >" = type { %struct.__false_type, %struct.__false_type, %struct.__false_type, %struct.__false_type, %"struct.std::vector<__gnu_cxx::_Hashtable_node<std::pair<const llvm::Value* const, int> >*,std::allocator<int> >", i32 }
- %"struct.llvm::AbstractTypeUser" = type { i32 (...)** }
- %"struct.llvm::Annotable" = type { i32 (...)**, %"struct.llvm::Annotation"* }
- %"struct.llvm::Annotation" = type { i32 (...)**, %"struct.llvm::AnnotationID", %"struct.llvm::Annotation"* }
- %"struct.llvm::AnnotationID" = type { i32 }
- %"struct.llvm::Argument" = type { %"struct.llvm::Value", %"struct.llvm::Function"*, %"struct.llvm::Argument"*, %"struct.llvm::Argument"* }
- %"struct.llvm::BasicBlock" = type { %"struct.llvm::Value", %"struct.llvm::iplist<llvm::Instruction,llvm::ilist_traits<llvm::Instruction> >", %"struct.llvm::BasicBlock"*, %"struct.llvm::BasicBlock"* }
- %"struct.llvm::Constant" = type opaque
- %"struct.llvm::DerivedType" = type { %"struct.llvm::Type", %"struct.llvm::AbstractTypeUser", %"struct.std::vector<llvm::AbstractTypeUser*,std::allocator<llvm::AbstractTypeUser*> >" }
- %"struct.llvm::Function" = type { %"struct.llvm::GlobalValue", %"struct.llvm::Annotable", %"struct.llvm::iplist<llvm::BasicBlock,llvm::ilist_traits<llvm::BasicBlock> >", %"struct.llvm::iplist<llvm::Argument,llvm::ilist_traits<llvm::Argument> >", %"struct.llvm::SymbolTable"*, %"struct.llvm::Function"*, %"struct.llvm::Function"* }
- %"struct.llvm::FunctionPass" = type { %"struct.llvm::Pass" }
- %"struct.llvm::FunctionType" = type { %"struct.llvm::DerivedType", i1 }
- %"struct.llvm::GlobalValue" = type { %"struct.llvm::User", i32, %"struct.llvm::Module"* }
- %"struct.llvm::Instruction" = type { %"struct.llvm::User", %"struct.llvm::Annotable", %"struct.llvm::BasicBlock"*, %"struct.llvm::Instruction"*, %"struct.llvm::Instruction"*, i32 }
- %"struct.llvm::IntrinsicLowering" = type opaque
- %"struct.llvm::MachineBasicBlock" = type { %"struct.llvm::ilist<llvm::MachineInstr>", %"struct.llvm::MachineBasicBlock"*, %"struct.llvm::MachineBasicBlock"*, %"struct.llvm::BasicBlock"* }
- %"struct.llvm::MachineConstantPool" = type opaque
- %"struct.llvm::MachineFrameInfo" = type opaque
- %"struct.llvm::MachineFunction" = type { %"struct.llvm::Annotation", %"struct.llvm::Function"*, %"struct.llvm::TargetMachine"*, %"struct.llvm::iplist<llvm::MachineBasicBlock,llvm::ilist_traits<llvm::MachineBasicBlock> >", %"struct.llvm::SSARegMap"*, %"struct.llvm::MachineFunctionInfo"*, %"struct.llvm::MachineFrameInfo"*, %"struct.llvm::MachineConstantPool"* }
- %"struct.llvm::MachineFunctionInfo" = type { %"struct.__gnu_cxx::hash_set<const llvm::Constant*,__gnu_cxx::hash<const llvm::Constant*>,std::equal_to<const llvm::Constant*>,std::allocator<const llvm::Constant*> >", %"struct.__gnu_cxx::hash_map<const llvm::Value*,int,__gnu_cxx::hash<const llvm::Value*>,std::equal_to<const llvm::Value*>,std::allocator<int> >", i32, i32, i32, i32, i32, i32, i32, i1, i1, i1, %"struct.llvm::MachineFunction"* }
- %"struct.llvm::MachineFunctionPass" = type { %"struct.llvm::FunctionPass" }
- %"struct.llvm::MachineInstr" = type { i16, i8, %"struct.std::vector<llvm::MachineOperand,std::allocator<llvm::MachineOperand> >", %"struct.llvm::MachineInstr"*, %"struct.llvm::MachineInstr"*, %"struct.llvm::MachineBasicBlock"* }
- %"struct.llvm::MachineInstrBuilder" = type { %"struct.llvm::MachineInstr"* }
- %"struct.llvm::MachineOperand" = type { %"union.llvm::MachineOperand::._65", i32, i32 }
- %"struct.llvm::Module" = type opaque
- %"struct.llvm::PATypeHandle" = type { %"struct.llvm::Type"*, %"struct.llvm::AbstractTypeUser"* }
- %"struct.llvm::PATypeHolder" = type { %"struct.llvm::Type"* }
- %"struct.llvm::Pass" = type { i32 (...)**, %"struct.llvm::AbstractTypeUser"*, %"struct.llvm::PassInfo"*, %"struct.std::vector<std::pair<const llvm::PassInfo*, llvm::Pass*>,std::allocator<std::pair<const llvm::PassInfo*, llvm::Pass*> > >" }
- %"struct.llvm::PassInfo" = type { i8*, i8*, %"struct.std::type_info"*, i8, %"struct.std::vector<const llvm::PassInfo*,std::allocator<const llvm::PassInfo*> >", %"struct.llvm::Pass"* ()*, %"struct.llvm::Pass"* (%"struct.llvm::TargetMachine"*)* }
- %"struct.llvm::SSARegMap" = type opaque
- %"struct.llvm::SymbolTable" = type opaque
- %"struct.llvm::SymbolTableListTraits<llvm::Argument,llvm::Function,llvm::Function,llvm::ilist_traits<llvm::Argument> >" = type { %"struct.llvm::Function"*, %"struct.llvm::Function"* }
- %"struct.llvm::SymbolTableListTraits<llvm::Instruction,llvm::BasicBlock,llvm::Function,llvm::ilist_traits<llvm::Instruction> >" = type { %"struct.llvm::Function"*, %"struct.llvm::BasicBlock"* }
- %"struct.llvm::TargetData" = type { %"struct.llvm::FunctionPass", i1, i8, i8, i8, i8, i8, i8, i8, i8 }
- %"struct.llvm::TargetFrameInfo" = type { i32 (...)**, i32, i32, i32 }
- %"struct.llvm::TargetInstrDescriptor" = type { i8*, i32, i32, i32, i1, i32, i32, i32, i32, i32, i32*, i32* }
- %"struct.llvm::TargetInstrInfo" = type { i32 (...)**, %"struct.llvm::TargetInstrDescriptor"*, i32, i32 }
- %"struct.llvm::TargetMachine" = type { i32 (...)**, %"struct.std::basic_string<char,std::char_traits<char>,std::allocator<char> >", %"struct.llvm::TargetData", %"struct.llvm::IntrinsicLowering"* }
- %"struct.llvm::TargetRegClassInfo" = type { i32 (...)**, i32, i32, i32 }
- %"struct.llvm::TargetRegInfo" = type { i32 (...)**, %"struct.std::vector<const llvm::TargetRegClassInfo*,std::allocator<const llvm::TargetRegClassInfo*> >", %"struct.llvm::TargetMachine"* }
- %"struct.llvm::Type" = type { %"struct.llvm::Value", i32, i32, i1, i32, %"struct.llvm::Type"*, %"struct.std::vector<llvm::PATypeHandle,std::allocator<llvm::PATypeHandle> >" }
- %"struct.llvm::Use" = type { %"struct.llvm::Value"*, %"struct.llvm::User"*, %"struct.llvm::Use"*, %"struct.llvm::Use"* }
- %"struct.llvm::User" = type { %"struct.llvm::Value", %"struct.std::vector<llvm::Use,std::allocator<llvm::Use> >" }
- %"struct.llvm::Value" = type { i32 (...)**, %"struct.llvm::iplist<llvm::Use,llvm::ilist_traits<llvm::Use> >", %"struct.std::basic_string<char,std::char_traits<char>,std::allocator<char> >", %"struct.llvm::PATypeHolder", i32 }
- %"struct.llvm::_GLOBAL__N_::InsertPrologEpilogCode" = type { %"struct.llvm::MachineFunctionPass" }
- %"struct.llvm::ilist<llvm::MachineInstr>" = type { %"struct.llvm::iplist<llvm::MachineInstr,llvm::ilist_traits<llvm::MachineInstr> >" }
- %"struct.llvm::ilist_iterator<const llvm::MachineBasicBlock>" = type { %"struct.llvm::MachineBasicBlock"* }
- %"struct.llvm::ilist_traits<llvm::Argument>" = type { %"struct.llvm::SymbolTableListTraits<llvm::Argument,llvm::Function,llvm::Function,llvm::ilist_traits<llvm::Argument> >" }
- %"struct.llvm::ilist_traits<llvm::Instruction>" = type { %"struct.llvm::SymbolTableListTraits<llvm::Instruction,llvm::BasicBlock,llvm::Function,llvm::ilist_traits<llvm::Instruction> >" }
- %"struct.llvm::iplist<llvm::Argument,llvm::ilist_traits<llvm::Argument> >" = type { %"struct.llvm::ilist_traits<llvm::Argument>", %"struct.llvm::Argument"*, %"struct.llvm::Argument"* }
- %"struct.llvm::iplist<llvm::BasicBlock,llvm::ilist_traits<llvm::BasicBlock> >" = type { %"struct.llvm::ilist_traits<llvm::Argument>", %"struct.llvm::BasicBlock"*, %"struct.llvm::BasicBlock"* }
- %"struct.llvm::iplist<llvm::Instruction,llvm::ilist_traits<llvm::Instruction> >" = type { %"struct.llvm::ilist_traits<llvm::Instruction>", %"struct.llvm::Instruction"*, %"struct.llvm::Instruction"* }
- %"struct.llvm::iplist<llvm::MachineBasicBlock,llvm::ilist_traits<llvm::MachineBasicBlock> >" = type { %"struct.llvm::MachineBasicBlock"*, %"struct.llvm::MachineBasicBlock"* }
- %"struct.llvm::iplist<llvm::MachineInstr,llvm::ilist_traits<llvm::MachineInstr> >" = type { %"struct.llvm::ilist_iterator<const llvm::MachineBasicBlock>", %"struct.llvm::MachineInstr"*, %"struct.llvm::MachineInstr"* }
- %"struct.llvm::iplist<llvm::Use,llvm::ilist_traits<llvm::Use> >" = type { %"struct.llvm::Use"*, %"struct.llvm::Use"* }
- %"struct.std::_Vector_alloc_base<__gnu_cxx::_Hashtable_node<const llvm::Constant*>*,std::allocator<const llvm::Constant*>, true>" = type { %"struct.__gnu_cxx::_Hashtable_node<const llvm::Constant*>"**, %"struct.__gnu_cxx::_Hashtable_node<const llvm::Constant*>"**, %"struct.__gnu_cxx::_Hashtable_node<const llvm::Constant*>"** }
- %"struct.std::_Vector_alloc_base<__gnu_cxx::_Hashtable_node<std::pair<const llvm::Value* const, int> >*,std::allocator<int>, true>" = type { %"struct.__gnu_cxx::_Hashtable_node<std::pair<const llvm::Value* const, int> >"**, %"struct.__gnu_cxx::_Hashtable_node<std::pair<const llvm::Value* const, int> >"**, %"struct.__gnu_cxx::_Hashtable_node<std::pair<const llvm::Value* const, int> >"** }
- %"struct.std::_Vector_alloc_base<const llvm::PassInfo*,std::allocator<const llvm::PassInfo*>, true>" = type { %"struct.llvm::PassInfo"**, %"struct.llvm::PassInfo"**, %"struct.llvm::PassInfo"** }
- %"struct.std::_Vector_alloc_base<const llvm::TargetRegClassInfo*,std::allocator<const llvm::TargetRegClassInfo*>, true>" = type { %"struct.llvm::TargetFrameInfo"**, %"struct.llvm::TargetFrameInfo"**, %"struct.llvm::TargetFrameInfo"** }
- %"struct.std::_Vector_alloc_base<llvm::AbstractTypeUser*,std::allocator<llvm::AbstractTypeUser*>, true>" = type { %"struct.llvm::AbstractTypeUser"**, %"struct.llvm::AbstractTypeUser"**, %"struct.llvm::AbstractTypeUser"** }
- %"struct.std::_Vector_alloc_base<llvm::MachineInstr*,std::allocator<llvm::MachineInstr*>, true>" = type { %"struct.llvm::MachineInstr"**, %"struct.llvm::MachineInstr"**, %"struct.llvm::MachineInstr"** }
- %"struct.std::_Vector_alloc_base<llvm::MachineOperand,std::allocator<llvm::MachineOperand>, true>" = type { %"struct.llvm::MachineOperand"*, %"struct.llvm::MachineOperand"*, %"struct.llvm::MachineOperand"* }
- %"struct.std::_Vector_alloc_base<llvm::PATypeHandle,std::allocator<llvm::PATypeHandle>, true>" = type { %"struct.llvm::PATypeHandle"*, %"struct.llvm::PATypeHandle"*, %"struct.llvm::PATypeHandle"* }
- %"struct.std::_Vector_alloc_base<llvm::Use,std::allocator<llvm::Use>, true>" = type { %"struct.llvm::Use"*, %"struct.llvm::Use"*, %"struct.llvm::Use"* }
- %"struct.std::_Vector_alloc_base<std::pair<const llvm::PassInfo*, llvm::Pass*>,std::allocator<std::pair<const llvm::PassInfo*, llvm::Pass*> >, true>" = type { %"struct.std::pair<const llvm::PassInfo*,llvm::Pass*>"*, %"struct.std::pair<const llvm::PassInfo*,llvm::Pass*>"*, %"struct.std::pair<const llvm::PassInfo*,llvm::Pass*>"* }
- %"struct.std::_Vector_base<__gnu_cxx::_Hashtable_node<const llvm::Constant*>*,std::allocator<const llvm::Constant*> >" = type { %"struct.std::_Vector_alloc_base<__gnu_cxx::_Hashtable_node<const llvm::Constant*>*,std::allocator<const llvm::Constant*>, true>" }
- %"struct.std::_Vector_base<__gnu_cxx::_Hashtable_node<std::pair<const llvm::Value* const, int> >*,std::allocator<int> >" = type { %"struct.std::_Vector_alloc_base<__gnu_cxx::_Hashtable_node<std::pair<const llvm::Value* const, int> >*,std::allocator<int>, true>" }
- %"struct.std::_Vector_base<const llvm::PassInfo*,std::allocator<const llvm::PassInfo*> >" = type { %"struct.std::_Vector_alloc_base<const llvm::PassInfo*,std::allocator<const llvm::PassInfo*>, true>" }
- %"struct.std::_Vector_base<const llvm::TargetRegClassInfo*,std::allocator<const llvm::TargetRegClassInfo*> >" = type { %"struct.std::_Vector_alloc_base<const llvm::TargetRegClassInfo*,std::allocator<const llvm::TargetRegClassInfo*>, true>" }
- %"struct.std::_Vector_base<llvm::AbstractTypeUser*,std::allocator<llvm::AbstractTypeUser*> >" = type { %"struct.std::_Vector_alloc_base<llvm::AbstractTypeUser*,std::allocator<llvm::AbstractTypeUser*>, true>" }
- %"struct.std::_Vector_base<llvm::MachineInstr*,std::allocator<llvm::MachineInstr*> >" = type { %"struct.std::_Vector_alloc_base<llvm::MachineInstr*,std::allocator<llvm::MachineInstr*>, true>" }
- %"struct.std::_Vector_base<llvm::MachineOperand,std::allocator<llvm::MachineOperand> >" = type { %"struct.std::_Vector_alloc_base<llvm::MachineOperand,std::allocator<llvm::MachineOperand>, true>" }
- %"struct.std::_Vector_base<llvm::PATypeHandle,std::allocator<llvm::PATypeHandle> >" = type { %"struct.std::_Vector_alloc_base<llvm::PATypeHandle,std::allocator<llvm::PATypeHandle>, true>" }
- %"struct.std::_Vector_base<llvm::Use,std::allocator<llvm::Use> >" = type { %"struct.std::_Vector_alloc_base<llvm::Use,std::allocator<llvm::Use>, true>" }
- %"struct.std::_Vector_base<std::pair<const llvm::PassInfo*, llvm::Pass*>,std::allocator<std::pair<const llvm::PassInfo*, llvm::Pass*> > >" = type { %"struct.std::_Vector_alloc_base<std::pair<const llvm::PassInfo*, llvm::Pass*>,std::allocator<std::pair<const llvm::PassInfo*, llvm::Pass*> >, true>" }
- %"struct.std::basic_string<char,std::char_traits<char>,std::allocator<char> >" = type { %"struct.std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Alloc_hider" }
- %"struct.std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Alloc_hider" = type { i8* }
- %"struct.std::pair<const llvm::PassInfo*,llvm::Pass*>" = type { %"struct.llvm::PassInfo"*, %"struct.llvm::Pass"* }
- %"struct.std::pair<const llvm::Value* const,int>" = type { %"struct.llvm::Value"*, i32 }
- %"struct.std::type_info" = type { i32 (...)**, i8* }
- %"struct.std::vector<__gnu_cxx::_Hashtable_node<const llvm::Constant*>*,std::allocator<const llvm::Constant*> >" = type { %"struct.std::_Vector_base<__gnu_cxx::_Hashtable_node<const llvm::Constant*>*,std::allocator<const llvm::Constant*> >" }
- %"struct.std::vector<__gnu_cxx::_Hashtable_node<std::pair<const llvm::Value* const, int> >*,std::allocator<int> >" = type { %"struct.std::_Vector_base<__gnu_cxx::_Hashtable_node<std::pair<const llvm::Value* const, int> >*,std::allocator<int> >" }
- %"struct.std::vector<const llvm::PassInfo*,std::allocator<const llvm::PassInfo*> >" = type { %"struct.std::_Vector_base<const llvm::PassInfo*,std::allocator<const llvm::PassInfo*> >" }
- %"struct.std::vector<const llvm::TargetRegClassInfo*,std::allocator<const llvm::TargetRegClassInfo*> >" = type { %"struct.std::_Vector_base<const llvm::TargetRegClassInfo*,std::allocator<const llvm::TargetRegClassInfo*> >" }
- %"struct.std::vector<llvm::AbstractTypeUser*,std::allocator<llvm::AbstractTypeUser*> >" = type { %"struct.std::_Vector_base<llvm::AbstractTypeUser*,std::allocator<llvm::AbstractTypeUser*> >" }
- %"struct.std::vector<llvm::MachineInstr*,std::allocator<llvm::MachineInstr*> >" = type { %"struct.std::_Vector_base<llvm::MachineInstr*,std::allocator<llvm::MachineInstr*> >" }
- %"struct.std::vector<llvm::MachineOperand,std::allocator<llvm::MachineOperand> >" = type { %"struct.std::_Vector_base<llvm::MachineOperand,std::allocator<llvm::MachineOperand> >" }
- %"struct.std::vector<llvm::PATypeHandle,std::allocator<llvm::PATypeHandle> >" = type { %"struct.std::_Vector_base<llvm::PATypeHandle,std::allocator<llvm::PATypeHandle> >" }
- %"struct.std::vector<llvm::Use,std::allocator<llvm::Use> >" = type { %"struct.std::_Vector_base<llvm::Use,std::allocator<llvm::Use> >" }
- %"struct.std::vector<std::pair<const llvm::PassInfo*, llvm::Pass*>,std::allocator<std::pair<const llvm::PassInfo*, llvm::Pass*> > >" = type { %"struct.std::_Vector_base<std::pair<const llvm::PassInfo*, llvm::Pass*>,std::allocator<std::pair<const llvm::PassInfo*, llvm::Pass*> > >" }
- %"union.llvm::MachineOperand::._65" = type { %"struct.std::basic_string<char,std::char_traits<char>,std::allocator<char> >"* }
-
-declare void @_Znwj()
-
-declare void @_ZN4llvm12MachineInstrC1Esjbb()
-
-declare void @_ZNSt6vectorIPN4llvm12MachineInstrESaIS2_EE9push_backERKS2_()
-
-declare void @_ZNK4llvm8Function15getFunctionTypeEv()
-
-declare void @_ZNK4llvm19MachineInstrBuilder7addMRegEiNS_14MachineOperand7UseTypeE()
-
-declare void @_ZNK4llvm19MachineInstrBuilder7addSImmEi()
-
-define void @_ZN4llvm11_GLOBAL__N_22InsertPrologEpilogCode20runOnMachineFunctionERNS_15MachineFunctionE(%"struct.llvm::MachineFunction"* %F) {
-entry:
- %tmp.8.i = invoke %"struct.llvm::TargetFrameInfo"* null( %"struct.llvm::TargetMachine"* null )
- to label %invoke_cont.0.i unwind label %invoke_catch.0.i ; <%"struct.llvm::TargetFrameInfo"*> [#uses=0]
-
-invoke_catch.0.i: ; preds = %invoke_cont.49.i, %invoke_cont.48.i, %invoke_cont.47.i, %invoke_cont.i53.i, %no_exit.i, %invoke_cont.44.i, %invoke_cont.43.i, %invoke_cont.42.i, %invoke_cont.41.i, %invoke_cont.40.i, %invoke_cont.39.i, %invoke_cont.38.i, %invoke_cont.37.i, %then.2.i, %invoke_cont.35.i, %invoke_cont.34.i, %then.1.i, %endif.0.i, %invoke_cont.9.i, %invoke_cont.8.i, %invoke_cont.7.i, %invoke_cont.i.i, %then.0.i, %invoke_cont.4.i, %invoke_cont.3.i, %invoke_cont.2.i, %invoke_cont.1.i, %endif.0.i.i, %tmp.7.i.noexc.i, %invoke_cont.0.i, %entry
- ret void
-
-invoke_cont.0.i: ; preds = %entry
- %tmp.7.i1.i = invoke %"struct.llvm::TargetFrameInfo"* null( %"struct.llvm::TargetMachine"* null )
- to label %tmp.7.i.noexc.i unwind label %invoke_catch.0.i ; <%"struct.llvm::TargetFrameInfo"*> [#uses=2]
-
-tmp.7.i.noexc.i: ; preds = %invoke_cont.0.i
- %tmp.17.i2.i = invoke i32 null( %"struct.llvm::TargetFrameInfo"* %tmp.7.i1.i )
- to label %endif.0.i.i unwind label %invoke_catch.0.i ; <i32> [#uses=0]
-
-endif.0.i.i: ; preds = %tmp.7.i.noexc.i
- %tmp.38.i4.i = invoke i32 null( %"struct.llvm::TargetFrameInfo"* %tmp.7.i1.i )
- to label %tmp.38.i.noexc.i unwind label %invoke_catch.0.i ; <i32> [#uses=0]
-
-tmp.38.i.noexc.i: ; preds = %endif.0.i.i
- br i1 false, label %invoke_cont.1.i, label %then.1.i.i
-
-then.1.i.i: ; preds = %tmp.38.i.noexc.i
- ret void
-
-invoke_cont.1.i: ; preds = %tmp.38.i.noexc.i
- %tmp.21.i = invoke %"struct.llvm::TargetRegInfo"* null( %"struct.llvm::TargetMachine"* null )
- to label %invoke_cont.2.i unwind label %invoke_catch.0.i ; <%"struct.llvm::TargetRegInfo"*> [#uses=1]
-
-invoke_cont.2.i: ; preds = %invoke_cont.1.i
- %tmp.28.i = invoke i32 null( %"struct.llvm::TargetRegInfo"* %tmp.21.i )
- to label %invoke_cont.3.i unwind label %invoke_catch.0.i ; <i32> [#uses=0]
-
-invoke_cont.3.i: ; preds = %invoke_cont.2.i
- %tmp.36.i = invoke %"struct.llvm::TargetInstrInfo"* null( %"struct.llvm::TargetMachine"* null )
- to label %invoke_cont.4.i unwind label %invoke_catch.0.i ; <%"struct.llvm::TargetInstrInfo"*> [#uses=1]
-
-invoke_cont.4.i: ; preds = %invoke_cont.3.i
- %tmp.43.i = invoke i1 null( %"struct.llvm::TargetInstrInfo"* %tmp.36.i, i16 383, i64 0 )
- to label %invoke_cont.5.i unwind label %invoke_catch.0.i ; <i1> [#uses=1]
-
-invoke_cont.5.i: ; preds = %invoke_cont.4.i
- br i1 %tmp.43.i, label %then.0.i, label %else.i
-
-then.0.i: ; preds = %invoke_cont.5.i
- invoke void @_Znwj( )
- to label %tmp.0.i.noexc.i unwind label %invoke_catch.0.i
-
-tmp.0.i.noexc.i: ; preds = %then.0.i
- invoke void @_ZN4llvm12MachineInstrC1Esjbb( )
- to label %invoke_cont.i.i unwind label %cond_true.i.i
-
-cond_true.i.i: ; preds = %tmp.0.i.noexc.i
- ret void
-
-invoke_cont.i.i: ; preds = %tmp.0.i.noexc.i
- invoke void @_ZNK4llvm19MachineInstrBuilder7addMRegEiNS_14MachineOperand7UseTypeE( )
- to label %invoke_cont.7.i unwind label %invoke_catch.0.i
-
-invoke_cont.7.i: ; preds = %invoke_cont.i.i
- invoke void @_ZNK4llvm19MachineInstrBuilder7addSImmEi( )
- to label %invoke_cont.8.i unwind label %invoke_catch.0.i
-
-invoke_cont.8.i: ; preds = %invoke_cont.7.i
- invoke void @_ZNK4llvm19MachineInstrBuilder7addMRegEiNS_14MachineOperand7UseTypeE( )
- to label %invoke_cont.9.i unwind label %invoke_catch.0.i
-
-invoke_cont.9.i: ; preds = %invoke_cont.8.i
- invoke void @_ZNSt6vectorIPN4llvm12MachineInstrESaIS2_EE9push_backERKS2_( )
- to label %endif.0.i unwind label %invoke_catch.0.i
-
-else.i: ; preds = %invoke_cont.5.i
- ret void
-
-endif.0.i: ; preds = %invoke_cont.9.i
- invoke void @_ZNK4llvm8Function15getFunctionTypeEv( )
- to label %invoke_cont.33.i unwind label %invoke_catch.0.i
-
-invoke_cont.33.i: ; preds = %endif.0.i
- br i1 false, label %then.1.i, label %endif.1.i
-
-then.1.i: ; preds = %invoke_cont.33.i
- invoke void @_ZNK4llvm8Function15getFunctionTypeEv( )
- to label %invoke_cont.34.i unwind label %invoke_catch.0.i
-
-invoke_cont.34.i: ; preds = %then.1.i
- %tmp.121.i = invoke %"struct.llvm::TargetRegInfo"* null( %"struct.llvm::TargetMachine"* null )
- to label %invoke_cont.35.i unwind label %invoke_catch.0.i ; <%"struct.llvm::TargetRegInfo"*> [#uses=1]
-
-invoke_cont.35.i: ; preds = %invoke_cont.34.i
- %tmp.128.i = invoke i32 null( %"struct.llvm::TargetRegInfo"* %tmp.121.i )
- to label %invoke_cont.36.i unwind label %invoke_catch.0.i ; <i32> [#uses=0]
-
-invoke_cont.36.i: ; preds = %invoke_cont.35.i
- br i1 false, label %then.2.i, label %endif.1.i
-
-then.2.i: ; preds = %invoke_cont.36.i
- %tmp.140.i = invoke %"struct.llvm::TargetRegInfo"* null( %"struct.llvm::TargetMachine"* null )
- to label %invoke_cont.37.i unwind label %invoke_catch.0.i ; <%"struct.llvm::TargetRegInfo"*> [#uses=0]
-
-invoke_cont.37.i: ; preds = %then.2.i
- %tmp.148.i = invoke %"struct.llvm::TargetRegInfo"* null( %"struct.llvm::TargetMachine"* null )
- to label %invoke_cont.38.i unwind label %invoke_catch.0.i ; <%"struct.llvm::TargetRegInfo"*> [#uses=1]
-
-invoke_cont.38.i: ; preds = %invoke_cont.37.i
- %tmp.155.i = invoke i32 null( %"struct.llvm::TargetRegInfo"* %tmp.148.i, %"struct.llvm::Type"* null, i1 false )
- to label %invoke_cont.39.i unwind label %invoke_catch.0.i ; <i32> [#uses=0]
-
-invoke_cont.39.i: ; preds = %invoke_cont.38.i
- %tmp.163.i = invoke %"struct.llvm::TargetFrameInfo"* null( %"struct.llvm::TargetMachine"* null )
- to label %invoke_cont.40.i unwind label %invoke_catch.0.i ; <%"struct.llvm::TargetFrameInfo"*> [#uses=1]
-
-invoke_cont.40.i: ; preds = %invoke_cont.39.i
- %tmp.170.i = invoke i32 null( %"struct.llvm::TargetFrameInfo"* %tmp.163.i )
- to label %invoke_cont.41.i unwind label %invoke_catch.0.i ; <i32> [#uses=0]
-
-invoke_cont.41.i: ; preds = %invoke_cont.40.i
- %tmp.177.i = invoke %"struct.llvm::TargetFrameInfo"* null( %"struct.llvm::TargetMachine"* null )
- to label %invoke_cont.42.i unwind label %invoke_catch.0.i ; <%"struct.llvm::TargetFrameInfo"*> [#uses=1]
-
-invoke_cont.42.i: ; preds = %invoke_cont.41.i
- %tmp.184.i = invoke i32 null( %"struct.llvm::TargetFrameInfo"* %tmp.177.i )
- to label %invoke_cont.43.i unwind label %invoke_catch.0.i ; <i32> [#uses=1]
-
-invoke_cont.43.i: ; preds = %invoke_cont.42.i
- %tmp.191.i = invoke %"struct.llvm::TargetFrameInfo"* null( %"struct.llvm::TargetMachine"* null )
- to label %invoke_cont.44.i unwind label %invoke_catch.0.i ; <%"struct.llvm::TargetFrameInfo"*> [#uses=1]
-
-invoke_cont.44.i: ; preds = %invoke_cont.43.i
- %tmp.198.i = invoke i32 null( %"struct.llvm::TargetFrameInfo"* %tmp.191.i, %"struct.llvm::MachineFunction"* %F, i1* null )
- to label %invoke_cont.45.i unwind label %invoke_catch.0.i ; <i32> [#uses=0]
-
-invoke_cont.45.i: ; preds = %invoke_cont.44.i
- br i1 false, label %no_exit.i, label %endif.1.i
-
-no_exit.i: ; preds = %invoke_cont.50.i, %invoke_cont.45.i
- %nextArgOffset.0.i.1 = phi i32 [ %tmp.221.i, %invoke_cont.50.i ], [ 0, %invoke_cont.45.i ] ; <i32> [#uses=1]
- invoke void @_Znwj( )
- to label %tmp.0.i.noexc55.i unwind label %invoke_catch.0.i
-
-tmp.0.i.noexc55.i: ; preds = %no_exit.i
- invoke void @_ZN4llvm12MachineInstrC1Esjbb( )
- to label %invoke_cont.i53.i unwind label %cond_true.i52.i
-
-cond_true.i52.i: ; preds = %tmp.0.i.noexc55.i
- ret void
-
-invoke_cont.i53.i: ; preds = %tmp.0.i.noexc55.i
- invoke void @_ZNK4llvm19MachineInstrBuilder7addMRegEiNS_14MachineOperand7UseTypeE( )
- to label %invoke_cont.47.i unwind label %invoke_catch.0.i
-
-invoke_cont.47.i: ; preds = %invoke_cont.i53.i
- invoke void @_ZNK4llvm19MachineInstrBuilder7addMRegEiNS_14MachineOperand7UseTypeE( )
- to label %invoke_cont.48.i unwind label %invoke_catch.0.i
-
-invoke_cont.48.i: ; preds = %invoke_cont.47.i
- invoke void @_ZNK4llvm19MachineInstrBuilder7addSImmEi( )
- to label %invoke_cont.49.i unwind label %invoke_catch.0.i
-
-invoke_cont.49.i: ; preds = %invoke_cont.48.i
- invoke void @_ZNSt6vectorIPN4llvm12MachineInstrESaIS2_EE9push_backERKS2_( )
- to label %invoke_cont.50.i unwind label %invoke_catch.0.i
-
-invoke_cont.50.i: ; preds = %invoke_cont.49.i
- %tmp.221.i = add i32 %nextArgOffset.0.i.1, %tmp.184.i ; <i32> [#uses=1]
- br i1 false, label %no_exit.i, label %endif.1.i
-
-endif.1.i: ; preds = %invoke_cont.50.i, %invoke_cont.45.i, %invoke_cont.36.i, %invoke_cont.33.i
- ret void
-}
diff --git a/release_23/test/Transforms/IndVarsSimplify/2004-04-07-ScalarEvolutionCrash.ll b/release_23/test/Transforms/IndVarsSimplify/2004-04-07-ScalarEvolutionCrash.ll
deleted file mode 100644
index b4eb3db19095..000000000000
--- a/release_23/test/Transforms/IndVarsSimplify/2004-04-07-ScalarEvolutionCrash.ll
+++ /dev/null
@@ -1,27 +0,0 @@
-; RUN: llvm-as < %s | opt -indvars -disable-output
-
-define void @.outPlank_21() {
-entry:
- br i1 false, label %loopexit.0, label %no_exit.0
-
-no_exit.0: ; preds = %entry
- ret void
-
-loopexit.0: ; preds = %entry
- br i1 false, label %no_exit.1, label %loopexit.1
-
-no_exit.1: ; preds = %loopexit.2, %loopexit.0
- %i.0.0 = phi i32 [ %inc, %loopexit.2 ], [ 0, %loopexit.0 ] ; <i32> [#uses=1]
- br i1 false, label %loopexit.2, label %no_exit.2
-
-no_exit.2: ; preds = %no_exit.1
- ret void
-
-loopexit.2: ; preds = %no_exit.1
- %inc = add i32 %i.0.0, 1 ; <i32> [#uses=1]
- br i1 false, label %no_exit.1, label %loopexit.1
-
-loopexit.1: ; preds = %loopexit.2, %loopexit.0
- ret void
-}
-
diff --git a/release_23/test/Transforms/IndVarsSimplify/2005-02-11-InvokeCrash.ll b/release_23/test/Transforms/IndVarsSimplify/2005-02-11-InvokeCrash.ll
deleted file mode 100644
index afee7e189180..000000000000
--- a/release_23/test/Transforms/IndVarsSimplify/2005-02-11-InvokeCrash.ll
+++ /dev/null
@@ -1,23 +0,0 @@
-; RUN: llvm-as < %s | opt -indvars -disable-output
-
-define void @_ZN5ArrayISt7complexIdEEC2ERK10dim_vector() {
-entry:
- %tmp.7 = invoke i32 @_ZN5ArrayISt7complexIdEE8get_sizeERK10dim_vector( )
- to label %invoke_cont.0 unwind label %cond_true.1 ; <i32> [#uses=2]
-
-cond_true.1: ; preds = %entry
- unwind
-
-invoke_cont.0: ; preds = %entry
- %tmp.4.i = bitcast i32 %tmp.7 to i32 ; <i32> [#uses=0]
- %tmp.14.0.i5 = add i32 %tmp.7, -1 ; <i32> [#uses=1]
- br label %no_exit.i
-
-no_exit.i: ; preds = %no_exit.i, %invoke_cont.0
- %tmp.14.0.i.0 = phi i32 [ %tmp.14.0.i, %no_exit.i ], [ %tmp.14.0.i5, %invoke_cont.0 ] ; <i32> [#uses=1]
- %tmp.14.0.i = add i32 %tmp.14.0.i.0, -1 ; <i32> [#uses=1]
- br label %no_exit.i
-}
-
-declare i32 @_ZN5ArrayISt7complexIdEE8get_sizeERK10dim_vector()
-
diff --git a/release_23/test/Transforms/IndVarsSimplify/2005-02-17-TruncateExprCrash.ll b/release_23/test/Transforms/IndVarsSimplify/2005-02-17-TruncateExprCrash.ll
deleted file mode 100644
index a1beec646891..000000000000
--- a/release_23/test/Transforms/IndVarsSimplify/2005-02-17-TruncateExprCrash.ll
+++ /dev/null
@@ -1,61 +0,0 @@
-; RUN: llvm-as < %s | opt -indvars -disable-output
-
-declare void @q_atomic_increment()
-
-declare void @_Z9qt_assertPKcS0_i()
-
-define void @_ZN13QMetaResourceC1EPKh() {
-entry:
- invoke void @_Z9qt_assertPKcS0_i( )
- to label %endif.1 unwind label %then.i.i551
-
-then.i.i551: ; preds = %entry
- ret void
-
-endif.1: ; preds = %entry
- br i1 false, label %then.2, label %then.i.i
-
-then.2: ; preds = %endif.1
- invoke void @q_atomic_increment( )
- to label %loopentry.0 unwind label %invoke_catch.6
-
-invoke_catch.6: ; preds = %then.2
- ret void
-
-loopentry.0: ; preds = %then.2
- br i1 false, label %shortcirc_next.i, label %endif.3
-
-endif.3: ; preds = %loopentry.0
- ret void
-
-shortcirc_next.i: ; preds = %loopentry.0
- br i1 false, label %_ZNK7QString2atEi.exit, label %then.i
-
-then.i: ; preds = %shortcirc_next.i
- ret void
-
-_ZNK7QString2atEi.exit: ; preds = %shortcirc_next.i
- br i1 false, label %endif.4, label %then.4
-
-then.4: ; preds = %_ZNK7QString2atEi.exit
- ret void
-
-endif.4: ; preds = %_ZNK7QString2atEi.exit
- %tmp.115 = load i8* null ; <i8> [#uses=1]
- br i1 false, label %loopexit.1, label %no_exit.0
-
-no_exit.0: ; preds = %no_exit.0, %endif.4
- %bytes_in_len.4.5 = phi i8 [ %dec, %no_exit.0 ], [ %tmp.115, %endif.4 ] ; <i8> [#uses=1]
- %off.5.5.in = phi i32 [ %off.5.5, %no_exit.0 ], [ 0, %endif.4 ] ; <i32> [#uses=1]
- %off.5.5 = add i32 %off.5.5.in, 1 ; <i32> [#uses=2]
- %dec = add i8 %bytes_in_len.4.5, -1 ; <i8> [#uses=2]
- %tmp.123631 = icmp eq i8 %dec, 0 ; <i1> [#uses=1]
- br i1 %tmp.123631, label %loopexit.1, label %no_exit.0
-
-loopexit.1: ; preds = %no_exit.0, %endif.4
- %off.5.in.6 = phi i32 [ 0, %endif.4 ], [ %off.5.5, %no_exit.0 ] ; <i32> [#uses=0]
- ret void
-
-then.i.i: ; preds = %endif.1
- ret void
-}
diff --git a/release_23/test/Transforms/IndVarsSimplify/2005-02-26-ExitValueCompute.ll b/release_23/test/Transforms/IndVarsSimplify/2005-02-26-ExitValueCompute.ll
deleted file mode 100644
index 853d5ad50146..000000000000
--- a/release_23/test/Transforms/IndVarsSimplify/2005-02-26-ExitValueCompute.ll
+++ /dev/null
@@ -1,20 +0,0 @@
-; RUN: llvm-as < %s | opt -indvars | llvm-dis | \
-; RUN: grep {ret i32 152}
-
-define i32 @main() {
-entry:
- br label %no_exit
-
-no_exit: ; preds = %no_exit, %entry
- %i.1.0 = phi i32 [ 0, %entry ], [ %inc, %no_exit ] ; <i32> [#uses=2]
- %tmp.4 = icmp sgt i32 %i.1.0, 50 ; <i1> [#uses=1]
- %tmp.7 = select i1 %tmp.4, i32 100, i32 0 ; <i32> [#uses=1]
- %i.0 = add i32 %i.1.0, 1 ; <i32> [#uses=1]
- %inc = add i32 %i.0, %tmp.7 ; <i32> [#uses=3]
- %tmp.1 = icmp slt i32 %inc, 100 ; <i1> [#uses=1]
- br i1 %tmp.1, label %no_exit, label %loopexit
-
-loopexit: ; preds = %no_exit
- ret i32 %inc
-}
-
diff --git a/release_23/test/Transforms/IndVarsSimplify/2005-06-15-InstMoveCrash.ll b/release_23/test/Transforms/IndVarsSimplify/2005-06-15-InstMoveCrash.ll
deleted file mode 100644
index ba4db9f95995..000000000000
--- a/release_23/test/Transforms/IndVarsSimplify/2005-06-15-InstMoveCrash.ll
+++ /dev/null
@@ -1,37 +0,0 @@
-; RUN: llvm-as < %s | opt -indvars -disable-output
-
-define void @main() {
-entry:
- br label %no_exit.1.outer
-
-no_exit.1.outer: ; preds = %endif.0, %entry
- %l_14237116.1.0.ph = phi i8 [ -46, %entry ], [ 0, %endif.0 ] ; <i8> [#uses=1]
- %i.0.0.0.ph = phi i32 [ 0, %entry ], [ %inc.1, %endif.0 ] ; <i32> [#uses=1]
- br label %no_exit.1
-
-no_exit.1: ; preds = %_Z13func_47880058cc.exit, %no_exit.1.outer
- br i1 false, label %_Z13func_47880058cc.exit, label %then.i
-
-then.i: ; preds = %no_exit.1
- br label %_Z13func_47880058cc.exit
-
-_Z13func_47880058cc.exit: ; preds = %then.i, %no_exit.1
- br i1 false, label %then.0, label %no_exit.1
-
-then.0: ; preds = %_Z13func_47880058cc.exit
- %tmp.6 = bitcast i8 %l_14237116.1.0.ph to i8 ; <i8> [#uses=1]
- br i1 false, label %endif.0, label %then.1
-
-then.1: ; preds = %then.0
- br label %endif.0
-
-endif.0: ; preds = %then.1, %then.0
- %inc.1 = add i32 %i.0.0.0.ph, 1 ; <i32> [#uses=2]
- %tmp.2 = icmp sgt i32 %inc.1, 99 ; <i1> [#uses=1]
- br i1 %tmp.2, label %loopexit.0, label %no_exit.1.outer
-
-loopexit.0: ; preds = %endif.0
- %tmp.28 = zext i8 %tmp.6 to i32 ; <i32> [#uses=0]
- ret void
-}
-
diff --git a/release_23/test/Transforms/IndVarsSimplify/2005-11-18-Crash.ll b/release_23/test/Transforms/IndVarsSimplify/2005-11-18-Crash.ll
deleted file mode 100644
index 5ee8cea74a38..000000000000
--- a/release_23/test/Transforms/IndVarsSimplify/2005-11-18-Crash.ll
+++ /dev/null
@@ -1,17 +0,0 @@
-; RUN: llvm-as < %s | opt -indvars -disable-output
-
-@fixtab = external global [29 x [29 x [2 x i32]]] ; <[29 x [29 x [2 x i32]]]*> [#uses=1]
-
-define void @init_optabs() {
-entry:
- br label %no_exit.0
-
-no_exit.0: ; preds = %no_exit.0, %entry
- %p.0.0 = phi i32* [ getelementptr ([29 x [29 x [2 x i32]]]* @fixtab, i32 0, i32 0, i32 0, i32 0), %entry ], [ %inc.0, %no_exit.0 ] ; <i32*> [#uses=1]
- %inc.0 = getelementptr i32* %p.0.0, i32 1 ; <i32*> [#uses=1]
- br i1 false, label %no_exit.0, label %no_exit.1
-
-no_exit.1: ; preds = %no_exit.0
- ret void
-}
-
diff --git a/release_23/test/Transforms/IndVarsSimplify/2006-03-31-NegativeStride.ll b/release_23/test/Transforms/IndVarsSimplify/2006-03-31-NegativeStride.ll
deleted file mode 100644
index 32abee9d1cc8..000000000000
--- a/release_23/test/Transforms/IndVarsSimplify/2006-03-31-NegativeStride.ll
+++ /dev/null
@@ -1,22 +0,0 @@
-; PR726
-; RUN: llvm-as < %s | opt -indvars | llvm-dis | \
-; RUN: grep {ret i32 27}
-
-; Make sure to compute the right exit value based on negative strides.
-
-define i32 @test() {
-entry:
- br label %cond_true
-
-cond_true: ; preds = %cond_true, %entry
- %a.0.0 = phi i32 [ 10, %entry ], [ %tmp4, %cond_true ] ; <i32> [#uses=2]
- %b.0.0 = phi i32 [ 0, %entry ], [ %tmp2, %cond_true ] ; <i32> [#uses=1]
- %tmp2 = add i32 %b.0.0, %a.0.0 ; <i32> [#uses=2]
- %tmp4 = add i32 %a.0.0, -1 ; <i32> [#uses=2]
- %tmp = icmp sgt i32 %tmp4, 7 ; <i1> [#uses=1]
- br i1 %tmp, label %cond_true, label %bb7
-
-bb7: ; preds = %cond_true
- ret i32 %tmp2
-}
-
diff --git a/release_23/test/Transforms/IndVarsSimplify/2006-06-16-Indvar-LCSSA-Crash.ll b/release_23/test/Transforms/IndVarsSimplify/2006-06-16-Indvar-LCSSA-Crash.ll
deleted file mode 100644
index 986831b9a6e4..000000000000
--- a/release_23/test/Transforms/IndVarsSimplify/2006-06-16-Indvar-LCSSA-Crash.ll
+++ /dev/null
@@ -1,22 +0,0 @@
-; RUN: llvm-as < %s | opt -indvars -disable-output
-
-define void @get_block() {
-endif.0:
- br label %no_exit.30
-
-no_exit.30: ; preds = %no_exit.30, %endif.0
- %x.12.0 = phi i32 [ %inc.28, %no_exit.30 ], [ -2, %endif.0 ] ; <i32> [#uses=1]
- %tmp.583 = load i16* null ; <i16> [#uses=1]
- %tmp.584 = zext i16 %tmp.583 to i32 ; <i32> [#uses=1]
- %tmp.588 = load i32* null ; <i32> [#uses=1]
- %tmp.589 = mul i32 %tmp.584, %tmp.588 ; <i32> [#uses=1]
- %tmp.591 = add i32 %tmp.589, 0 ; <i32> [#uses=1]
- %inc.28 = add i32 %x.12.0, 1 ; <i32> [#uses=2]
- %tmp.565 = icmp sgt i32 %inc.28, 3 ; <i1> [#uses=1]
- br i1 %tmp.565, label %loopexit.30, label %no_exit.30
-
-loopexit.30: ; preds = %no_exit.30
- %tmp.591.lcssa = phi i32 [ %tmp.591, %no_exit.30 ] ; <i32> [#uses=0]
- ret void
-}
-
diff --git a/release_23/test/Transforms/IndVarsSimplify/2006-09-20-LFTR-Crash.ll b/release_23/test/Transforms/IndVarsSimplify/2006-09-20-LFTR-Crash.ll
deleted file mode 100644
index 6a478ab5f5fd..000000000000
--- a/release_23/test/Transforms/IndVarsSimplify/2006-09-20-LFTR-Crash.ll
+++ /dev/null
@@ -1,44 +0,0 @@
-; RUN: llvm-as < %s | opt -indvars -disable-output
-; ModuleID = '2006-09-20-LFTR-Crash.ll'
- %struct.p7prior_s = type { i32, i32, [200 x float], [200 x [7 x float]], i32, [200 x float], [200 x [20 x float]], i32, [200 x float], [200 x [20 x float]] }
-
-define void @P7DefaultPrior() {
-entry:
- switch i32 0, label %UnifiedReturnBlock [
- i32 2, label %bb160
- i32 3, label %bb
- ]
-
-bb: ; preds = %entry
- br i1 false, label %cond_true.i, label %sre_malloc.exit
-
-cond_true.i: ; preds = %bb
- unreachable
-
-sre_malloc.exit: ; preds = %bb
- br label %cond_true
-
-cond_true: ; preds = %cond_true66, %cond_true, %sre_malloc.exit
- %tmp59 = phi i32 [ 1, %sre_malloc.exit ], [ %phitmp, %cond_true66 ], [ %tmp59, %cond_true ] ; <i32> [#uses=2]
- %indvar245.0.ph = phi i32 [ 0, %sre_malloc.exit ], [ %indvar.next246, %cond_true66 ], [ %indvar245.0.ph, %cond_true ] ; <i32> [#uses=2]
- br i1 false, label %bb57, label %cond_true
-
-bb57: ; preds = %cond_true
- %tmp65 = icmp sgt i32 0, %tmp59 ; <i1> [#uses=1]
- %indvar.next246 = add i32 %indvar245.0.ph, 1 ; <i32> [#uses=2]
- br i1 %tmp65, label %cond_true66, label %bb69
-
-cond_true66: ; preds = %bb57
- %q.1.0 = bitcast i32 %indvar.next246 to i32 ; <i32> [#uses=1]
- %phitmp = add i32 %q.1.0, 1 ; <i32> [#uses=1]
- br label %cond_true
-
-bb69: ; preds = %bb57
- ret void
-
-bb160: ; preds = %entry
- ret void
-
-UnifiedReturnBlock: ; preds = %entry
- ret void
-}
diff --git a/release_23/test/Transforms/IndVarsSimplify/2006-12-10-BitCast.ll b/release_23/test/Transforms/IndVarsSimplify/2006-12-10-BitCast.ll
deleted file mode 100644
index 903e81d3bf96..000000000000
--- a/release_23/test/Transforms/IndVarsSimplify/2006-12-10-BitCast.ll
+++ /dev/null
@@ -1,33 +0,0 @@
-; RUN: llvm-as < %s | opt -indvars -disable-output
-target datalayout = "e-p:32:32"
-target triple = "i686-apple-darwin8"
- %struct.vorbis_dsp_state = type { i32, %struct.vorbis_info*, float**, float**, i32, i32, i32, i32, i32, i32, i32, i32, i32, i64, i64, i64, i64, i64, i64, i8* }
- %struct.vorbis_info = type { i32, i32, i32, i32, i32, i32, i32, i8* }
-
-define void @_ve_envelope_search() {
-entry:
- br i1 false, label %cond_true27, label %bb137
-
-cond_true27: ; preds = %entry
- br i1 false, label %cond_true52, label %bb80
-
-cond_true52: ; preds = %cond_true27
- %tmp152.i = bitcast float 0.000000e+00 to i32 ; <i32> [#uses=1]
- br label %cond_next182.i
-
-cond_next182.i: ; preds = %cond_next182.i, %cond_true52
- %decay.i.0 = phi i32 [ %tmp195.i.upgrd.1, %cond_next182.i ], [ %tmp152.i, %cond_true52 ] ; <i32> [#uses=1]
- %tmp194.i53 = bitcast i32 %decay.i.0 to float ; <float> [#uses=1]
- %tmp195.i = sub float %tmp194.i53, 8.000000e+00 ; <float> [#uses=1]
- %tmp195.i.upgrd.1 = bitcast float %tmp195.i to i32 ; <i32> [#uses=1]
- br i1 false, label %cond_next182.i, label %bb418.i.preheader
-
-bb418.i.preheader: ; preds = %cond_next182.i
- ret void
-
-bb80: ; preds = %cond_true27
- ret void
-
-bb137: ; preds = %entry
- ret void
-}
diff --git a/release_23/test/Transforms/IndVarsSimplify/2007-01-06-TripCount.ll b/release_23/test/Transforms/IndVarsSimplify/2007-01-06-TripCount.ll
deleted file mode 100644
index dd151e84d00e..000000000000
--- a/release_23/test/Transforms/IndVarsSimplify/2007-01-06-TripCount.ll
+++ /dev/null
@@ -1,38 +0,0 @@
-; PR1015
-; RUN: llvm-as < %s | opt -indvars | llvm-dis | not grep {ret i32 0}
-
-target datalayout = "e-p:32:32"
-target triple = "i686-apple-darwin8"
-@foo = internal constant [5 x i8] c"\00abc\00" ; <[5 x i8]*> [#uses=1]
-@str = internal constant [4 x i8] c"%d\0A\00" ; <[4 x i8]*> [#uses=1]
-
-
-define i32 @test(i32 %J) {
-entry:
- br label %bb2
-
-bb: ; preds = %cond_next, %cond_true
- %tmp1 = add i32 %i.0, 1 ; <i32> [#uses=1]
- br label %bb2
-
-bb2: ; preds = %bb, %entry
- %i.0 = phi i32 [ 0, %entry ], [ %tmp1, %bb ] ; <i32> [#uses=4]
- %tmp = icmp eq i32 %i.0, 0 ; <i1> [#uses=1]
- br i1 %tmp, label %cond_true, label %cond_next
-
-cond_true: ; preds = %bb2
- br label %bb
-
-cond_next: ; preds = %bb2
- %tmp2 = getelementptr [5 x i8]* @foo, i32 0, i32 %i.0 ; <i8*> [#uses=1]
- %tmp3 = load i8* %tmp2 ; <i8> [#uses=1]
- %tmp5 = icmp eq i8 %tmp3, 0 ; <i1> [#uses=1]
- br i1 %tmp5, label %bb6, label %bb
-
-bb6: ; preds = %cond_next
- br label %return
-
-return: ; preds = %bb6
- ret i32 %i.0
-}
-
diff --git a/release_23/test/Transforms/IndVarsSimplify/2007-01-08-X86-64-Pointer.ll b/release_23/test/Transforms/IndVarsSimplify/2007-01-08-X86-64-Pointer.ll
deleted file mode 100644
index f1d018740a60..000000000000
--- a/release_23/test/Transforms/IndVarsSimplify/2007-01-08-X86-64-Pointer.ll
+++ /dev/null
@@ -1,19 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86-64 | grep {(%rdi,%rax,8)}
-; RUN: llvm-as < %s | llc -march=x86-64 | not grep {addq.*8}
-
-define void @foo(double* %y) {
-entry:
- br label %bb
-
-bb:
- %i = phi i64 [ 0, %entry ], [ %k, %bb ]
- %j = getelementptr double* %y, i64 %i
- store double 0.000000e+00, double* %j
- %k = add i64 %i, 1
- %n = icmp eq i64 %k, 0
- br i1 %n, label %return, label %bb
-
-return:
- ret void
-}
-
diff --git a/release_23/test/Transforms/IndVarsSimplify/2007-06-06-DeleteDanglesPtr.ll b/release_23/test/Transforms/IndVarsSimplify/2007-06-06-DeleteDanglesPtr.ll
deleted file mode 100644
index 363c98c493bf..000000000000
--- a/release_23/test/Transforms/IndVarsSimplify/2007-06-06-DeleteDanglesPtr.ll
+++ /dev/null
@@ -1,117 +0,0 @@
-; RUN: llvm-as < %s | opt -indvars -disable-output
-; PR1487
-
- %struct.AVClass = type { i8*, i8* (i8*)*, %struct.AVOption* }
- %struct.AVCodec = type { i8*, i32, i32, i32, i32 (%struct.AVCodecContext*)*, i32 (%struct.AVCodecContext*, i8*, i32, i8*)*, i32 (%struct.AVCodecContext*)*, i32 (%struct.AVCodecContext*, i8*, i32*, i8*, i32)*, i32, %struct.AVCodec*, void (%struct.AVCodecContext*)*, %struct.AVCodecTag*, i32* }
- %struct.AVCodecContext = type { %struct.AVClass*, i32, i32, i32, i32, i32, i8*, i32, %struct.AVCodecTag, i32, i32, i32, i32, i32, void (%struct.AVCodecContext*, %struct.AVFrame*, i32*, i32, i32, i32)*, i32, i32, i32, i32, i32, i32, i32, float, float, i32, i32, i32, i32, float, i32, i32, i32, %struct.AVCodec*, i8*, i32, i32, void (%struct.AVCodecContext*, i8*, i32, i32)*, i32, i32, i32, i32, i32, i32, i32, i32, i32, i8*, [32 x i8], i32, i32, i32, i32, i32, i32, i32, float, i32, i32 (%struct.AVCodecContext*, %struct.AVFrame*)*, void (%struct.AVCodecContext*, %struct.AVFrame*)*, i32, i32, i32, i32, i8*, i8*, float, float, i32, %struct.RcOverride*, i32, i8*, i32, i32, i32, float, float, float, float, i32, float, float, float, float, float, i32, i32, i32, i32*, i32, i32, i32, i32, %struct.AVCodecTag, %struct.AVFrame*, i32, i32, [4 x i64], i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 (%struct.AVCodecContext*, i32*)*, i32, i32, i32, i32, i32, i32, i8*, i32, i32, i32, i32, i32, i32, i16*, i16*, i32, i32, i32, i32, %struct.AVPaletteControl*, i32, i32 (%struct.AVCodecContext*, %struct.AVFrame*)*, i32, i32, i32, i32, i32, i32, i32, i32 (%struct.AVCodecContext*, i32 (%struct.AVCodecContext*, i8*)*, i8**, i32*, i32)*, i8*, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, float, i32, i32, i32, i32, i32, i32, i32, i32, float, i32, i32, i32, i32, i32, i32, float, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i64 }
- %struct.AVCodecTag = type { i32, i32 }
- %struct.AVFrame = type { [4 x i8*], [4 x i32], [4 x i8*], i32, i32, i64, i32, i32, i32, i32, i32, i8*, i32, i8*, [2 x [2 x i16]*], i32*, i8, i8*, [4 x i64], i32, i32, i32, i32, i32, %struct.AVPanScan*, i32, i32, i16*, [2 x i8*] }
- %struct.AVOption = type { i8*, i8*, i32, i32, double, double, double, i32, i8* }
- %struct.AVPaletteControl = type { i32, [256 x i32] }
- %struct.AVPanScan = type { i32, i32, i32, [3 x [2 x i16]] }
- %struct.RcOverride = type { i32, i32, i32, float }
-
-define i32 @smc_decode_frame(%struct.AVCodecContext* %avctx, i8* %data, i32* %data_size, i8* %buf, i32 %buf_size) {
-entry:
- br i1 false, label %cond_next, label %cond_true
-
-cond_true: ; preds = %entry
- ret i32 -1
-
-cond_next: ; preds = %entry
- br i1 false, label %bb.outer5.split.split.split.us, label %cond_true194.split
-
-bb.outer5.split.split.split.us: ; preds = %cond_next
- br i1 false, label %cond_next188.us503.us, label %bb.us481
-
-bb275.us493.us: ; preds = %cond_next188.us503.us, %cond_next188.us503.us
- ret i32 0
-
-cond_next188.us503.us: ; preds = %bb.outer5.split.split.split.us
- switch i32 0, label %bb1401 [
- i32 0, label %cond_next202.bb215_crit_edge.split
- i32 16, label %bb215
- i32 32, label %bb275.us493.us
- i32 48, label %bb275.us493.us
- i32 64, label %cond_next202.bb417_crit_edge.split
- i32 80, label %bb417
- i32 96, label %cond_next202.bb615_crit_edge.split
- i32 112, label %bb615
- i32 128, label %cond_next202.bb716_crit_edge.split
- i32 144, label %bb716
- i32 160, label %cond_next202.bb882_crit_edge.split
- i32 176, label %bb882
- i32 192, label %cond_next202.bb1062_crit_edge.split
- i32 208, label %bb1062
- i32 224, label %bb1326.us.outer.outer
- ]
-
-bb.us481: ; preds = %bb.outer5.split.split.split.us
- ret i32 0
-
-cond_true194.split: ; preds = %cond_next
- ret i32 %buf_size
-
-cond_next202.bb1062_crit_edge.split: ; preds = %cond_next188.us503.us
- ret i32 0
-
-cond_next202.bb882_crit_edge.split: ; preds = %cond_next188.us503.us
- ret i32 0
-
-cond_next202.bb716_crit_edge.split: ; preds = %cond_next188.us503.us
- ret i32 0
-
-cond_next202.bb615_crit_edge.split: ; preds = %cond_next188.us503.us
- ret i32 0
-
-cond_next202.bb417_crit_edge.split: ; preds = %cond_next188.us503.us
- ret i32 0
-
-cond_next202.bb215_crit_edge.split: ; preds = %cond_next188.us503.us
- ret i32 0
-
-bb215: ; preds = %cond_next188.us503.us
- ret i32 0
-
-bb417: ; preds = %cond_next188.us503.us
- ret i32 0
-
-bb615: ; preds = %cond_next188.us503.us
- ret i32 0
-
-bb716: ; preds = %cond_next188.us503.us
- ret i32 0
-
-bb882: ; preds = %cond_next188.us503.us
- ret i32 0
-
-bb1062: ; preds = %cond_next188.us503.us
- ret i32 0
-
-bb1326.us: ; preds = %bb1326.us.outer.outer, %bb1347.loopexit.us, %bb1326.us
- %pixel_y.162036.us.ph = phi i32 [ %tmp1352.us, %bb1347.loopexit.us ], [ 0, %bb1326.us.outer.outer ], [ %pixel_y.162036.us.ph, %bb1326.us ] ; <i32> [#uses=2]
- %stream_ptr.142038.us.ph = phi i32 [ %tmp1339.us, %bb1347.loopexit.us ], [ %stream_ptr.142038.us.ph.ph, %bb1326.us.outer.outer ], [ %stream_ptr.142038.us.ph, %bb1326.us ] ; <i32> [#uses=2]
- %pixel_x.232031.us = phi i32 [ %tmp1341.us, %bb1326.us ], [ 0, %bb1326.us.outer.outer ], [ 0, %bb1347.loopexit.us ] ; <i32> [#uses=3]
- %block_ptr.222030.us = add i32 0, %pixel_x.232031.us ; <i32> [#uses=1]
- %stream_ptr.132032.us = add i32 %pixel_x.232031.us, %stream_ptr.142038.us.ph ; <i32> [#uses=1]
- %tmp1341.us = add i32 %pixel_x.232031.us, 1 ; <i32> [#uses=2]
- %tmp1344.us = icmp slt i32 %tmp1341.us, 4 ; <i1> [#uses=1]
- br i1 %tmp1344.us, label %bb1326.us, label %bb1347.loopexit.us
-
-bb1347.loopexit.us: ; preds = %bb1326.us
- %tmp1339.us = add i32 %stream_ptr.132032.us, 1 ; <i32> [#uses=2]
- %tmp1337.us = add i32 %block_ptr.222030.us, 1 ; <i32> [#uses=0]
- %tmp1352.us = add i32 %pixel_y.162036.us.ph, 1 ; <i32> [#uses=2]
- %tmp1355.us = icmp slt i32 %tmp1352.us, 4 ; <i1> [#uses=1]
- br i1 %tmp1355.us, label %bb1326.us, label %bb1358
-
-bb1358: ; preds = %bb1347.loopexit.us
- br label %bb1326.us.outer.outer
-
-bb1326.us.outer.outer: ; preds = %bb1358, %cond_next188.us503.us
- %stream_ptr.142038.us.ph.ph = phi i32 [ %tmp1339.us, %bb1358 ], [ 0, %cond_next188.us503.us ] ; <i32> [#uses=1]
- br label %bb1326.us
-
-bb1401: ; preds = %cond_next188.us503.us
- ret i32 0
-}
diff --git a/release_23/test/Transforms/IndVarsSimplify/2007-11-23-BitcastCrash.ll b/release_23/test/Transforms/IndVarsSimplify/2007-11-23-BitcastCrash.ll
deleted file mode 100644
index 555cadda6de3..000000000000
--- a/release_23/test/Transforms/IndVarsSimplify/2007-11-23-BitcastCrash.ll
+++ /dev/null
@@ -1,20 +0,0 @@
-; RUN: llvm-as < %s | opt -indvars -disable-output
-; PR1814
-target datalayout = "e-p:32:32-f64:32:64-i64:32:64-f80:32:32"
-
-define void @FuncAt1938470480(i32, i32, i32, i32, i32, i32, i32, i32, i64, i64, i64, i64, i64, i64, i64, i64, i1, i1, i1, i1, i1, i1) {
-EntryBlock:
- br label %asmBlockAt738ab7f3
-
-asmBlockAt738ab9b0: ; preds = %asmBlockAt738ab7f3
- %.lcssa6 = phi i64 [ %23, %asmBlockAt738ab7f3 ] ; <i64> [#uses=0]
- ret void
-
-asmBlockAt738ab7f3: ; preds = %asmBlockAt738ab7f3, %EntryBlock
- %ebp95 = phi i32 [ 128, %EntryBlock ], [ %24, %asmBlockAt738ab7f3 ] ; <i32> [#uses=2]
- sub <4 x i16> zeroinitializer, zeroinitializer ; <<4 x i16>>:22 [#uses=1]
- bitcast <4 x i16> %22 to i64 ; <i64>:23 [#uses=1]
- add i32 %ebp95, -64 ; <i32>:24 [#uses=1]
- icmp ult i32 %ebp95, 64 ; <i1>:25 [#uses=1]
- br i1 %25, label %asmBlockAt738ab9b0, label %asmBlockAt738ab7f3
-}
diff --git a/release_23/test/Transforms/IndVarsSimplify/complex-scev.ll b/release_23/test/Transforms/IndVarsSimplify/complex-scev.ll
deleted file mode 100644
index 4bfc4e981af5..000000000000
--- a/release_23/test/Transforms/IndVarsSimplify/complex-scev.ll
+++ /dev/null
@@ -1,29 +0,0 @@
-; The i induction variable looks like a wrap-around, but it really is just
-; a simple affine IV. Make sure that indvars eliminates it.
-
-; RUN: llvm-as < %s | opt -indvars | llvm-dis | grep phi | count 1
-
-define void @foo() {
-entry:
- br label %bb6
-
-bb6: ; preds = %cond_true, %entry
- %j.0 = phi i32 [ 1, %entry ], [ %tmp5, %cond_true ] ; <i32> [#uses=3]
- %i.0 = phi i32 [ 0, %entry ], [ %j.0, %cond_true ] ; <i32> [#uses=1]
- %tmp7 = call i32 (...)* @foo2( ) ; <i32> [#uses=1]
- %tmp = icmp ne i32 %tmp7, 0 ; <i1> [#uses=1]
- br i1 %tmp, label %cond_true, label %return
-
-cond_true: ; preds = %bb6
- %tmp2 = call i32 (...)* @bar( i32 %i.0, i32 %j.0 ) ; <i32> [#uses=0]
- %tmp5 = add i32 %j.0, 1 ; <i32> [#uses=1]
- br label %bb6
-
-return: ; preds = %bb6
- ret void
-}
-
-declare i32 @bar(...)
-
-declare i32 @foo2(...)
-
diff --git a/release_23/test/Transforms/IndVarsSimplify/dg.exp b/release_23/test/Transforms/IndVarsSimplify/dg.exp
deleted file mode 100644
index 879685ca879d..000000000000
--- a/release_23/test/Transforms/IndVarsSimplify/dg.exp
+++ /dev/null
@@ -1,3 +0,0 @@
-load_lib llvm.exp
-
-RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
diff --git a/release_23/test/Transforms/IndVarsSimplify/exit_value_tests.ll b/release_23/test/Transforms/IndVarsSimplify/exit_value_tests.ll
deleted file mode 100644
index 5e26ea22d983..000000000000
--- a/release_23/test/Transforms/IndVarsSimplify/exit_value_tests.ll
+++ /dev/null
@@ -1,114 +0,0 @@
-; Test that we can evaluate the exit values of various expression types. Since
-; these loops all have predictable exit values we can replace the use outside
-; of the loop with a closed-form computation, making the loop dead.
-;
-; RUN: llvm-as < %s | opt -indvars -adce -simplifycfg | \
-; RUN: llvm-dis | not grep br
-
-define i32 @polynomial_constant() {
-; <label>:0
- br label %Loop
-
-Loop: ; preds = %Loop, %0
- %A1 = phi i32 [ 0, %0 ], [ %A2, %Loop ] ; <i32> [#uses=3]
- %B1 = phi i32 [ 0, %0 ], [ %B2, %Loop ] ; <i32> [#uses=1]
- %A2 = add i32 %A1, 1 ; <i32> [#uses=1]
- %B2 = add i32 %B1, %A1 ; <i32> [#uses=2]
- %C = icmp eq i32 %A1, 1000 ; <i1> [#uses=1]
- br i1 %C, label %Out, label %Loop
-
-Out: ; preds = %Loop
- ret i32 %B2
-}
-
-define i32 @NSquare(i32 %N) {
-; <label>:0
- br label %Loop
-
-Loop: ; preds = %Loop, %0
- %X = phi i32 [ 0, %0 ], [ %X2, %Loop ] ; <i32> [#uses=4]
- %X2 = add i32 %X, 1 ; <i32> [#uses=1]
- %c = icmp eq i32 %X, %N ; <i1> [#uses=1]
- br i1 %c, label %Out, label %Loop
-
-Out: ; preds = %Loop
- %Y = mul i32 %X, %X ; <i32> [#uses=1]
- ret i32 %Y
-}
-
-define i32 @NSquareOver2(i32 %N) {
-; <label>:0
- br label %Loop
-
-Loop: ; preds = %Loop, %0
- %X = phi i32 [ 0, %0 ], [ %X2, %Loop ] ; <i32> [#uses=3]
- %Y = phi i32 [ 15, %0 ], [ %Y2, %Loop ] ; <i32> [#uses=1]
- %Y2 = add i32 %Y, %X ; <i32> [#uses=2]
- %X2 = add i32 %X, 1 ; <i32> [#uses=1]
- %c = icmp eq i32 %X, %N ; <i1> [#uses=1]
- br i1 %c, label %Out, label %Loop
-
-Out: ; preds = %Loop
- ret i32 %Y2
-}
-
-define i32 @strength_reduced() {
-; <label>:0
- br label %Loop
-
-Loop: ; preds = %Loop, %0
- %A1 = phi i32 [ 0, %0 ], [ %A2, %Loop ] ; <i32> [#uses=3]
- %B1 = phi i32 [ 0, %0 ], [ %B2, %Loop ] ; <i32> [#uses=1]
- %A2 = add i32 %A1, 1 ; <i32> [#uses=1]
- %B2 = add i32 %B1, %A1 ; <i32> [#uses=2]
- %C = icmp eq i32 %A1, 1000 ; <i1> [#uses=1]
- br i1 %C, label %Out, label %Loop
-
-Out: ; preds = %Loop
- ret i32 %B2
-}
-
-define i32 @chrec_equals() {
-entry:
- br label %no_exit
-
-no_exit: ; preds = %no_exit, %entry
- %i0 = phi i32 [ 0, %entry ], [ %i1, %no_exit ] ; <i32> [#uses=3]
- %ISq = mul i32 %i0, %i0 ; <i32> [#uses=1]
- %i1 = add i32 %i0, 1 ; <i32> [#uses=2]
- %tmp.1 = icmp ne i32 %ISq, 10000 ; <i1> [#uses=1]
- br i1 %tmp.1, label %no_exit, label %loopexit
-
-loopexit: ; preds = %no_exit
- ret i32 %i1
-}
-
-define i16 @cast_chrec_test() {
-; <label>:0
- br label %Loop
-
-Loop: ; preds = %Loop, %0
- %A1 = phi i32 [ 0, %0 ], [ %A2, %Loop ] ; <i32> [#uses=2]
- %B1 = trunc i32 %A1 to i16 ; <i16> [#uses=2]
- %A2 = add i32 %A1, 1 ; <i32> [#uses=1]
- %C = icmp eq i16 %B1, 1000 ; <i1> [#uses=1]
- br i1 %C, label %Out, label %Loop
-
-Out: ; preds = %Loop
- ret i16 %B1
-}
-
-define i32 @linear_div_fold() {
-entry:
- br label %loop
-
-loop: ; preds = %loop, %entry
- %i = phi i32 [ 4, %entry ], [ %i.next, %loop ] ; <i32> [#uses=3]
- %i.next = add i32 %i, 8 ; <i32> [#uses=1]
- %RV = udiv i32 %i, 2 ; <i32> [#uses=1]
- %c = icmp ne i32 %i, 68 ; <i1> [#uses=1]
- br i1 %c, label %loop, label %loopexit
-
-loopexit: ; preds = %loop
- ret i32 %RV
-}
diff --git a/release_23/test/Transforms/IndVarsSimplify/iterationCount_zext_or_trunc.ll b/release_23/test/Transforms/IndVarsSimplify/iterationCount_zext_or_trunc.ll
deleted file mode 100644
index 747c781e993f..000000000000
--- a/release_23/test/Transforms/IndVarsSimplify/iterationCount_zext_or_trunc.ll
+++ /dev/null
@@ -1,25 +0,0 @@
-; RUN: llvm-as < %s | opt -indvars -disable-output
-
-; ModuleID = 'testcase.bc'
-target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64"
-target triple = "i686-pc-linux-gnu"
-
-define i32 @testcase(i5 zeroext %k) {
-entry:
- br label %bb2
-
-bb: ; preds = %bb2
- %tmp1 = add i32 %tmp2, %result ; <i32> [#uses=1]
- %indvar_next1 = add i5 %k_0, 1 ; <i5> [#uses=1]
- br label %bb2
-
-bb2: ; preds = %bb, %entry
- %k_0 = phi i5 [ 0, %entry ], [ %indvar_next1, %bb ] ; <i5> [#uses=2]
- %result = phi i32 [ 0, %entry ], [ %tmp1, %bb ] ; <i32> [#uses=2]
- %tmp2 = zext i5 %k_0 to i32 ; <i32> [#uses=1]
- %exitcond = icmp eq i32 %tmp2, 16 ; <i1> [#uses=1]
- br i1 %exitcond, label %bb3, label %bb
-
-bb3: ; preds = %bb2
- ret i32 %result
-}
diff --git a/release_23/test/Transforms/IndVarsSimplify/lftr_simple.ll b/release_23/test/Transforms/IndVarsSimplify/lftr_simple.ll
deleted file mode 100644
index 3f7c289a4885..000000000000
--- a/release_23/test/Transforms/IndVarsSimplify/lftr_simple.ll
+++ /dev/null
@@ -1,22 +0,0 @@
-; LFTR should eliminate the need for the computation of i*i completely. It
-; is only used to compute the exit value.
-; RUN: llvm-as < %s | opt -indvars -dce | llvm-dis | not grep mul
-
-@A = external global i32 ; <i32*> [#uses=1]
-
-define i32 @quadratic_setlt() {
-entry:
- br label %loop
-
-loop: ; preds = %loop, %entry
- %i = phi i32 [ 7, %entry ], [ %i.next, %loop ] ; <i32> [#uses=5]
- %i.next = add i32 %i, 1 ; <i32> [#uses=1]
- store i32 %i, i32* @A
- %i2 = mul i32 %i, %i ; <i32> [#uses=1]
- %c = icmp slt i32 %i2, 1000 ; <i1> [#uses=1]
- br i1 %c, label %loop, label %loopexit
-
-loopexit: ; preds = %loop
- ret i32 %i
-}
-
diff --git a/release_23/test/Transforms/IndVarsSimplify/loop_evaluate_1.ll b/release_23/test/Transforms/IndVarsSimplify/loop_evaluate_1.ll
deleted file mode 100644
index ffff30ae405a..000000000000
--- a/release_23/test/Transforms/IndVarsSimplify/loop_evaluate_1.ll
+++ /dev/null
@@ -1,21 +0,0 @@
-; RUN: llvm-as < %s | opt -indvars -adce -simplifycfg | llvm-dis | not grep br
-;
-; Testcase distilled from 256.bzip2
-
-define i32 @main() {
-entry:
- br label %loopentry
-
-loopentry: ; preds = %loopentry, %entry
- %indvar1 = phi i32 [ 0, %entry ], [ %indvar.next2, %loopentry ] ; <i32> [#uses=1]
- %h.0 = phi i32 [ %tmp.2, %loopentry ], [ 4, %entry ] ; <i32> [#uses=1]
- %tmp.1 = mul i32 %h.0, 3 ; <i32> [#uses=1]
- %tmp.2 = add i32 %tmp.1, 1 ; <i32> [#uses=2]
- %indvar.next2 = add i32 %indvar1, 1 ; <i32> [#uses=2]
- %exitcond3 = icmp ne i32 %indvar.next2, 4 ; <i1> [#uses=1]
- br i1 %exitcond3, label %loopentry, label %loopexit
-
-loopexit: ; preds = %loopentry
- ret i32 %tmp.2
-}
-
diff --git a/release_23/test/Transforms/IndVarsSimplify/loop_evaluate_2.ll b/release_23/test/Transforms/IndVarsSimplify/loop_evaluate_2.ll
deleted file mode 100644
index 635950aed661..000000000000
--- a/release_23/test/Transforms/IndVarsSimplify/loop_evaluate_2.ll
+++ /dev/null
@@ -1,28 +0,0 @@
-; RUN: llvm-as < %s | opt -indvars -adce -simplifycfg | opt \
-; RUN: -analyze -loops | not grep "^Loop Containing"
-; PR1179
-
-define i32 @ltst(i32 %x) {
-entry:
- icmp sgt i32 %x, 0 ; <i1>:0 [#uses=1]
- br i1 %0, label %bb.preheader, label %bb8
-
-bb.preheader: ; preds = %entry
- br label %bb
-
-bb: ; preds = %bb, %bb.preheader
- %i.01.0 = phi i32 [ %tmp4, %bb ], [ 0, %bb.preheader ] ; <i32> [#uses=1]
- %j.03.0 = phi i32 [ %tmp2, %bb ], [ 0, %bb.preheader ] ; <i32> [#uses=1]
- %tmp4 = add i32 %i.01.0, 1 ; <i32> [#uses=2]
- %tmp2 = add i32 %j.03.0, 1 ; <i32> [#uses=2]
- icmp slt i32 %tmp4, %x ; <i1>:1 [#uses=1]
- br i1 %1, label %bb, label %bb8.loopexit
-
-bb8.loopexit: ; preds = %bb
- br label %bb8
-
-bb8: ; preds = %bb8.loopexit, %entry
- %j.03.1 = phi i32 [ 0, %entry ], [ %tmp2, %bb8.loopexit ] ; <i32> [#uses=1]
- ret i32 %j.03.1
-}
-
diff --git a/release_23/test/Transforms/IndVarsSimplify/loop_evaluate_3.ll b/release_23/test/Transforms/IndVarsSimplify/loop_evaluate_3.ll
deleted file mode 100644
index 2a2f69dd4866..000000000000
--- a/release_23/test/Transforms/IndVarsSimplify/loop_evaluate_3.ll
+++ /dev/null
@@ -1,19 +0,0 @@
-; RUN: llvm-as < %s | opt -indvars | llvm-dis | grep {ret i32 600000}
-; PR1179
-
-define i32 @foo() {
-entry:
- br label %bb5
-
-bb5: ; preds = %bb5, %entry
- %i.01.0 = phi i32 [ 0, %entry ], [ %tmp2, %bb5 ] ; <i32> [#uses=1]
- %x.03.0 = phi i32 [ 0, %entry ], [ %tmp4, %bb5 ] ; <i32> [#uses=1]
- %tmp2 = add i32 %i.01.0, 3 ; <i32> [#uses=2]
- %tmp4 = add i32 %x.03.0, 1 ; <i32> [#uses=2]
- icmp slt i32 %tmp4, 200000 ; <i1>:0 [#uses=1]
- br i1 %0, label %bb5, label %bb7
-
-bb7: ; preds = %bb5
- ret i32 %tmp2
-}
-
diff --git a/release_23/test/Transforms/IndVarsSimplify/loop_evaluate_4.ll b/release_23/test/Transforms/IndVarsSimplify/loop_evaluate_4.ll
deleted file mode 100644
index 6c6a362f48e6..000000000000
--- a/release_23/test/Transforms/IndVarsSimplify/loop_evaluate_4.ll
+++ /dev/null
@@ -1,20 +0,0 @@
-; RUN: llvm-as < %s | opt -indvars | llvm-dis | grep {ret i32 9900}
-; PR1179
-
-define i32 @test4() {
-entry:
- br label %bb7
-
-bb7: ; preds = %bb7, %entry
- %v.01.0 = phi i32 [ 0, %entry ], [ %tmp4, %bb7 ] ; <i32> [#uses=1]
- %i.03.0 = phi i32 [ 0, %entry ], [ %tmp6, %bb7 ] ; <i32> [#uses=2]
- %tmp2 = shl i32 %i.03.0, 1 ; <i32> [#uses=1]
- %tmp4 = add i32 %tmp2, %v.01.0 ; <i32> [#uses=2]
- %tmp6 = add i32 %i.03.0, 1 ; <i32> [#uses=2]
- icmp slt i32 %tmp6, 100 ; <i1>:0 [#uses=1]
- br i1 %0, label %bb7, label %bb9
-
-bb9: ; preds = %bb7
- ret i32 %tmp4
-}
-
diff --git a/release_23/test/Transforms/IndVarsSimplify/pointer-indvars.ll b/release_23/test/Transforms/IndVarsSimplify/pointer-indvars.ll
deleted file mode 100644
index c9da1579e983..000000000000
--- a/release_23/test/Transforms/IndVarsSimplify/pointer-indvars.ll
+++ /dev/null
@@ -1,15 +0,0 @@
-; RUN: llvm-as < %s | opt -indvars | llvm-dis | grep indvar
-@G = global i32* null ; <i32**> [#uses=1]
-@Array = external global [40 x i32] ; <[40 x i32]*> [#uses=1]
-
-define void @test() {
-; <label>:0
- br label %Loop
-
-Loop: ; preds = %Loop, %0
- %X = phi i32* [ getelementptr ([40 x i32]* @Array, i64 0, i64 0), %0 ], [ %X.next, %Loop ] ; <i32*> [#uses=2]
- %X.next = getelementptr i32* %X, i64 1 ; <i32*> [#uses=1]
- store i32* %X, i32** @G
- br label %Loop
-}
-
diff --git a/release_23/test/Transforms/IndVarsSimplify/subtract.ll b/release_23/test/Transforms/IndVarsSimplify/subtract.ll
deleted file mode 100644
index 51065cc1a8a3..000000000000
--- a/release_23/test/Transforms/IndVarsSimplify/subtract.ll
+++ /dev/null
@@ -1,15 +0,0 @@
-; RUN: llvm-as < %s | opt -indvars | llvm-dis | grep indvar
-
-@G = global i64 0 ; <i64*> [#uses=1]
-
-define void @test(i64 %V) {
-; <label>:0
- br label %Loop
-
-Loop: ; preds = %Loop, %0
- %X = phi i64 [ 1, %0 ], [ %X.next, %Loop ] ; <i64> [#uses=2]
- %X.next = sub i64 %X, %V ; <i64> [#uses=1]
- store i64 %X, i64* @G
- br label %Loop
-}
-
diff --git a/release_23/test/Transforms/IndVarsSimplify/tripcount_compute.ll b/release_23/test/Transforms/IndVarsSimplify/tripcount_compute.ll
deleted file mode 100644
index 1abc82d635c3..000000000000
--- a/release_23/test/Transforms/IndVarsSimplify/tripcount_compute.ll
+++ /dev/null
@@ -1,100 +0,0 @@
-; These tests ensure that we can compute the trip count of various forms of
-; loops. If the trip count of the loop is computable, then we will know what
-; the exit value of the loop will be for some value, allowing us to substitute
-; it directly into users outside of the loop, making the loop dead.
-;
-; RUN: llvm-as < %s | opt -indvars -adce -simplifycfg | llvm-dis | not grep br
-
-define i32 @linear_setne() {
-entry:
- br label %loop
-
-loop: ; preds = %loop, %entry
- %i = phi i32 [ 0, %entry ], [ %i.next, %loop ] ; <i32> [#uses=3]
- %i.next = add i32 %i, 1 ; <i32> [#uses=1]
- %c = icmp ne i32 %i, 100 ; <i1> [#uses=1]
- br i1 %c, label %loop, label %loopexit
-
-loopexit: ; preds = %loop
- ret i32 %i
-}
-
-define i32 @linear_setne_2() {
-entry:
- br label %loop
-
-loop: ; preds = %loop, %entry
- %i = phi i32 [ 0, %entry ], [ %i.next, %loop ] ; <i32> [#uses=3]
- %i.next = add i32 %i, 2 ; <i32> [#uses=1]
- %c = icmp ne i32 %i, 100 ; <i1> [#uses=1]
- br i1 %c, label %loop, label %loopexit
-
-loopexit: ; preds = %loop
- ret i32 %i
-}
-
-define i32 @linear_setne_overflow() {
-entry:
- br label %loop
-
-loop: ; preds = %loop, %entry
- %i = phi i32 [ 1024, %entry ], [ %i.next, %loop ] ; <i32> [#uses=3]
- %i.next = add i32 %i, 1024 ; <i32> [#uses=1]
- %c = icmp ne i32 %i, 0 ; <i1> [#uses=1]
- br i1 %c, label %loop, label %loopexit
-
-loopexit: ; preds = %loop
- ret i32 %i
-}
-
-define i32 @linear_setlt() {
-entry:
- br label %loop
-
-loop: ; preds = %loop, %entry
- %i = phi i32 [ 0, %entry ], [ %i.next, %loop ] ; <i32> [#uses=3]
- %i.next = add i32 %i, 1 ; <i32> [#uses=1]
- %c = icmp slt i32 %i, 100 ; <i1> [#uses=1]
- br i1 %c, label %loop, label %loopexit
-
-loopexit: ; preds = %loop
- ret i32 %i
-}
-
-define i32 @quadratic_setlt() {
-entry:
- br label %loop
-
-loop: ; preds = %loop, %entry
- %i = phi i32 [ 7, %entry ], [ %i.next, %loop ] ; <i32> [#uses=4]
- %i.next = add i32 %i, 3 ; <i32> [#uses=1]
- %i2 = mul i32 %i, %i ; <i32> [#uses=1]
- %c = icmp slt i32 %i2, 1000 ; <i1> [#uses=1]
- br i1 %c, label %loop, label %loopexit
-
-loopexit: ; preds = %loop
- ret i32 %i
-}
-
-define i32 @chained() {
-entry:
- br label %loop
-
-loop: ; preds = %loop, %entry
- %i = phi i32 [ 0, %entry ], [ %i.next, %loop ] ; <i32> [#uses=3]
- %i.next = add i32 %i, 1 ; <i32> [#uses=1]
- %c = icmp ne i32 %i, 100 ; <i1> [#uses=1]
- br i1 %c, label %loop, label %loopexit
-
-loopexit: ; preds = %loop
- br label %loop2
-
-loop2: ; preds = %loop2, %loopexit
- %j = phi i32 [ %i, %loopexit ], [ %j.next, %loop2 ] ; <i32> [#uses=3]
- %j.next = add i32 %j, 1 ; <i32> [#uses=1]
- %c2 = icmp ne i32 %j, 200 ; <i1> [#uses=1]
- br i1 %c2, label %loop2, label %loopexit2
-
-loopexit2: ; preds = %loop2
- ret i32 %j
-}
diff --git a/release_23/test/Transforms/IndVarsSimplify/tripcount_infinite.ll b/release_23/test/Transforms/IndVarsSimplify/tripcount_infinite.ll
deleted file mode 100644
index d5965f4ed6f0..000000000000
--- a/release_23/test/Transforms/IndVarsSimplify/tripcount_infinite.ll
+++ /dev/null
@@ -1,38 +0,0 @@
-; These tests have an infinite trip count. We obviously shouldn't remove the
-; loops! :)
-;
-; RUN: llvm-as < %s | opt -indvars -adce -simplifycfg | llvm-dis | grep icmp | wc -l > %t2
-; RUN: llvm-as < %s | llvm-dis | grep icmp | wc -l > %t1
-; RUN: diff %t1 %t2
-
-;; test for (i = 1; i != 100; i += 2)
-define i32 @infinite_linear() {
-entry:
- br label %loop
-
-loop: ; preds = %loop, %entry
- %i = phi i32 [ 1, %entry ], [ %i.next, %loop ] ; <i32> [#uses=3]
- %i.next = add i32 %i, 2 ; <i32> [#uses=1]
- %c = icmp ne i32 %i, 100 ; <i1> [#uses=1]
- br i1 %c, label %loop, label %loopexit
-
-loopexit: ; preds = %loop
- ret i32 %i
-}
-
-;; test for (i = 1; i*i != 63; ++i)
-define i32 @infinite_quadratic() {
-entry:
- br label %loop
-
-loop: ; preds = %loop, %entry
- %i = phi i32 [ 1, %entry ], [ %i.next, %loop ] ; <i32> [#uses=4]
- %isquare = mul i32 %i, %i ; <i32> [#uses=1]
- %i.next = add i32 %i, 1 ; <i32> [#uses=1]
- %c = icmp ne i32 %isquare, 63 ; <i1> [#uses=1]
- br i1 %c, label %loop, label %loopexit
-
-loopexit: ; preds = %loop
- ret i32 %i
-}
-
diff --git a/release_23/test/Transforms/IndVarsSimplify/variable-stride-ivs.ll b/release_23/test/Transforms/IndVarsSimplify/variable-stride-ivs.ll
deleted file mode 100644
index 759ba8e177bc..000000000000
--- a/release_23/test/Transforms/IndVarsSimplify/variable-stride-ivs.ll
+++ /dev/null
@@ -1,43 +0,0 @@
-; RUN: llvm-as < %s | opt -indvars -instcombine | llvm-dis | \
-; RUN: grep {store i32 0}
-; Test that -indvars can reduce variable stride IVs. If it can reduce variable
-; stride iv's, it will make %iv. and %m.0.0 isomorphic to each other without
-; cycles, allowing the tmp.21 subtraction to be eliminated.
-; END.
-
-define void @vnum_test8(i32* %data) {
-entry:
- %tmp.1 = getelementptr i32* %data, i32 3 ; <i32*> [#uses=1]
- %tmp.2 = load i32* %tmp.1 ; <i32> [#uses=2]
- %tmp.4 = getelementptr i32* %data, i32 4 ; <i32*> [#uses=1]
- %tmp.5 = load i32* %tmp.4 ; <i32> [#uses=2]
- %tmp.8 = getelementptr i32* %data, i32 2 ; <i32*> [#uses=1]
- %tmp.9 = load i32* %tmp.8 ; <i32> [#uses=3]
- %tmp.125 = icmp sgt i32 %tmp.2, 0 ; <i1> [#uses=1]
- br i1 %tmp.125, label %no_exit.preheader, label %return
-
-no_exit.preheader: ; preds = %entry
- %tmp.16 = getelementptr i32* %data, i32 %tmp.9 ; <i32*> [#uses=1]
- br label %no_exit
-
-no_exit: ; preds = %no_exit, %no_exit.preheader
- %iv.ui = phi i32 [ 0, %no_exit.preheader ], [ %iv..inc.ui, %no_exit ] ; <i32> [#uses=1]
- %iv. = phi i32 [ %tmp.5, %no_exit.preheader ], [ %iv..inc, %no_exit ] ; <i32> [#uses=2]
- %m.0.0 = phi i32 [ %tmp.5, %no_exit.preheader ], [ %tmp.24, %no_exit ] ; <i32> [#uses=2]
- store i32 2, i32* %tmp.16
- %tmp.21 = sub i32 %m.0.0, %iv. ; <i32> [#uses=1]
- store i32 %tmp.21, i32* %data
- %tmp.24 = add i32 %m.0.0, %tmp.9 ; <i32> [#uses=1]
- %iv..inc = add i32 %tmp.9, %iv. ; <i32> [#uses=1]
- %iv..inc.ui = add i32 %iv.ui, 1 ; <i32> [#uses=2]
- %iv..inc1 = bitcast i32 %iv..inc.ui to i32 ; <i32> [#uses=1]
- %tmp.12 = icmp slt i32 %iv..inc1, %tmp.2 ; <i1> [#uses=1]
- br i1 %tmp.12, label %no_exit, label %return.loopexit
-
-return.loopexit: ; preds = %no_exit
- br label %return
-
-return: ; preds = %return.loopexit, %entry
- ret void
-}
-
diff --git a/release_23/test/Transforms/Inline/2003-09-14-InlineValue.ll b/release_23/test/Transforms/Inline/2003-09-14-InlineValue.ll
deleted file mode 100644
index edc9b474e064..000000000000
--- a/release_23/test/Transforms/Inline/2003-09-14-InlineValue.ll
+++ /dev/null
@@ -1,21 +0,0 @@
-; RUN: llvm-as < %s | opt -inline -disable-output
-
-declare i32 @External()
-
-define internal i32 @Callee() {
- %I = call i32 @External( ) ; <i32> [#uses=2]
- %J = add i32 %I, %I ; <i32> [#uses=1]
- ret i32 %J
-}
-
-define i32 @Caller() {
- %V = invoke i32 @Callee( )
- to label %Ok unwind label %Bad ; <i32> [#uses=1]
-
-Ok: ; preds = %0
- ret i32 %V
-
-Bad: ; preds = %0
- ret i32 0
-}
-
diff --git a/release_23/test/Transforms/Inline/2003-09-22-PHINodeInlineFail.ll b/release_23/test/Transforms/Inline/2003-09-22-PHINodeInlineFail.ll
deleted file mode 100644
index d57aee01c609..000000000000
--- a/release_23/test/Transforms/Inline/2003-09-22-PHINodeInlineFail.ll
+++ /dev/null
@@ -1,16 +0,0 @@
-; RUN: llvm-as < %s | opt -inline -disable-output
-
-define i32 @main() {
-entry:
- invoke void @__main( )
- to label %LongJmpBlkPre unwind label %LongJmpBlkPre
-
-LongJmpBlkPre: ; preds = %entry, %entry
- %i.3 = phi i32 [ 0, %entry ], [ 0, %entry ] ; <i32> [#uses=0]
- ret i32 0
-}
-
-define void @__main() {
- ret void
-}
-
diff --git a/release_23/test/Transforms/Inline/2003-09-22-PHINodesInExceptionDest.ll b/release_23/test/Transforms/Inline/2003-09-22-PHINodesInExceptionDest.ll
deleted file mode 100644
index d75999b9768d..000000000000
--- a/release_23/test/Transforms/Inline/2003-09-22-PHINodesInExceptionDest.ll
+++ /dev/null
@@ -1,25 +0,0 @@
-; RUN: llvm-as < %s | opt -inline -disable-output
-
-define i32 @main() {
-entry:
- invoke void @__main( )
- to label %Call2Invoke unwind label %LongJmpBlkPre
-
-Call2Invoke: ; preds = %entry
- br label %LongJmpBlkPre
-
-LongJmpBlkPre: ; preds = %Call2Invoke, %entry
- %i.3 = phi i32 [ 0, %entry ], [ 0, %Call2Invoke ] ; <i32> [#uses=0]
- ret i32 0
-}
-
-define void @__main() {
- call void @__llvm_getGlobalCtors( )
- call void @__llvm_getGlobalDtors( )
- ret void
-}
-
-declare void @__llvm_getGlobalCtors()
-
-declare void @__llvm_getGlobalDtors()
-
diff --git a/release_23/test/Transforms/Inline/2003-09-22-PHINodesInNormalInvokeDest.ll b/release_23/test/Transforms/Inline/2003-09-22-PHINodesInNormalInvokeDest.ll
deleted file mode 100644
index 09d516f48223..000000000000
--- a/release_23/test/Transforms/Inline/2003-09-22-PHINodesInNormalInvokeDest.ll
+++ /dev/null
@@ -1,23 +0,0 @@
-; RUN: llvm-as < %s | opt -inline -disable-output
-
-define i32 @main() {
-entry:
- invoke void @__main( )
- to label %else unwind label %RethrowExcept
-
-else: ; preds = %LJDecisionBB, %entry
- %i.2 = phi i32 [ 36, %entry ], [ %i.2, %LJDecisionBB ] ; <i32> [#uses=1]
- br label %LJDecisionBB
-
-LJDecisionBB: ; preds = %else
- br label %else
-
-RethrowExcept: ; preds = %entry
- ret i32 0
-}
-
-define void @__main() {
- ret void
-}
-
-
diff --git a/release_23/test/Transforms/Inline/2003-10-13-AllocaDominanceProblem.ll b/release_23/test/Transforms/Inline/2003-10-13-AllocaDominanceProblem.ll
deleted file mode 100644
index 6b6cf06abb29..000000000000
--- a/release_23/test/Transforms/Inline/2003-10-13-AllocaDominanceProblem.ll
+++ /dev/null
@@ -1,19 +0,0 @@
-; RUN: llvm-as < %s | opt -inline -disable-output
-
-define i32 @reload() {
-reloadentry:
- br label %A
-
-A: ; preds = %reloadentry
- call void @callee( )
- ret i32 0
-}
-
-define internal void @callee() {
-entry:
- %X = alloca i8, i32 0 ; <i8*> [#uses=0]
- %Y = bitcast i32 0 to i32 ; <i32> [#uses=1]
- %Z = alloca i8, i32 %Y ; <i8*> [#uses=0]
- ret void
-}
-
diff --git a/release_23/test/Transforms/Inline/2003-10-26-InlineInvokeExceptionDestPhi.ll b/release_23/test/Transforms/Inline/2003-10-26-InlineInvokeExceptionDestPhi.ll
deleted file mode 100644
index 675454e13482..000000000000
--- a/release_23/test/Transforms/Inline/2003-10-26-InlineInvokeExceptionDestPhi.ll
+++ /dev/null
@@ -1,20 +0,0 @@
-; The inliner is breaking inlining invoke instructions where there is a PHI
-; node in the exception destination, and the inlined function contains an
-; unwind instruction.
-
-; RUN: llvm-as < %s | opt -inline -disable-output
-
-define linkonce void @foo() {
- unwind
-}
-
-define i32 @test() {
-BB1:
- invoke void @foo( )
- to label %Cont unwind label %Cont
-
-Cont: ; preds = %BB1, %BB1
- %A = phi i32 [ 0, %BB1 ], [ 0, %BB1 ] ; <i32> [#uses=1]
- ret i32 %A
-}
-
diff --git a/release_23/test/Transforms/Inline/2004-04-15-InlineDeletesCall.ll b/release_23/test/Transforms/Inline/2004-04-15-InlineDeletesCall.ll
deleted file mode 100644
index 8a2f8e29edff..000000000000
--- a/release_23/test/Transforms/Inline/2004-04-15-InlineDeletesCall.ll
+++ /dev/null
@@ -1,20 +0,0 @@
-; RUN: llvm-as < %s | opt -inline -disable-output
-
-; Inlining the first call caused the inliner function to delete the second
-; call. Then the inliner tries to inline the second call, which no longer
-; exists.
-
-define internal void @Callee1() {
- unwind
-}
-
-define void @Callee2() {
- ret void
-}
-
-define void @caller() {
- call void @Callee1( )
- call void @Callee2( )
- ret void
-}
-
diff --git a/release_23/test/Transforms/Inline/2004-04-20-InlineLinkOnce.ll b/release_23/test/Transforms/Inline/2004-04-20-InlineLinkOnce.ll
deleted file mode 100644
index d9f09a06e7da..000000000000
--- a/release_23/test/Transforms/Inline/2004-04-20-InlineLinkOnce.ll
+++ /dev/null
@@ -1,11 +0,0 @@
-; RUN: llvm-as < %s | opt -inline -prune-eh -disable-output
-
-define linkonce void @caller() {
- call void @callee( )
- ret void
-}
-
-define linkonce void @callee() {
- ret void
-}
-
diff --git a/release_23/test/Transforms/Inline/2004-10-17-InlineFunctionWithoutReturn.ll b/release_23/test/Transforms/Inline/2004-10-17-InlineFunctionWithoutReturn.ll
deleted file mode 100644
index 09666ec8e65b..000000000000
--- a/release_23/test/Transforms/Inline/2004-10-17-InlineFunctionWithoutReturn.ll
+++ /dev/null
@@ -1,11 +0,0 @@
-; RUN: llvm-as < %s | opt -inline -disable-output
-
-define i32 @test() {
- unwind
-}
-
-define i32 @caller() {
- %X = call i32 @test( ) ; <i32> [#uses=1]
- ret i32 %X
-}
-
diff --git a/release_23/test/Transforms/Inline/2006-01-14-CallGraphUpdate.ll b/release_23/test/Transforms/Inline/2006-01-14-CallGraphUpdate.ll
deleted file mode 100644
index acdf6ab766b1..000000000000
--- a/release_23/test/Transforms/Inline/2006-01-14-CallGraphUpdate.ll
+++ /dev/null
@@ -1,25 +0,0 @@
-; RUN: llvm-as < %s | opt -inline -prune-eh -disable-output
-
- %"struct.std::__codecvt_abstract_base<char,char,__mbstate_t>" = type { %"struct.std::locale::facet" }
- %"struct.std::basic_streambuf<wchar_t,std::char_traits<wchar_t> >" = type { i32 (...)**, i32*, i32*, i32*, i32*, i32*, i32*, %"struct.std::locale" }
- %"struct.std::ios_base" = type { i32 (...)**, i32, i32, i32, i32, i32, %"struct.std::ios_base::_Callback_list"*, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, %"struct.std::ios_base::_Words"*, %"struct.std::locale" }
- %"struct.std::ios_base::_Callback_list" = type { %"struct.std::ios_base::_Callback_list"*, void (i32, %"struct.std::ios_base"*, i32)*, i32, i32 }
- %"struct.std::ios_base::_Words" = type { i8*, i32 }
- %"struct.std::locale" = type { %"struct.std::locale::_Impl"* }
- %"struct.std::locale::_Impl" = type { i32, %"struct.std::locale::facet"**, i32, %"struct.std::locale::facet"**, i8** }
- %"struct.std::locale::facet" = type { i32 (...)**, i32 }
- %"struct.std::ostreambuf_iterator<wchar_t,std::char_traits<wchar_t> >" = type { %"struct.std::basic_streambuf<wchar_t,std::char_traits<wchar_t> >"*, i32 }
-
-define void @_ZNKSt7num_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEE6do_putES3_RSt8ios_basewl(%"struct.std::ostreambuf_iterator<wchar_t,std::char_traits<wchar_t> >"* %agg.result, %"struct.std::__codecvt_abstract_base<char,char,__mbstate_t>"* %this, %"struct.std::basic_streambuf<wchar_t,std::char_traits<wchar_t> >"* %__s.0__, i32 %__s.1__, %"struct.std::ios_base"* %__io, i32 %__fill, i32 %__v) {
-entry:
- tail call fastcc void @_ZNKSt7num_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEE13_M_insert_intIlEES3_S3_RSt8ios_basewT_( )
- ret void
-}
-
-define fastcc void @_ZNKSt7num_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEE13_M_insert_intIlEES3_S3_RSt8ios_basewT_() {
-entry:
- %tmp.38 = shl i32 0, 3 ; <i32> [#uses=1]
- %tmp.39 = alloca i8, i32 %tmp.38 ; <i8*> [#uses=0]
- ret void
-}
-
diff --git a/release_23/test/Transforms/Inline/2006-07-12-InlinePruneCGUpdate.ll b/release_23/test/Transforms/Inline/2006-07-12-InlinePruneCGUpdate.ll
deleted file mode 100644
index 5215bec92909..000000000000
--- a/release_23/test/Transforms/Inline/2006-07-12-InlinePruneCGUpdate.ll
+++ /dev/null
@@ -1,840 +0,0 @@
-; RUN: llvm-as < %s | opt -inline -prune-eh -disable-output
-; PR827
-@_ZTV8CRjii = internal global [1 x i32 (...)*] [ i32 (...)* @_ZN8CRjii12NlFeeEPN5Jr7sE ] ; <[1 x i32 (...)*]*> [#uses=0]
-
-define internal i32 @_ZN8CRjii12NlFeeEPN5Jr7sE(...) {
-entry:
- br i1 false, label %cond_true, label %cond_false179
-
-cond_true: ; preds = %entry
- br label %bb9
-
-bb: ; preds = %cond_true14
- br label %bb9
-
-bb9: ; preds = %bb, %cond_true
- br i1 false, label %cond_true14, label %cond_false
-
-cond_true14: ; preds = %bb9
- br label %bb
-
-cond_false: ; preds = %bb9
- br label %bb15
-
-cond_next: ; No predecessors!
- br label %bb15
-
-bb15: ; preds = %cond_next, %cond_false
- br label %bb24
-
-bb17: ; preds = %cond_true29
- br label %bb24
-
-bb24: ; preds = %bb17, %bb15
- br i1 false, label %cond_true29, label %cond_false30
-
-cond_true29: ; preds = %bb24
- br label %bb17
-
-cond_false30: ; preds = %bb24
- br label %bb32
-
-cond_next31: ; No predecessors!
- br label %bb32
-
-bb32: ; preds = %cond_next31, %cond_false30
- br label %bb41
-
-bb34: ; preds = %cond_true46
- br label %bb41
-
-bb41: ; preds = %bb34, %bb32
- br i1 false, label %cond_true46, label %cond_false47
-
-cond_true46: ; preds = %bb41
- br label %bb34
-
-cond_false47: ; preds = %bb41
- br label %bb49
-
-cond_next48: ; No predecessors!
- br label %bb49
-
-bb49: ; preds = %cond_next48, %cond_false47
- br label %bb58
-
-bb51: ; preds = %cond_true63
- br label %bb58
-
-bb58: ; preds = %bb51, %bb49
- br i1 false, label %cond_true63, label %cond_false64
-
-cond_true63: ; preds = %bb58
- br label %bb51
-
-cond_false64: ; preds = %bb58
- br label %bb66
-
-cond_next65: ; No predecessors!
- br label %bb66
-
-bb66: ; preds = %cond_next65, %cond_false64
- br label %bb76
-
-bb68: ; preds = %cond_true81
- br label %bb76
-
-bb76: ; preds = %bb68, %bb66
- br i1 false, label %cond_true81, label %cond_false82
-
-cond_true81: ; preds = %bb76
- br label %bb68
-
-cond_false82: ; preds = %bb76
- br label %bb84
-
-cond_next83: ; No predecessors!
- br label %bb84
-
-bb84: ; preds = %cond_next83, %cond_false82
- br label %bb94
-
-bb86: ; preds = %cond_true99
- br label %bb94
-
-bb94: ; preds = %bb86, %bb84
- br i1 false, label %cond_true99, label %cond_false100
-
-cond_true99: ; preds = %bb94
- br label %bb86
-
-cond_false100: ; preds = %bb94
- br label %bb102
-
-cond_next101: ; No predecessors!
- br label %bb102
-
-bb102: ; preds = %cond_next101, %cond_false100
- br label %bb112
-
-bb104: ; preds = %cond_true117
- br label %bb112
-
-bb112: ; preds = %bb104, %bb102
- br i1 false, label %cond_true117, label %cond_false118
-
-cond_true117: ; preds = %bb112
- br label %bb104
-
-cond_false118: ; preds = %bb112
- br label %bb120
-
-cond_next119: ; No predecessors!
- br label %bb120
-
-bb120: ; preds = %cond_next119, %cond_false118
- br label %bb130
-
-bb122: ; preds = %cond_true135
- br label %bb130
-
-bb130: ; preds = %bb122, %bb120
- br i1 false, label %cond_true135, label %cond_false136
-
-cond_true135: ; preds = %bb130
- br label %bb122
-
-cond_false136: ; preds = %bb130
- br label %bb138
-
-cond_next137: ; No predecessors!
- br label %bb138
-
-bb138: ; preds = %cond_next137, %cond_false136
- br label %bb148
-
-bb140: ; preds = %cond_true153
- call fastcc void @_Zjrf1( )
- br label %bb148
-
-bb148: ; preds = %bb140, %bb138
- br i1 false, label %cond_true153, label %cond_false154
-
-cond_true153: ; preds = %bb148
- br label %bb140
-
-cond_false154: ; preds = %bb148
- br label %bb156
-
-cond_next155: ; No predecessors!
- br label %bb156
-
-bb156: ; preds = %cond_next155, %cond_false154
- br label %bb166
-
-bb158: ; preds = %cond_true171
- br label %bb166
-
-bb166: ; preds = %bb158, %bb156
- br i1 false, label %cond_true171, label %cond_false172
-
-cond_true171: ; preds = %bb166
- br label %bb158
-
-cond_false172: ; preds = %bb166
- br label %bb174
-
-cond_next173: ; No predecessors!
- br label %bb174
-
-bb174: ; preds = %cond_next173, %cond_false172
- br label %cleanup
-
-cleanup: ; preds = %bb174
- br label %finally
-
-finally: ; preds = %cleanup
- br label %cond_next180
-
-cond_false179: ; preds = %entry
- br label %cond_next180
-
-cond_next180: ; preds = %cond_false179, %finally
- br label %return
-
-return: ; preds = %cond_next180
- ret i32 0
-}
-
-define internal fastcc void @_Zjrf2() {
-entry:
- br label %bb3
-
-bb: ; preds = %cond_true
- br label %bb3
-
-bb3: ; preds = %bb, %entry
- %tmp5 = load i8** null ; <i8*> [#uses=1]
- %tmp = icmp ne i8* null, %tmp5 ; <i1> [#uses=1]
- br i1 %tmp, label %cond_true, label %cond_false
-
-cond_true: ; preds = %bb3
- br label %bb
-
-cond_false: ; preds = %bb3
- br label %bb6
-
-cond_next: ; No predecessors!
- br label %bb6
-
-bb6: ; preds = %cond_next, %cond_false
- br label %return
-
-return: ; preds = %bb6
- ret void
-}
-
-define internal fastcc void @_Zjrf3() {
-entry:
- call fastcc void @_Zjrf2( )
- br label %return
-
-return: ; preds = %entry
- ret void
-}
-
-define internal fastcc void @_Zjrf4() {
-entry:
- br label %bb6
-
-bb: ; preds = %cond_true
- br label %bb6
-
-bb6: ; preds = %bb, %entry
- br i1 false, label %cond_true, label %cond_false
-
-cond_true: ; preds = %bb6
- br label %bb
-
-cond_false: ; preds = %bb6
- br label %bb8
-
-cond_next: ; No predecessors!
- br label %bb8
-
-bb8: ; preds = %cond_next, %cond_false
- br i1 false, label %cond_true9, label %cond_false12
-
-cond_true9: ; preds = %bb8
- call fastcc void @_Zjrf3( )
- br label %cond_next13
-
-cond_false12: ; preds = %bb8
- br label %cond_next13
-
-cond_next13: ; preds = %cond_false12, %cond_true9
- br label %return
-
-return: ; preds = %cond_next13
- ret void
-}
-
-define internal fastcc void @_Zjrf5() {
-entry:
- call fastcc void @_Zjrf4( )
- br label %return
-
-return: ; preds = %entry
- ret void
-}
-
-define internal fastcc void @_Zjrf6() {
-entry:
- call fastcc void @_Zjrf5( )
- br label %return
-
-return: ; preds = %entry
- ret void
-}
-
-define internal fastcc void @_Zjrf7() {
-entry:
- br label %cleanup
-
-cleanup: ; preds = %entry
- br label %finally
-
-finally: ; preds = %cleanup
- call fastcc void @_Zjrf6( )
- br label %cleanup9
-
-cleanup9: ; preds = %finally
- br label %finally8
-
-finally8: ; preds = %cleanup9
- br label %cleanup11
-
-cleanup11: ; preds = %finally8
- br label %finally10
-
-finally10: ; preds = %cleanup11
- br label %finally23
-
-finally23: ; preds = %finally10
- br label %return
-
-return: ; preds = %finally23
- ret void
-}
-
-define internal fastcc void @_Zjrf11() {
-entry:
- br label %bb7
-
-bb: ; preds = %cond_true
- br label %bb7
-
-bb7: ; preds = %bb, %entry
- br i1 false, label %cond_true, label %cond_false
-
-cond_true: ; preds = %bb7
- br label %bb
-
-cond_false: ; preds = %bb7
- br label %bb9
-
-cond_next: ; No predecessors!
- br label %bb9
-
-bb9: ; preds = %cond_next, %cond_false
- br label %return
- ; No predecessors!
- br i1 false, label %cond_true12, label %cond_false15
-
-cond_true12: ; preds = %0
- call fastcc void @_Zjrf3( )
- br label %cond_next16
-
-cond_false15: ; preds = %0
- br label %cond_next16
-
-cond_next16: ; preds = %cond_false15, %cond_true12
- br label %return
-
-return: ; preds = %cond_next16, %bb9
- ret void
-}
-
-define internal fastcc void @_Zjrf9() {
-entry:
- call fastcc void @_Zjrf11( )
- br label %return
-
-return: ; preds = %entry
- ret void
-}
-
-define internal fastcc void @_Zjrf10() {
-entry:
- call fastcc void @_Zjrf9( )
- br label %return
-
-return: ; preds = %entry
- ret void
-}
-
-define internal fastcc void @_Zjrf8() {
-entry:
- br i1 false, label %cond_true, label %cond_false201
-
-cond_true: ; preds = %entry
- br i1 false, label %cond_true36, label %cond_false
-
-cond_true36: ; preds = %cond_true
- br label %cleanup
-
-cleanup: ; preds = %cond_true36
- br label %finally
-
-finally: ; preds = %cleanup
- br label %cond_next189
-
-cond_false: ; preds = %cond_true
- br i1 false, label %cond_true99, label %cond_false137
-
-cond_true99: ; preds = %cond_false
- br label %cleanup136
-
-cleanup136: ; preds = %cond_true99
- br label %finally135
-
-finally135: ; preds = %cleanup136
- br label %cond_next
-
-cond_false137: ; preds = %cond_false
- call fastcc void @_Zjrf10( )
- br label %cleanup188
-
-cleanup188: ; preds = %cond_false137
- br label %finally187
-
-finally187: ; preds = %cleanup188
- br label %cond_next
-
-cond_next: ; preds = %finally187, %finally135
- br label %cond_next189
-
-cond_next189: ; preds = %cond_next, %finally
- br label %cond_next202
-
-cond_false201: ; preds = %entry
- br label %cond_next202
-
-cond_next202: ; preds = %cond_false201, %cond_next189
- br label %return
-
-return: ; preds = %cond_next202
- ret void
-}
-
-define internal fastcc void @_Zjrf1() {
-entry:
- br label %bb492
-
-bb: ; preds = %cond_true499
- br label %cleanup
-
-cleanup: ; preds = %bb
- br label %finally
-
-finally: ; preds = %cleanup
- br label %cleanup11
-
-cleanup11: ; preds = %finally
- br label %finally10
-
-finally10: ; preds = %cleanup11
- br i1 false, label %cond_true, label %cond_false286
-
-cond_true: ; preds = %finally10
- br label %cleanup26
-
-cleanup26: ; preds = %cond_true
- br label %finally25
-
-finally25: ; preds = %cleanup26
- br label %bb30
-
-bb27: ; preds = %cond_true37
- br label %bb30
-
-bb30: ; preds = %bb27, %finally25
- br i1 false, label %cond_true37, label %cond_false
-
-cond_true37: ; preds = %bb30
- br label %bb27
-
-cond_false: ; preds = %bb30
- br label %bb38
-
-cond_next: ; No predecessors!
- br label %bb38
-
-bb38: ; preds = %cond_next, %cond_false
- br label %bb148
-
-bb40: ; preds = %cond_true156
- br label %bb139
-
-bb41: ; preds = %cond_true142
- call fastcc void @_Zjrf7( )
- br label %bb105
-
-bb44: ; preds = %cond_true112
- br label %bb74
-
-bb66: ; preds = %cond_true80
- br label %bb74
-
-bb74: ; preds = %bb66, %bb44
- br i1 false, label %cond_true80, label %cond_false81
-
-cond_true80: ; preds = %bb74
- br label %bb66
-
-cond_false81: ; preds = %bb74
- br label %bb83
-
-cond_next82: ; No predecessors!
- br label %bb83
-
-bb83: ; preds = %cond_next82, %cond_false81
- br label %cleanup97
-
-cleanup97: ; preds = %bb83
- br label %finally96
-
-finally96: ; preds = %cleanup97
- br label %cleanup99
-
-cleanup99: ; preds = %finally96
- br label %finally98
-
-finally98: ; preds = %cleanup99
- br label %bb105
-
-bb105: ; preds = %finally98, %bb41
- br i1 false, label %cond_true112, label %cond_false113
-
-cond_true112: ; preds = %bb105
- br label %bb44
-
-cond_false113: ; preds = %bb105
- br label %bb115
-
-cond_next114: ; No predecessors!
- br label %bb115
-
-bb115: ; preds = %cond_next114, %cond_false113
- br i1 false, label %cond_true119, label %cond_false123
-
-cond_true119: ; preds = %bb115
- call fastcc void @_Zjrf8( )
- br label %cond_next124
-
-cond_false123: ; preds = %bb115
- br label %cond_next124
-
-cond_next124: ; preds = %cond_false123, %cond_true119
- br i1 false, label %cond_true131, label %cond_false132
-
-cond_true131: ; preds = %cond_next124
- br label %cleanup135
-
-cond_false132: ; preds = %cond_next124
- br label %cond_next133
-
-cond_next133: ; preds = %cond_false132
- br label %cleanup136
-
-cleanup135: ; preds = %cond_true131
- br label %done
-
-cleanup136: ; preds = %cond_next133
- br label %finally134
-
-finally134: ; preds = %cleanup136
- br label %bb139
-
-bb139: ; preds = %finally134, %bb40
- br i1 false, label %cond_true142, label %cond_false143
-
-cond_true142: ; preds = %bb139
- br label %bb41
-
-cond_false143: ; preds = %bb139
- br label %bb145
-
-cond_next144: ; No predecessors!
- br label %bb145
-
-bb145: ; preds = %cond_next144, %cond_false143
- br label %bb148
-
-bb148: ; preds = %bb145, %bb38
- br i1 false, label %cond_true156, label %cond_false157
-
-cond_true156: ; preds = %bb148
- br label %bb40
-
-cond_false157: ; preds = %bb148
- br label %bb159
-
-cond_next158: ; No predecessors!
- br label %bb159
-
-bb159: ; preds = %cond_next158, %cond_false157
- br label %done
-
-done: ; preds = %bb159, %cleanup135
- br label %bb214
-
-bb185: ; preds = %cond_true218
- br i1 false, label %cond_true193, label %cond_false206
-
-cond_true193: ; preds = %bb185
- br label %cond_next211
-
-cond_false206: ; preds = %bb185
- br label %cond_next211
-
-cond_next211: ; preds = %cond_false206, %cond_true193
- br label %bb214
-
-bb214: ; preds = %cond_next211, %done
- br i1 false, label %cond_true218, label %cond_false219
-
-cond_true218: ; preds = %bb214
- br label %bb185
-
-cond_false219: ; preds = %bb214
- br label %bb221
-
-cond_next220: ; No predecessors!
- br label %bb221
-
-bb221: ; preds = %cond_next220, %cond_false219
- br i1 false, label %cond_true236, label %cond_false245
-
-cond_true236: ; preds = %bb221
- br label %cond_next249
-
-cond_false245: ; preds = %bb221
- br label %cond_next249
-
-cond_next249: ; preds = %cond_false245, %cond_true236
- br i1 false, label %cond_true272, label %cond_false277
-
-cond_true272: ; preds = %cond_next249
- br label %cond_next278
-
-cond_false277: ; preds = %cond_next249
- br label %cond_next278
-
-cond_next278: ; preds = %cond_false277, %cond_true272
- br label %cleanup285
-
-cleanup285: ; preds = %cond_next278
- br label %finally284
-
-finally284: ; preds = %cleanup285
- br label %cond_next287
-
-cond_false286: ; preds = %finally10
- br label %cond_next287
-
-cond_next287: ; preds = %cond_false286, %finally284
- br i1 false, label %cond_true317, label %cond_false319
-
-cond_true317: ; preds = %cond_next287
- br label %cond_next321
-
-cond_false319: ; preds = %cond_next287
- br label %cond_next321
-
-cond_next321: ; preds = %cond_false319, %cond_true317
- br label %bb348
-
-bb335: ; preds = %cond_true355
- br label %bb348
-
-bb348: ; preds = %bb335, %cond_next321
- br i1 false, label %cond_true355, label %cond_false356
-
-cond_true355: ; preds = %bb348
- br label %bb335
-
-cond_false356: ; preds = %bb348
- br label %bb358
-
-cond_next357: ; No predecessors!
- br label %bb358
-
-bb358: ; preds = %cond_next357, %cond_false356
- br i1 false, label %cond_true363, label %cond_false364
-
-cond_true363: ; preds = %bb358
- br label %bb388
-
-cond_false364: ; preds = %bb358
- br label %cond_next365
-
-cond_next365: ; preds = %cond_false364
- br i1 false, label %cond_true370, label %cond_false371
-
-cond_true370: ; preds = %cond_next365
- br label %bb388
-
-cond_false371: ; preds = %cond_next365
- br label %cond_next372
-
-cond_next372: ; preds = %cond_false371
- br i1 false, label %cond_true385, label %cond_false386
-
-cond_true385: ; preds = %cond_next372
- br label %bb388
-
-cond_false386: ; preds = %cond_next372
- br label %cond_next387
-
-cond_next387: ; preds = %cond_false386
- br label %bb389
-
-bb388: ; preds = %cond_true385, %cond_true370, %cond_true363
- br label %bb389
-
-bb389: ; preds = %bb388, %cond_next387
- br i1 false, label %cond_true392, label %cond_false443
-
-cond_true392: ; preds = %bb389
- br label %bb419
-
-bb402: ; preds = %cond_true425
- br i1 false, label %cond_true406, label %cond_false412
-
-cond_true406: ; preds = %bb402
- br label %cond_next416
-
-cond_false412: ; preds = %bb402
- br label %cond_next416
-
-cond_next416: ; preds = %cond_false412, %cond_true406
- br label %bb419
-
-bb419: ; preds = %cond_next416, %cond_true392
- br i1 false, label %cond_true425, label %cond_false426
-
-cond_true425: ; preds = %bb419
- br label %bb402
-
-cond_false426: ; preds = %bb419
- br label %bb428
-
-cond_next427: ; No predecessors!
- br label %bb428
-
-bb428: ; preds = %cond_next427, %cond_false426
- br label %cond_next478
-
-cond_false443: ; preds = %bb389
- br label %bb460
-
-bb450: ; preds = %cond_true466
- br label %bb460
-
-bb460: ; preds = %bb450, %cond_false443
- br i1 false, label %cond_true466, label %cond_false467
-
-cond_true466: ; preds = %bb460
- br label %bb450
-
-cond_false467: ; preds = %bb460
- br label %bb469
-
-cond_next468: ; No predecessors!
- br label %bb469
-
-bb469: ; preds = %cond_next468, %cond_false467
- br label %cond_next478
-
-cond_next478: ; preds = %bb469, %bb428
- br label %cleanup485
-
-cleanup485: ; preds = %cond_next478
- br label %finally484
-
-finally484: ; preds = %cleanup485
- br label %cleanup487
-
-cleanup487: ; preds = %finally484
- br label %finally486
-
-finally486: ; preds = %cleanup487
- br label %cleanup489
-
-cleanup489: ; preds = %finally486
- br label %finally488
-
-finally488: ; preds = %cleanup489
- br label %bb492
-
-bb492: ; preds = %finally488, %entry
- br i1 false, label %cond_true499, label %cond_false500
-
-cond_true499: ; preds = %bb492
- br label %bb
-
-cond_false500: ; preds = %bb492
- br label %bb502
-
-cond_next501: ; No predecessors!
- br label %bb502
-
-bb502: ; preds = %cond_next501, %cond_false500
- br label %return
-
-return: ; preds = %bb502
- ret void
-}
-
-define internal fastcc void @_ZSt26__unguarded_insertion_sortIN9__gnu_cxx17__normal_iteratorIPSsSt6vectorISsSaISsEEEEEvT_S7_() {
-entry:
- br label %bb12
-
-bb: ; preds = %cond_true
- br label %cleanup
-
-cleanup: ; preds = %bb
- br label %finally
-
-finally: ; preds = %cleanup
- br label %bb12
-
-bb12: ; preds = %finally, %entry
- br i1 false, label %cond_true, label %cond_false
-
-cond_true: ; preds = %bb12
- br label %bb
-
-cond_false: ; preds = %bb12
- br label %bb14
-
-cond_next: ; No predecessors!
- br label %bb14
-
-bb14: ; preds = %cond_next, %cond_false
- br label %return
-
-return: ; preds = %bb14
- ret void
-}
diff --git a/release_23/test/Transforms/Inline/2006-11-09-InlineCGUpdate-2.ll b/release_23/test/Transforms/Inline/2006-11-09-InlineCGUpdate-2.ll
deleted file mode 100644
index bd2885dab425..000000000000
--- a/release_23/test/Transforms/Inline/2006-11-09-InlineCGUpdate-2.ll
+++ /dev/null
@@ -1,245 +0,0 @@
-; RUN: llvm-as < %s | opt -inline -prune-eh -disable-output
-; PR993
-target datalayout = "e-p:32:32"
-target triple = "i386-unknown-openbsd3.9"
-deplibs = [ "stdc++", "c", "crtend" ]
- %"struct.__gnu_cxx::__normal_iterator<char*,std::basic_string<char, std::char_traits<char>, std::allocator<char> > >" = type { i8* }
- %"struct.__gnu_cxx::char_producer<char>" = type { i32 (...)** }
- %struct.__sFILE = type { i8*, i32, i32, i16, i16, %struct.__sbuf, i32, i8*, i32 (i8*)*, i32 (i8*, i8*, i32)*, i64 (i8*, i64, i32)*, i32 (i8*, i8*, i32)*, %struct.__sbuf, i8*, i32, [3 x i8], [1 x i8], %struct.__sbuf, i32, i64 }
- %struct.__sbuf = type { i8*, i32 }
- %"struct.std::__basic_file<char>" = type { %struct.__sFILE*, i1 }
- %"struct.std::__codecvt_abstract_base<char,char,__mbstate_t>" = type { %"struct.std::locale::facet" }
- %"struct.std::bad_alloc" = type { %"struct.__gnu_cxx::char_producer<char>" }
- %"struct.std::basic_filebuf<char,std::char_traits<char> >" = type { %"struct.std::basic_streambuf<char,std::char_traits<char> >", i32, %"struct.std::__basic_file<char>", i32, %union.__mbstate_t, %union.__mbstate_t, i8*, i32, i1, i1, i1, i1, i8, i8*, i8*, i1, %"struct.std::codecvt<char,char,__mbstate_t>"*, i8*, i32, i8*, i8* }
- %"struct.std::basic_ios<char,std::char_traits<char> >" = type { %"struct.std::ios_base", %"struct.std::basic_ostream<char,std::char_traits<char> >"*, i8, i1, %"struct.std::basic_streambuf<char,std::char_traits<char> >"*, %"struct.std::ctype<char>"*, %"struct.std::__codecvt_abstract_base<char,char,__mbstate_t>"*, %"struct.std::__codecvt_abstract_base<char,char,__mbstate_t>"* }
- %"struct.std::basic_iostream<char,std::char_traits<char> >" = type { %"struct.std::locale::facet", %"struct.__gnu_cxx::char_producer<char>", %"struct.std::basic_ios<char,std::char_traits<char> >" }
- %"struct.std::basic_ofstream<char,std::char_traits<char> >" = type { %"struct.__gnu_cxx::char_producer<char>", %"struct.std::basic_filebuf<char,std::char_traits<char> >", %"struct.std::basic_ios<char,std::char_traits<char> >" }
- %"struct.std::basic_ostream<char,std::char_traits<char> >" = type { i32 (...)**, %"struct.std::basic_ios<char,std::char_traits<char> >" }
- %"struct.std::basic_streambuf<char,std::char_traits<char> >" = type { i32 (...)**, i8*, i8*, i8*, i8*, i8*, i8*, %"struct.std::locale" }
- %"struct.std::basic_string<char,std::char_traits<char>,std::allocator<char> >" = type { %"struct.__gnu_cxx::__normal_iterator<char*,std::basic_string<char, std::char_traits<char>, std::allocator<char> > >" }
- %"struct.std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Rep" = type { %"struct.std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Rep_base" }
- %"struct.std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Rep_base" = type { i32, i32, i32 }
- %"struct.std::codecvt<char,char,__mbstate_t>" = type { %"struct.std::__codecvt_abstract_base<char,char,__mbstate_t>", i32* }
- %"struct.std::ctype<char>" = type { %"struct.std::__codecvt_abstract_base<char,char,__mbstate_t>", i32*, i1, i32*, i32*, i32* }
- %"struct.std::domain_error" = type { %"struct.std::logic_error" }
- %"struct.std::ios_base" = type { i32 (...)**, i32, i32, i32, i32, i32, %"struct.std::ios_base::_Callback_list"*, %struct.__sbuf, [8 x %struct.__sbuf], i32, %struct.__sbuf*, %"struct.std::locale" }
- %"struct.std::ios_base::_Callback_list" = type { %"struct.std::ios_base::_Callback_list"*, void (i32, %"struct.std::ios_base"*, i32)*, i32, i32 }
- %"struct.std::ios_base::_Words" = type { i8*, i32 }
- %"struct.std::locale" = type { %"struct.std::locale::_Impl"* }
- %"struct.std::locale::_Impl" = type { i32, %"struct.std::locale::facet"**, i32, %"struct.std::locale::facet"**, i8** }
- %"struct.std::locale::facet" = type { i32 (...)**, i32 }
- %"struct.std::logic_error" = type { %"struct.__gnu_cxx::char_producer<char>", %"struct.std::basic_string<char,std::char_traits<char>,std::allocator<char> >" }
- %union.__mbstate_t = type { i64, [120 x i8] }
-@.str_1 = external global [17 x i8] ; <[17 x i8]*> [#uses=0]
-@.str_9 = external global [24 x i8] ; <[24 x i8]*> [#uses=0]
-
-define void @main() {
-entry:
- call fastcc void @_ZNSt14basic_ofstreamIcSt11char_traitsIcEE4openEPKcSt13_Ios_Openmode( )
- ret void
-}
-
-define fastcc void @_ZNSt14basic_ofstreamIcSt11char_traitsIcEE4openEPKcSt13_Ios_Openmode() {
-entry:
- %tmp.6 = icmp eq %"struct.std::basic_filebuf<char,std::char_traits<char> >"* null, null ; <i1> [#uses=1]
- br i1 %tmp.6, label %then, label %UnifiedReturnBlock
-
-then: ; preds = %entry
- tail call fastcc void @_ZNSt9basic_iosIcSt11char_traitsIcEE8setstateESt12_Ios_Iostate( )
- ret void
-
-UnifiedReturnBlock: ; preds = %entry
- ret void
-}
-
-define fastcc void @_ZN10__cxxabiv111__terminateEPFvvE() {
-entry:
- unreachable
-}
-
-define void @_ZNSdD0Ev() {
-entry:
- unreachable
-}
-
-define void @_ZThn8_NSdD1Ev() {
-entry:
- ret void
-}
-
-define void @_ZNSt13basic_filebufIcSt11char_traitsIcEED0Ev() {
-entry:
- ret void
-}
-
-define void @_ZNSt13basic_filebufIcSt11char_traitsIcEE9pbackfailEi() {
-entry:
- unreachable
-}
-
-define fastcc void @_ZNSoD2Ev() {
-entry:
- unreachable
-}
-
-define fastcc void @_ZNSt9basic_iosIcSt11char_traitsIcEED2Ev() {
-entry:
- unreachable
-}
-
-define fastcc void @_ZNSt9basic_iosIcSt11char_traitsIcEE8setstateESt12_Ios_Iostate() {
-entry:
- tail call fastcc void @_ZSt19__throw_ios_failurePKc( )
- ret void
-}
-
-declare fastcc void @_ZNSaIcED1Ev()
-
-define fastcc void @_ZNSsC1EPKcRKSaIcE() {
-entry:
- tail call fastcc void @_ZNSs16_S_construct_auxIPKcEEPcT_S3_RKSaIcE12__false_type( )
- unreachable
-}
-
-define fastcc void @_ZSt14__convert_to_vIyEvPKcRT_RSt12_Ios_IostateRKPii() {
-entry:
- ret void
-}
-
-define fastcc void @_ZNSt7num_getIcSt19istreambuf_iteratorIcSt11char_traitsIcEEEC1Ej() {
-entry:
- ret void
-}
-
-define fastcc void @_ZSt19__throw_ios_failurePKc() {
-entry:
- call fastcc void @_ZNSsC1EPKcRKSaIcE( )
- unwind
-}
-
-define void @_GLOBAL__D__ZSt23lexicographical_compareIPKaS1_EbT_S2_T0_S3_() {
-entry:
- ret void
-}
-
-define void @_ZNSt9bad_allocD1Ev() {
-entry:
- unreachable
-}
-
-define fastcc void @_ZSt19__throw_logic_errorPKc() {
-entry:
- invoke fastcc void @_ZNSt11logic_errorC1ERKSs( )
- to label %try_exit.0 unwind label %try_catch.0
-
-try_catch.0: ; preds = %entry
- unreachable
-
-try_exit.0: ; preds = %entry
- unwind
-}
-
-define fastcc void @_ZNSt11logic_errorC1ERKSs() {
-entry:
- call fastcc void @_ZNSsC1ERKSs( )
- ret void
-}
-
-define void @_ZNSt12domain_errorD1Ev() {
-entry:
- unreachable
-}
-
-define fastcc void @_ZSt20__throw_length_errorPKc() {
-entry:
- call fastcc void @_ZNSt12length_errorC1ERKSs( )
- unwind
-}
-
-define fastcc void @_ZNSt12length_errorC1ERKSs() {
-entry:
- invoke fastcc void @_ZNSsC1ERKSs( )
- to label %_ZNSt11logic_errorC2ERKSs.exit unwind label %invoke_catch.i
-
-invoke_catch.i: ; preds = %entry
- unwind
-
-_ZNSt11logic_errorC2ERKSs.exit: ; preds = %entry
- ret void
-}
-
-define fastcc void @_ZNSs4_Rep9_S_createEjRKSaIcE() {
-entry:
- call fastcc void @_ZSt20__throw_length_errorPKc( )
- unreachable
-}
-
-define fastcc void @_ZNSs12_S_constructIN9__gnu_cxx17__normal_iteratorIPcSsEEEES2_T_S4_RKSaIcESt20forward_iterator_tag() {
-entry:
- unreachable
-}
-
-define fastcc void @_ZNSs16_S_construct_auxIPKcEEPcT_S3_RKSaIcE12__false_type() {
-entry:
- br i1 false, label %then.1.i, label %endif.1.i
-
-then.1.i: ; preds = %entry
- call fastcc void @_ZSt19__throw_logic_errorPKc( )
- br label %endif.1.i
-
-endif.1.i: ; preds = %then.1.i, %entry
- call fastcc void @_ZNSs4_Rep9_S_createEjRKSaIcE( )
- unreachable
-}
-
-define fastcc void @_ZNSsC1ERKSs() {
-entry:
- call fastcc void @_ZNSs4_Rep7_M_grabERKSaIcES2_( )
- invoke fastcc void @_ZNSaIcEC1ERKS_( )
- to label %invoke_cont.1 unwind label %invoke_catch.1
-
-invoke_catch.1: ; preds = %entry
- call fastcc void @_ZNSaIcED1Ev( )
- unwind
-
-invoke_cont.1: ; preds = %entry
- call fastcc void @_ZNSaIcEC2ERKS_( )
- ret void
-}
-
-define fastcc void @_ZNSaIcEC1ERKS_() {
-entry:
- ret void
-}
-
-define fastcc void @_ZNSs7replaceEN9__gnu_cxx17__normal_iteratorIPcSsEES2_jc() {
-entry:
- ret void
-}
-
-define fastcc void @_ZNSs4_Rep7_M_grabERKSaIcES2_() {
-entry:
- br i1 false, label %else.i, label %cond_true
-
-cond_true: ; preds = %entry
- ret void
-
-else.i: ; preds = %entry
- tail call fastcc void @_ZNSs4_Rep9_S_createEjRKSaIcE( )
- unreachable
-}
-
-define fastcc void @_ZNSaIcEC2ERKS_() {
-entry:
- ret void
-}
-
-define fastcc void @_ZN9__gnu_cxx12__pool_allocILb1ELi0EE8allocateEj() {
-entry:
- ret void
-}
-
-define fastcc void @_ZN9__gnu_cxx12__pool_allocILb1ELi0EE9_S_refillEj() {
-entry:
- unreachable
-}
diff --git a/release_23/test/Transforms/Inline/2006-11-09-InlineCGUpdate.ll b/release_23/test/Transforms/Inline/2006-11-09-InlineCGUpdate.ll
deleted file mode 100644
index 05096f425fde..000000000000
--- a/release_23/test/Transforms/Inline/2006-11-09-InlineCGUpdate.ll
+++ /dev/null
@@ -1,338 +0,0 @@
-; RUN: llvm-as < %s | opt -inline -prune-eh -disable-output
-; PR992
-target datalayout = "e-p:32:32"
-target triple = "i686-pc-linux-gnu"
-deplibs = [ "stdc++", "c", "crtend" ]
- %struct._IO_FILE = type { i32, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, %struct._IO_marker*, %struct._IO_FILE*, i32, i32, i32, i16, i8, [1 x i8], i8*, i64, i8*, i8*, i32, [52 x i8] }
- %struct._IO_marker = type { %struct._IO_marker*, %struct._IO_FILE*, i32 }
- %"struct.__cxxabiv1::__array_type_info" = type { %"struct.std::type_info" }
- %"struct.__cxxabiv1::__si_class_type_info" = type { %"struct.__cxxabiv1::__array_type_info", %"struct.__cxxabiv1::__array_type_info"* }
- %"struct.__gnu_cxx::_Rope_rep_alloc_base<char,std::allocator<char>, true>" = type { i32 }
- %"struct.__gnu_cxx::__normal_iterator<char*,std::basic_string<char, std::char_traits<char>, std::allocator<char> > >" = type { i8* }
- %"struct.__gnu_cxx::__normal_iterator<const wchar_t*,std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > >" = type { i32* }
- %"struct.__gnu_cxx::char_producer<char>" = type { i32 (...)** }
- %"struct.__gnu_cxx::stdio_sync_filebuf<char,std::char_traits<char> >" = type { %"struct.std::basic_streambuf<char,std::char_traits<char> >", %struct._IO_FILE*, i32 }
- %"struct.__gnu_cxx::stdio_sync_filebuf<wchar_t,std::char_traits<wchar_t> >" = type { %"struct.std::basic_streambuf<wchar_t,std::char_traits<wchar_t> >", %struct._IO_FILE*, i32 }
- %struct.__locale_struct = type { [13 x %struct.locale_data*], i16*, i32*, i32*, [13 x i8*] }
- %struct.__mbstate_t = type { i32, %"struct.__gnu_cxx::_Rope_rep_alloc_base<char,std::allocator<char>, true>" }
- %struct.locale_data = type opaque
- %"struct.std::__basic_file<char>" = type { %struct._IO_FILE*, i1 }
- %"struct.std::__codecvt_abstract_base<char,char,__mbstate_t>" = type { %"struct.std::locale::facet" }
- %"struct.std::basic_filebuf<char,std::char_traits<char> >" = type { %"struct.std::basic_streambuf<char,std::char_traits<char> >", i32, %"struct.std::__basic_file<char>", i32, %struct.__mbstate_t, %struct.__mbstate_t, i8*, i32, i1, i1, i1, i1, i8, i8*, i8*, i1, %"struct.std::codecvt<char,char,__mbstate_t>"*, i8*, i32, i8*, i8* }
- %"struct.std::basic_filebuf<wchar_t,std::char_traits<wchar_t> >" = type { %"struct.std::basic_streambuf<wchar_t,std::char_traits<wchar_t> >", i32, %"struct.std::__basic_file<char>", i32, %struct.__mbstate_t, %struct.__mbstate_t, i32*, i32, i1, i1, i1, i1, i32, i32*, i32*, i1, %"struct.std::codecvt<char,char,__mbstate_t>"*, i8*, i32, i8*, i8* }
- %"struct.std::basic_fstream<char,std::char_traits<char> >" = type { { %"struct.std::locale::facet", %"struct.__gnu_cxx::char_producer<char>" }, %"struct.std::basic_filebuf<char,std::char_traits<char> >", %"struct.std::basic_ios<char,std::char_traits<char> >" }
- %"struct.std::basic_fstream<wchar_t,std::char_traits<wchar_t> >" = type { { %"struct.std::locale::facet", %"struct.__gnu_cxx::char_producer<char>" }, %"struct.std::basic_filebuf<wchar_t,std::char_traits<wchar_t> >", %"struct.std::basic_ios<wchar_t,std::char_traits<wchar_t> >" }
- %"struct.std::basic_ios<char,std::char_traits<char> >" = type { %"struct.std::ios_base", %"struct.std::basic_ostream<char,std::char_traits<char> >"*, i8, i1, %"struct.std::basic_streambuf<char,std::char_traits<char> >"*, %"struct.std::ctype<char>"*, %"struct.std::__codecvt_abstract_base<char,char,__mbstate_t>"*, %"struct.std::__codecvt_abstract_base<char,char,__mbstate_t>"* }
- %"struct.std::basic_ios<wchar_t,std::char_traits<wchar_t> >" = type { %"struct.std::ios_base", %"struct.std::basic_ostream<wchar_t,std::char_traits<wchar_t> >"*, i32, i1, %"struct.std::basic_streambuf<wchar_t,std::char_traits<wchar_t> >"*, %"struct.std::codecvt<char,char,__mbstate_t>"*, %"struct.std::__codecvt_abstract_base<char,char,__mbstate_t>"*, %"struct.std::__codecvt_abstract_base<char,char,__mbstate_t>"* }
- %"struct.std::basic_iostream<wchar_t,std::char_traits<wchar_t> >" = type { %"struct.std::locale::facet", %"struct.__gnu_cxx::char_producer<char>", %"struct.std::basic_ios<wchar_t,std::char_traits<wchar_t> >" }
- %"struct.std::basic_ostream<char,std::char_traits<char> >" = type { i32 (...)**, %"struct.std::basic_ios<char,std::char_traits<char> >" }
- %"struct.std::basic_ostream<wchar_t,std::char_traits<wchar_t> >" = type { i32 (...)**, %"struct.std::basic_ios<wchar_t,std::char_traits<wchar_t> >" }
- %"struct.std::basic_streambuf<char,std::char_traits<char> >" = type { i32 (...)**, i8*, i8*, i8*, i8*, i8*, i8*, %"struct.std::locale" }
- %"struct.std::basic_streambuf<wchar_t,std::char_traits<wchar_t> >" = type { i32 (...)**, i32*, i32*, i32*, i32*, i32*, i32*, %"struct.std::locale" }
- %"struct.std::basic_string<char,std::char_traits<char>,std::allocator<char> >" = type { %"struct.__gnu_cxx::__normal_iterator<char*,std::basic_string<char, std::char_traits<char>, std::allocator<char> > >" }
- %"struct.std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Rep" = type { %"struct.std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Rep_base" }
- %"struct.std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Rep_base" = type { i32, i32, i32 }
- %"struct.std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t> >" = type { %"struct.__gnu_cxx::__normal_iterator<const wchar_t*,std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > >" }
- %"struct.std::codecvt<char,char,__mbstate_t>" = type { %"struct.std::__codecvt_abstract_base<char,char,__mbstate_t>", %struct.__locale_struct* }
- %"struct.std::collate<char>" = type { %"struct.std::locale::facet", %struct.__locale_struct* }
- %"struct.std::collate_byname<char>" = type { %"struct.std::collate<char>" }
- %"struct.std::ctype<char>" = type { %"struct.std::__codecvt_abstract_base<char,char,__mbstate_t>", %struct.__locale_struct*, i1, i32*, i32*, i16* }
- %"struct.std::ctype_byname<char>" = type { %"struct.std::ctype<char>" }
- %"struct.std::domain_error" = type { %"struct.std::logic_error" }
- %"struct.std::ios_base" = type { i32 (...)**, i32, i32, i32, i32, i32, %"struct.std::ios_base::_Callback_list"*, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, %"struct.std::ios_base::_Words"*, %"struct.std::locale" }
- %"struct.std::ios_base::_Callback_list" = type { %"struct.std::ios_base::_Callback_list"*, void (i32, %"struct.std::ios_base"*, i32)*, i32, i32 }
- %"struct.std::ios_base::_Words" = type { i8*, i32 }
- %"struct.std::istreambuf_iterator<char,std::char_traits<char> >" = type { %"struct.std::basic_streambuf<char,std::char_traits<char> >"*, i32 }
- %"struct.std::istreambuf_iterator<wchar_t,std::char_traits<wchar_t> >" = type { %"struct.std::basic_streambuf<wchar_t,std::char_traits<wchar_t> >"*, i32 }
- %"struct.std::locale" = type { %"struct.std::locale::_Impl"* }
- %"struct.std::locale::_Impl" = type { i32, %"struct.std::locale::facet"**, i32, %"struct.std::locale::facet"**, i8** }
- %"struct.std::locale::facet" = type { i32 (...)**, i32 }
- %"struct.std::logic_error" = type { %"struct.__gnu_cxx::char_producer<char>", %"struct.std::basic_string<char,std::char_traits<char>,std::allocator<char> >" }
- %"struct.std::type_info" = type { i32 (...)**, i8* }
-@.str_11 = external global [42 x i8] ; <[42 x i8]*> [#uses=0]
-@.str_9 = external global [24 x i8] ; <[24 x i8]*> [#uses=0]
-@.str_1 = external global [17 x i8] ; <[17 x i8]*> [#uses=0]
-
-define void @main() {
-entry:
- tail call fastcc void @_ZNSolsEi( )
- ret void
-}
-
-define fastcc void @_ZNSolsEi() {
-entry:
- %tmp.22 = icmp eq i32 0, 0 ; <i1> [#uses=1]
- br i1 %tmp.22, label %else, label %then
-
-then: ; preds = %entry
- ret void
-
-else: ; preds = %entry
- tail call fastcc void @_ZNSolsEl( )
- ret void
-}
-
-define void @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_() {
-entry:
- ret void
-}
-
-define fastcc void @_ZNSt9basic_iosIcSt11char_traitsIcEE8setstateESt12_Ios_Iostate() {
-entry:
- tail call fastcc void @_ZSt19__throw_ios_failurePKc( )
- ret void
-}
-
-define fastcc void @_ZNSo3putEc() {
-entry:
- ret void
-}
-
-define fastcc void @_ZNSolsEl() {
-entry:
- %tmp.21.i = icmp eq %"struct.std::basic_ostream<char,std::char_traits<char> >"* null, null ; <i1> [#uses=1]
- br i1 %tmp.21.i, label %endif.0.i, label %shortcirc_next.i
-
-shortcirc_next.i: ; preds = %entry
- ret void
-
-endif.0.i: ; preds = %entry
- call fastcc void @_ZNSt9basic_iosIcSt11char_traitsIcEE8setstateESt12_Ios_Iostate( )
- ret void
-}
-
-define fastcc void @_ZSt19__throw_ios_failurePKc() {
-entry:
- call fastcc void @_ZNSsC1EPKcRKSaIcE( )
- ret void
-}
-
-define fastcc void @_ZNSt8ios_baseD2Ev() {
-entry:
- unreachable
-}
-
-define void @_ZN9__gnu_cxx18stdio_sync_filebufIwSt11char_traitsIwEE5uflowEv() {
-entry:
- unreachable
-}
-
-define void @_ZN9__gnu_cxx18stdio_sync_filebufIcSt11char_traitsIcEED1Ev() {
-entry:
- unreachable
-}
-
-define void @_ZNSt15basic_streambufIcSt11char_traitsIcEE6setbufEPci() {
-entry:
- ret void
-}
-
-define fastcc void @_ZSt9use_facetISt5ctypeIcEERKT_RKSt6locale() {
-entry:
- ret void
-}
-
-declare fastcc void @_ZNSaIcED1Ev()
-
-define fastcc void @_ZSt19__throw_logic_errorPKc() {
-entry:
- call fastcc void @_ZNSt11logic_errorC1ERKSs( )
- ret void
-}
-
-define fastcc void @_ZNSs4_Rep9_S_createEjRKSaIcE() {
-entry:
- br i1 false, label %then.0, label %endif.0
-
-then.0: ; preds = %entry
- call fastcc void @_ZSt20__throw_length_errorPKc( )
- ret void
-
-endif.0: ; preds = %entry
- ret void
-}
-
-define fastcc void @_ZSt20__throw_length_errorPKc() {
-entry:
- call fastcc void @_ZNSt12length_errorC1ERKSs( )
- unwind
-}
-
-define fastcc void @_ZNSs16_S_construct_auxIPKcEEPcT_S3_RKSaIcE12__false_type() {
-entry:
- br i1 false, label %then.1.i, label %endif.1.i
-
-then.1.i: ; preds = %entry
- call fastcc void @_ZSt19__throw_logic_errorPKc( )
- ret void
-
-endif.1.i: ; preds = %entry
- call fastcc void @_ZNSs4_Rep9_S_createEjRKSaIcE( )
- unreachable
-}
-
-define fastcc void @_ZNSsC1ERKSs() {
-entry:
- call fastcc void @_ZNSs4_Rep7_M_grabERKSaIcES2_( )
- invoke fastcc void @_ZNSaIcEC1ERKS_( )
- to label %invoke_cont.1 unwind label %invoke_catch.1
-
-invoke_catch.1: ; preds = %entry
- call fastcc void @_ZNSaIcED1Ev( )
- unwind
-
-invoke_cont.1: ; preds = %entry
- call fastcc void @_ZNSaIcEC2ERKS_( )
- ret void
-}
-
-define fastcc void @_ZNSs7reserveEj() {
-entry:
- ret void
-}
-
-define fastcc void @_ZNSaIcEC1ERKS_() {
-entry:
- ret void
-}
-
-define fastcc void @_ZNSs4_Rep7_M_grabERKSaIcES2_() {
-entry:
- br i1 false, label %else.i, label %cond_true
-
-cond_true: ; preds = %entry
- ret void
-
-else.i: ; preds = %entry
- tail call fastcc void @_ZNSs4_Rep9_S_createEjRKSaIcE( )
- ret void
-}
-
-define fastcc void @_ZNSsC1EPKcRKSaIcE() {
-entry:
- tail call fastcc void @_ZNSs16_S_construct_auxIPKcEEPcT_S3_RKSaIcE12__false_type( )
- unreachable
-}
-
-define fastcc void @_ZNSaIcEC2ERKS_() {
-entry:
- ret void
-}
-
-define void @_ZNSt7num_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEED1Ev() {
-entry:
- unreachable
-}
-
-define void @_ZNSt14collate_bynameIcED1Ev() {
-entry:
- unreachable
-}
-
-define void @_ZNKSt7num_getIcSt19istreambuf_iteratorIcSt11char_traitsIcEEE6do_getES3_S3_RSt8ios_baseRSt12_Ios_IostateRy() {
-entry:
- ret void
-}
-
-define void @_ZNSt23__codecvt_abstract_baseIcc11__mbstate_tED1Ev() {
-entry:
- unreachable
-}
-
-define void @_ZNSt12ctype_bynameIcED0Ev() {
-entry:
- unreachable
-}
-
-define fastcc void @_ZNSt8messagesIwEC1Ej() {
-entry:
- ret void
-}
-
-define fastcc void @_ZSt14__convert_to_vIlEvPKcRT_RSt12_Ios_IostateRKP15__locale_structi() {
-entry:
- ret void
-}
-
-define fastcc void @_ZNSt8time_getIwSt19istreambuf_iteratorIwSt11char_traitsIwEEEC1Ej() {
-entry:
- ret void
-}
-
-define fastcc void @_ZNSt8time_getIcSt19istreambuf_iteratorIcSt11char_traitsIcEEEC1Ej() {
-entry:
- ret void
-}
-
-define fastcc void @_ZNKSt7num_getIwSt19istreambuf_iteratorIwSt11char_traitsIwEEE16_M_extract_floatES3_S3_RSt8ios_baseRSt12_Ios_IostateRSs() {
-entry:
- unreachable
-}
-
-define fastcc void @_ZNSbIwSt11char_traitsIwESaIwEE4swapERS2_() {
-entry:
- ret void
-}
-
-define void @_ZNSt14basic_iostreamIwSt11char_traitsIwEED0Ev() {
-entry:
- unreachable
-}
-
-define void @_ZNSt15basic_streambufIcSt11char_traitsIcEE9showmanycEv() {
-entry:
- ret void
-}
-
-define void @_ZNSt9exceptionD0Ev() {
-entry:
- unreachable
-}
-
-define fastcc void @_ZNSt11logic_errorC1ERKSs() {
-entry:
- call fastcc void @_ZNSsC1ERKSs( )
- ret void
-}
-
-define fastcc void @_ZNSt11logic_errorD2Ev() {
-entry:
- unreachable
-}
-
-define fastcc void @_ZNSt12length_errorC1ERKSs() {
-entry:
- invoke fastcc void @_ZNSsC1ERKSs( )
- to label %_ZNSt11logic_errorC2ERKSs.exit unwind label %invoke_catch.i
-
-invoke_catch.i: ; preds = %entry
- unwind
-
-_ZNSt11logic_errorC2ERKSs.exit: ; preds = %entry
- ret void
-}
-
-define void @_ZNK10__cxxabiv120__si_class_type_info20__do_find_public_srcEiPKvPKNS_17__class_type_infoES2_() {
-entry:
- ret void
-}
-
-define fastcc void @_ZNSbIwSt11char_traitsIwESaIwEE16_S_construct_auxIPKwEEPwT_S7_RKS1_12__false_type() {
-entry:
- ret void
-}
-
-define void @_ZTv0_n12_NSt13basic_fstreamIwSt11char_traitsIwEED1Ev() {
-entry:
- ret void
-}
-
-define void @_ZNSt13basic_fstreamIcSt11char_traitsIcEED1Ev() {
-entry:
- unreachable
-}
-
-define fastcc void @_ZNSt5ctypeIcEC1EPKtbj() {
-entry:
- ret void
-}
diff --git a/release_23/test/Transforms/Inline/2007-04-15-InlineEH.ll b/release_23/test/Transforms/Inline/2007-04-15-InlineEH.ll
deleted file mode 100644
index 083a328ae673..000000000000
--- a/release_23/test/Transforms/Inline/2007-04-15-InlineEH.ll
+++ /dev/null
@@ -1,49 +0,0 @@
-; RUN: llvm-as < %s | opt -inline | llvm-dis | not grep {invoke void asm}
-; PR1335
-
-target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64"
-target triple = "i686-pc-linux-gnu"
- %struct.gnat__strings__string_access = type { i8*, %struct.string___XUB* }
- %struct.string___XUB = type { i32, i32 }
-
-define void @bc__support__high_resolution_time__clock() {
-entry:
- call void asm "rdtsc\0A\09movl %eax, $0\0A\09movl %edx, $1", "=*imr,=*imr,~{dirflag},~{fpsr},~{flags},~{dx},~{ax}"( i32* null, i32* null ) nounwind
- unreachable
-}
-
-define fastcc void @bc__support__high_resolution_time__initialize_clock_rate() {
-entry:
- invoke void @gnat__os_lib__getenv( %struct.gnat__strings__string_access* null )
- to label %invcont unwind label %cleanup144
-
-invcont: ; preds = %entry
- invoke void @ada__calendar__delays__delay_for( )
- to label %invcont64 unwind label %cleanup144
-
-invcont64: ; preds = %invcont
- invoke void @ada__calendar__clock( )
- to label %invcont65 unwind label %cleanup144
-
-invcont65: ; preds = %invcont64
- invoke void @bc__support__high_resolution_time__clock( )
- to label %invcont67 unwind label %cleanup144
-
-invcont67: ; preds = %invcont65
- ret void
-
-cleanup144: ; preds = %invcont65, %invcont64, %invcont, %entry
- unwind
-}
-
-declare void @gnat__os_lib__getenv(%struct.gnat__strings__string_access*)
-
-declare void @ada__calendar__delays__delay_for()
-
-declare void @ada__calendar__clock()
-
-define void @bc__support__high_resolution_time___elabb() {
-entry:
- call fastcc void @bc__support__high_resolution_time__initialize_clock_rate( )
- ret void
-}
diff --git a/release_23/test/Transforms/Inline/2007-06-06-NoInline.ll b/release_23/test/Transforms/Inline/2007-06-06-NoInline.ll
deleted file mode 100644
index 51bba0705338..000000000000
--- a/release_23/test/Transforms/Inline/2007-06-06-NoInline.ll
+++ /dev/null
@@ -1,46 +0,0 @@
-; RUN: llvm-as < %s | opt -inline -f - | llvm-dis | grep "define internal i32 @bar"
-@llvm.noinline = appending global [1 x i8*] [ i8* bitcast (i32 (i32, i32)* @bar to i8*) ], section "llvm.metadata" ; <[1 x i8*]*> [#uses=0]
-
-define internal i32 @bar(i32 %x, i32 %y) {
-entry:
- %x_addr = alloca i32 ; <i32*> [#uses=2]
- %y_addr = alloca i32 ; <i32*> [#uses=2]
- %retval = alloca i32, align 4 ; <i32*> [#uses=2]
- %tmp = alloca i32, align 4 ; <i32*> [#uses=2]
- %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
- store i32 %x, i32* %x_addr
- store i32 %y, i32* %y_addr
- %tmp1 = load i32* %x_addr ; <i32> [#uses=1]
- %tmp2 = load i32* %y_addr ; <i32> [#uses=1]
- %tmp3 = add i32 %tmp1, %tmp2 ; <i32> [#uses=1]
- store i32 %tmp3, i32* %tmp
- %tmp4 = load i32* %tmp ; <i32> [#uses=1]
- store i32 %tmp4, i32* %retval
- br label %return
-
-return: ; preds = %entry
- %retval5 = load i32* %retval ; <i32> [#uses=1]
- ret i32 %retval5
-}
-
-define i32 @foo(i32 %a, i32 %b) {
-entry:
- %a_addr = alloca i32 ; <i32*> [#uses=2]
- %b_addr = alloca i32 ; <i32*> [#uses=2]
- %retval = alloca i32, align 4 ; <i32*> [#uses=2]
- %tmp = alloca i32, align 4 ; <i32*> [#uses=2]
- %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
- store i32 %a, i32* %a_addr
- store i32 %b, i32* %b_addr
- %tmp1 = load i32* %b_addr ; <i32> [#uses=1]
- %tmp2 = load i32* %a_addr ; <i32> [#uses=1]
- %tmp3 = call i32 @bar( i32 %tmp1, i32 %tmp2 ) ; <i32> [#uses=1]
- store i32 %tmp3, i32* %tmp
- %tmp4 = load i32* %tmp ; <i32> [#uses=1]
- store i32 %tmp4, i32* %retval
- br label %return
-
-return: ; preds = %entry
- %retval5 = load i32* %retval ; <i32> [#uses=1]
- ret i32 %retval5
-}
diff --git a/release_23/test/Transforms/Inline/2007-06-25-WeakInline.ll b/release_23/test/Transforms/Inline/2007-06-25-WeakInline.ll
deleted file mode 100644
index 3cf758ca8c8e..000000000000
--- a/release_23/test/Transforms/Inline/2007-06-25-WeakInline.ll
+++ /dev/null
@@ -1,14 +0,0 @@
-; RUN: llvm-as < %s | opt -inline | llvm-dis | grep call
-
-; 'bar' can be overridden at link-time, don't inline it.
-
-define void @foo() {
-entry:
- tail call void @bar( ) ; <i32> [#uses=0]
- ret void
-}
-
-define weak void @bar() {
- ret void
-}
-
diff --git a/release_23/test/Transforms/Inline/2007-12-19-InlineNoUnwind.ll b/release_23/test/Transforms/Inline/2007-12-19-InlineNoUnwind.ll
deleted file mode 100644
index 6264f8f01c3f..000000000000
--- a/release_23/test/Transforms/Inline/2007-12-19-InlineNoUnwind.ll
+++ /dev/null
@@ -1,19 +0,0 @@
-; RUN: llvm-as < %s -o - | opt -inline | llvm-dis | grep nounwind
-; RUN: llvm-as < %s -o - | opt -inline | llvm-dis | grep unreachable
-
-declare i1 @extern()
-
-define internal i32 @test() {
-entry:
- %n = call i1 @extern( )
- br i1 %n, label %r, label %u
-r:
- ret i32 0;
-u:
- unwind
-}
-
-define i32 @caller() {
- %X = call i32 @test( ) nounwind
- ret i32 %X
-}
diff --git a/release_23/test/Transforms/Inline/2008-03-04-StructRet.ll b/release_23/test/Transforms/Inline/2008-03-04-StructRet.ll
deleted file mode 100644
index fc7ebc4d8095..000000000000
--- a/release_23/test/Transforms/Inline/2008-03-04-StructRet.ll
+++ /dev/null
@@ -1,28 +0,0 @@
-; RUN: llvm-as < %s | opt -inline -disable-output
- %struct.Benchmark = type { i32 (...)** }
- %struct.Complex = type { double, double }
- %struct.ComplexBenchmark = type { %struct.Benchmark }
-
-define %struct.Complex @_Zml7ComplexS_1(double %a.0, double %a.1, double %b.0, double %b.1) nounwind {
-entry:
- %mrv = alloca %struct.Complex ; <%struct.Complex*> [#uses=2]
- %mrv.gep = getelementptr %struct.Complex* %mrv, i32 0, i32 0 ; <double*> [#uses=1]
- %mrv.ld = load double* %mrv.gep ; <double> [#uses=1]
- %mrv.gep1 = getelementptr %struct.Complex* %mrv, i32 0, i32 1 ; <double*> [#uses=1]
- %mrv.ld2 = load double* %mrv.gep1 ; <double> [#uses=1]
- ret double %mrv.ld, double %mrv.ld2
-}
-
-define void @_ZNK16ComplexBenchmark9oop_styleEv(%struct.ComplexBenchmark* %this) nounwind {
-entry:
- %tmp = alloca %struct.Complex ; <%struct.Complex*> [#uses=0]
- br label %bb31
-bb: ; preds = %bb31
- call %struct.Complex @_Zml7ComplexS_1( double 0.000000e+00, double 0.000000e+00, double 0.000000e+00, double 0.000000e+00 ) nounwind ; <%struct.Complex>:0 [#uses=1]
- %gr = getresult %struct.Complex %0, 1 ; <double> [#uses=0]
- br label %bb31
-bb31: ; preds = %bb, %entry
- br i1 false, label %bb, label %return
-return: ; preds = %bb31
- ret void
-}
diff --git a/release_23/test/Transforms/Inline/alloca_test.ll b/release_23/test/Transforms/Inline/alloca_test.ll
deleted file mode 100644
index 1fbd095354a9..000000000000
--- a/release_23/test/Transforms/Inline/alloca_test.ll
+++ /dev/null
@@ -1,21 +0,0 @@
-; This test ensures that alloca instructions in the entry block for an inlined
-; function are moved to the top of the function they are inlined into.
-;
-; RUN: llvm-as < %s | opt -inline | llvm-dis | %prcontext alloca 1 | grep Entry:
-
-define i32 @func(i32 %i) {
- %X = alloca i32 ; <i32*> [#uses=1]
- store i32 %i, i32* %X
- ret i32 %i
-}
-
-declare void @bar()
-
-define i32 @main(i32 %argc) {
-Entry:
- call void @bar( )
- %X = call i32 @func( i32 7 ) ; <i32> [#uses=1]
- %Y = add i32 %X, %argc ; <i32> [#uses=1]
- ret i32 %Y
-}
-
diff --git a/release_23/test/Transforms/Inline/basictest.ll b/release_23/test/Transforms/Inline/basictest.ll
deleted file mode 100644
index f34d1648a701..000000000000
--- a/release_23/test/Transforms/Inline/basictest.ll
+++ /dev/null
@@ -1,12 +0,0 @@
-; RUN: llvm-as < %s | opt -inline -disable-output -print
-
-define i32 @func(i32 %i) {
- ret i32 %i
-}
-
-define i32 @main(i32 %argc) {
- %X = call i32 @func( i32 7 ) ; <i32> [#uses=1]
- %Y = add i32 %X, %argc ; <i32> [#uses=1]
- ret i32 %Y
-}
-
diff --git a/release_23/test/Transforms/Inline/byval.ll b/release_23/test/Transforms/Inline/byval.ll
deleted file mode 100644
index ea8c35760386..000000000000
--- a/release_23/test/Transforms/Inline/byval.ll
+++ /dev/null
@@ -1,28 +0,0 @@
-; RUN: llvm-as < %s | opt -inline | llvm-dis | grep {llvm.memcpy}
-
-; Inlining a byval struct should cause an explicit copy into an alloca.
-
- %struct.ss = type { i32, i64 }
-@.str = internal constant [10 x i8] c"%d, %lld\0A\00" ; <[10 x i8]*> [#uses=1]
-
-define internal void @f(%struct.ss* byval %b) nounwind {
-entry:
- %tmp = getelementptr %struct.ss* %b, i32 0, i32 0 ; <i32*> [#uses=2]
- %tmp1 = load i32* %tmp, align 4 ; <i32> [#uses=1]
- %tmp2 = add i32 %tmp1, 1 ; <i32> [#uses=1]
- store i32 %tmp2, i32* %tmp, align 4
- ret void
-}
-
-declare i32 @printf(i8*, ...) nounwind
-
-define i32 @main() nounwind {
-entry:
- %S = alloca %struct.ss ; <%struct.ss*> [#uses=4]
- %tmp1 = getelementptr %struct.ss* %S, i32 0, i32 0 ; <i32*> [#uses=1]
- store i32 1, i32* %tmp1, align 8
- %tmp4 = getelementptr %struct.ss* %S, i32 0, i32 1 ; <i64*> [#uses=1]
- store i64 2, i64* %tmp4, align 4
- call void @f( %struct.ss* byval %S ) nounwind
- ret i32 0
-}
diff --git a/release_23/test/Transforms/Inline/byval2.ll b/release_23/test/Transforms/Inline/byval2.ll
deleted file mode 100644
index e949d01856d4..000000000000
--- a/release_23/test/Transforms/Inline/byval2.ll
+++ /dev/null
@@ -1,28 +0,0 @@
-; RUN: llvm-as < %s | opt -inline | llvm-dis | not grep {llvm.memcpy}
-
-; Inlining a byval struct should NOT cause an explicit copy
-; into an alloca if the function is readonly
-
- %struct.ss = type { i32, i64 }
-@.str = internal constant [10 x i8] c"%d, %lld\0A\00" ; <[10 x i8]*> [#uses=1]
-
-define internal i32 @f(%struct.ss* byval %b) nounwind readonly {
-entry:
- %tmp = getelementptr %struct.ss* %b, i32 0, i32 0 ; <i32*> [#uses=2]
- %tmp1 = load i32* %tmp, align 4 ; <i32> [#uses=1]
- %tmp2 = add i32 %tmp1, 1 ; <i32> [#uses=1]
- ret i32 %tmp2
-}
-
-declare i32 @printf(i8*, ...) nounwind
-
-define i32 @main() nounwind {
-entry:
- %S = alloca %struct.ss ; <%struct.ss*> [#uses=4]
- %tmp1 = getelementptr %struct.ss* %S, i32 0, i32 0 ; <i32*> [#uses=1]
- store i32 1, i32* %tmp1, align 8
- %tmp4 = getelementptr %struct.ss* %S, i32 0, i32 1 ; <i64*> [#uses=1]
- store i64 2, i64* %tmp4, align 4
- %X = call i32 @f( %struct.ss* byval %S ) nounwind
- ret i32 %X
-}
diff --git a/release_23/test/Transforms/Inline/casts.ll b/release_23/test/Transforms/Inline/casts.ll
deleted file mode 100644
index 029d309fd8e0..000000000000
--- a/release_23/test/Transforms/Inline/casts.ll
+++ /dev/null
@@ -1,19 +0,0 @@
-; RUN: llvm-as < %s | opt -inline | llvm-dis | grep {ret i32 1}
-; ModuleID = 'short.opt.bc'
-
-define i32 @testBool(i1 %X) {
- %tmp = zext i1 %X to i32 ; <i32> [#uses=1]
- ret i32 %tmp
-}
-
-define i32 @testByte(i8 %X) {
- %tmp = icmp ne i8 %X, 0 ; <i1> [#uses=1]
- %tmp.i = zext i1 %tmp to i32 ; <i32> [#uses=1]
- ret i32 %tmp.i
-}
-
-define i32 @main() {
- %rslt = call i32 @testByte( i8 123 ) ; <i32> [#uses=1]
- ret i32 %rslt
-}
-
diff --git a/release_23/test/Transforms/Inline/cfg_preserve_test.ll b/release_23/test/Transforms/Inline/cfg_preserve_test.ll
deleted file mode 100644
index 6b6ff18ecfd0..000000000000
--- a/release_23/test/Transforms/Inline/cfg_preserve_test.ll
+++ /dev/null
@@ -1,16 +0,0 @@
-; This test ensures that inlining an "empty" function does not destroy the CFG
-;
-; RUN: llvm-as < %s | opt -inline | llvm-dis | not grep br
-
-define i32 @func(i32 %i) {
- ret i32 %i
-}
-
-declare void @bar()
-
-define i32 @main(i32 %argc) {
-Entry:
- %X = call i32 @func( i32 7 ) ; <i32> [#uses=1]
- ret i32 %X
-}
-
diff --git a/release_23/test/Transforms/Inline/dg.exp b/release_23/test/Transforms/Inline/dg.exp
deleted file mode 100644
index 879685ca879d..000000000000
--- a/release_23/test/Transforms/Inline/dg.exp
+++ /dev/null
@@ -1,3 +0,0 @@
-load_lib llvm.exp
-
-RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
diff --git a/release_23/test/Transforms/Inline/dynamic_alloca_test.ll b/release_23/test/Transforms/Inline/dynamic_alloca_test.ll
deleted file mode 100644
index 87707120e687..000000000000
--- a/release_23/test/Transforms/Inline/dynamic_alloca_test.ll
+++ /dev/null
@@ -1,31 +0,0 @@
-; Test that functions with dynamic allocas get inlined in a case where
-; naively inlining it would result in a miscompilation.
-
-; RUN: llvm-as < %s | opt -inline | llvm-dis | \
-; RUN: grep llvm.stacksave
-; RUN: llvm-as < %s | opt -inline | llvm-dis | not grep callee
-
-
-declare void @ext(i32*)
-
-define internal void @callee(i32 %N) {
- %P = alloca i32, i32 %N ; <i32*> [#uses=1]
- call void @ext( i32* %P )
- ret void
-}
-
-define void @foo(i32 %N) {
-; <label>:0
- br label %Loop
-
-Loop: ; preds = %Loop, %0
- %count = phi i32 [ 0, %0 ], [ %next, %Loop ] ; <i32> [#uses=2]
- %next = add i32 %count, 1 ; <i32> [#uses=1]
- call void @callee( i32 %N )
- %cond = icmp eq i32 %count, 100000 ; <i1> [#uses=1]
- br i1 %cond, label %out, label %Loop
-
-out: ; preds = %Loop
- ret void
-}
-
diff --git a/release_23/test/Transforms/Inline/inline-tail.ll b/release_23/test/Transforms/Inline/inline-tail.ll
deleted file mode 100644
index 5921655b7364..000000000000
--- a/release_23/test/Transforms/Inline/inline-tail.ll
+++ /dev/null
@@ -1,15 +0,0 @@
-; RUN: llvm-as < %s | opt -inline | llvm-dis | not grep tail
-
-declare void @bar(i32*)
-
-define internal void @foo(i32* %P) {
- tail call void @bar( i32* %P )
- ret void
-}
-
-define void @caller() {
- %A = alloca i32 ; <i32*> [#uses=1]
- call void @foo( i32* %A )
- ret void
-}
-
diff --git a/release_23/test/Transforms/Inline/inline_cleanup.ll b/release_23/test/Transforms/Inline/inline_cleanup.ll
deleted file mode 100644
index 89b3a8283c06..000000000000
--- a/release_23/test/Transforms/Inline/inline_cleanup.ll
+++ /dev/null
@@ -1,63 +0,0 @@
-; Test that the inliner doesn't leave around dead allocas, and that it folds
-; uncond branches away after it is done specializing.
-
-; RUN: llvm-as < %s | opt -inline | llvm-dis | \
-; RUN: not grep {alloca.*uses=0}
-; RUN: llvm-as < %s | opt -inline | llvm-dis | \
-; RUN: not grep {br label}
-@A = weak global i32 0 ; <i32*> [#uses=1]
-@B = weak global i32 0 ; <i32*> [#uses=1]
-@C = weak global i32 0 ; <i32*> [#uses=1]
-
-define internal fastcc void @foo(i32 %X) {
-entry:
- %ALL = alloca i32, align 4 ; <i32*> [#uses=1]
- %tmp1 = and i32 %X, 1 ; <i32> [#uses=1]
- %tmp1.upgrd.1 = icmp eq i32 %tmp1, 0 ; <i1> [#uses=1]
- br i1 %tmp1.upgrd.1, label %cond_next, label %cond_true
-
-cond_true: ; preds = %entry
- store i32 1, i32* @A
- br label %cond_next
-
-cond_next: ; preds = %cond_true, %entry
- %tmp4 = and i32 %X, 2 ; <i32> [#uses=1]
- %tmp4.upgrd.2 = icmp eq i32 %tmp4, 0 ; <i1> [#uses=1]
- br i1 %tmp4.upgrd.2, label %cond_next7, label %cond_true5
-
-cond_true5: ; preds = %cond_next
- store i32 1, i32* @B
- br label %cond_next7
-
-cond_next7: ; preds = %cond_true5, %cond_next
- %tmp10 = and i32 %X, 4 ; <i32> [#uses=1]
- %tmp10.upgrd.3 = icmp eq i32 %tmp10, 0 ; <i1> [#uses=1]
- br i1 %tmp10.upgrd.3, label %cond_next13, label %cond_true11
-
-cond_true11: ; preds = %cond_next7
- store i32 1, i32* @C
- br label %cond_next13
-
-cond_next13: ; preds = %cond_true11, %cond_next7
- %tmp16 = and i32 %X, 8 ; <i32> [#uses=1]
- %tmp16.upgrd.4 = icmp eq i32 %tmp16, 0 ; <i1> [#uses=1]
- br i1 %tmp16.upgrd.4, label %UnifiedReturnBlock, label %cond_true17
-
-cond_true17: ; preds = %cond_next13
- call void @ext( i32* %ALL )
- ret void
-
-UnifiedReturnBlock: ; preds = %cond_next13
- ret void
-}
-
-declare void @ext(i32*)
-
-define void @test() {
-entry:
- tail call fastcc void @foo( i32 1 )
- tail call fastcc void @foo( i32 2 )
- tail call fastcc void @foo( i32 3 )
- tail call fastcc void @foo( i32 8 )
- ret void
-}
diff --git a/release_23/test/Transforms/Inline/inline_constprop.ll b/release_23/test/Transforms/Inline/inline_constprop.ll
deleted file mode 100644
index 4744c862335b..000000000000
--- a/release_23/test/Transforms/Inline/inline_constprop.ll
+++ /dev/null
@@ -1,14 +0,0 @@
-; RUN: llvm-as < %s | opt -inline | llvm-dis | not grep callee
-; RUN: llvm-as < %s | opt -inline | llvm-dis | not grep div
-
-
-define internal i32 @callee(i32 %A, i32 %B) {
- %C = sdiv i32 %A, %B ; <i32> [#uses=1]
- ret i32 %C
-}
-
-define i32 @test() {
- %X = call i32 @callee( i32 10, i32 3 ) ; <i32> [#uses=1]
- ret i32 %X
-}
-
diff --git a/release_23/test/Transforms/Inline/inline_dce.ll b/release_23/test/Transforms/Inline/inline_dce.ll
deleted file mode 100644
index dd971bee9300..000000000000
--- a/release_23/test/Transforms/Inline/inline_dce.ll
+++ /dev/null
@@ -1,25 +0,0 @@
-; This checks to ensure that the inline pass deletes functions if they get
-; inlined into all of their callers.
-
-; RUN: llvm-as < %s | opt -inline | llvm-dis | \
-; RUN: not grep @reallysmall
-
-define internal i32 @reallysmall(i32 %A) {
- ret i32 %A
-}
-
-define void @caller1() {
- call i32 @reallysmall( i32 5 ) ; <i32>:1 [#uses=0]
- ret void
-}
-
-define void @caller2(i32 %A) {
- call i32 @reallysmall( i32 %A ) ; <i32>:1 [#uses=0]
- ret void
-}
-
-define i32 @caller3(i32 %A) {
- %B = call i32 @reallysmall( i32 %A ) ; <i32> [#uses=1]
- ret i32 %B
-}
-
diff --git a/release_23/test/Transforms/Inline/inline_prune.ll b/release_23/test/Transforms/Inline/inline_prune.ll
deleted file mode 100644
index fcd8321d5a0f..000000000000
--- a/release_23/test/Transforms/Inline/inline_prune.ll
+++ /dev/null
@@ -1,45 +0,0 @@
-; RUN: llvm-as < %s | opt -inline | llvm-dis | \
-; RUN: not grep {callee\[12\](}
-; RUN: llvm-as < %s | opt -inline | llvm-dis | not grep mul
-
-define internal i32 @callee1(i32 %A, i32 %B) {
- %cond = icmp eq i32 %A, 123 ; <i1> [#uses=1]
- br i1 %cond, label %T, label %F
-
-T: ; preds = %0
- %C = mul i32 %B, %B ; <i32> [#uses=1]
- ret i32 %C
-
-F: ; preds = %0
- ret i32 0
-}
-
-define internal i32 @callee2(i32 %A, i32 %B) {
- switch i32 %A, label %T [
- i32 10, label %F
- i32 1234, label %G
- ]
- ; No predecessors!
- %cond = icmp eq i32 %A, 123 ; <i1> [#uses=1]
- br i1 %cond, label %T, label %F
-
-T: ; preds = %1, %0
- %C = mul i32 %B, %B ; <i32> [#uses=1]
- ret i32 %C
-
-F: ; preds = %1, %0
- ret i32 0
-
-G: ; preds = %0
- %D = mul i32 %B, %B ; <i32> [#uses=1]
- %E = mul i32 %D, %B ; <i32> [#uses=1]
- ret i32 %E
-}
-
-define i32 @test(i32 %A) {
- %X = call i32 @callee1( i32 10, i32 %A ) ; <i32> [#uses=1]
- %Y = call i32 @callee2( i32 10, i32 %A ) ; <i32> [#uses=1]
- %Z = add i32 %X, %Y ; <i32> [#uses=1]
- ret i32 %Z
-}
-
diff --git a/release_23/test/Transforms/Inline/invoke_test-1.ll b/release_23/test/Transforms/Inline/invoke_test-1.ll
deleted file mode 100644
index 1fd3317fd1f2..000000000000
--- a/release_23/test/Transforms/Inline/invoke_test-1.ll
+++ /dev/null
@@ -1,24 +0,0 @@
-; Test that we can inline a simple function, turning the calls in it into invoke
-; instructions
-
-; RUN: llvm-as < %s | opt -inline | llvm-dis | \
-; RUN: not grep {call\[^e\]}
-
-declare void @might_throw()
-
-define internal void @callee() {
- call void @might_throw( )
- ret void
-}
-
-; caller returns true if might_throw throws an exception...
-define i32 @caller() {
- invoke void @callee( )
- to label %cont unwind label %exc
-
-cont: ; preds = %0
- ret i32 0
-
-exc: ; preds = %0
- ret i32 1
-}
diff --git a/release_23/test/Transforms/Inline/invoke_test-2.ll b/release_23/test/Transforms/Inline/invoke_test-2.ll
deleted file mode 100644
index 68b8bd8b65a3..000000000000
--- a/release_23/test/Transforms/Inline/invoke_test-2.ll
+++ /dev/null
@@ -1,30 +0,0 @@
-; Test that if an invoked function is inlined, and if that function cannot
-; throw, that the dead handler is now unreachable.
-
-; RUN: llvm-as < %s | opt -inline -simplifycfg | llvm-dis | \
-; RUN: not grep UnreachableExceptionHandler
-
-declare void @might_throw()
-
-define internal i32 @callee() {
- invoke void @might_throw( )
- to label %cont unwind label %exc
-
-cont: ; preds = %0
- ret i32 0
-
-exc: ; preds = %0
- ret i32 1
-}
-
-; caller returns true if might_throw throws an exception... callee cannot throw.
-define i32 @caller() {
- %X = invoke i32 @callee( )
- to label %cont unwind label %UnreachableExceptionHandler ; <i32> [#uses=1]
-
-cont: ; preds = %0
- ret i32 %X
-
-UnreachableExceptionHandler: ; preds = %0
- ret i32 -1
-}
diff --git a/release_23/test/Transforms/Inline/invoke_test-3.ll b/release_23/test/Transforms/Inline/invoke_test-3.ll
deleted file mode 100644
index a5deec6aa881..000000000000
--- a/release_23/test/Transforms/Inline/invoke_test-3.ll
+++ /dev/null
@@ -1,32 +0,0 @@
-; Test that any rethrown exceptions in an inlined function are automatically
-; turned into branches to the invoke destination.
-
-; RUN: llvm-as < %s | opt -inline | llvm-dis | not grep unwind$
-
-declare void @might_throw()
-
-define internal i32 @callee() {
- invoke void @might_throw( )
- to label %cont unwind label %exc
-
-cont: ; preds = %0
- ret i32 0
-
-exc: ; preds = %0a
- ; This just rethrows the exception!
- unwind
-}
-
-; caller returns true if might_throw throws an exception... which gets
-; propagated by callee.
-define i32 @caller() {
- %X = invoke i32 @callee( )
- to label %cont unwind label %Handler ; <i32> [#uses=1]
-
-cont: ; preds = %0
- ret i32 %X
-
-Handler: ; preds = %0
-; This consumes an exception thrown by might_throw
- ret i32 1
-}
diff --git a/release_23/test/Transforms/InstCombine/2002-03-11-InstCombineHang.ll b/release_23/test/Transforms/InstCombine/2002-03-11-InstCombineHang.ll
deleted file mode 100644
index 94ce68e989b3..000000000000
--- a/release_23/test/Transforms/InstCombine/2002-03-11-InstCombineHang.ll
+++ /dev/null
@@ -1,9 +0,0 @@
-; This testcase causes instcombine to hang.
-;
-; RUN: llvm-as < %s | opt -instcombine
-
-define void @test(i32 %X) {
- %reg117 = add i32 %X, 0 ; <i32> [#uses=0]
- ret void
-}
-
diff --git a/release_23/test/Transforms/InstCombine/2002-05-14-SubFailure.ll b/release_23/test/Transforms/InstCombine/2002-05-14-SubFailure.ll
deleted file mode 100644
index 34c2df605e42..000000000000
--- a/release_23/test/Transforms/InstCombine/2002-05-14-SubFailure.ll
+++ /dev/null
@@ -1,10 +0,0 @@
-; Instcombine was missing a test that caused it to make illegal transformations
-; sometimes. In this case, it transforms the sub into an add:
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep sub
-;
-define i32 @test(i32 %i, i32 %j) {
- %A = mul i32 %i, %j
- %B = sub i32 2, %A
- ret i32 %B
-}
-
diff --git a/release_23/test/Transforms/InstCombine/2002-05-14-TouchDeletedInst.ll b/release_23/test/Transforms/InstCombine/2002-05-14-TouchDeletedInst.ll
deleted file mode 100644
index 4ebbe2470fa4..000000000000
--- a/release_23/test/Transforms/InstCombine/2002-05-14-TouchDeletedInst.ll
+++ /dev/null
@@ -1,508 +0,0 @@
-; This testcase, obviously distilled from a large program (bzip2 from
-; Specint2000) caused instcombine to fail because it got the same instruction
-; on it's worklist more than once (which is ok), but then deleted the
-; instruction. Since the inst stayed on the worklist, as soon as it came back
-; up to be processed, bad things happened, and opt asserted.
-;
-; RUN: llvm-as < %s | opt -instcombine
-;
-; END.
-
-@.LC0 = internal global [21 x i8] c"hbMakeCodeLengths(1)\00" ; <[21 x i8]*> [#uses=1]
-@.LC1 = internal global [21 x i8] c"hbMakeCodeLengths(2)\00" ; <[21 x i8]*> [#uses=1]
-
-define void @hbMakeCodeLengths(i8* %len, i32* %freq, i32 %alphaSize, i32 %maxLen) {
-bb0:
- %len.upgrd.1 = alloca i8* ; <i8**> [#uses=2]
- store i8* %len, i8** %len.upgrd.1
- %freq.upgrd.2 = alloca i32* ; <i32**> [#uses=2]
- store i32* %freq, i32** %freq.upgrd.2
- %alphaSize.upgrd.3 = alloca i32 ; <i32*> [#uses=2]
- store i32 %alphaSize, i32* %alphaSize.upgrd.3
- %maxLen.upgrd.4 = alloca i32 ; <i32*> [#uses=2]
- store i32 %maxLen, i32* %maxLen.upgrd.4
- %heap = alloca i32, i32 260 ; <i32*> [#uses=27]
- %weight = alloca i32, i32 516 ; <i32*> [#uses=18]
- %parent = alloca i32, i32 516 ; <i32*> [#uses=7]
- br label %bb1
-
-bb1: ; preds = %bb0
- %reg107 = load i8** %len.upgrd.1 ; <i8*> [#uses=1]
- %reg108 = load i32** %freq.upgrd.2 ; <i32*> [#uses=1]
- %reg109 = load i32* %alphaSize.upgrd.3 ; <i32> [#uses=10]
- %reg110 = load i32* %maxLen.upgrd.4 ; <i32> [#uses=1]
- %cond747 = icmp sge i32 0, %reg109 ; <i1> [#uses=1]
- br i1 %cond747, label %bb6, label %bb2
-
-bb2: ; preds = %bb5, %bb1
- %reg591 = phi i32 [ %reg594, %bb5 ], [ 0, %bb1 ] ; <i32> [#uses=3]
- %reg591-idxcast1 = bitcast i32 %reg591 to i32 ; <i32> [#uses=1]
- %reg591-idxcast1-offset = add i32 %reg591-idxcast1, 1 ; <i32> [#uses=1]
- %reg591-idxcast1-offset.upgrd.5 = zext i32 %reg591-idxcast1-offset to i64 ; <i64> [#uses=1]
- %reg126 = getelementptr i32* %weight, i64 %reg591-idxcast1-offset.upgrd.5 ; <i32*> [#uses=1]
- %reg591-idxcast = sext i32 %reg591 to i64 ; <i64> [#uses=1]
- %reg132 = getelementptr i32* %reg108, i64 %reg591-idxcast ; <i32*> [#uses=1]
- %reg133 = load i32* %reg132 ; <i32> [#uses=2]
- %cond748 = icmp eq i32 %reg133, 0 ; <i1> [#uses=1]
- br i1 %cond748, label %bb4, label %bb3
-
-bb3: ; preds = %bb2
- %reg127 = shl i32 %reg133, 8 ; <i32> [#uses=1]
- br label %bb5
-
-bb4: ; preds = %bb2
- br label %bb5
-
-bb5: ; preds = %bb4, %bb3
- %reg593 = phi i32 [ 256, %bb4 ], [ %reg127, %bb3 ] ; <i32> [#uses=1]
- store i32 %reg593, i32* %reg126
- %reg594 = add i32 %reg591, 1 ; <i32> [#uses=2]
- %cond749 = icmp slt i32 %reg594, %reg109 ; <i1> [#uses=1]
- br i1 %cond749, label %bb2, label %bb6
-
-bb6: ; preds = %bb43, %bb41, %bb5, %bb1
- store i32 0, i32* %heap
- store i32 0, i32* %weight
- store i32 -2, i32* %parent
- %cond750 = icmp sgt i32 1, %reg109 ; <i1> [#uses=1]
- br i1 %cond750, label %bb11, label %bb7
-
-bb7: ; preds = %bb10, %bb6
- %reg597 = phi i32 [ %reg598, %bb10 ], [ 0, %bb6 ] ; <i32> [#uses=5]
- %reg597-casted = bitcast i32 %reg597 to i32 ; <i32> [#uses=1]
- %reg596 = add i32 %reg597-casted, 1 ; <i32> [#uses=3]
- %reg597-offset = add i32 %reg597, 1 ; <i32> [#uses=1]
- %reg597-offset.upgrd.6 = zext i32 %reg597-offset to i64 ; <i64> [#uses=1]
- %reg149 = getelementptr i32* %parent, i64 %reg597-offset.upgrd.6 ; <i32*> [#uses=1]
- store i32 -1, i32* %reg149
- %reg598 = add i32 %reg597, 1 ; <i32> [#uses=3]
- %reg597-offset1 = add i32 %reg597, 1 ; <i32> [#uses=1]
- %reg597-offset1.upgrd.7 = zext i32 %reg597-offset1 to i64 ; <i64> [#uses=1]
- %reg157 = getelementptr i32* %heap, i64 %reg597-offset1.upgrd.7 ; <i32*> [#uses=1]
- store i32 %reg596, i32* %reg157
- br label %bb9
-
-bb8: ; preds = %bb9
- %reg599 = zext i32 %reg599.upgrd.8 to i64 ; <i64> [#uses=1]
- %reg198 = getelementptr i32* %heap, i64 %reg599 ; <i32*> [#uses=1]
- store i32 %reg182, i32* %reg198
- %cast938 = bitcast i32 %reg174 to i32 ; <i32> [#uses=1]
- br label %bb9
-
-bb9: ; preds = %bb8, %bb7
- %reg599.upgrd.8 = phi i32 [ %cast938, %bb8 ], [ %reg598, %bb7 ] ; <i32> [#uses=3]
- %cast807 = bitcast i32 %reg599.upgrd.8 to i32 ; <i32> [#uses=1]
- %reg597-offset2 = add i32 %reg597, 1 ; <i32> [#uses=1]
- %reg597-offset2.upgrd.9 = zext i32 %reg597-offset2 to i64 ; <i64> [#uses=1]
- %reg173 = getelementptr i32* %weight, i64 %reg597-offset2.upgrd.9 ; <i32*> [#uses=1]
- %reg174 = ashr i32 %cast807, 1 ; <i32> [#uses=2]
- %reg174-idxcast = bitcast i32 %reg174 to i32 ; <i32> [#uses=1]
- zext i32 %reg174-idxcast to i64 ; <i64>:0 [#uses=1]
- %reg181 = getelementptr i32* %heap, i64 %0 ; <i32*> [#uses=1]
- %reg182 = load i32* %reg181 ; <i32> [#uses=2]
- %reg182-idxcast = bitcast i32 %reg182 to i32 ; <i32> [#uses=1]
- zext i32 %reg182-idxcast to i64 ; <i64>:1 [#uses=1]
- %reg189 = getelementptr i32* %weight, i64 %1 ; <i32*> [#uses=1]
- %reg190 = load i32* %reg173 ; <i32> [#uses=1]
- %reg191 = load i32* %reg189 ; <i32> [#uses=1]
- %cond751 = icmp slt i32 %reg190, %reg191 ; <i1> [#uses=1]
- br i1 %cond751, label %bb8, label %bb10
-
-bb10: ; preds = %bb9
- zext i32 %reg599.upgrd.8 to i64 ; <i64>:2 [#uses=1]
- %reg214 = getelementptr i32* %heap, i64 %2 ; <i32*> [#uses=1]
- store i32 %reg596, i32* %reg214
- %reg601 = add i32 %reg596, 1 ; <i32> [#uses=1]
- %cond752 = icmp sle i32 %reg601, %reg109 ; <i1> [#uses=1]
- br i1 %cond752, label %bb7, label %bb11
-
-bb11: ; preds = %bb10, %bb6
- %reg602 = phi i32 [ %reg598, %bb10 ], [ 0, %bb6 ] ; <i32> [#uses=3]
- %cast819 = bitcast i32 %reg602 to i32 ; <i32> [#uses=1]
- %cast818 = bitcast i32 %reg602 to i32 ; <i32> [#uses=1]
- %cond753 = icmp sle i32 %cast818, 259 ; <i1> [#uses=1]
- br i1 %cond753, label %bb13, label %bb12
-
-bb12: ; preds = %bb11
- zext i32 0 to i64 ; <i64>:3 [#uses=1]
- zext i32 0 to i64 ; <i64>:4 [#uses=1]
- %cast784 = getelementptr [21 x i8]* @.LC0, i64 %3, i64 %4 ; <i8*> [#uses=1]
- call void @panic( i8* %cast784 )
- br label %bb13
-
-bb13: ; preds = %bb12, %bb11
- %cond754 = icmp sle i32 %cast819, 1 ; <i1> [#uses=1]
- %cast918 = bitcast i32 %reg109 to i32 ; <i32> [#uses=1]
- %cast940 = bitcast i32 %reg602 to i32 ; <i32> [#uses=1]
- %cast942 = bitcast i32 %reg109 to i32 ; <i32> [#uses=1]
- br i1 %cond754, label %bb32, label %bb14
-
-bb14: ; preds = %bb31, %bb13
- %cann-indvar1 = phi i32 [ 0, %bb13 ], [ %add1-indvar1, %bb31 ] ; <i32> [#uses=3]
- %cann-indvar1-casted = bitcast i32 %cann-indvar1 to i32 ; <i32> [#uses=1]
- %reg603-scale = mul i32 %cann-indvar1-casted, -1 ; <i32> [#uses=1]
- %reg603 = add i32 %reg603-scale, %cast940 ; <i32> [#uses=4]
- %reg604 = add i32 %cann-indvar1, %cast942 ; <i32> [#uses=4]
- %add1-indvar1 = add i32 %cann-indvar1, 1 ; <i32> [#uses=1]
- zext i32 1 to i64 ; <i64>:5 [#uses=1]
- %reg7551 = getelementptr i32* %heap, i64 %5 ; <i32*> [#uses=1]
- %reg113 = load i32* %reg7551 ; <i32> [#uses=2]
- %reg603-idxcast = bitcast i32 %reg603 to i32 ; <i32> [#uses=1]
- zext i32 %reg603-idxcast to i64 ; <i64>:6 [#uses=1]
- %reg222 = getelementptr i32* %heap, i64 %6 ; <i32*> [#uses=1]
- %reg223 = load i32* %reg222 ; <i32> [#uses=1]
- zext i32 1 to i64 ; <i64>:7 [#uses=1]
- %reg7561 = getelementptr i32* %heap, i64 %7 ; <i32*> [#uses=1]
- store i32 %reg223, i32* %reg7561
- %reg605 = add i32 %reg603, -1 ; <i32> [#uses=4]
- zext i32 1 to i64 ; <i64>:8 [#uses=1]
- %reg757 = getelementptr i32* %heap, i64 %8 ; <i32*> [#uses=1]
- %reg226 = load i32* %reg757 ; <i32> [#uses=2]
- %cond758 = icmp sgt i32 2, %reg605 ; <i1> [#uses=1]
- br i1 %cond758, label %bb20, label %bb15
-
-bb15: ; preds = %bb19, %bb14
- %reg606 = phi i32 [ %reg611, %bb19 ], [ 2, %bb14 ] ; <i32> [#uses=6]
- %reg607 = phi i32 [ %reg609, %bb19 ], [ 1, %bb14 ] ; <i32> [#uses=2]
- %cond759 = icmp sge i32 %reg606, %reg605 ; <i1> [#uses=1]
- br i1 %cond759, label %bb18, label %bb16
-
-bb16: ; preds = %bb15
- %reg606-idxcast = bitcast i32 %reg606 to i32 ; <i32> [#uses=1]
- %reg606-idxcast-offset = add i32 %reg606-idxcast, 1 ; <i32> [#uses=1]
- zext i32 %reg606-idxcast-offset to i64 ; <i64>:9 [#uses=1]
- %reg241 = getelementptr i32* %heap, i64 %9 ; <i32*> [#uses=1]
- %reg242 = load i32* %reg241 ; <i32> [#uses=1]
- %reg242-idxcast = bitcast i32 %reg242 to i32 ; <i32> [#uses=1]
- zext i32 %reg242-idxcast to i64 ; <i64>:10 [#uses=1]
- %reg249 = getelementptr i32* %weight, i64 %10 ; <i32*> [#uses=1]
- %reg606-idxcast1 = bitcast i32 %reg606 to i32 ; <i32> [#uses=1]
- zext i32 %reg606-idxcast1 to i64 ; <i64>:11 [#uses=1]
- %reg256 = getelementptr i32* %heap, i64 %11 ; <i32*> [#uses=1]
- %reg257 = load i32* %reg256 ; <i32> [#uses=1]
- %reg257-idxcast = bitcast i32 %reg257 to i32 ; <i32> [#uses=1]
- zext i32 %reg257-idxcast to i64 ; <i64>:12 [#uses=1]
- %reg264 = getelementptr i32* %weight, i64 %12 ; <i32*> [#uses=1]
- %reg265 = load i32* %reg249 ; <i32> [#uses=1]
- %reg266 = load i32* %reg264 ; <i32> [#uses=1]
- %cond760 = icmp sge i32 %reg265, %reg266 ; <i1> [#uses=1]
- br i1 %cond760, label %bb18, label %bb17
-
-bb17: ; preds = %bb16
- %reg608 = add i32 %reg606, 1 ; <i32> [#uses=1]
- br label %bb18
-
-bb18: ; preds = %bb17, %bb16, %bb15
- %reg609 = phi i32 [ %reg608, %bb17 ], [ %reg606, %bb16 ], [ %reg606, %bb15 ] ; <i32> [#uses=4]
- %reg226-idxcast = bitcast i32 %reg226 to i32 ; <i32> [#uses=1]
- zext i32 %reg226-idxcast to i64 ; <i64>:13 [#uses=1]
- %reg273 = getelementptr i32* %weight, i64 %13 ; <i32*> [#uses=1]
- %reg609-idxcast = bitcast i32 %reg609 to i32 ; <i32> [#uses=1]
- zext i32 %reg609-idxcast to i64 ; <i64>:14 [#uses=1]
- %reg280 = getelementptr i32* %heap, i64 %14 ; <i32*> [#uses=1]
- %reg281 = load i32* %reg280 ; <i32> [#uses=2]
- %reg281-idxcast = bitcast i32 %reg281 to i32 ; <i32> [#uses=1]
- zext i32 %reg281-idxcast to i64 ; <i64>:15 [#uses=1]
- %reg288 = getelementptr i32* %weight, i64 %15 ; <i32*> [#uses=1]
- %reg289 = load i32* %reg273 ; <i32> [#uses=1]
- %reg290 = load i32* %reg288 ; <i32> [#uses=1]
- %cond761 = icmp slt i32 %reg289, %reg290 ; <i1> [#uses=1]
- br i1 %cond761, label %bb20, label %bb19
-
-bb19: ; preds = %bb18
- %reg607-idxcast = bitcast i32 %reg607 to i32 ; <i32> [#uses=1]
- zext i32 %reg607-idxcast to i64 ; <i64>:16 [#uses=1]
- %reg297 = getelementptr i32* %heap, i64 %16 ; <i32*> [#uses=1]
- store i32 %reg281, i32* %reg297
- %reg611 = shl i32 %reg609, 1 ; <i32> [#uses=2]
- %cond762 = icmp sle i32 %reg611, %reg605 ; <i1> [#uses=1]
- br i1 %cond762, label %bb15, label %bb20
-
-bb20: ; preds = %bb19, %bb18, %bb14
- %reg612 = phi i32 [ %reg609, %bb19 ], [ %reg607, %bb18 ], [ 1, %bb14 ] ; <i32> [#uses=1]
- %reg612-idxcast = bitcast i32 %reg612 to i32 ; <i32> [#uses=1]
- zext i32 %reg612-idxcast to i64 ; <i64>:17 [#uses=1]
- %reg312 = getelementptr i32* %heap, i64 %17 ; <i32*> [#uses=1]
- store i32 %reg226, i32* %reg312
- zext i32 1 to i64 ; <i64>:18 [#uses=1]
- %reg7631 = getelementptr i32* %heap, i64 %18 ; <i32*> [#uses=1]
- %reg114 = load i32* %reg7631 ; <i32> [#uses=2]
- %reg603-idxcast1 = bitcast i32 %reg603 to i32 ; <i32> [#uses=1]
- %reg603-idxcast1-offset = add i32 %reg603-idxcast1, 1073741823 ; <i32> [#uses=1]
- zext i32 %reg603-idxcast1-offset to i64 ; <i64>:19 [#uses=1]
- %reg319 = getelementptr i32* %heap, i64 %19 ; <i32*> [#uses=1]
- %reg320 = load i32* %reg319 ; <i32> [#uses=1]
- zext i32 1 to i64 ; <i64>:20 [#uses=1]
- %reg7641 = getelementptr i32* %heap, i64 %20 ; <i32*> [#uses=1]
- store i32 %reg320, i32* %reg7641
- %reg613 = add i32 %reg605, -1 ; <i32> [#uses=4]
- zext i32 1 to i64 ; <i64>:21 [#uses=1]
- %reg765 = getelementptr i32* %heap, i64 %21 ; <i32*> [#uses=1]
- %reg323 = load i32* %reg765 ; <i32> [#uses=2]
- %cond766 = icmp sgt i32 2, %reg613 ; <i1> [#uses=1]
- br i1 %cond766, label %bb26, label %bb21
-
-bb21: ; preds = %bb25, %bb20
- %reg614 = phi i32 [ %reg619, %bb25 ], [ 2, %bb20 ] ; <i32> [#uses=6]
- %reg615 = phi i32 [ %reg617, %bb25 ], [ 1, %bb20 ] ; <i32> [#uses=2]
- %cond767 = icmp sge i32 %reg614, %reg613 ; <i1> [#uses=1]
- br i1 %cond767, label %bb24, label %bb22
-
-bb22: ; preds = %bb21
- %reg614-idxcast = bitcast i32 %reg614 to i32 ; <i32> [#uses=1]
- %reg614-idxcast-offset = add i32 %reg614-idxcast, 1 ; <i32> [#uses=1]
- zext i32 %reg614-idxcast-offset to i64 ; <i64>:22 [#uses=1]
- %reg338 = getelementptr i32* %heap, i64 %22 ; <i32*> [#uses=1]
- %reg339 = load i32* %reg338 ; <i32> [#uses=1]
- %reg339-idxcast = bitcast i32 %reg339 to i32 ; <i32> [#uses=1]
- zext i32 %reg339-idxcast to i64 ; <i64>:23 [#uses=1]
- %reg346 = getelementptr i32* %weight, i64 %23 ; <i32*> [#uses=1]
- %reg614-idxcast1 = bitcast i32 %reg614 to i32 ; <i32> [#uses=1]
- zext i32 %reg614-idxcast1 to i64 ; <i64>:24 [#uses=1]
- %reg353 = getelementptr i32* %heap, i64 %24 ; <i32*> [#uses=1]
- %reg354 = load i32* %reg353 ; <i32> [#uses=1]
- %reg354-idxcast = bitcast i32 %reg354 to i32 ; <i32> [#uses=1]
- zext i32 %reg354-idxcast to i64 ; <i64>:25 [#uses=1]
- %reg361 = getelementptr i32* %weight, i64 %25 ; <i32*> [#uses=1]
- %reg362 = load i32* %reg346 ; <i32> [#uses=1]
- %reg363 = load i32* %reg361 ; <i32> [#uses=1]
- %cond768 = icmp sge i32 %reg362, %reg363 ; <i1> [#uses=1]
- br i1 %cond768, label %bb24, label %bb23
-
-bb23: ; preds = %bb22
- %reg616 = add i32 %reg614, 1 ; <i32> [#uses=1]
- br label %bb24
-
-bb24: ; preds = %bb23, %bb22, %bb21
- %reg617 = phi i32 [ %reg616, %bb23 ], [ %reg614, %bb22 ], [ %reg614, %bb21 ] ; <i32> [#uses=4]
- %reg323-idxcast = bitcast i32 %reg323 to i32 ; <i32> [#uses=1]
- zext i32 %reg323-idxcast to i64 ; <i64>:26 [#uses=1]
- %reg370 = getelementptr i32* %weight, i64 %26 ; <i32*> [#uses=1]
- %reg617-idxcast = bitcast i32 %reg617 to i32 ; <i32> [#uses=1]
- zext i32 %reg617-idxcast to i64 ; <i64>:27 [#uses=1]
- %reg377 = getelementptr i32* %heap, i64 %27 ; <i32*> [#uses=1]
- %reg378 = load i32* %reg377 ; <i32> [#uses=2]
- %reg378-idxcast = bitcast i32 %reg378 to i32 ; <i32> [#uses=1]
- zext i32 %reg378-idxcast to i64 ; <i64>:28 [#uses=1]
- %reg385 = getelementptr i32* %weight, i64 %28 ; <i32*> [#uses=1]
- %reg386 = load i32* %reg370 ; <i32> [#uses=1]
- %reg387 = load i32* %reg385 ; <i32> [#uses=1]
- %cond769 = icmp slt i32 %reg386, %reg387 ; <i1> [#uses=1]
- br i1 %cond769, label %bb26, label %bb25
-
-bb25: ; preds = %bb24
- %reg615-idxcast = bitcast i32 %reg615 to i32 ; <i32> [#uses=1]
- zext i32 %reg615-idxcast to i64 ; <i64>:29 [#uses=1]
- %reg394 = getelementptr i32* %heap, i64 %29 ; <i32*> [#uses=1]
- store i32 %reg378, i32* %reg394
- %reg619 = shl i32 %reg617, 1 ; <i32> [#uses=2]
- %cond770 = icmp sle i32 %reg619, %reg613 ; <i1> [#uses=1]
- br i1 %cond770, label %bb21, label %bb26
-
-bb26: ; preds = %bb25, %bb24, %bb20
- %reg620 = phi i32 [ %reg617, %bb25 ], [ %reg615, %bb24 ], [ 1, %bb20 ] ; <i32> [#uses=1]
- %reg620-idxcast = bitcast i32 %reg620 to i32 ; <i32> [#uses=1]
- zext i32 %reg620-idxcast to i64 ; <i64>:30 [#uses=1]
- %reg409 = getelementptr i32* %heap, i64 %30 ; <i32*> [#uses=1]
- store i32 %reg323, i32* %reg409
- %reg621 = add i32 %reg604, 1 ; <i32> [#uses=5]
- %reg113-idxcast = bitcast i32 %reg113 to i32 ; <i32> [#uses=1]
- zext i32 %reg113-idxcast to i64 ; <i64>:31 [#uses=1]
- %reg416 = getelementptr i32* %parent, i64 %31 ; <i32*> [#uses=1]
- %reg114-idxcast = bitcast i32 %reg114 to i32 ; <i32> [#uses=1]
- zext i32 %reg114-idxcast to i64 ; <i64>:32 [#uses=1]
- %reg423 = getelementptr i32* %parent, i64 %32 ; <i32*> [#uses=1]
- %cast889 = bitcast i32 %reg621 to i32 ; <i32> [#uses=1]
- store i32 %cast889, i32* %reg423
- %cast890 = bitcast i32 %reg621 to i32 ; <i32> [#uses=1]
- store i32 %cast890, i32* %reg416
- %reg604-offset = add i32 %reg604, 1 ; <i32> [#uses=1]
- zext i32 %reg604-offset to i64 ; <i64>:33 [#uses=1]
- %reg431 = getelementptr i32* %weight, i64 %33 ; <i32*> [#uses=1]
- %reg113-idxcast2 = bitcast i32 %reg113 to i32 ; <i32> [#uses=1]
- zext i32 %reg113-idxcast2 to i64 ; <i64>:34 [#uses=1]
- %reg4381 = getelementptr i32* %weight, i64 %34 ; <i32*> [#uses=1]
- %reg439 = load i32* %reg4381 ; <i32> [#uses=2]
- %reg440 = and i32 %reg439, -256 ; <i32> [#uses=1]
- %reg114-idxcast2 = bitcast i32 %reg114 to i32 ; <i32> [#uses=1]
- zext i32 %reg114-idxcast2 to i64 ; <i64>:35 [#uses=1]
- %reg4471 = getelementptr i32* %weight, i64 %35 ; <i32*> [#uses=1]
- %reg448 = load i32* %reg4471 ; <i32> [#uses=2]
- %reg449 = and i32 %reg448, -256 ; <i32> [#uses=1]
- %reg450 = add i32 %reg440, %reg449 ; <i32> [#uses=1]
- %reg460 = and i32 %reg439, 255 ; <i32> [#uses=2]
- %reg451 = and i32 %reg448, 255 ; <i32> [#uses=2]
- %cond771 = icmp sge i32 %reg451, %reg460 ; <i1> [#uses=1]
- br i1 %cond771, label %bb28, label %bb27
-
-bb27: ; preds = %bb26
- br label %bb28
-
-bb28: ; preds = %bb27, %bb26
- %reg623 = phi i32 [ %reg460, %bb27 ], [ %reg451, %bb26 ] ; <i32> [#uses=1]
- %reg469 = add i32 %reg623, 1 ; <i32> [#uses=1]
- %reg470 = or i32 %reg450, %reg469 ; <i32> [#uses=1]
- store i32 %reg470, i32* %reg431
- %reg604-offset1 = add i32 %reg604, 1 ; <i32> [#uses=1]
- zext i32 %reg604-offset1 to i64 ; <i64>:36 [#uses=1]
- %reg4771 = getelementptr i32* %parent, i64 %36 ; <i32*> [#uses=1]
- store i32 -1, i32* %reg4771
- %reg624 = add i32 %reg613, 1 ; <i32> [#uses=2]
- %reg603-idxcast2 = bitcast i32 %reg603 to i32 ; <i32> [#uses=1]
- %reg603-idxcast2-offset = add i32 %reg603-idxcast2, 1073741823 ; <i32> [#uses=1]
- zext i32 %reg603-idxcast2-offset to i64 ; <i64>:37 [#uses=1]
- %reg485 = getelementptr i32* %heap, i64 %37 ; <i32*> [#uses=1]
- %cast902 = bitcast i32 %reg621 to i32 ; <i32> [#uses=1]
- store i32 %cast902, i32* %reg485
- br label %bb30
-
-bb29: ; preds = %bb30
- %reg625-idxcast = bitcast i32 %reg625 to i32 ; <i32> [#uses=1]
- zext i32 %reg625-idxcast to i64 ; <i64>:38 [#uses=1]
- %reg526 = getelementptr i32* %heap, i64 %38 ; <i32*> [#uses=1]
- store i32 %reg510, i32* %reg526
- br label %bb30
-
-bb30: ; preds = %bb29, %bb28
- %reg625 = phi i32 [ %reg502, %bb29 ], [ %reg624, %bb28 ] ; <i32> [#uses=3]
- %reg604-offset2 = add i32 %reg604, 1 ; <i32> [#uses=1]
- zext i32 %reg604-offset2 to i64 ; <i64>:39 [#uses=1]
- %reg501 = getelementptr i32* %weight, i64 %39 ; <i32*> [#uses=1]
- %reg502 = ashr i32 %reg625, 1 ; <i32> [#uses=2]
- %reg502-idxcast = bitcast i32 %reg502 to i32 ; <i32> [#uses=1]
- zext i32 %reg502-idxcast to i64 ; <i64>:40 [#uses=1]
- %reg509 = getelementptr i32* %heap, i64 %40 ; <i32*> [#uses=1]
- %reg510 = load i32* %reg509 ; <i32> [#uses=2]
- %reg510-idxcast = bitcast i32 %reg510 to i32 ; <i32> [#uses=1]
- zext i32 %reg510-idxcast to i64 ; <i64>:41 [#uses=1]
- %reg517 = getelementptr i32* %weight, i64 %41 ; <i32*> [#uses=1]
- %reg518 = load i32* %reg501 ; <i32> [#uses=1]
- %reg519 = load i32* %reg517 ; <i32> [#uses=1]
- %cond772 = icmp slt i32 %reg518, %reg519 ; <i1> [#uses=1]
- br i1 %cond772, label %bb29, label %bb31
-
-bb31: ; preds = %bb30
- %reg625-idxcast1 = bitcast i32 %reg625 to i32 ; <i32> [#uses=1]
- zext i32 %reg625-idxcast1 to i64 ; <i64>:42 [#uses=1]
- %reg542 = getelementptr i32* %heap, i64 %42 ; <i32*> [#uses=1]
- %cast916 = bitcast i32 %reg621 to i32 ; <i32> [#uses=1]
- store i32 %cast916, i32* %reg542
- %cond773 = icmp sgt i32 %reg624, 1 ; <i1> [#uses=1]
- br i1 %cond773, label %bb14, label %bb32
-
-bb32: ; preds = %bb31, %bb13
- %reg627 = phi i32 [ %reg621, %bb31 ], [ %cast918, %bb13 ] ; <i32> [#uses=1]
- %cast919 = bitcast i32 %reg627 to i32 ; <i32> [#uses=1]
- %cond774 = icmp sle i32 %cast919, 515 ; <i1> [#uses=1]
- br i1 %cond774, label %bb34, label %bb33
-
-bb33: ; preds = %bb32
- zext i32 0 to i64 ; <i64>:43 [#uses=1]
- zext i32 0 to i64 ; <i64>:44 [#uses=1]
- %cast785 = getelementptr [21 x i8]* @.LC1, i64 %43, i64 %44 ; <i8*> [#uses=1]
- call void @panic( i8* %cast785 )
- br label %bb34
-
-bb34: ; preds = %bb33, %bb32
- %cond775 = icmp sgt i32 1, %reg109 ; <i1> [#uses=1]
- br i1 %cond775, label %bb40, label %bb35
-
-bb35: ; preds = %bb39, %bb34
- %reg629 = phi i8 [ %reg639, %bb39 ], [ 0, %bb34 ] ; <i8> [#uses=1]
- %cann-indvar = phi i32 [ 0, %bb34 ], [ %add1-indvar, %bb39 ] ; <i32> [#uses=4]
- %cann-indvar-casted = bitcast i32 %cann-indvar to i32 ; <i32> [#uses=1]
- %reg630 = add i32 %cann-indvar-casted, 1 ; <i32> [#uses=2]
- %add1-indvar = add i32 %cann-indvar, 1 ; <i32> [#uses=1]
- %cann-indvar-offset1 = add i32 %cann-indvar, 1 ; <i32> [#uses=1]
- zext i32 %cann-indvar-offset1 to i64 ; <i64>:45 [#uses=1]
- %reg589 = getelementptr i32* %parent, i64 %45 ; <i32*> [#uses=1]
- %reg590 = load i32* %reg589 ; <i32> [#uses=1]
- %cond776 = icmp slt i32 %reg590, 0 ; <i1> [#uses=1]
- %parent-idxcast = ptrtoint i32* %parent to i32 ; <i32> [#uses=1]
- %cast948 = bitcast i32 %reg630 to i32 ; <i32> [#uses=1]
- br i1 %cond776, label %bb37, label %bb36
-
-bb36: ; preds = %bb36, %bb35
- %reg632 = phi i32 [ %reg634, %bb36 ], [ %cast948, %bb35 ] ; <i32> [#uses=1]
- %reg633 = phi i32 [ %reg635, %bb36 ], [ 0, %bb35 ] ; <i32> [#uses=3]
- %reg633-casted = inttoptr i32 %reg633 to i8* ; <i8*> [#uses=0]
- %reg631-scale = mul i32 %reg633, 0 ; <i32> [#uses=1]
- %reg631-scale.upgrd.10 = inttoptr i32 %reg631-scale to i8* ; <i8*> [#uses=1]
- zext i32 %parent-idxcast to i64 ; <i64>:46 [#uses=1]
- %reg6311 = getelementptr i8* %reg631-scale.upgrd.10, i64 %46 ; <i8*> [#uses=2]
- %reg632-scale = mul i32 %reg632, 4 ; <i32> [#uses=1]
- zext i32 %reg632-scale to i64 ; <i64>:47 [#uses=1]
- %reg5581 = getelementptr i8* %reg6311, i64 %47 ; <i8*> [#uses=1]
- %cast924 = bitcast i8* %reg5581 to i32* ; <i32*> [#uses=1]
- %reg634 = load i32* %cast924 ; <i32> [#uses=2]
- %reg635 = add i32 %reg633, 1 ; <i32> [#uses=2]
- %reg634-scale = mul i32 %reg634, 4 ; <i32> [#uses=1]
- zext i32 %reg634-scale to i64 ; <i64>:48 [#uses=1]
- %reg5501 = getelementptr i8* %reg6311, i64 %48 ; <i8*> [#uses=1]
- %cast925 = bitcast i8* %reg5501 to i32* ; <i32*> [#uses=1]
- %reg551 = load i32* %cast925 ; <i32> [#uses=1]
- %cond777 = icmp sge i32 %reg551, 0 ; <i1> [#uses=1]
- br i1 %cond777, label %bb36, label %bb37
-
-bb37: ; preds = %bb36, %bb35
- %reg637 = phi i32 [ %reg635, %bb36 ], [ 0, %bb35 ] ; <i32> [#uses=2]
- %cast928 = bitcast i32 %reg637 to i32 ; <i32> [#uses=1]
- %cann-indvar-offset = add i32 %cann-indvar, 1 ; <i32> [#uses=1]
- zext i32 %cann-indvar-offset to i64 ; <i64>:49 [#uses=1]
- %reg561 = getelementptr i8* %reg107, i64 %49 ; <i8*> [#uses=1]
- zext i32 -1 to i64 ; <i64>:50 [#uses=1]
- %reg778 = getelementptr i8* %reg561, i64 %50 ; <i8*> [#uses=1]
- %cast788 = trunc i32 %reg637 to i8 ; <i8> [#uses=1]
- store i8 %cast788, i8* %reg778
- %cond779 = icmp sle i32 %cast928, %reg110 ; <i1> [#uses=1]
- br i1 %cond779, label %bb39, label %bb38
-
-bb38: ; preds = %bb37
- br label %bb39
-
-bb39: ; preds = %bb38, %bb37
- %reg639 = phi i8 [ 1, %bb38 ], [ %reg629, %bb37 ] ; <i8> [#uses=2]
- %reg640 = add i32 %reg630, 1 ; <i32> [#uses=1]
- %cond780 = icmp sle i32 %reg640, %reg109 ; <i1> [#uses=1]
- br i1 %cond780, label %bb35, label %bb40
-
-bb40: ; preds = %bb39, %bb34
- %reg641 = phi i8 [ %reg639, %bb39 ], [ 0, %bb34 ] ; <i8> [#uses=1]
- %cond781 = icmp eq i8 %reg641, 0 ; <i1> [#uses=1]
- br i1 %cond781, label %bb44, label %bb41
-
-bb41: ; preds = %bb40
- %cond782 = icmp sge i32 1, %reg109 ; <i1> [#uses=1]
- br i1 %cond782, label %bb6, label %bb42
-
-bb42: ; preds = %bb42, %bb41
- %cann-indvar2 = phi i32 [ 0, %bb41 ], [ %add1-indvar2, %bb42 ] ; <i32> [#uses=3]
- %reg643 = add i32 %cann-indvar2, 1 ; <i32> [#uses=1]
- %add1-indvar2 = add i32 %cann-indvar2, 1 ; <i32> [#uses=1]
- %cann-indvar2-idxcast = bitcast i32 %cann-indvar2 to i32 ; <i32> [#uses=1]
- %cann-indvar2-idxcast-offset = add i32 %cann-indvar2-idxcast, 1 ; <i32> [#uses=1]
- zext i32 %cann-indvar2-idxcast-offset to i64 ; <i64>:51 [#uses=1]
- %reg569 = getelementptr i32* %weight, i64 %51 ; <i32*> [#uses=2]
- %reg570 = load i32* %reg569 ; <i32> [#uses=2]
- %reg644 = ashr i32 %reg570, 8 ; <i32> [#uses=1]
- %reg572 = ashr i32 %reg570, 31 ; <i32> [#uses=1]
- %cast933 = bitcast i32 %reg572 to i32 ; <i32> [#uses=1]
- %reg573 = lshr i32 %cast933, 31 ; <i32> [#uses=1]
- %cast934 = bitcast i32 %reg573 to i32 ; <i32> [#uses=1]
- %reg574 = add i32 %reg644, %cast934 ; <i32> [#uses=1]
- %reg571 = ashr i32 %reg574, 1 ; <i32> [#uses=1]
- %reg645 = add i32 %reg571, 1 ; <i32> [#uses=1]
- %reg582 = shl i32 %reg645, 8 ; <i32> [#uses=1]
- store i32 %reg582, i32* %reg569
- %reg646 = add i32 %reg643, 1 ; <i32> [#uses=1]
- %cond783 = icmp slt i32 %reg646, %reg109 ; <i1> [#uses=1]
- br i1 %cond783, label %bb42, label %bb43
-
-bb43: ; preds = %bb42
- br label %bb6
-
-bb44: ; preds = %bb40
- ret void
-}
-
-declare void @panic(i8*)
diff --git a/release_23/test/Transforms/InstCombine/2002-08-02-CastTest.ll b/release_23/test/Transforms/InstCombine/2002-08-02-CastTest.ll
deleted file mode 100644
index 54c836c1056c..000000000000
--- a/release_23/test/Transforms/InstCombine/2002-08-02-CastTest.ll
+++ /dev/null
@@ -1,11 +0,0 @@
-; This testcase is incorrectly getting completely eliminated. There should be
-; SOME instruction named %c here, even if it's a bitwise and.
-;
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep %c
-;
-define i64 @test3(i64 %A) {
- %c1 = trunc i64 %A to i8 ; <i8> [#uses=1]
- %c2 = zext i8 %c1 to i64 ; <i64> [#uses=1]
- ret i64 %c2
-}
-
diff --git a/release_23/test/Transforms/InstCombine/2002-09-17-GetElementPtrCrash.ll b/release_23/test/Transforms/InstCombine/2002-09-17-GetElementPtrCrash.ll
deleted file mode 100644
index 5b127d7b7938..000000000000
--- a/release_23/test/Transforms/InstCombine/2002-09-17-GetElementPtrCrash.ll
+++ /dev/null
@@ -1,12 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine
-
- %bob = type { i32 }
-
-define i32 @alias() {
- %pbob1 = alloca %bob ; <%bob*> [#uses=1]
- %pbob2 = getelementptr %bob* %pbob1 ; <%bob*> [#uses=1]
- %pbobel = getelementptr %bob* %pbob2, i64 0, i32 0 ; <i32*> [#uses=1]
- %rval = load i32* %pbobel ; <i32> [#uses=1]
- ret i32 %rval
-}
-
diff --git a/release_23/test/Transforms/InstCombine/2002-12-05-MissedConstProp.ll b/release_23/test/Transforms/InstCombine/2002-12-05-MissedConstProp.ll
deleted file mode 100644
index e7bd6a8da2fb..000000000000
--- a/release_23/test/Transforms/InstCombine/2002-12-05-MissedConstProp.ll
+++ /dev/null
@@ -1,11 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep add
-
-define i32 @test(i32 %A) {
- %A.neg = sub i32 0, %A ; <i32> [#uses=1]
- %.neg = sub i32 0, 1 ; <i32> [#uses=1]
- %X = add i32 %.neg, 1 ; <i32> [#uses=1]
- %Y.neg.ra = add i32 %A, %X ; <i32> [#uses=1]
- %r = add i32 %A.neg, %Y.neg.ra ; <i32> [#uses=1]
- ret i32 %r
-}
-
diff --git a/release_23/test/Transforms/InstCombine/2003-05-26-CastMiscompile.ll b/release_23/test/Transforms/InstCombine/2003-05-26-CastMiscompile.ll
deleted file mode 100644
index e7e784882ab5..000000000000
--- a/release_23/test/Transforms/InstCombine/2003-05-26-CastMiscompile.ll
+++ /dev/null
@@ -1,8 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep 4294967295
-
-define i64 @test(i64 %Val) {
- %tmp.3 = trunc i64 %Val to i32 ; <i32> [#uses=1]
- %tmp.8 = zext i32 %tmp.3 to i64 ; <i64> [#uses=1]
- ret i64 %tmp.8
-}
-
diff --git a/release_23/test/Transforms/InstCombine/2003-05-27-ConstExprCrash.ll b/release_23/test/Transforms/InstCombine/2003-05-27-ConstExprCrash.ll
deleted file mode 100644
index 214fa4d846db..000000000000
--- a/release_23/test/Transforms/InstCombine/2003-05-27-ConstExprCrash.ll
+++ /dev/null
@@ -1,10 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine -disable-output
-
-@X = global i32 5 ; <i32*> [#uses=1]
-
-define i64 @test() {
- %C = add i64 1, 2 ; <i64> [#uses=1]
- %V = add i64 ptrtoint (i32* @X to i64), %C ; <i64> [#uses=1]
- ret i64 %V
-}
-
diff --git a/release_23/test/Transforms/InstCombine/2003-06-05-BranchInvertInfLoop.ll b/release_23/test/Transforms/InstCombine/2003-06-05-BranchInvertInfLoop.ll
deleted file mode 100644
index 724f30f48894..000000000000
--- a/release_23/test/Transforms/InstCombine/2003-06-05-BranchInvertInfLoop.ll
+++ /dev/null
@@ -1,16 +0,0 @@
-; This testcase causes an infinite loop in the instruction combiner,
-; because it things that the constant value is a not expression... and
-; constantly inverts the branch back and forth.
-;
-; RUN: llvm-as < %s | opt -instcombine -disable-output
-
-define i8 @test19(i1 %c) {
- br i1 true, label %True, label %False
-
-True: ; preds = %0
- ret i8 1
-
-False: ; preds = %0
- ret i8 3
-}
-
diff --git a/release_23/test/Transforms/InstCombine/2003-06-22-ConstantExprCrash.ll b/release_23/test/Transforms/InstCombine/2003-06-22-ConstantExprCrash.ll
deleted file mode 100644
index d6cacece0890..000000000000
--- a/release_23/test/Transforms/InstCombine/2003-06-22-ConstantExprCrash.ll
+++ /dev/null
@@ -1,13 +0,0 @@
-; This is a bug in the VMcode library, not instcombine, it's just convenient
-; to expose it here.
-
-; RUN: llvm-as < %s | opt -instcombine -disable-output
-
-@A = global i32 1 ; <i32*> [#uses=1]
-@B = global i32 2 ; <i32*> [#uses=1]
-
-define i1 @test() {
- %C = icmp ult i32* getelementptr (i32* @A, i64 1), getelementptr (i32* @B, i64 2) ; <i1> [#uses=1]
- ret i1 %C
-}
-
diff --git a/release_23/test/Transforms/InstCombine/2003-07-21-ExternalConstant.ll b/release_23/test/Transforms/InstCombine/2003-07-21-ExternalConstant.ll
deleted file mode 100644
index 09732d3f636a..000000000000
--- a/release_23/test/Transforms/InstCombine/2003-07-21-ExternalConstant.ll
+++ /dev/null
@@ -1,44 +0,0 @@
-;
-; Test: ExternalConstant
-;
-; Description:
-; This regression test helps check whether the instruction combining
-; optimization pass correctly handles global variables which are marked
-; as external and constant.
-;
-; If a problem occurs, we should die on an assert(). Otherwise, we
-; should pass through the optimizer without failure.
-;
-; Extra code:
-; RUN: llvm-as < %s | opt -instcombine
-; END.
-
-target datalayout = "e-p:32:32"
-@silly = external constant i32 ; <i32*> [#uses=1]
-
-declare void @bzero(i8*, i32)
-
-declare void @bcopy(i8*, i8*, i32)
-
-declare i32 @bcmp(i8*, i8*, i32)
-
-declare i32 @fputs(i8*, i8*)
-
-declare i32 @fputs_unlocked(i8*, i8*)
-
-define i32 @function(i32 %a.1) {
-entry:
- %a.0 = alloca i32 ; <i32*> [#uses=2]
- %result = alloca i32 ; <i32*> [#uses=2]
- store i32 %a.1, i32* %a.0
- %tmp.0 = load i32* %a.0 ; <i32> [#uses=1]
- %tmp.1 = load i32* @silly ; <i32> [#uses=1]
- %tmp.2 = add i32 %tmp.0, %tmp.1 ; <i32> [#uses=1]
- store i32 %tmp.2, i32* %result
- br label %return
-
-return: ; preds = %entry
- %tmp.3 = load i32* %result ; <i32> [#uses=1]
- ret i32 %tmp.3
-}
-
diff --git a/release_23/test/Transforms/InstCombine/2003-08-12-AllocaNonNull.ll b/release_23/test/Transforms/InstCombine/2003-08-12-AllocaNonNull.ll
deleted file mode 100644
index 209ab1b33695..000000000000
--- a/release_23/test/Transforms/InstCombine/2003-08-12-AllocaNonNull.ll
+++ /dev/null
@@ -1,21 +0,0 @@
-; This testcase can be simplified by "realizing" that alloca can never return
-; null.
-; RUN: llvm-as < %s | opt -instcombine -simplifycfg | \
-; RUN: llvm-dis | not grep br
-
-declare i32 @bitmap_clear(...)
-
-define i32 @oof() {
-entry:
- %live_head = alloca i32 ; <i32*> [#uses=2]
- %tmp.1 = icmp ne i32* %live_head, null ; <i1> [#uses=1]
- br i1 %tmp.1, label %then, label %UnifiedExitNode
-
-then: ; preds = %entry
- %tmp.4 = call i32 (...)* @bitmap_clear( i32* %live_head ) ; <i32> [#uses=0]
- br label %UnifiedExitNode
-
-UnifiedExitNode: ; preds = %then, %entry
- ret i32 0
-}
-
diff --git a/release_23/test/Transforms/InstCombine/2003-09-09-VolatileLoadElim.ll b/release_23/test/Transforms/InstCombine/2003-09-09-VolatileLoadElim.ll
deleted file mode 100644
index 9779f21f925c..000000000000
--- a/release_23/test/Transforms/InstCombine/2003-09-09-VolatileLoadElim.ll
+++ /dev/null
@@ -1,7 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep load
-
-define void @test(i32* %P) {
- ; Dead but not deletable!
- %X = volatile load i32* %P ; <i32> [#uses=0]
- ret void
-}
diff --git a/release_23/test/Transforms/InstCombine/2003-10-23-InstcombineNullFail.ll b/release_23/test/Transforms/InstCombine/2003-10-23-InstcombineNullFail.ll
deleted file mode 100644
index 7daf7cb632bb..000000000000
--- a/release_23/test/Transforms/InstCombine/2003-10-23-InstcombineNullFail.ll
+++ /dev/null
@@ -1,12 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep false
-;
-; This actually looks like a constant propagation bug
-
-%X = type { [10 x i32], float }
-
-define i1 @test() {
- %A = getelementptr %X* null, i64 0, i32 0, i64 0 ; <i32*> [#uses=1]
- %B = icmp ne i32* %A, null ; <i1> [#uses=1]
- ret i1 %B
-}
-
diff --git a/release_23/test/Transforms/InstCombine/2003-10-29-CallSiteResolve.ll b/release_23/test/Transforms/InstCombine/2003-10-29-CallSiteResolve.ll
deleted file mode 100644
index 7d219cb35885..000000000000
--- a/release_23/test/Transforms/InstCombine/2003-10-29-CallSiteResolve.ll
+++ /dev/null
@@ -1,15 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine -disable-output
-
-declare i32* @bar()
-
-define float* @foo() {
- %tmp.11 = invoke float* bitcast (i32* ()* @bar to float* ()*)( )
- to label %invoke_cont unwind label %X ; <float*> [#uses=1]
-
-invoke_cont: ; preds = %0
- ret float* %tmp.11
-
-X: ; preds = %0
- ret float* null
-}
-
diff --git a/release_23/test/Transforms/InstCombine/2003-11-03-VarargsCallBug.ll b/release_23/test/Transforms/InstCombine/2003-11-03-VarargsCallBug.ll
deleted file mode 100644
index 71585d426645..000000000000
--- a/release_23/test/Transforms/InstCombine/2003-11-03-VarargsCallBug.ll
+++ /dev/null
@@ -1,13 +0,0 @@
-; The cast in this testcase is not eliminable on a 32-bit target!
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep inttoptr
-
-target datalayout = "e-p:32:32"
-
-declare void @foo(...)
-
-define void @test(i64 %X) {
- %Y = inttoptr i64 %X to i32* ; <i32*> [#uses=1]
- call void (...)* @foo( i32* %Y )
- ret void
-}
-
diff --git a/release_23/test/Transforms/InstCombine/2003-11-13-ConstExprCastCall.ll b/release_23/test/Transforms/InstCombine/2003-11-13-ConstExprCastCall.ll
deleted file mode 100644
index 23fe07d2b307..000000000000
--- a/release_23/test/Transforms/InstCombine/2003-11-13-ConstExprCastCall.ll
+++ /dev/null
@@ -1,9 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep call | notcast
-
-declare void @free(i8*)
-
-define void @test(i32* %X) {
- call i32 (...)* bitcast (void (i8*)* @free to i32 (...)*)( i32* %X ) ; <i32>:1 [#uses=0]
- ret void
-}
-
diff --git a/release_23/test/Transforms/InstCombine/2004-01-13-InstCombineInvokePHI.ll b/release_23/test/Transforms/InstCombine/2004-01-13-InstCombineInvokePHI.ll
deleted file mode 100644
index c6a6b6afb81d..000000000000
--- a/release_23/test/Transforms/InstCombine/2004-01-13-InstCombineInvokePHI.ll
+++ /dev/null
@@ -1,28 +0,0 @@
-; Test for a problem afflicting several C++ programs in the testsuite. The
-; instcombine pass is trying to get rid of the cast in the invoke instruction,
-; inserting a cast of the return value after the PHI instruction, but which is
-; used by the PHI instruction. This is bad: because of the semantics of the
-; invoke instruction, we really cannot perform this transformation at all at
-; least without splitting the critical edge.
-;
-; RUN: llvm-as < %s | opt -instcombine -disable-output
-
-declare i8* @test()
-
-define i32 @foo() {
-entry:
- br i1 true, label %cont, label %call
-
-call: ; preds = %entry
- %P = invoke i32* bitcast (i8* ()* @test to i32* ()*)( )
- to label %cont unwind label %N ; <i32*> [#uses=1]
-
-cont: ; preds = %call, %entry
- %P2 = phi i32* [ %P, %call ], [ null, %entry ] ; <i32*> [#uses=1]
- %V = load i32* %P2 ; <i32> [#uses=1]
- ret i32 %V
-
-N: ; preds = %call
- ret i32 0
-}
-
diff --git a/release_23/test/Transforms/InstCombine/2004-02-23-ShiftShiftOverflow.ll b/release_23/test/Transforms/InstCombine/2004-02-23-ShiftShiftOverflow.ll
deleted file mode 100644
index 3a4b66157dfe..000000000000
--- a/release_23/test/Transforms/InstCombine/2004-02-23-ShiftShiftOverflow.ll
+++ /dev/null
@@ -1,15 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep 34
-
-define i32 @test(i32 %X) {
- ; Do not fold into shr X, 34, as this uses undefined behavior!
- %Y = ashr i32 %X, 17 ; <i32> [#uses=1]
- %Z = ashr i32 %Y, 17 ; <i32> [#uses=1]
- ret i32 %Z
-}
-
-define i32 @test2(i32 %X) {
- ; Do not fold into shl X, 34, as this uses undefined behavior!
- %Y = shl i32 %X, 17 ; <i32> [#uses=1]
- %Z = shl i32 %Y, 17 ; <i32> [#uses=1]
- ret i32 %Z
-}
diff --git a/release_23/test/Transforms/InstCombine/2004-03-13-InstCombineInfLoop.ll b/release_23/test/Transforms/InstCombine/2004-03-13-InstCombineInfLoop.ll
deleted file mode 100644
index 2b5481b0195a..000000000000
--- a/release_23/test/Transforms/InstCombine/2004-03-13-InstCombineInfLoop.ll
+++ /dev/null
@@ -1,13 +0,0 @@
-; This testcase caused the combiner to go into an infinite loop, moving the
-; cast back and forth, changing the seteq to operate on int vs uint and back.
-
-; RUN: llvm-as < %s | opt -instcombine -disable-output
-
-define i1 @test(i32 %A, i32 %B) {
- %C = sub i32 0, %A ; <i32> [#uses=1]
- %Cc = bitcast i32 %C to i32 ; <i32> [#uses=1]
- %D = sub i32 0, %B ; <i32> [#uses=1]
- %E = icmp eq i32 %Cc, %D ; <i1> [#uses=1]
- ret i1 %E
-}
-
diff --git a/release_23/test/Transforms/InstCombine/2004-04-04-InstCombineReplaceAllUsesWith.ll b/release_23/test/Transforms/InstCombine/2004-04-04-InstCombineReplaceAllUsesWith.ll
deleted file mode 100644
index 0b93eb2322eb..000000000000
--- a/release_23/test/Transforms/InstCombine/2004-04-04-InstCombineReplaceAllUsesWith.ll
+++ /dev/null
@@ -1,10 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine -disable-output
-
-define i32 @test() {
- ret i32 0
-
-Loop: ; preds = %Loop
- %X = add i32 %X, 1 ; <i32> [#uses=1]
- br label %Loop
-}
-
diff --git a/release_23/test/Transforms/InstCombine/2004-05-07-UnsizedCastLoad.ll b/release_23/test/Transforms/InstCombine/2004-05-07-UnsizedCastLoad.ll
deleted file mode 100644
index 66a5a4d78f6a..000000000000
--- a/release_23/test/Transforms/InstCombine/2004-05-07-UnsizedCastLoad.ll
+++ /dev/null
@@ -1,10 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine -disable-output
-
-%Ty = type opaque
-
-define i32 @test(%Ty* %X) {
- %Y = bitcast %Ty* %X to i32* ; <i32*> [#uses=1]
- %Z = load i32* %Y ; <i32> [#uses=1]
- ret i32 %Z
-}
-
diff --git a/release_23/test/Transforms/InstCombine/2004-07-27-ConstantExprMul.ll b/release_23/test/Transforms/InstCombine/2004-07-27-ConstantExprMul.ll
deleted file mode 100644
index 82eecbb6986b..000000000000
--- a/release_23/test/Transforms/InstCombine/2004-07-27-ConstantExprMul.ll
+++ /dev/null
@@ -1,9 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine -disable-output
-
-@p = weak global i32 0 ; <i32*> [#uses=1]
-
-define i32 @test(i32 %x) {
- %y = mul i32 %x, ptrtoint (i32* @p to i32) ; <i32> [#uses=1]
- ret i32 %y
-}
-
diff --git a/release_23/test/Transforms/InstCombine/2004-08-09-RemInfLoop.ll b/release_23/test/Transforms/InstCombine/2004-08-09-RemInfLoop.ll
deleted file mode 100644
index 9fc48de4ec19..000000000000
--- a/release_23/test/Transforms/InstCombine/2004-08-09-RemInfLoop.ll
+++ /dev/null
@@ -1,9 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine
-
-; This testcase should not send the instcombiner into an infinite loop!
-
-define i32 @test(i32 %X) {
- %Y = srem i32 %X, 0 ; <i32> [#uses=1]
- ret i32 %Y
-}
-
diff --git a/release_23/test/Transforms/InstCombine/2004-08-10-BoolSetCC.ll b/release_23/test/Transforms/InstCombine/2004-08-10-BoolSetCC.ll
deleted file mode 100644
index 5d2ed0b86d9d..000000000000
--- a/release_23/test/Transforms/InstCombine/2004-08-10-BoolSetCC.ll
+++ /dev/null
@@ -1,8 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \
-; RUN: grep {ret i1 false}
-
-define i1 @test(i1 %V) {
- %Y = icmp ult i1 %V, false ; <i1> [#uses=1]
- ret i1 %Y
-}
-
diff --git a/release_23/test/Transforms/InstCombine/2004-09-20-BadLoadCombine.ll b/release_23/test/Transforms/InstCombine/2004-09-20-BadLoadCombine.ll
deleted file mode 100644
index e56c390d13f4..000000000000
--- a/release_23/test/Transforms/InstCombine/2004-09-20-BadLoadCombine.ll
+++ /dev/null
@@ -1,18 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine -mem2reg | llvm-dis | \
-; RUN: not grep {i32 1}
-
-; When propagating the load through the select, make sure that the load is
-; inserted where the original load was, not where the select is. Not doing
-; so could produce incorrect results!
-
-define i32 @test(i1 %C) {
- %X = alloca i32 ; <i32*> [#uses=3]
- %X2 = alloca i32 ; <i32*> [#uses=2]
- store i32 1, i32* %X
- store i32 2, i32* %X2
- %Y = select i1 %C, i32* %X, i32* %X2 ; <i32*> [#uses=1]
- store i32 3, i32* %X
- %Z = load i32* %Y ; <i32> [#uses=1]
- ret i32 %Z
-}
-
diff --git a/release_23/test/Transforms/InstCombine/2004-09-20-BadLoadCombine2.ll b/release_23/test/Transforms/InstCombine/2004-09-20-BadLoadCombine2.ll
deleted file mode 100644
index b89bd228403e..000000000000
--- a/release_23/test/Transforms/InstCombine/2004-09-20-BadLoadCombine2.ll
+++ /dev/null
@@ -1,25 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine -mem2reg -simplifycfg | \
-; RUN: llvm-dis | grep -v store | not grep {i32 1}
-
-; Test to make sure that instcombine does not accidentally propagate the load
-; into the PHI, which would break the program.
-
-define i32 @test(i1 %C) {
-entry:
- %X = alloca i32 ; <i32*> [#uses=3]
- %X2 = alloca i32 ; <i32*> [#uses=2]
- store i32 1, i32* %X
- store i32 2, i32* %X2
- br i1 %C, label %cond_true.i, label %cond_continue.i
-
-cond_true.i: ; preds = %entry
- br label %cond_continue.i
-
-cond_continue.i: ; preds = %cond_true.i, %entry
- %mem_tmp.i.0 = phi i32* [ %X, %cond_true.i ], [ %X2, %entry ] ; <i32*> [#uses=1]
- store i32 3, i32* %X
- %tmp.3 = load i32* %mem_tmp.i.0 ; <i32> [#uses=1]
- ret i32 %tmp.3
-}
-
-
diff --git a/release_23/test/Transforms/InstCombine/2004-09-28-BadShiftAndSetCC.ll b/release_23/test/Transforms/InstCombine/2004-09-28-BadShiftAndSetCC.ll
deleted file mode 100644
index ee4f62c8d5ce..000000000000
--- a/release_23/test/Transforms/InstCombine/2004-09-28-BadShiftAndSetCC.ll
+++ /dev/null
@@ -1,9 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep -- -65536
-
-define i1 @test(i32 %tmp.124) {
- %tmp.125 = shl i32 %tmp.124, 8 ; <i32> [#uses=1]
- %tmp.126.mask = and i32 %tmp.125, -16777216 ; <i32> [#uses=1]
- %tmp.128 = icmp eq i32 %tmp.126.mask, 167772160 ; <i1> [#uses=1]
- ret i1 %tmp.128
-}
-
diff --git a/release_23/test/Transforms/InstCombine/2004-11-22-Missed-and-fold.ll b/release_23/test/Transforms/InstCombine/2004-11-22-Missed-and-fold.ll
deleted file mode 100644
index 766ba48be63f..000000000000
--- a/release_23/test/Transforms/InstCombine/2004-11-22-Missed-and-fold.ll
+++ /dev/null
@@ -1,10 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep and
-
-define i8 @test21(i8 %A) {
- ;; sign extend
- %C = ashr i8 %A, 7 ; <i8> [#uses=1]
- ;; chop off sign
- %D = and i8 %C, 1 ; <i8> [#uses=1]
- ret i8 %D
-}
-
diff --git a/release_23/test/Transforms/InstCombine/2004-11-27-SetCCForCastLargerAndConstant.ll b/release_23/test/Transforms/InstCombine/2004-11-27-SetCCForCastLargerAndConstant.ll
deleted file mode 100644
index afb573b6ef23..000000000000
--- a/release_23/test/Transforms/InstCombine/2004-11-27-SetCCForCastLargerAndConstant.ll
+++ /dev/null
@@ -1,132 +0,0 @@
-; This test case tests the InstructionCombining optimization that
-; reduces things like:
-; %Y = sext i8 %X to i32
-; %C = icmp ult i32 %Y, 1024
-; to
-; %C = i1 true
-; It includes test cases for different constant values, signedness of the
-; cast operands, and types of setCC operators. In all cases, the cast should
-; be eliminated. In many cases the setCC is also eliminated based on the
-; constant value and the range of the casted value.
-;
-; RUN: llvm-as < %s -o - | opt -instcombine | llvm-dis | \
-; RUN: notcast .*int
-; END.
-define i1 @lt_signed_to_large_unsigned(i8 %SB) {
- %Y = sext i8 %SB to i32 ; <i32> [#uses=1]
- %C = icmp ult i32 %Y, 1024 ; <i1> [#uses=1]
- ret i1 %C
-}
-
-define i1 @lt_signed_to_large_signed(i8 %SB) {
- %Y = sext i8 %SB to i32 ; <i32> [#uses=1]
- %C = icmp slt i32 %Y, 1024 ; <i1> [#uses=1]
- ret i1 %C
-}
-
-define i1 @lt_signed_to_large_negative(i8 %SB) {
- %Y = sext i8 %SB to i32 ; <i32> [#uses=1]
- %C = icmp slt i32 %Y, -1024 ; <i1> [#uses=1]
- ret i1 %C
-}
-
-define i1 @lt_signed_to_small_signed(i8 %SB) {
- %Y = sext i8 %SB to i32 ; <i32> [#uses=1]
- %C = icmp slt i32 %Y, 17 ; <i1> [#uses=1]
- ret i1 %C
-}
-define i1 @lt_signed_to_small_negative(i8 %SB) {
- %Y = sext i8 %SB to i32 ; <i32> [#uses=1]
- %C = icmp slt i32 %Y, -17 ; <i1> [#uses=1]
- ret i1 %C
-}
-
-define i1 @lt_unsigned_to_large_unsigned(i8 %SB) {
- %Y = zext i8 %SB to i32 ; <i32> [#uses=1]
- %C = icmp ult i32 %Y, 1024 ; <i1> [#uses=1]
- ret i1 %C
-}
-
-define i1 @lt_unsigned_to_large_signed(i8 %SB) {
- %Y = zext i8 %SB to i32 ; <i32> [#uses=1]
- %C = icmp slt i32 %Y, 1024 ; <i1> [#uses=1]
- ret i1 %C
-}
-
-define i1 @lt_unsigned_to_large_negative(i8 %SB) {
- %Y = zext i8 %SB to i32 ; <i32> [#uses=1]
- %C = icmp slt i32 %Y, -1024 ; <i1> [#uses=1]
- ret i1 %C
-}
-
-define i1 @lt_unsigned_to_small_unsigned(i8 %SB) {
- %Y = zext i8 %SB to i32 ; <i32> [#uses=1]
- %C = icmp ult i32 %Y, 17 ; <i1> [#uses=1]
- ret i1 %C
-}
-
-define i1 @lt_unsigned_to_small_negative(i8 %SB) {
- %Y = zext i8 %SB to i32 ; <i32> [#uses=1]
- %C = icmp slt i32 %Y, -17 ; <i1> [#uses=1]
- ret i1 %C
-}
-
-define i1 @gt_signed_to_large_unsigned(i8 %SB) {
- %Y = sext i8 %SB to i32 ; <i32> [#uses=1]
- %C = icmp ugt i32 %Y, 1024 ; <i1> [#uses=1]
- ret i1 %C
-}
-
-define i1 @gt_signed_to_large_signed(i8 %SB) {
- %Y = sext i8 %SB to i32 ; <i32> [#uses=1]
- %C = icmp sgt i32 %Y, 1024 ; <i1> [#uses=1]
- ret i1 %C
-}
-
-define i1 @gt_signed_to_large_negative(i8 %SB) {
- %Y = sext i8 %SB to i32 ; <i32> [#uses=1]
- %C = icmp sgt i32 %Y, -1024 ; <i1> [#uses=1]
- ret i1 %C
-}
-define i1 @gt_signed_to_small_signed(i8 %SB) {
- %Y = sext i8 %SB to i32 ; <i32> [#uses=1]
- %C = icmp sgt i32 %Y, 17 ; <i1> [#uses=1]
- ret i1 %C
-}
-
-define i1 @gt_signed_to_small_negative(i8 %SB) {
- %Y = sext i8 %SB to i32 ; <i32> [#uses=1]
- %C = icmp sgt i32 %Y, -17 ; <i1> [#uses=1]
- ret i1 %C
-}
-
-define i1 @gt_unsigned_to_large_unsigned(i8 %SB) {
- %Y = zext i8 %SB to i32 ; <i32> [#uses=1]
- %C = icmp ugt i32 %Y, 1024 ; <i1> [#uses=1]
- ret i1 %C
-}
-
-define i1 @gt_unsigned_to_large_signed(i8 %SB) {
- %Y = zext i8 %SB to i32 ; <i32> [#uses=1]
- %C = icmp sgt i32 %Y, 1024 ; <i1> [#uses=1]
- ret i1 %C
-}
-
-define i1 @gt_unsigned_to_large_negative(i8 %SB) {
- %Y = zext i8 %SB to i32 ; <i32> [#uses=1]
- %C = icmp sgt i32 %Y, -1024 ; <i1> [#uses=1]
- ret i1 %C
-}
-
-define i1 @gt_unsigned_to_small_unsigned(i8 %SB) {
- %Y = zext i8 %SB to i32 ; <i32> [#uses=1]
- %C = icmp ugt i32 %Y, 17 ; <i1> [#uses=1]
- ret i1 %C
-}
-
-define i1 @gt_unsigned_to_small_negative(i8 %SB) {
- %Y = zext i8 %SB to i32 ; <i32> [#uses=1]
- %C = icmp sgt i32 %Y, -17 ; <i1> [#uses=1]
- ret i1 %C
-}
-
diff --git a/release_23/test/Transforms/InstCombine/2004-12-08-InstCombineCrash.ll b/release_23/test/Transforms/InstCombine/2004-12-08-InstCombineCrash.ll
deleted file mode 100644
index 5908205203e8..000000000000
--- a/release_23/test/Transforms/InstCombine/2004-12-08-InstCombineCrash.ll
+++ /dev/null
@@ -1,14 +0,0 @@
-; RUN: llvm-as %s -o - | opt -instcombine
-
-
-%"java/lang/Object" = type { %struct.llvm_java_object_base }
-%"java/lang/StringBuffer" = type { %"java/lang/Object", i32, { %"java/lang/Object", i32, [0 x i16] }*, i1 }
-%struct.llvm_java_object_base = type opaque
-
-define void @"java/lang/StringBuffer/append(Ljava/lang/String;)Ljava/lang/StringBuffer;"() {
-bc0:
- %tmp53 = getelementptr %"java/lang/StringBuffer"* null, i32 0, i32 1 ; <i32*> [#uses=1]
- store i32 0, i32* %tmp53
- ret void
-}
-
diff --git a/release_23/test/Transforms/InstCombine/2004-12-08-RemInfiniteLoop.ll b/release_23/test/Transforms/InstCombine/2004-12-08-RemInfiniteLoop.ll
deleted file mode 100644
index 4ea0b5c484bd..000000000000
--- a/release_23/test/Transforms/InstCombine/2004-12-08-RemInfiniteLoop.ll
+++ /dev/null
@@ -1,7 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine
-
-define i32 @test(i32 %X) {
- %Y = srem i32 %X, undef ; <i32> [#uses=1]
- ret i32 %Y
-}
-
diff --git a/release_23/test/Transforms/InstCombine/2005-03-04-ShiftOverflow.ll b/release_23/test/Transforms/InstCombine/2005-03-04-ShiftOverflow.ll
deleted file mode 100644
index ffaa0051e9f0..000000000000
--- a/release_23/test/Transforms/InstCombine/2005-03-04-ShiftOverflow.ll
+++ /dev/null
@@ -1,9 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \
-; RUN: not grep {ret i1 false}
-
-define i1 @test(i64 %tmp.169) {
- %tmp.1710 = lshr i64 %tmp.169, 1 ; <i64> [#uses=1]
- %tmp.1912 = icmp ugt i64 %tmp.1710, 0 ; <i1> [#uses=1]
- ret i1 %tmp.1912
-}
-
diff --git a/release_23/test/Transforms/InstCombine/2005-04-07-UDivSelectCrash.ll b/release_23/test/Transforms/InstCombine/2005-04-07-UDivSelectCrash.ll
deleted file mode 100644
index 8b2aa35bd754..000000000000
--- a/release_23/test/Transforms/InstCombine/2005-04-07-UDivSelectCrash.ll
+++ /dev/null
@@ -1,8 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine -disable-output
-
-define i32 @test(i1 %C, i32 %tmp.15) {
- %tmp.16 = select i1 %C, i32 8, i32 1 ; <i32> [#uses=1]
- %tmp.18 = udiv i32 %tmp.15, %tmp.16 ; <i32> [#uses=1]
- ret i32 %tmp.18
-}
-
diff --git a/release_23/test/Transforms/InstCombine/2005-06-15-DivSelectCrash.ll b/release_23/test/Transforms/InstCombine/2005-06-15-DivSelectCrash.ll
deleted file mode 100644
index 53585f9aa38b..000000000000
--- a/release_23/test/Transforms/InstCombine/2005-06-15-DivSelectCrash.ll
+++ /dev/null
@@ -1,10 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine -disable-output
-
-define i32 @_Z13func_31585107li(i32 %l_39521025, i32 %l_59244666) {
- %shortcirc_val = select i1 false, i32 1, i32 0 ; <i32> [#uses=1]
- %tmp.8 = udiv i32 0, %shortcirc_val ; <i32> [#uses=1]
- %tmp.9 = icmp eq i32 %tmp.8, 0 ; <i1> [#uses=1]
- %retval = select i1 %tmp.9, i32 %l_59244666, i32 -1621308501 ; <i32> [#uses=1]
- ret i32 %retval
-}
-
diff --git a/release_23/test/Transforms/InstCombine/2005-06-15-ShiftSetCCCrash.ll b/release_23/test/Transforms/InstCombine/2005-06-15-ShiftSetCCCrash.ll
deleted file mode 100644
index 64bfec18df6b..000000000000
--- a/release_23/test/Transforms/InstCombine/2005-06-15-ShiftSetCCCrash.ll
+++ /dev/null
@@ -1,9 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine -disable-output
-; PR577
-
-define i1 @test() {
- %tmp.3 = shl i32 0, 41 ; <i32> [#uses=1]
- %tmp.4 = icmp ne i32 %tmp.3, 0 ; <i1> [#uses=1]
- ret i1 %tmp.4
-}
-
diff --git a/release_23/test/Transforms/InstCombine/2005-06-16-RangeCrash.ll b/release_23/test/Transforms/InstCombine/2005-06-16-RangeCrash.ll
deleted file mode 100644
index 10dbfec21ae3..000000000000
--- a/release_23/test/Transforms/InstCombine/2005-06-16-RangeCrash.ll
+++ /dev/null
@@ -1,9 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine -disable-output
-; PR585
-
-define i1 @test() {
- %tmp.26 = sdiv i32 0, -2147483648 ; <i32> [#uses=1]
- %tmp.27 = icmp eq i32 %tmp.26, 0 ; <i1> [#uses=1]
- ret i1 %tmp.27
-}
-
diff --git a/release_23/test/Transforms/InstCombine/2005-06-16-SetCCOrSetCCMiscompile.ll b/release_23/test/Transforms/InstCombine/2005-06-16-SetCCOrSetCCMiscompile.ll
deleted file mode 100644
index 010087b4f472..000000000000
--- a/release_23/test/Transforms/InstCombine/2005-06-16-SetCCOrSetCCMiscompile.ll
+++ /dev/null
@@ -1,14 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \
-; RUN: grep {ret i1 true}
-; PR586
-
-@g_07918478 = external global i32 ; <i32*> [#uses=1]
-
-define i1 @test() {
- %tmp.0 = load i32* @g_07918478 ; <i32> [#uses=2]
- %tmp.1 = icmp ne i32 %tmp.0, 0 ; <i1> [#uses=1]
- %tmp.4 = icmp ult i32 %tmp.0, 4111 ; <i1> [#uses=1]
- %bothcond = or i1 %tmp.1, %tmp.4 ; <i1> [#uses=1]
- ret i1 %bothcond
-}
-
diff --git a/release_23/test/Transforms/InstCombine/2005-07-07-DeadPHILoop.ll b/release_23/test/Transforms/InstCombine/2005-07-07-DeadPHILoop.ll
deleted file mode 100644
index c58234a54995..000000000000
--- a/release_23/test/Transforms/InstCombine/2005-07-07-DeadPHILoop.ll
+++ /dev/null
@@ -1,14 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine -disable-output
-
-; This example caused instcombine to spin into an infinite loop.
-
-define void @test(i32* %P) {
- ret void
-
-Dead: ; preds = %Dead
- %X = phi i32 [ %Y, %Dead ] ; <i32> [#uses=1]
- %Y = sdiv i32 %X, 10 ; <i32> [#uses=2]
- store i32 %Y, i32* %P
- br label %Dead
-}
-
diff --git a/release_23/test/Transforms/InstCombine/2006-02-07-SextZextCrash.ll b/release_23/test/Transforms/InstCombine/2006-02-07-SextZextCrash.ll
deleted file mode 100644
index d7df5a01fb4c..000000000000
--- a/release_23/test/Transforms/InstCombine/2006-02-07-SextZextCrash.ll
+++ /dev/null
@@ -1,21 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine -disable-output
-
- %struct.rtx_const = type { i32, { %union.real_extract } }
- %struct.rtx_def = type { i32, [1 x %union.rtunion_def] }
- %union.real_extract = type { double }
- %union.rtunion_def = type { i32 }
-
-define fastcc void @decode_rtx_const(%struct.rtx_def* %x, %struct.rtx_const* %value) {
- %tmp.54 = getelementptr %struct.rtx_const* %value, i32 0, i32 0 ; <i32*> [#uses=1]
- %tmp.56 = getelementptr %struct.rtx_def* %x, i32 0, i32 0 ; <i32*> [#uses=1]
- %tmp.57 = load i32* %tmp.56 ; <i32> [#uses=1]
- %tmp.58 = shl i32 %tmp.57, 8 ; <i32> [#uses=1]
- %tmp.59 = ashr i32 %tmp.58, 24 ; <i32> [#uses=1]
- %tmp.60 = trunc i32 %tmp.59 to i16 ; <i16> [#uses=1]
- %tmp.61 = zext i16 %tmp.60 to i32 ; <i32> [#uses=1]
- %tmp.62 = shl i32 %tmp.61, 16 ; <i32> [#uses=1]
- %tmp.65 = or i32 0, %tmp.62 ; <i32> [#uses=1]
- store i32 %tmp.65, i32* %tmp.54
- ret void
-}
-
diff --git a/release_23/test/Transforms/InstCombine/2006-02-13-DemandedMiscompile.ll b/release_23/test/Transforms/InstCombine/2006-02-13-DemandedMiscompile.ll
deleted file mode 100644
index c89b0d54a9dd..000000000000
--- a/release_23/test/Transforms/InstCombine/2006-02-13-DemandedMiscompile.ll
+++ /dev/null
@@ -1,10 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \
-; RUN: not grep undef
-
-define i32 @test(i8 %A) {
- %B = sext i8 %A to i32 ; <i32> [#uses=1]
- %C = ashr i32 %B, 8 ; <i32> [#uses=1]
- ret i32 %C
-}
-
-
diff --git a/release_23/test/Transforms/InstCombine/2006-02-28-Crash.ll b/release_23/test/Transforms/InstCombine/2006-02-28-Crash.ll
deleted file mode 100644
index 1f3c9e8e6740..000000000000
--- a/release_23/test/Transforms/InstCombine/2006-02-28-Crash.ll
+++ /dev/null
@@ -1,8 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine -disable-output
-
-define i32 @test() {
- %tmp203 = icmp eq i32 1, 2 ; <i1> [#uses=1]
- %tmp203.upgrd.1 = zext i1 %tmp203 to i32 ; <i32> [#uses=1]
- ret i32 %tmp203.upgrd.1
-}
-
diff --git a/release_23/test/Transforms/InstCombine/2006-03-30-ExtractElement.ll b/release_23/test/Transforms/InstCombine/2006-03-30-ExtractElement.ll
deleted file mode 100644
index e4b2b3931224..000000000000
--- a/release_23/test/Transforms/InstCombine/2006-03-30-ExtractElement.ll
+++ /dev/null
@@ -1,8 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine -disable-output
-
-define float @test(<4 x float> %V) {
- %V2 = insertelement <4 x float> %V, float 1.000000e+00, i32 3 ; <<4 x float>> [#uses=1]
- %R = extractelement <4 x float> %V2, i32 2 ; <float> [#uses=1]
- ret float %R
-}
-
diff --git a/release_23/test/Transforms/InstCombine/2006-04-01-InfLoop.ll b/release_23/test/Transforms/InstCombine/2006-04-01-InfLoop.ll
deleted file mode 100644
index 6ea3d111203a..000000000000
--- a/release_23/test/Transforms/InstCombine/2006-04-01-InfLoop.ll
+++ /dev/null
@@ -1,444 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine -disable-output
-; END.
- %struct.DecRefPicMarking_s = type { i32, i32, i32, i32, i32, %struct.DecRefPicMarking_s* }
- %struct.datapartition = type { %typedef.Bitstream*, %typedef.DecodingEnvironment, i32 (%struct.syntaxelement*, %struct.img_par*, %struct.inp_par*, %struct.datapartition*)* }
- %struct.img_par = type { i32, i32, i32, i32, i32*, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, [16 x [16 x i16]], [6 x [32 x i32]], [16 x [16 x i32]], [4 x [12 x [4 x [4 x i32]]]], [16 x i32], i32**, i32*, i32***, i32**, i32, i32, i32, i32, %typedef.Slice*, %struct.macroblock*, i32, i32, i32, i32, i32, i32, i32**, %struct.DecRefPicMarking_s*, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, [3 x i32], i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32***, i32***, i32****, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, %struct.timeb, %struct.timeb, i32, i32, i32, i32, i32, i32, i32, i32 }
- %struct.inp_par = type { [100 x i8], [100 x i8], [100 x i8], i32, i32, i32, i32, i32, i32, i32 }
- %struct.macroblock = type { i32, i32, i32, %struct.macroblock*, %struct.macroblock*, i32, [2 x [4 x [4 x [2 x i32]]]], i32, i64, i64, i32, i32, [4 x i32], [4 x i32], i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 }
- %struct.pix_pos = type { i32, i32, i32, i32, i32, i32 }
- %struct.storable_picture = type { i32, i32, i32, i32, i32, [50 x [6 x [33 x i64]]], [50 x [6 x [33 x i64]]], [50 x [6 x [33 x i64]]], [50 x [6 x [33 x i64]]], i32, i32, i32, i32, i32, i32, i32, i32, i16, i32, i32, i32, i32, i32, i32, i32, i32, i32, i16**, i16***, i8*, i16**, i8***, i64***, i64***, i16****, i8**, i8**, %struct.storable_picture*, %struct.storable_picture*, %struct.storable_picture*, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, [2 x i32], i32, %struct.DecRefPicMarking_s*, i32 }
- %struct.syntaxelement = type { i32, i32, i32, i32, i32, i32, i32, i32, void (i32, i32, i32*, i32*)*, void (%struct.syntaxelement*, %struct.inp_par*, %struct.img_par*, %typedef.DecodingEnvironment*)* }
- %struct.timeb = type { i32, i16, i16, i16 }
- %typedef.BiContextType = type { i16, i8 }
- %typedef.Bitstream = type { i32, i32, i32, i32, i8*, i32 }
- %typedef.DecodingEnvironment = type { i32, i32, i32, i32, i32, i8*, i32* }
- %typedef.MotionInfoContexts = type { [4 x [11 x %typedef.BiContextType]], [2 x [9 x %typedef.BiContextType]], [2 x [10 x %typedef.BiContextType]], [2 x [6 x %typedef.BiContextType]], [4 x %typedef.BiContextType], [4 x %typedef.BiContextType], [3 x %typedef.BiContextType] }
- %typedef.Slice = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, %struct.datapartition*, %typedef.MotionInfoContexts*, %typedef.TextureInfoContexts*, i32, i32*, i32*, i32*, i32, i32*, i32*, i32*, i32 (%struct.img_par*, %struct.inp_par*)*, i32, i32, i32, i32 }
- %typedef.TextureInfoContexts = type { [2 x %typedef.BiContextType], [4 x %typedef.BiContextType], [3 x [4 x %typedef.BiContextType]], [10 x [4 x %typedef.BiContextType]], [10 x [15 x %typedef.BiContextType]], [10 x [15 x %typedef.BiContextType]], [10 x [5 x %typedef.BiContextType]], [10 x [5 x %typedef.BiContextType]], [10 x [15 x %typedef.BiContextType]], [10 x [15 x %typedef.BiContextType]] }
-@dec_picture = external global %struct.storable_picture* ; <%struct.storable_picture**> [#uses=1]
-@last_dquant = external global i32 ; <i32*> [#uses=1]
-
-define void @readCBP_CABAC(%struct.syntaxelement* %se, %struct.inp_par* %inp, %struct.img_par* %img.1, %typedef.DecodingEnvironment* %dep_dp) {
-entry:
- %block_a = alloca %struct.pix_pos ; <%struct.pix_pos*> [#uses=5]
- %tmp.1 = getelementptr %struct.img_par* %img.1, i32 0, i32 37 ; <%typedef.Slice**> [#uses=1]
- %tmp.2 = load %typedef.Slice** %tmp.1 ; <%typedef.Slice*> [#uses=1]
- %tmp.3 = getelementptr %typedef.Slice* %tmp.2, i32 0, i32 11 ; <%typedef.TextureInfoContexts**> [#uses=1]
- %tmp.4 = load %typedef.TextureInfoContexts** %tmp.3 ; <%typedef.TextureInfoContexts*> [#uses=3]
- %tmp.6 = getelementptr %struct.img_par* %img.1, i32 0, i32 38 ; <%struct.macroblock**> [#uses=1]
- %tmp.7 = load %struct.macroblock** %tmp.6 ; <%struct.macroblock*> [#uses=1]
- %tmp.9 = getelementptr %struct.img_par* %img.1, i32 0, i32 1 ; <i32*> [#uses=1]
- %tmp.10 = load i32* %tmp.9 ; <i32> [#uses=1]
- %tmp.11 = bitcast i32 %tmp.10 to i32 ; <i32> [#uses=1]
- %tmp.12 = getelementptr %struct.macroblock* %tmp.7, i32 %tmp.11 ; <%struct.macroblock*> [#uses=18]
- br label %loopentry.0
-
-loopentry.0: ; preds = %loopexit.1, %entry
- %mask.1 = phi i32 [ undef, %entry ], [ %mask.0, %loopexit.1 ] ; <i32> [#uses=1]
- %cbp_bit.1 = phi i32 [ undef, %entry ], [ %cbp_bit.0, %loopexit.1 ] ; <i32> [#uses=1]
- %cbp.2 = phi i32 [ 0, %entry ], [ %cbp.1, %loopexit.1 ] ; <i32> [#uses=5]
- %curr_cbp_ctx.1 = phi i32 [ undef, %entry ], [ %curr_cbp_ctx.0, %loopexit.1 ] ; <i32> [#uses=1]
- %b.2 = phi i32 [ undef, %entry ], [ %b.1, %loopexit.1 ] ; <i32> [#uses=1]
- %a.2 = phi i32 [ undef, %entry ], [ %a.1, %loopexit.1 ] ; <i32> [#uses=1]
- %mb_y.0 = phi i32 [ 0, %entry ], [ %tmp.152, %loopexit.1 ] ; <i32> [#uses=7]
- %mb_x.0 = phi i32 [ undef, %entry ], [ %mb_x.1, %loopexit.1 ] ; <i32> [#uses=0]
- %tmp.14 = icmp sle i32 %mb_y.0, 3 ; <i1> [#uses=2]
- %tmp.15 = zext i1 %tmp.14 to i32 ; <i32> [#uses=0]
- br i1 %tmp.14, label %no_exit.0, label %loopexit.0
-
-no_exit.0: ; preds = %loopentry.0
- br label %loopentry.1
-
-loopentry.1: ; preds = %endif.7, %no_exit.0
- %mask.0 = phi i32 [ %mask.1, %no_exit.0 ], [ %tmp.131, %endif.7 ] ; <i32> [#uses=1]
- %cbp_bit.0 = phi i32 [ %cbp_bit.1, %no_exit.0 ], [ %tmp.142, %endif.7 ] ; <i32> [#uses=1]
- %cbp.1 = phi i32 [ %cbp.2, %no_exit.0 ], [ %cbp.0, %endif.7 ] ; <i32> [#uses=5]
- %curr_cbp_ctx.0 = phi i32 [ %curr_cbp_ctx.1, %no_exit.0 ], [ %tmp.125, %endif.7 ] ; <i32> [#uses=1]
- %b.1 = phi i32 [ %b.2, %no_exit.0 ], [ %b.0, %endif.7 ] ; <i32> [#uses=1]
- %a.1 = phi i32 [ %a.2, %no_exit.0 ], [ %a.0, %endif.7 ] ; <i32> [#uses=1]
- %mb_x.1 = phi i32 [ 0, %no_exit.0 ], [ %tmp.150, %endif.7 ] ; <i32> [#uses=9]
- %tmp.17 = icmp sle i32 %mb_x.1, 3 ; <i1> [#uses=2]
- %tmp.18 = zext i1 %tmp.17 to i32 ; <i32> [#uses=0]
- br i1 %tmp.17, label %no_exit.1, label %loopexit.1
-
-no_exit.1: ; preds = %loopentry.1
- %tmp.20 = getelementptr %struct.macroblock* %tmp.12, i32 0, i32 12 ; <[4 x i32]*> [#uses=1]
- %tmp.22 = sdiv i32 %mb_x.1, 2 ; <i32> [#uses=1]
- %tmp.24 = add i32 %tmp.22, %mb_y.0 ; <i32> [#uses=1]
- %tmp.25 = getelementptr [4 x i32]* %tmp.20, i32 0, i32 %tmp.24 ; <i32*> [#uses=1]
- %tmp.26 = load i32* %tmp.25 ; <i32> [#uses=1]
- %tmp.27 = icmp eq i32 %tmp.26, 11 ; <i1> [#uses=2]
- %tmp.28 = zext i1 %tmp.27 to i32 ; <i32> [#uses=0]
- br i1 %tmp.27, label %then.0, label %else.0
-
-then.0: ; preds = %no_exit.1
- br label %endif.0
-
-else.0: ; preds = %no_exit.1
- br label %endif.0
-
-endif.0: ; preds = %else.0, %then.0
- %tmp.30 = icmp eq i32 %mb_y.0, 0 ; <i1> [#uses=2]
- %tmp.31 = zext i1 %tmp.30 to i32 ; <i32> [#uses=0]
- br i1 %tmp.30, label %then.1, label %else.1
-
-then.1: ; preds = %endif.0
- %tmp.33 = getelementptr %struct.macroblock* %tmp.12, i32 0, i32 3 ; <%struct.macroblock**> [#uses=1]
- %tmp.34 = load %struct.macroblock** %tmp.33 ; <%struct.macroblock*> [#uses=1]
- %tmp.35 = bitcast %struct.macroblock* %tmp.34 to i8* ; <i8*> [#uses=1]
- %tmp.36 = icmp eq i8* %tmp.35, null ; <i1> [#uses=2]
- %tmp.37 = zext i1 %tmp.36 to i32 ; <i32> [#uses=0]
- br i1 %tmp.36, label %then.2, label %else.2
-
-then.2: ; preds = %then.1
- br label %endif.1
-
-else.2: ; preds = %then.1
- %tmp.39 = getelementptr %struct.macroblock* %tmp.12, i32 0, i32 3 ; <%struct.macroblock**> [#uses=1]
- %tmp.40 = load %struct.macroblock** %tmp.39 ; <%struct.macroblock*> [#uses=1]
- %tmp.41 = getelementptr %struct.macroblock* %tmp.40, i32 0, i32 5 ; <i32*> [#uses=1]
- %tmp.42 = load i32* %tmp.41 ; <i32> [#uses=1]
- %tmp.43 = icmp eq i32 %tmp.42, 14 ; <i1> [#uses=2]
- %tmp.44 = zext i1 %tmp.43 to i32 ; <i32> [#uses=0]
- br i1 %tmp.43, label %then.3, label %else.3
-
-then.3: ; preds = %else.2
- br label %endif.1
-
-else.3: ; preds = %else.2
- %tmp.46 = getelementptr %struct.macroblock* %tmp.12, i32 0, i32 3 ; <%struct.macroblock**> [#uses=1]
- %tmp.47 = load %struct.macroblock** %tmp.46 ; <%struct.macroblock*> [#uses=1]
- %tmp.48 = getelementptr %struct.macroblock* %tmp.47, i32 0, i32 7 ; <i32*> [#uses=1]
- %tmp.49 = load i32* %tmp.48 ; <i32> [#uses=1]
- %tmp.51 = sdiv i32 %mb_x.1, 2 ; <i32> [#uses=1]
- %tmp.52 = add i32 %tmp.51, 2 ; <i32> [#uses=1]
- %tmp.53 = trunc i32 %tmp.52 to i8 ; <i8> [#uses=1]
- %shift.upgrd.1 = zext i8 %tmp.53 to i32 ; <i32> [#uses=1]
- %tmp.54 = ashr i32 %tmp.49, %shift.upgrd.1 ; <i32> [#uses=1]
- %tmp.55 = bitcast i32 %tmp.54 to i32 ; <i32> [#uses=1]
- %tmp.57 = xor i32 %tmp.55, 1 ; <i32> [#uses=1]
- %tmp.58 = bitcast i32 %tmp.57 to i32 ; <i32> [#uses=1]
- %tmp.59 = and i32 %tmp.58, 1 ; <i32> [#uses=1]
- br label %endif.1
-
-else.1: ; preds = %endif.0
- %tmp.62 = sdiv i32 %mb_x.1, 2 ; <i32> [#uses=1]
- %tmp.63 = trunc i32 %tmp.62 to i8 ; <i8> [#uses=1]
- %shift.upgrd.2 = zext i8 %tmp.63 to i32 ; <i32> [#uses=1]
- %tmp.64 = ashr i32 %cbp.1, %shift.upgrd.2 ; <i32> [#uses=1]
- %tmp.65 = bitcast i32 %tmp.64 to i32 ; <i32> [#uses=1]
- %tmp.67 = xor i32 %tmp.65, 1 ; <i32> [#uses=1]
- %tmp.68 = bitcast i32 %tmp.67 to i32 ; <i32> [#uses=1]
- %tmp.69 = and i32 %tmp.68, 1 ; <i32> [#uses=1]
- br label %endif.1
-
-endif.1: ; preds = %else.1, %else.3, %then.3, %then.2
- %b.0 = phi i32 [ 0, %then.2 ], [ 0, %then.3 ], [ %tmp.59, %else.3 ], [ %tmp.69, %else.1 ] ; <i32> [#uses=2]
- %tmp.71 = icmp eq i32 %mb_x.1, 0 ; <i1> [#uses=2]
- %tmp.72 = zext i1 %tmp.71 to i32 ; <i32> [#uses=0]
- br i1 %tmp.71, label %then.4, label %else.4
-
-then.4: ; preds = %endif.1
- %tmp.74 = getelementptr %struct.img_par* %img.1, i32 0, i32 1 ; <i32*> [#uses=1]
- %tmp.75 = load i32* %tmp.74 ; <i32> [#uses=1]
- %tmp.76 = bitcast i32 %tmp.75 to i32 ; <i32> [#uses=1]
- call void @getLuma4x4Neighbour( i32 %tmp.76, i32 %mb_x.1, i32 %mb_y.0, i32 -1, i32 0, %struct.pix_pos* %block_a )
- %tmp.79 = getelementptr %struct.pix_pos* %block_a, i32 0, i32 0 ; <i32*> [#uses=1]
- %tmp.80 = load i32* %tmp.79 ; <i32> [#uses=1]
- %tmp.81 = icmp ne i32 %tmp.80, 0 ; <i1> [#uses=2]
- %tmp.82 = zext i1 %tmp.81 to i32 ; <i32> [#uses=0]
- br i1 %tmp.81, label %then.5, label %else.5
-
-then.5: ; preds = %then.4
- %tmp.84 = getelementptr %struct.img_par* %img.1, i32 0, i32 38 ; <%struct.macroblock**> [#uses=1]
- %tmp.85 = load %struct.macroblock** %tmp.84 ; <%struct.macroblock*> [#uses=1]
- %tmp.86 = getelementptr %struct.pix_pos* %block_a, i32 0, i32 1 ; <i32*> [#uses=1]
- %tmp.87 = load i32* %tmp.86 ; <i32> [#uses=1]
- %tmp.88 = getelementptr %struct.macroblock* %tmp.85, i32 %tmp.87 ; <%struct.macroblock*> [#uses=1]
- %tmp.89 = getelementptr %struct.macroblock* %tmp.88, i32 0, i32 5 ; <i32*> [#uses=1]
- %tmp.90 = load i32* %tmp.89 ; <i32> [#uses=1]
- %tmp.91 = icmp eq i32 %tmp.90, 14 ; <i1> [#uses=2]
- %tmp.92 = zext i1 %tmp.91 to i32 ; <i32> [#uses=0]
- br i1 %tmp.91, label %then.6, label %else.6
-
-then.6: ; preds = %then.5
- br label %endif.4
-
-else.6: ; preds = %then.5
- %tmp.94 = getelementptr %struct.img_par* %img.1, i32 0, i32 38 ; <%struct.macroblock**> [#uses=1]
- %tmp.95 = load %struct.macroblock** %tmp.94 ; <%struct.macroblock*> [#uses=1]
- %tmp.96 = getelementptr %struct.pix_pos* %block_a, i32 0, i32 1 ; <i32*> [#uses=1]
- %tmp.97 = load i32* %tmp.96 ; <i32> [#uses=1]
- %tmp.98 = getelementptr %struct.macroblock* %tmp.95, i32 %tmp.97 ; <%struct.macroblock*> [#uses=1]
- %tmp.99 = getelementptr %struct.macroblock* %tmp.98, i32 0, i32 7 ; <i32*> [#uses=1]
- %tmp.100 = load i32* %tmp.99 ; <i32> [#uses=1]
- %tmp.101 = getelementptr %struct.pix_pos* %block_a, i32 0, i32 3 ; <i32*> [#uses=1]
- %tmp.102 = load i32* %tmp.101 ; <i32> [#uses=1]
- %tmp.103 = sdiv i32 %tmp.102, 2 ; <i32> [#uses=1]
- %tmp.104 = mul i32 %tmp.103, 2 ; <i32> [#uses=1]
- %tmp.105 = add i32 %tmp.104, 1 ; <i32> [#uses=1]
- %tmp.106 = trunc i32 %tmp.105 to i8 ; <i8> [#uses=1]
- %shift.upgrd.3 = zext i8 %tmp.106 to i32 ; <i32> [#uses=1]
- %tmp.107 = ashr i32 %tmp.100, %shift.upgrd.3 ; <i32> [#uses=1]
- %tmp.108 = bitcast i32 %tmp.107 to i32 ; <i32> [#uses=1]
- %tmp.110 = xor i32 %tmp.108, 1 ; <i32> [#uses=1]
- %tmp.111 = bitcast i32 %tmp.110 to i32 ; <i32> [#uses=1]
- %tmp.112 = and i32 %tmp.111, 1 ; <i32> [#uses=1]
- br label %endif.4
-
-else.5: ; preds = %then.4
- br label %endif.4
-
-else.4: ; preds = %endif.1
- %tmp.115 = trunc i32 %mb_y.0 to i8 ; <i8> [#uses=1]
- %shift.upgrd.4 = zext i8 %tmp.115 to i32 ; <i32> [#uses=1]
- %tmp.116 = ashr i32 %cbp.1, %shift.upgrd.4 ; <i32> [#uses=1]
- %tmp.117 = bitcast i32 %tmp.116 to i32 ; <i32> [#uses=1]
- %tmp.119 = xor i32 %tmp.117, 1 ; <i32> [#uses=1]
- %tmp.120 = bitcast i32 %tmp.119 to i32 ; <i32> [#uses=1]
- %tmp.121 = and i32 %tmp.120, 1 ; <i32> [#uses=1]
- br label %endif.4
-
-endif.4: ; preds = %else.4, %else.5, %else.6, %then.6
- %a.0 = phi i32 [ 0, %then.6 ], [ %tmp.112, %else.6 ], [ 0, %else.5 ], [ %tmp.121, %else.4 ] ; <i32> [#uses=2]
- %tmp.123 = mul i32 %b.0, 2 ; <i32> [#uses=1]
- %tmp.125 = add i32 %tmp.123, %a.0 ; <i32> [#uses=2]
- %tmp.127 = sdiv i32 %mb_x.1, 2 ; <i32> [#uses=1]
- %tmp.129 = add i32 %tmp.127, %mb_y.0 ; <i32> [#uses=1]
- %tmp.130 = trunc i32 %tmp.129 to i8 ; <i8> [#uses=1]
- %shift.upgrd.5 = zext i8 %tmp.130 to i32 ; <i32> [#uses=1]
- %tmp.131 = shl i32 1, %shift.upgrd.5 ; <i32> [#uses=2]
- %tmp.135 = getelementptr %typedef.TextureInfoContexts* %tmp.4, i32 0, i32 2 ; <[3 x [4 x %typedef.BiContextType]]*> [#uses=1]
- %tmp.136 = getelementptr [3 x [4 x %typedef.BiContextType]]* %tmp.135, i32 0, i32 0 ; <[4 x %typedef.BiContextType]*> [#uses=1]
- %tmp.137 = getelementptr [4 x %typedef.BiContextType]* %tmp.136, i32 0, i32 0 ; <%typedef.BiContextType*> [#uses=1]
- %tmp.139 = bitcast i32 %tmp.125 to i32 ; <i32> [#uses=1]
- %tmp.140 = bitcast i32 %tmp.139 to i32 ; <i32> [#uses=1]
- %tmp.141 = getelementptr %typedef.BiContextType* %tmp.137, i32 %tmp.140 ; <%typedef.BiContextType*> [#uses=1]
- %tmp.132 = call i32 @biari_decode_symbol( %typedef.DecodingEnvironment* %dep_dp, %typedef.BiContextType* %tmp.141 ) ; <i32> [#uses=1]
- %tmp.142 = bitcast i32 %tmp.132 to i32 ; <i32> [#uses=2]
- %tmp.144 = icmp ne i32 %tmp.142, 0 ; <i1> [#uses=2]
- %tmp.145 = zext i1 %tmp.144 to i32 ; <i32> [#uses=0]
- br i1 %tmp.144, label %then.7, label %endif.7
-
-then.7: ; preds = %endif.4
- %tmp.148 = add i32 %cbp.1, %tmp.131 ; <i32> [#uses=1]
- br label %endif.7
-
-endif.7: ; preds = %then.7, %endif.4
- %cbp.0 = phi i32 [ %tmp.148, %then.7 ], [ %cbp.1, %endif.4 ] ; <i32> [#uses=1]
- %tmp.150 = add i32 %mb_x.1, 2 ; <i32> [#uses=1]
- br label %loopentry.1
-
-loopexit.1: ; preds = %loopentry.1
- %tmp.152 = add i32 %mb_y.0, 2 ; <i32> [#uses=1]
- br label %loopentry.0
-
-loopexit.0: ; preds = %loopentry.0
- %tmp.153 = load %struct.storable_picture** @dec_picture ; <%struct.storable_picture*> [#uses=1]
- %tmp.154 = getelementptr %struct.storable_picture* %tmp.153, i32 0, i32 45 ; <i32*> [#uses=1]
- %tmp.155 = load i32* %tmp.154 ; <i32> [#uses=1]
- %tmp.156 = icmp ne i32 %tmp.155, 0 ; <i1> [#uses=2]
- %tmp.157 = zext i1 %tmp.156 to i32 ; <i32> [#uses=0]
- br i1 %tmp.156, label %then.8, label %endif.8
-
-then.8: ; preds = %loopexit.0
- %tmp.159 = getelementptr %struct.macroblock* %tmp.12, i32 0, i32 3 ; <%struct.macroblock**> [#uses=1]
- %tmp.160 = load %struct.macroblock** %tmp.159 ; <%struct.macroblock*> [#uses=1]
- %tmp.161 = bitcast %struct.macroblock* %tmp.160 to i8* ; <i8*> [#uses=1]
- %tmp.162 = icmp ne i8* %tmp.161, null ; <i1> [#uses=2]
- %tmp.163 = zext i1 %tmp.162 to i32 ; <i32> [#uses=0]
- br i1 %tmp.162, label %then.9, label %endif.9
-
-then.9: ; preds = %then.8
- %tmp.165 = getelementptr %struct.macroblock* %tmp.12, i32 0, i32 3 ; <%struct.macroblock**> [#uses=1]
- %tmp.166 = load %struct.macroblock** %tmp.165 ; <%struct.macroblock*> [#uses=1]
- %tmp.167 = getelementptr %struct.macroblock* %tmp.166, i32 0, i32 5 ; <i32*> [#uses=1]
- %tmp.168 = load i32* %tmp.167 ; <i32> [#uses=1]
- %tmp.169 = icmp eq i32 %tmp.168, 14 ; <i1> [#uses=2]
- %tmp.170 = zext i1 %tmp.169 to i32 ; <i32> [#uses=0]
- br i1 %tmp.169, label %then.10, label %else.7
-
-then.10: ; preds = %then.9
- br label %endif.9
-
-else.7: ; preds = %then.9
- %tmp.172 = getelementptr %struct.macroblock* %tmp.12, i32 0, i32 3 ; <%struct.macroblock**> [#uses=1]
- %tmp.173 = load %struct.macroblock** %tmp.172 ; <%struct.macroblock*> [#uses=1]
- %tmp.174 = getelementptr %struct.macroblock* %tmp.173, i32 0, i32 7 ; <i32*> [#uses=1]
- %tmp.175 = load i32* %tmp.174 ; <i32> [#uses=1]
- %tmp.176 = icmp sgt i32 %tmp.175, 15 ; <i1> [#uses=1]
- %tmp.177 = zext i1 %tmp.176 to i32 ; <i32> [#uses=1]
- br label %endif.9
-
-endif.9: ; preds = %else.7, %then.10, %then.8
- %b.4 = phi i32 [ 1, %then.10 ], [ %tmp.177, %else.7 ], [ 0, %then.8 ] ; <i32> [#uses=1]
- %tmp.179 = getelementptr %struct.macroblock* %tmp.12, i32 0, i32 4 ; <%struct.macroblock**> [#uses=1]
- %tmp.180 = load %struct.macroblock** %tmp.179 ; <%struct.macroblock*> [#uses=1]
- %tmp.181 = bitcast %struct.macroblock* %tmp.180 to i8* ; <i8*> [#uses=1]
- %tmp.182 = icmp ne i8* %tmp.181, null ; <i1> [#uses=2]
- %tmp.183 = zext i1 %tmp.182 to i32 ; <i32> [#uses=0]
- br i1 %tmp.182, label %then.11, label %endif.11
-
-then.11: ; preds = %endif.9
- %tmp.185 = getelementptr %struct.macroblock* %tmp.12, i32 0, i32 4 ; <%struct.macroblock**> [#uses=1]
- %tmp.186 = load %struct.macroblock** %tmp.185 ; <%struct.macroblock*> [#uses=1]
- %tmp.187 = getelementptr %struct.macroblock* %tmp.186, i32 0, i32 5 ; <i32*> [#uses=1]
- %tmp.188 = load i32* %tmp.187 ; <i32> [#uses=1]
- %tmp.189 = icmp eq i32 %tmp.188, 14 ; <i1> [#uses=2]
- %tmp.190 = zext i1 %tmp.189 to i32 ; <i32> [#uses=0]
- br i1 %tmp.189, label %then.12, label %else.8
-
-then.12: ; preds = %then.11
- br label %endif.11
-
-else.8: ; preds = %then.11
- %tmp.192 = getelementptr %struct.macroblock* %tmp.12, i32 0, i32 4 ; <%struct.macroblock**> [#uses=1]
- %tmp.193 = load %struct.macroblock** %tmp.192 ; <%struct.macroblock*> [#uses=1]
- %tmp.194 = getelementptr %struct.macroblock* %tmp.193, i32 0, i32 7 ; <i32*> [#uses=1]
- %tmp.195 = load i32* %tmp.194 ; <i32> [#uses=1]
- %tmp.196 = icmp sgt i32 %tmp.195, 15 ; <i1> [#uses=1]
- %tmp.197 = zext i1 %tmp.196 to i32 ; <i32> [#uses=1]
- br label %endif.11
-
-endif.11: ; preds = %else.8, %then.12, %endif.9
- %a.4 = phi i32 [ 1, %then.12 ], [ %tmp.197, %else.8 ], [ 0, %endif.9 ] ; <i32> [#uses=1]
- %tmp.199 = mul i32 %b.4, 2 ; <i32> [#uses=1]
- %tmp.201 = add i32 %tmp.199, %a.4 ; <i32> [#uses=1]
- %tmp.205 = getelementptr %typedef.TextureInfoContexts* %tmp.4, i32 0, i32 2 ; <[3 x [4 x %typedef.BiContextType]]*> [#uses=1]
- %tmp.206 = getelementptr [3 x [4 x %typedef.BiContextType]]* %tmp.205, i32 0, i32 1 ; <[4 x %typedef.BiContextType]*> [#uses=1]
- %tmp.207 = getelementptr [4 x %typedef.BiContextType]* %tmp.206, i32 0, i32 0 ; <%typedef.BiContextType*> [#uses=1]
- %tmp.209 = bitcast i32 %tmp.201 to i32 ; <i32> [#uses=1]
- %tmp.210 = bitcast i32 %tmp.209 to i32 ; <i32> [#uses=1]
- %tmp.211 = getelementptr %typedef.BiContextType* %tmp.207, i32 %tmp.210 ; <%typedef.BiContextType*> [#uses=1]
- %tmp.202 = call i32 @biari_decode_symbol( %typedef.DecodingEnvironment* %dep_dp, %typedef.BiContextType* %tmp.211 ) ; <i32> [#uses=1]
- %tmp.212 = bitcast i32 %tmp.202 to i32 ; <i32> [#uses=1]
- %tmp.214 = icmp ne i32 %tmp.212, 0 ; <i1> [#uses=2]
- %tmp.215 = zext i1 %tmp.214 to i32 ; <i32> [#uses=0]
- br i1 %tmp.214, label %then.13, label %endif.8
-
-then.13: ; preds = %endif.11
- %tmp.217 = getelementptr %struct.macroblock* %tmp.12, i32 0, i32 3 ; <%struct.macroblock**> [#uses=1]
- %tmp.218 = load %struct.macroblock** %tmp.217 ; <%struct.macroblock*> [#uses=1]
- %tmp.219 = bitcast %struct.macroblock* %tmp.218 to i8* ; <i8*> [#uses=1]
- %tmp.220 = icmp ne i8* %tmp.219, null ; <i1> [#uses=2]
- %tmp.221 = zext i1 %tmp.220 to i32 ; <i32> [#uses=0]
- br i1 %tmp.220, label %then.14, label %endif.14
-
-then.14: ; preds = %then.13
- %tmp.223 = getelementptr %struct.macroblock* %tmp.12, i32 0, i32 3 ; <%struct.macroblock**> [#uses=1]
- %tmp.224 = load %struct.macroblock** %tmp.223 ; <%struct.macroblock*> [#uses=1]
- %tmp.225 = getelementptr %struct.macroblock* %tmp.224, i32 0, i32 5 ; <i32*> [#uses=1]
- %tmp.226 = load i32* %tmp.225 ; <i32> [#uses=1]
- %tmp.227 = icmp eq i32 %tmp.226, 14 ; <i1> [#uses=2]
- %tmp.228 = zext i1 %tmp.227 to i32 ; <i32> [#uses=0]
- br i1 %tmp.227, label %then.15, label %else.9
-
-then.15: ; preds = %then.14
- br label %endif.14
-
-else.9: ; preds = %then.14
- %tmp.230 = getelementptr %struct.macroblock* %tmp.12, i32 0, i32 3 ; <%struct.macroblock**> [#uses=1]
- %tmp.231 = load %struct.macroblock** %tmp.230 ; <%struct.macroblock*> [#uses=1]
- %tmp.232 = getelementptr %struct.macroblock* %tmp.231, i32 0, i32 7 ; <i32*> [#uses=1]
- %tmp.233 = load i32* %tmp.232 ; <i32> [#uses=1]
- %tmp.234 = icmp sgt i32 %tmp.233, 15 ; <i1> [#uses=2]
- %tmp.235 = zext i1 %tmp.234 to i32 ; <i32> [#uses=0]
- br i1 %tmp.234, label %then.16, label %endif.14
-
-then.16: ; preds = %else.9
- %tmp.237 = getelementptr %struct.macroblock* %tmp.12, i32 0, i32 3 ; <%struct.macroblock**> [#uses=1]
- %tmp.238 = load %struct.macroblock** %tmp.237 ; <%struct.macroblock*> [#uses=1]
- %tmp.239 = getelementptr %struct.macroblock* %tmp.238, i32 0, i32 7 ; <i32*> [#uses=1]
- %tmp.240 = load i32* %tmp.239 ; <i32> [#uses=1]
- %tmp.242 = ashr i32 %tmp.240, 4 ; <i32> [#uses=1]
- %tmp.243 = icmp eq i32 %tmp.242, 2 ; <i1> [#uses=1]
- %tmp.244 = zext i1 %tmp.243 to i32 ; <i32> [#uses=1]
- br label %endif.14
-
-endif.14: ; preds = %then.16, %else.9, %then.15, %then.13
- %b.5 = phi i32 [ 1, %then.15 ], [ %tmp.244, %then.16 ], [ 0, %else.9 ], [ 0, %then.13 ] ; <i32> [#uses=1]
- %tmp.246 = getelementptr %struct.macroblock* %tmp.12, i32 0, i32 4 ; <%struct.macroblock**> [#uses=1]
- %tmp.247 = load %struct.macroblock** %tmp.246 ; <%struct.macroblock*> [#uses=1]
- %tmp.248 = bitcast %struct.macroblock* %tmp.247 to i8* ; <i8*> [#uses=1]
- %tmp.249 = icmp ne i8* %tmp.248, null ; <i1> [#uses=2]
- %tmp.250 = zext i1 %tmp.249 to i32 ; <i32> [#uses=0]
- br i1 %tmp.249, label %then.17, label %endif.17
-
-then.17: ; preds = %endif.14
- %tmp.252 = getelementptr %struct.macroblock* %tmp.12, i32 0, i32 4 ; <%struct.macroblock**> [#uses=1]
- %tmp.253 = load %struct.macroblock** %tmp.252 ; <%struct.macroblock*> [#uses=1]
- %tmp.254 = getelementptr %struct.macroblock* %tmp.253, i32 0, i32 5 ; <i32*> [#uses=1]
- %tmp.255 = load i32* %tmp.254 ; <i32> [#uses=1]
- %tmp.256 = icmp eq i32 %tmp.255, 14 ; <i1> [#uses=2]
- %tmp.257 = zext i1 %tmp.256 to i32 ; <i32> [#uses=0]
- br i1 %tmp.256, label %then.18, label %else.10
-
-then.18: ; preds = %then.17
- br label %endif.17
-
-else.10: ; preds = %then.17
- %tmp.259 = getelementptr %struct.macroblock* %tmp.12, i32 0, i32 4 ; <%struct.macroblock**> [#uses=1]
- %tmp.260 = load %struct.macroblock** %tmp.259 ; <%struct.macroblock*> [#uses=1]
- %tmp.261 = getelementptr %struct.macroblock* %tmp.260, i32 0, i32 7 ; <i32*> [#uses=1]
- %tmp.262 = load i32* %tmp.261 ; <i32> [#uses=1]
- %tmp.263 = icmp sgt i32 %tmp.262, 15 ; <i1> [#uses=2]
- %tmp.264 = zext i1 %tmp.263 to i32 ; <i32> [#uses=0]
- br i1 %tmp.263, label %then.19, label %endif.17
-
-then.19: ; preds = %else.10
- %tmp.266 = getelementptr %struct.macroblock* %tmp.12, i32 0, i32 4 ; <%struct.macroblock**> [#uses=1]
- %tmp.267 = load %struct.macroblock** %tmp.266 ; <%struct.macroblock*> [#uses=1]
- %tmp.268 = getelementptr %struct.macroblock* %tmp.267, i32 0, i32 7 ; <i32*> [#uses=1]
- %tmp.269 = load i32* %tmp.268 ; <i32> [#uses=1]
- %tmp.271 = ashr i32 %tmp.269, 4 ; <i32> [#uses=1]
- %tmp.272 = icmp eq i32 %tmp.271, 2 ; <i1> [#uses=1]
- %tmp.273 = zext i1 %tmp.272 to i32 ; <i32> [#uses=1]
- br label %endif.17
-
-endif.17: ; preds = %then.19, %else.10, %then.18, %endif.14
- %a.5 = phi i32 [ 1, %then.18 ], [ %tmp.273, %then.19 ], [ 0, %else.10 ], [ 0, %endif.14 ] ; <i32> [#uses=1]
- %tmp.275 = mul i32 %b.5, 2 ; <i32> [#uses=1]
- %tmp.277 = add i32 %tmp.275, %a.5 ; <i32> [#uses=1]
- %tmp.281 = getelementptr %typedef.TextureInfoContexts* %tmp.4, i32 0, i32 2 ; <[3 x [4 x %typedef.BiContextType]]*> [#uses=1]
- %tmp.282 = getelementptr [3 x [4 x %typedef.BiContextType]]* %tmp.281, i32 0, i32 2 ; <[4 x %typedef.BiContextType]*> [#uses=1]
- %tmp.283 = getelementptr [4 x %typedef.BiContextType]* %tmp.282, i32 0, i32 0 ; <%typedef.BiContextType*> [#uses=1]
- %tmp.285 = bitcast i32 %tmp.277 to i32 ; <i32> [#uses=1]
- %tmp.286 = bitcast i32 %tmp.285 to i32 ; <i32> [#uses=1]
- %tmp.287 = getelementptr %typedef.BiContextType* %tmp.283, i32 %tmp.286 ; <%typedef.BiContextType*> [#uses=1]
- %tmp.278 = call i32 @biari_decode_symbol( %typedef.DecodingEnvironment* %dep_dp, %typedef.BiContextType* %tmp.287 ) ; <i32> [#uses=1]
- %tmp.288 = bitcast i32 %tmp.278 to i32 ; <i32> [#uses=1]
- %tmp.290 = icmp eq i32 %tmp.288, 1 ; <i1> [#uses=2]
- %tmp.291 = zext i1 %tmp.290 to i32 ; <i32> [#uses=0]
- br i1 %tmp.290, label %cond_true, label %cond_false
-
-cond_true: ; preds = %endif.17
- %tmp.293 = add i32 %cbp.2, 32 ; <i32> [#uses=1]
- br label %cond_continue
-
-cond_false: ; preds = %endif.17
- %tmp.295 = add i32 %cbp.2, 16 ; <i32> [#uses=1]
- br label %cond_continue
-
-cond_continue: ; preds = %cond_false, %cond_true
- %mem_tmp.0 = phi i32 [ %tmp.293, %cond_true ], [ %tmp.295, %cond_false ] ; <i32> [#uses=1]
- br label %endif.8
-
-endif.8: ; preds = %cond_continue, %endif.11, %loopexit.0
- %cbp.3 = phi i32 [ %mem_tmp.0, %cond_continue ], [ %cbp.2, %endif.11 ], [ %cbp.2, %loopexit.0 ] ; <i32> [#uses=2]
- %tmp.298 = getelementptr %struct.syntaxelement* %se, i32 0, i32 1 ; <i32*> [#uses=1]
- store i32 %cbp.3, i32* %tmp.298
- %tmp.301 = icmp eq i32 %cbp.3, 0 ; <i1> [#uses=2]
- %tmp.302 = zext i1 %tmp.301 to i32 ; <i32> [#uses=0]
- br i1 %tmp.301, label %then.20, label %return
-
-then.20: ; preds = %endif.8
- store i32 0, i32* @last_dquant
- ret void
-
-return: ; preds = %endif.8
- ret void
-}
-
-declare i32 @biari_decode_symbol(%typedef.DecodingEnvironment*, %typedef.BiContextType*)
-
-declare void @getLuma4x4Neighbour(i32, i32, i32, i32, i32, %struct.pix_pos*)
diff --git a/release_23/test/Transforms/InstCombine/2006-04-28-ShiftShiftLongLong.ll b/release_23/test/Transforms/InstCombine/2006-04-28-ShiftShiftLongLong.ll
deleted file mode 100644
index 2541eb733031..000000000000
--- a/release_23/test/Transforms/InstCombine/2006-04-28-ShiftShiftLongLong.ll
+++ /dev/null
@@ -1,11 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep shl
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | notcast
-
-; This cannot be turned into a sign extending cast!
-
-define i64 @test(i64 %X) {
- %Y = shl i64 %X, 16 ; <i64> [#uses=1]
- %Z = ashr i64 %Y, 16 ; <i64> [#uses=1]
- ret i64 %Z
-}
-
diff --git a/release_23/test/Transforms/InstCombine/2006-05-04-DemandedBitCrash.ll b/release_23/test/Transforms/InstCombine/2006-05-04-DemandedBitCrash.ll
deleted file mode 100644
index 1b9df405c5ad..000000000000
--- a/release_23/test/Transforms/InstCombine/2006-05-04-DemandedBitCrash.ll
+++ /dev/null
@@ -1,51 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine -disable-output
-; END.
-
-define void @test() {
-bb38.i:
- %varspec.0.i1014 = bitcast i64 123814269237067777 to i64 ; <i64> [#uses=1]
- %locspec.0.i1015 = bitcast i32 1 to i32 ; <i32> [#uses=2]
- %tmp51391.i1018 = lshr i64 %varspec.0.i1014, 16 ; <i64> [#uses=1]
- %tmp51392.i1019 = trunc i64 %tmp51391.i1018 to i32 ; <i32> [#uses=2]
- %tmp51392.mask.i1020 = lshr i32 %tmp51392.i1019, 29 ; <i32> [#uses=1]
- %tmp7.i1021 = and i32 %tmp51392.mask.i1020, 1 ; <i32> [#uses=2]
- %tmp18.i1026 = lshr i32 %tmp51392.i1019, 31 ; <i32> [#uses=2]
- %tmp18.i1027 = trunc i32 %tmp18.i1026 to i8 ; <i8> [#uses=1]
- br i1 false, label %cond_false1148.i1653, label %bb377.i1259
-
-bb377.i1259: ; preds = %bb38.i
- br i1 false, label %cond_true541.i1317, label %cond_false1148.i1653
-
-cond_true541.i1317: ; preds = %bb377.i1259
- %tmp545.i1318 = lshr i32 %locspec.0.i1015, 10 ; <i32> [#uses=1]
- %tmp550.i1319 = lshr i32 %locspec.0.i1015, 4 ; <i32> [#uses=1]
- %tmp550551.i1320 = and i32 %tmp550.i1319, 63 ; <i32> [#uses=1]
- %tmp553.i1321 = icmp ult i32 %tmp550551.i1320, 4 ; <i1> [#uses=1]
- %tmp558.i1322 = icmp eq i32 %tmp7.i1021, 0 ; <i1> [#uses=1]
- %bothcond.i1326 = or i1 %tmp553.i1321, false ; <i1> [#uses=1]
- %bothcond1.i1327 = or i1 %bothcond.i1326, false ; <i1> [#uses=1]
- %bothcond2.not.i1328 = or i1 %bothcond1.i1327, false ; <i1> [#uses=1]
- %bothcond3.i1329 = or i1 %bothcond2.not.i1328, %tmp558.i1322 ; <i1> [#uses=0]
- br i1 false, label %cond_true583.i1333, label %cond_next592.i1337
-
-cond_true583.i1333: ; preds = %cond_true541.i1317
- br i1 false, label %cond_true586.i1335, label %cond_next592.i1337
-
-cond_true586.i1335: ; preds = %cond_true583.i1333
- br label %cond_true.i
-
-cond_next592.i1337: ; preds = %cond_true583.i1333, %cond_true541.i1317
- %mask_z.0.i1339 = phi i32 [ %tmp18.i1026, %cond_true541.i1317 ], [ 0, %cond_true583.i1333 ] ; <i32> [#uses=0]
- %tmp594.i1340 = and i32 %tmp545.i1318, 15 ; <i32> [#uses=0]
- br label %cond_true.i
-
-cond_false1148.i1653: ; preds = %bb377.i1259, %bb38.i
- %tmp1150.i1654 = icmp eq i32 %tmp7.i1021, 0 ; <i1> [#uses=1]
- %tmp1160.i1656 = icmp eq i8 %tmp18.i1027, 0 ; <i1> [#uses=1]
- %bothcond8.i1658 = or i1 %tmp1150.i1654, %tmp1160.i1656 ; <i1> [#uses=1]
- %bothcond9.i1659 = or i1 %bothcond8.i1658, false ; <i1> [#uses=0]
- br label %cond_true.i
-
-cond_true.i: ; preds = %cond_false1148.i1653, %cond_next592.i1337, %cond_true586.i1335
- ret void
-}
diff --git a/release_23/test/Transforms/InstCombine/2006-05-06-Infloop.ll b/release_23/test/Transforms/InstCombine/2006-05-06-Infloop.ll
deleted file mode 100644
index ec67d7178eb7..000000000000
--- a/release_23/test/Transforms/InstCombine/2006-05-06-Infloop.ll
+++ /dev/null
@@ -1,519 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine -disable-output
-; END.
- %struct.gs_matrix = type { float, i32, float, i32, float, i32, float, i32, float, i32, float, i32 }
- %struct.gx_bitmap = type { i8*, i32, i32, i32 }
- %struct.gx_device = type { i32, %struct.gx_device_procs*, i8*, i32, i32, float, float, i32, i16, i32, i32 }
- %struct.gx_device_memory = type { i32, %struct.gx_device_procs*, i8*, i32, i32, float, float, i32, i16, i32, i32, %struct.gs_matrix, i32, i8*, i8**, i32 (%struct.gx_device_memory*, i32, i32, i32, i32, i32)*, i32, i32, i8* }
- %struct.gx_device_procs = type { i32 (%struct.gx_device*)*, void (%struct.gx_device*, %struct.gs_matrix*)*, i32 (%struct.gx_device*)*, i32 (%struct.gx_device*)*, i32 (%struct.gx_device*)*, i32 (%struct.gx_device*, i16, i16, i16)*, i32 (%struct.gx_device*, i32, i16*)*, i32 (%struct.gx_device*, i32, i32, i32, i32, i32)*, i32 (%struct.gx_device*, %struct.gx_bitmap*, i32, i32, i32, i32, i32, i32)*, i32 (%struct.gx_device*, i8*, i32, i32, i32, i32, i32, i32, i32, i32)*, i32 (%struct.gx_device*, i8*, i32, i32, i32, i32, i32, i32)*, i32 (%struct.gx_device*, i32, i32, i32, i32, i32)*, i32 (%struct.gx_device*, i32, i32, i32, i32, i32, i32, i32)*, i32 (%struct.gx_device*, %struct.gx_bitmap*, i32, i32, i32, i32, i32, i32, i32, i32)* }
-
-define i32 @mem_mono_copy_mono(%struct.gx_device* %dev, i8* %base, i32 %sourcex, i32 %raster, i32 %x, i32 %y, i32 %w, i32 %h, i32 %zero, i32 %one) {
-entry:
- %tmp = icmp eq i32 %one, %zero ; <i1> [#uses=1]
- br i1 %tmp, label %cond_true, label %cond_next
-
-cond_true: ; preds = %entry
- %tmp6 = tail call i32 @mem_mono_fill_rectangle( %struct.gx_device* %dev, i32 %x, i32 %y, i32 %w, i32 %h, i32 %zero ) ; <i32> [#uses=1]
- ret i32 %tmp6
-
-cond_next: ; preds = %entry
- %tmp8 = bitcast %struct.gx_device* %dev to %struct.gx_device_memory* ; <%struct.gx_device_memory*> [#uses=6]
- %tmp.upgrd.1 = getelementptr %struct.gx_device_memory* %tmp8, i32 0, i32 15 ; <i32 (%struct.gx_device_memory*, i32, i32, i32, i32, i32)**> [#uses=1]
- %tmp.upgrd.2 = load i32 (%struct.gx_device_memory*, i32, i32, i32, i32, i32)** %tmp.upgrd.1 ; <i32 (%struct.gx_device_memory*, i32, i32, i32, i32, i32)*> [#uses=2]
- %tmp9 = icmp eq i32 (%struct.gx_device_memory*, i32, i32, i32, i32, i32)* %tmp.upgrd.2, @mem_no_fault_proc ; <i1> [#uses=1]
- br i1 %tmp9, label %cond_next46, label %cond_true10
-
-cond_true10: ; preds = %cond_next
- %tmp16 = add i32 %x, 7 ; <i32> [#uses=1]
- %tmp17 = add i32 %tmp16, %w ; <i32> [#uses=1]
- %tmp18 = ashr i32 %tmp17, 3 ; <i32> [#uses=1]
- %tmp20 = ashr i32 %x, 3 ; <i32> [#uses=2]
- %tmp21 = sub i32 %tmp18, %tmp20 ; <i32> [#uses=1]
- %tmp27 = tail call i32 %tmp.upgrd.2( %struct.gx_device_memory* %tmp8, i32 %tmp20, i32 %y, i32 %tmp21, i32 %h, i32 1 ) ; <i32> [#uses=2]
- %tmp29 = icmp slt i32 %tmp27, 0 ; <i1> [#uses=1]
- br i1 %tmp29, label %cond_true30, label %cond_next46
-
-cond_true30: ; preds = %cond_true10
- %tmp41 = tail call i32 @mem_copy_mono_recover( %struct.gx_device* %dev, i8* %base, i32 %sourcex, i32 %raster, i32 %x, i32 %y, i32 %w, i32 %h, i32 %zero, i32 %one, i32 %tmp27 ) ; <i32> [#uses=1]
- ret i32 %tmp41
-
-cond_next46: ; preds = %cond_true10, %cond_next
- %tmp48 = icmp sgt i32 %w, 0 ; <i1> [#uses=1]
- %tmp53 = icmp sgt i32 %h, 0 ; <i1> [#uses=1]
- %bothcond = and i1 %tmp53, %tmp48 ; <i1> [#uses=1]
- br i1 %bothcond, label %bb58, label %return
-
-bb58: ; preds = %cond_next46
- %tmp60 = icmp slt i32 %x, 0 ; <i1> [#uses=1]
- br i1 %tmp60, label %return, label %cond_next63
-
-cond_next63: ; preds = %bb58
- %tmp65 = getelementptr %struct.gx_device_memory* %tmp8, i32 0, i32 3 ; <i32*> [#uses=1]
- %tmp66 = load i32* %tmp65 ; <i32> [#uses=1]
- %tmp68 = sub i32 %tmp66, %w ; <i32> [#uses=1]
- %tmp70 = icmp slt i32 %tmp68, %x ; <i1> [#uses=1]
- %tmp75 = icmp slt i32 %y, 0 ; <i1> [#uses=1]
- %bothcond1 = or i1 %tmp70, %tmp75 ; <i1> [#uses=1]
- br i1 %bothcond1, label %return, label %cond_next78
-
-cond_next78: ; preds = %cond_next63
- %tmp80 = getelementptr %struct.gx_device_memory* %tmp8, i32 0, i32 4 ; <i32*> [#uses=1]
- %tmp81 = load i32* %tmp80 ; <i32> [#uses=1]
- %tmp83 = sub i32 %tmp81, %h ; <i32> [#uses=1]
- %tmp85 = icmp slt i32 %tmp83, %y ; <i1> [#uses=1]
- br i1 %tmp85, label %return, label %bb91
-
-bb91: ; preds = %cond_next78
- %tmp93 = ashr i32 %x, 3 ; <i32> [#uses=4]
- %tmp.upgrd.3 = getelementptr %struct.gx_device_memory* %tmp8, i32 0, i32 14 ; <i8***> [#uses=1]
- %tmp.upgrd.4 = load i8*** %tmp.upgrd.3 ; <i8**> [#uses=1]
- %tmp96 = getelementptr i8** %tmp.upgrd.4, i32 %y ; <i8**> [#uses=4]
- %tmp98 = load i8** %tmp96 ; <i8*> [#uses=1]
- %tmp100 = getelementptr i8* %tmp98, i32 %tmp93 ; <i8*> [#uses=3]
- %tmp102 = ashr i32 %sourcex, 3 ; <i32> [#uses=3]
- %tmp106 = and i32 %sourcex, 7 ; <i32> [#uses=1]
- %tmp107 = sub i32 8, %tmp106 ; <i32> [#uses=4]
- %tmp109 = and i32 %x, 7 ; <i32> [#uses=3]
- %tmp110 = sub i32 8, %tmp109 ; <i32> [#uses=8]
- %tmp112 = sub i32 8, %tmp110 ; <i32> [#uses=1]
- %tmp112.upgrd.5 = trunc i32 %tmp112 to i8 ; <i8> [#uses=1]
- %shift.upgrd.6 = zext i8 %tmp112.upgrd.5 to i32 ; <i32> [#uses=1]
- %tmp113464 = lshr i32 255, %shift.upgrd.6 ; <i32> [#uses=4]
- %tmp116 = icmp sgt i32 %tmp110, %w ; <i1> [#uses=1]
- %tmp132 = getelementptr %struct.gx_device_memory* %tmp8, i32 0, i32 16 ; <i32*> [#uses=2]
- br i1 %tmp116, label %cond_true117, label %cond_false123
-
-cond_true117: ; preds = %bb91
- %tmp119 = trunc i32 %w to i8 ; <i8> [#uses=1]
- %shift.upgrd.7 = zext i8 %tmp119 to i32 ; <i32> [#uses=1]
- %tmp120 = lshr i32 %tmp113464, %shift.upgrd.7 ; <i32> [#uses=1]
- %tmp122 = sub i32 %tmp113464, %tmp120 ; <i32> [#uses=2]
- %tmp13315 = load i32* %tmp132 ; <i32> [#uses=1]
- %tmp13416 = icmp eq i32 %tmp13315, 0 ; <i1> [#uses=1]
- br i1 %tmp13416, label %cond_next151, label %cond_true135
-
-cond_false123: ; preds = %bb91
- %tmp126 = sub i32 %w, %tmp110 ; <i32> [#uses=1]
- %tmp126.upgrd.8 = trunc i32 %tmp126 to i8 ; <i8> [#uses=1]
- %tmp127 = and i8 %tmp126.upgrd.8, 7 ; <i8> [#uses=1]
- %shift.upgrd.9 = zext i8 %tmp127 to i32 ; <i32> [#uses=1]
- %tmp128 = lshr i32 255, %shift.upgrd.9 ; <i32> [#uses=1]
- %tmp1295 = sub i32 255, %tmp128 ; <i32> [#uses=2]
- %tmp133 = load i32* %tmp132 ; <i32> [#uses=1]
- %tmp134 = icmp eq i32 %tmp133, 0 ; <i1> [#uses=1]
- br i1 %tmp134, label %cond_next151, label %cond_true135
-
-cond_true135: ; preds = %cond_false123, %cond_true117
- %rmask.0.0 = phi i32 [ undef, %cond_true117 ], [ %tmp1295, %cond_false123 ] ; <i32> [#uses=2]
- %mask.1.0 = phi i32 [ %tmp122, %cond_true117 ], [ %tmp113464, %cond_false123 ] ; <i32> [#uses=2]
- %not.tmp137 = icmp ne i32 %zero, -1 ; <i1> [#uses=1]
- %tmp140 = zext i1 %not.tmp137 to i32 ; <i32> [#uses=1]
- %zero_addr.0 = xor i32 %tmp140, %zero ; <i32> [#uses=2]
- %tmp144 = icmp eq i32 %one, -1 ; <i1> [#uses=1]
- br i1 %tmp144, label %cond_next151, label %cond_true145
-
-cond_true145: ; preds = %cond_true135
- %tmp147 = xor i32 %one, 1 ; <i32> [#uses=1]
- br label %cond_next151
-
-cond_next151: ; preds = %cond_true145, %cond_true135, %cond_false123, %cond_true117
- %rmask.0.1 = phi i32 [ %rmask.0.0, %cond_true145 ], [ undef, %cond_true117 ], [ %tmp1295, %cond_false123 ], [ %rmask.0.0, %cond_true135 ] ; <i32> [#uses=4]
- %mask.1.1 = phi i32 [ %mask.1.0, %cond_true145 ], [ %tmp122, %cond_true117 ], [ %tmp113464, %cond_false123 ], [ %mask.1.0, %cond_true135 ] ; <i32> [#uses=4]
- %one_addr.0 = phi i32 [ %tmp147, %cond_true145 ], [ %one, %cond_true117 ], [ %one, %cond_false123 ], [ %one, %cond_true135 ] ; <i32> [#uses=2]
- %zero_addr.1 = phi i32 [ %zero_addr.0, %cond_true145 ], [ %zero, %cond_true117 ], [ %zero, %cond_false123 ], [ %zero_addr.0, %cond_true135 ] ; <i32> [#uses=2]
- %tmp153 = icmp eq i32 %zero_addr.1, 1 ; <i1> [#uses=2]
- %tmp158 = icmp eq i32 %one_addr.0, 0 ; <i1> [#uses=2]
- %bothcond2 = or i1 %tmp153, %tmp158 ; <i1> [#uses=1]
- %iftmp.35.0 = select i1 %bothcond2, i32 -1, i32 0 ; <i32> [#uses=9]
- %tmp167 = icmp eq i32 %zero_addr.1, 0 ; <i1> [#uses=1]
- %bothcond3 = or i1 %tmp167, %tmp158 ; <i1> [#uses=1]
- %iftmp.36.0 = select i1 %bothcond3, i32 0, i32 -1 ; <i32> [#uses=4]
- %tmp186 = icmp eq i32 %one_addr.0, 1 ; <i1> [#uses=1]
- %bothcond4 = or i1 %tmp153, %tmp186 ; <i1> [#uses=1]
- %iftmp.37.0 = select i1 %bothcond4, i32 -1, i32 0 ; <i32> [#uses=6]
- %tmp196 = icmp eq i32 %tmp107, %tmp110 ; <i1> [#uses=1]
- br i1 %tmp196, label %cond_true197, label %cond_false299
-
-cond_true197: ; preds = %cond_next151
- %tmp29222 = add i32 %h, -1 ; <i32> [#uses=3]
- %tmp29424 = icmp slt i32 %tmp29222, 0 ; <i1> [#uses=1]
- br i1 %tmp29424, label %return, label %cond_true295.preheader
-
-cond_true249.preheader: ; preds = %cond_true295
- br label %cond_true249
-
-cond_true249: ; preds = %cond_true249, %cond_true249.preheader
- %indvar = phi i32 [ 0, %cond_true249.preheader ], [ %indvar.next, %cond_true249 ] ; <i32> [#uses=3]
- %optr.3.2 = phi i8* [ %tmp232.upgrd.12, %cond_true249 ], [ %dest.1.0, %cond_true249.preheader ] ; <i8*> [#uses=1]
- %bptr.3.2 = phi i8* [ %tmp226.upgrd.10, %cond_true249 ], [ %line.1.0, %cond_true249.preheader ] ; <i8*> [#uses=1]
- %tmp. = add i32 %tmp109, %w ; <i32> [#uses=1]
- %tmp.58 = mul i32 %indvar, -8 ; <i32> [#uses=1]
- %tmp.57 = add i32 %tmp., -16 ; <i32> [#uses=1]
- %tmp246.2 = add i32 %tmp.58, %tmp.57 ; <i32> [#uses=1]
- %tmp225 = ptrtoint i8* %bptr.3.2 to i32 ; <i32> [#uses=1]
- %tmp226 = add i32 %tmp225, 1 ; <i32> [#uses=1]
- %tmp226.upgrd.10 = inttoptr i32 %tmp226 to i8* ; <i8*> [#uses=3]
- %tmp228 = load i8* %tmp226.upgrd.10 ; <i8> [#uses=1]
- %tmp228.upgrd.11 = zext i8 %tmp228 to i32 ; <i32> [#uses=1]
- %tmp230 = xor i32 %tmp228.upgrd.11, %iftmp.35.0 ; <i32> [#uses=2]
- %tmp231 = ptrtoint i8* %optr.3.2 to i32 ; <i32> [#uses=1]
- %tmp232 = add i32 %tmp231, 1 ; <i32> [#uses=1]
- %tmp232.upgrd.12 = inttoptr i32 %tmp232 to i8* ; <i8*> [#uses=4]
- %tmp235 = or i32 %tmp230, %iftmp.36.0 ; <i32> [#uses=1]
- %tmp235.upgrd.13 = trunc i32 %tmp235 to i8 ; <i8> [#uses=1]
- %tmp237 = load i8* %tmp232.upgrd.12 ; <i8> [#uses=1]
- %tmp238 = and i8 %tmp235.upgrd.13, %tmp237 ; <i8> [#uses=1]
- %tmp241 = and i32 %tmp230, %iftmp.37.0 ; <i32> [#uses=1]
- %tmp241.upgrd.14 = trunc i32 %tmp241 to i8 ; <i8> [#uses=1]
- %tmp242 = or i8 %tmp238, %tmp241.upgrd.14 ; <i8> [#uses=1]
- store i8 %tmp242, i8* %tmp232.upgrd.12
- %tmp24629 = add i32 %tmp246.2, -8 ; <i32> [#uses=2]
- %tmp24831 = icmp slt i32 %tmp24629, 0 ; <i1> [#uses=1]
- %indvar.next = add i32 %indvar, 1 ; <i32> [#uses=1]
- br i1 %tmp24831, label %bb252.loopexit, label %cond_true249
-
-bb252.loopexit: ; preds = %cond_true249
- br label %bb252
-
-bb252: ; preds = %cond_true295, %bb252.loopexit
- %optr.3.3 = phi i8* [ %dest.1.0, %cond_true295 ], [ %tmp232.upgrd.12, %bb252.loopexit ] ; <i8*> [#uses=1]
- %bptr.3.3 = phi i8* [ %line.1.0, %cond_true295 ], [ %tmp226.upgrd.10, %bb252.loopexit ] ; <i8*> [#uses=1]
- %tmp246.3 = phi i32 [ %tmp246, %cond_true295 ], [ %tmp24629, %bb252.loopexit ] ; <i32> [#uses=1]
- %tmp254 = icmp sgt i32 %tmp246.3, -8 ; <i1> [#uses=1]
- br i1 %tmp254, label %cond_true255, label %cond_next280
-
-cond_true255: ; preds = %bb252
- %tmp256 = ptrtoint i8* %bptr.3.3 to i32 ; <i32> [#uses=1]
- %tmp257 = add i32 %tmp256, 1 ; <i32> [#uses=1]
- %tmp257.upgrd.15 = inttoptr i32 %tmp257 to i8* ; <i8*> [#uses=1]
- %tmp259 = load i8* %tmp257.upgrd.15 ; <i8> [#uses=1]
- %tmp259.upgrd.16 = zext i8 %tmp259 to i32 ; <i32> [#uses=1]
- %tmp261 = xor i32 %tmp259.upgrd.16, %iftmp.35.0 ; <i32> [#uses=2]
- %tmp262 = ptrtoint i8* %optr.3.3 to i32 ; <i32> [#uses=1]
- %tmp263 = add i32 %tmp262, 1 ; <i32> [#uses=1]
- %tmp263.upgrd.17 = inttoptr i32 %tmp263 to i8* ; <i8*> [#uses=2]
- %tmp265 = trunc i32 %tmp261 to i8 ; <i8> [#uses=1]
- %tmp268 = or i8 %tmp266, %tmp265 ; <i8> [#uses=1]
- %tmp270 = load i8* %tmp263.upgrd.17 ; <i8> [#uses=1]
- %tmp271 = and i8 %tmp268, %tmp270 ; <i8> [#uses=1]
- %tmp276 = and i32 %tmp274, %tmp261 ; <i32> [#uses=1]
- %tmp276.upgrd.18 = trunc i32 %tmp276 to i8 ; <i8> [#uses=1]
- %tmp277 = or i8 %tmp271, %tmp276.upgrd.18 ; <i8> [#uses=1]
- store i8 %tmp277, i8* %tmp263.upgrd.17
- br label %cond_next280
-
-cond_next280: ; preds = %cond_true255, %bb252
- %tmp281 = ptrtoint i8** %dest_line.1.0 to i32 ; <i32> [#uses=1]
- %tmp282 = add i32 %tmp281, 4 ; <i32> [#uses=1]
- %tmp282.upgrd.19 = inttoptr i32 %tmp282 to i8** ; <i8**> [#uses=2]
- %tmp284 = load i8** %tmp282.upgrd.19 ; <i8*> [#uses=1]
- %tmp286 = getelementptr i8* %tmp284, i32 %tmp93 ; <i8*> [#uses=1]
- %tmp292 = add i32 %tmp292.0, -1 ; <i32> [#uses=1]
- %tmp294 = icmp slt i32 %tmp292, 0 ; <i1> [#uses=1]
- %indvar.next61 = add i32 %indvar60, 1 ; <i32> [#uses=1]
- br i1 %tmp294, label %return.loopexit, label %cond_true295
-
-cond_true295.preheader: ; preds = %cond_true197
- %tmp200 = sub i32 %w, %tmp110 ; <i32> [#uses=1]
- %tmp209 = trunc i32 %mask.1.1 to i8 ; <i8> [#uses=1]
- %tmp209not = xor i8 %tmp209, -1 ; <i8> [#uses=1]
- %tmp212 = trunc i32 %iftmp.36.0 to i8 ; <i8> [#uses=2]
- %tmp211 = or i8 %tmp212, %tmp209not ; <i8> [#uses=2]
- %tmp219 = and i32 %iftmp.37.0, %mask.1.1 ; <i32> [#uses=2]
- %tmp246 = add i32 %tmp200, -8 ; <i32> [#uses=3]
- %tmp248 = icmp slt i32 %tmp246, 0 ; <i1> [#uses=1]
- %tmp264 = trunc i32 %rmask.0.1 to i8 ; <i8> [#uses=1]
- %tmp264not = xor i8 %tmp264, -1 ; <i8> [#uses=1]
- %tmp266 = or i8 %tmp212, %tmp264not ; <i8> [#uses=2]
- %tmp274 = and i32 %iftmp.37.0, %rmask.0.1 ; <i32> [#uses=2]
- br i1 %tmp248, label %cond_true295.preheader.split.us, label %cond_true295.preheader.split
-
-cond_true295.preheader.split.us: ; preds = %cond_true295.preheader
- br label %cond_true295.us
-
-cond_true295.us: ; preds = %cond_next280.us, %cond_true295.preheader.split.us
- %indvar86 = phi i32 [ 0, %cond_true295.preheader.split.us ], [ %indvar.next87, %cond_next280.us ] ; <i32> [#uses=3]
- %dest.1.0.us = phi i8* [ %tmp286.us, %cond_next280.us ], [ %tmp100, %cond_true295.preheader.split.us ] ; <i8*> [#uses=3]
- %dest_line.1.0.us = phi i8** [ %tmp282.us.upgrd.21, %cond_next280.us ], [ %tmp96, %cond_true295.preheader.split.us ] ; <i8**> [#uses=1]
- %tmp.89 = sub i32 0, %indvar86 ; <i32> [#uses=2]
- %tmp292.0.us = add i32 %tmp.89, %tmp29222 ; <i32> [#uses=1]
- %tmp.91 = mul i32 %indvar86, %raster ; <i32> [#uses=2]
- %tmp104.sum101 = add i32 %tmp102, %tmp.91 ; <i32> [#uses=1]
- %line.1.0.us = getelementptr i8* %base, i32 %tmp104.sum101 ; <i8*> [#uses=2]
- %tmp.us = load i8* %line.1.0.us ; <i8> [#uses=1]
- %tmp206.us = zext i8 %tmp.us to i32 ; <i32> [#uses=1]
- %tmp208.us = xor i32 %tmp206.us, %iftmp.35.0 ; <i32> [#uses=2]
- %tmp210.us = trunc i32 %tmp208.us to i8 ; <i8> [#uses=1]
- %tmp213.us = or i8 %tmp211, %tmp210.us ; <i8> [#uses=1]
- %tmp215.us = load i8* %dest.1.0.us ; <i8> [#uses=1]
- %tmp216.us = and i8 %tmp213.us, %tmp215.us ; <i8> [#uses=1]
- %tmp221.us = and i32 %tmp219, %tmp208.us ; <i32> [#uses=1]
- %tmp221.us.upgrd.20 = trunc i32 %tmp221.us to i8 ; <i8> [#uses=1]
- %tmp222.us = or i8 %tmp216.us, %tmp221.us.upgrd.20 ; <i8> [#uses=1]
- store i8 %tmp222.us, i8* %dest.1.0.us
- br i1 true, label %bb252.us, label %cond_true249.preheader.us
-
-cond_next280.us: ; preds = %bb252.us, %cond_true255.us
- %tmp281.us = ptrtoint i8** %dest_line.1.0.us to i32 ; <i32> [#uses=1]
- %tmp282.us = add i32 %tmp281.us, 4 ; <i32> [#uses=1]
- %tmp282.us.upgrd.21 = inttoptr i32 %tmp282.us to i8** ; <i8**> [#uses=2]
- %tmp284.us = load i8** %tmp282.us.upgrd.21 ; <i8*> [#uses=1]
- %tmp286.us = getelementptr i8* %tmp284.us, i32 %tmp93 ; <i8*> [#uses=1]
- %tmp292.us = add i32 %tmp292.0.us, -1 ; <i32> [#uses=1]
- %tmp294.us = icmp slt i32 %tmp292.us, 0 ; <i1> [#uses=1]
- %indvar.next87 = add i32 %indvar86, 1 ; <i32> [#uses=1]
- br i1 %tmp294.us, label %return.loopexit.us, label %cond_true295.us
-
-cond_true255.us: ; preds = %bb252.us
- %tmp256.us = ptrtoint i8* %bptr.3.3.us to i32 ; <i32> [#uses=1]
- %tmp257.us = add i32 %tmp256.us, 1 ; <i32> [#uses=1]
- %tmp257.us.upgrd.22 = inttoptr i32 %tmp257.us to i8* ; <i8*> [#uses=1]
- %tmp259.us = load i8* %tmp257.us.upgrd.22 ; <i8> [#uses=1]
- %tmp259.us.upgrd.23 = zext i8 %tmp259.us to i32 ; <i32> [#uses=1]
- %tmp261.us = xor i32 %tmp259.us.upgrd.23, %iftmp.35.0 ; <i32> [#uses=2]
- %tmp262.us = ptrtoint i8* %optr.3.3.us to i32 ; <i32> [#uses=1]
- %tmp263.us = add i32 %tmp262.us, 1 ; <i32> [#uses=1]
- %tmp263.us.upgrd.24 = inttoptr i32 %tmp263.us to i8* ; <i8*> [#uses=2]
- %tmp265.us = trunc i32 %tmp261.us to i8 ; <i8> [#uses=1]
- %tmp268.us = or i8 %tmp266, %tmp265.us ; <i8> [#uses=1]
- %tmp270.us = load i8* %tmp263.us.upgrd.24 ; <i8> [#uses=1]
- %tmp271.us = and i8 %tmp268.us, %tmp270.us ; <i8> [#uses=1]
- %tmp276.us = and i32 %tmp274, %tmp261.us ; <i32> [#uses=1]
- %tmp276.us.upgrd.25 = trunc i32 %tmp276.us to i8 ; <i8> [#uses=1]
- %tmp277.us = or i8 %tmp271.us, %tmp276.us.upgrd.25 ; <i8> [#uses=1]
- store i8 %tmp277.us, i8* %tmp263.us.upgrd.24
- br label %cond_next280.us
-
-bb252.us: ; preds = %bb252.loopexit.us, %cond_true295.us
- %optr.3.3.us = phi i8* [ %dest.1.0.us, %cond_true295.us ], [ undef, %bb252.loopexit.us ] ; <i8*> [#uses=1]
- %bptr.3.3.us = phi i8* [ %line.1.0.us, %cond_true295.us ], [ undef, %bb252.loopexit.us ] ; <i8*> [#uses=1]
- %tmp246.3.us = phi i32 [ %tmp246, %cond_true295.us ], [ undef, %bb252.loopexit.us ] ; <i32> [#uses=1]
- %tmp254.us = icmp sgt i32 %tmp246.3.us, -8 ; <i1> [#uses=1]
- br i1 %tmp254.us, label %cond_true255.us, label %cond_next280.us
-
-cond_true249.us: ; preds = %cond_true249.preheader.us, %cond_true249.us
- br i1 undef, label %bb252.loopexit.us, label %cond_true249.us
-
-cond_true249.preheader.us: ; preds = %cond_true295.us
- br label %cond_true249.us
-
-bb252.loopexit.us: ; preds = %cond_true249.us
- br label %bb252.us
-
-return.loopexit.us: ; preds = %cond_next280.us
- br label %return.loopexit.split
-
-cond_true295.preheader.split: ; preds = %cond_true295.preheader
- br label %cond_true295
-
-cond_true295: ; preds = %cond_true295.preheader.split, %cond_next280
- %indvar60 = phi i32 [ 0, %cond_true295.preheader.split ], [ %indvar.next61, %cond_next280 ] ; <i32> [#uses=3]
- %dest.1.0 = phi i8* [ %tmp286, %cond_next280 ], [ %tmp100, %cond_true295.preheader.split ] ; <i8*> [#uses=4]
- %dest_line.1.0 = phi i8** [ %tmp282.upgrd.19, %cond_next280 ], [ %tmp96, %cond_true295.preheader.split ] ; <i8**> [#uses=1]
- %tmp.63 = sub i32 0, %indvar60 ; <i32> [#uses=2]
- %tmp292.0 = add i32 %tmp.63, %tmp29222 ; <i32> [#uses=1]
- %tmp.65 = mul i32 %indvar60, %raster ; <i32> [#uses=2]
- %tmp104.sum97 = add i32 %tmp102, %tmp.65 ; <i32> [#uses=1]
- %line.1.0 = getelementptr i8* %base, i32 %tmp104.sum97 ; <i8*> [#uses=3]
- %tmp.upgrd.26 = load i8* %line.1.0 ; <i8> [#uses=1]
- %tmp206 = zext i8 %tmp.upgrd.26 to i32 ; <i32> [#uses=1]
- %tmp208 = xor i32 %tmp206, %iftmp.35.0 ; <i32> [#uses=2]
- %tmp210 = trunc i32 %tmp208 to i8 ; <i8> [#uses=1]
- %tmp213 = or i8 %tmp211, %tmp210 ; <i8> [#uses=1]
- %tmp215 = load i8* %dest.1.0 ; <i8> [#uses=1]
- %tmp216 = and i8 %tmp213, %tmp215 ; <i8> [#uses=1]
- %tmp221 = and i32 %tmp219, %tmp208 ; <i32> [#uses=1]
- %tmp221.upgrd.27 = trunc i32 %tmp221 to i8 ; <i8> [#uses=1]
- %tmp222 = or i8 %tmp216, %tmp221.upgrd.27 ; <i8> [#uses=1]
- store i8 %tmp222, i8* %dest.1.0
- br i1 false, label %bb252, label %cond_true249.preheader
-
-cond_false299: ; preds = %cond_next151
- %tmp302 = sub i32 %tmp107, %tmp110 ; <i32> [#uses=1]
- %tmp303 = and i32 %tmp302, 7 ; <i32> [#uses=3]
- %tmp305 = sub i32 8, %tmp303 ; <i32> [#uses=1]
- %tmp45438 = add i32 %h, -1 ; <i32> [#uses=2]
- %tmp45640 = icmp slt i32 %tmp45438, 0 ; <i1> [#uses=1]
- br i1 %tmp45640, label %return, label %cond_true457.preheader
-
-cond_true316: ; preds = %cond_true457
- %tmp318 = zext i8 %tmp318.upgrd.48 to i32 ; <i32> [#uses=1]
- %shift.upgrd.28 = zext i8 %tmp319 to i32 ; <i32> [#uses=1]
- %tmp320 = lshr i32 %tmp318, %shift.upgrd.28 ; <i32> [#uses=1]
- br label %cond_next340
-
-cond_false321: ; preds = %cond_true457
- %tmp3188 = zext i8 %tmp318.upgrd.48 to i32 ; <i32> [#uses=1]
- %shift.upgrd.29 = zext i8 %tmp324 to i32 ; <i32> [#uses=1]
- %tmp325 = shl i32 %tmp3188, %shift.upgrd.29 ; <i32> [#uses=2]
- %tmp326 = ptrtoint i8* %line.3.0 to i32 ; <i32> [#uses=1]
- %tmp327 = add i32 %tmp326, 1 ; <i32> [#uses=1]
- %tmp327.upgrd.30 = inttoptr i32 %tmp327 to i8* ; <i8*> [#uses=3]
- br i1 %tmp330, label %cond_true331, label %cond_next340
-
-cond_true331: ; preds = %cond_false321
- %tmp333 = load i8* %tmp327.upgrd.30 ; <i8> [#uses=1]
- %tmp333.upgrd.31 = zext i8 %tmp333 to i32 ; <i32> [#uses=1]
- %shift.upgrd.32 = zext i8 %tmp319 to i32 ; <i32> [#uses=1]
- %tmp335 = lshr i32 %tmp333.upgrd.31, %shift.upgrd.32 ; <i32> [#uses=1]
- %tmp337 = add i32 %tmp335, %tmp325 ; <i32> [#uses=1]
- br label %cond_next340
-
-cond_next340: ; preds = %cond_true331, %cond_false321, %cond_true316
- %bits.0 = phi i32 [ %tmp320, %cond_true316 ], [ %tmp337, %cond_true331 ], [ %tmp325, %cond_false321 ] ; <i32> [#uses=1]
- %bptr307.3 = phi i8* [ %line.3.0, %cond_true316 ], [ %tmp327.upgrd.30, %cond_true331 ], [ %tmp327.upgrd.30, %cond_false321 ] ; <i8*> [#uses=2]
- %tmp343 = xor i32 %bits.0, %iftmp.35.0 ; <i32> [#uses=2]
- %tmp345 = trunc i32 %tmp343 to i8 ; <i8> [#uses=1]
- %tmp348 = or i8 %tmp346, %tmp345 ; <i8> [#uses=1]
- %tmp350 = load i8* %dest.3.0 ; <i8> [#uses=1]
- %tmp351 = and i8 %tmp348, %tmp350 ; <i8> [#uses=1]
- %tmp356 = and i32 %tmp354, %tmp343 ; <i32> [#uses=1]
- %tmp356.upgrd.33 = trunc i32 %tmp356 to i8 ; <i8> [#uses=1]
- %tmp357 = or i8 %tmp351, %tmp356.upgrd.33 ; <i8> [#uses=1]
- store i8 %tmp357, i8* %dest.3.0
- %tmp362 = ptrtoint i8* %dest.3.0 to i32 ; <i32> [#uses=1]
- %optr309.3.in51 = add i32 %tmp362, 1 ; <i32> [#uses=2]
- %optr309.353 = inttoptr i32 %optr309.3.in51 to i8* ; <i8*> [#uses=2]
- br i1 %tmp39755, label %cond_true398.preheader, label %bb401
-
-cond_true398.preheader: ; preds = %cond_next340
- br label %cond_true398
-
-cond_true398: ; preds = %cond_true398, %cond_true398.preheader
- %indvar66 = phi i32 [ 0, %cond_true398.preheader ], [ %indvar.next67, %cond_true398 ] ; <i32> [#uses=4]
- %bptr307.4.0 = phi i8* [ %tmp370.upgrd.35, %cond_true398 ], [ %bptr307.3, %cond_true398.preheader ] ; <i8*> [#uses=2]
- %optr309.3.0 = phi i8* [ %optr309.3, %cond_true398 ], [ %optr309.353, %cond_true398.preheader ] ; <i8*> [#uses=2]
- %optr309.3.in.0 = add i32 %indvar66, %optr309.3.in51 ; <i32> [#uses=1]
- %tmp.70 = add i32 %tmp109, %w ; <i32> [#uses=1]
- %tmp.72 = mul i32 %indvar66, -8 ; <i32> [#uses=1]
- %tmp.71 = add i32 %tmp.70, -8 ; <i32> [#uses=1]
- %count308.3.0 = add i32 %tmp.72, %tmp.71 ; <i32> [#uses=1]
- %tmp366 = load i8* %bptr307.4.0 ; <i8> [#uses=1]
- %tmp366.upgrd.34 = zext i8 %tmp366 to i32 ; <i32> [#uses=1]
- %tmp369 = ptrtoint i8* %bptr307.4.0 to i32 ; <i32> [#uses=1]
- %tmp370 = add i32 %tmp369, 1 ; <i32> [#uses=1]
- %tmp370.upgrd.35 = inttoptr i32 %tmp370 to i8* ; <i8*> [#uses=3]
- %tmp372 = load i8* %tmp370.upgrd.35 ; <i8> [#uses=1]
- %tmp372.upgrd.36 = zext i8 %tmp372 to i32 ; <i32> [#uses=1]
- %shift.upgrd.37 = zext i8 %tmp319 to i32 ; <i32> [#uses=1]
- %tmp374463 = lshr i32 %tmp372.upgrd.36, %shift.upgrd.37 ; <i32> [#uses=1]
- %shift.upgrd.38 = zext i8 %tmp324 to i32 ; <i32> [#uses=1]
- %tmp368 = shl i32 %tmp366.upgrd.34, %shift.upgrd.38 ; <i32> [#uses=1]
- %tmp377 = add i32 %tmp374463, %tmp368 ; <i32> [#uses=1]
- %tmp379 = xor i32 %tmp377, %iftmp.35.0 ; <i32> [#uses=2]
- %tmp382 = or i32 %tmp379, %iftmp.36.0 ; <i32> [#uses=1]
- %tmp382.upgrd.39 = trunc i32 %tmp382 to i8 ; <i8> [#uses=1]
- %tmp384 = load i8* %optr309.3.0 ; <i8> [#uses=1]
- %tmp385 = and i8 %tmp382.upgrd.39, %tmp384 ; <i8> [#uses=1]
- %tmp388 = and i32 %tmp379, %iftmp.37.0 ; <i32> [#uses=1]
- %tmp388.upgrd.40 = trunc i32 %tmp388 to i8 ; <i8> [#uses=1]
- %tmp389 = or i8 %tmp385, %tmp388.upgrd.40 ; <i8> [#uses=1]
- store i8 %tmp389, i8* %optr309.3.0
- %tmp392 = add i32 %count308.3.0, -8 ; <i32> [#uses=2]
- %optr309.3.in = add i32 %optr309.3.in.0, 1 ; <i32> [#uses=1]
- %optr309.3 = inttoptr i32 %optr309.3.in to i8* ; <i8*> [#uses=2]
- %tmp397 = icmp sgt i32 %tmp392, 7 ; <i1> [#uses=1]
- %indvar.next67 = add i32 %indvar66, 1 ; <i32> [#uses=1]
- br i1 %tmp397, label %cond_true398, label %bb401.loopexit
-
-bb401.loopexit: ; preds = %cond_true398
- br label %bb401
-
-bb401: ; preds = %bb401.loopexit, %cond_next340
- %count308.3.1 = phi i32 [ %tmp361, %cond_next340 ], [ %tmp392, %bb401.loopexit ] ; <i32> [#uses=2]
- %bptr307.4.1 = phi i8* [ %bptr307.3, %cond_next340 ], [ %tmp370.upgrd.35, %bb401.loopexit ] ; <i8*> [#uses=2]
- %optr309.3.1 = phi i8* [ %optr309.353, %cond_next340 ], [ %optr309.3, %bb401.loopexit ] ; <i8*> [#uses=2]
- %tmp403 = icmp sgt i32 %count308.3.1, 0 ; <i1> [#uses=1]
- br i1 %tmp403, label %cond_true404, label %cond_next442
-
-cond_true404: ; preds = %bb401
- %tmp406 = load i8* %bptr307.4.1 ; <i8> [#uses=1]
- %tmp406.upgrd.41 = zext i8 %tmp406 to i32 ; <i32> [#uses=1]
- %shift.upgrd.42 = zext i8 %tmp324 to i32 ; <i32> [#uses=1]
- %tmp408 = shl i32 %tmp406.upgrd.41, %shift.upgrd.42 ; <i32> [#uses=2]
- %tmp413 = icmp sgt i32 %count308.3.1, %tmp303 ; <i1> [#uses=1]
- br i1 %tmp413, label %cond_true414, label %cond_next422
-
-cond_true414: ; preds = %cond_true404
- %tmp409 = ptrtoint i8* %bptr307.4.1 to i32 ; <i32> [#uses=1]
- %tmp410 = add i32 %tmp409, 1 ; <i32> [#uses=1]
- %tmp410.upgrd.43 = inttoptr i32 %tmp410 to i8* ; <i8*> [#uses=1]
- %tmp416 = load i8* %tmp410.upgrd.43 ; <i8> [#uses=1]
- %tmp416.upgrd.44 = zext i8 %tmp416 to i32 ; <i32> [#uses=1]
- %shift.upgrd.45 = zext i8 %tmp319 to i32 ; <i32> [#uses=1]
- %tmp418 = lshr i32 %tmp416.upgrd.44, %shift.upgrd.45 ; <i32> [#uses=2]
- %tmp420 = add i32 %tmp418, %tmp408 ; <i32> [#uses=1]
- br label %cond_next422
-
-cond_next422: ; preds = %cond_true414, %cond_true404
- %bits.6 = phi i32 [ %tmp420, %cond_true414 ], [ %tmp408, %cond_true404 ] ; <i32> [#uses=1]
- %tmp425 = xor i32 %bits.6, %iftmp.35.0 ; <i32> [#uses=1]
- %tmp427 = trunc i32 %tmp425 to i8 ; <i8> [#uses=2]
- %tmp430 = or i8 %tmp428, %tmp427 ; <i8> [#uses=1]
- %tmp432 = load i8* %optr309.3.1 ; <i8> [#uses=1]
- %tmp433 = and i8 %tmp430, %tmp432 ; <i8> [#uses=1]
- %tmp438 = and i8 %tmp436.upgrd.47, %tmp427 ; <i8> [#uses=1]
- %tmp439 = or i8 %tmp433, %tmp438 ; <i8> [#uses=1]
- store i8 %tmp439, i8* %optr309.3.1
- br label %cond_next442
-
-cond_next442: ; preds = %cond_next422, %bb401
- %tmp443 = ptrtoint i8** %dest_line.3.0 to i32 ; <i32> [#uses=1]
- %tmp444 = add i32 %tmp443, 4 ; <i32> [#uses=1]
- %tmp444.upgrd.46 = inttoptr i32 %tmp444 to i8** ; <i8**> [#uses=2]
- %tmp446 = load i8** %tmp444.upgrd.46 ; <i8*> [#uses=1]
- %tmp448 = getelementptr i8* %tmp446, i32 %tmp93 ; <i8*> [#uses=1]
- %tmp454 = add i32 %tmp454.0, -1 ; <i32> [#uses=1]
- %tmp456 = icmp slt i32 %tmp454, 0 ; <i1> [#uses=1]
- %indvar.next75 = add i32 %indvar74, 1 ; <i32> [#uses=1]
- br i1 %tmp456, label %return.loopexit56, label %cond_true457
-
-cond_true457.preheader: ; preds = %cond_false299
- %tmp315 = icmp slt i32 %tmp107, %tmp110 ; <i1> [#uses=1]
- %tmp319 = trunc i32 %tmp303 to i8 ; <i8> [#uses=4]
- %tmp324 = trunc i32 %tmp305 to i8 ; <i8> [#uses=3]
- %tmp330 = icmp slt i32 %tmp107, %w ; <i1> [#uses=1]
- %tmp344 = trunc i32 %mask.1.1 to i8 ; <i8> [#uses=1]
- %tmp344not = xor i8 %tmp344, -1 ; <i8> [#uses=1]
- %tmp347 = trunc i32 %iftmp.36.0 to i8 ; <i8> [#uses=2]
- %tmp346 = or i8 %tmp347, %tmp344not ; <i8> [#uses=1]
- %tmp354 = and i32 %iftmp.37.0, %mask.1.1 ; <i32> [#uses=1]
- %tmp361 = sub i32 %w, %tmp110 ; <i32> [#uses=2]
- %tmp39755 = icmp sgt i32 %tmp361, 7 ; <i1> [#uses=1]
- %tmp426 = trunc i32 %rmask.0.1 to i8 ; <i8> [#uses=1]
- %tmp426not = xor i8 %tmp426, -1 ; <i8> [#uses=1]
- %tmp428 = or i8 %tmp347, %tmp426not ; <i8> [#uses=1]
- %tmp436 = and i32 %iftmp.37.0, %rmask.0.1 ; <i32> [#uses=1]
- %tmp436.upgrd.47 = trunc i32 %tmp436 to i8 ; <i8> [#uses=1]
- br label %cond_true457
-
-cond_true457: ; preds = %cond_true457.preheader, %cond_next442
- %indvar74 = phi i32 [ 0, %cond_true457.preheader ], [ %indvar.next75, %cond_next442 ] ; <i32> [#uses=3]
- %dest.3.0 = phi i8* [ %tmp448, %cond_next442 ], [ %tmp100, %cond_true457.preheader ] ; <i8*> [#uses=3]
- %dest_line.3.0 = phi i8** [ %tmp444.upgrd.46, %cond_next442 ], [ %tmp96, %cond_true457.preheader ] ; <i8**> [#uses=1]
- %tmp.77 = sub i32 0, %indvar74 ; <i32> [#uses=2]
- %tmp454.0 = add i32 %tmp.77, %tmp45438 ; <i32> [#uses=1]
- %tmp.79 = mul i32 %indvar74, %raster ; <i32> [#uses=2]
- %tmp104.sum = add i32 %tmp102, %tmp.79 ; <i32> [#uses=1]
- %line.3.0 = getelementptr i8* %base, i32 %tmp104.sum ; <i8*> [#uses=3]
- %tmp318.upgrd.48 = load i8* %line.3.0 ; <i8> [#uses=2]
- br i1 %tmp315, label %cond_false321, label %cond_true316
-
-return.loopexit: ; preds = %cond_next280
- br label %return.loopexit.split
-
-return.loopexit.split: ; preds = %return.loopexit, %return.loopexit.us
- br label %return
-
-return.loopexit56: ; preds = %cond_next442
- br label %return
-
-return: ; preds = %return.loopexit56, %return.loopexit.split, %cond_false299, %cond_true197, %cond_next78, %cond_next63, %bb58, %cond_next46
- %retval.0 = phi i32 [ 0, %cond_next46 ], [ -1, %bb58 ], [ -1, %cond_next63 ], [ -1, %cond_next78 ], [ 0, %cond_true197 ], [ 0, %cond_false299 ], [ 0, %return.loopexit.split ], [ 0, %return.loopexit56 ] ; <i32> [#uses=1]
- ret i32 %retval.0
-}
-
-declare i32 @mem_no_fault_proc(%struct.gx_device_memory*, i32, i32, i32, i32, i32)
-
-declare i32 @mem_mono_fill_rectangle(%struct.gx_device*, i32, i32, i32, i32, i32)
-
-declare i32 @mem_copy_mono_recover(%struct.gx_device*, i8*, i32, i32, i32, i32, i32, i32, i32, i32, i32)
diff --git a/release_23/test/Transforms/InstCombine/2006-06-28-infloop.ll b/release_23/test/Transforms/InstCombine/2006-06-28-infloop.ll
deleted file mode 100644
index 84e751037b4d..000000000000
--- a/release_23/test/Transforms/InstCombine/2006-06-28-infloop.ll
+++ /dev/null
@@ -1,20 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine -disable-output
-
-target datalayout = "E-p:32:32"
-target triple = "powerpc-apple-darwin8"
-
-define void @test() {
-entry:
- %tmp = getelementptr { i64, i64, i64, i64 }* null, i32 0, i32 3 ; <i64*> [#uses=1]
- %tmp.upgrd.1 = load i64* %tmp ; <i64> [#uses=1]
- %tmp8.ui = load i64* null ; <i64> [#uses=1]
- %tmp8 = bitcast i64 %tmp8.ui to i64 ; <i64> [#uses=1]
- %tmp9 = and i64 %tmp8, %tmp.upgrd.1 ; <i64> [#uses=1]
- %sext = trunc i64 %tmp9 to i32 ; <i32> [#uses=1]
- %tmp27.i = sext i32 %sext to i64 ; <i64> [#uses=1]
- tail call void @foo( i32 0, i64 %tmp27.i )
- unreachable
-}
-
-declare void @foo(i32, i64)
-
diff --git a/release_23/test/Transforms/InstCombine/2006-09-11-EmptyStructCrash.ll b/release_23/test/Transforms/InstCombine/2006-09-11-EmptyStructCrash.ll
deleted file mode 100644
index bf9252a349ea..000000000000
--- a/release_23/test/Transforms/InstCombine/2006-09-11-EmptyStructCrash.ll
+++ /dev/null
@@ -1,46 +0,0 @@
-; PR905
-; RUN: llvm-as < %s | opt -instcombine -disable-output
-; END.
-
-%RPYTHON_EXCEPTION = type { %RPYTHON_EXCEPTION_VTABLE* }
-%RPYTHON_EXCEPTION_VTABLE = type { %RPYTHON_EXCEPTION_VTABLE*, i32, i32, %RPyOpaque_RuntimeTypeInfo*, %arraytype_Char*, %functiontype_12* }
-%RPyOpaque_RuntimeTypeInfo = type opaque*
-%arraytype_Char = type { i32, [0 x i8] }
-%fixarray_array1019 = type [1019 x i8*]
-%functiontype_12 = type %RPYTHON_EXCEPTION* ()
-%functiontype_14 = type void (%structtype_pypy.rpython.memory.gc.MarkSweepGC*)
-%structtype_AddressLinkedListChunk = type { %structtype_AddressLinkedListChunk*, i32, %fixarray_array1019 }
-%structtype_exceptions.Exception = type { %RPYTHON_EXCEPTION }
-%structtype_gc_pool = type { }
-%structtype_gc_pool_node = type { %structtype_header*, %structtype_gc_pool_node* }
-%structtype_header = type { i32, %structtype_header* }
-%structtype_pypy.rpython.memory.gc.MarkSweepGC = type { %structtype_exceptions.Exception, i32, i32, i1, %structtype_gc_pool*, i32, %structtype_header*, %structtype_header*, %structtype_gc_pool_node*, double, double }
-
-define fastcc void @pypy_MarkSweepGC.collect() {
-block0:
- %v1221 = load %structtype_AddressLinkedListChunk** null ; <%structtype_AddressLinkedListChunk*> [#uses=1]
- %v1222 = icmp ne %structtype_AddressLinkedListChunk* %v1221, null ; <i1> [#uses=1]
- br i1 %v1222, label %block79, label %block4
-
-block4: ; preds = %block0
- ret void
-
-block22: ; preds = %block79
- ret void
-
-block67: ; preds = %block79
- %v1459 = load %structtype_gc_pool** null ; <%structtype_gc_pool*> [#uses=1]
- %v1460 = bitcast %structtype_gc_pool* %v1459 to i8* ; <i8*> [#uses=1]
- %tmp_873 = ptrtoint i8* %v1460 to i32 ; <i32> [#uses=1]
- %tmp_874 = sub i32 %tmp_873, 0 ; <i32> [#uses=1]
- %v1461 = inttoptr i32 %tmp_874 to i8* ; <i8*> [#uses=1]
- %v1462 = bitcast i8* %v1461 to %structtype_header* ; <%structtype_header*> [#uses=1]
- %tmp_876 = getelementptr %structtype_header* %v1462, i32 0, i32 0 ; <i32*> [#uses=1]
- store i32 0, i32* %tmp_876
- ret void
-
-block79: ; preds = %block0
- %v1291 = load %structtype_gc_pool** null ; <%structtype_gc_pool*> [#uses=1]
- %v1292 = icmp ne %structtype_gc_pool* %v1291, null ; <i1> [#uses=1]
- br i1 %v1292, label %block67, label %block22
-}
diff --git a/release_23/test/Transforms/InstCombine/2006-09-15-CastToBool.ll b/release_23/test/Transforms/InstCombine/2006-09-15-CastToBool.ll
deleted file mode 100644
index 043b598c8966..000000000000
--- a/release_23/test/Transforms/InstCombine/2006-09-15-CastToBool.ll
+++ /dev/null
@@ -1,14 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep and
-; PR913
-
-define i32 @test(i32* %tmp1) {
- %tmp.i = load i32* %tmp1 ; <i32> [#uses=1]
- %tmp = bitcast i32 %tmp.i to i32 ; <i32> [#uses=1]
- %tmp2.ui = lshr i32 %tmp, 5 ; <i32> [#uses=1]
- %tmp2 = bitcast i32 %tmp2.ui to i32 ; <i32> [#uses=1]
- %tmp3 = and i32 %tmp2, 1 ; <i32> [#uses=1]
- %tmp3.upgrd.1 = icmp ne i32 %tmp3, 0 ; <i1> [#uses=1]
- %tmp34 = zext i1 %tmp3.upgrd.1 to i32 ; <i32> [#uses=1]
- ret i32 %tmp34
-}
-
diff --git a/release_23/test/Transforms/InstCombine/2006-10-19-SignedToUnsignedCastAndConst-2.ll b/release_23/test/Transforms/InstCombine/2006-10-19-SignedToUnsignedCastAndConst-2.ll
deleted file mode 100644
index eca315f6f8a9..000000000000
--- a/release_23/test/Transforms/InstCombine/2006-10-19-SignedToUnsignedCastAndConst-2.ll
+++ /dev/null
@@ -1,10 +0,0 @@
-; The optimizer should be able to remove cast operation here.
-; RUN: llvm-as < %s -o - | opt -instcombine | llvm-dis | \
-; RUN: not grep sext.*i32
-
-define i1 @eq_signed_to_small_unsigned(i8 %SB) {
- %Y = sext i8 %SB to i32 ; <i32> [#uses=1]
- %C = icmp eq i32 %Y, 17 ; <i1> [#uses=1]
- ret i1 %C
-}
-
diff --git a/release_23/test/Transforms/InstCombine/2006-10-19-SignedToUnsignedCastAndConst.ll b/release_23/test/Transforms/InstCombine/2006-10-19-SignedToUnsignedCastAndConst.ll
deleted file mode 100644
index 8678a85c4648..000000000000
--- a/release_23/test/Transforms/InstCombine/2006-10-19-SignedToUnsignedCastAndConst.ll
+++ /dev/null
@@ -1,12 +0,0 @@
-; This test case is reduced from llvmAsmParser.cpp
-; The optimizer should not remove the cast here.
-; RUN: llvm-as %s -o - | opt -instcombine | llvm-dis | \
-; RUN: grep sext.*i32
-
-
-define i1 @test(i16 %X) {
- %A = sext i16 %X to i32 ; <i32> [#uses=1]
- %B = icmp ugt i32 %A, 1330 ; <i1> [#uses=1]
- ret i1 %B
-}
-
diff --git a/release_23/test/Transforms/InstCombine/2006-10-20-mask.ll b/release_23/test/Transforms/InstCombine/2006-10-20-mask.ll
deleted file mode 100644
index a5864f1c1831..000000000000
--- a/release_23/test/Transforms/InstCombine/2006-10-20-mask.ll
+++ /dev/null
@@ -1,11 +0,0 @@
-; RUN: llvm-as %s -o - | opt -instcombine | llvm-dis | \
-; RUN: grep and
-
-define i64 @foo(i64 %tmp, i64 %tmp2) {
- %tmp.upgrd.1 = trunc i64 %tmp to i32 ; <i32> [#uses=1]
- %tmp2.upgrd.2 = trunc i64 %tmp2 to i32 ; <i32> [#uses=1]
- %tmp3 = and i32 %tmp.upgrd.1, %tmp2.upgrd.2 ; <i32> [#uses=1]
- %tmp4 = zext i32 %tmp3 to i64 ; <i64> [#uses=1]
- ret i64 %tmp4
-}
-
diff --git a/release_23/test/Transforms/InstCombine/2006-10-26-VectorReassoc.ll b/release_23/test/Transforms/InstCombine/2006-10-26-VectorReassoc.ll
deleted file mode 100644
index 5ad0af406d48..000000000000
--- a/release_23/test/Transforms/InstCombine/2006-10-26-VectorReassoc.ll
+++ /dev/null
@@ -1,9 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \
-; RUN: grep mul | count 2
-
-define <4 x float> @test(<4 x float> %V) {
- %Y = mul <4 x float> %V, < float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00 > ; <<4 x float>> [#uses=1]
- %Z = mul <4 x float> %Y, < float 1.000000e+00, float 2.000000e+05, float -3.000000e+00, float 4.000000e+00 > ; <<4 x float>> [#uses=1]
- ret <4 x float> %Z
-}
-
diff --git a/release_23/test/Transforms/InstCombine/2006-11-03-Memmove64.ll b/release_23/test/Transforms/InstCombine/2006-11-03-Memmove64.ll
deleted file mode 100644
index 23e805a9360c..000000000000
--- a/release_23/test/Transforms/InstCombine/2006-11-03-Memmove64.ll
+++ /dev/null
@@ -1,16 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \
-; RUN: not grep memmove.i32
-; Instcombine was trying to turn this into a memmove.i32
-
-target datalayout = "e-p:64:64"
-target triple = "alphaev67-unknown-linux-gnu"
-@str10 = internal constant [1 x i8] zeroinitializer ; <[1 x i8]*> [#uses=1]
-
-define void @do_join(i8* %b) {
-entry:
- call void @llvm.memmove.i64( i8* %b, i8* getelementptr ([1 x i8]* @str10, i32 0, i64 0), i64 1, i32 1 )
- ret void
-}
-
-declare void @llvm.memmove.i64(i8*, i8*, i64, i32)
-
diff --git a/release_23/test/Transforms/InstCombine/2006-11-10-ashr-miscompile.ll b/release_23/test/Transforms/InstCombine/2006-11-10-ashr-miscompile.ll
deleted file mode 100644
index 8c48d4357bca..000000000000
--- a/release_23/test/Transforms/InstCombine/2006-11-10-ashr-miscompile.ll
+++ /dev/null
@@ -1,9 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep lshr
-; Verify this is not turned into -1.
-
-define i32 @test(i8 %amt) {
- %shift.upgrd.1 = zext i8 %amt to i32 ; <i32> [#uses=1]
- %B = lshr i32 -1, %shift.upgrd.1 ; <i32> [#uses=1]
- ret i32 %B
-}
-
diff --git a/release_23/test/Transforms/InstCombine/2006-11-27-XorBug.ll b/release_23/test/Transforms/InstCombine/2006-11-27-XorBug.ll
deleted file mode 100644
index 631b43f61f9e..000000000000
--- a/release_23/test/Transforms/InstCombine/2006-11-27-XorBug.ll
+++ /dev/null
@@ -1,12 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep and.*32
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \
-; RUN: not grep or.*153
-; PR1014
-
-define i32 @test(i32 %tmp1) {
- %ovm = and i32 %tmp1, 32 ; <i32> [#uses=1]
- %ov3 = add i32 %ovm, 145 ; <i32> [#uses=1]
- %ov110 = xor i32 %ov3, 153 ; <i32> [#uses=1]
- ret i32 %ov110
-}
-
diff --git a/release_23/test/Transforms/InstCombine/2006-12-01-BadFPVectorXform.ll b/release_23/test/Transforms/InstCombine/2006-12-01-BadFPVectorXform.ll
deleted file mode 100644
index 60ee50327916..000000000000
--- a/release_23/test/Transforms/InstCombine/2006-12-01-BadFPVectorXform.ll
+++ /dev/null
@@ -1,9 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep sub
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep add
-
-define <4 x float> @test(<4 x float> %tmp26, <4 x float> %tmp53) {
- ; (X+Y)-Y != X for fp vectors.
- %tmp64 = add <4 x float> %tmp26, %tmp53 ; <<4 x float>> [#uses=1]
- %tmp75 = sub <4 x float> %tmp64, %tmp53 ; <<4 x float>> [#uses=1]
- ret <4 x float> %tmp75
-}
diff --git a/release_23/test/Transforms/InstCombine/2006-12-05-fp-to-int-ext.ll b/release_23/test/Transforms/InstCombine/2006-12-05-fp-to-int-ext.ll
deleted file mode 100644
index 2c3313efa2a8..000000000000
--- a/release_23/test/Transforms/InstCombine/2006-12-05-fp-to-int-ext.ll
+++ /dev/null
@@ -1,12 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep zext
-
-; Never merge these two conversions, even though it's possible: this is
-; significantly more expensive than the two conversions on some targets
-; and it causes libgcc to be compile __fixunsdfdi into a recursive
-; function.
-define i64 @test(double %D) {
- %A = fptoui double %D to i32 ; <i32> [#uses=1]
- %B = zext i32 %A to i64 ; <i64> [#uses=1]
- ret i64 %B
-}
-
diff --git a/release_23/test/Transforms/InstCombine/2006-12-08-ICmp-Combining.ll b/release_23/test/Transforms/InstCombine/2006-12-08-ICmp-Combining.ll
deleted file mode 100644
index ddfb88c7bfbb..000000000000
--- a/release_23/test/Transforms/InstCombine/2006-12-08-ICmp-Combining.ll
+++ /dev/null
@@ -1,18 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \
-; RUN: grep {%bothcond =}
-
-define i1 @Doit_bb(i32 %i.0) {
-bb:
- %tmp = icmp sgt i32 %i.0, 0 ; <i1> [#uses=1]
- %tmp.not = xor i1 %tmp, true ; <i1> [#uses=1]
- %tmp2 = icmp sgt i32 %i.0, 8 ; <i1> [#uses=1]
- %bothcond = or i1 %tmp.not, %tmp2 ; <i1> [#uses=1]
- br i1 %bothcond, label %exitTrue, label %exitFalse
-
-exitTrue: ; preds = %bb
- ret i1 true
-
-exitFalse: ; preds = %bb
- ret i1 false
-}
-
diff --git a/release_23/test/Transforms/InstCombine/2006-12-08-Phi-ICmp-Op-Fold.ll b/release_23/test/Transforms/InstCombine/2006-12-08-Phi-ICmp-Op-Fold.ll
deleted file mode 100644
index 1508a523b7a9..000000000000
--- a/release_23/test/Transforms/InstCombine/2006-12-08-Phi-ICmp-Op-Fold.ll
+++ /dev/null
@@ -1,51 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \
-; RUN: grep {icmp sgt}
-; END.
-target datalayout = "e-p:32:32"
-target triple = "i686-pc-linux-gnu"
- %struct.point = type { i32, i32 }
-
-define i32 @visible(i32 %direction, i64 %p1.0, i64 %p2.0, i64 %p3.0) {
-entry:
- %p1_addr = alloca %struct.point ; <%struct.point*> [#uses=2]
- %p2_addr = alloca %struct.point ; <%struct.point*> [#uses=2]
- %p3_addr = alloca %struct.point ; <%struct.point*> [#uses=2]
- %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
- %tmp = bitcast %struct.point* %p1_addr to { i64 }* ; <{ i64 }*> [#uses=1]
- %tmp.upgrd.1 = getelementptr { i64 }* %tmp, i64 0, i32 0 ; <i64*> [#uses=1]
- store i64 %p1.0, i64* %tmp.upgrd.1
- %tmp1 = bitcast %struct.point* %p2_addr to { i64 }* ; <{ i64 }*> [#uses=1]
- %tmp2 = getelementptr { i64 }* %tmp1, i64 0, i32 0 ; <i64*> [#uses=1]
- store i64 %p2.0, i64* %tmp2
- %tmp3 = bitcast %struct.point* %p3_addr to { i64 }* ; <{ i64 }*> [#uses=1]
- %tmp4 = getelementptr { i64 }* %tmp3, i64 0, i32 0 ; <i64*> [#uses=1]
- store i64 %p3.0, i64* %tmp4
- %tmp.upgrd.2 = icmp eq i32 %direction, 0 ; <i1> [#uses=1]
- %tmp5 = bitcast %struct.point* %p1_addr to { i64 }* ; <{ i64 }*> [#uses=1]
- %tmp6 = getelementptr { i64 }* %tmp5, i64 0, i32 0 ; <i64*> [#uses=1]
- %tmp.upgrd.3 = load i64* %tmp6 ; <i64> [#uses=1]
- %tmp7 = bitcast %struct.point* %p2_addr to { i64 }* ; <{ i64 }*> [#uses=1]
- %tmp8 = getelementptr { i64 }* %tmp7, i64 0, i32 0 ; <i64*> [#uses=1]
- %tmp9 = load i64* %tmp8 ; <i64> [#uses=1]
- %tmp10 = bitcast %struct.point* %p3_addr to { i64 }* ; <{ i64 }*> [#uses=1]
- %tmp11 = getelementptr { i64 }* %tmp10, i64 0, i32 0 ; <i64*> [#uses=1]
- %tmp12 = load i64* %tmp11 ; <i64> [#uses=1]
- %tmp13 = call i32 @determinant( i64 %tmp.upgrd.3, i64 %tmp9, i64 %tmp12 ) ; <i32> [#uses=2]
- br i1 %tmp.upgrd.2, label %cond_true, label %cond_false
-
-cond_true: ; preds = %entry
- %tmp14 = icmp slt i32 %tmp13, 0 ; <i1> [#uses=1]
- %tmp14.upgrd.4 = zext i1 %tmp14 to i32 ; <i32> [#uses=1]
- br label %return
-
-cond_false: ; preds = %entry
- %tmp26 = icmp sgt i32 %tmp13, 0 ; <i1> [#uses=1]
- %tmp26.upgrd.5 = zext i1 %tmp26 to i32 ; <i32> [#uses=1]
- br label %return
-
-return: ; preds = %cond_false, %cond_true
- %retval.0 = phi i32 [ %tmp14.upgrd.4, %cond_true ], [ %tmp26.upgrd.5, %cond_false ] ; <i32> [#uses=1]
- ret i32 %retval.0
-}
-
-declare i32 @determinant(i64, i64, i64)
diff --git a/release_23/test/Transforms/InstCombine/2006-12-08-Select-ICmp.ll b/release_23/test/Transforms/InstCombine/2006-12-08-Select-ICmp.ll
deleted file mode 100644
index e4aade7b8ea4..000000000000
--- a/release_23/test/Transforms/InstCombine/2006-12-08-Select-ICmp.ll
+++ /dev/null
@@ -1,41 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep select
-; END.
-
-target datalayout = "e-p:32:32"
-target triple = "i686-pc-linux-gnu"
- %struct.point = type { i32, i32 }
-
-define i32 @visible(i32 %direction, i64 %p1.0, i64 %p2.0, i64 %p3.0) {
-entry:
- %p1_addr = alloca %struct.point ; <%struct.point*> [#uses=2]
- %p2_addr = alloca %struct.point ; <%struct.point*> [#uses=2]
- %p3_addr = alloca %struct.point ; <%struct.point*> [#uses=2]
- %tmp = bitcast %struct.point* %p1_addr to { i64 }* ; <{ i64 }*> [#uses=1]
- %tmp.upgrd.1 = getelementptr { i64 }* %tmp, i32 0, i32 0 ; <i64*> [#uses=1]
- store i64 %p1.0, i64* %tmp.upgrd.1
- %tmp1 = bitcast %struct.point* %p2_addr to { i64 }* ; <{ i64 }*> [#uses=1]
- %tmp2 = getelementptr { i64 }* %tmp1, i32 0, i32 0 ; <i64*> [#uses=1]
- store i64 %p2.0, i64* %tmp2
- %tmp3 = bitcast %struct.point* %p3_addr to { i64 }* ; <{ i64 }*> [#uses=1]
- %tmp4 = getelementptr { i64 }* %tmp3, i32 0, i32 0 ; <i64*> [#uses=1]
- store i64 %p3.0, i64* %tmp4
- %tmp.upgrd.2 = icmp eq i32 %direction, 0 ; <i1> [#uses=1]
- %tmp5 = bitcast %struct.point* %p1_addr to { i64 }* ; <{ i64 }*> [#uses=1]
- %tmp6 = getelementptr { i64 }* %tmp5, i32 0, i32 0 ; <i64*> [#uses=1]
- %tmp.upgrd.3 = load i64* %tmp6 ; <i64> [#uses=1]
- %tmp7 = bitcast %struct.point* %p2_addr to { i64 }* ; <{ i64 }*> [#uses=1]
- %tmp8 = getelementptr { i64 }* %tmp7, i32 0, i32 0 ; <i64*> [#uses=1]
- %tmp9 = load i64* %tmp8 ; <i64> [#uses=1]
- %tmp10 = bitcast %struct.point* %p3_addr to { i64 }* ; <{ i64 }*> [#uses=1]
- %tmp11 = getelementptr { i64 }* %tmp10, i32 0, i32 0 ; <i64*> [#uses=1]
- %tmp12 = load i64* %tmp11 ; <i64> [#uses=1]
- %tmp13 = call i32 @determinant( i64 %tmp.upgrd.3, i64 %tmp9, i64 %tmp12 ) ; <i32> [#uses=2]
- %tmp14 = icmp slt i32 %tmp13, 0 ; <i1> [#uses=1]
- %tmp26 = icmp sgt i32 %tmp13, 0 ; <i1> [#uses=1]
- %retval.0.in = select i1 %tmp.upgrd.2, i1 %tmp14, i1 %tmp26 ; <i1> [#uses=1]
- %retval.0 = zext i1 %retval.0.in to i32 ; <i32> [#uses=1]
- ret i32 %retval.0
-}
-
-declare i32 @determinant(i64, i64, i64)
-
diff --git a/release_23/test/Transforms/InstCombine/2006-12-10-ICmp-GEP-GEP.ll b/release_23/test/Transforms/InstCombine/2006-12-10-ICmp-GEP-GEP.ll
deleted file mode 100644
index 15f73622d614..000000000000
--- a/release_23/test/Transforms/InstCombine/2006-12-10-ICmp-GEP-GEP.ll
+++ /dev/null
@@ -1,162 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \
-; RUN: grep -v {icmp ult i32}
-; END.
-
-target datalayout = "e-p:32:32"
-target triple = "i686-pc-linux-gnu"
- %struct.edgeBox = type { i16, i16, i16, i16, i16, i16 }
-@qsz = external global i32 ; <i32*> [#uses=12]
-@thresh = external global i32 ; <i32*> [#uses=2]
-@mthresh = external global i32 ; <i32*> [#uses=1]
-
-define i32 @qsorte(i8* %base, i32 %n, i32 %size) {
-entry:
- %tmp = icmp sgt i32 %n, 1 ; <i1> [#uses=1]
- br i1 %tmp, label %cond_next, label %return
-
-cond_next: ; preds = %entry
- store i32 %size, i32* @qsz
- %tmp3 = shl i32 %size, 2 ; <i32> [#uses=1]
- store i32 %tmp3, i32* @thresh
- %tmp4 = load i32* @qsz ; <i32> [#uses=1]
- %tmp5 = mul i32 %tmp4, 6 ; <i32> [#uses=1]
- store i32 %tmp5, i32* @mthresh
- %tmp6 = load i32* @qsz ; <i32> [#uses=1]
- %tmp8 = mul i32 %tmp6, %n ; <i32> [#uses=1]
- %tmp9 = getelementptr i8* %base, i32 %tmp8 ; <i8*> [#uses=3]
- %tmp11 = icmp sgt i32 %n, 3 ; <i1> [#uses=1]
- br i1 %tmp11, label %cond_true12, label %bb30
-
-cond_true12: ; preds = %cond_next
- %tmp156 = call i32 @qste( i8* %base, i8* %tmp9 ) ; <i32> [#uses=0]
- %tmp16 = load i32* @thresh ; <i32> [#uses=1]
- %tmp18 = getelementptr i8* %base, i32 %tmp16 ; <i8*> [#uses=2]
- %tmp3117 = load i32* @qsz ; <i32> [#uses=1]
- %tmp3318 = getelementptr i8* %base, i32 %tmp3117 ; <i8*> [#uses=2]
- %tmp3621 = icmp ult i8* %tmp3318, %tmp18 ; <i1> [#uses=1]
- br i1 %tmp3621, label %bb, label %bb37
-
-bb: ; preds = %bb30, %cond_true12
- %hi.0.0 = phi i8* [ %tmp18, %cond_true12 ], [ %hi.0, %bb30 ] ; <i8*> [#uses=4]
- %j.1.0 = phi i8* [ %base, %cond_true12 ], [ %j.1, %bb30 ] ; <i8*> [#uses=4]
- %tmp33.0 = phi i8* [ %tmp3318, %cond_true12 ], [ %tmp33, %bb30 ] ; <i8*> [#uses=6]
- %tmp3.upgrd.1 = bitcast i8* %j.1.0 to %struct.edgeBox* ; <%struct.edgeBox*> [#uses=1]
- %tmp4.upgrd.2 = bitcast i8* %tmp33.0 to %struct.edgeBox* ; <%struct.edgeBox*> [#uses=1]
- %tmp255 = call i32 @comparee( %struct.edgeBox* %tmp3.upgrd.1, %struct.edgeBox* %tmp4.upgrd.2 ) ; <i32> [#uses=1]
- %tmp26 = icmp sgt i32 %tmp255, 0 ; <i1> [#uses=1]
- br i1 %tmp26, label %cond_true27, label %bb30
-
-cond_true27: ; preds = %bb
- br label %bb30
-
-bb30: ; preds = %cond_true27, %bb, %cond_next
- %hi.0.3 = phi i8* [ %hi.0.0, %cond_true27 ], [ %hi.0.0, %bb ], [ undef, %cond_next ] ; <i8*> [#uses=0]
- %j.1.3 = phi i8* [ %j.1.0, %cond_true27 ], [ %j.1.0, %bb ], [ undef, %cond_next ] ; <i8*> [#uses=0]
- %tmp33.3 = phi i8* [ %tmp33.0, %cond_true27 ], [ %tmp33.0, %bb ], [ undef, %cond_next ] ; <i8*> [#uses=0]
- %hi.0 = phi i8* [ %tmp9, %cond_next ], [ %hi.0.0, %bb ], [ %hi.0.0, %cond_true27 ] ; <i8*> [#uses=2]
- %lo.1 = phi i8* [ %tmp33.0, %cond_true27 ], [ %tmp33.0, %bb ], [ %base, %cond_next ] ; <i8*> [#uses=1]
- %j.1 = phi i8* [ %tmp33.0, %cond_true27 ], [ %j.1.0, %bb ], [ %base, %cond_next ] ; <i8*> [#uses=2]
- %tmp31 = load i32* @qsz ; <i32> [#uses=1]
- %tmp33 = getelementptr i8* %lo.1, i32 %tmp31 ; <i8*> [#uses=2]
- %tmp36 = icmp ult i8* %tmp33, %hi.0 ; <i1> [#uses=1]
- br i1 %tmp36, label %bb, label %bb37
-
-bb37: ; preds = %bb30, %cond_true12
- %j.1.1 = phi i8* [ %j.1, %bb30 ], [ %base, %cond_true12 ] ; <i8*> [#uses=4]
- %tmp40 = icmp eq i8* %j.1.1, %base ; <i1> [#uses=1]
- br i1 %tmp40, label %bb115, label %cond_true41
-
-cond_true41: ; preds = %bb37
- %tmp43 = load i32* @qsz ; <i32> [#uses=1]
- %tmp45 = getelementptr i8* %base, i32 %tmp43 ; <i8*> [#uses=2]
- %tmp6030 = icmp ult i8* %base, %tmp45 ; <i1> [#uses=1]
- br i1 %tmp6030, label %bb46, label %bb115
-
-bb46: ; preds = %bb46, %cond_true41
- %j.2.0 = phi i8* [ %j.1.1, %cond_true41 ], [ %tmp52, %bb46 ] ; <i8*> [#uses=3]
- %i.2.0 = phi i8* [ %base, %cond_true41 ], [ %tmp56, %bb46 ] ; <i8*> [#uses=3]
- %tmp.upgrd.3 = load i8* %j.2.0 ; <i8> [#uses=2]
- %tmp49 = load i8* %i.2.0 ; <i8> [#uses=1]
- store i8 %tmp49, i8* %j.2.0
- %tmp52 = getelementptr i8* %j.2.0, i32 1 ; <i8*> [#uses=2]
- store i8 %tmp.upgrd.3, i8* %i.2.0
- %tmp56 = getelementptr i8* %i.2.0, i32 1 ; <i8*> [#uses=3]
- %tmp60 = icmp ult i8* %tmp56, %tmp45 ; <i1> [#uses=1]
- br i1 %tmp60, label %bb46, label %bb115
-
-bb66: ; preds = %bb115, %bb66
- %hi.3 = phi i8* [ %tmp118, %bb115 ], [ %tmp70, %bb66 ] ; <i8*> [#uses=2]
- %tmp67 = load i32* @qsz ; <i32> [#uses=2]
- %tmp68 = sub i32 0, %tmp67 ; <i32> [#uses=1]
- %tmp70 = getelementptr i8* %hi.3, i32 %tmp68 ; <i8*> [#uses=2]
- %tmp.upgrd.4 = bitcast i8* %tmp70 to %struct.edgeBox* ; <%struct.edgeBox*> [#uses=1]
- %tmp1 = bitcast i8* %tmp118 to %struct.edgeBox* ; <%struct.edgeBox*> [#uses=1]
- %tmp732 = call i32 @comparee( %struct.edgeBox* %tmp.upgrd.4, %struct.edgeBox* %tmp1 ) ; <i32> [#uses=1]
- %tmp74 = icmp sgt i32 %tmp732, 0 ; <i1> [#uses=1]
- br i1 %tmp74, label %bb66, label %bb75
-
-bb75: ; preds = %bb66
- %tmp76 = load i32* @qsz ; <i32> [#uses=1]
- %tmp70.sum = sub i32 %tmp76, %tmp67 ; <i32> [#uses=1]
- %tmp78 = getelementptr i8* %hi.3, i32 %tmp70.sum ; <i8*> [#uses=3]
- %tmp81 = icmp eq i8* %tmp78, %tmp118 ; <i1> [#uses=1]
- br i1 %tmp81, label %bb115, label %cond_true82
-
-cond_true82: ; preds = %bb75
- %tmp83 = load i32* @qsz ; <i32> [#uses=1]
- %tmp118.sum = add i32 %tmp116, %tmp83 ; <i32> [#uses=1]
- %tmp85 = getelementptr i8* %min.1, i32 %tmp118.sum ; <i8*> [#uses=1]
- %tmp10937 = getelementptr i8* %tmp85, i32 -1 ; <i8*> [#uses=3]
- %tmp11239 = icmp ult i8* %tmp10937, %tmp118 ; <i1> [#uses=1]
- br i1 %tmp11239, label %bb115, label %bb86
-
-bb86: ; preds = %bb104, %cond_true82
- %tmp109.0 = phi i8* [ %tmp10937, %cond_true82 ], [ %tmp109, %bb104 ] ; <i8*> [#uses=5]
- %i.5.2 = phi i8* [ %i.5.3, %cond_true82 ], [ %i.5.1, %bb104 ] ; <i8*> [#uses=0]
- %tmp100.2 = phi i8* [ %tmp100.3, %cond_true82 ], [ %tmp100.1, %bb104 ] ; <i8*> [#uses=0]
- %tmp88 = load i8* %tmp109.0 ; <i8> [#uses=2]
- %tmp9746 = load i32* @qsz ; <i32> [#uses=1]
- %tmp9847 = sub i32 0, %tmp9746 ; <i32> [#uses=1]
- %tmp10048 = getelementptr i8* %tmp109.0, i32 %tmp9847 ; <i8*> [#uses=3]
- %tmp10350 = icmp ult i8* %tmp10048, %tmp78 ; <i1> [#uses=1]
- br i1 %tmp10350, label %bb104, label %bb91
-
-bb91: ; preds = %bb91, %bb86
- %i.5.0 = phi i8* [ %tmp109.0, %bb86 ], [ %tmp100.0, %bb91 ] ; <i8*> [#uses=1]
- %tmp100.0 = phi i8* [ %tmp10048, %bb86 ], [ %tmp100, %bb91 ] ; <i8*> [#uses=4]
- %tmp93 = load i8* %tmp100.0 ; <i8> [#uses=1]
- store i8 %tmp93, i8* %i.5.0
- %tmp97 = load i32* @qsz ; <i32> [#uses=1]
- %tmp98 = sub i32 0, %tmp97 ; <i32> [#uses=1]
- %tmp100 = getelementptr i8* %tmp100.0, i32 %tmp98 ; <i8*> [#uses=3]
- %tmp103 = icmp ult i8* %tmp100, %tmp78 ; <i1> [#uses=1]
- br i1 %tmp103, label %bb104, label %bb91
-
-bb104: ; preds = %bb91, %bb86
- %i.5.1 = phi i8* [ %tmp109.0, %bb86 ], [ %tmp100.0, %bb91 ] ; <i8*> [#uses=4]
- %tmp100.1 = phi i8* [ %tmp10048, %bb86 ], [ %tmp100, %bb91 ] ; <i8*> [#uses=3]
- store i8 %tmp88, i8* %i.5.1
- %tmp109 = getelementptr i8* %tmp109.0, i32 -1 ; <i8*> [#uses=3]
- %tmp112 = icmp ult i8* %tmp109, %tmp118 ; <i1> [#uses=1]
- br i1 %tmp112, label %bb115, label %bb86
-
-bb115: ; preds = %bb104, %cond_true82, %bb75, %bb46, %cond_true41, %bb37
- %tmp109.1 = phi i8* [ undef, %bb37 ], [ %tmp109.1, %bb75 ], [ %tmp10937, %cond_true82 ], [ %tmp109, %bb104 ], [ undef, %bb46 ], [ undef, %cond_true41 ] ; <i8*> [#uses=1]
- %i.5.3 = phi i8* [ undef, %bb37 ], [ %i.5.3, %bb75 ], [ %i.5.3, %cond_true82 ], [ %i.5.1, %bb104 ], [ undef, %bb46 ], [ undef, %cond_true41 ] ; <i8*> [#uses=3]
- %tmp100.3 = phi i8* [ undef, %bb37 ], [ %tmp100.3, %bb75 ], [ %tmp100.3, %cond_true82 ], [ %tmp100.1, %bb104 ], [ undef, %bb46 ], [ undef, %cond_true41 ] ; <i8*> [#uses=3]
- %min.1 = phi i8* [ %tmp118, %bb104 ], [ %tmp118, %bb75 ], [ %base, %bb37 ], [ %base, %bb46 ], [ %base, %cond_true41 ], [ %tmp118, %cond_true82 ] ; <i8*> [#uses=2]
- %j.5 = phi i8* [ %tmp100.1, %bb104 ], [ %j.5, %bb75 ], [ %tmp52, %bb46 ], [ %j.1.1, %bb37 ], [ %j.1.1, %cond_true41 ], [ %j.5, %cond_true82 ] ; <i8*> [#uses=2]
- %i.4 = phi i8* [ %i.5.1, %bb104 ], [ %i.4, %bb75 ], [ %tmp56, %bb46 ], [ undef, %bb37 ], [ %base, %cond_true41 ], [ %i.4, %cond_true82 ] ; <i8*> [#uses=2]
- %c.4 = phi i8 [ %tmp88, %bb104 ], [ %c.4, %bb75 ], [ %tmp.upgrd.3, %bb46 ], [ undef, %bb37 ], [ undef, %cond_true41 ], [ %c.4, %cond_true82 ] ; <i8> [#uses=2]
- %tmp116 = load i32* @qsz ; <i32> [#uses=2]
- %tmp118 = getelementptr i8* %min.1, i32 %tmp116 ; <i8*> [#uses=9]
- %tmp122 = icmp ult i8* %tmp118, %tmp9 ; <i1> [#uses=1]
- br i1 %tmp122, label %bb66, label %return
-
-return: ; preds = %bb115, %entry
- ret i32 undef
-}
-
-declare i32 @qste(i8*, i8*)
-
-declare i32 @comparee(%struct.edgeBox*, %struct.edgeBox*)
diff --git a/release_23/test/Transforms/InstCombine/2006-12-15-Range-Test.ll b/release_23/test/Transforms/InstCombine/2006-12-15-Range-Test.ll
deleted file mode 100644
index 67bc84c4045c..000000000000
--- a/release_23/test/Transforms/InstCombine/2006-12-15-Range-Test.ll
+++ /dev/null
@@ -1,31 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \
-; RUN: grep icmp | count 1
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \
-; RUN: grep {icmp ugt} | count 1
-; END.
-
-target datalayout = "e-p:32:32"
-target triple = "i686-pc-linux-gnu"
-@r = external global [17 x i32] ; <[17 x i32]*> [#uses=1]
-
-define i1 @print_pgm_cond_true(i32 %tmp12.reload, i32* %tmp16.out) {
-newFuncRoot:
- br label %cond_true
-
-bb27.exitStub: ; preds = %cond_true
- store i32 %tmp16, i32* %tmp16.out
- ret i1 true
-
-cond_next23.exitStub: ; preds = %cond_true
- store i32 %tmp16, i32* %tmp16.out
- ret i1 false
-
-cond_true: ; preds = %newFuncRoot
- %tmp15 = getelementptr [17 x i32]* @r, i32 0, i32 %tmp12.reload ; <i32*> [#uses=1]
- %tmp16 = load i32* %tmp15 ; <i32> [#uses=4]
- %tmp18 = icmp slt i32 %tmp16, -31 ; <i1> [#uses=1]
- %tmp21 = icmp sgt i32 %tmp16, 31 ; <i1> [#uses=1]
- %bothcond = or i1 %tmp18, %tmp21 ; <i1> [#uses=1]
- br i1 %bothcond, label %bb27.exitStub, label %cond_next23.exitStub
-}
-
diff --git a/release_23/test/Transforms/InstCombine/2006-12-23-Select-Cmp-Cmp.ll b/release_23/test/Transforms/InstCombine/2006-12-23-Select-Cmp-Cmp.ll
deleted file mode 100644
index 695aea46ee2c..000000000000
--- a/release_23/test/Transforms/InstCombine/2006-12-23-Select-Cmp-Cmp.ll
+++ /dev/null
@@ -1,30 +0,0 @@
-; For PR1065. This causes an assertion in instcombine if a select with two cmp
-; operands is encountered.
-; RUN: llvm-as < %s | opt -instcombine -disable-output
-; END.
-
-target datalayout = "e-p:32:32"
-target triple = "i686-pc-linux-gnu"
- %struct.internal_state = type { i32 }
- %struct.mng_data = type { i32, i8*, i32, i32, i32, i32, i32, i32, i32, i32, i32, i8, i32, i32, i32, i8, i32, i32, i32, i32, i16, i16, i16, i8, i8, double, double, double, i8, i8, i8, i8, i32, i32, i32, i32, i32, i8, i32, i32, i8*, i8* (i32)*, void (i8*, i32)*, void (i8*, i8*, i32)*, i8 (%struct.mng_data*)*, i8 (%struct.mng_data*)*, i8 (%struct.mng_data*, i8*, i32, i32*)*, i8 (%struct.mng_data*, i8*, i32, i32*)*, i8 (%struct.mng_data*, i32, i8, i32, i32, i32, i32, i8*)*, i8 (%struct.mng_data*, i32, i32, i8*)*, i8 (%struct.mng_data*, i32, i32)*, i8 (%struct.mng_data*, i8, i8*, i8*, i8*, i8*)*, i8 (%struct.mng_data*)*, i8 (%struct.mng_data*, i8*)*, i8 (%struct.mng_data*, i8*)*, i8 (%struct.mng_data*, i32, i32)*, i8 (%struct.mng_data*, i32, i32, i8*)*, i8 (%struct.mng_data*, i8, i8, i32, i32)*, i8* (%struct.mng_data*, i32)*, i8* (%struct.mng_data*, i32)*, i8* (%struct.mng_data*, i32)*, i8 (%struct.mng_data*, i32, i32, i32, i32)*, i32 (%struct.mng_data*)*, i8 (%struct.mng_data*, i32)*, i8 (%struct.mng_data*, i32)*, i8 (%struct.mng_data*, i32, i32, i32, i32, i32, i32, i32, i32)*, i8 (%struct.mng_data*, i8)*, i8 (%struct.mng_data*, i32, i8*)*, i8 (%struct.mng_data*, i32, i8, i8*)*, i8, i32, i32, i8*, i8*, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i32, i32, i8, i8, i8, i8, i8, i32, i8, i8, i8, i32, i8*, i32, i8*, i32, i8, i8, i8, i32, i8*, i8*, i32, i32, i8*, i8*, %struct.mng_pushdata*, %struct.mng_pushdata*, %struct.mng_pushdata*, %struct.mng_pushdata*, i8, i8, i32, i32, i8*, i8, i8, i32, i32, i32, i32, i32, i32, i8, i8, i8, i8, i32, i32, i8*, i32, i32, i32, i8, i8, i32, i32, i32, i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i32, i8*, i8*, i8*, i32, i8*, i8*, i8*, i8*, i8*, %struct.mng_savedata*, i32, i32, i32, i32, i8, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i8*, i8*, i8*, i8, i8, i32, i32, i32, i32, i32, i32, i32, i32, i32, i8*, i8*, i8*, i8*, i8*, i8*, [256 x i8], double, void ()*, void ()*, void ()*, void ()*, void ()*, void ()*, void ()*, void ()*, void ()*, void ()*, void ()*, void ()*, i16, i8, i8, i8, i8, i8, i32, i32, i8, i32, i32, i32, i32, i16, i16, i16, i8, i16, i8, i32, i32, i32, i32, i8, i32, i32, i8, i32, i32, i32, i32, i8, i32, i32, i8, i32, i32, i32, i32, i32, i8, i32, i8, i16, i16, i16, i16, i32, [256 x %struct.mng_palette8e], i32, [256 x i8], i32, i32, i32, i32, i32, i32, i32, i32, i32, i8, i32, i8*, i16, i16, i16, i8*, i8, i8, i32, i32, i32, i32, i8, void ()*, void ()*, void ()*, void ()*, void ()*, void ()*, i8*, i8, i8, i8, i32, i8*, i8*, i16, i16, i16, i16, i32, i32, i8*, %struct.z_stream, i32, i32, i32, i32, i32, i32, i8, i8, [256 x i32], i8 }
- %struct.mng_palette8e = type { i8, i8, i8 }
- %struct.mng_pushdata = type { i8*, i8*, i32, i8, i8*, i32 }
- %struct.mng_savedata = type { i8, i8, i8, i8, i8, i8, i8, i16, i16, i16, i8, i16, i8, i8, i32, i32, i8, i32, i32, i32, i32, i32, [256 x %struct.mng_palette8e], i32, [256 x i8], i32, i32, i32, i32, i32, i32, i32, i32, i32, i8, i32, i8*, i16, i16, i16 }
- %struct.z_stream = type { i8*, i32, i32, i8*, i32, i32, i8*, %struct.internal_state*, i8* (i8*, i32, i32)*, void (i8*, i8*)*, i8*, i32, i32, i32 }
-
-define void @mng_write_basi() {
-entry:
- %tmp = load i8* null ; <i8> [#uses=1]
- %tmp.upgrd.1 = icmp ugt i8 %tmp, 8 ; <i1> [#uses=1]
- %tmp.upgrd.2 = load i16* null ; <i16> [#uses=2]
- %tmp3 = icmp eq i16 %tmp.upgrd.2, 255 ; <i1> [#uses=1]
- %tmp7 = icmp eq i16 %tmp.upgrd.2, -1 ; <i1> [#uses=1]
- %bOpaque.0.in = select i1 %tmp.upgrd.1, i1 %tmp7, i1 %tmp3 ; <i1> [#uses=1]
- br i1 %bOpaque.0.in, label %cond_next90, label %bb95
-
-cond_next90: ; preds = %entry
- ret void
-
-bb95: ; preds = %entry
- ret void
-}
diff --git a/release_23/test/Transforms/InstCombine/2007-01-13-ExtCompareMiscompile.ll b/release_23/test/Transforms/InstCombine/2007-01-13-ExtCompareMiscompile.ll
deleted file mode 100644
index edbcfeed923a..000000000000
--- a/release_23/test/Transforms/InstCombine/2007-01-13-ExtCompareMiscompile.ll
+++ /dev/null
@@ -1,10 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {icmp ugt}
-; PR1107
-; PR1940
-
-define i1 @test(i8 %A, i8 %B) {
- %a = zext i8 %A to i32
- %b = zext i8 %B to i32
- %c = icmp sgt i32 %a, %b
- ret i1 %c
-}
diff --git a/release_23/test/Transforms/InstCombine/2007-01-14-FcmpSelf.ll b/release_23/test/Transforms/InstCombine/2007-01-14-FcmpSelf.ll
deleted file mode 100644
index 073d3a154128..000000000000
--- a/release_23/test/Transforms/InstCombine/2007-01-14-FcmpSelf.ll
+++ /dev/null
@@ -1,6 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {fcmp uno.*0.0}
-; PR1111
-define i1 @test(double %X) {
- %tmp = fcmp une double %X, %X
- ret i1 %tmp
-}
diff --git a/release_23/test/Transforms/InstCombine/2007-01-18-VectorInfLoop.ll b/release_23/test/Transforms/InstCombine/2007-01-18-VectorInfLoop.ll
deleted file mode 100644
index 83d05d9d94f7..000000000000
--- a/release_23/test/Transforms/InstCombine/2007-01-18-VectorInfLoop.ll
+++ /dev/null
@@ -1,7 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine -disable-output
-
-define <4 x i32> @test(<4 x i32> %A) {
- %B = xor <4 x i32> %A, < i32 -1, i32 -1, i32 -1, i32 -1 >
- %C = and <4 x i32> %B, < i32 -1, i32 -1, i32 -1, i32 -1 >
- ret <4 x i32> %C
-}
diff --git a/release_23/test/Transforms/InstCombine/2007-01-27-AndICmp.ll b/release_23/test/Transforms/InstCombine/2007-01-27-AndICmp.ll
deleted file mode 100644
index 0e8c5b17666e..000000000000
--- a/release_23/test/Transforms/InstCombine/2007-01-27-AndICmp.ll
+++ /dev/null
@@ -1,8 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {ugt.*, 1}
-
-define i1 @test(i32 %tmp1030) {
- %tmp1037 = icmp ne i32 %tmp1030, 40 ; <i1> [#uses=1]
- %tmp1039 = icmp ne i32 %tmp1030, 41 ; <i1> [#uses=1]
- %tmp1042 = and i1 %tmp1037, %tmp1039 ; <i1> [#uses=1]
- ret i1 %tmp1042
-}
diff --git a/release_23/test/Transforms/InstCombine/2007-02-01-LoadSinkAlloca.ll b/release_23/test/Transforms/InstCombine/2007-02-01-LoadSinkAlloca.ll
deleted file mode 100644
index e559cdd914a9..000000000000
--- a/release_23/test/Transforms/InstCombine/2007-02-01-LoadSinkAlloca.ll
+++ /dev/null
@@ -1,45 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine -mem2reg | llvm-dis | grep {%A = alloca}
-; RUN: llvm-as < %s | opt -instcombine -mem2reg | llvm-dis | \
-; RUN: not grep {%B = alloca}
-; END.
-
-; Ensure that instcombine doesn't sink the loads in entry/cond_true into
-; cond_next. Doing so prevents mem2reg from promoting the B alloca.
-
-define i32 @test2(i32 %C) {
-entry:
- %A = alloca i32
- %B = alloca i32
- %tmp = call i32 (...)* @bar( i32* %A ) ; <i32> [#uses=0]
- %T = load i32* %A ; <i32> [#uses=1]
- %tmp2 = icmp eq i32 %C, 0 ; <i1> [#uses=1]
- br i1 %tmp2, label %cond_next, label %cond_true
-
-cond_true: ; preds = %entry
- store i32 123, i32* %B
- call i32 @test2( i32 123 ) ; <i32>:0 [#uses=0]
- %T1 = load i32* %B ; <i32> [#uses=1]
- br label %cond_next
-
-cond_next: ; preds = %cond_true, %entry
- %tmp1.0 = phi i32 [ %T1, %cond_true ], [ %T, %entry ] ; <i32> [#uses=1]
- %tmp7 = call i32 (...)* @baq( ) ; <i32> [#uses=0]
- %tmp8 = call i32 (...)* @baq( ) ; <i32> [#uses=0]
- %tmp9 = call i32 (...)* @baq( ) ; <i32> [#uses=0]
- %tmp10 = call i32 (...)* @baq( ) ; <i32> [#uses=0]
- %tmp11 = call i32 (...)* @baq( ) ; <i32> [#uses=0]
- %tmp12 = call i32 (...)* @baq( ) ; <i32> [#uses=0]
- %tmp13 = call i32 (...)* @baq( ) ; <i32> [#uses=0]
- %tmp14 = call i32 (...)* @baq( ) ; <i32> [#uses=0]
- %tmp15 = call i32 (...)* @baq( ) ; <i32> [#uses=0]
- %tmp16 = call i32 (...)* @baq( ) ; <i32> [#uses=0]
- %tmp17 = call i32 (...)* @baq( ) ; <i32> [#uses=0]
- %tmp18 = call i32 (...)* @baq( ) ; <i32> [#uses=0]
- %tmp19 = call i32 (...)* @baq( ) ; <i32> [#uses=0]
- %tmp20 = call i32 (...)* @baq( ) ; <i32> [#uses=0]
- ret i32 %tmp1.0
-}
-
-declare i32 @bar(...)
-
-declare i32 @baq(...)
diff --git a/release_23/test/Transforms/InstCombine/2007-02-07-PointerCast.ll b/release_23/test/Transforms/InstCombine/2007-02-07-PointerCast.ll
deleted file mode 100644
index ce9eb3c69d4b..000000000000
--- a/release_23/test/Transforms/InstCombine/2007-02-07-PointerCast.ll
+++ /dev/null
@@ -1,22 +0,0 @@
-;RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep zext
-
-; Make sure the uint isn't removed. Instcombine in llvm 1.9 was dropping the
-; uint cast which was causing a sign extend. This only affected code with
-; pointers in the high half of memory, so it wasn't noticed much
-; compile a kernel though...
-
-target datalayout = "e-p:32:32"
-@str = internal constant [6 x i8] c"%llx\0A\00" ; <[6 x i8]*> [#uses=1]
-
-declare i32 @printf(i8*, ...)
-
-define i32 @main(i32 %x, i8** %a) {
-entry:
- %tmp = getelementptr [6 x i8]* @str, i32 0, i64 0 ; <i8*> [#uses=1]
- %tmp1 = load i8** %a ; <i8*> [#uses=1]
- %tmp2 = ptrtoint i8* %tmp1 to i32 ; <i32> [#uses=1]
- %tmp3 = zext i32 %tmp2 to i64 ; <i64> [#uses=1]
- %tmp.upgrd.1 = call i32 (i8*, ...)* @printf( i8* %tmp, i64 %tmp3 ) ; <i32> [#uses=0]
- ret i32 0
-}
-
diff --git a/release_23/test/Transforms/InstCombine/2007-02-23-PhiFoldInfLoop.ll b/release_23/test/Transforms/InstCombine/2007-02-23-PhiFoldInfLoop.ll
deleted file mode 100644
index d60da44b7f19..000000000000
--- a/release_23/test/Transforms/InstCombine/2007-02-23-PhiFoldInfLoop.ll
+++ /dev/null
@@ -1,31 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep ret
-; PR1217
-
-target datalayout = "e-p:32:32"
-target triple = "i686-pc-linux-gnu"
- %struct.termbox = type { %struct.termbox*, i32, i32, i32, i32, i32 }
-
-
-define void @ggenorien() {
-entry:
- %tmp68 = icmp eq %struct.termbox* null, null ; <i1> [#uses=1]
- br i1 %tmp68, label %cond_next448, label %bb80
-
-bb80: ; preds = %entry
- ret void
-
-cond_next448: ; preds = %entry
- br i1 false, label %bb756, label %bb595
-
-bb595: ; preds = %cond_next448
- br label %bb609
-
-bb609: ; preds = %bb756, %bb595
- %termnum.6240.0 = phi i32 [ 2, %bb595 ], [ %termnum.6, %bb756 ] ; <i32> [#uses=1]
- %tmp755 = add i32 %termnum.6240.0, 1 ; <i32> [#uses=1]
- br label %bb756
-
-bb756: ; preds = %bb609, %cond_next448
- %termnum.6 = phi i32 [ %tmp755, %bb609 ], [ 2, %cond_next448 ] ; <i32> [#uses=1]
- br label %bb609
-}
diff --git a/release_23/test/Transforms/InstCombine/2007-03-13-CompareMerge.ll b/release_23/test/Transforms/InstCombine/2007-03-13-CompareMerge.ll
deleted file mode 100644
index d101050e9307..000000000000
--- a/release_23/test/Transforms/InstCombine/2007-03-13-CompareMerge.ll
+++ /dev/null
@@ -1,9 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {icmp sle}
-; PR1244
-
-define i1 @test(i32 %c.3.i, i32 %d.292.2.i) {
- %tmp266.i = icmp slt i32 %c.3.i, %d.292.2.i
- %tmp276.i = icmp eq i32 %c.3.i, %d.292.2.i
- %sel_tmp80 = or i1 %tmp266.i, %tmp276.i
- ret i1 %sel_tmp80
-}
diff --git a/release_23/test/Transforms/InstCombine/2007-03-19-BadTruncChangePR1261.ll b/release_23/test/Transforms/InstCombine/2007-03-19-BadTruncChangePR1261.ll
deleted file mode 100644
index da58dec1dcaa..000000000000
--- a/release_23/test/Transforms/InstCombine/2007-03-19-BadTruncChangePR1261.ll
+++ /dev/null
@@ -1,10 +0,0 @@
-; RUN: llvm-as %s -o - | opt -instcombine | llvm-dis | grep zext
-; PR1261.
-
-define i16 @test(i31 %zzz) {
- %A = sext i31 %zzz to i32
- %B = add i32 %A, 16384
- %C = lshr i32 %B, 15
- %D = trunc i32 %C to i16
- ret i16 %D
-}
diff --git a/release_23/test/Transforms/InstCombine/2007-03-21-SignedRangeTest.ll b/release_23/test/Transforms/InstCombine/2007-03-21-SignedRangeTest.ll
deleted file mode 100644
index c8dafd166299..000000000000
--- a/release_23/test/Transforms/InstCombine/2007-03-21-SignedRangeTest.ll
+++ /dev/null
@@ -1,7 +0,0 @@
-; For PR1248
-; RUN: llvm-as %s -o - | opt -instcombine | llvm-dis | grep {ugt i32 .*, 11}
-define i1 @test(i32 %tmp6) {
- %tmp7 = sdiv i32 %tmp6, 12 ; <i32> [#uses=1]
- icmp ne i32 %tmp7, -6 ; <i1>:1 [#uses=1]
- ret i1 %1
-}
diff --git a/release_23/test/Transforms/InstCombine/2007-03-25-BadShiftMask.ll b/release_23/test/Transforms/InstCombine/2007-03-25-BadShiftMask.ll
deleted file mode 100644
index 0b05f7c64320..000000000000
--- a/release_23/test/Transforms/InstCombine/2007-03-25-BadShiftMask.ll
+++ /dev/null
@@ -1,29 +0,0 @@
-; PR1271
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \
-; RUN: grep {icmp eq i32 .tmp.*, 2146435072}
-%struct..0anon = type { i32, i32 }
-%struct..1anon = type { double }
-
-define i32 @main() {
-entry:
- %u = alloca %struct..1anon, align 8 ; <%struct..1anon*> [#uses=4]
- %tmp1 = getelementptr %struct..1anon* %u, i32 0, i32 0 ; <double*> [#uses=1]
- store double 0x7FF0000000000000, double* %tmp1
- %tmp3 = getelementptr %struct..1anon* %u, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp34 = bitcast double* %tmp3 to %struct..0anon* ; <%struct..0anon*> [#uses=1]
- %tmp5 = getelementptr %struct..0anon* %tmp34, i32 0, i32 1 ; <i32*> [#uses=1]
- %tmp6 = load i32* %tmp5 ; <i32> [#uses=1]
- %tmp7 = shl i32 %tmp6, 1 ; <i32> [#uses=1]
- %tmp8 = lshr i32 %tmp7, 21 ; <i32> [#uses=1]
- %tmp89 = trunc i32 %tmp8 to i16 ; <i16> [#uses=1]
- icmp ne i16 %tmp89, 2047 ; <i1>:0 [#uses=1]
- zext i1 %0 to i8 ; <i8>:1 [#uses=1]
- icmp ne i8 %1, 0 ; <i1>:2 [#uses=1]
- br i1 %2, label %cond_true, label %cond_false
-
-cond_true: ; preds = %entry
- ret i32 0
-
-cond_false: ; preds = %entry
- ret i32 1
-}
diff --git a/release_23/test/Transforms/InstCombine/2007-03-25-DoubleShift.ll b/release_23/test/Transforms/InstCombine/2007-03-25-DoubleShift.ll
deleted file mode 100644
index d67e1a13cc4e..000000000000
--- a/release_23/test/Transforms/InstCombine/2007-03-25-DoubleShift.ll
+++ /dev/null
@@ -1,9 +0,0 @@
-; PR1271
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep and
-define i1 @test(i32 %tmp13) {
-entry:
- %tmp14 = shl i32 %tmp13, 12 ; <i32> [#uses=1]
- %tmp15 = lshr i32 %tmp14, 12 ; <i32> [#uses=1]
- %res = icmp ne i32 %tmp15, 0 ; <i1>:3 [#uses=1]
- ret i1 %res
-}
diff --git a/release_23/test/Transforms/InstCombine/2007-03-26-BadShiftMask.ll b/release_23/test/Transforms/InstCombine/2007-03-26-BadShiftMask.ll
deleted file mode 100644
index 4a2e60e7c35c..000000000000
--- a/release_23/test/Transforms/InstCombine/2007-03-26-BadShiftMask.ll
+++ /dev/null
@@ -1,36 +0,0 @@
-; PR1271
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \
-; RUN: grep {ashr i32 %.mp137, 2}
-; END.
-
-target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64"
-target triple = "i686-pc-linux-gnu"
-
-
-define i1 @test(i32* %tmp141, i32* %tmp145,
- i32 %b8, i32 %iftmp.430.0, i32* %tmp134.out, i32* %tmp137.out)
-{
-newFuncRoot:
- %tmp133 = and i32 %b8, 1 ; <i32> [#uses=1]
- %tmp134 = shl i32 %tmp133, 3 ; <i32> [#uses=3]
- %tmp136 = ashr i32 %b8, 1 ; <i32> [#uses=1]
- %tmp137 = shl i32 %tmp136, 3 ; <i32> [#uses=3]
- %tmp139 = ashr i32 %tmp134, 2 ; <i32> [#uses=1]
- store i32 %tmp139, i32* %tmp141
- %tmp143 = ashr i32 %tmp137, 2 ; <i32> [#uses=1]
- store i32 %tmp143, i32* %tmp145
- icmp eq i32 %iftmp.430.0, 0 ; <i1>:0 [#uses=1]
- zext i1 %0 to i8 ; <i8>:1 [#uses=1]
- icmp ne i8 %1, 0 ; <i1>:2 [#uses=1]
- br i1 %2, label %cond_true147.exitStub, label %cond_false252.exitStub
-
-cond_true147.exitStub: ; preds = %newFuncRoot
- store i32 %tmp134, i32* %tmp134.out
- store i32 %tmp137, i32* %tmp137.out
- ret i1 true
-
-cond_false252.exitStub: ; preds = %newFuncRoot
- store i32 %tmp134, i32* %tmp134.out
- store i32 %tmp137, i32* %tmp137.out
- ret i1 false
-}
diff --git a/release_23/test/Transforms/InstCombine/2007-03-27-PR1280.ll b/release_23/test/Transforms/InstCombine/2007-03-27-PR1280.ll
deleted file mode 100644
index 6cb9aaec0987..000000000000
--- a/release_23/test/Transforms/InstCombine/2007-03-27-PR1280.ll
+++ /dev/null
@@ -1,15 +0,0 @@
-; PR1280 - we should be able to reduce this function to a trunc/sext but it
-; would involve using a bit width (24) that doesn't match a size that
-; the back end can handle. This test makes sure that such a transform
-; is not done. It should be removed when code gen supports "funny"
-; bit widths.
-
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {add i49.*-8388608}
-
-define i49 @test5(i49 %x) {
- ;; If we have ADD(XOR(AND(X, 0xFF), 0x80), 0xF..F80), it's a sext.
- %X = and i49 %x, 16777215 ; 0x0000000ffffff
- %tmp.2 = xor i49 %X, 8388608 ; 0x0000000800000
- %tmp.4 = add i49 %tmp.2, -8388608 ; 0x1FFFFFF800000
- ret i49 %tmp.4
-}
diff --git a/release_23/test/Transforms/InstCombine/2007-03-31-InfiniteLoop.ll b/release_23/test/Transforms/InstCombine/2007-03-31-InfiniteLoop.ll
deleted file mode 100644
index 640f6d57504b..000000000000
--- a/release_23/test/Transforms/InstCombine/2007-03-31-InfiniteLoop.ll
+++ /dev/null
@@ -1,302 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine -disable-output
-; END.
-
-target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64"
-target triple = "i686-apple-darwin8"
- %struct.ZZIP_FILE = type { %struct.zzip_dir*, i32, i32, i32, i32, i32, i32, i64, i8*, i64, %struct.z_stream, %struct.zzip_plugin_io* }
- %struct.anon = type { %struct.ZZIP_FILE*, i8* }
- %struct.internal_state = type { i32 }
- %struct.z_stream = type { i8*, i32, i32, i8*, i32, i32, i8*, %struct.internal_state*, i8* (i8*, i32, i32)*, void (i8*, i8*)*, i8*, i32, i32, i32 }
- %struct.zzip_dir = type { i32, i32, i32, %struct.anon, %struct.zzip_dir_hdr*, %struct.zzip_dir_hdr*, %struct.ZZIP_FILE*, %struct.zzip_dirent, i8*, i8*, i8**, %struct.zzip_plugin_io* }
- %struct.zzip_dir_hdr = type { i32, i32, i32, i32, i16, i16, i8, i16, [1 x i8] }
- %struct.zzip_dirent = type { i32, i32, i32, i16, i8*, i32, i32 }
- %struct.zzip_plugin_io = type { i32 (i8*, i32, ...)*, i32 (i32)*, i32 (i32, i8*, i32)*, i64 (i32, i64, i32)*, i64 (i32)*, i32 }
-
-define %struct.ZZIP_FILE* @zzip_open_shared_io(%struct.ZZIP_FILE* %stream, i8* %filename, i32 %o_flags, i32 %o_modes, i8** %ext, %struct.zzip_plugin_io* %io) {
-entry:
- %basename = alloca [1024 x i8], align 16 ; <[1024 x i8]*> [#uses=5]
- %e = alloca i32, align 4 ; <i32*> [#uses=4]
- icmp eq %struct.ZZIP_FILE* %stream, null ; <i1>:0 [#uses=1]
- br i1 %0, label %cond_next22, label %cond_true
-
-cond_true: ; preds = %entry
- %tmp3 = getelementptr %struct.ZZIP_FILE* %stream, i32 0, i32 0 ; <%struct.zzip_dir**> [#uses=1]
- %tmp4 = load %struct.zzip_dir** %tmp3 ; <%struct.zzip_dir*> [#uses=1]
- icmp eq %struct.zzip_dir* %tmp4, null ; <i1>:1 [#uses=1]
- br i1 %1, label %cond_next22, label %cond_true5
-
-cond_true5: ; preds = %cond_true
- icmp eq i8** %ext, null ; <i1>:2 [#uses=1]
- br i1 %2, label %cond_true7, label %cond_next
-
-cond_true7: ; preds = %cond_true5
- %tmp9 = getelementptr %struct.ZZIP_FILE* %stream, i32 0, i32 0 ; <%struct.zzip_dir**> [#uses=1]
- %tmp10 = load %struct.zzip_dir** %tmp9 ; <%struct.zzip_dir*> [#uses=1]
- %tmp11 = getelementptr %struct.zzip_dir* %tmp10, i32 0, i32 10 ; <i8***> [#uses=1]
- %tmp12 = load i8*** %tmp11 ; <i8**> [#uses=1]
- br label %cond_next
-
-cond_next: ; preds = %cond_true7, %cond_true5
- %ext_addr.0 = phi i8** [ %ext, %cond_true5 ], [ %tmp12, %cond_true7 ] ; <i8**> [#uses=2]
- icmp eq %struct.zzip_plugin_io* %io, null ; <i1>:3 [#uses=1]
- br i1 %3, label %cond_true14, label %cond_next22
-
-cond_true14: ; preds = %cond_next
- %tmp16 = getelementptr %struct.ZZIP_FILE* %stream, i32 0, i32 0 ; <%struct.zzip_dir**> [#uses=1]
- %tmp17 = load %struct.zzip_dir** %tmp16 ; <%struct.zzip_dir*> [#uses=1]
- %tmp18 = getelementptr %struct.zzip_dir* %tmp17, i32 0, i32 11 ; <%struct.zzip_plugin_io**> [#uses=1]
- %tmp19 = load %struct.zzip_plugin_io** %tmp18 ; <%struct.zzip_plugin_io*> [#uses=1]
- br label %cond_next22
-
-cond_next22: ; preds = %cond_true14, %cond_next, %cond_true, %entry
- %io_addr.0 = phi %struct.zzip_plugin_io* [ %io, %entry ], [ %io, %cond_true ], [ %io, %cond_next ], [ %tmp19, %cond_true14 ] ; <%struct.zzip_plugin_io*> [#uses=2]
- %ext_addr.1 = phi i8** [ %ext, %entry ], [ %ext, %cond_true ], [ %ext_addr.0, %cond_next ], [ %ext_addr.0, %cond_true14 ] ; <i8**> [#uses=2]
- icmp eq %struct.zzip_plugin_io* %io_addr.0, null ; <i1>:4 [#uses=1]
- br i1 %4, label %cond_true24, label %cond_next26
-
-cond_true24: ; preds = %cond_next22
- %tmp25 = call %struct.zzip_plugin_io* @zzip_get_default_io( ) ; <%struct.zzip_plugin_io*> [#uses=1]
- br label %cond_next26
-
-cond_next26: ; preds = %cond_true24, %cond_next22
- %io_addr.1 = phi %struct.zzip_plugin_io* [ %io_addr.0, %cond_next22 ], [ %tmp25, %cond_true24 ] ; <%struct.zzip_plugin_io*> [#uses=4]
- %tmp28 = and i32 %o_modes, 81920 ; <i32> [#uses=1]
- icmp eq i32 %tmp28, 0 ; <i1>:5 [#uses=1]
- br i1 %5, label %try_real, label %try_zzip
-
-try_real: ; preds = %bb223, %cond_next26
- %fd160.2 = phi i32 [ undef, %cond_next26 ], [ %fd160.0, %bb223 ] ; <i32> [#uses=1]
- %len.2 = phi i32 [ undef, %cond_next26 ], [ %len.0, %bb223 ] ; <i32> [#uses=1]
- %o_flags_addr.1 = phi i32 [ %o_flags, %cond_next26 ], [ %o_flags_addr.0, %bb223 ] ; <i32> [#uses=2]
- %tmp33348 = and i32 %o_modes, 262144 ; <i32> [#uses=1]
- icmp eq i32 %tmp33348, 0 ; <i1>:6 [#uses=1]
- br i1 %6, label %cond_next38, label %cond_true35
-
-cond_true35: ; preds = %try_real
- %tmp36 = call %struct.zzip_plugin_io* @zzip_get_default_io( ) ; <%struct.zzip_plugin_io*> [#uses=1]
- br label %cond_next38
-
-cond_next38: ; preds = %cond_true35, %try_real
- %iftmp.21.0 = phi %struct.zzip_plugin_io* [ %tmp36, %cond_true35 ], [ %io_addr.1, %try_real ] ; <%struct.zzip_plugin_io*> [#uses=3]
- %tmp41 = getelementptr %struct.zzip_plugin_io* %iftmp.21.0, i32 0, i32 0 ; <i32 (i8*, i32, ...)**> [#uses=1]
- %tmp42 = load i32 (i8*, i32, ...)** %tmp41 ; <i32 (i8*, i32, ...)*> [#uses=1]
- %tmp45 = call i32 (i8*, i32, ...)* %tmp42( i8* %filename, i32 %o_flags_addr.1 ) ; <i32> [#uses=3]
- icmp eq i32 %tmp45, -1 ; <i1>:7 [#uses=1]
- br i1 %7, label %cond_next67, label %cond_true47
-
-cond_true47: ; preds = %cond_next38
- %tmp48 = call i8* @cli_calloc( i32 1, i32 108 ) ; <i8*> [#uses=2]
- %tmp4849 = bitcast i8* %tmp48 to %struct.ZZIP_FILE* ; <%struct.ZZIP_FILE*> [#uses=3]
- icmp eq i8* %tmp48, null ; <i1>:8 [#uses=1]
- br i1 %8, label %cond_true51, label %cond_next58
-
-cond_true51: ; preds = %cond_true47
- %tmp53 = getelementptr %struct.zzip_plugin_io* %iftmp.21.0, i32 0, i32 1 ; <i32 (i32)**> [#uses=1]
- %tmp54 = load i32 (i32)** %tmp53 ; <i32 (i32)*> [#uses=1]
- %tmp56 = call i32 %tmp54( i32 %tmp45 ) ; <i32> [#uses=0]
- ret %struct.ZZIP_FILE* null
-
-cond_next58: ; preds = %cond_true47
- %tmp60 = getelementptr %struct.ZZIP_FILE* %tmp4849, i32 0, i32 1 ; <i32*> [#uses=1]
- store i32 %tmp45, i32* %tmp60
- %tmp63 = getelementptr %struct.ZZIP_FILE* %tmp4849, i32 0, i32 11 ; <%struct.zzip_plugin_io**> [#uses=1]
- store %struct.zzip_plugin_io* %iftmp.21.0, %struct.zzip_plugin_io** %tmp63
- ret %struct.ZZIP_FILE* %tmp4849
-
-cond_next67: ; preds = %cond_next38
- %tmp70716 = and i32 %o_modes, 16384 ; <i32> [#uses=1]
- icmp eq i32 %tmp70716, 0 ; <i1>:9 [#uses=1]
- br i1 %9, label %try_zzip, label %return
-
-try_zzip: ; preds = %cond_next67, %cond_next26
- %fd160.3 = phi i32 [ %fd160.2, %cond_next67 ], [ undef, %cond_next26 ] ; <i32> [#uses=6]
- %len.3 = phi i32 [ %len.2, %cond_next67 ], [ undef, %cond_next26 ] ; <i32> [#uses=3]
- %o_flags_addr.3 = phi i32 [ %o_flags_addr.1, %cond_next67 ], [ %o_flags, %cond_next26 ] ; <i32> [#uses=4]
- %tmp76 = and i32 %o_flags_addr.3, 513 ; <i32> [#uses=1]
- icmp eq i32 %tmp76, 0 ; <i1>:10 [#uses=1]
- br i1 %10, label %cond_next80, label %cond_true77
-
-cond_true77: ; preds = %try_zzip
- %tmp78 = call i32* @__error( ) ; <i32*> [#uses=1]
- store i32 22, i32* %tmp78
- ret %struct.ZZIP_FILE* null
-
-cond_next80: ; preds = %try_zzip
- %tmp83844 = and i32 %o_flags_addr.3, 2 ; <i32> [#uses=1]
- icmp eq i32 %tmp83844, 0 ; <i1>:11 [#uses=1]
- %tmp87 = xor i32 %o_flags_addr.3, 2 ; <i32> [#uses=1]
- %o_flags_addr.0 = select i1 %11, i32 %o_flags_addr.3, i32 %tmp87 ; <i32> [#uses=2]
- %basename90 = getelementptr [1024 x i8]* %basename, i32 0, i32 0 ; <i8*> [#uses=1]
- %tmp92 = call i8* @strcpy( i8* %basename90, i8* %filename ) ; <i8*> [#uses=0]
- icmp eq %struct.ZZIP_FILE* %stream, null ; <i1>:12 [#uses=1]
- br i1 %12, label %bb219, label %cond_true94
-
-cond_true94: ; preds = %cond_next80
- %tmp96 = getelementptr %struct.ZZIP_FILE* %stream, i32 0, i32 0 ; <%struct.zzip_dir**> [#uses=1]
- %tmp97 = load %struct.zzip_dir** %tmp96 ; <%struct.zzip_dir*> [#uses=1]
- icmp eq %struct.zzip_dir* %tmp97, null ; <i1>:13 [#uses=1]
- br i1 %13, label %bb219, label %cond_true98
-
-cond_true98: ; preds = %cond_true94
- %tmp100 = getelementptr %struct.ZZIP_FILE* %stream, i32 0, i32 0 ; <%struct.zzip_dir**> [#uses=1]
- %tmp101 = load %struct.zzip_dir** %tmp100 ; <%struct.zzip_dir*> [#uses=1]
- %tmp102 = getelementptr %struct.zzip_dir* %tmp101, i32 0, i32 9 ; <i8**> [#uses=1]
- %tmp103 = load i8** %tmp102 ; <i8*> [#uses=1]
- icmp eq i8* %tmp103, null ; <i1>:14 [#uses=1]
- br i1 %14, label %bb219, label %cond_true104
-
-cond_true104: ; preds = %cond_true98
- %tmp106 = getelementptr %struct.ZZIP_FILE* %stream, i32 0, i32 0 ; <%struct.zzip_dir**> [#uses=1]
- %tmp107 = load %struct.zzip_dir** %tmp106 ; <%struct.zzip_dir*> [#uses=1]
- %tmp108 = getelementptr %struct.zzip_dir* %tmp107, i32 0, i32 9 ; <i8**> [#uses=1]
- %tmp109 = load i8** %tmp108 ; <i8*> [#uses=1]
- %tmp110 = call i32 @strlen( i8* %tmp109 ) ; <i32> [#uses=7]
- %tmp112 = getelementptr %struct.ZZIP_FILE* %stream, i32 0, i32 0 ; <%struct.zzip_dir**> [#uses=1]
- %tmp113 = load %struct.zzip_dir** %tmp112 ; <%struct.zzip_dir*> [#uses=1]
- %tmp114 = getelementptr %struct.zzip_dir* %tmp113, i32 0, i32 9 ; <i8**> [#uses=1]
- %tmp115 = load i8** %tmp114 ; <i8*> [#uses=1]
- %tmp118 = call i32 @memcmp( i8* %filename, i8* %tmp115, i32 %tmp110 ) ; <i32> [#uses=1]
- icmp eq i32 %tmp118, 0 ; <i1>:15 [#uses=1]
- br i1 %15, label %cond_true119, label %bb219
-
-cond_true119: ; preds = %cond_true104
- %tmp122 = getelementptr i8* %filename, i32 %tmp110 ; <i8*> [#uses=1]
- %tmp123 = load i8* %tmp122 ; <i8> [#uses=1]
- icmp eq i8 %tmp123, 47 ; <i1>:16 [#uses=1]
- br i1 %16, label %cond_true124, label %bb219
-
-cond_true124: ; preds = %cond_true119
- %tmp126 = add i32 %tmp110, 1 ; <i32> [#uses=1]
- %tmp128 = getelementptr i8* %filename, i32 %tmp126 ; <i8*> [#uses=1]
- %tmp129 = load i8* %tmp128 ; <i8> [#uses=1]
- icmp eq i8 %tmp129, 0 ; <i1>:17 [#uses=1]
- br i1 %17, label %bb219, label %cond_true130
-
-cond_true130: ; preds = %cond_true124
- %tmp134.sum = add i32 %tmp110, 1 ; <i32> [#uses=1]
- %tmp135 = getelementptr i8* %filename, i32 %tmp134.sum ; <i8*> [#uses=1]
- %tmp137 = getelementptr %struct.ZZIP_FILE* %stream, i32 0, i32 0 ; <%struct.zzip_dir**> [#uses=1]
- %tmp138 = load %struct.zzip_dir** %tmp137 ; <%struct.zzip_dir*> [#uses=1]
- %tmp140 = call %struct.ZZIP_FILE* @zzip_file_open( %struct.zzip_dir* %tmp138, i8* %tmp135, i32 %o_modes, i32 -1 ) ; <%struct.ZZIP_FILE*> [#uses=3]
- icmp eq %struct.ZZIP_FILE* %tmp140, null ; <i1>:18 [#uses=1]
- br i1 %18, label %cond_true142, label %return
-
-cond_true142: ; preds = %cond_true130
- %tmp144 = getelementptr %struct.ZZIP_FILE* %stream, i32 0, i32 0 ; <%struct.zzip_dir**> [#uses=1]
- %tmp145 = load %struct.zzip_dir** %tmp144 ; <%struct.zzip_dir*> [#uses=1]
- %tmp146 = getelementptr %struct.zzip_dir* %tmp145, i32 0, i32 1 ; <i32*> [#uses=1]
- %tmp147 = load i32* %tmp146 ; <i32> [#uses=1]
- %tmp148 = call i32 @zzip_errno( i32 %tmp147 ) ; <i32> [#uses=1]
- %tmp149 = call i32* @__error( ) ; <i32*> [#uses=1]
- store i32 %tmp148, i32* %tmp149
- ret %struct.ZZIP_FILE* %tmp140
-
-bb: ; preds = %bb219
- store i32 0, i32* %e
- store i8 0, i8* %tmp221
- %basename162 = getelementptr [1024 x i8]* %basename, i32 0, i32 0 ; <i8*> [#uses=1]
- %tmp166 = call i32 @__zzip_try_open( i8* %basename162, i32 %o_flags_addr.0, i8** %ext_addr.1, %struct.zzip_plugin_io* %io_addr.1 ) ; <i32> [#uses=4]
- icmp eq i32 %tmp166, -1 ; <i1>:19 [#uses=1]
- br i1 %19, label %bb219, label %cond_next169
-
-cond_next169: ; preds = %bb
- %tmp173 = call %struct.zzip_dir* @zzip_dir_fdopen_ext_io( i32 %tmp166, i32* %e, i8** %ext_addr.1, %struct.zzip_plugin_io* %io_addr.1 ) ; <%struct.zzip_dir*> [#uses=7]
- %tmp174 = load i32* %e ; <i32> [#uses=1]
- icmp eq i32 %tmp174, 0 ; <i1>:20 [#uses=1]
- br i1 %20, label %cond_next185, label %cond_true175
-
-cond_true175: ; preds = %cond_next169
- %tmp176 = load i32* %e ; <i32> [#uses=1]
- %tmp177 = call i32 @zzip_errno( i32 %tmp176 ) ; <i32> [#uses=1]
- %tmp178 = call i32* @__error( ) ; <i32*> [#uses=1]
- store i32 %tmp177, i32* %tmp178
- %tmp180 = getelementptr %struct.zzip_plugin_io* %io_addr.1, i32 0, i32 1 ; <i32 (i32)**> [#uses=1]
- %tmp181 = load i32 (i32)** %tmp180 ; <i32 (i32)*> [#uses=1]
- %tmp183 = call i32 %tmp181( i32 %tmp166 ) ; <i32> [#uses=0]
- ret %struct.ZZIP_FILE* null
-
-cond_next185: ; preds = %cond_next169
- %tmp186187 = ptrtoint i8* %tmp221 to i32 ; <i32> [#uses=1]
- %basename188189 = ptrtoint [1024 x i8]* %basename to i32 ; <i32> [#uses=1]
- %tmp190 = sub i32 %tmp186187, %basename188189 ; <i32> [#uses=1]
- %tmp192.sum = add i32 %tmp190, 1 ; <i32> [#uses=1]
- %tmp193 = getelementptr i8* %filename, i32 %tmp192.sum ; <i8*> [#uses=1]
- %tmp196 = call %struct.ZZIP_FILE* @zzip_file_open( %struct.zzip_dir* %tmp173, i8* %tmp193, i32 %o_modes, i32 -1 ) ; <%struct.ZZIP_FILE*> [#uses=4]
- icmp eq %struct.ZZIP_FILE* %tmp196, null ; <i1>:21 [#uses=1]
- br i1 %21, label %cond_true198, label %cond_false204
-
-cond_true198: ; preds = %cond_next185
- %tmp200 = getelementptr %struct.zzip_dir* %tmp173, i32 0, i32 1 ; <i32*> [#uses=1]
- %tmp201 = load i32* %tmp200 ; <i32> [#uses=1]
- %tmp202 = call i32 @zzip_errno( i32 %tmp201 ) ; <i32> [#uses=1]
- %tmp203 = call i32* @__error( ) ; <i32*> [#uses=1]
- store i32 %tmp202, i32* %tmp203
- %tmp2169 = call i32 @zzip_dir_close( %struct.zzip_dir* %tmp173 ) ; <i32> [#uses=0]
- ret %struct.ZZIP_FILE* %tmp196
-
-cond_false204: ; preds = %cond_next185
- %tmp206 = getelementptr %struct.zzip_dir* %tmp173, i32 0, i32 9 ; <i8**> [#uses=1]
- %tmp207 = load i8** %tmp206 ; <i8*> [#uses=1]
- icmp eq i8* %tmp207, null ; <i1>:22 [#uses=1]
- br i1 %22, label %cond_true208, label %cond_next214
-
-cond_true208: ; preds = %cond_false204
- %basename209 = getelementptr [1024 x i8]* %basename, i32 0, i32 0 ; <i8*> [#uses=1]
- %tmp210 = call i8* @strdup( i8* %basename209 ) ; <i8*> [#uses=1]
- %tmp212 = getelementptr %struct.zzip_dir* %tmp173, i32 0, i32 9 ; <i8**> [#uses=1]
- store i8* %tmp210, i8** %tmp212
- %tmp21610 = call i32 @zzip_dir_close( %struct.zzip_dir* %tmp173 ) ; <i32> [#uses=0]
- ret %struct.ZZIP_FILE* %tmp196
-
-cond_next214: ; preds = %cond_false204
- %tmp216 = call i32 @zzip_dir_close( %struct.zzip_dir* %tmp173 ) ; <i32> [#uses=0]
- ret %struct.ZZIP_FILE* %tmp196
-
-bb219: ; preds = %bb, %cond_true124, %cond_true119, %cond_true104, %cond_true98, %cond_true94, %cond_next80
- %fd160.0 = phi i32 [ %fd160.3, %cond_next80 ], [ %tmp166, %bb ], [ %fd160.3, %cond_true94 ], [ %fd160.3, %cond_true98 ], [ %fd160.3, %cond_true104 ], [ %fd160.3, %cond_true119 ], [ %fd160.3, %cond_true124 ] ; <i32> [#uses=1]
- %len.0 = phi i32 [ %len.3, %cond_next80 ], [ %len.0, %bb ], [ %len.3, %cond_true94 ], [ %len.3, %cond_true98 ], [ %tmp110, %cond_true104 ], [ %tmp110, %cond_true119 ], [ %tmp110, %cond_true124 ] ; <i32> [#uses=2]
- %basename220 = getelementptr [1024 x i8]* %basename, i32 0, i32 0 ; <i8*> [#uses=1]
- %tmp221 = call i8* @strrchr( i8* %basename220, i32 47 ) ; <i8*> [#uses=3]
- icmp eq i8* %tmp221, null ; <i1>:23 [#uses=1]
- br i1 %23, label %bb223, label %bb
-
-bb223: ; preds = %bb219
- %tmp2262272 = and i32 %o_modes, 16384 ; <i32> [#uses=1]
- icmp eq i32 %tmp2262272, 0 ; <i1>:24 [#uses=1]
- br i1 %24, label %cond_next229, label %try_real
-
-cond_next229: ; preds = %bb223
- %tmp230 = call i32* @__error( ) ; <i32*> [#uses=1]
- store i32 2, i32* %tmp230
- ret %struct.ZZIP_FILE* null
-
-return: ; preds = %cond_true130, %cond_next67
- %retval.0 = phi %struct.ZZIP_FILE* [ null, %cond_next67 ], [ %tmp140, %cond_true130 ] ; <%struct.ZZIP_FILE*> [#uses=1]
- ret %struct.ZZIP_FILE* %retval.0
-}
-
-declare i32 @zzip_dir_close(%struct.zzip_dir*)
-
-declare i8* @strrchr(i8*, i32)
-
-declare %struct.ZZIP_FILE* @zzip_file_open(%struct.zzip_dir*, i8*, i32, i32)
-
-declare i8* @cli_calloc(i32, i32)
-
-declare i32 @zzip_errno(i32)
-
-declare i32* @__error()
-
-declare %struct.zzip_plugin_io* @zzip_get_default_io()
-
-declare i8* @strcpy(i8*, i8*)
-
-declare i32 @strlen(i8*)
-
-declare i32 @memcmp(i8*, i8*, i32)
-
-declare i32 @__zzip_try_open(i8*, i32, i8**, %struct.zzip_plugin_io*)
-
-declare %struct.zzip_dir* @zzip_dir_fdopen_ext_io(i32, i32*, i8**, %struct.zzip_plugin_io*)
-
-declare i8* @strdup(i8*)
diff --git a/release_23/test/Transforms/InstCombine/2007-04-04-BadFoldBitcastIntoMalloc.ll b/release_23/test/Transforms/InstCombine/2007-04-04-BadFoldBitcastIntoMalloc.ll
deleted file mode 100644
index e738635be763..000000000000
--- a/release_23/test/Transforms/InstCombine/2007-04-04-BadFoldBitcastIntoMalloc.ll
+++ /dev/null
@@ -1,19 +0,0 @@
-; In the presence of a negative offset (the -8 below), a fold of a bitcast into
-; a malloc messes up the element count, causing an extra 4GB to be allocated on
-; 64-bit targets.
-;
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep {= add }
-
-target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64"
-target triple = "x86_64-unknown-freebsd6.2"
-
-define i1 @test(i32 %tmp141, double** %tmp145)
-{
- %tmp133 = add i32 %tmp141, 1
- %tmp134 = shl i32 %tmp133, 3
- %tmp135 = add i32 %tmp134, -8
- %tmp136 = malloc i8, i32 %tmp135
- %tmp137 = bitcast i8* %tmp136 to double*
- store double* %tmp137, double** %tmp145
- ret i1 false
-}
diff --git a/release_23/test/Transforms/InstCombine/2007-04-08-SingleEltVectorCrash.ll b/release_23/test/Transforms/InstCombine/2007-04-08-SingleEltVectorCrash.ll
deleted file mode 100644
index 34322a2788a2..000000000000
--- a/release_23/test/Transforms/InstCombine/2007-04-08-SingleEltVectorCrash.ll
+++ /dev/null
@@ -1,7 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine -disable-output
-; PR1304
-
-define i64 @bork(<1 x i64> %vec) {
- %tmp = extractelement <1 x i64> %vec, i32 0
- ret i64 %tmp
-}
diff --git a/release_23/test/Transforms/InstCombine/2007-05-04-Crash.ll b/release_23/test/Transforms/InstCombine/2007-05-04-Crash.ll
deleted file mode 100644
index 5ad791933574..000000000000
--- a/release_23/test/Transforms/InstCombine/2007-05-04-Crash.ll
+++ /dev/null
@@ -1,30 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine -disable-output
-; PR1384
-
-target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64"
-target triple = "i686-apple-darwin8"
- %struct.CFRuntimeBase = type { i32, [4 x i8] }
- %struct.CGColor = type opaque
- %struct.CGColorSpace = type { %struct.CFRuntimeBase, i8, i8, i8, i32, i32, i32, %struct.CGColor*, float*, %struct.CGMD5Signature, %struct.CGMD5Signature*, [0 x %struct.CGColorSpaceDescriptor] }
- %struct.CGColorSpaceCalibratedRGBData = type { [3 x float], [3 x float], [3 x float], [9 x float] }
- %struct.CGColorSpaceDescriptor = type { %struct.CGColorSpaceCalibratedRGBData }
- %struct.CGColorSpaceLabData = type { [3 x float], [3 x float], [4 x float] }
- %struct.CGMD5Signature = type { [16 x i8], i8 }
-
-declare fastcc %struct.CGColorSpace* @CGColorSpaceCreate(i32, i32)
-
-declare void @llvm.memcpy.i32(i8*, i8*, i32, i32)
-
-define %struct.CGColorSpace* @CGColorSpaceCreateLab(float* %whitePoint, float* %blackPoint, float* %range) {
-entry:
- %tmp17 = call fastcc %struct.CGColorSpace* @CGColorSpaceCreate( i32 5, i32 3 ) ; <%struct.CGColorSpace*> [#uses=2]
- %tmp28 = getelementptr %struct.CGColorSpace* %tmp17, i32 0, i32 11 ; <[0 x %struct.CGColorSpaceDescriptor]*> [#uses=1]
- %tmp29 = getelementptr [0 x %struct.CGColorSpaceDescriptor]* %tmp28, i32 0, i32 0 ; <%struct.CGColorSpaceDescriptor*> [#uses=1]
- %tmp30 = getelementptr %struct.CGColorSpaceDescriptor* %tmp29, i32 0, i32 0 ; <%struct.CGColorSpaceCalibratedRGBData*> [#uses=1]
- %tmp3031 = bitcast %struct.CGColorSpaceCalibratedRGBData* %tmp30 to %struct.CGColorSpaceLabData* ; <%struct.CGColorSpaceLabData*> [#uses=1]
- %tmp45 = getelementptr %struct.CGColorSpaceLabData* %tmp3031, i32 0, i32 2 ; <[4 x float]*> [#uses=1]
- %tmp46 = getelementptr [4 x float]* %tmp45, i32 0, i32 0 ; <float*> [#uses=1]
- %tmp4648 = bitcast float* %tmp46 to i8* ; <i8*> [#uses=1]
- call void @llvm.memcpy.i32( i8* %tmp4648, i8* null, i32 16, i32 4 )
- ret %struct.CGColorSpace* %tmp17
-}
diff --git a/release_23/test/Transforms/InstCombine/2007-05-10-icmp-or.ll b/release_23/test/Transforms/InstCombine/2007-05-10-icmp-or.ll
deleted file mode 100644
index 8769ded67b8e..000000000000
--- a/release_23/test/Transforms/InstCombine/2007-05-10-icmp-or.ll
+++ /dev/null
@@ -1,8 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine -disable-output
-define i1 @test(i32 %tmp9) {
- %tmp20 = icmp ugt i32 %tmp9, 255 ; <i1> [#uses=1]
- %tmp11.not = icmp sgt i32 %tmp9, 255 ; <i1> [#uses=1]
- %bothcond = or i1 %tmp20, %tmp11.not ; <i1> [#uses=1]
- ret i1 %bothcond
-}
-
diff --git a/release_23/test/Transforms/InstCombine/2007-05-14-Crash.ll b/release_23/test/Transforms/InstCombine/2007-05-14-Crash.ll
deleted file mode 100644
index ececd350dba9..000000000000
--- a/release_23/test/Transforms/InstCombine/2007-05-14-Crash.ll
+++ /dev/null
@@ -1,18 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine -disable-output
-
-target datalayout = "E-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64"
-target triple = "powerpc-apple-darwin8.8.0"
-
-%struct.abc = type { i32, [32 x i8] }
-%struct.def = type { i8**, %struct.abc }
- %struct.anon = type <{ }>
-
-define i8* @foo(%struct.anon* %deviceRef, %struct.abc* %pCap) {
-entry:
- %tmp1 = bitcast %struct.anon* %deviceRef to %struct.def*
- %tmp3 = getelementptr %struct.def* %tmp1, i32 0, i32 1
- %tmp35 = bitcast %struct.abc* %tmp3 to i8*
- ret i8* %tmp35
-}
-
-
diff --git a/release_23/test/Transforms/InstCombine/2007-05-18-CastFoldBug.ll b/release_23/test/Transforms/InstCombine/2007-05-18-CastFoldBug.ll
deleted file mode 100644
index 55bfac581faf..000000000000
--- a/release_23/test/Transforms/InstCombine/2007-05-18-CastFoldBug.ll
+++ /dev/null
@@ -1,10 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {call.*sret}
-; Make sure instcombine doesn't drop the sret attribute.
-
-define void @blah(i16* %tmp10) {
-entry:
- call void bitcast (i8* (i8*, i8*, ...)* @objc_msgSend_stret to void (i16* sret )*)( i16* %tmp10 sret )
- ret void
-}
-
-declare i8* @objc_msgSend_stret(i8*, i8*, ...)
diff --git a/release_23/test/Transforms/InstCombine/2007-06-06-AshrSignBit.ll b/release_23/test/Transforms/InstCombine/2007-06-06-AshrSignBit.ll
deleted file mode 100644
index 482c60869600..000000000000
--- a/release_23/test/Transforms/InstCombine/2007-06-06-AshrSignBit.ll
+++ /dev/null
@@ -1,22 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {ashr}
-; PR1499
-
-define void @av_cmp_q_cond_true(i32* %retval, i32* %tmp9, i64* %tmp10) {
-newFuncRoot:
- br label %cond_true
-
-return.exitStub: ; preds = %cond_true
- ret void
-
-cond_true: ; preds = %newFuncRoot
- %tmp30 = load i64* %tmp10 ; <i64> [#uses=1]
- %.cast = zext i32 63 to i64 ; <i64> [#uses=1]
- %tmp31 = ashr i64 %tmp30, %.cast ; <i64> [#uses=1]
- %tmp3132 = trunc i64 %tmp31 to i32 ; <i32> [#uses=1]
- %tmp33 = or i32 %tmp3132, 1 ; <i32> [#uses=1]
- store i32 %tmp33, i32* %tmp9
- %tmp34 = load i32* %tmp9 ; <i32> [#uses=1]
- store i32 %tmp34, i32* %retval
- br label %return.exitStub
-}
-
diff --git a/release_23/test/Transforms/InstCombine/2007-06-21-DivCompareMiscomp.ll b/release_23/test/Transforms/InstCombine/2007-06-21-DivCompareMiscomp.ll
deleted file mode 100644
index ffc402650262..000000000000
--- a/release_23/test/Transforms/InstCombine/2007-06-21-DivCompareMiscomp.ll
+++ /dev/null
@@ -1,9 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {ret i1 true}
-; rdar://5278853
-
-define i1 @test(i32 %tmp468) {
- %tmp470 = udiv i32 %tmp468, 4 ; <i32> [#uses=2]
- %tmp475 = icmp ult i32 %tmp470, 1073741824 ; <i1> [#uses=1]
- ret i1 %tmp475
-}
-
diff --git a/release_23/test/Transforms/InstCombine/2007-08-02-InfiniteLoop.ll b/release_23/test/Transforms/InstCombine/2007-08-02-InfiniteLoop.ll
deleted file mode 100644
index 988599ba3f95..000000000000
--- a/release_23/test/Transforms/InstCombine/2007-08-02-InfiniteLoop.ll
+++ /dev/null
@@ -1,10 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine -disable-output
-; PR1594
-
-define i64 @test(i16 %tmp510, i16 %tmp512) {
- %W = sext i16 %tmp510 to i32 ; <i32> [#uses=1]
- %X = sext i16 %tmp512 to i32 ; <i32> [#uses=1]
- %Y = add i32 %W, %X ; <i32> [#uses=1]
- %Z = sext i32 %Y to i64 ; <i64> [#uses=1]
- ret i64 %Z
-}
diff --git a/release_23/test/Transforms/InstCombine/2007-09-05-EqualGEP.ll b/release_23/test/Transforms/InstCombine/2007-09-05-EqualGEP.ll
deleted file mode 100644
index 77bae78ccd47..000000000000
--- a/release_23/test/Transforms/InstCombine/2007-09-05-EqualGEP.ll
+++ /dev/null
@@ -1,10 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {ret i1 true}
-; PR1637
-
-define i1 @f(i8* %arr) {
- %X = getelementptr i8* %arr, i32 1
- %Y = getelementptr i8* %arr, i32 1
- %test = icmp uge i8* %X, %Y
- ret i1 %test
-}
-
diff --git a/release_23/test/Transforms/InstCombine/2007-09-10-AliasConstFold.ll b/release_23/test/Transforms/InstCombine/2007-09-10-AliasConstFold.ll
deleted file mode 100644
index 2dcb43926ba8..000000000000
--- a/release_23/test/Transforms/InstCombine/2007-09-10-AliasConstFold.ll
+++ /dev/null
@@ -1,13 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep icmp
-; PR1646
-
-@__gthrw_pthread_cancel = alias weak i32 (i32)* @pthread_cancel ; <i32 (i32)*> [#uses=1]
-@__gthread_active_ptr.5335 = internal constant i8* bitcast (i32 (i32)* @__gthrw_pthread_cancel to i8*) ; <i8**> [#uses=1]
-declare extern_weak i32 @pthread_cancel(i32)
-
-define i1 @__gthread_active_p() {
-entry:
- %tmp1 = load i8** @__gthread_active_ptr.5335, align 4 ; <i8*> [#uses=1]
- %tmp2 = icmp ne i8* %tmp1, null ; <i1> [#uses=1]
- ret i1 %tmp2
-}
diff --git a/release_23/test/Transforms/InstCombine/2007-09-11-Trampoline.ll b/release_23/test/Transforms/InstCombine/2007-09-11-Trampoline.ll
deleted file mode 100644
index c022e571e11f..000000000000
--- a/release_23/test/Transforms/InstCombine/2007-09-11-Trampoline.ll
+++ /dev/null
@@ -1,24 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {call i32 @f}
-
- %struct.FRAME.nest = type { i32, i32 (i32)* }
- %struct.__builtin_trampoline = type { [10 x i8] }
-
-declare i8* @llvm.init.trampoline(i8*, i8*, i8*)
-
-declare i32 @f(%struct.FRAME.nest* nest , i32 )
-
-define i32 @nest(i32 %n) {
-entry:
- %FRAME.0 = alloca %struct.FRAME.nest, align 8 ; <%struct.FRAME.nest*> [#uses=3]
- %TRAMP.216 = alloca [10 x i8], align 16 ; <[10 x i8]*> [#uses=1]
- %TRAMP.216.sub = getelementptr [10 x i8]* %TRAMP.216, i32 0, i32 0 ; <i8*> [#uses=1]
- %tmp3 = getelementptr %struct.FRAME.nest* %FRAME.0, i32 0, i32 0 ; <i32*> [#uses=1]
- store i32 %n, i32* %tmp3, align 8
- %FRAME.06 = bitcast %struct.FRAME.nest* %FRAME.0 to i8* ; <i8*> [#uses=1]
- %tramp = call i8* @llvm.init.trampoline( i8* %TRAMP.216.sub, i8* bitcast (i32 (%struct.FRAME.nest* nest , i32)* @f to i8*), i8* %FRAME.06 ) ; <i8*> [#uses=1]
- %tmp7 = getelementptr %struct.FRAME.nest* %FRAME.0, i32 0, i32 1 ; <i32 (i32)**> [#uses=1]
- %tmp89 = bitcast i8* %tramp to i32 (i32)* ; <i32 (i32)*> [#uses=2]
- store i32 (i32)* %tmp89, i32 (i32)** %tmp7, align 8
- %tmp2.i = call i32 %tmp89( i32 1 ) ; <i32> [#uses=1]
- ret i32 %tmp2.i
-}
diff --git a/release_23/test/Transforms/InstCombine/2007-09-17-AliasConstFold2.ll b/release_23/test/Transforms/InstCombine/2007-09-17-AliasConstFold2.ll
deleted file mode 100644
index 300edd5e56ee..000000000000
--- a/release_23/test/Transforms/InstCombine/2007-09-17-AliasConstFold2.ll
+++ /dev/null
@@ -1,14 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep icmp
-; PR1678
-
-@A = alias weak void ()* @B ; <void ()*> [#uses=1]
-
-declare extern_weak void @B()
-
-define i32 @active() {
-entry:
- %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
- %tmp1 = icmp ne void ()* @A, null ; <i1> [#uses=1]
- %tmp12 = zext i1 %tmp1 to i32 ; <i32> [#uses=1]
- ret i32 %tmp12
-}
diff --git a/release_23/test/Transforms/InstCombine/2007-10-10-EliminateMemCpy.ll b/release_23/test/Transforms/InstCombine/2007-10-10-EliminateMemCpy.ll
deleted file mode 100644
index 6d251b12cf4f..000000000000
--- a/release_23/test/Transforms/InstCombine/2007-10-10-EliminateMemCpy.ll
+++ /dev/null
@@ -1,20 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep call
-; RUN: llvm-as < %s | opt -std-compile-opts | llvm-dis | not grep xyz
-
-@.str = internal constant [4 x i8] c"xyz\00" ; <[4 x i8]*> [#uses=1]
-
-define void @foo(i8* %P) {
-entry:
- %P_addr = alloca i8* ; <i8**> [#uses=2]
- %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
- store i8* %P, i8** %P_addr
- %tmp = load i8** %P_addr, align 4 ; <i8*> [#uses=1]
- %tmp1 = getelementptr [4 x i8]* @.str, i32 0, i32 0 ; <i8*> [#uses=1]
- call void @llvm.memcpy.i32( i8* %tmp, i8* %tmp1, i32 4, i32 1 )
- br label %return
-
-return: ; preds = %entry
- ret void
-}
-
-declare void @llvm.memcpy.i32(i8*, i8*, i32, i32)
diff --git a/release_23/test/Transforms/InstCombine/2007-10-12-Crash.ll b/release_23/test/Transforms/InstCombine/2007-10-12-Crash.ll
deleted file mode 100644
index ed98fcdb9cae..000000000000
--- a/release_23/test/Transforms/InstCombine/2007-10-12-Crash.ll
+++ /dev/null
@@ -1,38 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine -disable-output
-
- %struct.Ray = type { %struct.Vec, %struct.Vec }
- %struct.Scene = type { i32 (...)** }
- %struct.Vec = type { double, double, double }
-
-declare double @_Z9ray_traceRK3VecRK3RayRK5Scene(%struct.Vec*, %struct.Ray*, %struct.Scene*)
-
-define i32 @main(i32 %argc, i8** %argv) {
-entry:
- %tmp3 = alloca %struct.Ray, align 4 ; <%struct.Ray*> [#uses=2]
- %tmp97 = icmp slt i32 0, 512 ; <i1> [#uses=1]
- br i1 %tmp97, label %bb71, label %bb108
-
-bb29: ; preds = %bb62
- %tmp322 = bitcast %struct.Ray* %tmp3 to %struct.Vec* ; <%struct.Vec*> [#uses=1]
- %tmp322.0 = getelementptr %struct.Vec* %tmp322, i32 0, i32 0 ; <double*> [#uses=1]
- store double 0.000000e+00, double* %tmp322.0
- %tmp57 = call double @_Z9ray_traceRK3VecRK3RayRK5Scene( %struct.Vec* null, %struct.Ray* %tmp3, %struct.Scene* null ) ; <double> [#uses=0]
- br label %bb62
-
-bb62: ; preds = %bb71, %bb29
- %tmp65 = icmp slt i32 0, 4 ; <i1> [#uses=1]
- br i1 %tmp65, label %bb29, label %bb68
-
-bb68: ; preds = %bb62
- ret i32 0
-
-bb71: ; preds = %entry
- %tmp74 = icmp slt i32 0, 4 ; <i1> [#uses=1]
- br i1 %tmp74, label %bb62, label %bb77
-
-bb77: ; preds = %bb71
- ret i32 0
-
-bb108: ; preds = %entry
- ret i32 0
-}
diff --git a/release_23/test/Transforms/InstCombine/2007-10-28-EmptyField.ll b/release_23/test/Transforms/InstCombine/2007-10-28-EmptyField.ll
deleted file mode 100644
index 31ae985a6dd1..000000000000
--- a/release_23/test/Transforms/InstCombine/2007-10-28-EmptyField.ll
+++ /dev/null
@@ -1,24 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine -disable-output
-; PR1749
-
-target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128"
-target triple = "x86_64-unknown-linux-gnu"
- %struct.__large_struct = type { [100 x i64] }
- %struct.compat_siginfo = type { i32, i32, i32, { [29 x i32] } }
- %struct.siginfo_t = type { i32, i32, i32, { { i32, i32, [0 x i8], %struct.sigval_t, i32 }, [88 x i8] } }
- %struct.sigval_t = type { i8* }
-
-define i32 @copy_siginfo_to_user32(%struct.compat_siginfo* %to, %struct.siginfo_t* %from) {
-entry:
- %from_addr = alloca %struct.siginfo_t* ; <%struct.siginfo_t**> [#uses=1]
- %tmp344 = load %struct.siginfo_t** %from_addr, align 8 ; <%struct.siginfo_t*> [#uses=1]
- %tmp345 = getelementptr %struct.siginfo_t* %tmp344, i32 0, i32 3 ; <{ { i32, i32, [0 x i8], %struct.sigval_t, i32 }, [88 x i8] }*> [#uses=1]
- %tmp346 = getelementptr { { i32, i32, [0 x i8], %struct.sigval_t, i32 }, [88 x i8] }* %tmp345, i32 0, i32 0 ; <{ i32, i32, [0 x i8], %struct.sigval_t, i32 }*> [#uses=1]
- %tmp346347 = bitcast { i32, i32, [0 x i8], %struct.sigval_t, i32 }* %tmp346 to { i32, i32, %struct.sigval_t }* ; <{ i32, i32, %struct.sigval_t }*> [#uses=1]
- %tmp348 = getelementptr { i32, i32, %struct.sigval_t }* %tmp346347, i32 0, i32 2 ; <%struct.sigval_t*> [#uses=1]
- %tmp349 = getelementptr %struct.sigval_t* %tmp348, i32 0, i32 0 ; <i8**> [#uses=1]
- %tmp349350 = bitcast i8** %tmp349 to i32* ; <i32*> [#uses=1]
- %tmp351 = load i32* %tmp349350, align 8 ; <i32> [#uses=1]
- %tmp360 = call i32 asm sideeffect "1:\09movl ${1:k},$2\0A2:\0A.section .fixup,\22ax\22\0A3:\09mov $3,$0\0A\09jmp 2b\0A.previous\0A.section __ex_table,\22a\22\0A\09.align 8\0A\09.quad 1b,3b\0A.previous", "=r,ir,*m,i,0,~{dirflag},~{fpsr},~{flags}"( i32 %tmp351, %struct.__large_struct* null, i32 -14, i32 0 ) ; <i32> [#uses=0]
- unreachable
-}
diff --git a/release_23/test/Transforms/InstCombine/2007-10-28-stacksave.ll b/release_23/test/Transforms/InstCombine/2007-10-28-stacksave.ll
deleted file mode 100644
index 5f884d4a7812..000000000000
--- a/release_23/test/Transforms/InstCombine/2007-10-28-stacksave.ll
+++ /dev/null
@@ -1,47 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {call.*stacksave}
-; PR1745
-target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
-target triple = "i686-apple-darwin8"
-@p = weak global i8* null ; <i8**> [#uses=1]
-
-define i32 @main() {
-entry:
- %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
- br label %lab
-
-lab: ; preds = %cleanup31, %entry
- %n.0 = phi i32 [ 0, %entry ], [ %tmp25, %cleanup31 ] ; <i32> [#uses=2]
- %tmp2 = call i8* @llvm.stacksave( ) ; <i8*> [#uses=2]
- %tmp4 = srem i32 %n.0, 47 ; <i32> [#uses=1]
- %tmp5 = add i32 %tmp4, 1 ; <i32> [#uses=5]
- %tmp7 = sub i32 %tmp5, 1 ; <i32> [#uses=0]
- %tmp89 = zext i32 %tmp5 to i64 ; <i64> [#uses=1]
- %tmp10 = mul i64 %tmp89, 32 ; <i64> [#uses=0]
- %tmp12 = mul i32 %tmp5, 4 ; <i32> [#uses=0]
- %tmp1314 = zext i32 %tmp5 to i64 ; <i64> [#uses=1]
- %tmp15 = mul i64 %tmp1314, 32 ; <i64> [#uses=0]
- %tmp17 = mul i32 %tmp5, 4 ; <i32> [#uses=1]
- %tmp18 = alloca i8, i32 %tmp17 ; <i8*> [#uses=1]
- %tmp1819 = bitcast i8* %tmp18 to i32* ; <i32*> [#uses=2]
- %tmp21 = getelementptr i32* %tmp1819, i32 0 ; <i32*> [#uses=1]
- store i32 1, i32* %tmp21, align 4
- %tmp2223 = bitcast i32* %tmp1819 to i8* ; <i8*> [#uses=1]
- volatile store i8* %tmp2223, i8** @p, align 4
- %tmp25 = add i32 %n.0, 1 ; <i32> [#uses=2]
- %tmp27 = icmp sle i32 %tmp25, 999999 ; <i1> [#uses=1]
- %tmp2728 = zext i1 %tmp27 to i8 ; <i8> [#uses=1]
- %toBool = icmp ne i8 %tmp2728, 0 ; <i1> [#uses=1]
- br i1 %toBool, label %cleanup31, label %cond_next
-
-cond_next: ; preds = %lab
- call void @llvm.stackrestore( i8* %tmp2 )
- ret i32 0
-
-cleanup31: ; preds = %lab
- call void @llvm.stackrestore( i8* %tmp2 )
- br label %lab
-}
-
-declare i8* @llvm.stacksave()
-
-declare void @llvm.stackrestore(i8*)
diff --git a/release_23/test/Transforms/InstCombine/2007-10-31-RangeCrash.ll b/release_23/test/Transforms/InstCombine/2007-10-31-RangeCrash.ll
deleted file mode 100644
index 15e54b1bf749..000000000000
--- a/release_23/test/Transforms/InstCombine/2007-10-31-RangeCrash.ll
+++ /dev/null
@@ -1,35 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine -disable-output
-target datalayout = "E-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f128:64:128"
-target triple = "powerpc-apple-darwin8"
-
-define i32 @test() {
-entry:
- %tmp50.i17 = icmp slt i32 0, 4 ; <i1> [#uses=1]
- br i1 %tmp50.i17, label %bb.i, label %calculateColorSpecificBlackLevel.exit
-
-bb.i: ; preds = %entry
- br label %bb51.i.i
-
-bb27.i.i: ; preds = %bb51.i.i
- %tmp31.i.i = load i16* null, align 2 ; <i16> [#uses=2]
- %tmp35.i.i = icmp ult i16 %tmp31.i.i, 1 ; <i1> [#uses=1]
- %tmp41.i.i = icmp ugt i16 %tmp31.i.i, -1 ; <i1> [#uses=1]
- %bothcond.i.i = or i1 %tmp35.i.i, %tmp41.i.i ; <i1> [#uses=1]
- %bothcond1.i.i = zext i1 %bothcond.i.i to i32 ; <i32> [#uses=1]
- %tmp46.i.i = xor i32 %bothcond1.i.i, 1 ; <i32> [#uses=1]
- %count.0.i.i = add i32 %count.1.i.i, %tmp46.i.i ; <i32> [#uses=1]
- %tmp50.i.i = add i32 %x.0.i.i, 2 ; <i32> [#uses=1]
- br label %bb51.i.i
-
-bb51.i.i: ; preds = %bb27.i.i, %bb.i
- %count.1.i.i = phi i32 [ %count.0.i.i, %bb27.i.i ], [ 0, %bb.i ] ; <i32> [#uses=1]
- %x.0.i.i = phi i32 [ %tmp50.i.i, %bb27.i.i ], [ 0, %bb.i ] ; <i32> [#uses=2]
- %tmp54.i.i = icmp slt i32 %x.0.i.i, 0 ; <i1> [#uses=1]
- br i1 %tmp54.i.i, label %bb27.i.i, label %bb57.i.i
-
-bb57.i.i: ; preds = %bb51.i.i
- ret i32 0
-
-calculateColorSpecificBlackLevel.exit: ; preds = %entry
- ret i32 undef
-}
diff --git a/release_23/test/Transforms/InstCombine/2007-10-31-StringCrash.ll b/release_23/test/Transforms/InstCombine/2007-10-31-StringCrash.ll
deleted file mode 100644
index 6ba07e8a5a15..000000000000
--- a/release_23/test/Transforms/InstCombine/2007-10-31-StringCrash.ll
+++ /dev/null
@@ -1,21 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine -disable-output
-target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
-target triple = "i686-apple-darwin8"
-
-declare void @__darwin_gcc3_preregister_frame_info()
-
-define void @_start(i32 %argc, i8** %argv, i8** %envp) {
-entry:
- %tmp1 = bitcast void ()* @__darwin_gcc3_preregister_frame_info to i32* ; <i32*> [#uses=1]
- %tmp2 = load i32* %tmp1, align 4 ; <i32> [#uses=1]
- %tmp3 = icmp ne i32 %tmp2, 0 ; <i1> [#uses=1]
- %tmp34 = zext i1 %tmp3 to i8 ; <i8> [#uses=1]
- %toBool = icmp ne i8 %tmp34, 0 ; <i1> [#uses=1]
- br i1 %toBool, label %cond_true, label %return
-
-cond_true: ; preds = %entry
- ret void
-
-return: ; preds = %entry
- ret void
-}
diff --git a/release_23/test/Transforms/InstCombine/2007-11-07-OpaqueAlignCrash.ll b/release_23/test/Transforms/InstCombine/2007-11-07-OpaqueAlignCrash.ll
deleted file mode 100644
index f3caf0797638..000000000000
--- a/release_23/test/Transforms/InstCombine/2007-11-07-OpaqueAlignCrash.ll
+++ /dev/null
@@ -1,22 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine -disable-output
-; PR1780
-
-target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32"
-target triple = "i686-pc-linux-gnu"
-
-%opaque_t = type opaque
-
-%op_ts = type {opaque, i32}
-
-@g = external global %opaque_t
-@h = external global %op_ts
-
-define i32 @foo() {
-entry:
- %x = load i8* bitcast (%opaque_t* @g to i8*)
- %y = load i32* bitcast (%op_ts* @h to i32*)
- %z = zext i8 %x to i32
- %r = add i32 %y, %z
- ret i32 %r
-}
-
diff --git a/release_23/test/Transforms/InstCombine/2007-11-15-CompareMiscomp.ll b/release_23/test/Transforms/InstCombine/2007-11-15-CompareMiscomp.ll
deleted file mode 100644
index d7ac21137287..000000000000
--- a/release_23/test/Transforms/InstCombine/2007-11-15-CompareMiscomp.ll
+++ /dev/null
@@ -1,10 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {icmp eq i32 %In, 1}
-; PR1800
-
-define i1 @test(i32 %In) {
- %c1 = icmp sgt i32 %In, -1
- %c2 = icmp eq i32 %In, 1
- %V = and i1 %c1, %c2
- ret i1 %V
-}
-
diff --git a/release_23/test/Transforms/InstCombine/2007-11-22-IcmpCrash.ll b/release_23/test/Transforms/InstCombine/2007-11-22-IcmpCrash.ll
deleted file mode 100644
index 1f211b65d3fd..000000000000
--- a/release_23/test/Transforms/InstCombine/2007-11-22-IcmpCrash.ll
+++ /dev/null
@@ -1,16 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine -disable-output
-; PR1817
-
-define i1 @test1(i32 %X) {
- %A = icmp slt i32 %X, 10
- %B = icmp ult i32 %X, 10
- %C = and i1 %A, %B
- ret i1 %C
-}
-
-define i1 @test2(i32 %X) {
- %A = icmp slt i32 %X, 10
- %B = icmp ult i32 %X, 10
- %C = or i1 %A, %B
- ret i1 %C
-}
diff --git a/release_23/test/Transforms/InstCombine/2007-11-25-CompatibleAttributes.ll b/release_23/test/Transforms/InstCombine/2007-11-25-CompatibleAttributes.ll
deleted file mode 100644
index 60a4b3b4ab52..000000000000
--- a/release_23/test/Transforms/InstCombine/2007-11-25-CompatibleAttributes.ll
+++ /dev/null
@@ -1,12 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep bitcast
-; PR1716
-
-@.str = internal constant [4 x i8] c"%d\0A\00" ; <[4 x i8]*> [#uses=1]
-
-define i32 @main(i32 %argc, i8** %argv) {
-entry:
- %tmp32 = tail call i32 (i8* noalias , ...) nounwind * bitcast (i32 (i8*, ...) nounwind * @printf to i32 (i8* noalias , ...) nounwind *)( i8* getelementptr ([4 x i8]* @.str, i32 0, i32 0) noalias , i32 0 ) nounwind ; <i32> [#uses=0]
- ret i32 undef
-}
-
-declare i32 @printf(i8*, ...) nounwind
diff --git a/release_23/test/Transforms/InstCombine/2007-12-10-ConstFoldCompare.ll b/release_23/test/Transforms/InstCombine/2007-12-10-ConstFoldCompare.ll
deleted file mode 100644
index 80df6fbdce35..000000000000
--- a/release_23/test/Transforms/InstCombine/2007-12-10-ConstFoldCompare.ll
+++ /dev/null
@@ -1,9 +0,0 @@
-target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32"
-target triple = "i686-pc-linux-gnu"
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep {ret i1 0}
-; PR1850
-
-define i1 @test() {
- %cond = icmp ule i8* inttoptr (i64 4294967297 to i8*), inttoptr (i64 5 to i8*)
- ret i1 %cond
-}
diff --git a/release_23/test/Transforms/InstCombine/2007-12-12-GEPScale.ll b/release_23/test/Transforms/InstCombine/2007-12-12-GEPScale.ll
deleted file mode 100644
index 6580f90411a6..000000000000
--- a/release_23/test/Transforms/InstCombine/2007-12-12-GEPScale.ll
+++ /dev/null
@@ -1,10 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep 1431655764
-
-target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32"
-
-define i8* @foo([100 x {i8,i8,i8}]* %x) {
-entry:
- %p = bitcast [100 x {i8,i8,i8}]* %x to i8*
- %q = getelementptr i8* %p, i32 -4
- ret i8* %q
-}
diff --git a/release_23/test/Transforms/InstCombine/2007-12-16-AsmNoUnwind.ll b/release_23/test/Transforms/InstCombine/2007-12-16-AsmNoUnwind.ll
deleted file mode 100644
index 336c6d5a2eba..000000000000
--- a/release_23/test/Transforms/InstCombine/2007-12-16-AsmNoUnwind.ll
+++ /dev/null
@@ -1,7 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep nounwind
-
-define void @bar() {
-entry:
- call void asm sideeffect "", "~{dirflag},~{fpsr},~{flags}"( )
- ret void
-}
diff --git a/release_23/test/Transforms/InstCombine/2007-12-18-AddSelCmpSub.ll b/release_23/test/Transforms/InstCombine/2007-12-18-AddSelCmpSub.ll
deleted file mode 100644
index e44fc6f099a7..000000000000
--- a/release_23/test/Transforms/InstCombine/2007-12-18-AddSelCmpSub.ll
+++ /dev/null
@@ -1,29 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {add} | count 1
-
-define i32 @foo(i32 %a) {
-entry:
- %tmp15 = sub i32 99, %a ; <i32> [#uses=2]
- %tmp16 = icmp slt i32 %tmp15, 0 ; <i1> [#uses=1]
- %smax = select i1 %tmp16, i32 0, i32 %tmp15 ; <i32> [#uses=1]
- %tmp12 = add i32 %smax, %a ; <i32> [#uses=1]
- %tmp13 = add i32 %tmp12, 1 ; <i32> [#uses=1]
- ret i32 %tmp13
-}
-
-define i32 @bar(i32 %a) {
-entry:
- %tmp15 = sub i32 99, %a ; <i32> [#uses=2]
- %tmp16 = icmp slt i32 %tmp15, 0 ; <i1> [#uses=1]
- %smax = select i1 %tmp16, i32 0, i32 %tmp15 ; <i32> [#uses=1]
- %tmp12 = add i32 %smax, %a ; <i32> [#uses=1]
- ret i32 %tmp12
-}
-
-define i32 @fun(i32 %a) {
-entry:
- %tmp15 = sub i32 99, %a ; <i32> [#uses=1]
- %tmp16 = icmp slt i32 %a, 0 ; <i1> [#uses=1]
- %smax = select i1 %tmp16, i32 0, i32 %tmp15 ; <i32> [#uses=1]
- %tmp12 = add i32 %smax, %a ; <i32> [#uses=1]
- ret i32 %tmp12
-}
diff --git a/release_23/test/Transforms/InstCombine/2007-12-28-IcmpSub2.ll b/release_23/test/Transforms/InstCombine/2007-12-28-IcmpSub2.ll
deleted file mode 100644
index 5e95993960c7..000000000000
--- a/release_23/test/Transforms/InstCombine/2007-12-28-IcmpSub2.ll
+++ /dev/null
@@ -1,89 +0,0 @@
-; RUN: llvm-as < %s | opt -mem2reg -instcombine | llvm-dis | grep "ret i32 1" | count 8
-
-define i32 @test1() {
-entry:
- %z = alloca i32
- store i32 0, i32* %z
- %tmp = load i32* %z
- %sub = sub i32 %tmp, 1
- %cmp = icmp ule i32 %sub, 0
- %retval = select i1 %cmp, i32 0, i32 1
- ret i32 %retval
-}
-
-define i32 @test2() {
-entry:
- %z = alloca i32
- store i32 0, i32* %z
- %tmp = load i32* %z
- %sub = sub i32 %tmp, 1
- %cmp = icmp ugt i32 %sub, 0
- %retval = select i1 %cmp, i32 1, i32 0
- ret i32 %retval
-}
-
-define i32 @test3() {
-entry:
- %z = alloca i32
- store i32 0, i32* %z
- %tmp = load i32* %z
- %sub = sub i32 %tmp, 1
- %cmp = icmp slt i32 %sub, 0
- %retval = select i1 %cmp, i32 1, i32 0
- ret i32 %retval
-}
-
-define i32 @test4() {
-entry:
- %z = alloca i32
- store i32 0, i32* %z
- %tmp = load i32* %z
- %sub = sub i32 %tmp, 1
- %cmp = icmp sle i32 %sub, 0
- %retval = select i1 %cmp, i32 1, i32 0
- ret i32 %retval
-}
-
-define i32 @test5() {
-entry:
- %z = alloca i32
- store i32 0, i32* %z
- %tmp = load i32* %z
- %sub = sub i32 %tmp, 1
- %cmp = icmp sge i32 %sub, 0
- %retval = select i1 %cmp, i32 0, i32 1
- ret i32 %retval
-}
-
-define i32 @test6() {
-entry:
- %z = alloca i32
- store i32 0, i32* %z
- %tmp = load i32* %z
- %sub = sub i32 %tmp, 1
- %cmp = icmp sgt i32 %sub, 0
- %retval = select i1 %cmp, i32 0, i32 1
- ret i32 %retval
-}
-
-define i32 @test7() {
-entry:
- %z = alloca i32
- store i32 0, i32* %z
- %tmp = load i32* %z
- %sub = sub i32 %tmp, 1
- %cmp = icmp eq i32 %sub, 0
- %retval = select i1 %cmp, i32 0, i32 1
- ret i32 %retval
-}
-
-define i32 @test8() {
-entry:
- %z = alloca i32
- store i32 0, i32* %z
- %tmp = load i32* %z
- %sub = sub i32 %tmp, 1
- %cmp = icmp ne i32 %sub, 0
- %retval = select i1 %cmp, i32 1, i32 0
- ret i32 %retval
-} \ No newline at end of file
diff --git a/release_23/test/Transforms/InstCombine/2008-01-06-BitCastAttributes.ll b/release_23/test/Transforms/InstCombine/2008-01-06-BitCastAttributes.ll
deleted file mode 100644
index 99c34907c00c..000000000000
--- a/release_23/test/Transforms/InstCombine/2008-01-06-BitCastAttributes.ll
+++ /dev/null
@@ -1,22 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep bitcast
-
-define void @a() {
- ret void
-}
-
-define i32 @b(i32* inreg %x) signext {
- ret i32 0
-}
-
-define void @c(...) {
- ret void
-}
-
-define void @g(i32* %y) {
- call void bitcast (void ()* @a to void (i32*)*)( i32* noalias %y )
- call <2 x i32> bitcast (i32 (i32*)* @b to <2 x i32> (i32*)*)( i32* inreg null ) ; <<2 x i32>>:1 [#uses=0]
- %x = call i64 bitcast (i32 (i32*)* @b to i64 (i32)*)( i32 0 ) ; <i64> [#uses=0]
- call void bitcast (void (...)* @c to void (i32)*)( i32 0 )
- call void bitcast (void (...)* @c to void (i32)*)( i32 zeroext 0 )
- ret void
-}
diff --git a/release_23/test/Transforms/InstCombine/2008-01-06-CastCrash.ll b/release_23/test/Transforms/InstCombine/2008-01-06-CastCrash.ll
deleted file mode 100644
index 1d816d4b9967..000000000000
--- a/release_23/test/Transforms/InstCombine/2008-01-06-CastCrash.ll
+++ /dev/null
@@ -1,10 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine -disable-output
-
-define <2 x i32> @f() {
- ret <2 x i32> undef
-}
-
-define i32 @g() {
- %x = call i32 bitcast (<2 x i32> ()* @f to i32 ()*)( ) ; <i32> [#uses=1]
- ret i32 %x
-}
diff --git a/release_23/test/Transforms/InstCombine/2008-01-06-VoidCast.ll b/release_23/test/Transforms/InstCombine/2008-01-06-VoidCast.ll
deleted file mode 100644
index 015210a99831..000000000000
--- a/release_23/test/Transforms/InstCombine/2008-01-06-VoidCast.ll
+++ /dev/null
@@ -1,10 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep bitcast
-
-define void @f(i16 %y) {
- ret void
-}
-
-define i32 @g(i32 %y) {
- %x = call i32 bitcast (void (i16)* @f to i32 (i32)*)( i32 %y ) ; <i32> [#uses=1]
- ret i32 %x
-}
diff --git a/release_23/test/Transforms/InstCombine/2008-01-13-AndCmpCmp.ll b/release_23/test/Transforms/InstCombine/2008-01-13-AndCmpCmp.ll
deleted file mode 100644
index 71d5bf762c34..000000000000
--- a/release_23/test/Transforms/InstCombine/2008-01-13-AndCmpCmp.ll
+++ /dev/null
@@ -1,9 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep and
-; PR1907
-
-define i1 @test(i32 %c84.17) {
- %tmp2696 = icmp ne i32 %c84.17, 34 ; <i1> [#uses=2]
- %tmp2699 = icmp sgt i32 %c84.17, -1 ; <i1> [#uses=1]
- %tmp2703 = and i1 %tmp2696, %tmp2699 ; <i1> [#uses=1]
- ret i1 %tmp2703
-}
diff --git a/release_23/test/Transforms/InstCombine/2008-01-13-NoBitCastAttributes.ll b/release_23/test/Transforms/InstCombine/2008-01-13-NoBitCastAttributes.ll
deleted file mode 100644
index d791d7be26ec..000000000000
--- a/release_23/test/Transforms/InstCombine/2008-01-13-NoBitCastAttributes.ll
+++ /dev/null
@@ -1,15 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep bitcast | count 2
-
-define i32 @b(i32* inreg %x) signext {
- ret i32 0
-}
-
-define void @c(...) {
- ret void
-}
-
-define void @g(i32* %y) {
- call i32 bitcast (i32 (i32*)* @b to i32 (i32)*)( i32 zeroext 0 ) ; <i32>:2 [#uses=0]
- call void bitcast (void (...)* @c to void (i32*)*)( i32* sret null )
- ret void
-}
diff --git a/release_23/test/Transforms/InstCombine/2008-01-14-DoubleNest.ll b/release_23/test/Transforms/InstCombine/2008-01-14-DoubleNest.ll
deleted file mode 100644
index 5381db2acbcb..000000000000
--- a/release_23/test/Transforms/InstCombine/2008-01-14-DoubleNest.ll
+++ /dev/null
@@ -1,24 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine -disable-output
-
- %struct.FRAME.nest = type { i32, i32 (i32*)* }
- %struct.__builtin_trampoline = type { [10 x i8] }
-
-declare i8* @llvm.init.trampoline(i8*, i8*, i8*) nounwind
-
-declare i32 @f(%struct.FRAME.nest* nest , i32*)
-
-define i32 @nest(i32 %n) {
-entry:
- %FRAME.0 = alloca %struct.FRAME.nest, align 8 ; <%struct.FRAME.nest*> [#uses=3]
- %TRAMP.216 = alloca [10 x i8], align 16 ; <[10 x i8]*> [#uses=1]
- %TRAMP.216.sub = getelementptr [10 x i8]* %TRAMP.216, i32 0, i32 0 ; <i8*> [#uses=1]
- %tmp3 = getelementptr %struct.FRAME.nest* %FRAME.0, i32 0, i32 0 ; <i32*> [#uses=1]
- store i32 %n, i32* %tmp3, align 8
- %FRAME.06 = bitcast %struct.FRAME.nest* %FRAME.0 to i8* ; <i8*> [#uses=1]
- %tramp = call i8* @llvm.init.trampoline( i8* %TRAMP.216.sub, i8* bitcast (i32 (%struct.FRAME.nest*, i32*)* @f to i8*), i8* %FRAME.06 ) ; <i8*> [#uses=1]
- %tmp7 = getelementptr %struct.FRAME.nest* %FRAME.0, i32 0, i32 1 ; <i32 (i32*)**> [#uses=1]
- %tmp89 = bitcast i8* %tramp to i32 (i32*)* ; <i32 (i32*)*> [#uses=2]
- store i32 (i32*)* %tmp89, i32 (i32*)** %tmp7, align 8
- %tmp2.i = call i32 %tmp89( i32* nest null ) ; <i32> [#uses=1]
- ret i32 %tmp2.i
-}
diff --git a/release_23/test/Transforms/InstCombine/2008-01-14-VarArgTrampoline.ll b/release_23/test/Transforms/InstCombine/2008-01-14-VarArgTrampoline.ll
deleted file mode 100644
index e35794a813b0..000000000000
--- a/release_23/test/Transforms/InstCombine/2008-01-14-VarArgTrampoline.ll
+++ /dev/null
@@ -1,24 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep zeroext
-
- %struct.FRAME.nest = type { i32, i32 (...)* }
- %struct.__builtin_trampoline = type { [10 x i8] }
-
-declare i8* @llvm.init.trampoline(i8*, i8*, i8*) nounwind
-
-declare i32 @f(%struct.FRAME.nest* nest , ...)
-
-define i32 @nest(i32 %n) {
-entry:
- %FRAME.0 = alloca %struct.FRAME.nest, align 8 ; <%struct.FRAME.nest*> [#uses=3]
- %TRAMP.216 = alloca [10 x i8], align 16 ; <[10 x i8]*> [#uses=1]
- %TRAMP.216.sub = getelementptr [10 x i8]* %TRAMP.216, i32 0, i32 0 ; <i8*> [#uses=1]
- %tmp3 = getelementptr %struct.FRAME.nest* %FRAME.0, i32 0, i32 0 ; <i32*> [#uses=1]
- store i32 %n, i32* %tmp3, align 8
- %FRAME.06 = bitcast %struct.FRAME.nest* %FRAME.0 to i8* ; <i8*> [#uses=1]
- %tramp = call i8* @llvm.init.trampoline( i8* %TRAMP.216.sub, i8* bitcast (i32 (%struct.FRAME.nest*, ...)* @f to i8*), i8* %FRAME.06 ) ; <i8*> [#uses=1]
- %tmp7 = getelementptr %struct.FRAME.nest* %FRAME.0, i32 0, i32 1 ; <i32 (...)**> [#uses=1]
- %tmp89 = bitcast i8* %tramp to i32 (...)* ; <i32 (...)*> [#uses=2]
- store i32 (...)* %tmp89, i32 (...)** %tmp7, align 8
- %tmp2.i = call i32 (...)* %tmp89( i32 zeroext 0 ) ; <i32> [#uses=1]
- ret i32 %tmp2.i
-}
diff --git a/release_23/test/Transforms/InstCombine/2008-01-21-MismatchedCastAndCompare.ll b/release_23/test/Transforms/InstCombine/2008-01-21-MismatchedCastAndCompare.ll
deleted file mode 100644
index 12bfb80a164e..000000000000
--- a/release_23/test/Transforms/InstCombine/2008-01-21-MismatchedCastAndCompare.ll
+++ /dev/null
@@ -1,17 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | notcast
-; RUN: llvm-as < %s | opt -instcombine | not grep {icmp s}
-; PR1940
-
-define i1 @test1(i8 %A, i8 %B) {
- %a = zext i8 %A to i32
- %b = zext i8 %B to i32
- %c = icmp sgt i32 %a, %b
- ret i1 %c
-}
-
-define i1 @test2(i8 %A, i8 %B) {
- %a = sext i8 %A to i32
- %b = sext i8 %B to i32
- %c = icmp ugt i32 %a, %b
- ret i1 %c
-}
diff --git a/release_23/test/Transforms/InstCombine/2008-01-21-MulTrunc.ll b/release_23/test/Transforms/InstCombine/2008-01-21-MulTrunc.ll
deleted file mode 100644
index 8de0959bf754..000000000000
--- a/release_23/test/Transforms/InstCombine/2008-01-21-MulTrunc.ll
+++ /dev/null
@@ -1,11 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | notcast
-
-define i16 @test1(i16 %a) {
- %tmp = zext i16 %a to i32 ; <i32> [#uses=2]
- %tmp21 = lshr i32 %tmp, 8 ; <i32> [#uses=1]
- %tmp5 = mul i32 %tmp, 5 ; <i32> [#uses=1]
- %tmp.upgrd.32 = or i32 %tmp21, %tmp5 ; <i32> [#uses=1]
- %tmp.upgrd.3 = trunc i32 %tmp.upgrd.32 to i16 ; <i16> [#uses=1]
- ret i16 %tmp.upgrd.3
-}
-
diff --git a/release_23/test/Transforms/InstCombine/2008-01-27-FloatSelect.ll b/release_23/test/Transforms/InstCombine/2008-01-27-FloatSelect.ll
deleted file mode 100644
index 346f90f8293b..000000000000
--- a/release_23/test/Transforms/InstCombine/2008-01-27-FloatSelect.ll
+++ /dev/null
@@ -1,7 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep select
-
-define double @fold(i1 %a, double %b) {
-%s = select i1 %a, double 0., double 1.
-%c = fdiv double %b, %s
-ret double %c
-}
diff --git a/release_23/test/Transforms/InstCombine/2008-01-29-AddICmp.ll b/release_23/test/Transforms/InstCombine/2008-01-29-AddICmp.ll
deleted file mode 100644
index d937f7bb2303..000000000000
--- a/release_23/test/Transforms/InstCombine/2008-01-29-AddICmp.ll
+++ /dev/null
@@ -1,20 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep {a.off}
-; PR1949
-
-define i1 @test1(i32 %a) {
- %a.off = add i32 %a, 4 ; <i32> [#uses=1]
- %C = icmp ult i32 %a.off, 4 ; <i1> [#uses=1]
- ret i1 %C
-}
-
-define i1 @test2(i32 %a) {
- %a.off = sub i32 %a, 4 ; <i32> [#uses=1]
- %C = icmp ugt i32 %a.off, -5 ; <i1> [#uses=1]
- ret i1 %C
-}
-
-define i1 @test3(i32 %a) {
- %a.off = add i32 %a, 4 ; <i32> [#uses=1]
- %C = icmp slt i32 %a.off, 2147483652 ; <i1> [#uses=1]
- ret i1 %C
-}
diff --git a/release_23/test/Transforms/InstCombine/2008-02-04-GEPIdxBug.ll b/release_23/test/Transforms/InstCombine/2008-02-04-GEPIdxBug.ll
deleted file mode 100644
index 6814e2febce1..000000000000
--- a/release_23/test/Transforms/InstCombine/2008-02-04-GEPIdxBug.ll
+++ /dev/null
@@ -1,33 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {icmp eq i32 %indvar, 0}
-; PR1978
-target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
-target triple = "i686-apple-darwin8"
- %struct.x = type <{ i8 }>
-@.str = internal constant [6 x i8] c"Main!\00" ; <[6 x i8]*> [#uses=1]
-@.str1 = internal constant [12 x i8] c"destroy %p\0A\00" ; <[12 x i8]*> [#uses=1]
-
-define i32 @main() nounwind {
-entry:
- %orientations = alloca [1 x [1 x %struct.x]] ; <[1 x [1 x %struct.x]]*> [#uses=2]
- %tmp3 = call i32 @puts( i8* getelementptr ([6 x i8]* @.str, i32 0, i32 0) ) nounwind ; <i32> [#uses=0]
- %tmp45 = getelementptr [1 x [1 x %struct.x]]* %orientations, i32 1, i32 0, i32 0 ; <%struct.x*> [#uses=1]
- %orientations62 = getelementptr [1 x [1 x %struct.x]]* %orientations, i32 0, i32 0, i32 0 ; <%struct.x*> [#uses=1]
- br label %bb10
-
-bb10: ; preds = %bb10, %entry
- %indvar = phi i32 [ 0, %entry ], [ %indvar.next, %bb10 ] ; <i32> [#uses=2]
- %tmp.0.reg2mem.0.rec = mul i32 %indvar, -1 ; <i32> [#uses=1]
- %tmp12.rec = add i32 %tmp.0.reg2mem.0.rec, -1 ; <i32> [#uses=1]
- %tmp12 = getelementptr %struct.x* %tmp45, i32 %tmp12.rec ; <%struct.x*> [#uses=2]
- %tmp16 = call i32 (i8*, ...)* @printf( i8* getelementptr ([12 x i8]* @.str1, i32 0, i32 0), %struct.x* %tmp12 ) nounwind ; <i32> [#uses=0]
- %tmp84 = icmp eq %struct.x* %tmp12, %orientations62 ; <i1> [#uses=1]
- %indvar.next = add i32 %indvar, 1 ; <i32> [#uses=1]
- br i1 %tmp84, label %bb17, label %bb10
-
-bb17: ; preds = %bb10
- ret i32 0
-}
-
-declare i32 @puts(i8*)
-
-declare i32 @printf(i8*, ...)
diff --git a/release_23/test/Transforms/InstCombine/2008-02-13-MulURem.ll b/release_23/test/Transforms/InstCombine/2008-02-13-MulURem.ll
deleted file mode 100644
index 669738378970..000000000000
--- a/release_23/test/Transforms/InstCombine/2008-02-13-MulURem.ll
+++ /dev/null
@@ -1,8 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep rem
-; PR1933
-
-define i32 @fold(i32 %a) {
- %s = mul i32 %a, 3
- %c = urem i32 %s, 3
- ret i32 %c
-}
diff --git a/release_23/test/Transforms/InstCombine/2008-02-16-SDivOverflow.ll b/release_23/test/Transforms/InstCombine/2008-02-16-SDivOverflow.ll
deleted file mode 100644
index cd61a10c5b85..000000000000
--- a/release_23/test/Transforms/InstCombine/2008-02-16-SDivOverflow.ll
+++ /dev/null
@@ -1,14 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {ret i.* 0} | count 2
-; PR2048
-
-define i32 @i(i32 %a) {
- %tmp1 = sdiv i32 %a, -1431655765
- %tmp2 = sdiv i32 %tmp1, 3
- ret i32 %tmp2
-}
-
-define i8 @j(i8 %a) {
- %tmp1 = sdiv i8 %a, 64
- %tmp2 = sdiv i8 %tmp1, 3
- ret i8 %tmp2
-}
diff --git a/release_23/test/Transforms/InstCombine/2008-02-16-SDivOverflow2.ll b/release_23/test/Transforms/InstCombine/2008-02-16-SDivOverflow2.ll
deleted file mode 100644
index 0e260c465e32..000000000000
--- a/release_23/test/Transforms/InstCombine/2008-02-16-SDivOverflow2.ll
+++ /dev/null
@@ -1,9 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {sdiv i8 \%a, 9}
-; PR2048
-
-define i8 @i(i8 %a) {
- %tmp1 = sdiv i8 %a, -3
- %tmp2 = sdiv i8 %tmp1, -3
- ret i8 %tmp2
-}
-
diff --git a/release_23/test/Transforms/InstCombine/2008-02-23-MulSub.ll b/release_23/test/Transforms/InstCombine/2008-02-23-MulSub.ll
deleted file mode 100644
index a74e98d44860..000000000000
--- a/release_23/test/Transforms/InstCombine/2008-02-23-MulSub.ll
+++ /dev/null
@@ -1,9 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep mul
-
-define i26 @test(i26 %a) nounwind {
-entry:
- %_add = mul i26 %a, 2885 ; <i26> [#uses=1]
- %_shl2 = mul i26 %a, 2884 ; <i26> [#uses=1]
- %_sub = sub i26 %_add, %_shl2 ; <i26> [#uses=1]
- ret i26 %_sub
-}
diff --git a/release_23/test/Transforms/InstCombine/2008-02-28-OrFCmpCrash.ll b/release_23/test/Transforms/InstCombine/2008-02-28-OrFCmpCrash.ll
deleted file mode 100644
index ea0240395626..000000000000
--- a/release_23/test/Transforms/InstCombine/2008-02-28-OrFCmpCrash.ll
+++ /dev/null
@@ -1,16 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis
-; rdar://5771353
-
-define float @test(float %x, x86_fp80 %y) nounwind readonly {
-entry:
- %tmp67 = fcmp uno x86_fp80 %y, 0xK00000000000000000000 ; <i1> [#uses=1]
- %tmp71 = fcmp uno float %x, 0.000000e+00 ; <i1> [#uses=1]
- %bothcond = or i1 %tmp67, %tmp71 ; <i1> [#uses=1]
- br i1 %bothcond, label %bb74, label %bb80
-
-bb74: ; preds = %entry
- ret float 0.000000e+00
-
-bb80: ; preds = %entry
- ret float 0.000000e+00
-}
diff --git a/release_23/test/Transforms/InstCombine/2008-03-13-IntToPtr.ll b/release_23/test/Transforms/InstCombine/2008-03-13-IntToPtr.ll
deleted file mode 100644
index 31e7e35bef1f..000000000000
--- a/release_23/test/Transforms/InstCombine/2008-03-13-IntToPtr.ll
+++ /dev/null
@@ -1,9 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {16} | count 1
-
-define i8* @bork(i8** %qux) {
- %tmp275 = load i8** %qux, align 1
- %tmp275276 = ptrtoint i8* %tmp275 to i32
- %tmp277 = add i32 %tmp275276, 16
- %tmp277278 = inttoptr i32 %tmp277 to i8*
- ret i8* %tmp277278
-}
diff --git a/release_23/test/Transforms/InstCombine/2008-04-22-ByValBitcast.ll b/release_23/test/Transforms/InstCombine/2008-04-22-ByValBitcast.ll
deleted file mode 100644
index 020121375fea..000000000000
--- a/release_23/test/Transforms/InstCombine/2008-04-22-ByValBitcast.ll
+++ /dev/null
@@ -1,15 +0,0 @@
-;; The bitcast cannot be eliminated because byval arguments need
-;; the correct type, or at least a type of the correct size.
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep bitcast
-target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
-target triple = "i386-apple-darwin9"
- %struct.NSRect = type { [4 x float] }
-
-define void @foo(i8* %context) nounwind {
-entry:
- %tmp1 = bitcast i8* %context to %struct.NSRect* ; <%struct.NSRect*> [#uses=1]
- call void (i32, ...)* @bar( i32 3, %struct.NSRect* byval align 4 %tmp1 ) nounwind
- ret void
-}
-
-declare void @bar(i32, ...)
diff --git a/release_23/test/Transforms/InstCombine/2008-04-28-VolatileStore.ll b/release_23/test/Transforms/InstCombine/2008-04-28-VolatileStore.ll
deleted file mode 100644
index 9bfe7aa14148..000000000000
--- a/release_23/test/Transforms/InstCombine/2008-04-28-VolatileStore.ll
+++ /dev/null
@@ -1,8 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {volatile store}
-
-define void @test() {
- %votf = alloca <4 x float> ; <<4 x float>*> [#uses=1]
- volatile store <4 x float> zeroinitializer, <4 x float>* %votf, align 16
- ret void
-}
-
diff --git a/release_23/test/Transforms/InstCombine/2008-04-29-VolatileLoadDontMerge.ll b/release_23/test/Transforms/InstCombine/2008-04-29-VolatileLoadDontMerge.ll
deleted file mode 100644
index e43c22daa42a..000000000000
--- a/release_23/test/Transforms/InstCombine/2008-04-29-VolatileLoadDontMerge.ll
+++ /dev/null
@@ -1,25 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {volatile load} | count 2
-target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
-target triple = "i386-apple-darwin8"
-@g_1 = internal global i32 0 ; <i32*> [#uses=3]
-
-define i32 @main() nounwind {
-entry:
- %tmp93 = icmp slt i32 0, 10 ; <i1> [#uses=0]
- %tmp34 = volatile load i32* @g_1, align 4 ; <i32> [#uses=1]
- br label %bb
-
-bb: ; preds = %bb, %entry
- %b.0.reg2mem.0 = phi i32 [ 0, %entry ], [ %tmp6, %bb ] ; <i32> [#uses=1]
- %tmp3.reg2mem.0 = phi i32 [ %tmp34, %entry ], [ %tmp3, %bb ] ; <i32> [#uses=1]
- %tmp4 = add i32 %tmp3.reg2mem.0, 5 ; <i32> [#uses=1]
- volatile store i32 %tmp4, i32* @g_1, align 4
- %tmp6 = add i32 %b.0.reg2mem.0, 1 ; <i32> [#uses=2]
- %tmp9 = icmp slt i32 %tmp6, 10 ; <i1> [#uses=1]
- %tmp3 = volatile load i32* @g_1, align 4 ; <i32> [#uses=1]
- br i1 %tmp9, label %bb, label %bb11
-
-bb11: ; preds = %bb
- ret i32 0
-}
-
diff --git a/release_23/test/Transforms/InstCombine/2008-04-29-VolatileLoadMerge.ll b/release_23/test/Transforms/InstCombine/2008-04-29-VolatileLoadMerge.ll
deleted file mode 100644
index 928fdd68f65d..000000000000
--- a/release_23/test/Transforms/InstCombine/2008-04-29-VolatileLoadMerge.ll
+++ /dev/null
@@ -1,21 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {volatile load} | count 1
-; PR2262
-target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
-target triple = "i386-apple-darwin8"
-@g_1 = internal global i32 0 ; <i32*> [#uses=3]
-
-define i32 @main(i32 %i) nounwind {
-entry:
- %tmp93 = icmp slt i32 %i, 10 ; <i1> [#uses=0]
- %tmp34 = volatile load i32* @g_1, align 4 ; <i32> [#uses=1]
- br i1 %tmp93, label %bb11, label %bb
-
-bb: ; preds = %bb, %entry
- %tmp3 = volatile load i32* @g_1, align 4 ; <i32> [#uses=1]
- br label %bb11
-
-bb11: ; preds = %bb
- %tmp4 = phi i32 [ %tmp34, %entry ], [ %tmp3, %bb ] ; <i32> [#uses=1]
- ret i32 %tmp4
-}
-
diff --git a/release_23/test/Transforms/InstCombine/2008-05-08-LiveStoreDelete.ll b/release_23/test/Transforms/InstCombine/2008-05-08-LiveStoreDelete.ll
deleted file mode 100644
index e9cc97df0c61..000000000000
--- a/release_23/test/Transforms/InstCombine/2008-05-08-LiveStoreDelete.ll
+++ /dev/null
@@ -1,25 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {store i8} | count 3
-; PR2297
-target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
-target triple = "i386-apple-darwin8"
-
-define i32 @a() nounwind {
-entry:
- %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
- %tmp1 = call i8* @malloc( i32 10 ) nounwind ; <i8*> [#uses=5]
- %tmp3 = getelementptr i8* %tmp1, i32 1 ; <i8*> [#uses=1]
- store i8 0, i8* %tmp3, align 1
- %tmp5 = getelementptr i8* %tmp1, i32 0 ; <i8*> [#uses=1]
- store i8 1, i8* %tmp5, align 1
- %tmp7 = call i32 @strlen( i8* %tmp1 ) nounwind readonly ; <i32> [#uses=1]
- %tmp9 = getelementptr i8* %tmp1, i32 0 ; <i8*> [#uses=1]
- store i8 0, i8* %tmp9, align 1
- %tmp11 = call i32 (...)* @b( i8* %tmp1 ) nounwind ; <i32> [#uses=0]
- ret i32 %tmp7
-}
-
-declare i8* @malloc(i32) nounwind
-
-declare i32 @strlen(i8*) nounwind readonly
-
-declare i32 @b(...)
diff --git a/release_23/test/Transforms/InstCombine/2008-05-08-StrLenSink.ll b/release_23/test/Transforms/InstCombine/2008-05-08-StrLenSink.ll
deleted file mode 100644
index e81e828d51f3..000000000000
--- a/release_23/test/Transforms/InstCombine/2008-05-08-StrLenSink.ll
+++ /dev/null
@@ -1,28 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | %prcontext strlen 1 | not grep ret
-; PR2297
-target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
-target triple = "i386-apple-darwin8"
-
-define i32 @a() nounwind {
-entry:
- %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
- %tmp1 = call i8* @malloc( i32 10 ) nounwind ; <i8*> [#uses=5]
- %tmp3 = getelementptr i8* %tmp1, i32 1 ; <i8*> [#uses=1]
- store i8 0, i8* %tmp3, align 1
- %tmp5 = getelementptr i8* %tmp1, i32 0 ; <i8*> [#uses=1]
- store i8 1, i8* %tmp5, align 1
- %tmp7 = call i32 @strlen( i8* %tmp1 ) nounwind readonly ; <i32> [#uses=1]
- %tmp9 = getelementptr i8* %tmp1, i32 0 ; <i8*> [#uses=1]
- store i8 0, i8* %tmp9, align 1
- %tmp11 = call i32 (...)* @b( i8* %tmp1 ) nounwind ; <i32> [#uses=0]
- br label %return
-
-return: ; preds = %entry
- ret i32 %tmp7
-}
-
-declare i8* @malloc(i32) nounwind
-
-declare i32 @strlen(i8*) nounwind readonly
-
-declare i32 @b(...)
diff --git a/release_23/test/Transforms/InstCombine/CPP_min_max.ll b/release_23/test/Transforms/InstCombine/CPP_min_max.ll
deleted file mode 100644
index 785b91e79e49..000000000000
--- a/release_23/test/Transforms/InstCombine/CPP_min_max.ll
+++ /dev/null
@@ -1,34 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \
-; RUN: grep select | not grep {i32\\*}
-
-; This testcase corresponds to PR362, which notices that this horrible code
-; is generated by the C++ front-end and LLVM optimizers, which has lots of
-; loads and other stuff that are unneeded.
-;
-; Instcombine should propagate the load through the select instructions to
-; allow elimination of the extra stuff by the mem2reg pass.
-
-define void @_Z5test1RiS_(i32* %x, i32* %y) {
-entry:
- %tmp.1.i = load i32* %y ; <i32> [#uses=1]
- %tmp.3.i = load i32* %x ; <i32> [#uses=1]
- %tmp.4.i = icmp slt i32 %tmp.1.i, %tmp.3.i ; <i1> [#uses=1]
- %retval.i = select i1 %tmp.4.i, i32* %y, i32* %x ; <i32*> [#uses=1]
- %tmp.4 = load i32* %retval.i ; <i32> [#uses=1]
- store i32 %tmp.4, i32* %x
- ret void
-}
-
-define void @_Z5test2RiS_(i32* %x, i32* %y) {
-entry:
- %tmp.0 = alloca i32 ; <i32*> [#uses=2]
- %tmp.2 = load i32* %x ; <i32> [#uses=2]
- store i32 %tmp.2, i32* %tmp.0
- %tmp.3.i = load i32* %y ; <i32> [#uses=1]
- %tmp.4.i = icmp slt i32 %tmp.2, %tmp.3.i ; <i1> [#uses=1]
- %retval.i = select i1 %tmp.4.i, i32* %y, i32* %tmp.0 ; <i32*> [#uses=1]
- %tmp.6 = load i32* %retval.i ; <i32> [#uses=1]
- store i32 %tmp.6, i32* %y
- ret void
-}
-
diff --git a/release_23/test/Transforms/InstCombine/GEPIdxCanon.ll b/release_23/test/Transforms/InstCombine/GEPIdxCanon.ll
deleted file mode 100644
index 9f84c01a3a43..000000000000
--- a/release_23/test/Transforms/InstCombine/GEPIdxCanon.ll
+++ /dev/null
@@ -1,10 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine -gcse -instcombine | \
-; RUN: llvm-dis | not grep getelementptr
-
-define i1 @test(i32* %A) {
- %B = getelementptr i32* %A, i32 1 ; <i32*> [#uses=1]
- %C = getelementptr i32* %A, i64 1 ; <i32*> [#uses=1]
- %V = icmp eq i32* %B, %C ; <i1> [#uses=1]
- ret i1 %V
-}
-
diff --git a/release_23/test/Transforms/InstCombine/IntPtrCast.ll b/release_23/test/Transforms/InstCombine/IntPtrCast.ll
deleted file mode 100644
index e24d199f8c45..000000000000
--- a/release_23/test/Transforms/InstCombine/IntPtrCast.ll
+++ /dev/null
@@ -1,9 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | notcast
-target datalayout = "e-p:32:32"
-
-define i32* @test(i32* %P) {
- %V = ptrtoint i32* %P to i32 ; <i32> [#uses=1]
- %P2 = inttoptr i32 %V to i32* ; <i32*> [#uses=1]
- ret i32* %P2
-}
-
diff --git a/release_23/test/Transforms/InstCombine/JavaCompare.ll b/release_23/test/Transforms/InstCombine/JavaCompare.ll
deleted file mode 100644
index db62991211bc..000000000000
--- a/release_23/test/Transforms/InstCombine/JavaCompare.ll
+++ /dev/null
@@ -1,15 +0,0 @@
-; This is the sequence of stuff that the Java front-end expands for a single
-; <= comparison. Check to make sure we turn it into a <= (only)
-
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \
-; RUN: grep -v {icmp sle} | not grep #uses
-
-define i1 @le(i32 %A, i32 %B) {
- %c1 = icmp sgt i32 %A, %B ; <i1> [#uses=1]
- %tmp = select i1 %c1, i32 1, i32 0 ; <i32> [#uses=1]
- %c2 = icmp slt i32 %A, %B ; <i1> [#uses=1]
- %result = select i1 %c2, i32 -1, i32 %tmp ; <i32> [#uses=1]
- %c3 = icmp sle i32 %result, 0 ; <i1> [#uses=1]
- ret i1 %c3
-}
-
diff --git a/release_23/test/Transforms/InstCombine/README.txt b/release_23/test/Transforms/InstCombine/README.txt
deleted file mode 100644
index de043c774891..000000000000
--- a/release_23/test/Transforms/InstCombine/README.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-This directory contains test cases for the instcombine transformation. The
-dated tests are actual bug tests, whereas the named tests are used to test
-for features that the this pass should be capable of performing.
-
diff --git a/release_23/test/Transforms/InstCombine/add.ll b/release_23/test/Transforms/InstCombine/add.ll
deleted file mode 100644
index 6ff2187474f7..000000000000
--- a/release_23/test/Transforms/InstCombine/add.ll
+++ /dev/null
@@ -1,277 +0,0 @@
-; This test makes sure that add instructions are properly eliminated.
-
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \
-; RUN: grep -v OK | not grep add
-
-define i32 @test1(i32 %A) {
- %B = add i32 %A, 0 ; <i32> [#uses=1]
- ret i32 %B
-}
-
-define i32 @test2(i32 %A) {
- %B = add i32 %A, 5 ; <i32> [#uses=1]
- %C = add i32 %B, -5 ; <i32> [#uses=1]
- ret i32 %C
-}
-
-define i32 @test3(i32 %A) {
- %B = add i32 %A, 5 ; <i32> [#uses=1]
- ;; This should get converted to an add
- %C = sub i32 %B, 5 ; <i32> [#uses=1]
- ret i32 %C
-}
-
-define i32 @test4(i32 %A, i32 %B) {
- %C = sub i32 0, %A ; <i32> [#uses=1]
- ; D = B + -A = B - A
- %D = add i32 %B, %C ; <i32> [#uses=1]
- ret i32 %D
-}
-
-define i32 @test5(i32 %A, i32 %B) {
- %C = sub i32 0, %A ; <i32> [#uses=1]
- ; D = -A + B = B - A
- %D = add i32 %C, %B ; <i32> [#uses=1]
- ret i32 %D
-}
-
-define i32 @test6(i32 %A) {
- %B = mul i32 7, %A ; <i32> [#uses=1]
- ; C = 7*A+A == 8*A == A << 3
- %C = add i32 %B, %A ; <i32> [#uses=1]
- ret i32 %C
-}
-
-define i32 @test7(i32 %A) {
- %B = mul i32 7, %A ; <i32> [#uses=1]
- ; C = A+7*A == 8*A == A << 3
- %C = add i32 %A, %B ; <i32> [#uses=1]
- ret i32 %C
-}
-
-; (A & C1)+(B & C2) -> (A & C1)|(B & C2) iff C1&C2 == 0
-define i32 @test8(i32 %A, i32 %B) {
- %A1 = and i32 %A, 7 ; <i32> [#uses=1]
- %B1 = and i32 %B, 128 ; <i32> [#uses=1]
- %C = add i32 %A1, %B1 ; <i32> [#uses=1]
- ret i32 %C
-}
-
-define i32 @test9(i32 %A) {
- %B = shl i32 %A, 4 ; <i32> [#uses=2]
- ; === shl int %A, 5
- %C = add i32 %B, %B ; <i32> [#uses=1]
- ret i32 %C
-}
-
-define i1 @test10(i8 %A, i8 %b) {
- %B = add i8 %A, %b ; <i8> [#uses=1]
- ; === A != -b
- %c = icmp ne i8 %B, 0 ; <i1> [#uses=1]
- ret i1 %c
-}
-
-define i1 @test11(i8 %A) {
- %B = add i8 %A, -1 ; <i8> [#uses=1]
- ; === A != 1
- %c = icmp ne i8 %B, 0 ; <i1> [#uses=1]
- ret i1 %c
-}
-
-define i32 @test12(i32 %A, i32 %B) {
- ; Should be transformed into shl A, 1
- %C_OK = add i32 %B, %A ; <i32> [#uses=1]
- br label %X
-
-X: ; preds = %0
- %D = add i32 %C_OK, %A ; <i32> [#uses=1]
- ret i32 %D
-}
-
-define i32 @test13(i32 %A, i32 %B, i32 %C) {
- %D_OK = add i32 %A, %B ; <i32> [#uses=1]
- %E_OK = add i32 %D_OK, %C ; <i32> [#uses=1]
- ;; shl A, 1
- %F = add i32 %E_OK, %A ; <i32> [#uses=1]
- ret i32 %F
-}
-
-define i32 @test14(i32 %offset, i32 %difference) {
- %tmp.2 = and i32 %difference, 3 ; <i32> [#uses=1]
- %tmp.3_OK = add i32 %tmp.2, %offset ; <i32> [#uses=1]
- %tmp.5.mask = and i32 %difference, -4 ; <i32> [#uses=1]
- ; == add %offset, %difference
- %tmp.8 = add i32 %tmp.3_OK, %tmp.5.mask ; <i32> [#uses=1]
- ret i32 %tmp.8
-}
-
-define i8 @test15(i8 %A) {
- ; Does not effect result
- %B = add i8 %A, -64 ; <i8> [#uses=1]
- ; Only one bit set
- %C = and i8 %B, 16 ; <i8> [#uses=1]
- ret i8 %C
-}
-
-define i8 @test16(i8 %A) {
- ; Turn this into a XOR
- %B = add i8 %A, 16 ; <i8> [#uses=1]
- ; Only one bit set
- %C = and i8 %B, 16 ; <i8> [#uses=1]
- ret i8 %C
-}
-
-define i32 @test17(i32 %A) {
- %B = xor i32 %A, -1 ; <i32> [#uses=1]
- ; == sub int 0, %A
- %C = add i32 %B, 1 ; <i32> [#uses=1]
- ret i32 %C
-}
-
-define i8 @test18(i8 %A) {
- %B = xor i8 %A, -1 ; <i8> [#uses=1]
- ; == sub ubyte 16, %A
- %C = add i8 %B, 17 ; <i8> [#uses=1]
- ret i8 %C
-}
-
-define i32 @test19(i1 %C) {
- %A = select i1 %C, i32 1000, i32 10 ; <i32> [#uses=1]
- %V = add i32 %A, 123 ; <i32> [#uses=1]
- ret i32 %V
-}
-
-define i32 @test20(i32 %x) {
- %tmp.2 = xor i32 %x, -2147483648 ; <i32> [#uses=1]
- ;; Add of sign bit -> xor of sign bit.
- %tmp.4 = add i32 %tmp.2, -2147483648 ; <i32> [#uses=1]
- ret i32 %tmp.4
-}
-
-define i1 @test21(i32 %x) {
- %t = add i32 %x, 4 ; <i32> [#uses=1]
- %y = icmp eq i32 %t, 123 ; <i1> [#uses=1]
- ret i1 %y
-}
-
-define i32 @test22(i32 %V) {
- %V2 = add i32 %V, 10 ; <i32> [#uses=1]
- switch i32 %V2, label %Default [
- i32 20, label %Lab1
- i32 30, label %Lab2
- ]
-
-Default: ; preds = %0
- ret i32 123
-
-Lab1: ; preds = %0
- ret i32 12312
-
-Lab2: ; preds = %0
- ret i32 1231231
-}
-
-define i32 @test23(i1 %C, i32 %a) {
-entry:
- br i1 %C, label %endif, label %else
-
-else: ; preds = %entry
- br label %endif
-
-endif: ; preds = %else, %entry
- %b.0 = phi i32 [ 0, %entry ], [ 1, %else ] ; <i32> [#uses=1]
- %tmp.4 = add i32 %b.0, 1 ; <i32> [#uses=1]
- ret i32 %tmp.4
-}
-
-define i32 @test24(i32 %A) {
- %B = add i32 %A, 1 ; <i32> [#uses=1]
- %C = shl i32 %B, 1 ; <i32> [#uses=1]
- %D = sub i32 %C, 2 ; <i32> [#uses=1]
- ret i32 %D
-}
-
-define i64 @test25(i64 %Y) {
- %tmp.4 = shl i64 %Y, 2 ; <i64> [#uses=1]
- %tmp.12 = shl i64 %Y, 2 ; <i64> [#uses=1]
- %tmp.8 = add i64 %tmp.4, %tmp.12 ; <i64> [#uses=1]
- ret i64 %tmp.8
-}
-
-define i32 @test26(i32 %A, i32 %B) {
- %C = add i32 %A, %B ; <i32> [#uses=1]
- %D = sub i32 %C, %B ; <i32> [#uses=1]
- ret i32 %D
-}
-
-define i32 @test27(i1 %C, i32 %X, i32 %Y) {
- %A = add i32 %X, %Y ; <i32> [#uses=1]
- %B = add i32 %Y, 123 ; <i32> [#uses=1]
- ;; Fold add through select.
- %C.upgrd.1 = select i1 %C, i32 %A, i32 %B ; <i32> [#uses=1]
- %D = sub i32 %C.upgrd.1, %Y ; <i32> [#uses=1]
- ret i32 %D
-}
-
-define i32 @test28(i32 %X) {
- %Y = add i32 %X, 1234 ; <i32> [#uses=1]
- %Z = sub i32 42, %Y ; <i32> [#uses=1]
- ret i32 %Z
-}
-
-define i32 @test29(i32 %X, i32 %x) {
- %tmp.2 = sub i32 %X, %x ; <i32> [#uses=2]
- %tmp.2.mask = and i32 %tmp.2, 63 ; <i32> [#uses=1]
- %tmp.6 = add i32 %tmp.2.mask, %x ; <i32> [#uses=1]
- %tmp.7 = and i32 %tmp.6, 63 ; <i32> [#uses=1]
- %tmp.9 = and i32 %tmp.2, -64 ; <i32> [#uses=1]
- %tmp.10 = or i32 %tmp.7, %tmp.9 ; <i32> [#uses=1]
- ret i32 %tmp.10
-}
-
-define i64 @test30(i64 %x) {
- %tmp.2 = xor i64 %x, -9223372036854775808 ; <i64> [#uses=1]
- ;; Add of sign bit -> xor of sign bit.
- %tmp.4 = add i64 %tmp.2, -9223372036854775808 ; <i64> [#uses=1]
- ret i64 %tmp.4
-}
-
-define i32 @test31(i32 %A) {
- %B = add i32 %A, 4 ; <i32> [#uses=1]
- %C = mul i32 %B, 5 ; <i32> [#uses=1]
- %D = sub i32 %C, 20 ; <i32> [#uses=1]
- ret i32 %D
-}
-
-define i32 @test32(i32 %A) {
- %B = add i32 %A, 4 ; <i32> [#uses=1]
- %C = shl i32 %B, 2 ; <i32> [#uses=1]
- %D = sub i32 %C, 16 ; <i32> [#uses=1]
- ret i32 %D
-}
-
-define i8 @test33(i8 %A) {
- %B = and i8 %A, -2 ; <i8> [#uses=1]
- %C = add i8 %B, 1 ; <i8> [#uses=1]
- ret i8 %C
-}
-
-define i8 @test34(i8 %A) {
- %B = add i8 %A, 64 ; <i8> [#uses=1]
- %C = and i8 %B, 12 ; <i8> [#uses=1]
- ret i8 %C
-}
-
-define i32 @test35(i32 %a) {
- %tmpnot = xor i32 %a, -1 ; <i32> [#uses=1]
- %tmp2 = add i32 %tmpnot, %a ; <i32> [#uses=1]
- ret i32 %tmp2
-}
-
-define i32 @test36(i32 %a) {
- %x = and i32 %a, -2
- %y = and i32 %a, -126
- %z = add i32 %x, %y
- %q = and i32 %z, 1 ; always zero
- ret i32 %q
-}
diff --git a/release_23/test/Transforms/InstCombine/add2.ll b/release_23/test/Transforms/InstCombine/add2.ll
deleted file mode 100644
index de1bbf41b098..000000000000
--- a/release_23/test/Transforms/InstCombine/add2.ll
+++ /dev/null
@@ -1,31 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \
-; RUN: grep -v OK | not grep add
-
-;; Target triple for gep raising case below.
-target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
-target triple = "i686-apple-darwin8"
-
-define i64 @test1(i64 %A, i32 %B) {
- %tmp12 = zext i32 %B to i64
- %tmp3 = shl i64 %tmp12, 32
- %tmp5 = add i64 %tmp3, %A
- %tmp6 = and i64 %tmp5, 123
- ret i64 %tmp6
-}
-
-; PR1795
-define void @test2(i32 %.val24) {
-EntryBlock:
- add i32 %.val24, -12
- inttoptr i32 %0 to i32*
- store i32 1, i32* %1
- add i32 %.val24, -16
- inttoptr i32 %2 to i32*
- getelementptr i32* %3, i32 1
- load i32* %4
- tail call i32 @callee( i32 %5 )
- ret void
-}
-
-declare i32 @callee(i32)
-
diff --git a/release_23/test/Transforms/InstCombine/addnegneg.ll b/release_23/test/Transforms/InstCombine/addnegneg.ll
deleted file mode 100644
index f3b9565a51e1..000000000000
--- a/release_23/test/Transforms/InstCombine/addnegneg.ll
+++ /dev/null
@@ -1,12 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep { sub } | count 1
-; PR2047
-
-define i32 @l(i32 %a, i32 %b, i32 %c, i32 %d) {
-entry:
- %b.neg = sub i32 0, %b ; <i32> [#uses=1]
- %c.neg = sub i32 0, %c ; <i32> [#uses=1]
- %sub4 = add i32 %c.neg, %b.neg ; <i32> [#uses=1]
- %sub6 = add i32 %sub4, %d ; <i32> [#uses=1]
- ret i32 %sub6
-}
-
diff --git a/release_23/test/Transforms/InstCombine/align-2d-gep.ll b/release_23/test/Transforms/InstCombine/align-2d-gep.ll
deleted file mode 100644
index c826e31da1f9..000000000000
--- a/release_23/test/Transforms/InstCombine/align-2d-gep.ll
+++ /dev/null
@@ -1,43 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {align 16} | count 1
-
-; A multi-dimensional array in a nested loop doing vector stores that
-; aren't yet aligned. Instcombine can understand the addressing in the
-; Nice case to prove 16 byte alignment. In the Awkward case, the inner
-; array dimension is not even, so the stores to it won't always be
-; aligned. Instcombine should prove alignment in exactly one of the two
-; stores.
-
-@Nice = global [1001 x [20000 x double]] zeroinitializer, align 32
-@Awkward = global [1001 x [20001 x double]] zeroinitializer, align 32
-
-define void @foo() nounwind {
-entry:
- br label %bb7.outer
-
-bb7.outer:
- %i = phi i64 [ 0, %entry ], [ %indvar.next26, %bb11 ]
- br label %bb1
-
-bb1:
- %j = phi i64 [ 0, %bb7.outer ], [ %indvar.next, %bb1 ]
-
- %t4 = getelementptr [1001 x [20000 x double]]* @Nice, i64 0, i64 %i, i64 %j
- %q = bitcast double* %t4 to <2 x double>*
- store <2 x double><double 0.0, double 0.0>, <2 x double>* %q, align 8
-
- %s4 = getelementptr [1001 x [20001 x double]]* @Awkward, i64 0, i64 %i, i64 %j
- %r = bitcast double* %s4 to <2 x double>*
- store <2 x double><double 0.0, double 0.0>, <2 x double>* %r, align 8
-
- %indvar.next = add i64 %j, 2
- %exitcond = icmp eq i64 %indvar.next, 557
- br i1 %exitcond, label %bb11, label %bb1
-
-bb11:
- %indvar.next26 = add i64 %i, 1
- %exitcond27 = icmp eq i64 %indvar.next26, 991
- br i1 %exitcond27, label %return.split, label %bb7.outer
-
-return.split:
- ret void
-}
diff --git a/release_23/test/Transforms/InstCombine/align-addr.ll b/release_23/test/Transforms/InstCombine/align-addr.ll
deleted file mode 100644
index a05c513dcbb3..000000000000
--- a/release_23/test/Transforms/InstCombine/align-addr.ll
+++ /dev/null
@@ -1,30 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {align 16} | count 1
-
-; Instcombine should be able to prove vector alignment in the
-; presence of a few mild address computation tricks.
-
-define void @foo(i8* %b, i64 %n, i64 %u, i64 %y) nounwind {
-entry:
- %c = ptrtoint i8* %b to i64
- %d = and i64 %c, -16
- %e = inttoptr i64 %d to double*
- %v = mul i64 %u, 2
- %z = and i64 %y, -2
- %t1421 = icmp eq i64 %n, 0
- br i1 %t1421, label %return, label %bb
-
-bb:
- %i = phi i64 [ %indvar.next, %bb ], [ 20, %entry ]
- %j = mul i64 %i, %v
- %h = add i64 %j, %z
- %t8 = getelementptr double* %e, i64 %h
- %p = bitcast double* %t8 to <2 x double>*
- store <2 x double><double 0.0, double 0.0>, <2 x double>* %p, align 8
- %indvar.next = add i64 %i, 1
- %exitcond = icmp eq i64 %indvar.next, %n
- br i1 %exitcond, label %return, label %bb
-
-return:
- ret void
-}
-
diff --git a/release_23/test/Transforms/InstCombine/align-inc.ll b/release_23/test/Transforms/InstCombine/align-inc.ll
deleted file mode 100644
index 0ad01cb23498..000000000000
--- a/release_23/test/Transforms/InstCombine/align-inc.ll
+++ /dev/null
@@ -1,14 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {GLOBAL.*align 16}
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {tmp = load}
-
-@GLOBAL = internal global [4 x i32] zeroinitializer
-
-declare <16 x i8> @llvm.x86.sse2.loadu.dq(i8*)
-
-
-define <16 x i8> @foo(<2 x i64> %x) {
-entry:
- %tmp = tail call <16 x i8> @llvm.x86.sse2.loadu.dq( i8* bitcast ([4 x i32]* @GLOBAL to i8*) )
- ret <16 x i8> %tmp
-}
-
diff --git a/release_23/test/Transforms/InstCombine/alloca.ll b/release_23/test/Transforms/InstCombine/alloca.ll
deleted file mode 100644
index 95d0f094ae3f..000000000000
--- a/release_23/test/Transforms/InstCombine/alloca.ll
+++ /dev/null
@@ -1,31 +0,0 @@
-; Zero byte allocas should be deleted.
-
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \
-; RUN: not grep alloca
-; END.
-
-declare void @use(...)
-
-define void @test() {
- %X = alloca [0 x i32] ; <[0 x i32]*> [#uses=1]
- call void (...)* @use( [0 x i32]* %X )
- %Y = alloca i32, i32 0 ; <i32*> [#uses=1]
- call void (...)* @use( i32* %Y )
- %Z = alloca { } ; <{ }*> [#uses=1]
- call void (...)* @use( { }* %Z )
- ret void
-}
-
-define void @test2() {
- %A = alloca i32 ; <i32*> [#uses=1]
- store i32 123, i32* %A
- ret void
-}
-
-define void @test3() {
- %A = alloca { i32 } ; <{ i32 }*> [#uses=1]
- %B = getelementptr { i32 }* %A, i32 0, i32 0 ; <i32*> [#uses=1]
- store i32 123, i32* %B
- ret void
-}
-
diff --git a/release_23/test/Transforms/InstCombine/and-compare.ll b/release_23/test/Transforms/InstCombine/and-compare.ll
deleted file mode 100644
index d2f2753f887e..000000000000
--- a/release_23/test/Transforms/InstCombine/and-compare.ll
+++ /dev/null
@@ -1,11 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \
-; RUN: grep and | count 1
-
-; Should be optimized to one and.
-define i1 @test1(i32 %a, i32 %b) {
- %tmp1 = and i32 %a, 65280 ; <i32> [#uses=1]
- %tmp3 = and i32 %b, 65280 ; <i32> [#uses=1]
- %tmp = icmp ne i32 %tmp1, %tmp3 ; <i1> [#uses=1]
- ret i1 %tmp
-}
-
diff --git a/release_23/test/Transforms/InstCombine/and-or-and.ll b/release_23/test/Transforms/InstCombine/and-or-and.ll
deleted file mode 100644
index 04d475ccd822..000000000000
--- a/release_23/test/Transforms/InstCombine/and-or-and.ll
+++ /dev/null
@@ -1,61 +0,0 @@
-; If we have an 'and' of the result of an 'or', and one of the 'or' operands
-; cannot have contributed any of the resultant bits, delete the or. This
-; occurs for very common C/C++ code like this:
-;
-; struct foo { int A : 16; int B : 16; };
-; void test(struct foo *F, int X, int Y) {
-; F->A = X; F->B = Y;
-; }
-;
-; Which corresponds to test1.
-
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \
-; RUN: not grep {or }
-
-define i32 @test1(i32 %X, i32 %Y) {
- %A = and i32 %X, 7 ; <i32> [#uses=1]
- %B = and i32 %Y, 8 ; <i32> [#uses=1]
- %C = or i32 %A, %B ; <i32> [#uses=1]
- ;; This cannot include any bits from %Y!
- %D = and i32 %C, 7 ; <i32> [#uses=1]
- ret i32 %D
-}
-
-define i32 @test2(i32 %X, i8 %Y) {
- %B = zext i8 %Y to i32 ; <i32> [#uses=1]
- %C = or i32 %X, %B ; <i32> [#uses=1]
- ;; This cannot include any bits from %Y!
- %D = and i32 %C, 65536 ; <i32> [#uses=1]
- ret i32 %D
-}
-
-define i32 @test3(i32 %X, i32 %Y) {
- %B = shl i32 %Y, 1 ; <i32> [#uses=1]
- %C = or i32 %X, %B ; <i32> [#uses=1]
- ;; This cannot include any bits from %Y!
- %D = and i32 %C, 1 ; <i32> [#uses=1]
- ret i32 %D
-}
-
-define i32 @test4(i32 %X, i32 %Y) {
- %B = lshr i32 %Y, 31 ; <i32> [#uses=1]
- %C = or i32 %X, %B ; <i32> [#uses=1]
- ;; This cannot include any bits from %Y!
- %D = and i32 %C, 2 ; <i32> [#uses=1]
- ret i32 %D
-}
-
-define i32 @or_test1(i32 %X, i32 %Y) {
- %A = and i32 %X, 1 ; <i32> [#uses=1]
- ;; This cannot include any bits from X!
- %B = or i32 %A, 1 ; <i32> [#uses=1]
- ret i32 %B
-}
-
-define i8 @or_test2(i8 %X, i8 %Y) {
- %A = shl i8 %X, 7 ; <i8> [#uses=1]
- ;; This cannot include any bits from X!
- %B = or i8 %A, -128 ; <i8> [#uses=1]
- ret i8 %B
-}
-
diff --git a/release_23/test/Transforms/InstCombine/and-or-not.ll b/release_23/test/Transforms/InstCombine/and-or-not.ll
deleted file mode 100644
index 8fc53a7e0acb..000000000000
--- a/release_23/test/Transforms/InstCombine/and-or-not.ll
+++ /dev/null
@@ -1,46 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep xor | count 4
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep and
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep { or}
-
-; PR1510
-
-; These are all equivelent to A^B
-
-define i32 @test1(i32 %a, i32 %b) {
-entry:
- %tmp3 = or i32 %b, %a ; <i32> [#uses=1]
- %tmp3not = xor i32 %tmp3, -1 ; <i32> [#uses=1]
- %tmp6 = and i32 %b, %a ; <i32> [#uses=1]
- %tmp7 = or i32 %tmp6, %tmp3not ; <i32> [#uses=1]
- %tmp7not = xor i32 %tmp7, -1 ; <i32> [#uses=1]
- ret i32 %tmp7not
-}
-
-define i32 @test2(i32 %a, i32 %b) {
-entry:
- %tmp3 = or i32 %b, %a ; <i32> [#uses=1]
- %tmp6 = and i32 %b, %a ; <i32> [#uses=1]
- %tmp6not = xor i32 %tmp6, -1 ; <i32> [#uses=1]
- %tmp7 = and i32 %tmp3, %tmp6not ; <i32> [#uses=1]
- ret i32 %tmp7
-}
-
-define <4 x i32> @test3(<4 x i32> %a, <4 x i32> %b) {
-entry:
- %tmp3 = or <4 x i32> %a, %b ; <<4 x i32>> [#uses=1]
- %tmp3not = xor <4 x i32> %tmp3, < i32 -1, i32 -1, i32 -1, i32 -1 > ; <<4 x i32>> [#uses=1]
- %tmp6 = and <4 x i32> %a, %b ; <<4 x i32>> [#uses=1]
- %tmp7 = or <4 x i32> %tmp6, %tmp3not ; <<4 x i32>> [#uses=1]
- %tmp7not = xor <4 x i32> %tmp7, < i32 -1, i32 -1, i32 -1, i32 -1 > ; <<4 x i32>> [#uses=1]
- ret <4 x i32> %tmp7not
-}
-
-define <4 x i32> @test4(<4 x i32> %a, <4 x i32> %b) {
-entry:
- %tmp3 = or <4 x i32> %a, %b ; <<4 x i32>> [#uses=1]
- %tmp6 = and <4 x i32> %a, %b ; <<4 x i32>> [#uses=1]
- %tmp6not = xor <4 x i32> %tmp6, < i32 -1, i32 -1, i32 -1, i32 -1 > ; <<4 x i32>> [#uses=1]
- %tmp7 = and <4 x i32> %tmp3, %tmp6not ; <<4 x i32>> [#uses=1]
- ret <4 x i32> %tmp7
-}
-
diff --git a/release_23/test/Transforms/InstCombine/and-xor-merge.ll b/release_23/test/Transforms/InstCombine/and-xor-merge.ll
deleted file mode 100644
index 85f8026ab572..000000000000
--- a/release_23/test/Transforms/InstCombine/and-xor-merge.ll
+++ /dev/null
@@ -1,19 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep and | count 1
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep xor | count 2
-
-; (x&z) ^ (y&z) -> (x^y)&z
-define i32 @test1(i32 %x, i32 %y, i32 %z) {
- %tmp3 = and i32 %z, %x
- %tmp6 = and i32 %z, %y
- %tmp7 = xor i32 %tmp3, %tmp6
- ret i32 %tmp7
-}
-
-; (x & y) ^ (x|y) -> x^y
-define i32 @test2(i32 %x, i32 %y, i32 %z) {
- %tmp3 = and i32 %y, %x
- %tmp6 = or i32 %y, %x
- %tmp7 = xor i32 %tmp3, %tmp6
- ret i32 %tmp7
-}
-
diff --git a/release_23/test/Transforms/InstCombine/and.ll b/release_23/test/Transforms/InstCombine/and.ll
deleted file mode 100644
index edab47e87cf1..000000000000
--- a/release_23/test/Transforms/InstCombine/and.ll
+++ /dev/null
@@ -1,255 +0,0 @@
-; This test makes sure that these instructions are properly eliminated.
-;
-
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep and
-
-define i32 @test1(i32 %A) {
- ; zero result
- %B = and i32 %A, 0 ; <i32> [#uses=1]
- ret i32 %B
-}
-
-define i32 @test2(i32 %A) {
- ; noop
- %B = and i32 %A, -1 ; <i32> [#uses=1]
- ret i32 %B
-}
-
-define i1 @test3(i1 %A) {
- ; always = false
- %B = and i1 %A, false ; <i1> [#uses=1]
- ret i1 %B
-}
-
-define i1 @test4(i1 %A) {
- ; noop
- %B = and i1 %A, true ; <i1> [#uses=1]
- ret i1 %B
-}
-
-define i32 @test5(i32 %A) {
- %B = and i32 %A, %A ; <i32> [#uses=1]
- ret i32 %B
-}
-
-define i1 @test6(i1 %A) {
- %B = and i1 %A, %A ; <i1> [#uses=1]
- ret i1 %B
-}
-
-; A & ~A == 0
-define i32 @test7(i32 %A) {
- %NotA = xor i32 %A, -1 ; <i32> [#uses=1]
- %B = and i32 %A, %NotA ; <i32> [#uses=1]
- ret i32 %B
-}
-
-; AND associates
-define i8 @test8(i8 %A) {
- %B = and i8 %A, 3 ; <i8> [#uses=1]
- %C = and i8 %B, 4 ; <i8> [#uses=1]
- ret i8 %C
-}
-
-define i1 @test9(i32 %A) {
- ; Test of sign bit, convert to setle %A, 0
- %B = and i32 %A, -2147483648 ; <i32> [#uses=1]
- %C = icmp ne i32 %B, 0 ; <i1> [#uses=1]
- ret i1 %C
-}
-
-define i1 @test9a(i32 %A) {
- ; Test of sign bit, convert to setle %A, 0
- %B = and i32 %A, -2147483648 ; <i32> [#uses=1]
- %C = icmp ne i32 %B, 0 ; <i1> [#uses=1]
- ret i1 %C
-}
-
-define i32 @test10(i32 %A) {
- %B = and i32 %A, 12 ; <i32> [#uses=1]
- %C = xor i32 %B, 15 ; <i32> [#uses=1]
- ; (X ^ C1) & C2 --> (X & C2) ^ (C1&C2)
- %D = and i32 %C, 1 ; <i32> [#uses=1]
- ret i32 %D
-}
-
-define i32 @test11(i32 %A, i32* %P) {
- %B = or i32 %A, 3 ; <i32> [#uses=1]
- %C = xor i32 %B, 12 ; <i32> [#uses=2]
- ; additional use of C
- store i32 %C, i32* %P
- ; %C = and uint %B, 3 --> 3
- %D = and i32 %C, 3 ; <i32> [#uses=1]
- ret i32 %D
-}
-
-define i1 @test12(i32 %A, i32 %B) {
- %C1 = icmp ult i32 %A, %B ; <i1> [#uses=1]
- %C2 = icmp ule i32 %A, %B ; <i1> [#uses=1]
- ; (A < B) & (A <= B) === (A < B)
- %D = and i1 %C1, %C2 ; <i1> [#uses=1]
- ret i1 %D
-}
-
-define i1 @test13(i32 %A, i32 %B) {
- %C1 = icmp ult i32 %A, %B ; <i1> [#uses=1]
- %C2 = icmp ugt i32 %A, %B ; <i1> [#uses=1]
- ; (A < B) & (A > B) === false
- %D = and i1 %C1, %C2 ; <i1> [#uses=1]
- ret i1 %D
-}
-
-define i1 @test14(i8 %A) {
- %B = and i8 %A, -128 ; <i8> [#uses=1]
- %C = icmp ne i8 %B, 0 ; <i1> [#uses=1]
- ret i1 %C
-}
-
-define i8 @test15(i8 %A) {
- %B = lshr i8 %A, 7 ; <i8> [#uses=1]
- ; Always equals zero
- %C = and i8 %B, 2 ; <i8> [#uses=1]
- ret i8 %C
-}
-
-define i8 @test16(i8 %A) {
- %B = shl i8 %A, 2 ; <i8> [#uses=1]
- %C = and i8 %B, 3 ; <i8> [#uses=1]
- ret i8 %C
-}
-
-;; ~(~X & Y) --> (X | ~Y)
-define i8 @test17(i8 %X, i8 %Y) {
- %B = xor i8 %X, -1 ; <i8> [#uses=1]
- %C = and i8 %B, %Y ; <i8> [#uses=1]
- %D = xor i8 %C, -1 ; <i8> [#uses=1]
- ret i8 %D
-}
-
-define i1 @test18(i32 %A) {
- %B = and i32 %A, -128 ; <i32> [#uses=1]
- ;; C >= 128
- %C = icmp ne i32 %B, 0 ; <i1> [#uses=1]
- ret i1 %C
-}
-
-define i1 @test18a(i8 %A) {
- %B = and i8 %A, -2 ; <i8> [#uses=1]
- %C = icmp eq i8 %B, 0 ; <i1> [#uses=1]
- ret i1 %C
-}
-
-define i32 @test19(i32 %A) {
- %B = shl i32 %A, 3 ; <i32> [#uses=1]
- ;; Clearing a zero bit
- %C = and i32 %B, -2 ; <i32> [#uses=1]
- ret i32 %C
-}
-
-define i8 @test20(i8 %A) {
- %C = lshr i8 %A, 7 ; <i8> [#uses=1]
- ;; Unneeded
- %D = and i8 %C, 1 ; <i8> [#uses=1]
- ret i8 %D
-}
-
-define i1 @test22(i32 %A) {
- %B = icmp eq i32 %A, 1 ; <i1> [#uses=1]
- %C = icmp sge i32 %A, 3 ; <i1> [#uses=1]
- ;; false
- %D = and i1 %B, %C ; <i1> [#uses=1]
- ret i1 %D
-}
-
-define i1 @test23(i32 %A) {
- %B = icmp sgt i32 %A, 1 ; <i1> [#uses=1]
- %C = icmp sle i32 %A, 2 ; <i1> [#uses=1]
- ;; A == 2
- %D = and i1 %B, %C ; <i1> [#uses=1]
- ret i1 %D
-}
-
-define i1 @test24(i32 %A) {
- %B = icmp sgt i32 %A, 1 ; <i1> [#uses=1]
- %C = icmp ne i32 %A, 2 ; <i1> [#uses=1]
- ;; A > 2
- %D = and i1 %B, %C ; <i1> [#uses=1]
- ret i1 %D
-}
-
-define i1 @test25(i32 %A) {
- %B = icmp sge i32 %A, 50 ; <i1> [#uses=1]
- %C = icmp slt i32 %A, 100 ; <i1> [#uses=1]
- ;; (A-50) <u 50
- %D = and i1 %B, %C ; <i1> [#uses=1]
- ret i1 %D
-}
-
-define i1 @test26(i32 %A) {
- %B = icmp ne i32 %A, 50 ; <i1> [#uses=1]
- %C = icmp ne i32 %A, 51 ; <i1> [#uses=1]
- ;; (A-50) > 1
- %D = and i1 %B, %C ; <i1> [#uses=1]
- ret i1 %D
-}
-
-define i8 @test27(i8 %A) {
- %B = and i8 %A, 4 ; <i8> [#uses=1]
- %C = sub i8 %B, 16 ; <i8> [#uses=1]
- ;; 0xF0
- %D = and i8 %C, -16 ; <i8> [#uses=1]
- %E = add i8 %D, 16 ; <i8> [#uses=1]
- ret i8 %E
-}
-
-;; This is juse a zero extending shr.
-define i32 @test28(i32 %X) {
- ;; Sign extend
- %Y = ashr i32 %X, 24 ; <i32> [#uses=1]
- ;; Mask out sign bits
- %Z = and i32 %Y, 255 ; <i32> [#uses=1]
- ret i32 %Z
-}
-
-define i32 @test29(i8 %X) {
- %Y = zext i8 %X to i32 ; <i32> [#uses=1]
- ;; Zero extend makes this unneeded.
- %Z = and i32 %Y, 255 ; <i32> [#uses=1]
- ret i32 %Z
-}
-
-define i32 @test30(i1 %X) {
- %Y = zext i1 %X to i32 ; <i32> [#uses=1]
- %Z = and i32 %Y, 1 ; <i32> [#uses=1]
- ret i32 %Z
-}
-
-define i32 @test31(i1 %X) {
- %Y = zext i1 %X to i32 ; <i32> [#uses=1]
- %Z = shl i32 %Y, 4 ; <i32> [#uses=1]
- %A = and i32 %Z, 16 ; <i32> [#uses=1]
- ret i32 %A
-}
-
-define i32 @test32(i32 %In) {
- %Y = and i32 %In, 16 ; <i32> [#uses=1]
- %Z = lshr i32 %Y, 2 ; <i32> [#uses=1]
- %A = and i32 %Z, 1 ; <i32> [#uses=1]
- ret i32 %A
-}
-
-;; Code corresponding to one-bit bitfield ^1.
-define i32 @test33(i32 %b) {
- %tmp.4.mask = and i32 %b, 1 ; <i32> [#uses=1]
- %tmp.10 = xor i32 %tmp.4.mask, 1 ; <i32> [#uses=1]
- %tmp.12 = and i32 %b, -2 ; <i32> [#uses=1]
- %tmp.13 = or i32 %tmp.12, %tmp.10 ; <i32> [#uses=1]
- ret i32 %tmp.13
-}
-
-define i32 @test34(i32 %A, i32 %B) {
- %tmp.2 = or i32 %B, %A ; <i32> [#uses=1]
- %tmp.4 = and i32 %tmp.2, %B ; <i32> [#uses=1]
- ret i32 %tmp.4
-}
-
diff --git a/release_23/test/Transforms/InstCombine/and2.ll b/release_23/test/Transforms/InstCombine/and2.ll
deleted file mode 100644
index 3b80d94e1a61..000000000000
--- a/release_23/test/Transforms/InstCombine/and2.ll
+++ /dev/null
@@ -1,12 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep and
-
-
-; PR1738
-define i1 @test1(double %X, double %Y) {
- %tmp9 = fcmp ord double %X, 0.000000e+00
- %tmp13 = fcmp ord double %Y, 0.000000e+00
- %bothcond = and i1 %tmp13, %tmp9
- ret i1 %bothcond
-}
-
-
diff --git a/release_23/test/Transforms/InstCombine/apint-add1.ll b/release_23/test/Transforms/InstCombine/apint-add1.ll
deleted file mode 100644
index 74280ee7f7ca..000000000000
--- a/release_23/test/Transforms/InstCombine/apint-add1.ll
+++ /dev/null
@@ -1,34 +0,0 @@
-; This test makes sure that add instructions are properly eliminated.
-; This test is for Integer BitWidth <= 64 && BitWidth % 8 != 0.
-
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \
-; RUN: grep -v OK | not grep add
-
-
-define i1 @test1(i1 %x) {
- %tmp.2 = xor i1 %x, 1
- ;; Add of sign bit -> xor of sign bit.
- %tmp.4 = add i1 %tmp.2, 1
- ret i1 %tmp.4
-}
-
-define i47 @test2(i47 %x) {
- %tmp.2 = xor i47 %x, 70368744177664
- ;; Add of sign bit -> xor of sign bit.
- %tmp.4 = add i47 %tmp.2, 70368744177664
- ret i47 %tmp.4
-}
-
-define i15 @test3(i15 %x) {
- %tmp.2 = xor i15 %x, 16384
- ;; Add of sign bit -> xor of sign bit.
- %tmp.4 = add i15 %tmp.2, 16384
- ret i15 %tmp.4
-}
-
-define i49 @test6(i49 %x) {
- ;; (x & 254)+1 -> (x & 254)|1
- %tmp.2 = and i49 %x, 562949953421310
- %tmp.4 = add i49 %tmp.2, 1
- ret i49 %tmp.4
-}
diff --git a/release_23/test/Transforms/InstCombine/apint-add2.ll b/release_23/test/Transforms/InstCombine/apint-add2.ll
deleted file mode 100644
index 0ddfcc0764d6..000000000000
--- a/release_23/test/Transforms/InstCombine/apint-add2.ll
+++ /dev/null
@@ -1,46 +0,0 @@
-; This test makes sure that add instructions are properly eliminated.
-; This test is for Integer BitWidth > 64 && BitWidth <= 1024.
-
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \
-; RUN: grep -v OK | not grep add
-; END.
-
-define i111 @test1(i111 %x) {
- %tmp.2 = shl i111 1, 110
- %tmp.4 = xor i111 %x, %tmp.2
- ;; Add of sign bit -> xor of sign bit.
- %tmp.6 = add i111 %tmp.4, %tmp.2
- ret i111 %tmp.6
-}
-
-define i65 @test2(i65 %x) {
- %tmp.0 = shl i65 1, 64
- %tmp.2 = xor i65 %x, %tmp.0
- ;; Add of sign bit -> xor of sign bit.
- %tmp.4 = add i65 %tmp.2, %tmp.0
- ret i65 %tmp.4
-}
-
-define i1024 @test3(i1024 %x) {
- %tmp.0 = shl i1024 1, 1023
- %tmp.2 = xor i1024 %x, %tmp.0
- ;; Add of sign bit -> xor of sign bit.
- %tmp.4 = add i1024 %tmp.2, %tmp.0
- ret i1024 %tmp.4
-}
-
-define i128 @test4(i128 %x) {
- ;; If we have ADD(XOR(AND(X, 0xFF), 0xF..F80), 0x80), it's a sext.
- %tmp.5 = shl i128 1, 127
- %tmp.1 = ashr i128 %tmp.5, 120
- %tmp.2 = xor i128 %x, %tmp.1
- %tmp.4 = add i128 %tmp.2, %tmp.5
- ret i128 %tmp.4
-}
-
-define i77 @test6(i77 %x) {
- ;; (x & 254)+1 -> (x & 254)|1
- %tmp.2 = and i77 %x, 562949953421310
- %tmp.4 = add i77 %tmp.2, 1
- ret i77 %tmp.4
-}
diff --git a/release_23/test/Transforms/InstCombine/apint-and-compare.ll b/release_23/test/Transforms/InstCombine/apint-and-compare.ll
deleted file mode 100644
index ad2e41d718ef..000000000000
--- a/release_23/test/Transforms/InstCombine/apint-and-compare.ll
+++ /dev/null
@@ -1,16 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep and | count 2
-
-; Should be optimized to one and.
-define i1 @test1(i33 %a, i33 %b) {
- %tmp1 = and i33 %a, 65280
- %tmp3 = and i33 %b, 65280
- %tmp = icmp ne i33 %tmp1, %tmp3
- ret i1 %tmp
-}
-
-define i1 @test2(i999 %a, i999 %b) {
- %tmp1 = and i999 %a, 65280
- %tmp3 = and i999 %b, 65280
- %tmp = icmp ne i999 %tmp1, %tmp3
- ret i1 %tmp
-}
diff --git a/release_23/test/Transforms/InstCombine/apint-and-or-and.ll b/release_23/test/Transforms/InstCombine/apint-and-or-and.ll
deleted file mode 100644
index 4630f2867865..000000000000
--- a/release_23/test/Transforms/InstCombine/apint-and-or-and.ll
+++ /dev/null
@@ -1,50 +0,0 @@
-; If we have an 'and' of the result of an 'or', and one of the 'or' operands
-; cannot have contributed any of the resultant bits, delete the or. This
-; occurs for very common C/C++ code like this:
-;
-; struct foo { int A : 16; int B : 16; };
-; void test(struct foo *F, int X, int Y) {
-; F->A = X; F->B = Y;
-; }
-;
-; Which corresponds to test1.
-;
-; This tests arbitrary precision integers.
-
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep {or }
-; END.
-
-define i17 @test1(i17 %X, i17 %Y) {
- %A = and i17 %X, 7
- %B = and i17 %Y, 8
- %C = or i17 %A, %B
- %D = and i17 %C, 7 ;; This cannot include any bits from %Y!
- ret i17 %D
-}
-
-define i49 @test3(i49 %X, i49 %Y) {
- %B = shl i49 %Y, 1
- %C = or i49 %X, %B
- %D = and i49 %C, 1 ;; This cannot include any bits from %Y!
- ret i49 %D
-}
-
-define i67 @test4(i67 %X, i67 %Y) {
- %B = lshr i67 %Y, 66
- %C = or i67 %X, %B
- %D = and i67 %C, 2 ;; This cannot include any bits from %Y!
- ret i67 %D
-}
-
-define i231 @or_test1(i231 %X, i231 %Y) {
- %A = and i231 %X, 1
- %B = or i231 %A, 1 ;; This cannot include any bits from X!
- ret i231 %B
-}
-
-define i7 @or_test2(i7 %X, i7 %Y) {
- %A = shl i7 %X, 6
- %B = or i7 %A, 64 ;; This cannot include any bits from X!
- ret i7 %B
-}
-
diff --git a/release_23/test/Transforms/InstCombine/apint-and-xor-merge.ll b/release_23/test/Transforms/InstCombine/apint-and-xor-merge.ll
deleted file mode 100644
index e1e4e3caaef0..000000000000
--- a/release_23/test/Transforms/InstCombine/apint-and-xor-merge.ll
+++ /dev/null
@@ -1,22 +0,0 @@
-; This test case checks that the merge of and/xor can work on arbitrary
-; precision integers.
-
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep and | count 1
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep xor | count 2
-
-; (x &z ) ^ (y & z) -> (x ^ y) & z
-define i57 @test1(i57 %x, i57 %y, i57 %z) {
- %tmp3 = and i57 %z, %x
- %tmp6 = and i57 %z, %y
- %tmp7 = xor i57 %tmp3, %tmp6
- ret i57 %tmp7
-}
-
-; (x & y) ^ (x | y) -> x ^ y
-define i23 @test2(i23 %x, i23 %y, i23 %z) {
- %tmp3 = and i23 %y, %x
- %tmp6 = or i23 %y, %x
- %tmp7 = xor i23 %tmp3, %tmp6
- ret i23 %tmp7
-}
-
diff --git a/release_23/test/Transforms/InstCombine/apint-and1.ll b/release_23/test/Transforms/InstCombine/apint-and1.ll
deleted file mode 100644
index eb3b1a64b2ce..000000000000
--- a/release_23/test/Transforms/InstCombine/apint-and1.ll
+++ /dev/null
@@ -1,57 +0,0 @@
-; This test makes sure that and instructions are properly eliminated.
-; This test is for Integer BitWidth <= 64 && BitWidth % 8 != 0.
-
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep {and }
-; END.
-
-define i39 @test0(i39 %A) {
- %B = and i39 %A, 0 ; zero result
- ret i39 %B
-}
-
-define i47 @test1(i47 %A, i47 %B) {
- ;; (~A & ~B) == (~(A | B)) - De Morgan's Law
- %NotA = xor i47 %A, -1
- %NotB = xor i47 %B, -1
- %C1 = and i47 %NotA, %NotB
- ret i47 %C1
-}
-
-define i15 @test2(i15 %x) {
- %tmp.2 = and i15 %x, -1 ; noop
- ret i15 %tmp.2
-}
-
-define i23 @test3(i23 %x) {
- %tmp.0 = and i23 %x, 127
- %tmp.2 = and i23 %tmp.0, 128
- ret i23 %tmp.2
-}
-
-define i1 @test4(i37 %x) {
- %A = and i37 %x, -2147483648
- %B = icmp ne i37 %A, 0
- ret i1 %B
-}
-
-define i7 @test5(i7 %A, i7* %P) {
- %B = or i7 %A, 3
- %C = xor i7 %B, 12
- store i7 %C, i7* %P
- %r = and i7 %C, 3
- ret i7 %r
-}
-
-define i7 @test6(i7 %A, i7 %B) {
- ;; ~(~X & Y) --> (X | ~Y)
- %t0 = xor i7 %A, -1
- %t1 = and i7 %t0, %B
- %r = xor i7 %t1, -1
- ret i7 %r
-}
-
-define i47 @test7(i47 %A) {
- %X = ashr i47 %A, 39 ;; sign extend
- %C1 = and i47 %X, 255
- ret i47 %C1
-}
diff --git a/release_23/test/Transforms/InstCombine/apint-and2.ll b/release_23/test/Transforms/InstCombine/apint-and2.ll
deleted file mode 100644
index f7b3934d5b83..000000000000
--- a/release_23/test/Transforms/InstCombine/apint-and2.ll
+++ /dev/null
@@ -1,82 +0,0 @@
-; This test makes sure that and instructions are properly eliminated.
-; This test is for Integer BitWidth > 64 && BitWidth <= 1024.
-
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep {and }
-; END.
-
-
-define i999 @test0(i999 %A) {
- %B = and i999 %A, 0 ; zero result
- ret i999 %B
-}
-
-define i477 @test1(i477 %A, i477 %B) {
- ;; (~A & ~B) == (~(A | B)) - De Morgan's Law
- %NotA = xor i477 %A, -1
- %NotB = xor i477 %B, -1
- %C1 = and i477 %NotA, %NotB
- ret i477 %C1
-}
-
-define i129 @tst(i129 %A, i129 %B) {
- ;; (~A & ~B) == (~(A | B)) - De Morgan's Law
- %NotA = xor i129 %A, -1
- %NotB = xor i129 %B, -1
- %C1 = and i129 %NotA, %NotB
- ret i129 %C1
-}
-
-define i65 @test(i65 %A, i65 %B) {
- ;; (~A & ~B) == (~(A | B)) - De Morgan's Law
- %NotA = xor i65 %A, -1
- %NotB = xor i65 -1, %B
- %C1 = and i65 %NotA, %NotB
- ret i65 %C1
-}
-
-define i66 @tes(i66 %A, i66 %B) {
- ;; (~A & ~B) == (~(A | B)) - De Morgan's Law
- %NotA = xor i66 %A, -1
- %NotB = xor i66 %B, -1
- %C1 = and i66 %NotA, %NotB
- ret i66 %C1
-}
-
-define i1005 @test2(i1005 %x) {
- %tmp.2 = and i1005 %x, -1 ; noop
- ret i1005 %tmp.2
-}
-
-define i123 @test3(i123 %x) {
- %tmp.0 = and i123 %x, 127
- %tmp.2 = and i123 %tmp.0, 128
- ret i123 %tmp.2
-}
-
-define i1 @test4(i737 %x) {
- %A = and i737 %x, -2147483648
- %B = icmp ne i737 %A, 0
- ret i1 %B
-}
-
-define i117 @test5(i117 %A, i117* %P) {
- %B = or i117 %A, 3
- %C = xor i117 %B, 12
- store i117 %C, i117* %P
- %r = and i117 %C, 3
- ret i117 %r
-}
-
-define i117 @test6(i117 %A, i117 %B) {
- ;; ~(~X & Y) --> (X | ~Y)
- %t0 = xor i117 %A, -1
- %t1 = and i117 %t0, %B
- %r = xor i117 %t1, -1
- ret i117 %r
-}
-
-define i1024 @test7(i1024 %A) {
- %X = ashr i1024 %A, 1016 ;; sign extend
- %C1 = and i1024 %X, 255
- ret i1024 %C1
-}
diff --git a/release_23/test/Transforms/InstCombine/apint-call-cast-target.ll b/release_23/test/Transforms/InstCombine/apint-call-cast-target.ll
deleted file mode 100644
index 0f87a53160f5..000000000000
--- a/release_23/test/Transforms/InstCombine/apint-call-cast-target.ll
+++ /dev/null
@@ -1,13 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep call | not grep bitcast
-
-target datalayout = "e-p:32:32"
-target triple = "i686-pc-linux-gnu"
-
-
-define i32 @main() {
-entry:
- %tmp = call i32 bitcast (i7* (i999*)* @ctime to i32 (i99*)*)( i99* null )
- ret i32 %tmp
-}
-
-declare i7* @ctime(i999*)
diff --git a/release_23/test/Transforms/InstCombine/apint-cast-and-cast.ll b/release_23/test/Transforms/InstCombine/apint-cast-and-cast.ll
deleted file mode 100644
index 337fd7c2d722..000000000000
--- a/release_23/test/Transforms/InstCombine/apint-cast-and-cast.ll
+++ /dev/null
@@ -1,15 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep bitcast
-
-define i19 @test1(i43 %val) {
- %t1 = bitcast i43 %val to i43
- %t2 = and i43 %t1, 1
- %t3 = trunc i43 %t2 to i19
- ret i19 %t3
-}
-
-define i73 @test2(i677 %val) {
- %t1 = bitcast i677 %val to i677
- %t2 = and i677 %t1, 1
- %t3 = trunc i677 %t2 to i73
- ret i73 %t3
-}
diff --git a/release_23/test/Transforms/InstCombine/apint-cast-cast-to-and.ll b/release_23/test/Transforms/InstCombine/apint-cast-cast-to-and.ll
deleted file mode 100644
index 29a88694d5c5..000000000000
--- a/release_23/test/Transforms/InstCombine/apint-cast-cast-to-and.ll
+++ /dev/null
@@ -1,8 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep i41
-
-define i61 @test1(i61 %X) {
- %Y = trunc i61 %X to i41 ;; Turn i61o an AND
- %Z = zext i41 %Y to i61
- ret i61 %Z
-}
-
diff --git a/release_23/test/Transforms/InstCombine/apint-cast.ll b/release_23/test/Transforms/InstCombine/apint-cast.ll
deleted file mode 100644
index dd0014640021..000000000000
--- a/release_23/test/Transforms/InstCombine/apint-cast.ll
+++ /dev/null
@@ -1,20 +0,0 @@
-; Tests to make sure elimination of casts is working correctly
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | notcast
-
-define i17 @test1(i17 %a) {
- %tmp = zext i17 %a to i37 ; <i37> [#uses=2]
- %tmp21 = lshr i37 %tmp, 8 ; <i37> [#uses=1]
- %tmp5 = shl i37 %tmp, 8 ; <i37> [#uses=1]
- %tmp.upgrd.32 = or i37 %tmp21, %tmp5 ; <i37> [#uses=1]
- %tmp.upgrd.3 = trunc i37 %tmp.upgrd.32 to i17 ; <i17> [#uses=1]
- ret i17 %tmp.upgrd.3
-}
-
-define i167 @test2(i167 %a) {
- %tmp = zext i167 %a to i577 ; <i577> [#uses=2]
- %tmp21 = lshr i577 %tmp, 9 ; <i577> [#uses=1]
- %tmp5 = shl i577 %tmp, 8 ; <i577> [#uses=1]
- %tmp.upgrd.32 = or i577 %tmp21, %tmp5 ; <i577> [#uses=1]
- %tmp.upgrd.3 = trunc i577 %tmp.upgrd.32 to i167 ; <i167> [#uses=1]
- ret i167 %tmp.upgrd.3
-}
diff --git a/release_23/test/Transforms/InstCombine/apint-div1.ll b/release_23/test/Transforms/InstCombine/apint-div1.ll
deleted file mode 100644
index e9aa579b9583..000000000000
--- a/release_23/test/Transforms/InstCombine/apint-div1.ll
+++ /dev/null
@@ -1,22 +0,0 @@
-; This test makes sure that div instructions are properly eliminated.
-; This test is for Integer BitWidth < 64 && BitWidth % 2 != 0.
-;
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep div
-
-
-define i33 @test1(i33 %X) {
- %Y = udiv i33 %X, 4096
- ret i33 %Y
-}
-
-define i49 @test2(i49 %X) {
- %tmp.0 = shl i49 4096, 17
- %Y = udiv i49 %X, %tmp.0
- ret i49 %Y
-}
-
-define i59 @test3(i59 %X, i1 %C) {
- %V = select i1 %C, i59 1024, i59 4096
- %R = udiv i59 %X, %V
- ret i59 %R
-}
diff --git a/release_23/test/Transforms/InstCombine/apint-div2.ll b/release_23/test/Transforms/InstCombine/apint-div2.ll
deleted file mode 100644
index 2aa2c3a4ac2c..000000000000
--- a/release_23/test/Transforms/InstCombine/apint-div2.ll
+++ /dev/null
@@ -1,22 +0,0 @@
-; This test makes sure that div instructions are properly eliminated.
-; This test is for Integer BitWidth >= 64 && BitWidth <= 1024.
-;
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep div
-
-
-define i333 @test1(i333 %X) {
- %Y = udiv i333 %X, 70368744177664
- ret i333 %Y
-}
-
-define i499 @test2(i499 %X) {
- %tmp.0 = shl i499 4096, 197
- %Y = udiv i499 %X, %tmp.0
- ret i499 %Y
-}
-
-define i599 @test3(i599 %X, i1 %C) {
- %V = select i1 %C, i599 70368744177664, i599 4096
- %R = udiv i599 %X, %V
- ret i599 %R
-}
diff --git a/release_23/test/Transforms/InstCombine/apint-elim-logicalops.ll b/release_23/test/Transforms/InstCombine/apint-elim-logicalops.ll
deleted file mode 100644
index 13d032cacf21..000000000000
--- a/release_23/test/Transforms/InstCombine/apint-elim-logicalops.ll
+++ /dev/null
@@ -1,39 +0,0 @@
-; Test that elimination of logical operators works with
-; arbitrary precision integers.
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \
-; RUN: not grep {(and\|xor\|add\|shl\|shr)}
-; END.
-
-define i33 @test1(i33 %x) {
- %tmp.1 = and i33 %x, 65535 ; <i33> [#uses=1]
- %tmp.2 = xor i33 %tmp.1, -32768 ; <i33> [#uses=1]
- %tmp.3 = add i33 %tmp.2, 32768 ; <i33> [#uses=1]
- ret i33 %tmp.3
-}
-
-define i33 @test2(i33 %x) {
- %tmp.1 = and i33 %x, 65535 ; <i33> [#uses=1]
- %tmp.2 = xor i33 %tmp.1, 32768 ; <i33> [#uses=1]
- %tmp.3 = add i33 %tmp.2, -32768 ; <i33> [#uses=1]
- ret i33 %tmp.3
-}
-
-define i33 @test3(i16 %P) {
- %tmp.1 = zext i16 %P to i33 ; <i33> [#uses=1]
- %tmp.4 = xor i33 %tmp.1, 32768 ; <i33> [#uses=1]
- %tmp.5 = add i33 %tmp.4, -32768 ; <i33> [#uses=1]
- ret i33 %tmp.5
-}
-
-define i33 @test5(i33 %x) {
- %tmp.1 = and i33 %x, 254
- %tmp.2 = xor i33 %tmp.1, 128
- %tmp.3 = add i33 %tmp.2, -128
- ret i33 %tmp.3
-}
-
-define i33 @test6(i33 %x) {
- %tmp.2 = shl i33 %x, 16 ; <i33> [#uses=1]
- %tmp.4 = lshr i33 %tmp.2, 16 ; <i33> [#uses=1]
- ret i33 %tmp.4
-}
diff --git a/release_23/test/Transforms/InstCombine/apint-mul1.ll b/release_23/test/Transforms/InstCombine/apint-mul1.ll
deleted file mode 100644
index 36b1102580c9..000000000000
--- a/release_23/test/Transforms/InstCombine/apint-mul1.ll
+++ /dev/null
@@ -1,11 +0,0 @@
-; This test makes sure that mul instructions are properly eliminated.
-; This test is for Integer BitWidth < 64 && BitWidth % 2 != 0.
-;
-
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep mul
-
-
-define i17 @test1(i17 %X) {
- %Y = mul i17 %X, 1024
- ret i17 %Y
-}
diff --git a/release_23/test/Transforms/InstCombine/apint-mul2.ll b/release_23/test/Transforms/InstCombine/apint-mul2.ll
deleted file mode 100644
index 72fd97ac79f0..000000000000
--- a/release_23/test/Transforms/InstCombine/apint-mul2.ll
+++ /dev/null
@@ -1,12 +0,0 @@
-; This test makes sure that mul instructions are properly eliminated.
-; This test is for Integer BitWidth >= 64 && BitWidth % 2 >= 1024.
-;
-
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep mul
-
-
-define i177 @test1(i177 %X) {
- %C = shl i177 1, 155
- %Y = mul i177 %X, %C
- ret i177 %Y
-}
diff --git a/release_23/test/Transforms/InstCombine/apint-not.ll b/release_23/test/Transforms/InstCombine/apint-not.ll
deleted file mode 100644
index f557fa8b1788..000000000000
--- a/release_23/test/Transforms/InstCombine/apint-not.ll
+++ /dev/null
@@ -1,42 +0,0 @@
-; This test makes sure that the xor instructions are properly eliminated
-; when arbitrary precision integers are used.
-
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep xor
-
-define i33 @test1(i33 %A) {
- %B = xor i33 %A, -1
- %C = xor i33 %B, -1
- ret i33 %C
-}
-
-define i1 @test2(i52 %A, i52 %B) {
- %cond = icmp ule i52 %A, %B ; Can change into uge
- %Ret = xor i1 %cond, true
- ret i1 %Ret
-}
-
-; Test that demorgans law can be instcombined
-define i47 @test3(i47 %A, i47 %B) {
- %a = xor i47 %A, -1
- %b = xor i47 %B, -1
- %c = and i47 %a, %b
- %d = xor i47 %c, -1
- ret i47 %d
-}
-
-; Test that demorgens law can work with constants
-define i61 @test4(i61 %A, i61 %B) {
- %a = xor i61 %A, -1
- %c = and i61 %a, 5 ; 5 = ~c2
- %d = xor i61 %c, -1
- ret i61 %d
-}
-
-; test the mirror of demorgans law...
-define i71 @test5(i71 %A, i71 %B) {
- %a = xor i71 %A, -1
- %b = xor i71 %B, -1
- %c = or i71 %a, %b
- %d = xor i71 %c, -1
- ret i71 %d
-}
diff --git a/release_23/test/Transforms/InstCombine/apint-or1.ll b/release_23/test/Transforms/InstCombine/apint-or1.ll
deleted file mode 100644
index 51b87fe2a200..000000000000
--- a/release_23/test/Transforms/InstCombine/apint-or1.ll
+++ /dev/null
@@ -1,36 +0,0 @@
-; This test makes sure that or instructions are properly eliminated.
-; This test is for Integer BitWidth <= 64 && BitWidth % 2 != 0.
-;
-
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep or
-
-
-define i7 @test0(i7 %X) {
- %Y = or i7 %X, 0
- ret i7 %Y
-}
-
-define i17 @test1(i17 %X) {
- %Y = or i17 %X, -1
- ret i17 %Y
-}
-
-define i23 @test2(i23 %A) {
- ;; A | ~A == -1
- %NotA = xor i23 -1, %A
- %B = or i23 %A, %NotA
- ret i23 %B
-}
-
-define i39 @test3(i39 %V, i39 %M) {
- ;; If we have: ((V + N) & C1) | (V & C2)
- ;; .. and C2 = ~C1 and C2 is 0+1+ and (N & C2) == 0
- ;; replace with V+N.
- %C1 = xor i39 274877906943, -1 ;; C2 = 274877906943
- %N = and i39 %M, 274877906944
- %A = add i39 %V, %N
- %B = and i39 %A, %C1
- %D = and i39 %V, 274877906943
- %R = or i39 %B, %D
- ret i39 %R
-}
diff --git a/release_23/test/Transforms/InstCombine/apint-or2.ll b/release_23/test/Transforms/InstCombine/apint-or2.ll
deleted file mode 100644
index 21dc5654ceec..000000000000
--- a/release_23/test/Transforms/InstCombine/apint-or2.ll
+++ /dev/null
@@ -1,35 +0,0 @@
-; This test makes sure that or instructions are properly eliminated.
-; This test is for Integer BitWidth > 64 && BitWidth <= 1024.
-;
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep or
-
-
-define i777 @test0(i777 %X) {
- %Y = or i777 %X, 0
- ret i777 %Y
-}
-
-define i117 @test1(i117 %X) {
- %Y = or i117 %X, -1
- ret i117 %Y
-}
-
-define i1023 @test2(i1023 %A) {
- ;; A | ~A == -1
- %NotA = xor i1023 -1, %A
- %B = or i1023 %A, %NotA
- ret i1023 %B
-}
-
-define i399 @test3(i399 %V, i399 %M) {
- ;; If we have: ((V + N) & C1) | (V & C2)
- ;; .. and C2 = ~C1 and C2 is 0+1+ and (N & C2) == 0
- ;; replace with V+N.
- %C1 = xor i399 274877906943, -1 ;; C2 = 274877906943
- %N = and i399 %M, 18446742974197923840
- %A = add i399 %V, %N
- %B = and i399 %A, %C1
- %D = and i399 %V, 274877906943
- %R = or i399 %B, %D
- ret i399 %R
-}
diff --git a/release_23/test/Transforms/InstCombine/apint-rem1.ll b/release_23/test/Transforms/InstCombine/apint-rem1.ll
deleted file mode 100644
index 2ec8c749972d..000000000000
--- a/release_23/test/Transforms/InstCombine/apint-rem1.ll
+++ /dev/null
@@ -1,22 +0,0 @@
-; This test makes sure that these instructions are properly eliminated.
-; This test is for Integer BitWidth < 64 && BitWidth % 2 != 0.
-;
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep rem
-
-
-define i33 @test1(i33 %A) {
- %B = urem i33 %A, 4096
- ret i33 %B
-}
-
-define i49 @test2(i49 %A) {
- %B = shl i49 4096, 11
- %Y = urem i49 %A, %B
- ret i49 %Y
-}
-
-define i59 @test3(i59 %X, i1 %C) {
- %V = select i1 %C, i59 70368744177664, i59 4096
- %R = urem i59 %X, %V
- ret i59 %R
-}
diff --git a/release_23/test/Transforms/InstCombine/apint-rem2.ll b/release_23/test/Transforms/InstCombine/apint-rem2.ll
deleted file mode 100644
index 4d22c22d5401..000000000000
--- a/release_23/test/Transforms/InstCombine/apint-rem2.ll
+++ /dev/null
@@ -1,22 +0,0 @@
-; This test makes sure that these instructions are properly eliminated.
-; This test is for Integer BitWidth >= 64 && BitWidth <= 1024.
-;
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep rem
-
-
-define i333 @test1(i333 %A) {
- %B = urem i333 %A, 70368744177664
- ret i333 %B
-}
-
-define i499 @test2(i499 %A) {
- %B = shl i499 4096, 111
- %Y = urem i499 %A, %B
- ret i499 %Y
-}
-
-define i599 @test3(i599 %X, i1 %C) {
- %V = select i1 %C, i599 70368744177664, i599 4096
- %R = urem i599 %X, %V
- ret i599 %R
-}
diff --git a/release_23/test/Transforms/InstCombine/apint-select.ll b/release_23/test/Transforms/InstCombine/apint-select.ll
deleted file mode 100644
index c2399fb88efe..000000000000
--- a/release_23/test/Transforms/InstCombine/apint-select.ll
+++ /dev/null
@@ -1,44 +0,0 @@
-; This test makes sure that these instructions are properly eliminated.
-
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep select
-
-
-define i41 @test1(i1 %C) {
- %V = select i1 %C, i41 1, i41 0 ; V = C
- ret i41 %V
-}
-
-define i999 @test2(i1 %C) {
- %V = select i1 %C, i999 0, i999 1 ; V = C
- ret i999 %V
-}
-
-define i41 @test3(i41 %X) {
- ;; (x <s 0) ? -1 : 0 -> ashr x, 31
- %t = icmp slt i41 %X, 0
- %V = select i1 %t, i41 -1, i41 0
- ret i41 %V
-}
-
-define i1023 @test4(i1023 %X) {
- ;; (x <s 0) ? -1 : 0 -> ashr x, 31
- %t = icmp slt i1023 %X, 0
- %V = select i1 %t, i1023 -1, i1023 0
- ret i1023 %V
-}
-
-define i41 @test5(i41 %X) {
- ;; ((X & 27) ? 27 : 0)
- %Y = and i41 %X, 32
- %t = icmp ne i41 %Y, 0
- %V = select i1 %t, i41 32, i41 0
- ret i41 %V
-}
-
-define i1023 @test6(i1023 %X) {
- ;; ((X & 27) ? 27 : 0)
- %Y = and i1023 %X, 64
- %t = icmp ne i1023 %Y, 0
- %V = select i1 %t, i1023 64, i1023 0
- ret i1023 %V
-}
diff --git a/release_23/test/Transforms/InstCombine/apint-shift-simplify.ll b/release_23/test/Transforms/InstCombine/apint-shift-simplify.ll
deleted file mode 100644
index a0046fbacb6b..000000000000
--- a/release_23/test/Transforms/InstCombine/apint-shift-simplify.ll
+++ /dev/null
@@ -1,23 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \
-; RUN: egrep {shl|lshr|ashr} | count 3
-
-define i41 @test0(i41 %A, i41 %B, i41 %C) {
- %X = shl i41 %A, %C
- %Y = shl i41 %B, %C
- %Z = and i41 %X, %Y
- ret i41 %Z
-}
-
-define i57 @test1(i57 %A, i57 %B, i57 %C) {
- %X = lshr i57 %A, %C
- %Y = lshr i57 %B, %C
- %Z = or i57 %X, %Y
- ret i57 %Z
-}
-
-define i49 @test2(i49 %A, i49 %B, i49 %C) {
- %X = ashr i49 %A, %C
- %Y = ashr i49 %B, %C
- %Z = xor i49 %X, %Y
- ret i49 %Z
-}
diff --git a/release_23/test/Transforms/InstCombine/apint-shift.ll b/release_23/test/Transforms/InstCombine/apint-shift.ll
deleted file mode 100644
index afc5360d8de4..000000000000
--- a/release_23/test/Transforms/InstCombine/apint-shift.ll
+++ /dev/null
@@ -1,191 +0,0 @@
-; This test makes sure that shit instructions are properly eliminated
-; even with arbitrary precision integers.
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep sh
-; END.
-
-define i47 @test1(i47 %A) {
- %B = shl i47 %A, 0 ; <i47> [#uses=1]
- ret i47 %B
-}
-
-define i41 @test2(i7 %X) {
- %A = zext i7 %X to i41 ; <i41> [#uses=1]
- %B = shl i41 0, %A ; <i41> [#uses=1]
- ret i41 %B
-}
-
-define i41 @test3(i41 %A) {
- %B = ashr i41 %A, 0 ; <i41> [#uses=1]
- ret i41 %B
-}
-
-define i39 @test4(i7 %X) {
- %A = zext i7 %X to i39 ; <i39> [#uses=1]
- %B = ashr i39 0, %A ; <i39> [#uses=1]
- ret i39 %B
-}
-
-define i55 @test5(i55 %A) {
- %B = lshr i55 %A, 55 ; <i55> [#uses=1]
- ret i55 %B
-}
-
-define i32 @test5a(i32 %A) {
- %B = shl i32 %A, 32 ; <i32> [#uses=1]
- ret i32 %B
-}
-
-define i55 @test6(i55 %A) {
- %B = shl i55 %A, 1 ; <i55> [#uses=1]
- %C = mul i55 %B, 3 ; <i55> [#uses=1]
- ret i55 %C
-}
-
-define i29 @test7(i8 %X) {
- %A = zext i8 %X to i29 ; <i29> [#uses=1]
- %B = ashr i29 -1, %A ; <i29> [#uses=1]
- ret i29 %B
-}
-
-define i7 @test8(i7 %A) {
- %B = shl i7 %A, 4 ; <i7> [#uses=1]
- %C = shl i7 %B, 3 ; <i7> [#uses=1]
- ret i7 %C
-}
-
-define i17 @test9(i17 %A) {
- %B = shl i17 %A, 16 ; <i17> [#uses=1]
- %C = lshr i17 %B, 16 ; <i17> [#uses=1]
- ret i17 %C
-}
-
-define i19 @test10(i19 %A) {
- %B = lshr i19 %A, 18 ; <i19> [#uses=1]
- %C = shl i19 %B, 18 ; <i19> [#uses=1]
- ret i19 %C
-}
-
-define i23 @test11(i23 %A) {
- %a = mul i23 %A, 3 ; <i23> [#uses=1]
- %B = lshr i23 %a, 11 ; <i23> [#uses=1]
- %C = shl i23 %B, 12 ; <i23> [#uses=1]
- ret i23 %C
-}
-
-define i47 @test12(i47 %A) {
- %B = ashr i47 %A, 8 ; <i47> [#uses=1]
- %C = shl i47 %B, 8 ; <i47> [#uses=1]
- ret i47 %C
-}
-
-define i18 @test13(i18 %A) {
- %a = mul i18 %A, 3 ; <i18> [#uses=1]
- %B = ashr i18 %a, 8 ; <i18> [#uses=1]
- %C = shl i18 %B, 9 ; <i18> [#uses=1]
- ret i18 %C
-}
-
-define i35 @test14(i35 %A) {
- %B = lshr i35 %A, 4 ; <i35> [#uses=1]
- %C = or i35 %B, 1234 ; <i35> [#uses=1]
- %D = shl i35 %C, 4 ; <i35> [#uses=1]
- ret i35 %D
-}
-
-define i79 @test14a(i79 %A) {
- %B = shl i79 %A, 4 ; <i79> [#uses=1]
- %C = and i79 %B, 1234 ; <i79> [#uses=1]
- %D = lshr i79 %C, 4 ; <i79> [#uses=1]
- ret i79 %D
-}
-
-define i45 @test15(i1 %C) {
- %A = select i1 %C, i45 3, i45 1 ; <i45> [#uses=1]
- %V = shl i45 %A, 2 ; <i45> [#uses=1]
- ret i45 %V
-}
-
-define i53 @test15a(i1 %X) {
- %A = select i1 %X, i8 3, i8 1 ; <i8> [#uses=1]
- %B = zext i8 %A to i53 ; <i53> [#uses=1]
- %V = shl i53 64, %B ; <i53> [#uses=1]
- ret i53 %V
-}
-
-define i1 @test16(i84 %X) {
- %tmp.3 = ashr i84 %X, 4 ; <i84> [#uses=1]
- %tmp.6 = and i84 %tmp.3, 1 ; <i84> [#uses=1]
- %tmp.7 = icmp ne i84 %tmp.6, 0 ; <i1> [#uses=1]
- ret i1 %tmp.7
-}
-
-define i1 @test17(i106 %A) {
- %B = lshr i106 %A, 3 ; <i106> [#uses=1]
- %C = icmp eq i106 %B, 1234 ; <i1> [#uses=1]
- ret i1 %C
-}
-
-define i1 @test18(i11 %A) {
- %B = lshr i11 %A, 10 ; <i11> [#uses=1]
- %C = icmp eq i11 %B, 123 ; <i1> [#uses=1]
- ret i1 %C
-}
-
-define i1 @test19(i37 %A) {
- %B = ashr i37 %A, 2 ; <i37> [#uses=1]
- %C = icmp eq i37 %B, 0 ; <i1> [#uses=1]
- ret i1 %C
-}
-
-define i1 @test19a(i39 %A) {
- %B = ashr i39 %A, 2 ; <i39> [#uses=1]
- %C = icmp eq i39 %B, -1 ; <i1> [#uses=1]
- ret i1 %C
-}
-
-define i1 @test20(i13 %A) {
- %B = ashr i13 %A, 12 ; <i13> [#uses=1]
- %C = icmp eq i13 %B, 123 ; <i1> [#uses=1]
- ret i1 %C
-}
-
-define i1 @test21(i12 %A) {
- %B = shl i12 %A, 6 ; <i12> [#uses=1]
- %C = icmp eq i12 %B, -128 ; <i1> [#uses=1]
- ret i1 %C
-}
-
-define i1 @test22(i14 %A) {
- %B = shl i14 %A, 7 ; <i14> [#uses=1]
- %C = icmp eq i14 %B, 0 ; <i1> [#uses=1]
- ret i1 %C
-}
-
-define i11 @test23(i44 %A) {
- %B = shl i44 %A, 33 ; <i44> [#uses=1]
- %C = ashr i44 %B, 33 ; <i44> [#uses=1]
- %D = trunc i44 %C to i11 ; <i8> [#uses=1]
- ret i11 %D
-}
-
-define i17 @test24(i17 %X) {
- %Y = and i17 %X, -5 ; <i17> [#uses=1]
- %Z = shl i17 %Y, 9 ; <i17> [#uses=1]
- %Q = ashr i17 %Z, 9 ; <i17> [#uses=1]
- ret i17 %Q
-}
-
-define i37 @test25(i37 %tmp.2, i37 %AA) {
- %x = lshr i37 %AA, 17 ; <i37> [#uses=1]
- %tmp.3 = lshr i37 %tmp.2, 17 ; <i37> [#uses=1]
- %tmp.5 = add i37 %tmp.3, %x ; <i37> [#uses=1]
- %tmp.6 = shl i37 %tmp.5, 17 ; <i37> [#uses=1]
- ret i37 %tmp.6
-}
-
-define i40 @test26(i40 %A) {
- %B = lshr i40 %A, 1 ; <i40> [#uses=1]
- %C = bitcast i40 %B to i40 ; <i40> [#uses=1]
- %D = shl i40 %C, 1 ; <i40> [#uses=1]
- ret i40 %D
-}
diff --git a/release_23/test/Transforms/InstCombine/apint-shl-trunc.ll b/release_23/test/Transforms/InstCombine/apint-shl-trunc.ll
deleted file mode 100644
index a9cffdef04f4..000000000000
--- a/release_23/test/Transforms/InstCombine/apint-shl-trunc.ll
+++ /dev/null
@@ -1,14 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep shl
-; END.
-
-define i1 @test0(i39 %X, i39 %A) {
- %B = lshr i39 %X, %A
- %D = trunc i39 %B to i1
- ret i1 %D
-}
-
-define i1 @test1(i799 %X, i799 %A) {
- %B = lshr i799 %X, %A
- %D = trunc i799 %B to i1
- ret i1 %D
-}
diff --git a/release_23/test/Transforms/InstCombine/apint-sub.ll b/release_23/test/Transforms/InstCombine/apint-sub.ll
deleted file mode 100644
index 12f366de7f46..000000000000
--- a/release_23/test/Transforms/InstCombine/apint-sub.ll
+++ /dev/null
@@ -1,139 +0,0 @@
-; This test makes sure that sub instructions are properly eliminated
-; even with arbitrary precision integers.
-;
-
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \
-; RUN: grep -v {sub i19 %Cok, %Bok} | not grep sub
-; END.
-
-define i23 @test1(i23 %A) {
- %B = sub i23 %A, %A ; <i23> [#uses=1]
- ret i23 %B
-}
-
-define i47 @test2(i47 %A) {
- %B = sub i47 %A, 0 ; <i47> [#uses=1]
- ret i47 %B
-}
-
-define i97 @test3(i97 %A) {
- %B = sub i97 0, %A ; <i97> [#uses=1]
- %C = sub i97 0, %B ; <i97> [#uses=1]
- ret i97 %C
-}
-
-define i108 @test4(i108 %A, i108 %x) {
- %B = sub i108 0, %A ; <i108> [#uses=1]
- %C = sub i108 %x, %B ; <i108> [#uses=1]
- ret i108 %C
-}
-
-define i19 @test5(i19 %A, i19 %Bok, i19 %Cok) {
- %D = sub i19 %Bok, %Cok ; <i19> [#uses=1]
- %E = sub i19 %A, %D ; <i19> [#uses=1]
- ret i19 %E
-}
-
-define i57 @test6(i57 %A, i57 %B) {
- %C = and i57 %A, %B ; <i57> [#uses=1]
- %D = sub i57 %A, %C ; <i57> [#uses=1]
- ret i57 %D
-}
-
-define i77 @test7(i77 %A) {
- %B = sub i77 -1, %A ; <i77> [#uses=1]
- ret i77 %B
-}
-
-define i27 @test8(i27 %A) {
- %B = mul i27 9, %A ; <i27> [#uses=1]
- %C = sub i27 %B, %A ; <i27> [#uses=1]
- ret i27 %C
-}
-
-define i42 @test9(i42 %A) {
- %B = mul i42 3, %A ; <i42> [#uses=1]
- %C = sub i42 %A, %B ; <i42> [#uses=1]
- ret i42 %C
-}
-
-define i124 @test10(i124 %A, i124 %B) {
- %C = sub i124 0, %A ; <i124> [#uses=1]
- %D = sub i124 0, %B ; <i124> [#uses=1]
- %E = mul i124 %C, %D ; <i124> [#uses=1]
- ret i124 %E
-}
-
-define i55 @test10a(i55 %A) {
- %C = sub i55 0, %A ; <i55> [#uses=1]
- %E = mul i55 %C, 7 ; <i55> [#uses=1]
- ret i55 %E
-}
-
-define i1 @test11(i9 %A, i9 %B) {
- %C = sub i9 %A, %B ; <i9> [#uses=1]
- %cD = icmp ne i9 %C, 0 ; <i1> [#uses=1]
- ret i1 %cD
-}
-
-define i43 @test12(i43 %A) {
- %B = ashr i43 %A, 42 ; <i43> [#uses=1]
- %C = sub i43 0, %B ; <i43> [#uses=1]
- ret i43 %C
-}
-
-define i79 @test13(i79 %A) {
- %B = lshr i79 %A, 78 ; <i79> [#uses=1]
- %C = sub i79 0, %B ; <i79> [#uses=1]
- ret i79 %C
-}
-
-define i1024 @test14(i1024 %A) {
- %B = lshr i1024 %A, 1023 ; <i1024> [#uses=1]
- %C = bitcast i1024 %B to i1024 ; <i1024> [#uses=1]
- %D = sub i1024 0, %C ; <i1024> [#uses=1]
- ret i1024 %D
-}
-
-define i14 @test15(i14 %A, i14 %B) {
- %C = sub i14 0, %A ; <i14> [#uses=1]
- %D = srem i14 %B, %C ; <i14> [#uses=1]
- ret i14 %D
-}
-
-define i51 @test16(i51 %A) {
- %X = sdiv i51 %A, 1123 ; <i51> [#uses=1]
- %Y = sub i51 0, %X ; <i51> [#uses=1]
- ret i51 %Y
-}
-
-define i25 @test17(i25 %A) {
- %B = sub i25 0, %A ; <i25> [#uses=1]
- %C = sdiv i25 %B, 1234 ; <i25> [#uses=1]
- ret i25 %C
-}
-
-define i128 @test18(i128 %Y) {
- %tmp.4 = shl i128 %Y, 2 ; <i128> [#uses=1]
- %tmp.12 = shl i128 %Y, 2 ; <i128> [#uses=1]
- %tmp.8 = sub i128 %tmp.4, %tmp.12 ; <i128> [#uses=1]
- ret i128 %tmp.8
-}
-
-define i39 @test19(i39 %X, i39 %Y) {
- %Z = sub i39 %X, %Y ; <i39> [#uses=1]
- %Q = add i39 %Z, %Y ; <i39> [#uses=1]
- ret i39 %Q
-}
-
-define i1 @test20(i33 %g, i33 %h) {
- %tmp.2 = sub i33 %g, %h ; <i33> [#uses=1]
- %tmp.4 = icmp ne i33 %tmp.2, %g ; <i1> [#uses=1]
- ret i1 %tmp.4
-}
-
-define i1 @test21(i256 %g, i256 %h) {
- %tmp.2 = sub i256 %g, %h ; <i256> [#uses=1]
- %tmp.4 = icmp ne i256 %tmp.2, %g; <i1> [#uses=1]
- ret i1 %tmp.4
-}
diff --git a/release_23/test/Transforms/InstCombine/apint-xor1.ll b/release_23/test/Transforms/InstCombine/apint-xor1.ll
deleted file mode 100644
index 5ddf5cf9c9b6..000000000000
--- a/release_23/test/Transforms/InstCombine/apint-xor1.ll
+++ /dev/null
@@ -1,50 +0,0 @@
-; This test makes sure that xor instructions are properly eliminated.
-; This test is for Integer BitWidth <= 64 && BitWidth % 8 != 0.
-
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep {xor }
-
-
-define i47 @test1(i47 %A, i47 %B) {
- ;; (A & C1)^(B & C2) -> (A & C1)|(B & C2) iff C1&C2 == 0
- %A1 = and i47 %A, 70368744177664
- %B1 = and i47 %B, 70368744177661
- %C1 = xor i47 %A1, %B1
- ret i47 %C1
-}
-
-define i15 @test2(i15 %x) {
- %tmp.2 = xor i15 %x, 0
- ret i15 %tmp.2
-}
-
-define i23 @test3(i23 %x) {
- %tmp.2 = xor i23 %x, %x
- ret i23 %tmp.2
-}
-
-define i37 @test4(i37 %x) {
- ; x ^ ~x == -1
- %NotX = xor i37 -1, %x
- %B = xor i37 %x, %NotX
- ret i37 %B
-}
-
-define i7 @test5(i7 %A) {
- ;; (A|B)^B == A & (~B)
- %t1 = or i7 %A, 23
- %r = xor i7 %t1, 23
- ret i7 %r
-}
-
-define i7 @test6(i7 %A) {
- %t1 = xor i7 %A, 23
- %r = xor i7 %t1, 23
- ret i7 %r
-}
-
-define i47 @test7(i47 %A) {
- ;; (A | C1) ^ C2 -> (A | C1) & ~C2 iff (C1&C2) == C2
- %B1 = or i47 %A, 70368744177663
- %C1 = xor i47 %B1, 703687463
- ret i47 %C1
-}
diff --git a/release_23/test/Transforms/InstCombine/apint-xor2.ll b/release_23/test/Transforms/InstCombine/apint-xor2.ll
deleted file mode 100644
index 4d2d415f3467..000000000000
--- a/release_23/test/Transforms/InstCombine/apint-xor2.ll
+++ /dev/null
@@ -1,51 +0,0 @@
-; This test makes sure that xor instructions are properly eliminated.
-; This test is for Integer BitWidth > 64 && BitWidth <= 1024.
-
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep {xor }
-; END.
-
-
-define i447 @test1(i447 %A, i447 %B) {
- ;; (A & C1)^(B & C2) -> (A & C1)|(B & C2) iff C1&C2 == 0
- %A1 = and i447 %A, 70368744177664
- %B1 = and i447 %B, 70368744177663
- %C1 = xor i447 %A1, %B1
- ret i447 %C1
-}
-
-define i1005 @test2(i1005 %x) {
- %tmp.2 = xor i1005 %x, 0
- ret i1005 %tmp.2
-}
-
-define i123 @test3(i123 %x) {
- %tmp.2 = xor i123 %x, %x
- ret i123 %tmp.2
-}
-
-define i737 @test4(i737 %x) {
- ; x ^ ~x == -1
- %NotX = xor i737 -1, %x
- %B = xor i737 %x, %NotX
- ret i737 %B
-}
-
-define i700 @test5(i700 %A) {
- ;; (A|B)^B == A & (~B)
- %t1 = or i700 %A, 288230376151711743
- %r = xor i700 %t1, 288230376151711743
- ret i700 %r
-}
-
-define i77 @test6(i77 %A) {
- %t1 = xor i77 %A, 23
- %r = xor i77 %t1, 23
- ret i77 %r
-}
-
-define i1023 @test7(i1023 %A) {
- ;; (A | C1) ^ C2 -> (A | C1) & ~C2 iff (C1&C2) == C2
- %B1 = or i1023 %A, 70368744177663
- %C1 = xor i1023 %B1, 703687463
- ret i1023 %C1
-}
diff --git a/release_23/test/Transforms/InstCombine/apint-zext1.ll b/release_23/test/Transforms/InstCombine/apint-zext1.ll
deleted file mode 100644
index 03330c7be966..000000000000
--- a/release_23/test/Transforms/InstCombine/apint-zext1.ll
+++ /dev/null
@@ -1,9 +0,0 @@
-; Tests to make sure elimination of casts is working correctly
-; This test is for Integer BitWidth <= 64 && BitWidth % 2 != 0.
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | notcast {} {%c1.*}
-
-define i47 @test_sext_zext(i11 %A) {
- %c1 = zext i11 %A to i39
- %c2 = sext i39 %c1 to i47
- ret i47 %c2
-}
diff --git a/release_23/test/Transforms/InstCombine/apint-zext2.ll b/release_23/test/Transforms/InstCombine/apint-zext2.ll
deleted file mode 100644
index 8350d10282b6..000000000000
--- a/release_23/test/Transforms/InstCombine/apint-zext2.ll
+++ /dev/null
@@ -1,9 +0,0 @@
-; Tests to make sure elimination of casts is working correctly
-; This test is for Integer BitWidth > 64 && BitWidth <= 1024.
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | notcast {} {%c1.*}
-
-define i1024 @test_sext_zext(i77 %A) {
- %c1 = zext i77 %A to i533
- %c2 = sext i533 %c1 to i1024
- ret i1024 %c2
-}
diff --git a/release_23/test/Transforms/InstCombine/binop-cast.ll b/release_23/test/Transforms/InstCombine/binop-cast.ll
deleted file mode 100644
index ea5299ba8761..000000000000
--- a/release_23/test/Transforms/InstCombine/binop-cast.ll
+++ /dev/null
@@ -1,7 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | notcast
-
-define i32 @testAdd(i32 %X, i32 %Y) {
- %tmp = add i32 %X, %Y
- %tmp.l = bitcast i32 %tmp to i32
- ret i32 %tmp.l
-}
diff --git a/release_23/test/Transforms/InstCombine/bit-tracking.ll b/release_23/test/Transforms/InstCombine/bit-tracking.ll
deleted file mode 100644
index d090c69d7f3c..000000000000
--- a/release_23/test/Transforms/InstCombine/bit-tracking.ll
+++ /dev/null
@@ -1,26 +0,0 @@
-; This file contains various testcases that require tracking whether bits are
-; set or cleared by various instructions.
-; RUN: llvm-as < %s | opt -instcombine -instcombine | llvm-dis |\
-; RUN: not grep %ELIM
-
-; Reduce down to a single XOR
-define i32 @test3(i32 %B) {
- %ELIMinc = and i32 %B, 1 ; <i32> [#uses=1]
- %tmp.5 = xor i32 %ELIMinc, 1 ; <i32> [#uses=1]
- %ELIM7 = and i32 %B, -2 ; <i32> [#uses=1]
- %tmp.8 = or i32 %tmp.5, %ELIM7 ; <i32> [#uses=1]
- ret i32 %tmp.8
-}
-
-; Finally, a bigger case where we chain things together. This corresponds to
-; incrementing a single-bit bitfield, which should become just an xor.
-define i32 @test4(i32 %B) {
- %ELIM3 = shl i32 %B, 31 ; <i32> [#uses=1]
- %ELIM4 = ashr i32 %ELIM3, 31 ; <i32> [#uses=1]
- %inc = add i32 %ELIM4, 1 ; <i32> [#uses=1]
- %ELIM5 = and i32 %inc, 1 ; <i32> [#uses=1]
- %ELIM7 = and i32 %B, -2 ; <i32> [#uses=1]
- %tmp.8 = or i32 %ELIM5, %ELIM7 ; <i32> [#uses=1]
- ret i32 %tmp.8
-}
-
diff --git a/release_23/test/Transforms/InstCombine/bitcast-gep.ll b/release_23/test/Transforms/InstCombine/bitcast-gep.ll
deleted file mode 100644
index 5a514ab5c67a..000000000000
--- a/release_23/test/Transforms/InstCombine/bitcast-gep.ll
+++ /dev/null
@@ -1,19 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep bitcast
-; RUN: llvm-as < %s | opt -instcombine -scalarrepl | llvm-dis | grep {ret i8. %v}
-; PR1345
-
-target datalayout = "E-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64"
-target triple = "powerpc-apple-darwin8.8.0"
-
-define i8* @test(i8* %v) {
- %A = alloca [4 x i8*], align 16 ; <[4 x i8*]*> [#uses=3]
- %B = getelementptr [4 x i8*]* %A, i32 0, i32 0 ; <i8**> [#uses=1]
- store i8* null, i8** %B
- %C = bitcast [4 x i8*]* %A to { [16 x i8] }* ; <{ [16 x i8] }*> [#uses=1]
- %D = getelementptr { [16 x i8] }* %C, i32 0, i32 0, i32 8 ; <i8*> [#uses=1]
- %E = bitcast i8* %D to i8** ; <i8**> [#uses=1]
- store i8* %v, i8** %E
- %F = getelementptr [4 x i8*]* %A, i32 0, i32 2 ; <i8**> [#uses=1]
- %G = load i8** %F ; <i8*> [#uses=1]
- ret i8* %G
-}
diff --git a/release_23/test/Transforms/InstCombine/bitcast-vector-fold.ll b/release_23/test/Transforms/InstCombine/bitcast-vector-fold.ll
deleted file mode 100644
index ded3e2f10aba..000000000000
--- a/release_23/test/Transforms/InstCombine/bitcast-vector-fold.ll
+++ /dev/null
@@ -1,33 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep bitcast
-target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
-target triple = "i686-apple-darwin8"
-
-define <2 x i64> @test1() {
- %tmp3 = bitcast <4 x i32> < i32 0, i32 1, i32 2, i32 3 > to <2 x i64>
- ret <2 x i64> %tmp3
-}
-
-define <4 x i32> @test2() {
- %tmp3 = bitcast <2 x i64> < i64 0, i64 1 > to <4 x i32>
- ret <4 x i32> %tmp3
-}
-
-define <2 x double> @test3() {
- %tmp3 = bitcast <4 x i32> < i32 0, i32 1, i32 2, i32 3 > to <2 x double>
- ret <2 x double> %tmp3
-}
-
-define <4 x float> @test4() {
- %tmp3 = bitcast <2 x i64> < i64 0, i64 1 > to <4 x float>
- ret <4 x float> %tmp3
-}
-
-define <2 x i64> @test5() {
- %tmp3 = bitcast <4 x float> <float 0.0, float 1.0, float 2.0, float 3.0> to <2 x i64>
- ret <2 x i64> %tmp3
-}
-
-define <4 x i32> @test6() {
- %tmp3 = bitcast <2 x double> <double 0.5, double 1.0> to <4 x i32>
- ret <4 x i32> %tmp3
-}
diff --git a/release_23/test/Transforms/InstCombine/bitcount.ll b/release_23/test/Transforms/InstCombine/bitcount.ll
deleted file mode 100644
index 8ebf289eb7d7..000000000000
--- a/release_23/test/Transforms/InstCombine/bitcount.ll
+++ /dev/null
@@ -1,19 +0,0 @@
-; Tests to make sure bit counts of constants are folded
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {ret i32 19}
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \
-; RUN: grep -v declare | not grep llvm.ct
-
-declare i31 @llvm.ctpop.i31(i31 %val)
-declare i32 @llvm.cttz.i32(i32 %val)
-declare i33 @llvm.ctlz.i33(i33 %val)
-
-define i32 @test(i32 %A) {
- %c1 = call i31 @llvm.ctpop.i31(i31 12415124)
- %c2 = call i32 @llvm.cttz.i32(i32 87359874)
- %c3 = call i33 @llvm.ctlz.i33(i33 87359874)
- %t1 = zext i31 %c1 to i32
- %t3 = trunc i33 %c3 to i32
- %r1 = add i32 %t1, %c2
- %r2 = add i32 %r1, %t3
- ret i32 %r2
-}
diff --git a/release_23/test/Transforms/InstCombine/bittest.ll b/release_23/test/Transforms/InstCombine/bittest.ll
deleted file mode 100644
index 8d45a48aa91d..000000000000
--- a/release_23/test/Transforms/InstCombine/bittest.ll
+++ /dev/null
@@ -1,30 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine -simplifycfg | llvm-dis |\
-; RUN: not grep {call void @abort}
-
-@b_rec.0 = external global i32 ; <i32*> [#uses=2]
-
-define void @_Z12h000007_testv(i32* %P) {
-entry:
- %tmp.2 = load i32* @b_rec.0 ; <i32> [#uses=1]
- %tmp.9 = or i32 %tmp.2, -989855744 ; <i32> [#uses=2]
- %tmp.16 = and i32 %tmp.9, -805306369 ; <i32> [#uses=2]
- %tmp.17 = and i32 %tmp.9, -973078529 ; <i32> [#uses=1]
- store i32 %tmp.17, i32* @b_rec.0
- %tmp.17.shrunk = bitcast i32 %tmp.16 to i32 ; <i32> [#uses=1]
- %tmp.22 = and i32 %tmp.17.shrunk, -1073741824 ; <i32> [#uses=1]
- %tmp.23 = icmp eq i32 %tmp.22, -1073741824 ; <i1> [#uses=1]
- br i1 %tmp.23, label %endif.0, label %then.0
-
-then.0: ; preds = %entry
- tail call void @abort( )
- unreachable
-
-endif.0: ; preds = %entry
- %tmp.17.shrunk2 = bitcast i32 %tmp.16 to i32 ; <i32> [#uses=1]
- %tmp.27.mask = and i32 %tmp.17.shrunk2, 100663295 ; <i32> [#uses=1]
- store i32 %tmp.27.mask, i32* %P
- ret void
-}
-
-declare void @abort()
-
diff --git a/release_23/test/Transforms/InstCombine/bswap-fold.ll b/release_23/test/Transforms/InstCombine/bswap-fold.ll
deleted file mode 100644
index 3d354a102161..000000000000
--- a/release_23/test/Transforms/InstCombine/bswap-fold.ll
+++ /dev/null
@@ -1,29 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \
-; RUN: grep ret | count 3
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \
-; RUN: not grep call.*bswap
-
-define i1 @test1(i16 %tmp2) {
- %tmp10 = call i16 @llvm.bswap.i16( i16 %tmp2 ) ; <i16> [#uses=1]
- %tmp = icmp eq i16 %tmp10, 1 ; <i1> [#uses=1]
- ret i1 %tmp
-}
-
-define i1 @test2(i32 %tmp) {
- %tmp34 = tail call i32 @llvm.bswap.i32( i32 %tmp ) ; <i32> [#uses=1]
- %tmp.upgrd.1 = icmp eq i32 %tmp34, 1 ; <i1> [#uses=1]
- ret i1 %tmp.upgrd.1
-}
-
-declare i32 @llvm.bswap.i32(i32)
-
-define i1 @test3(i64 %tmp) {
- %tmp34 = tail call i64 @llvm.bswap.i64( i64 %tmp ) ; <i64> [#uses=1]
- %tmp.upgrd.2 = icmp eq i64 %tmp34, 1 ; <i1> [#uses=1]
- ret i1 %tmp.upgrd.2
-}
-
-declare i64 @llvm.bswap.i64(i64)
-
-declare i16 @llvm.bswap.i16(i16)
-
diff --git a/release_23/test/Transforms/InstCombine/bswap.ll b/release_23/test/Transforms/InstCombine/bswap.ll
deleted file mode 100644
index 5db4e73a5463..000000000000
--- a/release_23/test/Transforms/InstCombine/bswap.ll
+++ /dev/null
@@ -1,57 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \
-; RUN: grep {call.*llvm.bswap} | count 5
-
-define i32 @test1(i32 %i) {
- %tmp1 = lshr i32 %i, 24 ; <i32> [#uses=1]
- %tmp3 = lshr i32 %i, 8 ; <i32> [#uses=1]
- %tmp4 = and i32 %tmp3, 65280 ; <i32> [#uses=1]
- %tmp5 = or i32 %tmp1, %tmp4 ; <i32> [#uses=1]
- %tmp7 = shl i32 %i, 8 ; <i32> [#uses=1]
- %tmp8 = and i32 %tmp7, 16711680 ; <i32> [#uses=1]
- %tmp9 = or i32 %tmp5, %tmp8 ; <i32> [#uses=1]
- %tmp11 = shl i32 %i, 24 ; <i32> [#uses=1]
- %tmp12 = or i32 %tmp9, %tmp11 ; <i32> [#uses=1]
- ret i32 %tmp12
-}
-
-define i32 @test2(i32 %arg) {
- %tmp2 = shl i32 %arg, 24 ; <i32> [#uses=1]
- %tmp4 = shl i32 %arg, 8 ; <i32> [#uses=1]
- %tmp5 = and i32 %tmp4, 16711680 ; <i32> [#uses=1]
- %tmp6 = or i32 %tmp2, %tmp5 ; <i32> [#uses=1]
- %tmp8 = lshr i32 %arg, 8 ; <i32> [#uses=1]
- %tmp9 = and i32 %tmp8, 65280 ; <i32> [#uses=1]
- %tmp10 = or i32 %tmp6, %tmp9 ; <i32> [#uses=1]
- %tmp12 = lshr i32 %arg, 24 ; <i32> [#uses=1]
- %tmp14 = or i32 %tmp10, %tmp12 ; <i32> [#uses=1]
- ret i32 %tmp14
-}
-
-define i16 @test3(i16 %s) {
- %tmp2 = lshr i16 %s, 8 ; <i16> [#uses=1]
- %tmp4 = shl i16 %s, 8 ; <i16> [#uses=1]
- %tmp5 = or i16 %tmp2, %tmp4 ; <i16> [#uses=1]
- ret i16 %tmp5
-}
-
-define i16 @test4(i16 %s) {
- %tmp2 = lshr i16 %s, 8 ; <i16> [#uses=1]
- %tmp4 = shl i16 %s, 8 ; <i16> [#uses=1]
- %tmp5 = or i16 %tmp4, %tmp2 ; <i16> [#uses=1]
- ret i16 %tmp5
-}
-
-define i16 @test5(i16 %a) {
- %tmp = zext i16 %a to i32 ; <i32> [#uses=2]
- %tmp1 = and i32 %tmp, 65280 ; <i32> [#uses=1]
- %tmp2 = ashr i32 %tmp1, 8 ; <i32> [#uses=1]
- %tmp2.upgrd.1 = trunc i32 %tmp2 to i16 ; <i16> [#uses=1]
- %tmp4 = and i32 %tmp, 255 ; <i32> [#uses=1]
- %tmp5 = shl i32 %tmp4, 8 ; <i32> [#uses=1]
- %tmp5.upgrd.2 = trunc i32 %tmp5 to i16 ; <i16> [#uses=1]
- %tmp.upgrd.3 = or i16 %tmp2.upgrd.1, %tmp5.upgrd.2 ; <i16> [#uses=1]
- %tmp6 = bitcast i16 %tmp.upgrd.3 to i16 ; <i16> [#uses=1]
- %tmp6.upgrd.4 = zext i16 %tmp6 to i32 ; <i32> [#uses=1]
- %retval = trunc i32 %tmp6.upgrd.4 to i16 ; <i16> [#uses=1]
- ret i16 %retval
-}
diff --git a/release_23/test/Transforms/InstCombine/call-cast-target.ll b/release_23/test/Transforms/InstCombine/call-cast-target.ll
deleted file mode 100644
index 1a02514d1a7b..000000000000
--- a/release_23/test/Transforms/InstCombine/call-cast-target.ll
+++ /dev/null
@@ -1,14 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \
-; RUN: grep call | not grep bitcast
-
-target datalayout = "e-p:32:32"
-target triple = "i686-pc-linux-gnu"
-
-define i32 @main() {
-entry:
- %tmp = call i32 bitcast (i8* (i32*)* @ctime to i32 (i32*)*)( i32* null ) ; <i32> [#uses=1]
- ret i32 %tmp
-}
-
-declare i8* @ctime(i32*)
-
diff --git a/release_23/test/Transforms/InstCombine/call-intrinsics.ll b/release_23/test/Transforms/InstCombine/call-intrinsics.ll
deleted file mode 100644
index e1c60570f14f..000000000000
--- a/release_23/test/Transforms/InstCombine/call-intrinsics.ll
+++ /dev/null
@@ -1,19 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis
-
-@X = global i8 0 ; <i8*> [#uses=3]
-@Y = global i8 12 ; <i8*> [#uses=2]
-
-declare void @llvm.memmove.i32(i8*, i8*, i32, i32)
-
-declare void @llvm.memcpy.i32(i8*, i8*, i32, i32)
-
-declare void @llvm.memset.i32(i8*, i8, i32, i32)
-
-define void @zero_byte_test() {
- ; These process zero bytes, so they are a noop.
- call void @llvm.memmove.i32( i8* @X, i8* @Y, i32 0, i32 100 )
- call void @llvm.memcpy.i32( i8* @X, i8* @Y, i32 0, i32 100 )
- call void @llvm.memset.i32( i8* @X, i8 123, i32 0, i32 100 )
- ret void
-}
-
diff --git a/release_23/test/Transforms/InstCombine/call.ll b/release_23/test/Transforms/InstCombine/call.ll
deleted file mode 100644
index 9f9a28075599..000000000000
--- a/release_23/test/Transforms/InstCombine/call.ll
+++ /dev/null
@@ -1,77 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \
-; RUN: grep call | notcast
-; END.
-
-
-; Simple case, argument translatable without changing the value
-declare void @test1a(i8*)
-
-define void @test1(i32* %A) {
- call void bitcast (void (i8*)* @test1a to void (i32*)*)( i32* %A )
- ret void
-}
-
-; More complex case, translate argument because of resolution. This is safe
-; because we have the body of the function
-define void @test2a(i8 %A) {
- ret void
-}
-
-define i32 @test2(i32 %A) {
- call void bitcast (void (i8)* @test2a to void (i32)*)( i32 %A )
- ret i32 %A
-}
-
-
-; Resolving this should insert a cast from sbyte to int, following the C
-; promotion rules.
-declare void @test3a(i8, ...)
-
-define void @test3(i8 %A, i8 %B) {
- call void bitcast (void (i8, ...)* @test3a to void (i8, i8)*)( i8 %A, i8 %B
-)
- ret void
-}
-
-
-; test conversion of return value...
-define i8 @test4a() {
- ret i8 0
-}
-
-define i32 @test4() {
- %X = call i32 bitcast (i8 ()* @test4a to i32 ()*)( ) ; <i32> [#uses=1]
- ret i32 %X
-}
-
-
-; test conversion of return value... no value conversion occurs so we can do
-; this with just a prototype...
-declare i32 @test5a()
-
-define i32 @test5() {
- %X = call i32 @test5a( ) ; <i32> [#uses=1]
- ret i32 %X
-}
-
-
-; test addition of new arguments...
-declare i32 @test6a(i32)
-
-define i32 @test6() {
- %X = call i32 bitcast (i32 (i32)* @test6a to i32 ()*)( ) ; <i32> [#uses=1]
- ret i32 %X
-}
-
-
-; test removal of arguments, only can happen with a function body
-define void @test7a() {
- ret void
-}
-
-define void @test7() {
- call void bitcast (void ()* @test7a to void (i32)*)( i32 5 )
- ret void
-}
-
-
diff --git a/release_23/test/Transforms/InstCombine/call2.ll b/release_23/test/Transforms/InstCombine/call2.ll
deleted file mode 100644
index 4ba840f7fb96..000000000000
--- a/release_23/test/Transforms/InstCombine/call2.ll
+++ /dev/null
@@ -1,27 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis
-
-; This used to crash trying to do a double-to-pointer conversion
-define i32 @bar() {
-entry:
- %retval = alloca i32, align 4 ; <i32*> [#uses=1]
- "alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
- %tmp = call i32 (...)* bitcast (i32 (i8*)* @f to i32 (...)*)( double 3.000000e+00 ) ; <i32> [#uses=0]
- br label %return
-
-return: ; preds = %entry
- %retval1 = load i32* %retval ; <i32> [#uses=1]
- ret i32 %retval1
-}
-
-define i32 @f(i8* %p) {
-entry:
- %p_addr = alloca i8* ; <i8**> [#uses=1]
- %retval = alloca i32, align 4 ; <i32*> [#uses=1]
- "alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
- store i8* %p, i8** %p_addr
- br label %return
-
-return: ; preds = %entry
- %retval1 = load i32* %retval ; <i32> [#uses=1]
- ret i32 %retval1
-}
diff --git a/release_23/test/Transforms/InstCombine/canonicalize_branch.ll b/release_23/test/Transforms/InstCombine/canonicalize_branch.ll
deleted file mode 100644
index 79f02e73209a..000000000000
--- a/release_23/test/Transforms/InstCombine/canonicalize_branch.ll
+++ /dev/null
@@ -1,36 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \
-; RUN: not grep {icmp ne\|icmp ule\|icmp uge}
-
-define i32 @test1(i32 %X, i32 %Y) {
- %C = icmp ne i32 %X, %Y ; <i1> [#uses=1]
- br i1 %C, label %T, label %F
-
-T: ; preds = %0
- ret i32 12
-
-F: ; preds = %0
- ret i32 123
-}
-
-define i32 @test2(i32 %X, i32 %Y) {
- %C = icmp ule i32 %X, %Y ; <i1> [#uses=1]
- br i1 %C, label %T, label %F
-
-T: ; preds = %0
- ret i32 12
-
-F: ; preds = %0
- ret i32 123
-}
-
-define i32 @test3(i32 %X, i32 %Y) {
- %C = icmp uge i32 %X, %Y ; <i1> [#uses=1]
- br i1 %C, label %T, label %F
-
-T: ; preds = %0
- ret i32 12
-
-F: ; preds = %0
- ret i32 123
-}
-
diff --git a/release_23/test/Transforms/InstCombine/cast-and-cast.ll b/release_23/test/Transforms/InstCombine/cast-and-cast.ll
deleted file mode 100644
index f90cb7499aff..000000000000
--- a/release_23/test/Transforms/InstCombine/cast-and-cast.ll
+++ /dev/null
@@ -1,17 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \
-; RUN: not grep bitcast
-
-define i1 @test1(i32 %val) {
- %t1 = bitcast i32 %val to i32 ; <i32> [#uses=1]
- %t2 = and i32 %t1, 1 ; <i32> [#uses=1]
- %t3 = trunc i32 %t2 to i1 ; <i1> [#uses=1]
- ret i1 %t3
-}
-
-define i16 @test1.upgrd.1(i32 %val) {
- %t1 = bitcast i32 %val to i32 ; <i32> [#uses=1]
- %t2 = and i32 %t1, 1 ; <i32> [#uses=1]
- %t3 = trunc i32 %t2 to i16 ; <i16> [#uses=1]
- ret i16 %t3
-}
-
diff --git a/release_23/test/Transforms/InstCombine/cast-cast-to-and.ll b/release_23/test/Transforms/InstCombine/cast-cast-to-and.ll
deleted file mode 100644
index bb7c3dd754cc..000000000000
--- a/release_23/test/Transforms/InstCombine/cast-cast-to-and.ll
+++ /dev/null
@@ -1,9 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \
-; RUN: not grep i8
-
-define i32 @test1(i32 %X) {
- %Y = trunc i32 %X to i8 ; <i8> [#uses=1]
- %Z = zext i8 %Y to i32 ; <i32> [#uses=1]
- ret i32 %Z
-}
-
diff --git a/release_23/test/Transforms/InstCombine/cast-load-gep.ll b/release_23/test/Transforms/InstCombine/cast-load-gep.ll
deleted file mode 100644
index bc2c7b35163d..000000000000
--- a/release_23/test/Transforms/InstCombine/cast-load-gep.ll
+++ /dev/null
@@ -1,20 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine -globaldce | llvm-dis | \
-; RUN: not grep Array
-
-; Pulling the cast out of the load allows us to eliminate the load, and then
-; the whole array.
-
- %op = type { float }
- %unop = type { i32 }
-@Array = internal constant [1 x %op* (%op*)*] [ %op* (%op*)* @foo ] ; <[1 x %op* (%op*)*]*> [#uses=1]
-
-define %op* @foo(%op* %X) {
- ret %op* %X
-}
-
-define %unop* @caller(%op* %O) {
- %tmp = load %unop* (%op*)** bitcast ([1 x %op* (%op*)*]* @Array to %unop* (%op*)**); <%unop* (%op*)*> [#uses=1]
- %tmp.2 = call %unop* %tmp( %op* %O ) ; <%unop*> [#uses=1]
- ret %unop* %tmp.2
-}
-
diff --git a/release_23/test/Transforms/InstCombine/cast-malloc.ll b/release_23/test/Transforms/InstCombine/cast-malloc.ll
deleted file mode 100644
index d05f6b04fd07..000000000000
--- a/release_23/test/Transforms/InstCombine/cast-malloc.ll
+++ /dev/null
@@ -1,15 +0,0 @@
-; test that casted mallocs get converted to malloc of the right type
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \
-; RUN: not grep bitcast
-
-; The target datalayout is important for this test case. We have to tell
-; instcombine that the ABI alignment for a long is 4-bytes, not 8, otherwise
-; it won't do the transform.
-target datalayout = "e-i64:32:64"
-
-define i32* @test(i32 %size) {
- %X = malloc i64, i32 %size ; <i64*> [#uses=1]
- %ret = bitcast i64* %X to i32* ; <i32*> [#uses=1]
- ret i32* %ret
-}
-
diff --git a/release_23/test/Transforms/InstCombine/cast-propagate.ll b/release_23/test/Transforms/InstCombine/cast-propagate.ll
deleted file mode 100644
index c00f9537410a..000000000000
--- a/release_23/test/Transforms/InstCombine/cast-propagate.ll
+++ /dev/null
@@ -1,11 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine -mem2reg | llvm-dis | \
-; RUN: not grep load
-
-define i32 @test1(i32* %P) {
- %A = alloca i32 ; <i32*> [#uses=2]
- store i32 123, i32* %A
- ; Cast the result of the load not the source
- %Q = bitcast i32* %A to i32* ; <i32*> [#uses=1]
- %V = load i32* %Q ; <i32> [#uses=1]
- ret i32 %V
-}
diff --git a/release_23/test/Transforms/InstCombine/cast-set.ll b/release_23/test/Transforms/InstCombine/cast-set.ll
deleted file mode 100644
index 091f148a2483..000000000000
--- a/release_23/test/Transforms/InstCombine/cast-set.ll
+++ /dev/null
@@ -1,51 +0,0 @@
-; This tests for various complex cast elimination cases instcombine should
-; handle.
-
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | notcast
-
-define i1 @test1(i32 %X) {
- %A = bitcast i32 %X to i32 ; <i32> [#uses=1]
- ; Convert to setne int %X, 12
- %c = icmp ne i32 %A, 12 ; <i1> [#uses=1]
- ret i1 %c
-}
-
-define i1 @test2(i32 %X, i32 %Y) {
- %A = bitcast i32 %X to i32 ; <i32> [#uses=1]
- %B = bitcast i32 %Y to i32 ; <i32> [#uses=1]
- ; Convert to setne int %X, %Y
- %c = icmp ne i32 %A, %B ; <i1> [#uses=1]
- ret i1 %c
-}
-
-define i32 @test4(i32 %A) {
- %B = bitcast i32 %A to i32 ; <i32> [#uses=1]
- %C = shl i32 %B, 2 ; <i32> [#uses=1]
- %D = bitcast i32 %C to i32 ; <i32> [#uses=1]
- ret i32 %D
-}
-
-define i16 @test5(i16 %A) {
- %B = sext i16 %A to i32 ; <i32> [#uses=1]
- %C = and i32 %B, 15 ; <i32> [#uses=1]
- %D = trunc i32 %C to i16 ; <i16> [#uses=1]
- ret i16 %D
-}
-
-define i1 @test6(i1 %A) {
- %B = zext i1 %A to i32 ; <i32> [#uses=1]
- %C = icmp ne i32 %B, 0 ; <i1> [#uses=1]
- ret i1 %C
-}
-
-define i1 @test6a(i1 %A) {
- %B = zext i1 %A to i32 ; <i32> [#uses=1]
- %C = icmp ne i32 %B, -1 ; <i1> [#uses=1]
- ret i1 %C
-}
-
-define i1 @test7(i8* %A) {
- %B = bitcast i8* %A to i32* ; <i32*> [#uses=1]
- %C = icmp eq i32* %B, null ; <i1> [#uses=1]
- ret i1 %C
-}
diff --git a/release_23/test/Transforms/InstCombine/cast.ll b/release_23/test/Transforms/InstCombine/cast.ll
deleted file mode 100644
index dc5e92800f4e..000000000000
--- a/release_23/test/Transforms/InstCombine/cast.ll
+++ /dev/null
@@ -1,240 +0,0 @@
-; Tests to make sure elimination of casts is working correctly
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \
-; RUN: grep %c | notcast
-; END.
-
-@inbuf = external global [32832 x i8] ; <[32832 x i8]*> [#uses=1]
-
-define i32 @test1(i32 %A) {
- %c1 = bitcast i32 %A to i32 ; <i32> [#uses=1]
- %c2 = bitcast i32 %c1 to i32 ; <i32> [#uses=1]
- ret i32 %c2
-}
-
-define i64 @test2(i8 %A) {
- %c1 = zext i8 %A to i16 ; <i16> [#uses=1]
- %c2 = zext i16 %c1 to i32 ; <i32> [#uses=1]
- %Ret = zext i32 %c2 to i64 ; <i64> [#uses=1]
- ret i64 %Ret
-}
-
-; This function should just use bitwise AND
-define i64 @test3(i64 %A) {
- %c1 = trunc i64 %A to i8 ; <i8> [#uses=1]
- %c2 = zext i8 %c1 to i64 ; <i64> [#uses=1]
- ret i64 %c2
-}
-
-define i32 @test4(i32 %A, i32 %B) {
- %COND = icmp slt i32 %A, %B ; <i1> [#uses=1]
- ; Booleans are unsigned integrals
- %c = zext i1 %COND to i8 ; <i8> [#uses=1]
- ; for the cast elim purpose
- %result = zext i8 %c to i32 ; <i32> [#uses=1]
- ret i32 %result
-}
-
-define i32 @test5(i1 %B) {
- ; This cast should get folded into
- %c = zext i1 %B to i8 ; <i8> [#uses=1]
- ; this cast
- %result = zext i8 %c to i32 ; <i32> [#uses=1]
- ret i32 %result
-}
-
-define i32 @test6(i64 %A) {
- %c1 = trunc i64 %A to i32 ; <i32> [#uses=1]
- %res = bitcast i32 %c1 to i32 ; <i32> [#uses=1]
- ret i32 %res
-}
-
-define i64 @test7(i1 %A) {
- %c1 = zext i1 %A to i32 ; <i32> [#uses=1]
- %res = sext i32 %c1 to i64 ; <i64> [#uses=1]
- ret i64 %res
-}
-
-define i64 @test8(i8 %A) {
- %c1 = sext i8 %A to i64 ; <i64> [#uses=1]
- %res = bitcast i64 %c1 to i64 ; <i64> [#uses=1]
- ret i64 %res
-}
-
-define i16 @test9(i16 %A) {
- %c1 = sext i16 %A to i32 ; <i32> [#uses=1]
- %c2 = trunc i32 %c1 to i16 ; <i16> [#uses=1]
- ret i16 %c2
-}
-
-define i16 @test10(i16 %A) {
- %c1 = sext i16 %A to i32 ; <i32> [#uses=1]
- %c2 = trunc i32 %c1 to i16 ; <i16> [#uses=1]
- ret i16 %c2
-}
-
-declare void @varargs(i32, ...)
-
-define void @test11(i32* %P) {
- %c = bitcast i32* %P to i16* ; <i16*> [#uses=1]
- call void (i32, ...)* @varargs( i32 5, i16* %c )
- ret void
-}
-
-define i32* @test12() {
- %p = malloc [4 x i8] ; <[4 x i8]*> [#uses=1]
- %c = bitcast [4 x i8]* %p to i32* ; <i32*> [#uses=1]
- ret i32* %c
-}
-define i8* @test13(i64 %A) {
- %c = getelementptr [0 x i8]* bitcast ([32832 x i8]* @inbuf to [0 x i8]*), i64 0, i64 %A ; <i8*> [#uses=1]
- ret i8* %c
-}
-
-define i1 @test14(i8 %A) {
- %c = bitcast i8 %A to i8 ; <i8> [#uses=1]
- %X = icmp ult i8 %c, -128 ; <i1> [#uses=1]
- ret i1 %X
-}
-
-
-; This just won't occur when there's no difference between ubyte and sbyte
-;bool %test15(ubyte %A) {
-; %c = cast ubyte %A to sbyte
-; %X = setlt sbyte %c, 0 ; setgt %A, 127
-; ret bool %X
-;}
-
-define i1 @test16(i32* %P) {
- %c = icmp ne i32* %P, null ; <i1> [#uses=1]
- ret i1 %c
-}
-
-define i16 @test17(i1 %tmp3) {
- %c = zext i1 %tmp3 to i32 ; <i32> [#uses=1]
- %t86 = trunc i32 %c to i16 ; <i16> [#uses=1]
- ret i16 %t86
-}
-
-define i16 @test18(i8 %tmp3) {
- %c = sext i8 %tmp3 to i32 ; <i32> [#uses=1]
- %t86 = trunc i32 %c to i16 ; <i16> [#uses=1]
- ret i16 %t86
-}
-
-define i1 @test19(i32 %X) {
- %c = sext i32 %X to i64 ; <i64> [#uses=1]
- %Z = icmp slt i64 %c, 12345 ; <i1> [#uses=1]
- ret i1 %Z
-}
-
-define i1 @test20(i1 %B) {
- %c = zext i1 %B to i32 ; <i32> [#uses=1]
- %D = icmp slt i32 %c, -1 ; <i1> [#uses=1]
- ;; false
- ret i1 %D
-}
-
-define i32 @test21(i32 %X) {
- %c1 = trunc i32 %X to i8 ; <i8> [#uses=1]
- ;; sext -> zext -> and -> nop
- %c2 = sext i8 %c1 to i32 ; <i32> [#uses=1]
- %RV = and i32 %c2, 255 ; <i32> [#uses=1]
- ret i32 %RV
-}
-
-define i32 @test22(i32 %X) {
- %c1 = trunc i32 %X to i8 ; <i8> [#uses=1]
- ;; sext -> zext -> and -> nop
- %c2 = sext i8 %c1 to i32 ; <i32> [#uses=1]
- %RV = shl i32 %c2, 24 ; <i32> [#uses=1]
- ret i32 %RV
-}
-
-define i32 @test23(i32 %X) {
- ;; Turn into an AND even though X
- %c1 = trunc i32 %X to i16 ; <i16> [#uses=1]
- ;; and Z are signed.
- %c2 = zext i16 %c1 to i32 ; <i32> [#uses=1]
- ret i32 %c2
-}
-
-define i1 @test24(i1 %C) {
- %X = select i1 %C, i32 14, i32 1234 ; <i32> [#uses=1]
- ;; Fold cast into select
- %c = icmp ne i32 %X, 0 ; <i1> [#uses=1]
- ret i1 %c
-}
-
-define void @test25(i32** %P) {
- %c = bitcast i32** %P to float** ; <float**> [#uses=1]
- ;; Fold cast into null
- store float* null, float** %c
- ret void
-}
-
-define i32 @test26(float %F) {
- ;; no need to cast from float->double.
- %c = fpext float %F to double ; <double> [#uses=1]
- %D = fptosi double %c to i32 ; <i32> [#uses=1]
- ret i32 %D
-}
-
-define [4 x float]* @test27([9 x [4 x float]]* %A) {
- %c = bitcast [9 x [4 x float]]* %A to [4 x float]* ; <[4 x float]*> [#uses=1]
- ret [4 x float]* %c
-}
-
-define float* @test28([4 x float]* %A) {
- %c = bitcast [4 x float]* %A to float* ; <float*> [#uses=1]
- ret float* %c
-}
-
-define i32 @test29(i32 %c1, i32 %c2) {
- %tmp1 = trunc i32 %c1 to i8 ; <i8> [#uses=1]
- %tmp4.mask = trunc i32 %c2 to i8 ; <i8> [#uses=1]
- %tmp = or i8 %tmp4.mask, %tmp1 ; <i8> [#uses=1]
- %tmp10 = zext i8 %tmp to i32 ; <i32> [#uses=1]
- ret i32 %tmp10
-}
-
-define i32 @test30(i32 %c1) {
- %c2 = trunc i32 %c1 to i8 ; <i8> [#uses=1]
- %c3 = xor i8 %c2, 1 ; <i8> [#uses=1]
- %c4 = zext i8 %c3 to i32 ; <i32> [#uses=1]
- ret i32 %c4
-}
-
-define i1 @test31(i64 %A) {
- %B = trunc i64 %A to i32 ; <i32> [#uses=1]
- %C = and i32 %B, 42 ; <i32> [#uses=1]
- %D = icmp eq i32 %C, 10 ; <i1> [#uses=1]
- ret i1 %D
-}
-
-define void @test32(double** %tmp) {
- %tmp8 = malloc [16 x i8] ; <[16 x i8]*> [#uses=1]
- %tmp8.upgrd.1 = bitcast [16 x i8]* %tmp8 to double* ; <double*> [#uses=1]
- store double* %tmp8.upgrd.1, double** %tmp
- ret void
-}
-
-define i32 @test33(i32 %c1) {
- %x = bitcast i32 %c1 to float ; <float> [#uses=1]
- %y = bitcast float %x to i32 ; <i32> [#uses=1]
- ret i32 %y
-}
-
-define i16 @test34(i16 %a) {
- %c1 = zext i16 %a to i32 ; <i32> [#uses=1]
- %tmp21 = lshr i32 %c1, 8 ; <i32> [#uses=1]
- %c2 = trunc i32 %tmp21 to i16 ; <i16> [#uses=1]
- ret i16 %c2
-}
-
-define i16 @test35(i16 %a) {
- %c1 = bitcast i16 %a to i16 ; <i16> [#uses=1]
- %tmp2 = lshr i16 %c1, 8 ; <i16> [#uses=1]
- %c2 = bitcast i16 %tmp2 to i16 ; <i16> [#uses=1]
- ret i16 %c2
-}
-
diff --git a/release_23/test/Transforms/InstCombine/cast2.ll b/release_23/test/Transforms/InstCombine/cast2.ll
deleted file mode 100644
index 5cc9087198b2..000000000000
--- a/release_23/test/Transforms/InstCombine/cast2.ll
+++ /dev/null
@@ -1,29 +0,0 @@
-; Tests to make sure elimination of casts is working correctly
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | notcast
-
-define i16 @test1(i16 %a) {
- %tmp = zext i16 %a to i32 ; <i32> [#uses=2]
- %tmp21 = lshr i32 %tmp, 8 ; <i32> [#uses=1]
- %tmp5 = shl i32 %tmp, 8 ; <i32> [#uses=1]
- %tmp.upgrd.32 = or i32 %tmp21, %tmp5 ; <i32> [#uses=1]
- %tmp.upgrd.3 = trunc i32 %tmp.upgrd.32 to i16 ; <i16> [#uses=1]
- ret i16 %tmp.upgrd.3
-}
-
-define i16 @test2(i16 %a) {
- %tmp = zext i16 %a to i32 ; <i32> [#uses=2]
- %tmp21 = lshr i32 %tmp, 9 ; <i32> [#uses=1]
- %tmp5 = shl i32 %tmp, 8 ; <i32> [#uses=1]
- %tmp.upgrd.32 = or i32 %tmp21, %tmp5 ; <i32> [#uses=1]
- %tmp.upgrd.3 = trunc i32 %tmp.upgrd.32 to i16 ; <i16> [#uses=1]
- ret i16 %tmp.upgrd.3
-}
-
-; PR1263
-define i32* @test3(i32* %tmp1) {
- %tmp64 = bitcast i32* %tmp1 to { i32 }* ; <{ i32 }*> [#uses=1]
- %tmp65 = getelementptr { i32 }* %tmp64, i32 0, i32 0 ; <i32*> [#uses=1]
- ret i32* %tmp65
-}
-
-
diff --git a/release_23/test/Transforms/InstCombine/cast_ptr.ll b/release_23/test/Transforms/InstCombine/cast_ptr.ll
deleted file mode 100644
index fd600a883047..000000000000
--- a/release_23/test/Transforms/InstCombine/cast_ptr.ll
+++ /dev/null
@@ -1,19 +0,0 @@
-; Tests to make sure elimination of casts is working correctly
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | notcast
-
-target datalayout = "p:32:32"
-
-define i8* @test1(i8* %t) {
- %tmpc = ptrtoint i8* %t to i32 ; <i32> [#uses=1]
- %tmpa = add i32 %tmpc, 32 ; <i32> [#uses=1]
- %tv = inttoptr i32 %tmpa to i8* ; <i8*> [#uses=1]
- ret i8* %tv
-}
-
-define i1 @test2(i8* %a, i8* %b) {
- %tmpa = ptrtoint i8* %a to i32 ; <i32> [#uses=1]
- %tmpb = ptrtoint i8* %b to i32 ; <i32> [#uses=1]
- %r = icmp eq i32 %tmpa, %tmpb ; <i1> [#uses=1]
- ret i1 %r
-}
-
diff --git a/release_23/test/Transforms/InstCombine/deadcode.ll b/release_23/test/Transforms/InstCombine/deadcode.ll
deleted file mode 100644
index 43c179315548..000000000000
--- a/release_23/test/Transforms/InstCombine/deadcode.ll
+++ /dev/null
@@ -1,24 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {ret i32 %A}
-; RUN: llvm-as < %s | opt -die | llvm-dis | not grep call.*llvm.stacksave
-
-define i32 @test(i32 %A) {
- %X = or i1 false, false
- br i1 %X, label %T, label %C
-
-T: ; preds = %0
- %B = add i32 %A, 1
- br label %C
-
-C: ; preds = %T, %0
- %C.upgrd.1 = phi i32 [ %B, %T ], [ %A, %0 ]
- ret i32 %C.upgrd.1
-}
-
-define i32* @test2(i32 %width) {
- %tmp = call i8* @llvm.stacksave( )
- %tmp14 = alloca i32, i32 %width
- ret i32* %tmp14
-}
-
-declare i8* @llvm.stacksave()
-
diff --git a/release_23/test/Transforms/InstCombine/dg.exp b/release_23/test/Transforms/InstCombine/dg.exp
deleted file mode 100644
index 879685ca879d..000000000000
--- a/release_23/test/Transforms/InstCombine/dg.exp
+++ /dev/null
@@ -1,3 +0,0 @@
-load_lib llvm.exp
-
-RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
diff --git a/release_23/test/Transforms/InstCombine/div.ll b/release_23/test/Transforms/InstCombine/div.ll
deleted file mode 100644
index b21d39b7a539..000000000000
--- a/release_23/test/Transforms/InstCombine/div.ll
+++ /dev/null
@@ -1,74 +0,0 @@
-; This test makes sure that div instructions are properly eliminated.
-;
-
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep div
-; END.
-
-define i32 @test1(i32 %A) {
- %B = sdiv i32 %A, 1 ; <i32> [#uses=1]
- ret i32 %B
-}
-
-define i32 @test2(i32 %A) {
- ; => Shift
- %B = udiv i32 %A, 8 ; <i32> [#uses=1]
- ret i32 %B
-}
-
-define i32 @test3(i32 %A) {
- ; => 0, don't need to keep traps
- %B = sdiv i32 0, %A ; <i32> [#uses=1]
- ret i32 %B
-}
-
-define i32 @test4(i32 %A) {
- ; 0-A
- %B = sdiv i32 %A, -1 ; <i32> [#uses=1]
- ret i32 %B
-}
-
-define i32 @test5(i32 %A) {
- %B = udiv i32 %A, -16 ; <i32> [#uses=1]
- %C = udiv i32 %B, -4 ; <i32> [#uses=1]
- ret i32 %C
-}
-
-define i1 @test6(i32 %A) {
- %B = udiv i32 %A, 123 ; <i32> [#uses=1]
- ; A < 123
- %C = icmp eq i32 %B, 0 ; <i1> [#uses=1]
- ret i1 %C
-}
-
-define i1 @test7(i32 %A) {
- %B = udiv i32 %A, 10 ; <i32> [#uses=1]
- ; A >= 20 && A < 30
- %C = icmp eq i32 %B, 2 ; <i1> [#uses=1]
- ret i1 %C
-}
-
-define i1 @test8(i8 %A) {
- %B = udiv i8 %A, 123 ; <i8> [#uses=1]
- ; A >= 246
- %C = icmp eq i8 %B, 2 ; <i1> [#uses=1]
- ret i1 %C
-}
-
-define i1 @test9(i8 %A) {
- %B = udiv i8 %A, 123 ; <i8> [#uses=1]
- ; A < 246
- %C = icmp ne i8 %B, 2 ; <i1> [#uses=1]
- ret i1 %C
-}
-
-define i32 @test10(i32 %X, i1 %C) {
- %V = select i1 %C, i32 64, i32 8 ; <i32> [#uses=1]
- %R = udiv i32 %X, %V ; <i32> [#uses=1]
- ret i32 %R
-}
-
-define i32 @test11(i32 %X, i1 %C) {
- %A = select i1 %C, i32 1024, i32 32 ; <i32> [#uses=1]
- %B = udiv i32 %X, %A ; <i32> [#uses=1]
- ret i32 %B
-}
diff --git a/release_23/test/Transforms/InstCombine/fold-vector-zero.ll b/release_23/test/Transforms/InstCombine/fold-vector-zero.ll
deleted file mode 100644
index 0b5b30a5c6e7..000000000000
--- a/release_23/test/Transforms/InstCombine/fold-vector-zero.ll
+++ /dev/null
@@ -1,35 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep zeroinitializer
-
-define void @foo(i64 %A, i64 %B) {
-bb8:
- br label %bb30
-
-bb30:
- %s0 = phi i64 [ 0, %bb8 ], [ %r21, %bb30 ]
- %l0 = phi i64 [ -2222, %bb8 ], [ %r23, %bb30 ]
- %r2 = add i64 %s0, %B
- %r3 = inttoptr i64 %r2 to <2 x double>*
- %r4 = load <2 x double>* %r3, align 8
- %r6 = bitcast <2 x double> %r4 to <2 x i64>
- %r7 = bitcast <2 x double> zeroinitializer to <2 x i64>
- %r8 = insertelement <2 x i64> undef, i64 9223372036854775807, i32 0
- %r9 = insertelement <2 x i64> undef, i64 -9223372036854775808, i32 0
- %r10 = insertelement <2 x i64> %r8, i64 9223372036854775807, i32 1
- %r11 = insertelement <2 x i64> %r9, i64 -9223372036854775808, i32 1
- %r12 = and <2 x i64> %r6, %r10
- %r13 = and <2 x i64> %r7, %r11
- %r14 = or <2 x i64> %r12, %r13
- %r15 = bitcast <2 x i64> %r14 to <2 x double>
- %r18 = add i64 %s0, %A
- %r19 = inttoptr i64 %r18 to <2 x double>*
- store <2 x double> %r15, <2 x double>* %r19, align 8
- %r21 = add i64 16, %s0
- %r23 = add i64 1, %l0
- %r25 = icmp slt i64 %r23, 0
- %r26 = zext i1 %r25 to i64
- %r27 = icmp ne i64 %r26, 0
- br i1 %r27, label %bb30, label %bb5
-
-bb5:
- ret void
-}
diff --git a/release_23/test/Transforms/InstCombine/fpcast.ll b/release_23/test/Transforms/InstCombine/fpcast.ll
deleted file mode 100644
index 7f25092976f9..000000000000
--- a/release_23/test/Transforms/InstCombine/fpcast.ll
+++ /dev/null
@@ -1,15 +0,0 @@
-; Test some floating point casting cases
-; RUN: llvm-as %s -o - | opt -instcombine | llvm-dis | notcast
-; RUN: llvm-as %s -o - | opt -instcombine | llvm-dis | \
-; RUN: egrep {ret i8 \(-1\)\|\(255\)}
-
-define i8 @test1() {
- %x = fptoui float 2.550000e+02 to i8 ; <i8> [#uses=1]
- ret i8 %x
-}
-
-define i8 @test2() {
- %x = fptosi float -1.000000e+00 to i8 ; <i8> [#uses=1]
- ret i8 %x
-}
-
diff --git a/release_23/test/Transforms/InstCombine/fpextend.ll b/release_23/test/Transforms/InstCombine/fpextend.ll
deleted file mode 100644
index 5971080cef5c..000000000000
--- a/release_23/test/Transforms/InstCombine/fpextend.ll
+++ /dev/null
@@ -1,36 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep fpext
-@X = external global float
-@Y = external global float
-
-define void @test() nounwind {
-entry:
- %tmp = load float* @X, align 4 ; <float> [#uses=1]
- %tmp1 = fpext float %tmp to double ; <double> [#uses=1]
- %tmp3 = add double %tmp1, 0.000000e+00 ; <double> [#uses=1]
- %tmp34 = fptrunc double %tmp3 to float ; <float> [#uses=1]
- store float %tmp34, float* @X, align 4
- ret void
-}
-
-define void @test3() nounwind {
-entry:
- %tmp = load float* @X, align 4 ; <float> [#uses=1]
- %tmp1 = fpext float %tmp to double ; <double> [#uses=1]
- %tmp2 = load float* @Y, align 4 ; <float> [#uses=1]
- %tmp23 = fpext float %tmp2 to double ; <double> [#uses=1]
- %tmp5 = fdiv double %tmp1, %tmp23 ; <double> [#uses=1]
- %tmp56 = fptrunc double %tmp5 to float ; <float> [#uses=1]
- store float %tmp56, float* @X, align 4
- ret void
-}
-
-define void @test4() nounwind {
-entry:
- %tmp = load float* @X, align 4 ; <float> [#uses=1]
- %tmp1 = fpext float %tmp to double ; <double> [#uses=1]
- %tmp2 = sub double -0.000000e+00, %tmp1 ; <double> [#uses=1]
- %tmp34 = fptrunc double %tmp2 to float ; <float> [#uses=1]
- store float %tmp34, float* @X, align 4
- ret void
-}
-
diff --git a/release_23/test/Transforms/InstCombine/getelementptr-setcc.ll b/release_23/test/Transforms/InstCombine/getelementptr-setcc.ll
deleted file mode 100644
index 0a6d720d74f6..000000000000
--- a/release_23/test/Transforms/InstCombine/getelementptr-setcc.ll
+++ /dev/null
@@ -1,31 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \
-; RUN: not grep getelementptr
-
-define i1 @test1(i16* %P, i32 %I, i32 %J) {
- %X = getelementptr i16* %P, i32 %I ; <i16*> [#uses=1]
- %Y = getelementptr i16* %P, i32 %J ; <i16*> [#uses=1]
- %C = icmp ult i16* %X, %Y ; <i1> [#uses=1]
- ret i1 %C
-}
-
-define i1 @test2(i16* %P, i32 %I) {
- %X = getelementptr i16* %P, i32 %I ; <i16*> [#uses=1]
- %C = icmp ult i16* %X, %P ; <i1> [#uses=1]
- ret i1 %C
-}
-
-define i32 @test3(i32* %P, i32 %A, i32 %B) {
- %tmp.4 = getelementptr i32* %P, i32 %A ; <i32*> [#uses=1]
- %tmp.9 = getelementptr i32* %P, i32 %B ; <i32*> [#uses=1]
- %tmp.10 = icmp eq i32* %tmp.4, %tmp.9 ; <i1> [#uses=1]
- %tmp.11 = zext i1 %tmp.10 to i32 ; <i32> [#uses=1]
- ret i32 %tmp.11
-}
-
-define i32 @test4(i32* %P, i32 %A, i32 %B) {
- %tmp.4 = getelementptr i32* %P, i32 %A ; <i32*> [#uses=1]
- %tmp.6 = icmp eq i32* %tmp.4, %P ; <i1> [#uses=1]
- %tmp.7 = zext i1 %tmp.6 to i32 ; <i32> [#uses=1]
- ret i32 %tmp.7
-}
-
diff --git a/release_23/test/Transforms/InstCombine/getelementptr-seteq.ll b/release_23/test/Transforms/InstCombine/getelementptr-seteq.ll
deleted file mode 100644
index 05cec622b2ac..000000000000
--- a/release_23/test/Transforms/InstCombine/getelementptr-seteq.ll
+++ /dev/null
@@ -1,13 +0,0 @@
-; Test folding of constantexpr geps into normal geps.
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {icmp eq i64 %X, -1}
-; PR2235
-
-%S = type { i32, [ 100 x i32] }
-
-define i1 @test(i64 %X, %S* %P) {
- %A = getelementptr %S* %P, i32 0, i32 1, i64 %X
- %B = getelementptr %S* %P, i32 0, i32 0
- %C = icmp eq i32* %A, %B
- ret i1 %C
-}
-
diff --git a/release_23/test/Transforms/InstCombine/getelementptr.ll b/release_23/test/Transforms/InstCombine/getelementptr.ll
deleted file mode 100644
index c2cb72080319..000000000000
--- a/release_23/test/Transforms/InstCombine/getelementptr.ll
+++ /dev/null
@@ -1,81 +0,0 @@
-; The %A getelementptr instruction should be eliminated here
-
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \
-; RUN: grep -v %B | not grep getelementptr
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep foo1
-; END.
-
-@Global = constant [10 x i8] c"helloworld" ; <[10 x i8]*> [#uses=1]
-
-; Test noop elimination
-define i32* @foo1(i32* %I) {
- %A = getelementptr i32* %I, i64 0 ; <i32*> [#uses=1]
- ret i32* %A
-}
-
-; Test noop elimination
-define i32* @foo2(i32* %I) {
- %A = getelementptr i32* %I ; <i32*> [#uses=1]
- ret i32* %A
-}
-
-; Test that two array indexing geps fold
-define i32* @foo3(i32* %I) {
- %A = getelementptr i32* %I, i64 17 ; <i32*> [#uses=1]
- %B = getelementptr i32* %A, i64 4 ; <i32*> [#uses=1]
- ret i32* %B
-}
-
-; Test that two getelementptr insts fold
-define i32* @foo4({ i32 }* %I) {
- %A = getelementptr { i32 }* %I, i64 1 ; <{ i32 }*> [#uses=1]
- %B = getelementptr { i32 }* %A, i64 0, i32 0 ; <i32*> [#uses=1]
- ret i32* %B
-}
-
-define void @foo5(i8 %B) {
- ; This should be turned into a constexpr instead of being an instruction
- %A = getelementptr [10 x i8]* @Global, i64 0, i64 4 ; <i8*> [#uses=1]
- store i8 %B, i8* %A
- ret void
-}
-
-define i32* @foo6() {
- %M = malloc [4 x i32] ; <[4 x i32]*> [#uses=1]
- %A = getelementptr [4 x i32]* %M, i64 0, i64 0 ; <i32*> [#uses=1]
- %B = getelementptr i32* %A, i64 2 ; <i32*> [#uses=1]
- ret i32* %B
-}
-
-define i32* @foo7(i32* %I, i64 %C, i64 %D) {
- %A = getelementptr i32* %I, i64 %C ; <i32*> [#uses=1]
- %B = getelementptr i32* %A, i64 %D ; <i32*> [#uses=1]
- ret i32* %B
-}
-
-define i8* @foo8([10 x i32]* %X) {
- ;; Fold into the cast.
- %A = getelementptr [10 x i32]* %X, i64 0, i64 0 ; <i32*> [#uses=1]
- %B = bitcast i32* %A to i8* ; <i8*> [#uses=1]
- ret i8* %B
-}
-
-define i32 @test9() {
- %A = getelementptr { i32, double }* null, i32 0, i32 1 ; <double*> [#uses=1]
- %B = ptrtoint double* %A to i32 ; <i32> [#uses=1]
- ret i32 %B
-}
-
-define i1 @test10({ i32, i32 }* %x, { i32, i32 }* %y) {
- %tmp.1 = getelementptr { i32, i32 }* %x, i32 0, i32 1 ; <i32*> [#uses=1]
- %tmp.3 = getelementptr { i32, i32 }* %y, i32 0, i32 1 ; <i32*> [#uses=1]
- ;; seteq x, y
- %tmp.4 = icmp eq i32* %tmp.1, %tmp.3 ; <i1> [#uses=1]
- ret i1 %tmp.4
-}
-
-define i1 @test11({ i32, i32 }* %X) {
- %P = getelementptr { i32, i32 }* %X, i32 0, i32 0 ; <i32*> [#uses=1]
- %Q = icmp eq i32* %P, null ; <i1> [#uses=1]
- ret i1 %Q
-}
diff --git a/release_23/test/Transforms/InstCombine/getelementptr_cast.ll b/release_23/test/Transforms/InstCombine/getelementptr_cast.ll
deleted file mode 100644
index 1d2fcce13d39..000000000000
--- a/release_23/test/Transforms/InstCombine/getelementptr_cast.ll
+++ /dev/null
@@ -1,11 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \
-; RUN: notcast {} {getelementptr.*}
-
-@G = external global [3 x i8] ; <[3 x i8]*> [#uses=1]
-
-define i8* @foo(i32 %Idx) {
- %gep.upgrd.1 = zext i32 %Idx to i64 ; <i64> [#uses=1]
- %tmp = getelementptr i8* getelementptr ([3 x i8]* @G, i32 0, i32 0), i64 %gep.upgrd.1 ; <i8*> [#uses=1]
- ret i8* %tmp
-}
-
diff --git a/release_23/test/Transforms/InstCombine/getelementptr_const.ll b/release_23/test/Transforms/InstCombine/getelementptr_const.ll
deleted file mode 100644
index 3de9ecec2d51..000000000000
--- a/release_23/test/Transforms/InstCombine/getelementptr_const.ll
+++ /dev/null
@@ -1,15 +0,0 @@
-; Test folding of constantexpr geps into normal geps.
-; RUN: llvm-as < %s | opt -instcombine -gcse -instcombine | \
-; RUN: llvm-dis | not grep getelementptr
-
-@Array = external global [40 x i32] ; <[40 x i32]*> [#uses=2]
-
-define i32 @test(i64 %X) {
- %A = getelementptr i32* getelementptr ([40 x i32]* @Array, i64 0, i64 0), i64 %X ; <i32*> [#uses=1]
- %B = getelementptr [40 x i32]* @Array, i64 0, i64 %X ; <i32*> [#uses=1]
- %a = ptrtoint i32* %A to i32 ; <i32> [#uses=1]
- %b = ptrtoint i32* %B to i32 ; <i32> [#uses=1]
- %c = sub i32 %a, %b ; <i32> [#uses=1]
- ret i32 %c
-}
-
diff --git a/release_23/test/Transforms/InstCombine/getelementptr_index.ll b/release_23/test/Transforms/InstCombine/getelementptr_index.ll
deleted file mode 100644
index 556096516f97..000000000000
--- a/release_23/test/Transforms/InstCombine/getelementptr_index.ll
+++ /dev/null
@@ -1,9 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep trunc
-
-target datalayout = "e-p:32:32"
-
-define i32* @test(i32* %X, i64 %Idx) {
- %R = getelementptr i32* %X, i64 %Idx ; <i32*> [#uses=1]
- ret i32* %R
-}
-
diff --git a/release_23/test/Transforms/InstCombine/hoist_instr.ll b/release_23/test/Transforms/InstCombine/hoist_instr.ll
deleted file mode 100644
index e425bc2a5a90..000000000000
--- a/release_23/test/Transforms/InstCombine/hoist_instr.ll
+++ /dev/null
@@ -1,17 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \
-; RUN: %prcontext div 1 | grep then:
-
-;; This tests that the div is hoisted into the then block.
-define i32 @foo(i1 %C, i32 %A, i32 %B) {
-entry:
- br i1 %C, label %then, label %endif
-
-then: ; preds = %entry
- br label %endif
-
-endif: ; preds = %then, %entry
- %X = phi i32 [ %A, %then ], [ 15, %entry ] ; <i32> [#uses=1]
- %Y = sdiv i32 %X, 42 ; <i32> [#uses=1]
- ret i32 %Y
-}
-
diff --git a/release_23/test/Transforms/InstCombine/icmp.ll b/release_23/test/Transforms/InstCombine/icmp.ll
deleted file mode 100644
index bb69ba3be471..000000000000
--- a/release_23/test/Transforms/InstCombine/icmp.ll
+++ /dev/null
@@ -1,31 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep icmp
-; END.
-
-define i32 @test1(i32 %X) {
-entry:
- icmp slt i32 %X, 0 ; <i1>:0 [#uses=1]
- zext i1 %0 to i32 ; <i32>:1 [#uses=1]
- ret i32 %1
-}
-
-define i32 @test2(i32 %X) {
-entry:
- icmp ult i32 %X, -2147483648 ; <i1>:0 [#uses=1]
- zext i1 %0 to i32 ; <i32>:1 [#uses=1]
- ret i32 %1
-}
-
-define i32 @test3(i32 %X) {
-entry:
- icmp slt i32 %X, 0 ; <i1>:0 [#uses=1]
- sext i1 %0 to i32 ; <i32>:1 [#uses=1]
- ret i32 %1
-}
-
-define i32 @test4(i32 %X) {
-entry:
- icmp ult i32 %X, -2147483648 ; <i1>:0 [#uses=1]
- sext i1 %0 to i32 ; <i32>:1 [#uses=1]
- ret i32 %1
-}
-
diff --git a/release_23/test/Transforms/InstCombine/known_align.ll b/release_23/test/Transforms/InstCombine/known_align.ll
deleted file mode 100644
index a6e340902dfb..000000000000
--- a/release_23/test/Transforms/InstCombine/known_align.ll
+++ /dev/null
@@ -1,27 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {align 1}
-; END.
-
- %struct.p = type <{ i8, i32 }>
-@t = global %struct.p <{ i8 1, i32 10 }> ; <%struct.p*> [#uses=1]
-@u = weak global %struct.p zeroinitializer ; <%struct.p*> [#uses=1]
-
-define i32 @main() {
-entry:
- %retval = alloca i32, align 4 ; <i32*> [#uses=2]
- %tmp = alloca i32, align 4 ; <i32*> [#uses=2]
- %tmp1 = alloca i32, align 4 ; <i32*> [#uses=3]
- %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
- %tmp3 = load i32* getelementptr (%struct.p* @t, i32 0, i32 1), align 1 ; <i32> [#uses=1]
- store i32 %tmp3, i32* %tmp1, align 4
- %tmp5 = load i32* %tmp1, align 4 ; <i32> [#uses=1]
- store i32 %tmp5, i32* getelementptr (%struct.p* @u, i32 0, i32 1), align 1
- %tmp6 = load i32* %tmp1, align 4 ; <i32> [#uses=1]
- store i32 %tmp6, i32* %tmp, align 4
- %tmp7 = load i32* %tmp, align 4 ; <i32> [#uses=1]
- store i32 %tmp7, i32* %retval, align 4
- br label %return
-
-return: ; preds = %entry
- %retval8 = load i32* %retval ; <i32> [#uses=1]
- ret i32 %retval8
-}
diff --git a/release_23/test/Transforms/InstCombine/load.ll b/release_23/test/Transforms/InstCombine/load.ll
deleted file mode 100644
index 907550a778ae..000000000000
--- a/release_23/test/Transforms/InstCombine/load.ll
+++ /dev/null
@@ -1,70 +0,0 @@
-; This test makes sure that these instructions are properly eliminated.
-;
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep load
-
-@X = constant i32 42 ; <i32*> [#uses=2]
-@X2 = constant i32 47 ; <i32*> [#uses=1]
-@Y = constant [2 x { i32, float }] [ { i32, float } { i32 12, float 1.000000e+00 }, { i32, float } { i32 37, float 0x3FF3B2FEC0000000 } ] ; <[2 x { i32, float }]*> [#uses=2]
-@Z = constant [2 x { i32, float }] zeroinitializer ; <[2 x { i32, float }]*> [#uses=1]
-
-define i32 @test1() {
- %B = load i32* @X ; <i32> [#uses=1]
- ret i32 %B
-}
-
-define float @test2() {
- %A = getelementptr [2 x { i32, float }]* @Y, i64 0, i64 1, i32 1 ; <float*> [#uses=1]
- %B = load float* %A ; <float> [#uses=1]
- ret float %B
-}
-
-define i32 @test3() {
- %A = getelementptr [2 x { i32, float }]* @Y, i64 0, i64 0, i32 0 ; <i32*> [#uses=1]
- %B = load i32* %A ; <i32> [#uses=1]
- ret i32 %B
-}
-
-define i32 @test4() {
- %A = getelementptr [2 x { i32, float }]* @Z, i64 0, i64 1, i32 0 ; <i32*> [#uses=1]
- %B = load i32* %A ; <i32> [#uses=1]
- ret i32 %B
-}
-
-define i32 @test5(i1 %C) {
- %Y = select i1 %C, i32* @X, i32* @X2 ; <i32*> [#uses=1]
- %Z = load i32* %Y ; <i32> [#uses=1]
- ret i32 %Z
-}
-
-define i32 @test7(i32 %X) {
- %V = getelementptr i32* null, i32 %X ; <i32*> [#uses=1]
- %R = load i32* %V ; <i32> [#uses=1]
- ret i32 %R
-}
-
-define i32 @test8(i32* %P) {
- store i32 1, i32* %P
- %X = load i32* %P ; <i32> [#uses=1]
- ret i32 %X
-}
-
-define i32 @test9(i32* %P) {
- %X = load i32* %P ; <i32> [#uses=1]
- %Y = load i32* %P ; <i32> [#uses=1]
- %Z = sub i32 %X, %Y ; <i32> [#uses=1]
- ret i32 %Z
-}
-
-define i32 @test10(i1 %C.upgrd.1, i32* %P, i32* %Q) {
- br i1 %C.upgrd.1, label %T, label %F
-T: ; preds = %0
- store i32 1, i32* %Q
- store i32 0, i32* %P
- br label %C
-F: ; preds = %0
- store i32 0, i32* %P
- br label %C
-C: ; preds = %F, %T
- %V = load i32* %P ; <i32> [#uses=1]
- ret i32 %V
-}
diff --git a/release_23/test/Transforms/InstCombine/load2.ll b/release_23/test/Transforms/InstCombine/load2.ll
deleted file mode 100644
index 5c3cf330543b..000000000000
--- a/release_23/test/Transforms/InstCombine/load2.ll
+++ /dev/null
@@ -1,11 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep load
-
-@GLOBAL = internal constant [4 x i32] zeroinitializer
-
-
-define <16 x i8> @foo(<2 x i64> %x) {
-entry:
- %tmp = load <16 x i8> * bitcast ([4 x i32]* @GLOBAL to <16 x i8>*)
- ret <16 x i8> %tmp
-}
-
diff --git a/release_23/test/Transforms/InstCombine/loadstore-alignment.ll b/release_23/test/Transforms/InstCombine/loadstore-alignment.ll
deleted file mode 100644
index 82be575b328a..000000000000
--- a/release_23/test/Transforms/InstCombine/loadstore-alignment.ll
+++ /dev/null
@@ -1,66 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {, align 16} | count 12
-
-@x = external global <2 x i64>, align 16
-@xx = external global [13 x <2 x i64>], align 16
-
-define <2 x i64> @static_hem() {
- %t = getelementptr <2 x i64>* @x, i32 7
- %tmp1 = load <2 x i64>* %t, align 1
- ret <2 x i64> %tmp1
-}
-
-define <2 x i64> @hem(i32 %i) {
- %t = getelementptr <2 x i64>* @x, i32 %i
- %tmp1 = load <2 x i64>* %t, align 1
- ret <2 x i64> %tmp1
-}
-
-define <2 x i64> @hem_2d(i32 %i, i32 %j) {
- %t = getelementptr [13 x <2 x i64>]* @xx, i32 %i, i32 %j
- %tmp1 = load <2 x i64>* %t, align 1
- ret <2 x i64> %tmp1
-}
-
-define <2 x i64> @foo() {
- %tmp1 = load <2 x i64>* @x, align 1
- ret <2 x i64> %tmp1
-}
-
-define <2 x i64> @bar() {
- %t = alloca <2 x i64>
- call void @kip(<2 x i64>* %t);
- %tmp1 = load <2 x i64>* %t, align 1
- ret <2 x i64> %tmp1
-}
-
-define void @static_hem_store(<2 x i64> %y) {
- %t = getelementptr <2 x i64>* @x, i32 7
- store <2 x i64> %y, <2 x i64>* %t, align 1
- ret void
-}
-
-define void @hem_store(i32 %i, <2 x i64> %y) {
- %t = getelementptr <2 x i64>* @x, i32 %i
- store <2 x i64> %y, <2 x i64>* %t, align 1
- ret void
-}
-
-define void @hem_2d_store(i32 %i, i32 %j, <2 x i64> %y) {
- %t = getelementptr [13 x <2 x i64>]* @xx, i32 %i, i32 %j
- store <2 x i64> %y, <2 x i64>* %t, align 1
- ret void
-}
-
-define void @foo_store(<2 x i64> %y) {
- store <2 x i64> %y, <2 x i64>* @x, align 1
- ret void
-}
-
-define void @bar_store(<2 x i64> %y) {
- %t = alloca <2 x i64>
- call void @kip(<2 x i64>* %t);
- store <2 x i64> %y, <2 x i64>* %t, align 1
- ret void
-}
-
-declare void @kip(<2 x i64>* %t)
diff --git a/release_23/test/Transforms/InstCombine/malloc-free-delete.ll b/release_23/test/Transforms/InstCombine/malloc-free-delete.ll
deleted file mode 100644
index 24f793f7ca8f..000000000000
--- a/release_23/test/Transforms/InstCombine/malloc-free-delete.ll
+++ /dev/null
@@ -1,11 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {ret i32 0}
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep malloc
-; PR1201
-define i32 @main(i32 %argc, i8** %argv) {
- %c_19 = alloca i8* ; <i8**> [#uses=2]
- %malloc_206 = malloc i8, i32 10 ; <i8*> [#uses=1]
- store i8* %malloc_206, i8** %c_19
- %tmp_207 = load i8** %c_19 ; <i8*> [#uses=1]
- free i8* %tmp_207
- ret i32 0
-}
diff --git a/release_23/test/Transforms/InstCombine/malloc.ll b/release_23/test/Transforms/InstCombine/malloc.ll
deleted file mode 100644
index 6a4601a2ebee..000000000000
--- a/release_23/test/Transforms/InstCombine/malloc.ll
+++ /dev/null
@@ -1,7 +0,0 @@
-; test that malloc's with a constant argument are promoted to array allocations
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep getelementptr
-
-define i32* @test() {
- %X = malloc i32, i32 4
- ret i32* %X
-}
diff --git a/release_23/test/Transforms/InstCombine/malloc2.ll b/release_23/test/Transforms/InstCombine/malloc2.ll
deleted file mode 100644
index eb7c9abfcef5..000000000000
--- a/release_23/test/Transforms/InstCombine/malloc2.ll
+++ /dev/null
@@ -1,19 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {ret i32 0}
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep malloc
-; PR1313
-
-define i32 @test1(i32 %argc, i8* %argv, i8* %envp) {
- %tmp15.i.i.i23 = malloc [2564 x i32] ; <[2564 x i32]*> [#uses=1]
- %c = icmp eq [2564 x i32]* %tmp15.i.i.i23, null ; <i1>:0 [#uses=1]
- %retval = zext i1 %c to i32 ; <i32> [#uses=1]
- ret i32 %retval
-}
-
-define i32 @test2(i32 %argc, i8* %argv, i8* %envp) {
- %tmp15.i.i.i23 = malloc [2564 x i32] ; <[2564 x i32]*> [#uses=1]
- %X = bitcast [2564 x i32]* %tmp15.i.i.i23 to i32*
- %c = icmp ne i32* %X, null
- %retval = zext i1 %c to i32 ; <i32> [#uses=1]
- ret i32 %retval
-}
-
diff --git a/release_23/test/Transforms/InstCombine/malloc3.ll b/release_23/test/Transforms/InstCombine/malloc3.ll
deleted file mode 100644
index f6f412dfe062..000000000000
--- a/release_23/test/Transforms/InstCombine/malloc3.ll
+++ /dev/null
@@ -1,26 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {malloc.*struct.foo} | count 2
-; PR1728
-
-target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
-target triple = "i686-apple-darwin8"
- %struct.foo = type { %struct.foo*, [10 x i32] }
-@.str = internal constant [21 x i8] c"tmp = %p, next = %p\0A\00" ; <[21 x i8]*> [#uses=1]
-
-define i32 @main() {
-entry:
- %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
- %tmp1 = malloc i8, i32 44 ; <i8*> [#uses=1]
- %tmp12 = bitcast i8* %tmp1 to %struct.foo* ; <%struct.foo*> [#uses=3]
- %tmp3 = malloc i8, i32 44 ; <i8*> [#uses=1]
- %tmp34 = bitcast i8* %tmp3 to %struct.foo* ; <%struct.foo*> [#uses=1]
- %tmp6 = getelementptr %struct.foo* %tmp12, i32 0, i32 0 ; <%struct.foo**> [#uses=1]
- store %struct.foo* %tmp34, %struct.foo** %tmp6, align 4
- %tmp8 = getelementptr %struct.foo* %tmp12, i32 0, i32 0 ; <%struct.foo**> [#uses=1]
- %tmp9 = load %struct.foo** %tmp8, align 4 ; <%struct.foo*> [#uses=1]
- %tmp10 = getelementptr [21 x i8]* @.str, i32 0, i32 0 ; <i8*> [#uses=1]
- %tmp13 = call i32 (i8*, ...)* @printf( i8* %tmp10, %struct.foo* %tmp12, %struct.foo* %tmp9 ) ; <i32> [#uses=0]
- ret i32 undef
-}
-
-declare i32 @printf(i8*, ...)
-
diff --git a/release_23/test/Transforms/InstCombine/memcpy-to-load.ll b/release_23/test/Transforms/InstCombine/memcpy-to-load.ll
deleted file mode 100644
index 7a0027d7789f..000000000000
--- a/release_23/test/Transforms/InstCombine/memcpy-to-load.ll
+++ /dev/null
@@ -1,14 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {load double}
-target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
-target triple = "i686-apple-darwin8"
-
-define void @foo(double* %X, double* %Y) {
-entry:
- %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
- %tmp2 = bitcast double* %X to i8* ; <i8*> [#uses=1]
- %tmp13 = bitcast double* %Y to i8* ; <i8*> [#uses=1]
- call void @llvm.memcpy.i32( i8* %tmp2, i8* %tmp13, i32 8, i32 1 )
- ret void
-}
-
-declare void @llvm.memcpy.i32(i8*, i8*, i32, i32) nounwind
diff --git a/release_23/test/Transforms/InstCombine/memmove.ll b/release_23/test/Transforms/InstCombine/memmove.ll
deleted file mode 100644
index 2cb346f11236..000000000000
--- a/release_23/test/Transforms/InstCombine/memmove.ll
+++ /dev/null
@@ -1,36 +0,0 @@
-; This test makes sure that memmove instructions are properly eliminated.
-;
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \
-; RUN: not grep {call void @llvm.memmove}
-
-@S = internal constant [33 x i8] c"panic: restorelist inconsistency\00" ; <[33 x i8]*> [#uses=1]
-@h = constant [2 x i8] c"h\00" ; <[2 x i8]*> [#uses=1]
-@hel = constant [4 x i8] c"hel\00" ; <[4 x i8]*> [#uses=1]
-@hello_u = constant [8 x i8] c"hello_u\00" ; <[8 x i8]*> [#uses=1]
-
-
-declare void @llvm.memmove.i32(i8*, i8*, i32, i32)
-
-define void @test1(i8* %A, i8* %B, i32 %N) {
- call void @llvm.memmove.i32( i8* %A, i8* %B, i32 0, i32 1 )
- ret void
-}
-
-define void @test2(i8* %A, i32 %N) {
- ;; dest can't alias source since we can't write to source!
- call void @llvm.memmove.i32( i8* %A, i8* getelementptr ([33 x i8]* @S, i32 0, i32 0), i32 %N, i32 1 )
- ret void
-}
-
-define i32 @test3() {
- %h_p = getelementptr [2 x i8]* @h, i32 0, i32 0 ; <i8*> [#uses=1]
- %hel_p = getelementptr [4 x i8]* @hel, i32 0, i32 0 ; <i8*> [#uses=1]
- %hello_u_p = getelementptr [8 x i8]* @hello_u, i32 0, i32 0 ; <i8*> [#uses=1]
- %target = alloca [1024 x i8] ; <[1024 x i8]*> [#uses=1]
- %target_p = getelementptr [1024 x i8]* %target, i32 0, i32 0 ; <i8*> [#uses=3]
- call void @llvm.memmove.i32( i8* %target_p, i8* %h_p, i32 2, i32 2 )
- call void @llvm.memmove.i32( i8* %target_p, i8* %hel_p, i32 4, i32 4 )
- call void @llvm.memmove.i32( i8* %target_p, i8* %hello_u_p, i32 8, i32 8 )
- ret i32 0
-}
-
diff --git a/release_23/test/Transforms/InstCombine/memset.ll b/release_23/test/Transforms/InstCombine/memset.ll
deleted file mode 100644
index 27a5b60cade6..000000000000
--- a/release_23/test/Transforms/InstCombine/memset.ll
+++ /dev/null
@@ -1,15 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep {call.*llvm.memset}
-
-declare void @llvm.memset.i32(i8*, i8, i32, i32)
-
-define i32 @main() {
- %target = alloca [1024 x i8] ; <[1024 x i8]*> [#uses=1]
- %target_p = getelementptr [1024 x i8]* %target, i32 0, i32 0 ; <i8*> [#uses=5]
- call void @llvm.memset.i32( i8* %target_p, i8 1, i32 0, i32 1 )
- call void @llvm.memset.i32( i8* %target_p, i8 1, i32 1, i32 1 )
- call void @llvm.memset.i32( i8* %target_p, i8 1, i32 2, i32 2 )
- call void @llvm.memset.i32( i8* %target_p, i8 1, i32 4, i32 4 )
- call void @llvm.memset.i32( i8* %target_p, i8 1, i32 8, i32 8 )
- ret i32 0
-}
-
diff --git a/release_23/test/Transforms/InstCombine/mul-masked-bits.ll b/release_23/test/Transforms/InstCombine/mul-masked-bits.ll
deleted file mode 100644
index 9b0a5bfe20de..000000000000
--- a/release_23/test/Transforms/InstCombine/mul-masked-bits.ll
+++ /dev/null
@@ -1,10 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep ashr
-
-define i32 @foo(i32 %x, i32 %y) {
- %a = and i32 %x, 7
- %b = and i32 %y, 7
- %c = mul i32 %a, %b
- %d = shl i32 %c, 26
- %e = ashr i32 %d, 26
- ret i32 %e
-}
diff --git a/release_23/test/Transforms/InstCombine/mul.ll b/release_23/test/Transforms/InstCombine/mul.ll
deleted file mode 100644
index 8e9ab8d4213e..000000000000
--- a/release_23/test/Transforms/InstCombine/mul.ll
+++ /dev/null
@@ -1,80 +0,0 @@
-; This test makes sure that mul instructions are properly eliminated.
-;
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep mul
-; END.
-
-define i32 @test1(i32 %A) {
- %B = mul i32 %A, 1 ; <i32> [#uses=1]
- ret i32 %B
-}
-
-define i32 @test2(i32 %A) {
- ; Should convert to an add instruction
- %B = mul i32 %A, 2 ; <i32> [#uses=1]
- ret i32 %B
-}
-
-define i32 @test3(i32 %A) {
- ; This should disappear entirely
- %B = mul i32 %A, 0 ; <i32> [#uses=1]
- ret i32 %B
-}
-
-define double @test4(double %A) {
- ; This is safe for FP
- %B = mul double 1.000000e+00, %A ; <double> [#uses=1]
- ret double %B
-}
-
-define i32 @test5(i32 %A) {
- %B = mul i32 %A, 8 ; <i32> [#uses=1]
- ret i32 %B
-}
-
-define i8 @test6(i8 %A) {
- %B = mul i8 %A, 8 ; <i8> [#uses=1]
- %C = mul i8 %B, 8 ; <i8> [#uses=1]
- ret i8 %C
-}
-
-define i32 @test7(i32 %i) {
- %tmp = mul i32 %i, -1 ; <i32> [#uses=1]
- ret i32 %tmp
-}
-
-define i64 @test8(i64 %i) {
- ; tmp = sub 0, %i
- %j = mul i64 %i, -1 ; <i64> [#uses=1]
- ret i64 %j
-}
-
-define i32 @test9(i32 %i) {
- ; %j = sub 0, %i
- %j = mul i32 %i, -1 ; <i32> [#uses=1]
- ret i32 %j
-}
-
-define i32 @test10(i32 %a, i32 %b) {
- %c = icmp slt i32 %a, 0 ; <i1> [#uses=1]
- %d = zext i1 %c to i32 ; <i32> [#uses=1]
- ; e = b & (a >> 31)
- %e = mul i32 %d, %b ; <i32> [#uses=1]
- ret i32 %e
-}
-
-define i32 @test11(i32 %a, i32 %b) {
- %c = icmp sle i32 %a, -1 ; <i1> [#uses=1]
- %d = zext i1 %c to i32 ; <i32> [#uses=1]
- ; e = b & (a >> 31)
- %e = mul i32 %d, %b ; <i32> [#uses=1]
- ret i32 %e
-}
-
-define i32 @test12(i8 %a, i32 %b) {
- %c = icmp ugt i8 %a, 127 ; <i1> [#uses=1]
- %d = zext i1 %c to i32 ; <i32> [#uses=1]
- ; e = b & (a >> 31)
- %e = mul i32 %d, %b ; <i32> [#uses=1]
- ret i32 %e
-}
-
diff --git a/release_23/test/Transforms/InstCombine/narrow.ll b/release_23/test/Transforms/InstCombine/narrow.ll
deleted file mode 100644
index 41106e759ce0..000000000000
--- a/release_23/test/Transforms/InstCombine/narrow.ll
+++ /dev/null
@@ -1,18 +0,0 @@
-; This file contains various testcases that check to see that instcombine
-; is narrowing computations when possible.
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \
-; RUN: grep {ret i1 false}
-
-; test1 - Eliminating the casts in this testcase (by narrowing the AND
-; operation) allows instcombine to realize the function always returns false.
-;
-define i1 @test1(i32 %A, i32 %B) {
- %C1 = icmp slt i32 %A, %B ; <i1> [#uses=1]
- %ELIM1 = zext i1 %C1 to i32 ; <i32> [#uses=1]
- %C2 = icmp sgt i32 %A, %B ; <i1> [#uses=1]
- %ELIM2 = zext i1 %C2 to i32 ; <i32> [#uses=1]
- %C3 = and i32 %ELIM1, %ELIM2 ; <i32> [#uses=1]
- %ELIM3 = trunc i32 %C3 to i1 ; <i1> [#uses=1]
- ret i1 %ELIM3
-}
-
diff --git a/release_23/test/Transforms/InstCombine/not-fcmp.ll b/release_23/test/Transforms/InstCombine/not-fcmp.ll
deleted file mode 100644
index 4560419a35fc..000000000000
--- a/release_23/test/Transforms/InstCombine/not-fcmp.ll
+++ /dev/null
@@ -1,10 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep "fcmp uge"
-; PR1570
-
-define i1 @f(float %X, float %Y) {
-entry:
- %tmp3 = fcmp olt float %X, %Y ; <i1> [#uses=1]
- %toBoolnot5 = xor i1 %tmp3, true ; <i1> [#uses=1]
- ret i1 %toBoolnot5
-}
-
diff --git a/release_23/test/Transforms/InstCombine/not.ll b/release_23/test/Transforms/InstCombine/not.ll
deleted file mode 100644
index a79e51871818..000000000000
--- a/release_23/test/Transforms/InstCombine/not.ll
+++ /dev/null
@@ -1,54 +0,0 @@
-; This test makes sure that these instructions are properly eliminated.
-;
-
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep xor
-
-define i32 @test1(i32 %A) {
- %B = xor i32 %A, -1 ; <i32> [#uses=1]
- %C = xor i32 %B, -1 ; <i32> [#uses=1]
- ret i32 %C
-}
-
-define i1 @test2(i32 %A, i32 %B) {
- ; Can change into setge
- %cond = icmp sle i32 %A, %B ; <i1> [#uses=1]
- %Ret = xor i1 %cond, true ; <i1> [#uses=1]
- ret i1 %Ret
-}
-
-; Test that demorgans law can be instcombined
-define i32 @test3(i32 %A, i32 %B) {
- %a = xor i32 %A, -1 ; <i32> [#uses=1]
- %b = xor i32 %B, -1 ; <i32> [#uses=1]
- %c = and i32 %a, %b ; <i32> [#uses=1]
- %d = xor i32 %c, -1 ; <i32> [#uses=1]
- ret i32 %d
-}
-
-; Test that demorgens law can work with constants
-define i32 @test4(i32 %A, i32 %B) {
- %a = xor i32 %A, -1 ; <i32> [#uses=1]
- %c = and i32 %a, 5 ; <i32> [#uses=1]
- %d = xor i32 %c, -1 ; <i32> [#uses=1]
- ret i32 %d
-}
-
-; test the mirror of demorgans law...
-define i32 @test5(i32 %A, i32 %B) {
- %a = xor i32 %A, -1 ; <i32> [#uses=1]
- %b = xor i32 %B, -1 ; <i32> [#uses=1]
- %c = or i32 %a, %b ; <i32> [#uses=1]
- %d = xor i32 %c, -1 ; <i32> [#uses=1]
- ret i32 %d
-}
-
-; PR2298
-define i8 @test6(i32 %a, i32 %b) zeroext nounwind {
-entry:
- %tmp1not = xor i32 %a, -1 ; <i32> [#uses=1]
- %tmp2not = xor i32 %b, -1 ; <i32> [#uses=1]
- %tmp3 = icmp slt i32 %tmp1not, %tmp2not ; <i1> [#uses=1]
- %retval67 = zext i1 %tmp3 to i8 ; <i8> [#uses=1]
- ret i8 %retval67
-}
-
diff --git a/release_23/test/Transforms/InstCombine/or.ll b/release_23/test/Transforms/InstCombine/or.ll
deleted file mode 100644
index e70fb1c4e0c0..000000000000
--- a/release_23/test/Transforms/InstCombine/or.ll
+++ /dev/null
@@ -1,171 +0,0 @@
-; This test makes sure that these instructions are properly eliminated.
-;
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \
-; RUN: grep -v xor | not grep {or }
-; END.
-
-define i32 @test1(i32 %A) {
- %B = or i32 %A, 0 ; <i32> [#uses=1]
- ret i32 %B
-}
-
-define i32 @test2(i32 %A) {
- %B = or i32 %A, -1 ; <i32> [#uses=1]
- ret i32 %B
-}
-
-define i8 @test2a(i8 %A) {
- %B = or i8 %A, -1 ; <i8> [#uses=1]
- ret i8 %B
-}
-
-define i1 @test3(i1 %A) {
- %B = or i1 %A, false ; <i1> [#uses=1]
- ret i1 %B
-}
-
-define i1 @test4(i1 %A) {
- %B = or i1 %A, true ; <i1> [#uses=1]
- ret i1 %B
-}
-
-define i1 @test5(i1 %A) {
- %B = or i1 %A, %A ; <i1> [#uses=1]
- ret i1 %B
-}
-
-define i32 @test6(i32 %A) {
- %B = or i32 %A, %A ; <i32> [#uses=1]
- ret i32 %B
-}
-
-; A | ~A == -1
-define i32 @test7(i32 %A) {
- %NotA = xor i32 -1, %A ; <i32> [#uses=1]
- %B = or i32 %A, %NotA ; <i32> [#uses=1]
- ret i32 %B
-}
-
-define i8 @test8(i8 %A) {
- %B = or i8 %A, -2 ; <i8> [#uses=1]
- %C = or i8 %B, 1 ; <i8> [#uses=1]
- ret i8 %C
-}
-
-; Test that (A|c1)|(B|c2) == (A|B)|(c1|c2)
-define i8 @test9(i8 %A, i8 %B) {
- %C = or i8 %A, 1 ; <i8> [#uses=1]
- %D = or i8 %B, -2 ; <i8> [#uses=1]
- %E = or i8 %C, %D ; <i8> [#uses=1]
- ret i8 %E
-}
-
-define i8 @test10(i8 %A) {
- %B = or i8 %A, 1 ; <i8> [#uses=1]
- %C = and i8 %B, -2 ; <i8> [#uses=1]
- ; (X & C1) | C2 --> (X | C2) & (C1|C2)
- %D = or i8 %C, -2 ; <i8> [#uses=1]
- ret i8 %D
-}
-
-define i8 @test11(i8 %A) {
- %B = or i8 %A, -2 ; <i8> [#uses=1]
- %C = xor i8 %B, 13 ; <i8> [#uses=1]
- ; (X ^ C1) | C2 --> (X | C2) ^ (C1&~C2)
- %D = or i8 %C, 1 ; <i8> [#uses=1]
- %E = xor i8 %D, 12 ; <i8> [#uses=1]
- ret i8 %E
-}
-
-define i32 @test12(i32 %A) {
- ; Should be eliminated
- %B = or i32 %A, 4 ; <i32> [#uses=1]
- %C = and i32 %B, 8 ; <i32> [#uses=1]
- ret i32 %C
-}
-
-define i32 @test13(i32 %A) {
- %B = or i32 %A, 12 ; <i32> [#uses=1]
- ; Always equal to 8
- %C = and i32 %B, 8 ; <i32> [#uses=1]
- ret i32 %C
-}
-
-define i1 @test14(i32 %A, i32 %B) {
- %C1 = icmp ult i32 %A, %B ; <i1> [#uses=1]
- %C2 = icmp ugt i32 %A, %B ; <i1> [#uses=1]
- ; (A < B) | (A > B) === A != B
- %D = or i1 %C1, %C2 ; <i1> [#uses=1]
- ret i1 %D
-}
-
-define i1 @test15(i32 %A, i32 %B) {
- %C1 = icmp ult i32 %A, %B ; <i1> [#uses=1]
- %C2 = icmp eq i32 %A, %B ; <i1> [#uses=1]
- ; (A < B) | (A == B) === A <= B
- %D = or i1 %C1, %C2 ; <i1> [#uses=1]
- ret i1 %D
-}
-
-define i32 @test16(i32 %A) {
- %B = and i32 %A, 1 ; <i32> [#uses=1]
- ; -2 = ~1
- %C = and i32 %A, -2 ; <i32> [#uses=1]
- ; %D = and int %B, -1 == %B
- %D = or i32 %B, %C ; <i32> [#uses=1]
- ret i32 %D
-}
-
-define i32 @test17(i32 %A) {
- %B = and i32 %A, 1 ; <i32> [#uses=1]
- %C = and i32 %A, 4 ; <i32> [#uses=1]
- ; %D = and int %B, 5
- %D = or i32 %B, %C ; <i32> [#uses=1]
- ret i32 %D
-}
-
-define i1 @test18(i32 %A) {
- %B = icmp sge i32 %A, 100 ; <i1> [#uses=1]
- %C = icmp slt i32 %A, 50 ; <i1> [#uses=1]
- ;; (A-50) >u 50
- %D = or i1 %B, %C ; <i1> [#uses=1]
- ret i1 %D
-}
-
-define i1 @test19(i32 %A) {
- %B = icmp eq i32 %A, 50 ; <i1> [#uses=1]
- %C = icmp eq i32 %A, 51 ; <i1> [#uses=1]
- ;; (A-50) < 2
- %D = or i1 %B, %C ; <i1> [#uses=1]
- ret i1 %D
-}
-
-define i32 @test20(i32 %x) {
- %y = and i32 %x, 123 ; <i32> [#uses=1]
- %z = or i32 %y, %x ; <i32> [#uses=1]
- ret i32 %z
-}
-
-define i32 @test21(i32 %tmp.1) {
- %tmp.1.mask1 = add i32 %tmp.1, 2 ; <i32> [#uses=1]
- %tmp.3 = and i32 %tmp.1.mask1, -2 ; <i32> [#uses=1]
- %tmp.5 = and i32 %tmp.1, 1 ; <i32> [#uses=1]
- ;; add tmp.1, 2
- %tmp.6 = or i32 %tmp.5, %tmp.3 ; <i32> [#uses=1]
- ret i32 %tmp.6
-}
-
-define i32 @test22(i32 %B) {
- %ELIM41 = and i32 %B, 1 ; <i32> [#uses=1]
- %ELIM7 = and i32 %B, -2 ; <i32> [#uses=1]
- %ELIM5 = or i32 %ELIM41, %ELIM7 ; <i32> [#uses=1]
- ret i32 %ELIM5
-}
-
-define i16 @test23(i16 %A) {
- %B = lshr i16 %A, 1 ; <i16> [#uses=1]
- ;; fold or into xor
- %C = or i16 %B, -32768 ; <i16> [#uses=1]
- %D = xor i16 %C, 8193 ; <i16> [#uses=1]
- ret i16 %D
-}
diff --git a/release_23/test/Transforms/InstCombine/or2.ll b/release_23/test/Transforms/InstCombine/or2.ll
deleted file mode 100644
index f14a27439163..000000000000
--- a/release_23/test/Transforms/InstCombine/or2.ll
+++ /dev/null
@@ -1,12 +0,0 @@
-; This test makes sure that these instructions are properly eliminated.
-;
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep -v xor | not grep {or }
-
-; PR1738
-define i1 @test1(double %X, double %Y) {
- %tmp9 = fcmp uno double %X, 0.000000e+00 ; <i1> [#uses=1]
- %tmp13 = fcmp uno double %Y, 0.000000e+00 ; <i1> [#uses=1]
- %bothcond = or i1 %tmp13, %tmp9 ; <i1> [#uses=1]
- ret i1 %bothcond
-}
-
diff --git a/release_23/test/Transforms/InstCombine/phi-merge.ll b/release_23/test/Transforms/InstCombine/phi-merge.ll
deleted file mode 100644
index daac41274cde..000000000000
--- a/release_23/test/Transforms/InstCombine/phi-merge.ll
+++ /dev/null
@@ -1,31 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep {phi i32}
-; PR1777
-
-declare i1 @rrr()
-
-define i1 @zxcv() {
-entry:
-%a = alloca i32
-%i = ptrtoint i32* %a to i32
-%b = call i1 @rrr()
-br i1 %b, label %one, label %two
-
-one:
-%x = phi i32 [%i, %entry], [%y, %two]
-%c = call i1 @rrr()
-br i1 %c, label %two, label %end
-
-two:
-%y = phi i32 [%i, %entry], [%x, %one]
-%d = call i1 @rrr()
-br i1 %d, label %one, label %end
-
-end:
-%f = phi i32 [ %x, %one], [%y, %two]
-; Change the %f to %i, and the optimizer suddenly becomes a lot smarter
-; even though %f must equal %i at this point
-%g = inttoptr i32 %f to i32*
-store i32 10, i32* %g
-%z = call i1 @rrr()
-ret i1 %z
-}
diff --git a/release_23/test/Transforms/InstCombine/phi.ll b/release_23/test/Transforms/InstCombine/phi.ll
deleted file mode 100644
index 6f0ef6b549ef..000000000000
--- a/release_23/test/Transforms/InstCombine/phi.ll
+++ /dev/null
@@ -1,101 +0,0 @@
-; This test makes sure that these instructions are properly eliminated.
-;
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep phi
-; END.
-
-define i32 @test1(i32 %A, i1 %b) {
-BB0:
- br i1 %b, label %BB1, label %BB2
-
-BB1: ; preds = %BB0
- ; Combine away one argument PHI nodes
- %B = phi i32 [ %A, %BB0 ] ; <i32> [#uses=1]
- ret i32 %B
-
-BB2: ; preds = %BB0
- ret i32 %A
-}
-
-define i32 @test2(i32 %A, i1 %b) {
-BB0:
- br i1 %b, label %BB1, label %BB2
-
-BB1: ; preds = %BB0
- br label %BB2
-
-BB2: ; preds = %BB1, %BB0
- ; Combine away PHI nodes with same values
- %B = phi i32 [ %A, %BB0 ], [ %A, %BB1 ] ; <i32> [#uses=1]
- ret i32 %B
-}
-
-define i32 @test3(i32 %A, i1 %b) {
-BB0:
- br label %Loop
-
-Loop: ; preds = %Loop, %BB0
- ; PHI has same value always.
- %B = phi i32 [ %A, %BB0 ], [ %B, %Loop ] ; <i32> [#uses=2]
- br i1 %b, label %Loop, label %Exit
-
-Exit: ; preds = %Loop
- ret i32 %B
-}
-
-define i32 @test4(i1 %b) {
-BB0:
- ; Loop is unreachable
- ret i32 7
-
-Loop: ; preds = %L2, %Loop
- ; PHI has same value always.
- %B = phi i32 [ %B, %L2 ], [ %B, %Loop ] ; <i32> [#uses=2]
- br i1 %b, label %L2, label %Loop
-
-L2: ; preds = %Loop
- br label %Loop
-}
-
-define i32 @test5(i32 %A, i1 %b) {
-BB0:
- br label %Loop
-
-Loop: ; preds = %Loop, %BB0
- ; PHI has same value always.
- %B = phi i32 [ %A, %BB0 ], [ undef, %Loop ] ; <i32> [#uses=1]
- br i1 %b, label %Loop, label %Exit
-
-Exit: ; preds = %Loop
- ret i32 %B
-}
-
-define i32 @test6(i32 %A, i1 %b) {
-BB0:
- %X = bitcast i32 %A to i32 ; <i32> [#uses=1]
- br i1 %b, label %BB1, label %BB2
-
-BB1: ; preds = %BB0
- %Y = bitcast i32 %A to i32 ; <i32> [#uses=1]
- br label %BB2
-
-BB2: ; preds = %BB1, %BB0
- ;; Suck casts into phi
- %B = phi i32 [ %X, %BB0 ], [ %Y, %BB1 ] ; <i32> [#uses=1]
- ret i32 %B
-}
-
-define i32 @test7(i32 %A, i1 %b) {
-BB0:
- br label %Loop
-
-Loop: ; preds = %Loop, %BB0
- ; PHI is dead.
- %B = phi i32 [ %A, %BB0 ], [ %C, %Loop ] ; <i32> [#uses=1]
- %C = add i32 %B, 123 ; <i32> [#uses=1]
- br i1 %b, label %Loop, label %Exit
-
-Exit: ; preds = %Loop
- ret i32 0
-}
-
-
diff --git a/release_23/test/Transforms/InstCombine/rem.ll b/release_23/test/Transforms/InstCombine/rem.ll
deleted file mode 100644
index 8b2263d9b23f..000000000000
--- a/release_23/test/Transforms/InstCombine/rem.ll
+++ /dev/null
@@ -1,83 +0,0 @@
-; This test makes sure that these instructions are properly eliminated.
-;
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep rem
-; END.
-
-define i32 @test1(i32 %A) {
- %B = srem i32 %A, 1 ; ISA constant 0
- ret i32 %B
-}
-
-define i32 @test2(i32 %A) { ; 0 % X = 0, we don't need to preserve traps
- %B = srem i32 0, %A
- ret i32 %B
-}
-
-define i32 @test3(i32 %A) {
- %B = urem i32 %A, 8
- ret i32 %B
-}
-
-define i1 @test3a(i32 %A) {
- %B = srem i32 %A, -8
- %C = icmp ne i32 %B, 0
- ret i1 %C
-}
-
-define i32 @test4(i32 %X, i1 %C) {
- %V = select i1 %C, i32 1, i32 8
- %R = urem i32 %X, %V
- ret i32 %R
-}
-
-define i32 @test5(i32 %X, i8 %B) {
- %shift.upgrd.1 = zext i8 %B to i32
- %Amt = shl i32 32, %shift.upgrd.1
- %V = urem i32 %X, %Amt
- ret i32 %V
-}
-
-define i32 @test6(i32 %A) {
- %B = srem i32 %A, 0 ;; undef
- ret i32 %B
-}
-
-define i32 @test7(i32 %A) {
- %B = mul i32 %A, 8
- %C = srem i32 %B, 4
- ret i32 %C
-}
-
-define i32 @test8(i32 %A) {
- %B = shl i32 %A, 4
- %C = srem i32 %B, 8
- ret i32 %C
-}
-
-define i32 @test9(i32 %A) {
- %B = mul i32 %A, 64
- %C = urem i32 %B, 32
- ret i32 %C
-}
-
-define i32 @test10(i8 %c) {
- %tmp.1 = zext i8 %c to i32
- %tmp.2 = mul i32 %tmp.1, 4
- %tmp.3 = sext i32 %tmp.2 to i64
- %tmp.5 = urem i64 %tmp.3, 4
- %tmp.6 = trunc i64 %tmp.5 to i32
- ret i32 %tmp.6
-}
-
-define i32 @test11(i32 %i) {
- %tmp.1 = and i32 %i, -2
- %tmp.3 = mul i32 %tmp.1, 2
- %tmp.5 = urem i32 %tmp.3, 4
- ret i32 %tmp.5
-}
-
-define i32 @test12(i32 %i) {
- %tmp.1 = and i32 %i, -4
- %tmp.5 = srem i32 %tmp.1, 2
- ret i32 %tmp.5
-}
diff --git a/release_23/test/Transforms/InstCombine/select.ll b/release_23/test/Transforms/InstCombine/select.ll
deleted file mode 100644
index 15083f2facd2..000000000000
--- a/release_23/test/Transforms/InstCombine/select.ll
+++ /dev/null
@@ -1,204 +0,0 @@
-; This test makes sure that these instructions are properly eliminated.
-; PR1822
-
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep select
-
-define i32 @test1(i32 %A, i32 %B) {
- %C = select i1 false, i32 %A, i32 %B ; <i32> [#uses=1]
- ret i32 %C
-}
-
-define i32 @test2(i32 %A, i32 %B) {
- %C = select i1 true, i32 %A, i32 %B ; <i32> [#uses=1]
- ret i32 %C
-}
-
-
-define i32 @test3(i1 %C, i32 %I) {
- ; V = I
- %V = select i1 %C, i32 %I, i32 %I ; <i32> [#uses=1]
- ret i32 %V
-}
-
-define i1 @test4(i1 %C) {
- ; V = C
- %V = select i1 %C, i1 true, i1 false ; <i1> [#uses=1]
- ret i1 %V
-}
-
-define i1 @test5(i1 %C) {
- ; V = !C
- %V = select i1 %C, i1 false, i1 true ; <i1> [#uses=1]
- ret i1 %V
-}
-
-define i32 @test6(i1 %C) {
- ; V = cast C to int
- %V = select i1 %C, i32 1, i32 0 ; <i32> [#uses=1]
- ret i32 %V
-}
-
-define i1 @test7(i1 %C, i1 %X) {
- ; R = or C, X
- %R = select i1 %C, i1 true, i1 %X ; <i1> [#uses=1]
- ret i1 %R
-}
-
-define i1 @test8(i1 %C, i1 %X) {
- ; R = and C, X
- %R = select i1 %C, i1 %X, i1 false ; <i1> [#uses=1]
- ret i1 %R
-}
-
-define i1 @test9(i1 %C, i1 %X) {
- ; R = and !C, X
- %R = select i1 %C, i1 false, i1 %X ; <i1> [#uses=1]
- ret i1 %R
-}
-
-define i1 @test10(i1 %C, i1 %X) {
- ; R = or !C, X
- %R = select i1 %C, i1 %X, i1 true ; <i1> [#uses=1]
- ret i1 %R
-}
-
-define i32 @test11(i32 %a) {
- %C = icmp eq i32 %a, 0 ; <i1> [#uses=1]
- %R = select i1 %C, i32 0, i32 1 ; <i32> [#uses=1]
- ret i32 %R
-}
-
-define i32 @test12(i1 %cond, i32 %a) {
- %b = or i32 %a, 1 ; <i32> [#uses=1]
- %c = select i1 %cond, i32 %b, i32 %a ; <i32> [#uses=1]
- ret i32 %c
-}
-
-define i32 @test12a(i1 %cond, i32 %a) {
- %b = ashr i32 %a, 1 ; <i32> [#uses=1]
- %c = select i1 %cond, i32 %b, i32 %a ; <i32> [#uses=1]
- ret i32 %c
-}
-
-define i32 @test12b(i1 %cond, i32 %a) {
- %b = ashr i32 %a, 1 ; <i32> [#uses=1]
- %c = select i1 %cond, i32 %a, i32 %b ; <i32> [#uses=1]
- ret i32 %c
-}
-
-define i32 @test13(i32 %a, i32 %b) {
- %C = icmp eq i32 %a, %b ; <i1> [#uses=1]
- %V = select i1 %C, i32 %a, i32 %b ; <i32> [#uses=1]
- ret i32 %V
-}
-
-define i32 @test13a(i32 %a, i32 %b) {
- %C = icmp ne i32 %a, %b ; <i1> [#uses=1]
- %V = select i1 %C, i32 %a, i32 %b ; <i32> [#uses=1]
- ret i32 %V
-}
-
-define i32 @test13b(i32 %a, i32 %b) {
- %C = icmp eq i32 %a, %b ; <i1> [#uses=1]
- %V = select i1 %C, i32 %b, i32 %a ; <i32> [#uses=1]
- ret i32 %V
-}
-
-define i1 @test14a(i1 %C, i32 %X) {
- %V = select i1 %C, i32 %X, i32 0 ; <i32> [#uses=1]
- ; (X < 1) | !C
- %R = icmp slt i32 %V, 1 ; <i1> [#uses=1]
- ret i1 %R
-}
-
-define i1 @test14b(i1 %C, i32 %X) {
- %V = select i1 %C, i32 0, i32 %X ; <i32> [#uses=1]
- ; (X < 1) | C
- %R = icmp slt i32 %V, 1 ; <i1> [#uses=1]
- ret i1 %R
-}
-
-;; Code sequence for (X & 16) ? 16 : 0
-define i32 @test15a(i32 %X) {
- %t1 = and i32 %X, 16 ; <i32> [#uses=1]
- %t2 = icmp eq i32 %t1, 0 ; <i1> [#uses=1]
- %t3 = select i1 %t2, i32 0, i32 16 ; <i32> [#uses=1]
- ret i32 %t3
-}
-
-;; Code sequence for (X & 32) ? 0 : 24
-define i32 @test15b(i32 %X) {
- %t1 = and i32 %X, 32 ; <i32> [#uses=1]
- %t2 = icmp eq i32 %t1, 0 ; <i1> [#uses=1]
- %t3 = select i1 %t2, i32 32, i32 0 ; <i32> [#uses=1]
- ret i32 %t3
-}
-
-;; Alternate code sequence for (X & 16) ? 16 : 0
-define i32 @test15c(i32 %X) {
- %t1 = and i32 %X, 16 ; <i32> [#uses=1]
- %t2 = icmp eq i32 %t1, 16 ; <i1> [#uses=1]
- %t3 = select i1 %t2, i32 16, i32 0 ; <i32> [#uses=1]
- ret i32 %t3
-}
-
-;; Alternate code sequence for (X & 16) ? 16 : 0
-define i32 @test15d(i32 %X) {
- %t1 = and i32 %X, 16 ; <i32> [#uses=1]
- %t2 = icmp ne i32 %t1, 0 ; <i1> [#uses=1]
- %t3 = select i1 %t2, i32 16, i32 0 ; <i32> [#uses=1]
- ret i32 %t3
-}
-
-define i32 @test16(i1 %C, i32* %P) {
- %P2 = select i1 %C, i32* %P, i32* null ; <i32*> [#uses=1]
- %V = load i32* %P2 ; <i32> [#uses=1]
- ret i32 %V
-}
-
-define i1 @test17(i32* %X, i1 %C) {
- %R = select i1 %C, i32* %X, i32* null ; <i32*> [#uses=1]
- %RV = icmp eq i32* %R, null ; <i1> [#uses=1]
- ret i1 %RV
-}
-
-define i32 @test18(i32 %X, i32 %Y, i1 %C) {
- %R = select i1 %C, i32 %X, i32 0 ; <i32> [#uses=1]
- %V = sdiv i32 %Y, %R ; <i32> [#uses=1]
- ret i32 %V
-}
-
-define i32 @test19(i32 %x) {
- %tmp = icmp ugt i32 %x, 2147483647 ; <i1> [#uses=1]
- %retval = select i1 %tmp, i32 -1, i32 0 ; <i32> [#uses=1]
- ret i32 %retval
-}
-
-define i32 @test20(i32 %x) {
- %tmp = icmp slt i32 %x, 0 ; <i1> [#uses=1]
- %retval = select i1 %tmp, i32 -1, i32 0 ; <i32> [#uses=1]
- ret i32 %retval
-}
-
-define i64 @test21(i32 %x) {
- %tmp = icmp slt i32 %x, 0 ; <i1> [#uses=1]
- %retval = select i1 %tmp, i64 -1, i64 0 ; <i64> [#uses=1]
- ret i64 %retval
-}
-
-define i16 @test22(i32 %x) {
- %tmp = icmp slt i32 %x, 0 ; <i1> [#uses=1]
- %retval = select i1 %tmp, i16 -1, i16 0 ; <i16> [#uses=1]
- ret i16 %retval
-}
-
-define i1 @test23(i1 %a, i1 %b) {
- %c = select i1 %a, i1 %b, i1 %a ; <i1> [#uses=1]
- ret i1 %c
-}
-
-define i1 @test24(i1 %a, i1 %b) {
- %c = select i1 %a, i1 %a, i1 %b ; <i1> [#uses=1]
- ret i1 %c
-}
-
diff --git a/release_23/test/Transforms/InstCombine/set.ll b/release_23/test/Transforms/InstCombine/set.ll
deleted file mode 100644
index 5e3ca0b51b89..000000000000
--- a/release_23/test/Transforms/InstCombine/set.ll
+++ /dev/null
@@ -1,171 +0,0 @@
-; This test makes sure that these instructions are properly eliminated.
-;
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep icmp
-; END.
-
-@X = external global i32 ; <i32*> [#uses=2]
-
-define i1 @test1(i32 %A) {
- %B = icmp eq i32 %A, %A ; <i1> [#uses=1]
- ; Never true
- %C = icmp eq i32* @X, null ; <i1> [#uses=1]
- %D = and i1 %B, %C ; <i1> [#uses=1]
- ret i1 %D
-}
-
-define i1 @test2(i32 %A) {
- %B = icmp ne i32 %A, %A ; <i1> [#uses=1]
- ; Never false
- %C = icmp ne i32* @X, null ; <i1> [#uses=1]
- %D = or i1 %B, %C ; <i1> [#uses=1]
- ret i1 %D
-}
-
-define i1 @test3(i32 %A) {
- %B = icmp slt i32 %A, %A ; <i1> [#uses=1]
- ret i1 %B
-}
-
-
-define i1 @test4(i32 %A) {
- %B = icmp sgt i32 %A, %A ; <i1> [#uses=1]
- ret i1 %B
-}
-
-define i1 @test5(i32 %A) {
- %B = icmp sle i32 %A, %A ; <i1> [#uses=1]
- ret i1 %B
-}
-
-define i1 @test6(i32 %A) {
- %B = icmp sge i32 %A, %A ; <i1> [#uses=1]
- ret i1 %B
-}
-
-define i1 @test7(i32 %A) {
- ; true
- %B = icmp uge i32 %A, 0 ; <i1> [#uses=1]
- ret i1 %B
-}
-
-define i1 @test8(i32 %A) {
- ; false
- %B = icmp ult i32 %A, 0 ; <i1> [#uses=1]
- ret i1 %B
-}
-
-;; test operations on boolean values these should all be eliminated$a
-define i1 @test9(i1 %A) {
- ; false
- %B = icmp ult i1 %A, false ; <i1> [#uses=1]
- ret i1 %B
-}
-
-define i1 @test10(i1 %A) {
- ; false
- %B = icmp ugt i1 %A, true ; <i1> [#uses=1]
- ret i1 %B
-}
-
-define i1 @test11(i1 %A) {
- ; true
- %B = icmp ule i1 %A, true ; <i1> [#uses=1]
- ret i1 %B
-}
-
-define i1 @test12(i1 %A) {
- ; true
- %B = icmp uge i1 %A, false ; <i1> [#uses=1]
- ret i1 %B
-}
-
-define i1 @test13(i1 %A, i1 %B) {
- ; A | ~B
- %C = icmp uge i1 %A, %B ; <i1> [#uses=1]
- ret i1 %C
-}
-
-define i1 @test14(i1 %A, i1 %B) {
- ; ~(A ^ B)
- %C = icmp eq i1 %A, %B ; <i1> [#uses=1]
- ret i1 %C
-}
-
-define i1 @test16(i32 %A) {
- %B = and i32 %A, 5 ; <i32> [#uses=1]
- ; Is never true
- %C = icmp eq i32 %B, 8 ; <i1> [#uses=1]
- ret i1 %C
-}
-
-define i1 @test17(i8 %A) {
- %B = or i8 %A, 1 ; <i8> [#uses=1]
- ; Always false
- %C = icmp eq i8 %B, 2 ; <i1> [#uses=1]
- ret i1 %C
-}
-
-define i1 @test18(i1 %C, i32 %a) {
-entry:
- br i1 %C, label %endif, label %else
-
-else: ; preds = %entry
- br label %endif
-
-endif: ; preds = %else, %entry
- %b.0 = phi i32 [ 0, %entry ], [ 1, %else ] ; <i32> [#uses=1]
- %tmp.4 = icmp slt i32 %b.0, 123 ; <i1> [#uses=1]
- ret i1 %tmp.4
-}
-
-define i1 @test19(i1 %A, i1 %B) {
- %a = zext i1 %A to i32 ; <i32> [#uses=1]
- %b = zext i1 %B to i32 ; <i32> [#uses=1]
- %C = icmp eq i32 %a, %b ; <i1> [#uses=1]
- ret i1 %C
-}
-
-define i32 @test20(i32 %A) {
- %B = and i32 %A, 1 ; <i32> [#uses=1]
- %C = icmp ne i32 %B, 0 ; <i1> [#uses=1]
- %D = zext i1 %C to i32 ; <i32> [#uses=1]
- ret i32 %D
-}
-
-define i32 @test21(i32 %a) {
- %tmp.6 = and i32 %a, 4 ; <i32> [#uses=1]
- %not.tmp.7 = icmp ne i32 %tmp.6, 0 ; <i1> [#uses=1]
- %retval = zext i1 %not.tmp.7 to i32 ; <i32> [#uses=1]
- ret i32 %retval
-}
-
-define i1 @test22(i32 %A, i32 %X) {
- %B = and i32 %A, 100663295 ; <i32> [#uses=1]
- %C = icmp ult i32 %B, 268435456 ; <i1> [#uses=1]
- %Y = and i32 %X, 7 ; <i32> [#uses=1]
- %Z = icmp sgt i32 %Y, -1 ; <i1> [#uses=1]
- %R = or i1 %C, %Z ; <i1> [#uses=1]
- ret i1 %R
-}
-
-define i32 @test23(i32 %a) {
- %tmp.1 = and i32 %a, 1 ; <i32> [#uses=1]
- %tmp.2 = icmp eq i32 %tmp.1, 0 ; <i1> [#uses=1]
- %tmp.3 = zext i1 %tmp.2 to i32 ; <i32> [#uses=1]
- ret i32 %tmp.3
-}
-
-define i32 @test24(i32 %a) {
- %tmp1 = and i32 %a, 4 ; <i32> [#uses=1]
- %tmp.1 = lshr i32 %tmp1, 2 ; <i32> [#uses=1]
- %tmp.2 = icmp eq i32 %tmp.1, 0 ; <i1> [#uses=1]
- %tmp.3 = zext i1 %tmp.2 to i32 ; <i32> [#uses=1]
- ret i32 %tmp.3
-}
-
-define i1 @test25(i32 %A) {
- %B = and i32 %A, 2 ; <i32> [#uses=1]
- %C = icmp ugt i32 %B, 2 ; <i1> [#uses=1]
- ret i1 %C
-}
-
diff --git a/release_23/test/Transforms/InstCombine/setcc-cast-cast.ll b/release_23/test/Transforms/InstCombine/setcc-cast-cast.ll
deleted file mode 100644
index ed2e2bee551e..000000000000
--- a/release_23/test/Transforms/InstCombine/setcc-cast-cast.ll
+++ /dev/null
@@ -1,46 +0,0 @@
-; This test case was reduced from MultiSource/Applications/hbd. It makes sure
-; that folding doesn't happen in case a zext is applied where a sext should have
-; been when a setcc is used with two casts.
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \
-; RUN: not grep {br i1 false}
-; END.
-
-define i32 @bug(i8 %inbuff) {
-entry:
- %tmp = bitcast i8 %inbuff to i8 ; <i8> [#uses=1]
- %tmp.upgrd.1 = sext i8 %tmp to i32 ; <i32> [#uses=3]
- %tmp.upgrd.2 = icmp eq i32 %tmp.upgrd.1, 1 ; <i1> [#uses=1]
- br i1 %tmp.upgrd.2, label %cond_true, label %cond_next
-
-cond_true: ; preds = %entry
- br label %bb
-
-cond_next: ; preds = %entry
- %tmp3 = icmp eq i32 %tmp.upgrd.1, -1 ; <i1> [#uses=1]
- br i1 %tmp3, label %cond_true4, label %cond_next5
-
-cond_true4: ; preds = %cond_next
- br label %bb
-
-cond_next5: ; preds = %cond_next
- %tmp7 = icmp sgt i32 %tmp.upgrd.1, 1 ; <i1> [#uses=1]
- br i1 %tmp7, label %cond_true8, label %cond_false
-
-cond_true8: ; preds = %cond_next5
- br label %cond_next9
-
-cond_false: ; preds = %cond_next5
- br label %cond_next9
-
-cond_next9: ; preds = %cond_false, %cond_true8
- %iftmp.1.0 = phi i32 [ 42, %cond_true8 ], [ 23, %cond_false ] ; <i32> [#uses=1]
- br label %return
-
-bb: ; preds = %cond_true4, %cond_true
- br label %return
-
-return: ; preds = %bb, %cond_next9
- %retval.0 = phi i32 [ 17, %bb ], [ %iftmp.1.0, %cond_next9 ] ; <i32> [#uses=1]
- ret i32 %retval.0
-}
-
diff --git a/release_23/test/Transforms/InstCombine/setcc-strength-reduce.ll b/release_23/test/Transforms/InstCombine/setcc-strength-reduce.ll
deleted file mode 100644
index 9931ccb2fd25..000000000000
--- a/release_23/test/Transforms/InstCombine/setcc-strength-reduce.ll
+++ /dev/null
@@ -1,37 +0,0 @@
-; This test ensures that "strength reduction" of conditional expressions are
-; working. Basically this boils down to converting setlt,gt,le,ge instructions
-; into equivalent setne,eq instructions.
-;
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \
-; RUN: grep -v {icmp eq} | grep -v {icmp ne} | not grep icmp
-; END.
-
-define i1 @test1(i32 %A) {
- ; setne %A, 0
- %B = icmp uge i32 %A, 1 ; <i1> [#uses=1]
- ret i1 %B
-}
-
-define i1 @test2(i32 %A) {
- ; setne %A, 0
- %B = icmp ugt i32 %A, 0 ; <i1> [#uses=1]
- ret i1 %B
-}
-
-define i1 @test3(i8 %A) {
- ; setne %A, -128
- %B = icmp sge i8 %A, -127 ; <i1> [#uses=1]
- ret i1 %B
-}
-
-define i1 @test4(i8 %A) {
- ; setne %A, 127
- %B = icmp sle i8 %A, 126 ; <i1> [#uses=1]
- ret i1 %B
-}
-
-define i1 @test5(i8 %A) {
- ; setne %A, 127
- %B = icmp slt i8 %A, 127 ; <i1> [#uses=1]
- ret i1 %B
-}
diff --git a/release_23/test/Transforms/InstCombine/sext-misc.ll b/release_23/test/Transforms/InstCombine/sext-misc.ll
deleted file mode 100644
index da69e85ff5f3..000000000000
--- a/release_23/test/Transforms/InstCombine/sext-misc.ll
+++ /dev/null
@@ -1,45 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep sext
-; RUN: llvm-as < %s | llc -march=x86-64 | not grep movslq
-; RUN: llvm-as < %s | llc -march=x86 | not grep sar
-
-declare i32 @llvm.ctpop.i32(i32)
-declare i32 @llvm.ctlz.i32(i32)
-declare i32 @llvm.cttz.i32(i32)
-
-define i64 @foo(i32 %x) {
- %t = call i32 @llvm.ctpop.i32(i32 %x)
- %s = sext i32 %t to i64
- ret i64 %s
-}
-define i64 @boo(i32 %x) {
- %t = call i32 @llvm.ctlz.i32(i32 %x)
- %s = sext i32 %t to i64
- ret i64 %s
-}
-define i64 @zoo(i32 %x) {
- %t = call i32 @llvm.cttz.i32(i32 %x)
- %s = sext i32 %t to i64
- ret i64 %s
-}
-define i64 @coo(i32 %x) {
- %t = udiv i32 %x, 3
- %s = sext i32 %t to i64
- ret i64 %s
-}
-define i64 @moo(i32 %x) {
- %t = urem i32 %x, 30000
- %s = sext i32 %t to i64
- ret i64 %s
-}
-define i64 @yoo(i32 %x) {
- %u = lshr i32 %x, 3
- %t = mul i32 %u, 3
- %s = sext i32 %t to i64
- ret i64 %s
-}
-define i64 @voo(i32 %x) {
- %t = and i32 %x, 511
- %u = sub i32 20000, %t
- %s = sext i32 %u to i64
- ret i64 %s
-}
diff --git a/release_23/test/Transforms/InstCombine/shift-simplify.ll b/release_23/test/Transforms/InstCombine/shift-simplify.ll
deleted file mode 100644
index ecf3f5f92fef..000000000000
--- a/release_23/test/Transforms/InstCombine/shift-simplify.ll
+++ /dev/null
@@ -1,42 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \
-; RUN: egrep {shl|lshr|ashr} | count 3
-
-define i32 @test0(i32 %A, i32 %B, i32 %C) {
- %X = shl i32 %A, %C
- %Y = shl i32 %B, %C
- %Z = and i32 %X, %Y
- ret i32 %Z
-}
-
-define i32 @test1(i32 %A, i32 %B, i32 %C) {
- %X = lshr i32 %A, %C
- %Y = lshr i32 %B, %C
- %Z = or i32 %X, %Y
- ret i32 %Z
-}
-
-define i32 @test2(i32 %A, i32 %B, i32 %C) {
- %X = ashr i32 %A, %C
- %Y = ashr i32 %B, %C
- %Z = xor i32 %X, %Y
- ret i32 %Z
-}
-
-define i1 @test3(i32 %X) {
- %tmp1 = shl i32 %X, 7
- %tmp2 = icmp slt i32 %tmp1, 0
- ret i1 %tmp2
-}
-
-define i1 @test4(i32 %X) {
- %tmp1 = lshr i32 %X, 7
- %tmp2 = icmp slt i32 %tmp1, 0
- ret i1 %tmp2
-}
-
-define i1 @test5(i32 %X) {
- %tmp1 = ashr i32 %X, 7
- %tmp2 = icmp slt i32 %tmp1, 0
- ret i1 %tmp2
-}
-
diff --git a/release_23/test/Transforms/InstCombine/shift-sra.ll b/release_23/test/Transforms/InstCombine/shift-sra.ll
deleted file mode 100644
index 6058bd6dc724..000000000000
--- a/release_23/test/Transforms/InstCombine/shift-sra.ll
+++ /dev/null
@@ -1,19 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \
-; RUN: grep {lshr i32} | count 2
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep ashr
-
-
-define i32 @test1(i32 %X, i8 %A) {
- %shift.upgrd.1 = zext i8 %A to i32 ; <i32> [#uses=1]
- ; can be logical shift.
- %Y = ashr i32 %X, %shift.upgrd.1 ; <i32> [#uses=1]
- %Z = and i32 %Y, 1 ; <i32> [#uses=1]
- ret i32 %Z
-}
-
-define i32 @test2(i8 %tmp) {
- %tmp3 = zext i8 %tmp to i32 ; <i32> [#uses=1]
- %tmp4 = add i32 %tmp3, 7 ; <i32> [#uses=1]
- %tmp5 = ashr i32 %tmp4, 3 ; <i32> [#uses=1]
- ret i32 %tmp5
-}
diff --git a/release_23/test/Transforms/InstCombine/shift-trunc-shift.ll b/release_23/test/Transforms/InstCombine/shift-trunc-shift.ll
deleted file mode 100644
index bf9f4070fb98..000000000000
--- a/release_23/test/Transforms/InstCombine/shift-trunc-shift.ll
+++ /dev/null
@@ -1,10 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep lshr.*63
-
-define i32 @t1(i64 %d18) {
-entry:
- %tmp916 = lshr i64 %d18, 32 ; <i64> [#uses=1]
- %tmp917 = trunc i64 %tmp916 to i32 ; <i32> [#uses=1]
- %tmp10 = lshr i32 %tmp917, 31 ; <i32> [#uses=1]
- ret i32 %tmp10
-}
-
diff --git a/release_23/test/Transforms/InstCombine/shift.ll b/release_23/test/Transforms/InstCombine/shift.ll
deleted file mode 100644
index e17fd35fe403..000000000000
--- a/release_23/test/Transforms/InstCombine/shift.ll
+++ /dev/null
@@ -1,209 +0,0 @@
-; This test makes sure that these instructions are properly eliminated.
-;
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep sh
-; END.
-
-define i32 @test1(i32 %A) {
- %B = shl i32 %A, 0 ; <i32> [#uses=1]
- ret i32 %B
-}
-
-define i32 @test2(i8 %A) {
- %shift.upgrd.1 = zext i8 %A to i32 ; <i32> [#uses=1]
- %B = shl i32 0, %shift.upgrd.1 ; <i32> [#uses=1]
- ret i32 %B
-}
-
-define i32 @test3(i32 %A) {
- %B = ashr i32 %A, 0 ; <i32> [#uses=1]
- ret i32 %B
-}
-
-define i32 @test4(i8 %A) {
- %shift.upgrd.2 = zext i8 %A to i32 ; <i32> [#uses=1]
- %B = ashr i32 0, %shift.upgrd.2 ; <i32> [#uses=1]
- ret i32 %B
-}
-
-
-define i32 @test5(i32 %A) {
- %B = lshr i32 %A, 32 ;; shift all bits out
- ret i32 %B
-}
-
-define i32 @test5a(i32 %A) {
- %B = shl i32 %A, 32 ;; shift all bits out
- ret i32 %B
-}
-
-define i32 @test6(i32 %A) {
- %B = shl i32 %A, 1 ;; convert to an mul instruction
- %C = mul i32 %B, 3
- ret i32 %C
-}
-
-define i32 @test7(i8 %A) {
- %shift.upgrd.3 = zext i8 %A to i32
- %B = ashr i32 -1, %shift.upgrd.3 ;; Always equal to -1
- ret i32 %B
-}
-
-;; (A << 5) << 3 === A << 8 == 0
-define i8 @test8(i8 %A) {
- %B = shl i8 %A, 5 ; <i8> [#uses=1]
- %C = shl i8 %B, 3 ; <i8> [#uses=1]
- ret i8 %C
-}
-
-;; (A << 7) >> 7 === A & 1
-define i8 @test9(i8 %A) {
- %B = shl i8 %A, 7 ; <i8> [#uses=1]
- %C = lshr i8 %B, 7 ; <i8> [#uses=1]
- ret i8 %C
-}
-
-;; (A >> 7) << 7 === A & 128
-define i8 @test10(i8 %A) {
- %B = lshr i8 %A, 7 ; <i8> [#uses=1]
- %C = shl i8 %B, 7 ; <i8> [#uses=1]
- ret i8 %C
-}
-
-;; (A >> 3) << 4 === (A & 0x1F) << 1
-define i8 @test11(i8 %A) {
- %a = mul i8 %A, 3 ; <i8> [#uses=1]
- %B = lshr i8 %a, 3 ; <i8> [#uses=1]
- %C = shl i8 %B, 4 ; <i8> [#uses=1]
- ret i8 %C
-}
-
-;; (A >> 8) << 8 === A & -256
-define i32 @test12(i32 %A) {
- %B = ashr i32 %A, 8 ; <i32> [#uses=1]
- %C = shl i32 %B, 8 ; <i32> [#uses=1]
- ret i32 %C
-}
-
-;; (A >> 3) << 4 === (A & -8) * 2
-define i8 @test13(i8 %A) {
- %a = mul i8 %A, 3 ; <i8> [#uses=1]
- %B = ashr i8 %a, 3 ; <i8> [#uses=1]
- %C = shl i8 %B, 4 ; <i8> [#uses=1]
- ret i8 %C
-}
-
-;; D = ((B | 1234) << 4) === ((B << 4)|(1234 << 4)
-define i32 @test14(i32 %A) {
- %B = lshr i32 %A, 4 ; <i32> [#uses=1]
- %C = or i32 %B, 1234 ; <i32> [#uses=1]
- %D = shl i32 %C, 4 ; <i32> [#uses=1]
- ret i32 %D
-}
-
-;; D = ((B | 1234) << 4) === ((B << 4)|(1234 << 4)
-define i32 @test14a(i32 %A) {
- %B = shl i32 %A, 4 ; <i32> [#uses=1]
- %C = and i32 %B, 1234 ; <i32> [#uses=1]
- %D = lshr i32 %C, 4 ; <i32> [#uses=1]
- ret i32 %D
-}
-
-define i32 @test15(i1 %C) {
- %A = select i1 %C, i32 3, i32 1 ; <i32> [#uses=1]
- %V = shl i32 %A, 2 ; <i32> [#uses=1]
- ret i32 %V
-}
-
-define i32 @test15a(i1 %C) {
- %A = select i1 %C, i8 3, i8 1 ; <i8> [#uses=1]
- %shift.upgrd.4 = zext i8 %A to i32 ; <i32> [#uses=1]
- %V = shl i32 64, %shift.upgrd.4 ; <i32> [#uses=1]
- ret i32 %V
-}
-
-define i1 @test16(i32 %X) {
- %tmp.3 = ashr i32 %X, 4 ; <i32> [#uses=1]
- %tmp.6 = and i32 %tmp.3, 1 ; <i32> [#uses=1]
- %tmp.7 = icmp ne i32 %tmp.6, 0 ; <i1> [#uses=1]
- ret i1 %tmp.7
-}
-
-define i1 @test17(i32 %A) {
- %B = lshr i32 %A, 3 ; <i32> [#uses=1]
- %C = icmp eq i32 %B, 1234 ; <i1> [#uses=1]
- ret i1 %C
-}
-
-
-define i1 @test18(i8 %A) {
- %B = lshr i8 %A, 7 ; <i8> [#uses=1]
- ;; false
- %C = icmp eq i8 %B, 123 ; <i1> [#uses=1]
- ret i1 %C
-}
-
-define i1 @test19(i32 %A) {
- %B = ashr i32 %A, 2 ; <i32> [#uses=1]
- ;; (X & -4) == 0
- %C = icmp eq i32 %B, 0 ; <i1> [#uses=1]
- ret i1 %C
-}
-
-
-define i1 @test19a(i32 %A) {
- %B = ashr i32 %A, 2 ; <i32> [#uses=1]
- ;; (X & -4) == -4
- %C = icmp eq i32 %B, -1 ; <i1> [#uses=1]
- ret i1 %C
-}
-
-define i1 @test20(i8 %A) {
- %B = ashr i8 %A, 7 ; <i8> [#uses=1]
- ;; false
- %C = icmp eq i8 %B, 123 ; <i1> [#uses=1]
- ret i1 %C
-}
-
-define i1 @test21(i8 %A) {
- %B = shl i8 %A, 4 ; <i8> [#uses=1]
- %C = icmp eq i8 %B, -128 ; <i1> [#uses=1]
- ret i1 %C
-}
-
-define i1 @test22(i8 %A) {
- %B = shl i8 %A, 4 ; <i8> [#uses=1]
- %C = icmp eq i8 %B, 0 ; <i1> [#uses=1]
- ret i1 %C
-}
-
-define i8 @test23(i32 %A) {
- ;; casts not needed
- %B = shl i32 %A, 24 ; <i32> [#uses=1]
- %C = ashr i32 %B, 24 ; <i32> [#uses=1]
- %D = trunc i32 %C to i8 ; <i8> [#uses=1]
- ret i8 %D
-}
-
-define i8 @test24(i8 %X) {
- %Y = and i8 %X, -5 ; <i8> [#uses=1]
- %Z = shl i8 %Y, 5 ; <i8> [#uses=1]
- %Q = ashr i8 %Z, 5 ; <i8> [#uses=1]
- ret i8 %Q
-}
-
-define i32 @test25(i32 %tmp.2, i32 %AA) {
- %x = lshr i32 %AA, 17 ; <i32> [#uses=1]
- %tmp.3 = lshr i32 %tmp.2, 17 ; <i32> [#uses=1]
- %tmp.5 = add i32 %tmp.3, %x ; <i32> [#uses=1]
- %tmp.6 = shl i32 %tmp.5, 17 ; <i32> [#uses=1]
- ret i32 %tmp.6
-}
-
-;; handle casts between shifts.
-define i32 @test26(i32 %A) {
- %B = lshr i32 %A, 1 ; <i32> [#uses=1]
- %C = bitcast i32 %B to i32 ; <i32> [#uses=1]
- %D = shl i32 %C, 1 ; <i32> [#uses=1]
- ret i32 %D
-}
-
diff --git a/release_23/test/Transforms/InstCombine/shl-icmp.ll b/release_23/test/Transforms/InstCombine/shl-icmp.ll
deleted file mode 100644
index 234c40bf6881..000000000000
--- a/release_23/test/Transforms/InstCombine/shl-icmp.ll
+++ /dev/null
@@ -1,29 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine -stats -disable-output |& \
-; RUN: grep {Number of insts combined} | grep 5
-
-define i8 @t1(i8 zeroext %x, i8 zeroext %y) zeroext nounwind {
-entry:
- %tmp1 = lshr i8 %x, 7
- %cond1 = icmp ne i8 %tmp1, 0
- br i1 %cond1, label %bb1, label %bb2
-
-bb1:
- ret i8 %tmp1
-
-bb2:
- %tmp2 = add i8 %tmp1, %y
- ret i8 %tmp2
-}
-
-define i8 @t2(i8 zeroext %x) zeroext nounwind {
-entry:
- %tmp1 = lshr i8 %x, 7
- %cond1 = icmp ne i8 %tmp1, 0
- br i1 %cond1, label %bb1, label %bb2
-
-bb1:
- ret i8 0
-
-bb2:
- ret i8 1
-}
diff --git a/release_23/test/Transforms/InstCombine/shl-trunc.ll b/release_23/test/Transforms/InstCombine/shl-trunc.ll
deleted file mode 100644
index ffef2984f5c9..000000000000
--- a/release_23/test/Transforms/InstCombine/shl-trunc.ll
+++ /dev/null
@@ -1,9 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep shl
-
-define i1 @test(i32 %X, i8 %A) {
- %shift.upgrd.1 = zext i8 %A to i32 ; <i32> [#uses=1]
- %B = lshr i32 %X, %shift.upgrd.1 ; <i32> [#uses=1]
- %D = trunc i32 %B to i1 ; <i1> [#uses=1]
- ret i1 %D
-}
-
diff --git a/release_23/test/Transforms/InstCombine/signext.ll b/release_23/test/Transforms/InstCombine/signext.ll
deleted file mode 100644
index 716662682da3..000000000000
--- a/release_23/test/Transforms/InstCombine/signext.ll
+++ /dev/null
@@ -1,45 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \
-; RUN: not grep {(and\|xor\|add\|shl\|shr)}
-; END.
-
-define i32 @test1(i32 %x) {
- %tmp.1 = and i32 %x, 65535 ; <i32> [#uses=1]
- %tmp.2 = xor i32 %tmp.1, -32768 ; <i32> [#uses=1]
- %tmp.3 = add i32 %tmp.2, 32768 ; <i32> [#uses=1]
- ret i32 %tmp.3
-}
-
-define i32 @test2(i32 %x) {
- %tmp.1 = and i32 %x, 65535 ; <i32> [#uses=1]
- %tmp.2 = xor i32 %tmp.1, 32768 ; <i32> [#uses=1]
- %tmp.3 = add i32 %tmp.2, -32768 ; <i32> [#uses=1]
- ret i32 %tmp.3
-}
-
-define i32 @test3(i16 %P) {
- %tmp.1 = zext i16 %P to i32 ; <i32> [#uses=1]
- %tmp.4 = xor i32 %tmp.1, 32768 ; <i32> [#uses=1]
- %tmp.5 = add i32 %tmp.4, -32768 ; <i32> [#uses=1]
- ret i32 %tmp.5
-}
-
-define i32 @test4(i16 %P) {
- %tmp.1 = zext i16 %P to i32 ; <i32> [#uses=1]
- %tmp.4 = xor i32 %tmp.1, 32768 ; <i32> [#uses=1]
- %tmp.5 = add i32 %tmp.4, -32768 ; <i32> [#uses=1]
- ret i32 %tmp.5
-}
-
-define i32 @test5(i32 %x) {
- %tmp.1 = and i32 %x, 254 ; <i32> [#uses=1]
- %tmp.2 = xor i32 %tmp.1, 128 ; <i32> [#uses=1]
- %tmp.3 = add i32 %tmp.2, -128 ; <i32> [#uses=1]
- ret i32 %tmp.3
-}
-
-define i32 @test6(i32 %x) {
- %tmp.2 = shl i32 %x, 16 ; <i32> [#uses=1]
- %tmp.4 = ashr i32 %tmp.2, 16 ; <i32> [#uses=1]
- ret i32 %tmp.4
-}
-
diff --git a/release_23/test/Transforms/InstCombine/sink_instruction.ll b/release_23/test/Transforms/InstCombine/sink_instruction.ll
deleted file mode 100644
index cb8a090e5a07..000000000000
--- a/release_23/test/Transforms/InstCombine/sink_instruction.ll
+++ /dev/null
@@ -1,19 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \
-; RUN: %prcontext div 1 | grep ret
-
-;; This tests that the instructions in the entry blocks are sunk into each
-;; arm of the 'if'.
-
-define i32 @foo(i1 %C, i32 %A, i32 %B) {
-entry:
- %tmp.2 = sdiv i32 %A, %B ; <i32> [#uses=1]
- %tmp.9 = add i32 %B, %A ; <i32> [#uses=1]
- br i1 %C, label %then, label %endif
-
-then: ; preds = %entry
- ret i32 %tmp.9
-
-endif: ; preds = %entry
- ret i32 %tmp.2
-}
-
diff --git a/release_23/test/Transforms/InstCombine/srem-simplify-bug.ll b/release_23/test/Transforms/InstCombine/srem-simplify-bug.ll
deleted file mode 100644
index cdf520256837..000000000000
--- a/release_23/test/Transforms/InstCombine/srem-simplify-bug.ll
+++ /dev/null
@@ -1,9 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {ret i1 false}
-; PR2276
-
-define i1 @f(i32 %x) {
- %A = or i32 %x, 1
- %B = srem i32 %A, 1
- %C = icmp ne i32 %B, 0
- ret i1 %C
-}
diff --git a/release_23/test/Transforms/InstCombine/srem.ll b/release_23/test/Transforms/InstCombine/srem.ll
deleted file mode 100644
index 864775ae08a1..000000000000
--- a/release_23/test/Transforms/InstCombine/srem.ll
+++ /dev/null
@@ -1,8 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep srem
-
-define i64 @foo(i64 %x1, i64 %y2) {
- %r = sdiv i64 %x1, %y2
- %r7 = mul i64 %r, %y2
- %r8 = sub i64 %x1, %r7
- ret i64 %r8
-}
diff --git a/release_23/test/Transforms/InstCombine/stacksaverestore.ll b/release_23/test/Transforms/InstCombine/stacksaverestore.ll
deleted file mode 100644
index c82a425b2fd0..000000000000
--- a/release_23/test/Transforms/InstCombine/stacksaverestore.ll
+++ /dev/null
@@ -1,56 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {call.*stackrestore} | count 1
-
-declare i8* @llvm.stacksave()
-declare void @llvm.stackrestore(i8*)
-
-;; Test that llvm.stackrestore is removed when possible.
-define i32* @test1(i32 %P) {
- %tmp = call i8* @llvm.stacksave( )
- call void @llvm.stackrestore( i8* %tmp ) ;; not restoring anything
- %A = alloca i32, i32 %P
- ret i32* %A
-}
-
-define void @test2(i8* %X) {
- call void @llvm.stackrestore( i8* %X ) ;; no allocas before return.
- ret void
-}
-
-define void @foo(i32 %size) nounwind {
-entry:
- %tmp118124 = icmp sgt i32 %size, 0 ; <i1> [#uses=1]
- br i1 %tmp118124, label %bb.preheader, label %return
-
-bb.preheader: ; preds = %entry
- %tmp25 = add i32 %size, -1 ; <i32> [#uses=1]
- %tmp125 = icmp slt i32 %size, 1 ; <i1> [#uses=1]
- %smax = select i1 %tmp125, i32 1, i32 %size ; <i32> [#uses=1]
- br label %bb
-
-bb: ; preds = %bb, %bb.preheader
- %i.0.reg2mem.0 = phi i32 [ 0, %bb.preheader ], [ %indvar.next, %bb ] ; <i32> [#uses=2]
- %tmp = call i8* @llvm.stacksave( ) ; <i8*> [#uses=1]
- %tmp23 = alloca i8, i32 %size ; <i8*> [#uses=2]
- %tmp27 = getelementptr i8* %tmp23, i32 %tmp25 ; <i8*> [#uses=1]
- store i8 0, i8* %tmp27, align 1
- %tmp28 = call i8* @llvm.stacksave( ) ; <i8*> [#uses=1]
- %tmp52 = alloca i8, i32 %size ; <i8*> [#uses=1]
- %tmp53 = call i8* @llvm.stacksave( ) ; <i8*> [#uses=1]
- %tmp77 = alloca i8, i32 %size ; <i8*> [#uses=1]
- %tmp78 = call i8* @llvm.stacksave( ) ; <i8*> [#uses=1]
- %tmp102 = alloca i8, i32 %size ; <i8*> [#uses=1]
- call void @bar( i32 %i.0.reg2mem.0, i8* %tmp23, i8* %tmp52, i8* %tmp77, i8* %tmp102, i32 %size ) nounwind
- call void @llvm.stackrestore( i8* %tmp78 )
- call void @llvm.stackrestore( i8* %tmp53 )
- call void @llvm.stackrestore( i8* %tmp28 )
- call void @llvm.stackrestore( i8* %tmp )
- %indvar.next = add i32 %i.0.reg2mem.0, 1 ; <i32> [#uses=2]
- %exitcond = icmp eq i32 %indvar.next, %smax ; <i1> [#uses=1]
- br i1 %exitcond, label %return, label %bb
-
-return: ; preds = %bb, %entry
- ret void
-}
-
-declare void @bar(i32, i8*, i8*, i8*, i8*, i32)
-
diff --git a/release_23/test/Transforms/InstCombine/store-merge.ll b/release_23/test/Transforms/InstCombine/store-merge.ll
deleted file mode 100644
index 7b117ca7f5f9..000000000000
--- a/release_23/test/Transforms/InstCombine/store-merge.ll
+++ /dev/null
@@ -1,37 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \
-; RUN: grep {ret i32 %.toremerge} | count 2
-;; Simple sinking tests
-
-; "if then else"
-define i32 @test1(i1 %C) {
- %A = alloca i32
- br i1 %C, label %Cond, label %Cond2
-
-Cond:
- store i32 -987654321, i32* %A
- br label %Cont
-
-Cond2:
- store i32 47, i32* %A
- br label %Cont
-
-Cont:
- %V = load i32* %A
- ret i32 %V
-}
-
-; "if then"
-define i32 @test2(i1 %C) {
- %A = alloca i32
- store i32 47, i32* %A
- br i1 %C, label %Cond, label %Cont
-
-Cond:
- store i32 -987654321, i32* %A
- br label %Cont
-
-Cont:
- %V = load i32* %A
- ret i32 %V
-}
-
diff --git a/release_23/test/Transforms/InstCombine/store.ll b/release_23/test/Transforms/InstCombine/store.ll
deleted file mode 100644
index 337b2cce08aa..000000000000
--- a/release_23/test/Transforms/InstCombine/store.ll
+++ /dev/null
@@ -1,17 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \
-; RUN: grep -v {store.*,.*null} | not grep store
-
-define void @test1(i32* %P) {
- store i32 undef, i32* %P
- store i32 123, i32* undef
- store i32 124, i32* null
- ret void
-}
-
-define void @test2(i32* %P) {
- %X = load i32* %P ; <i32> [#uses=1]
- %Y = add i32 %X, 0 ; <i32> [#uses=1]
- store i32 %Y, i32* %P
- ret void
-}
-
diff --git a/release_23/test/Transforms/InstCombine/sub.ll b/release_23/test/Transforms/InstCombine/sub.ll
deleted file mode 100644
index da6d710f6bc2..000000000000
--- a/release_23/test/Transforms/InstCombine/sub.ll
+++ /dev/null
@@ -1,146 +0,0 @@
-; This test makes sure that these instructions are properly eliminated.
-;
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \
-; RUN: grep -v {sub i32 %Cok, %Bok} | not grep sub
-
-define i32 @test1(i32 %A) {
- %B = sub i32 %A, %A ; <i32> [#uses=1]
- ret i32 %B
-}
-
-define i32 @test2(i32 %A) {
- %B = sub i32 %A, 0 ; <i32> [#uses=1]
- ret i32 %B
-}
-
-define i32 @test3(i32 %A) {
- %B = sub i32 0, %A ; <i32> [#uses=1]
- %C = sub i32 0, %B ; <i32> [#uses=1]
- ret i32 %C
-}
-
-define i32 @test4(i32 %A, i32 %x) {
- %B = sub i32 0, %A ; <i32> [#uses=1]
- %C = sub i32 %x, %B ; <i32> [#uses=1]
- ret i32 %C
-}
-
-define i32 @test5(i32 %A, i32 %Bok, i32 %Cok) {
- %D = sub i32 %Bok, %Cok ; <i32> [#uses=1]
- %E = sub i32 %A, %D ; <i32> [#uses=1]
- ret i32 %E
-}
-
-define i32 @test6(i32 %A, i32 %B) {
- %C = and i32 %A, %B ; <i32> [#uses=1]
- %D = sub i32 %A, %C ; <i32> [#uses=1]
- ret i32 %D
-}
-
-define i32 @test7(i32 %A) {
- %B = sub i32 -1, %A ; <i32> [#uses=1]
- ret i32 %B
-}
-
-define i32 @test8(i32 %A) {
- %B = mul i32 9, %A ; <i32> [#uses=1]
- %C = sub i32 %B, %A ; <i32> [#uses=1]
- ret i32 %C
-}
-
-define i32 @test9(i32 %A) {
- %B = mul i32 3, %A ; <i32> [#uses=1]
- %C = sub i32 %A, %B ; <i32> [#uses=1]
- ret i32 %C
-}
-
-define i32 @test10(i32 %A, i32 %B) {
- %C = sub i32 0, %A ; <i32> [#uses=1]
- %D = sub i32 0, %B ; <i32> [#uses=1]
- %E = mul i32 %C, %D ; <i32> [#uses=1]
- ret i32 %E
-}
-
-define i32 @test10.upgrd.1(i32 %A) {
- %C = sub i32 0, %A ; <i32> [#uses=1]
- %E = mul i32 %C, 7 ; <i32> [#uses=1]
- ret i32 %E
-}
-
-define i1 @test11(i8 %A, i8 %B) {
- %C = sub i8 %A, %B ; <i8> [#uses=1]
- %cD = icmp ne i8 %C, 0 ; <i1> [#uses=1]
- ret i1 %cD
-}
-
-define i32 @test12(i32 %A) {
- %B = ashr i32 %A, 31 ; <i32> [#uses=1]
- %C = sub i32 0, %B ; <i32> [#uses=1]
- ret i32 %C
-}
-
-define i32 @test13(i32 %A) {
- %B = lshr i32 %A, 31 ; <i32> [#uses=1]
- %C = sub i32 0, %B ; <i32> [#uses=1]
- ret i32 %C
-}
-
-define i32 @test14(i32 %A) {
- %B = lshr i32 %A, 31 ; <i32> [#uses=1]
- %C = bitcast i32 %B to i32 ; <i32> [#uses=1]
- %D = sub i32 0, %C ; <i32> [#uses=1]
- ret i32 %D
-}
-
-define i32 @test15(i32 %A, i32 %B) {
- %C = sub i32 0, %A ; <i32> [#uses=1]
- %D = srem i32 %B, %C ; <i32> [#uses=1]
- ret i32 %D
-}
-
-define i32 @test16(i32 %A) {
- %X = sdiv i32 %A, 1123 ; <i32> [#uses=1]
- %Y = sub i32 0, %X ; <i32> [#uses=1]
- ret i32 %Y
-}
-
-define i32 @test17(i32 %A) {
- %B = sub i32 0, %A ; <i32> [#uses=1]
- %C = sdiv i32 %B, 1234 ; <i32> [#uses=1]
- ret i32 %C
-}
-
-define i64 @test18(i64 %Y) {
- %tmp.4 = shl i64 %Y, 2 ; <i64> [#uses=1]
- %tmp.12 = shl i64 %Y, 2 ; <i64> [#uses=1]
- %tmp.8 = sub i64 %tmp.4, %tmp.12 ; <i64> [#uses=1]
- ret i64 %tmp.8
-}
-
-define i32 @test19(i32 %X, i32 %Y) {
- %Z = sub i32 %X, %Y ; <i32> [#uses=1]
- %Q = add i32 %Z, %Y ; <i32> [#uses=1]
- ret i32 %Q
-}
-
-define i1 @test20(i32 %g, i32 %h) {
- %tmp.2 = sub i32 %g, %h ; <i32> [#uses=1]
- %tmp.4 = icmp ne i32 %tmp.2, %g ; <i1> [#uses=1]
- ret i1 %tmp.4
-}
-
-define i1 @test21(i32 %g, i32 %h) {
- %tmp.2 = sub i32 %g, %h ; <i32> [#uses=1]
- %tmp.4 = icmp ne i32 %tmp.2, %g ; <i1> [#uses=1]
- ret i1 %tmp.4
-}
-
-; PR2298
-define i8 @test22(i32 %a, i32 %b) zeroext nounwind {
- %tmp2 = sub i32 0, %a ; <i32> [#uses=1]
- %tmp4 = sub i32 0, %b ; <i32> [#uses=1]
- %tmp5 = icmp eq i32 %tmp2, %tmp4 ; <i1> [#uses=1]
- %retval89 = zext i1 %tmp5 to i8 ; <i8> [#uses=1]
- ret i8 %retval89
-}
-
diff --git a/release_23/test/Transforms/InstCombine/udiv-simplify-bug-0.ll b/release_23/test/Transforms/InstCombine/udiv-simplify-bug-0.ll
deleted file mode 100644
index 5bcaa66366c7..000000000000
--- a/release_23/test/Transforms/InstCombine/udiv-simplify-bug-0.ll
+++ /dev/null
@@ -1,14 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {ret i64 0} | count 2
-
-define i64 @foo(i32 %x) nounwind {
- %y = lshr i32 %x, 1
- %r = udiv i32 %y, -1
- %z = sext i32 %r to i64
- ret i64 %z
-}
-define i64 @bar(i32 %x) nounwind {
- %y = lshr i32 %x, 31
- %r = udiv i32 %y, 3
- %z = sext i32 %r to i64
- ret i64 %z
-}
diff --git a/release_23/test/Transforms/InstCombine/udiv-simplify-bug-1.ll b/release_23/test/Transforms/InstCombine/udiv-simplify-bug-1.ll
deleted file mode 100644
index 6e76bcfd7533..000000000000
--- a/release_23/test/Transforms/InstCombine/udiv-simplify-bug-1.ll
+++ /dev/null
@@ -1,25 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis > %t1.ll
-; RUN: grep udiv %t1.ll | count 3
-; RUN: grep zext %t1.ll | count 3
-; PR2274
-
-; The udiv instructions shouldn't be optimized away, and the
-; sext instructions should be optimized to zext.
-
-define i64 @foo(i32 %x) nounwind {
- %r = udiv i32 %x, -1
- %z = sext i32 %r to i64
- ret i64 %z
-}
-define i64 @bar(i32 %x) nounwind {
- %y = lshr i32 %x, 30
- %r = udiv i32 %y, 3
- %z = sext i32 %r to i64
- ret i64 %z
-}
-define i64 @qux(i32 %x, i32 %v) nounwind {
- %y = lshr i32 %x, 31
- %r = udiv i32 %y, %v
- %z = sext i32 %r to i64
- ret i64 %z
-}
diff --git a/release_23/test/Transforms/InstCombine/udiv_select_to_select_shift.ll b/release_23/test/Transforms/InstCombine/udiv_select_to_select_shift.ll
deleted file mode 100644
index 277592c983da..000000000000
--- a/release_23/test/Transforms/InstCombine/udiv_select_to_select_shift.ll
+++ /dev/null
@@ -1,17 +0,0 @@
-; Test that this transform works:
-; udiv X, (Select Cond, C1, C2) --> Select Cond, (shr X, C1), (shr X, C2)
-;
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis -f -o %t
-; RUN: grep select %t | count 1
-; RUN: grep lshr %t | count 2
-; RUN: ignore grep udiv %t | count 0
-
-define i64 @test(i64 %X, i1 %Cond ) {
-entry:
- %divisor1 = select i1 %Cond, i64 8, i64 16
- %quotient1 = udiv i64 %X, %divisor1
- %divisor2 = select i1 %Cond, i64 8, i64 0
- %quotient2 = udiv i64 %X, %divisor2
- %sum = add i64 %quotient1, %quotient2
- ret i64 %sum
-}
diff --git a/release_23/test/Transforms/InstCombine/urem-simplify-bug.ll b/release_23/test/Transforms/InstCombine/urem-simplify-bug.ll
deleted file mode 100644
index 15956f26b69a..000000000000
--- a/release_23/test/Transforms/InstCombine/urem-simplify-bug.ll
+++ /dev/null
@@ -1,32 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {= or i32 %x, -5 }
-
-@.str = internal constant [5 x i8] c"foo\0A\00" ; <[5 x i8]*> [#uses=1]
-@.str1 = internal constant [5 x i8] c"bar\0A\00" ; <[5 x i8]*> [#uses=1]
-
-define i32 @main() nounwind {
-entry:
- %x = call i32 @func_11( ) nounwind ; <i32> [#uses=1]
- %tmp3 = or i32 %x, -5 ; <i32> [#uses=1]
- %tmp5 = urem i32 251, %tmp3 ; <i32> [#uses=1]
- %tmp6 = icmp ne i32 %tmp5, 0 ; <i1> [#uses=1]
- %tmp67 = zext i1 %tmp6 to i32 ; <i32> [#uses=1]
- %tmp9 = urem i32 %tmp67, 95 ; <i32> [#uses=1]
- %tmp10 = and i32 %tmp9, 1 ; <i32> [#uses=1]
- %tmp12 = icmp eq i32 %tmp10, 0 ; <i1> [#uses=1]
- br i1 %tmp12, label %bb14, label %bb
-
-bb: ; preds = %entry
- br label %bb15
-
-bb14: ; preds = %entry
- br label %bb15
-
-bb15: ; preds = %bb14, %bb
- %iftmp.0.0 = phi i8* [ getelementptr ([5 x i8]* @.str1, i32 0, i32 0), %bb14 ], [ getelementptr ([5 x i8]* @.str, i32 0, i32 0), %bb ] ; <i8*> [#uses=1]
- %tmp17 = call i32 (i8*, ...)* @printf( i8* %iftmp.0.0 ) nounwind ; <i32> [#uses=0]
- ret i32 0
-}
-
-declare i32 @func_11()
-
-declare i32 @printf(i8*, ...) nounwind
diff --git a/release_23/test/Transforms/InstCombine/urem.ll b/release_23/test/Transforms/InstCombine/urem.ll
deleted file mode 100644
index 24e7463cbaf8..000000000000
--- a/release_23/test/Transforms/InstCombine/urem.ll
+++ /dev/null
@@ -1,8 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep urem
-
-define i64 @rem_unsigned(i64 %x1, i64 %y2) {
- %r = udiv i64 %x1, %y2
- %r7 = mul i64 %r, %y2
- %r8 = sub i64 %x1, %r7
- ret i64 %r8
-}
diff --git a/release_23/test/Transforms/InstCombine/vec_demanded_elts.ll b/release_23/test/Transforms/InstCombine/vec_demanded_elts.ll
deleted file mode 100644
index 03e070f89412..000000000000
--- a/release_23/test/Transforms/InstCombine/vec_demanded_elts.ll
+++ /dev/null
@@ -1,47 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \
-; RUN: grep {sub float}
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \
-; RUN: grep {mul float}
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \
-; RUN: not grep {insertelement.*0.00}
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \
-; RUN: not grep {call.*llvm.x86.sse.mul}
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \
-; RUN: not grep {call.*llvm.x86.sse.sub}
-; END.
-
-define i16 @test1(float %f) {
-entry:
- %tmp = insertelement <4 x float> undef, float %f, i32 0 ; <<4 x float>> [#uses=1]
- %tmp10 = insertelement <4 x float> %tmp, float 0.000000e+00, i32 1 ; <<4 x float>> [#uses=1]
- %tmp11 = insertelement <4 x float> %tmp10, float 0.000000e+00, i32 2 ; <<4 x float>> [#uses=1]
- %tmp12 = insertelement <4 x float> %tmp11, float 0.000000e+00, i32 3 ; <<4 x float>> [#uses=1]
- %tmp28 = tail call <4 x float> @llvm.x86.sse.sub.ss( <4 x float> %tmp12, <4 x float> < float 1.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00 > ) ; <<4 x float>> [#uses=1]
- %tmp37 = tail call <4 x float> @llvm.x86.sse.mul.ss( <4 x float> %tmp28, <4 x float> < float 5.000000e-01, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00 > ) ; <<4 x float>> [#uses=1]
- %tmp48 = tail call <4 x float> @llvm.x86.sse.min.ss( <4 x float> %tmp37, <4 x float> < float 6.553500e+04, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00 > ) ; <<4 x float>> [#uses=1]
- %tmp59 = tail call <4 x float> @llvm.x86.sse.max.ss( <4 x float> %tmp48, <4 x float> zeroinitializer ) ; <<4 x float>> [#uses=1]
- %tmp.upgrd.1 = tail call i32 @llvm.x86.sse.cvttss2si( <4 x float> %tmp59 ) ; <i32> [#uses=1]
- %tmp69 = trunc i32 %tmp.upgrd.1 to i16 ; <i16> [#uses=1]
- ret i16 %tmp69
-}
-
-define i32 @test2(float %f) {
- %tmp5 = mul float %f, %f
- %tmp9 = insertelement <4 x float> undef, float %tmp5, i32 0
- %tmp10 = insertelement <4 x float> %tmp9, float 0.000000e+00, i32 1
- %tmp11 = insertelement <4 x float> %tmp10, float 0.000000e+00, i32 2
- %tmp12 = insertelement <4 x float> %tmp11, float 0.000000e+00, i32 3
- %tmp19 = bitcast <4 x float> %tmp12 to <4 x i32>
- %tmp21 = extractelement <4 x i32> %tmp19, i32 0
- ret i32 %tmp21
-}
-
-declare <4 x float> @llvm.x86.sse.sub.ss(<4 x float>, <4 x float>)
-
-declare <4 x float> @llvm.x86.sse.mul.ss(<4 x float>, <4 x float>)
-
-declare <4 x float> @llvm.x86.sse.min.ss(<4 x float>, <4 x float>)
-
-declare <4 x float> @llvm.x86.sse.max.ss(<4 x float>, <4 x float>)
-
-declare i32 @llvm.x86.sse.cvttss2si(<4 x float>)
diff --git a/release_23/test/Transforms/InstCombine/vec_extract_elt.ll b/release_23/test/Transforms/InstCombine/vec_extract_elt.ll
deleted file mode 100644
index 30b2f1d042b4..000000000000
--- a/release_23/test/Transforms/InstCombine/vec_extract_elt.ll
+++ /dev/null
@@ -1,9 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep extractelement
-
-define i32 @test(float %f) {
- %tmp7 = insertelement <4 x float> undef, float %f, i32 0 ; <<4 x float>> [#uses=1]
- %tmp17 = bitcast <4 x float> %tmp7 to <4 x i32> ; <<4 x i32>> [#uses=1]
- %tmp19 = extractelement <4 x i32> %tmp17, i32 0 ; <i32> [#uses=1]
- ret i32 %tmp19
-}
-
diff --git a/release_23/test/Transforms/InstCombine/vec_insert_to_shuffle.ll b/release_23/test/Transforms/InstCombine/vec_insert_to_shuffle.ll
deleted file mode 100644
index df9cecd09c66..000000000000
--- a/release_23/test/Transforms/InstCombine/vec_insert_to_shuffle.ll
+++ /dev/null
@@ -1,19 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \
-; RUN: grep shufflevec | count 1
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \
-; RUN: not grep insertelement
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \
-; RUN: not grep extractelement
-; END.
-
-define <4 x float> @test(<4 x float> %tmp, <4 x float> %tmp1) {
- %tmp4 = extractelement <4 x float> %tmp, i32 1 ; <float> [#uses=1]
- %tmp2 = extractelement <4 x float> %tmp, i32 3 ; <float> [#uses=1]
- %tmp1.upgrd.1 = extractelement <4 x float> %tmp1, i32 0 ; <float> [#uses=1]
- %tmp128 = insertelement <4 x float> undef, float %tmp4, i32 0 ; <<4 x float>> [#uses=1]
- %tmp130 = insertelement <4 x float> %tmp128, float undef, i32 1 ; <<4 x float>> [#uses=1]
- %tmp132 = insertelement <4 x float> %tmp130, float %tmp2, i32 2 ; <<4 x float>> [#uses=1]
- %tmp134 = insertelement <4 x float> %tmp132, float %tmp1.upgrd.1, i32 3 ; <<4 x float>> [#uses=1]
- ret <4 x float> %tmp134
-}
-
diff --git a/release_23/test/Transforms/InstCombine/vec_insertelt.ll b/release_23/test/Transforms/InstCombine/vec_insertelt.ll
deleted file mode 100644
index 9be154b98715..000000000000
--- a/release_23/test/Transforms/InstCombine/vec_insertelt.ll
+++ /dev/null
@@ -1,7 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {ret <4 x i32> %A}
-
-; PR1286
-define <4 x i32> @test1(<4 x i32> %A) {
- %B = insertelement <4 x i32> %A, i32 undef, i32 1
- ret <4 x i32> %B
-}
diff --git a/release_23/test/Transforms/InstCombine/vec_narrow.ll b/release_23/test/Transforms/InstCombine/vec_narrow.ll
deleted file mode 100644
index 9063148424c5..000000000000
--- a/release_23/test/Transforms/InstCombine/vec_narrow.ll
+++ /dev/null
@@ -1,12 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \
-; RUN: grep {add float}
-
- %V = type <4 x float>
-
-define float @test(%V %A, %V %B, float %f) {
- %C = insertelement %V %A, float %f, i32 0 ; <%V> [#uses=1]
- %D = add %V %C, %B ; <%V> [#uses=1]
- %E = extractelement %V %D, i32 0 ; <float> [#uses=1]
- ret float %E
-}
-
diff --git a/release_23/test/Transforms/InstCombine/vec_shuffle.ll b/release_23/test/Transforms/InstCombine/vec_shuffle.ll
deleted file mode 100644
index aaaee3f84315..000000000000
--- a/release_23/test/Transforms/InstCombine/vec_shuffle.ll
+++ /dev/null
@@ -1,47 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep vector_shuffle
-; END.
-
-%T = type <4 x float>
-
-
-define %T @test1(%T %v1) {
- %v2 = shufflevector %T %v1, %T undef, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
- ret %T %v2
-}
-
-define %T @test2(%T %v1) {
- %v2 = shufflevector %T %v1, %T %v1, <4 x i32> <i32 0, i32 5, i32 2, i32 7>
- ret %T %v2
-}
-
-define float @test3(%T %A, %T %B, float %f) {
- %C = insertelement %T %A, float %f, i32 0
- %D = shufflevector %T %C, %T %B, <4 x i32> <i32 5, i32 0, i32 2, i32 7>
- %E = extractelement %T %D, i32 1
- ret float %E
-}
-
-define i32 @test4(<4 x i32> %X) {
- %tmp152.i53899.i = shufflevector <4 x i32> %X, <4 x i32> undef, <4 x i32> zeroinitializer
- %tmp34 = extractelement <4 x i32> %tmp152.i53899.i, i32 0
- ret i32 %tmp34
-}
-
-define i32 @test5(<4 x i32> %X) {
- %tmp152.i53899.i = shufflevector <4 x i32> %X, <4 x i32> undef, <4 x i32> <i32 3, i32 2, i32 undef, i32 undef>
- %tmp34 = extractelement <4 x i32> %tmp152.i53899.i, i32 0
- ret i32 %tmp34
-}
-
-define float @test6(<4 x float> %X) {
- %X1 = bitcast <4 x float> %X to <4 x i32>
- %tmp152.i53899.i = shufflevector <4 x i32> %X1, <4 x i32> undef, <4 x i32> zeroinitializer
- %tmp152.i53900.i = bitcast <4 x i32> %tmp152.i53899.i to <4 x float>
- %tmp34 = extractelement <4 x float> %tmp152.i53900.i, i32 0
- ret float %tmp34
-}
-
-define <4 x float> @test7(<4 x float> %tmp45.i) {
- %tmp1642.i = shufflevector <4 x float> %tmp45.i, <4 x float> undef, <4 x i32> < i32 0, i32 1, i32 6, i32 7 >
- ret <4 x float> %tmp1642.i
-}
diff --git a/release_23/test/Transforms/InstCombine/vector-srem.ll b/release_23/test/Transforms/InstCombine/vector-srem.ll
deleted file mode 100644
index e8766ebc1e07..000000000000
--- a/release_23/test/Transforms/InstCombine/vector-srem.ll
+++ /dev/null
@@ -1,9 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {srem <4 x i32>}
-
-define <4 x i32> @foo(<4 x i32> %t, <4 x i32> %u)
-{
- %k = sdiv <4 x i32> %t, %u
- %l = mul <4 x i32> %k, %u
- %m = sub <4 x i32> %t, %l
- ret <4 x i32> %m
-}
diff --git a/release_23/test/Transforms/InstCombine/volatile_store.ll b/release_23/test/Transforms/InstCombine/volatile_store.ll
deleted file mode 100644
index 09651ba302d5..000000000000
--- a/release_23/test/Transforms/InstCombine/volatile_store.ll
+++ /dev/null
@@ -1,14 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {volatile store}
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {volatile load}
-
-@x = weak global i32 0 ; <i32*> [#uses=2]
-
-define void @self_assign_1() {
-entry:
- %tmp = volatile load i32* @x ; <i32> [#uses=1]
- volatile store i32 %tmp, i32* @x
- br label %return
-
-return: ; preds = %entry
- ret void
-}
diff --git a/release_23/test/Transforms/InstCombine/xor-undef.ll b/release_23/test/Transforms/InstCombine/xor-undef.ll
deleted file mode 100644
index c090223b5371..000000000000
--- a/release_23/test/Transforms/InstCombine/xor-undef.ll
+++ /dev/null
@@ -1,6 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep zeroinitializer
-
-define <2 x i64> @f() {
- %tmp = xor <2 x i64> undef, undef
- ret <2 x i64> %tmp
-}
diff --git a/release_23/test/Transforms/InstCombine/xor.ll b/release_23/test/Transforms/InstCombine/xor.ll
deleted file mode 100644
index d8b84a6122dd..000000000000
--- a/release_23/test/Transforms/InstCombine/xor.ll
+++ /dev/null
@@ -1,193 +0,0 @@
-; This test makes sure that these instructions are properly eliminated.
-;
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \
-; RUN: not grep {xor }
-; END.
-@G1 = global i32 0 ; <i32*> [#uses=1]
-@G2 = global i32 0 ; <i32*> [#uses=1]
-
-define i1 @test0(i1 %A) {
- %B = xor i1 %A, false ; <i1> [#uses=1]
- ret i1 %B
-}
-
-define i32 @test1(i32 %A) {
- %B = xor i32 %A, 0 ; <i32> [#uses=1]
- ret i32 %B
-}
-
-define i1 @test2(i1 %A) {
- %B = xor i1 %A, %A ; <i1> [#uses=1]
- ret i1 %B
-}
-
-define i32 @test3(i32 %A) {
- %B = xor i32 %A, %A ; <i32> [#uses=1]
- ret i32 %B
-}
-
-define i32 @test4(i32 %A) {
- %NotA = xor i32 -1, %A ; <i32> [#uses=1]
- %B = xor i32 %A, %NotA ; <i32> [#uses=1]
- ret i32 %B
-}
-
-define i32 @test5(i32 %A) {
- %t1 = or i32 %A, 123 ; <i32> [#uses=1]
- %r = xor i32 %t1, 123 ; <i32> [#uses=1]
- ret i32 %r
-}
-
-define i8 @test6(i8 %A) {
- %B = xor i8 %A, 17 ; <i8> [#uses=1]
- %C = xor i8 %B, 17 ; <i8> [#uses=1]
- ret i8 %C
-}
-
-define i32 @test7(i32 %A, i32 %B) {
- %A1 = and i32 %A, 7 ; <i32> [#uses=1]
- %B1 = and i32 %B, 128 ; <i32> [#uses=1]
- %C1 = xor i32 %A1, %B1 ; <i32> [#uses=1]
- ret i32 %C1
-}
-
-define i8 @test8(i1 %c) {
- %d = xor i1 %c, true ; <i1> [#uses=1]
- br i1 %d, label %True, label %False
-
-True: ; preds = %0
- ret i8 1
-
-False: ; preds = %0
- ret i8 3
-}
-
-define i1 @test9(i8 %A) {
- %B = xor i8 %A, 123 ; <i8> [#uses=1]
- %C = icmp eq i8 %B, 34 ; <i1> [#uses=1]
- ret i1 %C
-}
-
-define i8 @test10(i8 %A) {
- %B = and i8 %A, 3 ; <i8> [#uses=1]
- %C = xor i8 %B, 4 ; <i8> [#uses=1]
- ret i8 %C
-}
-
-define i8 @test11(i8 %A) {
- %B = or i8 %A, 12 ; <i8> [#uses=1]
- %C = xor i8 %B, 4 ; <i8> [#uses=1]
- ret i8 %C
-}
-
-define i1 @test12(i8 %A) {
- %B = xor i8 %A, 4 ; <i8> [#uses=1]
- %c = icmp ne i8 %B, 0 ; <i1> [#uses=1]
- ret i1 %c
-}
-
-define i1 @test13(i8 %A, i8 %B) {
- %C = icmp ult i8 %A, %B ; <i1> [#uses=1]
- %D = icmp ugt i8 %A, %B ; <i1> [#uses=1]
- %E = xor i1 %C, %D ; <i1> [#uses=1]
- ret i1 %E
-}
-
-define i1 @test14(i8 %A, i8 %B) {
- %C = icmp eq i8 %A, %B ; <i1> [#uses=1]
- %D = icmp ne i8 %B, %A ; <i1> [#uses=1]
- %E = xor i1 %C, %D ; <i1> [#uses=1]
- ret i1 %E
-}
-
-define i32 @test15(i32 %A) {
- %B = add i32 %A, -1 ; <i32> [#uses=1]
- %C = xor i32 %B, -1 ; <i32> [#uses=1]
- ret i32 %C
-}
-
-define i32 @test16(i32 %A) {
- %B = add i32 %A, 123 ; <i32> [#uses=1]
- %C = xor i32 %B, -1 ; <i32> [#uses=1]
- ret i32 %C
-}
-
-define i32 @test17(i32 %A) {
- %B = sub i32 123, %A ; <i32> [#uses=1]
- %C = xor i32 %B, -1 ; <i32> [#uses=1]
- ret i32 %C
-}
-
-define i32 @test18(i32 %A) {
- %B = xor i32 %A, -1 ; <i32> [#uses=1]
- %C = sub i32 123, %B ; <i32> [#uses=1]
- ret i32 %C
-}
-
-define i32 @test19(i32 %A, i32 %B) {
- %C = xor i32 %A, %B ; <i32> [#uses=1]
- %D = xor i32 %C, %A ; <i32> [#uses=1]
- ret i32 %D
-}
-
-define void @test20(i32 %A, i32 %B) {
- %tmp.2 = xor i32 %B, %A ; <i32> [#uses=2]
- %tmp.5 = xor i32 %tmp.2, %B ; <i32> [#uses=2]
- %tmp.8 = xor i32 %tmp.5, %tmp.2 ; <i32> [#uses=1]
- store i32 %tmp.8, i32* @G1
- store i32 %tmp.5, i32* @G2
- ret void
-}
-
-define i32 @test21(i1 %C, i32 %A, i32 %B) {
- %C2 = xor i1 %C, true ; <i1> [#uses=1]
- %D = select i1 %C2, i32 %A, i32 %B ; <i32> [#uses=1]
- ret i32 %D
-}
-
-define i32 @test22(i1 %X) {
- %Y = xor i1 %X, true ; <i1> [#uses=1]
- %Z = zext i1 %Y to i32 ; <i32> [#uses=1]
- %Q = xor i32 %Z, 1 ; <i32> [#uses=1]
- ret i32 %Q
-}
-
-define i1 @test23(i32 %a, i32 %b) {
- %tmp.2 = xor i32 %b, %a ; <i32> [#uses=1]
- %tmp.4 = icmp eq i32 %tmp.2, %a ; <i1> [#uses=1]
- ret i1 %tmp.4
-}
-
-define i1 @test24(i32 %c, i32 %d) {
- %tmp.2 = xor i32 %d, %c ; <i32> [#uses=1]
- %tmp.4 = icmp ne i32 %tmp.2, %c ; <i1> [#uses=1]
- ret i1 %tmp.4
-}
-
-define i32 @test25(i32 %g, i32 %h) {
- %h2 = xor i32 %h, -1 ; <i32> [#uses=1]
- %tmp2 = and i32 %h2, %g ; <i32> [#uses=1]
- %tmp4 = xor i32 %tmp2, %g ; <i32> [#uses=1]
- ret i32 %tmp4
-}
-
-define i32 @test26(i32 %a, i32 %b) {
- %b2 = xor i32 %b, -1 ; <i32> [#uses=1]
- %tmp2 = xor i32 %a, %b2 ; <i32> [#uses=1]
- %tmp4 = and i32 %tmp2, %a ; <i32> [#uses=1]
- ret i32 %tmp4
-}
-
-define i32 @test27(i32 %b, i32 %c, i32 %d) {
- %tmp2 = xor i32 %d, %b ; <i32> [#uses=1]
- %tmp5 = xor i32 %d, %c ; <i32> [#uses=1]
- %tmp = icmp eq i32 %tmp2, %tmp5 ; <i1> [#uses=1]
- %tmp6 = zext i1 %tmp to i32 ; <i32> [#uses=1]
- ret i32 %tmp6
-}
-
-define i32 @test28(i32 %indvar) {
- %tmp7 = add i32 %indvar, -2147483647 ; <i32> [#uses=1]
- %tmp214 = xor i32 %tmp7, -2147483648 ; <i32> [#uses=1]
- ret i32 %tmp214
-}
diff --git a/release_23/test/Transforms/InstCombine/xor2.ll b/release_23/test/Transforms/InstCombine/xor2.ll
deleted file mode 100644
index efb3146c68bf..000000000000
--- a/release_23/test/Transforms/InstCombine/xor2.ll
+++ /dev/null
@@ -1,17 +0,0 @@
-; This test makes sure that these instructions are properly eliminated.
-;
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep {xor }
-
-; PR1253
-define i1 @test0(i32 %A) {
- %B = xor i32 %A, -2147483648
- %C = icmp sgt i32 %B, -1
- ret i1 %C
-}
-
-define i1 @test1(i32 %A) {
- %B = xor i32 %A, 12345
- %C = icmp slt i32 %B, 0
- ret i1 %C
-}
-
diff --git a/release_23/test/Transforms/InstCombine/zero-point-zero-add.ll b/release_23/test/Transforms/InstCombine/zero-point-zero-add.ll
deleted file mode 100644
index bae60d970356..000000000000
--- a/release_23/test/Transforms/InstCombine/zero-point-zero-add.ll
+++ /dev/null
@@ -1,15 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep 0.0 | count 1
-
-declare double @abs(double)
-
-define double @test(double %X) {
- %Y = add double %X, 0.0 ;; Should be a single add x, 0.0
- %Z = add double %Y, 0.0
- ret double %Z
-}
-
-define double @test1(double %X) {
- %Y = call double @abs(double %X)
- %Z = add double %Y, 0.0
- ret double %Z
-}
diff --git a/release_23/test/Transforms/InstCombine/zeroext-and-reduce.ll b/release_23/test/Transforms/InstCombine/zeroext-and-reduce.ll
deleted file mode 100644
index 2b4950aec978..000000000000
--- a/release_23/test/Transforms/InstCombine/zeroext-and-reduce.ll
+++ /dev/null
@@ -1,10 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \
-; RUN: grep {and i32 %Y, 8}
-
-define i32 @test1(i8 %X) {
- %Y = zext i8 %X to i32 ; <i32> [#uses=1]
- %Z = and i32 %Y, 65544 ; <i32> [#uses=1]
- ret i32 %Z
-}
-
-
diff --git a/release_23/test/Transforms/InstCombine/zext-fold.ll b/release_23/test/Transforms/InstCombine/zext-fold.ll
deleted file mode 100644
index 690a2275e062..000000000000
--- a/release_23/test/Transforms/InstCombine/zext-fold.ll
+++ /dev/null
@@ -1,13 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {zext } | count 1
-; PR1570
-; XFAIL: *
-
-define i32 @test2(float %X, float %Y) {
-entry:
- %tmp3 = fcmp uno float %X, %Y ; <i1> [#uses=1]
- %tmp34 = zext i1 %tmp3 to i8 ; <i8> [#uses=1]
- %tmp = xor i8 %tmp34, 1 ; <i8> [#uses=1]
- %toBoolnot5 = zext i8 %tmp to i32 ; <i32> [#uses=1]
- ret i32 %toBoolnot5
-}
-
diff --git a/release_23/test/Transforms/InstCombine/zext-or-icmp.ll b/release_23/test/Transforms/InstCombine/zext-or-icmp.ll
deleted file mode 100644
index 35c7c0a6be6e..000000000000
--- a/release_23/test/Transforms/InstCombine/zext-or-icmp.ll
+++ /dev/null
@@ -1,35 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep icmp | count 1
-
- %struct.FooBar = type <{ i8, i8, [2 x i8], i8, i8, i8, i8, i16, i16, [4 x i8], [8 x %struct.Rock] }>
- %struct.Rock = type { i16, i16 }
-@some_idx = internal constant [4 x i8] c"\0A\0B\0E\0F" ; <[4 x i8]*> [#uses=1]
-
-define i8 @t(%struct.FooBar* %up, i8 zeroext %intra_flag, i32 %blk_i) zeroext nounwind {
-entry:
- %tmp2 = lshr i32 %blk_i, 1 ; <i32> [#uses=1]
- %tmp3 = and i32 %tmp2, 2 ; <i32> [#uses=1]
- %tmp5 = and i32 %blk_i, 1 ; <i32> [#uses=1]
- %tmp6 = or i32 %tmp3, %tmp5 ; <i32> [#uses=1]
- %tmp8 = getelementptr %struct.FooBar* %up, i32 0, i32 7 ; <i16*> [#uses=1]
- %tmp9 = load i16* %tmp8, align 1 ; <i16> [#uses=1]
- %tmp910 = zext i16 %tmp9 to i32 ; <i32> [#uses=1]
- %tmp12 = getelementptr [4 x i8]* @some_idx, i32 0, i32 %tmp6 ; <i8*> [#uses=1]
- %tmp13 = load i8* %tmp12, align 1 ; <i8> [#uses=1]
- %tmp1314 = zext i8 %tmp13 to i32 ; <i32> [#uses=1]
- %tmp151 = lshr i32 %tmp910, %tmp1314 ; <i32> [#uses=1]
- %tmp1516 = trunc i32 %tmp151 to i8 ; <i8> [#uses=1]
- %tmp18 = getelementptr %struct.FooBar* %up, i32 0, i32 0 ; <i8*> [#uses=1]
- %tmp19 = load i8* %tmp18, align 1 ; <i8> [#uses=1]
- %tmp22 = and i8 %tmp1516, %tmp19 ; <i8> [#uses=1]
- %tmp24 = getelementptr %struct.FooBar* %up, i32 0, i32 0 ; <i8*> [#uses=1]
- %tmp25 = load i8* %tmp24, align 1 ; <i8> [#uses=1]
- %tmp26.mask = and i8 %tmp25, 1 ; <i8> [#uses=1]
- %toBool = icmp eq i8 %tmp26.mask, 0 ; <i1> [#uses=1]
- %toBool.not = xor i1 %toBool, true ; <i1> [#uses=1]
- %toBool33 = icmp eq i8 %intra_flag, 0 ; <i1> [#uses=1]
- %bothcond = or i1 %toBool.not, %toBool33 ; <i1> [#uses=1]
- %iftmp.1.0 = select i1 %bothcond, i8 0, i8 1 ; <i8> [#uses=1]
- %tmp40 = or i8 %tmp22, %iftmp.1.0 ; <i8> [#uses=1]
- %tmp432 = and i8 %tmp40, 1 ; <i8> [#uses=1]
- ret i8 %tmp432
-}
diff --git a/release_23/test/Transforms/InstCombine/zext.ll b/release_23/test/Transforms/InstCombine/zext.ll
deleted file mode 100644
index ceb8deb6775f..000000000000
--- a/release_23/test/Transforms/InstCombine/zext.ll
+++ /dev/null
@@ -1,10 +0,0 @@
-; Tests to make sure elimination of casts is working correctly
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \
-; RUN: notcast {} {%c1.*}
-
-define i64 @test_sext_zext(i16 %A) {
- %c1 = zext i16 %A to i32 ; <i32> [#uses=1]
- %c2 = sext i32 %c1 to i64 ; <i64> [#uses=1]
- ret i64 %c2
-}
-
diff --git a/release_23/test/Transforms/JumpThreading/2008-04-24-InfLoop.ll b/release_23/test/Transforms/JumpThreading/2008-04-24-InfLoop.ll
deleted file mode 100644
index 3eb2aa1be5b0..000000000000
--- a/release_23/test/Transforms/JumpThreading/2008-04-24-InfLoop.ll
+++ /dev/null
@@ -1,142 +0,0 @@
-; RUN: llvm-as < %s | opt -jump-threading -disable-output
-target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
-target triple = "i386-apple-darwin9"
-@Link = global [1 x i32] [ i32 -1 ] ; <[1 x i32]*> [#uses=2]
-@W = global [1 x i32] [ i32 2 ] ; <[1 x i32]*> [#uses=1]
-
-define i32 @f(i32 %k, i32 %p) nounwind {
-entry:
- br label %bb
-
-bb: ; preds = %bb56, %bb76.loopexit.us, %entry
- %j.2 = phi i32 [ 0, %entry ], [ 1, %bb56 ], [ 1, %bb76.loopexit.us ] ; <i32> [#uses=5]
- %pdest.2 = phi i32 [ 0, %entry ], [ %pdest.8, %bb56 ], [ %pdest.7.us, %bb76.loopexit.us ] ; <i32> [#uses=3]
- %p_addr.0 = phi i32 [ %p, %entry ], [ 0, %bb56 ], [ %p_addr.1.us, %bb76.loopexit.us ] ; <i32> [#uses=3]
- %k_addr.0 = phi i32 [ %k, %entry ], [ %tmp59, %bb56 ], [ %tmp59.us, %bb76.loopexit.us ] ; <i32> [#uses=4]
- %tmp2 = icmp sgt i32 %pdest.2, 2 ; <i1> [#uses=1]
- br i1 %tmp2, label %bb4.preheader, label %bb13
-
-bb4.preheader: ; preds = %bb
- %tmp109 = sub i32 1, %j.2 ; <i32> [#uses=2]
- %tmp110 = icmp slt i32 %tmp109, -2 ; <i1> [#uses=1]
- %smax111 = select i1 %tmp110, i32 -2, i32 %tmp109 ; <i32> [#uses=2]
- %tmp112 = add i32 %j.2, %smax111 ; <i32> [#uses=2]
- br label %bb4
-
-bb4: ; preds = %bb4, %bb4.preheader
- %indvar = phi i32 [ 0, %bb4.preheader ], [ %indvar.next, %bb4 ] ; <i32> [#uses=1]
- %indvar.next = add i32 %indvar, 1 ; <i32> [#uses=2]
- %exitcond = icmp eq i32 %indvar.next, %tmp112 ; <i1> [#uses=1]
- br i1 %exitcond, label %bb13.loopexit, label %bb4
-
-bb13.loopexit: ; preds = %bb4
- %tmp = add i32 %j.2, %pdest.2 ; <i32> [#uses=1]
- %tmp102 = add i32 %tmp, %smax111 ; <i32> [#uses=1]
- %tmp104 = add i32 %tmp112, -1 ; <i32> [#uses=1]
- %tmp106 = sub i32 %j.2, %tmp104 ; <i32> [#uses=1]
- %tmp107 = add i32 %tmp106, -1 ; <i32> [#uses=1]
- br label %bb13
-
-bb13: ; preds = %bb13.loopexit, %bb
- %j.1 = phi i32 [ %tmp107, %bb13.loopexit ], [ %j.2, %bb ] ; <i32> [#uses=4]
- %pdest.1 = phi i32 [ %tmp102, %bb13.loopexit ], [ %pdest.2, %bb ] ; <i32> [#uses=2]
- %tmp15 = icmp eq i32 %j.1, 1 ; <i1> [#uses=1]
- br i1 %tmp15, label %bb82, label %bb27.preheader
-
-bb27.preheader: ; preds = %bb13
- %tmp21 = icmp eq i32 %j.1, %p_addr.0 ; <i1> [#uses=0]
- br label %bb27.outer
-
-bb27.outer: ; preds = %bb27.outer.bb24.split_crit_edge, %bb27.preheader
- %indvar118 = phi i32 [ 0, %bb27.preheader ], [ %indvar.next119, %bb27.outer.bb24.split_crit_edge ] ; <i32> [#uses=2]
- %pdest.3.ph = add i32 %indvar118, %pdest.1 ; <i32> [#uses=2]
- %tmp30 = icmp sgt i32 %pdest.3.ph, %p_addr.0 ; <i1> [#uses=1]
- br i1 %tmp30, label %bb27.outer.bb24.split_crit_edge, label %bb27.outer.split
-
-bb27.outer.bb24.split_crit_edge: ; preds = %bb27.outer
- %indvar.next119 = add i32 %indvar118, 1 ; <i32> [#uses=1]
- br label %bb27.outer
-
-bb27.outer.split: ; preds = %bb27.outer
- %tmp35 = getelementptr [1 x i32]* @W, i32 0, i32 %k_addr.0 ; <i32*> [#uses=3]
- %tmp48 = icmp slt i32 %p_addr.0, 1 ; <i1> [#uses=1]
- %tmp53 = icmp sgt i32 %k_addr.0, 0 ; <i1> [#uses=1]
- br label %bb33
-
-bb33: ; preds = %bb51.split, %bb27.outer.split
- %pdest.5 = phi i32 [ %pdest.3.ph, %bb27.outer.split ], [ %pdest.4, %bb51.split ] ; <i32> [#uses=1]
- %tmp36 = load i32* %tmp35, align 4 ; <i32> [#uses=2]
- br i1 %tmp48, label %bb37.us, label %bb37
-
-bb37.us: ; preds = %bb42.us, %bb37.us, %bb33
- %D1361.1.us = phi i32 [ %tmp36, %bb33 ], [ 0, %bb42.us ], [ %D1361.1.us, %bb37.us ] ; <i32> [#uses=2]
- %tmp39.us = icmp eq i32 %D1361.1.us, 0 ; <i1> [#uses=1]
- br i1 %tmp39.us, label %bb37.us, label %bb42.us
-
-bb42.us: ; preds = %bb37.us
- store i32 0, i32* %tmp35, align 4
- br label %bb37.us
-
-bb37: ; preds = %bb33
- %tmp39 = icmp eq i32 %tmp36, 0 ; <i1> [#uses=1]
- br i1 %tmp39, label %bb51.split, label %bb42
-
-bb42: ; preds = %bb37
- store i32 0, i32* %tmp35, align 4
- br label %bb51.split
-
-bb51.split: ; preds = %bb42, %bb37
- %pdest.4 = phi i32 [ 1, %bb42 ], [ %pdest.5, %bb37 ] ; <i32> [#uses=3]
- br i1 %tmp53, label %bb33, label %bb56.preheader
-
-bb56.preheader: ; preds = %bb51.split
- %tmp7394 = icmp sgt i32 %j.1, 0 ; <i1> [#uses=1]
- br i1 %tmp7394, label %bb56.us, label %bb56
-
-bb56.us: ; preds = %bb76.loopexit.us, %bb56.preheader
- %pdest.8.us = phi i32 [ %pdest.4, %bb56.preheader ], [ %pdest.7.us, %bb76.loopexit.us ] ; <i32> [#uses=1]
- %k_addr.1.us = phi i32 [ %k_addr.0, %bb56.preheader ], [ %tmp59.us, %bb76.loopexit.us ] ; <i32> [#uses=1]
- %tmp58.us = getelementptr [1 x i32]* @Link, i32 0, i32 %k_addr.1.us ; <i32*> [#uses=1]
- %tmp59.us = load i32* %tmp58.us, align 4 ; <i32> [#uses=3]
- %tmp6295.us = icmp ne i32 %tmp59.us, -1 ; <i1> [#uses=2]
- br label %bb60.us
-
-bb60.us: ; preds = %bb60.us, %bb56.us
- %pdest.7.reg2mem.0.us = phi i32 [ %pdest.8.us, %bb56.us ], [ %pdest.7.us, %bb60.us ] ; <i32> [#uses=1]
- %p_addr.1.reg2mem.0.us = phi i32 [ 0, %bb56.us ], [ %p_addr.1.us, %bb60.us ] ; <i32> [#uses=1]
- %tmp67.us = zext i1 %tmp6295.us to i32 ; <i32> [#uses=2]
- %pdest.7.us = add i32 %pdest.7.reg2mem.0.us, %tmp67.us ; <i32> [#uses=3]
- %p_addr.1.us = add i32 %p_addr.1.reg2mem.0.us, %tmp67.us ; <i32> [#uses=3]
- %tmp73.us = icmp slt i32 %p_addr.1.us, %j.1 ; <i1> [#uses=1]
- br i1 %tmp73.us, label %bb60.us, label %bb76.loopexit.us
-
-bb76.loopexit.us: ; preds = %bb60.us
- br i1 %tmp6295.us, label %bb56.us, label %bb
-
-bb56: ; preds = %bb56, %bb56.preheader
- %pdest.8 = phi i32 [ %pdest.4, %bb56.preheader ], [ %pdest.8, %bb56 ] ; <i32> [#uses=2]
- %k_addr.1 = phi i32 [ %k_addr.0, %bb56.preheader ], [ %tmp59, %bb56 ] ; <i32> [#uses=1]
- %tmp58 = getelementptr [1 x i32]* @Link, i32 0, i32 %k_addr.1 ; <i32*> [#uses=1]
- %tmp59 = load i32* %tmp58, align 4 ; <i32> [#uses=3]
- %tmp6295 = icmp ne i32 %tmp59, -1 ; <i1> [#uses=1]
- br i1 %tmp6295, label %bb56, label %bb
-
-bb82: ; preds = %bb13
- ret i32 %pdest.1
-}
-
-define i32 @main() nounwind {
-entry:
- %tmp1 = tail call i32 @f( i32 0, i32 2 ) nounwind ; <i32> [#uses=1]
- %tmp2 = icmp eq i32 %tmp1, 0 ; <i1> [#uses=1]
- br i1 %tmp2, label %bb, label %bb4
-
-bb: ; preds = %entry
- tail call void @abort( ) noreturn nounwind
- unreachable
-
-bb4: ; preds = %entry
- ret i32 0
-}
-
-declare void @abort() noreturn nounwind
diff --git a/release_23/test/Transforms/JumpThreading/2008-05-05-MRV-Crash.ll b/release_23/test/Transforms/JumpThreading/2008-05-05-MRV-Crash.ll
deleted file mode 100644
index f109109fc3f5..000000000000
--- a/release_23/test/Transforms/JumpThreading/2008-05-05-MRV-Crash.ll
+++ /dev/null
@@ -1,25 +0,0 @@
-; RUN: llvm-as < %s | opt -jump-threading -disable-output
-; PR2285
-target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128"
-target triple = "x86_64-unknown-linux-gnu"
- %struct.system__secondary_stack__mark_id = type { i64, i64 }
-
-define void @_ada_c35507b() {
-entry:
- br label %bb
-
-bb: ; preds = %bb13, %entry
- %ch.0 = phi i8 [ 0, %entry ], [ 0, %bb13 ] ; <i8> [#uses=1]
- %tmp11 = icmp ugt i8 %ch.0, 31 ; <i1> [#uses=1]
- %tmp120 = call %struct.system__secondary_stack__mark_id @system__secondary_stack__ss_mark( ) ; <%struct.system__secondary_stack__mark_id> [#uses=1]
- br i1 %tmp11, label %bb110, label %bb13
-
-bb13: ; preds = %bb
- br label %bb
-
-bb110: ; preds = %bb
- %mrv_gr124 = getresult %struct.system__secondary_stack__mark_id %tmp120, 1 ; <i64> [#uses=0]
- unreachable
-}
-
-declare %struct.system__secondary_stack__mark_id @system__secondary_stack__ss_mark()
diff --git a/release_23/test/Transforms/JumpThreading/and-and-cond.ll b/release_23/test/Transforms/JumpThreading/and-and-cond.ll
deleted file mode 100644
index de4435c50794..000000000000
--- a/release_23/test/Transforms/JumpThreading/and-and-cond.ll
+++ /dev/null
@@ -1,33 +0,0 @@
-; RUN: llvm-as < %s | opt -jump-threading -mem2reg -instcombine -simplifycfg | llvm-dis | grep {ret i32 %v1}
-; There should be no uncond branches left.
-; RUN: llvm-as < %s | opt -jump-threading -mem2reg -instcombine -simplifycfg | llvm-dis | not grep {br label}
-
-declare i32 @f1()
-declare i32 @f2()
-declare void @f3()
-
-define i32 @test(i1 %cond, i1 %cond2, i1 %cond3) {
- br i1 %cond, label %T1, label %F1
-
-T1:
- %v1 = call i32 @f1()
- br label %Merge
-
-F1:
- %v2 = call i32 @f2()
- br label %Merge
-
-Merge:
- %A = phi i1 [true, %T1], [false, %F1]
- %B = phi i32 [%v1, %T1], [%v2, %F1]
- %C = and i1 %A, %cond2
- %D = and i1 %C, %cond3
- br i1 %D, label %T2, label %F2
-
-T2:
- call void @f3()
- ret i32 %B
-
-F2:
- ret i32 %B
-}
diff --git a/release_23/test/Transforms/JumpThreading/and-cond.ll b/release_23/test/Transforms/JumpThreading/and-cond.ll
deleted file mode 100644
index b01c4baffc0e..000000000000
--- a/release_23/test/Transforms/JumpThreading/and-cond.ll
+++ /dev/null
@@ -1,32 +0,0 @@
-; RUN: llvm-as < %s | opt -jump-threading -mem2reg -instcombine -simplifycfg | llvm-dis | grep {ret i32 %v1}
-; There should be no uncond branches left.
-; RUN: llvm-as < %s | opt -jump-threading -mem2reg -instcombine -simplifycfg | llvm-dis | not grep {br label}
-
-declare i32 @f1()
-declare i32 @f2()
-declare void @f3()
-
-define i32 @test(i1 %cond, i1 %cond2) {
- br i1 %cond, label %T1, label %F1
-
-T1:
- %v1 = call i32 @f1()
- br label %Merge
-
-F1:
- %v2 = call i32 @f2()
- br label %Merge
-
-Merge:
- %A = phi i1 [true, %T1], [false, %F1]
- %B = phi i32 [%v1, %T1], [%v2, %F1]
- %C = and i1 %A, %cond2
- br i1 %C, label %T2, label %F2
-
-T2:
- call void @f3()
- ret i32 %B
-
-F2:
- ret i32 %B
-}
diff --git a/release_23/test/Transforms/JumpThreading/basic.ll b/release_23/test/Transforms/JumpThreading/basic.ll
deleted file mode 100644
index 5d99a7c0bec1..000000000000
--- a/release_23/test/Transforms/JumpThreading/basic.ll
+++ /dev/null
@@ -1,31 +0,0 @@
-; RUN: llvm-as < %s | opt -jump-threading -simplifycfg -mem2reg | llvm-dis | grep {ret i32 %v1}
-; There should be no uncond branches left.
-; RUN: llvm-as < %s | opt -jump-threading -simplifycfg -mem2reg | llvm-dis | not grep {br label}
-
-declare i32 @f1()
-declare i32 @f2()
-declare void @f3()
-
-define i32 @test(i1 %cond) {
- br i1 %cond, label %T1, label %F1
-
-T1:
- %v1 = call i32 @f1()
- br label %Merge
-
-F1:
- %v2 = call i32 @f2()
- br label %Merge
-
-Merge:
- %A = phi i1 [true, %T1], [false, %F1]
- %B = phi i32 [%v1, %T1], [%v2, %F1]
- br i1 %A, label %T2, label %F2
-
-T2:
- call void @f3()
- ret i32 %B
-
-F2:
- ret i32 %B
-}
diff --git a/release_23/test/Transforms/JumpThreading/compare.ll b/release_23/test/Transforms/JumpThreading/compare.ll
deleted file mode 100644
index cbada569aac9..000000000000
--- a/release_23/test/Transforms/JumpThreading/compare.ll
+++ /dev/null
@@ -1,30 +0,0 @@
-; There should be no phi nodes left.
-; RUN: llvm-as < %s | opt -jump-threading -simplifycfg -mem2reg | llvm-dis | not grep {phi i32}
-
-declare i32 @f1()
-declare i32 @f2()
-declare void @f3()
-
-define i32 @test(i1 %cond) {
- br i1 %cond, label %T1, label %F1
-
-T1:
- %v1 = call i32 @f1()
- br label %Merge
-
-F1:
- %v2 = call i32 @f2()
- br label %Merge
-
-Merge:
- %B = phi i32 [%v1, %T1], [12, %F1]
- %A = icmp ne i32 %B, 42
- br i1 %A, label %T2, label %F2
-
-T2:
- call void @f3()
- ret i32 1
-
-F2:
- ret i32 0
-}
diff --git a/release_23/test/Transforms/JumpThreading/dg.exp b/release_23/test/Transforms/JumpThreading/dg.exp
deleted file mode 100644
index de42dad163fd..000000000000
--- a/release_23/test/Transforms/JumpThreading/dg.exp
+++ /dev/null
@@ -1,3 +0,0 @@
-load_lib llvm.exp
-
-RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.ll]]
diff --git a/release_23/test/Transforms/LCSSA/2006-06-03-IncorrectIDFPhis.ll b/release_23/test/Transforms/LCSSA/2006-06-03-IncorrectIDFPhis.ll
deleted file mode 100644
index aa24014f3b99..000000000000
--- a/release_23/test/Transforms/LCSSA/2006-06-03-IncorrectIDFPhis.ll
+++ /dev/null
@@ -1,23 +0,0 @@
-; RUN: llvm-as < %s | opt -lcssa | llvm-dis | \
-; RUN: grep {%SJE.0.0.lcssa = phi .struct.SetJmpMapEntry}
-; RUN: llvm-as < %s | opt -lcssa | llvm-dis | \
-; RUN: grep {%SJE.0.0.lcssa1 = phi .struct.SetJmpMapEntry}
-
- %struct.SetJmpMapEntry = type { i8*, i32, %struct.SetJmpMapEntry* }
-
-define void @__llvm_sjljeh_try_catching_longjmp_exception() {
-entry:
- br i1 false, label %UnifiedReturnBlock, label %no_exit
-no_exit: ; preds = %endif, %entry
- %SJE.0.0 = phi %struct.SetJmpMapEntry* [ %tmp.24, %endif ], [ null, %entry ] ; <%struct.SetJmpMapEntry*> [#uses=1]
- br i1 false, label %then, label %endif
-then: ; preds = %no_exit
- %tmp.20 = getelementptr %struct.SetJmpMapEntry* %SJE.0.0, i32 0, i32 1 ; <i32*> [#uses=0]
- ret void
-endif: ; preds = %no_exit
- %tmp.24 = load %struct.SetJmpMapEntry** null ; <%struct.SetJmpMapEntry*> [#uses=1]
- br i1 false, label %UnifiedReturnBlock, label %no_exit
-UnifiedReturnBlock: ; preds = %endif, %entry
- ret void
-}
-
diff --git a/release_23/test/Transforms/LCSSA/2006-06-12-MultipleExitsSameBlock.ll b/release_23/test/Transforms/LCSSA/2006-06-12-MultipleExitsSameBlock.ll
deleted file mode 100644
index eaccbadbf1d7..000000000000
--- a/release_23/test/Transforms/LCSSA/2006-06-12-MultipleExitsSameBlock.ll
+++ /dev/null
@@ -1,27 +0,0 @@
-; RUN: llvm-as < %s | opt -lcssa | llvm-dis | \
-; RUN: grep {%X.1.lcssa}
-; RUN: llvm-as < %s | opt -lcssa | llvm-dis | \
-; RUN: not grep {%X.1.lcssa1}
-
-declare i1 @c1()
-
-declare i1 @c2()
-
-define i32 @foo() {
-entry:
- br label %loop_begin
-loop_begin: ; preds = %loop_body.2, %entry
- br i1 true, label %loop_body.1, label %loop_exit2
-loop_body.1: ; preds = %loop_begin
- %X.1 = add i32 0, 1 ; <i32> [#uses=1]
- %rel.1 = call i1 @c1( ) ; <i1> [#uses=1]
- br i1 %rel.1, label %loop_exit, label %loop_body.2
-loop_body.2: ; preds = %loop_body.1
- %rel.2 = call i1 @c2( ) ; <i1> [#uses=1]
- br i1 %rel.2, label %loop_exit, label %loop_begin
-loop_exit: ; preds = %loop_body.2, %loop_body.1
- ret i32 %X.1
-loop_exit2: ; preds = %loop_begin
- ret i32 1
-}
-
diff --git a/release_23/test/Transforms/LCSSA/2006-07-09-NoDominator.ll b/release_23/test/Transforms/LCSSA/2006-07-09-NoDominator.ll
deleted file mode 100644
index c8af10058c08..000000000000
--- a/release_23/test/Transforms/LCSSA/2006-07-09-NoDominator.ll
+++ /dev/null
@@ -1,24 +0,0 @@
-; RUN: llvm-as < %s | opt -lcssa
-
- %struct.SetJmpMapEntry = type { i8*, i32, %struct.SetJmpMapEntry* }
-
-define void @__llvm_sjljeh_try_catching_longjmp_exception() {
-entry:
- br label %loopentry
-loopentry: ; preds = %endif, %entry
- %SJE.0 = phi %struct.SetJmpMapEntry* [ null, %entry ], [ %tmp.25, %endif ] ; <%struct.SetJmpMapEntry*> [#uses=1]
- br i1 false, label %no_exit, label %loopexit
-no_exit: ; preds = %loopentry
- br i1 false, label %then, label %endif
-then: ; preds = %no_exit
- %tmp.21 = getelementptr %struct.SetJmpMapEntry* %SJE.0, i32 0, i32 1 ; <i32*> [#uses=0]
- br label %return
-endif: ; preds = %no_exit
- %tmp.25 = load %struct.SetJmpMapEntry** null ; <%struct.SetJmpMapEntry*> [#uses=1]
- br label %loopentry
-loopexit: ; preds = %loopentry
- br label %return
-return: ; preds = %loopexit, %then
- ret void
-}
-
diff --git a/release_23/test/Transforms/LCSSA/2006-10-31-UnreachableBlock-2.ll b/release_23/test/Transforms/LCSSA/2006-10-31-UnreachableBlock-2.ll
deleted file mode 100644
index b85e6c36028b..000000000000
--- a/release_23/test/Transforms/LCSSA/2006-10-31-UnreachableBlock-2.ll
+++ /dev/null
@@ -1,145 +0,0 @@
-; RUN: llvm-as < %s | opt -lcssa -disable-output
-; PR977
-; END.
-declare i32 @opost_block()
-
-define void @write_chan() {
-entry:
- br i1 false, label %shortcirc_next.0, label %shortcirc_done.0
-shortcirc_next.0: ; preds = %entry
- br label %shortcirc_done.0
-shortcirc_done.0: ; preds = %shortcirc_next.0, %entry
- br i1 false, label %shortcirc_next.1, label %shortcirc_done.1
-shortcirc_next.1: ; preds = %shortcirc_done.0
- br label %shortcirc_done.1
-shortcirc_done.1: ; preds = %shortcirc_next.1, %shortcirc_done.0
- br i1 false, label %then.0, label %endif.0
-then.0: ; preds = %shortcirc_done.1
- br i1 false, label %then.1, label %endif.1
-then.1: ; preds = %then.0
- br label %return
-after_ret.0: ; No predecessors!
- br label %endif.1
-endif.1: ; preds = %after_ret.0, %then.0
- br label %endif.0
-endif.0: ; preds = %endif.1, %shortcirc_done.1
- br label %loopentry.0
-loopentry.0: ; preds = %endif.12, %endif.0
- br i1 false, label %then.2, label %endif.2
-then.2: ; preds = %loopentry.0
- br label %loopexit.0
-dead_block_after_break.0: ; No predecessors!
- br label %endif.2
-endif.2: ; preds = %dead_block_after_break.0, %loopentry.0
- br i1 false, label %shortcirc_done.2, label %shortcirc_next.2
-shortcirc_next.2: ; preds = %endif.2
- br i1 false, label %shortcirc_next.3, label %shortcirc_done.3
-shortcirc_next.3: ; preds = %shortcirc_next.2
- br label %shortcirc_done.3
-shortcirc_done.3: ; preds = %shortcirc_next.3, %shortcirc_next.2
- br label %shortcirc_done.2
-shortcirc_done.2: ; preds = %shortcirc_done.3, %endif.2
- br i1 false, label %then.3, label %endif.3
-then.3: ; preds = %shortcirc_done.2
- br label %loopexit.0
-dead_block_after_break.1: ; No predecessors!
- br label %endif.3
-endif.3: ; preds = %dead_block_after_break.1, %shortcirc_done.2
- br i1 false, label %shortcirc_next.4, label %shortcirc_done.4
-shortcirc_next.4: ; preds = %endif.3
- br label %shortcirc_done.4
-shortcirc_done.4: ; preds = %shortcirc_next.4, %endif.3
- br i1 false, label %then.4, label %else
-then.4: ; preds = %shortcirc_done.4
- br label %loopentry.1
-loopentry.1: ; preds = %endif.8, %then.4
- br i1 false, label %no_exit, label %loopexit.1
-no_exit: ; preds = %loopentry.1
- %tmp.94 = call i32 @opost_block( ) ; <i32> [#uses=1]
- br i1 false, label %then.5, label %endif.5
-then.5: ; preds = %no_exit
- br i1 false, label %then.6, label %endif.6
-then.6: ; preds = %then.5
- br label %loopexit.1
-dead_block_after_break.2: ; No predecessors!
- br label %endif.6
-endif.6: ; preds = %dead_block_after_break.2, %then.5
- br label %break_out
-dead_block_after_goto.0: ; No predecessors!
- br label %endif.5
-endif.5: ; preds = %dead_block_after_goto.0, %no_exit
- br i1 false, label %then.7, label %endif.7
-then.7: ; preds = %endif.5
- br label %loopexit.1
-dead_block_after_break.3: ; No predecessors!
- br label %endif.7
-endif.7: ; preds = %dead_block_after_break.3, %endif.5
- switch i32 1, label %switchexit [
- i32 4, label %label.2
- i32 2, label %label.1
- i32 1, label %label.0
- ]
-label.0: ; preds = %endif.7
- br label %switchexit
-dead_block_after_break.4: ; No predecessors!
- br label %label.1
-label.1: ; preds = %dead_block_after_break.4, %endif.7
- br label %switchexit
-dead_block_after_break.5: ; No predecessors!
- br label %label.2
-label.2: ; preds = %dead_block_after_break.5, %endif.7
- br label %switchexit
-dead_block_after_break.6: ; No predecessors!
- br label %switchexit
-switchexit: ; preds = %dead_block_after_break.6, %label.2, %label.1, %label.0, %endif.7
- br i1 false, label %then.8, label %endif.8
-then.8: ; preds = %switchexit
- br label %loopexit.1
-dead_block_after_break.7: ; No predecessors!
- br label %endif.8
-endif.8: ; preds = %dead_block_after_break.7, %switchexit
- br label %loopentry.1
-loopexit.1: ; preds = %then.8, %then.7, %then.6, %loopentry.1
- br i1 false, label %then.9, label %endif.9
-then.9: ; preds = %loopexit.1
- br label %endif.9
-endif.9: ; preds = %then.9, %loopexit.1
- br label %endif.4
-else: ; preds = %shortcirc_done.4
- br i1 false, label %then.10, label %endif.10
-then.10: ; preds = %else
- br label %break_out
-dead_block_after_goto.1: ; No predecessors!
- br label %endif.10
-endif.10: ; preds = %dead_block_after_goto.1, %else
- br label %endif.4
-endif.4: ; preds = %endif.10, %endif.9
- br i1 false, label %then.11, label %endif.11
-then.11: ; preds = %endif.4
- br label %loopexit.0
-dead_block_after_break.8: ; No predecessors!
- br label %endif.11
-endif.11: ; preds = %dead_block_after_break.8, %endif.4
- br i1 false, label %then.12, label %endif.12
-then.12: ; preds = %endif.11
- br label %loopexit.0
-dead_block_after_break.9: ; No predecessors!
- br label %endif.12
-endif.12: ; preds = %dead_block_after_break.9, %endif.11
- br label %loopentry.0
-loopexit.0: ; preds = %then.12, %then.11, %then.3, %then.2
- br label %break_out
-break_out: ; preds = %loopexit.0, %then.10, %endif.6
- %retval.3 = phi i32 [ 0, %loopexit.0 ], [ %tmp.94, %endif.6 ], [ 0, %then.10 ] ; <i32> [#uses=0]
- br i1 false, label %cond_true, label %cond_false
-cond_true: ; preds = %break_out
- br label %cond_continue
-cond_false: ; preds = %break_out
- br label %cond_continue
-cond_continue: ; preds = %cond_false, %cond_true
- br label %return
-after_ret.1: ; No predecessors!
- br label %return
-return: ; preds = %after_ret.1, %cond_continue, %then.1
- ret void
-}
diff --git a/release_23/test/Transforms/LCSSA/2006-10-31-UnreachableBlock.ll b/release_23/test/Transforms/LCSSA/2006-10-31-UnreachableBlock.ll
deleted file mode 100644
index b02feb4103d2..000000000000
--- a/release_23/test/Transforms/LCSSA/2006-10-31-UnreachableBlock.ll
+++ /dev/null
@@ -1,184 +0,0 @@
-; RUN: llvm-as < %s | opt -lcssa -disable-output
-; PR977
-; END.
-
-define void @process_backlog() {
-entry:
- br label %loopentry.preheader
-loopentry.preheader: ; preds = %dead_block_after_break, %entry
- %work.0.ph = phi i32 [ %inc, %dead_block_after_break ], [ 0, %entry ] ; <i32> [#uses=0]
- br label %loopentry
-loopentry: ; preds = %endif.1, %loopentry.preheader
- br i1 false, label %then.i, label %loopentry.__skb_dequeue67.exit_crit_edge
-loopentry.__skb_dequeue67.exit_crit_edge: ; preds = %loopentry
- br label %__skb_dequeue67.exit
-then.i: ; preds = %loopentry
- br label %__skb_dequeue67.exit
-__skb_dequeue67.exit: ; preds = %then.i, %loopentry.__skb_dequeue67.exit_crit_edge
- br i1 false, label %then.0, label %__skb_dequeue67.exit.endif.0_crit_edge
-__skb_dequeue67.exit.endif.0_crit_edge: ; preds = %__skb_dequeue67.exit
- br label %endif.0
-then.0: ; preds = %__skb_dequeue67.exit
- br label %job_done
-dead_block_after_goto: ; No predecessors!
- unreachable
-endif.0: ; preds = %__skb_dequeue67.exit.endif.0_crit_edge
- br i1 false, label %then.0.i, label %endif.0.endif.0.i_crit_edge
-endif.0.endif.0.i_crit_edge: ; preds = %endif.0
- br label %endif.0.i
-then.0.i: ; preds = %endif.0
- br label %endif.0.i
-endif.0.i: ; preds = %then.0.i, %endif.0.endif.0.i_crit_edge
- br i1 false, label %then.i.i, label %endif.0.i.skb_bond.exit.i_crit_edge
-endif.0.i.skb_bond.exit.i_crit_edge: ; preds = %endif.0.i
- br label %skb_bond.exit.i
-then.i.i: ; preds = %endif.0.i
- br label %skb_bond.exit.i
-skb_bond.exit.i: ; preds = %then.i.i, %endif.0.i.skb_bond.exit.i_crit_edge
- br label %loopentry.0.i
-loopentry.0.i: ; preds = %loopentry.0.i.backedge, %skb_bond.exit.i
- br i1 false, label %loopentry.0.i.no_exit.0.i_crit_edge, label %loopentry.0.i.loopexit.0.i_crit_edge
-loopentry.0.i.loopexit.0.i_crit_edge: ; preds = %loopentry.0.i
- br label %loopexit.0.i
-loopentry.0.i.no_exit.0.i_crit_edge: ; preds = %loopentry.0.i
- br label %no_exit.0.i
-no_exit.0.i: ; preds = %then.3.i.no_exit.0.i_crit_edge, %loopentry.0.i.no_exit.0.i_crit_edge
- br i1 false, label %no_exit.0.i.shortcirc_done.0.i_crit_edge, label %shortcirc_next.0.i
-no_exit.0.i.shortcirc_done.0.i_crit_edge: ; preds = %no_exit.0.i
- br label %shortcirc_done.0.i
-shortcirc_next.0.i: ; preds = %no_exit.0.i
- br label %shortcirc_done.0.i
-shortcirc_done.0.i: ; preds = %shortcirc_next.0.i, %no_exit.0.i.shortcirc_done.0.i_crit_edge
- br i1 false, label %then.1.i, label %endif.1.i
-then.1.i: ; preds = %shortcirc_done.0.i
- br i1 false, label %then.2.i, label %then.1.i.endif.2.i_crit_edge
-then.1.i.endif.2.i_crit_edge: ; preds = %then.1.i
- br label %endif.2.i
-then.2.i: ; preds = %then.1.i
- br i1 false, label %then.3.i, label %else.0.i
-then.3.i: ; preds = %then.2.i
- br i1 false, label %then.3.i.no_exit.0.i_crit_edge, label %then.3.i.loopexit.0.i_crit_edge
-then.3.i.loopexit.0.i_crit_edge: ; preds = %then.3.i
- br label %loopexit.0.i
-then.3.i.no_exit.0.i_crit_edge: ; preds = %then.3.i
- br label %no_exit.0.i
-else.0.i: ; preds = %then.2.i
- br label %endif.2.i
-endif.3.i: ; No predecessors!
- unreachable
-endif.2.i: ; preds = %else.0.i, %then.1.i.endif.2.i_crit_edge
- br label %loopentry.0.i.backedge
-endif.1.i: ; preds = %shortcirc_done.0.i
- br label %loopentry.0.i.backedge
-loopentry.0.i.backedge: ; preds = %endif.1.i, %endif.2.i
- br label %loopentry.0.i
-loopexit.0.i: ; preds = %then.3.i.loopexit.0.i_crit_edge, %loopentry.0.i.loopexit.0.i_crit_edge
- br label %loopentry.1.i
-loopentry.1.i: ; preds = %loopentry.1.i.backedge, %loopexit.0.i
- br i1 false, label %loopentry.1.i.no_exit.1.i_crit_edge, label %loopentry.1.i.loopexit.1.i_crit_edge
-loopentry.1.i.loopexit.1.i_crit_edge: ; preds = %loopentry.1.i
- br label %loopexit.1.i
-loopentry.1.i.no_exit.1.i_crit_edge: ; preds = %loopentry.1.i
- br label %no_exit.1.i
-no_exit.1.i: ; preds = %then.6.i.no_exit.1.i_crit_edge, %loopentry.1.i.no_exit.1.i_crit_edge
- br i1 false, label %shortcirc_next.1.i, label %no_exit.1.i.shortcirc_done.1.i_crit_edge
-no_exit.1.i.shortcirc_done.1.i_crit_edge: ; preds = %no_exit.1.i
- br label %shortcirc_done.1.i
-shortcirc_next.1.i: ; preds = %no_exit.1.i
- br i1 false, label %shortcirc_next.1.i.shortcirc_done.2.i_crit_edge, label %shortcirc_next.2.i
-shortcirc_next.1.i.shortcirc_done.2.i_crit_edge: ; preds = %shortcirc_next.1.i
- br label %shortcirc_done.2.i
-shortcirc_next.2.i: ; preds = %shortcirc_next.1.i
- br label %shortcirc_done.2.i
-shortcirc_done.2.i: ; preds = %shortcirc_next.2.i, %shortcirc_next.1.i.shortcirc_done.2.i_crit_edge
- br label %shortcirc_done.1.i
-shortcirc_done.1.i: ; preds = %shortcirc_done.2.i, %no_exit.1.i.shortcirc_done.1.i_crit_edge
- br i1 false, label %then.4.i, label %endif.4.i
-then.4.i: ; preds = %shortcirc_done.1.i
- br i1 false, label %then.5.i, label %then.4.i.endif.5.i_crit_edge
-then.4.i.endif.5.i_crit_edge: ; preds = %then.4.i
- br label %endif.5.i
-then.5.i: ; preds = %then.4.i
- br i1 false, label %then.6.i, label %else.1.i
-then.6.i: ; preds = %then.5.i
- br i1 false, label %then.6.i.no_exit.1.i_crit_edge, label %then.6.i.loopexit.1.i_crit_edge
-then.6.i.loopexit.1.i_crit_edge: ; preds = %then.6.i
- br label %loopexit.1.i
-then.6.i.no_exit.1.i_crit_edge: ; preds = %then.6.i
- br label %no_exit.1.i
-else.1.i: ; preds = %then.5.i
- br label %endif.5.i
-endif.6.i: ; No predecessors!
- unreachable
-endif.5.i: ; preds = %else.1.i, %then.4.i.endif.5.i_crit_edge
- br label %loopentry.1.i.backedge
-endif.4.i: ; preds = %shortcirc_done.1.i
- br label %loopentry.1.i.backedge
-loopentry.1.i.backedge: ; preds = %endif.4.i, %endif.5.i
- br label %loopentry.1.i
-loopexit.1.i: ; preds = %then.6.i.loopexit.1.i_crit_edge, %loopentry.1.i.loopexit.1.i_crit_edge
- br i1 false, label %then.7.i, label %else.2.i
-then.7.i: ; preds = %loopexit.1.i
- br i1 false, label %then.8.i, label %else.3.i
-then.8.i: ; preds = %then.7.i
- br label %netif_receive_skb.exit
-else.3.i: ; preds = %then.7.i
- br label %netif_receive_skb.exit
-endif.8.i: ; No predecessors!
- unreachable
-else.2.i: ; preds = %loopexit.1.i
- br i1 false, label %else.2.i.shortcirc_done.i.i_crit_edge, label %shortcirc_next.i.i
-else.2.i.shortcirc_done.i.i_crit_edge: ; preds = %else.2.i
- br label %shortcirc_done.i.i
-shortcirc_next.i.i: ; preds = %else.2.i
- br label %shortcirc_done.i.i
-shortcirc_done.i.i: ; preds = %shortcirc_next.i.i, %else.2.i.shortcirc_done.i.i_crit_edge
- br i1 false, label %then.i1.i, label %shortcirc_done.i.i.kfree_skb65.exit.i_crit_edge
-shortcirc_done.i.i.kfree_skb65.exit.i_crit_edge: ; preds = %shortcirc_done.i.i
- br label %kfree_skb65.exit.i
-then.i1.i: ; preds = %shortcirc_done.i.i
- br label %kfree_skb65.exit.i
-kfree_skb65.exit.i: ; preds = %then.i1.i, %shortcirc_done.i.i.kfree_skb65.exit.i_crit_edge
- br label %netif_receive_skb.exit
-netif_receive_skb.exit: ; preds = %kfree_skb65.exit.i, %else.3.i, %then.8.i
- br i1 false, label %then.i1, label %netif_receive_skb.exit.dev_put69.exit_crit_edge
-netif_receive_skb.exit.dev_put69.exit_crit_edge: ; preds = %netif_receive_skb.exit
- br label %dev_put69.exit
-then.i1: ; preds = %netif_receive_skb.exit
- br label %dev_put69.exit
-dev_put69.exit: ; preds = %then.i1, %netif_receive_skb.exit.dev_put69.exit_crit_edge
- %inc = add i32 0, 1 ; <i32> [#uses=1]
- br i1 false, label %dev_put69.exit.shortcirc_done_crit_edge, label %shortcirc_next
-dev_put69.exit.shortcirc_done_crit_edge: ; preds = %dev_put69.exit
- br label %shortcirc_done
-shortcirc_next: ; preds = %dev_put69.exit
- br label %shortcirc_done
-shortcirc_done: ; preds = %shortcirc_next, %dev_put69.exit.shortcirc_done_crit_edge
- br i1 false, label %then.1, label %endif.1
-then.1: ; preds = %shortcirc_done
- ret void
-dead_block_after_break: ; No predecessors!
- br label %loopentry.preheader
-endif.1: ; preds = %shortcirc_done
- br label %loopentry
-loopexit: ; No predecessors!
- unreachable
-after_ret.0: ; No predecessors!
- br label %job_done
-job_done: ; preds = %after_ret.0, %then.0
- br label %loopentry.i
-loopentry.i: ; preds = %no_exit.i, %job_done
- br i1 false, label %no_exit.i, label %clear_bit62.exit
-no_exit.i: ; preds = %loopentry.i
- br label %loopentry.i
-clear_bit62.exit: ; preds = %loopentry.i
- br i1 false, label %then.2, label %endif.2
-then.2: ; preds = %clear_bit62.exit
- ret void
-endif.2: ; preds = %clear_bit62.exit
- ret void
-after_ret.1: ; No predecessors!
- ret void
-return: ; No predecessors!
- unreachable
-}
diff --git a/release_23/test/Transforms/LCSSA/2007-07-12-LICM-2.ll b/release_23/test/Transforms/LCSSA/2007-07-12-LICM-2.ll
deleted file mode 100644
index 58bb19dc69c3..000000000000
--- a/release_23/test/Transforms/LCSSA/2007-07-12-LICM-2.ll
+++ /dev/null
@@ -1,17 +0,0 @@
-; RUN: llvm-as < %s | opt -loop-rotate -licm -loop-unswitch -disable-output
-define i32 @main(i32 %argc, i8** %argv) {
-entry:
- br label %bb7
-
-bb7: ; preds = %bb7, %entry
- %tmp39 = load <4 x float>* null ; <<4 x float>> [#uses=1]
- %tmp40 = add <4 x float> %tmp39, < float 2.000000e+00, float 3.000000e+00, float 1.000000e+00, float 0.000000e+00 > ; <<4 x float>> [#uses=1]
- %tmp43 = add <4 x float> %tmp40, < float 1.000000e+00, float 1.000000e+00, float 0.000000e+00, float 2.000000e+00 > ; <<4 x float>> [#uses=1]
- %tmp46 = add <4 x float> %tmp43, < float 3.000000e+00, float 0.000000e+00, float 2.000000e+00, float 4.000000e+00 > ; <<4 x float>> [#uses=1]
- %tmp49 = add <4 x float> %tmp46, < float 0.000000e+00, float 4.000000e+00, float 6.000000e+00, float 1.000000e+00 > ; <<4 x float>> [#uses=1]
- store <4 x float> %tmp49, <4 x float>* null
- br i1 false, label %bb7, label %bb56
-
-bb56: ; preds = %bb7
- ret i32 0
-}
diff --git a/release_23/test/Transforms/LCSSA/2007-07-12-LICM-3.ll b/release_23/test/Transforms/LCSSA/2007-07-12-LICM-3.ll
deleted file mode 100644
index 79370ee4340b..000000000000
--- a/release_23/test/Transforms/LCSSA/2007-07-12-LICM-3.ll
+++ /dev/null
@@ -1,24 +0,0 @@
-; RUN: llvm-as < %s | opt -loop-rotate -licm -loop-unswitch -disable-output
-
-define i32 @main(i32 %argc, i8** %argv) {
-entry:
- br label %bb
-
-bb: ; preds = %bb56, %entry
- br label %bb7
-
-bb7: ; preds = %bb7, %bb
- %tmp39 = load <4 x float>* null ; <<4 x float>> [#uses=1]
- %tmp40 = add <4 x float> %tmp39, < float 2.000000e+00, float 3.000000e+00, float 1.000000e+00, float 0.000000e+00 > ; <<4 x float>> [#uses=1]
- %tmp43 = add <4 x float> %tmp40, < float 1.000000e+00, float 1.000000e+00, float 0.000000e+00, float 2.000000e+00 > ; <<4 x float>> [#uses=1]
- %tmp46 = add <4 x float> %tmp43, < float 3.000000e+00, float 0.000000e+00, float 2.000000e+00, float 4.000000e+00 > ; <<4 x float>> [#uses=1]
- %tmp49 = add <4 x float> %tmp46, < float 0.000000e+00, float 4.000000e+00, float 6.000000e+00, float 1.000000e+00 > ; <<4 x float>> [#uses=1]
- store <4 x float> %tmp49, <4 x float>* null
- br i1 false, label %bb7, label %bb56
-
-bb56: ; preds = %bb7
- br i1 false, label %bb, label %bb64
-
-bb64: ; preds = %bb56
- ret i32 0
-}
diff --git a/release_23/test/Transforms/LCSSA/2007-07-12-LICM.ll b/release_23/test/Transforms/LCSSA/2007-07-12-LICM.ll
deleted file mode 100644
index 1c9830e03d9c..000000000000
--- a/release_23/test/Transforms/LCSSA/2007-07-12-LICM.ll
+++ /dev/null
@@ -1,14 +0,0 @@
-; RUN: llvm-as < %s | opt -loop-rotate -licm -loop-unswitch -disable-output
-define i32 @main(i32 %argc, i8** %argv) {
-entry:
- br label %bb7
-
-bb7: ; preds = %bb7, %entry
- %tmp39 = load <4 x float>* null ; <<4 x float>> [#uses=1]
- %tmp40 = add <4 x float> %tmp39, < float 2.000000e+00, float 3.000000e+00, float 1.000000e+00, float 0.000000e+00 > ; <<4 x float>> [#uses=0]
- store <4 x float> zeroinitializer, <4 x float>* null
- br i1 false, label %bb7, label %bb56
-
-bb56: ; preds = %bb7
- ret i32 0
-}
diff --git a/release_23/test/Transforms/LCSSA/basictest.ll b/release_23/test/Transforms/LCSSA/basictest.ll
deleted file mode 100644
index 090bde95d971..000000000000
--- a/release_23/test/Transforms/LCSSA/basictest.ll
+++ /dev/null
@@ -1,24 +0,0 @@
-; RUN: llvm-as < %s | opt -lcssa | llvm-dis | \
-; RUN: grep {X3.lcssa = phi i32}
-; RUN: llvm-as < %s | opt -lcssa | llvm-dis | \
-; RUN: grep {X4 = add i32 3, %X3.lcssa}
-
-define void @lcssa(i1 %S2) {
-entry:
- br label %loop.interior
-loop.interior: ; preds = %post.if, %entry
- br i1 %S2, label %if.true, label %if.false
-if.true: ; preds = %loop.interior
- %X1 = add i32 0, 0 ; <i32> [#uses=1]
- br label %post.if
-if.false: ; preds = %loop.interior
- %X2 = add i32 0, 1 ; <i32> [#uses=1]
- br label %post.if
-post.if: ; preds = %if.false, %if.true
- %X3 = phi i32 [ %X1, %if.true ], [ %X2, %if.false ] ; <i32> [#uses=1]
- br i1 %S2, label %loop.exit, label %loop.interior
-loop.exit: ; preds = %post.if
- %X4 = add i32 3, %X3 ; <i32> [#uses=0]
- ret void
-}
-
diff --git a/release_23/test/Transforms/LCSSA/dg.exp b/release_23/test/Transforms/LCSSA/dg.exp
deleted file mode 100644
index 879685ca879d..000000000000
--- a/release_23/test/Transforms/LCSSA/dg.exp
+++ /dev/null
@@ -1,3 +0,0 @@
-load_lib llvm.exp
-
-RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
diff --git a/release_23/test/Transforms/LICM/2003-02-26-LoopExitNotDominated.ll b/release_23/test/Transforms/LICM/2003-02-26-LoopExitNotDominated.ll
deleted file mode 100644
index cf0520617938..000000000000
--- a/release_23/test/Transforms/LICM/2003-02-26-LoopExitNotDominated.ll
+++ /dev/null
@@ -1,18 +0,0 @@
-; RUN: llvm-as < %s | opt -basicaa -licm -disable-output
-
-;%MoveArray = external global [64 x ulong]
-
-define void @InitMoveArray() {
-bb3:
- %X = alloca [2 x i64] ; <[2 x i64]*> [#uses=1]
- br i1 false, label %bb13, label %bb4
-bb4: ; preds = %bb3
- %reg3011 = getelementptr [2 x i64]* %X, i64 0, i64 0 ; <i64*> [#uses=1]
- br label %bb8
-bb8: ; preds = %bb8, %bb4
- store i64 0, i64* %reg3011
- br i1 false, label %bb8, label %bb13
-bb13: ; preds = %bb8, %bb3
- ret void
-}
-
diff --git a/release_23/test/Transforms/LICM/2003-02-27-NestedLoopExitBlocks.ll b/release_23/test/Transforms/LICM/2003-02-27-NestedLoopExitBlocks.ll
deleted file mode 100644
index bf209eaa479f..000000000000
--- a/release_23/test/Transforms/LICM/2003-02-27-NestedLoopExitBlocks.ll
+++ /dev/null
@@ -1,17 +0,0 @@
-; Exit blocks need to be updated for all nested loops...
-
-; RUN: llvm-as < %s | opt -loopsimplify
-
-define i32 @yyparse() {
-bb0:
- br i1 false, label %UnifiedExitNode, label %bb19
-bb19: ; preds = %bb28, %bb0
- br i1 false, label %bb28, label %UnifiedExitNode
-bb28: ; preds = %bb32, %bb19
- br i1 false, label %bb32, label %bb19
-bb32: ; preds = %bb28
- br i1 false, label %UnifiedExitNode, label %bb28
-UnifiedExitNode: ; preds = %bb32, %bb19, %bb0
- ret i32 0
-}
-
diff --git a/release_23/test/Transforms/LICM/2003-02-27-PreheaderExitNodeUpdate.ll b/release_23/test/Transforms/LICM/2003-02-27-PreheaderExitNodeUpdate.ll
deleted file mode 100644
index 4b51a3be4b06..000000000000
--- a/release_23/test/Transforms/LICM/2003-02-27-PreheaderExitNodeUpdate.ll
+++ /dev/null
@@ -1,16 +0,0 @@
-; This testcase fails because preheader insertion is not updating exit node
-; information for loops.
-
-; RUN: llvm-as < %s | opt -licm
-
-define i32 @main(i32 %argc, i8** %argv) {
-bb0:
- br i1 false, label %bb7, label %bb5
-bb5: ; preds = %bb5, %bb0
- br i1 false, label %bb5, label %bb7
-bb7: ; preds = %bb7, %bb5, %bb0
- br i1 false, label %bb7, label %bb10
-bb10: ; preds = %bb7
- ret i32 0
-}
-
diff --git a/release_23/test/Transforms/LICM/2003-02-27-PreheaderProblem.ll b/release_23/test/Transforms/LICM/2003-02-27-PreheaderProblem.ll
deleted file mode 100644
index 117c5c3aaf20..000000000000
--- a/release_23/test/Transforms/LICM/2003-02-27-PreheaderProblem.ll
+++ /dev/null
@@ -1,24 +0,0 @@
-; Here we have a case where there are two loops and LICM is hoisting an
-; instruction from one loop into the other loop! This is obviously bad and
-; happens because preheader insertion doesn't insert a preheader for this
-; case... bad.
-
-; RUN: llvm-as < %s | opt -licm -adce -simplifycfg | llvm-dis | \
-; RUN: not grep {br }
-
-define i32 @main(i32 %argc) {
-; <label>:0
- br label %bb5
-bb5: ; preds = %bb5, %0
- %I = phi i32 [ 0, %0 ], [ %I2, %bb5 ] ; <i32> [#uses=1]
- %I2 = add i32 %I, 1 ; <i32> [#uses=2]
- %c = icmp eq i32 %I2, 10 ; <i1> [#uses=1]
- br i1 %c, label %bb5, label %bb8
-bb8: ; preds = %bb8, %bb5
- %cann-indvar = phi i32 [ 0, %bb8 ], [ 0, %bb5 ] ; <i32> [#uses=0]
- %X = add i32 %argc, %argc ; <i32> [#uses=1]
- br i1 false, label %bb8, label %bb10
-bb10: ; preds = %bb8
- ret i32 %X
-}
-
diff --git a/release_23/test/Transforms/LICM/2003-02-27-StoreSinkPHIs.ll b/release_23/test/Transforms/LICM/2003-02-27-StoreSinkPHIs.ll
deleted file mode 100644
index 7ce164ec237f..000000000000
--- a/release_23/test/Transforms/LICM/2003-02-27-StoreSinkPHIs.ll
+++ /dev/null
@@ -1,15 +0,0 @@
-; LICM is adding stores before phi nodes. bad.
-
-; RUN: llvm-as < %s | opt -licm
-
-define i1 @test(i1 %c) {
-; <label>:0
- br i1 %c, label %Loop, label %Out
-Loop: ; preds = %Loop, %0
- store i32 0, i32* null
- br i1 %c, label %Loop, label %Out
-Out: ; preds = %Loop, %0
- %X = phi i1 [ %c, %0 ], [ true, %Loop ] ; <i1> [#uses=1]
- ret i1 %X
-}
-
diff --git a/release_23/test/Transforms/LICM/2003-02-28-PromoteDifferentType.ll b/release_23/test/Transforms/LICM/2003-02-28-PromoteDifferentType.ll
deleted file mode 100644
index 849ecd7cb1bb..000000000000
--- a/release_23/test/Transforms/LICM/2003-02-28-PromoteDifferentType.ll
+++ /dev/null
@@ -1,15 +0,0 @@
-; Test that hoisting is disabled for pointers of different types...
-;
-; RUN: llvm-as < %s | opt -licm
-
-define void @test(i32* %P) {
- br label %Loop
-Loop: ; preds = %Loop, %0
- store i32 5, i32* %P
- %P2 = bitcast i32* %P to i8* ; <i8*> [#uses=1]
- store i8 4, i8* %P2
- br i1 true, label %Loop, label %Out
-Out: ; preds = %Loop
- ret void
-}
-
diff --git a/release_23/test/Transforms/LICM/2003-05-02-LoadHoist.ll b/release_23/test/Transforms/LICM/2003-05-02-LoadHoist.ll
deleted file mode 100644
index 35fb420408a0..000000000000
--- a/release_23/test/Transforms/LICM/2003-05-02-LoadHoist.ll
+++ /dev/null
@@ -1,23 +0,0 @@
-; This testcase tests for a problem where LICM hoists loads out of a loop
-; despite the fact that calls to unknown functions may modify what is being
-; loaded from. Basically if the load gets hoisted, the subtract gets turned
-; into a constant zero.
-;
-; RUN: llvm-as < %s | opt -licm -load-vn -gcse -instcombine | llvm-dis | grep load
-
-@X = global i32 7 ; <i32*> [#uses=2]
-
-declare void @foo()
-
-define i32 @test(i1 %c) {
- %A = load i32* @X ; <i32> [#uses=1]
- br label %Loop
-Loop: ; preds = %Loop, %0
- call void @foo( )
- ;; Should not hoist this load!
- %B = load i32* @X ; <i32> [#uses=1]
- br i1 %c, label %Loop, label %Out
-Out: ; preds = %Loop
- %C = sub i32 %A, %B ; <i32> [#uses=1]
- ret i32 %C
-}
diff --git a/release_23/test/Transforms/LICM/2003-08-04-TrappingInstHoist.ll b/release_23/test/Transforms/LICM/2003-08-04-TrappingInstHoist.ll
deleted file mode 100644
index a00eb8c7a63c..000000000000
--- a/release_23/test/Transforms/LICM/2003-08-04-TrappingInstHoist.ll
+++ /dev/null
@@ -1,26 +0,0 @@
-; This testcase tests for a problem where LICM hoists
-; potentially trapping instructions when they are not guaranteed to execute.
-;
-; RUN: llvm-as < %s | opt -licm | llvm-dis | %prcontext "IfUnEqual" 2 | grep div
-
-@X = global i32 0 ; <i32*> [#uses=1]
-
-declare void @foo()
-
-define i32 @test(i1 %c) {
- %A = load i32* @X ; <i32> [#uses=2]
- br label %Loop
-Loop: ; preds = %LoopTail, %0
- call void @foo( )
- br i1 %c, label %LoopTail, label %IfUnEqual
-IfUnEqual: ; preds = %Loop
- %B1 = sdiv i32 4, %A ; <i32> [#uses=1]
- br label %LoopTail
-LoopTail: ; preds = %IfUnEqual, %Loop
- %B = phi i32 [ 0, %Loop ], [ %B1, %IfUnEqual ] ; <i32> [#uses=1]
- br i1 %c, label %Loop, label %Out
-Out: ; preds = %LoopTail
- %C = sub i32 %A, %B ; <i32> [#uses=1]
- ret i32 %C
-}
-
diff --git a/release_23/test/Transforms/LICM/2003-08-04-TrappingInstOkHoist.ll b/release_23/test/Transforms/LICM/2003-08-04-TrappingInstOkHoist.ll
deleted file mode 100644
index 59cc0d662071..000000000000
--- a/release_23/test/Transforms/LICM/2003-08-04-TrappingInstOkHoist.ll
+++ /dev/null
@@ -1,21 +0,0 @@
-; This testcase tests to make sure a trapping instruction is hoisted when
-; it is guaranteed to execute.
-;
-; RUN: llvm-as < %s | opt -licm | llvm-dis | %prcontext "test" 2 | grep div
-
-@X = global i32 0 ; <i32*> [#uses=1]
-
-declare void @foo(i32)
-
-define i32 @test(i1 %c) {
- %A = load i32* @X ; <i32> [#uses=2]
- br label %Loop
-Loop: ; preds = %Loop, %0
- ;; Should have hoisted this div!
- %B = sdiv i32 4, %A ; <i32> [#uses=2]
- call void @foo( i32 %B )
- br i1 %c, label %Loop, label %Out
-Out: ; preds = %Loop
- %C = sub i32 %A, %B ; <i32> [#uses=1]
- ret i32 %C
-}
diff --git a/release_23/test/Transforms/LICM/2003-12-11-SinkingToPHI.ll b/release_23/test/Transforms/LICM/2003-12-11-SinkingToPHI.ll
deleted file mode 100644
index e491c9aee479..000000000000
--- a/release_23/test/Transforms/LICM/2003-12-11-SinkingToPHI.ll
+++ /dev/null
@@ -1,16 +0,0 @@
-; RUN: llvm-as < %s | opt -licm | lli
-
-define i32 @main() {
-entry:
- br label %Loop
-Loop: ; preds = %LoopCont, %entry
- br i1 true, label %LoopCont, label %Out
-LoopCont: ; preds = %Loop
- %X = add i32 1, 0 ; <i32> [#uses=1]
- br i1 true, label %Out, label %Loop
-Out: ; preds = %LoopCont, %Loop
- %V = phi i32 [ 2, %Loop ], [ %X, %LoopCont ] ; <i32> [#uses=1]
- %V2 = sub i32 %V, 1 ; <i32> [#uses=1]
- ret i32 %V2
-}
-
diff --git a/release_23/test/Transforms/LICM/2003-12-13-VolatilePromote.ll b/release_23/test/Transforms/LICM/2003-12-13-VolatilePromote.ll
deleted file mode 100644
index 85c93c62bf5c..000000000000
--- a/release_23/test/Transforms/LICM/2003-12-13-VolatilePromote.ll
+++ /dev/null
@@ -1,16 +0,0 @@
-; RUN: llvm-as < %s | opt -licm | llvm-dis | %prcontext volatile 1 | grep Loop
-
-@X = global i32 7 ; <i32*> [#uses=2]
-
-define void @testfunc(i32 %i) {
- br label %Loop
-Loop: ; preds = %Loop, %0
- ; Should not promote this to a register
- %x = volatile load i32* @X ; <i32> [#uses=1]
- %x2 = add i32 %x, 1 ; <i32> [#uses=1]
- store i32 %x2, i32* @X
- br i1 true, label %Out, label %Loop
-Out: ; preds = %Loop
- ret void
-}
-
diff --git a/release_23/test/Transforms/LICM/2004-09-14-AliasAnalysisInvalidate.ll b/release_23/test/Transforms/LICM/2004-09-14-AliasAnalysisInvalidate.ll
deleted file mode 100644
index b9c9eb373999..000000000000
--- a/release_23/test/Transforms/LICM/2004-09-14-AliasAnalysisInvalidate.ll
+++ /dev/null
@@ -1,19 +0,0 @@
-; RUN: llvm-as < %s | opt -globalsmodref-aa -licm -disable-output
-
-@PL_regcomp_parse = internal global i8* null ; <i8**> [#uses=2]
-
-define void @test() {
- br label %Outer
-Outer: ; preds = %Next, %0
- br label %Inner
-Inner: ; preds = %Inner, %Outer
- %tmp.114.i.i.i = load i8** @PL_regcomp_parse ; <i8*> [#uses=1]
- %tmp.115.i.i.i = load i8* %tmp.114.i.i.i ; <i8> [#uses=0]
- store i8* null, i8** @PL_regcomp_parse
- br i1 false, label %Inner, label %Next
-Next: ; preds = %Inner
- br i1 false, label %Outer, label %Exit
-Exit: ; preds = %Next
- ret void
-}
-
diff --git a/release_23/test/Transforms/LICM/2004-11-17-UndefIndexCrash.ll b/release_23/test/Transforms/LICM/2004-11-17-UndefIndexCrash.ll
deleted file mode 100644
index 9a53d95996a7..000000000000
--- a/release_23/test/Transforms/LICM/2004-11-17-UndefIndexCrash.ll
+++ /dev/null
@@ -1,20 +0,0 @@
-; RUN: llvm-as < %s | opt -licm -disable-output
- %struct.roadlet = type { i8*, %struct.vehicle*, [8 x %struct.roadlet*], [8 x %struct.roadlet* (%struct.roadlet*, %struct.vehicle*, i32)*] }
- %struct.vehicle = type { %struct.roadlet*, i8*, i32, i32, %union.._631., i32 }
- %union.._631. = type { i32 }
-
-declare %struct.roadlet* @_Z11return_nullP7roadletP7vehicle9direction(%struct.roadlet*, %struct.vehicle*, i32)
-
-declare %struct.roadlet* @_Z14lane_switch_okP7roadletP7vehicle9direction(%struct.roadlet*, %struct.vehicle*, i32)
-
-define void @main() {
-__main.entry:
- br label %invoke_cont.3
-invoke_cont.3: ; preds = %invoke_cont.3, %__main.entry
- %tmp.34.i.i502.7 = getelementptr %struct.roadlet* null, i32 0, i32 3, i32 7 ; <%struct.roadlet* (%struct.roadlet*, %struct.vehicle*, i32)**> [#uses=1]
- store %struct.roadlet* (%struct.roadlet*, %struct.vehicle*, i32)* @_Z11return_nullP7roadletP7vehicle9direction, %struct.roadlet* (%struct.roadlet*, %struct.vehicle*, i32)** %tmp.34.i.i502.7
- store %struct.roadlet* (%struct.roadlet*, %struct.vehicle*, i32)* @_Z14lane_switch_okP7roadletP7vehicle9direction, %struct.roadlet* (%struct.roadlet*, %struct.vehicle*, i32)** null
- %tmp.4.i.i339 = getelementptr %struct.roadlet* null, i32 0, i32 3, i32 undef ; <%struct.roadlet* (%struct.roadlet*, %struct.vehicle*, i32)**> [#uses=1]
- store %struct.roadlet* (%struct.roadlet*, %struct.vehicle*, i32)* @_Z11return_nullP7roadletP7vehicle9direction, %struct.roadlet* (%struct.roadlet*, %struct.vehicle*, i32)** %tmp.4.i.i339
- br label %invoke_cont.3
-}
diff --git a/release_23/test/Transforms/LICM/2005-03-24-LICM-Aggregate-Crash.ll b/release_23/test/Transforms/LICM/2005-03-24-LICM-Aggregate-Crash.ll
deleted file mode 100644
index b001cd0d5cd2..000000000000
--- a/release_23/test/Transforms/LICM/2005-03-24-LICM-Aggregate-Crash.ll
+++ /dev/null
@@ -1,9 +0,0 @@
-; RUN: llvm-as < %s | opt -licm -disable-output
-
-define void @test({ i32 }* %P) {
- br label %Loop
-Loop: ; preds = %Loop, %0
- free { i32 }* %P
- br label %Loop
-}
-
diff --git a/release_23/test/Transforms/LICM/2006-09-12-DeadUserOfSunkInstr.ll b/release_23/test/Transforms/LICM/2006-09-12-DeadUserOfSunkInstr.ll
deleted file mode 100644
index c2c4bcb4ab0b..000000000000
--- a/release_23/test/Transforms/LICM/2006-09-12-DeadUserOfSunkInstr.ll
+++ /dev/null
@@ -1,148 +0,0 @@
-; RUN: llvm-as < %s | opt -licm -disable-output
-; PR908
-; END.
-
- %struct.alloc_chain = type { i8*, %struct.alloc_chain* }
- %struct.oggpack_buffer = type { i32, i32, i8*, i8*, i32 }
- %struct.vorbis_block = type { float**, %struct.oggpack_buffer, i32, i32, i32, i32, i32, i32, i64, i64, %struct.vorbis_dsp_state*, i8*, i32, i32, i32, %struct.alloc_chain*, i32, i32, i32, i32, i8* }
- %struct.vorbis_dsp_state = type { i32, %struct.vorbis_info*, float**, float**, i32, i32, i32, i32, i32, i32, i32, i32, i32, i64, i64, i64, i64, i64, i64, i8* }
- %struct.vorbis_info = type { i32, i32, i32, i32, i32, i32, i32, i8* }
-
-define fastcc void @_01forward() {
-entry:
- br i1 false, label %bb222.preheader, label %bb241
-cond_true67: ; preds = %cond_true87
- br label %cond_next80
-cond_next80: ; preds = %cond_true87, %cond_true67
- br label %bb83
-bb83.preheader: ; preds = %cond_true226
- br i1 false, label %bb83.us.preheader, label %bb83.preheader1
-bb83.us.preheader: ; preds = %bb83.preheader
- br label %bb83.us
-bb83.us: ; preds = %cond_next80.us, %bb83.us.preheader
- br i1 false, label %cond_true87.us, label %cond_next92.loopexit2
-cond_next80.us: ; preds = %bb59.loopexit.us, %cond_true67.us
- br label %bb83.us
-cond_true67.us: ; preds = %bb59.loopexit.us
- br label %cond_next80.us
-cond_next.us: ; preds = %cond_true56.us, %cond_true38.us
- br i1 false, label %cond_true56.us, label %bb59.loopexit.us
-cond_true38.us: ; preds = %cond_true56.us
- br label %cond_next.us
-cond_true56.us: ; preds = %cond_true87.us, %cond_next.us
- br i1 false, label %cond_true38.us, label %cond_next.us
-cond_true87.us: ; preds = %bb83.us
- br label %cond_true56.us
-bb59.loopexit.us: ; preds = %cond_next.us
- br i1 false, label %cond_true67.us, label %cond_next80.us
-bb83.preheader1: ; preds = %bb83.preheader
- br label %bb83
-bb83: ; preds = %bb83.preheader1, %cond_next80
- br i1 false, label %cond_next92.loopexit, label %cond_true87
-cond_true87: ; preds = %bb83
- br i1 false, label %cond_true67, label %cond_next80
-cond_next92.loopexit: ; preds = %bb83
- br label %cond_next92
-cond_next92.loopexit2: ; preds = %bb83.us
- br label %cond_next92
-cond_next92: ; preds = %cond_true226, %cond_next92.loopexit2, %cond_next92.loopexit
- br i1 false, label %cond_true218.loopexit, label %bb222
-cond_true139: ; preds = %cond_true202
- br i1 false, label %cond_next195, label %cond_true155
-cond_true155: ; preds = %cond_true139
- br i1 false, label %cond_true249.i.preheader, label %_encodepart.exit
-cond_true.i: ; preds = %cond_true115.i
- br i1 false, label %bb60.i.preheader, label %cond_next97.i
-bb60.i.preheader: ; preds = %cond_true.i
- br label %bb60.i
-bb60.i: ; preds = %cond_true63.i, %bb60.i.preheader
- br i1 false, label %cond_true63.i, label %cond_next97.i.loopexit
-cond_true63.i: ; preds = %bb60.i
- br i1 false, label %bb60.i, label %cond_next97.i.loopexit
-bb86.i.preheader: ; preds = %cond_true115.i
- br label %bb86.i
-bb86.i: ; preds = %cond_true93.i, %bb86.i.preheader
- br i1 false, label %cond_true93.i, label %cond_next97.i.loopexit3
-cond_true93.i: ; preds = %bb86.i
- br i1 false, label %cond_next97.i.loopexit3, label %bb86.i
-cond_next97.i.loopexit: ; preds = %cond_true63.i, %bb60.i
- br label %cond_next97.i
-cond_next97.i.loopexit3: ; preds = %cond_true93.i, %bb86.i
- br label %cond_next97.i
-cond_next97.i: ; preds = %cond_next97.i.loopexit3, %cond_next97.i.loopexit, %cond_true.i
- br i1 false, label %bb118.i.loopexit, label %cond_true115.i
-cond_true115.i.preheader: ; preds = %cond_true249.i
- br label %cond_true115.i
-cond_true115.i: ; preds = %cond_true115.i.preheader, %cond_next97.i
- br i1 false, label %cond_true.i, label %bb86.i.preheader
-bb118.i.loopexit: ; preds = %cond_next97.i
- br label %bb118.i
-bb118.i: ; preds = %cond_true249.i, %bb118.i.loopexit
- br i1 false, label %cond_next204.i, label %cond_true128.i
-cond_true128.i: ; preds = %bb118.i
- br i1 false, label %cond_true199.i.preheader, label %cond_next204.i
-cond_true199.i.preheader: ; preds = %cond_true128.i
- br label %cond_true199.i
-cond_true199.i.us: ; No predecessors!
- br i1 false, label %cond_true167.i.us, label %cond_next187.i.us
-cond_next187.i.us: ; preds = %bb170.i.loopexit.us, %bb170.i.us.cond_next187.i.us_crit_edge, %cond_true199.i.us
- unreachable
-bb170.i.us.cond_next187.i.us_crit_edge: ; preds = %bb170.i.loopexit.us
- br label %cond_next187.i.us
-cond_true167.i.us: ; preds = %cond_true167.i.us, %cond_true199.i.us
- br i1 false, label %cond_true167.i.us, label %bb170.i.loopexit.us
-bb170.i.loopexit.us: ; preds = %cond_true167.i.us
- br i1 false, label %cond_next187.i.us, label %bb170.i.us.cond_next187.i.us_crit_edge
-cond_true199.i: ; preds = %cond_true199.i, %cond_true199.i.preheader
- br i1 false, label %cond_next204.i.loopexit, label %cond_true199.i
-cond_next204.i.loopexit: ; preds = %cond_true199.i
- br label %cond_next204.i
-cond_next204.i: ; preds = %cond_next204.i.loopexit, %cond_true128.i, %bb118.i
- br label %bb233.i
-cond_true230.i: ; No predecessors!
- %exitcond155 = icmp eq i32 0, %tmp16.i ; <i1> [#uses=0]
- unreachable
-bb233.i: ; preds = %cond_next204.i
- br i1 false, label %_encodepart.exit.loopexit, label %cond_true249.i
-cond_true249.i.preheader: ; preds = %cond_true155
- br label %cond_true249.i
-cond_true249.i: ; preds = %cond_true249.i.preheader, %bb233.i
- %tmp16.i = bitcast i32 0 to i32 ; <i32> [#uses=1]
- br i1 false, label %cond_true115.i.preheader, label %bb118.i
-_encodepart.exit.loopexit: ; preds = %bb233.i
- br label %_encodepart.exit
-_encodepart.exit: ; preds = %_encodepart.exit.loopexit, %cond_true155
- br label %cond_next195
-cond_next195: ; preds = %cond_true202, %_encodepart.exit, %cond_true139
- br i1 false, label %bb205.loopexit, label %cond_true202
-cond_true202.preheader: ; preds = %cond_true218
- br label %cond_true202
-cond_true202: ; preds = %cond_true202.preheader, %cond_next195
- br i1 false, label %cond_next195, label %cond_true139
-bb205.loopexit: ; preds = %cond_next195
- br label %bb205
-bb205: ; preds = %cond_true218, %bb205.loopexit
- br i1 false, label %cond_true218, label %bb222.outer105.loopexit
-cond_true218.loopexit: ; preds = %cond_next92
- br label %cond_true218
-cond_true218: ; preds = %cond_true218.loopexit, %bb205
- br i1 false, label %cond_true202.preheader, label %bb205
-bb222.preheader: ; preds = %entry
- br label %bb222.outer
-bb222.outer: ; preds = %bb229, %bb222.preheader
- br label %bb222.outer105
-bb222.outer105.loopexit: ; preds = %bb205
- br label %bb222.outer105
-bb222.outer105: ; preds = %bb222.outer105.loopexit, %bb222.outer
- br label %bb222
-bb222: ; preds = %bb222.outer105, %cond_next92
- br i1 false, label %cond_true226, label %bb229
-cond_true226: ; preds = %bb222
- br i1 false, label %bb83.preheader, label %cond_next92
-bb229: ; preds = %bb222
- br i1 false, label %bb222.outer, label %bb241.loopexit
-bb241.loopexit: ; preds = %bb229
- br label %bb241
-bb241: ; preds = %bb241.loopexit, %entry
- ret void
-}
diff --git a/release_23/test/Transforms/LICM/2007-05-22-VolatileSink.ll b/release_23/test/Transforms/LICM/2007-05-22-VolatileSink.ll
deleted file mode 100644
index bf5d7bc09297..000000000000
--- a/release_23/test/Transforms/LICM/2007-05-22-VolatileSink.ll
+++ /dev/null
@@ -1,56 +0,0 @@
-; RUN: llvm-as < %s | opt -licm | llvm-dis | grep {volatile store}
-; PR1435
-target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64"
-target triple = "i686-apple-darwin8"
-
-define void @Transpose(i32* %DataIn, i32* %DataOut) {
-entry:
- %buffer = alloca [64 x i32], align 16 ; <[64 x i32]*> [#uses=2]
- %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
- br label %bb6
-
-bb: ; preds = %bb6
- %tmp2 = volatile load i32* %DataIn ; <i32> [#uses=1]
- %tmp3 = getelementptr [64 x i32]* %buffer, i32 0, i32 %i.0 ; <i32*> [#uses=1]
- store i32 %tmp2, i32* %tmp3
- %tmp5 = add i32 %i.0, 1 ; <i32> [#uses=1]
- br label %bb6
-
-bb6: ; preds = %bb, %entry
- %i.0 = phi i32 [ 0, %entry ], [ %tmp5, %bb ] ; <i32> [#uses=3]
- %tmp8 = icmp sle i32 %i.0, 63 ; <i1> [#uses=1]
- %tmp89 = zext i1 %tmp8 to i8 ; <i8> [#uses=1]
- %toBool = icmp ne i8 %tmp89, 0 ; <i1> [#uses=1]
- br i1 %toBool, label %bb, label %bb30
-
-bb12: ; preds = %bb22
- %tmp14 = mul i32 %j.1, 8 ; <i32> [#uses=1]
- %tmp16 = add i32 %tmp14, %i.1 ; <i32> [#uses=1]
- %tmp17 = getelementptr [64 x i32]* %buffer, i32 0, i32 %tmp16 ; <i32*> [#uses=1]
- %tmp18 = load i32* %tmp17 ; <i32> [#uses=1]
- volatile store i32 %tmp18, i32* %DataOut
- %tmp21 = add i32 %j.1, 1 ; <i32> [#uses=1]
- br label %bb22
-
-bb22: ; preds = %bb30, %bb12
- %j.1 = phi i32 [ %tmp21, %bb12 ], [ 0, %bb30 ] ; <i32> [#uses=4]
- %tmp24 = icmp sle i32 %j.1, 7 ; <i1> [#uses=1]
- %tmp2425 = zext i1 %tmp24 to i8 ; <i8> [#uses=1]
- %toBool26 = icmp ne i8 %tmp2425, 0 ; <i1> [#uses=1]
- br i1 %toBool26, label %bb12, label %bb27
-
-bb27: ; preds = %bb22
- %tmp29 = add i32 %i.1, 1 ; <i32> [#uses=1]
- br label %bb30
-
-bb30: ; preds = %bb27, %bb6
- %j.0 = phi i32 [ %j.1, %bb27 ], [ undef, %bb6 ] ; <i32> [#uses=0]
- %i.1 = phi i32 [ %tmp29, %bb27 ], [ 0, %bb6 ] ; <i32> [#uses=3]
- %tmp32 = icmp sle i32 %i.1, 7 ; <i1> [#uses=1]
- %tmp3233 = zext i1 %tmp32 to i8 ; <i8> [#uses=1]
- %toBool34 = icmp ne i8 %tmp3233, 0 ; <i1> [#uses=1]
- br i1 %toBool34, label %bb22, label %return
-
-return: ; preds = %bb30
- ret void
-}
diff --git a/release_23/test/Transforms/LICM/2007-07-30-AliasSet.ll b/release_23/test/Transforms/LICM/2007-07-30-AliasSet.ll
deleted file mode 100644
index 110d88449464..000000000000
--- a/release_23/test/Transforms/LICM/2007-07-30-AliasSet.ll
+++ /dev/null
@@ -1,39 +0,0 @@
-; RUN: llvm-as < %s | opt -licm -loop-unswitch -disable-output
- %struct.III_scalefac_t = type { [22 x i32], [13 x [3 x i32]] }
- %struct.gr_info = type { i32, i32, i32, i32, i32, i32, i32, i32, [3 x i32], [3 x i32], i32, i32, i32, i32, i32, i32, i32, i32, i32, i32*, [4 x i32] }
-
-define i32 @scale_bitcount_lsf(%struct.III_scalefac_t* %scalefac, %struct.gr_info* %cod_info) {
-entry:
- br i1 false, label %bb28, label %bb133.preheader
-
-bb133.preheader: ; preds = %entry
- ret i32 0
-
-bb28: ; preds = %entry
- br i1 false, label %bb63.outer, label %bb79
-
-bb63.outer: ; preds = %bb73, %bb28
- br i1 false, label %bb35, label %bb73
-
-bb35: ; preds = %cond_next60, %bb63.outer
- %window.34 = phi i32 [ %tmp62, %cond_next60 ], [ 0, %bb63.outer ] ; <i32> [#uses=1]
- %tmp44 = getelementptr [4 x i32]* null, i32 0, i32 0 ; <i32*> [#uses=1]
- %tmp46 = load i32* %tmp44, align 4 ; <i32> [#uses=0]
- br i1 false, label %cond_true50, label %cond_next60
-
-cond_true50: ; preds = %bb35
- %tmp59 = getelementptr [4 x i32]* null, i32 0, i32 0 ; <i32*> [#uses=1]
- store i32 0, i32* %tmp59, align 4
- br label %cond_next60
-
-cond_next60: ; preds = %cond_true50, %bb35
- %tmp62 = add i32 %window.34, 1 ; <i32> [#uses=1]
- br i1 false, label %bb35, label %bb73
-
-bb73: ; preds = %cond_next60, %bb63.outer
- %tmp76 = icmp slt i32 0, 0 ; <i1> [#uses=1]
- br i1 %tmp76, label %bb63.outer, label %bb79
-
-bb79: ; preds = %bb73, %bb28
- ret i32 0
-}
diff --git a/release_23/test/Transforms/LICM/2007-09-17-PromoteValue.ll b/release_23/test/Transforms/LICM/2007-09-17-PromoteValue.ll
deleted file mode 100644
index e9ba9e16318f..000000000000
--- a/release_23/test/Transforms/LICM/2007-09-17-PromoteValue.ll
+++ /dev/null
@@ -1,61 +0,0 @@
-; ModuleID = 'PR1657.bc'
-; Do not promote getelementptr because it may exposes load from a null pointer
-; and store from a null pointer which are covered by
-; icmp eq %struct.decision* null, null condition.
-; RUN: llvm-as < %s | opt -licm | llvm-dis | not grep promoted
- %struct.decision = type { i8, %struct.decision* }
-
-define i32 @main() {
-entry:
- br label %blah.i
-
-blah.i: ; preds = %cond_true.i, %entry
- %tmp3.i = icmp eq %struct.decision* null, null ; <i1> [#uses=1]
- br i1 %tmp3.i, label %clear_modes.exit, label %cond_true.i
-
-cond_true.i: ; preds = %blah.i
- %tmp1.i = getelementptr %struct.decision* null, i32 0, i32 0 ; <i8*> [#uses=1]
- store i8 0, i8* %tmp1.i
- br label %blah.i
-
-clear_modes.exit: ; preds = %blah.i
- call void @exit( i32 0 )
- unreachable
-}
-
-define i32 @f(i8* %ptr) {
-entry:
- br label %loop.head
-
-loop.head: ; preds = %cond.true, %entry
- %x = phi i8* [ %ptr, %entry ], [ %ptr.i, %cond.true ] ; <i8*> [#uses=1]
- %tmp3.i = icmp ne i8* %ptr, %x ; <i1> [#uses=1]
- br i1 %tmp3.i, label %cond.true, label %exit
-
-cond.true: ; preds = %loop.head
- %ptr.i = getelementptr i8* %ptr, i32 0 ; <i8*> [#uses=2]
- store i8 0, i8* %ptr.i
- br label %loop.head
-
-exit: ; preds = %loop.head
- ret i32 0
-}
-
-define i32 @f2(i8* %p, i8* %q) {
-entry:
- br label %loop.head
-
-loop.head: ; preds = %cond.true, %entry
- %tmp3.i = icmp eq i8* null, %q ; <i1> [#uses=1]
- br i1 %tmp3.i, label %exit, label %cond.true
-
-cond.true: ; preds = %loop.head
- %ptr.i = getelementptr i8* %p, i32 0 ; <i8*> [#uses=2]
- store i8 0, i8* %ptr.i
- br label %loop.head
-
-exit: ; preds = %loop.head
- ret i32 0
-}
-
-declare void @exit(i32)
diff --git a/release_23/test/Transforms/LICM/2007-09-24-PromoteNullValue.ll b/release_23/test/Transforms/LICM/2007-09-24-PromoteNullValue.ll
deleted file mode 100644
index f9f45f389b8a..000000000000
--- a/release_23/test/Transforms/LICM/2007-09-24-PromoteNullValue.ll
+++ /dev/null
@@ -1,46 +0,0 @@
-; Do not promote null value because it may be unsafe to do so.
-; RUN: llvm-as < %s | opt -licm | llvm-dis | not grep promoted
-
-define i32 @f(i32 %foo, i32 %bar, i32 %com) {
-entry:
- %tmp2 = icmp eq i32 %foo, 0 ; <i1> [#uses=1]
- br i1 %tmp2, label %cond_next, label %cond_true
-
-cond_true: ; preds = %entry
- br label %return
-
-cond_next: ; preds = %entry
- br label %bb
-
-bb: ; preds = %bb15, %cond_next
- switch i32 %bar, label %bb15 [
- i32 1, label %bb6
- ]
-
-bb6: ; preds = %bb
- %tmp8 = icmp eq i32 %com, 0 ; <i1> [#uses=1]
- br i1 %tmp8, label %cond_next14, label %cond_true11
-
-cond_true11: ; preds = %bb6
- br label %return
-
-cond_next14: ; preds = %bb6
- store i8 0, i8* null
- br label %bb15
-
-bb15: ; preds = %cond_next14, %bb
- br label %bb
-
-return: ; preds = %cond_true11, %cond_true
- %storemerge = phi i32 [ 0, %cond_true ], [ undef, %cond_true11 ] ; <i32> [#uses=1]
- ret i32 %storemerge
-}
-
-define i32 @kdMain() {
-entry:
- %tmp1 = call i32 @f( i32 0, i32 1, i32 1 ) ; <i32> [#uses=0]
- call void @exit( i32 0 )
- unreachable
-}
-
-declare void @exit(i32)
diff --git a/release_23/test/Transforms/LICM/2007-10-01-PromoteSafeValue.ll b/release_23/test/Transforms/LICM/2007-10-01-PromoteSafeValue.ll
deleted file mode 100644
index 7359cc0695ad..000000000000
--- a/release_23/test/Transforms/LICM/2007-10-01-PromoteSafeValue.ll
+++ /dev/null
@@ -1,21 +0,0 @@
-; RUN: llvm-as < %s | opt -licm | llvm-dis | grep promoted
-; Promote value if at least one use is safe
-
-
-define i32 @f2(i32* %p, i8* %q) {
-entry:
- br label %loop.head
-
-loop.head: ; preds = %cond.true, %entry
- store i32 20, i32* %p
- %tmp3.i = icmp eq i8* null, %q ; <i1> [#uses=1]
- br i1 %tmp3.i, label %exit, label %cond.true
-
-cond.true: ; preds = %loop.head
- store i32 40, i32* %p
- br label %loop.head
-
-exit: ; preds = %loop.head
- ret i32 0
-}
-
diff --git a/release_23/test/Transforms/LICM/Preserve-LCSSA.ll b/release_23/test/Transforms/LICM/Preserve-LCSSA.ll
deleted file mode 100644
index 850d071810ef..000000000000
--- a/release_23/test/Transforms/LICM/Preserve-LCSSA.ll
+++ /dev/null
@@ -1,25 +0,0 @@
-; RUN: llvm-as < %s | opt -loop-rotate -licm -loop-unswitch -disable-output
-
-define i32 @stringSearch_Clib(i32 %count) {
-entry:
- br i1 false, label %bb36, label %bb44
-
-bb4: ; preds = %bb36
- br i1 false, label %cond_next, label %cond_true
-
-cond_true: ; preds = %bb4
- ret i32 0
-
-cond_next: ; preds = %bb4
- ret i32 0
-
-bb36: ; preds = %bb41, %entry
- br i1 false, label %bb4, label %bb41
-
-bb41: ; preds = %bb36
- %ttmp2 = icmp slt i32 0, %count ; <i1> [#uses=1]
- br i1 %ttmp2, label %bb36, label %bb44
-
-bb44: ; preds = %bb41, %entry
- ret i32 0
-}
diff --git a/release_23/test/Transforms/LICM/basictest.ll b/release_23/test/Transforms/LICM/basictest.ll
deleted file mode 100644
index 0a57ce4539fe..000000000000
--- a/release_23/test/Transforms/LICM/basictest.ll
+++ /dev/null
@@ -1,15 +0,0 @@
-; RUN: llvm-as < %s | opt -licm | llvm-dis
-
-define void @testfunc(i32 %i) {
-; <label>:0
- br label %Loop
-Loop: ; preds = %Loop, %0
- %j = phi i32 [ 0, %0 ], [ %Next, %Loop ] ; <i32> [#uses=1]
- %i2 = mul i32 %i, 17 ; <i32> [#uses=1]
- %Next = add i32 %j, %i2 ; <i32> [#uses=2]
- %cond = icmp eq i32 %Next, 0 ; <i1> [#uses=1]
- br i1 %cond, label %Out, label %Loop
-Out: ; preds = %Loop
- ret void
-}
-
diff --git a/release_23/test/Transforms/LICM/call_sink_const_function.ll b/release_23/test/Transforms/LICM/call_sink_const_function.ll
deleted file mode 100644
index f187e27335ba..000000000000
--- a/release_23/test/Transforms/LICM/call_sink_const_function.ll
+++ /dev/null
@@ -1,17 +0,0 @@
-; RUN: llvm-as < %s | opt -basicaa -licm | llvm-dis | %prcontext sin 1 | grep Out:
-
-declare double @sin(double) readnone
-
-declare void @foo()
-
-define double @test(double %X) {
- br label %Loop
-
-Loop: ; preds = %Loop, %0
- call void @foo( )
- %A = call double @sin( double %X ) readnone ; <double> [#uses=1]
- br i1 true, label %Loop, label %Out
-
-Out: ; preds = %Loop
- ret double %A
-}
diff --git a/release_23/test/Transforms/LICM/call_sink_pure_function.ll b/release_23/test/Transforms/LICM/call_sink_pure_function.ll
deleted file mode 100644
index c0457a17fc4e..000000000000
--- a/release_23/test/Transforms/LICM/call_sink_pure_function.ll
+++ /dev/null
@@ -1,16 +0,0 @@
-; RUN: llvm-as < %s | opt -basicaa -licm | llvm-dis | %prcontext strlen 1 | grep Out:
-
-declare i32 @strlen(i8*) readonly
-
-declare void @foo()
-
-define i32 @test(i8* %P) {
- br label %Loop
-
-Loop: ; preds = %Loop, %0
- %A = call i32 @strlen( i8* %P ) readonly ; <i32> [#uses=1]
- br i1 false, label %Loop, label %Out
-
-Out: ; preds = %Loop
- ret i32 %A
-}
diff --git a/release_23/test/Transforms/LICM/dg.exp b/release_23/test/Transforms/LICM/dg.exp
deleted file mode 100644
index 879685ca879d..000000000000
--- a/release_23/test/Transforms/LICM/dg.exp
+++ /dev/null
@@ -1,3 +0,0 @@
-load_lib llvm.exp
-
-RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
diff --git a/release_23/test/Transforms/LICM/no-preheader-test.ll b/release_23/test/Transforms/LICM/no-preheader-test.ll
deleted file mode 100644
index 6ea08612ea86..000000000000
--- a/release_23/test/Transforms/LICM/no-preheader-test.ll
+++ /dev/null
@@ -1,20 +0,0 @@
-; Test that LICM works when there is not a loop-preheader
-; RUN: llvm-as < %s | opt -licm | llvm-dis
-
-define void @testfunc(i32 %i.s, i1 %ifcond) {
- br i1 %ifcond, label %Then, label %Else
-Then: ; preds = %0
- br label %Loop
-Else: ; preds = %0
- br label %Loop
-Loop: ; preds = %Loop, %Else, %Then
- %j = phi i32 [ 0, %Then ], [ 12, %Else ], [ %Next, %Loop ] ; <i32> [#uses=1]
- %i = bitcast i32 %i.s to i32 ; <i32> [#uses=1]
- %i2 = mul i32 %i, 17 ; <i32> [#uses=1]
- %Next = add i32 %j, %i2 ; <i32> [#uses=2]
- %cond = icmp eq i32 %Next, 0 ; <i1> [#uses=1]
- br i1 %cond, label %Out, label %Loop
-Out: ; preds = %Loop
- ret void
-}
-
diff --git a/release_23/test/Transforms/LICM/scalar_promote.ll b/release_23/test/Transforms/LICM/scalar_promote.ll
deleted file mode 100644
index f6c0f0821a30..000000000000
--- a/release_23/test/Transforms/LICM/scalar_promote.ll
+++ /dev/null
@@ -1,35 +0,0 @@
-; RUN: llvm-as < %s | opt -licm -disable-output -stats |& \
-; RUN: grep {memory locations promoted to register}
-@X = global i32 7 ; <i32*> [#uses=4]
-
-define void @testfunc(i32 %i) {
-; <label>:0
- br label %Loop
-
-Loop: ; preds = %Loop, %0
- %j = phi i32 [ 0, %0 ], [ %Next, %Loop ] ; <i32> [#uses=1]
- %x = load i32* @X ; <i32> [#uses=1]
- %x2 = add i32 %x, 1 ; <i32> [#uses=1]
- store i32 %x2, i32* @X
- %Next = add i32 %j, 1 ; <i32> [#uses=2]
- %cond = icmp eq i32 %Next, 0 ; <i1> [#uses=1]
- br i1 %cond, label %Out, label %Loop
-
-Out: ; preds = %Loop
- ret void
-}
-
-define void @testhard(i32 %i) {
- br label %Loop
-
-Loop: ; preds = %Loop, %0
- %X1 = getelementptr i32* @X, i64 0 ; <i32*> [#uses=1]
- %A = load i32* %X1 ; <i32> [#uses=1]
- %V = add i32 %A, 1 ; <i32> [#uses=1]
- %X2 = getelementptr i32* @X, i64 0 ; <i32*> [#uses=1]
- store i32 %V, i32* %X2
- br i1 false, label %Loop, label %Exit
-
-Exit: ; preds = %Loop
- ret void
-}
diff --git a/release_23/test/Transforms/LICM/sink_critical_edge.ll b/release_23/test/Transforms/LICM/sink_critical_edge.ll
deleted file mode 100644
index 6998ab1580c3..000000000000
--- a/release_23/test/Transforms/LICM/sink_critical_edge.ll
+++ /dev/null
@@ -1,16 +0,0 @@
-; This testcase checks to make sure the sinker does not cause problems with
-; critical edges.
-
-; RUN: llvm-as < %s | opt -licm | llvm-dis | %prcontext add 1 | grep Exit
-
-define void @test() {
-Entry:
- br i1 false, label %Loop, label %Exit
-Loop: ; preds = %Loop, %Entry
- %X = add i32 0, 1 ; <i32> [#uses=1]
- br i1 false, label %Loop, label %Exit
-Exit: ; preds = %Loop, %Entry
- %Y = phi i32 [ 0, %Entry ], [ %X, %Loop ] ; <i32> [#uses=0]
- ret void
-}
-
diff --git a/release_23/test/Transforms/LICM/sink_inst.ll b/release_23/test/Transforms/LICM/sink_inst.ll
deleted file mode 100644
index e634c753f361..000000000000
--- a/release_23/test/Transforms/LICM/sink_inst.ll
+++ /dev/null
@@ -1,20 +0,0 @@
-; If the result of an instruction is only used outside of the loop, sink
-; the instruction to the exit blocks instead of executing it on every
-; iteration of the loop.
-;
-; RUN: llvm-as < %s | opt -licm | llvm-dis | %prcontext mul 1 | grep Out:
-
-define i32 @test(i32 %N) {
-Entry:
- br label %Loop
-Loop: ; preds = %Loop, %Entry
- %N_addr.0.pn = phi i32 [ %dec, %Loop ], [ %N, %Entry ] ; <i32> [#uses=3]
- %tmp.6 = mul i32 %N, %N_addr.0.pn ; <i32> [#uses=1]
- %tmp.7 = sub i32 %tmp.6, %N ; <i32> [#uses=1]
- %dec = add i32 %N_addr.0.pn, -1 ; <i32> [#uses=1]
- %tmp.1 = icmp ne i32 %N_addr.0.pn, 1 ; <i1> [#uses=1]
- br i1 %tmp.1, label %Loop, label %Out
-Out: ; preds = %Loop
- ret i32 %tmp.7
-}
-
diff --git a/release_23/test/Transforms/LICM/sink_load.ll b/release_23/test/Transforms/LICM/sink_load.ll
deleted file mode 100644
index 87334840e054..000000000000
--- a/release_23/test/Transforms/LICM/sink_load.ll
+++ /dev/null
@@ -1,21 +0,0 @@
-; To reduce register pressure, if a load is hoistable out of the loop, and the
-; result of the load is only used outside of the loop, sink the load instead of
-; hoisting it!
-;
-; RUN: llvm-as < %s | opt -licm | llvm-dis | %prcontext load 1 | grep Out:
-
-@X = global i32 5 ; <i32*> [#uses=1]
-
-define i32 @test(i32 %N) {
-Entry:
- br label %Loop
-Loop: ; preds = %Loop, %Entry
- %N_addr.0.pn = phi i32 [ %dec, %Loop ], [ %N, %Entry ] ; <i32> [#uses=2]
- %tmp.6 = load i32* @X ; <i32> [#uses=1]
- %dec = add i32 %N_addr.0.pn, -1 ; <i32> [#uses=1]
- %tmp.1 = icmp ne i32 %N_addr.0.pn, 1 ; <i1> [#uses=1]
- br i1 %tmp.1, label %Loop, label %Out
-Out: ; preds = %Loop
- ret i32 %tmp.6
-}
-
diff --git a/release_23/test/Transforms/LICM/sink_multiple.ll b/release_23/test/Transforms/LICM/sink_multiple.ll
deleted file mode 100644
index c9341704738f..000000000000
--- a/release_23/test/Transforms/LICM/sink_multiple.ll
+++ /dev/null
@@ -1,21 +0,0 @@
-; The loop sinker was running from the bottom of the loop to the top, causing
-; it to miss opportunities to sink instructions that depended on sinking other
-; instructions from the loop. Instead they got hoisted, which is better than
-; leaving them in the loop, but increases register pressure pointlessly.
-
-; RUN: llvm-as < %s | opt -licm | llvm-dis | \
-; RUN: %prcontext getelementptr 1 | grep Out:
-
- %Ty = type { i32, i32 }
-@X = external global %Ty ; <%Ty*> [#uses=1]
-
-define i32 @test() {
- br label %Loop
-Loop: ; preds = %Loop, %0
- %dead = getelementptr %Ty* @X, i64 0, i32 0 ; <i32*> [#uses=1]
- %sunk2 = load i32* %dead ; <i32> [#uses=1]
- br i1 false, label %Loop, label %Out
-Out: ; preds = %Loop
- ret i32 %sunk2
-}
-
diff --git a/release_23/test/Transforms/LICM/sink_multiple_exits.ll b/release_23/test/Transforms/LICM/sink_multiple_exits.ll
deleted file mode 100644
index 2882fa4b0af7..000000000000
--- a/release_23/test/Transforms/LICM/sink_multiple_exits.ll
+++ /dev/null
@@ -1,24 +0,0 @@
-; This testcase ensures that we can sink instructions from loops with
-; multiple exits.
-;
-; RUN: llvm-as < %s | opt -licm | llvm-dis | \
-; RUN: %prcontext mul 1 | grep {Out\[12\]:}
-
-define i32 @test(i32 %N, i1 %C) {
-Entry:
- br label %Loop
-Loop: ; preds = %ContLoop, %Entry
- %N_addr.0.pn = phi i32 [ %dec, %ContLoop ], [ %N, %Entry ] ; <i32> [#uses=3]
- %tmp.6 = mul i32 %N, %N_addr.0.pn ; <i32> [#uses=1]
- %tmp.7 = sub i32 %tmp.6, %N ; <i32> [#uses=2]
- %dec = add i32 %N_addr.0.pn, -1 ; <i32> [#uses=1]
- br i1 %C, label %ContLoop, label %Out1
-ContLoop: ; preds = %Loop
- %tmp.1 = icmp ne i32 %N_addr.0.pn, 1 ; <i1> [#uses=1]
- br i1 %tmp.1, label %Loop, label %Out2
-Out1: ; preds = %Loop
- ret i32 %tmp.7
-Out2: ; preds = %ContLoop
- ret i32 %tmp.7
-}
-
diff --git a/release_23/test/Transforms/LICM/sink_only_some_exits.ll b/release_23/test/Transforms/LICM/sink_only_some_exits.ll
deleted file mode 100644
index 42cfece56c91..000000000000
--- a/release_23/test/Transforms/LICM/sink_only_some_exits.ll
+++ /dev/null
@@ -1,23 +0,0 @@
-; This testcase checks to make sure we can sink values which are only live on
-; some exits out of the loop, and that we can do so without breaking dominator
-; info.
-;
-; RUN: llvm-as < %s | opt -licm | llvm-dis | \
-; RUN: %prcontext add 1 | grep exit2:
-
-define i32 @test(i1 %C1, i1 %C2, i32* %P, i32* %Q) {
-Entry:
- br label %Loop
-Loop: ; preds = %Cont, %Entry
- br i1 %C1, label %Cont, label %exit1
-Cont: ; preds = %Loop
- %X = load i32* %P ; <i32> [#uses=2]
- store i32 %X, i32* %Q
- %V = add i32 %X, 1 ; <i32> [#uses=1]
- br i1 %C2, label %Loop, label %exit2
-exit1: ; preds = %Loop
- ret i32 0
-exit2: ; preds = %Cont
- ret i32 %V
-}
-
diff --git a/release_23/test/Transforms/LICM/sink_phi_node_use.ll b/release_23/test/Transforms/LICM/sink_phi_node_use.ll
deleted file mode 100644
index 6e558bb1e497..000000000000
--- a/release_23/test/Transforms/LICM/sink_phi_node_use.ll
+++ /dev/null
@@ -1,21 +0,0 @@
-; RUN: llvm-as < %s | opt -licm | llvm-dis | %prcontext add 1 | grep preheader.loopexit:
-
-define void @test() {
-loopentry.2.i:
- br i1 false, label %no_exit.1.i.preheader, label %loopentry.3.i.preheader
-no_exit.1.i.preheader: ; preds = %loopentry.2.i
- br label %no_exit.1.i
-no_exit.1.i: ; preds = %endif.8.i, %no_exit.1.i.preheader
- br i1 false, label %return.i, label %endif.8.i
-endif.8.i: ; preds = %no_exit.1.i
- %inc.1.i = add i32 0, 1 ; <i32> [#uses=1]
- br i1 false, label %no_exit.1.i, label %loopentry.3.i.preheader.loopexit
-loopentry.3.i.preheader.loopexit: ; preds = %endif.8.i
- br label %loopentry.3.i.preheader
-loopentry.3.i.preheader: ; preds = %loopentry.3.i.preheader.loopexit, %loopentry.2.i
- %arg_num.0.i.ph13000 = phi i32 [ 0, %loopentry.2.i ], [ %inc.1.i, %loopentry.3.i.preheader.loopexit ] ; <i32> [#uses=0]
- ret void
-return.i: ; preds = %no_exit.1.i
- ret void
-}
-
diff --git a/release_23/test/Transforms/LICM/sink_trapping_inst.ll b/release_23/test/Transforms/LICM/sink_trapping_inst.ll
deleted file mode 100644
index 8e79039efe4b..000000000000
--- a/release_23/test/Transforms/LICM/sink_trapping_inst.ll
+++ /dev/null
@@ -1,18 +0,0 @@
-; Potentially trapping instructions may be sunk as long as they are guaranteed
-; to be executed.
-;
-; RUN: llvm-as < %s | opt -licm | llvm-dis | %prcontext div 1 | grep Out:
-
-define i32 @test(i32 %N) {
-Entry:
- br label %Loop
-Loop: ; preds = %Loop, %Entry
- %N_addr.0.pn = phi i32 [ %dec, %Loop ], [ %N, %Entry ] ; <i32> [#uses=3]
- %tmp.6 = sdiv i32 %N, %N_addr.0.pn ; <i32> [#uses=1]
- %dec = add i32 %N_addr.0.pn, -1 ; <i32> [#uses=1]
- %tmp.1 = icmp ne i32 %N_addr.0.pn, 0 ; <i1> [#uses=1]
- br i1 %tmp.1, label %Loop, label %Out
-Out: ; preds = %Loop
- ret i32 %tmp.6
-}
-
diff --git a/release_23/test/Transforms/LoopDeletion/2007-07-23-InfiniteLoop.ll b/release_23/test/Transforms/LoopDeletion/2007-07-23-InfiniteLoop.ll
deleted file mode 100644
index ecba2f47b187..000000000000
--- a/release_23/test/Transforms/LoopDeletion/2007-07-23-InfiniteLoop.ll
+++ /dev/null
@@ -1,13 +0,0 @@
-; RUN: llvm-as < %s | opt -loop-deletion | llvm-dis | grep switch
-; PR 1564
-
-define fastcc void @out() {
- start:
- br label %loop
- unreachable:
- unreachable
- loop:
- switch i32 0, label %unreachable [
- i32 0, label %loop
- ]
-}
diff --git a/release_23/test/Transforms/LoopDeletion/2008-05-06-Phi.ll b/release_23/test/Transforms/LoopDeletion/2008-05-06-Phi.ll
deleted file mode 100644
index 4a6ad64227d6..000000000000
--- a/release_23/test/Transforms/LoopDeletion/2008-05-06-Phi.ll
+++ /dev/null
@@ -1,109 +0,0 @@
-; RUN: llvm-as < %s | opt -inline -tailduplicate -instcombine -jump-threading -licm -loop-unswitch -instcombine -indvars -loop-deletion -gvn -simplifycfg -verify
-
-target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
-target triple = "i386-apple-darwin9"
- %struct.BF_BitstreamElement = type { i32, i16 }
- %struct.BF_BitstreamPart = type { i32, %struct.BF_BitstreamElement* }
- %struct.BF_PartHolder = type { i32, %struct.BF_BitstreamPart* }
- %struct.Bit_stream_struc = type { i8*, i32, %struct.FILE*, i8*, i32, i32, i32, i32 }
- %struct.FILE = type { i8*, i32, i32, i16, i16, %struct.__sbuf, i32, i8*, i32 (i8*)*, i32 (i8*, i8*, i32)*, i64 (i8*, i64, i32)*, i32 (i8*, i8*, i32)*, %struct.__sbuf, %struct.__sFILEX*, i32, [3 x i8], [1 x i8], %struct.__sbuf, i32, i64 }
- %struct.III_scalefac_t = type { [22 x i32], [13 x [3 x i32]] }
- %struct.III_side_info_t = type { i32, i32, i32, [2 x [4 x i32]], [2 x %struct.anon] }
- %struct.__sFILEX = type opaque
- %struct.__sbuf = type { i8*, i32 }
- %struct.anon = type { [2 x %struct.gr_info_ss] }
- %struct.gr_info = type { i32, i32, i32, i32, i32, i32, i32, i32, [3 x i32], [3 x i32], i32, i32, i32, i32, i32, i32, i32, i32, i32, i32*, [4 x i32] }
- %struct.gr_info_ss = type { %struct.gr_info }
- %struct.lame_global_flags = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i8*, i8*, i32, i32, float, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, float, i32, i32, i32, float, float, float, float, i32, i32, i32, i32, i32, i32, i32, i32 }
-@scaleFactorsPH = external global [2 x [2 x %struct.BF_PartHolder*]] ; <[2 x [2 x %struct.BF_PartHolder*]]*> [#uses=1]
-@slen1_tab = external constant [16 x i32] ; <[16 x i32]*> [#uses=1]
-
-declare %struct.BF_PartHolder* @BF_addElement(%struct.BF_PartHolder*, %struct.BF_BitstreamElement*) nounwind
-
-define %struct.BF_PartHolder* @BF_addEntry(%struct.BF_PartHolder* %thePH, i32 %value, i32 %length) nounwind {
-entry:
- %myElement = alloca %struct.BF_BitstreamElement ; <%struct.BF_BitstreamElement*> [#uses=2]
- %tmp1 = getelementptr %struct.BF_BitstreamElement* %myElement, i32 0, i32 0 ; <i32*> [#uses=1]
- store i32 %value, i32* %tmp1, align 8
- %tmp7 = icmp eq i32 %length, 0 ; <i1> [#uses=1]
- br i1 %tmp7, label %bb13, label %bb
-
-bb: ; preds = %entry
- %tmp10 = call %struct.BF_PartHolder* @BF_addElement( %struct.BF_PartHolder* %thePH, %struct.BF_BitstreamElement* %myElement ) nounwind ; <%struct.BF_PartHolder*> [#uses=1]
- ret %struct.BF_PartHolder* %tmp10
-
-bb13: ; preds = %entry
- ret %struct.BF_PartHolder* %thePH
-}
-
-define void @III_format_bitstream(%struct.lame_global_flags* %gfp, i32 %bitsPerFrame, [2 x [576 x i32]]* %l3_enc, %struct.III_side_info_t* %l3_side, [2 x %struct.III_scalefac_t]* %scalefac, %struct.Bit_stream_struc* %in_bs) nounwind {
-entry:
- call fastcc void @encodeMainData( %struct.lame_global_flags* %gfp, [2 x [576 x i32]]* %l3_enc, %struct.III_side_info_t* %l3_side, [2 x %struct.III_scalefac_t]* %scalefac ) nounwind
- unreachable
-}
-
-define internal fastcc void @encodeMainData(%struct.lame_global_flags* %gfp, [2 x [576 x i32]]* %l3_enc, %struct.III_side_info_t* %si, [2 x %struct.III_scalefac_t]* %scalefac) nounwind {
-entry:
- %tmp69 = getelementptr %struct.lame_global_flags* %gfp, i32 0, i32 43 ; <i32*> [#uses=1]
- %tmp70 = load i32* %tmp69, align 4 ; <i32> [#uses=1]
- %tmp71 = icmp eq i32 %tmp70, 1 ; <i1> [#uses=1]
- br i1 %tmp71, label %bb352, label %bb498
-
-bb113: ; preds = %bb132
- %tmp123 = getelementptr [2 x %struct.III_scalefac_t]* %scalefac, i32 0, i32 0, i32 1, i32 %sfb.0, i32 %window.0 ; <i32*> [#uses=1]
- %tmp124 = load i32* %tmp123, align 4 ; <i32> [#uses=1]
- %tmp126 = load %struct.BF_PartHolder** %tmp80, align 4 ; <%struct.BF_PartHolder*> [#uses=1]
- %tmp128 = call %struct.BF_PartHolder* @BF_addEntry( %struct.BF_PartHolder* %tmp126, i32 %tmp124, i32 %tmp93 ) nounwind ; <%struct.BF_PartHolder*> [#uses=1]
- store %struct.BF_PartHolder* %tmp128, %struct.BF_PartHolder** %tmp80, align 4
- %tmp131 = add i32 %window.0, 1 ; <i32> [#uses=1]
- br label %bb132
-
-bb132: ; preds = %bb140, %bb113
- %window.0 = phi i32 [ %tmp131, %bb113 ], [ 0, %bb140 ] ; <i32> [#uses=3]
- %tmp134 = icmp slt i32 %window.0, 3 ; <i1> [#uses=1]
- br i1 %tmp134, label %bb113, label %bb137
-
-bb137: ; preds = %bb132
- %tmp139 = add i32 %sfb.0, 1 ; <i32> [#uses=1]
- br label %bb140
-
-bb140: ; preds = %bb341, %bb137
- %sfb.0 = phi i32 [ %tmp139, %bb137 ], [ 0, %bb341 ] ; <i32> [#uses=3]
- %tmp142 = icmp slt i32 %sfb.0, 6 ; <i1> [#uses=1]
- br i1 %tmp142, label %bb132, label %bb174
-
-bb166: ; preds = %bb174
- %tmp160 = load %struct.BF_PartHolder** %tmp80, align 4 ; <%struct.BF_PartHolder*> [#uses=1]
- %tmp162 = call %struct.BF_PartHolder* @BF_addEntry( %struct.BF_PartHolder* %tmp160, i32 0, i32 0 ) nounwind ; <%struct.BF_PartHolder*> [#uses=0]
- unreachable
-
-bb174: ; preds = %bb140
- %tmp176 = icmp slt i32 6, 12 ; <i1> [#uses=1]
- br i1 %tmp176, label %bb166, label %bb341
-
-bb341: ; preds = %bb352, %bb174
- %tmp80 = getelementptr [2 x [2 x %struct.BF_PartHolder*]]* @scaleFactorsPH, i32 0, i32 0, i32 0 ; <%struct.BF_PartHolder**> [#uses=3]
- %tmp92 = getelementptr [16 x i32]* @slen1_tab, i32 0, i32 0 ; <i32*> [#uses=1]
- %tmp93 = load i32* %tmp92, align 4 ; <i32> [#uses=1]
- br label %bb140
-
-bb352: ; preds = %entry
- %tmp354 = icmp slt i32 0, 2 ; <i1> [#uses=1]
- br i1 %tmp354, label %bb341, label %return
-
-bb498: ; preds = %entry
- ret void
-
-return: ; preds = %bb352
- ret void
-}
-
-define void @getframebits(%struct.lame_global_flags* %gfp, i32* %bitsPerFrame, i32* %mean_bits) nounwind {
-entry:
- unreachable
-}
-
-define i32 @lame_encode_buffer(%struct.lame_global_flags* %gfp, i16* %buffer_l, i16* %buffer_r, i32 %nsamples, i8* %mp3buf, i32 %mp3buf_size) nounwind {
-entry:
- unreachable
-}
diff --git a/release_23/test/Transforms/LoopDeletion/dg.exp b/release_23/test/Transforms/LoopDeletion/dg.exp
deleted file mode 100644
index 879685ca879d..000000000000
--- a/release_23/test/Transforms/LoopDeletion/dg.exp
+++ /dev/null
@@ -1,3 +0,0 @@
-load_lib llvm.exp
-
-RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
diff --git a/release_23/test/Transforms/LoopIndexSplit/2007-09-21-LoopBound.ll b/release_23/test/Transforms/LoopIndexSplit/2007-09-21-LoopBound.ll
deleted file mode 100644
index fa1ab2dd6ba1..000000000000
--- a/release_23/test/Transforms/LoopIndexSplit/2007-09-21-LoopBound.ll
+++ /dev/null
@@ -1,63 +0,0 @@
-; PR1692
-; RUN: llvm-as < %s | opt -loop-index-split -disable-output
- %struct.CLAUSE_HELP = type { i32, i32, i32, i32, i32*, i32, %struct.LIST_NODE*, %struct.LIST_NODE*, i32, i32, %struct.LITERAL_HELP**, i32, i32, i32, i32 }
- %struct.LIST_NODE = type { %struct.LIST_NODE*, i8* }
- %struct.LITERAL_HELP = type { i32, i32, i32, %struct.CLAUSE_HELP*, %struct.term* }
- %struct.anon = type { %struct.LIST_NODE* }
- %struct.st = type { %struct.subst*, %struct.LIST_NODE*, %struct.LIST_NODE*, i16, i16 }
- %struct.subst = type { %struct.subst*, i32, %struct.term* }
- %struct.term = type { i32, %struct.anon, %struct.LIST_NODE*, i32, i32 }
-
-define %struct.LIST_NODE* @inf_HyperResolvents(%struct.CLAUSE_HELP* %Clause, %struct.subst* %Subst, %struct.LIST_NODE* %Restlits, i32 %GlobalMaxVar, %struct.LIST_NODE* %FoundMap, i32 %StrictlyMaximal, { %struct.st*, [3001 x %struct.term*], [4000 x %struct.term*], i32 }* %Index, i32* %Flags, i32* %Precedence) {
-entry:
- br i1 false, label %cond_next44, label %bb37
-
-bb37: ; preds = %entry
- ret %struct.LIST_NODE* null
-
-cond_next44: ; preds = %entry
- br i1 false, label %bb29.i, label %bb.i31
-
-bb.i31: ; preds = %cond_next44
- ret %struct.LIST_NODE* null
-
-bb29.i: ; preds = %cond_next44
- br i1 false, label %cond_next89.i, label %bb34.i
-
-bb34.i: ; preds = %bb29.i
- ret %struct.LIST_NODE* null
-
-cond_next89.i: ; preds = %bb29.i
- br i1 false, label %clause_LiteralGetIndex.exit70.i, label %bb.i59.i
-
-bb.i59.i: ; preds = %cond_next89.i
- ret %struct.LIST_NODE* null
-
-clause_LiteralGetIndex.exit70.i: ; preds = %cond_next89.i
- br label %bb3.i.i
-
-bb3.i.i: ; preds = %bb3.i.i, %clause_LiteralGetIndex.exit70.i
- br i1 false, label %bb40.i.i, label %bb3.i.i
-
-subst_Apply.exit.i.i: ; preds = %bb40.i.i
- %tmp21.i.i = icmp sgt i32 %j.0.i.i, 0 ; <i1> [#uses=1]
- br i1 %tmp21.i.i, label %cond_false.i47.i, label %cond_true24.i.i
-
-cond_true24.i.i: ; preds = %subst_Apply.exit.i.i
- br label %cond_next37.i.i
-
-cond_false.i47.i: ; preds = %subst_Apply.exit.i.i
- br label %cond_next37.i.i
-
-cond_next37.i.i: ; preds = %cond_false.i47.i, %cond_true24.i.i
- %tmp39.i.i = add i32 %j.0.i.i, 1 ; <i32> [#uses=1]
- br label %bb40.i.i
-
-bb40.i.i: ; preds = %cond_next37.i.i, %bb3.i.i
- %j.0.i.i = phi i32 [ %tmp39.i.i, %cond_next37.i.i ], [ 0, %bb3.i.i ] ; <i32> [#uses=3]
- %tmp43.i.i = icmp sgt i32 %j.0.i.i, 0 ; <i1> [#uses=1]
- br i1 %tmp43.i.i, label %inf_CopyHyperElectron.exit.i, label %subst_Apply.exit.i.i
-
-inf_CopyHyperElectron.exit.i: ; preds = %bb40.i.i
- ret %struct.LIST_NODE* null
-}
diff --git a/release_23/test/Transforms/LoopIndexSplit/2007-09-24-UpdateIterationSpace.ll b/release_23/test/Transforms/LoopIndexSplit/2007-09-24-UpdateIterationSpace.ll
deleted file mode 100644
index b648cec0471c..000000000000
--- a/release_23/test/Transforms/LoopIndexSplit/2007-09-24-UpdateIterationSpace.ll
+++ /dev/null
@@ -1,57 +0,0 @@
-
-; Update loop iteraton space to eliminate condition inside loop.
-; RUN: llvm-as < %s | opt -loop-index-split | llvm-dis | not grep bothcond
-define void @test(float* %x, i32 %ndat, float** %y, float %xcen, i32 %xmin, i32 %xmax, float %sigmal, float %contribution) {
-entry:
- %tmp519 = icmp sgt i32 %xmin, %xmax ; <i1> [#uses=1]
- br i1 %tmp519, label %return, label %bb.preheader
-
-bb.preheader: ; preds = %entry
- %tmp3031 = fpext float %contribution to double ; <double> [#uses=1]
- %tmp32 = mul double %tmp3031, 5.000000e-01 ; <double> [#uses=1]
- %tmp3839 = fpext float %sigmal to double ; <double> [#uses=1]
- br label %bb
-
-bb: ; preds = %bb.preheader, %cond_next45
- %i.01.0 = phi i32 [ %tmp47, %cond_next45 ], [ %xmin, %bb.preheader ] ; <i32> [#uses=6]
- %tmp2 = icmp sgt i32 %i.01.0, -1 ; <i1> [#uses=1]
- %tmp6 = icmp slt i32 %i.01.0, %ndat ; <i1> [#uses=1]
- %bothcond = and i1 %tmp2, %tmp6 ; <i1> [#uses=1]
- br i1 %bothcond, label %cond_true9, label %cond_next45
-
-cond_true9: ; preds = %bb
- %tmp12 = getelementptr float* %x, i32 %i.01.0 ; <float*> [#uses=1]
- %tmp13 = load float* %tmp12, align 4 ; <float> [#uses=1]
- %tmp15 = sub float %xcen, %tmp13 ; <float> [#uses=1]
- %tmp16 = tail call float @fabsf( float %tmp15 ) ; <float> [#uses=1]
- %tmp18 = fdiv float %tmp16, %sigmal ; <float> [#uses=1]
- %tmp21 = load float** %y, align 4 ; <float*> [#uses=2]
- %tmp27 = getelementptr float* %tmp21, i32 %i.01.0 ; <float*> [#uses=1]
- %tmp28 = load float* %tmp27, align 4 ; <float> [#uses=1]
- %tmp2829 = fpext float %tmp28 to double ; <double> [#uses=1]
- %tmp34 = sub float -0.000000e+00, %tmp18 ; <float> [#uses=1]
- %tmp3435 = fpext float %tmp34 to double ; <double> [#uses=1]
- %tmp36 = tail call double @exp( double %tmp3435 ) ; <double> [#uses=1]
- %tmp37 = mul double %tmp32, %tmp36 ; <double> [#uses=1]
- %tmp40 = fdiv double %tmp37, %tmp3839 ; <double> [#uses=1]
- %tmp41 = add double %tmp2829, %tmp40 ; <double> [#uses=1]
- %tmp4142 = fptrunc double %tmp41 to float ; <float> [#uses=1]
- %tmp44 = getelementptr float* %tmp21, i32 %i.01.0 ; <float*> [#uses=1]
- store float %tmp4142, float* %tmp44, align 4
- br label %cond_next45
-
-cond_next45: ; preds = %bb, %cond_true9
- %tmp47 = add i32 %i.01.0, 1 ; <i32> [#uses=2]
- %tmp51 = icmp sgt i32 %tmp47, %xmax ; <i1> [#uses=1]
- br i1 %tmp51, label %return.loopexit, label %bb
-
-return.loopexit: ; preds = %cond_next45
- br label %return
-
-return: ; preds = %return.loopexit, %entry
- ret void
-}
-
-declare float @fabsf(float)
-
-declare double @exp(double)
diff --git a/release_23/test/Transforms/LoopIndexSplit/2007-09-25-UpdateIterationSpace-2.ll b/release_23/test/Transforms/LoopIndexSplit/2007-09-25-UpdateIterationSpace-2.ll
deleted file mode 100644
index 06f9e1109670..000000000000
--- a/release_23/test/Transforms/LoopIndexSplit/2007-09-25-UpdateIterationSpace-2.ll
+++ /dev/null
@@ -1,59 +0,0 @@
-; PR714
-; Update loop iteraton space to eliminate condition inside loop.
-; RUN: llvm-as < %s | opt -loop-index-split | llvm-dis | not grep bothcond
-define void @test(float* %x, i32 %ndat, float** %y, float %xcen, i32 %xmin, i32 %xmax, float %sigmal, float %contribution) {
-entry:
- %tmp5310 = icmp sgt i32 %xmin, %xmax ; <i1> [#uses=1]
- br i1 %tmp5310, label %return, label %bb.preheader
-
-bb.preheader: ; preds = %entry
- %tmp3031 = fpext float %contribution to double ; <double> [#uses=1]
- %tmp32 = mul double %tmp3031, 5.000000e-01 ; <double> [#uses=1]
- %tmp3839 = fpext float %sigmal to double ; <double> [#uses=1]
- br label %bb
-
-bb: ; preds = %bb.preheader, %cond_next45
- %i.01.0 = phi i32 [ %tmp47, %cond_next45 ], [ %xmin, %bb.preheader ] ; <i32> [#uses=4]
- %k.06.0 = phi i32 [ %tmp49, %cond_next45 ], [ 0, %bb.preheader ] ; <i32> [#uses=3]
- %tmp2 = icmp sgt i32 %i.01.0, -1 ; <i1> [#uses=1]
- %tmp6 = icmp slt i32 %i.01.0, %ndat ; <i1> [#uses=1]
- %bothcond = and i1 %tmp2, %tmp6 ; <i1> [#uses=1]
- br i1 %bothcond, label %cond_true9, label %cond_next45
-
-cond_true9: ; preds = %bb
- %tmp12 = getelementptr float* %x, i32 %i.01.0 ; <float*> [#uses=1]
- %tmp13 = load float* %tmp12, align 4 ; <float> [#uses=1]
- %tmp15 = sub float %xcen, %tmp13 ; <float> [#uses=1]
- %tmp16 = tail call float @fabsf( float %tmp15 ) ; <float> [#uses=1]
- %tmp18 = fdiv float %tmp16, %sigmal ; <float> [#uses=1]
- %tmp21 = load float** %y, align 4 ; <float*> [#uses=2]
- %tmp27 = getelementptr float* %tmp21, i32 %k.06.0 ; <float*> [#uses=1]
- %tmp28 = load float* %tmp27, align 4 ; <float> [#uses=1]
- %tmp2829 = fpext float %tmp28 to double ; <double> [#uses=1]
- %tmp34 = sub float -0.000000e+00, %tmp18 ; <float> [#uses=1]
- %tmp3435 = fpext float %tmp34 to double ; <double> [#uses=1]
- %tmp36 = tail call double @exp( double %tmp3435 ) ; <double> [#uses=1]
- %tmp37 = mul double %tmp32, %tmp36 ; <double> [#uses=1]
- %tmp40 = fdiv double %tmp37, %tmp3839 ; <double> [#uses=1]
- %tmp41 = add double %tmp2829, %tmp40 ; <double> [#uses=1]
- %tmp4142 = fptrunc double %tmp41 to float ; <float> [#uses=1]
- %tmp44 = getelementptr float* %tmp21, i32 %k.06.0 ; <float*> [#uses=1]
- store float %tmp4142, float* %tmp44, align 4
- br label %cond_next45
-
-cond_next45: ; preds = %bb, %cond_true9
- %tmp47 = add i32 %i.01.0, 1 ; <i32> [#uses=2]
- %tmp49 = add i32 %k.06.0, 1 ; <i32> [#uses=1]
- %tmp53 = icmp sgt i32 %tmp47, %xmax ; <i1> [#uses=1]
- br i1 %tmp53, label %return.loopexit, label %bb
-
-return.loopexit: ; preds = %cond_next45
- br label %return
-
-return: ; preds = %return.loopexit, %entry
- ret void
-}
-
-declare float @fabsf(float)
-
-declare double @exp(double)
diff --git a/release_23/test/Transforms/LoopIndexSplit/2008-01-28-IndDecrement.ll b/release_23/test/Transforms/LoopIndexSplit/2008-01-28-IndDecrement.ll
deleted file mode 100644
index a4966a9de4a2..000000000000
--- a/release_23/test/Transforms/LoopIndexSplit/2008-01-28-IndDecrement.ll
+++ /dev/null
@@ -1,46 +0,0 @@
-; RUN: llvm-as < %s | opt -loop-index-split -disable-output -stats |& \
-; RUN: not grep "loop-index-split"
-
-; Induction variable decrement is not yet handled.
-; pr1912.bc
-target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
-target triple = "i686-apple-darwin9"
- %struct.cset = type { i8*, i8, i8, i32, i8* }
- %struct.parse = type { i8*, i8*, i32, i32*, i32, i32, i32, %struct.re_guts*, [10 x i32], [10 x i32] }
- %struct.re_guts = type { i32, i32*, i32, i32, %struct.cset*, i8*, i32, i32, i32, i32, i32, i32, i32, i32, i8*, i8*, i32, i32, i32, i32, [1 x i8] }
-
-define fastcc void @p_bracket(%struct.parse* %p) {
-entry:
- br i1 false, label %bb160, label %bb195
-
-bb160: ; preds = %entry
- br i1 false, label %bb.i169, label %bb9.i
-
-bb195: ; preds = %entry
- ret void
-
-bb.i169: ; preds = %bb160
- br i1 false, label %bb372, label %bb565
-
-bb9.i: ; preds = %bb160
- ret void
-
-bb372: ; preds = %bb418, %bb.i169
- %i1.0.reg2mem.0 = phi i32 [ %i1.0, %bb418 ], [ 0, %bb.i169 ] ; <i32> [#uses=2]
- %tmp3.i.i.i170 = icmp ult i32 %i1.0.reg2mem.0, 128 ; <i1> [#uses=1]
- br i1 %tmp3.i.i.i170, label %bb.i.i173, label %bb13.i.i
-
-bb.i.i173: ; preds = %bb372
- br label %bb418
-
-bb13.i.i: ; preds = %bb372
- br label %bb418
-
-bb418: ; preds = %bb13.i.i, %bb.i.i173
- %i1.0 = add i32 %i1.0.reg2mem.0, -1 ; <i32> [#uses=2]
- %tmp420 = icmp sgt i32 %i1.0, -1 ; <i1> [#uses=1]
- br i1 %tmp420, label %bb372, label %bb565
-
-bb565: ; preds = %bb418, %bb.i169
- ret void
-}
diff --git a/release_23/test/Transforms/LoopIndexSplit/2008-02-08-Crash.ll b/release_23/test/Transforms/LoopIndexSplit/2008-02-08-Crash.ll
deleted file mode 100644
index 4ad906719f8b..000000000000
--- a/release_23/test/Transforms/LoopIndexSplit/2008-02-08-Crash.ll
+++ /dev/null
@@ -1,48 +0,0 @@
-; RUN: llvm-as < %s | opt -loop-index-split -disable-output
-; PR 1995
-
-define void @add_blkdev_randomness(i32 %major) nounwind {
-entry:
- br label %bb
-
-bb: ; preds = %bb39, %entry
- %A.0.reg2mem.0 = phi i32 [ undef, %entry ], [ %TEMP.0, %bb39 ] ; <i32> [#uses=1]
- %D.0.reg2mem.0 = phi i32 [ undef, %entry ], [ %C.0.reg2mem.0, %bb39 ] ; <i32> [#uses=3]
- %C.0.reg2mem.0 = phi i32 [ undef, %entry ], [ %tmp34, %bb39 ] ; <i32> [#uses=4]
- %TEMP.1.reg2mem.0 = phi i32 [ undef, %entry ], [ %TEMP.0, %bb39 ] ; <i32> [#uses=1]
- %i.0.reg2mem.0 = phi i32 [ 0, %entry ], [ %tmp38, %bb39 ] ; <i32> [#uses=3]
- %B.0.reg2mem.0 = phi i32 [ undef, %entry ], [ %A.0.reg2mem.0, %bb39 ] ; <i32> [#uses=5]
- %tmp1 = icmp slt i32 %i.0.reg2mem.0, 40 ; <i1> [#uses=1]
- br i1 %tmp1, label %bb3, label %bb12
-
-bb3: ; preds = %bb
- %tmp6 = xor i32 %C.0.reg2mem.0, %D.0.reg2mem.0 ; <i32> [#uses=1]
- %tmp8 = and i32 %B.0.reg2mem.0, %tmp6 ; <i32> [#uses=1]
- %tmp10 = xor i32 %tmp8, %D.0.reg2mem.0 ; <i32> [#uses=1]
- %tmp11 = add i32 %tmp10, 1518500249 ; <i32> [#uses=1]
- br label %bb39
-
-bb12: ; preds = %bb
- %tmp14 = icmp slt i32 %i.0.reg2mem.0, 60 ; <i1> [#uses=1]
- br i1 %tmp14, label %bb17, label %bb39
-
-bb17: ; preds = %bb12
- %tmp20 = and i32 %B.0.reg2mem.0, %C.0.reg2mem.0 ; <i32> [#uses=1]
- %tmp23 = xor i32 %B.0.reg2mem.0, %C.0.reg2mem.0 ; <i32> [#uses=1]
- %tmp25 = and i32 %tmp23, %D.0.reg2mem.0 ; <i32> [#uses=1]
- %tmp26 = add i32 %tmp20, -1894007588 ; <i32> [#uses=1]
- %tmp27 = add i32 %tmp26, %tmp25 ; <i32> [#uses=1]
- br label %bb39
-
-bb39: ; preds = %bb12, %bb3, %bb17
- %TEMP.0 = phi i32 [ %tmp27, %bb17 ], [ %tmp11, %bb3 ], [ %TEMP.1.reg2mem.0, %bb12 ] ; <i32> [#uses=2]
- %tmp31 = lshr i32 %B.0.reg2mem.0, 2 ; <i32> [#uses=1]
- %tmp33 = shl i32 %B.0.reg2mem.0, 30 ; <i32> [#uses=1]
- %tmp34 = or i32 %tmp31, %tmp33 ; <i32> [#uses=1]
- %tmp38 = add i32 %i.0.reg2mem.0, 1 ; <i32> [#uses=2]
- %tmp41 = icmp slt i32 %tmp38, 80 ; <i1> [#uses=1]
- br i1 %tmp41, label %bb, label %return
-
-return: ; preds = %bb39
- ret void
-} \ No newline at end of file
diff --git a/release_23/test/Transforms/LoopIndexSplit/2008-02-13-ExitValueNum.ll b/release_23/test/Transforms/LoopIndexSplit/2008-02-13-ExitValueNum.ll
deleted file mode 100644
index 9fa83e4f57ff..000000000000
--- a/release_23/test/Transforms/LoopIndexSplit/2008-02-13-ExitValueNum.ll
+++ /dev/null
@@ -1,67 +0,0 @@
-; RUN: llvm-as < %s | opt -disable-output -loop-index-split
-; PR 2011
- %struct.CLAUSE_HELP = type { i32, i32, i32, i32, i32*, i32, %struct.LIST_NODE*, %struct.LIST_NODE*, i32, i32, %struct.LITERAL_HELP**, i32, i32, i32, i32 }
- %struct.LIST_NODE = type { %struct.LIST_NODE*, i8* }
- %struct.LITERAL_HELP = type { i32, i32, i32, %struct.CLAUSE_HELP*, %struct.term* }
- %struct.anon = type { %struct.LIST_NODE* }
- %struct.st = type { %struct.subst*, %struct.LIST_NODE*, %struct.LIST_NODE*, i16, i16 }
- %struct.subst = type { %struct.subst*, i32, %struct.term* }
- %struct.term = type { i32, %struct.anon, %struct.LIST_NODE*, i32, i32 }
-
-define fastcc %struct.LIST_NODE* @inf_HyperResolvents(%struct.CLAUSE_HELP* %Clause, %struct.subst* %Subst, %struct.LIST_NODE* %Restlits, i32 %GlobalMaxVar, %struct.LIST_NODE* %FoundMap, i32 %StrictlyMaximal, { %struct.st*, [3001 x %struct.term*], [4000 x %struct.term*], i32 }* %Index, i32* %Flags, i32* %Precedence) nounwind {
-entry:
- br i1 false, label %bb960, label %bb885
-
-bb885: ; preds = %entry
- ret %struct.LIST_NODE* null
-
-bb960: ; preds = %entry
- br i1 false, label %bb1097, label %bb1005.preheader
-
-bb1005.preheader: ; preds = %bb960
- ret %struct.LIST_NODE* null
-
-bb1097: ; preds = %bb960
- br i1 false, label %bb1269.preheader, label %bb1141.preheader
-
-bb1141.preheader: ; preds = %bb1097
- ret %struct.LIST_NODE* null
-
-bb1269.preheader: ; preds = %bb1097
- br i1 false, label %bb1318, label %bb1281
-
-bb1281: ; preds = %bb1269.preheader
- ret %struct.LIST_NODE* null
-
-bb1318: ; preds = %bb1269.preheader
- br i1 false, label %bb1459, label %bb.nph52
-
-bb.nph52: ; preds = %bb1318
- ret %struct.LIST_NODE* null
-
-bb1459: ; preds = %bb1318
- br i1 false, label %bb1553, label %bb.nph62
-
-bb.nph62: ; preds = %bb1459
- ret %struct.LIST_NODE* null
-
-bb1553: ; preds = %bb1669, %bb1459
- %j295.0.reg2mem.0 = phi i32 [ %storemerge110, %bb1669 ], [ 0, %bb1459 ] ; <i32> [#uses=2]
- %tmp1629 = icmp sgt i32 %j295.0.reg2mem.0, 0 ; <i1> [#uses=1]
- br i1 %tmp1629, label %bb1649, label %bb1632
-
-bb1632: ; preds = %bb1553
- br label %bb1669
-
-bb1649: ; preds = %bb1553
- br label %bb1669
-
-bb1669: ; preds = %bb1649, %bb1632
- %storemerge110 = add i32 %j295.0.reg2mem.0, 1 ; <i32> [#uses=2]
- %tmp1672 = icmp sgt i32 %storemerge110, 0 ; <i1> [#uses=1]
- br i1 %tmp1672, label %bb1678, label %bb1553
-
-bb1678: ; preds = %bb1669
- ret %struct.LIST_NODE* null
-}
-
diff --git a/release_23/test/Transforms/LoopIndexSplit/2008-02-13-LoopLatch.ll b/release_23/test/Transforms/LoopIndexSplit/2008-02-13-LoopLatch.ll
deleted file mode 100644
index 0c67ea2c3070..000000000000
--- a/release_23/test/Transforms/LoopIndexSplit/2008-02-13-LoopLatch.ll
+++ /dev/null
@@ -1,72 +0,0 @@
-; RUN: llvm-as < %s | opt -loop-index-split -disable-output
-; PR 2011
- %struct.CLAUSE_HELP = type { i32, i32, i32, i32, i32*, i32, %struct.LIST_NODE*, %struct.LIST_NODE*, i32, i32, %struct.LITERAL_HELP**, i32, i32, i32, i32 }
- %struct.LIST_NODE = type { %struct.LIST_NODE*, i8* }
- %struct.LITERAL_HELP = type { i32, i32, i32, %struct.CLAUSE_HELP*, %struct.term* }
- %struct.anon = type { %struct.LIST_NODE* }
- %struct.st = type { %struct.subst*, %struct.LIST_NODE*, %struct.LIST_NODE*, i16, i16 }
- %struct.subst = type { %struct.subst*, i32, %struct.term* }
- %struct.term = type { i32, %struct.anon, %struct.LIST_NODE*, i32, i32 }
-
-define fastcc %struct.LIST_NODE* @inf_HyperResolvents(%struct.CLAUSE_HELP* %Clause, %struct.subst* %Subst, %struct.LIST_NODE* %Restlits, i32 %GlobalMaxVar, %struct.LIST_NODE* %FoundMap, i32 %StrictlyMaximal, { %struct.st*, [3001 x %struct.term*], [4000 x %struct.term*], i32 }* %Index, i32* %Flags, i32* %Precedence) nounwind {
-entry:
- br i1 false, label %bb960, label %bb885
-
-bb885: ; preds = %entry
- ret %struct.LIST_NODE* null
-
-bb960: ; preds = %entry
- br i1 false, label %bb1097, label %bb1005.preheader
-
-bb1005.preheader: ; preds = %bb960
- ret %struct.LIST_NODE* null
-
-bb1097: ; preds = %bb960
- br i1 false, label %bb1269.preheader, label %bb1141.preheader
-
-bb1141.preheader: ; preds = %bb1097
- ret %struct.LIST_NODE* null
-
-bb1269.preheader: ; preds = %bb1097
- br i1 false, label %bb1318, label %bb1281
-
-bb1281: ; preds = %bb1269.preheader
- ret %struct.LIST_NODE* null
-
-bb1318: ; preds = %bb1269.preheader
- br i1 false, label %bb1459, label %bb.nph52
-
-bb.nph52: ; preds = %bb1318
- ret %struct.LIST_NODE* null
-
-bb1459: ; preds = %bb1318
- br i1 false, label %bb1553, label %bb.nph62
-
-bb.nph62: ; preds = %bb1459
- ret %struct.LIST_NODE* null
-
-bb1553: ; preds = %bb1669, %bb1459
- %j295.0.reg2mem.0 = phi i32 [ %storemerge110, %bb1669 ], [ 0, %bb1459 ] ; <i32> [#uses=2]
- br i1 false, label %bb1588, label %bb1616
-
-bb1588: ; preds = %bb1553
- br label %bb1616
-
-bb1616: ; preds = %bb1588, %bb1553
- %tmp1629 = icmp sgt i32 %j295.0.reg2mem.0, 0 ; <i1> [#uses=1]
- br i1 %tmp1629, label %bb1649, label %bb1632
-
-bb1632: ; preds = %bb1616
- br label %bb1669
-
-bb1649: ; preds = %bb1616
- br label %bb1669
-
-bb1669: ; preds = %bb1649, %bb1632
- %storemerge110 = add i32 %j295.0.reg2mem.0, 1 ; <i32> [#uses=2]
- %tmp1672 = icmp sgt i32 %storemerge110, 0 ; <i1> [#uses=1]
- br i1 %tmp1672, label %bb1678, label %bb1553
-
-bb1678: ; preds = %bb1669
- ret %struct.LIST_NODE* null
-}
diff --git a/release_23/test/Transforms/LoopIndexSplit/2008-02-13-LoopLatchPHI.ll b/release_23/test/Transforms/LoopIndexSplit/2008-02-13-LoopLatchPHI.ll
deleted file mode 100644
index 393299f3e094..000000000000
--- a/release_23/test/Transforms/LoopIndexSplit/2008-02-13-LoopLatchPHI.ll
+++ /dev/null
@@ -1,74 +0,0 @@
-; RUN: llvm-as < %s | opt -loop-index-split -disable-output
-; PR 2011
- %struct.CLAUSE_HELP = type { i32, i32, i32, i32, i32*, i32, %struct.LIST_NODE*, %struct.LIST_NODE*, i32, i32, %struct.LITERAL_HELP**, i32, i32, i32, i32 }
- %struct.LIST_NODE = type { %struct.LIST_NODE*, i8* }
- %struct.LITERAL_HELP = type { i32, i32, i32, %struct.CLAUSE_HELP*, %struct.term* }
- %struct.anon = type { %struct.LIST_NODE* }
- %struct.st = type { %struct.subst*, %struct.LIST_NODE*, %struct.LIST_NODE*, i16, i16 }
- %struct.subst = type { %struct.subst*, i32, %struct.term* }
- %struct.term = type { i32, %struct.anon, %struct.LIST_NODE*, i32, i32 }
-
-define fastcc %struct.LIST_NODE* @inf_HyperResolvents(%struct.CLAUSE_HELP* %Clause, %struct.subst* %Subst, %struct.LIST_NODE* %Restlits, i32 %GlobalMaxVar, %struct.LIST_NODE* %FoundMap, i32 %StrictlyMaximal, { %struct.st*, [3001 x %struct.term*], [4000 x %struct.term*], i32 }* %Index, i32* %Flags, i32* %Precedence) nounwind {
-entry:
- br i1 false, label %bb960, label %bb885
-
-bb885: ; preds = %entry
- ret %struct.LIST_NODE* null
-
-bb960: ; preds = %entry
- br i1 false, label %bb1097, label %bb1005.preheader
-
-bb1005.preheader: ; preds = %bb960
- ret %struct.LIST_NODE* null
-
-bb1097: ; preds = %bb960
- br i1 false, label %bb1269.preheader, label %bb1141.preheader
-
-bb1141.preheader: ; preds = %bb1097
- ret %struct.LIST_NODE* null
-
-bb1269.preheader: ; preds = %bb1097
- br i1 false, label %bb1318, label %bb1281
-
-bb1281: ; preds = %bb1269.preheader
- ret %struct.LIST_NODE* null
-
-bb1318: ; preds = %bb1269.preheader
- br i1 false, label %bb1459, label %bb.nph52
-
-bb.nph52: ; preds = %bb1318
- ret %struct.LIST_NODE* null
-
-bb1459: ; preds = %bb1318
- br i1 false, label %bb1553, label %bb.nph62
-
-bb.nph62: ; preds = %bb1459
- ret %struct.LIST_NODE* null
-
-bb1553: ; preds = %bb1669, %bb1459
- %j295.0.reg2mem.0 = phi i32 [ %storemerge110, %bb1669 ], [ 0, %bb1459 ] ; <i32> [#uses=2]
- %Constraint403.2.reg2mem.0 = phi %struct.LIST_NODE* [ %Constraint403.1.reg2mem.0, %bb1669 ], [ null, %bb1459 ] ; <%struct.LIST_NODE*> [#uses=1]
- br i1 false, label %bb1588, label %bb1616
-
-bb1588: ; preds = %bb1553
- br label %bb1616
-
-bb1616: ; preds = %bb1588, %bb1553
- %tmp1629 = icmp sgt i32 %j295.0.reg2mem.0, 0 ; <i1> [#uses=1]
- br i1 %tmp1629, label %bb1649, label %bb1632
-
-bb1632: ; preds = %bb1616
- br label %bb1669
-
-bb1649: ; preds = %bb1616
- br label %bb1669
-
-bb1669: ; preds = %bb1649, %bb1632
- %Constraint403.1.reg2mem.0 = phi %struct.LIST_NODE* [ null, %bb1632 ], [ %Constraint403.2.reg2mem.0, %bb1649 ] ; <%struct.LIST_NODE*> [#uses=1]
- %storemerge110 = add i32 %j295.0.reg2mem.0, 1 ; <i32> [#uses=2]
- %tmp1672 = icmp sgt i32 %storemerge110, 0 ; <i1> [#uses=1]
- br i1 %tmp1672, label %bb1678, label %bb1553
-
-bb1678: ; preds = %bb1669
- ret %struct.LIST_NODE* null
-}
diff --git a/release_23/test/Transforms/LoopIndexSplit/2008-02-14-Crash.ll b/release_23/test/Transforms/LoopIndexSplit/2008-02-14-Crash.ll
deleted file mode 100644
index 2ee51e14948c..000000000000
--- a/release_23/test/Transforms/LoopIndexSplit/2008-02-14-Crash.ll
+++ /dev/null
@@ -1,464 +0,0 @@
-; RUN: llvm-as < %s | opt -loop-index-split -disable-output
-; PR 2030
- %struct.FULL = type { i32, i32, [1000 x float*] }
-
-define i32 @matgen(%struct.FULL* %a, float** %x, float** %b, float** %bt, i32** %ipvt, i32 %test_case, i32 %scale) {
-entry:
- br i1 false, label %bb, label %entry.bb30_crit_edge
-
-entry.bb30_crit_edge: ; preds = %entry
- br label %bb30
-
-bb: ; preds = %entry
- br label %bb14
-
-bb6: ; preds = %bb14
- br label %bb14
-
-bb14: ; preds = %bb6, %bb
- br i1 false, label %bb6, label %bb22
-
-bb22: ; preds = %bb14
- br label %bb30
-
-bb30: ; preds = %bb22, %entry.bb30_crit_edge
- switch i32 %test_case, label %bb648 [
- i32 1, label %bb30.bb32_crit_edge
- i32 2, label %bb30.bb32_crit_edge1
- i32 3, label %bb30.bb32_crit_edge2
- i32 4, label %bb30.bb108_crit_edge
- i32 5, label %bb30.bb108_crit_edge3
- i32 6, label %bb30.bb142_crit_edge
- i32 7, label %bb30.bb142_crit_edge4
- i32 8, label %bb30.bb142_crit_edge5
- i32 9, label %bb234
- i32 10, label %bb292
- i32 11, label %bb353
- i32 12, label %bb419
- i32 13, label %bb485
- i32 14, label %bb567
- ]
-
-bb30.bb142_crit_edge5: ; preds = %bb30
- br label %bb142
-
-bb30.bb142_crit_edge4: ; preds = %bb30
- br label %bb142
-
-bb30.bb142_crit_edge: ; preds = %bb30
- br label %bb142
-
-bb30.bb108_crit_edge3: ; preds = %bb30
- br label %bb108
-
-bb30.bb108_crit_edge: ; preds = %bb30
- br label %bb108
-
-bb30.bb32_crit_edge2: ; preds = %bb30
- br label %bb32
-
-bb30.bb32_crit_edge1: ; preds = %bb30
- br label %bb32
-
-bb30.bb32_crit_edge: ; preds = %bb30
- br label %bb32
-
-bb32: ; preds = %bb30.bb32_crit_edge, %bb30.bb32_crit_edge1, %bb30.bb32_crit_edge2
- br i1 false, label %bb53, label %bb52
-
-bb52: ; preds = %bb32
- br label %bb739
-
-bb53: ; preds = %bb32
- br label %bb101
-
-bb58: ; preds = %bb101
- br label %bb92
-
-bb64: ; preds = %bb92
- br i1 false, label %bb64.bb87_crit_edge, label %bb72
-
-bb64.bb87_crit_edge: ; preds = %bb64
- br label %bb87
-
-bb72: ; preds = %bb64
- br i1 false, label %bb72.bb87_crit_edge, label %bb79
-
-bb72.bb87_crit_edge: ; preds = %bb72
- br label %bb87
-
-bb79: ; preds = %bb72
- br label %bb87
-
-bb87: ; preds = %bb79, %bb72.bb87_crit_edge, %bb64.bb87_crit_edge
- br label %bb92
-
-bb92: ; preds = %bb87, %bb58
- br i1 false, label %bb64, label %bb98
-
-bb98: ; preds = %bb92
- br label %bb101
-
-bb101: ; preds = %bb98, %bb53
- br i1 false, label %bb58, label %bb107
-
-bb107: ; preds = %bb101
- br label %bb651
-
-bb108: ; preds = %bb30.bb108_crit_edge, %bb30.bb108_crit_edge3
- br i1 false, label %bb125, label %bb124
-
-bb124: ; preds = %bb108
- br label %bb739
-
-bb125: ; preds = %bb108
- br i1 false, label %bb138, label %bb139
-
-bb138: ; preds = %bb125
- br label %bb140
-
-bb139: ; preds = %bb125
- br label %bb140
-
-bb140: ; preds = %bb139, %bb138
- br label %bb651
-
-bb142: ; preds = %bb30.bb142_crit_edge, %bb30.bb142_crit_edge4, %bb30.bb142_crit_edge5
- br i1 false, label %bb161, label %bb160
-
-bb160: ; preds = %bb142
- br label %bb739
-
-bb161: ; preds = %bb142
- br i1 false, label %bb170, label %bb161.bb171_crit_edge
-
-bb161.bb171_crit_edge: ; preds = %bb161
- br label %bb171
-
-bb170: ; preds = %bb161
- br label %bb171
-
-bb171: ; preds = %bb170, %bb161.bb171_crit_edge
- br i1 false, label %bb176, label %bb171.bb177_crit_edge
-
-bb171.bb177_crit_edge: ; preds = %bb171
- br label %bb177
-
-bb176: ; preds = %bb171
- br label %bb177
-
-bb177: ; preds = %bb176, %bb171.bb177_crit_edge
- br label %bb227
-
-bb178: ; preds = %bb227
- br label %bb218
-
-bb184: ; preds = %bb218
- br i1 false, label %bb191, label %bb193
-
-bb191: ; preds = %bb184
- br label %bb213
-
-bb193: ; preds = %bb184
- br i1 false, label %bb200, label %bb203
-
-bb200: ; preds = %bb193
- br label %bb213
-
-bb203: ; preds = %bb193
- br i1 false, label %bb210, label %bb203.bb213_crit_edge
-
-bb203.bb213_crit_edge: ; preds = %bb203
- br label %bb213
-
-bb210: ; preds = %bb203
- br label %bb213
-
-bb213: ; preds = %bb210, %bb203.bb213_crit_edge, %bb200, %bb191
- br label %bb218
-
-bb218: ; preds = %bb213, %bb178
- br i1 false, label %bb184, label %bb224
-
-bb224: ; preds = %bb218
- br label %bb227
-
-bb227: ; preds = %bb224, %bb177
- br i1 false, label %bb178, label %bb233
-
-bb233: ; preds = %bb227
- br label %bb651
-
-bb234: ; preds = %bb30
- br i1 false, label %bb253, label %bb252
-
-bb252: ; preds = %bb234
- br label %bb739
-
-bb253: ; preds = %bb234
- br label %bb285
-
-bb258: ; preds = %bb285
- br label %bb276
-
-bb264: ; preds = %bb276
- br label %bb276
-
-bb276: ; preds = %bb264, %bb258
- br i1 false, label %bb264, label %bb282
-
-bb282: ; preds = %bb276
- br label %bb285
-
-bb285: ; preds = %bb282, %bb253
- br i1 false, label %bb258, label %bb291
-
-bb291: ; preds = %bb285
- br label %bb651
-
-bb292: ; preds = %bb30
- br i1 false, label %bb311, label %bb310
-
-bb310: ; preds = %bb292
- br label %bb739
-
-bb311: ; preds = %bb292
- br label %bb346
-
-bb316: ; preds = %bb346
- br label %bb337
-
-bb322: ; preds = %bb337
- br label %bb337
-
-bb337: ; preds = %bb322, %bb316
- br i1 false, label %bb322, label %bb343
-
-bb343: ; preds = %bb337
- br label %bb346
-
-bb346: ; preds = %bb343, %bb311
- br i1 false, label %bb316, label %bb352
-
-bb352: ; preds = %bb346
- br label %bb651
-
-bb353: ; preds = %bb30
- br i1 false, label %bb372, label %bb371
-
-bb371: ; preds = %bb353
- br label %bb739
-
-bb372: ; preds = %bb353
- br label %bb412
-
-bb377: ; preds = %bb412
- br label %bb403
-
-bb383: ; preds = %bb403
- br i1 false, label %bb395, label %bb389
-
-bb389: ; preds = %bb383
- br label %bb396
-
-bb395: ; preds = %bb383
- br label %bb396
-
-bb396: ; preds = %bb395, %bb389
- br label %bb403
-
-bb403: ; preds = %bb396, %bb377
- br i1 false, label %bb383, label %bb409
-
-bb409: ; preds = %bb403
- br label %bb412
-
-bb412: ; preds = %bb409, %bb372
- br i1 false, label %bb377, label %bb418
-
-bb418: ; preds = %bb412
- br label %bb651
-
-bb419: ; preds = %bb30
- br i1 false, label %bb438, label %bb437
-
-bb437: ; preds = %bb419
- br label %bb739
-
-bb438: ; preds = %bb419
- br label %bb478
-
-bb443: ; preds = %bb478
- br label %bb469
-
-bb449: ; preds = %bb469
- br i1 false, label %bb461, label %bb455
-
-bb455: ; preds = %bb449
- br label %bb462
-
-bb461: ; preds = %bb449
- br label %bb462
-
-bb462: ; preds = %bb461, %bb455
- br label %bb469
-
-bb469: ; preds = %bb462, %bb443
- br i1 false, label %bb449, label %bb475
-
-bb475: ; preds = %bb469
- br label %bb478
-
-bb478: ; preds = %bb475, %bb438
- br i1 false, label %bb443, label %bb484
-
-bb484: ; preds = %bb478
- br label %bb651
-
-bb485: ; preds = %bb30
- br i1 false, label %bb504, label %bb503
-
-bb503: ; preds = %bb485
- br label %bb739
-
-bb504: ; preds = %bb485
- br label %bb560
-
-bb513: ; preds = %bb560
- br label %bb551
-
-bb519: ; preds = %bb551
- br i1 false, label %bb528, label %bb532
-
-bb528: ; preds = %bb519
- br label %bb536
-
-bb532: ; preds = %bb519
- br label %bb536
-
-bb536: ; preds = %bb532, %bb528
- br label %bb551
-
-bb551: ; preds = %bb536, %bb513
- br i1 false, label %bb519, label %bb557
-
-bb557: ; preds = %bb551
- br label %bb560
-
-bb560: ; preds = %bb557, %bb504
- br i1 false, label %bb513, label %bb566
-
-bb566: ; preds = %bb560
- br label %bb651
-
-bb567: ; preds = %bb30
- br i1 false, label %bb586, label %bb585
-
-bb585: ; preds = %bb567
- br label %bb739
-
-bb586: ; preds = %bb567
- br label %bb641
-
-bb595: ; preds = %bb641
- br label %bb632
-
-bb601: ; preds = %bb632
- %tmp604 = icmp sgt i32 %i.7, 0 ; <i1> [#uses=1]
- br i1 %tmp604, label %bb607, label %bb611
-
-bb607: ; preds = %bb601
- br label %bb615
-
-bb611: ; preds = %bb601
- br label %bb615
-
-bb615: ; preds = %bb611, %bb607
- %tmp629 = add i32 %i.7, 1 ; <i32> [#uses=1]
- %tmp631 = getelementptr float* %col.7, i32 1 ; <float*> [#uses=1]
- br label %bb632
-
-bb632: ; preds = %bb615, %bb595
- %col.7 = phi float* [ null, %bb595 ], [ %tmp631, %bb615 ] ; <float*> [#uses=1]
- %i.7 = phi i32 [ 0, %bb595 ], [ %tmp629, %bb615 ] ; <i32> [#uses=3]
- %tmp635 = icmp slt i32 %i.7, 0 ; <i1> [#uses=1]
- br i1 %tmp635, label %bb601, label %bb638
-
-bb638: ; preds = %bb632
- br label %bb641
-
-bb641: ; preds = %bb638, %bb586
- br i1 false, label %bb595, label %bb647
-
-bb647: ; preds = %bb641
- br label %bb651
-
-bb648: ; preds = %bb30
- br label %bb739
-
-bb651: ; preds = %bb647, %bb566, %bb484, %bb418, %bb352, %bb291, %bb233, %bb140, %bb107
- br i1 false, label %bb658, label %bb651.bb661_crit_edge
-
-bb651.bb661_crit_edge: ; preds = %bb651
- br label %bb661
-
-bb658: ; preds = %bb651
- br label %bb661
-
-bb661: ; preds = %bb658, %bb651.bb661_crit_edge
- br i1 false, label %bb666, label %bb661.bb686_crit_edge
-
-bb661.bb686_crit_edge: ; preds = %bb661
- br label %bb686
-
-bb666: ; preds = %bb661
- br label %bb680
-
-bb670: ; preds = %bb680
- br label %bb680
-
-bb680: ; preds = %bb670, %bb666
- br i1 false, label %bb670, label %bb680.bb686_crit_edge
-
-bb680.bb686_crit_edge: ; preds = %bb680
- br label %bb686
-
-bb686: ; preds = %bb680.bb686_crit_edge, %bb661.bb686_crit_edge
- br i1 false, label %bb699, label %bb696
-
-bb696: ; preds = %bb686
- br label %bb739
-
-bb699: ; preds = %bb686
- br i1 false, label %bb712, label %bb709
-
-bb709: ; preds = %bb699
- br label %bb739
-
-bb712: ; preds = %bb699
- br i1 false, label %bb717, label %bb712.bb720_crit_edge
-
-bb712.bb720_crit_edge: ; preds = %bb712
- br label %bb720
-
-bb717: ; preds = %bb712
- br label %bb720
-
-bb720: ; preds = %bb717, %bb712.bb720_crit_edge
- br i1 false, label %bb725, label %bb720.bb738_crit_edge
-
-bb720.bb738_crit_edge: ; preds = %bb720
- br label %bb738
-
-bb725: ; preds = %bb720
- br label %bb738
-
-bb738: ; preds = %bb725, %bb720.bb738_crit_edge
- br label %bb739
-
-bb739: ; preds = %bb738, %bb709, %bb696, %bb648, %bb585, %bb503, %bb437, %bb371, %bb310, %bb252, %bb160, %bb124, %bb52
- br label %return
-
-return: ; preds = %bb739
- ret i32 0
-}
diff --git a/release_23/test/Transforms/LoopIndexSplit/2008-03-24-ExitPhi.ll b/release_23/test/Transforms/LoopIndexSplit/2008-03-24-ExitPhi.ll
deleted file mode 100644
index 24f22cab4ea1..000000000000
--- a/release_23/test/Transforms/LoopIndexSplit/2008-03-24-ExitPhi.ll
+++ /dev/null
@@ -1,69 +0,0 @@
-; RUN: llvm-as < %s | opt -loop-index-split -disable-output
-; Handle Exit block phis that do not have any use inside the loop.
-
- %struct.ATOM = type { double, double, double, double, double, double, i32, double, double, double, double, i8*, i8, [9 x i8], double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, [200 x i8*], [32 x i8*], [32 x i8], i32 }
- %struct.FILE = type { i8*, i32, i32, i16, i16, %struct.__sbuf, i32, i8*, i32 (i8*)*, i32 (i8*, i8*, i32)*, i64 (i8*, i64, i32)*, i32 (i8*, i8*, i32)*, %struct.__sbuf, %struct.__sFILEX*, i32, [3 x i8], [1 x i8], %struct.__sbuf, i32, i64 }
- %struct.__sFILEX = type opaque
- %struct.__sbuf = type { i8*, i32 }
-
-define i32 @math([80 x i8]* %tokens, double* %fvalue, i32* %ivalue, %struct.FILE* %ip, %struct.FILE* %op, i32 %echo) nounwind {
-entry:
- br i1 false, label %bb.i, label %bb35.i
-bb.i: ; preds = %entry
- br i1 false, label %bb6.i, label %bb9.i
-bb9.i: ; preds = %bb.i
- ret i32 0
-bb35.i: ; preds = %entry
- ret i32 0
-bb6.i: ; preds = %bb.i
- br i1 false, label %a_l2_f.exit, label %bb16.i
-bb16.i: ; preds = %bb6.i
- ret i32 0
-a_l2_f.exit: ; preds = %bb6.i
- br i1 false, label %bb7.i97, label %bb6.i71
-bb6.i71: ; preds = %a_l2_f.exit
- ret i32 0
-bb7.i97: ; preds = %a_l2_f.exit
- br i1 false, label %bb, label %bb18.i102
-bb18.i102: ; preds = %bb7.i97
- ret i32 0
-bb: ; preds = %bb7.i97
- br i1 false, label %bb38, label %AFOUND
-bb38: ; preds = %bb
- br i1 false, label %bb111, label %bb7.i120
-AFOUND: ; preds = %bb
- ret i32 0
-bb7.i120: ; preds = %bb38
- ret i32 0
-bb111: ; preds = %bb38
- switch i32 0, label %bb574 [
- i32 1, label %bb158
- i32 0, label %bb166
- ]
-bb158: ; preds = %bb111
- ret i32 0
-bb166: ; preds = %bb111
- ret i32 0
-bb574: ; preds = %bb111
- br i1 false, label %bb11.i249, label %bb600
-bb11.i249: ; preds = %bb574
- br i1 false, label %bb11.i265, label %bb596
-bb11.i265: ; preds = %bb590, %bb11.i249
- %i.1.reg2mem.0 = phi i32 [ %tmp589.reg2mem.0, %bb590 ], [ 0, %bb11.i249 ] ; <i32> [#uses=2]
- %tmp13.i264 = icmp slt i32 %i.1.reg2mem.0, 1 ; <i1> [#uses=1]
- br i1 %tmp13.i264, label %bb16.i267, label %bb30.i279
-bb16.i267: ; preds = %bb11.i265
- br label %bb590
-bb30.i279: ; preds = %bb11.i265
- br label %bb590
-bb590: ; preds = %bb30.i279, %bb16.i267
- %tmp5876282.reg2mem.0 = phi %struct.ATOM* [ null, %bb30.i279 ], [ null, %bb16.i267 ] ; <%struct.ATOM*> [#uses=1]
- %tmp589.reg2mem.0 = add i32 %i.1.reg2mem.0, 1 ; <i32> [#uses=2]
- %tmp593 = icmp slt i32 %tmp589.reg2mem.0, 0 ; <i1> [#uses=1]
- br i1 %tmp593, label %bb11.i265, label %bb596
-bb596: ; preds = %bb590, %bb11.i249
- %ap.0.reg2mem.0 = phi %struct.ATOM* [ null, %bb11.i249 ], [ %tmp5876282.reg2mem.0, %bb590 ] ; <%struct.ATOM*> [#uses=0]
- ret i32 0
-bb600: ; preds = %bb574
- ret i32 0
-}
diff --git a/release_23/test/Transforms/LoopIndexSplit/Crash-2007-08-17.ll b/release_23/test/Transforms/LoopIndexSplit/Crash-2007-08-17.ll
deleted file mode 100644
index d77f55a60aea..000000000000
--- a/release_23/test/Transforms/LoopIndexSplit/Crash-2007-08-17.ll
+++ /dev/null
@@ -1,52 +0,0 @@
-; RUN: llvm-as < %s | opt -loop-index-split -disable-output
-
- %struct._edit_script = type { %struct._edit_script*, i32, i8 }
-
-define void @align_path(i8* %seq1, i8* %seq2, i32 %i1, i32 %j1, i32 %i2, i32 %j2, i32 %dist, %struct._edit_script** %head, %struct._edit_script** %tail, i32 %M, i32 %N) {
-entry:
- br label %bb354
-
-bb354: ; preds = %bb511, %entry
- br i1 false, label %bb495, label %bb368
-
-bb368: ; preds = %bb354
- ret void
-
-bb495: ; preds = %bb495, %bb354
- br i1 false, label %bb511, label %bb495
-
-bb511: ; preds = %bb495
- br i1 false, label %xmalloc.exit69, label %bb354
-
-xmalloc.exit69: ; preds = %bb511
- br i1 false, label %bb556, label %bb542.preheader
-
-bb542.preheader: ; preds = %xmalloc.exit69
- ret void
-
-bb556: ; preds = %xmalloc.exit69
- br label %bb583
-
-bb583: ; preds = %cond_next693, %bb556
- %k.4342.0 = phi i32 [ %tmp707, %cond_next693 ], [ 0, %bb556 ] ; <i32> [#uses=2]
- %tmp586 = icmp eq i32 %k.4342.0, 0 ; <i1> [#uses=1]
- br i1 %tmp586, label %cond_true589, label %cond_false608
-
-cond_true589: ; preds = %bb583
- br label %cond_next693
-
-cond_false608: ; preds = %bb583
- br i1 false, label %cond_next661, label %cond_next693
-
-cond_next661: ; preds = %cond_false608
- br label %cond_next693
-
-cond_next693: ; preds = %cond_next661, %cond_false608, %cond_true589
- %tmp705 = getelementptr i32* null, i32 0 ; <i32*> [#uses=0]
- %tmp707 = add i32 %k.4342.0, 1 ; <i32> [#uses=2]
- %tmp711 = icmp sgt i32 %tmp707, 0 ; <i1> [#uses=1]
- br i1 %tmp711, label %bb726.preheader, label %bb583
-
-bb726.preheader: ; preds = %cond_next693
- ret void
-}
diff --git a/release_23/test/Transforms/LoopIndexSplit/Crash-2007-12-03.ll b/release_23/test/Transforms/LoopIndexSplit/Crash-2007-12-03.ll
deleted file mode 100644
index 4b2cffd79860..000000000000
--- a/release_23/test/Transforms/LoopIndexSplit/Crash-2007-12-03.ll
+++ /dev/null
@@ -1,44 +0,0 @@
-; RUN: llvm-as < %s | opt -loop-index-split -disable-output
-; PR1828.bc
-target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32"
-target triple = "i686-pc-linux-gnu"
- %RPyOpaque_RuntimeTypeInfo = type opaque*
- %arraytype_Char_1 = type { i32, [0 x i8] }
- %arraytype_Signed = type { i32, [0 x i32] }
- %functiontype_11 = type %structtype_object* ()
- %functiontype_360 = type %structtype_rpy_string* (%structtype_pypy.rlib.rbigint.rbigint*, %structtype_rpy_string*, %structtype_rpy_string*, %structtype_rpy_string*)
- %structtype_list_18 = type { i32, %arraytype_Signed* }
- %structtype_object = type { %structtype_object_vtable* }
- %structtype_object_vtable = type { i32, i32, %RPyOpaque_RuntimeTypeInfo*, %arraytype_Char_1*, %functiontype_11* }
- %structtype_pypy.rlib.rbigint.rbigint = type { %structtype_object, %structtype_list_18*, i32 }
- %structtype_rpy_string = type { i32, %arraytype_Char_1 }
-
-define fastcc %structtype_rpy_string* @pypy__format(%structtype_pypy.rlib.rbigint.rbigint* %a_1, %structtype_rpy_string* %digits_0, %structtype_rpy_string* %prefix_3, %structtype_rpy_string* %suffix_0) {
-block0:
- br i1 false, label %block67, label %block13
-
-block13: ; preds = %block0
- ret %structtype_rpy_string* null
-
-block31: ; preds = %block67, %block44
- ret %structtype_rpy_string* null
-
-block42: ; preds = %block67, %block44
- %j_167.reg2mem.0 = phi i32 [ %v63822, %block44 ], [ 0, %block67 ] ; <i32> [#uses=1]
- %v63822 = add i32 %j_167.reg2mem.0, -1 ; <i32> [#uses=3]
- %v63823 = icmp slt i32 %v63822, 0 ; <i1> [#uses=1]
- br i1 %v63823, label %block46, label %block43
-
-block43: ; preds = %block42
- br label %block44
-
-block44: ; preds = %block46, %block43
- %v6377959 = icmp sgt i32 %v63822, 0 ; <i1> [#uses=1]
- br i1 %v6377959, label %block42, label %block31
-
-block46: ; preds = %block42
- br label %block44
-
-block67: ; preds = %block0
- br i1 false, label %block42, label %block31
-}
diff --git a/release_23/test/Transforms/LoopIndexSplit/Crash2-2007-08-17.ll b/release_23/test/Transforms/LoopIndexSplit/Crash2-2007-08-17.ll
deleted file mode 100644
index 241b7dc188d6..000000000000
--- a/release_23/test/Transforms/LoopIndexSplit/Crash2-2007-08-17.ll
+++ /dev/null
@@ -1,58 +0,0 @@
-; RUN: llvm-as < %s | opt -loop-index-split -disable-output
-
- %struct._edit_script = type { %struct._edit_script*, i32, i8 }
-
-define void @align_path(i8* %seq1, i8* %seq2, i32 %i1, i32 %j1, i32 %i2, i32 %j2, i32 %dist, %struct._edit_script** %head, %struct._edit_script** %tail, i32 %M, i32 %N) {
-entry:
- br label %bb354
-
-bb354: ; preds = %bb511, %entry
- br i1 false, label %bb495, label %bb368
-
-bb368: ; preds = %bb354
- ret void
-
-bb495: ; preds = %bb495, %bb354
- br i1 false, label %bb511, label %bb495
-
-bb511: ; preds = %bb495
- br i1 false, label %xmalloc.exit69, label %bb354
-
-xmalloc.exit69: ; preds = %bb511
- br i1 false, label %bb556, label %bb542.preheader
-
-bb542.preheader: ; preds = %xmalloc.exit69
- ret void
-
-bb556: ; preds = %xmalloc.exit69
- br label %bb583
-
-bb583: ; preds = %cond_next693, %bb556
- %k.4342.0 = phi i32 [ %tmp707, %cond_next693 ], [ 0, %bb556 ] ; <i32> [#uses=2]
- %tmp586 = icmp eq i32 %k.4342.0, 0 ; <i1> [#uses=1]
- br i1 %tmp586, label %cond_true589, label %cond_false608
-
-cond_true589: ; preds = %bb583
- br label %cond_next693
-
-cond_false608: ; preds = %bb583
- br i1 false, label %bb645, label %cond_next693
-
-bb645: ; preds = %cond_false608
- br i1 false, label %bb684, label %cond_next661
-
-cond_next661: ; preds = %bb645
- br i1 false, label %bb684, label %cond_next693
-
-bb684: ; preds = %cond_next661, %bb645
- br label %cond_next693
-
-cond_next693: ; preds = %bb684, %cond_next661, %cond_false608, %cond_true589
- %tmp705 = getelementptr i32* null, i32 0 ; <i32*> [#uses=0]
- %tmp707 = add i32 %k.4342.0, 1 ; <i32> [#uses=2]
- %tmp711 = icmp sgt i32 %tmp707, 0 ; <i1> [#uses=1]
- br i1 %tmp711, label %bb726.preheader, label %bb583
-
-bb726.preheader: ; preds = %cond_next693
- ret void
-}
diff --git a/release_23/test/Transforms/LoopIndexSplit/ExitCondition-2007-09-10.ll b/release_23/test/Transforms/LoopIndexSplit/ExitCondition-2007-09-10.ll
deleted file mode 100644
index 9e79f483d9f3..000000000000
--- a/release_23/test/Transforms/LoopIndexSplit/ExitCondition-2007-09-10.ll
+++ /dev/null
@@ -1,50 +0,0 @@
-; RUN: llvm-as < %s | opt -loop-index-split -disable-output
-
-@k = external global i32 ; <i32*> [#uses=2]
-
-define void @foobar(i32 %a, i32 %b) {
-entry:
- br label %bb
-
-bb: ; preds = %cond_next16, %entry
- %i.01.0 = phi i32 [ 0, %entry ], [ %tmp18, %cond_next16 ] ; <i32> [#uses=5]
- %tsum.18.0 = phi i32 [ 42, %entry ], [ %tsum.013.1, %cond_next16 ] ; <i32> [#uses=3]
- %tmp1 = icmp slt i32 %i.01.0, 50 ; <i1> [#uses=1]
- br i1 %tmp1, label %cond_true, label %cond_false
-
-cond_true: ; preds = %bb
- %tmp4 = tail call i32 @foo( i32 %i.01.0 ) ; <i32> [#uses=1]
- %tmp6 = add i32 %tmp4, %tsum.18.0 ; <i32> [#uses=2]
- %tmp914 = load i32* @k, align 4 ; <i32> [#uses=1]
- %tmp1015 = icmp eq i32 %tmp914, 0 ; <i1> [#uses=1]
- br i1 %tmp1015, label %cond_next16, label %cond_true13
-
-cond_false: ; preds = %bb
- %tmp8 = tail call i32 @bar( i32 %i.01.0 ) ; <i32> [#uses=0]
- %tmp9 = load i32* @k, align 4 ; <i32> [#uses=1]
- %tmp10 = icmp eq i32 %tmp9, 0 ; <i1> [#uses=1]
- br i1 %tmp10, label %cond_next16, label %cond_true13
-
-cond_true13: ; preds = %cond_false, %cond_true
- %tsum.013.0 = phi i32 [ %tmp6, %cond_true ], [ %tsum.18.0, %cond_false ] ; <i32> [#uses=1]
- %tmp15 = tail call i32 @bar( i32 %i.01.0 ) ; <i32> [#uses=0]
- br label %cond_next16
-
-cond_next16: ; preds = %cond_false, %cond_true, %cond_true13
- %tsum.013.1 = phi i32 [ %tsum.013.0, %cond_true13 ], [ %tmp6, %cond_true ], [ %tsum.18.0, %cond_false ] ; <i32> [#uses=2]
- %tmp18 = add i32 %i.01.0, 1 ; <i32> [#uses=3]
- %tmp21 = icmp eq i32 %tmp18, 100 ; <i1> [#uses=1]
- br i1 %tmp21, label %bb, label %bb24
-
-bb24: ; preds = %cond_next16
- %tmp18.lcssa = phi i32 [ %tmp18, %cond_next16 ] ; <i32> [#uses=1]
- %tsum.013.1.lcssa = phi i32 [ %tsum.013.1, %cond_next16 ] ; <i32> [#uses=1]
- %tmp27 = tail call i32 @t( i32 %tmp18.lcssa, i32 %tsum.013.1.lcssa ) ; <i32> [#uses=0]
- ret void
-}
-
-declare i32 @foo(i32)
-
-declare i32 @bar(i32)
-
-declare i32 @t(i32, i32)
diff --git a/release_23/test/Transforms/LoopIndexSplit/OneIterLoop-2007-08-17.ll b/release_23/test/Transforms/LoopIndexSplit/OneIterLoop-2007-08-17.ll
deleted file mode 100644
index fb2cbad8852c..000000000000
--- a/release_23/test/Transforms/LoopIndexSplit/OneIterLoop-2007-08-17.ll
+++ /dev/null
@@ -1,61 +0,0 @@
-; Loop is elimianted
-; RUN: llvm-as < %s | opt -loop-index-split -disable-output -stats |& \
-; RUN: grep "loop-index-split" | count 1
- %struct.anon = type { i32 }
-@S1 = external global i32 ; <i32*> [#uses=1]
-@W1 = external global i32 ; <i32*> [#uses=1]
-@Y = weak global [100 x %struct.anon] zeroinitializer, align 32 ; <[100 x %struct.anon]*> [#uses=1]
-@ti = external global i32 ; <i32*> [#uses=1]
-@T2 = external global [100 x [100 x i32]] ; <[100 x [100 x i32]]*> [#uses=1]
-@d = external global i32 ; <i32*> [#uses=1]
-@T1 = external global i32 ; <i32*> [#uses=2]
-@N2 = external global i32 ; <i32*> [#uses=2]
-
-define void @foo() {
-entry:
- %tmp = load i32* @S1, align 4 ; <i32> [#uses=2]
- %tmp266 = load i32* @N2, align 4 ; <i32> [#uses=1]
- %tmp288 = icmp ult i32 %tmp, %tmp266 ; <i1> [#uses=1]
- br i1 %tmp288, label %bb.preheader, label %return
-
-bb.preheader: ; preds = %entry
- %tmp1 = load i32* @W1, align 4 ; <i32> [#uses=1]
- %tmp13 = load i32* @ti, align 4 ; <i32> [#uses=1]
- %tmp18 = load i32* @d, align 4 ; <i32> [#uses=1]
- %tmp26 = load i32* @N2, align 4 ; <i32> [#uses=1]
- %T1.promoted = load i32* @T1 ; <i32> [#uses=1]
- br label %bb
-
-bb: ; preds = %bb.preheader, %bb25
- %T1.tmp.1 = phi i32 [ %T1.promoted, %bb.preheader ], [ %T1.tmp.0, %bb25 ] ; <i32> [#uses=3]
- %tj.01.0 = phi i32 [ %tmp24, %bb25 ], [ %tmp, %bb.preheader ] ; <i32> [#uses=4]
- %tmp3 = icmp eq i32 %tj.01.0, %tmp1 ; <i1> [#uses=1]
- br i1 %tmp3, label %cond_true, label %bb25
-
-cond_true: ; preds = %bb
- %tmp7 = getelementptr [100 x %struct.anon]* @Y, i32 0, i32 %tj.01.0, i32 0 ; <i32*> [#uses=1]
- %tmp8 = load i32* %tmp7, align 4 ; <i32> [#uses=1]
- %tmp9 = icmp sgt i32 %tmp8, 0 ; <i1> [#uses=1]
- br i1 %tmp9, label %cond_true12, label %bb25
-
-cond_true12: ; preds = %cond_true
- %tmp16 = getelementptr [100 x [100 x i32]]* @T2, i32 0, i32 %tmp13, i32 %tj.01.0 ; <i32*> [#uses=1]
- %tmp17 = load i32* %tmp16, align 4 ; <i32> [#uses=1]
- %tmp19 = mul i32 %tmp18, %tmp17 ; <i32> [#uses=1]
- %tmp21 = add i32 %tmp19, %T1.tmp.1 ; <i32> [#uses=1]
- br label %bb25
-
-bb25: ; preds = %cond_true, %bb, %cond_true12
- %T1.tmp.0 = phi i32 [ %T1.tmp.1, %bb ], [ %T1.tmp.1, %cond_true ], [ %tmp21, %cond_true12 ] ; <i32> [#uses=2]
- %tmp24 = add i32 %tj.01.0, 1 ; <i32> [#uses=2]
- %tmp28 = icmp ult i32 %tmp24, %tmp26 ; <i1> [#uses=1]
- br i1 %tmp28, label %bb, label %return.loopexit
-
-return.loopexit: ; preds = %bb25
- %T1.tmp.0.lcssa = phi i32 [ %T1.tmp.0, %bb25 ] ; <i32> [#uses=1]
- store i32 %T1.tmp.0.lcssa, i32* @T1
- br label %return
-
-return: ; preds = %return.loopexit, %entry
- ret void
-}
diff --git a/release_23/test/Transforms/LoopIndexSplit/OneIterLoop2-2007-08-17.ll b/release_23/test/Transforms/LoopIndexSplit/OneIterLoop2-2007-08-17.ll
deleted file mode 100644
index a1ee8185e40e..000000000000
--- a/release_23/test/Transforms/LoopIndexSplit/OneIterLoop2-2007-08-17.ll
+++ /dev/null
@@ -1,62 +0,0 @@
-; Loop is elimianted. Save last value assignment.
-; RUN: llvm-as < %s | opt -loop-index-split -disable-output -stats |& \
-; RUN: grep "loop-index-split" | count 1
-
- %struct.anon = type { i32 }
-@S1 = external global i32 ; <i32*> [#uses=1]
-@W1 = external global i32 ; <i32*> [#uses=1]
-@Y = weak global [100 x %struct.anon] zeroinitializer, align 32 ; <[100 x %struct.anon]*> [#uses=1]
-@ti = external global i32 ; <i32*> [#uses=1]
-@T2 = external global [100 x [100 x i32]] ; <[100 x [100 x i32]]*> [#uses=1]
-@d = external global i32 ; <i32*> [#uses=1]
-@T1 = external global i32 ; <i32*> [#uses=2]
-@N1 = external global i32 ; <i32*> [#uses=2]
-
-define void @foo() {
-entry:
- %tmp = load i32* @S1, align 4 ; <i32> [#uses=2]
- %tmp266 = load i32* @N1, align 4 ; <i32> [#uses=1]
- %tmp288 = icmp ult i32 %tmp, %tmp266 ; <i1> [#uses=1]
- br i1 %tmp288, label %bb.preheader, label %return
-
-bb.preheader: ; preds = %entry
- %tmp1 = load i32* @W1, align 4 ; <i32> [#uses=1]
- %tmp13 = load i32* @ti, align 4 ; <i32> [#uses=1]
- %tmp18 = load i32* @d, align 4 ; <i32> [#uses=1]
- %tmp26 = load i32* @N1, align 4 ; <i32> [#uses=1]
- %T1.promoted = load i32* @T1 ; <i32> [#uses=1]
- br label %bb
-
-bb: ; preds = %bb.preheader, %bb25
- %T1.tmp.1 = phi i32 [ %T1.promoted, %bb.preheader ], [ %T1.tmp.0, %bb25 ] ; <i32> [#uses=3]
- %tj.01.0 = phi i32 [ %tmp24, %bb25 ], [ %tmp, %bb.preheader ] ; <i32> [#uses=4]
- %tmp24 = add i32 %tj.01.0, 1 ; <i32> [#uses=2]
- %tmp3 = icmp eq i32 %tmp24, %tmp1 ; <i1> [#uses=1]
- br i1 %tmp3, label %cond_true, label %bb25
-
-cond_true: ; preds = %bb
- %tmp7 = getelementptr [100 x %struct.anon]* @Y, i32 0, i32 %tj.01.0, i32 0 ; <i32*> [#uses=1]
- %tmp8 = load i32* %tmp7, align 4 ; <i32> [#uses=1]
- %tmp9 = icmp sgt i32 %tmp8, 0 ; <i1> [#uses=1]
- br i1 %tmp9, label %cond_true12, label %bb25
-
-cond_true12: ; preds = %cond_true
- %tmp16 = getelementptr [100 x [100 x i32]]* @T2, i32 0, i32 %tmp13, i32 %tj.01.0 ; <i32*> [#uses=1]
- %tmp17 = load i32* %tmp16, align 4 ; <i32> [#uses=1]
- %tmp19 = mul i32 %tmp18, %tmp17 ; <i32> [#uses=1]
- %tmp21 = add i32 %tmp19, %T1.tmp.1 ; <i32> [#uses=1]
- br label %bb25
-
-bb25: ; preds = %cond_true, %bb, %cond_true12
- %T1.tmp.0 = phi i32 [ %T1.tmp.1, %bb ], [ %T1.tmp.1, %cond_true ], [ %tmp21, %cond_true12 ] ; <i32> [#uses=2]
- %tmp28 = icmp ult i32 %tmp24, %tmp26 ; <i1> [#uses=1]
- br i1 %tmp28, label %bb, label %return.loopexit
-
-return.loopexit: ; preds = %bb25
- %T1.tmp.0.lcssa = phi i32 [ %T1.tmp.0, %bb25 ] ; <i32> [#uses=1]
- store i32 %T1.tmp.0.lcssa, i32* @T1
- br label %return
-
-return: ; preds = %return.loopexit, %entry
- ret void
-}
diff --git a/release_23/test/Transforms/LoopIndexSplit/OneIterLoop3-2007-08-17.ll b/release_23/test/Transforms/LoopIndexSplit/OneIterLoop3-2007-08-17.ll
deleted file mode 100644
index 9ca8923a6fa0..000000000000
--- a/release_23/test/Transforms/LoopIndexSplit/OneIterLoop3-2007-08-17.ll
+++ /dev/null
@@ -1,35 +0,0 @@
-; Loop is elimianted. Save last value assignments, including induction variable.
-; RUN: llvm-as < %s | opt -loop-index-split -disable-output -stats |& \
-; RUN: grep "loop-index-split" | count 1
-
-declare i32 @foo(i32)
-declare i32 @bar(i32, i32)
-
-define void @foobar(i32 %a, i32 %b) {
-entry:
- br label %bb
-
-bb: ; preds = %cond_next, %entry
- %i.01.0 = phi i32 [ 0, %entry ], [ %tmp8, %cond_next ] ; <i32> [#uses=3]
- %tsum.16.0 = phi i32 [ 42, %entry ], [ %tsum.0, %cond_next ] ; <i32> [#uses=2]
- %tmp1 = icmp eq i32 %i.01.0, 50 ; <i1> [#uses=1]
- br i1 %tmp1, label %cond_true, label %cond_next
-
-cond_true: ; preds = %bb
- %tmp4 = tail call i32 @foo( i32 %i.01.0 ) ; <i32> [#uses=1]
- %tmp6 = add i32 %tmp4, %tsum.16.0 ; <i32> [#uses=1]
- br label %cond_next
-
-cond_next: ; preds = %bb, %cond_true
- %tsum.0 = phi i32 [ %tmp6, %cond_true ], [ %tsum.16.0, %bb ] ; <i32> [#uses=2]
- %tmp8 = add i32 %i.01.0, 1 ; <i32> [#uses=3]
- %tmp11 = icmp slt i32 %tmp8, 100 ; <i1> [#uses=1]
- br i1 %tmp11, label %bb, label %bb14
-
-bb14: ; preds = %cond_next
- %tmp8.lcssa = phi i32 [ %tmp8, %cond_next ] ; <i32> [#uses=1]
- %tsum.0.lcssa = phi i32 [ %tsum.0, %cond_next ] ; <i32> [#uses=1]
- %tmp17 = tail call i32 @bar( i32 %tmp8.lcssa, i32 %tsum.0.lcssa ) ; <i32> [#uses=0]
- ret void
-}
-
diff --git a/release_23/test/Transforms/LoopIndexSplit/SaveLastValue-2007-08-17.ll b/release_23/test/Transforms/LoopIndexSplit/SaveLastValue-2007-08-17.ll
deleted file mode 100644
index e19f22a6211c..000000000000
--- a/release_23/test/Transforms/LoopIndexSplit/SaveLastValue-2007-08-17.ll
+++ /dev/null
@@ -1,52 +0,0 @@
-; Split loop. Save last value.
-; RUN: llvm-as < %s | opt -loop-index-split -disable-output -stats |& \
-; RUN: grep "loop-index-split" | count 1
-
-@k = external global i32 ; <i32*> [#uses=2]
-
-define void @foobar(i32 %a, i32 %b) {
-entry:
- br label %bb
-
-bb: ; preds = %cond_next16, %entry
- %i.01.0 = phi i32 [ 0, %entry ], [ %tmp18, %cond_next16 ] ; <i32> [#uses=5]
- %tsum.18.0 = phi i32 [ 42, %entry ], [ %tsum.013.1, %cond_next16 ] ; <i32> [#uses=3]
- %tmp1 = icmp slt i32 %i.01.0, 50 ; <i1> [#uses=1]
- br i1 %tmp1, label %cond_true, label %cond_false
-
-cond_true: ; preds = %bb
- %tmp4 = tail call i32 @foo( i32 %i.01.0 ) ; <i32> [#uses=1]
- %tmp6 = add i32 %tmp4, %tsum.18.0 ; <i32> [#uses=2]
- %tmp914 = load i32* @k, align 4 ; <i32> [#uses=1]
- %tmp1015 = icmp eq i32 %tmp914, 0 ; <i1> [#uses=1]
- br i1 %tmp1015, label %cond_next16, label %cond_true13
-
-cond_false: ; preds = %bb
- %tmp8 = tail call i32 @bar( i32 %i.01.0 ) ; <i32> [#uses=0]
- %tmp9 = load i32* @k, align 4 ; <i32> [#uses=1]
- %tmp10 = icmp eq i32 %tmp9, 0 ; <i1> [#uses=1]
- br i1 %tmp10, label %cond_next16, label %cond_true13
-
-cond_true13: ; preds = %cond_false, %cond_true
- %tsum.013.0 = phi i32 [ %tmp6, %cond_true ], [ %tsum.18.0, %cond_false ] ; <i32> [#uses=1]
- %tmp15 = tail call i32 @bar( i32 %i.01.0 ) ; <i32> [#uses=0]
- br label %cond_next16
-
-cond_next16: ; preds = %cond_false, %cond_true, %cond_true13
- %tsum.013.1 = phi i32 [ %tsum.013.0, %cond_true13 ], [ %tmp6, %cond_true ], [ %tsum.18.0, %cond_false ] ; <i32> [#uses=2]
- %tmp18 = add i32 %i.01.0, 1 ; <i32> [#uses=3]
- %tmp21 = icmp slt i32 %tmp18, 100 ; <i1> [#uses=1]
- br i1 %tmp21, label %bb, label %bb24
-
-bb24: ; preds = %cond_next16
- %tmp18.lcssa = phi i32 [ %tmp18, %cond_next16 ] ; <i32> [#uses=1]
- %tsum.013.1.lcssa = phi i32 [ %tsum.013.1, %cond_next16 ] ; <i32> [#uses=1]
- %tmp27 = tail call i32 @t( i32 %tmp18.lcssa, i32 %tsum.013.1.lcssa ) ; <i32> [#uses=0]
- ret void
-}
-
-declare i32 @foo(i32)
-
-declare i32 @bar(i32)
-
-declare i32 @t(i32, i32)
diff --git a/release_23/test/Transforms/LoopIndexSplit/SplitValue-2007-08-24.ll b/release_23/test/Transforms/LoopIndexSplit/SplitValue-2007-08-24.ll
deleted file mode 100644
index 27327a059cf9..000000000000
--- a/release_23/test/Transforms/LoopIndexSplit/SplitValue-2007-08-24.ll
+++ /dev/null
@@ -1,52 +0,0 @@
-; Split loop. Save last value. Split value is off by one in this example.
-; RUN: llvm-as < %s | opt -loop-index-split -disable-output -stats |& \
-; RUN: grep "loop-index-split" | count 1
-
-@k = external global i32 ; <i32*> [#uses=2]
-
-define void @foobar(i32 %a, i32 %b) {
-entry:
- br label %bb
-
-bb: ; preds = %cond_next16, %entry
- %i.01.0 = phi i32 [ 0, %entry ], [ %tmp18, %cond_next16 ] ; <i32> [#uses=5]
- %tsum.18.0 = phi i32 [ 42, %entry ], [ %tsum.013.1, %cond_next16 ] ; <i32> [#uses=3]
- %tmp1 = icmp sgt i32 %i.01.0, 50 ; <i1> [#uses=1]
- br i1 %tmp1, label %cond_true, label %cond_false
-
-cond_true: ; preds = %bb
- %tmp4 = tail call i32 @foo( i32 %i.01.0 ) ; <i32> [#uses=1]
- %tmp6 = add i32 %tmp4, %tsum.18.0 ; <i32> [#uses=2]
- %tmp914 = load i32* @k, align 4 ; <i32> [#uses=1]
- %tmp1015 = icmp eq i32 %tmp914, 0 ; <i1> [#uses=1]
- br i1 %tmp1015, label %cond_next16, label %cond_true13
-
-cond_false: ; preds = %bb
- %tmp8 = tail call i32 @bar( i32 %i.01.0 ) ; <i32> [#uses=0]
- %tmp9 = load i32* @k, align 4 ; <i32> [#uses=1]
- %tmp10 = icmp eq i32 %tmp9, 0 ; <i1> [#uses=1]
- br i1 %tmp10, label %cond_next16, label %cond_true13
-
-cond_true13: ; preds = %cond_false, %cond_true
- %tsum.013.0 = phi i32 [ %tmp6, %cond_true ], [ %tsum.18.0, %cond_false ] ; <i32> [#uses=1]
- %tmp15 = tail call i32 @bar( i32 %i.01.0 ) ; <i32> [#uses=0]
- br label %cond_next16
-
-cond_next16: ; preds = %cond_false, %cond_true, %cond_true13
- %tsum.013.1 = phi i32 [ %tsum.013.0, %cond_true13 ], [ %tmp6, %cond_true ], [ %tsum.18.0, %cond_false ] ; <i32> [#uses=2]
- %tmp18 = add i32 %i.01.0, 1 ; <i32> [#uses=3]
- %tmp21 = icmp slt i32 %tmp18, 100 ; <i1> [#uses=1]
- br i1 %tmp21, label %bb, label %bb24
-
-bb24: ; preds = %cond_next16
- %tmp18.lcssa = phi i32 [ %tmp18, %cond_next16 ] ; <i32> [#uses=1]
- %tsum.013.1.lcssa = phi i32 [ %tsum.013.1, %cond_next16 ] ; <i32> [#uses=1]
- %tmp27 = tail call i32 @t( i32 %tmp18.lcssa, i32 %tsum.013.1.lcssa ) ; <i32> [#uses=0]
- ret void
-}
-
-declare i32 @foo(i32)
-
-declare i32 @bar(i32)
-
-declare i32 @t(i32, i32)
diff --git a/release_23/test/Transforms/LoopIndexSplit/UpperBound-2007-08-24.ll b/release_23/test/Transforms/LoopIndexSplit/UpperBound-2007-08-24.ll
deleted file mode 100644
index c5064517dd1d..000000000000
--- a/release_23/test/Transforms/LoopIndexSplit/UpperBound-2007-08-24.ll
+++ /dev/null
@@ -1,52 +0,0 @@
-; Split loop. Split value is a constant and greater then exit value.
-; Check whether optimizer inserts proper checkfor split value or not.
-; RUN: llvm-as < %s | opt -loop-index-split | llvm-dis | grep select
-
-@k = external global i32 ; <i32*> [#uses=2]
-
-define void @foobar(i32 %a, i32 %b) {
-entry:
- br label %bb
-
-bb: ; preds = %cond_next16, %entry
- %i.01.0 = phi i32 [ 0, %entry ], [ %tmp18, %cond_next16 ] ; <i32> [#uses=5]
- %tsum.18.0 = phi i32 [ 42, %entry ], [ %tsum.013.1, %cond_next16 ] ; <i32> [#uses=3]
- %tmp1 = icmp slt i32 %i.01.0, 500 ; <i1> [#uses=1]
- br i1 %tmp1, label %cond_true, label %cond_false
-
-cond_true: ; preds = %bb
- %tmp4 = tail call i32 @foo( i32 %i.01.0 ) ; <i32> [#uses=1]
- %tmp6 = add i32 %tmp4, %tsum.18.0 ; <i32> [#uses=2]
- %tmp914 = load i32* @k, align 4 ; <i32> [#uses=1]
- %tmp1015 = icmp eq i32 %tmp914, 0 ; <i1> [#uses=1]
- br i1 %tmp1015, label %cond_next16, label %cond_true13
-
-cond_false: ; preds = %bb
- %tmp8 = tail call i32 @bar( i32 %i.01.0 ) ; <i32> [#uses=0]
- %tmp9 = load i32* @k, align 4 ; <i32> [#uses=1]
- %tmp10 = icmp eq i32 %tmp9, 0 ; <i1> [#uses=1]
- br i1 %tmp10, label %cond_next16, label %cond_true13
-
-cond_true13: ; preds = %cond_false, %cond_true
- %tsum.013.0 = phi i32 [ %tmp6, %cond_true ], [ %tsum.18.0, %cond_false ] ; <i32> [#uses=1]
- %tmp15 = tail call i32 @bar( i32 %i.01.0 ) ; <i32> [#uses=0]
- br label %cond_next16
-
-cond_next16: ; preds = %cond_false, %cond_true, %cond_true13
- %tsum.013.1 = phi i32 [ %tsum.013.0, %cond_true13 ], [ %tmp6, %cond_true ], [ %tsum.18.0, %cond_false ] ; <i32> [#uses=2]
- %tmp18 = add i32 %i.01.0, 1 ; <i32> [#uses=3]
- %tmp21 = icmp slt i32 %tmp18, 100 ; <i1> [#uses=1]
- br i1 %tmp21, label %bb, label %bb24
-
-bb24: ; preds = %cond_next16
- %tmp18.lcssa = phi i32 [ %tmp18, %cond_next16 ] ; <i32> [#uses=1]
- %tsum.013.1.lcssa = phi i32 [ %tsum.013.1, %cond_next16 ] ; <i32> [#uses=1]
- %tmp27 = tail call i32 @t( i32 %tmp18.lcssa, i32 %tsum.013.1.lcssa ) ; <i32> [#uses=0]
- ret void
-}
-
-declare i32 @foo(i32)
-
-declare i32 @bar(i32)
-
-declare i32 @t(i32, i32)
diff --git a/release_23/test/Transforms/LoopIndexSplit/dg.exp b/release_23/test/Transforms/LoopIndexSplit/dg.exp
deleted file mode 100644
index 879685ca879d..000000000000
--- a/release_23/test/Transforms/LoopIndexSplit/dg.exp
+++ /dev/null
@@ -1,3 +0,0 @@
-load_lib llvm.exp
-
-RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
diff --git a/release_23/test/Transforms/LoopRotate/LRCrash-1.ll b/release_23/test/Transforms/LoopRotate/LRCrash-1.ll
deleted file mode 100644
index e6c7667d5975..000000000000
--- a/release_23/test/Transforms/LoopRotate/LRCrash-1.ll
+++ /dev/null
@@ -1,18 +0,0 @@
-; RUN: llvm-as < %s | opt -loop-rotate -disable-output
-
- %struct.relation = type { [4 x i16], i32, [4 x i16], i32, i32 }
-
-define void @findAllPairs() {
-entry:
- br i1 false, label %bb139, label %bb10.i44
-bb10.i44: ; preds = %entry
- ret void
-bb127: ; preds = %bb139
- br label %bb139
-bb139: ; preds = %bb127, %entry
- br i1 false, label %bb127, label %bb142
-bb142: ; preds = %bb139
- %r91.0.lcssa = phi %struct.relation* [ null, %bb139 ] ; <%struct.relation*> [#uses=0]
- ret void
-}
-
diff --git a/release_23/test/Transforms/LoopRotate/LRCrash-2.ll b/release_23/test/Transforms/LoopRotate/LRCrash-2.ll
deleted file mode 100644
index 6dbe76df9eb3..000000000000
--- a/release_23/test/Transforms/LoopRotate/LRCrash-2.ll
+++ /dev/null
@@ -1,24 +0,0 @@
-; RUN: llvm-as < %s | opt -loop-rotate -disable-output
-
-define void @findAllPairs() {
-entry:
- br i1 false, label %bb139, label %cond_true
-cond_true: ; preds = %entry
- ret void
-bb90: ; preds = %bb139
- br i1 false, label %bb136, label %cond_next121
-cond_next121: ; preds = %bb90
- br i1 false, label %bb136, label %bb127
-bb127: ; preds = %cond_next121
- br label %bb136
-bb136: ; preds = %bb127, %cond_next121, %bb90
- %changes.1 = phi i32 [ %changes.2, %bb90 ], [ %changes.2, %cond_next121 ], [ 1, %bb127 ] ; <i32> [#uses=1]
- br label %bb139
-bb139: ; preds = %bb136, %entry
- %changes.2 = phi i32 [ %changes.1, %bb136 ], [ 0, %entry ] ; <i32> [#uses=3]
- br i1 false, label %bb90, label %bb142
-bb142: ; preds = %bb139
- %changes.2.lcssa = phi i32 [ %changes.2, %bb139 ] ; <i32> [#uses=0]
- ret void
-}
-
diff --git a/release_23/test/Transforms/LoopRotate/LRCrash-3.ll b/release_23/test/Transforms/LoopRotate/LRCrash-3.ll
deleted file mode 100644
index 94991a55b824..000000000000
--- a/release_23/test/Transforms/LoopRotate/LRCrash-3.ll
+++ /dev/null
@@ -1,29 +0,0 @@
-; RUN: llvm-as < %s | opt -loop-rotate -disable-output
-
-define void @_ZN9Classfile4readEv() {
-entry:
- br i1 false, label %cond_false485, label %bb405
-bb405: ; preds = %entry
- ret void
-cond_false485: ; preds = %entry
- br label %bb830
-bb511: ; preds = %bb830
- br i1 false, label %bb816, label %bb830
-cond_next667: ; preds = %bb816
- br i1 false, label %cond_next695, label %bb680
-bb676: ; preds = %bb680
- br label %bb680
-bb680: ; preds = %bb676, %cond_next667
- %iftmp.68.0 = zext i1 false to i8 ; <i8> [#uses=1]
- br i1 false, label %bb676, label %cond_next695
-cond_next695: ; preds = %bb680, %cond_next667
- %iftmp.68.2 = phi i8 [ %iftmp.68.0, %bb680 ], [ undef, %cond_next667 ] ; <i8> [#uses=0]
- ret void
-bb816: ; preds = %bb816, %bb511
- br i1 false, label %cond_next667, label %bb816
-bb830: ; preds = %bb511, %cond_false485
- br i1 false, label %bb511, label %bb835
-bb835: ; preds = %bb830
- ret void
-}
-
diff --git a/release_23/test/Transforms/LoopRotate/LRCrash-4.ll b/release_23/test/Transforms/LoopRotate/LRCrash-4.ll
deleted file mode 100644
index ab43fc88922c..000000000000
--- a/release_23/test/Transforms/LoopRotate/LRCrash-4.ll
+++ /dev/null
@@ -1,18 +0,0 @@
-; RUN: llvm-as < %s | opt -loop-rotate -disable-output
-
-define void @InterpretSEIMessage(i8* %msg) {
-entry:
- br label %bb15
-bb6: ; preds = %bb15
- %gep.upgrd.1 = zext i32 %offset.1 to i64 ; <i64> [#uses=1]
- %tmp11 = getelementptr i8* %msg, i64 %gep.upgrd.1 ; <i8*> [#uses=0]
- br label %bb15
-bb15: ; preds = %bb6, %entry
- %offset.1 = add i32 0, 1 ; <i32> [#uses=2]
- br i1 false, label %bb6, label %bb17
-bb17: ; preds = %bb15
- %offset.1.lcssa = phi i32 [ %offset.1, %bb15 ] ; <i32> [#uses=0]
- %payload_type.1.lcssa = phi i32 [ 0, %bb15 ] ; <i32> [#uses=0]
- ret void
-}
-
diff --git a/release_23/test/Transforms/LoopRotate/LRCrash-5.ll b/release_23/test/Transforms/LoopRotate/LRCrash-5.ll
deleted file mode 100644
index d61e749d7ee4..000000000000
--- a/release_23/test/Transforms/LoopRotate/LRCrash-5.ll
+++ /dev/null
@@ -1,26 +0,0 @@
-; RUN: llvm-as < %s | opt -loop-rotate -disable-output
-target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128"
-target triple = "x86_64-apple-darwin9"
- %struct.NSArray = type { %struct.NSObject }
- %struct.NSObject = type { %struct.objc_class* }
- %struct.NSRange = type { i64, i64 }
- %struct._message_ref_t = type { %struct.NSObject* (%struct.NSObject*, %struct._message_ref_t*, ...)*, %struct.objc_selector* }
- %struct.objc_class = type opaque
- %struct.objc_selector = type opaque
-@"\01L_OBJC_MESSAGE_REF_26" = external global %struct._message_ref_t ; <%struct._message_ref_t*> [#uses=1]
-
-define %struct.NSArray* @"-[NSString(DocSetPrivateAddition) _dsa_stringAsPathComponent]"(%struct.NSArray* %self, %struct._message_ref_t* %_cmd) {
-entry:
- br label %bb116
-
-bb116: ; preds = %bb131, %entry
- %tmp123 = call %struct.NSRange null( %struct.NSObject* null, %struct._message_ref_t* @"\01L_OBJC_MESSAGE_REF_26", %struct.NSArray* null ) ; <%struct.NSRange> [#uses=1]
- br i1 false, label %bb141, label %bb131
-
-bb131: ; preds = %bb116
- %mrv_gr125 = getresult %struct.NSRange %tmp123, 1 ; <i64> [#uses=0]
- br label %bb116
-
-bb141: ; preds = %bb116
- ret %struct.NSArray* null
-}
diff --git a/release_23/test/Transforms/LoopRotate/PhiRename-1.ll b/release_23/test/Transforms/LoopRotate/PhiRename-1.ll
deleted file mode 100644
index 573e3960bd86..000000000000
--- a/release_23/test/Transforms/LoopRotate/PhiRename-1.ll
+++ /dev/null
@@ -1,95 +0,0 @@
-; RUN: llvm-as < %s | opt -loop-rotate | llvm-dis | not grep {\\\[ .tmp224}
-; END.
-target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64"
-
- %struct.FILE = type { i8*, i32, i32, i16, i16, %struct.__sbuf, i32, i8*, i32 (i8*)*, i32 (i8*, i8*, i32)*, i64 (i8*, i64, i32)*, i32 (i8*, i8*, i32)*, %struct.__sbuf, %struct.__sFILEX*, i32, [3 x i8], [1 x i8], %struct.__sbuf, i32, i64 }
- %struct.Index_Map = type { i32, %struct.item_set** }
- %struct.Item = type { [4 x i16], %struct.rule* }
- %struct.__sFILEX = type opaque
- %struct.__sbuf = type { i8*, i32 }
- %struct.dimension = type { i16*, %struct.Index_Map, %struct.mapping*, i32, %struct.plankMap* }
- %struct.item_set = type { i32, i32, %struct.operator*, [2 x %struct.item_set*], %struct.item_set*, i16*, %struct.Item*, %struct.Item* }
- %struct.list = type { i8*, %struct.list* }
- %struct.mapping = type { %struct.list**, i32, i32, i32, %struct.item_set** }
- %struct.nonterminal = type { i8*, i32, i32, i32, %struct.plankMap*, %struct.rule* }
- %struct.operator = type { i8*, i8, i32, i32, i32, i32, %struct.table* }
- %struct.pattern = type { %struct.nonterminal*, %struct.operator*, [2 x %struct.nonterminal*] }
- %struct.plank = type { i8*, %struct.list*, i32 }
- %struct.plankMap = type { %struct.list*, i32, %struct.stateMap* }
- %struct.rule = type { [4 x i16], i32, i32, i32, %struct.nonterminal*, %struct.pattern*, i8 }
- %struct.stateMap = type { i8*, %struct.plank*, i32, i16* }
- %struct.table = type { %struct.operator*, %struct.list*, i16*, [2 x %struct.dimension*], %struct.item_set** }
-@outfile = external global %struct.FILE* ; <%struct.FILE**> [#uses=1]
-@str1 = external constant [11 x i8] ; <[11 x i8]*> [#uses=1]
-@operators = weak global %struct.list* null ; <%struct.list**> [#uses=1]
-
-
-
-define i32 @opsOfArity(i32 %arity) {
-entry:
- %arity_addr = alloca i32 ; <i32*> [#uses=2]
- %retval = alloca i32, align 4 ; <i32*> [#uses=2]
- %tmp = alloca i32, align 4 ; <i32*> [#uses=2]
- %c = alloca i32, align 4 ; <i32*> [#uses=4]
- %l = alloca %struct.list*, align 4 ; <%struct.list**> [#uses=5]
- %op = alloca %struct.operator*, align 4 ; <%struct.operator**> [#uses=3]
- "alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
- store i32 %arity, i32* %arity_addr
- store i32 0, i32* %c
- %tmp1 = load %struct.list** @operators ; <%struct.list*> [#uses=1]
- store %struct.list* %tmp1, %struct.list** %l
- br label %bb21
-
-bb: ; preds = %bb21
- %tmp3 = getelementptr %struct.list* %tmp22, i32 0, i32 0 ; <i8**> [#uses=1]
- %tmp4 = load i8** %tmp3 ; <i8*> [#uses=1]
- %tmp45 = bitcast i8* %tmp4 to %struct.operator* ; <%struct.operator*> [#uses=1]
- store %struct.operator* %tmp45, %struct.operator** %op
- %tmp6 = load %struct.operator** %op ; <%struct.operator*> [#uses=1]
- %tmp7 = getelementptr %struct.operator* %tmp6, i32 0, i32 5 ; <i32*> [#uses=1]
- %tmp8 = load i32* %tmp7 ; <i32> [#uses=1]
- %tmp9 = load i32* %arity_addr ; <i32> [#uses=1]
- icmp eq i32 %tmp8, %tmp9 ; <i1>:0 [#uses=1]
- zext i1 %0 to i8 ; <i8>:1 [#uses=1]
- icmp ne i8 %1, 0 ; <i1>:2 [#uses=1]
- br i1 %2, label %cond_true, label %cond_next
-
-cond_true: ; preds = %bb
- %tmp10 = load %struct.operator** %op ; <%struct.operator*> [#uses=1]
- %tmp11 = getelementptr %struct.operator* %tmp10, i32 0, i32 2 ; <i32*> [#uses=1]
- %tmp12 = load i32* %tmp11 ; <i32> [#uses=1]
- %tmp13 = load %struct.FILE** @outfile ; <%struct.FILE*> [#uses=1]
- %tmp14 = getelementptr [11 x i8]* @str1, i32 0, i32 0 ; <i8*> [#uses=1]
- %tmp15 = call i32 (%struct.FILE*, i8*, ...)* @fprintf( %struct.FILE* %tmp13, i8* %tmp14, i32 %tmp12 ) ; <i32> [#uses=0]
- %tmp16 = load i32* %c ; <i32> [#uses=1]
- %tmp17 = add i32 %tmp16, 1 ; <i32> [#uses=1]
- store i32 %tmp17, i32* %c
- br label %cond_next
-
-cond_next: ; preds = %cond_true, %bb
- %tmp19 = getelementptr %struct.list* %tmp22, i32 0, i32 1 ; <%struct.list**> [#uses=1]
- %tmp20 = load %struct.list** %tmp19 ; <%struct.list*> [#uses=1]
- store %struct.list* %tmp20, %struct.list** %l
- br label %bb21
-
-bb21: ; preds = %cond_next, %entry
- %l.in = phi %struct.list** [ @operators, %entry ], [ %tmp19, %cond_next ] ;
- %tmp22 = load %struct.list** %l.in ; <%struct.list*> [#uses=1]
- icmp ne %struct.list* %tmp22, null ; <i1>:3 [#uses=1]
- zext i1 %3 to i8 ; <i8>:4 [#uses=1]
- icmp ne i8 %4, 0 ; <i1>:5 [#uses=1]
- br i1 %5, label %bb, label %bb23
-
-bb23: ; preds = %bb21
- %tmp24 = load i32* %c ; <i32> [#uses=1]
- store i32 %tmp24, i32* %tmp
- %tmp25 = load i32* %tmp ; <i32> [#uses=1]
- store i32 %tmp25, i32* %retval
- br label %return
-
-return: ; preds = %bb23
- %retval26 = load i32* %retval ; <i32> [#uses=1]
- ret i32 %retval26
-}
-
-declare i32 @fprintf(%struct.FILE*, i8*, ...)
diff --git a/release_23/test/Transforms/LoopRotate/PhiSelfRefernce-1.ll b/release_23/test/Transforms/LoopRotate/PhiSelfRefernce-1.ll
deleted file mode 100644
index a55704b1fdb6..000000000000
--- a/release_23/test/Transforms/LoopRotate/PhiSelfRefernce-1.ll
+++ /dev/null
@@ -1,39 +0,0 @@
-; RUN: llvm-as < %s | opt -loop-rotate -disable-output
-; ModuleID = 'PhiSelfRefernce-1.bc'
-
-define void @snrm2(i32 %incx) {
-entry:
- br i1 false, label %START, label %return
-
-START: ; preds = %entry
- br i1 false, label %bb85, label %cond_false93
-
-bb52: ; preds = %bb85
- br i1 false, label %bb307, label %cond_next71
-
-cond_next71: ; preds = %bb52
- ret void
-
-bb85: ; preds = %START
- br i1 false, label %bb52, label %bb88
-
-bb88: ; preds = %bb85
- ret void
-
-cond_false93: ; preds = %START
- ret void
-
-bb243: ; preds = %bb307
- br label %bb307
-
-bb307: ; preds = %bb243, %bb52
- %sx_addr.2.pn = phi float* [ %sx_addr.5, %bb243 ], [ null, %bb52 ] ; <float*> [#uses=1]
- %sx_addr.5 = getelementptr float* %sx_addr.2.pn, i32 %incx ; <float*> [#uses=1]
- br i1 false, label %bb243, label %bb310
-
-bb310: ; preds = %bb307
- ret void
-
-return: ; preds = %entry
- ret void
-}
diff --git a/release_23/test/Transforms/LoopRotate/dg.exp b/release_23/test/Transforms/LoopRotate/dg.exp
deleted file mode 100644
index 879685ca879d..000000000000
--- a/release_23/test/Transforms/LoopRotate/dg.exp
+++ /dev/null
@@ -1,3 +0,0 @@
-load_lib llvm.exp
-
-RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
diff --git a/release_23/test/Transforms/LoopSimplify/2003-04-25-AssertFail.ll b/release_23/test/Transforms/LoopSimplify/2003-04-25-AssertFail.ll
deleted file mode 100644
index 70445fb8f8c1..000000000000
--- a/release_23/test/Transforms/LoopSimplify/2003-04-25-AssertFail.ll
+++ /dev/null
@@ -1,20 +0,0 @@
-; This testcase exposed a problem with the loop identification pass (LoopInfo).
-; Basically, it was incorrectly calculating the loop nesting information.
-;
-; RUN: llvm-as < %s | opt -loopsimplify
-
-define i32 @yylex() {
- br label %loopentry.0
-loopentry.0: ; preds = %else.4, %0
- br label %loopexit.2
-loopexit.2: ; preds = %else.4, %loopexit.2, %loopentry.0
- br i1 false, label %loopexit.2, label %else.4
-yy_find_action: ; preds = %else.4
- br label %else.4
-else.4: ; preds = %yy_find_action, %loopexit.2
- switch i32 0, label %loopexit.2 [
- i32 2, label %yy_find_action
- i32 0, label %loopentry.0
- ]
-}
-
diff --git a/release_23/test/Transforms/LoopSimplify/2003-05-12-PreheaderExitOfChild.ll b/release_23/test/Transforms/LoopSimplify/2003-05-12-PreheaderExitOfChild.ll
deleted file mode 100644
index ba2eef7095b1..000000000000
--- a/release_23/test/Transforms/LoopSimplify/2003-05-12-PreheaderExitOfChild.ll
+++ /dev/null
@@ -1,42 +0,0 @@
-; This (complex) testcase causes an assertion failure because a preheader is
-; inserted for the "fail" loop, but the exit block of a loop is not updated
-; to be the preheader instead of the exit loop itself.
-
-; RUN: llvm-as < %s | opt -loopsimplify
-define i32 @re_match_2() {
- br label %loopentry.1
-loopentry.1: ; preds = %endif.82, %0
- br label %shortcirc_done.36
-shortcirc_done.36: ; preds = %loopentry.1
- br i1 false, label %fail, label %endif.40
-endif.40: ; preds = %shortcirc_done.36
- br label %loopexit.20
-loopentry.20: ; preds = %endif.46
- br label %loopexit.20
-loopexit.20: ; preds = %loopentry.20, %endif.40
- br label %loopentry.21
-loopentry.21: ; preds = %no_exit.19, %loopexit.20
- br i1 false, label %no_exit.19, label %loopexit.21
-no_exit.19: ; preds = %loopentry.21
- br i1 false, label %fail, label %loopentry.21
-loopexit.21: ; preds = %loopentry.21
- br label %endif.45
-endif.45: ; preds = %loopexit.21
- br label %cond_true.15
-cond_true.15: ; preds = %endif.45
- br i1 false, label %fail, label %endif.46
-endif.46: ; preds = %cond_true.15
- br label %loopentry.20
-fail: ; preds = %loopexit.37, %cond_true.15, %no_exit.19, %shortcirc_done.36
- br label %then.80
-then.80: ; preds = %fail
- br label %endif.81
-endif.81: ; preds = %then.80
- br label %loopexit.37
-loopexit.37: ; preds = %endif.81
- br i1 false, label %fail, label %endif.82
-endif.82: ; preds = %loopexit.37
- br label %loopentry.1
-}
-
-
diff --git a/release_23/test/Transforms/LoopSimplify/2003-08-15-PreheadersFail.ll b/release_23/test/Transforms/LoopSimplify/2003-08-15-PreheadersFail.ll
deleted file mode 100644
index 53fc59edfc99..000000000000
--- a/release_23/test/Transforms/LoopSimplify/2003-08-15-PreheadersFail.ll
+++ /dev/null
@@ -1,52 +0,0 @@
-; RUN: llvm-as < %s | opt -tailduplicate -instcombine -simplifycfg -licm -disable-output
-target datalayout = "e-p:32:32"
-@yy_base = external global [787 x i16] ; <[787 x i16]*> [#uses=1]
-@yy_state_ptr = external global i32* ; <i32**> [#uses=3]
-@yy_state_buf = external global [16386 x i32] ; <[16386 x i32]*> [#uses=1]
-@yy_lp = external global i32 ; <i32*> [#uses=1]
-
-define i32 @_yylex() {
- br label %loopentry.0
-loopentry.0: ; preds = %else.26, %0
- store i32* getelementptr ([16386 x i32]* @yy_state_buf, i64 0, i64 0), i32** @yy_state_ptr
- %tmp.35 = load i32** @yy_state_ptr ; <i32*> [#uses=2]
- %inc.0 = getelementptr i32* %tmp.35, i64 1 ; <i32*> [#uses=1]
- store i32* %inc.0, i32** @yy_state_ptr
- %tmp.36 = load i32* null ; <i32> [#uses=1]
- store i32 %tmp.36, i32* %tmp.35
- br label %loopexit.2
-loopexit.2: ; preds = %else.26, %loopexit.2, %loopentry.0
- store i8* null, i8** null
- %tmp.91 = load i32* null ; <i32> [#uses=1]
- %tmp.92 = sext i32 %tmp.91 to i64 ; <i64> [#uses=1]
- %tmp.93 = getelementptr [787 x i16]* @yy_base, i64 0, i64 %tmp.92 ; <i16*> [#uses=1]
- %tmp.94 = load i16* %tmp.93 ; <i16> [#uses=1]
- %tmp.95 = icmp ne i16 %tmp.94, 4394 ; <i1> [#uses=1]
- br i1 %tmp.95, label %loopexit.2, label %yy_find_action
-yy_find_action: ; preds = %else.26, %loopexit.2
- br label %loopentry.3
-loopentry.3: ; preds = %then.9, %shortcirc_done.0, %yy_find_action
- %tmp.105 = load i32* @yy_lp ; <i32> [#uses=1]
- %tmp.106 = icmp ne i32 %tmp.105, 0 ; <i1> [#uses=1]
- br i1 %tmp.106, label %shortcirc_next.0, label %shortcirc_done.0
-shortcirc_next.0: ; preds = %loopentry.3
- %tmp.114 = load i16* null ; <i16> [#uses=1]
- %tmp.115 = sext i16 %tmp.114 to i32 ; <i32> [#uses=1]
- %tmp.116 = icmp slt i32 0, %tmp.115 ; <i1> [#uses=1]
- br label %shortcirc_done.0
-shortcirc_done.0: ; preds = %shortcirc_next.0, %loopentry.3
- %shortcirc_val.0 = phi i1 [ false, %loopentry.3 ], [ %tmp.116, %shortcirc_next.0 ] ; <i1> [#uses=1]
- br i1 %shortcirc_val.0, label %else.0, label %loopentry.3
-else.0: ; preds = %shortcirc_done.0
- %tmp.144 = load i32* null ; <i32> [#uses=1]
- %tmp.145 = and i32 %tmp.144, 8192 ; <i32> [#uses=1]
- %tmp.146 = icmp ne i32 %tmp.145, 0 ; <i1> [#uses=1]
- br i1 %tmp.146, label %then.9, label %else.26
-then.9: ; preds = %else.0
- br label %loopentry.3
-else.26: ; preds = %else.0
- switch i32 0, label %loopentry.0 [
- i32 2, label %yy_find_action
- i32 0, label %loopexit.2
- ]
-}
diff --git a/release_23/test/Transforms/LoopSimplify/2003-12-10-ExitBlocksProblem.ll b/release_23/test/Transforms/LoopSimplify/2003-12-10-ExitBlocksProblem.ll
deleted file mode 100644
index bd39330cb49d..000000000000
--- a/release_23/test/Transforms/LoopSimplify/2003-12-10-ExitBlocksProblem.ll
+++ /dev/null
@@ -1,36 +0,0 @@
-; LoopSimplify is breaking LICM on this testcase because the exit blocks from
-; the loop are reachable from more than just the exit nodes: the exit blocks
-; have predecessors from outside of the loop!
-;
-; This is distilled from a monsterous crafty example.
-
-; RUN: llvm-as < %s | opt -licm -disable-output
-
-
-@G = weak global i32 0 ; <i32*> [#uses=7]
-
-define i32 @main() {
-entry:
- store i32 123, i32* @G
- br label %loopentry.i
-loopentry.i: ; preds = %endif.1.i, %entry
- %tmp.0.i = load i32* @G ; <i32> [#uses=1]
- %tmp.1.i = icmp eq i32 %tmp.0.i, 123 ; <i1> [#uses=1]
- br i1 %tmp.1.i, label %Out.i, label %endif.0.i
-endif.0.i: ; preds = %loopentry.i
- %tmp.3.i = load i32* @G ; <i32> [#uses=1]
- %tmp.4.i = icmp eq i32 %tmp.3.i, 126 ; <i1> [#uses=1]
- br i1 %tmp.4.i, label %ExitBlock.i, label %endif.1.i
-endif.1.i: ; preds = %endif.0.i
- %tmp.6.i = load i32* @G ; <i32> [#uses=1]
- %inc.i = add i32 %tmp.6.i, 1 ; <i32> [#uses=1]
- store i32 %inc.i, i32* @G
- br label %loopentry.i
-Out.i: ; preds = %loopentry.i
- store i32 0, i32* @G
- br label %ExitBlock.i
-ExitBlock.i: ; preds = %Out.i, %endif.0.i
- %tmp.7.i = load i32* @G ; <i32> [#uses=1]
- ret i32 %tmp.7.i
-}
-
diff --git a/release_23/test/Transforms/LoopSimplify/2004-02-05-DominatorInfoCorruption.ll b/release_23/test/Transforms/LoopSimplify/2004-02-05-DominatorInfoCorruption.ll
deleted file mode 100644
index b8ced96f23fe..000000000000
--- a/release_23/test/Transforms/LoopSimplify/2004-02-05-DominatorInfoCorruption.ll
+++ /dev/null
@@ -1,14 +0,0 @@
-; RUN: llvm-as < %s | opt -loopsimplify -verify -licm -disable-output
-
-define void @.subst_48() {
-entry:
- br label %loopentry.0
-loopentry.0: ; preds = %loopentry.0, %entry
- br i1 false, label %loopentry.0, label %loopentry.2
-loopentry.2: ; preds = %loopentry.2, %loopentry.0
- %tmp.968 = icmp sle i32 0, 3 ; <i1> [#uses=1]
- br i1 %tmp.968, label %loopentry.2, label %UnifiedReturnBlock
-UnifiedReturnBlock: ; preds = %loopentry.2
- ret void
-}
-
diff --git a/release_23/test/Transforms/LoopSimplify/2004-03-15-IncorrectDomUpdate.ll b/release_23/test/Transforms/LoopSimplify/2004-03-15-IncorrectDomUpdate.ll
deleted file mode 100644
index 439ea7e2228a..000000000000
--- a/release_23/test/Transforms/LoopSimplify/2004-03-15-IncorrectDomUpdate.ll
+++ /dev/null
@@ -1,11 +0,0 @@
-; RUN: llvm-as < %s | opt -loopsimplify -licm -disable-output
-define void @main() {
-entry:
- br i1 false, label %Out, label %loop
-loop: ; preds = %loop, %entry
- %LI = icmp sgt i32 0, 0 ; <i1> [#uses=1]
- br i1 %LI, label %loop, label %Out
-Out: ; preds = %loop, %entry
- ret void
-}
-
diff --git a/release_23/test/Transforms/LoopSimplify/2004-04-01-IncorrectDomUpdate.ll b/release_23/test/Transforms/LoopSimplify/2004-04-01-IncorrectDomUpdate.ll
deleted file mode 100644
index e75b214cb25f..000000000000
--- a/release_23/test/Transforms/LoopSimplify/2004-04-01-IncorrectDomUpdate.ll
+++ /dev/null
@@ -1,20 +0,0 @@
-; RUN: llvm-as < %s | opt -loopsimplify -licm -disable-output
-
-; This is PR306
-
-define void @NormalizeCoeffsVecFFE() {
-entry:
- br label %loopentry.0
-loopentry.0: ; preds = %no_exit.0, %entry
- br i1 false, label %loopentry.1, label %no_exit.0
-no_exit.0: ; preds = %loopentry.0
- br i1 false, label %loopentry.0, label %loopentry.1
-loopentry.1: ; preds = %no_exit.1, %no_exit.0, %loopentry.0
- br i1 false, label %no_exit.1, label %loopexit.1
-no_exit.1: ; preds = %loopentry.1
- %tmp.43 = icmp eq i16 0, 0 ; <i1> [#uses=1]
- br i1 %tmp.43, label %loopentry.1, label %loopexit.1
-loopexit.1: ; preds = %no_exit.1, %loopentry.1
- ret void
-}
-
diff --git a/release_23/test/Transforms/LoopSimplify/2004-04-12-LoopSimplify-SwitchBackedges.ll b/release_23/test/Transforms/LoopSimplify/2004-04-12-LoopSimplify-SwitchBackedges.ll
deleted file mode 100644
index ae11d80d34b8..000000000000
--- a/release_23/test/Transforms/LoopSimplify/2004-04-12-LoopSimplify-SwitchBackedges.ll
+++ /dev/null
@@ -1,18 +0,0 @@
-; RUN: llvm-as < %s | opt -loopsimplify -disable-output
-
-define void @test() {
-loopentry.0:
- br label %loopentry.1
-loopentry.1: ; preds = %then.6, %then.6, %loopentry.1, %loopentry.0
- %pixel.4 = phi i32 [ 0, %loopentry.0 ], [ %pixel.4, %loopentry.1 ], [ %tmp.370, %then.6 ], [ %tmp.370, %then.6 ] ; <i32> [#uses=1]
- br i1 false, label %then.6, label %loopentry.1
-then.6: ; preds = %loopentry.1
- %tmp.370 = add i32 0, 0 ; <i32> [#uses=2]
- switch i32 0, label %label.7 [
- i32 6408, label %loopentry.1
- i32 32841, label %loopentry.1
- ]
-label.7: ; preds = %then.6
- ret void
-}
-
diff --git a/release_23/test/Transforms/LoopSimplify/2004-04-13-LoopSimplifyUpdateDomFrontier.ll b/release_23/test/Transforms/LoopSimplify/2004-04-13-LoopSimplifyUpdateDomFrontier.ll
deleted file mode 100644
index 427631c07f2a..000000000000
--- a/release_23/test/Transforms/LoopSimplify/2004-04-13-LoopSimplifyUpdateDomFrontier.ll
+++ /dev/null
@@ -1,18 +0,0 @@
-; RUN: llvm-as < %s | opt -scalarrepl -loopsimplify -licm -disable-output
-
-define void @inflate() {
-entry:
- br label %loopentry.0.outer1111
-loopentry.0.outer1111: ; preds = %then.41, %label.11, %loopentry.0.outer1111, %entry
- %left.0.ph1107 = phi i32 [ %tmp.1172, %then.41 ], [ 0, %entry ], [ %tmp.1172, %label.11 ], [ %left.0.ph1107, %loopentry.0.outer1111 ] ; <i32> [#uses=2]
- %tmp.1172 = sub i32 %left.0.ph1107, 0 ; <i32> [#uses=2]
- switch i32 0, label %label.11 [
- i32 23, label %loopentry.0.outer1111
- i32 13, label %then.41
- ]
-label.11: ; preds = %loopentry.0.outer1111
- br label %loopentry.0.outer1111
-then.41: ; preds = %loopentry.0.outer1111
- br label %loopentry.0.outer1111
-}
-
diff --git a/release_23/test/Transforms/LoopSimplify/2007-10-28-InvokeCrash.ll b/release_23/test/Transforms/LoopSimplify/2007-10-28-InvokeCrash.ll
deleted file mode 100644
index 914fcd1661b8..000000000000
--- a/release_23/test/Transforms/LoopSimplify/2007-10-28-InvokeCrash.ll
+++ /dev/null
@@ -1,892 +0,0 @@
-; RUN: llvm-as < %s | opt -loopsimplify -disable-output
-; PR1752
-target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-s0:0:64-f80:32:32"
-target triple = "i686-pc-mingw32"
- %struct.BigInt = type { %"struct.std::vector<ulong,std::allocator<ulong> >" }
- %struct.Fibonacci = type { %"struct.std::vector<BigInt,std::allocator<BigInt> >" }
- %struct.__false_type = type <{ i8 }>
- %"struct.__gnu_cxx::__normal_iterator<BigInt*,std::vector<BigInt, std::allocator<BigInt> > >" = type { %struct.BigInt* }
- %"struct.std::_Vector_base<BigInt,std::allocator<BigInt> >" = type { %"struct.std::_Vector_base<BigInt,std::allocator<BigInt> >::_Vector_impl" }
- %"struct.std::_Vector_base<BigInt,std::allocator<BigInt> >::_Vector_impl" = type { %struct.BigInt*, %struct.BigInt*, %struct.BigInt* }
- %"struct.std::_Vector_base<ulong,std::allocator<ulong> >" = type { %"struct.std::_Vector_base<ulong,std::allocator<ulong> >::_Vector_impl" }
- %"struct.std::_Vector_base<ulong,std::allocator<ulong> >::_Vector_impl" = type { i32*, i32*, i32* }
- %"struct.std::basic_ios<char,std::char_traits<char> >" = type { %"struct.std::ios_base", %"struct.std::basic_ostream<char,std::char_traits<char> >"*, i8, i8, %"struct.std::basic_streambuf<char,std::char_traits<char> >"*, %"struct.std::ctype<char>"*, %"struct.std::num_get<char,std::istreambuf_iterator<char, std::char_traits<char> > >"*, %"struct.std::num_get<char,std::istreambuf_iterator<char, std::char_traits<char> > >"* }
- %"struct.std::basic_ostream<char,std::char_traits<char> >" = type { i32 (...)**, %"struct.std::basic_ios<char,std::char_traits<char> >" }
- %"struct.std::basic_streambuf<char,std::char_traits<char> >" = type { i32 (...)**, i8*, i8*, i8*, i8*, i8*, i8*, %"struct.std::locale" }
- %"struct.std::basic_string<char,std::char_traits<char>,std::allocator<char> >" = type { %"struct.std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Alloc_hider" }
- %"struct.std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Alloc_hider" = type { i8* }
- %"struct.std::basic_stringbuf<char,std::char_traits<char>,std::allocator<char> >" = type { %"struct.std::basic_streambuf<char,std::char_traits<char> >", i32, %"struct.std::basic_string<char,std::char_traits<char>,std::allocator<char> >" }
- %"struct.std::ctype<char>" = type { %"struct.std::locale::facet", i32*, i8, i32*, i32*, i16*, i8, [256 x i8], [256 x i8], i8 }
- %"struct.std::ios_base" = type { i32 (...)**, i32, i32, i32, i32, i32, %"struct.std::ios_base::_Callback_list"*, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, %"struct.std::ios_base::_Words"*, %"struct.std::locale" }
- %"struct.std::ios_base::_Callback_list" = type { %"struct.std::ios_base::_Callback_list"*, void (i32, %"struct.std::ios_base"*, i32)*, i32, i32 }
- %"struct.std::ios_base::_Words" = type { i8*, i32 }
- %"struct.std::locale" = type { %"struct.std::locale::_Impl"* }
- %"struct.std::locale::_Impl" = type { i32, %"struct.std::locale::facet"**, i32, %"struct.std::locale::facet"**, i8** }
- %"struct.std::locale::facet" = type { i32 (...)**, i32 }
- %"struct.std::num_get<char,std::istreambuf_iterator<char, std::char_traits<char> > >" = type { %"struct.std::locale::facet" }
- %"struct.std::ostringstream" = type { [4 x i8], %"struct.std::basic_stringbuf<char,std::char_traits<char>,std::allocator<char> >", %"struct.std::basic_ios<char,std::char_traits<char> >" }
- %"struct.std::vector<BigInt,std::allocator<BigInt> >" = type { %"struct.std::_Vector_base<BigInt,std::allocator<BigInt> >" }
- %"struct.std::vector<ulong,std::allocator<ulong> >" = type { %"struct.std::_Vector_base<ulong,std::allocator<ulong> >" }
-@.str13 = external constant [6 x i8] ; <[6 x i8]*> [#uses=1]
-@.str14 = external constant [5 x i8] ; <[5 x i8]*> [#uses=1]
-@.str15 = external constant [2 x i8] ; <[2 x i8]*> [#uses=1]
-@_ZSt4cout = external global %"struct.std::basic_ostream<char,std::char_traits<char> >" ; <%"struct.std::basic_ostream<char,std::char_traits<char> >"*> [#uses=1]
-
-declare void @_ZN9Fibonacci10get_numberEj(%struct.BigInt* sret , %struct.Fibonacci*, i32)
-
-declare %"struct.std::basic_ostream<char,std::char_traits<char> >"* @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(%"struct.std::basic_ostream<char,std::char_traits<char> >"*, i8*)
-
-declare void @_ZNSsD1Ev(%"struct.std::basic_string<char,std::char_traits<char>,std::allocator<char> >"*)
-
-declare %"struct.std::basic_ostream<char,std::char_traits<char> >"* @_ZNSolsEm(%"struct.std::basic_ostream<char,std::char_traits<char> >"*, i32)
-
-declare void @_ZNKSt19basic_ostringstreamIcSt11char_traitsIcESaIcEE3strEv(%"struct.std::basic_string<char,std::char_traits<char>,std::allocator<char> >"* sret , %"struct.std::ostringstream"*)
-
-declare %"struct.std::basic_ostream<char,std::char_traits<char> >"* @_ZStlsIcSt11char_traitsIcESaIcEERSt13basic_ostreamIT_T0_ES7_RKSbIS4_S5_T1_E(%"struct.std::basic_ostream<char,std::char_traits<char> >"*, %"struct.std::basic_string<char,std::char_traits<char>,std::allocator<char> >"*)
-
-declare void @_ZNSt19basic_ostringstreamIcSt11char_traitsIcESaIcEED1Ev(%"struct.std::ostringstream"*)
-
-declare %"struct.std::basic_ostream<char,std::char_traits<char> >"* @___ZlsRSoRK6BigInt___ZN9__gnu_cxx13new_allocatorI6BigIntE10deallocateEPS1_j(i32, %"struct.std::basic_ostream<char,std::char_traits<char> >"*, %struct.BigInt*, %struct.__false_type*, i32)
-
-declare void @___ZNSt12_Vector_baseI6BigIntSaIS0_EE13_M_deallocateEPS0_j___ZNSt12_Vector_baseI6BigIntSaIS0_EED2Ev___ZNSt6vectorI6BigIntSaIS0_EEC1ERKS1_(%"struct.std::_Vector_base<BigInt,std::allocator<BigInt> >"*, i32, %struct.BigInt*, i32, %"struct.std::vector<BigInt,std::allocator<BigInt> >"*, %struct.__false_type*)
-
-declare i32 @___ZN9__gnu_cxxmiIPK6BigIntS3_St6vectorIS1_SaIS1_EEEENS_17__normal_iteratorIT_T1_E15difference_typeERKSA_RKNS7_IT0_S9_EE___ZNKSt6vectorI6BigIntSaIS0_EE4sizeEv___ZNK9Fibonacci16show_all_numbersEv___ZNKSt6vectorI6BigIntSaIS0_EE8capacityEv(%"struct.__gnu_cxx::__normal_iterator<BigInt*,std::vector<BigInt, std::allocator<BigInt> > >"*, %"struct.__gnu_cxx::__normal_iterator<BigInt*,std::vector<BigInt, std::allocator<BigInt> > >"*, %"struct.std::vector<BigInt,std::allocator<BigInt> >"*, i32, %struct.Fibonacci*)
-
-declare %struct.BigInt* @___ZNSt6vectorI6BigIntSaIS0_EEixEj___ZNSt6vectorI6BigIntSaIS0_EE3endEv(%"struct.std::vector<BigInt,std::allocator<BigInt> >"*, i32, i32)
-
-declare %"struct.__gnu_cxx::__normal_iterator<BigInt*,std::vector<BigInt, std::allocator<BigInt> > >"* @___ZN9__gnu_cxx17__normal_iteratorIP6BigIntSt6vectorIS1_SaIS1_EEEppEv___ZNSt6vectorImSaImEED1Ev___ZN6BigIntD1Ev___ZN9__gnu_cxx13new_allocatorI6BigIntE7destroyEPS1____ZSt8_DestroyIP6BigIntSaIS0_EEvT_S3_T0_(i32, %"struct.__gnu_cxx::__normal_iterator<BigInt*,std::vector<BigInt, std::allocator<BigInt> > >"*, %"struct.std::vector<ulong,std::allocator<ulong> >"*, %struct.BigInt*, %struct.__false_type*, %struct.BigInt*, %struct.__false_type* noalias )
-
-declare void @___ZNSt6vectorI6BigIntSaIS0_EED1Ev___ZN9FibonacciD1Ev___ZNSt6vectorImSaImEEC1ERKS0_(i32, %"struct.std::vector<BigInt,std::allocator<BigInt> >"*, %struct.Fibonacci*, %"struct.std::vector<ulong,std::allocator<ulong> >"*, %struct.__false_type*)
-
-define void @___ZN9FibonacciC1Ej___ZN9Fibonacci11show_numberEm(%struct.Fibonacci* %this_this, i32 %functionID, i32 %n_i_n_i) {
-bb_init:
- br label %bb_main
-
-bb_main: ; preds = %meshBB349, %meshBB348, %meshBB347, %meshBB346, %meshBB345.unwinddest, %meshBB345, %meshBB344, %meshBB343, %meshBB342, %meshBB341, %meshBB340.normaldest, %meshBB340, %meshBB339, %invcont17.normaldest.normaldest, %invcont17.normaldest, %meshBB338.unwinddest, %meshBB338, %meshBB337.unwinddest, %meshBB337, %meshBB336.unwinddest, %meshBB336, %meshBB335, %meshBB334, %meshBB333, %meshBB332, %meshBB331, %meshBB330.normaldest, %meshBB330, %meshBB329.normaldest, %meshBB329, %meshBB328, %meshBB327, %meshBB326, %meshBB325.unwinddest, %meshBB325, %meshBB324, %meshBB323.normaldest, %meshBB323, %meshBB322.unwinddest, %meshBB322, %meshBB321, %meshBB320.unwinddest, %meshBB320, %meshBB319.unwinddest, %meshBB319, %meshBB318.unwinddest, %meshBB318, %meshBB317, %meshBB37.fragment, %meshBB37.unwinddest, %meshBB37, %meshBB36.fragment, %meshBB36, %meshBB35.fragment, %meshBB35, %meshBB34.fragment, %meshBB34, %meshBB33.fragment, %meshBB33, %meshBB32.fragment, %meshBB32, %meshBB31.fragment, %meshBB31, %meshBB30.fragment, %meshBB30.normaldest, %meshBB30, %meshBB29.fragment, %meshBB29.unwinddest, %meshBB29, %meshBB28.fragment, %meshBB28.unwinddest, %meshBB28, %meshBB27.fragment, %meshBB27, %meshBB26.fragment, %meshBB26.normaldest, %meshBB26, %meshBB25.fragment, %meshBB25, %meshBB24.fragment, %meshBB24.unwinddest, %meshBB24, %meshBB23.fragment, %meshBB23.normaldest, %meshBB23, %entry1.fragment.normaldest.normaldest, %entry1.fragment.normaldest, %meshBB22.fragment, %meshBB22.unwinddest, %meshBB22, %meshBB.fragment, %meshBB.unwinddest, %meshBB, %Unwind20, %unwind78.Unwind_crit_edge, %unwind78.fragment.fragment, %unwind78.fragment, %unwind78.fragment316, %unwind78, %invcont70, %unwind66.Unwind_crit_edge, %unwind66.fragment.fragment, %unwind66.fragment, %unwind66.fragment315, %unwind66, %unwind53.nofilter_crit_edge, %unwind53.fragment.fragment, %unwind53.fragment, %unwind53.fragment314, %unwind53, %nofilter.Unwind_crit_edge.normaldest, %nofilter.Unwind_crit_edge, %nofilter, %unwind43.nofilter_crit_edge, %unwind43.fragment.fragment, %unwind43.fragment, %unwind43.fragment313, %unwind43, %invcont41.normaldest, %invcont41, %unwind37.nofilter_crit_edge, %unwind37, %invcont36, %invcont33.unwind_crit_edge.unwinddest, %invcont33.unwind_crit_edge, %invcont30.unwind_crit_edge.unwinddest, %invcont30.unwind_crit_edge, %invcont30.normaldest, %invcont30, %invcont28.unwind_crit_edge, %invcont28.normaldest, %invcont28, %invcont25.unwind_crit_edge.unwinddest, %invcont25.unwind_crit_edge, %invcont25, %invcont22.unwind_crit_edge, %invcont22, %invcont17.unwind_crit_edge, %invcont17, %cond_next.unwind_crit_edge, %cond_next, %invcont12.cond_next_crit_edge, %invcont12.unwind_crit_edge, %invcont12, %cond_true.unwind_crit_edge.unwinddest, %cond_true.unwind_crit_edge, %invcont.cond_next_crit_edge, %invcont16.fragment, %invcont16, %unwind11.fragment, %unwind11, %entry.unwind_crit_edge, %entry1.fragment, %entry1.fragment312, %entry1, %Unwind, %unwind20.Unwind_crit_edge, %unwind20.fragment.fragment, %unwind20.fragment, %unwind20.fragment311, %unwind20, %invcont15, %invcont14.unwind10_crit_edge, %invcont14, %unwind10.Unwind_crit_edge, %unwind10.fragment, %unwind10.fragment310, %unwind10, %invcont.unwind10_crit_edge, %invcont, %unwind.fragment, %unwind, %entry.fragment, %entry.fragment309, %entry, %NewDefault, %LeafBlock, %LeafBlock914, %NodeBlock, %comb_entry.fragment, %old_entry, %bb_init
- switch i32 0, label %old_entry [
- i32 2739, label %invcont28.fragment
- i32 2688, label %meshBB28.fragment
- i32 1318, label %meshBB32.fragment
- i32 2964, label %unwind53.fragment.fragment
- i32 824, label %unwind78.fragment.fragment
- i32 1983, label %meshBB33.fragment
- i32 2582, label %invcont30.fragment
- i32 2235, label %meshBB36.fragment
- i32 1275, label %meshBB343
- i32 2719, label %invcont.fragment
- i32 1500, label %entry1.fragment.fragment
- i32 815, label %unwind11.fragment
- i32 1051, label %entry
- i32 2342, label %unwind
- i32 1814, label %invcont
- i32 315, label %invcont.unwind10_crit_edge
- i32 2422, label %unwind10
- i32 2663, label %unwind10.Unwind_crit_edge
- i32 266, label %invcont14
- i32 367, label %invcont14.unwind10_crit_edge
- i32 2242, label %invcont15
- i32 452, label %unwind20
- i32 419, label %invcont.cond_next_crit_edge
- i32 181, label %cond_true
- i32 2089, label %unwind20.Unwind_crit_edge
- i32 633, label %filter
- i32 455, label %Unwind
- i32 2016, label %entry1
- i32 263, label %invcont33.unwind_crit_edge
- i32 2498, label %invcont36
- i32 2992, label %unwind37
- i32 616, label %entry.unwind_crit_edge
- i32 622, label %unwind11
- i32 875, label %invcont16
- i32 766, label %unwind53.nofilter_crit_edge
- i32 668, label %filter62
- i32 2138, label %unwind66
- i32 713, label %unwind66.Unwind_crit_edge
- i32 1422, label %invcont70
- i32 1976, label %cond_true.unwind_crit_edge
- i32 1263, label %invcont12
- i32 2453, label %invcont12.unwind_crit_edge
- i32 2876, label %invcont12.cond_next_crit_edge
- i32 2271, label %cond_next
- i32 2938, label %cond_next.unwind_crit_edge
- i32 1082, label %invcont17
- i32 531, label %invcont17.unwind_crit_edge
- i32 111, label %invcont22
- i32 1935, label %invcont22.unwind_crit_edge
- i32 2004, label %invcont25
- i32 1725, label %invcont25.unwind_crit_edge
- i32 1701, label %invcont28
- i32 957, label %invcont28.unwind_crit_edge
- i32 165, label %invcont30
- i32 899, label %invcont30.unwind_crit_edge
- i32 1092, label %invcont33
- i32 2869, label %unwind37.nofilter_crit_edge
- i32 203, label %invcont41
- i32 693, label %unwind43
- i32 2895, label %unwind43.nofilter_crit_edge
- i32 1174, label %invcont47
- i32 1153, label %filter19
- i32 2304, label %nofilter
- i32 848, label %nofilter.Unwind_crit_edge
- i32 1207, label %unwind53
- i32 2848, label %filter75
- i32 59, label %unwind78
- i32 1213, label %unwind78.Unwind_crit_edge
- i32 2199, label %filter87
- i32 1268, label %Unwind20
- i32 743, label %old_entry
- i32 1276, label %meshBB319
- i32 1619, label %meshBB320
- i32 2047, label %meshBB331
- i32 2828, label %meshBB23.fragment
- i32 2530, label %meshBB332
- i32 1389, label %meshBB318
- i32 1450, label %meshBB317
- i32 1416, label %meshBB31.fragment
- i32 82, label %meshBB322
- i32 853, label %unwind78.fragment316
- i32 107, label %meshBB24.fragment
- i32 1200, label %meshBB37.fragment
- i32 605, label %unwind53.fragment314
- i32 209, label %meshBB29.fragment
- i32 1513, label %meshBB27.fragment
- i32 1542, label %meshBB35.fragment
- i32 1873, label %meshBB348
- i32 472, label %meshBB325
- i32 2615, label %meshBB22.fragment
- i32 359, label %meshBB.fragment
- i32 2467, label %Unwind20.fragment
- i32 1671, label %unwind66.fragment.fragment
- i32 1006, label %meshBB25.fragment
- i32 1243, label %meshBB333
- i32 2795, label %unwind43.fragment313
- i32 1591, label %meshBB335
- i32 773, label %meshBB341
- i32 2440, label %cond_next.fragment
- i32 487, label %meshBB326
- i32 394, label %meshBB324
- i32 14, label %invcont16.fragment
- i32 574, label %entry1.fragment312
- i32 1453, label %meshBB35
- i32 345, label %entry1.fragment
- i32 2951, label %unwind20.fragment
- i32 1960, label %meshBB31
- i32 2163, label %meshBB32
- i32 1978, label %Unwind.fragment
- i32 1559, label %unwind20.fragment.fragment
- i32 950, label %unwind10.fragment
- i32 1724, label %unwind53.fragment
- i32 514, label %meshBB36
- i32 1928, label %unwind10.fragment.fragment
- i32 1266, label %meshBB26
- i32 3148, label %unwind20.fragment311
- i32 1581, label %unwind43.fragment
- i32 1829, label %meshBB34
- i32 1472, label %meshBB28
- i32 2657, label %unwind66.fragment
- i32 2169, label %meshBB22
- i32 2619, label %meshBB
- i32 1397, label %entry.fragment
- i32 231, label %invcont41.fragment
- i32 2557, label %meshBB338
- i32 2387, label %meshBB30.fragment
- i32 2927, label %meshBB340
- i32 2331, label %meshBB321
- i32 47, label %meshBB328
- i32 1753, label %meshBB342
- i32 2074, label %meshBB323
- i32 2128, label %meshBB334
- i32 2396, label %meshBB337
- i32 1811, label %meshBB29
- i32 1113, label %meshBB27
- i32 2232, label %unwind10.fragment310
- i32 804, label %meshBB24
- i32 3099, label %meshBB30
- i32 564, label %meshBB33
- i32 1359, label %unwind.fragment
- i32 1906, label %entry.fragment309
- i32 2644, label %entry.fragment.fragment
- i32 134, label %entry1.fragment.normaldest
- i32 2767, label %comb_entry.fragment
- i32 2577, label %meshBB25
- i32 3128, label %meshBB37
- i32 2360, label %meshBB23
- i32 286, label %unwind78.fragment
- i32 976, label %meshBB346
- i32 2412, label %meshBB339
- i32 876, label %meshBB345
- i32 3078, label %meshBB329
- i32 1297, label %meshBB347
- i32 3051, label %meshBB336
- i32 1342, label %meshBB344
- i32 728, label %meshBB330
- i32 1778, label %meshBB349
- i32 2784, label %meshBB327
- i32 1854, label %meshBB26.fragment
- i32 1025, label %meshBB34.fragment
- i32 2139, label %unwind43.fragment.fragment
- i32 2217, label %nofilter.fragment
- i32 665, label %invcont12.fragment
- i32 316, label %invcont22.fragment
- i32 1467, label %unwind66.fragment315
- i32 3018, label %unwind37.fragment
- i32 1123, label %invcont17.normaldest
- i32 2104, label %NewDefault
- i32 1639, label %LeafBlock
- i32 925, label %LeafBlock914
- i32 2880, label %NodeBlock
- ]
-
-old_entry: ; preds = %bb_main, %bb_main
- br label %bb_main
-
-comb_entry.fragment: ; preds = %bb_main
- br label %bb_main
-
-NodeBlock: ; preds = %bb_main
- br label %bb_main
-
-LeafBlock914: ; preds = %bb_main
- br label %bb_main
-
-LeafBlock: ; preds = %bb_main
- br label %bb_main
-
-NewDefault: ; preds = %bb_main
- br label %bb_main
-
-entry: ; preds = %bb_main
- br label %bb_main
-
-entry.fragment309: ; preds = %bb_main
- br label %bb_main
-
-entry.fragment: ; preds = %bb_main
- br label %bb_main
-
-entry.fragment.fragment: ; preds = %bb_main
- invoke void @___ZNSt12_Vector_baseI6BigIntSaIS0_EE13_M_deallocateEPS0_j___ZNSt12_Vector_baseI6BigIntSaIS0_EED2Ev___ZNSt6vectorI6BigIntSaIS0_EEC1ERKS1_( %"struct.std::_Vector_base<BigInt,std::allocator<BigInt> >"* null, i32 28, %struct.BigInt* null, i32 0, %"struct.std::vector<BigInt,std::allocator<BigInt> >"* null, %struct.__false_type* null )
- to label %meshBB340 unwind label %meshBB325
-
-unwind: ; preds = %bb_main
- br label %bb_main
-
-unwind.fragment: ; preds = %bb_main
- br label %bb_main
-
-invcont: ; preds = %bb_main
- br label %bb_main
-
-invcont.fragment: ; preds = %bb_main
- invoke void @_ZN9Fibonacci10get_numberEj( %struct.BigInt* null sret , %struct.Fibonacci* %this_this, i32 %n_i_n_i )
- to label %invcont14 unwind label %meshBB37
-
-invcont.unwind10_crit_edge: ; preds = %bb_main
- br label %bb_main
-
-unwind10: ; preds = %bb_main
- br label %bb_main
-
-unwind10.fragment310: ; preds = %bb_main
- br label %bb_main
-
-unwind10.fragment: ; preds = %bb_main
- br label %bb_main
-
-unwind10.fragment.fragment: ; preds = %bb_main
- invoke void @___ZNSt6vectorI6BigIntSaIS0_EED1Ev___ZN9FibonacciD1Ev___ZNSt6vectorImSaImEEC1ERKS0_( i32 57, %"struct.std::vector<BigInt,std::allocator<BigInt> >"* null, %struct.Fibonacci* null, %"struct.std::vector<ulong,std::allocator<ulong> >"* null, %struct.__false_type* null )
- to label %meshBB329 unwind label %meshBB24
-
-unwind10.Unwind_crit_edge: ; preds = %bb_main
- br label %bb_main
-
-invcont14: ; preds = %invcont.fragment, %bb_main
- br label %bb_main
-
-invcont14.normaldest: ; No predecessors!
- invoke %"struct.__gnu_cxx::__normal_iterator<BigInt*,std::vector<BigInt, std::allocator<BigInt> > >"* @___ZN9__gnu_cxx17__normal_iteratorIP6BigIntSt6vectorIS1_SaIS1_EEEppEv___ZNSt6vectorImSaImEED1Ev___ZN6BigIntD1Ev___ZN9__gnu_cxx13new_allocatorI6BigIntE7destroyEPS1____ZSt8_DestroyIP6BigIntSaIS0_EEvT_S3_T0_( i32 14, %"struct.__gnu_cxx::__normal_iterator<BigInt*,std::vector<BigInt, std::allocator<BigInt> > >"* null, %"struct.std::vector<ulong,std::allocator<ulong> >"* null, %struct.BigInt* null, %struct.__false_type* null, %struct.BigInt* null, %struct.__false_type* null noalias )
- to label %invcont15 unwind label %meshBB345 ; <%"struct.__gnu_cxx::__normal_iterator<BigInt*,std::vector<BigInt, std::allocator<BigInt> > >"*>:0 [#uses=0]
-
-invcont14.unwind10_crit_edge: ; preds = %bb_main
- br label %bb_main
-
-invcont15: ; preds = %invcont14.normaldest, %bb_main
- br label %bb_main
-
-invcont15.normaldest: ; No predecessors!
- br label %UnifiedReturnBlock
-
-unwind20: ; preds = %bb_main
- br label %bb_main
-
-unwind20.fragment311: ; preds = %bb_main
- br label %bb_main
-
-unwind20.fragment: ; preds = %bb_main
- br label %bb_main
-
-unwind20.fragment.fragment: ; preds = %bb_main
- br label %bb_main
-
-unwind20.Unwind_crit_edge: ; preds = %bb_main
- br label %bb_main
-
-filter: ; preds = %bb_main
- br label %UnifiedUnreachableBlock
-
-Unwind: ; preds = %bb_main
- br label %bb_main
-
-Unwind.fragment: ; preds = %bb_main
- br label %UnifiedUnreachableBlock
-
-entry1: ; preds = %bb_main
- br label %bb_main
-
-entry1.fragment312: ; preds = %bb_main
- br label %bb_main
-
-entry1.fragment: ; preds = %bb_main
- br label %bb_main
-
-entry1.fragment.fragment: ; preds = %bb_main
- %tmp52 = invoke i32 @___ZN9__gnu_cxxmiIPK6BigIntS3_St6vectorIS1_SaIS1_EEEENS_17__normal_iteratorIT_T1_E15difference_typeERKSA_RKNS7_IT0_S9_EE___ZNKSt6vectorI6BigIntSaIS0_EE4sizeEv___ZNK9Fibonacci16show_all_numbersEv___ZNKSt6vectorI6BigIntSaIS0_EE8capacityEv( %"struct.__gnu_cxx::__normal_iterator<BigInt*,std::vector<BigInt, std::allocator<BigInt> > >"* null, %"struct.__gnu_cxx::__normal_iterator<BigInt*,std::vector<BigInt, std::allocator<BigInt> > >"* null, %"struct.std::vector<BigInt,std::allocator<BigInt> >"* null, i32 16, %struct.Fibonacci* null )
- to label %entry1.fragment.normaldest unwind label %meshBB320 ; <i32> [#uses=0]
-
-entry.unwind_crit_edge: ; preds = %bb_main
- br label %bb_main
-
-unwind11: ; preds = %bb_main
- br label %bb_main
-
-unwind11.fragment: ; preds = %bb_main
- br label %bb_main
-
-invcont16: ; preds = %bb_main
- br label %bb_main
-
-invcont16.fragment: ; preds = %bb_main
- br label %bb_main
-
-invcont.cond_next_crit_edge: ; preds = %bb_main
- br label %bb_main
-
-cond_true: ; preds = %bb_main
- invoke void @_ZN9Fibonacci10get_numberEj( %struct.BigInt* null sret , %struct.Fibonacci* %this_this, i32 %n_i_n_i )
- to label %meshBB323 unwind label %cond_true.unwind_crit_edge
-
-cond_true.unwind_crit_edge: ; preds = %cond_true, %bb_main
- br label %bb_main
-
-cond_true.unwind_crit_edge.unwinddest: ; No predecessors!
- br label %bb_main
-
-invcont12: ; preds = %bb_main
- br label %bb_main
-
-invcont12.fragment: ; preds = %bb_main
- invoke %"struct.__gnu_cxx::__normal_iterator<BigInt*,std::vector<BigInt, std::allocator<BigInt> > >"* @___ZN9__gnu_cxx17__normal_iteratorIP6BigIntSt6vectorIS1_SaIS1_EEEppEv___ZNSt6vectorImSaImEED1Ev___ZN6BigIntD1Ev___ZN9__gnu_cxx13new_allocatorI6BigIntE7destroyEPS1____ZSt8_DestroyIP6BigIntSaIS0_EEvT_S3_T0_( i32 14, %"struct.__gnu_cxx::__normal_iterator<BigInt*,std::vector<BigInt, std::allocator<BigInt> > >"* null, %"struct.std::vector<ulong,std::allocator<ulong> >"* null, %struct.BigInt* null, %struct.__false_type* null, %struct.BigInt* null, %struct.__false_type* null noalias )
- to label %meshBB30 unwind label %meshBB337 ; <%"struct.__gnu_cxx::__normal_iterator<BigInt*,std::vector<BigInt, std::allocator<BigInt> > >"*>:1 [#uses=0]
-
-invcont12.unwind_crit_edge: ; preds = %bb_main
- br label %bb_main
-
-invcont12.cond_next_crit_edge: ; preds = %bb_main
- br label %bb_main
-
-cond_next: ; preds = %bb_main
- br label %bb_main
-
-cond_next.fragment: ; preds = %bb_main
- %tmp183 = invoke %struct.BigInt* @___ZNSt6vectorI6BigIntSaIS0_EEixEj___ZNSt6vectorI6BigIntSaIS0_EE3endEv( %"struct.std::vector<BigInt,std::allocator<BigInt> >"* null, i32 %n_i_n_i, i32 29 )
- to label %invcont17 unwind label %meshBB336 ; <%struct.BigInt*> [#uses=0]
-
-cond_next.unwind_crit_edge: ; preds = %bb_main
- br label %bb_main
-
-invcont17: ; preds = %cond_next.fragment, %bb_main
- br label %bb_main
-
-invcont17.normaldest917: ; No predecessors!
- %tmp23 = invoke %"struct.std::basic_ostream<char,std::char_traits<char> >"* @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc( %"struct.std::basic_ostream<char,std::char_traits<char> >"* null, i8* getelementptr ([6 x i8]* @.str13, i32 0, i32 0) )
- to label %invcont17.normaldest unwind label %meshBB318 ; <%"struct.std::basic_ostream<char,std::char_traits<char> >"*> [#uses=1]
-
-invcont17.unwind_crit_edge: ; preds = %bb_main
- br label %bb_main
-
-invcont22: ; preds = %bb_main
- br label %bb_main
-
-invcont22.fragment: ; preds = %bb_main
- %tmp26 = invoke %"struct.std::basic_ostream<char,std::char_traits<char> >"* @_ZNSolsEm( %"struct.std::basic_ostream<char,std::char_traits<char> >"* undef, i32 %n_i_n_i )
- to label %invcont25 unwind label %meshBB319 ; <%"struct.std::basic_ostream<char,std::char_traits<char> >"*> [#uses=1]
-
-invcont22.unwind_crit_edge: ; preds = %bb_main
- br label %bb_main
-
-invcont25: ; preds = %invcont22.fragment, %bb_main
- br label %bb_main
-
-invcont25.normaldest: ; No predecessors!
- %tmp2918 = invoke %"struct.std::basic_ostream<char,std::char_traits<char> >"* @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc( %"struct.std::basic_ostream<char,std::char_traits<char> >"* %tmp26, i8* getelementptr ([5 x i8]* @.str14, i32 0, i32 0) )
- to label %invcont28 unwind label %invcont25.unwind_crit_edge ; <%"struct.std::basic_ostream<char,std::char_traits<char> >"*> [#uses=0]
-
-invcont25.unwind_crit_edge: ; preds = %invcont25.normaldest, %bb_main
- br label %bb_main
-
-invcont25.unwind_crit_edge.unwinddest: ; No predecessors!
- br label %bb_main
-
-invcont28: ; preds = %invcont25.normaldest, %bb_main
- br label %bb_main
-
-invcont28.normaldest: ; No predecessors!
- br label %bb_main
-
-invcont28.fragment: ; preds = %bb_main
- %tmp311 = invoke %"struct.std::basic_ostream<char,std::char_traits<char> >"* @___ZlsRSoRK6BigInt___ZN9__gnu_cxx13new_allocatorI6BigIntE10deallocateEPS1_j( i32 32, %"struct.std::basic_ostream<char,std::char_traits<char> >"* undef, %struct.BigInt* undef, %struct.__false_type* null, i32 0 )
- to label %invcont30 unwind label %meshBB322 ; <%"struct.std::basic_ostream<char,std::char_traits<char> >"*> [#uses=0]
-
-invcont28.unwind_crit_edge: ; preds = %bb_main
- br label %bb_main
-
-invcont30: ; preds = %invcont28.fragment, %bb_main
- br label %bb_main
-
-invcont30.normaldest: ; No predecessors!
- br label %bb_main
-
-invcont30.fragment: ; preds = %bb_main
- %tmp34 = invoke %"struct.std::basic_ostream<char,std::char_traits<char> >"* @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc( %"struct.std::basic_ostream<char,std::char_traits<char> >"* undef, i8* getelementptr ([2 x i8]* @.str15, i32 0, i32 0) )
- to label %meshBB26 unwind label %invcont30.unwind_crit_edge ; <%"struct.std::basic_ostream<char,std::char_traits<char> >"*> [#uses=0]
-
-invcont30.unwind_crit_edge: ; preds = %invcont30.fragment, %bb_main
- br label %bb_main
-
-invcont30.unwind_crit_edge.unwinddest: ; No predecessors!
- br label %bb_main
-
-invcont33: ; preds = %bb_main
- invoke void @_ZNKSt19basic_ostringstreamIcSt11char_traitsIcESaIcEE3strEv( %"struct.std::basic_string<char,std::char_traits<char>,std::allocator<char> >"* null sret , %"struct.std::ostringstream"* null )
- to label %invcont36 unwind label %invcont33.unwind_crit_edge
-
-invcont33.unwind_crit_edge: ; preds = %invcont33, %bb_main
- br label %bb_main
-
-invcont33.unwind_crit_edge.unwinddest: ; No predecessors!
- br label %bb_main
-
-invcont36: ; preds = %invcont33, %bb_main
- br label %bb_main
-
-invcont36.normaldest: ; No predecessors!
- %tmp42 = invoke %"struct.std::basic_ostream<char,std::char_traits<char> >"* @_ZStlsIcSt11char_traitsIcESaIcEERSt13basic_ostreamIT_T0_ES7_RKSbIS4_S5_T1_E( %"struct.std::basic_ostream<char,std::char_traits<char> >"* @_ZSt4cout, %"struct.std::basic_string<char,std::char_traits<char>,std::allocator<char> >"* null )
- to label %invcont41 unwind label %meshBB338 ; <%"struct.std::basic_ostream<char,std::char_traits<char> >"*> [#uses=0]
-
-unwind37: ; preds = %bb_main
- br label %bb_main
-
-unwind37.fragment: ; preds = %bb_main
- invoke void @_ZNSsD1Ev( %"struct.std::basic_string<char,std::char_traits<char>,std::allocator<char> >"* null )
- to label %meshBB330 unwind label %meshBB22
-
-unwind37.nofilter_crit_edge: ; preds = %bb_main
- br label %bb_main
-
-invcont41: ; preds = %invcont36.normaldest, %bb_main
- br label %bb_main
-
-invcont41.normaldest: ; No predecessors!
- br label %bb_main
-
-invcont41.fragment: ; preds = %bb_main
- invoke void @_ZNSsD1Ev( %"struct.std::basic_string<char,std::char_traits<char>,std::allocator<char> >"* null )
- to label %meshBB23 unwind label %meshBB29
-
-unwind43: ; preds = %bb_main
- br label %bb_main
-
-unwind43.fragment313: ; preds = %bb_main
- br label %bb_main
-
-unwind43.fragment: ; preds = %bb_main
- br label %bb_main
-
-unwind43.fragment.fragment: ; preds = %bb_main
- br label %bb_main
-
-unwind43.nofilter_crit_edge: ; preds = %bb_main
- br label %bb_main
-
-invcont47: ; preds = %bb_main
- invoke void @_ZNSt19basic_ostringstreamIcSt11char_traitsIcESaIcEED1Ev( %"struct.std::ostringstream"* null )
- to label %invcont70 unwind label %meshBB28
-
-filter19: ; preds = %bb_main
- br label %UnifiedUnreachableBlock
-
-nofilter: ; preds = %bb_main
- br label %bb_main
-
-nofilter.fragment: ; preds = %bb_main
- invoke void @_ZNSt19basic_ostringstreamIcSt11char_traitsIcESaIcEED1Ev( %"struct.std::ostringstream"* null )
- to label %nofilter.Unwind_crit_edge unwind label %meshBB
-
-nofilter.Unwind_crit_edge: ; preds = %nofilter.fragment, %bb_main
- br label %bb_main
-
-nofilter.Unwind_crit_edge.normaldest: ; No predecessors!
- br label %bb_main
-
-unwind53: ; preds = %bb_main
- br label %bb_main
-
-unwind53.fragment314: ; preds = %bb_main
- br label %bb_main
-
-unwind53.fragment: ; preds = %bb_main
- br label %bb_main
-
-unwind53.fragment.fragment: ; preds = %bb_main
- br label %bb_main
-
-unwind53.nofilter_crit_edge: ; preds = %bb_main
- br label %bb_main
-
-filter62: ; preds = %bb_main
- br label %UnifiedUnreachableBlock
-
-unwind66: ; preds = %bb_main
- br label %bb_main
-
-unwind66.fragment315: ; preds = %bb_main
- br label %bb_main
-
-unwind66.fragment: ; preds = %bb_main
- br label %bb_main
-
-unwind66.fragment.fragment: ; preds = %bb_main
- br label %bb_main
-
-unwind66.Unwind_crit_edge: ; preds = %bb_main
- br label %bb_main
-
-invcont70: ; preds = %invcont47, %bb_main
- br label %bb_main
-
-invcont70.normaldest: ; No predecessors!
- br label %UnifiedReturnBlock
-
-filter75: ; preds = %bb_main
- br label %UnifiedUnreachableBlock
-
-unwind78: ; preds = %bb_main
- br label %bb_main
-
-unwind78.fragment316: ; preds = %bb_main
- br label %bb_main
-
-unwind78.fragment: ; preds = %bb_main
- br label %bb_main
-
-unwind78.fragment.fragment: ; preds = %bb_main
- br label %bb_main
-
-unwind78.Unwind_crit_edge: ; preds = %bb_main
- br label %bb_main
-
-filter87: ; preds = %bb_main
- br label %UnifiedUnreachableBlock
-
-Unwind20: ; preds = %bb_main
- br label %bb_main
-
-Unwind20.fragment: ; preds = %bb_main
- br label %UnifiedUnreachableBlock
-
-meshBB: ; preds = %nofilter.fragment, %bb_main
- br label %bb_main
-
-meshBB.unwinddest: ; No predecessors!
- br label %bb_main
-
-meshBB.fragment: ; preds = %bb_main
- br label %bb_main
-
-meshBB22: ; preds = %unwind37.fragment, %bb_main
- br label %bb_main
-
-meshBB22.unwinddest: ; No predecessors!
- br label %bb_main
-
-meshBB22.fragment: ; preds = %bb_main
- br label %bb_main
-
-entry1.fragment.normaldest: ; preds = %entry1.fragment.fragment, %bb_main
- br label %bb_main
-
-entry1.fragment.normaldest.normaldest: ; No predecessors!
- br label %bb_main
-
-meshBB23: ; preds = %invcont41.fragment, %bb_main
- br label %bb_main
-
-meshBB23.normaldest: ; No predecessors!
- br label %bb_main
-
-meshBB23.fragment: ; preds = %bb_main
- br label %bb_main
-
-meshBB24: ; preds = %unwind10.fragment.fragment, %bb_main
- br label %bb_main
-
-meshBB24.unwinddest: ; No predecessors!
- br label %bb_main
-
-meshBB24.fragment: ; preds = %bb_main
- br label %bb_main
-
-meshBB25: ; preds = %bb_main
- br label %bb_main
-
-meshBB25.fragment: ; preds = %bb_main
- br label %bb_main
-
-meshBB26: ; preds = %invcont30.fragment, %bb_main
- br label %bb_main
-
-meshBB26.normaldest: ; No predecessors!
- br label %bb_main
-
-meshBB26.fragment: ; preds = %bb_main
- br label %bb_main
-
-meshBB27: ; preds = %bb_main
- br label %bb_main
-
-meshBB27.fragment: ; preds = %bb_main
- br label %bb_main
-
-meshBB28: ; preds = %invcont47, %bb_main
- br label %bb_main
-
-meshBB28.unwinddest: ; No predecessors!
- br label %bb_main
-
-meshBB28.fragment: ; preds = %bb_main
- br label %bb_main
-
-meshBB29: ; preds = %invcont41.fragment, %bb_main
- br label %bb_main
-
-meshBB29.unwinddest: ; No predecessors!
- br label %bb_main
-
-meshBB29.fragment: ; preds = %bb_main
- br label %bb_main
-
-meshBB30: ; preds = %invcont12.fragment, %bb_main
- br label %bb_main
-
-meshBB30.normaldest: ; No predecessors!
- br label %bb_main
-
-meshBB30.fragment: ; preds = %bb_main
- br label %bb_main
-
-meshBB31: ; preds = %bb_main
- br label %bb_main
-
-meshBB31.fragment: ; preds = %bb_main
- br label %bb_main
-
-meshBB32: ; preds = %bb_main
- br label %bb_main
-
-meshBB32.fragment: ; preds = %bb_main
- br label %bb_main
-
-meshBB33: ; preds = %bb_main
- br label %bb_main
-
-meshBB33.fragment: ; preds = %bb_main
- br label %bb_main
-
-meshBB34: ; preds = %bb_main
- br label %bb_main
-
-meshBB34.fragment: ; preds = %bb_main
- br label %bb_main
-
-meshBB35: ; preds = %bb_main
- br label %bb_main
-
-meshBB35.fragment: ; preds = %bb_main
- br label %bb_main
-
-meshBB36: ; preds = %bb_main
- br label %bb_main
-
-meshBB36.fragment: ; preds = %bb_main
- br label %bb_main
-
-meshBB37: ; preds = %invcont.fragment, %bb_main
- br label %bb_main
-
-meshBB37.unwinddest: ; No predecessors!
- br label %bb_main
-
-meshBB37.fragment: ; preds = %bb_main
- br label %bb_main
-
-meshBB317: ; preds = %bb_main
- br label %bb_main
-
-meshBB318: ; preds = %invcont17.normaldest917, %bb_main
- br label %bb_main
-
-meshBB318.unwinddest: ; No predecessors!
- br label %bb_main
-
-meshBB319: ; preds = %invcont22.fragment, %bb_main
- br label %bb_main
-
-meshBB319.unwinddest: ; No predecessors!
- br label %bb_main
-
-meshBB320: ; preds = %entry1.fragment.fragment, %bb_main
- br label %bb_main
-
-meshBB320.unwinddest: ; No predecessors!
- br label %bb_main
-
-meshBB321: ; preds = %bb_main
- br label %bb_main
-
-meshBB322: ; preds = %invcont28.fragment, %bb_main
- br label %bb_main
-
-meshBB322.unwinddest: ; No predecessors!
- br label %bb_main
-
-meshBB323: ; preds = %cond_true, %bb_main
- br label %bb_main
-
-meshBB323.normaldest: ; No predecessors!
- br label %bb_main
-
-meshBB324: ; preds = %bb_main
- br label %bb_main
-
-meshBB325: ; preds = %entry.fragment.fragment, %bb_main
- br label %bb_main
-
-meshBB325.unwinddest: ; No predecessors!
- br label %bb_main
-
-meshBB326: ; preds = %bb_main
- br label %bb_main
-
-meshBB327: ; preds = %bb_main
- br label %bb_main
-
-meshBB328: ; preds = %bb_main
- br label %bb_main
-
-meshBB329: ; preds = %unwind10.fragment.fragment, %bb_main
- br label %bb_main
-
-meshBB329.normaldest: ; No predecessors!
- br label %bb_main
-
-meshBB330: ; preds = %unwind37.fragment, %bb_main
- br label %bb_main
-
-meshBB330.normaldest: ; No predecessors!
- br label %bb_main
-
-meshBB331: ; preds = %bb_main
- br label %bb_main
-
-meshBB332: ; preds = %bb_main
- br label %bb_main
-
-meshBB333: ; preds = %bb_main
- br label %bb_main
-
-meshBB334: ; preds = %bb_main
- br label %bb_main
-
-meshBB335: ; preds = %bb_main
- br label %bb_main
-
-meshBB336: ; preds = %cond_next.fragment, %bb_main
- br label %bb_main
-
-meshBB336.unwinddest: ; No predecessors!
- br label %bb_main
-
-meshBB337: ; preds = %invcont12.fragment, %bb_main
- br label %bb_main
-
-meshBB337.unwinddest: ; No predecessors!
- br label %bb_main
-
-meshBB338: ; preds = %invcont36.normaldest, %bb_main
- br label %bb_main
-
-meshBB338.unwinddest: ; No predecessors!
- br label %bb_main
-
-invcont17.normaldest: ; preds = %invcont17.normaldest917, %bb_main
- br label %bb_main
-
-invcont17.normaldest.normaldest: ; No predecessors!
- store %"struct.std::basic_ostream<char,std::char_traits<char> >"* %tmp23, %"struct.std::basic_ostream<char,std::char_traits<char> >"** undef
- br label %bb_main
-
-meshBB339: ; preds = %bb_main
- br label %bb_main
-
-meshBB340: ; preds = %entry.fragment.fragment, %bb_main
- br label %bb_main
-
-meshBB340.normaldest: ; No predecessors!
- br label %bb_main
-
-meshBB341: ; preds = %bb_main
- br label %bb_main
-
-meshBB342: ; preds = %bb_main
- br label %bb_main
-
-meshBB343: ; preds = %bb_main
- br label %bb_main
-
-meshBB344: ; preds = %bb_main
- br label %bb_main
-
-meshBB345: ; preds = %invcont14.normaldest, %bb_main
- br label %bb_main
-
-meshBB345.unwinddest: ; No predecessors!
- br label %bb_main
-
-meshBB346: ; preds = %bb_main
- br label %bb_main
-
-meshBB347: ; preds = %bb_main
- br label %bb_main
-
-meshBB348: ; preds = %bb_main
- br label %bb_main
-
-meshBB349: ; preds = %bb_main
- br label %bb_main
-
-UnifiedUnreachableBlock: ; preds = %Unwind20.fragment, %filter87, %filter75, %filter62, %filter19, %Unwind.fragment, %filter
- unreachable
-
-UnifiedReturnBlock: ; preds = %invcont70.normaldest, %invcont15.normaldest
- ret void
-}
diff --git a/release_23/test/Transforms/LoopSimplify/basictest.ll b/release_23/test/Transforms/LoopSimplify/basictest.ll
deleted file mode 100644
index 0388b0e9eac5..000000000000
--- a/release_23/test/Transforms/LoopSimplify/basictest.ll
+++ /dev/null
@@ -1,16 +0,0 @@
-; RUN: llvm-as < %s | opt -loopsimplify
-
-; This function should get a preheader inserted before BB3, that is jumped
-; to by BB1 & BB2
-;
-
-define void @test() {
- br i1 true, label %BB1, label %BB2
-BB1: ; preds = %0
- br label %BB3
-BB2: ; preds = %0
- br label %BB3
-BB3: ; preds = %BB3, %BB2, %BB1
- br label %BB3
-}
-
diff --git a/release_23/test/Transforms/LoopSimplify/dg.exp b/release_23/test/Transforms/LoopSimplify/dg.exp
deleted file mode 100644
index 879685ca879d..000000000000
--- a/release_23/test/Transforms/LoopSimplify/dg.exp
+++ /dev/null
@@ -1,3 +0,0 @@
-load_lib llvm.exp
-
-RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
diff --git a/release_23/test/Transforms/LoopSimplify/hardertest.ll b/release_23/test/Transforms/LoopSimplify/hardertest.ll
deleted file mode 100644
index 6ee0567dbc81..000000000000
--- a/release_23/test/Transforms/LoopSimplify/hardertest.ll
+++ /dev/null
@@ -1,15 +0,0 @@
-; RUN: llvm-as < %s | opt -loopsimplify
-
-define void @foo(i1 %C) {
- br i1 %C, label %T, label %F
-T: ; preds = %0
- br label %Loop
-F: ; preds = %0
- br label %Loop
-Loop: ; preds = %L2, %Loop, %F, %T
- %Val = phi i32 [ 0, %T ], [ 1, %F ], [ 2, %Loop ], [ 3, %L2 ] ; <i32> [#uses=0]
- br i1 %C, label %Loop, label %L2
-L2: ; preds = %Loop
- br label %Loop
-}
-
diff --git a/release_23/test/Transforms/LoopSimplify/phi-node-simplify.ll b/release_23/test/Transforms/LoopSimplify/phi-node-simplify.ll
deleted file mode 100644
index a22fadb48a4d..000000000000
--- a/release_23/test/Transforms/LoopSimplify/phi-node-simplify.ll
+++ /dev/null
@@ -1,55 +0,0 @@
-; Loop Simplify should turn phi nodes like X = phi [X, Y] into just Y, eliminating them.
-; RUN: llvm-as < %s | opt -loopsimplify | llvm-dis | grep phi | count 6
-
-@A = weak global [3000000 x i32] zeroinitializer ; <[3000000 x i32]*> [#uses=1]
-@B = weak global [20000 x i32] zeroinitializer ; <[20000 x i32]*> [#uses=1]
-@C = weak global [100 x i32] zeroinitializer ; <[100 x i32]*> [#uses=1]
-@Z = weak global i32 0 ; <i32*> [#uses=2]
-
-define i32 @main() {
-entry:
- tail call void @__main( )
- br label %loopentry.1
-loopentry.1: ; preds = %loopexit.1, %entry
- %indvar20 = phi i32 [ 0, %entry ], [ %indvar.next21, %loopexit.1 ] ; <i32> [#uses=1]
- %a.1 = phi i32* [ getelementptr ([3000000 x i32]* @A, i32 0, i32 0), %entry ], [ %inc.0, %loopexit.1 ] ; <i32*> [#uses=1]
- br label %no_exit.2
-no_exit.2: ; preds = %loopexit.2, %no_exit.2, %loopentry.1
- %a.0.4.ph = phi i32* [ %a.1, %loopentry.1 ], [ %inc.0, %loopexit.2 ], [ %a.0.4.ph, %no_exit.2 ] ; <i32*> [#uses=3]
- %b.1.4.ph = phi i32* [ getelementptr ([20000 x i32]* @B, i32 0, i32 0), %loopentry.1 ], [ %inc.1, %loopexit.2 ], [ %b.1.4.ph, %no_exit.2 ] ; <i32*> [#uses=3]
- %indvar17 = phi i32 [ 0, %loopentry.1 ], [ %indvar.next18, %loopexit.2 ], [ %indvar17, %no_exit.2 ] ; <i32> [#uses=2]
- %indvar = phi i32 [ %indvar.next, %no_exit.2 ], [ 0, %loopexit.2 ], [ 0, %loopentry.1 ] ; <i32> [#uses=5]
- %b.1.4.rec = bitcast i32 %indvar to i32 ; <i32> [#uses=1]
- %gep.upgrd.1 = zext i32 %indvar to i64 ; <i64> [#uses=1]
- %c.2.4 = getelementptr [100 x i32]* @C, i32 0, i64 %gep.upgrd.1 ; <i32*> [#uses=1]
- %gep.upgrd.2 = zext i32 %indvar to i64 ; <i64> [#uses=1]
- %a.0.4 = getelementptr i32* %a.0.4.ph, i64 %gep.upgrd.2 ; <i32*> [#uses=1]
- %gep.upgrd.3 = zext i32 %indvar to i64 ; <i64> [#uses=1]
- %b.1.4 = getelementptr i32* %b.1.4.ph, i64 %gep.upgrd.3 ; <i32*> [#uses=1]
- %inc.0.rec = add i32 %b.1.4.rec, 1 ; <i32> [#uses=2]
- %inc.0 = getelementptr i32* %a.0.4.ph, i32 %inc.0.rec ; <i32*> [#uses=2]
- %tmp.13 = load i32* %a.0.4 ; <i32> [#uses=1]
- %inc.1 = getelementptr i32* %b.1.4.ph, i32 %inc.0.rec ; <i32*> [#uses=1]
- %tmp.15 = load i32* %b.1.4 ; <i32> [#uses=1]
- %tmp.18 = load i32* %c.2.4 ; <i32> [#uses=1]
- %tmp.16 = mul i32 %tmp.15, %tmp.13 ; <i32> [#uses=1]
- %tmp.19 = mul i32 %tmp.16, %tmp.18 ; <i32> [#uses=1]
- %tmp.20 = load i32* @Z ; <i32> [#uses=1]
- %tmp.21 = add i32 %tmp.19, %tmp.20 ; <i32> [#uses=1]
- store i32 %tmp.21, i32* @Z
- %indvar.next = add i32 %indvar, 1 ; <i32> [#uses=2]
- %exitcond = icmp eq i32 %indvar.next, 100 ; <i1> [#uses=1]
- br i1 %exitcond, label %loopexit.2, label %no_exit.2
-loopexit.2: ; preds = %no_exit.2
- %indvar.next18 = add i32 %indvar17, 1 ; <i32> [#uses=2]
- %exitcond19 = icmp eq i32 %indvar.next18, 200 ; <i1> [#uses=1]
- br i1 %exitcond19, label %loopexit.1, label %no_exit.2
-loopexit.1: ; preds = %loopexit.2
- %indvar.next21 = add i32 %indvar20, 1 ; <i32> [#uses=2]
- %exitcond22 = icmp eq i32 %indvar.next21, 300 ; <i1> [#uses=1]
- br i1 %exitcond22, label %return, label %loopentry.1
-return: ; preds = %loopexit.1
- ret i32 undef
-}
-
-declare void @__main()
diff --git a/release_23/test/Transforms/LoopSimplify/single-backedge.ll b/release_23/test/Transforms/LoopSimplify/single-backedge.ll
deleted file mode 100644
index 0c09b9e51a62..000000000000
--- a/release_23/test/Transforms/LoopSimplify/single-backedge.ll
+++ /dev/null
@@ -1,19 +0,0 @@
-; The loop canonicalization pass should guarantee that there is one backedge
-; for all loops. This allows the -indvars pass to recognize the %IV
-; induction variable in this testcase.
-
-; RUN: llvm-as < %s | opt -indvars | llvm-dis | grep indvar
-
-define i32 @test(i1 %C) {
-; <label>:0
- br label %Loop
-Loop: ; preds = %BE2, %BE1, %0
- %IV = phi i32 [ 1, %0 ], [ %IV2, %BE1 ], [ %IV2, %BE2 ] ; <i32> [#uses=1]
- %IV2 = add i32 %IV, 2 ; <i32> [#uses=2]
- br i1 %C, label %BE1, label %BE2
-BE1: ; preds = %Loop
- br label %Loop
-BE2: ; preds = %Loop
- br label %Loop
-}
-
diff --git a/release_23/test/Transforms/LoopStrengthReduce/2005-08-15-AddRecIV.ll b/release_23/test/Transforms/LoopStrengthReduce/2005-08-15-AddRecIV.ll
deleted file mode 100644
index 75574c07c0e8..000000000000
--- a/release_23/test/Transforms/LoopStrengthReduce/2005-08-15-AddRecIV.ll
+++ /dev/null
@@ -1,57 +0,0 @@
-; RUN: llvm-as < %s | opt -loop-reduce -disable-output
-
-define void @try_swap() {
-entry:
- br i1 false, label %cond_continue.0.i, label %cond_false.0.i
-cond_false.0.i: ; preds = %entry
- ret void
-cond_continue.0.i: ; preds = %entry
- br i1 false, label %cond_continue.1.i, label %cond_false.1.i
-cond_false.1.i: ; preds = %cond_continue.0.i
- ret void
-cond_continue.1.i: ; preds = %cond_continue.0.i
- br i1 false, label %endif.3.i, label %else.0.i
-endif.3.i: ; preds = %cond_continue.1.i
- br i1 false, label %my_irand.exit82, label %endif.0.i62
-else.0.i: ; preds = %cond_continue.1.i
- ret void
-endif.0.i62: ; preds = %endif.3.i
- ret void
-my_irand.exit82: ; preds = %endif.3.i
- br i1 false, label %else.2, label %then.4
-then.4: ; preds = %my_irand.exit82
- ret void
-else.2: ; preds = %my_irand.exit82
- br i1 false, label %find_affected_nets.exit, label %loopentry.1.i107.outer.preheader
-loopentry.1.i107.outer.preheader: ; preds = %else.2
- ret void
-find_affected_nets.exit: ; preds = %else.2
- br i1 false, label %save_region_occ.exit, label %loopentry.1
-save_region_occ.exit: ; preds = %find_affected_nets.exit
- br i1 false, label %no_exit.1.preheader, label %loopexit.1
-loopentry.1: ; preds = %find_affected_nets.exit
- ret void
-no_exit.1.preheader: ; preds = %save_region_occ.exit
- ret void
-loopexit.1: ; preds = %save_region_occ.exit
- br i1 false, label %then.10, label %loopentry.3
-then.10: ; preds = %loopexit.1
- ret void
-loopentry.3: ; preds = %endif.16, %loopexit.1
- %indvar342 = phi i32 [ %indvar.next343, %endif.16 ], [ 0, %loopexit.1 ] ; <i32> [#uses=2]
- br i1 false, label %loopexit.3, label %endif.16
-endif.16: ; preds = %loopentry.3
- %indvar.next343 = add i32 %indvar342, 1 ; <i32> [#uses=1]
- br label %loopentry.3
-loopexit.3: ; preds = %loopentry.3
- br label %loopentry.4
-loopentry.4: ; preds = %loopentry.4, %loopexit.3
- %indvar340 = phi i32 [ 0, %loopexit.3 ], [ %indvar.next341, %loopentry.4 ] ; <i32> [#uses=2]
- %tmp. = add i32 %indvar340, %indvar342 ; <i32> [#uses=1]
- %tmp.526 = load i32** null ; <i32*> [#uses=1]
- %gep.upgrd.1 = zext i32 %tmp. to i64 ; <i64> [#uses=1]
- %tmp.528 = getelementptr i32* %tmp.526, i64 %gep.upgrd.1 ; <i32*> [#uses=1]
- store i32 0, i32* %tmp.528
- %indvar.next341 = add i32 %indvar340, 1 ; <i32> [#uses=1]
- br label %loopentry.4
-}
diff --git a/release_23/test/Transforms/LoopStrengthReduce/2005-08-17-OutOfLoopVariant.ll b/release_23/test/Transforms/LoopStrengthReduce/2005-08-17-OutOfLoopVariant.ll
deleted file mode 100644
index 83d46967e5f3..000000000000
--- a/release_23/test/Transforms/LoopStrengthReduce/2005-08-17-OutOfLoopVariant.ll
+++ /dev/null
@@ -1,17 +0,0 @@
-; RUN: llvm-as < %s | opt -loop-reduce -disable-output
-
-define i32 @image_to_texture(i32 %indvar454) {
-loopentry.1.outer:
- %j.2.1.ph = bitcast i32 %indvar454 to i32 ; <i32> [#uses=1]
- br label %loopentry.1
-loopentry.1: ; preds = %loopentry.1, %loopentry.1.outer
- %i.3 = phi i32 [ 0, %loopentry.1.outer ], [ %i.3.be, %loopentry.1 ] ; <i32> [#uses=2]
- %tmp.390 = load i32* null ; <i32> [#uses=1]
- %tmp.392 = mul i32 %tmp.390, %j.2.1.ph ; <i32> [#uses=1]
- %tmp.394 = add i32 %tmp.392, %i.3 ; <i32> [#uses=1]
- %i.3.be = add i32 %i.3, 1 ; <i32> [#uses=1]
- br i1 false, label %loopentry.1, label %label.6
-label.6: ; preds = %loopentry.1
- ret i32 %tmp.394
-}
-
diff --git a/release_23/test/Transforms/LoopStrengthReduce/2005-09-12-UsesOutOutsideOfLoop.ll b/release_23/test/Transforms/LoopStrengthReduce/2005-09-12-UsesOutOutsideOfLoop.ll
deleted file mode 100644
index 145551bded22..000000000000
--- a/release_23/test/Transforms/LoopStrengthReduce/2005-09-12-UsesOutOutsideOfLoop.ll
+++ /dev/null
@@ -1,32 +0,0 @@
-; RUN: llvm-as < %s | opt -loop-reduce -disable-output
-
-define void @main() {
-entry:
- br label %loopentry.0
-loopentry.0: ; preds = %then.5, %entry
- %arg_index.1.ph = phi i32 [ 1, %entry ], [ %arg_index.1.ph.be, %then.5 ] ; <i32> [#uses=1]
- br i1 false, label %no_exit.0, label %loopexit.0
-no_exit.0: ; preds = %loopentry.0
- %arg_index.1.1 = add i32 0, %arg_index.1.ph ; <i32> [#uses=2]
- br i1 false, label %then.i55, label %endif.i61
-then.i55: ; preds = %no_exit.0
- br i1 false, label %then.4, label %else.1
-endif.i61: ; preds = %no_exit.0
- ret void
-then.4: ; preds = %then.i55
- %tmp.19993 = add i32 %arg_index.1.1, 2 ; <i32> [#uses=0]
- ret void
-else.1: ; preds = %then.i55
- br i1 false, label %then.i86, label %loopexit.i97
-then.i86: ; preds = %else.1
- ret void
-loopexit.i97: ; preds = %else.1
- br i1 false, label %then.5, label %else.2
-then.5: ; preds = %loopexit.i97
- %arg_index.1.ph.be = add i32 %arg_index.1.1, 2 ; <i32> [#uses=1]
- br label %loopentry.0
-else.2: ; preds = %loopexit.i97
- ret void
-loopexit.0: ; preds = %loopentry.0
- ret void
-}
diff --git a/release_23/test/Transforms/LoopStrengthReduce/2007-04-23-UseIterator.ll b/release_23/test/Transforms/LoopStrengthReduce/2007-04-23-UseIterator.ll
deleted file mode 100644
index 2d2dade0bdc2..000000000000
--- a/release_23/test/Transforms/LoopStrengthReduce/2007-04-23-UseIterator.ll
+++ /dev/null
@@ -1,71 +0,0 @@
-; RUN: llvm-as < %s | opt -loop-reduce -disable-output
-
-target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64"
-
-target triple = "i686-apple-darwin9"
-
-define i8* @foo( i8* %ABC) {
-entry:
- switch i8 0, label %bb129 [
- i8 0, label %UnifiedReturnBlock
- i8 9, label %UnifiedReturnBlock
- i8 32, label %UnifiedReturnBlock
- i8 35, label %UnifiedReturnBlock
- i8 37, label %bb16.preheader
- ]
-
-bb16.preheader: ; preds = %entry
- br label %bb16
-
-bb16: ; preds = %cond_next102, %bb16.preheader
- %indvar = phi i32 [ %indvar.next, %cond_next102 ], [ 0, %bb16.preheader ] ; <i32> [#uses=2]
- %ABC.2146.0.rec = mul i32 %indvar, 3 ; <i32> [#uses=1]
- br i1 false, label %UnifiedReturnBlock.loopexit, label %cond_next102
-
-cond_next102: ; preds = %bb16
- %tmp138145.rec = add i32 %ABC.2146.0.rec, 3 ; <i32> [#uses=1]
- %tmp138145 = getelementptr i8* %ABC, i32 %tmp138145.rec ; <i8*> [#uses=4]
- %indvar.next = add i32 %indvar, 1 ; <i32> [#uses=1]
- switch i8 0, label %bb129.loopexit [
- i8 0, label %UnifiedReturnBlock.loopexit
- i8 9, label %UnifiedReturnBlock.loopexit
- i8 32, label %UnifiedReturnBlock.loopexit
- i8 35, label %UnifiedReturnBlock.loopexit
- i8 37, label %bb16
- ]
-
-bb129.loopexit: ; preds = %cond_next102
- br label %bb129
-
-bb129: ; preds = %bb129.loopexit, %entry
- ret i8* null
-
-UnifiedReturnBlock.loopexit: ; preds = %cond_next102, %cond_next102, %cond_next102, %cond_next102, %bb16
- %UnifiedRetVal.ph = phi i8* [ %tmp138145, %cond_next102 ], [ %tmp138145, %cond_next102 ], [ %tmp138145, %cond_next102 ], [ %tmp138145, %cond_next102 ], [ null, %bb16 ] ; <i8*> [#uses=0]
- br label %UnifiedReturnBlock
-
-UnifiedReturnBlock: ; preds = %UnifiedReturnBlock.loopexit, %entry, %entry, %entry, %entry
- ret i8* null
-}
-
-define i8* @bar() {
-entry:
- switch i8 0, label %bb158 [
- i8 37, label %bb74
- i8 58, label %cond_true
- i8 64, label %bb11
- ]
-
-bb11: ; preds = %entry
- ret i8* null
-
-cond_true: ; preds = %entry
- ret i8* null
-
-bb74: ; preds = %entry
- ret i8* null
-
-bb158: ; preds = %entry
- ret i8* null
-}
-
diff --git a/release_23/test/Transforms/LoopStrengthReduce/dg.exp b/release_23/test/Transforms/LoopStrengthReduce/dg.exp
deleted file mode 100644
index 879685ca879d..000000000000
--- a/release_23/test/Transforms/LoopStrengthReduce/dg.exp
+++ /dev/null
@@ -1,3 +0,0 @@
-load_lib llvm.exp
-
-RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
diff --git a/release_23/test/Transforms/LoopStrengthReduce/different-type-ivs.ll b/release_23/test/Transforms/LoopStrengthReduce/different-type-ivs.ll
deleted file mode 100644
index e5225da56ded..000000000000
--- a/release_23/test/Transforms/LoopStrengthReduce/different-type-ivs.ll
+++ /dev/null
@@ -1,25 +0,0 @@
-; RUN: llvm-as < %s | opt -loop-reduce -disable-output
-; Test to make sure that loop-reduce never crashes on IV's
-; with different types but identical strides.
-
-define void @foo() {
-entry:
- br label %no_exit
-no_exit: ; preds = %no_exit, %entry
- %indvar = phi i32 [ 0, %entry ], [ %indvar.next, %no_exit ] ; <i32> [#uses=3]
- %indvar.upgrd.1 = trunc i32 %indvar to i16 ; <i16> [#uses=1]
- %X.0.0 = mul i16 %indvar.upgrd.1, 1234 ; <i16> [#uses=1]
- %tmp. = mul i32 %indvar, 1234 ; <i32> [#uses=1]
- %tmp.5 = sext i16 %X.0.0 to i32 ; <i32> [#uses=1]
- %tmp.3 = call i32 (...)* @bar( i32 %tmp.5, i32 %tmp. ) ; <i32> [#uses=0]
- %tmp.0 = call i1 @pred( ) ; <i1> [#uses=1]
- %indvar.next = add i32 %indvar, 1 ; <i32> [#uses=1]
- br i1 %tmp.0, label %return, label %no_exit
-return: ; preds = %no_exit
- ret void
-}
-
-declare i1 @pred()
-
-declare i32 @bar(...)
-
diff --git a/release_23/test/Transforms/LoopStrengthReduce/dont-hoist-simple-loop-constants.ll b/release_23/test/Transforms/LoopStrengthReduce/dont-hoist-simple-loop-constants.ll
deleted file mode 100644
index 52095070ae0a..000000000000
--- a/release_23/test/Transforms/LoopStrengthReduce/dont-hoist-simple-loop-constants.ll
+++ /dev/null
@@ -1,23 +0,0 @@
-; RUN: llvm-as < %s | opt -loop-reduce | llvm-dis | \
-; RUN: not grep {bitcast i32 1 to i32}
-; END.
-; The setlt wants to use a value that is incremented one more than the dominant
-; IV. Don't insert the 1 outside the loop, preventing folding it into the add.
-
-define void @test([700 x i32]* %nbeaux_.0__558, i32* %i_.16574) {
-then.0:
- br label %no_exit.2
-no_exit.2: ; preds = %no_exit.2, %then.0
- %indvar630 = phi i32 [ 0, %then.0 ], [ %indvar.next631, %no_exit.2 ] ; <i32> [#uses=4]
- %gep.upgrd.1 = zext i32 %indvar630 to i64 ; <i64> [#uses=1]
- %tmp.38 = getelementptr [700 x i32]* %nbeaux_.0__558, i32 0, i64 %gep.upgrd.1 ; <i32*> [#uses=1]
- store i32 0, i32* %tmp.38
- %inc.2 = add i32 %indvar630, 2 ; <i32> [#uses=2]
- %tmp.34 = icmp slt i32 %inc.2, 701 ; <i1> [#uses=1]
- %indvar.next631 = add i32 %indvar630, 1 ; <i32> [#uses=1]
- br i1 %tmp.34, label %no_exit.2, label %loopexit.2.loopexit
-loopexit.2.loopexit: ; preds = %no_exit.2
- store i32 %inc.2, i32* %i_.16574
- ret void
-}
-
diff --git a/release_23/test/Transforms/LoopStrengthReduce/dont_insert_redundant_ops.ll b/release_23/test/Transforms/LoopStrengthReduce/dont_insert_redundant_ops.ll
deleted file mode 100644
index 68eb107f1091..000000000000
--- a/release_23/test/Transforms/LoopStrengthReduce/dont_insert_redundant_ops.ll
+++ /dev/null
@@ -1,36 +0,0 @@
-; Check that this test makes INDVAR and related stuff dead.
-; RUN: llvm-as < %s | opt -loop-reduce | llvm-dis | grep phi | count 2
-
-declare i1 @pred()
-
-define void @test1({ i32, i32 }* %P) {
-; <label>:0
- br label %Loop
-Loop: ; preds = %Loop, %0
- %INDVAR = phi i32 [ 0, %0 ], [ %INDVAR2, %Loop ] ; <i32> [#uses=3]
- %gep1 = getelementptr { i32, i32 }* %P, i32 %INDVAR, i32 0 ; <i32*> [#uses=1]
- store i32 0, i32* %gep1
- %gep2 = getelementptr { i32, i32 }* %P, i32 %INDVAR, i32 1 ; <i32*> [#uses=1]
- store i32 0, i32* %gep2
- %INDVAR2 = add i32 %INDVAR, 1 ; <i32> [#uses=1]
- %cond = call i1 @pred( ) ; <i1> [#uses=1]
- br i1 %cond, label %Loop, label %Out
-Out: ; preds = %Loop
- ret void
-}
-
-define void @test2([2 x i32]* %P) {
-; <label>:0
- br label %Loop
-Loop: ; preds = %Loop, %0
- %INDVAR = phi i32 [ 0, %0 ], [ %INDVAR2, %Loop ] ; <i32> [#uses=3]
- %gep1 = getelementptr [2 x i32]* %P, i32 %INDVAR, i64 0 ; <i32*> [#uses=1]
- store i32 0, i32* %gep1
- %gep2 = getelementptr [2 x i32]* %P, i32 %INDVAR, i64 1 ; <i32*> [#uses=1]
- store i32 0, i32* %gep2
- %INDVAR2 = add i32 %INDVAR, 1 ; <i32> [#uses=1]
- %cond = call i1 @pred( ) ; <i1> [#uses=1]
- br i1 %cond, label %Loop, label %Out
-Out: ; preds = %Loop
- ret void
-}
diff --git a/release_23/test/Transforms/LoopStrengthReduce/dont_reduce_bytes.ll b/release_23/test/Transforms/LoopStrengthReduce/dont_reduce_bytes.ll
deleted file mode 100644
index bfbbecfdb267..000000000000
--- a/release_23/test/Transforms/LoopStrengthReduce/dont_reduce_bytes.ll
+++ /dev/null
@@ -1,22 +0,0 @@
-; Don't reduce the byte access to P[i], at least not on targets that
-; support an efficient 'mem[r1+r2]' addressing mode.
-
-; RUN: llvm-as < %s | opt -loop-reduce -disable-output
-
-
-declare i1 @pred(i32)
-
-define void @test(i8* %PTR) {
-; <label>:0
- br label %Loop
-Loop: ; preds = %Loop, %0
- %INDVAR = phi i32 [ 0, %0 ], [ %INDVAR2, %Loop ] ; <i32> [#uses=2]
- %STRRED = getelementptr i8* %PTR, i32 %INDVAR ; <i8*> [#uses=1]
- store i8 0, i8* %STRRED
- %INDVAR2 = add i32 %INDVAR, 1 ; <i32> [#uses=2]
- ;; cannot eliminate indvar
- %cond = call i1 @pred( i32 %INDVAR2 ) ; <i1> [#uses=1]
- br i1 %cond, label %Loop, label %Out
-Out: ; preds = %Loop
- ret void
-}
diff --git a/release_23/test/Transforms/LoopStrengthReduce/exit_compare_live_range.ll b/release_23/test/Transforms/LoopStrengthReduce/exit_compare_live_range.ll
deleted file mode 100644
index d21498b0a457..000000000000
--- a/release_23/test/Transforms/LoopStrengthReduce/exit_compare_live_range.ll
+++ /dev/null
@@ -1,20 +0,0 @@
-; Make sure that the compare instruction occurs after the increment to avoid
-; having overlapping live ranges that result in copies. We want the setcc
-; instruction immediately before the conditional branch.
-;
-; RUN: llvm-as < %s | opt -loop-reduce | llvm-dis | \
-; RUN: %prcontext {br i1} 1 | grep icmp
-
-define void @foo(float* %D, i32 %E) {
-entry:
- br label %no_exit
-no_exit: ; preds = %no_exit, %entry
- %indvar = phi i32 [ 0, %entry ], [ %indvar.next, %no_exit ] ; <i32> [#uses=1]
- volatile store float 0.000000e+00, float* %D
- %indvar.next = add i32 %indvar, 1 ; <i32> [#uses=2]
- %exitcond = icmp eq i32 %indvar.next, %E ; <i1> [#uses=1]
- br i1 %exitcond, label %loopexit, label %no_exit
-loopexit: ; preds = %no_exit
- ret void
-}
-
diff --git a/release_23/test/Transforms/LoopStrengthReduce/invariant_value_first.ll b/release_23/test/Transforms/LoopStrengthReduce/invariant_value_first.ll
deleted file mode 100644
index 86a1c257655b..000000000000
--- a/release_23/test/Transforms/LoopStrengthReduce/invariant_value_first.ll
+++ /dev/null
@@ -1,23 +0,0 @@
-; Check that the index of 'P[outer]' is pulled out of the loop.
-; RUN: llvm-as < %s | opt -loop-reduce | llvm-dis | \
-; RUN: not grep {getelementptr.*%outer.*%INDVAR}
-
-declare i1 @pred()
-
-declare i32 @foo()
-
-define void @test([10000 x i32]* %P) {
-; <label>:0
- %outer = call i32 @foo( ) ; <i32> [#uses=1]
- br label %Loop
-Loop: ; preds = %Loop, %0
- %INDVAR = phi i32 [ 0, %0 ], [ %INDVAR2, %Loop ] ; <i32> [#uses=2]
- %STRRED = getelementptr [10000 x i32]* %P, i32 %outer, i32 %INDVAR ; <i32*> [#uses=1]
- store i32 0, i32* %STRRED
- %INDVAR2 = add i32 %INDVAR, 1 ; <i32> [#uses=1]
- %cond = call i1 @pred( ) ; <i1> [#uses=1]
- br i1 %cond, label %Loop, label %Out
-Out: ; preds = %Loop
- ret void
-}
-
diff --git a/release_23/test/Transforms/LoopStrengthReduce/invariant_value_first_arg.ll b/release_23/test/Transforms/LoopStrengthReduce/invariant_value_first_arg.ll
deleted file mode 100644
index 8e9cbc4a81ef..000000000000
--- a/release_23/test/Transforms/LoopStrengthReduce/invariant_value_first_arg.ll
+++ /dev/null
@@ -1,20 +0,0 @@
-; Check that the index of 'P[outer]' is pulled out of the loop.
-; RUN: llvm-as < %s | opt -loop-reduce | llvm-dis | \
-; RUN: not grep {getelementptr.*%outer.*%INDVAR}
-
-declare i1 @pred()
-
-define void @test([10000 x i32]* %P, i32 %outer) {
-; <label>:0
- br label %Loop
-Loop: ; preds = %Loop, %0
- %INDVAR = phi i32 [ 0, %0 ], [ %INDVAR2, %Loop ] ; <i32> [#uses=2]
- %STRRED = getelementptr [10000 x i32]* %P, i32 %outer, i32 %INDVAR ; <i32*> [#uses=1]
- store i32 0, i32* %STRRED
- %INDVAR2 = add i32 %INDVAR, 1 ; <i32> [#uses=1]
- %cond = call i1 @pred( ) ; <i1> [#uses=1]
- br i1 %cond, label %Loop, label %Out
-Out: ; preds = %Loop
- ret void
-}
-
diff --git a/release_23/test/Transforms/LoopStrengthReduce/nested-reduce.ll b/release_23/test/Transforms/LoopStrengthReduce/nested-reduce.ll
deleted file mode 100644
index c19e844ea2bb..000000000000
--- a/release_23/test/Transforms/LoopStrengthReduce/nested-reduce.ll
+++ /dev/null
@@ -1,49 +0,0 @@
-; RUN: llvm-as < %s | opt -loop-reduce | llvm-dis | not grep mul
-
-; Make sure we don't get a multiply by 6 in this loop.
-
-define i32 @foo(i32 %A, i32 %B, i32 %C, i32 %D) {
-entry:
- %tmp.5 = icmp sgt i32 %C, 0 ; <i1> [#uses=1]
- %tmp.25 = and i32 %A, 1 ; <i32> [#uses=1]
- br label %loopentry.1
-loopentry.1: ; preds = %loopexit.1, %entry
- %indvar20 = phi i32 [ 0, %entry ], [ %indvar.next21, %loopexit.1 ] ; <i32> [#uses=2]
- %k.1 = phi i32 [ 0, %entry ], [ %k.1.3, %loopexit.1 ] ; <i32> [#uses=2]
- br i1 %tmp.5, label %no_exit.1.preheader, label %loopexit.1
-no_exit.1.preheader: ; preds = %loopentry.1
- %i.0.0 = bitcast i32 %indvar20 to i32 ; <i32> [#uses=1]
- %tmp.9 = mul i32 %i.0.0, 6 ; <i32> [#uses=1]
- br label %no_exit.1.outer
-no_exit.1.outer: ; preds = %cond_true, %no_exit.1.preheader
- %k.1.2.ph = phi i32 [ %k.1, %no_exit.1.preheader ], [ %k.09, %cond_true ] ; <i32> [#uses=2]
- %j.1.2.ph = phi i32 [ 0, %no_exit.1.preheader ], [ %inc.1, %cond_true ] ; <i32> [#uses=1]
- br label %no_exit.1
-no_exit.1: ; preds = %cond_continue, %no_exit.1.outer
- %indvar.ui = phi i32 [ 0, %no_exit.1.outer ], [ %indvar.next, %cond_continue ] ; <i32> [#uses=2]
- %indvar = bitcast i32 %indvar.ui to i32 ; <i32> [#uses=1]
- %j.1.2 = add i32 %indvar, %j.1.2.ph ; <i32> [#uses=2]
- %tmp.11 = add i32 %j.1.2, %tmp.9 ; <i32> [#uses=1]
- %tmp.12 = trunc i32 %tmp.11 to i8 ; <i8> [#uses=1]
- %shift.upgrd.1 = zext i8 %tmp.12 to i32 ; <i32> [#uses=1]
- %tmp.13 = shl i32 %D, %shift.upgrd.1 ; <i32> [#uses=2]
- %tmp.15 = icmp eq i32 %tmp.13, %B ; <i1> [#uses=1]
- %inc.1 = add i32 %j.1.2, 1 ; <i32> [#uses=3]
- br i1 %tmp.15, label %cond_true, label %cond_continue
-cond_true: ; preds = %no_exit.1
- %tmp.26 = and i32 %tmp.25, %tmp.13 ; <i32> [#uses=1]
- %k.09 = add i32 %tmp.26, %k.1.2.ph ; <i32> [#uses=2]
- %tmp.517 = icmp slt i32 %inc.1, %C ; <i1> [#uses=1]
- br i1 %tmp.517, label %no_exit.1.outer, label %loopexit.1
-cond_continue: ; preds = %no_exit.1
- %tmp.519 = icmp slt i32 %inc.1, %C ; <i1> [#uses=1]
- %indvar.next = add i32 %indvar.ui, 1 ; <i32> [#uses=1]
- br i1 %tmp.519, label %no_exit.1, label %loopexit.1
-loopexit.1: ; preds = %cond_continue, %cond_true, %loopentry.1
- %k.1.3 = phi i32 [ %k.1, %loopentry.1 ], [ %k.09, %cond_true ], [ %k.1.2.ph, %cond_continue ] ; <i32> [#uses=2]
- %indvar.next21 = add i32 %indvar20, 1 ; <i32> [#uses=2]
- %exitcond = icmp eq i32 %indvar.next21, 4 ; <i1> [#uses=1]
- br i1 %exitcond, label %loopexit.0, label %loopentry.1
-loopexit.0: ; preds = %loopexit.1
- ret i32 %k.1.3
-}
diff --git a/release_23/test/Transforms/LoopStrengthReduce/ops_after_indvar.ll b/release_23/test/Transforms/LoopStrengthReduce/ops_after_indvar.ll
deleted file mode 100644
index 5880dc15f0d2..000000000000
--- a/release_23/test/Transforms/LoopStrengthReduce/ops_after_indvar.ll
+++ /dev/null
@@ -1,24 +0,0 @@
-; Check that this test makes INDVAR and related stuff dead, because P[indvar]
-; gets reduced, making INDVAR dead.
-
-; RUN: llvm-as < %s | opt -loop-reduce | llvm-dis | not grep INDVAR
-
-declare i1 @pred()
-
-declare i32 @getidx()
-
-define void @test([10000 x i32]* %P) {
-; <label>:0
- br label %Loop
-Loop: ; preds = %Loop, %0
- %INDVAR = phi i32 [ 0, %0 ], [ %INDVAR2, %Loop ] ; <i32> [#uses=2]
- %idx = call i32 @getidx( ) ; <i32> [#uses=1]
- %STRRED = getelementptr [10000 x i32]* %P, i32 %INDVAR, i32 %idx ; <i32*> [#uses=1]
- store i32 0, i32* %STRRED
- %INDVAR2 = add i32 %INDVAR, 1 ; <i32> [#uses=1]
- %cond = call i1 @pred( ) ; <i1> [#uses=1]
- br i1 %cond, label %Loop, label %Out
-Out: ; preds = %Loop
- ret void
-}
-
diff --git a/release_23/test/Transforms/LoopStrengthReduce/phi_node_update_multiple_preds.ll b/release_23/test/Transforms/LoopStrengthReduce/phi_node_update_multiple_preds.ll
deleted file mode 100644
index 64d387a4a936..000000000000
--- a/release_23/test/Transforms/LoopStrengthReduce/phi_node_update_multiple_preds.ll
+++ /dev/null
@@ -1,28 +0,0 @@
-; RUN: llvm-as < %s | opt -loop-reduce -disable-output
-; LSR should not crash on this.
-
-define fastcc void @loadloop() {
-entry:
- switch i8 0, label %shortcirc_next [
- i8 32, label %loopexit.2
- i8 59, label %loopexit.2
- ]
-shortcirc_next: ; preds = %no_exit.2, %entry
- %indvar37 = phi i32 [ 0, %entry ], [ %indvar.next38, %no_exit.2 ] ; <i32> [#uses=3]
- %gep.upgrd.1 = zext i32 %indvar37 to i64 ; <i64> [#uses=1]
- %wp.2.4 = getelementptr i8* null, i64 %gep.upgrd.1 ; <i8*> [#uses=1]
- br i1 false, label %loopexit.2, label %no_exit.2
-no_exit.2: ; preds = %shortcirc_next
- %wp.2.4.rec = bitcast i32 %indvar37 to i32 ; <i32> [#uses=1]
- %inc.1.rec = add i32 %wp.2.4.rec, 1 ; <i32> [#uses=1]
- %inc.1 = getelementptr i8* null, i32 %inc.1.rec ; <i8*> [#uses=2]
- %indvar.next38 = add i32 %indvar37, 1 ; <i32> [#uses=1]
- switch i8 0, label %shortcirc_next [
- i8 32, label %loopexit.2
- i8 59, label %loopexit.2
- ]
-loopexit.2: ; preds = %no_exit.2, %no_exit.2, %shortcirc_next, %entry, %entry
- %wp.2.7 = phi i8* [ null, %entry ], [ null, %entry ], [ %wp.2.4, %shortcirc_next ], [ %inc.1, %no_exit.2 ], [ %inc.1, %no_exit.2 ] ; <i8*> [#uses=0]
- ret void
-}
-
diff --git a/release_23/test/Transforms/LoopStrengthReduce/related_indvars.ll b/release_23/test/Transforms/LoopStrengthReduce/related_indvars.ll
deleted file mode 100644
index 434da99068c3..000000000000
--- a/release_23/test/Transforms/LoopStrengthReduce/related_indvars.ll
+++ /dev/null
@@ -1,27 +0,0 @@
-; RUN: llvm-as < %s | opt -loop-reduce | llvm-dis | grep phi | count 1
-
-; This should only result in one PHI node!
-
-; void foo(double *D, double *E, double F) {
-; while (D != E)
-; *D++ = F;
-; }
-
-define void @foo(double* %D, double* %E, double %F) {
-entry:
- %tmp.24 = icmp eq double* %D, %E ; <i1> [#uses=1]
- br i1 %tmp.24, label %return, label %no_exit
-no_exit: ; preds = %no_exit, %entry
- %indvar = phi i32 [ 0, %entry ], [ %indvar.next, %no_exit ] ; <i32> [#uses=2]
- %D_addr.0.0.rec = bitcast i32 %indvar to i32 ; <i32> [#uses=2]
- %D_addr.0.0 = getelementptr double* %D, i32 %D_addr.0.0.rec ; <double*> [#uses=1]
- %inc.rec = add i32 %D_addr.0.0.rec, 1 ; <i32> [#uses=1]
- %inc = getelementptr double* %D, i32 %inc.rec ; <double*> [#uses=1]
- store double %F, double* %D_addr.0.0
- %tmp.2 = icmp eq double* %inc, %E ; <i1> [#uses=1]
- %indvar.next = add i32 %indvar, 1 ; <i32> [#uses=1]
- br i1 %tmp.2, label %return, label %no_exit
-return: ; preds = %no_exit, %entry
- ret void
-}
-
diff --git a/release_23/test/Transforms/LoopStrengthReduce/remove_indvar.ll b/release_23/test/Transforms/LoopStrengthReduce/remove_indvar.ll
deleted file mode 100644
index 623c0b5338ef..000000000000
--- a/release_23/test/Transforms/LoopStrengthReduce/remove_indvar.ll
+++ /dev/null
@@ -1,19 +0,0 @@
-; Check that this test makes INDVAR and related stuff dead.
-; RUN: llvm-as < %s | opt -loop-reduce | llvm-dis | not grep INDVAR
-
-declare i1 @pred()
-
-define void @test(i32* %P) {
-; <label>:0
- br label %Loop
-Loop: ; preds = %Loop, %0
- %INDVAR = phi i32 [ 0, %0 ], [ %INDVAR2, %Loop ] ; <i32> [#uses=2]
- %STRRED = getelementptr i32* %P, i32 %INDVAR ; <i32*> [#uses=1]
- store i32 0, i32* %STRRED
- %INDVAR2 = add i32 %INDVAR, 1 ; <i32> [#uses=1]
- %cond = call i1 @pred( ) ; <i1> [#uses=1]
- br i1 %cond, label %Loop, label %Out
-Out: ; preds = %Loop
- ret void
-}
-
diff --git a/release_23/test/Transforms/LoopStrengthReduce/share_code_in_preheader.ll b/release_23/test/Transforms/LoopStrengthReduce/share_code_in_preheader.ll
deleted file mode 100644
index a78fa5f349fa..000000000000
--- a/release_23/test/Transforms/LoopStrengthReduce/share_code_in_preheader.ll
+++ /dev/null
@@ -1,27 +0,0 @@
-; RUN: llvm-as < %s | opt -loop-reduce | llvm-dis | grep mul | count 1
-; LSR should not make two copies of the Q*L expression in the preheader!
-
-define i8 @test(i8* %A, i8* %B, i32 %L, i32 %Q, i32 %N.s) {
-entry:
- %tmp.6 = mul i32 %Q, %L ; <i32> [#uses=1]
- %N = bitcast i32 %N.s to i32 ; <i32> [#uses=1]
- br label %no_exit
-no_exit: ; preds = %no_exit, %entry
- %indvar.ui = phi i32 [ 0, %entry ], [ %indvar.next, %no_exit ] ; <i32> [#uses=2]
- %Sum.0.0 = phi i8 [ 0, %entry ], [ %tmp.21, %no_exit ] ; <i8> [#uses=1]
- %indvar = bitcast i32 %indvar.ui to i32 ; <i32> [#uses=1]
- %N_addr.0.0 = sub i32 %N.s, %indvar ; <i32> [#uses=1]
- %tmp.8 = add i32 %N_addr.0.0, %tmp.6 ; <i32> [#uses=2]
- %tmp.9 = getelementptr i8* %A, i32 %tmp.8 ; <i8*> [#uses=1]
- %tmp.10 = load i8* %tmp.9 ; <i8> [#uses=1]
- %tmp.17 = getelementptr i8* %B, i32 %tmp.8 ; <i8*> [#uses=1]
- %tmp.18 = load i8* %tmp.17 ; <i8> [#uses=1]
- %tmp.19 = sub i8 %tmp.10, %tmp.18 ; <i8> [#uses=1]
- %tmp.21 = add i8 %tmp.19, %Sum.0.0 ; <i8> [#uses=2]
- %indvar.next = add i32 %indvar.ui, 1 ; <i32> [#uses=2]
- %exitcond = icmp eq i32 %indvar.next, %N ; <i1> [#uses=1]
- br i1 %exitcond, label %loopexit, label %no_exit
-loopexit: ; preds = %no_exit
- ret i8 %tmp.21
-}
-
diff --git a/release_23/test/Transforms/LoopStrengthReduce/share_ivs.ll b/release_23/test/Transforms/LoopStrengthReduce/share_ivs.ll
deleted file mode 100644
index b52d571f4276..000000000000
--- a/release_23/test/Transforms/LoopStrengthReduce/share_ivs.ll
+++ /dev/null
@@ -1,24 +0,0 @@
-; RUN: llvm-as < %s | opt -loop-reduce | llvm-dis | grep phi | count 1
-
-; This testcase should have ONE stride 18 indvar, the other use should have a
-; loop invariant value (B) added to it inside of the loop, instead of having
-; a whole indvar based on B for it.
-
-declare i1 @cond(i32)
-
-define void @test(i32 %B) {
-; <label>:0
- br label %Loop
-Loop: ; preds = %Loop, %0
- %IV = phi i32 [ 0, %0 ], [ %IVn, %Loop ] ; <i32> [#uses=3]
- %C = mul i32 %IV, 18 ; <i32> [#uses=1]
- %D = mul i32 %IV, 18 ; <i32> [#uses=1]
- %E = add i32 %D, %B ; <i32> [#uses=1]
- %cnd = call i1 @cond( i32 %E ) ; <i1> [#uses=1]
- call i1 @cond( i32 %C ) ; <i1>:1 [#uses=0]
- %IVn = add i32 %IV, 1 ; <i32> [#uses=1]
- br i1 %cnd, label %Loop, label %Out
-Out: ; preds = %Loop
- ret void
-}
-
diff --git a/release_23/test/Transforms/LoopStrengthReduce/use_postinc_value_outside_loop.ll b/release_23/test/Transforms/LoopStrengthReduce/use_postinc_value_outside_loop.ll
deleted file mode 100644
index a521ba4e2d9e..000000000000
--- a/release_23/test/Transforms/LoopStrengthReduce/use_postinc_value_outside_loop.ll
+++ /dev/null
@@ -1,29 +0,0 @@
-; RUN: llvm-as < %s | opt -loop-reduce | llvm-dis | \
-; RUN: grep {add i32 %iv.*inc, 1}
-;
-; Make sure that the use of the IV outside of the loop (the store) uses the
-; post incremented value of the IV, not the preincremented value. This
-; prevents the loop from having to keep the post and pre-incremented value
-; around for the duration of the loop, adding a copy and an extra register
-; to the loop.
-
-declare i1 @pred(i32)
-
-define void @test([700 x i32]* %nbeaux_.0__558, i32* %i_.16574) {
-then.0:
- br label %no_exit.2
-no_exit.2: ; preds = %no_exit.2, %then.0
- %indvar630.ui = phi i32 [ 0, %then.0 ], [ %indvar.next631, %no_exit.2 ] ; <i32> [#uses=3]
- %indvar630 = bitcast i32 %indvar630.ui to i32 ; <i32> [#uses=2]
- %gep.upgrd.1 = zext i32 %indvar630.ui to i64 ; <i64> [#uses=1]
- %tmp.38 = getelementptr [700 x i32]* %nbeaux_.0__558, i32 0, i64 %gep.upgrd.1 ; <i32*> [#uses=1]
- store i32 0, i32* %tmp.38
- %inc.2 = add i32 %indvar630, 2 ; <i32> [#uses=1]
- %tmp.34 = call i1 @pred( i32 %indvar630 ) ; <i1> [#uses=1]
- %indvar.next631 = add i32 %indvar630.ui, 1 ; <i32> [#uses=1]
- br i1 %tmp.34, label %no_exit.2, label %loopexit.2.loopexit
-loopexit.2.loopexit: ; preds = %no_exit.2
- store i32 %inc.2, i32* %i_.16574
- ret void
-}
-
diff --git a/release_23/test/Transforms/LoopStrengthReduce/var_stride_used_by_compare.ll b/release_23/test/Transforms/LoopStrengthReduce/var_stride_used_by_compare.ll
deleted file mode 100644
index 53eedd673260..000000000000
--- a/release_23/test/Transforms/LoopStrengthReduce/var_stride_used_by_compare.ll
+++ /dev/null
@@ -1,41 +0,0 @@
-; Base should not be i*3, it should be i*2.
-; RUN: llvm-as < %s | opt -loop-reduce | llvm-dis | \
-; RUN: not grep {mul.*%i, 3}
-
-; Indvar should not start at zero:
-; RUN: llvm-as < %s | opt -loop-reduce | llvm-dis | \
-; RUN: not grep {phi i32 .* 0}
-; END.
-
-; mul uint %i, 3
-
-target datalayout = "e-p:32:32"
-target triple = "i686-apple-darwin8"
-@flags2 = external global [8193 x i8], align 32 ; <[8193 x i8]*> [#uses=1]
-
-define void @foo(i32 %k, i32 %i.s) {
-entry:
- %i = bitcast i32 %i.s to i32 ; <i32> [#uses=2]
- %k_addr.012 = shl i32 %i.s, 1 ; <i32> [#uses=1]
- %tmp14 = icmp sgt i32 %k_addr.012, 8192 ; <i1> [#uses=1]
- br i1 %tmp14, label %return, label %bb.preheader
-bb.preheader: ; preds = %entry
- %tmp. = shl i32 %i, 1 ; <i32> [#uses=1]
- br label %bb
-bb: ; preds = %bb, %bb.preheader
- %indvar = phi i32 [ %indvar.next, %bb ], [ 0, %bb.preheader ] ; <i32> [#uses=2]
- %tmp.15 = mul i32 %indvar, %i ; <i32> [#uses=1]
- %tmp.16 = add i32 %tmp.15, %tmp. ; <i32> [#uses=2]
- %k_addr.0.0 = bitcast i32 %tmp.16 to i32 ; <i32> [#uses=1]
- %gep.upgrd.1 = zext i32 %tmp.16 to i64 ; <i64> [#uses=1]
- %tmp = getelementptr [8193 x i8]* @flags2, i32 0, i64 %gep.upgrd.1 ; <i8*> [#uses=1]
- store i8 0, i8* %tmp
- %k_addr.0 = add i32 %k_addr.0.0, %i.s ; <i32> [#uses=1]
- %tmp.upgrd.2 = icmp sgt i32 %k_addr.0, 8192 ; <i1> [#uses=1]
- %indvar.next = add i32 %indvar, 1 ; <i32> [#uses=1]
- br i1 %tmp.upgrd.2, label %return.loopexit, label %bb
-return.loopexit: ; preds = %bb
- br label %return
-return: ; preds = %return.loopexit, %entry
- ret void
-}
diff --git a/release_23/test/Transforms/LoopStrengthReduce/variable_stride.ll b/release_23/test/Transforms/LoopStrengthReduce/variable_stride.ll
deleted file mode 100644
index 90d3947101ff..000000000000
--- a/release_23/test/Transforms/LoopStrengthReduce/variable_stride.ll
+++ /dev/null
@@ -1,18 +0,0 @@
-; Check that variable strides are reduced to adds instead of multiplies.
-; RUN: llvm-as < %s | opt -loop-reduce | llvm-dis | not grep mul
-
-declare i1 @pred(i32)
-
-define void @test([10000 x i32]* %P, i32 %STRIDE) {
-; <label>:0
- br label %Loop
-Loop: ; preds = %Loop, %0
- %INDVAR = phi i32 [ 0, %0 ], [ %INDVAR2, %Loop ] ; <i32> [#uses=2]
- %Idx = mul i32 %INDVAR, %STRIDE ; <i32> [#uses=1]
- %cond = call i1 @pred( i32 %Idx ) ; <i1> [#uses=1]
- %INDVAR2 = add i32 %INDVAR, 1 ; <i32> [#uses=1]
- br i1 %cond, label %Loop, label %Out
-Out: ; preds = %Loop
- ret void
-}
-
diff --git a/release_23/test/Transforms/LoopUnroll/2004-05-13-DontUnrollTooMuch.ll b/release_23/test/Transforms/LoopUnroll/2004-05-13-DontUnrollTooMuch.ll
deleted file mode 100644
index 13a26a253325..000000000000
--- a/release_23/test/Transforms/LoopUnroll/2004-05-13-DontUnrollTooMuch.ll
+++ /dev/null
@@ -1,14 +0,0 @@
-; RUN: llvm-as < %s | opt -loop-unroll -disable-output
-
-define i32 @main() {
-entry:
- br label %no_exit
-no_exit: ; preds = %no_exit, %entry
- %indvar = phi i32 [ 0, %entry ], [ %indvar.next, %no_exit ] ; <i32> [#uses=1]
- %indvar.next = add i32 %indvar, 1 ; <i32> [#uses=2]
- %exitcond = icmp ne i32 %indvar.next, -2147483648 ; <i1> [#uses=1]
- br i1 %exitcond, label %no_exit, label %loopexit
-loopexit: ; preds = %no_exit
- ret i32 0
-}
-
diff --git a/release_23/test/Transforms/LoopUnroll/2005-03-06-BadLoopInfoUpdate.ll b/release_23/test/Transforms/LoopUnroll/2005-03-06-BadLoopInfoUpdate.ll
deleted file mode 100644
index db107fdd4bc0..000000000000
--- a/release_23/test/Transforms/LoopUnroll/2005-03-06-BadLoopInfoUpdate.ll
+++ /dev/null
@@ -1,22 +0,0 @@
-; RUN: llvm-as < %s | opt -loop-unroll -loopsimplify -disable-output
-
-define void @print_board() {
-entry:
- br label %no_exit.1
-no_exit.1: ; preds = %cond_false.2, %entry
- br label %no_exit.2
-no_exit.2: ; preds = %no_exit.2, %no_exit.1
- %indvar1 = phi i32 [ 0, %no_exit.1 ], [ %indvar.next2, %no_exit.2 ] ; <i32> [#uses=1]
- %indvar.next2 = add i32 %indvar1, 1 ; <i32> [#uses=2]
- %exitcond3 = icmp ne i32 %indvar.next2, 7 ; <i1> [#uses=1]
- br i1 %exitcond3, label %no_exit.2, label %loopexit.2
-loopexit.2: ; preds = %no_exit.2
- br i1 false, label %cond_true.2, label %cond_false.2
-cond_true.2: ; preds = %loopexit.2
- ret void
-cond_false.2: ; preds = %loopexit.2
- br i1 false, label %no_exit.1, label %loopexit.1
-loopexit.1: ; preds = %cond_false.2
- ret void
-}
-
diff --git a/release_23/test/Transforms/LoopUnroll/2006-08-24-MultiBlockLoop.ll b/release_23/test/Transforms/LoopUnroll/2006-08-24-MultiBlockLoop.ll
deleted file mode 100644
index 16419cab1abf..000000000000
--- a/release_23/test/Transforms/LoopUnroll/2006-08-24-MultiBlockLoop.ll
+++ /dev/null
@@ -1,16 +0,0 @@
-; RUN: llvm-as < %s | opt -loop-unroll | llvm-dis | grep bb72.2
-
-define void @vorbis_encode_noisebias_setup() {
-entry:
- br label %cond_true.outer
-cond_true.outer: ; preds = %bb72, %entry
- %indvar1.ph = phi i32 [ 0, %entry ], [ %indvar.next2, %bb72 ] ; <i32> [#uses=1]
- br label %bb72
-bb72: ; preds = %cond_true.outer
- %indvar.next2 = add i32 %indvar1.ph, 1 ; <i32> [#uses=2]
- %exitcond3 = icmp eq i32 %indvar.next2, 3 ; <i1> [#uses=1]
- br i1 %exitcond3, label %cond_true138, label %cond_true.outer
-cond_true138: ; preds = %bb72
- ret void
-}
-
diff --git a/release_23/test/Transforms/LoopUnroll/2007-04-16-PhiUpdate.ll b/release_23/test/Transforms/LoopUnroll/2007-04-16-PhiUpdate.ll
deleted file mode 100644
index 26fa60a8216c..000000000000
--- a/release_23/test/Transforms/LoopUnroll/2007-04-16-PhiUpdate.ll
+++ /dev/null
@@ -1,17 +0,0 @@
-; PR 1334
-; RUN: llvm-as < %s | opt -loop-unroll -disable-output
-
-define void @sal__math_float_manipulator_7__math__joint_array_dcv_ops__Omultiply__3([6 x float]* %agg.result) {
-entry:
- %tmp282911 = zext i8 0 to i32 ; <i32> [#uses=1]
- br label %cond_next
-cond_next: ; preds = %cond_next, %entry
- %indvar = phi i8 [ 0, %entry ], [ %indvar.next, %cond_next ] ; <i8> [#uses=1]
- %indvar.next = add i8 %indvar, 1 ; <i8> [#uses=2]
- %exitcond = icmp eq i8 %indvar.next, 7 ; <i1> [#uses=1]
- br i1 %exitcond, label %bb27, label %cond_next
-bb27: ; preds = %cond_next
- %tmp282911.lcssa = phi i32 [ %tmp282911, %cond_next ] ; <i32> [#uses=0]
- ret void
-}
-
diff --git a/release_23/test/Transforms/LoopUnroll/2007-05-05-UnrollMiscomp.ll b/release_23/test/Transforms/LoopUnroll/2007-05-05-UnrollMiscomp.ll
deleted file mode 100644
index 44890a6e616e..000000000000
--- a/release_23/test/Transforms/LoopUnroll/2007-05-05-UnrollMiscomp.ll
+++ /dev/null
@@ -1,36 +0,0 @@
-; RUN: llvm-as < %s | opt -loop-unroll | llvm-dis | not grep undef
-; PR1385
-
-target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64"
-target triple = "i686-apple-darwin8"
- %struct.__mpz_struct = type { i32, i32, i32* }
-
-
-define void @Foo(%struct.__mpz_struct* %base) {
-entry:
- %want = alloca [1 x %struct.__mpz_struct], align 16 ; <[1 x %struct.__mpz_struct]*> [#uses=4]
- %want1 = getelementptr [1 x %struct.__mpz_struct]* %want, i32 0, i32 0 ; <%struct.__mpz_struct*> [#uses=1]
- call void @__gmpz_init( %struct.__mpz_struct* %want1 )
- %want27 = getelementptr [1 x %struct.__mpz_struct]* %want, i32 0, i32 0 ; <%struct.__mpz_struct*> [#uses=1]
- %want3 = getelementptr [1 x %struct.__mpz_struct]* %want, i32 0, i32 0 ; <%struct.__mpz_struct*> [#uses=1]
- %want2 = getelementptr [1 x %struct.__mpz_struct]* %want, i32 0, i32 0 ; <%struct.__mpz_struct*> [#uses=2]
- br label %bb
-
-bb: ; preds = %bb, %entry
- %i.01.0 = phi i32 [ 0, %entry ], [ %indvar.next, %bb ] ; <i32> [#uses=1]
- %want23.0 = phi %struct.__mpz_struct* [ %want27, %entry ], [ %want2, %bb ] ; <%struct.__mpz_struct*> [#uses=1]
- call void @__gmpz_mul( %struct.__mpz_struct* %want23.0, %struct.__mpz_struct* %want3, %struct.__mpz_struct* %base )
- %indvar.next = add i32 %i.01.0, 1 ; <i32> [#uses=2]
- %exitcond = icmp ne i32 %indvar.next, 2 ; <i1> [#uses=1]
- br i1 %exitcond, label %bb, label %bb10
-
-bb10: ; preds = %bb
- %want2.lcssa = phi %struct.__mpz_struct* [ %want2, %bb ] ; <%struct.__mpz_struct*> [#uses=1]
- call void @__gmpz_clear( %struct.__mpz_struct* %want2.lcssa )
- ret void
-}
-
-declare void @__gmpz_init(%struct.__mpz_struct*)
-declare void @__gmpz_mul(%struct.__mpz_struct*, %struct.__mpz_struct*, %struct.__mpz_struct*)
-declare void @__gmpz_clear(%struct.__mpz_struct*)
-
diff --git a/release_23/test/Transforms/LoopUnroll/2007-05-09-UnknownTripCount.ll b/release_23/test/Transforms/LoopUnroll/2007-05-09-UnknownTripCount.ll
deleted file mode 100644
index 2086e9678cdc..000000000000
--- a/release_23/test/Transforms/LoopUnroll/2007-05-09-UnknownTripCount.ll
+++ /dev/null
@@ -1,18 +0,0 @@
-; RUN: llvm-as < %s | opt -loop-unroll -unroll-count=3 | llvm-dis | grep bb72.2
-
-define void @foo(i32 %trips) {
-entry:
- br label %cond_true.outer
-
-cond_true.outer:
- %indvar1.ph = phi i32 [ 0, %entry ], [ %indvar.next2, %bb72 ]
- br label %bb72
-
-bb72:
- %indvar.next2 = add i32 %indvar1.ph, 1
- %exitcond3 = icmp eq i32 %indvar.next2, %trips
- br i1 %exitcond3, label %cond_true138, label %cond_true.outer
-
-cond_true138:
- ret void
-}
diff --git a/release_23/test/Transforms/LoopUnroll/2007-11-05-Crash.ll b/release_23/test/Transforms/LoopUnroll/2007-11-05-Crash.ll
deleted file mode 100644
index a46c09e3bde8..000000000000
--- a/release_23/test/Transforms/LoopUnroll/2007-11-05-Crash.ll
+++ /dev/null
@@ -1,295 +0,0 @@
-; RUN: llvm-as < %s | opt -disable-output -loop-unroll
-; PR1770
-; PR1947
-
- %struct.cl_engine = type { i32, i16, i32, i8**, i8**, i8*, i8*, i8*, i8*, i8*, i8*, i8* }
- %struct.cl_limits = type { i32, i32, i32, i32, i16, i64 }
- %struct.cli_ac_alt = type { i8, i8*, i16, i16, %struct.cli_ac_alt* }
- %struct.cli_ac_node = type { i8, i8, %struct.cli_ac_patt*, %struct.cli_ac_node**, %struct.cli_ac_node* }
- %struct.cli_ac_patt = type { i16*, i16*, i16, i16, i8, i32, i32, i8*, i8*, i32, i16, i16, i16, i16, %struct.cli_ac_alt**, i8, i16, %struct.cli_ac_patt*, %struct.cli_ac_patt* }
- %struct.cli_bm_patt = type { i8*, i32, i8*, i8*, i8, %struct.cli_bm_patt* }
- %struct.cli_ctx = type { i8**, i64*, %struct.cli_matcher*, %struct.cl_engine*, %struct.cl_limits*, i32, i32, i32, i32, %struct.cli_dconf* }
- %struct.cli_dconf = type { i32, i32, i32, i32, i32, i32, i32 }
- %struct.cli_matcher = type { i16, i8, i32*, %struct.cli_bm_patt**, i32*, i32, i8, i8, %struct.cli_ac_node*, %struct.cli_ac_node**, %struct.cli_ac_patt**, i32, i32, i32 }
-
-declare i8* @calloc(i64, i64)
-
-define fastcc i32 @cli_scanpe(i32 %desc, %struct.cli_ctx* %ctx) {
-entry:
- br i1 false, label %cond_next17, label %cond_true14
-
-cond_true14: ; preds = %entry
- ret i32 0
-
-cond_next17: ; preds = %entry
- br i1 false, label %LeafBlock, label %LeafBlock1250
-
-LeafBlock1250: ; preds = %cond_next17
- ret i32 0
-
-LeafBlock: ; preds = %cond_next17
- br i1 false, label %cond_next33, label %cond_true30
-
-cond_true30: ; preds = %LeafBlock
- ret i32 0
-
-cond_next33: ; preds = %LeafBlock
- br i1 false, label %cond_next90, label %cond_true42
-
-cond_true42: ; preds = %cond_next33
- ret i32 0
-
-cond_next90: ; preds = %cond_next33
- br i1 false, label %cond_next100, label %cond_true97
-
-cond_true97: ; preds = %cond_next90
- ret i32 0
-
-cond_next100: ; preds = %cond_next90
- br i1 false, label %cond_next109, label %cond_true106
-
-cond_true106: ; preds = %cond_next100
- ret i32 0
-
-cond_next109: ; preds = %cond_next100
- br i1 false, label %cond_false, label %cond_true118
-
-cond_true118: ; preds = %cond_next109
- ret i32 0
-
-cond_false: ; preds = %cond_next109
- br i1 false, label %NodeBlock1482, label %cond_true126
-
-cond_true126: ; preds = %cond_false
- ret i32 0
-
-NodeBlock1482: ; preds = %cond_false
- br i1 false, label %cond_next285, label %NodeBlock1480
-
-NodeBlock1480: ; preds = %NodeBlock1482
- ret i32 0
-
-cond_next285: ; preds = %NodeBlock1482
- br i1 false, label %cond_next320, label %cond_true294
-
-cond_true294: ; preds = %cond_next285
- ret i32 0
-
-cond_next320: ; preds = %cond_next285
- br i1 false, label %LeafBlock1491, label %LeafBlock1493
-
-LeafBlock1493: ; preds = %cond_next320
- ret i32 0
-
-LeafBlock1491: ; preds = %cond_next320
- br i1 false, label %cond_true400, label %cond_true378
-
-cond_true378: ; preds = %LeafBlock1491
- ret i32 1
-
-cond_true400: ; preds = %LeafBlock1491
- br i1 false, label %cond_next413, label %cond_true406
-
-cond_true406: ; preds = %cond_true400
- ret i32 0
-
-cond_next413: ; preds = %cond_true400
- br i1 false, label %cond_next429, label %cond_true424
-
-cond_true424: ; preds = %cond_next413
- ret i32 0
-
-cond_next429: ; preds = %cond_next413
- br i1 false, label %NodeBlock1557, label %NodeBlock1579
-
-NodeBlock1579: ; preds = %cond_next429
- ret i32 0
-
-NodeBlock1557: ; preds = %cond_next429
- br i1 false, label %LeafBlock1543, label %NodeBlock1555
-
-NodeBlock1555: ; preds = %NodeBlock1557
- ret i32 0
-
-LeafBlock1543: ; preds = %NodeBlock1557
- br i1 false, label %cond_next870, label %cond_next663
-
-cond_next663: ; preds = %LeafBlock1543
- ret i32 0
-
-cond_next870: ; preds = %LeafBlock1543
- br i1 false, label %cond_true1012, label %cond_true916
-
-cond_true916: ; preds = %cond_next870
- ret i32 0
-
-cond_true1012: ; preds = %cond_next870
- br i1 false, label %cond_next3849, label %cond_true2105
-
-cond_true2105: ; preds = %cond_true1012
- ret i32 0
-
-cond_next3849: ; preds = %cond_true1012
- br i1 false, label %cond_next4378, label %bb6559
-
-bb3862: ; preds = %cond_next4385
- br i1 false, label %cond_false3904, label %cond_true3876
-
-cond_true3876: ; preds = %bb3862
- ret i32 0
-
-cond_false3904: ; preds = %bb3862
- br i1 false, label %cond_next4003, label %cond_true3935
-
-cond_true3935: ; preds = %cond_false3904
- ret i32 0
-
-cond_next4003: ; preds = %cond_false3904
- br i1 false, label %cond_next5160, label %cond_next4015
-
-cond_next4015: ; preds = %cond_next4003
- ret i32 0
-
-cond_next4378: ; preds = %cond_next3849
- br i1 false, label %cond_next4385, label %bb4393
-
-cond_next4385: ; preds = %cond_next4378
- br i1 false, label %bb3862, label %bb4393
-
-bb4393: ; preds = %cond_next4385, %cond_next4378
- ret i32 0
-
-cond_next5160: ; preds = %cond_next4003
- br i1 false, label %bb5188, label %bb6559
-
-bb5188: ; preds = %cond_next5160
- br i1 false, label %cond_next5285, label %cond_true5210
-
-cond_true5210: ; preds = %bb5188
- ret i32 0
-
-cond_next5285: ; preds = %bb5188
- br i1 false, label %cond_true5302, label %cond_true5330
-
-cond_true5302: ; preds = %cond_next5285
- br i1 false, label %bb7405, label %bb7367
-
-cond_true5330: ; preds = %cond_next5285
- ret i32 0
-
-bb6559: ; preds = %cond_next5160, %cond_next3849
- ret i32 0
-
-bb7367: ; preds = %cond_true5302
- ret i32 0
-
-bb7405: ; preds = %cond_true5302
- br i1 false, label %cond_next8154, label %cond_true7410
-
-cond_true7410: ; preds = %bb7405
- ret i32 0
-
-cond_next8154: ; preds = %bb7405
- br i1 false, label %cond_true8235, label %bb9065
-
-cond_true8235: ; preds = %cond_next8154
- br i1 false, label %bb8274, label %bb8245
-
-bb8245: ; preds = %cond_true8235
- ret i32 0
-
-bb8274: ; preds = %cond_true8235
- br i1 false, label %cond_next8358, label %cond_true8295
-
-cond_true8295: ; preds = %bb8274
- ret i32 0
-
-cond_next8358: ; preds = %bb8274
- br i1 false, label %cond_next.i509, label %cond_true8371
-
-cond_true8371: ; preds = %cond_next8358
- ret i32 -123
-
-cond_next.i509: ; preds = %cond_next8358
- br i1 false, label %bb36.i, label %bb33.i
-
-bb33.i: ; preds = %cond_next.i509
- ret i32 0
-
-bb36.i: ; preds = %cond_next.i509
- br i1 false, label %cond_next54.i, label %cond_true51.i
-
-cond_true51.i: ; preds = %bb36.i
- ret i32 0
-
-cond_next54.i: ; preds = %bb36.i
- %tmp10.i.i527 = call i8* @calloc( i64 0, i64 1 ) ; <i8*> [#uses=1]
- br i1 false, label %cond_next11.i.i, label %bb132.i
-
-bb132.i: ; preds = %cond_next54.i
- ret i32 0
-
-cond_next11.i.i: ; preds = %cond_next54.i
- br i1 false, label %bb32.i.i545, label %cond_true1008.critedge.i
-
-bb32.i.i545: ; preds = %cond_next11.i.i
- br i1 false, label %cond_next349.i, label %cond_true184.i
-
-cond_true184.i: ; preds = %bb32.i.i545
- ret i32 0
-
-cond_next349.i: ; preds = %bb32.i.i545
- br i1 false, label %cond_next535.i, label %cond_true1008.critedge1171.i
-
-cond_next535.i: ; preds = %cond_next349.i
- br i1 false, label %cond_next569.i, label %cond_false574.i
-
-cond_next569.i: ; preds = %cond_next535.i
- br i1 false, label %cond_next670.i, label %cond_true1008.critedge1185.i
-
-cond_false574.i: ; preds = %cond_next535.i
- ret i32 0
-
-cond_next670.i: ; preds = %cond_next569.i
- br i1 false, label %cond_true692.i, label %cond_next862.i
-
-cond_true692.i: ; preds = %cond_next670.i
- br i1 false, label %cond_false742.i, label %cond_true718.i
-
-cond_true718.i: ; preds = %cond_true692.i
- ret i32 0
-
-cond_false742.i: ; preds = %cond_true692.i
- br i1 false, label %cond_true784.i, label %cond_next9079
-
-cond_true784.i: ; preds = %cond_next811.i, %cond_false742.i
- %indvar1411.i.reg2mem.0 = phi i8 [ %indvar.next1412.i, %cond_next811.i ], [ 0, %cond_false742.i ] ; <i8> [#uses=1]
- br i1 false, label %cond_true1008.critedge1190.i, label %cond_next811.i
-
-cond_next811.i: ; preds = %cond_true784.i
- %indvar.next1412.i = add i8 %indvar1411.i.reg2mem.0, 1 ; <i8> [#uses=2]
- %tmp781.i = icmp eq i8 %indvar.next1412.i, 3 ; <i1> [#uses=1]
- br i1 %tmp781.i, label %cond_next9079, label %cond_true784.i
-
-cond_next862.i: ; preds = %cond_next670.i
- ret i32 0
-
-cond_true1008.critedge.i: ; preds = %cond_next11.i.i
- ret i32 0
-
-cond_true1008.critedge1171.i: ; preds = %cond_next349.i
- ret i32 0
-
-cond_true1008.critedge1185.i: ; preds = %cond_next569.i
- ret i32 0
-
-cond_true1008.critedge1190.i: ; preds = %cond_true784.i
- %tmp621.i532.lcssa610 = phi i8* [ %tmp10.i.i527, %cond_true784.i ] ; <i8*> [#uses=0]
- ret i32 0
-
-bb9065: ; preds = %cond_next8154
- ret i32 0
-
-cond_next9079: ; preds = %cond_next811.i, %cond_false742.i
- ret i32 0
-}
diff --git a/release_23/test/Transforms/LoopUnroll/dg.exp b/release_23/test/Transforms/LoopUnroll/dg.exp
deleted file mode 100644
index 879685ca879d..000000000000
--- a/release_23/test/Transforms/LoopUnroll/dg.exp
+++ /dev/null
@@ -1,3 +0,0 @@
-load_lib llvm.exp
-
-RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
diff --git a/release_23/test/Transforms/LoopUnswitch/2006-02-14-LoopSimplifyCrash.ll b/release_23/test/Transforms/LoopUnswitch/2006-02-14-LoopSimplifyCrash.ll
deleted file mode 100644
index b80220af5003..000000000000
--- a/release_23/test/Transforms/LoopUnswitch/2006-02-14-LoopSimplifyCrash.ll
+++ /dev/null
@@ -1,1697 +0,0 @@
-; RUN: llvm-as < %s | opt -loop-unswitch -disable-output
-; END.
-
-target datalayout = "E-p:32:32"
-target triple = "powerpc-apple-darwin8.2.0"
-deplibs = [ "c", "crtend" ]
- %struct.__sFILE = type { i8*, i32, i32, i16, i16, %struct.__sbuf, i32, i8*, i32 (i8*)*, i32 (i8*, i8*, i32)*, i64 (i8*, i64, i32)*, i32 (i8*, i8*, i32)*, %struct.__sbuf, %struct.__sFILEX*, i32, [3 x i8], [1 x i8], %struct.__sbuf, i32, i64 }
- %struct.__sFILEX = type opaque
- %struct.__sbuf = type { i8*, i32 }
- %struct.fd_set = type { [32 x i32] }
- %struct.timeval = type { i32, i32 }
- %struct.tm = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i8* }
- %typedef.CHESS_PATH = type { [65 x i32], i8, i8, i8 }
- %typedef.CHESS_POSITION = type { i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i32, i32, i8, i8, [64 x i8], i8, i8, i8, i8, i8 }
- %typedef.HASH_ENTRY = type { i64, i64 }
- %typedef.NEXT_MOVE = type { i32, i32, i32* }
- %typedef.PAWN_HASH_ENTRY = type { i32, i16, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }
- %typedef.SEARCH_POSITION = type { i8, i8, i8, i8 }
- %union.doub0. = type { i64 }
-@search = external global %typedef.CHESS_POSITION ; <%typedef.CHESS_POSITION*> [#uses=1]
-@w_pawn_attacks = external global [64 x i64] ; <[64 x i64]*> [#uses=0]
-@b_pawn_attacks = external global [64 x i64] ; <[64 x i64]*> [#uses=0]
-@knight_attacks = external global [64 x i64] ; <[64 x i64]*> [#uses=0]
-@bishop_attacks_rl45 = external global [64 x [256 x i64]] ; <[64 x [256 x i64]]*> [#uses=0]
-@bishop_shift_rl45 = external global [64 x i32] ; <[64 x i32]*> [#uses=0]
-@bishop_attacks_rr45 = external global [64 x [256 x i64]] ; <[64 x [256 x i64]]*> [#uses=0]
-@bishop_shift_rr45 = external global [64 x i32] ; <[64 x i32]*> [#uses=0]
-@rook_attacks_r0 = external global [64 x [256 x i64]] ; <[64 x [256 x i64]]*> [#uses=0]
-@rook_attacks_rl90 = external global [64 x [256 x i64]] ; <[64 x [256 x i64]]*> [#uses=0]
-@king_attacks = external global [64 x i64] ; <[64 x i64]*> [#uses=0]
-@set_mask = external global [65 x i64] ; <[65 x i64]*> [#uses=0]
-@first_ones = external global [65536 x i8] ; <[65536 x i8]*> [#uses=0]
-@last_ones = external global [65536 x i8] ; <[65536 x i8]*> [#uses=0]
-@draw_score_is_zero = external global i32 ; <i32*> [#uses=0]
-@default_draw_score = external global i32 ; <i32*> [#uses=0]
-@opening = external global i32 ; <i32*> [#uses=0]
-@middle_game = external global i32 ; <i32*> [#uses=0]
-@tc_increment = external global i32 ; <i32*> [#uses=0]
-@tc_time_remaining_opponent = external global i32 ; <i32*> [#uses=0]
-@.ctor_1 = external global [17 x i8] ; <[17 x i8]*> [#uses=0]
-@input_stream = external global %struct.__sFILE* ; <%struct.__sFILE**> [#uses=0]
-@__sF = external global [0 x %struct.__sFILE] ; <[0 x %struct.__sFILE]*> [#uses=1]
-@xboard = external global i32 ; <i32*> [#uses=0]
-@.str_1 = external global [14 x i8] ; <[14 x i8]*> [#uses=0]
-@.str_2 = external global [14 x i8] ; <[14 x i8]*> [#uses=0]
-@buffer = external global [512 x i8] ; <[512 x i8]*> [#uses=0]
-@nargs = external global i32 ; <i32*> [#uses=0]
-@args = external global [32 x i8*] ; <[32 x i8*]*> [#uses=0]
-@.str_3 = external global [4 x i8] ; <[4 x i8]*> [#uses=0]
-@.str_4 = external global [17 x i8] ; <[17 x i8]*> [#uses=0]
-@.str_5 = external global [6 x i8] ; <[6 x i8]*> [#uses=0]
-@.str_6 = external global [6 x i8] ; <[6 x i8]*> [#uses=0]
-@.str_7 = external global [2 x i8] ; <[2 x i8]*> [#uses=0]
-@.str_8 = external global [2 x i8] ; <[2 x i8]*> [#uses=0]
-@.str_9 = external global [4 x i8] ; <[4 x i8]*> [#uses=0]
-@.str_10 = external global [2 x i8] ; <[2 x i8]*> [#uses=0]
-@.str_11 = external global [2 x i8] ; <[2 x i8]*> [#uses=0]
-@.str_12 = external global [24 x i8] ; <[24 x i8]*> [#uses=0]
-@.str_14 = external global [23 x i8] ; <[23 x i8]*> [#uses=0]
-@position = external global [67 x %typedef.SEARCH_POSITION] ; <[67 x %typedef.SEARCH_POSITION]*> [#uses=0]
-@log_file = external global %struct.__sFILE* ; <%struct.__sFILE**> [#uses=0]
-@move_number = external global i32 ; <i32*> [#uses=0]
-@rephead_b = external global i64* ; <i64**> [#uses=0]
-@replist_b = external global [82 x i64] ; <[82 x i64]*> [#uses=0]
-@rephead_w = external global i64* ; <i64**> [#uses=0]
-@replist_w = external global [82 x i64] ; <[82 x i64]*> [#uses=0]
-@moves_out_of_book = external global i32 ; <i32*> [#uses=0]
-@largest_positional_score = external global i32 ; <i32*> [#uses=0]
-@end_game = external global i32 ; <i32*> [#uses=0]
-@p_values = external global [15 x i32] ; <[15 x i32]*> [#uses=0]
-@clear_mask = external global [65 x i64] ; <[65 x i64]*> [#uses=0]
-@directions = external global [64 x [64 x i8]] ; <[64 x [64 x i8]]*> [#uses=0]
-@root_wtm = external global i32 ; <i32*> [#uses=0]
-@all_pawns = external global i64 ; <i64*> [#uses=0]
-@pawn_score = external global %typedef.PAWN_HASH_ENTRY ; <%typedef.PAWN_HASH_ENTRY*> [#uses=0]
-@pawn_probes = external global i32 ; <i32*> [#uses=0]
-@pawn_hits = external global i32 ; <i32*> [#uses=0]
-@outside_passed = external global [128 x i32] ; <[128 x i32]*> [#uses=0]
-@root_total_black_pieces = external global i32 ; <i32*> [#uses=0]
-@root_total_white_pawns = external global i32 ; <i32*> [#uses=0]
-@root_total_white_pieces = external global i32 ; <i32*> [#uses=0]
-@root_total_black_pawns = external global i32 ; <i32*> [#uses=0]
-@mask_A7H7 = external global i64 ; <i64*> [#uses=0]
-@mask_B6B7 = external global i64 ; <i64*> [#uses=0]
-@mask_G6G7 = external global i64 ; <i64*> [#uses=0]
-@mask_A2H2 = external global i64 ; <i64*> [#uses=0]
-@mask_B2B3 = external global i64 ; <i64*> [#uses=0]
-@mask_G2G3 = external global i64 ; <i64*> [#uses=0]
-@king_defects_w = external global [64 x i8] ; <[64 x i8]*> [#uses=0]
-@good_bishop_kw = external global i64 ; <i64*> [#uses=0]
-@mask_F3H3 = external global i64 ; <i64*> [#uses=0]
-@file_mask = external global [8 x i64] ; <[8 x i64]*> [#uses=0]
-@good_bishop_qw = external global i64 ; <i64*> [#uses=0]
-@mask_A3C3 = external global i64 ; <i64*> [#uses=0]
-@king_defects_b = external global [64 x i8] ; <[64 x i8]*> [#uses=0]
-@good_bishop_kb = external global i64 ; <i64*> [#uses=0]
-@mask_F6H6 = external global i64 ; <i64*> [#uses=0]
-@good_bishop_qb = external global i64 ; <i64*> [#uses=0]
-@mask_A6C6 = external global i64 ; <i64*> [#uses=0]
-@square_color = external global [64 x i8] ; <[64 x i8]*> [#uses=0]
-@evaluations = external global i32 ; <i32*> [#uses=0]
-@king_value_w = external global [64 x i32] ; <[64 x i32]*> [#uses=0]
-@rank_mask = external global [8 x i64] ; <[8 x i64]*> [#uses=0]
-@mask_kr_trapped_w = external global [3 x i64] ; <[3 x i64]*> [#uses=0]
-@mask_qr_trapped_w = external global [3 x i64] ; <[3 x i64]*> [#uses=0]
-@king_value_b = external global [64 x i32] ; <[64 x i32]*> [#uses=0]
-@mask_kr_trapped_b = external global [3 x i64] ; <[3 x i64]*> [#uses=0]
-@mask_qr_trapped_b = external global [3 x i64] ; <[3 x i64]*> [#uses=0]
-@white_outpost = external global [64 x i8] ; <[64 x i8]*> [#uses=0]
-@mask_no_pawn_attacks_b = external global [64 x i64] ; <[64 x i64]*> [#uses=0]
-@knight_value_w = external global [64 x i32] ; <[64 x i32]*> [#uses=0]
-@black_outpost = external global [64 x i8] ; <[64 x i8]*> [#uses=0]
-@mask_no_pawn_attacks_w = external global [64 x i64] ; <[64 x i64]*> [#uses=0]
-@knight_value_b = external global [64 x i32] ; <[64 x i32]*> [#uses=0]
-@bishop_value_w = external global [64 x i32] ; <[64 x i32]*> [#uses=0]
-@bishop_mobility_rl45 = external global [64 x [256 x i32]] ; <[64 x [256 x i32]]*> [#uses=0]
-@bishop_mobility_rr45 = external global [64 x [256 x i32]] ; <[64 x [256 x i32]]*> [#uses=0]
-@bishop_value_b = external global [64 x i32] ; <[64 x i32]*> [#uses=0]
-@rook_value_w = external global [64 x i32] ; <[64 x i32]*> [#uses=0]
-@plus8dir = external global [65 x i64] ; <[65 x i64]*> [#uses=0]
-@mask_abs7_w = external global i64 ; <i64*> [#uses=0]
-@rook_value_b = external global [64 x i32] ; <[64 x i32]*> [#uses=0]
-@minus8dir = external global [65 x i64] ; <[65 x i64]*> [#uses=0]
-@mask_abs7_b = external global i64 ; <i64*> [#uses=0]
-@queen_value_w = external global [64 x i32] ; <[64 x i32]*> [#uses=0]
-@queen_value_b = external global [64 x i32] ; <[64 x i32]*> [#uses=0]
-@white_minor_pieces = external global i64 ; <i64*> [#uses=0]
-@black_minor_pieces = external global i64 ; <i64*> [#uses=0]
-@not_rook_pawns = external global i64 ; <i64*> [#uses=0]
-@dark_squares = external global i64 ; <i64*> [#uses=0]
-@b_n_mate_dark_squares = external global [64 x i32] ; <[64 x i32]*> [#uses=0]
-@b_n_mate_light_squares = external global [64 x i32] ; <[64 x i32]*> [#uses=0]
-@mate = external global [64 x i32] ; <[64 x i32]*> [#uses=0]
-@first_ones_8bit = external global [256 x i8] ; <[256 x i8]*> [#uses=0]
-@reduced_material_passer = external global [20 x i32] ; <[20 x i32]*> [#uses=0]
-@supported_passer = external global [8 x i32] ; <[8 x i32]*> [#uses=0]
-@passed_pawn_value = external global [8 x i32] ; <[8 x i32]*> [#uses=0]
-@connected_passed = external global [256 x i8] ; <[256 x i8]*> [#uses=0]
-@black_pawn_race_btm = external global [64 x i64] ; <[64 x i64]*> [#uses=0]
-@white_pawn_race_wtm = external global [64 x i64] ; <[64 x i64]*> [#uses=0]
-@black_pawn_race_wtm = external global [64 x i64] ; <[64 x i64]*> [#uses=0]
-@white_pawn_race_btm = external global [64 x i64] ; <[64 x i64]*> [#uses=0]
-@obstructed = external global [64 x [64 x i64]] ; <[64 x [64 x i64]]*> [#uses=0]
-@pawn_hash_table = external global %typedef.PAWN_HASH_ENTRY* ; <%typedef.PAWN_HASH_ENTRY**> [#uses=0]
-@pawn_hash_mask = external global i32 ; <i32*> [#uses=0]
-@pawn_value_w = external global [64 x i32] ; <[64 x i32]*> [#uses=0]
-@mask_pawn_isolated = external global [64 x i64] ; <[64 x i64]*> [#uses=0]
-@mask_pawn_passed_w = external global [64 x i64] ; <[64 x i64]*> [#uses=0]
-@mask_pawn_protected_w = external global [64 x i64] ; <[64 x i64]*> [#uses=0]
-@pawn_value_b = external global [64 x i32] ; <[64 x i32]*> [#uses=0]
-@mask_pawn_passed_b = external global [64 x i64] ; <[64 x i64]*> [#uses=0]
-@mask_pawn_protected_b = external global [64 x i64] ; <[64 x i64]*> [#uses=0]
-@unblocked_pawns = external global [9 x i32] ; <[9 x i32]*> [#uses=0]
-@mask_wk_4th = external global i64 ; <i64*> [#uses=0]
-@mask_wk_5th = external global i64 ; <i64*> [#uses=0]
-@mask_wq_4th = external global i64 ; <i64*> [#uses=0]
-@mask_wq_5th = external global i64 ; <i64*> [#uses=0]
-@stonewall_white = external global i64 ; <i64*> [#uses=0]
-@mask_bk_4th = external global i64 ; <i64*> [#uses=0]
-@mask_bk_5th = external global i64 ; <i64*> [#uses=0]
-@mask_bq_5th = external global i64 ; <i64*> [#uses=0]
-@mask_bq_4th = external global i64 ; <i64*> [#uses=0]
-@stonewall_black = external global i64 ; <i64*> [#uses=0]
-@last_ones_8bit = external global [256 x i8] ; <[256 x i8]*> [#uses=0]
-@right_side_mask = external global [8 x i64] ; <[8 x i64]*> [#uses=0]
-@left_side_empty_mask = external global [8 x i64] ; <[8 x i64]*> [#uses=0]
-@left_side_mask = external global [8 x i64] ; <[8 x i64]*> [#uses=0]
-@right_side_empty_mask = external global [8 x i64] ; <[8 x i64]*> [#uses=0]
-@pv = external global [65 x %typedef.CHESS_PATH] ; <[65 x %typedef.CHESS_PATH]*> [#uses=0]
-@history_w = external global [4096 x i32] ; <[4096 x i32]*> [#uses=0]
-@history_b = external global [4096 x i32] ; <[4096 x i32]*> [#uses=0]
-@killer_move1 = external global [65 x i32] ; <[65 x i32]*> [#uses=0]
-@killer_count1 = external global [65 x i32] ; <[65 x i32]*> [#uses=0]
-@killer_move2 = external global [65 x i32] ; <[65 x i32]*> [#uses=0]
-@killer_count2 = external global [65 x i32] ; <[65 x i32]*> [#uses=0]
-@current_move = external global [65 x i32] ; <[65 x i32]*> [#uses=0]
-@init_r90 = external global [64 x i32] ; <[64 x i32]*> [#uses=0]
-@init_l90 = external global [64 x i32] ; <[64 x i32]*> [#uses=0]
-@init_l45 = external global [64 x i32] ; <[64 x i32]*> [#uses=0]
-@init_ul45 = external global [64 x i32] ; <[64 x i32]*> [#uses=0]
-@init_r45 = external global [64 x i32] ; <[64 x i32]*> [#uses=0]
-@init_ur45 = external global [64 x i32] ; <[64 x i32]*> [#uses=0]
-@diagonal_length = external global [64 x i32] ; <[64 x i32]*> [#uses=0]
-@last = external global [65 x i32*] ; <[65 x i32*]*> [#uses=0]
-@move_list = external global [5120 x i32] ; <[5120 x i32]*> [#uses=0]
-@history_file = external global %struct.__sFILE* ; <%struct.__sFILE**> [#uses=0]
-@.str_1.upgrd.1 = external global [9 x i8] ; <[9 x i8]*> [#uses=0]
-@.str_2.upgrd.2 = external global [3 x i8] ; <[3 x i8]*> [#uses=0]
-@.str_3.upgrd.3 = external global [32 x i8] ; <[32 x i8]*> [#uses=0]
-@.str_5.upgrd.4 = external global [3 x i8] ; <[3 x i8]*> [#uses=0]
-@.str_6.upgrd.5 = external global [14 x i8] ; <[14 x i8]*> [#uses=0]
-@trans_ref_wa = external global %typedef.HASH_ENTRY* ; <%typedef.HASH_ENTRY**> [#uses=0]
-@hash_table_size = external global i32 ; <i32*> [#uses=0]
-@trans_ref_wb = external global %typedef.HASH_ENTRY* ; <%typedef.HASH_ENTRY**> [#uses=0]
-@trans_ref_ba = external global %typedef.HASH_ENTRY* ; <%typedef.HASH_ENTRY**> [#uses=0]
-@trans_ref_bb = external global %typedef.HASH_ENTRY* ; <%typedef.HASH_ENTRY**> [#uses=0]
-@pawn_hash_table_size = external global i32 ; <i32*> [#uses=0]
-@.str_9.upgrd.6 = external global [37 x i8] ; <[37 x i8]*> [#uses=0]
-@log_hash = external global i32 ; <i32*> [#uses=0]
-@log_pawn_hash = external global i32 ; <i32*> [#uses=0]
-@hash_maska = external global i32 ; <i32*> [#uses=0]
-@hash_maskb = external global i32 ; <i32*> [#uses=0]
-@mask_1 = external global i64 ; <i64*> [#uses=0]
-@bishop_attacks = external global [64 x i64] ; <[64 x i64]*> [#uses=0]
-@queen_attacks = external global [64 x i64] ; <[64 x i64]*> [#uses=0]
-@plus7dir = external global [65 x i64] ; <[65 x i64]*> [#uses=0]
-@plus9dir = external global [65 x i64] ; <[65 x i64]*> [#uses=0]
-@minus7dir = external global [65 x i64] ; <[65 x i64]*> [#uses=0]
-@minus9dir = external global [65 x i64] ; <[65 x i64]*> [#uses=0]
-@plus1dir = external global [65 x i64] ; <[65 x i64]*> [#uses=0]
-@minus1dir = external global [65 x i64] ; <[65 x i64]*> [#uses=0]
-@rook_attacks = external global [64 x i64] ; <[64 x i64]*> [#uses=0]
-@king_attacks_1 = external global [64 x i64] ; <[64 x i64]*> [#uses=0]
-@king_attacks_2 = external global [64 x i64] ; <[64 x i64]*> [#uses=0]
-@.ctor_1.upgrd.7 = external global [64 x i32] ; <[64 x i32]*> [#uses=0]
-@.ctor_2 = external global [64 x i32] ; <[64 x i32]*> [#uses=0]
-@rook_mobility_r0 = external global [64 x [256 x i32]] ; <[64 x [256 x i32]]*> [#uses=0]
-@rook_mobility_rl90 = external global [64 x [256 x i32]] ; <[64 x [256 x i32]]*> [#uses=0]
-@initial_position = external global [80 x i8] ; <[80 x i8]*> [#uses=5]
-@"\01a1.0__" = external global [80 x i8] ; <[80 x i8]*> [#uses=0]
-@"\01a2.1__" = external global [16 x i8] ; <[16 x i8]*> [#uses=0]
-@"\01a3.2__" = external global [16 x i8] ; <[16 x i8]*> [#uses=0]
-@"\01a4.3__" = external global [16 x i8] ; <[16 x i8]*> [#uses=0]
-@"\01a5.4__" = external global [16 x i8] ; <[16 x i8]*> [#uses=0]
-@"\01args.5__" = external global [16 x i8*] ; <[16 x i8*]*> [#uses=0]
-@.str_10.upgrd.8 = external global [3 x i8] ; <[3 x i8]*> [#uses=0]
-@w_pawn_random = external global [64 x i64] ; <[64 x i64]*> [#uses=0]
-@w_pawn_random32 = external global [64 x i32] ; <[64 x i32]*> [#uses=0]
-@b_pawn_random = external global [64 x i64] ; <[64 x i64]*> [#uses=0]
-@b_pawn_random32 = external global [64 x i32] ; <[64 x i32]*> [#uses=0]
-@w_knight_random = external global [64 x i64] ; <[64 x i64]*> [#uses=0]
-@b_knight_random = external global [64 x i64] ; <[64 x i64]*> [#uses=0]
-@w_bishop_random = external global [64 x i64] ; <[64 x i64]*> [#uses=0]
-@b_bishop_random = external global [64 x i64] ; <[64 x i64]*> [#uses=0]
-@w_rook_random = external global [64 x i64] ; <[64 x i64]*> [#uses=0]
-@b_rook_random = external global [64 x i64] ; <[64 x i64]*> [#uses=0]
-@w_queen_random = external global [64 x i64] ; <[64 x i64]*> [#uses=0]
-@b_queen_random = external global [64 x i64] ; <[64 x i64]*> [#uses=0]
-@w_king_random = external global [64 x i64] ; <[64 x i64]*> [#uses=0]
-@b_king_random = external global [64 x i64] ; <[64 x i64]*> [#uses=0]
-@enpassant_random = external global [65 x i64] ; <[65 x i64]*> [#uses=0]
-@castle_random_w = external global [2 x i64] ; <[2 x i64]*> [#uses=0]
-@castle_random_b = external global [2 x i64] ; <[2 x i64]*> [#uses=0]
-@set_mask_rl90 = external global [65 x i64] ; <[65 x i64]*> [#uses=0]
-@set_mask_rl45 = external global [65 x i64] ; <[65 x i64]*> [#uses=0]
-@set_mask_rr45 = external global [65 x i64] ; <[65 x i64]*> [#uses=0]
-@transposition_id = external global i8 ; <i8*> [#uses=0]
-@mask_2 = external global i64 ; <i64*> [#uses=0]
-@mask_3 = external global i64 ; <i64*> [#uses=0]
-@mask_4 = external global i64 ; <i64*> [#uses=0]
-@mask_8 = external global i64 ; <i64*> [#uses=0]
-@mask_16 = external global i64 ; <i64*> [#uses=0]
-@mask_32 = external global i64 ; <i64*> [#uses=0]
-@mask_72 = external global i64 ; <i64*> [#uses=0]
-@mask_80 = external global i64 ; <i64*> [#uses=0]
-@mask_85 = external global i64 ; <i64*> [#uses=0]
-@mask_96 = external global i64 ; <i64*> [#uses=0]
-@mask_107 = external global i64 ; <i64*> [#uses=0]
-@mask_108 = external global i64 ; <i64*> [#uses=0]
-@mask_112 = external global i64 ; <i64*> [#uses=0]
-@mask_118 = external global i64 ; <i64*> [#uses=0]
-@mask_120 = external global i64 ; <i64*> [#uses=0]
-@mask_121 = external global i64 ; <i64*> [#uses=0]
-@mask_127 = external global i64 ; <i64*> [#uses=0]
-@mask_clear_entry = external global i64 ; <i64*> [#uses=0]
-@clear_mask_rl45 = external global [65 x i64] ; <[65 x i64]*> [#uses=0]
-@clear_mask_rr45 = external global [65 x i64] ; <[65 x i64]*> [#uses=0]
-@clear_mask_rl90 = external global [65 x i64] ; <[65 x i64]*> [#uses=0]
-@right_half_mask = external global i64 ; <i64*> [#uses=0]
-@left_half_mask = external global i64 ; <i64*> [#uses=0]
-@mask_not_rank8 = external global i64 ; <i64*> [#uses=0]
-@mask_not_rank1 = external global i64 ; <i64*> [#uses=0]
-@center = external global i64 ; <i64*> [#uses=0]
-@mask_pawn_connected = external global [64 x i64] ; <[64 x i64]*> [#uses=0]
-@mask_eptest = external global [64 x i64] ; <[64 x i64]*> [#uses=0]
-@mask_kingside_attack_w1 = external global i64 ; <i64*> [#uses=0]
-@mask_kingside_attack_w2 = external global i64 ; <i64*> [#uses=0]
-@mask_queenside_attack_w1 = external global i64 ; <i64*> [#uses=0]
-@mask_queenside_attack_w2 = external global i64 ; <i64*> [#uses=0]
-@mask_kingside_attack_b1 = external global i64 ; <i64*> [#uses=0]
-@mask_kingside_attack_b2 = external global i64 ; <i64*> [#uses=0]
-@mask_queenside_attack_b1 = external global i64 ; <i64*> [#uses=0]
-@mask_queenside_attack_b2 = external global i64 ; <i64*> [#uses=0]
-@pawns_cramp_black = external global i64 ; <i64*> [#uses=0]
-@pawns_cramp_white = external global i64 ; <i64*> [#uses=0]
-@light_squares = external global i64 ; <i64*> [#uses=0]
-@mask_left_edge = external global i64 ; <i64*> [#uses=0]
-@mask_right_edge = external global i64 ; <i64*> [#uses=0]
-@mask_advance_2_w = external global i64 ; <i64*> [#uses=0]
-@mask_advance_2_b = external global i64 ; <i64*> [#uses=0]
-@mask_corner_squares = external global i64 ; <i64*> [#uses=0]
-@mask_promotion_threat_w = external global [64 x i64] ; <[64 x i64]*> [#uses=0]
-@mask_promotion_threat_b = external global [64 x i64] ; <[64 x i64]*> [#uses=0]
-@promote_mask_w = external global i64 ; <i64*> [#uses=0]
-@promote_mask_b = external global i64 ; <i64*> [#uses=0]
-@mask_a1_corner = external global i64 ; <i64*> [#uses=0]
-@mask_h1_corner = external global i64 ; <i64*> [#uses=0]
-@mask_a8_corner = external global i64 ; <i64*> [#uses=0]
-@mask_h8_corner = external global i64 ; <i64*> [#uses=0]
-@white_center_pawns = external global i64 ; <i64*> [#uses=0]
-@black_center_pawns = external global i64 ; <i64*> [#uses=0]
-@wtm_random = external global [2 x i64] ; <[2 x i64]*> [#uses=0]
-@endgame_random_w = external global i64 ; <i64*> [#uses=0]
-@endgame_random_b = external global i64 ; <i64*> [#uses=0]
-@w_rooks_random = external global i64 ; <i64*> [#uses=0]
-@b_rooks_random = external global i64 ; <i64*> [#uses=0]
-@.ctor_11 = external global [17 x i8] ; <[17 x i8]*> [#uses=0]
-@.ctor_2.upgrd.9 = external global [17 x i8] ; <[17 x i8]*> [#uses=0]
-@.str_1.upgrd.10 = external global [4 x i8] ; <[4 x i8]*> [#uses=0]
-@.str_2.upgrd.11 = external global [5 x i8] ; <[5 x i8]*> [#uses=0]
-@.str_32 = external global [4 x i8] ; <[4 x i8]*> [#uses=0]
-@.str_4.upgrd.12 = external global [5 x i8] ; <[5 x i8]*> [#uses=0]
-@.str_5.upgrd.13 = external global [4 x i8] ; <[4 x i8]*> [#uses=0]
-@.str_6.upgrd.14 = external global [5 x i8] ; <[5 x i8]*> [#uses=0]
-@.str_7.upgrd.15 = external global [6 x i8] ; <[6 x i8]*> [#uses=0]
-@.str_8.upgrd.16 = external global [7 x i8] ; <[7 x i8]*> [#uses=0]
-@.str_9.upgrd.17 = external global [6 x i8] ; <[6 x i8]*> [#uses=0]
-@.str_10.upgrd.18 = external global [7 x i8] ; <[7 x i8]*> [#uses=0]
-@.str_11.upgrd.19 = external global [6 x i8] ; <[6 x i8]*> [#uses=0]
-@.str_12.upgrd.20 = external global [7 x i8] ; <[7 x i8]*> [#uses=0]
-@.str_13 = external global [15 x i8] ; <[15 x i8]*> [#uses=0]
-@num_ponder_moves = external global i32 ; <i32*> [#uses=0]
-@ponder_moves = external global [220 x i32] ; <[220 x i32]*> [#uses=0]
-@.str_14.upgrd.21 = external global [15 x i8] ; <[15 x i8]*> [#uses=0]
-@.str_15 = external global [22 x i8] ; <[22 x i8]*> [#uses=0]
-@.str_16 = external global [20 x i8] ; <[20 x i8]*> [#uses=0]
-@auto232 = external global i32 ; <i32*> [#uses=0]
-@puzzling = external global i8 ; <i8*> [#uses=0]
-@abort_search = external global i8 ; <i8*> [#uses=0]
-@.str_24 = external global [5 x i8] ; <[5 x i8]*> [#uses=0]
-@wtm = external global i32 ; <i32*> [#uses=0]
-@.str_3.upgrd.22 = external global [15 x i8] ; <[15 x i8]*> [#uses=0]
-@.str_4.upgrd.23 = external global [15 x i8] ; <[15 x i8]*> [#uses=0]
-@end_time = external global i32 ; <i32*> [#uses=0]
-@time_type = external global i32 ; <i32*> [#uses=0]
-@start_time = external global i32 ; <i32*> [#uses=0]
-@.str_6.upgrd.24 = external global [12 x i8] ; <[12 x i8]*> [#uses=0]
-@.str_7.upgrd.25 = external global [4 x i8] ; <[4 x i8]*> [#uses=0]
-@nodes_searched = external global i32 ; <i32*> [#uses=0]
-@iteration_depth = external global i32 ; <i32*> [#uses=0]
-@searched_this_root_move = external global [256 x i8] ; <[256 x i8]*> [#uses=0]
-@.str_9.upgrd.26 = external global [8 x i8] ; <[8 x i8]*> [#uses=0]
-@.str_10.upgrd.27 = external global [9 x i8] ; <[9 x i8]*> [#uses=0]
-@.str_11.upgrd.28 = external global [10 x i8] ; <[10 x i8]*> [#uses=0]
-@.str_12.upgrd.29 = external global [12 x i8] ; <[12 x i8]*> [#uses=0]
-@.str_14.upgrd.30 = external global [2 x i8] ; <[2 x i8]*> [#uses=0]
-@.str_16.upgrd.31 = external global [2 x i8] ; <[2 x i8]*> [#uses=0]
-@thinking = external global i8 ; <i8*> [#uses=0]
-@time_abort = external global i32 ; <i32*> [#uses=0]
-@.str_17 = external global [24 x i8] ; <[24 x i8]*> [#uses=0]
-@analyze_move_read = external global i32 ; <i32*> [#uses=0]
-@analyze_mode = external global i32 ; <i32*> [#uses=0]
-@pondering = external global i8 ; <i8*> [#uses=0]
-@auto232_delay = external global i32 ; <i32*> [#uses=0]
-@auto_file = external global %struct.__sFILE* ; <%struct.__sFILE**> [#uses=0]
-@.str_19 = external global [2 x i8] ; <[2 x i8]*> [#uses=0]
-@.str_20 = external global [11 x i8] ; <[11 x i8]*> [#uses=0]
-@.str_21 = external global [4 x i8] ; <[4 x i8]*> [#uses=0]
-@ponder_move = external global i32 ; <i32*> [#uses=0]
-@predicted = external global i32 ; <i32*> [#uses=0]
-@made_predicted_move = external global i32 ; <i32*> [#uses=0]
-@opponent_end_time = external global i32 ; <i32*> [#uses=0]
-@program_start_time = external global i32 ; <i32*> [#uses=0]
-@.str_23 = external global [22 x i8] ; <[22 x i8]*> [#uses=0]
-@.str_24.upgrd.32 = external global [3 x i8] ; <[3 x i8]*> [#uses=0]
-@.str_25 = external global [5 x i8] ; <[5 x i8]*> [#uses=0]
-@.str_26 = external global [3 x i8] ; <[3 x i8]*> [#uses=0]
-@.str_28 = external global [31 x i8] ; <[31 x i8]*> [#uses=0]
-@book_move = external global i32 ; <i32*> [#uses=0]
-@elapsed_start = external global i32 ; <i32*> [#uses=0]
-@burp = external global i32 ; <i32*> [#uses=0]
-@cpu_percent = external global i32 ; <i32*> [#uses=0]
-@next_time_check = external global i32 ; <i32*> [#uses=0]
-@nodes_between_time_checks = external global i32 ; <i32*> [#uses=0]
-@transposition_hits = external global i32 ; <i32*> [#uses=0]
-@transposition_probes = external global i32 ; <i32*> [#uses=0]
-@tb_probes = external global i32 ; <i32*> [#uses=0]
-@tb_probes_successful = external global i32 ; <i32*> [#uses=0]
-@check_extensions_done = external global i32 ; <i32*> [#uses=0]
-@recapture_extensions_done = external global i32 ; <i32*> [#uses=0]
-@passed_pawn_extensions_done = external global i32 ; <i32*> [#uses=0]
-@one_reply_extensions_done = external global i32 ; <i32*> [#uses=0]
-@program_end_time = external global i32 ; <i32*> [#uses=0]
-@root_value = external global i32 ; <i32*> [#uses=0]
-@last_search_value = external global i32 ; <i32*> [#uses=0]
-@.str_1.upgrd.33 = external global [48 x i8] ; <[48 x i8]*> [#uses=0]
-@.str_2.upgrd.34 = external global [48 x i8] ; <[48 x i8]*> [#uses=0]
-@booking = external global i8 ; <i8*> [#uses=0]
-@annotate_mode = external global i32 ; <i32*> [#uses=0]
-@.str_4.upgrd.35 = external global [38 x i8] ; <[38 x i8]*> [#uses=0]
-@.str_5.upgrd.36 = external global [5 x i8] ; <[5 x i8]*> [#uses=0]
-@last_pv = external global %typedef.CHESS_PATH ; <%typedef.CHESS_PATH*> [#uses=0]
-@.str_8.upgrd.37 = external global [53 x i8] ; <[53 x i8]*> [#uses=0]
-@root_alpha = external global i32 ; <i32*> [#uses=0]
-@last_value = external global i32 ; <i32*> [#uses=0]
-@root_beta = external global i32 ; <i32*> [#uses=0]
-@root_nodes = external global [256 x i32] ; <[256 x i32]*> [#uses=0]
-@trace_level = external global i32 ; <i32*> [#uses=0]
-@.str_9.upgrd.38 = external global [36 x i8] ; <[36 x i8]*> [#uses=0]
-@.str_10.upgrd.39 = external global [37 x i8] ; <[37 x i8]*> [#uses=0]
-@search_failed_high = external global i32 ; <i32*> [#uses=0]
-@search_failed_low = external global i32 ; <i32*> [#uses=0]
-@nodes_per_second = external global i32 ; <i32*> [#uses=0]
-@time_limit = external global i32 ; <i32*> [#uses=0]
-@easy_move = external global i32 ; <i32*> [#uses=0]
-@noise_level = external global i32 ; <i32*> [#uses=0]
-@.str_12.upgrd.40 = external global [34 x i8] ; <[34 x i8]*> [#uses=0]
-@.str_136 = external global [4 x i8] ; <[4 x i8]*> [#uses=0]
-@solution_type = external global i32 ; <i32*> [#uses=0]
-@number_of_solutions = external global i32 ; <i32*> [#uses=0]
-@solutions = external global [10 x i32] ; <[10 x i32]*> [#uses=0]
-@early_exit = external global i32 ; <i32*> [#uses=0]
-@.str_14.upgrd.41 = external global [4 x i8] ; <[4 x i8]*> [#uses=0]
-@.str_15.upgrd.42 = external global [6 x i8] ; <[6 x i8]*> [#uses=0]
-@.str_16.upgrd.43 = external global [8 x i8] ; <[8 x i8]*> [#uses=0]
-@whisper_value = external global i32 ; <i32*> [#uses=0]
-@.str_17.upgrd.44 = external global [29 x i8] ; <[29 x i8]*> [#uses=0]
-@.str_19.upgrd.45 = external global [37 x i8] ; <[37 x i8]*> [#uses=0]
-@last_mate_score = external global i32 ; <i32*> [#uses=0]
-@search_depth = external global i32 ; <i32*> [#uses=0]
-@elapsed_end = external global i32 ; <i32*> [#uses=0]
-@.str_20.upgrd.46 = external global [40 x i8] ; <[40 x i8]*> [#uses=0]
-@.str_21.upgrd.47 = external global [7 x i8] ; <[7 x i8]*> [#uses=0]
-@.str_22 = external global [13 x i8] ; <[13 x i8]*> [#uses=0]
-@.str_23.upgrd.48 = external global [58 x i8] ; <[58 x i8]*> [#uses=0]
-@.str_24.upgrd.49 = external global [48 x i8] ; <[48 x i8]*> [#uses=0]
-@.str_25.upgrd.50 = external global [67 x i8] ; <[67 x i8]*> [#uses=0]
-@.str_26.upgrd.51 = external global [69 x i8] ; <[69 x i8]*> [#uses=0]
-@hash_move = external global [65 x i32] ; <[65 x i32]*> [#uses=0]
-@version = external global [6 x i8] ; <[6 x i8]*> [#uses=0]
-@mode = external global i32 ; <i32*> [#uses=0]
-@batch_mode = external global i32 ; <i32*> [#uses=0]
-@crafty_rating = external global i32 ; <i32*> [#uses=0]
-@opponent_rating = external global i32 ; <i32*> [#uses=0]
-@pgn_event = external global [32 x i8] ; <[32 x i8]*> [#uses=0]
-@pgn_site = external global [32 x i8] ; <[32 x i8]*> [#uses=0]
-@pgn_date = external global [32 x i8] ; <[32 x i8]*> [#uses=0]
-@pgn_round = external global [32 x i8] ; <[32 x i8]*> [#uses=0]
-@pgn_white = external global [64 x i8] ; <[64 x i8]*> [#uses=0]
-@pgn_white_elo = external global [32 x i8] ; <[32 x i8]*> [#uses=0]
-@pgn_black = external global [64 x i8] ; <[64 x i8]*> [#uses=0]
-@pgn_black_elo = external global [32 x i8] ; <[32 x i8]*> [#uses=0]
-@pgn_result = external global [32 x i8] ; <[32 x i8]*> [#uses=0]
-@number_auto_kibitzers = external global i32 ; <i32*> [#uses=0]
-@auto_kibitz_list = external global [100 x [20 x i8]] ; <[100 x [20 x i8]]*> [#uses=0]
-@number_of_computers = external global i32 ; <i32*> [#uses=0]
-@computer_list = external global [100 x [20 x i8]] ; <[100 x [20 x i8]]*> [#uses=0]
-@number_of_GMs = external global i32 ; <i32*> [#uses=0]
-@GM_list = external global [100 x [20 x i8]] ; <[100 x [20 x i8]]*> [#uses=0]
-@number_of_IMs = external global i32 ; <i32*> [#uses=0]
-@IM_list = external global [100 x [20 x i8]] ; <[100 x [20 x i8]]*> [#uses=0]
-@ics = external global i32 ; <i32*> [#uses=0]
-@output_format = external global i32 ; <i32*> [#uses=0]
-@EGTBlimit = external global i32 ; <i32*> [#uses=0]
-@whisper = external global i32 ; <i32*> [#uses=0]
-@channel = external global i32 ; <i32*> [#uses=0]
-@new_game = external global i32 ; <i32*> [#uses=0]
-@channel_title = external global [32 x i8] ; <[32 x i8]*> [#uses=0]
-@initialized = external global i32 ; <i32*> [#uses=0]
-@kibitz = external global i32 ; <i32*> [#uses=0]
-@post = external global i32 ; <i32*> [#uses=0]
-@log_id = external global i32 ; <i32*> [#uses=0]
-@crafty_is_white = external global i32 ; <i32*> [#uses=0]
-@last_opponent_move = external global i32 ; <i32*> [#uses=0]
-@search_move = external global i32 ; <i32*> [#uses=0]
-@time_used = external global i32 ; <i32*> [#uses=0]
-@time_used_opponent = external global i32 ; <i32*> [#uses=0]
-@auto_kibitzing = external global i32 ; <i32*> [#uses=0]
-@test_mode = external global i32 ; <i32*> [#uses=0]
-@resign = external global i8 ; <i8*> [#uses=0]
-@resign_counter = external global i8 ; <i8*> [#uses=0]
-@resign_count = external global i8 ; <i8*> [#uses=0]
-@draw_counter = external global i8 ; <i8*> [#uses=0]
-@draw_count = external global i8 ; <i8*> [#uses=0]
-@tc_moves = external global i32 ; <i32*> [#uses=0]
-@tc_time = external global i32 ; <i32*> [#uses=0]
-@tc_time_remaining = external global i32 ; <i32*> [#uses=0]
-@tc_moves_remaining = external global i32 ; <i32*> [#uses=0]
-@tc_secondary_moves = external global i32 ; <i32*> [#uses=0]
-@tc_secondary_time = external global i32 ; <i32*> [#uses=0]
-@tc_sudden_death = external global i32 ; <i32*> [#uses=0]
-@tc_operator_time = external global i32 ; <i32*> [#uses=0]
-@tc_safety_margin = external global i32 ; <i32*> [#uses=0]
-@force = external global i32 ; <i32*> [#uses=0]
-@over = external global i32 ; <i32*> [#uses=0]
-@usage_level = external global i32 ; <i32*> [#uses=0]
-@audible_alarm = external global i8 ; <i8*> [#uses=0]
-@ansi = external global i32 ; <i32*> [#uses=0]
-@book_accept_mask = external global i32 ; <i32*> [#uses=0]
-@book_reject_mask = external global i32 ; <i32*> [#uses=0]
-@book_random = external global i32 ; <i32*> [#uses=0]
-@book_search_trigger = external global i32 ; <i32*> [#uses=0]
-@learning = external global i32 ; <i32*> [#uses=0]
-@show_book = external global i32 ; <i32*> [#uses=0]
-@book_selection_width = external global i32 ; <i32*> [#uses=0]
-@ponder = external global i32 ; <i32*> [#uses=0]
-@verbosity_level = external global i32 ; <i32*> [#uses=0]
-@push_extensions = external global [64 x i8] ; <[64 x i8]*> [#uses=0]
-@.str_28.upgrd.52 = external global [5 x i8] ; <[5 x i8]*> [#uses=0]
-@.str_3.upgrd.53 = external global [43 x i8] ; <[43 x i8]*> [#uses=0]
-@display = external global %typedef.CHESS_POSITION ; <%typedef.CHESS_POSITION*> [#uses=0]
-@.str_4.upgrd.54 = external global [14 x i8] ; <[14 x i8]*> [#uses=0]
-@opponent_start_time = external global i32 ; <i32*> [#uses=0]
-@.str_8.upgrd.55 = external global [12 x i8] ; <[12 x i8]*> [#uses=0]
-@.str_9.upgrd.56 = external global [12 x i8] ; <[12 x i8]*> [#uses=0]
-@.str_18 = external global [5 x i8] ; <[5 x i8]*> [#uses=0]
-@.str_19.upgrd.57 = external global [35 x i8] ; <[35 x i8]*> [#uses=0]
-@.str_2013 = external global [6 x i8] ; <[6 x i8]*> [#uses=0]
-@.str_21.upgrd.58 = external global [41 x i8] ; <[41 x i8]*> [#uses=0]
-@.str_22.upgrd.59 = external global [29 x i8] ; <[29 x i8]*> [#uses=0]
-@.str_23.upgrd.60 = external global [8 x i8] ; <[8 x i8]*> [#uses=0]
-@whisper_text = external global [500 x i8] ; <[500 x i8]*> [#uses=0]
-@.str_24.upgrd.61 = external global [4 x i8] ; <[4 x i8]*> [#uses=0]
-@.str_25.upgrd.62 = external global [3 x i8] ; <[3 x i8]*> [#uses=0]
-@.str_26.upgrd.63 = external global [11 x i8] ; <[11 x i8]*> [#uses=0]
-@.str_28.upgrd.64 = external global [13 x i8] ; <[13 x i8]*> [#uses=0]
-@.str_29 = external global [13 x i8] ; <[13 x i8]*> [#uses=0]
-@.str_30 = external global [33 x i8] ; <[33 x i8]*> [#uses=0]
-@.str_31 = external global [2 x i8] ; <[2 x i8]*> [#uses=0]
-@.str_32.upgrd.65 = external global [22 x i8] ; <[22 x i8]*> [#uses=0]
-@.str_36 = external global [3 x i8] ; <[3 x i8]*> [#uses=1]
-@.str_37 = external global [15 x i8] ; <[15 x i8]*> [#uses=0]
-@.str_44 = external global [12 x i8] ; <[12 x i8]*> [#uses=0]
-@.str_45 = external global [5 x i8] ; <[5 x i8]*> [#uses=0]
-@.str_49 = external global [15 x i8] ; <[15 x i8]*> [#uses=0]
-@.str_52 = external global [12 x i8] ; <[12 x i8]*> [#uses=0]
-@previous_search_value = external global i32 ; <i32*> [#uses=0]
-@.str_64 = external global [8 x i8] ; <[8 x i8]*> [#uses=0]
-@whisper_depth = external global i32 ; <i32*> [#uses=0]
-@.str_65 = external global [6 x i8] ; <[6 x i8]*> [#uses=0]
-@.str_66 = external global [57 x i8] ; <[57 x i8]*> [#uses=0]
-@total_moves = external global i32 ; <i32*> [#uses=0]
-@book_file = external global %struct.__sFILE* ; <%struct.__sFILE**> [#uses=0]
-@books_file = external global %struct.__sFILE* ; <%struct.__sFILE**> [#uses=0]
-@book_lrn_file = external global %struct.__sFILE* ; <%struct.__sFILE**> [#uses=0]
-@position_file = external global %struct.__sFILE* ; <%struct.__sFILE**> [#uses=0]
-@position_lrn_file = external global %struct.__sFILE* ; <%struct.__sFILE**> [#uses=0]
-@log_filename = external global [64 x i8] ; <[64 x i8]*> [#uses=0]
-@history_filename = external global [64 x i8] ; <[64 x i8]*> [#uses=0]
-@book_path = external global [128 x i8] ; <[128 x i8]*> [#uses=0]
-@log_path = external global [128 x i8] ; <[128 x i8]*> [#uses=0]
-@tb_path = external global [128 x i8] ; <[128 x i8]*> [#uses=0]
-@cmd_buffer = external global [512 x i8] ; <[512 x i8]*> [#uses=0]
-@root_move = external global i32 ; <i32*> [#uses=0]
-@hint = external global [16 x i8] ; <[16 x i8]*> [#uses=0]
-@absolute_time_limit = external global i32 ; <i32*> [#uses=0]
-@search_time_limit = external global i32 ; <i32*> [#uses=0]
-@in_check = external global [65 x i8] ; <[65 x i8]*> [#uses=0]
-@extended_reason = external global [65 x i8] ; <[65 x i8]*> [#uses=0]
-@current_phase = external global [65 x i8] ; <[65 x i8]*> [#uses=0]
-@sort_value = external global [256 x i32] ; <[256 x i32]*> [#uses=0]
-@next_status = external global [65 x %typedef.NEXT_MOVE] ; <[65 x %typedef.NEXT_MOVE]*> [#uses=0]
-@save_hash_key = external global [67 x i64] ; <[67 x i64]*> [#uses=0]
-@save_pawn_hash_key = external global [67 x i32] ; <[67 x i32]*> [#uses=0]
-@pawn_advance = external global [8 x i32] ; <[8 x i32]*> [#uses=0]
-@bit_move = external global i64 ; <i64*> [#uses=0]
-@.str_1.upgrd.66 = external global [17 x i8] ; <[17 x i8]*> [#uses=0]
-@.str_2.upgrd.67 = external global [36 x i8] ; <[36 x i8]*> [#uses=0]
-@.str_3.upgrd.68 = external global [8 x i8] ; <[8 x i8]*> [#uses=0]
-@.str_1.upgrd.69 = external global [34 x i8] ; <[34 x i8]*> [#uses=0]
-@.str_2.upgrd.70 = external global [46 x i8] ; <[46 x i8]*> [#uses=0]
-@.str_2.upgrd.71 = external global [47 x i8] ; <[47 x i8]*> [#uses=0]
-@.str_1.upgrd.72 = external global [6 x i8] ; <[6 x i8]*> [#uses=0]
-@.str_2.upgrd.73 = external global [6 x i8] ; <[6 x i8]*> [#uses=0]
-@.str_3.upgrd.74 = external global [3 x i8] ; <[3 x i8]*> [#uses=0]
-@.str_4.upgrd.75 = external global [4 x i8] ; <[4 x i8]*> [#uses=0]
-@.str_5.upgrd.76 = external global [22 x i8] ; <[22 x i8]*> [#uses=0]
-@.str_615 = external global [5 x i8] ; <[5 x i8]*> [#uses=0]
-@.str_7.upgrd.77 = external global [21 x i8] ; <[21 x i8]*> [#uses=0]
-@.str_10.upgrd.78 = external global [8 x i8] ; <[8 x i8]*> [#uses=0]
-@.str_11.upgrd.79 = external global [3 x i8] ; <[3 x i8]*> [#uses=0]
-@.str_12.upgrd.80 = external global [18 x i8] ; <[18 x i8]*> [#uses=0]
-@.str_1318 = external global [4 x i8] ; <[4 x i8]*> [#uses=0]
-@.str_1419 = external global [2 x i8] ; <[2 x i8]*> [#uses=0]
-@.str_15.upgrd.81 = external global [17 x i8] ; <[17 x i8]*> [#uses=0]
-@.str_16.upgrd.82 = external global [6 x i8] ; <[6 x i8]*> [#uses=0]
-@.str_19.upgrd.83 = external global [22 x i8] ; <[22 x i8]*> [#uses=0]
-@.str_20.upgrd.84 = external global [5 x i8] ; <[5 x i8]*> [#uses=0]
-@.str_2222 = external global [6 x i8] ; <[6 x i8]*> [#uses=0]
-@.str_2323 = external global [8 x i8] ; <[8 x i8]*> [#uses=0]
-@.str_25.upgrd.85 = external global [29 x i8] ; <[29 x i8]*> [#uses=0]
-@.str_27 = external global [48 x i8] ; <[48 x i8]*> [#uses=0]
-@.str_28.upgrd.86 = external global [42 x i8] ; <[42 x i8]*> [#uses=0]
-@.str_29.upgrd.87 = external global [64 x i8] ; <[64 x i8]*> [#uses=0]
-@.str_30.upgrd.88 = external global [27 x i8] ; <[27 x i8]*> [#uses=0]
-@.str_31.upgrd.89 = external global [18 x i8] ; <[18 x i8]*> [#uses=0]
-@.str_32.upgrd.90 = external global [40 x i8] ; <[40 x i8]*> [#uses=0]
-@.str_33 = external global [8 x i8] ; <[8 x i8]*> [#uses=0]
-@.str_34 = external global [5 x i8] ; <[5 x i8]*> [#uses=0]
-@.str_35 = external global [40 x i8] ; <[40 x i8]*> [#uses=0]
-@.str_36.upgrd.91 = external global [46 x i8] ; <[46 x i8]*> [#uses=0]
-@.str_37.upgrd.92 = external global [5 x i8] ; <[5 x i8]*> [#uses=0]
-@.str_38 = external global [5 x i8] ; <[5 x i8]*> [#uses=0]
-@.str_41 = external global [7 x i8] ; <[7 x i8]*> [#uses=0]
-@.str_42 = external global [7 x i8] ; <[7 x i8]*> [#uses=0]
-@.str_43 = external global [5 x i8] ; <[5 x i8]*> [#uses=0]
-@.str_44.upgrd.93 = external global [6 x i8] ; <[6 x i8]*> [#uses=0]
-@.str_4525 = external global [5 x i8] ; <[5 x i8]*> [#uses=0]
-@.str_46 = external global [6 x i8] ; <[6 x i8]*> [#uses=0]
-@.str_47 = external global [19 x i8] ; <[19 x i8]*> [#uses=0]
-@.str_48 = external global [35 x i8] ; <[35 x i8]*> [#uses=0]
-@.str_49.upgrd.94 = external global [6 x i8] ; <[6 x i8]*> [#uses=0]
-@.str_50 = external global [19 x i8] ; <[19 x i8]*> [#uses=0]
-@.str_51 = external global [25 x i8] ; <[25 x i8]*> [#uses=0]
-@.str_52.upgrd.95 = external global [5 x i8] ; <[5 x i8]*> [#uses=0]
-@.str_53 = external global [10 x i8] ; <[10 x i8]*> [#uses=0]
-@.str_54 = external global [23 x i8] ; <[23 x i8]*> [#uses=0]
-@.str_55 = external global [32 x i8] ; <[32 x i8]*> [#uses=0]
-@.str_56 = external global [5 x i8] ; <[5 x i8]*> [#uses=0]
-@.str_57 = external global [5 x i8] ; <[5 x i8]*> [#uses=0]
-@.str_58 = external global [6 x i8] ; <[6 x i8]*> [#uses=0]
-@.str_59 = external global [5 x i8] ; <[5 x i8]*> [#uses=0]
-@.str_60 = external global [3 x i8] ; <[3 x i8]*> [#uses=0]
-@.str_61 = external global [10 x i8] ; <[10 x i8]*> [#uses=0]
-@.str_62 = external global [5 x i8] ; <[5 x i8]*> [#uses=0]
-@.str_63 = external global [16 x i8] ; <[16 x i8]*> [#uses=0]
-@.str_64.upgrd.96 = external global [37 x i8] ; <[37 x i8]*> [#uses=0]
-@.str_66.upgrd.97 = external global [5 x i8] ; <[5 x i8]*> [#uses=0]
-@.str_67 = external global [21 x i8] ; <[21 x i8]*> [#uses=0]
-@.str_68 = external global [4 x i8] ; <[4 x i8]*> [#uses=0]
-@.str_69 = external global [5 x i8] ; <[5 x i8]*> [#uses=0]
-@.str_71 = external global [5 x i8] ; <[5 x i8]*> [#uses=0]
-@.str_72 = external global [5 x i8] ; <[5 x i8]*> [#uses=0]
-@.str_73 = external global [6 x i8] ; <[6 x i8]*> [#uses=0]
-@.str_74 = external global [22 x i8] ; <[22 x i8]*> [#uses=0]
-@.str_75 = external global [9 x i8] ; <[9 x i8]*> [#uses=0]
-@.str_81 = external global [7 x i8] ; <[7 x i8]*> [#uses=0]
-@.str_83 = external global [8 x i8] ; <[8 x i8]*> [#uses=0]
-@.str_84 = external global [23 x i8] ; <[23 x i8]*> [#uses=0]
-@.str_86 = external global [4 x i8] ; <[4 x i8]*> [#uses=0]
-@.str_87 = external global [8 x i8] ; <[8 x i8]*> [#uses=0]
-@.str_89 = external global [7 x i8] ; <[7 x i8]*> [#uses=0]
-@.str_90 = external global [5 x i8] ; <[5 x i8]*> [#uses=0]
-@.str_91 = external global [5 x i8] ; <[5 x i8]*> [#uses=0]
-@.str_92 = external global [47 x i8] ; <[47 x i8]*> [#uses=0]
-@.str_94 = external global [37 x i8] ; <[37 x i8]*> [#uses=0]
-@.str_95 = external global [33 x i8] ; <[33 x i8]*> [#uses=0]
-@.str_96 = external global [34 x i8] ; <[34 x i8]*> [#uses=0]
-@.str_97 = external global [33 x i8] ; <[33 x i8]*> [#uses=0]
-@.str_98 = external global [6 x i8] ; <[6 x i8]*> [#uses=0]
-@.str_100 = external global [42 x i8] ; <[42 x i8]*> [#uses=0]
-@.str_101 = external global [38 x i8] ; <[38 x i8]*> [#uses=0]
-@.str_102 = external global [39 x i8] ; <[39 x i8]*> [#uses=0]
-@.str_103 = external global [38 x i8] ; <[38 x i8]*> [#uses=0]
-@.str_104 = external global [5 x i8] ; <[5 x i8]*> [#uses=0]
-@.str_105 = external global [8 x i8] ; <[8 x i8]*> [#uses=0]
-@.str_106 = external global [9 x i8] ; <[9 x i8]*> [#uses=0]
-@.str_107 = external global [59 x i8] ; <[59 x i8]*> [#uses=0]
-@.str_108 = external global [57 x i8] ; <[57 x i8]*> [#uses=0]
-@.str_109 = external global [56 x i8] ; <[56 x i8]*> [#uses=0]
-@.str_110 = external global [59 x i8] ; <[59 x i8]*> [#uses=0]
-@.str_111 = external global [54 x i8] ; <[54 x i8]*> [#uses=0]
-@.str_112 = external global [57 x i8] ; <[57 x i8]*> [#uses=0]
-@.str_113 = external global [58 x i8] ; <[58 x i8]*> [#uses=0]
-@.str_114 = external global [9 x i8] ; <[9 x i8]*> [#uses=0]
-@.str_115 = external global [48 x i8] ; <[48 x i8]*> [#uses=0]
-@.str_116 = external global [61 x i8] ; <[61 x i8]*> [#uses=0]
-@.str_117 = external global [60 x i8] ; <[60 x i8]*> [#uses=0]
-@.str_118 = external global [63 x i8] ; <[63 x i8]*> [#uses=0]
-@.str_119 = external global [62 x i8] ; <[62 x i8]*> [#uses=0]
-@.str_120 = external global [63 x i8] ; <[63 x i8]*> [#uses=0]
-@.str_121 = external global [60 x i8] ; <[60 x i8]*> [#uses=0]
-@.str_122 = external global [64 x i8] ; <[64 x i8]*> [#uses=0]
-@.str_123 = external global [61 x i8] ; <[61 x i8]*> [#uses=0]
-@.str_124 = external global [60 x i8] ; <[60 x i8]*> [#uses=0]
-@.str_125 = external global [65 x i8] ; <[65 x i8]*> [#uses=0]
-@.str_126 = external global [65 x i8] ; <[65 x i8]*> [#uses=0]
-@.str_127 = external global [69 x i8] ; <[69 x i8]*> [#uses=0]
-@.str_128 = external global [66 x i8] ; <[66 x i8]*> [#uses=0]
-@.str_129 = external global [61 x i8] ; <[61 x i8]*> [#uses=0]
-@.str_130 = external global [63 x i8] ; <[63 x i8]*> [#uses=0]
-@.str_131 = external global [67 x i8] ; <[67 x i8]*> [#uses=0]
-@.str_132 = external global [63 x i8] ; <[63 x i8]*> [#uses=0]
-@.str_133 = external global [58 x i8] ; <[58 x i8]*> [#uses=0]
-@.str_134 = external global [5 x i8] ; <[5 x i8]*> [#uses=0]
-@.str_135 = external global [57 x i8] ; <[57 x i8]*> [#uses=0]
-@.str_136.upgrd.98 = external global [56 x i8] ; <[56 x i8]*> [#uses=0]
-@.str_137 = external global [60 x i8] ; <[60 x i8]*> [#uses=0]
-@.str_138 = external global [60 x i8] ; <[60 x i8]*> [#uses=0]
-@.str_139 = external global [58 x i8] ; <[58 x i8]*> [#uses=0]
-@.str_140 = external global [57 x i8] ; <[57 x i8]*> [#uses=0]
-@.str_141 = external global [60 x i8] ; <[60 x i8]*> [#uses=0]
-@.str_142 = external global [59 x i8] ; <[59 x i8]*> [#uses=0]
-@.str_143 = external global [59 x i8] ; <[59 x i8]*> [#uses=0]
-@.str_144 = external global [62 x i8] ; <[62 x i8]*> [#uses=0]
-@.str_145 = external global [62 x i8] ; <[62 x i8]*> [#uses=0]
-@.str_146 = external global [61 x i8] ; <[61 x i8]*> [#uses=0]
-@.str_147 = external global [60 x i8] ; <[60 x i8]*> [#uses=0]
-@.str_148 = external global [62 x i8] ; <[62 x i8]*> [#uses=0]
-@.str_149 = external global [64 x i8] ; <[64 x i8]*> [#uses=0]
-@.str_150 = external global [65 x i8] ; <[65 x i8]*> [#uses=0]
-@.str_151 = external global [61 x i8] ; <[61 x i8]*> [#uses=0]
-@.str_152 = external global [46 x i8] ; <[46 x i8]*> [#uses=0]
-@.str_153 = external global [8 x i8] ; <[8 x i8]*> [#uses=0]
-@.str_154 = external global [64 x i8] ; <[64 x i8]*> [#uses=0]
-@.str_156 = external global [57 x i8] ; <[57 x i8]*> [#uses=0]
-@.str_157 = external global [31 x i8] ; <[31 x i8]*> [#uses=0]
-@.str_158 = external global [71 x i8] ; <[71 x i8]*> [#uses=0]
-@.str_159 = external global [72 x i8] ; <[72 x i8]*> [#uses=0]
-@.str_160 = external global [56 x i8] ; <[56 x i8]*> [#uses=0]
-@.str_161 = external global [59 x i8] ; <[59 x i8]*> [#uses=0]
-@.str_162 = external global [63 x i8] ; <[63 x i8]*> [#uses=0]
-@.str_163 = external global [62 x i8] ; <[62 x i8]*> [#uses=0]
-@.str_164 = external global [58 x i8] ; <[58 x i8]*> [#uses=0]
-@.str_165 = external global [57 x i8] ; <[57 x i8]*> [#uses=0]
-@.str_166 = external global [61 x i8] ; <[61 x i8]*> [#uses=0]
-@.str_167 = external global [63 x i8] ; <[63 x i8]*> [#uses=0]
-@.str_168 = external global [62 x i8] ; <[62 x i8]*> [#uses=0]
-@.str_169 = external global [65 x i8] ; <[65 x i8]*> [#uses=0]
-@.str_170 = external global [62 x i8] ; <[62 x i8]*> [#uses=0]
-@.str_171 = external global [63 x i8] ; <[63 x i8]*> [#uses=0]
-@.str_172 = external global [61 x i8] ; <[61 x i8]*> [#uses=0]
-@.str_173 = external global [64 x i8] ; <[64 x i8]*> [#uses=0]
-@.str_174 = external global [51 x i8] ; <[51 x i8]*> [#uses=0]
-@.str_175 = external global [70 x i8] ; <[70 x i8]*> [#uses=0]
-@.str_176 = external global [67 x i8] ; <[67 x i8]*> [#uses=0]
-@.str_177 = external global [64 x i8] ; <[64 x i8]*> [#uses=0]
-@.str_178 = external global [48 x i8] ; <[48 x i8]*> [#uses=0]
-@.str_180 = external global [57 x i8] ; <[57 x i8]*> [#uses=0]
-@.str_181 = external global [60 x i8] ; <[60 x i8]*> [#uses=0]
-@.str_182 = external global [53 x i8] ; <[53 x i8]*> [#uses=0]
-@.str_183 = external global [61 x i8] ; <[61 x i8]*> [#uses=0]
-@.str_184 = external global [57 x i8] ; <[57 x i8]*> [#uses=0]
-@.str_185 = external global [61 x i8] ; <[61 x i8]*> [#uses=0]
-@.str_186 = external global [59 x i8] ; <[59 x i8]*> [#uses=0]
-@.str_187 = external global [57 x i8] ; <[57 x i8]*> [#uses=0]
-@.str_188 = external global [35 x i8] ; <[35 x i8]*> [#uses=0]
-@.str_189 = external global [58 x i8] ; <[58 x i8]*> [#uses=0]
-@.str_190 = external global [59 x i8] ; <[59 x i8]*> [#uses=0]
-@.str_191 = external global [60 x i8] ; <[60 x i8]*> [#uses=0]
-@.str_192 = external global [39 x i8] ; <[39 x i8]*> [#uses=0]
-@.str_193 = external global [55 x i8] ; <[55 x i8]*> [#uses=0]
-@.str_194 = external global [32 x i8] ; <[32 x i8]*> [#uses=0]
-@.str_195 = external global [33 x i8] ; <[33 x i8]*> [#uses=0]
-@.str_196 = external global [46 x i8] ; <[46 x i8]*> [#uses=0]
-@.str_197 = external global [11 x i8] ; <[11 x i8]*> [#uses=0]
-@.str_198 = external global [16 x i8] ; <[16 x i8]*> [#uses=0]
-@.str_201 = external global [57 x i8] ; <[57 x i8]*> [#uses=0]
-@.str_202 = external global [58 x i8] ; <[58 x i8]*> [#uses=0]
-@.str_203 = external global [60 x i8] ; <[60 x i8]*> [#uses=0]
-@.str_204 = external global [3 x i8] ; <[3 x i8]*> [#uses=0]
-@.str_206 = external global [48 x i8] ; <[48 x i8]*> [#uses=0]
-@.str_207 = external global [46 x i8] ; <[46 x i8]*> [#uses=0]
-@.str_208 = external global [56 x i8] ; <[56 x i8]*> [#uses=0]
-@.str_209 = external global [59 x i8] ; <[59 x i8]*> [#uses=0]
-@.str_210 = external global [6 x i8] ; <[6 x i8]*> [#uses=0]
-@.str_211 = external global [43 x i8] ; <[43 x i8]*> [#uses=0]
-@.str_213 = external global [52 x i8] ; <[52 x i8]*> [#uses=0]
-@.str_214 = external global [59 x i8] ; <[59 x i8]*> [#uses=0]
-@.str_215 = external global [60 x i8] ; <[60 x i8]*> [#uses=0]
-@.str_216 = external global [14 x i8] ; <[14 x i8]*> [#uses=0]
-@.str_218 = external global [5 x i8] ; <[5 x i8]*> [#uses=0]
-@.str_219 = external global [60 x i8] ; <[60 x i8]*> [#uses=0]
-@.str_220 = external global [62 x i8] ; <[62 x i8]*> [#uses=0]
-@.str_221 = external global [37 x i8] ; <[37 x i8]*> [#uses=0]
-@.str_222 = external global [64 x i8] ; <[64 x i8]*> [#uses=0]
-@.str_223 = external global [66 x i8] ; <[66 x i8]*> [#uses=0]
-@.str_224 = external global [62 x i8] ; <[62 x i8]*> [#uses=0]
-@.str_225 = external global [64 x i8] ; <[64 x i8]*> [#uses=0]
-@.str_226 = external global [63 x i8] ; <[63 x i8]*> [#uses=0]
-@.str_227 = external global [46 x i8] ; <[46 x i8]*> [#uses=0]
-@.str_228 = external global [4 x i8] ; <[4 x i8]*> [#uses=0]
-@.str_229 = external global [56 x i8] ; <[56 x i8]*> [#uses=0]
-@.str_230 = external global [60 x i8] ; <[60 x i8]*> [#uses=0]
-@.str_231 = external global [19 x i8] ; <[19 x i8]*> [#uses=0]
-@.str_232 = external global [57 x i8] ; <[57 x i8]*> [#uses=0]
-@.str_233 = external global [60 x i8] ; <[60 x i8]*> [#uses=0]
-@.str_234 = external global [54 x i8] ; <[54 x i8]*> [#uses=0]
-@.str_235 = external global [60 x i8] ; <[60 x i8]*> [#uses=0]
-@.str_236 = external global [17 x i8] ; <[17 x i8]*> [#uses=0]
-@.str_237 = external global [9 x i8] ; <[9 x i8]*> [#uses=0]
-@.str_238 = external global [61 x i8] ; <[61 x i8]*> [#uses=0]
-@.str_239 = external global [59 x i8] ; <[59 x i8]*> [#uses=0]
-@.str_240 = external global [17 x i8] ; <[17 x i8]*> [#uses=0]
-@.str_241 = external global [61 x i8] ; <[61 x i8]*> [#uses=0]
-@.str_242 = external global [61 x i8] ; <[61 x i8]*> [#uses=0]
-@.str_243 = external global [35 x i8] ; <[35 x i8]*> [#uses=0]
-@.str_245 = external global [60 x i8] ; <[60 x i8]*> [#uses=0]
-@.str_246 = external global [58 x i8] ; <[58 x i8]*> [#uses=0]
-@.str_247 = external global [59 x i8] ; <[59 x i8]*> [#uses=0]
-@.str_248 = external global [56 x i8] ; <[56 x i8]*> [#uses=0]
-@.str_249 = external global [58 x i8] ; <[58 x i8]*> [#uses=0]
-@.str_250 = external global [45 x i8] ; <[45 x i8]*> [#uses=0]
-@.str_253 = external global [56 x i8] ; <[56 x i8]*> [#uses=0]
-@.str_254 = external global [17 x i8] ; <[17 x i8]*> [#uses=0]
-@.str_256 = external global [43 x i8] ; <[43 x i8]*> [#uses=0]
-@.str_258 = external global [52 x i8] ; <[52 x i8]*> [#uses=0]
-@.str_259 = external global [27 x i8] ; <[27 x i8]*> [#uses=0]
-@.str_261 = external global [43 x i8] ; <[43 x i8]*> [#uses=0]
-@.str_262 = external global [43 x i8] ; <[43 x i8]*> [#uses=0]
-@.str_263 = external global [43 x i8] ; <[43 x i8]*> [#uses=0]
-@.str_266 = external global [43 x i8] ; <[43 x i8]*> [#uses=0]
-@.str_267 = external global [43 x i8] ; <[43 x i8]*> [#uses=0]
-@.str_268 = external global [43 x i8] ; <[43 x i8]*> [#uses=0]
-@.str_270 = external global [60 x i8] ; <[60 x i8]*> [#uses=0]
-@.str_271 = external global [59 x i8] ; <[59 x i8]*> [#uses=0]
-@.str_272 = external global [60 x i8] ; <[60 x i8]*> [#uses=0]
-@.str_273 = external global [59 x i8] ; <[59 x i8]*> [#uses=0]
-@.str_274 = external global [59 x i8] ; <[59 x i8]*> [#uses=0]
-@.str_275 = external global [44 x i8] ; <[44 x i8]*> [#uses=0]
-@.str_276 = external global [5 x i8] ; <[5 x i8]*> [#uses=0]
-@.str_277 = external global [21 x i8] ; <[21 x i8]*> [#uses=0]
-@.str_278 = external global [48 x i8] ; <[48 x i8]*> [#uses=0]
-@.str_279 = external global [51 x i8] ; <[51 x i8]*> [#uses=0]
-@.str_280 = external global [52 x i8] ; <[52 x i8]*> [#uses=0]
-@.str_281 = external global [53 x i8] ; <[53 x i8]*> [#uses=0]
-@.str_282 = external global [50 x i8] ; <[50 x i8]*> [#uses=0]
-@.str_283 = external global [53 x i8] ; <[53 x i8]*> [#uses=0]
-@.str_284 = external global [56 x i8] ; <[56 x i8]*> [#uses=0]
-@.str_285 = external global [55 x i8] ; <[55 x i8]*> [#uses=0]
-@.str_286 = external global [56 x i8] ; <[56 x i8]*> [#uses=0]
-@.str_287 = external global [54 x i8] ; <[54 x i8]*> [#uses=0]
-@.str_288 = external global [58 x i8] ; <[58 x i8]*> [#uses=0]
-@.str_289 = external global [61 x i8] ; <[61 x i8]*> [#uses=0]
-@.str_290 = external global [56 x i8] ; <[56 x i8]*> [#uses=0]
-@.str_291 = external global [58 x i8] ; <[58 x i8]*> [#uses=0]
-@.str_292 = external global [58 x i8] ; <[58 x i8]*> [#uses=0]
-@.str_293 = external global [54 x i8] ; <[54 x i8]*> [#uses=0]
-@.str_294 = external global [56 x i8] ; <[56 x i8]*> [#uses=0]
-@.str_295 = external global [9 x i8] ; <[9 x i8]*> [#uses=0]
-@.str_296 = external global [5 x i8] ; <[5 x i8]*> [#uses=0]
-@.str_297 = external global [52 x i8] ; <[52 x i8]*> [#uses=0]
-@.str_298 = external global [51 x i8] ; <[51 x i8]*> [#uses=0]
-@.str_299 = external global [54 x i8] ; <[54 x i8]*> [#uses=0]
-@.str_300 = external global [49 x i8] ; <[49 x i8]*> [#uses=0]
-@.str_301 = external global [56 x i8] ; <[56 x i8]*> [#uses=0]
-@.str_302 = external global [18 x i8] ; <[18 x i8]*> [#uses=0]
-@.str_304 = external global [50 x i8] ; <[50 x i8]*> [#uses=0]
-@.str_305 = external global [50 x i8] ; <[50 x i8]*> [#uses=0]
-@.str_306 = external global [10 x i8] ; <[10 x i8]*> [#uses=0]
-@.str_308 = external global [52 x i8] ; <[52 x i8]*> [#uses=0]
-@.str_310 = external global [50 x i8] ; <[50 x i8]*> [#uses=0]
-@.str_311 = external global [52 x i8] ; <[52 x i8]*> [#uses=0]
-@.str_312 = external global [53 x i8] ; <[53 x i8]*> [#uses=0]
-@.str_313 = external global [52 x i8] ; <[52 x i8]*> [#uses=0]
-@.str_314 = external global [53 x i8] ; <[53 x i8]*> [#uses=0]
-@.str_315 = external global [54 x i8] ; <[54 x i8]*> [#uses=0]
-@.str_316 = external global [51 x i8] ; <[51 x i8]*> [#uses=0]
-@.str_317 = external global [26 x i8] ; <[26 x i8]*> [#uses=0]
-@.str_319 = external global [56 x i8] ; <[56 x i8]*> [#uses=0]
-@.str_320 = external global [53 x i8] ; <[53 x i8]*> [#uses=0]
-@.str_321 = external global [52 x i8] ; <[52 x i8]*> [#uses=0]
-@.str_322 = external global [55 x i8] ; <[55 x i8]*> [#uses=0]
-@.str_323 = external global [20 x i8] ; <[20 x i8]*> [#uses=0]
-@.str_325 = external global [26 x i8] ; <[26 x i8]*> [#uses=0]
-@.str_327 = external global [51 x i8] ; <[51 x i8]*> [#uses=0]
-@.str_328 = external global [51 x i8] ; <[51 x i8]*> [#uses=0]
-@.str_329 = external global [10 x i8] ; <[10 x i8]*> [#uses=0]
-@.str_330 = external global [8 x i8] ; <[8 x i8]*> [#uses=0]
-@.str_331 = external global [53 x i8] ; <[53 x i8]*> [#uses=0]
-@.str_332 = external global [39 x i8] ; <[39 x i8]*> [#uses=0]
-@.str_333 = external global [50 x i8] ; <[50 x i8]*> [#uses=0]
-@.str_334 = external global [54 x i8] ; <[54 x i8]*> [#uses=0]
-@.str_335 = external global [48 x i8] ; <[48 x i8]*> [#uses=0]
-@.str_336 = external global [52 x i8] ; <[52 x i8]*> [#uses=0]
-@.str_337 = external global [50 x i8] ; <[50 x i8]*> [#uses=0]
-@.str_338 = external global [56 x i8] ; <[56 x i8]*> [#uses=0]
-@.str_339 = external global [36 x i8] ; <[36 x i8]*> [#uses=0]
-@.str_340 = external global [55 x i8] ; <[55 x i8]*> [#uses=0]
-@.str_341 = external global [54 x i8] ; <[54 x i8]*> [#uses=0]
-@.str_342 = external global [49 x i8] ; <[49 x i8]*> [#uses=0]
-@.str_343 = external global [63 x i8] ; <[63 x i8]*> [#uses=0]
-@.str_344 = external global [49 x i8] ; <[49 x i8]*> [#uses=0]
-@.str_345 = external global [47 x i8] ; <[47 x i8]*> [#uses=0]
-@.str_346 = external global [49 x i8] ; <[49 x i8]*> [#uses=0]
-@.str_347 = external global [43 x i8] ; <[43 x i8]*> [#uses=0]
-@.str_348 = external global [52 x i8] ; <[52 x i8]*> [#uses=0]
-@.str_349 = external global [52 x i8] ; <[52 x i8]*> [#uses=0]
-@.str_350 = external global [55 x i8] ; <[55 x i8]*> [#uses=0]
-@.str_351 = external global [47 x i8] ; <[47 x i8]*> [#uses=0]
-@.str_352 = external global [49 x i8] ; <[49 x i8]*> [#uses=0]
-@.str_353 = external global [49 x i8] ; <[49 x i8]*> [#uses=0]
-@.str_354 = external global [42 x i8] ; <[42 x i8]*> [#uses=0]
-@.str_355 = external global [57 x i8] ; <[57 x i8]*> [#uses=0]
-@.str_356 = external global [59 x i8] ; <[59 x i8]*> [#uses=0]
-@.str_357 = external global [53 x i8] ; <[53 x i8]*> [#uses=0]
-@.str_358 = external global [47 x i8] ; <[47 x i8]*> [#uses=0]
-@.str_359 = external global [63 x i8] ; <[63 x i8]*> [#uses=0]
-@.str_360 = external global [54 x i8] ; <[54 x i8]*> [#uses=0]
-@.str_362 = external global [53 x i8] ; <[53 x i8]*> [#uses=0]
-@.str_363 = external global [62 x i8] ; <[62 x i8]*> [#uses=0]
-@.str_364 = external global [56 x i8] ; <[56 x i8]*> [#uses=0]
-@.str_365 = external global [51 x i8] ; <[51 x i8]*> [#uses=0]
-@.str_366 = external global [64 x i8] ; <[64 x i8]*> [#uses=0]
-@.str_367 = external global [62 x i8] ; <[62 x i8]*> [#uses=0]
-@.str_368 = external global [48 x i8] ; <[48 x i8]*> [#uses=0]
-@.str_369 = external global [52 x i8] ; <[52 x i8]*> [#uses=0]
-@.str_370 = external global [58 x i8] ; <[58 x i8]*> [#uses=0]
-@.str_371 = external global [49 x i8] ; <[49 x i8]*> [#uses=0]
-@.str_372 = external global [58 x i8] ; <[58 x i8]*> [#uses=0]
-@.str_373 = external global [61 x i8] ; <[61 x i8]*> [#uses=0]
-@.str_374 = external global [52 x i8] ; <[52 x i8]*> [#uses=0]
-@.str_375 = external global [63 x i8] ; <[63 x i8]*> [#uses=0]
-@.str_376 = external global [63 x i8] ; <[63 x i8]*> [#uses=0]
-@.str_377 = external global [62 x i8] ; <[62 x i8]*> [#uses=0]
-@.str_378 = external global [52 x i8] ; <[52 x i8]*> [#uses=0]
-@.str_379 = external global [60 x i8] ; <[60 x i8]*> [#uses=0]
-@.str_380 = external global [60 x i8] ; <[60 x i8]*> [#uses=0]
-@.str_381 = external global [60 x i8] ; <[60 x i8]*> [#uses=0]
-@.str_382 = external global [62 x i8] ; <[62 x i8]*> [#uses=0]
-@.str_383 = external global [49 x i8] ; <[49 x i8]*> [#uses=0]
-@.str_384 = external global [62 x i8] ; <[62 x i8]*> [#uses=0]
-@.str_385 = external global [62 x i8] ; <[62 x i8]*> [#uses=0]
-@.str_387 = external global [53 x i8] ; <[53 x i8]*> [#uses=0]
-@.str_388 = external global [57 x i8] ; <[57 x i8]*> [#uses=0]
-@.str_389 = external global [57 x i8] ; <[57 x i8]*> [#uses=0]
-@.str_390 = external global [55 x i8] ; <[55 x i8]*> [#uses=0]
-@.str_391 = external global [55 x i8] ; <[55 x i8]*> [#uses=0]
-@.str_392 = external global [71 x i8] ; <[71 x i8]*> [#uses=0]
-@.str_393 = external global [46 x i8] ; <[46 x i8]*> [#uses=0]
-@.str_394 = external global [51 x i8] ; <[51 x i8]*> [#uses=0]
-@.str_395 = external global [54 x i8] ; <[54 x i8]*> [#uses=0]
-@.str_396 = external global [60 x i8] ; <[60 x i8]*> [#uses=0]
-@.str_397 = external global [49 x i8] ; <[49 x i8]*> [#uses=0]
-@.str_398 = external global [62 x i8] ; <[62 x i8]*> [#uses=0]
-@.str_399 = external global [67 x i8] ; <[67 x i8]*> [#uses=0]
-@.str_400 = external global [55 x i8] ; <[55 x i8]*> [#uses=0]
-@.str_401 = external global [52 x i8] ; <[52 x i8]*> [#uses=0]
-@.str_402 = external global [62 x i8] ; <[62 x i8]*> [#uses=0]
-@.str_403 = external global [47 x i8] ; <[47 x i8]*> [#uses=0]
-@.str_404 = external global [59 x i8] ; <[59 x i8]*> [#uses=0]
-@.str_405 = external global [5 x i8] ; <[5 x i8]*> [#uses=0]
-@.str_406 = external global [10 x i8] ; <[10 x i8]*> [#uses=0]
-@.str_407 = external global [4 x i8] ; <[4 x i8]*> [#uses=0]
-@.str_408 = external global [6 x i8] ; <[6 x i8]*> [#uses=0]
-@.str_409 = external global [4 x i8] ; <[4 x i8]*> [#uses=0]
-@.str_410 = external global [26 x i8] ; <[26 x i8]*> [#uses=0]
-@.str_411 = external global [2 x i8] ; <[2 x i8]*> [#uses=0]
-@.str_412 = external global [22 x i8] ; <[22 x i8]*> [#uses=0]
-@.str_413 = external global [5 x i8] ; <[5 x i8]*> [#uses=0]
-@.str_414 = external global [19 x i8] ; <[19 x i8]*> [#uses=0]
-@.str_421 = external global [53 x i8] ; <[53 x i8]*> [#uses=0]
-@.str_422 = external global [55 x i8] ; <[55 x i8]*> [#uses=0]
-@.str_423 = external global [23 x i8] ; <[23 x i8]*> [#uses=0]
-@.str_424 = external global [39 x i8] ; <[39 x i8]*> [#uses=0]
-@.str_426 = external global [42 x i8] ; <[42 x i8]*> [#uses=0]
-@.str_427 = external global [40 x i8] ; <[40 x i8]*> [#uses=0]
-@.str_429 = external global [7 x i8] ; <[7 x i8]*> [#uses=0]
-@.str_430 = external global [24 x i8] ; <[24 x i8]*> [#uses=0]
-@.str_431 = external global [6 x i8] ; <[6 x i8]*> [#uses=0]
-@.str_432 = external global [23 x i8] ; <[23 x i8]*> [#uses=0]
-@.str_433 = external global [23 x i8] ; <[23 x i8]*> [#uses=0]
-@.str_434 = external global [24 x i8] ; <[24 x i8]*> [#uses=0]
-@.str_435 = external global [27 x i8] ; <[27 x i8]*> [#uses=0]
-@.str_436 = external global [28 x i8] ; <[28 x i8]*> [#uses=0]
-@.str_437 = external global [6 x i8] ; <[6 x i8]*> [#uses=0]
-@.str_438 = external global [38 x i8] ; <[38 x i8]*> [#uses=0]
-@.str_440 = external global [44 x i8] ; <[44 x i8]*> [#uses=0]
-@.str_445 = external global [3 x i8] ; <[3 x i8]*> [#uses=0]
-@.str_446 = external global [26 x i8] ; <[26 x i8]*> [#uses=0]
-@.str_447 = external global [36 x i8] ; <[36 x i8]*> [#uses=0]
-@.str_448 = external global [40 x i8] ; <[40 x i8]*> [#uses=0]
-@.str_449 = external global [22 x i8] ; <[22 x i8]*> [#uses=0]
-@.str_450 = external global [6 x i8] ; <[6 x i8]*> [#uses=0]
-@.str_451 = external global [44 x i8] ; <[44 x i8]*> [#uses=0]
-@.str_452 = external global [3 x i8] ; <[3 x i8]*> [#uses=0]
-@.str_453 = external global [26 x i8] ; <[26 x i8]*> [#uses=0]
-@.str_454 = external global [36 x i8] ; <[36 x i8]*> [#uses=0]
-@.str_455 = external global [40 x i8] ; <[40 x i8]*> [#uses=0]
-@.str_456 = external global [22 x i8] ; <[22 x i8]*> [#uses=0]
-@.str_459 = external global [2 x i8] ; <[2 x i8]*> [#uses=0]
-@.str_460 = external global [32 x i8] ; <[32 x i8]*> [#uses=0]
-@.str_461 = external global [42 x i8] ; <[42 x i8]*> [#uses=0]
-@.str_462 = external global [39 x i8] ; <[39 x i8]*> [#uses=0]
-@.str_463 = external global [28 x i8] ; <[28 x i8]*> [#uses=0]
-@.str_466 = external global [3 x i8] ; <[3 x i8]*> [#uses=0]
-@.str_467 = external global [35 x i8] ; <[35 x i8]*> [#uses=0]
-@.str_468 = external global [45 x i8] ; <[45 x i8]*> [#uses=0]
-@.str_469 = external global [40 x i8] ; <[40 x i8]*> [#uses=0]
-@.str_470 = external global [31 x i8] ; <[31 x i8]*> [#uses=0]
-@.str_474 = external global [10 x i8] ; <[10 x i8]*> [#uses=0]
-@.str_477 = external global [10 x i8] ; <[10 x i8]*> [#uses=0]
-@.str_480 = external global [16 x i8] ; <[16 x i8]*> [#uses=0]
-@.str_483 = external global [19 x i8] ; <[19 x i8]*> [#uses=0]
-@.str_485 = external global [5 x i8] ; <[5 x i8]*> [#uses=0]
-@.str_487 = external global [32 x i8] ; <[32 x i8]*> [#uses=0]
-@.str_490 = external global [5 x i8] ; <[5 x i8]*> [#uses=0]
-@.str_494 = external global [4 x i8] ; <[4 x i8]*> [#uses=0]
-@.str_495 = external global [33 x i8] ; <[33 x i8]*> [#uses=0]
-@.str_497 = external global [12 x i8] ; <[12 x i8]*> [#uses=0]
-@.str_498 = external global [13 x i8] ; <[13 x i8]*> [#uses=0]
-@.str_507 = external global [5 x i8] ; <[5 x i8]*> [#uses=0]
-@.str_508 = external global [11 x i8] ; <[11 x i8]*> [#uses=0]
-@.str_509 = external global [57 x i8] ; <[57 x i8]*> [#uses=0]
-@.str_510 = external global [37 x i8] ; <[37 x i8]*> [#uses=0]
-@.str_511 = external global [7 x i8] ; <[7 x i8]*> [#uses=0]
-@.str_512 = external global [32 x i8] ; <[32 x i8]*> [#uses=0]
-@.str_513 = external global [18 x i8] ; <[18 x i8]*> [#uses=0]
-@.str_514 = external global [14 x i8] ; <[14 x i8]*> [#uses=0]
-@.str_515 = external global [5 x i8] ; <[5 x i8]*> [#uses=0]
-@.str_516 = external global [21 x i8] ; <[21 x i8]*> [#uses=0]
-@.str_517 = external global [10 x i8] ; <[10 x i8]*> [#uses=0]
-@.str_519 = external global [17 x i8] ; <[17 x i8]*> [#uses=0]
-@.str_520 = external global [21 x i8] ; <[21 x i8]*> [#uses=0]
-@.str_521 = external global [15 x i8] ; <[15 x i8]*> [#uses=0]
-@.str_522 = external global [16 x i8] ; <[16 x i8]*> [#uses=0]
-@.str_523 = external global [4 x i8] ; <[4 x i8]*> [#uses=0]
-@.str_524 = external global [3 x i8] ; <[3 x i8]*> [#uses=0]
-@.str_525 = external global [6 x i8] ; <[6 x i8]*> [#uses=0]
-@.str_526 = external global [19 x i8] ; <[19 x i8]*> [#uses=0]
-@.str_527 = external global [24 x i8] ; <[24 x i8]*> [#uses=0]
-@.str_528 = external global [9 x i8] ; <[9 x i8]*> [#uses=0]
-@.str_529 = external global [28 x i8] ; <[28 x i8]*> [#uses=0]
-@.str_530 = external global [54 x i8] ; <[54 x i8]*> [#uses=0]
-@.str_531 = external global [6 x i8] ; <[6 x i8]*> [#uses=0]
-@.str_532 = external global [38 x i8] ; <[38 x i8]*> [#uses=0]
-@.str_533 = external global [32 x i8] ; <[32 x i8]*> [#uses=0]
-@.str_534 = external global [7 x i8] ; <[7 x i8]*> [#uses=0]
-@.str_535 = external global [27 x i8] ; <[27 x i8]*> [#uses=0]
-@.str_536 = external global [5 x i8] ; <[5 x i8]*> [#uses=0]
-@.str_537 = external global [6 x i8] ; <[6 x i8]*> [#uses=0]
-@.str_539 = external global [39 x i8] ; <[39 x i8]*> [#uses=0]
-@.str_540 = external global [40 x i8] ; <[40 x i8]*> [#uses=0]
-@.str_541 = external global [8 x i8] ; <[8 x i8]*> [#uses=0]
-@.str_542 = external global [9 x i8] ; <[9 x i8]*> [#uses=0]
-@.str_543 = external global [7 x i8] ; <[7 x i8]*> [#uses=0]
-@.str_544 = external global [49 x i8] ; <[49 x i8]*> [#uses=0]
-@.str_546 = external global [40 x i8] ; <[40 x i8]*> [#uses=0]
-@.str_550 = external global [5 x i8] ; <[5 x i8]*> [#uses=0]
-@.str_551 = external global [40 x i8] ; <[40 x i8]*> [#uses=0]
-@.str_552 = external global [31 x i8] ; <[31 x i8]*> [#uses=0]
-@.str_553 = external global [52 x i8] ; <[52 x i8]*> [#uses=0]
-@.str_554 = external global [43 x i8] ; <[43 x i8]*> [#uses=0]
-@.str_555 = external global [6 x i8] ; <[6 x i8]*> [#uses=0]
-@.str_556 = external global [26 x i8] ; <[26 x i8]*> [#uses=0]
-@.str_557 = external global [16 x i8] ; <[16 x i8]*> [#uses=0]
-@.str_559 = external global [27 x i8] ; <[27 x i8]*> [#uses=0]
-@.str_560 = external global [6 x i8] ; <[6 x i8]*> [#uses=0]
-@.str_562 = external global [5 x i8] ; <[5 x i8]*> [#uses=0]
-@.str_564 = external global [6 x i8] ; <[6 x i8]*> [#uses=0]
-@.str_565 = external global [6 x i8] ; <[6 x i8]*> [#uses=0]
-@.str_567 = external global [9 x i8] ; <[9 x i8]*> [#uses=0]
-@.str_568 = external global [6 x i8] ; <[6 x i8]*> [#uses=0]
-@.str_570 = external global [9 x i8] ; <[9 x i8]*> [#uses=0]
-@.str_571 = external global [7 x i8] ; <[7 x i8]*> [#uses=0]
-@.str_572 = external global [30 x i8] ; <[30 x i8]*> [#uses=0]
-@.str_574 = external global [20 x i8] ; <[20 x i8]*> [#uses=0]
-@.str_576 = external global [21 x i8] ; <[21 x i8]*> [#uses=0]
-@.str_577 = external global [5 x i8] ; <[5 x i8]*> [#uses=0]
-@.str_578 = external global [7 x i8] ; <[7 x i8]*> [#uses=0]
-@.str_579 = external global [7 x i8] ; <[7 x i8]*> [#uses=0]
-@.str_580 = external global [7 x i8] ; <[7 x i8]*> [#uses=0]
-@.str_581 = external global [36 x i8] ; <[36 x i8]*> [#uses=0]
-@.str_582 = external global [22 x i8] ; <[22 x i8]*> [#uses=0]
-@.str_583 = external global [24 x i8] ; <[24 x i8]*> [#uses=0]
-@.str_584 = external global [7 x i8] ; <[7 x i8]*> [#uses=0]
-@.str_586 = external global [6 x i8] ; <[6 x i8]*> [#uses=0]
-@.str_587 = external global [28 x i8] ; <[28 x i8]*> [#uses=0]
-@.str_589 = external global [28 x i8] ; <[28 x i8]*> [#uses=0]
-@.str_590 = external global [39 x i8] ; <[39 x i8]*> [#uses=0]
-@.str_591 = external global [5 x i8] ; <[5 x i8]*> [#uses=0]
-@.str_592 = external global [6 x i8] ; <[6 x i8]*> [#uses=0]
-@.str_596 = external global [25 x i8] ; <[25 x i8]*> [#uses=0]
-@.str_597 = external global [27 x i8] ; <[27 x i8]*> [#uses=0]
-@.str_598 = external global [17 x i8] ; <[17 x i8]*> [#uses=0]
-@.str_599 = external global [17 x i8] ; <[17 x i8]*> [#uses=0]
-@.str_605 = external global [5 x i8] ; <[5 x i8]*> [#uses=0]
-@.str_610 = external global [7 x i8] ; <[7 x i8]*> [#uses=0]
-@.str_613 = external global [6 x i8] ; <[6 x i8]*> [#uses=0]
-@.str_616 = external global [4 x i8] ; <[4 x i8]*> [#uses=0]
-@.str_621 = external global [7 x i8] ; <[7 x i8]*> [#uses=0]
-@.str_622 = external global [24 x i8] ; <[24 x i8]*> [#uses=0]
-@.str_623 = external global [40 x i8] ; <[40 x i8]*> [#uses=0]
-@.str_624 = external global [24 x i8] ; <[24 x i8]*> [#uses=0]
-@.str_625 = external global [9 x i8] ; <[9 x i8]*> [#uses=0]
-@.str_626 = external global [3 x i8] ; <[3 x i8]*> [#uses=0]
-@.str_628 = external global [30 x i8] ; <[30 x i8]*> [#uses=0]
-@.str_629 = external global [14 x i8] ; <[14 x i8]*> [#uses=0]
-@.str_630 = external global [13 x i8] ; <[13 x i8]*> [#uses=0]
-@.str_631 = external global [24 x i8] ; <[24 x i8]*> [#uses=0]
-@.str_632 = external global [14 x i8] ; <[14 x i8]*> [#uses=0]
-@.str_633 = external global [14 x i8] ; <[14 x i8]*> [#uses=0]
-@.str_634 = external global [17 x i8] ; <[17 x i8]*> [#uses=0]
-@.str_635 = external global [14 x i8] ; <[14 x i8]*> [#uses=0]
-@.str_636 = external global [17 x i8] ; <[17 x i8]*> [#uses=0]
-@.str_637 = external global [16 x i8] ; <[16 x i8]*> [#uses=0]
-@.str_639 = external global [5 x i8] ; <[5 x i8]*> [#uses=0]
-@.str_643 = external global [20 x i8] ; <[20 x i8]*> [#uses=0]
-@.str_644 = external global [8 x i8] ; <[8 x i8]*> [#uses=0]
-@.str_645 = external global [2 x i8] ; <[2 x i8]*> [#uses=0]
-@.str_646 = external global [1 x i8] ; <[1 x i8]*> [#uses=0]
-@.str_649 = external global [10 x i8] ; <[10 x i8]*> [#uses=0]
-@.str_654 = external global [2 x i8] ; <[2 x i8]*> [#uses=1]
-@.str_656 = external global [5 x i8] ; <[5 x i8]*> [#uses=0]
-@.str_658 = external global [2 x i8] ; <[2 x i8]*> [#uses=0]
-@.str_660 = external global [2 x i8] ; <[2 x i8]*> [#uses=0]
-@.str_662 = external global [2 x i8] ; <[2 x i8]*> [#uses=0]
-@.str_664 = external global [2 x i8] ; <[2 x i8]*> [#uses=0]
-@.str_666 = external global [6 x i8] ; <[6 x i8]*> [#uses=0]
-@.str_667 = external global [5 x i8] ; <[5 x i8]*> [#uses=0]
-@.str_669 = external global [6 x i8] ; <[6 x i8]*> [#uses=0]
-@.str_670 = external global [20 x i8] ; <[20 x i8]*> [#uses=0]
-@.str_671 = external global [7 x i8] ; <[7 x i8]*> [#uses=0]
-@.str_672 = external global [23 x i8] ; <[23 x i8]*> [#uses=0]
-@.str_674 = external global [6 x i8] ; <[6 x i8]*> [#uses=0]
-@.str_675 = external global [39 x i8] ; <[39 x i8]*> [#uses=0]
-@.str_676 = external global [30 x i8] ; <[30 x i8]*> [#uses=0]
-@.str_680 = external global [5 x i8] ; <[5 x i8]*> [#uses=0]
-@.str_682 = external global [6 x i8] ; <[6 x i8]*> [#uses=0]
-@.str_683 = external global [37 x i8] ; <[37 x i8]*> [#uses=0]
-@.str_684 = external global [40 x i8] ; <[40 x i8]*> [#uses=0]
-@.str_685 = external global [40 x i8] ; <[40 x i8]*> [#uses=0]
-@.str_686 = external global [40 x i8] ; <[40 x i8]*> [#uses=0]
-@.str_687 = external global [40 x i8] ; <[40 x i8]*> [#uses=0]
-@.str_688 = external global [40 x i8] ; <[40 x i8]*> [#uses=0]
-@.str_689 = external global [40 x i8] ; <[40 x i8]*> [#uses=0]
-@.str_690 = external global [40 x i8] ; <[40 x i8]*> [#uses=0]
-@.str_691 = external global [3 x i8] ; <[3 x i8]*> [#uses=0]
-@.str_692 = external global [20 x i8] ; <[20 x i8]*> [#uses=0]
-@.str_694 = external global [5 x i8] ; <[5 x i8]*> [#uses=0]
-@.str_695 = external global [19 x i8] ; <[19 x i8]*> [#uses=0]
-@.str_697 = external global [22 x i8] ; <[22 x i8]*> [#uses=0]
-@.str_698 = external global [28 x i8] ; <[28 x i8]*> [#uses=0]
-@.str_700 = external global [3 x i8] ; <[3 x i8]*> [#uses=0]
-@.str_701 = external global [19 x i8] ; <[19 x i8]*> [#uses=0]
-@.str_702 = external global [26 x i8] ; <[26 x i8]*> [#uses=0]
-@.str_703 = external global [8 x i8] ; <[8 x i8]*> [#uses=0]
-@.str_704 = external global [25 x i8] ; <[25 x i8]*> [#uses=0]
-@.str_707 = external global [4 x i8] ; <[4 x i8]*> [#uses=0]
-@.str_708 = external global [16 x i8] ; <[16 x i8]*> [#uses=0]
-@.str_709 = external global [8 x i8] ; <[8 x i8]*> [#uses=0]
-@.str_710 = external global [20 x i8] ; <[20 x i8]*> [#uses=0]
-@.str_711 = external global [37 x i8] ; <[37 x i8]*> [#uses=0]
-@.str_722 = external global [9 x i8] ; <[9 x i8]*> [#uses=0]
-@.str_723 = external global [34 x i8] ; <[34 x i8]*> [#uses=0]
-@.str_726 = external global [6 x i8] ; <[6 x i8]*> [#uses=0]
-@.str_727 = external global [23 x i8] ; <[23 x i8]*> [#uses=0]
-@.str_728 = external global [10 x i8] ; <[10 x i8]*> [#uses=0]
-@.str_729 = external global [3 x i8] ; <[3 x i8]*> [#uses=0]
-@.str_730 = external global [12 x i8] ; <[12 x i8]*> [#uses=0]
-@.str_732 = external global [5 x i8] ; <[5 x i8]*> [#uses=0]
-@.str_734 = external global [6 x i8] ; <[6 x i8]*> [#uses=0]
-@.str_735 = external global [28 x i8] ; <[28 x i8]*> [#uses=0]
-@.str_736 = external global [61 x i8] ; <[61 x i8]*> [#uses=0]
-@.str_738 = external global [25 x i8] ; <[25 x i8]*> [#uses=0]
-@.str_739 = external global [22 x i8] ; <[22 x i8]*> [#uses=0]
-@.str_740 = external global [8 x i8] ; <[8 x i8]*> [#uses=0]
-@.str_741 = external global [25 x i8] ; <[25 x i8]*> [#uses=0]
-@.str_742 = external global [5 x i8] ; <[5 x i8]*> [#uses=0]
-@.str_743 = external global [22 x i8] ; <[22 x i8]*> [#uses=0]
-@.str_744 = external global [31 x i8] ; <[31 x i8]*> [#uses=0]
-@.str_745 = external global [42 x i8] ; <[42 x i8]*> [#uses=0]
-@.str_747 = external global [7 x i8] ; <[7 x i8]*> [#uses=0]
-@.str_748 = external global [9 x i8] ; <[9 x i8]*> [#uses=0]
-@.str_750 = external global [3 x i8] ; <[3 x i8]*> [#uses=0]
-@"\01text_move.0__" = external global [10 x i8] ; <[10 x i8]*> [#uses=0]
-@"\01new_text.1__" = external global [10 x i8] ; <[10 x i8]*> [#uses=0]
-@.str_1.upgrd.99 = external global [5 x i8] ; <[5 x i8]*> [#uses=0]
-@"\01text_move.2__" = external global [10 x i8] ; <[10 x i8]*> [#uses=0]
-@.str_1.upgrd.100 = external global [15 x i8] ; <[15 x i8]*> [#uses=0]
-@.str_2.upgrd.101 = external global [19 x i8] ; <[19 x i8]*> [#uses=0]
-@.str_3.upgrd.102 = external global [16 x i8] ; <[16 x i8]*> [#uses=0]
-@.str_130.upgrd.103 = external global [5 x i8] ; <[5 x i8]*> [#uses=0]
-@.str_231.upgrd.104 = external global [47 x i8] ; <[47 x i8]*> [#uses=0]
-@.str_3.upgrd.105 = external global [27 x i8] ; <[27 x i8]*> [#uses=0]
-@.str_4.upgrd.106 = external global [27 x i8] ; <[27 x i8]*> [#uses=0]
-@.str_7.upgrd.107 = external global [30 x i8] ; <[30 x i8]*> [#uses=0]
-@"\01hashing_pawns.0__" = external global i32 ; <i32*> [#uses=0]
-@"\01hashing_opening.1__" = external global i32 ; <i32*> [#uses=0]
-@"\01hashing_middle_game.2__" = external global i32 ; <i32*> [#uses=0]
-@"\01hashing_end_game.3__" = external global i32 ; <i32*> [#uses=0]
-@"\01last_wtm.4__" = external global i32 ; <i32*> [#uses=0]
-@.str_1.upgrd.108 = external global [37 x i8] ; <[37 x i8]*> [#uses=0]
-@.str_1.upgrd.109 = external global [8 x i8] ; <[8 x i8]*> [#uses=0]
-@.str_1.upgrd.110 = external global [19 x i8] ; <[19 x i8]*> [#uses=0]
-@.str_2.upgrd.111 = external global [16 x i8] ; <[16 x i8]*> [#uses=0]
-@.str_3.upgrd.112 = external global [30 x i8] ; <[30 x i8]*> [#uses=0]
-@.str_4.upgrd.113 = external global [30 x i8] ; <[30 x i8]*> [#uses=0]
-@.str_5.upgrd.114 = external global [10 x i8] ; <[10 x i8]*> [#uses=0]
-@.str_6.upgrd.115 = external global [25 x i8] ; <[25 x i8]*> [#uses=0]
-@.str_7.upgrd.116 = external global [14 x i8] ; <[14 x i8]*> [#uses=0]
-@.str_934 = external global [8 x i8] ; <[8 x i8]*> [#uses=0]
-@.str_1.upgrd.117 = external global [28 x i8] ; <[28 x i8]*> [#uses=0]
-@.str_3.upgrd.118 = external global [9 x i8] ; <[9 x i8]*> [#uses=0]
-@.str_1.upgrd.119 = external global [38 x i8] ; <[38 x i8]*> [#uses=0]
-@.str_2.upgrd.120 = external global [7 x i8] ; <[7 x i8]*> [#uses=0]
-@.str_4.upgrd.121 = external global [28 x i8] ; <[28 x i8]*> [#uses=0]
-@.str_5.upgrd.122 = external global [40 x i8] ; <[40 x i8]*> [#uses=0]
-@.str_1.upgrd.123 = external global [11 x i8] ; <[11 x i8]*> [#uses=0]
-@.str_2.upgrd.124 = external global [27 x i8] ; <[27 x i8]*> [#uses=0]
-@.str_7.upgrd.125 = external global [29 x i8] ; <[29 x i8]*> [#uses=0]
-@.str_10.upgrd.126 = external global [34 x i8] ; <[34 x i8]*> [#uses=0]
-@.str_1141 = external global [6 x i8] ; <[6 x i8]*> [#uses=0]
-@.str_12.upgrd.127 = external global [6 x i8] ; <[6 x i8]*> [#uses=0]
-@.str_14.upgrd.128 = external global [20 x i8] ; <[20 x i8]*> [#uses=0]
-@.str_1542 = external global [17 x i8] ; <[17 x i8]*> [#uses=0]
-@.ctor_1.upgrd.129 = external global [25 x i8] ; <[25 x i8]*> [#uses=0]
-@.str_1.upgrd.130 = external global [33 x i8] ; <[33 x i8]*> [#uses=0]
-@.str_3.upgrd.131 = external global [21 x i8] ; <[21 x i8]*> [#uses=0]
-@.str_4.upgrd.132 = external global [25 x i8] ; <[25 x i8]*> [#uses=0]
-@.str_5.upgrd.133 = external global [26 x i8] ; <[26 x i8]*> [#uses=0]
-@.str_6.upgrd.134 = external global [55 x i8] ; <[55 x i8]*> [#uses=0]
-@.str_143.upgrd.135 = external global [33 x i8] ; <[33 x i8]*> [#uses=0]
-@.str_2.upgrd.136 = external global [15 x i8] ; <[15 x i8]*> [#uses=0]
-@.str_1.upgrd.137 = external global [22 x i8] ; <[22 x i8]*> [#uses=0]
-@.str_2.upgrd.138 = external global [51 x i8] ; <[51 x i8]*> [#uses=0]
-@bit_move44 = external global i64 ; <i64*> [#uses=0]
-@.str_1.upgrd.139 = external global [7 x i8] ; <[7 x i8]*> [#uses=0]
-@.str_248.upgrd.140 = external global [3 x i8] ; <[3 x i8]*> [#uses=0]
-@.str_349.upgrd.141 = external global [3 x i8] ; <[3 x i8]*> [#uses=0]
-@.ctor_1.upgrd.142 = external global [46 x i8] ; <[46 x i8]*> [#uses=0]
-@.str_5.upgrd.143 = external global [43 x i8] ; <[43 x i8]*> [#uses=0]
-@.str_6.upgrd.144 = external global [9 x i8] ; <[9 x i8]*> [#uses=0]
-@.str_751 = external global [5 x i8] ; <[5 x i8]*> [#uses=0]
-@.str_852 = external global [3 x i8] ; <[3 x i8]*> [#uses=0]
-@.str_9.upgrd.145 = external global [42 x i8] ; <[42 x i8]*> [#uses=0]
-@.str_10.upgrd.146 = external global [41 x i8] ; <[41 x i8]*> [#uses=0]
-@"\01out.0__" = external global [10 x i8] ; <[10 x i8]*> [#uses=0]
-@.str_1153 = external global [6 x i8] ; <[6 x i8]*> [#uses=0]
-@.str_12.upgrd.147 = external global [9 x i8] ; <[9 x i8]*> [#uses=0]
-@.str_13.upgrd.148 = external global [9 x i8] ; <[9 x i8]*> [#uses=0]
-@.str_14.upgrd.149 = external global [8 x i8] ; <[8 x i8]*> [#uses=0]
-@.str_15.upgrd.150 = external global [8 x i8] ; <[8 x i8]*> [#uses=0]
-@.str_16.upgrd.151 = external global [10 x i8] ; <[10 x i8]*> [#uses=0]
-@.str_17.upgrd.152 = external global [10 x i8] ; <[10 x i8]*> [#uses=0]
-@"\01out.1__" = external global [10 x i8] ; <[10 x i8]*> [#uses=0]
-@.str_18.upgrd.153 = external global [6 x i8] ; <[6 x i8]*> [#uses=0]
-@.str_19.upgrd.154 = external global [8 x i8] ; <[8 x i8]*> [#uses=0]
-@.str_20.upgrd.155 = external global [8 x i8] ; <[8 x i8]*> [#uses=0]
-@.str_21.upgrd.156 = external global [5 x i8] ; <[5 x i8]*> [#uses=0]
-@.str_2254 = external global [6 x i8] ; <[6 x i8]*> [#uses=0]
-@.str_2355 = external global [8 x i8] ; <[8 x i8]*> [#uses=0]
-@.str_24.upgrd.157 = external global [9 x i8] ; <[9 x i8]*> [#uses=0]
-@.str_25.upgrd.158 = external global [45 x i8] ; <[45 x i8]*> [#uses=0]
-@.str_26.upgrd.159 = external global [24 x i8] ; <[24 x i8]*> [#uses=0]
-@"\01out.2__" = external global [10 x i8] ; <[10 x i8]*> [#uses=0]
-@.str_31.upgrd.160 = external global [7 x i8] ; <[7 x i8]*> [#uses=0]
-@"\01out.3__" = external global [10 x i8] ; <[10 x i8]*> [#uses=0]
-@"\01out.4__" = external global [10 x i8] ; <[10 x i8]*> [#uses=0]
-@.str_3457 = external global [5 x i8] ; <[5 x i8]*> [#uses=0]
-@.str_35.upgrd.161 = external global [5 x i8] ; <[5 x i8]*> [#uses=0]
-@.str_36.upgrd.162 = external global [10 x i8] ; <[10 x i8]*> [#uses=0]
-@.str_37.upgrd.163 = external global [40 x i8] ; <[40 x i8]*> [#uses=0]
-@.str_41.upgrd.164 = external global [10 x i8] ; <[10 x i8]*> [#uses=0]
-@.str_45.upgrd.165 = external global [55 x i8] ; <[55 x i8]*> [#uses=0]
-@"\01save_book_selection_width.5__" = external global i32 ; <i32*> [#uses=0]
-@"\01save_book_random.6__" = external global i32 ; <i32*> [#uses=0]
-@"\01save_whisper.7__" = external global i32 ; <i32*> [#uses=0]
-@"\01save_kibitz.8__" = external global i32 ; <i32*> [#uses=0]
-@"\01save_channel.9__" = external global i32 ; <i32*> [#uses=0]
-@"\01save_resign.10" = external global i32 ; <i32*> [#uses=0]
-@"\01save_resign_count.11" = external global i32 ; <i32*> [#uses=0]
-@"\01save_draw_count.12" = external global i32 ; <i32*> [#uses=0]
-@"\01save_learning.13" = external global i32 ; <i32*> [#uses=0]
-@.str_49.upgrd.166 = external global [5 x i8] ; <[5 x i8]*> [#uses=0]
-@.str_51.upgrd.167 = external global [44 x i8] ; <[44 x i8]*> [#uses=0]
-@"\01x.14" = external global [55 x i32] ; <[55 x i32]*> [#uses=0]
-@"\01init.15.b" = external global i1 ; <i1*> [#uses=0]
-@"\01y.16" = external global [55 x i32] ; <[55 x i32]*> [#uses=0]
-@"\01j.17" = external global i32 ; <i32*> [#uses=0]
-@"\01k.18" = external global i32 ; <i32*> [#uses=0]
-@.str_52.upgrd.168 = external global [50 x i8] ; <[50 x i8]*> [#uses=0]
-@"\01text.19" = external global [128 x i8] ; <[128 x i8]*> [#uses=0]
-@.str_5659 = external global [12 x i8] ; <[12 x i8]*> [#uses=0]
-@.str_62.upgrd.169 = external global [14 x i8] ; <[14 x i8]*> [#uses=0]
-@.str_6662 = external global [5 x i8] ; <[5 x i8]*> [#uses=0]
-@.str_68.upgrd.170 = external global [22 x i8] ; <[22 x i8]*> [#uses=0]
-@.str_69.upgrd.171 = external global [16 x i8] ; <[16 x i8]*> [#uses=0]
-@.str_70 = external global [16 x i8] ; <[16 x i8]*> [#uses=0]
-@.str_72.upgrd.172 = external global [35 x i8] ; <[35 x i8]*> [#uses=0]
-@.str_74.upgrd.173 = external global [23 x i8] ; <[23 x i8]*> [#uses=0]
-@.str_76 = external global [24 x i8] ; <[24 x i8]*> [#uses=0]
-@.str_78 = external global [57 x i8] ; <[57 x i8]*> [#uses=0]
-@.str_80 = external global [45 x i8] ; <[45 x i8]*> [#uses=0]
-@.str_82 = external global [22 x i8] ; <[22 x i8]*> [#uses=0]
-@.str_84.upgrd.174 = external global [10 x i8] ; <[10 x i8]*> [#uses=0]
-@.str_86.upgrd.175 = external global [19 x i8] ; <[19 x i8]*> [#uses=0]
-@.str_88 = external global [7 x i8] ; <[7 x i8]*> [#uses=0]
-@.str_90.upgrd.176 = external global [31 x i8] ; <[31 x i8]*> [#uses=0]
-@.str_92.upgrd.177 = external global [19 x i8] ; <[19 x i8]*> [#uses=0]
-@.str_94.upgrd.178 = external global [30 x i8] ; <[30 x i8]*> [#uses=0]
-@.str_95.upgrd.179 = external global [48 x i8] ; <[48 x i8]*> [#uses=0]
-@.str_97.upgrd.180 = external global [18 x i8] ; <[18 x i8]*> [#uses=0]
-@.str_98.upgrd.181 = external global [36 x i8] ; <[36 x i8]*> [#uses=0]
-@.str_100.upgrd.182 = external global [22 x i8] ; <[22 x i8]*> [#uses=0]
-@.str_163.upgrd.183 = external global [38 x i8] ; <[38 x i8]*> [#uses=0]
-@.str_2.upgrd.184 = external global [38 x i8] ; <[38 x i8]*> [#uses=0]
-@.str_3.upgrd.185 = external global [50 x i8] ; <[50 x i8]*> [#uses=0]
-@.str_4.upgrd.186 = external global [50 x i8] ; <[50 x i8]*> [#uses=0]
-@.str_5.upgrd.187 = external global [51 x i8] ; <[51 x i8]*> [#uses=0]
-@.str_6.upgrd.188 = external global [30 x i8] ; <[30 x i8]*> [#uses=0]
-@.str_7.upgrd.189 = external global [28 x i8] ; <[28 x i8]*> [#uses=0]
-@.str_8.upgrd.190 = external global [33 x i8] ; <[33 x i8]*> [#uses=0]
-@.str_9.upgrd.191 = external global [54 x i8] ; <[54 x i8]*> [#uses=0]
-@.str_10.upgrd.192 = external global [47 x i8] ; <[47 x i8]*> [#uses=0]
-@.str_11.upgrd.193 = external global [46 x i8] ; <[46 x i8]*> [#uses=0]
-@.str_12.upgrd.194 = external global [47 x i8] ; <[47 x i8]*> [#uses=0]
-@.str_13.upgrd.195 = external global [46 x i8] ; <[46 x i8]*> [#uses=0]
-@.str_14.upgrd.196 = external global [35 x i8] ; <[35 x i8]*> [#uses=0]
-@.str_15.upgrd.197 = external global [36 x i8] ; <[36 x i8]*> [#uses=0]
-@.str_16.upgrd.198 = external global [35 x i8] ; <[35 x i8]*> [#uses=0]
-@.str_17.upgrd.199 = external global [36 x i8] ; <[36 x i8]*> [#uses=0]
-@.str_18.upgrd.200 = external global [35 x i8] ; <[35 x i8]*> [#uses=0]
-@.str_19.upgrd.201 = external global [41 x i8] ; <[41 x i8]*> [#uses=0]
-@.str_20.upgrd.202 = external global [36 x i8] ; <[36 x i8]*> [#uses=0]
-@.str_22.upgrd.203 = external global [35 x i8] ; <[35 x i8]*> [#uses=0]
-@.str_23.upgrd.204 = external global [39 x i8] ; <[39 x i8]*> [#uses=0]
-@.str_24.upgrd.205 = external global [36 x i8] ; <[36 x i8]*> [#uses=0]
-@.str_26.upgrd.206 = external global [35 x i8] ; <[35 x i8]*> [#uses=0]
-@.str_27.upgrd.207 = external global [40 x i8] ; <[40 x i8]*> [#uses=0]
-@.str_28.upgrd.208 = external global [36 x i8] ; <[36 x i8]*> [#uses=0]
-@.str_30.upgrd.209 = external global [35 x i8] ; <[35 x i8]*> [#uses=0]
-@.str_31.upgrd.210 = external global [40 x i8] ; <[40 x i8]*> [#uses=0]
-@.str_32.upgrd.211 = external global [36 x i8] ; <[36 x i8]*> [#uses=0]
-@.str_33.upgrd.212 = external global [40 x i8] ; <[40 x i8]*> [#uses=0]
-@.str_34.upgrd.213 = external global [39 x i8] ; <[39 x i8]*> [#uses=0]
-@.str_3565 = external global [40 x i8] ; <[40 x i8]*> [#uses=0]
-@.str_36.upgrd.214 = external global [39 x i8] ; <[39 x i8]*> [#uses=0]
-@.str_37.upgrd.215 = external global [41 x i8] ; <[41 x i8]*> [#uses=0]
-@.str_38.upgrd.216 = external global [41 x i8] ; <[41 x i8]*> [#uses=0]
-@.str_39 = external global [39 x i8] ; <[39 x i8]*> [#uses=0]
-@.str_40 = external global [39 x i8] ; <[39 x i8]*> [#uses=0]
-@.str_41.upgrd.217 = external global [40 x i8] ; <[40 x i8]*> [#uses=0]
-@.str_42.upgrd.218 = external global [39 x i8] ; <[39 x i8]*> [#uses=0]
-@.str_43.upgrd.219 = external global [41 x i8] ; <[41 x i8]*> [#uses=0]
-@.str_44.upgrd.220 = external global [41 x i8] ; <[41 x i8]*> [#uses=0]
-@.str_45.upgrd.221 = external global [39 x i8] ; <[39 x i8]*> [#uses=0]
-@.str_46.upgrd.222 = external global [35 x i8] ; <[35 x i8]*> [#uses=0]
-@.str_47.upgrd.223 = external global [50 x i8] ; <[50 x i8]*> [#uses=0]
-@.str_48.upgrd.224 = external global [26 x i8] ; <[26 x i8]*> [#uses=0]
-@.str_49.upgrd.225 = external global [31 x i8] ; <[31 x i8]*> [#uses=0]
-@.str_50.upgrd.226 = external global [15 x i8] ; <[15 x i8]*> [#uses=0]
-@.str_51.upgrd.227 = external global [6 x i8] ; <[6 x i8]*> [#uses=0]
-@.str_52.upgrd.228 = external global [24 x i8] ; <[24 x i8]*> [#uses=0]
-@.str_53.upgrd.229 = external global [9 x i8] ; <[9 x i8]*> [#uses=0]
-
-declare i64 @AttacksFrom(i32, i32)
-
-declare i64 @AttacksTo(i32)
-
-declare i32 @Attacked(i32, i32)
-
-declare i64 @Mask(i32)
-
-declare i32 @PopCnt(i64)
-
-declare i32 @FirstOne(i64)
-
-declare i32 @LastOne(i64)
-
-declare i32 @DrawScore()
-
-declare i32 @Drawn(i32)
-
-declare i8* @strchr(i8*, i32)
-
-declare i32 @strcmp(i8*, i8*)
-
-declare i32 @strlen(i8*)
-
-declare i32 @printf(i8*, ...)
-
-declare void @Edit()
-
-declare void @llvm.memcpy(i8*, i8*, i32, i32)
-
-declare i32 @fflush(%struct.__sFILE*)
-
-declare i32 @Read(i32, i8*)
-
-declare i32 @ReadParse(i8*, i8**, i8*)
-
-declare void @DisplayChessBoard(%struct.__sFILE*, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i32, i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8)
-
-declare void @SetChessBitBoards(%typedef.SEARCH_POSITION*)
-
-declare i32 @EnPrise(i32, i32)
-
-declare i64 @SwapXray(i64, i32, i32)
-
-declare i32 @Evaluate(i32, i32, i32, i32)
-
-declare i32 @EvaluateMate()
-
-declare i32 @EvaluatePawns()
-
-declare i32 @EvaluatePassedPawns()
-
-declare i32 @EvaluatePassedPawnRaces(i32)
-
-declare i32 @Swap(i32, i32, i32)
-
-declare i32 @EvaluateDevelopment(i32)
-
-declare i32 @EvaluateDraws()
-
-declare i32 @HasOpposition(i32, i32, i32)
-
-declare void @HistoryBest(i32, i32, i32)
-
-declare void @HistoryRefutation(i32, i32, i32)
-
-declare i32 @sprintf(i8*, i8*, ...)
-
-declare void @Initialize(i32)
-
-declare void @InitializeZeroMasks()
-
-declare void @InitializeMasks()
-
-declare void @InitializeRandomHash()
-
-declare void @InitializeAttackBoards()
-
-declare void @InitializePawnMasks()
-
-declare void @InitializePieceMasks()
-
-declare void @InitializeChessBoard(%typedef.SEARCH_POSITION*)
-
-declare %struct.__sFILE* @fopen(i8*, i8*)
-
-define i32 @Option() {
-no_exit.53.outer:
- %tmp.4747 = shl i32 7, 3 ; <i32> [#uses=1]
- %tmp.4779 = icmp eq %struct.__sFILE* getelementptr ([0 x %struct.__sFILE]* @__sF, i32 0, i32 1), null ; <i1> [#uses=2]
- br label %no_exit.53
-no_exit.53: ; preds = %else.166, %else.168, %then.360, %no_exit.53.outer
- %file.2.3.3.ph = phi i32 [ 0, %no_exit.53.outer ], [ %inc.551688, %then.360 ], [ %inc.551701, %else.168 ], [ %file.2.3.3.ph, %else.166 ] ; <i32> [#uses=2]
- %nempty.5.3.ph = phi i32 [ 0, %no_exit.53.outer ], [ %nempty.5.3, %then.360 ], [ %nempty.5.3, %else.168 ], [ %nempty.5.3.ph, %else.166 ] ; <i32> [#uses=2]
- %indvar2053.ui = phi i32 [ 0, %no_exit.53.outer ], [ 0, %then.360 ], [ 0, %else.168 ], [ %indvar.next2054, %else.166 ] ; <i32> [#uses=2]
- %indvar2053 = bitcast i32 %indvar2053.ui to i32 ; <i32> [#uses=2]
- %file.2.3.3 = add i32 %indvar2053, %file.2.3.3.ph ; <i32> [#uses=4]
- %nempty.5.3 = add i32 %indvar2053, %nempty.5.3.ph ; <i32> [#uses=3]
- %tmp.4749 = add i32 %file.2.3.3, %tmp.4747 ; <i32> [#uses=1]
- %tmp.4750 = getelementptr %typedef.CHESS_POSITION* @search, i32 0, i32 22, i32 %tmp.4749 ; <i8*> [#uses=3]
- %tmp.4751 = load i8* %tmp.4750 ; <i8> [#uses=1]
- %tmp.4752 = icmp eq i8 %tmp.4751, 0 ; <i1> [#uses=1]
- br i1 %tmp.4752, label %else.166, label %then.357
-then.357: ; preds = %no_exit.53
- %tmp.4755 = icmp eq i32 %nempty.5.3, 0 ; <i1> [#uses=1]
- br i1 %tmp.4755, label %endif.358, label %then.358
-then.358: ; preds = %then.357
- ret i32 0
-endif.358: ; preds = %then.357
- br i1 %tmp.4779, label %else.168, label %then.360
-then.360: ; preds = %endif.358
- %tmp.4791 = load i8* %tmp.4750 ; <i8> [#uses=1]
- %tmp.4792 = sext i8 %tmp.4791 to i32 ; <i32> [#uses=1]
- %tmp.4793 = add i32 %tmp.4792, 7 ; <i32> [#uses=1]
- %tmp.4794 = getelementptr [15 x i8]* null, i32 0, i32 %tmp.4793 ; <i8*> [#uses=1]
- %tmp.4795 = load i8* %tmp.4794 ; <i8> [#uses=1]
- %tmp.4796 = sext i8 %tmp.4795 to i32 ; <i32> [#uses=1]
- %tmp.4781 = call i32 (%struct.__sFILE*, i8*, ...)* @fprintf( %struct.__sFILE* getelementptr ([0 x %struct.__sFILE]* @__sF, i32 0, i32 1), i8* getelementptr ([3 x i8]* @.str_36, i32 0, i32 0), i32 %tmp.4796 ) ; <i32> [#uses=0]
- %inc.551688 = add i32 %file.2.3.3, 1 ; <i32> [#uses=2]
- %tmp.47421699 = icmp slt i32 %inc.551688, 8 ; <i1> [#uses=1]
- br i1 %tmp.47421699, label %no_exit.53, label %loopexit.56
-else.168: ; preds = %endif.358
- %tmp.4799 = call i32 @strlen( i8* getelementptr ([80 x i8]* @initial_position, i32 0, i32 0) ) ; <i32> [#uses=2]
- %gep.upgrd.230 = zext i32 %tmp.4799 to i64 ; <i64> [#uses=1]
- %tmp.4802 = getelementptr [80 x i8]* @initial_position, i32 0, i64 %gep.upgrd.230 ; <i8*> [#uses=1]
- %tmp.4811 = load i8* %tmp.4750 ; <i8> [#uses=1]
- %tmp.4812 = sext i8 %tmp.4811 to i32 ; <i32> [#uses=1]
- %tmp.4813 = add i32 %tmp.4812, 7 ; <i32> [#uses=1]
- %tmp.4814 = getelementptr [15 x i8]* null, i32 0, i32 %tmp.4813 ; <i8*> [#uses=1]
- %tmp.4815 = load i8* %tmp.4814 ; <i8> [#uses=1]
- store i8 %tmp.4815, i8* %tmp.4802
- %tmp.4802.sum = add i32 %tmp.4799, 1 ; <i32> [#uses=1]
- %gep.upgrd.231 = zext i32 %tmp.4802.sum to i64 ; <i64> [#uses=1]
- %tmp.4802.end = getelementptr [80 x i8]* @initial_position, i32 0, i64 %gep.upgrd.231 ; <i8*> [#uses=1]
- store i8 0, i8* %tmp.4802.end
- %inc.551701 = add i32 %file.2.3.3, 1 ; <i32> [#uses=2]
- %tmp.47421703 = icmp slt i32 %inc.551701, 8 ; <i1> [#uses=1]
- br i1 %tmp.47421703, label %no_exit.53, label %loopexit.56
-else.166: ; preds = %no_exit.53
- %inc.55 = add i32 %file.2.3.3, 1 ; <i32> [#uses=1]
- %tmp.47421705 = icmp slt i32 %inc.55, 8 ; <i1> [#uses=1]
- %indvar.next2054 = add i32 %indvar2053.ui, 1 ; <i32> [#uses=1]
- br i1 %tmp.47421705, label %no_exit.53, label %loopexit.56
-loopexit.56: ; preds = %else.166, %else.168, %then.360
- br i1 %tmp.4779, label %else.169, label %then.361
-then.361: ; preds = %loopexit.56
- %tmp.4822 = call i32 @fwrite( i8* getelementptr ([2 x i8]* @.str_654, i32 0, i32 0), i32 1, i32 1, %struct.__sFILE* getelementptr ([0 x %struct.__sFILE]* @__sF, i32 0, i32 1) ) ; <i32> [#uses=0]
- %dec.101707 = add i32 7, -1 ; <i32> [#uses=1]
- %tmp.47391709 = icmp sgt i32 %dec.101707, -1 ; <i1> [#uses=0]
- ret i32 0
-else.169: ; preds = %loopexit.56
- %tmp.4827 = call i32 @strlen( i8* getelementptr ([80 x i8]* @initial_position, i32 0, i32 0) ) ; <i32> [#uses=2]
- %gep.upgrd.232 = zext i32 %tmp.4827 to i64 ; <i64> [#uses=1]
- %tmp.4830 = getelementptr [80 x i8]* @initial_position, i32 0, i64 %gep.upgrd.232 ; <i8*> [#uses=1]
- store i8 47, i8* %tmp.4830
- %tmp.4830.sum = add i32 %tmp.4827, 1 ; <i32> [#uses=1]
- %gep.upgrd.233 = zext i32 %tmp.4830.sum to i64 ; <i64> [#uses=1]
- %tmp.4830.end = getelementptr [80 x i8]* @initial_position, i32 0, i64 %gep.upgrd.233 ; <i8*> [#uses=1]
- store i8 0, i8* %tmp.4830.end
- %dec.10 = add i32 7, -1 ; <i32> [#uses=1]
- %tmp.47391711 = icmp sgt i32 %dec.10, -1 ; <i1> [#uses=0]
- ret i32 0
-}
-
-declare void @InitializeHashTables()
-
-declare i32 @InitializeFindAttacks(i32, i32, i32)
-
-declare void @SetBoard(i32, i8**, i32)
-
-declare i32 @KingPawnSquare(i32, i32, i32, i32)
-
-declare i64 @Random64()
-
-declare i32 @Random32()
-
-declare i8* @strcpy(i8*, i8*)
-
-declare i32 @InputMove(i8*, i32, i32, i32, i32)
-
-declare i32 @InputMoveICS(i8*, i32, i32, i32, i32)
-
-declare i32* @GenerateCaptures(i32, i32, i32*)
-
-declare i32* @GenerateNonCaptures(i32, i32, i32*)
-
-declare void @MakeMove(i32, i32, i32)
-
-declare void @UnMakeMove(i32, i32, i32)
-
-declare void @Interrupt(i32)
-
-declare i32 @GetTime(i32)
-
-declare i8* @DisplayTime(i32)
-
-declare i8* @OutputMoveICS(i32*)
-
-declare void @Delay(i32)
-
-declare i32 @fprintf(%struct.__sFILE*, i8*, ...)
-
-declare void @SignalInterrupt(i32)
-
-declare void (i32)* @signal(i32, void (i32)*)
-
-declare i32 @Iterate(i32, i32, i32)
-
-declare void @PreEvaluate(i32)
-
-declare void @RootMoveList(i32)
-
-declare i8* @OutputMove(i32*, i32, i32)
-
-declare void @TimeSet(i32)
-
-declare void @StorePV(i32, i32)
-
-declare i32 @SearchRoot(i32, i32, i32, i32)
-
-declare void @Whisper(i32, i32, i32, i32, i32, i32, i8*)
-
-declare i8* @DisplayEvaluation(i32)
-
-declare i32 @LookUp(i32, i32, i32, i32*, i32*)
-
-declare i8* @strstr(i8*, i8*)
-
-declare i32 @main(i32, i8**)
-
-declare void @__main()
-
-declare i32 @atoi(i8*)
-
-declare void @NewGame(i32)
-
-declare i32 @Ponder(i32)
-
-declare i32 @fseek(%struct.__sFILE*, i32, i32)
-
-declare void @MakeMoveRoot(i32, i32)
-
-declare i32 @RepetitionDraw(i32)
-
-declare i8* @Reverse()
-
-declare i8* @Normal()
-
-declare void @TimeAdjust(i32, i32)
-
-declare void @ValidatePosition(i32, i32, i8*)
-
-declare i32 @ValidMove(i32, i32, i32)
-
-declare i32* @GenerateCheckEvasions(i32, i32, i32*)
-
-declare i64 @InterposeSquares(i32, i32, i32)
-
-declare i32 @PinnedOnKing(i32, i32)
-
-declare i32 @NextMove(i32, i32)
-
-declare i32 @NextEvasion(i32, i32)
-
-declare i32 @NextRootMove(i32)
-
-declare i32 @TimeCheck(i32)
-
-declare i32 @strncmp(i8*, i8*, i32)
-
-declare void @exit(i32)
-
-declare i32 @OptionMatch(i8*, i8*)
-
-declare i32 @fclose(%struct.__sFILE*)
-
-declare i32 @ParseTime(i8*)
-
-declare i8* @DisplayHHMM(i32)
-
-declare void @DisplayPieceBoards(i32*, i32*)
-
-declare i32 @fscanf(%struct.__sFILE*, i8*, ...)
-
-declare i32 @feof(%struct.__sFILE*)
-
-declare i8* @fgets(i8*, i32, %struct.__sFILE*)
-
-declare i32 @remove(i8*)
-
-declare i32 @__tolower(i32)
-
-declare i32 @clock()
-
-declare void @OptionPerft(i32, i32, i32)
-
-declare void @Phase()
-
-declare i32 @ReadNextMove(i8*, i32, i32)
-
-declare i32 @time(i32*)
-
-declare %struct.tm* @localtime(i32*)
-
-declare i8* @gets(i8*)
-
-declare i32 @OutputGood(i8*, i32, i32)
-
-declare i32 @CheckInput()
-
-declare void @ClearHashTables()
-
-declare i32 @Quiesce(i32, i32, i32, i32)
-
-declare void @SearchTrace(i32, i32, i32, i32, i32, i8*, i32)
-
-declare i32 @RepetitionCheck(i32, i32)
-
-declare void @ResignOrDraw(i32, i32)
-
-declare i32 @Search(i32, i32, i32, i32, i32, i32)
-
-declare void @StoreRefutation(i32, i32, i32, i32)
-
-declare void @StoreBest(i32, i32, i32, i32, i32)
-
-declare void @SearchOutput(i32, i32)
-
-declare i32 @strspn(i8*, i8*)
-
-declare i32 @isatty(i32)
-
-declare i32 @fileno(%struct.__sFILE*)
-
-declare void @llvm.memset(i8*, i8, i32, i32)
-
-declare i32 @select(i32, %struct.fd_set*, %struct.fd_set*, %struct.fd_set*, %struct.timeval*)
-
-declare void @DisplayBitBoard(i64)
-
-declare i8* @DisplayEvaluationWhisper(i32)
-
-declare i8* @DisplayTimeWhisper(i32)
-
-declare void @Display64bitWord(i64)
-
-declare void @Display2BitBoards(i64, i64)
-
-declare void @DisplayChessMove(i8*, i32)
-
-declare void @llvm.memmove(i8*, i8*, i32, i32)
-
-declare void @ReadClear()
-
-declare i8* @strtok(i8*, i8*)
-
-declare i32 @SpecReadRaw()
-
-declare i32 @read(i32, i8*, i32)
-
-declare i32* @__error()
-
-declare i32 @ReadChessMove(%struct.__sFILE*, i32, i32)
-
-declare i64 @ValidateComputeBishopAttacks(i32)
-
-declare i64 @ValidateComputeRookAttacks(i32)
-
-declare i8* @memchr(i8*, i32, i32)
-
-declare i32 @fwrite(i8*, i32, i32, %struct.__sFILE*)
diff --git a/release_23/test/Transforms/LoopUnswitch/2006-02-22-UnswitchCrash.ll b/release_23/test/Transforms/LoopUnswitch/2006-02-22-UnswitchCrash.ll
deleted file mode 100644
index 916cba20b529..000000000000
--- a/release_23/test/Transforms/LoopUnswitch/2006-02-22-UnswitchCrash.ll
+++ /dev/null
@@ -1,32 +0,0 @@
-; RUN: llvm-as < %s | opt -loop-unswitch -disable-output
-
-define void @sort_Eq(i32* %S2) {
-entry:
- br i1 false, label %list_Length.exit, label %cond_true.i
-cond_true.i: ; preds = %entry
- ret void
-list_Length.exit: ; preds = %entry
- br i1 false, label %list_Length.exit9, label %cond_true.i5
-cond_true.i5: ; preds = %list_Length.exit
- ret void
-list_Length.exit9: ; preds = %list_Length.exit
- br i1 false, label %bb78, label %return
-bb44: ; preds = %bb78, %cond_next68
- br i1 %tmp49.not, label %bb62, label %bb62.loopexit
-bb62.loopexit: ; preds = %bb44
- br label %bb62
-bb62: ; preds = %bb62.loopexit, %bb44
- br i1 false, label %return.loopexit, label %cond_next68
-cond_next68: ; preds = %bb62
- br i1 false, label %return.loopexit, label %bb44
-bb78: ; preds = %list_Length.exit9
- %tmp49.not = icmp eq i32* %S2, null ; <i1> [#uses=1]
- br label %bb44
-return.loopexit: ; preds = %cond_next68, %bb62
- %retval.0.ph = phi i32 [ 1, %cond_next68 ], [ 0, %bb62 ] ; <i32> [#uses=1]
- br label %return
-return: ; preds = %return.loopexit, %list_Length.exit9
- %retval.0 = phi i32 [ 0, %list_Length.exit9 ], [ %retval.0.ph, %return.loopexit ] ; <i32> [#uses=0]
- ret void
-}
-
diff --git a/release_23/test/Transforms/LoopUnswitch/2006-06-13-SingleEntryPHI.ll b/release_23/test/Transforms/LoopUnswitch/2006-06-13-SingleEntryPHI.ll
deleted file mode 100644
index 60e464f3acb6..000000000000
--- a/release_23/test/Transforms/LoopUnswitch/2006-06-13-SingleEntryPHI.ll
+++ /dev/null
@@ -1,35 +0,0 @@
-; RUN: llvm-as < %s | opt -loop-unswitch -disable-output
-
- %struct.BLEND_MAP = type { i16, i16, i16, i32, %struct.BLEND_MAP_ENTRY* }
- %struct.BLEND_MAP_ENTRY = type { float, i8, { [5 x float], [4 x i8] } }
- %struct.TPATTERN = type { i16, i16, i16, i32, float, float, float, %struct.WARP*, %struct.TPATTERN*, %struct.BLEND_MAP*, { %struct.anon, [4 x i8] } }
- %struct.TURB = type { i16, %struct.WARP*, [3 x double], i32, float, float }
- %struct.WARP = type { i16, %struct.WARP* }
- %struct.anon = type { float, [3 x double] }
-
-define void @Parse_Pattern() {
-entry:
- br label %bb1096.outer20
-bb671: ; preds = %cond_true1099
- br label %bb1096.outer23
-bb1096.outer20.loopexit: ; preds = %cond_true1099
- %Local_Turb.0.ph24.lcssa = phi %struct.TURB* [ %Local_Turb.0.ph24, %cond_true1099 ] ; <%struct.TURB*> [#uses=1]
- br label %bb1096.outer20
-bb1096.outer20: ; preds = %bb1096.outer20.loopexit, %entry
- %Local_Turb.0.ph22 = phi %struct.TURB* [ undef, %entry ], [ %Local_Turb.0.ph24.lcssa, %bb1096.outer20.loopexit ] ; <%struct.TURB*> [#uses=1]
- %tmp1098 = icmp eq i32 0, 0 ; <i1> [#uses=1]
- br label %bb1096.outer23
-bb1096.outer23: ; preds = %bb1096.outer20, %bb671
- %Local_Turb.0.ph24 = phi %struct.TURB* [ %Local_Turb.0.ph22, %bb1096.outer20 ], [ null, %bb671 ] ; <%struct.TURB*> [#uses=2]
- br label %bb1096
-bb1096: ; preds = %cond_true1099, %bb1096.outer23
- br i1 %tmp1098, label %cond_true1099, label %bb1102
-cond_true1099: ; preds = %bb1096
- switch i32 0, label %bb1096.outer20.loopexit [
- i32 161, label %bb671
- i32 359, label %bb1096
- ]
-bb1102: ; preds = %bb1096
- %Local_Turb.0.ph24.lcssa1 = phi %struct.TURB* [ %Local_Turb.0.ph24, %bb1096 ] ; <%struct.TURB*> [#uses=0]
- ret void
-}
diff --git a/release_23/test/Transforms/LoopUnswitch/2006-06-27-DeadSwitchCase.ll b/release_23/test/Transforms/LoopUnswitch/2006-06-27-DeadSwitchCase.ll
deleted file mode 100644
index 67da9ffad3e2..000000000000
--- a/release_23/test/Transforms/LoopUnswitch/2006-06-27-DeadSwitchCase.ll
+++ /dev/null
@@ -1,25 +0,0 @@
-; RUN: llvm-as < %s | opt -loop-unswitch -disable-output
-
-define void @init_caller_save() {
-entry:
- br label %cond_true78
-cond_next20: ; preds = %cond_true64
- br label %bb31
-bb31: ; preds = %cond_true64, %cond_true64, %cond_next20
- %iftmp.29.1 = phi i32 [ 0, %cond_next20 ], [ 0, %cond_true64 ], [ 0, %cond_true64 ] ; <i32> [#uses=0]
- br label %bb54
-bb54: ; preds = %cond_true78, %bb31
- br i1 false, label %bb75, label %cond_true64
-cond_true64: ; preds = %bb54
- switch i32 %i.0.0, label %cond_next20 [
- i32 17, label %bb31
- i32 18, label %bb31
- ]
-bb75: ; preds = %bb54
- %tmp74.0 = add i32 %i.0.0, 1 ; <i32> [#uses=1]
- br label %cond_true78
-cond_true78: ; preds = %bb75, %entry
- %i.0.0 = phi i32 [ 0, %entry ], [ %tmp74.0, %bb75 ] ; <i32> [#uses=2]
- br label %bb54
-}
-
diff --git a/release_23/test/Transforms/LoopUnswitch/2007-05-09-Unreachable.ll b/release_23/test/Transforms/LoopUnswitch/2007-05-09-Unreachable.ll
deleted file mode 100644
index 08cb9b66bc10..000000000000
--- a/release_23/test/Transforms/LoopUnswitch/2007-05-09-Unreachable.ll
+++ /dev/null
@@ -1,28 +0,0 @@
-; PR1333
-; RUN: llvm-as < %s | opt -loop-unswitch -disable-output
-
-target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64"
-target triple = "i686-pc-linux-gnu"
- %struct.ada__streams__root_stream_type = type { %struct.ada__tags__dispatch_table* }
- %struct.ada__tags__dispatch_table = type { [1 x i8*] }
- %struct.quotes__T173s = type { i8, %struct.quotes__T173s__T174s, [2 x [1 x double]], [2 x i16], i64, i8 }
- %struct.quotes__T173s__T174s = type { i8, i8, i8, i16, i16, [2 x [1 x double]] }
-
-define void @quotes__write_quote() {
-entry:
- %tmp606.i = icmp eq i32 0, 0 ; <i1> [#uses=1]
- br label %bb
-bb: ; preds = %cond_next73, %bb, %entry
- br i1 false, label %bb51, label %bb
-bb51: ; preds = %cond_next73, %bb
- br i1 %tmp606.i, label %quotes__bid_ask_depth_offset_matrices__get_price.exit, label %cond_true.i
-cond_true.i: ; preds = %bb51
- unreachable
-quotes__bid_ask_depth_offset_matrices__get_price.exit: ; preds = %bb51
- br i1 false, label %cond_next73, label %cond_true72
-cond_true72: ; preds = %quotes__bid_ask_depth_offset_matrices__get_price.exit
- unreachable
-cond_next73: ; preds = %quotes__bid_ask_depth_offset_matrices__get_price.exit
- br i1 false, label %bb, label %bb51
-}
-
diff --git a/release_23/test/Transforms/LoopUnswitch/2007-05-09-tl.ll b/release_23/test/Transforms/LoopUnswitch/2007-05-09-tl.ll
deleted file mode 100644
index c987daec7dbc..000000000000
--- a/release_23/test/Transforms/LoopUnswitch/2007-05-09-tl.ll
+++ /dev/null
@@ -1,95 +0,0 @@
-; PR1333
-; RUN: llvm-as < %s | opt -loop-unswitch -disable-output
-
-define void @pp_cxx_expression() {
-entry:
- %tmp6 = lshr i32 0, 24 ; <i32> [#uses=1]
- br label %tailrecurse
-
-tailrecurse: ; preds = %tailrecurse, %tailrecurse, %entry
- switch i32 %tmp6, label %bb96 [
- i32 24, label %bb10
- i32 25, label %bb10
- i32 28, label %bb10
- i32 29, label %bb48
- i32 31, label %bb48
- i32 32, label %bb48
- i32 33, label %bb48
- i32 34, label %bb48
- i32 36, label %bb15
- i32 51, label %bb89
- i32 52, label %bb89
- i32 54, label %bb83
- i32 57, label %bb59
- i32 63, label %bb80
- i32 64, label %bb80
- i32 68, label %bb80
- i32 169, label %bb75
- i32 170, label %bb19
- i32 171, label %bb63
- i32 172, label %bb63
- i32 173, label %bb67
- i32 174, label %bb67
- i32 175, label %bb19
- i32 176, label %bb75
- i32 178, label %bb59
- i32 179, label %bb89
- i32 180, label %bb59
- i32 182, label %bb48
- i32 183, label %bb48
- i32 184, label %bb48
- i32 185, label %bb48
- i32 186, label %bb48
- i32 195, label %bb48
- i32 196, label %bb59
- i32 197, label %bb89
- i32 198, label %bb70
- i32 199, label %bb59
- i32 200, label %bb59
- i32 201, label %bb59
- i32 202, label %bb59
- i32 203, label %bb75
- i32 204, label %bb59
- i32 205, label %tailrecurse
- i32 210, label %tailrecurse
- ]
-
-bb10: ; preds = %tailrecurse, %tailrecurse, %tailrecurse
- ret void
-
-bb15: ; preds = %tailrecurse
- ret void
-
-bb19: ; preds = %tailrecurse, %tailrecurse
- ret void
-
-bb48: ; preds = %tailrecurse, %tailrecurse, %tailrecurse, %tailrecurse, %tailrecurse, %tailrecurse, %tailrecurse, %tailrecurse, %tailrecurse, %tailrecurse, %tailrecurse
- ret void
-
-bb59: ; preds = %tailrecurse, %tailrecurse, %tailrecurse, %tailrecurse, %tailrecurse, %tailrecurse, %tailrecurse, %tailrecurse, %tailrecurse
- ret void
-
-bb63: ; preds = %tailrecurse, %tailrecurse
- ret void
-
-bb67: ; preds = %tailrecurse, %tailrecurse
- ret void
-
-bb70: ; preds = %tailrecurse
- ret void
-
-bb75: ; preds = %tailrecurse, %tailrecurse, %tailrecurse
- ret void
-
-bb80: ; preds = %tailrecurse, %tailrecurse, %tailrecurse
- ret void
-
-bb83: ; preds = %tailrecurse
- ret void
-
-bb89: ; preds = %tailrecurse, %tailrecurse, %tailrecurse, %tailrecurse
- ret void
-
-bb96: ; preds = %tailrecurse
- ret void
-}
diff --git a/release_23/test/Transforms/LoopUnswitch/2007-07-12-ExitDomInfo.ll b/release_23/test/Transforms/LoopUnswitch/2007-07-12-ExitDomInfo.ll
deleted file mode 100644
index c4080c1e3b19..000000000000
--- a/release_23/test/Transforms/LoopUnswitch/2007-07-12-ExitDomInfo.ll
+++ /dev/null
@@ -1,45 +0,0 @@
-; RUN: llvm-as < %s | opt -loop-unswitch -instcombine -disable-output
-
-@str3 = external constant [3 x i8] ; <[3 x i8]*> [#uses=1]
-
-define i32 @stringSearch_Clib(i32 %count) {
-entry:
- %ttmp25 = icmp sgt i32 %count, 0 ; <i1> [#uses=1]
- br i1 %ttmp25, label %bb36.preheader, label %bb44
-
-bb36.preheader: ; preds = %entry
- %ttmp33 = icmp slt i32 0, 250 ; <i1> [#uses=1]
- br label %bb36.outer
-
-bb36.outer: ; preds = %bb41, %bb36.preheader
- br i1 %ttmp33, label %bb.nph, label %bb41
-
-bb.nph: ; preds = %bb36.outer
- %ttmp8 = icmp eq i8* null, null ; <i1> [#uses=1]
- %ttmp6 = icmp eq i8* null, null ; <i1> [#uses=1]
- %tmp31 = call i32 @strcspn( i8* null, i8* getelementptr ([3 x i8]* @str3, i64 0, i64 0) ) ; <i32> [#uses=1]
- br i1 %ttmp8, label %cond_next, label %cond_true
-
-cond_true: ; preds = %bb.nph
- ret i32 0
-
-cond_next: ; preds = %bb.nph
- br i1 %ttmp6, label %cond_next28, label %cond_true20
-
-cond_true20: ; preds = %cond_next
- ret i32 0
-
-cond_next28: ; preds = %cond_next
- %tmp33 = add i32 %tmp31, 0 ; <i32> [#uses=1]
- br label %bb41
-
-bb41: ; preds = %cond_next28, %bb36.outer
- %c.2.lcssa = phi i32 [ 0, %bb36.outer ], [ %tmp33, %cond_next28 ] ; <i32> [#uses=1]
- br i1 false, label %bb36.outer, label %bb44
-
-bb44: ; preds = %bb41, %entry
- %c.01.1 = phi i32 [ 0, %entry ], [ %c.2.lcssa, %bb41 ] ; <i32> [#uses=1]
- ret i32 %c.01.1
-}
-
-declare i32 @strcspn(i8*, i8*)
diff --git a/release_23/test/Transforms/LoopUnswitch/2007-07-13-DomInfo.ll b/release_23/test/Transforms/LoopUnswitch/2007-07-13-DomInfo.ll
deleted file mode 100644
index de3f670f2b95..000000000000
--- a/release_23/test/Transforms/LoopUnswitch/2007-07-13-DomInfo.ll
+++ /dev/null
@@ -1,27 +0,0 @@
-; RUN: llvm-as < %s | opt -loop-unswitch -disable-output
-
-define i32 @main(i32 %argc, i8** %argv) {
-entry:
- %tmp1785365 = icmp ult i32 0, 100 ; <i1> [#uses=1]
- br label %bb
-
-bb: ; preds = %cond_true, %entry
- br i1 false, label %cond_true, label %cond_next
-
-cond_true: ; preds = %bb
- br i1 %tmp1785365, label %bb, label %bb1788
-
-cond_next: ; preds = %bb
- %iftmp.1.0 = select i1 false, i32 0, i32 0 ; <i32> [#uses=1]
- br i1 false, label %cond_true47, label %cond_next74
-
-cond_true47: ; preds = %cond_next
- %tmp53 = urem i32 %iftmp.1.0, 0 ; <i32> [#uses=0]
- ret i32 0
-
-cond_next74: ; preds = %cond_next
- ret i32 0
-
-bb1788: ; preds = %cond_true
- ret i32 0
-}
diff --git a/release_23/test/Transforms/LoopUnswitch/2007-07-18-DomInfo.ll b/release_23/test/Transforms/LoopUnswitch/2007-07-18-DomInfo.ll
deleted file mode 100644
index edd7d1ff58e7..000000000000
--- a/release_23/test/Transforms/LoopUnswitch/2007-07-18-DomInfo.ll
+++ /dev/null
@@ -1,66 +0,0 @@
-; RUN: llvm-as < %s | opt -loop-unswitch -disable-output
-; PR1559
-
-target triple = "i686-pc-linux-gnu"
- %struct.re_pattern_buffer = type { i8*, i32, i32, i32, i8*, i8*, i32, i8 }
-
-define fastcc i32 @byte_regex_compile(i8* %pattern, i32 %size, i32 %syntax, %struct.re_pattern_buffer* %bufp) {
-entry:
- br i1 false, label %bb147, label %cond_next123
-
-cond_next123: ; preds = %entry
- ret i32 0
-
-bb147: ; preds = %entry
- switch i32 0, label %normal_char [
- i32 91, label %bb1734
- i32 92, label %bb5700
- ]
-
-bb1734: ; preds = %bb147
- br label %bb1855.outer.outer
-
-cond_true1831: ; preds = %bb1855.outer
- br i1 %tmp1837, label %cond_next1844, label %cond_true1840
-
-cond_true1840: ; preds = %cond_true1831
- ret i32 0
-
-cond_next1844: ; preds = %cond_true1831
- br i1 false, label %bb1855.outer, label %cond_true1849
-
-cond_true1849: ; preds = %cond_next1844
- br label %bb1855.outer.outer
-
-bb1855.outer.outer: ; preds = %cond_true1849, %bb1734
- %b.10.ph.ph = phi i8* [ null, %cond_true1849 ], [ null, %bb1734 ] ; <i8*> [#uses=1]
- br label %bb1855.outer
-
-bb1855.outer: ; preds = %bb1855.outer.outer, %cond_next1844
- %b.10.ph = phi i8* [ null, %cond_next1844 ], [ %b.10.ph.ph, %bb1855.outer.outer ] ; <i8*> [#uses=1]
- %tmp1837 = icmp eq i8* null, null ; <i1> [#uses=2]
- br i1 false, label %cond_true1831, label %cond_next1915
-
-cond_next1915: ; preds = %cond_next1961, %bb1855.outer
- store i8* null, i8** null
- br i1 %tmp1837, label %cond_next1929, label %cond_true1923
-
-cond_true1923: ; preds = %cond_next1915
- ret i32 0
-
-cond_next1929: ; preds = %cond_next1915
- br i1 false, label %cond_next1961, label %cond_next2009
-
-cond_next1961: ; preds = %cond_next1929
- %tmp1992 = getelementptr i8* %b.10.ph, i32 0 ; <i8*> [#uses=0]
- br label %cond_next1915
-
-cond_next2009: ; preds = %cond_next1929
- ret i32 0
-
-bb5700: ; preds = %bb147
- ret i32 0
-
-normal_char: ; preds = %bb147
- ret i32 0
-}
diff --git a/release_23/test/Transforms/LoopUnswitch/2007-08-01-Dom.ll b/release_23/test/Transforms/LoopUnswitch/2007-08-01-Dom.ll
deleted file mode 100644
index 9673e2e96a96..000000000000
--- a/release_23/test/Transforms/LoopUnswitch/2007-08-01-Dom.ll
+++ /dev/null
@@ -1,30 +0,0 @@
-; RUN: llvm-as < %s | opt -licm -loop-unswitch -disable-output
-; PR 1589
-
- %struct.QBasicAtomic = type { i32 }
-
-define void @_ZNK5QDate9addMonthsEi(%struct.QBasicAtomic* sret %agg.result, %struct.QBasicAtomic* %this, i32 %nmonths) {
-entry:
- br label %cond_true90
-
-bb16: ; preds = %cond_true90
- br i1 false, label %bb93, label %cond_true90
-
-bb45: ; preds = %cond_true90
- br i1 false, label %bb53, label %bb58
-
-bb53: ; preds = %bb45
- br i1 false, label %bb93, label %cond_true90
-
-bb58: ; preds = %bb45
- store i32 0, i32* null, align 4
- br i1 false, label %cond_true90, label %bb93
-
-cond_true90: ; preds = %bb58, %bb53, %bb16, %entry
- %nmonths_addr.016.1 = phi i32 [ %nmonths, %entry ], [ 0, %bb16 ], [ 0, %bb53 ], [ %nmonths_addr.016.1, %bb58 ] ; <i32> [#uses=2]
- %tmp14 = icmp slt i32 %nmonths_addr.016.1, -11 ; <i1> [#uses=1]
- br i1 %tmp14, label %bb16, label %bb45
-
-bb93: ; preds = %bb58, %bb53, %bb16
- ret void
-}
diff --git a/release_23/test/Transforms/LoopUnswitch/2007-08-01-LCSSA.ll b/release_23/test/Transforms/LoopUnswitch/2007-08-01-LCSSA.ll
deleted file mode 100644
index 139cdbe70a05..000000000000
--- a/release_23/test/Transforms/LoopUnswitch/2007-08-01-LCSSA.ll
+++ /dev/null
@@ -1,55 +0,0 @@
-; RUN: llvm-as < %s | opt -loop-unswitch -instcombine -disable-output
- %struct.ClassDef = type { %struct.QByteArray, %struct.QByteArray, %"struct.QList<ArgumentDef>", %"struct.QList<ArgumentDef>", i8, i8, %"struct.QList<ArgumentDef>", %"struct.QList<ArgumentDef>", %"struct.QList<ArgumentDef>", %"struct.QList<ArgumentDef>", %"struct.QList<ArgumentDef>", %"struct.QList<ArgumentDef>", %"struct.QMap<QByteArray,QByteArray>", %"struct.QList<ArgumentDef>", %"struct.QMap<QByteArray,QByteArray>", i32, i32 }
- %struct.FILE = type { i32, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, %struct._IO_marker*, %struct.FILE*, i32, i32, i32, i16, i8, [1 x i8], i8*, i64, i8*, i8*, i8*, i8*, i32, i32, [40 x i8] }
- %struct.Generator = type { %struct.FILE*, %struct.ClassDef*, %"struct.QList<ArgumentDef>", %struct.QByteArray, %"struct.QList<ArgumentDef>" }
- %struct.QBasicAtomic = type { i32 }
- %struct.QByteArray = type { %"struct.QByteArray::Data"* }
- %"struct.QByteArray::Data" = type { %struct.QBasicAtomic, i32, i32, i8*, [1 x i8] }
- %"struct.QList<ArgumentDef>" = type { %"struct.QList<ArgumentDef>::._19" }
- %"struct.QList<ArgumentDef>::._19" = type { %struct.QListData }
- %struct.QListData = type { %"struct.QListData::Data"* }
- %"struct.QListData::Data" = type { %struct.QBasicAtomic, i32, i32, i32, i8, [1 x i8*] }
- %"struct.QMap<QByteArray,QByteArray>" = type { %"struct.QMap<QByteArray,QByteArray>::._56" }
- %"struct.QMap<QByteArray,QByteArray>::._56" = type { %struct.QMapData* }
- %struct.QMapData = type { %struct.QMapData*, [12 x %struct.QMapData*], %struct.QBasicAtomic, i32, i32, i32, i8 }
- %struct._IO_marker = type { %struct._IO_marker*, %struct.FILE*, i32 }
-@.str9 = external constant [1 x i8] ; <[1 x i8]*> [#uses=1]
-
-declare i32 @strcmp(i8*, i8*)
-
-define i32 @_ZN9Generator6strregEPKc(%struct.Generator* %this, i8* %s) {
-entry:
- %s_addr.0 = select i1 false, i8* getelementptr ([1 x i8]* @.str9, i32 0, i32 0), i8* %s ; <i8*> [#uses=2]
- %tmp122 = icmp eq i8* %s_addr.0, null ; <i1> [#uses=1]
- br label %bb184
-
-bb55: ; preds = %bb184
- ret i32 0
-
-bb88: ; preds = %bb184
- br i1 %tmp122, label %bb154, label %bb128
-
-bb128: ; preds = %bb88
- %tmp138 = call i32 @strcmp( i8* null, i8* %s_addr.0 ) ; <i32> [#uses=1]
- %iftmp.37.0.in4 = icmp eq i32 %tmp138, 0 ; <i1> [#uses=1]
- br i1 %iftmp.37.0.in4, label %bb250, label %bb166
-
-bb154: ; preds = %bb88
- br i1 false, label %bb250, label %bb166
-
-bb166: ; preds = %bb154, %bb128
- %tmp175 = add i32 %idx.0, 1 ; <i32> [#uses=1]
- %tmp177 = add i32 %tmp175, 0 ; <i32> [#uses=1]
- %tmp181 = add i32 %tmp177, 0 ; <i32> [#uses=1]
- %tmp183 = add i32 %i33.0, 1 ; <i32> [#uses=1]
- br label %bb184
-
-bb184: ; preds = %bb166, %entry
- %i33.0 = phi i32 [ 0, %entry ], [ %tmp183, %bb166 ] ; <i32> [#uses=2]
- %idx.0 = phi i32 [ 0, %entry ], [ %tmp181, %bb166 ] ; <i32> [#uses=2]
- %tmp49 = icmp slt i32 %i33.0, 0 ; <i1> [#uses=1]
- br i1 %tmp49, label %bb88, label %bb55
-
-bb250: ; preds = %bb154, %bb128
- ret i32 %idx.0
-}
diff --git a/release_23/test/Transforms/LoopUnswitch/2007-10-04-DomFrontier.ll b/release_23/test/Transforms/LoopUnswitch/2007-10-04-DomFrontier.ll
deleted file mode 100644
index b236edcf56c1..000000000000
--- a/release_23/test/Transforms/LoopUnswitch/2007-10-04-DomFrontier.ll
+++ /dev/null
@@ -1,29 +0,0 @@
-; RUN: llvm-as < %s | opt -licm -loop-unroll -disable-output
-
-@resonant = external global i32 ; <i32*> [#uses=2]
-
-define void @weightadj() {
-entry:
- br label %bb
-
-bb: ; preds = %bb158, %entry
- store i32 0, i32* @resonant, align 4
- br i1 false, label %g.exit, label %bb158
-
-g.exit: ; preds = %bb68, %bb
- br i1 false, label %bb68, label %cond_true
-
-cond_true: ; preds = %g.exit
- store i32 1, i32* @resonant, align 4
- br label %bb68
-
-bb68: ; preds = %cond_true, %g.exit
- %tmp71 = icmp slt i32 0, 0 ; <i1> [#uses=1]
- br i1 %tmp71, label %g.exit, label %bb158
-
-bb158: ; preds = %bb68, %bb
- br i1 false, label %bb, label %return
-
-return: ; preds = %bb158
- ret void
-}
diff --git a/release_23/test/Transforms/LoopUnswitch/basictest.ll b/release_23/test/Transforms/LoopUnswitch/basictest.ll
deleted file mode 100644
index eeaf08d7e650..000000000000
--- a/release_23/test/Transforms/LoopUnswitch/basictest.ll
+++ /dev/null
@@ -1,31 +0,0 @@
-; RUN: llvm-as < %s | opt -loop-unswitch -disable-output
-
-define i32 @test(i32* %A, i1 %C) {
-entry:
- br label %no_exit
-no_exit: ; preds = %no_exit.backedge, %entry
- %i.0.0 = phi i32 [ 0, %entry ], [ %i.0.0.be, %no_exit.backedge ] ; <i32> [#uses=3]
- %gep.upgrd.1 = zext i32 %i.0.0 to i64 ; <i64> [#uses=1]
- %tmp.7 = getelementptr i32* %A, i64 %gep.upgrd.1 ; <i32*> [#uses=4]
- %tmp.13 = load i32* %tmp.7 ; <i32> [#uses=2]
- %tmp.14 = add i32 %tmp.13, 1 ; <i32> [#uses=1]
- store i32 %tmp.14, i32* %tmp.7
- br i1 %C, label %then, label %endif
-then: ; preds = %no_exit
- %tmp.29 = load i32* %tmp.7 ; <i32> [#uses=1]
- %tmp.30 = add i32 %tmp.29, 2 ; <i32> [#uses=1]
- store i32 %tmp.30, i32* %tmp.7
- %inc9 = add i32 %i.0.0, 1 ; <i32> [#uses=2]
- %tmp.112 = icmp ult i32 %inc9, 100000 ; <i1> [#uses=1]
- br i1 %tmp.112, label %no_exit.backedge, label %return
-no_exit.backedge: ; preds = %endif, %then
- %i.0.0.be = phi i32 [ %inc9, %then ], [ %inc, %endif ] ; <i32> [#uses=1]
- br label %no_exit
-endif: ; preds = %no_exit
- %inc = add i32 %i.0.0, 1 ; <i32> [#uses=2]
- %tmp.1 = icmp ult i32 %inc, 100000 ; <i1> [#uses=1]
- br i1 %tmp.1, label %no_exit.backedge, label %return
-return: ; preds = %endif, %then
- ret i32 %tmp.13
-}
-
diff --git a/release_23/test/Transforms/LoopUnswitch/dg.exp b/release_23/test/Transforms/LoopUnswitch/dg.exp
deleted file mode 100644
index 879685ca879d..000000000000
--- a/release_23/test/Transforms/LoopUnswitch/dg.exp
+++ /dev/null
@@ -1,3 +0,0 @@
-load_lib llvm.exp
-
-RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
diff --git a/release_23/test/Transforms/LowerInvoke/2003-12-10-Crash.ll b/release_23/test/Transforms/LowerInvoke/2003-12-10-Crash.ll
deleted file mode 100644
index 1e8b880485e4..000000000000
--- a/release_23/test/Transforms/LowerInvoke/2003-12-10-Crash.ll
+++ /dev/null
@@ -1,22 +0,0 @@
-; This testcase was reduced from Shootout-C++/reversefile.cpp by bugpoint
-
-; RUN: llvm-as < %s | opt -lowerinvoke -disable-output
-
-declare void @baz()
-
-declare void @bar()
-
-define void @foo() {
-then:
- invoke void @baz( )
- to label %invoke_cont.0 unwind label %try_catch
-invoke_cont.0: ; preds = %then
- invoke void @bar( )
- to label %try_exit unwind label %try_catch
-try_catch: ; preds = %invoke_cont.0, %then
- %__tmp.0 = phi i32* [ null, %invoke_cont.0 ], [ null, %then ] ; <i32*> [#uses=0]
- ret void
-try_exit: ; preds = %invoke_cont.0
- ret void
-}
-
diff --git a/release_23/test/Transforms/LowerInvoke/2004-02-29-PHICrash.ll b/release_23/test/Transforms/LowerInvoke/2004-02-29-PHICrash.ll
deleted file mode 100644
index 07770136964e..000000000000
--- a/release_23/test/Transforms/LowerInvoke/2004-02-29-PHICrash.ll
+++ /dev/null
@@ -1,15 +0,0 @@
-; RUN: llvm-as < %s | opt -lowerinvoke -enable-correct-eh-support -disable-output
-
-define void @_ZNKSt11__use_cacheISt16__numpunct_cacheIcEEclERKSt6locale() {
-entry:
- br i1 false, label %then, label %UnifiedReturnBlock
-then: ; preds = %entry
- invoke void @_Znwj( )
- to label %UnifiedReturnBlock unwind label %UnifiedReturnBlock
-UnifiedReturnBlock: ; preds = %then, %then, %entry
- %UnifiedRetVal = phi i32* [ null, %entry ], [ null, %then ], [ null, %then ] ; <i32*> [#uses=0]
- ret void
-}
-
-declare void @_Znwj()
-
diff --git a/release_23/test/Transforms/LowerInvoke/2005-08-03-InvokeWithPHI.ll b/release_23/test/Transforms/LowerInvoke/2005-08-03-InvokeWithPHI.ll
deleted file mode 100644
index 10c878537289..000000000000
--- a/release_23/test/Transforms/LowerInvoke/2005-08-03-InvokeWithPHI.ll
+++ /dev/null
@@ -1,17 +0,0 @@
-; RUN: llvm-as < %s | opt -lowerinvoke -enable-correct-eh-support -disable-output
-
-declare void @ll_listnext__listiterPtr()
-
-define void @WorkTask.fn() {
-block0:
- invoke void @ll_listnext__listiterPtr( )
- to label %block9 unwind label %block8_exception_handling
-block8_exception_handling: ; preds = %block0
- ret void
-block9: ; preds = %block0
- %w_2690 = phi { i32, i32 }* [ null, %block0 ] ; <{ i32, i32 }*> [#uses=1]
- %tmp.129 = getelementptr { i32, i32 }* %w_2690, i32 0, i32 1 ; <i32*> [#uses=1]
- %v2769 = load i32* %tmp.129 ; <i32> [#uses=0]
- ret void
-}
-
diff --git a/release_23/test/Transforms/LowerInvoke/2005-08-03-InvokeWithPHIUse.ll b/release_23/test/Transforms/LowerInvoke/2005-08-03-InvokeWithPHIUse.ll
deleted file mode 100644
index 0a8ccbe3e61e..000000000000
--- a/release_23/test/Transforms/LowerInvoke/2005-08-03-InvokeWithPHIUse.ll
+++ /dev/null
@@ -1,15 +0,0 @@
-; RUN: llvm-as < %s | opt -lowerinvoke -enable-correct-eh-support -disable-output
-
-declare fastcc i32 @ll_listnext__listiterPtr()
-
-define fastcc i32 @WorkTask.fn() {
-block0:
- %v2679 = invoke fastcc i32 @ll_listnext__listiterPtr( )
- to label %block9 unwind label %block8_exception_handling ; <i32> [#uses=1]
-block8_exception_handling: ; preds = %block0
- ret i32 0
-block9: ; preds = %block0
- %i_2689 = phi i32 [ %v2679, %block0 ] ; <i32> [#uses=1]
- ret i32 %i_2689
-}
-
diff --git a/release_23/test/Transforms/LowerInvoke/2008-02-14-CritEdgePhiCrash.ll b/release_23/test/Transforms/LowerInvoke/2008-02-14-CritEdgePhiCrash.ll
deleted file mode 100644
index fa8253986533..000000000000
--- a/release_23/test/Transforms/LowerInvoke/2008-02-14-CritEdgePhiCrash.ll
+++ /dev/null
@@ -1,14 +0,0 @@
-; RUN: llvm-as < %s | opt -lowerinvoke -enable-correct-eh-support -disable-output
-; PR2029
-define i32 @main(i32 %argc, i8** %argv) {
-bb470:
- invoke i32 @main(i32 0, i8** null) to label %invcont474 unwind label
-%lpad902
-
-invcont474: ; preds = %bb470
- ret i32 0
-
-lpad902: ; preds = %bb470
- %tmp471.lcssa = phi i8* [ null, %bb470 ] ; <i8*>
- ret i32 0
-}
diff --git a/release_23/test/Transforms/LowerInvoke/basictest.ll b/release_23/test/Transforms/LowerInvoke/basictest.ll
deleted file mode 100644
index a9c19f2790d5..000000000000
--- a/release_23/test/Transforms/LowerInvoke/basictest.ll
+++ /dev/null
@@ -1,30 +0,0 @@
-; RUN: llvm-as < %s | opt -lowerinvoke -disable-output -enable-correct-eh-support
-
-
-define i32 @foo() {
- invoke i32 @foo( )
- to label %Ok unwind label %Crap ; <i32>:1 [#uses=0]
-Ok: ; preds = %0
- invoke i32 @foo( )
- to label %Ok2 unwind label %Crap ; <i32>:2 [#uses=0]
-Ok2: ; preds = %Ok
- ret i32 2
-Crap: ; preds = %Ok, %0
- ret i32 1
-}
-
-define i32 @bar(i32 %blah) {
- br label %doit
-doit: ; preds = %0
- ;; Value live across an unwind edge.
- %B2 = add i32 %blah, 1 ; <i32> [#uses=1]
- invoke i32 @foo( )
- to label %Ok unwind label %Crap ; <i32>:1 [#uses=0]
-Ok: ; preds = %doit
- invoke i32 @foo( )
- to label %Ok2 unwind label %Crap ; <i32>:2 [#uses=0]
-Ok2: ; preds = %Ok
- ret i32 2
-Crap: ; preds = %Ok, %doit
- ret i32 %B2
-}
diff --git a/release_23/test/Transforms/LowerInvoke/dg.exp b/release_23/test/Transforms/LowerInvoke/dg.exp
deleted file mode 100644
index 879685ca879d..000000000000
--- a/release_23/test/Transforms/LowerInvoke/dg.exp
+++ /dev/null
@@ -1,3 +0,0 @@
-load_lib llvm.exp
-
-RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
diff --git a/release_23/test/Transforms/LowerSetJmp/2003-11-05-DominanceProperties.ll b/release_23/test/Transforms/LowerSetJmp/2003-11-05-DominanceProperties.ll
deleted file mode 100644
index 3be2163aa469..000000000000
--- a/release_23/test/Transforms/LowerSetJmp/2003-11-05-DominanceProperties.ll
+++ /dev/null
@@ -1,16 +0,0 @@
-; RUN: llvm-as < %s | opt -lowersetjmp -disable-output
-
- %struct.jmpenv = type { i32, i8 }
-
-declare void @Perl_sv_setpv()
-
-declare i32 @llvm.setjmp(i32*)
-
-define void @perl_call_sv() {
- call void @Perl_sv_setpv( )
- %tmp.335 = getelementptr %struct.jmpenv* null, i64 0, i32 0 ; <i32*> [#uses=1]
- %tmp.336 = call i32 @llvm.setjmp( i32* null ) ; <i32> [#uses=1]
- store i32 %tmp.336, i32* %tmp.335
- ret void
-}
-
diff --git a/release_23/test/Transforms/LowerSetJmp/dg.exp b/release_23/test/Transforms/LowerSetJmp/dg.exp
deleted file mode 100644
index 879685ca879d..000000000000
--- a/release_23/test/Transforms/LowerSetJmp/dg.exp
+++ /dev/null
@@ -1,3 +0,0 @@
-load_lib llvm.exp
-
-RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
diff --git a/release_23/test/Transforms/LowerSetJmp/simpletest.ll b/release_23/test/Transforms/LowerSetJmp/simpletest.ll
deleted file mode 100644
index 9ff5f29c238e..000000000000
--- a/release_23/test/Transforms/LowerSetJmp/simpletest.ll
+++ /dev/null
@@ -1,32 +0,0 @@
-; RUN: llvm-as < %s | opt -lowersetjmp | llvm-dis | grep invoke
-
- %JmpBuf = type i32
-@.str_1 = internal constant [13 x i8] c"returned %d\0A\00" ; <[13 x i8]*> [#uses=1]
-
-declare void @llvm.longjmp(i32*, i32)
-
-declare i32 @llvm.setjmp(i32*)
-
-declare void @foo()
-
-define i32 @simpletest() {
- %B = alloca i32 ; <i32*> [#uses=2]
- %Val = call i32 @llvm.setjmp( i32* %B ) ; <i32> [#uses=2]
- %V = icmp ne i32 %Val, 0 ; <i1> [#uses=1]
- br i1 %V, label %LongJumped, label %Normal
-Normal: ; preds = %0
- call void @foo( )
- call void @llvm.longjmp( i32* %B, i32 42 )
- ret i32 0
-LongJumped: ; preds = %0
- ret i32 %Val
-}
-
-declare i32 @printf(i8*, ...)
-
-define i32 @main() {
- %V = call i32 @simpletest( ) ; <i32> [#uses=1]
- call i32 (i8*, ...)* @printf( i8* getelementptr ([13 x i8]* @.str_1, i64 0, i64 0), i32 %V ) ; <i32>:1 [#uses=0]
- ret i32 0
-}
-
diff --git a/release_23/test/Transforms/LowerSwitch/2003-05-01-PHIProblem.ll b/release_23/test/Transforms/LowerSwitch/2003-05-01-PHIProblem.ll
deleted file mode 100644
index cb5f090864b7..000000000000
--- a/release_23/test/Transforms/LowerSwitch/2003-05-01-PHIProblem.ll
+++ /dev/null
@@ -1,15 +0,0 @@
-; RUN: llvm-as < %s | opt -lowerswitch
-
-define void @child(i32 %ct.1) {
-entry:
- switch i32 0, label %return [
- i32 3, label %UnifiedExitNode
- i32 0, label %return
- ]
-return: ; preds = %entry, %entry
- %result.0 = phi i32* [ null, %entry ], [ null, %entry ] ; <i32*> [#uses=0]
- br label %UnifiedExitNode
-UnifiedExitNode: ; preds = %return, %entry
- ret void
-}
-
diff --git a/release_23/test/Transforms/LowerSwitch/2003-08-23-EmptySwitch.ll b/release_23/test/Transforms/LowerSwitch/2003-08-23-EmptySwitch.ll
deleted file mode 100644
index 71e5a4bcc4d7..000000000000
--- a/release_23/test/Transforms/LowerSwitch/2003-08-23-EmptySwitch.ll
+++ /dev/null
@@ -1,9 +0,0 @@
-; RUN: llvm-as < %s | opt -lowerswitch
-
-define void @test() {
- switch i32 0, label %Next [
- ]
-Next: ; preds = %0
- ret void
-}
-
diff --git a/release_23/test/Transforms/LowerSwitch/2004-03-13-SwitchIsDefaultCrash.ll b/release_23/test/Transforms/LowerSwitch/2004-03-13-SwitchIsDefaultCrash.ll
deleted file mode 100644
index 2fc1c9801914..000000000000
--- a/release_23/test/Transforms/LowerSwitch/2004-03-13-SwitchIsDefaultCrash.ll
+++ /dev/null
@@ -1,19 +0,0 @@
-; RUN: llvm-as < %s | opt -lowerswitch -disable-output
-
-define void @solve() {
-entry:
- %targetBlock = call i16 @solve_code( ) ; <i16> [#uses=1]
- br label %codeReplTail
-then.1: ; preds = %codeReplTail
- ret void
-loopexit.0: ; preds = %codeReplTail
- ret void
-codeReplTail: ; preds = %codeReplTail, %entry
- switch i16 %targetBlock, label %codeReplTail [
- i16 0, label %loopexit.0
- i16 1, label %then.1
- ]
-}
-
-declare i16 @solve_code()
-
diff --git a/release_23/test/Transforms/LowerSwitch/dg.exp b/release_23/test/Transforms/LowerSwitch/dg.exp
deleted file mode 100644
index 879685ca879d..000000000000
--- a/release_23/test/Transforms/LowerSwitch/dg.exp
+++ /dev/null
@@ -1,3 +0,0 @@
-load_lib llvm.exp
-
-RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
diff --git a/release_23/test/Transforms/LowerSwitch/feature.ll b/release_23/test/Transforms/LowerSwitch/feature.ll
deleted file mode 100644
index 7523ad235b6d..000000000000
--- a/release_23/test/Transforms/LowerSwitch/feature.ll
+++ /dev/null
@@ -1,51 +0,0 @@
-; RUN: llvm-as %s -o - | opt -lowerswitch | llvm-dis > %t
-; RUN: grep slt %t | count 10
-; RUN: grep ule %t | count 3
-; RUN: grep eq %t | count 9
-
-define i32 @main(i32 %tmp158) {
-entry:
- switch i32 %tmp158, label %bb336 [
- i32 -2, label %bb338
- i32 -3, label %bb338
- i32 -4, label %bb338
- i32 -5, label %bb338
- i32 -6, label %bb338
- i32 0, label %bb338
- i32 1, label %bb338
- i32 2, label %bb338
- i32 3, label %bb338
- i32 4, label %bb338
- i32 5, label %bb338
- i32 6, label %bb338
- i32 7, label %bb
- i32 8, label %bb338
- i32 9, label %bb322
- i32 10, label %bb324
- i32 11, label %bb326
- i32 12, label %bb328
- i32 13, label %bb330
- i32 14, label %bb332
- i32 15, label %bb334
- ]
-bb:
- ret i32 2
-bb322:
- ret i32 3
-bb324:
- ret i32 4
-bb326:
- ret i32 5
-bb328:
- ret i32 6
-bb330:
- ret i32 7
-bb332:
- ret i32 8
-bb334:
- ret i32 9
-bb336:
- ret i32 10
-bb338:
- ret i32 11
-}
diff --git a/release_23/test/Transforms/Mem2Reg/2002-03-28-UninitializedVal.ll b/release_23/test/Transforms/Mem2Reg/2002-03-28-UninitializedVal.ll
deleted file mode 100644
index 1c881b95156d..000000000000
--- a/release_23/test/Transforms/Mem2Reg/2002-03-28-UninitializedVal.ll
+++ /dev/null
@@ -1,11 +0,0 @@
-; Uninitialized values are not handled correctly.
-;
-; RUN: llvm-as < %s | opt -mem2reg
-;
-
-define i32 @test() {
- ; To be promoted
- %X = alloca i32 ; <i32*> [#uses=1]
- %Y = load i32* %X ; <i32> [#uses=1]
- ret i32 %Y
-}
diff --git a/release_23/test/Transforms/Mem2Reg/2002-05-01-ShouldNotPromoteThisAlloca.ll b/release_23/test/Transforms/Mem2Reg/2002-05-01-ShouldNotPromoteThisAlloca.ll
deleted file mode 100644
index c649d6a5f443..000000000000
--- a/release_23/test/Transforms/Mem2Reg/2002-05-01-ShouldNotPromoteThisAlloca.ll
+++ /dev/null
@@ -1,12 +0,0 @@
-; This input caused the mem2reg pass to die because it was trying to promote
-; the %r alloca, even though it is invalid to do so in this case!
-;
-; RUN: llvm-as < %s | opt -mem2reg
-
-define void @test() {
- %r = alloca i32 ; <i32*> [#uses=2]
- store i32 4, i32* %r
- store i32* %r, i32** null
- ret void
-}
-
diff --git a/release_23/test/Transforms/Mem2Reg/2003-04-10-DFNotFound.ll b/release_23/test/Transforms/Mem2Reg/2003-04-10-DFNotFound.ll
deleted file mode 100644
index 0dd27614104d..000000000000
--- a/release_23/test/Transforms/Mem2Reg/2003-04-10-DFNotFound.ll
+++ /dev/null
@@ -1,10 +0,0 @@
-; RUN: llvm-as < %s | opt -mem2reg
-
-define void @_Z3barv() {
- %result = alloca i32 ; <i32*> [#uses=1]
- ret void
- ; No predecessors!
- store i32 0, i32* %result
- ret void
-}
-
diff --git a/release_23/test/Transforms/Mem2Reg/2003-04-18-DeadBlockProblem.ll b/release_23/test/Transforms/Mem2Reg/2003-04-18-DeadBlockProblem.ll
deleted file mode 100644
index 78bfcb4197b2..000000000000
--- a/release_23/test/Transforms/Mem2Reg/2003-04-18-DeadBlockProblem.ll
+++ /dev/null
@@ -1,16 +0,0 @@
-; This testcases makes sure that mem2reg can handle unreachable blocks.
-; RUN: llvm-as < %s | opt -mem2reg
-
-define i32 @test() {
- %X = alloca i32 ; <i32*> [#uses=2]
- store i32 6, i32* %X
- br label %Loop
-Loop: ; preds = %EndOfLoop, %0
- store i32 5, i32* %X
- br label %EndOfLoop
-Unreachable: ; No predecessors!
- br label %EndOfLoop
-EndOfLoop: ; preds = %Unreachable, %Loop
- br label %Loop
-}
-
diff --git a/release_23/test/Transforms/Mem2Reg/2003-04-24-MultipleIdenticalSuccessors.ll b/release_23/test/Transforms/Mem2Reg/2003-04-24-MultipleIdenticalSuccessors.ll
deleted file mode 100644
index 04e8db3c8de5..000000000000
--- a/release_23/test/Transforms/Mem2Reg/2003-04-24-MultipleIdenticalSuccessors.ll
+++ /dev/null
@@ -1,16 +0,0 @@
-; Mem2reg used to only add one incoming value to a PHI node, even if it had
-; multiple incoming edges from a block.
-;
-; RUN: llvm-as < %s | opt -mem2reg -disable-output
-
-define i32 @test(i1 %c1, i1 %c2) {
- %X = alloca i32 ; <i32*> [#uses=2]
- br i1 %c1, label %Exit, label %B2
-B2: ; preds = %0
- store i32 2, i32* %X
- br i1 %c2, label %Exit, label %Exit
-Exit: ; preds = %B2, %B2, %0
- %Y = load i32* %X ; <i32> [#uses=1]
- ret i32 %Y
-}
-
diff --git a/release_23/test/Transforms/Mem2Reg/2003-06-26-IterativePromote.ll b/release_23/test/Transforms/Mem2Reg/2003-06-26-IterativePromote.ll
deleted file mode 100644
index 27d00150d685..000000000000
--- a/release_23/test/Transforms/Mem2Reg/2003-06-26-IterativePromote.ll
+++ /dev/null
@@ -1,16 +0,0 @@
-; Promoting some values allows promotion of other values.
-; RUN: llvm-as < %s | opt -mem2reg | llvm-dis | not grep alloca
-
-define i32 @test2() {
- %result = alloca i32 ; <i32*> [#uses=2]
- %a = alloca i32 ; <i32*> [#uses=2]
- %p = alloca i32* ; <i32**> [#uses=2]
- store i32 0, i32* %a
- store i32* %a, i32** %p
- %tmp.0 = load i32** %p ; <i32*> [#uses=1]
- %tmp.1 = load i32* %tmp.0 ; <i32> [#uses=1]
- store i32 %tmp.1, i32* %result
- %tmp.2 = load i32* %result ; <i32> [#uses=1]
- ret i32 %tmp.2
-}
-
diff --git a/release_23/test/Transforms/Mem2Reg/2003-10-05-DeadPHIInsertion.ll b/release_23/test/Transforms/Mem2Reg/2003-10-05-DeadPHIInsertion.ll
deleted file mode 100644
index 5a27b20ca509..000000000000
--- a/release_23/test/Transforms/Mem2Reg/2003-10-05-DeadPHIInsertion.ll
+++ /dev/null
@@ -1,22 +0,0 @@
-; Mem2reg should not insert dead PHI nodes! The naive algorithm inserts a PHI
-; node in L3, even though there is no load of %A in anything dominated by L3.
-
-; RUN: llvm-as < %s | opt -mem2reg | llvm-dis | not grep phi
-
-define void @test(i32 %B, i1 %C) {
- %A = alloca i32 ; <i32*> [#uses=4]
- store i32 %B, i32* %A
- br i1 %C, label %L1, label %L2
-L1: ; preds = %0
- store i32 %B, i32* %A
- %D = load i32* %A ; <i32> [#uses=1]
- call void @test( i32 %D, i1 false )
- br label %L3
-L2: ; preds = %0
- %E = load i32* %A ; <i32> [#uses=1]
- call void @test( i32 %E, i1 true )
- br label %L3
-L3: ; preds = %L2, %L1
- ret void
-}
-
diff --git a/release_23/test/Transforms/Mem2Reg/2005-06-30-ReadBeforeWrite.ll b/release_23/test/Transforms/Mem2Reg/2005-06-30-ReadBeforeWrite.ll
deleted file mode 100644
index b053aa162f5b..000000000000
--- a/release_23/test/Transforms/Mem2Reg/2005-06-30-ReadBeforeWrite.ll
+++ /dev/null
@@ -1,47 +0,0 @@
-; RUN: llvm-as < %s | opt -mem2reg -instcombine | llvm-dis | grep store
-; PR590
-
-
-define void @zero(i8* %p, i32 %n) {
-entry:
- %p_addr = alloca i8* ; <i8**> [#uses=2]
- %n_addr = alloca i32 ; <i32*> [#uses=2]
- %i = alloca i32 ; <i32*> [#uses=6]
- %out = alloca i32 ; <i32*> [#uses=2]
- %undef = alloca i32 ; <i32*> [#uses=2]
- store i8* %p, i8** %p_addr
- store i32 %n, i32* %n_addr
- store i32 0, i32* %i
- br label %loopentry
-loopentry: ; preds = %endif, %entry
- %tmp.0 = load i32* %n_addr ; <i32> [#uses=1]
- %tmp.1 = add i32 %tmp.0, 1 ; <i32> [#uses=1]
- %tmp.2 = load i32* %i ; <i32> [#uses=1]
- %tmp.3 = icmp sgt i32 %tmp.1, %tmp.2 ; <i1> [#uses=2]
- %tmp.4 = zext i1 %tmp.3 to i32 ; <i32> [#uses=0]
- br i1 %tmp.3, label %no_exit, label %return
-no_exit: ; preds = %loopentry
- %tmp.5 = load i32* %undef ; <i32> [#uses=1]
- store i32 %tmp.5, i32* %out
- store i32 0, i32* %undef
- %tmp.6 = load i32* %i ; <i32> [#uses=1]
- %tmp.7 = icmp sgt i32 %tmp.6, 0 ; <i1> [#uses=2]
- %tmp.8 = zext i1 %tmp.7 to i32 ; <i32> [#uses=0]
- br i1 %tmp.7, label %then, label %endif
-then: ; preds = %no_exit
- %tmp.9 = load i8** %p_addr ; <i8*> [#uses=1]
- %tmp.10 = load i32* %i ; <i32> [#uses=1]
- %tmp.11 = sub i32 %tmp.10, 1 ; <i32> [#uses=1]
- %tmp.12 = getelementptr i8* %tmp.9, i32 %tmp.11 ; <i8*> [#uses=1]
- %tmp.13 = load i32* %out ; <i32> [#uses=1]
- %tmp.14 = trunc i32 %tmp.13 to i8 ; <i8> [#uses=1]
- store i8 %tmp.14, i8* %tmp.12
- br label %endif
-endif: ; preds = %then, %no_exit
- %tmp.15 = load i32* %i ; <i32> [#uses=1]
- %inc = add i32 %tmp.15, 1 ; <i32> [#uses=1]
- store i32 %inc, i32* %i
- br label %loopentry
-return: ; preds = %loopentry
- ret void
-}
diff --git a/release_23/test/Transforms/Mem2Reg/2005-11-28-Crash.ll b/release_23/test/Transforms/Mem2Reg/2005-11-28-Crash.ll
deleted file mode 100644
index a985db3eb8c7..000000000000
--- a/release_23/test/Transforms/Mem2Reg/2005-11-28-Crash.ll
+++ /dev/null
@@ -1,62 +0,0 @@
-; RUN: llvm-as < %s | opt -mem2reg -disable-output
-; PR670
-
-define void @printk(i32, ...) {
-entry:
- %flags = alloca i32 ; <i32*> [#uses=2]
- br i1 false, label %then.0, label %endif.0
-then.0: ; preds = %entry
- br label %endif.0
-endif.0: ; preds = %then.0, %entry
- store i32 0, i32* %flags
- br label %loopentry
-loopentry: ; preds = %endif.3, %endif.0
- br i1 false, label %no_exit, label %loopexit
-no_exit: ; preds = %loopentry
- br i1 false, label %then.1, label %endif.1
-then.1: ; preds = %no_exit
- br i1 false, label %shortcirc_done.0, label %shortcirc_next.0
-shortcirc_next.0: ; preds = %then.1
- br label %shortcirc_done.0
-shortcirc_done.0: ; preds = %shortcirc_next.0, %then.1
- br i1 false, label %shortcirc_done.1, label %shortcirc_next.1
-shortcirc_next.1: ; preds = %shortcirc_done.0
- br label %shortcirc_done.1
-shortcirc_done.1: ; preds = %shortcirc_next.1, %shortcirc_done.0
- br i1 false, label %shortcirc_done.2, label %shortcirc_next.2
-shortcirc_next.2: ; preds = %shortcirc_done.1
- br label %shortcirc_done.2
-shortcirc_done.2: ; preds = %shortcirc_next.2, %shortcirc_done.1
- br i1 false, label %then.2, label %endif.2
-then.2: ; preds = %shortcirc_done.2
- br label %endif.2
-endif.2: ; preds = %then.2, %shortcirc_done.2
- br label %endif.1
-endif.1: ; preds = %endif.2, %no_exit
- br i1 false, label %then.3, label %endif.3
-then.3: ; preds = %endif.1
- br label %endif.3
-endif.3: ; preds = %then.3, %endif.1
- br label %loopentry
-loopexit: ; preds = %loopentry
- br label %endif.4
-then.4: ; No predecessors!
- %tmp.61 = load i32* %flags ; <i32> [#uses=0]
- br label %out
-dead_block_after_goto: ; No predecessors!
- br label %endif.4
-endif.4: ; preds = %dead_block_after_goto, %loopexit
- br i1 false, label %then.5, label %else
-then.5: ; preds = %endif.4
- br label %endif.5
-else: ; preds = %endif.4
- br label %endif.5
-endif.5: ; preds = %else, %then.5
- br label %out
-out: ; preds = %endif.5, %then.4
- br label %return
-after_ret: ; No predecessors!
- br label %return
-return: ; preds = %after_ret, %out
- ret void
-}
diff --git a/release_23/test/Transforms/Mem2Reg/2007-08-27-VolatileLoadsStores.ll b/release_23/test/Transforms/Mem2Reg/2007-08-27-VolatileLoadsStores.ll
deleted file mode 100644
index 579ed41c94c1..000000000000
--- a/release_23/test/Transforms/Mem2Reg/2007-08-27-VolatileLoadsStores.ll
+++ /dev/null
@@ -1,47 +0,0 @@
-; RUN: llvm-as < %s | opt -std-compile-opts | llvm-dis | grep volatile | count 3
-; PR1520
-; Don't promote volatile loads/stores. This is really needed to handle setjmp/lonjmp properly.
-
-target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32"
-target triple = "i686-pc-linux-gnu"
- %struct.__jmp_buf_tag = type { [6 x i32], i32, %struct.__sigset_t }
- %struct.__sigset_t = type { [32 x i32] }
-@j = external global [1 x %struct.__jmp_buf_tag] ; <[1 x %struct.__jmp_buf_tag]*> [#uses=1]
-
-define i32 @f() {
-entry:
- %retval = alloca i32, align 4 ; <i32*> [#uses=2]
- %v = alloca i32, align 4 ; <i32*> [#uses=3]
- %tmp = alloca i32, align 4 ; <i32*> [#uses=3]
- %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
- volatile store i32 0, i32* %v, align 4
- %tmp1 = call i32 @_setjmp( %struct.__jmp_buf_tag* getelementptr ([1 x %struct.__jmp_buf_tag]* @j, i32 0, i32 0) ) ; <i32> [#uses=1]
- %tmp2 = icmp ne i32 %tmp1, 0 ; <i1> [#uses=1]
- %tmp23 = zext i1 %tmp2 to i8 ; <i8> [#uses=1]
- %toBool = icmp ne i8 %tmp23, 0 ; <i1> [#uses=1]
- br i1 %toBool, label %bb, label %bb5
-
-bb: ; preds = %entry
- %tmp4 = volatile load i32* %v, align 4 ; <i32> [#uses=1]
- store i32 %tmp4, i32* %tmp, align 4
- br label %bb6
-
-bb5: ; preds = %entry
- volatile store i32 1, i32* %v, align 4
- call void @g( )
- store i32 0, i32* %tmp, align 4
- br label %bb6
-
-bb6: ; preds = %bb5, %bb
- %tmp7 = load i32* %tmp, align 4 ; <i32> [#uses=1]
- store i32 %tmp7, i32* %retval, align 4
- br label %return
-
-return: ; preds = %bb6
- %retval8 = load i32* %retval ; <i32> [#uses=1]
- ret i32 %retval8
-}
-
-declare i32 @_setjmp(%struct.__jmp_buf_tag*)
-
-declare void @g()
diff --git a/release_23/test/Transforms/Mem2Reg/PromoteMemToRegister.ll b/release_23/test/Transforms/Mem2Reg/PromoteMemToRegister.ll
deleted file mode 100644
index fdc33fb26897..000000000000
--- a/release_23/test/Transforms/Mem2Reg/PromoteMemToRegister.ll
+++ /dev/null
@@ -1,18 +0,0 @@
-; Simple sanity check testcase. Both alloca's should be eliminated.
-; RUN: llvm-as < %s | opt -mem2reg | llvm-dis | not grep alloca
-
-define double @testfunc(i32 %i, double %j) {
- %I = alloca i32 ; <i32*> [#uses=4]
- %J = alloca double ; <double*> [#uses=2]
- store i32 %i, i32* %I
- store double %j, double* %J
- %t1 = load i32* %I ; <i32> [#uses=1]
- %t2 = add i32 %t1, 1 ; <i32> [#uses=1]
- store i32 %t2, i32* %I
- %t3 = load i32* %I ; <i32> [#uses=1]
- %t4 = sitofp i32 %t3 to double ; <double> [#uses=1]
- %t5 = load double* %J ; <double> [#uses=1]
- %t6 = mul double %t4, %t5 ; <double> [#uses=1]
- ret double %t6
-}
-
diff --git a/release_23/test/Transforms/Mem2Reg/UndefValuesMerge.ll b/release_23/test/Transforms/Mem2Reg/UndefValuesMerge.ll
deleted file mode 100644
index 0d20d7df3458..000000000000
--- a/release_23/test/Transforms/Mem2Reg/UndefValuesMerge.ll
+++ /dev/null
@@ -1,13 +0,0 @@
-; RUN: llvm-as < %s | opt -mem2reg | llvm-dis | not grep phi
-
-define i32 @testfunc(i1 %C, i32 %i, i8 %j) {
- %I = alloca i32 ; <i32*> [#uses=2]
- br i1 %C, label %T, label %Cont
-T: ; preds = %0
- store i32 %i, i32* %I
- br label %Cont
-Cont: ; preds = %T, %0
- %Y = load i32* %I ; <i32> [#uses=1]
- ret i32 %Y
-}
-
diff --git a/release_23/test/Transforms/Mem2Reg/dg.exp b/release_23/test/Transforms/Mem2Reg/dg.exp
deleted file mode 100644
index 879685ca879d..000000000000
--- a/release_23/test/Transforms/Mem2Reg/dg.exp
+++ /dev/null
@@ -1,3 +0,0 @@
-load_lib llvm.exp
-
-RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
diff --git a/release_23/test/Transforms/MemCpyOpt/2008-02-24-MultipleUseofSRet.ll b/release_23/test/Transforms/MemCpyOpt/2008-02-24-MultipleUseofSRet.ll
deleted file mode 100644
index 30d0a6dbebb5..000000000000
--- a/release_23/test/Transforms/MemCpyOpt/2008-02-24-MultipleUseofSRet.ll
+++ /dev/null
@@ -1,34 +0,0 @@
-; RUN: llvm-as < %s | opt -memcpyopt -dse | llvm-dis | grep {call.*initialize} | not grep memtmp
-; PR2077
-
-target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32"
-target triple = "i386-pc-linux-gnu"
-
-define internal fastcc void @initialize({ x86_fp80, x86_fp80 }* noalias sret %agg.result) nounwind {
-entry:
- %agg.result.03 = getelementptr { x86_fp80, x86_fp80 }* %agg.result, i32 0, i32 0 ; <x86_fp80*> [#uses=1]
- store x86_fp80 0xK00000000000000000000, x86_fp80* %agg.result.03
- %agg.result.15 = getelementptr { x86_fp80, x86_fp80 }* %agg.result, i32 0, i32 1 ; <x86_fp80*> [#uses=1]
- store x86_fp80 0xK00000000000000000000, x86_fp80* %agg.result.15
- ret void
-}
-
-declare fastcc x86_fp80 @passed_uninitialized({ x86_fp80, x86_fp80 }* %x) nounwind
-
-define fastcc void @badly_optimized() nounwind {
-entry:
- %z = alloca { x86_fp80, x86_fp80 } ; <{ x86_fp80, x86_fp80 }*> [#uses=2]
- %tmp = alloca { x86_fp80, x86_fp80 } ; <{ x86_fp80, x86_fp80 }*> [#uses=2]
- %memtmp = alloca { x86_fp80, x86_fp80 }, align 8 ; <{ x86_fp80, x86_fp80 }*> [#uses=2]
- call fastcc void @initialize( { x86_fp80, x86_fp80 }* noalias sret %memtmp )
- %tmp1 = bitcast { x86_fp80, x86_fp80 }* %tmp to i8* ; <i8*> [#uses=1]
- %memtmp2 = bitcast { x86_fp80, x86_fp80 }* %memtmp to i8* ; <i8*> [#uses=1]
- call void @llvm.memcpy.i32( i8* %tmp1, i8* %memtmp2, i32 24, i32 8 )
- %z3 = bitcast { x86_fp80, x86_fp80 }* %z to i8* ; <i8*> [#uses=1]
- %tmp4 = bitcast { x86_fp80, x86_fp80 }* %tmp to i8* ; <i8*> [#uses=1]
- call void @llvm.memcpy.i32( i8* %z3, i8* %tmp4, i32 24, i32 8 )
- %tmp5 = call fastcc x86_fp80 @passed_uninitialized( { x86_fp80, x86_fp80 }* %z ) ; <x86_fp80> [#uses=0]
- ret void
-}
-
-declare void @llvm.memcpy.i32(i8*, i8*, i32, i32) nounwind
diff --git a/release_23/test/Transforms/MemCpyOpt/2008-03-13-ReturnSlotBitcast.ll b/release_23/test/Transforms/MemCpyOpt/2008-03-13-ReturnSlotBitcast.ll
deleted file mode 100644
index 12c9a9d23e53..000000000000
--- a/release_23/test/Transforms/MemCpyOpt/2008-03-13-ReturnSlotBitcast.ll
+++ /dev/null
@@ -1,19 +0,0 @@
-; RUN: llvm-as < %s | opt -memcpyopt | llvm-dis | not grep {call.*memcpy.}
- %a = type { i32 }
- %b = type { float }
-
-declare void @llvm.memcpy.i32(i8*, i8*, i32, i32) nounwind
-declare void @g(%a*)
-
-define float @f() {
-entry:
- %a_var = alloca %a
- %b_var = alloca %b
- call void @g(%a *%a_var)
- %a_i8 = bitcast %a* %a_var to i8*
- %b_i8 = bitcast %b* %b_var to i8*
- call void @llvm.memcpy.i32(i8* %b_i8, i8* %a_i8, i32 4, i32 4)
- %tmp1 = getelementptr %b* %b_var, i32 0, i32 0
- %tmp2 = load float* %tmp1
- ret float %tmp2
-}
diff --git a/release_23/test/Transforms/MemCpyOpt/2008-04-29-SRetRemoval.ll b/release_23/test/Transforms/MemCpyOpt/2008-04-29-SRetRemoval.ll
deleted file mode 100644
index 1d9a35d63f28..000000000000
--- a/release_23/test/Transforms/MemCpyOpt/2008-04-29-SRetRemoval.ll
+++ /dev/null
@@ -1,17 +0,0 @@
-; RUN: llvm-as < %s | opt -memcpyopt | llvm-dis | grep {call.*memcpy.*agg.result}
-
-target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
-target triple = "i386-apple-darwin8"
-@x = external global { x86_fp80, x86_fp80 } ; <{ x86_fp80, x86_fp80 }*> [#uses=1]
-
-define void @foo({ x86_fp80, x86_fp80 }* noalias sret %agg.result) nounwind {
-entry:
- %x.0 = alloca { x86_fp80, x86_fp80 } ; <{ x86_fp80, x86_fp80 }*> [#uses=1]
- %x.01 = bitcast { x86_fp80, x86_fp80 }* %x.0 to i8* ; <i8*> [#uses=2]
- call void @llvm.memcpy.i32( i8* %x.01, i8* bitcast ({ x86_fp80, x86_fp80 }* @x to i8*), i32 32, i32 16 )
- %agg.result2 = bitcast { x86_fp80, x86_fp80 }* %agg.result to i8* ; <i8*> [#uses=1]
- call void @llvm.memcpy.i32( i8* %agg.result2, i8* %x.01, i32 32, i32 16 )
- ret void
-}
-
-declare void @llvm.memcpy.i32(i8*, i8*, i32, i32) nounwind
diff --git a/release_23/test/Transforms/MemCpyOpt/dg.exp b/release_23/test/Transforms/MemCpyOpt/dg.exp
deleted file mode 100644
index 879685ca879d..000000000000
--- a/release_23/test/Transforms/MemCpyOpt/dg.exp
+++ /dev/null
@@ -1,3 +0,0 @@
-load_lib llvm.exp
-
-RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
diff --git a/release_23/test/Transforms/MemCpyOpt/form-memset.ll b/release_23/test/Transforms/MemCpyOpt/form-memset.ll
deleted file mode 100644
index ffacb8565c21..000000000000
--- a/release_23/test/Transforms/MemCpyOpt/form-memset.ll
+++ /dev/null
@@ -1,55 +0,0 @@
-; RUN: llvm-as < %s | opt -memcpyopt | llvm-dis | not grep store
-; RUN: llvm-as < %s | opt -memcpyopt | llvm-dis | grep {call.*llvm.memset}
-
-; All the stores in this example should be merged into a single memset.
-
-target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
-target triple = "i386-apple-darwin8"
-
-define void @foo(i8 signext %c) nounwind {
-entry:
- %x = alloca [19 x i8] ; <[19 x i8]*> [#uses=20]
- %tmp = getelementptr [19 x i8]* %x, i32 0, i32 0 ; <i8*> [#uses=1]
- store i8 %c, i8* %tmp, align 1
- %tmp5 = getelementptr [19 x i8]* %x, i32 0, i32 1 ; <i8*> [#uses=1]
- store i8 %c, i8* %tmp5, align 1
- %tmp9 = getelementptr [19 x i8]* %x, i32 0, i32 2 ; <i8*> [#uses=1]
- store i8 %c, i8* %tmp9, align 1
- %tmp13 = getelementptr [19 x i8]* %x, i32 0, i32 3 ; <i8*> [#uses=1]
- store i8 %c, i8* %tmp13, align 1
- %tmp17 = getelementptr [19 x i8]* %x, i32 0, i32 4 ; <i8*> [#uses=1]
- store i8 %c, i8* %tmp17, align 1
- %tmp21 = getelementptr [19 x i8]* %x, i32 0, i32 5 ; <i8*> [#uses=1]
- store i8 %c, i8* %tmp21, align 1
- %tmp25 = getelementptr [19 x i8]* %x, i32 0, i32 6 ; <i8*> [#uses=1]
- store i8 %c, i8* %tmp25, align 1
- %tmp29 = getelementptr [19 x i8]* %x, i32 0, i32 7 ; <i8*> [#uses=1]
- store i8 %c, i8* %tmp29, align 1
- %tmp33 = getelementptr [19 x i8]* %x, i32 0, i32 8 ; <i8*> [#uses=1]
- store i8 %c, i8* %tmp33, align 1
- %tmp37 = getelementptr [19 x i8]* %x, i32 0, i32 9 ; <i8*> [#uses=1]
- store i8 %c, i8* %tmp37, align 1
- %tmp41 = getelementptr [19 x i8]* %x, i32 0, i32 10 ; <i8*> [#uses=1]
- store i8 %c, i8* %tmp41, align 1
- %tmp45 = getelementptr [19 x i8]* %x, i32 0, i32 11 ; <i8*> [#uses=1]
- store i8 %c, i8* %tmp45, align 1
- %tmp49 = getelementptr [19 x i8]* %x, i32 0, i32 12 ; <i8*> [#uses=1]
- store i8 %c, i8* %tmp49, align 1
- %tmp53 = getelementptr [19 x i8]* %x, i32 0, i32 13 ; <i8*> [#uses=1]
- store i8 %c, i8* %tmp53, align 1
- %tmp57 = getelementptr [19 x i8]* %x, i32 0, i32 14 ; <i8*> [#uses=1]
- store i8 %c, i8* %tmp57, align 1
- %tmp61 = getelementptr [19 x i8]* %x, i32 0, i32 15 ; <i8*> [#uses=1]
- store i8 %c, i8* %tmp61, align 1
- %tmp65 = getelementptr [19 x i8]* %x, i32 0, i32 16 ; <i8*> [#uses=1]
- store i8 %c, i8* %tmp65, align 1
- %tmp69 = getelementptr [19 x i8]* %x, i32 0, i32 17 ; <i8*> [#uses=1]
- store i8 %c, i8* %tmp69, align 1
- %tmp73 = getelementptr [19 x i8]* %x, i32 0, i32 18 ; <i8*> [#uses=1]
- store i8 %c, i8* %tmp73, align 1
- %tmp76 = call i32 (...)* @bar( [19 x i8]* %x ) nounwind ; <i32> [#uses=0]
- ret void
-}
-
-declare i32 @bar(...)
-
diff --git a/release_23/test/Transforms/MemCpyOpt/form-memset2.ll b/release_23/test/Transforms/MemCpyOpt/form-memset2.ll
deleted file mode 100644
index 719cd47b0b7b..000000000000
--- a/release_23/test/Transforms/MemCpyOpt/form-memset2.ll
+++ /dev/null
@@ -1,99 +0,0 @@
-; RUN: llvm-as < %s | opt -memcpyopt | llvm-dis | not grep store
-; RUN: llvm-as < %s | opt -memcpyopt | llvm-dis | grep {call.*llvm.memset} | count 3
-
-target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
-target triple = "i386-apple-darwin8"
- %struct.MV = type { i16, i16 }
-
-define i32 @t() nounwind {
-entry:
- %ref_idx = alloca [8 x i8] ; <[8 x i8]*> [#uses=8]
- %left_mvd = alloca [8 x %struct.MV] ; <[8 x %struct.MV]*> [#uses=17]
- %up_mvd = alloca [8 x %struct.MV] ; <[8 x %struct.MV]*> [#uses=17]
- %tmp20 = getelementptr [8 x i8]* %ref_idx, i32 0, i32 7 ; <i8*> [#uses=1]
- store i8 -1, i8* %tmp20, align 1
- %tmp23 = getelementptr [8 x i8]* %ref_idx, i32 0, i32 6 ; <i8*> [#uses=1]
- store i8 -1, i8* %tmp23, align 1
- %tmp26 = getelementptr [8 x i8]* %ref_idx, i32 0, i32 5 ; <i8*> [#uses=1]
- store i8 -1, i8* %tmp26, align 1
- %tmp29 = getelementptr [8 x i8]* %ref_idx, i32 0, i32 4 ; <i8*> [#uses=1]
- store i8 -1, i8* %tmp29, align 1
- %tmp32 = getelementptr [8 x i8]* %ref_idx, i32 0, i32 3 ; <i8*> [#uses=1]
- store i8 -1, i8* %tmp32, align 1
- %tmp35 = getelementptr [8 x i8]* %ref_idx, i32 0, i32 2 ; <i8*> [#uses=1]
- store i8 -1, i8* %tmp35, align 1
- %tmp38 = getelementptr [8 x i8]* %ref_idx, i32 0, i32 1 ; <i8*> [#uses=1]
- store i8 -1, i8* %tmp38, align 1
- %tmp41 = getelementptr [8 x i8]* %ref_idx, i32 0, i32 0 ; <i8*> [#uses=2]
- store i8 -1, i8* %tmp41, align 1
- %tmp43 = getelementptr [8 x %struct.MV]* %up_mvd, i32 0, i32 7, i32 0 ; <i16*> [#uses=1]
- store i16 0, i16* %tmp43, align 2
- %tmp46 = getelementptr [8 x %struct.MV]* %up_mvd, i32 0, i32 7, i32 1 ; <i16*> [#uses=1]
- store i16 0, i16* %tmp46, align 2
- %tmp57 = getelementptr [8 x %struct.MV]* %up_mvd, i32 0, i32 6, i32 0 ; <i16*> [#uses=1]
- store i16 0, i16* %tmp57, align 2
- %tmp60 = getelementptr [8 x %struct.MV]* %up_mvd, i32 0, i32 6, i32 1 ; <i16*> [#uses=1]
- store i16 0, i16* %tmp60, align 2
- %tmp71 = getelementptr [8 x %struct.MV]* %up_mvd, i32 0, i32 5, i32 0 ; <i16*> [#uses=1]
- store i16 0, i16* %tmp71, align 2
- %tmp74 = getelementptr [8 x %struct.MV]* %up_mvd, i32 0, i32 5, i32 1 ; <i16*> [#uses=1]
- store i16 0, i16* %tmp74, align 2
- %tmp85 = getelementptr [8 x %struct.MV]* %up_mvd, i32 0, i32 4, i32 0 ; <i16*> [#uses=1]
- store i16 0, i16* %tmp85, align 2
- %tmp88 = getelementptr [8 x %struct.MV]* %up_mvd, i32 0, i32 4, i32 1 ; <i16*> [#uses=1]
- store i16 0, i16* %tmp88, align 2
- %tmp99 = getelementptr [8 x %struct.MV]* %up_mvd, i32 0, i32 3, i32 0 ; <i16*> [#uses=1]
- store i16 0, i16* %tmp99, align 2
- %tmp102 = getelementptr [8 x %struct.MV]* %up_mvd, i32 0, i32 3, i32 1 ; <i16*> [#uses=1]
- store i16 0, i16* %tmp102, align 2
- %tmp113 = getelementptr [8 x %struct.MV]* %up_mvd, i32 0, i32 2, i32 0 ; <i16*> [#uses=1]
- store i16 0, i16* %tmp113, align 2
- %tmp116 = getelementptr [8 x %struct.MV]* %up_mvd, i32 0, i32 2, i32 1 ; <i16*> [#uses=1]
- store i16 0, i16* %tmp116, align 2
- %tmp127 = getelementptr [8 x %struct.MV]* %up_mvd, i32 0, i32 1, i32 0 ; <i16*> [#uses=1]
- store i16 0, i16* %tmp127, align 2
- %tmp130 = getelementptr [8 x %struct.MV]* %up_mvd, i32 0, i32 1, i32 1 ; <i16*> [#uses=1]
- store i16 0, i16* %tmp130, align 2
- %tmp141 = getelementptr [8 x %struct.MV]* %up_mvd, i32 0, i32 0, i32 0 ; <i16*> [#uses=1]
- store i16 0, i16* %tmp141, align 8
- %tmp144 = getelementptr [8 x %struct.MV]* %up_mvd, i32 0, i32 0, i32 1 ; <i16*> [#uses=1]
- store i16 0, i16* %tmp144, align 2
- %tmp148 = getelementptr [8 x %struct.MV]* %left_mvd, i32 0, i32 7, i32 0 ; <i16*> [#uses=1]
- store i16 0, i16* %tmp148, align 2
- %tmp151 = getelementptr [8 x %struct.MV]* %left_mvd, i32 0, i32 7, i32 1 ; <i16*> [#uses=1]
- store i16 0, i16* %tmp151, align 2
- %tmp162 = getelementptr [8 x %struct.MV]* %left_mvd, i32 0, i32 6, i32 0 ; <i16*> [#uses=1]
- store i16 0, i16* %tmp162, align 2
- %tmp165 = getelementptr [8 x %struct.MV]* %left_mvd, i32 0, i32 6, i32 1 ; <i16*> [#uses=1]
- store i16 0, i16* %tmp165, align 2
- %tmp176 = getelementptr [8 x %struct.MV]* %left_mvd, i32 0, i32 5, i32 0 ; <i16*> [#uses=1]
- store i16 0, i16* %tmp176, align 2
- %tmp179 = getelementptr [8 x %struct.MV]* %left_mvd, i32 0, i32 5, i32 1 ; <i16*> [#uses=1]
- store i16 0, i16* %tmp179, align 2
- %tmp190 = getelementptr [8 x %struct.MV]* %left_mvd, i32 0, i32 4, i32 0 ; <i16*> [#uses=1]
- store i16 0, i16* %tmp190, align 2
- %tmp193 = getelementptr [8 x %struct.MV]* %left_mvd, i32 0, i32 4, i32 1 ; <i16*> [#uses=1]
- store i16 0, i16* %tmp193, align 2
- %tmp204 = getelementptr [8 x %struct.MV]* %left_mvd, i32 0, i32 3, i32 0 ; <i16*> [#uses=1]
- store i16 0, i16* %tmp204, align 2
- %tmp207 = getelementptr [8 x %struct.MV]* %left_mvd, i32 0, i32 3, i32 1 ; <i16*> [#uses=1]
- store i16 0, i16* %tmp207, align 2
- %tmp218 = getelementptr [8 x %struct.MV]* %left_mvd, i32 0, i32 2, i32 0 ; <i16*> [#uses=1]
- store i16 0, i16* %tmp218, align 2
- %tmp221 = getelementptr [8 x %struct.MV]* %left_mvd, i32 0, i32 2, i32 1 ; <i16*> [#uses=1]
- store i16 0, i16* %tmp221, align 2
- %tmp232 = getelementptr [8 x %struct.MV]* %left_mvd, i32 0, i32 1, i32 0 ; <i16*> [#uses=1]
- store i16 0, i16* %tmp232, align 2
- %tmp235 = getelementptr [8 x %struct.MV]* %left_mvd, i32 0, i32 1, i32 1 ; <i16*> [#uses=1]
- store i16 0, i16* %tmp235, align 2
- %tmp246 = getelementptr [8 x %struct.MV]* %left_mvd, i32 0, i32 0, i32 0 ; <i16*> [#uses=1]
- store i16 0, i16* %tmp246, align 8
- %tmp249 = getelementptr [8 x %struct.MV]* %left_mvd, i32 0, i32 0, i32 1 ; <i16*> [#uses=1]
- store i16 0, i16* %tmp249, align 2
- %up_mvd252 = getelementptr [8 x %struct.MV]* %up_mvd, i32 0, i32 0 ; <%struct.MV*> [#uses=1]
- %left_mvd253 = getelementptr [8 x %struct.MV]* %left_mvd, i32 0, i32 0 ; <%struct.MV*> [#uses=1]
- call void @foo( %struct.MV* %up_mvd252, %struct.MV* %left_mvd253, i8* %tmp41 ) nounwind
- ret i32 undef
-}
-
-declare void @foo(%struct.MV*, %struct.MV*, i8*)
diff --git a/release_23/test/Transforms/MemCpyOpt/memcpy.ll b/release_23/test/Transforms/MemCpyOpt/memcpy.ll
deleted file mode 100644
index c5cdc29a5cf2..000000000000
--- a/release_23/test/Transforms/MemCpyOpt/memcpy.ll
+++ /dev/null
@@ -1,22 +0,0 @@
-; RUN: llvm-as < %s | opt -memcpyopt -dse | llvm-dis | grep {call.*memcpy} | count 1
-
-target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
-target triple = "i686-apple-darwin9"
-
-define void @ccosl({ x86_fp80, x86_fp80 }* sret %agg.result, x86_fp80 %z.0, x86_fp80 %z.1) nounwind {
-entry:
- %tmp2 = alloca { x86_fp80, x86_fp80 } ; <{ x86_fp80, x86_fp80 }*> [#uses=1]
- %memtmp = alloca { x86_fp80, x86_fp80 }, align 16 ; <{ x86_fp80, x86_fp80 }*> [#uses=2]
- %tmp5 = sub x86_fp80 0xK80000000000000000000, %z.1 ; <x86_fp80> [#uses=1]
- call void @ccoshl( { x86_fp80, x86_fp80 }* sret %memtmp, x86_fp80 %tmp5, x86_fp80 %z.0 ) nounwind
- %tmp219 = bitcast { x86_fp80, x86_fp80 }* %tmp2 to i8* ; <i8*> [#uses=2]
- %memtmp20 = bitcast { x86_fp80, x86_fp80 }* %memtmp to i8* ; <i8*> [#uses=1]
- call void @llvm.memcpy.i32( i8* %tmp219, i8* %memtmp20, i32 32, i32 16 )
- %agg.result21 = bitcast { x86_fp80, x86_fp80 }* %agg.result to i8* ; <i8*> [#uses=1]
- call void @llvm.memcpy.i32( i8* %agg.result21, i8* %tmp219, i32 32, i32 16 )
- ret void
-}
-
-declare void @ccoshl({ x86_fp80, x86_fp80 }* sret , x86_fp80, x86_fp80) nounwind
-
-declare void @llvm.memcpy.i32(i8*, i8*, i32, i32) nounwind
diff --git a/release_23/test/Transforms/MemCpyOpt/sret.ll b/release_23/test/Transforms/MemCpyOpt/sret.ll
deleted file mode 100644
index 1ac11aa959f9..000000000000
--- a/release_23/test/Transforms/MemCpyOpt/sret.ll
+++ /dev/null
@@ -1,28 +0,0 @@
-; RUN: llvm-as < %s | opt -memcpyopt | llvm-dis | not grep {call.*memcpy}
-
-target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
-target triple = "i686-apple-darwin9"
-
-define void @ccosl({ x86_fp80, x86_fp80 }* noalias sret %agg.result, { x86_fp80, x86_fp80 }* byval %z) nounwind {
-entry:
- %iz = alloca { x86_fp80, x86_fp80 } ; <{ x86_fp80, x86_fp80 }*> [#uses=3]
- %memtmp = alloca { x86_fp80, x86_fp80 }, align 16 ; <{ x86_fp80, x86_fp80 }*> [#uses=2]
- %tmp1 = getelementptr { x86_fp80, x86_fp80 }* %z, i32 0, i32 1 ; <x86_fp80*> [#uses=1]
- %tmp2 = load x86_fp80* %tmp1, align 16 ; <x86_fp80> [#uses=1]
- %tmp3 = sub x86_fp80 0xK80000000000000000000, %tmp2 ; <x86_fp80> [#uses=1]
- %tmp4 = getelementptr { x86_fp80, x86_fp80 }* %iz, i32 0, i32 1 ; <x86_fp80*> [#uses=1]
- %real = getelementptr { x86_fp80, x86_fp80 }* %iz, i32 0, i32 0 ; <x86_fp80*> [#uses=1]
- %tmp7 = getelementptr { x86_fp80, x86_fp80 }* %z, i32 0, i32 0 ; <x86_fp80*> [#uses=1]
- %tmp8 = load x86_fp80* %tmp7, align 16 ; <x86_fp80> [#uses=1]
- store x86_fp80 %tmp3, x86_fp80* %real, align 16
- store x86_fp80 %tmp8, x86_fp80* %tmp4, align 16
- call void @ccoshl( { x86_fp80, x86_fp80 }* noalias sret %memtmp, { x86_fp80, x86_fp80 }* byval %iz ) nounwind
- %memtmp14 = bitcast { x86_fp80, x86_fp80 }* %memtmp to i8* ; <i8*> [#uses=1]
- %agg.result15 = bitcast { x86_fp80, x86_fp80 }* %agg.result to i8* ; <i8*> [#uses=1]
- call void @llvm.memcpy.i32( i8* %agg.result15, i8* %memtmp14, i32 32, i32 16 )
- ret void
-}
-
-declare void @ccoshl({ x86_fp80, x86_fp80 }* noalias sret , { x86_fp80, x86_fp80 }* byval ) nounwind
-
-declare void @llvm.memcpy.i32(i8*, i8*, i32, i32) nounwind
diff --git a/release_23/test/Transforms/PredicateSimplifier/2006-08-02-Switch.ll b/release_23/test/Transforms/PredicateSimplifier/2006-08-02-Switch.ll
deleted file mode 100644
index fadaaa2ac56a..000000000000
--- a/release_23/test/Transforms/PredicateSimplifier/2006-08-02-Switch.ll
+++ /dev/null
@@ -1,19 +0,0 @@
-; RUN: llvm-as < %s | opt -predsimplify -disable-output
-
-define fastcc void @_ov_splice(i32 %n1, i32 %n2, i32 %ch2) {
-entry:
- %tmp = icmp sgt i32 %n1, %n2 ; <i1> [#uses=1]
- %n.0 = select i1 %tmp, i32 %n2, i32 %n1 ; <i32> [#uses=1]
- %tmp104 = icmp slt i32 0, %ch2 ; <i1> [#uses=1]
- br i1 %tmp104, label %cond_true105, label %return
-cond_true95: ; preds = %cond_true105
- ret void
-bb98: ; preds = %cond_true105
- ret void
-cond_true105: ; preds = %entry
- %tmp94 = icmp sgt i32 %n.0, 0 ; <i1> [#uses=1]
- br i1 %tmp94, label %cond_true95, label %bb98
-return: ; preds = %entry
- ret void
-}
-
diff --git a/release_23/test/Transforms/PredicateSimplifier/2006-08-07-LeaderOffByOne.ll b/release_23/test/Transforms/PredicateSimplifier/2006-08-07-LeaderOffByOne.ll
deleted file mode 100644
index c08dbb3a095c..000000000000
--- a/release_23/test/Transforms/PredicateSimplifier/2006-08-07-LeaderOffByOne.ll
+++ /dev/null
@@ -1,23 +0,0 @@
-; RUN: llvm-as < %s | opt -predsimplify -disable-output
-
-define void @safe_strcpy(i32 %size1) {
-entry:
- %tmp = icmp eq i32 %size1, 0 ; <i1> [#uses=1]
- br i1 %tmp, label %return, label %strlen.exit
-strlen.exit: ; preds = %entry
- %tmp.upgrd.1 = trunc i64 0 to i32 ; <i32> [#uses=2]
- %tmp6 = icmp ult i32 %tmp.upgrd.1, %size1 ; <i1> [#uses=1]
- br i1 %tmp6, label %cond_true7, label %cond_false19
-cond_true7: ; preds = %strlen.exit
- %tmp9 = icmp eq i32 %tmp.upgrd.1, 0 ; <i1> [#uses=1]
- br i1 %tmp9, label %cond_next15, label %cond_true10
-cond_true10: ; preds = %cond_true7
- ret void
-cond_next15: ; preds = %cond_true7
- ret void
-cond_false19: ; preds = %strlen.exit
- ret void
-return: ; preds = %entry
- ret void
-}
-
diff --git a/release_23/test/Transforms/PredicateSimplifier/2006-09-20-ResolveCycle.ll b/release_23/test/Transforms/PredicateSimplifier/2006-09-20-ResolveCycle.ll
deleted file mode 100644
index f3d58e9102d0..000000000000
--- a/release_23/test/Transforms/PredicateSimplifier/2006-09-20-ResolveCycle.ll
+++ /dev/null
@@ -1,24 +0,0 @@
-; RUN: llvm-as < %s | opt -predsimplify -disable-output
-
-define void @gs_image_next() {
-entry:
- %tmp = load i32* null ; <i32> [#uses=2]
- br i1 false, label %cond_next21, label %UnifiedReturnBlock
-cond_next21: ; preds = %entry
- br i1 false, label %cond_next42, label %UnifiedReturnBlock
-cond_next42: ; preds = %cond_next21
- br label %cond_true158
-cond_next134: ; preds = %cond_true158
- %tmp1571 = icmp eq i32 0, %min ; <i1> [#uses=0]
- ret void
-cond_true158: ; preds = %cond_true158, %cond_next42
- %tmp47 = sub i32 %tmp, 0 ; <i32> [#uses=2]
- %tmp49 = icmp ule i32 %tmp47, 0 ; <i1> [#uses=1]
- %min = select i1 %tmp49, i32 %tmp47, i32 0 ; <i32> [#uses=2]
- %tmp92 = add i32 %min, 0 ; <i32> [#uses=1]
- %tmp101 = icmp eq i32 %tmp92, %tmp ; <i1> [#uses=1]
- br i1 %tmp101, label %cond_next134, label %cond_true158
-UnifiedReturnBlock: ; preds = %cond_next21, %entry
- ret void
-}
-
diff --git a/release_23/test/Transforms/PredicateSimplifier/2006-09-20-SetCC.ll b/release_23/test/Transforms/PredicateSimplifier/2006-09-20-SetCC.ll
deleted file mode 100644
index 9df0f9d9bef9..000000000000
--- a/release_23/test/Transforms/PredicateSimplifier/2006-09-20-SetCC.ll
+++ /dev/null
@@ -1,46 +0,0 @@
-; RUN: llvm-as < %s | opt -predsimplify | llvm-dis | grep br | grep return.i.bb8_crit_edge | grep false
-@str = external global [4 x i8] ; <[4 x i8]*> [#uses=1]
-
-declare i32 @sprintf(i8*, i8*, ...)
-
-define i32 @main() {
-entry:
- br label %cond_true.outer
-cond_true.outer: ; preds = %cond_true.i, %entry
- %i.0.0.ph = phi i32 [ 0, %entry ], [ %tmp5, %cond_true.i ] ; <i32> [#uses=1]
- %j.0.0.ph = phi i32 [ 0, %entry ], [ %tmp312, %cond_true.i ] ; <i32> [#uses=2]
- br label %cond_true
-cond_true: ; preds = %return.i, %cond_true.outer
- %indvar.ui = phi i32 [ 0, %cond_true.outer ], [ %indvar.next, %return.i ] ; <i32> [#uses=2]
- %indvar = bitcast i32 %indvar.ui to i32 ; <i32> [#uses=1]
- %i.0.0 = add i32 %indvar, %i.0.0.ph ; <i32> [#uses=3]
- %savedstack = call i8* @llvm.stacksave( ) ; <i8*> [#uses=2]
- %tmp.i = icmp eq i32 %i.0.0, 0 ; <i1> [#uses=1]
- %tmp5 = add i32 %i.0.0, 1 ; <i32> [#uses=3]
- br i1 %tmp.i, label %return.i, label %cond_true.i
-cond_true.i: ; preds = %cond_true
- %tmp.i.upgrd.1 = alloca [1000 x i8] ; <[1000 x i8]*> [#uses=1]
- %tmp.sub.i = getelementptr [1000 x i8]* %tmp.i.upgrd.1, i32 0, i32 0 ; <i8*> [#uses=2]
- %tmp4.i = call i32 (i8*, i8*, ...)* @sprintf( i8* %tmp.sub.i, i8* getelementptr ([4 x i8]* @str, i32 0, i64 0), i32 %i.0.0 ) ; <i32> [#uses=0]
- %tmp.i.upgrd.2 = load i8* %tmp.sub.i ; <i8> [#uses=1]
- %tmp7.i = sext i8 %tmp.i.upgrd.2 to i32 ; <i32> [#uses=1]
- call void @llvm.stackrestore( i8* %savedstack )
- %tmp312 = add i32 %tmp7.i, %j.0.0.ph ; <i32> [#uses=2]
- %tmp19 = icmp sgt i32 %tmp5, 9999 ; <i1> [#uses=1]
- br i1 %tmp19, label %bb8, label %cond_true.outer
-return.i: ; preds = %cond_true
- call void @llvm.stackrestore( i8* %savedstack )
- %tmp21 = icmp sgt i32 %tmp5, 9999 ; <i1> [#uses=1]
- %indvar.next = add i32 %indvar.ui, 1 ; <i32> [#uses=1]
- br i1 %tmp21, label %bb8, label %cond_true
-bb8: ; preds = %return.i, %cond_true.i
- %j.0.1 = phi i32 [ %j.0.0.ph, %return.i ], [ %tmp312, %cond_true.i ] ; <i32> [#uses=1]
- %tmp10 = call i32 (i8*, ...)* @printf( i8* getelementptr ([4 x i8]* @str, i32 0, i64 0), i32 %j.0.1 ) ; <i32> [#uses=0]
- ret i32 undef
-}
-
-declare i32 @printf(i8*, ...)
-
-declare i8* @llvm.stacksave()
-
-declare void @llvm.stackrestore(i8*)
diff --git a/release_23/test/Transforms/PredicateSimplifier/2006-10-22-IntOr.ll b/release_23/test/Transforms/PredicateSimplifier/2006-10-22-IntOr.ll
deleted file mode 100644
index 9146576ef616..000000000000
--- a/release_23/test/Transforms/PredicateSimplifier/2006-10-22-IntOr.ll
+++ /dev/null
@@ -1,48 +0,0 @@
-; RUN: llvm-as < %s | \
-; RUN: opt -predsimplify -instcombine -simplifycfg | llvm-dis > %t
-; RUN: grep -v declare %t | not grep fail
-; RUN: grep -v declare %t | grep pass | count 3
-
-define i32 @test1(i32 %x, i32 %y) {
-entry:
- %tmp2 = or i32 %x, %y ; <i32> [#uses=1]
- %tmp = icmp eq i32 %tmp2, 0 ; <i1> [#uses=1]
- br i1 %tmp, label %cond_true, label %return
-cond_true: ; preds = %entry
- %tmp4 = icmp eq i32 %x, 0 ; <i1> [#uses=1]
- br i1 %tmp4, label %cond_true5, label %cond_false
-cond_true5: ; preds = %cond_true
- %tmp6 = call i32 @pass( ) ; <i32> [#uses=1]
- ret i32 %tmp6
-cond_false: ; preds = %cond_true
- %tmp8 = call i32 @fail( ) ; <i32> [#uses=1]
- ret i32 %tmp8
-return: ; preds = %entry
- ret i32 0
-}
-
-define i32 @test2(i32 %x, i32 %y) {
-entry:
- %tmp2 = or i32 %x, %y ; <i32> [#uses=1]
- %tmp = icmp ne i32 %tmp2, 0 ; <i1> [#uses=1]
- br i1 %tmp, label %cond_true, label %return
-cond_true: ; preds = %entry
- %tmp4 = icmp eq i32 %x, 0 ; <i1> [#uses=1]
- br i1 %tmp4, label %cond_true5, label %cond_false
-cond_true5: ; preds = %cond_true
- %tmp6 = call i32 @pass1( ) ; <i32> [#uses=1]
- ret i32 %tmp6
-cond_false: ; preds = %cond_true
- %tmp8 = call i32 @pass2( ) ; <i32> [#uses=1]
- ret i32 %tmp8
-return: ; preds = %entry
- ret i32 0
-}
-
-declare i32 @fail()
-
-declare i32 @pass()
-
-declare i32 @pass1()
-
-declare i32 @pass2()
diff --git a/release_23/test/Transforms/PredicateSimplifier/2006-10-25-AddSetCC.ll b/release_23/test/Transforms/PredicateSimplifier/2006-10-25-AddSetCC.ll
deleted file mode 100644
index cbc54bee21bc..000000000000
--- a/release_23/test/Transforms/PredicateSimplifier/2006-10-25-AddSetCC.ll
+++ /dev/null
@@ -1,26 +0,0 @@
-; RUN: llvm-as < %s | \
-; RUN: opt -predsimplify -instcombine -simplifycfg | llvm-dis | \
-; RUN: grep -v declare | grep pass | count 2
-
-define i32 @test(i32 %x, i32 %y) {
-entry:
- %tmp2 = icmp slt i32 %x, %y ; <i1> [#uses=1]
- %tmp = icmp ne i1 %tmp2, true ; <i1> [#uses=1]
- br i1 %tmp, label %cond_true, label %return
-cond_true: ; preds = %entry
- %tmp4 = icmp eq i32 %x, %y ; <i1> [#uses=1]
- br i1 %tmp4, label %cond_true5, label %cond_false
-cond_true5: ; preds = %cond_true
- %tmp6 = call i32 @pass1( ) ; <i32> [#uses=1]
- ret i32 %tmp6
-cond_false: ; preds = %cond_true
- %tmp8 = call i32 @pass2( ) ; <i32> [#uses=1]
- ret i32 %tmp8
-return: ; preds = %entry
- ret i32 0
-}
-
-declare i32 @pass1()
-
-declare i32 @pass2()
-
diff --git a/release_23/test/Transforms/PredicateSimplifier/2006-11-04-ImpossibleGT.ll b/release_23/test/Transforms/PredicateSimplifier/2006-11-04-ImpossibleGT.ll
deleted file mode 100644
index b0b9859462a6..000000000000
--- a/release_23/test/Transforms/PredicateSimplifier/2006-11-04-ImpossibleGT.ll
+++ /dev/null
@@ -1,16 +0,0 @@
-; RUN: llvm-as < %s | opt -predsimplify -disable-output
-
-define void @readMotionInfoFromNAL() {
-entry:
- br i1 false, label %bb2425, label %cond_next30
-cond_next30: ; preds = %entry
- ret void
-bb2418: ; preds = %bb2425
- ret void
-bb2425: ; preds = %entry
- %tmp2427 = icmp sgt i32 0, 3 ; <i1> [#uses=1]
- br i1 %tmp2427, label %cond_next2429, label %bb2418
-cond_next2429: ; preds = %bb2425
- ret void
-}
-
diff --git a/release_23/test/Transforms/PredicateSimplifier/2006-11-04-ReplacingZeros.ll b/release_23/test/Transforms/PredicateSimplifier/2006-11-04-ReplacingZeros.ll
deleted file mode 100644
index 906d7c363bf6..000000000000
--- a/release_23/test/Transforms/PredicateSimplifier/2006-11-04-ReplacingZeros.ll
+++ /dev/null
@@ -1,25 +0,0 @@
-; RUN: llvm-as < %s | opt -predsimplify -disable-output
-
-define i32 @test_wp_B_slice(i32 %select_method) {
-entry:
- br label %bb309
-cond_true114: ; preds = %bb309
- %tmp130 = icmp slt i32 0, 128 ; <i1> [#uses=1]
- %min = select i1 %tmp130, i32 0, i32 127 ; <i32> [#uses=2]
- %tmp143 = load i32* null ; <i32> [#uses=0]
- br i1 false, label %bb303, label %bb314
-cond_true166: ; preds = %bb303
- ret i32 0
-cond_false200: ; preds = %bb303
- %tmp205 = sdiv i32 %min, 2 ; <i32> [#uses=1]
- %iftmp.380.0.p = select i1 false, i32 0, i32 %tmp205 ; <i32> [#uses=0]
- ret i32 0
-bb303: ; preds = %cond_true114
- %tmp165 = icmp eq i32 %min, 0 ; <i1> [#uses=1]
- br i1 %tmp165, label %cond_true166, label %cond_false200
-bb309: ; preds = %entry
- br i1 false, label %cond_true114, label %bb314
-bb314: ; preds = %bb309, %cond_true114
- ret i32 0
-}
-
diff --git a/release_23/test/Transforms/PredicateSimplifier/2006-11-05-CycleGTLT.ll b/release_23/test/Transforms/PredicateSimplifier/2006-11-05-CycleGTLT.ll
deleted file mode 100644
index 87e0e16b5eea..000000000000
--- a/release_23/test/Transforms/PredicateSimplifier/2006-11-05-CycleGTLT.ll
+++ /dev/null
@@ -1,13 +0,0 @@
-; RUN: llvm-as < %s | opt -predsimplify -disable-output
-
-define void @diff(i32 %N) {
-entry:
- %tmp = icmp sgt i32 %N, 0 ; <i1> [#uses=1]
- br i1 %tmp, label %bb519, label %bb744
-bb519: ; preds = %entry
- %tmp720101 = icmp slt i32 %N, 0 ; <i1> [#uses=1]
- br i1 %tmp720101, label %bb744, label %bb744
-bb744: ; preds = %bb519, %bb519, %entry
- ret void
-}
-
diff --git a/release_23/test/Transforms/PredicateSimplifier/2006-11-11-Squeeze.ll b/release_23/test/Transforms/PredicateSimplifier/2006-11-11-Squeeze.ll
deleted file mode 100644
index 4f8af01bc399..000000000000
--- a/release_23/test/Transforms/PredicateSimplifier/2006-11-11-Squeeze.ll
+++ /dev/null
@@ -1,25 +0,0 @@
-; RUN: llvm-as < %s | opt -predsimplify -disable-output
-
- %struct.cube_struct = type { i32, i32, i32, i32*, i32*, i32*, i32*, i32*, i32*, i32*, i32**, i32**, i32*, i32*, i32, i32, i32*, i32, i32 }
-@cube = external global %struct.cube_struct ; <%struct.cube_struct*> [#uses=2]
-
-define fastcc void @cube_setup() {
-entry:
- %tmp = load i32* getelementptr (%struct.cube_struct* @cube, i32 0, i32 2) ; <i32> [#uses=2]
- %tmp.upgrd.1 = icmp slt i32 %tmp, 0 ; <i1> [#uses=1]
- br i1 %tmp.upgrd.1, label %bb, label %cond_next
-cond_next: ; preds = %entry
- %tmp2 = load i32* getelementptr (%struct.cube_struct* @cube, i32 0, i32 1) ; <i32> [#uses=2]
- %tmp5 = icmp slt i32 %tmp2, %tmp ; <i1> [#uses=1]
- br i1 %tmp5, label %bb, label %bb6
-bb: ; preds = %cond_next, %entry
- unreachable
-bb6: ; preds = %cond_next
- %tmp98124 = icmp sgt i32 %tmp2, 0 ; <i1> [#uses=1]
- br i1 %tmp98124, label %bb42, label %bb99
-bb42: ; preds = %bb6
- ret void
-bb99: ; preds = %bb6
- ret void
-}
-
diff --git a/release_23/test/Transforms/PredicateSimplifier/2006-11-12-MergeNodes.ll b/release_23/test/Transforms/PredicateSimplifier/2006-11-12-MergeNodes.ll
deleted file mode 100644
index 47f912de5e8b..000000000000
--- a/release_23/test/Transforms/PredicateSimplifier/2006-11-12-MergeNodes.ll
+++ /dev/null
@@ -1,41 +0,0 @@
-; RUN: llvm-as < %s | opt -predsimplify -disable-output
-; END.
-target datalayout = "e-p:32:32"
-target triple = "i686-pc-linux-gnu"
-deplibs = [ "c", "crtend" ]
- %struct.VDIR_ST = type { i32, i32, i32, %struct.acl*, %struct.pfile*, %struct.vlink*, %struct.vlink*, %struct.vlink*, %struct.VDIR_ST*, %struct.VDIR_ST* }
- %struct.acl = type { i32, i8*, i8*, i8*, %struct.restrict*, %struct.acl*, %struct.acl* }
- %struct.avalue = type { i8* }
- %struct.pattrib = type { i8, i8*, i8*, %struct.avalue, %struct.pattrib*, %struct.pattrib* }
- %struct.pfile = type { i32, i32, i32, i32, i32, %struct.vlink*, %struct.vlink*, %struct.pattrib*, %struct.pfile*, %struct.pfile* }
- %struct.restrict = type { %struct.acl*, %struct.acl* }
- %struct.vlink = type { i32, i8*, i8, i32, i8*, %struct.vlink*, %struct.vlink*, i8*, i8*, i8*, i8*, i32, i32, %struct.acl*, i32, i32, i8*, %struct.pattrib*, %struct.pfile*, %struct.vlink*, %struct.vlink* }
-
-define void @vl_insert(%struct.vlink* %vl) {
-entry:
- %tmp91 = call i32 @vl_comp( ) ; <i32> [#uses=2]
- %tmp93 = icmp sgt i32 %tmp91, 0 ; <i1> [#uses=1]
- br i1 %tmp93, label %cond_next84, label %bb94
-cond_next84: ; preds = %entry
- ret void
-bb94: ; preds = %entry
- %tmp96 = icmp eq i32 %tmp91, 0 ; <i1> [#uses=1]
- br i1 %tmp96, label %cond_true97, label %cond_next203
-cond_true97: ; preds = %bb94
- br i1 false, label %cond_next105, label %cond_true102
-cond_true102: ; preds = %cond_true97
- ret void
-cond_next105: ; preds = %cond_true97
- %tmp110 = getelementptr %struct.vlink* %vl, i32 0, i32 12 ; <i32*> [#uses=1]
- %tmp111 = load i32* %tmp110 ; <i32> [#uses=1]
- %tmp129 = icmp eq i32 %tmp111, 0 ; <i1> [#uses=1]
- br i1 %tmp129, label %cond_true130, label %cond_next133
-cond_true130: ; preds = %cond_next105
- ret void
-cond_next133: ; preds = %cond_next105
- ret void
-cond_next203: ; preds = %bb94
- ret void
-}
-
-declare i32 @vl_comp()
diff --git a/release_23/test/Transforms/PredicateSimplifier/2007-01-04-SelectSwitch.ll b/release_23/test/Transforms/PredicateSimplifier/2007-01-04-SelectSwitch.ll
deleted file mode 100644
index 8e45a6602acf..000000000000
--- a/release_23/test/Transforms/PredicateSimplifier/2007-01-04-SelectSwitch.ll
+++ /dev/null
@@ -1,17 +0,0 @@
-; RUN: llvm-as < %s | opt -predsimplify -disable-output
-
-define void @ercMarkCurrMBConcealed(i32 %comp) {
-entry:
- %tmp5 = icmp slt i32 %comp, 0 ; <i1> [#uses=2]
- %comp_addr.0 = select i1 %tmp5, i32 0, i32 %comp ; <i32> [#uses=1]
- switch i32 %comp_addr.0, label %return [
- i32 0, label %bb
- ]
-bb: ; preds = %entry
- br i1 %tmp5, label %bb87.bb97_crit_edge.critedge, label %return
-bb87.bb97_crit_edge.critedge: ; preds = %bb
- ret void
-return: ; preds = %bb, %entry
- ret void
-}
-
diff --git a/release_23/test/Transforms/PredicateSimplifier/2007-03-17-OpsToDefVRP.ll b/release_23/test/Transforms/PredicateSimplifier/2007-03-17-OpsToDefVRP.ll
deleted file mode 100644
index 0a45e7ce36a2..000000000000
--- a/release_23/test/Transforms/PredicateSimplifier/2007-03-17-OpsToDefVRP.ll
+++ /dev/null
@@ -1,19 +0,0 @@
-; RUN: llvm-as < %s | opt -predsimplify | llvm-dis | grep -v %c
-define void @foo(i8* %X, i8* %Y) {
-entry:
- %A = load i8* %X
- %B = load i8* %Y
- %a = icmp ult i8 %B, 10
- br i1 %a, label %cond_true, label %URB
-cond_true:
- %b = icmp eq i8 %A, %B
- br i1 %b, label %cond_true2, label %URB
-cond_true2:
- %c = icmp ult i8 %A, 11
- call i8 @bar(i1 %c)
- ret void
-URB:
- ret void
-}
-
-declare i8 @bar(i1)
diff --git a/release_23/test/Transforms/PredicateSimplifier/2007-09-19-Subtract.ll b/release_23/test/Transforms/PredicateSimplifier/2007-09-19-Subtract.ll
deleted file mode 100644
index e12453a76c41..000000000000
--- a/release_23/test/Transforms/PredicateSimplifier/2007-09-19-Subtract.ll
+++ /dev/null
@@ -1,102 +0,0 @@
-; RUN: llvm-as < %s | opt -predsimplify | llvm-dis | grep unreachable | count 2
-; PR1683
-
-@.str = internal constant [13 x i8] c"c36174a.adb\00\00" ; <[13 x i8]*> [#uses=1]
-
-define void @_ada_c36174a() {
-entry:
- %tmp3 = call i8* @llvm.stacksave( ) ; <i8*> [#uses=1]
- %tmp4 = invoke i32 @report__ident_int( i32 6 )
- to label %invcont unwind label %entry.lpad_crit_edge ; <i32> [#uses=7]
-
-entry.lpad_crit_edge: ; preds = %entry
- br label %lpad
-
-invcont: ; preds = %entry
- %tmp6 = icmp slt i32 %tmp4, 1 ; <i1> [#uses=1]
- br i1 %tmp6, label %bb, label %bb9
-
-bb: ; preds = %invcont
- invoke void @__gnat_rcheck_07( i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0), i32 10 )
- to label %invcont8 unwind label %bb.lpad_crit_edge
-
-bb.lpad_crit_edge: ; preds = %bb
- br label %lpad
-
-invcont8: ; preds = %bb
- unreachable
-
-bb9: ; preds = %invcont
- %tmp51 = add i32 %tmp4, 6 ; <i32> [#uses=2]
- %tmp56 = icmp sgt i32 %tmp4, %tmp51 ; <i1> [#uses=1]
- br i1 %tmp56, label %bb9.bb76_crit_edge, label %bb9.bb61_crit_edge
-
-bb9.bb61_crit_edge: ; preds = %bb9
- br label %bb61
-
-bb9.bb76_crit_edge: ; preds = %bb9
- br label %bb76
-
-bb61: ; preds = %bb73, %bb9.bb61_crit_edge
- %J4b.0 = phi i32 [ %tmp75, %bb73 ], [ %tmp4, %bb9.bb61_crit_edge ] ; <i32> [#uses=2]
- %tmp70 = icmp eq i32 %tmp51, %J4b.0 ; <i1> [#uses=1]
- br i1 %tmp70, label %bb61.bb76_crit_edge, label %bb73
-
-bb61.bb76_crit_edge: ; preds = %bb61
- br label %bb76
-
-bb73: ; preds = %bb61
- %tmp75 = add i32 %J4b.0, 1 ; <i32> [#uses=1]
- br label %bb61
-
-bb76: ; preds = %bb61.bb76_crit_edge, %bb9.bb76_crit_edge
- %tmp78 = icmp ne i32 %tmp4, 6 ; <i1> [#uses=1]
- %tmp81 = add i32 %tmp4, 6 ; <i32> [#uses=1]
- %tmp8182 = sext i32 %tmp81 to i64 ; <i64> [#uses=1]
- %tmp8384 = sext i32 %tmp4 to i64 ; <i64> [#uses=1]
- %tmp85 = sub i64 %tmp8182, %tmp8384 ; <i64> [#uses=1]
- %tmp86 = icmp ne i64 %tmp85, 6 ; <i1> [#uses=1]
- %tmp90 = or i1 %tmp78, %tmp86 ; <i1> [#uses=1]
- br i1 %tmp90, label %bb93, label %bb76.bb99_crit_edge
-
-bb76.bb99_crit_edge: ; preds = %bb76
- br label %bb99
-
-bb93: ; preds = %bb76
- invoke void @abort( )
- to label %bb93.bb99_crit_edge unwind label %bb93.lpad_crit_edge
-
-bb93.lpad_crit_edge: ; preds = %bb93
- br label %lpad
-
-bb93.bb99_crit_edge: ; preds = %bb93
- br label %bb99
-
-bb99: ; preds = %bb93.bb99_crit_edge, %bb76.bb99_crit_edge
- ret void
-
-lpad: ; preds = %bb93.lpad_crit_edge, %bb.lpad_crit_edge, %entry.lpad_crit_edge
- %eh_ptr = call i8* @llvm.eh.exception( ) ; <i8*> [#uses=2]
- %eh_select102 = call i32 (i8*, i8*, ...)* @llvm.eh.selector.i32( i8* %eh_ptr, i8* bitcast (i32 (...)* @__gnat_eh_personality to i8*), i32 0 ) ; <i32> [#uses=0]
- call void @llvm.stackrestore( i8* %tmp3 )
- call i32 (...)* @_Unwind_Resume( i8* %eh_ptr ) ; <i32>:0 [#uses=0]
- unreachable
-}
-
-declare i8* @llvm.stacksave()
-
-declare i32 @report__ident_int(i32)
-
-declare void @__gnat_rcheck_07(i8*, i32)
-
-declare void @abort()
-
-declare i8* @llvm.eh.exception()
-
-declare i32 @llvm.eh.selector.i32(i8*, i8*, ...)
-
-declare i32 @__gnat_eh_personality(...)
-
-declare i32 @_Unwind_Resume(...)
-
-declare void @llvm.stackrestore(i8*)
diff --git a/release_23/test/Transforms/PredicateSimplifier/dg.exp b/release_23/test/Transforms/PredicateSimplifier/dg.exp
deleted file mode 100644
index 879685ca879d..000000000000
--- a/release_23/test/Transforms/PredicateSimplifier/dg.exp
+++ /dev/null
@@ -1,3 +0,0 @@
-load_lib llvm.exp
-
-RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
diff --git a/release_23/test/Transforms/PredicateSimplifier/predsimplify.ll b/release_23/test/Transforms/PredicateSimplifier/predsimplify.ll
deleted file mode 100644
index a6848df69e3d..000000000000
--- a/release_23/test/Transforms/PredicateSimplifier/predsimplify.ll
+++ /dev/null
@@ -1,279 +0,0 @@
-; RUN: llvm-as < %s | \
-; RUN: opt -predsimplify -instcombine -simplifycfg | llvm-dis > %t
-; RUN: grep -v declare %t | not grep fail
-; RUN: grep -v declare %t | grep pass | count 4
-
-
-define void @test1(i32 %x) {
-entry:
- %A = icmp eq i32 %x, 0 ; <i1> [#uses=1]
- br i1 %A, label %then.1, label %else.1
-then.1: ; preds = %entry
- %B = icmp eq i32 %x, 1 ; <i1> [#uses=1]
- br i1 %B, label %then.2, label %else.1
-then.2: ; preds = %then.1
- call void (...)* @fail( )
- ret void
-else.1: ; preds = %then.1, %entry
- ret void
-}
-
-define void @test2(i32 %x) {
-entry:
- %A = icmp eq i32 %x, 0 ; <i1> [#uses=1]
- %B = icmp eq i32 %x, 1 ; <i1> [#uses=1]
- br i1 %A, label %then.1, label %else.1
-then.1: ; preds = %entry
- br i1 %B, label %then.2, label %else.1
-then.2: ; preds = %then.1
- call void (...)* @fail( )
- ret void
-else.1: ; preds = %then.1, %entry
- ret void
-}
-
-define void @test3(i32 %x) {
-entry:
- %A = icmp eq i32 %x, 0 ; <i1> [#uses=1]
- %B = icmp eq i32 %x, 1 ; <i1> [#uses=1]
- br i1 %A, label %then.1, label %else.1
-then.1: ; preds = %entry
- br i1 %B, label %then.2, label %else.1
-then.2: ; preds = %then.1
- call void (...)* @fail( )
- ret void
-else.1: ; preds = %then.1, %entry
- ret void
-}
-
-define void @test4(i32 %x, i32 %y) {
-entry:
- %A = icmp eq i32 %x, 0 ; <i1> [#uses=1]
- %B = icmp eq i32 %y, 0 ; <i1> [#uses=1]
- %C = and i1 %A, %B ; <i1> [#uses=1]
- br i1 %C, label %then.1, label %else.1
-then.1: ; preds = %entry
- %D = icmp eq i32 %x, 0 ; <i1> [#uses=1]
- br i1 %D, label %then.2, label %else.2
-then.2: ; preds = %then.1
- %E = icmp eq i32 %y, 0 ; <i1> [#uses=1]
- br i1 %E, label %else.1, label %else.2
-else.1: ; preds = %then.2, %entry
- ret void
-else.2: ; preds = %then.2, %then.1
- call void (...)* @fail( )
- ret void
-}
-
-define void @test5(i32 %x) {
-entry:
- %A = icmp eq i32 %x, 0 ; <i1> [#uses=1]
- br i1 %A, label %then.1, label %else.1
-then.1: ; preds = %else.1, %entry
- ret void
-then.2: ; preds = %else.1
- call void (...)* @fail( )
- ret void
-else.1: ; preds = %entry
- %B = icmp eq i32 %x, 0 ; <i1> [#uses=1]
- br i1 %B, label %then.2, label %then.1
-}
-
-define void @test6(i32 %x, i32 %y) {
-entry:
- %A = icmp eq i32 %x, 0 ; <i1> [#uses=1]
- %B = icmp eq i32 %y, 0 ; <i1> [#uses=1]
- %C = or i1 %A, %B ; <i1> [#uses=1]
- br i1 %C, label %then.1, label %else.1
-then.1: ; preds = %else.2, %entry
- ret void
-then.2: ; preds = %else.2, %else.1
- call void (...)* @fail( )
- ret void
-else.1: ; preds = %entry
- %D = icmp eq i32 %x, 0 ; <i1> [#uses=1]
- br i1 %D, label %then.2, label %else.2
-else.2: ; preds = %else.1
- %E = icmp ne i32 %y, 0 ; <i1> [#uses=1]
- br i1 %E, label %then.1, label %then.2
-}
-
-define void @test7(i32 %x) {
-entry:
- %A = icmp ne i32 %x, 0 ; <i1> [#uses=1]
- %B = xor i1 %A, true ; <i1> [#uses=1]
- br i1 %B, label %then.1, label %else.1
-then.1: ; preds = %entry
- %C = icmp eq i32 %x, 1 ; <i1> [#uses=1]
- br i1 %C, label %then.2, label %else.1
-then.2: ; preds = %then.1
- call void (...)* @fail( )
- ret void
-else.1: ; preds = %then.1, %entry
- ret void
-}
-
-define void @test8(i32 %x) {
-entry:
- %A = add i32 %x, 1 ; <i32> [#uses=1]
- %B = icmp eq i32 %x, 0 ; <i1> [#uses=1]
- br i1 %B, label %then.1, label %then.2
-then.1: ; preds = %entry
- %C = icmp eq i32 %A, 1 ; <i1> [#uses=1]
- br i1 %C, label %then.2, label %else.2
-then.2: ; preds = %then.1, %entry
- ret void
-else.2: ; preds = %then.1
- call void (...)* @fail( )
- ret void
-}
-
-define void @test9(i32 %y, i32 %z) {
-entry:
- %x = add i32 %y, %z ; <i32> [#uses=1]
- %A = icmp eq i32 %y, 3 ; <i1> [#uses=1]
- %B = icmp eq i32 %z, 5 ; <i1> [#uses=1]
- %C = and i1 %A, %B ; <i1> [#uses=1]
- br i1 %C, label %cond_true, label %return
-cond_true: ; preds = %entry
- %D = icmp eq i32 %x, 8 ; <i1> [#uses=1]
- br i1 %D, label %then, label %oops
-then: ; preds = %cond_true
- call void (...)* @pass( )
- ret void
-oops: ; preds = %cond_true
- call void (...)* @fail( )
- ret void
-return: ; preds = %entry
- ret void
-}
-
-define void @test10() {
-entry:
- %A = alloca i32 ; <i32*> [#uses=1]
- %B = icmp eq i32* %A, null ; <i1> [#uses=1]
- br i1 %B, label %cond_true, label %cond_false
-cond_true: ; preds = %entry
- call void (...)* @fail( )
- ret void
-cond_false: ; preds = %entry
- call void (...)* @pass( )
- ret void
-}
-
-define void @switch1(i32 %x) {
-entry:
- %A = icmp eq i32 %x, 10 ; <i1> [#uses=1]
- br i1 %A, label %return, label %cond_false
-cond_false: ; preds = %entry
- switch i32 %x, label %return [
- i32 9, label %then1
- i32 10, label %then2
- ]
-then1: ; preds = %cond_false
- call void (...)* @pass( )
- ret void
-then2: ; preds = %cond_false
- call void (...)* @fail( )
- ret void
-return: ; preds = %cond_false, %entry
- ret void
-}
-
-define void @switch2(i32 %x) {
-entry:
- %A = icmp eq i32 %x, 10 ; <i1> [#uses=1]
- br i1 %A, label %return, label %cond_false
-cond_false: ; preds = %entry
- switch i32 %x, label %return [
- i32 8, label %then1
- i32 9, label %then1
- i32 10, label %then1
- ]
-then1: ; preds = %cond_false, %cond_false, %cond_false
- %B = icmp ne i32 %x, 8 ; <i1> [#uses=1]
- br i1 %B, label %then2, label %return
-then2: ; preds = %then1
- call void (...)* @pass( )
- ret void
-return: ; preds = %then1, %cond_false, %entry
- ret void
-}
-
-define void @switch3(i32 %x) {
-entry:
- %A = icmp eq i32 %x, 10 ; <i1> [#uses=1]
- br i1 %A, label %return, label %cond_false
-cond_false: ; preds = %entry
- switch i32 %x, label %return [
- i32 9, label %then1
- i32 10, label %then1
- ]
-then1: ; preds = %cond_false, %cond_false
- %B = icmp eq i32 %x, 9 ; <i1> [#uses=1]
- br i1 %B, label %return, label %oops
-oops: ; preds = %then1
- call void (...)* @fail( )
- ret void
-return: ; preds = %then1, %cond_false, %entry
- ret void
-}
-
-define void @switch4(i32 %x) {
-entry:
- %A = icmp eq i32 %x, 10 ; <i1> [#uses=1]
- br i1 %A, label %then1, label %cond_false
-cond_false: ; preds = %entry
- switch i32 %x, label %default [
- i32 9, label %then1
- i32 10, label %then2
- ]
-then1: ; preds = %default, %cond_false, %entry
- ret void
-then2: ; preds = %cond_false
- ret void
-default: ; preds = %cond_false
- %B = icmp eq i32 %x, 9 ; <i1> [#uses=1]
- br i1 %B, label %oops, label %then1
-oops: ; preds = %default
- call void (...)* @fail( )
- ret void
-}
-
-define void @select1(i32 %x) {
-entry:
- %A = icmp eq i32 %x, 10 ; <i1> [#uses=3]
- %B = select i1 %A, i32 1, i32 2 ; <i32> [#uses=1]
- %C = icmp eq i32 %B, 1 ; <i1> [#uses=1]
- br i1 %C, label %then, label %else
-then: ; preds = %entry
- br i1 %A, label %return, label %oops
-else: ; preds = %entry
- br i1 %A, label %oops, label %return
-oops: ; preds = %else, %then
- call void (...)* @fail( )
- ret void
-return: ; preds = %else, %then
- ret void
-}
-
-define void @select2(i32 %x) {
-entry:
- %A = icmp eq i32 %x, 10 ; <i1> [#uses=2]
- %B = select i1 %A, i32 1, i32 2 ; <i32> [#uses=1]
- %C = icmp eq i32 %B, 1 ; <i1> [#uses=2]
- br i1 %A, label %then, label %else
-then: ; preds = %entry
- br i1 %C, label %return, label %oops
-else: ; preds = %entry
- br i1 %C, label %oops, label %return
-oops: ; preds = %else, %then
- call void (...)* @fail( )
- ret void
-return: ; preds = %else, %then
- ret void
-}
-
-declare void @fail(...)
-
-declare void @pass(...)
diff --git a/release_23/test/Transforms/PredicateSimplifier/predsimplify.reg1.ll b/release_23/test/Transforms/PredicateSimplifier/predsimplify.reg1.ll
deleted file mode 100644
index e98362b5ddda..000000000000
--- a/release_23/test/Transforms/PredicateSimplifier/predsimplify.reg1.ll
+++ /dev/null
@@ -1,20 +0,0 @@
-; RUN: llvm-as < %s | opt -predsimplify -verify
-
-define void @dgefa() {
-entry:
- br label %cond_true96
-cond_true: ; preds = %cond_true96
- %tmp19 = icmp eq i32 %tmp10, %k.0 ; <i1> [#uses=1]
- br i1 %tmp19, label %cond_next, label %cond_true20
-cond_true20: ; preds = %cond_true
- br label %cond_next
-cond_next: ; preds = %cond_true20, %cond_true
- %tmp84 = icmp sgt i32 %tmp3, 1999 ; <i1> [#uses=0]
- ret void
-cond_true96: ; preds = %cond_true96, %entry
- %k.0 = phi i32 [ 0, %entry ], [ 0, %cond_true96 ] ; <i32> [#uses=3]
- %tmp3 = add i32 %k.0, 1 ; <i32> [#uses=1]
- %tmp10 = add i32 0, %k.0 ; <i32> [#uses=1]
- br i1 false, label %cond_true96, label %cond_true
-}
-
diff --git a/release_23/test/Transforms/PredicateSimplifier/predsimplify.reg2.ll b/release_23/test/Transforms/PredicateSimplifier/predsimplify.reg2.ll
deleted file mode 100644
index 9c064eebe584..000000000000
--- a/release_23/test/Transforms/PredicateSimplifier/predsimplify.reg2.ll
+++ /dev/null
@@ -1,37 +0,0 @@
-; RUN: llvm-as < %s | opt -predsimplify -verify
-target datalayout = "e-p:32:32"
-target triple = "i686-pc-linux-gnu"
-deplibs = [ "c", "crtend" ]
- %struct.anon = type { %struct.set_family*, %struct.set_family*, %struct.set_family*, i8*, i32, i32*, %struct.pair_struct*, i8**, %struct.symbolic_t*, %struct.symbolic_t* }
- %struct.pair_struct = type { i32, i32*, i32* }
- %struct.set_family = type { i32, i32, i32, i32, i32, i32*, %struct.set_family* }
- %struct.symbolic_label_t = type { i8*, %struct.symbolic_label_t* }
- %struct.symbolic_list_t = type { i32, i32, %struct.symbolic_list_t* }
- %struct.symbolic_t = type { %struct.symbolic_list_t*, i32, %struct.symbolic_label_t*, i32, %struct.symbolic_t* }
-
-define void @find_pairing_cost(i32 %strategy) {
-entry:
- br i1 false, label %cond_true299, label %bb314
-bb94: ; preds = %cond_true299
- switch i32 %strategy, label %bb246 [
- i32 0, label %bb196
- i32 1, label %bb159
- ]
-cond_next113: ; preds = %cond_true299
- switch i32 %strategy, label %bb246 [
- i32 0, label %bb196
- i32 1, label %bb159
- ]
-bb159: ; preds = %cond_next113, %bb94
- ret void
-bb196: ; preds = %cond_next113, %bb94
- %Rsave.0.3 = phi %struct.set_family* [ null, %bb94 ], [ null, %cond_next113 ] ; <%struct.set_family*> [#uses=0]
- ret void
-bb246: ; preds = %cond_next113, %bb94
- br label %bb314
-cond_true299: ; preds = %entry
- %tmp55 = icmp sgt i32 %strategy, 0 ; <i1> [#uses=1]
- br i1 %tmp55, label %bb94, label %cond_next113
-bb314: ; preds = %bb246, %entry
- ret void
-}
diff --git a/release_23/test/Transforms/PredicateSimplifier/predsimplify.reg3.ll b/release_23/test/Transforms/PredicateSimplifier/predsimplify.reg3.ll
deleted file mode 100644
index 190cc900689e..000000000000
--- a/release_23/test/Transforms/PredicateSimplifier/predsimplify.reg3.ll
+++ /dev/null
@@ -1,22 +0,0 @@
-; RUN: llvm-as < %s | opt -predsimplify -simplifycfg | llvm-dis | grep pass
-
-define void @regtest(i32 %x) {
-entry:
- %A = icmp eq i32 %x, 0 ; <i1> [#uses=1]
- br i1 %A, label %middle, label %after
-middle: ; preds = %entry
- br label %after
-after: ; preds = %middle, %entry
- %B = icmp eq i32 %x, 0 ; <i1> [#uses=1]
- br i1 %B, label %then, label %else
-then: ; preds = %after
- br label %end
-else: ; preds = %after
- call void (...)* @pass( )
- br label %end
-end: ; preds = %else, %then
- ret void
-}
-
-declare void @pass(...)
-
diff --git a/release_23/test/Transforms/PredicateSimplifier/predsimplify.reg4.ll b/release_23/test/Transforms/PredicateSimplifier/predsimplify.reg4.ll
deleted file mode 100644
index 092a49e7a38e..000000000000
--- a/release_23/test/Transforms/PredicateSimplifier/predsimplify.reg4.ll
+++ /dev/null
@@ -1,28 +0,0 @@
-; RUN: llvm-as < %s | opt -predsimplify -disable-output
-target datalayout = "e-p:32:32"
-target triple = "i686-pc-linux-gnu"
-
-define void @f(i32 %x, i32 %y) {
-entry:
- %tmp = icmp eq i32 %x, 10 ; <i1> [#uses=1]
- %tmp.not = xor i1 %tmp, true ; <i1> [#uses=1]
- %tmp3 = icmp eq i32 %x, %y ; <i1> [#uses=1]
- %bothcond = and i1 %tmp.not, %tmp3 ; <i1> [#uses=1]
- br i1 %bothcond, label %cond_true4, label %return
-cond_true4: ; preds = %entry
- switch i32 %y, label %return [
- i32 9, label %bb
- i32 10, label %bb6
- ]
-bb: ; preds = %cond_true4
- call void @g( i32 9 )
- ret void
-bb6: ; preds = %cond_true4
- call void @g( i32 10 )
- ret void
-return: ; preds = %cond_true4, %entry
- ret void
-}
-
-declare void @g(i32)
-
diff --git a/release_23/test/Transforms/PruneEH/2003-09-14-ExternalCall.ll b/release_23/test/Transforms/PruneEH/2003-09-14-ExternalCall.ll
deleted file mode 100644
index 7fc912563e1f..000000000000
--- a/release_23/test/Transforms/PruneEH/2003-09-14-ExternalCall.ll
+++ /dev/null
@@ -1,11 +0,0 @@
-; RUN: llvm-as < %s | opt -prune-eh | llvm-dis | grep invoke
-
-declare void @External()
-
-define void @foo() {
- invoke void @External( )
- to label %Cont unwind label %Cont
-Cont: ; preds = %0, %0
- ret void
-}
-
diff --git a/release_23/test/Transforms/PruneEH/2003-11-21-PHIUpdate.ll b/release_23/test/Transforms/PruneEH/2003-11-21-PHIUpdate.ll
deleted file mode 100644
index 8333cd8f722c..000000000000
--- a/release_23/test/Transforms/PruneEH/2003-11-21-PHIUpdate.ll
+++ /dev/null
@@ -1,15 +0,0 @@
-; RUN: llvm-as < %s | opt -prune-eh -disable-output
-
-define internal void @callee() {
- ret void
-}
-
-define i32 @caller() {
-; <label>:0
- invoke void @callee( )
- to label %E unwind label %E
-E: ; preds = %0, %0
- %X = phi i32 [ 0, %0 ], [ 0, %0 ] ; <i32> [#uses=1]
- ret i32 %X
-}
-
diff --git a/release_23/test/Transforms/PruneEH/dg.exp b/release_23/test/Transforms/PruneEH/dg.exp
deleted file mode 100644
index 879685ca879d..000000000000
--- a/release_23/test/Transforms/PruneEH/dg.exp
+++ /dev/null
@@ -1,3 +0,0 @@
-load_lib llvm.exp
-
-RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
diff --git a/release_23/test/Transforms/PruneEH/recursivetest.ll b/release_23/test/Transforms/PruneEH/recursivetest.ll
deleted file mode 100644
index 231c7b373819..000000000000
--- a/release_23/test/Transforms/PruneEH/recursivetest.ll
+++ /dev/null
@@ -1,20 +0,0 @@
-; RUN: llvm-as < %s | opt -prune-eh | llvm-dis | not grep invoke
-
-define internal i32 @foo() {
- invoke i32 @foo( )
- to label %Normal unwind label %Except ; <i32>:1 [#uses=0]
-Normal: ; preds = %0
- ret i32 12
-Except: ; preds = %0
- ret i32 123
-}
-
-define i32 @caller() {
- invoke i32 @foo( )
- to label %Normal unwind label %Except ; <i32>:1 [#uses=0]
-Normal: ; preds = %0
- ret i32 0
-Except: ; preds = %0
- ret i32 1
-}
-
diff --git a/release_23/test/Transforms/PruneEH/simplenoreturntest.ll b/release_23/test/Transforms/PruneEH/simplenoreturntest.ll
deleted file mode 100644
index d2bd50cf5da7..000000000000
--- a/release_23/test/Transforms/PruneEH/simplenoreturntest.ll
+++ /dev/null
@@ -1,13 +0,0 @@
-; RUN: llvm-as < %s | opt -prune-eh | llvm-dis | not grep {ret i32}
-
-declare void @noreturn() noreturn;
-
-define i32 @caller() {
- call void @noreturn( )
- ret i32 17
-}
-
-define i32 @caller2() {
- %T = call i32 @caller( ) ; <i32> [#uses=1]
- ret i32 %T
-}
diff --git a/release_23/test/Transforms/PruneEH/simpletest.ll b/release_23/test/Transforms/PruneEH/simpletest.ll
deleted file mode 100644
index 678e8d76b680..000000000000
--- a/release_23/test/Transforms/PruneEH/simpletest.ll
+++ /dev/null
@@ -1,19 +0,0 @@
-; RUN: llvm-as < %s | opt -prune-eh | llvm-dis | not grep invoke
-
-declare void @nounwind() nounwind
-
-define internal void @foo() {
- call void @nounwind()
- ret void
-}
-
-define i32 @caller() {
- invoke void @foo( )
- to label %Normal unwind label %Except
-
-Normal: ; preds = %0
- ret i32 0
-
-Except: ; preds = %0
- ret i32 1
-}
diff --git a/release_23/test/Transforms/RaiseAllocations/2004-11-08-FreeUseCrash.ll b/release_23/test/Transforms/RaiseAllocations/2004-11-08-FreeUseCrash.ll
deleted file mode 100644
index 10daa7620d22..000000000000
--- a/release_23/test/Transforms/RaiseAllocations/2004-11-08-FreeUseCrash.ll
+++ /dev/null
@@ -1,10 +0,0 @@
-; RUN: llvm-as < %s | opt -raiseallocs -disable-output
-
-define void @main() {
- %tmp.13 = call i32 (...)* @free( i32 32 ) ; <i32> [#uses=1]
- %tmp.14 = inttoptr i32 %tmp.13 to i32* ; <i32*> [#uses=0]
- ret void
-}
-
-declare i32 @free(...)
-
diff --git a/release_23/test/Transforms/RaiseAllocations/2007-10-17-InvokeFree.ll b/release_23/test/Transforms/RaiseAllocations/2007-10-17-InvokeFree.ll
deleted file mode 100644
index 513cf6f339b1..000000000000
--- a/release_23/test/Transforms/RaiseAllocations/2007-10-17-InvokeFree.ll
+++ /dev/null
@@ -1,17 +0,0 @@
-; RUN: llvm-as <%s | opt -raiseallocs -stats -disable-output |& \
-; RUN: not grep {Number of allocations raised}
-define void @foo() {
-entry:
- %buffer = alloca i16*
- %tmp = load i16** %buffer, align 8
- invoke i32(...)* @free(i16* %tmp)
- to label %invcont unwind label %unwind
-invcont:
- br label %finally
-unwind:
- br label %finally
-finally:
- ret void
-}
-declare i32 @free(...)
-
diff --git a/release_23/test/Transforms/RaiseAllocations/FreeCastConstantExpr.ll b/release_23/test/Transforms/RaiseAllocations/FreeCastConstantExpr.ll
deleted file mode 100644
index 4521581b3879..000000000000
--- a/release_23/test/Transforms/RaiseAllocations/FreeCastConstantExpr.ll
+++ /dev/null
@@ -1,11 +0,0 @@
-; This situation can occur due to the funcresolve pass.
-;
-; RUN: llvm-as < %s | opt -raiseallocs | llvm-dis | not grep call
-
-declare void @free(i8*)
-
-define void @test(i32* %P) {
- call void bitcast (void (i8*)* @free to void (i32*)*)( i32* %P )
- ret void
-}
-
diff --git a/release_23/test/Transforms/RaiseAllocations/dg.exp b/release_23/test/Transforms/RaiseAllocations/dg.exp
deleted file mode 100644
index 879685ca879d..000000000000
--- a/release_23/test/Transforms/RaiseAllocations/dg.exp
+++ /dev/null
@@ -1,3 +0,0 @@
-load_lib llvm.exp
-
-RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
diff --git a/release_23/test/Transforms/Reassociate/2002-05-15-AgressiveSubMove.ll b/release_23/test/Transforms/Reassociate/2002-05-15-AgressiveSubMove.ll
deleted file mode 100644
index 5465418d00de..000000000000
--- a/release_23/test/Transforms/Reassociate/2002-05-15-AgressiveSubMove.ll
+++ /dev/null
@@ -1,9 +0,0 @@
-; RUN: llvm-as < %s | opt -reassociate -instcombine -constprop -dce | llvm-dis | not grep add
-
-define i32 @test(i32 %A) {
- %X = add i32 %A, 1 ; <i32> [#uses=1]
- %Y = add i32 %A, 1 ; <i32> [#uses=1]
- %r = sub i32 %X, %Y ; <i32> [#uses=1]
- ret i32 %r
-}
-
diff --git a/release_23/test/Transforms/Reassociate/2002-05-15-MissedTree.ll b/release_23/test/Transforms/Reassociate/2002-05-15-MissedTree.ll
deleted file mode 100644
index 79afb6e64c13..000000000000
--- a/release_23/test/Transforms/Reassociate/2002-05-15-MissedTree.ll
+++ /dev/null
@@ -1,9 +0,0 @@
-; RUN: llvm-as < %s | opt -reassociate -instcombine -constprop -die | llvm-dis | not grep 5
-
-define i32 @test(i32 %A, i32 %B) {
- %W = add i32 %B, -5 ; <i32> [#uses=1]
- %Y = add i32 %A, 5 ; <i32> [#uses=1]
- %Z = add i32 %W, %Y ; <i32> [#uses=1]
- ret i32 %Z
-}
-
diff --git a/release_23/test/Transforms/Reassociate/2002-05-15-SubReassociate.ll b/release_23/test/Transforms/Reassociate/2002-05-15-SubReassociate.ll
deleted file mode 100644
index de0666e95617..000000000000
--- a/release_23/test/Transforms/Reassociate/2002-05-15-SubReassociate.ll
+++ /dev/null
@@ -1,12 +0,0 @@
-; With sub reassociation, constant folding can eliminate all of the constants.
-;
-; RUN: llvm-as < %s | opt -reassociate -constprop -instcombine -dce | llvm-dis | not grep add
-
-define i32 @test(i32 %A, i32 %B) {
- %W = add i32 5, %B ; <i32> [#uses=1]
- %X = add i32 -7, %A ; <i32> [#uses=1]
- %Y = sub i32 %X, %W ; <i32> [#uses=1]
- %Z = add i32 %Y, 12 ; <i32> [#uses=1]
- ret i32 %Z
-}
-
diff --git a/release_23/test/Transforms/Reassociate/2002-05-15-SubReassociate2.ll b/release_23/test/Transforms/Reassociate/2002-05-15-SubReassociate2.ll
deleted file mode 100644
index 070080acf24f..000000000000
--- a/release_23/test/Transforms/Reassociate/2002-05-15-SubReassociate2.ll
+++ /dev/null
@@ -1,13 +0,0 @@
-; With sub reassociation, constant folding can eliminate the two 12 constants.
-;
-; RUN: llvm-as < %s | opt -reassociate -constprop -dce | llvm-dis | not grep 12
-
-define i32 @test(i32 %A, i32 %B, i32 %C, i32 %D) {
- %M = add i32 %A, 12 ; <i32> [#uses=1]
- %N = add i32 %M, %B ; <i32> [#uses=1]
- %O = add i32 %N, %C ; <i32> [#uses=1]
- %P = sub i32 %D, %O ; <i32> [#uses=1]
- %Q = add i32 %P, 12 ; <i32> [#uses=1]
- ret i32 %Q
-}
-
diff --git a/release_23/test/Transforms/Reassociate/2002-07-09-DominanceProblem.ll b/release_23/test/Transforms/Reassociate/2002-07-09-DominanceProblem.ll
deleted file mode 100644
index c19baeaae68f..000000000000
--- a/release_23/test/Transforms/Reassociate/2002-07-09-DominanceProblem.ll
+++ /dev/null
@@ -1,10 +0,0 @@
-; The reassociate pass is not preserving dominance properties correctly
-;
-; RUN: llvm-as < %s | opt -reassociate
-
-define i32 @compute_dist(i32 %i, i32 %j) {
- %reg119 = sub i32 %j, %i ; <i32> [#uses=1]
- ret i32 %reg119
-}
-
-
diff --git a/release_23/test/Transforms/Reassociate/2003-08-12-InfiniteLoop.ll b/release_23/test/Transforms/Reassociate/2003-08-12-InfiniteLoop.ll
deleted file mode 100644
index 41cba63d8fda..000000000000
--- a/release_23/test/Transforms/Reassociate/2003-08-12-InfiniteLoop.ll
+++ /dev/null
@@ -1,9 +0,0 @@
-; RUN: llvm-as < %s | opt -reassociate -disable-output
-
-define i32 @test(i32 %A.1, i32 %B.1, i32 %C.1, i32 %D.1) {
- %tmp.16 = and i32 %A.1, %B.1 ; <i32> [#uses=1]
- %tmp.18 = and i32 %tmp.16, %C.1 ; <i32> [#uses=1]
- %tmp.20 = and i32 %tmp.18, %D.1 ; <i32> [#uses=1]
- ret i32 %tmp.20
-}
-
diff --git a/release_23/test/Transforms/Reassociate/2005-08-24-Crash.ll b/release_23/test/Transforms/Reassociate/2005-08-24-Crash.ll
deleted file mode 100644
index 99c98ef5932c..000000000000
--- a/release_23/test/Transforms/Reassociate/2005-08-24-Crash.ll
+++ /dev/null
@@ -1,13 +0,0 @@
-; RUN: llvm-as < %s | opt -reassociate -disable-output
-
-define void @test(i32 %a, i32 %b, i32 %c, i32 %d) {
- %tmp.2 = xor i32 %a, %b ; <i32> [#uses=1]
- %tmp.5 = xor i32 %c, %d ; <i32> [#uses=1]
- %tmp.6 = xor i32 %tmp.2, %tmp.5 ; <i32> [#uses=1]
- %tmp.9 = xor i32 %c, %a ; <i32> [#uses=1]
- %tmp.12 = xor i32 %b, %d ; <i32> [#uses=1]
- %tmp.13 = xor i32 %tmp.9, %tmp.12 ; <i32> [#uses=1]
- %tmp.16 = xor i32 %tmp.6, %tmp.13 ; <i32> [#uses=0]
- ret void
-}
-
diff --git a/release_23/test/Transforms/Reassociate/2005-09-01-ArrayOutOfBounds.ll b/release_23/test/Transforms/Reassociate/2005-09-01-ArrayOutOfBounds.ll
deleted file mode 100644
index d11a2ea767a9..000000000000
--- a/release_23/test/Transforms/Reassociate/2005-09-01-ArrayOutOfBounds.ll
+++ /dev/null
@@ -1,23 +0,0 @@
-; RUN: llvm-as < %s | opt -reassociate -instcombine | llvm-dis |\
-; RUN: grep {ret i32 0}
-
-define i32 @f(i32 %a0, i32 %a1, i32 %a2, i32 %a3, i32 %a4) {
- %tmp.2 = add i32 %a4, %a3 ; <i32> [#uses=1]
- %tmp.4 = add i32 %tmp.2, %a2 ; <i32> [#uses=1]
- %tmp.6 = add i32 %tmp.4, %a1 ; <i32> [#uses=1]
- %tmp.8 = add i32 %tmp.6, %a0 ; <i32> [#uses=1]
- %tmp.11 = add i32 %a3, %a2 ; <i32> [#uses=1]
- %tmp.13 = add i32 %tmp.11, %a1 ; <i32> [#uses=1]
- %tmp.15 = add i32 %tmp.13, %a0 ; <i32> [#uses=1]
- %tmp.18 = add i32 %a2, %a1 ; <i32> [#uses=1]
- %tmp.20 = add i32 %tmp.18, %a0 ; <i32> [#uses=1]
- %tmp.23 = add i32 %a1, %a0 ; <i32> [#uses=1]
- %tmp.26 = sub i32 %tmp.8, %tmp.15 ; <i32> [#uses=1]
- %tmp.28 = add i32 %tmp.26, %tmp.20 ; <i32> [#uses=1]
- %tmp.30 = sub i32 %tmp.28, %tmp.23 ; <i32> [#uses=1]
- %tmp.32 = sub i32 %tmp.30, %a4 ; <i32> [#uses=1]
- %tmp.34 = sub i32 %tmp.32, %a2 ; <i32> [#uses=2]
- %T = mul i32 %tmp.34, %tmp.34 ; <i32> [#uses=1]
- ret i32 %T
-}
-
diff --git a/release_23/test/Transforms/Reassociate/2006-04-27-ReassociateVector.ll b/release_23/test/Transforms/Reassociate/2006-04-27-ReassociateVector.ll
deleted file mode 100644
index 05d6103bbfd3..000000000000
--- a/release_23/test/Transforms/Reassociate/2006-04-27-ReassociateVector.ll
+++ /dev/null
@@ -1,8 +0,0 @@
-; RUN: llvm-as < %s | opt -reassociate -disable-output
-
-define void @foo() {
- %tmp162 = sub <4 x float> zeroinitializer, zeroinitializer ; <<4 x float>> [#uses=1]
- %tmp164 = mul <4 x float> zeroinitializer, %tmp162 ; <<4 x float>> [#uses=0]
- ret void
-}
-
diff --git a/release_23/test/Transforms/Reassociate/basictest.ll b/release_23/test/Transforms/Reassociate/basictest.ll
deleted file mode 100644
index 09db47b1907c..000000000000
--- a/release_23/test/Transforms/Reassociate/basictest.ll
+++ /dev/null
@@ -1,10 +0,0 @@
-; With reassociation, constant folding can eliminate the 12 and -12 constants.
-;
-; RUN: llvm-as < %s | opt -reassociate -constprop -instcombine -die | llvm-dis | not grep add
-
-define i32 @test(i32 %arg) {
- %tmp1 = sub i32 -12, %arg ; <i32> [#uses=1]
- %tmp2 = add i32 %tmp1, 12 ; <i32> [#uses=1]
- ret i32 %tmp2
-}
-
diff --git a/release_23/test/Transforms/Reassociate/basictest2.ll b/release_23/test/Transforms/Reassociate/basictest2.ll
deleted file mode 100644
index dbde3af35e1b..000000000000
--- a/release_23/test/Transforms/Reassociate/basictest2.ll
+++ /dev/null
@@ -1,11 +0,0 @@
-; With reassociation, constant folding can eliminate the +/- 30 constants.
-;
-; RUN: llvm-as < %s | opt -reassociate -constprop -instcombine -die | llvm-dis | not grep 30
-
-define i32 @test(i32 %reg109, i32 %reg1111) {
- %reg115 = add i32 %reg109, -30 ; <i32> [#uses=1]
- %reg116 = add i32 %reg115, %reg1111 ; <i32> [#uses=1]
- %reg117 = add i32 %reg116, 30 ; <i32> [#uses=1]
- ret i32 %reg117
-}
-
diff --git a/release_23/test/Transforms/Reassociate/basictest3.ll b/release_23/test/Transforms/Reassociate/basictest3.ll
deleted file mode 100644
index 71a6cf656d44..000000000000
--- a/release_23/test/Transforms/Reassociate/basictest3.ll
+++ /dev/null
@@ -1,54 +0,0 @@
-; RUN: llvm-as < %s | opt -reassociate -gcse | llvm-dis | grep add | count 6
-; Each of these functions should turn into two adds each.
-
-@e = external global i32 ; <i32*> [#uses=3]
-@a = external global i32 ; <i32*> [#uses=3]
-@b = external global i32 ; <i32*> [#uses=3]
-@c = external global i32 ; <i32*> [#uses=3]
-@f = external global i32 ; <i32*> [#uses=3]
-
-define void @test1() {
- %A = load i32* @a ; <i32> [#uses=2]
- %B = load i32* @b ; <i32> [#uses=2]
- %C = load i32* @c ; <i32> [#uses=2]
- %t1 = add i32 %A, %B ; <i32> [#uses=1]
- %t2 = add i32 %t1, %C ; <i32> [#uses=1]
- %t3 = add i32 %C, %A ; <i32> [#uses=1]
- %t4 = add i32 %t3, %B ; <i32> [#uses=1]
- ; e = (a+b)+c;
- store i32 %t2, i32* @e
- ; f = (a+c)+b
- store i32 %t4, i32* @f
- ret void
-}
-
-define void @test2() {
- %A = load i32* @a ; <i32> [#uses=2]
- %B = load i32* @b ; <i32> [#uses=2]
- %C = load i32* @c ; <i32> [#uses=2]
- %t1 = add i32 %A, %B ; <i32> [#uses=1]
- %t2 = add i32 %t1, %C ; <i32> [#uses=1]
- %t3 = add i32 %C, %A ; <i32> [#uses=1]
- %t4 = add i32 %t3, %B ; <i32> [#uses=1]
- ; e = c+(a+b)
- store i32 %t2, i32* @e
- ; f = (c+a)+b
- store i32 %t4, i32* @f
- ret void
-}
-
-define void @test3() {
- %A = load i32* @a ; <i32> [#uses=2]
- %B = load i32* @b ; <i32> [#uses=2]
- %C = load i32* @c ; <i32> [#uses=2]
- %t1 = add i32 %B, %A ; <i32> [#uses=1]
- %t2 = add i32 %t1, %C ; <i32> [#uses=1]
- %t3 = add i32 %C, %A ; <i32> [#uses=1]
- %t4 = add i32 %t3, %B ; <i32> [#uses=1]
- ; e = c+(b+a)
- store i32 %t2, i32* @e
- ; f = (c+a)+b
- store i32 %t4, i32* @f
- ret void
-}
-
diff --git a/release_23/test/Transforms/Reassociate/basictest4.ll b/release_23/test/Transforms/Reassociate/basictest4.ll
deleted file mode 100644
index fbf86a9f5830..000000000000
--- a/release_23/test/Transforms/Reassociate/basictest4.ll
+++ /dev/null
@@ -1,23 +0,0 @@
-; RUN: llvm-as < %s | opt -reassociate -gcse -instcombine | llvm-dis | not grep add
-
-@a = weak global i32 0 ; <i32*> [#uses=1]
-@b = weak global i32 0 ; <i32*> [#uses=1]
-@c = weak global i32 0 ; <i32*> [#uses=1]
-@d = weak global i32 0 ; <i32*> [#uses=0]
-
-define i32 @foo() {
- %tmp.0 = load i32* @a ; <i32> [#uses=2]
- %tmp.1 = load i32* @b ; <i32> [#uses=2]
- ; (a+b)
- %tmp.2 = add i32 %tmp.0, %tmp.1 ; <i32> [#uses=1]
- %tmp.4 = load i32* @c ; <i32> [#uses=2]
- ; (a+b)+c
- %tmp.5 = add i32 %tmp.2, %tmp.4 ; <i32> [#uses=1]
- ; (a+c)
- %tmp.8 = add i32 %tmp.0, %tmp.4 ; <i32> [#uses=1]
- ; (a+c)+b
- %tmp.11 = add i32 %tmp.8, %tmp.1 ; <i32> [#uses=1]
- ; X ^ X = 0
- %RV = xor i32 %tmp.5, %tmp.11 ; <i32> [#uses=1]
- ret i32 %RV
-}
diff --git a/release_23/test/Transforms/Reassociate/dg.exp b/release_23/test/Transforms/Reassociate/dg.exp
deleted file mode 100644
index 879685ca879d..000000000000
--- a/release_23/test/Transforms/Reassociate/dg.exp
+++ /dev/null
@@ -1,3 +0,0 @@
-load_lib llvm.exp
-
-RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
diff --git a/release_23/test/Transforms/Reassociate/inverses.ll b/release_23/test/Transforms/Reassociate/inverses.ll
deleted file mode 100644
index 5b08d0eec675..000000000000
--- a/release_23/test/Transforms/Reassociate/inverses.ll
+++ /dev/null
@@ -1,28 +0,0 @@
-; RUN: llvm-as < %s | opt -reassociate -dce | llvm-dis | \
-; RUN: not grep {\\(and\\|sub\\)}
-
-define i32 @test1(i32 %a, i32 %b) {
- %tmp.2 = and i32 %b, %a ; <i32> [#uses=1]
- %tmp.4 = xor i32 %a, -1 ; <i32> [#uses=1]
- ; (A&B)&~A == 0
- %tmp.5 = and i32 %tmp.2, %tmp.4 ; <i32> [#uses=1]
- ret i32 %tmp.5
-}
-
-define i32 @test2(i32 %a, i32 %b) {
- %tmp.1 = and i32 %a, 1234 ; <i32> [#uses=1]
- %tmp.2 = and i32 %b, %tmp.1 ; <i32> [#uses=1]
- %tmp.4 = xor i32 %a, -1 ; <i32> [#uses=1]
- ; A&~A == 0
- %tmp.5 = and i32 %tmp.2, %tmp.4 ; <i32> [#uses=1]
- ret i32 %tmp.5
-}
-
-define i32 @test3(i32 %b, i32 %a) {
- %tmp.1 = add i32 %a, 1234 ; <i32> [#uses=1]
- %tmp.2 = add i32 %b, %tmp.1 ; <i32> [#uses=1]
- %tmp.4 = sub i32 0, %a ; <i32> [#uses=1]
- ; (b+(a+1234))+-a -> b+1234
- %tmp.5 = add i32 %tmp.2, %tmp.4 ; <i32> [#uses=1]
- ret i32 %tmp.5
-}
diff --git a/release_23/test/Transforms/Reassociate/looptest.ll b/release_23/test/Transforms/Reassociate/looptest.ll
deleted file mode 100644
index 3b28c2389538..000000000000
--- a/release_23/test/Transforms/Reassociate/looptest.ll
+++ /dev/null
@@ -1,50 +0,0 @@
-; This testcase comes from this C fragment:
-;
-; void test(unsigned Num, int *Array) {
-; unsigned i, j, k;
-;
-; for (i = 0; i != Num; ++i)
-; for (j = 0; j != Num; ++j)
-; for (k = 0; k != Num; ++k)
-; printf("%d\n", i+k+j); /* Reassociate to (i+j)+k */
-;}
-;
-; In this case, we want to reassociate the specified expr so that i+j can be
-; hoisted out of the inner most loop.
-;
-; RUN: llvm-as < %s | opt -reassociate | llvm-dis | grep 115 | not grep 117
-; END.
-@.LC0 = internal global [4 x i8] c"%d\0A\00" ; <[4 x i8]*> [#uses=1]
-
-declare i32 @printf(i8*, ...)
-
-define void @test(i32 %Num, i32* %Array) {
-bb0:
- %cond221 = icmp eq i32 0, %Num ; <i1> [#uses=3]
- br i1 %cond221, label %bb7, label %bb2
-bb2: ; preds = %bb6, %bb0
- %reg115 = phi i32 [ %reg120, %bb6 ], [ 0, %bb0 ] ; <i32> [#uses=2]
- br i1 %cond221, label %bb6, label %bb3
-bb3: ; preds = %bb5, %bb2
- %reg116 = phi i32 [ %reg119, %bb5 ], [ 0, %bb2 ] ; <i32> [#uses=2]
- br i1 %cond221, label %bb5, label %bb4
-bb4: ; preds = %bb4, %bb3
- %reg117 = phi i32 [ %reg118, %bb4 ], [ 0, %bb3 ] ; <i32> [#uses=2]
- %reg113 = add i32 %reg115, %reg117 ; <i32> [#uses=1]
- %reg114 = add i32 %reg113, %reg116 ; <i32> [#uses=1]
- %cast227 = getelementptr [4 x i8]* @.LC0, i64 0, i64 0 ; <i8*> [#uses=1]
- call i32 (i8*, ...)* @printf( i8* %cast227, i32 %reg114 ) ; <i32>:0 [#uses=0]
- %reg118 = add i32 %reg117, 1 ; <i32> [#uses=2]
- %cond224 = icmp ne i32 %reg118, %Num ; <i1> [#uses=1]
- br i1 %cond224, label %bb4, label %bb5
-bb5: ; preds = %bb4, %bb3
- %reg119 = add i32 %reg116, 1 ; <i32> [#uses=2]
- %cond225 = icmp ne i32 %reg119, %Num ; <i1> [#uses=1]
- br i1 %cond225, label %bb3, label %bb6
-bb6: ; preds = %bb5, %bb2
- %reg120 = add i32 %reg115, 1 ; <i32> [#uses=2]
- %cond226 = icmp ne i32 %reg120, %Num ; <i1> [#uses=1]
- br i1 %cond226, label %bb2, label %bb7
-bb7: ; preds = %bb6, %bb0
- ret void
-}
diff --git a/release_23/test/Transforms/Reassociate/mul-factor3.ll b/release_23/test/Transforms/Reassociate/mul-factor3.ll
deleted file mode 100644
index e45e431df545..000000000000
--- a/release_23/test/Transforms/Reassociate/mul-factor3.ll
+++ /dev/null
@@ -1,16 +0,0 @@
-; This should be one add and two multiplies.
-
-; RUN: llvm-as < %s | \
-; RUN: opt -reassociate -instcombine | llvm-dis > %t
-; RUN: grep mul %t | count 2
-; RUN: grep add %t | count 1
-
-define i32 @test(i32 %A, i32 %B, i32 %C) {
- %aa = mul i32 %A, %A ; <i32> [#uses=1]
- %aab = mul i32 %aa, %B ; <i32> [#uses=1]
- %ac = mul i32 %A, %C ; <i32> [#uses=1]
- %aac = mul i32 %ac, %A ; <i32> [#uses=1]
- %r = add i32 %aab, %aac ; <i32> [#uses=1]
- ret i32 %r
-}
-
diff --git a/release_23/test/Transforms/Reassociate/mul-neg-add.ll b/release_23/test/Transforms/Reassociate/mul-neg-add.ll
deleted file mode 100644
index 1899be79e112..000000000000
--- a/release_23/test/Transforms/Reassociate/mul-neg-add.ll
+++ /dev/null
@@ -1,10 +0,0 @@
-; RUN: llvm-as < %s | opt -reassociate -instcombine | llvm-dis |\
-; RUN: not grep {sub i32 0}
-
-define i32 @test(i32 %X, i32 %Y, i32 %Z) {
- %A = sub i32 0, %X ; <i32> [#uses=1]
- %B = mul i32 %A, %Y ; <i32> [#uses=1]
- ; (-X)*Y + Z -> Z-X*Y
- %C = add i32 %B, %Z ; <i32> [#uses=1]
- ret i32 %C
-}
diff --git a/release_23/test/Transforms/Reassociate/mulfactor.ll b/release_23/test/Transforms/Reassociate/mulfactor.ll
deleted file mode 100644
index f80019c95e36..000000000000
--- a/release_23/test/Transforms/Reassociate/mulfactor.ll
+++ /dev/null
@@ -1,14 +0,0 @@
-; RUN: llvm-as < %s | opt -reassociate -instcombine | llvm-dis | grep mul | count 2
-
-; This should have exactly 2 multiplies when we're done.
-
-define i32 @f(i32 %a, i32 %b) {
- %tmp.2 = mul i32 %a, %a ; <i32> [#uses=1]
- %tmp.5 = shl i32 %a, 1 ; <i32> [#uses=1]
- %tmp.6 = mul i32 %tmp.5, %b ; <i32> [#uses=1]
- %tmp.10 = mul i32 %b, %b ; <i32> [#uses=1]
- %tmp.7 = add i32 %tmp.6, %tmp.2 ; <i32> [#uses=1]
- %tmp.11 = add i32 %tmp.7, %tmp.10 ; <i32> [#uses=1]
- ret i32 %tmp.11
-}
-
diff --git a/release_23/test/Transforms/Reassociate/mulfactor2.ll b/release_23/test/Transforms/Reassociate/mulfactor2.ll
deleted file mode 100644
index 11fe2e04084e..000000000000
--- a/release_23/test/Transforms/Reassociate/mulfactor2.ll
+++ /dev/null
@@ -1,16 +0,0 @@
-; This should turn into one multiply and one add.
-
-; RUN: llvm-as < %s | \
-; RUN: opt -instcombine -reassociate -instcombine | llvm-dis -o %t
-; RUN: grep mul %t | count 1
-; RUN: grep add %t | count 1
-
-define i32 @main(i32 %t) {
- %tmp.3 = mul i32 %t, 12 ; <i32> [#uses=1]
- %tmp.4 = add i32 %tmp.3, 5 ; <i32> [#uses=1]
- %tmp.6 = mul i32 %t, 6 ; <i32> [#uses=1]
- %tmp.8 = mul i32 %tmp.4, 3 ; <i32> [#uses=1]
- %tmp.9 = add i32 %tmp.8, %tmp.6 ; <i32> [#uses=1]
- ret i32 %tmp.9
-}
-
diff --git a/release_23/test/Transforms/Reassociate/negation.ll b/release_23/test/Transforms/Reassociate/negation.ll
deleted file mode 100644
index 6b2041898a1d..000000000000
--- a/release_23/test/Transforms/Reassociate/negation.ll
+++ /dev/null
@@ -1,21 +0,0 @@
-; RUN: llvm-as < %s | opt -reassociate -instcombine | llvm-dis | not grep sub
-
-; Test that we can turn things like X*-(Y*Z) -> X*-1*Y*Z.
-
-define i32 @test1(i32 %a, i32 %b, i32 %z) {
- %c = sub i32 0, %z ; <i32> [#uses=1]
- %d = mul i32 %a, %b ; <i32> [#uses=1]
- %e = mul i32 %c, %d ; <i32> [#uses=1]
- %f = mul i32 %e, 12345 ; <i32> [#uses=1]
- %g = sub i32 0, %f ; <i32> [#uses=1]
- ret i32 %g
-}
-
-define i32 @test2(i32 %a, i32 %b, i32 %z) {
- %d = mul i32 %z, 40 ; <i32> [#uses=1]
- %c = sub i32 0, %d ; <i32> [#uses=1]
- %e = mul i32 %a, %c ; <i32> [#uses=1]
- %f = sub i32 0, %e ; <i32> [#uses=1]
- ret i32 %f
-}
-
diff --git a/release_23/test/Transforms/Reassociate/otherops.ll b/release_23/test/Transforms/Reassociate/otherops.ll
deleted file mode 100644
index 3c9b0744a8fc..000000000000
--- a/release_23/test/Transforms/Reassociate/otherops.ll
+++ /dev/null
@@ -1,28 +0,0 @@
-; Reassociation should apply to Add, Mul, And, Or, & Xor
-;
-; RUN: llvm-as < %s | opt -reassociate -constprop -instcombine -die | llvm-dis | not grep 12
-
-define i32 @test_mul(i32 %arg) {
- %tmp1 = mul i32 12, %arg ; <i32> [#uses=1]
- %tmp2 = mul i32 %tmp1, 12 ; <i32> [#uses=1]
- ret i32 %tmp2
-}
-
-define i32 @test_and(i32 %arg) {
- %tmp1 = and i32 14, %arg ; <i32> [#uses=1]
- %tmp2 = and i32 %tmp1, 14 ; <i32> [#uses=1]
- ret i32 %tmp2
-}
-
-define i32 @test_or(i32 %arg) {
- %tmp1 = or i32 14, %arg ; <i32> [#uses=1]
- %tmp2 = or i32 %tmp1, 14 ; <i32> [#uses=1]
- ret i32 %tmp2
-}
-
-define i32 @test_xor(i32 %arg) {
- %tmp1 = xor i32 12, %arg ; <i32> [#uses=1]
- %tmp2 = xor i32 %tmp1, 12 ; <i32> [#uses=1]
- ret i32 %tmp2
-}
-
diff --git a/release_23/test/Transforms/Reassociate/shift-factor.ll b/release_23/test/Transforms/Reassociate/shift-factor.ll
deleted file mode 100644
index 05437fd86639..000000000000
--- a/release_23/test/Transforms/Reassociate/shift-factor.ll
+++ /dev/null
@@ -1,13 +0,0 @@
-; There should be exactly one shift and one add left.
-; RUN: llvm-as < %s | \
-; RUN: opt -reassociate -instcombine | llvm-dis > %t
-; RUN: grep shl %t | count 1
-; RUN: grep add %t | count 1
-
-define i32 @test(i32 %X, i32 %Y) {
- %tmp.2 = shl i32 %X, 1 ; <i32> [#uses=1]
- %tmp.6 = shl i32 %Y, 1 ; <i32> [#uses=1]
- %tmp.4 = add i32 %tmp.6, %tmp.2 ; <i32> [#uses=1]
- ret i32 %tmp.4
-}
-
diff --git a/release_23/test/Transforms/Reassociate/shifttest.ll b/release_23/test/Transforms/Reassociate/shifttest.ll
deleted file mode 100644
index fd49e7d3f223..000000000000
--- a/release_23/test/Transforms/Reassociate/shifttest.ll
+++ /dev/null
@@ -1,12 +0,0 @@
-; With shl->mul reassociation, we can see that this is (shl A, 9) * A
-;
-; RUN: llvm-as < %s | opt -reassociate -instcombine | llvm-dis |\
-; RUN: grep {shl .*, 9}
-
-define i32 @test(i32 %A, i32 %B) {
- %X = shl i32 %A, 5 ; <i32> [#uses=1]
- %Y = shl i32 %A, 4 ; <i32> [#uses=1]
- %Z = mul i32 %Y, %X ; <i32> [#uses=1]
- ret i32 %Z
-}
-
diff --git a/release_23/test/Transforms/Reassociate/subtest.ll b/release_23/test/Transforms/Reassociate/subtest.ll
deleted file mode 100644
index 513984e7722d..000000000000
--- a/release_23/test/Transforms/Reassociate/subtest.ll
+++ /dev/null
@@ -1,11 +0,0 @@
-; With sub reassociation, constant folding can eliminate the 12 and -12 constants.
-;
-; RUN: llvm-as < %s | opt -reassociate -instcombine | llvm-dis | not grep 12
-
-define i32 @test(i32 %A, i32 %B) {
- %X = add i32 -12, %A ; <i32> [#uses=1]
- %Y = sub i32 %X, %B ; <i32> [#uses=1]
- %Z = add i32 %Y, 12 ; <i32> [#uses=1]
- ret i32 %Z
-}
-
diff --git a/release_23/test/Transforms/Reassociate/subtest2.ll b/release_23/test/Transforms/Reassociate/subtest2.ll
deleted file mode 100644
index c81e9b38def9..000000000000
--- a/release_23/test/Transforms/Reassociate/subtest2.ll
+++ /dev/null
@@ -1,13 +0,0 @@
-; With sub reassociation, constant folding can eliminate the uses of %a.
-;
-; RUN: llvm-as < %s | opt -reassociate -instcombine | llvm-dis | grep %a | count 1
-; PR2047
-
-define i32 @test(i32 %a, i32 %b, i32 %c) nounwind {
-entry:
- %tmp3 = sub i32 %a, %b ; <i32> [#uses=1]
- %tmp5 = sub i32 %tmp3, %c ; <i32> [#uses=1]
- %tmp7 = sub i32 %tmp5, %a ; <i32> [#uses=1]
- ret i32 %tmp7
-}
-
diff --git a/release_23/test/Transforms/SCCP/2002-05-02-EdgeFailure.ll b/release_23/test/Transforms/SCCP/2002-05-02-EdgeFailure.ll
deleted file mode 100644
index 13b45f59a94f..000000000000
--- a/release_23/test/Transforms/SCCP/2002-05-02-EdgeFailure.ll
+++ /dev/null
@@ -1,26 +0,0 @@
-; edgefailure - This function illustrates how SCCP is not doing it's job. This
-; function should be optimized almost completely away: the loop should be
-; analyzed to detect that the body executes exactly once, and thus the branch
-; can be eliminated and code becomes trivially dead. This is distilled from a
-; real benchmark (mst from Olden benchmark, MakeGraph function). When SCCP is
-; fixed, this should be eliminated by a single SCCP application.
-;
-; RUN: llvm-as < %s | opt -sccp | llvm-dis | not grep loop
-
-define i32* @test() {
-bb1:
- %A = malloc i32 ; <i32*> [#uses=2]
- br label %bb2
-bb2: ; preds = %bb2, %bb1
- ;; Always 0
- %i = phi i32 [ %i2, %bb2 ], [ 0, %bb1 ] ; <i32> [#uses=2]
- ;; Always 1
- %i2 = add i32 %i, 1 ; <i32> [#uses=2]
- store i32 %i, i32* %A
- ;; Always false
- %loop = icmp sle i32 %i2, 0 ; <i1> [#uses=1]
- br i1 %loop, label %bb2, label %bb3
-bb3: ; preds = %bb2
- ret i32* %A
-}
-
diff --git a/release_23/test/Transforms/SCCP/2002-05-02-MissSecondInst.ll b/release_23/test/Transforms/SCCP/2002-05-02-MissSecondInst.ll
deleted file mode 100644
index fd4083d1374c..000000000000
--- a/release_23/test/Transforms/SCCP/2002-05-02-MissSecondInst.ll
+++ /dev/null
@@ -1,8 +0,0 @@
-; RUN: llvm-as < %s | opt -sccp | llvm-dis | not grep sub
-
-define void @test3(i32, i32) {
- add i32 0, 0 ; <i32>:3 [#uses=0]
- sub i32 0, 4 ; <i32>:4 [#uses=0]
- ret void
-}
-
diff --git a/release_23/test/Transforms/SCCP/2002-05-20-MissedIncomingValue.ll b/release_23/test/Transforms/SCCP/2002-05-20-MissedIncomingValue.ll
deleted file mode 100644
index 61bf5db44441..000000000000
--- a/release_23/test/Transforms/SCCP/2002-05-20-MissedIncomingValue.ll
+++ /dev/null
@@ -1,19 +0,0 @@
-; This test shows a case where SCCP is incorrectly eliminating the PHI node
-; because it thinks it has a constant 0 value, when it really doesn't.
-
-; RUN: llvm-as < %s | opt -sccp | llvm-dis | grep phi
-
-define i32 @test(i32 %A, i1 %c) {
-bb1:
- br label %BB2
-BB2: ; preds = %BB4, %bb1
- %V = phi i32 [ 0, %bb1 ], [ %A, %BB4 ] ; <i32> [#uses=1]
- br label %BB3
-BB3: ; preds = %BB2
- br i1 %c, label %BB4, label %BB5
-BB4: ; preds = %BB3
- br label %BB2
-BB5: ; preds = %BB3
- ret i32 %V
-}
-
diff --git a/release_23/test/Transforms/SCCP/2002-05-21-InvalidSimplify.ll b/release_23/test/Transforms/SCCP/2002-05-21-InvalidSimplify.ll
deleted file mode 100644
index b46d23a9dcf3..000000000000
--- a/release_23/test/Transforms/SCCP/2002-05-21-InvalidSimplify.ll
+++ /dev/null
@@ -1,33 +0,0 @@
-; This test shows SCCP "proving" that the loop (from bb6 to 14) loops infinitely
-; this is in fact NOT the case, so the return should still be alive in the code
-; after sccp and CFG simplification have been performed.
-;
-; RUN: llvm-as < %s | opt -sccp -simplifycfg | llvm-dis | \
-; RUN: grep ret
-
-define void @old_main() {
-bb3:
- br label %bb6
-bb6: ; preds = %bb14, %bb3
- %reg403 = phi i32 [ %reg155, %bb14 ], [ 0, %bb3 ] ; <i32> [#uses=1]
- %reg155 = add i32 %reg403, 1 ; <i32> [#uses=2]
- br label %bb11
-bb11: ; preds = %bb11, %bb6
- %reg407 = phi i32 [ %reg408, %bb11 ], [ 0, %bb6 ] ; <i32> [#uses=2]
- %reg408 = add i32 %reg407, 1 ; <i32> [#uses=1]
- %cond550 = icmp sle i32 %reg407, 1 ; <i1> [#uses=1]
- br i1 %cond550, label %bb11, label %bb12
-bb12: ; preds = %bb11
- br label %bb13
-bb13: ; preds = %bb13, %bb12
- %reg409 = phi i32 [ %reg410, %bb13 ], [ 0, %bb12 ] ; <i32> [#uses=1]
- %reg410 = add i32 %reg409, 1 ; <i32> [#uses=2]
- %cond552 = icmp sle i32 %reg410, 2 ; <i1> [#uses=1]
- br i1 %cond552, label %bb13, label %bb14
-bb14: ; preds = %bb13
- %cond553 = icmp sle i32 %reg155, 31 ; <i1> [#uses=1]
- br i1 %cond553, label %bb6, label %bb15
-bb15: ; preds = %bb14
- ret void
-}
-
diff --git a/release_23/test/Transforms/SCCP/2002-08-30-GetElementPtrTest.ll b/release_23/test/Transforms/SCCP/2002-08-30-GetElementPtrTest.ll
deleted file mode 100644
index c5a7c790bd26..000000000000
--- a/release_23/test/Transforms/SCCP/2002-08-30-GetElementPtrTest.ll
+++ /dev/null
@@ -1,9 +0,0 @@
-; RUN: llvm-as < %s | opt -sccp | llvm-dis | not grep %X
-
-@G = external global [40 x i32] ; <[40 x i32]*> [#uses=1]
-
-define i32* @test() {
- %X = getelementptr [40 x i32]* @G, i64 0, i64 0 ; <i32*> [#uses=1]
- ret i32* %X
-}
-
diff --git a/release_23/test/Transforms/SCCP/2003-06-24-OverdefinedPHIValue.ll b/release_23/test/Transforms/SCCP/2003-06-24-OverdefinedPHIValue.ll
deleted file mode 100644
index 03ff4dde8a10..000000000000
--- a/release_23/test/Transforms/SCCP/2003-06-24-OverdefinedPHIValue.ll
+++ /dev/null
@@ -1,30 +0,0 @@
-; RUN: llvm-as < %s | opt -sccp -simplifycfg | llvm-dis | \
-; RUN: not grep then:
-
-define void @cprop_test11(i32* %data.1) {
-entry:
- %tmp.1 = load i32* %data.1 ; <i32> [#uses=3]
- %tmp.41 = icmp sgt i32 %tmp.1, 1 ; <i1> [#uses=1]
- br i1 %tmp.41, label %no_exit, label %loopexit
-no_exit: ; preds = %endif, %then, %entry
- %j.0 = phi i32 [ %j.0, %endif ], [ %i.0, %then ], [ 1, %entry ] ; <i32> [#uses=3]
- %i.0 = phi i32 [ %inc, %endif ], [ %inc1, %then ], [ 1, %entry ] ; <i32> [#uses=4]
- %tmp.8.not = icmp ne i32 %j.0, 0 ; <i1> [#uses=1]
- br i1 %tmp.8.not, label %endif, label %then
-then: ; preds = %no_exit
- %inc1 = add i32 %i.0, 1 ; <i32> [#uses=3]
- %tmp.42 = icmp slt i32 %inc1, %tmp.1 ; <i1> [#uses=1]
- br i1 %tmp.42, label %no_exit, label %loopexit
-endif: ; preds = %no_exit
- %inc = add i32 %i.0, 1 ; <i32> [#uses=3]
- %tmp.4 = icmp slt i32 %inc, %tmp.1 ; <i1> [#uses=1]
- br i1 %tmp.4, label %no_exit, label %loopexit
-loopexit: ; preds = %endif, %then, %entry
- %j.1 = phi i32 [ 1, %entry ], [ %j.0, %endif ], [ %i.0, %then ] ; <i32> [#uses=1]
- %i.1 = phi i32 [ 1, %entry ], [ %inc, %endif ], [ %inc1, %then ] ; <i32> [#uses=1]
- %tmp.17 = getelementptr i32* %data.1, i64 1 ; <i32*> [#uses=1]
- store i32 %j.1, i32* %tmp.17
- %tmp.23 = getelementptr i32* %data.1, i64 2 ; <i32*> [#uses=1]
- store i32 %i.1, i32* %tmp.23
- ret void
-}
diff --git a/release_23/test/Transforms/SCCP/2003-08-26-InvokeHandling.ll b/release_23/test/Transforms/SCCP/2003-08-26-InvokeHandling.ll
deleted file mode 100644
index 020af7d16c7d..000000000000
--- a/release_23/test/Transforms/SCCP/2003-08-26-InvokeHandling.ll
+++ /dev/null
@@ -1,18 +0,0 @@
-; The PHI cannot be eliminated from this testcase, SCCP is mishandling invoke's!
-; RUN: llvm-as < %s | opt -sccp | llvm-dis | grep phi
-
-declare void @foo()
-
-define i32 @test(i1 %cond) {
-Entry:
- br i1 %cond, label %Inv, label %Cont
-Inv: ; preds = %Entry
- invoke void @foo( )
- to label %Ok unwind label %Cont
-Ok: ; preds = %Inv
- br label %Cont
-Cont: ; preds = %Ok, %Inv, %Entry
- %X = phi i32 [ 0, %Entry ], [ 1, %Ok ], [ 0, %Inv ] ; <i32> [#uses=1]
- ret i32 %X
-}
-
diff --git a/release_23/test/Transforms/SCCP/2004-11-16-DeadInvoke.ll b/release_23/test/Transforms/SCCP/2004-11-16-DeadInvoke.ll
deleted file mode 100644
index cf64677334a2..000000000000
--- a/release_23/test/Transforms/SCCP/2004-11-16-DeadInvoke.ll
+++ /dev/null
@@ -1,13 +0,0 @@
-; RUN: llvm-as < %s | opt -sccp -disable-output
-
-declare i32 @foo()
-
-define void @caller() {
- br i1 true, label %T, label %F
-F: ; preds = %0
- %X = invoke i32 @foo( )
- to label %T unwind label %T ; <i32> [#uses=0]
-T: ; preds = %F, %F, %0
- ret void
-}
-
diff --git a/release_23/test/Transforms/SCCP/2004-12-10-UndefBranchBug.ll b/release_23/test/Transforms/SCCP/2004-12-10-UndefBranchBug.ll
deleted file mode 100644
index 6592e8b08925..000000000000
--- a/release_23/test/Transforms/SCCP/2004-12-10-UndefBranchBug.ll
+++ /dev/null
@@ -1,12 +0,0 @@
-; RUN: llvm-as < %s | opt -sccp | llvm-dis | grep {ret i32 1}
-
-; This function definitely returns 1, even if we don't know the direction
-; of the branch.
-
-define i32 @foo() {
- br i1 undef, label %T, label %T
-T: ; preds = %0, %0
- %X = add i32 0, 1 ; <i32> [#uses=1]
- ret i32 %X
-}
-
diff --git a/release_23/test/Transforms/SCCP/2006-10-23-IPSCCP-Crash.ll b/release_23/test/Transforms/SCCP/2006-10-23-IPSCCP-Crash.ll
deleted file mode 100644
index 299b79f53e21..000000000000
--- a/release_23/test/Transforms/SCCP/2006-10-23-IPSCCP-Crash.ll
+++ /dev/null
@@ -1,103 +0,0 @@
-; RUN: llvm-as < %s | opt -sccp -disable-output
-; END.
-target datalayout = "E-p:32:32"
-target triple = "powerpc-apple-darwin8.7.0"
- %struct.pat_list = type { i32, %struct.pat_list* }
-@JUMP = external global i32 ; <i32*> [#uses=1]
-@old_D_pat = external global [16 x i8] ; <[16 x i8]*> [#uses=0]
-
-define void @asearch1(i32 %D) {
-entry:
- %tmp80 = icmp ult i32 0, %D ; <i1> [#uses=1]
- br i1 %tmp80, label %bb647.preheader, label %cond_true81.preheader
-cond_true81.preheader: ; preds = %entry
- ret void
-bb647.preheader: ; preds = %entry
- %tmp3.i = call i32 @read( ) ; <i32> [#uses=1]
- %tmp6.i = add i32 %tmp3.i, 0 ; <i32> [#uses=1]
- %tmp653 = icmp sgt i32 %tmp6.i, 0 ; <i1> [#uses=1]
- br i1 %tmp653, label %cond_true654, label %UnifiedReturnBlock
-cond_true612: ; preds = %cond_true654
- ret void
-cond_next624: ; preds = %cond_true654
- ret void
-cond_true654: ; preds = %bb647.preheader
- br i1 undef, label %cond_true612, label %cond_next624
-UnifiedReturnBlock: ; preds = %bb647.preheader
- ret void
-}
-
-define void @bitap(i32 %D) {
-entry:
- %tmp29 = icmp eq i32 0, 0 ; <i1> [#uses=1]
- br i1 %tmp29, label %cond_next50, label %cond_next37
-cond_next37: ; preds = %entry
- ret void
-cond_next50: ; preds = %entry
- %tmp52 = icmp sgt i32 %D, 0 ; <i1> [#uses=1]
- br i1 %tmp52, label %cond_true53, label %cond_next71
-cond_true53: ; preds = %cond_next50
- %tmp54 = load i32* @JUMP ; <i32> [#uses=1]
- %tmp55 = icmp eq i32 %tmp54, 1 ; <i1> [#uses=1]
- br i1 %tmp55, label %cond_true56, label %cond_next63
-cond_true56: ; preds = %cond_true53
- %tmp57 = bitcast i32 %D to i32 ; <i32> [#uses=1]
- call void @asearch1( i32 %tmp57 )
- ret void
-cond_next63: ; preds = %cond_true53
- ret void
-cond_next71: ; preds = %cond_next50
- ret void
-}
-
-declare i32 @read()
-
-define void @initial_value() {
-entry:
- ret void
-}
-
-define void @main() {
-entry:
- br label %cond_next252
-cond_next208: ; preds = %cond_true260
- %tmp229 = call i32 @atoi( ) ; <i32> [#uses=1]
- br label %cond_next252
-bb217: ; preds = %cond_true260
- ret void
-cond_next252: ; preds = %cond_next208, %entry
- %D.0.0 = phi i32 [ 0, %entry ], [ %tmp229, %cond_next208 ] ; <i32> [#uses=1]
- %tmp254 = getelementptr i8** null, i32 1 ; <i8**> [#uses=1]
- %tmp256 = load i8** %tmp254 ; <i8*> [#uses=1]
- %tmp258 = load i8* %tmp256 ; <i8> [#uses=1]
- %tmp259 = icmp eq i8 %tmp258, 45 ; <i1> [#uses=1]
- br i1 %tmp259, label %cond_true260, label %bb263
-cond_true260: ; preds = %cond_next252
- %tmp205818 = icmp sgt i8 0, -1 ; <i1> [#uses=1]
- br i1 %tmp205818, label %cond_next208, label %bb217
-bb263: ; preds = %cond_next252
- %tmp265 = icmp eq i32 0, 0 ; <i1> [#uses=1]
- br i1 %tmp265, label %cond_next276, label %cond_true266
-cond_true266: ; preds = %bb263
- ret void
-cond_next276: ; preds = %bb263
- %tmp278 = icmp eq i32 0, 0 ; <i1> [#uses=1]
- br i1 %tmp278, label %cond_next298, label %cond_true279
-cond_true279: ; preds = %cond_next276
- ret void
-cond_next298: ; preds = %cond_next276
- call void @bitap( i32 %D.0.0 )
- ret void
-}
-
-declare i32 @atoi()
-
-define void @subset_pset() {
-entry:
- ret void
-}
-
-define void @strcmp() {
-entry:
- ret void
-}
diff --git a/release_23/test/Transforms/SCCP/2006-12-04-PackedType.ll b/release_23/test/Transforms/SCCP/2006-12-04-PackedType.ll
deleted file mode 100644
index b7a7880b0faf..000000000000
--- a/release_23/test/Transforms/SCCP/2006-12-04-PackedType.ll
+++ /dev/null
@@ -1,140 +0,0 @@
-; Test VectorType handling by SCCP.
-; SCCP ignores VectorTypes until PR 1034 is fixed
-;
-; RUN: llvm-as < %s | opt -sccp
-; END.
-
-target datalayout = "E-p:32:32"
-target triple = "powerpc-apple-darwin8"
- %struct.GLDAlphaTest = type { float, i16, i8, i8 }
- %struct.GLDArrayRange = type { i8, i8, i8, i8 }
- %struct.GLDBlendMode = type { i16, i16, i16, i16, %struct.GLTColor4, i16, i16, i8, i8, i8, i8 }
- %struct.GLDBufferRec = type opaque
- %struct.GLDBufferstate = type { %struct.GLTDimensions, %struct.GLTDimensions, %struct.GLTFixedColor4, %struct.GLTFixedColor4, i8, i8, i8, i8, [2 x %struct.GLSBuffer], [4 x %struct.GLSBuffer], %struct.GLSBuffer, %struct.GLSBuffer, %struct.GLSBuffer, [4 x %struct.GLSBuffer*], %struct.GLSBuffer*, %struct.GLSBuffer*, %struct.GLSBuffer*, i8, i8 }
- %struct.GLDClearColor = type { double, %struct.GLTColor4, %struct.GLTColor4, float, i32 }
- %struct.GLDClipPlane = type { i32, [6 x %struct.GLTColor4] }
- %struct.GLDColorBuffer = type { i16, i16, [4 x i16] }
- %struct.GLDColorMatrix = type { [16 x float]*, %struct.GLDImagingColorScale }
- %struct.GLDContextRec = type { float, float, float, float, float, float, float, float, %struct.GLTColor4, %struct.GLTColor4, %struct.GLVMFPContext, %struct.GLDTextureMachine, %struct.GLGProcessor, %struct._GLVMConstants*, void (%struct.GLDContextRec*, i32, i32, %struct.GLVMFragmentAttribRec*, %struct.GLVMFragmentAttribRec*, i32)*, %struct._GLVMFunction*, void (%struct.GLDContextRec*, %struct.GLDVertex*)*, void (%struct.GLDContextRec*, %struct.GLDVertex*, %struct.GLDVertex*)*, void (%struct.GLDContextRec*, %struct.GLDVertex*, %struct.GLDVertex*, %struct.GLDVertex*)*, %struct._GLVMFunction*, %struct._GLVMFunction*, %struct._GLVMFunction*, i32, i32, i32, float, float, float, i32, %struct.GLSDrawable, %struct.GLDFramebufferAttachment, %struct.GLDFormat, %struct.GLDBufferstate, %struct.GLDSharedRec*, %struct.GLDState*, %struct.GLDPluginState*, %struct.GLTDimensions, %struct.GLTColor4*, %struct.GLTColor4*, %struct.GLVMFragmentAttribRec*, %struct.GLVMFragmentAttribRec*, %struct.GLVMFragmentAttribRec*, %struct.GLDPipelineProgramRec*, %struct.GLDStateProgramRec, %struct.GLVMTextures, { [4 x i8*], i8*, i8* }, [64 x float], %struct.GLDStippleData, i16, i8, i8, i32, %struct.GLDFramebufferRec*, i8, %struct.GLDQueryRec*, %struct.GLDQueryRec* }
- %struct.GLDConvolution = type { %struct.GLTColor4, %struct.GLDImagingColorScale, i16, i16, float*, i32, i32 }
- %struct.GLDDepthTest = type { i16, i16, i8, i8, i8, i8, double, double }
- %struct.GLDFogMode = type { %struct.GLTColor4, float, float, float, float, float, i16, i16, i16, i8, i8 }
- %struct.GLDFormat = type { i32, i32, i32, i32, i32, i32, i32, i32, i8, i8, i8, i8, i32, i32, i32 }
- %struct.GLDFramebufferAttachment = type { i32, i32, i32, i32, i32, i32 }
- %struct.GLDFramebufferData = type { [6 x %struct.GLDFramebufferAttachment], [4 x i16], i16, i16, i16, i16, i32 }
- %struct.GLDFramebufferRec = type { %struct.GLDFramebufferData*, %struct.GLDPluginFramebufferData*, %struct.GLDPixelFormat }
- %struct.GLDHintMode = type { i16, i16, i16, i16, i16, i16, i16, i16, i16, i16 }
- %struct.GLDHistogram = type { %struct.GLTFixedColor4*, i32, i16, i8, i8 }
- %struct.GLDImagingColorScale = type { { float, float }, { float, float }, { float, float }, { float, float } }
- %struct.GLDImagingSubset = type { %struct.GLDConvolution, %struct.GLDConvolution, %struct.GLDConvolution, %struct.GLDColorMatrix, %struct.GLDMinmax, %struct.GLDHistogram, %struct.GLDImagingColorScale, %struct.GLDImagingColorScale, %struct.GLDImagingColorScale, %struct.GLDImagingColorScale, i32 }
- %struct.GLDLight = type { %struct.GLTColor4, %struct.GLTColor4, %struct.GLTColor4, %struct.GLTColor4, %struct.GLTCoord3, float, float, float, float, float, %struct.GLTCoord3, float, float, float, float, float }
- %struct.GLDLightModel = type { %struct.GLTColor4, [8 x %struct.GLDLight], [2 x %struct.GLDMaterial], i32, i16, i16, i16, i8, i8, i8, i8, i8, i8 }
- %struct.GLDLightProduct = type { %struct.GLTColor4, %struct.GLTColor4, %struct.GLTColor4 }
- %struct.GLDLineMode = type { float, i32, i16, i16, i8, i8, i8, i8 }
- %struct.GLDLogicOp = type { i16, i8, i8 }
- %struct.GLDMaskMode = type { i32, [3 x i32], i8, i8, i8, i8, i8, i8, i8, i8 }
- %struct.GLDMaterial = type { %struct.GLTColor4, %struct.GLTColor4, %struct.GLTColor4, %struct.GLTColor4, float, float, float, float, [8 x %struct.GLDLightProduct], %struct.GLTColor4, [6 x i32], [2 x i32] }
- %struct.GLDMinmax = type { %struct.GLDMinmaxTable*, i16, i8, i8 }
- %struct.GLDMinmaxTable = type { %struct.GLTColor4, %struct.GLTColor4 }
- %struct.GLDMipmaplevel = type { [4 x i32], [4 x float], [4 x i32], [4 x i32], [4 x float], [4 x i32], [3 x i32], i32, float*, float*, float*, i32, i32, i8*, i16, i16, i16, i16 }
- %struct.GLDMultisample = type { float, i8, i8, i8, i8, i8, i8, i8, i8 }
- %struct.GLDPipelineProgramData = type { i16, i16, i32, %struct._PPStreamToken*, i64, %struct.GLDShaderSourceData*, %struct.GLTColor4*, i32 }
- %struct.GLDPipelineProgramRec = type { %struct.GLDPipelineProgramData*, %struct._PPStreamToken*, %struct._PPStreamToken*, %struct._GLVMFunction*, i32, i32, i32 }
- %struct.GLDPipelineProgramState = type { i8, i8, i8, i8, %struct.GLTColor4* }
- %struct.GLDPixelFormat = type { i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }
- %struct.GLDPixelMap = type { i32*, float*, float*, float*, float*, float*, float*, float*, float*, i32*, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 }
- %struct.GLDPixelMode = type { float, float, %struct.GLDPixelStore, %struct.GLDPixelTransfer, %struct.GLDPixelMap, %struct.GLDImagingSubset, i32, i32 }
- %struct.GLDPixelPack = type { i32, i32, i32, i32, i32, i32, i32, i32, i8, i8, i8, i8 }
- %struct.GLDPixelStore = type { %struct.GLDPixelPack, %struct.GLDPixelPack }
- %struct.GLDPixelTransfer = type { float, float, float, float, float, float, float, float, float, float, i32, i32, float, float, float, float, float, float, float, float, float, float, float, float }
- %struct.GLDPluginFramebufferData = type { [6 x %struct.GLDTextureRec*], i32, i32 }
- %struct.GLDPluginProgramData = type { [3 x %struct.GLDPipelineProgramRec*], %struct.GLDBufferRec**, i32 }
- %struct.GLDPluginState = type { [16 x [5 x %struct.GLDTextureRec*]], [3 x %struct.GLDTextureRec*], [16 x %struct.GLDTextureRec*], [3 x %struct.GLDPipelineProgramRec*], %struct.GLDProgramRec*, %struct.GLDVertexArrayRec*, [16 x %struct.GLDBufferRec*], %struct.GLDFramebufferRec*, %struct.GLDFramebufferRec* }
- %struct.GLDPointMode = type { float, float, float, float, %struct.GLTCoord3, float, i8, i8, i8, i8, i16, i16, i32, i16, i16 }
- %struct.GLDPolygonMode = type { [128 x i8], float, float, i16, i16, i16, i16, i8, i8, i8, i8, i8, i8, i8, i8 }
- %struct.GLDProgramData = type { i32, [16 x i32], i32, i32, i32, i32 }
- %struct.GLDProgramRec = type { %struct.GLDProgramData*, %struct.GLDPluginProgramData*, i32 }
- %struct.GLDQueryRec = type { i32, i32, %struct.GLDQueryRec* }
- %struct.GLDRect = type { i32, i32, i32, i32, i32, i32 }
- %struct.GLDRegisterCombiners = type { i8, i8, i8, i8, i32, [2 x %struct.GLTColor4], [8 x %struct.GLDRegisterCombinersPerStageState], %struct.GLDRegisterCombinersFinalStageState }
- %struct.GLDRegisterCombinersFinalStageState = type { i8, i8, i8, i8, [7 x %struct.GLDRegisterCombinersPerVariableState] }
- %struct.GLDRegisterCombinersPerPortionState = type { [4 x %struct.GLDRegisterCombinersPerVariableState], i8, i8, i8, i8, i16, i16, i16, i16, i16, i16 }
- %struct.GLDRegisterCombinersPerStageState = type { [2 x %struct.GLDRegisterCombinersPerPortionState], [2 x %struct.GLTColor4] }
- %struct.GLDRegisterCombinersPerVariableState = type { i16, i16, i16, i16 }
- %struct.GLDScissorTest = type { %struct.GLTFixedColor4, i8, i8, i8, i8 }
- %struct.GLDShaderSourceData = type { i32, i32, i8*, i32*, i32, i32, i8*, i32*, i8* }
- %struct.GLDSharedRec = type opaque
- %struct.GLDState = type { i16, i16, i32, i32, i32, [256 x %struct.GLTColor4], [128 x %struct.GLTColor4], %struct.GLDViewport, %struct.GLDTransform, %struct.GLDLightModel, i32*, i32, i32, i32, %struct.GLDAlphaTest, %struct.GLDBlendMode, %struct.GLDClearColor, %struct.GLDColorBuffer, %struct.GLDDepthTest, %struct.GLDArrayRange, %struct.GLDFogMode, %struct.GLDHintMode, %struct.GLDLineMode, %struct.GLDLogicOp, %struct.GLDMaskMode, %struct.GLDPixelMode, %struct.GLDPointMode, %struct.GLDPolygonMode, %struct.GLDScissorTest, i32, %struct.GLDStencilTest, [16 x %struct.GLDTextureMode], %struct.GLDArrayRange, [8 x %struct.GLDTextureCoordGen], %struct.GLDClipPlane, %struct.GLDMultisample, %struct.GLDRegisterCombiners, %struct.GLDArrayRange, %struct.GLDArrayRange, [3 x %struct.GLDPipelineProgramState], %struct.GLDTransformFeedback }
- %struct.GLDStateProgramRec = type { %struct.GLDPipelineProgramData*, %struct.GLDPipelineProgramRec* }
- %struct.GLDStencilTest = type { [3 x { i32, i32, i16, i16, i16, i16 }], i32, [4 x i8] }
- %struct.GLDStippleData = type { i32, i16, i16, [32 x [32 x i8]] }
- %struct.GLDTextureCoordGen = type { { i16, i16, %struct.GLTColor4, %struct.GLTColor4 }, { i16, i16, %struct.GLTColor4, %struct.GLTColor4 }, { i16, i16, %struct.GLTColor4, %struct.GLTColor4 }, { i16, i16, %struct.GLTColor4, %struct.GLTColor4 }, i8, i8, i8, i8 }
- %struct.GLDTextureGeomState = type { i16, i16, i16, i16, i16, i8, i8, i16, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, [6 x i16], [6 x i16] }
- %struct.GLDTextureLevel = type { i32, i32, i16, i16, i16, i8, i8, i16, i16, i16, i16, i8* }
- %struct.GLDTextureMachine = type { [8 x %struct.GLDTextureRec*], %struct.GLDTextureRec*, i8, i8, i8, i8 }
- %struct.GLDTextureMode = type { %struct.GLTColor4, i32, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, float, float, float, i16, i16, i16, i16, i16, i16, [4 x i16], i8, i8, i8, i8, [3 x float], [4 x float], float, float }
- %struct.GLDTextureParamState = type { i16, i16, i16, i16, i16, i16, %struct.GLTColor4, float, float, float, float, i16, i16, i16, i16, float, i16, i8, i8, i32, i8* }
- %struct.GLDTextureRec = type { %struct.GLDTextureState*, i32, [2 x float], float, i32, float, float, float, float, float, float, %struct.GLDMipmaplevel*, %struct.GLDMipmaplevel*, i32, i32, i32, i32, i32, i32, %struct.GLDTextureParamState, i32, [2 x %struct._PPStreamToken] }
- %struct.GLDTextureState = type { i16, i16, i16, float, i32, i16, %struct.GLISWRSurface*, i8, i8, i8, i8, %struct.GLDTextureParamState, %struct.GLDTextureGeomState, %struct.GLDTextureLevel, [6 x [15 x %struct.GLDTextureLevel]] }
- %struct.GLDTransform = type { [24 x [16 x float]], [24 x [16 x float]], [16 x float], float, float, float, float, i32, float, i16, i16, i8, i8, i8, i8 }
- %struct.GLDTransformFeedback = type { i8, i8, i8, [16 x i32], [16 x i32] }
- %struct.GLDVertex = type { %struct.GLTColor4, %struct.GLTColor4, %struct.GLTColor4, %struct.GLTColor4, %struct.GLTColor4, %struct.GLTCoord3, float, %struct.GLTColor4, float, float, float, i8, i8, i8, i8, [4 x float], [2 x %struct.GLDMaterial*], i32, i32, [8 x %struct.GLTColor4] }
- %struct.GLDVertexArrayRec = type opaque
- %struct.GLDViewport = type { float, float, float, float, float, float, float, float, double, double, i32, i32, i32, i32, float, float, float, float }
- %struct.GLGColorTable = type { i32, i32, i32, i8* }
- %struct.GLGOperation = type { i8*, i8*, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, float, float, %struct.GLGColorTable, %struct.GLGColorTable, %struct.GLGColorTable }
- %struct.GLGProcessor = type { void (%struct.GLDPixelMode*, %struct.GLGOperation*, %struct._GLGFunctionKey*)*, %struct._GLVMFunction*, %struct._GLGFunctionKey* }
- %struct.GLISWRSurface = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i8*, i8*, i8*, [4 x i8*], i32 }
- %struct.GLIWindow = type { i32, i32, i32 }
- %struct.GLSBuffer = type { i8* }
- %struct.GLSDrawable = type { %struct.GLSWindowRec* }
- %struct.GLSWindowRec = type { %struct.GLTDimensions, %struct.GLTDimensions, i32, i32, %struct.GLSDrawable, [2 x i8*], i8*, i8*, i8*, [4 x i8*], i32, i32, i32, i32, [4 x i32], i16, i16, i16, %struct.GLIWindow, i32, i32, i8*, i8* }
- %struct.GLTColor4 = type { float, float, float, float }
- %struct.GLTCoord3 = type { float, float, float }
- %struct.GLTDimensions = type { i32, i32 }
- %struct.GLTFixedColor4 = type { i32, i32, i32, i32 }
- %struct.GLVMFPContext = type { float, i32, i32, i32 }
- %struct.GLVMFragmentAttribRec = type { <4 x float>, <4 x float>, <4 x float>, <4 x float>, [8 x <4 x float>] }
- %struct.GLVMTextures = type { [8 x %struct.GLDTextureRec*] }
- %struct._GLGFunctionKey = type opaque
- %struct._GLVMConstants = type opaque
- %struct._GLVMFunction = type opaque
- %struct._PPStreamToken = type { { i16, i8, i8, i32 } }
-
-define void @gldLLVMVecPointRender(%struct.GLDContextRec* %ctx) {
-entry:
- %tmp.uip = getelementptr %struct.GLDContextRec* %ctx, i32 0, i32 22 ; <i32*> [#uses=1]
- %tmp = load i32* %tmp.uip ; <i32> [#uses=3]
- %tmp91 = lshr i32 %tmp, 5 ; <i32> [#uses=1]
- %tmp92 = trunc i32 %tmp91 to i1 ; <i1> [#uses=1]
- br i1 %tmp92, label %cond_true93, label %cond_next116
-cond_true93: ; preds = %entry
- %tmp.upgrd.1 = getelementptr %struct.GLDContextRec* %ctx, i32 0, i32 31, i32 14 ; <i32*> [#uses=1]
- %tmp95 = load i32* %tmp.upgrd.1 ; <i32> [#uses=1]
- %tmp95.upgrd.2 = sitofp i32 %tmp95 to float ; <float> [#uses=1]
- %tmp108 = mul float undef, %tmp95.upgrd.2 ; <float> [#uses=1]
- br label %cond_next116
-cond_next116: ; preds = %cond_true93, %entry
- %point_size.2 = phi float [ %tmp108, %cond_true93 ], [ undef, %entry ] ; <float> [#uses=2]
- %tmp457 = fcmp olt float %point_size.2, 1.000000e+00 ; <i1> [#uses=1]
- %tmp460 = lshr i32 %tmp, 6 ; <i32> [#uses=1]
- %tmp461 = trunc i32 %tmp460 to i1 ; <i1> [#uses=1]
- br i1 %tmp457, label %cond_true458, label %cond_next484
-cond_true458: ; preds = %cond_next116
- br i1 %tmp461, label %cond_true462, label %cond_next487
-cond_true462: ; preds = %cond_true458
- %tmp26 = bitcast i32 %tmp to i32 ; <i32> [#uses=1]
- %tmp465 = and i32 %tmp26, 128 ; <i32> [#uses=1]
- %tmp466 = icmp eq i32 %tmp465, 0 ; <i1> [#uses=1]
- br i1 %tmp466, label %cond_true467, label %cond_next487
-cond_true467: ; preds = %cond_true462
- ret void
-cond_next484: ; preds = %cond_next116
- %tmp486 = mul float %point_size.2, 5.000000e-01 ; <float> [#uses=1]
- br label %cond_next487
-cond_next487: ; preds = %cond_next484, %cond_true462, %cond_true458
- %radius.0 = phi float [ %tmp486, %cond_next484 ], [ 5.000000e-01, %cond_true458 ], [ 5.000000e-01, %cond_true462 ] ; <float> [#uses=2]
- %tmp494 = insertelement <4 x float> zeroinitializer, float %radius.0, i32 2 ; <<4 x float>> [#uses=1]
- %tmp495 = insertelement <4 x float> %tmp494, float %radius.0, i32 3 ; <<4 x float>> [#uses=0]
- ret void
-}
diff --git a/release_23/test/Transforms/SCCP/2006-12-19-UndefBug.ll b/release_23/test/Transforms/SCCP/2006-12-19-UndefBug.ll
deleted file mode 100644
index 4d686690b98f..000000000000
--- a/release_23/test/Transforms/SCCP/2006-12-19-UndefBug.ll
+++ /dev/null
@@ -1,8 +0,0 @@
-; RUN: llvm-as < %s | opt -sccp | llvm-dis | \
-; RUN: grep {ret i1 false}
-
-define i1 @foo() {
- %X = and i1 false, undef ; <i1> [#uses=1]
- ret i1 %X
-}
-
diff --git a/release_23/test/Transforms/SCCP/2007-05-16-InvokeCrash.ll b/release_23/test/Transforms/SCCP/2007-05-16-InvokeCrash.ll
deleted file mode 100644
index c099b88044c0..000000000000
--- a/release_23/test/Transforms/SCCP/2007-05-16-InvokeCrash.ll
+++ /dev/null
@@ -1,41 +0,0 @@
-; RUN: llvm-as < %s | opt -sccp -disable-output
-; PR 1431
-
-define void @_ada_bench() {
-entry:
- br label %cond_next
-cond_next: ; preds = %cond_next, %entry
- %indvar46 = phi i32 [ 0, %entry ], [ %indvar.next47, %cond_next ] ; <i32> [#uses=1]
- %indvar.next47 = add i32 %indvar46, 1 ; <i32> [#uses=2]
- %exitcond48 = icmp eq i32 %indvar.next47, 10000 ; <i1> [#uses=1]
- br i1 %exitcond48, label %cond_next40, label %cond_next
-cond_next40: ; preds = %cond_next40, %cond_next
- %indvar43 = phi i32 [ %indvar.next44, %cond_next40 ], [ 0, %cond_next ] ; <i32> [#uses=1]
- %indvar.next44 = add i32 %indvar43, 1 ; <i32> [#uses=2]
- %exitcond45 = icmp eq i32 %indvar.next44, 10000 ; <i1> [#uses=1]
- br i1 %exitcond45, label %cond_next53, label %cond_next40
-cond_next53: ; preds = %cond_next53, %cond_next40
- %indvar41 = phi i32 [ %indvar.next42, %cond_next53 ], [ 0, %cond_next40 ] ; <i32> [#uses=1]
- %indvar.next42 = add i32 %indvar41, 1 ; <i32> [#uses=2]
- %exitcond = icmp eq i32 %indvar.next42, 10000 ; <i1> [#uses=1]
- br i1 %exitcond, label %bb67, label %cond_next53
-bb67: ; preds = %cond_next53
- %tmp112 = invoke double @sin( double 5.000000e-01 )
- to label %bb114 unwind label %cleanup ; <double> [#uses=0]
-bb114: ; preds = %bb67
- %tmp147 = invoke double @log( double 5.000000e-01 )
- to label %bb149 unwind label %cleanup ; <double> [#uses=0]
-bb149: ; preds = %bb114
- %tmp175 = invoke double @sqrt( double 5.000000e-01 )
- to label %bb177 unwind label %cleanup ; <double> [#uses=0]
-bb177: ; preds = %bb149
- unreachable
-cleanup: ; preds = %bb149, %bb114, %bb67
- unwind
-}
-
-declare double @sin(double)
-
-declare double @log(double)
-
-declare double @sqrt(double)
diff --git a/release_23/test/Transforms/SCCP/2008-01-27-UndefCorrelate.ll b/release_23/test/Transforms/SCCP/2008-01-27-UndefCorrelate.ll
deleted file mode 100644
index 18ab5e8cdc5b..000000000000
--- a/release_23/test/Transforms/SCCP/2008-01-27-UndefCorrelate.ll
+++ /dev/null
@@ -1,36 +0,0 @@
-; RUN: llvm-as < %s | opt -sccp | llvm-dis | grep undef | count 1
-; PR1938
-
-define i32 @main() {
-entry:
- br label %bb
-
-bb:
- %indvar = phi i32 [ 0, %entry ], [ %k, %bb.backedge ]
- %k = add i32 %indvar, 1
- br i1 undef, label %cond_true, label %cond_false
-
-cond_true:
- %tmp97 = icmp slt i32 %k, 10
- br i1 %tmp97, label %bb.backedge, label %bb12
-
-bb.backedge:
- br label %bb
-
-cond_false:
- %tmp9 = icmp slt i32 %k, 10
- br i1 %tmp9, label %bb.backedge, label %bb12
-
-bb12:
- %tmp14 = icmp eq i32 %k, 10
- br i1 %tmp14, label %cond_next18, label %cond_true17
-
-cond_true17:
- tail call void @abort( )
- unreachable
-
-cond_next18:
- ret i32 0
-}
-
-declare void @abort()
diff --git a/release_23/test/Transforms/SCCP/2008-03-10-sret.ll b/release_23/test/Transforms/SCCP/2008-03-10-sret.ll
deleted file mode 100644
index f5bc00de5097..000000000000
--- a/release_23/test/Transforms/SCCP/2008-03-10-sret.ll
+++ /dev/null
@@ -1,14 +0,0 @@
-; RUN: llvm-as < %s | opt -ipsccp | llvm-dis | grep {ret i32 36}
-; RUN: llvm-as < %s | opt -ipsccp | llvm-dis | grep {ret i32 18, i32 17}
-
-define internal {i32, i32} @bar(i32 %A) {
- %X = add i32 1, %A
- ret i32 %X, i32 %A
-}
-
-define i32 @foo() {
- %X = call {i32, i32} @bar(i32 17)
- %Y = getresult {i32, i32} %X, 0
- %Z = add i32 %Y, %Y
- ret i32 %Z
-}
diff --git a/release_23/test/Transforms/SCCP/2008-04-22-multiple-ret-sccp.ll b/release_23/test/Transforms/SCCP/2008-04-22-multiple-ret-sccp.ll
deleted file mode 100644
index 99f9136ea370..000000000000
--- a/release_23/test/Transforms/SCCP/2008-04-22-multiple-ret-sccp.ll
+++ /dev/null
@@ -1,11 +0,0 @@
-; RUN: llvm-as < %s | opt -sccp | llvm-dis | grep {ret i32 %Z}
-; rdar://5778210
-
-declare {i32, i32} @bar(i32 %A)
-
-define i32 @foo() {
- %X = call {i32, i32} @bar(i32 17)
- %Y = getresult {i32, i32} %X, 0
- %Z = add i32 %Y, %Y
- ret i32 %Z
-}
diff --git a/release_23/test/Transforms/SCCP/apint-array.ll b/release_23/test/Transforms/SCCP/apint-array.ll
deleted file mode 100644
index ead3f6ab9a66..000000000000
--- a/release_23/test/Transforms/SCCP/apint-array.ll
+++ /dev/null
@@ -1,23 +0,0 @@
-; RUN: llvm-as < %s | opt -sccp | llvm-dis | grep {ret i101 12}
-
-@Y = constant [6 x i101] [ i101 12, i101 123456789000000, i101 -12,i101
--123456789000000, i101 0,i101 9123456789000000]
-
-define i101 @array()
-{
-Head:
- %A = getelementptr [6 x i101]* @Y, i32 0, i32 1
-
- %B = load i101* %A
- %C = icmp sge i101 %B, 1
- br i1 %C, label %True, label %False
-True:
- %D = and i101 %B, 1
- %E = trunc i101 %D to i32
- %F = getelementptr [6 x i101]* @Y, i32 0, i32 %E
- %G = load i101* %F
- br label %False
-False:
- %H = phi i101 [%G, %True], [-1, %Head]
- ret i101 %H
-}
diff --git a/release_23/test/Transforms/SCCP/apint-basictest.ll b/release_23/test/Transforms/SCCP/apint-basictest.ll
deleted file mode 100644
index 12f8326a7375..000000000000
--- a/release_23/test/Transforms/SCCP/apint-basictest.ll
+++ /dev/null
@@ -1,16 +0,0 @@
-; This is a basic sanity check for constant propogation. The add instruction
-; should be eliminated.
-
-; RUN: llvm-as < %s | opt -sccp | llvm-dis | not grep add
-
-define i128 @test(i1 %B) {
- br i1 %B, label %BB1, label %BB2
-BB1:
- %Val = add i128 0, 1
- br label %BB3
-BB2:
- br label %BB3
-BB3:
- %Ret = phi i128 [%Val, %BB1], [2, %BB2]
- ret i128 %Ret
-}
diff --git a/release_23/test/Transforms/SCCP/apint-basictest2.ll b/release_23/test/Transforms/SCCP/apint-basictest2.ll
deleted file mode 100644
index 7db4e362eb4c..000000000000
--- a/release_23/test/Transforms/SCCP/apint-basictest2.ll
+++ /dev/null
@@ -1,17 +0,0 @@
-; This is a basic sanity check for constant propogation. The add instruction
-; and phi instruction should be eliminated.
-
-; RUN: llvm-as < %s | opt -sccp | llvm-dis | not grep phi
-; RUN: llvm-as < %s | opt -sccp | llvm-dis | not grep add
-
-define i128 @test(i1 %B) {
- br i1 %B, label %BB1, label %BB2
-BB1:
- %Val = add i128 0, 1
- br label %BB3
-BB2:
- br label %BB3
-BB3:
- %Ret = phi i128 [%Val, %BB1], [1, %BB2]
- ret i128 %Ret
-}
diff --git a/release_23/test/Transforms/SCCP/apint-basictest3.ll b/release_23/test/Transforms/SCCP/apint-basictest3.ll
deleted file mode 100644
index 6e86764bf2cf..000000000000
--- a/release_23/test/Transforms/SCCP/apint-basictest3.ll
+++ /dev/null
@@ -1,23 +0,0 @@
-; This is a basic sanity check for constant propogation. It tests the basic
-; arithmatic operations.
-
-
-; RUN: llvm-as < %s | opt -sccp | llvm-dis | not grep mul
-; RUN: llvm-as < %s | opt -sccp | llvm-dis | not grep umod
-
-define i128 @test(i1 %B) {
- br i1 %B, label %BB1, label %BB2
-BB1:
- %t1 = add i128 0, 1
- %t2 = sub i128 0, %t1
- %t3 = mul i128 %t2, -1
- br label %BB3
-BB2:
- %f1 = udiv i128 -1, 1
- %f2 = add i128 %f1, 1
- %f3 = urem i128 %f2, 2121
- br label %BB3
-BB3:
- %Ret = phi i128 [%t3, %BB1], [%f3, %BB2]
- ret i128 %Ret
-}
diff --git a/release_23/test/Transforms/SCCP/apint-basictest4.ll b/release_23/test/Transforms/SCCP/apint-basictest4.ll
deleted file mode 100644
index a90bd7d7315b..000000000000
--- a/release_23/test/Transforms/SCCP/apint-basictest4.ll
+++ /dev/null
@@ -1,25 +0,0 @@
-; This is a basic sanity check for constant propogation. It tests the basic
-; logic operations.
-
-
-; RUN: llvm-as < %s | opt -sccp | llvm-dis | not grep and
-; RUN: llvm-as < %s | opt -sccp | llvm-dis | not grep trunc
-; RUN: llvm-as < %s | opt -sccp | llvm-dis | grep {ret i100 -1}
-
-define i100 @test(i133 %A) {
- %B = and i133 0, %A
- %C = icmp sgt i133 %B, 0
- br i1 %C, label %BB1, label %BB2
-BB1:
- %t3 = xor i133 %B, -1
- %t4 = trunc i133 %t3 to i100
- br label %BB3
-BB2:
- %f1 = or i133 -1, %A
- %f2 = lshr i133 %f1, 33
- %f3 = trunc i133 %f2 to i100
- br label %BB3
-BB3:
- %Ret = phi i100 [%t4, %BB1], [%f3, %BB2]
- ret i100 %Ret
-}
diff --git a/release_23/test/Transforms/SCCP/apint-bigarray.ll b/release_23/test/Transforms/SCCP/apint-bigarray.ll
deleted file mode 100644
index 5cd1107a7a44..000000000000
--- a/release_23/test/Transforms/SCCP/apint-bigarray.ll
+++ /dev/null
@@ -1,23 +0,0 @@
-; RUN: llvm-as < %s | opt -sccp | llvm-dis | not grep %X
-
-@G = global [1000000 x i10000] zeroinitializer
-
-define internal i10000* @test(i10000 %Arg) {
- %X = getelementptr [1000000 x i10000]* @G, i32 0, i32 999
- store i10000 %Arg, i10000* %X
- ret i10000* %X
-}
-
-define i10000 @caller()
-{
- %Y = call i10000* @test(i10000 -1)
- %Z = load i10000* %Y
- ret i10000 %Z
-}
-
-define i10000 @caller2()
-{
- %Y = call i10000* @test(i10000 1)
- %Z = load i10000* %Y
- ret i10000 %Z
-}
diff --git a/release_23/test/Transforms/SCCP/apint-bigint.ll b/release_23/test/Transforms/SCCP/apint-bigint.ll
deleted file mode 100644
index ebb0d0760f2e..000000000000
--- a/release_23/test/Transforms/SCCP/apint-bigint.ll
+++ /dev/null
@@ -1,9 +0,0 @@
-; RUN: llvm-as < %s | opt -sccp | llvm-dis | not grep xor
-
-define i11129 @test1() {
- %B = shl i11129 1, 11128
- %C = sub i11129 %B, 1
- %D = xor i11129 %B, %C
-
- ret i11129 %D
-}
diff --git a/release_23/test/Transforms/SCCP/apint-bigint2.ll b/release_23/test/Transforms/SCCP/apint-bigint2.ll
deleted file mode 100644
index e95e9d0abb13..000000000000
--- a/release_23/test/Transforms/SCCP/apint-bigint2.ll
+++ /dev/null
@@ -1,18 +0,0 @@
-; RUN: llvm-as < %s | opt -sccp | llvm-dis | not grep load
-
-@Y = constant [6 x i101] [ i101 12, i101 123456789000000, i101 -12,
- i101 -123456789000000, i101 0,i101 9123456789000000]
-
-define i101 @array()
-{
-Head:
- %A = getelementptr [6 x i101]* @Y, i32 0, i32 1
- %B = load i101* %A
- %D = and i101 %B, 1
- %DD = or i101 %D, 1
- %E = trunc i101 %DD to i32
- %F = getelementptr [6 x i101]* @Y, i32 0, i32 %E
- %G = load i101* %F
-
- ret i101 %G
-}
diff --git a/release_23/test/Transforms/SCCP/apint-ipsccp1.ll b/release_23/test/Transforms/SCCP/apint-ipsccp1.ll
deleted file mode 100644
index 59cfa3f7a2f3..000000000000
--- a/release_23/test/Transforms/SCCP/apint-ipsccp1.ll
+++ /dev/null
@@ -1,24 +0,0 @@
-; RUN: llvm-as < %s | opt -ipsccp | llvm-dis | grep -v {ret i512 undef} | \
-; RUN: grep {ret i8 2}
-
-define internal i512 @test(i1 %B) {
- br i1 %B, label %BB1, label %BB2
-BB1:
- %Val = add i512 0, 1
- br label %BB3
-BB2:
- br label %BB3
-BB3:
- %Ret = phi i512 [%Val, %BB1], [2, %BB2]
- ret i512 %Ret
-}
-
-define i8 @caller()
-{
- %t1 = and i2 2, 1
- %t11 = trunc i2 %t1 to i1
- %t2 = call i512 @test(i1 %t11)
- %t3 = trunc i512 %t2 to i8
- ret i8 %t3
-}
-
diff --git a/release_23/test/Transforms/SCCP/apint-ipsccp2.ll b/release_23/test/Transforms/SCCP/apint-ipsccp2.ll
deleted file mode 100644
index 65e5ee7e89ec..000000000000
--- a/release_23/test/Transforms/SCCP/apint-ipsccp2.ll
+++ /dev/null
@@ -1,19 +0,0 @@
-; RUN: llvm-as < %s | opt -ipsccp | llvm-dis | grep -v {ret i101 0} | \
-; RUN: grep -v {ret i101 undef} | not grep ret
-
-
-define internal i101 @bar(i101 %A) {
- %x = icmp eq i101 %A, 0
- br i1 %x, label %T, label %F
-T:
- %B = call i101 @bar(i101 0)
- ret i101 0
-F: ; unreachable
- %C = call i101 @bar(i101 1)
- ret i101 %C
-}
-
-define i101 @foo() {
- %X = call i101 @bar(i101 0)
- ret i101 %X
-}
diff --git a/release_23/test/Transforms/SCCP/apint-ipsccp3.ll b/release_23/test/Transforms/SCCP/apint-ipsccp3.ll
deleted file mode 100644
index c07a54f8f6f8..000000000000
--- a/release_23/test/Transforms/SCCP/apint-ipsccp3.ll
+++ /dev/null
@@ -1,23 +0,0 @@
-; RUN: llvm-as < %s | opt -ipsccp | llvm-dis | not grep global
-
-@G = internal global i66 undef
-
-
-
-define void @foo() {
- %X = load i66* @G
- store i66 %X, i66* @G
- ret void
-}
-
-define i66 @bar() {
- %V = load i66* @G
- %C = icmp eq i66 %V, 17
- br i1 %C, label %T, label %F
-T:
- store i66 17, i66* @G
- ret i66 %V
-F:
- store i66 123, i66* @G
- ret i66 0
-}
diff --git a/release_23/test/Transforms/SCCP/apint-ipsccp4.ll b/release_23/test/Transforms/SCCP/apint-ipsccp4.ll
deleted file mode 100644
index de355d1d50e1..000000000000
--- a/release_23/test/Transforms/SCCP/apint-ipsccp4.ll
+++ /dev/null
@@ -1,49 +0,0 @@
-; This test makes sure that these instructions are properly constant propagated.
-
-; RUN: llvm-as < %s | opt -ipsccp | llvm-dis | not grep load
-; RUN: llvm-as < %s | opt -ipsccp | llvm-dis | not grep add
-; RUN: llvm-as < %s | opt -ipsccp | llvm-dis | not grep phi
-
-
-@Y = constant [2 x { i212, float }] [ { i212, float } { i212 12, float 1.0 },
- { i212, float } { i212 37, float 2.0 } ]
-
-define internal float @test2() {
- %A = getelementptr [2 x { i212, float}]* @Y, i32 0, i32 1, i32 1
- %B = load float* %A
- ret float %B
-}
-
-define internal float @test3() {
- %A = getelementptr [2 x { i212, float}]* @Y, i32 0, i32 0, i32 1
- %B = load float* %A
- ret float %B
-}
-
-define internal float @test()
-{
- %A = call float @test2()
- %B = call float @test3()
-
- %E = fdiv float %B, %A
- ret float %E
-}
-
-define float @All()
-{
- %A = call float @test()
- %B = fcmp oge float %A, 1.0
- br i1 %B, label %T, label %F
-T:
- %C = add float %A, 1.0
- br label %exit
-F:
- %D = add float %A, 2.0
- br label %exit
-exit:
- %E = phi float [%C, %T], [%D, %F]
- ret float %E
-}
-
-
-
diff --git a/release_23/test/Transforms/SCCP/apint-load.ll b/release_23/test/Transforms/SCCP/apint-load.ll
deleted file mode 100644
index 96509714bb07..000000000000
--- a/release_23/test/Transforms/SCCP/apint-load.ll
+++ /dev/null
@@ -1,36 +0,0 @@
-; This test makes sure that these instructions are properly constant propagated.
-
-; RUN: llvm-as < %s | opt -ipsccp | llvm-dis | not grep load
-; RUN: llvm-as < %s | opt -ipsccp | llvm-dis | not grep fdiv
-
-@X = constant i212 42
-@Y = constant [2 x { i212, float }] [ { i212, float } { i212 12, float 1.0 },
- { i212, float } { i212 37, float 0x3FF3B2FEC0000000 } ]
-define i212 @test1() {
- %B = load i212* @X
- ret i212 %B
-}
-
-define internal float @test2() {
- %A = getelementptr [2 x { i212, float}]* @Y, i32 0, i32 1, i32 1
- %B = load float* %A
- ret float %B
-}
-
-define internal i212 @test3() {
- %A = getelementptr [2 x { i212, float}]* @Y, i32 0, i32 0, i32 0
- %B = load i212* %A
- ret i212 %B
-}
-
-define float @All()
-{
- %A = call float @test2()
- %B = call i212 @test3()
- %C = mul i212 %B, -1234567
- %D = sitofp i212 %C to float
- %E = fdiv float %A, %D
- ret float %E
-}
-
-
diff --git a/release_23/test/Transforms/SCCP/apint-phi.ll b/release_23/test/Transforms/SCCP/apint-phi.ll
deleted file mode 100644
index 77f6bc869266..000000000000
--- a/release_23/test/Transforms/SCCP/apint-phi.ll
+++ /dev/null
@@ -1,19 +0,0 @@
-; RUN: llvm-as < %s | opt -sccp | llvm-dis | not grep phi
-
-define i999 @test(i999%A, i1 %c) {
-bb1:
- br label %BB2
-BB2:
- %V = phi i999 [2, %bb1], [%A, %BB4]
- br label %BB3
-
-BB3:
- %E = trunc i999 %V to i1
- %F = and i1 %E, %c
- br i1 %F, label %BB4, label %BB5
-BB4:
- br label %BB2
-
-BB5:
- ret i999 %V
-}
diff --git a/release_23/test/Transforms/SCCP/apint-select.ll b/release_23/test/Transforms/SCCP/apint-select.ll
deleted file mode 100644
index c856896be9f9..000000000000
--- a/release_23/test/Transforms/SCCP/apint-select.ll
+++ /dev/null
@@ -1,21 +0,0 @@
-; RUN: llvm-as < %s | opt -sccp | llvm-dis | not grep select
-
-@A = constant i32 10
-
-define i712 @test1() {
- %P = getelementptr i32* @A, i32 0
- %B = ptrtoint i32* %P to i64
- %BB = and i64 %B, undef
- %C = icmp sge i64 %BB, 0
- %X = select i1 %C, i712 0, i712 1
- ret i712 %X
-}
-
-
-
-define i712 @test2(i1 %C) {
- %X = select i1 %C, i712 0, i712 undef
- ret i712 %X
-}
-
-
diff --git a/release_23/test/Transforms/SCCP/basictest.ll b/release_23/test/Transforms/SCCP/basictest.ll
deleted file mode 100644
index 08640a9a239a..000000000000
--- a/release_23/test/Transforms/SCCP/basictest.ll
+++ /dev/null
@@ -1,17 +0,0 @@
-; This is a basic sanity check for constant propogation. The add instruction
-; should be eliminated.
-
-; RUN: llvm-as < %s | opt -sccp | llvm-dis | not grep add
-
-define i32 @test(i1 %B) {
- br i1 %B, label %BB1, label %BB2
-BB1: ; preds = %0
- %Val = add i32 0, 0 ; <i32> [#uses=1]
- br label %BB3
-BB2: ; preds = %0
- br label %BB3
-BB3: ; preds = %BB2, %BB1
- %Ret = phi i32 [ %Val, %BB1 ], [ 1, %BB2 ] ; <i32> [#uses=1]
- ret i32 %Ret
-}
-
diff --git a/release_23/test/Transforms/SCCP/calltest.ll b/release_23/test/Transforms/SCCP/calltest.ll
deleted file mode 100644
index 481ba9c229a2..000000000000
--- a/release_23/test/Transforms/SCCP/calltest.ll
+++ /dev/null
@@ -1,22 +0,0 @@
-; RUN: llvm-as < %s | opt -sccp -adce -simplifycfg | llvm-dis | \
-; RUN: not grep br
-
-; No matter how hard you try, sqrt(1.0) is always 1.0. This allows the
-; optimizer to delete this loop.
-
-declare double @sqrt(double)
-
-define double @test(i32 %param) {
-entry:
- br label %Loop
-Loop: ; preds = %Loop, %entry
- %I2 = phi i32 [ 0, %entry ], [ %I3, %Loop ] ; <i32> [#uses=1]
- %V = phi double [ 1.000000e+00, %entry ], [ %V2, %Loop ] ; <double> [#uses=2]
- %V2 = call double @sqrt( double %V ) ; <double> [#uses=1]
- %I3 = add i32 %I2, 1 ; <i32> [#uses=2]
- %tmp.7 = icmp ne i32 %I3, %param ; <i1> [#uses=1]
- br i1 %tmp.7, label %Loop, label %Exit
-Exit: ; preds = %Loop
- ret double %V
-}
-
diff --git a/release_23/test/Transforms/SCCP/dg.exp b/release_23/test/Transforms/SCCP/dg.exp
deleted file mode 100644
index 879685ca879d..000000000000
--- a/release_23/test/Transforms/SCCP/dg.exp
+++ /dev/null
@@ -1,3 +0,0 @@
-load_lib llvm.exp
-
-RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
diff --git a/release_23/test/Transforms/SCCP/ipsccp-basic.ll b/release_23/test/Transforms/SCCP/ipsccp-basic.ll
deleted file mode 100644
index 1449ea70c39b..000000000000
--- a/release_23/test/Transforms/SCCP/ipsccp-basic.ll
+++ /dev/null
@@ -1,13 +0,0 @@
-; RUN: llvm-as < %s | opt -ipsccp | llvm-dis | \
-; RUN: grep -v {ret i32 17} | grep -v {ret i32 undef} | not grep ret
-
-define internal i32 @bar(i32 %A) {
- %X = add i32 1, 2 ; <i32> [#uses=0]
- ret i32 %A
-}
-
-define i32 @foo() {
- %X = call i32 @bar( i32 17 ) ; <i32> [#uses=1]
- ret i32 %X
-}
-
diff --git a/release_23/test/Transforms/SCCP/ipsccp-conditional.ll b/release_23/test/Transforms/SCCP/ipsccp-conditional.ll
deleted file mode 100644
index b98bbf44be68..000000000000
--- a/release_23/test/Transforms/SCCP/ipsccp-conditional.ll
+++ /dev/null
@@ -1,19 +0,0 @@
-; RUN: llvm-as < %s | opt -ipsccp | llvm-dis | \
-; RUN: grep -v {ret i32 0} | grep -v {ret i32 undef} | not grep ret
-
-define internal i32 @bar(i32 %A) {
- %C = icmp eq i32 %A, 0 ; <i1> [#uses=1]
- br i1 %C, label %T, label %F
-T: ; preds = %0
- %B = call i32 @bar( i32 0 ) ; <i32> [#uses=0]
- ret i32 0
-F: ; preds = %0
- %C.upgrd.1 = call i32 @bar( i32 1 ) ; <i32> [#uses=1]
- ret i32 %C.upgrd.1
-}
-
-define i32 @foo() {
- %X = call i32 @bar( i32 0 ) ; <i32> [#uses=1]
- ret i32 %X
-}
-
diff --git a/release_23/test/Transforms/SCCP/ipsccp-gvar.ll b/release_23/test/Transforms/SCCP/ipsccp-gvar.ll
deleted file mode 100644
index 6f2ee1f4d8a3..000000000000
--- a/release_23/test/Transforms/SCCP/ipsccp-gvar.ll
+++ /dev/null
@@ -1,22 +0,0 @@
-; RUN: llvm-as < %s | opt -ipsccp | llvm-dis | not grep global
-
-@G = internal global i32 undef ; <i32*> [#uses=5]
-
-define void @foo() {
- %X = load i32* @G ; <i32> [#uses=1]
- store i32 %X, i32* @G
- ret void
-}
-
-define i32 @bar() {
- %V = load i32* @G ; <i32> [#uses=2]
- %C = icmp eq i32 %V, 17 ; <i1> [#uses=1]
- br i1 %C, label %T, label %F
-T: ; preds = %0
- store i32 17, i32* @G
- ret i32 %V
-F: ; preds = %0
- store i32 123, i32* @G
- ret i32 0
-}
-
diff --git a/release_23/test/Transforms/SCCP/loadtest.ll b/release_23/test/Transforms/SCCP/loadtest.ll
deleted file mode 100644
index 0cbbdf603661..000000000000
--- a/release_23/test/Transforms/SCCP/loadtest.ll
+++ /dev/null
@@ -1,26 +0,0 @@
-; This test makes sure that these instructions are properly constant propagated.
-;
-
-; RUN: llvm-as < %s | opt -sccp | llvm-dis | not grep load
-
-
-@X = constant i32 42 ; <i32*> [#uses=1]
-@Y = constant [2 x { i32, float }] [ { i32, float } { i32 12, float 1.000000e+00 }, { i32, float } { i32 37, float 0x3FF3B2FEC0000000 } ] ; <[2 x { i32, float }]*> [#uses=2]
-
-define i32 @test1() {
- %B = load i32* @X ; <i32> [#uses=1]
- ret i32 %B
-}
-
-define float @test2() {
- %A = getelementptr [2 x { i32, float }]* @Y, i64 0, i64 1, i32 1 ; <float*> [#uses=1]
- %B = load float* %A ; <float> [#uses=1]
- ret float %B
-}
-
-define i32 @test3() {
- %A = getelementptr [2 x { i32, float }]* @Y, i64 0, i64 0, i32 0 ; <i32*> [#uses=1]
- %B = load i32* %A ; <i32> [#uses=1]
- ret i32 %B
-}
-
diff --git a/release_23/test/Transforms/SCCP/logical-nuke.ll b/release_23/test/Transforms/SCCP/logical-nuke.ll
deleted file mode 100644
index 87454e4dcea6..000000000000
--- a/release_23/test/Transforms/SCCP/logical-nuke.ll
+++ /dev/null
@@ -1,9 +0,0 @@
-; RUN: llvm-as < %s | opt -sccp | llvm-dis | grep {ret i32 0}
-
-; Test that SCCP has basic knowledge of when and/or nuke overdefined values.
-
-define i32 @test(i32 %X) {
- %Y = and i32 %X, 0 ; <i32> [#uses=1]
- ret i32 %Y
-}
-
diff --git a/release_23/test/Transforms/SCCP/phitest.ll b/release_23/test/Transforms/SCCP/phitest.ll
deleted file mode 100644
index c75de5dde8fa..000000000000
--- a/release_23/test/Transforms/SCCP/phitest.ll
+++ /dev/null
@@ -1,21 +0,0 @@
-; RUN: llvm-as < %s | opt -sccp -dce -simplifycfg | llvm-dis | \
-; RUN: not grep br
-
-define i32 @test(i32 %param) {
-entry:
- %tmp.1 = icmp ne i32 %param, 0 ; <i1> [#uses=1]
- br i1 %tmp.1, label %endif.0, label %else
-else: ; preds = %entry
- br label %endif.0
-endif.0: ; preds = %else, %entry
- %a.0 = phi i32 [ 2, %else ], [ 3, %entry ] ; <i32> [#uses=1]
- %b.0 = phi i32 [ 3, %else ], [ 2, %entry ] ; <i32> [#uses=1]
- %tmp.5 = add i32 %a.0, %b.0 ; <i32> [#uses=1]
- %tmp.7 = icmp ne i32 %tmp.5, 5 ; <i1> [#uses=1]
- br i1 %tmp.7, label %UnifiedReturnBlock, label %endif.1
-endif.1: ; preds = %endif.0
- ret i32 0
-UnifiedReturnBlock: ; preds = %endif.0
- ret i32 2
-}
-
diff --git a/release_23/test/Transforms/SCCP/sccptest.ll b/release_23/test/Transforms/SCCP/sccptest.ll
deleted file mode 100644
index 84ba2d43cde7..000000000000
--- a/release_23/test/Transforms/SCCP/sccptest.ll
+++ /dev/null
@@ -1,31 +0,0 @@
-; This is the test case taken from appel's book that illustrates a hard case
-; that SCCP gets right. BB3 should be completely eliminated.
-;
-; RUN: llvm-as < %s | opt -sccp -constprop -dce -simplifycfg | \
-; RUN: llvm-dis | not grep BB3
-
-define i32 @testfunction(i32 %i0, i32 %j0) {
-BB1:
- br label %BB2
-BB2: ; preds = %BB7, %BB1
- %j2 = phi i32 [ %j4, %BB7 ], [ 1, %BB1 ] ; <i32> [#uses=2]
- %k2 = phi i32 [ %k4, %BB7 ], [ 0, %BB1 ] ; <i32> [#uses=4]
- %kcond = icmp slt i32 %k2, 100 ; <i1> [#uses=1]
- br i1 %kcond, label %BB3, label %BB4
-BB3: ; preds = %BB2
- %jcond = icmp slt i32 %j2, 20 ; <i1> [#uses=1]
- br i1 %jcond, label %BB5, label %BB6
-BB4: ; preds = %BB2
- ret i32 %j2
-BB5: ; preds = %BB3
- %k3 = add i32 %k2, 1 ; <i32> [#uses=1]
- br label %BB7
-BB6: ; preds = %BB3
- %k5 = add i32 %k2, 1 ; <i32> [#uses=1]
- br label %BB7
-BB7: ; preds = %BB6, %BB5
- %j4 = phi i32 [ 1, %BB5 ], [ %k2, %BB6 ] ; <i32> [#uses=1]
- %k4 = phi i32 [ %k3, %BB5 ], [ %k5, %BB6 ] ; <i32> [#uses=1]
- br label %BB2
-}
-
diff --git a/release_23/test/Transforms/SCCP/select.ll b/release_23/test/Transforms/SCCP/select.ll
deleted file mode 100644
index 74b20d09c143..000000000000
--- a/release_23/test/Transforms/SCCP/select.ll
+++ /dev/null
@@ -1,12 +0,0 @@
-; RUN: llvm-as < %s | opt -sccp | llvm-dis | not grep select
-
-define i32 @test1(i1 %C) {
- %X = select i1 %C, i32 0, i32 0 ; <i32> [#uses=1]
- ret i32 %X
-}
-
-define i32 @test2(i1 %C) {
- %X = select i1 %C, i32 0, i32 undef ; <i32> [#uses=1]
- ret i32 %X
-}
-
diff --git a/release_23/test/Transforms/SRETPromotion/2008-03-07-Inline-2.ll b/release_23/test/Transforms/SRETPromotion/2008-03-07-Inline-2.ll
deleted file mode 100644
index 0c256906a072..000000000000
--- a/release_23/test/Transforms/SRETPromotion/2008-03-07-Inline-2.ll
+++ /dev/null
@@ -1,53 +0,0 @@
-; RUN: llvm-as < %s | opt -inline -disable-output
- %struct.Demand = type { double, double }
- %struct.branch = type { %struct.Demand, double, double, double, double, %struct.branch*, [12 x %struct.leaf*] }
- %struct.leaf = type { %struct.Demand, double, double }
-@P = external global double ; <double*> [#uses=1]
-
-define %struct.leaf* @build_leaf() nounwind {
-entry:
- unreachable
-}
-
-define %struct.Demand @Compute_Branch2(%struct.branch* %br, double %theta_R, double %theta_I, double %pi_R, double %pi_I) nounwind {
-entry:
- %mrv = alloca %struct.Demand ; <%struct.Demand*> [#uses=4]
- %a2 = alloca %struct.Demand ; <%struct.Demand*> [#uses=0]
- br i1 false, label %bb46, label %bb
-bb: ; preds = %entry
- %mrv.gep = getelementptr %struct.Demand* %mrv, i32 0, i32 0 ; <double*> [#uses=1]
- %mrv.ld = load double* %mrv.gep ; <double> [#uses=1]
- %mrv.gep1 = getelementptr %struct.Demand* %mrv, i32 0, i32 1 ; <double*> [#uses=1]
- %mrv.ld2 = load double* %mrv.gep1 ; <double> [#uses=1]
- ret double %mrv.ld, double %mrv.ld2
-bb46: ; preds = %entry
- br label %bb72
-bb49: ; preds = %bb72
- call %struct.Demand @Compute_Leaf1( %struct.leaf* null, double 0.000000e+00, double 0.000000e+00 ) nounwind ; <%struct.Demand>:0 [#uses=1]
- %gr = getresult %struct.Demand %0, 1 ; <double> [#uses=0]
- br label %bb72
-bb72: ; preds = %bb49, %bb46
- br i1 false, label %bb49, label %bb77
-bb77: ; preds = %bb72
- %mrv.gep3 = getelementptr %struct.Demand* %mrv, i32 0, i32 0 ; <double*> [#uses=1]
- %mrv.ld4 = load double* %mrv.gep3 ; <double> [#uses=1]
- %mrv.gep5 = getelementptr %struct.Demand* %mrv, i32 0, i32 1 ; <double*> [#uses=1]
- %mrv.ld6 = load double* %mrv.gep5 ; <double> [#uses=1]
- ret double %mrv.ld4, double %mrv.ld6
-}
-
-define %struct.Demand @Compute_Leaf1(%struct.leaf* %l, double %pi_R, double %pi_I) nounwind {
-entry:
- %mrv = alloca %struct.Demand ; <%struct.Demand*> [#uses=2]
- %tmp10 = load double* @P, align 8 ; <double> [#uses=1]
- %tmp11 = fcmp olt double %tmp10, 0.000000e+00 ; <i1> [#uses=1]
- br i1 %tmp11, label %bb, label %bb13
-bb: ; preds = %entry
- br label %bb13
-bb13: ; preds = %bb, %entry
- %mrv.gep = getelementptr %struct.Demand* %mrv, i32 0, i32 0 ; <double*> [#uses=1]
- %mrv.ld = load double* %mrv.gep ; <double> [#uses=1]
- %mrv.gep1 = getelementptr %struct.Demand* %mrv, i32 0, i32 1 ; <double*> [#uses=1]
- %mrv.ld2 = load double* %mrv.gep1 ; <double> [#uses=1]
- ret double %mrv.ld, double %mrv.ld2
-}
diff --git a/release_23/test/Transforms/SRETPromotion/2008-03-07-Inline.ll b/release_23/test/Transforms/SRETPromotion/2008-03-07-Inline.ll
deleted file mode 100644
index 09d14f021343..000000000000
--- a/release_23/test/Transforms/SRETPromotion/2008-03-07-Inline.ll
+++ /dev/null
@@ -1,57 +0,0 @@
-; RUN: llvm-as < %s | opt -inline -disable-output
- %struct.Demand = type { double, double }
- %struct.branch = type { %struct.Demand, double, double, double, double, %struct.branch*, [12 x %struct.leaf*] }
- %struct.leaf = type { %struct.Demand, double, double }
-@P = external global double ; <double*> [#uses=1]
-
-define %struct.leaf* @build_leaf() nounwind {
-entry:
- unreachable
-}
-
-define %struct.Demand @Compute_Branch2(%struct.branch* %br, double %theta_R, double %theta_I, double %pi_R, double %pi_I) nounwind {
-entry:
- %mrv = alloca %struct.Demand ; <%struct.Demand*> [#uses=4]
- %a2 = alloca %struct.Demand ; <%struct.Demand*> [#uses=0]
- br i1 false, label %bb46, label %bb
-bb: ; preds = %entry
- %mrv.gep = getelementptr %struct.Demand* %mrv, i32 0, i32 0 ; <double*> [#uses=1]
- %mrv.ld = load double* %mrv.gep ; <double> [#uses=1]
- %mrv.gep1 = getelementptr %struct.Demand* %mrv, i32 0, i32 1 ; <double*> [#uses=1]
- %mrv.ld2 = load double* %mrv.gep1 ; <double> [#uses=1]
- ret double %mrv.ld, double %mrv.ld2
-bb46: ; preds = %entry
- br label %bb72
-bb49: ; preds = %bb72
- call %struct.Demand @Compute_Leaf1( %struct.leaf* null, double 0.000000e+00, double 0.000000e+00 ) nounwind ; <%struct.Demand>:0 [#uses=1]
- %gr = getresult %struct.Demand %0, 1 ; <double> [#uses=0]
- br label %bb72
-bb72: ; preds = %bb49, %bb46
- br i1 false, label %bb49, label %bb77
-bb77: ; preds = %bb72
- %mrv.gep3 = getelementptr %struct.Demand* %mrv, i32 0, i32 0 ; <double*> [#uses=1]
- %mrv.ld4 = load double* %mrv.gep3 ; <double> [#uses=1]
- %mrv.gep5 = getelementptr %struct.Demand* %mrv, i32 0, i32 1 ; <double*> [#uses=1]
- %mrv.ld6 = load double* %mrv.gep5 ; <double> [#uses=1]
- ret double %mrv.ld4, double %mrv.ld6
-}
-
-define %struct.Demand @Compute_Leaf1(%struct.leaf* %l, double %pi_R, double %pi_I) nounwind {
-entry:
- %mrv = alloca %struct.Demand ; <%struct.Demand*> [#uses=4]
- %tmp10 = load double* @P, align 8 ; <double> [#uses=1]
- %tmp11 = fcmp olt double %tmp10, 0.000000e+00 ; <i1> [#uses=1]
- br i1 %tmp11, label %bb, label %bb13
-bb: ; preds = %entry
- %mrv.gep = getelementptr %struct.Demand* %mrv, i32 0, i32 0 ; <double*> [#uses=1]
- %mrv.ld = load double* %mrv.gep ; <double> [#uses=1]
- %mrv.gep1 = getelementptr %struct.Demand* %mrv, i32 0, i32 1 ; <double*> [#uses=1]
- %mrv.ld2 = load double* %mrv.gep1 ; <double> [#uses=1]
- ret double %mrv.ld, double %mrv.ld2
-bb13: ; preds = %entry
- %mrv.gep3 = getelementptr %struct.Demand* %mrv, i32 0, i32 0 ; <double*> [#uses=1]
- %mrv.ld4 = load double* %mrv.gep3 ; <double> [#uses=1]
- %mrv.gep5 = getelementptr %struct.Demand* %mrv, i32 0, i32 1 ; <double*> [#uses=1]
- %mrv.ld6 = load double* %mrv.gep5 ; <double> [#uses=1]
- ret double %mrv.ld4, double %mrv.ld6
-}
diff --git a/release_23/test/Transforms/SRETPromotion/2008-03-11-attributes.ll b/release_23/test/Transforms/SRETPromotion/2008-03-11-attributes.ll
deleted file mode 100644
index 81a1476fc964..000000000000
--- a/release_23/test/Transforms/SRETPromotion/2008-03-11-attributes.ll
+++ /dev/null
@@ -1,7 +0,0 @@
-; RUN: llvm-as < %s | opt -sretpromotion -disable-output
- %struct.ObjPoint = type { double, double, double, double, double, double }
-
-define void @RotatePoint(%struct.ObjPoint* sret %agg.result, %struct.ObjPoint* byval %a, double %rx, double %ry, double %rz) nounwind {
-entry:
- unreachable
-}
diff --git a/release_23/test/Transforms/SRETPromotion/dg.exp b/release_23/test/Transforms/SRETPromotion/dg.exp
deleted file mode 100644
index 879685ca879d..000000000000
--- a/release_23/test/Transforms/SRETPromotion/dg.exp
+++ /dev/null
@@ -1,3 +0,0 @@
-load_lib llvm.exp
-
-RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
diff --git a/release_23/test/Transforms/ScalarRepl/2003-05-29-ArrayFail.ll b/release_23/test/Transforms/ScalarRepl/2003-05-29-ArrayFail.ll
deleted file mode 100644
index adfa5f85d2eb..000000000000
--- a/release_23/test/Transforms/ScalarRepl/2003-05-29-ArrayFail.ll
+++ /dev/null
@@ -1,13 +0,0 @@
-; RUN: llvm-as < %s | opt -scalarrepl | llvm-dis | \
-; RUN: grep alloca | grep {4 x}
-
-; Test that an array is not incorrectly deconstructed...
-
-define i32 @test() {
- %X = alloca [4 x i32] ; <[4 x i32]*> [#uses=1]
- %Y = getelementptr [4 x i32]* %X, i64 0, i64 0 ; <i32*> [#uses=1]
- ; Must preserve arrayness!
- %Z = getelementptr i32* %Y, i64 1 ; <i32*> [#uses=1]
- %A = load i32* %Z ; <i32> [#uses=1]
- ret i32 %A
-}
diff --git a/release_23/test/Transforms/ScalarRepl/2003-05-30-InvalidIndices.ll b/release_23/test/Transforms/ScalarRepl/2003-05-30-InvalidIndices.ll
deleted file mode 100644
index 83a18c1cd58a..000000000000
--- a/release_23/test/Transforms/ScalarRepl/2003-05-30-InvalidIndices.ll
+++ /dev/null
@@ -1,8 +0,0 @@
-; RUN: llvm-as < %s | opt -scalarrepl
-
-define void @main() {
- %E = alloca { { i32, float, double, i64 }, { i32, float, double, i64 } } ; <{ { i32, float, double, i64 }, { i32, float, double, i64 } }*> [#uses=1]
- %tmp.151 = getelementptr { { i32, float, double, i64 }, { i32, float, double, i64 } }* %E, i64 0, i32 1, i32 3 ; <i64*> [#uses=0]
- ret void
-}
-
diff --git a/release_23/test/Transforms/ScalarRepl/2003-05-30-MultiLevel.ll b/release_23/test/Transforms/ScalarRepl/2003-05-30-MultiLevel.ll
deleted file mode 100644
index 422064967819..000000000000
--- a/release_23/test/Transforms/ScalarRepl/2003-05-30-MultiLevel.ll
+++ /dev/null
@@ -1,10 +0,0 @@
-; RUN: llvm-as < %s | opt -scalarrepl
-
-define i32 @test() {
- %X = alloca { [4 x i32] } ; <{ [4 x i32] }*> [#uses=1]
- %Y = getelementptr { [4 x i32] }* %X, i64 0, i32 0, i64 2 ; <i32*> [#uses=2]
- store i32 4, i32* %Y
- %Z = load i32* %Y ; <i32> [#uses=1]
- ret i32 %Z
-}
-
diff --git a/release_23/test/Transforms/ScalarRepl/2003-09-12-IncorrectPromote.ll b/release_23/test/Transforms/ScalarRepl/2003-09-12-IncorrectPromote.ll
deleted file mode 100644
index ef48cf8d2138..000000000000
--- a/release_23/test/Transforms/ScalarRepl/2003-09-12-IncorrectPromote.ll
+++ /dev/null
@@ -1,13 +0,0 @@
-; Scalar replacement was incorrectly promoting this alloca!!
-;
-; RUN: llvm-as < %s | opt -scalarrepl | llvm-dis | \
-; RUN: sed {s/;.*//g} | grep \[
-
-define i8* @test() {
- %A = alloca [30 x i8] ; <[30 x i8]*> [#uses=1]
- %B = getelementptr [30 x i8]* %A, i64 0, i64 0 ; <i8*> [#uses=2]
- %C = getelementptr i8* %B, i64 1 ; <i8*> [#uses=1]
- store i8 0, i8* %B
- ret i8* %C
-}
-
diff --git a/release_23/test/Transforms/ScalarRepl/2003-10-29-ArrayProblem.ll b/release_23/test/Transforms/ScalarRepl/2003-10-29-ArrayProblem.ll
deleted file mode 100644
index 47b70351e971..000000000000
--- a/release_23/test/Transforms/ScalarRepl/2003-10-29-ArrayProblem.ll
+++ /dev/null
@@ -1,16 +0,0 @@
-; RUN: llvm-as < %s | opt -scalarrepl | llvm-dis | \
-; RUN: grep alloca | grep \{
-
-declare i32 @.callback_1(i8*)
-
-declare void @.iter_2(i32 (i8*)*, i8*)
-
-define i32 @main() {
- %d = alloca { [80 x i8], i32, i32 } ; <{ [80 x i8], i32, i32 }*> [#uses=2]
- %tmp.0 = getelementptr { [80 x i8], i32, i32 }* %d, i64 0, i32 2 ; <i32*> [#uses=1]
- store i32 0, i32* %tmp.0
- %tmp.1 = getelementptr { [80 x i8], i32, i32 }* %d, i64 0, i32 0, i64 0 ; <i8*> [#uses=1]
- call void @.iter_2( i32 (i8*)* @.callback_1, i8* %tmp.1 )
- ret i32 0
-}
-
diff --git a/release_23/test/Transforms/ScalarRepl/2005-12-14-UnionPromoteCrash.ll b/release_23/test/Transforms/ScalarRepl/2005-12-14-UnionPromoteCrash.ll
deleted file mode 100644
index de6e2974a9ec..000000000000
--- a/release_23/test/Transforms/ScalarRepl/2005-12-14-UnionPromoteCrash.ll
+++ /dev/null
@@ -1,28 +0,0 @@
-; RUN: llvm-as < %s | opt -scalarrepl -disable-output
-
-target datalayout = "E-p:32:32"
- %struct.rtx_def = type { [2 x i8], i32, [1 x %union.rtunion_def] }
- %union.rtunion_def = type { i32 }
-
-define void @find_reloads() {
-entry:
- %c_addr.i = alloca i8 ; <i8*> [#uses=1]
- switch i32 0, label %return [
- i32 36, label %label.7
- i32 34, label %label.7
- i32 41, label %label.5
- ]
-label.5: ; preds = %entry
- ret void
-label.7: ; preds = %entry, %entry
- br i1 false, label %then.4, label %switchexit.0
-then.4: ; preds = %label.7
- %tmp.0.i = bitcast i8* %c_addr.i to i32* ; <i32*> [#uses=1]
- store i32 44, i32* %tmp.0.i
- ret void
-switchexit.0: ; preds = %label.7
- ret void
-return: ; preds = %entry
- ret void
-}
-
diff --git a/release_23/test/Transforms/ScalarRepl/2006-01-24-IllegalUnionPromoteCrash.ll b/release_23/test/Transforms/ScalarRepl/2006-01-24-IllegalUnionPromoteCrash.ll
deleted file mode 100644
index bcb8457d553a..000000000000
--- a/release_23/test/Transforms/ScalarRepl/2006-01-24-IllegalUnionPromoteCrash.ll
+++ /dev/null
@@ -1,12 +0,0 @@
-; RUN: llvm-as < %s | opt -scalarrepl -disable-output
-
-target datalayout = "E-p:32:32"
-
-define i32 @test(i64 %L) {
- %X = alloca i32 ; <i32*> [#uses=2]
- %Y = bitcast i32* %X to i64* ; <i64*> [#uses=1]
- store i64 0, i64* %Y
- %Z = load i32* %X ; <i32> [#uses=1]
- ret i32 %Z
-}
-
diff --git a/release_23/test/Transforms/ScalarRepl/2006-04-20-PromoteCrash.ll b/release_23/test/Transforms/ScalarRepl/2006-04-20-PromoteCrash.ll
deleted file mode 100644
index 18493f594713..000000000000
--- a/release_23/test/Transforms/ScalarRepl/2006-04-20-PromoteCrash.ll
+++ /dev/null
@@ -1,18 +0,0 @@
-; RUN: llvm-as < %s | opt -scalarrepl -disable-output
-
-define void @output_toc() {
-entry:
- %buf = alloca [256 x i8], align 16 ; <[256 x i8]*> [#uses=1]
- %name = alloca i8*, align 4 ; <i8**> [#uses=1]
- %real_name = alloca i8*, align 4 ; <i8**> [#uses=0]
- %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
- %buf.upgrd.1 = bitcast [256 x i8]* %buf to i8* ; <i8*> [#uses=1]
- store i8* %buf.upgrd.1, i8** %name
- call void @abort( )
- unreachable
-return: ; No predecessors!
- ret void
-}
-
-declare void @abort()
-
diff --git a/release_23/test/Transforms/ScalarRepl/2006-10-23-PointerUnionCrash.ll b/release_23/test/Transforms/ScalarRepl/2006-10-23-PointerUnionCrash.ll
deleted file mode 100644
index 0007665a8f86..000000000000
--- a/release_23/test/Transforms/ScalarRepl/2006-10-23-PointerUnionCrash.ll
+++ /dev/null
@@ -1,57 +0,0 @@
-; RUN: llvm-as < %s | opt -scalarrepl -disable-output
-; END.
-target datalayout = "e-p:32:32"
-target triple = "i686-apple-darwin8.7.2"
-
-define void @glgProcessColor() {
-entry:
- %source_ptr = alloca i8*, align 4 ; <i8**> [#uses=2]
- br i1 false, label %bb1357, label %cond_next583
-cond_next583: ; preds = %entry
- ret void
-bb1357: ; preds = %entry
- br i1 false, label %bb1365, label %bb27055
-bb1365: ; preds = %bb1357
- switch i32 0, label %cond_next10377 [
- i32 0, label %bb4679
- i32 1, label %bb4679
- i32 2, label %bb4679
- i32 3, label %bb4679
- i32 4, label %bb5115
- i32 5, label %bb6651
- i32 6, label %bb7147
- i32 7, label %bb8683
- i32 8, label %bb9131
- i32 9, label %bb9875
- i32 10, label %bb4679
- i32 11, label %bb4859
- i32 12, label %bb4679
- i32 16, label %bb10249
- ]
-bb4679: ; preds = %bb1365, %bb1365, %bb1365, %bb1365, %bb1365, %bb1365
- ret void
-bb4859: ; preds = %bb1365
- ret void
-bb5115: ; preds = %bb1365
- ret void
-bb6651: ; preds = %bb1365
- ret void
-bb7147: ; preds = %bb1365
- ret void
-bb8683: ; preds = %bb1365
- ret void
-bb9131: ; preds = %bb1365
- ret void
-bb9875: ; preds = %bb1365
- %source_ptr9884 = bitcast i8** %source_ptr to i8** ; <i8**> [#uses=1]
- %tmp9885 = load i8** %source_ptr9884 ; <i8*> [#uses=0]
- ret void
-bb10249: ; preds = %bb1365
- %source_ptr10257 = bitcast i8** %source_ptr to i16** ; <i16**> [#uses=1]
- %tmp10258 = load i16** %source_ptr10257 ; <i16*> [#uses=0]
- ret void
-cond_next10377: ; preds = %bb1365
- ret void
-bb27055: ; preds = %bb1357
- ret void
-}
diff --git a/release_23/test/Transforms/ScalarRepl/2006-11-07-InvalidArrayPromote.ll b/release_23/test/Transforms/ScalarRepl/2006-11-07-InvalidArrayPromote.ll
deleted file mode 100644
index 1f3df499c32f..000000000000
--- a/release_23/test/Transforms/ScalarRepl/2006-11-07-InvalidArrayPromote.ll
+++ /dev/null
@@ -1,20 +0,0 @@
-; RUN: llvm-as < %s | opt -scalarrepl | llvm-dis | \
-; RUN: grep -F {alloca \[2 x <4 x i32>\]}
-
-define i32 @func(<4 x float> %v0, <4 x float> %v1) {
- %vsiidx = alloca [2 x <4 x i32>], align 16 ; <[2 x <4 x i32>]*> [#uses=3]
- %tmp = call <4 x i32> @llvm.x86.sse2.cvttps2dq( <4 x float> %v0 ) ; <<4 x i32>> [#uses=2]
- %tmp.upgrd.1 = bitcast <4 x i32> %tmp to <2 x i64> ; <<2 x i64>> [#uses=0]
- %tmp.upgrd.2 = getelementptr [2 x <4 x i32>]* %vsiidx, i32 0, i32 0 ; <<4 x i32>*> [#uses=1]
- store <4 x i32> %tmp, <4 x i32>* %tmp.upgrd.2
- %tmp10 = call <4 x i32> @llvm.x86.sse2.cvttps2dq( <4 x float> %v1 ) ; <<4 x i32>> [#uses=2]
- %tmp10.upgrd.3 = bitcast <4 x i32> %tmp10 to <2 x i64> ; <<2 x i64>> [#uses=0]
- %tmp14 = getelementptr [2 x <4 x i32>]* %vsiidx, i32 0, i32 1 ; <<4 x i32>*> [#uses=1]
- store <4 x i32> %tmp10, <4 x i32>* %tmp14
- %tmp15 = getelementptr [2 x <4 x i32>]* %vsiidx, i32 0, i32 0, i32 4 ; <i32*> [#uses=1]
- %tmp.upgrd.4 = load i32* %tmp15 ; <i32> [#uses=1]
- ret i32 %tmp.upgrd.4
-}
-
-declare <4 x i32> @llvm.x86.sse2.cvttps2dq(<4 x float>)
-
diff --git a/release_23/test/Transforms/ScalarRepl/2006-12-11-SROA-Crash.ll b/release_23/test/Transforms/ScalarRepl/2006-12-11-SROA-Crash.ll
deleted file mode 100644
index ae870d385580..000000000000
--- a/release_23/test/Transforms/ScalarRepl/2006-12-11-SROA-Crash.ll
+++ /dev/null
@@ -1,20 +0,0 @@
-; RUN: llvm-as < %s | opt -scalarrepl -disable-output
-; PR1045
-
-target datalayout = "e-p:32:32"
-target triple = "i686-pc-linux-gnu"
- %"struct.__gnu_cxx::balloc::_Inclusive_between<__gnu_cxx::bitmap_allocator<char>::_Alloc_block*>" = type { %"struct.__gnu_cxx::bitmap_allocator<char>::_Alloc_block"* }
- %"struct.__gnu_cxx::bitmap_allocator<char>" = type { i8 }
- %"struct.__gnu_cxx::bitmap_allocator<char>::_Alloc_block" = type { [8 x i8] }
-
-define void @_ZN9__gnu_cxx16bitmap_allocatorIwE27_M_deallocate_single_objectEPw() {
-entry:
- %this_addr.i = alloca %"struct.__gnu_cxx::balloc::_Inclusive_between<__gnu_cxx::bitmap_allocator<char>::_Alloc_block*>"* ; <%"struct.__gnu_cxx::balloc::_Inclusive_between<__gnu_cxx::bitmap_allocator<char>::_Alloc_block*>"**> [#uses=3]
- %tmp = alloca %"struct.__gnu_cxx::balloc::_Inclusive_between<__gnu_cxx::bitmap_allocator<char>::_Alloc_block*>", align 4 ; <%"struct.__gnu_cxx::balloc::_Inclusive_between<__gnu_cxx::bitmap_allocator<char>::_Alloc_block*>"*> [#uses=1]
- store %"struct.__gnu_cxx::balloc::_Inclusive_between<__gnu_cxx::bitmap_allocator<char>::_Alloc_block*>"* %tmp, %"struct.__gnu_cxx::balloc::_Inclusive_between<__gnu_cxx::bitmap_allocator<char>::_Alloc_block*>"** %this_addr.i
- %tmp.i = load %"struct.__gnu_cxx::balloc::_Inclusive_between<__gnu_cxx::bitmap_allocator<char>::_Alloc_block*>"** %this_addr.i ; <%"struct.__gnu_cxx::balloc::_Inclusive_between<__gnu_cxx::bitmap_allocator<char>::_Alloc_block*>"*> [#uses=1]
- %tmp.i.upgrd.1 = bitcast %"struct.__gnu_cxx::balloc::_Inclusive_between<__gnu_cxx::bitmap_allocator<char>::_Alloc_block*>"* %tmp.i to %"struct.__gnu_cxx::bitmap_allocator<char>"* ; <%"struct.__gnu_cxx::bitmap_allocator<char>"*> [#uses=0]
- %tmp1.i = load %"struct.__gnu_cxx::balloc::_Inclusive_between<__gnu_cxx::bitmap_allocator<char>::_Alloc_block*>"** %this_addr.i ; <%"struct.__gnu_cxx::balloc::_Inclusive_between<__gnu_cxx::bitmap_allocator<char>::_Alloc_block*>"*> [#uses=1]
- %tmp.i.upgrd.2 = getelementptr %"struct.__gnu_cxx::balloc::_Inclusive_between<__gnu_cxx::bitmap_allocator<char>::_Alloc_block*>"* %tmp1.i, i32 0, i32 0 ; <%"struct.__gnu_cxx::bitmap_allocator<char>::_Alloc_block"**> [#uses=0]
- unreachable
-}
diff --git a/release_23/test/Transforms/ScalarRepl/2007-03-19-CanonicalizeMemcpy.ll b/release_23/test/Transforms/ScalarRepl/2007-03-19-CanonicalizeMemcpy.ll
deleted file mode 100644
index 769ec199b849..000000000000
--- a/release_23/test/Transforms/ScalarRepl/2007-03-19-CanonicalizeMemcpy.ll
+++ /dev/null
@@ -1,44 +0,0 @@
-; RUN: llvm-as < %s | opt -scalarrepl -disable-output
-
-target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:32-f32:32:32-f64:32:32-v64:64:64-v128:128:128-a0:0:64"
-target triple = "arm-apple-darwin8"
- %struct.CGPoint = type { float, float }
- %struct.aal_big_range_t = type { i32, i32 }
- %struct.aal_callback_t = type { i8* (i8*, i32)*, void (i8*, i8*)* }
- %struct.aal_edge_pool_t = type { %struct.aal_edge_pool_t*, i32, i32, [0 x %struct.aal_edge_t] }
- %struct.aal_edge_t = type { %struct.CGPoint, %struct.CGPoint, i32 }
- %struct.aal_range_t = type { i16, i16 }
- %struct.aal_span_pool_t = type { %struct.aal_span_pool_t*, [341 x %struct.aal_span_t] }
- %struct.aal_span_t = type { %struct.aal_span_t*, %struct.aal_big_range_t }
- %struct.aal_spanarray_t = type { [2 x %struct.aal_range_t] }
- %struct.aal_spanbucket_t = type { i16, [2 x i8], %struct.anon }
- %struct.aal_state_t = type { %struct.CGPoint, %struct.CGPoint, %struct.CGPoint, i32, float, float, float, float, %struct.CGPoint, %struct.CGPoint, float, float, float, float, i32, i32, i32, i32, float, float, i8*, i32, i32, %struct.aal_edge_pool_t*, %struct.aal_edge_pool_t*, i8*, %struct.aal_callback_t*, i32, %struct.aal_span_t*, %struct.aal_span_t*, %struct.aal_span_t*, %struct.aal_span_pool_t*, i8, float, i8, i32 }
- %struct.anon = type { %struct.aal_spanarray_t }
-
-
-declare void @llvm.memcpy.i32(i8*, i8*, i32, i32)
-
-define fastcc void @aal_insert_span() {
-entry:
- %SB = alloca %struct.aal_spanbucket_t, align 4 ; <%struct.aal_spanbucket_t*> [#uses=2]
- br i1 false, label %cond_true, label %cond_next79
-
-cond_true: ; preds = %entry
- br i1 false, label %cond_next, label %cond_next114.i
-
-cond_next114.i: ; preds = %cond_true
- ret void
-
-cond_next: ; preds = %cond_true
- %SB19 = bitcast %struct.aal_spanbucket_t* %SB to i8* ; <i8*> [#uses=1]
- call void @llvm.memcpy.i32( i8* %SB19, i8* null, i32 12, i32 0 )
- br i1 false, label %cond_next34, label %cond_next79
-
-cond_next34: ; preds = %cond_next
- %i.2.reload22 = load i32* null ; <i32> [#uses=1]
- %tmp51 = getelementptr %struct.aal_spanbucket_t* %SB, i32 0, i32 2, i32 0, i32 0, i32 %i.2.reload22, i32 1 ; <i16*> [#uses=0]
- ret void
-
-cond_next79: ; preds = %cond_next, %entry
- ret void
-}
diff --git a/release_23/test/Transforms/ScalarRepl/2007-05-24-LargeAggregate.ll b/release_23/test/Transforms/ScalarRepl/2007-05-24-LargeAggregate.ll
deleted file mode 100644
index 43b721b7013e..000000000000
--- a/release_23/test/Transforms/ScalarRepl/2007-05-24-LargeAggregate.ll
+++ /dev/null
@@ -1,27 +0,0 @@
-; RUN: llvm-as < %s | opt -scalarrepl | llvm-dis | grep {alloca.*client_t}
-; PR1446
-target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64"
-target triple = "i686-pc-linux-gnu"
-
- %struct.clientSnapshot_t = type { i32, [32 x i8], %struct.playerState_t, i32, i32, i32, i32, i32 }
- %struct.client_t = type { i32, [1024 x i8], [64 x [1024 x i8]], i32, i32, i32, i32, i32, i32, %struct.usercmd_t, i32, i32, [1024 x i8], %struct.sharedEntity_t*, [32 x i8], [64 x i8], i32, i32, i32, i32, i32, i32, [8 x i8*], [8 x i32], i32, i32, i32, i32, i32, i32, i32, i32, i32, [32 x %struct.clientSnapshot_t], i32, i32, i32, i32, i32, %struct.netchan_t, %struct.netchan_buffer_t*, %struct.netchan_buffer_t**, i32, [1025 x i32] }
- %struct.entityShared_t = type { %struct.entityState_t, i32, i32, i32, i32, i32, [3 x float], [3 x float], i32, [3 x float], [3 x float], [3 x float], [3 x float], i32 }
- %struct.entityState_t = type { i32, i32, i32, %struct.trajectory_t, %struct.trajectory_t, i32, i32, [3 x float], [3 x float], [3 x float], [3 x float], i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 }
- %struct.msg_t = type { i32, i32, i32, i8*, i32, i32, i32, i32 }
- %struct.netadr_t = type { i32, [4 x i8], [10 x i8], i16 }
- %struct.netchan_buffer_t = type { %struct.msg_t, [16384 x i8], %struct.netchan_buffer_t* }
- %struct.netchan_t = type { i32, i32, %struct.netadr_t, i32, i32, i32, i32, i32, [16384 x i8], i32, i32, i32, [16384 x i8] }
- %struct.playerState_t = type { i32, i32, i32, i32, i32, [3 x float], [3 x float], i32, i32, i32, [3 x i32], i32, i32, i32, i32, i32, i32, [3 x float], i32, i32, [2 x i32], [2 x i32], i32, i32, i32, i32, i32, i32, [3 x float], i32, i32, i32, i32, i32, [16 x i32], [16 x i32], [16 x i32], [16 x i32], i32, i32, i32, i32, i32, i32, i32 }
- %struct.sharedEntity_t = type { %struct.entityState_t, %struct.entityShared_t }
- %struct.trajectory_t = type { i32, i32, i32, [3 x float], [3 x float] }
- %struct.usercmd_t = type { i32, [3 x i32], i32, i8, i8, i8, i8 }
-
-declare void @llvm.memcpy.i32(i8*, i8*, i32, i32)
-
-define void @SV_DirectConnect(i64 %from.0.0, i64 %from.0.1, i32 %from.1) {
-entry:
- %temp = alloca %struct.client_t, align 16 ; <%struct.client_t*> [#uses=1]
- %temp586 = bitcast %struct.client_t* %temp to i8* ; <i8*> [#uses=1]
- call void @llvm.memcpy.i32( i8* null, i8* %temp586, i32 121596, i32 0 )
- unreachable
-}
diff --git a/release_23/test/Transforms/ScalarRepl/2007-05-29-MemcpyPreserve.ll b/release_23/test/Transforms/ScalarRepl/2007-05-29-MemcpyPreserve.ll
deleted file mode 100644
index dc1198ead89f..000000000000
--- a/release_23/test/Transforms/ScalarRepl/2007-05-29-MemcpyPreserve.ll
+++ /dev/null
@@ -1,23 +0,0 @@
-; RUN: llvm-as < %s | opt -scalarrepl | llvm-dis | grep memcpy
-; PR1421
-
-target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64"
-target triple = "i686-apple-darwin8"
- %struct.LongestMember = type { i8, i32 }
- %struct.MyString = type { i32 }
- %struct.UnionType = type { %struct.LongestMember }
-
-define void @_Z4testP9UnionTypePS0_(%struct.UnionType* %p, %struct.UnionType** %pointerToUnion) {
-entry:
- %tmp = alloca %struct.UnionType, align 8 ; <%struct.UnionType*> [#uses=2]
- %tmp2 = getelementptr %struct.UnionType* %tmp, i32 0, i32 0, i32 0 ; <i8*> [#uses=1]
- %tmp13 = getelementptr %struct.UnionType* %p, i32 0, i32 0, i32 0 ; <i8*> [#uses=1]
- call void @llvm.memcpy.i32( i8* %tmp2, i8* %tmp13, i32 8, i32 0 )
- %tmp5 = load %struct.UnionType** %pointerToUnion ; <%struct.UnionType*> [#uses=1]
- %tmp56 = getelementptr %struct.UnionType* %tmp5, i32 0, i32 0, i32 0 ; <i8*> [#uses=1]
- %tmp7 = getelementptr %struct.UnionType* %tmp, i32 0, i32 0, i32 0 ; <i8*> [#uses=1]
- call void @llvm.memcpy.i32( i8* %tmp56, i8* %tmp7, i32 8, i32 0 )
- ret void
-}
-
-declare void @llvm.memcpy.i32(i8*, i8*, i32, i32)
diff --git a/release_23/test/Transforms/ScalarRepl/2007-11-03-bigendian_apint.ll b/release_23/test/Transforms/ScalarRepl/2007-11-03-bigendian_apint.ll
deleted file mode 100644
index d2d2b24da763..000000000000
--- a/release_23/test/Transforms/ScalarRepl/2007-11-03-bigendian_apint.ll
+++ /dev/null
@@ -1,30 +0,0 @@
-; RUN: llvm-as < %s | opt -scalarrepl | llvm-dis | not grep shr
-
-%struct.S = type { i16 }
-
-define i1 @f(i16 signext %b) zeroext {
-entry:
- %b_addr = alloca i16 ; <i16*> [#uses=2]
- %retval = alloca i32 ; <i32*> [#uses=2]
- %s = alloca %struct.S ; <%struct.S*> [#uses=2]
- %tmp = alloca i32 ; <i32*> [#uses=2]
- %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
- store i16 %b, i16* %b_addr
- %tmp1 = getelementptr %struct.S* %s, i32 0, i32 0 ; <i16*> [#uses=1]
- %tmp2 = load i16* %b_addr, align 2 ; <i16> [#uses=1]
- store i16 %tmp2, i16* %tmp1, align 2
- %tmp3 = getelementptr %struct.S* %s, i32 0, i32 0 ; <i16*> [#uses=1]
- %tmp34 = bitcast i16* %tmp3 to [2 x i1]* ; <[2 x i1]*> [#uses=1]
- %tmp5 = getelementptr [2 x i1]* %tmp34, i32 0, i32 1 ; <i1*> [#uses=1]
- %tmp6 = load i1* %tmp5, align 1 ; <i1> [#uses=1]
- %tmp67 = zext i1 %tmp6 to i32 ; <i32> [#uses=1]
- store i32 %tmp67, i32* %tmp, align 4
- %tmp8 = load i32* %tmp, align 4 ; <i32> [#uses=1]
- store i32 %tmp8, i32* %retval, align 4
- br label %return
-
-return: ; preds = %entry
- %retval9 = load i32* %retval ; <i32> [#uses=1]
- %retval910 = trunc i32 %retval9 to i1 ; <i1> [#uses=1]
- ret i1 %retval910
-}
diff --git a/release_23/test/Transforms/ScalarRepl/2008-01-29-PromoteBug.ll b/release_23/test/Transforms/ScalarRepl/2008-01-29-PromoteBug.ll
deleted file mode 100644
index 0675a966b5a3..000000000000
--- a/release_23/test/Transforms/ScalarRepl/2008-01-29-PromoteBug.ll
+++ /dev/null
@@ -1,21 +0,0 @@
-; RUN: llvm-as < %s | opt -scalarrepl -instcombine | llvm-dis | grep {ret i8 17}
-; rdar://5707076
-target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
-target triple = "i386-apple-darwin9.1.0"
- %struct.T = type <{ i8, [3 x i8] }>
-
-define i8 @f() {
-entry:
- %s = alloca [1 x %struct.T], align 4 ; <[1 x %struct.T]*> [#uses=2]
- %T3 = bitcast [1 x %struct.T]* %s to i32*
- store i32 -61184, i32* %T3
-
- %tmp16 = getelementptr [1 x %struct.T]* %s, i32 0, i32 0 ; <%struct.T*> [#uses=1]
- %tmp17 = getelementptr %struct.T* %tmp16, i32 0, i32 1 ; <[3 x i8]*> [#uses=1]
- %tmp1718 = bitcast [3 x i8]* %tmp17 to i32* ; <i32*> [#uses=1]
- %tmp19 = load i32* %tmp1718, align 4 ; <i32> [#uses=1]
- %mask = and i32 %tmp19, 16777215 ; <i32> [#uses=2]
- %mask2324 = trunc i32 %mask to i8 ; <i8> [#uses=1]
- ret i8 %mask2324
-}
-
diff --git a/release_23/test/Transforms/ScalarRepl/2008-02-28-SubElementExtractCrash.ll b/release_23/test/Transforms/ScalarRepl/2008-02-28-SubElementExtractCrash.ll
deleted file mode 100644
index 9ec5fa381221..000000000000
--- a/release_23/test/Transforms/ScalarRepl/2008-02-28-SubElementExtractCrash.ll
+++ /dev/null
@@ -1,16 +0,0 @@
-; RUN: llvm-as < %s | opt -scalarrepl | llvm-dis | not grep alloca
-target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
-target triple = "i686-apple-darwin8"
- %struct..0anon = type { <1 x i64> }
-
-define i32 @main(i32 %argc, i8** %argv) {
-entry:
- %c = alloca %struct..0anon ; <%struct..0anon*> [#uses=2]
- %tmp2 = getelementptr %struct..0anon* %c, i32 0, i32 0 ; <<1 x i64>*> [#uses=1]
- store <1 x i64> zeroinitializer, <1 x i64>* %tmp2, align 8
- %tmp7 = getelementptr %struct..0anon* %c, i32 0, i32 0 ; <<1 x i64>*> [#uses=1]
- %tmp78 = bitcast <1 x i64>* %tmp7 to [2 x i32]* ; <[2 x i32]*> [#uses=1]
- %tmp9 = getelementptr [2 x i32]* %tmp78, i32 0, i32 0 ; <i32*> [#uses=1]
- %tmp10 = load i32* %tmp9, align 4 ; <i32> [#uses=0]
- unreachable
-}
diff --git a/release_23/test/Transforms/ScalarRepl/AggregatePromote.ll b/release_23/test/Transforms/ScalarRepl/AggregatePromote.ll
deleted file mode 100644
index 104a0f989760..000000000000
--- a/release_23/test/Transforms/ScalarRepl/AggregatePromote.ll
+++ /dev/null
@@ -1,51 +0,0 @@
-; RUN: llvm-as < %s | opt -scalarrepl | llvm-dis | \
-; RUN: not grep alloca
-
-target datalayout = "E-p:32:32"
-target triple = "powerpc-apple-darwin8.0.0"
-
-define i64 @test1(i64 %X) {
- %A = alloca i64 ; <i64*> [#uses=3]
- store i64 %X, i64* %A
- %B = bitcast i64* %A to i32* ; <i32*> [#uses=1]
- %C = bitcast i32* %B to i8* ; <i8*> [#uses=1]
- store i8 0, i8* %C
- %Y = load i64* %A ; <i64> [#uses=1]
- ret i64 %Y
-}
-
-define i8 @test2(i64 %X) {
- %X_addr = alloca i64 ; <i64*> [#uses=2]
- store i64 %X, i64* %X_addr
- %tmp.0 = bitcast i64* %X_addr to i32* ; <i32*> [#uses=1]
- %tmp.1 = getelementptr i32* %tmp.0, i32 1 ; <i32*> [#uses=1]
- %tmp.2 = bitcast i32* %tmp.1 to i8* ; <i8*> [#uses=1]
- %tmp.3 = getelementptr i8* %tmp.2, i32 3 ; <i8*> [#uses=1]
- %tmp.2.upgrd.1 = load i8* %tmp.3 ; <i8> [#uses=1]
- ret i8 %tmp.2.upgrd.1
-}
-
-define i16 @crafty(i64 %X) {
- %a = alloca { i64 } ; <{ i64 }*> [#uses=2]
- %tmp.0 = getelementptr { i64 }* %a, i32 0, i32 0 ; <i64*> [#uses=1]
- store i64 %X, i64* %tmp.0
- %tmp.3 = bitcast { i64 }* %a to [4 x i16]* ; <[4 x i16]*> [#uses=2]
- %tmp.4 = getelementptr [4 x i16]* %tmp.3, i32 0, i32 3 ; <i16*> [#uses=1]
- %tmp.5 = load i16* %tmp.4 ; <i16> [#uses=1]
- %tmp.8 = getelementptr [4 x i16]* %tmp.3, i32 0, i32 2 ; <i16*> [#uses=1]
- %tmp.9 = load i16* %tmp.8 ; <i16> [#uses=1]
- %tmp.10 = or i16 %tmp.9, %tmp.5 ; <i16> [#uses=1]
- ret i16 %tmp.10
-}
-
-define i16 @crafty2(i64 %X) {
- %a = alloca i64 ; <i64*> [#uses=2]
- store i64 %X, i64* %a
- %tmp.3 = bitcast i64* %a to [4 x i16]* ; <[4 x i16]*> [#uses=2]
- %tmp.4 = getelementptr [4 x i16]* %tmp.3, i32 0, i32 3 ; <i16*> [#uses=1]
- %tmp.5 = load i16* %tmp.4 ; <i16> [#uses=1]
- %tmp.8 = getelementptr [4 x i16]* %tmp.3, i32 0, i32 2 ; <i16*> [#uses=1]
- %tmp.9 = load i16* %tmp.8 ; <i16> [#uses=1]
- %tmp.10 = or i16 %tmp.9, %tmp.5 ; <i16> [#uses=1]
- ret i16 %tmp.10
-}
diff --git a/release_23/test/Transforms/ScalarRepl/DifferingTypes.ll b/release_23/test/Transforms/ScalarRepl/DifferingTypes.ll
deleted file mode 100644
index c0604142df89..000000000000
--- a/release_23/test/Transforms/ScalarRepl/DifferingTypes.ll
+++ /dev/null
@@ -1,15 +0,0 @@
-; This is a feature test. Hopefully one day this will be implemented. The
-; generated code should perform the appropriate masking operations required
-; depending on the endianness of the target...
-; RUN: llvm-as < %s | opt -scalarrepl | llvm-dis | \
-; RUN: not grep alloca
-
-define i32 @testfunc(i32 %i, i8 %j) {
- %I = alloca i32 ; <i32*> [#uses=3]
- store i32 %i, i32* %I
- %P = bitcast i32* %I to i8* ; <i8*> [#uses=1]
- store i8 %j, i8* %P
- %t = load i32* %I ; <i32> [#uses=1]
- ret i32 %t
-}
-
diff --git a/release_23/test/Transforms/ScalarRepl/arraytest.ll b/release_23/test/Transforms/ScalarRepl/arraytest.ll
deleted file mode 100644
index 911a8e38c087..000000000000
--- a/release_23/test/Transforms/ScalarRepl/arraytest.ll
+++ /dev/null
@@ -1,10 +0,0 @@
-; RUN: llvm-as < %s | opt -scalarrepl -mem2reg | llvm-dis | not grep alloca
-
-define i32 @test() {
- %X = alloca [4 x i32] ; <[4 x i32]*> [#uses=1]
- %Y = getelementptr [4 x i32]* %X, i64 0, i64 0 ; <i32*> [#uses=2]
- store i32 0, i32* %Y
- %Z = load i32* %Y ; <i32> [#uses=1]
- ret i32 %Z
-}
-
diff --git a/release_23/test/Transforms/ScalarRepl/badarray.ll b/release_23/test/Transforms/ScalarRepl/badarray.ll
deleted file mode 100644
index 1e4714eae988..000000000000
--- a/release_23/test/Transforms/ScalarRepl/badarray.ll
+++ /dev/null
@@ -1,11 +0,0 @@
-; RUN: llvm-as < %s | opt -scalarrepl -mem2reg | llvm-dis | grep alloca
-
-define i32 @test() {
- %X = alloca [4 x i32] ; <[4 x i32]*> [#uses=1]
- ; Off end of array!
- %Y = getelementptr [4 x i32]* %X, i64 0, i64 6 ; <i32*> [#uses=2]
- store i32 0, i32* %Y
- %Z = load i32* %Y ; <i32> [#uses=1]
- ret i32 %Z
-}
-
diff --git a/release_23/test/Transforms/ScalarRepl/basictest.ll b/release_23/test/Transforms/ScalarRepl/basictest.ll
deleted file mode 100644
index 11a1d51a9676..000000000000
--- a/release_23/test/Transforms/ScalarRepl/basictest.ll
+++ /dev/null
@@ -1,10 +0,0 @@
-; RUN: llvm-as < %s | opt -scalarrepl -mem2reg | llvm-dis | not grep alloca
-
-define i32 @test() {
- %X = alloca { i32, float } ; <{ i32, float }*> [#uses=1]
- %Y = getelementptr { i32, float }* %X, i64 0, i32 0 ; <i32*> [#uses=2]
- store i32 0, i32* %Y
- %Z = load i32* %Y ; <i32> [#uses=1]
- ret i32 %Z
-}
-
diff --git a/release_23/test/Transforms/ScalarRepl/dg.exp b/release_23/test/Transforms/ScalarRepl/dg.exp
deleted file mode 100644
index 879685ca879d..000000000000
--- a/release_23/test/Transforms/ScalarRepl/dg.exp
+++ /dev/null
@@ -1,3 +0,0 @@
-load_lib llvm.exp
-
-RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
diff --git a/release_23/test/Transforms/ScalarRepl/memcpy-from-global.ll b/release_23/test/Transforms/ScalarRepl/memcpy-from-global.ll
deleted file mode 100644
index ee77e1fdeb7e..000000000000
--- a/release_23/test/Transforms/ScalarRepl/memcpy-from-global.ll
+++ /dev/null
@@ -1,33 +0,0 @@
-; RUN: llvm-as < %s | opt -scalarrepl | llvm-dis | not grep {call.*memcpy}
-@C.0.1248 = internal constant [128 x float] [ float -1.000000e+00, float -1.000000e+00, float -1.000000e+00, float 0.000000e+00, float -1.000000e+00, float -1.000000e+00, float 0.000000e+00, float -1.000000e+00, float -1.000000e+00, float -1.000000e+00, float 0.000000e+00, float 1.000000e+00, float -1.000000e+00, float -1.000000e+00, float 1.000000e+00, float 0.000000e+00, float -1.000000e+00, float 0.000000e+00, float -1.000000e+00, float -1.000000e+00, float -1.000000e+00, float 0.000000e+00, float -1.000000e+00, float 1.000000e+00, float -1.000000e+00, float 0.000000e+00, float 1.000000e+00, float -1.000000e+00, float -1.000000e+00, float 0.000000e+00, float 1.000000e+00, float 1.000000e+00, float -1.000000e+00, float 1.000000e+00, float -1.000000e+00, float 0.000000e+00, float -1.000000e+00, float 1.000000e+00, float 0.000000e+00, float -1.000000e+00, float -1.000000e+00, float 1.000000e+00, float 0.000000e+00, float 1.000000e+00, float -1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 0.000000e+00, float 0.000000e+00, float -1.000000e+00, float -1.000000e+00, float -1.000000e+00, float 0.000000e+00, float -1.000000e+00, float -1.000000e+00, float 1.000000e+00, float 0.000000e+00, float -1.000000e+00, float 1.000000e+00, float -1.000000e+00, float 0.000000e+00, float -1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float -1.000000e+00, float -1.000000e+00, float 0.000000e+00, float 1.000000e+00, float -1.000000e+00, float 0.000000e+00, float -1.000000e+00, float 1.000000e+00, float -1.000000e+00, float 0.000000e+00, float 1.000000e+00, float 1.000000e+00, float -1.000000e+00, float 1.000000e+00, float 0.000000e+00, float 1.000000e+00, float 0.000000e+00, float -1.000000e+00, float -1.000000e+00, float 1.000000e+00, float 0.000000e+00, float -1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 0.000000e+00, float 1.000000e+00, float -1.000000e+00, float 1.000000e+00, float 0.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float -1.000000e+00, float 0.000000e+00, float 1.000000e+00, float 1.000000e+00, float 0.000000e+00, float -1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 0.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 0.000000e+00, float 0.000000e+00, float 1.000000e+00, float -1.000000e+00, float -1.000000e+00, float 0.000000e+00, float 1.000000e+00, float -1.000000e+00, float 1.000000e+00, float 0.000000e+00, float 1.000000e+00, float 1.000000e+00, float -1.000000e+00, float 0.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00 ], align 32 ; <[128 x float]*> [#uses=1]
-
-define float @grad4(i32 %hash, float %x, float %y, float %z, float %w) {
-entry:
- %lookupTable = alloca [128 x float], align 16 ; <[128 x float]*> [#uses=5]
- %lookupTable1 = bitcast [128 x float]* %lookupTable to i8* ; <i8*> [#uses=1]
- call void @llvm.memcpy.i32( i8* %lookupTable1, i8* bitcast ([128 x float]* @C.0.1248 to i8*), i32 512, i32 16 )
- %tmp3 = shl i32 %hash, 2 ; <i32> [#uses=1]
- %tmp5 = and i32 %tmp3, 124 ; <i32> [#uses=4]
- %tmp753 = getelementptr [128 x float]* %lookupTable, i32 0, i32 %tmp5 ; <float*> [#uses=1]
- %tmp9 = load float* %tmp753 ; <float> [#uses=1]
- %tmp11 = mul float %tmp9, %x ; <float> [#uses=1]
- %tmp13 = add float %tmp11, 0.000000e+00 ; <float> [#uses=1]
- %tmp17.sum52 = or i32 %tmp5, 1 ; <i32> [#uses=1]
- %tmp1851 = getelementptr [128 x float]* %lookupTable, i32 0, i32 %tmp17.sum52 ; <float*> [#uses=1]
- %tmp19 = load float* %tmp1851 ; <float> [#uses=1]
- %tmp21 = mul float %tmp19, %y ; <float> [#uses=1]
- %tmp23 = add float %tmp21, %tmp13 ; <float> [#uses=1]
- %tmp27.sum50 = or i32 %tmp5, 2 ; <i32> [#uses=1]
- %tmp2849 = getelementptr [128 x float]* %lookupTable, i32 0, i32 %tmp27.sum50 ; <float*> [#uses=1]
- %tmp29 = load float* %tmp2849 ; <float> [#uses=1]
- %tmp31 = mul float %tmp29, %z ; <float> [#uses=1]
- %tmp33 = add float %tmp31, %tmp23 ; <float> [#uses=1]
- %tmp37.sum48 = or i32 %tmp5, 3 ; <i32> [#uses=1]
- %tmp3847 = getelementptr [128 x float]* %lookupTable, i32 0, i32 %tmp37.sum48 ; <float*> [#uses=1]
- %tmp39 = load float* %tmp3847 ; <float> [#uses=1]
- %tmp41 = mul float %tmp39, %w ; <float> [#uses=1]
- %tmp43 = add float %tmp41, %tmp33 ; <float> [#uses=1]
- ret float %tmp43
-}
-
-declare void @llvm.memcpy.i32(i8*, i8*, i32, i32)
diff --git a/release_23/test/Transforms/ScalarRepl/memset-aggregate-byte-leader.ll b/release_23/test/Transforms/ScalarRepl/memset-aggregate-byte-leader.ll
deleted file mode 100644
index 91d8ea900717..000000000000
--- a/release_23/test/Transforms/ScalarRepl/memset-aggregate-byte-leader.ll
+++ /dev/null
@@ -1,23 +0,0 @@
-; PR1226
-; RUN: llvm-as < %s | opt -scalarrepl | llvm-dis | \
-; RUN: not grep {call void @llvm.memcpy.i32}
-; RUN: llvm-as < %s | opt -scalarrepl | llvm-dis | grep getelementptr
-; END.
-
-target datalayout = "E-p:32:32"
-target triple = "powerpc-apple-darwin8.8.0"
- %struct.foo = type { i8, i8 }
-
-
-define i32 @test1(%struct.foo* %P) {
-entry:
- %L = alloca %struct.foo, align 2 ; <%struct.foo*> [#uses=1]
- %L2 = getelementptr %struct.foo* %L, i32 0, i32 0 ; <i8*> [#uses=2]
- %tmp13 = getelementptr %struct.foo* %P, i32 0, i32 0 ; <i8*> [#uses=1]
- call void @llvm.memcpy.i32( i8* %L2, i8* %tmp13, i32 2, i32 1 )
- %tmp5 = load i8* %L2 ; <i8> [#uses=1]
- %tmp56 = sext i8 %tmp5 to i32 ; <i32> [#uses=1]
- ret i32 %tmp56
-}
-
-declare void @llvm.memcpy.i32(i8*, i8*, i32, i32)
diff --git a/release_23/test/Transforms/ScalarRepl/memset-aggregate.ll b/release_23/test/Transforms/ScalarRepl/memset-aggregate.ll
deleted file mode 100644
index 4febda5b9a79..000000000000
--- a/release_23/test/Transforms/ScalarRepl/memset-aggregate.ll
+++ /dev/null
@@ -1,48 +0,0 @@
-; PR1226
-; RUN: llvm-as < %s | opt -scalarrepl | llvm-dis | grep {ret i32 16843009}
-; RUN: llvm-as < %s | opt -scalarrepl | llvm-dis | not grep alloca
-
-target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64"
-target triple = "i686-apple-darwin8"
- %struct.bar = type { %struct.foo, i64, double }
- %struct.foo = type { i32, i32 }
-
-
-define i32 @test1(%struct.foo* %P) {
-entry:
- %L = alloca %struct.foo, align 8 ; <%struct.foo*> [#uses=2]
- %L2 = bitcast %struct.foo* %L to i8* ; <i8*> [#uses=1]
- %tmp13 = bitcast %struct.foo* %P to i8* ; <i8*> [#uses=1]
- call void @llvm.memcpy.i32( i8* %L2, i8* %tmp13, i32 8, i32 4 )
- %tmp4 = getelementptr %struct.foo* %L, i32 0, i32 0 ; <i32*> [#uses=1]
- %tmp5 = load i32* %tmp4 ; <i32> [#uses=1]
- ret i32 %tmp5
-}
-
-declare void @llvm.memcpy.i32(i8*, i8*, i32, i32)
-
-define i32 @test2() {
-entry:
- %L = alloca [4 x %struct.foo], align 16 ; <[4 x %struct.foo]*> [#uses=2]
- %L12 = bitcast [4 x %struct.foo]* %L to i8* ; <i8*> [#uses=1]
- call void @llvm.memset.i32( i8* %L12, i8 0, i32 32, i32 16 )
- %tmp4 = getelementptr [4 x %struct.foo]* %L, i32 0, i32 0, i32 0 ; <i32*> [#uses=1]
- %tmp5 = load i32* %tmp4 ; <i32> [#uses=1]
- ret i32 %tmp5
-}
-
-declare void @llvm.memset.i32(i8*, i8, i32, i32)
-
-define i32 @test3() {
-entry:
- %B = alloca %struct.bar, align 16 ; <%struct.bar*> [#uses=4]
- %B1 = bitcast %struct.bar* %B to i8* ; <i8*> [#uses=1]
- call void @llvm.memset.i32( i8* %B1, i8 1, i32 24, i32 16 )
- %tmp3 = getelementptr %struct.bar* %B, i32 0, i32 0, i32 0 ; <i32*> [#uses=1]
- store i32 1, i32* %tmp3
- %tmp4 = getelementptr %struct.bar* %B, i32 0, i32 2 ; <double*> [#uses=1]
- store double 1.000000e+01, double* %tmp4
- %tmp6 = getelementptr %struct.bar* %B, i32 0, i32 0, i32 1 ; <i32*> [#uses=1]
- %tmp7 = load i32* %tmp6 ; <i32> [#uses=1]
- ret i32 %tmp7
-}
diff --git a/release_23/test/Transforms/ScalarRepl/phinodepromote.ll b/release_23/test/Transforms/ScalarRepl/phinodepromote.ll
deleted file mode 100644
index 4eb8743bd1cf..000000000000
--- a/release_23/test/Transforms/ScalarRepl/phinodepromote.ll
+++ /dev/null
@@ -1,34 +0,0 @@
-; RUN: llvm-as < %s | opt -simplifycfg -instcombine -mem2reg | llvm-dis | not grep alloca
-;
-; This tests to see if mem2reg can promote alloca instructions whose addresses
-; are used by PHI nodes that are immediately loaded. The LLVM C++ front-end
-; often generates code that looks like this (when it codegen's ?: exprs as
-; lvalues), so handling this simple extension is quite useful.
-;
-; This testcase is what the following program looks like when it reaches
-; instcombine:
-;
-; template<typename T>
-; const T& max(const T& a1, const T& a2) { return a1 < a2 ? a1 : a2; }
-; int main() { return max(0, 1); }
-;
-; This test checks to make sure the combination of instcombine and mem2reg
-; perform the transformation.
-
-define i32 @main() {
-entry:
- %mem_tmp.0 = alloca i32 ; <i32*> [#uses=3]
- %mem_tmp.1 = alloca i32 ; <i32*> [#uses=3]
- store i32 0, i32* %mem_tmp.0
- store i32 1, i32* %mem_tmp.1
- %tmp.1.i = load i32* %mem_tmp.1 ; <i32> [#uses=1]
- %tmp.3.i = load i32* %mem_tmp.0 ; <i32> [#uses=1]
- %tmp.4.i = icmp sle i32 %tmp.1.i, %tmp.3.i ; <i1> [#uses=1]
- br i1 %tmp.4.i, label %cond_true.i, label %cond_continue.i
-cond_true.i: ; preds = %entry
- br label %cond_continue.i
-cond_continue.i: ; preds = %cond_true.i, %entry
- %mem_tmp.i.0 = phi i32* [ %mem_tmp.1, %cond_true.i ], [ %mem_tmp.0, %entry ] ; <i32*> [#uses=1]
- %tmp.3 = load i32* %mem_tmp.i.0 ; <i32> [#uses=1]
- ret i32 %tmp.3
-}
diff --git a/release_23/test/Transforms/ScalarRepl/select_promote.ll b/release_23/test/Transforms/ScalarRepl/select_promote.ll
deleted file mode 100644
index 901fa90dc96d..000000000000
--- a/release_23/test/Transforms/ScalarRepl/select_promote.ll
+++ /dev/null
@@ -1,18 +0,0 @@
-; Test promotion of loads that use the result of a select instruction. This
-; should be simplified by the instcombine pass.
-
-; RUN: llvm-as < %s | opt -instcombine -mem2reg | llvm-dis | not grep alloca
-
-define i32 @main() {
- %mem_tmp.0 = alloca i32 ; <i32*> [#uses=3]
- %mem_tmp.1 = alloca i32 ; <i32*> [#uses=3]
- store i32 0, i32* %mem_tmp.0
- store i32 1, i32* %mem_tmp.1
- %tmp.1.i = load i32* %mem_tmp.1 ; <i32> [#uses=1]
- %tmp.3.i = load i32* %mem_tmp.0 ; <i32> [#uses=1]
- %tmp.4.i = icmp sle i32 %tmp.1.i, %tmp.3.i ; <i1> [#uses=1]
- %mem_tmp.i.0 = select i1 %tmp.4.i, i32* %mem_tmp.1, i32* %mem_tmp.0 ; <i32*> [#uses=1]
- %tmp.3 = load i32* %mem_tmp.i.0 ; <i32> [#uses=1]
- ret i32 %tmp.3
-}
-
diff --git a/release_23/test/Transforms/ScalarRepl/sroa_two.ll b/release_23/test/Transforms/ScalarRepl/sroa_two.ll
deleted file mode 100644
index e0ea2bc93fec..000000000000
--- a/release_23/test/Transforms/ScalarRepl/sroa_two.ll
+++ /dev/null
@@ -1,13 +0,0 @@
-; RUN: llvm-as < %s | opt -scalarrepl | llvm-dis
-
-define i32 @test(i32 %X) {
- %Arr = alloca [2 x i32] ; <[2 x i32]*> [#uses=3]
- %tmp.0 = getelementptr [2 x i32]* %Arr, i32 0, i32 0 ; <i32*> [#uses=1]
- store i32 1, i32* %tmp.0
- %tmp.1 = getelementptr [2 x i32]* %Arr, i32 0, i32 1 ; <i32*> [#uses=1]
- store i32 2, i32* %tmp.1
- %tmp.3 = getelementptr [2 x i32]* %Arr, i32 0, i32 %X ; <i32*> [#uses=1]
- %tmp.4 = load i32* %tmp.3 ; <i32> [#uses=1]
- ret i32 %tmp.4
-}
-
diff --git a/release_23/test/Transforms/ScalarRepl/union-fp-int.ll b/release_23/test/Transforms/ScalarRepl/union-fp-int.ll
deleted file mode 100644
index 1c3b18b4a1e1..000000000000
--- a/release_23/test/Transforms/ScalarRepl/union-fp-int.ll
+++ /dev/null
@@ -1,13 +0,0 @@
-; RUN: llvm-as < %s | opt -scalarrepl | llvm-dis | \
-; RUN: not grep alloca
-; RUN: llvm-as < %s | opt -scalarrepl | llvm-dis | \
-; RUN: grep {bitcast.*float.*i32}
-
-define i32 @test(float %X) {
- %X_addr = alloca float ; <float*> [#uses=2]
- store float %X, float* %X_addr
- %X_addr.upgrd.1 = bitcast float* %X_addr to i32* ; <i32*> [#uses=1]
- %tmp = load i32* %X_addr.upgrd.1 ; <i32> [#uses=1]
- ret i32 %tmp
-}
-
diff --git a/release_23/test/Transforms/ScalarRepl/union-packed.ll b/release_23/test/Transforms/ScalarRepl/union-packed.ll
deleted file mode 100644
index 10d8a5d7ac4b..000000000000
--- a/release_23/test/Transforms/ScalarRepl/union-packed.ll
+++ /dev/null
@@ -1,13 +0,0 @@
-; RUN: llvm-as < %s | opt -scalarrepl | llvm-dis | \
-; RUN: not grep alloca
-; RUN: llvm-as < %s | opt -scalarrepl | llvm-dis | \
-; RUN: grep bitcast
-
-define <4 x i32> @test(<4 x float> %X) {
- %X_addr = alloca <4 x float> ; <<4 x float>*> [#uses=2]
- store <4 x float> %X, <4 x float>* %X_addr
- %X_addr.upgrd.1 = bitcast <4 x float>* %X_addr to <4 x i32>* ; <<4 x i32>*> [#uses=1]
- %tmp = load <4 x i32>* %X_addr.upgrd.1 ; <<4 x i32>> [#uses=1]
- ret <4 x i32> %tmp
-}
-
diff --git a/release_23/test/Transforms/ScalarRepl/union-pointer.ll b/release_23/test/Transforms/ScalarRepl/union-pointer.ll
deleted file mode 100644
index 269b4b9ff52e..000000000000
--- a/release_23/test/Transforms/ScalarRepl/union-pointer.ll
+++ /dev/null
@@ -1,41 +0,0 @@
-; PR892
-; RUN: llvm-as < %s | opt -scalarrepl | llvm-dis | \
-; RUN: not grep alloca
-; RUN: llvm-as < %s | opt -scalarrepl | llvm-dis | grep {ret i8}
-
-target datalayout = "e-p:32:32"
-target triple = "i686-apple-darwin8.7.2"
- %struct.Val = type { i32*, i32 }
-
-define i8* @test(i16* %X) {
- %X_addr = alloca i16* ; <i16**> [#uses=2]
- store i16* %X, i16** %X_addr
- %X_addr.upgrd.1 = bitcast i16** %X_addr to i8** ; <i8**> [#uses=1]
- %tmp = load i8** %X_addr.upgrd.1 ; <i8*> [#uses=1]
- ret i8* %tmp
-}
-
-define void @test2(i64 %Op.0) {
- %tmp = alloca %struct.Val, align 8 ; <%struct.Val*> [#uses=3]
- %tmp1 = alloca %struct.Val, align 8 ; <%struct.Val*> [#uses=3]
- %tmp.upgrd.2 = call i64 @_Z3foov( ) ; <i64> [#uses=1]
- %tmp1.upgrd.3 = bitcast %struct.Val* %tmp1 to i64* ; <i64*> [#uses=1]
- store i64 %tmp.upgrd.2, i64* %tmp1.upgrd.3
- %tmp.upgrd.4 = getelementptr %struct.Val* %tmp, i32 0, i32 0 ; <i32**> [#uses=1]
- %tmp2 = getelementptr %struct.Val* %tmp1, i32 0, i32 0 ; <i32**> [#uses=1]
- %tmp.upgrd.5 = load i32** %tmp2 ; <i32*> [#uses=1]
- store i32* %tmp.upgrd.5, i32** %tmp.upgrd.4
- %tmp3 = getelementptr %struct.Val* %tmp, i32 0, i32 1 ; <i32*> [#uses=1]
- %tmp4 = getelementptr %struct.Val* %tmp1, i32 0, i32 1 ; <i32*> [#uses=1]
- %tmp.upgrd.6 = load i32* %tmp4 ; <i32> [#uses=1]
- store i32 %tmp.upgrd.6, i32* %tmp3
- %tmp7 = bitcast %struct.Val* %tmp to { i64 }* ; <{ i64 }*> [#uses=1]
- %tmp8 = getelementptr { i64 }* %tmp7, i32 0, i32 0 ; <i64*> [#uses=1]
- %tmp9 = load i64* %tmp8 ; <i64> [#uses=1]
- call void @_Z3bar3ValS_( i64 %Op.0, i64 %tmp9 )
- ret void
-}
-
-declare i64 @_Z3foov()
-
-declare void @_Z3bar3ValS_(i64, i64)
diff --git a/release_23/test/Transforms/ScalarRepl/vector_promote.ll b/release_23/test/Transforms/ScalarRepl/vector_promote.ll
deleted file mode 100644
index ec22f6464b45..000000000000
--- a/release_23/test/Transforms/ScalarRepl/vector_promote.ll
+++ /dev/null
@@ -1,55 +0,0 @@
-; RUN: llvm-as < %s | opt -scalarrepl | llvm-dis | \
-; RUN: not grep alloca
-; END.
-
-define void @test(<4 x float>* %F, float %f) {
-entry:
- %G = alloca <4 x float>, align 16 ; <<4 x float>*> [#uses=3]
- %tmp = load <4 x float>* %F ; <<4 x float>> [#uses=2]
- %tmp3 = add <4 x float> %tmp, %tmp ; <<4 x float>> [#uses=1]
- store <4 x float> %tmp3, <4 x float>* %G
- %G.upgrd.1 = getelementptr <4 x float>* %G, i32 0, i32 0 ; <float*> [#uses=1]
- store float %f, float* %G.upgrd.1
- %tmp4 = load <4 x float>* %G ; <<4 x float>> [#uses=2]
- %tmp6 = add <4 x float> %tmp4, %tmp4 ; <<4 x float>> [#uses=1]
- store <4 x float> %tmp6, <4 x float>* %F
- ret void
-}
-
-define void @test2(<4 x float>* %F, float %f) {
-entry:
- %G = alloca <4 x float>, align 16 ; <<4 x float>*> [#uses=3]
- %tmp = load <4 x float>* %F ; <<4 x float>> [#uses=2]
- %tmp3 = add <4 x float> %tmp, %tmp ; <<4 x float>> [#uses=1]
- store <4 x float> %tmp3, <4 x float>* %G
- %tmp.upgrd.2 = getelementptr <4 x float>* %G, i32 0, i32 2 ; <float*> [#uses=1]
- store float %f, float* %tmp.upgrd.2
- %tmp4 = load <4 x float>* %G ; <<4 x float>> [#uses=2]
- %tmp6 = add <4 x float> %tmp4, %tmp4 ; <<4 x float>> [#uses=1]
- store <4 x float> %tmp6, <4 x float>* %F
- ret void
-}
-
-define void @test3(<4 x float>* %F, float* %f) {
-entry:
- %G = alloca <4 x float>, align 16 ; <<4 x float>*> [#uses=2]
- %tmp = load <4 x float>* %F ; <<4 x float>> [#uses=2]
- %tmp3 = add <4 x float> %tmp, %tmp ; <<4 x float>> [#uses=1]
- store <4 x float> %tmp3, <4 x float>* %G
- %tmp.upgrd.3 = getelementptr <4 x float>* %G, i32 0, i32 2 ; <float*> [#uses=1]
- %tmp.upgrd.4 = load float* %tmp.upgrd.3 ; <float> [#uses=1]
- store float %tmp.upgrd.4, float* %f
- ret void
-}
-
-define void @test4(<4 x float>* %F, float* %f) {
-entry:
- %G = alloca <4 x float>, align 16 ; <<4 x float>*> [#uses=2]
- %tmp = load <4 x float>* %F ; <<4 x float>> [#uses=2]
- %tmp3 = add <4 x float> %tmp, %tmp ; <<4 x float>> [#uses=1]
- store <4 x float> %tmp3, <4 x float>* %G
- %G.upgrd.5 = getelementptr <4 x float>* %G, i32 0, i32 0 ; <float*> [#uses=1]
- %tmp.upgrd.6 = load float* %G.upgrd.5 ; <float> [#uses=1]
- store float %tmp.upgrd.6, float* %f
- ret void
-}
diff --git a/release_23/test/Transforms/SimplifyCFG/2002-05-05-EmptyBlockMerge.ll b/release_23/test/Transforms/SimplifyCFG/2002-05-05-EmptyBlockMerge.ll
deleted file mode 100644
index 5682ff4e40df..000000000000
--- a/release_23/test/Transforms/SimplifyCFG/2002-05-05-EmptyBlockMerge.ll
+++ /dev/null
@@ -1,22 +0,0 @@
-; Basic block #2 should not be merged into BB #3!
-;
-; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis | \
-; RUN: grep {br label}
-;
-
-declare void @foo()
-
-define void @cprop_test12(i32* %data) {
-bb0:
- %reg108 = load i32* %data ; <i32> [#uses=2]
- %cond218 = icmp ne i32 %reg108, 5 ; <i1> [#uses=1]
- br i1 %cond218, label %bb3, label %bb2
-bb2: ; preds = %bb0
- call void @foo( )
- br label %bb3
-bb3: ; preds = %bb2, %bb0
- %reg117 = phi i32 [ 110, %bb2 ], [ %reg108, %bb0 ] ; <i32> [#uses=1]
- store i32 %reg117, i32* %data
- ret void
-}
-
diff --git a/release_23/test/Transforms/SimplifyCFG/2002-05-21-PHIElimination.ll b/release_23/test/Transforms/SimplifyCFG/2002-05-21-PHIElimination.ll
deleted file mode 100644
index c955d668898f..000000000000
--- a/release_23/test/Transforms/SimplifyCFG/2002-05-21-PHIElimination.ll
+++ /dev/null
@@ -1,19 +0,0 @@
-; CFG Simplification is making a loop dead, then changing the add into:
-;
-; %V1 = add int %V1, 1
-;
-; Which is not valid SSA
-;
-; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis
-
-define void @test() {
-; <label>:0
- br i1 true, label %end, label %Loop
-Loop: ; preds = %Loop, %0
- %V = phi i32 [ 0, %0 ], [ %V1, %Loop ] ; <i32> [#uses=1]
- %V1 = add i32 %V, 1 ; <i32> [#uses=1]
- br label %Loop
-end: ; preds = %0
- ret void
-}
-
diff --git a/release_23/test/Transforms/SimplifyCFG/2002-06-24-PHINode.ll b/release_23/test/Transforms/SimplifyCFG/2002-06-24-PHINode.ll
deleted file mode 100644
index 87b428600ba5..000000000000
--- a/release_23/test/Transforms/SimplifyCFG/2002-06-24-PHINode.ll
+++ /dev/null
@@ -1,14 +0,0 @@
-; -simplifycfg is not folding blocks if there is a PHI node involved. This
-; should be fixed eventually
-
-; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis | not grep br
-
-define i32 @main(i32 %argc) {
-; <label>:0
- br label %InlinedFunctionReturnNode
-InlinedFunctionReturnNode: ; preds = %0
- %X = phi i32 [ 7, %0 ] ; <i32> [#uses=1]
- %Y = add i32 %X, %argc ; <i32> [#uses=1]
- ret i32 %Y
-}
-
diff --git a/release_23/test/Transforms/SimplifyCFG/2002-09-24-PHIAssertion.ll b/release_23/test/Transforms/SimplifyCFG/2002-09-24-PHIAssertion.ll
deleted file mode 100644
index 75beb344a883..000000000000
--- a/release_23/test/Transforms/SimplifyCFG/2002-09-24-PHIAssertion.ll
+++ /dev/null
@@ -1,13 +0,0 @@
-; RUN: llvm-as < %s | opt -simplifycfg
-
-define i32 @test(i32 %A, i32 %B, i1 %cond) {
-J:
- %C = add i32 %A, 12 ; <i32> [#uses=3]
- br i1 %cond, label %L, label %L
-L: ; preds = %J, %J
- %Q = phi i32 [ %C, %J ], [ %C, %J ] ; <i32> [#uses=1]
- %D = add i32 %C, %B ; <i32> [#uses=1]
- %E = add i32 %Q, %D ; <i32> [#uses=1]
- ret i32 %E
-}
-
diff --git a/release_23/test/Transforms/SimplifyCFG/2003-03-07-DominateProblem.ll b/release_23/test/Transforms/SimplifyCFG/2003-03-07-DominateProblem.ll
deleted file mode 100644
index c45a5c9da98c..000000000000
--- a/release_23/test/Transforms/SimplifyCFG/2003-03-07-DominateProblem.ll
+++ /dev/null
@@ -1,17 +0,0 @@
-; RUN: llvm-as < %s | opt -simplifycfg -disable-output
-
-define void @test(i32* %ldo, i1 %c, i1 %d) {
-bb9:
- br i1 %c, label %bb11, label %bb10
-bb10: ; preds = %bb9
- br label %bb11
-bb11: ; preds = %bb10, %bb9
- %reg330 = phi i32* [ null, %bb10 ], [ %ldo, %bb9 ] ; <i32*> [#uses=1]
- br label %bb20
-bb20: ; preds = %bb20, %bb11
- store i32* %reg330, i32** null
- br i1 %d, label %bb20, label %done
-done: ; preds = %bb20
- ret void
-}
-
diff --git a/release_23/test/Transforms/SimplifyCFG/2003-08-05-InvokeCrash.ll b/release_23/test/Transforms/SimplifyCFG/2003-08-05-InvokeCrash.ll
deleted file mode 100644
index 74e7428429de..000000000000
--- a/release_23/test/Transforms/SimplifyCFG/2003-08-05-InvokeCrash.ll
+++ /dev/null
@@ -1,13 +0,0 @@
-; Do not remove the invoke!
-;
-; RUN: llvm-as < %s | opt -simplifycfg -disable-output
-
-define i32 @test() {
- %A = invoke i32 @test( )
- to label %Ret unwind label %Ret2 ; <i32> [#uses=1]
-Ret: ; preds = %0
- ret i32 %A
-Ret2: ; preds = %0
- ret i32 undef
-}
-
diff --git a/release_23/test/Transforms/SimplifyCFG/2003-08-05-MishandleInvoke.ll b/release_23/test/Transforms/SimplifyCFG/2003-08-05-MishandleInvoke.ll
deleted file mode 100644
index 9f56e07bfd62..000000000000
--- a/release_23/test/Transforms/SimplifyCFG/2003-08-05-MishandleInvoke.ll
+++ /dev/null
@@ -1,12 +0,0 @@
-; Do not remove the invoke!
-;
-; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis | grep invoke
-
-define i32 @test() {
- invoke i32 @test( )
- to label %Ret unwind label %Ret ; <i32>:1 [#uses=0]
-Ret: ; preds = %0, %0
- %A = add i32 0, 1 ; <i32> [#uses=1]
- ret i32 %A
-}
-
diff --git a/release_23/test/Transforms/SimplifyCFG/2003-08-17-BranchFold.ll b/release_23/test/Transforms/SimplifyCFG/2003-08-17-BranchFold.ll
deleted file mode 100644
index ea74692d05f7..000000000000
--- a/release_23/test/Transforms/SimplifyCFG/2003-08-17-BranchFold.ll
+++ /dev/null
@@ -1,22 +0,0 @@
-; This test checks to make sure that 'br X, Dest, Dest' is folded into
-; 'br Dest'
-
-; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis | \
-; RUN: not grep {br i1 %c2}
-
-declare void @noop()
-
-define i32 @test(i1 %c1, i1 %c2) {
- call void @noop( )
- br i1 %c1, label %A, label %Y
-A: ; preds = %0
- call void @noop( )
- br i1 %c2, label %X, label %X
-X: ; preds = %Y, %A, %A
- call void @noop( )
- ret i32 0
-Y: ; preds = %0
- call void @noop( )
- br label %X
-}
-
diff --git a/release_23/test/Transforms/SimplifyCFG/2003-08-17-BranchFoldOrdering.ll b/release_23/test/Transforms/SimplifyCFG/2003-08-17-BranchFoldOrdering.ll
deleted file mode 100644
index a307573d3d33..000000000000
--- a/release_23/test/Transforms/SimplifyCFG/2003-08-17-BranchFoldOrdering.ll
+++ /dev/null
@@ -1,26 +0,0 @@
-; This test checks to make sure that 'br X, Dest, Dest' is folded into
-; 'br Dest'. This can only happen after the 'Z' block is eliminated. This is
-; due to the fact that the SimplifyCFG function does not use
-; the ConstantFoldTerminator function.
-
-; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis | \
-; RUN: not grep {br i1 %c2}
-
-declare void @noop()
-
-define i32 @test(i1 %c1, i1 %c2) {
- call void @noop( )
- br i1 %c1, label %A, label %Y
-A: ; preds = %0
- call void @noop( )
- br i1 %c2, label %Z, label %X
-Z: ; preds = %A
- br label %X
-X: ; preds = %Y, %Z, %A
- call void @noop( )
- ret i32 0
-Y: ; preds = %0
- call void @noop( )
- br label %X
-}
-
diff --git a/release_23/test/Transforms/SimplifyCFG/2003-08-17-FoldSwitch.ll b/release_23/test/Transforms/SimplifyCFG/2003-08-17-FoldSwitch.ll
deleted file mode 100644
index cd22e1edb15a..000000000000
--- a/release_23/test/Transforms/SimplifyCFG/2003-08-17-FoldSwitch.ll
+++ /dev/null
@@ -1,80 +0,0 @@
-; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis | \
-; RUN: not grep switch
-
-; Test normal folding
-define i32 @test1() {
- switch i32 5, label %Default [
- i32 0, label %Foo
- i32 1, label %Bar
- i32 2, label %Baz
- i32 5, label %TheDest
- ]
-Default: ; preds = %0
- ret i32 -1
-Foo: ; preds = %0
- ret i32 -2
-Bar: ; preds = %0
- ret i32 -3
-Baz: ; preds = %0
- ret i32 -4
-TheDest: ; preds = %0
- ret i32 1234
-}
-
-; Test folding to default dest
-define i32 @test2() {
- switch i32 3, label %Default [
- i32 0, label %Foo
- i32 1, label %Bar
- i32 2, label %Baz
- i32 5, label %TheDest
- ]
-Default: ; preds = %0
- ret i32 1234
-Foo: ; preds = %0
- ret i32 -2
-Bar: ; preds = %0
- ret i32 -5
-Baz: ; preds = %0
- ret i32 -6
-TheDest: ; preds = %0
- ret i32 -8
-}
-
-; Test folding all to same dest
-define i32 @test3(i1 %C) {
- br i1 %C, label %Start, label %TheDest
-Start: ; preds = %0
- switch i32 3, label %TheDest [
- i32 0, label %TheDest
- i32 1, label %TheDest
- i32 2, label %TheDest
- i32 5, label %TheDest
- ]
-TheDest: ; preds = %Start, %Start, %Start, %Start, %Start, %0
- ret i32 1234
-}
-
-; Test folding switch -> branch
-define i32 @test4(i32 %C) {
- switch i32 %C, label %L1 [
- i32 0, label %L2
- ]
-L1: ; preds = %0
- ret i32 0
-L2: ; preds = %0
- ret i32 1
-}
-
-; Can fold into a cond branch!
-define i32 @test5(i32 %C) {
- switch i32 %C, label %L1 [
- i32 0, label %L2
- i32 123, label %L1
- ]
-L1: ; preds = %0, %0
- ret i32 0
-L2: ; preds = %0
- ret i32 1
-}
-
diff --git a/release_23/test/Transforms/SimplifyCFG/2004-12-10-SimplifyCFGCrash.ll b/release_23/test/Transforms/SimplifyCFG/2004-12-10-SimplifyCFGCrash.ll
deleted file mode 100644
index de0d26245829..000000000000
--- a/release_23/test/Transforms/SimplifyCFG/2004-12-10-SimplifyCFGCrash.ll
+++ /dev/null
@@ -1,40 +0,0 @@
-; RUN: llvm-as < %s | opt -simplifycfg -disable-output
-
-define void @symhash_add() {
-entry:
- br i1 undef, label %then.0, label %UnifiedReturnBlock
-then.0: ; preds = %entry
- br i1 undef, label %loopentry.2, label %loopentry.1.preheader
-loopentry.1.preheader: ; preds = %then.0
- br label %loopentry.1.outer
-loopentry.1.outer: ; preds = %loopexit.1, %loopentry.1.preheader
- br label %loopentry.1
-loopentry.1: ; preds = %endif.1, %then.4, %then.3, %then.1, %loopentry.1.outer
- br i1 undef, label %loopexit.1, label %no_exit.1
-no_exit.1: ; preds = %loopentry.1
- br i1 undef, label %then.1, label %else.0
-then.1: ; preds = %no_exit.1
- br label %loopentry.1
-else.0: ; preds = %no_exit.1
- br i1 undef, label %then.2, label %else.1
-then.2: ; preds = %else.0
- br i1 undef, label %then.3, label %endif.1
-then.3: ; preds = %then.2
- br label %loopentry.1
-else.1: ; preds = %else.0
- br i1 undef, label %endif.1, label %then.4
-then.4: ; preds = %else.1
- br label %loopentry.1
-endif.1: ; preds = %else.1, %then.2
- br label %loopentry.1
-loopexit.1: ; preds = %loopentry.1
- br i1 undef, label %loopentry.1.outer, label %loopentry.2
-loopentry.2: ; preds = %no_exit.2, %loopexit.1, %then.0
- br i1 undef, label %loopexit.2, label %no_exit.2
-no_exit.2: ; preds = %loopentry.2
- br label %loopentry.2
-loopexit.2: ; preds = %loopentry.2
- ret void
-UnifiedReturnBlock: ; preds = %entry
- ret void
-}
diff --git a/release_23/test/Transforms/SimplifyCFG/2005-06-16-PHICrash.ll b/release_23/test/Transforms/SimplifyCFG/2005-06-16-PHICrash.ll
deleted file mode 100644
index 7fea2921b023..000000000000
--- a/release_23/test/Transforms/SimplifyCFG/2005-06-16-PHICrash.ll
+++ /dev/null
@@ -1,95 +0,0 @@
-; RUN: llvm-as < %s | opt -simplifycfg -disable-output
-; PR584
-@g_38098584 = external global i32 ; <i32*> [#uses=1]
-@g_60187400 = external global i32 ; <i32*> [#uses=1]
-@g_59182229 = external global i32 ; <i32*> [#uses=2]
-
-define i32 @_Z13func_26556482h(i8 %l_88173906) {
-entry:
- %tmp.1 = bitcast i8 %l_88173906 to i8 ; <i8> [#uses=2]
- %tmp.3 = icmp eq i8 %l_88173906, 0 ; <i1> [#uses=1]
- br i1 %tmp.3, label %else.0, label %then.0
-then.0: ; preds = %entry
- %tmp.5 = icmp eq i8 %l_88173906, 0 ; <i1> [#uses=1]
- br i1 %tmp.5, label %else.1, label %then.1
-then.1: ; preds = %then.0
- br label %return
-else.1: ; preds = %then.0
- br label %loopentry.0
-loopentry.0: ; preds = %no_exit.0, %else.1
- %i.0.1 = phi i32 [ 0, %else.1 ], [ %inc.0, %no_exit.0 ] ; <i32> [#uses=2]
- %tmp.9 = icmp sgt i32 %i.0.1, 99 ; <i1> [#uses=1]
- br i1 %tmp.9, label %endif.0, label %no_exit.0
-no_exit.0: ; preds = %loopentry.0
- %inc.0 = add i32 %i.0.1, 1 ; <i32> [#uses=1]
- br label %loopentry.0
-else.0: ; preds = %entry
- %tmp.12 = sext i8 %tmp.1 to i32 ; <i32> [#uses=1]
- br label %return
-endif.0: ; preds = %loopentry.0
- %tmp.14 = sext i8 %tmp.1 to i32 ; <i32> [#uses=1]
- %tmp.16 = zext i8 %l_88173906 to i32 ; <i32> [#uses=1]
- %tmp.17 = icmp sgt i32 %tmp.14, %tmp.16 ; <i1> [#uses=1]
- %tmp.19 = load i32* @g_59182229 ; <i32> [#uses=2]
- br i1 %tmp.17, label %cond_true, label %cond_false
-cond_true: ; preds = %endif.0
- %tmp.20 = icmp ne i32 %tmp.19, 1 ; <i1> [#uses=1]
- br label %cond_continue
-cond_false: ; preds = %endif.0
- %tmp.22 = icmp ne i32 %tmp.19, 0 ; <i1> [#uses=1]
- br label %cond_continue
-cond_continue: ; preds = %cond_false, %cond_true
- %mem_tmp.0 = phi i1 [ %tmp.20, %cond_true ], [ %tmp.22, %cond_false ] ; <i1> [#uses=1]
- br i1 %mem_tmp.0, label %then.2, label %else.2
-then.2: ; preds = %cond_continue
- %tmp.25 = zext i8 %l_88173906 to i32 ; <i32> [#uses=1]
- br label %return
-else.2: ; preds = %cond_continue
- br label %loopentry.1
-loopentry.1: ; preds = %endif.3, %else.2
- %i.1.1 = phi i32 [ 0, %else.2 ], [ %inc.3, %endif.3 ] ; <i32> [#uses=2]
- %i.3.2 = phi i32 [ undef, %else.2 ], [ %i.3.0, %endif.3 ] ; <i32> [#uses=2]
- %l_88173906_addr.1 = phi i8 [ %l_88173906, %else.2 ], [ %l_88173906_addr.0, %endif.3 ] ; <i8> [#uses=3]
- %tmp.29 = icmp sgt i32 %i.1.1, 99 ; <i1> [#uses=1]
- br i1 %tmp.29, label %endif.2, label %no_exit.1
-no_exit.1: ; preds = %loopentry.1
- %tmp.30 = load i32* @g_38098584 ; <i32> [#uses=1]
- %tmp.31 = icmp eq i32 %tmp.30, 0 ; <i1> [#uses=1]
- br i1 %tmp.31, label %else.3, label %then.3
-then.3: ; preds = %no_exit.1
- br label %endif.3
-else.3: ; preds = %no_exit.1
- br i1 false, label %else.4, label %then.4
-then.4: ; preds = %else.3
- br label %endif.3
-else.4: ; preds = %else.3
- br i1 false, label %else.5, label %then.5
-then.5: ; preds = %else.4
- store i32 -1004318825, i32* @g_59182229
- br label %return
-else.5: ; preds = %else.4
- br label %loopentry.3
-loopentry.3: ; preds = %then.7, %else.5
- %i.3.3 = phi i32 [ 0, %else.5 ], [ %inc.2, %then.7 ] ; <i32> [#uses=3]
- %tmp.55 = icmp sgt i32 %i.3.3, 99 ; <i1> [#uses=1]
- br i1 %tmp.55, label %endif.3, label %no_exit.3
-no_exit.3: ; preds = %loopentry.3
- %tmp.57 = icmp eq i8 %l_88173906_addr.1, 0 ; <i1> [#uses=1]
- br i1 %tmp.57, label %else.7, label %then.7
-then.7: ; preds = %no_exit.3
- store i32 16239, i32* @g_60187400
- %inc.2 = add i32 %i.3.3, 1 ; <i32> [#uses=1]
- br label %loopentry.3
-else.7: ; preds = %no_exit.3
- br label %return
-endif.3: ; preds = %loopentry.3, %then.4, %then.3
- %i.3.0 = phi i32 [ %i.3.2, %then.3 ], [ %i.3.2, %then.4 ], [ %i.3.3, %loopentry.3 ] ; <i32> [#uses=1]
- %l_88173906_addr.0 = phi i8 [ 100, %then.3 ], [ %l_88173906_addr.1, %then.4 ], [ %l_88173906_addr.1, %loopentry.3 ] ; <i8> [#uses=1]
- %inc.3 = add i32 %i.1.1, 1 ; <i32> [#uses=1]
- br label %loopentry.1
-endif.2: ; preds = %loopentry.1
- br label %return
-return: ; preds = %endif.2, %else.7, %then.5, %then.2, %else.0, %then.1
- %result.0 = phi i32 [ 1624650671, %then.1 ], [ %tmp.25, %then.2 ], [ 3379, %then.5 ], [ 52410, %else.7 ], [ -1526438411, %endif.2 ], [ %tmp.12, %else.0 ] ; <i32> [#uses=1]
- ret i32 %result.0
-}
diff --git a/release_23/test/Transforms/SimplifyCFG/2005-08-01-PHIUpdateFail.ll b/release_23/test/Transforms/SimplifyCFG/2005-08-01-PHIUpdateFail.ll
deleted file mode 100644
index 83143218b1ad..000000000000
--- a/release_23/test/Transforms/SimplifyCFG/2005-08-01-PHIUpdateFail.ll
+++ /dev/null
@@ -1,71 +0,0 @@
-; RUN: llvm-as < %s | opt -simplifycfg -disable-output
-; END.
-
-define void @main() {
-entry:
- %tmp.14.i19 = icmp eq i32 0, 2 ; <i1> [#uses=1]
- br i1 %tmp.14.i19, label %endif.1.i20, label %read_min.exit
-endif.1.i20: ; preds = %entry
- %tmp.9.i.i = icmp eq i8* null, null ; <i1> [#uses=1]
- br i1 %tmp.9.i.i, label %then.i12.i, label %then.i.i
-then.i.i: ; preds = %endif.1.i20
- ret void
-then.i12.i: ; preds = %endif.1.i20
- %tmp.9.i4.i = icmp eq i8* null, null ; <i1> [#uses=1]
- br i1 %tmp.9.i4.i, label %endif.2.i33, label %then.i5.i
-then.i5.i: ; preds = %then.i12.i
- ret void
-endif.2.i33: ; preds = %then.i12.i
- br i1 false, label %loopexit.0.i40, label %no_exit.0.i35
-no_exit.0.i35: ; preds = %no_exit.0.i35, %endif.2.i33
- %tmp.130.i = icmp slt i32 0, 0 ; <i1> [#uses=1]
- br i1 %tmp.130.i, label %loopexit.0.i40.loopexit, label %no_exit.0.i35
-loopexit.0.i40.loopexit: ; preds = %no_exit.0.i35
- br label %loopexit.0.i40
-loopexit.0.i40: ; preds = %loopexit.0.i40.loopexit, %endif.2.i33
- %tmp.341.i = icmp eq i32 0, 0 ; <i1> [#uses=1]
- br i1 %tmp.341.i, label %loopentry.1.i, label %read_min.exit
-loopentry.1.i: ; preds = %loopexit.0.i40
- %tmp.347.i = icmp sgt i32 0, 0 ; <i1> [#uses=1]
- br i1 %tmp.347.i, label %no_exit.1.i41, label %loopexit.2.i44
-no_exit.1.i41: ; preds = %endif.5.i, %loopentry.1.i
- %indvar.i42 = phi i32 [ %indvar.next.i, %endif.5.i ], [ 0, %loopentry.1.i ] ; <i32> [#uses=1]
- %tmp.355.i = icmp eq i32 0, 3 ; <i1> [#uses=1]
- br i1 %tmp.355.i, label %endif.5.i, label %read_min.exit
-endif.5.i: ; preds = %no_exit.1.i41
- %tmp.34773.i = icmp sgt i32 0, 0 ; <i1> [#uses=1]
- %indvar.next.i = add i32 %indvar.i42, 1 ; <i32> [#uses=1]
- br i1 %tmp.34773.i, label %no_exit.1.i41, label %loopexit.1.i.loopexit
-loopexit.1.i.loopexit: ; preds = %endif.5.i
- ret void
-loopexit.2.i44: ; preds = %loopentry.1.i
- ret void
-read_min.exit: ; preds = %no_exit.1.i41, %loopexit.0.i40, %entry
- %tmp.23 = icmp eq i32 0, 0 ; <i1> [#uses=1]
- br i1 %tmp.23, label %endif.1, label %then.1
-then.1: ; preds = %read_min.exit
- br i1 false, label %endif.0.i, label %then.0.i
-then.0.i: ; preds = %then.1
- br i1 false, label %endif.1.i, label %then.1.i
-endif.0.i: ; preds = %then.1
- br i1 false, label %endif.1.i, label %then.1.i
-then.1.i: ; preds = %endif.0.i, %then.0.i
- br i1 false, label %getfree.exit, label %then.2.i
-endif.1.i: ; preds = %endif.0.i, %then.0.i
- br i1 false, label %getfree.exit, label %then.2.i
-then.2.i: ; preds = %endif.1.i, %then.1.i
- ret void
-getfree.exit: ; preds = %endif.1.i, %then.1.i
- ret void
-endif.1: ; preds = %read_min.exit
- %tmp.27.i = getelementptr i32* null, i32 0 ; <i32*> [#uses=0]
- br i1 false, label %loopexit.0.i15, label %no_exit.0.i14
-no_exit.0.i14: ; preds = %endif.1
- ret void
-loopexit.0.i15: ; preds = %endif.1
- br i1 false, label %primal_start_artificial.exit, label %no_exit.1.i16
-no_exit.1.i16: ; preds = %no_exit.1.i16, %loopexit.0.i15
- br i1 false, label %primal_start_artificial.exit, label %no_exit.1.i16
-primal_start_artificial.exit: ; preds = %no_exit.1.i16, %loopexit.0.i15
- ret void
-}
diff --git a/release_23/test/Transforms/SimplifyCFG/2005-08-03-PHIFactorCrash.ll b/release_23/test/Transforms/SimplifyCFG/2005-08-03-PHIFactorCrash.ll
deleted file mode 100644
index 51490a00eb47..000000000000
--- a/release_23/test/Transforms/SimplifyCFG/2005-08-03-PHIFactorCrash.ll
+++ /dev/null
@@ -1,75 +0,0 @@
-; RUN: llvm-as < %s | opt -simplifycfg -disable-output
-; END.
-
- %arraytype.1.Char = type { i32, [0 x i8] }
- %arraytype.4.Signed = type { i32, [0 x i32] }
- %functiontype.23 = type %structtype.Task* (%structtype.Task*, %structtype.Packet*, %structtype.FailedRun*)
- %functiontype.27 = type %structtype.object* ()
- %functiontype.28 = type i1 (%structtype.object*, %structtype.object_vtable*)
- %functiontype.39 = type i32 (%structtype.listiter*)
- %opaquetype.RuntimeTypeInfo = type i8* (i8*)
- %structtype.AssertionError_vtable = type { %structtype.FailedRun_vtable }
- %structtype.DeviceTask = type { %structtype.Task }
- %structtype.FailedRun = type { %structtype.object }
- %structtype.FailedRun_vtable = type { %structtype.object_vtable }
- %structtype.Packet = type { %structtype.object, %structtype.list.1*, i32, i32, i32, %structtype.Packet* }
- %structtype.Task = type { %structtype.TaskState, %structtype.FailedRun*, i32, %structtype.Packet*, %structtype.Task*, i32 }
- %structtype.TaskState = type { %structtype.object, i1, i1, i1 }
- %structtype.list.1 = type { %arraytype.4.Signed* }
- %structtype.listiter = type { %structtype.list.1*, i32 }
- %structtype.object = type { %structtype.object_vtable* }
- %structtype.object_vtable = type { %structtype.object_vtable*, %opaquetype.RuntimeTypeInfo*, %arraytype.1.Char*, %functiontype.27* }
-@structinstance.59 = external global %structtype.AssertionError_vtable ; <%structtype.AssertionError_vtable*> [#uses=0]
-
-declare fastcc i1 @ll_isinstance__objectPtr_object_vtablePtr()
-
-declare fastcc void @ll_listnext__listiterPtr()
-
-define fastcc void @WorkTask.fn() {
-block0:
- br label %block1
-block1: ; preds = %block0
- %v2542 = call fastcc i1 @ll_isinstance__objectPtr_object_vtablePtr( ) ; <i1> [#uses=1]
- br i1 %v2542, label %block4, label %block2
-block2: ; preds = %block1
- br label %block3
-block3: ; preds = %block2
- unwind
-block4: ; preds = %block1
- br label %block5
-block5: ; preds = %block4
- %v2565 = icmp eq %structtype.Packet* null, null ; <i1> [#uses=1]
- br i1 %v2565, label %block15, label %block6
-block6: ; preds = %block5
- %self_2575 = phi %structtype.DeviceTask* [ null, %block5 ] ; <%structtype.DeviceTask*> [#uses=1]
- br i1 false, label %block14, label %block7
-block7: ; preds = %block14, %block6
- %self_2635 = phi %structtype.DeviceTask* [ %self_2575, %block6 ], [ null, %block14 ] ; <%structtype.DeviceTask*> [#uses=1]
- %tmp.124 = getelementptr %structtype.Packet* null, i32 0, i32 2 ; <i32*> [#uses=0]
- br label %block8
-block8: ; preds = %block10, %block7
- %self_2672 = phi %structtype.DeviceTask* [ %self_2635, %block7 ], [ null, %block10 ] ; <%structtype.DeviceTask*> [#uses=0]
- invoke fastcc void @ll_listnext__listiterPtr( )
- to label %block9 unwind label %block8_exception_handling
-block8_exception_handling: ; preds = %block8
- br i1 false, label %block8_exception_found_branchto_block12, label %block8_not_exception_structinstance.10
-block8_not_exception_structinstance.10: ; preds = %block8_exception_handling
- unwind
-block8_exception_found_branchto_block12: ; preds = %block8_exception_handling
- br label %block12
-block9: ; preds = %block8
- br i1 false, label %block11, label %block10
-block10: ; preds = %block11, %block9
- br label %block8
-block11: ; preds = %block9
- br label %block10
-block12: ; preds = %block8_exception_found_branchto_block12
- br label %block13
-block13: ; preds = %block15, %block12
- ret void
-block14: ; preds = %block6
- br label %block7
-block15: ; preds = %block5
- %v2586 = phi %structtype.DeviceTask* [ null, %block5 ] ; <%structtype.DeviceTask*> [#uses=0]
- br label %block13
-}
diff --git a/release_23/test/Transforms/SimplifyCFG/2005-10-02-InvokeSimplify.ll b/release_23/test/Transforms/SimplifyCFG/2005-10-02-InvokeSimplify.ll
deleted file mode 100644
index a0fe7817743a..000000000000
--- a/release_23/test/Transforms/SimplifyCFG/2005-10-02-InvokeSimplify.ll
+++ /dev/null
@@ -1,15 +0,0 @@
-; RUN: llvm-as < %s | opt -simplifycfg -disable-output
-
-define i1 @foo() {
- %X = invoke i1 @foo( )
- to label %N unwind label %F ; <i1> [#uses=1]
-F: ; preds = %0
- ret i1 false
-N: ; preds = %0
- br i1 %X, label %A, label %B
-A: ; preds = %N
- ret i1 true
-B: ; preds = %N
- ret i1 true
-}
-
diff --git a/release_23/test/Transforms/SimplifyCFG/2005-12-03-IncorrectPHIFold.ll b/release_23/test/Transforms/SimplifyCFG/2005-12-03-IncorrectPHIFold.ll
deleted file mode 100644
index 27413fcf9fa1..000000000000
--- a/release_23/test/Transforms/SimplifyCFG/2005-12-03-IncorrectPHIFold.ll
+++ /dev/null
@@ -1,124 +0,0 @@
-; Make sure this doesn't turn into an infinite loop
-
-; RUN: llvm-as < %s | opt -simplifycfg -constprop -simplifycfg |\
-; RUN: llvm-dis | grep bb86
-; END.
-
-%struct.anon = type { i32, i32, i32, i32, [1024 x i8] }
-@_zero_ = external global %struct.anon* ; <%struct.anon**> [#uses=2]
-@_one_ = external global %struct.anon* ; <%struct.anon**> [#uses=4]
-@str = internal constant [4 x i8] c"%d\0A\00" ; <[4 x i8]*> [#uses=0]
-
-declare i32 @bc_compare(%struct.anon*, %struct.anon*)
-
-declare void @free_num(%struct.anon**)
-
-declare %struct.anon* @copy_num(%struct.anon*)
-
-declare void @init_num(%struct.anon**)
-
-declare %struct.anon* @new_num(i32, i32)
-
-declare void @int2num(%struct.anon**, i32)
-
-declare void @bc_multiply(%struct.anon*, %struct.anon*, %struct.anon**, i32)
-
-declare void @bc_raise(%struct.anon*, %struct.anon*, %struct.anon**, i32)
-
-declare i32 @bc_divide(%struct.anon*, %struct.anon*, %struct.anon**, i32)
-
-declare void @bc_add(%struct.anon*, %struct.anon*, %struct.anon**)
-
-declare i32 @_do_compare(%struct.anon*, %struct.anon*, i32, i32)
-
-declare i32 @printf(i8*, ...)
-
-define i32 @bc_sqrt(%struct.anon** %num, i32 %scale) {
-entry:
- %guess = alloca %struct.anon* ; <%struct.anon**> [#uses=7]
- %guess1 = alloca %struct.anon* ; <%struct.anon**> [#uses=7]
- %point5 = alloca %struct.anon* ; <%struct.anon**> [#uses=3]
- %tmp = load %struct.anon** %num ; <%struct.anon*> [#uses=1]
- %tmp1 = load %struct.anon** @_zero_ ; <%struct.anon*> [#uses=1]
- %tmp.upgrd.1 = call i32 @bc_compare( %struct.anon* %tmp, %struct.anon* %tmp1 ) ; <i32> [#uses=2]
- %tmp.upgrd.2 = icmp slt i32 %tmp.upgrd.1, 0 ; <i1> [#uses=1]
- br i1 %tmp.upgrd.2, label %cond_true, label %cond_false
-cond_true: ; preds = %entry
- ret i32 0
-cond_false: ; preds = %entry
- %tmp5 = icmp eq i32 %tmp.upgrd.1, 0 ; <i1> [#uses=1]
- br i1 %tmp5, label %cond_true6, label %cond_next13
-cond_true6: ; preds = %cond_false
- call void @free_num( %struct.anon** %num )
- %tmp8 = load %struct.anon** @_zero_ ; <%struct.anon*> [#uses=1]
- %tmp9 = call %struct.anon* @copy_num( %struct.anon* %tmp8 ) ; <%struct.anon*> [#uses=1]
- store %struct.anon* %tmp9, %struct.anon** %num
- ret i32 1
-cond_next13: ; preds = %cond_false
- %tmp15 = load %struct.anon** %num ; <%struct.anon*> [#uses=1]
- %tmp16 = load %struct.anon** @_one_ ; <%struct.anon*> [#uses=1]
- %tmp17 = call i32 @bc_compare( %struct.anon* %tmp15, %struct.anon* %tmp16 ) ; <i32> [#uses=2]
- %tmp19 = icmp eq i32 %tmp17, 0 ; <i1> [#uses=1]
- br i1 %tmp19, label %cond_true20, label %cond_next27
-cond_true20: ; preds = %cond_next13
- call void @free_num( %struct.anon** %num )
- %tmp22 = load %struct.anon** @_one_ ; <%struct.anon*> [#uses=1]
- %tmp23 = call %struct.anon* @copy_num( %struct.anon* %tmp22 ) ; <%struct.anon*> [#uses=1]
- store %struct.anon* %tmp23, %struct.anon** %num
- ret i32 1
-cond_next27: ; preds = %cond_next13
- %tmp29 = load %struct.anon** %num ; <%struct.anon*> [#uses=1]
- %tmp30 = getelementptr %struct.anon* %tmp29, i32 0, i32 2 ; <i32*> [#uses=1]
- %tmp31 = load i32* %tmp30 ; <i32> [#uses=2]
- %tmp33 = icmp sge i32 %tmp31, %scale ; <i1> [#uses=1]
- %max = select i1 %tmp33, i32 %tmp31, i32 %scale ; <i32> [#uses=4]
- %tmp35 = add i32 %max, 2 ; <i32> [#uses=0]
- call void @init_num( %struct.anon** %guess )
- call void @init_num( %struct.anon** %guess1 )
- %tmp36 = call %struct.anon* @new_num( i32 1, i32 1 ) ; <%struct.anon*> [#uses=2]
- store %struct.anon* %tmp36, %struct.anon** %point5
- %tmp.upgrd.3 = getelementptr %struct.anon* %tmp36, i32 0, i32 4, i32 1 ; <i8*> [#uses=1]
- store i8 5, i8* %tmp.upgrd.3
- %tmp39 = icmp slt i32 %tmp17, 0 ; <i1> [#uses=1]
- br i1 %tmp39, label %cond_true40, label %cond_false43
-cond_true40: ; preds = %cond_next27
- %tmp41 = load %struct.anon** @_one_ ; <%struct.anon*> [#uses=1]
- %tmp42 = call %struct.anon* @copy_num( %struct.anon* %tmp41 ) ; <%struct.anon*> [#uses=1]
- store %struct.anon* %tmp42, %struct.anon** %guess
- br label %bb80.outer
-cond_false43: ; preds = %cond_next27
- call void @int2num( %struct.anon** %guess, i32 10 )
- %tmp45 = load %struct.anon** %num ; <%struct.anon*> [#uses=1]
- %tmp46 = getelementptr %struct.anon* %tmp45, i32 0, i32 1 ; <i32*> [#uses=1]
- %tmp47 = load i32* %tmp46 ; <i32> [#uses=1]
- call void @int2num( %struct.anon** %guess1, i32 %tmp47 )
- %tmp48 = load %struct.anon** %guess1 ; <%struct.anon*> [#uses=1]
- %tmp49 = load %struct.anon** %point5 ; <%struct.anon*> [#uses=1]
- call void @bc_multiply( %struct.anon* %tmp48, %struct.anon* %tmp49, %struct.anon** %guess1, i32 %max )
- %tmp51 = load %struct.anon** %guess1 ; <%struct.anon*> [#uses=1]
- %tmp52 = getelementptr %struct.anon* %tmp51, i32 0, i32 2 ; <i32*> [#uses=1]
- store i32 0, i32* %tmp52
- %tmp53 = load %struct.anon** %guess ; <%struct.anon*> [#uses=1]
- %tmp54 = load %struct.anon** %guess1 ; <%struct.anon*> [#uses=1]
- call void @bc_raise( %struct.anon* %tmp53, %struct.anon* %tmp54, %struct.anon** %guess, i32 %max )
- br label %bb80.outer
-bb80.outer: ; preds = %cond_true83, %cond_false43, %cond_true40
- %done.1.ph = phi i32 [ 1, %cond_true83 ], [ 0, %cond_true40 ], [ 0, %cond_false43 ] ; <i32> [#uses=1]
- br label %bb80
-bb80: ; preds = %cond_true83, %bb80.outer
- %tmp82 = icmp eq i32 %done.1.ph, 0 ; <i1> [#uses=1]
- br i1 %tmp82, label %cond_true83, label %bb86
-cond_true83: ; preds = %bb80
- %tmp71 = call i32 @_do_compare( %struct.anon* null, %struct.anon* null, i32 0, i32 1 ) ; <i32> [#uses=1]
- %tmp76 = icmp eq i32 %tmp71, 0 ; <i1> [#uses=1]
- br i1 %tmp76, label %bb80.outer, label %bb80
-bb86: ; preds = %bb80
- call void @free_num( %struct.anon** %num )
- %tmp88 = load %struct.anon** %guess ; <%struct.anon*> [#uses=1]
- %tmp89 = load %struct.anon** @_one_ ; <%struct.anon*> [#uses=1]
- %tmp92 = call i32 @bc_divide( %struct.anon* %tmp88, %struct.anon* %tmp89, %struct.anon** %num, i32 %max ) ; <i32> [#uses=0]
- call void @free_num( %struct.anon** %guess )
- call void @free_num( %struct.anon** %guess1 )
- call void @free_num( %struct.anon** %point5 )
- ret i32 1
-}
diff --git a/release_23/test/Transforms/SimplifyCFG/2006-02-17-InfiniteUnroll.ll b/release_23/test/Transforms/SimplifyCFG/2006-02-17-InfiniteUnroll.ll
deleted file mode 100644
index 4400624d184d..000000000000
--- a/release_23/test/Transforms/SimplifyCFG/2006-02-17-InfiniteUnroll.ll
+++ /dev/null
@@ -1,27 +0,0 @@
-; RUN: llvm-as < %s | opt -simplifycfg -disable-output
-
-define void @polnel_() {
-entry:
- %tmp595 = icmp slt i32 0, 0 ; <i1> [#uses=4]
- br i1 %tmp595, label %bb148.critedge, label %cond_true40
-bb36: ; preds = %bb43
- br i1 %tmp595, label %bb43, label %cond_true40
-cond_true40: ; preds = %bb46, %cond_true40, %bb36, %entry
- %tmp397 = icmp sgt i32 0, 0 ; <i1> [#uses=1]
- br i1 %tmp397, label %bb43, label %cond_true40
-bb43: ; preds = %cond_true40, %bb36
- br i1 false, label %bb53, label %bb36
-bb46: ; preds = %bb53
- br i1 %tmp595, label %bb53, label %cond_true40
-bb53: ; preds = %bb46, %bb43
- br i1 false, label %bb102, label %bb46
-bb92.preheader: ; preds = %bb102
- ret void
-bb102: ; preds = %bb53
- br i1 %tmp595, label %bb148, label %bb92.preheader
-bb148.critedge: ; preds = %entry
- ret void
-bb148: ; preds = %bb102
- ret void
-}
-
diff --git a/release_23/test/Transforms/SimplifyCFG/2006-06-12-InfLoop.ll b/release_23/test/Transforms/SimplifyCFG/2006-06-12-InfLoop.ll
deleted file mode 100644
index 4981cf3c9aa3..000000000000
--- a/release_23/test/Transforms/SimplifyCFG/2006-06-12-InfLoop.ll
+++ /dev/null
@@ -1,413 +0,0 @@
-; RUN: llvm-as < %s | opt -simplifycfg -disable-output
-; END.
-
-define void @main(i32 %c) {
-entry:
- %tmp.9 = icmp eq i32 %c, 2 ; <i1> [#uses=1]
- br i1 %tmp.9, label %endif.0, label %then.0
-then.0: ; preds = %entry
- ret void
-endif.0: ; preds = %entry
- br i1 false, label %then.1, label %endif.1
-then.1: ; preds = %endif.0
- ret void
-endif.1: ; preds = %endif.0
- br i1 false, label %then.2, label %endif.2
-then.2: ; preds = %endif.1
- ret void
-endif.2: ; preds = %endif.1
- br i1 false, label %then.3, label %loopentry.0
-then.3: ; preds = %endif.2
- ret void
-loopentry.0: ; preds = %endif.2
- br i1 false, label %no_exit.0.preheader, label %loopexit.0
-no_exit.0.preheader: ; preds = %loopentry.0
- br label %no_exit.0
-no_exit.0: ; preds = %endif.4, %no_exit.0.preheader
- br i1 false, label %then.4, label %endif.4
-then.4: ; preds = %no_exit.0
- ret void
-endif.4: ; preds = %no_exit.0
- br i1 false, label %no_exit.0, label %loopexit.0.loopexit
-loopexit.0.loopexit: ; preds = %endif.4
- br label %loopexit.0
-loopexit.0: ; preds = %loopexit.0.loopexit, %loopentry.0
- br i1 false, label %then.5, label %loopentry.1
-then.5: ; preds = %loopexit.0
- ret void
-loopentry.1: ; preds = %loopexit.0
- %tmp.143 = icmp sgt i32 0, 0 ; <i1> [#uses=4]
- br i1 %tmp.143, label %no_exit.1.preheader, label %loopexit.1
-no_exit.1.preheader: ; preds = %loopentry.1
- br label %no_exit.1
-no_exit.1: ; preds = %endif.6, %no_exit.1.preheader
- br i1 false, label %then.6, label %shortcirc_next.3
-shortcirc_next.3: ; preds = %no_exit.1
- br i1 false, label %then.6, label %shortcirc_next.4
-shortcirc_next.4: ; preds = %shortcirc_next.3
- br i1 false, label %then.6, label %endif.6
-then.6: ; preds = %shortcirc_next.4, %shortcirc_next.3, %no_exit.1
- ret void
-endif.6: ; preds = %shortcirc_next.4
- br i1 false, label %no_exit.1, label %loopexit.1.loopexit
-loopexit.1.loopexit: ; preds = %endif.6
- br label %loopexit.1
-loopexit.1: ; preds = %loopexit.1.loopexit, %loopentry.1
- br i1 false, label %then.i, label %loopentry.0.i
-then.i: ; preds = %loopexit.1
- ret void
-loopentry.0.i: ; preds = %loopexit.1
- br i1 %tmp.143, label %no_exit.0.i.preheader, label %readvector.exit
-no_exit.0.i.preheader: ; preds = %loopentry.0.i
- br label %no_exit.0.i
-no_exit.0.i: ; preds = %loopexit.1.i, %no_exit.0.i.preheader
- br i1 false, label %no_exit.1.i.preheader, label %loopexit.1.i
-no_exit.1.i.preheader: ; preds = %no_exit.0.i
- br label %no_exit.1.i
-no_exit.1.i: ; preds = %loopexit.2.i, %no_exit.1.i.preheader
- br i1 false, label %no_exit.2.i.preheader, label %loopexit.2.i
-no_exit.2.i.preheader: ; preds = %no_exit.1.i
- br label %no_exit.2.i
-no_exit.2.i: ; preds = %no_exit.2.i, %no_exit.2.i.preheader
- br i1 false, label %no_exit.2.i, label %loopexit.2.i.loopexit
-loopexit.2.i.loopexit: ; preds = %no_exit.2.i
- br label %loopexit.2.i
-loopexit.2.i: ; preds = %loopexit.2.i.loopexit, %no_exit.1.i
- br i1 false, label %no_exit.1.i, label %loopexit.1.i.loopexit
-loopexit.1.i.loopexit: ; preds = %loopexit.2.i
- br label %loopexit.1.i
-loopexit.1.i: ; preds = %loopexit.1.i.loopexit, %no_exit.0.i
- br i1 false, label %no_exit.0.i, label %readvector.exit.loopexit
-readvector.exit.loopexit: ; preds = %loopexit.1.i
- br label %readvector.exit
-readvector.exit: ; preds = %readvector.exit.loopexit, %loopentry.0.i
- br i1 %tmp.143, label %loopentry.1.preheader.i, label %loopexit.0.i
-loopentry.1.preheader.i: ; preds = %readvector.exit
- br label %loopentry.1.outer.i
-loopentry.1.outer.i: ; preds = %loopexit.1.i110, %loopentry.1.preheader.i
- br label %loopentry.1.i85
-loopentry.1.i85.loopexit: ; preds = %hamming.exit16.i
- br label %loopentry.1.i85
-loopentry.1.i85: ; preds = %loopentry.1.i85.loopexit, %loopentry.1.outer.i
- br i1 false, label %no_exit.1.preheader.i, label %loopexit.1.i110.loopexit1
-no_exit.1.preheader.i: ; preds = %loopentry.1.i85
- br label %no_exit.1.i87
-no_exit.1.i87: ; preds = %then.1.i107, %no_exit.1.preheader.i
- br i1 false, label %no_exit.i.i101.preheader, label %hamming.exit.i104
-no_exit.i.i101.preheader: ; preds = %no_exit.1.i87
- br label %no_exit.i.i101
-no_exit.i.i101: ; preds = %no_exit.i.i101, %no_exit.i.i101.preheader
- br i1 false, label %no_exit.i.i101, label %hamming.exit.i104.loopexit
-hamming.exit.i104.loopexit: ; preds = %no_exit.i.i101
- br label %hamming.exit.i104
-hamming.exit.i104: ; preds = %hamming.exit.i104.loopexit, %no_exit.1.i87
- br i1 false, label %no_exit.i15.i.preheader, label %hamming.exit16.i
-no_exit.i15.i.preheader: ; preds = %hamming.exit.i104
- br label %no_exit.i15.i
-no_exit.i15.i: ; preds = %no_exit.i15.i, %no_exit.i15.i.preheader
- br i1 false, label %no_exit.i15.i, label %hamming.exit16.i.loopexit
-hamming.exit16.i.loopexit: ; preds = %no_exit.i15.i
- br label %hamming.exit16.i
-hamming.exit16.i: ; preds = %hamming.exit16.i.loopexit, %hamming.exit.i104
- br i1 false, label %loopentry.1.i85.loopexit, label %then.1.i107
-then.1.i107: ; preds = %hamming.exit16.i
- br i1 false, label %no_exit.1.i87, label %loopexit.1.i110.loopexit
-loopexit.1.i110.loopexit: ; preds = %then.1.i107
- br label %loopexit.1.i110
-loopexit.1.i110.loopexit1: ; preds = %loopentry.1.i85
- br label %loopexit.1.i110
-loopexit.1.i110: ; preds = %loopexit.1.i110.loopexit1, %loopexit.1.i110.loopexit
- br i1 false, label %loopentry.1.outer.i, label %loopexit.0.i.loopexit
-loopexit.0.i.loopexit: ; preds = %loopexit.1.i110
- br label %loopexit.0.i
-loopexit.0.i: ; preds = %loopexit.0.i.loopexit, %readvector.exit
- br i1 false, label %UnifiedReturnBlock.i113, label %then.2.i112
-then.2.i112: ; preds = %loopexit.0.i
- br label %checkham.exit
-UnifiedReturnBlock.i113: ; preds = %loopexit.0.i
- br label %checkham.exit
-checkham.exit: ; preds = %UnifiedReturnBlock.i113, %then.2.i112
- br i1 false, label %loopentry.1.i14.preheader, label %loopentry.3.i.preheader
-loopentry.1.i14.preheader: ; preds = %checkham.exit
- br label %loopentry.1.i14
-loopentry.1.i14: ; preds = %loopexit.1.i18, %loopentry.1.i14.preheader
- br i1 false, label %no_exit.1.i16.preheader, label %loopexit.1.i18
-no_exit.1.i16.preheader: ; preds = %loopentry.1.i14
- br label %no_exit.1.i16
-no_exit.1.i16: ; preds = %no_exit.1.i16, %no_exit.1.i16.preheader
- br i1 false, label %no_exit.1.i16, label %loopexit.1.i18.loopexit
-loopexit.1.i18.loopexit: ; preds = %no_exit.1.i16
- br label %loopexit.1.i18
-loopexit.1.i18: ; preds = %loopexit.1.i18.loopexit, %loopentry.1.i14
- br i1 false, label %loopentry.1.i14, label %loopentry.3.i.loopexit
-loopentry.3.i.loopexit: ; preds = %loopexit.1.i18
- br label %loopentry.3.i.preheader
-loopentry.3.i.preheader: ; preds = %loopentry.3.i.loopexit, %checkham.exit
- br label %loopentry.3.i
-loopentry.3.i: ; preds = %endif.1.i, %loopentry.3.i.preheader
- br i1 false, label %loopentry.4.i.preheader, label %endif.1.i
-loopentry.4.i.preheader: ; preds = %loopentry.3.i
- br label %loopentry.4.i
-loopentry.4.i: ; preds = %loopexit.4.i, %loopentry.4.i.preheader
- br i1 false, label %no_exit.4.i.preheader, label %loopexit.4.i
-no_exit.4.i.preheader: ; preds = %loopentry.4.i
- br label %no_exit.4.i
-no_exit.4.i: ; preds = %no_exit.4.i.backedge, %no_exit.4.i.preheader
- br i1 false, label %endif.0.i, label %else.i
-else.i: ; preds = %no_exit.4.i
- br i1 false, label %no_exit.4.i.backedge, label %loopexit.4.i.loopexit
-no_exit.4.i.backedge: ; preds = %endif.0.i, %else.i
- br label %no_exit.4.i
-endif.0.i: ; preds = %no_exit.4.i
- br i1 false, label %no_exit.4.i.backedge, label %loopexit.4.i.loopexit
-loopexit.4.i.loopexit: ; preds = %endif.0.i, %else.i
- br label %loopexit.4.i
-loopexit.4.i: ; preds = %loopexit.4.i.loopexit, %loopentry.4.i
- br i1 false, label %loopentry.4.i, label %endif.1.i.loopexit
-endif.1.i.loopexit: ; preds = %loopexit.4.i
- br label %endif.1.i
-endif.1.i: ; preds = %endif.1.i.loopexit, %loopentry.3.i
- %exitcond = icmp eq i32 0, 10 ; <i1> [#uses=1]
- br i1 %exitcond, label %generateT.exit, label %loopentry.3.i
-generateT.exit: ; preds = %endif.1.i
- br i1 false, label %then.0.i, label %loopentry.1.i30.preheader
-then.0.i: ; preds = %generateT.exit
- ret void
-loopentry.1.i30.loopexit: ; preds = %loopexit.3.i
- br label %loopentry.1.i30.backedge
-loopentry.1.i30.preheader: ; preds = %generateT.exit
- br label %loopentry.1.i30
-loopentry.1.i30: ; preds = %loopentry.1.i30.backedge, %loopentry.1.i30.preheader
- br i1 %tmp.143, label %no_exit.0.i31.preheader, label %loopentry.1.i30.backedge
-loopentry.1.i30.backedge: ; preds = %loopentry.1.i30, %loopentry.1.i30.loopexit
- br label %loopentry.1.i30
-no_exit.0.i31.preheader: ; preds = %loopentry.1.i30
- br label %no_exit.0.i31
-no_exit.0.i31: ; preds = %loopexit.3.i, %no_exit.0.i31.preheader
- br i1 false, label %then.1.i, label %else.0.i
-then.1.i: ; preds = %no_exit.0.i31
- br i1 undef, label %then.0.i29, label %loopentry.0.i31
-then.0.i29: ; preds = %then.1.i
- unreachable
-loopentry.0.i31: ; preds = %then.1.i
- br i1 false, label %no_exit.0.i38.preheader, label %loopentry.1.i.preheader
-no_exit.0.i38.preheader: ; preds = %loopentry.0.i31
- br label %no_exit.0.i38
-no_exit.0.i38: ; preds = %no_exit.0.i38, %no_exit.0.i38.preheader
- br i1 undef, label %no_exit.0.i38, label %loopentry.1.i.preheader.loopexit
-loopentry.1.i.preheader.loopexit: ; preds = %no_exit.0.i38
- br label %loopentry.1.i.preheader
-loopentry.1.i.preheader: ; preds = %loopentry.1.i.preheader.loopexit, %loopentry.0.i31
- br label %loopentry.1.i
-loopentry.1.i: ; preds = %endif.2.i, %loopentry.1.i.preheader
- br i1 undef, label %loopentry.2.i39.preheader, label %loopexit.1.i79.loopexit2
-loopentry.2.i39.preheader: ; preds = %loopentry.1.i
- br label %loopentry.2.i39
-loopentry.2.i39: ; preds = %loopexit.5.i77, %loopentry.2.i39.preheader
- br i1 false, label %loopentry.3.i40.preheader, label %hamming.exit.i71
-loopentry.3.i40.preheader: ; preds = %loopentry.2.i39
- br label %loopentry.3.i40
-loopentry.3.i40: ; preds = %loopexit.3.i51, %loopentry.3.i40.preheader
- br i1 false, label %no_exit.3.preheader.i42, label %loopexit.3.i51
-no_exit.3.preheader.i42: ; preds = %loopentry.3.i40
- br label %no_exit.3.i49
-no_exit.3.i49: ; preds = %no_exit.3.i49, %no_exit.3.preheader.i42
- br i1 undef, label %no_exit.3.i49, label %loopexit.3.i51.loopexit
-loopexit.3.i51.loopexit: ; preds = %no_exit.3.i49
- br label %loopexit.3.i51
-loopexit.3.i51: ; preds = %loopexit.3.i51.loopexit, %loopentry.3.i40
- br i1 undef, label %loopentry.3.i40, label %loopentry.4.i52
-loopentry.4.i52: ; preds = %loopexit.3.i51
- br i1 false, label %no_exit.4.i54.preheader, label %hamming.exit.i71
-no_exit.4.i54.preheader: ; preds = %loopentry.4.i52
- br label %no_exit.4.i54
-no_exit.4.i54: ; preds = %no_exit.4.backedge.i, %no_exit.4.i54.preheader
- br i1 undef, label %then.1.i55, label %endif.1.i56
-then.1.i55: ; preds = %no_exit.4.i54
- br i1 undef, label %no_exit.4.backedge.i, label %loopexit.4.i57
-no_exit.4.backedge.i: ; preds = %endif.1.i56, %then.1.i55
- br label %no_exit.4.i54
-endif.1.i56: ; preds = %no_exit.4.i54
- br i1 undef, label %no_exit.4.backedge.i, label %loopexit.4.i57
-loopexit.4.i57: ; preds = %endif.1.i56, %then.1.i55
- br i1 false, label %no_exit.i.i69.preheader, label %hamming.exit.i71
-no_exit.i.i69.preheader: ; preds = %loopexit.4.i57
- br label %no_exit.i.i69
-no_exit.i.i69: ; preds = %no_exit.i.i69, %no_exit.i.i69.preheader
- br i1 undef, label %no_exit.i.i69, label %hamming.exit.i71.loopexit
-hamming.exit.i71.loopexit: ; preds = %no_exit.i.i69
- br label %hamming.exit.i71
-hamming.exit.i71: ; preds = %hamming.exit.i71.loopexit, %loopexit.4.i57, %loopentry.4.i52, %loopentry.2.i39
- br i1 undef, label %endif.2.i, label %loopentry.5.i72
-loopentry.5.i72: ; preds = %hamming.exit.i71
- br i1 false, label %shortcirc_next.i74.preheader, label %loopexit.5.i77
-shortcirc_next.i74.preheader: ; preds = %loopentry.5.i72
- br label %shortcirc_next.i74
-shortcirc_next.i74: ; preds = %no_exit.5.i76, %shortcirc_next.i74.preheader
- br i1 undef, label %no_exit.5.i76, label %loopexit.5.i77.loopexit
-no_exit.5.i76: ; preds = %shortcirc_next.i74
- br i1 undef, label %shortcirc_next.i74, label %loopexit.5.i77.loopexit
-loopexit.5.i77.loopexit: ; preds = %no_exit.5.i76, %shortcirc_next.i74
- br label %loopexit.5.i77
-loopexit.5.i77: ; preds = %loopexit.5.i77.loopexit, %loopentry.5.i72
- br i1 undef, label %loopentry.2.i39, label %loopexit.1.i79.loopexit
-endif.2.i: ; preds = %hamming.exit.i71
- br label %loopentry.1.i
-loopexit.1.i79.loopexit: ; preds = %loopexit.5.i77
- br label %loopexit.1.i79
-loopexit.1.i79.loopexit2: ; preds = %loopentry.1.i
- br label %loopexit.1.i79
-loopexit.1.i79: ; preds = %loopexit.1.i79.loopexit2, %loopexit.1.i79.loopexit
- br i1 undef, label %then.3.i, label %loopentry.6.i80
-then.3.i: ; preds = %loopexit.1.i79
- br i1 false, label %no_exit.6.i82.preheader, label %run.exit
-loopentry.6.i80: ; preds = %loopexit.1.i79
- br i1 false, label %no_exit.6.i82.preheader, label %run.exit
-no_exit.6.i82.preheader: ; preds = %loopentry.6.i80, %then.3.i
- br label %no_exit.6.i82
-no_exit.6.i82: ; preds = %no_exit.6.i82, %no_exit.6.i82.preheader
- br i1 undef, label %no_exit.6.i82, label %run.exit.loopexit
-run.exit.loopexit: ; preds = %no_exit.6.i82
- br label %run.exit
-run.exit: ; preds = %run.exit.loopexit, %loopentry.6.i80, %then.3.i
- br i1 false, label %no_exit.1.i36.preheader, label %loopentry.3.i37
-else.0.i: ; preds = %no_exit.0.i31
- br i1 false, label %then.0.i4, label %loopentry.0.i6
-then.0.i4: ; preds = %else.0.i
- unreachable
-loopentry.0.i6: ; preds = %else.0.i
- br i1 false, label %no_exit.0.i8.preheader, label %loopentry.2.i.preheader
-no_exit.0.i8.preheader: ; preds = %loopentry.0.i6
- br label %no_exit.0.i8
-no_exit.0.i8: ; preds = %no_exit.0.i8, %no_exit.0.i8.preheader
- br i1 false, label %no_exit.0.i8, label %loopentry.2.i.preheader.loopexit
-loopentry.2.i.preheader.loopexit: ; preds = %no_exit.0.i8
- br label %loopentry.2.i.preheader
-loopentry.2.i.preheader: ; preds = %loopentry.2.i.preheader.loopexit, %loopentry.0.i6
- br label %loopentry.2.i
-loopentry.2.i: ; preds = %endif.3.i19, %loopentry.2.i.preheader
- br i1 false, label %loopentry.3.i10.preheader, label %loopentry.4.i15
-loopentry.3.i10.preheader: ; preds = %loopentry.2.i
- br label %loopentry.3.i10
-loopentry.3.i10: ; preds = %loopexit.3.i14, %loopentry.3.i10.preheader
- br i1 false, label %no_exit.3.preheader.i, label %loopexit.3.i14
-no_exit.3.preheader.i: ; preds = %loopentry.3.i10
- br label %no_exit.3.i12
-no_exit.3.i12: ; preds = %no_exit.3.i12, %no_exit.3.preheader.i
- br i1 false, label %no_exit.3.i12, label %loopexit.3.i14.loopexit
-loopexit.3.i14.loopexit: ; preds = %no_exit.3.i12
- br label %loopexit.3.i14
-loopexit.3.i14: ; preds = %loopexit.3.i14.loopexit, %loopentry.3.i10
- br i1 false, label %loopentry.3.i10, label %loopentry.4.i15.loopexit
-loopentry.4.i15.loopexit: ; preds = %loopexit.3.i14
- br label %loopentry.4.i15
-loopentry.4.i15: ; preds = %loopentry.4.i15.loopexit, %loopentry.2.i
- br i1 false, label %loopentry.5.outer.i.preheader, label %loopentry.7.i
-loopentry.5.outer.i.preheader: ; preds = %loopentry.4.i15
- br label %loopentry.5.outer.i
-loopentry.5.outer.i: ; preds = %loopexit.5.i, %loopentry.5.outer.i.preheader
- br label %loopentry.5.i
-loopentry.5.i: ; preds = %endif.1.i18, %loopentry.5.outer.i
- br i1 false, label %no_exit.5.i.preheader, label %loopexit.5.i.loopexit3
-no_exit.5.i.preheader: ; preds = %loopentry.5.i
- br label %no_exit.5.i
-no_exit.5.i: ; preds = %then.2.i, %no_exit.5.i.preheader
- br i1 false, label %loopentry.6.i, label %endif.1.i18
-loopentry.6.i: ; preds = %no_exit.5.i
- br i1 false, label %no_exit.6.preheader.i, label %loopexit.6.i
-no_exit.6.preheader.i: ; preds = %loopentry.6.i
- br label %no_exit.6.i
-no_exit.6.i: ; preds = %no_exit.6.i, %no_exit.6.preheader.i
- br i1 false, label %no_exit.6.i, label %loopexit.6.i.loopexit
-loopexit.6.i.loopexit: ; preds = %no_exit.6.i
- br label %loopexit.6.i
-loopexit.6.i: ; preds = %loopexit.6.i.loopexit, %loopentry.6.i
- br i1 false, label %then.2.i, label %endif.1.i18
-then.2.i: ; preds = %loopexit.6.i
- br i1 false, label %no_exit.5.i, label %loopexit.5.i.loopexit
-endif.1.i18: ; preds = %loopexit.6.i, %no_exit.5.i
- br label %loopentry.5.i
-loopexit.5.i.loopexit: ; preds = %then.2.i
- br label %loopexit.5.i
-loopexit.5.i.loopexit3: ; preds = %loopentry.5.i
- br label %loopexit.5.i
-loopexit.5.i: ; preds = %loopexit.5.i.loopexit3, %loopexit.5.i.loopexit
- br i1 false, label %loopentry.5.outer.i, label %loopentry.7.i.loopexit
-loopentry.7.i.loopexit: ; preds = %loopexit.5.i
- br label %loopentry.7.i
-loopentry.7.i: ; preds = %loopentry.7.i.loopexit, %loopentry.4.i15
- br i1 false, label %no_exit.7.i.preheader, label %hamming.exit.i
-no_exit.7.i.preheader: ; preds = %loopentry.7.i
- br label %no_exit.7.i
-no_exit.7.i: ; preds = %no_exit.7.i, %no_exit.7.i.preheader
- br i1 false, label %no_exit.7.i, label %loopexit.7.i
-loopexit.7.i: ; preds = %no_exit.7.i
- br i1 false, label %no_exit.i.i.preheader, label %hamming.exit.i
-no_exit.i.i.preheader: ; preds = %loopexit.7.i
- br label %no_exit.i.i
-no_exit.i.i: ; preds = %no_exit.i.i, %no_exit.i.i.preheader
- br i1 false, label %no_exit.i.i, label %hamming.exit.i.loopexit
-hamming.exit.i.loopexit: ; preds = %no_exit.i.i
- br label %hamming.exit.i
-hamming.exit.i: ; preds = %hamming.exit.i.loopexit, %loopexit.7.i, %loopentry.7.i
- br i1 false, label %endif.3.i19, label %loopentry.8.i
-loopentry.8.i: ; preds = %hamming.exit.i
- br i1 false, label %shortcirc_next.i.preheader, label %loopexit.8.i
-shortcirc_next.i.preheader: ; preds = %loopentry.8.i
- br label %shortcirc_next.i
-shortcirc_next.i: ; preds = %no_exit.8.i, %shortcirc_next.i.preheader
- br i1 false, label %no_exit.8.i, label %loopexit.8.i.loopexit
-no_exit.8.i: ; preds = %shortcirc_next.i
- br i1 false, label %shortcirc_next.i, label %loopexit.8.i.loopexit
-loopexit.8.i.loopexit: ; preds = %no_exit.8.i, %shortcirc_next.i
- br label %loopexit.8.i
-loopexit.8.i: ; preds = %loopexit.8.i.loopexit, %loopentry.8.i
- br i1 false, label %no_exit.9.i.preheader, label %endif.3.i19
-no_exit.9.i.preheader: ; preds = %loopexit.8.i
- br label %no_exit.9.i
-no_exit.9.i: ; preds = %no_exit.9.i, %no_exit.9.i.preheader
- br i1 false, label %no_exit.9.i, label %endif.3.i19.loopexit
-endif.3.i19.loopexit: ; preds = %no_exit.9.i
- br label %endif.3.i19
-endif.3.i19: ; preds = %endif.3.i19.loopexit, %loopexit.8.i, %hamming.exit.i
- br i1 false, label %loopentry.2.i, label %loopexit.1.i20
-loopexit.1.i20: ; preds = %endif.3.i19
- br i1 false, label %then.4.i, label %UnifiedReturnBlock.i
-then.4.i: ; preds = %loopexit.1.i20
- br label %runcont.exit
-UnifiedReturnBlock.i: ; preds = %loopexit.1.i20
- br label %runcont.exit
-runcont.exit: ; preds = %UnifiedReturnBlock.i, %then.4.i
- br i1 false, label %no_exit.1.i36.preheader, label %loopentry.3.i37
-no_exit.1.i36.preheader: ; preds = %runcont.exit, %run.exit
- br label %no_exit.1.i36
-no_exit.1.i36: ; preds = %no_exit.1.i36, %no_exit.1.i36.preheader
- br i1 false, label %no_exit.1.i36, label %loopentry.3.i37.loopexit
-loopentry.3.i37.loopexit: ; preds = %no_exit.1.i36
- br label %loopentry.3.i37
-loopentry.3.i37: ; preds = %loopentry.3.i37.loopexit, %runcont.exit, %run.exit
- br i1 false, label %loopentry.4.i38.preheader, label %loopexit.3.i
-loopentry.4.i38.preheader: ; preds = %loopentry.3.i37
- br label %loopentry.4.i38
-loopentry.4.i38: ; preds = %loopexit.4.i42, %loopentry.4.i38.preheader
- br i1 false, label %no_exit.3.i.preheader, label %loopexit.4.i42
-no_exit.3.i.preheader: ; preds = %loopentry.4.i38
- br label %no_exit.3.i
-no_exit.3.i: ; preds = %no_exit.3.i.backedge, %no_exit.3.i.preheader
- br i1 false, label %endif.3.i, label %else.1.i
-else.1.i: ; preds = %no_exit.3.i
- br i1 false, label %no_exit.3.i.backedge, label %loopexit.4.i42.loopexit
-no_exit.3.i.backedge: ; preds = %endif.3.i, %else.1.i
- br label %no_exit.3.i
-endif.3.i: ; preds = %no_exit.3.i
- br i1 false, label %no_exit.3.i.backedge, label %loopexit.4.i42.loopexit
-loopexit.4.i42.loopexit: ; preds = %endif.3.i, %else.1.i
- br label %loopexit.4.i42
-loopexit.4.i42: ; preds = %loopexit.4.i42.loopexit, %loopentry.4.i38
- br i1 false, label %loopentry.4.i38, label %loopexit.3.i.loopexit
-loopexit.3.i.loopexit: ; preds = %loopexit.4.i42
- br label %loopexit.3.i
-loopexit.3.i: ; preds = %loopexit.3.i.loopexit, %loopentry.3.i37
- %tmp.13.i155 = icmp slt i32 0, 0 ; <i1> [#uses=1]
- br i1 %tmp.13.i155, label %no_exit.0.i31, label %loopentry.1.i30.loopexit
-}
diff --git a/release_23/test/Transforms/SimplifyCFG/2006-08-03-Crash.ll b/release_23/test/Transforms/SimplifyCFG/2006-08-03-Crash.ll
deleted file mode 100644
index 110a440e6649..000000000000
--- a/release_23/test/Transforms/SimplifyCFG/2006-08-03-Crash.ll
+++ /dev/null
@@ -1,98 +0,0 @@
-; RUN: llvm-as < %s | opt -load-vn -gcse -simplifycfg \
-; RUN: -disable-output
-; PR867
-; END.
-
-target datalayout = "E-p:32:32"
-target triple = "powerpc-apple-darwin8"
- %struct.CUMULATIVE_ARGS = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 }
- %struct.eh_status = type opaque
- %struct.emit_status = type { i32, i32, %struct.rtx_def*, %struct.rtx_def*, %struct.sequence_stack*, i32, %struct.location_t, i32, i8*, %struct.rtx_def** }
- %struct.expr_status = type { i32, i32, i32, %struct.rtx_def*, %struct.rtx_def*, %struct.rtx_def* }
- %struct.function = type { %struct.eh_status*, %struct.expr_status*, %struct.emit_status*, %struct.varasm_status*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.function*, i32, i32, i32, i32, %struct.rtx_def*, %struct.CUMULATIVE_ARGS, %struct.rtx_def*, %struct.rtx_def*, %struct.initial_value_struct*, %struct.rtx_def*, %struct.rtx_def*, %struct.rtx_def*, %struct.rtx_def*, %struct.rtx_def*, %struct.rtx_def*, i8, i32, i64, %struct.tree_node*, %struct.tree_node*, %struct.rtx_def*, %struct.varray_head_tag*, %struct.temp_slot*, i32, %struct.var_refs_queue*, i32, i32, %struct.rtvec_def*, %struct.tree_node*, i32, i32, i32, %struct.machine_function*, i32, i32, i8, i8, %struct.language_function*, %struct.rtx_def*, i32, i32, i32, i32, %struct.location_t, %struct.varray_head_tag*, %struct.tree_node*, i8, i8, i8 }
- %struct.initial_value_struct = type opaque
- %struct.lang_decl = type opaque
- %struct.lang_type = type opaque
- %struct.language_function = type opaque
- %struct.location_t = type { i8*, i32 }
- %struct.machine_function = type { i32, i32, i8*, i32, i32 }
- %struct.rtunion = type { i32 }
- %struct.rtvec_def = type { i32, [1 x %struct.rtx_def*] }
- %struct.rtx_def = type { i16, i8, i8, %struct.u }
- %struct.sequence_stack = type { %struct.rtx_def*, %struct.rtx_def*, %struct.sequence_stack* }
- %struct.temp_slot = type opaque
- %struct.tree_common = type { %struct.tree_node*, %struct.tree_node*, %union.tree_ann_d*, i8, i8, i8, i8, i8 }
- %struct.tree_decl = type { %struct.tree_common, %struct.location_t, i32, %struct.tree_node*, i8, i8, i8, i8, i8, i8, i8, i8, i32, %struct.tree_decl_u1, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.rtx_def*, %struct.tree_decl_u2, %struct.tree_node*, %struct.tree_node*, i64, %struct.lang_decl* }
- %struct.tree_decl_u1 = type { i64 }
- %struct.tree_decl_u2 = type { %struct.function* }
- %struct.tree_node = type { %struct.tree_decl }
- %struct.tree_type = type { %struct.tree_common, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, i32, i16, i8, i8, i32, %struct.tree_node*, %struct.tree_node*, %struct.rtunion, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, i64, %struct.lang_type* }
- %struct.u = type { [1 x i64] }
- %struct.var_refs_queue = type { %struct.rtx_def*, i32, i32, %struct.var_refs_queue* }
- %struct.varasm_status = type opaque
- %struct.varray_head_tag = type { i32, i32, i32, i8*, %struct.u }
- %union.tree_ann_d = type opaque
-@mode_class = external global [35 x i8] ; <[35 x i8]*> [#uses=3]
-
-define void @fold_builtin_classify() {
-entry:
- %tmp63 = load i32* null ; <i32> [#uses=1]
- switch i32 %tmp63, label %bb276 [
- i32 414, label %bb145
- i32 417, label %bb
- ]
-bb: ; preds = %entry
- ret void
-bb145: ; preds = %entry
- %tmp146 = load %struct.tree_node** null ; <%struct.tree_node*> [#uses=1]
- %tmp148 = getelementptr %struct.tree_node* %tmp146, i32 0, i32 0, i32 0, i32 1 ; <%struct.tree_node**> [#uses=1]
- %tmp149 = load %struct.tree_node** %tmp148 ; <%struct.tree_node*> [#uses=1]
- %tmp150 = bitcast %struct.tree_node* %tmp149 to %struct.tree_type* ; <%struct.tree_type*> [#uses=1]
- %tmp151 = getelementptr %struct.tree_type* %tmp150, i32 0, i32 6 ; <i16*> [#uses=1]
- %tmp151.upgrd.1 = bitcast i16* %tmp151 to i32* ; <i32*> [#uses=1]
- %tmp152 = load i32* %tmp151.upgrd.1 ; <i32> [#uses=1]
- %tmp154 = lshr i32 %tmp152, 16 ; <i32> [#uses=1]
- %tmp154.mask = and i32 %tmp154, 127 ; <i32> [#uses=1]
- %gep.upgrd.2 = zext i32 %tmp154.mask to i64 ; <i64> [#uses=1]
- %tmp155 = getelementptr [35 x i8]* @mode_class, i32 0, i64 %gep.upgrd.2 ; <i8*> [#uses=1]
- %tmp156 = load i8* %tmp155 ; <i8> [#uses=1]
- %tmp157 = icmp eq i8 %tmp156, 4 ; <i1> [#uses=1]
- br i1 %tmp157, label %cond_next241, label %cond_true158
-cond_true158: ; preds = %bb145
- %tmp172 = load %struct.tree_node** null ; <%struct.tree_node*> [#uses=1]
- %tmp174 = getelementptr %struct.tree_node* %tmp172, i32 0, i32 0, i32 0, i32 1 ; <%struct.tree_node**> [#uses=1]
- %tmp175 = load %struct.tree_node** %tmp174 ; <%struct.tree_node*> [#uses=1]
- %tmp176 = bitcast %struct.tree_node* %tmp175 to %struct.tree_type* ; <%struct.tree_type*> [#uses=1]
- %tmp177 = getelementptr %struct.tree_type* %tmp176, i32 0, i32 6 ; <i16*> [#uses=1]
- %tmp177.upgrd.3 = bitcast i16* %tmp177 to i32* ; <i32*> [#uses=1]
- %tmp178 = load i32* %tmp177.upgrd.3 ; <i32> [#uses=1]
- %tmp180 = lshr i32 %tmp178, 16 ; <i32> [#uses=1]
- %tmp180.mask = and i32 %tmp180, 127 ; <i32> [#uses=1]
- %gep.upgrd.4 = zext i32 %tmp180.mask to i64 ; <i64> [#uses=1]
- %tmp181 = getelementptr [35 x i8]* @mode_class, i32 0, i64 %gep.upgrd.4 ; <i8*> [#uses=1]
- %tmp182 = load i8* %tmp181 ; <i8> [#uses=1]
- %tmp183 = icmp eq i8 %tmp182, 8 ; <i1> [#uses=1]
- br i1 %tmp183, label %cond_next241, label %cond_true184
-cond_true184: ; preds = %cond_true158
- %tmp185 = load %struct.tree_node** null ; <%struct.tree_node*> [#uses=1]
- %tmp187 = getelementptr %struct.tree_node* %tmp185, i32 0, i32 0, i32 0, i32 1 ; <%struct.tree_node**> [#uses=1]
- %tmp188 = load %struct.tree_node** %tmp187 ; <%struct.tree_node*> [#uses=1]
- %tmp189 = bitcast %struct.tree_node* %tmp188 to %struct.tree_type* ; <%struct.tree_type*> [#uses=1]
- %tmp190 = getelementptr %struct.tree_type* %tmp189, i32 0, i32 6 ; <i16*> [#uses=1]
- %tmp190.upgrd.5 = bitcast i16* %tmp190 to i32* ; <i32*> [#uses=1]
- %tmp191 = load i32* %tmp190.upgrd.5 ; <i32> [#uses=1]
- %tmp193 = lshr i32 %tmp191, 16 ; <i32> [#uses=1]
- %tmp193.mask = and i32 %tmp193, 127 ; <i32> [#uses=1]
- %gep.upgrd.6 = zext i32 %tmp193.mask to i64 ; <i64> [#uses=1]
- %tmp194 = getelementptr [35 x i8]* @mode_class, i32 0, i64 %gep.upgrd.6 ; <i8*> [#uses=1]
- %tmp195 = load i8* %tmp194 ; <i8> [#uses=1]
- %tmp196 = icmp eq i8 %tmp195, 4 ; <i1> [#uses=1]
- br i1 %tmp196, label %cond_next241, label %cond_true197
-cond_true197: ; preds = %cond_true184
- ret void
-cond_next241: ; preds = %cond_true184, %cond_true158, %bb145
- %tmp245 = load i32* null ; <i32> [#uses=0]
- ret void
-bb276: ; preds = %entry
- ret void
-}
diff --git a/release_23/test/Transforms/SimplifyCFG/2006-10-19-UncondDiv.ll b/release_23/test/Transforms/SimplifyCFG/2006-10-19-UncondDiv.ll
deleted file mode 100644
index 7165c5bd29b4..000000000000
--- a/release_23/test/Transforms/SimplifyCFG/2006-10-19-UncondDiv.ll
+++ /dev/null
@@ -1,26 +0,0 @@
-; PR957
-; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis | \
-; RUN: not grep select
-
-define i32 @test(i32 %tmp) {
-cond_false179:
- %tmp181 = icmp eq i32 %tmp, 0 ; <i1> [#uses=1]
- br i1 %tmp181, label %cond_true182, label %cond_next185
-cond_true182: ; preds = %cond_false179
- br label %cond_next185
-cond_next185: ; preds = %cond_true182, %cond_false179
- %d0.3 = phi i32 [ udiv (i32 1, i32 0), %cond_true182 ], [ %tmp, %cond_false179 ] ; <i32> [#uses=1]
- ret i32 %d0.3
-}
-
-define i32 @test2(i32 %tmp) {
-cond_false179:
- %tmp181 = icmp eq i32 %tmp, 0 ; <i1> [#uses=1]
- br i1 %tmp181, label %cond_true182, label %cond_next185
-cond_true182: ; preds = %cond_false179
- br label %cond_next185
-cond_next185: ; preds = %cond_true182, %cond_false179
- %d0.3 = phi i32 [ udiv (i32 1, i32 0), %cond_true182 ], [ %tmp, %cond_false179 ] ; <i32> [#uses=1]
- call i32 @test( i32 4 ) ; <i32>:0 [#uses=0]
- ret i32 %d0.3
-}
diff --git a/release_23/test/Transforms/SimplifyCFG/2006-10-29-InvokeCrash.ll b/release_23/test/Transforms/SimplifyCFG/2006-10-29-InvokeCrash.ll
deleted file mode 100644
index f22ca6ca330a..000000000000
--- a/release_23/test/Transforms/SimplifyCFG/2006-10-29-InvokeCrash.ll
+++ /dev/null
@@ -1,555 +0,0 @@
-; RUN: llvm-as < %s | opt -simplifycfg -disable-output
-; END.
- %struct..4._102 = type { %struct.QVectorData* }
- %struct..5._125 = type { %struct.QMapData* }
- %struct.QAbstractTextDocumentLayout = type { %struct.QObject }
- %struct.QBasicAtomic = type { i32 }
- %struct.QFont = type { %struct.QFontPrivate*, i32 }
- %struct.QFontMetrics = type { %struct.QFontPrivate* }
- %struct.QFontPrivate = type opaque
- %"struct.QFragmentMap<QTextBlockData>" = type { %struct.QFragmentMapData }
- %struct.QFragmentMapData = type { %"struct.QFragmentMapData::._154", i32 }
- %"struct.QFragmentMapData::._154" = type { %"struct.QFragmentMapData::Header"* }
- %"struct.QFragmentMapData::Header" = type { i32, i32, i32, i32, i32, i32, i32, i32 }
- %"struct.QHash<uint,QHashDummyValue>" = type { %"struct.QHash<uint,QHashDummyValue>::._152" }
- %"struct.QHash<uint,QHashDummyValue>::._152" = type { %struct.QHashData* }
- %struct.QHashData = type { %"struct.QHashData::Node"*, %"struct.QHashData::Node"**, %struct.QBasicAtomic, i32, i32, i16, i16, i32, i8 }
- %"struct.QHashData::Node" = type { %"struct.QHashData::Node"*, i32 }
- %"struct.QList<QObject*>::._92" = type { %struct.QListData }
- %"struct.QList<QPointer<QObject> >" = type { %"struct.QList<QObject*>::._92" }
- %struct.QListData = type { %"struct.QListData::Data"* }
- %"struct.QListData::Data" = type { %struct.QBasicAtomic, i32, i32, i32, i8, [1 x i8*] }
- %"struct.QMap<QUrl,QVariant>" = type { %struct..5._125 }
- %struct.QMapData = type { %"struct.QMapData::Node"*, [12 x %"struct.QMapData::Node"*], %struct.QBasicAtomic, i32, i32, i32, i8 }
- %"struct.QMapData::Node" = type { %"struct.QMapData::Node"*, [1 x %"struct.QMapData::Node"*] }
- %struct.QObject = type { i32 (...)**, %struct.QObjectData* }
- %struct.QObjectData = type { i32 (...)**, %struct.QObject*, %struct.QObject*, %"struct.QList<QPointer<QObject> >", i8, [3 x i8], i32, i32 }
- %struct.QObjectPrivate = type { %struct.QObjectData, i32, %struct.QObject*, %"struct.QList<QPointer<QObject> >", %"struct.QVector<QAbstractTextDocumentLayout::Selection>", %struct.QString }
- %struct.QPaintDevice = type { i32 (...)**, i16 }
- %struct.QPainter = type { %struct.QPainterPrivate* }
- %struct.QPainterPrivate = type opaque
- %struct.QPointF = type { double, double }
- %struct.QPrinter = type { %struct.QPaintDevice, %struct.QPrinterPrivate* }
- %struct.QPrinterPrivate = type opaque
- %struct.QRectF = type { double, double, double, double }
- %"struct.QSet<uint>" = type { %"struct.QHash<uint,QHashDummyValue>" }
- %"struct.QSharedDataPointer<QTextFormatPrivate>" = type { %struct.QTextFormatPrivate* }
- %struct.QString = type { %"struct.QString::Data"* }
- %"struct.QString::Data" = type { %struct.QBasicAtomic, i32, i32, i16*, i8, i8, [1 x i16] }
- %struct.QTextBlockFormat = type { %struct.QTextFormat }
- %struct.QTextBlockGroup = type { %struct.QAbstractTextDocumentLayout }
- %struct.QTextDocumentConfig = type { %struct.QString }
- %struct.QTextDocumentPrivate = type { %struct.QObjectPrivate, %struct.QString, %"struct.QVector<QAbstractTextDocumentLayout::Selection>", i1, i32, i32, i1, i32, i32, i32, i32, i1, %struct.QTextFormatCollection, %struct.QTextBlockGroup*, %struct.QAbstractTextDocumentLayout*, %"struct.QFragmentMap<QTextBlockData>", %"struct.QFragmentMap<QTextBlockData>", i32, %"struct.QList<QPointer<QObject> >", %"struct.QList<QPointer<QObject> >", %"struct.QMap<QUrl,QVariant>", %"struct.QMap<QUrl,QVariant>", %"struct.QMap<QUrl,QVariant>", %struct.QTextDocumentConfig, i1, i1, %struct.QPointF }
- %struct.QTextFormat = type { %"struct.QSharedDataPointer<QTextFormatPrivate>", i32 }
- %struct.QTextFormatCollection = type { %"struct.QVector<QAbstractTextDocumentLayout::Selection>", %"struct.QVector<QAbstractTextDocumentLayout::Selection>", %"struct.QSet<uint>", %struct.QFont }
- %struct.QTextFormatPrivate = type opaque
- %"struct.QVector<QAbstractTextDocumentLayout::Selection>" = type { %struct..4._102 }
- %struct.QVectorData = type { %struct.QBasicAtomic, i32, i32, i8 }
-
-define void @_ZNK13QTextDocument5printEP8QPrinter(%struct.QAbstractTextDocumentLayout* %this, %struct.QPrinter* %printer) {
-entry:
- %tmp = alloca %struct.QPointF, align 16 ; <%struct.QPointF*> [#uses=2]
- %tmp.upgrd.1 = alloca %struct.QRectF, align 16 ; <%struct.QRectF*> [#uses=5]
- %tmp2 = alloca %struct.QPointF, align 16 ; <%struct.QPointF*> [#uses=3]
- %tmp.upgrd.2 = alloca %struct.QFontMetrics, align 16 ; <%struct.QFontMetrics*> [#uses=4]
- %tmp.upgrd.3 = alloca %struct.QFont, align 16 ; <%struct.QFont*> [#uses=4]
- %tmp3 = alloca %struct.QPointF, align 16 ; <%struct.QPointF*> [#uses=2]
- %p = alloca %struct.QPainter, align 16 ; <%struct.QPainter*> [#uses=14]
- %body = alloca %struct.QRectF, align 16 ; <%struct.QRectF*> [#uses=9]
- %pageNumberPos = alloca %struct.QPointF, align 16 ; <%struct.QPointF*> [#uses=4]
- %scaledPageSize = alloca %struct.QPointF, align 16 ; <%struct.QPointF*> [#uses=6]
- %printerPageSize = alloca %struct.QPointF, align 16 ; <%struct.QPointF*> [#uses=3]
- %fmt = alloca %struct.QTextBlockFormat, align 16 ; <%struct.QTextBlockFormat*> [#uses=5]
- %font = alloca %struct.QFont, align 16 ; <%struct.QFont*> [#uses=5]
- %tmp.upgrd.4 = call %struct.QTextDocumentPrivate* @_ZNK13QTextDocument6d_funcEv( %struct.QAbstractTextDocumentLayout* %this ) ; <%struct.QTextDocumentPrivate*> [#uses=5]
- %tmp.upgrd.5 = getelementptr %struct.QPrinter* %printer, i32 0, i32 0 ; <%struct.QPaintDevice*> [#uses=1]
- call void @_ZN8QPainterC1EP12QPaintDevice( %struct.QPainter* %p, %struct.QPaintDevice* %tmp.upgrd.5 )
- %tmp.upgrd.6 = invoke i1 @_ZNK8QPainter8isActiveEv( %struct.QPainter* %p )
- to label %invcont unwind label %cleanup329 ; <i1> [#uses=1]
-invcont: ; preds = %entry
- br i1 %tmp.upgrd.6, label %cond_next, label %cleanup328
-cond_next: ; preds = %invcont
- %tmp8 = invoke %struct.QAbstractTextDocumentLayout* @_ZNK13QTextDocument14documentLayoutEv( %struct.QAbstractTextDocumentLayout* %this )
- to label %invcont7 unwind label %cleanup329 ; <%struct.QAbstractTextDocumentLayout*> [#uses=0]
-invcont7: ; preds = %cond_next
- %tmp10 = getelementptr %struct.QTextDocumentPrivate* %tmp.upgrd.4, i32 0, i32 26 ; <%struct.QPointF*> [#uses=1]
- call void @_ZN7QPointFC1Edd( %struct.QPointF* %tmp, double 0.000000e+00, double 0.000000e+00 )
- call void @_ZN6QRectFC1ERK7QPointFRK6QSizeF( %struct.QRectF* %body, %struct.QPointF* %tmp, %struct.QPointF* %tmp10 )
- call void @_ZN7QPointFC1Ev( %struct.QPointF* %pageNumberPos )
- %tmp12 = getelementptr %struct.QTextDocumentPrivate* %tmp.upgrd.4, i32 0, i32 26 ; <%struct.QPointF*> [#uses=1]
- %tmp13 = call i1 @_ZNK6QSizeF7isValidEv( %struct.QPointF* %tmp12 ) ; <i1> [#uses=1]
- br i1 %tmp13, label %cond_next15, label %bb
-cond_next15: ; preds = %invcont7
- %tmp17 = getelementptr %struct.QTextDocumentPrivate* %tmp.upgrd.4, i32 0, i32 26 ; <%struct.QPointF*> [#uses=1]
- %tmp.upgrd.7 = call double @_ZNK6QSizeF6heightEv( %struct.QPointF* %tmp17 ) ; <double> [#uses=1]
- %tmp18 = fcmp oeq double %tmp.upgrd.7, 0x41DFFFFFFFC00000 ; <i1> [#uses=1]
- br i1 %tmp18, label %bb, label %cond_next20
-cond_next20: ; preds = %cond_next15
- br label %bb21
-bb: ; preds = %cond_next15, %invcont7
- br label %bb21
-bb21: ; preds = %bb, %cond_next20
- %iftmp.406.0 = phi i1 [ false, %bb ], [ true, %cond_next20 ] ; <i1> [#uses=1]
- br i1 %iftmp.406.0, label %cond_true24, label %cond_false
-cond_true24: ; preds = %bb21
- %tmp.upgrd.8 = invoke i32 @_Z13qt_defaultDpiv( )
- to label %invcont25 unwind label %cleanup329 ; <i32> [#uses=1]
-invcont25: ; preds = %cond_true24
- %tmp26 = sitofp i32 %tmp.upgrd.8 to double ; <double> [#uses=2]
- %tmp30 = invoke %struct.QAbstractTextDocumentLayout* @_ZNK13QTextDocument14documentLayoutEv( %struct.QAbstractTextDocumentLayout* %this )
- to label %invcont29 unwind label %cleanup329 ; <%struct.QAbstractTextDocumentLayout*> [#uses=1]
-invcont29: ; preds = %invcont25
- %tmp32 = invoke %struct.QPaintDevice* @_ZNK27QAbstractTextDocumentLayout11paintDeviceEv( %struct.QAbstractTextDocumentLayout* %tmp30 )
- to label %invcont31 unwind label %cleanup329 ; <%struct.QPaintDevice*> [#uses=3]
-invcont31: ; preds = %invcont29
- %tmp34 = icmp eq %struct.QPaintDevice* %tmp32, null ; <i1> [#uses=1]
- br i1 %tmp34, label %cond_next42, label %cond_true35
-cond_true35: ; preds = %invcont31
- %tmp38 = invoke i32 @_ZNK12QPaintDevice11logicalDpiXEv( %struct.QPaintDevice* %tmp32 )
- to label %invcont37 unwind label %cleanup329 ; <i32> [#uses=1]
-invcont37: ; preds = %cond_true35
- %tmp38.upgrd.9 = sitofp i32 %tmp38 to double ; <double> [#uses=1]
- %tmp41 = invoke i32 @_ZNK12QPaintDevice11logicalDpiYEv( %struct.QPaintDevice* %tmp32 )
- to label %invcont40 unwind label %cleanup329 ; <i32> [#uses=1]
-invcont40: ; preds = %invcont37
- %tmp41.upgrd.10 = sitofp i32 %tmp41 to double ; <double> [#uses=1]
- br label %cond_next42
-cond_next42: ; preds = %invcont40, %invcont31
- %sourceDpiY.2 = phi double [ %tmp41.upgrd.10, %invcont40 ], [ %tmp26, %invcont31 ] ; <double> [#uses=1]
- %sourceDpiX.2 = phi double [ %tmp38.upgrd.9, %invcont40 ], [ %tmp26, %invcont31 ] ; <double> [#uses=1]
- %tmp44 = getelementptr %struct.QPrinter* %printer, i32 0, i32 0 ; <%struct.QPaintDevice*> [#uses=1]
- %tmp46 = invoke i32 @_ZNK12QPaintDevice11logicalDpiXEv( %struct.QPaintDevice* %tmp44 )
- to label %invcont45 unwind label %cleanup329 ; <i32> [#uses=1]
-invcont45: ; preds = %cond_next42
- %tmp46.upgrd.11 = sitofp i32 %tmp46 to double ; <double> [#uses=1]
- %tmp48 = fdiv double %tmp46.upgrd.11, %sourceDpiX.2 ; <double> [#uses=2]
- %tmp50 = getelementptr %struct.QPrinter* %printer, i32 0, i32 0 ; <%struct.QPaintDevice*> [#uses=1]
- %tmp52 = invoke i32 @_ZNK12QPaintDevice11logicalDpiYEv( %struct.QPaintDevice* %tmp50 )
- to label %invcont51 unwind label %cleanup329 ; <i32> [#uses=1]
-invcont51: ; preds = %invcont45
- %tmp52.upgrd.12 = sitofp i32 %tmp52 to double ; <double> [#uses=1]
- %tmp54 = fdiv double %tmp52.upgrd.12, %sourceDpiY.2 ; <double> [#uses=2]
- invoke void @_ZN8QPainter5scaleEdd( %struct.QPainter* %p, double %tmp48, double %tmp54 )
- to label %invcont57 unwind label %cleanup329
-invcont57: ; preds = %invcont51
- %tmp.upgrd.13 = getelementptr %struct.QPointF* %scaledPageSize, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp60 = getelementptr %struct.QTextDocumentPrivate* %tmp.upgrd.4, i32 0, i32 26, i32 0 ; <double*> [#uses=1]
- %tmp61 = load double* %tmp60 ; <double> [#uses=1]
- store double %tmp61, double* %tmp.upgrd.13
- %tmp62 = getelementptr %struct.QPointF* %scaledPageSize, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp63 = getelementptr %struct.QTextDocumentPrivate* %tmp.upgrd.4, i32 0, i32 26, i32 1 ; <double*> [#uses=1]
- %tmp64 = load double* %tmp63 ; <double> [#uses=1]
- store double %tmp64, double* %tmp62
- %tmp65 = call double* @_ZN6QSizeF6rwidthEv( %struct.QPointF* %scaledPageSize ) ; <double*> [#uses=2]
- %tmp67 = load double* %tmp65 ; <double> [#uses=1]
- %tmp69 = mul double %tmp67, %tmp48 ; <double> [#uses=1]
- store double %tmp69, double* %tmp65
- %tmp71 = call double* @_ZN6QSizeF7rheightEv( %struct.QPointF* %scaledPageSize ) ; <double*> [#uses=2]
- %tmp73 = load double* %tmp71 ; <double> [#uses=1]
- %tmp75 = mul double %tmp73, %tmp54 ; <double> [#uses=1]
- store double %tmp75, double* %tmp71
- %tmp78 = getelementptr %struct.QPrinter* %printer, i32 0, i32 0 ; <%struct.QPaintDevice*> [#uses=1]
- %tmp80 = invoke i32 @_ZNK12QPaintDevice6heightEv( %struct.QPaintDevice* %tmp78 )
- to label %invcont79 unwind label %cleanup329 ; <i32> [#uses=1]
-invcont79: ; preds = %invcont57
- %tmp82 = getelementptr %struct.QPrinter* %printer, i32 0, i32 0 ; <%struct.QPaintDevice*> [#uses=1]
- %tmp84 = invoke i32 @_ZNK12QPaintDevice5widthEv( %struct.QPaintDevice* %tmp82 )
- to label %invcont83 unwind label %cleanup329 ; <i32> [#uses=1]
-invcont83: ; preds = %invcont79
- %tmp80.upgrd.14 = sitofp i32 %tmp80 to double ; <double> [#uses=1]
- %tmp84.upgrd.15 = sitofp i32 %tmp84 to double ; <double> [#uses=1]
- call void @_ZN6QSizeFC1Edd( %struct.QPointF* %printerPageSize, double %tmp84.upgrd.15, double %tmp80.upgrd.14 )
- %tmp85 = call double @_ZNK6QSizeF6heightEv( %struct.QPointF* %printerPageSize ) ; <double> [#uses=1]
- %tmp86 = call double @_ZNK6QSizeF6heightEv( %struct.QPointF* %scaledPageSize ) ; <double> [#uses=1]
- %tmp87 = fdiv double %tmp85, %tmp86 ; <double> [#uses=1]
- %tmp88 = call double @_ZNK6QSizeF5widthEv( %struct.QPointF* %printerPageSize ) ; <double> [#uses=1]
- %tmp89 = call double @_ZNK6QSizeF5widthEv( %struct.QPointF* %scaledPageSize ) ; <double> [#uses=1]
- %tmp90 = fdiv double %tmp88, %tmp89 ; <double> [#uses=1]
- invoke void @_ZN8QPainter5scaleEdd( %struct.QPainter* %p, double %tmp90, double %tmp87 )
- to label %cond_next194 unwind label %cleanup329
-cond_false: ; preds = %bb21
- %tmp.upgrd.16 = getelementptr %struct.QAbstractTextDocumentLayout* %this, i32 0, i32 0 ; <%struct.QObject*> [#uses=1]
- %tmp95 = invoke %struct.QAbstractTextDocumentLayout* @_ZNK13QTextDocument5cloneEP7QObject( %struct.QAbstractTextDocumentLayout* %this, %struct.QObject* %tmp.upgrd.16 )
- to label %invcont94 unwind label %cleanup329 ; <%struct.QAbstractTextDocumentLayout*> [#uses=9]
-invcont94: ; preds = %cond_false
- %tmp99 = invoke %struct.QAbstractTextDocumentLayout* @_ZNK13QTextDocument14documentLayoutEv( %struct.QAbstractTextDocumentLayout* %tmp95 )
- to label %invcont98 unwind label %cleanup329 ; <%struct.QAbstractTextDocumentLayout*> [#uses=1]
-invcont98: ; preds = %invcont94
- %tmp101 = invoke %struct.QPaintDevice* @_ZNK8QPainter6deviceEv( %struct.QPainter* %p )
- to label %invcont100 unwind label %cleanup329 ; <%struct.QPaintDevice*> [#uses=1]
-invcont100: ; preds = %invcont98
- invoke void @_ZN27QAbstractTextDocumentLayout14setPaintDeviceEP12QPaintDevice( %struct.QAbstractTextDocumentLayout* %tmp99, %struct.QPaintDevice* %tmp101 )
- to label %invcont103 unwind label %cleanup329
-invcont103: ; preds = %invcont100
- %tmp105 = invoke %struct.QPaintDevice* @_ZNK8QPainter6deviceEv( %struct.QPainter* %p )
- to label %invcont104 unwind label %cleanup329 ; <%struct.QPaintDevice*> [#uses=1]
-invcont104: ; preds = %invcont103
- %tmp107 = invoke i32 @_ZNK12QPaintDevice11logicalDpiYEv( %struct.QPaintDevice* %tmp105 )
- to label %invcont106 unwind label %cleanup329 ; <i32> [#uses=1]
-invcont106: ; preds = %invcont104
- %tmp108 = sitofp i32 %tmp107 to double ; <double> [#uses=1]
- %tmp109 = mul double %tmp108, 0x3FE93264C993264C ; <double> [#uses=1]
- %tmp109.upgrd.17 = fptosi double %tmp109 to i32 ; <i32> [#uses=3]
- %tmp.upgrd.18 = call %struct.QTextBlockGroup* @_ZNK13QTextDocument9rootFrameEv( %struct.QAbstractTextDocumentLayout* %tmp95 ) ; <%struct.QTextBlockGroup*> [#uses=1]
- invoke void @_ZNK10QTextFrame11frameFormatEv( %struct.QTextBlockFormat* sret %fmt, %struct.QTextBlockGroup* %tmp.upgrd.18 )
- to label %invcont111 unwind label %cleanup329
-invcont111: ; preds = %invcont106
- %tmp112 = sitofp i32 %tmp109.upgrd.17 to double ; <double> [#uses=1]
- invoke void @_ZN16QTextFrameFormat9setMarginEd( %struct.QTextBlockFormat* %fmt, double %tmp112 )
- to label %invcont114 unwind label %cleanup192
-invcont114: ; preds = %invcont111
- %tmp116 = call %struct.QTextBlockGroup* @_ZNK13QTextDocument9rootFrameEv( %struct.QAbstractTextDocumentLayout* %tmp95 ) ; <%struct.QTextBlockGroup*> [#uses=1]
- invoke void @_ZN10QTextFrame14setFrameFormatERK16QTextFrameFormat( %struct.QTextBlockGroup* %tmp116, %struct.QTextBlockFormat* %fmt )
- to label %invcont117 unwind label %cleanup192
-invcont117: ; preds = %invcont114
- %tmp119 = invoke %struct.QPaintDevice* @_ZNK8QPainter6deviceEv( %struct.QPainter* %p )
- to label %invcont118 unwind label %cleanup192 ; <%struct.QPaintDevice*> [#uses=1]
-invcont118: ; preds = %invcont117
- %tmp121 = invoke i32 @_ZNK12QPaintDevice6heightEv( %struct.QPaintDevice* %tmp119 )
- to label %invcont120 unwind label %cleanup192 ; <i32> [#uses=1]
-invcont120: ; preds = %invcont118
- %tmp121.upgrd.19 = sitofp i32 %tmp121 to double ; <double> [#uses=1]
- %tmp123 = invoke %struct.QPaintDevice* @_ZNK8QPainter6deviceEv( %struct.QPainter* %p )
- to label %invcont122 unwind label %cleanup192 ; <%struct.QPaintDevice*> [#uses=1]
-invcont122: ; preds = %invcont120
- %tmp125 = invoke i32 @_ZNK12QPaintDevice5widthEv( %struct.QPaintDevice* %tmp123 )
- to label %invcont124 unwind label %cleanup192 ; <i32> [#uses=1]
-invcont124: ; preds = %invcont122
- %tmp125.upgrd.20 = sitofp i32 %tmp125 to double ; <double> [#uses=1]
- call void @_ZN6QRectFC1Edddd( %struct.QRectF* %tmp.upgrd.1, double 0.000000e+00, double 0.000000e+00, double %tmp125.upgrd.20, double %tmp121.upgrd.19 )
- %tmp126 = getelementptr %struct.QRectF* %body, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp127 = getelementptr %struct.QRectF* %tmp.upgrd.1, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp128 = load double* %tmp127 ; <double> [#uses=1]
- store double %tmp128, double* %tmp126
- %tmp129 = getelementptr %struct.QRectF* %body, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp130 = getelementptr %struct.QRectF* %tmp.upgrd.1, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp131 = load double* %tmp130 ; <double> [#uses=1]
- store double %tmp131, double* %tmp129
- %tmp132 = getelementptr %struct.QRectF* %body, i32 0, i32 2 ; <double*> [#uses=1]
- %tmp133 = getelementptr %struct.QRectF* %tmp.upgrd.1, i32 0, i32 2 ; <double*> [#uses=1]
- %tmp134 = load double* %tmp133 ; <double> [#uses=1]
- store double %tmp134, double* %tmp132
- %tmp135 = getelementptr %struct.QRectF* %body, i32 0, i32 3 ; <double*> [#uses=1]
- %tmp136 = getelementptr %struct.QRectF* %tmp.upgrd.1, i32 0, i32 3 ; <double*> [#uses=1]
- %tmp137 = load double* %tmp136 ; <double> [#uses=1]
- store double %tmp137, double* %tmp135
- %tmp138 = call double @_ZNK6QRectF6heightEv( %struct.QRectF* %body ) ; <double> [#uses=1]
- %tmp139 = sitofp i32 %tmp109.upgrd.17 to double ; <double> [#uses=1]
- %tmp140 = sub double %tmp138, %tmp139 ; <double> [#uses=1]
- %tmp142 = invoke %struct.QPaintDevice* @_ZNK8QPainter6deviceEv( %struct.QPainter* %p )
- to label %invcont141 unwind label %cleanup192 ; <%struct.QPaintDevice*> [#uses=1]
-invcont141: ; preds = %invcont124
- invoke void @_ZNK13QTextDocument11defaultFontEv( %struct.QFont* sret %tmp.upgrd.3, %struct.QAbstractTextDocumentLayout* %tmp95 )
- to label %invcont144 unwind label %cleanup192
-invcont144: ; preds = %invcont141
- invoke void @_ZN12QFontMetricsC1ERK5QFontP12QPaintDevice( %struct.QFontMetrics* %tmp.upgrd.2, %struct.QFont* %tmp.upgrd.3, %struct.QPaintDevice* %tmp142 )
- to label %invcont146 unwind label %cleanup173
-invcont146: ; preds = %invcont144
- %tmp149 = invoke i32 @_ZNK12QFontMetrics6ascentEv( %struct.QFontMetrics* %tmp.upgrd.2 )
- to label %invcont148 unwind label %cleanup168 ; <i32> [#uses=1]
-invcont148: ; preds = %invcont146
- %tmp149.upgrd.21 = sitofp i32 %tmp149 to double ; <double> [#uses=1]
- %tmp150 = add double %tmp140, %tmp149.upgrd.21 ; <double> [#uses=1]
- %tmp152 = invoke %struct.QPaintDevice* @_ZNK8QPainter6deviceEv( %struct.QPainter* %p )
- to label %invcont151 unwind label %cleanup168 ; <%struct.QPaintDevice*> [#uses=1]
-invcont151: ; preds = %invcont148
- %tmp154 = invoke i32 @_ZNK12QPaintDevice11logicalDpiYEv( %struct.QPaintDevice* %tmp152 )
- to label %invcont153 unwind label %cleanup168 ; <i32> [#uses=1]
-invcont153: ; preds = %invcont151
- %tmp155 = mul i32 %tmp154, 5 ; <i32> [#uses=1]
- %tmp156 = sdiv i32 %tmp155, 72 ; <i32> [#uses=1]
- %tmp156.upgrd.22 = sitofp i32 %tmp156 to double ; <double> [#uses=1]
- %tmp157 = add double %tmp150, %tmp156.upgrd.22 ; <double> [#uses=1]
- %tmp158 = call double @_ZNK6QRectF5widthEv( %struct.QRectF* %body ) ; <double> [#uses=1]
- %tmp159 = sitofp i32 %tmp109.upgrd.17 to double ; <double> [#uses=1]
- %tmp160 = sub double %tmp158, %tmp159 ; <double> [#uses=1]
- call void @_ZN7QPointFC1Edd( %struct.QPointF* %tmp2, double %tmp160, double %tmp157 )
- %tmp161 = getelementptr %struct.QPointF* %pageNumberPos, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp162 = getelementptr %struct.QPointF* %tmp2, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp163 = load double* %tmp162 ; <double> [#uses=1]
- store double %tmp163, double* %tmp161
- %tmp164 = getelementptr %struct.QPointF* %pageNumberPos, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp165 = getelementptr %struct.QPointF* %tmp2, i32 0, i32 1 ; <double*> [#uses=1]
- %tmp166 = load double* %tmp165 ; <double> [#uses=1]
- store double %tmp166, double* %tmp164
- invoke void @_ZN12QFontMetricsD1Ev( %struct.QFontMetrics* %tmp.upgrd.2 )
- to label %cleanup171 unwind label %cleanup173
-cleanup168: ; preds = %invcont151, %invcont148, %invcont146
- invoke void @_ZN12QFontMetricsD1Ev( %struct.QFontMetrics* %tmp.upgrd.2 )
- to label %cleanup173 unwind label %cleanup173
-cleanup171: ; preds = %invcont153
- invoke void @_ZN5QFontD1Ev( %struct.QFont* %tmp.upgrd.3 )
- to label %finally170 unwind label %cleanup192
-cleanup173: ; preds = %cleanup168, %cleanup168, %invcont153, %invcont144
- invoke void @_ZN5QFontD1Ev( %struct.QFont* %tmp.upgrd.3 )
- to label %cleanup192 unwind label %cleanup192
-finally170: ; preds = %cleanup171
- invoke void @_ZNK13QTextDocument11defaultFontEv( %struct.QFont* sret %font, %struct.QAbstractTextDocumentLayout* %tmp95 )
- to label %invcont177 unwind label %cleanup192
-invcont177: ; preds = %finally170
- invoke void @_ZN5QFont12setPointSizeEi( %struct.QFont* %font, i32 10 )
- to label %invcont179 unwind label %cleanup187
-invcont179: ; preds = %invcont177
- invoke void @_ZN13QTextDocument14setDefaultFontERK5QFont( %struct.QAbstractTextDocumentLayout* %tmp95, %struct.QFont* %font )
- to label %invcont181 unwind label %cleanup187
-invcont181: ; preds = %invcont179
- call void @_ZNK6QRectF4sizeEv( %struct.QPointF* sret %tmp3, %struct.QRectF* %body )
- invoke void @_ZN13QTextDocument11setPageSizeERK6QSizeF( %struct.QAbstractTextDocumentLayout* %tmp95, %struct.QPointF* %tmp3 )
- to label %cleanup185 unwind label %cleanup187
-cleanup185: ; preds = %invcont181
- invoke void @_ZN5QFontD1Ev( %struct.QFont* %font )
- to label %cleanup190 unwind label %cleanup192
-cleanup187: ; preds = %invcont181, %invcont179, %invcont177
- invoke void @_ZN5QFontD1Ev( %struct.QFont* %font )
- to label %cleanup192 unwind label %cleanup192
-cleanup190: ; preds = %cleanup185
- invoke void @_ZN16QTextFrameFormatD1Ev( %struct.QTextBlockFormat* %fmt )
- to label %cond_next194 unwind label %cleanup329
-cleanup192: ; preds = %cleanup187, %cleanup187, %cleanup185, %finally170, %cleanup173, %cleanup173, %cleanup171, %invcont141, %invcont124, %invcont122, %invcont120, %invcont118, %invcont117, %invcont114, %invcont111
- invoke void @_ZN16QTextFrameFormatD1Ev( %struct.QTextBlockFormat* %fmt )
- to label %cleanup329 unwind label %cleanup329
-cond_next194: ; preds = %cleanup190, %invcont83
- %clonedDoc.1 = phi %struct.QAbstractTextDocumentLayout* [ null, %invcont83 ], [ %tmp95, %cleanup190 ] ; <%struct.QAbstractTextDocumentLayout*> [#uses=3]
- %doc.1 = phi %struct.QAbstractTextDocumentLayout* [ %this, %invcont83 ], [ %tmp95, %cleanup190 ] ; <%struct.QAbstractTextDocumentLayout*> [#uses=2]
- %tmp197 = invoke i1 @_ZNK8QPrinter13collateCopiesEv( %struct.QPrinter* %printer )
- to label %invcont196 unwind label %cleanup329 ; <i1> [#uses=1]
-invcont196: ; preds = %cond_next194
- br i1 %tmp197, label %cond_true200, label %cond_false204
-cond_true200: ; preds = %invcont196
- %tmp203 = invoke i32 @_ZNK8QPrinter9numCopiesEv( %struct.QPrinter* %printer )
- to label %invcont202 unwind label %cleanup329 ; <i32> [#uses=1]
-invcont202: ; preds = %cond_true200
- br label %cond_next208
-cond_false204: ; preds = %invcont196
- %tmp207 = invoke i32 @_ZNK8QPrinter9numCopiesEv( %struct.QPrinter* %printer )
- to label %invcont206 unwind label %cleanup329 ; <i32> [#uses=1]
-invcont206: ; preds = %cond_false204
- br label %cond_next208
-cond_next208: ; preds = %invcont206, %invcont202
- %pageCopies.0 = phi i32 [ %tmp203, %invcont202 ], [ 1, %invcont206 ] ; <i32> [#uses=2]
- %docCopies.0 = phi i32 [ 1, %invcont202 ], [ %tmp207, %invcont206 ] ; <i32> [#uses=2]
- %tmp211 = invoke i32 @_ZNK8QPrinter8fromPageEv( %struct.QPrinter* %printer )
- to label %invcont210 unwind label %cleanup329 ; <i32> [#uses=3]
-invcont210: ; preds = %cond_next208
- %tmp214 = invoke i32 @_ZNK8QPrinter6toPageEv( %struct.QPrinter* %printer )
- to label %invcont213 unwind label %cleanup329 ; <i32> [#uses=3]
-invcont213: ; preds = %invcont210
- %tmp216 = icmp eq i32 %tmp211, 0 ; <i1> [#uses=1]
- br i1 %tmp216, label %cond_true217, label %cond_next225
-cond_true217: ; preds = %invcont213
- %tmp219 = icmp eq i32 %tmp214, 0 ; <i1> [#uses=1]
- br i1 %tmp219, label %cond_true220, label %cond_next225
-cond_true220: ; preds = %cond_true217
- %tmp223 = invoke i32 @_ZNK13QTextDocument9pageCountEv( %struct.QAbstractTextDocumentLayout* %doc.1 )
- to label %invcont222 unwind label %cleanup329 ; <i32> [#uses=1]
-invcont222: ; preds = %cond_true220
- br label %cond_next225
-cond_next225: ; preds = %invcont222, %cond_true217, %invcont213
- %toPage.1 = phi i32 [ %tmp223, %invcont222 ], [ %tmp214, %cond_true217 ], [ %tmp214, %invcont213 ] ; <i32> [#uses=2]
- %fromPage.1 = phi i32 [ 1, %invcont222 ], [ %tmp211, %cond_true217 ], [ %tmp211, %invcont213 ] ; <i32> [#uses=2]
- %tmp.page = invoke i32 @_ZNK8QPrinter9pageOrderEv( %struct.QPrinter* %printer )
- to label %invcont227 unwind label %cleanup329 ; <i32> [#uses=1]
-invcont227: ; preds = %cond_next225
- %tmp228 = icmp eq i32 %tmp.page, 1 ; <i1> [#uses=1]
- br i1 %tmp228, label %cond_true230, label %cond_next234
-cond_true230: ; preds = %invcont227
- br label %cond_next234
-cond_next234: ; preds = %cond_true230, %invcont227
- %ascending.1 = phi i1 [ false, %cond_true230 ], [ true, %invcont227 ] ; <i1> [#uses=1]
- %toPage.2 = phi i32 [ %fromPage.1, %cond_true230 ], [ %toPage.1, %invcont227 ] ; <i32> [#uses=1]
- %fromPage.2 = phi i32 [ %toPage.1, %cond_true230 ], [ %fromPage.1, %invcont227 ] ; <i32> [#uses=1]
- br label %bb309
-bb237: ; preds = %cond_true313, %cond_next293
- %iftmp.410.4 = phi i1 [ %iftmp.410.5, %cond_true313 ], [ %iftmp.410.1, %cond_next293 ] ; <i1> [#uses=1]
- %page.4 = phi i32 [ %fromPage.2, %cond_true313 ], [ %page.3, %cond_next293 ] ; <i32> [#uses=4]
- br label %bb273
-invcont240: ; preds = %cond_true277
- %tmp242 = icmp eq i32 %tmp241, 2 ; <i1> [#uses=1]
- br i1 %tmp242, label %bb252, label %cond_next244
-cond_next244: ; preds = %invcont240
- %tmp247 = invoke i32 @_ZNK8QPrinter12printerStateEv( %struct.QPrinter* %printer )
- to label %invcont246 unwind label %cleanup329 ; <i32> [#uses=1]
-invcont246: ; preds = %cond_next244
- %tmp248 = icmp eq i32 %tmp247, 3 ; <i1> [#uses=1]
- br i1 %tmp248, label %bb252, label %bb253
-bb252: ; preds = %invcont246, %invcont240
- br label %bb254
-bb253: ; preds = %invcont246
- br label %bb254
-bb254: ; preds = %bb253, %bb252
- %iftmp.410.0 = phi i1 [ true, %bb252 ], [ false, %bb253 ] ; <i1> [#uses=2]
- br i1 %iftmp.410.0, label %UserCanceled, label %cond_next258
-cond_next258: ; preds = %bb254
- invoke fastcc void @_Z9printPageiP8QPainterPK13QTextDocumentRK6QRectFRK7QPointF( i32 %page.4, %struct.QPainter* %p, %struct.QAbstractTextDocumentLayout* %doc.1, %struct.QRectF* %body, %struct.QPointF* %pageNumberPos )
- to label %invcont261 unwind label %cleanup329
-invcont261: ; preds = %cond_next258
- %tmp263 = add i32 %pageCopies.0, -1 ; <i32> [#uses=1]
- %tmp265 = icmp sgt i32 %tmp263, %j.4 ; <i1> [#uses=1]
- br i1 %tmp265, label %cond_true266, label %cond_next270
-cond_true266: ; preds = %invcont261
- %tmp269 = invoke i1 @_ZN8QPrinter7newPageEv( %struct.QPrinter* %printer )
- to label %cond_next270 unwind label %cleanup329 ; <i1> [#uses=0]
-cond_next270: ; preds = %cond_true266, %invcont261
- %tmp272 = add i32 %j.4, 1 ; <i32> [#uses=1]
- br label %bb273
-bb273: ; preds = %cond_next270, %bb237
- %iftmp.410.1 = phi i1 [ %iftmp.410.4, %bb237 ], [ %iftmp.410.0, %cond_next270 ] ; <i1> [#uses=2]
- %j.4 = phi i32 [ 0, %bb237 ], [ %tmp272, %cond_next270 ] ; <i32> [#uses=3]
- %tmp276 = icmp slt i32 %j.4, %pageCopies.0 ; <i1> [#uses=1]
- br i1 %tmp276, label %cond_true277, label %bb280
-cond_true277: ; preds = %bb273
- %tmp241 = invoke i32 @_ZNK8QPrinter12printerStateEv( %struct.QPrinter* %printer )
- to label %invcont240 unwind label %cleanup329 ; <i32> [#uses=1]
-bb280: ; preds = %bb273
- %tmp283 = icmp eq i32 %page.4, %toPage.2 ; <i1> [#uses=1]
- br i1 %tmp283, label %bb297, label %cond_next285
-cond_next285: ; preds = %bb280
- br i1 %ascending.1, label %cond_true287, label %cond_false290
-cond_true287: ; preds = %cond_next285
- %tmp289 = add i32 %page.4, 1 ; <i32> [#uses=1]
- br label %cond_next293
-cond_false290: ; preds = %cond_next285
- %tmp292 = add i32 %page.4, -1 ; <i32> [#uses=1]
- br label %cond_next293
-cond_next293: ; preds = %cond_false290, %cond_true287
- %page.3 = phi i32 [ %tmp289, %cond_true287 ], [ %tmp292, %cond_false290 ] ; <i32> [#uses=1]
- %tmp296 = invoke i1 @_ZN8QPrinter7newPageEv( %struct.QPrinter* %printer )
- to label %bb237 unwind label %cleanup329 ; <i1> [#uses=0]
-bb297: ; preds = %bb280
- %tmp299 = add i32 %docCopies.0, -1 ; <i32> [#uses=1]
- %tmp301 = icmp sgt i32 %tmp299, %i.1 ; <i1> [#uses=1]
- br i1 %tmp301, label %cond_true302, label %cond_next306
-cond_true302: ; preds = %bb297
- %tmp305 = invoke i1 @_ZN8QPrinter7newPageEv( %struct.QPrinter* %printer )
- to label %cond_next306 unwind label %cleanup329 ; <i1> [#uses=0]
-cond_next306: ; preds = %cond_true302, %bb297
- %tmp308 = add i32 %i.1, 1 ; <i32> [#uses=1]
- br label %bb309
-bb309: ; preds = %cond_next306, %cond_next234
- %iftmp.410.5 = phi i1 [ undef, %cond_next234 ], [ %iftmp.410.1, %cond_next306 ] ; <i1> [#uses=1]
- %i.1 = phi i32 [ 0, %cond_next234 ], [ %tmp308, %cond_next306 ] ; <i32> [#uses=3]
- %tmp312 = icmp slt i32 %i.1, %docCopies.0 ; <i1> [#uses=1]
- br i1 %tmp312, label %cond_true313, label %UserCanceled
-cond_true313: ; preds = %bb309
- br label %bb237
-UserCanceled: ; preds = %bb309, %bb254
- %tmp318 = icmp eq %struct.QAbstractTextDocumentLayout* %clonedDoc.1, null ; <i1> [#uses=1]
- br i1 %tmp318, label %cleanup327, label %cond_true319
-cond_true319: ; preds = %UserCanceled
- %tmp.upgrd.23 = getelementptr %struct.QAbstractTextDocumentLayout* %clonedDoc.1, i32 0, i32 0, i32 0 ; <i32 (...)***> [#uses=1]
- %tmp.upgrd.24 = load i32 (...)*** %tmp.upgrd.23 ; <i32 (...)**> [#uses=1]
- %tmp322 = getelementptr i32 (...)** %tmp.upgrd.24, i32 4 ; <i32 (...)**> [#uses=1]
- %tmp.upgrd.25 = load i32 (...)** %tmp322 ; <i32 (...)*> [#uses=1]
- %tmp.upgrd.26 = bitcast i32 (...)* %tmp.upgrd.25 to void (%struct.QAbstractTextDocumentLayout*)* ; <void (%struct.QAbstractTextDocumentLayout*)*> [#uses=1]
- invoke void %tmp.upgrd.26( %struct.QAbstractTextDocumentLayout* %clonedDoc.1 )
- to label %cleanup327 unwind label %cleanup329
-cleanup327: ; preds = %cond_true319, %UserCanceled
- call void @_ZN8QPainterD1Ev( %struct.QPainter* %p )
- ret void
-cleanup328: ; preds = %invcont
- call void @_ZN8QPainterD1Ev( %struct.QPainter* %p )
- ret void
-cleanup329: ; preds = %cond_true319, %cond_true302, %cond_next293, %cond_true277, %cond_true266, %cond_next258, %cond_next244, %cond_next225, %cond_true220, %invcont210, %cond_next208, %cond_false204, %cond_true200, %cond_next194, %cleanup192, %cleanup192, %cleanup190, %invcont106, %invcont104, %invcont103, %invcont100, %invcont98, %invcont94, %cond_false, %invcont83, %invcont79, %invcont57, %invcont51, %invcont45, %cond_next42, %invcont37, %cond_true35, %invcont29, %invcont25, %cond_true24, %cond_next, %entry
- call void @_ZN8QPainterD1Ev( %struct.QPainter* %p )
- unwind
-}
-
-declare void @_ZN6QSizeFC1Edd(%struct.QPointF*, double, double)
-
-declare i1 @_ZNK6QSizeF7isValidEv(%struct.QPointF*)
-
-declare double @_ZNK6QSizeF5widthEv(%struct.QPointF*)
-
-declare double @_ZNK6QSizeF6heightEv(%struct.QPointF*)
-
-declare double* @_ZN6QSizeF6rwidthEv(%struct.QPointF*)
-
-declare double* @_ZN6QSizeF7rheightEv(%struct.QPointF*)
-
-declare %struct.QTextDocumentPrivate* @_ZNK13QTextDocument6d_funcEv(%struct.QAbstractTextDocumentLayout*)
-
-declare void @_ZN7QPointFC1Ev(%struct.QPointF*)
-
-declare void @_ZN7QPointFC1Edd(%struct.QPointF*, double, double)
-
-declare void @_ZN16QTextFrameFormat9setMarginEd(%struct.QTextBlockFormat*, double)
-
-declare void @_ZN6QRectFC1Edddd(%struct.QRectF*, double, double, double, double)
-
-declare void @_ZN6QRectFC1ERK7QPointFRK6QSizeF(%struct.QRectF*, %struct.QPointF*, %struct.QPointF*)
-
-declare double @_ZNK6QRectF5widthEv(%struct.QRectF*)
-
-declare double @_ZNK6QRectF6heightEv(%struct.QRectF*)
-
-declare void @_ZNK6QRectF4sizeEv(%struct.QPointF*, %struct.QRectF*)
-
-declare void @_ZN16QTextFrameFormatD1Ev(%struct.QTextBlockFormat*)
-
-declare void @_ZNK10QTextFrame11frameFormatEv(%struct.QTextBlockFormat*, %struct.QTextBlockGroup*)
-
-declare void @_ZN10QTextFrame14setFrameFormatERK16QTextFrameFormat(%struct.QTextBlockGroup*, %struct.QTextBlockFormat*)
-
-declare i32 @_ZNK12QPaintDevice5widthEv(%struct.QPaintDevice*)
-
-declare i32 @_ZNK12QPaintDevice6heightEv(%struct.QPaintDevice*)
-
-declare i32 @_ZNK12QPaintDevice11logicalDpiXEv(%struct.QPaintDevice*)
-
-declare i32 @_ZNK12QPaintDevice11logicalDpiYEv(%struct.QPaintDevice*)
-
-declare %struct.QAbstractTextDocumentLayout* @_ZNK13QTextDocument5cloneEP7QObject(%struct.QAbstractTextDocumentLayout*, %struct.QObject*)
-
-declare void @_ZN5QFontD1Ev(%struct.QFont*)
-
-declare %struct.QAbstractTextDocumentLayout* @_ZNK13QTextDocument14documentLayoutEv(%struct.QAbstractTextDocumentLayout*)
-
-declare %struct.QTextBlockGroup* @_ZNK13QTextDocument9rootFrameEv(%struct.QAbstractTextDocumentLayout*)
-
-declare i32 @_ZNK13QTextDocument9pageCountEv(%struct.QAbstractTextDocumentLayout*)
-
-declare void @_ZNK13QTextDocument11defaultFontEv(%struct.QFont*, %struct.QAbstractTextDocumentLayout*)
-
-declare void @_ZN13QTextDocument14setDefaultFontERK5QFont(%struct.QAbstractTextDocumentLayout*, %struct.QFont*)
-
-declare void @_ZN13QTextDocument11setPageSizeERK6QSizeF(%struct.QAbstractTextDocumentLayout*, %struct.QPointF*)
-
-declare void @_Z9printPageiP8QPainterPK13QTextDocumentRK6QRectFRK7QPointF(i32, %struct.QPainter*, %struct.QAbstractTextDocumentLayout*, %struct.QRectF*, %struct.QPointF*)
-
-declare void @_ZN12QFontMetricsD1Ev(%struct.QFontMetrics*)
-
-declare void @_ZN8QPainterC1EP12QPaintDevice(%struct.QPainter*, %struct.QPaintDevice*)
-
-declare i1 @_ZNK8QPainter8isActiveEv(%struct.QPainter*)
-
-declare i32 @_Z13qt_defaultDpiv()
-
-declare %struct.QPaintDevice* @_ZNK27QAbstractTextDocumentLayout11paintDeviceEv(%struct.QAbstractTextDocumentLayout*)
-
-declare void @_ZN8QPainter5scaleEdd(%struct.QPainter*, double, double)
-
-declare %struct.QPaintDevice* @_ZNK8QPainter6deviceEv(%struct.QPainter*)
-
-declare void @_ZN27QAbstractTextDocumentLayout14setPaintDeviceEP12QPaintDevice(%struct.QAbstractTextDocumentLayout*, %struct.QPaintDevice*)
-
-declare void @_ZN12QFontMetricsC1ERK5QFontP12QPaintDevice(%struct.QFontMetrics*, %struct.QFont*, %struct.QPaintDevice*)
-
-declare i32 @_ZNK12QFontMetrics6ascentEv(%struct.QFontMetrics*)
-
-declare void @_ZN5QFont12setPointSizeEi(%struct.QFont*, i32)
-
-declare i1 @_ZNK8QPrinter13collateCopiesEv(%struct.QPrinter*)
-
-declare i32 @_ZNK8QPrinter9numCopiesEv(%struct.QPrinter*)
-
-declare i32 @_ZNK8QPrinter8fromPageEv(%struct.QPrinter*)
-
-declare i32 @_ZNK8QPrinter6toPageEv(%struct.QPrinter*)
-
-declare i32 @_ZNK8QPrinter9pageOrderEv(%struct.QPrinter*)
-
-declare i32 @_ZNK8QPrinter12printerStateEv(%struct.QPrinter*)
-
-declare i1 @_ZN8QPrinter7newPageEv(%struct.QPrinter*)
-
-declare void @_ZN8QPainterD1Ev(%struct.QPainter*)
diff --git a/release_23/test/Transforms/SimplifyCFG/2006-12-08-Ptr-ICmp-Branch.ll b/release_23/test/Transforms/SimplifyCFG/2006-12-08-Ptr-ICmp-Branch.ll
deleted file mode 100644
index d433f0482955..000000000000
--- a/release_23/test/Transforms/SimplifyCFG/2006-12-08-Ptr-ICmp-Branch.ll
+++ /dev/null
@@ -1,131 +0,0 @@
-; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis
-; END.
-
-; ModuleID = '2006-12-08-Ptr-ICmp-Branch.ll'
-target datalayout = "e-p:32:32"
-target triple = "i686-pc-linux-gnu"
- %struct.FILE = type { i32, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, %struct._IO_marker*, %struct.FILE*, i32, i32, i32, i16, i8, [1 x i8], i8*, i64, i8*, i8*, i8*, i8*, i32, i32, [40 x i8] }
- %struct._IO_FILE = type { i32, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, %struct._IO_marker*, %struct.FILE*, i32, i32, i32, i16, i8, [1 x i8], i8*, i64, i8*, i8*, i8*, i8*, i32, i32, [40 x i8] }
- %struct._IO_marker = type { %struct._IO_marker*, %struct.FILE*, i32 }
- %struct.charsequence = type { i8*, i32, i32 }
- %struct.trie_s = type { [26 x %struct.trie_s*], i32 }
-@str = external global [14 x i8] ; <[14 x i8]*> [#uses=0]
-@str.upgrd.1 = external global [32 x i8] ; <[32 x i8]*> [#uses=0]
-@str.upgrd.2 = external global [12 x i8] ; <[12 x i8]*> [#uses=0]
-@C.0.2294 = external global %struct.charsequence ; <%struct.charsequence*> [#uses=3]
-@t = external global %struct.trie_s* ; <%struct.trie_s**> [#uses=0]
-@str.upgrd.3 = external global [3 x i8] ; <[3 x i8]*> [#uses=0]
-@str.upgrd.4 = external global [26 x i8] ; <[26 x i8]*> [#uses=0]
-
-declare void @charsequence_reset(%struct.charsequence*)
-
-declare void @free(i8*)
-
-declare void @charsequence_push(%struct.charsequence*, i8)
-
-declare i8* @charsequence_val(%struct.charsequence*)
-
-declare i32 @_IO_getc(%struct.FILE*)
-
-declare i32 @tolower(i32)
-
-declare %struct.trie_s* @trie_insert(%struct.trie_s*, i8*)
-
-declare i32 @feof(%struct.FILE*)
-
-define void @addfile(%struct.trie_s* %t, %struct.FILE* %f) {
-entry:
- %t_addr = alloca %struct.trie_s* ; <%struct.trie_s**> [#uses=2]
- %f_addr = alloca %struct.FILE* ; <%struct.FILE**> [#uses=3]
- %c = alloca i8, align 1 ; <i8*> [#uses=7]
- %wstate = alloca i32, align 4 ; <i32*> [#uses=4]
- %cs = alloca %struct.charsequence, align 16 ; <%struct.charsequence*> [#uses=7]
- %str = alloca i8*, align 4 ; <i8**> [#uses=3]
- %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
- store %struct.trie_s* %t, %struct.trie_s** %t_addr
- store %struct.FILE* %f, %struct.FILE** %f_addr
- store i32 0, i32* %wstate
- %tmp = getelementptr %struct.charsequence* %cs, i64 0, i32 0 ; <i8**> [#uses=1]
- %tmp1 = getelementptr %struct.charsequence* @C.0.2294, i64 0, i32 0 ; <i8**> [#uses=1]
- %tmp.upgrd.5 = load i8** %tmp1 ; <i8*> [#uses=1]
- store i8* %tmp.upgrd.5, i8** %tmp
- %tmp.upgrd.6 = getelementptr %struct.charsequence* %cs, i64 0, i32 1 ; <i32*> [#uses=1]
- %tmp2 = getelementptr %struct.charsequence* @C.0.2294, i64 0, i32 1 ; <i32*> [#uses=1]
- %tmp.upgrd.7 = load i32* %tmp2 ; <i32> [#uses=1]
- store i32 %tmp.upgrd.7, i32* %tmp.upgrd.6
- %tmp3 = getelementptr %struct.charsequence* %cs, i64 0, i32 2 ; <i32*> [#uses=1]
- %tmp4 = getelementptr %struct.charsequence* @C.0.2294, i64 0, i32 2 ; <i32*> [#uses=1]
- %tmp5 = load i32* %tmp4 ; <i32> [#uses=1]
- store i32 %tmp5, i32* %tmp3
- br label %bb33
-bb: ; preds = %bb33
- %tmp.upgrd.8 = load %struct.FILE** %f_addr ; <%struct.FILE*> [#uses=1]
- %tmp.upgrd.9 = call i32 @_IO_getc( %struct.FILE* %tmp.upgrd.8 ) ; <i32> [#uses=1]
- %tmp6 = call i32 @tolower( i32 %tmp.upgrd.9 ) ; <i32> [#uses=1]
- %tmp6.upgrd.10 = trunc i32 %tmp6 to i8 ; <i8> [#uses=1]
- store i8 %tmp6.upgrd.10, i8* %c
- %tmp7 = load i32* %wstate ; <i32> [#uses=1]
- %tmp.upgrd.11 = icmp ne i32 %tmp7, 0 ; <i1> [#uses=1]
- br i1 %tmp.upgrd.11, label %cond_true, label %cond_false
-cond_true: ; preds = %bb
- %tmp.upgrd.12 = load i8* %c ; <i8> [#uses=1]
- %tmp8 = icmp sle i8 %tmp.upgrd.12, 96 ; <i1> [#uses=1]
- br i1 %tmp8, label %cond_true9, label %cond_next
-cond_true9: ; preds = %cond_true
- br label %bb16
-cond_next: ; preds = %cond_true
- %tmp10 = load i8* %c ; <i8> [#uses=1]
- %tmp11 = icmp sgt i8 %tmp10, 122 ; <i1> [#uses=1]
- br i1 %tmp11, label %cond_true12, label %cond_next13
-cond_true12: ; preds = %cond_next
- br label %bb16
-cond_next13: ; preds = %cond_next
- %tmp14 = load i8* %c ; <i8> [#uses=1]
- %tmp14.upgrd.13 = sext i8 %tmp14 to i32 ; <i32> [#uses=1]
- %tmp1415 = trunc i32 %tmp14.upgrd.13 to i8 ; <i8> [#uses=1]
- call void @charsequence_push( %struct.charsequence* %cs, i8 %tmp1415 )
- br label %bb21
-bb16: ; preds = %cond_true12, %cond_true9
- %tmp17 = call i8* @charsequence_val( %struct.charsequence* %cs ) ; <i8*> [#uses=1]
- store i8* %tmp17, i8** %str
- %tmp.upgrd.14 = load %struct.trie_s** %t_addr ; <%struct.trie_s*> [#uses=1]
- %tmp18 = load i8** %str ; <i8*> [#uses=1]
- %tmp19 = call %struct.trie_s* @trie_insert( %struct.trie_s* %tmp.upgrd.14, i8* %tmp18 ) ; <%struct.trie_s*> [#uses=0]
- %tmp20 = load i8** %str ; <i8*> [#uses=1]
- call void @free( i8* %tmp20 )
- store i32 0, i32* %wstate
- br label %bb21
-bb21: ; preds = %bb16, %cond_next13
- br label %cond_next32
-cond_false: ; preds = %bb
- %tmp22 = load i8* %c ; <i8> [#uses=1]
- %tmp23 = icmp sgt i8 %tmp22, 96 ; <i1> [#uses=1]
- br i1 %tmp23, label %cond_true24, label %cond_next31
-cond_true24: ; preds = %cond_false
- %tmp25 = load i8* %c ; <i8> [#uses=1]
- %tmp26 = icmp sle i8 %tmp25, 122 ; <i1> [#uses=1]
- br i1 %tmp26, label %cond_true27, label %cond_next30
-cond_true27: ; preds = %cond_true24
- call void @charsequence_reset( %struct.charsequence* %cs )
- %tmp28 = load i8* %c ; <i8> [#uses=1]
- %tmp28.upgrd.15 = sext i8 %tmp28 to i32 ; <i32> [#uses=1]
- %tmp2829 = trunc i32 %tmp28.upgrd.15 to i8 ; <i8> [#uses=1]
- call void @charsequence_push( %struct.charsequence* %cs, i8 %tmp2829 )
- store i32 1, i32* %wstate
- br label %cond_next30
-cond_next30: ; preds = %cond_true27, %cond_true24
- br label %cond_next31
-cond_next31: ; preds = %cond_next30, %cond_false
- br label %cond_next32
-cond_next32: ; preds = %cond_next31, %bb21
- br label %bb33
-bb33: ; preds = %cond_next32, %entry
- %tmp34 = load %struct.FILE** %f_addr ; <%struct.FILE*> [#uses=1]
- %tmp35 = call i32 @feof( %struct.FILE* %tmp34 ) ; <i32> [#uses=1]
- %tmp36 = icmp eq i32 %tmp35, 0 ; <i1> [#uses=1]
- br i1 %tmp36, label %bb, label %bb37
-bb37: ; preds = %bb33
- br label %return
-return: ; preds = %bb37
- ret void
-}
diff --git a/release_23/test/Transforms/SimplifyCFG/2007-11-22-InvokeNoUnwind.ll b/release_23/test/Transforms/SimplifyCFG/2007-11-22-InvokeNoUnwind.ll
deleted file mode 100644
index 449047b0d32f..000000000000
--- a/release_23/test/Transforms/SimplifyCFG/2007-11-22-InvokeNoUnwind.ll
+++ /dev/null
@@ -1,14 +0,0 @@
-; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis | not grep invoke
-
-declare i32 @func(i8*) nounwind
-
-define i32 @test() {
- invoke i32 @func( i8* null )
- to label %Cont unwind label %Other ; <i32>:1 [#uses=0]
-
-Cont: ; preds = %0
- ret i32 0
-
-Other: ; preds = %0
- ret i32 1
-}
diff --git a/release_23/test/Transforms/SimplifyCFG/2007-12-21-Crash.ll b/release_23/test/Transforms/SimplifyCFG/2007-12-21-Crash.ll
deleted file mode 100644
index fe1ca80468be..000000000000
--- a/release_23/test/Transforms/SimplifyCFG/2007-12-21-Crash.ll
+++ /dev/null
@@ -1,37 +0,0 @@
-;RUN: llvm-as < %s | opt -simplifycfg -disable-output
-target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
-
-define i32 @bork() nounwind {
-entry:
- br label %bb5.outer
-
-bb5.outer.loopexit: ; preds = %bb5
- br label %bb5.outer
-
-bb5.outer: ; preds = %bb5.outer.loopexit, %entry
- %undo.0.ph = phi i32 [ 0, %entry ], [ 1, %bb5.outer.loopexit ] ; <i32> [#uses=1]
- br label %bb5
-
-bb5: ; preds = %bb5, %bb5.outer
- %tmp6 = tail call i32 (...)* @foo( ) nounwind ; <i32> [#uses=1]
- switch i32 %tmp6, label %bb13 [
- i32 -1, label %bb10
- i32 102, label %bb5
- i32 110, label %bb5.outer.loopexit
- ]
-
-bb10: ; preds = %bb5
- %tmp12 = tail call i32 (...)* @bar( i32 %undo.0.ph ) nounwind ; <i32> [#uses=0]
- br label %UnifiedReturnBlock
-
-bb13: ; preds = %bb5
- br label %UnifiedReturnBlock
-
-UnifiedReturnBlock: ; preds = %bb13, %bb10
- %UnifiedRetVal = phi i32 [ 1, %bb10 ], [ 258, %bb13 ] ; <i32> [#uses=1]
- ret i32 %UnifiedRetVal
-}
-
-declare i32 @foo(...)
-
-declare i32 @bar(...)
diff --git a/release_23/test/Transforms/SimplifyCFG/2008-01-02-hoist-fp-add.ll b/release_23/test/Transforms/SimplifyCFG/2008-01-02-hoist-fp-add.ll
deleted file mode 100644
index 43ff690150e3..000000000000
--- a/release_23/test/Transforms/SimplifyCFG/2008-01-02-hoist-fp-add.ll
+++ /dev/null
@@ -1,26 +0,0 @@
-; The phi should not be eliminated in this case, because the fp op could trap.
-; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis | grep {= phi double}
-
-target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
-target triple = "i686-apple-darwin8"
-@G = weak global double 0.000000e+00, align 8 ; <double*> [#uses=2]
-
-define void @test(i32 %X, i32 %Y, double %Z) {
-entry:
- %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
- %tmp = load double* @G, align 8 ; <double> [#uses=2]
- %tmp3 = icmp eq i32 %X, %Y ; <i1> [#uses=1]
- %tmp34 = zext i1 %tmp3 to i8 ; <i8> [#uses=1]
- %toBool = icmp ne i8 %tmp34, 0 ; <i1> [#uses=1]
- br i1 %toBool, label %cond_true, label %cond_next
-
-cond_true: ; preds = %entry
- %tmp7 = add double %tmp, %Z ; <double> [#uses=1]
- br label %cond_next
-
-cond_next: ; preds = %cond_true, %entry
- %F.0 = phi double [ %tmp, %entry ], [ %tmp7, %cond_true ] ; <double> [#uses=1]
- store double %F.0, double* @G, align 8
- ret void
-}
-
diff --git a/release_23/test/Transforms/SimplifyCFG/2008-04-23-MergeMultipleResultRet.ll b/release_23/test/Transforms/SimplifyCFG/2008-04-23-MergeMultipleResultRet.ll
deleted file mode 100644
index 5ee13526785d..000000000000
--- a/release_23/test/Transforms/SimplifyCFG/2008-04-23-MergeMultipleResultRet.ll
+++ /dev/null
@@ -1,43 +0,0 @@
-; RUN: llvm-as < %s | opt -simplifycfg -disable-output
-; rdar://5882392
-target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128"
-target triple = "x86_64-apple-darwin9"
- %struct.Py_complex = type { double, double }
-
-define %struct.Py_complex @_Py_c_pow(double %a.0, double %a.1, double %b.0, double %b.1) nounwind {
-entry:
- %tmp7 = fcmp une double %b.0, 0.000000e+00 ; <i1> [#uses=1]
- %tmp11 = fcmp une double %b.1, 0.000000e+00 ; <i1> [#uses=1]
- %bothcond = or i1 %tmp7, %tmp11 ; <i1> [#uses=1]
- br i1 %bothcond, label %bb15, label %bb53
-
-bb15: ; preds = %entry
- %tmp18 = fcmp une double %a.0, 0.000000e+00 ; <i1> [#uses=1]
- %tmp24 = fcmp une double %a.1, 0.000000e+00 ; <i1> [#uses=1]
- %bothcond1 = or i1 %tmp18, %tmp24 ; <i1> [#uses=1]
- br i1 %bothcond1, label %bb29, label %bb27
-
-bb27: ; preds = %bb15
- %tmp28 = call i32* @__error( ) nounwind ; <i32*> [#uses=1]
- store i32 33, i32* %tmp28, align 4
- ret double undef, double undef
-
-bb29: ; preds = %bb15
- %tmp36 = fcmp une double %b.1, 0.000000e+00 ; <i1> [#uses=1]
- br i1 %tmp36, label %bb39, label %bb47
-
-bb39: ; preds = %bb29
- br label %bb47
-
-bb47: ; preds = %bb39, %bb29
- ret double undef, double undef
-
-bb53: ; preds = %entry
- ret double undef, double undef
-}
-
-declare i32* @__error()
-
-declare double @pow(double, double) nounwind readonly
-
-declare double @cos(double) nounwind readonly
diff --git a/release_23/test/Transforms/SimplifyCFG/2008-04-27-MultipleReturnCrash.ll b/release_23/test/Transforms/SimplifyCFG/2008-04-27-MultipleReturnCrash.ll
deleted file mode 100644
index a370b9521090..000000000000
--- a/release_23/test/Transforms/SimplifyCFG/2008-04-27-MultipleReturnCrash.ll
+++ /dev/null
@@ -1,30 +0,0 @@
-; RUN: llvm-as < %s | opt -simplifycfg -disable-output
-; PR2256
-target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128"
-target triple = "x86_64-mingw32"
-
-define { x86_fp80, x86_fp80 } @catanl({ x86_fp80, x86_fp80 }* byval %Z, i1 %cond) nounwind {
-bb: ; preds = %entry
- br i1 %cond, label %bb48, label %bb40
-
-bb40: ; preds = %bb
- store i32 34, i32* null, align 4
- br label %bb196
-
-bb48: ; preds = %bb.bb48_crit_edge, %entry.bb48_crit_edge
- %tmp53 = icmp eq i32 0, 1280 ; <i1> [#uses=1]
- br i1 %tmp53, label %bb56, label %bb174
-
-bb56: ; preds = %bb48
- %iftmp.0.0 = select i1 false, x86_fp80 0xK3FFFC90FDAA22168C235, x86_fp80 0xKBFFFC90FDAA22168C235 ; <x86_fp80> [#uses=0]
- br label %bb196
-
-
-bb174: ; preds = %bb144, %bb114
- %tmp191 = mul x86_fp80 0xK00000000000000000000, 0xK3FFE8000000000000000 ; <x86_fp80> [#uses=1]
- br label %bb196
-
-bb196: ; preds = %bb174, %bb56, %bb40
- %Res.1.0 = phi x86_fp80 [ 0xK7FFF8000000000000000, %bb40 ], [ %tmp191, %bb174 ], [ 0xK00000000000000000000, %bb56 ] ; <x86_fp80> [#uses=1]
- ret x86_fp80 0xK00000000000000000000, x86_fp80 %Res.1.0
-}
diff --git a/release_23/test/Transforms/SimplifyCFG/BrUnwind.ll b/release_23/test/Transforms/SimplifyCFG/BrUnwind.ll
deleted file mode 100644
index 1acdecd5781a..000000000000
--- a/release_23/test/Transforms/SimplifyCFG/BrUnwind.ll
+++ /dev/null
@@ -1,15 +0,0 @@
-; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis | \
-; RUN: not grep {br label}
-
-define void @test(i1 %C) {
- br i1 %C, label %A, label %B
-A: ; preds = %0
- call void @test( i1 %C )
- br label %X
-B: ; preds = %0
- call void @test( i1 %C )
- br label %X
-X: ; preds = %B, %A
- unwind
-}
-
diff --git a/release_23/test/Transforms/SimplifyCFG/DeadSetCC.ll b/release_23/test/Transforms/SimplifyCFG/DeadSetCC.ll
deleted file mode 100644
index a4c8366e00fb..000000000000
--- a/release_23/test/Transforms/SimplifyCFG/DeadSetCC.ll
+++ /dev/null
@@ -1,28 +0,0 @@
-; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis | \
-; RUN: not grep {icmp eq}
-
-; Check that simplifycfg deletes a dead 'seteq' instruction when it
-; folds a conditional branch into a switch instruction.
-
-declare void @foo()
-
-declare void @bar()
-
-define void @testcfg(i32 %V) {
- %C = icmp eq i32 %V, 18 ; <i1> [#uses=1]
- %D = icmp eq i32 %V, 180 ; <i1> [#uses=1]
- %E = or i1 %C, %D ; <i1> [#uses=1]
- br i1 %E, label %L1, label %Sw
-Sw: ; preds = %0
- switch i32 %V, label %L1 [
- i32 15, label %L2
- i32 16, label %L2
- ]
-L1: ; preds = %Sw, %0
- call void @foo( )
- ret void
-L2: ; preds = %Sw, %Sw
- call void @bar( )
- ret void
-}
-
diff --git a/release_23/test/Transforms/SimplifyCFG/EqualPHIEdgeBlockMerge.ll b/release_23/test/Transforms/SimplifyCFG/EqualPHIEdgeBlockMerge.ll
deleted file mode 100644
index 55db7880f125..000000000000
--- a/release_23/test/Transforms/SimplifyCFG/EqualPHIEdgeBlockMerge.ll
+++ /dev/null
@@ -1,18 +0,0 @@
-; Test merging of blocks with phi nodes.
-;
-; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis | not grep N:
-;
-
-define i32 @test(i1 %a) {
-Q:
- br i1 %a, label %N, label %M
-N: ; preds = %Q
- br label %M
-M: ; preds = %N, %Q
- ; It's ok to merge N and M because the incoming values for W are the
- ; same for both cases...
- %W = phi i32 [ 2, %N ], [ 2, %Q ] ; <i32> [#uses=1]
- %R = add i32 %W, 1 ; <i32> [#uses=1]
- ret i32 %R
-}
-
diff --git a/release_23/test/Transforms/SimplifyCFG/HoistCode.ll b/release_23/test/Transforms/SimplifyCFG/HoistCode.ll
deleted file mode 100644
index d8894a6faa47..000000000000
--- a/release_23/test/Transforms/SimplifyCFG/HoistCode.ll
+++ /dev/null
@@ -1,11 +0,0 @@
-; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis | not grep br
-
-define void @foo(i1 %C, i32* %P) {
- br i1 %C, label %T, label %F
-T: ; preds = %0
- store i32 7, i32* %P
- ret void
-F: ; preds = %0
- store i32 7, i32* %P
- ret void
-}
diff --git a/release_23/test/Transforms/SimplifyCFG/InvokeEliminate.ll b/release_23/test/Transforms/SimplifyCFG/InvokeEliminate.ll
deleted file mode 100644
index 4f52f6b72e9e..000000000000
--- a/release_23/test/Transforms/SimplifyCFG/InvokeEliminate.ll
+++ /dev/null
@@ -1,18 +0,0 @@
-; This testcase checks to see if the simplifycfg pass is converting invoke
-; instructions to call instructions if the handler just rethrows the exception.
-
-; If this test is successful, the function should be reduced to 'call; ret'
-
-; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis | \
-; RUN: not egrep {\\(invoke\\)|\\(br\\)}
-
-declare void @bar()
-
-define i32 @test() {
- invoke void @bar( )
- to label %Ok unwind label %Rethrow
-Ok: ; preds = %0
- ret i32 0
-Rethrow: ; preds = %0
- unwind
-}
diff --git a/release_23/test/Transforms/SimplifyCFG/PhiBlockMerge.ll b/release_23/test/Transforms/SimplifyCFG/PhiBlockMerge.ll
deleted file mode 100644
index f3844f7328e9..000000000000
--- a/release_23/test/Transforms/SimplifyCFG/PhiBlockMerge.ll
+++ /dev/null
@@ -1,22 +0,0 @@
-; Test merging of blocks that only have PHI nodes in them
-;
-; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis | not grep N:
-;
-
-define i32 @test(i1 %a, i1 %b) {
-; <label>:0
- br i1 %a, label %M, label %O
-O: ; preds = %0
- br i1 %b, label %N, label %Q
-Q: ; preds = %O
- br label %N
-N: ; preds = %Q, %O
- ; This block should be foldable into M
- %Wp = phi i32 [ 0, %O ], [ 1, %Q ] ; <i32> [#uses=1]
- br label %M
-M: ; preds = %N, %0
- %W = phi i32 [ %Wp, %N ], [ 2, %0 ] ; <i32> [#uses=1]
- %R = add i32 %W, 1 ; <i32> [#uses=1]
- ret i32 %R
-}
-
diff --git a/release_23/test/Transforms/SimplifyCFG/PhiBlockMerge2.ll b/release_23/test/Transforms/SimplifyCFG/PhiBlockMerge2.ll
deleted file mode 100644
index 24b3d118e7bc..000000000000
--- a/release_23/test/Transforms/SimplifyCFG/PhiBlockMerge2.ll
+++ /dev/null
@@ -1,27 +0,0 @@
-; Test merging of blocks that only have PHI nodes in them. This tests the case
-; where the mergedinto block doesn't have any PHI nodes, and is in fact
-; dominated by the block-to-be-eliminated
-;
-; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis | not grep N:
-;
-
-declare i1 @foo()
-
-define i32 @test(i1 %a, i1 %b) {
- %c = call i1 @foo()
- br i1 %c, label %N, label %P
-P:
- %d = call i1 @foo()
- br i1 %d, label %N, label %Q
-Q:
- br label %N
-N:
- %W = phi i32 [0, %0], [1, %Q], [2, %P]
- ; This block should be foldable into M
- br label %M
-
-M:
- %R = add i32 %W, 1
- ret i32 %R
-}
-
diff --git a/release_23/test/Transforms/SimplifyCFG/PhiEliminate.ll b/release_23/test/Transforms/SimplifyCFG/PhiEliminate.ll
deleted file mode 100644
index 94697c96b78a..000000000000
--- a/release_23/test/Transforms/SimplifyCFG/PhiEliminate.ll
+++ /dev/null
@@ -1,41 +0,0 @@
-; Test a bunch of cases where the cfg simplification code should
-; be able to fold PHI nodes into computation in common cases. Folding the PHI
-; nodes away allows the branches to be eliminated, performing a simple form of
-; 'if conversion'.
-
-; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis > %t.xform
-; RUN: not grep phi %t.xform
-; RUN: grep ret %t.xform
-
-declare void @use(i1)
-
-declare void @use.upgrd.1(i32)
-
-define void @test2(i1 %c, i1 %d, i32 %V, i32 %V2) {
-; <label>:0
- br i1 %d, label %X, label %F
-X: ; preds = %0
- br i1 %c, label %T, label %F
-T: ; preds = %X
- br label %F
-F: ; preds = %T, %X, %0
- %B1 = phi i1 [ true, %0 ], [ false, %T ], [ false, %X ] ; <i1> [#uses=1]
- %I7 = phi i32 [ %V, %0 ], [ %V2, %T ], [ %V2, %X ] ; <i32> [#uses=1]
- call void @use( i1 %B1 )
- call void @use.upgrd.1( i32 %I7 )
- ret void
-}
-
-define void @test(i1 %c, i32 %V, i32 %V2) {
-; <label>:0
- br i1 %c, label %T, label %F
-T: ; preds = %0
- br label %F
-F: ; preds = %T, %0
- %B1 = phi i1 [ true, %0 ], [ false, %T ] ; <i1> [#uses=1]
- %I6 = phi i32 [ %V, %0 ], [ 0, %T ] ; <i32> [#uses=1]
- call void @use( i1 %B1 )
- call void @use.upgrd.1( i32 %I6 )
- ret void
-}
-
diff --git a/release_23/test/Transforms/SimplifyCFG/PhiEliminate2.ll b/release_23/test/Transforms/SimplifyCFG/PhiEliminate2.ll
deleted file mode 100644
index ec1b91a0d16e..000000000000
--- a/release_23/test/Transforms/SimplifyCFG/PhiEliminate2.ll
+++ /dev/null
@@ -1,14 +0,0 @@
-; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis | not grep br
-
-define i32 @test(i1 %C, i32 %V1, i32 %V2) {
-entry:
- br i1 %C, label %then, label %Cont
-then: ; preds = %entry
- %V3 = or i32 %V2, %V1 ; <i32> [#uses=1]
- br label %Cont
-Cont: ; preds = %then, %entry
- %V4 = phi i32 [ %V1, %entry ], [ %V3, %then ] ; <i32> [#uses=0]
- call i32 @test( i1 false, i32 0, i32 0 ) ; <i32>:0 [#uses=0]
- ret i32 %V1
-}
-
diff --git a/release_23/test/Transforms/SimplifyCFG/PhiNoEliminate.ll b/release_23/test/Transforms/SimplifyCFG/PhiNoEliminate.ll
deleted file mode 100644
index dfe122abbf94..000000000000
--- a/release_23/test/Transforms/SimplifyCFG/PhiNoEliminate.ll
+++ /dev/null
@@ -1,27 +0,0 @@
-; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis | \
-; RUN: not grep select
-
-;; The PHI node in this example should not be turned into a select, as we are
-;; not able to ifcvt the entire block. As such, converting to a select just
-;; introduces inefficiency without saving copies.
-
-define i32 @bar(i1 %C) {
-entry:
- br i1 %C, label %then, label %endif
-then: ; preds = %entry
- %tmp.3 = call i32 @qux( ) ; <i32> [#uses=0]
- br label %endif
-endif: ; preds = %then, %entry
- %R = phi i32 [ 123, %entry ], [ 12312, %then ] ; <i32> [#uses=1]
- ;; stuff to disable tail duplication
- call i32 @qux( ) ; <i32>:0 [#uses=0]
- call i32 @qux( ) ; <i32>:1 [#uses=0]
- call i32 @qux( ) ; <i32>:2 [#uses=0]
- call i32 @qux( ) ; <i32>:3 [#uses=0]
- call i32 @qux( ) ; <i32>:4 [#uses=0]
- call i32 @qux( ) ; <i32>:5 [#uses=0]
- call i32 @qux( ) ; <i32>:6 [#uses=0]
- ret i32 %R
-}
-
-declare i32 @qux()
diff --git a/release_23/test/Transforms/SimplifyCFG/UncondBranchToReturn.ll b/release_23/test/Transforms/SimplifyCFG/UncondBranchToReturn.ll
deleted file mode 100644
index e6c05f3beeb0..000000000000
--- a/release_23/test/Transforms/SimplifyCFG/UncondBranchToReturn.ll
+++ /dev/null
@@ -1,33 +0,0 @@
-; The unify-function-exit-nodes pass often makes basic blocks that just contain
-; a PHI node and a return. Make sure the simplify cfg can straighten out this
-; important case. This is basically the most trivial form of tail-duplication.
-
-; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis | \
-; RUN: not grep {br label}
-
-define i32 @test(i1 %B, i32 %A, i32 %B.upgrd.1) {
- br i1 %B, label %T, label %F
-T: ; preds = %0
- br label %ret
-F: ; preds = %0
- br label %ret
-ret: ; preds = %F, %T
- %X = phi i32 [ %A, %F ], [ %B.upgrd.1, %T ] ; <i32> [#uses=1]
- ret i32 %X
-}
-
-
-; Make sure it's willing to move unconditional branches to return instructions
-; as well, even if the return block is shared and the source blocks are
-; non-empty.
-define i32 @test2(i1 %B, i32 %A, i32 %B.upgrd.2) {
- br i1 %B, label %T, label %F
-T: ; preds = %0
- call i32 @test( i1 true, i32 5, i32 8 ) ; <i32>:1 [#uses=0]
- br label %ret
-F: ; preds = %0
- call i32 @test( i1 true, i32 5, i32 8 ) ; <i32>:2 [#uses=0]
- br label %ret
-ret: ; preds = %F, %T
- ret i32 %A
-}
diff --git a/release_23/test/Transforms/SimplifyCFG/UnreachableEliminate.ll b/release_23/test/Transforms/SimplifyCFG/UnreachableEliminate.ll
deleted file mode 100644
index 3c4491937355..000000000000
--- a/release_23/test/Transforms/SimplifyCFG/UnreachableEliminate.ll
+++ /dev/null
@@ -1,33 +0,0 @@
-; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis | not grep unreachable
-
-define void @test1(i1 %C, i1* %BP) {
- br i1 %C, label %T, label %F
-T: ; preds = %0
- store i1 %C, i1* %BP
- unreachable
-F: ; preds = %0
- ret void
-}
-
-define void @test2() {
- invoke void @test2( )
- to label %N unwind label %U
-U: ; preds = %0
- unreachable
-N: ; preds = %0
- ret void
-}
-
-define i32 @test3(i32 %v) {
- switch i32 %v, label %default [
- i32 1, label %U
- i32 2, label %T
- ]
-default: ; preds = %0
- ret i32 1
-U: ; preds = %0
- unreachable
-T: ; preds = %0
- ret i32 2
-}
-
diff --git a/release_23/test/Transforms/SimplifyCFG/basictest.ll b/release_23/test/Transforms/SimplifyCFG/basictest.ll
deleted file mode 100644
index 1fd629a4fd41..000000000000
--- a/release_23/test/Transforms/SimplifyCFG/basictest.ll
+++ /dev/null
@@ -1,25 +0,0 @@
-; Test CFG simplify removal of branch instructions...
-;
-; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis | not grep br
-
-define void @test1() {
- br label %BB1
-BB1: ; preds = %0
- ret void
-}
-
-define void @test2() {
- ret void
-BB1: ; No predecessors!
- ret void
-}
-
-define void @test3(i1 %T) {
- br i1 %T, label %BB1, label %BB1
-BB1: ; preds = %0, %0
- ret void
-}
-
-
-
-
diff --git a/release_23/test/Transforms/SimplifyCFG/branch-cond-merge.ll b/release_23/test/Transforms/SimplifyCFG/branch-cond-merge.ll
deleted file mode 100644
index ae465036584f..000000000000
--- a/release_23/test/Transforms/SimplifyCFG/branch-cond-merge.ll
+++ /dev/null
@@ -1,19 +0,0 @@
-; RUN: llvm-as < %s | opt -simplifycfg -instcombine \
-; RUN: -simplifycfg | llvm-dis | not grep call
-
-declare void @bar()
-
-define void @test(i32 %X, i32 %Y) {
-entry:
- %tmp.2 = icmp ne i32 %X, %Y ; <i1> [#uses=1]
- br i1 %tmp.2, label %shortcirc_next, label %UnifiedReturnBlock
-shortcirc_next: ; preds = %entry
- %tmp.3 = icmp ne i32 %X, %Y ; <i1> [#uses=1]
- br i1 %tmp.3, label %UnifiedReturnBlock, label %then
-then: ; preds = %shortcirc_next
- call void @bar( )
- ret void
-UnifiedReturnBlock: ; preds = %shortcirc_next, %entry
- ret void
-}
-
diff --git a/release_23/test/Transforms/SimplifyCFG/branch-cond-prop.ll b/release_23/test/Transforms/SimplifyCFG/branch-cond-prop.ll
deleted file mode 100644
index a7cd359689d9..000000000000
--- a/release_23/test/Transforms/SimplifyCFG/branch-cond-prop.ll
+++ /dev/null
@@ -1,17 +0,0 @@
-; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis | not grep call
-
-declare void @bar()
-
-define void @test(i32 %X, i32 %Y) {
-entry:
- %tmp.2 = icmp slt i32 %X, %Y ; <i1> [#uses=2]
- br i1 %tmp.2, label %shortcirc_next, label %UnifiedReturnBlock
-shortcirc_next: ; preds = %entry
- br i1 %tmp.2, label %UnifiedReturnBlock, label %then
-then: ; preds = %shortcirc_next
- call void @bar( )
- ret void
-UnifiedReturnBlock: ; preds = %shortcirc_next, %entry
- ret void
-}
-
diff --git a/release_23/test/Transforms/SimplifyCFG/branch-fold-test.ll b/release_23/test/Transforms/SimplifyCFG/branch-fold-test.ll
deleted file mode 100644
index 2deca4063457..000000000000
--- a/release_23/test/Transforms/SimplifyCFG/branch-fold-test.ll
+++ /dev/null
@@ -1,17 +0,0 @@
-; This test ensures that the simplifycfg pass continues to constant fold
-; terminator instructions.
-
-; RUN: llvm-as < %s | opt -simplifycfg | not grep br
-
-define i32 @test(i32 %A, i32 %B) {
-J:
- %C = add i32 %A, 12 ; <i32> [#uses=2]
- br i1 true, label %L, label %K
-L: ; preds = %J
- %D = add i32 %C, %B ; <i32> [#uses=1]
- ret i32 %D
-K: ; preds = %J
- %E = add i32 %C, %B ; <i32> [#uses=1]
- ret i32 %E
-}
-
diff --git a/release_23/test/Transforms/SimplifyCFG/branch-fold.ll b/release_23/test/Transforms/SimplifyCFG/branch-fold.ll
deleted file mode 100644
index d671b6edec45..000000000000
--- a/release_23/test/Transforms/SimplifyCFG/branch-fold.ll
+++ /dev/null
@@ -1,13 +0,0 @@
-; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis | grep {br i1} | count 1
-
-define void @test(i32* %P, i32* %Q, i1 %A, i1 %B) {
- br i1 %A, label %a, label %b
-a: ; preds = %0
- br i1 %B, label %b, label %c
-b: ; preds = %a, %0
- store i32 123, i32* %P
- ret void
-c: ; preds = %a
- ret void
-}
-
diff --git a/release_23/test/Transforms/SimplifyCFG/branch-phi-thread.ll b/release_23/test/Transforms/SimplifyCFG/branch-phi-thread.ll
deleted file mode 100644
index c536b6c88716..000000000000
--- a/release_23/test/Transforms/SimplifyCFG/branch-phi-thread.ll
+++ /dev/null
@@ -1,66 +0,0 @@
-; RUN: llvm-as < %s | opt -simplifycfg -adce | llvm-dis | \
-; RUN: not grep {call void @f1}
-; END.
-
-declare void @f1()
-
-declare void @f2()
-
-declare void @f3()
-
-declare void @f4()
-
-define i32 @test1(i32 %X, i1 %D) {
-E:
- %C = icmp eq i32 %X, 0 ; <i1> [#uses=2]
- br i1 %C, label %T, label %F
-T: ; preds = %A, %E
- br i1 %C, label %B, label %A
-A: ; preds = %T
- call void @f1( )
- br i1 %D, label %T, label %F
-B: ; preds = %T
- call void @f2( )
- ret i32 345
-F: ; preds = %A, %E
- call void @f3( )
- ret i32 123
-}
-
-define i32 @test2(i32 %X, i1 %D) {
-E:
- %C = icmp eq i32 %X, 0 ; <i1> [#uses=2]
- br i1 %C, label %T, label %F
-T: ; preds = %A, %E
- %P = phi i1 [ true, %E ], [ %C, %A ] ; <i1> [#uses=1]
- br i1 %P, label %B, label %A
-A: ; preds = %T
- call void @f1( )
- br i1 %D, label %T, label %F
-B: ; preds = %T
- call void @f2( )
- ret i32 345
-F: ; preds = %A, %E
- call void @f3( )
- ret i32 123
-}
-
-define i32 @test3(i32 %X, i1 %D, i32* %AP, i32* %BP) {
-E:
- %C = icmp eq i32 %X, 0 ; <i1> [#uses=2]
- br i1 %C, label %T, label %F
-T: ; preds = %A, %E
- call void @f3( )
- %XX = load i32* %AP ; <i32> [#uses=1]
- store i32 %XX, i32* %BP
- br i1 %C, label %B, label %A
-A: ; preds = %T
- call void @f1( )
- br i1 %D, label %T, label %F
-B: ; preds = %T
- call void @f2( )
- ret i32 345
-F: ; preds = %A, %E
- call void @f3( )
- ret i32 123
-}
diff --git a/release_23/test/Transforms/SimplifyCFG/dg.exp b/release_23/test/Transforms/SimplifyCFG/dg.exp
deleted file mode 100644
index 879685ca879d..000000000000
--- a/release_23/test/Transforms/SimplifyCFG/dg.exp
+++ /dev/null
@@ -1,3 +0,0 @@
-load_lib llvm.exp
-
-RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
diff --git a/release_23/test/Transforms/SimplifyCFG/hoist-common-code.ll b/release_23/test/Transforms/SimplifyCFG/hoist-common-code.ll
deleted file mode 100644
index 7512da263bd5..000000000000
--- a/release_23/test/Transforms/SimplifyCFG/hoist-common-code.ll
+++ /dev/null
@@ -1,18 +0,0 @@
-; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis | not grep br
-
-declare void @bar(i32)
-
-define void @test(i1 %P, i32* %Q) {
- br i1 %P, label %T, label %F
-T: ; preds = %0
- store i32 1, i32* %Q
- %A = load i32* %Q ; <i32> [#uses=1]
- call void @bar( i32 %A )
- ret void
-F: ; preds = %0
- store i32 1, i32* %Q
- %B = load i32* %Q ; <i32> [#uses=1]
- call void @bar( i32 %B )
- ret void
-}
-
diff --git a/release_23/test/Transforms/SimplifyCFG/iterative-simplify.ll b/release_23/test/Transforms/SimplifyCFG/iterative-simplify.ll
deleted file mode 100644
index 9081b01b20a8..000000000000
--- a/release_23/test/Transforms/SimplifyCFG/iterative-simplify.ll
+++ /dev/null
@@ -1,100 +0,0 @@
-; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis | not grep bb17
-; PR1786
-
-define i32 @main() {
-entry:
- %retval = alloca i32, align 4 ; <i32*> [#uses=1]
- %i = alloca i32, align 4 ; <i32*> [#uses=7]
- %z = alloca i32, align 4 ; <i32*> [#uses=4]
- %z16 = alloca i32, align 4 ; <i32*> [#uses=4]
- %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
- store i32 0, i32* %i
- %toBool = icmp ne i8 1, 0 ; <i1> [#uses=1]
- br i1 %toBool, label %cond_true, label %cond_false
-
-cond_true: ; preds = %entry
- store i32 0, i32* %z
- br label %bb
-
-bb: ; preds = %cond_next, %cond_true
- %tmp = load i32* %z ; <i32> [#uses=1]
- %tmp1 = sub i32 %tmp, 16384 ; <i32> [#uses=1]
- store i32 %tmp1, i32* %z
- %tmp2 = load i32* %i ; <i32> [#uses=1]
- %tmp3 = add i32 %tmp2, 1 ; <i32> [#uses=1]
- store i32 %tmp3, i32* %i
- %tmp4 = load i32* %i ; <i32> [#uses=1]
- %tmp5 = icmp sgt i32 %tmp4, 262144 ; <i1> [#uses=1]
- %tmp56 = zext i1 %tmp5 to i8 ; <i8> [#uses=1]
- %toBool7 = icmp ne i8 %tmp56, 0 ; <i1> [#uses=1]
- br i1 %toBool7, label %cond_true8, label %cond_next
-
-cond_true8: ; preds = %bb
- call void @abort( )
- unreachable
-
-cond_next: ; preds = %bb
- %tmp9 = load i32* %z ; <i32> [#uses=1]
- %tmp10 = icmp ne i32 %tmp9, 0 ; <i1> [#uses=1]
- %tmp1011 = zext i1 %tmp10 to i8 ; <i8> [#uses=1]
- %toBool12 = icmp ne i8 %tmp1011, 0 ; <i1> [#uses=1]
- br i1 %toBool12, label %bb, label %bb13
-
-bb13: ; preds = %cond_next
- call void @exit( i32 0 )
- unreachable
-
-cond_false: ; preds = %entry
- %toBool14 = icmp ne i8 1, 0 ; <i1> [#uses=1]
- br i1 %toBool14, label %cond_true15, label %cond_false33
-
-cond_true15: ; preds = %cond_false
- store i32 0, i32* %z16
- br label %bb17
-
-bb17: ; preds = %cond_next27, %cond_true15
- %tmp18 = load i32* %z16 ; <i32> [#uses=1]
- %tmp19 = sub i32 %tmp18, 16384 ; <i32> [#uses=1]
- store i32 %tmp19, i32* %z16
- %tmp20 = load i32* %i ; <i32> [#uses=1]
- %tmp21 = add i32 %tmp20, 1 ; <i32> [#uses=1]
- store i32 %tmp21, i32* %i
- %tmp22 = load i32* %i ; <i32> [#uses=1]
- %tmp23 = icmp sgt i32 %tmp22, 262144 ; <i1> [#uses=1]
- %tmp2324 = zext i1 %tmp23 to i8 ; <i8> [#uses=1]
- %toBool25 = icmp ne i8 %tmp2324, 0 ; <i1> [#uses=1]
- br i1 %toBool25, label %cond_true26, label %cond_next27
-
-cond_true26: ; preds = %bb17
- call void @abort( )
- unreachable
-
-cond_next27: ; preds = %bb17
- %tmp28 = load i32* %z16 ; <i32> [#uses=1]
- %tmp29 = icmp ne i32 %tmp28, 0 ; <i1> [#uses=1]
- %tmp2930 = zext i1 %tmp29 to i8 ; <i8> [#uses=1]
- %toBool31 = icmp ne i8 %tmp2930, 0 ; <i1> [#uses=1]
- br i1 %toBool31, label %bb17, label %bb32
-
-bb32: ; preds = %cond_next27
- call void @exit( i32 0 )
- unreachable
-
-cond_false33: ; preds = %cond_false
- call void @exit( i32 0 )
- unreachable
-
-cond_next34: ; No predecessors!
- br label %cond_next35
-
-cond_next35: ; preds = %cond_next34
- br label %return
-
-return: ; preds = %cond_next35
- %retval36 = load i32* %retval ; <i32> [#uses=1]
- ret i32 %retval36
-}
-
-declare void @abort()
-
-declare void @exit(i32)
diff --git a/release_23/test/Transforms/SimplifyCFG/noreturn-call.ll b/release_23/test/Transforms/SimplifyCFG/noreturn-call.ll
deleted file mode 100644
index 0e1c6327e8b3..000000000000
--- a/release_23/test/Transforms/SimplifyCFG/noreturn-call.ll
+++ /dev/null
@@ -1,11 +0,0 @@
-; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis | grep unreachable
-; PR1796
-
-declare void @Finisher(i32) noreturn
-
-define void @YYY(i32) {
- tail call void @Finisher(i32 %0) noreturn
- tail call void @Finisher(i32 %0) noreturn
- ret void
-}
-
diff --git a/release_23/test/Transforms/SimplifyCFG/return-merge.ll b/release_23/test/Transforms/SimplifyCFG/return-merge.ll
deleted file mode 100644
index 60267e9ec69b..000000000000
--- a/release_23/test/Transforms/SimplifyCFG/return-merge.ll
+++ /dev/null
@@ -1,19 +0,0 @@
-; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis | not grep br
-
-define i32 @test1(i1 %C) {
-entry:
- br i1 %C, label %T, label %F
-T: ; preds = %entry
- ret i32 1
-F: ; preds = %entry
- ret i32 0
-}
-
-define void @test2(i1 %C) {
- br i1 %C, label %T, label %F
-T: ; preds = %0
- ret void
-F: ; preds = %0
- ret void
-}
-
diff --git a/release_23/test/Transforms/SimplifyCFG/switch-simplify-crash.ll b/release_23/test/Transforms/SimplifyCFG/switch-simplify-crash.ll
deleted file mode 100644
index 74559a02647e..000000000000
--- a/release_23/test/Transforms/SimplifyCFG/switch-simplify-crash.ll
+++ /dev/null
@@ -1,108 +0,0 @@
-; RUN: llvm-as < %s | opt -simplifycfg -disable-output
-
-define void @NewExtractNames() {
-entry:
- br i1 false, label %endif.0, label %then.0
-then.0: ; preds = %entry
- br i1 false, label %shortcirc_next.i, label %shortcirc_done.i
-shortcirc_next.i: ; preds = %then.0
- br label %shortcirc_done.i
-shortcirc_done.i: ; preds = %shortcirc_next.i, %then.0
- br i1 false, label %then.0.i, label %else.0.i
-then.0.i: ; preds = %shortcirc_done.i
- br label %NewBase.exit
-else.0.i: ; preds = %shortcirc_done.i
- br i1 false, label %endif.0.i, label %else.1.i
-else.1.i: ; preds = %else.0.i
- br i1 false, label %endif.0.i, label %else.2.i
-else.2.i: ; preds = %else.1.i
- br label %NewBase.exit
-endif.0.i: ; preds = %else.1.i, %else.0.i
- br label %NewBase.exit
-NewBase.exit: ; preds = %endif.0.i, %else.2.i, %then.0.i
- br label %endif.0
-endif.0: ; preds = %NewBase.exit, %entry
- %tmp.32.mask = and i32 0, 31 ; <i32> [#uses=1]
- switch i32 %tmp.32.mask, label %label.9 [
- i32 16, label %loopentry.2
- i32 15, label %loopentry.2
- i32 14, label %loopentry.2
- i32 13, label %loopentry.2
- i32 10, label %loopentry.2
- i32 20, label %loopentry.1
- i32 19, label %loopentry.1
- i32 2, label %loopentry.0
- i32 0, label %switchexit
- ]
-loopentry.0: ; preds = %endif.1, %endif.0
- br i1 false, label %no_exit.0, label %switchexit
-no_exit.0: ; preds = %loopentry.0
- br i1 false, label %then.1, label %else.1
-then.1: ; preds = %no_exit.0
- br label %endif.1
-else.1: ; preds = %no_exit.0
- br i1 false, label %shortcirc_next.0, label %shortcirc_done.0
-shortcirc_next.0: ; preds = %else.1
- br label %shortcirc_done.0
-shortcirc_done.0: ; preds = %shortcirc_next.0, %else.1
- br i1 false, label %then.2, label %endif.2
-then.2: ; preds = %shortcirc_done.0
- br label %endif.2
-endif.2: ; preds = %then.2, %shortcirc_done.0
- br label %endif.1
-endif.1: ; preds = %endif.2, %then.1
- br label %loopentry.0
-loopentry.1: ; preds = %endif.3, %endif.0, %endif.0
- br i1 false, label %no_exit.1, label %switchexit
-no_exit.1: ; preds = %loopentry.1
- br i1 false, label %then.3, label %else.2
-then.3: ; preds = %no_exit.1
- br label %endif.3
-else.2: ; preds = %no_exit.1
- br i1 false, label %shortcirc_next.1, label %shortcirc_done.1
-shortcirc_next.1: ; preds = %else.2
- br label %shortcirc_done.1
-shortcirc_done.1: ; preds = %shortcirc_next.1, %else.2
- br i1 false, label %then.4, label %endif.4
-then.4: ; preds = %shortcirc_done.1
- br label %endif.4
-endif.4: ; preds = %then.4, %shortcirc_done.1
- br label %endif.3
-endif.3: ; preds = %endif.4, %then.3
- br label %loopentry.1
-loopentry.2: ; preds = %endif.5, %endif.0, %endif.0, %endif.0, %endif.0, %endif.0
- %i.3 = phi i32 [ 0, %endif.5 ], [ 0, %endif.0 ], [ 0, %endif.0 ], [ 0, %endif.0 ], [ 0, %endif.0 ], [ 0, %endif.0 ] ; <i32> [#uses=1]
- %tmp.158 = icmp slt i32 %i.3, 0 ; <i1> [#uses=1]
- br i1 %tmp.158, label %no_exit.2, label %switchexit
-no_exit.2: ; preds = %loopentry.2
- br i1 false, label %shortcirc_next.2, label %shortcirc_done.2
-shortcirc_next.2: ; preds = %no_exit.2
- br label %shortcirc_done.2
-shortcirc_done.2: ; preds = %shortcirc_next.2, %no_exit.2
- br i1 false, label %then.5, label %endif.5
-then.5: ; preds = %shortcirc_done.2
- br label %endif.5
-endif.5: ; preds = %then.5, %shortcirc_done.2
- br label %loopentry.2
-label.9: ; preds = %endif.0
- br i1 false, label %then.6, label %endif.6
-then.6: ; preds = %label.9
- br label %endif.6
-endif.6: ; preds = %then.6, %label.9
- store i32 0, i32* null
- br label %switchexit
-switchexit: ; preds = %endif.6, %loopentry.2, %loopentry.1, %loopentry.0, %endif.0
- br i1 false, label %endif.7, label %then.7
-then.7: ; preds = %switchexit
- br i1 false, label %shortcirc_next.3, label %shortcirc_done.3
-shortcirc_next.3: ; preds = %then.7
- br label %shortcirc_done.3
-shortcirc_done.3: ; preds = %shortcirc_next.3, %then.7
- br i1 false, label %then.8, label %endif.8
-then.8: ; preds = %shortcirc_done.3
- br label %endif.8
-endif.8: ; preds = %then.8, %shortcirc_done.3
- br label %endif.7
-endif.7: ; preds = %endif.8, %switchexit
- ret void
-}
diff --git a/release_23/test/Transforms/SimplifyCFG/switch_create.ll b/release_23/test/Transforms/SimplifyCFG/switch_create.ll
deleted file mode 100644
index 4994cd3960aa..000000000000
--- a/release_23/test/Transforms/SimplifyCFG/switch_create.ll
+++ /dev/null
@@ -1,47 +0,0 @@
-; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis | not grep br
-
-declare void @foo1()
-
-declare void @foo2()
-
-define void @test1(i32 %V) {
- %C1 = icmp eq i32 %V, 4 ; <i1> [#uses=1]
- %C2 = icmp eq i32 %V, 17 ; <i1> [#uses=1]
- %CN = or i1 %C1, %C2 ; <i1> [#uses=1]
- br i1 %CN, label %T, label %F
-T: ; preds = %0
- call void @foo1( )
- ret void
-F: ; preds = %0
- call void @foo2( )
- ret void
-}
-
-define void @test2(i32 %V) {
- %C1 = icmp ne i32 %V, 4 ; <i1> [#uses=1]
- %C2 = icmp ne i32 %V, 17 ; <i1> [#uses=1]
- %CN = and i1 %C1, %C2 ; <i1> [#uses=1]
- br i1 %CN, label %T, label %F
-T: ; preds = %0
- call void @foo1( )
- ret void
-F: ; preds = %0
- call void @foo2( )
- ret void
-}
-
-define void @test3(i32 %V) {
- %C1 = icmp eq i32 %V, 4 ; <i1> [#uses=1]
- br i1 %C1, label %T, label %N
-N: ; preds = %0
- %C2 = icmp eq i32 %V, 17 ; <i1> [#uses=1]
- br i1 %C2, label %T, label %F
-T: ; preds = %N, %0
- call void @foo1( )
- ret void
-F: ; preds = %N
- call void @foo2( )
- ret void
-}
-
-
diff --git a/release_23/test/Transforms/SimplifyCFG/switch_formation.ll b/release_23/test/Transforms/SimplifyCFG/switch_formation.ll
deleted file mode 100644
index 534c471eaad7..000000000000
--- a/release_23/test/Transforms/SimplifyCFG/switch_formation.ll
+++ /dev/null
@@ -1,31 +0,0 @@
-; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis | not grep br
-; END.
-
-define i1 @_ZN4llvm11SetCondInst7classofEPKNS_11InstructionE({ i32, i32 }* %I) {
-entry:
- %tmp.1.i = getelementptr { i32, i32 }* %I, i64 0, i32 1 ; <i32*> [#uses=1]
- %tmp.2.i = load i32* %tmp.1.i ; <i32> [#uses=6]
- %tmp.2 = icmp eq i32 %tmp.2.i, 14 ; <i1> [#uses=1]
- br i1 %tmp.2, label %shortcirc_done.4, label %shortcirc_next.0
-shortcirc_next.0: ; preds = %entry
- %tmp.6 = icmp eq i32 %tmp.2.i, 15 ; <i1> [#uses=1]
- br i1 %tmp.6, label %shortcirc_done.4, label %shortcirc_next.1
-shortcirc_next.1: ; preds = %shortcirc_next.0
- %tmp.11 = icmp eq i32 %tmp.2.i, 16 ; <i1> [#uses=1]
- br i1 %tmp.11, label %shortcirc_done.4, label %shortcirc_next.2
-shortcirc_next.2: ; preds = %shortcirc_next.1
- %tmp.16 = icmp eq i32 %tmp.2.i, 17 ; <i1> [#uses=1]
- br i1 %tmp.16, label %shortcirc_done.4, label %shortcirc_next.3
-shortcirc_next.3: ; preds = %shortcirc_next.2
- %tmp.21 = icmp eq i32 %tmp.2.i, 18 ; <i1> [#uses=1]
- br i1 %tmp.21, label %shortcirc_done.4, label %shortcirc_next.4
-shortcirc_next.4: ; preds = %shortcirc_next.3
- %tmp.26 = icmp eq i32 %tmp.2.i, 19 ; <i1> [#uses=1]
- br label %UnifiedReturnBlock
-shortcirc_done.4: ; preds = %shortcirc_next.3, %shortcirc_next.2, %shortcirc_next.1, %shortcirc_next.0, %entry
- br label %UnifiedReturnBlock
-UnifiedReturnBlock: ; preds = %shortcirc_done.4, %shortcirc_next.4
- %UnifiedRetVal = phi i1 [ %tmp.26, %shortcirc_next.4 ], [ true, %shortcirc_done.4 ] ; <i1> [#uses=1]
- ret i1 %UnifiedRetVal
-}
-
diff --git a/release_23/test/Transforms/SimplifyCFG/switch_switch_fold.ll b/release_23/test/Transforms/SimplifyCFG/switch_switch_fold.ll
deleted file mode 100644
index 1590f343a5fd..000000000000
--- a/release_23/test/Transforms/SimplifyCFG/switch_switch_fold.ll
+++ /dev/null
@@ -1,47 +0,0 @@
-; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis | \
-; RUN: grep switch | count 1
-
-; Test that a switch going to a switch on the same value can be merged. All
-; three switches in this example can be merged into one big one.
-
-declare void @foo1()
-
-declare void @foo2()
-
-declare void @foo3()
-
-declare void @foo4()
-
-define void @test1(i32 %V) {
- switch i32 %V, label %F [
- i32 4, label %T
- i32 17, label %T
- i32 5, label %T
- i32 1234, label %F
- ]
-T: ; preds = %0, %0, %0
- switch i32 %V, label %F [
- i32 4, label %A
- i32 17, label %B
- i32 42, label %C
- ]
-A: ; preds = %T
- call void @foo1( )
- ret void
-B: ; preds = %F, %F, %T
- call void @foo2( )
- ret void
-C: ; preds = %T
- call void @foo3( )
- ret void
-F: ; preds = %F, %T, %0, %0
- switch i32 %V, label %F [
- i32 4, label %B
- i32 18, label %B
- i32 42, label %D
- ]
-D: ; preds = %F
- call void @foo4( )
- ret void
-}
-
diff --git a/release_23/test/Transforms/SimplifyCFG/switch_thread.ll b/release_23/test/Transforms/SimplifyCFG/switch_thread.ll
deleted file mode 100644
index a92528a3331f..000000000000
--- a/release_23/test/Transforms/SimplifyCFG/switch_thread.ll
+++ /dev/null
@@ -1,79 +0,0 @@
-; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis | \
-; RUN: not grep {call void @DEAD}
-
-; Test that we can thread a simple known condition through switch statements.
-
-declare void @foo1()
-
-declare void @foo2()
-
-declare void @DEAD()
-
-define void @test1(i32 %V) {
- switch i32 %V, label %A [
- i32 4, label %T
- i32 17, label %Done
- i32 1234, label %A
- ]
-;; V == 4 if we get here.
-T: ; preds = %0
- call void @foo1( )
- ;; This switch is always statically determined.
- switch i32 %V, label %A2 [
- i32 4, label %B
- i32 17, label %C
- i32 42, label %C
- ]
-A2: ; preds = %T
- call void @DEAD( )
- call void @DEAD( )
- ;; always true
- %cond2 = icmp eq i32 %V, 4 ; <i1> [#uses=1]
- br i1 %cond2, label %Done, label %C
-A: ; preds = %0, %0
- call void @foo1( )
- ;; always true
- %cond = icmp ne i32 %V, 4 ; <i1> [#uses=1]
- br i1 %cond, label %Done, label %C
-Done: ; preds = %B, %A, %A2, %0
- ret void
-B: ; preds = %T
- call void @foo2( )
- ;; always true
- %cond3 = icmp eq i32 %V, 4 ; <i1> [#uses=1]
- br i1 %cond3, label %Done, label %C
-C: ; preds = %B, %A, %A2, %T, %T
- call void @DEAD( )
- ret void
-}
-
-define void @test2(i32 %V) {
- switch i32 %V, label %A [
- i32 4, label %T
- i32 17, label %D
- i32 1234, label %E
- ]
-;; V != 4, 17, 1234 here.
-A: ; preds = %0
- call void @foo1( )
- ;; This switch is always statically determined.
- switch i32 %V, label %E [
- i32 4, label %C
- i32 17, label %C
- i32 42, label %D
- ]
-;; unreacahble.
-C: ; preds = %A, %A
- call void @DEAD( )
- ret void
-T: ; preds = %0
- call void @foo1( )
- call void @foo1( )
- ret void
-D: ; preds = %A, %0
- call void @foo1( )
- ret void
-E: ; preds = %A, %0
- ret void
-}
-
diff --git a/release_23/test/Transforms/SimplifyCFG/two-entry-phi-return.ll b/release_23/test/Transforms/SimplifyCFG/two-entry-phi-return.ll
deleted file mode 100644
index 19814ade4d91..000000000000
--- a/release_23/test/Transforms/SimplifyCFG/two-entry-phi-return.ll
+++ /dev/null
@@ -1,15 +0,0 @@
-; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis | not grep br
-
-define i1 @qux(i8* %m, i8* %n, i8* %o, i8* %p) nounwind {
-entry:
- %tmp7 = icmp eq i8* %m, %n
- br i1 %tmp7, label %bb, label %UnifiedReturnBlock
-
-bb:
- %tmp15 = icmp eq i8* %o, %p
- br label %UnifiedReturnBlock
-
-UnifiedReturnBlock:
- %result = phi i1 [ 0, %entry ], [ %tmp15, %bb ]
- ret i1 %result
-}
diff --git a/release_23/test/Transforms/SimplifyLibCalls/2005-05-20-sprintf-crash.ll b/release_23/test/Transforms/SimplifyLibCalls/2005-05-20-sprintf-crash.ll
deleted file mode 100644
index 860a6ebf966b..000000000000
--- a/release_23/test/Transforms/SimplifyLibCalls/2005-05-20-sprintf-crash.ll
+++ /dev/null
@@ -1,11 +0,0 @@
-; RUN: llvm-as < %s | opt -simplify-libcalls -disable-output
-
-@G = constant [3 x i8] c"%s\00" ; <[3 x i8]*> [#uses=1]
-
-declare i32 @sprintf(i8*, i8*, ...)
-
-define void @foo(i8* %P, i32* %X) {
- call i32 (i8*, i8*, ...)* @sprintf( i8* %P, i8* getelementptr ([3 x i8]* @G, i32 0, i32 0), i32* %X ) ; <i32>:1 [#uses=0]
- ret void
-}
-
diff --git a/release_23/test/Transforms/SimplifyLibCalls/2007-04-06-strchr-miscompile.ll b/release_23/test/Transforms/SimplifyLibCalls/2007-04-06-strchr-miscompile.ll
deleted file mode 100644
index 5a56d24a35ab..000000000000
--- a/release_23/test/Transforms/SimplifyLibCalls/2007-04-06-strchr-miscompile.ll
+++ /dev/null
@@ -1,29 +0,0 @@
-; PR1307
-; RUN: llvm-as < %s | opt -simplify-libcalls -instcombine | llvm-dis > %t
-; RUN: grep {@str,.*i64 3} %t
-; RUN: grep {@str1,.*i64 7} %t
-; RUN: grep {ret i8.*null} %t
-; END.
-
-@str = internal constant [5 x i8] c"foog\00"
-@str1 = internal constant [8 x i8] c"blahhh!\00"
-@str2 = internal constant [5 x i8] c"Ponk\00"
-
-define i8* @test1() {
- %tmp3 = tail call i8* @strchr( i8* getelementptr ([5 x i8]* @str, i32 0, i32 2), i32 103 ) ; <i8*> [#uses=1]
- ret i8* %tmp3
-}
-
-declare i8* @strchr(i8*, i32)
-
-define i8* @test2() {
- %tmp3 = tail call i8* @strchr( i8* getelementptr ([8 x i8]* @str1, i32 0, i32 2), i32 0 ) ; <i8*> [#uses=1]
- ret i8* %tmp3
-}
-
-define i8* @test3() {
-entry:
- %tmp3 = tail call i8* @strchr( i8* getelementptr ([5 x i8]* @str2, i32 0, i32 1), i32 80 ) ; <i8*> [#uses=1]
- ret i8* %tmp3
-}
-
diff --git a/release_23/test/Transforms/SimplifyLibCalls/ExitInMain.ll b/release_23/test/Transforms/SimplifyLibCalls/ExitInMain.ll
deleted file mode 100644
index 8abf3b1cc46b..000000000000
--- a/release_23/test/Transforms/SimplifyLibCalls/ExitInMain.ll
+++ /dev/null
@@ -1,15 +0,0 @@
-; Test that the ExitInMainOptimization pass works correctly
-; RUN: llvm-as < %s | opt -simplify-libcalls | llvm-dis | \
-; RUN: grep {ret i32 3} | count 1
-; END.
-
-declare void @exit(i32)
-
-declare void @exitonly(i32)
-
-define i32 @main() {
- call void @exitonly( i32 3 )
- call void @exit( i32 3 )
- ret i32 0
-}
-
diff --git a/release_23/test/Transforms/SimplifyLibCalls/FFS.ll b/release_23/test/Transforms/SimplifyLibCalls/FFS.ll
deleted file mode 100644
index bdf43ef69f7a..000000000000
--- a/release_23/test/Transforms/SimplifyLibCalls/FFS.ll
+++ /dev/null
@@ -1,30 +0,0 @@
-; Test that the ToAsciiOptimizer works correctly
-; RUN: llvm-as < %s | opt -simplify-libcalls | llvm-dis | \
-; RUN: not grep {call.*@ffs}
-
-@non_const = external global i32 ; <i32*> [#uses=1]
-
-declare i32 @ffs(i32)
-
-declare i32 @ffsl(i32)
-
-declare i32 @ffsll(i64)
-
-define i32 @main() {
- %arg = load i32* @non_const ; <i32> [#uses=1]
- %val0 = call i32 @ffs( i32 %arg ) ; <i32> [#uses=1]
- %val1 = call i32 @ffs( i32 1 ) ; <i32> [#uses=1]
- %val2 = call i32 @ffs( i32 2048 ) ; <i32> [#uses=1]
- %val3 = call i32 @ffsl( i32 65536 ) ; <i32> [#uses=1]
- %val4 = call i32 @ffsll( i64 1024 ) ; <i32> [#uses=1]
- %val5 = call i32 @ffsll( i64 17179869184 ) ; <i32> [#uses=1]
- %val6 = call i32 @ffsll( i64 1152921504606846976 ) ; <i32> [#uses=1]
- %rslt1 = add i32 %val1, %val2 ; <i32> [#uses=1]
- %rslt2 = add i32 %val3, %val4 ; <i32> [#uses=1]
- %rslt3 = add i32 %val5, %val6 ; <i32> [#uses=1]
- %rslt4 = add i32 %rslt1, %rslt2 ; <i32> [#uses=1]
- %rslt5 = add i32 %rslt4, %rslt3 ; <i32> [#uses=2]
- %rslt6 = add i32 %rslt5, %val0 ; <i32> [#uses=0]
- ret i32 %rslt5
-}
-
diff --git a/release_23/test/Transforms/SimplifyLibCalls/FPrintF.ll b/release_23/test/Transforms/SimplifyLibCalls/FPrintF.ll
deleted file mode 100644
index ac6b3c1f7097..000000000000
--- a/release_23/test/Transforms/SimplifyLibCalls/FPrintF.ll
+++ /dev/null
@@ -1,25 +0,0 @@
-; Test that the FPrintFOptimizer works correctly
-; RUN: llvm-as < %s | opt -simplify-libcalls | llvm-dis | \
-; RUN: not grep {call.*fprintf}
-;
-
- %struct._IO_FILE = type { i32, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, %struct._IO_marker*, %struct._IO_FILE*, i32, i32, i32, i16, i8, [1 x i8], i8*, i64, i8*, i8*, i32, [52 x i8] }
- %struct._IO_marker = type { %struct._IO_marker*, %struct._IO_FILE*, i32 }
-@str = constant [3 x i8] c"%s\00" ; <[3 x i8]*> [#uses=1]
-@chr = constant [3 x i8] c"%c\00" ; <[3 x i8]*> [#uses=1]
-@hello = constant [13 x i8] c"hello world\0A\00" ; <[13 x i8]*> [#uses=1]
-@stdout = external global %struct._IO_FILE* ; <%struct._IO_FILE**> [#uses=3]
-
-declare i32 @fprintf(%struct._IO_FILE*, i8*, ...)
-
-define i32 @foo() {
-entry:
- %tmp.1 = load %struct._IO_FILE** @stdout ; <%struct._IO_FILE*> [#uses=1]
- %tmp.0 = call i32 (%struct._IO_FILE*, i8*, ...)* @fprintf( %struct._IO_FILE* %tmp.1, i8* getelementptr ([13 x i8]* @hello, i32 0, i32 0) ) ; <i32> [#uses=0]
- %tmp.4 = load %struct._IO_FILE** @stdout ; <%struct._IO_FILE*> [#uses=1]
- %tmp.3 = call i32 (%struct._IO_FILE*, i8*, ...)* @fprintf( %struct._IO_FILE* %tmp.4, i8* getelementptr ([3 x i8]* @str, i32 0, i32 0), i8* getelementptr ([13 x i8]* @hello, i32 0, i32 0) ) ; <i32> [#uses=0]
- %tmp.8 = load %struct._IO_FILE** @stdout ; <%struct._IO_FILE*> [#uses=1]
- %tmp.7 = call i32 (%struct._IO_FILE*, i8*, ...)* @fprintf( %struct._IO_FILE* %tmp.8, i8* getelementptr ([3 x i8]* @chr, i32 0, i32 0), i32 33 ) ; <i32> [#uses=0]
- ret i32 0
-}
-
diff --git a/release_23/test/Transforms/SimplifyLibCalls/IsDigit.ll b/release_23/test/Transforms/SimplifyLibCalls/IsDigit.ll
deleted file mode 100644
index a290e0107d45..000000000000
--- a/release_23/test/Transforms/SimplifyLibCalls/IsDigit.ll
+++ /dev/null
@@ -1,21 +0,0 @@
-; Test that the IsDigitOptimizer works correctly
-; RUN: llvm-as < %s | opt -simplify-libcalls | llvm-dis | \
-; RUN: not grep call
-
-declare i32 @isdigit(i32)
-
-declare i32 @isascii(i32)
-
-define i32 @main() {
- %val1 = call i32 @isdigit( i32 47 ) ; <i32> [#uses=1]
- %val2 = call i32 @isdigit( i32 48 ) ; <i32> [#uses=1]
- %val3 = call i32 @isdigit( i32 57 ) ; <i32> [#uses=1]
- %val4 = call i32 @isdigit( i32 58 ) ; <i32> [#uses=1]
- %rslt1 = add i32 %val1, %val2 ; <i32> [#uses=1]
- %rslt2 = add i32 %val3, %val4 ; <i32> [#uses=1]
- %sum = add i32 %rslt1, %rslt2 ; <i32> [#uses=1]
- %rslt = call i32 @isdigit( i32 %sum ) ; <i32> [#uses=1]
- %tmp = call i32 @isascii( i32 %rslt ) ; <i32> [#uses=1]
- ret i32 %tmp
-}
-
diff --git a/release_23/test/Transforms/SimplifyLibCalls/MemCpy.ll b/release_23/test/Transforms/SimplifyLibCalls/MemCpy.ll
deleted file mode 100644
index 4e33b0755f94..000000000000
--- a/release_23/test/Transforms/SimplifyLibCalls/MemCpy.ll
+++ /dev/null
@@ -1,20 +0,0 @@
-; RUN: llvm-as < %s | opt -constprop -instcombine | llvm-dis | not grep {call.*llvm.memcpy.i32}
-
-@h = constant [2 x i8] c"h\00" ; <[2 x i8]*> [#uses=1]
-@hel = constant [4 x i8] c"hel\00" ; <[4 x i8]*> [#uses=1]
-@hello_u = constant [8 x i8] c"hello_u\00" ; <[8 x i8]*> [#uses=1]
-
-declare void @llvm.memcpy.i32(i8*, i8*, i32, i32)
-
-define i32 @main() {
- %h_p = getelementptr [2 x i8]* @h, i32 0, i32 0 ; <i8*> [#uses=1]
- %hel_p = getelementptr [4 x i8]* @hel, i32 0, i32 0 ; <i8*> [#uses=1]
- %hello_u_p = getelementptr [8 x i8]* @hello_u, i32 0, i32 0 ; <i8*> [#uses=1]
- %target = alloca [1024 x i8] ; <[1024 x i8]*> [#uses=1]
- %target_p = getelementptr [1024 x i8]* %target, i32 0, i32 0 ; <i8*> [#uses=3]
- call void @llvm.memcpy.i32( i8* %target_p, i8* %h_p, i32 2, i32 2 )
- call void @llvm.memcpy.i32( i8* %target_p, i8* %hel_p, i32 4, i32 4 )
- call void @llvm.memcpy.i32( i8* %target_p, i8* %hello_u_p, i32 8, i32 8 )
- ret i32 0
-}
-
diff --git a/release_23/test/Transforms/SimplifyLibCalls/Printf.ll b/release_23/test/Transforms/SimplifyLibCalls/Printf.ll
deleted file mode 100644
index c892f0341ab3..000000000000
--- a/release_23/test/Transforms/SimplifyLibCalls/Printf.ll
+++ /dev/null
@@ -1,21 +0,0 @@
-; RUN: llvm-as < %s | opt -simplify-libcalls | llvm-dis | grep putchar
-; RUN: llvm-as < %s | opt -simplify-libcalls | llvm-dis | \
-; RUN: not grep {call.*printf}
-
-@str = internal constant [13 x i8] c"hello world\0A\00" ; <[13 x i8]*> [#uses=1]
-@str1 = internal constant [2 x i8] c"h\00" ; <[2 x i8]*> [#uses=1]
-
-define void @foo() {
-entry:
- %tmp1 = tail call i32 (i8*, ...)* @printf( i8* getelementptr ([13 x i8]* @str, i32 0, i32 0) ) ; <i32> [#uses=0]
- ret void
-}
-
-declare i32 @printf(i8*, ...)
-
-define void @bar() {
-entry:
- %tmp1 = tail call i32 (i8*, ...)* @printf( i8* getelementptr ([2 x i8]* @str1, i32 0, i32 0) ) ; <i32> [#uses=0]
- ret void
-}
-
diff --git a/release_23/test/Transforms/SimplifyLibCalls/Puts.ll b/release_23/test/Transforms/SimplifyLibCalls/Puts.ll
deleted file mode 100644
index e9bb2b381c98..000000000000
--- a/release_23/test/Transforms/SimplifyLibCalls/Puts.ll
+++ /dev/null
@@ -1,26 +0,0 @@
-; Test that the PutsCatOptimizer works correctly
-; RUN: llvm-as < %s | opt -simplify-libcalls | llvm-dis | \
-; RUN: not grep {call.*fputs}
-;
-
- %struct._IO_FILE = type { i32, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, %struct._IO_marker*, %struct._IO_FILE*, i32, i32, i32, i16, i8, [1 x i8], i8*, i64, i8*, i8*, i32, [52 x i8] }
- %struct._IO_marker = type { %struct._IO_marker*, %struct._IO_FILE*, i32 }
-@stdout = external global %struct._IO_FILE* ; <%struct._IO_FILE**> [#uses=1]
-@empty = constant [1 x i8] zeroinitializer ; <[1 x i8]*> [#uses=1]
-@len1 = constant [2 x i8] c"A\00" ; <[2 x i8]*> [#uses=1]
-@long = constant [7 x i8] c"hello\0A\00" ; <[7 x i8]*> [#uses=1]
-
-declare i32 @fputs(i8*, %struct._IO_FILE*)
-
-define i32 @main() {
-entry:
- %out = load %struct._IO_FILE** @stdout ; <%struct._IO_FILE*> [#uses=3]
- %s1 = getelementptr [1 x i8]* @empty, i32 0, i32 0 ; <i8*> [#uses=1]
- %s2 = getelementptr [2 x i8]* @len1, i32 0, i32 0 ; <i8*> [#uses=1]
- %s3 = getelementptr [7 x i8]* @long, i32 0, i32 0 ; <i8*> [#uses=1]
- %a = call i32 @fputs( i8* %s1, %struct._IO_FILE* %out ) ; <i32> [#uses=0]
- %b = call i32 @fputs( i8* %s2, %struct._IO_FILE* %out ) ; <i32> [#uses=0]
- %c = call i32 @fputs( i8* %s3, %struct._IO_FILE* %out ) ; <i32> [#uses=0]
- ret i32 0
-}
-
diff --git a/release_23/test/Transforms/SimplifyLibCalls/SPrintF.ll b/release_23/test/Transforms/SimplifyLibCalls/SPrintF.ll
deleted file mode 100644
index 53f5ef1f429e..000000000000
--- a/release_23/test/Transforms/SimplifyLibCalls/SPrintF.ll
+++ /dev/null
@@ -1,36 +0,0 @@
-; Test that the SPrintFOptimizer works correctly
-; RUN: llvm-as < %s | opt -simplify-libcalls | llvm-dis | \
-; RUN: not grep {call.*sprintf}
-
-@hello = constant [6 x i8] c"hello\00" ; <[6 x i8]*> [#uses=1]
-@null = constant [1 x i8] zeroinitializer ; <[1 x i8]*> [#uses=1]
-@null_hello = constant [7 x i8] c"\00hello\00" ; <[7 x i8]*> [#uses=1]
-@fmt1 = constant [3 x i8] c"%s\00" ; <[3 x i8]*> [#uses=1]
-@fmt2 = constant [3 x i8] c"%c\00" ; <[3 x i8]*> [#uses=1]
-
-declare i32 @sprintf(i8*, i8*, ...)
-
-declare i32 @puts(i8*)
-
-define i32 @foo(i8* %p) {
- %target = alloca [1024 x i8] ; <[1024 x i8]*> [#uses=1]
- %target_p = getelementptr [1024 x i8]* %target, i32 0, i32 0 ; <i8*> [#uses=7]
- %hello_p = getelementptr [6 x i8]* @hello, i32 0, i32 0 ; <i8*> [#uses=2]
- %null_p = getelementptr [1 x i8]* @null, i32 0, i32 0 ; <i8*> [#uses=1]
- %nh_p = getelementptr [7 x i8]* @null_hello, i32 0, i32 0 ; <i8*> [#uses=1]
- %fmt1_p = getelementptr [3 x i8]* @fmt1, i32 0, i32 0 ; <i8*> [#uses=2]
- %fmt2_p = getelementptr [3 x i8]* @fmt2, i32 0, i32 0 ; <i8*> [#uses=1]
- store i8 0, i8* %target_p
- %r1 = call i32 (i8*, i8*, ...)* @sprintf( i8* %target_p, i8* %hello_p ) ; <i32> [#uses=1]
- %r2 = call i32 (i8*, i8*, ...)* @sprintf( i8* %target_p, i8* %null_p ) ; <i32> [#uses=1]
- %r3 = call i32 (i8*, i8*, ...)* @sprintf( i8* %target_p, i8* %nh_p ) ; <i32> [#uses=1]
- %r4 = call i32 (i8*, i8*, ...)* @sprintf( i8* %target_p, i8* %fmt1_p, i8* %hello_p ) ; <i32> [#uses=1]
- %r4.1 = call i32 (i8*, i8*, ...)* @sprintf( i8* %target_p, i8* %fmt1_p, i8* %p ) ; <i32> [#uses=1]
- %r5 = call i32 (i8*, i8*, ...)* @sprintf( i8* %target_p, i8* %fmt2_p, i32 82 ) ; <i32> [#uses=1]
- %r6 = add i32 %r1, %r2 ; <i32> [#uses=1]
- %r7 = add i32 %r3, %r6 ; <i32> [#uses=1]
- %r8 = add i32 %r5, %r7 ; <i32> [#uses=1]
- %r9 = add i32 %r8, %r4 ; <i32> [#uses=1]
- %r10 = add i32 %r9, %r4.1 ; <i32> [#uses=1]
- ret i32 %r10
-}
diff --git a/release_23/test/Transforms/SimplifyLibCalls/StrCat.ll b/release_23/test/Transforms/SimplifyLibCalls/StrCat.ll
deleted file mode 100644
index a6ef6771b460..000000000000
--- a/release_23/test/Transforms/SimplifyLibCalls/StrCat.ll
+++ /dev/null
@@ -1,26 +0,0 @@
-; Test that the StrCatOptimizer works correctly
-; RUN: llvm-as < %s | opt -simplify-libcalls | llvm-dis | \
-; RUN: not grep {call.*strcat}
-
-@hello = constant [6 x i8] c"hello\00" ; <[6 x i8]*> [#uses=1]
-@null = constant [1 x i8] zeroinitializer ; <[1 x i8]*> [#uses=1]
-@null_hello = constant [7 x i8] c"\00hello\00" ; <[7 x i8]*> [#uses=1]
-
-declare i8* @strcat(i8*, i8*)
-
-declare i32 @puts(i8*)
-
-define i32 @main() {
- %target = alloca [1024 x i8] ; <[1024 x i8]*> [#uses=1]
- %arg1 = getelementptr [1024 x i8]* %target, i32 0, i32 0 ; <i8*> [#uses=2]
- store i8 0, i8* %arg1
- %arg2 = getelementptr [6 x i8]* @hello, i32 0, i32 0 ; <i8*> [#uses=1]
- %rslt1 = call i8* @strcat( i8* %arg1, i8* %arg2 ) ; <i8*> [#uses=1]
- %arg3 = getelementptr [1 x i8]* @null, i32 0, i32 0 ; <i8*> [#uses=1]
- %rslt2 = call i8* @strcat( i8* %rslt1, i8* %arg3 ) ; <i8*> [#uses=1]
- %arg4 = getelementptr [7 x i8]* @null_hello, i32 0, i32 0 ; <i8*> [#uses=1]
- %rslt3 = call i8* @strcat( i8* %rslt2, i8* %arg4 ) ; <i8*> [#uses=1]
- call i32 @puts( i8* %rslt3 ) ; <i32>:1 [#uses=0]
- ret i32 0
-}
-
diff --git a/release_23/test/Transforms/SimplifyLibCalls/StrChr.ll b/release_23/test/Transforms/SimplifyLibCalls/StrChr.ll
deleted file mode 100644
index 802639f72320..000000000000
--- a/release_23/test/Transforms/SimplifyLibCalls/StrChr.ll
+++ /dev/null
@@ -1,22 +0,0 @@
-; Test that the StrChrOptimizer works correctly
-; RUN: llvm-as < %s | opt -simplify-libcalls | llvm-dis | \
-; RUN: not grep {call.*@strchr}
-
-@hello = constant [14 x i8] c"hello world\5Cn\00" ; <[14 x i8]*> [#uses=1]
-@null = constant [1 x i8] zeroinitializer ; <[1 x i8]*> [#uses=1]
-
-declare i8* @strchr(i8*, i32)
-
-declare i32 @puts(i8*)
-
-define i32 @main() {
- %hello_p = getelementptr [14 x i8]* @hello, i32 0, i32 0 ; <i8*> [#uses=2]
- %null_p = getelementptr [1 x i8]* @null, i32 0, i32 0 ; <i8*> [#uses=1]
- %world = call i8* @strchr( i8* %hello_p, i32 119 ) ; <i8*> [#uses=1]
- %ignore = call i8* @strchr( i8* %null_p, i32 119 ) ; <i8*> [#uses=0]
- %len = call i32 @puts( i8* %world ) ; <i32> [#uses=1]
- %index = add i32 %len, 112 ; <i32> [#uses=2]
- %result = call i8* @strchr( i8* %hello_p, i32 %index ) ; <i8*> [#uses=0]
- ret i32 %index
-}
-
diff --git a/release_23/test/Transforms/SimplifyLibCalls/StrCmp.ll b/release_23/test/Transforms/SimplifyLibCalls/StrCmp.ll
deleted file mode 100644
index ae28e4a10008..000000000000
--- a/release_23/test/Transforms/SimplifyLibCalls/StrCmp.ll
+++ /dev/null
@@ -1,28 +0,0 @@
-; Test that the StrCmpOptimizer works correctly
-; RUN: llvm-as < %s | opt -simplify-libcalls | llvm-dis | \
-; RUN: not grep {call.*strcmp}
-
-@hello = constant [6 x i8] c"hello\00" ; <[6 x i8]*> [#uses=1]
-@hell = constant [5 x i8] c"hell\00" ; <[5 x i8]*> [#uses=1]
-@null = constant [1 x i8] zeroinitializer ; <[1 x i8]*> [#uses=1]
-
-declare i32 @strcmp(i8*, i8*)
-
-declare i32 @puts(i8*)
-
-define i32 @main() {
- %hello_p = getelementptr [6 x i8]* @hello, i32 0, i32 0 ; <i8*> [#uses=5]
- %hell_p = getelementptr [5 x i8]* @hell, i32 0, i32 0 ; <i8*> [#uses=1]
- %null_p = getelementptr [1 x i8]* @null, i32 0, i32 0 ; <i8*> [#uses=4]
- %temp1 = call i32 @strcmp( i8* %hello_p, i8* %hello_p ) ; <i32> [#uses=1]
- %temp2 = call i32 @strcmp( i8* %null_p, i8* %null_p ) ; <i32> [#uses=1]
- %temp3 = call i32 @strcmp( i8* %hello_p, i8* %null_p ) ; <i32> [#uses=1]
- %temp4 = call i32 @strcmp( i8* %null_p, i8* %hello_p ) ; <i32> [#uses=1]
- %temp5 = call i32 @strcmp( i8* %hell_p, i8* %hello_p ) ; <i32> [#uses=1]
- %rslt1 = add i32 %temp1, %temp2 ; <i32> [#uses=1]
- %rslt2 = add i32 %rslt1, %temp3 ; <i32> [#uses=1]
- %rslt3 = add i32 %rslt2, %temp4 ; <i32> [#uses=1]
- %rslt4 = add i32 %rslt3, %temp5 ; <i32> [#uses=1]
- ret i32 %rslt4
-}
-
diff --git a/release_23/test/Transforms/SimplifyLibCalls/StrCpy.ll b/release_23/test/Transforms/SimplifyLibCalls/StrCpy.ll
deleted file mode 100644
index f23582c46206..000000000000
--- a/release_23/test/Transforms/SimplifyLibCalls/StrCpy.ll
+++ /dev/null
@@ -1,26 +0,0 @@
-; Test that the StrCpyOptimizer works correctly
-; RUN: llvm-as < %s | opt -simplify-libcalls | llvm-dis | \
-; RUN: not grep {call.*strcpy}
-
-@hello = constant [6 x i8] c"hello\00" ; <[6 x i8]*> [#uses=1]
-@null = constant [1 x i8] zeroinitializer ; <[1 x i8]*> [#uses=1]
-@null_hello = constant [7 x i8] c"\00hello\00" ; <[7 x i8]*> [#uses=1]
-
-declare i8* @strcpy(i8*, i8*)
-
-declare i32 @puts(i8*)
-
-define i32 @main() {
- %target = alloca [1024 x i8] ; <[1024 x i8]*> [#uses=1]
- %arg1 = getelementptr [1024 x i8]* %target, i32 0, i32 0 ; <i8*> [#uses=2]
- store i8 0, i8* %arg1
- %arg2 = getelementptr [6 x i8]* @hello, i32 0, i32 0 ; <i8*> [#uses=1]
- %rslt1 = call i8* @strcpy( i8* %arg1, i8* %arg2 ) ; <i8*> [#uses=1]
- %arg3 = getelementptr [1 x i8]* @null, i32 0, i32 0 ; <i8*> [#uses=1]
- %rslt2 = call i8* @strcpy( i8* %rslt1, i8* %arg3 ) ; <i8*> [#uses=1]
- %arg4 = getelementptr [7 x i8]* @null_hello, i32 0, i32 0 ; <i8*> [#uses=1]
- %rslt3 = call i8* @strcpy( i8* %rslt2, i8* %arg4 ) ; <i8*> [#uses=1]
- call i32 @puts( i8* %rslt3 ) ; <i32>:1 [#uses=0]
- ret i32 0
-}
-
diff --git a/release_23/test/Transforms/SimplifyLibCalls/StrLen.ll b/release_23/test/Transforms/SimplifyLibCalls/StrLen.ll
deleted file mode 100644
index 521a2242c9bf..000000000000
--- a/release_23/test/Transforms/SimplifyLibCalls/StrLen.ll
+++ /dev/null
@@ -1,56 +0,0 @@
-; Test that the StrCatOptimizer works correctly
-; RUN: llvm-as < %s | opt -simplify-libcalls | llvm-dis | \
-; RUN: not grep {call.*strlen}
-
-target datalayout = "e-p:32:32"
-@hello = constant [6 x i8] c"hello\00" ; <[6 x i8]*> [#uses=3]
-@null = constant [1 x i8] zeroinitializer ; <[1 x i8]*> [#uses=3]
-@null_hello = constant [7 x i8] c"\00hello\00" ; <[7 x i8]*> [#uses=1]
-
-declare i32 @strlen(i8*)
-
-define i32 @test1() {
- %hello_p = getelementptr [6 x i8]* @hello, i32 0, i32 0 ; <i8*> [#uses=1]
- %hello_l = call i32 @strlen( i8* %hello_p ) ; <i32> [#uses=1]
- ret i32 %hello_l
-}
-
-define i32 @test2() {
- %null_p = getelementptr [1 x i8]* @null, i32 0, i32 0 ; <i8*> [#uses=1]
- %null_l = call i32 @strlen( i8* %null_p ) ; <i32> [#uses=1]
- ret i32 %null_l
-}
-
-define i32 @test3() {
- %null_hello_p = getelementptr [7 x i8]* @null_hello, i32 0, i32 0 ; <i8*> [#uses=1]
- %null_hello_l = call i32 @strlen( i8* %null_hello_p ) ; <i32> [#uses=1]
- ret i32 %null_hello_l
-}
-
-define i1 @test4() {
- %hello_p = getelementptr [6 x i8]* @hello, i32 0, i32 0 ; <i8*> [#uses=1]
- %hello_l = call i32 @strlen( i8* %hello_p ) ; <i32> [#uses=1]
- %eq_hello = icmp eq i32 %hello_l, 0 ; <i1> [#uses=1]
- ret i1 %eq_hello
-}
-
-define i1 @test5() {
- %null_p = getelementptr [1 x i8]* @null, i32 0, i32 0 ; <i8*> [#uses=1]
- %null_l = call i32 @strlen( i8* %null_p ) ; <i32> [#uses=1]
- %eq_null = icmp eq i32 %null_l, 0 ; <i1> [#uses=1]
- ret i1 %eq_null
-}
-
-define i1 @test6() {
- %hello_p = getelementptr [6 x i8]* @hello, i32 0, i32 0 ; <i8*> [#uses=1]
- %hello_l = call i32 @strlen( i8* %hello_p ) ; <i32> [#uses=1]
- %ne_hello = icmp ne i32 %hello_l, 0 ; <i1> [#uses=1]
- ret i1 %ne_hello
-}
-
-define i1 @test7() {
- %null_p = getelementptr [1 x i8]* @null, i32 0, i32 0 ; <i8*> [#uses=1]
- %null_l = call i32 @strlen( i8* %null_p ) ; <i32> [#uses=1]
- %ne_null = icmp ne i32 %null_l, 0 ; <i1> [#uses=1]
- ret i1 %ne_null
-}
diff --git a/release_23/test/Transforms/SimplifyLibCalls/StrNCmp.ll b/release_23/test/Transforms/SimplifyLibCalls/StrNCmp.ll
deleted file mode 100644
index f85394d30281..000000000000
--- a/release_23/test/Transforms/SimplifyLibCalls/StrNCmp.ll
+++ /dev/null
@@ -1,28 +0,0 @@
-; Test that the StrNCmpOptimizer works correctly
-; RUN: llvm-as < %s | opt -simplify-libcalls | llvm-dis | \
-; RUN: not grep {call.*strncmp}
-
-@hello = constant [6 x i8] c"hello\00" ; <[6 x i8]*> [#uses=1]
-@hell = constant [5 x i8] c"hell\00" ; <[5 x i8]*> [#uses=1]
-@null = constant [1 x i8] zeroinitializer ; <[1 x i8]*> [#uses=1]
-
-declare i32 @strncmp(i8*, i8*, i32)
-
-declare i32 @puts(i8*)
-
-define i32 @main() {
- %hello_p = getelementptr [6 x i8]* @hello, i32 0, i32 0 ; <i8*> [#uses=5]
- %hell_p = getelementptr [5 x i8]* @hell, i32 0, i32 0 ; <i8*> [#uses=1]
- %null_p = getelementptr [1 x i8]* @null, i32 0, i32 0 ; <i8*> [#uses=4]
- %temp1 = call i32 @strncmp( i8* %hello_p, i8* %hello_p, i32 5 ) ; <i32> [#uses=1]
- %temp2 = call i32 @strncmp( i8* %null_p, i8* %null_p, i32 0 ) ; <i32> [#uses=1]
- %temp3 = call i32 @strncmp( i8* %hello_p, i8* %null_p, i32 0 ) ; <i32> [#uses=1]
- %temp4 = call i32 @strncmp( i8* %null_p, i8* %hello_p, i32 0 ) ; <i32> [#uses=1]
- %temp5 = call i32 @strncmp( i8* %hell_p, i8* %hello_p, i32 4 ) ; <i32> [#uses=1]
- %rslt1 = add i32 %temp1, %temp2 ; <i32> [#uses=1]
- %rslt2 = add i32 %rslt1, %temp3 ; <i32> [#uses=1]
- %rslt3 = add i32 %rslt2, %temp4 ; <i32> [#uses=1]
- %rslt4 = add i32 %rslt3, %temp5 ; <i32> [#uses=1]
- ret i32 %rslt4
-}
-
diff --git a/release_23/test/Transforms/SimplifyLibCalls/ToAscii.ll b/release_23/test/Transforms/SimplifyLibCalls/ToAscii.ll
deleted file mode 100644
index 9200d2f67edf..000000000000
--- a/release_23/test/Transforms/SimplifyLibCalls/ToAscii.ll
+++ /dev/null
@@ -1,21 +0,0 @@
-; Test that the ToAsciiOptimizer works correctly
-; RUN: llvm-as < %s | opt -simplify-libcalls | llvm-dis | \
-; RUN: not grep {call.*toascii}
-
-declare i32 @toascii(i32)
-
-define i32 @main() {
- %val1 = call i32 @toascii( i32 1 ) ; <i32> [#uses=1]
- %val2 = call i32 @toascii( i32 0 ) ; <i32> [#uses=1]
- %val3 = call i32 @toascii( i32 127 ) ; <i32> [#uses=1]
- %val4 = call i32 @toascii( i32 128 ) ; <i32> [#uses=1]
- %val5 = call i32 @toascii( i32 255 ) ; <i32> [#uses=1]
- %val6 = call i32 @toascii( i32 256 ) ; <i32> [#uses=1]
- %rslt1 = add i32 %val1, %val2 ; <i32> [#uses=1]
- %rslt2 = add i32 %val3, %val4 ; <i32> [#uses=1]
- %rslt3 = add i32 %val5, %val6 ; <i32> [#uses=1]
- %rslt4 = add i32 %rslt1, %rslt2 ; <i32> [#uses=1]
- %rslt5 = add i32 %rslt4, %rslt3 ; <i32> [#uses=1]
- ret i32 %rslt5
-}
-
diff --git a/release_23/test/Transforms/SimplifyLibCalls/dg.exp b/release_23/test/Transforms/SimplifyLibCalls/dg.exp
deleted file mode 100644
index 879685ca879d..000000000000
--- a/release_23/test/Transforms/SimplifyLibCalls/dg.exp
+++ /dev/null
@@ -1,3 +0,0 @@
-load_lib llvm.exp
-
-RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
diff --git a/release_23/test/Transforms/SimplifyLibCalls/exp2.ll b/release_23/test/Transforms/SimplifyLibCalls/exp2.ll
deleted file mode 100644
index dea3df4b51bc..000000000000
--- a/release_23/test/Transforms/SimplifyLibCalls/exp2.ll
+++ /dev/null
@@ -1,38 +0,0 @@
-; RUN: llvm-as < %s | opt -simplify-libcalls | llvm-dis | grep {call.*ldexp} | count 4
-; rdar://5852514
-
-target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
-target triple = "i386-apple-darwin8"
-
-define double @t1(i32 %x) nounwind {
-entry:
- %tmp12 = sitofp i32 %x to double ; <double> [#uses=1]
- %exp2 = tail call double @exp2( double %tmp12 ) ; <double> [#uses=1]
- ret double %exp2
-}
-
-define float @t4(i8 zeroext %x) nounwind {
-entry:
- %tmp12 = uitofp i8 %x to float ; <float> [#uses=1]
- %tmp3 = tail call float @exp2f( float %tmp12 ) nounwind readonly ; <float> [#uses=1]
- ret float %tmp3
-}
-
-declare float @exp2f(float) nounwind readonly
-
-define double @t3(i16 zeroext %x) nounwind {
-entry:
- %tmp12 = uitofp i16 %x to double ; <double> [#uses=1]
- %exp2 = tail call double @exp2( double %tmp12 ) ; <double> [#uses=1]
- ret double %exp2
-}
-
-define double @t2(i16 signext %x) nounwind {
-entry:
- %tmp12 = sitofp i16 %x to double ; <double> [#uses=1]
- %exp2 = tail call double @exp2( double %tmp12 ) ; <double> [#uses=1]
- ret double %exp2
-}
-
-declare double @exp2(double)
-
diff --git a/release_23/test/Transforms/SimplifyLibCalls/floor.ll b/release_23/test/Transforms/SimplifyLibCalls/floor.ll
deleted file mode 100644
index 31eb3f65623f..000000000000
--- a/release_23/test/Transforms/SimplifyLibCalls/floor.ll
+++ /dev/null
@@ -1,39 +0,0 @@
-; RUN: llvm-as < %s | opt -simplify-libcalls | llvm-dis > %t
-; RUN: not grep {call.*floor(} %t
-; RUN: grep {call.*floorf(} %t
-; RUN: not grep {call.*ceil(} %t
-; RUN: grep {call.*ceilf(} %t
-; RUN: not grep {call.*nearbyint(} %t
-; RUN: grep {call.*nearbyintf(} %t
-; XFAIL: sparc
-
-declare double @floor(double)
-
-declare double @ceil(double)
-
-declare double @nearbyint(double)
-
-define float @test_floor(float %C) {
- %D = fpext float %C to double ; <double> [#uses=1]
- ; --> floorf
- %E = call double @floor( double %D ) ; <double> [#uses=1]
- %F = fptrunc double %E to float ; <float> [#uses=1]
- ret float %F
-}
-
-define float @test_ceil(float %C) {
- %D = fpext float %C to double ; <double> [#uses=1]
- ; --> ceilf
- %E = call double @ceil( double %D ) ; <double> [#uses=1]
- %F = fptrunc double %E to float ; <float> [#uses=1]
- ret float %F
-}
-
-define float @test_nearbyint(float %C) {
- %D = fpext float %C to double ; <double> [#uses=1]
- ; --> nearbyintf
- %E = call double @nearbyint( double %D ) ; <double> [#uses=1]
- %F = fptrunc double %E to float ; <float> [#uses=1]
- ret float %F
-}
-
diff --git a/release_23/test/Transforms/SimplifyLibCalls/memcmp.ll b/release_23/test/Transforms/SimplifyLibCalls/memcmp.ll
deleted file mode 100644
index 7bdbc8d17e4f..000000000000
--- a/release_23/test/Transforms/SimplifyLibCalls/memcmp.ll
+++ /dev/null
@@ -1,22 +0,0 @@
-; Test that the memcmpOptimizer works correctly
-; RUN: llvm-as < %s | opt -simplify-libcalls | llvm-dis | not grep {call.*memcmp}
-
-@h = constant [2 x i8] c"h\00" ; <[2 x i8]*> [#uses=0]
-@hel = constant [4 x i8] c"hel\00" ; <[4 x i8]*> [#uses=0]
-@hello_u = constant [8 x i8] c"hello_u\00" ; <[8 x i8]*> [#uses=0]
-
-declare i32 @memcmp(i8*, i8*, i32)
-
-define void @test(i8* %P, i8* %Q, i32 %N, i32* %IP, i1* %BP) {
- %A = call i32 @memcmp( i8* %P, i8* %P, i32 %N ) ; <i32> [#uses=1]
- volatile store i32 %A, i32* %IP
- %B = call i32 @memcmp( i8* %P, i8* %Q, i32 0 ) ; <i32> [#uses=1]
- volatile store i32 %B, i32* %IP
- %C = call i32 @memcmp( i8* %P, i8* %Q, i32 1 ) ; <i32> [#uses=1]
- volatile store i32 %C, i32* %IP
- %D = call i32 @memcmp( i8* %P, i8* %Q, i32 2 ) ; <i32> [#uses=1]
- %E = icmp eq i32 %D, 0 ; <i1> [#uses=1]
- volatile store i1 %E, i1* %BP
- ret void
-}
-
diff --git a/release_23/test/Transforms/SimplifyLibCalls/pow2.ll b/release_23/test/Transforms/SimplifyLibCalls/pow2.ll
deleted file mode 100644
index a48abbaf1e74..000000000000
--- a/release_23/test/Transforms/SimplifyLibCalls/pow2.ll
+++ /dev/null
@@ -1,37 +0,0 @@
-; Testcase for calls to the standard C "pow" function
-;
-; RUN: llvm-as < %s | opt -simplify-libcalls | llvm-dis | not grep {call .pow}
-
-
-declare double @pow(double, double)
-declare float @powf(float, float)
-
-define double @test1(double %X) {
- %Y = call double @pow( double %X, double 0.000000e+00 ) ; <double> [#uses=1]
- ret double %Y
-}
-
-define double @test2(double %X) {
- %Y = call double @pow( double %X, double -0.000000e+00 ) ; <double> [#uses=1]
- ret double %Y
-}
-
-define double @test3(double %X) {
- %Y = call double @pow( double 1.000000e+00, double %X ) ; <double> [#uses=1]
- ret double %Y
-}
-
-define double @test4(double %X) {
- %Y = call double @pow( double %X, double 2.0)
- ret double %Y
-}
-
-define float @test4f(float %X) {
- %Y = call float @powf( float %X, float 2.0)
- ret float %Y
-}
-
-define float @test5f(float %X) {
- %Y = call float @powf(float 2.0, float %X) ;; exp2
- ret float %Y
-}
diff --git a/release_23/test/Transforms/StripSymbols/2007-01-15-llvm.used.ll b/release_23/test/Transforms/StripSymbols/2007-01-15-llvm.used.ll
deleted file mode 100644
index 16cee15ee179..000000000000
--- a/release_23/test/Transforms/StripSymbols/2007-01-15-llvm.used.ll
+++ /dev/null
@@ -1,15 +0,0 @@
-; RUN: llvm-as < %s | opt -strip | llvm-dis | grep foo | count 2
-; RUN: llvm-as < %s | opt -strip | llvm-dis | grep bar | count 2
-@llvm.used = appending global [2 x i8*] [ i8* bitcast (i32* @foo to i8*), i8* bitcast (i32 ()* @bar to i8*) ], section "llvm.metadata" ; <[2 x i8*]*> [#uses=0]
-@foo = internal constant i32 41 ; <i32*> [#uses=1]
-
-define internal i32 @bar() nounwind {
-entry:
- ret i32 42
-}
-
-define i32 @main() nounwind {
-entry:
- ret i32 0
-}
-
diff --git a/release_23/test/Transforms/StripSymbols/dg.exp b/release_23/test/Transforms/StripSymbols/dg.exp
deleted file mode 100644
index 879685ca879d..000000000000
--- a/release_23/test/Transforms/StripSymbols/dg.exp
+++ /dev/null
@@ -1,3 +0,0 @@
-load_lib llvm.exp
-
-RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
diff --git a/release_23/test/Transforms/TailCallElim/accum_recursion.ll b/release_23/test/Transforms/TailCallElim/accum_recursion.ll
deleted file mode 100644
index e8c28ec80672..000000000000
--- a/release_23/test/Transforms/TailCallElim/accum_recursion.ll
+++ /dev/null
@@ -1,15 +0,0 @@
-; RUN: llvm-as < %s | opt -tailcallelim | llvm-dis | not grep call
-
-define i32 @factorial(i32 %x) {
-entry:
- %tmp.1 = icmp sgt i32 %x, 0 ; <i1> [#uses=1]
- br i1 %tmp.1, label %then, label %else
-then: ; preds = %entry
- %tmp.6 = add i32 %x, -1 ; <i32> [#uses=1]
- %tmp.4 = call i32 @factorial( i32 %tmp.6 ) ; <i32> [#uses=1]
- %tmp.7 = mul i32 %tmp.4, %x ; <i32> [#uses=1]
- ret i32 %tmp.7
-else: ; preds = %entry
- ret i32 1
-}
-
diff --git a/release_23/test/Transforms/TailCallElim/accum_recursion_constant_arg.ll b/release_23/test/Transforms/TailCallElim/accum_recursion_constant_arg.ll
deleted file mode 100644
index 4d63b595d7cc..000000000000
--- a/release_23/test/Transforms/TailCallElim/accum_recursion_constant_arg.ll
+++ /dev/null
@@ -1,20 +0,0 @@
-; This is a more aggressive form of accumulator recursion insertion, which
-; requires noticing that X doesn't change as we perform the tailcall. Thanks
-; go out to the anonymous users of the demo script for "suggesting"
-; optimizations that should be done. :)
-
-; RUN: llvm-as < %s | opt -tailcallelim | llvm-dis | not grep call
-
-define i32 @mul(i32 %x, i32 %y) {
-entry:
- %tmp.1 = icmp eq i32 %y, 0 ; <i1> [#uses=1]
- br i1 %tmp.1, label %return, label %endif
-endif: ; preds = %entry
- %tmp.8 = add i32 %y, -1 ; <i32> [#uses=1]
- %tmp.5 = call i32 @mul( i32 %x, i32 %tmp.8 ) ; <i32> [#uses=1]
- %tmp.9 = add i32 %tmp.5, %x ; <i32> [#uses=1]
- ret i32 %tmp.9
-return: ; preds = %entry
- ret i32 %x
-}
-
diff --git a/release_23/test/Transforms/TailCallElim/ackermann.ll b/release_23/test/Transforms/TailCallElim/ackermann.ll
deleted file mode 100644
index f65c66669e56..000000000000
--- a/release_23/test/Transforms/TailCallElim/ackermann.ll
+++ /dev/null
@@ -1,26 +0,0 @@
-; This function contains two tail calls, which should be eliminated
-; RUN: llvm-as < %s | \
-; RUN: opt -tailcallelim -stats -disable-output |& grep {2 tailcallelim}
-
-define i32 @Ack(i32 %M.1, i32 %N.1) {
-entry:
- %tmp.1 = icmp eq i32 %M.1, 0 ; <i1> [#uses=1]
- br i1 %tmp.1, label %then.0, label %endif.0
-then.0: ; preds = %entry
- %tmp.4 = add i32 %N.1, 1 ; <i32> [#uses=1]
- ret i32 %tmp.4
-endif.0: ; preds = %entry
- %tmp.6 = icmp eq i32 %N.1, 0 ; <i1> [#uses=1]
- br i1 %tmp.6, label %then.1, label %endif.1
-then.1: ; preds = %endif.0
- %tmp.10 = add i32 %M.1, -1 ; <i32> [#uses=1]
- %tmp.8 = call i32 @Ack( i32 %tmp.10, i32 1 ) ; <i32> [#uses=1]
- ret i32 %tmp.8
-endif.1: ; preds = %endif.0
- %tmp.13 = add i32 %M.1, -1 ; <i32> [#uses=1]
- %tmp.17 = add i32 %N.1, -1 ; <i32> [#uses=1]
- %tmp.14 = call i32 @Ack( i32 %M.1, i32 %tmp.17 ) ; <i32> [#uses=1]
- %tmp.11 = call i32 @Ack( i32 %tmp.13, i32 %tmp.14 ) ; <i32> [#uses=1]
- ret i32 %tmp.11
-}
-
diff --git a/release_23/test/Transforms/TailCallElim/dg.exp b/release_23/test/Transforms/TailCallElim/dg.exp
deleted file mode 100644
index 879685ca879d..000000000000
--- a/release_23/test/Transforms/TailCallElim/dg.exp
+++ /dev/null
@@ -1,3 +0,0 @@
-load_lib llvm.exp
-
-RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
diff --git a/release_23/test/Transforms/TailCallElim/dont-tce-tail-marked-call.ll b/release_23/test/Transforms/TailCallElim/dont-tce-tail-marked-call.ll
deleted file mode 100644
index e20fe18d5ada..000000000000
--- a/release_23/test/Transforms/TailCallElim/dont-tce-tail-marked-call.ll
+++ /dev/null
@@ -1,13 +0,0 @@
-; RUN: llvm-as < %s | opt -tailcallelim | llvm-dis | \
-; RUN: grep {call i32 @foo}
-
-declare void @bar(i32*)
-
-define i32 @foo(i32 %N) {
- %A = alloca i32, i32 %N ; <i32*> [#uses=2]
- store i32 17, i32* %A
- call void @bar( i32* %A )
- %X = tail call i32 @foo( i32 %N ) ; <i32> [#uses=1]
- ret i32 %X
-}
-
diff --git a/release_23/test/Transforms/TailCallElim/inf-recursion.ll b/release_23/test/Transforms/TailCallElim/inf-recursion.ll
deleted file mode 100644
index fe00f4a764e9..000000000000
--- a/release_23/test/Transforms/TailCallElim/inf-recursion.ll
+++ /dev/null
@@ -1,10 +0,0 @@
-; RUN: llvm-as < %s | opt -tailcallelim | llvm-dis | grep call
-; Don't turn this into an infinite loop, this is probably the implementation
-; of fabs and we expect the codegen to lower fabs.
-
-define double @fabs(double %f) {
-entry:
- %tmp2 = call double @fabs( double %f ) ; <double> [#uses=1]
- ret double %tmp2
-}
-
diff --git a/release_23/test/Transforms/TailCallElim/intervening-inst.ll b/release_23/test/Transforms/TailCallElim/intervening-inst.ll
deleted file mode 100644
index ae4f50941f81..000000000000
--- a/release_23/test/Transforms/TailCallElim/intervening-inst.ll
+++ /dev/null
@@ -1,17 +0,0 @@
-; This function contains intervening instructions which should be moved out of the way
-; RUN: llvm-as < %s | opt -tailcallelim | llvm-dis | not grep call
-
-define i32 @Test(i32 %X) {
-entry:
- %tmp.1 = icmp eq i32 %X, 0 ; <i1> [#uses=1]
- br i1 %tmp.1, label %then.0, label %endif.0
-then.0: ; preds = %entry
- %tmp.4 = add i32 %X, 1 ; <i32> [#uses=1]
- ret i32 %tmp.4
-endif.0: ; preds = %entry
- %tmp.10 = add i32 %X, -1 ; <i32> [#uses=1]
- %tmp.8 = call i32 @Test( i32 %tmp.10 ) ; <i32> [#uses=1]
- %DUMMY = add i32 %X, 1 ; <i32> [#uses=0]
- ret i32 %tmp.8
-}
-
diff --git a/release_23/test/Transforms/TailCallElim/move_alloca_for_tail_call.ll b/release_23/test/Transforms/TailCallElim/move_alloca_for_tail_call.ll
deleted file mode 100644
index bd2b93f7a8d6..000000000000
--- a/release_23/test/Transforms/TailCallElim/move_alloca_for_tail_call.ll
+++ /dev/null
@@ -1,13 +0,0 @@
-; RUN: llvm-as < %s | opt -tailcallelim | llvm-dis | \
-; RUN: %prcontext alloca 1 | grep {i32 @foo}
-
-declare void @bar(i32*)
-
-define i32 @foo() {
- %A = alloca i32 ; <i32*> [#uses=2]
- store i32 17, i32* %A
- call void @bar( i32* %A )
- %X = tail call i32 @foo( ) ; <i32> [#uses=1]
- ret i32 %X
-}
-
diff --git a/release_23/test/Transforms/TailCallElim/return_constant.ll b/release_23/test/Transforms/TailCallElim/return_constant.ll
deleted file mode 100644
index ab69a42b7851..000000000000
--- a/release_23/test/Transforms/TailCallElim/return_constant.ll
+++ /dev/null
@@ -1,17 +0,0 @@
-; Though this case seems to be fairly unlikely to occur in the wild, someone
-; plunked it into the demo script, so maybe they care about it.
-;
-; RUN: llvm-as < %s | opt -tailcallelim | llvm-dis | not grep call
-
-define i32 @aaa(i32 %c) {
-entry:
- %tmp.1 = icmp eq i32 %c, 0 ; <i1> [#uses=1]
- br i1 %tmp.1, label %return, label %else
-else: ; preds = %entry
- %tmp.5 = add i32 %c, -1 ; <i32> [#uses=1]
- %tmp.3 = call i32 @aaa( i32 %tmp.5 ) ; <i32> [#uses=0]
- ret i32 0
-return: ; preds = %entry
- ret i32 0
-}
-
diff --git a/release_23/test/Transforms/TailCallElim/trivial_codegen_tailcall.ll b/release_23/test/Transforms/TailCallElim/trivial_codegen_tailcall.ll
deleted file mode 100644
index 90a8163ee321..000000000000
--- a/release_23/test/Transforms/TailCallElim/trivial_codegen_tailcall.ll
+++ /dev/null
@@ -1,11 +0,0 @@
-; RUN: llvm-as < %s | opt -tailcallelim | llvm-dis | \
-; RUN: grep {tail call void @foo}
-
-
-declare void @foo()
-
-define void @bar() {
- call void @foo( )
- ret void
-}
-
diff --git a/release_23/test/Transforms/TailDup/2003-06-24-Simpleloop.ll b/release_23/test/Transforms/TailDup/2003-06-24-Simpleloop.ll
deleted file mode 100644
index 5c3b5394ef46..000000000000
--- a/release_23/test/Transforms/TailDup/2003-06-24-Simpleloop.ll
+++ /dev/null
@@ -1,15 +0,0 @@
-; RUN: llvm-as < %s | opt -tailduplicate -disable-output
-
-define void @motion_result7() {
-entry:
- br label %endif
-endif: ; preds = %no_exit, %entry
- %i.1 = phi i32 [ %inc, %no_exit ], [ 0, %entry ] ; <i32> [#uses=1]
- %inc = add i32 %i.1, 1 ; <i32> [#uses=1]
- br i1 false, label %no_exit, label %UnifiedExitNode
-no_exit: ; preds = %endif
- br i1 false, label %UnifiedExitNode, label %endif
-UnifiedExitNode: ; preds = %no_exit, %endif
- ret void
-}
-
diff --git a/release_23/test/Transforms/TailDup/2003-07-22-InfiniteLoop.ll b/release_23/test/Transforms/TailDup/2003-07-22-InfiniteLoop.ll
deleted file mode 100644
index 705f8bcdd652..000000000000
--- a/release_23/test/Transforms/TailDup/2003-07-22-InfiniteLoop.ll
+++ /dev/null
@@ -1,11 +0,0 @@
-; RUN: llvm-as < %s | opt -tailduplicate -disable-output
-
-define i32 @sum() {
-entry:
- br label %loopentry
-loopentry: ; preds = %loopentry, %entry
- %i.0 = phi i32 [ 1, %entry ], [ %tmp.3, %loopentry ] ; <i32> [#uses=1]
- %tmp.3 = add i32 %i.0, 1 ; <i32> [#uses=1]
- br label %loopentry
-}
-
diff --git a/release_23/test/Transforms/TailDup/2003-08-23-InvalidatedPointers.ll b/release_23/test/Transforms/TailDup/2003-08-23-InvalidatedPointers.ll
deleted file mode 100644
index 1fae77b0892e..000000000000
--- a/release_23/test/Transforms/TailDup/2003-08-23-InvalidatedPointers.ll
+++ /dev/null
@@ -1,29 +0,0 @@
-; RUN: llvm-as < %s | opt -tailduplicate -disable-output
-
-define i32 @sell_haggle() {
-entry:
- br i1 false, label %then.5, label %UnifiedExitNode
-then.5: ; preds = %entry
- br i1 false, label %loopentry.1.preheader, label %else.1
-else.1: ; preds = %then.5
- br label %loopentry.1.preheader
-loopentry.1.preheader: ; preds = %else.1, %then.5
- %final_ask.0 = phi i32 [ 0, %else.1 ], [ 0, %then.5 ] ; <i32> [#uses=2]
- br label %loopentry.1
-loopentry.1: ; preds = %endif.17, %loopentry.1.preheader
- switch i32 0, label %UnifiedExitNode [
- i32 2, label %UnifiedExitNode
- i32 1, label %endif.16
- ]
-endif.16: ; preds = %loopentry.1
- br i1 false, label %then.17, label %UnifiedExitNode
-then.17: ; preds = %endif.16
- br i1 false, label %then.18, label %endif.17
-then.18: ; preds = %then.17
- br i1 false, label %endif.17, label %UnifiedExitNode
-endif.17: ; preds = %then.18, %then.17
- %cur_ask.3 = phi i32 [ %final_ask.0, %then.17 ], [ %final_ask.0, %then.18 ] ; <i32> [#uses=0]
- br i1 false, label %loopentry.1, label %UnifiedExitNode
-UnifiedExitNode: ; preds = %endif.17, %then.18, %endif.16, %loopentry.1, %loopentry.1, %entry
- ret i32 0
-}
diff --git a/release_23/test/Transforms/TailDup/2003-08-31-UnreachableBlocks.ll b/release_23/test/Transforms/TailDup/2003-08-31-UnreachableBlocks.ll
deleted file mode 100644
index e46471331d20..000000000000
--- a/release_23/test/Transforms/TailDup/2003-08-31-UnreachableBlocks.ll
+++ /dev/null
@@ -1,17 +0,0 @@
-; RUN: llvm-as < %s | opt -tailduplicate -disable-output
-
-define i32 @foo() {
-entry:
- br label %return.i
-after_ret.i: ; No predecessors!
- br label %return.i
-return.i: ; preds = %after_ret.i, %entry
- %tmp.3 = ptrtoint i32* null to i32 ; <i32> [#uses=1]
- br label %return.i1
-after_ret.i1: ; No predecessors!
- br label %return.i1
-return.i1: ; preds = %after_ret.i1, %return.i
- %tmp.8 = sub i32 %tmp.3, 0 ; <i32> [#uses=0]
- ret i32 0
-}
-
diff --git a/release_23/test/Transforms/TailDup/2004-04-01-DemoteRegToStack.ll b/release_23/test/Transforms/TailDup/2004-04-01-DemoteRegToStack.ll
deleted file mode 100644
index 81624ff65f79..000000000000
--- a/release_23/test/Transforms/TailDup/2004-04-01-DemoteRegToStack.ll
+++ /dev/null
@@ -1,20 +0,0 @@
-; RUN: llvm-as < %s | opt -tailduplicate -disable-output
-
-define void @interpret() {
-entry:
- br label %retry
-retry: ; preds = %endif.4, %entry
- %tmp.8 = call i32 @interp( ) ; <i32> [#uses=3]
- switch i32 0, label %endif.4 [
- i32 -25, label %return
- i32 -16, label %return
- ]
-endif.4: ; preds = %retry
- br i1 false, label %return, label %retry
-return: ; preds = %endif.4, %retry, %retry
- %result.0 = phi i32 [ %tmp.8, %retry ], [ %tmp.8, %retry ], [ %tmp.8, %endif.4 ] ; <i32> [#uses=0]
- ret void
-}
-
-declare i32 @interp()
-
diff --git a/release_23/test/Transforms/TailDup/MergeTest.ll b/release_23/test/Transforms/TailDup/MergeTest.ll
deleted file mode 100644
index 252bf5610b04..000000000000
--- a/release_23/test/Transforms/TailDup/MergeTest.ll
+++ /dev/null
@@ -1,27 +0,0 @@
-; RUN: llvm-as < %s | opt -tailduplicate | llvm-dis | grep add | not grep uses=1
-
-define i32 @test1(i1 %C, i32 %A, i32* %P) {
-entry:
- br i1 %C, label %L1, label %L2
-L1: ; preds = %entry
- store i32 1, i32* %P
- br label %L2
-L2: ; preds = %L1, %entry
- %X = add i32 %A, 17 ; <i32> [#uses=1]
- ret i32 %X
-}
-
-define i32 @test2(i1 %C, i32 %A, i32* %P) {
-entry:
- br i1 %C, label %L1, label %L2
-L1: ; preds = %entry
- store i32 1, i32* %P
- br label %L3
-L2: ; preds = %entry
- store i32 7, i32* %P
- br label %L3
-L3: ; preds = %L2, %L1
- %X = add i32 %A, 17 ; <i32> [#uses=1]
- ret i32 %X
-}
-
diff --git a/release_23/test/Transforms/TailDup/PHIUpdateTest.ll b/release_23/test/Transforms/TailDup/PHIUpdateTest.ll
deleted file mode 100644
index 6f86587b24d6..000000000000
--- a/release_23/test/Transforms/TailDup/PHIUpdateTest.ll
+++ /dev/null
@@ -1,16 +0,0 @@
-; This test checks to make sure phi nodes are updated properly
-;
-; RUN: llvm-as < %s | opt -tailduplicate -disable-output
-
-define i32 @test(i1 %c, i32 %X, i32 %Y) {
- br label %L
-L: ; preds = %F, %0
- %A = add i32 %X, %Y ; <i32> [#uses=1]
- br i1 %c, label %T, label %F
-F: ; preds = %L
- br i1 %c, label %L, label %T
-T: ; preds = %F, %L
- %V = phi i32 [ %A, %L ], [ 0, %F ] ; <i32> [#uses=1]
- ret i32 %V
-}
-
diff --git a/release_23/test/Transforms/TailDup/basictest.ll b/release_23/test/Transforms/TailDup/basictest.ll
deleted file mode 100644
index ef368906378d..000000000000
--- a/release_23/test/Transforms/TailDup/basictest.ll
+++ /dev/null
@@ -1,20 +0,0 @@
-; RUN: llvm-as < %s | opt -tailduplicate -disable-output
-
-declare void @__main()
-
-define i32 @main() {
-entry:
- call void @__main( )
- br label %loopentry
-loopentry: ; preds = %no_exit, %entry
- %i.0 = phi i32 [ %inc, %no_exit ], [ 0, %entry ] ; <i32> [#uses=3]
- %tmp.1 = icmp sle i32 %i.0, 99 ; <i1> [#uses=1]
- br i1 %tmp.1, label %no_exit, label %return
-no_exit: ; preds = %loopentry
- %tmp.51 = call i32 @main( ) ; <i32> [#uses=0]
- %inc = add i32 %i.0, 1 ; <i32> [#uses=1]
- br label %loopentry
-return: ; preds = %loopentry
- ret i32 %i.0
-}
-
diff --git a/release_23/test/Transforms/TailDup/basictest2.ll b/release_23/test/Transforms/TailDup/basictest2.ll
deleted file mode 100644
index f79d718cdb56..000000000000
--- a/release_23/test/Transforms/TailDup/basictest2.ll
+++ /dev/null
@@ -1,15 +0,0 @@
-; RUN: llvm-as < %s | opt -tailduplicate -disable-output
-
-define void @ab() {
-entry:
- br label %loopentry.5
-loopentry.5: ; preds = %no_exit.5, %entry
- %poscnt.1 = phi i64 [ 0, %entry ], [ %tmp.289, %no_exit.5 ] ; <i64> [#uses=1]
- %tmp.289 = ashr i64 %poscnt.1, 1 ; <i64> [#uses=1]
- br i1 false, label %no_exit.5, label %loopexit.5
-no_exit.5: ; preds = %loopentry.5
- br label %loopentry.5
-loopexit.5: ; preds = %loopentry.5
- ret void
-}
-
diff --git a/release_23/test/Transforms/TailDup/dg.exp b/release_23/test/Transforms/TailDup/dg.exp
deleted file mode 100644
index 879685ca879d..000000000000
--- a/release_23/test/Transforms/TailDup/dg.exp
+++ /dev/null
@@ -1,3 +0,0 @@
-load_lib llvm.exp
-
-RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
diff --git a/release_23/test/Transforms/TailDup/if-tail-dup.ll b/release_23/test/Transforms/TailDup/if-tail-dup.ll
deleted file mode 100644
index 7c4d9c25ef3e..000000000000
--- a/release_23/test/Transforms/TailDup/if-tail-dup.ll
+++ /dev/null
@@ -1,49 +0,0 @@
-; RUN: llvm-as < %s | opt -tailduplicate | \
-; RUN: llc -march=x86 -o %t -f
-; RUN: grep {\\\<je\\\>} %t
-; RUN: not grep jmp %t
-; END.
-; This should have no unconditional jumps in it. The C source is:
-
-;void foo(int c, int* P) {
-; if (c & 1) P[0] = 1;
-; if (c & 2) P[1] = 1;
-; if (c & 4) P[2] = 1;
-; if (c & 8) P[3] = 1;
-;}
-
-define void @foo(i32 %c, i32* %P) {
-entry:
- %tmp1 = and i32 %c, 1 ; <i32> [#uses=1]
- %tmp1.upgrd.1 = icmp eq i32 %tmp1, 0 ; <i1> [#uses=1]
- br i1 %tmp1.upgrd.1, label %cond_next, label %cond_true
-cond_true: ; preds = %entry
- store i32 1, i32* %P
- br label %cond_next
-cond_next: ; preds = %cond_true, %entry
- %tmp5 = and i32 %c, 2 ; <i32> [#uses=1]
- %tmp5.upgrd.2 = icmp eq i32 %tmp5, 0 ; <i1> [#uses=1]
- br i1 %tmp5.upgrd.2, label %cond_next10, label %cond_true6
-cond_true6: ; preds = %cond_next
- %tmp8 = getelementptr i32* %P, i32 1 ; <i32*> [#uses=1]
- store i32 1, i32* %tmp8
- br label %cond_next10
-cond_next10: ; preds = %cond_true6, %cond_next
- %tmp13 = and i32 %c, 4 ; <i32> [#uses=1]
- %tmp13.upgrd.3 = icmp eq i32 %tmp13, 0 ; <i1> [#uses=1]
- br i1 %tmp13.upgrd.3, label %cond_next18, label %cond_true14
-cond_true14: ; preds = %cond_next10
- %tmp16 = getelementptr i32* %P, i32 2 ; <i32*> [#uses=1]
- store i32 1, i32* %tmp16
- br label %cond_next18
-cond_next18: ; preds = %cond_true14, %cond_next10
- %tmp21 = and i32 %c, 8 ; <i32> [#uses=1]
- %tmp21.upgrd.4 = icmp eq i32 %tmp21, 0 ; <i1> [#uses=1]
- br i1 %tmp21.upgrd.4, label %return, label %cond_true22
-cond_true22: ; preds = %cond_next18
- %tmp24 = getelementptr i32* %P, i32 3 ; <i32*> [#uses=1]
- store i32 1, i32* %tmp24
- ret void
-return: ; preds = %cond_next18
- ret void
-}
diff --git a/release_23/test/Verifier/2002-04-13-RetTypes.ll b/release_23/test/Verifier/2002-04-13-RetTypes.ll
deleted file mode 100644
index 197f5c24fc4c..000000000000
--- a/release_23/test/Verifier/2002-04-13-RetTypes.ll
+++ /dev/null
@@ -1,10 +0,0 @@
-; RUN: not llvm-as < %s |& grep {return type does not match operand type}
-
-; Verify the the operand type of the ret instructions in a function match the
-; delcared return type of the function they live in.
-;
-
-define i32 @testfunc()
-begin
- ret i32* null
-end
diff --git a/release_23/test/Verifier/2002-11-05-GetelementptrPointers.ll b/release_23/test/Verifier/2002-11-05-GetelementptrPointers.ll
deleted file mode 100644
index e37a0ffd3249..000000000000
--- a/release_23/test/Verifier/2002-11-05-GetelementptrPointers.ll
+++ /dev/null
@@ -1,9 +0,0 @@
-; RUN: not llvm-as < %s |& grep {Invalid getelementptr indices}
-
-; This testcase is invalid because we are indexing into a pointer that is
-; contained WITHIN a structure.
-
-define void @test({i32, i32*} * %X) {
- getelementptr {i32, i32*} * %X, i32 0, i32 1, i32 0
- ret void
-}
diff --git a/release_23/test/Verifier/2004-05-21-SwitchConstantMismatch.ll b/release_23/test/Verifier/2004-05-21-SwitchConstantMismatch.ll
deleted file mode 100644
index e965c6dac921..000000000000
--- a/release_23/test/Verifier/2004-05-21-SwitchConstantMismatch.ll
+++ /dev/null
@@ -1,13 +0,0 @@
-; RUN: not llvm-as -f %s -o /dev/null
-
-
-
-int %main() {
-start1:
- switch uint 0, label %brt0 [int 3, label %brt1 ]
-brt0:
- ret int 0
-brt1:
- ret int 0
-}
-
diff --git a/release_23/test/Verifier/2005-03-21-UndefinedTypeReference.ll b/release_23/test/Verifier/2005-03-21-UndefinedTypeReference.ll
deleted file mode 100644
index 19a9826ea52c..000000000000
--- a/release_23/test/Verifier/2005-03-21-UndefinedTypeReference.ll
+++ /dev/null
@@ -1,7 +0,0 @@
-; RUN: not llvm-as < %s |& grep {Reference to an undefined type}
-
-define void @test() {
- malloc %InvalidType
- ret void
-}
-
diff --git a/release_23/test/Verifier/2006-07-11-StoreStruct.ll b/release_23/test/Verifier/2006-07-11-StoreStruct.ll
deleted file mode 100644
index 655e4b748ef5..000000000000
--- a/release_23/test/Verifier/2006-07-11-StoreStruct.ll
+++ /dev/null
@@ -1,9 +0,0 @@
-; RUN: not llvm-as < %s |& grep {Instruction operands must be first-class}
-; PR826
-
- %struct_4 = type { i32 }
-
-define void @test() {
- store %struct_4 zeroinitializer, %struct_4* null
- unreachable
-}
diff --git a/release_23/test/Verifier/2006-10-15-AddrLabel.ll b/release_23/test/Verifier/2006-10-15-AddrLabel.ll
deleted file mode 100644
index e2c0e603c33a..000000000000
--- a/release_23/test/Verifier/2006-10-15-AddrLabel.ll
+++ /dev/null
@@ -1,9 +0,0 @@
-; RUN: not llvm-as < %s > /dev/null |& \
-; RUN: grep {Cannot form a pointer to a basic block}
-
-define i32 @main() {
- %foo = call i8* %llvm.stacksave()
- %foop = bitcast i8* %foo to label*
- %nret = load label* %foop
- br label %nret;
-}
diff --git a/release_23/test/Verifier/2006-12-12-IntrinsicDefine.ll b/release_23/test/Verifier/2006-12-12-IntrinsicDefine.ll
deleted file mode 100644
index b63ae65aa2e7..000000000000
--- a/release_23/test/Verifier/2006-12-12-IntrinsicDefine.ll
+++ /dev/null
@@ -1,7 +0,0 @@
-; RUN: not llvm-as < %s |& grep {llvm intrinsics cannot be defined}
-; PR1047
-
-define void @llvm.memcpy.i32(i8*, i8*, i32, i32) {
-entry:
- ret void
-}
diff --git a/release_23/test/Verifier/2007-12-21-InvokeParamAttrs.ll b/release_23/test/Verifier/2007-12-21-InvokeParamAttrs.ll
deleted file mode 100644
index 5a8fa65dbc32..000000000000
--- a/release_23/test/Verifier/2007-12-21-InvokeParamAttrs.ll
+++ /dev/null
@@ -1,10 +0,0 @@
-; RUN: not llvm-as < %s
-
-declare void @foo(i8*)
-
-define void @bar() {
- invoke void @foo(i8* signext null)
- to label %r unwind label %r
-r:
- ret void
-}
diff --git a/release_23/test/Verifier/2008-01-11-VarargAttrs.ll b/release_23/test/Verifier/2008-01-11-VarargAttrs.ll
deleted file mode 100644
index e8e9c41c6dfb..000000000000
--- a/release_23/test/Verifier/2008-01-11-VarargAttrs.ll
+++ /dev/null
@@ -1,10 +0,0 @@
-; RUN: not llvm-as < %s -o /dev/null
-
- %struct = type { }
-
-declare void @foo(...)
-
-define void @bar() {
- call void (...)* @foo(%struct* sret null )
- ret void
-}
diff --git a/release_23/test/Verifier/2008-03-01-AllocaSized.ll b/release_23/test/Verifier/2008-03-01-AllocaSized.ll
deleted file mode 100644
index eb96ced78824..000000000000
--- a/release_23/test/Verifier/2008-03-01-AllocaSized.ll
+++ /dev/null
@@ -1,8 +0,0 @@
-; RUN: not llvm-as -f %s -o /dev/null |& grep {Cannot allocate unsized type}
-; PR2113
-
-define void @test() {
- %A = alloca void()
- ret void
-}
-
diff --git a/release_23/test/Verifier/AmbiguousPhi.ll b/release_23/test/Verifier/AmbiguousPhi.ll
deleted file mode 100644
index 9a7253018775..000000000000
--- a/release_23/test/Verifier/AmbiguousPhi.ll
+++ /dev/null
@@ -1,10 +0,0 @@
-; RUN: not llvm-as < %s |& grep {multiple entries for the same basic block}
-
-
-
-define i32 @test(i32 %i, i32 %j, i1 %c) {
- br i1 %c, label %A, label %A
-A:
- %a = phi i32 [%i, %0], [%j, %0] ; Error, different values from same block!
- ret i32 %a
-}
diff --git a/release_23/test/Verifier/PhiGrouping.ll b/release_23/test/Verifier/PhiGrouping.ll
deleted file mode 100644
index dc529dced365..000000000000
--- a/release_23/test/Verifier/PhiGrouping.ll
+++ /dev/null
@@ -1,17 +0,0 @@
-; RUN: not llvm-as < %s |& grep {PHI nodes not grouped at top}
-
-
-
-define i32 @test(i32 %i, i32 %j, i1 %c) {
- br i1 %c, label %A, label %B
-A:
- br label %C
-B:
- br label %C
-
-C:
- %a = phi i32 [%i, %A], [%j, %B]
- %x = add i32 %a, 0 ; Error, PHI's should be grouped!
- %b = phi i32 [%i, %A], [%j, %B]
- ret i32 %x
-}
diff --git a/release_23/test/Verifier/README.txt b/release_23/test/Verifier/README.txt
deleted file mode 100644
index c04152172e9a..000000000000
--- a/release_23/test/Verifier/README.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-This directory contains testcases that the verifier is supposed to detect as
-malformed LLVM code. Testcases for situations that the verifier incorrectly
-identifies as malformed should go in the test/Assembler directory.
diff --git a/release_23/test/Verifier/SelfReferential.ll b/release_23/test/Verifier/SelfReferential.ll
deleted file mode 100644
index c013bfb6a188..000000000000
--- a/release_23/test/Verifier/SelfReferential.ll
+++ /dev/null
@@ -1,9 +0,0 @@
-; RUN: not llvm-as -f %s -o /dev/null |& grep {Only PHI nodes may reference their own value}
-
-; Test that self referential instructions are not allowed
-
-define void @test() {
- %A = add i32 %A, 0 ; <i32> [#uses=1]
- ret void
-}
-
diff --git a/release_23/test/Verifier/aliasing-chain.ll b/release_23/test/Verifier/aliasing-chain.ll
deleted file mode 100644
index 53b929bd782e..000000000000
--- a/release_23/test/Verifier/aliasing-chain.ll
+++ /dev/null
@@ -1,6 +0,0 @@
-; RUN: not llvm-as -f %s -o /dev/null |& grep {Aliasing chain should end with function or global variable}
-
-; Test that alising chain does not create a cycle
-
-@b1 = alias i32* @c1
-@c1 = alias i32* @b1
diff --git a/release_23/test/Verifier/byval-1.ll b/release_23/test/Verifier/byval-1.ll
deleted file mode 100644
index 9c2cb98451a9..000000000000
--- a/release_23/test/Verifier/byval-1.ll
+++ /dev/null
@@ -1,2 +0,0 @@
-; RUN: not llvm-as < %s -o /dev/null -f
-declare void @h(i32 byval %num)
diff --git a/release_23/test/Verifier/byval-2.ll b/release_23/test/Verifier/byval-2.ll
deleted file mode 100644
index 43cea4ee1ec3..000000000000
--- a/release_23/test/Verifier/byval-2.ll
+++ /dev/null
@@ -1,3 +0,0 @@
-; RUN: llvm-as < %s -o /dev/null -f
- %s = type opaque
-declare void @h(%s* byval %num)
diff --git a/release_23/test/Verifier/byval-4.ll b/release_23/test/Verifier/byval-4.ll
deleted file mode 100644
index ff733a5bdc93..000000000000
--- a/release_23/test/Verifier/byval-4.ll
+++ /dev/null
@@ -1,4 +0,0 @@
-; RUN: llvm-as < %s -o /dev/null -f
-%struct.foo = type { i64 }
-
-declare void @h(%struct.foo* byval %num)
diff --git a/release_23/test/Verifier/dg.exp b/release_23/test/Verifier/dg.exp
deleted file mode 100644
index 879685ca879d..000000000000
--- a/release_23/test/Verifier/dg.exp
+++ /dev/null
@@ -1,3 +0,0 @@
-load_lib llvm.exp
-
-RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
diff --git a/release_23/test/Verifier/gcread-ptrptr.ll b/release_23/test/Verifier/gcread-ptrptr.ll
deleted file mode 100644
index bcfc6eb4f71c..000000000000
--- a/release_23/test/Verifier/gcread-ptrptr.ll
+++ /dev/null
@@ -1,13 +0,0 @@
-; RUN: not llvm-as < %s
-; PR1633
-
-%meta = type { i8* }
-%obj = type { %meta* }
-
-declare %obj* @llvm.gcread(%obj*, %obj*)
-
-define %obj* @f() {
-entry:
- %x = call %obj* @llvm.gcread(%obj* null, %obj* null)
- ret %obj* %x
-}
diff --git a/release_23/test/Verifier/gcroot-alloca.ll b/release_23/test/Verifier/gcroot-alloca.ll
deleted file mode 100644
index c44321a065b0..000000000000
--- a/release_23/test/Verifier/gcroot-alloca.ll
+++ /dev/null
@@ -1,14 +0,0 @@
-; RUN: not llvm-as < %s
-; PR1633
-
-%meta = type { i8* }
-%obj = type { %meta* }
-
-declare void @llvm.gcroot(%obj**, %meta*)
-
-define void @f() {
-entry:
- call void @llvm.gcroot(%obj** null, %meta* null)
-
- ret void
-}
diff --git a/release_23/test/Verifier/gcroot-meta.ll b/release_23/test/Verifier/gcroot-meta.ll
deleted file mode 100644
index 51d19515afbf..000000000000
--- a/release_23/test/Verifier/gcroot-meta.ll
+++ /dev/null
@@ -1,16 +0,0 @@
-; RUN: not llvm-as < %s
-; PR1633
-
-%meta = type { i8* }
-%obj = type { %meta* }
-
-declare void @llvm.gcroot(%obj**, %meta*)
-
-define void @f() {
-entry:
- %local.obj = alloca %obj*
- %local.meta = alloca %meta
- call void @llvm.gcroot(%obj** %local.obj, %meta* %local.meta)
-
- ret void
-}
diff --git a/release_23/test/Verifier/gcroot-ptrptr.ll b/release_23/test/Verifier/gcroot-ptrptr.ll
deleted file mode 100644
index 0a7738d866c2..000000000000
--- a/release_23/test/Verifier/gcroot-ptrptr.ll
+++ /dev/null
@@ -1,14 +0,0 @@
-; RUN: not llvm-as < %s
-; PR1633
-
-%meta = type { i8* }
-%obj = type { %meta* }
-
-declare void @llvm.gcroot(%obj*, %meta*)
-
-define void @f() {
-entry:
- %local.obj = alloca %obj
- call void @llvm.gcroot(%obj* %local.obj, %meta* null)
- ret void
-}
diff --git a/release_23/test/Verifier/gcwrite-ptrptr.ll b/release_23/test/Verifier/gcwrite-ptrptr.ll
deleted file mode 100644
index b1e96c8aa6ea..000000000000
--- a/release_23/test/Verifier/gcwrite-ptrptr.ll
+++ /dev/null
@@ -1,13 +0,0 @@
-; RUN: not llvm-as < %s
-; PR1633
-
-%meta = type { i8* }
-%obj = type { %meta* }
-
-declare void @llvm.gcwrite(%obj*, %obj*, %obj*)
-
-define void @f() {
-entry:
- call void @llvm.gcwrite(%obj* null, %obj* null, %obj* null)
- ret void
-}
diff --git a/release_23/test/Verifier/invoke-1.ll b/release_23/test/Verifier/invoke-1.ll
deleted file mode 100644
index 427abe02cef7..000000000000
--- a/release_23/test/Verifier/invoke-1.ll
+++ /dev/null
@@ -1,10 +0,0 @@
-; RUN: not llvm-as < %s |& grep {not verify as correct}
-; PR1042
-
-define i32 @foo() {
- %A = invoke i32 @foo( )
- to label %L unwind label %L ; <i32> [#uses=1]
-L: ; preds = %0, %0
- ret i32 %A
-}
-
diff --git a/release_23/test/Verifier/invoke-2.ll b/release_23/test/Verifier/invoke-2.ll
deleted file mode 100644
index 27375fa7f5a8..000000000000
--- a/release_23/test/Verifier/invoke-2.ll
+++ /dev/null
@@ -1,14 +0,0 @@
-; RUN: not llvm-as < %s -f |& grep {not verify as correct}
-; PR1042
-
-define i32 @foo() {
- br i1 false, label %L1, label %L2
-L1: ; preds = %0
- %A = invoke i32 @foo( )
- to label %L unwind label %L ; <i32> [#uses=1]
-L2: ; preds = %0
- br label %L
-L: ; preds = %L2, %L1, %L1
- ret i32 %A
-}
-
diff --git a/release_23/test/lib/llvm.exp b/release_23/test/lib/llvm.exp
deleted file mode 100644
index b59f341d72b1..000000000000
--- a/release_23/test/lib/llvm.exp
+++ /dev/null
@@ -1,264 +0,0 @@
-# This procedure executes one line of a test case's execution script.
-proc execOneLine { test PRS outcome lineno line } {
- set status 0
- set resultmsg ""
- set retval [ catch { eval exec -keepnewline -- $line } errmsg ]
- if { $retval != 0 } {
- set code [lindex $::errorCode 0]
- set lineno [expr $lineno + 1]
- if { $PRS != ""} {
- set PRS " for $PRS"
- }
- set errmsg " at line $lineno\nwhile running: $line\n$errmsg"
- switch "$code" {
- CHILDSTATUS {
- set status [lindex $::errorCode 2]
- if { $status != 0 } {
- set resultmsg "$test$PRS\nFailed with exit($status)$errmsg"
- }
- }
- CHILDKILLED {
- set signal [lindex $::errorCode 2]
- set resultmsg "$test$PRS\nFailed with signal($signal)$errmsg"
- }
- CHILDSUSP {
- set signal [lindex $::errorCode 2]
- set resultmsg "$test$PRS\nFailed with suspend($signal)$errmsg"
- }
- POSIX {
- set posixNum [lindex $::errorCode 1]
- set posixMsg [lindex $::errorCode 2]
- set resultmsg "$test$PRS\nFailed with posix($posixNum,$posixMsg)$errmsg"
- }
- NONE {
- }
- default {
- }
- }
- }
- return $resultmsg
-}
-
-# This procedure performs variable substitutions on the RUN: lines of a test
-# cases.
-proc substitute { line test tmpFile } {
- global srcroot objroot srcdir objdir subdir target_triplet prcontext
- global llvmgcc llvmgxx llvmgcc_version llvmgccmajvers ocamlc
- global gccpath gxxpath compile_c compile_cxx link shlibext llvmlibsdir
- set path [file join $srcdir $subdir]
-
- # Substitute all Tcl variables.
- set new_line [subst $line ]
-
- #replace %prcontext with prcontext.tcl (Must replace before %p)
- regsub -all {%prcontext} $new_line $prcontext new_line
- #replace %llvmgcc with actual path to llvmgcc
- regsub -all {%llvmgcc} $new_line "$llvmgcc -emit-llvm" new_line
- #replace %llvmgxx with actual path to llvmg++
- regsub -all {%llvmgxx} $new_line "$llvmgxx -emit-llvm" new_line
- #replace %compile_cxx with C++ compilation command
- regsub -all {%compile_cxx} $new_line "$compile_cxx" new_line
- #replace %compile_c with C compilation command
- regsub -all {%compile_c} $new_line "$compile_c" new_line
- #replace %link with C++ link command
- regsub -all {%link} $new_line "$link" new_line
- #replace %shlibext with shared library extension
- regsub -all {%shlibext} $new_line "$shlibext" new_line
- #replace %ocamlc with ocaml compiler command
- regsub -all {%ocamlc} $new_line "$ocamlc" new_line
- #replace %llvmlibsdir with configure library directory
- regsub -all {%llvmlibsdir} $new_line "$llvmlibsdir" new_line
- #replace %p with path to source,
- regsub -all {%p} $new_line [file join $srcdir $subdir] new_line
- #replace %s with filename
- regsub -all {%s} $new_line $test new_line
- #replace %t with temp filenames
- regsub -all {%t} $new_line $tmpFile new_line
- #replace %% with %
- regsub -all {%%} $new_line % new_line
- return $new_line
-}
-
-# This procedure runs the set of tests for the test_source_files array.
-proc RunLLVMTests { test_source_files } {
- global srcroot objroot srcdir objdir subdir target_triplet llvmgcc_version
- set timeout 60
-
- set path [file join $objdir $subdir]
-
- #Make Output Directory if it does not exist already
- if { [file exists path] } {
- cd $path
- } else {
- file mkdir $path
- cd $path
- }
-
- file mkdir Output
- cd Output
-
- foreach test $test_source_files {
- #Should figure out best way to set the timeout
- #set timeout 40
-
- set filename [file tail $test]
- verbose "ABOUT TO RUN: $filename" 2
- set outcome PASS
- set tmpFile "$filename.tmp"
-
- # Mark that it should not be XFAIL for this target.
- set targetPASS 0
-
- #set hasRunline bool to check if testcase has a runline
- set numLines 0
-
- # Open the test file and start reading lines
- set testFileId [ open $test r]
- set runline ""
- set PRNUMS ""
- foreach line [split [read $testFileId] \n] {
-
- # if its the END. line then stop parsing (optimization for big files)
- if {[regexp {END.[[:space:]]*$} $line match endofscript]} {
- break
-
- # if the line is continued, concatenate and continue the loop
- } elseif {[regexp {RUN: *(.+)(\\)$} $line match oneline suffix]} {
- set runline "$runline$oneline "
-
- # if its a terminating RUN: line then do substitution on the whole line
- # and then save the line.
- } elseif {[regexp {RUN: *(.+)$} $line match oneline suffix]} {
- set runline "$runline$oneline"
- set runline [ substitute $runline $test $tmpFile ]
- set lines($numLines) $runline
- set numLines [expr $numLines + 1]
- set runline ""
-
- # if its an PR line, save the problem report number
- } elseif {[regexp {PR([0-9]+)} $line match prnum]} {
- if {$PRNUMS == ""} {
- set PRNUMS "PR$prnum"
- } else {
- set PRNUMS "$PRNUMS,$prnum"
- }
- # if its an XFAIL line, see if we should be XFAILing or not.
- } elseif {[regexp {XFAIL:[ *](.+)} $line match targets]} {
- set targets
-
- #split up target if more then 1 specified
- foreach target [split $targets ,] {
- if { [regexp {\*} $target match] } {
- if {$targetPASS != 1} {
- set outcome XFAIL
- }
- } elseif { [regexp $target $target_triplet match] } {
- if {$targetPASS != 1} {
- set outcome XFAIL
- }
- } elseif { [regexp {llvmgcc(([0-9]+)|([0-9]+[.][0-9]+))} $target match submatch submatch2] } {
- if { [regexp ^($submatch)$|^(($submatch)(\.)) $llvmgcc_version match] } {
- if {$targetPASS != 1} {
- set outcome XFAIL
- }
- }
- }
- }
- } elseif {[regexp {XTARGET:[ *](.+)} $line match targets]} {
- set targets
-
- #split up target if more then 1 specified
- foreach target [split $targets ,] {
- if { [regexp {\*} $target match] } {
- set targetPASS 1
- set outcome PASS
- } elseif { [regexp $target $target_triplet match] } {
- set targetPASS 1
- set outcome PASS
- } elseif { [regexp {llvmgcc(([0-9]+)|([0-9]+[.][0-9]+))} $target match submatch submatch2] } {
- if { [regexp ^($submatch)$|^(($submatch)(\.)) $llvmgcc_version match] } {
- set targetPASS 1
- set outcome PASS
- }
- }
- }
- }
- }
-
- # Done reading the script
- close $testFileId
-
-
- if { $numLines == 0 } {
- fail "$test: \nDoes not have a RUN line\n"
- } else {
- set failed 0
- for { set i 0 } { $i < $numLines } { set i [ expr $i + 1 ] } {
- regsub ^.*RUN:(.*) $lines($i) \1 theLine
- set resultmsg [execOneLine $test $PRNUMS $outcome $i $theLine ]
- if { $resultmsg != "" } {
- if { $outcome == "XFAIL" } {
- xfail "$resultmsg"
- } else {
- fail "$resultmsg"
- }
- set failed 1
- break
- }
- }
- if { $failed } {
- continue
- } else {
- if { $PRNUMS != "" } {
- set PRNUMS " for $PRNUMS"
- }
- if { $outcome == "XFAIL" } {
- xpass "$test$PRNUMS"
- } else {
- pass "$test$PRNUMS"
- }
- }
- }
- }
-}
-
-# This procedure provides an interface to check the LLVMGCC_LANGS makefile
-# variable to see if llvm-gcc supports compilation of a particular language.
-proc llvm_gcc_supports { lang } {
- global llvmgcc llvmgcc_langs
- # validate the language choices and determine the name of the compiler
- # component responsible for determining if the compiler has been built.
- switch "$lang" {
- ada { set file gnat1 }
- c { set file cc1 }
- c++ { set file cc1plus }
- objc { set file cc1 }
- objc++ { set file cc1 }
- fortran { set file fcc1 }
- default { return 0 }
- }
- foreach supported_lang [split "$llvmgcc_langs" ,] {
- if { "$lang" == "$supported_lang" } {
- # FIXME: Knowing it is configured is not enough. We should do two more
- # checks here. First, we need to run llvm-gcc -print-prog-name=$file to
- # get the path to the compiler. If we don't get a path, the language isn't
- # properly configured or built. If we do get a path, we should check to
- # make sure that it is executable and perhaps even try executing it.
- return 1;
- }
- }
- return 0;
-}
-
-# This procedure provides an interface to check the TARGETS_TO_BUILD makefile
-# variable to see if a particular target has been configured to build. This
-# helps avoid running tests for targets that aren't available.
-proc llvm_supports_target { tgtName } {
- global TARGETS_TO_BUILD
- foreach target [split $TARGETS_TO_BUILD] {
- if { [regexp $tgtName $target match] } {
- return 1
- }
- }
- return 0
-}
diff --git a/release_23/test/lib/llvm2cpp.exp b/release_23/test/lib/llvm2cpp.exp
deleted file mode 100644
index d8a65ffc4bec..000000000000
--- a/release_23/test/lib/llvm2cpp.exp
+++ /dev/null
@@ -1,100 +0,0 @@
-# This file defines a tcl proc to assist with testing the llvm2cpp. There are
-# no llvm2cpp specific test cases. Instead, it utilizes all the existing test
-# cases and makes sure llvm2cpp can run them. The basic idea is that we find
-# all the LLVM Assembly (*.ll) files, run llvm2cpp on them to generate a C++
-# program, compile those programs, run them and see if what they produce matches
-# the original input to llvm2cpp.
-
-proc llvm2cpp-test { files } {
- global subdir llvmtoolsdir llvmlibsdir objdir srcdir objroot srcroot
- set timeout 30
- set path [file join $objdir $subdir]
- set llc [file join $llvmtoolsdir llc ]
- set llvmas [file join $llvmtoolsdir llvm-as ]
- set llvmdis [file join $llvmtoolsdir llvm-dis ]
-
- #Make Output Directory if it does not exist already
- if { [file exists path] } {
- cd $path
- } else {
- file mkdir $path
- cd $path
- }
-
- file mkdir Output
-
- foreach test $files {
-
- set filename [file tail $test]
- set generated [file join Output $filename.cpp]
- set executable [file join Output $filename.exe]
- set output [file join Output $filename.gen]
- set assembly [file join Output $filename.asm]
- set testname [file rootname $filename]
- set bytecode [file join Output $filename.bc]
-
- # Note that the stderr for llvm-as, etc. must be redirected to /dev/null
- # because otherwise exec will see the msgs and return 1 even though they
- # are only warnings. If real errors are generated on stderr then llvm-as
- # will return a non-zero retval anyway so we're good.
-
- # Scan the test file to see if there's an XFAIL file. If so, don't run it
- set retval [ catch {
- exec -keepnewline grep XFAIL $test 2>/dev/null } msg ]
- if { $retval == 0 } {
- continue;
- }
-
- # Run llvm-as/llvm-dis
- set pipeline llvm-as|llvm-dis
- set retval [ catch {
- exec -keepnewline $llvmas < $test -o - | $llvmdis -f -o $assembly 2>/dev/null } msg ]
-
- if { $retval != 0 } {
- fail "$test: $pipeline returned $retval\n$msg"
- continue
- }
-
- # Build bytecode for llvm2cpp input
- set retval [ catch {
- exec -keepnewline $llvmas < $assembly > $bytecode 2>/dev/null } msg ]
-
- if { $retval != 0 } {
- fail "$test: llvm-as returned $retval\n$msg"
- continue
- }
-
- set retval [ catch {
- exec -keepnewline $llc -march=cpp -f -o $generated < $bytecode 2>/dev/null } msg]
-
- if { $retval != 0 } {
- fail "$test: llvm2cpp returned $retval\n$msg"
- continue
- }
-
- set retval [ catch {
- exec -keepnewline gcc -g -D__STDC_LIMIT_MACROS -o $executable $generated -I$srcroot/include -I$objroot/include -L$llvmlibsdir -lLLVMCore -lLLVMSupport -lLLVMbzip2 -lLLVMSystem -lstdc++ } msg ]
- if { $retval != 0 } {
- fail "$test: gcc returned $retval\n$msg"
- continue
- }
-
- set retval [ catch { exec -keepnewline $executable > $output } msg ]
- if { $retval != 0 } {
- set execname [file tail $executable]
- fail "$test: $execname returned $retval:\n$msg"
- continue
- }
-
- set retval [ catch {
- exec -keepnewline diff $assembly $output } msg ]
-
- if { $retval != 0 } {
- fail "$test: diff returned $retval:\n$msg"
- continue
- }
- pass "$test"
- }
-}
-
-
diff --git a/release_23/tools/Makefile b/release_23/tools/Makefile
deleted file mode 100644
index d742f41bd65c..000000000000
--- a/release_23/tools/Makefile
+++ /dev/null
@@ -1,32 +0,0 @@
-##===- tools/Makefile --------------------------------------*- Makefile -*-===##
-#
-# The LLVM Compiler Infrastructure
-#
-# This file is distributed under the University of Illinois Open Source
-# License. See LICENSE.TXT for details.
-#
-##===----------------------------------------------------------------------===##
-
-LEVEL := ..
-# NOTE: The tools are organized into five groups of four consisting of one
-# large and three small executables. This is done to minimize memory load
-# in parallel builds. Please retain this ordering.
-PARALLEL_DIRS := llvm-config \
- opt llvm-as llvm-dis \
- llc llvm-ranlib llvm-ar llvm-nm \
- llvm-ld llvm-prof llvm-link \
- lli gccas gccld llvm-extract llvm-db \
- bugpoint llvm-bcanalyzer llvm-stub llvmc2
-
-
-include $(LEVEL)/Makefile.config
-
-# Disable liblto as it is going away
-#PARALLEL_DIRS += lto
-
-# only build new lto project on Darwin for now
-ifeq ($(OS),Darwin)
-PARALLEL_DIRS += lto2
-endif
-
-include $(LEVEL)/Makefile.common
diff --git a/release_23/tools/bugpoint/BugDriver.cpp b/release_23/tools/bugpoint/BugDriver.cpp
deleted file mode 100644
index acea37e1feef..000000000000
--- a/release_23/tools/bugpoint/BugDriver.cpp
+++ /dev/null
@@ -1,239 +0,0 @@
-//===- BugDriver.cpp - Top-Level BugPoint class implementation ------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This class contains all of the shared state and information that is used by
-// the BugPoint tool to track down errors in optimizations. This class is the
-// main driver class that invokes all sub-functionality.
-//
-//===----------------------------------------------------------------------===//
-
-#include "BugDriver.h"
-#include "ToolRunner.h"
-#include "llvm/Linker.h"
-#include "llvm/Module.h"
-#include "llvm/Pass.h"
-#include "llvm/Assembly/Parser.h"
-#include "llvm/Bitcode/ReaderWriter.h"
-#include "llvm/Support/CommandLine.h"
-#include "llvm/Support/FileUtilities.h"
-#include "llvm/Support/MemoryBuffer.h"
-#include <iostream>
-#include <memory>
-using namespace llvm;
-
-// Anonymous namespace to define command line options for debugging.
-//
-namespace {
- // Output - The user can specify a file containing the expected output of the
- // program. If this filename is set, it is used as the reference diff source,
- // otherwise the raw input run through an interpreter is used as the reference
- // source.
- //
- cl::opt<std::string>
- OutputFile("output", cl::desc("Specify a reference program output "
- "(for miscompilation detection)"));
-}
-
-/// setNewProgram - If we reduce or update the program somehow, call this method
-/// to update bugdriver with it. This deletes the old module and sets the
-/// specified one as the current program.
-void BugDriver::setNewProgram(Module *M) {
- delete Program;
- Program = M;
-}
-
-
-/// getPassesString - Turn a list of passes into a string which indicates the
-/// command line options that must be passed to add the passes.
-///
-std::string llvm::getPassesString(const std::vector<const PassInfo*> &Passes) {
- std::string Result;
- for (unsigned i = 0, e = Passes.size(); i != e; ++i) {
- if (i) Result += " ";
- Result += "-";
- Result += Passes[i]->getPassArgument();
- }
- return Result;
-}
-
-BugDriver::BugDriver(const char *toolname, bool as_child, bool find_bugs,
- unsigned timeout, unsigned memlimit)
- : ToolName(toolname), ReferenceOutputFile(OutputFile),
- Program(0), Interpreter(0), cbe(0), gcc(0), run_as_child(as_child),
- run_find_bugs(find_bugs), Timeout(timeout), MemoryLimit(memlimit) {}
-
-
-/// ParseInputFile - Given a bitcode or assembly input filename, parse and
-/// return it, or return null if not possible.
-///
-Module *llvm::ParseInputFile(const std::string &Filename) {
- std::auto_ptr<MemoryBuffer> Buffer(MemoryBuffer::getFileOrSTDIN(Filename));
- Module *Result = 0;
- if (Buffer.get())
- Result = ParseBitcodeFile(Buffer.get());
-
- ParseError Err;
- if (!Result && !(Result = ParseAssemblyFile(Filename, &Err))) {
- std::cerr << "bugpoint: " << Err.getMessage() << "\n";
- Result = 0;
- }
-
- return Result;
-}
-
-// This method takes the specified list of LLVM input files, attempts to load
-// them, either as assembly or bitcode, then link them together. It returns
-// true on failure (if, for example, an input bitcode file could not be
-// parsed), and false on success.
-//
-bool BugDriver::addSources(const std::vector<std::string> &Filenames) {
- assert(Program == 0 && "Cannot call addSources multiple times!");
- assert(!Filenames.empty() && "Must specify at least on input filename!");
-
- try {
- // Load the first input file.
- Program = ParseInputFile(Filenames[0]);
- if (Program == 0) return true;
-
- if (!run_as_child)
- std::cout << "Read input file : '" << Filenames[0] << "'\n";
-
- for (unsigned i = 1, e = Filenames.size(); i != e; ++i) {
- std::auto_ptr<Module> M(ParseInputFile(Filenames[i]));
- if (M.get() == 0) return true;
-
- if (!run_as_child)
- std::cout << "Linking in input file: '" << Filenames[i] << "'\n";
- std::string ErrorMessage;
- if (Linker::LinkModules(Program, M.get(), &ErrorMessage)) {
- std::cerr << ToolName << ": error linking in '" << Filenames[i] << "': "
- << ErrorMessage << '\n';
- return true;
- }
- }
- } catch (const std::string &Error) {
- std::cerr << ToolName << ": error reading input '" << Error << "'\n";
- return true;
- }
-
- if (!run_as_child)
- std::cout << "*** All input ok\n";
-
- // All input files read successfully!
- return false;
-}
-
-
-
-/// run - The top level method that is invoked after all of the instance
-/// variables are set up from command line arguments.
-///
-bool BugDriver::run() {
- // The first thing to do is determine if we're running as a child. If we are,
- // then what to do is very narrow. This form of invocation is only called
- // from the runPasses method to actually run those passes in a child process.
- if (run_as_child) {
- // Execute the passes
- return runPassesAsChild(PassesToRun);
- }
-
- if (run_find_bugs) {
- // Rearrange the passes and apply them to the program. Repeat this process
- // until the user kills the program or we find a bug.
- return runManyPasses(PassesToRun);
- }
-
- // If we're not running as a child, the first thing that we must do is
- // determine what the problem is. Does the optimization series crash the
- // compiler, or does it produce illegal code? We make the top-level
- // decision by trying to run all of the passes on the the input program,
- // which should generate a bitcode file. If it does generate a bitcode
- // file, then we know the compiler didn't crash, so try to diagnose a
- // miscompilation.
- if (!PassesToRun.empty()) {
- std::cout << "Running selected passes on program to test for crash: ";
- if (runPasses(PassesToRun))
- return debugOptimizerCrash();
- }
-
- // Set up the execution environment, selecting a method to run LLVM bitcode.
- if (initializeExecutionEnvironment()) return true;
-
- // Test to see if we have a code generator crash.
- std::cout << "Running the code generator to test for a crash: ";
- try {
- compileProgram(Program);
- std::cout << '\n';
- } catch (ToolExecutionError &TEE) {
- std::cout << TEE.what();
- return debugCodeGeneratorCrash();
- }
-
-
- // Run the raw input to see where we are coming from. If a reference output
- // was specified, make sure that the raw output matches it. If not, it's a
- // problem in the front-end or the code generator.
- //
- bool CreatedOutput = false;
- if (ReferenceOutputFile.empty()) {
- std::cout << "Generating reference output from raw program: ";
- if(!createReferenceFile(Program)){
- return debugCodeGeneratorCrash();
- }
- CreatedOutput = true;
- }
-
- // Make sure the reference output file gets deleted on exit from this
- // function, if appropriate.
- sys::Path ROF(ReferenceOutputFile);
- FileRemover RemoverInstance(ROF, CreatedOutput);
-
- // Diff the output of the raw program against the reference output. If it
- // matches, then we assume there is a miscompilation bug and try to
- // diagnose it.
- std::cout << "*** Checking the code generator...\n";
- try {
- if (!diffProgram()) {
- std::cout << "\n*** Debugging miscompilation!\n";
- return debugMiscompilation();
- }
- } catch (ToolExecutionError &TEE) {
- std::cerr << TEE.what();
- return debugCodeGeneratorCrash();
- }
-
- std::cout << "\n*** Input program does not match reference diff!\n";
- std::cout << "Debugging code generator problem!\n";
- try {
- return debugCodeGenerator();
- } catch (ToolExecutionError &TEE) {
- std::cerr << TEE.what();
- return debugCodeGeneratorCrash();
- }
-}
-
-void llvm::PrintFunctionList(const std::vector<Function*> &Funcs) {
- unsigned NumPrint = Funcs.size();
- if (NumPrint > 10) NumPrint = 10;
- for (unsigned i = 0; i != NumPrint; ++i)
- std::cout << " " << Funcs[i]->getName();
- if (NumPrint < Funcs.size())
- std::cout << "... <" << Funcs.size() << " total>";
- std::cout << std::flush;
-}
-
-void llvm::PrintGlobalVariableList(const std::vector<GlobalVariable*> &GVs) {
- unsigned NumPrint = GVs.size();
- if (NumPrint > 10) NumPrint = 10;
- for (unsigned i = 0; i != NumPrint; ++i)
- std::cout << " " << GVs[i]->getName();
- if (NumPrint < GVs.size())
- std::cout << "... <" << GVs.size() << " total>";
- std::cout << std::flush;
-}
diff --git a/release_23/tools/bugpoint/BugDriver.h b/release_23/tools/bugpoint/BugDriver.h
deleted file mode 100644
index 2750575454f1..000000000000
--- a/release_23/tools/bugpoint/BugDriver.h
+++ /dev/null
@@ -1,319 +0,0 @@
-//===- BugDriver.h - Top-Level BugPoint class -------------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This class contains all of the shared state and information that is used by
-// the BugPoint tool to track down errors in optimizations. This class is the
-// main driver class that invokes all sub-functionality.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef BUGDRIVER_H
-#define BUGDRIVER_H
-
-#include <vector>
-#include <string>
-
-namespace llvm {
-
-class PassInfo;
-class Module;
-class GlobalVariable;
-class Function;
-class BasicBlock;
-class AbstractInterpreter;
-class Instruction;
-
-class DebugCrashes;
-
-class GCC;
-
-extern bool DisableSimplifyCFG;
-
-/// BugpointIsInterrupted - Set to true when the user presses ctrl-c.
-///
-extern bool BugpointIsInterrupted;
-
-class BugDriver {
- const std::string ToolName; // Name of bugpoint
- std::string ReferenceOutputFile; // Name of `good' output file
- Module *Program; // The raw program, linked together
- std::vector<const PassInfo*> PassesToRun;
- AbstractInterpreter *Interpreter; // How to run the program
- AbstractInterpreter *cbe;
- GCC *gcc;
- bool run_as_child;
- bool run_find_bugs;
- unsigned Timeout;
- unsigned MemoryLimit;
-
- // FIXME: sort out public/private distinctions...
- friend class ReducePassList;
- friend class ReduceMisCodegenFunctions;
-
-public:
- BugDriver(const char *toolname, bool as_child, bool find_bugs,
- unsigned timeout, unsigned memlimit);
-
- const std::string &getToolName() const { return ToolName; }
-
- // Set up methods... these methods are used to copy information about the
- // command line arguments into instance variables of BugDriver.
- //
- bool addSources(const std::vector<std::string> &FileNames);
- template<class It>
- void addPasses(It I, It E) { PassesToRun.insert(PassesToRun.end(), I, E); }
- void setPassesToRun(const std::vector<const PassInfo*> &PTR) {
- PassesToRun = PTR;
- }
- const std::vector<const PassInfo*> &getPassesToRun() const {
- return PassesToRun;
- }
-
- /// run - The top level method that is invoked after all of the instance
- /// variables are set up from command line arguments. The \p as_child argument
- /// indicates whether the driver is to run in parent mode or child mode.
- ///
- bool run();
-
- /// debugOptimizerCrash - This method is called when some optimizer pass
- /// crashes on input. It attempts to prune down the testcase to something
- /// reasonable, and figure out exactly which pass is crashing.
- ///
- bool debugOptimizerCrash(const std::string &ID = "passes");
-
- /// debugCodeGeneratorCrash - This method is called when the code generator
- /// crashes on an input. It attempts to reduce the input as much as possible
- /// while still causing the code generator to crash.
- bool debugCodeGeneratorCrash();
-
- /// debugMiscompilation - This method is used when the passes selected are not
- /// crashing, but the generated output is semantically different from the
- /// input.
- bool debugMiscompilation();
-
- /// debugPassMiscompilation - This method is called when the specified pass
- /// miscompiles Program as input. It tries to reduce the testcase to
- /// something that smaller that still miscompiles the program.
- /// ReferenceOutput contains the filename of the file containing the output we
- /// are to match.
- ///
- bool debugPassMiscompilation(const PassInfo *ThePass,
- const std::string &ReferenceOutput);
-
- /// compileSharedObject - This method creates a SharedObject from a given
- /// BitcodeFile for debugging a code generator.
- ///
- std::string compileSharedObject(const std::string &BitcodeFile);
-
- /// debugCodeGenerator - This method narrows down a module to a function or
- /// set of functions, using the CBE as a ``safe'' code generator for other
- /// functions that are not under consideration.
- bool debugCodeGenerator();
-
- /// isExecutingJIT - Returns true if bugpoint is currently testing the JIT
- ///
- bool isExecutingJIT();
-
- /// runPasses - Run all of the passes in the "PassesToRun" list, discard the
- /// output, and return true if any of the passes crashed.
- bool runPasses(Module *M = 0) {
- if (M == 0) M = Program;
- std::swap(M, Program);
- bool Result = runPasses(PassesToRun);
- std::swap(M, Program);
- return Result;
- }
-
- Module *getProgram() const { return Program; }
-
- /// swapProgramIn - Set the current module to the specified module, returning
- /// the old one.
- Module *swapProgramIn(Module *M) {
- Module *OldProgram = Program;
- Program = M;
- return OldProgram;
- }
-
- AbstractInterpreter *switchToCBE() {
- AbstractInterpreter *Old = Interpreter;
- Interpreter = (AbstractInterpreter*)cbe;
- return Old;
- }
-
- void switchToInterpreter(AbstractInterpreter *AI) {
- Interpreter = AI;
- }
-
- /// setNewProgram - If we reduce or update the program somehow, call this
- /// method to update bugdriver with it. This deletes the old module and sets
- /// the specified one as the current program.
- void setNewProgram(Module *M);
-
- /// compileProgram - Try to compile the specified module, throwing an
- /// exception if an error occurs, or returning normally if not. This is used
- /// for code generation crash testing.
- ///
- void compileProgram(Module *M);
-
- /// executeProgram - This method runs "Program", capturing the output of the
- /// program to a file, returning the filename of the file. A recommended
- /// filename may be optionally specified. If there is a problem with the code
- /// generator (e.g., llc crashes), this will throw an exception.
- ///
- std::string executeProgram(std::string RequestedOutputFilename = "",
- std::string Bitcode = "",
- const std::string &SharedObjects = "",
- AbstractInterpreter *AI = 0,
- bool *ProgramExitedNonzero = 0);
-
- /// executeProgramWithCBE - Used to create reference output with the C
- /// backend, if reference output is not provided. If there is a problem with
- /// the code generator (e.g., llc crashes), this will throw an exception.
- ///
- std::string executeProgramWithCBE(std::string OutputFile = "");
-
- /// createReferenceFile - calls compileProgram and then records the output
- /// into ReferenceOutputFile. Returns true if reference file created, false
- /// otherwise. Note: initializeExecutionEnvironment should be called BEFORE
- /// this function.
- ///
- bool createReferenceFile(Module *M, const std::string &Filename
- = "bugpoint.reference.out");
-
- /// diffProgram - This method executes the specified module and diffs the
- /// output against the file specified by ReferenceOutputFile. If the output
- /// is different, true is returned. If there is a problem with the code
- /// generator (e.g., llc crashes), this will throw an exception.
- ///
- bool diffProgram(const std::string &BitcodeFile = "",
- const std::string &SharedObj = "",
- bool RemoveBitcode = false);
-
- /// EmitProgressBitcode - This function is used to output the current Program
- /// to a file named "bugpoint-ID.bc".
- ///
- void EmitProgressBitcode(const std::string &ID, bool NoFlyer = false);
-
- /// deleteInstructionFromProgram - This method clones the current Program and
- /// deletes the specified instruction from the cloned module. It then runs a
- /// series of cleanup passes (ADCE and SimplifyCFG) to eliminate any code
- /// which depends on the value. The modified module is then returned.
- ///
- Module *deleteInstructionFromProgram(const Instruction *I, unsigned Simp)
- const;
-
- /// performFinalCleanups - This method clones the current Program and performs
- /// a series of cleanups intended to get rid of extra cruft on the module. If
- /// the MayModifySemantics argument is true, then the cleanups is allowed to
- /// modify how the code behaves.
- ///
- Module *performFinalCleanups(Module *M, bool MayModifySemantics = false);
-
- /// ExtractLoop - Given a module, extract up to one loop from it into a new
- /// function. This returns null if there are no extractable loops in the
- /// program or if the loop extractor crashes.
- Module *ExtractLoop(Module *M);
-
- /// ExtractMappedBlocksFromModule - Extract all but the specified basic blocks
- /// into their own functions. The only detail is that M is actually a module
- /// cloned from the one the BBs are in, so some mapping needs to be performed.
- /// If this operation fails for some reason (ie the implementation is buggy),
- /// this function should return null, otherwise it returns a new Module.
- Module *ExtractMappedBlocksFromModule(const std::vector<BasicBlock*> &BBs,
- Module *M);
-
- /// runPassesOn - Carefully run the specified set of pass on the specified
- /// module, returning the transformed module on success, or a null pointer on
- /// failure. If AutoDebugCrashes is set to true, then bugpoint will
- /// automatically attempt to track down a crashing pass if one exists, and
- /// this method will never return null.
- Module *runPassesOn(Module *M, const std::vector<const PassInfo*> &Passes,
- bool AutoDebugCrashes = false, unsigned NumExtraArgs = 0,
- const char * const *ExtraArgs = NULL);
-
- /// runPasses - Run the specified passes on Program, outputting a bitcode
- /// file and writting the filename into OutputFile if successful. If the
- /// optimizations fail for some reason (optimizer crashes), return true,
- /// otherwise return false. If DeleteOutput is set to true, the bitcode is
- /// deleted on success, and the filename string is undefined. This prints to
- /// cout a single line message indicating whether compilation was successful
- /// or failed, unless Quiet is set. ExtraArgs specifies additional arguments
- /// to pass to the child bugpoint instance.
- ///
- bool runPasses(const std::vector<const PassInfo*> &PassesToRun,
- std::string &OutputFilename, bool DeleteOutput = false,
- bool Quiet = false, unsigned NumExtraArgs = 0,
- const char * const *ExtraArgs = NULL) const;
-
- /// runManyPasses - Take the specified pass list and create different
- /// combinations of passes to compile the program with. Compile the program with
- /// each set and mark test to see if it compiled correctly. If the passes
- /// compiled correctly output nothing and rearrange the passes into a new order.
- /// If the passes did not compile correctly, output the command required to
- /// recreate the failure. This returns true if a compiler error is found.
- ///
- bool runManyPasses(const std::vector<const PassInfo*> &AllPasses);
-
- /// writeProgramToFile - This writes the current "Program" to the named
- /// bitcode file. If an error occurs, true is returned.
- ///
- bool writeProgramToFile(const std::string &Filename, Module *M = 0) const;
-
-private:
- /// runPasses - Just like the method above, but this just returns true or
- /// false indicating whether or not the optimizer crashed on the specified
- /// input (true = crashed).
- ///
- bool runPasses(const std::vector<const PassInfo*> &PassesToRun,
- bool DeleteOutput = true) const {
- std::string Filename;
- return runPasses(PassesToRun, Filename, DeleteOutput);
- }
-
- /// runAsChild - The actual "runPasses" guts that runs in a child process.
- int runPassesAsChild(const std::vector<const PassInfo*> &PassesToRun);
-
- /// initializeExecutionEnvironment - This method is used to set up the
- /// environment for executing LLVM programs.
- ///
- bool initializeExecutionEnvironment();
-};
-
-/// ParseInputFile - Given a bitcode or assembly input filename, parse and
-/// return it, or return null if not possible.
-///
-Module *ParseInputFile(const std::string &InputFilename);
-
-
-/// getPassesString - Turn a list of passes into a string which indicates the
-/// command line options that must be passed to add the passes.
-///
-std::string getPassesString(const std::vector<const PassInfo*> &Passes);
-
-/// PrintFunctionList - prints out list of problematic functions
-///
-void PrintFunctionList(const std::vector<Function*> &Funcs);
-
-/// PrintGlobalVariableList - prints out list of problematic global variables
-///
-void PrintGlobalVariableList(const std::vector<GlobalVariable*> &GVs);
-
-// DeleteFunctionBody - "Remove" the function by deleting all of it's basic
-// blocks, making it external.
-//
-void DeleteFunctionBody(Function *F);
-
-/// SplitFunctionsOutOfModule - Given a module and a list of functions in the
-/// module, split the functions OUT of the specified module, and place them in
-/// the new module.
-Module *SplitFunctionsOutOfModule(Module *M, const std::vector<Function*> &F);
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/tools/bugpoint/CrashDebugger.cpp b/release_23/tools/bugpoint/CrashDebugger.cpp
deleted file mode 100644
index 7dcbfe3c4a68..000000000000
--- a/release_23/tools/bugpoint/CrashDebugger.cpp
+++ /dev/null
@@ -1,559 +0,0 @@
-//===- CrashDebugger.cpp - Debug compilation crashes ----------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines the bugpoint internals that narrow down compilation crashes
-//
-//===----------------------------------------------------------------------===//
-
-#include "BugDriver.h"
-#include "ToolRunner.h"
-#include "ListReducer.h"
-#include "llvm/Constants.h"
-#include "llvm/DerivedTypes.h"
-#include "llvm/Instructions.h"
-#include "llvm/Module.h"
-#include "llvm/Pass.h"
-#include "llvm/PassManager.h"
-#include "llvm/ValueSymbolTable.h"
-#include "llvm/Analysis/Verifier.h"
-#include "llvm/Support/CFG.h"
-#include "llvm/Transforms/Scalar.h"
-#include "llvm/Transforms/Utils/Cloning.h"
-#include "llvm/Support/FileUtilities.h"
-#include "llvm/Support/CommandLine.h"
-#include <fstream>
-#include <set>
-using namespace llvm;
-
-namespace {
- cl::opt<bool>
- KeepMain("keep-main",
- cl::desc("Force function reduction to keep main"),
- cl::init(false));
-}
-
-namespace llvm {
- class ReducePassList : public ListReducer<const PassInfo*> {
- BugDriver &BD;
- public:
- ReducePassList(BugDriver &bd) : BD(bd) {}
-
- // doTest - Return true iff running the "removed" passes succeeds, and
- // running the "Kept" passes fail when run on the output of the "removed"
- // passes. If we return true, we update the current module of bugpoint.
- //
- virtual TestResult doTest(std::vector<const PassInfo*> &Removed,
- std::vector<const PassInfo*> &Kept);
- };
-}
-
-ReducePassList::TestResult
-ReducePassList::doTest(std::vector<const PassInfo*> &Prefix,
- std::vector<const PassInfo*> &Suffix) {
- sys::Path PrefixOutput;
- Module *OrigProgram = 0;
- if (!Prefix.empty()) {
- std::cout << "Checking to see if these passes crash: "
- << getPassesString(Prefix) << ": ";
- std::string PfxOutput;
- if (BD.runPasses(Prefix, PfxOutput))
- return KeepPrefix;
-
- PrefixOutput.set(PfxOutput);
- OrigProgram = BD.Program;
-
- BD.Program = ParseInputFile(PrefixOutput.toString());
- if (BD.Program == 0) {
- std::cerr << BD.getToolName() << ": Error reading bitcode file '"
- << PrefixOutput << "'!\n";
- exit(1);
- }
- PrefixOutput.eraseFromDisk();
- }
-
- std::cout << "Checking to see if these passes crash: "
- << getPassesString(Suffix) << ": ";
-
- if (BD.runPasses(Suffix)) {
- delete OrigProgram; // The suffix crashes alone...
- return KeepSuffix;
- }
-
- // Nothing failed, restore state...
- if (OrigProgram) {
- delete BD.Program;
- BD.Program = OrigProgram;
- }
- return NoFailure;
-}
-
-namespace {
- /// ReduceCrashingGlobalVariables - This works by removing the global
- /// variable's initializer and seeing if the program still crashes. If it
- /// does, then we keep that program and try again.
- ///
- class ReduceCrashingGlobalVariables : public ListReducer<GlobalVariable*> {
- BugDriver &BD;
- bool (*TestFn)(BugDriver &, Module *);
- public:
- ReduceCrashingGlobalVariables(BugDriver &bd,
- bool (*testFn)(BugDriver&, Module*))
- : BD(bd), TestFn(testFn) {}
-
- virtual TestResult doTest(std::vector<GlobalVariable*>& Prefix,
- std::vector<GlobalVariable*>& Kept) {
- if (!Kept.empty() && TestGlobalVariables(Kept))
- return KeepSuffix;
-
- if (!Prefix.empty() && TestGlobalVariables(Prefix))
- return KeepPrefix;
-
- return NoFailure;
- }
-
- bool TestGlobalVariables(std::vector<GlobalVariable*>& GVs);
- };
-}
-
-bool
-ReduceCrashingGlobalVariables::TestGlobalVariables(
- std::vector<GlobalVariable*>& GVs) {
- // Clone the program to try hacking it apart...
- DenseMap<const Value*, Value*> ValueMap;
- Module *M = CloneModule(BD.getProgram(), ValueMap);
-
- // Convert list to set for fast lookup...
- std::set<GlobalVariable*> GVSet;
-
- for (unsigned i = 0, e = GVs.size(); i != e; ++i) {
- GlobalVariable* CMGV = cast<GlobalVariable>(ValueMap[GVs[i]]);
- assert(CMGV && "Global Variable not in module?!");
- GVSet.insert(CMGV);
- }
-
- std::cout << "Checking for crash with only these global variables: ";
- PrintGlobalVariableList(GVs);
- std::cout << ": ";
-
- // Loop over and delete any global variables which we aren't supposed to be
- // playing with...
- for (Module::global_iterator I = M->global_begin(), E = M->global_end();
- I != E; ++I)
- if (I->hasInitializer()) {
- I->setInitializer(0);
- I->setLinkage(GlobalValue::ExternalLinkage);
- }
-
- // Try running the hacked up program...
- if (TestFn(BD, M)) {
- BD.setNewProgram(M); // It crashed, keep the trimmed version...
-
- // Make sure to use global variable pointers that point into the now-current
- // module.
- GVs.assign(GVSet.begin(), GVSet.end());
- return true;
- }
-
- delete M;
- return false;
-}
-
-namespace llvm {
- /// ReduceCrashingFunctions reducer - This works by removing functions and
- /// seeing if the program still crashes. If it does, then keep the newer,
- /// smaller program.
- ///
- class ReduceCrashingFunctions : public ListReducer<Function*> {
- BugDriver &BD;
- bool (*TestFn)(BugDriver &, Module *);
- public:
- ReduceCrashingFunctions(BugDriver &bd,
- bool (*testFn)(BugDriver &, Module *))
- : BD(bd), TestFn(testFn) {}
-
- virtual TestResult doTest(std::vector<Function*> &Prefix,
- std::vector<Function*> &Kept) {
- if (!Kept.empty() && TestFuncs(Kept))
- return KeepSuffix;
- if (!Prefix.empty() && TestFuncs(Prefix))
- return KeepPrefix;
- return NoFailure;
- }
-
- bool TestFuncs(std::vector<Function*> &Prefix);
- };
-}
-
-bool ReduceCrashingFunctions::TestFuncs(std::vector<Function*> &Funcs) {
-
- //if main isn't present, claim there is no problem
- if (KeepMain && find(Funcs.begin(), Funcs.end(),
- BD.getProgram()->getFunction("main")) == Funcs.end())
- return false;
-
- // Clone the program to try hacking it apart...
- Module *M = CloneModule(BD.getProgram());
-
- // Convert list to set for fast lookup...
- std::set<Function*> Functions;
- for (unsigned i = 0, e = Funcs.size(); i != e; ++i) {
- // FIXME: bugpoint should add names to all stripped symbols.
- assert(!Funcs[i]->getName().empty() &&
- "Bugpoint doesn't work on stripped modules yet PR718!");
- Function *CMF = M->getFunction(Funcs[i]->getName());
- assert(CMF && "Function not in module?!");
- assert(CMF->getFunctionType() == Funcs[i]->getFunctionType() && "wrong ty");
- Functions.insert(CMF);
- }
-
- std::cout << "Checking for crash with only these functions: ";
- PrintFunctionList(Funcs);
- std::cout << ": ";
-
- // Loop over and delete any functions which we aren't supposed to be playing
- // with...
- for (Module::iterator I = M->begin(), E = M->end(); I != E; ++I)
- if (!I->isDeclaration() && !Functions.count(I))
- DeleteFunctionBody(I);
-
- // Try running the hacked up program...
- if (TestFn(BD, M)) {
- BD.setNewProgram(M); // It crashed, keep the trimmed version...
-
- // Make sure to use function pointers that point into the now-current
- // module.
- Funcs.assign(Functions.begin(), Functions.end());
- return true;
- }
- delete M;
- return false;
-}
-
-
-namespace {
- /// ReduceCrashingBlocks reducer - This works by setting the terminators of
- /// all terminators except the specified basic blocks to a 'ret' instruction,
- /// then running the simplify-cfg pass. This has the effect of chopping up
- /// the CFG really fast which can reduce large functions quickly.
- ///
- class ReduceCrashingBlocks : public ListReducer<const BasicBlock*> {
- BugDriver &BD;
- bool (*TestFn)(BugDriver &, Module *);
- public:
- ReduceCrashingBlocks(BugDriver &bd, bool (*testFn)(BugDriver &, Module *))
- : BD(bd), TestFn(testFn) {}
-
- virtual TestResult doTest(std::vector<const BasicBlock*> &Prefix,
- std::vector<const BasicBlock*> &Kept) {
- if (!Kept.empty() && TestBlocks(Kept))
- return KeepSuffix;
- if (!Prefix.empty() && TestBlocks(Prefix))
- return KeepPrefix;
- return NoFailure;
- }
-
- bool TestBlocks(std::vector<const BasicBlock*> &Prefix);
- };
-}
-
-bool ReduceCrashingBlocks::TestBlocks(std::vector<const BasicBlock*> &BBs) {
- // Clone the program to try hacking it apart...
- Module *M = CloneModule(BD.getProgram());
-
- // Convert list to set for fast lookup...
- std::set<BasicBlock*> Blocks;
- for (unsigned i = 0, e = BBs.size(); i != e; ++i) {
- // Convert the basic block from the original module to the new module...
- const Function *F = BBs[i]->getParent();
- Function *CMF = M->getFunction(F->getName());
- assert(CMF && "Function not in module?!");
- assert(CMF->getFunctionType() == F->getFunctionType() && "wrong type?");
-
- // Get the mapped basic block...
- Function::iterator CBI = CMF->begin();
- std::advance(CBI, std::distance(F->begin(),
- Function::const_iterator(BBs[i])));
- Blocks.insert(CBI);
- }
-
- std::cout << "Checking for crash with only these blocks:";
- unsigned NumPrint = Blocks.size();
- if (NumPrint > 10) NumPrint = 10;
- for (unsigned i = 0, e = NumPrint; i != e; ++i)
- std::cout << " " << BBs[i]->getName();
- if (NumPrint < Blocks.size())
- std::cout << "... <" << Blocks.size() << " total>";
- std::cout << ": ";
-
- // Loop over and delete any hack up any blocks that are not listed...
- for (Module::iterator I = M->begin(), E = M->end(); I != E; ++I)
- for (Function::iterator BB = I->begin(), E = I->end(); BB != E; ++BB)
- if (!Blocks.count(BB) && BB->getTerminator()->getNumSuccessors()) {
- // Loop over all of the successors of this block, deleting any PHI nodes
- // that might include it.
- for (succ_iterator SI = succ_begin(BB), E = succ_end(BB); SI != E; ++SI)
- (*SI)->removePredecessor(BB);
-
- TerminatorInst *BBTerm = BB->getTerminator();
-
- if (isa<StructType>(BBTerm->getType()))
- BBTerm->replaceAllUsesWith(UndefValue::get(BBTerm->getType()));
- else if (BB->getTerminator()->getType() != Type::VoidTy)
- BBTerm->replaceAllUsesWith(Constant::getNullValue(BBTerm->getType()));
-
- // Replace the old terminator instruction.
- BB->getInstList().pop_back();
- new UnreachableInst(BB);
- }
-
- // The CFG Simplifier pass may delete one of the basic blocks we are
- // interested in. If it does we need to take the block out of the list. Make
- // a "persistent mapping" by turning basic blocks into <function, name> pairs.
- // This won't work well if blocks are unnamed, but that is just the risk we
- // have to take.
- std::vector<std::pair<Function*, std::string> > BlockInfo;
-
- for (std::set<BasicBlock*>::iterator I = Blocks.begin(), E = Blocks.end();
- I != E; ++I)
- BlockInfo.push_back(std::make_pair((*I)->getParent(), (*I)->getName()));
-
- // Now run the CFG simplify pass on the function...
- PassManager Passes;
- Passes.add(createCFGSimplificationPass());
- Passes.add(createVerifierPass());
- Passes.run(*M);
-
- // Try running on the hacked up program...
- if (TestFn(BD, M)) {
- BD.setNewProgram(M); // It crashed, keep the trimmed version...
-
- // Make sure to use basic block pointers that point into the now-current
- // module, and that they don't include any deleted blocks.
- BBs.clear();
- for (unsigned i = 0, e = BlockInfo.size(); i != e; ++i) {
- ValueSymbolTable &ST = BlockInfo[i].first->getValueSymbolTable();
- Value* V = ST.lookup(BlockInfo[i].second);
- if (V && V->getType() == Type::LabelTy)
- BBs.push_back(cast<BasicBlock>(V));
- }
- return true;
- }
- delete M; // It didn't crash, try something else.
- return false;
-}
-
-/// DebugACrash - Given a predicate that determines whether a component crashes
-/// on a program, try to destructively reduce the program while still keeping
-/// the predicate true.
-static bool DebugACrash(BugDriver &BD, bool (*TestFn)(BugDriver &, Module *)) {
- // See if we can get away with nuking some of the global variable initializers
- // in the program...
- if (BD.getProgram()->global_begin() != BD.getProgram()->global_end()) {
- // Now try to reduce the number of global variable initializers in the
- // module to something small.
- Module *M = CloneModule(BD.getProgram());
- bool DeletedInit = false;
-
- for (Module::global_iterator I = M->global_begin(), E = M->global_end();
- I != E; ++I)
- if (I->hasInitializer()) {
- I->setInitializer(0);
- I->setLinkage(GlobalValue::ExternalLinkage);
- DeletedInit = true;
- }
-
- if (!DeletedInit) {
- delete M; // No change made...
- } else {
- // See if the program still causes a crash...
- std::cout << "\nChecking to see if we can delete global inits: ";
-
- if (TestFn(BD, M)) { // Still crashes?
- BD.setNewProgram(M);
- std::cout << "\n*** Able to remove all global initializers!\n";
- } else { // No longer crashes?
- std::cout << " - Removing all global inits hides problem!\n";
- delete M;
-
- std::vector<GlobalVariable*> GVs;
-
- for (Module::global_iterator I = BD.getProgram()->global_begin(),
- E = BD.getProgram()->global_end(); I != E; ++I)
- if (I->hasInitializer())
- GVs.push_back(I);
-
- if (GVs.size() > 1 && !BugpointIsInterrupted) {
- std::cout << "\n*** Attempting to reduce the number of global "
- << "variables in the testcase\n";
-
- unsigned OldSize = GVs.size();
- ReduceCrashingGlobalVariables(BD, TestFn).reduceList(GVs);
-
- if (GVs.size() < OldSize)
- BD.EmitProgressBitcode("reduced-global-variables");
- }
- }
- }
- }
-
- // Now try to reduce the number of functions in the module to something small.
- std::vector<Function*> Functions;
- for (Module::iterator I = BD.getProgram()->begin(),
- E = BD.getProgram()->end(); I != E; ++I)
- if (!I->isDeclaration())
- Functions.push_back(I);
-
- if (Functions.size() > 1 && !BugpointIsInterrupted) {
- std::cout << "\n*** Attempting to reduce the number of functions "
- "in the testcase\n";
-
- unsigned OldSize = Functions.size();
- ReduceCrashingFunctions(BD, TestFn).reduceList(Functions);
-
- if (Functions.size() < OldSize)
- BD.EmitProgressBitcode("reduced-function");
- }
-
- // Attempt to delete entire basic blocks at a time to speed up
- // convergence... this actually works by setting the terminator of the blocks
- // to a return instruction then running simplifycfg, which can potentially
- // shrinks the code dramatically quickly
- //
- if (!DisableSimplifyCFG && !BugpointIsInterrupted) {
- std::vector<const BasicBlock*> Blocks;
- for (Module::const_iterator I = BD.getProgram()->begin(),
- E = BD.getProgram()->end(); I != E; ++I)
- for (Function::const_iterator FI = I->begin(), E = I->end(); FI !=E; ++FI)
- Blocks.push_back(FI);
- ReduceCrashingBlocks(BD, TestFn).reduceList(Blocks);
- }
-
- // FIXME: This should use the list reducer to converge faster by deleting
- // larger chunks of instructions at a time!
- unsigned Simplification = 2;
- do {
- if (BugpointIsInterrupted) break;
- --Simplification;
- std::cout << "\n*** Attempting to reduce testcase by deleting instruc"
- << "tions: Simplification Level #" << Simplification << '\n';
-
- // Now that we have deleted the functions that are unnecessary for the
- // program, try to remove instructions that are not necessary to cause the
- // crash. To do this, we loop through all of the instructions in the
- // remaining functions, deleting them (replacing any values produced with
- // nulls), and then running ADCE and SimplifyCFG. If the transformed input
- // still triggers failure, keep deleting until we cannot trigger failure
- // anymore.
- //
- unsigned InstructionsToSkipBeforeDeleting = 0;
- TryAgain:
-
- // Loop over all of the (non-terminator) instructions remaining in the
- // function, attempting to delete them.
- unsigned CurInstructionNum = 0;
- for (Module::const_iterator FI = BD.getProgram()->begin(),
- E = BD.getProgram()->end(); FI != E; ++FI)
- if (!FI->isDeclaration())
- for (Function::const_iterator BI = FI->begin(), E = FI->end(); BI != E;
- ++BI)
- for (BasicBlock::const_iterator I = BI->begin(), E = --BI->end();
- I != E; ++I, ++CurInstructionNum)
- if (InstructionsToSkipBeforeDeleting) {
- --InstructionsToSkipBeforeDeleting;
- } else {
- if (BugpointIsInterrupted) goto ExitLoops;
-
- std::cout << "Checking instruction '" << I->getName() << "': ";
- Module *M = BD.deleteInstructionFromProgram(I, Simplification);
-
- // Find out if the pass still crashes on this pass...
- if (TestFn(BD, M)) {
- // Yup, it does, we delete the old module, and continue trying
- // to reduce the testcase...
- BD.setNewProgram(M);
- InstructionsToSkipBeforeDeleting = CurInstructionNum;
- goto TryAgain; // I wish I had a multi-level break here!
- }
-
- // This pass didn't crash without this instruction, try the next
- // one.
- delete M;
- }
-
- if (InstructionsToSkipBeforeDeleting) {
- InstructionsToSkipBeforeDeleting = 0;
- goto TryAgain;
- }
-
- } while (Simplification);
-ExitLoops:
-
- // Try to clean up the testcase by running funcresolve and globaldce...
- if (!BugpointIsInterrupted) {
- std::cout << "\n*** Attempting to perform final cleanups: ";
- Module *M = CloneModule(BD.getProgram());
- M = BD.performFinalCleanups(M, true);
-
- // Find out if the pass still crashes on the cleaned up program...
- if (TestFn(BD, M)) {
- BD.setNewProgram(M); // Yup, it does, keep the reduced version...
- } else {
- delete M;
- }
- }
-
- BD.EmitProgressBitcode("reduced-simplified");
-
- return false;
-}
-
-static bool TestForOptimizerCrash(BugDriver &BD, Module *M) {
- return BD.runPasses(M);
-}
-
-/// debugOptimizerCrash - This method is called when some pass crashes on input.
-/// It attempts to prune down the testcase to something reasonable, and figure
-/// out exactly which pass is crashing.
-///
-bool BugDriver::debugOptimizerCrash(const std::string &ID) {
- std::cout << "\n*** Debugging optimizer crash!\n";
-
- // Reduce the list of passes which causes the optimizer to crash...
- if (!BugpointIsInterrupted)
- ReducePassList(*this).reduceList(PassesToRun);
-
- std::cout << "\n*** Found crashing pass"
- << (PassesToRun.size() == 1 ? ": " : "es: ")
- << getPassesString(PassesToRun) << '\n';
-
- EmitProgressBitcode(ID);
-
- return DebugACrash(*this, TestForOptimizerCrash);
-}
-
-static bool TestForCodeGenCrash(BugDriver &BD, Module *M) {
- try {
- std::cerr << '\n';
- BD.compileProgram(M);
- std::cerr << '\n';
- return false;
- } catch (ToolExecutionError &) {
- std::cerr << "<crash>\n";
- return true; // Tool is still crashing.
- }
-}
-
-/// debugCodeGeneratorCrash - This method is called when the code generator
-/// crashes on an input. It attempts to reduce the input as much as possible
-/// while still causing the code generator to crash.
-bool BugDriver::debugCodeGeneratorCrash() {
- std::cerr << "*** Debugging code generator crash!\n";
-
- return DebugACrash(*this, TestForCodeGenCrash);
-}
diff --git a/release_23/tools/bugpoint/ExecutionDriver.cpp b/release_23/tools/bugpoint/ExecutionDriver.cpp
deleted file mode 100644
index 49480efb6366..000000000000
--- a/release_23/tools/bugpoint/ExecutionDriver.cpp
+++ /dev/null
@@ -1,416 +0,0 @@
-//===- ExecutionDriver.cpp - Allow execution of LLVM program --------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains code used to execute the program utilizing one of the
-// various ways of running LLVM bitcode.
-//
-//===----------------------------------------------------------------------===//
-
-#include "BugDriver.h"
-#include "ToolRunner.h"
-#include "llvm/Support/CommandLine.h"
-#include "llvm/Support/Debug.h"
-#include "llvm/Support/FileUtilities.h"
-#include "llvm/Support/SystemUtils.h"
-#include <fstream>
-#include <iostream>
-
-using namespace llvm;
-
-namespace {
- // OutputType - Allow the user to specify the way code should be run, to test
- // for miscompilation.
- //
- enum OutputType {
- AutoPick, RunLLI, RunJIT, RunLLC, RunCBE, CBE_bug, LLC_Safe, Custom
- };
-
- cl::opt<double>
- AbsTolerance("abs-tolerance", cl::desc("Absolute error tolerated"),
- cl::init(0.0));
- cl::opt<double>
- RelTolerance("rel-tolerance", cl::desc("Relative error tolerated"),
- cl::init(0.0));
-
- cl::opt<OutputType>
- InterpreterSel(cl::desc("Specify how LLVM code should be executed:"),
- cl::values(clEnumValN(AutoPick, "auto", "Use best guess"),
- clEnumValN(RunLLI, "run-int",
- "Execute with the interpreter"),
- clEnumValN(RunJIT, "run-jit", "Execute with JIT"),
- clEnumValN(RunLLC, "run-llc", "Compile with LLC"),
- clEnumValN(RunCBE, "run-cbe", "Compile with CBE"),
- clEnumValN(CBE_bug,"cbe-bug", "Find CBE bugs"),
- clEnumValN(LLC_Safe, "llc-safe", "Use LLC for all"),
- clEnumValN(Custom, "run-custom",
- "Use -exec-command to define a command to execute "
- "the bitcode. Useful for cross-compilation."),
- clEnumValEnd),
- cl::init(AutoPick));
-
- cl::opt<bool>
- CheckProgramExitCode("check-exit-code",
- cl::desc("Assume nonzero exit code is failure (default on)"),
- cl::init(true));
-
- cl::opt<bool>
- AppendProgramExitCode("append-exit-code",
- cl::desc("Append the exit code to the output so it gets diff'd too"),
- cl::init(false));
-
- cl::opt<std::string>
- InputFile("input", cl::init("/dev/null"),
- cl::desc("Filename to pipe in as stdin (default: /dev/null)"));
-
- cl::list<std::string>
- AdditionalSOs("additional-so",
- cl::desc("Additional shared objects to load "
- "into executing programs"));
-
- cl::list<std::string>
- AdditionalLinkerArgs("Xlinker",
- cl::desc("Additional arguments to pass to the linker"));
-
- cl::opt<std::string>
- CustomExecCommand("exec-command", cl::init("simulate"),
- cl::desc("Command to execute the bitcode (use with -run-custom) "
- "(default: simulate)"));
-}
-
-namespace llvm {
- // Anything specified after the --args option are taken as arguments to the
- // program being debugged.
- cl::list<std::string>
- InputArgv("args", cl::Positional, cl::desc("<program arguments>..."),
- cl::ZeroOrMore, cl::PositionalEatsArgs);
-
- cl::list<std::string>
- ToolArgv("tool-args", cl::Positional, cl::desc("<tool arguments>..."),
- cl::ZeroOrMore, cl::PositionalEatsArgs);
-}
-
-//===----------------------------------------------------------------------===//
-// BugDriver method implementation
-//
-
-/// initializeExecutionEnvironment - This method is used to set up the
-/// environment for executing LLVM programs.
-///
-bool BugDriver::initializeExecutionEnvironment() {
- std::cout << "Initializing execution environment: ";
-
- // Create an instance of the AbstractInterpreter interface as specified on
- // the command line
- cbe = 0;
- std::string Message;
-
- switch (InterpreterSel) {
- case AutoPick:
- InterpreterSel = RunCBE;
- Interpreter = cbe = AbstractInterpreter::createCBE(getToolName(), Message,
- &ToolArgv);
- if (!Interpreter) {
- InterpreterSel = RunJIT;
- Interpreter = AbstractInterpreter::createJIT(getToolName(), Message,
- &ToolArgv);
- }
- if (!Interpreter) {
- InterpreterSel = RunLLC;
- Interpreter = AbstractInterpreter::createLLC(getToolName(), Message,
- &ToolArgv);
- }
- if (!Interpreter) {
- InterpreterSel = RunLLI;
- Interpreter = AbstractInterpreter::createLLI(getToolName(), Message,
- &ToolArgv);
- }
- if (!Interpreter) {
- InterpreterSel = AutoPick;
- Message = "Sorry, I can't automatically select an interpreter!\n";
- }
- break;
- case RunLLI:
- Interpreter = AbstractInterpreter::createLLI(getToolName(), Message,
- &ToolArgv);
- break;
- case RunLLC:
- Interpreter = AbstractInterpreter::createLLC(getToolName(), Message,
- &ToolArgv);
- break;
- case RunJIT:
- Interpreter = AbstractInterpreter::createJIT(getToolName(), Message,
- &ToolArgv);
- break;
- case LLC_Safe:
- Interpreter = AbstractInterpreter::createLLC(getToolName(), Message,
- &ToolArgv);
- break;
- case RunCBE:
- case CBE_bug:
- Interpreter = AbstractInterpreter::createCBE(getToolName(), Message,
- &ToolArgv);
- break;
- case Custom:
- Interpreter = AbstractInterpreter::createCustom(getToolName(), Message,
- CustomExecCommand);
- break;
- default:
- Message = "Sorry, this back-end is not supported by bugpoint right now!\n";
- break;
- }
- std::cerr << Message;
-
- // Initialize auxiliary tools for debugging
- if (InterpreterSel == RunCBE) {
- // We already created a CBE, reuse it.
- cbe = Interpreter;
- } else if (InterpreterSel == CBE_bug || InterpreterSel == LLC_Safe) {
- // We want to debug the CBE itself or LLC is known-good. Use LLC as the
- // 'known-good' compiler.
- std::vector<std::string> ToolArgs;
- ToolArgs.push_back("--relocation-model=pic");
- cbe = AbstractInterpreter::createLLC(getToolName(), Message, &ToolArgs);
- } else {
- cbe = AbstractInterpreter::createCBE(getToolName(), Message, &ToolArgv);
- }
- if (!cbe) { std::cout << Message << "\nExiting.\n"; exit(1); }
-
- gcc = GCC::create(getToolName(), Message);
- if (!gcc) { std::cout << Message << "\nExiting.\n"; exit(1); }
-
- // If there was an error creating the selected interpreter, quit with error.
- return Interpreter == 0;
-}
-
-/// compileProgram - Try to compile the specified module, throwing an exception
-/// if an error occurs, or returning normally if not. This is used for code
-/// generation crash testing.
-///
-void BugDriver::compileProgram(Module *M) {
- // Emit the program to a bitcode file...
- sys::Path BitcodeFile ("bugpoint-test-program.bc");
- std::string ErrMsg;
- if (BitcodeFile.makeUnique(true,&ErrMsg)) {
- std::cerr << ToolName << ": Error making unique filename: " << ErrMsg
- << "\n";
- exit(1);
- }
- if (writeProgramToFile(BitcodeFile.toString(), M)) {
- std::cerr << ToolName << ": Error emitting bitcode to file '"
- << BitcodeFile << "'!\n";
- exit(1);
- }
-
- // Remove the temporary bitcode file when we are done.
- FileRemover BitcodeFileRemover(BitcodeFile);
-
- // Actually compile the program!
- Interpreter->compileProgram(BitcodeFile.toString());
-}
-
-
-/// executeProgram - This method runs "Program", capturing the output of the
-/// program to a file, returning the filename of the file. A recommended
-/// filename may be optionally specified.
-///
-std::string BugDriver::executeProgram(std::string OutputFile,
- std::string BitcodeFile,
- const std::string &SharedObj,
- AbstractInterpreter *AI,
- bool *ProgramExitedNonzero) {
- if (AI == 0) AI = Interpreter;
- assert(AI && "Interpreter should have been created already!");
- bool CreatedBitcode = false;
- std::string ErrMsg;
- if (BitcodeFile.empty()) {
- // Emit the program to a bitcode file...
- sys::Path uniqueFilename("bugpoint-test-program.bc");
- if (uniqueFilename.makeUnique(true, &ErrMsg)) {
- std::cerr << ToolName << ": Error making unique filename: "
- << ErrMsg << "!\n";
- exit(1);
- }
- BitcodeFile = uniqueFilename.toString();
-
- if (writeProgramToFile(BitcodeFile, Program)) {
- std::cerr << ToolName << ": Error emitting bitcode to file '"
- << BitcodeFile << "'!\n";
- exit(1);
- }
- CreatedBitcode = true;
- }
-
- // Remove the temporary bitcode file when we are done.
- sys::Path BitcodePath (BitcodeFile);
- FileRemover BitcodeFileRemover(BitcodePath, CreatedBitcode);
-
- if (OutputFile.empty()) OutputFile = "bugpoint-execution-output";
-
- // Check to see if this is a valid output filename...
- sys::Path uniqueFile(OutputFile);
- if (uniqueFile.makeUnique(true, &ErrMsg)) {
- std::cerr << ToolName << ": Error making unique filename: "
- << ErrMsg << "\n";
- exit(1);
- }
- OutputFile = uniqueFile.toString();
-
- // Figure out which shared objects to run, if any.
- std::vector<std::string> SharedObjs(AdditionalSOs);
- if (!SharedObj.empty())
- SharedObjs.push_back(SharedObj);
-
-
- // If this is an LLC or CBE run, then the GCC compiler might get run to
- // compile the program. If so, we should pass the user's -Xlinker options
- // as the GCCArgs.
- int RetVal = 0;
- if (InterpreterSel == RunLLC || InterpreterSel == RunCBE ||
- InterpreterSel == CBE_bug || InterpreterSel == LLC_Safe)
- RetVal = AI->ExecuteProgram(BitcodeFile, InputArgv, InputFile,
- OutputFile, AdditionalLinkerArgs, SharedObjs,
- Timeout, MemoryLimit);
- else
- RetVal = AI->ExecuteProgram(BitcodeFile, InputArgv, InputFile,
- OutputFile, std::vector<std::string>(),
- SharedObjs, Timeout, MemoryLimit);
-
- if (RetVal == -1) {
- std::cerr << "<timeout>";
- static bool FirstTimeout = true;
- if (FirstTimeout) {
- std::cout << "\n"
- "*** Program execution timed out! This mechanism is designed to handle\n"
- " programs stuck in infinite loops gracefully. The -timeout option\n"
- " can be used to change the timeout threshold or disable it completely\n"
- " (with -timeout=0). This message is only displayed once.\n";
- FirstTimeout = false;
- }
- }
-
- if (AppendProgramExitCode) {
- std::ofstream outFile(OutputFile.c_str(), std::ios_base::app);
- outFile << "exit " << RetVal << '\n';
- outFile.close();
- }
-
- if (ProgramExitedNonzero != 0)
- *ProgramExitedNonzero = (RetVal != 0);
-
- // Return the filename we captured the output to.
- return OutputFile;
-}
-
-/// executeProgramWithCBE - Used to create reference output with the C
-/// backend, if reference output is not provided.
-///
-std::string BugDriver::executeProgramWithCBE(std::string OutputFile) {
- bool ProgramExitedNonzero;
- std::string outFN = executeProgram(OutputFile, "", "", cbe,
- &ProgramExitedNonzero);
- if (ProgramExitedNonzero) {
- std::cerr
- << "Warning: While generating reference output, program exited with\n"
- << "non-zero exit code. This will NOT be treated as a failure.\n";
- CheckProgramExitCode = false;
- }
- return outFN;
-}
-
-std::string BugDriver::compileSharedObject(const std::string &BitcodeFile) {
- assert(Interpreter && "Interpreter should have been created already!");
- sys::Path OutputFile;
-
- // Using CBE
- GCC::FileType FT = cbe->OutputCode(BitcodeFile, OutputFile);
-
- std::string SharedObjectFile;
- if (gcc->MakeSharedObject(OutputFile.toString(), FT,
- SharedObjectFile, AdditionalLinkerArgs))
- exit(1);
-
- // Remove the intermediate C file
- OutputFile.eraseFromDisk();
-
- return "./" + SharedObjectFile;
-}
-
-/// createReferenceFile - calls compileProgram and then records the output
-/// into ReferenceOutputFile. Returns true if reference file created, false
-/// otherwise. Note: initializeExecutionEnvironment should be called BEFORE
-/// this function.
-///
-bool BugDriver::createReferenceFile(Module *M, const std::string &Filename) {
- try {
- compileProgram(Program);
- } catch (ToolExecutionError &) {
- return false;
- }
- try {
- ReferenceOutputFile = executeProgramWithCBE(Filename);
- std::cout << "Reference output is: " << ReferenceOutputFile << "\n\n";
- } catch (ToolExecutionError &TEE) {
- std::cerr << TEE.what();
- if (Interpreter != cbe) {
- std::cerr << "*** There is a bug running the C backend. Either debug"
- << " it (use the -run-cbe bugpoint option), or fix the error"
- << " some other way.\n";
- }
- return false;
- }
- return true;
-}
-
-/// diffProgram - This method executes the specified module and diffs the
-/// output against the file specified by ReferenceOutputFile. If the output
-/// is different, true is returned. If there is a problem with the code
-/// generator (e.g., llc crashes), this will throw an exception.
-///
-bool BugDriver::diffProgram(const std::string &BitcodeFile,
- const std::string &SharedObject,
- bool RemoveBitcode) {
- bool ProgramExitedNonzero;
-
- // Execute the program, generating an output file...
- sys::Path Output(executeProgram("", BitcodeFile, SharedObject, 0,
- &ProgramExitedNonzero));
-
- // If we're checking the program exit code, assume anything nonzero is bad.
- if (CheckProgramExitCode && ProgramExitedNonzero) {
- Output.eraseFromDisk();
- if (RemoveBitcode)
- sys::Path(BitcodeFile).eraseFromDisk();
- return true;
- }
-
- std::string Error;
- bool FilesDifferent = false;
- if (int Diff = DiffFilesWithTolerance(sys::Path(ReferenceOutputFile),
- sys::Path(Output.toString()),
- AbsTolerance, RelTolerance, &Error)) {
- if (Diff == 2) {
- std::cerr << "While diffing output: " << Error << '\n';
- exit(1);
- }
- FilesDifferent = true;
- }
-
- // Remove the generated output.
- Output.eraseFromDisk();
-
- // Remove the bitcode file if we are supposed to.
- if (RemoveBitcode)
- sys::Path(BitcodeFile).eraseFromDisk();
- return FilesDifferent;
-}
-
-bool BugDriver::isExecutingJIT() {
- return InterpreterSel == RunJIT;
-}
-
diff --git a/release_23/tools/bugpoint/ExtractFunction.cpp b/release_23/tools/bugpoint/ExtractFunction.cpp
deleted file mode 100644
index ca8a279153fe..000000000000
--- a/release_23/tools/bugpoint/ExtractFunction.cpp
+++ /dev/null
@@ -1,368 +0,0 @@
-//===- ExtractFunction.cpp - Extract a function from Program --------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements several methods that are used to extract functions,
-// loops, or portions of a module from the rest of the module.
-//
-//===----------------------------------------------------------------------===//
-
-#include "BugDriver.h"
-#include "llvm/Constants.h"
-#include "llvm/DerivedTypes.h"
-#include "llvm/Module.h"
-#include "llvm/PassManager.h"
-#include "llvm/Pass.h"
-#include "llvm/Analysis/Verifier.h"
-#include "llvm/Transforms/IPO.h"
-#include "llvm/Transforms/Scalar.h"
-#include "llvm/Transforms/Utils/Cloning.h"
-#include "llvm/Transforms/Utils/FunctionUtils.h"
-#include "llvm/Target/TargetData.h"
-#include "llvm/Support/CommandLine.h"
-#include "llvm/Support/Debug.h"
-#include "llvm/Support/FileUtilities.h"
-#include "llvm/System/Path.h"
-#include "llvm/System/Signals.h"
-#include <set>
-#include <fstream>
-#include <iostream>
-using namespace llvm;
-
-namespace llvm {
- bool DisableSimplifyCFG = false;
-} // End llvm namespace
-
-namespace {
- cl::opt<bool>
- NoDCE ("disable-dce",
- cl::desc("Do not use the -dce pass to reduce testcases"));
- cl::opt<bool, true>
- NoSCFG("disable-simplifycfg", cl::location(DisableSimplifyCFG),
- cl::desc("Do not use the -simplifycfg pass to reduce testcases"));
-}
-
-/// deleteInstructionFromProgram - This method clones the current Program and
-/// deletes the specified instruction from the cloned module. It then runs a
-/// series of cleanup passes (ADCE and SimplifyCFG) to eliminate any code which
-/// depends on the value. The modified module is then returned.
-///
-Module *BugDriver::deleteInstructionFromProgram(const Instruction *I,
- unsigned Simplification) const {
- Module *Result = CloneModule(Program);
-
- const BasicBlock *PBB = I->getParent();
- const Function *PF = PBB->getParent();
-
- Module::iterator RFI = Result->begin(); // Get iterator to corresponding fn
- std::advance(RFI, std::distance(PF->getParent()->begin(),
- Module::const_iterator(PF)));
-
- Function::iterator RBI = RFI->begin(); // Get iterator to corresponding BB
- std::advance(RBI, std::distance(PF->begin(), Function::const_iterator(PBB)));
-
- BasicBlock::iterator RI = RBI->begin(); // Get iterator to corresponding inst
- std::advance(RI, std::distance(PBB->begin(), BasicBlock::const_iterator(I)));
- Instruction *TheInst = RI; // Got the corresponding instruction!
-
- // If this instruction produces a value, replace any users with null values
- if (isa<StructType>(TheInst->getType()))
- TheInst->replaceAllUsesWith(UndefValue::get(TheInst->getType()));
- else if (TheInst->getType() != Type::VoidTy)
- TheInst->replaceAllUsesWith(Constant::getNullValue(TheInst->getType()));
-
- // Remove the instruction from the program.
- TheInst->getParent()->getInstList().erase(TheInst);
-
-
- //writeProgramToFile("current.bc", Result);
-
- // Spiff up the output a little bit.
- PassManager Passes;
- // Make sure that the appropriate target data is always used...
- Passes.add(new TargetData(Result));
-
- /// FIXME: If this used runPasses() like the methods below, we could get rid
- /// of the -disable-* options!
- if (Simplification > 1 && !NoDCE)
- Passes.add(createDeadCodeEliminationPass());
- if (Simplification && !DisableSimplifyCFG)
- Passes.add(createCFGSimplificationPass()); // Delete dead control flow
-
- Passes.add(createVerifierPass());
- Passes.run(*Result);
- return Result;
-}
-
-static const PassInfo *getPI(Pass *P) {
- const PassInfo *PI = P->getPassInfo();
- delete P;
- return PI;
-}
-
-/// performFinalCleanups - This method clones the current Program and performs
-/// a series of cleanups intended to get rid of extra cruft on the module
-/// before handing it to the user.
-///
-Module *BugDriver::performFinalCleanups(Module *M, bool MayModifySemantics) {
- // Make all functions external, so GlobalDCE doesn't delete them...
- for (Module::iterator I = M->begin(), E = M->end(); I != E; ++I)
- I->setLinkage(GlobalValue::ExternalLinkage);
-
- std::vector<const PassInfo*> CleanupPasses;
- CleanupPasses.push_back(getPI(createGlobalDCEPass()));
- CleanupPasses.push_back(getPI(createDeadTypeEliminationPass()));
-
- if (MayModifySemantics)
- CleanupPasses.push_back(getPI(createDeadArgHackingPass()));
- else
- CleanupPasses.push_back(getPI(createDeadArgEliminationPass()));
-
- Module *New = runPassesOn(M, CleanupPasses);
- if (New == 0) {
- std::cerr << "Final cleanups failed. Sorry. :( Please report a bug!\n";
- return M;
- }
- delete M;
- return New;
-}
-
-
-/// ExtractLoop - Given a module, extract up to one loop from it into a new
-/// function. This returns null if there are no extractable loops in the
-/// program or if the loop extractor crashes.
-Module *BugDriver::ExtractLoop(Module *M) {
- std::vector<const PassInfo*> LoopExtractPasses;
- LoopExtractPasses.push_back(getPI(createSingleLoopExtractorPass()));
-
- Module *NewM = runPassesOn(M, LoopExtractPasses);
- if (NewM == 0) {
- Module *Old = swapProgramIn(M);
- std::cout << "*** Loop extraction failed: ";
- EmitProgressBitcode("loopextraction", true);
- std::cout << "*** Sorry. :( Please report a bug!\n";
- swapProgramIn(Old);
- return 0;
- }
-
- // Check to see if we created any new functions. If not, no loops were
- // extracted and we should return null. Limit the number of loops we extract
- // to avoid taking forever.
- static unsigned NumExtracted = 32;
- if (M->size() == NewM->size() || --NumExtracted == 0) {
- delete NewM;
- return 0;
- } else {
- assert(M->size() < NewM->size() && "Loop extract removed functions?");
- Module::iterator MI = NewM->begin();
- for (unsigned i = 0, e = M->size(); i != e; ++i)
- ++MI;
- }
-
- return NewM;
-}
-
-
-// DeleteFunctionBody - "Remove" the function by deleting all of its basic
-// blocks, making it external.
-//
-void llvm::DeleteFunctionBody(Function *F) {
- // delete the body of the function...
- F->deleteBody();
- assert(F->isDeclaration() && "This didn't make the function external!");
-}
-
-/// GetTorInit - Given a list of entries for static ctors/dtors, return them
-/// as a constant array.
-static Constant *GetTorInit(std::vector<std::pair<Function*, int> > &TorList) {
- assert(!TorList.empty() && "Don't create empty tor list!");
- std::vector<Constant*> ArrayElts;
- for (unsigned i = 0, e = TorList.size(); i != e; ++i) {
- std::vector<Constant*> Elts;
- Elts.push_back(ConstantInt::get(Type::Int32Ty, TorList[i].second));
- Elts.push_back(TorList[i].first);
- ArrayElts.push_back(ConstantStruct::get(Elts));
- }
- return ConstantArray::get(ArrayType::get(ArrayElts[0]->getType(),
- ArrayElts.size()),
- ArrayElts);
-}
-
-/// SplitStaticCtorDtor - A module was recently split into two parts, M1/M2, and
-/// M1 has all of the global variables. If M2 contains any functions that are
-/// static ctors/dtors, we need to add an llvm.global_[cd]tors global to M2, and
-/// prune appropriate entries out of M1s list.
-static void SplitStaticCtorDtor(const char *GlobalName, Module *M1, Module *M2){
- GlobalVariable *GV = M1->getNamedGlobal(GlobalName);
- if (!GV || GV->isDeclaration() || GV->hasInternalLinkage() ||
- !GV->use_empty()) return;
-
- std::vector<std::pair<Function*, int> > M1Tors, M2Tors;
- ConstantArray *InitList = dyn_cast<ConstantArray>(GV->getInitializer());
- if (!InitList) return;
-
- for (unsigned i = 0, e = InitList->getNumOperands(); i != e; ++i) {
- if (ConstantStruct *CS = dyn_cast<ConstantStruct>(InitList->getOperand(i))){
- if (CS->getNumOperands() != 2) return; // Not array of 2-element structs.
-
- if (CS->getOperand(1)->isNullValue())
- break; // Found a null terminator, stop here.
-
- ConstantInt *CI = dyn_cast<ConstantInt>(CS->getOperand(0));
- int Priority = CI ? CI->getSExtValue() : 0;
-
- Constant *FP = CS->getOperand(1);
- if (ConstantExpr *CE = dyn_cast<ConstantExpr>(FP))
- if (CE->isCast())
- FP = CE->getOperand(0);
- if (Function *F = dyn_cast<Function>(FP)) {
- if (!F->isDeclaration())
- M1Tors.push_back(std::make_pair(F, Priority));
- else {
- // Map to M2's version of the function.
- F = M2->getFunction(F->getName());
- M2Tors.push_back(std::make_pair(F, Priority));
- }
- }
- }
- }
-
- GV->eraseFromParent();
- if (!M1Tors.empty()) {
- Constant *M1Init = GetTorInit(M1Tors);
- new GlobalVariable(M1Init->getType(), false, GlobalValue::AppendingLinkage,
- M1Init, GlobalName, M1);
- }
-
- GV = M2->getNamedGlobal(GlobalName);
- assert(GV && "Not a clone of M1?");
- assert(GV->use_empty() && "llvm.ctors shouldn't have uses!");
-
- GV->eraseFromParent();
- if (!M2Tors.empty()) {
- Constant *M2Init = GetTorInit(M2Tors);
- new GlobalVariable(M2Init->getType(), false, GlobalValue::AppendingLinkage,
- M2Init, GlobalName, M2);
- }
-}
-
-
-/// SplitFunctionsOutOfModule - Given a module and a list of functions in the
-/// module, split the functions OUT of the specified module, and place them in
-/// the new module.
-Module *llvm::SplitFunctionsOutOfModule(Module *M,
- const std::vector<Function*> &F) {
- // Make sure functions & globals are all external so that linkage
- // between the two modules will work.
- for (Module::iterator I = M->begin(), E = M->end(); I != E; ++I)
- I->setLinkage(GlobalValue::ExternalLinkage);
- for (Module::global_iterator I = M->global_begin(), E = M->global_end();
- I != E; ++I)
- I->setLinkage(GlobalValue::ExternalLinkage);
-
- Module *New = CloneModule(M);
-
- // Make sure global initializers exist only in the safe module (CBE->.so)
- for (Module::global_iterator I = New->global_begin(), E = New->global_end();
- I != E; ++I)
- I->setInitializer(0); // Delete the initializer to make it external
-
- // Remove the Test functions from the Safe module
- std::set<std::pair<std::string, const PointerType*> > TestFunctions;
- for (unsigned i = 0, e = F.size(); i != e; ++i) {
- TestFunctions.insert(std::make_pair(F[i]->getName(), F[i]->getType()));
- Function *TNOF = M->getFunction(F[i]->getName());
- assert(TNOF && "Function doesn't exist in module!");
- assert(TNOF->getFunctionType() == F[i]->getFunctionType() && "wrong type?");
- DEBUG(std::cerr << "Removing function " << F[i]->getName() << "\n");
- DeleteFunctionBody(TNOF); // Function is now external in this module!
- }
-
-
- // Remove the Safe functions from the Test module
- for (Module::iterator I = New->begin(), E = New->end(); I != E; ++I)
- if (!TestFunctions.count(std::make_pair(I->getName(), I->getType())))
- DeleteFunctionBody(I);
-
-
- // Make sure that there is a global ctor/dtor array in both halves of the
- // module if they both have static ctor/dtor functions.
- SplitStaticCtorDtor("llvm.global_ctors", M, New);
- SplitStaticCtorDtor("llvm.global_dtors", M, New);
-
- return New;
-}
-
-//===----------------------------------------------------------------------===//
-// Basic Block Extraction Code
-//===----------------------------------------------------------------------===//
-
-/// ExtractMappedBlocksFromModule - Extract all but the specified basic blocks
-/// into their own functions. The only detail is that M is actually a module
-/// cloned from the one the BBs are in, so some mapping needs to be performed.
-/// If this operation fails for some reason (ie the implementation is buggy),
-/// this function should return null, otherwise it returns a new Module.
-Module *BugDriver::ExtractMappedBlocksFromModule(const
- std::vector<BasicBlock*> &BBs,
- Module *M) {
- char *ExtraArg = NULL;
-
- sys::Path uniqueFilename("bugpoint-extractblocks");
- std::string ErrMsg;
- if (uniqueFilename.createTemporaryFileOnDisk(true, &ErrMsg)) {
- std::cout << "*** Basic Block extraction failed!\n";
- std::cerr << "Error creating temporary file: " << ErrMsg << "\n";
- M = swapProgramIn(M);
- EmitProgressBitcode("basicblockextractfail", true);
- swapProgramIn(M);
- return 0;
- }
- sys::RemoveFileOnSignal(uniqueFilename);
-
- std::ofstream BlocksToNotExtractFile(uniqueFilename.c_str());
- if (!BlocksToNotExtractFile) {
- std::cout << "*** Basic Block extraction failed!\n";
- std::cerr << "Error writing list of blocks to not extract: " << ErrMsg
- << "\n";
- M = swapProgramIn(M);
- EmitProgressBitcode("basicblockextractfail", true);
- swapProgramIn(M);
- return 0;
- }
- for (std::vector<BasicBlock*>::const_iterator I = BBs.begin(), E = BBs.end();
- I != E; ++I) {
- BasicBlock *BB = *I;
- // If the BB doesn't have a name, give it one so we have something to key
- // off of.
- if (!BB->hasName()) BB->setName("tmpbb");
- BlocksToNotExtractFile << BB->getParent()->getName() << " "
- << BB->getName() << "\n";
- }
- BlocksToNotExtractFile.close();
-
- const char *uniqueFN = uniqueFilename.c_str();
- ExtraArg = (char*)malloc(23 + strlen(uniqueFN));
- strcat(strcpy(ExtraArg, "--extract-blocks-file="), uniqueFN);
-
- std::vector<const PassInfo*> PI;
- std::vector<BasicBlock *> EmptyBBs; // This parameter is ignored.
- PI.push_back(getPI(createBlockExtractorPass(EmptyBBs)));
- Module *Ret = runPassesOn(M, PI, false, 1, &ExtraArg);
-
- if (uniqueFilename.exists())
- uniqueFilename.eraseFromDisk(); // Free disk space
- free(ExtraArg);
-
- if (Ret == 0) {
- std::cout << "*** Basic Block extraction failed, please report a bug!\n";
- M = swapProgramIn(M);
- EmitProgressBitcode("basicblockextractfail", true);
- swapProgramIn(M);
- }
- return Ret;
-}
diff --git a/release_23/tools/bugpoint/FindBugs.cpp b/release_23/tools/bugpoint/FindBugs.cpp
deleted file mode 100644
index e42cce47ba02..000000000000
--- a/release_23/tools/bugpoint/FindBugs.cpp
+++ /dev/null
@@ -1,112 +0,0 @@
-//===-- FindBugs.cpp - Run Many Different Optimizations -------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines an interface that allows bugpoint to choose different
-// combinations of optimizations to run on the selected input. Bugpoint will
-// run these optimizations and record the success/failure of each. This way
-// we can hopefully spot bugs in the optimizations.
-//
-//===----------------------------------------------------------------------===//
-
-#include "BugDriver.h"
-#include "ToolRunner.h"
-#include "llvm/Pass.h"
-#include <algorithm>
-#include <ctime>
-#include <iostream>
-using namespace llvm;
-
-/// runManyPasses - Take the specified pass list and create different
-/// combinations of passes to compile the program with. Compile the program with
-/// each set and mark test to see if it compiled correctly. If the passes
-/// compiled correctly output nothing and rearrange the passes into a new order.
-/// If the passes did not compile correctly, output the command required to
-/// recreate the failure. This returns true if a compiler error is found.
-///
-bool BugDriver::runManyPasses(const std::vector<const PassInfo*> &AllPasses) {
- setPassesToRun(AllPasses);
- std::cout << "Starting bug finding procedure...\n\n";
-
- // Creating a reference output if necessary
- if (initializeExecutionEnvironment()) return false;
-
- std::cout << "\n";
- if (ReferenceOutputFile.empty()) {
- std::cout << "Generating reference output from raw program: \n";
- if (!createReferenceFile(Program))
- return false;
- }
-
- srand(time(NULL));
-
- unsigned num = 1;
- while(1) {
- //
- // Step 1: Randomize the order of the optimizer passes.
- //
- std::random_shuffle(PassesToRun.begin(), PassesToRun.end());
-
- //
- // Step 2: Run optimizer passes on the program and check for success.
- //
- std::cout << "Running selected passes on program to test for crash: ";
- for(int i = 0, e = PassesToRun.size(); i != e; i++) {
- std::cout << "-" << PassesToRun[i]->getPassArgument( )<< " ";
- }
-
- std::string Filename;
- if(runPasses(PassesToRun, Filename, false)) {
- std::cout << "\n";
- std::cout << "Optimizer passes caused failure!\n\n";
- debugOptimizerCrash();
- return true;
- } else {
- std::cout << "Combination " << num << " optimized successfully!\n";
- }
-
- //
- // Step 3: Compile the optimized code.
- //
- std::cout << "Running the code generator to test for a crash: ";
- try {
- compileProgram(Program);
- std::cout << '\n';
- } catch (ToolExecutionError &TEE) {
- std::cout << "\n*** compileProgram threw an exception: ";
- std::cout << TEE.what();
- return debugCodeGeneratorCrash();
- }
-
- //
- // Step 4: Run the program and compare its output to the reference
- // output (created above).
- //
- std::cout << "*** Checking if passes caused miscompliation:\n";
- try {
- if (diffProgram(Filename, "", false)) {
- std::cout << "\n*** diffProgram returned true!\n";
- debugMiscompilation();
- return true;
- } else {
- std::cout << "\n*** diff'd output matches!\n";
- }
- } catch (ToolExecutionError &TEE) {
- std::cerr << TEE.what();
- debugCodeGeneratorCrash();
- return true;
- }
-
- sys::Path(Filename).eraseFromDisk();
-
- std::cout << "\n\n";
- num++;
- } //end while
-
- // Unreachable.
-}
diff --git a/release_23/tools/bugpoint/ListReducer.h b/release_23/tools/bugpoint/ListReducer.h
deleted file mode 100644
index de3f3892001e..000000000000
--- a/release_23/tools/bugpoint/ListReducer.h
+++ /dev/null
@@ -1,189 +0,0 @@
-//===- ListReducer.h - Trim down list while retaining property --*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This class is to be used as a base class for operations that want to zero in
-// on a subset of the input which still causes the bug we are tracking.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef BUGPOINT_LIST_REDUCER_H
-#define BUGPOINT_LIST_REDUCER_H
-
-#include <vector>
-#include <iostream>
-#include <cstdlib>
-#include <algorithm>
-
-namespace llvm {
-
- extern bool BugpointIsInterrupted;
-
-template<typename ElTy>
-struct ListReducer {
- enum TestResult {
- NoFailure, // No failure of the predicate was detected
- KeepSuffix, // The suffix alone satisfies the predicate
- KeepPrefix // The prefix alone satisfies the predicate
- };
-
- virtual ~ListReducer() {}
-
- // doTest - This virtual function should be overriden by subclasses to
- // implement the test desired. The testcase is only required to test to see
- // if the Kept list still satisfies the property, but if it is going to check
- // the prefix anyway, it can.
- //
- virtual TestResult doTest(std::vector<ElTy> &Prefix,
- std::vector<ElTy> &Kept) = 0;
-
- // reduceList - This function attempts to reduce the length of the specified
- // list while still maintaining the "test" property. This is the core of the
- // "work" that bugpoint does.
- //
- bool reduceList(std::vector<ElTy> &TheList) {
- std::vector<ElTy> empty;
- std::srand(0x6e5ea738); // Seed the random number generator
- switch (doTest(TheList, empty)) {
- case KeepPrefix:
- if (TheList.size() == 1) // we are done, it's the base case and it fails
- return true;
- else
- break; // there's definitely an error, but we need to narrow it down
-
- case KeepSuffix:
- // cannot be reached!
- std::cerr << "bugpoint ListReducer internal error: selected empty set.\n";
- abort();
-
- case NoFailure:
- return false; // there is no failure with the full set of passes/funcs!
- }
-
- // Maximal number of allowed splitting iterations,
- // before the elements are randomly shuffled.
- const unsigned MaxIterationsWithoutProgress = 3;
- bool ShufflingEnabled = true;
-
-Backjump:
- unsigned MidTop = TheList.size();
- unsigned MaxIterations = MaxIterationsWithoutProgress;
- unsigned NumOfIterationsWithoutProgress = 0;
- while (MidTop > 1) { // Binary split reduction loop
- // Halt if the user presses ctrl-c.
- if (BugpointIsInterrupted) {
- std::cerr << "\n\n*** Reduction Interrupted, cleaning up...\n\n";
- return true;
- }
-
- // If the loop doesn't make satisfying progress, try shuffling.
- // The purpose of shuffling is to avoid the heavy tails of the
- // distribution (improving the speed of convergence).
- if (ShufflingEnabled &&
- NumOfIterationsWithoutProgress > MaxIterations) {
- std::vector<ElTy> ShuffledList(TheList);
- std::random_shuffle(ShuffledList.begin(), ShuffledList.end());
- std::cerr << "\n\n*** Testing shuffled set...\n\n";
- // Check that random shuffle doesn't loose the bug
- if (doTest(ShuffledList, empty) == KeepPrefix) {
- // If the bug is still here, use the shuffled list.
- TheList.swap(ShuffledList);
- MidTop = TheList.size();
- // Must increase the shuffling treshold to avoid the small
- // probability of inifinite looping without making progress.
- MaxIterations += 2;
- std::cerr << "\n\n*** Shuffling does not hide the bug...\n\n";
- } else {
- ShufflingEnabled = false; // Disable shuffling further on
- std::cerr << "\n\n*** Shuffling hides the bug...\n\n";
- }
- NumOfIterationsWithoutProgress = 0;
- }
-
- unsigned Mid = MidTop / 2;
- std::vector<ElTy> Prefix(TheList.begin(), TheList.begin()+Mid);
- std::vector<ElTy> Suffix(TheList.begin()+Mid, TheList.end());
-
- switch (doTest(Prefix, Suffix)) {
- case KeepSuffix:
- // The property still holds. We can just drop the prefix elements, and
- // shorten the list to the "kept" elements.
- TheList.swap(Suffix);
- MidTop = TheList.size();
- // Reset progress treshold and progress counter
- MaxIterations = MaxIterationsWithoutProgress;
- NumOfIterationsWithoutProgress = 0;
- break;
- case KeepPrefix:
- // The predicate still holds, shorten the list to the prefix elements.
- TheList.swap(Prefix);
- MidTop = TheList.size();
- // Reset progress treshold and progress counter
- MaxIterations = MaxIterationsWithoutProgress;
- NumOfIterationsWithoutProgress = 0;
- break;
- case NoFailure:
- // Otherwise the property doesn't hold. Some of the elements we removed
- // must be necessary to maintain the property.
- MidTop = Mid;
- NumOfIterationsWithoutProgress++;
- break;
- }
- }
-
- // Probability of backjumping from the trimming loop back to the binary
- // split reduction loop.
- const int BackjumpProbability = 10;
-
- // Okay, we trimmed as much off the top and the bottom of the list as we
- // could. If there is more than two elements in the list, try deleting
- // interior elements and testing that.
- //
- if (TheList.size() > 2) {
- bool Changed = true;
- std::vector<ElTy> EmptyList;
- while (Changed) { // Trimming loop.
- Changed = false;
-
- // If the binary split reduction loop made an unfortunate sequence of
- // splits, the trimming loop might be left off with a huge number of
- // remaining elements (large search space). Backjumping out of that
- // search space and attempting a different split can significantly
- // improve the convergence speed.
- if (std::rand() % 100 < BackjumpProbability)
- goto Backjump;
-
- for (unsigned i = 1; i < TheList.size()-1; ++i) { // Check interior elts
- if (BugpointIsInterrupted) {
- std::cerr << "\n\n*** Reduction Interrupted, cleaning up...\n\n";
- return true;
- }
-
- std::vector<ElTy> TestList(TheList);
- TestList.erase(TestList.begin()+i);
-
- if (doTest(EmptyList, TestList) == KeepSuffix) {
- // We can trim down the list!
- TheList.swap(TestList);
- --i; // Don't skip an element of the list
- Changed = true;
- }
- }
- // This can take a long time if left uncontrolled. For now, don't
- // iterate.
- break;
- }
- }
-
- return true; // there are some failure and we've narrowed them down
- }
-};
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/tools/bugpoint/Makefile b/release_23/tools/bugpoint/Makefile
deleted file mode 100644
index b821b6c7bd23..000000000000
--- a/release_23/tools/bugpoint/Makefile
+++ /dev/null
@@ -1,17 +0,0 @@
-##===- tools/bugpoint/Makefile -----------------------------*- Makefile -*-===##
-#
-# The LLVM Compiler Infrastructure
-#
-# This file is distributed under the University of Illinois Open Source
-# License. See LICENSE.TXT for details.
-#
-##===----------------------------------------------------------------------===##
-LEVEL = ../..
-
-TOOLNAME = bugpoint
-
-LINK_COMPONENTS := asmparser instrumentation scalaropts ipo \
- linker bitreader bitwriter
-REQUIRES_EH := 1
-
-include $(LEVEL)/Makefile.common
diff --git a/release_23/tools/bugpoint/Miscompilation.cpp b/release_23/tools/bugpoint/Miscompilation.cpp
deleted file mode 100644
index 536c3dbd744c..000000000000
--- a/release_23/tools/bugpoint/Miscompilation.cpp
+++ /dev/null
@@ -1,915 +0,0 @@
-//===- Miscompilation.cpp - Debug program miscompilations -----------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements optimizer and code generation miscompilation debugging
-// support.
-//
-//===----------------------------------------------------------------------===//
-
-#include "BugDriver.h"
-#include "ListReducer.h"
-#include "llvm/Constants.h"
-#include "llvm/DerivedTypes.h"
-#include "llvm/Instructions.h"
-#include "llvm/Linker.h"
-#include "llvm/Module.h"
-#include "llvm/Pass.h"
-#include "llvm/Analysis/Verifier.h"
-#include "llvm/Support/Mangler.h"
-#include "llvm/Transforms/Utils/Cloning.h"
-#include "llvm/Support/CommandLine.h"
-#include "llvm/Support/FileUtilities.h"
-#include "llvm/Config/config.h" // for HAVE_LINK_R
-using namespace llvm;
-
-namespace llvm {
- extern cl::list<std::string> InputArgv;
-}
-
-namespace {
- static llvm::cl::opt<bool>
- DisableLoopExtraction("disable-loop-extraction",
- cl::desc("Don't extract loops when searching for miscompilations"),
- cl::init(false));
-
- class ReduceMiscompilingPasses : public ListReducer<const PassInfo*> {
- BugDriver &BD;
- public:
- ReduceMiscompilingPasses(BugDriver &bd) : BD(bd) {}
-
- virtual TestResult doTest(std::vector<const PassInfo*> &Prefix,
- std::vector<const PassInfo*> &Suffix);
- };
-}
-
-/// TestResult - After passes have been split into a test group and a control
-/// group, see if they still break the program.
-///
-ReduceMiscompilingPasses::TestResult
-ReduceMiscompilingPasses::doTest(std::vector<const PassInfo*> &Prefix,
- std::vector<const PassInfo*> &Suffix) {
- // First, run the program with just the Suffix passes. If it is still broken
- // with JUST the kept passes, discard the prefix passes.
- std::cout << "Checking to see if '" << getPassesString(Suffix)
- << "' compile correctly: ";
-
- std::string BitcodeResult;
- if (BD.runPasses(Suffix, BitcodeResult, false/*delete*/, true/*quiet*/)) {
- std::cerr << " Error running this sequence of passes"
- << " on the input program!\n";
- BD.setPassesToRun(Suffix);
- BD.EmitProgressBitcode("pass-error", false);
- exit(BD.debugOptimizerCrash());
- }
-
- // Check to see if the finished program matches the reference output...
- if (BD.diffProgram(BitcodeResult, "", true /*delete bitcode*/)) {
- std::cout << " nope.\n";
- if (Suffix.empty()) {
- std::cerr << BD.getToolName() << ": I'm confused: the test fails when "
- << "no passes are run, nondeterministic program?\n";
- exit(1);
- }
- return KeepSuffix; // Miscompilation detected!
- }
- std::cout << " yup.\n"; // No miscompilation!
-
- if (Prefix.empty()) return NoFailure;
-
- // Next, see if the program is broken if we run the "prefix" passes first,
- // then separately run the "kept" passes.
- std::cout << "Checking to see if '" << getPassesString(Prefix)
- << "' compile correctly: ";
-
- // If it is not broken with the kept passes, it's possible that the prefix
- // passes must be run before the kept passes to break it. If the program
- // WORKS after the prefix passes, but then fails if running the prefix AND
- // kept passes, we can update our bitcode file to include the result of the
- // prefix passes, then discard the prefix passes.
- //
- if (BD.runPasses(Prefix, BitcodeResult, false/*delete*/, true/*quiet*/)) {
- std::cerr << " Error running this sequence of passes"
- << " on the input program!\n";
- BD.setPassesToRun(Prefix);
- BD.EmitProgressBitcode("pass-error", false);
- exit(BD.debugOptimizerCrash());
- }
-
- // If the prefix maintains the predicate by itself, only keep the prefix!
- if (BD.diffProgram(BitcodeResult)) {
- std::cout << " nope.\n";
- sys::Path(BitcodeResult).eraseFromDisk();
- return KeepPrefix;
- }
- std::cout << " yup.\n"; // No miscompilation!
-
- // Ok, so now we know that the prefix passes work, try running the suffix
- // passes on the result of the prefix passes.
- //
- Module *PrefixOutput = ParseInputFile(BitcodeResult);
- if (PrefixOutput == 0) {
- std::cerr << BD.getToolName() << ": Error reading bitcode file '"
- << BitcodeResult << "'!\n";
- exit(1);
- }
- sys::Path(BitcodeResult).eraseFromDisk(); // No longer need the file on disk
-
- // Don't check if there are no passes in the suffix.
- if (Suffix.empty())
- return NoFailure;
-
- std::cout << "Checking to see if '" << getPassesString(Suffix)
- << "' passes compile correctly after the '"
- << getPassesString(Prefix) << "' passes: ";
-
- Module *OriginalInput = BD.swapProgramIn(PrefixOutput);
- if (BD.runPasses(Suffix, BitcodeResult, false/*delete*/, true/*quiet*/)) {
- std::cerr << " Error running this sequence of passes"
- << " on the input program!\n";
- BD.setPassesToRun(Suffix);
- BD.EmitProgressBitcode("pass-error", false);
- exit(BD.debugOptimizerCrash());
- }
-
- // Run the result...
- if (BD.diffProgram(BitcodeResult, "", true/*delete bitcode*/)) {
- std::cout << " nope.\n";
- delete OriginalInput; // We pruned down the original input...
- return KeepSuffix;
- }
-
- // Otherwise, we must not be running the bad pass anymore.
- std::cout << " yup.\n"; // No miscompilation!
- delete BD.swapProgramIn(OriginalInput); // Restore orig program & free test
- return NoFailure;
-}
-
-namespace {
- class ReduceMiscompilingFunctions : public ListReducer<Function*> {
- BugDriver &BD;
- bool (*TestFn)(BugDriver &, Module *, Module *);
- public:
- ReduceMiscompilingFunctions(BugDriver &bd,
- bool (*F)(BugDriver &, Module *, Module *))
- : BD(bd), TestFn(F) {}
-
- virtual TestResult doTest(std::vector<Function*> &Prefix,
- std::vector<Function*> &Suffix) {
- if (!Suffix.empty() && TestFuncs(Suffix))
- return KeepSuffix;
- if (!Prefix.empty() && TestFuncs(Prefix))
- return KeepPrefix;
- return NoFailure;
- }
-
- bool TestFuncs(const std::vector<Function*> &Prefix);
- };
-}
-
-/// TestMergedProgram - Given two modules, link them together and run the
-/// program, checking to see if the program matches the diff. If the diff
-/// matches, return false, otherwise return true. If the DeleteInputs argument
-/// is set to true then this function deletes both input modules before it
-/// returns.
-///
-static bool TestMergedProgram(BugDriver &BD, Module *M1, Module *M2,
- bool DeleteInputs) {
- // Link the two portions of the program back to together.
- std::string ErrorMsg;
- if (!DeleteInputs) {
- M1 = CloneModule(M1);
- M2 = CloneModule(M2);
- }
- if (Linker::LinkModules(M1, M2, &ErrorMsg)) {
- std::cerr << BD.getToolName() << ": Error linking modules together:"
- << ErrorMsg << '\n';
- exit(1);
- }
- delete M2; // We are done with this module.
-
- Module *OldProgram = BD.swapProgramIn(M1);
-
- // Execute the program. If it does not match the expected output, we must
- // return true.
- bool Broken = BD.diffProgram();
-
- // Delete the linked module & restore the original
- BD.swapProgramIn(OldProgram);
- delete M1;
- return Broken;
-}
-
-/// TestFuncs - split functions in a Module into two groups: those that are
-/// under consideration for miscompilation vs. those that are not, and test
-/// accordingly. Each group of functions becomes a separate Module.
-///
-bool ReduceMiscompilingFunctions::TestFuncs(const std::vector<Function*>&Funcs){
- // Test to see if the function is misoptimized if we ONLY run it on the
- // functions listed in Funcs.
- std::cout << "Checking to see if the program is misoptimized when "
- << (Funcs.size()==1 ? "this function is" : "these functions are")
- << " run through the pass"
- << (BD.getPassesToRun().size() == 1 ? "" : "es") << ":";
- PrintFunctionList(Funcs);
- std::cout << '\n';
-
- // Split the module into the two halves of the program we want.
- Module *ToNotOptimize = CloneModule(BD.getProgram());
- Module *ToOptimize = SplitFunctionsOutOfModule(ToNotOptimize, Funcs);
-
- // Run the predicate, note that the predicate will delete both input modules.
- return TestFn(BD, ToOptimize, ToNotOptimize);
-}
-
-/// DisambiguateGlobalSymbols - Mangle symbols to guarantee uniqueness by
-/// modifying predominantly internal symbols rather than external ones.
-///
-static void DisambiguateGlobalSymbols(Module *M) {
- // Try not to cause collisions by minimizing chances of renaming an
- // already-external symbol, so take in external globals and functions as-is.
- // The code should work correctly without disambiguation (assuming the same
- // mangler is used by the two code generators), but having symbols with the
- // same name causes warnings to be emitted by the code generator.
- Mangler Mang(*M);
- // Agree with the CBE on symbol naming
- Mang.markCharUnacceptable('.');
- Mang.setPreserveAsmNames(true);
- for (Module::global_iterator I = M->global_begin(), E = M->global_end();
- I != E; ++I)
- I->setName(Mang.getValueName(I));
- for (Module::iterator I = M->begin(), E = M->end(); I != E; ++I)
- I->setName(Mang.getValueName(I));
-}
-
-/// ExtractLoops - Given a reduced list of functions that still exposed the bug,
-/// check to see if we can extract the loops in the region without obscuring the
-/// bug. If so, it reduces the amount of code identified.
-///
-static bool ExtractLoops(BugDriver &BD,
- bool (*TestFn)(BugDriver &, Module *, Module *),
- std::vector<Function*> &MiscompiledFunctions) {
- bool MadeChange = false;
- while (1) {
- if (BugpointIsInterrupted) return MadeChange;
-
- Module *ToNotOptimize = CloneModule(BD.getProgram());
- Module *ToOptimize = SplitFunctionsOutOfModule(ToNotOptimize,
- MiscompiledFunctions);
- Module *ToOptimizeLoopExtracted = BD.ExtractLoop(ToOptimize);
- if (!ToOptimizeLoopExtracted) {
- // If the loop extractor crashed or if there were no extractible loops,
- // then this chapter of our odyssey is over with.
- delete ToNotOptimize;
- delete ToOptimize;
- return MadeChange;
- }
-
- std::cerr << "Extracted a loop from the breaking portion of the program.\n";
-
- // Bugpoint is intentionally not very trusting of LLVM transformations. In
- // particular, we're not going to assume that the loop extractor works, so
- // we're going to test the newly loop extracted program to make sure nothing
- // has broken. If something broke, then we'll inform the user and stop
- // extraction.
- AbstractInterpreter *AI = BD.switchToCBE();
- if (TestMergedProgram(BD, ToOptimizeLoopExtracted, ToNotOptimize, false)) {
- BD.switchToInterpreter(AI);
-
- // Merged program doesn't work anymore!
- std::cerr << " *** ERROR: Loop extraction broke the program. :("
- << " Please report a bug!\n";
- std::cerr << " Continuing on with un-loop-extracted version.\n";
-
- BD.writeProgramToFile("bugpoint-loop-extract-fail-tno.bc", ToNotOptimize);
- BD.writeProgramToFile("bugpoint-loop-extract-fail-to.bc", ToOptimize);
- BD.writeProgramToFile("bugpoint-loop-extract-fail-to-le.bc",
- ToOptimizeLoopExtracted);
-
- std::cerr << "Please submit the bugpoint-loop-extract-fail-*.bc files.\n";
- delete ToOptimize;
- delete ToNotOptimize;
- delete ToOptimizeLoopExtracted;
- return MadeChange;
- }
- delete ToOptimize;
- BD.switchToInterpreter(AI);
-
- std::cout << " Testing after loop extraction:\n";
- // Clone modules, the tester function will free them.
- Module *TOLEBackup = CloneModule(ToOptimizeLoopExtracted);
- Module *TNOBackup = CloneModule(ToNotOptimize);
- if (!TestFn(BD, ToOptimizeLoopExtracted, ToNotOptimize)) {
- std::cout << "*** Loop extraction masked the problem. Undoing.\n";
- // If the program is not still broken, then loop extraction did something
- // that masked the error. Stop loop extraction now.
- delete TOLEBackup;
- delete TNOBackup;
- return MadeChange;
- }
- ToOptimizeLoopExtracted = TOLEBackup;
- ToNotOptimize = TNOBackup;
-
- std::cout << "*** Loop extraction successful!\n";
-
- std::vector<std::pair<std::string, const FunctionType*> > MisCompFunctions;
- for (Module::iterator I = ToOptimizeLoopExtracted->begin(),
- E = ToOptimizeLoopExtracted->end(); I != E; ++I)
- if (!I->isDeclaration())
- MisCompFunctions.push_back(std::make_pair(I->getName(),
- I->getFunctionType()));
-
- // Okay, great! Now we know that we extracted a loop and that loop
- // extraction both didn't break the program, and didn't mask the problem.
- // Replace the current program with the loop extracted version, and try to
- // extract another loop.
- std::string ErrorMsg;
- if (Linker::LinkModules(ToNotOptimize, ToOptimizeLoopExtracted, &ErrorMsg)){
- std::cerr << BD.getToolName() << ": Error linking modules together:"
- << ErrorMsg << '\n';
- exit(1);
- }
- delete ToOptimizeLoopExtracted;
-
- // All of the Function*'s in the MiscompiledFunctions list are in the old
- // module. Update this list to include all of the functions in the
- // optimized and loop extracted module.
- MiscompiledFunctions.clear();
- for (unsigned i = 0, e = MisCompFunctions.size(); i != e; ++i) {
- Function *NewF = ToNotOptimize->getFunction(MisCompFunctions[i].first);
-
- assert(NewF && "Function not found??");
- assert(NewF->getFunctionType() == MisCompFunctions[i].second &&
- "found wrong function type?");
- MiscompiledFunctions.push_back(NewF);
- }
-
- BD.setNewProgram(ToNotOptimize);
- MadeChange = true;
- }
-}
-
-namespace {
- class ReduceMiscompiledBlocks : public ListReducer<BasicBlock*> {
- BugDriver &BD;
- bool (*TestFn)(BugDriver &, Module *, Module *);
- std::vector<Function*> FunctionsBeingTested;
- public:
- ReduceMiscompiledBlocks(BugDriver &bd,
- bool (*F)(BugDriver &, Module *, Module *),
- const std::vector<Function*> &Fns)
- : BD(bd), TestFn(F), FunctionsBeingTested(Fns) {}
-
- virtual TestResult doTest(std::vector<BasicBlock*> &Prefix,
- std::vector<BasicBlock*> &Suffix) {
- if (!Suffix.empty() && TestFuncs(Suffix))
- return KeepSuffix;
- if (TestFuncs(Prefix))
- return KeepPrefix;
- return NoFailure;
- }
-
- bool TestFuncs(const std::vector<BasicBlock*> &Prefix);
- };
-}
-
-/// TestFuncs - Extract all blocks for the miscompiled functions except for the
-/// specified blocks. If the problem still exists, return true.
-///
-bool ReduceMiscompiledBlocks::TestFuncs(const std::vector<BasicBlock*> &BBs) {
- // Test to see if the function is misoptimized if we ONLY run it on the
- // functions listed in Funcs.
- std::cout << "Checking to see if the program is misoptimized when all ";
- if (!BBs.empty()) {
- std::cout << "but these " << BBs.size() << " blocks are extracted: ";
- for (unsigned i = 0, e = BBs.size() < 10 ? BBs.size() : 10; i != e; ++i)
- std::cout << BBs[i]->getName() << " ";
- if (BBs.size() > 10) std::cout << "...";
- } else {
- std::cout << "blocks are extracted.";
- }
- std::cout << '\n';
-
- // Split the module into the two halves of the program we want.
- Module *ToNotOptimize = CloneModule(BD.getProgram());
- Module *ToOptimize = SplitFunctionsOutOfModule(ToNotOptimize,
- FunctionsBeingTested);
-
- // Try the extraction. If it doesn't work, then the block extractor crashed
- // or something, in which case bugpoint can't chase down this possibility.
- if (Module *New = BD.ExtractMappedBlocksFromModule(BBs, ToOptimize)) {
- delete ToOptimize;
- // Run the predicate, not that the predicate will delete both input modules.
- return TestFn(BD, New, ToNotOptimize);
- }
- delete ToOptimize;
- delete ToNotOptimize;
- return false;
-}
-
-
-/// ExtractBlocks - Given a reduced list of functions that still expose the bug,
-/// extract as many basic blocks from the region as possible without obscuring
-/// the bug.
-///
-static bool ExtractBlocks(BugDriver &BD,
- bool (*TestFn)(BugDriver &, Module *, Module *),
- std::vector<Function*> &MiscompiledFunctions) {
- if (BugpointIsInterrupted) return false;
-
- std::vector<BasicBlock*> Blocks;
- for (unsigned i = 0, e = MiscompiledFunctions.size(); i != e; ++i)
- for (Function::iterator I = MiscompiledFunctions[i]->begin(),
- E = MiscompiledFunctions[i]->end(); I != E; ++I)
- Blocks.push_back(I);
-
- // Use the list reducer to identify blocks that can be extracted without
- // obscuring the bug. The Blocks list will end up containing blocks that must
- // be retained from the original program.
- unsigned OldSize = Blocks.size();
-
- // Check to see if all blocks are extractible first.
- if (ReduceMiscompiledBlocks(BD, TestFn,
- MiscompiledFunctions).TestFuncs(std::vector<BasicBlock*>())) {
- Blocks.clear();
- } else {
- ReduceMiscompiledBlocks(BD, TestFn,MiscompiledFunctions).reduceList(Blocks);
- if (Blocks.size() == OldSize)
- return false;
- }
-
- Module *ProgClone = CloneModule(BD.getProgram());
- Module *ToExtract = SplitFunctionsOutOfModule(ProgClone,
- MiscompiledFunctions);
- Module *Extracted = BD.ExtractMappedBlocksFromModule(Blocks, ToExtract);
- if (Extracted == 0) {
- // Weird, extraction should have worked.
- std::cerr << "Nondeterministic problem extracting blocks??\n";
- delete ProgClone;
- delete ToExtract;
- return false;
- }
-
- // Otherwise, block extraction succeeded. Link the two program fragments back
- // together.
- delete ToExtract;
-
- std::vector<std::pair<std::string, const FunctionType*> > MisCompFunctions;
- for (Module::iterator I = Extracted->begin(), E = Extracted->end();
- I != E; ++I)
- if (!I->isDeclaration())
- MisCompFunctions.push_back(std::make_pair(I->getName(),
- I->getFunctionType()));
-
- std::string ErrorMsg;
- if (Linker::LinkModules(ProgClone, Extracted, &ErrorMsg)) {
- std::cerr << BD.getToolName() << ": Error linking modules together:"
- << ErrorMsg << '\n';
- exit(1);
- }
- delete Extracted;
-
- // Set the new program and delete the old one.
- BD.setNewProgram(ProgClone);
-
- // Update the list of miscompiled functions.
- MiscompiledFunctions.clear();
-
- for (unsigned i = 0, e = MisCompFunctions.size(); i != e; ++i) {
- Function *NewF = ProgClone->getFunction(MisCompFunctions[i].first);
- assert(NewF && "Function not found??");
- assert(NewF->getFunctionType() == MisCompFunctions[i].second &&
- "Function has wrong type??");
- MiscompiledFunctions.push_back(NewF);
- }
-
- return true;
-}
-
-
-/// DebugAMiscompilation - This is a generic driver to narrow down
-/// miscompilations, either in an optimization or a code generator.
-///
-static std::vector<Function*>
-DebugAMiscompilation(BugDriver &BD,
- bool (*TestFn)(BugDriver &, Module *, Module *)) {
- // Okay, now that we have reduced the list of passes which are causing the
- // failure, see if we can pin down which functions are being
- // miscompiled... first build a list of all of the non-external functions in
- // the program.
- std::vector<Function*> MiscompiledFunctions;
- Module *Prog = BD.getProgram();
- for (Module::iterator I = Prog->begin(), E = Prog->end(); I != E; ++I)
- if (!I->isDeclaration())
- MiscompiledFunctions.push_back(I);
-
- // Do the reduction...
- if (!BugpointIsInterrupted)
- ReduceMiscompilingFunctions(BD, TestFn).reduceList(MiscompiledFunctions);
-
- std::cout << "\n*** The following function"
- << (MiscompiledFunctions.size() == 1 ? " is" : "s are")
- << " being miscompiled: ";
- PrintFunctionList(MiscompiledFunctions);
- std::cout << '\n';
-
- // See if we can rip any loops out of the miscompiled functions and still
- // trigger the problem.
-
- if (!BugpointIsInterrupted && !DisableLoopExtraction &&
- ExtractLoops(BD, TestFn, MiscompiledFunctions)) {
- // Okay, we extracted some loops and the problem still appears. See if we
- // can eliminate some of the created functions from being candidates.
-
- // Loop extraction can introduce functions with the same name (foo_code).
- // Make sure to disambiguate the symbols so that when the program is split
- // apart that we can link it back together again.
- DisambiguateGlobalSymbols(BD.getProgram());
-
- // Do the reduction...
- if (!BugpointIsInterrupted)
- ReduceMiscompilingFunctions(BD, TestFn).reduceList(MiscompiledFunctions);
-
- std::cout << "\n*** The following function"
- << (MiscompiledFunctions.size() == 1 ? " is" : "s are")
- << " being miscompiled: ";
- PrintFunctionList(MiscompiledFunctions);
- std::cout << '\n';
- }
-
- if (!BugpointIsInterrupted &&
- ExtractBlocks(BD, TestFn, MiscompiledFunctions)) {
- // Okay, we extracted some blocks and the problem still appears. See if we
- // can eliminate some of the created functions from being candidates.
-
- // Block extraction can introduce functions with the same name (foo_code).
- // Make sure to disambiguate the symbols so that when the program is split
- // apart that we can link it back together again.
- DisambiguateGlobalSymbols(BD.getProgram());
-
- // Do the reduction...
- ReduceMiscompilingFunctions(BD, TestFn).reduceList(MiscompiledFunctions);
-
- std::cout << "\n*** The following function"
- << (MiscompiledFunctions.size() == 1 ? " is" : "s are")
- << " being miscompiled: ";
- PrintFunctionList(MiscompiledFunctions);
- std::cout << '\n';
- }
-
- return MiscompiledFunctions;
-}
-
-/// TestOptimizer - This is the predicate function used to check to see if the
-/// "Test" portion of the program is misoptimized. If so, return true. In any
-/// case, both module arguments are deleted.
-///
-static bool TestOptimizer(BugDriver &BD, Module *Test, Module *Safe) {
- // Run the optimization passes on ToOptimize, producing a transformed version
- // of the functions being tested.
- std::cout << " Optimizing functions being tested: ";
- Module *Optimized = BD.runPassesOn(Test, BD.getPassesToRun(),
- /*AutoDebugCrashes*/true);
- std::cout << "done.\n";
- delete Test;
-
- std::cout << " Checking to see if the merged program executes correctly: ";
- bool Broken = TestMergedProgram(BD, Optimized, Safe, true);
- std::cout << (Broken ? " nope.\n" : " yup.\n");
- return Broken;
-}
-
-
-/// debugMiscompilation - This method is used when the passes selected are not
-/// crashing, but the generated output is semantically different from the
-/// input.
-///
-bool BugDriver::debugMiscompilation() {
- // Make sure something was miscompiled...
- if (!BugpointIsInterrupted)
- if (!ReduceMiscompilingPasses(*this).reduceList(PassesToRun)) {
- std::cerr << "*** Optimized program matches reference output! No problem"
- << " detected...\nbugpoint can't help you with your problem!\n";
- return false;
- }
-
- std::cout << "\n*** Found miscompiling pass"
- << (getPassesToRun().size() == 1 ? "" : "es") << ": "
- << getPassesString(getPassesToRun()) << '\n';
- EmitProgressBitcode("passinput");
-
- std::vector<Function*> MiscompiledFunctions =
- DebugAMiscompilation(*this, TestOptimizer);
-
- // Output a bunch of bitcode files for the user...
- std::cout << "Outputting reduced bitcode files which expose the problem:\n";
- Module *ToNotOptimize = CloneModule(getProgram());
- Module *ToOptimize = SplitFunctionsOutOfModule(ToNotOptimize,
- MiscompiledFunctions);
-
- std::cout << " Non-optimized portion: ";
- ToNotOptimize = swapProgramIn(ToNotOptimize);
- EmitProgressBitcode("tonotoptimize", true);
- setNewProgram(ToNotOptimize); // Delete hacked module.
-
- std::cout << " Portion that is input to optimizer: ";
- ToOptimize = swapProgramIn(ToOptimize);
- EmitProgressBitcode("tooptimize");
- setNewProgram(ToOptimize); // Delete hacked module.
-
- return false;
-}
-
-/// CleanupAndPrepareModules - Get the specified modules ready for code
-/// generator testing.
-///
-static void CleanupAndPrepareModules(BugDriver &BD, Module *&Test,
- Module *Safe) {
- // Clean up the modules, removing extra cruft that we don't need anymore...
- Test = BD.performFinalCleanups(Test);
-
- // If we are executing the JIT, we have several nasty issues to take care of.
- if (!BD.isExecutingJIT()) return;
-
- // First, if the main function is in the Safe module, we must add a stub to
- // the Test module to call into it. Thus, we create a new function `main'
- // which just calls the old one.
- if (Function *oldMain = Safe->getFunction("main"))
- if (!oldMain->isDeclaration()) {
- // Rename it
- oldMain->setName("llvm_bugpoint_old_main");
- // Create a NEW `main' function with same type in the test module.
- Function *newMain = Function::Create(oldMain->getFunctionType(),
- GlobalValue::ExternalLinkage,
- "main", Test);
- // Create an `oldmain' prototype in the test module, which will
- // corresponds to the real main function in the same module.
- Function *oldMainProto = Function::Create(oldMain->getFunctionType(),
- GlobalValue::ExternalLinkage,
- oldMain->getName(), Test);
- // Set up and remember the argument list for the main function.
- std::vector<Value*> args;
- for (Function::arg_iterator
- I = newMain->arg_begin(), E = newMain->arg_end(),
- OI = oldMain->arg_begin(); I != E; ++I, ++OI) {
- I->setName(OI->getName()); // Copy argument names from oldMain
- args.push_back(I);
- }
-
- // Call the old main function and return its result
- BasicBlock *BB = BasicBlock::Create("entry", newMain);
- CallInst *call = CallInst::Create(oldMainProto, args.begin(), args.end(),
- "", BB);
-
- // If the type of old function wasn't void, return value of call
- ReturnInst::Create(call, BB);
- }
-
- // The second nasty issue we must deal with in the JIT is that the Safe
- // module cannot directly reference any functions defined in the test
- // module. Instead, we use a JIT API call to dynamically resolve the
- // symbol.
-
- // Add the resolver to the Safe module.
- // Prototype: void *getPointerToNamedFunction(const char* Name)
- Constant *resolverFunc =
- Safe->getOrInsertFunction("getPointerToNamedFunction",
- PointerType::getUnqual(Type::Int8Ty),
- PointerType::getUnqual(Type::Int8Ty), (Type *)0);
-
- // Use the function we just added to get addresses of functions we need.
- for (Module::iterator F = Safe->begin(), E = Safe->end(); F != E; ++F) {
- if (F->isDeclaration() && !F->use_empty() && &*F != resolverFunc &&
- !F->isIntrinsic() /* ignore intrinsics */) {
- Function *TestFn = Test->getFunction(F->getName());
-
- // Don't forward functions which are external in the test module too.
- if (TestFn && !TestFn->isDeclaration()) {
- // 1. Add a string constant with its name to the global file
- Constant *InitArray = ConstantArray::get(F->getName());
- GlobalVariable *funcName =
- new GlobalVariable(InitArray->getType(), true /*isConstant*/,
- GlobalValue::InternalLinkage, InitArray,
- F->getName() + "_name", Safe);
-
- // 2. Use `GetElementPtr *funcName, 0, 0' to convert the string to an
- // sbyte* so it matches the signature of the resolver function.
-
- // GetElementPtr *funcName, ulong 0, ulong 0
- std::vector<Constant*> GEPargs(2,Constant::getNullValue(Type::Int32Ty));
- Value *GEP = ConstantExpr::getGetElementPtr(funcName, &GEPargs[0], 2);
- std::vector<Value*> ResolverArgs;
- ResolverArgs.push_back(GEP);
-
- // Rewrite uses of F in global initializers, etc. to uses of a wrapper
- // function that dynamically resolves the calls to F via our JIT API
- if (!F->use_empty()) {
- // Create a new global to hold the cached function pointer.
- Constant *NullPtr = ConstantPointerNull::get(F->getType());
- GlobalVariable *Cache =
- new GlobalVariable(F->getType(), false,GlobalValue::InternalLinkage,
- NullPtr,F->getName()+".fpcache", F->getParent());
-
- // Construct a new stub function that will re-route calls to F
- const FunctionType *FuncTy = F->getFunctionType();
- Function *FuncWrapper = Function::Create(FuncTy,
- GlobalValue::InternalLinkage,
- F->getName() + "_wrapper",
- F->getParent());
- BasicBlock *EntryBB = BasicBlock::Create("entry", FuncWrapper);
- BasicBlock *DoCallBB = BasicBlock::Create("usecache", FuncWrapper);
- BasicBlock *LookupBB = BasicBlock::Create("lookupfp", FuncWrapper);
-
- // Check to see if we already looked up the value.
- Value *CachedVal = new LoadInst(Cache, "fpcache", EntryBB);
- Value *IsNull = new ICmpInst(ICmpInst::ICMP_EQ, CachedVal,
- NullPtr, "isNull", EntryBB);
- BranchInst::Create(LookupBB, DoCallBB, IsNull, EntryBB);
-
- // Resolve the call to function F via the JIT API:
- //
- // call resolver(GetElementPtr...)
- CallInst *Resolver = CallInst::Create(resolverFunc, ResolverArgs.begin(),
- ResolverArgs.end(),
- "resolver", LookupBB);
- // cast the result from the resolver to correctly-typed function
- CastInst *CastedResolver = new BitCastInst(Resolver,
- PointerType::getUnqual(F->getFunctionType()), "resolverCast", LookupBB);
-
- // Save the value in our cache.
- new StoreInst(CastedResolver, Cache, LookupBB);
- BranchInst::Create(DoCallBB, LookupBB);
-
- PHINode *FuncPtr = PHINode::Create(NullPtr->getType(), "fp", DoCallBB);
- FuncPtr->addIncoming(CastedResolver, LookupBB);
- FuncPtr->addIncoming(CachedVal, EntryBB);
-
- // Save the argument list.
- std::vector<Value*> Args;
- for (Function::arg_iterator i = FuncWrapper->arg_begin(),
- e = FuncWrapper->arg_end(); i != e; ++i)
- Args.push_back(i);
-
- // Pass on the arguments to the real function, return its result
- if (F->getReturnType() == Type::VoidTy) {
- CallInst::Create(FuncPtr, Args.begin(), Args.end(), "", DoCallBB);
- ReturnInst::Create(DoCallBB);
- } else {
- CallInst *Call = CallInst::Create(FuncPtr, Args.begin(), Args.end(),
- "retval", DoCallBB);
- ReturnInst::Create(Call, DoCallBB);
- }
-
- // Use the wrapper function instead of the old function
- F->replaceAllUsesWith(FuncWrapper);
- }
- }
- }
- }
-
- if (verifyModule(*Test) || verifyModule(*Safe)) {
- std::cerr << "Bugpoint has a bug, which corrupted a module!!\n";
- abort();
- }
-}
-
-
-
-/// TestCodeGenerator - This is the predicate function used to check to see if
-/// the "Test" portion of the program is miscompiled by the code generator under
-/// test. If so, return true. In any case, both module arguments are deleted.
-///
-static bool TestCodeGenerator(BugDriver &BD, Module *Test, Module *Safe) {
- CleanupAndPrepareModules(BD, Test, Safe);
-
- sys::Path TestModuleBC("bugpoint.test.bc");
- std::string ErrMsg;
- if (TestModuleBC.makeUnique(true, &ErrMsg)) {
- std::cerr << BD.getToolName() << "Error making unique filename: "
- << ErrMsg << "\n";
- exit(1);
- }
- if (BD.writeProgramToFile(TestModuleBC.toString(), Test)) {
- std::cerr << "Error writing bitcode to `" << TestModuleBC << "'\nExiting.";
- exit(1);
- }
- delete Test;
-
- // Make the shared library
- sys::Path SafeModuleBC("bugpoint.safe.bc");
- if (SafeModuleBC.makeUnique(true, &ErrMsg)) {
- std::cerr << BD.getToolName() << "Error making unique filename: "
- << ErrMsg << "\n";
- exit(1);
- }
-
- if (BD.writeProgramToFile(SafeModuleBC.toString(), Safe)) {
- std::cerr << "Error writing bitcode to `" << SafeModuleBC << "'\nExiting.";
- exit(1);
- }
- std::string SharedObject = BD.compileSharedObject(SafeModuleBC.toString());
- delete Safe;
-
- // Run the code generator on the `Test' code, loading the shared library.
- // The function returns whether or not the new output differs from reference.
- int Result = BD.diffProgram(TestModuleBC.toString(), SharedObject, false);
-
- if (Result)
- std::cerr << ": still failing!\n";
- else
- std::cerr << ": didn't fail.\n";
- TestModuleBC.eraseFromDisk();
- SafeModuleBC.eraseFromDisk();
- sys::Path(SharedObject).eraseFromDisk();
-
- return Result;
-}
-
-
-/// debugCodeGenerator - debug errors in LLC, LLI, or CBE.
-///
-bool BugDriver::debugCodeGenerator() {
- if ((void*)cbe == (void*)Interpreter) {
- std::string Result = executeProgramWithCBE("bugpoint.cbe.out");
- std::cout << "\n*** The C backend cannot match the reference diff, but it "
- << "is used as the 'known good'\n code generator, so I can't"
- << " debug it. Perhaps you have a front-end problem?\n As a"
- << " sanity check, I left the result of executing the program "
- << "with the C backend\n in this file for you: '"
- << Result << "'.\n";
- return true;
- }
-
- DisambiguateGlobalSymbols(Program);
-
- std::vector<Function*> Funcs = DebugAMiscompilation(*this, TestCodeGenerator);
-
- // Split the module into the two halves of the program we want.
- Module *ToNotCodeGen = CloneModule(getProgram());
- Module *ToCodeGen = SplitFunctionsOutOfModule(ToNotCodeGen, Funcs);
-
- // Condition the modules
- CleanupAndPrepareModules(*this, ToCodeGen, ToNotCodeGen);
-
- sys::Path TestModuleBC("bugpoint.test.bc");
- std::string ErrMsg;
- if (TestModuleBC.makeUnique(true, &ErrMsg)) {
- std::cerr << getToolName() << "Error making unique filename: "
- << ErrMsg << "\n";
- exit(1);
- }
-
- if (writeProgramToFile(TestModuleBC.toString(), ToCodeGen)) {
- std::cerr << "Error writing bitcode to `" << TestModuleBC << "'\nExiting.";
- exit(1);
- }
- delete ToCodeGen;
-
- // Make the shared library
- sys::Path SafeModuleBC("bugpoint.safe.bc");
- if (SafeModuleBC.makeUnique(true, &ErrMsg)) {
- std::cerr << getToolName() << "Error making unique filename: "
- << ErrMsg << "\n";
- exit(1);
- }
-
- if (writeProgramToFile(SafeModuleBC.toString(), ToNotCodeGen)) {
- std::cerr << "Error writing bitcode to `" << SafeModuleBC << "'\nExiting.";
- exit(1);
- }
- std::string SharedObject = compileSharedObject(SafeModuleBC.toString());
- delete ToNotCodeGen;
-
- std::cout << "You can reproduce the problem with the command line: \n";
- if (isExecutingJIT()) {
- std::cout << " lli -load " << SharedObject << " " << TestModuleBC;
- } else {
- std::cout << " llc -f " << TestModuleBC << " -o " << TestModuleBC<< ".s\n";
- std::cout << " gcc " << SharedObject << " " << TestModuleBC
- << ".s -o " << TestModuleBC << ".exe";
-#if defined (HAVE_LINK_R)
- std::cout << " -Wl,-R.";
-#endif
- std::cout << "\n";
- std::cout << " " << TestModuleBC << ".exe";
- }
- for (unsigned i=0, e = InputArgv.size(); i != e; ++i)
- std::cout << " " << InputArgv[i];
- std::cout << '\n';
- std::cout << "The shared object was created with:\n llc -march=c "
- << SafeModuleBC << " -o temporary.c\n"
- << " gcc -xc temporary.c -O2 -o " << SharedObject
-#if defined(sparc) || defined(__sparc__) || defined(__sparcv9)
- << " -G" // Compile a shared library, `-G' for Sparc
-#else
- << " -fPIC -shared" // `-shared' for Linux/X86, maybe others
-#endif
- << " -fno-strict-aliasing\n";
-
- return false;
-}
diff --git a/release_23/tools/bugpoint/OptimizerDriver.cpp b/release_23/tools/bugpoint/OptimizerDriver.cpp
deleted file mode 100644
index b08171bc5879..000000000000
--- a/release_23/tools/bugpoint/OptimizerDriver.cpp
+++ /dev/null
@@ -1,259 +0,0 @@
-//===- OptimizerDriver.cpp - Allow BugPoint to run passes safely ----------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines an interface that allows bugpoint to run various passes
-// without the threat of a buggy pass corrupting bugpoint (of course, bugpoint
-// may have its own bugs, but that's another story...). It achieves this by
-// forking a copy of itself and having the child process do the optimizations.
-// If this client dies, we can always fork a new one. :)
-//
-//===----------------------------------------------------------------------===//
-
-// Note: as a short term hack, the old Unix-specific code and platform-
-// independent code co-exist via conditional compilation until it is verified
-// that the new code works correctly on Unix.
-
-#include "BugDriver.h"
-#include "llvm/Module.h"
-#include "llvm/PassManager.h"
-#include "llvm/Analysis/Verifier.h"
-#include "llvm/Bitcode/ReaderWriter.h"
-#include "llvm/Target/TargetData.h"
-#include "llvm/Support/FileUtilities.h"
-#include "llvm/Support/CommandLine.h"
-#include "llvm/Support/Streams.h"
-#include "llvm/System/Path.h"
-#include "llvm/System/Program.h"
-#include "llvm/Config/alloca.h"
-
-#define DONT_GET_PLUGIN_LOADER_OPTION
-#include "llvm/Support/PluginLoader.h"
-
-#include <fstream>
-using namespace llvm;
-
-
-namespace {
- // ChildOutput - This option captures the name of the child output file that
- // is set up by the parent bugpoint process
- cl::opt<std::string> ChildOutput("child-output", cl::ReallyHidden);
- cl::opt<bool> UseValgrind("enable-valgrind",
- cl::desc("Run optimizations through valgrind"));
-}
-
-/// writeProgramToFile - This writes the current "Program" to the named bitcode
-/// file. If an error occurs, true is returned.
-///
-bool BugDriver::writeProgramToFile(const std::string &Filename,
- Module *M) const {
- std::ios::openmode io_mode = std::ios::out | std::ios::trunc |
- std::ios::binary;
- std::ofstream Out(Filename.c_str(), io_mode);
- if (!Out.good()) return true;
-
- WriteBitcodeToFile(M ? M : Program, Out);
- return false;
-}
-
-
-/// EmitProgressBitcode - This function is used to output the current Program
-/// to a file named "bugpoint-ID.bc".
-///
-void BugDriver::EmitProgressBitcode(const std::string &ID, bool NoFlyer) {
- // Output the input to the current pass to a bitcode file, emit a message
- // telling the user how to reproduce it: opt -foo blah.bc
- //
- std::string Filename = "bugpoint-" + ID + ".bc";
- if (writeProgramToFile(Filename)) {
- cerr << "Error opening file '" << Filename << "' for writing!\n";
- return;
- }
-
- cout << "Emitted bitcode to '" << Filename << "'\n";
- if (NoFlyer || PassesToRun.empty()) return;
- cout << "\n*** You can reproduce the problem with: ";
- cout << "opt " << Filename << " ";
- cout << getPassesString(PassesToRun) << "\n";
-}
-
-int BugDriver::runPassesAsChild(const std::vector<const PassInfo*> &Passes) {
-
- std::ios::openmode io_mode = std::ios::out | std::ios::trunc |
- std::ios::binary;
- std::ofstream OutFile(ChildOutput.c_str(), io_mode);
- if (!OutFile.good()) {
- cerr << "Error opening bitcode file: " << ChildOutput << "\n";
- return 1;
- }
-
- PassManager PM;
- // Make sure that the appropriate target data is always used...
- PM.add(new TargetData(Program));
-
- for (unsigned i = 0, e = Passes.size(); i != e; ++i) {
- if (Passes[i]->getNormalCtor())
- PM.add(Passes[i]->getNormalCtor()());
- else
- cerr << "Cannot create pass yet: " << Passes[i]->getPassName() << "\n";
- }
- // Check that the module is well formed on completion of optimization
- PM.add(createVerifierPass());
-
- // Write bitcode out to disk as the last step...
- PM.add(CreateBitcodeWriterPass(OutFile));
-
- // Run all queued passes.
- PM.run(*Program);
-
- return 0;
-}
-
-/// runPasses - Run the specified passes on Program, outputting a bitcode file
-/// and writing the filename into OutputFile if successful. If the
-/// optimizations fail for some reason (optimizer crashes), return true,
-/// otherwise return false. If DeleteOutput is set to true, the bitcode is
-/// deleted on success, and the filename string is undefined. This prints to
-/// cout a single line message indicating whether compilation was successful or
-/// failed.
-///
-bool BugDriver::runPasses(const std::vector<const PassInfo*> &Passes,
- std::string &OutputFilename, bool DeleteOutput,
- bool Quiet, unsigned NumExtraArgs,
- const char * const *ExtraArgs) const {
- // setup the output file name
- cout << std::flush;
- sys::Path uniqueFilename("bugpoint-output.bc");
- std::string ErrMsg;
- if (uniqueFilename.makeUnique(true, &ErrMsg)) {
- cerr << getToolName() << ": Error making unique filename: "
- << ErrMsg << "\n";
- return(1);
- }
- OutputFilename = uniqueFilename.toString();
-
- // set up the input file name
- sys::Path inputFilename("bugpoint-input.bc");
- if (inputFilename.makeUnique(true, &ErrMsg)) {
- cerr << getToolName() << ": Error making unique filename: "
- << ErrMsg << "\n";
- return(1);
- }
- std::ios::openmode io_mode = std::ios::out | std::ios::trunc |
- std::ios::binary;
- std::ofstream InFile(inputFilename.c_str(), io_mode);
- if (!InFile.good()) {
- cerr << "Error opening bitcode file: " << inputFilename << "\n";
- return(1);
- }
- WriteBitcodeToFile(Program, InFile);
- InFile.close();
-
- // setup the child process' arguments
- const char** args = (const char**)
- alloca(sizeof(const char*) *
- (Passes.size()+13+2*PluginLoader::getNumPlugins()+NumExtraArgs));
- int n = 0;
- sys::Path tool = sys::Program::FindProgramByName(ToolName);
- if (UseValgrind) {
- args[n++] = "valgrind";
- args[n++] = "--error-exitcode=1";
- args[n++] = "-q";
- args[n++] = tool.c_str();
- } else
- args[n++] = ToolName.c_str();
-
- args[n++] = "-as-child";
- args[n++] = "-child-output";
- args[n++] = OutputFilename.c_str();
- std::vector<std::string> pass_args;
- for (unsigned i = 0, e = PluginLoader::getNumPlugins(); i != e; ++i) {
- pass_args.push_back( std::string("-load"));
- pass_args.push_back( PluginLoader::getPlugin(i));
- }
- for (std::vector<const PassInfo*>::const_iterator I = Passes.begin(),
- E = Passes.end(); I != E; ++I )
- pass_args.push_back( std::string("-") + (*I)->getPassArgument() );
- for (std::vector<std::string>::const_iterator I = pass_args.begin(),
- E = pass_args.end(); I != E; ++I )
- args[n++] = I->c_str();
- args[n++] = inputFilename.c_str();
- for (unsigned i = 0; i < NumExtraArgs; ++i)
- args[n++] = *ExtraArgs;
- args[n++] = 0;
-
- sys::Path prog;
- if (UseValgrind)
- prog = sys::Program::FindProgramByName("valgrind");
- else
- prog = tool;
- int result = sys::Program::ExecuteAndWait(prog, args, 0, 0,
- Timeout, MemoryLimit, &ErrMsg);
-
- // If we are supposed to delete the bitcode file or if the passes crashed,
- // remove it now. This may fail if the file was never created, but that's ok.
- if (DeleteOutput || result != 0)
- sys::Path(OutputFilename).eraseFromDisk();
-
- // Remove the temporary input file as well
- inputFilename.eraseFromDisk();
-
- if (!Quiet) {
- if (result == 0)
- cout << "Success!\n";
- else if (result > 0)
- cout << "Exited with error code '" << result << "'\n";
- else if (result < 0) {
- if (result == -1)
- cout << "Execute failed: " << ErrMsg << "\n";
- else
- cout << "Crashed with signal #" << abs(result) << "\n";
- }
- if (result & 0x01000000)
- cout << "Dumped core\n";
- }
-
- // Was the child successful?
- return result != 0;
-}
-
-
-/// runPassesOn - Carefully run the specified set of pass on the specified
-/// module, returning the transformed module on success, or a null pointer on
-/// failure.
-Module *BugDriver::runPassesOn(Module *M,
- const std::vector<const PassInfo*> &Passes,
- bool AutoDebugCrashes, unsigned NumExtraArgs,
- const char * const *ExtraArgs) {
- Module *OldProgram = swapProgramIn(M);
- std::string BitcodeResult;
- if (runPasses(Passes, BitcodeResult, false/*delete*/, true/*quiet*/,
- NumExtraArgs, ExtraArgs)) {
- if (AutoDebugCrashes) {
- cerr << " Error running this sequence of passes"
- << " on the input program!\n";
- delete OldProgram;
- EmitProgressBitcode("pass-error", false);
- exit(debugOptimizerCrash());
- }
- swapProgramIn(OldProgram);
- return 0;
- }
-
- // Restore the current program.
- swapProgramIn(OldProgram);
-
- Module *Ret = ParseInputFile(BitcodeResult);
- if (Ret == 0) {
- cerr << getToolName() << ": Error reading bitcode file '"
- << BitcodeResult << "'!\n";
- exit(1);
- }
- sys::Path(BitcodeResult).eraseFromDisk(); // No longer need the file on disk
- return Ret;
-}
diff --git a/release_23/tools/bugpoint/TestPasses.cpp b/release_23/tools/bugpoint/TestPasses.cpp
deleted file mode 100644
index db7544b57a62..000000000000
--- a/release_23/tools/bugpoint/TestPasses.cpp
+++ /dev/null
@@ -1,75 +0,0 @@
-//===- TestPasses.cpp - "buggy" passes used to test bugpoint --------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains "buggy" passes that are used to test bugpoint, to check
-// that it is narrowing down testcases correctly.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/BasicBlock.h"
-#include "llvm/Constant.h"
-#include "llvm/Instructions.h"
-#include "llvm/Pass.h"
-#include "llvm/Type.h"
-#include "llvm/Support/InstVisitor.h"
-
-using namespace llvm;
-
-namespace {
- /// CrashOnCalls - This pass is used to test bugpoint. It intentionally
- /// crashes on any call instructions.
- class CrashOnCalls : public BasicBlockPass {
- public:
- static char ID; // Pass ID, replacement for typeid
- CrashOnCalls() : BasicBlockPass((intptr_t)&ID) {}
- private:
- virtual void getAnalysisUsage(AnalysisUsage &AU) const {
- AU.setPreservesAll();
- }
-
- bool runOnBasicBlock(BasicBlock &BB) {
- for (BasicBlock::iterator I = BB.begin(), E = BB.end(); I != E; ++I)
- if (isa<CallInst>(*I))
- abort();
-
- return false;
- }
- };
-
- char CrashOnCalls::ID = 0;
- RegisterPass<CrashOnCalls>
- X("bugpoint-crashcalls",
- "BugPoint Test Pass - Intentionally crash on CallInsts");
-}
-
-namespace {
- /// DeleteCalls - This pass is used to test bugpoint. It intentionally
- /// deletes some call instructions, "misoptimizing" the program.
- class DeleteCalls : public BasicBlockPass {
- public:
- static char ID; // Pass ID, replacement for typeid
- DeleteCalls() : BasicBlockPass((intptr_t)&ID) {}
- private:
- bool runOnBasicBlock(BasicBlock &BB) {
- for (BasicBlock::iterator I = BB.begin(), E = BB.end(); I != E; ++I)
- if (CallInst *CI = dyn_cast<CallInst>(I)) {
- if (!CI->use_empty())
- CI->replaceAllUsesWith(Constant::getNullValue(CI->getType()));
- CI->getParent()->getInstList().erase(CI);
- break;
- }
- return false;
- }
- };
-
- char DeleteCalls::ID = 0;
- RegisterPass<DeleteCalls>
- Y("bugpoint-deletecalls",
- "BugPoint Test Pass - Intentionally 'misoptimize' CallInsts");
-}
diff --git a/release_23/tools/bugpoint/ToolRunner.cpp b/release_23/tools/bugpoint/ToolRunner.cpp
deleted file mode 100644
index d25ce6c306f1..000000000000
--- a/release_23/tools/bugpoint/ToolRunner.cpp
+++ /dev/null
@@ -1,730 +0,0 @@
-//===-- ToolRunner.cpp ----------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the interfaces described in the ToolRunner.h file.
-//
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "toolrunner"
-#include "ToolRunner.h"
-#include "llvm/Config/config.h" // for HAVE_LINK_R
-#include "llvm/System/Program.h"
-#include "llvm/Support/CommandLine.h"
-#include "llvm/Support/Debug.h"
-#include "llvm/Support/FileUtilities.h"
-#include <fstream>
-#include <sstream>
-#include <iostream>
-using namespace llvm;
-
-namespace {
- cl::opt<std::string>
- RSHHost("rsh-host",
- cl::desc("Remote execution (rsh) host"));
-
- cl::opt<std::string>
- RSHUser("rsh-user",
- cl::desc("Remote execution (rsh) user id"));
-}
-
-ToolExecutionError::~ToolExecutionError() throw() { }
-
-/// RunProgramWithTimeout - This function provides an alternate interface to the
-/// sys::Program::ExecuteAndWait interface.
-/// @see sys:Program::ExecuteAndWait
-static int RunProgramWithTimeout(const sys::Path &ProgramPath,
- const char **Args,
- const sys::Path &StdInFile,
- const sys::Path &StdOutFile,
- const sys::Path &StdErrFile,
- unsigned NumSeconds = 0,
- unsigned MemoryLimit = 0) {
- const sys::Path* redirects[3];
- redirects[0] = &StdInFile;
- redirects[1] = &StdOutFile;
- redirects[2] = &StdErrFile;
-
- if (0) {
- std::cerr << "RUN:";
- for (unsigned i = 0; Args[i]; ++i)
- std::cerr << " " << Args[i];
- std::cerr << "\n";
- }
-
- return
- sys::Program::ExecuteAndWait(ProgramPath, Args, 0, redirects,
- NumSeconds, MemoryLimit);
-}
-
-
-
-static void ProcessFailure(sys::Path ProgPath, const char** Args) {
- std::ostringstream OS;
- OS << "\nError running tool:\n ";
- for (const char **Arg = Args; *Arg; ++Arg)
- OS << " " << *Arg;
- OS << "\n";
-
- // Rerun the compiler, capturing any error messages to print them.
- sys::Path ErrorFilename("error_messages");
- std::string ErrMsg;
- if (ErrorFilename.makeUnique(true, &ErrMsg)) {
- std::cerr << "Error making unique filename: " << ErrMsg << "\n";
- exit(1);
- }
- RunProgramWithTimeout(ProgPath, Args, sys::Path(""), ErrorFilename,
- ErrorFilename); // FIXME: check return code ?
-
- // Print out the error messages generated by GCC if possible...
- std::ifstream ErrorFile(ErrorFilename.c_str());
- if (ErrorFile) {
- std::copy(std::istreambuf_iterator<char>(ErrorFile),
- std::istreambuf_iterator<char>(),
- std::ostreambuf_iterator<char>(OS));
- ErrorFile.close();
- }
-
- ErrorFilename.eraseFromDisk();
- throw ToolExecutionError(OS.str());
-}
-
-//===---------------------------------------------------------------------===//
-// LLI Implementation of AbstractIntepreter interface
-//
-namespace {
- class LLI : public AbstractInterpreter {
- std::string LLIPath; // The path to the LLI executable
- std::vector<std::string> ToolArgs; // Args to pass to LLI
- public:
- LLI(const std::string &Path, const std::vector<std::string> *Args)
- : LLIPath(Path) {
- ToolArgs.clear ();
- if (Args) { ToolArgs = *Args; }
- }
-
- virtual int ExecuteProgram(const std::string &Bitcode,
- const std::vector<std::string> &Args,
- const std::string &InputFile,
- const std::string &OutputFile,
- const std::vector<std::string> &GCCArgs,
- const std::vector<std::string> &SharedLibs =
- std::vector<std::string>(),
- unsigned Timeout = 0,
- unsigned MemoryLimit = 0);
- };
-}
-
-int LLI::ExecuteProgram(const std::string &Bitcode,
- const std::vector<std::string> &Args,
- const std::string &InputFile,
- const std::string &OutputFile,
- const std::vector<std::string> &GCCArgs,
- const std::vector<std::string> &SharedLibs,
- unsigned Timeout,
- unsigned MemoryLimit) {
- if (!SharedLibs.empty())
- throw ToolExecutionError("LLI currently does not support "
- "loading shared libraries.");
-
- if (!GCCArgs.empty())
- throw ToolExecutionError("LLI currently does not support "
- "GCC Arguments.");
- std::vector<const char*> LLIArgs;
- LLIArgs.push_back(LLIPath.c_str());
- LLIArgs.push_back("-force-interpreter=true");
-
- // Add any extra LLI args.
- for (unsigned i = 0, e = ToolArgs.size(); i != e; ++i)
- LLIArgs.push_back(ToolArgs[i].c_str());
-
- LLIArgs.push_back(Bitcode.c_str());
- // Add optional parameters to the running program from Argv
- for (unsigned i=0, e = Args.size(); i != e; ++i)
- LLIArgs.push_back(Args[i].c_str());
- LLIArgs.push_back(0);
-
- std::cout << "<lli>" << std::flush;
- DEBUG(std::cerr << "\nAbout to run:\t";
- for (unsigned i=0, e = LLIArgs.size()-1; i != e; ++i)
- std::cerr << " " << LLIArgs[i];
- std::cerr << "\n";
- );
- return RunProgramWithTimeout(sys::Path(LLIPath), &LLIArgs[0],
- sys::Path(InputFile), sys::Path(OutputFile), sys::Path(OutputFile),
- Timeout, MemoryLimit);
-}
-
-// LLI create method - Try to find the LLI executable
-AbstractInterpreter *AbstractInterpreter::createLLI(const std::string &ProgPath,
- std::string &Message,
- const std::vector<std::string> *ToolArgs) {
- std::string LLIPath = FindExecutable("lli", ProgPath).toString();
- if (!LLIPath.empty()) {
- Message = "Found lli: " + LLIPath + "\n";
- return new LLI(LLIPath, ToolArgs);
- }
-
- Message = "Cannot find `lli' in executable directory or PATH!\n";
- return 0;
-}
-
-//===---------------------------------------------------------------------===//
-// Custom execution command implementation of AbstractIntepreter interface
-//
-// Allows using a custom command for executing the bitcode, thus allows,
-// for example, to invoke a cross compiler for code generation followed by
-// a simulator that executes the generated binary.
-namespace {
- class CustomExecutor : public AbstractInterpreter {
- std::string ExecutionCommand;
- std::vector<std::string> ExecutorArgs;
- public:
- CustomExecutor(
- const std::string &ExecutionCmd, std::vector<std::string> ExecArgs) :
- ExecutionCommand(ExecutionCmd), ExecutorArgs(ExecArgs) {}
-
- virtual int ExecuteProgram(const std::string &Bitcode,
- const std::vector<std::string> &Args,
- const std::string &InputFile,
- const std::string &OutputFile,
- const std::vector<std::string> &GCCArgs,
- const std::vector<std::string> &SharedLibs =
- std::vector<std::string>(),
- unsigned Timeout = 0,
- unsigned MemoryLimit = 0);
- };
-}
-
-int CustomExecutor::ExecuteProgram(const std::string &Bitcode,
- const std::vector<std::string> &Args,
- const std::string &InputFile,
- const std::string &OutputFile,
- const std::vector<std::string> &GCCArgs,
- const std::vector<std::string> &SharedLibs,
- unsigned Timeout,
- unsigned MemoryLimit) {
-
- std::vector<const char*> ProgramArgs;
- ProgramArgs.push_back(ExecutionCommand.c_str());
-
- for (std::size_t i = 0; i < ExecutorArgs.size(); ++i)
- ProgramArgs.push_back(ExecutorArgs.at(i).c_str());
- ProgramArgs.push_back(Bitcode.c_str());
- ProgramArgs.push_back(0);
-
- // Add optional parameters to the running program from Argv
- for (unsigned i=0, e = Args.size(); i != e; ++i)
- ProgramArgs.push_back(Args[i].c_str());
-
- return RunProgramWithTimeout(
- sys::Path(ExecutionCommand),
- &ProgramArgs[0], sys::Path(InputFile), sys::Path(OutputFile),
- sys::Path(OutputFile), Timeout, MemoryLimit);
-}
-
-// Custom execution environment create method, takes the execution command
-// as arguments
-AbstractInterpreter *AbstractInterpreter::createCustom(
- const std::string &ProgramPath,
- std::string &Message,
- const std::string &ExecCommandLine) {
-
- std::string Command = "";
- std::vector<std::string> Args;
- std::string delimiters = " ";
-
- // Tokenize the ExecCommandLine to the command and the args to allow
- // defining a full command line as the command instead of just the
- // executed program. We cannot just pass the whole string after the command
- // as a single argument because then program sees only a single
- // command line argument (with spaces in it: "foo bar" instead
- // of "foo" and "bar").
-
- // code borrowed from:
- // http://oopweb.com/CPP/Documents/CPPHOWTO/Volume/C++Programming-HOWTO-7.html
- std::string::size_type lastPos =
- ExecCommandLine.find_first_not_of(delimiters, 0);
- std::string::size_type pos =
- ExecCommandLine.find_first_of(delimiters, lastPos);
-
- while (std::string::npos != pos || std::string::npos != lastPos) {
- std::string token = ExecCommandLine.substr(lastPos, pos - lastPos);
- if (Command == "")
- Command = token;
- else
- Args.push_back(token);
- // Skip delimiters. Note the "not_of"
- lastPos = ExecCommandLine.find_first_not_of(delimiters, pos);
- // Find next "non-delimiter"
- pos = ExecCommandLine.find_first_of(delimiters, lastPos);
- }
-
- std::string CmdPath = FindExecutable(Command, ProgramPath).toString();
- if (CmdPath.empty()) {
- Message =
- std::string("Cannot find '") + Command +
- "' in executable directory or PATH!\n";
- return 0;
- }
-
- Message = "Found command in: " + CmdPath + "\n";
-
- return new CustomExecutor(CmdPath, Args);
-}
-
-//===----------------------------------------------------------------------===//
-// LLC Implementation of AbstractIntepreter interface
-//
-GCC::FileType LLC::OutputCode(const std::string &Bitcode,
- sys::Path &OutputAsmFile) {
- sys::Path uniqueFile(Bitcode+".llc.s");
- std::string ErrMsg;
- if (uniqueFile.makeUnique(true, &ErrMsg)) {
- std::cerr << "Error making unique filename: " << ErrMsg << "\n";
- exit(1);
- }
- OutputAsmFile = uniqueFile;
- std::vector<const char *> LLCArgs;
- LLCArgs.push_back (LLCPath.c_str());
-
- // Add any extra LLC args.
- for (unsigned i = 0, e = ToolArgs.size(); i != e; ++i)
- LLCArgs.push_back(ToolArgs[i].c_str());
-
- LLCArgs.push_back ("-o");
- LLCArgs.push_back (OutputAsmFile.c_str()); // Output to the Asm file
- LLCArgs.push_back ("-f"); // Overwrite as necessary...
- LLCArgs.push_back (Bitcode.c_str()); // This is the input bitcode
- LLCArgs.push_back (0);
-
- std::cout << "<llc>" << std::flush;
- DEBUG(std::cerr << "\nAbout to run:\t";
- for (unsigned i=0, e = LLCArgs.size()-1; i != e; ++i)
- std::cerr << " " << LLCArgs[i];
- std::cerr << "\n";
- );
- if (RunProgramWithTimeout(sys::Path(LLCPath), &LLCArgs[0],
- sys::Path(), sys::Path(), sys::Path()))
- ProcessFailure(sys::Path(LLCPath), &LLCArgs[0]);
-
- return GCC::AsmFile;
-}
-
-void LLC::compileProgram(const std::string &Bitcode) {
- sys::Path OutputAsmFile;
- OutputCode(Bitcode, OutputAsmFile);
- OutputAsmFile.eraseFromDisk();
-}
-
-int LLC::ExecuteProgram(const std::string &Bitcode,
- const std::vector<std::string> &Args,
- const std::string &InputFile,
- const std::string &OutputFile,
- const std::vector<std::string> &ArgsForGCC,
- const std::vector<std::string> &SharedLibs,
- unsigned Timeout,
- unsigned MemoryLimit) {
-
- sys::Path OutputAsmFile;
- OutputCode(Bitcode, OutputAsmFile);
- FileRemover OutFileRemover(OutputAsmFile);
-
- std::vector<std::string> GCCArgs(ArgsForGCC);
- GCCArgs.insert(GCCArgs.end(),SharedLibs.begin(),SharedLibs.end());
-
- // Assuming LLC worked, compile the result with GCC and run it.
- return gcc->ExecuteProgram(OutputAsmFile.toString(), Args, GCC::AsmFile,
- InputFile, OutputFile, GCCArgs,
- Timeout, MemoryLimit);
-}
-
-/// createLLC - Try to find the LLC executable
-///
-LLC *AbstractInterpreter::createLLC(const std::string &ProgramPath,
- std::string &Message,
- const std::vector<std::string> *Args) {
- std::string LLCPath = FindExecutable("llc", ProgramPath).toString();
- if (LLCPath.empty()) {
- Message = "Cannot find `llc' in executable directory or PATH!\n";
- return 0;
- }
-
- Message = "Found llc: " + LLCPath + "\n";
- GCC *gcc = GCC::create(ProgramPath, Message);
- if (!gcc) {
- std::cerr << Message << "\n";
- exit(1);
- }
- return new LLC(LLCPath, gcc, Args);
-}
-
-//===---------------------------------------------------------------------===//
-// JIT Implementation of AbstractIntepreter interface
-//
-namespace {
- class JIT : public AbstractInterpreter {
- std::string LLIPath; // The path to the LLI executable
- std::vector<std::string> ToolArgs; // Args to pass to LLI
- public:
- JIT(const std::string &Path, const std::vector<std::string> *Args)
- : LLIPath(Path) {
- ToolArgs.clear ();
- if (Args) { ToolArgs = *Args; }
- }
-
- virtual int ExecuteProgram(const std::string &Bitcode,
- const std::vector<std::string> &Args,
- const std::string &InputFile,
- const std::string &OutputFile,
- const std::vector<std::string> &GCCArgs =
- std::vector<std::string>(),
- const std::vector<std::string> &SharedLibs =
- std::vector<std::string>(),
- unsigned Timeout =0,
- unsigned MemoryLimit =0);
- };
-}
-
-int JIT::ExecuteProgram(const std::string &Bitcode,
- const std::vector<std::string> &Args,
- const std::string &InputFile,
- const std::string &OutputFile,
- const std::vector<std::string> &GCCArgs,
- const std::vector<std::string> &SharedLibs,
- unsigned Timeout,
- unsigned MemoryLimit) {
- if (!GCCArgs.empty())
- throw ToolExecutionError("JIT does not support GCC Arguments.");
- // Construct a vector of parameters, incorporating those from the command-line
- std::vector<const char*> JITArgs;
- JITArgs.push_back(LLIPath.c_str());
- JITArgs.push_back("-force-interpreter=false");
-
- // Add any extra LLI args.
- for (unsigned i = 0, e = ToolArgs.size(); i != e; ++i)
- JITArgs.push_back(ToolArgs[i].c_str());
-
- for (unsigned i = 0, e = SharedLibs.size(); i != e; ++i) {
- JITArgs.push_back("-load");
- JITArgs.push_back(SharedLibs[i].c_str());
- }
- JITArgs.push_back(Bitcode.c_str());
- // Add optional parameters to the running program from Argv
- for (unsigned i=0, e = Args.size(); i != e; ++i)
- JITArgs.push_back(Args[i].c_str());
- JITArgs.push_back(0);
-
- std::cout << "<jit>" << std::flush;
- DEBUG(std::cerr << "\nAbout to run:\t";
- for (unsigned i=0, e = JITArgs.size()-1; i != e; ++i)
- std::cerr << " " << JITArgs[i];
- std::cerr << "\n";
- );
- DEBUG(std::cerr << "\nSending output to " << OutputFile << "\n");
- return RunProgramWithTimeout(sys::Path(LLIPath), &JITArgs[0],
- sys::Path(InputFile), sys::Path(OutputFile), sys::Path(OutputFile),
- Timeout, MemoryLimit);
-}
-
-/// createJIT - Try to find the LLI executable
-///
-AbstractInterpreter *AbstractInterpreter::createJIT(const std::string &ProgPath,
- std::string &Message, const std::vector<std::string> *Args) {
- std::string LLIPath = FindExecutable("lli", ProgPath).toString();
- if (!LLIPath.empty()) {
- Message = "Found lli: " + LLIPath + "\n";
- return new JIT(LLIPath, Args);
- }
-
- Message = "Cannot find `lli' in executable directory or PATH!\n";
- return 0;
-}
-
-GCC::FileType CBE::OutputCode(const std::string &Bitcode,
- sys::Path &OutputCFile) {
- sys::Path uniqueFile(Bitcode+".cbe.c");
- std::string ErrMsg;
- if (uniqueFile.makeUnique(true, &ErrMsg)) {
- std::cerr << "Error making unique filename: " << ErrMsg << "\n";
- exit(1);
- }
- OutputCFile = uniqueFile;
- std::vector<const char *> LLCArgs;
- LLCArgs.push_back (LLCPath.c_str());
-
- // Add any extra LLC args.
- for (unsigned i = 0, e = ToolArgs.size(); i != e; ++i)
- LLCArgs.push_back(ToolArgs[i].c_str());
-
- LLCArgs.push_back ("-o");
- LLCArgs.push_back (OutputCFile.c_str()); // Output to the C file
- LLCArgs.push_back ("-march=c"); // Output C language
- LLCArgs.push_back ("-f"); // Overwrite as necessary...
- LLCArgs.push_back (Bitcode.c_str()); // This is the input bitcode
- LLCArgs.push_back (0);
-
- std::cout << "<cbe>" << std::flush;
- DEBUG(std::cerr << "\nAbout to run:\t";
- for (unsigned i=0, e = LLCArgs.size()-1; i != e; ++i)
- std::cerr << " " << LLCArgs[i];
- std::cerr << "\n";
- );
- if (RunProgramWithTimeout(LLCPath, &LLCArgs[0], sys::Path(), sys::Path(),
- sys::Path()))
- ProcessFailure(LLCPath, &LLCArgs[0]);
- return GCC::CFile;
-}
-
-void CBE::compileProgram(const std::string &Bitcode) {
- sys::Path OutputCFile;
- OutputCode(Bitcode, OutputCFile);
- OutputCFile.eraseFromDisk();
-}
-
-int CBE::ExecuteProgram(const std::string &Bitcode,
- const std::vector<std::string> &Args,
- const std::string &InputFile,
- const std::string &OutputFile,
- const std::vector<std::string> &ArgsForGCC,
- const std::vector<std::string> &SharedLibs,
- unsigned Timeout,
- unsigned MemoryLimit) {
- sys::Path OutputCFile;
- OutputCode(Bitcode, OutputCFile);
-
- FileRemover CFileRemove(OutputCFile);
-
- std::vector<std::string> GCCArgs(ArgsForGCC);
- GCCArgs.insert(GCCArgs.end(),SharedLibs.begin(),SharedLibs.end());
- return gcc->ExecuteProgram(OutputCFile.toString(), Args, GCC::CFile,
- InputFile, OutputFile, GCCArgs,
- Timeout, MemoryLimit);
-}
-
-/// createCBE - Try to find the 'llc' executable
-///
-CBE *AbstractInterpreter::createCBE(const std::string &ProgramPath,
- std::string &Message,
- const std::vector<std::string> *Args) {
- sys::Path LLCPath = FindExecutable("llc", ProgramPath);
- if (LLCPath.isEmpty()) {
- Message =
- "Cannot find `llc' in executable directory or PATH!\n";
- return 0;
- }
-
- Message = "Found llc: " + LLCPath.toString() + "\n";
- GCC *gcc = GCC::create(ProgramPath, Message);
- if (!gcc) {
- std::cerr << Message << "\n";
- exit(1);
- }
- return new CBE(LLCPath, gcc, Args);
-}
-
-//===---------------------------------------------------------------------===//
-// GCC abstraction
-//
-int GCC::ExecuteProgram(const std::string &ProgramFile,
- const std::vector<std::string> &Args,
- FileType fileType,
- const std::string &InputFile,
- const std::string &OutputFile,
- const std::vector<std::string> &ArgsForGCC,
- unsigned Timeout,
- unsigned MemoryLimit) {
- std::vector<const char*> GCCArgs;
-
- GCCArgs.push_back(GCCPath.c_str());
-
- // Specify -x explicitly in case the extension is wonky
- GCCArgs.push_back("-x");
- if (fileType == CFile) {
- GCCArgs.push_back("c");
- GCCArgs.push_back("-fno-strict-aliasing");
- } else {
- GCCArgs.push_back("assembler");
-#ifdef __APPLE__
- GCCArgs.push_back("-force_cpusubtype_ALL");
-#endif
- }
- GCCArgs.push_back(ProgramFile.c_str()); // Specify the input filename...
- GCCArgs.push_back("-x");
- GCCArgs.push_back("none");
- GCCArgs.push_back("-o");
- sys::Path OutputBinary (ProgramFile+".gcc.exe");
- std::string ErrMsg;
- if (OutputBinary.makeUnique(true, &ErrMsg)) {
- std::cerr << "Error making unique filename: " << ErrMsg << "\n";
- exit(1);
- }
- GCCArgs.push_back(OutputBinary.c_str()); // Output to the right file...
-
- // Add any arguments intended for GCC. We locate them here because this is
- // most likely -L and -l options that need to come before other libraries but
- // after the source. Other options won't be sensitive to placement on the
- // command line, so this should be safe.
- for (unsigned i = 0, e = ArgsForGCC.size(); i != e; ++i)
- GCCArgs.push_back(ArgsForGCC[i].c_str());
-
- GCCArgs.push_back("-lm"); // Hard-code the math library...
- GCCArgs.push_back("-O2"); // Optimize the program a bit...
-#if defined (HAVE_LINK_R)
- GCCArgs.push_back("-Wl,-R."); // Search this dir for .so files
-#endif
-#ifdef __sparc__
- GCCArgs.push_back("-mcpu=v9");
-#endif
- GCCArgs.push_back(0); // NULL terminator
-
- std::cout << "<gcc>" << std::flush;
- DEBUG(std::cerr << "\nAbout to run:\t";
- for (unsigned i=0, e = GCCArgs.size()-1; i != e; ++i)
- std::cerr << " " << GCCArgs[i];
- std::cerr << "\n";
- );
- if (RunProgramWithTimeout(GCCPath, &GCCArgs[0], sys::Path(), sys::Path(),
- sys::Path())) {
- ProcessFailure(GCCPath, &GCCArgs[0]);
- exit(1);
- }
-
- std::vector<const char*> ProgramArgs;
-
- if (RSHPath.isEmpty())
- ProgramArgs.push_back(OutputBinary.c_str());
- else {
- ProgramArgs.push_back(RSHPath.c_str());
- ProgramArgs.push_back(RSHHost.c_str());
- ProgramArgs.push_back("-l");
- ProgramArgs.push_back(RSHUser.c_str());
-
- char* env_pwd = getenv("PWD");
- std::string Exec = "cd ";
- Exec += env_pwd;
- Exec += "; ./";
- Exec += OutputBinary.c_str();
- ProgramArgs.push_back(Exec.c_str());
- }
-
- // Add optional parameters to the running program from Argv
- for (unsigned i=0, e = Args.size(); i != e; ++i)
- ProgramArgs.push_back(Args[i].c_str());
- ProgramArgs.push_back(0); // NULL terminator
-
- // Now that we have a binary, run it!
- std::cout << "<program>" << std::flush;
- DEBUG(std::cerr << "\nAbout to run:\t";
- for (unsigned i=0, e = ProgramArgs.size()-1; i != e; ++i)
- std::cerr << " " << ProgramArgs[i];
- std::cerr << "\n";
- );
-
- FileRemover OutputBinaryRemover(OutputBinary);
-
- if (RSHPath.isEmpty())
- return RunProgramWithTimeout(OutputBinary, &ProgramArgs[0],
- sys::Path(InputFile), sys::Path(OutputFile), sys::Path(OutputFile),
- Timeout, MemoryLimit);
- else
- return RunProgramWithTimeout(sys::Path(RSHPath), &ProgramArgs[0],
- sys::Path(InputFile), sys::Path(OutputFile), sys::Path(OutputFile),
- Timeout, MemoryLimit);
-}
-
-int GCC::MakeSharedObject(const std::string &InputFile, FileType fileType,
- std::string &OutputFile,
- const std::vector<std::string> &ArgsForGCC) {
- sys::Path uniqueFilename(InputFile+LTDL_SHLIB_EXT);
- std::string ErrMsg;
- if (uniqueFilename.makeUnique(true, &ErrMsg)) {
- std::cerr << "Error making unique filename: " << ErrMsg << "\n";
- exit(1);
- }
- OutputFile = uniqueFilename.toString();
-
- std::vector<const char*> GCCArgs;
-
- GCCArgs.push_back(GCCPath.c_str());
-
-
- // Compile the C/asm file into a shared object
- GCCArgs.push_back("-x");
- GCCArgs.push_back(fileType == AsmFile ? "assembler" : "c");
- GCCArgs.push_back("-fno-strict-aliasing");
- GCCArgs.push_back(InputFile.c_str()); // Specify the input filename.
- GCCArgs.push_back("-x");
- GCCArgs.push_back("none");
-#if defined(sparc) || defined(__sparc__) || defined(__sparcv9)
- GCCArgs.push_back("-G"); // Compile a shared library, `-G' for Sparc
-#elif defined(__APPLE__)
- // link all source files into a single module in data segment, rather than
- // generating blocks. dynamic_lookup requires that you set
- // MACOSX_DEPLOYMENT_TARGET=10.3 in your env. FIXME: it would be better for
- // bugpoint to just pass that in the environment of GCC.
- GCCArgs.push_back("-single_module");
- GCCArgs.push_back("-dynamiclib"); // `-dynamiclib' for MacOS X/PowerPC
- GCCArgs.push_back("-undefined");
- GCCArgs.push_back("dynamic_lookup");
-#else
- GCCArgs.push_back("-shared"); // `-shared' for Linux/X86, maybe others
-#endif
-
-#if defined(__ia64__) || defined(__alpha__) || defined(__amd64__)
- GCCArgs.push_back("-fPIC"); // Requires shared objs to contain PIC
-#endif
-#ifdef __sparc__
- GCCArgs.push_back("-mcpu=v9");
-#endif
- GCCArgs.push_back("-o");
- GCCArgs.push_back(OutputFile.c_str()); // Output to the right filename.
- GCCArgs.push_back("-O2"); // Optimize the program a bit.
-
-
-
- // Add any arguments intended for GCC. We locate them here because this is
- // most likely -L and -l options that need to come before other libraries but
- // after the source. Other options won't be sensitive to placement on the
- // command line, so this should be safe.
- for (unsigned i = 0, e = ArgsForGCC.size(); i != e; ++i)
- GCCArgs.push_back(ArgsForGCC[i].c_str());
- GCCArgs.push_back(0); // NULL terminator
-
-
-
- std::cout << "<gcc>" << std::flush;
- DEBUG(std::cerr << "\nAbout to run:\t";
- for (unsigned i=0, e = GCCArgs.size()-1; i != e; ++i)
- std::cerr << " " << GCCArgs[i];
- std::cerr << "\n";
- );
- if (RunProgramWithTimeout(GCCPath, &GCCArgs[0], sys::Path(), sys::Path(),
- sys::Path())) {
- ProcessFailure(GCCPath, &GCCArgs[0]);
- return 1;
- }
- return 0;
-}
-
-/// create - Try to find the `gcc' executable
-///
-GCC *GCC::create(const std::string &ProgramPath, std::string &Message) {
- sys::Path GCCPath = FindExecutable("gcc", ProgramPath);
- if (GCCPath.isEmpty()) {
- Message = "Cannot find `gcc' in executable directory or PATH!\n";
- return 0;
- }
-
- sys::Path RSHPath;
- if (!RSHHost.empty())
- RSHPath = FindExecutable("rsh", ProgramPath);
-
- Message = "Found gcc: " + GCCPath.toString() + "\n";
- return new GCC(GCCPath, RSHPath);
-}
diff --git a/release_23/tools/bugpoint/ToolRunner.h b/release_23/tools/bugpoint/ToolRunner.h
deleted file mode 100644
index 0cc5426b083f..000000000000
--- a/release_23/tools/bugpoint/ToolRunner.h
+++ /dev/null
@@ -1,218 +0,0 @@
-//===-- tools/bugpoint/ToolRunner.h -----------------------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file exposes an abstraction around a platform C compiler, used to
-// compile C and assembly code. It also exposes an "AbstractIntepreter"
-// interface, which is used to execute code using one of the LLVM execution
-// engines.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef BUGPOINT_TOOLRUNNER_H
-#define BUGPOINT_TOOLRUNNER_H
-
-#include "llvm/Support/SystemUtils.h"
-#include <exception>
-#include <vector>
-
-namespace llvm {
-
-class CBE;
-class LLC;
-
-/// ToolExecutionError - An instance of this class is thrown by the
-/// AbstractInterpreter instances if there is an error running a tool (e.g., LLC
-/// crashes) which prevents execution of the program.
-///
-class ToolExecutionError : std::exception {
- std::string Message;
-public:
- explicit ToolExecutionError(const std::string &M) : Message(M) {}
- virtual ~ToolExecutionError() throw();
- virtual const char* what() const throw() { return Message.c_str(); }
-};
-
-
-//===---------------------------------------------------------------------===//
-// GCC abstraction
-//
-class GCC {
- sys::Path GCCPath; // The path to the gcc executable
- sys::Path RSHPath; // The path to the rsh executable
- GCC(const sys::Path &gccPath, const sys::Path &rshPath)
- : GCCPath(gccPath), RSHPath(rshPath) { }
-public:
- enum FileType { AsmFile, CFile };
-
- static GCC *create(const std::string &ProgramPath, std::string &Message);
-
- /// ExecuteProgram - Execute the program specified by "ProgramFile" (which is
- /// either a .s file, or a .c file, specified by FileType), with the specified
- /// arguments. Standard input is specified with InputFile, and standard
- /// Output is captured to the specified OutputFile location. The SharedLibs
- /// option specifies optional native shared objects that can be loaded into
- /// the program for execution.
- ///
- int ExecuteProgram(const std::string &ProgramFile,
- const std::vector<std::string> &Args,
- FileType fileType,
- const std::string &InputFile,
- const std::string &OutputFile,
- const std::vector<std::string> &GCCArgs =
- std::vector<std::string>(),
- unsigned Timeout = 0,
- unsigned MemoryLimit = 0);
-
- /// MakeSharedObject - This compiles the specified file (which is either a .c
- /// file or a .s file) into a shared object.
- ///
- int MakeSharedObject(const std::string &InputFile, FileType fileType,
- std::string &OutputFile,
- const std::vector<std::string> &ArgsForGCC);
-};
-
-
-//===---------------------------------------------------------------------===//
-/// AbstractInterpreter Class - Subclasses of this class are used to execute
-/// LLVM bitcode in a variety of ways. This abstract interface hides this
-/// complexity behind a simple interface.
-///
-class AbstractInterpreter {
-public:
- static CBE *createCBE(const std::string &ProgramPath, std::string &Message,
- const std::vector<std::string> *Args = 0);
- static LLC *createLLC(const std::string &ProgramPath, std::string &Message,
- const std::vector<std::string> *Args = 0);
-
- static AbstractInterpreter* createLLI(const std::string &ProgramPath,
- std::string &Message,
- const std::vector<std::string> *Args=0);
-
- static AbstractInterpreter* createJIT(const std::string &ProgramPath,
- std::string &Message,
- const std::vector<std::string> *Args=0);
-
- static AbstractInterpreter* createCustom(const std::string &ProgramPath,
- std::string &Message,
- const std::string &ExecCommandLine);
-
-
- virtual ~AbstractInterpreter() {}
-
- /// compileProgram - Compile the specified program from bitcode to executable
- /// code. This does not produce any output, it is only used when debugging
- /// the code generator. If the code generator fails, an exception should be
- /// thrown, otherwise, this function will just return.
- virtual void compileProgram(const std::string &Bitcode) {}
-
- /// OutputCode - Compile the specified program from bitcode to code
- /// understood by the GCC driver (either C or asm). If the code generator
- /// fails, an exception should be thrown, otherwise, this function returns the
- /// type of code emitted.
- virtual GCC::FileType OutputCode(const std::string &Bitcode,
- sys::Path &OutFile) {
- throw std::string("OutputCode not supported by this AbstractInterpreter!");
- }
-
- /// ExecuteProgram - Run the specified bitcode file, emitting output to the
- /// specified filename. This returns the exit code of the program.
- ///
- virtual int ExecuteProgram(const std::string &Bitcode,
- const std::vector<std::string> &Args,
- const std::string &InputFile,
- const std::string &OutputFile,
- const std::vector<std::string> &GCCArgs =
- std::vector<std::string>(),
- const std::vector<std::string> &SharedLibs =
- std::vector<std::string>(),
- unsigned Timeout = 0,
- unsigned MemoryLimit = 0) = 0;
-};
-
-//===---------------------------------------------------------------------===//
-// CBE Implementation of AbstractIntepreter interface
-//
-class CBE : public AbstractInterpreter {
- sys::Path LLCPath; // The path to the `llc' executable
- std::vector<std::string> ToolArgs; // Extra args to pass to LLC
- GCC *gcc;
-public:
- CBE(const sys::Path &llcPath, GCC *Gcc,
- const std::vector<std::string> *Args) : LLCPath(llcPath), gcc(Gcc) {
- ToolArgs.clear ();
- if (Args) { ToolArgs = *Args; }
- }
- ~CBE() { delete gcc; }
-
- /// compileProgram - Compile the specified program from bitcode to executable
- /// code. This does not produce any output, it is only used when debugging
- /// the code generator. If the code generator fails, an exception should be
- /// thrown, otherwise, this function will just return.
- virtual void compileProgram(const std::string &Bitcode);
-
- virtual int ExecuteProgram(const std::string &Bitcode,
- const std::vector<std::string> &Args,
- const std::string &InputFile,
- const std::string &OutputFile,
- const std::vector<std::string> &GCCArgs =
- std::vector<std::string>(),
- const std::vector<std::string> &SharedLibs =
- std::vector<std::string>(),
- unsigned Timeout = 0,
- unsigned MemoryLimit = 0);
-
- /// OutputCode - Compile the specified program from bitcode to code
- /// understood by the GCC driver (either C or asm). If the code generator
- /// fails, an exception should be thrown, otherwise, this function returns the
- /// type of code emitted.
- virtual GCC::FileType OutputCode(const std::string &Bitcode,
- sys::Path &OutFile);
-};
-
-
-//===---------------------------------------------------------------------===//
-// LLC Implementation of AbstractIntepreter interface
-//
-class LLC : public AbstractInterpreter {
- std::string LLCPath; // The path to the LLC executable
- std::vector<std::string> ToolArgs; // Extra args to pass to LLC
- GCC *gcc;
-public:
- LLC(const std::string &llcPath, GCC *Gcc,
- const std::vector<std::string> *Args) : LLCPath(llcPath), gcc(Gcc) {
- ToolArgs.clear ();
- if (Args) { ToolArgs = *Args; }
- }
- ~LLC() { delete gcc; }
-
- /// compileProgram - Compile the specified program from bitcode to executable
- /// code. This does not produce any output, it is only used when debugging
- /// the code generator. If the code generator fails, an exception should be
- /// thrown, otherwise, this function will just return.
- virtual void compileProgram(const std::string &Bitcode);
-
- virtual int ExecuteProgram(const std::string &Bitcode,
- const std::vector<std::string> &Args,
- const std::string &InputFile,
- const std::string &OutputFile,
- const std::vector<std::string> &GCCArgs =
- std::vector<std::string>(),
- const std::vector<std::string> &SharedLibs =
- std::vector<std::string>(),
- unsigned Timeout = 0,
- unsigned MemoryLimit = 0);
-
- virtual GCC::FileType OutputCode(const std::string &Bitcode,
- sys::Path &OutFile);
-
-};
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/tools/bugpoint/bugpoint.cpp b/release_23/tools/bugpoint/bugpoint.cpp
deleted file mode 100644
index 236467550407..000000000000
--- a/release_23/tools/bugpoint/bugpoint.cpp
+++ /dev/null
@@ -1,94 +0,0 @@
-//===- bugpoint.cpp - The LLVM Bugpoint utility ---------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This program is an automated compiler debugger tool. It is used to narrow
-// down miscompilations and crash problems to a specific pass in the compiler,
-// and the specific Module or Function input that is causing the problem.
-//
-//===----------------------------------------------------------------------===//
-
-#include "BugDriver.h"
-#include "ToolRunner.h"
-#include "llvm/LinkAllPasses.h"
-#include "llvm/Support/PassNameParser.h"
-#include "llvm/Support/CommandLine.h"
-#include "llvm/Support/ManagedStatic.h"
-#include "llvm/Support/PluginLoader.h"
-#include "llvm/System/Process.h"
-#include "llvm/System/Signals.h"
-#include "llvm/LinkAllVMCore.h"
-#include <iostream>
-using namespace llvm;
-
-// AsChild - Specifies that this invocation of bugpoint is being generated
-// from a parent process. It is not intended to be used by users so the
-// option is hidden.
-static cl::opt<bool>
-AsChild("as-child", cl::desc("Run bugpoint as child process"),
- cl::ReallyHidden);
-
-static cl::opt<bool>
-FindBugs("find-bugs", cl::desc("Run many different optimization sequences "
- "on program to find bugs"), cl::init(false));
-
-static cl::list<std::string>
-InputFilenames(cl::Positional, cl::OneOrMore,
- cl::desc("<input llvm ll/bc files>"));
-
-static cl::opt<unsigned>
-TimeoutValue("timeout", cl::init(300), cl::value_desc("seconds"),
- cl::desc("Number of seconds program is allowed to run before it "
- "is killed (default is 300s), 0 disables timeout"));
-
-static cl::opt<unsigned>
-MemoryLimit("mlimit", cl::init(100), cl::value_desc("MBytes"),
- cl::desc("Maximum amount of memory to use. 0 disables check."));
-
-// The AnalysesList is automatically populated with registered Passes by the
-// PassNameParser.
-//
-static cl::list<const PassInfo*, bool, PassNameParser>
-PassList(cl::desc("Passes available:"), cl::ZeroOrMore);
-
-/// BugpointIsInterrupted - Set to true when the user presses ctrl-c.
-bool llvm::BugpointIsInterrupted = false;
-
-static void BugpointInterruptFunction() {
- BugpointIsInterrupted = true;
-}
-
-int main(int argc, char **argv) {
- llvm_shutdown_obj X; // Call llvm_shutdown() on exit.
- cl::ParseCommandLineOptions(argc, argv,
- "LLVM automatic testcase reducer. See\nhttp://"
- "llvm.org/docs/CommandGuide/bugpoint.html"
- " for more information.\n");
- sys::PrintStackTraceOnErrorSignal();
- sys::SetInterruptFunction(BugpointInterruptFunction);
-
- BugDriver D(argv[0], AsChild, FindBugs, TimeoutValue, MemoryLimit);
- if (D.addSources(InputFilenames)) return 1;
- D.addPasses(PassList.begin(), PassList.end());
-
- // Bugpoint has the ability of generating a plethora of core files, so to
- // avoid filling up the disk, we prevent it
- sys::Process::PreventCoreFiles();
-
- try {
- return D.run();
- } catch (ToolExecutionError &TEE) {
- std::cerr << "Tool execution error: " << TEE.what() << '\n';
- } catch (const std::string& msg) {
- std::cerr << argv[0] << ": " << msg << "\n";
- } catch (...) {
- std::cerr << "Whoops, an exception leaked out of bugpoint. "
- << "This is a bug in bugpoint!\n";
- }
- return 1;
-}
diff --git a/release_23/tools/gccas/Makefile b/release_23/tools/gccas/Makefile
deleted file mode 100644
index ff84d967798e..000000000000
--- a/release_23/tools/gccas/Makefile
+++ /dev/null
@@ -1,28 +0,0 @@
-##===- tools/gccas/Makefile --------------------------------*- Makefile -*-===##
-#
-# The LLVM Compiler Infrastructure
-#
-# This file is distributed under the University of Illinois Open Source
-# License. See LICENSE.TXT for details.
-#
-##===----------------------------------------------------------------------===##
-LEVEL = ../..
-
-include $(LEVEL)/Makefile.common
-
-install-local:: $(PROJ_bindir)/gccas
-
-$(PROJ_bindir)/gccas : gccas.sh Makefile
- $(Echo) Installing gccas shell script.
- $(Verb) sed "s#@TOOLDIR@#$(PROJ_bindir)#" $< > $@
- $(Verb) chmod 0755 $@
-
-all-local:: $(ToolDir)/gccas
-
-$(ToolDir)/gccas : gccas.sh Makefile
- $(Echo) Making $(ToolDir)/gccas shell script.
- $(Verb) sed "s#@TOOLDIR@#$(ToolDir)#" $< > $@
- $(Verb) chmod 0755 $@
-
-clean-local::
- $(Verb)$(RM) -f $(ToolDir)/gccas
diff --git a/release_23/tools/gccas/gccas.sh b/release_23/tools/gccas/gccas.sh
deleted file mode 100644
index 9cacad4b675f..000000000000
--- a/release_23/tools/gccas/gccas.sh
+++ /dev/null
@@ -1,64 +0,0 @@
-#!/bin/sh
-##===- tools/gccas.sh ------------------------------------------*- bash -*-===##
-#
-# The LLVM Compiler Infrastructure
-#
-# This file is distributed under the University of Illinois Open Source
-# License. See LICENSE.TXT for details.
-#
-##===----------------------------------------------------------------------===##
-#
-# Synopsis: This shell script is a replacement for the old "gccas" tool that
-# existed in LLVM versions before 2.0. The functionality of gccas has
-# now been moved to opt and llvm-as. This shell script provides
-# backwards compatibility so build environments invoking gccas can
-# still get the net effect of llvm-as/opt by running gccas.
-#
-# Syntax: gccas OPTIONS... [asm file]
-#
-##===----------------------------------------------------------------------===##
-#
-echo "gccas: This tool is deprecated, please use opt" 1>&2
-TOOLDIR=@TOOLDIR@
-OPTOPTS="-std-compile-opts -f"
-ASOPTS=""
-lastwasdasho=0
-for option in "$@" ; do
- option=`echo "$option" | sed 's/^--/-/'`
- case "$option" in
- -disable-opt)
- OPTOPTS="$OPTOPTS $option"
- ;;
- -disable-inlining)
- OPTOPTS="$OPTOPTS $option"
- ;;
- -verify)
- OPTOPTS="$OPTOPTS -verify-each"
- ;;
- -strip-debug)
- OPTOPTS="$OPTOPTS $option"
- ;;
- -o)
- OPTOPTS="$OPTOPTS -o"
- lastwasdasho=1
- ;;
- -disable-compression)
- # ignore
- ;;
- -traditional-format)
- # ignore
- ;;
- -*)
- OPTOPTS="$OPTOPTS $option"
- ;;
- *)
- if test $lastwasdasho -eq 1 ; then
- OPTOPTS="$OPTOPTS $option"
- lastwasdasho=0
- else
- ASOPTS="$ASOPTS $option"
- fi
- ;;
- esac
-done
-${TOOLDIR}/llvm-as $ASOPTS -o - | ${TOOLDIR}/opt $OPTOPTS
diff --git a/release_23/tools/gccld/Makefile b/release_23/tools/gccld/Makefile
deleted file mode 100644
index b2d3f734356d..000000000000
--- a/release_23/tools/gccld/Makefile
+++ /dev/null
@@ -1,29 +0,0 @@
-##===- tools/gccld/Makefile --------------------------------*- Makefile -*-===##
-#
-# The LLVM Compiler Infrastructure
-#
-# This file is distributed under the University of Illinois Open Source
-# License. See LICENSE.TXT for details.
-#
-##===----------------------------------------------------------------------===##
-
-LEVEL = ../..
-
-include $(LEVEL)/Makefile.common
-
-install-local:: $(PROJ_bindir)/gccld
-
-$(PROJ_bindir)/gccld : gccld.sh Makefile
- $(Echo) Installing gccld shell script.
- $(Verb) sed "s#@TOOLDIR@#$(PROJ_bindir)#" $< > $@
- $(Verb) chmod 0755 $@
-
-all-local:: $(ToolDir)/gccld
-
-$(ToolDir)/gccld : gccld.sh Makefile
- $(Echo) Making $(ToolDir)/gccld shell script.
- $(Verb) sed "s#@TOOLDIR@#$(ToolDir)#" $< > $@
- $(Verb) chmod 0755 $@
-
-clean-local::
- $(Verb)$(RM) -f $(ToolDir)/gccld
diff --git a/release_23/tools/gccld/gccld.sh b/release_23/tools/gccld/gccld.sh
deleted file mode 100644
index b092607c7270..000000000000
--- a/release_23/tools/gccld/gccld.sh
+++ /dev/null
@@ -1,23 +0,0 @@
-#!/bin/sh
-##===- tools/gccld/gccld.sh ------------------------------------*- bash -*-===##
-#
-# The LLVM Compiler Infrastructure
-#
-# This file is distributed under the University of Illinois Open Source
-# License. See LICENSE.TXT for details.
-#
-##===----------------------------------------------------------------------===##
-#
-# Synopsis: This shell script is a replacement for the old "gccld" tool that
-# existed in LLVM versions before 2.0. The functionality of gccld has
-# now been moved to llvm-ld. This shell script provides backwards
-# compatibility so build environments invoking gccld can still get
-# link (under the covers) with llvm-ld.
-#
-# Syntax: gccld OPTIONS... (see llvm-ld for details)
-#
-##===----------------------------------------------------------------------===##
-#
-echo "gccld: This tool is deprecated, please use llvm-ld" 1>&2
-TOOLDIR=@TOOLDIR@
-$TOOLDIR/llvm-ld "$@"
diff --git a/release_23/tools/llc/Makefile b/release_23/tools/llc/Makefile
deleted file mode 100644
index 8514040cf271..000000000000
--- a/release_23/tools/llc/Makefile
+++ /dev/null
@@ -1,21 +0,0 @@
-#===- tools/llc/Makefile -----------------------------------*- Makefile -*-===##
-#
-# The LLVM Compiler Infrastructure
-#
-# This file is distributed under the University of Illinois Open Source
-# License. See LICENSE.TXT for details.
-#
-##===----------------------------------------------------------------------===##
-
-LEVEL = ../..
-TOOLNAME = llc
-
-# Include this here so we can get the configuration of the targets
-# that have been configured for construction. We have to do this
-# early so we can set up LINK_COMPONENTS before including Makefile.rules
-include $(LEVEL)/Makefile.config
-
-LINK_COMPONENTS := $(TARGETS_TO_BUILD) bitreader
-
-include $(LLVM_SRC_ROOT)/Makefile.rules
-
diff --git a/release_23/tools/llc/llc.cpp b/release_23/tools/llc/llc.cpp
deleted file mode 100644
index d179efc03831..000000000000
--- a/release_23/tools/llc/llc.cpp
+++ /dev/null
@@ -1,311 +0,0 @@
-//===-- llc.cpp - Implement the LLVM Native Code Generator ----------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This is the llc code generator driver. It provides a convenient
-// command-line interface for generating native assembly-language code
-// or C code, given LLVM bitcode.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Bitcode/ReaderWriter.h"
-#include "llvm/CodeGen/FileWriters.h"
-#include "llvm/CodeGen/LinkAllCodegenComponents.h"
-#include "llvm/Target/SubtargetFeature.h"
-#include "llvm/Target/TargetData.h"
-#include "llvm/Target/TargetMachine.h"
-#include "llvm/Target/TargetMachineRegistry.h"
-#include "llvm/Transforms/Scalar.h"
-#include "llvm/Module.h"
-#include "llvm/ModuleProvider.h"
-#include "llvm/PassManager.h"
-#include "llvm/Pass.h"
-#include "llvm/Support/CommandLine.h"
-#include "llvm/Support/ManagedStatic.h"
-#include "llvm/Support/MemoryBuffer.h"
-#include "llvm/Support/PluginLoader.h"
-#include "llvm/Support/FileUtilities.h"
-#include "llvm/Analysis/Verifier.h"
-#include "llvm/System/Signals.h"
-#include "llvm/Config/config.h"
-#include "llvm/LinkAllVMCore.h"
-#include <fstream>
-#include <iostream>
-#include <memory>
-using namespace llvm;
-
-// General options for llc. Other pass-specific options are specified
-// within the corresponding llc passes, and target-specific options
-// and back-end code generation options are specified with the target machine.
-//
-static cl::opt<std::string>
-InputFilename(cl::Positional, cl::desc("<input bitcode>"), cl::init("-"));
-
-static cl::opt<std::string>
-OutputFilename("o", cl::desc("Output filename"), cl::value_desc("filename"));
-
-static cl::opt<bool> Force("f", cl::desc("Overwrite output files"));
-
-static cl::opt<bool> Fast("fast",
- cl::desc("Generate code quickly, potentially sacrificing code quality"));
-
-static cl::opt<std::string>
-TargetTriple("mtriple", cl::desc("Override target triple for module"));
-
-static cl::opt<const TargetMachineRegistry::entry*, false,
- TargetMachineRegistry::Parser>
-MArch("march", cl::desc("Architecture to generate code for:"));
-
-static cl::opt<std::string>
-MCPU("mcpu",
- cl::desc("Target a specific cpu type (-mcpu=help for details)"),
- cl::value_desc("cpu-name"),
- cl::init(""));
-
-static cl::list<std::string>
-MAttrs("mattr",
- cl::CommaSeparated,
- cl::desc("Target specific attributes (-mattr=help for details)"),
- cl::value_desc("a1,+a2,-a3,..."));
-
-cl::opt<TargetMachine::CodeGenFileType>
-FileType("filetype", cl::init(TargetMachine::AssemblyFile),
- cl::desc("Choose a file type (not all types are supported by all targets):"),
- cl::values(
- clEnumValN(TargetMachine::AssemblyFile, "asm",
- " Emit an assembly ('.s') file"),
- clEnumValN(TargetMachine::ObjectFile, "obj",
- " Emit a native object ('.o') file [experimental]"),
- clEnumValN(TargetMachine::DynamicLibrary, "dynlib",
- " Emit a native dynamic library ('.so') file"
- " [experimental]"),
- clEnumValEnd));
-
-cl::opt<bool> NoVerify("disable-verify", cl::Hidden,
- cl::desc("Do not verify input module"));
-
-
-// GetFileNameRoot - Helper function to get the basename of a filename.
-static inline std::string
-GetFileNameRoot(const std::string &InputFilename) {
- std::string IFN = InputFilename;
- std::string outputFilename;
- int Len = IFN.length();
- if ((Len > 2) &&
- IFN[Len-3] == '.' && IFN[Len-2] == 'b' && IFN[Len-1] == 'c') {
- outputFilename = std::string(IFN.begin(), IFN.end()-3); // s/.bc/.s/
- } else {
- outputFilename = IFN;
- }
- return outputFilename;
-}
-
-static std::ostream *GetOutputStream(const char *ProgName) {
- if (OutputFilename != "") {
- if (OutputFilename == "-")
- return &std::cout;
-
- // Specified an output filename?
- if (!Force && std::ifstream(OutputFilename.c_str())) {
- // If force is not specified, make sure not to overwrite a file!
- std::cerr << ProgName << ": error opening '" << OutputFilename
- << "': file exists!\n"
- << "Use -f command line argument to force output\n";
- return 0;
- }
- // Make sure that the Out file gets unlinked from the disk if we get a
- // SIGINT
- sys::RemoveFileOnSignal(sys::Path(OutputFilename));
-
- return new std::ofstream(OutputFilename.c_str());
- }
-
- if (InputFilename == "-") {
- OutputFilename = "-";
- return &std::cout;
- }
-
- OutputFilename = GetFileNameRoot(InputFilename);
-
- switch (FileType) {
- case TargetMachine::AssemblyFile:
- if (MArch->Name[0] == 'c') {
- if (MArch->Name[1] == 0)
- OutputFilename += ".cbe.c";
- else if (MArch->Name[1] == 'p' && MArch->Name[2] == 'p')
- OutputFilename += ".cpp";
- else
- OutputFilename += ".s";
- } else
- OutputFilename += ".s";
- break;
- case TargetMachine::ObjectFile:
- OutputFilename += ".o";
- break;
- case TargetMachine::DynamicLibrary:
- OutputFilename += LTDL_SHLIB_EXT;
- break;
- }
-
- if (!Force && std::ifstream(OutputFilename.c_str())) {
- // If force is not specified, make sure not to overwrite a file!
- std::cerr << ProgName << ": error opening '" << OutputFilename
- << "': file exists!\n"
- << "Use -f command line argument to force output\n";
- return 0;
- }
-
- // Make sure that the Out file gets unlinked from the disk if we get a
- // SIGINT
- sys::RemoveFileOnSignal(sys::Path(OutputFilename));
-
- std::ostream *Out = new std::ofstream(OutputFilename.c_str());
- if (!Out->good()) {
- std::cerr << ProgName << ": error opening " << OutputFilename << "!\n";
- delete Out;
- return 0;
- }
-
- return Out;
-}
-
-// main - Entry point for the llc compiler.
-//
-int main(int argc, char **argv) {
- llvm_shutdown_obj X; // Call llvm_shutdown() on exit.
- cl::ParseCommandLineOptions(argc, argv, "llvm system compiler\n");
- sys::PrintStackTraceOnErrorSignal();
-
- // Load the module to be compiled...
- std::string ErrorMessage;
- std::auto_ptr<Module> M;
-
- std::auto_ptr<MemoryBuffer> Buffer(
- MemoryBuffer::getFileOrSTDIN(InputFilename, &ErrorMessage));
- if (Buffer.get())
- M.reset(ParseBitcodeFile(Buffer.get(), &ErrorMessage));
- if (M.get() == 0) {
- std::cerr << argv[0] << ": bitcode didn't read correctly.\n";
- std::cerr << "Reason: " << ErrorMessage << "\n";
- return 1;
- }
- Module &mod = *M.get();
-
- // If we are supposed to override the target triple, do so now.
- if (!TargetTriple.empty())
- mod.setTargetTriple(TargetTriple);
-
- // Allocate target machine. First, check whether the user has
- // explicitly specified an architecture to compile for.
- if (MArch == 0) {
- std::string Err;
- MArch = TargetMachineRegistry::getClosestStaticTargetForModule(mod, Err);
- if (MArch == 0) {
- std::cerr << argv[0] << ": error auto-selecting target for module '"
- << Err << "'. Please use the -march option to explicitly "
- << "pick a target.\n";
- return 1;
- }
- }
-
- // Package up features to be passed to target/subtarget
- std::string FeaturesStr;
- if (MCPU.size() || MAttrs.size()) {
- SubtargetFeatures Features;
- Features.setCPU(MCPU);
- for (unsigned i = 0; i != MAttrs.size(); ++i)
- Features.AddFeature(MAttrs[i]);
- FeaturesStr = Features.getString();
- }
-
- std::auto_ptr<TargetMachine> target(MArch->CtorFn(mod, FeaturesStr));
- assert(target.get() && "Could not allocate target machine!");
- TargetMachine &Target = *target.get();
-
- // Figure out where we are going to send the output...
- std::ostream *Out = GetOutputStream(argv[0]);
- if (Out == 0) return 1;
-
- // If this target requires addPassesToEmitWholeFile, do it now. This is
- // used by strange things like the C backend.
- if (Target.WantsWholeFile()) {
- PassManager PM;
- PM.add(new TargetData(*Target.getTargetData()));
- if (!NoVerify)
- PM.add(createVerifierPass());
-
- // Ask the target to add backend passes as necessary.
- if (Target.addPassesToEmitWholeFile(PM, *Out, FileType, Fast)) {
- std::cerr << argv[0] << ": target does not support generation of this"
- << " file type!\n";
- if (Out != &std::cout) delete Out;
- // And the Out file is empty and useless, so remove it now.
- sys::Path(OutputFilename).eraseFromDisk();
- return 1;
- }
- PM.run(mod);
- } else {
- // Build up all of the passes that we want to do to the module.
- ExistingModuleProvider Provider(M.release());
- FunctionPassManager Passes(&Provider);
- Passes.add(new TargetData(*Target.getTargetData()));
-
-#ifndef NDEBUG
- if (!NoVerify)
- Passes.add(createVerifierPass());
-#endif
-
- // Ask the target to add backend passes as necessary.
- MachineCodeEmitter *MCE = 0;
-
- switch (Target.addPassesToEmitFile(Passes, *Out, FileType, Fast)) {
- default:
- assert(0 && "Invalid file model!");
- return 1;
- case FileModel::Error:
- std::cerr << argv[0] << ": target does not support generation of this"
- << " file type!\n";
- if (Out != &std::cout) delete Out;
- // And the Out file is empty and useless, so remove it now.
- sys::Path(OutputFilename).eraseFromDisk();
- return 1;
- case FileModel::AsmFile:
- break;
- case FileModel::MachOFile:
- MCE = AddMachOWriter(Passes, *Out, Target);
- break;
- case FileModel::ElfFile:
- MCE = AddELFWriter(Passes, *Out, Target);
- break;
- }
-
- if (Target.addPassesToEmitFileFinish(Passes, MCE, Fast)) {
- std::cerr << argv[0] << ": target does not support generation of this"
- << " file type!\n";
- if (Out != &std::cout) delete Out;
- // And the Out file is empty and useless, so remove it now.
- sys::Path(OutputFilename).eraseFromDisk();
- return 1;
- }
-
- Passes.doInitialization();
-
- // Run our queue of passes all at once now, efficiently.
- // TODO: this could lazily stream functions out of the module.
- for (Module::iterator I = mod.begin(), E = mod.end(); I != E; ++I)
- if (!I->isDeclaration())
- Passes.run(*I);
-
- Passes.doFinalization();
- }
-
- // Delete the ostream if it's not a stdout stream
- if (Out != &std::cout) delete Out;
-
- return 0;
-}
diff --git a/release_23/tools/lli/Makefile b/release_23/tools/lli/Makefile
deleted file mode 100644
index b070cee27146..000000000000
--- a/release_23/tools/lli/Makefile
+++ /dev/null
@@ -1,15 +0,0 @@
-##===- tools/lli/Makefile ------------------------------*- Makefile -*-===##
-#
-# The LLVM Compiler Infrastructure
-#
-# This file is distributed under the University of Illinois Open Source
-# License. See LICENSE.TXT for details.
-#
-##===----------------------------------------------------------------------===##
-
-LEVEL := ../..
-TOOLNAME := lli
-LINK_COMPONENTS := jit interpreter native bitreader selectiondag
-
-# Enable JIT support
-include $(LEVEL)/Makefile.common
diff --git a/release_23/tools/lli/lli.cpp b/release_23/tools/lli/lli.cpp
deleted file mode 100644
index 5d34d9f1dd79..000000000000
--- a/release_23/tools/lli/lli.cpp
+++ /dev/null
@@ -1,182 +0,0 @@
-//===- lli.cpp - LLVM Interpreter / Dynamic compiler ----------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This utility provides a simple wrapper around the LLVM Execution Engines,
-// which allow the direct execution of LLVM programs through a Just-In-Time
-// compiler, or through an intepreter if no JIT is available for this platform.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Module.h"
-#include "llvm/ModuleProvider.h"
-#include "llvm/Type.h"
-#include "llvm/Bitcode/ReaderWriter.h"
-#include "llvm/CodeGen/LinkAllCodegenComponents.h"
-#include "llvm/ExecutionEngine/JIT.h"
-#include "llvm/ExecutionEngine/Interpreter.h"
-#include "llvm/ExecutionEngine/GenericValue.h"
-#include "llvm/Support/CommandLine.h"
-#include "llvm/Support/ManagedStatic.h"
-#include "llvm/Support/MemoryBuffer.h"
-#include "llvm/Support/PluginLoader.h"
-#include "llvm/System/Process.h"
-#include "llvm/System/Signals.h"
-#include <iostream>
-#include <cerrno>
-using namespace llvm;
-
-namespace {
- cl::opt<std::string>
- InputFile(cl::desc("<input bitcode>"), cl::Positional, cl::init("-"));
-
- cl::list<std::string>
- InputArgv(cl::ConsumeAfter, cl::desc("<program arguments>..."));
-
- cl::opt<bool> ForceInterpreter("force-interpreter",
- cl::desc("Force interpretation: disable JIT"),
- cl::init(false));
- cl::opt<std::string>
- TargetTriple("mtriple", cl::desc("Override target triple for module"));
-
- cl::opt<std::string>
- FakeArgv0("fake-argv0",
- cl::desc("Override the 'argv[0]' value passed into the executing"
- " program"), cl::value_desc("executable"));
-
- cl::opt<bool>
- DisableCoreFiles("disable-core-files", cl::Hidden,
- cl::desc("Disable emission of core files if possible"));
-
- cl::opt<bool>
- NoLazyCompilation("no-lazy",
- cl::desc("Disable JIT lazy compilation"),
- cl::init(false));
-}
-
-static ExecutionEngine *EE = 0;
-
-static void do_shutdown() {
- delete EE;
- llvm_shutdown();
-}
-
-//===----------------------------------------------------------------------===//
-// main Driver function
-//
-int main(int argc, char **argv, char * const *envp) {
- atexit(do_shutdown); // Call llvm_shutdown() on exit.
- cl::ParseCommandLineOptions(argc, argv,
- "llvm interpreter & dynamic compiler\n");
- sys::PrintStackTraceOnErrorSignal();
-
- // If the user doesn't want core files, disable them.
- if (DisableCoreFiles)
- sys::Process::PreventCoreFiles();
-
- // Load the bitcode...
- std::string ErrorMsg;
- ModuleProvider *MP = NULL;
- if (MemoryBuffer *Buffer = MemoryBuffer::getFileOrSTDIN(InputFile,&ErrorMsg)) {
- MP = getBitcodeModuleProvider(Buffer, &ErrorMsg);
- if (!MP) delete Buffer;
- }
-
- if (!MP) {
- std::cerr << argv[0] << ": error loading program '" << InputFile << "': "
- << ErrorMsg << "\n";
- exit(1);
- }
-
- // Get the module as the MP could go away once EE takes over.
- Module *Mod = NoLazyCompilation
- ? MP->materializeModule(&ErrorMsg) : MP->getModule();
- if (!Mod) {
- std::cerr << argv[0] << ": bitcode didn't read correctly.\n";
- std::cerr << "Reason: " << ErrorMsg << "\n";
- exit(1);
- }
-
- // If we are supposed to override the target triple, do so now.
- if (!TargetTriple.empty())
- Mod->setTargetTriple(TargetTriple);
-
- EE = ExecutionEngine::create(MP, ForceInterpreter, &ErrorMsg);
- if (!EE && !ErrorMsg.empty()) {
- std::cerr << argv[0] << ":error creating EE: " << ErrorMsg << "\n";
- exit(1);
- }
-
- if (NoLazyCompilation)
- EE->DisableLazyCompilation();
-
- // If the user specifically requested an argv[0] to pass into the program,
- // do it now.
- if (!FakeArgv0.empty()) {
- InputFile = FakeArgv0;
- } else {
- // Otherwise, if there is a .bc suffix on the executable strip it off, it
- // might confuse the program.
- if (InputFile.rfind(".bc") == InputFile.length() - 3)
- InputFile.erase(InputFile.length() - 3);
- }
-
- // Add the module's name to the start of the vector of arguments to main().
- InputArgv.insert(InputArgv.begin(), InputFile);
-
- // Call the main function from M as if its signature were:
- // int main (int argc, char **argv, const char **envp)
- // using the contents of Args to determine argc & argv, and the contents of
- // EnvVars to determine envp.
- //
- Function *MainFn = Mod->getFunction("main");
- if (!MainFn) {
- std::cerr << "'main' function not found in module.\n";
- return -1;
- }
-
- // If the program doesn't explicitly call exit, we will need the Exit
- // function later on to make an explicit call, so get the function now.
- Constant *Exit = Mod->getOrInsertFunction("exit", Type::VoidTy,
- Type::Int32Ty, NULL);
-
- // Reset errno to zero on entry to main.
- errno = 0;
-
- // Run static constructors.
- EE->runStaticConstructorsDestructors(false);
-
- if (NoLazyCompilation) {
- for (Module::iterator I = Mod->begin(), E = Mod->end(); I != E; ++I) {
- Function *Fn = &*I;
- if (Fn != MainFn && !Fn->isDeclaration())
- EE->getPointerToFunction(Fn);
- }
- }
-
- // Run main.
- int Result = EE->runFunctionAsMain(MainFn, InputArgv, envp);
-
- // Run static destructors.
- EE->runStaticConstructorsDestructors(true);
-
- // If the program didn't call exit explicitly, we should call it now.
- // This ensures that any atexit handlers get called correctly.
- if (Function *ExitF = dyn_cast<Function>(Exit)) {
- std::vector<GenericValue> Args;
- GenericValue ResultGV;
- ResultGV.IntVal = APInt(32, Result);
- Args.push_back(ResultGV);
- EE->runFunction(ExitF, Args);
- std::cerr << "ERROR: exit(" << Result << ") returned!\n";
- abort();
- } else {
- std::cerr << "ERROR: exit defined with wrong prototype!\n";
- abort();
- }
-}
diff --git a/release_23/tools/llvm-ar/Makefile b/release_23/tools/llvm-ar/Makefile
deleted file mode 100644
index ec862e670209..000000000000
--- a/release_23/tools/llvm-ar/Makefile
+++ /dev/null
@@ -1,22 +0,0 @@
-##===- tools/llvm-ar/Makefile ------------------------------*- Makefile -*-===##
-#
-# The LLVM Compiler Infrastructure
-#
-# This file is distributed under the University of Illinois Open Source
-# License. See LICENSE.TXT for details.
-#
-##===----------------------------------------------------------------------===##
-LEVEL = ../..
-
-TOOLNAME = llvm-ar
-LINK_COMPONENTS = archive
-REQUIRES_EH := 1
-
-include $(LEVEL)/Makefile.common
-
-check-local::
- $(Echo) Checking llvm-ar
- $(Verb) $(ToolDir)/llvm-ar zRrS nada.a .
- $(Verb) $(ToolDir)/llvm-ar tv nada.a | \
- grep Debug/llvm-ar.d >/dev/null 2>&1
- $(Verb) $(RM) -f nada.a
diff --git a/release_23/tools/llvm-ar/llvm-ar.cpp b/release_23/tools/llvm-ar/llvm-ar.cpp
deleted file mode 100644
index a6611a3e8091..000000000000
--- a/release_23/tools/llvm-ar/llvm-ar.cpp
+++ /dev/null
@@ -1,775 +0,0 @@
-//===-- llvm-ar.cpp - LLVM archive librarian utility ----------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// Builds up (relatively) standard unix archive files (.a) containing LLVM
-// bitcode or other files.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Module.h"
-#include "llvm/Bitcode/Archive.h"
-#include "llvm/Support/CommandLine.h"
-#include "llvm/Support/ManagedStatic.h"
-#include "llvm/System/Signals.h"
-#include <iostream>
-#include <algorithm>
-#include <iomanip>
-#include <memory>
-using namespace llvm;
-
-// Option for compatibility with AIX, not used but must allow it to be present.
-static cl::opt<bool>
-X32Option ("X32_64", cl::Hidden,
- cl::desc("Ignored option for compatibility with AIX"));
-
-// llvm-ar operation code and modifier flags. This must come first.
-static cl::opt<std::string>
-Options(cl::Positional, cl::Required, cl::desc("{operation}[modifiers]..."));
-
-// llvm-ar remaining positional arguments.
-static cl::list<std::string>
-RestOfArgs(cl::Positional, cl::OneOrMore,
- cl::desc("[relpos] [count] <archive-file> [members]..."));
-
-// MoreHelp - Provide additional help output explaining the operations and
-// modifiers of llvm-ar. This object instructs the CommandLine library
-// to print the text of the constructor when the --help option is given.
-static cl::extrahelp MoreHelp(
- "\nOPERATIONS:\n"
- " d[NsS] - delete file(s) from the archive\n"
- " m[abiSs] - move file(s) in the archive\n"
- " p[kN] - print file(s) found in the archive\n"
- " q[ufsS] - quick append file(s) to the archive\n"
- " r[abfiuzRsS] - replace or insert file(s) into the archive\n"
- " t - display contents of archive\n"
- " x[No] - extract file(s) from the archive\n"
- "\nMODIFIERS (operation specific):\n"
- " [a] - put file(s) after [relpos]\n"
- " [b] - put file(s) before [relpos] (same as [i])\n"
- " [f] - truncate inserted file names\n"
- " [i] - put file(s) before [relpos] (same as [b])\n"
- " [k] - always print bitcode files (default is to skip them)\n"
- " [N] - use instance [count] of name\n"
- " [o] - preserve original dates\n"
- " [P] - use full path names when matching\n"
- " [R] - recurse through directories when inserting\n"
- " [s] - create an archive index (cf. ranlib)\n"
- " [S] - do not build a symbol table\n"
- " [u] - update only files newer than archive contents\n"
- " [z] - compress files before inserting/extracting\n"
- "\nMODIFIERS (generic):\n"
- " [c] - do not warn if the library had to be created\n"
- " [v] - be verbose about actions taken\n"
- " [V] - be *really* verbose about actions taken\n"
-);
-
-// This enumeration delineates the kinds of operations on an archive
-// that are permitted.
-enum ArchiveOperation {
- NoOperation, ///< An operation hasn't been specified
- Print, ///< Print the contents of the archive
- Delete, ///< Delete the specified members
- Move, ///< Move members to end or as given by {a,b,i} modifiers
- QuickAppend, ///< Quickly append to end of archive
- ReplaceOrInsert, ///< Replace or Insert members
- DisplayTable, ///< Display the table of contents
- Extract ///< Extract files back to file system
-};
-
-// Modifiers to follow operation to vary behavior
-bool AddAfter = false; ///< 'a' modifier
-bool AddBefore = false; ///< 'b' modifier
-bool Create = false; ///< 'c' modifier
-bool TruncateNames = false; ///< 'f' modifier
-bool InsertBefore = false; ///< 'i' modifier
-bool DontSkipBitcode = false; ///< 'k' modifier
-bool UseCount = false; ///< 'N' modifier
-bool OriginalDates = false; ///< 'o' modifier
-bool FullPath = false; ///< 'P' modifier
-bool RecurseDirectories = false; ///< 'R' modifier
-bool SymTable = true; ///< 's' & 'S' modifiers
-bool OnlyUpdate = false; ///< 'u' modifier
-bool Verbose = false; ///< 'v' modifier
-bool ReallyVerbose = false; ///< 'V' modifier
-bool Compression = false; ///< 'z' modifier
-
-// Relative Positional Argument (for insert/move). This variable holds
-// the name of the archive member to which the 'a', 'b' or 'i' modifier
-// refers. Only one of 'a', 'b' or 'i' can be specified so we only need
-// one variable.
-std::string RelPos;
-
-// Select which of multiple entries in the archive with the same name should be
-// used (specified with -N) for the delete and extract operations.
-int Count = 1;
-
-// This variable holds the name of the archive file as given on the
-// command line.
-std::string ArchiveName;
-
-// This variable holds the list of member files to proecess, as given
-// on the command line.
-std::vector<std::string> Members;
-
-// This variable holds the (possibly expanded) list of path objects that
-// correspond to files we will
-std::set<sys::Path> Paths;
-
-// The Archive object to which all the editing operations will be sent.
-Archive* TheArchive = 0;
-
-// getRelPos - Extract the member filename from the command line for
-// the [relpos] argument associated with a, b, and i modifiers
-void getRelPos() {
- if(RestOfArgs.size() > 0) {
- RelPos = RestOfArgs[0];
- RestOfArgs.erase(RestOfArgs.begin());
- }
- else
- throw "Expected [relpos] for a, b, or i modifier";
-}
-
-// getCount - Extract the [count] argument associated with the N modifier
-// from the command line and check its value.
-void getCount() {
- if(RestOfArgs.size() > 0) {
- Count = atoi(RestOfArgs[0].c_str());
- RestOfArgs.erase(RestOfArgs.begin());
- }
- else
- throw "Expected [count] value with N modifier";
-
- // Non-positive counts are not allowed
- if (Count < 1)
- throw "Invalid [count] value (not a positive integer)";
-}
-
-// getArchive - Get the archive file name from the command line
-void getArchive() {
- if(RestOfArgs.size() > 0) {
- ArchiveName = RestOfArgs[0];
- RestOfArgs.erase(RestOfArgs.begin());
- }
- else
- throw "An archive name must be specified.";
-}
-
-// getMembers - Copy over remaining items in RestOfArgs to our Members vector
-// This is just for clarity.
-void getMembers() {
- if(RestOfArgs.size() > 0)
- Members = std::vector<std::string>(RestOfArgs);
-}
-
-// parseCommandLine - Parse the command line options as presented and return the
-// operation specified. Process all modifiers and check to make sure that
-// constraints on modifier/operation pairs have not been violated.
-ArchiveOperation parseCommandLine() {
-
- // Keep track of number of operations. We can only specify one
- // per execution.
- unsigned NumOperations = 0;
-
- // Keep track of the number of positional modifiers (a,b,i). Only
- // one can be specified.
- unsigned NumPositional = 0;
-
- // Keep track of which operation was requested
- ArchiveOperation Operation = NoOperation;
-
- for(unsigned i=0; i<Options.size(); ++i) {
- switch(Options[i]) {
- case 'd': ++NumOperations; Operation = Delete; break;
- case 'm': ++NumOperations; Operation = Move ; break;
- case 'p': ++NumOperations; Operation = Print; break;
- case 'q': ++NumOperations; Operation = QuickAppend; break;
- case 'r': ++NumOperations; Operation = ReplaceOrInsert; break;
- case 't': ++NumOperations; Operation = DisplayTable; break;
- case 'x': ++NumOperations; Operation = Extract; break;
- case 'c': Create = true; break;
- case 'f': TruncateNames = true; break;
- case 'k': DontSkipBitcode = true; break;
- case 'l': /* accepted but unused */ break;
- case 'o': OriginalDates = true; break;
- case 'P': FullPath = true; break;
- case 'R': RecurseDirectories = true; break;
- case 's': SymTable = true; break;
- case 'S': SymTable = false; break;
- case 'u': OnlyUpdate = true; break;
- case 'v': Verbose = true; break;
- case 'V': Verbose = ReallyVerbose = true; break;
- case 'z': Compression = true; break;
- case 'a':
- getRelPos();
- AddAfter = true;
- NumPositional++;
- break;
- case 'b':
- getRelPos();
- AddBefore = true;
- NumPositional++;
- break;
- case 'i':
- getRelPos();
- InsertBefore = true;
- NumPositional++;
- break;
- case 'N':
- getCount();
- UseCount = true;
- break;
- default:
- cl::PrintHelpMessage();
- }
- }
-
- // At this point, the next thing on the command line must be
- // the archive name.
- getArchive();
-
- // Everything on the command line at this point is a member.
- getMembers();
-
- // Perform various checks on the operation/modifier specification
- // to make sure we are dealing with a legal request.
- if (NumOperations == 0)
- throw "You must specify at least one of the operations";
- if (NumOperations > 1)
- throw "Only one operation may be specified";
- if (NumPositional > 1)
- throw "You may only specify one of a, b, and i modifiers";
- if (AddAfter || AddBefore || InsertBefore)
- if (Operation != Move && Operation != ReplaceOrInsert)
- throw "The 'a', 'b' and 'i' modifiers can only be specified with "
- "the 'm' or 'r' operations";
- if (RecurseDirectories && Operation != ReplaceOrInsert)
- throw "The 'R' modifiers is only applicabe to the 'r' operation";
- if (OriginalDates && Operation != Extract)
- throw "The 'o' modifier is only applicable to the 'x' operation";
- if (TruncateNames && Operation!=QuickAppend && Operation!=ReplaceOrInsert)
- throw "The 'f' modifier is only applicable to the 'q' and 'r' operations";
- if (OnlyUpdate && Operation != ReplaceOrInsert)
- throw "The 'u' modifier is only applicable to the 'r' operation";
- if (Compression && Operation!=ReplaceOrInsert && Operation!=Extract)
- throw "The 'z' modifier is only applicable to the 'r' and 'x' operations";
- if (Count > 1 && Members.size() > 1)
- throw "Only one member name may be specified with the 'N' modifier";
-
- // Return the parsed operation to the caller
- return Operation;
-}
-
-// recurseDirectories - Implements the "R" modifier. This function scans through
-// the Paths vector (built by buildPaths, below) and replaces any directories it
-// finds with all the files in that directory (recursively). It uses the
-// sys::Path::getDirectoryContent method to perform the actual directory scans.
-bool
-recurseDirectories(const sys::Path& path,
- std::set<sys::Path>& result, std::string* ErrMsg) {
- result.clear();
- if (RecurseDirectories) {
- std::set<sys::Path> content;
- if (path.getDirectoryContents(content, ErrMsg))
- return true;
-
- for (std::set<sys::Path>::iterator I = content.begin(), E = content.end();
- I != E; ++I) {
- // Make sure it exists and is a directory
- sys::PathWithStatus PwS(*I);
- const sys::FileStatus *Status = PwS.getFileStatus(false, ErrMsg);
- if (!Status)
- return true;
- if (Status->isDir) {
- std::set<sys::Path> moreResults;
- if (recurseDirectories(*I, moreResults, ErrMsg))
- return true;
- result.insert(moreResults.begin(), moreResults.end());
- } else {
- result.insert(*I);
- }
- }
- }
- return false;
-}
-
-// buildPaths - Convert the strings in the Members vector to sys::Path objects
-// and make sure they are valid and exist exist. This check is only needed for
-// the operations that add/replace files to the archive ('q' and 'r')
-bool buildPaths(bool checkExistence, std::string* ErrMsg) {
- for (unsigned i = 0; i < Members.size(); i++) {
- sys::Path aPath;
- if (!aPath.set(Members[i]))
- throw std::string("File member name invalid: ") + Members[i];
- if (checkExistence) {
- if (!aPath.exists())
- throw std::string("File does not exist: ") + Members[i];
- std::string Err;
- sys::PathWithStatus PwS(aPath);
- const sys::FileStatus *si = PwS.getFileStatus(false, &Err);
- if (!si)
- throw Err;
- if (si->isDir) {
- std::set<sys::Path> dirpaths;
- if (recurseDirectories(aPath, dirpaths, ErrMsg))
- return true;
- Paths.insert(dirpaths.begin(),dirpaths.end());
- } else {
- Paths.insert(aPath);
- }
- } else {
- Paths.insert(aPath);
- }
- }
- return false;
-}
-
-// printSymbolTable - print out the archive's symbol table.
-void printSymbolTable() {
- std::cout << "\nArchive Symbol Table:\n";
- const Archive::SymTabType& symtab = TheArchive->getSymbolTable();
- for (Archive::SymTabType::const_iterator I=symtab.begin(), E=symtab.end();
- I != E; ++I ) {
- unsigned offset = TheArchive->getFirstFileOffset() + I->second;
- std::cout << " " << std::setw(9) << offset << "\t" << I->first <<"\n";
- }
-}
-
-// doPrint - Implements the 'p' operation. This function traverses the archive
-// looking for members that match the path list. It is careful to uncompress
-// things that should be and to skip bitcode files unless the 'k' modifier was
-// given.
-bool doPrint(std::string* ErrMsg) {
- if (buildPaths(false, ErrMsg))
- return true;
- unsigned countDown = Count;
- for (Archive::iterator I = TheArchive->begin(), E = TheArchive->end();
- I != E; ++I ) {
- if (Paths.empty() ||
- (std::find(Paths.begin(), Paths.end(), I->getPath()) != Paths.end())) {
- if (countDown == 1) {
- const char* data = reinterpret_cast<const char*>(I->getData());
-
- // Skip things that don't make sense to print
- if (I->isLLVMSymbolTable() || I->isSVR4SymbolTable() ||
- I->isBSD4SymbolTable() || (!DontSkipBitcode && I->isBitcode()))
- continue;
-
- if (Verbose)
- std::cout << "Printing " << I->getPath().toString() << "\n";
-
- unsigned len = I->getSize();
- std::cout.write(data, len);
- } else {
- countDown--;
- }
- }
- }
- return false;
-}
-
-// putMode - utility function for printing out the file mode when the 't'
-// operation is in verbose mode.
-void
-printMode(unsigned mode) {
- if (mode & 004)
- std::cout << "r";
- else
- std::cout << "-";
- if (mode & 002)
- std::cout << "w";
- else
- std::cout << "-";
- if (mode & 001)
- std::cout << "x";
- else
- std::cout << "-";
-}
-
-// doDisplayTable - Implement the 't' operation. This function prints out just
-// the file names of each of the members. However, if verbose mode is requested
-// ('v' modifier) then the file type, permission mode, user, group, size, and
-// modification time are also printed.
-bool
-doDisplayTable(std::string* ErrMsg) {
- if (buildPaths(false, ErrMsg))
- return true;
- for (Archive::iterator I = TheArchive->begin(), E = TheArchive->end();
- I != E; ++I ) {
- if (Paths.empty() ||
- (std::find(Paths.begin(), Paths.end(), I->getPath()) != Paths.end())) {
- if (Verbose) {
- // FIXME: Output should be this format:
- // Zrw-r--r-- 500/ 500 525 Nov 8 17:42 2004 Makefile
- if (I->isBitcode())
- std::cout << "b";
- else if (I->isCompressed())
- std::cout << "Z";
- else
- std::cout << " ";
- unsigned mode = I->getMode();
- printMode((mode >> 6) & 007);
- printMode((mode >> 3) & 007);
- printMode(mode & 007);
- std::cout << " " << std::setw(4) << I->getUser();
- std::cout << "/" << std::setw(4) << I->getGroup();
- std::cout << " " << std::setw(8) << I->getSize();
- std::cout << " " << std::setw(20) <<
- I->getModTime().toString().substr(4);
- std::cout << " " << I->getPath().toString() << "\n";
- } else {
- std::cout << I->getPath().toString() << "\n";
- }
- }
- }
- if (ReallyVerbose)
- printSymbolTable();
- return false;
-}
-
-// doExtract - Implement the 'x' operation. This function extracts files back to
-// the file system, making sure to uncompress any that were compressed
-bool
-doExtract(std::string* ErrMsg) {
- if (buildPaths(false, ErrMsg))
- return true;
- for (Archive::iterator I = TheArchive->begin(), E = TheArchive->end();
- I != E; ++I ) {
- if (Paths.empty() ||
- (std::find(Paths.begin(), Paths.end(), I->getPath()) != Paths.end())) {
-
- // Make sure the intervening directories are created
- if (I->hasPath()) {
- sys::Path dirs(I->getPath());
- dirs.eraseComponent();
- if (dirs.createDirectoryOnDisk(/*create_parents=*/true, ErrMsg))
- return true;
- }
-
- // Open up a file stream for writing
- std::ios::openmode io_mode = std::ios::out | std::ios::trunc |
- std::ios::binary;
- std::ofstream file(I->getPath().c_str(), io_mode);
-
- // Get the data and its length
- const char* data = reinterpret_cast<const char*>(I->getData());
- unsigned len = I->getSize();
-
- // Write the data.
- file.write(data,len);
- file.close();
-
- // If we're supposed to retain the original modification times, etc. do so
- // now.
- if (OriginalDates)
- I->getPath().setStatusInfoOnDisk(I->getFileStatus());
- }
- }
- return false;
-}
-
-// doDelete - Implement the delete operation. This function deletes zero or more
-// members from the archive. Note that if the count is specified, there should
-// be no more than one path in the Paths list or else this algorithm breaks.
-// That check is enforced in parseCommandLine (above).
-bool
-doDelete(std::string* ErrMsg) {
- if (buildPaths(false, ErrMsg))
- return true;
- if (Paths.empty())
- return false;
- unsigned countDown = Count;
- for (Archive::iterator I = TheArchive->begin(), E = TheArchive->end();
- I != E; ) {
- if (std::find(Paths.begin(), Paths.end(), I->getPath()) != Paths.end()) {
- if (countDown == 1) {
- Archive::iterator J = I;
- ++I;
- TheArchive->erase(J);
- } else
- countDown--;
- } else {
- ++I;
- }
- }
-
- // We're done editting, reconstruct the archive.
- if (TheArchive->writeToDisk(SymTable,TruncateNames,Compression,ErrMsg))
- return true;
- if (ReallyVerbose)
- printSymbolTable();
- return false;
-}
-
-// doMore - Implement the move operation. This function re-arranges just the
-// order of the archive members so that when the archive is written the move
-// of the members is accomplished. Note the use of the RelPos variable to
-// determine where the items should be moved to.
-bool
-doMove(std::string* ErrMsg) {
- if (buildPaths(false, ErrMsg))
- return true;
-
- // By default and convention the place to move members to is the end of the
- // archive.
- Archive::iterator moveto_spot = TheArchive->end();
-
- // However, if the relative positioning modifiers were used, we need to scan
- // the archive to find the member in question. If we don't find it, its no
- // crime, we just move to the end.
- if (AddBefore || InsertBefore || AddAfter) {
- for (Archive::iterator I = TheArchive->begin(), E= TheArchive->end();
- I != E; ++I ) {
- if (RelPos == I->getPath().toString()) {
- if (AddAfter) {
- moveto_spot = I;
- moveto_spot++;
- } else {
- moveto_spot = I;
- }
- break;
- }
- }
- }
-
- // Keep a list of the paths remaining to be moved
- std::set<sys::Path> remaining(Paths);
-
- // Scan the archive again, this time looking for the members to move to the
- // moveto_spot.
- for (Archive::iterator I = TheArchive->begin(), E= TheArchive->end();
- I != E && !remaining.empty(); ++I ) {
- std::set<sys::Path>::iterator found =
- std::find(remaining.begin(),remaining.end(),I->getPath());
- if (found != remaining.end()) {
- if (I != moveto_spot)
- TheArchive->splice(moveto_spot,*TheArchive,I);
- remaining.erase(found);
- }
- }
-
- // We're done editting, reconstruct the archive.
- if (TheArchive->writeToDisk(SymTable,TruncateNames,Compression,ErrMsg))
- return true;
- if (ReallyVerbose)
- printSymbolTable();
- return false;
-}
-
-// doQuickAppend - Implements the 'q' operation. This function just
-// indiscriminantly adds the members to the archive and rebuilds it.
-bool
-doQuickAppend(std::string* ErrMsg) {
- // Get the list of paths to append.
- if (buildPaths(true, ErrMsg))
- return true;
- if (Paths.empty())
- return false;
-
- // Append them quickly.
- for (std::set<sys::Path>::iterator PI = Paths.begin(), PE = Paths.end();
- PI != PE; ++PI) {
- if (TheArchive->addFileBefore(*PI,TheArchive->end(),ErrMsg))
- return true;
- }
-
- // We're done editting, reconstruct the archive.
- if (TheArchive->writeToDisk(SymTable,TruncateNames,Compression,ErrMsg))
- return true;
- if (ReallyVerbose)
- printSymbolTable();
- return false;
-}
-
-// doReplaceOrInsert - Implements the 'r' operation. This function will replace
-// any existing files or insert new ones into the archive.
-bool
-doReplaceOrInsert(std::string* ErrMsg) {
-
- // Build the list of files to be added/replaced.
- if (buildPaths(true, ErrMsg))
- return true;
- if (Paths.empty())
- return false;
-
- // Keep track of the paths that remain to be inserted.
- std::set<sys::Path> remaining(Paths);
-
- // Default the insertion spot to the end of the archive
- Archive::iterator insert_spot = TheArchive->end();
-
- // Iterate over the archive contents
- for (Archive::iterator I = TheArchive->begin(), E = TheArchive->end();
- I != E && !remaining.empty(); ++I ) {
-
- // Determine if this archive member matches one of the paths we're trying
- // to replace.
-
- std::set<sys::Path>::iterator found = remaining.end();
- for (std::set<sys::Path>::iterator RI = remaining.begin(),
- RE = remaining.end(); RI != RE; ++RI ) {
- std::string compare(RI->toString());
- if (TruncateNames && compare.length() > 15) {
- const char* nm = compare.c_str();
- unsigned len = compare.length();
- size_t slashpos = compare.rfind('/');
- if (slashpos != std::string::npos) {
- nm += slashpos + 1;
- len -= slashpos +1;
- }
- if (len > 15)
- len = 15;
- compare.assign(nm,len);
- }
- if (compare == I->getPath().toString()) {
- found = RI;
- break;
- }
- }
-
- if (found != remaining.end()) {
- std::string Err;
- sys::PathWithStatus PwS(*found);
- const sys::FileStatus *si = PwS.getFileStatus(false, &Err);
- if (!si)
- return true;
- if (si->isDir) {
- if (OnlyUpdate) {
- // Replace the item only if it is newer.
- if (si->modTime > I->getModTime())
- if (I->replaceWith(*found, ErrMsg))
- return true;
- } else {
- // Replace the item regardless of time stamp
- if (I->replaceWith(*found, ErrMsg))
- return true;
- }
- } else {
- // We purposefully ignore directories.
- }
-
- // Remove it from our "to do" list
- remaining.erase(found);
- }
-
- // Determine if this is the place where we should insert
- if ((AddBefore || InsertBefore) && (RelPos == I->getPath().toString()))
- insert_spot = I;
- else if (AddAfter && (RelPos == I->getPath().toString())) {
- insert_spot = I;
- insert_spot++;
- }
- }
-
- // If we didn't replace all the members, some will remain and need to be
- // inserted at the previously computed insert-spot.
- if (!remaining.empty()) {
- for (std::set<sys::Path>::iterator PI = remaining.begin(),
- PE = remaining.end(); PI != PE; ++PI) {
- if (TheArchive->addFileBefore(*PI,insert_spot, ErrMsg))
- return true;
- }
- }
-
- // We're done editting, reconstruct the archive.
- if (TheArchive->writeToDisk(SymTable,TruncateNames,Compression,ErrMsg))
- return true;
- if (ReallyVerbose)
- printSymbolTable();
- return false;
-}
-
-// main - main program for llvm-ar .. see comments in the code
-int main(int argc, char **argv) {
- llvm_shutdown_obj X; // Call llvm_shutdown() on exit.
-
- // Have the command line options parsed and handle things
- // like --help and --version.
- cl::ParseCommandLineOptions(argc, argv,
- "LLVM Archiver (llvm-ar)\n\n"
- " This program archives bitcode files into single libraries\n"
- );
-
- // Print a stack trace if we signal out.
- sys::PrintStackTraceOnErrorSignal();
-
- int exitCode = 0;
-
- // Make sure we don't exit with "unhandled exception".
- try {
- // Do our own parsing of the command line because the CommandLine utility
- // can't handle the grouped positional parameters without a dash.
- ArchiveOperation Operation = parseCommandLine();
-
- // Check the path name of the archive
- sys::Path ArchivePath;
- if (!ArchivePath.set(ArchiveName))
- throw std::string("Archive name invalid: ") + ArchiveName;
-
- // Create or open the archive object.
- if (!ArchivePath.exists()) {
- // Produce a warning if we should and we're creating the archive
- if (!Create)
- std::cerr << argv[0] << ": creating " << ArchivePath.toString() << "\n";
- TheArchive = Archive::CreateEmpty(ArchivePath);
- TheArchive->writeToDisk();
- } else {
- std::string Error;
- TheArchive = Archive::OpenAndLoad(ArchivePath, &Error);
- if (TheArchive == 0) {
- std::cerr << argv[0] << ": error loading '" << ArchivePath << "': "
- << Error << "!\n";
- return 1;
- }
- }
-
- // Make sure we're not fooling ourselves.
- assert(TheArchive && "Unable to instantiate the archive");
-
- // Make sure we clean up the archive even on failure.
- std::auto_ptr<Archive> AutoArchive(TheArchive);
-
- // Perform the operation
- std::string ErrMsg;
- bool haveError = false;
- switch (Operation) {
- case Print: haveError = doPrint(&ErrMsg); break;
- case Delete: haveError = doDelete(&ErrMsg); break;
- case Move: haveError = doMove(&ErrMsg); break;
- case QuickAppend: haveError = doQuickAppend(&ErrMsg); break;
- case ReplaceOrInsert: haveError = doReplaceOrInsert(&ErrMsg); break;
- case DisplayTable: haveError = doDisplayTable(&ErrMsg); break;
- case Extract: haveError = doExtract(&ErrMsg); break;
- case NoOperation:
- std::cerr << argv[0] << ": No operation was selected.\n";
- break;
- }
- if (haveError) {
- std::cerr << argv[0] << ": " << ErrMsg << "\n";
- return 1;
- }
- } catch (const char*msg) {
- // These errors are usage errors, thrown only by the various checks in the
- // code above.
- std::cerr << argv[0] << ": " << msg << "\n\n";
- cl::PrintHelpMessage();
- exitCode = 1;
- } catch (const std::string& msg) {
- // These errors are thrown by LLVM libraries (e.g. lib System) and represent
- // a more serious error so we bump the exitCode and don't print the usage.
- std::cerr << argv[0] << ": " << msg << "\n";
- exitCode = 2;
- } catch (...) {
- // This really shouldn't happen, but just in case ....
- std::cerr << argv[0] << ": An unexpected unknown exception occurred.\n";
- exitCode = 3;
- }
-
- // Return result code back to operating system.
- return exitCode;
-}
diff --git a/release_23/tools/llvm-as/Makefile b/release_23/tools/llvm-as/Makefile
deleted file mode 100644
index bdeeaa1e77f0..000000000000
--- a/release_23/tools/llvm-as/Makefile
+++ /dev/null
@@ -1,15 +0,0 @@
-##===- tools/llvm-as/Makefile ------------------------------*- Makefile -*-===##
-#
-# The LLVM Compiler Infrastructure
-#
-# This file is distributed under the University of Illinois Open Source
-# License. See LICENSE.TXT for details.
-#
-##===----------------------------------------------------------------------===##
-
-LEVEL = ../..
-TOOLNAME = llvm-as
-LINK_COMPONENTS := asmparser bitwriter
-REQUIRES_EH := 1
-
-include $(LEVEL)/Makefile.common
diff --git a/release_23/tools/llvm-as/llvm-as.cpp b/release_23/tools/llvm-as/llvm-as.cpp
deleted file mode 100644
index d9fa1fa7f40a..000000000000
--- a/release_23/tools/llvm-as/llvm-as.cpp
+++ /dev/null
@@ -1,145 +0,0 @@
-//===--- llvm-as.cpp - The low-level LLVM assembler -----------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This utility may be invoked in the following manner:
-// llvm-as --help - Output information about command line switches
-// llvm-as [options] - Read LLVM asm from stdin, write bitcode to stdout
-// llvm-as [options] x.ll - Read LLVM asm from the x.ll file, write bitcode
-// to the x.bc file.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Module.h"
-#include "llvm/Assembly/Parser.h"
-#include "llvm/Analysis/Verifier.h"
-#include "llvm/Bitcode/ReaderWriter.h"
-#include "llvm/Support/CommandLine.h"
-#include "llvm/Support/ManagedStatic.h"
-#include "llvm/Support/Streams.h"
-#include "llvm/Support/SystemUtils.h"
-#include "llvm/System/Signals.h"
-#include <fstream>
-#include <iostream>
-#include <memory>
-using namespace llvm;
-
-static cl::opt<std::string>
-InputFilename(cl::Positional, cl::desc("<input .llvm file>"), cl::init("-"));
-
-static cl::opt<std::string>
-OutputFilename("o", cl::desc("Override output filename"),
- cl::value_desc("filename"));
-
-static cl::opt<bool>
-Force("f", cl::desc("Overwrite output files"));
-
-static cl::opt<bool>
-DisableOutput("disable-output", cl::desc("Disable output"), cl::init(false));
-
-static cl::opt<bool>
-DumpAsm("d", cl::desc("Print assembly as parsed"), cl::Hidden);
-
-static cl::opt<bool>
-DisableVerify("disable-verify", cl::Hidden,
- cl::desc("Do not run verifier on input LLVM (dangerous!)"));
-
-int main(int argc, char **argv) {
- llvm_shutdown_obj X; // Call llvm_shutdown() on exit.
- cl::ParseCommandLineOptions(argc, argv, "llvm .ll -> .bc assembler\n");
- sys::PrintStackTraceOnErrorSignal();
-
- int exitCode = 0;
- std::ostream *Out = 0;
- try {
- // Parse the file now...
- ParseError Err;
- std::auto_ptr<Module> M(ParseAssemblyFile(InputFilename,&Err));
- if (M.get() == 0) {
- cerr << argv[0] << ": " << Err.getMessage() << "\n";
- return 1;
- }
-
- if (!DisableVerify) {
- std::string Err;
- if (verifyModule(*M.get(), ReturnStatusAction, &Err)) {
- cerr << argv[0]
- << ": assembly parsed, but does not verify as correct!\n";
- cerr << Err;
- return 1;
- }
- }
-
- if (DumpAsm) cerr << "Here's the assembly:\n" << *M.get();
-
- if (OutputFilename != "") { // Specified an output filename?
- if (OutputFilename != "-") { // Not stdout?
- if (!Force && std::ifstream(OutputFilename.c_str())) {
- // If force is not specified, make sure not to overwrite a file!
- cerr << argv[0] << ": error opening '" << OutputFilename
- << "': file exists!\n"
- << "Use -f command line argument to force output\n";
- return 1;
- }
- Out = new std::ofstream(OutputFilename.c_str(), std::ios::out |
- std::ios::trunc | std::ios::binary);
- } else { // Specified stdout
- // FIXME: cout is not binary!
- Out = &std::cout;
- }
- } else {
- if (InputFilename == "-") {
- OutputFilename = "-";
- Out = &std::cout;
- } else {
- std::string IFN = InputFilename;
- int Len = IFN.length();
- if (IFN[Len-3] == '.' && IFN[Len-2] == 'l' && IFN[Len-1] == 'l') {
- // Source ends in .ll
- OutputFilename = std::string(IFN.begin(), IFN.end()-3);
- } else {
- OutputFilename = IFN; // Append a .bc to it
- }
- OutputFilename += ".bc";
-
- if (!Force && std::ifstream(OutputFilename.c_str())) {
- // If force is not specified, make sure not to overwrite a file!
- cerr << argv[0] << ": error opening '" << OutputFilename
- << "': file exists!\n"
- << "Use -f command line argument to force output\n";
- return 1;
- }
-
- Out = new std::ofstream(OutputFilename.c_str(), std::ios::out |
- std::ios::trunc | std::ios::binary);
- // Make sure that the Out file gets unlinked from the disk if we get a
- // SIGINT
- sys::RemoveFileOnSignal(sys::Path(OutputFilename));
- }
- }
-
- if (!Out->good()) {
- cerr << argv[0] << ": error opening " << OutputFilename << "!\n";
- return 1;
- }
-
- if (!DisableOutput)
- if (Force || !CheckBitcodeOutputToConsole(Out,true))
- WriteBitcodeToFile(M.get(), *Out);
- } catch (const std::string& msg) {
- cerr << argv[0] << ": " << msg << "\n";
- exitCode = 1;
- } catch (...) {
- cerr << argv[0] << ": Unexpected unknown exception occurred.\n";
- exitCode = 1;
- }
-
- if (Out != &std::cout) delete Out;
- return exitCode;
-}
-
diff --git a/release_23/tools/llvm-bcanalyzer/Makefile b/release_23/tools/llvm-bcanalyzer/Makefile
deleted file mode 100644
index 78732363046a..000000000000
--- a/release_23/tools/llvm-bcanalyzer/Makefile
+++ /dev/null
@@ -1,15 +0,0 @@
-##===- tools/llvm-bcanalyzer/Makefile ----------------------*- Makefile -*-===##
-#
-# The LLVM Compiler Infrastructure
-#
-# This file is distributed under the University of Illinois Open Source
-# License. See LICENSE.TXT for details.
-#
-##===----------------------------------------------------------------------===##
-LEVEL = ../..
-
-TOOLNAME = llvm-bcanalyzer
-LINK_COMPONENTS := bitreader
-REQUIRES_EH := 1
-
-include $(LEVEL)/Makefile.common
diff --git a/release_23/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp b/release_23/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp
deleted file mode 100644
index 1cd23679edd3..000000000000
--- a/release_23/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp
+++ /dev/null
@@ -1,502 +0,0 @@
-//===-- llvm-bcanalyzer.cpp - Bitcode Analyzer --------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This tool may be invoked in the following manner:
-// llvm-bcanalyzer [options] - Read LLVM bitcode from stdin
-// llvm-bcanalyzer [options] x.bc - Read LLVM bitcode from the x.bc file
-//
-// Options:
-// --help - Output information about command line switches
-// --dump - Dump low-level bitcode structure in readable format
-//
-// This tool provides analytical information about a bitcode file. It is
-// intended as an aid to developers of bitcode reading and writing software. It
-// produces on std::out a summary of the bitcode file that shows various
-// statistics about the contents of the file. By default this information is
-// detailed and contains information about individual bitcode blocks and the
-// functions in the module.
-// The tool is also able to print a bitcode file in a straight forward text
-// format that shows the containment and relationships of the information in
-// the bitcode file (-dump option).
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Analysis/Verifier.h"
-#include "llvm/Bitcode/BitstreamReader.h"
-#include "llvm/Bitcode/LLVMBitCodes.h"
-#include "llvm/Support/CommandLine.h"
-#include "llvm/Support/ManagedStatic.h"
-#include "llvm/Support/MemoryBuffer.h"
-#include "llvm/System/Signals.h"
-#include <map>
-#include <fstream>
-#include <iostream>
-#include <algorithm>
-using namespace llvm;
-
-static cl::opt<std::string>
- InputFilename(cl::Positional, cl::desc("<input bitcode>"), cl::init("-"));
-
-static cl::opt<std::string>
- OutputFilename("-o", cl::init("-"), cl::desc("<output file>"));
-
-static cl::opt<bool> Dump("dump", cl::desc("Dump low level bitcode trace"));
-
-//===----------------------------------------------------------------------===//
-// Bitcode specific analysis.
-//===----------------------------------------------------------------------===//
-
-static cl::opt<bool> NoHistogram("disable-histogram",
- cl::desc("Do not print per-code histogram"));
-
-static cl::opt<bool>
-NonSymbolic("non-symbolic",
- cl::desc("Emit numberic info in dump even if"
- " symbolic info is available"));
-
-/// CurStreamType - If we can sniff the flavor of this stream, we can produce
-/// better dump info.
-static enum {
- UnknownBitstream,
- LLVMIRBitstream
-} CurStreamType;
-
-
-/// GetBlockName - Return a symbolic block name if known, otherwise return
-/// null.
-static const char *GetBlockName(unsigned BlockID) {
- // Standard blocks for all bitcode files.
- if (BlockID < bitc::FIRST_APPLICATION_BLOCKID) {
- if (BlockID == bitc::BLOCKINFO_BLOCK_ID)
- return "BLOCKINFO_BLOCK";
- return 0;
- }
-
- if (CurStreamType != LLVMIRBitstream) return 0;
-
- switch (BlockID) {
- default: return 0;
- case bitc::MODULE_BLOCK_ID: return "MODULE_BLOCK";
- case bitc::PARAMATTR_BLOCK_ID: return "PARAMATTR_BLOCK";
- case bitc::TYPE_BLOCK_ID: return "TYPE_BLOCK";
- case bitc::CONSTANTS_BLOCK_ID: return "CONSTANTS_BLOCK";
- case bitc::FUNCTION_BLOCK_ID: return "FUNCTION_BLOCK";
- case bitc::TYPE_SYMTAB_BLOCK_ID: return "TYPE_SYMTAB";
- case bitc::VALUE_SYMTAB_BLOCK_ID: return "VALUE_SYMTAB";
- }
-}
-
-/// GetCodeName - Return a symbolic code name if known, otherwise return
-/// null.
-static const char *GetCodeName(unsigned CodeID, unsigned BlockID) {
- // Standard blocks for all bitcode files.
- if (BlockID < bitc::FIRST_APPLICATION_BLOCKID) {
- if (BlockID == bitc::BLOCKINFO_BLOCK_ID) {
- switch (CodeID) {
- default: return 0;
- case bitc::MODULE_CODE_VERSION: return "VERSION";
- }
- }
- return 0;
- }
-
- if (CurStreamType != LLVMIRBitstream) return 0;
-
- switch (BlockID) {
- default: return 0;
- case bitc::MODULE_BLOCK_ID:
- switch (CodeID) {
- default: return 0;
- case bitc::MODULE_CODE_VERSION: return "VERSION";
- case bitc::MODULE_CODE_TRIPLE: return "TRIPLE";
- case bitc::MODULE_CODE_DATALAYOUT: return "DATALAYOUT";
- case bitc::MODULE_CODE_ASM: return "ASM";
- case bitc::MODULE_CODE_SECTIONNAME: return "SECTIONNAME";
- case bitc::MODULE_CODE_DEPLIB: return "DEPLIB";
- case bitc::MODULE_CODE_GLOBALVAR: return "GLOBALVAR";
- case bitc::MODULE_CODE_FUNCTION: return "FUNCTION";
- case bitc::MODULE_CODE_ALIAS: return "ALIAS";
- case bitc::MODULE_CODE_PURGEVALS: return "PURGEVALS";
- }
- case bitc::PARAMATTR_BLOCK_ID:
- switch (CodeID) {
- default: return 0;
- case bitc::PARAMATTR_CODE_ENTRY: return "ENTRY";
- }
- case bitc::TYPE_BLOCK_ID:
- switch (CodeID) {
- default: return 0;
- case bitc::TYPE_CODE_NUMENTRY: return "NUMENTRY";
- case bitc::TYPE_CODE_VOID: return "VOID";
- case bitc::TYPE_CODE_FLOAT: return "FLOAT";
- case bitc::TYPE_CODE_DOUBLE: return "DOUBLE";
- case bitc::TYPE_CODE_LABEL: return "LABEL";
- case bitc::TYPE_CODE_OPAQUE: return "OPAQUE";
- case bitc::TYPE_CODE_INTEGER: return "INTEGER";
- case bitc::TYPE_CODE_POINTER: return "POINTER";
- case bitc::TYPE_CODE_FUNCTION: return "FUNCTION";
- case bitc::TYPE_CODE_STRUCT: return "STRUCT";
- case bitc::TYPE_CODE_ARRAY: return "ARRAY";
- case bitc::TYPE_CODE_VECTOR: return "VECTOR";
- }
-
- case bitc::CONSTANTS_BLOCK_ID:
- switch (CodeID) {
- default: return 0;
- case bitc::CST_CODE_SETTYPE: return "SETTYPE";
- case bitc::CST_CODE_NULL: return "NULL";
- case bitc::CST_CODE_UNDEF: return "UNDEF";
- case bitc::CST_CODE_INTEGER: return "INTEGER";
- case bitc::CST_CODE_WIDE_INTEGER: return "WIDE_INTEGER";
- case bitc::CST_CODE_FLOAT: return "FLOAT";
- case bitc::CST_CODE_AGGREGATE: return "AGGREGATE";
- case bitc::CST_CODE_STRING: return "STRING";
- case bitc::CST_CODE_CSTRING: return "CSTRING";
- case bitc::CST_CODE_CE_BINOP: return "CE_BINOP";
- case bitc::CST_CODE_CE_CAST: return "CE_CAST";
- case bitc::CST_CODE_CE_GEP: return "CE_GEP";
- case bitc::CST_CODE_CE_SELECT: return "CE_SELECT";
- case bitc::CST_CODE_CE_EXTRACTELT: return "CE_EXTRACTELT";
- case bitc::CST_CODE_CE_INSERTELT: return "CE_INSERTELT";
- case bitc::CST_CODE_CE_SHUFFLEVEC: return "CE_SHUFFLEVEC";
- case bitc::CST_CODE_CE_CMP: return "CE_CMP";
- case bitc::CST_CODE_INLINEASM: return "INLINEASM";
- }
- case bitc::FUNCTION_BLOCK_ID:
- switch (CodeID) {
- default: return 0;
- case bitc::FUNC_CODE_DECLAREBLOCKS: return "DECLAREBLOCKS";
-
- case bitc::FUNC_CODE_INST_BINOP: return "INST_BINOP";
- case bitc::FUNC_CODE_INST_CAST: return "INST_CAST";
- case bitc::FUNC_CODE_INST_GEP: return "INST_GEP";
- case bitc::FUNC_CODE_INST_SELECT: return "INST_SELECT";
- case bitc::FUNC_CODE_INST_EXTRACTELT: return "INST_EXTRACTELT";
- case bitc::FUNC_CODE_INST_INSERTELT: return "INST_INSERTELT";
- case bitc::FUNC_CODE_INST_SHUFFLEVEC: return "INST_SHUFFLEVEC";
- case bitc::FUNC_CODE_INST_CMP: return "INST_CMP";
-
- case bitc::FUNC_CODE_INST_RET: return "INST_RET";
- case bitc::FUNC_CODE_INST_BR: return "INST_BR";
- case bitc::FUNC_CODE_INST_SWITCH: return "INST_SWITCH";
- case bitc::FUNC_CODE_INST_INVOKE: return "INST_INVOKE";
- case bitc::FUNC_CODE_INST_UNWIND: return "INST_UNWIND";
- case bitc::FUNC_CODE_INST_UNREACHABLE: return "INST_UNREACHABLE";
-
- case bitc::FUNC_CODE_INST_PHI: return "INST_PHI";
- case bitc::FUNC_CODE_INST_MALLOC: return "INST_MALLOC";
- case bitc::FUNC_CODE_INST_FREE: return "INST_FREE";
- case bitc::FUNC_CODE_INST_ALLOCA: return "INST_ALLOCA";
- case bitc::FUNC_CODE_INST_LOAD: return "INST_LOAD";
- case bitc::FUNC_CODE_INST_STORE: return "INST_STORE";
- case bitc::FUNC_CODE_INST_CALL: return "INST_CALL";
- case bitc::FUNC_CODE_INST_VAARG: return "INST_VAARG";
- case bitc::FUNC_CODE_INST_STORE2: return "INST_STORE2";
- case bitc::FUNC_CODE_INST_GETRESULT: return "INST_GETRESULT";
- }
- case bitc::TYPE_SYMTAB_BLOCK_ID:
- switch (CodeID) {
- default: return 0;
- case bitc::TST_CODE_ENTRY: return "ENTRY";
- }
- case bitc::VALUE_SYMTAB_BLOCK_ID:
- switch (CodeID) {
- default: return 0;
- case bitc::VST_CODE_ENTRY: return "ENTRY";
- case bitc::VST_CODE_BBENTRY: return "BBENTRY";
- }
- }
-}
-
-
-struct PerBlockIDStats {
- /// NumInstances - This the number of times this block ID has been seen.
- unsigned NumInstances;
-
- /// NumBits - The total size in bits of all of these blocks.
- uint64_t NumBits;
-
- /// NumSubBlocks - The total number of blocks these blocks contain.
- unsigned NumSubBlocks;
-
- /// NumAbbrevs - The total number of abbreviations.
- unsigned NumAbbrevs;
-
- /// NumRecords - The total number of records these blocks contain, and the
- /// number that are abbreviated.
- unsigned NumRecords, NumAbbreviatedRecords;
-
- /// CodeFreq - Keep track of the number of times we see each code.
- std::vector<unsigned> CodeFreq;
-
- PerBlockIDStats()
- : NumInstances(0), NumBits(0),
- NumSubBlocks(0), NumAbbrevs(0), NumRecords(0), NumAbbreviatedRecords(0) {}
-};
-
-static std::map<unsigned, PerBlockIDStats> BlockIDStats;
-
-
-
-/// Error - All bitcode analysis errors go through this function, making this a
-/// good place to breakpoint if debugging.
-static bool Error(const std::string &Err) {
- std::cerr << Err << "\n";
- return true;
-}
-
-/// ParseBlock - Read a block, updating statistics, etc.
-static bool ParseBlock(BitstreamReader &Stream, unsigned IndentLevel) {
- std::string Indent(IndentLevel*2, ' ');
- uint64_t BlockBitStart = Stream.GetCurrentBitNo();
- unsigned BlockID = Stream.ReadSubBlockID();
-
- // Get the statistics for this BlockID.
- PerBlockIDStats &BlockStats = BlockIDStats[BlockID];
-
- BlockStats.NumInstances++;
-
- // BLOCKINFO is a special part of the stream.
- if (BlockID == bitc::BLOCKINFO_BLOCK_ID) {
- if (Dump) std::cerr << Indent << "<BLOCKINFO_BLOCK/>\n";
- if (Stream.ReadBlockInfoBlock())
- return Error("Malformed BlockInfoBlock");
- uint64_t BlockBitEnd = Stream.GetCurrentBitNo();
- BlockStats.NumBits += BlockBitEnd-BlockBitStart;
- return false;
- }
-
- unsigned NumWords = 0;
- if (Stream.EnterSubBlock(BlockID, &NumWords))
- return Error("Malformed block record");
-
- const char *BlockName = 0;
- if (Dump) {
- std::cerr << Indent << "<";
- if ((BlockName = GetBlockName(BlockID)))
- std::cerr << BlockName;
- else
- std::cerr << "UnknownBlock" << BlockID;
-
- if (NonSymbolic && BlockName)
- std::cerr << " BlockID=" << BlockID;
-
- std::cerr << " NumWords=" << NumWords
- << " BlockCodeSize=" << Stream.GetAbbrevIDWidth() << ">\n";
- }
-
- SmallVector<uint64_t, 64> Record;
-
- // Read all the records for this block.
- while (1) {
- if (Stream.AtEndOfStream())
- return Error("Premature end of bitstream");
-
- // Read the code for this record.
- unsigned AbbrevID = Stream.ReadCode();
- switch (AbbrevID) {
- case bitc::END_BLOCK: {
- if (Stream.ReadBlockEnd())
- return Error("Error at end of block");
- uint64_t BlockBitEnd = Stream.GetCurrentBitNo();
- BlockStats.NumBits += BlockBitEnd-BlockBitStart;
- if (Dump) {
- std::cerr << Indent << "</";
- if (BlockName)
- std::cerr << BlockName << ">\n";
- else
- std::cerr << "UnknownBlock" << BlockID << ">\n";
- }
- return false;
- }
- case bitc::ENTER_SUBBLOCK: {
- uint64_t SubBlockBitStart = Stream.GetCurrentBitNo();
- if (ParseBlock(Stream, IndentLevel+1))
- return true;
- ++BlockStats.NumSubBlocks;
- uint64_t SubBlockBitEnd = Stream.GetCurrentBitNo();
-
- // Don't include subblock sizes in the size of this block.
- BlockBitStart += SubBlockBitEnd-SubBlockBitStart;
- break;
- }
- case bitc::DEFINE_ABBREV:
- Stream.ReadAbbrevRecord();
- ++BlockStats.NumAbbrevs;
- break;
- default:
- ++BlockStats.NumRecords;
- if (AbbrevID != bitc::UNABBREV_RECORD)
- ++BlockStats.NumAbbreviatedRecords;
-
- Record.clear();
- unsigned Code = Stream.ReadRecord(AbbrevID, Record);
-
- // Increment the # occurrences of this code.
- if (BlockStats.CodeFreq.size() <= Code)
- BlockStats.CodeFreq.resize(Code+1);
- BlockStats.CodeFreq[Code]++;
-
- if (Dump) {
- std::cerr << Indent << " <";
- if (const char *CodeName = GetCodeName(Code, BlockID))
- std::cerr << CodeName;
- else
- std::cerr << "UnknownCode" << Code;
- if (NonSymbolic && GetCodeName(Code, BlockID))
- std::cerr << " codeid=" << Code;
- if (AbbrevID != bitc::UNABBREV_RECORD)
- std::cerr << " abbrevid=" << AbbrevID;
-
- for (unsigned i = 0, e = Record.size(); i != e; ++i)
- std::cerr << " op" << i << "=" << (int64_t)Record[i];
-
- std::cerr << "/>\n";
- }
-
- break;
- }
- }
-}
-
-static void PrintSize(double Bits) {
- std::cerr << Bits << "b/" << Bits/8 << "B/" << Bits/32 << "W";
-}
-
-
-/// AnalyzeBitcode - Analyze the bitcode file specified by InputFilename.
-static int AnalyzeBitcode() {
- // Read the input file.
- MemoryBuffer *Buffer = MemoryBuffer::getFileOrSTDIN(InputFilename.c_str());
-
- if (Buffer == 0)
- return Error("Error reading '" + InputFilename + "'.");
-
- if (Buffer->getBufferSize() & 3)
- return Error("Bitcode stream should be a multiple of 4 bytes in length");
-
- unsigned char *BufPtr = (unsigned char *)Buffer->getBufferStart();
- BitstreamReader Stream(BufPtr, BufPtr+Buffer->getBufferSize());
-
-
- // Read the stream signature.
- char Signature[6];
- Signature[0] = Stream.Read(8);
- Signature[1] = Stream.Read(8);
- Signature[2] = Stream.Read(4);
- Signature[3] = Stream.Read(4);
- Signature[4] = Stream.Read(4);
- Signature[5] = Stream.Read(4);
-
- // Autodetect the file contents, if it is one we know.
- CurStreamType = UnknownBitstream;
- if (Signature[0] == 'B' && Signature[1] == 'C' &&
- Signature[2] == 0x0 && Signature[3] == 0xC &&
- Signature[4] == 0xE && Signature[5] == 0xD)
- CurStreamType = LLVMIRBitstream;
-
- unsigned NumTopBlocks = 0;
-
- // Parse the top-level structure. We only allow blocks at the top-level.
- while (!Stream.AtEndOfStream()) {
- unsigned Code = Stream.ReadCode();
- if (Code != bitc::ENTER_SUBBLOCK)
- return Error("Invalid record at top-level");
-
- if (ParseBlock(Stream, 0))
- return true;
- ++NumTopBlocks;
- }
-
- if (Dump) std::cerr << "\n\n";
-
- uint64_t BufferSizeBits = Buffer->getBufferSize()*8;
- // Print a summary of the read file.
- std::cerr << "Summary of " << InputFilename << ":\n";
- std::cerr << " Total size: ";
- PrintSize(BufferSizeBits);
- std::cerr << "\n";
- std::cerr << " Stream type: ";
- switch (CurStreamType) {
- default: assert(0 && "Unknown bitstream type");
- case UnknownBitstream: std::cerr << "unknown\n"; break;
- case LLVMIRBitstream: std::cerr << "LLVM IR\n"; break;
- }
- std::cerr << " # Toplevel Blocks: " << NumTopBlocks << "\n";
- std::cerr << "\n";
-
- // Emit per-block stats.
- std::cerr << "Per-block Summary:\n";
- for (std::map<unsigned, PerBlockIDStats>::iterator I = BlockIDStats.begin(),
- E = BlockIDStats.end(); I != E; ++I) {
- std::cerr << " Block ID #" << I->first;
- if (const char *BlockName = GetBlockName(I->first))
- std::cerr << " (" << BlockName << ")";
- std::cerr << ":\n";
-
- const PerBlockIDStats &Stats = I->second;
- std::cerr << " Num Instances: " << Stats.NumInstances << "\n";
- std::cerr << " Total Size: ";
- PrintSize(Stats.NumBits);
- std::cerr << "\n";
- std::cerr << " % of file: "
- << Stats.NumBits/(double)BufferSizeBits*100 << "\n";
- if (Stats.NumInstances > 1) {
- std::cerr << " Average Size: ";
- PrintSize(Stats.NumBits/(double)Stats.NumInstances);
- std::cerr << "\n";
- std::cerr << " Tot/Avg SubBlocks: " << Stats.NumSubBlocks << "/"
- << Stats.NumSubBlocks/(double)Stats.NumInstances << "\n";
- std::cerr << " Tot/Avg Abbrevs: " << Stats.NumAbbrevs << "/"
- << Stats.NumAbbrevs/(double)Stats.NumInstances << "\n";
- std::cerr << " Tot/Avg Records: " << Stats.NumRecords << "/"
- << Stats.NumRecords/(double)Stats.NumInstances << "\n";
- } else {
- std::cerr << " Num SubBlocks: " << Stats.NumSubBlocks << "\n";
- std::cerr << " Num Abbrevs: " << Stats.NumAbbrevs << "\n";
- std::cerr << " Num Records: " << Stats.NumRecords << "\n";
- }
- if (Stats.NumRecords)
- std::cerr << " % Abbrev Recs: " << (Stats.NumAbbreviatedRecords/
- (double)Stats.NumRecords)*100 << "\n";
- std::cerr << "\n";
-
- // Print a histogram of the codes we see.
- if (!NoHistogram && !Stats.CodeFreq.empty()) {
- std::vector<std::pair<unsigned, unsigned> > FreqPairs; // <freq,code>
- for (unsigned i = 0, e = Stats.CodeFreq.size(); i != e; ++i)
- if (unsigned Freq = Stats.CodeFreq[i])
- FreqPairs.push_back(std::make_pair(Freq, i));
- std::stable_sort(FreqPairs.begin(), FreqPairs.end());
- std::reverse(FreqPairs.begin(), FreqPairs.end());
-
- std::cerr << "\tCode Histogram:\n";
- for (unsigned i = 0, e = FreqPairs.size(); i != e; ++i) {
- std::cerr << "\t\t" << FreqPairs[i].first << "\t";
- if (const char *CodeName = GetCodeName(FreqPairs[i].second, I->first))
- std::cerr << CodeName << "\n";
- else
- std::cerr << "UnknownCode" << FreqPairs[i].second << "\n";
- }
- std::cerr << "\n";
-
- }
- }
- return 0;
-}
-
-
-int main(int argc, char **argv) {
- llvm_shutdown_obj X; // Call llvm_shutdown() on exit.
- cl::ParseCommandLineOptions(argc, argv, "llvm-bcanalyzer file analyzer\n");
-
- sys::PrintStackTraceOnErrorSignal();
-
- return AnalyzeBitcode();
-}
diff --git a/release_23/tools/llvm-config/Makefile b/release_23/tools/llvm-config/Makefile
deleted file mode 100644
index de89d290353a..000000000000
--- a/release_23/tools/llvm-config/Makefile
+++ /dev/null
@@ -1,87 +0,0 @@
-##===- tools/llvm-config/Makefile --------------------------*- Makefile -*-===##
-#
-# The LLVM Compiler Infrastructure
-#
-# This file is distributed under the University of Illinois Open Source
-# License. See LICENSE.TXT for details.
-#
-##===----------------------------------------------------------------------===##
-
-LEVEL = ../..
-
-EXTRA_DIST = LibDeps.txt FinalLibDeps.txt llvm-config.in.in find-cycles.pl
-REQUIRES_EH := 1
-
-include $(LEVEL)/Makefile.common
-
-# If we don't have Perl, we can't generate the library dependencies upon which
-# llvm-config depends. Therefore, only if we detect perl will we do anything
-# useful.
-ifeq ($(HAVE_PERL),1)
-
-# Combine preprocessor flags (except for -I) and CXX flags.
-SUB_CPPFLAGS = ${CPP.BaseFlags}
-SUB_CFLAGS = ${CPP.BaseFlags} ${C.Flags}
-SUB_CXXFLAGS = ${CPP.BaseFlags} ${CXX.Flags}
-
-# This is blank for now. We need to be careful about adding stuff here:
-# LDFLAGS tend not to be portable, and we don't currently require the
-# user to use libtool when linking against LLVM.
-SUB_LDFLAGS =
-
-FinalLibDeps = $(PROJ_OBJ_DIR)/FinalLibDeps.txt
-LibDeps = $(PROJ_OBJ_DIR)/LibDeps.txt
-LibDepsTemp = $(PROJ_OBJ_DIR)/LibDeps.txt.tmp
-GenLibDeps = $(PROJ_SRC_ROOT)/utils/GenLibDeps.pl
-
-$(LibDepsTemp): $(GenLibDeps) $(LibDir) $(wildcard $(LibDir)/*.a $(LibDir)/*.o)
- $(Echo) "Regenerating LibDeps.txt.tmp"
- $(Verb) $(PERL) $(GenLibDeps) -flat $(LibDir) "$(NM_PATH)" > $(LibDepsTemp)
-
-$(LibDeps): $(LibDepsTemp)
- $(Verb) $(CMP) -s $@ $< || ( $(CP) $< $@ && \
- $(EchoCmd) Updated LibDeps.txt because dependencies changed )
-
-# Find all the cyclic dependencies between various LLVM libraries, so we
-# don't have to process them at runtime.
-$(FinalLibDeps): find-cycles.pl $(LibDeps)
- $(Echo) "Checking for cyclic dependencies between LLVM libraries."
- $(Verb) $(PERL) $< < $(LibDeps) > $@ || rm -f $@
-
-# Rerun our configure substitutions as needed.
-ConfigInIn = $(PROJ_SRC_DIR)/llvm-config.in.in
-llvm-config.in: $(ConfigInIn) $(ConfigStatusScript)
- $(Verb) cd $(PROJ_OBJ_ROOT) ; \
- $(ConfigStatusScript) tools/llvm-config/llvm-config.in
-
-# Build our final script.
-$(ToolDir)/llvm-config: llvm-config.in $(FinalLibDeps)
- $(Echo) "Building llvm-config script."
- $(Verb) $(ECHO) 's,@LLVM_CPPFLAGS@,$(SUB_CPPFLAGS),' > temp.sed
- $(Verb) $(ECHO) 's,@LLVM_CFLAGS@,$(SUB_CFLAGS),' >> temp.sed
- $(Verb) $(ECHO) 's,@LLVM_CXXFLAGS@,$(SUB_CXXFLAGS),' >> temp.sed
- $(Verb) $(ECHO) 's,@LLVM_LDFLAGS@,$(SUB_LDFLAGS),' >> temp.sed
- $(Verb) $(ECHO) 's,@LLVM_BUILDMODE@,$(BuildMode),' >> temp.sed
- $(Verb) $(SED) -f temp.sed < $< > $@
- $(Verb) $(RM) temp.sed
- $(Verb) cat $(FinalLibDeps) >> $@
- $(Verb) chmod +x $@
-
-else
-# We don't have perl, just generate a dummy llvm-config
-$(ToolDir)/llvm-config:
- $(Echo) "Building place holder llvm-config script."
- $(Verb) $(ECHO) 'echo llvm-config: Perl not found so llvm-config could not be generated' >> $@
- $(Verb) chmod +x $@
-
-endif
-# Hook into the standard Makefile rules.
-all-local:: $(ToolDir)/llvm-config
-clean-local::
- $(Verb) $(RM) -f $(ToolDir)/llvm-config llvm-config.in $(FinalLibDeps) \
- $(LibDeps) GenLibDeps.out
-install-local:: all-local
- $(Echo) Installing llvm-config
- $(Verb) $(MKDIR) $(PROJ_bindir)
- $(Verb) $(ScriptInstall) $(ToolDir)/llvm-config $(PROJ_bindir)
-
diff --git a/release_23/tools/llvm-config/find-cycles.pl b/release_23/tools/llvm-config/find-cycles.pl
deleted file mode 100755
index 8156abd3f053..000000000000
--- a/release_23/tools/llvm-config/find-cycles.pl
+++ /dev/null
@@ -1,165 +0,0 @@
-#!/usr/bin/perl
-#
-# Program: find-cycles.pl
-#
-# Synopsis: Given a list of possibly cyclic dependencies, merge all the
-# cycles. This makes it possible to topologically sort the
-# dependencies between different parts of LLVM.
-#
-# Syntax: find-cycles.pl < LibDeps.txt > FinalLibDeps.txt
-#
-# Input: cycmem1: cycmem2 dep1 dep2
-# cycmem2: cycmem1 dep3 dep4
-# boring: dep4
-#
-# Output: cycmem1 cycmem2: dep1 dep2 dep3 dep4
-# boring: dep4
-#
-# This file was written by Eric Kidd, and is placed into the public domain.
-#
-
-use 5.006;
-use strict;
-use warnings;
-
-my %DEPS;
-my @CYCLES;
-sub find_all_cycles;
-
-# Read our dependency information.
-while (<>) {
- chomp;
- my ($module, $dependency_str) = /^\s*([^:]+):\s*(.*)\s*$/;
- die "Malformed data: $_" unless defined $dependency_str;
- my @dependencies = split(/ /, $dependency_str);
- $DEPS{$module} = \@dependencies;
-}
-
-# Partition our raw dependencies into sets of cyclically-connected nodes.
-find_all_cycles();
-
-# Print out the finished cycles, with their dependencies.
-my @output;
-my $cycles_found = 0;
-foreach my $cycle (@CYCLES) {
- my @modules = sort keys %{$cycle};
-
- # Merge the dependencies of all modules in this cycle.
- my %dependencies;
- foreach my $module (@modules) {
- @dependencies{@{$DEPS{$module}}} = 1;
- }
-
- # Prune the known cyclic dependencies.
- foreach my $module (@modules) {
- delete $dependencies{$module};
- }
-
- # Warn about possible linker problems.
- my @archives = grep(/\.a$/, @modules);
- if (@archives > 1) {
- $cycles_found = $cycles_found + 1;
- print STDERR "find-cycles.pl: Circular dependency between *.a files:\n";
- print STDERR "find-cycles.pl: ", join(' ', @archives), "\n";
- push @modules, @archives; # WORKAROUND: Duplicate *.a files. Ick.
- }
-
- # Add to our output. (@modules is already as sorted as we need it to be.)
- push @output, (join(' ', @modules) . ': ' .
- join(' ', sort keys %dependencies) . "\n");
-}
-print sort @output;
-
-exit $cycles_found;
-
-#==========================================================================
-# Depedency Cycle Support
-#==========================================================================
-# For now, we have cycles in our dependency graph. Ideally, each cycle
-# would be collapsed down to a single *.a file, saving us all this work.
-#
-# To understand this code, you'll need a working knowledge of Perl 5,
-# and possibly some quality time with 'man perlref'.
-
-my %SEEN;
-my %CYCLES;
-sub find_cycles ($@);
-sub found_cycles ($@);
-
-sub find_all_cycles {
- # Find all multi-item cycles.
- my @modules = sort keys %DEPS;
- foreach my $module (@modules) { find_cycles($module); }
-
- # Build fake one-item "cycles" for the remaining modules, so we can
- # treat them uniformly.
- foreach my $module (@modules) {
- unless (defined $CYCLES{$module}) {
- my %cycle = ($module, 1);
- $CYCLES{$module} = \%cycle;
- }
- }
-
- # Find all our unique cycles. We have to do this the hard way because
- # we apparently can't store hash references as hash keys without making
- # 'strict refs' sad.
- my %seen;
- foreach my $cycle (values %CYCLES) {
- unless ($seen{$cycle}) {
- $seen{$cycle} = 1;
- push @CYCLES, $cycle;
- }
- }
-}
-
-# Walk through our graph depth-first (keeping a trail in @path), and report
-# any cycles we find.
-sub find_cycles ($@) {
- my ($module, @path) = @_;
- if (str_in_list($module, @path)) {
- found_cycle($module, @path);
- } else {
- return if defined $SEEN{$module};
- $SEEN{$module} = 1;
- foreach my $dep (@{$DEPS{$module}}) {
- find_cycles($dep, @path, $module);
- }
- }
-}
-
-# Give a cycle, attempt to merge it with pre-existing cycle data.
-sub found_cycle ($@) {
- my ($module, @path) = @_;
-
- # Pop any modules which aren't part of our cycle.
- while ($path[0] ne $module) { shift @path; }
- #print join("->", @path, $module) . "\n";
-
- # Collect the modules in our cycle into a hash.
- my %cycle;
- foreach my $item (@path) {
- $cycle{$item} = 1;
- if (defined $CYCLES{$item}) {
- # Looks like we intersect with an existing cycle, so merge
- # all those in, too.
- foreach my $old_item (keys %{$CYCLES{$item}}) {
- $cycle{$old_item} = 1;
- }
- }
- }
-
- # Update our global cycle table.
- my $cycle_ref = \%cycle;
- foreach my $item (keys %cycle) {
- $CYCLES{$item} = $cycle_ref;
- }
- #print join(":", sort keys %cycle) . "\n";
-}
-
-sub str_in_list ($@) {
- my ($str, @list) = @_;
- foreach my $item (@list) {
- return 1 if ($item eq $str);
- }
- return 0;
-}
diff --git a/release_23/tools/llvm-config/llvm-config.in.in b/release_23/tools/llvm-config/llvm-config.in.in
deleted file mode 100644
index 296ba4266d00..000000000000
--- a/release_23/tools/llvm-config/llvm-config.in.in
+++ /dev/null
@@ -1,451 +0,0 @@
-#!@PERL@
-##===- tools/llvm-config ---------------------------------------*- perl -*-===##
-#
-# The LLVM Compiler Infrastructure
-#
-# This file is distributed under the University of Illinois Open Source
-# License. See LICENSE.TXT for details.
-#
-##===----------------------------------------------------------------------===##
-#
-# Synopsis: Prints out compiler options needed to build against an installed
-# copy of LLVM.
-#
-# Syntax: llvm-config OPTIONS... [COMPONENTS...]
-#
-##===----------------------------------------------------------------------===##
-
-use 5.006;
-use strict;
-use warnings;
-
-#---- begin autoconf values ----
-my $PACKAGE_NAME = q{@PACKAGE_NAME@};
-my $VERSION = q{@PACKAGE_VERSION@};
-my $PREFIX = q{@LLVM_PREFIX@};
-my $LLVM_CONFIGTIME = q{@LLVM_CONFIGTIME@};
-my $LLVM_SRC_ROOT = q{@abs_top_srcdir@};
-my $LLVM_OBJ_ROOT = q{@abs_top_builddir@};
-my $LLVM_ON_WIN32 = q{@LLVM_ON_WIN32@};
-my $LLVM_ON_UNIX = q{@LLVM_ON_UNIX@};
-my $LLVMGCCDIR = q{@LLVMGCCDIR@};
-my $LLVMGCC = q{@LLVMGCC@};
-my $LLVMGXX = q{@LLVMGXX@};
-my $LLVMGCC_VERSION = q{@LLVMGCC_VERSION@};
-my $LLVMGCC_MAJVERS = q{@LLVMGCC_MAJVERS@};
-my $ENDIAN = q{@ENDIAN@};
-my $SHLIBEXT = q{@SHLIBEXT@};
-my $EXEEXT = q{@EXEEXT@};
-my $OS = q{@OS@};
-my $ARCH = lc(q{@ARCH@});
-my $TARGET_TRIPLE = q{@target@};
-my $TARGETS_TO_BUILD = q{@TARGETS_TO_BUILD@};
-my $TARGET_HAS_JIT = q{@TARGET_HAS_JIT@};
-my @TARGETS_BUILT = map { lc($_) } qw{@TARGETS_TO_BUILD@};
-#---- end autoconf values ----
-
-# Must pretend x86_64 architecture is really x86, otherwise the native backend
-# won't get linked in.
-$ARCH = "x86" if $ARCH eq "x86_64";
-
-#---- begin Makefile values ----
-my $CPPFLAGS = q{@LLVM_CPPFLAGS@};
-my $CFLAGS = q{@LLVM_CFLAGS@};
-my $CXXFLAGS = q{@LLVM_CXXFLAGS@};
-my $LDFLAGS = q{@LLVM_LDFLAGS@};
-my $SYSTEM_LIBS = q{@LIBS@};
-my $LLVM_BUILDMODE = q{@LLVM_BUILDMODE@};
-#---- end Makefile values ----
-
-# Figure out where llvm-config is being run from. Primarily, we care if it has
-# been installed, or is running from the build directory, which changes the
-# locations of some files.
-
-# Convert the current executable name into its directory (e.g. ".").
-my ($RUN_DIR) = ($0 =~ /^(.*)\/.*$/);
-
-# Find the unix pwd program: we don't want to use the bash builtin, as it does
-# not look through symlinks etc.
-my $PWD = `which pwd`;
-chomp($PWD);
-$PWD = "pwd" if (!-e $PWD);
-
-# Turn the directory into an absolute directory on the file system, also pop up
-# from "bin" into the build or prefix dir.
-my $ABS_RUN_DIR = `cd $RUN_DIR/..; $PWD`;
-chomp($ABS_RUN_DIR);
-
-# Compute the absolute object directory build, e.g. "foo/llvm/Debug".
-my $ABS_OBJ_ROOT = "$LLVM_OBJ_ROOT/$LLVM_BUILDMODE";
-$ABS_OBJ_ROOT = `cd $ABS_OBJ_ROOT; $PWD` if (-d $ABS_OBJ_ROOT);
-chomp($ABS_OBJ_ROOT);
-
-my $INCLUDEDIR = "$ABS_RUN_DIR/include";
-my $LIBDIR = "$ABS_RUN_DIR/lib";
-my $BINDIR = "$ABS_RUN_DIR/bin";
-if ($ABS_RUN_DIR eq $ABS_OBJ_ROOT) {
- # If we are running out of the build directory, the include dir is in the
- # srcdir.
- $INCLUDEDIR = "$LLVM_SRC_ROOT/include";
-} else {
- # If installed, ignore the prefix the tree was configured with, use the
- # current prefix.
- $PREFIX = $ABS_RUN_DIR;
-}
-
-sub usage;
-sub fix_library_names (@);
-sub fix_library_files (@);
-sub expand_dependencies (@);
-sub name_map_entries;
-
-# Parse our command-line arguments.
-usage if @ARGV == 0;
-my @components;
-my $has_opt = 0;
-my $want_libs = 0;
-my $want_libnames = 0;
-my $want_libfiles = 0;
-my $want_components = 0;
-foreach my $arg (@ARGV) {
- if ($arg =~ /^-/) {
- if ($arg eq "--version") {
- $has_opt = 1; print "$VERSION\n";
- } elsif ($arg eq "--prefix") {
- $has_opt = 1; print "$PREFIX\n";
- } elsif ($arg eq "--bindir") {
- $has_opt = 1; print "$BINDIR\n";
- } elsif ($arg eq "--includedir") {
- $has_opt = 1; print "$INCLUDEDIR\n";
- } elsif ($arg eq "--libdir") {
- $has_opt = 1; print "$LIBDIR\n";
- } elsif ($arg eq "--cppflags") {
- $has_opt = 1; print "-I$INCLUDEDIR $CPPFLAGS\n";
- } elsif ($arg eq "--cflags") {
- $has_opt = 1; print "-I$INCLUDEDIR $CFLAGS\n";
- } elsif ($arg eq "--cxxflags") {
- $has_opt = 1; print "-I$INCLUDEDIR $CXXFLAGS\n";
- } elsif ($arg eq "--ldflags") {
- $has_opt = 1; print "-L$LIBDIR $LDFLAGS $SYSTEM_LIBS\n";
- } elsif ($arg eq "--libs") {
- $has_opt = 1; $want_libs = 1;
- } elsif ($arg eq "--libnames") {
- $has_opt = 1; $want_libnames = 1;
- } elsif ($arg eq "--libfiles") {
- $has_opt = 1; $want_libfiles = 1;
- } elsif ($arg eq "--components") {
- $has_opt = 1; print join(' ', name_map_entries), "\n";
- } elsif ($arg eq "--targets-built") {
- $has_opt = 1; print join(' ', @TARGETS_BUILT), "\n";
- } elsif ($arg eq "--host-target") {
- $has_opt = 1; print "$TARGET_TRIPLE\n";
- } elsif ($arg eq "--build-mode") {
- $has_opt = 1; print "$LLVM_BUILDMODE\n";
- } elsif ($arg eq "--obj-root") {
- $has_opt = 1; print `cd $LLVM_OBJ_ROOT/; $PWD`;
- } elsif ($arg eq "--src-root") {
- $has_opt = 1; print `cd $LLVM_SRC_ROOT/; $PWD`;
- } else {
- usage();
- }
- } else {
- push @components, $arg;
- }
-}
-
-# If no options were specified, fail.
-usage unless $has_opt;
-
-# If no components were specified, default to 'all'.
-if (@components == 0) {
- push @components, 'all';
-}
-
-# Force component names to lower case.
-@components = map lc, @components;
-
-# Handle any arguments which require building our dependency graph.
-if ($want_libs || $want_libnames || $want_libfiles) {
- my @libs = expand_dependencies(@components);
- print join(' ', fix_library_names(@libs)), "\n" if ($want_libs);
- print join(' ', @libs), "\n" if ($want_libnames);
- print join(' ', fix_library_files(@libs)), "\n" if ($want_libfiles);
-}
-
-exit 0;
-
-#==========================================================================
-# Support Routines
-#==========================================================================
-
-sub usage {
- print STDERR <<__EOD__;
-Usage: llvm-config <OPTION>... [<COMPONENT>...]
-
-Get various configuration information needed to compile programs which use
-LLVM. Typically called from 'configure' scripts. Examples:
- llvm-config --cxxflags
- llvm-config --ldflags
- llvm-config --libs engine bcreader scalaropts
-
-Options:
- --version Print LLVM version.
- --prefix Print the installation prefix.
- --src-root Print the source root LLVM was built from.
- --obj-root Print the object root used to build LLVM.
- --bindir Directory containing LLVM executables.
- --includedir Directory containing LLVM headers.
- --libdir Directory containing LLVM libraries.
- --cppflags C preprocessor flags for files that include LLVM headers.
- --cflags C compiler flags for files that include LLVM headers.
- --cxxflags C++ compiler flags for files that include LLVM headers.
- --ldflags Print Linker flags.
- --libs Libraries needed to link against LLVM components.
- --libnames Bare library names for in-tree builds.
- --libfiles Fully qualified library filenames for makefile depends.
- --components List of all possible components.
- --targets-built List of all targets currently built.
- --host-target Target triple used to configure LLVM.
- --build-mode Print build mode of LLVM tree (e.g. Debug or Release).
-Typical components:
- all All LLVM libraries (default).
- backend Either a native backend or the C backend.
- engine Either a native JIT or a bytecode interpreter.
-__EOD__
- exit(1);
-}
-
-# Use -lfoo instead of libfoo.a whenever possible, and add directories to
-# files which can't be found using -L.
-sub fix_library_names (@) {
- my @libs = @_;
- my @result;
- foreach my $lib (@libs) {
- # Transform the bare library name appropriately.
- my ($basename) = ($lib =~ /^lib([^.]*)\.a/);
- if (defined $basename) {
- push @result, "-l$basename";
- } else {
- push @result, "$LIBDIR/$lib";
- }
- }
- return @result;
-}
-
-# Turn the list of libraries into a list of files.
-sub fix_library_files(@) {
- my @libs = @_;
- my @result;
- foreach my $lib (@libs) {
- # Transform the bare library name into a filename.
- push @result, "$LIBDIR/$lib";
- }
- return @result;
-}
-
-#==========================================================================
-# Library Dependency Analysis
-#==========================================================================
-# Given a few human-readable library names, find all their dependencies
-# and sort them into an order which the linker will like. If we packed
-# our libraries into fewer archives, we could make the linker do much
-# of this work for us.
-#
-# Libraries have two different types of names in this code: Human-friendly
-# "component" names entered on the command-line, and the raw file names
-# we use internally (and ultimately pass to the linker).
-#
-# To understand this code, you'll need a working knowledge of Perl 5,
-# and possibly some quality time with 'man perlref'.
-
-sub load_dependencies;
-sub build_name_map;
-sub have_native_backend;
-sub find_best_engine;
-sub expand_names (@);
-sub find_all_required_sets (@);
-sub find_all_required_sets_helper ($$@);
-
-# Each "set" contains one or more libraries which must be included as a
-# group (due to cyclic dependencies). Sets are represented as a Perl array
-# reference pointing to a list of internal library names.
-my @SETS;
-
-# Various mapping tables.
-my %LIB_TO_SET_MAP; # Maps internal library names to their sets.
-my %SET_DEPS; # Maps sets to a list of libraries they depend on.
-my %NAME_MAP; # Maps human-entered names to internal names.
-
-# Have our dependencies been loaded yet?
-my $DEPENDENCIES_LOADED = 0;
-
-# Given a list of human-friendly component names, translate them into a
-# complete set of linker arguments.
-sub expand_dependencies (@) {
- my @libs = @_;
- load_dependencies;
- my @required_sets = find_all_required_sets(expand_names(@libs));
- my @sorted_sets = topologically_sort_sets(@required_sets);
-
- # Expand the library sets into libraries.
- my @result;
- foreach my $set (@sorted_sets) { push @result, @{$set}; }
- return @result;
-}
-
-# Load in the raw dependency data stored at the end of this file.
-sub load_dependencies {
- return if $DEPENDENCIES_LOADED;
- $DEPENDENCIES_LOADED = 1;
- while (<DATA>) {
- # Parse our line.
- my ($libs, $deps) = /^\s*([^:]+):\s*(.*)\s*$/;
- die "Malformed dependency data" unless defined $deps;
- my @libs = split(' ', $libs);
- my @deps = split(' ', $deps);
-
- # Record our dependency data.
- my $set = \@libs;
- push @SETS, $set;
- foreach my $lib (@libs) { $LIB_TO_SET_MAP{$lib} = $set; }
- $SET_DEPS{$set} = \@deps;
- }
- build_name_map;
-}
-
-# Build a map converting human-friendly component names into internal
-# library names.
-sub build_name_map {
- # Add entries for all the actual libraries.
- foreach my $set (@SETS) {
- foreach my $lib (sort @$set) {
- my $short_name = $lib;
- $short_name =~ s/^(lib)?LLVM([^.]*)\..*$/$2/;
- $short_name =~ tr/A-Z/a-z/;
- $NAME_MAP{$short_name} = [$lib];
- }
- }
-
- # Add virtual entries.
- $NAME_MAP{'native'} = have_native_backend() ? [$ARCH] : [];
- $NAME_MAP{'backend'} = have_native_backend() ? ['native'] : ['cbackend'];
- $NAME_MAP{'engine'} = find_best_engine;
- $NAME_MAP{'all'} = [name_map_entries]; # Must be last.
-}
-
-# Return true if we have a native backend to use.
-sub have_native_backend {
- my %BUILT;
- foreach my $target (@TARGETS_BUILT) { $BUILT{$target} = 1; }
- return defined $NAME_MAP{$ARCH} && defined $BUILT{$ARCH};
-}
-
-# Find a working subclass of ExecutionEngine for this platform.
-sub find_best_engine {
- if (have_native_backend && $TARGET_HAS_JIT) {
- return ['jit', 'native'];
- } else {
- return ['interpreter'];
- }
-}
-
-# Get all the human-friendly component names.
-sub name_map_entries {
- load_dependencies;
- return sort keys %NAME_MAP;
-}
-
-# Map human-readable names to internal library names.
-sub expand_names (@) {
- my @names = @_;
- my @result;
- foreach my $name (@names) {
- if (defined $LIB_TO_SET_MAP{$name}) {
- # We've hit bottom: An actual library name.
- push @result, $name;
- } elsif (defined $NAME_MAP{$name}) {
- # We've found a short name to expand.
- push @result, expand_names(@{$NAME_MAP{$name}});
- } else {
- print STDERR "llvm-config: unknown component name: $name\n";
- exit(1);
- }
- }
- return @result;
-}
-
-# Given a list of internal library names, return all sets of libraries which
-# will need to be included by the linker (in no particular order).
-sub find_all_required_sets (@) {
- my @libs = @_;
- my %sets_added;
- my @result;
- find_all_required_sets_helper(\%sets_added, \@result, @libs);
- return @result;
-}
-
-# Recursive closures are pretty broken in Perl, so we're going to separate
-# this function from find_all_required_sets and pass in the state we need
-# manually, as references. Yes, this is fairly unpleasant.
-sub find_all_required_sets_helper ($$@) {
- my ($sets_added, $result, @libs) = @_;
- foreach my $lib (@libs) {
- my $set = $LIB_TO_SET_MAP{$lib};
- next if defined $$sets_added{$set};
- $$sets_added{$set} = 1;
- push @$result, $set;
- find_all_required_sets_helper($sets_added, $result, @{$SET_DEPS{$set}});
- }
-}
-
-# Print a list of sets, with a label. Used for debugging.
-sub print_sets ($@) {
- my ($label, @sets) = @_;
- my @output;
- foreach my $set (@sets) { push @output, join(',', @$set); }
- print "$label: ", join(';', @output), "\n";
-}
-
-# Returns true if $lib is a key in $added.
-sub has_lib_been_added ($$) {
- my ($added, $lib) = @_;
- return defined $$added{$LIB_TO_SET_MAP{$lib}};
-}
-
-# Returns true if all the dependencies of $set appear in $added.
-sub have_all_deps_been_added ($$) {
- my ($added, $set) = @_;
- #print_sets(" Checking", $set);
- #print_sets(" Wants", $SET_DEPS{$set});
- foreach my $lib (@{$SET_DEPS{$set}}) {
- return 0 unless has_lib_been_added($added, $lib);
- }
- return 1;
-}
-
-# Given a list of sets, topologically sort them using dependencies.
-sub topologically_sort_sets (@) {
- my @sets = @_;
- my %added;
- my @result;
- SCAN: while (@sets) { # We'll delete items from @sets as we go.
- #print_sets("So far", reverse(@result));
- #print_sets("Remaining", @sets);
- for (my $i = 0; $i < @sets; ++$i) {
- my $set = $sets[$i];
- if (have_all_deps_been_added(\%added, $set)) {
- push @result, $set;
- $added{$set} = 1;
- #print "Removing $i.\n";
- splice(@sets, $i, 1);
- next SCAN; # Restart our scan.
- }
- }
- die "Can't find a library with no dependencies";
- }
- return reverse(@result);
-}
-
-# Our library dependency data will be added after the '__END__' token, and will
-# be read through the magic <DATA> filehandle.
-__END__
diff --git a/release_23/tools/llvm-db/CLICommand.h b/release_23/tools/llvm-db/CLICommand.h
deleted file mode 100644
index 0beec91eda0c..000000000000
--- a/release_23/tools/llvm-db/CLICommand.h
+++ /dev/null
@@ -1,111 +0,0 @@
-//===- CLICommand.h - Classes used to represent commands --------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines a small class hierarchy used to represent the various types
-// of commands in the CLI debugger front-end.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef CLICOMMAND_H
-#define CLICOMMAND_H
-
-#include <string>
-#include <vector>
-#include <cassert>
-
-namespace llvm {
- class CLIDebugger;
-
- /// CLICommand - Base class of the hierarchy, used to provide the abstract
- /// interface common to all commands.
- ///
- class CLICommand {
- /// ShortHelp, LongHelp - The short and long helps strings printed for the
- /// command. The ShortHelp string should be a single line of text without a
- /// newline. The LongHelp string should be a full description with
- /// terminating newline.
- std::string ShortHelp, LongHelp;
-
- /// RefCount - This contains the number of entries in the CLIDebugger
- /// CommandTable that points to this command.
- unsigned RefCount;
-
- /// OptionNames - This contains a list of names for the option. Keeping
- /// track of this is done just to make the help output more helpful.
- ///
- std::vector<std::string> OptionNames;
- public:
- CLICommand(const std::string &SH, const std::string &LH)
- : ShortHelp(SH), LongHelp(LH), RefCount(0) {}
-
- virtual ~CLICommand() {}
-
- /// addRef/dropRef - Implement a simple reference counting scheme to make
- /// sure we delete commands that are no longer used.
- void addRef() { ++RefCount; }
- void dropRef() {
- if (--RefCount == 0) delete this;
- }
-
- /// getPrimaryOptionName - Return the first name the option was added under.
- /// This is the name we report for the option in the help output.
- std::string getPrimaryOptionName() const {
- return OptionNames.empty() ? "" : OptionNames[0];
- }
-
- /// getOptionName - Return all of the names the option is registered as.
- ///
- const std::vector<std::string> &getOptionNames() const {
- return OptionNames;
- }
-
- /// addOptionName - Add a name that this option is known as.
- ///
- void addOptionName(const std::string &Name) {
- OptionNames.push_back(Name);
- }
-
- /// removeOptionName - Eliminate one of the names for this option.
- ///
- void removeOptionName(const std::string &Name) {
- unsigned i = 0;
- for (; OptionNames[i] != Name; ++i)
- assert(i+1 < OptionNames.size() && "Didn't find option name!");
- OptionNames.erase(OptionNames.begin()+i);
- }
-
-
- /// getShortHelp - Return the short help string for this command.
- ///
- const std::string &getShortHelp() { return ShortHelp; }
-
- /// getLongHelp - Return the long help string for this command, if it
- /// exists.
- const std::string &getLongHelp() { return LongHelp; }
-
- virtual void runCommand(CLIDebugger &D, std::string &Arguments) = 0;
- };
-
- /// BuiltinCLICommand - This class represents commands that are built directly
- /// into the debugger.
- class BuiltinCLICommand : public CLICommand {
- // Impl - Pointer to the method that implements the command
- void (CLIDebugger::*Impl)(std::string&);
- public:
- BuiltinCLICommand(const std::string &ShortHelp, const std::string &LongHelp,
- void (CLIDebugger::*impl)(std::string&))
- : CLICommand(ShortHelp, LongHelp), Impl(impl) {}
-
- void runCommand(CLIDebugger &D, std::string &Arguments) {
- (D.*Impl)(Arguments);
- }
- };
-}
-
-#endif
diff --git a/release_23/tools/llvm-db/CLIDebugger.cpp b/release_23/tools/llvm-db/CLIDebugger.cpp
deleted file mode 100644
index 1d2a8387a9c7..000000000000
--- a/release_23/tools/llvm-db/CLIDebugger.cpp
+++ /dev/null
@@ -1,308 +0,0 @@
-//===-- CLIDebugger.cpp - Command Line Interface to the Debugger ----------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains the main implementation of the Command Line Interface to
-// the debugger.
-//
-//===----------------------------------------------------------------------===//
-
-#include "CLIDebugger.h"
-#include "CLICommand.h"
-#include "llvm/Debugger/SourceFile.h"
-#include "llvm/ADT/StringExtras.h"
-#include <iostream>
-using namespace llvm;
-
-/// CLIDebugger constructor - This initializes the debugger to its default
-/// state, and initializes the command table.
-///
-CLIDebugger::CLIDebugger()
- : TheProgramInfo(0), TheRuntimeInfo(0), Prompt("(llvm-db) "), ListSize(10) {
- // Initialize instance variables
- CurrentFile = 0;
- LineListedStart = 1;
- LineListedEnd = 1;
- LastCurrentFrame = 0;
- CurrentLanguage = 0;
-
- CLICommand *C;
- //===--------------------------------------------------------------------===//
- // Program startup and shutdown options
- //
- addCommand("file", new BuiltinCLICommand(
- "Use specified file as the program to be debugged",
- "The debugger looks in the current directory and the program $PATH for the"
- " specified LLVM program. It then unloads the currently loaded program and"
- " loads the specified program.\n",
- &CLIDebugger::fileCommand));
-
- addCommand("create", new BuiltinCLICommand(
- "Start the program, halting its execution in main",
- "This command creates an instance of the current program, but stops"
- "\nexecution immediately.\n",
- &CLIDebugger::createCommand));
-
- addCommand("kill", new BuiltinCLICommand(
- "Kills the execution of the current program being debugged", "",
- &CLIDebugger::killCommand));
-
- addCommand("quit", new BuiltinCLICommand(
- "Exit the debugger", "",
- &CLIDebugger::quitCommand));
-
- //===--------------------------------------------------------------------===//
- // Program execution commands
- //
- addCommand("run", C = new BuiltinCLICommand(
- "Start the program running from the beginning", "",
- &CLIDebugger::runCommand));
- addCommand("r", C);
-
- addCommand("cont", C = new BuiltinCLICommand(
- "Continue program being debugged until the next stop point", "",
- &CLIDebugger::contCommand));
- addCommand("c", C); addCommand("fg", C);
-
- addCommand("step", C = new BuiltinCLICommand(
- "Step program until it reaches a new source line", "",
- &CLIDebugger::stepCommand));
- addCommand("s", C);
-
- addCommand("next", C = new BuiltinCLICommand(
- "Step program until it reaches a new source line, stepping over calls", "",
- &CLIDebugger::nextCommand));
- addCommand("n", C);
-
- addCommand("finish", new BuiltinCLICommand(
- "Execute until the selected stack frame returns",
- "Upon return, the value returned is printed and put in the value history.\n",
- &CLIDebugger::finishCommand));
-
- //===--------------------------------------------------------------------===//
- // Stack frame commands
- //
- addCommand("backtrace", C = new BuiltinCLICommand(
- "Print backtrace of all stack frames, or innermost COUNT frames",
- "FIXME: describe. Takes 'n', '-n' or 'full'\n",
- &CLIDebugger::backtraceCommand));
- addCommand("bt", C);
-
- addCommand("up", new BuiltinCLICommand(
- "Select and print stack frame that called this one",
- "An argument says how many frames up to go.\n",
- &CLIDebugger::upCommand));
-
- addCommand("down", new BuiltinCLICommand(
- "Select and print stack frame called by this one",
- "An argument says how many frames down go.\n",
- &CLIDebugger::downCommand));
-
- addCommand("frame", C = new BuiltinCLICommand(
- "Select and print a stack frame",
- "With no argument, print the selected stack frame. (See also 'info frame').\n"
- "An argument specifies the frame to select.\n",
- &CLIDebugger::frameCommand));
- addCommand("f", C);
-
- //===--------------------------------------------------------------------===//
- // Breakpoint related commands
- //
- addCommand("break", C = new BuiltinCLICommand(
- "Set breakpoint at specified line or function",
- "FIXME: describe.\n",
- &CLIDebugger::breakCommand));
- addCommand("b", C);
-
-
- //===--------------------------------------------------------------------===//
- // Miscellaneous commands
- //
- addCommand("info", new BuiltinCLICommand(
- "Generic command for showing things about the program being debugged",
- "info functions: display information about functions in the program.\ninfo"
- " source : display information about the current source file.\ninfo source"
- "s : Display source file names for the program\ninfo target : print status"
- " of inferior process\n",
- &CLIDebugger::infoCommand));
-
- addCommand("list", C = new BuiltinCLICommand(
- "List specified function or line",
- "FIXME: document\n",
- &CLIDebugger::listCommand));
- addCommand("l", C);
-
- addCommand("set", new BuiltinCLICommand(
- "Change program or debugger variable",
- "FIXME: document\n",
- &CLIDebugger::setCommand));
-
- addCommand("show", new BuiltinCLICommand(
- "Generic command for showing things about the debugger",
- "FIXME: document\n",
- &CLIDebugger::showCommand));
-
- addCommand("help", C = new BuiltinCLICommand(
- "Prints information about available commands", "",
- &CLIDebugger::helpCommand));
- addCommand("h", C);
-}
-
-
-/// addCommand - Add a command to the CommandTable, potentially displacing a
-/// preexisting command.
-void CLIDebugger::addCommand(const std::string &Option, CLICommand *Cmd) {
- assert(Cmd && "Cannot set a null command!");
- CLICommand *&CS = CommandTable[Option];
- if (CS == Cmd) return; // noop
-
- // If we already have a command, decrement the command's reference count.
- if (CS) {
- CS->removeOptionName(Option);
- CS->dropRef();
- }
- CS = Cmd;
-
- // Remember that we are using this command.
- Cmd->addRef();
- Cmd->addOptionName(Option);
-}
-
-static bool isValidPrefix(const std::string &Prefix, const std::string &Option){
- return Prefix.size() <= Option.size() &&
- Prefix == std::string(Option.begin(), Option.begin()+Prefix.size());
-}
-
-/// getCommand - This looks up the specified command using a fuzzy match.
-/// If the string exactly matches a command or is an unambiguous prefix of a
-/// command, it returns the command. Otherwise it throws an exception
-/// indicating the possible ambiguous choices.
-CLICommand *CLIDebugger::getCommand(const std::string &Command) {
-
- // Look up the command in the table.
- std::map<std::string, CLICommand*>::iterator CI =
- CommandTable.lower_bound(Command);
-
- if (Command == "") {
- throw "Null command should not get here!";
- } else if (CI == CommandTable.end() ||
- !isValidPrefix(Command, CI->first)) {
- // If this command has no relation to anything in the command table,
- // print the error message.
- throw "Unknown command: '" + Command +
- "'. Use 'help' for list of commands.";
- } else if (CI->first == Command) {
- // We have an exact match on the command
- return CI->second;
- } else {
- // Otherwise, we have a prefix match. Check to see if this is
- // unambiguous, and if so, run it.
- std::map<std::string, CLICommand*>::iterator CI2 = CI;
-
- // If the next command is a valid completion of this one, we are
- // ambiguous.
- if (++CI2 != CommandTable.end() && isValidPrefix(Command, CI2->first)) {
- std::string ErrorMsg =
- "Ambiguous command '" + Command + "'. Options: " + CI->first;
- for (++CI; CI != CommandTable.end() &&
- isValidPrefix(Command, CI->first); ++CI)
- ErrorMsg += ", " + CI->first;
- throw ErrorMsg;
- } else {
- // It's an unambiguous prefix of a command, use it.
- return CI->second;
- }
- }
-}
-
-
-/// run - Start the debugger, returning when the user exits the debugger. This
-/// starts the main event loop of the CLI debugger.
-///
-int CLIDebugger::run() {
- std::string Command;
- std::cout << Prompt;
-
- // Keep track of the last command issued, so that we can reissue it if the
- // user hits enter as the command.
- CLICommand *LastCommand = 0;
- std::string LastArgs;
-
- // Continue reading commands until the end of file.
- while (getline(std::cin, Command)) {
- std::string Arguments = Command;
-
- // Split off the command from the arguments to the command.
- Command = getToken(Arguments, " \t\n\v\f\r\\/;.*&");
-
- try {
- CLICommand *CurCommand;
-
- if (Command == "") {
- CurCommand = LastCommand;
- Arguments = LastArgs;
- } else {
- CurCommand = getCommand(Command);
- }
-
- // Save the command we are running in case the user wants us to repeat it
- // next time.
- LastCommand = CurCommand;
- LastArgs = Arguments;
-
- // Finally, execute the command.
- if (CurCommand)
- CurCommand->runCommand(*this, Arguments);
-
- } catch (int RetVal) {
- // The quit command exits the command loop by throwing an integer return
- // code.
- return RetVal;
- } catch (const std::string &Error) {
- std::cout << "Error: " << Error << "\n";
- } catch (const char *Error) {
- std::cout << "Error: " << Error << "\n";
- } catch (const NonErrorException &E) {
- std::cout << E.getMessage() << "\n";
- } catch (...) {
- std::cout << "ERROR: Debugger caught unexpected exception!\n";
- // Attempt to continue.
- }
-
- // Write the prompt to get the next bit of user input
- std::cout << Prompt;
- }
-
- return 0;
-}
-
-
-/// askYesNo - Ask the user a question, and demand a yes/no response. If
-/// the user says yes, return true.
-///
-bool CLIDebugger::askYesNo(const std::string &Message) const {
- std::string Answer;
- std::cout << Message << " (y or n) " << std::flush;
- while (getline(std::cin, Answer)) {
- std::string Val = getToken(Answer);
- if (getToken(Answer).empty()) {
- if (Val == "yes" || Val == "y" || Val == "YES" || Val == "Y" ||
- Val == "Yes")
- return true;
- if (Val == "no" || Val == "n" || Val == "NO" || Val == "N" ||
- Val == "No")
- return false;
- }
-
- std::cout << "Please answer y or n.\n" << Message << " (y or n) "
- << std::flush;
- }
-
- // Ran out of input?
- return false;
-}
diff --git a/release_23/tools/llvm-db/CLIDebugger.h b/release_23/tools/llvm-db/CLIDebugger.h
deleted file mode 100644
index 56ea14dfbcfd..000000000000
--- a/release_23/tools/llvm-db/CLIDebugger.h
+++ /dev/null
@@ -1,205 +0,0 @@
-//===- CLIDebugger.h - LLVM Command Line Interface Debugger -----*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines the CLIDebugger class, which implements a command line
-// interface to the LLVM Debugger library.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef CLIDEBUGGER_H
-#define CLIDEBUGGER_H
-
-#include "llvm/Debugger/Debugger.h"
-#include <map>
-
-namespace llvm {
- class CLICommand;
- class SourceFile;
- class SourceLanguage;
- class ProgramInfo;
- class RuntimeInfo;
-
- /// CLIDebugger - This class implements the command line interface for the
- /// LLVM debugger.
- class CLIDebugger {
- /// Dbg - The low-level LLVM debugger object that we use to do our dirty
- /// work.
- Debugger Dbg;
-
- /// CommandTable - This table contains a mapping from command names to the
- /// CLICommand object that implements the command.
- std::map<std::string, CLICommand*> CommandTable;
-
- //===------------------------------------------------------------------===//
- // Data related to the program that is currently loaded. Note that the Dbg
- // variable also captures some information about the loaded program. This
- // pointer is non-null iff Dbg.isProgramLoaded() is true.
- //
- ProgramInfo *TheProgramInfo;
-
- //===------------------------------------------------------------------===//
- // Data related to the program that is currently executing, but has stopped.
- // Note that the Dbg variable also captures some information about the
- // loaded program. This pointer is non-null iff Dbg.isProgramRunning() is
- // true.
- //
- RuntimeInfo *TheRuntimeInfo;
-
- /// LastCurrentFrame - This variable holds the Frame ID of the top-level
- /// stack frame from the last time that the program was executed. We keep
- /// this because we only want to print the source location when the current
- /// function changes.
- void *LastCurrentFrame;
-
- //===------------------------------------------------------------------===//
- // Data directly exposed through the debugger prompt
- //
- std::string Prompt; // set prompt, show prompt
- unsigned ListSize; // set listsize, show listsize
-
- //===------------------------------------------------------------------===//
- // Data to support user interaction
- //
-
- /// CurrentFile - The current source file we are inspecting, or null if
- /// none.
- const SourceFile *CurrentFile;
- unsigned LineListedStart, LineListedEnd;
-
- /// CurrentLanguage - This contains the source language in use, if one is
- /// explicitly set by the user. If this is null (the default), the language
- /// is automatically determined from the current stack frame.
- ///
- const SourceLanguage *CurrentLanguage;
-
- public:
- CLIDebugger();
-
- /// getDebugger - Return the current LLVM debugger implementation being
- /// used.
- Debugger &getDebugger() { return Dbg; }
-
- /// run - Start the debugger, returning when the user exits the debugger.
- /// This starts the main event loop of the CLI debugger.
- ///
- int run();
-
- /// addCommand - Add a command to the CommandTable, potentially displacing a
- /// preexisting command.
- void addCommand(const std::string &Option, CLICommand *Cmd);
-
- /// addSourceDirectory - Add a directory to search when looking for the
- /// source code of the program.
- void addSourceDirectory(const std::string &Dir) {
- // FIXME: implement
- }
-
- /// getCurrentLanguage - Return the current source language that the user is
- /// playing around with. This is aquired from the current stack frame of a
- /// running program if one exists, but this value can be explicitly set by
- /// the user as well.
- const SourceLanguage &getCurrentLanguage() const;
-
- /// getProgramInfo - Return a reference to the ProgramInfo object for the
- /// currently loaded program. If there is no program loaded, throw an
- /// exception.
- ProgramInfo &getProgramInfo() const {
- if (TheProgramInfo == 0)
- throw "No program is loaded.";
- return *TheProgramInfo;
- }
-
- /// getRuntimeInfo - Return a reference to the current RuntimeInfo object.
- /// If there is no program running, throw an exception.
- RuntimeInfo &getRuntimeInfo() const {
- if (TheRuntimeInfo == 0)
- throw "No program is running.";
- return *TheRuntimeInfo;
- }
-
- private: // Internal implementation methods
-
- /// getCommand - This looks up the specified command using a fuzzy match.
- /// If the string exactly matches a command or is an unambiguous prefix of a
- /// command, it returns the command. Otherwise it throws an exception
- /// indicating the possible ambiguous choices.
- CLICommand *getCommand(const std::string &Command);
-
- /// askYesNo - Ask the user a question, and demand a yes/no response. If
- /// the user says yes, return true.
- bool askYesNo(const std::string &Message) const;
-
- /// printProgramLocation - Given a loaded and created child process that has
- /// stopped, print its current source location.
- void printProgramLocation(bool PrintLocation = true);
-
- /// eliminateRunInfo - We are about to run the program. Forget any state
- /// about how the program used to be stopped.
- void eliminateRunInfo();
-
- /// programStoppedSuccessfully - This method updates internal data
- /// structures to reflect the fact that the program just executed a while,
- /// and has successfully stopped.
- void programStoppedSuccessfully();
-
- public: /// Builtin debugger commands, invokable by the user
- // Program startup and shutdown options
- void fileCommand(std::string &Options); // file
- void createCommand(std::string &Options); // create
- void killCommand(std::string &Options); // kill
- void quitCommand(std::string &Options); // quit
-
- // Program execution commands
- void runCommand(std::string &Options); // run|r
- void contCommand(std::string &Options); // cont|c|fg
- void stepCommand(std::string &Options); // step|s [count]
- void nextCommand(std::string &Options); // next|n [count]
- void finishCommand(std::string &Options); // finish
-
- // Stack frame commands
- void backtraceCommand(std::string &Options); // backtrace|bt [count]
- void upCommand(std::string &Options); // up
- void downCommand(std::string &Options); // down
- void frameCommand(std::string &Options); // frame
-
-
- // Breakpoint related commands
- void breakCommand(std::string &Options); // break|b <id>
-
- // Miscellaneous commands
- void infoCommand(std::string &Options); // info
- void listCommand(std::string &Options); // list
- void setCommand(std::string &Options); // set
- void showCommand(std::string &Options); // show
- void helpCommand(std::string &Options); // help
-
- private:
- /// startProgramRunning - If the program has been updated, reload it, then
- /// start executing the program.
- void startProgramRunning();
-
- /// printSourceLine - Print the specified line of the current source file.
- /// If the specified line is invalid (the source file could not be loaded or
- /// the line number is out of range), don't print anything, but return true.
- bool printSourceLine(unsigned LineNo);
-
- /// parseLineSpec - Parses a line specifier, for use by the 'list' command.
- /// If SourceFile is returned as a void pointer, then it was not specified.
- /// If the line specifier is invalid, an exception is thrown.
- void parseLineSpec(std::string &LineSpec, const SourceFile *&SourceFile,
- unsigned &LineNo);
-
- /// parseProgramOptions - This method parses the Options string and loads it
- /// as options to be passed to the program. This is used by the run command
- /// and by 'set args'.
- void parseProgramOptions(std::string &Options);
- };
-}
-
-#endif
diff --git a/release_23/tools/llvm-db/Commands.cpp b/release_23/tools/llvm-db/Commands.cpp
deleted file mode 100644
index ffebdd5d58f4..000000000000
--- a/release_23/tools/llvm-db/Commands.cpp
+++ /dev/null
@@ -1,865 +0,0 @@
-//===-- Commands.cpp - Implement various commands for the CLI -------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements many builtin user commands.
-//
-//===----------------------------------------------------------------------===//
-
-#include "CLIDebugger.h"
-#include "CLICommand.h"
-#include "llvm/Debugger/ProgramInfo.h"
-#include "llvm/Debugger/RuntimeInfo.h"
-#include "llvm/Debugger/SourceLanguage.h"
-#include "llvm/Debugger/SourceFile.h"
-#include "llvm/Debugger/InferiorProcess.h"
-#include "llvm/Support/FileUtilities.h"
-#include "llvm/ADT/StringExtras.h"
-#include <iostream>
-#include <cstdlib>
-using namespace llvm;
-
-/// getCurrentLanguage - Return the current source language that the user is
-/// playing around with. This is aquired from the current stack frame of a
-/// running program if one exists, but this value can be explicitly set by the
-/// user as well.
-const SourceLanguage &CLIDebugger::getCurrentLanguage() const {
- // If the user explicitly switched languages with 'set language', use what
- // they asked for.
- if (CurrentLanguage) {
- return *CurrentLanguage;
- } else if (Dbg.isProgramRunning()) {
- // Otherwise, if the program is running, infer the current language from it.
- const GlobalVariable *FuncDesc =
- getRuntimeInfo().getCurrentFrame().getFunctionDesc();
- return getProgramInfo().getFunction(FuncDesc).getSourceFile().getLanguage();
- } else {
- // Otherwise, default to C like GDB apparently does.
- return SourceLanguage::getCFamilyInstance();
- }
-}
-
-/// startProgramRunning - If the program has been updated, reload it, then
-/// start executing the program.
-void CLIDebugger::startProgramRunning() {
- eliminateRunInfo();
-
- // If the program has been modified, reload it!
- sys::PathWithStatus Program(Dbg.getProgramPath());
- std::string Err;
- const sys::FileStatus *Status = Program.getFileStatus(false, &Err);
- if (!Status)
- throw Err;
- if (TheProgramInfo->getProgramTimeStamp() != Status->getTimestamp()) {
- std::cout << "'" << Program << "' has changed; re-reading program.\n";
-
- // Unload an existing program. This kills the program if necessary.
- Dbg.unloadProgram();
- delete TheProgramInfo;
- TheProgramInfo = 0;
- CurrentFile = 0;
-
- Dbg.loadProgram(Program.toString());
- TheProgramInfo = new ProgramInfo(Dbg.getProgram());
- }
-
- std::cout << "Starting program: " << Dbg.getProgramPath() << "\n";
- Dbg.createProgram();
-
- // There was no current frame.
- LastCurrentFrame = 0;
-}
-
-/// printSourceLine - Print the specified line of the current source file.
-/// If the specified line is invalid (the source file could not be loaded or
-/// the line number is out of range), don't print anything, but return true.
-bool CLIDebugger::printSourceLine(unsigned LineNo) {
- assert(CurrentFile && "There is no current source file to print!");
- const char *LineStart, *LineEnd;
- CurrentFile->getSourceLine(LineNo-1, LineStart, LineEnd);
- if (LineStart == 0) return true;
- std::cout << LineNo;
-
- // If this is the line the program is currently stopped at, print a marker.
- if (Dbg.isProgramRunning()) {
- unsigned CurLineNo, CurColNo;
- const SourceFileInfo *CurSFI;
- getRuntimeInfo().getCurrentFrame().getSourceLocation(CurLineNo, CurColNo,
- CurSFI);
-
- if (CurLineNo == LineNo && CurrentFile == &CurSFI->getSourceText())
- std::cout << " ->";
- }
-
- std::cout << "\t" << std::string(LineStart, LineEnd) << "\n";
- return false;
-}
-
-/// printProgramLocation - Print a line of the place where the current stack
-/// frame has stopped and the source line it is on.
-///
-void CLIDebugger::printProgramLocation(bool PrintLocation) {
- assert(Dbg.isProgramLoaded() && Dbg.isProgramRunning() &&
- "Error program is not loaded and running!");
-
- // Figure out where the program stopped...
- StackFrame &SF = getRuntimeInfo().getCurrentFrame();
- unsigned LineNo, ColNo;
- const SourceFileInfo *FileDesc;
- SF.getSourceLocation(LineNo, ColNo, FileDesc);
-
- // If requested, print out some program information about WHERE we are.
- if (PrintLocation) {
- // FIXME: print the current function arguments
- if (const GlobalVariable *FuncDesc = SF.getFunctionDesc())
- std::cout << getProgramInfo().getFunction(FuncDesc).getSymbolicName();
- else
- std::cout << "<unknown function>";
-
- CurrentFile = &FileDesc->getSourceText();
-
- std::cout << " at " << CurrentFile->getFilename() << ":" << LineNo;
- if (ColNo) std::cout << ":" << ColNo;
- std::cout << "\n";
- }
-
- if (printSourceLine(LineNo))
- std::cout << "<could not load source file>\n";
- else {
- LineListedStart = LineNo-ListSize/2+1;
- if ((int)LineListedStart < 1) LineListedStart = 1;
- LineListedEnd = LineListedStart+1;
- }
-}
-
-/// eliminateRunInfo - We are about to run the program. Forget any state
-/// about how the program used to be stopped.
-void CLIDebugger::eliminateRunInfo() {
- delete TheRuntimeInfo;
- TheRuntimeInfo = 0;
-}
-
-/// programStoppedSuccessfully - This method updates internal data
-/// structures to reflect the fact that the program just executed a while,
-/// and has successfully stopped.
-void CLIDebugger::programStoppedSuccessfully() {
- assert(TheRuntimeInfo==0 && "Someone forgot to release the old RuntimeInfo!");
-
- TheRuntimeInfo = new RuntimeInfo(TheProgramInfo, Dbg.getRunningProcess());
-
- // FIXME: if there are any breakpoints at the current location, print them as
- // well.
-
- // Since the program as successfully stopped, print its location.
- void *CurrentFrame = getRuntimeInfo().getCurrentFrame().getFrameID();
- printProgramLocation(CurrentFrame != LastCurrentFrame);
- LastCurrentFrame = CurrentFrame;
-}
-
-
-
-/// getUnsignedIntegerOption - Get an unsigned integer number from the Val
-/// string. Check to make sure that the string contains an unsigned integer
-/// token, and if not, throw an exception. If isOnlyOption is set, also throw
-/// an exception if there is extra junk at the end of the string.
-static unsigned getUnsignedIntegerOption(const char *Msg, std::string &Val,
- bool isOnlyOption = true) {
- std::string Tok = getToken(Val);
- if (Tok.empty() || (isOnlyOption && !getToken(Val).empty()))
- throw std::string(Msg) + " expects an unsigned integer argument.";
-
- char *EndPtr;
- unsigned Result = strtoul(Tok.c_str(), &EndPtr, 0);
- if (EndPtr != Tok.c_str()+Tok.size())
- throw std::string(Msg) + " expects an unsigned integer argument.";
-
- return Result;
-}
-
-/// getOptionalUnsignedIntegerOption - This method is just like
-/// getUnsignedIntegerOption, but if the argument value is not specified, a
-/// default is returned instead of causing an error.
-static unsigned
-getOptionalUnsignedIntegerOption(const char *Msg, unsigned Default,
- std::string &Val, bool isOnlyOption = true) {
- // Check to see if the value was specified...
- std::string TokVal = getToken(Val);
- if (TokVal.empty()) return Default;
-
- // If it was specified, add it back to the value we are parsing...
- Val = TokVal+Val;
-
- // And parse normally.
- return getUnsignedIntegerOption(Msg, Val, isOnlyOption);
-}
-
-
-/// parseProgramOptions - This method parses the Options string and loads it
-/// as options to be passed to the program. This is used by the run command
-/// and by 'set args'.
-void CLIDebugger::parseProgramOptions(std::string &Options) {
- // FIXME: tokenizing by whitespace is clearly incorrect. Instead we should
- // honor quotes and other things that a shell would. Also in the future we
- // should support redirection of standard IO.
-
- std::vector<std::string> Arguments;
- for (std::string A = getToken(Options); !A.empty(); A = getToken(Options))
- Arguments.push_back(A);
- Dbg.setProgramArguments(Arguments.begin(), Arguments.end());
-}
-
-
-//===----------------------------------------------------------------------===//
-// Program startup and shutdown options
-//===----------------------------------------------------------------------===//
-
-
-/// file command - If the user specifies an option, search the PATH for the
-/// specified program/bitcode file and load it. If the user does not specify
-/// an option, unload the current program.
-void CLIDebugger::fileCommand(std::string &Options) {
- std::string Prog = getToken(Options);
- if (!getToken(Options).empty())
- throw "file command takes at most one argument.";
-
- // Check to make sure the user knows what they are doing
- if (Dbg.isProgramRunning() &&
- !askYesNo("A program is already loaded. Kill it?"))
- return;
-
- // Unload an existing program. This kills the program if necessary.
- eliminateRunInfo();
- delete TheProgramInfo;
- TheProgramInfo = 0;
- Dbg.unloadProgram();
- CurrentFile = 0;
-
- // If requested, start the new program.
- if (Prog.empty()) {
- std::cout << "Unloaded program.\n";
- } else {
- std::cout << "Loading program... " << std::flush;
- Dbg.loadProgram(Prog);
- assert(Dbg.isProgramLoaded() &&
- "loadProgram succeeded, but not program loaded!");
- TheProgramInfo = new ProgramInfo(Dbg.getProgram());
- std::cout << "successfully loaded '" << Dbg.getProgramPath() << "'!\n";
- }
-}
-
-
-void CLIDebugger::createCommand(std::string &Options) {
- if (!getToken(Options).empty())
- throw "create command does not take any arguments.";
- if (!Dbg.isProgramLoaded()) throw "No program loaded.";
- if (Dbg.isProgramRunning() &&
- !askYesNo("The program is already running. Restart from the beginning?"))
- return;
-
- // Start the program running.
- startProgramRunning();
-
- // The program stopped!
- programStoppedSuccessfully();
-}
-
-void CLIDebugger::killCommand(std::string &Options) {
- if (!getToken(Options).empty())
- throw "kill command does not take any arguments.";
- if (!Dbg.isProgramRunning())
- throw "No program is currently being run.";
-
- if (askYesNo("Kill the program being debugged?"))
- Dbg.killProgram();
- eliminateRunInfo();
-}
-
-void CLIDebugger::quitCommand(std::string &Options) {
- if (!getToken(Options).empty())
- throw "quit command does not take any arguments.";
-
- if (Dbg.isProgramRunning() &&
- !askYesNo("The program is running. Exit anyway?"))
- return;
-
- // Throw exception to get out of the user-input loop.
- throw 0;
-}
-
-
-//===----------------------------------------------------------------------===//
-// Program execution commands
-//===----------------------------------------------------------------------===//
-
-void CLIDebugger::runCommand(std::string &Options) {
- if (!Dbg.isProgramLoaded()) throw "No program loaded.";
- if (Dbg.isProgramRunning() &&
- !askYesNo("The program is already running. Restart from the beginning?"))
- return;
-
- // Parse all of the options to the run command, which specify program
- // arguments to run with.
- parseProgramOptions(Options);
-
- eliminateRunInfo();
-
- // Start the program running.
- startProgramRunning();
-
- // Start the program running...
- Options = "";
- contCommand(Options);
-}
-
-void CLIDebugger::contCommand(std::string &Options) {
- if (!getToken(Options).empty()) throw "cont argument not supported yet.";
- if (!Dbg.isProgramRunning()) throw "Program is not running.";
-
- eliminateRunInfo();
-
- Dbg.contProgram();
-
- // The program stopped!
- programStoppedSuccessfully();
-}
-
-void CLIDebugger::stepCommand(std::string &Options) {
- if (!Dbg.isProgramRunning()) throw "Program is not running.";
-
- // Figure out how many times to step.
- unsigned Amount =
- getOptionalUnsignedIntegerOption("'step' command", 1, Options);
-
- eliminateRunInfo();
-
- // Step the specified number of times.
- for (; Amount; --Amount)
- Dbg.stepProgram();
-
- // The program stopped!
- programStoppedSuccessfully();
-}
-
-void CLIDebugger::nextCommand(std::string &Options) {
- if (!Dbg.isProgramRunning()) throw "Program is not running.";
- unsigned Amount =
- getOptionalUnsignedIntegerOption("'next' command", 1, Options);
-
- eliminateRunInfo();
-
- for (; Amount; --Amount)
- Dbg.nextProgram();
-
- // The program stopped!
- programStoppedSuccessfully();
-}
-
-void CLIDebugger::finishCommand(std::string &Options) {
- if (!getToken(Options).empty())
- throw "finish command does not take any arguments.";
- if (!Dbg.isProgramRunning()) throw "Program is not running.";
-
- // Figure out where we are exactly. If the user requests that we return from
- // a frame that is not the top frame, make sure we get it.
- void *CurrentFrame = getRuntimeInfo().getCurrentFrame().getFrameID();
-
- eliminateRunInfo();
-
- Dbg.finishProgram(CurrentFrame);
-
- // The program stopped!
- programStoppedSuccessfully();
-}
-
-//===----------------------------------------------------------------------===//
-// Stack frame commands
-//===----------------------------------------------------------------------===//
-
-void CLIDebugger::backtraceCommand(std::string &Options) {
- // Accepts "full", n, -n
- if (!getToken(Options).empty())
- throw "FIXME: bt command argument not implemented yet!";
-
- RuntimeInfo &RI = getRuntimeInfo();
- ProgramInfo &PI = getProgramInfo();
-
- try {
- for (unsigned i = 0; ; ++i) {
- StackFrame &SF = RI.getStackFrame(i);
- std::cout << "#" << i;
- if (i == RI.getCurrentFrameIdx())
- std::cout << " ->";
- std::cout << "\t" << SF.getFrameID() << " in ";
- if (const GlobalVariable *G = SF.getFunctionDesc())
- std::cout << PI.getFunction(G).getSymbolicName();
-
- unsigned LineNo, ColNo;
- const SourceFileInfo *SFI;
- SF.getSourceLocation(LineNo, ColNo, SFI);
- if (!SFI->getBaseName().empty()) {
- std::cout << " at " << SFI->getBaseName();
- if (LineNo) {
- std::cout << ":" << LineNo;
- if (ColNo)
- std::cout << ":" << ColNo;
- }
- }
-
- // FIXME: when we support shared libraries, we should print ' from foo.so'
- // if the stack frame is from a different object than the current one.
-
- std::cout << "\n";
- }
- } catch (...) {
- // Stop automatically when we run off the bottom of the stack.
- }
-}
-
-void CLIDebugger::upCommand(std::string &Options) {
- unsigned Num =
- getOptionalUnsignedIntegerOption("'up' command", 1, Options);
-
- RuntimeInfo &RI = getRuntimeInfo();
- unsigned CurFrame = RI.getCurrentFrameIdx();
-
- // Check to see if we go can up the specified number of frames.
- try {
- RI.getStackFrame(CurFrame+Num);
- } catch (...) {
- if (Num == 1)
- throw "Initial frame selected; you cannot go up.";
- else
- throw "Cannot go up " + utostr(Num) + " frames!";
- }
-
- RI.setCurrentFrameIdx(CurFrame+Num);
- printProgramLocation();
-}
-
-void CLIDebugger::downCommand(std::string &Options) {
- unsigned Num =
- getOptionalUnsignedIntegerOption("'down' command", 1, Options);
-
- RuntimeInfo &RI = getRuntimeInfo();
- unsigned CurFrame = RI.getCurrentFrameIdx();
-
- // Check to see if we can go up the specified number of frames.
- if (CurFrame < Num) {
- if (Num == 1)
- throw "Bottom (i.e., innermost) frame selected; you cannot go down.";
- else
- throw "Cannot go down " + utostr(Num) + " frames!";
- }
-
- RI.setCurrentFrameIdx(CurFrame-Num);
- printProgramLocation();
-}
-
-void CLIDebugger::frameCommand(std::string &Options) {
- RuntimeInfo &RI = getRuntimeInfo();
- unsigned CurFrame = RI.getCurrentFrameIdx();
-
- unsigned Num =
- getOptionalUnsignedIntegerOption("'frame' command", CurFrame, Options);
-
- // Check to see if we go to the specified frame.
- RI.getStackFrame(Num);
-
- RI.setCurrentFrameIdx(Num);
- printProgramLocation();
-}
-
-
-//===----------------------------------------------------------------------===//
-// Breakpoint related commands
-//===----------------------------------------------------------------------===//
-
-void CLIDebugger::breakCommand(std::string &Options) {
- // Figure out where the user wants a breakpoint.
- const SourceFile *File;
- unsigned LineNo;
-
- // Check to see if the user specified a line specifier.
- std::string Option = getToken(Options); // strip whitespace
- if (!Option.empty()) {
- Options = Option + Options; // reconstruct string
-
- // Parse the line specifier.
- parseLineSpec(Options, File, LineNo);
- } else {
- // Build a line specifier for the current stack frame.
- throw "FIXME: breaking at the current location is not implemented yet!";
- }
-
- if (!File) File = CurrentFile;
- if (File == 0)
- throw "Unknown file to place breakpoint!";
-
- std::cerr << "Break: " << File->getFilename() << ":" << LineNo << "\n";
-
- throw "breakpoints not implemented yet!";
-}
-
-//===----------------------------------------------------------------------===//
-// Miscellaneous commands
-//===----------------------------------------------------------------------===//
-
-void CLIDebugger::infoCommand(std::string &Options) {
- std::string What = getToken(Options);
-
- if (What.empty() || !getToken(Options).empty()){
- std::string infoStr("info");
- helpCommand(infoStr);
- return;
- }
-
- if (What == "frame") {
- } else if (What == "functions") {
- const std::map<const GlobalVariable*, SourceFunctionInfo*> &Functions
- = getProgramInfo().getSourceFunctions();
- std::cout << "All defined functions:\n";
- // FIXME: GDB groups these by source file. We could do that I guess.
- for (std::map<const GlobalVariable*, SourceFunctionInfo*>::const_iterator
- I = Functions.begin(), E = Functions.end(); I != E; ++I) {
- std::cout << I->second->getSymbolicName() << "\n";
- }
-
- } else if (What == "source") {
- if (CurrentFile == 0)
- throw "No current source file.";
-
- // Get the SourceFile information for the current file.
- const SourceFileInfo &SF =
- getProgramInfo().getSourceFile(CurrentFile->getDescriptor());
-
- std::cout << "Current source file is: " << SF.getBaseName() << "\n"
- << "Compilation directory is: " << SF.getDirectory() << "\n";
- if (unsigned NL = CurrentFile->getNumLines())
- std::cout << "Located in: " << CurrentFile->getFilename() << "\n"
- << "Contains " << NL << " lines\n";
- else
- std::cout << "Could not find source file.\n";
- std::cout << "Source language is "
- << SF.getLanguage().getSourceLanguageName() << "\n";
-
- } else if (What == "sources") {
- const std::map<const GlobalVariable*, SourceFileInfo*> &SourceFiles =
- getProgramInfo().getSourceFiles();
- std::cout << "Source files for the program:\n";
- for (std::map<const GlobalVariable*, SourceFileInfo*>::const_iterator I =
- SourceFiles.begin(), E = SourceFiles.end(); I != E;) {
- std::cout << I->second->getDirectory() << "/"
- << I->second->getBaseName();
- ++I;
- if (I != E) std::cout << ", ";
- }
- std::cout << "\n";
- } else if (What == "target") {
- std::cout << Dbg.getRunningProcess().getStatus();
- } else {
- // See if this is something handled by the current language.
- if (getCurrentLanguage().printInfo(What))
- return;
-
- throw "Unknown info command '" + What + "'. Try 'help info'.";
- }
-}
-
-/// parseLineSpec - Parses a line specifier, for use by the 'list' command.
-/// If SourceFile is returned as a void pointer, then it was not specified.
-/// If the line specifier is invalid, an exception is thrown.
-void CLIDebugger::parseLineSpec(std::string &LineSpec,
- const SourceFile *&SourceFile,
- unsigned &LineNo) {
- SourceFile = 0;
- LineNo = 0;
-
- // First, check to see if we have a : separator.
- std::string FirstPart = getToken(LineSpec, ":");
- std::string SecondPart = getToken(LineSpec, ":");
- if (!getToken(LineSpec).empty()) throw "Malformed line specification!";
-
- // If there is no second part, we must have either "function", "number",
- // "+offset", or "-offset".
- if (SecondPart.empty()) {
- if (FirstPart.empty()) throw "Malformed line specification!";
- if (FirstPart[0] == '+') {
- FirstPart.erase(FirstPart.begin(), FirstPart.begin()+1);
- // For +n, return LineListedEnd+n
- LineNo = LineListedEnd +
- getUnsignedIntegerOption("Line specifier '+'", FirstPart);
-
- } else if (FirstPart[0] == '-') {
- FirstPart.erase(FirstPart.begin(), FirstPart.begin()+1);
- // For -n, return LineListedEnd-n
- LineNo = LineListedEnd -
- getUnsignedIntegerOption("Line specifier '-'", FirstPart);
- if ((int)LineNo < 1) LineNo = 1;
- } else if (FirstPart[0] == '*') {
- throw "Address expressions not supported as source locations!";
- } else {
- // Ok, check to see if this is just a line number.
- std::string Saved = FirstPart;
- try {
- LineNo = getUnsignedIntegerOption("", Saved);
- } catch (...) {
- // Ok, it's not a valid line number. It must be a source-language
- // entity name.
- std::string Name = getToken(FirstPart);
- if (!getToken(FirstPart).empty())
- throw "Extra junk in line specifier after '" + Name + "'.";
- SourceFunctionInfo *SFI =
- getCurrentLanguage().lookupFunction(Name, getProgramInfo(),
- TheRuntimeInfo);
- if (SFI == 0)
- throw "Unknown identifier '" + Name + "'.";
-
- unsigned L, C;
- SFI->getSourceLocation(L, C);
- if (L == 0) throw "Could not locate '" + Name + "'!";
- LineNo = L;
- SourceFile = &SFI->getSourceFile().getSourceText();
- return;
- }
- }
-
- } else {
- // Ok, this must be a filename qualified line number or function name.
- // First, figure out the source filename.
- std::string SourceFilename = getToken(FirstPart);
- if (!getToken(FirstPart).empty())
- throw "Invalid filename qualified source location!";
-
- // Next, check to see if this is just a line number.
- std::string Saved = SecondPart;
- try {
- LineNo = getUnsignedIntegerOption("", Saved);
- } catch (...) {
- // Ok, it's not a valid line number. It must be a function name.
- throw "FIXME: Filename qualified function names are not support "
- "as line specifiers yet!";
- }
-
- // Ok, we got the line number. Now check out the source file name to make
- // sure it's all good. If it is, return it. If not, throw exception.
- SourceFile =&getProgramInfo().getSourceFile(SourceFilename).getSourceText();
- }
-}
-
-void CLIDebugger::listCommand(std::string &Options) {
- if (!Dbg.isProgramLoaded())
- throw "No program is loaded. Use the 'file' command.";
-
- // Handle "list foo," correctly, by returning " " as the second token
- Options += " ";
-
- std::string FirstLineSpec = getToken(Options, ",");
- std::string SecondLineSpec = getToken(Options, ",");
- if (!getToken(Options, ",").empty())
- throw "list command only expects two source location specifiers!";
-
- // StartLine, EndLine - The starting and ending line numbers to print.
- unsigned StartLine = 0, EndLine = 0;
-
- if (SecondLineSpec.empty()) { // No second line specifier provided?
- // Handle special forms like "", "+", "-", etc.
- std::string TmpSpec = FirstLineSpec;
- std::string Tok = getToken(TmpSpec);
- if (getToken(TmpSpec).empty() && (Tok == "" || Tok == "+" || Tok == "-")) {
- if (Tok == "+" || Tok == "") {
- StartLine = LineListedEnd;
- EndLine = StartLine + ListSize;
- } else {
- assert(Tok == "-");
- StartLine = LineListedStart-ListSize;
- EndLine = LineListedStart;
- if ((int)StartLine <= 0) StartLine = 1;
- }
- } else {
- // Must be a normal line specifier.
- const SourceFile *File;
- unsigned LineNo;
- parseLineSpec(FirstLineSpec, File, LineNo);
-
- // If the user only specified one file specifier, we should display
- // ListSize lines centered at the specified line.
- if (File != 0) CurrentFile = File;
- StartLine = LineNo - (ListSize+1)/2;
- if ((int)StartLine <= 0) StartLine = 1;
- EndLine = StartLine + ListSize;
- }
-
- } else {
- // Parse two line specifiers...
- const SourceFile *StartFile, *EndFile;
- unsigned StartLineNo, EndLineNo;
- parseLineSpec(FirstLineSpec, StartFile, StartLineNo);
- unsigned SavedLLE = LineListedEnd;
- LineListedEnd = StartLineNo;
- try {
- parseLineSpec(SecondLineSpec, EndFile, EndLineNo);
- } catch (...) {
- LineListedEnd = SavedLLE;
- throw;
- }
-
- // Inherit file specified by the first line spec if there was one.
- if (EndFile == 0) EndFile = StartFile;
-
- if (StartFile != EndFile)
- throw "Start and end line specifiers are in different files!";
- CurrentFile = StartFile;
- StartLine = StartLineNo;
- EndLine = EndLineNo+1;
- }
-
- assert((int)StartLine > 0 && (int)EndLine > 0 && StartLine <= EndLine &&
- "Error reading line specifiers!");
-
- // If there was no current file, and the user didn't specify one to list, we
- // have an error.
- if (CurrentFile == 0)
- throw "There is no current file to list.";
-
- // Remember for next time.
- LineListedStart = StartLine;
- LineListedEnd = StartLine;
-
- for (unsigned LineNo = StartLine; LineNo != EndLine; ++LineNo) {
- // Print the source line, unless it is invalid.
- if (printSourceLine(LineNo))
- break;
- LineListedEnd = LineNo+1;
- }
-
- // If we didn't print any lines, find out why.
- if (LineListedEnd == StartLine) {
- // See if we can read line #0 from the file, if not, we couldn't load the
- // file.
- const char *LineStart, *LineEnd;
- CurrentFile->getSourceLine(0, LineStart, LineEnd);
- if (LineStart == 0)
- throw "Could not load source file '" + CurrentFile->getFilename() + "'!";
- else
- std::cout << "<end of file>\n";
- }
-}
-
-void CLIDebugger::setCommand(std::string &Options) {
- std::string What = getToken(Options);
-
- if (What.empty())
- throw "set command expects at least two arguments.";
- if (What == "args") {
- parseProgramOptions(Options);
- } else if (What == "language") {
- std::string Lang = getToken(Options);
- if (!getToken(Options).empty())
- throw "set language expects one argument at most.";
- if (Lang == "") {
- std::cout << "The currently understood settings are:\n\n"
- << "local or auto Automatic setting based on source file\n"
- << "c Use the C language\n"
- << "c++ Use the C++ language\n"
- << "unknown Use when source language is not supported\n";
- } else if (Lang == "local" || Lang == "auto") {
- CurrentLanguage = 0;
- } else if (Lang == "c") {
- CurrentLanguage = &SourceLanguage::getCFamilyInstance();
- } else if (Lang == "c++") {
- CurrentLanguage = &SourceLanguage::getCPlusPlusInstance();
- } else if (Lang == "unknown") {
- CurrentLanguage = &SourceLanguage::getUnknownLanguageInstance();
- } else {
- throw "Unknown language '" + Lang + "'.";
- }
-
- } else if (What == "listsize") {
- ListSize = getUnsignedIntegerOption("'set prompt' command", Options);
- } else if (What == "prompt") {
- // Include any trailing whitespace or other tokens, but not leading
- // whitespace.
- Prompt = getToken(Options); // Strip leading whitespace
- Prompt += Options; // Keep trailing whitespace or other stuff
- } else {
- // FIXME: Try to parse this as a source-language program expression.
- throw "Don't know how to set '" + What + "'!";
- }
-}
-
-void CLIDebugger::showCommand(std::string &Options) {
- std::string What = getToken(Options);
-
- if (What.empty() || !getToken(Options).empty())
- throw "show command expects one argument.";
-
- if (What == "args") {
- std::cout << "Argument list to give program when started is \"";
- // FIXME: This doesn't print stuff correctly if the arguments have spaces in
- // them, but currently the only way to get that is to use the --args command
- // line argument. This should really handle escaping all hard characters as
- // needed.
- for (unsigned i = 0, e = Dbg.getNumProgramArguments(); i != e; ++i)
- std::cout << (i ? " " : "") << Dbg.getProgramArgument(i);
- std::cout << "\"\n";
-
- } else if (What == "language") {
- std::cout << "The current source language is '";
- if (CurrentLanguage)
- std::cout << CurrentLanguage->getSourceLanguageName();
- else
- std::cout << "auto; currently "
- << getCurrentLanguage().getSourceLanguageName();
- std::cout << "'.\n";
- } else if (What == "listsize") {
- std::cout << "Number of source lines llvm-db will list by default is "
- << ListSize << ".\n";
- } else if (What == "prompt") {
- std::cout << "llvm-db's prompt is \"" << Prompt << "\".\n";
- } else {
- throw "Unknown show command '" + What + "'. Try 'help show'.";
- }
-}
-
-void CLIDebugger::helpCommand(std::string &Options) {
- // Print out all of the commands in the CommandTable
- std::string Command = getToken(Options);
- if (!getToken(Options).empty())
- throw "help command takes at most one argument.";
-
- // Getting detailed help on a particular command?
- if (!Command.empty()) {
- CLICommand *C = getCommand(Command);
- std::cout << C->getShortHelp() << ".\n" << C->getLongHelp();
-
- // If there are aliases for this option, print them out.
- const std::vector<std::string> &Names = C->getOptionNames();
- if (Names.size() > 1) {
- std::cout << "The '" << Command << "' command is known as: '"
- << Names[0] << "'";
- for (unsigned i = 1, e = Names.size(); i != e; ++i)
- std::cout << ", '" << Names[i] << "'";
- std::cout << "\n";
- }
-
- } else {
- unsigned MaxSize = 0;
- for (std::map<std::string, CLICommand*>::iterator I = CommandTable.begin(),
- E = CommandTable.end(); I != E; ++I)
- if (I->first.size() > MaxSize &&
- I->first == I->second->getPrimaryOptionName())
- MaxSize = I->first.size();
-
- // Loop over all of the commands, printing the short help version
- for (std::map<std::string, CLICommand*>::iterator I = CommandTable.begin(),
- E = CommandTable.end(); I != E; ++I)
- if (I->first == I->second->getPrimaryOptionName())
- std::cout << I->first << std::string(MaxSize - I->first.size(), ' ')
- << " - " << I->second->getShortHelp() << "\n";
- }
-}
diff --git a/release_23/tools/llvm-db/Makefile b/release_23/tools/llvm-db/Makefile
deleted file mode 100644
index df8164944f00..000000000000
--- a/release_23/tools/llvm-db/Makefile
+++ /dev/null
@@ -1,15 +0,0 @@
-##===- tools/llvm-db/Makefile ------------------------------*- Makefile -*-===##
-#
-# The LLVM Compiler Infrastructure
-#
-# This file is distributed under the University of Illinois Open Source
-# License. See LICENSE.TXT for details.
-#
-##===----------------------------------------------------------------------===##
-
-LEVEL = ../..
-TOOLNAME = llvm-db
-LINK_COMPONENTS := debugger
-REQUIRES_EH := 1
-
-include $(LEVEL)/Makefile.common
diff --git a/release_23/tools/llvm-db/llvm-db.cpp b/release_23/tools/llvm-db/llvm-db.cpp
deleted file mode 100644
index a4e8b526cef7..000000000000
--- a/release_23/tools/llvm-db/llvm-db.cpp
+++ /dev/null
@@ -1,96 +0,0 @@
-//===- llvm-db.cpp - LLVM Debugger ----------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This utility implements a simple text-mode front-end to the LLVM debugger
-// library.
-//
-//===----------------------------------------------------------------------===//
-
-#include "CLIDebugger.h"
-#include "llvm/Support/CommandLine.h"
-#include "llvm/Support/ManagedStatic.h"
-#include "llvm/System/Signals.h"
-#include <iostream>
-using namespace llvm;
-
-namespace {
- // Command line options for specifying the program to debug and options to use
- cl::opt<std::string>
- InputFile(cl::desc("<program>"), cl::Positional, cl::init(""));
-
- cl::list<std::string>
- InputArgs("args", cl::Positional, cl::desc("<program and arguments>"),
- cl::ZeroOrMore);
-
- // Command line options to control various directory related stuff
- cl::list<std::string>
- SourceDirectories("directory", cl::value_desc("directory"),
- cl::desc("Add directory to the search for source files"));
- cl::alias SDA("d", cl::desc("Alias for --directory"),
- cl::aliasopt(SourceDirectories));
-
- cl::opt<std::string>
- WorkingDirectory("cd", cl::desc("Use directory as current working directory"),
- cl::value_desc("directory"));
-
- // Command line options specific to the llvm-db debugger driver
- cl::opt<bool> Quiet("quiet", cl::desc("Do not print introductory messages"));
- cl::alias QA1("silent", cl::desc("Alias for -quiet"), cl::aliasopt(Quiet));
- cl::alias QA2("q", cl::desc("Alias for -quiet"), cl::aliasopt(Quiet));
-}
-
-//===----------------------------------------------------------------------===//
-// main Driver function
-//
-int main(int argc, char **argv, char * const *envp) {
- llvm_shutdown_obj X; // Call llvm_shutdown() on exit.
- std::cout << "NOTE: llvm-db is known useless right now.\n";
- try {
- cl::ParseCommandLineOptions(argc, argv,
- "llvm source-level debugger\n");
- sys::PrintStackTraceOnErrorSignal();
-
- if (!Quiet)
- std::cout << "llvm-db: The LLVM source-level debugger\n";
-
- // Merge Inputfile and InputArgs into the InputArgs list...
- if (!InputFile.empty() && InputArgs.empty())
- InputArgs.push_back(InputFile);
-
- // Create the CLI debugger...
- CLIDebugger D;
-
- // Initialize the debugger with the command line options we read...
- Debugger &Dbg = D.getDebugger();
-
- // Initialize the debugger environment.
- Dbg.initializeEnvironment(envp);
- Dbg.setWorkingDirectory(WorkingDirectory);
- for (unsigned i = 0, e = SourceDirectories.size(); i != e; ++i)
- D.addSourceDirectory(SourceDirectories[i]);
-
- if (!InputArgs.empty()) {
- try {
- D.fileCommand(InputArgs[0]);
- } catch (const std::string &Error) {
- std::cout << "Error: " << Error << "\n";
- }
-
- Dbg.setProgramArguments(InputArgs.begin()+1, InputArgs.end());
- }
-
- // Now that we have initialized the debugger, run it.
- return D.run();
- } catch (const std::string& msg) {
- std::cerr << argv[0] << ": " << msg << "\n";
- } catch (...) {
- std::cerr << argv[0] << ": Unexpected unknown exception occurred.\n";
- }
- return 1;
-}
diff --git a/release_23/tools/llvm-dis/Makefile b/release_23/tools/llvm-dis/Makefile
deleted file mode 100644
index 6c8d0a327cc7..000000000000
--- a/release_23/tools/llvm-dis/Makefile
+++ /dev/null
@@ -1,15 +0,0 @@
-##===- tools/llvm-dis/Makefile ------------------------------*- Makefile -*-===##
-#
-# The LLVM Compiler Infrastructure
-#
-# This file is distributed under the University of Illinois Open Source
-# License. See LICENSE.TXT for details.
-#
-##===----------------------------------------------------------------------===##
-LEVEL = ../..
-
-TOOLNAME = llvm-dis
-LINK_COMPONENTS := bitreader
-REQUIRES_EH := 1
-
-include $(LEVEL)/Makefile.common
diff --git a/release_23/tools/llvm-dis/llvm-dis.cpp b/release_23/tools/llvm-dis/llvm-dis.cpp
deleted file mode 100644
index 9802541e0f6b..000000000000
--- a/release_23/tools/llvm-dis/llvm-dis.cpp
+++ /dev/null
@@ -1,138 +0,0 @@
-//===-- llvm-dis.cpp - The low-level LLVM disassembler --------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This utility may be invoked in the following manner:
-// llvm-dis [options] - Read LLVM bitcode from stdin, write asm to stdout
-// llvm-dis [options] x.bc - Read LLVM bitcode from the x.bc file, write asm
-// to the x.ll file.
-// Options:
-// --help - Output information about command line switches
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Module.h"
-#include "llvm/PassManager.h"
-#include "llvm/Bitcode/ReaderWriter.h"
-#include "llvm/Assembly/PrintModulePass.h"
-#include "llvm/Support/CommandLine.h"
-#include "llvm/Support/ManagedStatic.h"
-#include "llvm/Support/MemoryBuffer.h"
-#include "llvm/Support/Streams.h"
-#include "llvm/System/Signals.h"
-#include <iostream>
-#include <fstream>
-#include <memory>
-using namespace llvm;
-
-static cl::opt<std::string>
-InputFilename(cl::Positional, cl::desc("<input bitcode>"), cl::init("-"));
-
-static cl::opt<std::string>
-OutputFilename("o", cl::desc("Override output filename"),
- cl::value_desc("filename"));
-
-static cl::opt<bool>
-Force("f", cl::desc("Overwrite output files"));
-
-static cl::opt<bool>
-DontPrint("disable-output", cl::desc("Don't output the .ll file"), cl::Hidden);
-
-int main(int argc, char **argv) {
- llvm_shutdown_obj X; // Call llvm_shutdown() on exit.
- try {
- cl::ParseCommandLineOptions(argc, argv, "llvm .bc -> .ll disassembler\n");
- sys::PrintStackTraceOnErrorSignal();
-
- std::ostream *Out = &std::cout; // Default to printing to stdout.
- std::string ErrorMessage;
-
- std::auto_ptr<Module> M;
-
- if (MemoryBuffer *Buffer
- = MemoryBuffer::getFileOrSTDIN(InputFilename, &ErrorMessage)) {
- M.reset(ParseBitcodeFile(Buffer, &ErrorMessage));
- delete Buffer;
- }
-
- if (M.get() == 0) {
- cerr << argv[0] << ": ";
- if (ErrorMessage.size())
- cerr << ErrorMessage << "\n";
- else
- cerr << "bitcode didn't read correctly.\n";
- return 1;
- }
-
- if (DontPrint) {
- // Just use stdout. We won't actually print anything on it.
- } else if (OutputFilename != "") { // Specified an output filename?
- if (OutputFilename != "-") { // Not stdout?
- if (!Force && std::ifstream(OutputFilename.c_str())) {
- // If force is not specified, make sure not to overwrite a file!
- cerr << argv[0] << ": error opening '" << OutputFilename
- << "': file exists! Sending to standard output.\n";
- } else {
- Out = new std::ofstream(OutputFilename.c_str());
- }
- }
- } else {
- if (InputFilename == "-") {
- OutputFilename = "-";
- } else {
- std::string IFN = InputFilename;
- int Len = IFN.length();
- if (IFN[Len-3] == '.' && IFN[Len-2] == 'b' && IFN[Len-1] == 'c') {
- // Source ends in .bc
- OutputFilename = std::string(IFN.begin(), IFN.end()-3)+".ll";
- } else {
- OutputFilename = IFN+".ll";
- }
-
- if (!Force && std::ifstream(OutputFilename.c_str())) {
- // If force is not specified, make sure not to overwrite a file!
- cerr << argv[0] << ": error opening '" << OutputFilename
- << "': file exists! Sending to standard output.\n";
- } else {
- Out = new std::ofstream(OutputFilename.c_str());
-
- // Make sure that the Out file gets unlinked from the disk if we get a
- // SIGINT
- sys::RemoveFileOnSignal(sys::Path(OutputFilename));
- }
- }
- }
-
- if (!Out->good()) {
- cerr << argv[0] << ": error opening " << OutputFilename
- << ": sending to stdout instead!\n";
- Out = &std::cout;
- }
-
- // All that llvm-dis does is write the assembly to a file.
- if (!DontPrint) {
- PassManager Passes;
- OStream L(*Out);
- Passes.add(new PrintModulePass(&L));
- Passes.run(*M.get());
- }
-
- if (Out != &std::cout) {
- ((std::ofstream*)Out)->close();
- delete Out;
- }
- return 0;
- } catch (const std::string& msg) {
- cerr << argv[0] << ": " << msg << "\n";
- } catch (...) {
- cerr << argv[0] << ": Unexpected unknown exception occurred.\n";
- }
-
- return 1;
-}
-
diff --git a/release_23/tools/llvm-extract/Makefile b/release_23/tools/llvm-extract/Makefile
deleted file mode 100644
index 21fe37b13109..000000000000
--- a/release_23/tools/llvm-extract/Makefile
+++ /dev/null
@@ -1,15 +0,0 @@
-##===- tools/llvm-extract/Makefile -------------------------*- Makefile -*-===##
-#
-# The LLVM Compiler Infrastructure
-#
-# This file is distributed under the University of Illinois Open Source
-# License. See LICENSE.TXT for details.
-#
-##===----------------------------------------------------------------------===##
-
-LEVEL = ../..
-
-TOOLNAME = llvm-extract
-LINK_COMPONENTS := ipo bitreader bitwriter
-
-include $(LEVEL)/Makefile.common
diff --git a/release_23/tools/llvm-extract/llvm-extract.cpp b/release_23/tools/llvm-extract/llvm-extract.cpp
deleted file mode 100644
index 360630b41dc0..000000000000
--- a/release_23/tools/llvm-extract/llvm-extract.cpp
+++ /dev/null
@@ -1,132 +0,0 @@
-//===- llvm-extract.cpp - LLVM function extraction utility ----------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This utility changes the input module to only contain a single function,
-// which is primarily used for debugging transformations.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Module.h"
-#include "llvm/PassManager.h"
-#include "llvm/Bitcode/ReaderWriter.h"
-#include "llvm/Transforms/IPO.h"
-#include "llvm/Target/TargetData.h"
-#include "llvm/Support/CommandLine.h"
-#include "llvm/Support/ManagedStatic.h"
-#include "llvm/Support/MemoryBuffer.h"
-#include "llvm/System/Signals.h"
-#include <iostream>
-#include <memory>
-#include <fstream>
-using namespace llvm;
-
-// InputFilename - The filename to read from.
-static cl::opt<std::string>
-InputFilename(cl::Positional, cl::desc("<input bitcode file>"),
- cl::init("-"), cl::value_desc("filename"));
-
-static cl::opt<std::string>
-OutputFilename("o", cl::desc("Specify output filename"),
- cl::value_desc("filename"), cl::init("-"));
-
-static cl::opt<bool>
-Force("f", cl::desc("Overwrite output files"));
-
-static cl::opt<bool>
-DeleteFn("delete", cl::desc("Delete specified Globals from Module"));
-
-static cl::opt<bool>
-Relink("relink",
- cl::desc("Turn external linkage for callees of function to delete"));
-
-// ExtractFunc - The function to extract from the module...
-static cl::opt<std::string>
-ExtractFunc("func", cl::desc("Specify function to extract"), cl::init(""),
- cl::value_desc("function"));
-
-// ExtractGlobal - The global to extract from the module...
-static cl::opt<std::string>
-ExtractGlobal("glob", cl::desc("Specify global to extract"), cl::init(""),
- cl::value_desc("global"));
-
-int main(int argc, char **argv) {
- llvm_shutdown_obj X; // Call llvm_shutdown() on exit.
- cl::ParseCommandLineOptions(argc, argv, "llvm extractor\n");
- sys::PrintStackTraceOnErrorSignal();
-
- std::auto_ptr<Module> M;
-
- MemoryBuffer *Buffer = MemoryBuffer::getFileOrSTDIN(InputFilename);
- if (Buffer == 0) {
- cerr << argv[0] << ": Error reading file '" + InputFilename + "'\n";
- return 1;
- } else {
- M.reset(ParseBitcodeFile(Buffer));
- }
- delete Buffer;
-
- if (M.get() == 0) {
- cerr << argv[0] << ": bitcode didn't read correctly.\n";
- return 1;
- }
-
- // Figure out which function we should extract
- GlobalVariable *G = ExtractGlobal.size() ?
- M.get()->getNamedGlobal(ExtractGlobal) : 0;
-
- // Figure out which function we should extract
- if (!ExtractFunc.size() && !ExtractGlobal.size()) ExtractFunc = "main";
- Function *F = M.get()->getFunction(ExtractFunc);
-
- if (F == 0 && G == 0) {
- cerr << argv[0] << ": program doesn't contain function named '"
- << ExtractFunc << "' or a global named '" << ExtractGlobal << "'!\n";
- return 1;
- }
-
- // In addition to deleting all other functions, we also want to spiff it
- // up a little bit. Do this now.
- PassManager Passes;
- Passes.add(new TargetData(M.get())); // Use correct TargetData
- // Either isolate the function or delete it from the Module
- std::vector<GlobalValue*> GVs;
- if (F) GVs.push_back(F);
- if (G) GVs.push_back(G);
-
- Passes.add(createGVExtractionPass(GVs, DeleteFn, Relink));
- if (!DeleteFn)
- Passes.add(createGlobalDCEPass()); // Delete unreachable globals
- Passes.add(createDeadTypeEliminationPass()); // Remove dead types...
- Passes.add(createStripDeadPrototypesPass()); // Remove dead func decls
-
- std::ostream *Out = 0;
-
- if (OutputFilename != "-") { // Not stdout?
- if (!Force && std::ifstream(OutputFilename.c_str())) {
- // If force is not specified, make sure not to overwrite a file!
- cerr << argv[0] << ": error opening '" << OutputFilename
- << "': file exists!\n"
- << "Use -f command line argument to force output\n";
- return 1;
- }
- std::ios::openmode io_mode = std::ios::out | std::ios::trunc |
- std::ios::binary;
- Out = new std::ofstream(OutputFilename.c_str(), io_mode);
- } else { // Specified stdout
- // FIXME: cout is not binary!
- Out = &std::cout;
- }
-
- Passes.add(CreateBitcodeWriterPass(*Out));
- Passes.run(*M.get());
-
- if (Out != &std::cout)
- delete Out;
- return 0;
-}
diff --git a/release_23/tools/llvm-ld/Makefile b/release_23/tools/llvm-ld/Makefile
deleted file mode 100644
index 92cac2afc919..000000000000
--- a/release_23/tools/llvm-ld/Makefile
+++ /dev/null
@@ -1,16 +0,0 @@
-##===- tools/llvm-ld/Makefile ------------------------------*- Makefile -*-===##
-#
-# The LLVM Compiler Infrastructure
-#
-# This file is distributed under the University of Illinois Open Source
-# License. See LICENSE.TXT for details.
-#
-##===----------------------------------------------------------------------===##
-
-LEVEL = ../..
-
-TOOLNAME = llvm-ld
-LINK_COMPONENTS = ipo scalaropts linker archive bitwriter
-REQUIRES_EH := 1
-
-include $(LEVEL)/Makefile.common
diff --git a/release_23/tools/llvm-ld/Optimize.cpp b/release_23/tools/llvm-ld/Optimize.cpp
deleted file mode 100644
index cbdf2f74990a..000000000000
--- a/release_23/tools/llvm-ld/Optimize.cpp
+++ /dev/null
@@ -1,222 +0,0 @@
-//===- Optimize.cpp - Optimize a complete program -------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements all optimization of the linked module for llvm-ld.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Module.h"
-#include "llvm/PassManager.h"
-#include "llvm/Analysis/LoadValueNumbering.h"
-#include "llvm/Analysis/Passes.h"
-#include "llvm/Analysis/LoopPass.h"
-#include "llvm/Analysis/Verifier.h"
-#include "llvm/Support/CommandLine.h"
-#include "llvm/System/DynamicLibrary.h"
-#include "llvm/Target/TargetData.h"
-#include "llvm/Target/TargetMachine.h"
-#include "llvm/Transforms/IPO.h"
-#include "llvm/Transforms/Scalar.h"
-#include "llvm/Support/PassNameParser.h"
-#include "llvm/Support/PluginLoader.h"
-#include <iostream>
-using namespace llvm;
-
-// Pass Name Options as generated by the PassNameParser
-static cl::list<const PassInfo*, bool, PassNameParser>
- OptimizationList(cl::desc("Optimizations available:"));
-
-//Don't verify at the end
-static cl::opt<bool> DontVerify("disable-verify", cl::ReallyHidden);
-
-// Optimization Enumeration
-enum OptimizationLevels {
- OPT_FAST_COMPILE = 1,
- OPT_SIMPLE = 2,
- OPT_AGGRESSIVE = 3,
- OPT_LINK_TIME = 4,
- OPT_AGGRESSIVE_LINK_TIME = 5
-};
-
-// Optimization Options
-static cl::opt<OptimizationLevels> OptLevel(
- cl::desc("Choose level of optimization to apply:"),
- cl::init(OPT_FAST_COMPILE), cl::values(
- clEnumValN(OPT_FAST_COMPILE,"O0",
- "An alias for the -O1 option."),
- clEnumValN(OPT_FAST_COMPILE,"O1",
- "Optimize for linking speed, not execution speed."),
- clEnumValN(OPT_SIMPLE,"O2",
- "Perform only required/minimal optimizations"),
- clEnumValN(OPT_AGGRESSIVE,"O3",
- "An alias for the -O2 option."),
- clEnumValN(OPT_LINK_TIME,"O4",
- "Perform standard link time optimizations"),
- clEnumValN(OPT_AGGRESSIVE_LINK_TIME,"O5",
- "Perform aggressive link time optimizations"),
- clEnumValEnd
- )
-);
-
-static cl::opt<bool> DisableInline("disable-inlining",
- cl::desc("Do not run the inliner pass"));
-
-static cl::opt<bool>
-DisableOptimizations("disable-opt",
- cl::desc("Do not run any optimization passes"));
-
-static cl::opt<bool> DisableInternalize("disable-internalize",
- cl::desc("Do not mark all symbols as internal"));
-
-static cl::opt<bool> VerifyEach("verify-each",
- cl::desc("Verify intermediate results of all passes"));
-
-static cl::alias ExportDynamic("export-dynamic",
- cl::aliasopt(DisableInternalize),
- cl::desc("Alias for -disable-internalize"));
-
-static cl::opt<bool> Strip("strip-all",
- cl::desc("Strip all symbol info from executable"));
-
-static cl::alias A0("s", cl::desc("Alias for --strip-all"),
- cl::aliasopt(Strip));
-
-static cl::opt<bool> StripDebug("strip-debug",
- cl::desc("Strip debugger symbol info from executable"));
-
-static cl::alias A1("S", cl::desc("Alias for --strip-debug"),
- cl::aliasopt(StripDebug));
-
-// A utility function that adds a pass to the pass manager but will also add
-// a verifier pass after if we're supposed to verify.
-static inline void addPass(PassManager &PM, Pass *P) {
- // Add the pass to the pass manager...
- PM.add(P);
-
- // If we are verifying all of the intermediate steps, add the verifier...
- if (VerifyEach)
- PM.add(createVerifierPass());
-}
-
-namespace llvm {
-
-/// Optimize - Perform link time optimizations. This will run the scalar
-/// optimizations, any loaded plugin-optimization modules, and then the
-/// inter-procedural optimizations if applicable.
-void Optimize(Module* M) {
-
- // Instantiate the pass manager to organize the passes.
- PassManager Passes;
-
- // If we're verifying, start off with a verification pass.
- if (VerifyEach)
- Passes.add(createVerifierPass());
-
- // Add an appropriate TargetData instance for this module...
- addPass(Passes, new TargetData(M));
-
- if (!DisableOptimizations) {
- // Now that composite has been compiled, scan through the module, looking
- // for a main function. If main is defined, mark all other functions
- // internal.
- if (!DisableInternalize)
- addPass(Passes, createInternalizePass(true));
-
- // Propagate constants at call sites into the functions they call. This
- // opens opportunities for globalopt (and inlining) by substituting function
- // pointers passed as arguments to direct uses of functions.
- addPass(Passes, createIPSCCPPass());
-
- // Now that we internalized some globals, see if we can hack on them!
- addPass(Passes, createGlobalOptimizerPass());
-
- // Linking modules together can lead to duplicated global constants, only
- // keep one copy of each constant...
- addPass(Passes, createConstantMergePass());
-
- // Remove unused arguments from functions...
- addPass(Passes, createDeadArgEliminationPass());
-
- // Reduce the code after globalopt and ipsccp. Both can open up significant
- // simplification opportunities, and both can propagate functions through
- // function pointers. When this happens, we often have to resolve varargs
- // calls, etc, so let instcombine do this.
- addPass(Passes, createInstructionCombiningPass());
-
- if (!DisableInline)
- addPass(Passes, createFunctionInliningPass()); // Inline small functions
-
- addPass(Passes, createPruneEHPass()); // Remove dead EH info
- addPass(Passes, createGlobalOptimizerPass()); // Optimize globals again.
- addPass(Passes, createGlobalDCEPass()); // Remove dead functions
-
- // If we didn't decide to inline a function, check to see if we can
- // transform it to pass arguments by value instead of by reference.
- addPass(Passes, createArgumentPromotionPass());
-
- // The IPO passes may leave cruft around. Clean up after them.
- addPass(Passes, createInstructionCombiningPass());
- addPass(Passes, createJumpThreadingPass()); // Thread jumps.
- addPass(Passes, createScalarReplAggregatesPass()); // Break up allocas
-
- // Run a few AA driven optimizations here and now, to cleanup the code.
- addPass(Passes, createGlobalsModRefPass()); // IP alias analysis
-
- addPass(Passes, createLICMPass()); // Hoist loop invariants
- addPass(Passes, createGVNPass()); // Remove redundancies
- addPass(Passes, createMemCpyOptPass()); // Remove dead memcpy's
- addPass(Passes, createDeadStoreEliminationPass()); // Nuke dead stores
-
- // Cleanup and simplify the code after the scalar optimizations.
- addPass(Passes, createInstructionCombiningPass());
-
- addPass(Passes, createJumpThreadingPass()); // Thread jumps.
-
- // Delete basic blocks, which optimization passes may have killed...
- addPass(Passes, createCFGSimplificationPass());
-
- // Now that we have optimized the program, discard unreachable functions...
- addPass(Passes, createGlobalDCEPass());
- }
-
- // If the -s or -S command line options were specified, strip the symbols out
- // of the resulting program to make it smaller. -s and -S are GNU ld options
- // that we are supporting; they alias -strip-all and -strip-debug.
- if (Strip || StripDebug)
- addPass(Passes, createStripSymbolsPass(StripDebug && !Strip));
-
- // Create a new optimization pass for each one specified on the command line
- std::auto_ptr<TargetMachine> target;
- for (unsigned i = 0; i < OptimizationList.size(); ++i) {
- const PassInfo *Opt = OptimizationList[i];
- if (Opt->getNormalCtor())
- addPass(Passes, Opt->getNormalCtor()());
- else
- std::cerr << "llvm-ld: cannot create pass: " << Opt->getPassName()
- << "\n";
- }
-
- // The user's passes may leave cruft around. Clean up after them them but
- // only if we haven't got DisableOptimizations set
- if (!DisableOptimizations) {
- addPass(Passes, createInstructionCombiningPass());
- addPass(Passes, createCFGSimplificationPass());
- addPass(Passes, createDeadCodeEliminationPass());
- addPass(Passes, createGlobalDCEPass());
- }
-
- // Make sure everything is still good.
- if (!DontVerify)
- Passes.add(createVerifierPass());
-
- // Run our queue of passes all at once now, efficiently.
- Passes.run(*M);
-}
-
-}
diff --git a/release_23/tools/llvm-ld/llvm-ld.cpp b/release_23/tools/llvm-ld/llvm-ld.cpp
deleted file mode 100644
index 6657c7c7fd27..000000000000
--- a/release_23/tools/llvm-ld/llvm-ld.cpp
+++ /dev/null
@@ -1,666 +0,0 @@
-//===- llvm-ld.cpp - LLVM 'ld' compatible linker --------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This utility is intended to be compatible with GCC, and follows standard
-// system 'ld' conventions. As such, the default output file is ./a.out.
-// Additionally, this program outputs a shell script that is used to invoke LLI
-// to execute the program. In this manner, the generated executable (a.out for
-// example), is directly executable, whereas the bitcode file actually lives in
-// the a.out.bc file generated by this program. Also, Force is on by default.
-//
-// Note that if someone (or a script) deletes the executable program generated,
-// the .bc file will be left around. Considering that this is a temporary hack,
-// I'm not too worried about this.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/LinkAllVMCore.h"
-#include "llvm/Linker.h"
-#include "llvm/System/Program.h"
-#include "llvm/Module.h"
-#include "llvm/PassManager.h"
-#include "llvm/Bitcode/ReaderWriter.h"
-#include "llvm/Target/TargetData.h"
-#include "llvm/Target/TargetMachine.h"
-#include "llvm/Target/TargetMachineRegistry.h"
-#include "llvm/Support/CommandLine.h"
-#include "llvm/Support/FileUtilities.h"
-#include "llvm/Support/ManagedStatic.h"
-#include "llvm/Support/MemoryBuffer.h"
-#include "llvm/Support/Streams.h"
-#include "llvm/Support/SystemUtils.h"
-#include "llvm/System/Signals.h"
-#include <fstream>
-#include <memory>
-#include <cstring>
-using namespace llvm;
-
-// Input/Output Options
-static cl::list<std::string> InputFilenames(cl::Positional, cl::OneOrMore,
- cl::desc("<input bitcode files>"));
-
-static cl::opt<std::string> OutputFilename("o", cl::init("a.out"),
- cl::desc("Override output filename"),
- cl::value_desc("filename"));
-
-static cl::opt<bool> Verbose("v",
- cl::desc("Print information about actions taken"));
-
-static cl::list<std::string> LibPaths("L", cl::Prefix,
- cl::desc("Specify a library search path"),
- cl::value_desc("directory"));
-
-static cl::list<std::string> FrameworkPaths("F", cl::Prefix,
- cl::desc("Specify a framework search path"),
- cl::value_desc("directory"));
-
-static cl::list<std::string> Libraries("l", cl::Prefix,
- cl::desc("Specify libraries to link to"),
- cl::value_desc("library prefix"));
-
-static cl::list<std::string> Frameworks("framework",
- cl::desc("Specify frameworks to link to"),
- cl::value_desc("framework"));
-
-// Options to control the linking, optimization, and code gen processes
-static cl::opt<bool> LinkAsLibrary("link-as-library",
- cl::desc("Link the .bc files together as a library, not an executable"));
-
-static cl::alias Relink("r", cl::aliasopt(LinkAsLibrary),
- cl::desc("Alias for -link-as-library"));
-
-static cl::opt<bool> Native("native",
- cl::desc("Generate a native binary instead of a shell script"));
-
-static cl::opt<bool>NativeCBE("native-cbe",
- cl::desc("Generate a native binary with the C backend and GCC"));
-
-static cl::list<std::string> PostLinkOpts("post-link-opts",
- cl::value_desc("path"),
- cl::desc("Run one or more optimization programs after linking"));
-
-static cl::list<std::string> XLinker("Xlinker", cl::value_desc("option"),
- cl::desc("Pass options to the system linker"));
-
-// Compatibility options that llvm-ld ignores but are supported for
-// compatibility with LD
-static cl::opt<std::string> CO3("soname", cl::Hidden,
- cl::desc("Compatibility option: ignored"));
-
-static cl::opt<std::string> CO4("version-script", cl::Hidden,
- cl::desc("Compatibility option: ignored"));
-
-static cl::opt<bool> CO5("eh-frame-hdr", cl::Hidden,
- cl::desc("Compatibility option: ignored"));
-
-static cl::opt<std::string> CO6("h", cl::Hidden,
- cl::desc("Compatibility option: ignored"));
-
-static cl::opt<bool> CO7("start-group", cl::Hidden,
- cl::desc("Compatibility option: ignored"));
-
-static cl::opt<bool> CO8("end-group", cl::Hidden,
- cl::desc("Compatibility option: ignored"));
-
-/// This is just for convenience so it doesn't have to be passed around
-/// everywhere.
-static std::string progname;
-
-/// PrintAndExit - Prints a message to standard error and exits with error code
-///
-/// Inputs:
-/// Message - The message to print to standard error.
-///
-static void PrintAndExit(const std::string &Message, int errcode = 1) {
- cerr << progname << ": " << Message << "\n";
- llvm_shutdown();
- exit(errcode);
-}
-
-static void PrintCommand(const std::vector<const char*> &args) {
- std::vector<const char*>::const_iterator I = args.begin(), E = args.end();
- for (; I != E; ++I)
- if (*I)
- cout << "'" << *I << "'" << " ";
- cout << "\n" << std::flush;
-}
-
-/// CopyEnv - This function takes an array of environment variables and makes a
-/// copy of it. This copy can then be manipulated any way the caller likes
-/// without affecting the process's real environment.
-///
-/// Inputs:
-/// envp - An array of C strings containing an environment.
-///
-/// Return value:
-/// NULL - An error occurred.
-///
-/// Otherwise, a pointer to a new array of C strings is returned. Every string
-/// in the array is a duplicate of the one in the original array (i.e. we do
-/// not copy the char *'s from one array to another).
-///
-static char ** CopyEnv(char ** const envp) {
- // Count the number of entries in the old list;
- unsigned entries; // The number of entries in the old environment list
- for (entries = 0; envp[entries] != NULL; entries++)
- /*empty*/;
-
- // Add one more entry for the NULL pointer that ends the list.
- ++entries;
-
- // If there are no entries at all, just return NULL.
- if (entries == 0)
- return NULL;
-
- // Allocate a new environment list.
- char **newenv = new char* [entries];
- if ((newenv = new char* [entries]) == NULL)
- return NULL;
-
- // Make a copy of the list. Don't forget the NULL that ends the list.
- entries = 0;
- while (envp[entries] != NULL) {
- newenv[entries] = new char[strlen (envp[entries]) + 1];
- strcpy (newenv[entries], envp[entries]);
- ++entries;
- }
- newenv[entries] = NULL;
-
- return newenv;
-}
-
-
-/// RemoveEnv - Remove the specified environment variable from the environment
-/// array.
-///
-/// Inputs:
-/// name - The name of the variable to remove. It cannot be NULL.
-/// envp - The array of environment variables. It cannot be NULL.
-///
-/// Notes:
-/// This is mainly done because functions to remove items from the environment
-/// are not available across all platforms. In particular, Solaris does not
-/// seem to have an unsetenv() function or a setenv() function (or they are
-/// undocumented if they do exist).
-///
-static void RemoveEnv(const char * name, char ** const envp) {
- for (unsigned index=0; envp[index] != NULL; index++) {
- // Find the first equals sign in the array and make it an EOS character.
- char *p = strchr (envp[index], '=');
- if (p == NULL)
- continue;
- else
- *p = '\0';
-
- // Compare the two strings. If they are equal, zap this string.
- // Otherwise, restore it.
- if (!strcmp(name, envp[index]))
- *envp[index] = '\0';
- else
- *p = '=';
- }
-
- return;
-}
-
-/// GenerateBitcode - generates a bitcode file from the module provided
-void GenerateBitcode(Module* M, const std::string& FileName) {
-
- if (Verbose)
- cout << "Generating Bitcode To " << FileName << '\n';
-
- // Create the output file.
- std::ios::openmode io_mode = std::ios::out | std::ios::trunc |
- std::ios::binary;
- std::ofstream Out(FileName.c_str(), io_mode);
- if (!Out.good())
- PrintAndExit("error opening '" + FileName + "' for writing!");
-
- // Ensure that the bitcode file gets removed from the disk if we get a
- // terminating signal.
- sys::RemoveFileOnSignal(sys::Path(FileName));
-
- // Write it out
- WriteBitcodeToFile(M, Out);
-
- // Close the bitcode file.
- Out.close();
-}
-
-/// GenerateAssembly - generates a native assembly language source file from the
-/// specified bitcode file.
-///
-/// Inputs:
-/// InputFilename - The name of the input bitcode file.
-/// OutputFilename - The name of the file to generate.
-/// llc - The pathname to use for LLC.
-/// envp - The environment to use when running LLC.
-///
-/// Return non-zero value on error.
-///
-static int GenerateAssembly(const std::string &OutputFilename,
- const std::string &InputFilename,
- const sys::Path &llc,
- std::string &ErrMsg ) {
- // Run LLC to convert the bitcode file into assembly code.
- std::vector<const char*> args;
- args.push_back(llc.c_str());
- args.push_back("-f");
- args.push_back("-o");
- args.push_back(OutputFilename.c_str());
- args.push_back(InputFilename.c_str());
- args.push_back(0);
-
- if (Verbose) {
- cout << "Generating Assembly With: \n";
- PrintCommand(args);
- }
-
- return sys::Program::ExecuteAndWait(llc, &args[0], 0, 0, 0, 0, &ErrMsg);
-}
-
-/// GenerateCFile - generates a C source file from the specified bitcode file.
-static int GenerateCFile(const std::string &OutputFile,
- const std::string &InputFile,
- const sys::Path &llc,
- std::string& ErrMsg) {
- // Run LLC to convert the bitcode file into C.
- std::vector<const char*> args;
- args.push_back(llc.c_str());
- args.push_back("-march=c");
- args.push_back("-f");
- args.push_back("-o");
- args.push_back(OutputFile.c_str());
- args.push_back(InputFile.c_str());
- args.push_back(0);
-
- if (Verbose) {
- cout << "Generating C Source With: \n";
- PrintCommand(args);
- }
-
- return sys::Program::ExecuteAndWait(llc, &args[0], 0, 0, 0, 0, &ErrMsg);
-}
-
-/// GenerateNative - generates a native object file from the
-/// specified bitcode file.
-///
-/// Inputs:
-/// InputFilename - The name of the input bitcode file.
-/// OutputFilename - The name of the file to generate.
-/// NativeLinkItems - The native libraries, files, code with which to link
-/// LibPaths - The list of directories in which to find libraries.
-/// FrameworksPaths - The list of directories in which to find frameworks.
-/// Frameworks - The list of frameworks (dynamic libraries)
-/// gcc - The pathname to use for GGC.
-/// envp - A copy of the process's current environment.
-///
-/// Outputs:
-/// None.
-///
-/// Returns non-zero value on error.
-///
-static int GenerateNative(const std::string &OutputFilename,
- const std::string &InputFilename,
- const Linker::ItemList &LinkItems,
- const sys::Path &gcc, char ** const envp,
- std::string& ErrMsg) {
- // Remove these environment variables from the environment of the
- // programs that we will execute. It appears that GCC sets these
- // environment variables so that the programs it uses can configure
- // themselves identically.
- //
- // However, when we invoke GCC below, we want it to use its normal
- // configuration. Hence, we must sanitize its environment.
- char ** clean_env = CopyEnv(envp);
- if (clean_env == NULL)
- return 1;
- RemoveEnv("LIBRARY_PATH", clean_env);
- RemoveEnv("COLLECT_GCC_OPTIONS", clean_env);
- RemoveEnv("GCC_EXEC_PREFIX", clean_env);
- RemoveEnv("COMPILER_PATH", clean_env);
- RemoveEnv("COLLECT_GCC", clean_env);
-
-
- // Run GCC to assemble and link the program into native code.
- //
- // Note:
- // We can't just assemble and link the file with the system assembler
- // and linker because we don't know where to put the _start symbol.
- // GCC mysteriously knows how to do it.
- std::vector<std::string> args;
- args.push_back(gcc.c_str());
- args.push_back("-fno-strict-aliasing");
- args.push_back("-O3");
- args.push_back("-o");
- args.push_back(OutputFilename);
- args.push_back(InputFilename);
-
- // Add in the library and framework paths
- for (unsigned index = 0; index < LibPaths.size(); index++) {
- args.push_back("-L" + LibPaths[index]);
- }
- for (unsigned index = 0; index < FrameworkPaths.size(); index++) {
- args.push_back("-F" + FrameworkPaths[index]);
- }
-
- // Add the requested options
- for (unsigned index = 0; index < XLinker.size(); index++)
- args.push_back(XLinker[index]);
-
- // Add in the libraries to link.
- for (unsigned index = 0; index < LinkItems.size(); index++)
- if (LinkItems[index].first != "crtend") {
- if (LinkItems[index].second)
- args.push_back("-l" + LinkItems[index].first);
- else
- args.push_back(LinkItems[index].first);
- }
-
- // Add in frameworks to link.
- for (unsigned index = 0; index < Frameworks.size(); index++) {
- args.push_back("-framework");
- args.push_back(Frameworks[index]);
- }
-
- // Now that "args" owns all the std::strings for the arguments, call the c_str
- // method to get the underlying string array. We do this game so that the
- // std::string array is guaranteed to outlive the const char* array.
- std::vector<const char *> Args;
- for (unsigned i = 0, e = args.size(); i != e; ++i)
- Args.push_back(args[i].c_str());
- Args.push_back(0);
-
- if (Verbose) {
- cout << "Generating Native Executable With:\n";
- PrintCommand(Args);
- }
-
- // Run the compiler to assembly and link together the program.
- int R = sys::Program::ExecuteAndWait(
- gcc, &Args[0], (const char**)clean_env, 0, 0, 0, &ErrMsg);
- delete [] clean_env;
- return R;
-}
-
-/// EmitShellScript - Output the wrapper file that invokes the JIT on the LLVM
-/// bitcode file for the program.
-static void EmitShellScript(char **argv) {
- if (Verbose)
- cout << "Emitting Shell Script\n";
-#if defined(_WIN32) || defined(__CYGWIN__)
- // Windows doesn't support #!/bin/sh style shell scripts in .exe files. To
- // support windows systems, we copy the llvm-stub.exe executable from the
- // build tree to the destination file.
- std::string ErrMsg;
- sys::Path llvmstub = FindExecutable("llvm-stub.exe", argv[0]);
- if (llvmstub.isEmpty())
- PrintAndExit("Could not find llvm-stub.exe executable!");
-
- if (0 != sys::CopyFile(sys::Path(OutputFilename), llvmstub, &ErrMsg))
- PrintAndExit(ErrMsg);
-
- return;
-#endif
-
- // Output the script to start the program...
- std::ofstream Out2(OutputFilename.c_str());
- if (!Out2.good())
- PrintAndExit("error opening '" + OutputFilename + "' for writing!");
-
- Out2 << "#!/bin/sh\n";
- // Allow user to setenv LLVMINTERP if lli is not in their PATH.
- Out2 << "lli=${LLVMINTERP-lli}\n";
- Out2 << "exec $lli \\\n";
- // gcc accepts -l<lib> and implicitly searches /lib and /usr/lib.
- LibPaths.push_back("/lib");
- LibPaths.push_back("/usr/lib");
- LibPaths.push_back("/usr/X11R6/lib");
- // We don't need to link in libc! In fact, /usr/lib/libc.so may not be a
- // shared object at all! See RH 8: plain text.
- std::vector<std::string>::iterator libc =
- std::find(Libraries.begin(), Libraries.end(), "c");
- if (libc != Libraries.end()) Libraries.erase(libc);
- // List all the shared object (native) libraries this executable will need
- // on the command line, so that we don't have to do this manually!
- for (std::vector<std::string>::iterator i = Libraries.begin(),
- e = Libraries.end(); i != e; ++i) {
- sys::Path FullLibraryPath = sys::Path::FindLibrary(*i);
- if (!FullLibraryPath.isEmpty() && FullLibraryPath.isDynamicLibrary())
- Out2 << " -load=" << FullLibraryPath.toString() << " \\\n";
- }
- Out2 << " $0.bc ${1+\"$@\"}\n";
- Out2.close();
-}
-
-// BuildLinkItems -- This function generates a LinkItemList for the LinkItems
-// linker function by combining the Files and Libraries in the order they were
-// declared on the command line.
-static void BuildLinkItems(
- Linker::ItemList& Items,
- const cl::list<std::string>& Files,
- const cl::list<std::string>& Libraries) {
-
- // Build the list of linkage items for LinkItems.
-
- cl::list<std::string>::const_iterator fileIt = Files.begin();
- cl::list<std::string>::const_iterator libIt = Libraries.begin();
-
- int libPos = -1, filePos = -1;
- while ( libIt != Libraries.end() || fileIt != Files.end() ) {
- if (libIt != Libraries.end())
- libPos = Libraries.getPosition(libIt - Libraries.begin());
- else
- libPos = -1;
- if (fileIt != Files.end())
- filePos = Files.getPosition(fileIt - Files.begin());
- else
- filePos = -1;
-
- if (filePos != -1 && (libPos == -1 || filePos < libPos)) {
- // Add a source file
- Items.push_back(std::make_pair(*fileIt++, false));
- } else if (libPos != -1 && (filePos == -1 || libPos < filePos)) {
- // Add a library
- Items.push_back(std::make_pair(*libIt++, true));
- }
- }
-}
-
-// Rightly this should go in a header file but it just seems such a waste.
-namespace llvm {
-extern void Optimize(Module*);
-}
-
-int main(int argc, char **argv, char **envp) {
- llvm_shutdown_obj X; // Call llvm_shutdown() on exit.
- try {
- // Initial global variable above for convenience printing of program name.
- progname = sys::Path(argv[0]).getBasename();
-
- // Parse the command line options
- cl::ParseCommandLineOptions(argc, argv, "llvm linker\n");
- sys::PrintStackTraceOnErrorSignal();
-
- // Construct a Linker (now that Verbose is set)
- Linker TheLinker(progname, OutputFilename, Verbose);
-
- // Keep track of the native link items (versus the bitcode items)
- Linker::ItemList NativeLinkItems;
-
- // Add library paths to the linker
- TheLinker.addPaths(LibPaths);
- TheLinker.addSystemPaths();
-
- // Remove any consecutive duplicates of the same library...
- Libraries.erase(std::unique(Libraries.begin(), Libraries.end()),
- Libraries.end());
-
- if (LinkAsLibrary) {
- std::vector<sys::Path> Files;
- for (unsigned i = 0; i < InputFilenames.size(); ++i )
- Files.push_back(sys::Path(InputFilenames[i]));
- if (TheLinker.LinkInFiles(Files))
- return 1; // Error already printed
-
- // The libraries aren't linked in but are noted as "dependent" in the
- // module.
- for (cl::list<std::string>::const_iterator I = Libraries.begin(),
- E = Libraries.end(); I != E ; ++I) {
- TheLinker.getModule()->addLibrary(*I);
- }
- } else {
- // Build a list of the items from our command line
- Linker::ItemList Items;
- BuildLinkItems(Items, InputFilenames, Libraries);
-
- // Link all the items together
- if (TheLinker.LinkInItems(Items, NativeLinkItems) )
- return 1; // Error already printed
- }
-
- std::auto_ptr<Module> Composite(TheLinker.releaseModule());
-
- // Optimize the module
- Optimize(Composite.get());
-
- // Generate the bitcode for the optimized module.
- std::string RealBitcodeOutput = OutputFilename;
- if (!LinkAsLibrary) RealBitcodeOutput += ".bc";
- GenerateBitcode(Composite.get(), RealBitcodeOutput);
-
- // If we are not linking a library, generate either a native executable
- // or a JIT shell script, depending upon what the user wants.
- if (!LinkAsLibrary) {
- // If the user wants to run a post-link optimization, run it now.
- if (!PostLinkOpts.empty()) {
- std::vector<std::string> opts = PostLinkOpts;
- for (std::vector<std::string>::iterator I = opts.begin(),
- E = opts.end(); I != E; ++I) {
- sys::Path prog(*I);
- if (!prog.canExecute()) {
- prog = sys::Program::FindProgramByName(*I);
- if (prog.isEmpty())
- PrintAndExit(std::string("Optimization program '") + *I +
- "' is not found or not executable.");
- }
- // Get the program arguments
- sys::Path tmp_output("opt_result");
- std::string ErrMsg;
- if (tmp_output.createTemporaryFileOnDisk(true, &ErrMsg))
- PrintAndExit(ErrMsg);
-
- const char* args[4];
- args[0] = I->c_str();
- args[1] = RealBitcodeOutput.c_str();
- args[2] = tmp_output.c_str();
- args[3] = 0;
- if (0 == sys::Program::ExecuteAndWait(prog, args, 0,0,0,0, &ErrMsg)) {
- if (tmp_output.isBitcodeFile() || tmp_output.isBitcodeFile()) {
- sys::Path target(RealBitcodeOutput);
- target.eraseFromDisk();
- if (tmp_output.renamePathOnDisk(target, &ErrMsg))
- PrintAndExit(ErrMsg, 2);
- } else
- PrintAndExit("Post-link optimization output is not bitcode");
- } else {
- PrintAndExit(ErrMsg);
- }
- }
- }
-
- // If the user wants to generate a native executable, compile it from the
- // bitcode file.
- //
- // Otherwise, create a script that will run the bitcode through the JIT.
- if (Native) {
- // Name of the Assembly Language output file
- sys::Path AssemblyFile ( OutputFilename);
- AssemblyFile.appendSuffix("s");
-
- // Mark the output files for removal if we get an interrupt.
- sys::RemoveFileOnSignal(AssemblyFile);
- sys::RemoveFileOnSignal(sys::Path(OutputFilename));
-
- // Determine the locations of the llc and gcc programs.
- sys::Path llc = FindExecutable("llc", argv[0]);
- if (llc.isEmpty())
- PrintAndExit("Failed to find llc");
-
- sys::Path gcc = FindExecutable("gcc", argv[0]);
- if (gcc.isEmpty())
- PrintAndExit("Failed to find gcc");
-
- // Generate an assembly language file for the bitcode.
- std::string ErrMsg;
- if (0 != GenerateAssembly(AssemblyFile.toString(), RealBitcodeOutput,
- llc, ErrMsg))
- PrintAndExit(ErrMsg);
-
- if (0 != GenerateNative(OutputFilename, AssemblyFile.toString(),
- NativeLinkItems, gcc, envp, ErrMsg))
- PrintAndExit(ErrMsg);
-
- // Remove the assembly language file.
- AssemblyFile.eraseFromDisk();
- } else if (NativeCBE) {
- sys::Path CFile (OutputFilename);
- CFile.appendSuffix("cbe.c");
-
- // Mark the output files for removal if we get an interrupt.
- sys::RemoveFileOnSignal(CFile);
- sys::RemoveFileOnSignal(sys::Path(OutputFilename));
-
- // Determine the locations of the llc and gcc programs.
- sys::Path llc = FindExecutable("llc", argv[0]);
- if (llc.isEmpty())
- PrintAndExit("Failed to find llc");
-
- sys::Path gcc = FindExecutable("gcc", argv[0]);
- if (gcc.isEmpty())
- PrintAndExit("Failed to find gcc");
-
- // Generate an assembly language file for the bitcode.
- std::string ErrMsg;
- if (0 != GenerateCFile(
- CFile.toString(), RealBitcodeOutput, llc, ErrMsg))
- PrintAndExit(ErrMsg);
-
- if (0 != GenerateNative(OutputFilename, CFile.toString(),
- NativeLinkItems, gcc, envp, ErrMsg))
- PrintAndExit(ErrMsg);
-
- // Remove the assembly language file.
- CFile.eraseFromDisk();
-
- } else {
- EmitShellScript(argv);
- }
-
- // Make the script executable...
- std::string ErrMsg;
- if (sys::Path(OutputFilename).makeExecutableOnDisk(&ErrMsg))
- PrintAndExit(ErrMsg);
-
- // Make the bitcode file readable and directly executable in LLEE as well
- if (sys::Path(RealBitcodeOutput).makeExecutableOnDisk(&ErrMsg))
- PrintAndExit(ErrMsg);
-
- if (sys::Path(RealBitcodeOutput).makeReadableOnDisk(&ErrMsg))
- PrintAndExit(ErrMsg);
- }
- } catch (const std::string& msg) {
- PrintAndExit(msg,2);
- } catch (...) {
- PrintAndExit("Unexpected unknown exception occurred.", 2);
- }
-
- // Graceful exit
- return 0;
-}
diff --git a/release_23/tools/llvm-link/Makefile b/release_23/tools/llvm-link/Makefile
deleted file mode 100644
index fdb1c196feb5..000000000000
--- a/release_23/tools/llvm-link/Makefile
+++ /dev/null
@@ -1,14 +0,0 @@
-##===- tools/llvm-link/Makefile ----------------------------*- Makefile -*-===##
-#
-# The LLVM Compiler Infrastructure
-#
-# This file is distributed under the University of Illinois Open Source
-# License. See LICENSE.TXT for details.
-#
-##===----------------------------------------------------------------------===##
-LEVEL = ../..
-
-TOOLNAME = llvm-link
-LINK_COMPONENTS = linker bitreader bitwriter
-
-include $(LEVEL)/Makefile.common
diff --git a/release_23/tools/llvm-link/llvm-link.cpp b/release_23/tools/llvm-link/llvm-link.cpp
deleted file mode 100644
index 6c595701c60a..000000000000
--- a/release_23/tools/llvm-link/llvm-link.cpp
+++ /dev/null
@@ -1,150 +0,0 @@
-//===- llvm-link.cpp - Low-level LLVM linker ------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This utility may be invoked in the following manner:
-// llvm-link a.bc b.bc c.bc -o x.bc
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Linker.h"
-#include "llvm/Module.h"
-#include "llvm/Analysis/Verifier.h"
-#include "llvm/Bitcode/ReaderWriter.h"
-#include "llvm/Support/CommandLine.h"
-#include "llvm/Support/ManagedStatic.h"
-#include "llvm/Support/MemoryBuffer.h"
-#include "llvm/System/Signals.h"
-#include "llvm/System/Path.h"
-#include <fstream>
-#include <iostream>
-#include <memory>
-using namespace llvm;
-
-static cl::list<std::string>
-InputFilenames(cl::Positional, cl::OneOrMore,
- cl::desc("<input bitcode files>"));
-
-static cl::opt<std::string>
-OutputFilename("o", cl::desc("Override output filename"), cl::init("-"),
- cl::value_desc("filename"));
-
-static cl::opt<bool> Force("f", cl::desc("Overwrite output files"));
-
-static cl::opt<bool>
-Verbose("v", cl::desc("Print information about actions taken"));
-
-static cl::opt<bool>
-DumpAsm("d", cl::desc("Print assembly as linked"), cl::Hidden);
-
-// LoadFile - Read the specified bitcode file in and return it. This routine
-// searches the link path for the specified file to try to find it...
-//
-static inline std::auto_ptr<Module> LoadFile(const std::string &FN) {
- sys::Path Filename;
- if (!Filename.set(FN)) {
- cerr << "Invalid file name: '" << FN << "'\n";
- return std::auto_ptr<Module>();
- }
-
- std::string ErrorMessage;
- if (Filename.exists()) {
- if (Verbose) cerr << "Loading '" << Filename.c_str() << "'\n";
- Module* Result = 0;
-
- const std::string &FNStr = Filename.toString();
- if (MemoryBuffer *Buffer = MemoryBuffer::getFileOrSTDIN(FNStr,
- &ErrorMessage)) {
- Result = ParseBitcodeFile(Buffer, &ErrorMessage);
- delete Buffer;
- }
- if (Result) return std::auto_ptr<Module>(Result); // Load successful!
-
- if (Verbose) {
- cerr << "Error opening bitcode file: '" << Filename.c_str() << "'";
- if (ErrorMessage.size()) cerr << ": " << ErrorMessage;
- cerr << "\n";
- }
- } else {
- cerr << "Bitcode file: '" << Filename.c_str() << "' does not exist.\n";
- }
-
- return std::auto_ptr<Module>();
-}
-
-int main(int argc, char **argv) {
- llvm_shutdown_obj X; // Call llvm_shutdown() on exit.
- cl::ParseCommandLineOptions(argc, argv, "llvm linker\n");
- sys::PrintStackTraceOnErrorSignal();
- assert(InputFilenames.size() > 0 && "OneOrMore is not working");
-
- unsigned BaseArg = 0;
- std::string ErrorMessage;
-
- std::auto_ptr<Module> Composite(LoadFile(InputFilenames[BaseArg]));
- if (Composite.get() == 0) {
- cerr << argv[0] << ": error loading file '"
- << InputFilenames[BaseArg] << "'\n";
- return 1;
- }
-
- for (unsigned i = BaseArg+1; i < InputFilenames.size(); ++i) {
- std::auto_ptr<Module> M(LoadFile(InputFilenames[i]));
- if (M.get() == 0) {
- cerr << argv[0] << ": error loading file '" <<InputFilenames[i]<< "'\n";
- return 1;
- }
-
- if (Verbose) cerr << "Linking in '" << InputFilenames[i] << "'\n";
-
- if (Linker::LinkModules(Composite.get(), M.get(), &ErrorMessage)) {
- cerr << argv[0] << ": link error in '" << InputFilenames[i]
- << "': " << ErrorMessage << "\n";
- return 1;
- }
- }
-
- // TODO: Iterate over the -l list and link in any modules containing
- // global symbols that have not been resolved so far.
-
- if (DumpAsm) cerr << "Here's the assembly:\n" << *Composite.get();
-
- // FIXME: cout is not binary!
- std::ostream *Out = &std::cout; // Default to printing to stdout...
- if (OutputFilename != "-") {
- if (!Force && std::ifstream(OutputFilename.c_str())) {
- // If force is not specified, make sure not to overwrite a file!
- cerr << argv[0] << ": error opening '" << OutputFilename
- << "': file exists!\n"
- << "Use -f command line argument to force output\n";
- return 1;
- }
- std::ios::openmode io_mode = std::ios::out | std::ios::trunc |
- std::ios::binary;
- Out = new std::ofstream(OutputFilename.c_str(), io_mode);
- if (!Out->good()) {
- cerr << argv[0] << ": error opening '" << OutputFilename << "'!\n";
- return 1;
- }
-
- // Make sure that the Out file gets unlinked from the disk if we get a
- // SIGINT
- sys::RemoveFileOnSignal(sys::Path(OutputFilename));
- }
-
- if (verifyModule(*Composite.get())) {
- cerr << argv[0] << ": linked module is broken!\n";
- return 1;
- }
-
- if (Verbose) cerr << "Writing bitcode...\n";
- WriteBitcodeToFile(Composite.get(), *Out);
-
- if (Out != &std::cout) delete Out;
- return 0;
-}
diff --git a/release_23/tools/llvm-nm/Makefile b/release_23/tools/llvm-nm/Makefile
deleted file mode 100644
index ee495bf4e9e5..000000000000
--- a/release_23/tools/llvm-nm/Makefile
+++ /dev/null
@@ -1,14 +0,0 @@
-##===- tools/llvm-nm/Makefile ------------------------------*- Makefile -*-===##
-#
-# The LLVM Compiler Infrastructure
-#
-# This file is distributed under the University of Illinois Open Source
-# License. See LICENSE.TXT for details.
-#
-##===----------------------------------------------------------------------===##
-LEVEL = ../..
-
-TOOLNAME = llvm-nm
-LINK_COMPONENTS = archive bitreader
-
-include $(LEVEL)/Makefile.common
diff --git a/release_23/tools/llvm-nm/llvm-nm.cpp b/release_23/tools/llvm-nm/llvm-nm.cpp
deleted file mode 100644
index 63fa75d884f1..000000000000
--- a/release_23/tools/llvm-nm/llvm-nm.cpp
+++ /dev/null
@@ -1,184 +0,0 @@
-//===-- llvm-nm.cpp - Symbol table dumping utility for llvm ---------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This program is a utility that works like traditional Unix "nm",
-// that is, it prints out the names of symbols in a bitcode file,
-// along with some information about each symbol.
-//
-// This "nm" does not print symbols' addresses. It supports many of
-// the features of GNU "nm", including its different output formats.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Module.h"
-#include "llvm/Bitcode/ReaderWriter.h"
-#include "llvm/Bitcode/Archive.h"
-#include "llvm/Support/CommandLine.h"
-#include "llvm/Support/ManagedStatic.h"
-#include "llvm/Support/MemoryBuffer.h"
-#include "llvm/System/Signals.h"
-#include <algorithm>
-#include <cctype>
-#include <cerrno>
-#include <cstring>
-#include <iostream>
-using namespace llvm;
-
-namespace {
- enum OutputFormatTy { bsd, sysv, posix };
- cl::opt<OutputFormatTy>
- OutputFormat("format",
- cl::desc("Specify output format"),
- cl::values(clEnumVal(bsd, "BSD format"),
- clEnumVal(sysv, "System V format"),
- clEnumVal(posix, "POSIX.2 format"),
- clEnumValEnd), cl::init(bsd));
- cl::alias OutputFormat2("f", cl::desc("Alias for --format"),
- cl::aliasopt(OutputFormat));
-
- cl::list<std::string>
- InputFilenames(cl::Positional, cl::desc("<input bitcode files>"),
- cl::ZeroOrMore);
-
- cl::opt<bool> UndefinedOnly("undefined-only",
- cl::desc("Show only undefined symbols"));
- cl::alias UndefinedOnly2("u", cl::desc("Alias for --undefined-only"),
- cl::aliasopt(UndefinedOnly));
-
- cl::opt<bool> DefinedOnly("defined-only",
- cl::desc("Show only defined symbols"));
-
- cl::opt<bool> ExternalOnly("extern-only",
- cl::desc("Show only external symbols"));
- cl::alias ExternalOnly2("g", cl::desc("Alias for --extern-only"),
- cl::aliasopt(ExternalOnly));
-
- cl::opt<bool> BSDFormat("B", cl::desc("Alias for --format=bsd"));
- cl::opt<bool> POSIXFormat("P", cl::desc("Alias for --format=posix"));
-
- bool MultipleFiles = false;
-
- std::string ToolName;
-}
-
-static char TypeCharForSymbol(GlobalValue &GV) {
- if (GV.isDeclaration()) return 'U';
- if (GV.hasLinkOnceLinkage()) return 'C';
- if (GV.hasWeakLinkage()) return 'W';
- if (isa<Function>(GV) && GV.hasInternalLinkage()) return 't';
- if (isa<Function>(GV)) return 'T';
- if (isa<GlobalVariable>(GV) && GV.hasInternalLinkage()) return 'd';
- if (isa<GlobalVariable>(GV)) return 'D';
- if (const GlobalAlias *GA = dyn_cast<GlobalAlias>(&GV)) {
- const GlobalValue *AliasedGV = GA->getAliasedGlobal();
- if (isa<Function>(AliasedGV)) return 'T';
- if (isa<GlobalVariable>(AliasedGV)) return 'D';
- }
- return '?';
-}
-
-static void DumpSymbolNameForGlobalValue(GlobalValue &GV) {
- const std::string SymbolAddrStr = " "; // Not used yet...
- char TypeChar = TypeCharForSymbol (GV);
- if ((TypeChar != 'U') && UndefinedOnly)
- return;
- if ((TypeChar == 'U') && DefinedOnly)
- return;
- if (GV.hasInternalLinkage () && ExternalOnly)
- return;
- if (OutputFormat == posix) {
- std::cout << GV.getName () << " " << TypeCharForSymbol (GV) << " "
- << SymbolAddrStr << "\n";
- } else if (OutputFormat == bsd) {
- std::cout << SymbolAddrStr << " " << TypeCharForSymbol (GV) << " "
- << GV.getName () << "\n";
- } else if (OutputFormat == sysv) {
- std::string PaddedName (GV.getName ());
- while (PaddedName.length () < 20)
- PaddedName += " ";
- std::cout << PaddedName << "|" << SymbolAddrStr << "| "
- << TypeCharForSymbol (GV)
- << " | | | |\n";
- }
-}
-
-static void DumpSymbolNamesFromModule(Module *M) {
- const std::string &Filename = M->getModuleIdentifier ();
- if (OutputFormat == posix && MultipleFiles) {
- std::cout << Filename << ":\n";
- } else if (OutputFormat == bsd && MultipleFiles) {
- std::cout << "\n" << Filename << ":\n";
- } else if (OutputFormat == sysv) {
- std::cout << "\n\nSymbols from " << Filename << ":\n\n"
- << "Name Value Class Type"
- << " Size Line Section\n";
- }
- std::for_each (M->begin (), M->end (), DumpSymbolNameForGlobalValue);
- std::for_each (M->global_begin (), M->global_end (),
- DumpSymbolNameForGlobalValue);
- std::for_each (M->alias_begin (), M->alias_end (),
- DumpSymbolNameForGlobalValue);
-}
-
-static void DumpSymbolNamesFromFile(std::string &Filename) {
- std::string ErrorMessage;
- sys::Path aPath(Filename);
- // Note: Currently we do not support reading an archive from stdin.
- if (Filename == "-" || aPath.isBitcodeFile()) {
- std::auto_ptr<MemoryBuffer> Buffer(
- MemoryBuffer::getFileOrSTDIN(Filename, &ErrorMessage));
- Module *Result = 0;
- if (Buffer.get())
- Result = ParseBitcodeFile(Buffer.get(), &ErrorMessage);
-
- if (Result)
- DumpSymbolNamesFromModule(Result);
- else {
- std::cerr << ToolName << ": " << Filename << ": " << ErrorMessage << "\n";
- return;
- }
-
- } else if (aPath.isArchive()) {
- std::string ErrMsg;
- Archive* archive = Archive::OpenAndLoad(sys::Path(Filename), &ErrorMessage);
- if (!archive)
- std::cerr << ToolName << ": " << Filename << ": " << ErrorMessage << "\n";
- std::vector<Module *> Modules;
- if (archive->getAllModules(Modules, &ErrorMessage)) {
- std::cerr << ToolName << ": " << Filename << ": " << ErrorMessage << "\n";
- return;
- }
- MultipleFiles = true;
- std::for_each (Modules.begin(), Modules.end(), DumpSymbolNamesFromModule);
- } else {
- std::cerr << ToolName << ": " << Filename << ": "
- << "unrecognizable file type\n";
- return;
- }
-}
-
-int main(int argc, char **argv) {
- llvm_shutdown_obj X; // Call llvm_shutdown() on exit.
- cl::ParseCommandLineOptions(argc, argv, "llvm symbol table dumper\n");
- sys::PrintStackTraceOnErrorSignal();
-
- ToolName = argv[0];
- if (BSDFormat) OutputFormat = bsd;
- if (POSIXFormat) OutputFormat = posix;
-
- switch (InputFilenames.size()) {
- case 0: InputFilenames.push_back("-");
- case 1: break;
- default: MultipleFiles = true;
- }
-
- std::for_each(InputFilenames.begin(), InputFilenames.end(),
- DumpSymbolNamesFromFile);
- return 0;
-}
diff --git a/release_23/tools/llvm-prof/Makefile b/release_23/tools/llvm-prof/Makefile
deleted file mode 100644
index d9beabb433db..000000000000
--- a/release_23/tools/llvm-prof/Makefile
+++ /dev/null
@@ -1,15 +0,0 @@
-##===- tools/llvm-prof/Makefile ----------------------------*- Makefile -*-===##
-#
-# The LLVM Compiler Infrastructure
-#
-# This file is distributed under the University of Illinois Open Source
-# License. See LICENSE.TXT for details.
-#
-##===----------------------------------------------------------------------===##
-LEVEL = ../..
-
-TOOLNAME = llvm-prof
-LINK_COMPONENTS = bitreader analysis
-REQUIRES_EH := 1
-
-include $(LEVEL)/Makefile.common
diff --git a/release_23/tools/llvm-prof/llvm-prof.cpp b/release_23/tools/llvm-prof/llvm-prof.cpp
deleted file mode 100644
index 17a8e53607b4..000000000000
--- a/release_23/tools/llvm-prof/llvm-prof.cpp
+++ /dev/null
@@ -1,251 +0,0 @@
-//===- llvm-prof.cpp - Read in and process llvmprof.out data files --------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This tools is meant for use with the various LLVM profiling instrumentation
-// passes. It reads in the data file produced by executing an instrumented
-// program, and outputs a nice report.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/InstrTypes.h"
-#include "llvm/Module.h"
-#include "llvm/Assembly/AsmAnnotationWriter.h"
-#include "llvm/Analysis/ProfileInfoLoader.h"
-#include "llvm/Bitcode/ReaderWriter.h"
-#include "llvm/Support/CommandLine.h"
-#include "llvm/Support/ManagedStatic.h"
-#include "llvm/Support/MemoryBuffer.h"
-#include "llvm/System/Signals.h"
-#include <algorithm>
-#include <iostream>
-#include <iomanip>
-#include <map>
-#include <set>
-
-using namespace llvm;
-
-namespace {
- cl::opt<std::string>
- BitcodeFile(cl::Positional, cl::desc("<program bitcode file>"),
- cl::Required);
-
- cl::opt<std::string>
- ProfileDataFile(cl::Positional, cl::desc("<llvmprof.out file>"),
- cl::Optional, cl::init("llvmprof.out"));
-
- cl::opt<bool>
- PrintAnnotatedLLVM("annotated-llvm",
- cl::desc("Print LLVM code with frequency annotations"));
- cl::alias PrintAnnotated2("A", cl::desc("Alias for --annotated-llvm"),
- cl::aliasopt(PrintAnnotatedLLVM));
- cl::opt<bool>
- PrintAllCode("print-all-code",
- cl::desc("Print annotated code for the entire program"));
-}
-
-// PairSecondSort - A sorting predicate to sort by the second element of a pair.
-template<class T>
-struct PairSecondSortReverse
- : public std::binary_function<std::pair<T, unsigned>,
- std::pair<T, unsigned>, bool> {
- bool operator()(const std::pair<T, unsigned> &LHS,
- const std::pair<T, unsigned> &RHS) const {
- return LHS.second > RHS.second;
- }
-};
-
-namespace {
- class ProfileAnnotator : public AssemblyAnnotationWriter {
- std::map<const Function *, unsigned> &FuncFreqs;
- std::map<const BasicBlock*, unsigned> &BlockFreqs;
- std::map<ProfileInfoLoader::Edge, unsigned> &EdgeFreqs;
- public:
- ProfileAnnotator(std::map<const Function *, unsigned> &FF,
- std::map<const BasicBlock*, unsigned> &BF,
- std::map<ProfileInfoLoader::Edge, unsigned> &EF)
- : FuncFreqs(FF), BlockFreqs(BF), EdgeFreqs(EF) {}
-
- virtual void emitFunctionAnnot(const Function *F, std::ostream &OS) {
- OS << ";;; %" << F->getName() << " called " << FuncFreqs[F]
- << " times.\n;;;\n";
- }
- virtual void emitBasicBlockStartAnnot(const BasicBlock *BB,
- std::ostream &OS) {
- if (BlockFreqs.empty()) return;
- if (unsigned Count = BlockFreqs[BB])
- OS << "\t;;; Basic block executed " << Count << " times.\n";
- else
- OS << "\t;;; Never executed!\n";
- }
-
- virtual void emitBasicBlockEndAnnot(const BasicBlock *BB, std::ostream &OS){
- if (EdgeFreqs.empty()) return;
-
- // Figure out how many times each successor executed.
- std::vector<std::pair<const BasicBlock*, unsigned> > SuccCounts;
- const TerminatorInst *TI = BB->getTerminator();
-
- std::map<ProfileInfoLoader::Edge, unsigned>::iterator I =
- EdgeFreqs.lower_bound(std::make_pair(const_cast<BasicBlock*>(BB), 0U));
- for (; I != EdgeFreqs.end() && I->first.first == BB; ++I)
- if (I->second)
- SuccCounts.push_back(std::make_pair(TI->getSuccessor(I->first.second),
- I->second));
- if (!SuccCounts.empty()) {
- OS << "\t;;; Out-edge counts:";
- for (unsigned i = 0, e = SuccCounts.size(); i != e; ++i)
- OS << " [" << SuccCounts[i].second << " -> "
- << SuccCounts[i].first->getName() << "]";
- OS << "\n";
- }
- }
- };
-}
-
-
-int main(int argc, char **argv) {
- llvm_shutdown_obj X; // Call llvm_shutdown() on exit.
- try {
- cl::ParseCommandLineOptions(argc, argv, "llvm profile dump decoder\n");
- sys::PrintStackTraceOnErrorSignal();
-
- // Read in the bitcode file...
- std::string ErrorMessage;
- Module *M = 0;
- if (MemoryBuffer *Buffer = MemoryBuffer::getFileOrSTDIN(BitcodeFile,
- &ErrorMessage)) {
- M = ParseBitcodeFile(Buffer, &ErrorMessage);
- delete Buffer;
- }
- if (M == 0) {
- std::cerr << argv[0] << ": " << BitcodeFile << ": "
- << ErrorMessage << "\n";
- return 1;
- }
-
- // Read the profiling information
- ProfileInfoLoader PI(argv[0], ProfileDataFile, *M);
-
- std::map<const Function *, unsigned> FuncFreqs;
- std::map<const BasicBlock*, unsigned> BlockFreqs;
- std::map<ProfileInfoLoader::Edge, unsigned> EdgeFreqs;
-
- // Output a report. Eventually, there will be multiple reports selectable on
- // the command line, for now, just keep things simple.
-
- // Emit the most frequent function table...
- std::vector<std::pair<Function*, unsigned> > FunctionCounts;
- PI.getFunctionCounts(FunctionCounts);
- FuncFreqs.insert(FunctionCounts.begin(), FunctionCounts.end());
-
- // Sort by the frequency, backwards.
- sort(FunctionCounts.begin(), FunctionCounts.end(),
- PairSecondSortReverse<Function*>());
-
- uint64_t TotalExecutions = 0;
- for (unsigned i = 0, e = FunctionCounts.size(); i != e; ++i)
- TotalExecutions += FunctionCounts[i].second;
-
- std::cout << "===" << std::string(73, '-') << "===\n"
- << "LLVM profiling output for execution";
- if (PI.getNumExecutions() != 1) std::cout << "s";
- std::cout << ":\n";
-
- for (unsigned i = 0, e = PI.getNumExecutions(); i != e; ++i) {
- std::cout << " ";
- if (e != 1) std::cout << i+1 << ". ";
- std::cout << PI.getExecution(i) << "\n";
- }
-
- std::cout << "\n===" << std::string(73, '-') << "===\n";
- std::cout << "Function execution frequencies:\n\n";
-
- // Print out the function frequencies...
- std::cout << " ## Frequency\n";
- for (unsigned i = 0, e = FunctionCounts.size(); i != e; ++i) {
- if (FunctionCounts[i].second == 0) {
- std::cout << "\n NOTE: " << e-i << " function" <<
- (e-i-1 ? "s were" : " was") << " never executed!\n";
- break;
- }
-
- std::cout << std::setw(3) << i+1 << ". "
- << std::setw(5) << FunctionCounts[i].second << "/"
- << TotalExecutions << " "
- << FunctionCounts[i].first->getName().c_str() << "\n";
- }
-
- std::set<Function*> FunctionsToPrint;
-
- // If we have block count information, print out the LLVM module with
- // frequency annotations.
- if (PI.hasAccurateBlockCounts()) {
- std::vector<std::pair<BasicBlock*, unsigned> > Counts;
- PI.getBlockCounts(Counts);
-
- TotalExecutions = 0;
- for (unsigned i = 0, e = Counts.size(); i != e; ++i)
- TotalExecutions += Counts[i].second;
-
- // Sort by the frequency, backwards.
- sort(Counts.begin(), Counts.end(),
- PairSecondSortReverse<BasicBlock*>());
-
- std::cout << "\n===" << std::string(73, '-') << "===\n";
- std::cout << "Top 20 most frequently executed basic blocks:\n\n";
-
- // Print out the function frequencies...
- std::cout <<" ## %% \tFrequency\n";
- unsigned BlocksToPrint = Counts.size();
- if (BlocksToPrint > 20) BlocksToPrint = 20;
- for (unsigned i = 0; i != BlocksToPrint; ++i) {
- if (Counts[i].second == 0) break;
- Function *F = Counts[i].first->getParent();
- std::cout << std::setw(3) << i+1 << ". "
- << std::setw(5) << std::setprecision(2)
- << Counts[i].second/(double)TotalExecutions*100 << "% "
- << std::setw(5) << Counts[i].second << "/"
- << TotalExecutions << "\t"
- << F->getName().c_str() << "() - "
- << Counts[i].first->getName().c_str() << "\n";
- FunctionsToPrint.insert(F);
- }
-
- BlockFreqs.insert(Counts.begin(), Counts.end());
- }
-
- if (PI.hasAccurateEdgeCounts()) {
- std::vector<std::pair<ProfileInfoLoader::Edge, unsigned> > Counts;
- PI.getEdgeCounts(Counts);
- EdgeFreqs.insert(Counts.begin(), Counts.end());
- }
-
- if (PrintAnnotatedLLVM || PrintAllCode) {
- std::cout << "\n===" << std::string(73, '-') << "===\n";
- std::cout << "Annotated LLVM code for the module:\n\n";
-
- ProfileAnnotator PA(FuncFreqs, BlockFreqs, EdgeFreqs);
-
- if (FunctionsToPrint.empty() || PrintAllCode)
- M->print(std::cout, &PA);
- else
- // Print just a subset of the functions...
- for (std::set<Function*>::iterator I = FunctionsToPrint.begin(),
- E = FunctionsToPrint.end(); I != E; ++I)
- (*I)->print(std::cout, &PA);
- }
-
- return 0;
- } catch (const std::string& msg) {
- std::cerr << argv[0] << ": " << msg << "\n";
- } catch (...) {
- std::cerr << argv[0] << ": Unexpected unknown exception occurred.\n";
- }
- return 1;
-}
diff --git a/release_23/tools/llvm-ranlib/Makefile b/release_23/tools/llvm-ranlib/Makefile
deleted file mode 100644
index 1d315c2b82e2..000000000000
--- a/release_23/tools/llvm-ranlib/Makefile
+++ /dev/null
@@ -1,15 +0,0 @@
-##===- tools/llvm-ranlib/Makefile --------------------------*- Makefile -*-===##
-#
-# The LLVM Compiler Infrastructure
-#
-# This file is distributed under the University of Illinois Open Source
-# License. See LICENSE.TXT for details.
-#
-##===----------------------------------------------------------------------===##
-
-LEVEL = ../..
-TOOLNAME = llvm-ranlib
-LINK_COMPONENTS = archive
-REQUIRES_EH := 1
-
-include $(LEVEL)/Makefile.common
diff --git a/release_23/tools/llvm-ranlib/llvm-ranlib.cpp b/release_23/tools/llvm-ranlib/llvm-ranlib.cpp
deleted file mode 100644
index 43f66a4c226f..000000000000
--- a/release_23/tools/llvm-ranlib/llvm-ranlib.cpp
+++ /dev/null
@@ -1,96 +0,0 @@
-//===-- llvm-ranlib.cpp - LLVM archive index generator --------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// Adds or updates an index (symbol table) for an LLVM archive file.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Module.h"
-#include "llvm/Bitcode/Archive.h"
-#include "llvm/Support/CommandLine.h"
-#include "llvm/Support/ManagedStatic.h"
-#include "llvm/System/Signals.h"
-#include <iostream>
-#include <iomanip>
-#include <memory>
-
-using namespace llvm;
-
-// llvm-ar operation code and modifier flags
-static cl::opt<std::string>
-ArchiveName(cl::Positional, cl::Optional, cl::desc("<archive-file>"));
-
-static cl::opt<bool>
-Verbose("verbose",cl::Optional,cl::init(false),
- cl::desc("Print the symbol table"));
-
-// printSymbolTable - print out the archive's symbol table.
-void printSymbolTable(Archive* TheArchive) {
- std::cout << "\nArchive Symbol Table:\n";
- const Archive::SymTabType& symtab = TheArchive->getSymbolTable();
- for (Archive::SymTabType::const_iterator I=symtab.begin(), E=symtab.end();
- I != E; ++I ) {
- unsigned offset = TheArchive->getFirstFileOffset() + I->second;
- std::cout << " " << std::setw(9) << offset << "\t" << I->first <<"\n";
- }
-}
-
-int main(int argc, char **argv) {
- llvm_shutdown_obj X; // Call llvm_shutdown() on exit.
-
- // Have the command line options parsed and handle things
- // like --help and --version.
- cl::ParseCommandLineOptions(argc, argv,
- "LLVM Archive Index Generator (llvm-ranlib)\n\n"
- " This program adds or updates an index of bitcode symbols\n"
- " to an LLVM archive file."
- );
-
- // Print a stack trace if we signal out.
- sys::PrintStackTraceOnErrorSignal();
-
- int exitCode = 0;
-
- // Make sure we don't exit with "unhandled exception".
- try {
-
- // Check the path name of the archive
- sys::Path ArchivePath;
- if (!ArchivePath.set(ArchiveName))
- throw std::string("Archive name invalid: ") + ArchiveName;
-
- // Make sure it exists, we don't create empty archives
- if (!ArchivePath.exists())
- throw std::string("Archive file does not exist");
-
- std::string err_msg;
- std::auto_ptr<Archive>
- AutoArchive(Archive::OpenAndLoad(ArchivePath,&err_msg));
- Archive* TheArchive = AutoArchive.get();
- if (!TheArchive)
- throw err_msg;
-
- if (TheArchive->writeToDisk(true, false, false, &err_msg ))
- throw err_msg;
-
- if (Verbose)
- printSymbolTable(TheArchive);
-
- } catch (const char*msg) {
- std::cerr << argv[0] << ": " << msg << "\n\n";
- exitCode = 1;
- } catch (const std::string& msg) {
- std::cerr << argv[0] << ": " << msg << "\n";
- exitCode = 2;
- } catch (...) {
- std::cerr << argv[0] << ": An unexpected unknown exception occurred.\n";
- exitCode = 3;
- }
- return exitCode;
-}
diff --git a/release_23/tools/llvm-stub/Makefile b/release_23/tools/llvm-stub/Makefile
deleted file mode 100644
index 7ffe14976bb5..000000000000
--- a/release_23/tools/llvm-stub/Makefile
+++ /dev/null
@@ -1,13 +0,0 @@
-##===- tools/llvm-stub/Makefile ----------------------------*- Makefile -*-===##
-#
-# The LLVM Compiler Infrastructure
-#
-# This file is distributed under the University of Illinois Open Source
-# License. See LICENSE.TXT for details.
-#
-##===----------------------------------------------------------------------===##
-
-LEVEL = ../..
-TOOLNAME = llvm-stub
-include $(LEVEL)/Makefile.common
-
diff --git a/release_23/tools/llvm-stub/llvm-stub.c b/release_23/tools/llvm-stub/llvm-stub.c
deleted file mode 100644
index 7e123cf60743..000000000000
--- a/release_23/tools/llvm-stub/llvm-stub.c
+++ /dev/null
@@ -1,69 +0,0 @@
-/*===- llvm-stub.c - Stub executable to run llvm bitcode files -----------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This tool is used by the gccld program to enable transparent execution of
-// bitcode files by the user. Specifically, gccld outputs two files when asked
-// to compile a <program> file:
-// 1. It outputs the LLVM bitcode file to <program>.bc
-// 2. It outputs a stub executable that runs lli on <program>.bc
-//
-// This allows the end user to just say ./<program> and have the JIT executed
-// automatically. On unix, the stub executable emitted is actually a bourne
-// shell script that does the forwarding. Windows does not like #!/bin/sh
-// programs in .exe files, so we make it an actual program, defined here.
-//
-//===----------------------------------------------------------------------===*/
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "llvm/Config/config.h"
-
-#if defined(HAVE_UNISTD_H) && !defined(_MSC_VER)
-#include <unistd.h>
-#endif
-
-#ifdef _WIN32
-#include <process.h>
-#include <io.h>
-#endif
-
-int main(int argc, char** argv) {
- const char *Interp = getenv("LLVMINTERP");
- const char **Args;
- if (Interp == 0) Interp = "lli";
-
- /* Set up the command line options to pass to the JIT. */
- Args = (const char**)malloc(sizeof(char*) * (argc+2));
- /* argv[0] is the JIT */
- Args[0] = Interp;
-
-#ifdef __CYGWIN32__
- /* Cygwin strips the .exe suffix off of argv[0] to "help" us. Put it back
- * on.
- */
- argv[0] = strcat(strcpy((char*)malloc(strlen(argv[0])+5), argv[0]), ".exe");
-#endif
-
- /* argv[1] is argv[0] + ".bc". */
- Args[1] = strcat(strcpy((char*)malloc(strlen(argv[0])+4), argv[0]), ".bc");
-
- /* The rest of the args are as before. */
- memcpy(Args+2, argv+1, sizeof(char*)*argc);
-
- /* Run the JIT. */
- execvp(Interp, (char *const*)Args);
-
- /* if _execv returns, the JIT could not be started. */
- fprintf(stderr, "Could not execute the LLVM JIT. Either add 'lli' to your"
- " path, or set the\ninterpreter you want to use in the LLVMINTERP "
- "environment variable.\n");
- return 1;
-}
diff --git a/release_23/tools/llvmc2/Action.cpp b/release_23/tools/llvmc2/Action.cpp
deleted file mode 100644
index 80531c0806a7..000000000000
--- a/release_23/tools/llvmc2/Action.cpp
+++ /dev/null
@@ -1,74 +0,0 @@
-//===--- Tools.h - The LLVM Compiler Driver ---------------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open
-// Source License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// Action class - implementation and auxiliary functions.
-//
-//===----------------------------------------------------------------------===//
-
-#include "Action.h"
-
-#include "llvm/Support/CommandLine.h"
-#include "llvm/System/Program.h"
-
-#include <iostream>
-#include <stdexcept>
-
-using namespace llvm;
-using namespace llvmc;
-
-extern cl::opt<bool> VerboseMode;
-
-namespace {
- int ExecuteProgram(const std::string& name,
- const StringVector& args) {
- sys::Path prog = sys::Program::FindProgramByName(name);
-
- if (prog.isEmpty())
- throw std::runtime_error("Can't find program '" + name + "'");
- if (!prog.canExecute())
- throw std::runtime_error("Program '" + name + "' is not executable.");
-
- // Build the command line vector and the redirects array.
- const sys::Path* redirects[3] = {0,0,0};
- sys::Path stdout_redirect;
-
- std::vector<const char*> argv;
- argv.reserve((args.size()+2));
- argv.push_back(name.c_str());
-
- for (StringVector::const_iterator B = args.begin(), E = args.end();
- B!=E; ++B) {
- if (*B == ">") {
- ++B;
- stdout_redirect.set(*B);
- redirects[1] = &stdout_redirect;
- }
- else {
- argv.push_back((*B).c_str());
- }
- }
- argv.push_back(0); // null terminate list.
-
- // Invoke the program.
- return sys::Program::ExecuteAndWait(prog, &argv[0], 0, &redirects[0]);
- }
-
- void print_string (const std::string& str) {
- std::cerr << str << ' ';
- }
-}
-
-int llvmc::Action::Execute() const {
- if (VerboseMode) {
- std::cerr << Command_ << " ";
- std::for_each(Args_.begin(), Args_.end(), print_string);
- std::cerr << '\n';
- }
- return ExecuteProgram(Command_, Args_);
-}
diff --git a/release_23/tools/llvmc2/Action.h b/release_23/tools/llvmc2/Action.h
deleted file mode 100644
index 32d185545a6e..000000000000
--- a/release_23/tools/llvmc2/Action.h
+++ /dev/null
@@ -1,42 +0,0 @@
-//===--- Tools.h - The LLVM Compiler Driver ---------------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open
-// Source License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// Action - encapsulates a single shell command.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_TOOLS_LLVMC2_ACTION_H
-#define LLVM_TOOLS_LLVMC2_ACTION_H
-
-#include <string>
-#include <vector>
-
-namespace llvmc {
-
- typedef std::vector<std::string> StringVector;
-
- /// Action - A class that encapsulates a single shell command.
- class Action {
- /// Command_ - The actual command (for example, 'ls').
- std::string Command_;
- /// Args_ - Command arguments. Stdout redirection is allowed.
- std::vector<std::string> Args_;
- public:
- Action (const std::string& C,
- const StringVector& A)
- : Command_(C), Args_(A)
- {}
-
- /// Execute - Executes the represented action.
- int Execute() const;
- };
-
-}
-
-#endif // LLVM_TOOLS_LLVMC2_ACTION_H
diff --git a/release_23/tools/llvmc2/AutoGenerated.cpp b/release_23/tools/llvmc2/AutoGenerated.cpp
deleted file mode 100644
index e01702653aa4..000000000000
--- a/release_23/tools/llvmc2/AutoGenerated.cpp
+++ /dev/null
@@ -1,27 +0,0 @@
-//===--- Tools.cpp - The LLVM Compiler Driver -------------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open
-// Source License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// Auto-generated tool descriptions - implementation.
-//
-//===----------------------------------------------------------------------===//
-
-#include "AutoGenerated.h"
-#include "CompilationGraph.h"
-#include "Tool.h"
-
-#include "llvm/ADT/StringExtras.h"
-#include "llvm/Support/CommandLine.h"
-
-#include <stdexcept>
-
-using namespace llvm;
-using namespace llvmc;
-
-// The auto-generated file
-#include "AutoGenerated.inc"
diff --git a/release_23/tools/llvmc2/AutoGenerated.h b/release_23/tools/llvmc2/AutoGenerated.h
deleted file mode 100644
index 3b65256e0a55..000000000000
--- a/release_23/tools/llvmc2/AutoGenerated.h
+++ /dev/null
@@ -1,34 +0,0 @@
-//===--- Tools.cpp - The LLVM Compiler Driver -------------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open
-// Source License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// Auto-generated tool descriptions - public interface.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_TOOLS_LLVMC2_AUTOGENERATED_H
-#define LLVM_TOOLS_LLVMC2_AUTOGENERATED_H
-
-#include "llvm/ADT/StringMap.h"
-
-#include <string>
-
-namespace llvmc {
-
- typedef llvm::StringMap<std::string> LanguageMap;
- class CompilationGraph;
-
- /// PopulateLanguageMap - The auto-generated function that fills in
- /// the language map (map from file extensions to language names).
- void PopulateLanguageMap(LanguageMap& language_map);
- /// PopulateCompilationGraph - The auto-generated function that
- /// populates the compilation graph with nodes and edges.
- void PopulateCompilationGraph(CompilationGraph& tools);
-}
-
-#endif // LLVM_TOOLS_LLVMC2_AUTOGENERATED_H
diff --git a/release_23/tools/llvmc2/Common.td b/release_23/tools/llvmc2/Common.td
deleted file mode 100644
index b04596fb76e7..000000000000
--- a/release_23/tools/llvmc2/Common.td
+++ /dev/null
@@ -1,90 +0,0 @@
-//===- Tools.td - Common definitions for LLVMCC -----------*- tablegen -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains common definitions used in llvmcc tool description files.
-//
-//===----------------------------------------------------------------------===//
-
-class Tool<list<dag> l> {
- list<dag> properties = l;
-}
-
-// Special Tool instance - the root node of the compilation graph.
-
-def root : Tool<[]>;
-
-// Possible Tool properties
-
-def in_language;
-def out_language;
-def output_suffix;
-def cmd_line;
-def join;
-def sink;
-
-// Possible option types
-
-def switch_option;
-def parameter_option;
-def parameter_list_option;
-def prefix_option;
-def prefix_list_option;
-
-// Possible option properties
-
-def append_cmd;
-def forward;
-def stop_compilation;
-def unpack_values;
-def help;
-def required;
-
-// Possible edge properties
-
-// 'Atomic' properties.
-def switch_on;
-def parameter_equals;
-def element_in_list;
-def if_input_languages_contain;
-
-// Edge property combinators.
-def weight;
-def and;
-def or;
-
-// Map from suffixes to language names
-
-class LangToSuffixes<string str, list<string> lst> {
- string lang = str;
- list<string> suffixes = lst;
-}
-
-class LanguageMap<list<LangToSuffixes> lst> {
- list<LangToSuffixes> map = lst;
-}
-
-// Compilation graph
-
-class EdgeBase<Tool t1, Tool t2, list<dag> lst> {
- Tool a = t1;
- Tool b = t2;
- list<dag> props = lst;
-}
-
-class Edge<Tool t1, Tool t2> : EdgeBase<t1, t2, []>;
-
-// Edge and SimpleEdge are synonyms.
-class SimpleEdge<Tool t1, Tool t2> : EdgeBase<t1, t2, []>;
-
-// Optionally enabled edge.
-class OptionalEdge<Tool t1, Tool t2, list<dag> lst> : EdgeBase<t1, t2, lst>;
-
-class CompilationGraph<list<EdgeBase> lst> {
- list<EdgeBase> edges = lst;
-}
diff --git a/release_23/tools/llvmc2/CompilationGraph.cpp b/release_23/tools/llvmc2/CompilationGraph.cpp
deleted file mode 100644
index d149c0fbfd2a..000000000000
--- a/release_23/tools/llvmc2/CompilationGraph.cpp
+++ /dev/null
@@ -1,406 +0,0 @@
-//===--- CompilationGraph.cpp - The LLVM Compiler Driver --------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open
-// Source License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// Compilation graph - implementation.
-//
-//===----------------------------------------------------------------------===//
-
-#include "CompilationGraph.h"
-
-#include "llvm/ADT/STLExtras.h"
-#include "llvm/Support/CommandLine.h"
-#include "llvm/Support/DOTGraphTraits.h"
-#include "llvm/Support/GraphWriter.h"
-
-#include <algorithm>
-#include <iterator>
-#include <limits>
-#include <queue>
-#include <stdexcept>
-
-using namespace llvm;
-using namespace llvmc;
-
-extern cl::list<std::string> InputFilenames;
-extern cl::opt<std::string> OutputFilename;
-extern cl::list<std::string> Languages;
-
-namespace {
-
- /// ChooseEdge - Return the edge with the maximum weight.
- template <class C>
- const Edge* ChooseEdge(const C& EdgesContainer,
- const InputLanguagesSet& InLangs,
- const std::string& NodeName = "root") {
- const Edge* MaxEdge = 0;
- unsigned MaxWeight = 0;
- bool SingleMax = true;
-
- for (typename C::const_iterator B = EdgesContainer.begin(),
- E = EdgesContainer.end(); B != E; ++B) {
- const Edge* E = B->getPtr();
- unsigned EW = E->Weight(InLangs);
- if (EW > MaxWeight) {
- MaxEdge = E;
- MaxWeight = EW;
- SingleMax = true;
- } else if (EW == MaxWeight) {
- SingleMax = false;
- }
- }
-
- if (!SingleMax)
- throw std::runtime_error("Node " + NodeName +
- ": multiple maximal outward edges found!"
- " Most probably a specification error.");
- if (!MaxEdge)
- throw std::runtime_error("Node " + NodeName +
- ": no maximal outward edge found!"
- " Most probably a specification error.");
- return MaxEdge;
- }
-
-}
-
-CompilationGraph::CompilationGraph() {
- NodesMap["root"] = Node(this);
-}
-
-Node& CompilationGraph::getNode(const std::string& ToolName) {
- nodes_map_type::iterator I = NodesMap.find(ToolName);
- if (I == NodesMap.end())
- throw std::runtime_error("Node " + ToolName + " is not in the graph");
- return I->second;
-}
-
-const Node& CompilationGraph::getNode(const std::string& ToolName) const {
- nodes_map_type::const_iterator I = NodesMap.find(ToolName);
- if (I == NodesMap.end())
- throw std::runtime_error("Node " + ToolName + " is not in the graph!");
- return I->second;
-}
-
-// Find the language name corresponding to the given file.
-const std::string& CompilationGraph::getLanguage(const sys::Path& File) const {
- LanguageMap::const_iterator Lang = ExtsToLangs.find(File.getSuffix());
- if (Lang == ExtsToLangs.end())
- throw std::runtime_error("Unknown suffix: " + File.getSuffix() + '!');
- return Lang->second;
-}
-
-// Find the tools list corresponding to the given language name.
-const CompilationGraph::tools_vector_type&
-CompilationGraph::getToolsVector(const std::string& LangName) const
-{
- tools_map_type::const_iterator I = ToolsMap.find(LangName);
- if (I == ToolsMap.end())
- throw std::runtime_error("No tool corresponding to the language "
- + LangName + "found!");
- return I->second;
-}
-
-void CompilationGraph::insertNode(Tool* V) {
- if (NodesMap.count(V->Name()) == 0) {
- Node N;
- N.OwningGraph = this;
- N.ToolPtr = V;
- NodesMap[V->Name()] = N;
- }
-}
-
-void CompilationGraph::insertEdge(const std::string& A, Edge* E) {
- Node& B = getNode(E->ToolName());
- if (A == "root") {
- const std::string& InputLanguage = B.ToolPtr->InputLanguage();
- ToolsMap[InputLanguage].push_back(IntrusiveRefCntPtr<Edge>(E));
- NodesMap["root"].AddEdge(E);
- }
- else {
- Node& N = getNode(A);
- N.AddEdge(E);
- }
- // Increase the inward edge counter.
- B.IncrInEdges();
-}
-
-namespace {
- sys::Path MakeTempFile(const sys::Path& TempDir, const std::string& BaseName,
- const std::string& Suffix) {
- sys::Path Out = TempDir;
- Out.appendComponent(BaseName);
- Out.appendSuffix(Suffix);
- Out.makeUnique(true, NULL);
- return Out;
- }
-}
-
-// Pass input file through the chain until we bump into a Join node or
-// a node that says that it is the last.
-void CompilationGraph::PassThroughGraph (const sys::Path& InFile,
- const Node* StartNode,
- const InputLanguagesSet& InLangs,
- const sys::Path& TempDir) const {
- bool Last = false;
- sys::Path In = InFile;
- const Node* CurNode = StartNode;
-
- while(!Last) {
- sys::Path Out;
- Tool* CurTool = CurNode->ToolPtr.getPtr();
-
- if (CurTool->IsJoin()) {
- JoinTool& JT = dynamic_cast<JoinTool&>(*CurTool);
- JT.AddToJoinList(In);
- break;
- }
-
- // Since toolchains do not have to end with a Join node, we should
- // check if this Node is the last.
- if (!CurNode->HasChildren() || CurTool->IsLast()) {
- if (!OutputFilename.empty()) {
- Out.set(OutputFilename);
- }
- else {
- Out.set(In.getBasename());
- Out.appendSuffix(CurTool->OutputSuffix());
- }
- Last = true;
- }
- else {
- Out = MakeTempFile(TempDir, In.getBasename(), CurTool->OutputSuffix());
- }
-
- if (CurTool->GenerateAction(In, Out).Execute() != 0)
- throw std::runtime_error("Tool returned error code!");
-
- if (Last)
- return;
-
- CurNode = &getNode(ChooseEdge(CurNode->OutEdges,
- InLangs,
- CurNode->Name())->ToolName());
- In = Out; Out.clear();
- }
-}
-
-// Find the head of the toolchain corresponding to the given file.
-// Also, insert an input language into InLangs.
-const Node* CompilationGraph::
-FindToolChain(const sys::Path& In, const std::string* forceLanguage,
- InputLanguagesSet& InLangs) const {
-
- // Determine the input language.
- const std::string& InLanguage =
- forceLanguage ? *forceLanguage : getLanguage(In);
-
- // Add the current input language to the input language set.
- InLangs.insert(InLanguage);
-
- // Find the toolchain for the input language.
- const tools_vector_type& TV = getToolsVector(InLanguage);
- if (TV.empty())
- throw std::runtime_error("No toolchain corresponding to language"
- + InLanguage + " found!");
- return &getNode(ChooseEdge(TV, InLangs)->ToolName());
-}
-
-// Helper function used by Build().
-// Traverses initial portions of the toolchains (up to the first Join node).
-// This function is also responsible for handling the -x option.
-void CompilationGraph::BuildInitial (InputLanguagesSet& InLangs,
- const sys::Path& TempDir) {
- // This is related to -x option handling.
- cl::list<std::string>::const_iterator xIter = Languages.begin(),
- xBegin = xIter, xEnd = Languages.end();
- bool xEmpty = true;
- const std::string* xLanguage = 0;
- unsigned xPos = 0, xPosNext = 0, filePos = 0;
-
- if (xIter != xEnd) {
- xEmpty = false;
- xPos = Languages.getPosition(xIter - xBegin);
- cl::list<std::string>::const_iterator xNext = llvm::next(xIter);
- xPosNext = (xNext == xEnd) ? std::numeric_limits<unsigned>::max()
- : Languages.getPosition(xNext - xBegin);
- xLanguage = (*xIter == "none") ? 0 : &(*xIter);
- }
-
- // For each input file:
- for (cl::list<std::string>::const_iterator B = InputFilenames.begin(),
- CB = B, E = InputFilenames.end(); B != E; ++B) {
- sys::Path In = sys::Path(*B);
-
- // Code for handling the -x option.
- // Output: std::string* xLanguage (can be NULL).
- if (!xEmpty) {
- filePos = InputFilenames.getPosition(B - CB);
-
- if (xPos < filePos) {
- if (filePos < xPosNext) {
- xLanguage = (*xIter == "none") ? 0 : &(*xIter);
- }
- else { // filePos >= xPosNext
- // Skip xIters while filePos > xPosNext
- while (filePos > xPosNext) {
- ++xIter;
- xPos = xPosNext;
-
- cl::list<std::string>::const_iterator xNext = llvm::next(xIter);
- if (xNext == xEnd)
- xPosNext = std::numeric_limits<unsigned>::max();
- else
- xPosNext = Languages.getPosition(xNext - xBegin);
- xLanguage = (*xIter == "none") ? 0 : &(*xIter);
- }
- }
- }
- }
-
- // Find the toolchain corresponding to this file.
- const Node* N = FindToolChain(In, xLanguage, InLangs);
- // Pass file through the chain starting at head.
- PassThroughGraph(In, N, InLangs, TempDir);
- }
-}
-
-// Sort the nodes in topological order.
-void CompilationGraph::TopologicalSort(std::vector<const Node*>& Out) {
- std::queue<const Node*> Q;
- Q.push(&getNode("root"));
-
- while (!Q.empty()) {
- const Node* A = Q.front();
- Q.pop();
- Out.push_back(A);
- for (Node::const_iterator EB = A->EdgesBegin(), EE = A->EdgesEnd();
- EB != EE; ++EB) {
- Node* B = &getNode((*EB)->ToolName());
- B->DecrInEdges();
- if (B->HasNoInEdges())
- Q.push(B);
- }
- }
-}
-
-namespace {
- bool NotJoinNode(const Node* N) {
- return N->ToolPtr ? !N->ToolPtr->IsJoin() : true;
- }
-}
-
-// Call TopologicalSort and filter the resulting list to include
-// only Join nodes.
-void CompilationGraph::
-TopologicalSortFilterJoinNodes(std::vector<const Node*>& Out) {
- std::vector<const Node*> TopSorted;
- TopologicalSort(TopSorted);
- std::remove_copy_if(TopSorted.begin(), TopSorted.end(),
- std::back_inserter(Out), NotJoinNode);
-}
-
-int CompilationGraph::Build (const sys::Path& TempDir) {
-
- InputLanguagesSet InLangs;
-
- // Traverse initial parts of the toolchains and fill in InLangs.
- BuildInitial(InLangs, TempDir);
-
- std::vector<const Node*> JTV;
- TopologicalSortFilterJoinNodes(JTV);
-
- // For all join nodes in topological order:
- for (std::vector<const Node*>::iterator B = JTV.begin(), E = JTV.end();
- B != E; ++B) {
-
- sys::Path Out;
- const Node* CurNode = *B;
- JoinTool* JT = &dynamic_cast<JoinTool&>(*CurNode->ToolPtr.getPtr());
- bool IsLast = false;
-
- // Are there any files in the join list?
- if (JT->JoinListEmpty())
- continue;
-
- // Is this the last tool in the toolchain?
- // NOTE: we can process several toolchains in parallel.
- if (!CurNode->HasChildren() || JT->IsLast()) {
- if (OutputFilename.empty()) {
- Out.set("a");
- Out.appendSuffix(JT->OutputSuffix());
- }
- else
- Out.set(OutputFilename);
- IsLast = true;
- }
- else {
- Out = MakeTempFile(TempDir, "tmp", JT->OutputSuffix());
- }
-
- if (JT->GenerateAction(Out).Execute() != 0)
- throw std::runtime_error("Tool returned error code!");
-
- if (!IsLast) {
- const Node* NextNode =
- &getNode(ChooseEdge(CurNode->OutEdges, InLangs,
- CurNode->Name())->ToolName());
- PassThroughGraph(Out, NextNode, InLangs, TempDir);
- }
- }
-
- return 0;
-}
-
-// Code related to graph visualization.
-
-namespace llvm {
- template <>
- struct DOTGraphTraits<llvmc::CompilationGraph*>
- : public DefaultDOTGraphTraits
- {
-
- template<typename GraphType>
- static std::string getNodeLabel(const Node* N, const GraphType&)
- {
- if (N->ToolPtr)
- if (N->ToolPtr->IsJoin())
- return N->Name() + "\n (join" +
- (N->HasChildren() ? ")"
- : std::string(": ") + N->ToolPtr->OutputLanguage() + ')');
- else
- return N->Name();
- else
- return "root";
- }
-
- template<typename EdgeIter>
- static std::string getEdgeSourceLabel(const Node* N, EdgeIter I) {
- if (N->ToolPtr)
- return N->ToolPtr->OutputLanguage();
- else
- return I->ToolPtr->InputLanguage();
- }
- };
-
-}
-
-void CompilationGraph::writeGraph() {
- std::ofstream O("CompilationGraph.dot");
-
- if (O.good()) {
- llvm::WriteGraph(this, "compilation-graph");
- O.close();
- }
- else {
- throw std::runtime_error("");
- }
-}
-
-void CompilationGraph::viewGraph() {
- llvm::ViewGraph(this, "compilation-graph");
-}
diff --git a/release_23/tools/llvmc2/CompilationGraph.h b/release_23/tools/llvmc2/CompilationGraph.h
deleted file mode 100644
index 2169cd39ce73..000000000000
--- a/release_23/tools/llvmc2/CompilationGraph.h
+++ /dev/null
@@ -1,314 +0,0 @@
-//===--- CompilationGraph.h - The LLVM Compiler Driver ----------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open
-// Source License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// Compilation graph - definition.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_TOOLS_LLVMC2_COMPILATION_GRAPH_H
-#define LLVM_TOOLS_LLVMC2_COMPILATION_GRAPH_H
-
-#include "AutoGenerated.h"
-#include "Tool.h"
-
-#include "llvm/ADT/GraphTraits.h"
-#include "llvm/ADT/IntrusiveRefCntPtr.h"
-#include "llvm/ADT/iterator"
-#include "llvm/ADT/SmallVector.h"
-#include "llvm/ADT/StringMap.h"
-#include "llvm/System/Path.h"
-
-#include <cassert>
-#include <string>
-
-namespace llvmc {
-
- /// StringSet - A wrapper for StringMap that provides set-like
- /// functionality. Only insert() and count() methods are used by my
- /// code.
- template <class AllocatorTy = llvm::MallocAllocator>
- class StringSet : public llvm::StringMap<char, AllocatorTy> {
- typedef llvm::StringMap<char, AllocatorTy> base;
- public:
- void insert (const std::string& InLang) {
- assert(!InLang.empty());
- const char* KeyStart = &InLang[0];
- const char* KeyEnd = KeyStart + InLang.size();
- base::insert(llvm::StringMapEntry<char>::
- Create(KeyStart, KeyEnd, base::getAllocator(), '+'));
- }
- };
- typedef StringSet<> InputLanguagesSet;
-
- /// Edge - Represents an edge of the compilation graph.
- class Edge : public llvm::RefCountedBaseVPTR<Edge> {
- public:
- Edge(const std::string& T) : ToolName_(T) {}
- virtual ~Edge() {};
-
- const std::string& ToolName() const { return ToolName_; }
- virtual unsigned Weight(const InputLanguagesSet& InLangs) const = 0;
- private:
- std::string ToolName_;
- };
-
- /// SimpleEdge - An edge that has no properties.
- class SimpleEdge : public Edge {
- public:
- SimpleEdge(const std::string& T) : Edge(T) {}
- unsigned Weight(const InputLanguagesSet&) const { return 1; }
- };
-
- /// Node - A node (vertex) of the compilation graph.
- struct Node {
- // A Node holds a list of the outward edges.
- typedef llvm::SmallVector<llvm::IntrusiveRefCntPtr<Edge>, 3> container_type;
- typedef container_type::iterator iterator;
- typedef container_type::const_iterator const_iterator;
-
- Node() : OwningGraph(0), InEdges(0) {}
- Node(CompilationGraph* G) : OwningGraph(G), InEdges(0) {}
- Node(CompilationGraph* G, Tool* T) :
- OwningGraph(G), ToolPtr(T), InEdges(0) {}
-
- bool HasChildren() const { return !OutEdges.empty(); }
- const std::string Name() const
- { return ToolPtr ? ToolPtr->Name() : "root"; }
-
- // Iteration.
- iterator EdgesBegin() { return OutEdges.begin(); }
- const_iterator EdgesBegin() const { return OutEdges.begin(); }
- iterator EdgesEnd() { return OutEdges.end(); }
- const_iterator EdgesEnd() const { return OutEdges.end(); }
-
- /// AddEdge - Add an outward edge. Takes ownership of the provided
- /// Edge object.
- void AddEdge(Edge* E)
- { OutEdges.push_back(llvm::IntrusiveRefCntPtr<Edge>(E)); }
-
- // Inward edge counter. Used to implement topological sort.
- // TOTHINK: Move the mutable counter back into Tool classes? Makes
- // us more const-correct.
- void IncrInEdges() { ++InEdges; }
- void DecrInEdges() { --InEdges; }
- bool HasNoInEdges() const { return InEdges == 0; }
-
- // Needed to implement NodeChildIterator/GraphTraits
- CompilationGraph* OwningGraph;
- // The corresponding Tool.
- // WARNING: ToolPtr can be NULL (for the root node).
- llvm::IntrusiveRefCntPtr<Tool> ToolPtr;
- // Links to children.
- container_type OutEdges;
- // Inward edge counter. Updated in
- // CompilationGraph::insertEdge(). Used for topological sorting.
- unsigned InEdges;
- };
-
- class NodesIterator;
-
- /// CompilationGraph - The compilation graph itself.
- class CompilationGraph {
- /// nodes_map_type - The main data structure.
- typedef llvm::StringMap<Node> nodes_map_type;
- /// tools_vector_type, tools_map_type - Data structures used to
- /// map from language names to tools. (We can have several tools
- /// associated with each language name, hence the need for a
- /// vector.)
- typedef
- llvm::SmallVector<llvm::IntrusiveRefCntPtr<Edge>, 3> tools_vector_type;
- typedef llvm::StringMap<tools_vector_type> tools_map_type;
-
- /// ExtsToLangs - Map from file extensions to language names.
- LanguageMap ExtsToLangs;
- /// ToolsMap - Map from language names to lists of tool names.
- tools_map_type ToolsMap;
- /// NodesMap - Map from tool names to Tool objects.
- nodes_map_type NodesMap;
-
- public:
-
- CompilationGraph();
-
- /// insertNode - Insert a new node into the graph. Takes
- /// ownership of the object.
- void insertNode(Tool* T);
-
- /// insertEdge - Insert a new edge into the graph. Takes ownership
- /// of the Edge object.
- void insertEdge(const std::string& A, Edge* E);
-
- /// Build - Build target(s) from the input file set. Command-line
- /// options are passed implicitly as global variables.
- int Build(llvm::sys::Path const& tempDir);
-
- /// getNode -Return a reference to the node correponding to the
- /// given tool name. Throws std::runtime_error.
- Node& getNode(const std::string& ToolName);
- const Node& getNode(const std::string& ToolName) const;
-
- /// viewGraph - This function is meant for use from the debugger.
- /// You can just say 'call G->viewGraph()' and a ghostview window
- /// should pop up from the program, displaying the compilation
- /// graph. This depends on there being a 'dot' and 'gv' program
- /// in your path.
- void viewGraph();
-
- /// writeGraph - Write a compilation-graph.dot file.
- void writeGraph();
-
- // GraphTraits support.
- friend NodesIterator GraphBegin(CompilationGraph*);
- friend NodesIterator GraphEnd(CompilationGraph*);
- friend void PopulateCompilationGraph(CompilationGraph&);
-
- private:
- // Helper functions.
-
- /// getLanguage - Find out which language corresponds to the
- /// suffix of this file.
- const std::string& getLanguage(const llvm::sys::Path& File) const;
-
- /// getToolsVector - Return a reference to the list of tool names
- /// corresponding to the given language name. Throws
- /// std::runtime_error.
- const tools_vector_type& getToolsVector(const std::string& LangName) const;
-
- /// PassThroughGraph - Pass the input file through the toolchain
- /// starting at StartNode.
- void PassThroughGraph (const llvm::sys::Path& In, const Node* StartNode,
- const InputLanguagesSet& InLangs,
- const llvm::sys::Path& TempDir) const;
-
- /// FindToolChain - Find head of the toolchain corresponding to the given file.
- const Node* FindToolChain(const llvm::sys::Path& In,
- const std::string* forceLanguage,
- InputLanguagesSet& InLangs) const;
-
- /// BuildInitial - Traverse the initial parts of the toolchains.
- void BuildInitial(InputLanguagesSet& InLangs,
- const llvm::sys::Path& TempDir);
-
- /// TopologicalSort - Sort the nodes in topological order.
- void TopologicalSort(std::vector<const Node*>& Out);
- /// TopologicalSortFilterJoinNodes - Call TopologicalSort and
- /// filter the resulting list to include only Join nodes.
- void TopologicalSortFilterJoinNodes(std::vector<const Node*>& Out);
- };
-
- // GraphTraits support code.
-
- /// NodesIterator - Auxiliary class needed to implement GraphTraits
- /// support. Can be generalised to something like value_iterator
- /// for map-like containers.
- class NodesIterator : public llvm::StringMap<Node>::iterator {
- typedef llvm::StringMap<Node>::iterator super;
- typedef NodesIterator ThisType;
- typedef Node* pointer;
- typedef Node& reference;
-
- public:
- NodesIterator(super I) : super(I) {}
-
- inline reference operator*() const {
- return super::operator->()->second;
- }
- inline pointer operator->() const {
- return &super::operator->()->second;
- }
- };
-
- inline NodesIterator GraphBegin(CompilationGraph* G) {
- return NodesIterator(G->NodesMap.begin());
- }
-
- inline NodesIterator GraphEnd(CompilationGraph* G) {
- return NodesIterator(G->NodesMap.end());
- }
-
-
- /// NodeChildIterator - Another auxiliary class needed by GraphTraits.
- class NodeChildIterator : public bidirectional_iterator<Node, ptrdiff_t> {
- typedef NodeChildIterator ThisType;
- typedef Node::container_type::iterator iterator;
-
- CompilationGraph* OwningGraph;
- iterator EdgeIter;
- public:
- typedef Node* pointer;
- typedef Node& reference;
-
- NodeChildIterator(Node* N, iterator I) :
- OwningGraph(N->OwningGraph), EdgeIter(I) {}
-
- const ThisType& operator=(const ThisType& I) {
- assert(OwningGraph == I.OwningGraph);
- EdgeIter = I.EdgeIter;
- return *this;
- }
-
- inline bool operator==(const ThisType& I) const
- { return EdgeIter == I.EdgeIter; }
- inline bool operator!=(const ThisType& I) const
- { return EdgeIter != I.EdgeIter; }
-
- inline pointer operator*() const {
- return &OwningGraph->getNode((*EdgeIter)->ToolName());
- }
- inline pointer operator->() const {
- return &OwningGraph->getNode((*EdgeIter)->ToolName());
- }
-
- ThisType& operator++() { ++EdgeIter; return *this; } // Preincrement
- ThisType operator++(int) { // Postincrement
- ThisType tmp = *this;
- ++*this;
- return tmp;
- }
-
- inline ThisType& operator--() { --EdgeIter; return *this; } // Predecrement
- inline ThisType operator--(int) { // Postdecrement
- ThisType tmp = *this;
- --*this;
- return tmp;
- }
-
- };
-}
-
-namespace llvm {
- template <>
- struct GraphTraits<llvmc::CompilationGraph*> {
- typedef llvmc::CompilationGraph GraphType;
- typedef llvmc::Node NodeType;
- typedef llvmc::NodeChildIterator ChildIteratorType;
-
- static NodeType* getEntryNode(GraphType* G) {
- return &G->getNode("root");
- }
-
- static ChildIteratorType child_begin(NodeType* N) {
- return ChildIteratorType(N, N->OutEdges.begin());
- }
- static ChildIteratorType child_end(NodeType* N) {
- return ChildIteratorType(N, N->OutEdges.end());
- }
-
- typedef llvmc::NodesIterator nodes_iterator;
- static nodes_iterator nodes_begin(GraphType *G) {
- return GraphBegin(G);
- }
- static nodes_iterator nodes_end(GraphType *G) {
- return GraphEnd(G);
- }
- };
-
-}
-
-#endif // LLVM_TOOLS_LLVMC2_COMPILATION_GRAPH_H
diff --git a/release_23/tools/llvmc2/Graph.td b/release_23/tools/llvmc2/Graph.td
deleted file mode 100644
index 6fb998b28b2a..000000000000
--- a/release_23/tools/llvmc2/Graph.td
+++ /dev/null
@@ -1,47 +0,0 @@
-//===- Example.td - LLVMCC toolchain descriptions ---------*- tablegen -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains compilation graph description used by llvmcc.
-//
-//===----------------------------------------------------------------------===//
-
-include "Common.td"
-include "Tools.td"
-
-// Toolchains
-
-def CompilationGraph : CompilationGraph<[
- Edge<root, llvm_gcc_c>,
- Edge<root, llvm_gcc_assembler>,
- Edge<root, llvm_gcc_cpp>,
- Edge<root, llvm_as>,
-
- Edge<llvm_gcc_c, llc>,
- Edge<llvm_gcc_cpp, llc>,
- Edge<llvm_as, llc>,
-
- OptionalEdge<llvm_gcc_c, opt, [(switch_on "opt")]>,
- OptionalEdge<llvm_gcc_cpp, opt, [(switch_on "opt")]>,
- OptionalEdge<llvm_as, opt, [(switch_on "opt")]>,
- Edge<opt, llc>,
-
- Edge<llc, llvm_gcc_assembler>,
- Edge<llvm_gcc_assembler, llvm_gcc_linker>,
- OptionalEdge<llvm_gcc_assembler, llvm_gcc_cpp_linker,
- [(if_input_languages_contain "c++"),
- (or (parameter_equals "linker", "g++"),
- (parameter_equals "linker", "c++"))]>,
-
-
- Edge<root, llvm_gcc_linker>,
- OptionalEdge<root, llvm_gcc_cpp_linker,
- [(if_input_languages_contain "c++"),
- (or (parameter_equals "linker", "g++"),
- (parameter_equals "linker", "c++"))]>
- ]>;
diff --git a/release_23/tools/llvmc2/Makefile b/release_23/tools/llvmc2/Makefile
deleted file mode 100644
index d1b85a63d04a..000000000000
--- a/release_23/tools/llvmc2/Makefile
+++ /dev/null
@@ -1,27 +0,0 @@
-##===- tools/llvmc2/Makefile -------------------------------*- Makefile -*-===##
-#
-# The LLVM Compiler Infrastructure
-#
-# This file is distributed under the University of Illinois Open
-# Source License. See LICENSE.TXT for details.
-#
-##===----------------------------------------------------------------------===##
-LEVEL = ../..
-TOOLNAME = llvmc2
-BUILT_SOURCES = AutoGenerated.inc
-LINK_COMPONENTS = support system
-REQUIRES_EH := 1
-
-include $(LEVEL)/Makefile.common
-
-TOOLS_SOURCE=Graph.td Tools.td Common.td
-
-# TOFIX: integrate this part into Makefile.rules?
-# The degree of horrorshowness in that file is too much for me atm.
-$(ObjDir)/AutoGenerated.inc.tmp: $(TOOLS_SOURCE) $(ObjDir)/.dir
- $(Echo) "Building LLVMCC configuration library with tblgen"
- $(Verb) $(TableGen) -gen-llvmc -o $(call SYSPATH, $@) $<
-
-AutoGenerated.inc : $(ObjDir)/AutoGenerated.inc.tmp
- $(Verb) $(CMP) -s $@ $< || $(CP) $< $@
-
diff --git a/release_23/tools/llvmc2/Tool.h b/release_23/tools/llvmc2/Tool.h
deleted file mode 100644
index bfa7e46f9e85..000000000000
--- a/release_23/tools/llvmc2/Tool.h
+++ /dev/null
@@ -1,68 +0,0 @@
-//===--- Tools.h - The LLVM Compiler Driver ---------------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open
-// Source License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// Tool abstract base class - an interface to tool descriptions.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_TOOLS_LLVMC2_TOOL_H
-#define LLVM_TOOLS_LLVMC2_TOOL_H
-
-#include "Action.h"
-
-#include "llvm/ADT/IntrusiveRefCntPtr.h"
-#include "llvm/System/Path.h"
-
-#include <string>
-#include <vector>
-
-namespace llvmc {
-
- typedef std::vector<llvm::sys::Path> PathVector;
-
- /// Tool - A class
- class Tool : public llvm::RefCountedBaseVPTR<Tool> {
- public:
-
- virtual ~Tool() {}
-
- virtual Action GenerateAction (const PathVector& inFiles,
- const llvm::sys::Path& outFile) const = 0;
-
- virtual Action GenerateAction (const llvm::sys::Path& inFile,
- const llvm::sys::Path& outFile) const = 0;
-
- virtual const char* Name() const = 0;
- virtual const char* InputLanguage() const = 0;
- virtual const char* OutputLanguage() const = 0;
- virtual const char* OutputSuffix() const = 0;
-
- virtual bool IsLast() const = 0;
- virtual bool IsJoin() const = 0;
- };
-
- /// JoinTool - A Tool that has an associated input file list.
- class JoinTool : public Tool {
- public:
- void AddToJoinList(const llvm::sys::Path& P) { JoinList_.push_back(P); }
- void ClearJoinList() { JoinList_.clear(); }
- bool JoinListEmpty() const { return JoinList_.empty(); }
-
- Action GenerateAction(const llvm::sys::Path& outFile) const
- { return GenerateAction(JoinList_, outFile); }
- // We shouldn't shadow base class's version of GenerateAction.
- using Tool::GenerateAction;
-
- private:
- PathVector JoinList_;
- };
-
-}
-
-#endif //LLVM_TOOLS_LLVMC2_TOOL_H
diff --git a/release_23/tools/llvmc2/Tools.td b/release_23/tools/llvmc2/Tools.td
deleted file mode 100644
index 26925628d19a..000000000000
--- a/release_23/tools/llvmc2/Tools.td
+++ /dev/null
@@ -1,113 +0,0 @@
-//===- Tools.td - Tools description for the LLVMCC --------*- tablegen -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains descriptions of the various build tools run by llvmcc.
-//
-//===----------------------------------------------------------------------===//
-
-// TOTHINK: Open issue: should we use DAG lists in Tool specifications
-// or change to something like
-
-// def LLVMGccC : < Tool<
-// [ InLanguage<"c">,
-// PrefixListOption<"Wl", [UnpackValues, PropertyName<Arg>, ...]>
-// ...] ?
-
-// DAG lists look more aesthetically pleasing to me.
-
-def llvm_gcc_c : Tool<
-[(in_language "c"),
- (out_language "llvm-bitcode"),
- (output_suffix "bc"),
- (cmd_line "llvm-gcc -c -x c $INFILE -o $OUTFILE -emit-llvm"),
- (switch_option "E", (stop_compilation),
- (help "Stop after the preprocessing stage, do not run the compiler")),
- (sink)
-]>;
-
-def llvm_gcc_cpp : Tool<
-[(in_language "c++"),
- (out_language "llvm-bitcode"),
- (output_suffix "bc"),
- (cmd_line "llvm-g++ -c -x c++ $INFILE -o $OUTFILE -emit-llvm"),
- (switch_option "E", (stop_compilation)),
- (sink)
-]>;
-
-def opt : Tool<
-[(in_language "llvm-bitcode"),
- (out_language "llvm-bitcode"),
- (switch_option "opt", (help "Enable opt")),
- (output_suffix "bc"),
- (cmd_line "opt $INFILE -o $OUTFILE")
-]>;
-
-def llvm_as : Tool<
-[(in_language "llvm-assembler"),
- (out_language "llvm-bitcode"),
- (output_suffix "bc"),
- (cmd_line "llvm-as $INFILE -o $OUTFILE")
-]>;
-
-def llc : Tool<
-[(in_language "llvm-bitcode"),
- (out_language "assembler"),
- (output_suffix "s"),
- (switch_option "S", (stop_compilation),
- (help "Stop after compilation, do not assemble")),
- (cmd_line "llc -f $INFILE -o $OUTFILE")
-]>;
-
-def llvm_gcc_assembler : Tool<
-[(in_language "assembler"),
- (out_language "object-code"),
- (output_suffix "o"),
- (cmd_line "llvm-gcc -c -x assembler $INFILE -o $OUTFILE"),
- (switch_option "c", (stop_compilation),
- (help "Compile and assemble, but do not link")),
- (prefix_list_option "Wa", (unpack_values), (help "pass options to assembler"))
-]>;
-
-// Default linker
-def llvm_gcc_linker : Tool<
-[(in_language "object-code"),
- (out_language "executable"),
- (output_suffix "out"),
- (cmd_line "llvm-gcc $INFILE -o $OUTFILE"),
- (join),
- (prefix_list_option "L", (forward), (help "add a directory to link path")),
- (prefix_list_option "l", (forward), (help "search a library when linking")),
- (prefix_list_option "Wl", (unpack_values), (help "pass options to linker"))
-]>;
-
-// Alternative linker for C++
-def llvm_gcc_cpp_linker : Tool<
-[(in_language "object-code"),
- (out_language "executable"),
- (output_suffix "out"),
- (cmd_line "llvm-g++ $INFILE -o $OUTFILE"),
- (join),
- (parameter_option "linker",
- (help "Choose linker (possible values: gcc, g++)")),
- (prefix_list_option "L", (forward)),
- (prefix_list_option "l", (forward)),
- (prefix_list_option "Wl", (unpack_values))
-]>;
-
-// Language map
-
-def LanguageMap : LanguageMap<
- [LangToSuffixes<"c++", ["cc", "cp", "cxx", "cpp", "CPP", "c++", "C"]>,
- LangToSuffixes<"c", ["c"]>,
- LangToSuffixes<"assembler", ["s"]>,
- LangToSuffixes<"llvm-assembler", ["ll"]>,
- LangToSuffixes<"llvm-bitcode", ["bc"]>,
- LangToSuffixes<"object-code", ["o"]>,
- LangToSuffixes<"executable", ["out"]>
- ]>;
diff --git a/release_23/tools/llvmc2/doc/LLVMC-Enhancements.rst b/release_23/tools/llvmc2/doc/LLVMC-Enhancements.rst
deleted file mode 100644
index 94919ce58ee5..000000000000
--- a/release_23/tools/llvmc2/doc/LLVMC-Enhancements.rst
+++ /dev/null
@@ -1,264 +0,0 @@
-Introduction
-============
-
-Disclaimer: this document is currently somewhat out-of-date and is
-retained for reference; for more recent documentation please refer to
-LLVMC-Tutorial.rst.
-
-A complete rewrite of the LLVMC compiler driver is proposed, aimed at
-making it more configurable and useful.
-
-Motivation
-==========
-
-As it stands, the current version of LLVMC does not meet its stated goals
-of configurability and extensibility, and is therefore not used
-much. The need for enhancements to LLVMC is also reflected in [1]_. The
-proposed rewrite will fix the aforementioned deficiences and provide
-an extensible, future-proof solution.
-
-Design
-======
-
-A compiler driver's job is essentially to find a way to transform a set
-of input files into a set of targets, depending on the user-provided
-options. Since several methods of transformation can potentially exist,
-it's natural to use a directed graph to represent all of them. In this
-graph, nodes are tools -- e.g., ``gcc -S`` is a tool that generates
-assembly from C language files -- and edges between the nodes indicate
-that the output of one tool can be given as input to another -- i.e.,
-``gcc -S -o - file.c | as``. We'll call this graph the compilation graph.
-
-The proposed design revolves around the compilation graph and the
-following core abstractions:
-
-- Target - An (intermediate) compilation target.
-
-- Action - A shell command template that represents a basic compilation
- transformation -- example: ``gcc -S $INPUT_FILE -o $OUTPUT_FILE``.
-
-- Tool - Encapsulates information about a concrete tool used in the
- compilation process, produces Actions. Its operation depends on
- command-line options provided by the user.
-
-- GraphBuilder - Constructs the compilation graph. Its operation
- depends on command-line options.
-
-- GraphTraverser - Traverses the compilation graph and constructs a
- sequence of Actions needed to build the target file. Its operation
- depends on command-line options.
-
-A high-level view of the compilation process:
-
- 1. Configuration libraries (see below) are loaded in and the
- compilation graph is constructed from the tool descriptions.
-
- 2. Information about possible options is gathered from (the nodes of)
- the compilation graph.
-
- 3. Options are parsed based on data gathered in step 2.
-
- 4. A sequence of Actions needed to build the target is constructed
- using the compilation graph and provided options.
-
- 5. The resulting action sequence is executed.
-
-Extensibility
-==============
-
-To make this design extensible, TableGen [2]_ will be used for
-automatic generation of the Tool classes. Users wanting to customize
-LLVMC need to write a configuration library consisting of a set of
-TableGen descriptions of compilation tools plus a number of hooks
-that influence compilation graph construction and traversal. LLVMC
-will have the ability to load user configuration libraries at runtime;
-in fact, its own basic functionality will be implemented as a
-configuration library.
-
-TableGen specification example
-------------------------------
-
-This small example specifies a Tool that converts C source to object
-files. Note that it is only a mock-up of intended functionality, not a
-final specification::
-
- def GCC : Tool<
- GCCProperties, // Properties of this tool
- GCCOptions // Options description for this tool
- >;
-
- def GCCProperties : ToolProperties<[
- ToolName<"GCC">,
- InputLanguageName<"C">,
- OutputLanguageName<"Object-Code">
- InputFileExtension<"c">,
- OutputFileExtension<"o">,
- CommandFormat<"gcc -c $OPTIONS $FILES">
- ]>;
-
- def GCCOptions : ToolOptions<[
- Option<
- "-Wall", // Option name
- [None], // Allowed values
- [AddOption<"-Wall">]>, // Action
-
- Option<
- "-Wextra", // Option name
- [None], // Allowed values
- [AddOption<"-Wextra">]>, // Action
-
- Option<
- "-W", // Option name
- [None], // Allowed values
- [AddOption<"-W">]>, // Action
-
- Option<
- "-D", // Option name
- [AnyString], // Allowed values
-
- [AddOptionWithArgument<"-D",GetOptionArgument<"-D">>]
- // Action:
- // If the driver was given option "-D<argument>", add
- // option "-D" with the same argument to the invocation string of
- // this tool.
- >
-
- ]>;
-
-Example of generated code
--------------------------
-
-The specification above compiles to the following code (again, it's a
-mock-up)::
-
- class GCC : public Tool {
-
- public:
-
- GCC() { //... }
-
- // Properties
-
- static const char* ToolName = "GCC";
- static const char* InputLanguageName = "C";
- static const char* OutputLanguageName = "Object-Code";
- static const char* InputFileExtension = "c";
- static const char* OutputFileExtension = "o";
- static const char* CommandFormat = "gcc -c $OPTIONS $FILES";
-
- // Options
-
- OptionsDescription SupportedOptions() {
- OptionsDescription supportedOptions;
-
- supportedOptions.Add(Option("-Wall"));
- supportedOptions.Add(Option("-Wextra"));
- supportedOptions.Add(Option("-W"));
- supportedOptions.Add(Option("-D", AllowedArgs::ANY_STRING));
-
- return supportedOptions;
- }
-
- Action GenerateAction(Options providedOptions) {
- Action generatedAction(CommandFormat); Option curOpt;
-
- curOpt = providedOptions.Get("-D");
- if (curOpt) {
- assert(curOpt.HasArgument());
- generatedAction.AddOption(Option("-D", curOpt.GetArgument()));
- }
-
- curOpt = providedOptions.Get("-Wall");
- if (curOpt)
- generatedAction.AddOption(Option("-Wall"));
-
- curOpt = providedOptions.Get("-Wextra");
- if (curOpt)
- generatedAction.AddOption(Option("-Wall"));
-
- curOpt = providedOptions.Get("-W");
- if (curOpt)
- generatedAction.AddOption(Option("-Wall")); }
-
- return generatedAction;
- }
-
- };
-
- // defined somewhere...
-
- class Action { public: void AddOption(const Option& opt) {...}
- int Run(const Filenames& fnms) {...}
-
- }
-
-Option handling
-===============
-
-Because one of the main tasks of the compiler driver is to correctly
-handle user-provided options, it is important to define this process
-in an exact way. The intent of the proposed scheme is to function as
-a drop-in replacement for GCC.
-
-Option syntax
--------------
-
-The option syntax is specified by the following formal grammar::
-
- <command-line> ::= <option>*
- <option> ::= <positional-option> | <named-option>
- <named-option> ::= -[-]<option-name>[<delimeter><option-argument>]
- <delimeter> ::= ',' | '=' | ' '
- <positional-option> ::= <string>
- <option-name> ::= <string>
- <option-argument> ::= <string>
-
-This roughly corresponds to the GCC option syntax. Note that grouping
-of short options (as in ``ls -la``) is forbidden.
-
-Example::
-
- llvmc -O3 -Wa,-foo,-bar -pedantic -std=c++0x a.c b.c c.c
-
-Option arguments can also have special forms. For example, an argument
-can be a comma-separated list (like in -Wa,-foo,-bar). In such cases,
-it's up to the option handler to parse the argument.
-
-Option semantics
-----------------
-
-According to their meaning, options are classified into the following
-categories:
-
-- Global options - Options that influence compilation graph
- construction/traversal. Example: -E (stop after preprocessing).
-
-- Local options - Options that influence one or several Actions in
- the generated action sequence. Example: -O3 (turn on optimization).
-
-- Prefix options - Options that influence the meaning of the following
- command-line arguments. Example: -x language (specify language for
- the input files explicitly). Prefix options can be local or global.
-
-- Built-in options - Options that are hard-coded into the
- driver. Examples: --help, -o file/-pipe (redirect output). Can be
- local or global.
-
-Issues
-======
-
-1. Should global-options-influencing hooks be written by hand or
- auto-generated from TableGen specifications?
-
-2. More?
-
-References
-==========
-
-.. [1] LLVM Bug#686
-
- http://llvm.org/bugs/show_bug.cgi?id=686
-
-.. [2] TableGen Fundamentals
-
- http://llvm.org/docs/TableGenFundamentals.html
diff --git a/release_23/tools/llvmc2/doc/LLVMC-Tutorial.rst b/release_23/tools/llvmc2/doc/LLVMC-Tutorial.rst
deleted file mode 100644
index b8a364f606ce..000000000000
--- a/release_23/tools/llvmc2/doc/LLVMC-Tutorial.rst
+++ /dev/null
@@ -1,258 +0,0 @@
-Tutorial - Writing LLVMC Configuration files
-=============================================
-
-LLVMC is a generic compiler driver, designed to be customizable and
-extensible. It plays the same role for LLVM as the ``gcc`` program
-does for GCC - LLVMC's job is essentially to transform a set of input
-files into a set of targets depending on configuration rules and user
-options. What makes LLVMC different is that these transformation rules
-are completely customizable - in fact, LLVMC knows nothing about the
-specifics of transformation (even the command-line options are mostly
-not hard-coded) and regards the transformation structure as an
-abstract graph. This makes it possible to adapt LLVMC for other
-purposes - for example, as a build tool for game resources. This
-tutorial describes the basic usage and configuration of LLVMC.
-
-Because LLVMC employs TableGen [1]_ as its configuration language, you
-need to be familiar with it to customize LLVMC.
-
-Compiling with LLVMC
---------------------
-
-In general, LLVMC tries to be command-line compatible with ``gcc`` as
-much as possible, so most of the familiar options work::
-
- $ llvmc2 -O3 -Wall hello.cpp
- $ ./a.out
- hello
-
-One nice feature of LLVMC is that you don't have to distinguish
-between different compilers for different languages (think ``g++`` and
-``gcc``) - the right toolchain is chosen automatically based on input
-language names (which are, in turn, determined from file extension). If
-you want to force files ending with ".c" compile as C++, use the
-``-x`` option, just like you would do it with ``gcc``::
-
- $ llvmc2 -x c hello.cpp
- $ # hello.cpp is really a C file
- $ ./a.out
- hello
-
-On the other hand, when using LLVMC as a linker to combine several C++
-object files you should provide the ``--linker`` option since it's
-impossible for LLVMC to choose the right linker in that case::
-
- $ llvmc2 -c hello.cpp
- $ llvmc2 hello.o
- [A lot of link-time errors skipped]
- $ llvmc2 --linker=c++ hello.o
- $ ./a.out
- hello
-
-For further help on command-line LLVMC usage, refer to the ``llvmc
---help`` output.
-
-Customizing LLVMC: the compilation graph
-----------------------------------------
-
-At the time of writing LLVMC does not support on-the-fly reloading of
-configuration, so to customize LLVMC you'll have to edit and recompile
-the source code (which lives under ``$LLVM_DIR/tools/llvmc2``). The
-relevant files are ``Common.td``, ``Tools.td`` and ``Example.td``.
-
-Internally, LLVMC stores information about possible transformations in
-form of a graph. Nodes in this graph represent tools, and edges
-between two nodes represent a transformation path. A special "root"
-node represents entry points for the transformations. LLVMC also
-assigns a weight to each edge (more on that below) to choose between
-several alternative edges.
-
-The definition of the compilation graph (see file ``Example.td``) is
-just a list of edges::
-
- def CompilationGraph : CompilationGraph<[
- Edge<root, llvm_gcc_c>,
- Edge<root, llvm_gcc_assembler>,
- ...
-
- Edge<llvm_gcc_c, llc>,
- Edge<llvm_gcc_cpp, llc>,
- ...
-
- OptionalEdge<llvm_gcc_c, opt, [(switch_on "opt")]>,
- OptionalEdge<llvm_gcc_cpp, opt, [(switch_on "opt")]>,
- ...
-
- OptionalEdge<llvm_gcc_assembler, llvm_gcc_cpp_linker,
- [(if_input_languages_contain "c++"),
- (or (parameter_equals "linker", "g++"),
- (parameter_equals "linker", "c++"))]>,
- ...
-
- ]>;
-
-As you can see, the edges can be either default or optional, where
-optional edges are differentiated by sporting a list of patterns (or
-edge properties) which are used to calculate the edge's weight. The
-default edges are assigned a weight of 1, and optional edges get a
-weight of 0 + 2*N where N is the number of succesful edge property
-matches. When passing an input file through the graph, LLVMC picks the
-edge with the maximum weight. To avoid ambiguity, there should be only
-one default edge between two nodes (with the exception of the root
-node, which gets a special treatment - there you are allowed to
-specify one default edge *per language*).
-
-* Possible edge properties are:
-
- - ``switch_on`` - Returns true if a given command-line option is
- provided by the user. Example: ``(switch_on "opt")``. Note that
- you have to define all possible command-line options separately in
- the tool descriptions. See the next section for the discussion of
- different kinds of command-line options.
-
- - ``parameter_equals`` - Returns true if a command-line parameter equals
- a given value. Example: ``(parameter_equals "W", "all")``.
-
- - ``element_in_list`` - Returns true if a command-line parameter list
- includes a given value. Example: ``(parameter_in_list "l", "pthread")``.
-
- - ``if_input_languages_contain`` - Returns true if a given input
- language belongs to the current input language set.
-
- - ``and`` - Edge property combinator. Returns true if all of its
- arguments return true. Used like this: ``(and (prop1), (prop2),
- ... (propN))``. Nesting is allowed, but not encouraged.
-
- - ``or`` - Edge property combinator that returns true if any one of its
- arguments returns true. Example: ``(or (prop1), (prop2), ... (propN))``.
-
- - ``weight`` - Makes it possible to explicitly specify the quantity
- added to the edge weight if this edge property matches. Used like
- this: ``(weight N, (prop))``. The inner property can include
- ``and`` and ``or`` combinators. When N is equal to 2, equivalent
- to ``(prop)``.
-
- Example: ``(weight 8, (and (switch_on "a"), (switch_on "b")))``.
-
-
-To get a visual representation of the compilation graph (useful for
-debugging), run ``llvmc2 --view-graph``. You will need ``dot`` and
-``gsview`` installed for this to work properly.
-
-
-Writing a tool description
---------------------------
-
-As was said earlier, nodes in the compilation graph represent tools. A
-tool definition looks like this (taken from the ``Tools.td`` file)::
-
- def llvm_gcc_cpp : Tool<[
- (in_language "c++"),
- (out_language "llvm-assembler"),
- (output_suffix "bc"),
- (cmd_line "llvm-g++ -c $INFILE -o $OUTFILE -emit-llvm"),
- (sink)
- ]>;
-
-This defines a new tool called ``llvm_gcc_cpp``, which is an alias for
-``llvm-g++``. As you can see, a tool definition is just a list of
-properties; most of them should be self-evident. The ``sink`` property
-means that this tool should be passed all command-line options that
-aren't handled by the other tools.
-
-The complete list of the currently implemented tool properties follows:
-
-* Possible tool properties:
-
- - ``in_language`` - input language name.
-
- - ``out_language`` - output language name.
-
- - ``output_suffix`` - output file suffix.
-
- - ``cmd_line`` - the actual command used to run the tool. You can use
- ``$INFILE`` and ``$OUTFILE`` variables, as well as output
- redirection with ``>``.
-
- - ``join`` - this tool is a "join node" in the graph, i.e. it gets a
- list of input files and joins them together. Used for linkers.
-
- - ``sink`` - all command-line options that are not handled by other
- tools are passed to this tool.
-
-The next tool definition is slightly more complex::
-
- def llvm_gcc_linker : Tool<[
- (in_language "object-code"),
- (out_language "executable"),
- (output_suffix "out"),
- (cmd_line "llvm-gcc $INFILE -o $OUTFILE"),
- (join),
- (prefix_list_option "L", (forward), (help "add a directory to link path")),
- (prefix_list_option "l", (forward), (help "search a library when linking")),
- (prefix_list_option "Wl", (unpack_values), (help "pass options to linker"))
- ]>;
-
-This tool has a "join" property, which means that it behaves like a
-linker (because of that this tool should be the last in the
-toolchain). This tool also defines several command-line options: ``-l``,
-``-L`` and ``-Wl`` which have their usual meaning. An option has two
-attributes: a name and a (possibly empty) list of properties. All
-currently implemented option types and properties are described below:
-
-* Possible option types:
-
- - ``switch_option`` - a simple boolean switch, for example ``-time``.
-
- - ``parameter_option`` - option that takes an argument, for example
- ``-std=c99``;
-
- - ``parameter_list_option`` - same as the above, but more than one
- occurence of the option is allowed.
-
- - ``prefix_option`` - same as the parameter_option, but the option name
- and parameter value are not separated.
-
- - ``prefix_list_option`` - same as the above, but more than one
- occurence of the option is allowed; example: ``-lm -lpthread``.
-
-
-* Possible option properties:
-
- - ``append_cmd`` - append a string to the tool invocation command.
-
- - ``forward`` - forward this option unchanged.
-
- - ``stop_compilation`` - stop compilation after this phase.
-
- - ``unpack_values`` - used for for splitting and forwarding
- comma-separated lists of options, e.g. ``-Wa,-foo=bar,-baz`` is
- converted to ``-foo=bar -baz`` and appended to the tool invocation
- command.
-
- - ``help`` - help string associated with this option.
-
- - ``required`` - this option is obligatory.
-
-
-Language map
-------------
-
-One last thing that you need to modify when adding support for a new
-language to LLVMC is the language map, which defines mappings from
-file extensions to language names. It is used to choose the proper
-toolchain based on the input. Language map definition is located in
-the file ``Tools.td`` and looks like this::
-
- def LanguageMap : LanguageMap<
- [LangToSuffixes<"c++", ["cc", "cp", "cxx", "cpp", "CPP", "c++", "C"]>,
- LangToSuffixes<"c", ["c"]>,
- ...
- ]>;
-
-
-References
-==========
-
-.. [1] TableGen Fundamentals
- http://llvm.cs.uiuc.edu/docs/TableGenFundamentals.html
diff --git a/release_23/tools/llvmc2/llvmc.cpp b/release_23/tools/llvmc2/llvmc.cpp
deleted file mode 100644
index 4eeb627169be..000000000000
--- a/release_23/tools/llvmc2/llvmc.cpp
+++ /dev/null
@@ -1,102 +0,0 @@
-//===--- llvmc.cpp - The LLVM Compiler Driver ------------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open
-// Source License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This tool provides a single point of access to the LLVM
-// compilation tools. It has many options. To discover the options
-// supported please refer to the tools' manual page or run the tool
-// with the --help option.
-//
-//===----------------------------------------------------------------------===//
-
-#include "CompilationGraph.h"
-#include "Tool.h"
-
-#include "llvm/System/Path.h"
-#include "llvm/Support/CommandLine.h"
-
-#include <iostream>
-#include <stdexcept>
-#include <string>
-
-namespace cl = llvm::cl;
-namespace sys = llvm::sys;
-using namespace llvmc;
-
-// Built-in command-line options.
-// External linkage here is intentional.
-
-cl::list<std::string> InputFilenames(cl::Positional, cl::desc("<input file>"),
- cl::ZeroOrMore);
-cl::opt<std::string> OutputFilename("o", cl::desc("Output file name"),
- cl::value_desc("file"));
-cl::list<std::string> Languages("x",
- cl::desc("Specify the language of the following input files"),
- cl::ZeroOrMore);
-cl::opt<bool> VerboseMode("v",
- cl::desc("Enable verbose mode"));
-cl::opt<bool> WriteGraph("write-graph",
- cl::desc("Write compilation-graph.dot file"),
- cl::Hidden);
-cl::opt<bool> ViewGraph("view-graph",
- cl::desc("Show compilation graph in GhostView"),
- cl::Hidden);
-
-namespace {
- /// BuildTargets - A small wrapper for CompilationGraph::Build.
- int BuildTargets(CompilationGraph& graph) {
- int ret;
- sys::Path tempDir(sys::Path::GetTemporaryDirectory());
-
- try {
- ret = graph.Build(tempDir);
- }
- catch(...) {
- tempDir.eraseFromDisk(true);
- throw;
- }
-
- tempDir.eraseFromDisk(true);
- return ret;
- }
-}
-
-int main(int argc, char** argv) {
- try {
- CompilationGraph graph;
-
- cl::ParseCommandLineOptions(argc, argv,
- "LLVM Compiler Driver (Work In Progress)");
- PopulateCompilationGraph(graph);
-
- if (WriteGraph) {
- graph.writeGraph();
- if (!ViewGraph)
- return 0;
- }
-
- if (ViewGraph) {
- graph.viewGraph();
- return 0;
- }
-
- if (InputFilenames.empty()) {
- std::cerr << "No input files.\n";
- return 1;
- }
-
- return BuildTargets(graph);
- }
- catch(const std::exception& ex) {
- std::cerr << ex.what() << '\n';
- }
- catch(...) {
- std::cerr << "Unknown error!\n";
- }
- return 1;
-}
diff --git a/release_23/tools/lto/Makefile b/release_23/tools/lto/Makefile
deleted file mode 100644
index b5664e4843d1..000000000000
--- a/release_23/tools/lto/Makefile
+++ /dev/null
@@ -1,30 +0,0 @@
-##===- tools/lto/Makefile ----------------------------------*- Makefile -*-===##
-#
-# The LLVM Compiler Infrastructure
-#
-# This file is distributed under the University of Illinois Open Source
-# License. See LICENSE.TXT for details.
-#
-##===----------------------------------------------------------------------===##
-
-LEVEL = ../..
-LIBRARYNAME = LLVMlto
-
-# Include this here so we can get the configuration of the targets
-# that have been configured for construction. We have to do this
-# early so we can set up LINK_COMPONENTS before includeing Makefile.rules
-include $(LEVEL)/Makefile.config
-
-LINK_LIBS_IN_SHARED = 1
-ifeq ($(OS),Darwin)
- SHARED_LIBRARY = 1
- LOADABLE_MODULE = 1
- DONT_BUILD_RELINKED = 1
-else
- BUILD_ARCHIVE = 1
-endif
-
-LINK_COMPONENTS := $(TARGETS_TO_BUILD) ipo scalaropts linker bitreader bitwriter
-
-include $(LEVEL)/Makefile.common
-
diff --git a/release_23/tools/lto/lto-c.cpp b/release_23/tools/lto/lto-c.cpp
deleted file mode 100644
index df9af0bef402..000000000000
--- a/release_23/tools/lto/lto-c.cpp
+++ /dev/null
@@ -1,66 +0,0 @@
-//===- lto-c.cpp - LLVM Link Time Optimizer C Wrappers --------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements a C wrapper API for the Link Time Optimization
-// library.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm-c/LinkTimeOptimizer.h"
-#include "llvm/LinkTimeOptimizer.h"
-using namespace llvm;
-
-
-/// Create an instance of the LLVM LTO object for performing the link
-/// time optimizations.
-extern "C"
-llvm_lto_t llvm_create_optimizer() {
- return new llvm::LTO();
-}
-
-/// Destroy an instance of the LLVM LTO object
-extern "C"
-void llvm_destroy_optimizer(llvm_lto_t lto) {
- delete (llvm::LTO*)lto;
-}
-
-/// Read an LLVM bitcode file using LTO::readLLVMObjectFile.
-extern "C"
-llvm_lto_status
-llvm_read_object_file(llvm_lto_t lto, const char *input_filename) {
- llvm::LTO *l = (llvm::LTO*)lto;
-
- if (input_filename == NULL)
- return LLVM_LTO_READ_FAILURE;
-
- std::string InputFilename(input_filename);
- llvm::LTO::NameToSymbolMap symbols;
- std::set<std::string> references;
- return (llvm_lto_status)((int)(l->readLLVMObjectFile(InputFilename, symbols,
- references)));
-}
-
-
-/// Optimize and output object code using LTO::optimizeModules.
-extern "C"
-llvm_lto_status
-llvm_optimize_modules(llvm_lto_t lto, const char *output_filename) {
- llvm::LTO *l = (llvm::LTO*)lto;
-
- std::string OutputFilename(output_filename);
- std::vector<const char *> exportList;
- std::string targetTriple;
-
- return (llvm_lto_status)((int)(
- l->optimizeModules(OutputFilename, exportList,
- targetTriple, false, "")));
-}
-
-
-
diff --git a/release_23/tools/lto/lto.cpp b/release_23/tools/lto/lto.cpp
deleted file mode 100644
index d2cb3b8b43c4..000000000000
--- a/release_23/tools/lto/lto.cpp
+++ /dev/null
@@ -1,561 +0,0 @@
-//===-lto.cpp - LLVM Link Time Optimizer ----------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the Link Time Optimization library. This library is
-// intended to be used by linker to optimize code at link time.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Module.h"
-#include "llvm/PassManager.h"
-#include "llvm/Linker.h"
-#include "llvm/Constants.h"
-#include "llvm/DerivedTypes.h"
-#include "llvm/ModuleProvider.h"
-#include "llvm/Bitcode/ReaderWriter.h"
-#include "llvm/Support/CommandLine.h"
-#include "llvm/Support/FileUtilities.h"
-#include "llvm/Support/SystemUtils.h"
-#include "llvm/Support/Mangler.h"
-#include "llvm/Support/MemoryBuffer.h"
-#include "llvm/System/Program.h"
-#include "llvm/System/Signals.h"
-#include "llvm/Analysis/Passes.h"
-#include "llvm/Analysis/LoopPass.h"
-#include "llvm/Analysis/Verifier.h"
-#include "llvm/CodeGen/FileWriters.h"
-#include "llvm/Target/SubtargetFeature.h"
-#include "llvm/Target/TargetOptions.h"
-#include "llvm/Target/TargetData.h"
-#include "llvm/Target/TargetMachine.h"
-#include "llvm/Target/TargetMachineRegistry.h"
-#include "llvm/Target/TargetAsmInfo.h"
-#include "llvm/Transforms/IPO.h"
-#include "llvm/Transforms/Scalar.h"
-#include "llvm/Analysis/LoadValueNumbering.h"
-#include "llvm/Support/MathExtras.h"
-#include "llvm/LinkTimeOptimizer.h"
-#include <fstream>
-#include <ostream>
-using namespace llvm;
-
-extern "C"
-llvm::LinkTimeOptimizer *createLLVMOptimizer(unsigned VERSION)
-{
- // Linker records LLVM_LTO_VERSION based on llvm optimizer available
- // during linker build. Match linker's recorded LTO VERSION number
- // with installed llvm optimizer version. If these numbers do not match
- // then linker may not be able to use llvm optimizer dynamically.
- if (VERSION != LLVM_LTO_VERSION)
- return NULL;
-
- llvm::LTO *l = new llvm::LTO();
- return l;
-}
-
-/// If symbol is not used then make it internal and let optimizer takes
-/// care of it.
-void LLVMSymbol::mayBeNotUsed() {
- gv->setLinkage(GlobalValue::InternalLinkage);
-}
-
-// Map LLVM LinkageType to LTO LinakgeType
-static LTOLinkageTypes
-getLTOLinkageType(GlobalValue *v)
-{
- LTOLinkageTypes lt;
- if (v->hasExternalLinkage())
- lt = LTOExternalLinkage;
- else if (v->hasLinkOnceLinkage())
- lt = LTOLinkOnceLinkage;
- else if (v->hasWeakLinkage())
- lt = LTOWeakLinkage;
- else
- // Otherwise it is internal linkage for link time optimizer
- lt = LTOInternalLinkage;
- return lt;
-}
-
-// MAP LLVM VisibilityType to LTO VisibilityType
-static LTOVisibilityTypes
-getLTOVisibilityType(GlobalValue *v)
-{
- LTOVisibilityTypes vis;
- if (v->hasHiddenVisibility())
- vis = LTOHiddenVisibility;
- else if (v->hasProtectedVisibility())
- vis = LTOProtectedVisibility;
- else
- vis = LTODefaultVisibility;
- return vis;
-}
-
-// Find exeternal symbols referenced by VALUE. This is a recursive function.
-static void
-findExternalRefs(Value *value, std::set<std::string> &references,
- Mangler &mangler) {
-
- if (GlobalValue *gv = dyn_cast<GlobalValue>(value)) {
- LTOLinkageTypes lt = getLTOLinkageType(gv);
- if (lt != LTOInternalLinkage && strncmp (gv->getName().c_str(), "llvm.", 5))
- references.insert(mangler.getValueName(gv));
- }
-
- // GlobalValue, even with InternalLinkage type, may have operands with
- // ExternalLinkage type. Do not ignore these operands.
- if (Constant *c = dyn_cast<Constant>(value))
- // Handle ConstantExpr, ConstantStruct, ConstantArry etc..
- for (unsigned i = 0, e = c->getNumOperands(); i != e; ++i)
- findExternalRefs(c->getOperand(i), references, mangler);
-}
-
-/// If Module with InputFilename is available then remove it from allModules
-/// and call delete on it.
-void
-LTO::removeModule (const std::string &InputFilename)
-{
- NameToModuleMap::iterator pos = allModules.find(InputFilename.c_str());
- if (pos == allModules.end())
- return;
-
- Module *m = pos->second;
- allModules.erase(pos);
- delete m;
-}
-
-/// InputFilename is a LLVM bitcode file. If Module with InputFilename is
-/// available then return it. Otherwise parseInputFilename.
-Module *
-LTO::getModule(const std::string &InputFilename)
-{
- Module *m = NULL;
-
- NameToModuleMap::iterator pos = allModules.find(InputFilename.c_str());
- if (pos != allModules.end())
- m = allModules[InputFilename.c_str()];
- else {
- if (MemoryBuffer *Buffer
- = MemoryBuffer::getFile(&InputFilename[0], InputFilename.size())) {
- m = ParseBitcodeFile(Buffer);
- delete Buffer;
- }
- allModules[InputFilename.c_str()] = m;
- }
- return m;
-}
-
-/// InputFilename is a LLVM bitcode file. Reade this bitcode file and
-/// set corresponding target triplet string.
-void
-LTO::getTargetTriple(const std::string &InputFilename,
- std::string &targetTriple)
-{
- Module *m = getModule(InputFilename);
- if (m)
- targetTriple = m->getTargetTriple();
-}
-
-/// InputFilename is a LLVM bitcode file. Read it using bitcode reader.
-/// Collect global functions and symbol names in symbols vector.
-/// Collect external references in references vector.
-/// Return LTO_READ_SUCCESS if there is no error.
-enum LTOStatus
-LTO::readLLVMObjectFile(const std::string &InputFilename,
- NameToSymbolMap &symbols,
- std::set<std::string> &references)
-{
- Module *m = getModule(InputFilename);
- if (!m)
- return LTO_READ_FAILURE;
-
- // Collect Target info
- getTarget(m);
-
- if (!Target)
- return LTO_READ_FAILURE;
-
- // Use mangler to add GlobalPrefix to names to match linker names.
- // FIXME : Instead of hard coding "-" use GlobalPrefix.
- Mangler mangler(*m, Target->getTargetAsmInfo()->getGlobalPrefix());
- modules.push_back(m);
-
- for (Module::iterator f = m->begin(), e = m->end(); f != e; ++f) {
- LTOLinkageTypes lt = getLTOLinkageType(f);
- LTOVisibilityTypes vis = getLTOVisibilityType(f);
- if (!f->isDeclaration() && lt != LTOInternalLinkage
- && strncmp (f->getName().c_str(), "llvm.", 5)) {
- int alignment = ( 16 > f->getAlignment() ? 16 : f->getAlignment());
- LLVMSymbol *newSymbol = new LLVMSymbol(lt, vis, f, f->getName(),
- mangler.getValueName(f),
- Log2_32(alignment));
- symbols[newSymbol->getMangledName()] = newSymbol;
- allSymbols[newSymbol->getMangledName()] = newSymbol;
- }
-
- // Collect external symbols referenced by this function.
- for (Function::iterator b = f->begin(), fe = f->end(); b != fe; ++b)
- for (BasicBlock::iterator i = b->begin(), be = b->end();
- i != be; ++i) {
- for (unsigned count = 0, total = i->getNumOperands();
- count != total; ++count)
- findExternalRefs(i->getOperand(count), references, mangler);
- }
- }
-
- for (Module::global_iterator v = m->global_begin(), e = m->global_end();
- v != e; ++v) {
- LTOLinkageTypes lt = getLTOLinkageType(v);
- LTOVisibilityTypes vis = getLTOVisibilityType(v);
- if (!v->isDeclaration() && lt != LTOInternalLinkage
- && strncmp (v->getName().c_str(), "llvm.", 5)) {
- const TargetData *TD = Target->getTargetData();
- LLVMSymbol *newSymbol = new LLVMSymbol(lt, vis, v, v->getName(),
- mangler.getValueName(v),
- TD->getPreferredAlignmentLog(v));
- symbols[newSymbol->getMangledName()] = newSymbol;
- allSymbols[newSymbol->getMangledName()] = newSymbol;
-
- for (unsigned count = 0, total = v->getNumOperands();
- count != total; ++count)
- findExternalRefs(v->getOperand(count), references, mangler);
-
- }
- }
-
- return LTO_READ_SUCCESS;
-}
-
-/// Get TargetMachine.
-/// Use module M to find appropriate Target.
-void
-LTO::getTarget (Module *M) {
-
- if (Target)
- return;
-
- std::string Err;
- const TargetMachineRegistry::entry* March =
- TargetMachineRegistry::getClosestStaticTargetForModule(*M, Err);
-
- if (March == 0)
- return;
-
- // Create target
- SubtargetFeatures Features;
- std::string FeatureStr;
- std::string TargetTriple = M->getTargetTriple();
-
- if (strncmp(TargetTriple.c_str(), "powerpc-apple-", 14) == 0)
- Features.AddFeature("altivec", true);
- else if (strncmp(TargetTriple.c_str(), "powerpc64-apple-", 16) == 0) {
- Features.AddFeature("64bit", true);
- Features.AddFeature("altivec", true);
- }
-
- FeatureStr = Features.getString();
- Target = March->CtorFn(*M, FeatureStr);
-}
-
-/// Optimize module M using various IPO passes. Use exportList to
-/// internalize selected symbols. Target platform is selected
-/// based on information available to module M. No new target
-/// features are selected.
-enum LTOStatus
-LTO::optimize(Module *M, std::ostream &Out,
- std::vector<const char *> &exportList)
-{
- // Instantiate the pass manager to organize the passes.
- PassManager Passes;
-
- // Collect Target info
- getTarget(M);
-
- if (!Target)
- return LTO_NO_TARGET;
-
- // If target supports exception handling then enable it now.
- if (Target->getTargetAsmInfo()->doesSupportExceptionHandling())
- ExceptionHandling = true;
-
- // Start off with a verification pass.
- Passes.add(createVerifierPass());
-
- // Add an appropriate TargetData instance for this module...
- Passes.add(new TargetData(*Target->getTargetData()));
-
- // Internalize symbols if export list is nonemty
- if (!exportList.empty())
- Passes.add(createInternalizePass(exportList));
-
- // Now that we internalized some globals, see if we can hack on them!
- Passes.add(createGlobalOptimizerPass());
-
- // Linking modules together can lead to duplicated global constants, only
- // keep one copy of each constant...
- Passes.add(createConstantMergePass());
-
- // If the -s command line option was specified, strip the symbols out of the
- // resulting program to make it smaller. -s is a GLD option that we are
- // supporting.
- Passes.add(createStripSymbolsPass());
-
- // Propagate constants at call sites into the functions they call.
- Passes.add(createIPConstantPropagationPass());
-
- // Remove unused arguments from functions...
- Passes.add(createDeadArgEliminationPass());
-
- Passes.add(createFunctionInliningPass()); // Inline small functions
-
- Passes.add(createPruneEHPass()); // Remove dead EH info
-
- Passes.add(createGlobalDCEPass()); // Remove dead functions
-
- // If we didn't decide to inline a function, check to see if we can
- // transform it to pass arguments by value instead of by reference.
- Passes.add(createArgumentPromotionPass());
-
- // The IPO passes may leave cruft around. Clean up after them.
- Passes.add(createInstructionCombiningPass());
-
- Passes.add(createScalarReplAggregatesPass()); // Break up allocas
-
- // Run a few AA driven optimizations here and now, to cleanup the code.
- Passes.add(createGlobalsModRefPass()); // IP alias analysis
-
- Passes.add(createLICMPass()); // Hoist loop invariants
- Passes.add(createGVNPass()); // Remove common subexprs
- Passed.add(createMemCpyOptPass()); // Remove dead memcpy's
- Passes.add(createDeadStoreEliminationPass()); // Nuke dead stores
-
- // Cleanup and simplify the code after the scalar optimizations.
- Passes.add(createInstructionCombiningPass());
-
- // Delete basic blocks, which optimization passes may have killed...
- Passes.add(createCFGSimplificationPass());
-
- // Now that we have optimized the program, discard unreachable functions...
- Passes.add(createGlobalDCEPass());
-
- // Make sure everything is still good.
- Passes.add(createVerifierPass());
-
- FunctionPassManager *CodeGenPasses =
- new FunctionPassManager(new ExistingModuleProvider(M));
-
- CodeGenPasses->add(new TargetData(*Target->getTargetData()));
-
- MachineCodeEmitter *MCE = 0;
-
- switch (Target->addPassesToEmitFile(*CodeGenPasses, Out,
- TargetMachine::AssemblyFile, true)) {
- default:
- case FileModel::Error:
- return LTO_WRITE_FAILURE;
- case FileModel::AsmFile:
- break;
- case FileModel::MachOFile:
- MCE = AddMachOWriter(*CodeGenPasses, Out, *Target);
- break;
- case FileModel::ElfFile:
- MCE = AddELFWriter(*CodeGenPasses, Out, *Target);
- break;
- }
-
- if (Target->addPassesToEmitFileFinish(*CodeGenPasses, MCE, true))
- return LTO_WRITE_FAILURE;
-
- // Run our queue of passes all at once now, efficiently.
- Passes.run(*M);
-
- // Run the code generator, if present.
- CodeGenPasses->doInitialization();
- for (Module::iterator I = M->begin(), E = M->end(); I != E; ++I) {
- if (!I->isDeclaration())
- CodeGenPasses->run(*I);
- }
- CodeGenPasses->doFinalization();
-
- return LTO_OPT_SUCCESS;
-}
-
-///Link all modules together and optimize them using IPO. Generate
-/// native object file using OutputFilename
-/// Return appropriate LTOStatus.
-enum LTOStatus
-LTO::optimizeModules(const std::string &OutputFilename,
- std::vector<const char *> &exportList,
- std::string &targetTriple,
- bool saveTemps, const char *FinalOutputFilename)
-{
- if (modules.empty())
- return LTO_NO_WORK;
-
- std::ios::openmode io_mode =
- std::ios::out | std::ios::trunc | std::ios::binary;
- std::string *errMsg = NULL;
- Module *bigOne = modules[0];
- Linker theLinker("LinkTimeOptimizer", bigOne, false);
- for (unsigned i = 1, e = modules.size(); i != e; ++i)
- if (theLinker.LinkModules(bigOne, modules[i], errMsg))
- return LTO_MODULE_MERGE_FAILURE;
- // all modules have been handed off to the linker.
- modules.clear();
-
- sys::Path FinalOutputPath(FinalOutputFilename);
- FinalOutputPath.eraseSuffix();
-
- switch(CGModel) {
- case LTO_CGM_Dynamic:
- Target->setRelocationModel(Reloc::PIC_);
- break;
- case LTO_CGM_DynamicNoPIC:
- Target->setRelocationModel(Reloc::DynamicNoPIC);
- break;
- case LTO_CGM_Static:
- Target->setRelocationModel(Reloc::Static);
- break;
- }
-
- if (saveTemps) {
- std::string tempFileName(FinalOutputPath.c_str());
- tempFileName += "0.bc";
- std::ofstream Out(tempFileName.c_str(), io_mode);
- WriteBitcodeToFile(bigOne, Out);
- }
-
- // Strip leading underscore because it was added to match names
- // seen by linker.
- for (unsigned i = 0, e = exportList.size(); i != e; ++i) {
- const char *name = exportList[i];
- NameToSymbolMap::iterator itr = allSymbols.find(name);
- if (itr != allSymbols.end())
- exportList[i] = allSymbols[name]->getName();
- }
-
-
- std::string ErrMsg;
- sys::Path TempDir = sys::Path::GetTemporaryDirectory(&ErrMsg);
- if (TempDir.isEmpty()) {
- cerr << "lto: " << ErrMsg << "\n";
- return LTO_WRITE_FAILURE;
- }
- sys::Path tmpAsmFilePath(TempDir);
- if (!tmpAsmFilePath.appendComponent("lto")) {
- cerr << "lto: " << ErrMsg << "\n";
- TempDir.eraseFromDisk(true);
- return LTO_WRITE_FAILURE;
- }
- if (tmpAsmFilePath.createTemporaryFileOnDisk(true, &ErrMsg)) {
- cerr << "lto: " << ErrMsg << "\n";
- TempDir.eraseFromDisk(true);
- return LTO_WRITE_FAILURE;
- }
- sys::RemoveFileOnSignal(tmpAsmFilePath);
-
- std::ofstream asmFile(tmpAsmFilePath.c_str(), io_mode);
- if (!asmFile.is_open() || asmFile.bad()) {
- if (tmpAsmFilePath.exists()) {
- tmpAsmFilePath.eraseFromDisk();
- TempDir.eraseFromDisk(true);
- }
- return LTO_WRITE_FAILURE;
- }
-
- enum LTOStatus status = optimize(bigOne, asmFile, exportList);
- asmFile.close();
- if (status != LTO_OPT_SUCCESS) {
- tmpAsmFilePath.eraseFromDisk();
- TempDir.eraseFromDisk(true);
- return status;
- }
-
- if (saveTemps) {
- std::string tempFileName(FinalOutputPath.c_str());
- tempFileName += "1.bc";
- std::ofstream Out(tempFileName.c_str(), io_mode);
- WriteBitcodeToFile(bigOne, Out);
- }
-
- targetTriple = bigOne->getTargetTriple();
-
- // Run GCC to assemble and link the program into native code.
- //
- // Note:
- // We can't just assemble and link the file with the system assembler
- // and linker because we don't know where to put the _start symbol.
- // GCC mysteriously knows how to do it.
- const sys::Path gcc = sys::Program::FindProgramByName("gcc");
- if (gcc.isEmpty()) {
- tmpAsmFilePath.eraseFromDisk();
- TempDir.eraseFromDisk(true);
- return LTO_ASM_FAILURE;
- }
-
- std::vector<const char*> args;
- args.push_back(gcc.c_str());
- if (strncmp(targetTriple.c_str(), "i686-apple-", 11) == 0) {
- args.push_back("-arch");
- args.push_back("i386");
- }
- if (strncmp(targetTriple.c_str(), "x86_64-apple-", 13) == 0) {
- args.push_back("-arch");
- args.push_back("x86_64");
- }
- if (strncmp(targetTriple.c_str(), "powerpc-apple-", 14) == 0) {
- args.push_back("-arch");
- args.push_back("ppc");
- }
- if (strncmp(targetTriple.c_str(), "powerpc64-apple-", 16) == 0) {
- args.push_back("-arch");
- args.push_back("ppc64");
- }
- args.push_back("-c");
- args.push_back("-x");
- args.push_back("assembler");
- args.push_back("-o");
- args.push_back(OutputFilename.c_str());
- args.push_back(tmpAsmFilePath.c_str());
- args.push_back(0);
-
- if (sys::Program::ExecuteAndWait(gcc, &args[0], 0, 0, 0, 0, &ErrMsg)) {
- cerr << "lto: " << ErrMsg << "\n";
- return LTO_ASM_FAILURE;
- }
-
- tmpAsmFilePath.eraseFromDisk();
- TempDir.eraseFromDisk(true);
-
- return LTO_OPT_SUCCESS;
-}
-
-void LTO::printVersion() {
- cl::PrintVersionMessage();
-}
-
-/// Unused pure-virtual destructor. Must remain empty.
-LinkTimeOptimizer::~LinkTimeOptimizer() {}
-
-/// Destruct LTO. Delete all modules, symbols and target.
-LTO::~LTO() {
-
- for (std::vector<Module *>::iterator itr = modules.begin(), e = modules.end();
- itr != e; ++itr)
- delete *itr;
-
- modules.clear();
-
- for (NameToSymbolMap::iterator itr = allSymbols.begin(), e = allSymbols.end();
- itr != e; ++itr)
- delete itr->second;
-
- allSymbols.clear();
-
- delete Target;
-}
diff --git a/release_23/tools/lto2/LTOCodeGenerator.cpp b/release_23/tools/lto2/LTOCodeGenerator.cpp
deleted file mode 100644
index e829cfb6dc35..000000000000
--- a/release_23/tools/lto2/LTOCodeGenerator.cpp
+++ /dev/null
@@ -1,442 +0,0 @@
-//===-LTOCodeGenerator.cpp - LLVM Link Time Optimizer ---------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the Link Time Optimization library. This library is
-// intended to be used by linker to optimize code at link time.
-//
-//===----------------------------------------------------------------------===//
-
-#include "LTOModule.h"
-#include "LTOCodeGenerator.h"
-
-
-#include "llvm/Module.h"
-#include "llvm/PassManager.h"
-#include "llvm/Linker.h"
-#include "llvm/Constants.h"
-#include "llvm/DerivedTypes.h"
-#include "llvm/ModuleProvider.h"
-#include "llvm/Bitcode/ReaderWriter.h"
-#include "llvm/Support/SystemUtils.h"
-#include "llvm/Support/Mangler.h"
-#include "llvm/Support/MemoryBuffer.h"
-#include "llvm/System/Signals.h"
-#include "llvm/Analysis/Passes.h"
-#include "llvm/Analysis/LoopPass.h"
-#include "llvm/Analysis/Verifier.h"
-#include "llvm/Analysis/LoadValueNumbering.h"
-#include "llvm/CodeGen/FileWriters.h"
-#include "llvm/Target/TargetOptions.h"
-#include "llvm/Target/TargetData.h"
-#include "llvm/Target/TargetMachine.h"
-#include "llvm/Target/TargetMachineRegistry.h"
-#include "llvm/Target/TargetAsmInfo.h"
-#include "llvm/Transforms/IPO.h"
-#include "llvm/Transforms/Scalar.h"
-#include "llvm/Config/config.h"
-
-
-#include <fstream>
-#include <unistd.h>
-#include <stdlib.h>
-#include <fcntl.h>
-
-
-using namespace llvm;
-
-
-
-const char* LTOCodeGenerator::getVersionString()
-{
-#ifdef LLVM_VERSION_INFO
- return PACKAGE_NAME " version " PACKAGE_VERSION ", " LLVM_VERSION_INFO;
-#else
- return PACKAGE_NAME " version " PACKAGE_VERSION;
-#endif
-}
-
-
-LTOCodeGenerator::LTOCodeGenerator()
- : _linker("LinkTimeOptimizer", "ld-temp.o"), _target(NULL),
- _emitDwarfDebugInfo(false), _scopeRestrictionsDone(false),
- _codeModel(LTO_CODEGEN_PIC_MODEL_DYNAMIC),
- _nativeObjectFile(NULL)
-{
-
-}
-
-LTOCodeGenerator::~LTOCodeGenerator()
-{
- delete _target;
- delete _nativeObjectFile;
-}
-
-
-
-bool LTOCodeGenerator::addModule(LTOModule* mod, std::string& errMsg)
-{
- return _linker.LinkInModule(mod->getLLVVMModule(), &errMsg);
-}
-
-
-bool LTOCodeGenerator::setDebugInfo(lto_debug_model debug, std::string& errMsg)
-{
- switch (debug) {
- case LTO_DEBUG_MODEL_NONE:
- _emitDwarfDebugInfo = false;
- return false;
-
- case LTO_DEBUG_MODEL_DWARF:
- _emitDwarfDebugInfo = true;
- return false;
- }
- errMsg = "unknown debug format";
- return true;
-}
-
-
-bool LTOCodeGenerator::setCodePICModel(lto_codegen_model model,
- std::string& errMsg)
-{
- switch (model) {
- case LTO_CODEGEN_PIC_MODEL_STATIC:
- case LTO_CODEGEN_PIC_MODEL_DYNAMIC:
- case LTO_CODEGEN_PIC_MODEL_DYNAMIC_NO_PIC:
- _codeModel = model;
- return false;
- }
- errMsg = "unknown pic model";
- return true;
-}
-
-
-void LTOCodeGenerator::addMustPreserveSymbol(const char* sym)
-{
- _mustPreserveSymbols[sym] = 1;
-}
-
-
-bool LTOCodeGenerator::writeMergedModules(const char* path, std::string& errMsg)
-{
- if ( this->determineTarget(errMsg) )
- return true;
-
- // mark which symbols can not be internalized
- this->applyScopeRestrictions();
-
- // create output file
- std::ofstream out(path, std::ios_base::out|std::ios::trunc|std::ios::binary);
- if ( out.fail() ) {
- errMsg = "could not open bitcode file for writing: ";
- errMsg += path;
- return true;
- }
-
- // write bitcode to it
- WriteBitcodeToFile(_linker.getModule(), out);
- if ( out.fail() ) {
- errMsg = "could not write bitcode file: ";
- errMsg += path;
- return true;
- }
-
- return false;
-}
-
-
-const void* LTOCodeGenerator::compile(size_t* length, std::string& errMsg)
-{
- // make unique temp .s file to put generated assembly code
- sys::Path uniqueAsmPath("lto-llvm.s");
- if ( uniqueAsmPath.createTemporaryFileOnDisk(true, &errMsg) )
- return NULL;
- sys::RemoveFileOnSignal(uniqueAsmPath);
-
- // generate assembly code
- std::ofstream asmFile(uniqueAsmPath.c_str());
- bool genResult = this->generateAssemblyCode(asmFile, errMsg);
- asmFile.close();
- if ( genResult ) {
- if ( uniqueAsmPath.exists() )
- uniqueAsmPath.eraseFromDisk();
- return NULL;
- }
-
- // make unique temp .o file to put generated object file
- sys::PathWithStatus uniqueObjPath("lto-llvm.o");
- if ( uniqueObjPath.createTemporaryFileOnDisk(true, &errMsg) ) {
- if ( uniqueAsmPath.exists() )
- uniqueAsmPath.eraseFromDisk();
- return NULL;
- }
- sys::RemoveFileOnSignal(uniqueObjPath);
-
- // assemble the assembly code
- const std::string& uniqueObjStr = uniqueObjPath.toString();
- bool asmResult = this->assemble(uniqueAsmPath.toString(),
- uniqueObjStr, errMsg);
- if ( !asmResult ) {
- // remove old buffer if compile() called twice
- delete _nativeObjectFile;
-
- // read .o file into memory buffer
- _nativeObjectFile = MemoryBuffer::getFile(uniqueObjStr.c_str(),&errMsg);
- }
-
- // remove temp files
- uniqueAsmPath.eraseFromDisk();
- uniqueObjPath.eraseFromDisk();
-
- // return buffer, unless error
- if ( _nativeObjectFile == NULL )
- return NULL;
- *length = _nativeObjectFile->getBufferSize();
- return _nativeObjectFile->getBufferStart();
-}
-
-
-bool LTOCodeGenerator::assemble(const std::string& asmPath,
- const std::string& objPath, std::string& errMsg)
-{
- // find compiler driver
- const sys::Path gcc = sys::Program::FindProgramByName("gcc");
- if ( gcc.isEmpty() ) {
- errMsg = "can't locate gcc";
- return true;
- }
-
- // build argument list
- std::vector<const char*> args;
- std::string targetTriple = _linker.getModule()->getTargetTriple();
- args.push_back(gcc.c_str());
- if ( targetTriple.find("darwin") != targetTriple.size() ) {
- if (strncmp(targetTriple.c_str(), "i686-apple-", 11) == 0) {
- args.push_back("-arch");
- args.push_back("i386");
- }
- else if (strncmp(targetTriple.c_str(), "x86_64-apple-", 13) == 0) {
- args.push_back("-arch");
- args.push_back("x86_64");
- }
- else if (strncmp(targetTriple.c_str(), "powerpc-apple-", 14) == 0) {
- args.push_back("-arch");
- args.push_back("ppc");
- }
- else if (strncmp(targetTriple.c_str(), "powerpc64-apple-", 16) == 0) {
- args.push_back("-arch");
- args.push_back("ppc64");
- }
- }
- args.push_back("-c");
- args.push_back("-x");
- args.push_back("assembler");
- args.push_back("-o");
- args.push_back(objPath.c_str());
- args.push_back(asmPath.c_str());
- args.push_back(0);
-
- // invoke assembler
- if ( sys::Program::ExecuteAndWait(gcc, &args[0], 0, 0, 0, 0, &errMsg) ) {
- errMsg = "error in assembly";
- return true;
- }
- return false; // success
-}
-
-
-
-bool LTOCodeGenerator::determineTarget(std::string& errMsg)
-{
- if ( _target == NULL ) {
- // create target machine from info for merged modules
- Module* mergedModule = _linker.getModule();
- const TargetMachineRegistry::entry* march =
- TargetMachineRegistry::getClosestStaticTargetForModule(
- *mergedModule, errMsg);
- if ( march == NULL )
- return true;
- std::string features;
- _target = march->CtorFn(*mergedModule, features);
- }
- return false;
-}
-
-void LTOCodeGenerator::applyScopeRestrictions()
-{
- if ( !_scopeRestrictionsDone ) {
- Module* mergedModule = _linker.getModule();
-
- // Start off with a verification pass.
- PassManager passes;
- passes.add(createVerifierPass());
-
- // mark which symbols can not be internalized
- if ( !_mustPreserveSymbols.empty() ) {
- Mangler mangler(*mergedModule,
- _target->getTargetAsmInfo()->getGlobalPrefix());
- std::vector<const char*> mustPreserveList;
- for (Module::iterator f = mergedModule->begin(),
- e = mergedModule->end(); f != e; ++f) {
- if ( !f->isDeclaration()
- && _mustPreserveSymbols.count(mangler.getValueName(f)) )
- mustPreserveList.push_back(::strdup(f->getName().c_str()));
- }
- for (Module::global_iterator v = mergedModule->global_begin(),
- e = mergedModule->global_end(); v != e; ++v) {
- if ( !v->isDeclaration()
- && _mustPreserveSymbols.count(mangler.getValueName(v)) )
- mustPreserveList.push_back(::strdup(v->getName().c_str()));
- }
- passes.add(createInternalizePass(mustPreserveList));
- }
- // apply scope restrictions
- passes.run(*mergedModule);
-
- _scopeRestrictionsDone = true;
- }
-}
-
-
-/// Optimize merged modules using various IPO passes
-bool LTOCodeGenerator::generateAssemblyCode(std::ostream& out, std::string& errMsg)
-{
- if ( this->determineTarget(errMsg) )
- return true;
-
- // mark which symbols can not be internalized
- this->applyScopeRestrictions();
-
- Module* mergedModule = _linker.getModule();
-
- // If target supports exception handling then enable it now.
- if ( _target->getTargetAsmInfo()->doesSupportExceptionHandling() )
- llvm::ExceptionHandling = true;
-
- // set codegen model
- switch( _codeModel ) {
- case LTO_CODEGEN_PIC_MODEL_STATIC:
- _target->setRelocationModel(Reloc::Static);
- break;
- case LTO_CODEGEN_PIC_MODEL_DYNAMIC:
- _target->setRelocationModel(Reloc::PIC_);
- break;
- case LTO_CODEGEN_PIC_MODEL_DYNAMIC_NO_PIC:
- _target->setRelocationModel(Reloc::DynamicNoPIC);
- break;
- }
-
- // Instantiate the pass manager to organize the passes.
- PassManager passes;
-
- // Start off with a verification pass.
- passes.add(createVerifierPass());
-
- // Add an appropriate TargetData instance for this module...
- passes.add(new TargetData(*_target->getTargetData()));
-
- // Now that we internalized some globals, see if we can hack on them!
- passes.add(createGlobalOptimizerPass());
-
- // Linking modules together can lead to duplicated global constants, only
- // keep one copy of each constant...
- passes.add(createConstantMergePass());
-
- // If the -s command line option was specified, strip the symbols out of the
- // resulting program to make it smaller. -s is a GLD option that we are
- // supporting.
- passes.add(createStripSymbolsPass());
-
- // Propagate constants at call sites into the functions they call.
- passes.add(createIPConstantPropagationPass());
-
- // Remove unused arguments from functions...
- passes.add(createDeadArgEliminationPass());
-
- passes.add(createFunctionInliningPass()); // Inline small functions
-
- passes.add(createPruneEHPass()); // Remove dead EH info
-
- passes.add(createGlobalDCEPass()); // Remove dead functions
-
- // If we didn't decide to inline a function, check to see if we can
- // transform it to pass arguments by value instead of by reference.
- passes.add(createArgumentPromotionPass());
-
- // The IPO passes may leave cruft around. Clean up after them.
- passes.add(createInstructionCombiningPass());
- passes.add(createJumpThreadingPass()); // Thread jumps.
- passes.add(createScalarReplAggregatesPass()); // Break up allocas
-
- // Run a few AA driven optimizations here and now, to cleanup the code.
- passes.add(createGlobalsModRefPass()); // IP alias analysis
-
- passes.add(createLICMPass()); // Hoist loop invariants
- passes.add(createGVNPass()); // Remove common subexprs
- passes.add(createMemCpyOptPass()); // Remove dead memcpy's
- passes.add(createDeadStoreEliminationPass()); // Nuke dead stores
-
- // Cleanup and simplify the code after the scalar optimizations.
- passes.add(createInstructionCombiningPass());
-
- passes.add(createJumpThreadingPass()); // Thread jumps.
-
- // Delete basic blocks, which optimization passes may have killed...
- passes.add(createCFGSimplificationPass());
-
- // Now that we have optimized the program, discard unreachable functions...
- passes.add(createGlobalDCEPass());
-
- // Make sure everything is still good.
- passes.add(createVerifierPass());
-
- FunctionPassManager* codeGenPasses =
- new FunctionPassManager(new ExistingModuleProvider(mergedModule));
-
- codeGenPasses->add(new TargetData(*_target->getTargetData()));
-
- MachineCodeEmitter* mce = NULL;
-
- switch (_target->addPassesToEmitFile(*codeGenPasses, out,
- TargetMachine::AssemblyFile, true)) {
- case FileModel::MachOFile:
- mce = AddMachOWriter(*codeGenPasses, out, *_target);
- break;
- case FileModel::ElfFile:
- mce = AddELFWriter(*codeGenPasses, out, *_target);
- break;
- case FileModel::AsmFile:
- break;
- case FileModel::Error:
- case FileModel::None:
- errMsg = "target file type not supported";
- return true;
- }
-
- if (_target->addPassesToEmitFileFinish(*codeGenPasses, mce, true)) {
- errMsg = "target does not support generation of this file type";
- return true;
- }
-
- // Run our queue of passes all at once now, efficiently.
- passes.run(*mergedModule);
-
- // Run the code generator, and write assembly file
- codeGenPasses->doInitialization();
- for (Module::iterator it = mergedModule->begin(),
- e = mergedModule->end(); it != e; ++it) {
- if (!it->isDeclaration())
- codeGenPasses->run(*it);
- }
- codeGenPasses->doFinalization();
-
- return false; // success
-}
-
-
-
diff --git a/release_23/tools/lto2/LTOCodeGenerator.h b/release_23/tools/lto2/LTOCodeGenerator.h
deleted file mode 100644
index eab076ebc880..000000000000
--- a/release_23/tools/lto2/LTOCodeGenerator.h
+++ /dev/null
@@ -1,62 +0,0 @@
-//===-LTOCodeGenerator.h - LLVM Link Time Optimizer -----------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file declares the LTOCodeGenerator class.
-//
-//===----------------------------------------------------------------------===//
-
-
-#ifndef LTO_CODE_GENERATOR_H
-#define LTO_CODE_GENERATOR_H
-
-#include "llvm/Linker.h"
-#include "llvm/ADT/StringMap.h"
-
-#include <string>
-
-
-//
-// C++ class which implements the opaque lto_code_gen_t
-//
-class LTOCodeGenerator {
-public:
- static const char* getVersionString();
-
- LTOCodeGenerator();
- ~LTOCodeGenerator();
-
- bool addModule(class LTOModule*, std::string& errMsg);
- bool setDebugInfo(lto_debug_model, std::string& errMsg);
- bool setCodePICModel(lto_codegen_model, std::string& errMsg);
- void addMustPreserveSymbol(const char* sym);
- bool writeMergedModules(const char* path,
- std::string& errMsg);
- const void* compile(size_t* length, std::string& errMsg);
-
-private:
- bool generateAssemblyCode(std::ostream& out,
- std::string& errMsg);
- bool assemble(const std::string& asmPath,
- const std::string& objPath, std::string& errMsg);
- void applyScopeRestrictions();
- bool determineTarget(std::string& errMsg);
-
- typedef llvm::StringMap<uint8_t> StringSet;
-
- llvm::Linker _linker;
- llvm::TargetMachine* _target;
- bool _emitDwarfDebugInfo;
- bool _scopeRestrictionsDone;
- lto_codegen_model _codeModel;
- StringSet _mustPreserveSymbols;
- llvm::MemoryBuffer* _nativeObjectFile;
-};
-
-#endif // LTO_CODE_GENERATOR_H
-
diff --git a/release_23/tools/lto2/LTOModule.cpp b/release_23/tools/lto2/LTOModule.cpp
deleted file mode 100644
index cc3b1f142dc0..000000000000
--- a/release_23/tools/lto2/LTOModule.cpp
+++ /dev/null
@@ -1,321 +0,0 @@
-//===-LTOModule.cpp - LLVM Link Time Optimizer ----------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the Link Time Optimization library. This library is
-// intended to be used by linker to optimize code at link time.
-//
-//===----------------------------------------------------------------------===//
-
-#include "LTOModule.h"
-
-#include "llvm/Module.h"
-#include "llvm/ModuleProvider.h"
-#include "llvm/ADT/OwningPtr.h"
-#include "llvm/Bitcode/ReaderWriter.h"
-#include "llvm/Support/SystemUtils.h"
-#include "llvm/Support/Mangler.h"
-#include "llvm/Support/MemoryBuffer.h"
-#include "llvm/Support/MathExtras.h"
-#include "llvm/System/Path.h"
-#include "llvm/System/Process.h"
-#include "llvm/Target/TargetMachine.h"
-#include "llvm/Target/TargetMachineRegistry.h"
-#include "llvm/Target/TargetAsmInfo.h"
-
-
-#include <fstream>
-
-using namespace llvm;
-
-bool LTOModule::isBitcodeFile(const void* mem, size_t length)
-{
- return ( llvm::sys::IdentifyFileType((char*)mem, length)
- == llvm::sys::Bitcode_FileType );
-}
-
-bool LTOModule::isBitcodeFile(const char* path)
-{
- return llvm::sys::Path(path).isBitcodeFile();
-}
-
-bool LTOModule::isBitcodeFileForTarget(const void* mem, size_t length,
- const char* triplePrefix)
-{
- MemoryBuffer* buffer = makeBuffer(mem, length);
- if ( buffer == NULL )
- return false;
- return isTargetMatch(buffer, triplePrefix);
-}
-
-
-bool LTOModule::isBitcodeFileForTarget(const char* path,
- const char* triplePrefix)
-{
- MemoryBuffer *buffer = MemoryBuffer::getFile(path);
- if (buffer == NULL)
- return false;
- return isTargetMatch(buffer, triplePrefix);
-}
-
-// takes ownership of buffer
-bool LTOModule::isTargetMatch(MemoryBuffer* buffer, const char* triplePrefix)
-{
- OwningPtr<ModuleProvider> mp(getBitcodeModuleProvider(buffer));
- // on success, mp owns buffer and both are deleted at end of this method
- if ( !mp ) {
- delete buffer;
- return false;
- }
- std::string actualTarget = mp->getModule()->getTargetTriple();
- return ( strncmp(actualTarget.c_str(), triplePrefix,
- strlen(triplePrefix)) == 0);
-}
-
-
-LTOModule::LTOModule(Module* m, TargetMachine* t)
- : _module(m), _target(t), _symbolsParsed(false)
-{
-}
-
-LTOModule* LTOModule::makeLTOModule(const char* path, std::string& errMsg)
-{
- OwningPtr<MemoryBuffer> buffer(MemoryBuffer::getFile(path, &errMsg));
- if ( !buffer )
- return NULL;
- return makeLTOModule(buffer.get(), errMsg);
-}
-
-/// makeBuffer - create a MemoryBuffer from a memory range.
-/// MemoryBuffer requires the byte past end of the buffer to be a zero.
-/// We might get lucky and already be that way, otherwise make a copy.
-/// Also if next byte is on a different page, don't assume it is readable.
-MemoryBuffer* LTOModule::makeBuffer(const void* mem, size_t length)
-{
- const char* startPtr = (char*)mem;
- const char* endPtr = startPtr+length;
- if ( (((uintptr_t)endPtr & (sys::Process::GetPageSize()-1)) == 0)
- || (*endPtr != 0) )
- return MemoryBuffer::getMemBufferCopy(startPtr, endPtr);
- else
- return MemoryBuffer::getMemBuffer(startPtr, endPtr);
-}
-
-
-LTOModule* LTOModule::makeLTOModule(const void* mem, size_t length,
- std::string& errMsg)
-{
- OwningPtr<MemoryBuffer> buffer(makeBuffer(mem, length));
- if ( !buffer )
- return NULL;
- return makeLTOModule(buffer.get(), errMsg);
-}
-
-LTOModule* LTOModule::makeLTOModule(MemoryBuffer* buffer, std::string& errMsg)
-{
- // parse bitcode buffer
- OwningPtr<Module> m(ParseBitcodeFile(buffer, &errMsg));
- if ( !m )
- return NULL;
- // find machine architecture for this module
- const TargetMachineRegistry::entry* march =
- TargetMachineRegistry::getClosestStaticTargetForModule(*m, errMsg);
- if ( march == NULL )
- return NULL;
- // construct LTModule, hand over ownership of module and target
- std::string features;
- TargetMachine* target = march->CtorFn(*m, features);
- return new LTOModule(m.take(), target);
-}
-
-
-const char* LTOModule::getTargetTriple()
-{
- return _module->getTargetTriple().c_str();
-}
-
-void LTOModule::addDefinedFunctionSymbol(Function* f, Mangler &mangler)
-{
- // add to list of defined symbols
- addDefinedSymbol(f, mangler, true);
-
- // add external symbols referenced by this function.
- for (Function::iterator b = f->begin(); b != f->end(); ++b) {
- for (BasicBlock::iterator i = b->begin(); i != b->end(); ++i) {
- for (unsigned count = 0, total = i->getNumOperands();
- count != total; ++count) {
- findExternalRefs(i->getOperand(count), mangler);
- }
- }
- }
-}
-
-void LTOModule::addDefinedDataSymbol(GlobalValue* v, Mangler &mangler)
-{
- // add to list of defined symbols
- addDefinedSymbol(v, mangler, false);
-
- // add external symbols referenced by this data.
- for (unsigned count = 0, total = v->getNumOperands();\
- count != total; ++count) {
- findExternalRefs(v->getOperand(count), mangler);
- }
-}
-
-
-void LTOModule::addDefinedSymbol(GlobalValue* def, Mangler &mangler,
- bool isFunction)
-{
- // string is owned by _defines
- const char* symbolName = ::strdup(mangler.getValueName(def).c_str());
-
- // set alignment part log2() can have rounding errors
- uint32_t align = def->getAlignment();
- uint32_t attr = align ? CountTrailingZeros_32(def->getAlignment()) : 0;
-
- // set permissions part
- if ( isFunction )
- attr |= LTO_SYMBOL_PERMISSIONS_CODE;
- else {
- GlobalVariable* gv = dyn_cast<GlobalVariable>(def);
- if ( (gv != NULL) && gv->isConstant() )
- attr |= LTO_SYMBOL_PERMISSIONS_RODATA;
- else
- attr |= LTO_SYMBOL_PERMISSIONS_DATA;
- }
-
- // set definition part
- if ( def->hasWeakLinkage() || def->hasLinkOnceLinkage() ) {
- // lvm bitcode does not differenciate between weak def data
- // and tentative definitions!
- // HACK HACK HACK
- // C++ does not use tentative definitions, but does use weak symbols
- // so guess that anything that looks like a C++ symbol is weak and others
- // are tentative definitions
- if ( (strncmp(symbolName, "__Z", 3) == 0) )
- attr |= LTO_SYMBOL_DEFINITION_WEAK;
- else {
- attr |= LTO_SYMBOL_DEFINITION_TENTATIVE;
- }
- }
- else {
- attr |= LTO_SYMBOL_DEFINITION_REGULAR;
- }
-
- // set scope part
- if ( def->hasHiddenVisibility() )
- attr |= LTO_SYMBOL_SCOPE_HIDDEN;
- else if ( def->hasExternalLinkage() || def->hasWeakLinkage() )
- attr |= LTO_SYMBOL_SCOPE_DEFAULT;
- else
- attr |= LTO_SYMBOL_SCOPE_INTERNAL;
-
- // add to table of symbols
- NameAndAttributes info;
- info.name = symbolName;
- info.attributes = (lto_symbol_attributes)attr;
- _symbols.push_back(info);
- _defines[info.name] = 1;
-}
-
-
-void LTOModule::addPotentialUndefinedSymbol(GlobalValue* decl, Mangler &mangler)
-{
- const char* name = mangler.getValueName(decl).c_str();
- // ignore all llvm.* symbols
- if ( strncmp(name, "llvm.", 5) != 0 ) {
- _undefines[name] = 1;
- }
-}
-
-
-
-// Find exeternal symbols referenced by VALUE. This is a recursive function.
-void LTOModule::findExternalRefs(Value* value, Mangler &mangler) {
-
- if (GlobalValue* gv = dyn_cast<GlobalValue>(value)) {
- if ( !gv->hasExternalLinkage() )
- addPotentialUndefinedSymbol(gv, mangler);
- }
-
- // GlobalValue, even with InternalLinkage type, may have operands with
- // ExternalLinkage type. Do not ignore these operands.
- if (Constant* c = dyn_cast<Constant>(value)) {
- // Handle ConstantExpr, ConstantStruct, ConstantArry etc..
- for (unsigned i = 0, e = c->getNumOperands(); i != e; ++i)
- findExternalRefs(c->getOperand(i), mangler);
- }
-}
-
-void LTOModule::lazyParseSymbols()
-{
- if ( !_symbolsParsed ) {
- _symbolsParsed = true;
-
- // Use mangler to add GlobalPrefix to names to match linker names.
- Mangler mangler(*_module, _target->getTargetAsmInfo()->getGlobalPrefix());
-
- // add functions
- for (Module::iterator f = _module->begin(); f != _module->end(); ++f) {
- if ( f->isDeclaration() )
- addPotentialUndefinedSymbol(f, mangler);
- else
- addDefinedFunctionSymbol(f, mangler);
- }
-
- // add data
- for (Module::global_iterator v = _module->global_begin(),
- e = _module->global_end(); v != e; ++v) {
- if ( v->isDeclaration() )
- addPotentialUndefinedSymbol(v, mangler);
- else
- addDefinedDataSymbol(v, mangler);
- }
-
- // make symbols for all undefines
- for (StringSet::iterator it=_undefines.begin();
- it != _undefines.end(); ++it) {
- // if this symbol also has a definition, then don't make an undefine
- // because it is a tentative definition
- if ( _defines.count(it->getKeyData(), it->getKeyData()+
- it->getKeyLength()) == 0 ) {
- NameAndAttributes info;
- info.name = it->getKeyData();
- info.attributes = LTO_SYMBOL_DEFINITION_UNDEFINED;
- _symbols.push_back(info);
- }
- }
- }
-}
-
-
-uint32_t LTOModule::getSymbolCount()
-{
- lazyParseSymbols();
- return _symbols.size();
-}
-
-
-lto_symbol_attributes LTOModule::getSymbolAttributes(uint32_t index)
-{
- lazyParseSymbols();
- if ( index < _symbols.size() )
- return _symbols[index].attributes;
- else
- return lto_symbol_attributes(0);
-}
-
-const char* LTOModule::getSymbolName(uint32_t index)
-{
- lazyParseSymbols();
- if ( index < _symbols.size() )
- return _symbols[index].name;
- else
- return NULL;
-}
-
diff --git a/release_23/tools/lto2/LTOModule.h b/release_23/tools/lto2/LTOModule.h
deleted file mode 100644
index fa15850c6292..000000000000
--- a/release_23/tools/lto2/LTOModule.h
+++ /dev/null
@@ -1,103 +0,0 @@
-//===-LTOModule.h - LLVM Link Time Optimizer ------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file declares the LTOModule class.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LTO_MODULE_H
-#define LTO_MODULE_H
-
-#include "llvm/Module.h"
-#include "llvm/ADT/OwningPtr.h"
-#include "llvm/Target/TargetMachine.h"
-#include "llvm/ADT/StringMap.h"
-
-#include "llvm-c/lto.h"
-
-#include <vector>
-#include <string>
-
-
-// forward references to llvm classes
-namespace llvm {
- class Mangler;
- class MemoryBuffer;
- class GlobalValue;
- class Value;
- class Function;
-}
-
-
-//
-// C++ class which implements the opaque lto_module_t
-//
-class LTOModule {
-public:
-
- static bool isBitcodeFile(const void* mem, size_t length);
- static bool isBitcodeFile(const char* path);
-
- static bool isBitcodeFileForTarget(const void* mem,
- size_t length, const char* triplePrefix);
-
- static bool isBitcodeFileForTarget(const char* path,
- const char* triplePrefix);
-
- static LTOModule* makeLTOModule(const char* path, std::string& errMsg);
- static LTOModule* makeLTOModule(const void* mem, size_t length,
- std::string& errMsg);
-
- const char* getTargetTriple();
- uint32_t getSymbolCount();
- lto_symbol_attributes getSymbolAttributes(uint32_t index);
- const char* getSymbolName(uint32_t index);
-
- llvm::Module * getLLVVMModule() { return _module.get(); }
-
-private:
- LTOModule(llvm::Module* m, llvm::TargetMachine* t);
-
- void lazyParseSymbols();
- void addDefinedSymbol(llvm::GlobalValue* def,
- llvm::Mangler& mangler,
- bool isFunction);
- void addPotentialUndefinedSymbol(llvm::GlobalValue* decl,
- llvm::Mangler &mangler);
- void findExternalRefs(llvm::Value* value,
- llvm::Mangler& mangler);
- void addDefinedFunctionSymbol(llvm::Function* f,
- llvm::Mangler &mangler);
- void addDefinedDataSymbol(llvm::GlobalValue* v,
- llvm::Mangler &mangler);
- static bool isTargetMatch(llvm::MemoryBuffer* memBuffer,
- const char* triplePrefix);
-
- static LTOModule* makeLTOModule(llvm::MemoryBuffer* buffer,
- std::string& errMsg);
- static llvm::MemoryBuffer* makeBuffer(const void* mem, size_t length);
-
- typedef llvm::StringMap<uint8_t> StringSet;
-
- struct NameAndAttributes {
- const char* name;
- lto_symbol_attributes attributes;
- };
-
- llvm::OwningPtr<llvm::Module> _module;
- llvm::OwningPtr<llvm::TargetMachine> _target;
- bool _symbolsParsed;
- std::vector<NameAndAttributes> _symbols;
- // _defines and _undefines only needed to disambiguate tentative definitions
- StringSet _defines;
- StringSet _undefines;
-};
-
-#endif // LTO_MODULE_H
-
diff --git a/release_23/tools/lto2/Makefile b/release_23/tools/lto2/Makefile
deleted file mode 100644
index 45fa69cd8704..000000000000
--- a/release_23/tools/lto2/Makefile
+++ /dev/null
@@ -1,53 +0,0 @@
-##===- tools/lto2/Makefile ---------------------------------*- Makefile -*-===##
-#
-# The LLVM Compiler Infrastructure
-#
-# This file is distributed under the University of Illinois Open Source
-# License. See LICENSE.TXT for details.
-#
-##===----------------------------------------------------------------------===##
-
-LEVEL = ../..
-LIBRARYNAME = LTO
-
-# Include this here so we can get the configuration of the targets
-# that have been configured for construction. We have to do this
-# early so we can set up LINK_COMPONENTS before includeing Makefile.rules
-include $(LEVEL)/Makefile.config
-
-LINK_LIBS_IN_SHARED = 1
-ifeq ($(OS),Darwin)
- SHARED_LIBRARY = 1
- BUILD_ARCHIVE = 0
- DONT_BUILD_RELINKED = 1
-else
- BUILD_ARCHIVE = 1
-endif
-
-LINK_COMPONENTS := $(TARGETS_TO_BUILD) ipo scalaropts linker bitreader bitwriter
-
-include $(LEVEL)/Makefile.common
-
-ifeq ($(OS),Darwin)
- # set dylib internal version number to llvmCore submission number
- ifdef LLVM_SUBMIT_VERSION
- LLVMLibsOptions := $(LLVMLibsOptions) -Wl,-current_version \
- -Wl,$(LLVM_SUBMIT_VERSION).$(LLVM_SUBMIT_SUBVERSION) \
- -Wl,-compatibility_version -Wl,1
- endif
- # extra options to override libtool defaults
- LLVMLibsOptions := $(LLVMLibsOptions) \
- -no-undefined -avoid-version \
- -Wl,-exported_symbols_list -Wl,$(PROJ_SRC_DIR)/lto.exports \
- -Wl,-dead_strip \
- -Wl,-seg1addr -Wl,0xE0000000
-
- # Mac OS X 10.4 and earlier tools do not allow a second -install_name on command line
- DARWIN_VERS := $(shell echo $(TARGET_TRIPLE) | sed 's/.*darwin\([0-9]*\).*/\1/')
- ifneq ($(DARWIN_VERS),8)
- LLVMLibsOptions := $(LLVMLibsOptions) \
- -Wl,-install_name \
- -Wl,"@executable_path/../lib/lib$(LIBRARYNAME)$(SHLIBEXT)"
- endif
-
-endif
diff --git a/release_23/tools/lto2/lto.cpp b/release_23/tools/lto2/lto.cpp
deleted file mode 100644
index f60f7b5ac094..000000000000
--- a/release_23/tools/lto2/lto.cpp
+++ /dev/null
@@ -1,241 +0,0 @@
-//===-lto.cpp - LLVM Link Time Optimizer ----------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the Link Time Optimization library. This library is
-// intended to be used by linker to optimize code at link time.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm-c/lto.h"
-
-#include "LTOModule.h"
-#include "LTOCodeGenerator.h"
-
-
-// holds most recent error string
-// *** not thread safe ***
-static std::string sLastErrorString;
-
-
-
-//
-// returns a printable string
-//
-extern const char* lto_get_version()
-{
- return LTOCodeGenerator::getVersionString();
-}
-
-//
-// returns the last error string or NULL if last operation was successful
-//
-const char* lto_get_error_message()
-{
- return sLastErrorString.c_str();
-}
-
-
-
-//
-// validates if a file is a loadable object file
-//
-bool lto_module_is_object_file(const char* path)
-{
- return LTOModule::isBitcodeFile(path);
-}
-
-
-//
-// validates if a file is a loadable object file compilable for requested target
-//
-bool lto_module_is_object_file_for_target(const char* path,
- const char* target_triplet_prefix)
-{
- return LTOModule::isBitcodeFileForTarget(path, target_triplet_prefix);
-}
-
-
-//
-// validates if a buffer is a loadable object file
-//
-bool lto_module_is_object_file_in_memory(const void* mem, size_t length)
-{
- return LTOModule::isBitcodeFile(mem, length);
-}
-
-
-//
-// validates if a buffer is a loadable object file compilable for the target
-//
-bool lto_module_is_object_file_in_memory_for_target(const void* mem,
- size_t length, const char* target_triplet_prefix)
-{
- return LTOModule::isBitcodeFileForTarget(mem, length, target_triplet_prefix);
-}
-
-
-
-//
-// loads an object file from disk
-// returns NULL on error (check lto_get_error_message() for details)
-//
-lto_module_t lto_module_create(const char* path)
-{
- return LTOModule::makeLTOModule(path, sLastErrorString);
-}
-
-
-//
-// loads an object file from memory
-// returns NULL on error (check lto_get_error_message() for details)
-//
-lto_module_t lto_module_create_from_memory(const void* mem, size_t length)
-{
- return LTOModule::makeLTOModule(mem, length, sLastErrorString);
-}
-
-
-//
-// frees all memory for a module
-// upon return the lto_module_t is no longer valid
-//
-void lto_module_dispose(lto_module_t mod)
-{
- delete mod;
-}
-
-
-//
-// returns triplet string which the object module was compiled under
-//
-const char* lto_module_get_target_triple(lto_module_t mod)
-{
- return mod->getTargetTriple();
-}
-
-
-//
-// returns the number of symbols in the object module
-//
-uint32_t lto_module_get_num_symbols(lto_module_t mod)
-{
- return mod->getSymbolCount();
-}
-
-//
-// returns the name of the ith symbol in the object module
-//
-const char* lto_module_get_symbol_name(lto_module_t mod, uint32_t index)
-{
- return mod->getSymbolName(index);
-}
-
-
-//
-// returns the attributes of the ith symbol in the object module
-//
-lto_symbol_attributes lto_module_get_symbol_attribute(lto_module_t mod,
- uint32_t index)
-{
- return mod->getSymbolAttributes(index);
-}
-
-
-
-
-
-//
-// instantiates a code generator
-// returns NULL if there is an error
-//
-lto_code_gen_t lto_codegen_create()
-{
- return new LTOCodeGenerator();
-}
-
-
-
-//
-// frees all memory for a code generator
-// upon return the lto_code_gen_t is no longer valid
-//
-void lto_codegen_dispose(lto_code_gen_t cg)
-{
- delete cg;
-}
-
-
-
-//
-// add an object module to the set of modules for which code will be generated
-// returns true on error (check lto_get_error_message() for details)
-//
-bool lto_codegen_add_module(lto_code_gen_t cg, lto_module_t mod)
-{
- return cg->addModule(mod, sLastErrorString);
-}
-
-
-//
-// sets what if any format of debug info should be generated
-// returns true on error (check lto_get_error_message() for details)
-//
-bool lto_codegen_set_debug_model(lto_code_gen_t cg, lto_debug_model debug)
-{
- return cg->setDebugInfo(debug, sLastErrorString);
-}
-
-
-//
-// sets what code model to generated
-// returns true on error (check lto_get_error_message() for details)
-//
-bool lto_codegen_set_pic_model(lto_code_gen_t cg, lto_codegen_model model)
-{
- return cg->setCodePICModel(model, sLastErrorString);
-}
-
-//
-// adds to a list of all global symbols that must exist in the final
-// generated code. If a function is not listed there, it might be
-// inlined into every usage and optimized away.
-//
-void lto_codegen_add_must_preserve_symbol(lto_code_gen_t cg, const char* symbol)
-{
- cg->addMustPreserveSymbol(symbol);
-}
-
-
-//
-// writes a new file at the specified path that contains the
-// merged contents of all modules added so far.
-// returns true on error (check lto_get_error_message() for details)
-//
-bool lto_codegen_write_merged_modules(lto_code_gen_t cg, const char* path)
-{
- return cg->writeMergedModules(path, sLastErrorString);
-}
-
-
-//
-// Generates code for all added modules into one native object file.
-// On sucess returns a pointer to a generated mach-o/ELF buffer and
-// length set to the buffer size. The buffer is owned by the
-// lto_code_gen_t and will be freed when lto_codegen_dispose()
-// is called, or lto_codegen_compile() is called again.
-// On failure, returns NULL (check lto_get_error_message() for details).
-//
-extern const void*
-lto_codegen_compile(lto_code_gen_t cg, size_t* length)
-{
- return cg->compile(length, sLastErrorString);
-}
-
-
-
diff --git a/release_23/tools/lto2/lto.exports b/release_23/tools/lto2/lto.exports
deleted file mode 100644
index 415cbbe25ba6..000000000000
--- a/release_23/tools/lto2/lto.exports
+++ /dev/null
@@ -1,22 +0,0 @@
-_lto_get_error_message
-_lto_get_version
-_lto_module_create
-_lto_module_create_from_memory
-_lto_module_get_num_symbols
-_lto_module_get_symbol_attribute
-_lto_module_get_symbol_name
-_lto_module_get_target_triple
-_lto_module_is_object_file
-_lto_module_is_object_file_for_target
-_lto_module_is_object_file_in_memory
-_lto_module_is_object_file_in_memory_for_target
-_lto_module_dispose
-_lto_codegen_add_module
-_lto_codegen_add_must_preserve_symbol
-_lto_codegen_compile
-_lto_codegen_create
-_lto_codegen_dispose
-_lto_codegen_set_debug_model
-_lto_codegen_set_pic_model
-_lto_codegen_write_merged_modules
-
diff --git a/release_23/tools/opt/AnalysisWrappers.cpp b/release_23/tools/opt/AnalysisWrappers.cpp
deleted file mode 100644
index dcc8dbb49efa..000000000000
--- a/release_23/tools/opt/AnalysisWrappers.cpp
+++ /dev/null
@@ -1,88 +0,0 @@
-//===- AnalysisWrappers.cpp - Wrappers around non-pass analyses -----------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines pass wrappers around LLVM analyses that don't make sense to
-// be passes. It provides a nice standard pass interface to these classes so
-// that they can be printed out by analyze.
-//
-// These classes are separated out of analyze.cpp so that it is more clear which
-// code is the integral part of the analyze tool, and which part of the code is
-// just making it so more passes are available.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Module.h"
-#include "llvm/Pass.h"
-#include "llvm/Support/CallSite.h"
-#include "llvm/Analysis/CallGraph.h"
-#include <iostream>
-using namespace llvm;
-
-namespace {
- /// ExternalFunctionsPassedConstants - This pass prints out call sites to
- /// external functions that are called with constant arguments. This can be
- /// useful when looking for standard library functions we should constant fold
- /// or handle in alias analyses.
- struct ExternalFunctionsPassedConstants : public ModulePass {
- static char ID; // Pass ID, replacement for typeid
- ExternalFunctionsPassedConstants() : ModulePass((intptr_t)&ID) {}
- virtual bool runOnModule(Module &M) {
- for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I)
- if (I->isDeclaration()) {
- bool PrintedFn = false;
- for (Value::use_iterator UI = I->use_begin(), E = I->use_end();
- UI != E; ++UI)
- if (Instruction *User = dyn_cast<Instruction>(*UI)) {
- CallSite CS = CallSite::get(User);
- if (CS.getInstruction()) {
- for (CallSite::arg_iterator AI = CS.arg_begin(),
- E = CS.arg_end(); AI != E; ++AI)
- if (isa<Constant>(*AI)) {
- if (!PrintedFn) {
- std::cerr << "Function '" << I->getName() << "':\n";
- PrintedFn = true;
- }
- std::cerr << *User;
- break;
- }
- }
- }
- }
-
- return false;
- }
-
- virtual void getAnalysisUsage(AnalysisUsage &AU) const {
- AU.setPreservesAll();
- }
- };
-
- char ExternalFunctionsPassedConstants::ID = 0;
- RegisterPass<ExternalFunctionsPassedConstants>
- P1("externalfnconstants", "Print external fn callsites passed constants");
-
- struct CallGraphPrinter : public ModulePass {
- static char ID; // Pass ID, replacement for typeid
- CallGraphPrinter() : ModulePass((intptr_t)&ID) {}
-
- virtual void getAnalysisUsage(AnalysisUsage &AU) const {
- AU.setPreservesAll();
- AU.addRequiredTransitive<CallGraph>();
- }
- virtual bool runOnModule(Module &M) { return false; }
-
- virtual void print(std::ostream &OS, const Module *M) const {
- getAnalysis<CallGraph>().print(OS, M);
- }
- };
-
- char CallGraphPrinter::ID = 0;
- RegisterPass<CallGraphPrinter>
- P2("callgraph", "Print a call graph");
-}
diff --git a/release_23/tools/opt/GraphPrinters.cpp b/release_23/tools/opt/GraphPrinters.cpp
deleted file mode 100644
index 867e33480879..000000000000
--- a/release_23/tools/opt/GraphPrinters.cpp
+++ /dev/null
@@ -1,83 +0,0 @@
-//===- GraphPrinters.cpp - DOT printers for various graph types -----------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines several printers for various different types of graphs used
-// by the LLVM infrastructure. It uses the generic graph interface to convert
-// the graph into a .dot graph. These graphs can then be processed with the
-// "dot" tool to convert them to postscript or some other suitable format.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Support/GraphWriter.h"
-#include "llvm/Pass.h"
-#include "llvm/Value.h"
-#include "llvm/Analysis/CallGraph.h"
-#include <iostream>
-#include <fstream>
-using namespace llvm;
-
-template<typename GraphType>
-static void WriteGraphToFile(std::ostream &O, const std::string &GraphName,
- const GraphType &GT) {
- std::string Filename = GraphName + ".dot";
- O << "Writing '" << Filename << "'...";
- std::ofstream F(Filename.c_str());
-
- if (F.good())
- WriteGraph(F, GT);
- else
- O << " error opening file for writing!";
- O << "\n";
-}
-
-
-//===----------------------------------------------------------------------===//
-// Call Graph Printer
-//===----------------------------------------------------------------------===//
-
-namespace llvm {
- template<>
- struct DOTGraphTraits<CallGraph*> : public DefaultDOTGraphTraits {
- static std::string getGraphName(CallGraph *F) {
- return "Call Graph";
- }
-
- static std::string getNodeLabel(CallGraphNode *Node, CallGraph *Graph) {
- if (Node->getFunction())
- return ((Value*)Node->getFunction())->getName();
- else
- return "Indirect call node";
- }
- };
-}
-
-
-namespace {
- struct CallGraphPrinter : public ModulePass {
- static char ID; // Pass ID, replacement for typeid
- CallGraphPrinter() : ModulePass((intptr_t)&ID) {}
-
- virtual bool runOnModule(Module &M) {
- WriteGraphToFile(std::cerr, "callgraph", &getAnalysis<CallGraph>());
- return false;
- }
-
- void print(std::ostream &OS) const {}
- void print(std::ostream &OS, const llvm::Module*) const {}
-
- virtual void getAnalysisUsage(AnalysisUsage &AU) const {
- AU.addRequired<CallGraph>();
- AU.setPreservesAll();
- }
- };
-
- char CallGraphPrinter::ID = 0;
- RegisterPass<CallGraphPrinter> P2("print-callgraph",
- "Print Call Graph to 'dot' file");
-}
diff --git a/release_23/tools/opt/Makefile b/release_23/tools/opt/Makefile
deleted file mode 100644
index 481c1ea7b5f6..000000000000
--- a/release_23/tools/opt/Makefile
+++ /dev/null
@@ -1,15 +0,0 @@
-##===- tools/opt/Makefile ------------------------------*- Makefile -*-===##
-#
-# The LLVM Compiler Infrastructure
-#
-# This file is distributed under the University of Illinois Open Source
-# License. See LICENSE.TXT for details.
-#
-##===----------------------------------------------------------------------===##
-LEVEL = ../..
-TOOLNAME = opt
-REQUIRES_EH := 1
-
-LINK_COMPONENTS := bitreader bitwriter instrumentation scalaropts ipo
-
-include $(LEVEL)/Makefile.common
diff --git a/release_23/tools/opt/PrintSCC.cpp b/release_23/tools/opt/PrintSCC.cpp
deleted file mode 100644
index 0b9c12ff4bf3..000000000000
--- a/release_23/tools/opt/PrintSCC.cpp
+++ /dev/null
@@ -1,112 +0,0 @@
-//===- PrintSCC.cpp - Enumerate SCCs in some key graphs -------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file provides passes to print out SCCs in a CFG or a CallGraph.
-// Normally, you would not use these passes; instead, you would use the
-// scc_iterator directly to enumerate SCCs and process them in some way. These
-// passes serve three purposes:
-//
-// (1) As a reference for how to use the scc_iterator.
-// (2) To print out the SCCs for a CFG or a CallGraph:
-// analyze -cfgscc to print the SCCs in each CFG of a module.
-// analyze -cfgscc -stats to print the #SCCs and the maximum SCC size.
-// analyze -cfgscc -debug > /dev/null to watch the algorithm in action.
-//
-// and similarly:
-// analyze -callscc [-stats] [-debug] to print SCCs in the CallGraph
-//
-// (3) To test the scc_iterator.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Pass.h"
-#include "llvm/Module.h"
-#include "llvm/Analysis/CallGraph.h"
-#include "llvm/Support/CFG.h"
-#include "llvm/ADT/SCCIterator.h"
-#include <iostream>
-using namespace llvm;
-
-namespace {
- struct CFGSCC : public FunctionPass {
- static char ID; // Pass identification, replacement for typeid
- CFGSCC() : FunctionPass((intptr_t)&ID) {}
- bool runOnFunction(Function& func);
-
- void print(std::ostream &O, const Module* = 0) const { }
-
- virtual void getAnalysisUsage(AnalysisUsage &AU) const {
- AU.setPreservesAll();
- }
- };
-
- struct CallGraphSCC : public ModulePass {
- static char ID; // Pass identification, replacement for typeid
- CallGraphSCC() : ModulePass((intptr_t)&ID) {}
-
- // run - Print out SCCs in the call graph for the specified module.
- bool runOnModule(Module &M);
-
- void print(std::ostream &O, const Module* = 0) const { }
-
- // getAnalysisUsage - This pass requires the CallGraph.
- virtual void getAnalysisUsage(AnalysisUsage &AU) const {
- AU.setPreservesAll();
- AU.addRequired<CallGraph>();
- }
- };
-
- char CFGSCC::ID = 0;
- RegisterPass<CFGSCC>
- Y("cfgscc", "Print SCCs of each function CFG");
-
- char CallGraphSCC::ID = 0;
- RegisterPass<CallGraphSCC>
- Z("callscc", "Print SCCs of the Call Graph");
-}
-
-bool CFGSCC::runOnFunction(Function &F) {
- unsigned sccNum = 0;
- std::cout << "SCCs for Function " << F.getName() << " in PostOrder:";
- for (scc_iterator<Function*> SCCI = scc_begin(&F),
- E = scc_end(&F); SCCI != E; ++SCCI) {
- std::vector<BasicBlock*> &nextSCC = *SCCI;
- std::cout << "\nSCC #" << ++sccNum << " : ";
- for (std::vector<BasicBlock*>::const_iterator I = nextSCC.begin(),
- E = nextSCC.end(); I != E; ++I)
- std::cout << (*I)->getName() << ", ";
- if (nextSCC.size() == 1 && SCCI.hasLoop())
- std::cout << " (Has self-loop).";
- }
- std::cout << "\n";
-
- return true;
-}
-
-
-// run - Print out SCCs in the call graph for the specified module.
-bool CallGraphSCC::runOnModule(Module &M) {
- CallGraphNode* rootNode = getAnalysis<CallGraph>().getRoot();
- unsigned sccNum = 0;
- std::cout << "SCCs for the program in PostOrder:";
- for (scc_iterator<CallGraphNode*> SCCI = scc_begin(rootNode),
- E = scc_end(rootNode); SCCI != E; ++SCCI) {
- const std::vector<CallGraphNode*> &nextSCC = *SCCI;
- std::cout << "\nSCC #" << ++sccNum << " : ";
- for (std::vector<CallGraphNode*>::const_iterator I = nextSCC.begin(),
- E = nextSCC.end(); I != E; ++I)
- std::cout << ((*I)->getFunction() ? (*I)->getFunction()->getName()
- : std::string("Indirect CallGraph node")) << ", ";
- if (nextSCC.size() == 1 && SCCI.hasLoop())
- std::cout << " (Has self-loop).";
- }
- std::cout << "\n";
-
- return true;
-}
diff --git a/release_23/tools/opt/opt.cpp b/release_23/tools/opt/opt.cpp
deleted file mode 100644
index d1862a08fcf2..000000000000
--- a/release_23/tools/opt/opt.cpp
+++ /dev/null
@@ -1,443 +0,0 @@
-//===- opt.cpp - The LLVM Modular Optimizer -------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// Optimizations may be specified an arbitrary number of times on the command
-// line, They are run in the order specified.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Module.h"
-#include "llvm/PassManager.h"
-#include "llvm/CallGraphSCCPass.h"
-#include "llvm/Bitcode/ReaderWriter.h"
-#include "llvm/Assembly/PrintModulePass.h"
-#include "llvm/Analysis/Verifier.h"
-#include "llvm/Analysis/LoopPass.h"
-#include "llvm/Analysis/CallGraph.h"
-#include "llvm/Target/TargetData.h"
-#include "llvm/Target/TargetMachine.h"
-#include "llvm/Support/PassNameParser.h"
-#include "llvm/System/Signals.h"
-#include "llvm/Support/ManagedStatic.h"
-#include "llvm/Support/MemoryBuffer.h"
-#include "llvm/Support/PluginLoader.h"
-#include "llvm/Support/Streams.h"
-#include "llvm/Support/SystemUtils.h"
-#include "llvm/LinkAllPasses.h"
-#include "llvm/LinkAllVMCore.h"
-#include <iostream>
-#include <fstream>
-#include <memory>
-#include <algorithm>
-using namespace llvm;
-
-// The OptimizationList is automatically populated with registered Passes by the
-// PassNameParser.
-//
-static cl::list<const PassInfo*, bool, PassNameParser>
-PassList(cl::desc("Optimizations available:"));
-
-// Other command line options...
-//
-static cl::opt<std::string>
-InputFilename(cl::Positional, cl::desc("<input bitcode file>"),
- cl::init("-"), cl::value_desc("filename"));
-
-static cl::opt<std::string>
-OutputFilename("o", cl::desc("Override output filename"),
- cl::value_desc("filename"), cl::init("-"));
-
-static cl::opt<bool>
-Force("f", cl::desc("Overwrite output files"));
-
-static cl::opt<bool>
-PrintEachXForm("p", cl::desc("Print module after each transformation"));
-
-static cl::opt<bool>
-NoOutput("disable-output",
- cl::desc("Do not write result bitcode file"), cl::Hidden);
-
-static cl::opt<bool>
-NoVerify("disable-verify", cl::desc("Do not verify result module"), cl::Hidden);
-
-static cl::opt<bool>
-VerifyEach("verify-each", cl::desc("Verify after each transform"));
-
-static cl::opt<bool>
-StripDebug("strip-debug",
- cl::desc("Strip debugger symbol info from translation unit"));
-
-static cl::opt<bool>
-DisableInline("disable-inlining", cl::desc("Do not run the inliner pass"));
-
-static cl::opt<bool>
-DisableOptimizations("disable-opt",
- cl::desc("Do not run any optimization passes"));
-
-static cl::opt<bool>
-StandardCompileOpts("std-compile-opts",
- cl::desc("Include the standard compile time optimizations"));
-
-static cl::opt<bool>
-Quiet("q", cl::desc("Obsolete option"), cl::Hidden);
-
-static cl::alias
-QuietA("quiet", cl::desc("Alias for -q"), cl::aliasopt(Quiet));
-
-static cl::opt<bool>
-AnalyzeOnly("analyze", cl::desc("Only perform analysis, no optimization"));
-
-// ---------- Define Printers for module and function passes ------------
-namespace {
-
-struct CallGraphSCCPassPrinter : public CallGraphSCCPass {
- static char ID;
- const PassInfo *PassToPrint;
- CallGraphSCCPassPrinter(const PassInfo *PI) :
- CallGraphSCCPass((intptr_t)&ID), PassToPrint(PI) {}
-
- virtual bool runOnSCC(const std::vector<CallGraphNode *>&SCC) {
- if (!Quiet) {
- cout << "Printing analysis '" << PassToPrint->getPassName() << "':\n";
-
- for (unsigned i = 0, e = SCC.size(); i != e; ++i) {
- Function *F = SCC[i]->getFunction();
- if (F)
- getAnalysisID<Pass>(PassToPrint).print(cout, F->getParent());
- }
- }
- // Get and print pass...
- return false;
- }
-
- virtual const char *getPassName() const { return "'Pass' Printer"; }
-
- virtual void getAnalysisUsage(AnalysisUsage &AU) const {
- AU.addRequiredID(PassToPrint);
- AU.setPreservesAll();
- }
-};
-
-char CallGraphSCCPassPrinter::ID = 0;
-
-struct ModulePassPrinter : public ModulePass {
- static char ID;
- const PassInfo *PassToPrint;
- ModulePassPrinter(const PassInfo *PI) : ModulePass((intptr_t)&ID),
- PassToPrint(PI) {}
-
- virtual bool runOnModule(Module &M) {
- if (!Quiet) {
- cout << "Printing analysis '" << PassToPrint->getPassName() << "':\n";
- getAnalysisID<Pass>(PassToPrint).print(cout, &M);
- }
-
- // Get and print pass...
- return false;
- }
-
- virtual const char *getPassName() const { return "'Pass' Printer"; }
-
- virtual void getAnalysisUsage(AnalysisUsage &AU) const {
- AU.addRequiredID(PassToPrint);
- AU.setPreservesAll();
- }
-};
-
-char ModulePassPrinter::ID = 0;
-struct FunctionPassPrinter : public FunctionPass {
- const PassInfo *PassToPrint;
- static char ID;
- FunctionPassPrinter(const PassInfo *PI) : FunctionPass((intptr_t)&ID),
- PassToPrint(PI) {}
-
- virtual bool runOnFunction(Function &F) {
- if (!Quiet) {
- cout << "Printing analysis '" << PassToPrint->getPassName()
- << "' for function '" << F.getName() << "':\n";
- }
- // Get and print pass...
- getAnalysisID<Pass>(PassToPrint).print(cout, F.getParent());
- return false;
- }
-
- virtual const char *getPassName() const { return "FunctionPass Printer"; }
-
- virtual void getAnalysisUsage(AnalysisUsage &AU) const {
- AU.addRequiredID(PassToPrint);
- AU.setPreservesAll();
- }
-};
-
-char FunctionPassPrinter::ID = 0;
-
-struct LoopPassPrinter : public LoopPass {
- static char ID;
- const PassInfo *PassToPrint;
- LoopPassPrinter(const PassInfo *PI) :
- LoopPass((intptr_t)&ID), PassToPrint(PI) {}
-
- virtual bool runOnLoop(Loop *L, LPPassManager &LPM) {
- if (!Quiet) {
- cout << "Printing analysis '" << PassToPrint->getPassName() << "':\n";
- getAnalysisID<Pass>(PassToPrint).print(cout,
- L->getHeader()->getParent()->getParent());
- }
- // Get and print pass...
- return false;
- }
-
- virtual const char *getPassName() const { return "'Pass' Printer"; }
-
- virtual void getAnalysisUsage(AnalysisUsage &AU) const {
- AU.addRequiredID(PassToPrint);
- AU.setPreservesAll();
- }
-};
-
-char LoopPassPrinter::ID = 0;
-
-struct BasicBlockPassPrinter : public BasicBlockPass {
- const PassInfo *PassToPrint;
- static char ID;
- BasicBlockPassPrinter(const PassInfo *PI)
- : BasicBlockPass((intptr_t)&ID), PassToPrint(PI) {}
-
- virtual bool runOnBasicBlock(BasicBlock &BB) {
- if (!Quiet) {
- cout << "Printing Analysis info for BasicBlock '" << BB.getName()
- << "': Pass " << PassToPrint->getPassName() << ":\n";
- }
-
- // Get and print pass...
- getAnalysisID<Pass>(PassToPrint).print(cout, BB.getParent()->getParent());
- return false;
- }
-
- virtual const char *getPassName() const { return "BasicBlockPass Printer"; }
-
- virtual void getAnalysisUsage(AnalysisUsage &AU) const {
- AU.addRequiredID(PassToPrint);
- AU.setPreservesAll();
- }
-};
-
-char BasicBlockPassPrinter::ID = 0;
-inline void addPass(PassManager &PM, Pass *P) {
- // Add the pass to the pass manager...
- PM.add(P);
-
- // If we are verifying all of the intermediate steps, add the verifier...
- if (VerifyEach) PM.add(createVerifierPass());
-}
-
-void AddStandardCompilePasses(PassManager &PM) {
- PM.add(createVerifierPass()); // Verify that input is correct
-
- addPass(PM, createLowerSetJmpPass()); // Lower llvm.setjmp/.longjmp
-
- // If the -strip-debug command line option was specified, do it.
- if (StripDebug)
- addPass(PM, createStripSymbolsPass(true));
-
- if (DisableOptimizations) return;
-
- addPass(PM, createRaiseAllocationsPass()); // call %malloc -> malloc inst
- addPass(PM, createCFGSimplificationPass()); // Clean up disgusting code
- addPass(PM, createPromoteMemoryToRegisterPass());// Kill useless allocas
- addPass(PM, createGlobalOptimizerPass()); // Optimize out global vars
- addPass(PM, createGlobalDCEPass()); // Remove unused fns and globs
- addPass(PM, createIPConstantPropagationPass());// IP Constant Propagation
- addPass(PM, createDeadArgEliminationPass()); // Dead argument elimination
- addPass(PM, createInstructionCombiningPass()); // Clean up after IPCP & DAE
- addPass(PM, createCFGSimplificationPass()); // Clean up after IPCP & DAE
-
- addPass(PM, createPruneEHPass()); // Remove dead EH info
-
- if (!DisableInline)
- addPass(PM, createFunctionInliningPass()); // Inline small functions
- addPass(PM, createArgumentPromotionPass()); // Scalarize uninlined fn args
-
- addPass(PM, createTailDuplicationPass()); // Simplify cfg by copying code
- addPass(PM, createSimplifyLibCallsPass()); // Library Call Optimizations
- addPass(PM, createInstructionCombiningPass()); // Cleanup for scalarrepl.
- addPass(PM, createJumpThreadingPass()); // Thread jumps.
- addPass(PM, createCFGSimplificationPass()); // Merge & remove BBs
- addPass(PM, createScalarReplAggregatesPass()); // Break up aggregate allocas
- addPass(PM, createInstructionCombiningPass()); // Combine silly seq's
- addPass(PM, createCondPropagationPass()); // Propagate conditionals
-
- addPass(PM, createTailCallEliminationPass()); // Eliminate tail calls
- addPass(PM, createCFGSimplificationPass()); // Merge & remove BBs
- addPass(PM, createReassociatePass()); // Reassociate expressions
- addPass(PM, createLoopRotatePass());
- addPass(PM, createLICMPass()); // Hoist loop invariants
- addPass(PM, createLoopUnswitchPass()); // Unswitch loops.
- addPass(PM, createLoopIndexSplitPass()); // Index split loops.
- addPass(PM, createInstructionCombiningPass()); // Clean up after LICM/reassoc
- addPass(PM, createIndVarSimplifyPass()); // Canonicalize indvars
- addPass(PM, createLoopUnrollPass()); // Unroll small loops
- addPass(PM, createInstructionCombiningPass()); // Clean up after the unroller
- addPass(PM, createGVNPass()); // Remove redundancies
- addPass(PM, createMemCpyOptPass()); // Remove memcpy / form memset
- addPass(PM, createSCCPPass()); // Constant prop with SCCP
-
- // Run instcombine after redundancy elimination to exploit opportunities
- // opened up by them.
- addPass(PM, createInstructionCombiningPass());
- addPass(PM, createCondPropagationPass()); // Propagate conditionals
-
- addPass(PM, createDeadStoreEliminationPass()); // Delete dead stores
- addPass(PM, createAggressiveDCEPass()); // SSA based 'Aggressive DCE'
- addPass(PM, createCFGSimplificationPass()); // Merge & remove BBs
- addPass(PM, createStripDeadPrototypesPass()); // Get rid of dead prototypes
- addPass(PM, createDeadTypeEliminationPass()); // Eliminate dead types
- addPass(PM, createConstantMergePass()); // Merge dup global constants
-}
-
-} // anonymous namespace
-
-
-//===----------------------------------------------------------------------===//
-// main for opt
-//
-int main(int argc, char **argv) {
- llvm_shutdown_obj X; // Call llvm_shutdown() on exit.
- try {
- cl::ParseCommandLineOptions(argc, argv,
- "llvm .bc -> .bc modular optimizer and analysis printer\n");
- sys::PrintStackTraceOnErrorSignal();
-
- // Allocate a full target machine description only if necessary.
- // FIXME: The choice of target should be controllable on the command line.
- std::auto_ptr<TargetMachine> target;
-
- std::string ErrorMessage;
-
- // Load the input module...
- std::auto_ptr<Module> M;
- if (MemoryBuffer *Buffer
- = MemoryBuffer::getFileOrSTDIN(InputFilename, &ErrorMessage)) {
- M.reset(ParseBitcodeFile(Buffer, &ErrorMessage));
- delete Buffer;
- }
-
- if (M.get() == 0) {
- cerr << argv[0] << ": ";
- if (ErrorMessage.size())
- cerr << ErrorMessage << "\n";
- else
- cerr << "bitcode didn't read correctly.\n";
- return 1;
- }
-
- // Figure out what stream we are supposed to write to...
- // FIXME: cout is not binary!
- std::ostream *Out = &std::cout; // Default to printing to stdout...
- if (OutputFilename != "-") {
- if (!Force && std::ifstream(OutputFilename.c_str())) {
- // If force is not specified, make sure not to overwrite a file!
- cerr << argv[0] << ": error opening '" << OutputFilename
- << "': file exists!\n"
- << "Use -f command line argument to force output\n";
- return 1;
- }
- std::ios::openmode io_mode = std::ios::out | std::ios::trunc |
- std::ios::binary;
- Out = new std::ofstream(OutputFilename.c_str(), io_mode);
-
- if (!Out->good()) {
- cerr << argv[0] << ": error opening " << OutputFilename << "!\n";
- return 1;
- }
-
- // Make sure that the Output file gets unlinked from the disk if we get a
- // SIGINT
- sys::RemoveFileOnSignal(sys::Path(OutputFilename));
- }
-
- // If the output is set to be emitted to standard out, and standard out is a
- // console, print out a warning message and refuse to do it. We don't
- // impress anyone by spewing tons of binary goo to a terminal.
- if (!Force && !NoOutput && CheckBitcodeOutputToConsole(Out,!Quiet)) {
- NoOutput = true;
- }
-
- // Create a PassManager to hold and optimize the collection of passes we are
- // about to build...
- //
- PassManager Passes;
-
- // Add an appropriate TargetData instance for this module...
- Passes.add(new TargetData(M.get()));
-
- // If -std-compile-opts is given, add in all the standard compilation
- // optimizations first. This will handle -strip-debug, -disable-inline,
- // and -disable-opt as well.
- if (StandardCompileOpts)
- AddStandardCompilePasses(Passes);
-
- // otherwise if the -strip-debug command line option was specified, add it.
- else if (StripDebug)
- addPass(Passes, createStripSymbolsPass(true));
-
- // Create a new optimization pass for each one specified on the command line
- for (unsigned i = 0; i < PassList.size(); ++i) {
- const PassInfo *PassInf = PassList[i];
- Pass *P = 0;
- if (PassInf->getNormalCtor())
- P = PassInf->getNormalCtor()();
- else
- cerr << argv[0] << ": cannot create pass: "
- << PassInf->getPassName() << "\n";
- if (P) {
- addPass(Passes, P);
-
- if (AnalyzeOnly) {
- if (dynamic_cast<BasicBlockPass*>(P))
- Passes.add(new BasicBlockPassPrinter(PassInf));
- else if (dynamic_cast<LoopPass*>(P))
- Passes.add(new LoopPassPrinter(PassInf));
- else if (dynamic_cast<FunctionPass*>(P))
- Passes.add(new FunctionPassPrinter(PassInf));
- else if (dynamic_cast<CallGraphSCCPass*>(P))
- Passes.add(new CallGraphSCCPassPrinter(PassInf));
- else
- Passes.add(new ModulePassPrinter(PassInf));
- }
- }
-
- if (PrintEachXForm)
- Passes.add(new PrintModulePass(&cerr));
- }
-
- // Check that the module is well formed on completion of optimization
- if (!NoVerify && !VerifyEach)
- Passes.add(createVerifierPass());
-
- // Write bitcode out to disk or cout as the last step...
- if (!NoOutput && !AnalyzeOnly)
- Passes.add(CreateBitcodeWriterPass(*Out));
-
- // Now that we have all of the passes ready, run them.
- Passes.run(*M.get());
-
- // Delete the ofstream.
- if (Out != &std::cout)
- delete Out;
- return 0;
-
- } catch (const std::string& msg) {
- cerr << argv[0] << ": " << msg << "\n";
- } catch (...) {
- cerr << argv[0] << ": Unexpected unknown exception occurred.\n";
- }
- llvm_shutdown();
- return 1;
-}
diff --git a/release_23/utils/DSAclean.py b/release_23/utils/DSAclean.py
deleted file mode 100755
index 6c43357019ef..000000000000
--- a/release_23/utils/DSAclean.py
+++ /dev/null
@@ -1,32 +0,0 @@
-#! /usr/bin/python
-
-#changelog:
-#10/13/2005b: replaced the # in tmp(.#*)* with alphanumeric and _, this will then remove
-#nodes such as %tmp.1.i and %tmp._i.3
-#10/13/2005: exntended to remove variables of the form %tmp(.#)* rather than just
-#%tmp.#, i.e. it now will remove %tmp.12.3.15 etc, additionally fixed a spelling error in
-#the comments
-#10/12/2005: now it only removes nodes and edges for which the label is %tmp.# rather
-#than removing all lines for which the lable CONTAINS %tmp.#
-import re
-import sys
-if( len(sys.argv) < 3 ):
- print 'usage is: ./DSAclean <dot_file_to_be_cleaned> <out_put_file>'
- sys.exit(1)
-#get a file object
-input = open(sys.argv[1], 'r')
-output = open(sys.argv[2], 'w')
-#we'll get this one line at a time...while we could just put the whole thing in a string
-#it would kill old computers
-buffer = input.readline()
-while buffer != '':
- if re.compile("label(\s*)=(\s*)\"\s%tmp(.\w*)*(\s*)\"").search(buffer):
- #skip next line, write neither this line nor the next
- buffer = input.readline()
- else:
- #this isn't a tmp Node, we can write it
- output.write(buffer)
- #prepare for the next iteration
- buffer = input.readline()
-input.close()
-output.close()
diff --git a/release_23/utils/DSAextract.py b/release_23/utils/DSAextract.py
deleted file mode 100644
index 134e9453fbb5..000000000000
--- a/release_23/utils/DSAextract.py
+++ /dev/null
@@ -1,111 +0,0 @@
-#! /usr/bin/python
-
-#this is a script to extract given named nodes from a dot file, with
-#the associated edges. An edge is kept iff for edge x -> y
-# x and y are both nodes specified to be kept.
-
-#known issues: if a line contains '->' and is not an edge line
-#problems will occur. If node labels do not begin with
-#Node this also will not work. Since this is designed to work
-#on DSA dot output and not general dot files this is ok.
-#If you want to use this on other files rename the node labels
-#to Node[.*] with a script or something. This also relies on
-#the length of a node name being 13 characters (as it is in all
-#DSA dot output files)
-
-#Note that the name of the node can be any substring of the actual
-#name in the dot file. Thus if you say specify COLLAPSED
-#as a parameter this script will pull out all COLLAPSED
-#nodes in the file
-
-#Specifying escape characters in the name like \n also will not work,
-#as Python
-#will make it \\n, I'm not really sure how to fix this
-
-#currently the script prints the names it is searching for
-#to STDOUT, so you can check to see if they are what you intend
-
-import re
-import string
-import sys
-
-
-if len(sys.argv) < 3:
- print 'usage is ./DSAextract <dot_file_to_modify> \
- <output_file> [list of nodes to extract]'
-
-#open the input file
-input = open(sys.argv[1], 'r')
-
-#construct a set of node names
-node_name_set = set()
-for name in sys.argv[3:]:
- node_name_set |= set([name])
-
-#construct a list of compiled regular expressions from the
-#node_name_set
-regexp_list = []
-for name in node_name_set:
- regexp_list.append(re.compile(name))
-
-#used to see what kind of line we are on
-nodeexp = re.compile('Node')
-#used to check to see if the current line is an edge line
-arrowexp = re.compile('->')
-
-node_set = set()
-
-#read the file one line at a time
-buffer = input.readline()
-while buffer != '':
- #filter out the unecessary checks on all the edge lines
- if not arrowexp.search(buffer):
- #check to see if this is a node we are looking for
- for regexp in regexp_list:
- #if this name is for the current node, add the dot variable name
- #for the node (it will be Node(hex number)) to our set of nodes
- if regexp.search(buffer):
- node_set |= set([re.split('\s+',buffer,2)[1]])
- break
- buffer = input.readline()
-
-
-#test code
-#print '\n'
-
-print node_name_set
-
-#print node_set
-
-
-#open the output file
-output = open(sys.argv[2], 'w')
-#start the second pass over the file
-input = open(sys.argv[1], 'r')
-
-buffer = input.readline()
-while buffer != '':
- #there are three types of lines we are looking for
- #1) node lines, 2) edge lines 3) support lines (like page size, etc)
-
- #is this an edge line?
- #note that this is no completely robust, if a none edge line
- #for some reason contains -> it will be missidentified
- #hand edit the file if this happens
- if arrowexp.search(buffer):
- #check to make sure that both nodes are in the node list
- #if they are print this to output
- nodes = arrowexp.split(buffer)
- nodes[0] = string.strip(nodes[0])
- nodes[1] = string.strip(nodes[1])
- if nodes[0][:13] in node_set and \
- nodes[1][:13] in node_set:
- output.write(buffer)
- elif nodeexp.search(buffer): #this is a node line
- node = re.split('\s+', buffer,2)[1]
- if node in node_set:
- output.write(buffer)
- else: #this is a support line
- output.write(buffer)
- buffer = input.readline()
-
diff --git a/release_23/utils/GenLibDeps.pl b/release_23/utils/GenLibDeps.pl
deleted file mode 100755
index 74eedd3383bc..000000000000
--- a/release_23/utils/GenLibDeps.pl
+++ /dev/null
@@ -1,214 +0,0 @@
-#!/usr/bin/perl -w
-#
-# Program: GenLibDeps.pl
-#
-# Synopsis: Generate HTML output that shows the dependencies between a set of
-# libraries. The output of this script should periodically replace
-# the similar content in the UsingLibraries.html document.
-#
-# Syntax: GenLibDeps.pl [-flat] <directory_with_libraries_in_it> [path_to_nm_binary]
-#
-use strict;
-
-# Parse arguments...
-my $FLAT = 0;
-my $WHY = 0;
-while (scalar(@ARGV) and ($_ = $ARGV[0], /^[-+]/)) {
- shift;
- last if /^--$/; # Stop processing arguments on --
-
- # List command line options here...
- if (/^-flat$/) { $FLAT = 1; next; }
- if (/^-why/) { $WHY = 1; $FLAT = 1; next; }
- print "Unknown option: $_ : ignoring!\n";
-}
-
-# Give first option a name.
-my $Directory = $ARGV[0];
-if (!defined($Directory) || ! -d "$Directory") {
- die "First argument must specify the directory containing LLVM libs\n";
-}
-
-my $nmPath = $ARGV[1];
-
-# Find the "dot" program
-my $DotPath="";
-if (!$FLAT) {
- chomp($DotPath = `which dot`);
- die "Can't find 'dot'" if (! -x "$DotPath");
-}
-
-if (!defined($nmPath) || $nmPath eq "") {
- chomp($nmPath=`which nm`);
- die "Can't find 'nm'" if (! -x "$nmPath");
-}
-
-# Open the directory and read its contents, sorting by name and differentiating
-# by whether its a library (.a) or an object file (.o)
-opendir DIR,$Directory;
-my @files = readdir DIR;
-closedir DIR;
-my @libs = grep(/libLLVM.*\.a$/,sort(@files));
-my @objs = grep(/LLVM.*\.o$/,sort(@files));
-
-# Declare the hashes we will use to keep track of the library and object file
-# symbol definitions.
-my %libdefs;
-my %objdefs;
-
-# Gather definitions from the libraries
-foreach my $lib (@libs ) {
- open DEFS, "$nmPath -g $Directory/$lib|";
- while (<DEFS>) {
- next if (! / [ABCDGRST] /);
- s/^[^ ]* [ABCDGRST] //;
- s/\015?\012//; # not sure if <DEFS> is in binmode and uses LF or CRLF.
- # this strips both LF and CRLF.
- $libdefs{$_} = $lib;
- }
- close DEFS;
-}
-
-# Gather definitions from the object files.
-foreach my $obj (@objs ) {
- open DEFS, "$nmPath -g $Directory/$obj |";
- while (<DEFS>) {
- next if (! / [ABCDGRST] /);
- s/^[^ ]* [ABCDGRST] //;
- s/\015?\012//; # not sure if <DEFS> is in binmode and uses LF or CRLF.
- # this strips both LF and CRLF.
- $objdefs{$_} = $obj;
- }
- close DEFS;
-}
-
-# Generate one entry in the <dl> list. This generates the <dt> and <dd> elements
-# for one library or object file. The <dt> provides the name of the library or
-# object. The <dd> provides a list of the libraries/objects it depends on.
-sub gen_one_entry {
- my $lib = $_[0];
- my $lib_ns = $lib;
- $lib_ns =~ s/(.*)\.[oa]/$1/;
- if ($FLAT) {
- print "$lib:";
- if ($WHY) { print "\n"; }
- } else {
- print " <dt><b>$lib</b</dt><dd><ul>\n";
- }
- open UNDEFS,
- "$nmPath -g -u $Directory/$lib | sed -e 's/^ *U //' | sort | uniq |";
- my %DepLibs;
- while (<UNDEFS>) {
- chomp;
- my $lib_printed = 0;
- if (defined($libdefs{$_}) && $libdefs{$_} ne $lib) {
- $DepLibs{$libdefs{$_}} = [] unless exists $DepLibs{$libdefs{$_}};
- push(@{$DepLibs{$libdefs{$_}}}, $_);
- } elsif (defined($objdefs{$_}) && $objdefs{$_} ne $lib) {
- my $libroot = $lib;
- $libroot =~ s/lib(.*).a/$1/;
- if ($objdefs{$_} ne "$libroot.o") {
- $DepLibs{$objdefs{$_}} = [] unless exists $DepLibs{$objdefs{$_}};
- push(@{$DepLibs{$objdefs{$_}}}, $_);
- }
- }
- }
- close UNDEFS;
- for my $key (sort keys %DepLibs) {
- if ($FLAT) {
- print " $key";
- if ($WHY) {
- print "\n";
- my @syms = @{$DepLibs{$key}};
- foreach my $sym (@syms) {
- print " $sym\n";
- }
- }
- } else {
- print " <li>$key</li>\n";
- }
- my $suffix = substr($key,length($key)-1,1);
- $key =~ s/(.*)\.[oa]/$1/;
- if ($suffix eq "a") {
- if (!$FLAT) { print DOT "$lib_ns -> $key [ weight=0 ];\n" };
- } else {
- if (!$FLAT) { print DOT "$lib_ns -> $key [ weight=10];\n" };
- }
- }
- if ($FLAT) {
- if (!$WHY) {
- print "\n";
- }
- } else {
- print " </ul></dd>\n";
- }
-}
-
-# Make sure we flush on write. This is slower but correct based on the way we
-# write I/O in gen_one_entry.
-$| = 1;
-
-# Print the definition list tag
-if (!$FLAT) {
- print "<dl>\n";
-
- open DOT, "| $DotPath -Tgif > libdeps.gif";
-
- print DOT "digraph LibDeps {\n";
- print DOT " size=\"40,15\"; \n";
- print DOT " ratio=\"1.33333\"; \n";
- print DOT " margin=\"0.25\"; \n";
- print DOT " rankdir=\"LR\"; \n";
- print DOT " mclimit=\"50.0\"; \n";
- print DOT " ordering=\"out\"; \n";
- print DOT " center=\"1\";\n";
- print DOT "node [shape=\"box\",\n";
- print DOT " color=\"#000088\",\n";
- print DOT " fillcolor=\"#FFFACD\",\n";
- print DOT " fontcolor=\"#3355BB\",\n";
- print DOT " style=\"filled\",\n";
- print DOT " fontname=\"sans\",\n";
- print DOT " fontsize=\"24\"\n";
- print DOT "];\n";
- print DOT "edge [dir=\"forward\",style=\"solid\",color=\"#000088\"];\n";
-}
-
-# Print libraries first
-foreach my $lib (@libs) {
- gen_one_entry($lib);
-}
-
-if (!$FLAT) {
- print DOT "}\n";
- close DOT;
- open DOT, "| $DotPath -Tgif > objdeps.gif";
- print DOT "digraph ObjDeps {\n";
- print DOT " size=\"8,10\";\n";
- print DOT " margin=\"0.25\";\n";
- print DOT " rankdir=\"LR\";\n";
- print DOT " mclimit=\"50.0\";\n";
- print DOT " ordering=\"out\";\n";
- print DOT " center=\"1\";\n";
- print DOT "node [shape=\"box\",\n";
- print DOT " color=\"#000088\",\n";
- print DOT " fillcolor=\"#FFFACD\",\n";
- print DOT " fontcolor=\"#3355BB\",\n";
- print DOT " fontname=\"sans\",\n";
- print DOT " style=\"filled\",\n";
- print DOT " fontsize=\"24\"\n";
- print DOT "];\n";
- print DOT "edge [dir=\"forward\",style=\"solid\",color=\"#000088\"];\n";
-}
-
-# Print objects second
-foreach my $obj (@objs) {
- gen_one_entry($obj);
-}
-
-if (!$FLAT) {
- print DOT "}\n";
- close DOT;
-
-# Print end tag of definition list element
- print "</dl>\n";
-}
diff --git a/release_23/utils/Makefile b/release_23/utils/Makefile
deleted file mode 100644
index 0cfaf1846d9a..000000000000
--- a/release_23/utils/Makefile
+++ /dev/null
@@ -1,21 +0,0 @@
-##===- utils/Makefile --------------------------------------*- Makefile -*-===##
-#
-# The LLVM Compiler Infrastructure
-#
-# This file is distributed under the University of Illinois Open Source
-# License. See LICENSE.TXT for details.
-#
-##===----------------------------------------------------------------------===##
-
-LEVEL = ..
-PARALLEL_DIRS := TableGen fpcmp PerfectShuffle
-
-EXTRA_DIST := cgiplotNLT.pl check-each-file codegen-diff countloc.sh cvsupdate \
- DSAclean.py DSAextract.py emacs findsym.pl GenLibDeps.pl \
- getsrcs.sh importNLT.pl llvmdo llvmgrep llvm-native-gcc \
- llvm-native-gxx makellvm NightlyTest.gnuplot NightlyTest.pl \
- NightlyTestTemplate.html NLT.schema OldenDataRecover.pl \
- parseNLT.pl plotNLT.pl profile.pl RegressionFinder.pl userloc.pl \
- webNLT.pl vim
-
-include $(LEVEL)/Makefile.common
diff --git a/release_23/utils/NLT.schema b/release_23/utils/NLT.schema
deleted file mode 100644
index 4bcddbc9f7f6..000000000000
--- a/release_23/utils/NLT.schema
+++ /dev/null
@@ -1,8 +0,0 @@
-CREATE TABLE `Tests` (
- `NAME` varchar(255) NOT NULL default '',
- `RUN` date NOT NULL default '0000-00-00',
- `TEST` varchar(32) NOT NULL default '',
- `VALUE` double NOT NULL default '0',
- KEY `name_index` (`NAME`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1
-
diff --git a/release_23/utils/NewNightlyTest.pl b/release_23/utils/NewNightlyTest.pl
deleted file mode 100755
index 0dbacda4a7d6..000000000000
--- a/release_23/utils/NewNightlyTest.pl
+++ /dev/null
@@ -1,1159 +0,0 @@
-#!/usr/bin/perl
-use POSIX qw(strftime);
-use File::Copy;
-use Socket;
-
-#
-# Program: NewNightlyTest.pl
-#
-# Synopsis: Perform a series of tests which are designed to be run nightly.
-# This is used to keep track of the status of the LLVM tree, tracking
-# regressions and performance changes. Submits this information
-# to llvm.org where it is placed into the nightlytestresults database.
-#
-# Modified heavily by Patrick Jenkins, July 2006
-#
-# Syntax: NightlyTest.pl [OPTIONS] [CVSROOT BUILDDIR WEBDIR]
-# where
-# OPTIONS may include one or more of the following:
-# -nocheckout Do not create, checkout, update, or configure
-# the source tree.
-# -noremove Do not remove the BUILDDIR after it has been built.
-# -noremoveresults Do not remove the WEBDIR after it has been built.
-# -nobuild Do not build llvm. If tests are enabled perform them
-# on the llvm build specified in the build directory
-# -notest Do not even attempt to run the test programs. Implies
-# -norunningtests.
-# -norunningtests Do not run the Olden benchmark suite with
-# LARGE_PROBLEM_SIZE enabled.
-# -nodejagnu Do not run feature or regression tests
-# -parallel Run two parallel jobs with GNU Make.
-# -release Build an LLVM Release version
-# -release-asserts Build an LLVM ReleaseAsserts version
-# -enable-llcbeta Enable testing of beta features in llc.
-# -enable-lli Enable testing of lli (interpreter) features, default is off
-# -disable-llc Disable LLC tests in the nightly tester.
-# -disable-jit Disable JIT tests in the nightly tester.
-# -disable-cbe Disable C backend tests in the nightly tester.
-# -disable-lto Disable link time optimization.
-# -verbose Turn on some debug output
-# -debug Print information useful only to maintainers of this script.
-# -nice Checkout/Configure/Build with "nice" to reduce impact
-# on busy servers.
-# -f2c Next argument specifies path to F2C utility
-# -nickname The next argument specifieds the nickname this script
-# will submit to the nightlytest results repository.
-# -gccpath Path to gcc/g++ used to build LLVM
-# -cvstag Check out a specific CVS tag to build LLVM (useful for
-# testing release branches)
-# -usecvs Check code out from the (old) CVS Repository instead of from
-# the standard Subversion repository.
-# -target Specify the target triplet
-# -cflags Next argument specifies that C compilation options that
-# override the default.
-# -cxxflags Next argument specifies that C++ compilation options that
-# override the default.
-# -ldflags Next argument specifies that linker options that override
-# the default.
-# -compileflags Next argument specifies extra options passed to make when
-# building LLVM.
-# -use-gmake Use gmake instead of the default make command to build
-# llvm and run tests.
-#
-# ---------------- Options to configure llvm-test ----------------------------
-# -extraflags Next argument specifies extra options that are passed to
-# compile the tests.
-# -noexternals Do not run the external tests (for cases where povray
-# or SPEC are not installed)
-# -with-externals Specify a directory where the external tests are located.
-# -submit-server Specifies a server to submit the test results too. If this
-# option is not specified it defaults to
-# llvm.org. This is basically just the address of the
-# webserver
-# -submit-script Specifies which script to call on the submit server. If
-# this option is not specified it defaults to
-# /nightlytest/NightlyTestAccept.php. This is basically
-# everything after the www.yourserver.org.
-# -nosubmit Do not report the test results back to a submit server.
-#
-# CVSROOT is the CVS repository from which the tree will be checked out,
-# specified either in the full :method:user@host:/dir syntax, or
-# just /dir if using a local repo.
-# BUILDDIR is the directory where sources for this test run will be checked out
-# AND objects for this test run will be built. This directory MUST NOT
-# exist before the script is run; it will be created by the cvs checkout
-# process and erased (unless -noremove is specified; see above.)
-# WEBDIR is the directory into which the test results web page will be written,
-# AND in which the "index.html" is assumed to be a symlink to the most recent
-# copy of the results. This directory will be created if it does not exist.
-# LLVMGCCDIR is the directory in which the LLVM GCC Front End is installed
-# to. This is the same as you would have for a normal LLVM build.
-#
-##############################################################
-#
-# Getting environment variables
-#
-##############################################################
-my $HOME = $ENV{'HOME'};
-my $SVNURL = $ENV{"SVNURL"};
-$SVNURL = 'https://llvm.org/svn/llvm-project' unless $SVNURL;
-my $CVSRootDir = $ENV{'CVSROOT'};
-$CVSRootDir = "/home/vadve/shared/PublicCVS" unless $CVSRootDir;
-my $BuildDir = $ENV{'BUILDDIR'};
-$BuildDir = "$HOME/buildtest" unless $BuildDir;
-my $WebDir = $ENV{'WEBDIR'};
-$WebDir = "$HOME/cvs/testresults-X86" unless $WebDir;
-
-##############################################################
-#
-# Calculate the date prefix...
-#
-##############################################################
-@TIME = localtime;
-my $DATE = sprintf "%4d-%02d-%02d", $TIME[5]+1900, $TIME[4]+1, $TIME[3];
-my $DateString = strftime "%B %d, %Y", localtime;
-my $TestStartTime = gmtime() . "GMT<br>" . localtime() . " (local)";
-
-##############################################################
-#
-# Parse arguments...
-#
-##############################################################
-$CONFIGUREARGS="";
-$nickname="";
-$NOTEST=0;
-$USESVN=1;
-$NORUNNINGTESTS=0;
-$MAKECMD="make";
-$SUBMITSERVER = "llvm.org";
-$SUBMITSCRIPT = "/nightlytest/NightlyTestAccept.php";
-$SUBMIT = 1;
-
-while (scalar(@ARGV) and ($_ = $ARGV[0], /^[-+]/)) {
- shift;
- last if /^--$/; # Stop processing arguments on --
-
- # List command line options here...
- if (/^-nocheckout$/) { $NOCHECKOUT = 1; next; }
- if (/^-nocvsstats$/) { $NOCVSSTATS = 1; next; }
- if (/^-noremove$/) { $NOREMOVE = 1; next; }
- if (/^-noremoveresults$/){ $NOREMOVERESULTS = 1; next; }
- if (/^-notest$/) { $NOTEST = 1; $NORUNNINGTESTS = 1; next; }
- if (/^-norunningtests$/) { $NORUNNINGTESTS = 1; next; }
- if (/^-parallel$/) { $MAKEOPTS = "$MAKEOPTS -j2 -l3.0"; next; }
- if (/^-release$/) { $MAKEOPTS = "$MAKEOPTS ENABLE_OPTIMIZED=1 ".
- "OPTIMIZE_OPTION=-O2"; $BUILDTYPE="release"; next;}
- if (/^-release-asserts$/){ $MAKEOPTS = "$MAKEOPTS ENABLE_OPTIMIZED=1 ".
- "DISABLE-ASSERTIONS=1 ".
- "OPTIMIZE_OPTION=-O2";
- $BUILDTYPE="release-asserts"; next;}
- if (/^-enable-llcbeta$/) { $PROGTESTOPTS .= " ENABLE_LLCBETA=1"; next; }
- if (/^-enable-lli$/) { $PROGTESTOPTS .= " ENABLE_LLI=1";
- $CONFIGUREARGS .= " --enable-lli"; next; }
- if (/^-disable-llc$/) { $PROGTESTOPTS .= " DISABLE_LLC=1";
- $CONFIGUREARGS .= " --disable-llc_diffs"; next; }
- if (/^-disable-jit$/) { $PROGTESTOPTS .= " DISABLE_JIT=1";
- $CONFIGUREARGS .= " --disable-jit"; next; }
- if (/^-disable-cbe$/) { $PROGTESTOPTS .= " DISABLE_CBE=1"; next; }
- if (/^-disable-lto$/) { $PROGTESTOPTS .= " DISABLE_LTO=1"; next; }
- if (/^-test-opts$/) { $PROGTESTOPTS .= " $ARGV[0]"; shift; next; }
- if (/^-verbose$/) { $VERBOSE = 1; next; }
- if (/^-debug$/) { $DEBUG = 1; next; }
- if (/^-nice$/) { $NICE = "nice "; next; }
- if (/^-f2c$/) { $CONFIGUREARGS .= " --with-f2c=$ARGV[0]";
- shift; next; }
- if (/^-with-externals$/) { $CONFIGUREARGS .= " --with-externals=$ARGV[0]";
- shift; next; }
- if (/^-submit-server/) { $SUBMITSERVER = "$ARGV[0]"; shift; next; }
- if (/^-submit-script/) { $SUBMITSCRIPT = "$ARGV[0]"; shift; next; }
- if (/^-nosubmit$/) { $SUBMIT = 0; next; }
- if (/^-nickname$/) { $nickname = "$ARGV[0]"; shift; next; }
- if (/^-gccpath/) { $CONFIGUREARGS .=
- " CC=$ARGV[0]/gcc CXX=$ARGV[0]/g++";
- $GCCPATH=$ARGV[0]; shift; next; }
- else { $GCCPATH=""; }
- if (/^-cvstag/) { $CVSCOOPT .= " -r $ARGV[0]"; shift; next; }
- else { $CVSCOOPT="";}
- if (/^-usecvs/) { $USESVN = 0; }
- if (/^-target/) { $CONFIGUREARGS .= " --target=$ARGV[0]";
- shift; next; }
- if (/^-cflags/) { $MAKEOPTS = "$MAKEOPTS C.Flags=\'$ARGV[0]\'";
- shift; next; }
- if (/^-cxxflags/) { $MAKEOPTS = "$MAKEOPTS CXX.Flags=\'$ARGV[0]\'";
- shift; next; }
- if (/^-ldflags/) { $MAKEOPTS = "$MAKEOPTS LD.Flags=\'$ARGV[0]\'";
- shift; next; }
- if (/^-compileflags/) { $MAKEOPTS = "$MAKEOPTS $ARGV[0]"; shift; next; }
- if (/^-use-gmake/) { $MAKECMD = "gmake"; shift; next; }
- if (/^-extraflags/) { $CONFIGUREARGS .=
- " --with-extra-options=\'$ARGV[0]\'"; shift; next;}
- if (/^-noexternals$/) { $NOEXTERNALS = 1; next; }
- if (/^-nodejagnu$/) { $NODEJAGNU = 1; next; }
- if (/^-nobuild$/) { $NOBUILD = 1; next; }
- print "Unknown option: $_ : ignoring!\n";
-}
-
-if ($ENV{'LLVMGCCDIR'}) {
- $CONFIGUREARGS .= " --with-llvmgccdir=" . $ENV{'LLVMGCCDIR'};
- $LLVMGCCPATH = $ENV{'LLVMGCCDIR'};
-}
-else {
- $LLVMGCCPATH = "";
-}
-
-if ($CONFIGUREARGS !~ /--disable-jit/) {
- $CONFIGUREARGS .= " --enable-jit";
-}
-
-if (@ARGV != 0 and @ARGV != 3 and $VERBOSE) {
- foreach $x (@ARGV) {
- print "$x\n";
- }
- print "Must specify 0 or 3 options!";
-}
-
-if (@ARGV == 3) {
- $CVSRootDir = $ARGV[0];
- $BuildDir = $ARGV[1];
- $WebDir = $ARGV[2];
-}
-
-if ($CVSRootDir eq "" or
- $BuildDir eq "" or
- $WebDir eq "") {
- die("please specify a cvs root directory, a build directory, and a ".
- "web directory");
- }
-
-if ($nickname eq "") {
- die ("Please invoke NewNightlyTest.pl with command line option " .
- "\"-nickname <nickname>\"");
-}
-
-if ($BUILDTYPE ne "release" && $BUILDTYPE ne "release-asserts") {
- $BUILDTYPE = "debug";
-}
-
-##############################################################
-#
-#define the file names we'll use
-#
-##############################################################
-my $Prefix = "$WebDir/$DATE";
-my $BuildLog = "$Prefix-Build-Log.txt";
-my $COLog = "$Prefix-CVS-Log.txt";
-my $OldenTestsLog = "$Prefix-Olden-tests.txt";
-my $SingleSourceLog = "$Prefix-SingleSource-ProgramTest.txt.gz";
-my $MultiSourceLog = "$Prefix-MultiSource-ProgramTest.txt.gz";
-my $ExternalLog = "$Prefix-External-ProgramTest.txt.gz";
-my $DejagnuLog = "$Prefix-Dejagnu-testrun.log";
-my $DejagnuSum = "$Prefix-Dejagnu-testrun.sum";
-my $DejagnuTestsLog = "$Prefix-DejagnuTests-Log.txt";
-if (! -d $WebDir) {
- mkdir $WebDir, 0777;
- if($VERBOSE){
- warn "$WebDir did not exist; creating it.\n";
- }
-}
-
-if ($VERBOSE) {
- print "INITIALIZED\n";
- if ($USESVN) {
- print "SVN URL = $SVNURL\n";
- } else {
- print "CVS Root = $CVSRootDir\n";
- }
- print "COLog = $COLog\n";
- print "BuildDir = $BuildDir\n";
- print "WebDir = $WebDir\n";
- print "Prefix = $Prefix\n";
- print "BuildLog = $BuildLog\n";
-}
-
-##############################################################
-#
-# Helper functions
-#
-##############################################################
-sub GetDir {
- my $Suffix = shift;
- opendir DH, $WebDir;
- my @Result = reverse sort grep !/$DATE/, grep /[-0-9]+$Suffix/, readdir DH;
- closedir DH;
- return @Result;
-}
-
-#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-#
-# DiffFiles - Diff the current version of the file against the last version of
-# the file, reporting things added and removed. This is used to report, for
-# example, added and removed warnings. This returns a pair (added, removed)
-#
-#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-sub DiffFiles {
- my $Suffix = shift;
- my @Others = GetDir $Suffix;
- if (@Others == 0) { # No other files? We added all entries...
- return (`cat $WebDir/$DATE$Suffix`, "");
- }
-# Diff the files now...
- my @Diffs = split "\n", `diff $WebDir/$DATE$Suffix $WebDir/$Others[0]`;
- my $Added = join "\n", grep /^</, @Diffs;
- my $Removed = join "\n", grep /^>/, @Diffs;
- $Added =~ s/^< //gm;
- $Removed =~ s/^> //gm;
- return ($Added, $Removed);
-}
-
-#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-sub GetRegex { # (Regex with ()'s, value)
- $_[1] =~ /$_[0]/m;
- return $1
- if (defined($1));
- return "0";
-}
-
-#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-sub GetRegexNum {
- my ($Regex, $Num, $Regex2, $File) = @_;
- my @Items = split "\n", `grep '$Regex' $File`;
- return GetRegex $Regex2, $Items[$Num];
-}
-
-#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-sub ChangeDir { # directory, logical name
- my ($dir,$name) = @_;
- chomp($dir);
- if ( $VERBOSE ) { print "Changing To: $name ($dir)\n"; }
- $result = chdir($dir);
- if (!$result) {
- print "ERROR!!! Cannot change directory to: $name ($dir) because $!";
- return false;
- }
- return true;
-}
-
-#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-sub ReadFile {
- if (open (FILE, $_[0])) {
- undef $/;
- my $Ret = <FILE>;
- close FILE;
- $/ = '\n';
- return $Ret;
- } else {
- print "Could not open file '$_[0]' for reading!\n";
- return "";
- }
-}
-
-#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-sub WriteFile { # (filename, contents)
- open (FILE, ">$_[0]") or die "Could not open file '$_[0]' for writing!\n";
- print FILE $_[1];
- close FILE;
-}
-
-#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-sub CopyFile { #filename, newfile
- my ($file, $newfile) = @_;
- chomp($file);
- if ($VERBOSE) { print "Copying $file to $newfile\n"; }
- copy($file, $newfile);
-}
-
-#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-sub AddRecord {
- my ($Val, $Filename,$WebDir) = @_;
- my @Records;
- if (open FILE, "$WebDir/$Filename") {
- @Records = grep !/$DATE/, split "\n", <FILE>;
- close FILE;
- }
- push @Records, "$DATE: $Val";
- WriteFile "$WebDir/$Filename", (join "\n", @Records) . "\n";
-}
-
-#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-#
-# FormatTime - Convert a time from 1m23.45 into 83.45
-#
-#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-sub FormatTime {
- my $Time = shift;
- if ($Time =~ m/([0-9]+)m([0-9.]+)/) {
- $Time = sprintf("%7.4f", $1*60.0+$2);
- }
- return $Time;
-}
-
-#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-#
-# This function is meant to read in the dejagnu sum file and
-# return a string with only the results (i.e. PASS/FAIL/XPASS/
-# XFAIL).
-#
-#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-sub GetDejagnuTestResults { # (filename, log)
- my ($filename, $DejagnuLog) = @_;
- my @lines;
- $/ = "\n"; #Make sure we're going line at a time.
-
- if( $VERBOSE) { print "DEJAGNU TEST RESULTS:\n"; }
-
- if (open SRCHFILE, $filename) {
- # Process test results
- while ( <SRCHFILE> ) {
- if ( length($_) > 1 ) {
- chomp($_);
- if ( m/^(PASS|XPASS|FAIL|XFAIL): .*\/llvm\/test\/(.*)$/ ) {
- push(@lines, "$1: test/$2");
- }
- }
- }
- }
- close SRCHFILE;
-
- my $content = join("\n", @lines);
- return $content;
-}
-
-
-
-#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-#
-# This function acts as a mini web browswer submitting data
-# to our central server via the post method
-#
-#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-sub SendData{
- $host = $_[0];
- $file = $_[1];
- $variables=$_[2];
-
- $port=80;
- $socketaddr= sockaddr_in $port, inet_aton $host or die "Bad hostname\n";
- socket SOCK, PF_INET, SOCK_STREAM, getprotobyname('tcp') or
- die "Bad socket\n";
- connect SOCK, $socketaddr or die "Bad connection\n";
- select((select(SOCK), $| = 1)[0]);
-
- #creating content here
- my $content;
- foreach $key (keys (%$variables)){
- $value = $variables->{$key};
- $value =~ s/([^A-Za-z0-9])/sprintf("%%%02X", ord($1))/seg;
- $content .= "$key=$value&";
- }
-
- $length = length($content);
-
- my $send= "POST $file HTTP/1.0\n";
- $send.= "Host: $host\n";
- $send.= "Content-Type: application/x-www-form-urlencoded\n";
- $send.= "Content-length: $length\n\n";
- $send.= "$content";
-
- print SOCK $send;
- my $result;
- while(<SOCK>){
- $result .= $_;
- }
- close(SOCK);
-
- my $sentdata="";
- foreach $x (keys (%$variables)){
- $value = $variables->{$x};
- $sentdata.= "$x => $value\n";
- }
- WriteFile "$Prefix-sentdata.txt", $sentdata;
-
-
- return $result;
-}
-
-##############################################################
-#
-# Getting Start timestamp
-#
-##############################################################
-$starttime = `date "+20%y-%m-%d %H:%M:%S"`;
-
-##############################################################
-#
-# Create the CVS repository directory
-#
-##############################################################
-if (!$NOCHECKOUT) {
- if (-d $BuildDir) {
- if (!$NOREMOVE) {
- if ( $VERBOSE ) {
- print "Build directory exists! Removing it\n";
- }
- system "rm -rf $BuildDir";
- mkdir $BuildDir or die "Could not create checkout directory $BuildDir!";
- } else {
- if ( $VERBOSE ) {
- print "Build directory exists!\n";
- }
- }
- } else {
- mkdir $BuildDir or die "Could not create checkout directory $BuildDir!";
- }
-}
-ChangeDir( $BuildDir, "checkout directory" );
-
-
-##############################################################
-#
-# Check out the llvm tree, using either SVN or CVS
-#
-##############################################################
-if (!$NOCHECKOUT) {
- if ( $VERBOSE ) { print "CHECKOUT STAGE:\n"; }
- if ($USESVN) {
- my $SVNCMD = "$NICE svn co $SVNURL";
- if ($VERBOSE) {
- print "( time -p $SVNCMD/llvm/trunk llvm; cd llvm/projects ; " .
- "$SVNCMD/test-suite/trunk llvm-test ) > $COLog 2>&1\n";
- }
- system "( time -p $SVNCMD/llvm/trunk llvm; cd llvm/projects ; " .
- "$SVNCMD/test-suite/trunk llvm-test ) > $COLog 2>&1\n";
- } else {
- my $CVSOPT = "";
- $CVSOPT = "-z3" # Use compression if going over ssh.
- if $CVSRootDir =~ /^:ext:/;
- my $CVSCMD = "$NICE cvs $CVSOPT -d $CVSRootDir co -P $CVSCOOPT";
- if ($VERBOSE) {
- print "( time -p $CVSCMD llvm; cd llvm/projects ; " .
- "$CVSCMD llvm-test ) > $COLog 2>&1\n";
- }
- system "( time -p $CVSCMD llvm; cd llvm/projects ; " .
- "$CVSCMD llvm-test ) > $COLog 2>&1\n";
- }
-}
-ChangeDir( $BuildDir , "Checkout directory") ;
-ChangeDir( "llvm" , "llvm source directory") ;
-
-##############################################################
-#
-# Get some static statistics about the current state of CVS
-#
-# This can probably be put on the server side
-#
-##############################################################
-my $CheckoutTime_Wall = GetRegex "([0-9.]+)", `grep '^real' $COLog`;
-my $CheckoutTime_User = GetRegex "([0-9.]+)", `grep '^user' $COLog`;
-my $CheckoutTime_Sys = GetRegex "([0-9.]+)", `grep '^sys' $COLog`;
-my $CheckoutTime_CPU = $CVSCheckoutTime_User + $CVSCheckoutTime_Sys;
-
-my $NumFilesInCVS = 0;
-my $NumDirsInCVS = 0;
-if ($USESVN) {
- $NumFilesInCVS = `egrep '^A' $COLog | wc -l` + 0;
- $NumDirsInCVS = `sed -e 's#/[^/]*$##' $COLog | sort | uniq | wc -l` + 0;
-} else {
- $NumFilesInCVS = `egrep '^U' $COLog | wc -l` + 0;
- $NumDirsInCVS = `egrep '^cvs (checkout|server|update):' $COLog | wc -l` + 0;
-}
-
-##############################################################
-#
-# Extract some information from the CVS history... use a hash so no duplicate
-# stuff is stored. This gets the history from the previous days worth
-# of cvs activity and parses it.
-#
-##############################################################
-
-# This just computes a reasonably accurate #of seconds since 2000. It doesn't
-# have to be perfect as its only used for comparing date ranges within a couple
-# of days.
-sub ConvertToSeconds {
- my ($sec, $min, $hour, $day, $mon, $yr) = @_;
- my $Result = ($yr - 2000) * 12;
- $Result += $mon;
- $Result *= 31;
- $Result += $day;
- $Result *= 24;
- $Result += $hour;
- $Result *= 60;
- $Result += $min;
- $Result *= 60;
- $Result += $sec;
- return $Result;
-}
-
-my (%AddedFiles, %ModifiedFiles, %RemovedFiles, %UsersCommitted, %UsersUpdated);
-
-if (!$NOCVSSTATS) {
- if ($VERBOSE) { print "CHANGE HISTORY ANALYSIS STAGE\n"; }
-
- if ($USESVN) {
- @SVNHistory = split /<logentry/, `svn log --xml --verbose -r{$DATE}:HEAD`;
- # Skip very first entry because it is the XML header cruft
- shift @SVNHistory;
- my $Now = time();
- foreach $Record (@SVNHistory) {
- my @Lines = split "\n", $Record;
- my ($Author, $Date, $Revision);
- # Get the date and see if its one we want to process.
- my ($Year, $Month, $Day, $Hour, $Min, $Sec);
- if ($Lines[3] =~ /<date>(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})/){
- $Year = $1; $Month = $2; $Day = $3; $Hour = $4; $Min = $5; $Sec = $6;
- }
- my $Then = ConvertToSeconds($Sec, $Min, $Hour, $Day, $Month, $Year);
- # Get the current date and compute when "yesterday" is.
- my ($NSec, $NMin, $NHour, $NDay, $NMon, $NYear) = gmtime();
- my $Now = ConvertToSeconds( $NSec, $NMin, $NHour, $NDay, $NMon, $NYear);
- if (($Now - 24*60*60) > $Then) {
- next;
- }
- if ($Lines[1] =~ / revision="([0-9]*)">/) {
- $Revision = $1;
- }
- if ($Lines[2] =~ /<author>([^<]*)<\/author>/) {
- $Author = $1;
- }
- $UsersCommitted{$Author} = 1;
- $Date = $Year . "-" . $Month . "-" . $Day;
- $Time = $Hour . ":" . $Min . ":" . $Sec;
- print "Rev: $Revision, Author: $Author, Date: $Date, Time: $Time\n";
- for ($i = 6; $i < $#Lines; $i += 2 ) {
- if ($Lines[$i] =~ /^ action="(.)">([^<]*)</) {
- if ($1 == "A") {
- $AddedFiles{$2} = 1;
- } elsif ($1 == 'D') {
- $RemovedFiles{$2} = 1;
- } elsif ($1 == 'M' || $1 == 'R' || $1 == 'C') {
- $ModifiedFiles{$2} = 1;
- } else {
- print "UNMATCHABLE: $Lines[$i]\n";
- }
- }
- }
- }
- } else {
- @CVSHistory = split "\n", `cvs history -D '1 day ago' -a -xAMROCGUW`;
-#print join "\n", @CVSHistory; print "\n";
-
- my $DateRE = '[-/:0-9 ]+\+[0-9]+';
-
-# Loop over every record from the CVS history, filling in the hashes.
- foreach $File (@CVSHistory) {
- my ($Type, $Date, $UID, $Rev, $Filename);
- if ($File =~ /([AMRUGC]) ($DateRE) ([^ ]+) +([^ ]+) +([^ ]+) +([^ ]+)/) {
- ($Type, $Date, $UID, $Rev, $Filename) = ($1, $2, $3, $4, "$6/$5");
- } elsif ($File =~ /([W]) ($DateRE) ([^ ]+)/) {
- ($Type, $Date, $UID, $Rev, $Filename) = ($1, $2, $3, "", "");
- } elsif ($File =~ /([O]) ($DateRE) ([^ ]+) +([^ ]+)/) {
- ($Type, $Date, $UID, $Rev, $Filename) = ($1, $2, $3, "", "$4/");
- } else {
- print "UNMATCHABLE: $File\n";
- next;
- }
- # print "$File\nTy = $Type Date = '$Date' UID=$UID Rev=$Rev File = '$Filename'\n";
-
- if ($Filename =~ /^llvm/) {
- if ($Type eq 'M') { # Modified
- $ModifiedFiles{$Filename} = 1;
- $UsersCommitted{$UID} = 1;
- } elsif ($Type eq 'A') { # Added
- $AddedFiles{$Filename} = 1;
- $UsersCommitted{$UID} = 1;
- } elsif ($Type eq 'R') { # Removed
- $RemovedFiles{$Filename} = 1;
- $UsersCommitted{$UID} = 1;
- } else {
- $UsersUpdated{$UID} = 1;
- }
- }
- }
-
- my $TestError = 1;
- } #$USESVN
-}#!NOCVSSTATS
-
-my $CVSAddedFiles = join "\n", sort keys %AddedFiles;
-my $CVSModifiedFiles = join "\n", sort keys %ModifiedFiles;
-my $CVSRemovedFiles = join "\n", sort keys %RemovedFiles;
-my $UserCommitList = join "\n", sort keys %UsersCommitted;
-my $UserUpdateList = join "\n", sort keys %UsersUpdated;
-
-##############################################################
-#
-# Build the entire tree, saving build messages to the build log
-#
-##############################################################
-if (!$NOCHECKOUT && !$NOBUILD) {
- my $EXTRAFLAGS = "--enable-spec --with-objroot=.";
- if ( $VERBOSE ) {
- print "CONFIGURE STAGE:\n";
- print "(time -p $NICE ./configure $CONFIGUREARGS $EXTRAFLAGS) " .
- "> $BuildLog 2>&1\n";
- }
- system "(time -p $NICE ./configure $CONFIGUREARGS $EXTRAFLAGS) " .
- "> $BuildLog 2>&1";
- if ( $VERBOSE ) {
- print "BUILD STAGE:\n";
- print "(time -p $NICE $MAKECMD $MAKEOPTS) >> $BuildLog 2>&1\n";
- }
- # Build the entire tree, capturing the output into $BuildLog
- system "(time -p $NICE $MAKECMD $MAKEOPTS) >> $BuildLog 2>&1";
-}
-
-##############################################################
-#
-# Get some statistics about the build...
-#
-##############################################################
-#this can de done on server
-#my @Linked = split '\n', `grep Linking $BuildLog`;
-#my $NumExecutables = scalar(grep(/executable/, @Linked));
-#my $NumLibraries = scalar(grep(!/executable/, @Linked));
-#my $NumObjects = `grep ']\: Compiling ' $BuildLog | wc -l` + 0;
-
-# Get the number of lines of source code. Must be here after the build is done
-# because countloc.sh uses the llvm-config script which must be built.
-my $LOC = `utils/countloc.sh -topdir $BuildDir/llvm`;
-
-# Get the time taken by the configure script
-my $ConfigTimeU = GetRegexNum "^user", 0, "([0-9.]+)", "$BuildLog";
-my $ConfigTimeS = GetRegexNum "^sys", 0, "([0-9.]+)", "$BuildLog";
-my $ConfigTime = $ConfigTimeU+$ConfigTimeS; # ConfigTime = User+System
-my $ConfigWallTime = GetRegexNum "^real", 0,"([0-9.]+)","$BuildLog";
-
-$ConfigTime=-1 unless $ConfigTime;
-$ConfigWallTime=-1 unless $ConfigWallTime;
-
-my $BuildTimeU = GetRegexNum "^user", 1, "([0-9.]+)", "$BuildLog";
-my $BuildTimeS = GetRegexNum "^sys", 1, "([0-9.]+)", "$BuildLog";
-my $BuildTime = $BuildTimeU+$BuildTimeS; # BuildTime = User+System
-my $BuildWallTime = GetRegexNum "^real", 1, "([0-9.]+)","$BuildLog";
-
-$BuildTime=-1 unless $BuildTime;
-$BuildWallTime=-1 unless $BuildWallTime;
-
-my $BuildError = 0, $BuildStatus = "OK";
-if ($NOBUILD) {
- $BuildStatus = "Skipped by user";
-}
-elsif (`grep '^$MAKECMD\[^:]*: .*Error' $BuildLog | wc -l` + 0 ||
- `grep '^$MAKECMD: \*\*\*.*Stop.' $BuildLog | wc -l`+0) {
- $BuildStatus = "Error: compilation aborted";
- $BuildError = 1;
- if( $VERBOSE) { print "\n***ERROR BUILDING TREE\n\n"; }
-}
-if ($BuildError) { $NODEJAGNU=1; }
-
-my $a_file_sizes="";
-my $o_file_sizes="";
-if (!$BuildError) {
- print "Organizing size of .o and .a files\n"
- if ( $VERBOSE );
- ChangeDir( "$BuildDir/llvm", "Build Directory" );
- $afiles.= `find utils/ -iname '*.a' -ls`;
- $afiles.= `find lib/ -iname '*.a' -ls`;
- $afiles.= `find tools/ -iname '*.a' -ls`;
- if($BUILDTYPE eq "release"){
- $afiles.= `find Release/ -iname '*.a' -ls`;
- } elsif($BUILDTYPE eq "release-asserts") {
- $afiles.= `find Release-Asserts/ -iname '*.a' -ls`;
- } else {
- $afiles.= `find Debug/ -iname '*.a' -ls`;
- }
-
- $ofiles.= `find utils/ -iname '*.o' -ls`;
- $ofiles.= `find lib/ -iname '*.o' -ls`;
- $ofiles.= `find tools/ -iname '*.o' -ls`;
- if($BUILDTYPE eq "release"){
- $ofiles.= `find Release/ -iname '*.o' -ls`;
- } elsif($BUILDTYPE eq "release-asserts") {
- $ofiles.= `find Release-Asserts/ -iname '*.o' -ls`;
- } else {
- $ofiles.= `find Debug/ -iname '*.o' -ls`;
- }
-
- @AFILES = split "\n", $afiles;
- $a_file_sizes="";
- foreach $x (@AFILES){
- $x =~ m/.+\s+.+\s+.+\s+.+\s+.+\s+.+\s+(.+)\s+.+\s+.+\s+.+\s+(.+)/;
- $a_file_sizes.="$1 $2 $BUILDTYPE\n";
- }
- @OFILES = split "\n", $ofiles;
- $o_file_sizes="";
- foreach $x (@OFILES){
- $x =~ m/.+\s+.+\s+.+\s+.+\s+.+\s+.+\s+(.+)\s+.+\s+.+\s+.+\s+(.+)/;
- $o_file_sizes.="$1 $2 $BUILDTYPE\n";
- }
-} else {
- $a_file_sizes="No data due to a bad build.";
- $o_file_sizes="No data due to a bad build.";
-}
-
-##############################################################
-#
-# Running dejagnu tests
-#
-##############################################################
-my $DejangnuTestResults=""; # String containing the results of the dejagnu
-my $dejagnu_output = "$DejagnuTestsLog";
-if (!$NODEJAGNU) {
- if($VERBOSE) {
- print "DEJAGNU FEATURE/REGRESSION TEST STAGE:\n";
- print "(time -p $MAKECMD $MAKEOPTS check) > $dejagnu_output 2>&1\n";
- }
-
- #Run the feature and regression tests, results are put into testrun.sum
- #Full log in testrun.log
- system "(time -p $MAKECMD $MAKEOPTS check) > $dejagnu_output 2>&1";
-
- #Copy the testrun.log and testrun.sum to our webdir
- CopyFile("test/testrun.log", $DejagnuLog);
- CopyFile("test/testrun.sum", $DejagnuSum);
- #can be done on server
- $DejagnuTestResults = GetDejagnuTestResults($DejagnuSum, $DejagnuLog);
- $unexpfail_tests = $DejagnuTestResults;
-}
-
-#Extract time of dejagnu tests
-my $DejagnuTimeU = GetRegexNum "^user", 0, "([0-9.]+)", "$dejagnu_output";
-my $DejagnuTimeS = GetRegexNum "^sys", 0, "([0-9.]+)", "$dejagnu_output";
-$DejagnuTime = $DejagnuTimeU+$DejagnuTimeS; # DejagnuTime = User+System
-$DejagnuWallTime = GetRegexNum "^real", 0,"([0-9.]+)","$dejagnu_output";
-$DejagnuTestResults =
- "Dejagnu skipped by user choice." unless $DejagnuTestResults;
-$DejagnuTime = "0.0" unless $DejagnuTime;
-$DejagnuWallTime = "0.0" unless $DejagnuWallTime;
-
-##############################################################
-#
-# Get warnings from the build
-#
-##############################################################
-if (!$NODEJAGNU) {
- if ( $VERBOSE ) { print "BUILD INFORMATION COLLECTION STAGE\n"; }
- my @Warn = split "\n", `egrep 'warning:|Entering dir' $BuildLog`;
- my @Warnings;
- my $CurDir = "";
-
- foreach $Warning (@Warn) {
- if ($Warning =~ m/Entering directory \`([^\`]+)\'/) {
- $CurDir = $1; # Keep track of directory warning is in...
- # Remove buildir prefix if included
- if ($CurDir =~ m#$BuildDir/llvm/(.*)#) { $CurDir = $1; }
- } else {
- push @Warnings, "$CurDir/$Warning"; # Add directory to warning...
- }
- }
- my $WarningsFile = join "\n", @Warnings;
- $WarningsFile =~ s/:[0-9]+:/::/g;
-
- # Emit the warnings file, so we can diff...
- WriteFile "$WebDir/$DATE-Warnings.txt", $WarningsFile . "\n";
- my ($WarningsAdded, $WarningsRemoved) = DiffFiles "-Warnings.txt";
-
- # Output something to stdout if something has changed
- #print "ADDED WARNINGS:\n$WarningsAdded\n\n" if (length $WarningsAdded);
- #print "REMOVED WARNINGS:\n$WarningsRemoved\n\n" if (length $WarningsRemoved);
-
- #my @TmpWarningsAdded = split "\n", $WarningsAdded; ~PJ on upgrade
- #my @TmpWarningsRemoved = split "\n", $WarningsRemoved; ~PJ on upgrade
-
-} #endif !NODEGAGNU
-
-##############################################################
-#
-# If we built the tree successfully, run the nightly programs tests...
-#
-# A set of tests to run is passed in (i.e. "SingleSource" "MultiSource"
-# "External")
-#
-##############################################################
-sub TestDirectory {
- my $SubDir = shift;
- ChangeDir( "$BuildDir/llvm/projects/llvm-test/$SubDir",
- "Programs Test Subdirectory" ) || return ("", "");
-
- my $ProgramTestLog = "$Prefix-$SubDir-ProgramTest.txt";
-
- # Run the programs tests... creating a report.nightly.csv file
- if (!$NOTEST) {
- if( $VERBOSE) {
- print "$MAKECMD -k $MAKEOPTS $PROGTESTOPTS report.nightly.csv ".
- "TEST=nightly > $ProgramTestLog 2>&1\n";
- }
- system "$MAKECMD -k $MAKEOPTS $PROGTESTOPTS report.nightly.csv ".
- "TEST=nightly > $ProgramTestLog 2>&1";
- $llcbeta_options=`$MAKECMD print-llcbeta-option`;
- }
-
- my $ProgramsTable;
- if (`grep '^$MAKECMD\[^:]: .*Error' $ProgramTestLog | wc -l` + 0) {
- $TestError = 1;
- $ProgramsTable="Error running test $SubDir\n";
- print "ERROR TESTING\n";
- } elsif (`grep '^$MAKECMD\[^:]: .*No rule to make target' $ProgramTestLog | wc -l` + 0) {
- $TestError = 1;
- $ProgramsTable="Makefile error running tests $SubDir!\n";
- print "ERROR TESTING\n";
- } else {
- $TestError = 0;
- #
- # Create a list of the tests which were run...
- #
- system "egrep 'TEST-(PASS|FAIL)' < $ProgramTestLog ".
- "| sort > $Prefix-$SubDir-Tests.txt";
- }
- $ProgramsTable = ReadFile "report.nightly.csv";
-
- ChangeDir( "../../..", "Programs Test Parent Directory" );
- return ($ProgramsTable, $llcbeta_options);
-} #end sub TestDirectory
-
-##############################################################
-#
-# Calling sub TestDirectory
-#
-##############################################################
-if (!$BuildError) {
- if ( $VERBOSE ) {
- print "SingleSource TEST STAGE\n";
- }
- ($SingleSourceProgramsTable, $llcbeta_options) =
- TestDirectory("SingleSource");
- WriteFile "$Prefix-SingleSource-Performance.txt", $SingleSourceProgramsTable;
- if ( $VERBOSE ) {
- print "MultiSource TEST STAGE\n";
- }
- ($MultiSourceProgramsTable, $llcbeta_options) = TestDirectory("MultiSource");
- WriteFile "$Prefix-MultiSource-Performance.txt", $MultiSourceProgramsTable;
- if ( ! $NOEXTERNALS ) {
- if ( $VERBOSE ) {
- print "External TEST STAGE\n";
- }
- ($ExternalProgramsTable, $llcbeta_options) = TestDirectory("External");
- WriteFile "$Prefix-External-Performance.txt", $ExternalProgramsTable;
- system "cat $Prefix-SingleSource-Tests.txt " .
- "$Prefix-MultiSource-Tests.txt ".
- "$Prefix-External-Tests.txt | sort > $Prefix-Tests.txt";
- system "cat $Prefix-SingleSource-Performance.txt " .
- "$Prefix-MultiSource-Performance.txt ".
- "$Prefix-External-Performance.txt | sort > $Prefix-Performance.txt";
- } else {
- $ExternalProgramsTable = "External TEST STAGE SKIPPED\n";
- if ( $VERBOSE ) {
- print "External TEST STAGE SKIPPED\n";
- }
- system "cat $Prefix-SingleSource-Tests.txt " .
- "$Prefix-MultiSource-Tests.txt ".
- " | sort > $Prefix-Tests.txt";
- system "cat $Prefix-SingleSource-Performance.txt " .
- "$Prefix-MultiSource-Performance.txt ".
- " | sort > $Prefix-Performance.txt";
- }
-
- ##############################################################
- #
- #
- # gathering tests added removed broken information here
- #
- #
- ##############################################################
- my $dejagnu_test_list = ReadFile "$Prefix-Tests.txt";
- my @DEJAGNU = split "\n", $dejagnu_test_list;
- my ($passes, $fails, $xfails) = "";
-
- if(!$NODEJAGNU) {
- for ($x=0; $x<@DEJAGNU; $x++) {
- if ($DEJAGNU[$x] =~ m/^PASS:/) {
- $passes.="$DEJAGNU[$x]\n";
- }
- elsif ($DEJAGNU[$x] =~ m/^FAIL:/) {
- $fails.="$DEJAGNU[$x]\n";
- }
- elsif ($DEJAGNU[$x] =~ m/^XFAIL:/) {
- $xfails.="$DEJAGNU[$x]\n";
- }
- }
- }
-
-} #end if !$BuildError
-
-
-##############################################################
-#
-# If we built the tree successfully, runs of the Olden suite with
-# LARGE_PROBLEM_SIZE on so that we can get some "running" statistics.
-#
-##############################################################
-if (!$BuildError) {
- if ( $VERBOSE ) { print "OLDEN TEST SUITE STAGE\n"; }
- my ($NATTime, $CBETime, $LLCTime, $JITTime, $OptTime, $BytecodeSize,
- $MachCodeSize) = ("","","","","","","");
- if (!$NORUNNINGTESTS) {
- ChangeDir( "$BuildDir/llvm/projects/llvm-test/MultiSource/Benchmarks/Olden",
- "Olden Test Directory");
-
- # Clean out previous results...
- system "$NICE $MAKECMD $MAKEOPTS clean > /dev/null 2>&1";
-
- # Run the nightly test in this directory, with LARGE_PROBLEM_SIZE and
- # GET_STABLE_NUMBERS enabled!
- if( $VERBOSE ) {
- print "$MAKECMD -k $MAKEOPTS $PROGTESTOPTS report.nightly.csv.out " .
- "TEST=nightly LARGE_PROBLEM_SIZE=1 GET_STABLE_NUMBERS=1 " .
- "> /dev/null 2>&1\n";
- }
- system "$MAKECMD -k $MAKEOPTS $PROGTESTOPTS report.nightly.csv.out " .
- "TEST=nightly LARGE_PROBLEM_SIZE=1 GET_STABLE_NUMBERS=1 " .
- "> /dev/null 2>&1";
- system "cp report.nightly.csv $OldenTestsLog";
- }
-}
-
-##############################################################
-#
-# Getting end timestamp
-#
-##############################################################
-$endtime = `date "+20%y-%m-%d %H:%M:%S"`;
-
-
-##############################################################
-#
-# Place all the logs neatly into one humungous file
-#
-##############################################################
-if ( $VERBOSE ) { print "PREPARING LOGS TO BE SENT TO SERVER\n"; }
-
-$machine_data = "uname: ".`uname -a`.
- "hardware: ".`uname -m`.
- "os: ".`uname -sr`.
- "name: ".`uname -n`.
- "date: ".`date \"+20%y-%m-%d\"`.
- "time: ".`date +\"%H:%M:%S\"`;
-
-my @CVS_DATA;
-my $cvs_data;
-@CVS_DATA = ReadFile "$COLog";
-$cvs_data = join("\n", @CVS_DATA);
-
-my @BUILD_DATA;
-my $build_data;
-@BUILD_DATA = ReadFile "$BuildLog";
-$build_data = join("\n", @BUILD_DATA);
-
-my (@DEJAGNU_LOG, @DEJAGNU_SUM, @DEJAGNULOG_FULL, @GCC_VERSION);
-my ($dejagnutests_log ,$dejagnutests_sum, $dejagnulog_full) = "";
-my ($gcc_version, $gcc_version_long) = "";
-
-$gcc_version_long="";
-if ($GCCPATH ne "") {
- $gcc_version_long = `$GCCPATH/gcc --version`;
-} elsif ($ENV{"CC"}) {
- $gcc_version_long = `$ENV{"CC"} --version`;
-} else {
- $gcc_version_long = `gcc --version`;
-}
-@GCC_VERSION = split '\n', $gcc_version_long;
-$gcc_version = $GCC_VERSION[0];
-
-$llvmgcc_version_long="";
-if ($LLVMGCCPATH ne "") {
- $llvmgcc_version_long = `$LLVMGCCPATH/llvm-gcc -v 2>&1`;
-} else {
- $llvmgcc_version_long = `llvm-gcc -v 2>&1`;
-}
-@LLVMGCC_VERSION = split '\n', $llvmgcc_version_long;
-$llvmgcc_versionTarget = $LLVMGCC_VERSION[1];
-$llvmgcc_versionTarget =~ /Target: (.+)/;
-$targetTriple = $1;
-
-if(!$BuildError){
- @DEJAGNU_LOG = ReadFile "$DejagnuLog";
- @DEJAGNU_SUM = ReadFile "$DejagnuSum";
- $dejagnutests_log = join("\n", @DEJAGNU_LOG);
- $dejagnutests_sum = join("\n", @DEJAGNU_SUM);
-
- @DEJAGNULOG_FULL = ReadFile "$DejagnuTestsLog";
- $dejagnulog_full = join("\n", @DEJAGNULOG_FULL);
-}
-
-##############################################################
-#
-# Send data via a post request
-#
-##############################################################
-
-if ( $VERBOSE ) { print "SEND THE DATA VIA THE POST REQUEST\n"; }
-
-my %hash_of_data = (
- 'machine_data' => $machine_data,
- 'build_data' => $build_data,
- 'gcc_version' => $gcc_version,
- 'nickname' => $nickname,
- 'dejagnutime_wall' => $DejagnuWallTime,
- 'dejagnutime_cpu' => $DejagnuTime,
- 'cvscheckouttime_wall' => $CheckoutTime_Wall,
- 'cvscheckouttime_cpu' => $CheckoutTime_CPU,
- 'configtime_wall' => $ConfigWallTime,
- 'configtime_cpu'=> $ConfigTime,
- 'buildtime_wall' => $BuildWallTime,
- 'buildtime_cpu' => $BuildTime,
- 'warnings' => $WarningsFile,
- 'cvsusercommitlist' => $UserCommitList,
- 'cvsuserupdatelist' => $UserUpdateList,
- 'cvsaddedfiles' => $CVSAddedFiles,
- 'cvsmodifiedfiles' => $CVSModifiedFiles,
- 'cvsremovedfiles' => $CVSRemovedFiles,
- 'lines_of_code' => $LOC,
- 'cvs_file_count' => $NumFilesInCVS,
- 'cvs_dir_count' => $NumDirsInCVS,
- 'buildstatus' => $BuildStatus,
- 'singlesource_programstable' => $SingleSourceProgramsTable,
- 'multisource_programstable' => $MultiSourceProgramsTable,
- 'externalsource_programstable' => $ExternalProgramsTable,
- 'llcbeta_options' => $multisource_llcbeta_options,
- 'warnings_removed' => $WarningsRemoved,
- 'warnings_added' => $WarningsAdded,
- 'passing_tests' => $passes,
- 'expfail_tests' => $xfails,
- 'unexpfail_tests' => $fails,
- 'all_tests' => $dejagnu_test_list,
- 'new_tests' => "",
- 'removed_tests' => "",
- 'dejagnutests_results' => $DejagnuTestResults,
- 'dejagnutests_log' => $dejagnulog_full,
- 'starttime' => $starttime,
- 'endtime' => $endtime,
- 'o_file_sizes' => $o_file_sizes,
- 'a_file_sizes' => $a_file_sizes,
- 'target_triple' => $targetTriple
-);
-
-if ($SUBMIT) {
- my $response = SendData $SUBMITSERVER,$SUBMITSCRIPT,\%hash_of_data;
- if( $VERBOSE) { print "============================\n$response"; }
-} else {
- print "============================\n";
- foreach $x(keys %hash_of_data){
- print "$x => $hash_of_data{$x}\n";
- }
-}
-
-##############################################################
-#
-# Remove the cvs tree...
-#
-##############################################################
-system ( "$NICE rm -rf $BuildDir")
- if (!$NOCHECKOUT and !$NOREMOVE);
-system ( "$NICE rm -rf $WebDir")
- if (!$NOCHECKOUT and !$NOREMOVE and !$NOREMOVERESULTS);
diff --git a/release_23/utils/NightlyTest.gnuplot b/release_23/utils/NightlyTest.gnuplot
deleted file mode 100644
index 514b72ab20ad..000000000000
--- a/release_23/utils/NightlyTest.gnuplot
+++ /dev/null
@@ -1,214 +0,0 @@
-set terminal png
-
-##------- Plot small Date vs LOC ----
-set output "running_loc.png"
-set xlabel "Date"
-set ylabel "Lines of Code"
-set xdata time
-set timefmt "%Y-%m-%d-%H:%M:%S:"
-set format x "%b %d, %Y"
-
-set size .75,.75
-set xtics rotate
-set xlabel 0,-1
-plot "running_loc.txt" using 1:2 title '' with lines, \
- "running_loc.txt" using 1:2 title "Date vs. Lines of Code" with lines
-
-##------- Plot large Date vs LOC ----
-set size 1.5,1.5
-set xtics norotate
-set xlabel 0,0
-set output "running_loc_large.png"
-plot "running_loc.txt" using 1:2 title '', \
- "running_loc.txt" using 1:2 title "Date vs. Lines of Code" with lines
-
-
-# Delete all labels...
-set nolabel
-
-##------- Olden CBE performance ----
-
-set size .75,.75
-set xtics rotate
-set xlabel 0,-1
-set output "running_Olden_cbe_time.png"
-set ylabel "CBE compiled execution time (s)"
-plot "running_Olden_cbe_time.txt" u 1:2 t '' with lines, \
- "running_Olden_cbe_time.txt" u 1:2 t "bh" with lines, \
- "running_Olden_cbe_time.txt" u 1:3 t "em3d" with lines, \
- "running_Olden_cbe_time.txt" u 1:4 t "mst" with lines, \
- "running_Olden_cbe_time.txt" u 1:5 t "power" with lines, \
- "running_Olden_cbe_time.txt" u 1:6 t "tsp" with lines, \
- "running_Olden_cbe_time.txt" u 1:7 t "bisort" with lines, \
- "running_Olden_cbe_time.txt" u 1:8 t "health" with lines, \
- "running_Olden_cbe_time.txt" u 1:9 t "perimeter" with lines, \
- "running_Olden_cbe_time.txt" u 1:10 t "treeadd" with lines, \
- "running_Olden_cbe_time.txt" u 1:11 t "voronoi" \
- with lines
-
-set size 1.5,1.5
-set xtics norotate
-set xlabel 0,0
-set output "running_Olden_cbe_time_large.png"
-plot "running_Olden_cbe_time.txt" u 1:2 t '' with lines, \
- "running_Olden_cbe_time.txt" u 1:2 t "bh" with lines, \
- "running_Olden_cbe_time.txt" u 1:3 t "em3d" with lines, \
- "running_Olden_cbe_time.txt" u 1:4 t "mst" with lines, \
- "running_Olden_cbe_time.txt" u 1:5 t "power" with lines, \
- "running_Olden_cbe_time.txt" u 1:6 t "tsp" with lines, \
- "running_Olden_cbe_time.txt" u 1:7 t "bisort" with lines, \
- "running_Olden_cbe_time.txt" u 1:8 t "health" with lines, \
- "running_Olden_cbe_time.txt" u 1:9 t "perimeter" with lines, \
- "running_Olden_cbe_time.txt" u 1:10 t "treeadd" with lines, \
- "running_Olden_cbe_time.txt" u 1:11 t "voronoi" \
- with lines
-
-##------- Olden JIT performance ----
-
-set size .75,.75
-set xtics rotate
-set xlabel 0,-1
-set output "running_Olden_jit_time.png"
-set ylabel "JIT execution time (s)"
-plot "running_Olden_jit_time.txt" u 1:2 t '' with lines, \
- "running_Olden_jit_time.txt" u 1:2 t "bh" with lines, \
- "running_Olden_jit_time.txt" u 1:3 t "em3d" with lines, \
- "running_Olden_jit_time.txt" u 1:4 t "mst" with lines, \
- "running_Olden_jit_time.txt" u 1:5 t "power" with lines, \
- "running_Olden_jit_time.txt" u 1:6 t "tsp" with lines, \
- "running_Olden_jit_time.txt" u 1:7 t "bisort" with lines, \
- "running_Olden_jit_time.txt" u 1:8 t "health" with lines, \
- "running_Olden_jit_time.txt" u 1:9 t "perimeter" with lines, \
- "running_Olden_jit_time.txt" u 1:10 t "treeadd" with lines, \
- "running_Olden_jit_time.txt" u 1:11 t "voronoi" \
- with lines
-
-set size 1.5,1.5
-set xtics norotate
-set xlabel 0,0
-set output "running_Olden_jit_time_large.png"
-plot "running_Olden_jit_time.txt" u 1:2 t '' with lines, \
- "running_Olden_jit_time.txt" u 1:2 t "bh" with lines, \
- "running_Olden_jit_time.txt" u 1:3 t "em3d" with lines, \
- "running_Olden_jit_time.txt" u 1:4 t "mst" with lines, \
- "running_Olden_jit_time.txt" u 1:5 t "power" with lines, \
- "running_Olden_jit_time.txt" u 1:6 t "tsp" with lines, \
- "running_Olden_jit_time.txt" u 1:7 t "bisort" with lines, \
- "running_Olden_jit_time.txt" u 1:8 t "health" with lines, \
- "running_Olden_jit_time.txt" u 1:9 t "perimeter" with lines, \
- "running_Olden_jit_time.txt" u 1:10 t "treeadd" with lines, \
- "running_Olden_jit_time.txt" u 1:11 t "voronoi" \
- with lines
-
-##------- Olden LLC performance ----
-
-set size .75,.75
-set xtics rotate
-set xlabel 0,-1
-set output "running_Olden_llc_time.png"
-set ylabel "LLC compiled execution time (s)"
-plot "running_Olden_llc_time.txt" u 1:2 t '' with lines, \
- "running_Olden_llc_time.txt" u 1:2 t "bh" with lines, \
- "running_Olden_llc_time.txt" u 1:3 t "em3d" with lines, \
- "running_Olden_llc_time.txt" u 1:4 t "mst" with lines, \
- "running_Olden_llc_time.txt" u 1:5 t "power" with lines, \
- "running_Olden_llc_time.txt" u 1:6 t "tsp" with lines, \
- "running_Olden_llc_time.txt" u 1:7 t "bisort" with lines, \
- "running_Olden_llc_time.txt" u 1:8 t "health" with lines, \
- "running_Olden_llc_time.txt" u 1:9 t "perimeter" with lines, \
- "running_Olden_llc_time.txt" u 1:10 t "treeadd" with lines, \
- "running_Olden_llc_time.txt" u 1:11 t "voronoi" \
- with lines
-
-set size 1.5,1.5
-set xtics norotate
-set xlabel 0,0
-set output "running_Olden_llc_time_large.png"
-plot "running_Olden_llc_time.txt" u 1:2 t '' with lines, \
- "running_Olden_llc_time.txt" u 1:2 t "bh" with lines, \
- "running_Olden_llc_time.txt" u 1:3 t "em3d" with lines, \
- "running_Olden_llc_time.txt" u 1:4 t "mst" with lines, \
- "running_Olden_llc_time.txt" u 1:5 t "power" with lines, \
- "running_Olden_llc_time.txt" u 1:6 t "tsp" with lines, \
- "running_Olden_llc_time.txt" u 1:7 t "bisort" with lines, \
- "running_Olden_llc_time.txt" u 1:8 t "health" with lines, \
- "running_Olden_llc_time.txt" u 1:9 t "perimeter" with lines, \
- "running_Olden_llc_time.txt" u 1:10 t "treeadd" with lines, \
- "running_Olden_llc_time.txt" u 1:11 t "voronoi" \
- with lines
-
-
-##------- Olden optimizer time ----
-
-set size .75,.75
-set xtics rotate
-set xlabel 0,-1
-set output "running_Olden_opt_time.png"
-set ylabel "Time to run the optimizer (s)"
-plot "running_Olden_opt_time.txt" u 1:2 t '' with lines, \
- "running_Olden_opt_time.txt" u 1:2 t "bh" with lines, \
- "running_Olden_opt_time.txt" u 1:3 t "em3d" with lines, \
- "running_Olden_opt_time.txt" u 1:4 t "mst" with lines, \
- "running_Olden_opt_time.txt" u 1:5 t "power" with lines, \
- "running_Olden_opt_time.txt" u 1:6 t "tsp" with lines, \
- "running_Olden_opt_time.txt" u 1:7 t "bisort" with lines, \
- "running_Olden_opt_time.txt" u 1:8 t "health" with lines, \
- "running_Olden_opt_time.txt" u 1:9 t "perimeter" with lines, \
- "running_Olden_opt_time.txt" u 1:10 t "treeadd" with lines, \
- "running_Olden_opt_time.txt" u 1:11 t "voronoi" \
- with lines
-
-set size 1.5,1.5
-set xtics norotate
-set xlabel 0,0
-set output "running_Olden_opt_time_large.png"
-plot "running_Olden_opt_time.txt" u 1:2 t '' with lines, \
- "running_Olden_opt_time.txt" u 1:2 t "bh" with lines, \
- "running_Olden_opt_time.txt" u 1:3 t "em3d" with lines, \
- "running_Olden_opt_time.txt" u 1:4 t "mst" with lines, \
- "running_Olden_opt_time.txt" u 1:5 t "power" with lines, \
- "running_Olden_opt_time.txt" u 1:6 t "tsp" with lines, \
- "running_Olden_opt_time.txt" u 1:7 t "bisort" with lines, \
- "running_Olden_opt_time.txt" u 1:8 t "health" with lines, \
- "running_Olden_opt_time.txt" u 1:9 t "perimeter" with lines, \
- "running_Olden_opt_time.txt" u 1:10 t "treeadd" with lines, \
- "running_Olden_opt_time.txt" u 1:11 t "voronoi" \
- with lines
-
-
-##------- Bytecode size ----
-
-set size .75,.75
-set xtics rotate
-set xlabel 0,-1
-set output "running_Olden_bytecode.png"
-set ylabel "Program bytecode size (bytes)"
-plot "running_Olden_bytecode.txt" u 1:2 t '' with lines, \
- "running_Olden_bytecode.txt" u 1:2 t "bh" with lines, \
- "running_Olden_bytecode.txt" u 1:3 t "em3d" with lines, \
- "running_Olden_bytecode.txt" u 1:4 t "mst" with lines, \
- "running_Olden_bytecode.txt" u 1:5 t "power" with lines, \
- "running_Olden_bytecode.txt" u 1:6 t "tsp" with lines, \
- "running_Olden_bytecode.txt" u 1:7 t "bisort" with lines, \
- "running_Olden_bytecode.txt" u 1:8 t "health" with lines, \
- "running_Olden_bytecode.txt" u 1:9 t "perimeter" with lines, \
- "running_Olden_bytecode.txt" u 1:10 t "treeadd" with lines, \
- "running_Olden_bytecode.txt" u 1:11 t "voronoi" \
- with lines
-
-set size 1.5,1.5
-set xtics norotate
-set xlabel 0,0
-set output "running_Olden_bytecode_large.png"
-plot "running_Olden_bytecode.txt" u 1:2 t '' with lines, \
- "running_Olden_bytecode.txt" u 1:2 t "bh" with lines, \
- "running_Olden_bytecode.txt" u 1:3 t "em3d" with lines, \
- "running_Olden_bytecode.txt" u 1:4 t "mst" with lines, \
- "running_Olden_bytecode.txt" u 1:5 t "power" with lines, \
- "running_Olden_bytecode.txt" u 1:6 t "tsp" with lines, \
- "running_Olden_bytecode.txt" u 1:7 t "bisort" with lines, \
- "running_Olden_bytecode.txt" u 1:8 t "health" with lines, \
- "running_Olden_bytecode.txt" u 1:9 t "perimeter" with lines, \
- "running_Olden_bytecode.txt" u 1:10 t "treeadd" with lines, \
- "running_Olden_bytecode.txt" u 1:11 t "voronoi" \
- with lines
diff --git a/release_23/utils/NightlyTestTemplate.html b/release_23/utils/NightlyTestTemplate.html
deleted file mode 100644
index c38bb2e776bb..000000000000
--- a/release_23/utils/NightlyTestTemplate.html
+++ /dev/null
@@ -1,244 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><title>LLVM Test Results for $DateString</title></head>
-
-<body bgcolor=white>
-<center><font size=+3 face=Verdana><b>LLVM Test Results for $DateString</b></font></center>
-<hr height=1>
-
-<table width=100%>
-<tr><td valign=top align=center>
-
-<table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#000000">
-<table border="0" cellpadding="5" cellspacing="0"><tr><td bgcolor="#DDAA77">
-<font size=+1><b>Sections:</b></font><br>
-</td></tr><tr><td bgcolor="#FFCC99" align=center>
-<a href="#Overview">Overview</a><br>
-<a href="#Changes">Changes</a><br>
-<a href="#Dejagnu">Dejagnu Tests</a><br>
-<a href="#Trends">Trends</a><br>
-<a href="#Programs">Programs</a><br>
-</td></tr></table></td></tr></table>
-
-<p>
-<table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#000000">
-<table border="0" cellpadding="5" cellspacing="0"><tr><td bgcolor="#DDAA77"
-<font size=+1><b>Previous:</b></font><br>
-</td></tr><tr><td bgcolor="#FFCC99">
- $PrevDaysList
-</td></tr></table></td></tr></table>
-<p>
-
-<font size=+1><b>Back to:</b></font><br>
-<a href="http://llvm.org/testresults/">Test&nbsp;Results</a><br>
-<a href="http://llvm.org/">LLVM&nbsp;Page</a><p>
-
-</td><td valign=top>
-
-<center>
-<table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#000000">
-<table border="0" cellpadding="10" cellspacing="0"><tr><td bgcolor="#DDAA77"
-<font size=+2 face=Verdana><b><a name="Overview">Today's Test Results Overview</font></b>
-</td></tr></table></td></tr></table></center><p>
-
-<!-- Running LOC graph -->
-<table align=right>
-<tr><td>
-<a href="running_loc_large.png"
- ><img border=0 width=480 height=360 src="running_loc.png"></a>
-</td></tr>
-<tr><td align=center>Lines Of Code over Time<br>
-<font size=-1><a href="running_loc_large.png">Click for larger view</a></font>
-</td></tr>
-</table>
-
-<h2>Nightly Test Overview:</h2>
-<ul>
- <li>Start: <b>$TestStartTime</b></li>
- <li>Finish: <b>$TestFinishTime</b></li>
- <li>Platform: <b>$TestPlatform</b></li>
-</ul>
-<h2>CVS Tree Overview:</h2>
-<ul>
-<li><a href="$DATE-CVS-Log.txt">CVS Checkout Log</a>
-<ul>
- <b>$NumDirsInCVS</b> dirs, <b>$NumFilesInCVS</b> files, <b>$LOC</b>
- lines of code, checked out in <b>$CVSCheckoutTime</b> seconds<br></ul>
-<li><a href="$DATE-Build-Log.txt">Compilation Log</a>
-<table>
-<tr><td><b>Item</b></td><td><b>CPU Time</b></td><td><b>Wall Clock</b></td></tr>
-<tr><td>Configure CVS Tree</td><td>$ConfigTime</td><td>$ConfigWallTime</td></tr>
-<tr><td>Build CVS Tree</td><td>$BuildTime</td><td>$BuildWallTime</td></tr>
-<tr><td>Run Dejagnu Tests</td><td>$DejagnuTime</td><td>$DejagnuWallTime</td></tr>
-</table></li>
-<li>Number of object files compiled: <b>$NumObjects</b></li>
-<li>Number of libraries linked: <b>$NumLibraries</b></li>
-<li>Number of executables linked:<b> $NumExecutables</b></li>
-<li>Build Status: $BuildStatus</li>
-</ul>
-
-<h2>Warnings during the build:</h2>
-$WarningsList
-
-<br><br><center>
-<table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#000000">
-<table border="0" cellpadding="10" cellspacing="0"><tr><td bgcolor="#DDAA77"
-<font size=+2 face=Verdana><b><a name="Changes">Changes from Yesterday</font></b>
-</td></tr></table></td></tr></table></center><p>
-
-<h2>Changes to CVS:</h2>
-<ul>
-<li>Users who committed to CVS: <b>$UserCommitList</b>
-<li>Users who updated from CVS: <b>$UserUpdateList</b>
-<li>Added Files: $AddedFilesList
-<li>Modified Files: $ModifiedFilesList
-<li>Removed Files: $RemovedFilesList
-</ul><p>
-
-<h2>Changes to Warnings:</h2>
-<p>Warnings Added:</p>
-$WarningsAdded
-<p>Warnings Removed:</p>
-$WarningsRemoved
-
-<h2>Changes in the test suite:</h2>
-<ul>
-<li>New Tests: $TestsAdded
-<li>Removed Tests: $TestsRemoved
-<li>Newly passing tests: $TestsFixed
-<li>Newly failing tests: $TestsBroken
-</ul>
-</td></tr></tbody></table>
-
-
-<br/><br/><center>
-<table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#000000">
-<table border="0" cellpadding="10" cellspacing="0"><tr><td bgcolor="#DDAA77"
-<font size=+2 face=Verdana><b><a name="Dejagnu">Dejagnu Test Results</font></b>
-</td></tr></table></td></tr></table></center>
-<br/>
-$DejagnuTestResults
-<p>A complete log of testing <a href="$DATE-Dejagnu-testrun.log">Feature and Regression</a> is available for further analysis.</p>
-
-<br><br><center>
-<table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#000000">
-<table border="0" cellpadding="10" cellspacing="0"><tr><td bgcolor="#DDAA77"
-<font size=+2 face=Verdana><b><a name="Trends">Changes Over Time</font></b>
-</td></tr></table></td></tr></table></center><p>
-
-
-Here are some charts showing how the LLVM optimizer and code generators are
-changing over time. For now we use the Olden benchmark suite to measure this,
-but eventually we will switch to using SPEC CPU2000. All programs are run with
-"LARGE_PROBLEM_SIZE" enabled. Click on any of the charts to get a larger
-version.<p>
-
-<h2>Compilation Measurements:</h2>
-
-<table border="0" align=center>
-<tr>
-<td width=50% align=center>
-<a href="running_Olden_bytecode_large.png"><img width=480 height=360 border=0 src="running_Olden_bytecode.png"></a><br>
-Size of LLVM bytecode files
-</td>
-<td width=50% align=center>
-<a href="running_Olden_opt_time_large.png"><img width=480 height=360 border=0 src="running_Olden_opt_time.png"></a><br>
-Time to run the LLVM optimizer on each program
-</td></tr>
-</table>
-
-<h2>Program Execution Measurements:</h2>
-
-<table border="0" align=center>
-<tr>
-<td width=50% align=center>
-<a href="running_Olden_cbe_time_large.png"><img width=480 height=360 border=0 src="running_Olden_cbe_time.png"></a><br>
-Execution time for CBE generated executable
-</td>
-<td width=50% align=center>
-<a href="running_Olden_llc_time_large.png"><img width=480 height=360 border=0 src="running_Olden_llc_time.png"></a><br>
-Execution time for the LLC generated executable
-</td></tr>
-
-<tr>
-<td align=center>
-<a href="running_Olden_jit_time_large.png"><img width=480 height=360 border=0 src="running_Olden_jit_time.png"></a><br>
-Execution time for program in the JIT
-</td>
-<td></td></tr>
-</table>
-
-
-
-
-<br><br><center>
-<table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#000000">
-<table border="0" cellpadding="10" cellspacing="0"><tr><td bgcolor="#DDAA77"
-<font size=+2 face=Verdana><b><a name="Programs">Program Tests</font></b>
-</td></tr></table></td></tr></table></center><p>
-
-This section tests LLVM on a variety of programs in the test suite. This
-includes benchmark suites like the Olden, McCat, Ptrdist, and SPEC benchmarks as
-well as a few random programs with test inputs. This section is meant to track
-how stable LLVM is as a whole. A failure in the execution of any test is marked
-with an asterisk: `*'. The columns of the tables are:<p>
-
-<ol>
-<li><a name="Program">Program</a> - The name of the program for that row.</li>
-<li><a name="GCCAS">GCCAS</a> - Time to run LLVM optimizers on the program.</li>
-<li><a name="Bytecode">Bytecode</a> - The size of the bytecode for the
- program</li>
-<li><a name="Instrs">Instrs</a> - The number of LLVM instructions in the
- compiled bytecode</li>
-<li><a name="LLC<br>compile">LLC compile</a> - The time taken compile with
- LLC (the static backend)</li>
-<li><a name="JIT<br>codegen">JIT codegen</a> - The amount of time spent in the
- JIT itself, instead of executing the program.</li>
-<li><a name="Machine<br>code">Machine code</a> - The number of bytes of machine
- code generated by the JIT.</li>
-<li><a name="GCC">GCC</a> - The time taken to execute the program when compiled
- with GCC -O2.</li>
-<li><a name="CBE">CBE</a> - The time taken to execute the program after
- compilation through the C backend, compiled with -O2.</li>
-<li><a name="LLC">LLC</a> - How long does the program generated by the static
- backend LLC take to execute </li>
-<li><a name="JIT">JIT</a> - The amount of time spent running the
- program with the JIT; this includes the code generation phase (listed above)
- and actually running the program.</li>
-<li><a name="GCC/LLC">GCC/LLC</a> - The speed-up of the LLC output vs the native
- GCC output: greater than 1 is a speedup, less than 1 is a slowdown.</li>
-<li><a name="GCC/CBE">GCC/CBE</a> - The speed-up of the CBE output vs the native
- GCC output: greater than 1 is a speedup, less than 1 is a slowdown.</li>
-<li><a name="LLC-BETA">LLC-BETA</a> - How long does the program generated by the static
- backend LLC take to execute the program, when compiled with new experimental
- features. This is temporary, for tuning.</li>
-</ol><p>
-
-A complete log of testing
-<a href="$DATE-SingleSource-ProgramTest.txt.gz">SingleSource</a>,
-<a href="$DATE-MultiSource-ProgramTest.txt.gz">MultiSource</a>, and
-<a href="$DATE-External-ProgramTest.txt.gz">External</a> programs are
-available for further analysis.
-
-<h2>Programs/External</h2>
-
-<center>
-<table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#000000">
-$ExternalProgramsTable
-</td></tr></table></center>
-
-<h2>Programs/MultiSource</h2>
-
-<center>
-<table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#000000">
-$MultiSourceProgramsTable
-</td></tr></table></center>
-
-<h2>Programs/SingleSource</h2>
-
-<center>
-<table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#000000">
-$SingleSourceProgramsTable
-</td></tr></table></center>
-
-</td></tr></html>
-
diff --git a/release_23/utils/OldenDataRecover.pl b/release_23/utils/OldenDataRecover.pl
deleted file mode 100644
index 767839488b34..000000000000
--- a/release_23/utils/OldenDataRecover.pl
+++ /dev/null
@@ -1,37 +0,0 @@
-#this script is intended to help recover the running graphs when
-#the nightly tester decides to eat them.
-
-#zgrep -E "(=========)|(TEST-RESULT-llc-time)" *-Olden-tests.txt* |perl this > file
-#zgrep -E "(=========)|(TEST-RESULT-compile.*bc)" *-Olden-tests.tx* |perl this >file
-
-while (<>) {
- if (/(\d*-\d*-\d*)-.*=========.*\/(.*)\' Program/) {
-# print "$1 $2\n";
- $curP = $2;
- $curD = $1;
- $dates{$1} = 1;
- } elsif (/(\d*-\d*-\d*)-.*TEST-RESULT-.*: program (\d*\.\d*)/) {
-# print "$1 $2\n";
- if ($curD eq $1) {
- $$data{$curD}{$curP} = $2;
- }
- } elsif (/(\d*-\d*-\d*)-.*TEST-RESULT-.*: (\d*)/) {
-# print "$1 $2\n";
- if ($curD eq $1) {
- $$data{$curD}{$curP} = $2;
- }
- }
-}
-@progs = ("bh", "em3d", "mst", "power", "tsp", "bisort", "health", "perimeter", "treeadd", "voronoi");
-
-foreach $date (sort keys %dates) {
- print "$date: ";
- foreach $prog (@progs) {
- if ($$data{$date}{$prog}) {
- print " $$data{$date}{$prog}";
- } else {
- print " 0";
- }
- }
- print "\n";
-}
diff --git a/release_23/utils/PerfectShuffle/Makefile b/release_23/utils/PerfectShuffle/Makefile
deleted file mode 100644
index 0eb3a9947ffe..000000000000
--- a/release_23/utils/PerfectShuffle/Makefile
+++ /dev/null
@@ -1,14 +0,0 @@
-##===- utils/PerfectShuffle/Makefile -----------------------*- Makefile -*-===##
-#
-# The LLVM Compiler Infrastructure
-#
-# This file is distributed under the University of Illinois Open Source
-# License. See LICENSE.TXT for details.
-#
-##===----------------------------------------------------------------------===##
-
-LEVEL = ../..
-TOOLNAME = llvm-PerfectShuffle
-NO_INSTALL = 1
-include $(LEVEL)/Makefile.common
-
diff --git a/release_23/utils/PerfectShuffle/PerfectShuffle.cpp b/release_23/utils/PerfectShuffle/PerfectShuffle.cpp
deleted file mode 100644
index 26c4cf44c6e2..000000000000
--- a/release_23/utils/PerfectShuffle/PerfectShuffle.cpp
+++ /dev/null
@@ -1,497 +0,0 @@
-//===-- PerfectShuffle.cpp - Perfect Shuffle Generator --------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file computes an optimal sequence of instructions for doing all shuffles
-// of two 4-element vectors. With a release build and when configured to emit
-// an altivec instruction table, this takes about 30s to run on a 2.7Ghz
-// PowerPC G5.
-//
-//===----------------------------------------------------------------------===//
-
-#include <iostream>
-#include <vector>
-#include <cassert>
-#include <cstdlib>
-struct Operator;
-
-// Masks are 4-nibble hex numbers. Values 0-7 in any nibble means that it takes
-// an element from that value of the input vectors. A value of 8 means the
-// entry is undefined.
-
-// Mask manipulation functions.
-static inline unsigned short MakeMask(unsigned V0, unsigned V1,
- unsigned V2, unsigned V3) {
- return (V0 << (3*4)) | (V1 << (2*4)) | (V2 << (1*4)) | (V3 << (0*4));
-}
-
-/// getMaskElt - Return element N of the specified mask.
-static unsigned getMaskElt(unsigned Mask, unsigned Elt) {
- return (Mask >> ((3-Elt)*4)) & 0xF;
-}
-
-static unsigned setMaskElt(unsigned Mask, unsigned Elt, unsigned NewVal) {
- unsigned FieldShift = ((3-Elt)*4);
- return (Mask & ~(0xF << FieldShift)) | (NewVal << FieldShift);
-}
-
-// Reject elements where the values are 9-15.
-static bool isValidMask(unsigned short Mask) {
- unsigned short UndefBits = Mask & 0x8888;
- return (Mask & ((UndefBits >> 1)|(UndefBits>>2)|(UndefBits>>3))) == 0;
-}
-
-/// hasUndefElements - Return true if any of the elements in the mask are undefs
-///
-static bool hasUndefElements(unsigned short Mask) {
- return (Mask & 0x8888) != 0;
-}
-
-/// isOnlyLHSMask - Return true if this mask only refers to its LHS, not
-/// including undef values..
-static bool isOnlyLHSMask(unsigned short Mask) {
- return (Mask & 0x4444) == 0;
-}
-
-/// getLHSOnlyMask - Given a mask that refers to its LHS and RHS, modify it to
-/// refer to the LHS only (for when one argument value is passed into the same
-/// function twice).
-#if 0
-static unsigned short getLHSOnlyMask(unsigned short Mask) {
- return Mask & 0xBBBB; // Keep only LHS and Undefs.
-}
-#endif
-
-/// getCompressedMask - Turn a 16-bit uncompressed mask (where each elt uses 4
-/// bits) into a compressed 13-bit mask, where each elt is multiplied by 9.
-static unsigned getCompressedMask(unsigned short Mask) {
- return getMaskElt(Mask, 0)*9*9*9 + getMaskElt(Mask, 1)*9*9 +
- getMaskElt(Mask, 2)*9 + getMaskElt(Mask, 3);
-}
-
-static void PrintMask(unsigned i, std::ostream &OS) {
- OS << "<" << (char)(getMaskElt(i, 0) == 8 ? 'u' : ('0'+getMaskElt(i, 0)))
- << "," << (char)(getMaskElt(i, 1) == 8 ? 'u' : ('0'+getMaskElt(i, 1)))
- << "," << (char)(getMaskElt(i, 2) == 8 ? 'u' : ('0'+getMaskElt(i, 2)))
- << "," << (char)(getMaskElt(i, 3) == 8 ? 'u' : ('0'+getMaskElt(i, 3)))
- << ">";
-}
-
-/// ShuffleVal - This represents a shufflevector operation.
-struct ShuffleVal {
- unsigned Cost; // Number of instrs used to generate this value.
- Operator *Op; // The Operation used to generate this value.
- unsigned short Arg0, Arg1; // Input operands for this value.
-
- ShuffleVal() : Cost(1000000) {}
-};
-
-
-/// ShufTab - This is the actual shuffle table that we are trying to generate.
-///
-static ShuffleVal ShufTab[65536];
-
-/// TheOperators - All of the operators that this target supports.
-static std::vector<Operator*> TheOperators;
-
-/// Operator - This is a vector operation that is available for use.
-struct Operator {
- unsigned short ShuffleMask;
- unsigned short OpNum;
- const char *Name;
-
- Operator(unsigned short shufflemask, const char *name, unsigned opnum)
- : ShuffleMask(shufflemask), OpNum(opnum), Name(name) {
- TheOperators.push_back(this);
- }
- ~Operator() {
- assert(TheOperators.back() == this);
- TheOperators.pop_back();
- }
-
- bool isOnlyLHSOperator() const {
- return isOnlyLHSMask(ShuffleMask);
- }
-
- const char *getName() const { return Name; }
-
- unsigned short getTransformedMask(unsigned short LHSMask, unsigned RHSMask) {
- // Extract the elements from LHSMask and RHSMask, as appropriate.
- unsigned Result = 0;
- for (unsigned i = 0; i != 4; ++i) {
- unsigned SrcElt = (ShuffleMask >> (4*i)) & 0xF;
- unsigned ResElt;
- if (SrcElt < 4)
- ResElt = getMaskElt(LHSMask, SrcElt);
- else if (SrcElt < 8)
- ResElt = getMaskElt(RHSMask, SrcElt-4);
- else {
- assert(SrcElt == 8 && "Bad src elt!");
- ResElt = 8;
- }
- Result |= ResElt << (4*i);
- }
- return Result;
- }
-};
-
-static const char *getZeroCostOpName(unsigned short Op) {
- if (ShufTab[Op].Arg0 == 0x0123)
- return "LHS";
- else if (ShufTab[Op].Arg0 == 0x4567)
- return "RHS";
- else {
- assert(0 && "bad zero cost operation");
- abort();
- }
-}
-
-static void PrintOperation(unsigned ValNo, unsigned short Vals[]) {
- unsigned short ThisOp = Vals[ValNo];
- std::cerr << "t" << ValNo;
- PrintMask(ThisOp, std::cerr);
- std::cerr << " = " << ShufTab[ThisOp].Op->getName() << "(";
-
- if (ShufTab[ShufTab[ThisOp].Arg0].Cost == 0) {
- std::cerr << getZeroCostOpName(ShufTab[ThisOp].Arg0);
- PrintMask(ShufTab[ThisOp].Arg0, std::cerr);
- } else {
- // Figure out what tmp # it is.
- for (unsigned i = 0; ; ++i)
- if (Vals[i] == ShufTab[ThisOp].Arg0) {
- std::cerr << "t" << i;
- break;
- }
- }
-
- if (!ShufTab[Vals[ValNo]].Op->isOnlyLHSOperator()) {
- std::cerr << ", ";
- if (ShufTab[ShufTab[ThisOp].Arg1].Cost == 0) {
- std::cerr << getZeroCostOpName(ShufTab[ThisOp].Arg1);
- PrintMask(ShufTab[ThisOp].Arg1, std::cerr);
- } else {
- // Figure out what tmp # it is.
- for (unsigned i = 0; ; ++i)
- if (Vals[i] == ShufTab[ThisOp].Arg1) {
- std::cerr << "t" << i;
- break;
- }
- }
- }
- std::cerr << ") ";
-}
-
-static unsigned getNumEntered() {
- unsigned Count = 0;
- for (unsigned i = 0; i != 65536; ++i)
- Count += ShufTab[i].Cost < 100;
- return Count;
-}
-
-static void EvaluateOps(unsigned short Elt, unsigned short Vals[],
- unsigned &NumVals) {
- if (ShufTab[Elt].Cost == 0) return;
-
- // If this value has already been evaluated, it is free. FIXME: match undefs.
- for (unsigned i = 0, e = NumVals; i != e; ++i)
- if (Vals[i] == Elt) return;
-
- // Otherwise, get the operands of the value, then add it.
- unsigned Arg0 = ShufTab[Elt].Arg0, Arg1 = ShufTab[Elt].Arg1;
- if (ShufTab[Arg0].Cost)
- EvaluateOps(Arg0, Vals, NumVals);
- if (Arg0 != Arg1 && ShufTab[Arg1].Cost)
- EvaluateOps(Arg1, Vals, NumVals);
-
- Vals[NumVals++] = Elt;
-}
-
-
-int main() {
- // Seed the table with accesses to the LHS and RHS.
- ShufTab[0x0123].Cost = 0;
- ShufTab[0x0123].Op = 0;
- ShufTab[0x0123].Arg0 = 0x0123;
- ShufTab[0x4567].Cost = 0;
- ShufTab[0x4567].Op = 0;
- ShufTab[0x4567].Arg0 = 0x4567;
-
- // Seed the first-level of shuffles, shuffles whose inputs are the input to
- // the vectorshuffle operation.
- bool MadeChange = true;
- unsigned OpCount = 0;
- while (MadeChange) {
- MadeChange = false;
- ++OpCount;
- std::cerr << "Starting iteration #" << OpCount << " with "
- << getNumEntered() << " entries established.\n";
-
- // Scan the table for two reasons: First, compute the maximum cost of any
- // operation left in the table. Second, make sure that values with undefs
- // have the cheapest alternative that they match.
- unsigned MaxCost = ShufTab[0].Cost;
- for (unsigned i = 1; i != 0x8889; ++i) {
- if (!isValidMask(i)) continue;
- if (ShufTab[i].Cost > MaxCost)
- MaxCost = ShufTab[i].Cost;
-
- // If this value has an undef, make it be computed the cheapest possible
- // way of any of the things that it matches.
- if (hasUndefElements(i)) {
- // This code is a little bit tricky, so here's the idea: consider some
- // permutation, like 7u4u. To compute the lowest cost for 7u4u, we
- // need to take the minimum cost of all of 7[0-8]4[0-8], 81 entries. If
- // there are 3 undefs, the number rises to 729 entries we have to scan,
- // and for the 4 undef case, we have to scan the whole table.
- //
- // Instead of doing this huge amount of scanning, we process the table
- // entries *in order*, and use the fact that 'u' is 8, larger than any
- // valid index. Given an entry like 7u4u then, we only need to scan
- // 7[0-7]4u - 8 entries. We can get away with this, because we already
- // know that each of 704u, 714u, 724u, etc contain the minimum value of
- // all of the 704[0-8], 714[0-8] and 724[0-8] entries respectively.
- unsigned UndefIdx;
- if (i & 0x8000)
- UndefIdx = 0;
- else if (i & 0x0800)
- UndefIdx = 1;
- else if (i & 0x0080)
- UndefIdx = 2;
- else if (i & 0x0008)
- UndefIdx = 3;
- else
- abort();
-
- unsigned MinVal = i;
- unsigned MinCost = ShufTab[i].Cost;
-
- // Scan the 8 entries.
- for (unsigned j = 0; j != 8; ++j) {
- unsigned NewElt = setMaskElt(i, UndefIdx, j);
- if (ShufTab[NewElt].Cost < MinCost) {
- MinCost = ShufTab[NewElt].Cost;
- MinVal = NewElt;
- }
- }
-
- // If we found something cheaper than what was here before, use it.
- if (i != MinVal) {
- MadeChange = true;
- ShufTab[i] = ShufTab[MinVal];
- }
- }
- }
-
- for (unsigned LHS = 0; LHS != 0x8889; ++LHS) {
- if (!isValidMask(LHS)) continue;
- if (ShufTab[LHS].Cost > 1000) continue;
-
- // If nothing involving this operand could possibly be cheaper than what
- // we already have, don't consider it.
- if (ShufTab[LHS].Cost + 1 >= MaxCost)
- continue;
-
- for (unsigned opnum = 0, e = TheOperators.size(); opnum != e; ++opnum) {
- Operator *Op = TheOperators[opnum];
-
- // Evaluate op(LHS,LHS)
- unsigned ResultMask = Op->getTransformedMask(LHS, LHS);
-
- unsigned Cost = ShufTab[LHS].Cost + 1;
- if (Cost < ShufTab[ResultMask].Cost) {
- ShufTab[ResultMask].Cost = Cost;
- ShufTab[ResultMask].Op = Op;
- ShufTab[ResultMask].Arg0 = LHS;
- ShufTab[ResultMask].Arg1 = LHS;
- MadeChange = true;
- }
-
- // If this is a two input instruction, include the op(x,y) cases. If
- // this is a one input instruction, skip this.
- if (Op->isOnlyLHSOperator()) continue;
-
- for (unsigned RHS = 0; RHS != 0x8889; ++RHS) {
- if (!isValidMask(RHS)) continue;
- if (ShufTab[RHS].Cost > 1000) continue;
-
- // If nothing involving this operand could possibly be cheaper than
- // what we already have, don't consider it.
- if (ShufTab[RHS].Cost + 1 >= MaxCost)
- continue;
-
-
- // Evaluate op(LHS,RHS)
- unsigned ResultMask = Op->getTransformedMask(LHS, RHS);
-
- if (ShufTab[ResultMask].Cost <= OpCount ||
- ShufTab[ResultMask].Cost <= ShufTab[LHS].Cost ||
- ShufTab[ResultMask].Cost <= ShufTab[RHS].Cost)
- continue;
-
- // Figure out the cost to evaluate this, knowing that CSE's only need
- // to be evaluated once.
- unsigned short Vals[30];
- unsigned NumVals = 0;
- EvaluateOps(LHS, Vals, NumVals);
- EvaluateOps(RHS, Vals, NumVals);
-
- unsigned Cost = NumVals + 1;
- if (Cost < ShufTab[ResultMask].Cost) {
- ShufTab[ResultMask].Cost = Cost;
- ShufTab[ResultMask].Op = Op;
- ShufTab[ResultMask].Arg0 = LHS;
- ShufTab[ResultMask].Arg1 = RHS;
- MadeChange = true;
- }
- }
- }
- }
- }
-
- std::cerr << "Finished Table has " << getNumEntered()
- << " entries established.\n";
-
- unsigned CostArray[10] = { 0 };
-
- // Compute a cost histogram.
- for (unsigned i = 0; i != 65536; ++i) {
- if (!isValidMask(i)) continue;
- if (ShufTab[i].Cost > 9)
- ++CostArray[9];
- else
- ++CostArray[ShufTab[i].Cost];
- }
-
- for (unsigned i = 0; i != 9; ++i)
- if (CostArray[i])
- std::cout << "// " << CostArray[i] << " entries have cost " << i << "\n";
- if (CostArray[9])
- std::cout << "// " << CostArray[9] << " entries have higher cost!\n";
-
-
- // Build up the table to emit.
- std::cout << "\n// This table is 6561*4 = 26244 bytes in size.\n";
- std::cout << "static const unsigned PerfectShuffleTable[6561+1] = {\n";
-
- for (unsigned i = 0; i != 0x8889; ++i) {
- if (!isValidMask(i)) continue;
-
- // CostSat - The cost of this operation saturated to two bits.
- unsigned CostSat = ShufTab[i].Cost;
- if (CostSat > 4) CostSat = 4;
- if (CostSat == 0) CostSat = 1;
- --CostSat; // Cost is now between 0-3.
-
- unsigned OpNum = ShufTab[i].Op ? ShufTab[i].Op->OpNum : 0;
- assert(OpNum < 16 && "Too few bits to encode operation!");
-
- unsigned LHS = getCompressedMask(ShufTab[i].Arg0);
- unsigned RHS = getCompressedMask(ShufTab[i].Arg1);
-
- // Encode this as 2 bits of saturated cost, 4 bits of opcodes, 13 bits of
- // LHS, and 13 bits of RHS = 32 bits.
- unsigned Val = (CostSat << 30) | (OpNum << 26) | (LHS << 13) | RHS;
-
- std::cout << " " << Val << "U,\t// ";
- PrintMask(i, std::cout);
- std::cout << ": Cost " << ShufTab[i].Cost;
- std::cout << " " << (ShufTab[i].Op ? ShufTab[i].Op->getName() : "copy");
- std::cout << " ";
- if (ShufTab[ShufTab[i].Arg0].Cost == 0) {
- std::cout << getZeroCostOpName(ShufTab[i].Arg0);
- } else {
- PrintMask(ShufTab[i].Arg0, std::cout);
- }
-
- if (ShufTab[i].Op && !ShufTab[i].Op->isOnlyLHSOperator()) {
- std::cout << ", ";
- if (ShufTab[ShufTab[i].Arg1].Cost == 0) {
- std::cout << getZeroCostOpName(ShufTab[i].Arg1);
- } else {
- PrintMask(ShufTab[i].Arg1, std::cout);
- }
- }
- std::cout << "\n";
- }
- std::cout << " 0\n};\n";
-
- if (0) {
- // Print out the table.
- for (unsigned i = 0; i != 0x8889; ++i) {
- if (!isValidMask(i)) continue;
- if (ShufTab[i].Cost < 1000) {
- PrintMask(i, std::cerr);
- std::cerr << " - Cost " << ShufTab[i].Cost << " - ";
-
- unsigned short Vals[30];
- unsigned NumVals = 0;
- EvaluateOps(i, Vals, NumVals);
-
- for (unsigned j = 0, e = NumVals; j != e; ++j)
- PrintOperation(j, Vals);
- std::cerr << "\n";
- }
- }
- }
-}
-
-
-#define GENERATE_ALTIVEC
-
-#ifdef GENERATE_ALTIVEC
-
-///===---------------------------------------------------------------------===//
-/// The altivec instruction definitions. This is the altivec-specific part of
-/// this file.
-///===---------------------------------------------------------------------===//
-
-// Note that the opcode numbers here must match those in the PPC backend.
-enum {
- OP_COPY = 0, // Copy, used for things like <u,u,u,3> to say it is <0,1,2,3>
- OP_VMRGHW,
- OP_VMRGLW,
- OP_VSPLTISW0,
- OP_VSPLTISW1,
- OP_VSPLTISW2,
- OP_VSPLTISW3,
- OP_VSLDOI4,
- OP_VSLDOI8,
- OP_VSLDOI12
-};
-
-struct vmrghw : public Operator {
- vmrghw() : Operator(0x0415, "vmrghw", OP_VMRGHW) {}
-} the_vmrghw;
-
-struct vmrglw : public Operator {
- vmrglw() : Operator(0x2637, "vmrglw", OP_VMRGLW) {}
-} the_vmrglw;
-
-template<unsigned Elt>
-struct vspltisw : public Operator {
- vspltisw(const char *N, unsigned Opc)
- : Operator(MakeMask(Elt, Elt, Elt, Elt), N, Opc) {}
-};
-
-vspltisw<0> the_vspltisw0("vspltisw0", OP_VSPLTISW0);
-vspltisw<1> the_vspltisw1("vspltisw1", OP_VSPLTISW1);
-vspltisw<2> the_vspltisw2("vspltisw2", OP_VSPLTISW2);
-vspltisw<3> the_vspltisw3("vspltisw3", OP_VSPLTISW3);
-
-template<unsigned N>
-struct vsldoi : public Operator {
- vsldoi(const char *Name, unsigned Opc)
- : Operator(MakeMask(N&7, (N+1)&7, (N+2)&7, (N+3)&7), Name, Opc) {
- }
-};
-
-vsldoi<1> the_vsldoi1("vsldoi4" , OP_VSLDOI4);
-vsldoi<2> the_vsldoi2("vsldoi8" , OP_VSLDOI8);
-vsldoi<3> the_vsldoi3("vsldoi12", OP_VSLDOI12);
-
-#endif
diff --git a/release_23/utils/RegressionFinder.pl b/release_23/utils/RegressionFinder.pl
deleted file mode 100755
index 86b077780b0d..000000000000
--- a/release_23/utils/RegressionFinder.pl
+++ /dev/null
@@ -1,186 +0,0 @@
-#! /usr/bin/perl
-# Script to find regressions by binary-searching a time interval in the
-# CVS tree. Written by Brian Gaeke on 2-Mar-2004.
-#
-
-require 5.6.0; # NOTE: This script not tested with earlier versions.
-use Getopt::Std;
-use POSIX;
-use Time::Local;
-use IO::Handle;
-
-sub usage {
- print STDERR <<END;
-findRegression [-I] -w WTIME -d DTIME -t TOOLS -c SCRIPT
-
-The -w, -d, -t, and -c options are required.
-Run findRegression in the top level of an LLVM tree.
-WTIME is a time when you are sure the regression does NOT exist ("Works").
-DTIME is a time when you are sure the regression DOES exist ("Doesntwork").
-WTIME and DTIME are both in the format: "YYYY/MM/DD HH:MM".
--I means run builds at WTIME and DTIME first to make sure.
-TOOLS is a comma separated list of tools to rebuild before running SCRIPT.
-SCRIPT exits 1 if the regression is present in TOOLS; 0 otherwise.
-END
- exit 1;
-}
-
-sub timeAsSeconds {
- my ($timestr) = @_;
-
- if ( $timestr =~ /(\d\d\d\d)\/(\d\d)\/(\d\d) (\d\d):(\d\d)/ ) {
- my ( $year, $mon, $mday, $hour, $min ) = ( $1, $2, $3, $4, $5 );
- return timegm( 0, $min, $hour, $mday, $mon - 1, $year );
- }
- else {
- die "** Can't parse date + time: $timestr\n";
- }
-}
-
-sub timeAsString {
- my ($secs) = @_;
- return strftime( "%Y/%m/%d %H:%M", gmtime($secs) );
-}
-
-sub run {
- my ($cmdline) = @_;
- print LOG "** Running: $cmdline\n";
- return system($cmdline);
-}
-
-sub buildLibrariesAndTools {
- run("sh /home/vadve/gaeke/scripts/run-configure");
- run("$MAKE -C lib/Support");
- run("$MAKE -C utils");
- run("$MAKE -C lib");
- foreach my $tool (@TOOLS) { run("$MAKE -C tools/$tool"); }
-}
-
-sub contains {
- my ( $file, $regex ) = @_;
- local (*FILE);
- open( FILE, "<$file" ) or die "** can't read $file: $!\n";
- while (<FILE>) {
- if (/$regex/) {
- close FILE;
- return 1;
- }
- }
- close FILE;
- return 0;
-}
-
-sub updateSources {
- my ($time) = @_;
- my $inst = "include/llvm/Instruction.h";
- unlink($inst);
- run( "cvs update -D'" . timeAsString($time) . "'" );
- if ( !contains( $inst, 'class Instruction.*Annotable' ) ) {
- run("patch -F100 -p0 < makeInstructionAnnotable.patch");
- }
-}
-
-sub regressionPresentAt {
- my ($time) = @_;
-
- updateSources($time);
- buildLibrariesAndTools();
- my $rc = run($SCRIPT);
- if ($rc) {
- print LOG "** Found that regression was PRESENT at "
- . timeAsString($time) . "\n";
- return 1;
- }
- else {
- print LOG "** Found that regression was ABSENT at "
- . timeAsString($time) . "\n";
- return 0;
- }
-}
-
-sub regressionAbsentAt {
- my ($time) = @_;
- return !regressionPresentAt($time);
-}
-
-sub closeTo {
- my ( $time1, $time2 ) = @_;
- return abs( $time1 - $time2 ) < 600; # 10 minutes seems reasonable.
-}
-
-sub halfWayPoint {
- my ( $time1, $time2 ) = @_;
- my $halfSpan = int( abs( $time1 - $time2 ) / 2 );
- if ( $time1 < $time2 ) {
- return $time1 + $halfSpan;
- }
- else {
- return $time2 + $halfSpan;
- }
-}
-
-sub checkBoundaryConditions {
- print LOG "** Checking for presence of regression at ", timeAsString($DTIME),
- "\n";
- if ( !regressionPresentAt($DTIME) ) {
- die ( "** Can't help you; $SCRIPT says regression absent at dtime: "
- . timeAsString($DTIME)
- . "\n" );
- }
- print LOG "** Checking for absence of regression at ", timeAsString($WTIME),
- "\n";
- if ( !regressionAbsentAt($WTIME) ) {
- die ( "** Can't help you; $SCRIPT says regression present at wtime: "
- . timeAsString($WTIME)
- . "\n" );
- }
-}
-
-##############################################################################
-
-# Set up log files
-open (STDERR, ">&STDOUT") || die "** Can't redirect std.err: $!\n";
-autoflush STDOUT 1;
-autoflush STDERR 1;
-open (LOG, ">RegFinder.log") || die "** can't write RegFinder.log: $!\n";
-autoflush LOG 1;
-# Check command line arguments and environment variables
-getopts('Iw:d:t:c:');
-if ( !( $opt_w && $opt_d && $opt_t && $opt_c ) ) {
- usage;
-}
-$MAKE = $ENV{'MAKE'};
-$MAKE = 'gmake' unless $MAKE;
-$WTIME = timeAsSeconds($opt_w);
-print LOG "** Assuming worked at ", timeAsString($WTIME), "\n";
-$DTIME = timeAsSeconds($opt_d);
-print LOG "** Assuming didn't work at ", timeAsString($DTIME), "\n";
-$opt_t =~ s/\s*//g;
-$SCRIPT = $opt_c;
-die "** $SCRIPT is not executable or not found\n" unless -x $SCRIPT;
-print LOG "** Checking for the regression using $SCRIPT\n";
-@TOOLS = split ( /,/, $opt_t );
-print LOG (
- "** Going to rebuild: ",
- ( join ", ", @TOOLS ),
- " before each $SCRIPT run\n"
-);
-if ($opt_I) { checkBoundaryConditions(); }
-# do the dirty work:
-while ( !closeTo( $DTIME, $WTIME ) ) {
- my $halfPt = halfWayPoint( $DTIME, $WTIME );
- print LOG "** Checking whether regression is present at ",
- timeAsString($halfPt), "\n";
- if ( regressionPresentAt($halfPt) ) {
- $DTIME = $halfPt;
- }
- else {
- $WTIME = $halfPt;
- }
-}
-# Tell them what we found
-print LOG "** Narrowed it down to:\n";
-print LOG "** Worked at: ", timeAsString($WTIME), "\n";
-print LOG "** Did not work at: ", timeAsString($DTIME), "\n";
-close LOG;
-exit 0;
diff --git a/release_23/utils/TableGen/AsmWriterEmitter.cpp b/release_23/utils/TableGen/AsmWriterEmitter.cpp
deleted file mode 100644
index 8fbb2cfbb61c..000000000000
--- a/release_23/utils/TableGen/AsmWriterEmitter.cpp
+++ /dev/null
@@ -1,727 +0,0 @@
-//===- AsmWriterEmitter.cpp - Generate an assembly writer -----------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This tablegen backend is emits an assembly printer for the current target.
-// Note that this is currently fairly skeletal, but will grow over time.
-//
-//===----------------------------------------------------------------------===//
-
-#include "AsmWriterEmitter.h"
-#include "CodeGenTarget.h"
-#include "Record.h"
-#include "llvm/ADT/StringExtras.h"
-#include "llvm/Support/Debug.h"
-#include "llvm/Support/MathExtras.h"
-#include <algorithm>
-using namespace llvm;
-
-static bool isIdentChar(char C) {
- return (C >= 'a' && C <= 'z') ||
- (C >= 'A' && C <= 'Z') ||
- (C >= '0' && C <= '9') ||
- C == '_';
-}
-
-// This should be an anon namespace, this works around a GCC warning.
-namespace llvm {
- struct AsmWriterOperand {
- enum { isLiteralTextOperand, isMachineInstrOperand } OperandType;
-
- /// Str - For isLiteralTextOperand, this IS the literal text. For
- /// isMachineInstrOperand, this is the PrinterMethodName for the operand.
- std::string Str;
-
- /// MiOpNo - For isMachineInstrOperand, this is the operand number of the
- /// machine instruction.
- unsigned MIOpNo;
-
- /// MiModifier - For isMachineInstrOperand, this is the modifier string for
- /// an operand, specified with syntax like ${opname:modifier}.
- std::string MiModifier;
-
- AsmWriterOperand(const std::string &LitStr)
- : OperandType(isLiteralTextOperand), Str(LitStr) {}
-
- AsmWriterOperand(const std::string &Printer, unsigned OpNo,
- const std::string &Modifier)
- : OperandType(isMachineInstrOperand), Str(Printer), MIOpNo(OpNo),
- MiModifier(Modifier) {}
-
- bool operator!=(const AsmWriterOperand &Other) const {
- if (OperandType != Other.OperandType || Str != Other.Str) return true;
- if (OperandType == isMachineInstrOperand)
- return MIOpNo != Other.MIOpNo || MiModifier != Other.MiModifier;
- return false;
- }
- bool operator==(const AsmWriterOperand &Other) const {
- return !operator!=(Other);
- }
-
- /// getCode - Return the code that prints this operand.
- std::string getCode() const;
- };
-}
-
-namespace llvm {
- class AsmWriterInst {
- public:
- std::vector<AsmWriterOperand> Operands;
- const CodeGenInstruction *CGI;
-
- AsmWriterInst(const CodeGenInstruction &CGI, unsigned Variant);
-
- /// MatchesAllButOneOp - If this instruction is exactly identical to the
- /// specified instruction except for one differing operand, return the
- /// differing operand number. Otherwise return ~0.
- unsigned MatchesAllButOneOp(const AsmWriterInst &Other) const;
-
- private:
- void AddLiteralString(const std::string &Str) {
- // If the last operand was already a literal text string, append this to
- // it, otherwise add a new operand.
- if (!Operands.empty() &&
- Operands.back().OperandType == AsmWriterOperand::isLiteralTextOperand)
- Operands.back().Str.append(Str);
- else
- Operands.push_back(AsmWriterOperand(Str));
- }
- };
-}
-
-
-std::string AsmWriterOperand::getCode() const {
- if (OperandType == isLiteralTextOperand)
- return "O << \"" + Str + "\"; ";
-
- std::string Result = Str + "(MI";
- if (MIOpNo != ~0U)
- Result += ", " + utostr(MIOpNo);
- if (!MiModifier.empty())
- Result += ", \"" + MiModifier + '"';
- return Result + "); ";
-}
-
-
-/// ParseAsmString - Parse the specified Instruction's AsmString into this
-/// AsmWriterInst.
-///
-AsmWriterInst::AsmWriterInst(const CodeGenInstruction &CGI, unsigned Variant) {
- this->CGI = &CGI;
- unsigned CurVariant = ~0U; // ~0 if we are outside a {.|.|.} region, other #.
-
- // NOTE: Any extensions to this code need to be mirrored in the
- // AsmPrinter::printInlineAsm code that executes as compile time (assuming
- // that inline asm strings should also get the new feature)!
- const std::string &AsmString = CGI.AsmString;
- std::string::size_type LastEmitted = 0;
- while (LastEmitted != AsmString.size()) {
- std::string::size_type DollarPos =
- AsmString.find_first_of("${|}\\", LastEmitted);
- if (DollarPos == std::string::npos) DollarPos = AsmString.size();
-
- // Emit a constant string fragment.
- if (DollarPos != LastEmitted) {
- // TODO: this should eventually handle escaping.
- if (CurVariant == Variant || CurVariant == ~0U)
- AddLiteralString(std::string(AsmString.begin()+LastEmitted,
- AsmString.begin()+DollarPos));
- LastEmitted = DollarPos;
- } else if (AsmString[DollarPos] == '\\') {
- if (DollarPos+1 != AsmString.size() &&
- (CurVariant == Variant || CurVariant == ~0U)) {
- if (AsmString[DollarPos+1] == 'n') {
- AddLiteralString("\\n");
- } else if (AsmString[DollarPos+1] == 't') {
- AddLiteralString("\\t");
- } else if (std::string("${|}\\").find(AsmString[DollarPos+1])
- != std::string::npos) {
- AddLiteralString(std::string(1, AsmString[DollarPos+1]));
- } else {
- throw "Non-supported escaped character found in instruction '" +
- CGI.TheDef->getName() + "'!";
- }
- LastEmitted = DollarPos+2;
- continue;
- }
- } else if (AsmString[DollarPos] == '{') {
- if (CurVariant != ~0U)
- throw "Nested variants found for instruction '" +
- CGI.TheDef->getName() + "'!";
- LastEmitted = DollarPos+1;
- CurVariant = 0; // We are now inside of the variant!
- } else if (AsmString[DollarPos] == '|') {
- if (CurVariant == ~0U)
- throw "'|' character found outside of a variant in instruction '"
- + CGI.TheDef->getName() + "'!";
- ++CurVariant;
- ++LastEmitted;
- } else if (AsmString[DollarPos] == '}') {
- if (CurVariant == ~0U)
- throw "'}' character found outside of a variant in instruction '"
- + CGI.TheDef->getName() + "'!";
- ++LastEmitted;
- CurVariant = ~0U;
- } else if (DollarPos+1 != AsmString.size() &&
- AsmString[DollarPos+1] == '$') {
- if (CurVariant == Variant || CurVariant == ~0U)
- AddLiteralString("$"); // "$$" -> $
- LastEmitted = DollarPos+2;
- } else {
- // Get the name of the variable.
- std::string::size_type VarEnd = DollarPos+1;
-
- // handle ${foo}bar as $foo by detecting whether the character following
- // the dollar sign is a curly brace. If so, advance VarEnd and DollarPos
- // so the variable name does not contain the leading curly brace.
- bool hasCurlyBraces = false;
- if (VarEnd < AsmString.size() && '{' == AsmString[VarEnd]) {
- hasCurlyBraces = true;
- ++DollarPos;
- ++VarEnd;
- }
-
- while (VarEnd < AsmString.size() && isIdentChar(AsmString[VarEnd]))
- ++VarEnd;
- std::string VarName(AsmString.begin()+DollarPos+1,
- AsmString.begin()+VarEnd);
-
- // Modifier - Support ${foo:modifier} syntax, where "modifier" is passed
- // into printOperand. Also support ${:feature}, which is passed into
- // PrintSpecial.
- std::string Modifier;
-
- // In order to avoid starting the next string at the terminating curly
- // brace, advance the end position past it if we found an opening curly
- // brace.
- if (hasCurlyBraces) {
- if (VarEnd >= AsmString.size())
- throw "Reached end of string before terminating curly brace in '"
- + CGI.TheDef->getName() + "'";
-
- // Look for a modifier string.
- if (AsmString[VarEnd] == ':') {
- ++VarEnd;
- if (VarEnd >= AsmString.size())
- throw "Reached end of string before terminating curly brace in '"
- + CGI.TheDef->getName() + "'";
-
- unsigned ModifierStart = VarEnd;
- while (VarEnd < AsmString.size() && isIdentChar(AsmString[VarEnd]))
- ++VarEnd;
- Modifier = std::string(AsmString.begin()+ModifierStart,
- AsmString.begin()+VarEnd);
- if (Modifier.empty())
- throw "Bad operand modifier name in '"+ CGI.TheDef->getName() + "'";
- }
-
- if (AsmString[VarEnd] != '}')
- throw "Variable name beginning with '{' did not end with '}' in '"
- + CGI.TheDef->getName() + "'";
- ++VarEnd;
- }
- if (VarName.empty() && Modifier.empty())
- throw "Stray '$' in '" + CGI.TheDef->getName() +
- "' asm string, maybe you want $$?";
-
- if (VarName.empty()) {
- // Just a modifier, pass this into PrintSpecial.
- Operands.push_back(AsmWriterOperand("PrintSpecial", ~0U, Modifier));
- } else {
- // Otherwise, normal operand.
- unsigned OpNo = CGI.getOperandNamed(VarName);
- CodeGenInstruction::OperandInfo OpInfo = CGI.OperandList[OpNo];
-
- if (CurVariant == Variant || CurVariant == ~0U) {
- unsigned MIOp = OpInfo.MIOperandNo;
- Operands.push_back(AsmWriterOperand(OpInfo.PrinterMethodName, MIOp,
- Modifier));
- }
- }
- LastEmitted = VarEnd;
- }
- }
-
- AddLiteralString("\\n");
-}
-
-/// MatchesAllButOneOp - If this instruction is exactly identical to the
-/// specified instruction except for one differing operand, return the differing
-/// operand number. If more than one operand mismatches, return ~1, otherwise
-/// if the instructions are identical return ~0.
-unsigned AsmWriterInst::MatchesAllButOneOp(const AsmWriterInst &Other)const{
- if (Operands.size() != Other.Operands.size()) return ~1;
-
- unsigned MismatchOperand = ~0U;
- for (unsigned i = 0, e = Operands.size(); i != e; ++i) {
- if (Operands[i] != Other.Operands[i]) {
- if (MismatchOperand != ~0U) // Already have one mismatch?
- return ~1U;
- else
- MismatchOperand = i;
- }
- }
- return MismatchOperand;
-}
-
-static void PrintCases(std::vector<std::pair<std::string,
- AsmWriterOperand> > &OpsToPrint, std::ostream &O) {
- O << " case " << OpsToPrint.back().first << ": ";
- AsmWriterOperand TheOp = OpsToPrint.back().second;
- OpsToPrint.pop_back();
-
- // Check to see if any other operands are identical in this list, and if so,
- // emit a case label for them.
- for (unsigned i = OpsToPrint.size(); i != 0; --i)
- if (OpsToPrint[i-1].second == TheOp) {
- O << "\n case " << OpsToPrint[i-1].first << ": ";
- OpsToPrint.erase(OpsToPrint.begin()+i-1);
- }
-
- // Finally, emit the code.
- O << TheOp.getCode();
- O << "break;\n";
-}
-
-
-/// EmitInstructions - Emit the last instruction in the vector and any other
-/// instructions that are suitably similar to it.
-static void EmitInstructions(std::vector<AsmWriterInst> &Insts,
- std::ostream &O) {
- AsmWriterInst FirstInst = Insts.back();
- Insts.pop_back();
-
- std::vector<AsmWriterInst> SimilarInsts;
- unsigned DifferingOperand = ~0;
- for (unsigned i = Insts.size(); i != 0; --i) {
- unsigned DiffOp = Insts[i-1].MatchesAllButOneOp(FirstInst);
- if (DiffOp != ~1U) {
- if (DifferingOperand == ~0U) // First match!
- DifferingOperand = DiffOp;
-
- // If this differs in the same operand as the rest of the instructions in
- // this class, move it to the SimilarInsts list.
- if (DifferingOperand == DiffOp || DiffOp == ~0U) {
- SimilarInsts.push_back(Insts[i-1]);
- Insts.erase(Insts.begin()+i-1);
- }
- }
- }
-
- O << " case " << FirstInst.CGI->Namespace << "::"
- << FirstInst.CGI->TheDef->getName() << ":\n";
- for (unsigned i = 0, e = SimilarInsts.size(); i != e; ++i)
- O << " case " << SimilarInsts[i].CGI->Namespace << "::"
- << SimilarInsts[i].CGI->TheDef->getName() << ":\n";
- for (unsigned i = 0, e = FirstInst.Operands.size(); i != e; ++i) {
- if (i != DifferingOperand) {
- // If the operand is the same for all instructions, just print it.
- O << " " << FirstInst.Operands[i].getCode();
- } else {
- // If this is the operand that varies between all of the instructions,
- // emit a switch for just this operand now.
- O << " switch (MI->getOpcode()) {\n";
- std::vector<std::pair<std::string, AsmWriterOperand> > OpsToPrint;
- OpsToPrint.push_back(std::make_pair(FirstInst.CGI->Namespace + "::" +
- FirstInst.CGI->TheDef->getName(),
- FirstInst.Operands[i]));
-
- for (unsigned si = 0, e = SimilarInsts.size(); si != e; ++si) {
- AsmWriterInst &AWI = SimilarInsts[si];
- OpsToPrint.push_back(std::make_pair(AWI.CGI->Namespace+"::"+
- AWI.CGI->TheDef->getName(),
- AWI.Operands[i]));
- }
- std::reverse(OpsToPrint.begin(), OpsToPrint.end());
- while (!OpsToPrint.empty())
- PrintCases(OpsToPrint, O);
- O << " }";
- }
- O << "\n";
- }
-
- O << " break;\n";
-}
-
-void AsmWriterEmitter::
-FindUniqueOperandCommands(std::vector<std::string> &UniqueOperandCommands,
- std::vector<unsigned> &InstIdxs,
- std::vector<unsigned> &InstOpsUsed) const {
- InstIdxs.assign(NumberedInstructions.size(), ~0U);
-
- // This vector parallels UniqueOperandCommands, keeping track of which
- // instructions each case are used for. It is a comma separated string of
- // enums.
- std::vector<std::string> InstrsForCase;
- InstrsForCase.resize(UniqueOperandCommands.size());
- InstOpsUsed.assign(UniqueOperandCommands.size(), 0);
-
- for (unsigned i = 0, e = NumberedInstructions.size(); i != e; ++i) {
- const AsmWriterInst *Inst = getAsmWriterInstByID(i);
- if (Inst == 0) continue; // PHI, INLINEASM, LABEL, etc.
-
- std::string Command;
- if (Inst->Operands.empty())
- continue; // Instruction already done.
-
- Command = " " + Inst->Operands[0].getCode() + "\n";
-
- // If this is the last operand, emit a return.
- if (Inst->Operands.size() == 1)
- Command += " return true;\n";
-
- // Check to see if we already have 'Command' in UniqueOperandCommands.
- // If not, add it.
- bool FoundIt = false;
- for (unsigned idx = 0, e = UniqueOperandCommands.size(); idx != e; ++idx)
- if (UniqueOperandCommands[idx] == Command) {
- InstIdxs[i] = idx;
- InstrsForCase[idx] += ", ";
- InstrsForCase[idx] += Inst->CGI->TheDef->getName();
- FoundIt = true;
- break;
- }
- if (!FoundIt) {
- InstIdxs[i] = UniqueOperandCommands.size();
- UniqueOperandCommands.push_back(Command);
- InstrsForCase.push_back(Inst->CGI->TheDef->getName());
-
- // This command matches one operand so far.
- InstOpsUsed.push_back(1);
- }
- }
-
- // For each entry of UniqueOperandCommands, there is a set of instructions
- // that uses it. If the next command of all instructions in the set are
- // identical, fold it into the command.
- for (unsigned CommandIdx = 0, e = UniqueOperandCommands.size();
- CommandIdx != e; ++CommandIdx) {
-
- for (unsigned Op = 1; ; ++Op) {
- // Scan for the first instruction in the set.
- std::vector<unsigned>::iterator NIT =
- std::find(InstIdxs.begin(), InstIdxs.end(), CommandIdx);
- if (NIT == InstIdxs.end()) break; // No commonality.
-
- // If this instruction has no more operands, we isn't anything to merge
- // into this command.
- const AsmWriterInst *FirstInst =
- getAsmWriterInstByID(NIT-InstIdxs.begin());
- if (!FirstInst || FirstInst->Operands.size() == Op)
- break;
-
- // Otherwise, scan to see if all of the other instructions in this command
- // set share the operand.
- bool AllSame = true;
-
- for (NIT = std::find(NIT+1, InstIdxs.end(), CommandIdx);
- NIT != InstIdxs.end();
- NIT = std::find(NIT+1, InstIdxs.end(), CommandIdx)) {
- // Okay, found another instruction in this command set. If the operand
- // matches, we're ok, otherwise bail out.
- const AsmWriterInst *OtherInst =
- getAsmWriterInstByID(NIT-InstIdxs.begin());
- if (!OtherInst || OtherInst->Operands.size() == Op ||
- OtherInst->Operands[Op] != FirstInst->Operands[Op]) {
- AllSame = false;
- break;
- }
- }
- if (!AllSame) break;
-
- // Okay, everything in this command set has the same next operand. Add it
- // to UniqueOperandCommands and remember that it was consumed.
- std::string Command = " " + FirstInst->Operands[Op].getCode() + "\n";
-
- // If this is the last operand, emit a return after the code.
- if (FirstInst->Operands.size() == Op+1)
- Command += " return true;\n";
-
- UniqueOperandCommands[CommandIdx] += Command;
- InstOpsUsed[CommandIdx]++;
- }
- }
-
- // Prepend some of the instructions each case is used for onto the case val.
- for (unsigned i = 0, e = InstrsForCase.size(); i != e; ++i) {
- std::string Instrs = InstrsForCase[i];
- if (Instrs.size() > 70) {
- Instrs.erase(Instrs.begin()+70, Instrs.end());
- Instrs += "...";
- }
-
- if (!Instrs.empty())
- UniqueOperandCommands[i] = " // " + Instrs + "\n" +
- UniqueOperandCommands[i];
- }
-}
-
-
-
-void AsmWriterEmitter::run(std::ostream &O) {
- EmitSourceFileHeader("Assembly Writer Source Fragment", O);
-
- CodeGenTarget Target;
- Record *AsmWriter = Target.getAsmWriter();
- std::string ClassName = AsmWriter->getValueAsString("AsmWriterClassName");
- unsigned Variant = AsmWriter->getValueAsInt("Variant");
-
- O <<
- "/// printInstruction - This method is automatically generated by tablegen\n"
- "/// from the instruction set description. This method returns true if the\n"
- "/// machine instruction was sufficiently described to print it, otherwise\n"
- "/// it returns false.\n"
- "bool " << Target.getName() << ClassName
- << "::printInstruction(const MachineInstr *MI) {\n";
-
- std::vector<AsmWriterInst> Instructions;
-
- for (CodeGenTarget::inst_iterator I = Target.inst_begin(),
- E = Target.inst_end(); I != E; ++I)
- if (!I->second.AsmString.empty())
- Instructions.push_back(AsmWriterInst(I->second, Variant));
-
- // Get the instruction numbering.
- Target.getInstructionsByEnumValue(NumberedInstructions);
-
- // Compute the CodeGenInstruction -> AsmWriterInst mapping. Note that not
- // all machine instructions are necessarily being printed, so there may be
- // target instructions not in this map.
- for (unsigned i = 0, e = Instructions.size(); i != e; ++i)
- CGIAWIMap.insert(std::make_pair(Instructions[i].CGI, &Instructions[i]));
-
- // Build an aggregate string, and build a table of offsets into it.
- std::map<std::string, unsigned> StringOffset;
- std::string AggregateString;
- AggregateString.push_back(0); // "\0"
- AggregateString.push_back(0); // "\0"
-
- /// OpcodeInfo - This encodes the index of the string to use for the first
- /// chunk of the output as well as indices used for operand printing.
- std::vector<unsigned> OpcodeInfo;
-
- unsigned MaxStringIdx = 0;
- for (unsigned i = 0, e = NumberedInstructions.size(); i != e; ++i) {
- AsmWriterInst *AWI = CGIAWIMap[NumberedInstructions[i]];
- unsigned Idx;
- if (AWI == 0) {
- // Something not handled by the asmwriter printer.
- Idx = 0;
- } else if (AWI->Operands[0].OperandType !=
- AsmWriterOperand::isLiteralTextOperand ||
- AWI->Operands[0].Str.empty()) {
- // Something handled by the asmwriter printer, but with no leading string.
- Idx = 1;
- } else {
- unsigned &Entry = StringOffset[AWI->Operands[0].Str];
- if (Entry == 0) {
- // Add the string to the aggregate if this is the first time found.
- MaxStringIdx = Entry = AggregateString.size();
- std::string Str = AWI->Operands[0].Str;
- UnescapeString(Str);
- AggregateString += Str;
- AggregateString += '\0';
- }
- Idx = Entry;
-
- // Nuke the string from the operand list. It is now handled!
- AWI->Operands.erase(AWI->Operands.begin());
- }
- OpcodeInfo.push_back(Idx);
- }
-
- // Figure out how many bits we used for the string index.
- unsigned AsmStrBits = Log2_32_Ceil(MaxStringIdx+1);
-
- // To reduce code size, we compactify common instructions into a few bits
- // in the opcode-indexed table.
- unsigned BitsLeft = 32-AsmStrBits;
-
- std::vector<std::vector<std::string> > TableDrivenOperandPrinters;
-
- bool isFirst = true;
- while (1) {
- std::vector<std::string> UniqueOperandCommands;
-
- // For the first operand check, add a default value for instructions with
- // just opcode strings to use.
- if (isFirst) {
- UniqueOperandCommands.push_back(" return true;\n");
- isFirst = false;
- }
-
- std::vector<unsigned> InstIdxs;
- std::vector<unsigned> NumInstOpsHandled;
- FindUniqueOperandCommands(UniqueOperandCommands, InstIdxs,
- NumInstOpsHandled);
-
- // If we ran out of operands to print, we're done.
- if (UniqueOperandCommands.empty()) break;
-
- // Compute the number of bits we need to represent these cases, this is
- // ceil(log2(numentries)).
- unsigned NumBits = Log2_32_Ceil(UniqueOperandCommands.size());
-
- // If we don't have enough bits for this operand, don't include it.
- if (NumBits > BitsLeft) {
- DOUT << "Not enough bits to densely encode " << NumBits
- << " more bits\n";
- break;
- }
-
- // Otherwise, we can include this in the initial lookup table. Add it in.
- BitsLeft -= NumBits;
- for (unsigned i = 0, e = InstIdxs.size(); i != e; ++i)
- if (InstIdxs[i] != ~0U)
- OpcodeInfo[i] |= InstIdxs[i] << (BitsLeft+AsmStrBits);
-
- // Remove the info about this operand.
- for (unsigned i = 0, e = NumberedInstructions.size(); i != e; ++i) {
- if (AsmWriterInst *Inst = getAsmWriterInstByID(i))
- if (!Inst->Operands.empty()) {
- unsigned NumOps = NumInstOpsHandled[InstIdxs[i]];
- assert(NumOps <= Inst->Operands.size() &&
- "Can't remove this many ops!");
- Inst->Operands.erase(Inst->Operands.begin(),
- Inst->Operands.begin()+NumOps);
- }
- }
-
- // Remember the handlers for this set of operands.
- TableDrivenOperandPrinters.push_back(UniqueOperandCommands);
- }
-
-
-
- O<<" static const unsigned OpInfo[] = {\n";
- for (unsigned i = 0, e = NumberedInstructions.size(); i != e; ++i) {
- O << " " << OpcodeInfo[i] << "U,\t// "
- << NumberedInstructions[i]->TheDef->getName() << "\n";
- }
- // Add a dummy entry so the array init doesn't end with a comma.
- O << " 0U\n";
- O << " };\n\n";
-
- // Emit the string itself.
- O << " const char *AsmStrs = \n \"";
- unsigned CharsPrinted = 0;
- EscapeString(AggregateString);
- for (unsigned i = 0, e = AggregateString.size(); i != e; ++i) {
- if (CharsPrinted > 70) {
- O << "\"\n \"";
- CharsPrinted = 0;
- }
- O << AggregateString[i];
- ++CharsPrinted;
-
- // Print escape sequences all together.
- if (AggregateString[i] == '\\') {
- assert(i+1 < AggregateString.size() && "Incomplete escape sequence!");
- if (isdigit(AggregateString[i+1])) {
- assert(isdigit(AggregateString[i+2]) && isdigit(AggregateString[i+3]) &&
- "Expected 3 digit octal escape!");
- O << AggregateString[++i];
- O << AggregateString[++i];
- O << AggregateString[++i];
- CharsPrinted += 3;
- } else {
- O << AggregateString[++i];
- ++CharsPrinted;
- }
- }
- }
- O << "\";\n\n";
-
- O << " if (MI->getOpcode() == TargetInstrInfo::INLINEASM) {\n"
- << " O << \"\\t\";\n"
- << " printInlineAsm(MI);\n"
- << " return true;\n"
- << " } else if (MI->getOpcode() == TargetInstrInfo::LABEL) {\n"
- << " printLabel(MI);\n"
- << " return true;\n"
- << " } else if (MI->getOpcode() == TargetInstrInfo::DECLARE) {\n"
- << " printDeclare(MI);\n"
- << " return true;\n"
- << " } else if (MI->getOpcode() == TargetInstrInfo::IMPLICIT_DEF) {\n"
- << " printImplicitDef(MI);\n"
- << " return true;\n"
- << " }\n\n";
-
- O << " O << \"\\t\";\n\n";
-
- O << " // Emit the opcode for the instruction.\n"
- << " unsigned Bits = OpInfo[MI->getOpcode()];\n"
- << " if (Bits == 0) return false;\n"
- << " O << AsmStrs+(Bits & " << (1 << AsmStrBits)-1 << ");\n\n";
-
- // Output the table driven operand information.
- BitsLeft = 32-AsmStrBits;
- for (unsigned i = 0, e = TableDrivenOperandPrinters.size(); i != e; ++i) {
- std::vector<std::string> &Commands = TableDrivenOperandPrinters[i];
-
- // Compute the number of bits we need to represent these cases, this is
- // ceil(log2(numentries)).
- unsigned NumBits = Log2_32_Ceil(Commands.size());
- assert(NumBits <= BitsLeft && "consistency error");
-
- // Emit code to extract this field from Bits.
- BitsLeft -= NumBits;
-
- O << "\n // Fragment " << i << " encoded into " << NumBits
- << " bits for " << Commands.size() << " unique commands.\n";
-
- if (Commands.size() == 2) {
- // Emit two possibilitys with if/else.
- O << " if ((Bits >> " << (BitsLeft+AsmStrBits) << ") & "
- << ((1 << NumBits)-1) << ") {\n"
- << Commands[1]
- << " } else {\n"
- << Commands[0]
- << " }\n\n";
- } else {
- O << " switch ((Bits >> " << (BitsLeft+AsmStrBits) << ") & "
- << ((1 << NumBits)-1) << ") {\n"
- << " default: // unreachable.\n";
-
- // Print out all the cases.
- for (unsigned i = 0, e = Commands.size(); i != e; ++i) {
- O << " case " << i << ":\n";
- O << Commands[i];
- O << " break;\n";
- }
- O << " }\n\n";
- }
- }
-
- // Okay, delete instructions with no operand info left.
- for (unsigned i = 0, e = Instructions.size(); i != e; ++i) {
- // Entire instruction has been emitted?
- AsmWriterInst &Inst = Instructions[i];
- if (Inst.Operands.empty()) {
- Instructions.erase(Instructions.begin()+i);
- --i; --e;
- }
- }
-
-
- // Because this is a vector, we want to emit from the end. Reverse all of the
- // elements in the vector.
- std::reverse(Instructions.begin(), Instructions.end());
-
- if (!Instructions.empty()) {
- // Find the opcode # of inline asm.
- O << " switch (MI->getOpcode()) {\n";
- while (!Instructions.empty())
- EmitInstructions(Instructions, O);
-
- O << " }\n";
- O << " return true;\n";
- }
-
- O << "}\n";
-}
diff --git a/release_23/utils/TableGen/AsmWriterEmitter.h b/release_23/utils/TableGen/AsmWriterEmitter.h
deleted file mode 100644
index 302722d6df06..000000000000
--- a/release_23/utils/TableGen/AsmWriterEmitter.h
+++ /dev/null
@@ -1,50 +0,0 @@
-//===- AsmWriterEmitter.h - Generate an assembly writer ---------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This tablegen backend is responsible for emitting an assembly printer for the
-// code generator.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef ASMWRITER_EMITTER_H
-#define ASMWRITER_EMITTER_H
-
-#include "TableGenBackend.h"
-#include <map>
-#include <vector>
-#include <cassert>
-
-namespace llvm {
- class AsmWriterInst;
- class CodeGenInstruction;
-
- class AsmWriterEmitter : public TableGenBackend {
- RecordKeeper &Records;
- std::map<const CodeGenInstruction*, AsmWriterInst*> CGIAWIMap;
- std::vector<const CodeGenInstruction*> NumberedInstructions;
- public:
- AsmWriterEmitter(RecordKeeper &R) : Records(R) {}
-
- // run - Output the asmwriter, returning true on failure.
- void run(std::ostream &o);
-
-private:
- AsmWriterInst *getAsmWriterInstByID(unsigned ID) const {
- assert(ID < NumberedInstructions.size());
- std::map<const CodeGenInstruction*, AsmWriterInst*>::const_iterator I =
- CGIAWIMap.find(NumberedInstructions[ID]);
- assert(I != CGIAWIMap.end() && "Didn't find inst!");
- return I->second;
- }
- void FindUniqueOperandCommands(std::vector<std::string> &UOC,
- std::vector<unsigned> &InstIdxs,
- std::vector<unsigned> &InstOpsUsed) const;
- };
-}
-#endif
diff --git a/release_23/utils/TableGen/CallingConvEmitter.cpp b/release_23/utils/TableGen/CallingConvEmitter.cpp
deleted file mode 100644
index a211b6aecca9..000000000000
--- a/release_23/utils/TableGen/CallingConvEmitter.cpp
+++ /dev/null
@@ -1,197 +0,0 @@
-//===- CallingConvEmitter.cpp - Generate calling conventions --------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This tablegen backend is responsible for emitting descriptions of the calling
-// conventions supported by this target.
-//
-//===----------------------------------------------------------------------===//
-
-#include "CallingConvEmitter.h"
-#include "Record.h"
-#include "CodeGenTarget.h"
-using namespace llvm;
-
-void CallingConvEmitter::run(std::ostream &O) {
- EmitSourceFileHeader("Calling Convention Implementation Fragment", O);
-
- std::vector<Record*> CCs = Records.getAllDerivedDefinitions("CallingConv");
-
- // Emit prototypes for all of the CC's so that they can forward ref each
- // other.
- for (unsigned i = 0, e = CCs.size(); i != e; ++i) {
- O << "static bool " << CCs[i]->getName()
- << "(unsigned ValNo, MVT::ValueType ValVT,\n"
- << std::string(CCs[i]->getName().size()+13, ' ')
- << "MVT::ValueType LocVT, CCValAssign::LocInfo LocInfo,\n"
- << std::string(CCs[i]->getName().size()+13, ' ')
- << "ISD::ArgFlagsTy ArgFlags, CCState &State);\n";
- }
-
- // Emit each calling convention description in full.
- for (unsigned i = 0, e = CCs.size(); i != e; ++i)
- EmitCallingConv(CCs[i], O);
-}
-
-
-void CallingConvEmitter::EmitCallingConv(Record *CC, std::ostream &O) {
- ListInit *CCActions = CC->getValueAsListInit("Actions");
- Counter = 0;
-
- O << "\n\nstatic bool " << CC->getName()
- << "(unsigned ValNo, MVT::ValueType ValVT,\n"
- << std::string(CC->getName().size()+13, ' ')
- << "MVT::ValueType LocVT, CCValAssign::LocInfo LocInfo,\n"
- << std::string(CC->getName().size()+13, ' ')
- << "ISD::ArgFlagsTy ArgFlags, CCState &State) {\n";
- // Emit all of the actions, in order.
- for (unsigned i = 0, e = CCActions->getSize(); i != e; ++i) {
- O << "\n";
- EmitAction(CCActions->getElementAsRecord(i), 2, O);
- }
-
- O << "\n return true; // CC didn't match.\n";
- O << "}\n";
-}
-
-void CallingConvEmitter::EmitAction(Record *Action,
- unsigned Indent, std::ostream &O) {
- std::string IndentStr = std::string(Indent, ' ');
-
- if (Action->isSubClassOf("CCPredicateAction")) {
- O << IndentStr << "if (";
-
- if (Action->isSubClassOf("CCIfType")) {
- ListInit *VTs = Action->getValueAsListInit("VTs");
- for (unsigned i = 0, e = VTs->getSize(); i != e; ++i) {
- Record *VT = VTs->getElementAsRecord(i);
- if (i != 0) O << " ||\n " << IndentStr;
- O << "LocVT == " << getEnumName(getValueType(VT));
- }
-
- } else if (Action->isSubClassOf("CCIf")) {
- O << Action->getValueAsString("Predicate");
- } else {
- Action->dump();
- throw "Unknown CCPredicateAction!";
- }
-
- O << ") {\n";
- EmitAction(Action->getValueAsDef("SubAction"), Indent+2, O);
- O << IndentStr << "}\n";
- } else {
- if (Action->isSubClassOf("CCDelegateTo")) {
- Record *CC = Action->getValueAsDef("CC");
- O << IndentStr << "if (!" << CC->getName()
- << "(ValNo, ValVT, LocVT, LocInfo, ArgFlags, State))\n"
- << IndentStr << " return false;\n";
- } else if (Action->isSubClassOf("CCAssignToReg")) {
- ListInit *RegList = Action->getValueAsListInit("RegList");
- if (RegList->getSize() == 1) {
- O << IndentStr << "if (unsigned Reg = State.AllocateReg(";
- O << getQualifiedName(RegList->getElementAsRecord(0)) << ")) {\n";
- } else {
- O << IndentStr << "static const unsigned RegList" << ++Counter
- << "[] = {\n";
- O << IndentStr << " ";
- for (unsigned i = 0, e = RegList->getSize(); i != e; ++i) {
- if (i != 0) O << ", ";
- O << getQualifiedName(RegList->getElementAsRecord(i));
- }
- O << "\n" << IndentStr << "};\n";
- O << IndentStr << "if (unsigned Reg = State.AllocateReg(RegList"
- << Counter << ", " << RegList->getSize() << ")) {\n";
- }
- O << IndentStr << " State.addLoc(CCValAssign::getReg(ValNo, ValVT, "
- << "Reg, LocVT, LocInfo));\n";
- O << IndentStr << " return false;\n";
- O << IndentStr << "}\n";
- } else if (Action->isSubClassOf("CCAssignToRegWithShadow")) {
- ListInit *RegList = Action->getValueAsListInit("RegList");
- ListInit *ShadowRegList = Action->getValueAsListInit("ShadowRegList");
- if (ShadowRegList->getSize() >0 &&
- ShadowRegList->getSize() != RegList->getSize())
- throw "Invalid length of list of shadowed registers";
-
- if (RegList->getSize() == 1) {
- O << IndentStr << "if (unsigned Reg = State.AllocateReg(";
- O << getQualifiedName(RegList->getElementAsRecord(0));
- O << ", " << getQualifiedName(ShadowRegList->getElementAsRecord(0));
- O << ")) {\n";
- } else {
- unsigned RegListNumber = ++Counter;
- unsigned ShadowRegListNumber = ++Counter;
-
- O << IndentStr << "static const unsigned RegList" << RegListNumber
- << "[] = {\n";
- O << IndentStr << " ";
- for (unsigned i = 0, e = RegList->getSize(); i != e; ++i) {
- if (i != 0) O << ", ";
- O << getQualifiedName(RegList->getElementAsRecord(i));
- }
- O << "\n" << IndentStr << "};\n";
-
- O << IndentStr << "static const unsigned RegList"
- << ShadowRegListNumber << "[] = {\n";
- O << IndentStr << " ";
- for (unsigned i = 0, e = ShadowRegList->getSize(); i != e; ++i) {
- if (i != 0) O << ", ";
- O << getQualifiedName(ShadowRegList->getElementAsRecord(i));
- }
- O << "\n" << IndentStr << "};\n";
-
- O << IndentStr << "if (unsigned Reg = State.AllocateReg(RegList"
- << RegListNumber << ", " << "RegList" << ShadowRegListNumber
- << ", " << RegList->getSize() << ")) {\n";
- }
- O << IndentStr << " State.addLoc(CCValAssign::getReg(ValNo, ValVT, "
- << "Reg, LocVT, LocInfo));\n";
- O << IndentStr << " return false;\n";
- O << IndentStr << "}\n";
- } else if (Action->isSubClassOf("CCAssignToStack")) {
- int Size = Action->getValueAsInt("Size");
- int Align = Action->getValueAsInt("Align");
-
- O << IndentStr << "unsigned Offset" << ++Counter
- << " = State.AllocateStack(";
- if (Size)
- O << Size << ", ";
- else
- O << "\n" << IndentStr << " State.getTarget().getTargetData()"
- "->getABITypeSize(MVT::getTypeForValueType(LocVT)), ";
- if (Align)
- O << Align;
- else
- O << "\n" << IndentStr << " State.getTarget().getTargetData()"
- "->getABITypeAlignment(MVT::getTypeForValueType(LocVT))";
- O << ");\n" << IndentStr
- << "State.addLoc(CCValAssign::getMem(ValNo, ValVT, Offset"
- << Counter << ", LocVT, LocInfo));\n";
- O << IndentStr << "return false;\n";
- } else if (Action->isSubClassOf("CCPromoteToType")) {
- Record *DestTy = Action->getValueAsDef("DestTy");
- O << IndentStr << "LocVT = " << getEnumName(getValueType(DestTy)) <<";\n";
- O << IndentStr << "if (ArgFlags.isSExt())\n"
- << IndentStr << IndentStr << "LocInfo = CCValAssign::SExt;\n"
- << IndentStr << "else if (ArgFlags.isZExt())\n"
- << IndentStr << IndentStr << "LocInfo = CCValAssign::ZExt;\n"
- << IndentStr << "else\n"
- << IndentStr << IndentStr << "LocInfo = CCValAssign::AExt;\n";
- } else if (Action->isSubClassOf("CCPassByVal")) {
- int Size = Action->getValueAsInt("Size");
- int Align = Action->getValueAsInt("Align");
- O << IndentStr
- << "State.HandleByVal(ValNo, ValVT, LocVT, LocInfo, "
- << Size << ", " << Align << ", ArgFlags);\n";
- O << IndentStr << "return false;\n";
- } else {
- Action->dump();
- throw "Unknown CCAction!";
- }
- }
-}
diff --git a/release_23/utils/TableGen/CallingConvEmitter.h b/release_23/utils/TableGen/CallingConvEmitter.h
deleted file mode 100644
index ffd6a48c7ad6..000000000000
--- a/release_23/utils/TableGen/CallingConvEmitter.h
+++ /dev/null
@@ -1,38 +0,0 @@
-//===- CallingConvEmitter.h - Generate calling conventions ------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This tablegen backend is responsible for emitting descriptions of the calling
-// conventions supported by this target.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef CALLINGCONV_EMITTER_H
-#define CALLINGCONV_EMITTER_H
-
-#include "TableGenBackend.h"
-#include <map>
-#include <vector>
-#include <cassert>
-
-namespace llvm {
- class CallingConvEmitter : public TableGenBackend {
- RecordKeeper &Records;
- public:
- explicit CallingConvEmitter(RecordKeeper &R) : Records(R) {}
-
- // run - Output the asmwriter, returning true on failure.
- void run(std::ostream &o);
-
- private:
- void EmitCallingConv(Record *CC, std::ostream &O);
- void EmitAction(Record *Action, unsigned Indent, std::ostream &O);
- unsigned Counter;
- };
-}
-#endif
diff --git a/release_23/utils/TableGen/CodeEmitterGen.cpp b/release_23/utils/TableGen/CodeEmitterGen.cpp
deleted file mode 100644
index a21a31c2bfc1..000000000000
--- a/release_23/utils/TableGen/CodeEmitterGen.cpp
+++ /dev/null
@@ -1,243 +0,0 @@
-//===- CodeEmitterGen.cpp - Code Emitter Generator ------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// CodeEmitterGen uses the descriptions of instructions and their fields to
-// construct an automated code emitter: a function that, given a MachineInstr,
-// returns the (currently, 32-bit unsigned) value of the instruction.
-//
-//===----------------------------------------------------------------------===//
-
-#include "CodeEmitterGen.h"
-#include "CodeGenTarget.h"
-#include "Record.h"
-#include "llvm/ADT/StringExtras.h"
-#include "llvm/Support/Debug.h"
-using namespace llvm;
-
-void CodeEmitterGen::reverseBits(std::vector<Record*> &Insts) {
- for (std::vector<Record*>::iterator I = Insts.begin(), E = Insts.end();
- I != E; ++I) {
- Record *R = *I;
- if (R->getName() == "PHI" ||
- R->getName() == "INLINEASM" ||
- R->getName() == "LABEL" ||
- R->getName() == "DECLARE" ||
- R->getName() == "EXTRACT_SUBREG" ||
- R->getName() == "INSERT_SUBREG" ||
- R->getName() == "IMPLICIT_DEF" ||
- R->getName() == "SUBREG_TO_REG") continue;
-
- BitsInit *BI = R->getValueAsBitsInit("Inst");
-
- unsigned numBits = BI->getNumBits();
- BitsInit *NewBI = new BitsInit(numBits);
- for (unsigned bit = 0, end = numBits / 2; bit != end; ++bit) {
- unsigned bitSwapIdx = numBits - bit - 1;
- Init *OrigBit = BI->getBit(bit);
- Init *BitSwap = BI->getBit(bitSwapIdx);
- NewBI->setBit(bit, BitSwap);
- NewBI->setBit(bitSwapIdx, OrigBit);
- }
- if (numBits % 2) {
- unsigned middle = (numBits + 1) / 2;
- NewBI->setBit(middle, BI->getBit(middle));
- }
-
- // Update the bits in reversed order so that emitInstrOpBits will get the
- // correct endianness.
- R->getValue("Inst")->setValue(NewBI);
- }
-}
-
-
-// If the VarBitInit at position 'bit' matches the specified variable then
-// return the variable bit position. Otherwise return -1.
-int CodeEmitterGen::getVariableBit(const std::string &VarName,
- BitsInit *BI, int bit) {
- if (VarBitInit *VBI = dynamic_cast<VarBitInit*>(BI->getBit(bit))) {
- TypedInit *TI = VBI->getVariable();
-
- if (VarInit *VI = dynamic_cast<VarInit*>(TI)) {
- if (VI->getName() == VarName) return VBI->getBitNum();
- }
- }
-
- return -1;
-}
-
-
-void CodeEmitterGen::run(std::ostream &o) {
- CodeGenTarget Target;
- std::vector<Record*> Insts = Records.getAllDerivedDefinitions("Instruction");
-
- // For little-endian instruction bit encodings, reverse the bit order
- if (Target.isLittleEndianEncoding()) reverseBits(Insts);
-
- EmitSourceFileHeader("Machine Code Emitter", o);
- std::string Namespace = Insts[0]->getValueAsString("Namespace") + "::";
-
- std::vector<const CodeGenInstruction*> NumberedInstructions;
- Target.getInstructionsByEnumValue(NumberedInstructions);
-
- // Emit function declaration
- o << "unsigned " << Target.getName() << "CodeEmitter::"
- << "getBinaryCodeForInstr(MachineInstr &MI) {\n";
-
- // Emit instruction base values
- o << " static const unsigned InstBits[] = {\n";
- for (std::vector<const CodeGenInstruction*>::iterator
- IN = NumberedInstructions.begin(),
- EN = NumberedInstructions.end();
- IN != EN; ++IN) {
- const CodeGenInstruction *CGI = *IN;
- Record *R = CGI->TheDef;
-
- if (IN != NumberedInstructions.begin()) o << ",\n";
-
- if (R->getName() == "PHI" ||
- R->getName() == "INLINEASM" ||
- R->getName() == "LABEL" ||
- R->getName() == "DECLARE" ||
- R->getName() == "EXTRACT_SUBREG" ||
- R->getName() == "INSERT_SUBREG" ||
- R->getName() == "IMPLICIT_DEF" ||
- R->getName() == "SUBREG_TO_REG") {
- o << " 0U";
- continue;
- }
-
- BitsInit *BI = R->getValueAsBitsInit("Inst");
-
- // Start by filling in fixed values...
- unsigned Value = 0;
- for (unsigned i = 0, e = BI->getNumBits(); i != e; ++i) {
- if (BitInit *B = dynamic_cast<BitInit*>(BI->getBit(e-i-1))) {
- Value |= B->getValue() << (e-i-1);
- }
- }
- o << " " << Value << "U";
- }
- o << "\n };\n";
-
- // Map to accumulate all the cases.
- std::map<std::string, std::vector<std::string> > CaseMap;
-
- // Construct all cases statement for each opcode
- for (std::vector<Record*>::iterator IC = Insts.begin(), EC = Insts.end();
- IC != EC; ++IC) {
- Record *R = *IC;
- const std::string &InstName = R->getName();
- std::string Case("");
-
- if (InstName == "PHI" ||
- InstName == "INLINEASM" ||
- InstName == "LABEL"||
- InstName == "DECLARE"||
- InstName == "EXTRACT_SUBREG" ||
- InstName == "INSERT_SUBREG" ||
- InstName == "IMPLICIT_DEF" ||
- InstName == "SUBREG_TO_REG") continue;
-
- BitsInit *BI = R->getValueAsBitsInit("Inst");
- const std::vector<RecordVal> &Vals = R->getValues();
- CodeGenInstruction &CGI = Target.getInstruction(InstName);
-
- // Loop over all of the fields in the instruction, determining which are the
- // operands to the instruction.
- unsigned op = 0;
- for (unsigned i = 0, e = Vals.size(); i != e; ++i) {
- if (!Vals[i].getPrefix() && !Vals[i].getValue()->isComplete()) {
- // Is the operand continuous? If so, we can just mask and OR it in
- // instead of doing it bit-by-bit, saving a lot in runtime cost.
- const std::string &VarName = Vals[i].getName();
- bool gotOp = false;
-
- for (int bit = BI->getNumBits()-1; bit >= 0; ) {
- int varBit = getVariableBit(VarName, BI, bit);
-
- if (varBit == -1) {
- --bit;
- } else {
- int beginInstBit = bit;
- int beginVarBit = varBit;
- int N = 1;
-
- for (--bit; bit >= 0;) {
- varBit = getVariableBit(VarName, BI, bit);
- if (varBit == -1 || varBit != (beginVarBit - N)) break;
- ++N;
- --bit;
- }
-
- if (!gotOp) {
- /// If this operand is not supposed to be emitted by the generated
- /// emitter, skip it.
- while (CGI.isFlatOperandNotEmitted(op))
- ++op;
-
- Case += " // op: " + VarName + "\n"
- + " op = getMachineOpValue(MI, MI.getOperand("
- + utostr(op++) + "));\n";
- gotOp = true;
- }
-
- unsigned opMask = (1 << N) - 1;
- int opShift = beginVarBit - N + 1;
- opMask <<= opShift;
- opShift = beginInstBit - beginVarBit;
-
- if (opShift > 0) {
- Case += " Value |= (op & " + utostr(opMask) + "U) << "
- + itostr(opShift) + ";\n";
- } else if (opShift < 0) {
- Case += " Value |= (op & " + utostr(opMask) + "U) >> "
- + itostr(-opShift) + ";\n";
- } else {
- Case += " Value |= op & " + utostr(opMask) + "U;\n";
- }
- }
- }
- }
- }
-
- std::vector<std::string> &InstList = CaseMap[Case];
- InstList.push_back(InstName);
- }
-
-
- // Emit initial function code
- o << " const unsigned opcode = MI.getOpcode();\n"
- << " unsigned Value = InstBits[opcode];\n"
- << " unsigned op;\n"
- << " switch (opcode) {\n";
-
- // Emit each case statement
- std::map<std::string, std::vector<std::string> >::iterator IE, EE;
- for (IE = CaseMap.begin(), EE = CaseMap.end(); IE != EE; ++IE) {
- const std::string &Case = IE->first;
- std::vector<std::string> &InstList = IE->second;
-
- for (int i = 0, N = InstList.size(); i < N; i++) {
- if (i) o << "\n";
- o << " case " << Namespace << InstList[i] << ":";
- }
- o << " {\n";
- o << Case;
- o << " break;\n"
- << " }\n";
- }
-
- // Default case: unhandled opcode
- o << " default:\n"
- << " cerr << \"Not supported instr: \" << MI << \"\\n\";\n"
- << " abort();\n"
- << " }\n"
- << " return Value;\n"
- << "}\n\n";
-}
diff --git a/release_23/utils/TableGen/CodeEmitterGen.h b/release_23/utils/TableGen/CodeEmitterGen.h
deleted file mode 100644
index cb272bd56d25..000000000000
--- a/release_23/utils/TableGen/CodeEmitterGen.h
+++ /dev/null
@@ -1,43 +0,0 @@
-//===- CodeEmitterGen.h - Code Emitter Generator ----------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// FIXME: document
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef CODEMITTERGEN_H
-#define CODEMITTERGEN_H
-
-#include "TableGenBackend.h"
-#include <map>
-#include <vector>
-#include <string>
-
-namespace llvm {
-
-class RecordVal;
-class BitsInit;
-
-class CodeEmitterGen : public TableGenBackend {
- RecordKeeper &Records;
-public:
- CodeEmitterGen(RecordKeeper &R) : Records(R) {}
-
- // run - Output the code emitter
- void run(std::ostream &o);
-private:
- void emitMachineOpEmitter(std::ostream &o, const std::string &Namespace);
- void emitGetValueBit(std::ostream &o, const std::string &Namespace);
- void reverseBits(std::vector<Record*> &Insts);
- int getVariableBit(const std::string &VarName, BitsInit *BI, int bit);
-};
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/utils/TableGen/CodeGenDAGPatterns.cpp b/release_23/utils/TableGen/CodeGenDAGPatterns.cpp
deleted file mode 100644
index 8c46b35fa19f..000000000000
--- a/release_23/utils/TableGen/CodeGenDAGPatterns.cpp
+++ /dev/null
@@ -1,2322 +0,0 @@
-//===- CodeGenDAGPatterns.cpp - Read DAG patterns from .td file -----------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the CodeGenDAGPatterns class, which is used to read and
-// represent the patterns present in a .td file for instructions.
-//
-//===----------------------------------------------------------------------===//
-
-#include "CodeGenDAGPatterns.h"
-#include "Record.h"
-#include "llvm/ADT/StringExtras.h"
-#include "llvm/Support/Debug.h"
-#include "llvm/Support/Streams.h"
-#include <set>
-#include <algorithm>
-using namespace llvm;
-
-//===----------------------------------------------------------------------===//
-// Helpers for working with extended types.
-
-/// FilterVTs - Filter a list of VT's according to a predicate.
-///
-template<typename T>
-static std::vector<MVT::ValueType>
-FilterVTs(const std::vector<MVT::ValueType> &InVTs, T Filter) {
- std::vector<MVT::ValueType> Result;
- for (unsigned i = 0, e = InVTs.size(); i != e; ++i)
- if (Filter(InVTs[i]))
- Result.push_back(InVTs[i]);
- return Result;
-}
-
-template<typename T>
-static std::vector<unsigned char>
-FilterEVTs(const std::vector<unsigned char> &InVTs, T Filter) {
- std::vector<unsigned char> Result;
- for (unsigned i = 0, e = InVTs.size(); i != e; ++i)
- if (Filter((MVT::ValueType)InVTs[i]))
- Result.push_back(InVTs[i]);
- return Result;
-}
-
-static std::vector<unsigned char>
-ConvertVTs(const std::vector<MVT::ValueType> &InVTs) {
- std::vector<unsigned char> Result;
- for (unsigned i = 0, e = InVTs.size(); i != e; ++i)
- Result.push_back(InVTs[i]);
- return Result;
-}
-
-static bool LHSIsSubsetOfRHS(const std::vector<unsigned char> &LHS,
- const std::vector<unsigned char> &RHS) {
- if (LHS.size() > RHS.size()) return false;
- for (unsigned i = 0, e = LHS.size(); i != e; ++i)
- if (std::find(RHS.begin(), RHS.end(), LHS[i]) == RHS.end())
- return false;
- return true;
-}
-
-/// isExtIntegerVT - Return true if the specified extended value type vector
-/// contains isInt or an integer value type.
-namespace llvm {
-namespace MVT {
-bool isExtIntegerInVTs(const std::vector<unsigned char> &EVTs) {
- assert(!EVTs.empty() && "Cannot check for integer in empty ExtVT list!");
- return EVTs[0] == isInt || !(FilterEVTs(EVTs, isInteger).empty());
-}
-
-/// isExtFloatingPointVT - Return true if the specified extended value type
-/// vector contains isFP or a FP value type.
-bool isExtFloatingPointInVTs(const std::vector<unsigned char> &EVTs) {
- assert(!EVTs.empty() && "Cannot check for integer in empty ExtVT list!");
- return EVTs[0] == isFP || !(FilterEVTs(EVTs, isFloatingPoint).empty());
-}
-} // end namespace MVT.
-} // end namespace llvm.
-
-
-/// Dependent variable map for CodeGenDAGPattern variant generation
-typedef std::map<std::string, int> DepVarMap;
-
-/// Const iterator shorthand for DepVarMap
-typedef DepVarMap::const_iterator DepVarMap_citer;
-
-namespace {
-void FindDepVarsOf(TreePatternNode *N, DepVarMap &DepMap) {
- if (N->isLeaf()) {
- if (dynamic_cast<DefInit*>(N->getLeafValue()) != NULL) {
- DepMap[N->getName()]++;
- }
- } else {
- for (size_t i = 0, e = N->getNumChildren(); i != e; ++i)
- FindDepVarsOf(N->getChild(i), DepMap);
- }
-}
-
-//! Find dependent variables within child patterns
-/*!
- */
-void FindDepVars(TreePatternNode *N, MultipleUseVarSet &DepVars) {
- DepVarMap depcounts;
- FindDepVarsOf(N, depcounts);
- for (DepVarMap_citer i = depcounts.begin(); i != depcounts.end(); ++i) {
- if (i->second > 1) { // std::pair<std::string, int>
- DepVars.insert(i->first);
- }
- }
-}
-
-//! Dump the dependent variable set:
-void DumpDepVars(MultipleUseVarSet &DepVars) {
- if (DepVars.empty()) {
- DOUT << "<empty set>";
- } else {
- DOUT << "[ ";
- for (MultipleUseVarSet::const_iterator i = DepVars.begin(), e = DepVars.end();
- i != e; ++i) {
- DOUT << (*i) << " ";
- }
- DOUT << "]";
- }
-}
-}
-
-//===----------------------------------------------------------------------===//
-// SDTypeConstraint implementation
-//
-
-SDTypeConstraint::SDTypeConstraint(Record *R) {
- OperandNo = R->getValueAsInt("OperandNum");
-
- if (R->isSubClassOf("SDTCisVT")) {
- ConstraintType = SDTCisVT;
- x.SDTCisVT_Info.VT = getValueType(R->getValueAsDef("VT"));
- } else if (R->isSubClassOf("SDTCisPtrTy")) {
- ConstraintType = SDTCisPtrTy;
- } else if (R->isSubClassOf("SDTCisInt")) {
- ConstraintType = SDTCisInt;
- } else if (R->isSubClassOf("SDTCisFP")) {
- ConstraintType = SDTCisFP;
- } else if (R->isSubClassOf("SDTCisSameAs")) {
- ConstraintType = SDTCisSameAs;
- x.SDTCisSameAs_Info.OtherOperandNum = R->getValueAsInt("OtherOperandNum");
- } else if (R->isSubClassOf("SDTCisVTSmallerThanOp")) {
- ConstraintType = SDTCisVTSmallerThanOp;
- x.SDTCisVTSmallerThanOp_Info.OtherOperandNum =
- R->getValueAsInt("OtherOperandNum");
- } else if (R->isSubClassOf("SDTCisOpSmallerThanOp")) {
- ConstraintType = SDTCisOpSmallerThanOp;
- x.SDTCisOpSmallerThanOp_Info.BigOperandNum =
- R->getValueAsInt("BigOperandNum");
- } else if (R->isSubClassOf("SDTCisIntVectorOfSameSize")) {
- ConstraintType = SDTCisIntVectorOfSameSize;
- x.SDTCisIntVectorOfSameSize_Info.OtherOperandNum =
- R->getValueAsInt("OtherOpNum");
- } else if (R->isSubClassOf("SDTCisEltOfVec")) {
- ConstraintType = SDTCisEltOfVec;
- x.SDTCisEltOfVec_Info.OtherOperandNum =
- R->getValueAsInt("OtherOpNum");
- } else {
- cerr << "Unrecognized SDTypeConstraint '" << R->getName() << "'!\n";
- exit(1);
- }
-}
-
-/// getOperandNum - Return the node corresponding to operand #OpNo in tree
-/// N, which has NumResults results.
-TreePatternNode *SDTypeConstraint::getOperandNum(unsigned OpNo,
- TreePatternNode *N,
- unsigned NumResults) const {
- assert(NumResults <= 1 &&
- "We only work with nodes with zero or one result so far!");
-
- if (OpNo >= (NumResults + N->getNumChildren())) {
- cerr << "Invalid operand number " << OpNo << " ";
- N->dump();
- cerr << '\n';
- exit(1);
- }
-
- if (OpNo < NumResults)
- return N; // FIXME: need value #
- else
- return N->getChild(OpNo-NumResults);
-}
-
-/// ApplyTypeConstraint - Given a node in a pattern, apply this type
-/// constraint to the nodes operands. This returns true if it makes a
-/// change, false otherwise. If a type contradiction is found, throw an
-/// exception.
-bool SDTypeConstraint::ApplyTypeConstraint(TreePatternNode *N,
- const SDNodeInfo &NodeInfo,
- TreePattern &TP) const {
- unsigned NumResults = NodeInfo.getNumResults();
- assert(NumResults <= 1 &&
- "We only work with nodes with zero or one result so far!");
-
- // Check that the number of operands is sane. Negative operands -> varargs.
- if (NodeInfo.getNumOperands() >= 0) {
- if (N->getNumChildren() != (unsigned)NodeInfo.getNumOperands())
- TP.error(N->getOperator()->getName() + " node requires exactly " +
- itostr(NodeInfo.getNumOperands()) + " operands!");
- }
-
- const CodeGenTarget &CGT = TP.getDAGPatterns().getTargetInfo();
-
- TreePatternNode *NodeToApply = getOperandNum(OperandNo, N, NumResults);
-
- switch (ConstraintType) {
- default: assert(0 && "Unknown constraint type!");
- case SDTCisVT:
- // Operand must be a particular type.
- return NodeToApply->UpdateNodeType(x.SDTCisVT_Info.VT, TP);
- case SDTCisPtrTy: {
- // Operand must be same as target pointer type.
- return NodeToApply->UpdateNodeType(MVT::iPTR, TP);
- }
- case SDTCisInt: {
- // If there is only one integer type supported, this must be it.
- std::vector<MVT::ValueType> IntVTs =
- FilterVTs(CGT.getLegalValueTypes(), MVT::isInteger);
-
- // If we found exactly one supported integer type, apply it.
- if (IntVTs.size() == 1)
- return NodeToApply->UpdateNodeType(IntVTs[0], TP);
- return NodeToApply->UpdateNodeType(MVT::isInt, TP);
- }
- case SDTCisFP: {
- // If there is only one FP type supported, this must be it.
- std::vector<MVT::ValueType> FPVTs =
- FilterVTs(CGT.getLegalValueTypes(), MVT::isFloatingPoint);
-
- // If we found exactly one supported FP type, apply it.
- if (FPVTs.size() == 1)
- return NodeToApply->UpdateNodeType(FPVTs[0], TP);
- return NodeToApply->UpdateNodeType(MVT::isFP, TP);
- }
- case SDTCisSameAs: {
- TreePatternNode *OtherNode =
- getOperandNum(x.SDTCisSameAs_Info.OtherOperandNum, N, NumResults);
- return NodeToApply->UpdateNodeType(OtherNode->getExtTypes(), TP) |
- OtherNode->UpdateNodeType(NodeToApply->getExtTypes(), TP);
- }
- case SDTCisVTSmallerThanOp: {
- // The NodeToApply must be a leaf node that is a VT. OtherOperandNum must
- // have an integer type that is smaller than the VT.
- if (!NodeToApply->isLeaf() ||
- !dynamic_cast<DefInit*>(NodeToApply->getLeafValue()) ||
- !static_cast<DefInit*>(NodeToApply->getLeafValue())->getDef()
- ->isSubClassOf("ValueType"))
- TP.error(N->getOperator()->getName() + " expects a VT operand!");
- MVT::ValueType VT =
- getValueType(static_cast<DefInit*>(NodeToApply->getLeafValue())->getDef());
- if (!MVT::isInteger(VT))
- TP.error(N->getOperator()->getName() + " VT operand must be integer!");
-
- TreePatternNode *OtherNode =
- getOperandNum(x.SDTCisVTSmallerThanOp_Info.OtherOperandNum, N,NumResults);
-
- // It must be integer.
- bool MadeChange = false;
- MadeChange |= OtherNode->UpdateNodeType(MVT::isInt, TP);
-
- // This code only handles nodes that have one type set. Assert here so
- // that we can change this if we ever need to deal with multiple value
- // types at this point.
- assert(OtherNode->getExtTypes().size() == 1 && "Node has too many types!");
- if (OtherNode->hasTypeSet() && OtherNode->getTypeNum(0) <= VT)
- OtherNode->UpdateNodeType(MVT::Other, TP); // Throw an error.
- return false;
- }
- case SDTCisOpSmallerThanOp: {
- TreePatternNode *BigOperand =
- getOperandNum(x.SDTCisOpSmallerThanOp_Info.BigOperandNum, N, NumResults);
-
- // Both operands must be integer or FP, but we don't care which.
- bool MadeChange = false;
-
- // This code does not currently handle nodes which have multiple types,
- // where some types are integer, and some are fp. Assert that this is not
- // the case.
- assert(!(MVT::isExtIntegerInVTs(NodeToApply->getExtTypes()) &&
- MVT::isExtFloatingPointInVTs(NodeToApply->getExtTypes())) &&
- !(MVT::isExtIntegerInVTs(BigOperand->getExtTypes()) &&
- MVT::isExtFloatingPointInVTs(BigOperand->getExtTypes())) &&
- "SDTCisOpSmallerThanOp does not handle mixed int/fp types!");
- if (MVT::isExtIntegerInVTs(NodeToApply->getExtTypes()))
- MadeChange |= BigOperand->UpdateNodeType(MVT::isInt, TP);
- else if (MVT::isExtFloatingPointInVTs(NodeToApply->getExtTypes()))
- MadeChange |= BigOperand->UpdateNodeType(MVT::isFP, TP);
- if (MVT::isExtIntegerInVTs(BigOperand->getExtTypes()))
- MadeChange |= NodeToApply->UpdateNodeType(MVT::isInt, TP);
- else if (MVT::isExtFloatingPointInVTs(BigOperand->getExtTypes()))
- MadeChange |= NodeToApply->UpdateNodeType(MVT::isFP, TP);
-
- std::vector<MVT::ValueType> VTs = CGT.getLegalValueTypes();
-
- if (MVT::isExtIntegerInVTs(NodeToApply->getExtTypes())) {
- VTs = FilterVTs(VTs, MVT::isInteger);
- } else if (MVT::isExtFloatingPointInVTs(NodeToApply->getExtTypes())) {
- VTs = FilterVTs(VTs, MVT::isFloatingPoint);
- } else {
- VTs.clear();
- }
-
- switch (VTs.size()) {
- default: // Too many VT's to pick from.
- case 0: break; // No info yet.
- case 1:
- // Only one VT of this flavor. Cannot ever satisify the constraints.
- return NodeToApply->UpdateNodeType(MVT::Other, TP); // throw
- case 2:
- // If we have exactly two possible types, the little operand must be the
- // small one, the big operand should be the big one. Common with
- // float/double for example.
- assert(VTs[0] < VTs[1] && "Should be sorted!");
- MadeChange |= NodeToApply->UpdateNodeType(VTs[0], TP);
- MadeChange |= BigOperand->UpdateNodeType(VTs[1], TP);
- break;
- }
- return MadeChange;
- }
- case SDTCisIntVectorOfSameSize: {
- TreePatternNode *OtherOperand =
- getOperandNum(x.SDTCisIntVectorOfSameSize_Info.OtherOperandNum,
- N, NumResults);
- if (OtherOperand->hasTypeSet()) {
- if (!MVT::isVector(OtherOperand->getTypeNum(0)))
- TP.error(N->getOperator()->getName() + " VT operand must be a vector!");
- MVT::ValueType IVT = OtherOperand->getTypeNum(0);
- IVT = MVT::getIntVectorWithNumElements(MVT::getVectorNumElements(IVT));
- return NodeToApply->UpdateNodeType(IVT, TP);
- }
- return false;
- }
- case SDTCisEltOfVec: {
- TreePatternNode *OtherOperand =
- getOperandNum(x.SDTCisIntVectorOfSameSize_Info.OtherOperandNum,
- N, NumResults);
- if (OtherOperand->hasTypeSet()) {
- if (!MVT::isVector(OtherOperand->getTypeNum(0)))
- TP.error(N->getOperator()->getName() + " VT operand must be a vector!");
- MVT::ValueType IVT = OtherOperand->getTypeNum(0);
- IVT = MVT::getVectorElementType(IVT);
- return NodeToApply->UpdateNodeType(IVT, TP);
- }
- return false;
- }
- }
- return false;
-}
-
-//===----------------------------------------------------------------------===//
-// SDNodeInfo implementation
-//
-SDNodeInfo::SDNodeInfo(Record *R) : Def(R) {
- EnumName = R->getValueAsString("Opcode");
- SDClassName = R->getValueAsString("SDClass");
- Record *TypeProfile = R->getValueAsDef("TypeProfile");
- NumResults = TypeProfile->getValueAsInt("NumResults");
- NumOperands = TypeProfile->getValueAsInt("NumOperands");
-
- // Parse the properties.
- Properties = 0;
- std::vector<Record*> PropList = R->getValueAsListOfDefs("Properties");
- for (unsigned i = 0, e = PropList.size(); i != e; ++i) {
- if (PropList[i]->getName() == "SDNPCommutative") {
- Properties |= 1 << SDNPCommutative;
- } else if (PropList[i]->getName() == "SDNPAssociative") {
- Properties |= 1 << SDNPAssociative;
- } else if (PropList[i]->getName() == "SDNPHasChain") {
- Properties |= 1 << SDNPHasChain;
- } else if (PropList[i]->getName() == "SDNPOutFlag") {
- Properties |= 1 << SDNPOutFlag;
- } else if (PropList[i]->getName() == "SDNPInFlag") {
- Properties |= 1 << SDNPInFlag;
- } else if (PropList[i]->getName() == "SDNPOptInFlag") {
- Properties |= 1 << SDNPOptInFlag;
- } else if (PropList[i]->getName() == "SDNPMayStore") {
- Properties |= 1 << SDNPMayStore;
- } else if (PropList[i]->getName() == "SDNPMayLoad") {
- Properties |= 1 << SDNPMayLoad;
- } else if (PropList[i]->getName() == "SDNPSideEffect") {
- Properties |= 1 << SDNPSideEffect;
- } else {
- cerr << "Unknown SD Node property '" << PropList[i]->getName()
- << "' on node '" << R->getName() << "'!\n";
- exit(1);
- }
- }
-
-
- // Parse the type constraints.
- std::vector<Record*> ConstraintList =
- TypeProfile->getValueAsListOfDefs("Constraints");
- TypeConstraints.assign(ConstraintList.begin(), ConstraintList.end());
-}
-
-//===----------------------------------------------------------------------===//
-// TreePatternNode implementation
-//
-
-TreePatternNode::~TreePatternNode() {
-#if 0 // FIXME: implement refcounted tree nodes!
- for (unsigned i = 0, e = getNumChildren(); i != e; ++i)
- delete getChild(i);
-#endif
-}
-
-/// UpdateNodeType - Set the node type of N to VT if VT contains
-/// information. If N already contains a conflicting type, then throw an
-/// exception. This returns true if any information was updated.
-///
-bool TreePatternNode::UpdateNodeType(const std::vector<unsigned char> &ExtVTs,
- TreePattern &TP) {
- assert(!ExtVTs.empty() && "Cannot update node type with empty type vector!");
-
- if (ExtVTs[0] == MVT::isUnknown || LHSIsSubsetOfRHS(getExtTypes(), ExtVTs))
- return false;
- if (isTypeCompletelyUnknown() || LHSIsSubsetOfRHS(ExtVTs, getExtTypes())) {
- setTypes(ExtVTs);
- return true;
- }
-
- if (getExtTypeNum(0) == MVT::iPTR) {
- if (ExtVTs[0] == MVT::iPTR || ExtVTs[0] == MVT::isInt)
- return false;
- if (MVT::isExtIntegerInVTs(ExtVTs)) {
- std::vector<unsigned char> FVTs = FilterEVTs(ExtVTs, MVT::isInteger);
- if (FVTs.size()) {
- setTypes(ExtVTs);
- return true;
- }
- }
- }
-
- if (ExtVTs[0] == MVT::isInt && MVT::isExtIntegerInVTs(getExtTypes())) {
- assert(hasTypeSet() && "should be handled above!");
- std::vector<unsigned char> FVTs = FilterEVTs(getExtTypes(), MVT::isInteger);
- if (getExtTypes() == FVTs)
- return false;
- setTypes(FVTs);
- return true;
- }
- if (ExtVTs[0] == MVT::iPTR && MVT::isExtIntegerInVTs(getExtTypes())) {
- //assert(hasTypeSet() && "should be handled above!");
- std::vector<unsigned char> FVTs = FilterEVTs(getExtTypes(), MVT::isInteger);
- if (getExtTypes() == FVTs)
- return false;
- if (FVTs.size()) {
- setTypes(FVTs);
- return true;
- }
- }
- if (ExtVTs[0] == MVT::isFP && MVT::isExtFloatingPointInVTs(getExtTypes())) {
- assert(hasTypeSet() && "should be handled above!");
- std::vector<unsigned char> FVTs =
- FilterEVTs(getExtTypes(), MVT::isFloatingPoint);
- if (getExtTypes() == FVTs)
- return false;
- setTypes(FVTs);
- return true;
- }
-
- // If we know this is an int or fp type, and we are told it is a specific one,
- // take the advice.
- //
- // Similarly, we should probably set the type here to the intersection of
- // {isInt|isFP} and ExtVTs
- if ((getExtTypeNum(0) == MVT::isInt && MVT::isExtIntegerInVTs(ExtVTs)) ||
- (getExtTypeNum(0) == MVT::isFP && MVT::isExtFloatingPointInVTs(ExtVTs))){
- setTypes(ExtVTs);
- return true;
- }
- if (getExtTypeNum(0) == MVT::isInt && ExtVTs[0] == MVT::iPTR) {
- setTypes(ExtVTs);
- return true;
- }
-
- if (isLeaf()) {
- dump();
- cerr << " ";
- TP.error("Type inference contradiction found in node!");
- } else {
- TP.error("Type inference contradiction found in node " +
- getOperator()->getName() + "!");
- }
- return true; // unreachable
-}
-
-
-void TreePatternNode::print(std::ostream &OS) const {
- if (isLeaf()) {
- OS << *getLeafValue();
- } else {
- OS << "(" << getOperator()->getName();
- }
-
- // FIXME: At some point we should handle printing all the value types for
- // nodes that are multiply typed.
- switch (getExtTypeNum(0)) {
- case MVT::Other: OS << ":Other"; break;
- case MVT::isInt: OS << ":isInt"; break;
- case MVT::isFP : OS << ":isFP"; break;
- case MVT::isUnknown: ; /*OS << ":?";*/ break;
- case MVT::iPTR: OS << ":iPTR"; break;
- default: {
- std::string VTName = llvm::getName(getTypeNum(0));
- // Strip off MVT:: prefix if present.
- if (VTName.substr(0,5) == "MVT::")
- VTName = VTName.substr(5);
- OS << ":" << VTName;
- break;
- }
- }
-
- if (!isLeaf()) {
- if (getNumChildren() != 0) {
- OS << " ";
- getChild(0)->print(OS);
- for (unsigned i = 1, e = getNumChildren(); i != e; ++i) {
- OS << ", ";
- getChild(i)->print(OS);
- }
- }
- OS << ")";
- }
-
- if (!PredicateFn.empty())
- OS << "<<P:" << PredicateFn << ">>";
- if (TransformFn)
- OS << "<<X:" << TransformFn->getName() << ">>";
- if (!getName().empty())
- OS << ":$" << getName();
-
-}
-void TreePatternNode::dump() const {
- print(*cerr.stream());
-}
-
-/// isIsomorphicTo - Return true if this node is recursively
-/// isomorphic to the specified node. For this comparison, the node's
-/// entire state is considered. The assigned name is ignored, since
-/// nodes with differing names are considered isomorphic. However, if
-/// the assigned name is present in the dependent variable set, then
-/// the assigned name is considered significant and the node is
-/// isomorphic if the names match.
-bool TreePatternNode::isIsomorphicTo(const TreePatternNode *N,
- const MultipleUseVarSet &DepVars) const {
- if (N == this) return true;
- if (N->isLeaf() != isLeaf() || getExtTypes() != N->getExtTypes() ||
- getPredicateFn() != N->getPredicateFn() ||
- getTransformFn() != N->getTransformFn())
- return false;
-
- if (isLeaf()) {
- if (DefInit *DI = dynamic_cast<DefInit*>(getLeafValue())) {
- if (DefInit *NDI = dynamic_cast<DefInit*>(N->getLeafValue())) {
- return ((DI->getDef() == NDI->getDef())
- && (DepVars.find(getName()) == DepVars.end()
- || getName() == N->getName()));
- }
- }
- return getLeafValue() == N->getLeafValue();
- }
-
- if (N->getOperator() != getOperator() ||
- N->getNumChildren() != getNumChildren()) return false;
- for (unsigned i = 0, e = getNumChildren(); i != e; ++i)
- if (!getChild(i)->isIsomorphicTo(N->getChild(i), DepVars))
- return false;
- return true;
-}
-
-/// clone - Make a copy of this tree and all of its children.
-///
-TreePatternNode *TreePatternNode::clone() const {
- TreePatternNode *New;
- if (isLeaf()) {
- New = new TreePatternNode(getLeafValue());
- } else {
- std::vector<TreePatternNode*> CChildren;
- CChildren.reserve(Children.size());
- for (unsigned i = 0, e = getNumChildren(); i != e; ++i)
- CChildren.push_back(getChild(i)->clone());
- New = new TreePatternNode(getOperator(), CChildren);
- }
- New->setName(getName());
- New->setTypes(getExtTypes());
- New->setPredicateFn(getPredicateFn());
- New->setTransformFn(getTransformFn());
- return New;
-}
-
-/// SubstituteFormalArguments - Replace the formal arguments in this tree
-/// with actual values specified by ArgMap.
-void TreePatternNode::
-SubstituteFormalArguments(std::map<std::string, TreePatternNode*> &ArgMap) {
- if (isLeaf()) return;
-
- for (unsigned i = 0, e = getNumChildren(); i != e; ++i) {
- TreePatternNode *Child = getChild(i);
- if (Child->isLeaf()) {
- Init *Val = Child->getLeafValue();
- if (dynamic_cast<DefInit*>(Val) &&
- static_cast<DefInit*>(Val)->getDef()->getName() == "node") {
- // We found a use of a formal argument, replace it with its value.
- Child = ArgMap[Child->getName()];
- assert(Child && "Couldn't find formal argument!");
- setChild(i, Child);
- }
- } else {
- getChild(i)->SubstituteFormalArguments(ArgMap);
- }
- }
-}
-
-
-/// InlinePatternFragments - If this pattern refers to any pattern
-/// fragments, inline them into place, giving us a pattern without any
-/// PatFrag references.
-TreePatternNode *TreePatternNode::InlinePatternFragments(TreePattern &TP) {
- if (isLeaf()) return this; // nothing to do.
- Record *Op = getOperator();
-
- if (!Op->isSubClassOf("PatFrag")) {
- // Just recursively inline children nodes.
- for (unsigned i = 0, e = getNumChildren(); i != e; ++i)
- setChild(i, getChild(i)->InlinePatternFragments(TP));
- return this;
- }
-
- // Otherwise, we found a reference to a fragment. First, look up its
- // TreePattern record.
- TreePattern *Frag = TP.getDAGPatterns().getPatternFragment(Op);
-
- // Verify that we are passing the right number of operands.
- if (Frag->getNumArgs() != Children.size())
- TP.error("'" + Op->getName() + "' fragment requires " +
- utostr(Frag->getNumArgs()) + " operands!");
-
- TreePatternNode *FragTree = Frag->getOnlyTree()->clone();
-
- // Resolve formal arguments to their actual value.
- if (Frag->getNumArgs()) {
- // Compute the map of formal to actual arguments.
- std::map<std::string, TreePatternNode*> ArgMap;
- for (unsigned i = 0, e = Frag->getNumArgs(); i != e; ++i)
- ArgMap[Frag->getArgName(i)] = getChild(i)->InlinePatternFragments(TP);
-
- FragTree->SubstituteFormalArguments(ArgMap);
- }
-
- FragTree->setName(getName());
- FragTree->UpdateNodeType(getExtTypes(), TP);
-
- // Get a new copy of this fragment to stitch into here.
- //delete this; // FIXME: implement refcounting!
- return FragTree;
-}
-
-/// getImplicitType - Check to see if the specified record has an implicit
-/// type which should be applied to it. This infer the type of register
-/// references from the register file information, for example.
-///
-static std::vector<unsigned char> getImplicitType(Record *R, bool NotRegisters,
- TreePattern &TP) {
- // Some common return values
- std::vector<unsigned char> Unknown(1, MVT::isUnknown);
- std::vector<unsigned char> Other(1, MVT::Other);
-
- // Check to see if this is a register or a register class...
- if (R->isSubClassOf("RegisterClass")) {
- if (NotRegisters)
- return Unknown;
- const CodeGenRegisterClass &RC =
- TP.getDAGPatterns().getTargetInfo().getRegisterClass(R);
- return ConvertVTs(RC.getValueTypes());
- } else if (R->isSubClassOf("PatFrag")) {
- // Pattern fragment types will be resolved when they are inlined.
- return Unknown;
- } else if (R->isSubClassOf("Register")) {
- if (NotRegisters)
- return Unknown;
- const CodeGenTarget &T = TP.getDAGPatterns().getTargetInfo();
- return T.getRegisterVTs(R);
- } else if (R->isSubClassOf("ValueType") || R->isSubClassOf("CondCode")) {
- // Using a VTSDNode or CondCodeSDNode.
- return Other;
- } else if (R->isSubClassOf("ComplexPattern")) {
- if (NotRegisters)
- return Unknown;
- std::vector<unsigned char>
- ComplexPat(1, TP.getDAGPatterns().getComplexPattern(R).getValueType());
- return ComplexPat;
- } else if (R->getName() == "ptr_rc") {
- Other[0] = MVT::iPTR;
- return Other;
- } else if (R->getName() == "node" || R->getName() == "srcvalue" ||
- R->getName() == "zero_reg") {
- // Placeholder.
- return Unknown;
- }
-
- TP.error("Unknown node flavor used in pattern: " + R->getName());
- return Other;
-}
-
-
-/// getIntrinsicInfo - If this node corresponds to an intrinsic, return the
-/// CodeGenIntrinsic information for it, otherwise return a null pointer.
-const CodeGenIntrinsic *TreePatternNode::
-getIntrinsicInfo(const CodeGenDAGPatterns &CDP) const {
- if (getOperator() != CDP.get_intrinsic_void_sdnode() &&
- getOperator() != CDP.get_intrinsic_w_chain_sdnode() &&
- getOperator() != CDP.get_intrinsic_wo_chain_sdnode())
- return 0;
-
- unsigned IID =
- dynamic_cast<IntInit*>(getChild(0)->getLeafValue())->getValue();
- return &CDP.getIntrinsicInfo(IID);
-}
-
-
-/// ApplyTypeConstraints - Apply all of the type constraints relevent to
-/// this node and its children in the tree. This returns true if it makes a
-/// change, false otherwise. If a type contradiction is found, throw an
-/// exception.
-bool TreePatternNode::ApplyTypeConstraints(TreePattern &TP, bool NotRegisters) {
- CodeGenDAGPatterns &CDP = TP.getDAGPatterns();
- if (isLeaf()) {
- if (DefInit *DI = dynamic_cast<DefInit*>(getLeafValue())) {
- // If it's a regclass or something else known, include the type.
- return UpdateNodeType(getImplicitType(DI->getDef(), NotRegisters, TP),TP);
- } else if (IntInit *II = dynamic_cast<IntInit*>(getLeafValue())) {
- // Int inits are always integers. :)
- bool MadeChange = UpdateNodeType(MVT::isInt, TP);
-
- if (hasTypeSet()) {
- // At some point, it may make sense for this tree pattern to have
- // multiple types. Assert here that it does not, so we revisit this
- // code when appropriate.
- assert(getExtTypes().size() >= 1 && "TreePattern doesn't have a type!");
- MVT::ValueType VT = getTypeNum(0);
- for (unsigned i = 1, e = getExtTypes().size(); i != e; ++i)
- assert(getTypeNum(i) == VT && "TreePattern has too many types!");
-
- VT = getTypeNum(0);
- if (VT != MVT::iPTR) {
- unsigned Size = MVT::getSizeInBits(VT);
- // Make sure that the value is representable for this type.
- if (Size < 32) {
- int Val = (II->getValue() << (32-Size)) >> (32-Size);
- if (Val != II->getValue()) {
- // If sign-extended doesn't fit, does it fit as unsigned?
- unsigned ValueMask = unsigned(MVT::getIntVTBitMask(VT));
- unsigned UnsignedVal = unsigned(II->getValue());
-
- if ((ValueMask & UnsignedVal) != UnsignedVal) {
- TP.error("Integer value '" + itostr(II->getValue())+
- "' is out of range for type '" +
- getEnumName(getTypeNum(0)) + "'!");
- }
- }
- }
- }
- }
-
- return MadeChange;
- }
- return false;
- }
-
- // special handling for set, which isn't really an SDNode.
- if (getOperator()->getName() == "set") {
- assert (getNumChildren() >= 2 && "Missing RHS of a set?");
- unsigned NC = getNumChildren();
- bool MadeChange = false;
- for (unsigned i = 0; i < NC-1; ++i) {
- MadeChange = getChild(i)->ApplyTypeConstraints(TP, NotRegisters);
- MadeChange |= getChild(NC-1)->ApplyTypeConstraints(TP, NotRegisters);
-
- // Types of operands must match.
- MadeChange |= getChild(i)->UpdateNodeType(getChild(NC-1)->getExtTypes(),
- TP);
- MadeChange |= getChild(NC-1)->UpdateNodeType(getChild(i)->getExtTypes(),
- TP);
- MadeChange |= UpdateNodeType(MVT::isVoid, TP);
- }
- return MadeChange;
- } else if (getOperator()->getName() == "implicit" ||
- getOperator()->getName() == "parallel") {
- bool MadeChange = false;
- for (unsigned i = 0; i < getNumChildren(); ++i)
- MadeChange = getChild(i)->ApplyTypeConstraints(TP, NotRegisters);
- MadeChange |= UpdateNodeType(MVT::isVoid, TP);
- return MadeChange;
- } else if (const CodeGenIntrinsic *Int = getIntrinsicInfo(CDP)) {
- bool MadeChange = false;
-
- // Apply the result type to the node.
- MadeChange = UpdateNodeType(Int->ArgVTs[0], TP);
-
- if (getNumChildren() != Int->ArgVTs.size())
- TP.error("Intrinsic '" + Int->Name + "' expects " +
- utostr(Int->ArgVTs.size()-1) + " operands, not " +
- utostr(getNumChildren()-1) + " operands!");
-
- // Apply type info to the intrinsic ID.
- MadeChange |= getChild(0)->UpdateNodeType(MVT::iPTR, TP);
-
- for (unsigned i = 1, e = getNumChildren(); i != e; ++i) {
- MVT::ValueType OpVT = Int->ArgVTs[i];
- MadeChange |= getChild(i)->UpdateNodeType(OpVT, TP);
- MadeChange |= getChild(i)->ApplyTypeConstraints(TP, NotRegisters);
- }
- return MadeChange;
- } else if (getOperator()->isSubClassOf("SDNode")) {
- const SDNodeInfo &NI = CDP.getSDNodeInfo(getOperator());
-
- bool MadeChange = NI.ApplyTypeConstraints(this, TP);
- for (unsigned i = 0, e = getNumChildren(); i != e; ++i)
- MadeChange |= getChild(i)->ApplyTypeConstraints(TP, NotRegisters);
- // Branch, etc. do not produce results and top-level forms in instr pattern
- // must have void types.
- if (NI.getNumResults() == 0)
- MadeChange |= UpdateNodeType(MVT::isVoid, TP);
-
- // If this is a vector_shuffle operation, apply types to the build_vector
- // operation. The types of the integers don't matter, but this ensures they
- // won't get checked.
- if (getOperator()->getName() == "vector_shuffle" &&
- getChild(2)->getOperator()->getName() == "build_vector") {
- TreePatternNode *BV = getChild(2);
- const std::vector<MVT::ValueType> &LegalVTs
- = CDP.getTargetInfo().getLegalValueTypes();
- MVT::ValueType LegalIntVT = MVT::Other;
- for (unsigned i = 0, e = LegalVTs.size(); i != e; ++i)
- if (MVT::isInteger(LegalVTs[i]) && !MVT::isVector(LegalVTs[i])) {
- LegalIntVT = LegalVTs[i];
- break;
- }
- assert(LegalIntVT != MVT::Other && "No legal integer VT?");
-
- for (unsigned i = 0, e = BV->getNumChildren(); i != e; ++i)
- MadeChange |= BV->getChild(i)->UpdateNodeType(LegalIntVT, TP);
- }
- return MadeChange;
- } else if (getOperator()->isSubClassOf("Instruction")) {
- const DAGInstruction &Inst = CDP.getInstruction(getOperator());
- bool MadeChange = false;
- unsigned NumResults = Inst.getNumResults();
-
- assert(NumResults <= 1 &&
- "Only supports zero or one result instrs!");
-
- CodeGenInstruction &InstInfo =
- CDP.getTargetInfo().getInstruction(getOperator()->getName());
- // Apply the result type to the node
- if (NumResults == 0 || InstInfo.NumDefs == 0) {
- MadeChange = UpdateNodeType(MVT::isVoid, TP);
- } else {
- Record *ResultNode = Inst.getResult(0);
-
- if (ResultNode->getName() == "ptr_rc") {
- std::vector<unsigned char> VT;
- VT.push_back(MVT::iPTR);
- MadeChange = UpdateNodeType(VT, TP);
- } else if (ResultNode->getName() == "unknown") {
- std::vector<unsigned char> VT;
- VT.push_back(MVT::isUnknown);
- MadeChange = UpdateNodeType(VT, TP);
- } else {
- assert(ResultNode->isSubClassOf("RegisterClass") &&
- "Operands should be register classes!");
-
- const CodeGenRegisterClass &RC =
- CDP.getTargetInfo().getRegisterClass(ResultNode);
- MadeChange = UpdateNodeType(ConvertVTs(RC.getValueTypes()), TP);
- }
- }
-
- unsigned ChildNo = 0;
- for (unsigned i = 0, e = Inst.getNumOperands(); i != e; ++i) {
- Record *OperandNode = Inst.getOperand(i);
-
- // If the instruction expects a predicate or optional def operand, we
- // codegen this by setting the operand to it's default value if it has a
- // non-empty DefaultOps field.
- if ((OperandNode->isSubClassOf("PredicateOperand") ||
- OperandNode->isSubClassOf("OptionalDefOperand")) &&
- !CDP.getDefaultOperand(OperandNode).DefaultOps.empty())
- continue;
-
- // Verify that we didn't run out of provided operands.
- if (ChildNo >= getNumChildren())
- TP.error("Instruction '" + getOperator()->getName() +
- "' expects more operands than were provided.");
-
- MVT::ValueType VT;
- TreePatternNode *Child = getChild(ChildNo++);
- if (OperandNode->isSubClassOf("RegisterClass")) {
- const CodeGenRegisterClass &RC =
- CDP.getTargetInfo().getRegisterClass(OperandNode);
- MadeChange |= Child->UpdateNodeType(ConvertVTs(RC.getValueTypes()), TP);
- } else if (OperandNode->isSubClassOf("Operand")) {
- VT = getValueType(OperandNode->getValueAsDef("Type"));
- MadeChange |= Child->UpdateNodeType(VT, TP);
- } else if (OperandNode->getName() == "ptr_rc") {
- MadeChange |= Child->UpdateNodeType(MVT::iPTR, TP);
- } else if (OperandNode->getName() == "unknown") {
- MadeChange |= Child->UpdateNodeType(MVT::isUnknown, TP);
- } else {
- assert(0 && "Unknown operand type!");
- abort();
- }
- MadeChange |= Child->ApplyTypeConstraints(TP, NotRegisters);
- }
-
- if (ChildNo != getNumChildren())
- TP.error("Instruction '" + getOperator()->getName() +
- "' was provided too many operands!");
-
- return MadeChange;
- } else {
- assert(getOperator()->isSubClassOf("SDNodeXForm") && "Unknown node type!");
-
- // Node transforms always take one operand.
- if (getNumChildren() != 1)
- TP.error("Node transform '" + getOperator()->getName() +
- "' requires one operand!");
-
- // If either the output or input of the xform does not have exact
- // type info. We assume they must be the same. Otherwise, it is perfectly
- // legal to transform from one type to a completely different type.
- if (!hasTypeSet() || !getChild(0)->hasTypeSet()) {
- bool MadeChange = UpdateNodeType(getChild(0)->getExtTypes(), TP);
- MadeChange |= getChild(0)->UpdateNodeType(getExtTypes(), TP);
- return MadeChange;
- }
- return false;
- }
-}
-
-/// OnlyOnRHSOfCommutative - Return true if this value is only allowed on the
-/// RHS of a commutative operation, not the on LHS.
-static bool OnlyOnRHSOfCommutative(TreePatternNode *N) {
- if (!N->isLeaf() && N->getOperator()->getName() == "imm")
- return true;
- if (N->isLeaf() && dynamic_cast<IntInit*>(N->getLeafValue()))
- return true;
- return false;
-}
-
-
-/// canPatternMatch - If it is impossible for this pattern to match on this
-/// target, fill in Reason and return false. Otherwise, return true. This is
-/// used as a santity check for .td files (to prevent people from writing stuff
-/// that can never possibly work), and to prevent the pattern permuter from
-/// generating stuff that is useless.
-bool TreePatternNode::canPatternMatch(std::string &Reason,
- const CodeGenDAGPatterns &CDP) {
- if (isLeaf()) return true;
-
- for (unsigned i = 0, e = getNumChildren(); i != e; ++i)
- if (!getChild(i)->canPatternMatch(Reason, CDP))
- return false;
-
- // If this is an intrinsic, handle cases that would make it not match. For
- // example, if an operand is required to be an immediate.
- if (getOperator()->isSubClassOf("Intrinsic")) {
- // TODO:
- return true;
- }
-
- // If this node is a commutative operator, check that the LHS isn't an
- // immediate.
- const SDNodeInfo &NodeInfo = CDP.getSDNodeInfo(getOperator());
- if (NodeInfo.hasProperty(SDNPCommutative)) {
- // Scan all of the operands of the node and make sure that only the last one
- // is a constant node, unless the RHS also is.
- if (!OnlyOnRHSOfCommutative(getChild(getNumChildren()-1))) {
- for (unsigned i = 0, e = getNumChildren()-1; i != e; ++i)
- if (OnlyOnRHSOfCommutative(getChild(i))) {
- Reason="Immediate value must be on the RHS of commutative operators!";
- return false;
- }
- }
- }
-
- return true;
-}
-
-//===----------------------------------------------------------------------===//
-// TreePattern implementation
-//
-
-TreePattern::TreePattern(Record *TheRec, ListInit *RawPat, bool isInput,
- CodeGenDAGPatterns &cdp) : TheRecord(TheRec), CDP(cdp){
- isInputPattern = isInput;
- for (unsigned i = 0, e = RawPat->getSize(); i != e; ++i)
- Trees.push_back(ParseTreePattern((DagInit*)RawPat->getElement(i)));
-}
-
-TreePattern::TreePattern(Record *TheRec, DagInit *Pat, bool isInput,
- CodeGenDAGPatterns &cdp) : TheRecord(TheRec), CDP(cdp){
- isInputPattern = isInput;
- Trees.push_back(ParseTreePattern(Pat));
-}
-
-TreePattern::TreePattern(Record *TheRec, TreePatternNode *Pat, bool isInput,
- CodeGenDAGPatterns &cdp) : TheRecord(TheRec), CDP(cdp){
- isInputPattern = isInput;
- Trees.push_back(Pat);
-}
-
-
-
-void TreePattern::error(const std::string &Msg) const {
- dump();
- throw "In " + TheRecord->getName() + ": " + Msg;
-}
-
-TreePatternNode *TreePattern::ParseTreePattern(DagInit *Dag) {
- DefInit *OpDef = dynamic_cast<DefInit*>(Dag->getOperator());
- if (!OpDef) error("Pattern has unexpected operator type!");
- Record *Operator = OpDef->getDef();
-
- if (Operator->isSubClassOf("ValueType")) {
- // If the operator is a ValueType, then this must be "type cast" of a leaf
- // node.
- if (Dag->getNumArgs() != 1)
- error("Type cast only takes one operand!");
-
- Init *Arg = Dag->getArg(0);
- TreePatternNode *New;
- if (DefInit *DI = dynamic_cast<DefInit*>(Arg)) {
- Record *R = DI->getDef();
- if (R->isSubClassOf("SDNode") || R->isSubClassOf("PatFrag")) {
- Dag->setArg(0, new DagInit(DI,
- std::vector<std::pair<Init*, std::string> >()));
- return ParseTreePattern(Dag);
- }
- New = new TreePatternNode(DI);
- } else if (DagInit *DI = dynamic_cast<DagInit*>(Arg)) {
- New = ParseTreePattern(DI);
- } else if (IntInit *II = dynamic_cast<IntInit*>(Arg)) {
- New = new TreePatternNode(II);
- if (!Dag->getArgName(0).empty())
- error("Constant int argument should not have a name!");
- } else if (BitsInit *BI = dynamic_cast<BitsInit*>(Arg)) {
- // Turn this into an IntInit.
- Init *II = BI->convertInitializerTo(new IntRecTy());
- if (II == 0 || !dynamic_cast<IntInit*>(II))
- error("Bits value must be constants!");
-
- New = new TreePatternNode(dynamic_cast<IntInit*>(II));
- if (!Dag->getArgName(0).empty())
- error("Constant int argument should not have a name!");
- } else {
- Arg->dump();
- error("Unknown leaf value for tree pattern!");
- return 0;
- }
-
- // Apply the type cast.
- New->UpdateNodeType(getValueType(Operator), *this);
- New->setName(Dag->getArgName(0));
- return New;
- }
-
- // Verify that this is something that makes sense for an operator.
- if (!Operator->isSubClassOf("PatFrag") && !Operator->isSubClassOf("SDNode") &&
- !Operator->isSubClassOf("Instruction") &&
- !Operator->isSubClassOf("SDNodeXForm") &&
- !Operator->isSubClassOf("Intrinsic") &&
- Operator->getName() != "set" &&
- Operator->getName() != "implicit" &&
- Operator->getName() != "parallel")
- error("Unrecognized node '" + Operator->getName() + "'!");
-
- // Check to see if this is something that is illegal in an input pattern.
- if (isInputPattern && (Operator->isSubClassOf("Instruction") ||
- Operator->isSubClassOf("SDNodeXForm")))
- error("Cannot use '" + Operator->getName() + "' in an input pattern!");
-
- std::vector<TreePatternNode*> Children;
-
- for (unsigned i = 0, e = Dag->getNumArgs(); i != e; ++i) {
- Init *Arg = Dag->getArg(i);
- if (DagInit *DI = dynamic_cast<DagInit*>(Arg)) {
- Children.push_back(ParseTreePattern(DI));
- if (Children.back()->getName().empty())
- Children.back()->setName(Dag->getArgName(i));
- } else if (DefInit *DefI = dynamic_cast<DefInit*>(Arg)) {
- Record *R = DefI->getDef();
- // Direct reference to a leaf DagNode or PatFrag? Turn it into a
- // TreePatternNode if its own.
- if (R->isSubClassOf("SDNode") || R->isSubClassOf("PatFrag")) {
- Dag->setArg(i, new DagInit(DefI,
- std::vector<std::pair<Init*, std::string> >()));
- --i; // Revisit this node...
- } else {
- TreePatternNode *Node = new TreePatternNode(DefI);
- Node->setName(Dag->getArgName(i));
- Children.push_back(Node);
-
- // Input argument?
- if (R->getName() == "node") {
- if (Dag->getArgName(i).empty())
- error("'node' argument requires a name to match with operand list");
- Args.push_back(Dag->getArgName(i));
- }
- }
- } else if (IntInit *II = dynamic_cast<IntInit*>(Arg)) {
- TreePatternNode *Node = new TreePatternNode(II);
- if (!Dag->getArgName(i).empty())
- error("Constant int argument should not have a name!");
- Children.push_back(Node);
- } else if (BitsInit *BI = dynamic_cast<BitsInit*>(Arg)) {
- // Turn this into an IntInit.
- Init *II = BI->convertInitializerTo(new IntRecTy());
- if (II == 0 || !dynamic_cast<IntInit*>(II))
- error("Bits value must be constants!");
-
- TreePatternNode *Node = new TreePatternNode(dynamic_cast<IntInit*>(II));
- if (!Dag->getArgName(i).empty())
- error("Constant int argument should not have a name!");
- Children.push_back(Node);
- } else {
- cerr << '"';
- Arg->dump();
- cerr << "\": ";
- error("Unknown leaf value for tree pattern!");
- }
- }
-
- // If the operator is an intrinsic, then this is just syntactic sugar for for
- // (intrinsic_* <number>, ..children..). Pick the right intrinsic node, and
- // convert the intrinsic name to a number.
- if (Operator->isSubClassOf("Intrinsic")) {
- const CodeGenIntrinsic &Int = getDAGPatterns().getIntrinsic(Operator);
- unsigned IID = getDAGPatterns().getIntrinsicID(Operator)+1;
-
- // If this intrinsic returns void, it must have side-effects and thus a
- // chain.
- if (Int.ArgVTs[0] == MVT::isVoid) {
- Operator = getDAGPatterns().get_intrinsic_void_sdnode();
- } else if (Int.ModRef != CodeGenIntrinsic::NoMem) {
- // Has side-effects, requires chain.
- Operator = getDAGPatterns().get_intrinsic_w_chain_sdnode();
- } else {
- // Otherwise, no chain.
- Operator = getDAGPatterns().get_intrinsic_wo_chain_sdnode();
- }
-
- TreePatternNode *IIDNode = new TreePatternNode(new IntInit(IID));
- Children.insert(Children.begin(), IIDNode);
- }
-
- return new TreePatternNode(Operator, Children);
-}
-
-/// InferAllTypes - Infer/propagate as many types throughout the expression
-/// patterns as possible. Return true if all types are infered, false
-/// otherwise. Throw an exception if a type contradiction is found.
-bool TreePattern::InferAllTypes() {
- bool MadeChange = true;
- while (MadeChange) {
- MadeChange = false;
- for (unsigned i = 0, e = Trees.size(); i != e; ++i)
- MadeChange |= Trees[i]->ApplyTypeConstraints(*this, false);
- }
-
- bool HasUnresolvedTypes = false;
- for (unsigned i = 0, e = Trees.size(); i != e; ++i)
- HasUnresolvedTypes |= Trees[i]->ContainsUnresolvedType();
- return !HasUnresolvedTypes;
-}
-
-void TreePattern::print(std::ostream &OS) const {
- OS << getRecord()->getName();
- if (!Args.empty()) {
- OS << "(" << Args[0];
- for (unsigned i = 1, e = Args.size(); i != e; ++i)
- OS << ", " << Args[i];
- OS << ")";
- }
- OS << ": ";
-
- if (Trees.size() > 1)
- OS << "[\n";
- for (unsigned i = 0, e = Trees.size(); i != e; ++i) {
- OS << "\t";
- Trees[i]->print(OS);
- OS << "\n";
- }
-
- if (Trees.size() > 1)
- OS << "]\n";
-}
-
-void TreePattern::dump() const { print(*cerr.stream()); }
-
-//===----------------------------------------------------------------------===//
-// CodeGenDAGPatterns implementation
-//
-
-// FIXME: REMOVE OSTREAM ARGUMENT
-CodeGenDAGPatterns::CodeGenDAGPatterns(RecordKeeper &R) : Records(R) {
- Intrinsics = LoadIntrinsics(Records);
- ParseNodeInfo();
- ParseNodeTransforms();
- ParseComplexPatterns();
- ParsePatternFragments();
- ParseDefaultOperands();
- ParseInstructions();
- ParsePatterns();
-
- // Generate variants. For example, commutative patterns can match
- // multiple ways. Add them to PatternsToMatch as well.
- GenerateVariants();
-
- // Infer instruction flags. For example, we can detect loads,
- // stores, and side effects in many cases by examining an
- // instruction's pattern.
- InferInstructionFlags();
-}
-
-CodeGenDAGPatterns::~CodeGenDAGPatterns() {
- for (std::map<Record*, TreePattern*>::iterator I = PatternFragments.begin(),
- E = PatternFragments.end(); I != E; ++I)
- delete I->second;
-}
-
-
-Record *CodeGenDAGPatterns::getSDNodeNamed(const std::string &Name) const {
- Record *N = Records.getDef(Name);
- if (!N || !N->isSubClassOf("SDNode")) {
- cerr << "Error getting SDNode '" << Name << "'!\n";
- exit(1);
- }
- return N;
-}
-
-// Parse all of the SDNode definitions for the target, populating SDNodes.
-void CodeGenDAGPatterns::ParseNodeInfo() {
- std::vector<Record*> Nodes = Records.getAllDerivedDefinitions("SDNode");
- while (!Nodes.empty()) {
- SDNodes.insert(std::make_pair(Nodes.back(), Nodes.back()));
- Nodes.pop_back();
- }
-
- // Get the buildin intrinsic nodes.
- intrinsic_void_sdnode = getSDNodeNamed("intrinsic_void");
- intrinsic_w_chain_sdnode = getSDNodeNamed("intrinsic_w_chain");
- intrinsic_wo_chain_sdnode = getSDNodeNamed("intrinsic_wo_chain");
-}
-
-/// ParseNodeTransforms - Parse all SDNodeXForm instances into the SDNodeXForms
-/// map, and emit them to the file as functions.
-void CodeGenDAGPatterns::ParseNodeTransforms() {
- std::vector<Record*> Xforms = Records.getAllDerivedDefinitions("SDNodeXForm");
- while (!Xforms.empty()) {
- Record *XFormNode = Xforms.back();
- Record *SDNode = XFormNode->getValueAsDef("Opcode");
- std::string Code = XFormNode->getValueAsCode("XFormFunction");
- SDNodeXForms.insert(std::make_pair(XFormNode, NodeXForm(SDNode, Code)));
-
- Xforms.pop_back();
- }
-}
-
-void CodeGenDAGPatterns::ParseComplexPatterns() {
- std::vector<Record*> AMs = Records.getAllDerivedDefinitions("ComplexPattern");
- while (!AMs.empty()) {
- ComplexPatterns.insert(std::make_pair(AMs.back(), AMs.back()));
- AMs.pop_back();
- }
-}
-
-
-/// ParsePatternFragments - Parse all of the PatFrag definitions in the .td
-/// file, building up the PatternFragments map. After we've collected them all,
-/// inline fragments together as necessary, so that there are no references left
-/// inside a pattern fragment to a pattern fragment.
-///
-void CodeGenDAGPatterns::ParsePatternFragments() {
- std::vector<Record*> Fragments = Records.getAllDerivedDefinitions("PatFrag");
-
- // First step, parse all of the fragments.
- for (unsigned i = 0, e = Fragments.size(); i != e; ++i) {
- DagInit *Tree = Fragments[i]->getValueAsDag("Fragment");
- TreePattern *P = new TreePattern(Fragments[i], Tree, true, *this);
- PatternFragments[Fragments[i]] = P;
-
- // Validate the argument list, converting it to set, to discard duplicates.
- std::vector<std::string> &Args = P->getArgList();
- std::set<std::string> OperandsSet(Args.begin(), Args.end());
-
- if (OperandsSet.count(""))
- P->error("Cannot have unnamed 'node' values in pattern fragment!");
-
- // Parse the operands list.
- DagInit *OpsList = Fragments[i]->getValueAsDag("Operands");
- DefInit *OpsOp = dynamic_cast<DefInit*>(OpsList->getOperator());
- // Special cases: ops == outs == ins. Different names are used to
- // improve readibility.
- if (!OpsOp ||
- (OpsOp->getDef()->getName() != "ops" &&
- OpsOp->getDef()->getName() != "outs" &&
- OpsOp->getDef()->getName() != "ins"))
- P->error("Operands list should start with '(ops ... '!");
-
- // Copy over the arguments.
- Args.clear();
- for (unsigned j = 0, e = OpsList->getNumArgs(); j != e; ++j) {
- if (!dynamic_cast<DefInit*>(OpsList->getArg(j)) ||
- static_cast<DefInit*>(OpsList->getArg(j))->
- getDef()->getName() != "node")
- P->error("Operands list should all be 'node' values.");
- if (OpsList->getArgName(j).empty())
- P->error("Operands list should have names for each operand!");
- if (!OperandsSet.count(OpsList->getArgName(j)))
- P->error("'" + OpsList->getArgName(j) +
- "' does not occur in pattern or was multiply specified!");
- OperandsSet.erase(OpsList->getArgName(j));
- Args.push_back(OpsList->getArgName(j));
- }
-
- if (!OperandsSet.empty())
- P->error("Operands list does not contain an entry for operand '" +
- *OperandsSet.begin() + "'!");
-
- // If there is a code init for this fragment, keep track of the fact that
- // this fragment uses it.
- std::string Code = Fragments[i]->getValueAsCode("Predicate");
- if (!Code.empty())
- P->getOnlyTree()->setPredicateFn("Predicate_"+Fragments[i]->getName());
-
- // If there is a node transformation corresponding to this, keep track of
- // it.
- Record *Transform = Fragments[i]->getValueAsDef("OperandTransform");
- if (!getSDNodeTransform(Transform).second.empty()) // not noop xform?
- P->getOnlyTree()->setTransformFn(Transform);
- }
-
- // Now that we've parsed all of the tree fragments, do a closure on them so
- // that there are not references to PatFrags left inside of them.
- for (std::map<Record*, TreePattern*>::iterator I = PatternFragments.begin(),
- E = PatternFragments.end(); I != E; ++I) {
- TreePattern *ThePat = I->second;
- ThePat->InlinePatternFragments();
-
- // Infer as many types as possible. Don't worry about it if we don't infer
- // all of them, some may depend on the inputs of the pattern.
- try {
- ThePat->InferAllTypes();
- } catch (...) {
- // If this pattern fragment is not supported by this target (no types can
- // satisfy its constraints), just ignore it. If the bogus pattern is
- // actually used by instructions, the type consistency error will be
- // reported there.
- }
-
- // If debugging, print out the pattern fragment result.
- DEBUG(ThePat->dump());
- }
-}
-
-void CodeGenDAGPatterns::ParseDefaultOperands() {
- std::vector<Record*> DefaultOps[2];
- DefaultOps[0] = Records.getAllDerivedDefinitions("PredicateOperand");
- DefaultOps[1] = Records.getAllDerivedDefinitions("OptionalDefOperand");
-
- // Find some SDNode.
- assert(!SDNodes.empty() && "No SDNodes parsed?");
- Init *SomeSDNode = new DefInit(SDNodes.begin()->first);
-
- for (unsigned iter = 0; iter != 2; ++iter) {
- for (unsigned i = 0, e = DefaultOps[iter].size(); i != e; ++i) {
- DagInit *DefaultInfo = DefaultOps[iter][i]->getValueAsDag("DefaultOps");
-
- // Clone the DefaultInfo dag node, changing the operator from 'ops' to
- // SomeSDnode so that we can parse this.
- std::vector<std::pair<Init*, std::string> > Ops;
- for (unsigned op = 0, e = DefaultInfo->getNumArgs(); op != e; ++op)
- Ops.push_back(std::make_pair(DefaultInfo->getArg(op),
- DefaultInfo->getArgName(op)));
- DagInit *DI = new DagInit(SomeSDNode, Ops);
-
- // Create a TreePattern to parse this.
- TreePattern P(DefaultOps[iter][i], DI, false, *this);
- assert(P.getNumTrees() == 1 && "This ctor can only produce one tree!");
-
- // Copy the operands over into a DAGDefaultOperand.
- DAGDefaultOperand DefaultOpInfo;
-
- TreePatternNode *T = P.getTree(0);
- for (unsigned op = 0, e = T->getNumChildren(); op != e; ++op) {
- TreePatternNode *TPN = T->getChild(op);
- while (TPN->ApplyTypeConstraints(P, false))
- /* Resolve all types */;
-
- if (TPN->ContainsUnresolvedType()) {
- if (iter == 0)
- throw "Value #" + utostr(i) + " of PredicateOperand '" +
- DefaultOps[iter][i]->getName() + "' doesn't have a concrete type!";
- else
- throw "Value #" + utostr(i) + " of OptionalDefOperand '" +
- DefaultOps[iter][i]->getName() + "' doesn't have a concrete type!";
- }
- DefaultOpInfo.DefaultOps.push_back(TPN);
- }
-
- // Insert it into the DefaultOperands map so we can find it later.
- DefaultOperands[DefaultOps[iter][i]] = DefaultOpInfo;
- }
- }
-}
-
-/// HandleUse - Given "Pat" a leaf in the pattern, check to see if it is an
-/// instruction input. Return true if this is a real use.
-static bool HandleUse(TreePattern *I, TreePatternNode *Pat,
- std::map<std::string, TreePatternNode*> &InstInputs,
- std::vector<Record*> &InstImpInputs) {
- // No name -> not interesting.
- if (Pat->getName().empty()) {
- if (Pat->isLeaf()) {
- DefInit *DI = dynamic_cast<DefInit*>(Pat->getLeafValue());
- if (DI && DI->getDef()->isSubClassOf("RegisterClass"))
- I->error("Input " + DI->getDef()->getName() + " must be named!");
- else if (DI && DI->getDef()->isSubClassOf("Register"))
- InstImpInputs.push_back(DI->getDef());
- ;
- }
- return false;
- }
-
- Record *Rec;
- if (Pat->isLeaf()) {
- DefInit *DI = dynamic_cast<DefInit*>(Pat->getLeafValue());
- if (!DI) I->error("Input $" + Pat->getName() + " must be an identifier!");
- Rec = DI->getDef();
- } else {
- assert(Pat->getNumChildren() == 0 && "can't be a use with children!");
- Rec = Pat->getOperator();
- }
-
- // SRCVALUE nodes are ignored.
- if (Rec->getName() == "srcvalue")
- return false;
-
- TreePatternNode *&Slot = InstInputs[Pat->getName()];
- if (!Slot) {
- Slot = Pat;
- } else {
- Record *SlotRec;
- if (Slot->isLeaf()) {
- SlotRec = dynamic_cast<DefInit*>(Slot->getLeafValue())->getDef();
- } else {
- assert(Slot->getNumChildren() == 0 && "can't be a use with children!");
- SlotRec = Slot->getOperator();
- }
-
- // Ensure that the inputs agree if we've already seen this input.
- if (Rec != SlotRec)
- I->error("All $" + Pat->getName() + " inputs must agree with each other");
- if (Slot->getExtTypes() != Pat->getExtTypes())
- I->error("All $" + Pat->getName() + " inputs must agree with each other");
- }
- return true;
-}
-
-/// FindPatternInputsAndOutputs - Scan the specified TreePatternNode (which is
-/// part of "I", the instruction), computing the set of inputs and outputs of
-/// the pattern. Report errors if we see anything naughty.
-void CodeGenDAGPatterns::
-FindPatternInputsAndOutputs(TreePattern *I, TreePatternNode *Pat,
- std::map<std::string, TreePatternNode*> &InstInputs,
- std::map<std::string, TreePatternNode*>&InstResults,
- std::vector<Record*> &InstImpInputs,
- std::vector<Record*> &InstImpResults) {
- if (Pat->isLeaf()) {
- bool isUse = HandleUse(I, Pat, InstInputs, InstImpInputs);
- if (!isUse && Pat->getTransformFn())
- I->error("Cannot specify a transform function for a non-input value!");
- return;
- } else if (Pat->getOperator()->getName() == "implicit") {
- for (unsigned i = 0, e = Pat->getNumChildren(); i != e; ++i) {
- TreePatternNode *Dest = Pat->getChild(i);
- if (!Dest->isLeaf())
- I->error("implicitly defined value should be a register!");
-
- DefInit *Val = dynamic_cast<DefInit*>(Dest->getLeafValue());
- if (!Val || !Val->getDef()->isSubClassOf("Register"))
- I->error("implicitly defined value should be a register!");
- InstImpResults.push_back(Val->getDef());
- }
- return;
- } else if (Pat->getOperator()->getName() != "set") {
- // If this is not a set, verify that the children nodes are not void typed,
- // and recurse.
- for (unsigned i = 0, e = Pat->getNumChildren(); i != e; ++i) {
- if (Pat->getChild(i)->getExtTypeNum(0) == MVT::isVoid)
- I->error("Cannot have void nodes inside of patterns!");
- FindPatternInputsAndOutputs(I, Pat->getChild(i), InstInputs, InstResults,
- InstImpInputs, InstImpResults);
- }
-
- // If this is a non-leaf node with no children, treat it basically as if
- // it were a leaf. This handles nodes like (imm).
- bool isUse = false;
- if (Pat->getNumChildren() == 0)
- isUse = HandleUse(I, Pat, InstInputs, InstImpInputs);
-
- if (!isUse && Pat->getTransformFn())
- I->error("Cannot specify a transform function for a non-input value!");
- return;
- }
-
- // Otherwise, this is a set, validate and collect instruction results.
- if (Pat->getNumChildren() == 0)
- I->error("set requires operands!");
-
- if (Pat->getTransformFn())
- I->error("Cannot specify a transform function on a set node!");
-
- // Check the set destinations.
- unsigned NumDests = Pat->getNumChildren()-1;
- for (unsigned i = 0; i != NumDests; ++i) {
- TreePatternNode *Dest = Pat->getChild(i);
- if (!Dest->isLeaf())
- I->error("set destination should be a register!");
-
- DefInit *Val = dynamic_cast<DefInit*>(Dest->getLeafValue());
- if (!Val)
- I->error("set destination should be a register!");
-
- if (Val->getDef()->isSubClassOf("RegisterClass") ||
- Val->getDef()->getName() == "ptr_rc") {
- if (Dest->getName().empty())
- I->error("set destination must have a name!");
- if (InstResults.count(Dest->getName()))
- I->error("cannot set '" + Dest->getName() +"' multiple times");
- InstResults[Dest->getName()] = Dest;
- } else if (Val->getDef()->isSubClassOf("Register")) {
- InstImpResults.push_back(Val->getDef());
- } else {
- I->error("set destination should be a register!");
- }
- }
-
- // Verify and collect info from the computation.
- FindPatternInputsAndOutputs(I, Pat->getChild(NumDests),
- InstInputs, InstResults,
- InstImpInputs, InstImpResults);
-}
-
-//===----------------------------------------------------------------------===//
-// Instruction Analysis
-//===----------------------------------------------------------------------===//
-
-class InstAnalyzer {
- const CodeGenDAGPatterns &CDP;
- bool &mayStore;
- bool &mayLoad;
- bool &HasSideEffects;
-public:
- InstAnalyzer(const CodeGenDAGPatterns &cdp,
- bool &maystore, bool &mayload, bool &hse)
- : CDP(cdp), mayStore(maystore), mayLoad(mayload), HasSideEffects(hse){
- }
-
- /// Analyze - Analyze the specified instruction, returning true if the
- /// instruction had a pattern.
- bool Analyze(Record *InstRecord) {
- const TreePattern *Pattern = CDP.getInstruction(InstRecord).getPattern();
- if (Pattern == 0) {
- HasSideEffects = 1;
- return false; // No pattern.
- }
-
- // FIXME: Assume only the first tree is the pattern. The others are clobber
- // nodes.
- AnalyzeNode(Pattern->getTree(0));
- return true;
- }
-
-private:
- void AnalyzeNode(const TreePatternNode *N) {
- if (N->isLeaf()) {
- if (DefInit *DI = dynamic_cast<DefInit*>(N->getLeafValue())) {
- Record *LeafRec = DI->getDef();
- // Handle ComplexPattern leaves.
- if (LeafRec->isSubClassOf("ComplexPattern")) {
- const ComplexPattern &CP = CDP.getComplexPattern(LeafRec);
- if (CP.hasProperty(SDNPMayStore)) mayStore = true;
- if (CP.hasProperty(SDNPMayLoad)) mayLoad = true;
- if (CP.hasProperty(SDNPSideEffect)) HasSideEffects = true;
- }
- }
- return;
- }
-
- // Analyze children.
- for (unsigned i = 0, e = N->getNumChildren(); i != e; ++i)
- AnalyzeNode(N->getChild(i));
-
- // Ignore set nodes, which are not SDNodes.
- if (N->getOperator()->getName() == "set")
- return;
-
- // Get information about the SDNode for the operator.
- const SDNodeInfo &OpInfo = CDP.getSDNodeInfo(N->getOperator());
-
- // Notice properties of the node.
- if (OpInfo.hasProperty(SDNPMayStore)) mayStore = true;
- if (OpInfo.hasProperty(SDNPMayLoad)) mayLoad = true;
- if (OpInfo.hasProperty(SDNPSideEffect)) HasSideEffects = true;
-
- if (const CodeGenIntrinsic *IntInfo = N->getIntrinsicInfo(CDP)) {
- // If this is an intrinsic, analyze it.
- if (IntInfo->ModRef >= CodeGenIntrinsic::ReadArgMem)
- mayLoad = true;// These may load memory.
-
- if (IntInfo->ModRef >= CodeGenIntrinsic::WriteArgMem)
- mayStore = true;// Intrinsics that can write to memory are 'mayStore'.
-
- if (IntInfo->ModRef >= CodeGenIntrinsic::WriteMem)
- // WriteMem intrinsics can have other strange effects.
- HasSideEffects = true;
- }
- }
-
-};
-
-static void InferFromPattern(const CodeGenInstruction &Inst,
- bool &MayStore, bool &MayLoad,
- bool &HasSideEffects,
- const CodeGenDAGPatterns &CDP) {
- MayStore = MayLoad = HasSideEffects = false;
-
- bool HadPattern =
- InstAnalyzer(CDP, MayStore, MayLoad, HasSideEffects).Analyze(Inst.TheDef);
-
- // InstAnalyzer only correctly analyzes mayStore/mayLoad so far.
- if (Inst.mayStore) { // If the .td file explicitly sets mayStore, use it.
- // If we decided that this is a store from the pattern, then the .td file
- // entry is redundant.
- if (MayStore)
- fprintf(stderr,
- "Warning: mayStore flag explicitly set on instruction '%s'"
- " but flag already inferred from pattern.\n",
- Inst.TheDef->getName().c_str());
- MayStore = true;
- }
-
- if (Inst.mayLoad) { // If the .td file explicitly sets mayLoad, use it.
- // If we decided that this is a load from the pattern, then the .td file
- // entry is redundant.
- if (MayLoad)
- fprintf(stderr,
- "Warning: mayLoad flag explicitly set on instruction '%s'"
- " but flag already inferred from pattern.\n",
- Inst.TheDef->getName().c_str());
- MayLoad = true;
- }
-
- if (Inst.neverHasSideEffects) {
- if (HadPattern)
- fprintf(stderr, "Warning: neverHasSideEffects set on instruction '%s' "
- "which already has a pattern\n", Inst.TheDef->getName().c_str());
- HasSideEffects = false;
- }
-
- if (Inst.hasSideEffects) {
- if (HasSideEffects)
- fprintf(stderr, "Warning: hasSideEffects set on instruction '%s' "
- "which already inferred this.\n", Inst.TheDef->getName().c_str());
- HasSideEffects = true;
- }
-}
-
-/// ParseInstructions - Parse all of the instructions, inlining and resolving
-/// any fragments involved. This populates the Instructions list with fully
-/// resolved instructions.
-void CodeGenDAGPatterns::ParseInstructions() {
- std::vector<Record*> Instrs = Records.getAllDerivedDefinitions("Instruction");
-
- for (unsigned i = 0, e = Instrs.size(); i != e; ++i) {
- ListInit *LI = 0;
-
- if (dynamic_cast<ListInit*>(Instrs[i]->getValueInit("Pattern")))
- LI = Instrs[i]->getValueAsListInit("Pattern");
-
- // If there is no pattern, only collect minimal information about the
- // instruction for its operand list. We have to assume that there is one
- // result, as we have no detailed info.
- if (!LI || LI->getSize() == 0) {
- std::vector<Record*> Results;
- std::vector<Record*> Operands;
-
- CodeGenInstruction &InstInfo =Target.getInstruction(Instrs[i]->getName());
-
- if (InstInfo.OperandList.size() != 0) {
- if (InstInfo.NumDefs == 0) {
- // These produce no results
- for (unsigned j = 0, e = InstInfo.OperandList.size(); j < e; ++j)
- Operands.push_back(InstInfo.OperandList[j].Rec);
- } else {
- // Assume the first operand is the result.
- Results.push_back(InstInfo.OperandList[0].Rec);
-
- // The rest are inputs.
- for (unsigned j = 1, e = InstInfo.OperandList.size(); j < e; ++j)
- Operands.push_back(InstInfo.OperandList[j].Rec);
- }
- }
-
- // Create and insert the instruction.
- std::vector<Record*> ImpResults;
- std::vector<Record*> ImpOperands;
- Instructions.insert(std::make_pair(Instrs[i],
- DAGInstruction(0, Results, Operands, ImpResults,
- ImpOperands)));
- continue; // no pattern.
- }
-
- // Parse the instruction.
- TreePattern *I = new TreePattern(Instrs[i], LI, true, *this);
- // Inline pattern fragments into it.
- I->InlinePatternFragments();
-
- // Infer as many types as possible. If we cannot infer all of them, we can
- // never do anything with this instruction pattern: report it to the user.
- if (!I->InferAllTypes())
- I->error("Could not infer all types in pattern!");
-
- // InstInputs - Keep track of all of the inputs of the instruction, along
- // with the record they are declared as.
- std::map<std::string, TreePatternNode*> InstInputs;
-
- // InstResults - Keep track of all the virtual registers that are 'set'
- // in the instruction, including what reg class they are.
- std::map<std::string, TreePatternNode*> InstResults;
-
- std::vector<Record*> InstImpInputs;
- std::vector<Record*> InstImpResults;
-
- // Verify that the top-level forms in the instruction are of void type, and
- // fill in the InstResults map.
- for (unsigned j = 0, e = I->getNumTrees(); j != e; ++j) {
- TreePatternNode *Pat = I->getTree(j);
- if (Pat->getExtTypeNum(0) != MVT::isVoid)
- I->error("Top-level forms in instruction pattern should have"
- " void types");
-
- // Find inputs and outputs, and verify the structure of the uses/defs.
- FindPatternInputsAndOutputs(I, Pat, InstInputs, InstResults,
- InstImpInputs, InstImpResults);
- }
-
- // Now that we have inputs and outputs of the pattern, inspect the operands
- // list for the instruction. This determines the order that operands are
- // added to the machine instruction the node corresponds to.
- unsigned NumResults = InstResults.size();
-
- // Parse the operands list from the (ops) list, validating it.
- assert(I->getArgList().empty() && "Args list should still be empty here!");
- CodeGenInstruction &CGI = Target.getInstruction(Instrs[i]->getName());
-
- // Check that all of the results occur first in the list.
- std::vector<Record*> Results;
- TreePatternNode *Res0Node = NULL;
- for (unsigned i = 0; i != NumResults; ++i) {
- if (i == CGI.OperandList.size())
- I->error("'" + InstResults.begin()->first +
- "' set but does not appear in operand list!");
- const std::string &OpName = CGI.OperandList[i].Name;
-
- // Check that it exists in InstResults.
- TreePatternNode *RNode = InstResults[OpName];
- if (RNode == 0)
- I->error("Operand $" + OpName + " does not exist in operand list!");
-
- if (i == 0)
- Res0Node = RNode;
- Record *R = dynamic_cast<DefInit*>(RNode->getLeafValue())->getDef();
- if (R == 0)
- I->error("Operand $" + OpName + " should be a set destination: all "
- "outputs must occur before inputs in operand list!");
-
- if (CGI.OperandList[i].Rec != R)
- I->error("Operand $" + OpName + " class mismatch!");
-
- // Remember the return type.
- Results.push_back(CGI.OperandList[i].Rec);
-
- // Okay, this one checks out.
- InstResults.erase(OpName);
- }
-
- // Loop over the inputs next. Make a copy of InstInputs so we can destroy
- // the copy while we're checking the inputs.
- std::map<std::string, TreePatternNode*> InstInputsCheck(InstInputs);
-
- std::vector<TreePatternNode*> ResultNodeOperands;
- std::vector<Record*> Operands;
- for (unsigned i = NumResults, e = CGI.OperandList.size(); i != e; ++i) {
- CodeGenInstruction::OperandInfo &Op = CGI.OperandList[i];
- const std::string &OpName = Op.Name;
- if (OpName.empty())
- I->error("Operand #" + utostr(i) + " in operands list has no name!");
-
- if (!InstInputsCheck.count(OpName)) {
- // If this is an predicate operand or optional def operand with an
- // DefaultOps set filled in, we can ignore this. When we codegen it,
- // we will do so as always executed.
- if (Op.Rec->isSubClassOf("PredicateOperand") ||
- Op.Rec->isSubClassOf("OptionalDefOperand")) {
- // Does it have a non-empty DefaultOps field? If so, ignore this
- // operand.
- if (!getDefaultOperand(Op.Rec).DefaultOps.empty())
- continue;
- }
- I->error("Operand $" + OpName +
- " does not appear in the instruction pattern");
- }
- TreePatternNode *InVal = InstInputsCheck[OpName];
- InstInputsCheck.erase(OpName); // It occurred, remove from map.
-
- if (InVal->isLeaf() &&
- dynamic_cast<DefInit*>(InVal->getLeafValue())) {
- Record *InRec = static_cast<DefInit*>(InVal->getLeafValue())->getDef();
- if (Op.Rec != InRec && !InRec->isSubClassOf("ComplexPattern"))
- I->error("Operand $" + OpName + "'s register class disagrees"
- " between the operand and pattern");
- }
- Operands.push_back(Op.Rec);
-
- // Construct the result for the dest-pattern operand list.
- TreePatternNode *OpNode = InVal->clone();
-
- // No predicate is useful on the result.
- OpNode->setPredicateFn("");
-
- // Promote the xform function to be an explicit node if set.
- if (Record *Xform = OpNode->getTransformFn()) {
- OpNode->setTransformFn(0);
- std::vector<TreePatternNode*> Children;
- Children.push_back(OpNode);
- OpNode = new TreePatternNode(Xform, Children);
- }
-
- ResultNodeOperands.push_back(OpNode);
- }
-
- if (!InstInputsCheck.empty())
- I->error("Input operand $" + InstInputsCheck.begin()->first +
- " occurs in pattern but not in operands list!");
-
- TreePatternNode *ResultPattern =
- new TreePatternNode(I->getRecord(), ResultNodeOperands);
- // Copy fully inferred output node type to instruction result pattern.
- if (NumResults > 0)
- ResultPattern->setTypes(Res0Node->getExtTypes());
-
- // Create and insert the instruction.
- // FIXME: InstImpResults and InstImpInputs should not be part of
- // DAGInstruction.
- DAGInstruction TheInst(I, Results, Operands, InstImpResults, InstImpInputs);
- Instructions.insert(std::make_pair(I->getRecord(), TheInst));
-
- // Use a temporary tree pattern to infer all types and make sure that the
- // constructed result is correct. This depends on the instruction already
- // being inserted into the Instructions map.
- TreePattern Temp(I->getRecord(), ResultPattern, false, *this);
- Temp.InferAllTypes();
-
- DAGInstruction &TheInsertedInst = Instructions.find(I->getRecord())->second;
- TheInsertedInst.setResultPattern(Temp.getOnlyTree());
-
- DEBUG(I->dump());
- }
-
- // If we can, convert the instructions to be patterns that are matched!
- for (std::map<Record*, DAGInstruction>::iterator II = Instructions.begin(),
- E = Instructions.end(); II != E; ++II) {
- DAGInstruction &TheInst = II->second;
- const TreePattern *I = TheInst.getPattern();
- if (I == 0) continue; // No pattern.
-
- // FIXME: Assume only the first tree is the pattern. The others are clobber
- // nodes.
- TreePatternNode *Pattern = I->getTree(0);
- TreePatternNode *SrcPattern;
- if (Pattern->getOperator()->getName() == "set") {
- SrcPattern = Pattern->getChild(Pattern->getNumChildren()-1)->clone();
- } else{
- // Not a set (store or something?)
- SrcPattern = Pattern;
- }
-
- std::string Reason;
- if (!SrcPattern->canPatternMatch(Reason, *this))
- I->error("Instruction can never match: " + Reason);
-
- Record *Instr = II->first;
- TreePatternNode *DstPattern = TheInst.getResultPattern();
- PatternsToMatch.
- push_back(PatternToMatch(Instr->getValueAsListInit("Predicates"),
- SrcPattern, DstPattern, TheInst.getImpResults(),
- Instr->getValueAsInt("AddedComplexity")));
- }
-}
-
-
-void CodeGenDAGPatterns::InferInstructionFlags() {
- std::map<std::string, CodeGenInstruction> &InstrDescs =
- Target.getInstructions();
- for (std::map<std::string, CodeGenInstruction>::iterator
- II = InstrDescs.begin(), E = InstrDescs.end(); II != E; ++II) {
- CodeGenInstruction &InstInfo = II->second;
- // Determine properties of the instruction from its pattern.
- bool MayStore, MayLoad, HasSideEffects;
- InferFromPattern(InstInfo, MayStore, MayLoad, HasSideEffects, *this);
- InstInfo.mayStore = MayStore;
- InstInfo.mayLoad = MayLoad;
- InstInfo.hasSideEffects = HasSideEffects;
- }
-}
-
-void CodeGenDAGPatterns::ParsePatterns() {
- std::vector<Record*> Patterns = Records.getAllDerivedDefinitions("Pattern");
-
- for (unsigned i = 0, e = Patterns.size(); i != e; ++i) {
- DagInit *Tree = Patterns[i]->getValueAsDag("PatternToMatch");
- DefInit *OpDef = dynamic_cast<DefInit*>(Tree->getOperator());
- Record *Operator = OpDef->getDef();
- TreePattern *Pattern;
- if (Operator->getName() != "parallel")
- Pattern = new TreePattern(Patterns[i], Tree, true, *this);
- else {
- std::vector<Init*> Values;
- for (unsigned j = 0, ee = Tree->getNumArgs(); j != ee; ++j)
- Values.push_back(Tree->getArg(j));
- ListInit *LI = new ListInit(Values);
- Pattern = new TreePattern(Patterns[i], LI, true, *this);
- }
-
- // Inline pattern fragments into it.
- Pattern->InlinePatternFragments();
-
- ListInit *LI = Patterns[i]->getValueAsListInit("ResultInstrs");
- if (LI->getSize() == 0) continue; // no pattern.
-
- // Parse the instruction.
- TreePattern *Result = new TreePattern(Patterns[i], LI, false, *this);
-
- // Inline pattern fragments into it.
- Result->InlinePatternFragments();
-
- if (Result->getNumTrees() != 1)
- Result->error("Cannot handle instructions producing instructions "
- "with temporaries yet!");
-
- bool IterateInference;
- bool InferredAllPatternTypes, InferredAllResultTypes;
- do {
- // Infer as many types as possible. If we cannot infer all of them, we
- // can never do anything with this pattern: report it to the user.
- InferredAllPatternTypes = Pattern->InferAllTypes();
-
- // Infer as many types as possible. If we cannot infer all of them, we
- // can never do anything with this pattern: report it to the user.
- InferredAllResultTypes = Result->InferAllTypes();
-
- // Apply the type of the result to the source pattern. This helps us
- // resolve cases where the input type is known to be a pointer type (which
- // is considered resolved), but the result knows it needs to be 32- or
- // 64-bits. Infer the other way for good measure.
- IterateInference = Pattern->getTree(0)->
- UpdateNodeType(Result->getTree(0)->getExtTypes(), *Result);
- IterateInference |= Result->getTree(0)->
- UpdateNodeType(Pattern->getTree(0)->getExtTypes(), *Result);
- } while (IterateInference);
-
- // Verify that we inferred enough types that we can do something with the
- // pattern and result. If these fire the user has to add type casts.
- if (!InferredAllPatternTypes)
- Pattern->error("Could not infer all types in pattern!");
- if (!InferredAllResultTypes)
- Result->error("Could not infer all types in pattern result!");
-
- // Validate that the input pattern is correct.
- std::map<std::string, TreePatternNode*> InstInputs;
- std::map<std::string, TreePatternNode*> InstResults;
- std::vector<Record*> InstImpInputs;
- std::vector<Record*> InstImpResults;
- for (unsigned j = 0, ee = Pattern->getNumTrees(); j != ee; ++j)
- FindPatternInputsAndOutputs(Pattern, Pattern->getTree(j),
- InstInputs, InstResults,
- InstImpInputs, InstImpResults);
-
- // Promote the xform function to be an explicit node if set.
- TreePatternNode *DstPattern = Result->getOnlyTree();
- std::vector<TreePatternNode*> ResultNodeOperands;
- for (unsigned ii = 0, ee = DstPattern->getNumChildren(); ii != ee; ++ii) {
- TreePatternNode *OpNode = DstPattern->getChild(ii);
- if (Record *Xform = OpNode->getTransformFn()) {
- OpNode->setTransformFn(0);
- std::vector<TreePatternNode*> Children;
- Children.push_back(OpNode);
- OpNode = new TreePatternNode(Xform, Children);
- }
- ResultNodeOperands.push_back(OpNode);
- }
- DstPattern = Result->getOnlyTree();
- if (!DstPattern->isLeaf())
- DstPattern = new TreePatternNode(DstPattern->getOperator(),
- ResultNodeOperands);
- DstPattern->setTypes(Result->getOnlyTree()->getExtTypes());
- TreePattern Temp(Result->getRecord(), DstPattern, false, *this);
- Temp.InferAllTypes();
-
- std::string Reason;
- if (!Pattern->getTree(0)->canPatternMatch(Reason, *this))
- Pattern->error("Pattern can never match: " + Reason);
-
- PatternsToMatch.
- push_back(PatternToMatch(Patterns[i]->getValueAsListInit("Predicates"),
- Pattern->getTree(0),
- Temp.getOnlyTree(), InstImpResults,
- Patterns[i]->getValueAsInt("AddedComplexity")));
- }
-}
-
-/// CombineChildVariants - Given a bunch of permutations of each child of the
-/// 'operator' node, put them together in all possible ways.
-static void CombineChildVariants(TreePatternNode *Orig,
- const std::vector<std::vector<TreePatternNode*> > &ChildVariants,
- std::vector<TreePatternNode*> &OutVariants,
- CodeGenDAGPatterns &CDP,
- const MultipleUseVarSet &DepVars) {
- // Make sure that each operand has at least one variant to choose from.
- for (unsigned i = 0, e = ChildVariants.size(); i != e; ++i)
- if (ChildVariants[i].empty())
- return;
-
- // The end result is an all-pairs construction of the resultant pattern.
- std::vector<unsigned> Idxs;
- Idxs.resize(ChildVariants.size());
- bool NotDone;
- do {
-#ifndef NDEBUG
- if (DebugFlag && !Idxs.empty()) {
- cerr << Orig->getOperator()->getName() << ": Idxs = [ ";
- for (unsigned i = 0; i < Idxs.size(); ++i) {
- cerr << Idxs[i] << " ";
- }
- cerr << "]\n";
- }
-#endif
- // Create the variant and add it to the output list.
- std::vector<TreePatternNode*> NewChildren;
- for (unsigned i = 0, e = ChildVariants.size(); i != e; ++i)
- NewChildren.push_back(ChildVariants[i][Idxs[i]]);
- TreePatternNode *R = new TreePatternNode(Orig->getOperator(), NewChildren);
-
- // Copy over properties.
- R->setName(Orig->getName());
- R->setPredicateFn(Orig->getPredicateFn());
- R->setTransformFn(Orig->getTransformFn());
- R->setTypes(Orig->getExtTypes());
-
- // If this pattern cannot match, do not include it as a variant.
- std::string ErrString;
- if (!R->canPatternMatch(ErrString, CDP)) {
- delete R;
- } else {
- bool AlreadyExists = false;
-
- // Scan to see if this pattern has already been emitted. We can get
- // duplication due to things like commuting:
- // (and GPRC:$a, GPRC:$b) -> (and GPRC:$b, GPRC:$a)
- // which are the same pattern. Ignore the dups.
- for (unsigned i = 0, e = OutVariants.size(); i != e; ++i)
- if (R->isIsomorphicTo(OutVariants[i], DepVars)) {
- AlreadyExists = true;
- break;
- }
-
- if (AlreadyExists)
- delete R;
- else
- OutVariants.push_back(R);
- }
-
- // Increment indices to the next permutation by incrementing the
- // indicies from last index backward, e.g., generate the sequence
- // [0, 0], [0, 1], [1, 0], [1, 1].
- int IdxsIdx;
- for (IdxsIdx = Idxs.size() - 1; IdxsIdx >= 0; --IdxsIdx) {
- if (++Idxs[IdxsIdx] == ChildVariants[IdxsIdx].size())
- Idxs[IdxsIdx] = 0;
- else
- break;
- }
- NotDone = (IdxsIdx >= 0);
- } while (NotDone);
-}
-
-/// CombineChildVariants - A helper function for binary operators.
-///
-static void CombineChildVariants(TreePatternNode *Orig,
- const std::vector<TreePatternNode*> &LHS,
- const std::vector<TreePatternNode*> &RHS,
- std::vector<TreePatternNode*> &OutVariants,
- CodeGenDAGPatterns &CDP,
- const MultipleUseVarSet &DepVars) {
- std::vector<std::vector<TreePatternNode*> > ChildVariants;
- ChildVariants.push_back(LHS);
- ChildVariants.push_back(RHS);
- CombineChildVariants(Orig, ChildVariants, OutVariants, CDP, DepVars);
-}
-
-
-static void GatherChildrenOfAssociativeOpcode(TreePatternNode *N,
- std::vector<TreePatternNode *> &Children) {
- assert(N->getNumChildren()==2 &&"Associative but doesn't have 2 children!");
- Record *Operator = N->getOperator();
-
- // Only permit raw nodes.
- if (!N->getName().empty() || !N->getPredicateFn().empty() ||
- N->getTransformFn()) {
- Children.push_back(N);
- return;
- }
-
- if (N->getChild(0)->isLeaf() || N->getChild(0)->getOperator() != Operator)
- Children.push_back(N->getChild(0));
- else
- GatherChildrenOfAssociativeOpcode(N->getChild(0), Children);
-
- if (N->getChild(1)->isLeaf() || N->getChild(1)->getOperator() != Operator)
- Children.push_back(N->getChild(1));
- else
- GatherChildrenOfAssociativeOpcode(N->getChild(1), Children);
-}
-
-/// GenerateVariantsOf - Given a pattern N, generate all permutations we can of
-/// the (potentially recursive) pattern by using algebraic laws.
-///
-static void GenerateVariantsOf(TreePatternNode *N,
- std::vector<TreePatternNode*> &OutVariants,
- CodeGenDAGPatterns &CDP,
- const MultipleUseVarSet &DepVars) {
- // We cannot permute leaves.
- if (N->isLeaf()) {
- OutVariants.push_back(N);
- return;
- }
-
- // Look up interesting info about the node.
- const SDNodeInfo &NodeInfo = CDP.getSDNodeInfo(N->getOperator());
-
- // If this node is associative, reassociate.
- if (NodeInfo.hasProperty(SDNPAssociative)) {
- // Reassociate by pulling together all of the linked operators
- std::vector<TreePatternNode*> MaximalChildren;
- GatherChildrenOfAssociativeOpcode(N, MaximalChildren);
-
- // Only handle child sizes of 3. Otherwise we'll end up trying too many
- // permutations.
- if (MaximalChildren.size() == 3) {
- // Find the variants of all of our maximal children.
- std::vector<TreePatternNode*> AVariants, BVariants, CVariants;
- GenerateVariantsOf(MaximalChildren[0], AVariants, CDP, DepVars);
- GenerateVariantsOf(MaximalChildren[1], BVariants, CDP, DepVars);
- GenerateVariantsOf(MaximalChildren[2], CVariants, CDP, DepVars);
-
- // There are only two ways we can permute the tree:
- // (A op B) op C and A op (B op C)
- // Within these forms, we can also permute A/B/C.
-
- // Generate legal pair permutations of A/B/C.
- std::vector<TreePatternNode*> ABVariants;
- std::vector<TreePatternNode*> BAVariants;
- std::vector<TreePatternNode*> ACVariants;
- std::vector<TreePatternNode*> CAVariants;
- std::vector<TreePatternNode*> BCVariants;
- std::vector<TreePatternNode*> CBVariants;
- CombineChildVariants(N, AVariants, BVariants, ABVariants, CDP, DepVars);
- CombineChildVariants(N, BVariants, AVariants, BAVariants, CDP, DepVars);
- CombineChildVariants(N, AVariants, CVariants, ACVariants, CDP, DepVars);
- CombineChildVariants(N, CVariants, AVariants, CAVariants, CDP, DepVars);
- CombineChildVariants(N, BVariants, CVariants, BCVariants, CDP, DepVars);
- CombineChildVariants(N, CVariants, BVariants, CBVariants, CDP, DepVars);
-
- // Combine those into the result: (x op x) op x
- CombineChildVariants(N, ABVariants, CVariants, OutVariants, CDP, DepVars);
- CombineChildVariants(N, BAVariants, CVariants, OutVariants, CDP, DepVars);
- CombineChildVariants(N, ACVariants, BVariants, OutVariants, CDP, DepVars);
- CombineChildVariants(N, CAVariants, BVariants, OutVariants, CDP, DepVars);
- CombineChildVariants(N, BCVariants, AVariants, OutVariants, CDP, DepVars);
- CombineChildVariants(N, CBVariants, AVariants, OutVariants, CDP, DepVars);
-
- // Combine those into the result: x op (x op x)
- CombineChildVariants(N, CVariants, ABVariants, OutVariants, CDP, DepVars);
- CombineChildVariants(N, CVariants, BAVariants, OutVariants, CDP, DepVars);
- CombineChildVariants(N, BVariants, ACVariants, OutVariants, CDP, DepVars);
- CombineChildVariants(N, BVariants, CAVariants, OutVariants, CDP, DepVars);
- CombineChildVariants(N, AVariants, BCVariants, OutVariants, CDP, DepVars);
- CombineChildVariants(N, AVariants, CBVariants, OutVariants, CDP, DepVars);
- return;
- }
- }
-
- // Compute permutations of all children.
- std::vector<std::vector<TreePatternNode*> > ChildVariants;
- ChildVariants.resize(N->getNumChildren());
- for (unsigned i = 0, e = N->getNumChildren(); i != e; ++i)
- GenerateVariantsOf(N->getChild(i), ChildVariants[i], CDP, DepVars);
-
- // Build all permutations based on how the children were formed.
- CombineChildVariants(N, ChildVariants, OutVariants, CDP, DepVars);
-
- // If this node is commutative, consider the commuted order.
- if (NodeInfo.hasProperty(SDNPCommutative)) {
- assert(N->getNumChildren()==2 &&"Commutative but doesn't have 2 children!");
- // Don't count children which are actually register references.
- unsigned NC = 0;
- for (unsigned i = 0, e = N->getNumChildren(); i != e; ++i) {
- TreePatternNode *Child = N->getChild(i);
- if (Child->isLeaf())
- if (DefInit *DI = dynamic_cast<DefInit*>(Child->getLeafValue())) {
- Record *RR = DI->getDef();
- if (RR->isSubClassOf("Register"))
- continue;
- }
- NC++;
- }
- // Consider the commuted order.
- if (NC == 2)
- CombineChildVariants(N, ChildVariants[1], ChildVariants[0],
- OutVariants, CDP, DepVars);
- }
-}
-
-
-// GenerateVariants - Generate variants. For example, commutative patterns can
-// match multiple ways. Add them to PatternsToMatch as well.
-void CodeGenDAGPatterns::GenerateVariants() {
- DOUT << "Generating instruction variants.\n";
-
- // Loop over all of the patterns we've collected, checking to see if we can
- // generate variants of the instruction, through the exploitation of
- // identities. This permits the target to provide agressive matching without
- // the .td file having to contain tons of variants of instructions.
- //
- // Note that this loop adds new patterns to the PatternsToMatch list, but we
- // intentionally do not reconsider these. Any variants of added patterns have
- // already been added.
- //
- for (unsigned i = 0, e = PatternsToMatch.size(); i != e; ++i) {
- MultipleUseVarSet DepVars;
- std::vector<TreePatternNode*> Variants;
- FindDepVars(PatternsToMatch[i].getSrcPattern(), DepVars);
- DOUT << "Dependent/multiply used variables: ";
- DEBUG(DumpDepVars(DepVars));
- DOUT << "\n";
- GenerateVariantsOf(PatternsToMatch[i].getSrcPattern(), Variants, *this, DepVars);
-
- assert(!Variants.empty() && "Must create at least original variant!");
- Variants.erase(Variants.begin()); // Remove the original pattern.
-
- if (Variants.empty()) // No variants for this pattern.
- continue;
-
- DOUT << "FOUND VARIANTS OF: ";
- DEBUG(PatternsToMatch[i].getSrcPattern()->dump());
- DOUT << "\n";
-
- for (unsigned v = 0, e = Variants.size(); v != e; ++v) {
- TreePatternNode *Variant = Variants[v];
-
- DOUT << " VAR#" << v << ": ";
- DEBUG(Variant->dump());
- DOUT << "\n";
-
- // Scan to see if an instruction or explicit pattern already matches this.
- bool AlreadyExists = false;
- for (unsigned p = 0, e = PatternsToMatch.size(); p != e; ++p) {
- // Check to see if this variant already exists.
- if (Variant->isIsomorphicTo(PatternsToMatch[p].getSrcPattern(), DepVars)) {
- DOUT << " *** ALREADY EXISTS, ignoring variant.\n";
- AlreadyExists = true;
- break;
- }
- }
- // If we already have it, ignore the variant.
- if (AlreadyExists) continue;
-
- // Otherwise, add it to the list of patterns we have.
- PatternsToMatch.
- push_back(PatternToMatch(PatternsToMatch[i].getPredicates(),
- Variant, PatternsToMatch[i].getDstPattern(),
- PatternsToMatch[i].getDstRegs(),
- PatternsToMatch[i].getAddedComplexity()));
- }
-
- DOUT << "\n";
- }
-}
-
diff --git a/release_23/utils/TableGen/CodeGenDAGPatterns.h b/release_23/utils/TableGen/CodeGenDAGPatterns.h
deleted file mode 100644
index 0d29eb51658d..000000000000
--- a/release_23/utils/TableGen/CodeGenDAGPatterns.h
+++ /dev/null
@@ -1,572 +0,0 @@
-//===- CodeGenDAGPatterns.h - Read DAG patterns from .td file ---*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file declares the CodeGenDAGPatterns class, which is used to read and
-// represent the patterns present in a .td file for instructions.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef CODEGEN_DAGPATTERNS_H
-#define CODEGEN_DAGPATTERNS_H
-
-#include <set>
-
-#include "CodeGenTarget.h"
-#include "CodeGenIntrinsics.h"
-
-namespace llvm {
- class Record;
- struct Init;
- class ListInit;
- class DagInit;
- class SDNodeInfo;
- class TreePattern;
- class TreePatternNode;
- class CodeGenDAGPatterns;
- class ComplexPattern;
-
-/// MVT::DAGISelGenValueType - These are some extended forms of MVT::ValueType
-/// that we use as lattice values during type inferrence.
-namespace MVT {
- enum DAGISelGenValueType {
- isFP = MVT::LAST_VALUETYPE,
- isInt,
- isUnknown
- };
-
- /// isExtIntegerVT - Return true if the specified extended value type vector
- /// contains isInt or an integer value type.
- bool isExtIntegerInVTs(const std::vector<unsigned char> &EVTs);
-
- /// isExtFloatingPointVT - Return true if the specified extended value type
- /// vector contains isFP or a FP value type.
- bool isExtFloatingPointInVTs(const std::vector<unsigned char> &EVTs);
-}
-
-/// Set type used to track multiply used variables in patterns
-typedef std::set<std::string> MultipleUseVarSet;
-
-/// SDTypeConstraint - This is a discriminated union of constraints,
-/// corresponding to the SDTypeConstraint tablegen class in Target.td.
-struct SDTypeConstraint {
- SDTypeConstraint(Record *R);
-
- unsigned OperandNo; // The operand # this constraint applies to.
- enum {
- SDTCisVT, SDTCisPtrTy, SDTCisInt, SDTCisFP, SDTCisSameAs,
- SDTCisVTSmallerThanOp, SDTCisOpSmallerThanOp, SDTCisIntVectorOfSameSize,
- SDTCisEltOfVec
- } ConstraintType;
-
- union { // The discriminated union.
- struct {
- MVT::ValueType VT;
- } SDTCisVT_Info;
- struct {
- unsigned OtherOperandNum;
- } SDTCisSameAs_Info;
- struct {
- unsigned OtherOperandNum;
- } SDTCisVTSmallerThanOp_Info;
- struct {
- unsigned BigOperandNum;
- } SDTCisOpSmallerThanOp_Info;
- struct {
- unsigned OtherOperandNum;
- } SDTCisIntVectorOfSameSize_Info;
- struct {
- unsigned OtherOperandNum;
- } SDTCisEltOfVec_Info;
- } x;
-
- /// ApplyTypeConstraint - Given a node in a pattern, apply this type
- /// constraint to the nodes operands. This returns true if it makes a
- /// change, false otherwise. If a type contradiction is found, throw an
- /// exception.
- bool ApplyTypeConstraint(TreePatternNode *N, const SDNodeInfo &NodeInfo,
- TreePattern &TP) const;
-
- /// getOperandNum - Return the node corresponding to operand #OpNo in tree
- /// N, which has NumResults results.
- TreePatternNode *getOperandNum(unsigned OpNo, TreePatternNode *N,
- unsigned NumResults) const;
-};
-
-/// SDNodeInfo - One of these records is created for each SDNode instance in
-/// the target .td file. This represents the various dag nodes we will be
-/// processing.
-class SDNodeInfo {
- Record *Def;
- std::string EnumName;
- std::string SDClassName;
- unsigned Properties;
- unsigned NumResults;
- int NumOperands;
- std::vector<SDTypeConstraint> TypeConstraints;
-public:
- SDNodeInfo(Record *R); // Parse the specified record.
-
- unsigned getNumResults() const { return NumResults; }
- int getNumOperands() const { return NumOperands; }
- Record *getRecord() const { return Def; }
- const std::string &getEnumName() const { return EnumName; }
- const std::string &getSDClassName() const { return SDClassName; }
-
- const std::vector<SDTypeConstraint> &getTypeConstraints() const {
- return TypeConstraints;
- }
-
- /// hasProperty - Return true if this node has the specified property.
- ///
- bool hasProperty(enum SDNP Prop) const { return Properties & (1 << Prop); }
-
- /// ApplyTypeConstraints - Given a node in a pattern, apply the type
- /// constraints for this node to the operands of the node. This returns
- /// true if it makes a change, false otherwise. If a type contradiction is
- /// found, throw an exception.
- bool ApplyTypeConstraints(TreePatternNode *N, TreePattern &TP) const {
- bool MadeChange = false;
- for (unsigned i = 0, e = TypeConstraints.size(); i != e; ++i)
- MadeChange |= TypeConstraints[i].ApplyTypeConstraint(N, *this, TP);
- return MadeChange;
- }
-};
-
-/// FIXME: TreePatternNode's can be shared in some cases (due to dag-shaped
-/// patterns), and as such should be ref counted. We currently just leak all
-/// TreePatternNode objects!
-class TreePatternNode {
- /// The inferred type for this node, or MVT::isUnknown if it hasn't
- /// been determined yet.
- std::vector<unsigned char> Types;
-
- /// Operator - The Record for the operator if this is an interior node (not
- /// a leaf).
- Record *Operator;
-
- /// Val - The init value (e.g. the "GPRC" record, or "7") for a leaf.
- ///
- Init *Val;
-
- /// Name - The name given to this node with the :$foo notation.
- ///
- std::string Name;
-
- /// PredicateFn - The predicate function to execute on this node to check
- /// for a match. If this string is empty, no predicate is involved.
- std::string PredicateFn;
-
- /// TransformFn - The transformation function to execute on this node before
- /// it can be substituted into the resulting instruction on a pattern match.
- Record *TransformFn;
-
- std::vector<TreePatternNode*> Children;
-public:
- TreePatternNode(Record *Op, const std::vector<TreePatternNode*> &Ch)
- : Types(), Operator(Op), Val(0), TransformFn(0),
- Children(Ch) { Types.push_back(MVT::isUnknown); }
- TreePatternNode(Init *val) // leaf ctor
- : Types(), Operator(0), Val(val), TransformFn(0) {
- Types.push_back(MVT::isUnknown);
- }
- ~TreePatternNode();
-
- const std::string &getName() const { return Name; }
- void setName(const std::string &N) { Name = N; }
-
- bool isLeaf() const { return Val != 0; }
- bool hasTypeSet() const {
- return (Types[0] < MVT::LAST_VALUETYPE) || (Types[0] == MVT::iPTR);
- }
- bool isTypeCompletelyUnknown() const {
- return Types[0] == MVT::isUnknown;
- }
- bool isTypeDynamicallyResolved() const {
- return Types[0] == MVT::iPTR;
- }
- MVT::ValueType getTypeNum(unsigned Num) const {
- assert(hasTypeSet() && "Doesn't have a type yet!");
- assert(Types.size() > Num && "Type num out of range!");
- return (MVT::ValueType)Types[Num];
- }
- unsigned char getExtTypeNum(unsigned Num) const {
- assert(Types.size() > Num && "Extended type num out of range!");
- return Types[Num];
- }
- const std::vector<unsigned char> &getExtTypes() const { return Types; }
- void setTypes(const std::vector<unsigned char> &T) { Types = T; }
- void removeTypes() { Types = std::vector<unsigned char>(1,MVT::isUnknown); }
-
- Init *getLeafValue() const { assert(isLeaf()); return Val; }
- Record *getOperator() const { assert(!isLeaf()); return Operator; }
-
- unsigned getNumChildren() const { return Children.size(); }
- TreePatternNode *getChild(unsigned N) const { return Children[N]; }
- void setChild(unsigned i, TreePatternNode *N) {
- Children[i] = N;
- }
-
- const std::string &getPredicateFn() const { return PredicateFn; }
- void setPredicateFn(const std::string &Fn) { PredicateFn = Fn; }
-
- Record *getTransformFn() const { return TransformFn; }
- void setTransformFn(Record *Fn) { TransformFn = Fn; }
-
- /// getIntrinsicInfo - If this node corresponds to an intrinsic, return the
- /// CodeGenIntrinsic information for it, otherwise return a null pointer.
- const CodeGenIntrinsic *getIntrinsicInfo(const CodeGenDAGPatterns &CDP) const;
-
- void print(std::ostream &OS) const;
- void dump() const;
-
-public: // Higher level manipulation routines.
-
- /// clone - Return a new copy of this tree.
- ///
- TreePatternNode *clone() const;
-
- /// isIsomorphicTo - Return true if this node is recursively isomorphic to
- /// the specified node. For this comparison, all of the state of the node
- /// is considered, except for the assigned name. Nodes with differing names
- /// that are otherwise identical are considered isomorphic.
- bool isIsomorphicTo(const TreePatternNode *N,
- const MultipleUseVarSet &DepVars) const;
-
- /// SubstituteFormalArguments - Replace the formal arguments in this tree
- /// with actual values specified by ArgMap.
- void SubstituteFormalArguments(std::map<std::string,
- TreePatternNode*> &ArgMap);
-
- /// InlinePatternFragments - If this pattern refers to any pattern
- /// fragments, inline them into place, giving us a pattern without any
- /// PatFrag references.
- TreePatternNode *InlinePatternFragments(TreePattern &TP);
-
- /// ApplyTypeConstraints - Apply all of the type constraints relevent to
- /// this node and its children in the tree. This returns true if it makes a
- /// change, false otherwise. If a type contradiction is found, throw an
- /// exception.
- bool ApplyTypeConstraints(TreePattern &TP, bool NotRegisters);
-
- /// UpdateNodeType - Set the node type of N to VT if VT contains
- /// information. If N already contains a conflicting type, then throw an
- /// exception. This returns true if any information was updated.
- ///
- bool UpdateNodeType(const std::vector<unsigned char> &ExtVTs,
- TreePattern &TP);
- bool UpdateNodeType(unsigned char ExtVT, TreePattern &TP) {
- std::vector<unsigned char> ExtVTs(1, ExtVT);
- return UpdateNodeType(ExtVTs, TP);
- }
-
- /// ContainsUnresolvedType - Return true if this tree contains any
- /// unresolved types.
- bool ContainsUnresolvedType() const {
- if (!hasTypeSet() && !isTypeDynamicallyResolved()) return true;
- for (unsigned i = 0, e = getNumChildren(); i != e; ++i)
- if (getChild(i)->ContainsUnresolvedType()) return true;
- return false;
- }
-
- /// canPatternMatch - If it is impossible for this pattern to match on this
- /// target, fill in Reason and return false. Otherwise, return true.
- bool canPatternMatch(std::string &Reason, const CodeGenDAGPatterns &CDP);
-};
-
-
-/// TreePattern - Represent a pattern, used for instructions, pattern
-/// fragments, etc.
-///
-class TreePattern {
- /// Trees - The list of pattern trees which corresponds to this pattern.
- /// Note that PatFrag's only have a single tree.
- ///
- std::vector<TreePatternNode*> Trees;
-
- /// TheRecord - The actual TableGen record corresponding to this pattern.
- ///
- Record *TheRecord;
-
- /// Args - This is a list of all of the arguments to this pattern (for
- /// PatFrag patterns), which are the 'node' markers in this pattern.
- std::vector<std::string> Args;
-
- /// CDP - the top-level object coordinating this madness.
- ///
- CodeGenDAGPatterns &CDP;
-
- /// isInputPattern - True if this is an input pattern, something to match.
- /// False if this is an output pattern, something to emit.
- bool isInputPattern;
-public:
-
- /// TreePattern constructor - Parse the specified DagInits into the
- /// current record.
- TreePattern(Record *TheRec, ListInit *RawPat, bool isInput,
- CodeGenDAGPatterns &ise);
- TreePattern(Record *TheRec, DagInit *Pat, bool isInput,
- CodeGenDAGPatterns &ise);
- TreePattern(Record *TheRec, TreePatternNode *Pat, bool isInput,
- CodeGenDAGPatterns &ise);
-
- /// getTrees - Return the tree patterns which corresponds to this pattern.
- ///
- const std::vector<TreePatternNode*> &getTrees() const { return Trees; }
- unsigned getNumTrees() const { return Trees.size(); }
- TreePatternNode *getTree(unsigned i) const { return Trees[i]; }
- TreePatternNode *getOnlyTree() const {
- assert(Trees.size() == 1 && "Doesn't have exactly one pattern!");
- return Trees[0];
- }
-
- /// getRecord - Return the actual TableGen record corresponding to this
- /// pattern.
- ///
- Record *getRecord() const { return TheRecord; }
-
- unsigned getNumArgs() const { return Args.size(); }
- const std::string &getArgName(unsigned i) const {
- assert(i < Args.size() && "Argument reference out of range!");
- return Args[i];
- }
- std::vector<std::string> &getArgList() { return Args; }
-
- CodeGenDAGPatterns &getDAGPatterns() const { return CDP; }
-
- /// InlinePatternFragments - If this pattern refers to any pattern
- /// fragments, inline them into place, giving us a pattern without any
- /// PatFrag references.
- void InlinePatternFragments() {
- for (unsigned i = 0, e = Trees.size(); i != e; ++i)
- Trees[i] = Trees[i]->InlinePatternFragments(*this);
- }
-
- /// InferAllTypes - Infer/propagate as many types throughout the expression
- /// patterns as possible. Return true if all types are infered, false
- /// otherwise. Throw an exception if a type contradiction is found.
- bool InferAllTypes();
-
- /// error - Throw an exception, prefixing it with information about this
- /// pattern.
- void error(const std::string &Msg) const;
-
- void print(std::ostream &OS) const;
- void dump() const;
-
-private:
- TreePatternNode *ParseTreePattern(DagInit *DI);
-};
-
-/// DAGDefaultOperand - One of these is created for each PredicateOperand
-/// or OptionalDefOperand that has a set ExecuteAlways / DefaultOps field.
-struct DAGDefaultOperand {
- std::vector<TreePatternNode*> DefaultOps;
-};
-
-class DAGInstruction {
- TreePattern *Pattern;
- std::vector<Record*> Results;
- std::vector<Record*> Operands;
- std::vector<Record*> ImpResults;
- std::vector<Record*> ImpOperands;
- TreePatternNode *ResultPattern;
-public:
- DAGInstruction(TreePattern *TP,
- const std::vector<Record*> &results,
- const std::vector<Record*> &operands,
- const std::vector<Record*> &impresults,
- const std::vector<Record*> &impoperands)
- : Pattern(TP), Results(results), Operands(operands),
- ImpResults(impresults), ImpOperands(impoperands),
- ResultPattern(0) {}
-
- const TreePattern *getPattern() const { return Pattern; }
- unsigned getNumResults() const { return Results.size(); }
- unsigned getNumOperands() const { return Operands.size(); }
- unsigned getNumImpResults() const { return ImpResults.size(); }
- unsigned getNumImpOperands() const { return ImpOperands.size(); }
- const std::vector<Record*>& getImpResults() const { return ImpResults; }
-
- void setResultPattern(TreePatternNode *R) { ResultPattern = R; }
-
- Record *getResult(unsigned RN) const {
- assert(RN < Results.size());
- return Results[RN];
- }
-
- Record *getOperand(unsigned ON) const {
- assert(ON < Operands.size());
- return Operands[ON];
- }
-
- Record *getImpResult(unsigned RN) const {
- assert(RN < ImpResults.size());
- return ImpResults[RN];
- }
-
- Record *getImpOperand(unsigned ON) const {
- assert(ON < ImpOperands.size());
- return ImpOperands[ON];
- }
-
- TreePatternNode *getResultPattern() const { return ResultPattern; }
-};
-
-/// PatternToMatch - Used by CodeGenDAGPatterns to keep tab of patterns
-/// processed to produce isel.
-struct PatternToMatch {
- PatternToMatch(ListInit *preds,
- TreePatternNode *src, TreePatternNode *dst,
- const std::vector<Record*> &dstregs,
- unsigned complexity):
- Predicates(preds), SrcPattern(src), DstPattern(dst), Dstregs(dstregs),
- AddedComplexity(complexity) {};
-
- ListInit *Predicates; // Top level predicate conditions to match.
- TreePatternNode *SrcPattern; // Source pattern to match.
- TreePatternNode *DstPattern; // Resulting pattern.
- std::vector<Record*> Dstregs; // Physical register defs being matched.
- unsigned AddedComplexity; // Add to matching pattern complexity.
-
- ListInit *getPredicates() const { return Predicates; }
- TreePatternNode *getSrcPattern() const { return SrcPattern; }
- TreePatternNode *getDstPattern() const { return DstPattern; }
- const std::vector<Record*> &getDstRegs() const { return Dstregs; }
- unsigned getAddedComplexity() const { return AddedComplexity; }
-};
-
-
-class CodeGenDAGPatterns {
- RecordKeeper &Records;
- CodeGenTarget Target;
- std::vector<CodeGenIntrinsic> Intrinsics;
-
- std::map<Record*, SDNodeInfo> SDNodes;
- std::map<Record*, std::pair<Record*, std::string> > SDNodeXForms;
- std::map<Record*, ComplexPattern> ComplexPatterns;
- std::map<Record*, TreePattern*> PatternFragments;
- std::map<Record*, DAGDefaultOperand> DefaultOperands;
- std::map<Record*, DAGInstruction> Instructions;
-
- // Specific SDNode definitions:
- Record *intrinsic_void_sdnode;
- Record *intrinsic_w_chain_sdnode, *intrinsic_wo_chain_sdnode;
-
- /// PatternsToMatch - All of the things we are matching on the DAG. The first
- /// value is the pattern to match, the second pattern is the result to
- /// emit.
- std::vector<PatternToMatch> PatternsToMatch;
-public:
- CodeGenDAGPatterns(RecordKeeper &R);
- ~CodeGenDAGPatterns();
-
- CodeGenTarget &getTargetInfo() { return Target; }
- const CodeGenTarget &getTargetInfo() const { return Target; }
-
- Record *getSDNodeNamed(const std::string &Name) const;
-
- const SDNodeInfo &getSDNodeInfo(Record *R) const {
- assert(SDNodes.count(R) && "Unknown node!");
- return SDNodes.find(R)->second;
- }
-
- // Node transformation lookups.
- typedef std::pair<Record*, std::string> NodeXForm;
- const NodeXForm &getSDNodeTransform(Record *R) const {
- assert(SDNodeXForms.count(R) && "Invalid transform!");
- return SDNodeXForms.find(R)->second;
- }
-
- typedef std::map<Record*, NodeXForm>::const_iterator nx_iterator;
- nx_iterator nx_begin() const { return SDNodeXForms.begin(); }
- nx_iterator nx_end() const { return SDNodeXForms.end(); }
-
-
- const ComplexPattern &getComplexPattern(Record *R) const {
- assert(ComplexPatterns.count(R) && "Unknown addressing mode!");
- return ComplexPatterns.find(R)->second;
- }
-
- const CodeGenIntrinsic &getIntrinsic(Record *R) const {
- for (unsigned i = 0, e = Intrinsics.size(); i != e; ++i)
- if (Intrinsics[i].TheDef == R) return Intrinsics[i];
- assert(0 && "Unknown intrinsic!");
- abort();
- }
-
- const CodeGenIntrinsic &getIntrinsicInfo(unsigned IID) const {
- assert(IID-1 < Intrinsics.size() && "Bad intrinsic ID!");
- return Intrinsics[IID-1];
- }
-
- unsigned getIntrinsicID(Record *R) const {
- for (unsigned i = 0, e = Intrinsics.size(); i != e; ++i)
- if (Intrinsics[i].TheDef == R) return i;
- assert(0 && "Unknown intrinsic!");
- abort();
- }
-
- const DAGDefaultOperand &getDefaultOperand(Record *R) {
- assert(DefaultOperands.count(R) &&"Isn't an analyzed default operand!");
- return DefaultOperands.find(R)->second;
- }
-
- // Pattern Fragment information.
- TreePattern *getPatternFragment(Record *R) const {
- assert(PatternFragments.count(R) && "Invalid pattern fragment request!");
- return PatternFragments.find(R)->second;
- }
- typedef std::map<Record*, TreePattern*>::const_iterator pf_iterator;
- pf_iterator pf_begin() const { return PatternFragments.begin(); }
- pf_iterator pf_end() const { return PatternFragments.end(); }
-
- // Patterns to match information.
- typedef std::vector<PatternToMatch>::const_iterator ptm_iterator;
- ptm_iterator ptm_begin() const { return PatternsToMatch.begin(); }
- ptm_iterator ptm_end() const { return PatternsToMatch.end(); }
-
-
-
- const DAGInstruction &getInstruction(Record *R) const {
- assert(Instructions.count(R) && "Unknown instruction!");
- return Instructions.find(R)->second;
- }
-
- Record *get_intrinsic_void_sdnode() const {
- return intrinsic_void_sdnode;
- }
- Record *get_intrinsic_w_chain_sdnode() const {
- return intrinsic_w_chain_sdnode;
- }
- Record *get_intrinsic_wo_chain_sdnode() const {
- return intrinsic_wo_chain_sdnode;
- }
-
-private:
- void ParseNodeInfo();
- void ParseNodeTransforms();
- void ParseComplexPatterns();
- void ParsePatternFragments();
- void ParseDefaultOperands();
- void ParseInstructions();
- void ParsePatterns();
- void InferInstructionFlags();
- void GenerateVariants();
-
- void FindPatternInputsAndOutputs(TreePattern *I, TreePatternNode *Pat,
- std::map<std::string,
- TreePatternNode*> &InstInputs,
- std::map<std::string,
- TreePatternNode*> &InstResults,
- std::vector<Record*> &InstImpInputs,
- std::vector<Record*> &InstImpResults);
-};
-} // end namespace llvm
-
-#endif
diff --git a/release_23/utils/TableGen/CodeGenInstruction.cpp b/release_23/utils/TableGen/CodeGenInstruction.cpp
deleted file mode 100644
index 53daf9d94463..000000000000
--- a/release_23/utils/TableGen/CodeGenInstruction.cpp
+++ /dev/null
@@ -1,271 +0,0 @@
-//===- CodeGenInstruction.cpp - CodeGen Instruction Class Wrapper ---------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the CodeGenInstruction class.
-//
-//===----------------------------------------------------------------------===//
-
-#include "CodeGenInstruction.h"
-#include "Record.h"
-#include "llvm/ADT/StringExtras.h"
-#include <set>
-using namespace llvm;
-
-static void ParseConstraint(const std::string &CStr, CodeGenInstruction *I) {
- // FIXME: Only supports TIED_TO for now.
- std::string::size_type pos = CStr.find_first_of('=');
- assert(pos != std::string::npos && "Unrecognized constraint");
- std::string Name = CStr.substr(0, pos);
-
- // TIED_TO: $src1 = $dst
- std::string::size_type wpos = Name.find_first_of(" \t");
- if (wpos == std::string::npos)
- throw "Illegal format for tied-to constraint: '" + CStr + "'";
- std::string DestOpName = Name.substr(0, wpos);
- std::pair<unsigned,unsigned> DestOp = I->ParseOperandName(DestOpName, false);
-
- Name = CStr.substr(pos+1);
- wpos = Name.find_first_not_of(" \t");
- if (wpos == std::string::npos)
- throw "Illegal format for tied-to constraint: '" + CStr + "'";
-
- std::pair<unsigned,unsigned> SrcOp =
- I->ParseOperandName(Name.substr(wpos), false);
- if (SrcOp > DestOp)
- throw "Illegal tied-to operand constraint '" + CStr + "'";
-
-
- unsigned FlatOpNo = I->getFlattenedOperandNumber(SrcOp);
- // Build the string for the operand.
- std::string OpConstraint =
- "((" + utostr(FlatOpNo) + " << 16) | (1 << TOI::TIED_TO))";
-
-
- if (!I->OperandList[DestOp.first].Constraints[DestOp.second].empty())
- throw "Operand '" + DestOpName + "' cannot have multiple constraints!";
- I->OperandList[DestOp.first].Constraints[DestOp.second] = OpConstraint;
-}
-
-static void ParseConstraints(const std::string &CStr, CodeGenInstruction *I) {
- // Make sure the constraints list for each operand is large enough to hold
- // constraint info, even if none is present.
- for (unsigned i = 0, e = I->OperandList.size(); i != e; ++i)
- I->OperandList[i].Constraints.resize(I->OperandList[i].MINumOperands);
-
- if (CStr.empty()) return;
-
- const std::string delims(",");
- std::string::size_type bidx, eidx;
-
- bidx = CStr.find_first_not_of(delims);
- while (bidx != std::string::npos) {
- eidx = CStr.find_first_of(delims, bidx);
- if (eidx == std::string::npos)
- eidx = CStr.length();
-
- ParseConstraint(CStr.substr(bidx, eidx), I);
- bidx = CStr.find_first_not_of(delims, eidx);
- }
-}
-
-CodeGenInstruction::CodeGenInstruction(Record *R, const std::string &AsmStr)
- : TheDef(R), AsmString(AsmStr) {
- Namespace = R->getValueAsString("Namespace");
-
- isReturn = R->getValueAsBit("isReturn");
- isBranch = R->getValueAsBit("isBranch");
- isIndirectBranch = R->getValueAsBit("isIndirectBranch");
- isBarrier = R->getValueAsBit("isBarrier");
- isCall = R->getValueAsBit("isCall");
- isSimpleLoad = R->getValueAsBit("isSimpleLoad");
- mayLoad = R->getValueAsBit("mayLoad");
- mayStore = R->getValueAsBit("mayStore");
- bool isTwoAddress = R->getValueAsBit("isTwoAddress");
- isPredicable = R->getValueAsBit("isPredicable");
- isConvertibleToThreeAddress = R->getValueAsBit("isConvertibleToThreeAddress");
- isCommutable = R->getValueAsBit("isCommutable");
- isTerminator = R->getValueAsBit("isTerminator");
- isReMaterializable = R->getValueAsBit("isReMaterializable");
- hasDelaySlot = R->getValueAsBit("hasDelaySlot");
- usesCustomDAGSchedInserter = R->getValueAsBit("usesCustomDAGSchedInserter");
- hasCtrlDep = R->getValueAsBit("hasCtrlDep");
- isNotDuplicable = R->getValueAsBit("isNotDuplicable");
- hasSideEffects = R->getValueAsBit("hasSideEffects");
- mayHaveSideEffects = R->getValueAsBit("mayHaveSideEffects");
- neverHasSideEffects = R->getValueAsBit("neverHasSideEffects");
- hasOptionalDef = false;
- isVariadic = false;
-
- if (mayHaveSideEffects + neverHasSideEffects + hasSideEffects > 1)
- throw R->getName() + ": multiple conflicting side-effect flags set!";
-
- DagInit *DI;
- try {
- DI = R->getValueAsDag("OutOperandList");
- } catch (...) {
- // Error getting operand list, just ignore it (sparcv9).
- AsmString.clear();
- OperandList.clear();
- return;
- }
- NumDefs = DI->getNumArgs();
-
- DagInit *IDI;
- try {
- IDI = R->getValueAsDag("InOperandList");
- } catch (...) {
- // Error getting operand list, just ignore it (sparcv9).
- AsmString.clear();
- OperandList.clear();
- return;
- }
- DI = (DagInit*)(new BinOpInit(BinOpInit::CONCAT, DI, IDI))->Fold();
-
- unsigned MIOperandNo = 0;
- std::set<std::string> OperandNames;
- for (unsigned i = 0, e = DI->getNumArgs(); i != e; ++i) {
- DefInit *Arg = dynamic_cast<DefInit*>(DI->getArg(i));
- if (!Arg)
- throw "Illegal operand for the '" + R->getName() + "' instruction!";
-
- Record *Rec = Arg->getDef();
- std::string PrintMethod = "printOperand";
- unsigned NumOps = 1;
- DagInit *MIOpInfo = 0;
- if (Rec->isSubClassOf("Operand")) {
- PrintMethod = Rec->getValueAsString("PrintMethod");
- MIOpInfo = Rec->getValueAsDag("MIOperandInfo");
-
- // Verify that MIOpInfo has an 'ops' root value.
- if (!dynamic_cast<DefInit*>(MIOpInfo->getOperator()) ||
- dynamic_cast<DefInit*>(MIOpInfo->getOperator())
- ->getDef()->getName() != "ops")
- throw "Bad value for MIOperandInfo in operand '" + Rec->getName() +
- "'\n";
-
- // If we have MIOpInfo, then we have #operands equal to number of entries
- // in MIOperandInfo.
- if (unsigned NumArgs = MIOpInfo->getNumArgs())
- NumOps = NumArgs;
-
- if (Rec->isSubClassOf("PredicateOperand"))
- isPredicable = true;
- else if (Rec->isSubClassOf("OptionalDefOperand"))
- hasOptionalDef = true;
- } else if (Rec->getName() == "variable_ops") {
- isVariadic = true;
- continue;
- } else if (!Rec->isSubClassOf("RegisterClass") &&
- Rec->getName() != "ptr_rc" && Rec->getName() != "unknown")
- throw "Unknown operand class '" + Rec->getName() +
- "' in instruction '" + R->getName() + "' instruction!";
-
- // Check that the operand has a name and that it's unique.
- if (DI->getArgName(i).empty())
- throw "In instruction '" + R->getName() + "', operand #" + utostr(i) +
- " has no name!";
- if (!OperandNames.insert(DI->getArgName(i)).second)
- throw "In instruction '" + R->getName() + "', operand #" + utostr(i) +
- " has the same name as a previous operand!";
-
- OperandList.push_back(OperandInfo(Rec, DI->getArgName(i), PrintMethod,
- MIOperandNo, NumOps, MIOpInfo));
- MIOperandNo += NumOps;
- }
-
- // Parse Constraints.
- ParseConstraints(R->getValueAsString("Constraints"), this);
-
- // For backward compatibility: isTwoAddress means operand 1 is tied to
- // operand 0.
- if (isTwoAddress) {
- if (!OperandList[1].Constraints[0].empty())
- throw R->getName() + ": cannot use isTwoAddress property: instruction "
- "already has constraint set!";
- OperandList[1].Constraints[0] = "((0 << 16) | (1 << TOI::TIED_TO))";
- }
-
- // Any operands with unset constraints get 0 as their constraint.
- for (unsigned op = 0, e = OperandList.size(); op != e; ++op)
- for (unsigned j = 0, e = OperandList[op].MINumOperands; j != e; ++j)
- if (OperandList[op].Constraints[j].empty())
- OperandList[op].Constraints[j] = "0";
-
- // Parse the DisableEncoding field.
- std::string DisableEncoding = R->getValueAsString("DisableEncoding");
- while (1) {
- std::string OpName = getToken(DisableEncoding, " ,\t");
- if (OpName.empty()) break;
-
- // Figure out which operand this is.
- std::pair<unsigned,unsigned> Op = ParseOperandName(OpName, false);
-
- // Mark the operand as not-to-be encoded.
- if (Op.second >= OperandList[Op.first].DoNotEncode.size())
- OperandList[Op.first].DoNotEncode.resize(Op.second+1);
- OperandList[Op.first].DoNotEncode[Op.second] = true;
- }
-}
-
-/// getOperandNamed - Return the index of the operand with the specified
-/// non-empty name. If the instruction does not have an operand with the
-/// specified name, throw an exception.
-///
-unsigned CodeGenInstruction::getOperandNamed(const std::string &Name) const {
- assert(!Name.empty() && "Cannot search for operand with no name!");
- for (unsigned i = 0, e = OperandList.size(); i != e; ++i)
- if (OperandList[i].Name == Name) return i;
- throw "Instruction '" + TheDef->getName() +
- "' does not have an operand named '$" + Name + "'!";
-}
-
-std::pair<unsigned,unsigned>
-CodeGenInstruction::ParseOperandName(const std::string &Op,
- bool AllowWholeOp) {
- if (Op.empty() || Op[0] != '$')
- throw TheDef->getName() + ": Illegal operand name: '" + Op + "'";
-
- std::string OpName = Op.substr(1);
- std::string SubOpName;
-
- // Check to see if this is $foo.bar.
- std::string::size_type DotIdx = OpName.find_first_of(".");
- if (DotIdx != std::string::npos) {
- SubOpName = OpName.substr(DotIdx+1);
- if (SubOpName.empty())
- throw TheDef->getName() + ": illegal empty suboperand name in '" +Op +"'";
- OpName = OpName.substr(0, DotIdx);
- }
-
- unsigned OpIdx = getOperandNamed(OpName);
-
- if (SubOpName.empty()) { // If no suboperand name was specified:
- // If one was needed, throw.
- if (OperandList[OpIdx].MINumOperands > 1 && !AllowWholeOp &&
- SubOpName.empty())
- throw TheDef->getName() + ": Illegal to refer to"
- " whole operand part of complex operand '" + Op + "'";
-
- // Otherwise, return the operand.
- return std::make_pair(OpIdx, 0U);
- }
-
- // Find the suboperand number involved.
- DagInit *MIOpInfo = OperandList[OpIdx].MIOperandInfo;
- if (MIOpInfo == 0)
- throw TheDef->getName() + ": unknown suboperand name in '" + Op + "'";
-
- // Find the operand with the right name.
- for (unsigned i = 0, e = MIOpInfo->getNumArgs(); i != e; ++i)
- if (MIOpInfo->getArgName(i) == SubOpName)
- return std::make_pair(OpIdx, i);
-
- // Otherwise, didn't find it!
- throw TheDef->getName() + ": unknown suboperand name in '" + Op + "'";
-}
diff --git a/release_23/utils/TableGen/CodeGenInstruction.h b/release_23/utils/TableGen/CodeGenInstruction.h
deleted file mode 100644
index 9bfd4323f914..000000000000
--- a/release_23/utils/TableGen/CodeGenInstruction.h
+++ /dev/null
@@ -1,150 +0,0 @@
-//===- CodeGenInstruction.h - Instruction Class Wrapper ---------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines a wrapper class for the 'Instruction' TableGen class.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef CODEGEN_INSTRUCTION_H
-#define CODEGEN_INSTRUCTION_H
-
-#include "llvm/CodeGen/ValueTypes.h"
-#include <string>
-#include <vector>
-#include <utility>
-
-namespace llvm {
- class Record;
- class DagInit;
-
- class CodeGenInstruction {
- public:
- Record *TheDef; // The actual record defining this instruction.
- std::string Namespace; // The namespace the instruction is in.
-
- /// AsmString - The format string used to emit a .s file for the
- /// instruction.
- std::string AsmString;
-
- /// OperandInfo - The information we keep track of for each operand in the
- /// operand list for a tablegen instruction.
- struct OperandInfo {
- /// Rec - The definition this operand is declared as.
- ///
- Record *Rec;
-
- /// Name - If this operand was assigned a symbolic name, this is it,
- /// otherwise, it's empty.
- std::string Name;
-
- /// PrinterMethodName - The method used to print operands of this type in
- /// the asmprinter.
- std::string PrinterMethodName;
-
- /// MIOperandNo - Currently (this is meant to be phased out), some logical
- /// operands correspond to multiple MachineInstr operands. In the X86
- /// target for example, one address operand is represented as 4
- /// MachineOperands. Because of this, the operand number in the
- /// OperandList may not match the MachineInstr operand num. Until it
- /// does, this contains the MI operand index of this operand.
- unsigned MIOperandNo;
- unsigned MINumOperands; // The number of operands.
-
- /// DoNotEncode - Bools are set to true in this vector for each operand in
- /// the DisableEncoding list. These should not be emitted by the code
- /// emitter.
- std::vector<bool> DoNotEncode;
-
- /// MIOperandInfo - Default MI operand type. Note an operand may be made
- /// up of multiple MI operands.
- DagInit *MIOperandInfo;
-
- /// Constraint info for this operand. This operand can have pieces, so we
- /// track constraint info for each.
- std::vector<std::string> Constraints;
-
- OperandInfo(Record *R, const std::string &N, const std::string &PMN,
- unsigned MION, unsigned MINO, DagInit *MIOI)
- : Rec(R), Name(N), PrinterMethodName(PMN), MIOperandNo(MION),
- MINumOperands(MINO), MIOperandInfo(MIOI) {}
- };
-
- /// NumDefs - Number of def operands declared.
- ///
- unsigned NumDefs;
-
- /// OperandList - The list of declared operands, along with their declared
- /// type (which is a record).
- std::vector<OperandInfo> OperandList;
-
- // Various boolean values we track for the instruction.
- bool isReturn;
- bool isBranch;
- bool isIndirectBranch;
- bool isBarrier;
- bool isCall;
- bool isSimpleLoad;
- bool mayLoad, mayStore;
- bool isPredicable;
- bool isConvertibleToThreeAddress;
- bool isCommutable;
- bool isTerminator;
- bool isReMaterializable;
- bool hasDelaySlot;
- bool usesCustomDAGSchedInserter;
- bool isVariadic;
- bool hasCtrlDep;
- bool isNotDuplicable;
- bool hasOptionalDef;
- bool hasSideEffects, mayHaveSideEffects, neverHasSideEffects;
-
- /// ParseOperandName - Parse an operand name like "$foo" or "$foo.bar",
- /// where $foo is a whole operand and $foo.bar refers to a suboperand.
- /// This throws an exception if the name is invalid. If AllowWholeOp is
- /// true, references to operands with suboperands are allowed, otherwise
- /// not.
- std::pair<unsigned,unsigned> ParseOperandName(const std::string &Op,
- bool AllowWholeOp = true);
-
- /// getFlattenedOperandNumber - Flatten a operand/suboperand pair into a
- /// flat machineinstr operand #.
- unsigned getFlattenedOperandNumber(std::pair<unsigned,unsigned> Op) const {
- return OperandList[Op.first].MIOperandNo + Op.second;
- }
-
- /// getSubOperandNumber - Unflatten a operand number into an
- /// operand/suboperand pair.
- std::pair<unsigned,unsigned> getSubOperandNumber(unsigned Op) const {
- for (unsigned i = 0; ; ++i) {
- assert(i < OperandList.size() && "Invalid flat operand #");
- if (OperandList[i].MIOperandNo+OperandList[i].MINumOperands > Op)
- return std::make_pair(i, Op-OperandList[i].MIOperandNo);
- }
- }
-
-
- /// isFlatOperandNotEmitted - Return true if the specified flat operand #
- /// should not be emitted with the code emitter.
- bool isFlatOperandNotEmitted(unsigned FlatOpNo) const {
- std::pair<unsigned,unsigned> Op = getSubOperandNumber(FlatOpNo);
- if (OperandList[Op.first].DoNotEncode.size() > Op.second)
- return OperandList[Op.first].DoNotEncode[Op.second];
- return false;
- }
-
- CodeGenInstruction(Record *R, const std::string &AsmStr);
-
- /// getOperandNamed - Return the index of the operand with the specified
- /// non-empty name. If the instruction does not have an operand with the
- /// specified name, throw an exception.
- unsigned getOperandNamed(const std::string &Name) const;
- };
-}
-
-#endif
diff --git a/release_23/utils/TableGen/CodeGenIntrinsics.h b/release_23/utils/TableGen/CodeGenIntrinsics.h
deleted file mode 100644
index 4515ebcdc6aa..000000000000
--- a/release_23/utils/TableGen/CodeGenIntrinsics.h
+++ /dev/null
@@ -1,60 +0,0 @@
-//===- CodeGenIntrinsic.h - Intrinsic Class Wrapper ------------*- C++ -*--===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines a wrapper class for the 'Intrinsic' TableGen class.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef CODEGEN_INTRINSIC_H
-#define CODEGEN_INTRINSIC_H
-
-#include <string>
-#include <vector>
-#include "llvm/CodeGen/ValueTypes.h"
-
-namespace llvm {
- class Record;
- class RecordKeeper;
- class CodeGenTarget;
-
- struct CodeGenIntrinsic {
- Record *TheDef; // The actual record defining this intrinsic.
- std::string Name; // The name of the LLVM function "llvm.bswap.i32"
- std::string EnumName; // The name of the enum "bswap_i32"
- std::string GCCBuiltinName;// Name of the corresponding GCC builtin, or "".
- std::string TargetPrefix; // Target prefix, e.g. "ppc" for t-s intrinsics.
-
- /// ArgVTs - The MVT::ValueType for each argument type. Note that this list
- /// is only populated when in the context of a target .td file. When
- /// building Intrinsics.td, this isn't available, because we don't know the
- /// target pointer size.
- std::vector<MVT::ValueType> ArgVTs;
-
- /// ArgTypeDefs - The records for each argument type.
- ///
- std::vector<Record*> ArgTypeDefs;
-
- // Memory mod/ref behavior of this intrinsic.
- enum {
- NoMem, ReadArgMem, ReadMem, WriteArgMem, WriteMem
- } ModRef;
-
- // This is set to true if the intrinsic is overloaded by its argument
- // types.
- bool isOverloaded;
-
- CodeGenIntrinsic(Record *R);
- };
-
- /// LoadIntrinsics - Read all of the intrinsics defined in the specified
- /// .td file.
- std::vector<CodeGenIntrinsic> LoadIntrinsics(const RecordKeeper &RC);
-}
-
-#endif
diff --git a/release_23/utils/TableGen/CodeGenRegisters.h b/release_23/utils/TableGen/CodeGenRegisters.h
deleted file mode 100644
index 0f1b501fc14f..000000000000
--- a/release_23/utils/TableGen/CodeGenRegisters.h
+++ /dev/null
@@ -1,61 +0,0 @@
-//===- CodeGenRegisters.h - Register and RegisterClass Info -----*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines structures to encapsulate information gleaned from the
-// target register and register class definitions.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef CODEGEN_REGISTERS_H
-#define CODEGEN_REGISTERS_H
-
-#include "llvm/CodeGen/ValueTypes.h"
-#include <string>
-#include <vector>
-#include <cstdlib>
-
-namespace llvm {
- class Record;
-
- /// CodeGenRegister - Represents a register definition.
- struct CodeGenRegister {
- Record *TheDef;
- const std::string &getName() const;
- unsigned DeclaredSpillSize, DeclaredSpillAlignment;
- CodeGenRegister(Record *R);
- };
-
-
- struct CodeGenRegisterClass {
- Record *TheDef;
- std::string Namespace;
- std::vector<Record*> Elements;
- std::vector<MVT::ValueType> VTs;
- unsigned SpillSize;
- unsigned SpillAlignment;
- int CopyCost;
- std::vector<Record*> SubRegClasses;
- std::string MethodProtos, MethodBodies;
-
- const std::string &getName() const;
- const std::vector<MVT::ValueType> &getValueTypes() const { return VTs; }
- unsigned getNumValueTypes() const { return VTs.size(); }
-
- MVT::ValueType getValueTypeNum(unsigned VTNum) const {
- if (VTNum < VTs.size())
- return VTs[VTNum];
- assert(0 && "VTNum greater than number of ValueTypes in RegClass!");
- abort();
- }
-
- CodeGenRegisterClass(Record *R);
- };
-}
-
-#endif
diff --git a/release_23/utils/TableGen/CodeGenTarget.cpp b/release_23/utils/TableGen/CodeGenTarget.cpp
deleted file mode 100644
index 78d39ee06fcb..000000000000
--- a/release_23/utils/TableGen/CodeGenTarget.cpp
+++ /dev/null
@@ -1,475 +0,0 @@
-//===- CodeGenTarget.cpp - CodeGen Target Class Wrapper -------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This class wraps target description classes used by the various code
-// generation TableGen backends. This makes it easier to access the data and
-// provides a single place that needs to check it for validity. All of these
-// classes throw exceptions on error conditions.
-//
-//===----------------------------------------------------------------------===//
-
-#include "CodeGenTarget.h"
-#include "CodeGenIntrinsics.h"
-#include "Record.h"
-#include "llvm/ADT/StringExtras.h"
-#include "llvm/Support/CommandLine.h"
-#include "llvm/Support/Streams.h"
-#include <algorithm>
-using namespace llvm;
-
-static cl::opt<unsigned>
-AsmWriterNum("asmwriternum", cl::init(0),
- cl::desc("Make -gen-asm-writer emit assembly writer #N"));
-
-/// getValueType - Return the MCV::ValueType that the specified TableGen record
-/// corresponds to.
-MVT::ValueType llvm::getValueType(Record *Rec) {
- return (MVT::ValueType)Rec->getValueAsInt("Value");
-}
-
-std::string llvm::getName(MVT::ValueType T) {
- switch (T) {
- case MVT::Other: return "UNKNOWN";
- case MVT::i1: return "MVT::i1";
- case MVT::i8: return "MVT::i8";
- case MVT::i16: return "MVT::i16";
- case MVT::i32: return "MVT::i32";
- case MVT::i64: return "MVT::i64";
- case MVT::i128: return "MVT::i128";
- case MVT::iAny: return "MVT::iAny";
- case MVT::fAny: return "MVT::fAny";
- case MVT::f32: return "MVT::f32";
- case MVT::f64: return "MVT::f64";
- case MVT::f80: return "MVT::f80";
- case MVT::f128: return "MVT::f128";
- case MVT::ppcf128: return "MVT::ppcf128";
- case MVT::Flag: return "MVT::Flag";
- case MVT::isVoid:return "MVT::void";
- case MVT::v8i8: return "MVT::v8i8";
- case MVT::v4i16: return "MVT::v4i16";
- case MVT::v2i32: return "MVT::v2i32";
- case MVT::v1i64: return "MVT::v1i64";
- case MVT::v16i8: return "MVT::v16i8";
- case MVT::v8i16: return "MVT::v8i16";
- case MVT::v4i32: return "MVT::v4i32";
- case MVT::v2i64: return "MVT::v2i64";
- case MVT::v2f32: return "MVT::v2f32";
- case MVT::v4f32: return "MVT::v4f32";
- case MVT::v2f64: return "MVT::v2f64";
- case MVT::v3i32: return "MVT::v3i32";
- case MVT::v3f32: return "MVT::v3f32";
- case MVT::iPTR: return "TLI.getPointerTy()";
- default: assert(0 && "ILLEGAL VALUE TYPE!"); return "";
- }
-}
-
-std::string llvm::getEnumName(MVT::ValueType T) {
- switch (T) {
- case MVT::Other: return "MVT::Other";
- case MVT::i1: return "MVT::i1";
- case MVT::i8: return "MVT::i8";
- case MVT::i16: return "MVT::i16";
- case MVT::i32: return "MVT::i32";
- case MVT::i64: return "MVT::i64";
- case MVT::i128: return "MVT::i128";
- case MVT::iAny: return "MVT::iAny";
- case MVT::fAny: return "MVT::fAny";
- case MVT::f32: return "MVT::f32";
- case MVT::f64: return "MVT::f64";
- case MVT::f80: return "MVT::f80";
- case MVT::f128: return "MVT::f128";
- case MVT::ppcf128: return "MVT::ppcf128";
- case MVT::Flag: return "MVT::Flag";
- case MVT::isVoid:return "MVT::isVoid";
- case MVT::v8i8: return "MVT::v8i8";
- case MVT::v4i16: return "MVT::v4i16";
- case MVT::v2i32: return "MVT::v2i32";
- case MVT::v1i64: return "MVT::v1i64";
- case MVT::v16i8: return "MVT::v16i8";
- case MVT::v8i16: return "MVT::v8i16";
- case MVT::v4i32: return "MVT::v4i32";
- case MVT::v2i64: return "MVT::v2i64";
- case MVT::v2f32: return "MVT::v2f32";
- case MVT::v4f32: return "MVT::v4f32";
- case MVT::v2f64: return "MVT::v2f64";
- case MVT::v3i32: return "MVT::v3i32";
- case MVT::v3f32: return "MVT::v3f32";
- case MVT::iPTR: return "MVT::iPTR";
- default: assert(0 && "ILLEGAL VALUE TYPE!"); return "";
- }
-}
-
-/// getQualifiedName - Return the name of the specified record, with a
-/// namespace qualifier if the record contains one.
-///
-std::string llvm::getQualifiedName(const Record *R) {
- std::string Namespace = R->getValueAsString("Namespace");
- if (Namespace.empty()) return R->getName();
- return Namespace + "::" + R->getName();
-}
-
-
-
-
-/// getTarget - Return the current instance of the Target class.
-///
-CodeGenTarget::CodeGenTarget() {
- std::vector<Record*> Targets = Records.getAllDerivedDefinitions("Target");
- if (Targets.size() == 0)
- throw std::string("ERROR: No 'Target' subclasses defined!");
- if (Targets.size() != 1)
- throw std::string("ERROR: Multiple subclasses of Target defined!");
- TargetRec = Targets[0];
-}
-
-
-const std::string &CodeGenTarget::getName() const {
- return TargetRec->getName();
-}
-
-Record *CodeGenTarget::getInstructionSet() const {
- return TargetRec->getValueAsDef("InstructionSet");
-}
-
-/// getAsmWriter - Return the AssemblyWriter definition for this target.
-///
-Record *CodeGenTarget::getAsmWriter() const {
- std::vector<Record*> LI = TargetRec->getValueAsListOfDefs("AssemblyWriters");
- if (AsmWriterNum >= LI.size())
- throw "Target does not have an AsmWriter #" + utostr(AsmWriterNum) + "!";
- return LI[AsmWriterNum];
-}
-
-void CodeGenTarget::ReadRegisters() const {
- std::vector<Record*> Regs = Records.getAllDerivedDefinitions("Register");
- if (Regs.empty())
- throw std::string("No 'Register' subclasses defined!");
-
- Registers.reserve(Regs.size());
- Registers.assign(Regs.begin(), Regs.end());
-}
-
-CodeGenRegister::CodeGenRegister(Record *R) : TheDef(R) {
- DeclaredSpillSize = R->getValueAsInt("SpillSize");
- DeclaredSpillAlignment = R->getValueAsInt("SpillAlignment");
-}
-
-const std::string &CodeGenRegister::getName() const {
- return TheDef->getName();
-}
-
-void CodeGenTarget::ReadRegisterClasses() const {
- std::vector<Record*> RegClasses =
- Records.getAllDerivedDefinitions("RegisterClass");
- if (RegClasses.empty())
- throw std::string("No 'RegisterClass' subclasses defined!");
-
- RegisterClasses.reserve(RegClasses.size());
- RegisterClasses.assign(RegClasses.begin(), RegClasses.end());
-}
-
-std::vector<unsigned char> CodeGenTarget::getRegisterVTs(Record *R) const {
- std::vector<unsigned char> Result;
- const std::vector<CodeGenRegisterClass> &RCs = getRegisterClasses();
- for (unsigned i = 0, e = RCs.size(); i != e; ++i) {
- const CodeGenRegisterClass &RC = RegisterClasses[i];
- for (unsigned ei = 0, ee = RC.Elements.size(); ei != ee; ++ei) {
- if (R == RC.Elements[ei]) {
- const std::vector<MVT::ValueType> &InVTs = RC.getValueTypes();
- for (unsigned i = 0, e = InVTs.size(); i != e; ++i)
- Result.push_back(InVTs[i]);
- }
- }
- }
- return Result;
-}
-
-
-CodeGenRegisterClass::CodeGenRegisterClass(Record *R) : TheDef(R) {
- // Rename anonymous register classes.
- if (R->getName().size() > 9 && R->getName()[9] == '.') {
- static unsigned AnonCounter = 0;
- R->setName("AnonRegClass_"+utostr(AnonCounter++));
- }
-
- std::vector<Record*> TypeList = R->getValueAsListOfDefs("RegTypes");
- for (unsigned i = 0, e = TypeList.size(); i != e; ++i) {
- Record *Type = TypeList[i];
- if (!Type->isSubClassOf("ValueType"))
- throw "RegTypes list member '" + Type->getName() +
- "' does not derive from the ValueType class!";
- VTs.push_back(getValueType(Type));
- }
- assert(!VTs.empty() && "RegisterClass must contain at least one ValueType!");
-
- std::vector<Record*> RegList = R->getValueAsListOfDefs("MemberList");
- for (unsigned i = 0, e = RegList.size(); i != e; ++i) {
- Record *Reg = RegList[i];
- if (!Reg->isSubClassOf("Register"))
- throw "Register Class member '" + Reg->getName() +
- "' does not derive from the Register class!";
- Elements.push_back(Reg);
- }
-
- std::vector<Record*> SubRegClassList =
- R->getValueAsListOfDefs("SubRegClassList");
- for (unsigned i = 0, e = SubRegClassList.size(); i != e; ++i) {
- Record *SubRegClass = SubRegClassList[i];
- if (!SubRegClass->isSubClassOf("RegisterClass"))
- throw "Register Class member '" + SubRegClass->getName() +
- "' does not derive from the RegisterClass class!";
- SubRegClasses.push_back(SubRegClass);
- }
-
- // Allow targets to override the size in bits of the RegisterClass.
- unsigned Size = R->getValueAsInt("Size");
-
- Namespace = R->getValueAsString("Namespace");
- SpillSize = Size ? Size : MVT::getSizeInBits(VTs[0]);
- SpillAlignment = R->getValueAsInt("Alignment");
- CopyCost = R->getValueAsInt("CopyCost");
- MethodBodies = R->getValueAsCode("MethodBodies");
- MethodProtos = R->getValueAsCode("MethodProtos");
-}
-
-const std::string &CodeGenRegisterClass::getName() const {
- return TheDef->getName();
-}
-
-void CodeGenTarget::ReadLegalValueTypes() const {
- const std::vector<CodeGenRegisterClass> &RCs = getRegisterClasses();
- for (unsigned i = 0, e = RCs.size(); i != e; ++i)
- for (unsigned ri = 0, re = RCs[i].VTs.size(); ri != re; ++ri)
- LegalValueTypes.push_back(RCs[i].VTs[ri]);
-
- // Remove duplicates.
- std::sort(LegalValueTypes.begin(), LegalValueTypes.end());
- LegalValueTypes.erase(std::unique(LegalValueTypes.begin(),
- LegalValueTypes.end()),
- LegalValueTypes.end());
-}
-
-
-void CodeGenTarget::ReadInstructions() const {
- std::vector<Record*> Insts = Records.getAllDerivedDefinitions("Instruction");
- if (Insts.size() <= 2)
- throw std::string("No 'Instruction' subclasses defined!");
-
- // Parse the instructions defined in the .td file.
- std::string InstFormatName =
- getAsmWriter()->getValueAsString("InstFormatName");
-
- for (unsigned i = 0, e = Insts.size(); i != e; ++i) {
- std::string AsmStr = Insts[i]->getValueAsString(InstFormatName);
- Instructions.insert(std::make_pair(Insts[i]->getName(),
- CodeGenInstruction(Insts[i], AsmStr)));
- }
-}
-
-/// getInstructionsByEnumValue - Return all of the instructions defined by the
-/// target, ordered by their enum value.
-void CodeGenTarget::
-getInstructionsByEnumValue(std::vector<const CodeGenInstruction*>
- &NumberedInstructions) {
- std::map<std::string, CodeGenInstruction>::const_iterator I;
- I = getInstructions().find("PHI");
- if (I == Instructions.end()) throw "Could not find 'PHI' instruction!";
- const CodeGenInstruction *PHI = &I->second;
-
- I = getInstructions().find("INLINEASM");
- if (I == Instructions.end()) throw "Could not find 'INLINEASM' instruction!";
- const CodeGenInstruction *INLINEASM = &I->second;
-
- I = getInstructions().find("LABEL");
- if (I == Instructions.end()) throw "Could not find 'LABEL' instruction!";
- const CodeGenInstruction *LABEL = &I->second;
-
- I = getInstructions().find("DECLARE");
- if (I == Instructions.end()) throw "Could not find 'DECLARE' instruction!";
- const CodeGenInstruction *DECLARE = &I->second;
-
- I = getInstructions().find("EXTRACT_SUBREG");
- if (I == Instructions.end())
- throw "Could not find 'EXTRACT_SUBREG' instruction!";
- const CodeGenInstruction *EXTRACT_SUBREG = &I->second;
-
- I = getInstructions().find("INSERT_SUBREG");
- if (I == Instructions.end())
- throw "Could not find 'INSERT_SUBREG' instruction!";
- const CodeGenInstruction *INSERT_SUBREG = &I->second;
-
- I = getInstructions().find("IMPLICIT_DEF");
- if (I == Instructions.end())
- throw "Could not find 'IMPLICIT_DEF' instruction!";
- const CodeGenInstruction *IMPLICIT_DEF = &I->second;
-
- I = getInstructions().find("SUBREG_TO_REG");
- if (I == Instructions.end())
- throw "Could not find 'SUBREG_TO_REG' instruction!";
- const CodeGenInstruction *SUBREG_TO_REG = &I->second;
-
- // Print out the rest of the instructions now.
- NumberedInstructions.push_back(PHI);
- NumberedInstructions.push_back(INLINEASM);
- NumberedInstructions.push_back(LABEL);
- NumberedInstructions.push_back(DECLARE);
- NumberedInstructions.push_back(EXTRACT_SUBREG);
- NumberedInstructions.push_back(INSERT_SUBREG);
- NumberedInstructions.push_back(IMPLICIT_DEF);
- NumberedInstructions.push_back(SUBREG_TO_REG);
- for (inst_iterator II = inst_begin(), E = inst_end(); II != E; ++II)
- if (&II->second != PHI &&
- &II->second != INLINEASM &&
- &II->second != LABEL &&
- &II->second != DECLARE &&
- &II->second != EXTRACT_SUBREG &&
- &II->second != INSERT_SUBREG &&
- &II->second != IMPLICIT_DEF &&
- &II->second != SUBREG_TO_REG)
- NumberedInstructions.push_back(&II->second);
-}
-
-
-/// isLittleEndianEncoding - Return whether this target encodes its instruction
-/// in little-endian format, i.e. bits laid out in the order [0..n]
-///
-bool CodeGenTarget::isLittleEndianEncoding() const {
- return getInstructionSet()->getValueAsBit("isLittleEndianEncoding");
-}
-
-//===----------------------------------------------------------------------===//
-// ComplexPattern implementation
-//
-ComplexPattern::ComplexPattern(Record *R) {
- Ty = ::getValueType(R->getValueAsDef("Ty"));
- NumOperands = R->getValueAsInt("NumOperands");
- SelectFunc = R->getValueAsString("SelectFunc");
- RootNodes = R->getValueAsListOfDefs("RootNodes");
-
- // Parse the properties.
- Properties = 0;
- std::vector<Record*> PropList = R->getValueAsListOfDefs("Properties");
- for (unsigned i = 0, e = PropList.size(); i != e; ++i)
- if (PropList[i]->getName() == "SDNPHasChain") {
- Properties |= 1 << SDNPHasChain;
- } else if (PropList[i]->getName() == "SDNPOptInFlag") {
- Properties |= 1 << SDNPOptInFlag;
- } else if (PropList[i]->getName() == "SDNPMayStore") {
- Properties |= 1 << SDNPMayStore;
- } else if (PropList[i]->getName() == "SDNPMayLoad") {
- Properties |= 1 << SDNPMayLoad;
- } else if (PropList[i]->getName() == "SDNPSideEffect") {
- Properties |= 1 << SDNPSideEffect;
- } else {
- cerr << "Unsupported SD Node property '" << PropList[i]->getName()
- << "' on ComplexPattern '" << R->getName() << "'!\n";
- exit(1);
- }
-
- // Parse the attributes.
- Attributes = 0;
- PropList = R->getValueAsListOfDefs("Attributes");
- for (unsigned i = 0, e = PropList.size(); i != e; ++i)
- if (PropList[i]->getName() == "CPAttrParentAsRoot") {
- Attributes |= 1 << CPAttrParentAsRoot;
- } else {
- cerr << "Unsupported pattern attribute '" << PropList[i]->getName()
- << "' on ComplexPattern '" << R->getName() << "'!\n";
- exit(1);
- }
-}
-
-//===----------------------------------------------------------------------===//
-// CodeGenIntrinsic Implementation
-//===----------------------------------------------------------------------===//
-
-std::vector<CodeGenIntrinsic> llvm::LoadIntrinsics(const RecordKeeper &RC) {
- std::vector<Record*> I = RC.getAllDerivedDefinitions("Intrinsic");
-
- std::vector<CodeGenIntrinsic> Result;
-
- for (unsigned i = 0, e = I.size(); i != e; ++i)
- Result.push_back(CodeGenIntrinsic(I[i]));
- return Result;
-}
-
-CodeGenIntrinsic::CodeGenIntrinsic(Record *R) {
- TheDef = R;
- std::string DefName = R->getName();
- ModRef = WriteMem;
- isOverloaded = false;
-
- if (DefName.size() <= 4 ||
- std::string(DefName.begin(), DefName.begin()+4) != "int_")
- throw "Intrinsic '" + DefName + "' does not start with 'int_'!";
- EnumName = std::string(DefName.begin()+4, DefName.end());
- if (R->getValue("GCCBuiltinName")) // Ignore a missing GCCBuiltinName field.
- GCCBuiltinName = R->getValueAsString("GCCBuiltinName");
- TargetPrefix = R->getValueAsString("TargetPrefix");
- Name = R->getValueAsString("LLVMName");
- if (Name == "") {
- // If an explicit name isn't specified, derive one from the DefName.
- Name = "llvm.";
- for (unsigned i = 0, e = EnumName.size(); i != e; ++i)
- if (EnumName[i] == '_')
- Name += '.';
- else
- Name += EnumName[i];
- } else {
- // Verify it starts with "llvm.".
- if (Name.size() <= 5 ||
- std::string(Name.begin(), Name.begin()+5) != "llvm.")
- throw "Intrinsic '" + DefName + "'s name does not start with 'llvm.'!";
- }
-
- // If TargetPrefix is specified, make sure that Name starts with
- // "llvm.<targetprefix>.".
- if (!TargetPrefix.empty()) {
- if (Name.size() < 6+TargetPrefix.size() ||
- std::string(Name.begin()+5, Name.begin()+6+TargetPrefix.size())
- != (TargetPrefix+"."))
- throw "Intrinsic '" + DefName + "' does not start with 'llvm." +
- TargetPrefix + ".'!";
- }
-
- // Parse the list of argument types.
- ListInit *TypeList = R->getValueAsListInit("Types");
- for (unsigned i = 0, e = TypeList->getSize(); i != e; ++i) {
- Record *TyEl = TypeList->getElementAsRecord(i);
- assert(TyEl->isSubClassOf("LLVMType") && "Expected a type!");
- MVT::ValueType VT = getValueType(TyEl->getValueAsDef("VT"));
- isOverloaded |= VT == MVT::iAny || VT == MVT::fAny;
- ArgVTs.push_back(VT);
- ArgTypeDefs.push_back(TyEl);
- }
- if (ArgVTs.size() == 0)
- throw "Intrinsic '"+DefName+"' needs at least a type for the ret value!";
-
-
- // Parse the intrinsic properties.
- ListInit *PropList = R->getValueAsListInit("Properties");
- for (unsigned i = 0, e = PropList->getSize(); i != e; ++i) {
- Record *Property = PropList->getElementAsRecord(i);
- assert(Property->isSubClassOf("IntrinsicProperty") &&
- "Expected a property!");
-
- if (Property->getName() == "IntrNoMem")
- ModRef = NoMem;
- else if (Property->getName() == "IntrReadArgMem")
- ModRef = ReadArgMem;
- else if (Property->getName() == "IntrReadMem")
- ModRef = ReadMem;
- else if (Property->getName() == "IntrWriteArgMem")
- ModRef = WriteArgMem;
- else if (Property->getName() == "IntrWriteMem")
- ModRef = WriteMem;
- else
- assert(0 && "Unknown property!");
- }
-}
diff --git a/release_23/utils/TableGen/CodeGenTarget.h b/release_23/utils/TableGen/CodeGenTarget.h
deleted file mode 100644
index b066b6aa2b5b..000000000000
--- a/release_23/utils/TableGen/CodeGenTarget.h
+++ /dev/null
@@ -1,200 +0,0 @@
-//===- CodeGenTarget.h - Target Class Wrapper -------------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines wrappers for the Target class and related global
-// functionality. This makes it easier to access the data and provides a single
-// place that needs to check it for validity. All of these classes throw
-// exceptions on error conditions.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef CODEGEN_TARGET_H
-#define CODEGEN_TARGET_H
-
-#include "CodeGenRegisters.h"
-#include "CodeGenInstruction.h"
-#include <iosfwd>
-#include <map>
-
-namespace llvm {
-
-class Record;
-class RecordKeeper;
-struct CodeGenRegister;
-class CodeGenTarget;
-
-// SelectionDAG node properties.
-enum SDNP {
- SDNPCommutative,
- SDNPAssociative,
- SDNPHasChain,
- SDNPOutFlag,
- SDNPInFlag,
- SDNPOptInFlag,
- SDNPMayLoad,
- SDNPMayStore,
- SDNPSideEffect
-};
-
-// ComplexPattern attributes.
-enum CPAttr { CPAttrParentAsRoot };
-
-/// getValueType - Return the MVT::ValueType that the specified TableGen record
-/// corresponds to.
-MVT::ValueType getValueType(Record *Rec);
-
-std::string getName(MVT::ValueType T);
-std::string getEnumName(MVT::ValueType T);
-
-/// getQualifiedName - Return the name of the specified record, with a
-/// namespace qualifier if the record contains one.
-std::string getQualifiedName(const Record *R);
-
-/// CodeGenTarget - This class corresponds to the Target class in the .td files.
-///
-class CodeGenTarget {
- Record *TargetRec;
-
- mutable std::map<std::string, CodeGenInstruction> Instructions;
- mutable std::vector<CodeGenRegister> Registers;
- mutable std::vector<CodeGenRegisterClass> RegisterClasses;
- mutable std::vector<MVT::ValueType> LegalValueTypes;
- void ReadRegisters() const;
- void ReadRegisterClasses() const;
- void ReadInstructions() const;
- void ReadLegalValueTypes() const;
-public:
- CodeGenTarget();
-
- Record *getTargetRecord() const { return TargetRec; }
- const std::string &getName() const;
-
- /// getInstructionSet - Return the InstructionSet object.
- ///
- Record *getInstructionSet() const;
-
- /// getAsmWriter - Return the AssemblyWriter definition for this target.
- ///
- Record *getAsmWriter() const;
-
- const std::vector<CodeGenRegister> &getRegisters() const {
- if (Registers.empty()) ReadRegisters();
- return Registers;
- }
-
- const std::vector<CodeGenRegisterClass> &getRegisterClasses() const {
- if (RegisterClasses.empty()) ReadRegisterClasses();
- return RegisterClasses;
- }
-
- const CodeGenRegisterClass &getRegisterClass(Record *R) const {
- const std::vector<CodeGenRegisterClass> &RC = getRegisterClasses();
- for (unsigned i = 0, e = RC.size(); i != e; ++i)
- if (RC[i].TheDef == R)
- return RC[i];
- assert(0 && "Didn't find the register class");
- abort();
- }
-
- /// getRegisterClassForRegister - Find the register class that contains the
- /// specified physical register. If there register exists in multiple
- /// register classes or is not in a register class, return null.
- const CodeGenRegisterClass *getRegisterClassForRegister(Record *R) const {
- const std::vector<CodeGenRegisterClass> &RCs = getRegisterClasses();
- const CodeGenRegisterClass *FoundRC = 0;
- for (unsigned i = 0, e = RCs.size(); i != e; ++i) {
- const CodeGenRegisterClass &RC = RegisterClasses[i];
- for (unsigned ei = 0, ee = RC.Elements.size(); ei != ee; ++ei) {
- if (R == RC.Elements[ei]) {
- if (FoundRC) return 0; // In multiple RC's
- FoundRC = &RC;
- break;
- }
- }
- }
- return FoundRC;
- }
-
- /// getRegisterVTs - Find the union of all possible ValueTypes for the
- /// specified physical register.
- std::vector<unsigned char> getRegisterVTs(Record *R) const;
-
- const std::vector<MVT::ValueType> &getLegalValueTypes() const {
- if (LegalValueTypes.empty()) ReadLegalValueTypes();
- return LegalValueTypes;
- }
-
- /// isLegalValueType - Return true if the specified value type is natively
- /// supported by the target (i.e. there are registers that directly hold it).
- bool isLegalValueType(MVT::ValueType VT) const {
- const std::vector<MVT::ValueType> &LegalVTs = getLegalValueTypes();
- for (unsigned i = 0, e = LegalVTs.size(); i != e; ++i)
- if (LegalVTs[i] == VT) return true;
- return false;
- }
-
- /// getInstructions - Return all of the instructions defined for this target.
- ///
- const std::map<std::string, CodeGenInstruction> &getInstructions() const {
- if (Instructions.empty()) ReadInstructions();
- return Instructions;
- }
- std::map<std::string, CodeGenInstruction> &getInstructions() {
- if (Instructions.empty()) ReadInstructions();
- return Instructions;
- }
-
- CodeGenInstruction &getInstruction(const std::string &Name) const {
- const std::map<std::string, CodeGenInstruction> &Insts = getInstructions();
- assert(Insts.count(Name) && "Not an instruction!");
- return const_cast<CodeGenInstruction&>(Insts.find(Name)->second);
- }
-
- typedef std::map<std::string,
- CodeGenInstruction>::const_iterator inst_iterator;
- inst_iterator inst_begin() const { return getInstructions().begin(); }
- inst_iterator inst_end() const { return Instructions.end(); }
-
- /// getInstructionsByEnumValue - Return all of the instructions defined by the
- /// target, ordered by their enum value.
- void getInstructionsByEnumValue(std::vector<const CodeGenInstruction*>
- &NumberedInstructions);
-
-
- /// isLittleEndianEncoding - are instruction bit patterns defined as [0..n]?
- ///
- bool isLittleEndianEncoding() const;
-};
-
-/// ComplexPattern - ComplexPattern info, corresponding to the ComplexPattern
-/// tablegen class in TargetSelectionDAG.td
-class ComplexPattern {
- MVT::ValueType Ty;
- unsigned NumOperands;
- std::string SelectFunc;
- std::vector<Record*> RootNodes;
- unsigned Properties; // Node properties
- unsigned Attributes; // Pattern attributes
-public:
- ComplexPattern() : NumOperands(0) {};
- ComplexPattern(Record *R);
-
- MVT::ValueType getValueType() const { return Ty; }
- unsigned getNumOperands() const { return NumOperands; }
- const std::string &getSelectFunc() const { return SelectFunc; }
- const std::vector<Record*> &getRootNodes() const {
- return RootNodes;
- }
- bool hasProperty(enum SDNP Prop) const { return Properties & (1 << Prop); }
- bool hasAttribute(enum CPAttr Attr) const { return Attributes & (1 << Attr); }
-};
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/utils/TableGen/DAGISelEmitter.cpp b/release_23/utils/TableGen/DAGISelEmitter.cpp
deleted file mode 100644
index 70d88cea4500..000000000000
--- a/release_23/utils/TableGen/DAGISelEmitter.cpp
+++ /dev/null
@@ -1,2172 +0,0 @@
-//===- DAGISelEmitter.cpp - Generate an instruction selector --------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This tablegen backend emits a DAG instruction selector.
-//
-//===----------------------------------------------------------------------===//
-
-#include "DAGISelEmitter.h"
-#include "Record.h"
-#include "llvm/ADT/StringExtras.h"
-#include "llvm/Support/Debug.h"
-#include "llvm/Support/MathExtras.h"
-#include "llvm/Support/Streams.h"
-#include <algorithm>
-using namespace llvm;
-
-//===----------------------------------------------------------------------===//
-// DAGISelEmitter Helper methods
-//
-
-/// NodeIsComplexPattern - return true if N is a leaf node and a subclass of
-/// ComplexPattern.
-static bool NodeIsComplexPattern(TreePatternNode *N) {
- return (N->isLeaf() &&
- dynamic_cast<DefInit*>(N->getLeafValue()) &&
- static_cast<DefInit*>(N->getLeafValue())->getDef()->
- isSubClassOf("ComplexPattern"));
-}
-
-/// NodeGetComplexPattern - return the pointer to the ComplexPattern if N
-/// is a leaf node and a subclass of ComplexPattern, else it returns NULL.
-static const ComplexPattern *NodeGetComplexPattern(TreePatternNode *N,
- CodeGenDAGPatterns &CGP) {
- if (N->isLeaf() &&
- dynamic_cast<DefInit*>(N->getLeafValue()) &&
- static_cast<DefInit*>(N->getLeafValue())->getDef()->
- isSubClassOf("ComplexPattern")) {
- return &CGP.getComplexPattern(static_cast<DefInit*>(N->getLeafValue())
- ->getDef());
- }
- return NULL;
-}
-
-/// getPatternSize - Return the 'size' of this pattern. We want to match large
-/// patterns before small ones. This is used to determine the size of a
-/// pattern.
-static unsigned getPatternSize(TreePatternNode *P, CodeGenDAGPatterns &CGP) {
- assert((MVT::isExtIntegerInVTs(P->getExtTypes()) ||
- MVT::isExtFloatingPointInVTs(P->getExtTypes()) ||
- P->getExtTypeNum(0) == MVT::isVoid ||
- P->getExtTypeNum(0) == MVT::Flag ||
- P->getExtTypeNum(0) == MVT::iPTR) &&
- "Not a valid pattern node to size!");
- unsigned Size = 3; // The node itself.
- // If the root node is a ConstantSDNode, increases its size.
- // e.g. (set R32:$dst, 0).
- if (P->isLeaf() && dynamic_cast<IntInit*>(P->getLeafValue()))
- Size += 2;
-
- // FIXME: This is a hack to statically increase the priority of patterns
- // which maps a sub-dag to a complex pattern. e.g. favors LEA over ADD.
- // Later we can allow complexity / cost for each pattern to be (optionally)
- // specified. To get best possible pattern match we'll need to dynamically
- // calculate the complexity of all patterns a dag can potentially map to.
- const ComplexPattern *AM = NodeGetComplexPattern(P, CGP);
- if (AM)
- Size += AM->getNumOperands() * 3;
-
- // If this node has some predicate function that must match, it adds to the
- // complexity of this node.
- if (!P->getPredicateFn().empty())
- ++Size;
-
- // Count children in the count if they are also nodes.
- for (unsigned i = 0, e = P->getNumChildren(); i != e; ++i) {
- TreePatternNode *Child = P->getChild(i);
- if (!Child->isLeaf() && Child->getExtTypeNum(0) != MVT::Other)
- Size += getPatternSize(Child, CGP);
- else if (Child->isLeaf()) {
- if (dynamic_cast<IntInit*>(Child->getLeafValue()))
- Size += 5; // Matches a ConstantSDNode (+3) and a specific value (+2).
- else if (NodeIsComplexPattern(Child))
- Size += getPatternSize(Child, CGP);
- else if (!Child->getPredicateFn().empty())
- ++Size;
- }
- }
-
- return Size;
-}
-
-/// getResultPatternCost - Compute the number of instructions for this pattern.
-/// This is a temporary hack. We should really include the instruction
-/// latencies in this calculation.
-static unsigned getResultPatternCost(TreePatternNode *P,
- CodeGenDAGPatterns &CGP) {
- if (P->isLeaf()) return 0;
-
- unsigned Cost = 0;
- Record *Op = P->getOperator();
- if (Op->isSubClassOf("Instruction")) {
- Cost++;
- CodeGenInstruction &II = CGP.getTargetInfo().getInstruction(Op->getName());
- if (II.usesCustomDAGSchedInserter)
- Cost += 10;
- }
- for (unsigned i = 0, e = P->getNumChildren(); i != e; ++i)
- Cost += getResultPatternCost(P->getChild(i), CGP);
- return Cost;
-}
-
-/// getResultPatternCodeSize - Compute the code size of instructions for this
-/// pattern.
-static unsigned getResultPatternSize(TreePatternNode *P,
- CodeGenDAGPatterns &CGP) {
- if (P->isLeaf()) return 0;
-
- unsigned Cost = 0;
- Record *Op = P->getOperator();
- if (Op->isSubClassOf("Instruction")) {
- Cost += Op->getValueAsInt("CodeSize");
- }
- for (unsigned i = 0, e = P->getNumChildren(); i != e; ++i)
- Cost += getResultPatternSize(P->getChild(i), CGP);
- return Cost;
-}
-
-// PatternSortingPredicate - return true if we prefer to match LHS before RHS.
-// In particular, we want to match maximal patterns first and lowest cost within
-// a particular complexity first.
-struct PatternSortingPredicate {
- PatternSortingPredicate(CodeGenDAGPatterns &cgp) : CGP(cgp) {}
- CodeGenDAGPatterns &CGP;
-
- bool operator()(const PatternToMatch *LHS,
- const PatternToMatch *RHS) {
- unsigned LHSSize = getPatternSize(LHS->getSrcPattern(), CGP);
- unsigned RHSSize = getPatternSize(RHS->getSrcPattern(), CGP);
- LHSSize += LHS->getAddedComplexity();
- RHSSize += RHS->getAddedComplexity();
- if (LHSSize > RHSSize) return true; // LHS -> bigger -> less cost
- if (LHSSize < RHSSize) return false;
-
- // If the patterns have equal complexity, compare generated instruction cost
- unsigned LHSCost = getResultPatternCost(LHS->getDstPattern(), CGP);
- unsigned RHSCost = getResultPatternCost(RHS->getDstPattern(), CGP);
- if (LHSCost < RHSCost) return true;
- if (LHSCost > RHSCost) return false;
-
- return getResultPatternSize(LHS->getDstPattern(), CGP) <
- getResultPatternSize(RHS->getDstPattern(), CGP);
- }
-};
-
-/// getRegisterValueType - Look up and return the first ValueType of specified
-/// RegisterClass record
-static MVT::ValueType getRegisterValueType(Record *R, const CodeGenTarget &T) {
- if (const CodeGenRegisterClass *RC = T.getRegisterClassForRegister(R))
- return RC->getValueTypeNum(0);
- return MVT::Other;
-}
-
-
-/// RemoveAllTypes - A quick recursive walk over a pattern which removes all
-/// type information from it.
-static void RemoveAllTypes(TreePatternNode *N) {
- N->removeTypes();
- if (!N->isLeaf())
- for (unsigned i = 0, e = N->getNumChildren(); i != e; ++i)
- RemoveAllTypes(N->getChild(i));
-}
-
-/// NodeHasProperty - return true if TreePatternNode has the specified
-/// property.
-static bool NodeHasProperty(TreePatternNode *N, SDNP Property,
- CodeGenDAGPatterns &CGP) {
- if (N->isLeaf()) {
- const ComplexPattern *CP = NodeGetComplexPattern(N, CGP);
- if (CP)
- return CP->hasProperty(Property);
- return false;
- }
- Record *Operator = N->getOperator();
- if (!Operator->isSubClassOf("SDNode")) return false;
-
- return CGP.getSDNodeInfo(Operator).hasProperty(Property);
-}
-
-static bool PatternHasProperty(TreePatternNode *N, SDNP Property,
- CodeGenDAGPatterns &CGP) {
- if (NodeHasProperty(N, Property, CGP))
- return true;
-
- for (unsigned i = 0, e = N->getNumChildren(); i != e; ++i) {
- TreePatternNode *Child = N->getChild(i);
- if (PatternHasProperty(Child, Property, CGP))
- return true;
- }
-
- return false;
-}
-
-//===----------------------------------------------------------------------===//
-// Node Transformation emitter implementation.
-//
-void DAGISelEmitter::EmitNodeTransforms(std::ostream &OS) {
- // Walk the pattern fragments, adding them to a map, which sorts them by
- // name.
- typedef std::map<std::string, CodeGenDAGPatterns::NodeXForm> NXsByNameTy;
- NXsByNameTy NXsByName;
-
- for (CodeGenDAGPatterns::nx_iterator I = CGP.nx_begin(), E = CGP.nx_end();
- I != E; ++I)
- NXsByName.insert(std::make_pair(I->first->getName(), I->second));
-
- OS << "\n// Node transformations.\n";
-
- for (NXsByNameTy::iterator I = NXsByName.begin(), E = NXsByName.end();
- I != E; ++I) {
- Record *SDNode = I->second.first;
- std::string Code = I->second.second;
-
- if (Code.empty()) continue; // Empty code? Skip it.
-
- std::string ClassName = CGP.getSDNodeInfo(SDNode).getSDClassName();
- const char *C2 = ClassName == "SDNode" ? "N" : "inN";
-
- OS << "inline SDOperand Transform_" << I->first << "(SDNode *" << C2
- << ") {\n";
- if (ClassName != "SDNode")
- OS << " " << ClassName << " *N = cast<" << ClassName << ">(inN);\n";
- OS << Code << "\n}\n";
- }
-}
-
-//===----------------------------------------------------------------------===//
-// Predicate emitter implementation.
-//
-
-void DAGISelEmitter::EmitPredicateFunctions(std::ostream &OS) {
- OS << "\n// Predicate functions.\n";
-
- // Walk the pattern fragments, adding them to a map, which sorts them by
- // name.
- typedef std::map<std::string, std::pair<Record*, TreePattern*> > PFsByNameTy;
- PFsByNameTy PFsByName;
-
- for (CodeGenDAGPatterns::pf_iterator I = CGP.pf_begin(), E = CGP.pf_end();
- I != E; ++I)
- PFsByName.insert(std::make_pair(I->first->getName(), *I));
-
-
- for (PFsByNameTy::iterator I = PFsByName.begin(), E = PFsByName.end();
- I != E; ++I) {
- Record *PatFragRecord = I->second.first;// Record that derives from PatFrag.
- TreePattern *P = I->second.second;
-
- // If there is a code init for this fragment, emit the predicate code.
- std::string Code = PatFragRecord->getValueAsCode("Predicate");
- if (Code.empty()) continue;
-
- if (P->getOnlyTree()->isLeaf())
- OS << "inline bool Predicate_" << PatFragRecord->getName()
- << "(SDNode *N) {\n";
- else {
- std::string ClassName =
- CGP.getSDNodeInfo(P->getOnlyTree()->getOperator()).getSDClassName();
- const char *C2 = ClassName == "SDNode" ? "N" : "inN";
-
- OS << "inline bool Predicate_" << PatFragRecord->getName()
- << "(SDNode *" << C2 << ") {\n";
- if (ClassName != "SDNode")
- OS << " " << ClassName << " *N = cast<" << ClassName << ">(inN);\n";
- }
- OS << Code << "\n}\n";
- }
-
- OS << "\n\n";
-}
-
-
-//===----------------------------------------------------------------------===//
-// PatternCodeEmitter implementation.
-//
-class PatternCodeEmitter {
-private:
- CodeGenDAGPatterns &CGP;
-
- // Predicates.
- ListInit *Predicates;
- // Pattern cost.
- unsigned Cost;
- // Instruction selector pattern.
- TreePatternNode *Pattern;
- // Matched instruction.
- TreePatternNode *Instruction;
-
- // Node to name mapping
- std::map<std::string, std::string> VariableMap;
- // Node to operator mapping
- std::map<std::string, Record*> OperatorMap;
- // Name of the folded node which produces a flag.
- std::pair<std::string, unsigned> FoldedFlag;
- // Names of all the folded nodes which produce chains.
- std::vector<std::pair<std::string, unsigned> > FoldedChains;
- // Original input chain(s).
- std::vector<std::pair<std::string, std::string> > OrigChains;
- std::set<std::string> Duplicates;
-
- /// LSI - Load/Store information.
- /// Save loads/stores matched by a pattern, and generate a MemOperandSDNode
- /// for each memory access. This facilitates the use of AliasAnalysis in
- /// the backend.
- std::vector<std::string> LSI;
-
- /// GeneratedCode - This is the buffer that we emit code to. The first int
- /// indicates whether this is an exit predicate (something that should be
- /// tested, and if true, the match fails) [when 1], or normal code to emit
- /// [when 0], or initialization code to emit [when 2].
- std::vector<std::pair<unsigned, std::string> > &GeneratedCode;
- /// GeneratedDecl - This is the set of all SDOperand declarations needed for
- /// the set of patterns for each top-level opcode.
- std::set<std::string> &GeneratedDecl;
- /// TargetOpcodes - The target specific opcodes used by the resulting
- /// instructions.
- std::vector<std::string> &TargetOpcodes;
- std::vector<std::string> &TargetVTs;
-
- std::string ChainName;
- unsigned TmpNo;
- unsigned OpcNo;
- unsigned VTNo;
-
- void emitCheck(const std::string &S) {
- if (!S.empty())
- GeneratedCode.push_back(std::make_pair(1, S));
- }
- void emitCode(const std::string &S) {
- if (!S.empty())
- GeneratedCode.push_back(std::make_pair(0, S));
- }
- void emitInit(const std::string &S) {
- if (!S.empty())
- GeneratedCode.push_back(std::make_pair(2, S));
- }
- void emitDecl(const std::string &S) {
- assert(!S.empty() && "Invalid declaration");
- GeneratedDecl.insert(S);
- }
- void emitOpcode(const std::string &Opc) {
- TargetOpcodes.push_back(Opc);
- OpcNo++;
- }
- void emitVT(const std::string &VT) {
- TargetVTs.push_back(VT);
- VTNo++;
- }
-public:
- PatternCodeEmitter(CodeGenDAGPatterns &cgp, ListInit *preds,
- TreePatternNode *pattern, TreePatternNode *instr,
- std::vector<std::pair<unsigned, std::string> > &gc,
- std::set<std::string> &gd,
- std::vector<std::string> &to,
- std::vector<std::string> &tv)
- : CGP(cgp), Predicates(preds), Pattern(pattern), Instruction(instr),
- GeneratedCode(gc), GeneratedDecl(gd),
- TargetOpcodes(to), TargetVTs(tv),
- TmpNo(0), OpcNo(0), VTNo(0) {}
-
- /// EmitMatchCode - Emit a matcher for N, going to the label for PatternNo
- /// if the match fails. At this point, we already know that the opcode for N
- /// matches, and the SDNode for the result has the RootName specified name.
- void EmitMatchCode(TreePatternNode *N, TreePatternNode *P,
- const std::string &RootName, const std::string &ChainSuffix,
- bool &FoundChain) {
-
- // Save loads/stores matched by a pattern.
- if (!N->isLeaf() && N->getName().empty()) {
- std::string EnumName = N->getOperator()->getValueAsString("Opcode");
- if (EnumName == "ISD::LOAD" ||
- EnumName == "ISD::STORE") {
- LSI.push_back(RootName);
- }
- }
-
- bool isRoot = (P == NULL);
- // Emit instruction predicates. Each predicate is just a string for now.
- if (isRoot) {
- std::string PredicateCheck;
- for (unsigned i = 0, e = Predicates->getSize(); i != e; ++i) {
- if (DefInit *Pred = dynamic_cast<DefInit*>(Predicates->getElement(i))) {
- Record *Def = Pred->getDef();
- if (!Def->isSubClassOf("Predicate")) {
-#ifndef NDEBUG
- Def->dump();
-#endif
- assert(0 && "Unknown predicate type!");
- }
- if (!PredicateCheck.empty())
- PredicateCheck += " && ";
- PredicateCheck += "(" + Def->getValueAsString("CondString") + ")";
- }
- }
-
- emitCheck(PredicateCheck);
- }
-
- if (N->isLeaf()) {
- if (IntInit *II = dynamic_cast<IntInit*>(N->getLeafValue())) {
- emitCheck("cast<ConstantSDNode>(" + RootName +
- ")->getSignExtended() == " + itostr(II->getValue()));
- return;
- } else if (!NodeIsComplexPattern(N)) {
- assert(0 && "Cannot match this as a leaf value!");
- abort();
- }
- }
-
- // If this node has a name associated with it, capture it in VariableMap. If
- // we already saw this in the pattern, emit code to verify dagness.
- if (!N->getName().empty()) {
- std::string &VarMapEntry = VariableMap[N->getName()];
- if (VarMapEntry.empty()) {
- VarMapEntry = RootName;
- } else {
- // If we get here, this is a second reference to a specific name. Since
- // we already have checked that the first reference is valid, we don't
- // have to recursively match it, just check that it's the same as the
- // previously named thing.
- emitCheck(VarMapEntry + " == " + RootName);
- return;
- }
-
- if (!N->isLeaf())
- OperatorMap[N->getName()] = N->getOperator();
- }
-
-
- // Emit code to load the child nodes and match their contents recursively.
- unsigned OpNo = 0;
- bool NodeHasChain = NodeHasProperty (N, SDNPHasChain, CGP);
- bool HasChain = PatternHasProperty(N, SDNPHasChain, CGP);
- bool EmittedUseCheck = false;
- if (HasChain) {
- if (NodeHasChain)
- OpNo = 1;
- if (!isRoot) {
- // Multiple uses of actual result?
- emitCheck(RootName + ".hasOneUse()");
- EmittedUseCheck = true;
- if (NodeHasChain) {
- // If the immediate use can somehow reach this node through another
- // path, then can't fold it either or it will create a cycle.
- // e.g. In the following diagram, XX can reach ld through YY. If
- // ld is folded into XX, then YY is both a predecessor and a successor
- // of XX.
- //
- // [ld]
- // ^ ^
- // | |
- // / \---
- // / [YY]
- // | ^
- // [XX]-------|
- bool NeedCheck = false;
- if (P != Pattern)
- NeedCheck = true;
- else {
- const SDNodeInfo &PInfo = CGP.getSDNodeInfo(P->getOperator());
- NeedCheck =
- P->getOperator() == CGP.get_intrinsic_void_sdnode() ||
- P->getOperator() == CGP.get_intrinsic_w_chain_sdnode() ||
- P->getOperator() == CGP.get_intrinsic_wo_chain_sdnode() ||
- PInfo.getNumOperands() > 1 ||
- PInfo.hasProperty(SDNPHasChain) ||
- PInfo.hasProperty(SDNPInFlag) ||
- PInfo.hasProperty(SDNPOptInFlag);
- }
-
- if (NeedCheck) {
- std::string ParentName(RootName.begin(), RootName.end()-1);
- emitCheck("CanBeFoldedBy(" + RootName + ".Val, " + ParentName +
- ".Val, N.Val)");
- }
- }
- }
-
- if (NodeHasChain) {
- if (FoundChain) {
- emitCheck("(" + ChainName + ".Val == " + RootName + ".Val || "
- "IsChainCompatible(" + ChainName + ".Val, " +
- RootName + ".Val))");
- OrigChains.push_back(std::make_pair(ChainName, RootName));
- } else
- FoundChain = true;
- ChainName = "Chain" + ChainSuffix;
- emitInit("SDOperand " + ChainName + " = " + RootName +
- ".getOperand(0);");
- }
- }
-
- // Don't fold any node which reads or writes a flag and has multiple uses.
- // FIXME: We really need to separate the concepts of flag and "glue". Those
- // real flag results, e.g. X86CMP output, can have multiple uses.
- // FIXME: If the optional incoming flag does not exist. Then it is ok to
- // fold it.
- if (!isRoot &&
- (PatternHasProperty(N, SDNPInFlag, CGP) ||
- PatternHasProperty(N, SDNPOptInFlag, CGP) ||
- PatternHasProperty(N, SDNPOutFlag, CGP))) {
- if (!EmittedUseCheck) {
- // Multiple uses of actual result?
- emitCheck(RootName + ".hasOneUse()");
- }
- }
-
- // If there is a node predicate for this, emit the call.
- if (!N->getPredicateFn().empty())
- emitCheck(N->getPredicateFn() + "(" + RootName + ".Val)");
-
-
- // If this is an 'and R, 1234' where the operation is AND/OR and the RHS is
- // a constant without a predicate fn that has more that one bit set, handle
- // this as a special case. This is usually for targets that have special
- // handling of certain large constants (e.g. alpha with it's 8/16/32-bit
- // handling stuff). Using these instructions is often far more efficient
- // than materializing the constant. Unfortunately, both the instcombiner
- // and the dag combiner can often infer that bits are dead, and thus drop
- // them from the mask in the dag. For example, it might turn 'AND X, 255'
- // into 'AND X, 254' if it knows the low bit is set. Emit code that checks
- // to handle this.
- if (!N->isLeaf() &&
- (N->getOperator()->getName() == "and" ||
- N->getOperator()->getName() == "or") &&
- N->getChild(1)->isLeaf() &&
- N->getChild(1)->getPredicateFn().empty()) {
- if (IntInit *II = dynamic_cast<IntInit*>(N->getChild(1)->getLeafValue())) {
- if (!isPowerOf2_32(II->getValue())) { // Don't bother with single bits.
- emitInit("SDOperand " + RootName + "0" + " = " +
- RootName + ".getOperand(" + utostr(0) + ");");
- emitInit("SDOperand " + RootName + "1" + " = " +
- RootName + ".getOperand(" + utostr(1) + ");");
-
- emitCheck("isa<ConstantSDNode>(" + RootName + "1)");
- const char *MaskPredicate = N->getOperator()->getName() == "or"
- ? "CheckOrMask(" : "CheckAndMask(";
- emitCheck(MaskPredicate + RootName + "0, cast<ConstantSDNode>(" +
- RootName + "1), " + itostr(II->getValue()) + ")");
-
- EmitChildMatchCode(N->getChild(0), N, RootName + utostr(0), RootName,
- ChainSuffix + utostr(0), FoundChain);
- return;
- }
- }
- }
-
- for (unsigned i = 0, e = N->getNumChildren(); i != e; ++i, ++OpNo) {
- emitInit("SDOperand " + RootName + utostr(OpNo) + " = " +
- RootName + ".getOperand(" +utostr(OpNo) + ");");
-
- EmitChildMatchCode(N->getChild(i), N, RootName + utostr(OpNo), RootName,
- ChainSuffix + utostr(OpNo), FoundChain);
- }
-
- // Handle cases when root is a complex pattern.
- const ComplexPattern *CP;
- if (isRoot && N->isLeaf() && (CP = NodeGetComplexPattern(N, CGP))) {
- std::string Fn = CP->getSelectFunc();
- unsigned NumOps = CP->getNumOperands();
- for (unsigned i = 0; i < NumOps; ++i) {
- emitDecl("CPTmp" + utostr(i));
- emitCode("SDOperand CPTmp" + utostr(i) + ";");
- }
- if (CP->hasProperty(SDNPHasChain)) {
- emitDecl("CPInChain");
- emitDecl("Chain" + ChainSuffix);
- emitCode("SDOperand CPInChain;");
- emitCode("SDOperand Chain" + ChainSuffix + ";");
- }
-
- std::string Code = Fn + "(" + RootName + ", " + RootName;
- for (unsigned i = 0; i < NumOps; i++)
- Code += ", CPTmp" + utostr(i);
- if (CP->hasProperty(SDNPHasChain)) {
- ChainName = "Chain" + ChainSuffix;
- Code += ", CPInChain, Chain" + ChainSuffix;
- }
- emitCheck(Code + ")");
- }
- }
-
- void EmitChildMatchCode(TreePatternNode *Child, TreePatternNode *Parent,
- const std::string &RootName,
- const std::string &ParentRootName,
- const std::string &ChainSuffix, bool &FoundChain) {
- if (!Child->isLeaf()) {
- // If it's not a leaf, recursively match.
- const SDNodeInfo &CInfo = CGP.getSDNodeInfo(Child->getOperator());
- emitCheck(RootName + ".getOpcode() == " +
- CInfo.getEnumName());
- EmitMatchCode(Child, Parent, RootName, ChainSuffix, FoundChain);
- bool HasChain = false;
- if (NodeHasProperty(Child, SDNPHasChain, CGP)) {
- HasChain = true;
- FoldedChains.push_back(std::make_pair(RootName, CInfo.getNumResults()));
- }
- if (NodeHasProperty(Child, SDNPOutFlag, CGP)) {
- assert(FoldedFlag.first == "" && FoldedFlag.second == 0 &&
- "Pattern folded multiple nodes which produce flags?");
- FoldedFlag = std::make_pair(RootName,
- CInfo.getNumResults() + (unsigned)HasChain);
- }
- } else {
- // If this child has a name associated with it, capture it in VarMap. If
- // we already saw this in the pattern, emit code to verify dagness.
- if (!Child->getName().empty()) {
- std::string &VarMapEntry = VariableMap[Child->getName()];
- if (VarMapEntry.empty()) {
- VarMapEntry = RootName;
- } else {
- // If we get here, this is a second reference to a specific name.
- // Since we already have checked that the first reference is valid,
- // we don't have to recursively match it, just check that it's the
- // same as the previously named thing.
- emitCheck(VarMapEntry + " == " + RootName);
- Duplicates.insert(RootName);
- return;
- }
- }
-
- // Handle leaves of various types.
- if (DefInit *DI = dynamic_cast<DefInit*>(Child->getLeafValue())) {
- Record *LeafRec = DI->getDef();
- if (LeafRec->isSubClassOf("RegisterClass") ||
- LeafRec->getName() == "ptr_rc") {
- // Handle register references. Nothing to do here.
- } else if (LeafRec->isSubClassOf("Register")) {
- // Handle register references.
- } else if (LeafRec->isSubClassOf("ComplexPattern")) {
- // Handle complex pattern.
- const ComplexPattern *CP = NodeGetComplexPattern(Child, CGP);
- std::string Fn = CP->getSelectFunc();
- unsigned NumOps = CP->getNumOperands();
- for (unsigned i = 0; i < NumOps; ++i) {
- emitDecl("CPTmp" + utostr(i));
- emitCode("SDOperand CPTmp" + utostr(i) + ";");
- }
- if (CP->hasProperty(SDNPHasChain)) {
- const SDNodeInfo &PInfo = CGP.getSDNodeInfo(Parent->getOperator());
- FoldedChains.push_back(std::make_pair("CPInChain",
- PInfo.getNumResults()));
- ChainName = "Chain" + ChainSuffix;
- emitDecl("CPInChain");
- emitDecl(ChainName);
- emitCode("SDOperand CPInChain;");
- emitCode("SDOperand " + ChainName + ";");
- }
-
- std::string Code = Fn + "(";
- if (CP->hasAttribute(CPAttrParentAsRoot)) {
- Code += ParentRootName + ", ";
- } else {
- Code += "N, ";
- }
- if (CP->hasProperty(SDNPHasChain)) {
- std::string ParentName(RootName.begin(), RootName.end()-1);
- Code += ParentName + ", ";
- }
- Code += RootName;
- for (unsigned i = 0; i < NumOps; i++)
- Code += ", CPTmp" + utostr(i);
- if (CP->hasProperty(SDNPHasChain))
- Code += ", CPInChain, Chain" + ChainSuffix;
- emitCheck(Code + ")");
- } else if (LeafRec->getName() == "srcvalue") {
- // Place holder for SRCVALUE nodes. Nothing to do here.
- } else if (LeafRec->isSubClassOf("ValueType")) {
- // Make sure this is the specified value type.
- emitCheck("cast<VTSDNode>(" + RootName +
- ")->getVT() == MVT::" + LeafRec->getName());
- } else if (LeafRec->isSubClassOf("CondCode")) {
- // Make sure this is the specified cond code.
- emitCheck("cast<CondCodeSDNode>(" + RootName +
- ")->get() == ISD::" + LeafRec->getName());
- } else {
-#ifndef NDEBUG
- Child->dump();
- cerr << " ";
-#endif
- assert(0 && "Unknown leaf type!");
- }
-
- // If there is a node predicate for this, emit the call.
- if (!Child->getPredicateFn().empty())
- emitCheck(Child->getPredicateFn() + "(" + RootName +
- ".Val)");
- } else if (IntInit *II =
- dynamic_cast<IntInit*>(Child->getLeafValue())) {
- emitCheck("isa<ConstantSDNode>(" + RootName + ")");
- unsigned CTmp = TmpNo++;
- emitCode("int64_t CN"+utostr(CTmp)+" = cast<ConstantSDNode>("+
- RootName + ")->getSignExtended();");
-
- emitCheck("CN" + utostr(CTmp) + " == " +itostr(II->getValue()));
- } else {
-#ifndef NDEBUG
- Child->dump();
-#endif
- assert(0 && "Unknown leaf type!");
- }
- }
- }
-
- /// EmitResultCode - Emit the action for a pattern. Now that it has matched
- /// we actually have to build a DAG!
- std::vector<std::string>
- EmitResultCode(TreePatternNode *N, std::vector<Record*> DstRegs,
- bool InFlagDecled, bool ResNodeDecled,
- bool LikeLeaf = false, bool isRoot = false) {
- // List of arguments of getTargetNode() or SelectNodeTo().
- std::vector<std::string> NodeOps;
- // This is something selected from the pattern we matched.
- if (!N->getName().empty()) {
- const std::string &VarName = N->getName();
- std::string Val = VariableMap[VarName];
- bool ModifiedVal = false;
- if (Val.empty()) {
- cerr << "Variable '" << VarName << " referenced but not defined "
- << "and not caught earlier!\n";
- abort();
- }
- if (Val[0] == 'T' && Val[1] == 'm' && Val[2] == 'p') {
- // Already selected this operand, just return the tmpval.
- NodeOps.push_back(Val);
- return NodeOps;
- }
-
- const ComplexPattern *CP;
- unsigned ResNo = TmpNo++;
- if (!N->isLeaf() && N->getOperator()->getName() == "imm") {
- assert(N->getExtTypes().size() == 1 && "Multiple types not handled!");
- std::string CastType;
- std::string TmpVar = "Tmp" + utostr(ResNo);
- switch (N->getTypeNum(0)) {
- default:
- cerr << "Cannot handle " << getEnumName(N->getTypeNum(0))
- << " type as an immediate constant. Aborting\n";
- abort();
- case MVT::i1: CastType = "bool"; break;
- case MVT::i8: CastType = "unsigned char"; break;
- case MVT::i16: CastType = "unsigned short"; break;
- case MVT::i32: CastType = "unsigned"; break;
- case MVT::i64: CastType = "uint64_t"; break;
- }
- emitCode("SDOperand " + TmpVar +
- " = CurDAG->getTargetConstant(((" + CastType +
- ") cast<ConstantSDNode>(" + Val + ")->getValue()), " +
- getEnumName(N->getTypeNum(0)) + ");");
- // Add Tmp<ResNo> to VariableMap, so that we don't multiply select this
- // value if used multiple times by this pattern result.
- Val = TmpVar;
- ModifiedVal = true;
- NodeOps.push_back(Val);
- } else if (!N->isLeaf() && N->getOperator()->getName() == "fpimm") {
- assert(N->getExtTypes().size() == 1 && "Multiple types not handled!");
- std::string TmpVar = "Tmp" + utostr(ResNo);
- emitCode("SDOperand " + TmpVar +
- " = CurDAG->getTargetConstantFP(cast<ConstantFPSDNode>(" +
- Val + ")->getValueAPF(), cast<ConstantFPSDNode>(" + Val +
- ")->getValueType(0));");
- // Add Tmp<ResNo> to VariableMap, so that we don't multiply select this
- // value if used multiple times by this pattern result.
- Val = TmpVar;
- ModifiedVal = true;
- NodeOps.push_back(Val);
- } else if (!N->isLeaf() && N->getOperator()->getName() == "texternalsym"){
- Record *Op = OperatorMap[N->getName()];
- // Transform ExternalSymbol to TargetExternalSymbol
- if (Op && Op->getName() == "externalsym") {
- std::string TmpVar = "Tmp"+utostr(ResNo);
- emitCode("SDOperand " + TmpVar + " = CurDAG->getTarget"
- "ExternalSymbol(cast<ExternalSymbolSDNode>(" +
- Val + ")->getSymbol(), " +
- getEnumName(N->getTypeNum(0)) + ");");
- // Add Tmp<ResNo> to VariableMap, so that we don't multiply select
- // this value if used multiple times by this pattern result.
- Val = TmpVar;
- ModifiedVal = true;
- }
- NodeOps.push_back(Val);
- } else if (!N->isLeaf() && (N->getOperator()->getName() == "tglobaladdr"
- || N->getOperator()->getName() == "tglobaltlsaddr")) {
- Record *Op = OperatorMap[N->getName()];
- // Transform GlobalAddress to TargetGlobalAddress
- if (Op && (Op->getName() == "globaladdr" ||
- Op->getName() == "globaltlsaddr")) {
- std::string TmpVar = "Tmp" + utostr(ResNo);
- emitCode("SDOperand " + TmpVar + " = CurDAG->getTarget"
- "GlobalAddress(cast<GlobalAddressSDNode>(" + Val +
- ")->getGlobal(), " + getEnumName(N->getTypeNum(0)) +
- ");");
- // Add Tmp<ResNo> to VariableMap, so that we don't multiply select
- // this value if used multiple times by this pattern result.
- Val = TmpVar;
- ModifiedVal = true;
- }
- NodeOps.push_back(Val);
- } else if (!N->isLeaf()
- && (N->getOperator()->getName() == "texternalsym"
- || N->getOperator()->getName() == "tconstpool")) {
- // Do not rewrite the variable name, since we don't generate a new
- // temporary.
- NodeOps.push_back(Val);
- } else if (N->isLeaf() && (CP = NodeGetComplexPattern(N, CGP))) {
- for (unsigned i = 0; i < CP->getNumOperands(); ++i) {
- emitCode("AddToISelQueue(CPTmp" + utostr(i) + ");");
- NodeOps.push_back("CPTmp" + utostr(i));
- }
- } else {
- // This node, probably wrapped in a SDNodeXForm, behaves like a leaf
- // node even if it isn't one. Don't select it.
- if (!LikeLeaf) {
- emitCode("AddToISelQueue(" + Val + ");");
- if (isRoot && N->isLeaf()) {
- emitCode("ReplaceUses(N, " + Val + ");");
- emitCode("return NULL;");
- }
- }
- NodeOps.push_back(Val);
- }
-
- if (ModifiedVal) {
- VariableMap[VarName] = Val;
- }
- return NodeOps;
- }
- if (N->isLeaf()) {
- // If this is an explicit register reference, handle it.
- if (DefInit *DI = dynamic_cast<DefInit*>(N->getLeafValue())) {
- unsigned ResNo = TmpNo++;
- if (DI->getDef()->isSubClassOf("Register")) {
- emitCode("SDOperand Tmp" + utostr(ResNo) + " = CurDAG->getRegister(" +
- getQualifiedName(DI->getDef()) + ", " +
- getEnumName(N->getTypeNum(0)) + ");");
- NodeOps.push_back("Tmp" + utostr(ResNo));
- return NodeOps;
- } else if (DI->getDef()->getName() == "zero_reg") {
- emitCode("SDOperand Tmp" + utostr(ResNo) +
- " = CurDAG->getRegister(0, " +
- getEnumName(N->getTypeNum(0)) + ");");
- NodeOps.push_back("Tmp" + utostr(ResNo));
- return NodeOps;
- }
- } else if (IntInit *II = dynamic_cast<IntInit*>(N->getLeafValue())) {
- unsigned ResNo = TmpNo++;
- assert(N->getExtTypes().size() == 1 && "Multiple types not handled!");
- emitCode("SDOperand Tmp" + utostr(ResNo) +
- " = CurDAG->getTargetConstant(0x" + itohexstr(II->getValue()) +
- "ULL, " + getEnumName(N->getTypeNum(0)) + ");");
- NodeOps.push_back("Tmp" + utostr(ResNo));
- return NodeOps;
- }
-
-#ifndef NDEBUG
- N->dump();
-#endif
- assert(0 && "Unknown leaf type!");
- return NodeOps;
- }
-
- Record *Op = N->getOperator();
- if (Op->isSubClassOf("Instruction")) {
- const CodeGenTarget &CGT = CGP.getTargetInfo();
- CodeGenInstruction &II = CGT.getInstruction(Op->getName());
- const DAGInstruction &Inst = CGP.getInstruction(Op);
- const TreePattern *InstPat = Inst.getPattern();
- // FIXME: Assume actual pattern comes before "implicit".
- TreePatternNode *InstPatNode =
- isRoot ? (InstPat ? InstPat->getTree(0) : Pattern)
- : (InstPat ? InstPat->getTree(0) : NULL);
- if (InstPatNode && InstPatNode->getOperator()->getName() == "set") {
- InstPatNode = InstPatNode->getChild(InstPatNode->getNumChildren()-1);
- }
- bool HasVarOps = isRoot && II.isVariadic;
- // FIXME: fix how we deal with physical register operands.
- bool HasImpInputs = isRoot && Inst.getNumImpOperands() > 0;
- bool HasImpResults = isRoot && DstRegs.size() > 0;
- bool NodeHasOptInFlag = isRoot &&
- PatternHasProperty(Pattern, SDNPOptInFlag, CGP);
- bool NodeHasInFlag = isRoot &&
- PatternHasProperty(Pattern, SDNPInFlag, CGP);
- bool NodeHasOutFlag = isRoot &&
- PatternHasProperty(Pattern, SDNPOutFlag, CGP);
- bool NodeHasChain = InstPatNode &&
- PatternHasProperty(InstPatNode, SDNPHasChain, CGP);
- bool InputHasChain = isRoot &&
- NodeHasProperty(Pattern, SDNPHasChain, CGP);
- unsigned NumResults = Inst.getNumResults();
- unsigned NumDstRegs = HasImpResults ? DstRegs.size() : 0;
-
- if (NodeHasOptInFlag) {
- emitCode("bool HasInFlag = "
- "(N.getOperand(N.getNumOperands()-1).getValueType() == MVT::Flag);");
- }
- if (HasVarOps)
- emitCode("SmallVector<SDOperand, 8> Ops" + utostr(OpcNo) + ";");
-
- // How many results is this pattern expected to produce?
- unsigned NumPatResults = 0;
- for (unsigned i = 0, e = Pattern->getExtTypes().size(); i != e; i++) {
- MVT::ValueType VT = Pattern->getTypeNum(i);
- if (VT != MVT::isVoid && VT != MVT::Flag)
- NumPatResults++;
- }
-
- if (OrigChains.size() > 0) {
- // The original input chain is being ignored. If it is not just
- // pointing to the op that's being folded, we should create a
- // TokenFactor with it and the chain of the folded op as the new chain.
- // We could potentially be doing multiple levels of folding, in that
- // case, the TokenFactor can have more operands.
- emitCode("SmallVector<SDOperand, 8> InChains;");
- for (unsigned i = 0, e = OrigChains.size(); i < e; ++i) {
- emitCode("if (" + OrigChains[i].first + ".Val != " +
- OrigChains[i].second + ".Val) {");
- emitCode(" AddToISelQueue(" + OrigChains[i].first + ");");
- emitCode(" InChains.push_back(" + OrigChains[i].first + ");");
- emitCode("}");
- }
- emitCode("AddToISelQueue(" + ChainName + ");");
- emitCode("InChains.push_back(" + ChainName + ");");
- emitCode(ChainName + " = CurDAG->getNode(ISD::TokenFactor, MVT::Other, "
- "&InChains[0], InChains.size());");
- }
-
- // Loop over all of the operands of the instruction pattern, emitting code
- // to fill them all in. The node 'N' usually has number children equal to
- // the number of input operands of the instruction. However, in cases
- // where there are predicate operands for an instruction, we need to fill
- // in the 'execute always' values. Match up the node operands to the
- // instruction operands to do this.
- std::vector<std::string> AllOps;
- unsigned NumEAInputs = 0; // # of synthesized 'execute always' inputs.
- for (unsigned ChildNo = 0, InstOpNo = NumResults;
- InstOpNo != II.OperandList.size(); ++InstOpNo) {
- std::vector<std::string> Ops;
-
- // If this is a normal operand or a predicate operand without
- // 'execute always', emit it.
- Record *OperandNode = II.OperandList[InstOpNo].Rec;
- if ((!OperandNode->isSubClassOf("PredicateOperand") &&
- !OperandNode->isSubClassOf("OptionalDefOperand")) ||
- CGP.getDefaultOperand(OperandNode).DefaultOps.empty()) {
- Ops = EmitResultCode(N->getChild(ChildNo), DstRegs,
- InFlagDecled, ResNodeDecled);
- AllOps.insert(AllOps.end(), Ops.begin(), Ops.end());
- ++ChildNo;
- } else {
- // Otherwise, this is a predicate or optional def operand, emit the
- // 'default ops' operands.
- const DAGDefaultOperand &DefaultOp =
- CGP.getDefaultOperand(II.OperandList[InstOpNo].Rec);
- for (unsigned i = 0, e = DefaultOp.DefaultOps.size(); i != e; ++i) {
- Ops = EmitResultCode(DefaultOp.DefaultOps[i], DstRegs,
- InFlagDecled, ResNodeDecled);
- AllOps.insert(AllOps.end(), Ops.begin(), Ops.end());
- NumEAInputs += Ops.size();
- }
- }
- }
-
- // Generate MemOperandSDNodes nodes for each memory accesses covered by
- // this pattern.
- if (II.isSimpleLoad | II.mayLoad | II.mayStore) {
- std::vector<std::string>::const_iterator mi, mie;
- for (mi = LSI.begin(), mie = LSI.end(); mi != mie; ++mi) {
- emitCode("SDOperand LSI_" + *mi + " = "
- "CurDAG->getMemOperand(cast<LSBaseSDNode>(" +
- *mi + ")->getMemOperand());");
- AllOps.push_back("LSI_" + *mi);
- }
- }
-
- // Emit all the chain and CopyToReg stuff.
- bool ChainEmitted = NodeHasChain;
- if (NodeHasChain)
- emitCode("AddToISelQueue(" + ChainName + ");");
- if (NodeHasInFlag || HasImpInputs)
- EmitInFlagSelectCode(Pattern, "N", ChainEmitted,
- InFlagDecled, ResNodeDecled, true);
- if (NodeHasOptInFlag || NodeHasInFlag || HasImpInputs) {
- if (!InFlagDecled) {
- emitCode("SDOperand InFlag(0, 0);");
- InFlagDecled = true;
- }
- if (NodeHasOptInFlag) {
- emitCode("if (HasInFlag) {");
- emitCode(" InFlag = N.getOperand(N.getNumOperands()-1);");
- emitCode(" AddToISelQueue(InFlag);");
- emitCode("}");
- }
- }
-
- unsigned ResNo = TmpNo++;
- if (!isRoot || InputHasChain || NodeHasChain || NodeHasOutFlag ||
- NodeHasOptInFlag || HasImpResults) {
- std::string Code;
- std::string Code2;
- std::string NodeName;
- if (!isRoot) {
- NodeName = "Tmp" + utostr(ResNo);
- Code2 = "SDOperand " + NodeName + "(";
- } else {
- NodeName = "ResNode";
- if (!ResNodeDecled) {
- Code2 = "SDNode *" + NodeName + " = ";
- ResNodeDecled = true;
- } else
- Code2 = NodeName + " = ";
- }
-
- Code += "CurDAG->getTargetNode(Opc" + utostr(OpcNo);
- unsigned OpsNo = OpcNo;
- emitOpcode(II.Namespace + "::" + II.TheDef->getName());
-
- // Output order: results, chain, flags
- // Result types.
- if (NumResults > 0 && N->getTypeNum(0) != MVT::isVoid) {
- Code += ", VT" + utostr(VTNo);
- emitVT(getEnumName(N->getTypeNum(0)));
- }
- // Add types for implicit results in physical registers, scheduler will
- // care of adding copyfromreg nodes.
- for (unsigned i = 0; i < NumDstRegs; i++) {
- Record *RR = DstRegs[i];
- if (RR->isSubClassOf("Register")) {
- MVT::ValueType RVT = getRegisterValueType(RR, CGT);
- Code += ", " + getEnumName(RVT);
- }
- }
- if (NodeHasChain)
- Code += ", MVT::Other";
- if (NodeHasOutFlag)
- Code += ", MVT::Flag";
-
- // Figure out how many fixed inputs the node has. This is important to
- // know which inputs are the variable ones if present.
- unsigned NumInputs = AllOps.size();
- NumInputs += NodeHasChain;
-
- // Inputs.
- if (HasVarOps) {
- for (unsigned i = 0, e = AllOps.size(); i != e; ++i)
- emitCode("Ops" + utostr(OpsNo) + ".push_back(" + AllOps[i] + ");");
- AllOps.clear();
- }
-
- if (HasVarOps) {
- // Figure out whether any operands at the end of the op list are not
- // part of the variable section.
- std::string EndAdjust;
- if (NodeHasInFlag || HasImpInputs)
- EndAdjust = "-1"; // Always has one flag.
- else if (NodeHasOptInFlag)
- EndAdjust = "-(HasInFlag?1:0)"; // May have a flag.
-
- emitCode("for (unsigned i = " + utostr(NumInputs - NumEAInputs) +
- ", e = N.getNumOperands()" + EndAdjust + "; i != e; ++i) {");
-
- emitCode(" AddToISelQueue(N.getOperand(i));");
- emitCode(" Ops" + utostr(OpsNo) + ".push_back(N.getOperand(i));");
- emitCode("}");
- }
-
- if (NodeHasChain) {
- if (HasVarOps)
- emitCode("Ops" + utostr(OpsNo) + ".push_back(" + ChainName + ");");
- else
- AllOps.push_back(ChainName);
- }
-
- if (HasVarOps) {
- if (NodeHasInFlag || HasImpInputs)
- emitCode("Ops" + utostr(OpsNo) + ".push_back(InFlag);");
- else if (NodeHasOptInFlag) {
- emitCode("if (HasInFlag)");
- emitCode(" Ops" + utostr(OpsNo) + ".push_back(InFlag);");
- }
- Code += ", &Ops" + utostr(OpsNo) + "[0], Ops" + utostr(OpsNo) +
- ".size()";
- } else if (NodeHasInFlag || NodeHasOptInFlag || HasImpInputs)
- AllOps.push_back("InFlag");
-
- unsigned NumOps = AllOps.size();
- if (NumOps) {
- if (!NodeHasOptInFlag && NumOps < 4) {
- for (unsigned i = 0; i != NumOps; ++i)
- Code += ", " + AllOps[i];
- } else {
- std::string OpsCode = "SDOperand Ops" + utostr(OpsNo) + "[] = { ";
- for (unsigned i = 0; i != NumOps; ++i) {
- OpsCode += AllOps[i];
- if (i != NumOps-1)
- OpsCode += ", ";
- }
- emitCode(OpsCode + " };");
- Code += ", Ops" + utostr(OpsNo) + ", ";
- if (NodeHasOptInFlag) {
- Code += "HasInFlag ? ";
- Code += utostr(NumOps) + " : " + utostr(NumOps-1);
- } else
- Code += utostr(NumOps);
- }
- }
-
- if (!isRoot)
- Code += "), 0";
- emitCode(Code2 + Code + ");");
-
- if (NodeHasChain) {
- // Remember which op produces the chain.
- if (!isRoot)
- emitCode(ChainName + " = SDOperand(" + NodeName +
- ".Val, " + utostr(NumResults+NumDstRegs) + ");");
- else
- emitCode(ChainName + " = SDOperand(" + NodeName +
- ", " + utostr(NumResults+NumDstRegs) + ");");
- }
-
- if (!isRoot) {
- NodeOps.push_back("Tmp" + utostr(ResNo));
- return NodeOps;
- }
-
- bool NeedReplace = false;
- if (NodeHasOutFlag) {
- if (!InFlagDecled) {
- emitCode("SDOperand InFlag(ResNode, " +
- utostr(NumResults+NumDstRegs+(unsigned)NodeHasChain) + ");");
- InFlagDecled = true;
- } else
- emitCode("InFlag = SDOperand(ResNode, " +
- utostr(NumResults+NumDstRegs+(unsigned)NodeHasChain) + ");");
- }
-
- if (FoldedChains.size() > 0) {
- std::string Code;
- for (unsigned j = 0, e = FoldedChains.size(); j < e; j++)
- emitCode("ReplaceUses(SDOperand(" +
- FoldedChains[j].first + ".Val, " +
- utostr(FoldedChains[j].second) + "), SDOperand(ResNode, " +
- utostr(NumResults+NumDstRegs) + "));");
- NeedReplace = true;
- }
-
- if (NodeHasOutFlag) {
- if (FoldedFlag.first != "") {
- emitCode("ReplaceUses(SDOperand(" + FoldedFlag.first + ".Val, " +
- utostr(FoldedFlag.second) + "), InFlag);");
- } else {
- assert(NodeHasProperty(Pattern, SDNPOutFlag, CGP));
- emitCode("ReplaceUses(SDOperand(N.Val, " +
- utostr(NumPatResults + (unsigned)InputHasChain)
- +"), InFlag);");
- }
- NeedReplace = true;
- }
-
- if (NeedReplace && InputHasChain)
- emitCode("ReplaceUses(SDOperand(N.Val, " +
- utostr(NumPatResults) + "), SDOperand(" + ChainName
- + ".Val, " + ChainName + ".ResNo" + "));");
-
- // User does not expect the instruction would produce a chain!
- if ((!InputHasChain && NodeHasChain) && NodeHasOutFlag) {
- ;
- } else if (InputHasChain && !NodeHasChain) {
- // One of the inner node produces a chain.
- if (NodeHasOutFlag)
- emitCode("ReplaceUses(SDOperand(N.Val, " + utostr(NumPatResults+1) +
- "), SDOperand(ResNode, N.ResNo-1));");
- emitCode("ReplaceUses(SDOperand(N.Val, " + utostr(NumPatResults) +
- "), " + ChainName + ");");
- }
-
- emitCode("return ResNode;");
- } else {
- std::string Code = "return CurDAG->SelectNodeTo(N.Val, Opc" +
- utostr(OpcNo);
- if (N->getTypeNum(0) != MVT::isVoid)
- Code += ", VT" + utostr(VTNo);
- if (NodeHasOutFlag)
- Code += ", MVT::Flag";
-
- if (NodeHasInFlag || NodeHasOptInFlag || HasImpInputs)
- AllOps.push_back("InFlag");
-
- unsigned NumOps = AllOps.size();
- if (NumOps) {
- if (!NodeHasOptInFlag && NumOps < 4) {
- for (unsigned i = 0; i != NumOps; ++i)
- Code += ", " + AllOps[i];
- } else {
- std::string OpsCode = "SDOperand Ops" + utostr(OpcNo) + "[] = { ";
- for (unsigned i = 0; i != NumOps; ++i) {
- OpsCode += AllOps[i];
- if (i != NumOps-1)
- OpsCode += ", ";
- }
- emitCode(OpsCode + " };");
- Code += ", Ops" + utostr(OpcNo) + ", ";
- Code += utostr(NumOps);
- }
- }
- emitCode(Code + ");");
- emitOpcode(II.Namespace + "::" + II.TheDef->getName());
- if (N->getTypeNum(0) != MVT::isVoid)
- emitVT(getEnumName(N->getTypeNum(0)));
- }
-
- return NodeOps;
- } else if (Op->isSubClassOf("SDNodeXForm")) {
- assert(N->getNumChildren() == 1 && "node xform should have one child!");
- // PatLeaf node - the operand may or may not be a leaf node. But it should
- // behave like one.
- std::vector<std::string> Ops =
- EmitResultCode(N->getChild(0), DstRegs, InFlagDecled,
- ResNodeDecled, true);
- unsigned ResNo = TmpNo++;
- emitCode("SDOperand Tmp" + utostr(ResNo) + " = Transform_" + Op->getName()
- + "(" + Ops.back() + ".Val);");
- NodeOps.push_back("Tmp" + utostr(ResNo));
- if (isRoot)
- emitCode("return Tmp" + utostr(ResNo) + ".Val;");
- return NodeOps;
- } else {
- N->dump();
- cerr << "\n";
- throw std::string("Unknown node in result pattern!");
- }
- }
-
- /// InsertOneTypeCheck - Insert a type-check for an unresolved type in 'Pat'
- /// and add it to the tree. 'Pat' and 'Other' are isomorphic trees except that
- /// 'Pat' may be missing types. If we find an unresolved type to add a check
- /// for, this returns true otherwise false if Pat has all types.
- bool InsertOneTypeCheck(TreePatternNode *Pat, TreePatternNode *Other,
- const std::string &Prefix, bool isRoot = false) {
- // Did we find one?
- if (Pat->getExtTypes() != Other->getExtTypes()) {
- // Move a type over from 'other' to 'pat'.
- Pat->setTypes(Other->getExtTypes());
- // The top level node type is checked outside of the select function.
- if (!isRoot)
- emitCheck(Prefix + ".Val->getValueType(0) == " +
- getName(Pat->getTypeNum(0)));
- return true;
- }
-
- unsigned OpNo =
- (unsigned) NodeHasProperty(Pat, SDNPHasChain, CGP);
- for (unsigned i = 0, e = Pat->getNumChildren(); i != e; ++i, ++OpNo)
- if (InsertOneTypeCheck(Pat->getChild(i), Other->getChild(i),
- Prefix + utostr(OpNo)))
- return true;
- return false;
- }
-
-private:
- /// EmitInFlagSelectCode - Emit the flag operands for the DAG that is
- /// being built.
- void EmitInFlagSelectCode(TreePatternNode *N, const std::string &RootName,
- bool &ChainEmitted, bool &InFlagDecled,
- bool &ResNodeDecled, bool isRoot = false) {
- const CodeGenTarget &T = CGP.getTargetInfo();
- unsigned OpNo =
- (unsigned) NodeHasProperty(N, SDNPHasChain, CGP);
- bool HasInFlag = NodeHasProperty(N, SDNPInFlag, CGP);
- for (unsigned i = 0, e = N->getNumChildren(); i != e; ++i, ++OpNo) {
- TreePatternNode *Child = N->getChild(i);
- if (!Child->isLeaf()) {
- EmitInFlagSelectCode(Child, RootName + utostr(OpNo), ChainEmitted,
- InFlagDecled, ResNodeDecled);
- } else {
- if (DefInit *DI = dynamic_cast<DefInit*>(Child->getLeafValue())) {
- if (!Child->getName().empty()) {
- std::string Name = RootName + utostr(OpNo);
- if (Duplicates.find(Name) != Duplicates.end())
- // A duplicate! Do not emit a copy for this node.
- continue;
- }
-
- Record *RR = DI->getDef();
- if (RR->isSubClassOf("Register")) {
- MVT::ValueType RVT = getRegisterValueType(RR, T);
- if (RVT == MVT::Flag) {
- if (!InFlagDecled) {
- emitCode("SDOperand InFlag = " + RootName + utostr(OpNo) + ";");
- InFlagDecled = true;
- } else
- emitCode("InFlag = " + RootName + utostr(OpNo) + ";");
- emitCode("AddToISelQueue(InFlag);");
- } else {
- if (!ChainEmitted) {
- emitCode("SDOperand Chain = CurDAG->getEntryNode();");
- ChainName = "Chain";
- ChainEmitted = true;
- }
- emitCode("AddToISelQueue(" + RootName + utostr(OpNo) + ");");
- if (!InFlagDecled) {
- emitCode("SDOperand InFlag(0, 0);");
- InFlagDecled = true;
- }
- std::string Decl = (!ResNodeDecled) ? "SDNode *" : "";
- emitCode(Decl + "ResNode = CurDAG->getCopyToReg(" + ChainName +
- ", " + getQualifiedName(RR) +
- ", " + RootName + utostr(OpNo) + ", InFlag).Val;");
- ResNodeDecled = true;
- emitCode(ChainName + " = SDOperand(ResNode, 0);");
- emitCode("InFlag = SDOperand(ResNode, 1);");
- }
- }
- }
- }
- }
-
- if (HasInFlag) {
- if (!InFlagDecled) {
- emitCode("SDOperand InFlag = " + RootName +
- ".getOperand(" + utostr(OpNo) + ");");
- InFlagDecled = true;
- } else
- emitCode("InFlag = " + RootName +
- ".getOperand(" + utostr(OpNo) + ");");
- emitCode("AddToISelQueue(InFlag);");
- }
- }
-};
-
-/// EmitCodeForPattern - Given a pattern to match, emit code to the specified
-/// stream to match the pattern, and generate the code for the match if it
-/// succeeds. Returns true if the pattern is not guaranteed to match.
-void DAGISelEmitter::GenerateCodeForPattern(const PatternToMatch &Pattern,
- std::vector<std::pair<unsigned, std::string> > &GeneratedCode,
- std::set<std::string> &GeneratedDecl,
- std::vector<std::string> &TargetOpcodes,
- std::vector<std::string> &TargetVTs) {
- PatternCodeEmitter Emitter(CGP, Pattern.getPredicates(),
- Pattern.getSrcPattern(), Pattern.getDstPattern(),
- GeneratedCode, GeneratedDecl,
- TargetOpcodes, TargetVTs);
-
- // Emit the matcher, capturing named arguments in VariableMap.
- bool FoundChain = false;
- Emitter.EmitMatchCode(Pattern.getSrcPattern(), NULL, "N", "", FoundChain);
-
- // TP - Get *SOME* tree pattern, we don't care which.
- TreePattern &TP = *CGP.pf_begin()->second;
-
- // At this point, we know that we structurally match the pattern, but the
- // types of the nodes may not match. Figure out the fewest number of type
- // comparisons we need to emit. For example, if there is only one integer
- // type supported by a target, there should be no type comparisons at all for
- // integer patterns!
- //
- // To figure out the fewest number of type checks needed, clone the pattern,
- // remove the types, then perform type inference on the pattern as a whole.
- // If there are unresolved types, emit an explicit check for those types,
- // apply the type to the tree, then rerun type inference. Iterate until all
- // types are resolved.
- //
- TreePatternNode *Pat = Pattern.getSrcPattern()->clone();
- RemoveAllTypes(Pat);
-
- do {
- // Resolve/propagate as many types as possible.
- try {
- bool MadeChange = true;
- while (MadeChange)
- MadeChange = Pat->ApplyTypeConstraints(TP,
- true/*Ignore reg constraints*/);
- } catch (...) {
- assert(0 && "Error: could not find consistent types for something we"
- " already decided was ok!");
- abort();
- }
-
- // Insert a check for an unresolved type and add it to the tree. If we find
- // an unresolved type to add a check for, this returns true and we iterate,
- // otherwise we are done.
- } while (Emitter.InsertOneTypeCheck(Pat, Pattern.getSrcPattern(), "N", true));
-
- Emitter.EmitResultCode(Pattern.getDstPattern(), Pattern.getDstRegs(),
- false, false, false, true);
- delete Pat;
-}
-
-/// EraseCodeLine - Erase one code line from all of the patterns. If removing
-/// a line causes any of them to be empty, remove them and return true when
-/// done.
-static bool EraseCodeLine(std::vector<std::pair<const PatternToMatch*,
- std::vector<std::pair<unsigned, std::string> > > >
- &Patterns) {
- bool ErasedPatterns = false;
- for (unsigned i = 0, e = Patterns.size(); i != e; ++i) {
- Patterns[i].second.pop_back();
- if (Patterns[i].second.empty()) {
- Patterns.erase(Patterns.begin()+i);
- --i; --e;
- ErasedPatterns = true;
- }
- }
- return ErasedPatterns;
-}
-
-/// EmitPatterns - Emit code for at least one pattern, but try to group common
-/// code together between the patterns.
-void DAGISelEmitter::EmitPatterns(std::vector<std::pair<const PatternToMatch*,
- std::vector<std::pair<unsigned, std::string> > > >
- &Patterns, unsigned Indent,
- std::ostream &OS) {
- typedef std::pair<unsigned, std::string> CodeLine;
- typedef std::vector<CodeLine> CodeList;
- typedef std::vector<std::pair<const PatternToMatch*, CodeList> > PatternList;
-
- if (Patterns.empty()) return;
-
- // Figure out how many patterns share the next code line. Explicitly copy
- // FirstCodeLine so that we don't invalidate a reference when changing
- // Patterns.
- const CodeLine FirstCodeLine = Patterns.back().second.back();
- unsigned LastMatch = Patterns.size()-1;
- while (LastMatch != 0 && Patterns[LastMatch-1].second.back() == FirstCodeLine)
- --LastMatch;
-
- // If not all patterns share this line, split the list into two pieces. The
- // first chunk will use this line, the second chunk won't.
- if (LastMatch != 0) {
- PatternList Shared(Patterns.begin()+LastMatch, Patterns.end());
- PatternList Other(Patterns.begin(), Patterns.begin()+LastMatch);
-
- // FIXME: Emit braces?
- if (Shared.size() == 1) {
- const PatternToMatch &Pattern = *Shared.back().first;
- OS << "\n" << std::string(Indent, ' ') << "// Pattern: ";
- Pattern.getSrcPattern()->print(OS);
- OS << "\n" << std::string(Indent, ' ') << "// Emits: ";
- Pattern.getDstPattern()->print(OS);
- OS << "\n";
- unsigned AddedComplexity = Pattern.getAddedComplexity();
- OS << std::string(Indent, ' ') << "// Pattern complexity = "
- << getPatternSize(Pattern.getSrcPattern(), CGP) + AddedComplexity
- << " cost = "
- << getResultPatternCost(Pattern.getDstPattern(), CGP)
- << " size = "
- << getResultPatternSize(Pattern.getDstPattern(), CGP) << "\n";
- }
- if (FirstCodeLine.first != 1) {
- OS << std::string(Indent, ' ') << "{\n";
- Indent += 2;
- }
- EmitPatterns(Shared, Indent, OS);
- if (FirstCodeLine.first != 1) {
- Indent -= 2;
- OS << std::string(Indent, ' ') << "}\n";
- }
-
- if (Other.size() == 1) {
- const PatternToMatch &Pattern = *Other.back().first;
- OS << "\n" << std::string(Indent, ' ') << "// Pattern: ";
- Pattern.getSrcPattern()->print(OS);
- OS << "\n" << std::string(Indent, ' ') << "// Emits: ";
- Pattern.getDstPattern()->print(OS);
- OS << "\n";
- unsigned AddedComplexity = Pattern.getAddedComplexity();
- OS << std::string(Indent, ' ') << "// Pattern complexity = "
- << getPatternSize(Pattern.getSrcPattern(), CGP) + AddedComplexity
- << " cost = "
- << getResultPatternCost(Pattern.getDstPattern(), CGP)
- << " size = "
- << getResultPatternSize(Pattern.getDstPattern(), CGP) << "\n";
- }
- EmitPatterns(Other, Indent, OS);
- return;
- }
-
- // Remove this code from all of the patterns that share it.
- bool ErasedPatterns = EraseCodeLine(Patterns);
-
- bool isPredicate = FirstCodeLine.first == 1;
-
- // Otherwise, every pattern in the list has this line. Emit it.
- if (!isPredicate) {
- // Normal code.
- OS << std::string(Indent, ' ') << FirstCodeLine.second << "\n";
- } else {
- OS << std::string(Indent, ' ') << "if (" << FirstCodeLine.second;
-
- // If the next code line is another predicate, and if all of the pattern
- // in this group share the same next line, emit it inline now. Do this
- // until we run out of common predicates.
- while (!ErasedPatterns && Patterns.back().second.back().first == 1) {
- // Check that all of fhe patterns in Patterns end with the same predicate.
- bool AllEndWithSamePredicate = true;
- for (unsigned i = 0, e = Patterns.size(); i != e; ++i)
- if (Patterns[i].second.back() != Patterns.back().second.back()) {
- AllEndWithSamePredicate = false;
- break;
- }
- // If all of the predicates aren't the same, we can't share them.
- if (!AllEndWithSamePredicate) break;
-
- // Otherwise we can. Emit it shared now.
- OS << " &&\n" << std::string(Indent+4, ' ')
- << Patterns.back().second.back().second;
- ErasedPatterns = EraseCodeLine(Patterns);
- }
-
- OS << ") {\n";
- Indent += 2;
- }
-
- EmitPatterns(Patterns, Indent, OS);
-
- if (isPredicate)
- OS << std::string(Indent-2, ' ') << "}\n";
-}
-
-static std::string getOpcodeName(Record *Op, CodeGenDAGPatterns &CGP) {
- return CGP.getSDNodeInfo(Op).getEnumName();
-}
-
-static std::string getLegalCName(std::string OpName) {
- std::string::size_type pos = OpName.find("::");
- if (pos != std::string::npos)
- OpName.replace(pos, 2, "_");
- return OpName;
-}
-
-void DAGISelEmitter::EmitInstructionSelector(std::ostream &OS) {
- const CodeGenTarget &Target = CGP.getTargetInfo();
-
- // Get the namespace to insert instructions into. Make sure not to pick up
- // "TargetInstrInfo" by accidentally getting the namespace off the PHI
- // instruction or something.
- std::string InstNS;
- for (CodeGenTarget::inst_iterator i = Target.inst_begin(),
- e = Target.inst_end(); i != e; ++i) {
- InstNS = i->second.Namespace;
- if (InstNS != "TargetInstrInfo")
- break;
- }
-
- if (!InstNS.empty()) InstNS += "::";
-
- // Group the patterns by their top-level opcodes.
- std::map<std::string, std::vector<const PatternToMatch*> > PatternsByOpcode;
- // All unique target node emission functions.
- std::map<std::string, unsigned> EmitFunctions;
- for (CodeGenDAGPatterns::ptm_iterator I = CGP.ptm_begin(),
- E = CGP.ptm_end(); I != E; ++I) {
- const PatternToMatch &Pattern = *I;
-
- TreePatternNode *Node = Pattern.getSrcPattern();
- if (!Node->isLeaf()) {
- PatternsByOpcode[getOpcodeName(Node->getOperator(), CGP)].
- push_back(&Pattern);
- } else {
- const ComplexPattern *CP;
- if (dynamic_cast<IntInit*>(Node->getLeafValue())) {
- PatternsByOpcode[getOpcodeName(CGP.getSDNodeNamed("imm"), CGP)].
- push_back(&Pattern);
- } else if ((CP = NodeGetComplexPattern(Node, CGP))) {
- std::vector<Record*> OpNodes = CP->getRootNodes();
- for (unsigned j = 0, e = OpNodes.size(); j != e; j++) {
- PatternsByOpcode[getOpcodeName(OpNodes[j], CGP)]
- .insert(PatternsByOpcode[getOpcodeName(OpNodes[j], CGP)].begin(),
- &Pattern);
- }
- } else {
- cerr << "Unrecognized opcode '";
- Node->dump();
- cerr << "' on tree pattern '";
- cerr << Pattern.getDstPattern()->getOperator()->getName() << "'!\n";
- exit(1);
- }
- }
- }
-
- // For each opcode, there might be multiple select functions, one per
- // ValueType of the node (or its first operand if it doesn't produce a
- // non-chain result.
- std::map<std::string, std::vector<std::string> > OpcodeVTMap;
-
- // Emit one Select_* method for each top-level opcode. We do this instead of
- // emitting one giant switch statement to support compilers where this will
- // result in the recursive functions taking less stack space.
- for (std::map<std::string, std::vector<const PatternToMatch*> >::iterator
- PBOI = PatternsByOpcode.begin(), E = PatternsByOpcode.end();
- PBOI != E; ++PBOI) {
- const std::string &OpName = PBOI->first;
- std::vector<const PatternToMatch*> &PatternsOfOp = PBOI->second;
- assert(!PatternsOfOp.empty() && "No patterns but map has entry?");
-
- // We want to emit all of the matching code now. However, we want to emit
- // the matches in order of minimal cost. Sort the patterns so the least
- // cost one is at the start.
- std::stable_sort(PatternsOfOp.begin(), PatternsOfOp.end(),
- PatternSortingPredicate(CGP));
-
- // Split them into groups by type.
- std::map<MVT::ValueType, std::vector<const PatternToMatch*> >PatternsByType;
- for (unsigned i = 0, e = PatternsOfOp.size(); i != e; ++i) {
- const PatternToMatch *Pat = PatternsOfOp[i];
- TreePatternNode *SrcPat = Pat->getSrcPattern();
- MVT::ValueType VT = SrcPat->getTypeNum(0);
- std::map<MVT::ValueType,
- std::vector<const PatternToMatch*> >::iterator TI =
- PatternsByType.find(VT);
- if (TI != PatternsByType.end())
- TI->second.push_back(Pat);
- else {
- std::vector<const PatternToMatch*> PVec;
- PVec.push_back(Pat);
- PatternsByType.insert(std::make_pair(VT, PVec));
- }
- }
-
- for (std::map<MVT::ValueType, std::vector<const PatternToMatch*> >::iterator
- II = PatternsByType.begin(), EE = PatternsByType.end(); II != EE;
- ++II) {
- MVT::ValueType OpVT = II->first;
- std::vector<const PatternToMatch*> &Patterns = II->second;
- typedef std::vector<std::pair<unsigned,std::string> > CodeList;
- typedef std::vector<std::pair<unsigned,std::string> >::iterator CodeListI;
-
- std::vector<std::pair<const PatternToMatch*, CodeList> > CodeForPatterns;
- std::vector<std::vector<std::string> > PatternOpcodes;
- std::vector<std::vector<std::string> > PatternVTs;
- std::vector<std::set<std::string> > PatternDecls;
- for (unsigned i = 0, e = Patterns.size(); i != e; ++i) {
- CodeList GeneratedCode;
- std::set<std::string> GeneratedDecl;
- std::vector<std::string> TargetOpcodes;
- std::vector<std::string> TargetVTs;
- GenerateCodeForPattern(*Patterns[i], GeneratedCode, GeneratedDecl,
- TargetOpcodes, TargetVTs);
- CodeForPatterns.push_back(std::make_pair(Patterns[i], GeneratedCode));
- PatternDecls.push_back(GeneratedDecl);
- PatternOpcodes.push_back(TargetOpcodes);
- PatternVTs.push_back(TargetVTs);
- }
-
- // Scan the code to see if all of the patterns are reachable and if it is
- // possible that the last one might not match.
- bool mightNotMatch = true;
- for (unsigned i = 0, e = CodeForPatterns.size(); i != e; ++i) {
- CodeList &GeneratedCode = CodeForPatterns[i].second;
- mightNotMatch = false;
-
- for (unsigned j = 0, e = GeneratedCode.size(); j != e; ++j) {
- if (GeneratedCode[j].first == 1) { // predicate.
- mightNotMatch = true;
- break;
- }
- }
-
- // If this pattern definitely matches, and if it isn't the last one, the
- // patterns after it CANNOT ever match. Error out.
- if (mightNotMatch == false && i != CodeForPatterns.size()-1) {
- cerr << "Pattern '";
- CodeForPatterns[i].first->getSrcPattern()->print(*cerr.stream());
- cerr << "' is impossible to select!\n";
- exit(1);
- }
- }
-
- // Factor target node emission code (emitted by EmitResultCode) into
- // separate functions. Uniquing and share them among all instruction
- // selection routines.
- for (unsigned i = 0, e = CodeForPatterns.size(); i != e; ++i) {
- CodeList &GeneratedCode = CodeForPatterns[i].second;
- std::vector<std::string> &TargetOpcodes = PatternOpcodes[i];
- std::vector<std::string> &TargetVTs = PatternVTs[i];
- std::set<std::string> Decls = PatternDecls[i];
- std::vector<std::string> AddedInits;
- int CodeSize = (int)GeneratedCode.size();
- int LastPred = -1;
- for (int j = CodeSize-1; j >= 0; --j) {
- if (LastPred == -1 && GeneratedCode[j].first == 1)
- LastPred = j;
- else if (LastPred != -1 && GeneratedCode[j].first == 2)
- AddedInits.push_back(GeneratedCode[j].second);
- }
-
- std::string CalleeCode = "(const SDOperand &N";
- std::string CallerCode = "(N";
- for (unsigned j = 0, e = TargetOpcodes.size(); j != e; ++j) {
- CalleeCode += ", unsigned Opc" + utostr(j);
- CallerCode += ", " + TargetOpcodes[j];
- }
- for (unsigned j = 0, e = TargetVTs.size(); j != e; ++j) {
- CalleeCode += ", MVT::ValueType VT" + utostr(j);
- CallerCode += ", " + TargetVTs[j];
- }
- for (std::set<std::string>::iterator
- I = Decls.begin(), E = Decls.end(); I != E; ++I) {
- std::string Name = *I;
- CalleeCode += ", SDOperand &" + Name;
- CallerCode += ", " + Name;
- }
- CallerCode += ");";
- CalleeCode += ") ";
- // Prevent emission routines from being inlined to reduce selection
- // routines stack frame sizes.
- CalleeCode += "DISABLE_INLINE ";
- CalleeCode += "{\n";
-
- for (std::vector<std::string>::const_reverse_iterator
- I = AddedInits.rbegin(), E = AddedInits.rend(); I != E; ++I)
- CalleeCode += " " + *I + "\n";
-
- for (int j = LastPred+1; j < CodeSize; ++j)
- CalleeCode += " " + GeneratedCode[j].second + "\n";
- for (int j = LastPred+1; j < CodeSize; ++j)
- GeneratedCode.pop_back();
- CalleeCode += "}\n";
-
- // Uniquing the emission routines.
- unsigned EmitFuncNum;
- std::map<std::string, unsigned>::iterator EFI =
- EmitFunctions.find(CalleeCode);
- if (EFI != EmitFunctions.end()) {
- EmitFuncNum = EFI->second;
- } else {
- EmitFuncNum = EmitFunctions.size();
- EmitFunctions.insert(std::make_pair(CalleeCode, EmitFuncNum));
- OS << "SDNode *Emit_" << utostr(EmitFuncNum) << CalleeCode;
- }
-
- // Replace the emission code within selection routines with calls to the
- // emission functions.
- CallerCode = "return Emit_" + utostr(EmitFuncNum) + CallerCode;
- GeneratedCode.push_back(std::make_pair(false, CallerCode));
- }
-
- // Print function.
- std::string OpVTStr;
- if (OpVT == MVT::iPTR) {
- OpVTStr = "_iPTR";
- } else if (OpVT == MVT::isVoid) {
- // Nodes with a void result actually have a first result type of either
- // Other (a chain) or Flag. Since there is no one-to-one mapping from
- // void to this case, we handle it specially here.
- } else {
- OpVTStr = "_" + getEnumName(OpVT).substr(5); // Skip 'MVT::'
- }
- std::map<std::string, std::vector<std::string> >::iterator OpVTI =
- OpcodeVTMap.find(OpName);
- if (OpVTI == OpcodeVTMap.end()) {
- std::vector<std::string> VTSet;
- VTSet.push_back(OpVTStr);
- OpcodeVTMap.insert(std::make_pair(OpName, VTSet));
- } else
- OpVTI->second.push_back(OpVTStr);
-
- OS << "SDNode *Select_" << getLegalCName(OpName)
- << OpVTStr << "(const SDOperand &N) {\n";
-
- // Loop through and reverse all of the CodeList vectors, as we will be
- // accessing them from their logical front, but accessing the end of a
- // vector is more efficient.
- for (unsigned i = 0, e = CodeForPatterns.size(); i != e; ++i) {
- CodeList &GeneratedCode = CodeForPatterns[i].second;
- std::reverse(GeneratedCode.begin(), GeneratedCode.end());
- }
-
- // Next, reverse the list of patterns itself for the same reason.
- std::reverse(CodeForPatterns.begin(), CodeForPatterns.end());
-
- // Emit all of the patterns now, grouped together to share code.
- EmitPatterns(CodeForPatterns, 2, OS);
-
- // If the last pattern has predicates (which could fail) emit code to
- // catch the case where nothing handles a pattern.
- if (mightNotMatch) {
- OS << " cerr << \"Cannot yet select: \";\n";
- if (OpName != "ISD::INTRINSIC_W_CHAIN" &&
- OpName != "ISD::INTRINSIC_WO_CHAIN" &&
- OpName != "ISD::INTRINSIC_VOID") {
- OS << " N.Val->dump(CurDAG);\n";
- } else {
- OS << " unsigned iid = cast<ConstantSDNode>(N.getOperand("
- "N.getOperand(0).getValueType() == MVT::Other))->getValue();\n"
- << " cerr << \"intrinsic %\"<< "
- "Intrinsic::getName((Intrinsic::ID)iid);\n";
- }
- OS << " cerr << '\\n';\n"
- << " abort();\n"
- << " return NULL;\n";
- }
- OS << "}\n\n";
- }
- }
-
- // Emit boilerplate.
- OS << "SDNode *Select_INLINEASM(SDOperand N) {\n"
- << " std::vector<SDOperand> Ops(N.Val->op_begin(), N.Val->op_end());\n"
- << " SelectInlineAsmMemoryOperands(Ops, *CurDAG);\n\n"
-
- << " // Ensure that the asm operands are themselves selected.\n"
- << " for (unsigned j = 0, e = Ops.size(); j != e; ++j)\n"
- << " AddToISelQueue(Ops[j]);\n\n"
-
- << " std::vector<MVT::ValueType> VTs;\n"
- << " VTs.push_back(MVT::Other);\n"
- << " VTs.push_back(MVT::Flag);\n"
- << " SDOperand New = CurDAG->getNode(ISD::INLINEASM, VTs, &Ops[0], "
- "Ops.size());\n"
- << " return New.Val;\n"
- << "}\n\n";
-
- OS << "SDNode *Select_UNDEF(const SDOperand &N) {\n"
- << " return CurDAG->getTargetNode(TargetInstrInfo::IMPLICIT_DEF,\n"
- << " N.getValueType());\n"
- << "}\n\n";
-
- OS << "SDNode *Select_LABEL(const SDOperand &N) {\n"
- << " SDOperand Chain = N.getOperand(0);\n"
- << " SDOperand N1 = N.getOperand(1);\n"
- << " SDOperand N2 = N.getOperand(2);\n"
- << " unsigned C1 = cast<ConstantSDNode>(N1)->getValue();\n"
- << " unsigned C2 = cast<ConstantSDNode>(N2)->getValue();\n"
- << " SDOperand Tmp1 = CurDAG->getTargetConstant(C1, MVT::i32);\n"
- << " SDOperand Tmp2 = CurDAG->getTargetConstant(C2, MVT::i32);\n"
- << " AddToISelQueue(Chain);\n"
- << " SDOperand Ops[] = { Tmp1, Tmp2, Chain };\n"
- << " return CurDAG->getTargetNode(TargetInstrInfo::LABEL,\n"
- << " MVT::Other, Ops, 3);\n"
- << "}\n\n";
-
- OS << "SDNode *Select_DECLARE(const SDOperand &N) {\n"
- << " SDOperand Chain = N.getOperand(0);\n"
- << " SDOperand N1 = N.getOperand(1);\n"
- << " SDOperand N2 = N.getOperand(2);\n"
- << " if (!isa<FrameIndexSDNode>(N1) || !isa<GlobalAddressSDNode>(N2)) {\n"
- << " cerr << \"Cannot yet select llvm.dbg.declare: \";\n"
- << " N.Val->dump(CurDAG);\n"
- << " abort();\n"
- << " }\n"
- << " int FI = cast<FrameIndexSDNode>(N1)->getIndex();\n"
- << " GlobalValue *GV = cast<GlobalAddressSDNode>(N2)->getGlobal();\n"
- << " SDOperand Tmp1 = "
- << "CurDAG->getTargetFrameIndex(FI, TLI.getPointerTy());\n"
- << " SDOperand Tmp2 = "
- << "CurDAG->getTargetGlobalAddress(GV, TLI.getPointerTy());\n"
- << " AddToISelQueue(Chain);\n"
- << " SDOperand Ops[] = { Tmp1, Tmp2, Chain };\n"
- << " return CurDAG->getTargetNode(TargetInstrInfo::DECLARE,\n"
- << " MVT::Other, Ops, 3);\n"
- << "}\n\n";
-
- OS << "SDNode *Select_EXTRACT_SUBREG(const SDOperand &N) {\n"
- << " SDOperand N0 = N.getOperand(0);\n"
- << " SDOperand N1 = N.getOperand(1);\n"
- << " unsigned C = cast<ConstantSDNode>(N1)->getValue();\n"
- << " SDOperand Tmp = CurDAG->getTargetConstant(C, MVT::i32);\n"
- << " AddToISelQueue(N0);\n"
- << " SDOperand Ops[] = { N0, Tmp };\n"
- << " return CurDAG->getTargetNode(TargetInstrInfo::EXTRACT_SUBREG,\n"
- << " N.getValueType(), Ops, 2);\n"
- << "}\n\n";
-
- OS << "SDNode *Select_INSERT_SUBREG(const SDOperand &N) {\n"
- << " SDOperand N0 = N.getOperand(0);\n"
- << " SDOperand N1 = N.getOperand(1);\n"
- << " SDOperand N2 = N.getOperand(2);\n"
- << " unsigned C = cast<ConstantSDNode>(N2)->getValue();\n"
- << " SDOperand Tmp = CurDAG->getTargetConstant(C, MVT::i32);\n"
- << " AddToISelQueue(N1);\n"
- << " SDOperand Ops[] = { N0, N1, Tmp };\n"
- << " AddToISelQueue(N0);\n"
- << " return CurDAG->getTargetNode(TargetInstrInfo::INSERT_SUBREG,\n"
- << " N.getValueType(), Ops, 3);\n"
- << "}\n\n";
-
- OS << "// The main instruction selector code.\n"
- << "SDNode *SelectCode(SDOperand N) {\n"
- << " if (N.getOpcode() >= ISD::BUILTIN_OP_END &&\n"
- << " N.getOpcode() < (ISD::BUILTIN_OP_END+" << InstNS
- << "INSTRUCTION_LIST_END)) {\n"
- << " return NULL; // Already selected.\n"
- << " }\n\n"
- << " MVT::ValueType NVT = N.Val->getValueType(0);\n"
- << " switch (N.getOpcode()) {\n"
- << " default: break;\n"
- << " case ISD::EntryToken: // These leaves remain the same.\n"
- << " case ISD::BasicBlock:\n"
- << " case ISD::Register:\n"
- << " case ISD::HANDLENODE:\n"
- << " case ISD::TargetConstant:\n"
- << " case ISD::TargetConstantFP:\n"
- << " case ISD::TargetConstantPool:\n"
- << " case ISD::TargetFrameIndex:\n"
- << " case ISD::TargetExternalSymbol:\n"
- << " case ISD::TargetJumpTable:\n"
- << " case ISD::TargetGlobalTLSAddress:\n"
- << " case ISD::TargetGlobalAddress: {\n"
- << " return NULL;\n"
- << " }\n"
- << " case ISD::AssertSext:\n"
- << " case ISD::AssertZext: {\n"
- << " AddToISelQueue(N.getOperand(0));\n"
- << " ReplaceUses(N, N.getOperand(0));\n"
- << " return NULL;\n"
- << " }\n"
- << " case ISD::TokenFactor:\n"
- << " case ISD::CopyFromReg:\n"
- << " case ISD::CopyToReg: {\n"
- << " for (unsigned i = 0, e = N.getNumOperands(); i != e; ++i)\n"
- << " AddToISelQueue(N.getOperand(i));\n"
- << " return NULL;\n"
- << " }\n"
- << " case ISD::INLINEASM: return Select_INLINEASM(N);\n"
- << " case ISD::LABEL: return Select_LABEL(N);\n"
- << " case ISD::DECLARE: return Select_DECLARE(N);\n"
- << " case ISD::EXTRACT_SUBREG: return Select_EXTRACT_SUBREG(N);\n"
- << " case ISD::INSERT_SUBREG: return Select_INSERT_SUBREG(N);\n"
- << " case ISD::UNDEF: return Select_UNDEF(N);\n";
-
-
- // Loop over all of the case statements, emiting a call to each method we
- // emitted above.
- for (std::map<std::string, std::vector<const PatternToMatch*> >::iterator
- PBOI = PatternsByOpcode.begin(), E = PatternsByOpcode.end();
- PBOI != E; ++PBOI) {
- const std::string &OpName = PBOI->first;
- // Potentially multiple versions of select for this opcode. One for each
- // ValueType of the node (or its first true operand if it doesn't produce a
- // result.
- std::map<std::string, std::vector<std::string> >::iterator OpVTI =
- OpcodeVTMap.find(OpName);
- std::vector<std::string> &OpVTs = OpVTI->second;
- OS << " case " << OpName << ": {\n";
- // Keep track of whether we see a pattern that has an iPtr result.
- bool HasPtrPattern = false;
- bool HasDefaultPattern = false;
-
- OS << " switch (NVT) {\n";
- for (unsigned i = 0, e = OpVTs.size(); i < e; ++i) {
- std::string &VTStr = OpVTs[i];
- if (VTStr.empty()) {
- HasDefaultPattern = true;
- continue;
- }
-
- // If this is a match on iPTR: don't emit it directly, we need special
- // code.
- if (VTStr == "_iPTR") {
- HasPtrPattern = true;
- continue;
- }
- OS << " case MVT::" << VTStr.substr(1) << ":\n"
- << " return Select_" << getLegalCName(OpName)
- << VTStr << "(N);\n";
- }
- OS << " default:\n";
-
- // If there is an iPTR result version of this pattern, emit it here.
- if (HasPtrPattern) {
- OS << " if (NVT == TLI.getPointerTy())\n";
- OS << " return Select_" << getLegalCName(OpName) <<"_iPTR(N);\n";
- }
- if (HasDefaultPattern) {
- OS << " return Select_" << getLegalCName(OpName) << "(N);\n";
- }
- OS << " break;\n";
- OS << " }\n";
- OS << " break;\n";
- OS << " }\n";
- }
-
- OS << " } // end of big switch.\n\n"
- << " cerr << \"Cannot yet select: \";\n"
- << " if (N.getOpcode() != ISD::INTRINSIC_W_CHAIN &&\n"
- << " N.getOpcode() != ISD::INTRINSIC_WO_CHAIN &&\n"
- << " N.getOpcode() != ISD::INTRINSIC_VOID) {\n"
- << " N.Val->dump(CurDAG);\n"
- << " } else {\n"
- << " unsigned iid = cast<ConstantSDNode>(N.getOperand("
- "N.getOperand(0).getValueType() == MVT::Other))->getValue();\n"
- << " cerr << \"intrinsic %\"<< "
- "Intrinsic::getName((Intrinsic::ID)iid);\n"
- << " }\n"
- << " cerr << '\\n';\n"
- << " abort();\n"
- << " return NULL;\n"
- << "}\n";
-}
-
-void DAGISelEmitter::run(std::ostream &OS) {
- EmitSourceFileHeader("DAG Instruction Selector for the " +
- CGP.getTargetInfo().getName() + " target", OS);
-
- OS << "// *** NOTE: This file is #included into the middle of the target\n"
- << "// *** instruction selector class. These functions are really "
- << "methods.\n\n";
-
- OS << "// Instruction selector priority queue:\n"
- << "std::vector<SDNode*> ISelQueue;\n";
- OS << "/// Keep track of nodes which have already been added to queue.\n"
- << "unsigned char *ISelQueued;\n";
- OS << "/// Keep track of nodes which have already been selected.\n"
- << "unsigned char *ISelSelected;\n";
-
-
- OS << "/// IsChainCompatible - Returns true if Chain is Op or Chain does\n";
- OS << "/// not reach Op.\n";
- OS << "static bool IsChainCompatible(SDNode *Chain, SDNode *Op) {\n";
- OS << " if (Chain->getOpcode() == ISD::EntryToken)\n";
- OS << " return true;\n";
- OS << " else if (Chain->getOpcode() == ISD::TokenFactor)\n";
- OS << " return false;\n";
- OS << " else if (Chain->getNumOperands() > 0) {\n";
- OS << " SDOperand C0 = Chain->getOperand(0);\n";
- OS << " if (C0.getValueType() == MVT::Other)\n";
- OS << " return C0.Val != Op && IsChainCompatible(C0.Val, Op);\n";
- OS << " }\n";
- OS << " return true;\n";
- OS << "}\n";
-
- OS << "/// Sorting functions for the selection queue.\n"
- << "struct isel_sort : public std::binary_function"
- << "<SDNode*, SDNode*, bool> {\n"
- << " bool operator()(const SDNode* left, const SDNode* right) "
- << "const {\n"
- << " return (left->getNodeId() > right->getNodeId());\n"
- << " }\n"
- << "};\n\n";
-
- OS << "inline void setQueued(int Id) {\n";
- OS << " ISelQueued[Id / 8] |= 1 << (Id % 8);\n";
- OS << "}\n";
- OS << "inline bool isQueued(int Id) {\n";
- OS << " return ISelQueued[Id / 8] & (1 << (Id % 8));\n";
- OS << "}\n";
- OS << "inline void setSelected(int Id) {\n";
- OS << " ISelSelected[Id / 8] |= 1 << (Id % 8);\n";
- OS << "}\n";
- OS << "inline bool isSelected(int Id) {\n";
- OS << " return ISelSelected[Id / 8] & (1 << (Id % 8));\n";
- OS << "}\n\n";
-
- OS << "void AddToISelQueue(SDOperand N) DISABLE_INLINE {\n";
- OS << " int Id = N.Val->getNodeId();\n";
- OS << " if (Id != -1 && !isQueued(Id)) {\n";
- OS << " ISelQueue.push_back(N.Val);\n";
- OS << " std::push_heap(ISelQueue.begin(), ISelQueue.end(), isel_sort());\n";
- OS << " setQueued(Id);\n";
- OS << " }\n";
- OS << "}\n\n";
-
-
- OS << "class VISIBILITY_HIDDEN ISelQueueUpdater :\n";
- OS << " public SelectionDAG::DAGUpdateListener {\n";
- OS << " std::vector<SDNode*> &ISelQueue;\n";
- OS << " bool HadDelete;\n";
- OS << " public:\n";
- OS << " explicit ISelQueueUpdater(std::vector<SDNode*> &isq)\n";
- OS << " : ISelQueue(isq), HadDelete(false) {}\n";
- OS << " \n";
- OS << " bool hadDelete() const { return HadDelete; }\n";
- OS << " \n";
- OS << " virtual void NodeDeleted(SDNode *N) {\n";
- OS << " ISelQueue.erase(std::remove(ISelQueue.begin(), ISelQueue.end(),";
- OS << " N),\n ISelQueue.end());\n";
- OS << " HadDelete = true;\n";
- OS << " }\n";
- OS << " \n";
- OS << " // Ignore updates.\n";
- OS << " virtual void NodeUpdated(SDNode *N) {}\n";
- OS << " };\n";
-
- OS << "inline void UpdateQueue(const ISelQueueUpdater &ISQU) {\n";
- OS << " if (ISQU.hadDelete())\n";
- OS << " std::make_heap(ISelQueue.begin(), ISelQueue.end(),isel_sort());\n";
- OS << "}\n\n";
-
- OS << "void ReplaceUses(SDOperand F, SDOperand T) DISABLE_INLINE {\n";
- OS << " ISelQueueUpdater ISQU(ISelQueue);\n";
- OS << " CurDAG->ReplaceAllUsesOfValueWith(F, T, &ISQU);\n";
- OS << " setSelected(F.Val->getNodeId());\n";
- OS << " UpdateQueue(ISQU);\n";
- OS << "}\n";
- OS << "void ReplaceUses(SDNode *F, SDNode *T) DISABLE_INLINE {\n";
- OS << " unsigned FNumVals = F->getNumValues();\n";
- OS << " unsigned TNumVals = T->getNumValues();\n";
- OS << " ISelQueueUpdater ISQU(ISelQueue);\n";
- OS << " if (FNumVals != TNumVals) {\n";
- OS << " for (unsigned i = 0, e = std::min(FNumVals, TNumVals); "
- << "i < e; ++i)\n";
- OS << " CurDAG->ReplaceAllUsesOfValueWith(SDOperand(F, i), "
- << "SDOperand(T, i), &ISQU);\n";
- OS << " } else {\n";
- OS << " CurDAG->ReplaceAllUsesWith(F, T, &ISQU);\n";
- OS << " }\n";
- OS << " setSelected(F->getNodeId());\n";
- OS << " UpdateQueue(ISQU);\n";
- OS << "}\n\n";
-
- OS << "// SelectRoot - Top level entry to DAG isel.\n";
- OS << "SDOperand SelectRoot(SDOperand Root) {\n";
- OS << " SelectRootInit();\n";
- OS << " unsigned NumBytes = (DAGSize + 7) / 8;\n";
- OS << " ISelQueued = new unsigned char[NumBytes];\n";
- OS << " ISelSelected = new unsigned char[NumBytes];\n";
- OS << " memset(ISelQueued, 0, NumBytes);\n";
- OS << " memset(ISelSelected, 0, NumBytes);\n";
- OS << "\n";
- OS << " // Create a dummy node (which is not added to allnodes), that adds\n"
- << " // a reference to the root node, preventing it from being deleted,\n"
- << " // and tracking any changes of the root.\n"
- << " HandleSDNode Dummy(CurDAG->getRoot());\n"
- << " ISelQueue.push_back(CurDAG->getRoot().Val);\n";
- OS << " while (!ISelQueue.empty()) {\n";
- OS << " SDNode *Node = ISelQueue.front();\n";
- OS << " std::pop_heap(ISelQueue.begin(), ISelQueue.end(), isel_sort());\n";
- OS << " ISelQueue.pop_back();\n";
- OS << " if (!isSelected(Node->getNodeId())) {\n";
- OS << " SDNode *ResNode = Select(SDOperand(Node, 0));\n";
- OS << " if (ResNode != Node) {\n";
- OS << " if (ResNode)\n";
- OS << " ReplaceUses(Node, ResNode);\n";
- OS << " if (Node->use_empty()) { // Don't delete EntryToken, etc.\n";
- OS << " ISelQueueUpdater ISQU(ISelQueue);\n";
- OS << " CurDAG->RemoveDeadNode(Node, &ISQU);\n";
- OS << " UpdateQueue(ISQU);\n";
- OS << " }\n";
- OS << " }\n";
- OS << " }\n";
- OS << " }\n";
- OS << "\n";
- OS << " delete[] ISelQueued;\n";
- OS << " ISelQueued = NULL;\n";
- OS << " delete[] ISelSelected;\n";
- OS << " ISelSelected = NULL;\n";
- OS << " return Dummy.getValue();\n";
- OS << "}\n";
-
- EmitNodeTransforms(OS);
- EmitPredicateFunctions(OS);
-
- DOUT << "\n\nALL PATTERNS TO MATCH:\n\n";
- for (CodeGenDAGPatterns::ptm_iterator I = CGP.ptm_begin(), E = CGP.ptm_end();
- I != E; ++I) {
- DOUT << "PATTERN: "; DEBUG(I->getSrcPattern()->dump());
- DOUT << "\nRESULT: "; DEBUG(I->getDstPattern()->dump());
- DOUT << "\n";
- }
-
- // At this point, we have full information about the 'Patterns' we need to
- // parse, both implicitly from instructions as well as from explicit pattern
- // definitions. Emit the resultant instruction selector.
- EmitInstructionSelector(OS);
-
-}
diff --git a/release_23/utils/TableGen/DAGISelEmitter.h b/release_23/utils/TableGen/DAGISelEmitter.h
deleted file mode 100644
index 1b47bcc156e6..000000000000
--- a/release_23/utils/TableGen/DAGISelEmitter.h
+++ /dev/null
@@ -1,54 +0,0 @@
-//===- DAGISelEmitter.h - Generate an instruction selector ------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This tablegen backend emits a DAG instruction selector.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef DAGISEL_EMITTER_H
-#define DAGISEL_EMITTER_H
-
-#include "TableGenBackend.h"
-#include "CodeGenDAGPatterns.h"
-#include <set>
-
-namespace llvm {
-
-/// DAGISelEmitter - The top-level class which coordinates construction
-/// and emission of the instruction selector.
-///
-class DAGISelEmitter : public TableGenBackend {
- RecordKeeper &Records;
- CodeGenDAGPatterns CGP;
-public:
- DAGISelEmitter(RecordKeeper &R) : Records(R), CGP(R) {}
-
- // run - Output the isel, returning true on failure.
- void run(std::ostream &OS);
-
-
-private:
- void EmitNodeTransforms(std::ostream &OS);
- void EmitPredicateFunctions(std::ostream &OS);
-
- void GenerateCodeForPattern(const PatternToMatch &Pattern,
- std::vector<std::pair<unsigned, std::string> > &GeneratedCode,
- std::set<std::string> &GeneratedDecl,
- std::vector<std::string> &TargetOpcodes,
- std::vector<std::string> &TargetVTs);
- void EmitPatterns(std::vector<std::pair<const PatternToMatch*,
- std::vector<std::pair<unsigned, std::string> > > > &Patterns,
- unsigned Indent, std::ostream &OS);
-
- void EmitInstructionSelector(std::ostream &OS);
-};
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/utils/TableGen/InstrEnumEmitter.cpp b/release_23/utils/TableGen/InstrEnumEmitter.cpp
deleted file mode 100644
index df07119944e4..000000000000
--- a/release_23/utils/TableGen/InstrEnumEmitter.cpp
+++ /dev/null
@@ -1,54 +0,0 @@
-//===- InstrEnumEmitter.cpp - Generate Instruction Set Enums --------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This tablegen backend is responsible for emitting enums for each machine
-// instruction.
-//
-//===----------------------------------------------------------------------===//
-
-#include "InstrEnumEmitter.h"
-#include "CodeGenTarget.h"
-#include "Record.h"
-using namespace llvm;
-
-// runEnums - Print out enum values for all of the instructions.
-void InstrEnumEmitter::run(std::ostream &OS) {
- EmitSourceFileHeader("Target Instruction Enum Values", OS);
- OS << "namespace llvm {\n\n";
-
- CodeGenTarget Target;
-
- // We must emit the PHI opcode first...
- std::string Namespace;
- for (CodeGenTarget::inst_iterator II = Target.inst_begin(),
- E = Target.inst_end(); II != E; ++II) {
- if (II->second.Namespace != "TargetInstrInfo") {
- Namespace = II->second.Namespace;
- break;
- }
- }
-
- if (Namespace.empty()) {
- fprintf(stderr, "No instructions defined!\n");
- exit(1);
- }
-
- std::vector<const CodeGenInstruction*> NumberedInstructions;
- Target.getInstructionsByEnumValue(NumberedInstructions);
-
- OS << "namespace " << Namespace << " {\n";
- OS << " enum {\n";
- for (unsigned i = 0, e = NumberedInstructions.size(); i != e; ++i) {
- OS << " " << NumberedInstructions[i]->TheDef->getName()
- << "\t= " << i << ",\n";
- }
- OS << " INSTRUCTION_LIST_END = " << NumberedInstructions.size() << "\n";
- OS << " };\n}\n";
- OS << "} // End llvm namespace \n";
-}
diff --git a/release_23/utils/TableGen/InstrEnumEmitter.h b/release_23/utils/TableGen/InstrEnumEmitter.h
deleted file mode 100644
index b39fef2d433c..000000000000
--- a/release_23/utils/TableGen/InstrEnumEmitter.h
+++ /dev/null
@@ -1,33 +0,0 @@
-//===- InstrEnumEmitter.h - Generate Instruction Set Enums ------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This tablegen backend is responsible for emitting enums for each machine
-// instruction.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef INSTRENUM_EMITTER_H
-#define INSTRENUM_EMITTER_H
-
-#include "TableGenBackend.h"
-
-namespace llvm {
-
-class InstrEnumEmitter : public TableGenBackend {
- RecordKeeper &Records;
-public:
- InstrEnumEmitter(RecordKeeper &R) : Records(R) {}
-
- // run - Output the instruction set description, returning true on failure.
- void run(std::ostream &OS);
-};
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/utils/TableGen/InstrInfoEmitter.cpp b/release_23/utils/TableGen/InstrInfoEmitter.cpp
deleted file mode 100644
index 57d72b436e3b..000000000000
--- a/release_23/utils/TableGen/InstrInfoEmitter.cpp
+++ /dev/null
@@ -1,323 +0,0 @@
-//===- InstrInfoEmitter.cpp - Generate a Instruction Set Desc. ------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This tablegen backend is responsible for emitting a description of the target
-// instruction set for the code generator.
-//
-//===----------------------------------------------------------------------===//
-
-#include "InstrInfoEmitter.h"
-#include "CodeGenTarget.h"
-#include "Record.h"
-#include <algorithm>
-#include <iostream>
-using namespace llvm;
-
-static void PrintDefList(const std::vector<Record*> &Uses,
- unsigned Num, std::ostream &OS) {
- OS << "static const unsigned ImplicitList" << Num << "[] = { ";
- for (unsigned i = 0, e = Uses.size(); i != e; ++i)
- OS << getQualifiedName(Uses[i]) << ", ";
- OS << "0 };\n";
-}
-
-//===----------------------------------------------------------------------===//
-// Instruction Itinerary Information.
-//===----------------------------------------------------------------------===//
-
-struct RecordNameComparator {
- bool operator()(const Record *Rec1, const Record *Rec2) const {
- return Rec1->getName() < Rec2->getName();
- }
-};
-
-void InstrInfoEmitter::GatherItinClasses() {
- std::vector<Record*> DefList =
- Records.getAllDerivedDefinitions("InstrItinClass");
- std::sort(DefList.begin(), DefList.end(), RecordNameComparator());
-
- for (unsigned i = 0, N = DefList.size(); i < N; i++)
- ItinClassMap[DefList[i]->getName()] = i;
-}
-
-unsigned InstrInfoEmitter::getItinClassNumber(const Record *InstRec) {
- return ItinClassMap[InstRec->getValueAsDef("Itinerary")->getName()];
-}
-
-//===----------------------------------------------------------------------===//
-// Operand Info Emission.
-//===----------------------------------------------------------------------===//
-
-std::vector<std::string>
-InstrInfoEmitter::GetOperandInfo(const CodeGenInstruction &Inst) {
- std::vector<std::string> Result;
-
- for (unsigned i = 0, e = Inst.OperandList.size(); i != e; ++i) {
- // Handle aggregate operands and normal operands the same way by expanding
- // either case into a list of operands for this op.
- std::vector<CodeGenInstruction::OperandInfo> OperandList;
-
- // This might be a multiple operand thing. Targets like X86 have
- // registers in their multi-operand operands. It may also be an anonymous
- // operand, which has a single operand, but no declared class for the
- // operand.
- DagInit *MIOI = Inst.OperandList[i].MIOperandInfo;
-
- if (!MIOI || MIOI->getNumArgs() == 0) {
- // Single, anonymous, operand.
- OperandList.push_back(Inst.OperandList[i]);
- } else {
- for (unsigned j = 0, e = Inst.OperandList[i].MINumOperands; j != e; ++j) {
- OperandList.push_back(Inst.OperandList[i]);
-
- Record *OpR = dynamic_cast<DefInit*>(MIOI->getArg(j))->getDef();
- OperandList.back().Rec = OpR;
- }
- }
-
- for (unsigned j = 0, e = OperandList.size(); j != e; ++j) {
- Record *OpR = OperandList[j].Rec;
- std::string Res;
-
- if (OpR->isSubClassOf("RegisterClass"))
- Res += getQualifiedName(OpR) + "RegClassID, ";
- else
- Res += "0, ";
- // Fill in applicable flags.
- Res += "0";
-
- // Ptr value whose register class is resolved via callback.
- if (OpR->getName() == "ptr_rc")
- Res += "|(1<<TOI::LookupPtrRegClass)";
-
- // Predicate operands. Check to see if the original unexpanded operand
- // was of type PredicateOperand.
- if (Inst.OperandList[i].Rec->isSubClassOf("PredicateOperand"))
- Res += "|(1<<TOI::Predicate)";
-
- // Optional def operands. Check to see if the original unexpanded operand
- // was of type OptionalDefOperand.
- if (Inst.OperandList[i].Rec->isSubClassOf("OptionalDefOperand"))
- Res += "|(1<<TOI::OptionalDef)";
-
- // Fill in constraint info.
- Res += ", " + Inst.OperandList[i].Constraints[j];
- Result.push_back(Res);
- }
- }
-
- return Result;
-}
-
-void InstrInfoEmitter::EmitOperandInfo(std::ostream &OS,
- OperandInfoMapTy &OperandInfoIDs) {
- // ID #0 is for no operand info.
- unsigned OperandListNum = 0;
- OperandInfoIDs[std::vector<std::string>()] = ++OperandListNum;
-
- OS << "\n";
- const CodeGenTarget &Target = CDP.getTargetInfo();
- for (CodeGenTarget::inst_iterator II = Target.inst_begin(),
- E = Target.inst_end(); II != E; ++II) {
- std::vector<std::string> OperandInfo = GetOperandInfo(II->second);
- unsigned &N = OperandInfoIDs[OperandInfo];
- if (N != 0) continue;
-
- N = ++OperandListNum;
- OS << "static const TargetOperandInfo OperandInfo" << N << "[] = { ";
- for (unsigned i = 0, e = OperandInfo.size(); i != e; ++i)
- OS << "{ " << OperandInfo[i] << " }, ";
- OS << "};\n";
- }
-}
-
-//===----------------------------------------------------------------------===//
-// Main Output.
-//===----------------------------------------------------------------------===//
-
-// run - Emit the main instruction description records for the target...
-void InstrInfoEmitter::run(std::ostream &OS) {
- GatherItinClasses();
-
- EmitSourceFileHeader("Target Instruction Descriptors", OS);
- OS << "namespace llvm {\n\n";
-
- CodeGenTarget &Target = CDP.getTargetInfo();
- const std::string &TargetName = Target.getName();
- Record *InstrInfo = Target.getInstructionSet();
-
- // Keep track of all of the def lists we have emitted already.
- std::map<std::vector<Record*>, unsigned> EmittedLists;
- unsigned ListNumber = 0;
-
- // Emit all of the instruction's implicit uses and defs.
- for (CodeGenTarget::inst_iterator II = Target.inst_begin(),
- E = Target.inst_end(); II != E; ++II) {
- Record *Inst = II->second.TheDef;
- std::vector<Record*> Uses = Inst->getValueAsListOfDefs("Uses");
- if (!Uses.empty()) {
- unsigned &IL = EmittedLists[Uses];
- if (!IL) PrintDefList(Uses, IL = ++ListNumber, OS);
- }
- std::vector<Record*> Defs = Inst->getValueAsListOfDefs("Defs");
- if (!Defs.empty()) {
- unsigned &IL = EmittedLists[Defs];
- if (!IL) PrintDefList(Defs, IL = ++ListNumber, OS);
- }
- }
-
- OperandInfoMapTy OperandInfoIDs;
-
- // Emit all of the operand info records.
- EmitOperandInfo(OS, OperandInfoIDs);
-
- // Emit all of the TargetInstrDesc records in their ENUM ordering.
- //
- OS << "\nstatic const TargetInstrDesc " << TargetName
- << "Insts[] = {\n";
- std::vector<const CodeGenInstruction*> NumberedInstructions;
- Target.getInstructionsByEnumValue(NumberedInstructions);
-
- for (unsigned i = 0, e = NumberedInstructions.size(); i != e; ++i)
- emitRecord(*NumberedInstructions[i], i, InstrInfo, EmittedLists,
- OperandInfoIDs, OS);
- OS << "};\n";
- OS << "} // End llvm namespace \n";
-}
-
-void InstrInfoEmitter::emitRecord(const CodeGenInstruction &Inst, unsigned Num,
- Record *InstrInfo,
- std::map<std::vector<Record*>, unsigned> &EmittedLists,
- const OperandInfoMapTy &OpInfo,
- std::ostream &OS) {
- int MinOperands = 0;
- if (!Inst.OperandList.empty())
- // Each logical operand can be multiple MI operands.
- MinOperands = Inst.OperandList.back().MIOperandNo +
- Inst.OperandList.back().MINumOperands;
-
- OS << " { ";
- OS << Num << ",\t" << MinOperands << ",\t"
- << Inst.NumDefs << ",\t" << getItinClassNumber(Inst.TheDef)
- << ",\t\"" << Inst.TheDef->getName() << "\", 0";
-
- // Emit all of the target indepedent flags...
- if (Inst.isReturn) OS << "|(1<<TID::Return)";
- if (Inst.isBranch) OS << "|(1<<TID::Branch)";
- if (Inst.isIndirectBranch) OS << "|(1<<TID::IndirectBranch)";
- if (Inst.isBarrier) OS << "|(1<<TID::Barrier)";
- if (Inst.hasDelaySlot) OS << "|(1<<TID::DelaySlot)";
- if (Inst.isCall) OS << "|(1<<TID::Call)";
- if (Inst.isSimpleLoad) OS << "|(1<<TID::SimpleLoad)";
- if (Inst.mayLoad) OS << "|(1<<TID::MayLoad)";
- if (Inst.mayStore) OS << "|(1<<TID::MayStore)";
- if (Inst.isPredicable) OS << "|(1<<TID::Predicable)";
- if (Inst.isConvertibleToThreeAddress) OS << "|(1<<TID::ConvertibleTo3Addr)";
- if (Inst.isCommutable) OS << "|(1<<TID::Commutable)";
- if (Inst.isTerminator) OS << "|(1<<TID::Terminator)";
- if (Inst.isReMaterializable) OS << "|(1<<TID::Rematerializable)";
- if (Inst.isNotDuplicable) OS << "|(1<<TID::NotDuplicable)";
- if (Inst.hasOptionalDef) OS << "|(1<<TID::HasOptionalDef)";
- if (Inst.usesCustomDAGSchedInserter)
- OS << "|(1<<TID::UsesCustomDAGSchedInserter)";
- if (Inst.isVariadic) OS << "|(1<<TID::Variadic)";
- if (Inst.hasSideEffects) OS << "|(1<<TID::UnmodeledSideEffects)";
- OS << ", 0";
-
- // Emit all of the target-specific flags...
- ListInit *LI = InstrInfo->getValueAsListInit("TSFlagsFields");
- ListInit *Shift = InstrInfo->getValueAsListInit("TSFlagsShifts");
- if (LI->getSize() != Shift->getSize())
- throw "Lengths of " + InstrInfo->getName() +
- ":(TargetInfoFields, TargetInfoPositions) must be equal!";
-
- for (unsigned i = 0, e = LI->getSize(); i != e; ++i)
- emitShiftedValue(Inst.TheDef, dynamic_cast<StringInit*>(LI->getElement(i)),
- dynamic_cast<IntInit*>(Shift->getElement(i)), OS);
-
- OS << ", ";
-
- // Emit the implicit uses and defs lists...
- std::vector<Record*> UseList = Inst.TheDef->getValueAsListOfDefs("Uses");
- if (UseList.empty())
- OS << "NULL, ";
- else
- OS << "ImplicitList" << EmittedLists[UseList] << ", ";
-
- std::vector<Record*> DefList = Inst.TheDef->getValueAsListOfDefs("Defs");
- if (DefList.empty())
- OS << "NULL, ";
- else
- OS << "ImplicitList" << EmittedLists[DefList] << ", ";
-
- // Emit the operand info.
- std::vector<std::string> OperandInfo = GetOperandInfo(Inst);
- if (OperandInfo.empty())
- OS << "0";
- else
- OS << "OperandInfo" << OpInfo.find(OperandInfo)->second;
-
- OS << " }, // Inst #" << Num << " = " << Inst.TheDef->getName() << "\n";
-}
-
-
-void InstrInfoEmitter::emitShiftedValue(Record *R, StringInit *Val,
- IntInit *ShiftInt, std::ostream &OS) {
- if (Val == 0 || ShiftInt == 0)
- throw std::string("Illegal value or shift amount in TargetInfo*!");
- RecordVal *RV = R->getValue(Val->getValue());
- int Shift = ShiftInt->getValue();
-
- if (RV == 0 || RV->getValue() == 0) {
- // This isn't an error if this is a builtin instruction.
- if (R->getName() != "PHI" &&
- R->getName() != "INLINEASM" &&
- R->getName() != "LABEL" &&
- R->getName() != "DECLARE" &&
- R->getName() != "EXTRACT_SUBREG" &&
- R->getName() != "INSERT_SUBREG" &&
- R->getName() != "IMPLICIT_DEF" &&
- R->getName() != "SUBREG_TO_REG")
- throw R->getName() + " doesn't have a field named '" +
- Val->getValue() + "'!";
- return;
- }
-
- Init *Value = RV->getValue();
- if (BitInit *BI = dynamic_cast<BitInit*>(Value)) {
- if (BI->getValue()) OS << "|(1<<" << Shift << ")";
- return;
- } else if (BitsInit *BI = dynamic_cast<BitsInit*>(Value)) {
- // Convert the Bits to an integer to print...
- Init *I = BI->convertInitializerTo(new IntRecTy());
- if (I)
- if (IntInit *II = dynamic_cast<IntInit*>(I)) {
- if (II->getValue()) {
- if (Shift)
- OS << "|(" << II->getValue() << "<<" << Shift << ")";
- else
- OS << "|" << II->getValue();
- }
- return;
- }
-
- } else if (IntInit *II = dynamic_cast<IntInit*>(Value)) {
- if (II->getValue()) {
- if (Shift)
- OS << "|(" << II->getValue() << "<<" << Shift << ")";
- else
- OS << II->getValue();
- }
- return;
- }
-
- std::cerr << "Unhandled initializer: " << *Val << "\n";
- throw "In record '" + R->getName() + "' for TSFlag emission.";
-}
-
diff --git a/release_23/utils/TableGen/InstrInfoEmitter.h b/release_23/utils/TableGen/InstrInfoEmitter.h
deleted file mode 100644
index 2dd3a0f44fc9..000000000000
--- a/release_23/utils/TableGen/InstrInfoEmitter.h
+++ /dev/null
@@ -1,63 +0,0 @@
-//===- InstrInfoEmitter.h - Generate a Instruction Set Desc. ----*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This tablegen backend is responsible for emitting a description of the target
-// instruction set for the code generator.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef INSTRINFO_EMITTER_H
-#define INSTRINFO_EMITTER_H
-
-#include "TableGenBackend.h"
-#include "CodeGenDAGPatterns.h"
-#include <vector>
-#include <map>
-
-namespace llvm {
-
-class StringInit;
-class IntInit;
-class ListInit;
-class CodeGenInstruction;
-
-class InstrInfoEmitter : public TableGenBackend {
- RecordKeeper &Records;
- CodeGenDAGPatterns CDP;
- std::map<std::string, unsigned> ItinClassMap;
-
-public:
- InstrInfoEmitter(RecordKeeper &R) : Records(R), CDP(R) { }
-
- // run - Output the instruction set description, returning true on failure.
- void run(std::ostream &OS);
-
-private:
- typedef std::map<std::vector<std::string>, unsigned> OperandInfoMapTy;
-
- void emitRecord(const CodeGenInstruction &Inst, unsigned Num,
- Record *InstrInfo,
- std::map<std::vector<Record*>, unsigned> &EL,
- const OperandInfoMapTy &OpInfo,
- std::ostream &OS);
- void emitShiftedValue(Record *R, StringInit *Val, IntInit *Shift,
- std::ostream &OS);
-
- // Itinerary information.
- void GatherItinClasses();
- unsigned getItinClassNumber(const Record *InstRec);
-
- // Operand information.
- void EmitOperandInfo(std::ostream &OS, OperandInfoMapTy &OperandInfoIDs);
- std::vector<std::string> GetOperandInfo(const CodeGenInstruction &Inst);
-};
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/utils/TableGen/IntrinsicEmitter.cpp b/release_23/utils/TableGen/IntrinsicEmitter.cpp
deleted file mode 100644
index 567973a3cacd..000000000000
--- a/release_23/utils/TableGen/IntrinsicEmitter.cpp
+++ /dev/null
@@ -1,485 +0,0 @@
-//===- IntrinsicEmitter.cpp - Generate intrinsic information --------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This tablegen backend emits information about intrinsic functions.
-//
-//===----------------------------------------------------------------------===//
-
-#include "CodeGenTarget.h"
-#include "IntrinsicEmitter.h"
-#include "Record.h"
-#include "llvm/ADT/StringExtras.h"
-#include <algorithm>
-using namespace llvm;
-
-//===----------------------------------------------------------------------===//
-// IntrinsicEmitter Implementation
-//===----------------------------------------------------------------------===//
-
-void IntrinsicEmitter::run(std::ostream &OS) {
- EmitSourceFileHeader("Intrinsic Function Source Fragment", OS);
-
- std::vector<CodeGenIntrinsic> Ints = LoadIntrinsics(Records);
-
- // Emit the enum information.
- EmitEnumInfo(Ints, OS);
-
- // Emit the intrinsic ID -> name table.
- EmitIntrinsicToNameTable(Ints, OS);
-
- // Emit the function name recognizer.
- EmitFnNameRecognizer(Ints, OS);
-
- // Emit the intrinsic verifier.
- EmitVerifier(Ints, OS);
-
- // Emit the intrinsic declaration generator.
- EmitGenerator(Ints, OS);
-
- // Emit the intrinsic parameter attributes.
- EmitAttributes(Ints, OS);
-
- // Emit a list of intrinsics with corresponding GCC builtins.
- EmitGCCBuiltinList(Ints, OS);
-
- // Emit code to translate GCC builtins into LLVM intrinsics.
- EmitIntrinsicToGCCBuiltinMap(Ints, OS);
-}
-
-void IntrinsicEmitter::EmitEnumInfo(const std::vector<CodeGenIntrinsic> &Ints,
- std::ostream &OS) {
- OS << "// Enum values for Intrinsics.h\n";
- OS << "#ifdef GET_INTRINSIC_ENUM_VALUES\n";
- for (unsigned i = 0, e = Ints.size(); i != e; ++i) {
- OS << " " << Ints[i].EnumName;
- OS << ((i != e-1) ? ", " : " ");
- OS << std::string(40-Ints[i].EnumName.size(), ' ')
- << "// " << Ints[i].Name << "\n";
- }
- OS << "#endif\n\n";
-}
-
-void IntrinsicEmitter::
-EmitFnNameRecognizer(const std::vector<CodeGenIntrinsic> &Ints,
- std::ostream &OS) {
- // Build a function name -> intrinsic name mapping.
- std::map<std::string, unsigned> IntMapping;
- for (unsigned i = 0, e = Ints.size(); i != e; ++i)
- IntMapping[Ints[i].Name] = i;
-
- OS << "// Function name -> enum value recognizer code.\n";
- OS << "#ifdef GET_FUNCTION_RECOGNIZER\n";
- OS << " switch (Name[5]) {\n";
- OS << " default:\n";
- // Emit the intrinsics in sorted order.
- char LastChar = 0;
- for (std::map<std::string, unsigned>::iterator I = IntMapping.begin(),
- E = IntMapping.end(); I != E; ++I) {
- if (I->first[5] != LastChar) {
- LastChar = I->first[5];
- OS << " break;\n";
- OS << " case '" << LastChar << "':\n";
- }
-
- // For overloaded intrinsics, only the prefix needs to match
- if (Ints[I->second].isOverloaded)
- OS << " if (Len > " << I->first.size()
- << " && !memcmp(Name, \"" << I->first << ".\", "
- << (I->first.size() + 1) << ")) return Intrinsic::"
- << Ints[I->second].EnumName << ";\n";
- else
- OS << " if (Len == " << I->first.size()
- << " && !memcmp(Name, \"" << I->first << "\", "
- << I->first.size() << ")) return Intrinsic::"
- << Ints[I->second].EnumName << ";\n";
- }
- OS << " }\n";
- OS << "#endif\n\n";
-}
-
-void IntrinsicEmitter::
-EmitIntrinsicToNameTable(const std::vector<CodeGenIntrinsic> &Ints,
- std::ostream &OS) {
- OS << "// Intrinsic ID to name table\n";
- OS << "#ifdef GET_INTRINSIC_NAME_TABLE\n";
- OS << " // Note that entry #0 is the invalid intrinsic!\n";
- for (unsigned i = 0, e = Ints.size(); i != e; ++i)
- OS << " \"" << Ints[i].Name << "\",\n";
- OS << "#endif\n\n";
-}
-
-static void EmitTypeForValueType(std::ostream &OS, MVT::ValueType VT) {
- if (MVT::isInteger(VT)) {
- unsigned BitWidth = MVT::getSizeInBits(VT);
- OS << "IntegerType::get(" << BitWidth << ")";
- } else if (VT == MVT::Other) {
- // MVT::OtherVT is used to mean the empty struct type here.
- OS << "StructType::get(std::vector<const Type *>())";
- } else if (VT == MVT::f32) {
- OS << "Type::FloatTy";
- } else if (VT == MVT::f64) {
- OS << "Type::DoubleTy";
- } else if (VT == MVT::f80) {
- OS << "Type::X86_FP80Ty";
- } else if (VT == MVT::f128) {
- OS << "Type::FP128Ty";
- } else if (VT == MVT::ppcf128) {
- OS << "Type::PPC_FP128Ty";
- } else if (VT == MVT::isVoid) {
- OS << "Type::VoidTy";
- } else {
- assert(false && "Unsupported ValueType!");
- }
-}
-
-static void EmitTypeGenerate(std::ostream &OS, Record *ArgType,
- unsigned &ArgNo) {
- MVT::ValueType VT = getValueType(ArgType->getValueAsDef("VT"));
-
- if (ArgType->isSubClassOf("LLVMMatchType")) {
- unsigned Number = ArgType->getValueAsInt("Number");
- assert(Number < ArgNo && "Invalid matching number!");
- OS << "Tys[" << Number << "]";
- } else if (VT == MVT::iAny || VT == MVT::fAny) {
- // NOTE: The ArgNo variable here is not the absolute argument number, it is
- // the index of the "arbitrary" type in the Tys array passed to the
- // Intrinsic::getDeclaration function. Consequently, we only want to
- // increment it when we actually hit an overloaded type. Getting this wrong
- // leads to very subtle bugs!
- OS << "Tys[" << ArgNo++ << "]";
- } else if (MVT::isVector(VT)) {
- OS << "VectorType::get(";
- EmitTypeForValueType(OS, MVT::getVectorElementType(VT));
- OS << ", " << MVT::getVectorNumElements(VT) << ")";
- } else if (VT == MVT::iPTR) {
- OS << "PointerType::getUnqual(";
- EmitTypeGenerate(OS, ArgType->getValueAsDef("ElTy"), ArgNo);
- OS << ")";
- } else if (VT == MVT::isVoid) {
- if (ArgNo == 0)
- OS << "Type::VoidTy";
- else
- // MVT::isVoid is used to mean varargs here.
- OS << "...";
- } else {
- EmitTypeForValueType(OS, VT);
- }
-}
-
-/// RecordListComparator - Provide a determinstic comparator for lists of
-/// records.
-namespace {
- struct RecordListComparator {
- bool operator()(const std::vector<Record*> &LHS,
- const std::vector<Record*> &RHS) const {
- unsigned i = 0;
- do {
- if (i == RHS.size()) return false; // RHS is shorter than LHS.
- if (LHS[i] != RHS[i])
- return LHS[i]->getName() < RHS[i]->getName();
- } while (++i != LHS.size());
-
- return i != RHS.size();
- }
- };
-}
-
-void IntrinsicEmitter::EmitVerifier(const std::vector<CodeGenIntrinsic> &Ints,
- std::ostream &OS) {
- OS << "// Verifier::visitIntrinsicFunctionCall code.\n";
- OS << "#ifdef GET_INTRINSIC_VERIFIER\n";
- OS << " switch (ID) {\n";
- OS << " default: assert(0 && \"Invalid intrinsic!\");\n";
-
- // This checking can emit a lot of very common code. To reduce the amount of
- // code that we emit, batch up cases that have identical types. This avoids
- // problems where GCC can run out of memory compiling Verifier.cpp.
- typedef std::map<std::vector<Record*>, std::vector<unsigned>,
- RecordListComparator> MapTy;
- MapTy UniqueArgInfos;
-
- // Compute the unique argument type info.
- for (unsigned i = 0, e = Ints.size(); i != e; ++i)
- UniqueArgInfos[Ints[i].ArgTypeDefs].push_back(i);
-
- // Loop through the array, emitting one comparison for each batch.
- for (MapTy::iterator I = UniqueArgInfos.begin(),
- E = UniqueArgInfos.end(); I != E; ++I) {
- for (unsigned i = 0, e = I->second.size(); i != e; ++i) {
- OS << " case Intrinsic::" << Ints[I->second[i]].EnumName << ":\t\t// "
- << Ints[I->second[i]].Name << "\n";
- }
-
- const std::vector<Record*> &ArgTypes = I->first;
- OS << " VerifyIntrinsicPrototype(ID, IF, " << ArgTypes.size() << ", ";
- for (unsigned j = 0; j != ArgTypes.size(); ++j) {
- Record *ArgType = ArgTypes[j];
- if (ArgType->isSubClassOf("LLVMMatchType")) {
- unsigned Number = ArgType->getValueAsInt("Number");
- assert(Number < j && "Invalid matching number!");
- OS << "~" << Number;
- } else {
- MVT::ValueType VT = getValueType(ArgType->getValueAsDef("VT"));
- OS << getEnumName(VT);
- if (VT == MVT::isVoid && j != 0 && j != ArgTypes.size()-1)
- throw "Var arg type not last argument";
- }
- if (j != ArgTypes.size()-1)
- OS << ", ";
- }
-
- OS << ");\n";
- OS << " break;\n";
- }
- OS << " }\n";
- OS << "#endif\n\n";
-}
-
-void IntrinsicEmitter::EmitGenerator(const std::vector<CodeGenIntrinsic> &Ints,
- std::ostream &OS) {
- OS << "// Code for generating Intrinsic function declarations.\n";
- OS << "#ifdef GET_INTRINSIC_GENERATOR\n";
- OS << " switch (id) {\n";
- OS << " default: assert(0 && \"Invalid intrinsic!\");\n";
-
- // Similar to GET_INTRINSIC_VERIFIER, batch up cases that have identical
- // types.
- typedef std::map<std::vector<Record*>, std::vector<unsigned>,
- RecordListComparator> MapTy;
- MapTy UniqueArgInfos;
-
- // Compute the unique argument type info.
- for (unsigned i = 0, e = Ints.size(); i != e; ++i)
- UniqueArgInfos[Ints[i].ArgTypeDefs].push_back(i);
-
- // Loop through the array, emitting one generator for each batch.
- for (MapTy::iterator I = UniqueArgInfos.begin(),
- E = UniqueArgInfos.end(); I != E; ++I) {
- for (unsigned i = 0, e = I->second.size(); i != e; ++i) {
- OS << " case Intrinsic::" << Ints[I->second[i]].EnumName << ":\t\t// "
- << Ints[I->second[i]].Name << "\n";
- }
-
- const std::vector<Record*> &ArgTypes = I->first;
- unsigned N = ArgTypes.size();
-
- if (N > 1 &&
- getValueType(ArgTypes[N-1]->getValueAsDef("VT")) == MVT::isVoid) {
- OS << " IsVarArg = true;\n";
- --N;
- }
-
- unsigned ArgNo = 0;
- OS << " ResultTy = ";
- EmitTypeGenerate(OS, ArgTypes[0], ArgNo);
- OS << ";\n";
-
- for (unsigned j = 1; j != N; ++j) {
- OS << " ArgTys.push_back(";
- EmitTypeGenerate(OS, ArgTypes[j], ArgNo);
- OS << ");\n";
- }
- OS << " break;\n";
- }
- OS << " }\n";
- OS << "#endif\n\n";
-}
-
-void IntrinsicEmitter::
-EmitAttributes(const std::vector<CodeGenIntrinsic> &Ints, std::ostream &OS) {
- OS << "// Add parameter attributes that are not common to all intrinsics.\n";
- OS << "#ifdef GET_INTRINSIC_ATTRIBUTES\n";
- OS << " switch (id) {\n";
- OS << " default: break;\n";
- for (unsigned i = 0, e = Ints.size(); i != e; ++i) {
- switch (Ints[i].ModRef) {
- default: break;
- case CodeGenIntrinsic::NoMem:
- OS << " case Intrinsic::" << Ints[i].EnumName << ":\n";
- break;
- }
- }
- OS << " Attr |= ParamAttr::ReadNone; // These do not access memory.\n";
- OS << " break;\n";
- for (unsigned i = 0, e = Ints.size(); i != e; ++i) {
- switch (Ints[i].ModRef) {
- default: break;
- case CodeGenIntrinsic::ReadArgMem:
- case CodeGenIntrinsic::ReadMem:
- OS << " case Intrinsic::" << Ints[i].EnumName << ":\n";
- break;
- }
- }
- OS << " Attr |= ParamAttr::ReadOnly; // These do not write memory.\n";
- OS << " break;\n";
- OS << " }\n";
- OS << "#endif\n\n";
-}
-
-void IntrinsicEmitter::
-EmitGCCBuiltinList(const std::vector<CodeGenIntrinsic> &Ints, std::ostream &OS){
- OS << "// Get the GCC builtin that corresponds to an LLVM intrinsic.\n";
- OS << "#ifdef GET_GCC_BUILTIN_NAME\n";
- OS << " switch (F->getIntrinsicID()) {\n";
- OS << " default: BuiltinName = \"\"; break;\n";
- for (unsigned i = 0, e = Ints.size(); i != e; ++i) {
- if (!Ints[i].GCCBuiltinName.empty()) {
- OS << " case Intrinsic::" << Ints[i].EnumName << ": BuiltinName = \""
- << Ints[i].GCCBuiltinName << "\"; break;\n";
- }
- }
- OS << " }\n";
- OS << "#endif\n\n";
-}
-
-/// EmitBuiltinComparisons - Emit comparisons to determine whether the specified
-/// sorted range of builtin names is equal to the current builtin. This breaks
-/// it down into a simple tree.
-///
-/// At this point, we know that all the builtins in the range have the same name
-/// for the first 'CharStart' characters. Only the end of the name needs to be
-/// discriminated.
-typedef std::map<std::string, std::string>::const_iterator StrMapIterator;
-static void EmitBuiltinComparisons(StrMapIterator Start, StrMapIterator End,
- unsigned CharStart, unsigned Indent,
- std::ostream &OS) {
- if (Start == End) return; // empty range.
-
- // Determine what, if anything, is the same about all these strings.
- std::string CommonString = Start->first;
- unsigned NumInRange = 0;
- for (StrMapIterator I = Start; I != End; ++I, ++NumInRange) {
- // Find the first character that doesn't match.
- const std::string &ThisStr = I->first;
- unsigned NonMatchChar = CharStart;
- while (NonMatchChar < CommonString.size() &&
- NonMatchChar < ThisStr.size() &&
- CommonString[NonMatchChar] == ThisStr[NonMatchChar])
- ++NonMatchChar;
- // Truncate off pieces that don't match.
- CommonString.resize(NonMatchChar);
- }
-
- // Just compare the rest of the string.
- if (NumInRange == 1) {
- if (CharStart != CommonString.size()) {
- OS << std::string(Indent*2, ' ') << "if (!memcmp(BuiltinName";
- if (CharStart) OS << "+" << CharStart;
- OS << ", \"" << (CommonString.c_str()+CharStart) << "\", ";
- OS << CommonString.size() - CharStart << "))\n";
- ++Indent;
- }
- OS << std::string(Indent*2, ' ') << "IntrinsicID = Intrinsic::";
- OS << Start->second << ";\n";
- return;
- }
-
- // At this point, we potentially have a common prefix for these builtins, emit
- // a check for this common prefix.
- if (CommonString.size() != CharStart) {
- OS << std::string(Indent*2, ' ') << "if (!memcmp(BuiltinName";
- if (CharStart) OS << "+" << CharStart;
- OS << ", \"" << (CommonString.c_str()+CharStart) << "\", ";
- OS << CommonString.size()-CharStart << ")) {\n";
-
- EmitBuiltinComparisons(Start, End, CommonString.size(), Indent+1, OS);
- OS << std::string(Indent*2, ' ') << "}\n";
- return;
- }
-
- // Output a switch on the character that differs across the set.
- OS << std::string(Indent*2, ' ') << "switch (BuiltinName[" << CharStart
- << "]) {";
- if (CharStart)
- OS << " // \"" << std::string(Start->first.begin(),
- Start->first.begin()+CharStart) << "\"";
- OS << "\n";
-
- for (StrMapIterator I = Start; I != End; ) {
- char ThisChar = I->first[CharStart];
- OS << std::string(Indent*2, ' ') << "case '" << ThisChar << "':\n";
- // Figure out the range that has this common character.
- StrMapIterator NextChar = I;
- for (++NextChar; NextChar != End && NextChar->first[CharStart] == ThisChar;
- ++NextChar)
- /*empty*/;
- EmitBuiltinComparisons(I, NextChar, CharStart+1, Indent+1, OS);
- OS << std::string(Indent*2, ' ') << " break;\n";
- I = NextChar;
- }
- OS << std::string(Indent*2, ' ') << "}\n";
-}
-
-/// EmitTargetBuiltins - All of the builtins in the specified map are for the
-/// same target, and we already checked it.
-static void EmitTargetBuiltins(const std::map<std::string, std::string> &BIM,
- std::ostream &OS) {
- // Rearrange the builtins by length.
- std::vector<std::map<std::string, std::string> > BuiltinsByLen;
- BuiltinsByLen.reserve(100);
-
- for (StrMapIterator I = BIM.begin(), E = BIM.end(); I != E; ++I) {
- if (I->first.size() >= BuiltinsByLen.size())
- BuiltinsByLen.resize(I->first.size()+1);
- BuiltinsByLen[I->first.size()].insert(*I);
- }
-
- // Now that we have all the builtins by their length, emit a switch stmt.
- OS << " switch (strlen(BuiltinName)) {\n";
- OS << " default: break;\n";
- for (unsigned i = 0, e = BuiltinsByLen.size(); i != e; ++i) {
- if (BuiltinsByLen[i].empty()) continue;
- OS << " case " << i << ":\n";
- EmitBuiltinComparisons(BuiltinsByLen[i].begin(), BuiltinsByLen[i].end(),
- 0, 3, OS);
- OS << " break;\n";
- }
- OS << " }\n";
-}
-
-
-void IntrinsicEmitter::
-EmitIntrinsicToGCCBuiltinMap(const std::vector<CodeGenIntrinsic> &Ints,
- std::ostream &OS) {
- typedef std::map<std::string, std::map<std::string, std::string> > BIMTy;
- BIMTy BuiltinMap;
- for (unsigned i = 0, e = Ints.size(); i != e; ++i) {
- if (!Ints[i].GCCBuiltinName.empty()) {
- // Get the map for this target prefix.
- std::map<std::string, std::string> &BIM =BuiltinMap[Ints[i].TargetPrefix];
-
- if (!BIM.insert(std::make_pair(Ints[i].GCCBuiltinName,
- Ints[i].EnumName)).second)
- throw "Intrinsic '" + Ints[i].TheDef->getName() +
- "': duplicate GCC builtin name!";
- }
- }
-
- OS << "// Get the LLVM intrinsic that corresponds to a GCC builtin.\n";
- OS << "// This is used by the C front-end. The GCC builtin name is passed\n";
- OS << "// in as BuiltinName, and a target prefix (e.g. 'ppc') is passed\n";
- OS << "// in as TargetPrefix. The result is assigned to 'IntrinsicID'.\n";
- OS << "#ifdef GET_LLVM_INTRINSIC_FOR_GCC_BUILTIN\n";
- OS << " IntrinsicID = Intrinsic::not_intrinsic;\n";
-
- // Note: this could emit significantly better code if we cared.
- for (BIMTy::iterator I = BuiltinMap.begin(), E = BuiltinMap.end();I != E;++I){
- OS << " ";
- if (!I->first.empty())
- OS << "if (!strcmp(TargetPrefix, \"" << I->first << "\")) ";
- else
- OS << "/* Target Independent Builtins */ ";
- OS << "{\n";
-
- // Emit the comparisons for this target prefix.
- EmitTargetBuiltins(I->second, OS);
- OS << " }\n";
- }
- OS << "#endif\n\n";
-}
diff --git a/release_23/utils/TableGen/IntrinsicEmitter.h b/release_23/utils/TableGen/IntrinsicEmitter.h
deleted file mode 100644
index 357369263b97..000000000000
--- a/release_23/utils/TableGen/IntrinsicEmitter.h
+++ /dev/null
@@ -1,53 +0,0 @@
-//===- IntrinsicEmitter.h - Generate intrinsic information ------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This tablegen backend emits information about intrinsic functions.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef INTRINSIC_EMITTER_H
-#define INTRINSIC_EMITTER_H
-
-#include "CodeGenIntrinsics.h"
-#include "TableGenBackend.h"
-
-namespace llvm {
- class IntrinsicEmitter : public TableGenBackend {
- RecordKeeper &Records;
-
- public:
- IntrinsicEmitter(RecordKeeper &R) : Records(R) {}
-
- void run(std::ostream &OS);
-
- void EmitEnumInfo(const std::vector<CodeGenIntrinsic> &Ints,
- std::ostream &OS);
-
- void EmitFnNameRecognizer(const std::vector<CodeGenIntrinsic> &Ints,
- std::ostream &OS);
- void EmitIntrinsicToNameTable(const std::vector<CodeGenIntrinsic> &Ints,
- std::ostream &OS);
- void EmitVerifier(const std::vector<CodeGenIntrinsic> &Ints,
- std::ostream &OS);
- void EmitGenerator(const std::vector<CodeGenIntrinsic> &Ints,
- std::ostream &OS);
- void EmitAttributes(const std::vector<CodeGenIntrinsic> &Ints,
- std::ostream &OS);
- void EmitGCCBuiltinList(const std::vector<CodeGenIntrinsic> &Ints,
- std::ostream &OS);
- void EmitIntrinsicToGCCBuiltinMap(const std::vector<CodeGenIntrinsic> &Ints,
- std::ostream &OS);
- };
-
-} // End llvm namespace
-
-#endif
-
-
-
diff --git a/release_23/utils/TableGen/LLVMCConfigurationEmitter.cpp b/release_23/utils/TableGen/LLVMCConfigurationEmitter.cpp
deleted file mode 100644
index 1947aa5bef55..000000000000
--- a/release_23/utils/TableGen/LLVMCConfigurationEmitter.cpp
+++ /dev/null
@@ -1,1203 +0,0 @@
-//===- LLVMCConfigurationEmitter.cpp - Generate LLVMC config --------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open
-// Source License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This tablegen backend is responsible for emitting LLVMC configuration code.
-//
-//===----------------------------------------------------------------------===//
-
-#include "LLVMCConfigurationEmitter.h"
-#include "Record.h"
-
-#include "llvm/ADT/IntrusiveRefCntPtr.h"
-#include "llvm/ADT/SmallVector.h"
-#include "llvm/ADT/StringExtras.h"
-#include "llvm/ADT/StringMap.h"
-#include "llvm/Support/Streams.h"
-
-#include <algorithm>
-#include <cassert>
-#include <functional>
-#include <string>
-
-using namespace llvm;
-
-namespace {
-
-//===----------------------------------------------------------------------===//
-/// Typedefs
-
-typedef std::vector<Record*> RecordVector;
-typedef std::vector<std::string> StrVector;
-
-//===----------------------------------------------------------------------===//
-/// Constants
-
-// Indentation strings.
-const char * Indent1 = " ";
-const char * Indent2 = " ";
-const char * Indent3 = " ";
-const char * Indent4 = " ";
-
-// Default help string.
-const char * DefaultHelpString = "NO HELP MESSAGE PROVIDED";
-
-// Name for the "sink" option.
-const char * SinkOptionName = "AutoGeneratedSinkOption";
-
-//===----------------------------------------------------------------------===//
-/// Helper functions
-
-std::string InitPtrToString(Init* ptr) {
- StringInit& val = dynamic_cast<StringInit&>(*ptr);
- return val.getValue();
-}
-
-int InitPtrToInt(Init* ptr) {
- IntInit& val = dynamic_cast<IntInit&>(*ptr);
- return val.getValue();
-}
-
-const DagInit& InitPtrToDagInitRef(Init* ptr) {
- DagInit& val = dynamic_cast<DagInit&>(*ptr);
- return val;
-}
-
-
-// checkNumberOfArguments - Ensure that the number of args in d is
-// less than or equal to min_arguments, otherwise throw an exception .
-void checkNumberOfArguments (const DagInit* d, unsigned min_arguments) {
- if (d->getNumArgs() < min_arguments)
- throw "Property " + d->getOperator()->getAsString()
- + " has too few arguments!";
-}
-
-
-//===----------------------------------------------------------------------===//
-/// Back-end specific code
-
-// A command-line option can have one of the following types:
-//
-// Switch - a simple switch w/o arguments, e.g. -O2
-//
-// Parameter - an option that takes one(and only one) argument, e.g. -o file,
-// --output=file
-//
-// ParameterList - same as Parameter, but more than one occurence
-// of the option is allowed, e.g. -lm -lpthread
-//
-// Prefix - argument is everything after the prefix,
-// e.g. -Wa,-foo,-bar, -DNAME=VALUE
-//
-// PrefixList - same as Prefix, but more than one option occurence is
-// allowed
-
-namespace OptionType {
- enum OptionType { Switch, Parameter, ParameterList, Prefix, PrefixList};
-}
-
-bool IsListOptionType (OptionType::OptionType t) {
- return (t == OptionType::ParameterList || t == OptionType::PrefixList);
-}
-
-// Code duplication here is necessary because one option can affect
-// several tools and those tools may have different actions associated
-// with this option. GlobalOptionDescriptions are used to generate
-// the option registration code, while ToolOptionDescriptions are used
-// to generate tool-specific code.
-
-/// OptionDescription - Base class for option descriptions.
-struct OptionDescription {
- OptionType::OptionType Type;
- std::string Name;
-
- OptionDescription(OptionType::OptionType t = OptionType::Switch,
- const std::string& n = "")
- : Type(t), Name(n)
- {}
-
- const char* GenTypeDeclaration() const {
- switch (Type) {
- case OptionType::PrefixList:
- case OptionType::ParameterList:
- return "cl::list<std::string>";
- case OptionType::Switch:
- return "cl::opt<bool>";
- case OptionType::Parameter:
- case OptionType::Prefix:
- default:
- return "cl::opt<std::string>";
- }
- }
-
- std::string GenVariableName() const {
- switch (Type) {
- case OptionType::Switch:
- return "AutoGeneratedSwitch" + Name;
- case OptionType::Prefix:
- return "AutoGeneratedPrefix" + Name;
- case OptionType::PrefixList:
- return "AutoGeneratedPrefixList" + Name;
- case OptionType::Parameter:
- return "AutoGeneratedParameter" + Name;
- case OptionType::ParameterList:
- default:
- return "AutoGeneratedParameterList" + Name;
- }
- }
-
-};
-
-// Global option description.
-
-namespace GlobalOptionDescriptionFlags {
- enum GlobalOptionDescriptionFlags { Required = 0x1 };
-}
-
-struct GlobalOptionDescription : public OptionDescription {
- std::string Help;
- unsigned Flags;
-
- // We need to provide a default constructor because
- // StringMap can only store DefaultConstructible objects.
- GlobalOptionDescription() : OptionDescription(), Flags(0)
- {}
-
- GlobalOptionDescription (OptionType::OptionType t, const std::string& n)
- : OptionDescription(t, n), Help(DefaultHelpString), Flags(0)
- {}
-
- bool isRequired() const {
- return Flags & GlobalOptionDescriptionFlags::Required;
- }
- void setRequired() {
- Flags |= GlobalOptionDescriptionFlags::Required;
- }
-
- /// Merge - Merge two option descriptions.
- void Merge (const GlobalOptionDescription& other)
- {
- if (other.Type != Type)
- throw "Conflicting definitions for the option " + Name + "!";
-
- if (Help == DefaultHelpString)
- Help = other.Help;
- else if (other.Help != DefaultHelpString) {
- llvm::cerr << "Warning: more than one help string defined for option "
- + Name + "\n";
- }
-
- Flags |= other.Flags;
- }
-};
-
-/// GlobalOptionDescriptions - A GlobalOptionDescription array
-/// together with some flags affecting generation of option
-/// declarations.
-struct GlobalOptionDescriptions {
- typedef StringMap<GlobalOptionDescription> container_type;
- typedef container_type::const_iterator const_iterator;
-
- /// Descriptions - A list of GlobalOptionDescriptions.
- container_type Descriptions;
- /// HasSink - Should the emitter generate a "cl::sink" option?
- bool HasSink;
-
- const GlobalOptionDescription& FindOption(const std::string& OptName) const {
- const_iterator I = Descriptions.find(OptName);
- if (I != Descriptions.end())
- return I->second;
- else
- throw OptName + ": no such option!";
- }
-
- // Support for STL-style iteration
- const_iterator begin() const { return Descriptions.begin(); }
- const_iterator end() const { return Descriptions.end(); }
-};
-
-
-// Tool-local option description.
-
-// Properties without arguments are implemented as flags.
-namespace ToolOptionDescriptionFlags {
- enum ToolOptionDescriptionFlags { StopCompilation = 0x1,
- Forward = 0x2, UnpackValues = 0x4};
-}
-namespace OptionPropertyType {
- enum OptionPropertyType { AppendCmd };
-}
-
-typedef std::pair<OptionPropertyType::OptionPropertyType, std::string>
-OptionProperty;
-typedef SmallVector<OptionProperty, 4> OptionPropertyList;
-
-struct ToolOptionDescription : public OptionDescription {
- unsigned Flags;
- OptionPropertyList Props;
-
- // StringMap can only store DefaultConstructible objects
- ToolOptionDescription() : OptionDescription(), Flags(0) {}
-
- ToolOptionDescription (OptionType::OptionType t, const std::string& n)
- : OptionDescription(t, n)
- {}
-
- // Various boolean properties
- bool isStopCompilation() const {
- return Flags & ToolOptionDescriptionFlags::StopCompilation;
- }
- void setStopCompilation() {
- Flags |= ToolOptionDescriptionFlags::StopCompilation;
- }
-
- bool isForward() const {
- return Flags & ToolOptionDescriptionFlags::Forward;
- }
- void setForward() {
- Flags |= ToolOptionDescriptionFlags::Forward;
- }
-
- bool isUnpackValues() const {
- return Flags & ToolOptionDescriptionFlags::UnpackValues;
- }
- void setUnpackValues() {
- Flags |= ToolOptionDescriptionFlags::UnpackValues;
- }
-
- void AddProperty (OptionPropertyType::OptionPropertyType t,
- const std::string& val)
- {
- Props.push_back(std::make_pair(t, val));
- }
-};
-
-typedef StringMap<ToolOptionDescription> ToolOptionDescriptions;
-
-// Tool information record
-
-namespace ToolFlags {
- enum ToolFlags { Join = 0x1, Sink = 0x2 };
-}
-
-struct ToolProperties : public RefCountedBase<ToolProperties> {
- std::string Name;
- StrVector CmdLine;
- std::string InLanguage;
- std::string OutLanguage;
- std::string OutputSuffix;
- unsigned Flags;
- ToolOptionDescriptions OptDescs;
-
- // Various boolean properties
- void setSink() { Flags |= ToolFlags::Sink; }
- bool isSink() const { return Flags & ToolFlags::Sink; }
- void setJoin() { Flags |= ToolFlags::Join; }
- bool isJoin() const { return Flags & ToolFlags::Join; }
-
- // Default ctor here is needed because StringMap can only store
- // DefaultConstructible objects
- ToolProperties() : Flags(0) {}
- ToolProperties (const std::string& n) : Name(n), Flags(0) {}
-};
-
-
-/// ToolPropertiesList - A list of Tool information records
-/// IntrusiveRefCntPtrs are used here because StringMap has no copy
-/// constructor (and we want to avoid copying ToolProperties anyway).
-typedef std::vector<IntrusiveRefCntPtr<ToolProperties> > ToolPropertiesList;
-
-
-/// CollectProperties - Function object for iterating over a list of
-/// tool property records.
-class CollectProperties {
-private:
-
- /// Implementation details
-
- /// PropertyHandler - a function that extracts information
- /// about a given tool property from its DAG representation
- typedef void (CollectProperties::*PropertyHandler)(const DagInit*);
-
- /// PropertyHandlerMap - A map from property names to property
- /// handlers.
- typedef StringMap<PropertyHandler> PropertyHandlerMap;
-
- /// OptionPropertyHandler - a function that extracts information
- /// about a given option property from its DAG representation.
- typedef void (CollectProperties::* OptionPropertyHandler)
- (const DagInit*, GlobalOptionDescription &);
-
- /// OptionPropertyHandlerMap - A map from option property names to
- /// option property handlers
- typedef StringMap<OptionPropertyHandler> OptionPropertyHandlerMap;
-
- // Static maps from strings to CollectProperties methods("handlers")
- static PropertyHandlerMap propertyHandlers_;
- static OptionPropertyHandlerMap optionPropertyHandlers_;
- static bool staticMembersInitialized_;
-
-
- /// This is where the information is stored
-
- /// toolProps_ - Properties of the current Tool.
- ToolProperties& toolProps_;
- /// optDescs_ - OptionDescriptions table (used to register options
- /// globally).
- GlobalOptionDescriptions& optDescs_;
-
-public:
-
- explicit CollectProperties (ToolProperties& p, GlobalOptionDescriptions& d)
- : toolProps_(p), optDescs_(d)
- {
- if (!staticMembersInitialized_) {
- // Init tool property handlers
- propertyHandlers_["cmd_line"] = &CollectProperties::onCmdLine;
- propertyHandlers_["in_language"] = &CollectProperties::onInLanguage;
- propertyHandlers_["join"] = &CollectProperties::onJoin;
- propertyHandlers_["out_language"] = &CollectProperties::onOutLanguage;
- propertyHandlers_["output_suffix"] = &CollectProperties::onOutputSuffix;
- propertyHandlers_["parameter_option"]
- = &CollectProperties::onParameter;
- propertyHandlers_["parameter_list_option"] =
- &CollectProperties::onParameterList;
- propertyHandlers_["prefix_option"] = &CollectProperties::onPrefix;
- propertyHandlers_["prefix_list_option"] =
- &CollectProperties::onPrefixList;
- propertyHandlers_["sink"] = &CollectProperties::onSink;
- propertyHandlers_["switch_option"] = &CollectProperties::onSwitch;
-
- // Init option property handlers
- optionPropertyHandlers_["append_cmd"] = &CollectProperties::onAppendCmd;
- optionPropertyHandlers_["forward"] = &CollectProperties::onForward;
- optionPropertyHandlers_["help"] = &CollectProperties::onHelp;
- optionPropertyHandlers_["required"] = &CollectProperties::onRequired;
- optionPropertyHandlers_["stop_compilation"] =
- &CollectProperties::onStopCompilation;
- optionPropertyHandlers_["unpack_values"] =
- &CollectProperties::onUnpackValues;
-
- staticMembersInitialized_ = true;
- }
- }
-
- /// operator() - Gets called for every tool property; Just forwards
- /// to the corresponding property handler.
- void operator() (Init* i) {
- const DagInit& d = InitPtrToDagInitRef(i);
- const std::string& property_name = d.getOperator()->getAsString();
- PropertyHandlerMap::iterator method
- = propertyHandlers_.find(property_name);
-
- if (method != propertyHandlers_.end()) {
- PropertyHandler h = method->second;
- (this->*h)(&d);
- }
- else {
- throw "Unknown tool property: " + property_name + "!";
- }
- }
-
-private:
-
- /// Property handlers --
- /// Functions that extract information about tool properties from
- /// DAG representation.
-
- void onCmdLine (const DagInit* d) {
- checkNumberOfArguments(d, 1);
- SplitString(InitPtrToString(d->getArg(0)), toolProps_.CmdLine);
- if (toolProps_.CmdLine.empty())
- throw "Tool " + toolProps_.Name + " has empty command line!";
- }
-
- void onInLanguage (const DagInit* d) {
- checkNumberOfArguments(d, 1);
- toolProps_.InLanguage = InitPtrToString(d->getArg(0));
- }
-
- void onJoin (const DagInit* d) {
- checkNumberOfArguments(d, 0);
- toolProps_.setJoin();
- }
-
- void onOutLanguage (const DagInit* d) {
- checkNumberOfArguments(d, 1);
- toolProps_.OutLanguage = InitPtrToString(d->getArg(0));
- }
-
- void onOutputSuffix (const DagInit* d) {
- checkNumberOfArguments(d, 1);
- toolProps_.OutputSuffix = InitPtrToString(d->getArg(0));
- }
-
- void onSink (const DagInit* d) {
- checkNumberOfArguments(d, 0);
- optDescs_.HasSink = true;
- toolProps_.setSink();
- }
-
- void onSwitch (const DagInit* d) {
- addOption(d, OptionType::Switch);
- }
-
- void onParameter (const DagInit* d) {
- addOption(d, OptionType::Parameter);
- }
-
- void onParameterList (const DagInit* d) {
- addOption(d, OptionType::ParameterList);
- }
-
- void onPrefix (const DagInit* d) {
- addOption(d, OptionType::Prefix);
- }
-
- void onPrefixList (const DagInit* d) {
- addOption(d, OptionType::PrefixList);
- }
-
- /// Option property handlers --
- /// Methods that handle properties that are common for all types of
- /// options (like append_cmd, stop_compilation)
-
- void onAppendCmd (const DagInit* d, GlobalOptionDescription& o) {
- checkNumberOfArguments(d, 1);
- std::string const& cmd = InitPtrToString(d->getArg(0));
-
- toolProps_.OptDescs[o.Name].AddProperty(OptionPropertyType::AppendCmd, cmd);
- }
-
- void onForward (const DagInit* d, GlobalOptionDescription& o) {
- checkNumberOfArguments(d, 0);
- toolProps_.OptDescs[o.Name].setForward();
- }
-
- void onHelp (const DagInit* d, GlobalOptionDescription& o) {
- checkNumberOfArguments(d, 1);
- const std::string& help_message = InitPtrToString(d->getArg(0));
-
- o.Help = help_message;
- }
-
- void onRequired (const DagInit* d, GlobalOptionDescription& o) {
- checkNumberOfArguments(d, 0);
- o.setRequired();
- }
-
- void onStopCompilation (const DagInit* d, GlobalOptionDescription& o) {
- checkNumberOfArguments(d, 0);
- if (o.Type != OptionType::Switch)
- throw std::string("Only options of type Switch can stop compilation!");
- toolProps_.OptDescs[o.Name].setStopCompilation();
- }
-
- void onUnpackValues (const DagInit* d, GlobalOptionDescription& o) {
- checkNumberOfArguments(d, 0);
- toolProps_.OptDescs[o.Name].setUnpackValues();
- }
-
- /// Helper functions
-
- // Add an option of type t
- void addOption (const DagInit* d, OptionType::OptionType t) {
- checkNumberOfArguments(d, 2);
- const std::string& name = InitPtrToString(d->getArg(0));
-
- GlobalOptionDescription o(t, name);
- toolProps_.OptDescs[name].Type = t;
- toolProps_.OptDescs[name].Name = name;
- processOptionProperties(d, o);
- insertDescription(o);
- }
-
- // Insert new GlobalOptionDescription into GlobalOptionDescriptions list
- void insertDescription (const GlobalOptionDescription& o)
- {
- if (optDescs_.Descriptions.count(o.Name)) {
- GlobalOptionDescription& D = optDescs_.Descriptions[o.Name];
- D.Merge(o);
- }
- else {
- optDescs_.Descriptions[o.Name] = o;
- }
- }
-
- /// processOptionProperties - Go through the list of option
- /// properties and call a corresponding handler for each.
- ///
- /// Parameters:
- /// name - option name
- /// d - option property list
- void processOptionProperties (const DagInit* d, GlobalOptionDescription& o) {
- // First argument is option name
- checkNumberOfArguments(d, 2);
-
- for (unsigned B = 1, E = d->getNumArgs(); B!=E; ++B) {
- const DagInit& option_property
- = InitPtrToDagInitRef(d->getArg(B));
- const std::string& option_property_name
- = option_property.getOperator()->getAsString();
- OptionPropertyHandlerMap::iterator method
- = optionPropertyHandlers_.find(option_property_name);
-
- if (method != optionPropertyHandlers_.end()) {
- OptionPropertyHandler h = method->second;
- (this->*h)(&option_property, o);
- }
- else {
- throw "Unknown option property: " + option_property_name + "!";
- }
- }
- }
-};
-
-// Static members of CollectProperties
-CollectProperties::PropertyHandlerMap
-CollectProperties::propertyHandlers_;
-
-CollectProperties::OptionPropertyHandlerMap
-CollectProperties::optionPropertyHandlers_;
-
-bool CollectProperties::staticMembersInitialized_ = false;
-
-
-/// CollectToolProperties - Gather information from the parsed
-/// TableGen data (basically a wrapper for the CollectProperties
-/// function object).
-void CollectToolProperties (RecordVector::const_iterator B,
- RecordVector::const_iterator E,
- ToolPropertiesList& TPList,
- GlobalOptionDescriptions& OptDescs)
-{
- // Iterate over a properties list of every Tool definition
- for (;B!=E;++B) {
- RecordVector::value_type T = *B;
- ListInit* PropList = T->getValueAsListInit("properties");
-
- IntrusiveRefCntPtr<ToolProperties>
- ToolProps(new ToolProperties(T->getName()));
-
- std::for_each(PropList->begin(), PropList->end(),
- CollectProperties(*ToolProps, OptDescs));
- TPList.push_back(ToolProps);
- }
-}
-
-/// EmitForwardOptionPropertyHandlingCode - Helper function used to
-/// implement EmitOptionPropertyHandlingCode(). Emits code for
-/// handling the (forward) option property.
-void EmitForwardOptionPropertyHandlingCode (const ToolOptionDescription& D,
- std::ostream& O) {
- switch (D.Type) {
- case OptionType::Switch:
- O << Indent3 << "vec.push_back(\"-" << D.Name << "\");\n";
- break;
- case OptionType::Parameter:
- O << Indent3 << "vec.push_back(\"-" << D.Name << "\");\n";
- O << Indent3 << "vec.push_back(" << D.GenVariableName() << ");\n";
- break;
- case OptionType::Prefix:
- O << Indent3 << "vec.push_back(\"-" << D.Name << "\" + "
- << D.GenVariableName() << ");\n";
- break;
- case OptionType::PrefixList:
- O << Indent3 << "for (" << D.GenTypeDeclaration()
- << "::iterator B = " << D.GenVariableName() << ".begin(),\n"
- << Indent3 << "E = " << D.GenVariableName() << ".end(); B != E; ++B)\n"
- << Indent4 << "vec.push_back(\"-" << D.Name << "\" + "
- << "*B);\n";
- break;
- case OptionType::ParameterList:
- O << Indent3 << "for (" << D.GenTypeDeclaration()
- << "::iterator B = " << D.GenVariableName() << ".begin(),\n"
- << Indent3 << "E = " << D.GenVariableName()
- << ".end() ; B != E; ++B) {\n"
- << Indent4 << "vec.push_back(\"-" << D.Name << "\");\n"
- << Indent4 << "vec.push_back(*B);\n"
- << Indent3 << "}\n";
- break;
- }
-}
-
-/// EmitOptionPropertyHandlingCode - Helper function used by
-/// EmitGenerateActionMethod(). Emits code that handles option
-/// properties.
-void EmitOptionPropertyHandlingCode (const ToolProperties& P,
- const ToolOptionDescription& D,
- std::ostream& O)
-{
- // Start of the if-clause.
- O << Indent2 << "if (";
- if (D.Type == OptionType::Switch)
- O << D.GenVariableName();
- else
- O << '!' << D.GenVariableName() << ".empty()";
-
- O <<") {\n";
-
- // Handle option properties that take an argument.
- for (OptionPropertyList::const_iterator B = D.Props.begin(),
- E = D.Props.end(); B!=E; ++B) {
- const OptionProperty& val = *B;
-
- switch (val.first) {
- // (append_cmd cmd) property
- case OptionPropertyType::AppendCmd:
- O << Indent3 << "vec.push_back(\"" << val.second << "\");\n";
- break;
- // Other properties with argument
- default:
- break;
- }
- }
-
- // Handle flags
-
- // (forward) property
- if (D.isForward())
- EmitForwardOptionPropertyHandlingCode(D, O);
-
- // (unpack_values) property
- if (D.isUnpackValues()) {
- if (IsListOptionType(D.Type)) {
- O << Indent3 << "for (" << D.GenTypeDeclaration()
- << "::iterator B = " << D.GenVariableName() << ".begin(),\n"
- << Indent3 << "E = " << D.GenVariableName()
- << ".end(); B != E; ++B)\n"
- << Indent4 << "llvm::SplitString(*B, vec, \",\");\n";
- }
- else if (D.Type == OptionType::Prefix || D.Type == OptionType::Parameter){
- O << Indent3 << "llvm::SplitString("
- << D.GenVariableName() << ", vec, \",\");\n";
- }
- else {
- // TOFIX: move this to the type-checking phase
- throw std::string("Switches can't have unpack_values property!");
- }
- }
-
- // End of the if-clause.
- O << Indent2 << "}\n";
-}
-
-// EmitGenerateActionMethod - Emit one of two versions of the
-// Tool::GenerateAction() method.
-void EmitGenerateActionMethod (const ToolProperties& P, bool V, std::ostream& O)
-{
- if (V)
- O << Indent1 << "Action GenerateAction(const PathVector& inFiles,\n";
- else
- O << Indent1 << "Action GenerateAction(const sys::Path& inFile,\n";
-
- O << Indent2 << "const sys::Path& outFile) const\n"
- << Indent1 << "{\n"
- << Indent2 << "std::vector<std::string> vec;\n";
-
- // Parse CmdLine tool property
- if(P.CmdLine.empty())
- throw "Tool " + P.Name + " has empty command line!";
-
- StrVector::const_iterator I = P.CmdLine.begin();
- ++I;
- for (StrVector::const_iterator E = P.CmdLine.end(); I != E; ++I) {
- const std::string& cmd = *I;
- O << Indent2;
- if (cmd == "$INFILE") {
- if (V)
- O << "for (PathVector::const_iterator B = inFiles.begin()"
- << ", E = inFiles.end();\n"
- << Indent2 << "B != E; ++B)\n"
- << Indent3 << "vec.push_back(B->toString());\n";
- else
- O << "vec.push_back(inFile.toString());\n";
- }
- else if (cmd == "$OUTFILE") {
- O << "vec.push_back(outFile.toString());\n";
- }
- else {
- O << "vec.push_back(\"" << cmd << "\");\n";
- }
- }
-
- // For every understood option, emit handling code.
- for (ToolOptionDescriptions::const_iterator B = P.OptDescs.begin(),
- E = P.OptDescs.end(); B != E; ++B) {
- const ToolOptionDescription& val = B->second;
- EmitOptionPropertyHandlingCode(P, val, O);
- }
-
- // Handle the Sink property.
- if (P.isSink()) {
- O << Indent2 << "if (!" << SinkOptionName << ".empty()) {\n"
- << Indent3 << "vec.insert(vec.end(), "
- << SinkOptionName << ".begin(), " << SinkOptionName << ".end());\n"
- << Indent2 << "}\n";
- }
-
- O << Indent2 << "return Action(\"" << P.CmdLine.at(0) << "\", vec);\n"
- << Indent1 << "}\n\n";
-}
-
-/// EmitGenerateActionMethods - Emit two GenerateAction() methods for
-/// a given Tool class.
-void EmitGenerateActionMethods (const ToolProperties& P, std::ostream& O) {
-
- if (!P.isJoin())
- O << Indent1 << "Action GenerateAction(const PathVector& inFiles,\n"
- << Indent2 << "const llvm::sys::Path& outFile) const\n"
- << Indent1 << "{\n"
- << Indent2 << "throw std::runtime_error(\"" << P.Name
- << " is not a Join tool!\");\n"
- << Indent1 << "}\n\n";
- else
- EmitGenerateActionMethod(P, true, O);
-
- EmitGenerateActionMethod(P, false, O);
-}
-
-/// EmitIsLastMethod - Emit the IsLast() method for a given Tool
-/// class.
-void EmitIsLastMethod (const ToolProperties& P, std::ostream& O) {
- O << Indent1 << "bool IsLast() const {\n"
- << Indent2 << "bool last = false;\n";
-
- for (ToolOptionDescriptions::const_iterator B = P.OptDescs.begin(),
- E = P.OptDescs.end(); B != E; ++B) {
- const ToolOptionDescription& val = B->second;
-
- if (val.isStopCompilation())
- O << Indent2
- << "if (" << val.GenVariableName()
- << ")\n" << Indent3 << "last = true;\n";
- }
-
- O << Indent2 << "return last;\n"
- << Indent1 << "}\n\n";
-}
-
-/// EmitInOutLanguageMethods - Emit the [Input,Output]Language()
-/// methods for a given Tool class.
-void EmitInOutLanguageMethods (const ToolProperties& P, std::ostream& O) {
- O << Indent1 << "const char* InputLanguage() const {\n"
- << Indent2 << "return \"" << P.InLanguage << "\";\n"
- << Indent1 << "}\n\n";
-
- O << Indent1 << "const char* OutputLanguage() const {\n"
- << Indent2 << "return \"" << P.OutLanguage << "\";\n"
- << Indent1 << "}\n\n";
-}
-
-/// EmitOutputSuffixMethod - Emit the OutputSuffix() method for a
-/// given Tool class.
-void EmitOutputSuffixMethod (const ToolProperties& P, std::ostream& O) {
- O << Indent1 << "const char* OutputSuffix() const {\n"
- << Indent2 << "return \"" << P.OutputSuffix << "\";\n"
- << Indent1 << "}\n\n";
-}
-
-/// EmitNameMethod - Emit the Name() method for a given Tool class.
-void EmitNameMethod (const ToolProperties& P, std::ostream& O) {
- O << Indent1 << "const char* Name() const {\n"
- << Indent2 << "return \"" << P.Name << "\";\n"
- << Indent1 << "}\n\n";
-}
-
-/// EmitIsJoinMethod - Emit the IsJoin() method for a given Tool
-/// class.
-void EmitIsJoinMethod (const ToolProperties& P, std::ostream& O) {
- O << Indent1 << "bool IsJoin() const {\n";
- if (P.isJoin())
- O << Indent2 << "return true;\n";
- else
- O << Indent2 << "return false;\n";
- O << Indent1 << "}\n\n";
-}
-
-/// EmitToolClassDefinition - Emit a Tool class definition.
-void EmitToolClassDefinition (const ToolProperties& P, std::ostream& O) {
-
- if(P.Name == "root")
- return;
-
- // Header
- O << "class " << P.Name << " : public ";
- if (P.isJoin())
- O << "JoinTool";
- else
- O << "Tool";
- O << " {\npublic:\n";
-
- EmitNameMethod(P, O);
- EmitInOutLanguageMethods(P, O);
- EmitOutputSuffixMethod(P, O);
- EmitIsJoinMethod(P, O);
- EmitGenerateActionMethods(P, O);
- EmitIsLastMethod(P, O);
-
- // Close class definition
- O << "};\n\n";
-}
-
-/// EmitOptionDescriptions - Iterate over a list of option
-/// descriptions and emit registration code.
-void EmitOptionDescriptions (const GlobalOptionDescriptions& descs,
- std::ostream& O)
-{
- // Emit static cl::Option variables
- for (GlobalOptionDescriptions::const_iterator B = descs.begin(),
- E = descs.end(); B!=E; ++B) {
- const GlobalOptionDescription& val = B->second;
-
- O << val.GenTypeDeclaration() << ' '
- << val.GenVariableName()
- << "(\"" << val.Name << '\"';
-
- if (val.Type == OptionType::Prefix || val.Type == OptionType::PrefixList)
- O << ", cl::Prefix";
-
- if (val.isRequired()) {
- switch (val.Type) {
- case OptionType::PrefixList:
- case OptionType::ParameterList:
- O << ", cl::OneOrMore";
- break;
- default:
- O << ", cl::Required";
- }
- }
-
- O << ", cl::desc(\"" << val.Help << "\"));\n";
- }
-
- if (descs.HasSink)
- O << "cl::list<std::string> " << SinkOptionName << "(cl::Sink);\n";
-
- O << '\n';
-}
-
-/// EmitPopulateLanguageMap - Emit the PopulateLanguageMap() function.
-void EmitPopulateLanguageMap (const RecordKeeper& Records, std::ostream& O)
-{
- // Get the relevant field out of RecordKeeper
- Record* LangMapRecord = Records.getDef("LanguageMap");
- if (!LangMapRecord)
- throw std::string("Language map definition not found!");
-
- ListInit* LangsToSuffixesList = LangMapRecord->getValueAsListInit("map");
- if (!LangsToSuffixesList)
- throw std::string("Error in the language map definition!");
-
- // Generate code
- O << "void llvmc::PopulateLanguageMap(LanguageMap& language_map) {\n";
-
- for (unsigned i = 0; i < LangsToSuffixesList->size(); ++i) {
- Record* LangToSuffixes = LangsToSuffixesList->getElementAsRecord(i);
-
- const std::string& Lang = LangToSuffixes->getValueAsString("lang");
- const ListInit* Suffixes = LangToSuffixes->getValueAsListInit("suffixes");
-
- for (unsigned i = 0; i < Suffixes->size(); ++i)
- O << Indent1 << "language_map[\""
- << InitPtrToString(Suffixes->getElement(i))
- << "\"] = \"" << Lang << "\";\n";
- }
-
- O << "}\n\n";
-}
-
-/// FillInToolToLang - Fills in two tables that map tool names to
-/// (input, output) languages. Used by the typechecker.
-void FillInToolToLang (const ToolPropertiesList& TPList,
- StringMap<std::string>& ToolToInLang,
- StringMap<std::string>& ToolToOutLang) {
- for (ToolPropertiesList::const_iterator B = TPList.begin(), E = TPList.end();
- B != E; ++B) {
- const ToolProperties& P = *(*B);
- ToolToInLang[P.Name] = P.InLanguage;
- ToolToOutLang[P.Name] = P.OutLanguage;
- }
-}
-
-/// TypecheckGraph - Check that names for output and input languages
-/// on all edges do match.
-// TOFIX: check for cycles.
-// TOFIX: check for multiple default edges.
-void TypecheckGraph (Record* CompilationGraph,
- const ToolPropertiesList& TPList) {
- StringMap<std::string> ToolToInLang;
- StringMap<std::string> ToolToOutLang;
-
- FillInToolToLang(TPList, ToolToInLang, ToolToOutLang);
- ListInit* edges = CompilationGraph->getValueAsListInit("edges");
- StringMap<std::string>::iterator IAE = ToolToInLang.end();
- StringMap<std::string>::iterator IBE = ToolToOutLang.end();
-
- for (unsigned i = 0; i < edges->size(); ++i) {
- Record* Edge = edges->getElementAsRecord(i);
- Record* A = Edge->getValueAsDef("a");
- Record* B = Edge->getValueAsDef("b");
- StringMap<std::string>::iterator IA = ToolToOutLang.find(A->getName());
- StringMap<std::string>::iterator IB = ToolToInLang.find(B->getName());
- if(IA == IAE)
- throw A->getName() + ": no such tool!";
- if(IB == IBE)
- throw B->getName() + ": no such tool!";
- if(A->getName() != "root" && IA->second != IB->second)
- throw "Edge " + A->getName() + "->" + B->getName()
- + ": output->input language mismatch";
- if(B->getName() == "root")
- throw std::string("Edges back to the root are not allowed!");
- }
-}
-
-/// EmitEdgePropertyTest1Arg - Helper function used by
-/// EmitEdgePropertyTest.
-bool EmitEdgePropertyTest1Arg(const std::string& PropName,
- const DagInit& Prop,
- const GlobalOptionDescriptions& OptDescs,
- std::ostream& O) {
- checkNumberOfArguments(&Prop, 1);
- const std::string& OptName = InitPtrToString(Prop.getArg(0));
- if (PropName == "switch_on") {
- const GlobalOptionDescription& OptDesc = OptDescs.FindOption(OptName);
- if (OptDesc.Type != OptionType::Switch)
- throw OptName + ": incorrect option type!";
- O << OptDesc.GenVariableName();
- return true;
- } else if (PropName == "if_input_languages_contain") {
- O << "InLangs.count(\"" << OptName << "\") != 0";
- return true;
- }
-
- return false;
-}
-
-/// EmitEdgePropertyTest2Args - Helper function used by
-/// EmitEdgePropertyTest.
-bool EmitEdgePropertyTest2Args(const std::string& PropName,
- const DagInit& Prop,
- const GlobalOptionDescriptions& OptDescs,
- std::ostream& O) {
- checkNumberOfArguments(&Prop, 2);
- const std::string& OptName = InitPtrToString(Prop.getArg(0));
- const std::string& OptArg = InitPtrToString(Prop.getArg(1));
- const GlobalOptionDescription& OptDesc = OptDescs.FindOption(OptName);
-
- if (PropName == "parameter_equals") {
- if (OptDesc.Type != OptionType::Parameter
- && OptDesc.Type != OptionType::Prefix)
- throw OptName + ": incorrect option type!";
- O << OptDesc.GenVariableName() << " == \"" << OptArg << "\"";
- return true;
- }
- else if (PropName == "element_in_list") {
- if (OptDesc.Type != OptionType::ParameterList
- && OptDesc.Type != OptionType::PrefixList)
- throw OptName + ": incorrect option type!";
- const std::string& VarName = OptDesc.GenVariableName();
- O << "std::find(" << VarName << ".begin(),\n"
- << Indent3 << VarName << ".end(), \""
- << OptArg << "\") != " << VarName << ".end()";
- return true;
- }
-
- return false;
-}
-
-// Forward declaration.
-void EmitEdgePropertyTest(const DagInit& Prop,
- const GlobalOptionDescriptions& OptDescs,
- std::ostream& O);
-
-/// EmitLogicalOperationTest - Helper function used by
-/// EmitEdgePropertyTest.
-void EmitLogicalOperationTest(const DagInit& Prop, const char* LogicOp,
- const GlobalOptionDescriptions& OptDescs,
- std::ostream& O) {
- O << '(';
- for (unsigned j = 0, NumArgs = Prop.getNumArgs(); j < NumArgs; ++j) {
- const DagInit& InnerProp = InitPtrToDagInitRef(Prop.getArg(j));
- EmitEdgePropertyTest(InnerProp, OptDescs, O);
- if (j != NumArgs - 1)
- O << ")\n" << Indent3 << ' ' << LogicOp << " (";
- else
- O << ')';
- }
-}
-
-/// EmitEdgePropertyTest - Helper function used by EmitEdgeClass.
-void EmitEdgePropertyTest(const DagInit& Prop,
- const GlobalOptionDescriptions& OptDescs,
- std::ostream& O) {
- const std::string& PropName = Prop.getOperator()->getAsString();
-
- if (PropName == "and")
- EmitLogicalOperationTest(Prop, "&&", OptDescs, O);
- else if (PropName == "or")
- EmitLogicalOperationTest(Prop, "||", OptDescs, O);
- else if (EmitEdgePropertyTest1Arg(PropName, Prop, OptDescs, O))
- return;
- else if (EmitEdgePropertyTest2Args(PropName, Prop, OptDescs, O))
- return;
- else
- throw PropName + ": unknown edge property!";
-}
-
-/// EmitEdgeClass - Emit a single Edge# class.
-void EmitEdgeClass(unsigned N, const std::string& Target,
- ListInit* Props, const GlobalOptionDescriptions& OptDescs,
- std::ostream& O) {
-
- // Class constructor.
- O << "class Edge" << N << ": public Edge {\n"
- << "public:\n"
- << Indent1 << "Edge" << N << "() : Edge(\"" << Target
- << "\") {}\n\n"
-
- // Function Weight().
- << Indent1 << "unsigned Weight(const InputLanguagesSet& InLangs) const {\n"
- << Indent2 << "unsigned ret = 0;\n";
-
- // Emit tests for every edge property.
- for (size_t i = 0, PropsSize = Props->size(); i < PropsSize; ++i) {
- const DagInit& Prop = InitPtrToDagInitRef(Props->getElement(i));
- const std::string& PropName = Prop.getOperator()->getAsString();
- unsigned N = 2;
-
- O << Indent2 << "if (";
-
- if (PropName == "weight") {
- checkNumberOfArguments(&Prop, 2);
- N = InitPtrToInt(Prop.getArg(0));
- const DagInit& InnerProp = InitPtrToDagInitRef(Prop.getArg(1));
- EmitEdgePropertyTest(InnerProp, OptDescs, O);
- }
- else {
- EmitEdgePropertyTest(Prop, OptDescs, O);
- }
-
- O << ")\n" << Indent3 << "ret += " << N << ";\n";
- }
-
- O << Indent2 << "return ret;\n"
- << Indent1 << "};\n\n};\n\n";
-}
-
-// Emit Edge* classes that represent graph edges.
-void EmitEdgeClasses (Record* CompilationGraph,
- const GlobalOptionDescriptions& OptDescs,
- std::ostream& O) {
- ListInit* edges = CompilationGraph->getValueAsListInit("edges");
-
- for (unsigned i = 0; i < edges->size(); ++i) {
- Record* Edge = edges->getElementAsRecord(i);
- Record* B = Edge->getValueAsDef("b");
- ListInit* Props = Edge->getValueAsListInit("props");
-
- if (Props->empty())
- continue;
-
- EmitEdgeClass(i, B->getName(), Props, OptDescs, O);
- }
-}
-
-/// EmitPopulateCompilationGraph - Emit the PopulateCompilationGraph()
-/// function.
-void EmitPopulateCompilationGraph (Record* CompilationGraph,
- std::ostream& O)
-{
- ListInit* edges = CompilationGraph->getValueAsListInit("edges");
-
- // Generate code
- O << "void llvmc::PopulateCompilationGraph(CompilationGraph& G) {\n"
- << Indent1 << "PopulateLanguageMap(G.ExtsToLangs);\n\n";
-
- // Insert vertices
-
- RecordVector Tools = Records.getAllDerivedDefinitions("Tool");
- if (Tools.empty())
- throw std::string("No tool definitions found!");
-
- for (RecordVector::iterator B = Tools.begin(), E = Tools.end(); B != E; ++B) {
- const std::string& Name = (*B)->getName();
- if(Name != "root")
- O << Indent1 << "G.insertNode(new "
- << Name << "());\n";
- }
-
- O << '\n';
-
- // Insert edges
- for (unsigned i = 0; i < edges->size(); ++i) {
- Record* Edge = edges->getElementAsRecord(i);
- Record* A = Edge->getValueAsDef("a");
- Record* B = Edge->getValueAsDef("b");
- ListInit* Props = Edge->getValueAsListInit("props");
-
- O << Indent1 << "G.insertEdge(\"" << A->getName() << "\", ";
-
- if (Props->empty())
- O << "new SimpleEdge(\"" << B->getName() << "\")";
- else
- O << "new Edge" << i << "()";
-
- O << ");\n";
- }
-
- O << "}\n\n";
-}
-
-
-// End of anonymous namespace
-}
-
-/// run - The back-end entry point.
-void LLVMCConfigurationEmitter::run (std::ostream &O) {
-
- // Emit file header.
- EmitSourceFileHeader("LLVMC Configuration Library", O);
-
- // Get a list of all defined Tools.
- RecordVector Tools = Records.getAllDerivedDefinitions("Tool");
- if (Tools.empty())
- throw std::string("No tool definitions found!");
-
- // Gather information from the Tool description dags.
- ToolPropertiesList tool_props;
- GlobalOptionDescriptions opt_descs;
- CollectToolProperties(Tools.begin(), Tools.end(), tool_props, opt_descs);
-
- // Emit global option registration code.
- EmitOptionDescriptions(opt_descs, O);
-
- // Emit PopulateLanguageMap() function
- // (a language map maps from file extensions to language names).
- EmitPopulateLanguageMap(Records, O);
-
- // Emit Tool classes.
- for (ToolPropertiesList::const_iterator B = tool_props.begin(),
- E = tool_props.end(); B!=E; ++B)
- EmitToolClassDefinition(*(*B), O);
-
- Record* CompilationGraphRecord = Records.getDef("CompilationGraph");
- if (!CompilationGraphRecord)
- throw std::string("Compilation graph description not found!");
-
- // Typecheck the compilation graph.
- TypecheckGraph(CompilationGraphRecord, tool_props);
-
- // Emit Edge# classes.
- EmitEdgeClasses(CompilationGraphRecord, opt_descs, O);
-
- // Emit PopulateCompilationGraph() function.
- EmitPopulateCompilationGraph(CompilationGraphRecord, O);
-
- // EOF
-}
diff --git a/release_23/utils/TableGen/LLVMCConfigurationEmitter.h b/release_23/utils/TableGen/LLVMCConfigurationEmitter.h
deleted file mode 100644
index 164f12d14603..000000000000
--- a/release_23/utils/TableGen/LLVMCConfigurationEmitter.h
+++ /dev/null
@@ -1,33 +0,0 @@
-//===- LLVMCConfigurationEmitter.cpp - Generate LLVMCC config -------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open
-// Source License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This tablegen backend is responsible for emitting LLVMCC configuration code.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_UTILS_TABLEGEN_LLVMCCONF_EMITTER_H
-#define LLVM_UTILS_TABLEGEN_LLVMCCONF_EMITTER_H
-
-#include "TableGenBackend.h"
-
-namespace llvm {
-
- /// LLVMCConfigurationEmitter - TableGen backend that generates
- /// configuration code for LLVMC.
- class LLVMCConfigurationEmitter : public TableGenBackend {
- RecordKeeper &Records;
- public:
- explicit LLVMCConfigurationEmitter(RecordKeeper &R) : Records(R) {}
-
- // run - Output the asmwriter, returning true on failure.
- void run(std::ostream &o);
- };
-}
-
-#endif //LLVM_UTILS_TABLEGEN_LLVMCCONF_EMITTER_H
diff --git a/release_23/utils/TableGen/Makefile b/release_23/utils/TableGen/Makefile
deleted file mode 100644
index 6e55c53df0ec..000000000000
--- a/release_23/utils/TableGen/Makefile
+++ /dev/null
@@ -1,18 +0,0 @@
-##===- utils/TableGen/Makefile -----------------------------*- Makefile -*-===##
-#
-# The LLVM Compiler Infrastructure
-#
-# This file is distributed under the University of Illinois Open Source
-# License. See LICENSE.TXT for details.
-#
-##===----------------------------------------------------------------------===##
-
-LEVEL = ../..
-TOOLNAME = tblgen
-NO_INSTALL = 1;
-USEDLIBS = LLVMSupport.a LLVMSystem.a
-REQUIRES_EH := 1
-REQUIRES_RTTI := 1
-
-include $(LEVEL)/Makefile.common
-
diff --git a/release_23/utils/TableGen/Record.cpp b/release_23/utils/TableGen/Record.cpp
deleted file mode 100644
index 3225c3cdcb05..000000000000
--- a/release_23/utils/TableGen/Record.cpp
+++ /dev/null
@@ -1,996 +0,0 @@
-//===- Record.cpp - Record implementation ---------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// Implement the tablegen record classes.
-//
-//===----------------------------------------------------------------------===//
-
-#include "Record.h"
-#include "llvm/Support/DataTypes.h"
-#include "llvm/Support/Streams.h"
-#include "llvm/ADT/StringExtras.h"
-#include <ios>
-
-using namespace llvm;
-
-//===----------------------------------------------------------------------===//
-// Type implementations
-//===----------------------------------------------------------------------===//
-
-void RecTy::dump() const { print(*cerr.stream()); }
-
-Init *BitRecTy::convertValue(BitsInit *BI) {
- if (BI->getNumBits() != 1) return 0; // Only accept if just one bit!
- return BI->getBit(0);
-}
-
-bool BitRecTy::baseClassOf(const BitsRecTy *RHS) const {
- return RHS->getNumBits() == 1;
-}
-
-Init *BitRecTy::convertValue(IntInit *II) {
- int Val = II->getValue();
- if (Val != 0 && Val != 1) return 0; // Only accept 0 or 1 for a bit!
-
- return new BitInit(Val != 0);
-}
-
-Init *BitRecTy::convertValue(TypedInit *VI) {
- if (dynamic_cast<BitRecTy*>(VI->getType()))
- return VI; // Accept variable if it is already of bit type!
- return 0;
-}
-
-std::string BitsRecTy::getAsString() const {
- return "bits<" + utostr(Size) + ">";
-}
-
-Init *BitsRecTy::convertValue(UnsetInit *UI) {
- BitsInit *Ret = new BitsInit(Size);
-
- for (unsigned i = 0; i != Size; ++i)
- Ret->setBit(i, new UnsetInit());
- return Ret;
-}
-
-Init *BitsRecTy::convertValue(BitInit *UI) {
- if (Size != 1) return 0; // Can only convert single bit...
- BitsInit *Ret = new BitsInit(1);
- Ret->setBit(0, UI);
- return Ret;
-}
-
-// convertValue from Int initializer to bits type: Split the integer up into the
-// appropriate bits...
-//
-Init *BitsRecTy::convertValue(IntInit *II) {
- int64_t Value = II->getValue();
- // Make sure this bitfield is large enough to hold the integer value...
- if (Value >= 0) {
- if (Value & ~((1LL << Size)-1))
- return 0;
- } else {
- if ((Value >> Size) != -1 || ((Value & (1LL << (Size-1))) == 0))
- return 0;
- }
-
- BitsInit *Ret = new BitsInit(Size);
- for (unsigned i = 0; i != Size; ++i)
- Ret->setBit(i, new BitInit(Value & (1LL << i)));
-
- return Ret;
-}
-
-Init *BitsRecTy::convertValue(BitsInit *BI) {
- // If the number of bits is right, return it. Otherwise we need to expand or
- // truncate...
- if (BI->getNumBits() == Size) return BI;
- return 0;
-}
-
-Init *BitsRecTy::convertValue(TypedInit *VI) {
- if (BitsRecTy *BRT = dynamic_cast<BitsRecTy*>(VI->getType()))
- if (BRT->Size == Size) {
- BitsInit *Ret = new BitsInit(Size);
- for (unsigned i = 0; i != Size; ++i)
- Ret->setBit(i, new VarBitInit(VI, i));
- return Ret;
- }
- if (Size == 1 && dynamic_cast<BitRecTy*>(VI->getType())) {
- BitsInit *Ret = new BitsInit(1);
- Ret->setBit(0, VI);
- return Ret;
- }
-
- return 0;
-}
-
-Init *IntRecTy::convertValue(BitInit *BI) {
- return new IntInit(BI->getValue());
-}
-
-Init *IntRecTy::convertValue(BitsInit *BI) {
- int Result = 0;
- for (unsigned i = 0, e = BI->getNumBits(); i != e; ++i)
- if (BitInit *Bit = dynamic_cast<BitInit*>(BI->getBit(i))) {
- Result |= Bit->getValue() << i;
- } else {
- return 0;
- }
- return new IntInit(Result);
-}
-
-Init *IntRecTy::convertValue(TypedInit *TI) {
- if (TI->getType()->typeIsConvertibleTo(this))
- return TI; // Accept variable if already of the right type!
- return 0;
-}
-
-Init *StringRecTy::convertValue(BinOpInit *BO) {
- if (BO->getOpcode() == BinOpInit::STRCONCAT) {
- Init *L = BO->getLHS()->convertInitializerTo(this);
- Init *R = BO->getRHS()->convertInitializerTo(this);
- if (L == 0 || R == 0) return 0;
- if (L != BO->getLHS() || R != BO->getRHS())
- return new BinOpInit(BinOpInit::STRCONCAT, L, R);
- return BO;
- }
- return 0;
-}
-
-
-Init *StringRecTy::convertValue(TypedInit *TI) {
- if (dynamic_cast<StringRecTy*>(TI->getType()))
- return TI; // Accept variable if already of the right type!
- return 0;
-}
-
-std::string ListRecTy::getAsString() const {
- return "list<" + Ty->getAsString() + ">";
-}
-
-Init *ListRecTy::convertValue(ListInit *LI) {
- std::vector<Init*> Elements;
-
- // Verify that all of the elements of the list are subclasses of the
- // appropriate class!
- for (unsigned i = 0, e = LI->getSize(); i != e; ++i)
- if (Init *CI = LI->getElement(i)->convertInitializerTo(Ty))
- Elements.push_back(CI);
- else
- return 0;
-
- return new ListInit(Elements);
-}
-
-Init *ListRecTy::convertValue(TypedInit *TI) {
- // Ensure that TI is compatible with our class.
- if (ListRecTy *LRT = dynamic_cast<ListRecTy*>(TI->getType()))
- if (LRT->getElementType()->typeIsConvertibleTo(getElementType()))
- return TI;
- return 0;
-}
-
-Init *CodeRecTy::convertValue(TypedInit *TI) {
- if (TI->getType()->typeIsConvertibleTo(this))
- return TI;
- return 0;
-}
-
-Init *DagRecTy::convertValue(TypedInit *TI) {
- if (TI->getType()->typeIsConvertibleTo(this))
- return TI;
- return 0;
-}
-
-Init *DagRecTy::convertValue(BinOpInit *BO) {
- if (BO->getOpcode() == BinOpInit::CONCAT) {
- Init *L = BO->getLHS()->convertInitializerTo(this);
- Init *R = BO->getRHS()->convertInitializerTo(this);
- if (L == 0 || R == 0) return 0;
- if (L != BO->getLHS() || R != BO->getRHS())
- return new BinOpInit(BinOpInit::CONCAT, L, R);
- return BO;
- }
- return 0;
-}
-
-std::string RecordRecTy::getAsString() const {
- return Rec->getName();
-}
-
-Init *RecordRecTy::convertValue(DefInit *DI) {
- // Ensure that DI is a subclass of Rec.
- if (!DI->getDef()->isSubClassOf(Rec))
- return 0;
- return DI;
-}
-
-Init *RecordRecTy::convertValue(TypedInit *TI) {
- // Ensure that TI is compatible with Rec.
- if (RecordRecTy *RRT = dynamic_cast<RecordRecTy*>(TI->getType()))
- if (RRT->getRecord()->isSubClassOf(getRecord()) ||
- RRT->getRecord() == getRecord())
- return TI;
- return 0;
-}
-
-bool RecordRecTy::baseClassOf(const RecordRecTy *RHS) const {
- return Rec == RHS->getRecord() || RHS->getRecord()->isSubClassOf(Rec);
-}
-
-
-//===----------------------------------------------------------------------===//
-// Initializer implementations
-//===----------------------------------------------------------------------===//
-
-void Init::dump() const { return print(*cerr.stream()); }
-
-Init *BitsInit::convertInitializerBitRange(const std::vector<unsigned> &Bits) {
- BitsInit *BI = new BitsInit(Bits.size());
- for (unsigned i = 0, e = Bits.size(); i != e; ++i) {
- if (Bits[i] >= getNumBits()) {
- delete BI;
- return 0;
- }
- BI->setBit(i, getBit(Bits[i]));
- }
- return BI;
-}
-
-std::string BitsInit::getAsString() const {
- //if (!printInHex(OS)) return;
- //if (!printAsVariable(OS)) return;
- //if (!printAsUnset(OS)) return;
-
- std::string Result = "{ ";
- for (unsigned i = 0, e = getNumBits(); i != e; ++i) {
- if (i) Result += ", ";
- if (Init *Bit = getBit(e-i-1))
- Result += Bit->getAsString();
- else
- Result += "*";
- }
- return Result + " }";
-}
-
-bool BitsInit::printInHex(std::ostream &OS) const {
- // First, attempt to convert the value into an integer value...
- int Result = 0;
- for (unsigned i = 0, e = getNumBits(); i != e; ++i)
- if (BitInit *Bit = dynamic_cast<BitInit*>(getBit(i))) {
- Result |= Bit->getValue() << i;
- } else {
- return true;
- }
-
- OS << "0x" << std::hex << Result << std::dec;
- return false;
-}
-
-bool BitsInit::printAsVariable(std::ostream &OS) const {
- // Get the variable that we may be set equal to...
- assert(getNumBits() != 0);
- VarBitInit *FirstBit = dynamic_cast<VarBitInit*>(getBit(0));
- if (FirstBit == 0) return true;
- TypedInit *Var = FirstBit->getVariable();
-
- // Check to make sure the types are compatible.
- BitsRecTy *Ty = dynamic_cast<BitsRecTy*>(FirstBit->getVariable()->getType());
- if (Ty == 0) return true;
- if (Ty->getNumBits() != getNumBits()) return true; // Incompatible types!
-
- // Check to make sure all bits are referring to the right bits in the variable
- for (unsigned i = 0, e = getNumBits(); i != e; ++i) {
- VarBitInit *Bit = dynamic_cast<VarBitInit*>(getBit(i));
- if (Bit == 0 || Bit->getVariable() != Var || Bit->getBitNum() != i)
- return true;
- }
-
- Var->print(OS);
- return false;
-}
-
-bool BitsInit::printAsUnset(std::ostream &OS) const {
- for (unsigned i = 0, e = getNumBits(); i != e; ++i)
- if (!dynamic_cast<UnsetInit*>(getBit(i)))
- return true;
- OS << "?";
- return false;
-}
-
-// resolveReferences - If there are any field references that refer to fields
-// that have been filled in, we can propagate the values now.
-//
-Init *BitsInit::resolveReferences(Record &R, const RecordVal *RV) {
- bool Changed = false;
- BitsInit *New = new BitsInit(getNumBits());
-
- for (unsigned i = 0, e = Bits.size(); i != e; ++i) {
- Init *B;
- Init *CurBit = getBit(i);
-
- do {
- B = CurBit;
- CurBit = CurBit->resolveReferences(R, RV);
- Changed |= B != CurBit;
- } while (B != CurBit);
- New->setBit(i, CurBit);
- }
-
- if (Changed)
- return New;
- delete New;
- return this;
-}
-
-std::string IntInit::getAsString() const {
- return itostr(Value);
-}
-
-Init *IntInit::convertInitializerBitRange(const std::vector<unsigned> &Bits) {
- BitsInit *BI = new BitsInit(Bits.size());
-
- for (unsigned i = 0, e = Bits.size(); i != e; ++i) {
- if (Bits[i] >= 32) {
- delete BI;
- return 0;
- }
- BI->setBit(i, new BitInit(Value & (1 << Bits[i])));
- }
- return BI;
-}
-
-Init *ListInit::convertInitListSlice(const std::vector<unsigned> &Elements) {
- std::vector<Init*> Vals;
- for (unsigned i = 0, e = Elements.size(); i != e; ++i) {
- if (Elements[i] >= getSize())
- return 0;
- Vals.push_back(getElement(Elements[i]));
- }
- return new ListInit(Vals);
-}
-
-Record *ListInit::getElementAsRecord(unsigned i) const {
- assert(i < Values.size() && "List element index out of range!");
- DefInit *DI = dynamic_cast<DefInit*>(Values[i]);
- if (DI == 0) throw "Expected record in list!";
- return DI->getDef();
-}
-
-Init *ListInit::resolveReferences(Record &R, const RecordVal *RV) {
- std::vector<Init*> Resolved;
- Resolved.reserve(getSize());
- bool Changed = false;
-
- for (unsigned i = 0, e = getSize(); i != e; ++i) {
- Init *E;
- Init *CurElt = getElement(i);
-
- do {
- E = CurElt;
- CurElt = CurElt->resolveReferences(R, RV);
- Changed |= E != CurElt;
- } while (E != CurElt);
- Resolved.push_back(E);
- }
-
- if (Changed)
- return new ListInit(Resolved);
- return this;
-}
-
-std::string ListInit::getAsString() const {
- std::string Result = "[";
- for (unsigned i = 0, e = Values.size(); i != e; ++i) {
- if (i) Result += ", ";
- Result += Values[i]->getAsString();
- }
- return Result + "]";
-}
-
-Init *BinOpInit::Fold() {
- switch (getOpcode()) {
- default: assert(0 && "Unknown binop");
- case CONCAT: {
- DagInit *LHSs = dynamic_cast<DagInit*>(LHS);
- DagInit *RHSs = dynamic_cast<DagInit*>(RHS);
- if (LHSs && RHSs) {
- DefInit *LOp = dynamic_cast<DefInit*>(LHSs->getOperator());
- DefInit *ROp = dynamic_cast<DefInit*>(RHSs->getOperator());
- if (LOp->getDef() != ROp->getDef()) {
- bool LIsOps =
- LOp->getDef()->getName() == "outs" ||
- LOp->getDef()->getName() != "ins" ||
- LOp->getDef()->getName() != "defs";
- bool RIsOps =
- ROp->getDef()->getName() == "outs" ||
- ROp->getDef()->getName() != "ins" ||
- ROp->getDef()->getName() != "defs";
- if (!LIsOps || !RIsOps)
- throw "Concated Dag operators do not match!";
- }
- std::vector<Init*> Args;
- std::vector<std::string> ArgNames;
- for (unsigned i = 0, e = LHSs->getNumArgs(); i != e; ++i) {
- Args.push_back(LHSs->getArg(i));
- ArgNames.push_back(LHSs->getArgName(i));
- }
- for (unsigned i = 0, e = RHSs->getNumArgs(); i != e; ++i) {
- Args.push_back(RHSs->getArg(i));
- ArgNames.push_back(RHSs->getArgName(i));
- }
- return new DagInit(LHSs->getOperator(), Args, ArgNames);
- }
- break;
- }
- case STRCONCAT: {
- StringInit *LHSs = dynamic_cast<StringInit*>(LHS);
- StringInit *RHSs = dynamic_cast<StringInit*>(RHS);
- if (LHSs && RHSs)
- return new StringInit(LHSs->getValue() + RHSs->getValue());
- break;
- }
- case SHL:
- case SRA:
- case SRL: {
- IntInit *LHSi = dynamic_cast<IntInit*>(LHS);
- IntInit *RHSi = dynamic_cast<IntInit*>(RHS);
- if (LHSi && RHSi) {
- int LHSv = LHSi->getValue(), RHSv = RHSi->getValue();
- int Result;
- switch (getOpcode()) {
- default: assert(0 && "Bad opcode!");
- case SHL: Result = LHSv << RHSv; break;
- case SRA: Result = LHSv >> RHSv; break;
- case SRL: Result = (unsigned)LHSv >> (unsigned)RHSv; break;
- }
- return new IntInit(Result);
- }
- break;
- }
- }
- return this;
-}
-
-Init *BinOpInit::resolveReferences(Record &R, const RecordVal *RV) {
- Init *lhs = LHS->resolveReferences(R, RV);
- Init *rhs = RHS->resolveReferences(R, RV);
-
- if (LHS != lhs || RHS != rhs)
- return (new BinOpInit(getOpcode(), lhs, rhs))->Fold();
- return Fold();
-}
-
-std::string BinOpInit::getAsString() const {
- std::string Result;
- switch (Opc) {
- case CONCAT: Result = "!con"; break;
- case SHL: Result = "!shl"; break;
- case SRA: Result = "!sra"; break;
- case SRL: Result = "!srl"; break;
- case STRCONCAT: Result = "!strconcat"; break;
- }
- return Result + "(" + LHS->getAsString() + ", " + RHS->getAsString() + ")";
-}
-
-Init *TypedInit::convertInitializerBitRange(const std::vector<unsigned> &Bits) {
- BitsRecTy *T = dynamic_cast<BitsRecTy*>(getType());
- if (T == 0) return 0; // Cannot subscript a non-bits variable...
- unsigned NumBits = T->getNumBits();
-
- BitsInit *BI = new BitsInit(Bits.size());
- for (unsigned i = 0, e = Bits.size(); i != e; ++i) {
- if (Bits[i] >= NumBits) {
- delete BI;
- return 0;
- }
- BI->setBit(i, new VarBitInit(this, Bits[i]));
- }
- return BI;
-}
-
-Init *TypedInit::convertInitListSlice(const std::vector<unsigned> &Elements) {
- ListRecTy *T = dynamic_cast<ListRecTy*>(getType());
- if (T == 0) return 0; // Cannot subscript a non-list variable...
-
- if (Elements.size() == 1)
- return new VarListElementInit(this, Elements[0]);
-
- std::vector<Init*> ListInits;
- ListInits.reserve(Elements.size());
- for (unsigned i = 0, e = Elements.size(); i != e; ++i)
- ListInits.push_back(new VarListElementInit(this, Elements[i]));
- return new ListInit(ListInits);
-}
-
-
-Init *VarInit::resolveBitReference(Record &R, const RecordVal *IRV,
- unsigned Bit) {
- if (R.isTemplateArg(getName())) return 0;
- if (IRV && IRV->getName() != getName()) return 0;
-
- RecordVal *RV = R.getValue(getName());
- assert(RV && "Reference to a non-existant variable?");
- assert(dynamic_cast<BitsInit*>(RV->getValue()));
- BitsInit *BI = (BitsInit*)RV->getValue();
-
- assert(Bit < BI->getNumBits() && "Bit reference out of range!");
- Init *B = BI->getBit(Bit);
-
- if (!dynamic_cast<UnsetInit*>(B)) // If the bit is not set...
- return B; // Replace the VarBitInit with it.
- return 0;
-}
-
-Init *VarInit::resolveListElementReference(Record &R, const RecordVal *IRV,
- unsigned Elt) {
- if (R.isTemplateArg(getName())) return 0;
- if (IRV && IRV->getName() != getName()) return 0;
-
- RecordVal *RV = R.getValue(getName());
- assert(RV && "Reference to a non-existant variable?");
- ListInit *LI = dynamic_cast<ListInit*>(RV->getValue());
- assert(LI && "Invalid list element!");
-
- if (Elt >= LI->getSize())
- return 0; // Out of range reference.
- Init *E = LI->getElement(Elt);
- if (!dynamic_cast<UnsetInit*>(E)) // If the element is set
- return E; // Replace the VarListElementInit with it.
- return 0;
-}
-
-
-RecTy *VarInit::getFieldType(const std::string &FieldName) const {
- if (RecordRecTy *RTy = dynamic_cast<RecordRecTy*>(getType()))
- if (const RecordVal *RV = RTy->getRecord()->getValue(FieldName))
- return RV->getType();
- return 0;
-}
-
-Init *VarInit::getFieldInit(Record &R, const std::string &FieldName) const {
- if (dynamic_cast<RecordRecTy*>(getType()))
- if (const RecordVal *RV = R.getValue(VarName)) {
- Init *TheInit = RV->getValue();
- assert(TheInit != this && "Infinite loop detected!");
- if (Init *I = TheInit->getFieldInit(R, FieldName))
- return I;
- else
- return 0;
- }
- return 0;
-}
-
-/// resolveReferences - This method is used by classes that refer to other
-/// variables which may not be defined at the time they expression is formed.
-/// If a value is set for the variable later, this method will be called on
-/// users of the value to allow the value to propagate out.
-///
-Init *VarInit::resolveReferences(Record &R, const RecordVal *RV) {
- if (RecordVal *Val = R.getValue(VarName))
- if (RV == Val || (RV == 0 && !dynamic_cast<UnsetInit*>(Val->getValue())))
- return Val->getValue();
- return this;
-}
-
-std::string VarBitInit::getAsString() const {
- return TI->getAsString() + "{" + utostr(Bit) + "}";
-}
-
-Init *VarBitInit::resolveReferences(Record &R, const RecordVal *RV) {
- if (Init *I = getVariable()->resolveBitReference(R, RV, getBitNum()))
- return I;
- return this;
-}
-
-std::string VarListElementInit::getAsString() const {
- return TI->getAsString() + "[" + utostr(Element) + "]";
-}
-
-Init *VarListElementInit::resolveReferences(Record &R, const RecordVal *RV) {
- if (Init *I = getVariable()->resolveListElementReference(R, RV,
- getElementNum()))
- return I;
- return this;
-}
-
-Init *VarListElementInit::resolveBitReference(Record &R, const RecordVal *RV,
- unsigned Bit) {
- // FIXME: This should be implemented, to support references like:
- // bit B = AA[0]{1};
- return 0;
-}
-
-Init *VarListElementInit::
-resolveListElementReference(Record &R, const RecordVal *RV, unsigned Elt) {
- // FIXME: This should be implemented, to support references like:
- // int B = AA[0][1];
- return 0;
-}
-
-RecTy *DefInit::getFieldType(const std::string &FieldName) const {
- if (const RecordVal *RV = Def->getValue(FieldName))
- return RV->getType();
- return 0;
-}
-
-Init *DefInit::getFieldInit(Record &R, const std::string &FieldName) const {
- return Def->getValue(FieldName)->getValue();
-}
-
-
-std::string DefInit::getAsString() const {
- return Def->getName();
-}
-
-Init *FieldInit::resolveBitReference(Record &R, const RecordVal *RV,
- unsigned Bit) {
- if (Init *BitsVal = Rec->getFieldInit(R, FieldName))
- if (BitsInit *BI = dynamic_cast<BitsInit*>(BitsVal)) {
- assert(Bit < BI->getNumBits() && "Bit reference out of range!");
- Init *B = BI->getBit(Bit);
-
- if (dynamic_cast<BitInit*>(B)) // If the bit is set...
- return B; // Replace the VarBitInit with it.
- }
- return 0;
-}
-
-Init *FieldInit::resolveListElementReference(Record &R, const RecordVal *RV,
- unsigned Elt) {
- if (Init *ListVal = Rec->getFieldInit(R, FieldName))
- if (ListInit *LI = dynamic_cast<ListInit*>(ListVal)) {
- if (Elt >= LI->getSize()) return 0;
- Init *E = LI->getElement(Elt);
-
- if (!dynamic_cast<UnsetInit*>(E)) // If the bit is set...
- return E; // Replace the VarListElementInit with it.
- }
- return 0;
-}
-
-Init *FieldInit::resolveReferences(Record &R, const RecordVal *RV) {
- Init *NewRec = RV ? Rec->resolveReferences(R, RV) : Rec;
-
- Init *BitsVal = NewRec->getFieldInit(R, FieldName);
- if (BitsVal) {
- Init *BVR = BitsVal->resolveReferences(R, RV);
- return BVR->isComplete() ? BVR : this;
- }
-
- if (NewRec != Rec) {
- dump();
- NewRec->dump(); cerr << "\n";
- return new FieldInit(NewRec, FieldName);
- }
- return this;
-}
-
-Init *DagInit::resolveReferences(Record &R, const RecordVal *RV) {
- std::vector<Init*> NewArgs;
- for (unsigned i = 0, e = Args.size(); i != e; ++i)
- NewArgs.push_back(Args[i]->resolveReferences(R, RV));
-
- Init *Op = Val->resolveReferences(R, RV);
-
- if (Args != NewArgs || Op != Val)
- return new DagInit(Op, NewArgs, ArgNames);
-
- return this;
-}
-
-
-std::string DagInit::getAsString() const {
- std::string Result = "(" + Val->getAsString();
- if (Args.size()) {
- Result += " " + Args[0]->getAsString();
- if (!ArgNames[0].empty()) Result += ":$" + ArgNames[0];
- for (unsigned i = 1, e = Args.size(); i != e; ++i) {
- Result += ", " + Args[i]->getAsString();
- if (!ArgNames[i].empty()) Result += ":$" + ArgNames[i];
- }
- }
- return Result + ")";
-}
-
-
-//===----------------------------------------------------------------------===//
-// Other implementations
-//===----------------------------------------------------------------------===//
-
-RecordVal::RecordVal(const std::string &N, RecTy *T, unsigned P)
- : Name(N), Ty(T), Prefix(P) {
- Value = Ty->convertValue(new UnsetInit());
- assert(Value && "Cannot create unset value for current type!");
-}
-
-void RecordVal::dump() const { cerr << *this; }
-
-void RecordVal::print(std::ostream &OS, bool PrintSem) const {
- if (getPrefix()) OS << "field ";
- OS << *getType() << " " << getName();
-
- if (getValue())
- OS << " = " << *getValue();
-
- if (PrintSem) OS << ";\n";
-}
-
-void Record::setName(const std::string &Name) {
- if (Records.getDef(getName()) == this) {
- Records.removeDef(getName());
- this->Name = Name;
- Records.addDef(this);
- } else {
- Records.removeClass(getName());
- this->Name = Name;
- Records.addClass(this);
- }
-}
-
-/// resolveReferencesTo - If anything in this record refers to RV, replace the
-/// reference to RV with the RHS of RV. If RV is null, we resolve all possible
-/// references.
-void Record::resolveReferencesTo(const RecordVal *RV) {
- for (unsigned i = 0, e = Values.size(); i != e; ++i) {
- if (Init *V = Values[i].getValue())
- Values[i].setValue(V->resolveReferences(*this, RV));
- }
-}
-
-
-void Record::dump() const { cerr << *this; }
-
-std::ostream &llvm::operator<<(std::ostream &OS, const Record &R) {
- OS << R.getName();
-
- const std::vector<std::string> &TArgs = R.getTemplateArgs();
- if (!TArgs.empty()) {
- OS << "<";
- for (unsigned i = 0, e = TArgs.size(); i != e; ++i) {
- if (i) OS << ", ";
- const RecordVal *RV = R.getValue(TArgs[i]);
- assert(RV && "Template argument record not found??");
- RV->print(OS, false);
- }
- OS << ">";
- }
-
- OS << " {";
- const std::vector<Record*> &SC = R.getSuperClasses();
- if (!SC.empty()) {
- OS << "\t//";
- for (unsigned i = 0, e = SC.size(); i != e; ++i)
- OS << " " << SC[i]->getName();
- }
- OS << "\n";
-
- const std::vector<RecordVal> &Vals = R.getValues();
- for (unsigned i = 0, e = Vals.size(); i != e; ++i)
- if (Vals[i].getPrefix() && !R.isTemplateArg(Vals[i].getName()))
- OS << Vals[i];
- for (unsigned i = 0, e = Vals.size(); i != e; ++i)
- if (!Vals[i].getPrefix() && !R.isTemplateArg(Vals[i].getName()))
- OS << Vals[i];
-
- return OS << "}\n";
-}
-
-/// getValueInit - Return the initializer for a value with the specified name,
-/// or throw an exception if the field does not exist.
-///
-Init *Record::getValueInit(const std::string &FieldName) const {
- const RecordVal *R = getValue(FieldName);
- if (R == 0 || R->getValue() == 0)
- throw "Record `" + getName() + "' does not have a field named `" +
- FieldName + "'!\n";
- return R->getValue();
-}
-
-
-/// getValueAsString - This method looks up the specified field and returns its
-/// value as a string, throwing an exception if the field does not exist or if
-/// the value is not a string.
-///
-std::string Record::getValueAsString(const std::string &FieldName) const {
- const RecordVal *R = getValue(FieldName);
- if (R == 0 || R->getValue() == 0)
- throw "Record `" + getName() + "' does not have a field named `" +
- FieldName + "'!\n";
-
- if (const StringInit *SI = dynamic_cast<const StringInit*>(R->getValue()))
- return SI->getValue();
- throw "Record `" + getName() + "', field `" + FieldName +
- "' does not have a string initializer!";
-}
-
-/// getValueAsBitsInit - This method looks up the specified field and returns
-/// its value as a BitsInit, throwing an exception if the field does not exist
-/// or if the value is not the right type.
-///
-BitsInit *Record::getValueAsBitsInit(const std::string &FieldName) const {
- const RecordVal *R = getValue(FieldName);
- if (R == 0 || R->getValue() == 0)
- throw "Record `" + getName() + "' does not have a field named `" +
- FieldName + "'!\n";
-
- if (BitsInit *BI = dynamic_cast<BitsInit*>(R->getValue()))
- return BI;
- throw "Record `" + getName() + "', field `" + FieldName +
- "' does not have a BitsInit initializer!";
-}
-
-/// getValueAsListInit - This method looks up the specified field and returns
-/// its value as a ListInit, throwing an exception if the field does not exist
-/// or if the value is not the right type.
-///
-ListInit *Record::getValueAsListInit(const std::string &FieldName) const {
- const RecordVal *R = getValue(FieldName);
- if (R == 0 || R->getValue() == 0)
- throw "Record `" + getName() + "' does not have a field named `" +
- FieldName + "'!\n";
-
- if (ListInit *LI = dynamic_cast<ListInit*>(R->getValue()))
- return LI;
- throw "Record `" + getName() + "', field `" + FieldName +
- "' does not have a list initializer!";
-}
-
-/// getValueAsListOfDefs - This method looks up the specified field and returns
-/// its value as a vector of records, throwing an exception if the field does
-/// not exist or if the value is not the right type.
-///
-std::vector<Record*>
-Record::getValueAsListOfDefs(const std::string &FieldName) const {
- ListInit *List = getValueAsListInit(FieldName);
- std::vector<Record*> Defs;
- for (unsigned i = 0; i < List->getSize(); i++) {
- if (DefInit *DI = dynamic_cast<DefInit*>(List->getElement(i))) {
- Defs.push_back(DI->getDef());
- } else {
- throw "Record `" + getName() + "', field `" + FieldName +
- "' list is not entirely DefInit!";
- }
- }
- return Defs;
-}
-
-/// getValueAsInt - This method looks up the specified field and returns its
-/// value as an int, throwing an exception if the field does not exist or if
-/// the value is not the right type.
-///
-int Record::getValueAsInt(const std::string &FieldName) const {
- const RecordVal *R = getValue(FieldName);
- if (R == 0 || R->getValue() == 0)
- throw "Record `" + getName() + "' does not have a field named `" +
- FieldName + "'!\n";
-
- if (IntInit *II = dynamic_cast<IntInit*>(R->getValue()))
- return II->getValue();
- throw "Record `" + getName() + "', field `" + FieldName +
- "' does not have an int initializer!";
-}
-
-/// getValueAsListOfInts - This method looks up the specified field and returns
-/// its value as a vector of integers, throwing an exception if the field does
-/// not exist or if the value is not the right type.
-///
-std::vector<int>
-Record::getValueAsListOfInts(const std::string &FieldName) const {
- ListInit *List = getValueAsListInit(FieldName);
- std::vector<int> Ints;
- for (unsigned i = 0; i < List->getSize(); i++) {
- if (IntInit *II = dynamic_cast<IntInit*>(List->getElement(i))) {
- Ints.push_back(II->getValue());
- } else {
- throw "Record `" + getName() + "', field `" + FieldName +
- "' does not have a list of ints initializer!";
- }
- }
- return Ints;
-}
-
-/// getValueAsDef - This method looks up the specified field and returns its
-/// value as a Record, throwing an exception if the field does not exist or if
-/// the value is not the right type.
-///
-Record *Record::getValueAsDef(const std::string &FieldName) const {
- const RecordVal *R = getValue(FieldName);
- if (R == 0 || R->getValue() == 0)
- throw "Record `" + getName() + "' does not have a field named `" +
- FieldName + "'!\n";
-
- if (DefInit *DI = dynamic_cast<DefInit*>(R->getValue()))
- return DI->getDef();
- throw "Record `" + getName() + "', field `" + FieldName +
- "' does not have a def initializer!";
-}
-
-/// getValueAsBit - This method looks up the specified field and returns its
-/// value as a bit, throwing an exception if the field does not exist or if
-/// the value is not the right type.
-///
-bool Record::getValueAsBit(const std::string &FieldName) const {
- const RecordVal *R = getValue(FieldName);
- if (R == 0 || R->getValue() == 0)
- throw "Record `" + getName() + "' does not have a field named `" +
- FieldName + "'!\n";
-
- if (BitInit *BI = dynamic_cast<BitInit*>(R->getValue()))
- return BI->getValue();
- throw "Record `" + getName() + "', field `" + FieldName +
- "' does not have a bit initializer!";
-}
-
-/// getValueAsDag - This method looks up the specified field and returns its
-/// value as an Dag, throwing an exception if the field does not exist or if
-/// the value is not the right type.
-///
-DagInit *Record::getValueAsDag(const std::string &FieldName) const {
- const RecordVal *R = getValue(FieldName);
- if (R == 0 || R->getValue() == 0)
- throw "Record `" + getName() + "' does not have a field named `" +
- FieldName + "'!\n";
-
- if (DagInit *DI = dynamic_cast<DagInit*>(R->getValue()))
- return DI;
- throw "Record `" + getName() + "', field `" + FieldName +
- "' does not have a dag initializer!";
-}
-
-std::string Record::getValueAsCode(const std::string &FieldName) const {
- const RecordVal *R = getValue(FieldName);
- if (R == 0 || R->getValue() == 0)
- throw "Record `" + getName() + "' does not have a field named `" +
- FieldName + "'!\n";
-
- if (const CodeInit *CI = dynamic_cast<const CodeInit*>(R->getValue()))
- return CI->getValue();
- throw "Record `" + getName() + "', field `" + FieldName +
- "' does not have a code initializer!";
-}
-
-
-void RecordKeeper::dump() const { cerr << *this; }
-
-std::ostream &llvm::operator<<(std::ostream &OS, const RecordKeeper &RK) {
- OS << "------------- Classes -----------------\n";
- const std::map<std::string, Record*> &Classes = RK.getClasses();
- for (std::map<std::string, Record*>::const_iterator I = Classes.begin(),
- E = Classes.end(); I != E; ++I)
- OS << "class " << *I->second;
-
- OS << "------------- Defs -----------------\n";
- const std::map<std::string, Record*> &Defs = RK.getDefs();
- for (std::map<std::string, Record*>::const_iterator I = Defs.begin(),
- E = Defs.end(); I != E; ++I)
- OS << "def " << *I->second;
- return OS;
-}
-
-
-/// getAllDerivedDefinitions - This method returns all concrete definitions
-/// that derive from the specified class name. If a class with the specified
-/// name does not exist, an error is printed and true is returned.
-std::vector<Record*>
-RecordKeeper::getAllDerivedDefinitions(const std::string &ClassName) const {
- Record *Class = Records.getClass(ClassName);
- if (!Class)
- throw "ERROR: Couldn't find the `" + ClassName + "' class!\n";
-
- std::vector<Record*> Defs;
- for (std::map<std::string, Record*>::const_iterator I = getDefs().begin(),
- E = getDefs().end(); I != E; ++I)
- if (I->second->isSubClassOf(Class))
- Defs.push_back(I->second);
-
- return Defs;
-}
-
diff --git a/release_23/utils/TableGen/Record.h b/release_23/utils/TableGen/Record.h
deleted file mode 100644
index 83d358ad2ce7..000000000000
--- a/release_23/utils/TableGen/Record.h
+++ /dev/null
@@ -1,1184 +0,0 @@
-//===- Record.h - Classes to represent Table Records ------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines the main TableGen data structures, including the TableGen
-// types, values, and high-level data structures.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef RECORD_H
-#define RECORD_H
-
-#include <string>
-#include <vector>
-#include <map>
-#include <ostream>
-#include <cassert>
-
-namespace llvm {
-
-// RecTy subclasses.
-class BitRecTy;
-class BitsRecTy;
-class IntRecTy;
-class StringRecTy;
-class ListRecTy;
-class CodeRecTy;
-class DagRecTy;
-class RecordRecTy;
-
-// Init subclasses.
-struct Init;
-class UnsetInit;
-class BitInit;
-class BitsInit;
-class IntInit;
-class StringInit;
-class CodeInit;
-class ListInit;
-class BinOpInit;
-class DefInit;
-class DagInit;
-class TypedInit;
-class VarInit;
-class FieldInit;
-class VarBitInit;
-class VarListElementInit;
-
-// Other classes.
-class Record;
-class RecordVal;
-
-//===----------------------------------------------------------------------===//
-// Type Classes
-//===----------------------------------------------------------------------===//
-
-struct RecTy {
- virtual ~RecTy() {}
-
- virtual std::string getAsString() const = 0;
- void print(std::ostream &OS) const { OS << getAsString(); }
- void dump() const;
-
- /// typeIsConvertibleTo - Return true if all values of 'this' type can be
- /// converted to the specified type.
- virtual bool typeIsConvertibleTo(const RecTy *RHS) const = 0;
-
-public: // These methods should only be called from subclasses of Init
- virtual Init *convertValue( UnsetInit *UI) { return 0; }
- virtual Init *convertValue( BitInit *BI) { return 0; }
- virtual Init *convertValue( BitsInit *BI) { return 0; }
- virtual Init *convertValue( IntInit *II) { return 0; }
- virtual Init *convertValue(StringInit *SI) { return 0; }
- virtual Init *convertValue( ListInit *LI) { return 0; }
- virtual Init *convertValue( BinOpInit *UI) { return 0; }
- virtual Init *convertValue( CodeInit *CI) { return 0; }
- virtual Init *convertValue(VarBitInit *VB) { return 0; }
- virtual Init *convertValue( DefInit *DI) { return 0; }
- virtual Init *convertValue( DagInit *DI) { return 0; }
- virtual Init *convertValue( TypedInit *TI) { return 0; }
- virtual Init *convertValue( VarInit *VI) {
- return convertValue((TypedInit*)VI);
- }
- virtual Init *convertValue( FieldInit *FI) {
- return convertValue((TypedInit*)FI);
- }
-
-public: // These methods should only be called by subclasses of RecTy.
- // baseClassOf - These virtual methods should be overloaded to return true iff
- // all values of type 'RHS' can be converted to the 'this' type.
- virtual bool baseClassOf(const BitRecTy *RHS) const { return false; }
- virtual bool baseClassOf(const BitsRecTy *RHS) const { return false; }
- virtual bool baseClassOf(const IntRecTy *RHS) const { return false; }
- virtual bool baseClassOf(const StringRecTy *RHS) const { return false; }
- virtual bool baseClassOf(const ListRecTy *RHS) const { return false; }
- virtual bool baseClassOf(const CodeRecTy *RHS) const { return false; }
- virtual bool baseClassOf(const DagRecTy *RHS) const { return false; }
- virtual bool baseClassOf(const RecordRecTy *RHS) const { return false; }
-};
-
-inline std::ostream &operator<<(std::ostream &OS, const RecTy &Ty) {
- Ty.print(OS);
- return OS;
-}
-
-
-/// BitRecTy - 'bit' - Represent a single bit
-///
-class BitRecTy : public RecTy {
-public:
- virtual Init *convertValue( UnsetInit *UI) { return (Init*)UI; }
- virtual Init *convertValue( BitInit *BI) { return (Init*)BI; }
- virtual Init *convertValue( BitsInit *BI);
- virtual Init *convertValue( IntInit *II);
- virtual Init *convertValue(StringInit *SI) { return 0; }
- virtual Init *convertValue( ListInit *LI) { return 0; }
- virtual Init *convertValue( CodeInit *CI) { return 0; }
- virtual Init *convertValue(VarBitInit *VB) { return (Init*)VB; }
- virtual Init *convertValue( DefInit *DI) { return 0; }
- virtual Init *convertValue( DagInit *DI) { return 0; }
- virtual Init *convertValue( BinOpInit *UI) { return 0; }
- virtual Init *convertValue( TypedInit *TI);
- virtual Init *convertValue( VarInit *VI) { return RecTy::convertValue(VI);}
- virtual Init *convertValue( FieldInit *FI) { return RecTy::convertValue(FI);}
-
- std::string getAsString() const { return "bit"; }
-
- bool typeIsConvertibleTo(const RecTy *RHS) const {
- return RHS->baseClassOf(this);
- }
- virtual bool baseClassOf(const BitRecTy *RHS) const { return true; }
- virtual bool baseClassOf(const BitsRecTy *RHS) const;
- virtual bool baseClassOf(const IntRecTy *RHS) const { return true; }
- virtual bool baseClassOf(const StringRecTy *RHS) const { return false; }
- virtual bool baseClassOf(const ListRecTy *RHS) const { return false; }
- virtual bool baseClassOf(const CodeRecTy *RHS) const { return false; }
- virtual bool baseClassOf(const DagRecTy *RHS) const { return false; }
- virtual bool baseClassOf(const RecordRecTy *RHS) const { return false; }
-
-};
-
-
-// BitsRecTy - 'bits<n>' - Represent a fixed number of bits
-/// BitsRecTy - 'bits&lt;n&gt;' - Represent a fixed number of bits
-///
-class BitsRecTy : public RecTy {
- unsigned Size;
-public:
- BitsRecTy(unsigned Sz) : Size(Sz) {}
-
- unsigned getNumBits() const { return Size; }
-
- virtual Init *convertValue( UnsetInit *UI);
- virtual Init *convertValue( BitInit *UI);
- virtual Init *convertValue( BitsInit *BI);
- virtual Init *convertValue( IntInit *II);
- virtual Init *convertValue(StringInit *SI) { return 0; }
- virtual Init *convertValue( ListInit *LI) { return 0; }
- virtual Init *convertValue( CodeInit *CI) { return 0; }
- virtual Init *convertValue(VarBitInit *VB) { return 0; }
- virtual Init *convertValue( DefInit *DI) { return 0; }
- virtual Init *convertValue( DagInit *DI) { return 0; }
- virtual Init *convertValue( BinOpInit *UI) { return 0; }
- virtual Init *convertValue( TypedInit *TI);
- virtual Init *convertValue( VarInit *VI) { return RecTy::convertValue(VI);}
- virtual Init *convertValue( FieldInit *FI) { return RecTy::convertValue(FI);}
-
- std::string getAsString() const;
-
- bool typeIsConvertibleTo(const RecTy *RHS) const {
- return RHS->baseClassOf(this);
- }
- virtual bool baseClassOf(const BitRecTy *RHS) const { return Size == 1; }
- virtual bool baseClassOf(const BitsRecTy *RHS) const {
- return RHS->Size == Size;
- }
- virtual bool baseClassOf(const IntRecTy *RHS) const { return true; }
- virtual bool baseClassOf(const StringRecTy *RHS) const { return false; }
- virtual bool baseClassOf(const ListRecTy *RHS) const { return false; }
- virtual bool baseClassOf(const CodeRecTy *RHS) const { return false; }
- virtual bool baseClassOf(const DagRecTy *RHS) const { return false; }
- virtual bool baseClassOf(const RecordRecTy *RHS) const { return false; }
-
-};
-
-
-/// IntRecTy - 'int' - Represent an integer value of no particular size
-///
-class IntRecTy : public RecTy {
-public:
- virtual Init *convertValue( UnsetInit *UI) { return (Init*)UI; }
- virtual Init *convertValue( BitInit *BI);
- virtual Init *convertValue( BitsInit *BI);
- virtual Init *convertValue( IntInit *II) { return (Init*)II; }
- virtual Init *convertValue(StringInit *SI) { return 0; }
- virtual Init *convertValue( ListInit *LI) { return 0; }
- virtual Init *convertValue( CodeInit *CI) { return 0; }
- virtual Init *convertValue(VarBitInit *VB) { return 0; }
- virtual Init *convertValue( DefInit *DI) { return 0; }
- virtual Init *convertValue( DagInit *DI) { return 0; }
- virtual Init *convertValue( BinOpInit *UI) { return 0; }
- virtual Init *convertValue( TypedInit *TI);
- virtual Init *convertValue( VarInit *VI) { return RecTy::convertValue(VI);}
- virtual Init *convertValue( FieldInit *FI) { return RecTy::convertValue(FI);}
-
- std::string getAsString() const { return "int"; }
-
- bool typeIsConvertibleTo(const RecTy *RHS) const {
- return RHS->baseClassOf(this);
- }
-
- virtual bool baseClassOf(const BitRecTy *RHS) const { return true; }
- virtual bool baseClassOf(const BitsRecTy *RHS) const { return true; }
- virtual bool baseClassOf(const IntRecTy *RHS) const { return true; }
- virtual bool baseClassOf(const StringRecTy *RHS) const { return false; }
- virtual bool baseClassOf(const ListRecTy *RHS) const { return false; }
- virtual bool baseClassOf(const CodeRecTy *RHS) const { return false; }
- virtual bool baseClassOf(const DagRecTy *RHS) const { return false; }
- virtual bool baseClassOf(const RecordRecTy *RHS) const { return false; }
-
-};
-
-/// StringRecTy - 'string' - Represent an string value
-///
-class StringRecTy : public RecTy {
-public:
- virtual Init *convertValue( UnsetInit *UI) { return (Init*)UI; }
- virtual Init *convertValue( BitInit *BI) { return 0; }
- virtual Init *convertValue( BitsInit *BI) { return 0; }
- virtual Init *convertValue( IntInit *II) { return 0; }
- virtual Init *convertValue(StringInit *SI) { return (Init*)SI; }
- virtual Init *convertValue( ListInit *LI) { return 0; }
- virtual Init *convertValue( BinOpInit *BO);
- virtual Init *convertValue( CodeInit *CI) { return 0; }
- virtual Init *convertValue(VarBitInit *VB) { return 0; }
- virtual Init *convertValue( DefInit *DI) { return 0; }
- virtual Init *convertValue( DagInit *DI) { return 0; }
- virtual Init *convertValue( TypedInit *TI);
- virtual Init *convertValue( VarInit *VI) { return RecTy::convertValue(VI);}
- virtual Init *convertValue( FieldInit *FI) { return RecTy::convertValue(FI);}
-
- std::string getAsString() const { return "string"; }
-
- bool typeIsConvertibleTo(const RecTy *RHS) const {
- return RHS->baseClassOf(this);
- }
-
- virtual bool baseClassOf(const BitRecTy *RHS) const { return false; }
- virtual bool baseClassOf(const BitsRecTy *RHS) const { return false; }
- virtual bool baseClassOf(const IntRecTy *RHS) const { return false; }
- virtual bool baseClassOf(const StringRecTy *RHS) const { return true; }
- virtual bool baseClassOf(const ListRecTy *RHS) const { return false; }
- virtual bool baseClassOf(const CodeRecTy *RHS) const { return false; }
- virtual bool baseClassOf(const DagRecTy *RHS) const { return false; }
- virtual bool baseClassOf(const RecordRecTy *RHS) const { return false; }
-};
-
-// ListRecTy - 'list<Ty>' - Represent a list of values, all of which must be of
-// the specified type.
-/// ListRecTy - 'list&lt;Ty&gt;' - Represent a list of values, all of which must
-/// be of the specified type.
-///
-class ListRecTy : public RecTy {
- RecTy *Ty;
-public:
- ListRecTy(RecTy *T) : Ty(T) {}
-
- RecTy *getElementType() const { return Ty; }
-
- virtual Init *convertValue( UnsetInit *UI) { return (Init*)UI; }
- virtual Init *convertValue( BitInit *BI) { return 0; }
- virtual Init *convertValue( BitsInit *BI) { return 0; }
- virtual Init *convertValue( IntInit *II) { return 0; }
- virtual Init *convertValue(StringInit *SI) { return 0; }
- virtual Init *convertValue( ListInit *LI);
- virtual Init *convertValue( CodeInit *CI) { return 0; }
- virtual Init *convertValue(VarBitInit *VB) { return 0; }
- virtual Init *convertValue( DefInit *DI) { return 0; }
- virtual Init *convertValue( DagInit *DI) { return 0; }
- virtual Init *convertValue( BinOpInit *UI) { return 0; }
- virtual Init *convertValue( TypedInit *TI);
- virtual Init *convertValue( VarInit *VI) { return RecTy::convertValue(VI);}
- virtual Init *convertValue( FieldInit *FI) { return RecTy::convertValue(FI);}
-
- std::string getAsString() const;
-
- bool typeIsConvertibleTo(const RecTy *RHS) const {
- return RHS->baseClassOf(this);
- }
-
- virtual bool baseClassOf(const BitRecTy *RHS) const { return false; }
- virtual bool baseClassOf(const BitsRecTy *RHS) const { return false; }
- virtual bool baseClassOf(const IntRecTy *RHS) const { return false; }
- virtual bool baseClassOf(const StringRecTy *RHS) const { return false; }
- virtual bool baseClassOf(const ListRecTy *RHS) const {
- return RHS->getElementType()->typeIsConvertibleTo(Ty);
- }
- virtual bool baseClassOf(const CodeRecTy *RHS) const { return false; }
- virtual bool baseClassOf(const DagRecTy *RHS) const { return false; }
- virtual bool baseClassOf(const RecordRecTy *RHS) const { return false; }
-};
-
-/// CodeRecTy - 'code' - Represent an code fragment, function or method.
-///
-class CodeRecTy : public RecTy {
-public:
- virtual Init *convertValue( UnsetInit *UI) { return (Init*)UI; }
- virtual Init *convertValue( BitInit *BI) { return 0; }
- virtual Init *convertValue( BitsInit *BI) { return 0; }
- virtual Init *convertValue( IntInit *II) { return 0; }
- virtual Init *convertValue(StringInit *SI) { return 0; }
- virtual Init *convertValue( ListInit *LI) { return 0; }
- virtual Init *convertValue( CodeInit *CI) { return (Init*)CI; }
- virtual Init *convertValue(VarBitInit *VB) { return 0; }
- virtual Init *convertValue( DefInit *DI) { return 0; }
- virtual Init *convertValue( DagInit *DI) { return 0; }
- virtual Init *convertValue( BinOpInit *UI) { return 0; }
- virtual Init *convertValue( TypedInit *TI);
- virtual Init *convertValue( VarInit *VI) { return RecTy::convertValue(VI);}
- virtual Init *convertValue( FieldInit *FI) { return RecTy::convertValue(FI);}
-
- std::string getAsString() const { return "code"; }
-
- bool typeIsConvertibleTo(const RecTy *RHS) const {
- return RHS->baseClassOf(this);
- }
- virtual bool baseClassOf(const BitRecTy *RHS) const { return false; }
- virtual bool baseClassOf(const BitsRecTy *RHS) const { return false; }
- virtual bool baseClassOf(const IntRecTy *RHS) const { return false; }
- virtual bool baseClassOf(const StringRecTy *RHS) const { return false; }
- virtual bool baseClassOf(const ListRecTy *RHS) const { return false; }
- virtual bool baseClassOf(const CodeRecTy *RHS) const { return true; }
- virtual bool baseClassOf(const DagRecTy *RHS) const { return false; }
- virtual bool baseClassOf(const RecordRecTy *RHS) const { return false; }
-};
-
-/// DagRecTy - 'dag' - Represent a dag fragment
-///
-class DagRecTy : public RecTy {
-public:
- virtual Init *convertValue( UnsetInit *UI) { return (Init*)UI; }
- virtual Init *convertValue( BitInit *BI) { return 0; }
- virtual Init *convertValue( BitsInit *BI) { return 0; }
- virtual Init *convertValue( IntInit *II) { return 0; }
- virtual Init *convertValue(StringInit *SI) { return 0; }
- virtual Init *convertValue( ListInit *LI) { return 0; }
- virtual Init *convertValue( CodeInit *CI) { return 0; }
- virtual Init *convertValue(VarBitInit *VB) { return 0; }
- virtual Init *convertValue( DefInit *DI) { return 0; }
- virtual Init *convertValue( BinOpInit *BO);
- virtual Init *convertValue( DagInit *CI) { return (Init*)CI; }
- virtual Init *convertValue( TypedInit *TI);
- virtual Init *convertValue( VarInit *VI) { return RecTy::convertValue(VI);}
- virtual Init *convertValue( FieldInit *FI) { return RecTy::convertValue(FI);}
-
- std::string getAsString() const { return "dag"; }
-
- bool typeIsConvertibleTo(const RecTy *RHS) const {
- return RHS->baseClassOf(this);
- }
-
- virtual bool baseClassOf(const BitRecTy *RHS) const { return false; }
- virtual bool baseClassOf(const BitsRecTy *RHS) const { return false; }
- virtual bool baseClassOf(const IntRecTy *RHS) const { return false; }
- virtual bool baseClassOf(const StringRecTy *RHS) const { return false; }
- virtual bool baseClassOf(const ListRecTy *RHS) const { return false; }
- virtual bool baseClassOf(const CodeRecTy *RHS) const { return false; }
- virtual bool baseClassOf(const DagRecTy *RHS) const { return true; }
- virtual bool baseClassOf(const RecordRecTy *RHS) const { return false; }
-};
-
-
-/// RecordRecTy - '[classname]' - Represent an instance of a class, such as:
-/// (R32 X = EAX).
-///
-class RecordRecTy : public RecTy {
- Record *Rec;
-public:
- RecordRecTy(Record *R) : Rec(R) {}
-
- Record *getRecord() const { return Rec; }
-
- virtual Init *convertValue( UnsetInit *UI) { return (Init*)UI; }
- virtual Init *convertValue( BitInit *BI) { return 0; }
- virtual Init *convertValue( BitsInit *BI) { return 0; }
- virtual Init *convertValue( IntInit *II) { return 0; }
- virtual Init *convertValue(StringInit *SI) { return 0; }
- virtual Init *convertValue( ListInit *LI) { return 0; }
- virtual Init *convertValue( CodeInit *CI) { return 0; }
- virtual Init *convertValue(VarBitInit *VB) { return 0; }
- virtual Init *convertValue( BinOpInit *UI) { return 0; }
- virtual Init *convertValue( DefInit *DI);
- virtual Init *convertValue( DagInit *DI) { return 0; }
- virtual Init *convertValue( TypedInit *VI);
- virtual Init *convertValue( VarInit *VI) { return RecTy::convertValue(VI);}
- virtual Init *convertValue( FieldInit *FI) { return RecTy::convertValue(FI);}
-
- std::string getAsString() const;
-
- bool typeIsConvertibleTo(const RecTy *RHS) const {
- return RHS->baseClassOf(this);
- }
- virtual bool baseClassOf(const BitRecTy *RHS) const { return false; }
- virtual bool baseClassOf(const BitsRecTy *RHS) const { return false; }
- virtual bool baseClassOf(const IntRecTy *RHS) const { return false; }
- virtual bool baseClassOf(const StringRecTy *RHS) const { return false; }
- virtual bool baseClassOf(const ListRecTy *RHS) const { return false; }
- virtual bool baseClassOf(const CodeRecTy *RHS) const { return false; }
- virtual bool baseClassOf(const DagRecTy *RHS) const { return false; }
- virtual bool baseClassOf(const RecordRecTy *RHS) const;
-};
-
-
-
-//===----------------------------------------------------------------------===//
-// Initializer Classes
-//===----------------------------------------------------------------------===//
-
-struct Init {
- virtual ~Init() {}
-
- /// isComplete - This virtual method should be overridden by values that may
- /// not be completely specified yet.
- virtual bool isComplete() const { return true; }
-
- /// print - Print out this value.
- void print(std::ostream &OS) const { OS << getAsString(); }
-
- /// getAsString - Convert this value to a string form.
- virtual std::string getAsString() const = 0;
-
- /// dump - Debugging method that may be called through a debugger, just
- /// invokes print on cerr.
- void dump() const;
-
- /// convertInitializerTo - This virtual function is a simple call-back
- /// function that should be overridden to call the appropriate
- /// RecTy::convertValue method.
- ///
- virtual Init *convertInitializerTo(RecTy *Ty) = 0;
-
- /// convertInitializerBitRange - This method is used to implement the bitrange
- /// selection operator. Given an initializer, it selects the specified bits
- /// out, returning them as a new init of bits type. If it is not legal to use
- /// the bit subscript operator on this initializer, return null.
- ///
- virtual Init *convertInitializerBitRange(const std::vector<unsigned> &Bits) {
- return 0;
- }
-
- /// convertInitListSlice - This method is used to implement the list slice
- /// selection operator. Given an initializer, it selects the specified list
- /// elements, returning them as a new init of list type. If it is not legal
- /// to take a slice of this, return null.
- ///
- virtual Init *convertInitListSlice(const std::vector<unsigned> &Elements) {
- return 0;
- }
-
- /// getFieldType - This method is used to implement the FieldInit class.
- /// Implementors of this method should return the type of the named field if
- /// they are of record type.
- ///
- virtual RecTy *getFieldType(const std::string &FieldName) const { return 0; }
-
- /// getFieldInit - This method complements getFieldType to return the
- /// initializer for the specified field. If getFieldType returns non-null
- /// this method should return non-null, otherwise it returns null.
- ///
- virtual Init *getFieldInit(Record &R, const std::string &FieldName) const {
- return 0;
- }
-
- /// resolveReferences - This method is used by classes that refer to other
- /// variables which may not be defined at the time they expression is formed.
- /// If a value is set for the variable later, this method will be called on
- /// users of the value to allow the value to propagate out.
- ///
- virtual Init *resolveReferences(Record &R, const RecordVal *RV) {
- return this;
- }
-};
-
-inline std::ostream &operator<<(std::ostream &OS, const Init &I) {
- I.print(OS); return OS;
-}
-
-
-/// UnsetInit - ? - Represents an uninitialized value
-///
-class UnsetInit : public Init {
-public:
- virtual Init *convertInitializerTo(RecTy *Ty) {
- return Ty->convertValue(this);
- }
-
- virtual bool isComplete() const { return false; }
- virtual std::string getAsString() const { return "?"; }
-};
-
-
-/// BitInit - true/false - Represent a concrete initializer for a bit.
-///
-class BitInit : public Init {
- bool Value;
-public:
- explicit BitInit(bool V) : Value(V) {}
-
- bool getValue() const { return Value; }
-
- virtual Init *convertInitializerTo(RecTy *Ty) {
- return Ty->convertValue(this);
- }
-
- virtual std::string getAsString() const { return Value ? "1" : "0"; }
-};
-
-/// BitsInit - { a, b, c } - Represents an initializer for a BitsRecTy value.
-/// It contains a vector of bits, whose size is determined by the type.
-///
-class BitsInit : public Init {
- std::vector<Init*> Bits;
-public:
- explicit BitsInit(unsigned Size) : Bits(Size) {}
-
- unsigned getNumBits() const { return Bits.size(); }
-
- Init *getBit(unsigned Bit) const {
- assert(Bit < Bits.size() && "Bit index out of range!");
- return Bits[Bit];
- }
- void setBit(unsigned Bit, Init *V) {
- assert(Bit < Bits.size() && "Bit index out of range!");
- assert(Bits[Bit] == 0 && "Bit already set!");
- Bits[Bit] = V;
- }
-
- virtual Init *convertInitializerTo(RecTy *Ty) {
- return Ty->convertValue(this);
- }
- virtual Init *convertInitializerBitRange(const std::vector<unsigned> &Bits);
-
- virtual bool isComplete() const {
- for (unsigned i = 0; i != getNumBits(); ++i)
- if (!getBit(i)->isComplete()) return false;
- return true;
- }
- virtual std::string getAsString() const;
-
- virtual Init *resolveReferences(Record &R, const RecordVal *RV);
-
- // printXX - Print this bitstream with the specified format, returning true if
- // it is not possible.
- bool printInHex(std::ostream &OS) const;
- bool printAsVariable(std::ostream &OS) const;
- bool printAsUnset(std::ostream &OS) const;
-};
-
-
-/// IntInit - 7 - Represent an initalization by a literal integer value.
-///
-class IntInit : public Init {
- int Value;
-public:
- explicit IntInit(int V) : Value(V) {}
-
- int getValue() const { return Value; }
-
- virtual Init *convertInitializerTo(RecTy *Ty) {
- return Ty->convertValue(this);
- }
- virtual Init *convertInitializerBitRange(const std::vector<unsigned> &Bits);
-
- virtual std::string getAsString() const;
-};
-
-
-/// StringInit - "foo" - Represent an initialization by a string value.
-///
-class StringInit : public Init {
- std::string Value;
-public:
- explicit StringInit(const std::string &V) : Value(V) {}
-
- const std::string &getValue() const { return Value; }
-
- virtual Init *convertInitializerTo(RecTy *Ty) {
- return Ty->convertValue(this);
- }
-
- virtual std::string getAsString() const { return "\"" + Value + "\""; }
-};
-
-/// CodeInit - "[{...}]" - Represent a code fragment.
-///
-class CodeInit : public Init {
- std::string Value;
-public:
- explicit CodeInit(const std::string &V) : Value(V) {}
-
- const std::string getValue() const { return Value; }
-
- virtual Init *convertInitializerTo(RecTy *Ty) {
- return Ty->convertValue(this);
- }
-
- virtual std::string getAsString() const { return "[{" + Value + "}]"; }
-};
-
-/// ListInit - [AL, AH, CL] - Represent a list of defs
-///
-class ListInit : public Init {
- std::vector<Init*> Values;
-public:
- explicit ListInit(std::vector<Init*> &Vs) {
- Values.swap(Vs);
- }
-
- unsigned getSize() const { return Values.size(); }
- Init *getElement(unsigned i) const {
- assert(i < Values.size() && "List element index out of range!");
- return Values[i];
- }
-
- Record *getElementAsRecord(unsigned i) const;
-
- Init *convertInitListSlice(const std::vector<unsigned> &Elements);
-
- virtual Init *convertInitializerTo(RecTy *Ty) {
- return Ty->convertValue(this);
- }
-
- /// resolveReferences - This method is used by classes that refer to other
- /// variables which may not be defined at the time they expression is formed.
- /// If a value is set for the variable later, this method will be called on
- /// users of the value to allow the value to propagate out.
- ///
- virtual Init *resolveReferences(Record &R, const RecordVal *RV);
-
- virtual std::string getAsString() const;
-
- typedef std::vector<Init*>::iterator iterator;
- typedef std::vector<Init*>::const_iterator const_iterator;
-
- inline iterator begin() { return Values.begin(); }
- inline const_iterator begin() const { return Values.begin(); }
- inline iterator end () { return Values.end(); }
- inline const_iterator end () const { return Values.end(); }
-
- inline size_t size () const { return Values.size(); }
- inline bool empty() const { return Values.empty(); }
-};
-
-/// BinOpInit - !op (X, Y) - Combine two inits.
-///
-class BinOpInit : public Init {
-public:
- enum BinaryOp { SHL, SRA, SRL, STRCONCAT, CONCAT };
-private:
- BinaryOp Opc;
- Init *LHS, *RHS;
-public:
- BinOpInit(BinaryOp opc, Init *lhs, Init *rhs) : Opc(opc), LHS(lhs), RHS(rhs) {
- }
-
- BinaryOp getOpcode() const { return Opc; }
- Init *getLHS() const { return LHS; }
- Init *getRHS() const { return RHS; }
-
- // Fold - If possible, fold this to a simpler init. Return this if not
- // possible to fold.
- Init *Fold();
-
- virtual Init *convertInitializerTo(RecTy *Ty) {
- return Ty->convertValue(this);
- }
-
- virtual Init *resolveReferences(Record &R, const RecordVal *RV);
-
- virtual std::string getAsString() const;
-};
-
-
-
-/// TypedInit - This is the common super-class of types that have a specific,
-/// explicit, type.
-///
-class TypedInit : public Init {
- RecTy *Ty;
-public:
- explicit TypedInit(RecTy *T) : Ty(T) {}
-
- RecTy *getType() const { return Ty; }
-
- virtual Init *convertInitializerBitRange(const std::vector<unsigned> &Bits);
- virtual Init *convertInitListSlice(const std::vector<unsigned> &Elements);
-
- /// resolveBitReference - This method is used to implement
- /// VarBitInit::resolveReferences. If the bit is able to be resolved, we
- /// simply return the resolved value, otherwise we return null.
- ///
- virtual Init *resolveBitReference(Record &R, const RecordVal *RV,
- unsigned Bit) = 0;
-
- /// resolveListElementReference - This method is used to implement
- /// VarListElementInit::resolveReferences. If the list element is resolvable
- /// now, we return the resolved value, otherwise we return null.
- virtual Init *resolveListElementReference(Record &R, const RecordVal *RV,
- unsigned Elt) = 0;
-};
-
-/// VarInit - 'Opcode' - Represent a reference to an entire variable object.
-///
-class VarInit : public TypedInit {
- std::string VarName;
-public:
- explicit VarInit(const std::string &VN, RecTy *T)
- : TypedInit(T), VarName(VN) {}
-
- virtual Init *convertInitializerTo(RecTy *Ty) {
- return Ty->convertValue(this);
- }
-
- const std::string &getName() const { return VarName; }
-
- virtual Init *resolveBitReference(Record &R, const RecordVal *RV,
- unsigned Bit);
- virtual Init *resolveListElementReference(Record &R, const RecordVal *RV,
- unsigned Elt);
-
- virtual RecTy *getFieldType(const std::string &FieldName) const;
- virtual Init *getFieldInit(Record &R, const std::string &FieldName) const;
-
- /// resolveReferences - This method is used by classes that refer to other
- /// variables which may not be defined at the time they expression is formed.
- /// If a value is set for the variable later, this method will be called on
- /// users of the value to allow the value to propagate out.
- ///
- virtual Init *resolveReferences(Record &R, const RecordVal *RV);
-
- virtual std::string getAsString() const { return VarName; }
-};
-
-
-/// VarBitInit - Opcode{0} - Represent access to one bit of a variable or field.
-///
-class VarBitInit : public Init {
- TypedInit *TI;
- unsigned Bit;
-public:
- VarBitInit(TypedInit *T, unsigned B) : TI(T), Bit(B) {
- assert(T->getType() && dynamic_cast<BitsRecTy*>(T->getType()) &&
- ((BitsRecTy*)T->getType())->getNumBits() > B &&
- "Illegal VarBitInit expression!");
- }
-
- virtual Init *convertInitializerTo(RecTy *Ty) {
- return Ty->convertValue(this);
- }
-
- TypedInit *getVariable() const { return TI; }
- unsigned getBitNum() const { return Bit; }
-
- virtual std::string getAsString() const;
- virtual Init *resolveReferences(Record &R, const RecordVal *RV);
-};
-
-/// VarListElementInit - List[4] - Represent access to one element of a var or
-/// field.
-class VarListElementInit : public TypedInit {
- TypedInit *TI;
- unsigned Element;
-public:
- VarListElementInit(TypedInit *T, unsigned E)
- : TypedInit(dynamic_cast<ListRecTy*>(T->getType())->getElementType()),
- TI(T), Element(E) {
- assert(T->getType() && dynamic_cast<ListRecTy*>(T->getType()) &&
- "Illegal VarBitInit expression!");
- }
-
- virtual Init *convertInitializerTo(RecTy *Ty) {
- return Ty->convertValue(this);
- }
-
- TypedInit *getVariable() const { return TI; }
- unsigned getElementNum() const { return Element; }
-
- virtual Init *resolveBitReference(Record &R, const RecordVal *RV,
- unsigned Bit);
-
- /// resolveListElementReference - This method is used to implement
- /// VarListElementInit::resolveReferences. If the list element is resolvable
- /// now, we return the resolved value, otherwise we return null.
- virtual Init *resolveListElementReference(Record &R, const RecordVal *RV,
- unsigned Elt);
-
- virtual std::string getAsString() const;
- virtual Init *resolveReferences(Record &R, const RecordVal *RV);
-};
-
-/// DefInit - AL - Represent a reference to a 'def' in the description
-///
-class DefInit : public Init {
- Record *Def;
-public:
- explicit DefInit(Record *D) : Def(D) {}
-
- virtual Init *convertInitializerTo(RecTy *Ty) {
- return Ty->convertValue(this);
- }
-
- Record *getDef() const { return Def; }
-
- //virtual Init *convertInitializerBitRange(const std::vector<unsigned> &Bits);
-
- virtual RecTy *getFieldType(const std::string &FieldName) const;
- virtual Init *getFieldInit(Record &R, const std::string &FieldName) const;
-
- virtual std::string getAsString() const;
-};
-
-
-/// FieldInit - X.Y - Represent a reference to a subfield of a variable
-///
-class FieldInit : public TypedInit {
- Init *Rec; // Record we are referring to
- std::string FieldName; // Field we are accessing
-public:
- FieldInit(Init *R, const std::string &FN)
- : TypedInit(R->getFieldType(FN)), Rec(R), FieldName(FN) {
- assert(getType() && "FieldInit with non-record type!");
- }
-
- virtual Init *convertInitializerTo(RecTy *Ty) {
- return Ty->convertValue(this);
- }
-
- virtual Init *resolveBitReference(Record &R, const RecordVal *RV,
- unsigned Bit);
- virtual Init *resolveListElementReference(Record &R, const RecordVal *RV,
- unsigned Elt);
-
- virtual Init *resolveReferences(Record &R, const RecordVal *RV);
-
- virtual std::string getAsString() const {
- return Rec->getAsString() + "." + FieldName;
- }
-};
-
-/// DagInit - (v a, b) - Represent a DAG tree value. DAG inits are required
-/// to have at least one value then a (possibly empty) list of arguments. Each
-/// argument can have a name associated with it.
-///
-class DagInit : public Init {
- Init *Val;
- std::vector<Init*> Args;
- std::vector<std::string> ArgNames;
-public:
- DagInit(Init *V, const std::vector<std::pair<Init*, std::string> > &args)
- : Val(V) {
- Args.reserve(args.size());
- ArgNames.reserve(args.size());
- for (unsigned i = 0, e = args.size(); i != e; ++i) {
- Args.push_back(args[i].first);
- ArgNames.push_back(args[i].second);
- }
- }
- DagInit(Init *V, const std::vector<Init*> &args,
- const std::vector<std::string> &argNames)
- : Val(V), Args(args), ArgNames(argNames) {
- }
-
- virtual Init *convertInitializerTo(RecTy *Ty) {
- return Ty->convertValue(this);
- }
-
- Init *getOperator() const { return Val; }
-
- unsigned getNumArgs() const { return Args.size(); }
- Init *getArg(unsigned Num) const {
- assert(Num < Args.size() && "Arg number out of range!");
- return Args[Num];
- }
- const std::string &getArgName(unsigned Num) const {
- assert(Num < ArgNames.size() && "Arg number out of range!");
- return ArgNames[Num];
- }
-
- void setArg(unsigned Num, Init *I) {
- assert(Num < Args.size() && "Arg number out of range!");
- Args[Num] = I;
- }
-
- virtual Init *resolveReferences(Record &R, const RecordVal *RV);
-
- virtual std::string getAsString() const;
-
- typedef std::vector<Init*>::iterator arg_iterator;
- typedef std::vector<Init*>::const_iterator const_arg_iterator;
- typedef std::vector<std::string>::iterator name_iterator;
- typedef std::vector<std::string>::const_iterator const_name_iterator;
-
- inline arg_iterator arg_begin() { return Args.begin(); }
- inline const_arg_iterator arg_begin() const { return Args.begin(); }
- inline arg_iterator arg_end () { return Args.end(); }
- inline const_arg_iterator arg_end () const { return Args.end(); }
-
- inline size_t arg_size () const { return Args.size(); }
- inline bool arg_empty() const { return Args.empty(); }
-
- inline name_iterator name_begin() { return ArgNames.begin(); }
- inline const_name_iterator name_begin() const { return ArgNames.begin(); }
- inline name_iterator name_end () { return ArgNames.end(); }
- inline const_name_iterator name_end () const { return ArgNames.end(); }
-
- inline size_t name_size () const { return ArgNames.size(); }
- inline bool name_empty() const { return ArgNames.empty(); }
-
-};
-
-//===----------------------------------------------------------------------===//
-// High-Level Classes
-//===----------------------------------------------------------------------===//
-
-class RecordVal {
- std::string Name;
- RecTy *Ty;
- unsigned Prefix;
- Init *Value;
-public:
- RecordVal(const std::string &N, RecTy *T, unsigned P);
-
- const std::string &getName() const { return Name; }
-
- unsigned getPrefix() const { return Prefix; }
- RecTy *getType() const { return Ty; }
- Init *getValue() const { return Value; }
-
- bool setValue(Init *V) {
- if (V) {
- Value = V->convertInitializerTo(Ty);
- return Value == 0;
- }
- Value = 0;
- return false;
- }
-
- void dump() const;
- void print(std::ostream &OS, bool PrintSem = true) const;
-};
-
-inline std::ostream &operator<<(std::ostream &OS, const RecordVal &RV) {
- RV.print(OS << " ");
- return OS;
-}
-
-class Record {
- std::string Name;
- std::vector<std::string> TemplateArgs;
- std::vector<RecordVal> Values;
- std::vector<Record*> SuperClasses;
-public:
-
- Record(const std::string &N) : Name(N) {}
- ~Record() {}
-
- const std::string &getName() const { return Name; }
- void setName(const std::string &Name); // Also updates RecordKeeper.
- const std::vector<std::string> &getTemplateArgs() const {
- return TemplateArgs;
- }
- const std::vector<RecordVal> &getValues() const { return Values; }
- const std::vector<Record*> &getSuperClasses() const { return SuperClasses; }
-
- bool isTemplateArg(const std::string &Name) const {
- for (unsigned i = 0, e = TemplateArgs.size(); i != e; ++i)
- if (TemplateArgs[i] == Name) return true;
- return false;
- }
-
- const RecordVal *getValue(const std::string &Name) const {
- for (unsigned i = 0, e = Values.size(); i != e; ++i)
- if (Values[i].getName() == Name) return &Values[i];
- return 0;
- }
- RecordVal *getValue(const std::string &Name) {
- for (unsigned i = 0, e = Values.size(); i != e; ++i)
- if (Values[i].getName() == Name) return &Values[i];
- return 0;
- }
-
- void addTemplateArg(const std::string &Name) {
- assert(!isTemplateArg(Name) && "Template arg already defined!");
- TemplateArgs.push_back(Name);
- }
-
- void addValue(const RecordVal &RV) {
- assert(getValue(RV.getName()) == 0 && "Value already added!");
- Values.push_back(RV);
- }
-
- void removeValue(const std::string &Name) {
- assert(getValue(Name) && "Cannot remove an entry that does not exist!");
- for (unsigned i = 0, e = Values.size(); i != e; ++i)
- if (Values[i].getName() == Name) {
- Values.erase(Values.begin()+i);
- return;
- }
- assert(0 && "Name does not exist in record!");
- }
-
- bool isSubClassOf(Record *R) const {
- for (unsigned i = 0, e = SuperClasses.size(); i != e; ++i)
- if (SuperClasses[i] == R)
- return true;
- return false;
- }
-
- bool isSubClassOf(const std::string &Name) const {
- for (unsigned i = 0, e = SuperClasses.size(); i != e; ++i)
- if (SuperClasses[i]->getName() == Name)
- return true;
- return false;
- }
-
- void addSuperClass(Record *R) {
- assert(!isSubClassOf(R) && "Already subclassing record!");
- SuperClasses.push_back(R);
- }
-
- /// resolveReferences - If there are any field references that refer to fields
- /// that have been filled in, we can propagate the values now.
- ///
- void resolveReferences() { resolveReferencesTo(0); }
-
- /// resolveReferencesTo - If anything in this record refers to RV, replace the
- /// reference to RV with the RHS of RV. If RV is null, we resolve all
- /// possible references.
- void resolveReferencesTo(const RecordVal *RV);
-
- void dump() const;
-
- //===--------------------------------------------------------------------===//
- // High-level methods useful to tablegen back-ends
- //
-
- /// getValueInit - Return the initializer for a value with the specified name,
- /// or throw an exception if the field does not exist.
- ///
- Init *getValueInit(const std::string &FieldName) const;
-
- /// getValueAsString - This method looks up the specified field and returns
- /// its value as a string, throwing an exception if the field does not exist
- /// or if the value is not a string.
- ///
- std::string getValueAsString(const std::string &FieldName) const;
-
- /// getValueAsBitsInit - This method looks up the specified field and returns
- /// its value as a BitsInit, throwing an exception if the field does not exist
- /// or if the value is not the right type.
- ///
- BitsInit *getValueAsBitsInit(const std::string &FieldName) const;
-
- /// getValueAsListInit - This method looks up the specified field and returns
- /// its value as a ListInit, throwing an exception if the field does not exist
- /// or if the value is not the right type.
- ///
- ListInit *getValueAsListInit(const std::string &FieldName) const;
-
- /// getValueAsListOfDefs - This method looks up the specified field and
- /// returns its value as a vector of records, throwing an exception if the
- /// field does not exist or if the value is not the right type.
- ///
- std::vector<Record*> getValueAsListOfDefs(const std::string &FieldName) const;
-
- /// getValueAsListOfInts - This method looks up the specified field and returns
- /// its value as a vector of integers, throwing an exception if the field does
- /// not exist or if the value is not the right type.
- ///
- std::vector<int> getValueAsListOfInts(const std::string &FieldName) const;
-
- /// getValueAsDef - This method looks up the specified field and returns its
- /// value as a Record, throwing an exception if the field does not exist or if
- /// the value is not the right type.
- ///
- Record *getValueAsDef(const std::string &FieldName) const;
-
- /// getValueAsBit - This method looks up the specified field and returns its
- /// value as a bit, throwing an exception if the field does not exist or if
- /// the value is not the right type.
- ///
- bool getValueAsBit(const std::string &FieldName) const;
-
- /// getValueAsInt - This method looks up the specified field and returns its
- /// value as an int, throwing an exception if the field does not exist or if
- /// the value is not the right type.
- ///
- int getValueAsInt(const std::string &FieldName) const;
-
- /// getValueAsDag - This method looks up the specified field and returns its
- /// value as an Dag, throwing an exception if the field does not exist or if
- /// the value is not the right type.
- ///
- DagInit *getValueAsDag(const std::string &FieldName) const;
-
- /// getValueAsCode - This method looks up the specified field and returns
- /// its value as the string data in a CodeInit, throwing an exception if the
- /// field does not exist or if the value is not a code object.
- ///
- std::string getValueAsCode(const std::string &FieldName) const;
-};
-
-std::ostream &operator<<(std::ostream &OS, const Record &R);
-
-class RecordKeeper {
- std::map<std::string, Record*> Classes, Defs;
-public:
- ~RecordKeeper() {
- for (std::map<std::string, Record*>::iterator I = Classes.begin(),
- E = Classes.end(); I != E; ++I)
- delete I->second;
- for (std::map<std::string, Record*>::iterator I = Defs.begin(),
- E = Defs.end(); I != E; ++I)
- delete I->second;
- }
-
- const std::map<std::string, Record*> &getClasses() const { return Classes; }
- const std::map<std::string, Record*> &getDefs() const { return Defs; }
-
- Record *getClass(const std::string &Name) const {
- std::map<std::string, Record*>::const_iterator I = Classes.find(Name);
- return I == Classes.end() ? 0 : I->second;
- }
- Record *getDef(const std::string &Name) const {
- std::map<std::string, Record*>::const_iterator I = Defs.find(Name);
- return I == Defs.end() ? 0 : I->second;
- }
- void addClass(Record *R) {
- assert(getClass(R->getName()) == 0 && "Class already exists!");
- Classes.insert(std::make_pair(R->getName(), R));
- }
- void addDef(Record *R) {
- assert(getDef(R->getName()) == 0 && "Def already exists!");
- Defs.insert(std::make_pair(R->getName(), R));
- }
-
- /// removeClass - Remove, but do not delete, the specified record.
- ///
- void removeClass(const std::string &Name) {
- assert(Classes.count(Name) && "Class does not exist!");
- Classes.erase(Name);
- }
- /// removeDef - Remove, but do not delete, the specified record.
- ///
- void removeDef(const std::string &Name) {
- assert(Defs.count(Name) && "Def does not exist!");
- Defs.erase(Name);
- }
-
- //===--------------------------------------------------------------------===//
- // High-level helper methods, useful for tablegen backends...
-
- /// getAllDerivedDefinitions - This method returns all concrete definitions
- /// that derive from the specified class name. If a class with the specified
- /// name does not exist, an exception is thrown.
- std::vector<Record*>
- getAllDerivedDefinitions(const std::string &ClassName) const;
-
-
- void dump() const;
-};
-
-std::ostream &operator<<(std::ostream &OS, const RecordKeeper &RK);
-
-extern RecordKeeper Records;
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/utils/TableGen/RegisterInfoEmitter.cpp b/release_23/utils/TableGen/RegisterInfoEmitter.cpp
deleted file mode 100644
index b9253cfd3e84..000000000000
--- a/release_23/utils/TableGen/RegisterInfoEmitter.cpp
+++ /dev/null
@@ -1,683 +0,0 @@
-//===- RegisterInfoEmitter.cpp - Generate a Register File Desc. -*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This tablegen backend is responsible for emitting a description of a target
-// register file for a code generator. It uses instances of the Register,
-// RegisterAliases, and RegisterClass classes to gather this information.
-//
-//===----------------------------------------------------------------------===//
-
-#include "RegisterInfoEmitter.h"
-#include "CodeGenTarget.h"
-#include "CodeGenRegisters.h"
-#include "Record.h"
-#include "llvm/ADT/StringExtras.h"
-#include "llvm/ADT/STLExtras.h"
-#include "llvm/Support/Streams.h"
-#include <set>
-#include <algorithm>
-using namespace llvm;
-
-// runEnums - Print out enum values for all of the registers.
-void RegisterInfoEmitter::runEnums(std::ostream &OS) {
- CodeGenTarget Target;
- const std::vector<CodeGenRegister> &Registers = Target.getRegisters();
-
- std::string Namespace = Registers[0].TheDef->getValueAsString("Namespace");
-
- EmitSourceFileHeader("Target Register Enum Values", OS);
- OS << "namespace llvm {\n\n";
-
- if (!Namespace.empty())
- OS << "namespace " << Namespace << " {\n";
- OS << " enum {\n NoRegister,\n";
-
- for (unsigned i = 0, e = Registers.size(); i != e; ++i)
- OS << " " << Registers[i].getName() << ", \t// " << i+1 << "\n";
- OS << " NUM_TARGET_REGS \t// " << Registers.size()+1 << "\n";
- OS << " };\n";
- if (!Namespace.empty())
- OS << "}\n";
- OS << "} // End llvm namespace \n";
-}
-
-void RegisterInfoEmitter::runHeader(std::ostream &OS) {
- EmitSourceFileHeader("Register Information Header Fragment", OS);
- CodeGenTarget Target;
- const std::string &TargetName = Target.getName();
- std::string ClassName = TargetName + "GenRegisterInfo";
-
- OS << "#include \"llvm/Target/TargetRegisterInfo.h\"\n";
- OS << "#include <string>\n\n";
-
- OS << "namespace llvm {\n\n";
-
- OS << "struct " << ClassName << " : public TargetRegisterInfo {\n"
- << " explicit " << ClassName
- << "(int CallFrameSetupOpcode = -1, int CallFrameDestroyOpcode = -1);\n"
- << " virtual int getDwarfRegNumFull(unsigned RegNum, "
- << "unsigned Flavour) const;\n"
- << " virtual int getDwarfRegNum(unsigned RegNum, bool isEH) const = 0;\n"
- << " unsigned getSubReg(unsigned RegNo, unsigned Index) const;\n"
- << "};\n\n";
-
- const std::vector<CodeGenRegisterClass> &RegisterClasses =
- Target.getRegisterClasses();
-
- if (!RegisterClasses.empty()) {
- OS << "namespace " << RegisterClasses[0].Namespace
- << " { // Register classes\n";
-
- OS << " enum {\n";
- for (unsigned i = 0, e = RegisterClasses.size(); i != e; ++i) {
- if (i) OS << ",\n";
- OS << " " << RegisterClasses[i].getName() << "RegClassID";
- OS << " = " << (i+1);
- }
- OS << "\n };\n\n";
-
- for (unsigned i = 0, e = RegisterClasses.size(); i != e; ++i) {
- const std::string &Name = RegisterClasses[i].getName();
-
- // Output the register class definition.
- OS << " struct " << Name << "Class : public TargetRegisterClass {\n"
- << " " << Name << "Class();\n"
- << RegisterClasses[i].MethodProtos << " };\n";
-
- // Output the extern for the instance.
- OS << " extern " << Name << "Class\t" << Name << "RegClass;\n";
- // Output the extern for the pointer to the instance (should remove).
- OS << " static TargetRegisterClass * const "<< Name <<"RegisterClass = &"
- << Name << "RegClass;\n";
- }
- OS << "} // end of namespace " << TargetName << "\n\n";
- }
- OS << "} // End llvm namespace \n";
-}
-
-bool isSubRegisterClass(const CodeGenRegisterClass &RC,
- std::set<Record*> &RegSet) {
- for (unsigned i = 0, e = RC.Elements.size(); i != e; ++i) {
- Record *Reg = RC.Elements[i];
- if (!RegSet.count(Reg))
- return false;
- }
- return true;
-}
-
-static void addSuperReg(Record *R, Record *S,
- std::map<Record*, std::set<Record*> > &SubRegs,
- std::map<Record*, std::set<Record*> > &SuperRegs,
- std::map<Record*, std::set<Record*> > &Aliases) {
- if (R == S) {
- cerr << "Error: recursive sub-register relationship between"
- << " register " << getQualifiedName(R)
- << " and its sub-registers?\n";
- abort();
- }
- if (!SuperRegs[R].insert(S).second)
- return;
- SubRegs[S].insert(R);
- Aliases[R].insert(S);
- Aliases[S].insert(R);
- if (SuperRegs.count(S))
- for (std::set<Record*>::iterator I = SuperRegs[S].begin(),
- E = SuperRegs[S].end(); I != E; ++I)
- addSuperReg(R, *I, SubRegs, SuperRegs, Aliases);
-}
-
-static void addSubSuperReg(Record *R, Record *S,
- std::map<Record*, std::set<Record*> > &SubRegs,
- std::map<Record*, std::set<Record*> > &SuperRegs,
- std::map<Record*, std::set<Record*> > &Aliases) {
- if (R == S) {
- cerr << "Error: recursive sub-register relationship between"
- << " register " << getQualifiedName(R)
- << " and its sub-registers?\n";
- abort();
- }
-
- if (!SubRegs[R].insert(S).second)
- return;
- addSuperReg(S, R, SubRegs, SuperRegs, Aliases);
- Aliases[R].insert(S);
- Aliases[S].insert(R);
- if (SubRegs.count(S))
- for (std::set<Record*>::iterator I = SubRegs[S].begin(),
- E = SubRegs[S].end(); I != E; ++I)
- addSubSuperReg(R, *I, SubRegs, SuperRegs, Aliases);
-}
-
-class RegisterSorter {
-private:
- std::map<Record*, std::set<Record*> > &RegisterSubRegs;
-
-public:
- RegisterSorter(std::map<Record*, std::set<Record*> > &RS)
- : RegisterSubRegs(RS) {};
-
- bool operator()(Record *RegA, Record *RegB) {
- // B is sub-register of A.
- return RegisterSubRegs.count(RegA) && RegisterSubRegs[RegA].count(RegB);
- }
-};
-
-// RegisterInfoEmitter::run - Main register file description emitter.
-//
-void RegisterInfoEmitter::run(std::ostream &OS) {
- CodeGenTarget Target;
- EmitSourceFileHeader("Register Information Source Fragment", OS);
-
- OS << "namespace llvm {\n\n";
-
- // Start out by emitting each of the register classes... to do this, we build
- // a set of registers which belong to a register class, this is to ensure that
- // each register is only in a single register class.
- //
- const std::vector<CodeGenRegisterClass> &RegisterClasses =
- Target.getRegisterClasses();
-
- // Loop over all of the register classes... emitting each one.
- OS << "namespace { // Register classes...\n";
-
- // RegClassesBelongedTo - Keep track of which register classes each reg
- // belongs to.
- std::multimap<Record*, const CodeGenRegisterClass*> RegClassesBelongedTo;
-
- // Emit the register enum value arrays for each RegisterClass
- for (unsigned rc = 0, e = RegisterClasses.size(); rc != e; ++rc) {
- const CodeGenRegisterClass &RC = RegisterClasses[rc];
-
- // Give the register class a legal C name if it's anonymous.
- std::string Name = RC.TheDef->getName();
-
- // Emit the register list now.
- OS << " // " << Name << " Register Class...\n"
- << " static const unsigned " << Name
- << "[] = {\n ";
- for (unsigned i = 0, e = RC.Elements.size(); i != e; ++i) {
- Record *Reg = RC.Elements[i];
- OS << getQualifiedName(Reg) << ", ";
-
- // Keep track of which regclasses this register is in.
- RegClassesBelongedTo.insert(std::make_pair(Reg, &RC));
- }
- OS << "\n };\n\n";
- }
-
- // Emit the ValueType arrays for each RegisterClass
- for (unsigned rc = 0, e = RegisterClasses.size(); rc != e; ++rc) {
- const CodeGenRegisterClass &RC = RegisterClasses[rc];
-
- // Give the register class a legal C name if it's anonymous.
- std::string Name = RC.TheDef->getName() + "VTs";
-
- // Emit the register list now.
- OS << " // " << Name
- << " Register Class Value Types...\n"
- << " static const MVT::ValueType " << Name
- << "[] = {\n ";
- for (unsigned i = 0, e = RC.VTs.size(); i != e; ++i)
- OS << getEnumName(RC.VTs[i]) << ", ";
- OS << "MVT::Other\n };\n\n";
- }
- OS << "} // end anonymous namespace\n\n";
-
- // Now that all of the structs have been emitted, emit the instances.
- if (!RegisterClasses.empty()) {
- OS << "namespace " << RegisterClasses[0].Namespace
- << " { // Register class instances\n";
- for (unsigned i = 0, e = RegisterClasses.size(); i != e; ++i)
- OS << " " << RegisterClasses[i].getName() << "Class\t"
- << RegisterClasses[i].getName() << "RegClass;\n";
-
- std::map<unsigned, std::set<unsigned> > SuperClassMap;
- std::map<unsigned, std::set<unsigned> > SuperRegClassMap;
- OS << "\n";
-
- // Emit the sub-register classes for each RegisterClass
- for (unsigned rc = 0, e = RegisterClasses.size(); rc != e; ++rc) {
- const CodeGenRegisterClass &RC = RegisterClasses[rc];
-
- // Give the register class a legal C name if it's anonymous.
- std::string Name = RC.TheDef->getName();
-
- OS << " // " << Name
- << " Sub-register Classess...\n"
- << " static const TargetRegisterClass* const "
- << Name << "SubRegClasses [] = {\n ";
-
- bool Empty = true;
-
- for (unsigned subrc = 0, subrcMax = RC.SubRegClasses.size();
- subrc != subrcMax; ++subrc) {
- unsigned rc2 = 0, e2 = RegisterClasses.size();
- for (; rc2 != e2; ++rc2) {
- const CodeGenRegisterClass &RC2 = RegisterClasses[rc2];
- if (RC.SubRegClasses[subrc]->getName() == RC2.getName()) {
- if (!Empty)
- OS << ", ";
- OS << "&" << getQualifiedName(RC2.TheDef) << "RegClass";
- Empty = false;
-
- std::map<unsigned, std::set<unsigned> >::iterator SCMI =
- SuperRegClassMap.find(rc2);
- if (SCMI == SuperRegClassMap.end()) {
- SuperRegClassMap.insert(std::make_pair(rc2, std::set<unsigned>()));
- SCMI = SuperRegClassMap.find(rc2);
- }
- SCMI->second.insert(rc);
- break;
- }
- }
- if (rc2 == e2)
- throw "Register Class member '" +
- RC.SubRegClasses[subrc]->getName() +
- "' is not a valid RegisterClass!";
- }
-
- OS << (!Empty ? ", " : "") << "NULL";
- OS << "\n };\n\n";
- }
-
- // Emit the super-register classes for each RegisterClass
- for (unsigned rc = 0, e = RegisterClasses.size(); rc != e; ++rc) {
- const CodeGenRegisterClass &RC = RegisterClasses[rc];
-
- // Give the register class a legal C name if it's anonymous.
- std::string Name = RC.TheDef->getName();
-
- OS << " // " << Name
- << " Super-register Classess...\n"
- << " static const TargetRegisterClass* const "
- << Name << "SuperRegClasses [] = {\n ";
-
- bool Empty = true;
- std::map<unsigned, std::set<unsigned> >::iterator I =
- SuperRegClassMap.find(rc);
- if (I != SuperRegClassMap.end()) {
- for (std::set<unsigned>::iterator II = I->second.begin(),
- EE = I->second.end(); II != EE; ++II) {
- const CodeGenRegisterClass &RC2 = RegisterClasses[*II];
- if (!Empty)
- OS << ", ";
- OS << "&" << getQualifiedName(RC2.TheDef) << "RegClass";
- Empty = false;
- }
- }
-
- OS << (!Empty ? ", " : "") << "NULL";
- OS << "\n };\n\n";
- }
-
- // Emit the sub-classes array for each RegisterClass
- for (unsigned rc = 0, e = RegisterClasses.size(); rc != e; ++rc) {
- const CodeGenRegisterClass &RC = RegisterClasses[rc];
-
- // Give the register class a legal C name if it's anonymous.
- std::string Name = RC.TheDef->getName();
-
- std::set<Record*> RegSet;
- for (unsigned i = 0, e = RC.Elements.size(); i != e; ++i) {
- Record *Reg = RC.Elements[i];
- RegSet.insert(Reg);
- }
-
- OS << " // " << Name
- << " Register Class sub-classes...\n"
- << " static const TargetRegisterClass* const "
- << Name << "Subclasses [] = {\n ";
-
- bool Empty = true;
- for (unsigned rc2 = 0, e2 = RegisterClasses.size(); rc2 != e2; ++rc2) {
- const CodeGenRegisterClass &RC2 = RegisterClasses[rc2];
- if (rc == rc2 || RC2.Elements.size() > RC.Elements.size() ||
- RC.SpillSize != RC2.SpillSize || !isSubRegisterClass(RC2, RegSet))
- continue;
-
- if (!Empty) OS << ", ";
- OS << "&" << getQualifiedName(RC2.TheDef) << "RegClass";
- Empty = false;
-
- std::map<unsigned, std::set<unsigned> >::iterator SCMI =
- SuperClassMap.find(rc2);
- if (SCMI == SuperClassMap.end()) {
- SuperClassMap.insert(std::make_pair(rc2, std::set<unsigned>()));
- SCMI = SuperClassMap.find(rc2);
- }
- SCMI->second.insert(rc);
- }
-
- OS << (!Empty ? ", " : "") << "NULL";
- OS << "\n };\n\n";
- }
-
- for (unsigned rc = 0, e = RegisterClasses.size(); rc != e; ++rc) {
- const CodeGenRegisterClass &RC = RegisterClasses[rc];
-
- // Give the register class a legal C name if it's anonymous.
- std::string Name = RC.TheDef->getName();
-
- OS << " // " << Name
- << " Register Class super-classes...\n"
- << " static const TargetRegisterClass* const "
- << Name << "Superclasses [] = {\n ";
-
- bool Empty = true;
- std::map<unsigned, std::set<unsigned> >::iterator I =
- SuperClassMap.find(rc);
- if (I != SuperClassMap.end()) {
- for (std::set<unsigned>::iterator II = I->second.begin(),
- EE = I->second.end(); II != EE; ++II) {
- const CodeGenRegisterClass &RC2 = RegisterClasses[*II];
- if (!Empty) OS << ", ";
- OS << "&" << getQualifiedName(RC2.TheDef) << "RegClass";
- Empty = false;
- }
- }
-
- OS << (!Empty ? ", " : "") << "NULL";
- OS << "\n };\n\n";
- }
-
-
- for (unsigned i = 0, e = RegisterClasses.size(); i != e; ++i) {
- const CodeGenRegisterClass &RC = RegisterClasses[i];
- OS << RC.MethodBodies << "\n";
- OS << RC.getName() << "Class::" << RC.getName()
- << "Class() : TargetRegisterClass("
- << RC.getName() + "RegClassID" << ", "
- << RC.getName() + "VTs" << ", "
- << RC.getName() + "Subclasses" << ", "
- << RC.getName() + "Superclasses" << ", "
- << RC.getName() + "SubRegClasses" << ", "
- << RC.getName() + "SuperRegClasses" << ", "
- << RC.SpillSize/8 << ", "
- << RC.SpillAlignment/8 << ", "
- << RC.CopyCost << ", "
- << RC.getName() << ", " << RC.getName() << " + " << RC.Elements.size()
- << ") {}\n";
- }
-
- OS << "}\n";
- }
-
- OS << "\nnamespace {\n";
- OS << " const TargetRegisterClass* const RegisterClasses[] = {\n";
- for (unsigned i = 0, e = RegisterClasses.size(); i != e; ++i)
- OS << " &" << getQualifiedName(RegisterClasses[i].TheDef)
- << "RegClass,\n";
- OS << " };\n";
-
- // Emit register sub-registers / super-registers, aliases...
- std::map<Record*, std::set<Record*> > RegisterImmSubRegs;
- std::map<Record*, std::set<Record*> > RegisterSubRegs;
- std::map<Record*, std::set<Record*> > RegisterSuperRegs;
- std::map<Record*, std::set<Record*> > RegisterAliases;
- std::map<Record*, std::vector<std::pair<int, Record*> > > SubRegVectors;
- std::map<Record*, std::vector<int> > DwarfRegNums;
-
- const std::vector<CodeGenRegister> &Regs = Target.getRegisters();
-
- for (unsigned i = 0, e = Regs.size(); i != e; ++i) {
- Record *R = Regs[i].TheDef;
- std::vector<Record*> LI = Regs[i].TheDef->getValueAsListOfDefs("Aliases");
- // Add information that R aliases all of the elements in the list... and
- // that everything in the list aliases R.
- for (unsigned j = 0, e = LI.size(); j != e; ++j) {
- Record *Reg = LI[j];
- if (RegisterAliases[R].count(Reg))
- cerr << "Warning: register alias between " << getQualifiedName(R)
- << " and " << getQualifiedName(Reg)
- << " specified multiple times!\n";
- RegisterAliases[R].insert(Reg);
-
- if (RegisterAliases[Reg].count(R))
- cerr << "Warning: register alias between " << getQualifiedName(R)
- << " and " << getQualifiedName(Reg)
- << " specified multiple times!\n";
- RegisterAliases[Reg].insert(R);
- }
- }
-
- // Process sub-register sets.
- for (unsigned i = 0, e = Regs.size(); i != e; ++i) {
- Record *R = Regs[i].TheDef;
- std::vector<Record*> LI = Regs[i].TheDef->getValueAsListOfDefs("SubRegs");
- // Process sub-register set and add aliases information.
- for (unsigned j = 0, e = LI.size(); j != e; ++j) {
- Record *SubReg = LI[j];
- if (RegisterSubRegs[R].count(SubReg))
- cerr << "Warning: register " << getQualifiedName(SubReg)
- << " specified as a sub-register of " << getQualifiedName(R)
- << " multiple times!\n";
- RegisterImmSubRegs[R].insert(SubReg);
- addSubSuperReg(R, SubReg, RegisterSubRegs, RegisterSuperRegs,
- RegisterAliases);
- }
- }
-
- if (!RegisterAliases.empty())
- OS << "\n\n // Register Alias Sets...\n";
-
- // Emit the empty alias list
- OS << " const unsigned Empty_AliasSet[] = { 0 };\n";
- // Loop over all of the registers which have aliases, emitting the alias list
- // to memory.
- for (std::map<Record*, std::set<Record*> >::iterator
- I = RegisterAliases.begin(), E = RegisterAliases.end(); I != E; ++I) {
- OS << " const unsigned " << I->first->getName() << "_AliasSet[] = { ";
- for (std::set<Record*>::iterator ASI = I->second.begin(),
- E = I->second.end(); ASI != E; ++ASI)
- OS << getQualifiedName(*ASI) << ", ";
- OS << "0 };\n";
- }
-
- if (!RegisterSubRegs.empty())
- OS << "\n\n // Register Sub-registers Sets...\n";
-
- // Emit the empty sub-registers list
- OS << " const unsigned Empty_SubRegsSet[] = { 0 };\n";
- // Loop over all of the registers which have sub-registers, emitting the
- // sub-registers list to memory.
- for (std::map<Record*, std::set<Record*> >::iterator
- I = RegisterSubRegs.begin(), E = RegisterSubRegs.end(); I != E; ++I) {
- OS << " const unsigned " << I->first->getName() << "_SubRegsSet[] = { ";
- std::vector<Record*> SubRegsVector;
- for (std::set<Record*>::iterator ASI = I->second.begin(),
- E = I->second.end(); ASI != E; ++ASI)
- SubRegsVector.push_back(*ASI);
- RegisterSorter RS(RegisterSubRegs);
- std::stable_sort(SubRegsVector.begin(), SubRegsVector.end(), RS);
- for (unsigned i = 0, e = SubRegsVector.size(); i != e; ++i)
- OS << getQualifiedName(SubRegsVector[i]) << ", ";
- OS << "0 };\n";
- }
-
- if (!RegisterImmSubRegs.empty())
- OS << "\n\n // Register Immediate Sub-registers Sets...\n";
-
- // Loop over all of the registers which have sub-registers, emitting the
- // sub-registers list to memory.
- for (std::map<Record*, std::set<Record*> >::iterator
- I = RegisterImmSubRegs.begin(), E = RegisterImmSubRegs.end();
- I != E; ++I) {
- OS << " const unsigned " << I->first->getName() << "_ImmSubRegsSet[] = { ";
- for (std::set<Record*>::iterator ASI = I->second.begin(),
- E = I->second.end(); ASI != E; ++ASI)
- OS << getQualifiedName(*ASI) << ", ";
- OS << "0 };\n";
- }
-
- if (!RegisterSuperRegs.empty())
- OS << "\n\n // Register Super-registers Sets...\n";
-
- // Emit the empty super-registers list
- OS << " const unsigned Empty_SuperRegsSet[] = { 0 };\n";
- // Loop over all of the registers which have super-registers, emitting the
- // super-registers list to memory.
- for (std::map<Record*, std::set<Record*> >::iterator
- I = RegisterSuperRegs.begin(), E = RegisterSuperRegs.end(); I != E; ++I) {
- OS << " const unsigned " << I->first->getName() << "_SuperRegsSet[] = { ";
-
- std::vector<Record*> SuperRegsVector;
- for (std::set<Record*>::iterator ASI = I->second.begin(),
- E = I->second.end(); ASI != E; ++ASI)
- SuperRegsVector.push_back(*ASI);
- RegisterSorter RS(RegisterSubRegs);
- std::stable_sort(SuperRegsVector.begin(), SuperRegsVector.end(), RS);
- for (unsigned i = 0, e = SuperRegsVector.size(); i != e; ++i)
- OS << getQualifiedName(SuperRegsVector[i]) << ", ";
- OS << "0 };\n";
- }
-
- OS<<"\n const TargetRegisterDesc RegisterDescriptors[] = { // Descriptors\n";
- OS << " { \"NOREG\",\t\"NOREG\",\t0,\t0,\t0,\t0 },\n";
-
- // Now that register alias and sub-registers sets have been emitted, emit the
- // register descriptors now.
- const std::vector<CodeGenRegister> &Registers = Target.getRegisters();
- for (unsigned i = 0, e = Registers.size(); i != e; ++i) {
- const CodeGenRegister &Reg = Registers[i];
- OS << " { \"";
- if (!Reg.TheDef->getValueAsString("AsmName").empty())
- OS << Reg.TheDef->getValueAsString("AsmName");
- else
- OS << Reg.getName();
- OS << "\",\t\"";
- if (!Reg.TheDef->getValueAsString("Name").empty()) {
- OS << Reg.TheDef->getValueAsString("Name");
- } else {
- // Default to "name".
- if (!Reg.TheDef->getValueAsString("AsmName").empty())
- OS << Reg.TheDef->getValueAsString("AsmName");
- else
- OS << Reg.getName();
- }
- OS << "\",\t";
- if (RegisterAliases.count(Reg.TheDef))
- OS << Reg.getName() << "_AliasSet,\t";
- else
- OS << "Empty_AliasSet,\t";
- if (RegisterSubRegs.count(Reg.TheDef))
- OS << Reg.getName() << "_SubRegsSet,\t";
- else
- OS << "Empty_SubRegsSet,\t";
- if (RegisterImmSubRegs.count(Reg.TheDef))
- OS << Reg.getName() << "_ImmSubRegsSet,\t";
- else
- OS << "Empty_SubRegsSet,\t";
- if (RegisterSuperRegs.count(Reg.TheDef))
- OS << Reg.getName() << "_SuperRegsSet },\n";
- else
- OS << "Empty_SuperRegsSet },\n";
- }
- OS << " };\n"; // End of register descriptors...
- OS << "}\n\n"; // End of anonymous namespace...
-
- std::string ClassName = Target.getName() + "GenRegisterInfo";
-
- // Calculate the mapping of subregister+index pairs to physical registers.
- std::vector<Record*> SubRegs = Records.getAllDerivedDefinitions("SubRegSet");
- for (unsigned i = 0, e = SubRegs.size(); i != e; ++i) {
- int subRegIndex = SubRegs[i]->getValueAsInt("index");
- std::vector<Record*> From = SubRegs[i]->getValueAsListOfDefs("From");
- std::vector<Record*> To = SubRegs[i]->getValueAsListOfDefs("To");
-
- if (From.size() != To.size()) {
- cerr << "Error: register list and sub-register list not of equal length"
- << " in SubRegSet\n";
- exit(1);
- }
-
- // For each entry in from/to vectors, insert the to register at index
- for (unsigned ii = 0, ee = From.size(); ii != ee; ++ii)
- SubRegVectors[From[ii]].push_back(std::make_pair(subRegIndex, To[ii]));
- }
-
- // Emit the subregister + index mapping function based on the information
- // calculated above.
- OS << "unsigned " << ClassName
- << "::getSubReg(unsigned RegNo, unsigned Index) const {\n"
- << " switch (RegNo) {\n"
- << " default: abort(); break;\n";
- for (std::map<Record*, std::vector<std::pair<int, Record*> > >::iterator
- I = SubRegVectors.begin(), E = SubRegVectors.end(); I != E; ++I) {
- OS << " case " << getQualifiedName(I->first) << ":\n";
- OS << " switch (Index) {\n";
- OS << " default: abort(); break;\n";
- for (unsigned i = 0, e = I->second.size(); i != e; ++i)
- OS << " case " << (I->second)[i].first << ": return "
- << getQualifiedName((I->second)[i].second) << ";\n";
- OS << " }; break;\n";
- }
- OS << " };\n";
- OS << " return 0;\n";
- OS << "}\n\n";
-
- // Emit the constructor of the class...
- OS << ClassName << "::" << ClassName
- << "(int CallFrameSetupOpcode, int CallFrameDestroyOpcode)\n"
- << " : TargetRegisterInfo(RegisterDescriptors, " << Registers.size()+1
- << ", RegisterClasses, RegisterClasses+" << RegisterClasses.size() <<",\n "
- << " CallFrameSetupOpcode, CallFrameDestroyOpcode) {}\n\n";
-
- // Collect all information about dwarf register numbers
-
- // First, just pull all provided information to the map
- unsigned maxLength = 0;
- for (unsigned i = 0, e = Registers.size(); i != e; ++i) {
- Record *Reg = Registers[i].TheDef;
- std::vector<int> RegNums = Reg->getValueAsListOfInts("DwarfNumbers");
- maxLength = std::max((size_t)maxLength, RegNums.size());
- if (DwarfRegNums.count(Reg))
- cerr << "Warning: DWARF numbers for register " << getQualifiedName(Reg)
- << "specified multiple times\n";
- DwarfRegNums[Reg] = RegNums;
- }
-
- // Now we know maximal length of number list. Append -1's, where needed
- for (std::map<Record*, std::vector<int> >::iterator
- I = DwarfRegNums.begin(), E = DwarfRegNums.end(); I != E; ++I)
- for (unsigned i = I->second.size(), e = maxLength; i != e; ++i)
- I->second.push_back(-1);
-
- // Emit information about the dwarf register numbers.
- OS << "int " << ClassName << "::getDwarfRegNumFull(unsigned RegNum, "
- << "unsigned Flavour) const {\n"
- << " switch (Flavour) {\n"
- << " default:\n"
- << " assert(0 && \"Unknown DWARF flavour\");\n"
- << " return -1;\n";
-
- for (unsigned i = 0, e = maxLength; i != e; ++i) {
- OS << " case " << i << ":\n"
- << " switch (RegNum) {\n"
- << " default:\n"
- << " assert(0 && \"Invalid RegNum\");\n"
- << " return -1;\n";
-
- for (std::map<Record*, std::vector<int> >::iterator
- I = DwarfRegNums.begin(), E = DwarfRegNums.end(); I != E; ++I) {
- int RegNo = I->second[i];
- if (RegNo != -2)
- OS << " case " << getQualifiedName(I->first) << ":\n"
- << " return " << RegNo << ";\n";
- else
- OS << " case " << getQualifiedName(I->first) << ":\n"
- << " assert(0 && \"Invalid register for this mode\");\n"
- << " return -1;\n";
- }
- OS << " };\n";
- }
-
- OS << " };\n}\n\n";
-
- OS << "} // End llvm namespace \n";
-}
diff --git a/release_23/utils/TableGen/RegisterInfoEmitter.h b/release_23/utils/TableGen/RegisterInfoEmitter.h
deleted file mode 100644
index b5493a9f4574..000000000000
--- a/release_23/utils/TableGen/RegisterInfoEmitter.h
+++ /dev/null
@@ -1,40 +0,0 @@
-//===- RegisterInfoEmitter.h - Generate a Register File Desc. ---*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This tablegen backend is responsible for emitting a description of a target
-// register file for a code generator. It uses instances of the Register,
-// RegisterAliases, and RegisterClass classes to gather this information.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef REGISTER_INFO_EMITTER_H
-#define REGISTER_INFO_EMITTER_H
-
-#include "TableGenBackend.h"
-
-namespace llvm {
-
-class RegisterInfoEmitter : public TableGenBackend {
- RecordKeeper &Records;
-public:
- RegisterInfoEmitter(RecordKeeper &R) : Records(R) {}
-
- // run - Output the register file description, returning true on failure.
- void run(std::ostream &o);
-
- // runHeader - Emit a header fragment for the register info emitter.
- void runHeader(std::ostream &o);
-
- // runEnums - Print out enum values for all of the registers.
- void runEnums(std::ostream &o);
-};
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/utils/TableGen/SubtargetEmitter.cpp b/release_23/utils/TableGen/SubtargetEmitter.cpp
deleted file mode 100644
index 1f833efcaac8..000000000000
--- a/release_23/utils/TableGen/SubtargetEmitter.cpp
+++ /dev/null
@@ -1,530 +0,0 @@
-//===- SubtargetEmitter.cpp - Generate subtarget enumerations -------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This tablegen backend emits subtarget enumerations.
-//
-//===----------------------------------------------------------------------===//
-
-#include "SubtargetEmitter.h"
-#include "CodeGenTarget.h"
-#include "Record.h"
-#include "llvm/ADT/StringExtras.h"
-#include "llvm/Support/Debug.h"
-#include <algorithm>
-using namespace llvm;
-
-//
-// Record sort by name function.
-//
-struct LessRecord {
- bool operator()(const Record *Rec1, const Record *Rec2) const {
- return Rec1->getName() < Rec2->getName();
- }
-};
-
-//
-// Record sort by field "Name" function.
-//
-struct LessRecordFieldName {
- bool operator()(const Record *Rec1, const Record *Rec2) const {
- return Rec1->getValueAsString("Name") < Rec2->getValueAsString("Name");
- }
-};
-
-//
-// Enumeration - Emit the specified class as an enumeration.
-//
-void SubtargetEmitter::Enumeration(std::ostream &OS,
- const char *ClassName,
- bool isBits) {
- // Get all records of class and sort
- std::vector<Record*> DefList = Records.getAllDerivedDefinitions(ClassName);
- std::sort(DefList.begin(), DefList.end(), LessRecord());
-
- // Open enumeration
- OS << "enum {\n";
-
- // For each record
- for (unsigned i = 0, N = DefList.size(); i < N;) {
- // Next record
- Record *Def = DefList[i];
-
- // Get and emit name
- OS << " " << Def->getName();
-
- // If bit flags then emit expression (1 << i)
- if (isBits) OS << " = " << " 1 << " << i;
-
- // Depending on 'if more in the list' emit comma
- if (++i < N) OS << ",";
-
- OS << "\n";
- }
-
- // Close enumeration
- OS << "};\n";
-}
-
-//
-// FeatureKeyValues - Emit data of all the subtarget features. Used by the
-// command line.
-//
-void SubtargetEmitter::FeatureKeyValues(std::ostream &OS) {
- // Gather and sort all the features
- std::vector<Record*> FeatureList =
- Records.getAllDerivedDefinitions("SubtargetFeature");
- std::sort(FeatureList.begin(), FeatureList.end(), LessRecord());
-
- // Begin feature table
- OS << "// Sorted (by key) array of values for CPU features.\n"
- << "static const llvm::SubtargetFeatureKV FeatureKV[] = {\n";
-
- // For each feature
- for (unsigned i = 0, N = FeatureList.size(); i < N; ++i) {
- // Next feature
- Record *Feature = FeatureList[i];
-
- const std::string &Name = Feature->getName();
- const std::string &CommandLineName = Feature->getValueAsString("Name");
- const std::string &Desc = Feature->getValueAsString("Desc");
-
- if (CommandLineName.empty()) continue;
-
- // Emit as { "feature", "decription", feactureEnum, i1 | i2 | ... | in }
- OS << " { "
- << "\"" << CommandLineName << "\", "
- << "\"" << Desc << "\", "
- << Name << ", ";
-
- const std::vector<Record*> &ImpliesList =
- Feature->getValueAsListOfDefs("Implies");
-
- if (ImpliesList.empty()) {
- OS << "0";
- } else {
- for (unsigned j = 0, M = ImpliesList.size(); j < M;) {
- OS << ImpliesList[j]->getName();
- if (++j < M) OS << " | ";
- }
- }
-
- OS << " }";
-
- // Depending on 'if more in the list' emit comma
- if ((i + 1) < N) OS << ",";
-
- OS << "\n";
- }
-
- // End feature table
- OS << "};\n";
-
- // Emit size of table
- OS<<"\nenum {\n";
- OS<<" FeatureKVSize = sizeof(FeatureKV)/sizeof(llvm::SubtargetFeatureKV)\n";
- OS<<"};\n";
-}
-
-//
-// CPUKeyValues - Emit data of all the subtarget processors. Used by command
-// line.
-//
-void SubtargetEmitter::CPUKeyValues(std::ostream &OS) {
- // Gather and sort processor information
- std::vector<Record*> ProcessorList =
- Records.getAllDerivedDefinitions("Processor");
- std::sort(ProcessorList.begin(), ProcessorList.end(), LessRecordFieldName());
-
- // Begin processor table
- OS << "// Sorted (by key) array of values for CPU subtype.\n"
- << "static const llvm::SubtargetFeatureKV SubTypeKV[] = {\n";
-
- // For each processor
- for (unsigned i = 0, N = ProcessorList.size(); i < N;) {
- // Next processor
- Record *Processor = ProcessorList[i];
-
- const std::string &Name = Processor->getValueAsString("Name");
- const std::vector<Record*> &FeatureList =
- Processor->getValueAsListOfDefs("Features");
-
- // Emit as { "cpu", "description", f1 | f2 | ... fn },
- OS << " { "
- << "\"" << Name << "\", "
- << "\"Select the " << Name << " processor\", ";
-
- if (FeatureList.empty()) {
- OS << "0";
- } else {
- for (unsigned j = 0, M = FeatureList.size(); j < M;) {
- OS << FeatureList[j]->getName();
- if (++j < M) OS << " | ";
- }
- }
-
- // The "0" is for the "implies" section of this data structure.
- OS << ", 0 }";
-
- // Depending on 'if more in the list' emit comma
- if (++i < N) OS << ",";
-
- OS << "\n";
- }
-
- // End processor table
- OS << "};\n";
-
- // Emit size of table
- OS<<"\nenum {\n";
- OS<<" SubTypeKVSize = sizeof(SubTypeKV)/sizeof(llvm::SubtargetFeatureKV)\n";
- OS<<"};\n";
-}
-
-//
-// CollectAllItinClasses - Gathers and enumerates all the itinerary classes.
-// Returns itinerary class count.
-//
-unsigned SubtargetEmitter::CollectAllItinClasses(std::ostream &OS,
- std::map<std::string, unsigned> &ItinClassesMap) {
- // Gather and sort all itinerary classes
- std::vector<Record*> ItinClassList =
- Records.getAllDerivedDefinitions("InstrItinClass");
- std::sort(ItinClassList.begin(), ItinClassList.end(), LessRecord());
-
- // For each itinerary class
- unsigned N = ItinClassList.size();
- for (unsigned i = 0; i < N; i++) {
- // Next itinerary class
- const Record *ItinClass = ItinClassList[i];
- // Get name of itinerary class
- // Assign itinerary class a unique number
- ItinClassesMap[ItinClass->getName()] = i;
- }
-
- // Emit size of table
- OS<<"\nenum {\n";
- OS<<" ItinClassesSize = " << N << "\n";
- OS<<"};\n";
-
- // Return itinerary class count
- return N;
-}
-
-//
-// FormItineraryString - Compose a string containing the data initialization
-// for the specified itinerary. N is the number of stages.
-//
-void SubtargetEmitter::FormItineraryString(Record *ItinData,
- std::string &ItinString,
- unsigned &NStages) {
- // Get states list
- const std::vector<Record*> &StageList =
- ItinData->getValueAsListOfDefs("Stages");
-
- // For each stage
- unsigned N = NStages = StageList.size();
- for (unsigned i = 0; i < N;) {
- // Next stage
- const Record *Stage = StageList[i];
-
- // Form string as ,{ cycles, u1 | u2 | ... | un }
- int Cycles = Stage->getValueAsInt("Cycles");
- ItinString += " { " + itostr(Cycles) + ", ";
-
- // Get unit list
- const std::vector<Record*> &UnitList = Stage->getValueAsListOfDefs("Units");
-
- // For each unit
- for (unsigned j = 0, M = UnitList.size(); j < M;) {
- // Add name and bitwise or
- ItinString += UnitList[j]->getName();
- if (++j < M) ItinString += " | ";
- }
-
- // Close off stage
- ItinString += " }";
- if (++i < N) ItinString += ", ";
- }
-}
-
-//
-// EmitStageData - Generate unique itinerary stages. Record itineraries for
-// processors.
-//
-void SubtargetEmitter::EmitStageData(std::ostream &OS,
- unsigned NItinClasses,
- std::map<std::string, unsigned> &ItinClassesMap,
- std::vector<std::vector<InstrItinerary> > &ProcList) {
- // Gather processor iteraries
- std::vector<Record*> ProcItinList =
- Records.getAllDerivedDefinitions("ProcessorItineraries");
-
- // If just no itinerary then don't bother
- if (ProcItinList.size() < 2) return;
-
- // Begin stages table
- OS << "static const llvm::InstrStage Stages[] = {\n"
- " { 0, 0 }, // No itinerary\n";
-
- unsigned StageCount = 1;
- unsigned ItinEnum = 1;
- std::map<std::string, unsigned> ItinMap;
- for (unsigned i = 0, N = ProcItinList.size(); i < N; i++) {
- // Next record
- Record *Proc = ProcItinList[i];
-
- // Get processor itinerary name
- const std::string &Name = Proc->getName();
-
- // Skip default
- if (Name == "NoItineraries") continue;
-
- // Create and expand processor itinerary to cover all itinerary classes
- std::vector<InstrItinerary> ItinList;
- ItinList.resize(NItinClasses);
-
- // Get itinerary data list
- std::vector<Record*> ItinDataList = Proc->getValueAsListOfDefs("IID");
-
- // For each itinerary data
- for (unsigned j = 0, M = ItinDataList.size(); j < M; j++) {
- // Next itinerary data
- Record *ItinData = ItinDataList[j];
-
- // Get string and stage count
- std::string ItinString;
- unsigned NStages;
- FormItineraryString(ItinData, ItinString, NStages);
-
- // Check to see if it already exists
- unsigned Find = ItinMap[ItinString];
-
- // If new itinerary
- if (Find == 0) {
- // Emit as { cycles, u1 | u2 | ... | un }, // index
- OS << ItinString << ", // " << ItinEnum << "\n";
- // Record Itin class number.
- ItinMap[ItinString] = Find = StageCount;
- StageCount += NStages;
- ItinEnum++;
- }
-
- // Set up itinerary as location and location + stage count
- InstrItinerary Intinerary = { Find, Find + NStages };
-
- // Locate where to inject into processor itinerary table
- const std::string &Name = ItinData->getValueAsDef("TheClass")->getName();
- Find = ItinClassesMap[Name];
-
- // Inject - empty slots will be 0, 0
- ItinList[Find] = Intinerary;
- }
-
- // Add process itinerary to list
- ProcList.push_back(ItinList);
- }
-
- // Closing stage
- OS << " { 0, 0 } // End itinerary\n";
- // End stages table
- OS << "};\n";
-
- // Emit size of table
- OS<<"\nenum {\n";
- OS<<" StagesSize = sizeof(Stages)/sizeof(llvm::InstrStage)\n";
- OS<<"};\n";
-}
-
-//
-// EmitProcessorData - Generate data for processor itineraries.
-//
-void SubtargetEmitter::EmitProcessorData(std::ostream &OS,
- std::vector<std::vector<InstrItinerary> > &ProcList) {
- // Get an iterator for processor itinerary stages
- std::vector<std::vector<InstrItinerary> >::iterator
- ProcListIter = ProcList.begin();
-
- // For each processor itinerary
- std::vector<Record*> Itins =
- Records.getAllDerivedDefinitions("ProcessorItineraries");
- for (unsigned i = 0, N = Itins.size(); i < N; i++) {
- // Next record
- Record *Itin = Itins[i];
-
- // Get processor itinerary name
- const std::string &Name = Itin->getName();
-
- // Skip default
- if (Name == "NoItineraries") continue;
-
- // Begin processor itinerary table
- OS << "\n";
- OS << "static const llvm::InstrItinerary " << Name << "[] = {\n";
-
- // For each itinerary class
- std::vector<InstrItinerary> &ItinList = *ProcListIter++;
- for (unsigned j = 0, M = ItinList.size(); j < M;) {
- InstrItinerary &Intinerary = ItinList[j];
-
- // Emit in the form of { first, last } // index
- if (Intinerary.First == 0) {
- OS << " { 0, 0 }";
- } else {
- OS << " { " << Intinerary.First << ", " << Intinerary.Last << " }";
- }
-
- // If more in list add comma
- if (++j < M) OS << ",";
-
- OS << " // " << (j - 1) << "\n";
- }
-
- // End processor itinerary table
- OS << "};\n";
- }
-}
-
-//
-// EmitProcessorLookup - generate cpu name to itinerary lookup table.
-//
-void SubtargetEmitter::EmitProcessorLookup(std::ostream &OS) {
- // Gather and sort processor information
- std::vector<Record*> ProcessorList =
- Records.getAllDerivedDefinitions("Processor");
- std::sort(ProcessorList.begin(), ProcessorList.end(), LessRecordFieldName());
-
- // Begin processor table
- OS << "\n";
- OS << "// Sorted (by key) array of itineraries for CPU subtype.\n"
- << "static const llvm::SubtargetInfoKV ProcItinKV[] = {\n";
-
- // For each processor
- for (unsigned i = 0, N = ProcessorList.size(); i < N;) {
- // Next processor
- Record *Processor = ProcessorList[i];
-
- const std::string &Name = Processor->getValueAsString("Name");
- const std::string &ProcItin =
- Processor->getValueAsDef("ProcItin")->getName();
-
- // Emit as { "cpu", procinit },
- OS << " { "
- << "\"" << Name << "\", "
- << "(void *)&" << ProcItin;
-
- OS << " }";
-
- // Depending on ''if more in the list'' emit comma
- if (++i < N) OS << ",";
-
- OS << "\n";
- }
-
- // End processor table
- OS << "};\n";
-
- // Emit size of table
- OS<<"\nenum {\n";
- OS<<" ProcItinKVSize = sizeof(ProcItinKV)/"
- "sizeof(llvm::SubtargetInfoKV)\n";
- OS<<"};\n";
-}
-
-//
-// EmitData - Emits all stages and itineries, folding common patterns.
-//
-void SubtargetEmitter::EmitData(std::ostream &OS) {
- std::map<std::string, unsigned> ItinClassesMap;
- std::vector<std::vector<InstrItinerary> > ProcList;
-
- // Enumerate all the itinerary classes
- unsigned NItinClasses = CollectAllItinClasses(OS, ItinClassesMap);
- // Make sure the rest is worth the effort
- HasItineraries = NItinClasses != 1; // Ignore NoItinerary.
-
- if (HasItineraries) {
- // Emit the stage data
- EmitStageData(OS, NItinClasses, ItinClassesMap, ProcList);
- // Emit the processor itinerary data
- EmitProcessorData(OS, ProcList);
- // Emit the processor lookup data
- EmitProcessorLookup(OS);
- }
-}
-
-//
-// ParseFeaturesFunction - Produces a subtarget specific function for parsing
-// the subtarget features string.
-//
-void SubtargetEmitter::ParseFeaturesFunction(std::ostream &OS) {
- std::vector<Record*> Features =
- Records.getAllDerivedDefinitions("SubtargetFeature");
- std::sort(Features.begin(), Features.end(), LessRecord());
-
- OS << "// ParseSubtargetFeatures - Parses features string setting specified\n"
- << "// subtarget options.\n"
- << "void llvm::";
- OS << Target;
- OS << "Subtarget::ParseSubtargetFeatures(const std::string &FS,\n"
- << " const std::string &CPU) {\n"
- << " SubtargetFeatures Features(FS);\n"
- << " Features.setCPUIfNone(CPU);\n"
- << " uint32_t Bits = Features.getBits(SubTypeKV, SubTypeKVSize,\n"
- << " FeatureKV, FeatureKVSize);\n";
-
- for (unsigned i = 0; i < Features.size(); i++) {
- // Next record
- Record *R = Features[i];
- const std::string &Instance = R->getName();
- const std::string &Value = R->getValueAsString("Value");
- const std::string &Attribute = R->getValueAsString("Attribute");
-
- if (Value=="true" || Value=="false")
- OS << " if ((Bits & " << Instance << ") != 0) "
- << Attribute << " = " << Value << ";\n";
- else
- OS << " if ((Bits & " << Instance << ") != 0 && " << Attribute <<
- " < " << Value << ") " << Attribute << " = " << Value << ";\n";
- }
-
- if (HasItineraries) {
- OS << "\n"
- << " InstrItinerary *Itinerary = (InstrItinerary *)"
- << "Features.getInfo(ProcItinKV, ProcItinKVSize);\n"
- << " InstrItins = InstrItineraryData(Stages, Itinerary);\n";
- }
-
- OS << "}\n";
-}
-
-//
-// SubtargetEmitter::run - Main subtarget enumeration emitter.
-//
-void SubtargetEmitter::run(std::ostream &OS) {
- Target = CodeGenTarget().getName();
-
- EmitSourceFileHeader("Subtarget Enumeration Source Fragment", OS);
-
- OS << "#include \"llvm/Target/SubtargetFeature.h\"\n";
- OS << "#include \"llvm/Target/TargetInstrItineraries.h\"\n\n";
-
- Enumeration(OS, "FuncUnit", true);
- OS<<"\n";
-// Enumeration(OS, "InstrItinClass", false);
-// OS<<"\n";
- Enumeration(OS, "SubtargetFeature", true);
- OS<<"\n";
- FeatureKeyValues(OS);
- OS<<"\n";
- CPUKeyValues(OS);
- OS<<"\n";
- EmitData(OS);
- OS<<"\n";
- ParseFeaturesFunction(OS);
-}
diff --git a/release_23/utils/TableGen/SubtargetEmitter.h b/release_23/utils/TableGen/SubtargetEmitter.h
deleted file mode 100644
index 4fcd8f8b0b24..000000000000
--- a/release_23/utils/TableGen/SubtargetEmitter.h
+++ /dev/null
@@ -1,62 +0,0 @@
-//===- SubtargetEmitter.h - Generate subtarget enumerations -----*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This tablegen backend emits subtarget enumerations.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef SUBTARGET_EMITTER_H
-#define SUBTARGET_EMITTER_H
-
-#include "TableGenBackend.h"
-#include "llvm/Target/TargetInstrItineraries.h"
-#include <vector>
-#include <map>
-#include <string>
-
-
-namespace llvm {
-
-class SubtargetEmitter : public TableGenBackend {
-
- RecordKeeper &Records;
- std::string Target;
- bool HasItineraries;
-
- void Enumeration(std::ostream &OS, const char *ClassName, bool isBits);
- void FeatureKeyValues(std::ostream &OS);
- void CPUKeyValues(std::ostream &OS);
- unsigned CollectAllItinClasses(std::ostream &OS,
- std::map<std::string, unsigned> &ItinClassesMap);
- void FormItineraryString(Record *ItinData, std::string &ItinString,
- unsigned &NStages);
- void EmitStageData(std::ostream &OS, unsigned NItinClasses,
- std::map<std::string, unsigned> &ItinClassesMap,
- std::vector<std::vector<InstrItinerary> > &ProcList);
- void EmitProcessorData(std::ostream &OS,
- std::vector<std::vector<InstrItinerary> > &ProcList);
- void EmitProcessorLookup(std::ostream &OS);
- void EmitData(std::ostream &OS);
- void ParseFeaturesFunction(std::ostream &OS);
-
-public:
- SubtargetEmitter(RecordKeeper &R) : Records(R), HasItineraries(false) {}
-
- // run - Output the subtarget enumerations, returning true on failure.
- void run(std::ostream &o);
-
-};
-
-
-} // End llvm namespace
-
-#endif
-
-
-
diff --git a/release_23/utils/TableGen/TGLexer.cpp b/release_23/utils/TableGen/TGLexer.cpp
deleted file mode 100644
index a6de239e6f6d..000000000000
--- a/release_23/utils/TableGen/TGLexer.cpp
+++ /dev/null
@@ -1,419 +0,0 @@
-//===- TGLexer.cpp - Lexer for TableGen -----------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// Implement the Lexer for TableGen.
-//
-//===----------------------------------------------------------------------===//
-
-#include "TGLexer.h"
-#include "llvm/Support/Streams.h"
-#include "llvm/Support/MemoryBuffer.h"
-#include <ostream>
-#include "llvm/Config/config.h"
-#include <cctype>
-#include <cstdlib>
-#include <cstring>
-using namespace llvm;
-
-TGLexer::TGLexer(MemoryBuffer *StartBuf) : CurLineNo(1), CurBuf(StartBuf) {
- CurPtr = CurBuf->getBufferStart();
- TokStart = 0;
-}
-
-TGLexer::~TGLexer() {
- while (!IncludeStack.empty()) {
- delete IncludeStack.back().Buffer;
- IncludeStack.pop_back();
- }
- delete CurBuf;
-}
-
-/// ReturnError - Set the error to the specified string at the specified
-/// location. This is defined to always return tgtok::Error.
-tgtok::TokKind TGLexer::ReturnError(const char *Loc, const std::string &Msg) {
- PrintError(Loc, Msg);
- return tgtok::Error;
-}
-
-void TGLexer::PrintIncludeStack(std::ostream &OS) const {
- for (unsigned i = 0, e = IncludeStack.size(); i != e; ++i)
- OS << "Included from " << IncludeStack[i].Buffer->getBufferIdentifier()
- << ":" << IncludeStack[i].LineNo << ":\n";
- OS << "Parsing " << CurBuf->getBufferIdentifier() << ":"
- << CurLineNo << ": ";
-}
-
-/// PrintError - Print the error at the specified location.
-void TGLexer::PrintError(const char *ErrorLoc, const std::string &Msg) const {
- PrintIncludeStack(*cerr.stream());
- cerr << Msg << "\n";
- assert(ErrorLoc && "Location not specified!");
-
- // Scan backward to find the start of the line.
- const char *LineStart = ErrorLoc;
- while (LineStart != CurBuf->getBufferStart() &&
- LineStart[-1] != '\n' && LineStart[-1] != '\r')
- --LineStart;
- // Get the end of the line.
- const char *LineEnd = ErrorLoc;
- while (LineEnd != CurBuf->getBufferEnd() &&
- LineEnd[0] != '\n' && LineEnd[0] != '\r')
- ++LineEnd;
- // Print out the line.
- cerr << std::string(LineStart, LineEnd) << "\n";
- // Print out spaces before the carat.
- for (const char *Pos = LineStart; Pos != ErrorLoc; ++Pos)
- cerr << (*Pos == '\t' ? '\t' : ' ');
- cerr << "^\n";
-}
-
-int TGLexer::getNextChar() {
- char CurChar = *CurPtr++;
- switch (CurChar) {
- default:
- return (unsigned char)CurChar;
- case 0:
- // A nul character in the stream is either the end of the current buffer or
- // a random nul in the file. Disambiguate that here.
- if (CurPtr-1 != CurBuf->getBufferEnd())
- return 0; // Just whitespace.
-
- // If this is the end of an included file, pop the parent file off the
- // include stack.
- if (!IncludeStack.empty()) {
- delete CurBuf;
- CurBuf = IncludeStack.back().Buffer;
- CurLineNo = IncludeStack.back().LineNo;
- CurPtr = IncludeStack.back().CurPtr;
- IncludeStack.pop_back();
- return getNextChar();
- }
-
- // Otherwise, return end of file.
- --CurPtr; // Another call to lex will return EOF again.
- return EOF;
- case '\n':
- case '\r':
- // Handle the newline character by ignoring it and incrementing the line
- // count. However, be careful about 'dos style' files with \n\r in them.
- // Only treat a \n\r or \r\n as a single line.
- if ((*CurPtr == '\n' || (*CurPtr == '\r')) &&
- *CurPtr != CurChar)
- ++CurPtr; // Eat the two char newline sequence.
-
- ++CurLineNo;
- return '\n';
- }
-}
-
-tgtok::TokKind TGLexer::LexToken() {
- TokStart = CurPtr;
- // This always consumes at least one character.
- int CurChar = getNextChar();
-
- switch (CurChar) {
- default:
- // Handle letters: [a-zA-Z_]
- if (isalpha(CurChar) || CurChar == '_')
- return LexIdentifier();
-
- // Unknown character, emit an error.
- return ReturnError(TokStart, "Unexpected character");
- case EOF: return tgtok::Eof;
- case ':': return tgtok::colon;
- case ';': return tgtok::semi;
- case '.': return tgtok::period;
- case ',': return tgtok::comma;
- case '<': return tgtok::less;
- case '>': return tgtok::greater;
- case ']': return tgtok::r_square;
- case '{': return tgtok::l_brace;
- case '}': return tgtok::r_brace;
- case '(': return tgtok::l_paren;
- case ')': return tgtok::r_paren;
- case '=': return tgtok::equal;
- case '?': return tgtok::question;
-
- case 0:
- case ' ':
- case '\t':
- case '\n':
- case '\r':
- // Ignore whitespace.
- return LexToken();
- case '/':
- // If this is the start of a // comment, skip until the end of the line or
- // the end of the buffer.
- if (*CurPtr == '/')
- SkipBCPLComment();
- else if (*CurPtr == '*') {
- if (SkipCComment())
- return tgtok::Error;
- } else // Otherwise, this is an error.
- return ReturnError(TokStart, "Unexpected character");
- return LexToken();
- case '-': case '+':
- case '0': case '1': case '2': case '3': case '4': case '5': case '6':
- case '7': case '8': case '9':
- return LexNumber();
- case '"': return LexString();
- case '$': return LexVarName();
- case '[': return LexBracket();
- case '!': return LexExclaim();
- }
-}
-
-/// LexString - Lex "[^"]*"
-tgtok::TokKind TGLexer::LexString() {
- const char *StrStart = CurPtr;
-
- while (*CurPtr != '"') {
- // If we hit the end of the buffer, report an error.
- if (*CurPtr == 0 && CurPtr == CurBuf->getBufferEnd())
- return ReturnError(StrStart, "End of file in string literal");
-
- if (*CurPtr == '\n' || *CurPtr == '\r')
- return ReturnError(StrStart, "End of line in string literal");
-
- ++CurPtr;
- }
-
- CurStrVal.assign(StrStart, CurPtr);
- ++CurPtr;
- return tgtok::StrVal;
-}
-
-tgtok::TokKind TGLexer::LexVarName() {
- if (!isalpha(CurPtr[0]) && CurPtr[0] != '_')
- return ReturnError(TokStart, "Invalid variable name");
-
- // Otherwise, we're ok, consume the rest of the characters.
- const char *VarNameStart = CurPtr++;
-
- while (isalpha(*CurPtr) || isdigit(*CurPtr) || *CurPtr == '_')
- ++CurPtr;
-
- CurStrVal.assign(VarNameStart, CurPtr);
- return tgtok::VarName;
-}
-
-
-tgtok::TokKind TGLexer::LexIdentifier() {
- // The first letter is [a-zA-Z_].
- const char *IdentStart = TokStart;
-
- // Match the rest of the identifier regex: [0-9a-zA-Z_]*
- while (isalpha(*CurPtr) || isdigit(*CurPtr) || *CurPtr == '_')
- ++CurPtr;
-
- // Check to see if this identifier is a keyword.
- unsigned Len = CurPtr-IdentStart;
-
- if (Len == 3 && !memcmp(IdentStart, "int", 3)) return tgtok::Int;
- if (Len == 3 && !memcmp(IdentStart, "bit", 3)) return tgtok::Bit;
- if (Len == 4 && !memcmp(IdentStart, "bits", 4)) return tgtok::Bits;
- if (Len == 6 && !memcmp(IdentStart, "string", 6)) return tgtok::String;
- if (Len == 4 && !memcmp(IdentStart, "list", 4)) return tgtok::List;
- if (Len == 4 && !memcmp(IdentStart, "code", 4)) return tgtok::Code;
- if (Len == 3 && !memcmp(IdentStart, "dag", 3)) return tgtok::Dag;
-
- if (Len == 5 && !memcmp(IdentStart, "class", 5)) return tgtok::Class;
- if (Len == 3 && !memcmp(IdentStart, "def", 3)) return tgtok::Def;
- if (Len == 4 && !memcmp(IdentStart, "defm", 4)) return tgtok::Defm;
- if (Len == 10 && !memcmp(IdentStart, "multiclass", 10))
- return tgtok::MultiClass;
- if (Len == 5 && !memcmp(IdentStart, "field", 5)) return tgtok::Field;
- if (Len == 3 && !memcmp(IdentStart, "let", 3)) return tgtok::Let;
- if (Len == 2 && !memcmp(IdentStart, "in", 2)) return tgtok::In;
-
- if (Len == 7 && !memcmp(IdentStart, "include", 7)) {
- if (LexInclude()) return tgtok::Error;
- return Lex();
- }
-
- CurStrVal.assign(IdentStart, CurPtr);
- return tgtok::Id;
-}
-
-/// LexInclude - We just read the "include" token. Get the string token that
-/// comes next and enter the include.
-bool TGLexer::LexInclude() {
- // The token after the include must be a string.
- tgtok::TokKind Tok = LexToken();
- if (Tok == tgtok::Error) return true;
- if (Tok != tgtok::StrVal) {
- PrintError(getLoc(), "Expected filename after include");
- return true;
- }
-
- // Get the string.
- std::string Filename = CurStrVal;
-
- // Try to find the file.
- MemoryBuffer *NewBuf = MemoryBuffer::getFile(Filename.c_str());
-
- // If the file didn't exist directly, see if it's in an include path.
- for (unsigned i = 0, e = IncludeDirectories.size(); i != e && !NewBuf; ++i) {
- std::string IncFile = IncludeDirectories[i] + "/" + Filename;
- NewBuf = MemoryBuffer::getFile(IncFile.c_str());
- }
-
- if (NewBuf == 0) {
- PrintError(getLoc(), "Could not find include file '" + Filename + "'");
- return true;
- }
-
- // Save the line number and lex buffer of the includer.
- IncludeStack.push_back(IncludeRec(CurBuf, CurPtr, CurLineNo));
-
- CurLineNo = 1; // Reset line numbering.
- CurBuf = NewBuf;
- CurPtr = CurBuf->getBufferStart();
- return false;
-}
-
-void TGLexer::SkipBCPLComment() {
- ++CurPtr; // skip the second slash.
- while (1) {
- switch (*CurPtr) {
- case '\n':
- case '\r':
- return; // Newline is end of comment.
- case 0:
- // If this is the end of the buffer, end the comment.
- if (CurPtr == CurBuf->getBufferEnd())
- return;
- break;
- }
- // Otherwise, skip the character.
- ++CurPtr;
- }
-}
-
-/// SkipCComment - This skips C-style /**/ comments. The only difference from C
-/// is that we allow nesting.
-bool TGLexer::SkipCComment() {
- ++CurPtr; // skip the star.
- unsigned CommentDepth = 1;
-
- while (1) {
- int CurChar = getNextChar();
- switch (CurChar) {
- case EOF:
- PrintError(TokStart, "Unterminated comment!");
- return true;
- case '*':
- // End of the comment?
- if (CurPtr[0] != '/') break;
-
- ++CurPtr; // End the */.
- if (--CommentDepth == 0)
- return false;
- break;
- case '/':
- // Start of a nested comment?
- if (CurPtr[0] != '*') break;
- ++CurPtr;
- ++CommentDepth;
- break;
- }
- }
-}
-
-/// LexNumber - Lex:
-/// [-+]?[0-9]+
-/// 0x[0-9a-fA-F]+
-/// 0b[01]+
-tgtok::TokKind TGLexer::LexNumber() {
- if (CurPtr[-1] == '0') {
- if (CurPtr[0] == 'x') {
- ++CurPtr;
- const char *NumStart = CurPtr;
- while (isxdigit(CurPtr[0]))
- ++CurPtr;
-
- // Requires at least one hex digit.
- if (CurPtr == NumStart)
- return ReturnError(CurPtr-2, "Invalid hexadecimal number");
-
- CurIntVal = strtoll(NumStart, 0, 16);
- return tgtok::IntVal;
- } else if (CurPtr[0] == 'b') {
- ++CurPtr;
- const char *NumStart = CurPtr;
- while (CurPtr[0] == '0' || CurPtr[0] == '1')
- ++CurPtr;
-
- // Requires at least one binary digit.
- if (CurPtr == NumStart)
- return ReturnError(CurPtr-2, "Invalid binary number");
- CurIntVal = strtoll(NumStart, 0, 2);
- return tgtok::IntVal;
- }
- }
-
- // Check for a sign without a digit.
- if (!isdigit(CurPtr[0])) {
- if (CurPtr[-1] == '-')
- return tgtok::minus;
- else if (CurPtr[-1] == '+')
- return tgtok::plus;
- }
-
- while (isdigit(CurPtr[0]))
- ++CurPtr;
- CurIntVal = strtoll(TokStart, 0, 10);
- return tgtok::IntVal;
-}
-
-/// LexBracket - We just read '['. If this is a code block, return it,
-/// otherwise return the bracket. Match: '[' and '[{ ( [^}]+ | }[^]] )* }]'
-tgtok::TokKind TGLexer::LexBracket() {
- if (CurPtr[0] != '{')
- return tgtok::l_square;
- ++CurPtr;
- const char *CodeStart = CurPtr;
- while (1) {
- int Char = getNextChar();
- if (Char == EOF) break;
-
- if (Char != '}') continue;
-
- Char = getNextChar();
- if (Char == EOF) break;
- if (Char == ']') {
- CurStrVal.assign(CodeStart, CurPtr-2);
- return tgtok::CodeFragment;
- }
- }
-
- return ReturnError(CodeStart-2, "Unterminated Code Block");
-}
-
-/// LexExclaim - Lex '!' and '![a-zA-Z]+'.
-tgtok::TokKind TGLexer::LexExclaim() {
- if (!isalpha(*CurPtr))
- return ReturnError(CurPtr-1, "Invalid \"!operator\"");
-
- const char *Start = CurPtr++;
- while (isalpha(*CurPtr))
- ++CurPtr;
-
- // Check to see which operator this is.
- unsigned Len = CurPtr-Start;
-
- if (Len == 3 && !memcmp(Start, "con", 3)) return tgtok::XConcat;
- if (Len == 3 && !memcmp(Start, "sra", 3)) return tgtok::XSRA;
- if (Len == 3 && !memcmp(Start, "srl", 3)) return tgtok::XSRL;
- if (Len == 3 && !memcmp(Start, "shl", 3)) return tgtok::XSHL;
- if (Len == 9 && !memcmp(Start, "strconcat", 9)) return tgtok::XStrConcat;
-
- return ReturnError(Start-1, "Unknown operator");
-}
-
diff --git a/release_23/utils/TableGen/TGLexer.h b/release_23/utils/TableGen/TGLexer.h
deleted file mode 100644
index b4fa97cc0864..000000000000
--- a/release_23/utils/TableGen/TGLexer.h
+++ /dev/null
@@ -1,133 +0,0 @@
-//===- TGLexer.h - Lexer for TableGen Files ---------------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This class represents the Lexer for tablegen files.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef TGLEXER_H
-#define TGLEXER_H
-
-#include <vector>
-#include <string>
-#include <iosfwd>
-#include <cassert>
-
-namespace llvm {
-class MemoryBuffer;
-
-namespace tgtok {
- enum TokKind {
- // Markers
- Eof, Error,
-
- // Tokens with no info.
- minus, plus, // - +
- l_square, r_square, // [ ]
- l_brace, r_brace, // { }
- l_paren, r_paren, // ( )
- less, greater, // < >
- colon, semi, // ; :
- comma, period, // , .
- equal, question, // = ?
-
- // Keywords.
- Bit, Bits, Class, Code, Dag, Def, Defm, Field, In, Int, Let, List,
- MultiClass, String,
-
- // !keywords.
- XConcat, XSRA, XSRL, XSHL, XStrConcat,
-
- // Integer value.
- IntVal,
-
- // String valued tokens.
- Id, StrVal, VarName, CodeFragment
- };
-}
-
-/// TGLexer - TableGen Lexer class.
-class TGLexer {
- const char *CurPtr;
- unsigned CurLineNo;
- MemoryBuffer *CurBuf;
-
- // Information about the current token.
- const char *TokStart;
- tgtok::TokKind CurCode;
- std::string CurStrVal; // This is valid for ID, STRVAL, VARNAME, CODEFRAGMENT
- int CurIntVal; // This is valid for INTVAL.
-
- /// IncludeRec / IncludeStack - This captures the current set of include
- /// directives we are nested within.
- struct IncludeRec {
- MemoryBuffer *Buffer;
- const char *CurPtr;
- unsigned LineNo;
- IncludeRec(MemoryBuffer *buffer, const char *curPtr, unsigned lineNo)
- : Buffer(buffer), CurPtr(curPtr), LineNo(lineNo) {}
- };
- std::vector<IncludeRec> IncludeStack;
-
- // IncludeDirectories - This is the list of directories we should search for
- // include files in.
- std::vector<std::string> IncludeDirectories;
-public:
- TGLexer(MemoryBuffer *StartBuf);
- ~TGLexer();
-
- void setIncludeDirs(const std::vector<std::string> &Dirs) {
- IncludeDirectories = Dirs;
- }
-
- tgtok::TokKind Lex() {
- return CurCode = LexToken();
- }
-
- tgtok::TokKind getCode() const { return CurCode; }
-
- const std::string &getCurStrVal() const {
- assert((CurCode == tgtok::Id || CurCode == tgtok::StrVal ||
- CurCode == tgtok::VarName || CurCode == tgtok::CodeFragment) &&
- "This token doesn't have a string value");
- return CurStrVal;
- }
- int getCurIntVal() const {
- assert(CurCode == tgtok::IntVal && "This token isn't an integer");
- return CurIntVal;
- }
-
- typedef const char* LocTy;
- LocTy getLoc() const { return TokStart; }
-
- void PrintError(LocTy Loc, const std::string &Msg) const;
-
- void PrintIncludeStack(std::ostream &OS) const;
-
-private:
- /// LexToken - Read the next token and return its code.
- tgtok::TokKind LexToken();
-
- tgtok::TokKind ReturnError(const char *Loc, const std::string &Msg);
-
- int getNextChar();
- void SkipBCPLComment();
- bool SkipCComment();
- tgtok::TokKind LexIdentifier();
- bool LexInclude();
- tgtok::TokKind LexString();
- tgtok::TokKind LexVarName();
- tgtok::TokKind LexNumber();
- tgtok::TokKind LexBracket();
- tgtok::TokKind LexExclaim();
-};
-
-} // end namespace llvm
-
-#endif
diff --git a/release_23/utils/TableGen/TGParser.cpp b/release_23/utils/TableGen/TGParser.cpp
deleted file mode 100644
index 68a1cba3da5f..000000000000
--- a/release_23/utils/TableGen/TGParser.cpp
+++ /dev/null
@@ -1,1380 +0,0 @@
-//===- TGParser.cpp - Parser for TableGen Files ---------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// Implement the Parser for TableGen.
-//
-//===----------------------------------------------------------------------===//
-
-#include <algorithm>
-
-#include "TGParser.h"
-#include "Record.h"
-#include "llvm/ADT/StringExtras.h"
-using namespace llvm;
-
-//===----------------------------------------------------------------------===//
-// Support Code for the Semantic Actions.
-//===----------------------------------------------------------------------===//
-
-namespace llvm {
-struct MultiClass {
- Record Rec; // Placeholder for template args and Name.
- std::vector<Record*> DefPrototypes;
-
- MultiClass(const std::string &Name) : Rec(Name) {}
-};
-
-struct SubClassReference {
- TGParser::LocTy RefLoc;
- Record *Rec;
- std::vector<Init*> TemplateArgs;
- SubClassReference() : RefLoc(0), Rec(0) {}
-
- bool isInvalid() const { return Rec == 0; }
-};
-
-} // end namespace llvm
-
-bool TGParser::AddValue(Record *CurRec, LocTy Loc, const RecordVal &RV) {
- if (CurRec == 0)
- CurRec = &CurMultiClass->Rec;
-
- if (RecordVal *ERV = CurRec->getValue(RV.getName())) {
- // The value already exists in the class, treat this as a set.
- if (ERV->setValue(RV.getValue()))
- return Error(Loc, "New definition of '" + RV.getName() + "' of type '" +
- RV.getType()->getAsString() + "' is incompatible with " +
- "previous definition of type '" +
- ERV->getType()->getAsString() + "'");
- } else {
- CurRec->addValue(RV);
- }
- return false;
-}
-
-/// SetValue -
-/// Return true on error, false on success.
-bool TGParser::SetValue(Record *CurRec, LocTy Loc, const std::string &ValName,
- const std::vector<unsigned> &BitList, Init *V) {
- if (!V) return false;
-
- if (CurRec == 0) CurRec = &CurMultiClass->Rec;
-
- RecordVal *RV = CurRec->getValue(ValName);
- if (RV == 0)
- return Error(Loc, "Value '" + ValName + "' unknown!");
-
- // Do not allow assignments like 'X = X'. This will just cause infinite loops
- // in the resolution machinery.
- if (BitList.empty())
- if (VarInit *VI = dynamic_cast<VarInit*>(V))
- if (VI->getName() == ValName)
- return false;
-
- // If we are assigning to a subset of the bits in the value... then we must be
- // assigning to a field of BitsRecTy, which must have a BitsInit
- // initializer.
- //
- if (!BitList.empty()) {
- BitsInit *CurVal = dynamic_cast<BitsInit*>(RV->getValue());
- if (CurVal == 0)
- return Error(Loc, "Value '" + ValName + "' is not a bits type");
-
- // Convert the incoming value to a bits type of the appropriate size...
- Init *BI = V->convertInitializerTo(new BitsRecTy(BitList.size()));
- if (BI == 0) {
- V->convertInitializerTo(new BitsRecTy(BitList.size()));
- return Error(Loc, "Initializer is not compatible with bit range");
- }
-
- // We should have a BitsInit type now.
- BitsInit *BInit = dynamic_cast<BitsInit*>(BI);
- assert(BInit != 0);
-
- BitsInit *NewVal = new BitsInit(CurVal->getNumBits());
-
- // Loop over bits, assigning values as appropriate.
- for (unsigned i = 0, e = BitList.size(); i != e; ++i) {
- unsigned Bit = BitList[i];
- if (NewVal->getBit(Bit))
- return Error(Loc, "Cannot set bit #" + utostr(Bit) + " of value '" +
- ValName + "' more than once");
- NewVal->setBit(Bit, BInit->getBit(i));
- }
-
- for (unsigned i = 0, e = CurVal->getNumBits(); i != e; ++i)
- if (NewVal->getBit(i) == 0)
- NewVal->setBit(i, CurVal->getBit(i));
-
- V = NewVal;
- }
-
- if (RV->setValue(V))
- return Error(Loc, "Value '" + ValName + "' of type '" +
- RV->getType()->getAsString() +
- "' is incompatible with initializer '" + V->getAsString() +"'");
- return false;
-}
-
-/// AddSubClass - Add SubClass as a subclass to CurRec, resolving its template
-/// args as SubClass's template arguments.
-bool TGParser::AddSubClass(Record *CurRec, class SubClassReference &SubClass) {
- Record *SC = SubClass.Rec;
- // Add all of the values in the subclass into the current class.
- const std::vector<RecordVal> &Vals = SC->getValues();
- for (unsigned i = 0, e = Vals.size(); i != e; ++i)
- if (AddValue(CurRec, SubClass.RefLoc, Vals[i]))
- return true;
-
- const std::vector<std::string> &TArgs = SC->getTemplateArgs();
-
- // Ensure that an appropriate number of template arguments are specified.
- if (TArgs.size() < SubClass.TemplateArgs.size())
- return Error(SubClass.RefLoc, "More template args specified than expected");
-
- // Loop over all of the template arguments, setting them to the specified
- // value or leaving them as the default if necessary.
- for (unsigned i = 0, e = TArgs.size(); i != e; ++i) {
- if (i < SubClass.TemplateArgs.size()) {
- // If a value is specified for this template arg, set it now.
- if (SetValue(CurRec, SubClass.RefLoc, TArgs[i], std::vector<unsigned>(),
- SubClass.TemplateArgs[i]))
- return true;
-
- // Resolve it next.
- CurRec->resolveReferencesTo(CurRec->getValue(TArgs[i]));
-
- // Now remove it.
- CurRec->removeValue(TArgs[i]);
-
- } else if (!CurRec->getValue(TArgs[i])->getValue()->isComplete()) {
- return Error(SubClass.RefLoc,"Value not specified for template argument #"
- + utostr(i) + " (" + TArgs[i] + ") of subclass '" +
- SC->getName() + "'!");
- }
- }
-
- // Since everything went well, we can now set the "superclass" list for the
- // current record.
- const std::vector<Record*> &SCs = SC->getSuperClasses();
- for (unsigned i = 0, e = SCs.size(); i != e; ++i) {
- if (CurRec->isSubClassOf(SCs[i]))
- return Error(SubClass.RefLoc,
- "Already subclass of '" + SCs[i]->getName() + "'!\n");
- CurRec->addSuperClass(SCs[i]);
- }
-
- if (CurRec->isSubClassOf(SC))
- return Error(SubClass.RefLoc,
- "Already subclass of '" + SC->getName() + "'!\n");
- CurRec->addSuperClass(SC);
- return false;
-}
-
-//===----------------------------------------------------------------------===//
-// Parser Code
-//===----------------------------------------------------------------------===//
-
-/// isObjectStart - Return true if this is a valid first token for an Object.
-static bool isObjectStart(tgtok::TokKind K) {
- return K == tgtok::Class || K == tgtok::Def ||
- K == tgtok::Defm || K == tgtok::Let || K == tgtok::MultiClass;
-}
-
-/// ParseObjectName - If an object name is specified, return it. Otherwise,
-/// return an anonymous name.
-/// ObjectName ::= ID
-/// ObjectName ::= /*empty*/
-///
-std::string TGParser::ParseObjectName() {
- if (Lex.getCode() == tgtok::Id) {
- std::string Ret = Lex.getCurStrVal();
- Lex.Lex();
- return Ret;
- }
-
- static unsigned AnonCounter = 0;
- return "anonymous."+utostr(AnonCounter++);
-}
-
-
-/// ParseClassID - Parse and resolve a reference to a class name. This returns
-/// null on error.
-///
-/// ClassID ::= ID
-///
-Record *TGParser::ParseClassID() {
- if (Lex.getCode() != tgtok::Id) {
- TokError("expected name for ClassID");
- return 0;
- }
-
- Record *Result = Records.getClass(Lex.getCurStrVal());
- if (Result == 0)
- TokError("Couldn't find class '" + Lex.getCurStrVal() + "'");
-
- Lex.Lex();
- return Result;
-}
-
-Record *TGParser::ParseDefmID() {
- if (Lex.getCode() != tgtok::Id) {
- TokError("expected multiclass name");
- return 0;
- }
-
- MultiClass *MC = MultiClasses[Lex.getCurStrVal()];
- if (MC == 0) {
- TokError("Couldn't find multiclass '" + Lex.getCurStrVal() + "'");
- return 0;
- }
-
- Lex.Lex();
- return &MC->Rec;
-}
-
-
-
-/// ParseSubClassReference - Parse a reference to a subclass or to a templated
-/// subclass. This returns a SubClassRefTy with a null Record* on error.
-///
-/// SubClassRef ::= ClassID
-/// SubClassRef ::= ClassID '<' ValueList '>'
-///
-SubClassReference TGParser::
-ParseSubClassReference(Record *CurRec, bool isDefm) {
- SubClassReference Result;
- Result.RefLoc = Lex.getLoc();
-
- if (isDefm)
- Result.Rec = ParseDefmID();
- else
- Result.Rec = ParseClassID();
- if (Result.Rec == 0) return Result;
-
- // If there is no template arg list, we're done.
- if (Lex.getCode() != tgtok::less)
- return Result;
- Lex.Lex(); // Eat the '<'
-
- if (Lex.getCode() == tgtok::greater) {
- TokError("subclass reference requires a non-empty list of template values");
- Result.Rec = 0;
- return Result;
- }
-
- Result.TemplateArgs = ParseValueList(CurRec);
- if (Result.TemplateArgs.empty()) {
- Result.Rec = 0; // Error parsing value list.
- return Result;
- }
-
- if (Lex.getCode() != tgtok::greater) {
- TokError("expected '>' in template value list");
- Result.Rec = 0;
- return Result;
- }
- Lex.Lex();
-
- return Result;
-}
-
-/// ParseRangePiece - Parse a bit/value range.
-/// RangePiece ::= INTVAL
-/// RangePiece ::= INTVAL '-' INTVAL
-/// RangePiece ::= INTVAL INTVAL
-bool TGParser::ParseRangePiece(std::vector<unsigned> &Ranges) {
- if (Lex.getCode() != tgtok::IntVal) {
- TokError("expected integer or bitrange");
- return true;
- }
- int Start = Lex.getCurIntVal();
- int End;
-
- if (Start < 0)
- return TokError("invalid range, cannot be negative");
-
- switch (Lex.Lex()) { // eat first character.
- default:
- Ranges.push_back(Start);
- return false;
- case tgtok::minus:
- if (Lex.Lex() != tgtok::IntVal) {
- TokError("expected integer value as end of range");
- return true;
- }
- End = Lex.getCurIntVal();
- break;
- case tgtok::IntVal:
- End = -Lex.getCurIntVal();
- break;
- }
- if (End < 0)
- return TokError("invalid range, cannot be negative");
- Lex.Lex();
-
- // Add to the range.
- if (Start < End) {
- for (; Start <= End; ++Start)
- Ranges.push_back(Start);
- } else {
- for (; Start >= End; --Start)
- Ranges.push_back(Start);
- }
- return false;
-}
-
-/// ParseRangeList - Parse a list of scalars and ranges into scalar values.
-///
-/// RangeList ::= RangePiece (',' RangePiece)*
-///
-std::vector<unsigned> TGParser::ParseRangeList() {
- std::vector<unsigned> Result;
-
- // Parse the first piece.
- if (ParseRangePiece(Result))
- return std::vector<unsigned>();
- while (Lex.getCode() == tgtok::comma) {
- Lex.Lex(); // Eat the comma.
-
- // Parse the next range piece.
- if (ParseRangePiece(Result))
- return std::vector<unsigned>();
- }
- return Result;
-}
-
-/// ParseOptionalRangeList - Parse either a range list in <>'s or nothing.
-/// OptionalRangeList ::= '<' RangeList '>'
-/// OptionalRangeList ::= /*empty*/
-bool TGParser::ParseOptionalRangeList(std::vector<unsigned> &Ranges) {
- if (Lex.getCode() != tgtok::less)
- return false;
-
- LocTy StartLoc = Lex.getLoc();
- Lex.Lex(); // eat the '<'
-
- // Parse the range list.
- Ranges = ParseRangeList();
- if (Ranges.empty()) return true;
-
- if (Lex.getCode() != tgtok::greater) {
- TokError("expected '>' at end of range list");
- return Error(StartLoc, "to match this '<'");
- }
- Lex.Lex(); // eat the '>'.
- return false;
-}
-
-/// ParseOptionalBitList - Parse either a bit list in {}'s or nothing.
-/// OptionalBitList ::= '{' RangeList '}'
-/// OptionalBitList ::= /*empty*/
-bool TGParser::ParseOptionalBitList(std::vector<unsigned> &Ranges) {
- if (Lex.getCode() != tgtok::l_brace)
- return false;
-
- LocTy StartLoc = Lex.getLoc();
- Lex.Lex(); // eat the '{'
-
- // Parse the range list.
- Ranges = ParseRangeList();
- if (Ranges.empty()) return true;
-
- if (Lex.getCode() != tgtok::r_brace) {
- TokError("expected '}' at end of bit list");
- return Error(StartLoc, "to match this '{'");
- }
- Lex.Lex(); // eat the '}'.
- return false;
-}
-
-
-/// ParseType - Parse and return a tblgen type. This returns null on error.
-///
-/// Type ::= STRING // string type
-/// Type ::= BIT // bit type
-/// Type ::= BITS '<' INTVAL '>' // bits<x> type
-/// Type ::= INT // int type
-/// Type ::= LIST '<' Type '>' // list<x> type
-/// Type ::= CODE // code type
-/// Type ::= DAG // dag type
-/// Type ::= ClassID // Record Type
-///
-RecTy *TGParser::ParseType() {
- switch (Lex.getCode()) {
- default: TokError("Unknown token when expecting a type"); return 0;
- case tgtok::String: Lex.Lex(); return new StringRecTy();
- case tgtok::Bit: Lex.Lex(); return new BitRecTy();
- case tgtok::Int: Lex.Lex(); return new IntRecTy();
- case tgtok::Code: Lex.Lex(); return new CodeRecTy();
- case tgtok::Dag: Lex.Lex(); return new DagRecTy();
- case tgtok::Id:
- if (Record *R = ParseClassID()) return new RecordRecTy(R);
- return 0;
- case tgtok::Bits: {
- if (Lex.Lex() != tgtok::less) { // Eat 'bits'
- TokError("expected '<' after bits type");
- return 0;
- }
- if (Lex.Lex() != tgtok::IntVal) { // Eat '<'
- TokError("expected integer in bits<n> type");
- return 0;
- }
- unsigned Val = Lex.getCurIntVal();
- if (Lex.Lex() != tgtok::greater) { // Eat count.
- TokError("expected '>' at end of bits<n> type");
- return 0;
- }
- Lex.Lex(); // Eat '>'
- return new BitsRecTy(Val);
- }
- case tgtok::List: {
- if (Lex.Lex() != tgtok::less) { // Eat 'bits'
- TokError("expected '<' after list type");
- return 0;
- }
- Lex.Lex(); // Eat '<'
- RecTy *SubType = ParseType();
- if (SubType == 0) return 0;
-
- if (Lex.getCode() != tgtok::greater) {
- TokError("expected '>' at end of list<ty> type");
- return 0;
- }
- Lex.Lex(); // Eat '>'
- return new ListRecTy(SubType);
- }
- }
-}
-
-/// ParseIDValue - Parse an ID as a value and decode what it means.
-///
-/// IDValue ::= ID [def local value]
-/// IDValue ::= ID [def template arg]
-/// IDValue ::= ID [multiclass local value]
-/// IDValue ::= ID [multiclass template argument]
-/// IDValue ::= ID [def name]
-///
-Init *TGParser::ParseIDValue(Record *CurRec) {
- assert(Lex.getCode() == tgtok::Id && "Expected ID in ParseIDValue");
- std::string Name = Lex.getCurStrVal();
- LocTy Loc = Lex.getLoc();
- Lex.Lex();
- return ParseIDValue(CurRec, Name, Loc);
-}
-
-/// ParseIDValue - This is just like ParseIDValue above, but it assumes the ID
-/// has already been read.
-Init *TGParser::ParseIDValue(Record *CurRec,
- const std::string &Name, LocTy NameLoc) {
- if (CurRec) {
- if (const RecordVal *RV = CurRec->getValue(Name))
- return new VarInit(Name, RV->getType());
-
- std::string TemplateArgName = CurRec->getName()+":"+Name;
- if (CurRec->isTemplateArg(TemplateArgName)) {
- const RecordVal *RV = CurRec->getValue(TemplateArgName);
- assert(RV && "Template arg doesn't exist??");
- return new VarInit(TemplateArgName, RV->getType());
- }
- }
-
- if (CurMultiClass) {
- std::string MCName = CurMultiClass->Rec.getName()+"::"+Name;
- if (CurMultiClass->Rec.isTemplateArg(MCName)) {
- const RecordVal *RV = CurMultiClass->Rec.getValue(MCName);
- assert(RV && "Template arg doesn't exist??");
- return new VarInit(MCName, RV->getType());
- }
- }
-
- if (Record *D = Records.getDef(Name))
- return new DefInit(D);
-
- Error(NameLoc, "Variable not defined: '" + Name + "'");
- return 0;
-}
-
-/// ParseSimpleValue - Parse a tblgen value. This returns null on error.
-///
-/// SimpleValue ::= IDValue
-/// SimpleValue ::= INTVAL
-/// SimpleValue ::= STRVAL
-/// SimpleValue ::= CODEFRAGMENT
-/// SimpleValue ::= '?'
-/// SimpleValue ::= '{' ValueList '}'
-/// SimpleValue ::= ID '<' ValueListNE '>'
-/// SimpleValue ::= '[' ValueList ']'
-/// SimpleValue ::= '(' IDValue DagArgList ')'
-/// SimpleValue ::= CONCATTOK '(' Value ',' Value ')'
-/// SimpleValue ::= SHLTOK '(' Value ',' Value ')'
-/// SimpleValue ::= SRATOK '(' Value ',' Value ')'
-/// SimpleValue ::= SRLTOK '(' Value ',' Value ')'
-/// SimpleValue ::= STRCONCATTOK '(' Value ',' Value ')'
-///
-Init *TGParser::ParseSimpleValue(Record *CurRec) {
- Init *R = 0;
- switch (Lex.getCode()) {
- default: TokError("Unknown token when parsing a value"); break;
- case tgtok::IntVal: R = new IntInit(Lex.getCurIntVal()); Lex.Lex(); break;
- case tgtok::StrVal: R = new StringInit(Lex.getCurStrVal()); Lex.Lex(); break;
- case tgtok::CodeFragment:
- R = new CodeInit(Lex.getCurStrVal()); Lex.Lex(); break;
- case tgtok::question: R = new UnsetInit(); Lex.Lex(); break;
- case tgtok::Id: {
- LocTy NameLoc = Lex.getLoc();
- std::string Name = Lex.getCurStrVal();
- if (Lex.Lex() != tgtok::less) // consume the Id.
- return ParseIDValue(CurRec, Name, NameLoc); // Value ::= IDValue
-
- // Value ::= ID '<' ValueListNE '>'
- if (Lex.Lex() == tgtok::greater) {
- TokError("expected non-empty value list");
- return 0;
- }
- std::vector<Init*> ValueList = ParseValueList(CurRec);
- if (ValueList.empty()) return 0;
-
- if (Lex.getCode() != tgtok::greater) {
- TokError("expected '>' at end of value list");
- return 0;
- }
- Lex.Lex(); // eat the '>'
-
- // This is a CLASS<initvalslist> expression. This is supposed to synthesize
- // a new anonymous definition, deriving from CLASS<initvalslist> with no
- // body.
- Record *Class = Records.getClass(Name);
- if (!Class) {
- Error(NameLoc, "Expected a class name, got '" + Name + "'");
- return 0;
- }
-
- // Create the new record, set it as CurRec temporarily.
- static unsigned AnonCounter = 0;
- Record *NewRec = new Record("anonymous.val."+utostr(AnonCounter++));
- SubClassReference SCRef;
- SCRef.RefLoc = NameLoc;
- SCRef.Rec = Class;
- SCRef.TemplateArgs = ValueList;
- // Add info about the subclass to NewRec.
- if (AddSubClass(NewRec, SCRef))
- return 0;
- NewRec->resolveReferences();
- Records.addDef(NewRec);
-
- // The result of the expression is a reference to the new record.
- return new DefInit(NewRec);
- }
- case tgtok::l_brace: { // Value ::= '{' ValueList '}'
- LocTy BraceLoc = Lex.getLoc();
- Lex.Lex(); // eat the '{'
- std::vector<Init*> Vals;
-
- if (Lex.getCode() != tgtok::r_brace) {
- Vals = ParseValueList(CurRec);
- if (Vals.empty()) return 0;
- }
- if (Lex.getCode() != tgtok::r_brace) {
- TokError("expected '}' at end of bit list value");
- return 0;
- }
- Lex.Lex(); // eat the '}'
-
- BitsInit *Result = new BitsInit(Vals.size());
- for (unsigned i = 0, e = Vals.size(); i != e; ++i) {
- Init *Bit = Vals[i]->convertInitializerTo(new BitRecTy());
- if (Bit == 0) {
- Error(BraceLoc, "Element #" + utostr(i) + " (" + Vals[i]->getAsString()+
- ") is not convertable to a bit");
- return 0;
- }
- Result->setBit(Vals.size()-i-1, Bit);
- }
- return Result;
- }
- case tgtok::l_square: { // Value ::= '[' ValueList ']'
- Lex.Lex(); // eat the '['
- std::vector<Init*> Vals;
-
- if (Lex.getCode() != tgtok::r_square) {
- Vals = ParseValueList(CurRec);
- if (Vals.empty()) return 0;
- }
- if (Lex.getCode() != tgtok::r_square) {
- TokError("expected ']' at end of list value");
- return 0;
- }
- Lex.Lex(); // eat the ']'
- return new ListInit(Vals);
- }
- case tgtok::l_paren: { // Value ::= '(' IDValue DagArgList ')'
- Lex.Lex(); // eat the '('
- if (Lex.getCode() != tgtok::Id) {
- TokError("expected identifier in dag init");
- return 0;
- }
-
- Init *Operator = ParseIDValue(CurRec);
- if (Operator == 0) return 0;
-
- std::vector<std::pair<llvm::Init*, std::string> > DagArgs;
- if (Lex.getCode() != tgtok::r_paren) {
- DagArgs = ParseDagArgList(CurRec);
- if (DagArgs.empty()) return 0;
- }
-
- if (Lex.getCode() != tgtok::r_paren) {
- TokError("expected ')' in dag init");
- return 0;
- }
- Lex.Lex(); // eat the ')'
-
- return new DagInit(Operator, DagArgs);
- }
- case tgtok::XConcat:
- case tgtok::XSRA:
- case tgtok::XSRL:
- case tgtok::XSHL:
- case tgtok::XStrConcat: { // Value ::= !binop '(' Value ',' Value ')'
- BinOpInit::BinaryOp Code;
- switch (Lex.getCode()) {
- default: assert(0 && "Unhandled code!");
- case tgtok::XConcat: Code = BinOpInit::CONCAT; break;
- case tgtok::XSRA: Code = BinOpInit::SRA; break;
- case tgtok::XSRL: Code = BinOpInit::SRL; break;
- case tgtok::XSHL: Code = BinOpInit::SHL; break;
- case tgtok::XStrConcat: Code = BinOpInit::STRCONCAT; break;
- }
- Lex.Lex(); // eat the operation
- if (Lex.getCode() != tgtok::l_paren) {
- TokError("expected '(' after binary operator");
- return 0;
- }
- Lex.Lex(); // eat the '('
-
- Init *LHS = ParseValue(CurRec);
- if (LHS == 0) return 0;
-
- if (Lex.getCode() != tgtok::comma) {
- TokError("expected ',' in binary operator");
- return 0;
- }
- Lex.Lex(); // eat the ','
-
- Init *RHS = ParseValue(CurRec);
- if (RHS == 0) return 0;
-
- if (Lex.getCode() != tgtok::r_paren) {
- TokError("expected ')' in binary operator");
- return 0;
- }
- Lex.Lex(); // eat the ')'
- return (new BinOpInit(Code, LHS, RHS))->Fold();
- }
- }
-
- return R;
-}
-
-/// ParseValue - Parse a tblgen value. This returns null on error.
-///
-/// Value ::= SimpleValue ValueSuffix*
-/// ValueSuffix ::= '{' BitList '}'
-/// ValueSuffix ::= '[' BitList ']'
-/// ValueSuffix ::= '.' ID
-///
-Init *TGParser::ParseValue(Record *CurRec) {
- Init *Result = ParseSimpleValue(CurRec);
- if (Result == 0) return 0;
-
- // Parse the suffixes now if present.
- while (1) {
- switch (Lex.getCode()) {
- default: return Result;
- case tgtok::l_brace: {
- LocTy CurlyLoc = Lex.getLoc();
- Lex.Lex(); // eat the '{'
- std::vector<unsigned> Ranges = ParseRangeList();
- if (Ranges.empty()) return 0;
-
- // Reverse the bitlist.
- std::reverse(Ranges.begin(), Ranges.end());
- Result = Result->convertInitializerBitRange(Ranges);
- if (Result == 0) {
- Error(CurlyLoc, "Invalid bit range for value");
- return 0;
- }
-
- // Eat the '}'.
- if (Lex.getCode() != tgtok::r_brace) {
- TokError("expected '}' at end of bit range list");
- return 0;
- }
- Lex.Lex();
- break;
- }
- case tgtok::l_square: {
- LocTy SquareLoc = Lex.getLoc();
- Lex.Lex(); // eat the '['
- std::vector<unsigned> Ranges = ParseRangeList();
- if (Ranges.empty()) return 0;
-
- Result = Result->convertInitListSlice(Ranges);
- if (Result == 0) {
- Error(SquareLoc, "Invalid range for list slice");
- return 0;
- }
-
- // Eat the ']'.
- if (Lex.getCode() != tgtok::r_square) {
- TokError("expected ']' at end of list slice");
- return 0;
- }
- Lex.Lex();
- break;
- }
- case tgtok::period:
- if (Lex.Lex() != tgtok::Id) { // eat the .
- TokError("expected field identifier after '.'");
- return 0;
- }
- if (!Result->getFieldType(Lex.getCurStrVal())) {
- TokError("Cannot access field '" + Lex.getCurStrVal() + "' of value '" +
- Result->getAsString() + "'");
- return 0;
- }
- Result = new FieldInit(Result, Lex.getCurStrVal());
- Lex.Lex(); // eat field name
- break;
- }
- }
-}
-
-/// ParseDagArgList - Parse the argument list for a dag literal expression.
-///
-/// ParseDagArgList ::= Value (':' VARNAME)?
-/// ParseDagArgList ::= ParseDagArgList ',' Value (':' VARNAME)?
-std::vector<std::pair<llvm::Init*, std::string> >
-TGParser::ParseDagArgList(Record *CurRec) {
- std::vector<std::pair<llvm::Init*, std::string> > Result;
-
- while (1) {
- Init *Val = ParseValue(CurRec);
- if (Val == 0) return std::vector<std::pair<llvm::Init*, std::string> >();
-
- // If the variable name is present, add it.
- std::string VarName;
- if (Lex.getCode() == tgtok::colon) {
- if (Lex.Lex() != tgtok::VarName) { // eat the ':'
- TokError("expected variable name in dag literal");
- return std::vector<std::pair<llvm::Init*, std::string> >();
- }
- VarName = Lex.getCurStrVal();
- Lex.Lex(); // eat the VarName.
- }
-
- Result.push_back(std::make_pair(Val, VarName));
-
- if (Lex.getCode() != tgtok::comma) break;
- Lex.Lex(); // eat the ','
- }
-
- return Result;
-}
-
-
-/// ParseValueList - Parse a comma separated list of values, returning them as a
-/// vector. Note that this always expects to be able to parse at least one
-/// value. It returns an empty list if this is not possible.
-///
-/// ValueList ::= Value (',' Value)
-///
-std::vector<Init*> TGParser::ParseValueList(Record *CurRec) {
- std::vector<Init*> Result;
- Result.push_back(ParseValue(CurRec));
- if (Result.back() == 0) return std::vector<Init*>();
-
- while (Lex.getCode() == tgtok::comma) {
- Lex.Lex(); // Eat the comma
-
- Result.push_back(ParseValue(CurRec));
- if (Result.back() == 0) return std::vector<Init*>();
- }
-
- return Result;
-}
-
-
-
-/// ParseDeclaration - Read a declaration, returning the name of field ID, or an
-/// empty string on error. This can happen in a number of different context's,
-/// including within a def or in the template args for a def (which which case
-/// CurRec will be non-null) and within the template args for a multiclass (in
-/// which case CurRec will be null, but CurMultiClass will be set). This can
-/// also happen within a def that is within a multiclass, which will set both
-/// CurRec and CurMultiClass.
-///
-/// Declaration ::= FIELD? Type ID ('=' Value)?
-///
-std::string TGParser::ParseDeclaration(Record *CurRec,
- bool ParsingTemplateArgs) {
- // Read the field prefix if present.
- bool HasField = Lex.getCode() == tgtok::Field;
- if (HasField) Lex.Lex();
-
- RecTy *Type = ParseType();
- if (Type == 0) return "";
-
- if (Lex.getCode() != tgtok::Id) {
- TokError("Expected identifier in declaration");
- return "";
- }
-
- LocTy IdLoc = Lex.getLoc();
- std::string DeclName = Lex.getCurStrVal();
- Lex.Lex();
-
- if (ParsingTemplateArgs) {
- if (CurRec) {
- DeclName = CurRec->getName() + ":" + DeclName;
- } else {
- assert(CurMultiClass);
- }
- if (CurMultiClass)
- DeclName = CurMultiClass->Rec.getName() + "::" + DeclName;
- }
-
- // Add the value.
- if (AddValue(CurRec, IdLoc, RecordVal(DeclName, Type, HasField)))
- return "";
-
- // If a value is present, parse it.
- if (Lex.getCode() == tgtok::equal) {
- Lex.Lex();
- LocTy ValLoc = Lex.getLoc();
- Init *Val = ParseValue(CurRec);
- if (Val == 0 ||
- SetValue(CurRec, ValLoc, DeclName, std::vector<unsigned>(), Val))
- return "";
- }
-
- return DeclName;
-}
-
-/// ParseTemplateArgList - Read a template argument list, which is a non-empty
-/// sequence of template-declarations in <>'s. If CurRec is non-null, these are
-/// template args for a def, which may or may not be in a multiclass. If null,
-/// these are the template args for a multiclass.
-///
-/// TemplateArgList ::= '<' Declaration (',' Declaration)* '>'
-///
-bool TGParser::ParseTemplateArgList(Record *CurRec) {
- assert(Lex.getCode() == tgtok::less && "Not a template arg list!");
- Lex.Lex(); // eat the '<'
-
- Record *TheRecToAddTo = CurRec ? CurRec : &CurMultiClass->Rec;
-
- // Read the first declaration.
- std::string TemplArg = ParseDeclaration(CurRec, true/*templateargs*/);
- if (TemplArg.empty())
- return true;
-
- TheRecToAddTo->addTemplateArg(TemplArg);
-
- while (Lex.getCode() == tgtok::comma) {
- Lex.Lex(); // eat the ','
-
- // Read the following declarations.
- TemplArg = ParseDeclaration(CurRec, true/*templateargs*/);
- if (TemplArg.empty())
- return true;
- TheRecToAddTo->addTemplateArg(TemplArg);
- }
-
- if (Lex.getCode() != tgtok::greater)
- return TokError("expected '>' at end of template argument list");
- Lex.Lex(); // eat the '>'.
- return false;
-}
-
-
-/// ParseBodyItem - Parse a single item at within the body of a def or class.
-///
-/// BodyItem ::= Declaration ';'
-/// BodyItem ::= LET ID OptionalBitList '=' Value ';'
-bool TGParser::ParseBodyItem(Record *CurRec) {
- if (Lex.getCode() != tgtok::Let) {
- if (ParseDeclaration(CurRec, false).empty())
- return true;
-
- if (Lex.getCode() != tgtok::semi)
- return TokError("expected ';' after declaration");
- Lex.Lex();
- return false;
- }
-
- // LET ID OptionalRangeList '=' Value ';'
- if (Lex.Lex() != tgtok::Id)
- return TokError("expected field identifier after let");
-
- LocTy IdLoc = Lex.getLoc();
- std::string FieldName = Lex.getCurStrVal();
- Lex.Lex(); // eat the field name.
-
- std::vector<unsigned> BitList;
- if (ParseOptionalBitList(BitList))
- return true;
- std::reverse(BitList.begin(), BitList.end());
-
- if (Lex.getCode() != tgtok::equal)
- return TokError("expected '=' in let expression");
- Lex.Lex(); // eat the '='.
-
- Init *Val = ParseValue(CurRec);
- if (Val == 0) return true;
-
- if (Lex.getCode() != tgtok::semi)
- return TokError("expected ';' after let expression");
- Lex.Lex();
-
- return SetValue(CurRec, IdLoc, FieldName, BitList, Val);
-}
-
-/// ParseBody - Read the body of a class or def. Return true on error, false on
-/// success.
-///
-/// Body ::= ';'
-/// Body ::= '{' BodyList '}'
-/// BodyList BodyItem*
-///
-bool TGParser::ParseBody(Record *CurRec) {
- // If this is a null definition, just eat the semi and return.
- if (Lex.getCode() == tgtok::semi) {
- Lex.Lex();
- return false;
- }
-
- if (Lex.getCode() != tgtok::l_brace)
- return TokError("Expected ';' or '{' to start body");
- // Eat the '{'.
- Lex.Lex();
-
- while (Lex.getCode() != tgtok::r_brace)
- if (ParseBodyItem(CurRec))
- return true;
-
- // Eat the '}'.
- Lex.Lex();
- return false;
-}
-
-/// ParseObjectBody - Parse the body of a def or class. This consists of an
-/// optional ClassList followed by a Body. CurRec is the current def or class
-/// that is being parsed.
-///
-/// ObjectBody ::= BaseClassList Body
-/// BaseClassList ::= /*empty*/
-/// BaseClassList ::= ':' BaseClassListNE
-/// BaseClassListNE ::= SubClassRef (',' SubClassRef)*
-///
-bool TGParser::ParseObjectBody(Record *CurRec) {
- // If there is a baseclass list, read it.
- if (Lex.getCode() == tgtok::colon) {
- Lex.Lex();
-
- // Read all of the subclasses.
- SubClassReference SubClass = ParseSubClassReference(CurRec, false);
- while (1) {
- // Check for error.
- if (SubClass.Rec == 0) return true;
-
- // Add it.
- if (AddSubClass(CurRec, SubClass))
- return true;
-
- if (Lex.getCode() != tgtok::comma) break;
- Lex.Lex(); // eat ','.
- SubClass = ParseSubClassReference(CurRec, false);
- }
- }
-
- // Process any variables on the let stack.
- for (unsigned i = 0, e = LetStack.size(); i != e; ++i)
- for (unsigned j = 0, e = LetStack[i].size(); j != e; ++j)
- if (SetValue(CurRec, LetStack[i][j].Loc, LetStack[i][j].Name,
- LetStack[i][j].Bits, LetStack[i][j].Value))
- return true;
-
- return ParseBody(CurRec);
-}
-
-
-/// ParseDef - Parse and return a top level or multiclass def, return the record
-/// corresponding to it. This returns null on error.
-///
-/// DefInst ::= DEF ObjectName ObjectBody
-///
-llvm::Record *TGParser::ParseDef(MultiClass *CurMultiClass) {
- LocTy DefLoc = Lex.getLoc();
- assert(Lex.getCode() == tgtok::Def && "Unknown tok");
- Lex.Lex(); // Eat the 'def' token.
-
- // Parse ObjectName and make a record for it.
- Record *CurRec = new Record(ParseObjectName());
-
- if (!CurMultiClass) {
- // Top-level def definition.
-
- // Ensure redefinition doesn't happen.
- if (Records.getDef(CurRec->getName())) {
- Error(DefLoc, "def '" + CurRec->getName() + "' already defined");
- return 0;
- }
- Records.addDef(CurRec);
- } else {
- // Otherwise, a def inside a multiclass, add it to the multiclass.
- for (unsigned i = 0, e = CurMultiClass->DefPrototypes.size(); i != e; ++i)
- if (CurMultiClass->DefPrototypes[i]->getName() == CurRec->getName()) {
- Error(DefLoc, "def '" + CurRec->getName() +
- "' already defined in this multiclass!");
- return 0;
- }
- CurMultiClass->DefPrototypes.push_back(CurRec);
- }
-
- if (ParseObjectBody(CurRec))
- return 0;
-
- if (CurMultiClass == 0) // Def's in multiclasses aren't really defs.
- CurRec->resolveReferences();
-
- // If ObjectBody has template arguments, it's an error.
- assert(CurRec->getTemplateArgs().empty() && "How'd this get template args?");
- return CurRec;
-}
-
-
-/// ParseClass - Parse a tblgen class definition.
-///
-/// ClassInst ::= CLASS ID TemplateArgList? ObjectBody
-///
-bool TGParser::ParseClass() {
- assert(Lex.getCode() == tgtok::Class && "Unexpected token!");
- Lex.Lex();
-
- if (Lex.getCode() != tgtok::Id)
- return TokError("expected class name after 'class' keyword");
-
- Record *CurRec = Records.getClass(Lex.getCurStrVal());
- if (CurRec) {
- // If the body was previously defined, this is an error.
- if (!CurRec->getValues().empty() ||
- !CurRec->getSuperClasses().empty() ||
- !CurRec->getTemplateArgs().empty())
- return TokError("Class '" + CurRec->getName() + "' already defined");
- } else {
- // If this is the first reference to this class, create and add it.
- CurRec = new Record(Lex.getCurStrVal());
- Records.addClass(CurRec);
- }
- Lex.Lex(); // eat the name.
-
- // If there are template args, parse them.
- if (Lex.getCode() == tgtok::less)
- if (ParseTemplateArgList(CurRec))
- return true;
-
- // Finally, parse the object body.
- return ParseObjectBody(CurRec);
-}
-
-/// ParseLetList - Parse a non-empty list of assignment expressions into a list
-/// of LetRecords.
-///
-/// LetList ::= LetItem (',' LetItem)*
-/// LetItem ::= ID OptionalRangeList '=' Value
-///
-std::vector<LetRecord> TGParser::ParseLetList() {
- std::vector<LetRecord> Result;
-
- while (1) {
- if (Lex.getCode() != tgtok::Id) {
- TokError("expected identifier in let definition");
- return std::vector<LetRecord>();
- }
- std::string Name = Lex.getCurStrVal();
- LocTy NameLoc = Lex.getLoc();
- Lex.Lex(); // Eat the identifier.
-
- // Check for an optional RangeList.
- std::vector<unsigned> Bits;
- if (ParseOptionalRangeList(Bits))
- return std::vector<LetRecord>();
- std::reverse(Bits.begin(), Bits.end());
-
- if (Lex.getCode() != tgtok::equal) {
- TokError("expected '=' in let expression");
- return std::vector<LetRecord>();
- }
- Lex.Lex(); // eat the '='.
-
- Init *Val = ParseValue(0);
- if (Val == 0) return std::vector<LetRecord>();
-
- // Now that we have everything, add the record.
- Result.push_back(LetRecord(Name, Bits, Val, NameLoc));
-
- if (Lex.getCode() != tgtok::comma)
- return Result;
- Lex.Lex(); // eat the comma.
- }
-}
-
-/// ParseTopLevelLet - Parse a 'let' at top level. This can be a couple of
-/// different related productions.
-///
-/// Object ::= LET LetList IN '{' ObjectList '}'
-/// Object ::= LET LetList IN Object
-///
-bool TGParser::ParseTopLevelLet() {
- assert(Lex.getCode() == tgtok::Let && "Unexpected token");
- Lex.Lex();
-
- // Add this entry to the let stack.
- std::vector<LetRecord> LetInfo = ParseLetList();
- if (LetInfo.empty()) return true;
- LetStack.push_back(LetInfo);
-
- if (Lex.getCode() != tgtok::In)
- return TokError("expected 'in' at end of top-level 'let'");
- Lex.Lex();
-
- // If this is a scalar let, just handle it now
- if (Lex.getCode() != tgtok::l_brace) {
- // LET LetList IN Object
- if (ParseObject())
- return true;
- } else { // Object ::= LETCommand '{' ObjectList '}'
- LocTy BraceLoc = Lex.getLoc();
- // Otherwise, this is a group let.
- Lex.Lex(); // eat the '{'.
-
- // Parse the object list.
- if (ParseObjectList())
- return true;
-
- if (Lex.getCode() != tgtok::r_brace) {
- TokError("expected '}' at end of top level let command");
- return Error(BraceLoc, "to match this '{'");
- }
- Lex.Lex();
- }
-
- // Outside this let scope, this let block is not active.
- LetStack.pop_back();
- return false;
-}
-
-/// ParseMultiClassDef - Parse a def in a multiclass context.
-///
-/// MultiClassDef ::= DefInst
-///
-bool TGParser::ParseMultiClassDef(MultiClass *CurMC) {
- if (Lex.getCode() != tgtok::Def)
- return TokError("expected 'def' in multiclass body");
-
- Record *D = ParseDef(CurMC);
- if (D == 0) return true;
-
- // Copy the template arguments for the multiclass into the def.
- const std::vector<std::string> &TArgs = CurMC->Rec.getTemplateArgs();
-
- for (unsigned i = 0, e = TArgs.size(); i != e; ++i) {
- const RecordVal *RV = CurMC->Rec.getValue(TArgs[i]);
- assert(RV && "Template arg doesn't exist?");
- D->addValue(*RV);
- }
-
- return false;
-}
-
-/// ParseMultiClass - Parse a multiclass definition.
-///
-/// MultiClassInst ::= MULTICLASS ID TemplateArgList? '{' MultiClassDef+ '}'
-///
-bool TGParser::ParseMultiClass() {
- assert(Lex.getCode() == tgtok::MultiClass && "Unexpected token");
- Lex.Lex(); // Eat the multiclass token.
-
- if (Lex.getCode() != tgtok::Id)
- return TokError("expected identifier after multiclass for name");
- std::string Name = Lex.getCurStrVal();
-
- if (MultiClasses.count(Name))
- return TokError("multiclass '" + Name + "' already defined");
-
- CurMultiClass = MultiClasses[Name] = new MultiClass(Name);
- Lex.Lex(); // Eat the identifier.
-
- // If there are template args, parse them.
- if (Lex.getCode() == tgtok::less)
- if (ParseTemplateArgList(0))
- return true;
-
- if (Lex.getCode() != tgtok::l_brace)
- return TokError("expected '{' in multiclass definition");
-
- if (Lex.Lex() == tgtok::r_brace) // eat the '{'.
- return TokError("multiclass must contain at least one def");
-
- while (Lex.getCode() != tgtok::r_brace)
- if (ParseMultiClassDef(CurMultiClass))
- return true;
-
- Lex.Lex(); // eat the '}'.
-
- CurMultiClass = 0;
- return false;
-}
-
-/// ParseDefm - Parse the instantiation of a multiclass.
-///
-/// DefMInst ::= DEFM ID ':' DefmSubClassRef ';'
-///
-bool TGParser::ParseDefm() {
- assert(Lex.getCode() == tgtok::Defm && "Unexpected token!");
- if (Lex.Lex() != tgtok::Id) // eat the defm.
- return TokError("expected identifier after defm");
-
- LocTy DefmPrefixLoc = Lex.getLoc();
- std::string DefmPrefix = Lex.getCurStrVal();
- if (Lex.Lex() != tgtok::colon)
- return TokError("expected ':' after defm identifier");
-
- // eat the colon.
- Lex.Lex();
-
- LocTy SubClassLoc = Lex.getLoc();
- SubClassReference Ref = ParseSubClassReference(0, true);
- if (Ref.Rec == 0) return true;
-
- if (Lex.getCode() != tgtok::semi)
- return TokError("expected ';' at end of defm");
- Lex.Lex();
-
- // To instantiate a multiclass, we need to first get the multiclass, then
- // instantiate each def contained in the multiclass with the SubClassRef
- // template parameters.
- MultiClass *MC = MultiClasses[Ref.Rec->getName()];
- assert(MC && "Didn't lookup multiclass correctly?");
- std::vector<Init*> &TemplateVals = Ref.TemplateArgs;
-
- // Verify that the correct number of template arguments were specified.
- const std::vector<std::string> &TArgs = MC->Rec.getTemplateArgs();
- if (TArgs.size() < TemplateVals.size())
- return Error(SubClassLoc,
- "more template args specified than multiclass expects");
-
- // Loop over all the def's in the multiclass, instantiating each one.
- for (unsigned i = 0, e = MC->DefPrototypes.size(); i != e; ++i) {
- Record *DefProto = MC->DefPrototypes[i];
-
- // Add the suffix to the defm name to get the new name.
- Record *CurRec = new Record(DefmPrefix + DefProto->getName());
-
- SubClassReference Ref;
- Ref.RefLoc = DefmPrefixLoc;
- Ref.Rec = DefProto;
- AddSubClass(CurRec, Ref);
-
- // Loop over all of the template arguments, setting them to the specified
- // value or leaving them as the default if necessary.
- for (unsigned i = 0, e = TArgs.size(); i != e; ++i) {
- if (i < TemplateVals.size()) { // A value is specified for this temp-arg?
- // Set it now.
- if (SetValue(CurRec, DefmPrefixLoc, TArgs[i], std::vector<unsigned>(),
- TemplateVals[i]))
- return true;
-
- // Resolve it next.
- CurRec->resolveReferencesTo(CurRec->getValue(TArgs[i]));
-
- // Now remove it.
- CurRec->removeValue(TArgs[i]);
-
- } else if (!CurRec->getValue(TArgs[i])->getValue()->isComplete()) {
- return Error(SubClassLoc, "value not specified for template argument #"+
- utostr(i) + " (" + TArgs[i] + ") of multiclassclass '" +
- MC->Rec.getName() + "'");
- }
- }
-
- // If the mdef is inside a 'let' expression, add to each def.
- for (unsigned i = 0, e = LetStack.size(); i != e; ++i)
- for (unsigned j = 0, e = LetStack[i].size(); j != e; ++j)
- if (SetValue(CurRec, LetStack[i][j].Loc, LetStack[i][j].Name,
- LetStack[i][j].Bits, LetStack[i][j].Value)) {
- Error(DefmPrefixLoc, "when instantiating this defm");
- return true;
- }
-
-
- // Ensure redefinition doesn't happen.
- if (Records.getDef(CurRec->getName()))
- return Error(DefmPrefixLoc, "def '" + CurRec->getName() +
- "' already defined, instantiating defm with subdef '" +
- DefProto->getName() + "'");
- Records.addDef(CurRec);
- CurRec->resolveReferences();
- }
-
- return false;
-}
-
-/// ParseObject
-/// Object ::= ClassInst
-/// Object ::= DefInst
-/// Object ::= MultiClassInst
-/// Object ::= DefMInst
-/// Object ::= LETCommand '{' ObjectList '}'
-/// Object ::= LETCommand Object
-bool TGParser::ParseObject() {
- switch (Lex.getCode()) {
- default: assert(0 && "This is not an object");
- case tgtok::Let: return ParseTopLevelLet();
- case tgtok::Def: return ParseDef(0) == 0;
- case tgtok::Defm: return ParseDefm();
- case tgtok::Class: return ParseClass();
- case tgtok::MultiClass: return ParseMultiClass();
- }
-}
-
-/// ParseObjectList
-/// ObjectList :== Object*
-bool TGParser::ParseObjectList() {
- while (isObjectStart(Lex.getCode())) {
- if (ParseObject())
- return true;
- }
- return false;
-}
-
-
-bool TGParser::ParseFile() {
- Lex.Lex(); // Prime the lexer.
- if (ParseObjectList()) return true;
-
- // If we have unread input at the end of the file, report it.
- if (Lex.getCode() == tgtok::Eof)
- return false;
-
- return TokError("Unexpected input at top level");
-}
-
diff --git a/release_23/utils/TableGen/TGParser.h b/release_23/utils/TableGen/TGParser.h
deleted file mode 100644
index a5435afacf29..000000000000
--- a/release_23/utils/TableGen/TGParser.h
+++ /dev/null
@@ -1,109 +0,0 @@
-//===- TGParser.h - Parser for TableGen Files -------------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This class represents the Parser for tablegen files.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef TGPARSER_H
-#define TGPARSER_H
-
-#include "TGLexer.h"
-#include <map>
-
-namespace llvm {
- class Record;
- class RecordVal;
- class RecTy;
- class Init;
- struct MultiClass;
- struct SubClassReference;
-
- struct LetRecord {
- std::string Name;
- std::vector<unsigned> Bits;
- Init *Value;
- TGLexer::LocTy Loc;
- LetRecord(const std::string &N, const std::vector<unsigned> &B, Init *V,
- TGLexer::LocTy L)
- : Name(N), Bits(B), Value(V), Loc(L) {
- }
- };
-
-class TGParser {
- TGLexer Lex;
- std::vector<std::vector<LetRecord> > LetStack;
- std::map<std::string, MultiClass*> MultiClasses;
-
- /// CurMultiClass - If we are parsing a 'multiclass' definition, this is the
- /// current value.
- MultiClass *CurMultiClass;
-public:
- typedef TGLexer::LocTy LocTy;
-
- TGParser(MemoryBuffer *StartBuf) : Lex(StartBuf), CurMultiClass(0) {}
-
- void setIncludeDirs(const std::vector<std::string> &D){Lex.setIncludeDirs(D);}
-
- /// ParseFile - Main entrypoint for parsing a tblgen file. These parser
- /// routines return true on error, or false on success.
- bool ParseFile();
-
- bool Error(LocTy L, const std::string &Msg) const {
- Lex.PrintError(L, Msg);
- return true;
- }
- bool TokError(const std::string &Msg) const {
- return Error(Lex.getLoc(), Msg);
- }
-private: // Semantic analysis methods.
- bool AddValue(Record *TheRec, LocTy Loc, const RecordVal &RV);
- bool SetValue(Record *TheRec, LocTy Loc, const std::string &ValName,
- const std::vector<unsigned> &BitList, Init *V);
- bool AddSubClass(Record *Rec, class SubClassReference &SubClass);
-
-private: // Parser methods.
- bool ParseObjectList();
- bool ParseObject();
- bool ParseClass();
- bool ParseMultiClass();
- bool ParseMultiClassDef(MultiClass *CurMC);
- bool ParseDefm();
- bool ParseTopLevelLet();
- std::vector<LetRecord> ParseLetList();
-
- Record *ParseDef(MultiClass *CurMultiClass);
- bool ParseObjectBody(Record *CurRec);
- bool ParseBody(Record *CurRec);
- bool ParseBodyItem(Record *CurRec);
-
- bool ParseTemplateArgList(Record *CurRec);
- std::string ParseDeclaration(Record *CurRec, bool ParsingTemplateArgs);
-
- SubClassReference ParseSubClassReference(Record *CurRec, bool isDefm);
-
- Init *ParseIDValue(Record *CurRec);
- Init *ParseIDValue(Record *CurRec, const std::string &Name, LocTy NameLoc);
- Init *ParseSimpleValue(Record *CurRec);
- Init *ParseValue(Record *CurRec);
- std::vector<Init*> ParseValueList(Record *CurRec);
- std::vector<std::pair<llvm::Init*, std::string> > ParseDagArgList(Record *);
- bool ParseOptionalRangeList(std::vector<unsigned> &Ranges);
- bool ParseOptionalBitList(std::vector<unsigned> &Ranges);
- std::vector<unsigned> ParseRangeList();
- bool ParseRangePiece(std::vector<unsigned> &Ranges);
- RecTy *ParseType();
- std::string ParseObjectName();
- Record *ParseClassID();
- Record *ParseDefmID();
-};
-
-} // end namespace llvm
-
-#endif
diff --git a/release_23/utils/TableGen/TableGen.cpp b/release_23/utils/TableGen/TableGen.cpp
deleted file mode 100644
index 64b2f97dc306..000000000000
--- a/release_23/utils/TableGen/TableGen.cpp
+++ /dev/null
@@ -1,221 +0,0 @@
-//===- TableGen.cpp - Top-Level TableGen implementation -------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// TableGen is a tool which can be used to build up a description of something,
-// then invoke one or more "tablegen backends" to emit information about the
-// description in some predefined format. In practice, this is used by the LLVM
-// code generators to automate generation of a code generator through a
-// high-level description of the target.
-//
-//===----------------------------------------------------------------------===//
-
-#include "Record.h"
-#include "TGParser.h"
-#include "llvm/Support/CommandLine.h"
-#include "llvm/Support/Streams.h"
-#include "llvm/System/Signals.h"
-#include "llvm/Support/FileUtilities.h"
-#include "llvm/Support/MemoryBuffer.h"
-#include "CallingConvEmitter.h"
-#include "CodeEmitterGen.h"
-#include "RegisterInfoEmitter.h"
-#include "InstrInfoEmitter.h"
-#include "InstrEnumEmitter.h"
-#include "AsmWriterEmitter.h"
-#include "DAGISelEmitter.h"
-#include "SubtargetEmitter.h"
-#include "IntrinsicEmitter.h"
-#include "LLVMCConfigurationEmitter.h"
-#include <algorithm>
-#include <cstdio>
-#include <fstream>
-#include <ios>
-using namespace llvm;
-
-enum ActionType {
- PrintRecords,
- GenEmitter,
- GenRegisterEnums, GenRegister, GenRegisterHeader,
- GenInstrEnums, GenInstrs, GenAsmWriter,
- GenCallingConv,
- GenDAGISel,
- GenSubtarget,
- GenIntrinsic,
- GenLLVMCConf,
- PrintEnums
-};
-
-namespace {
- cl::opt<ActionType>
- Action(cl::desc("Action to perform:"),
- cl::values(clEnumValN(PrintRecords, "print-records",
- "Print all records to stdout (default)"),
- clEnumValN(GenEmitter, "gen-emitter",
- "Generate machine code emitter"),
- clEnumValN(GenRegisterEnums, "gen-register-enums",
- "Generate enum values for registers"),
- clEnumValN(GenRegister, "gen-register-desc",
- "Generate a register info description"),
- clEnumValN(GenRegisterHeader, "gen-register-desc-header",
- "Generate a register info description header"),
- clEnumValN(GenInstrEnums, "gen-instr-enums",
- "Generate enum values for instructions"),
- clEnumValN(GenInstrs, "gen-instr-desc",
- "Generate instruction descriptions"),
- clEnumValN(GenCallingConv, "gen-callingconv",
- "Generate calling convention descriptions"),
- clEnumValN(GenAsmWriter, "gen-asm-writer",
- "Generate assembly writer"),
- clEnumValN(GenDAGISel, "gen-dag-isel",
- "Generate a DAG instruction selector"),
- clEnumValN(GenSubtarget, "gen-subtarget",
- "Generate subtarget enumerations"),
- clEnumValN(GenIntrinsic, "gen-intrinsic",
- "Generate intrinsic information"),
- clEnumValN(GenLLVMCConf, "gen-llvmc",
- "Generate LLVMC configuration library"),
- clEnumValN(PrintEnums, "print-enums",
- "Print enum values for a class"),
- clEnumValEnd));
-
- cl::opt<std::string>
- Class("class", cl::desc("Print Enum list for this class"),
- cl::value_desc("class name"));
-
- cl::opt<std::string>
- OutputFilename("o", cl::desc("Output filename"), cl::value_desc("filename"),
- cl::init("-"));
-
- cl::opt<std::string>
- InputFilename(cl::Positional, cl::desc("<input file>"), cl::init("-"));
-
- cl::list<std::string>
- IncludeDirs("I", cl::desc("Directory of include files"),
- cl::value_desc("directory"), cl::Prefix);
-}
-
-RecordKeeper llvm::Records;
-
-/// ParseFile - this function begins the parsing of the specified tablegen
-/// file.
-static bool ParseFile(const std::string &Filename,
- const std::vector<std::string> &IncludeDirs) {
- std::string ErrorStr;
- MemoryBuffer *F = MemoryBuffer::getFileOrSTDIN(Filename.c_str(), &ErrorStr);
- if (F == 0) {
- cerr << "Could not open input file '" + Filename + "': " << ErrorStr <<"\n";
- return true;
- }
-
- TGParser Parser(F);
-
- // Record the location of the include directory so that the lexer can find
- // it later.
- Parser.setIncludeDirs(IncludeDirs);
-
- return Parser.ParseFile();
-}
-
-int main(int argc, char **argv) {
- cl::ParseCommandLineOptions(argc, argv);
-
- // Parse the input file.
- if (ParseFile(InputFilename, IncludeDirs))
- return 1;
-
- std::ostream *Out = cout.stream();
- if (OutputFilename != "-") {
- Out = new std::ofstream(OutputFilename.c_str());
-
- if (!Out->good()) {
- cerr << argv[0] << ": error opening " << OutputFilename << "!\n";
- return 1;
- }
-
- // Make sure the file gets removed if *gasp* tablegen crashes...
- sys::RemoveFileOnSignal(sys::Path(OutputFilename));
- }
-
- try {
- switch (Action) {
- case PrintRecords:
- *Out << Records; // No argument, dump all contents
- break;
- case GenEmitter:
- CodeEmitterGen(Records).run(*Out);
- break;
-
- case GenRegisterEnums:
- RegisterInfoEmitter(Records).runEnums(*Out);
- break;
- case GenRegister:
- RegisterInfoEmitter(Records).run(*Out);
- break;
- case GenRegisterHeader:
- RegisterInfoEmitter(Records).runHeader(*Out);
- break;
-
- case GenInstrEnums:
- InstrEnumEmitter(Records).run(*Out);
- break;
- case GenInstrs:
- InstrInfoEmitter(Records).run(*Out);
- break;
- case GenCallingConv:
- CallingConvEmitter(Records).run(*Out);
- break;
- case GenAsmWriter:
- AsmWriterEmitter(Records).run(*Out);
- break;
-
- case GenDAGISel:
- DAGISelEmitter(Records).run(*Out);
- break;
- case GenSubtarget:
- SubtargetEmitter(Records).run(*Out);
- break;
- case GenIntrinsic:
- IntrinsicEmitter(Records).run(*Out);
- break;
- case GenLLVMCConf:
- LLVMCConfigurationEmitter(Records).run(*Out);
- break;
- case PrintEnums:
- {
- std::vector<Record*> Recs = Records.getAllDerivedDefinitions(Class);
- for (unsigned i = 0, e = Recs.size(); i != e; ++i)
- *Out << Recs[i]->getName() << ", ";
- *Out << "\n";
- break;
- }
- default:
- assert(1 && "Invalid Action");
- return 1;
- }
- } catch (const std::string &Error) {
- cerr << argv[0] << ": " << Error << "\n";
- if (Out != cout.stream()) {
- delete Out; // Close the file
- std::remove(OutputFilename.c_str()); // Remove the file, it's broken
- }
- return 1;
- } catch (...) {
- cerr << argv[0] << ": Unknown unexpected exception occurred.\n";
- if (Out != cout.stream()) {
- delete Out; // Close the file
- std::remove(OutputFilename.c_str()); // Remove the file, it's broken
- }
- return 2;
- }
-
- if (Out != cout.stream()) {
- delete Out; // Close the file
- }
- return 0;
-}
diff --git a/release_23/utils/TableGen/TableGenBackend.cpp b/release_23/utils/TableGen/TableGenBackend.cpp
deleted file mode 100644
index 87a1b3da1196..000000000000
--- a/release_23/utils/TableGen/TableGenBackend.cpp
+++ /dev/null
@@ -1,25 +0,0 @@
-//===- TableGenBackend.cpp - Base class for TableGen Backends ---*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file provides useful services for TableGen backends...
-//
-//===----------------------------------------------------------------------===//
-
-#include "TableGenBackend.h"
-#include "Record.h"
-using namespace llvm;
-
-void TableGenBackend::EmitSourceFileHeader(const std::string &Desc,
- std::ostream &OS) const {
- OS << "//===- TableGen'erated file -------------------------------------*-"
- " C++ -*-===//\n//\n// " << Desc << "\n//\n// Automatically generate"
- "d file, do not edit!\n//\n//===------------------------------------"
- "----------------------------------===//\n\n";
-}
-
diff --git a/release_23/utils/TableGen/TableGenBackend.h b/release_23/utils/TableGen/TableGenBackend.h
deleted file mode 100644
index 109bc9f9ae8d..000000000000
--- a/release_23/utils/TableGen/TableGenBackend.h
+++ /dev/null
@@ -1,43 +0,0 @@
-//===- TableGenBackend.h - Base class for TableGen Backends -----*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// The TableGenBackend class is provided as a common interface for all TableGen
-// backends. It provides useful services and an standardized interface.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef TABLEGENBACKEND_H
-#define TABLEGENBACKEND_H
-
-#include <string>
-#include <iosfwd>
-
-namespace llvm {
-
-class Record;
-class RecordKeeper;
-
-struct TableGenBackend {
- virtual ~TableGenBackend() {}
-
- // run - All TableGen backends should implement the run method, which should
- // be the main entry point.
- virtual void run(std::ostream &OS) = 0;
-
-
-public: // Useful helper routines...
- /// EmitSourceFileHeader - Output a LLVM style file header to the specified
- /// ostream.
- void EmitSourceFileHeader(const std::string &Desc, std::ostream &OS) const;
-
-};
-
-} // End llvm namespace
-
-#endif
diff --git a/release_23/utils/buildit/GNUmakefile b/release_23/utils/buildit/GNUmakefile
deleted file mode 100644
index 6e5131254cb0..000000000000
--- a/release_23/utils/buildit/GNUmakefile
+++ /dev/null
@@ -1,115 +0,0 @@
-# LLVM LOCAL file build machinery
-# LLVM Compiler Makefile for use by buildit.
-#
-# This makefile is intended only for use with B&I buildit. For "normal" builds
-# use the conventional top-level makefile.
-#
-# You can specify TARGETS=ppc (or i386) on the buildit command line to limit the
-# build to just one target. The default is for ppc and i386. The compiler
-# targetted at this host gets built anyway, but not installed unless it's listed
-# in TARGETS.
-
-# Include the set of standard Apple makefile definitions.
-ifndef CoreOSMakefiles
-CoreOSMakefiles = $(MAKEFILEPATH)/CoreOS
-endif
-include $(CoreOSMakefiles)/Standard/Standard.make
-
-# Enable Apple extensions to (gnu)make.
-USE_APPLE_PB_SUPPORT = all
-
-RC_ARCHS := ppc i386
-HOSTS = $(RC_ARCHS)
-targets = echo $(RC_ARCHS)
-TARGETS := $(shell $(targets))
-
-SRCROOT = .
-
-SRC = $(shell cd $(SRCROOT) && pwd | sed s,/private,,)
-OBJROOT = $(SRC)/obj
-SYMROOT = $(OBJROOT)/../sym
-DSTROOT = $(OBJROOT)/../dst
-
-#######################################################################
-
-PREFIX = /usr/local
-
-# Unless assertions are forced on in the GMAKE command line, disable them.
-ifdef ENABLE_ASSERTIONS
-LLVM_ASSERTIONS := yes
-else
-LLVM_ASSERTIONS := no
-endif
-
-# Default is optimized build.
-ifeq ($(LLVM_DEBUG),1)
-LLVM_OPTIMIZED := no
-else
-LLVM_OPTIMIZED := yes
-endif
-
-ifndef RC_ProjectSourceVersion
-RC_ProjectSourceVersion = 9999
-endif
-
-ifndef RC_ProjectSourceSubversion
-RC_ProjectSourceSubversion = 0
-endif
-
-# NOTE : Always put version numbers at the end because they are optional.
-install: $(OBJROOT) $(SYMROOT) $(DSTROOT)
- cd $(OBJROOT) && \
- $(SRC)/build_llvm "$(RC_ARCHS)" "$(TARGETS)" \
- $(SRC) $(PREFIX) $(DSTROOT) $(SYMROOT) \
- $(LLVM_ASSERTIONS) $(LLVM_OPTIMIZED) \
- $(RC_ProjectSourceVersion) $(RC_ProjectSourceSubversion)
-
-
-# installhdrs does nothing, because the headers aren't useful until
-# the compiler is installed.
-installhdrs:
-
-# We build and install in one shell script.
-build:
-
-installsrc:
- @echo
- @echo ++++++++++++++++++++++
- @echo + Installing sources +
- @echo ++++++++++++++++++++++
- @echo
- if [ $(SRCROOT) != . ]; then \
- $(PAX) -rw . $(SRCROOT); \
- fi
- find -d "$(SRCROOT)" \( -type d -a -name .svn -o \
- -type f -a -name .DS_Store -o \
- -name \*~ -o -name .\#\* \) \
- -exec rm -rf {} \;
-
-#######################################################################
-
-clean:
- @echo
- @echo ++++++++++++
- @echo + Cleaning +
- @echo ++++++++++++
- @echo
- @if [ -d $(OBJROOT) -a "$(OBJROOT)" != / ]; then \
- echo '*** DELETING ' $(OBJROOT); \
- rm -rf $(OBJROOT); \
- fi
- @if [ -d $(SYMROOT) -a "$(SYMROOT)" != / ]; then \
- echo '*** DELETING ' $(SYMROOT); \
- rm -rf $(SYMROOT); \
- fi
- @if [ -d $(DSTROOT) -a "$(DSTROOT)" != / ]; then \
- echo '*** DELETING ' $(DSTROOT); \
- rm -rf $(DSTROOT); \
- fi
-
-#######################################################################
-
-$(OBJROOT) $(SYMROOT) $(DSTROOT):
- mkdir -p $@
-
-.PHONY: install installsrc clean
diff --git a/release_23/utils/buildit/build_llvm b/release_23/utils/buildit/build_llvm
deleted file mode 100755
index 6ccff46ba890..000000000000
--- a/release_23/utils/buildit/build_llvm
+++ /dev/null
@@ -1,245 +0,0 @@
-#!/bin/sh
-# LLVM LOCAL file B&I
-
-set -x
-
-# Build LLVM the "Apple way".
-# Parameters:
-
-# The first parameter is a space-separated list of the architectures the
-# compilers will run on. For instance, "ppc i386". If the current machine
-# isn't in the list, it will (effectively) be added.
-# FIXME: HOSTS is not used in this script. Use it or Remove it.
-HOSTS="$1"
-
-# The second parameter is a space-separated list of the architectures the
-# compilers will generate code for. If the current machine isn't in the list, a
-# compiler for it will get built anyway, but won't be installed.
-TARGETS="$2"
-
-# The third parameter is the path to the compiler sources. There should be a
-# shell script named 'configure' in this directory. This script makes a copy...
-ORIG_SRC_DIR="$3"
-
-# The fourth parameter is the location where the LLVM will be installed. You can
-# move it once it's built, so this mostly controls the layout of $DEST_DIR.
-DEST_ROOT="$4"
-
-# The fifth parameter is the place where the compiler will be copied once it's
-# built.
-DEST_DIR="$5"
-
-# The sixth parameter is a directory in which to place information (like
-# unstripped executables and generated source files) helpful in debugging the
-# resulting compiler.
-SYM_DIR="$6"
-
-# The seventh parameter is a yes/no that indicates whether assertions should be
-# enabled in the LLVM libs/tools.
-LLVM_ASSERTIONS="$7"
-
-# The eighth parameter is a yes/no that indicates whether this is an optimized
-# build.
-LLVM_OPTIMIZED="$8"
-
-# The nineth parameter is the version number of the submission, e.g. 1007.
-LLVM_SUBMIT_VERSION="$9"
-
-# The tenth parameter is the subversion number of the submission, e.g. 03.
-LLVM_SUBMIT_SUBVERSION="${10}"
-
-# The current working directory is where the build will happen. It may already
-# contain a partial result of an interrupted build, in which case this script
-# will continue where it left off.
-DIR=`pwd`
-
-DARWIN_VERS=`uname -r | sed 's/\..*//'`
-echo DARWIN_VERS = $DARWIN_VERS
-
-# If the user has CC set in their environment unset it now
-unset CC
-
-DT_HOME=$DEST_DIR/Developer/usr
-DEST_ROOT="/Developer$DEST_ROOT"
-if [ "x$DEVELOPER_BIN" != "x" ]; then
- DT_HOME=$DEST_DIR/$DEVELOPER_DIR/usr
- DEST_ROOT="/$DEVELOPER_DIR$DEST_ROOT"
-fi
-
-################################################################################
-# Run the build.
-
-# Create the source tree we'll actually use to build, deleting
-# tcl since it doesn't actually build properly in a cross environment
-# and we don't really need it.
-SRC_DIR=$DIR/src
-rm -rf $SRC_DIR || exit 1
-mkdir $SRC_DIR || exit 1
-ln -s $ORIG_SRC_DIR/* $SRC_DIR/ || exit 1
-
-# Build the LLVM tree universal.
-mkdir -p $DIR/obj-llvm || exit 1
-cd $DIR/obj-llvm || exit 1
-
-if [ \! -f Makefile.config ]; then
- $SRC_DIR/llvm/configure --prefix=$DT_HOME/local \
- --enable-targets=x86,powerpc,cbe \
- --enable-assertions=$LLVM_ASSERTIONS \
- --enable-optimized=$LLVM_OPTIMIZED \
- || exit 1
-fi
-
-if [ "x$LLVM_SUBMIT_SUBVERSION" = "x00" -o "x$LLVM_SUBMIT_SUBVERSION" = "x0" ]; then
- LLVM_VERSION="$LLVM_SUBMIT_VERSION"
-else
- LLVM_VERSION="$LLVM_SUBMIT_VERSION-$LLVM_SUBMIT_SUBVERSION"
-fi
-
-GCC_VER=`cc --version 2>/dev/null | sed 1q`
-
-if echo "$GCC_VER" | grep GCC > /dev/null; then
- GCC_VER=`echo $GCC_VER | sed -e 's/.*(GCC) \([0-9.][0-9.]*\).*/\1/'`
- MAJ_VER=`echo $GCC_VER | sed 's/\..*//'`
- MIN_VER=`echo $GCC_VER | sed 's/[^.]*\.\([0-9]*\).*/\1/'`
-fi
-
-JOBS_FLAG=""
-
-# Note: If compiling with GCC 4.0, don't pass the -jN flag. Building universal
-# already has parallelism and we don't want to make the builders hit swap by
-# firing off too many gccs at the same time.
-if [ "x$MAJ_VER" != "x4" -o "x$MIN_VER" != "x0" ]; then
- # Figure out how many make processes to run.
- SYSCTL=`sysctl -n hw.activecpu`
-
- # hw.activecpu only available in 10.2.6 and later
- if [ -z "$SYSCTL" ]; then
- SYSCTL=`sysctl -n hw.ncpu`
- fi
-
- # sysctl -n hw.* does not work when invoked via B&I chroot /BuildRoot.
- # Builders can default to 2, since even if they are single processor,
- # nothing else is running on the machine.
- if [ -z "$SYSCTL" ]; then
- SYSCTL=2
- fi
-
- JOBS_FLAG="-j $SYSCTL"
-fi
-
-make $JOBS_FLAG $OPTIMIZE_OPTS UNIVERSAL=1 UNIVERSAL_ARCH="$TARGETS" \
- LLVM_SUBMIT_VERSION=$LLVM_SUBMIT_VERSION \
- LLVM_SUBMIT_SUBVERSION=$LLVM_SUBMIT_SUBVERSION \
- CXXFLAGS="-DLLVM_VERSION_INFO='\" Apple Build #$LLVM_VERSION\"'"
-
-if ! test $? == 0 ; then
- echo "error: LLVM 'make' failed!"
- exit 1
-fi
-
-################################################################################
-# Construct the actual destination root, by copying stuff from $DIR/dst-* to
-# $DEST_DIR, with occasional 'lipo' commands.
-
-cd $DEST_DIR || exit 1
-
-# Clean out DEST_DIR in case -noclean was passed to buildit.
-rm -rf * || exit 1
-
-cd $DIR/obj-llvm || exit 1
-
-# Install the tree into the destination directory.
-make $LOCAL_MAKEFLAGS $OPTIMIZE_OPTS UNIVERSAL=1 OPTIMIZE_OPTION='-O2' install
-
-if ! test $? == 0 ; then
- echo "error: LLVM 'make install' failed!"
- exit 1
-fi
-
-# Install Version.h
-RC_ProjectSourceSubversion=`printf "%d" $LLVM_SUBMIT_SUBVERSION`
-echo "#define LLVM_VERSION ${RC_ProjectSourceVersion}" > $DEST_DIR$DEST_ROOT/include/llvm/Version.h
-echo "#define LLVM_MINOR_VERSION ${RC_ProjectSourceSubversion}" >> $DEST_DIR$DEST_ROOT/include/llvm/Version.h
-
-if [ "x$LLVM_DEBUG" != "x1" ]; then
- # Strip local symbols from llvm libraries.
- strip -S $DEST_DIR$DEST_ROOT/lib/*.[oa]
- strip -Sx $DEST_DIR$DEST_ROOT/lib/*.so
-fi
-
-# Remove .dir files
-cd $DEST_DIR$DEST_ROOT
-rm bin/.dir etc/llvm/.dir lib/.dir
-
-# Remove PPC64 fat slices.
-cd $DEST_DIR$DEST_ROOT/bin
-
-if [ $MACOSX_DEPLOYMENT_TARGET = "10.4" ]; then
- find . -perm 755 -type f -exec lipo -extract ppc -extract i386 {} -output {} \;
-else
- find . -perm 755 -type f -exec lipo -extract ppc7400 -extract i386 {} -output {} \;
-fi
-
-cd $DEST_DIR$DEST_ROOT
-
-mkdir -p $DT_HOME/lib
-mv lib/libLTO.dylib $DT_HOME/lib/libLTO.dylib
-rm -f lib/libLTO.a lib/libLTO.la
-
-
-
-################################################################################
-# Create SYM_DIR with information required for debugging.
-
-# Figure out how many make processes to run.
-SYSCTL=`sysctl -n hw.activecpu`
-
-# hw.activecpu only available in 10.2.6 and later
-if [ -z "$SYSCTL" ]; then
- SYSCTL=`sysctl -n hw.ncpu`
-fi
-
-# sysctl -n hw.* does not work when invoked via B&I chroot /BuildRoot. Builders
-# can default to 2, since even if they are single processor, nothing else is
-# running on the machine.
-if [ -z "$SYSCTL" ]; then
- SYSCTL=2
-fi
-
-cd $SYM_DIR || exit 1
-
-# Clean out SYM_DIR in case -noclean was passed to buildit.
-rm -rf * || exit 1
-
-# Generate .dSYM files
-find $DEST_DIR -perm -0111 -type f ! \( -name '*.la' -o -name gccas -o -name gccld -o -name llvm-config \) -print \
- | xargs -n 1 -P ${SYSCTL} dsymutil
-
-# Save .dSYM files and .a archives
-cd $DEST_DIR || exit 1
-find . \( -path \*.dSYM/\* -or -name \*.a \) -print \
- | cpio -pdml $SYM_DIR || exit 1
-
-# Save source files.
-mkdir $SYM_DIR/src || exit 1
-cd $DIR || exit 1
-find obj-* -name \*.\[chy\] -o -name \*.cpp -print \
- | cpio -pdml $SYM_DIR/src || exit 1
-
-################################################################################
-# Remove debugging information from DEST_DIR.
-
-find $DEST_DIR -name \*.a -print | xargs ranlib || exit 1
-find $DEST_DIR -name \*.dSYM -print | xargs rm -r || exit 1
-chgrp -h -R wheel $DEST_DIR
-chgrp -R wheel $DEST_DIR
-
-################################################################################
-# Remove tar ball from docs directory
-
-find $DEST_DIR -name html.tar.gz -exec rm {} \;
-
-################################################################################
-# w00t! Done!
-
-exit 0
diff --git a/release_23/utils/cgiplotNLT.pl b/release_23/utils/cgiplotNLT.pl
deleted file mode 100755
index 0360e4120d8c..000000000000
--- a/release_23/utils/cgiplotNLT.pl
+++ /dev/null
@@ -1,68 +0,0 @@
-#!/usr/bin/perl
-#takes a test and a program from a dp and produces a gnuplot script
-#use like perl plotNLT.pl password Programs/MultiSource/Benchmarks/ASCI_Purple/SMG2000/smg2000 llc
-
-use CGI;
-use DBI;
-my $q = new CGI;
-
-# database information
-$db="llvmalpha";
-$host="localhost";
-$userid="llvmdbuser";
-$passwd=$q->param('pwd');
-$connectionInfo="dbi:mysql:$db;$host";
-
-# make connection to database
-$dbh = DBI->connect($connectionInfo,$userid,$passwd) or die DBI->errstr;
-
-
-$count = 0;
-while ($q->param('n' . $count))
- {
- $count++;
- }
-
-$| = 1;
-print "Content-type: image/png", "\n\n";
-
-open CMDSTREAM, "|gnuplot";
-#open CMDSTREAM, "|echo";
-
-print CMDSTREAM "set terminal png\n";
-print CMDSTREAM "set output\n";
-print CMDSTREAM "set xdata time\n";
-print CMDSTREAM 'set timefmt "%Y-%m-%d"';
-print CMDSTREAM "\nplot";
-for ($iter = 0; $iter < $count; $iter++) {
- if ($iter)
- { print CMDSTREAM ","; }
- print CMDSTREAM " '-' using 1:2 title \"" . $q->param('t' . $iter) . "," . $q->param('n' . $iter) . "\"with lines";
-}
-
-print CMDSTREAM "\n";
-
-for ($iter = 0; $iter < $count; $iter++) {
-
- $prog = $q->param('n' . $iter);
- $test = $q->param('t' . $iter);
-
- $query = "Select RUN, VALUE from Tests where TEST = '$test' AND NAME = '$prog' ORDER BY RUN";
- #print "\n$query\n";
-
- my $sth = $dbh->prepare( $query) || die "Can't prepare statement: $DBI::errstr";;
-
- my $rc = $sth->execute or die DBI->errstr;
-
- while(($da,$v) = $sth->fetchrow_array)
- {
- print CMDSTREAM "$da $v\n";
- }
-
- print CMDSTREAM "e\n";
-}
-print CMDSTREAM "exit\n";
-close CMDSTREAM;
-
-# disconnect from database
-$dbh->disconnect;
diff --git a/release_23/utils/check-each-file b/release_23/utils/check-each-file
deleted file mode 100755
index bd7633301dc2..000000000000
--- a/release_23/utils/check-each-file
+++ /dev/null
@@ -1,150 +0,0 @@
-#!/bin/sh
-# check-each-file
-# Used to narrow down a miscompilation to one .o file from a list. Please read
-# the usage procedure, below, for command-line syntax (or run it with --help).
-# This script depends on the llvm-native-gcc script.
-
-if [ x$1 = x--make-linker-script ]
-then
- program=$2
- linker=./link-$program
- echo "Building $program with llvm-native-gcc"
- rm -f $program
- gmake -e $program CC=llvm-native-gcc CXX=llvm-native-gxx
- echo "Erasing $program and re-linking it"
- rm -f $program
- echo "rm -f $program" > $linker
- gmake -n $program >> $linker
- chmod 755 $linker
- echo "Linker script created in $linker; testing it out"
- output=`./$linker 2>&1`
- case "$output" in
- *undefined*reference*__main*)
- echo "$program appears to need a dummy __main function; adding one"
- echo "void __main () { }" > __main.c
- gcc -c __main.c
- echo "Done; rebuilding $linker"
- echo "rm -f $program" > $linker
- gmake -n $program 2>&1 | sed '/gcc/s/$/__main.o/' >> $linker
- ./$linker > /dev/null 2>&1
- if [ ! -x $program ]
- then
- echo "WARNING: linker script didn't work"
- fi
- ;;
- *)
- if [ ! -x $program ]
- then
- echo "WARNING: linker script didn't work"
- fi
- ;;
- esac
- echo "Linker script created in $linker; please check it manually"
- exit 0
-fi
-
-checkfiles="$1"
-program="$2"
-linker="$3"
-checker="$4"
-
-usage () {
- myname=`basename $0`
- echo "$myname --make-linker-script PROGRAM"
- echo "$myname OBJECTS-FILE PROGRAM LINKER CHECKER"
- echo ""
- echo "OBJECTS-FILE is a text file containing the names of all the .o files"
- echo "PROGRAM is the name of the executable under test"
- echo "(there must also exist a Makefile in the current directory which"
- echo "has PROGRAM as a target)"
- echo "LINKER is the script that builds PROGRAM; try --make-linker-script"
- echo "to automatically generate it"
- echo "CHECKER is the script that exits 0 if PROGRAM is ok, 1 if it is not OK"
- echo "(LINKER and CHECKER must be in your PATH, or you should specify ./)"
- echo ""
- echo "Bugs to <gaeke@uiuc.edu>."
- exit 1
-}
-
-if [ x$1 = x--help ]
-then
- usage
-fi
-
-if [ -z "$checkfiles" ]
-then
- echo "ERROR: Must specify name of file w/ list of objects as 1st arg."
- echo "(got \"$checkfiles\")"
- usage
-fi
-if [ ! -f "$checkfiles" ]
-then
- echo "ERROR: $checkfiles not found"
- usage
-fi
-if [ -z "$program" ]
-then
- echo "ERROR: Must specify name of program as 2nd arg."
- usage
-fi
-if [ -z "$linker" ]
-then
- echo "ERROR: Must specify name of link script as 3rd arg."
- usage
-fi
-if [ ! -x "$linker" ]
-then
- echo "ERROR: $linker not found or not executable"
- echo "You may wish to try: $0 --make-linker-script $program"
- usage
-fi
-if [ -z "$checker" ]
-then
- echo "ERROR: Must specify name of $program check script as 3rd arg."
- usage
-fi
-if [ ! -x "$checker" ]
-then
- echo "ERROR: $checker not found or not executable"
- usage
-fi
-
-files=`cat $checkfiles`
-echo "Recompiling everything with llvm-native-gcc"
-for f in $files
-do
- rm -f $f
- gmake $f CC=llvm-native-gcc CXX=llvm-native-gxx
-done
-rm -f $program
-$linker
-if $checker
-then
- echo "Sorry, I can't help you, $program is OK when compiled with llvm-native-gcc"
- exit 1
-fi
-for f in $files
-do
- echo Trying to compile $f with native gcc and rebuild $program
- mv ${f} ${f}__OLD__
- gmake ${f} CC=gcc > /dev/null 2>&1
- $linker
- echo Checking validity of new $program
- if $checker
- then
- echo Program is OK
- okfiles="$okfiles $f"
- else
- echo Program is not OK
- notokfiles="$notokfiles $f"
- fi
- mv ${f}__OLD__ ${f}
-done
-echo ""
-echo "Program is OK when these files are recompiled with native gcc: "
-echo "$okfiles"
-echo ""
-echo "Program is not OK when these files are recompiled with native gcc: "
-echo "$notokfiles"
-echo ""
-exit 0
diff --git a/release_23/utils/codegen-diff b/release_23/utils/codegen-diff
deleted file mode 100755
index 2c3ac4c6dfa8..000000000000
--- a/release_23/utils/codegen-diff
+++ /dev/null
@@ -1,135 +0,0 @@
-#!/usr/bin/perl
-
-use Getopt::Std;
-$DEBUG = 0;
-
-sub parse_objdump_file {
- my ($filename) = @_;
- my @result;
- open (INPUT, $filename) or die "$filename: $!\n";
- print "opened objdump output file $filename\n" if $DEBUG;
- while (<INPUT>) {
- if (/\s*([0-9a-f]*):\t(([0-9a-f]{2} )+) *\t(.*)$/) {
- my ($addr, $bytes, $instr) = ($1, $2, $4);
- $addr = "0x" . $addr;
- $bytes =~ s/\s*(.*\S)\s*/$1/; # trim any remaining whitespace
- $instr =~ s/\s*(.*\S)\s*/$1/;
- push (@result, {'addr' => $addr, 'bytes' => $bytes, 'instr' => $instr});
- print "addr=$addr bytes='$bytes' instr='$instr'\n" if $DEBUG;
- }
- }
- close INPUT;
- return @result;
-}
-
-sub parse_gdb_file {
- my ($filename) = @_;
- my @result;
- my $got_addr;
- open (INPUT, $filename) or die "$filename: $!\n";
- print "opened gdb output file $filename\n" if $DEBUG;
- while (<INPUT>) {
- if (/^(0x[0-9a-f]*):\t([^\t]*)\t[^:]*:\t((0x[0-9a-f]{2}\s*)+)\s*$/) {
- my ($addr, $bytes, $instr) = ($1, $3, $2);
- $bytes =~ s/0x//g;
- $bytes =~ s/\s+/ /g; # regularize whitespace
- $bytes =~ s/\s*(.*\S)\s*/$1/; # trim any remaining whitespace
- $instr =~ s/\s*(.*\S)\s*/$1/;
- push (@result, {'addr' => $addr, 'bytes' => $bytes, 'instr' => $instr});
- print "addr=$addr bytes='$bytes' instr='$instr'\n" if $DEBUG;
- } elsif (/^(0x[0-9a-f]*):\t$/) { # deal with gdb's line breaker
- $got_addr = $1;
- } elsif ($got_addr && /^ ([^\t]*)\t[^:]*:\t((0x[0-9a-f]{2}\s*)+)\s*$/) {
- my ($addr, $bytes, $instr) = ($got_addr, $2, $1);
- $bytes =~ s/0x//g;
- $bytes =~ s/\s+/ /g; # regularize whitespace
- $bytes =~ s/\s*(.*\S)\s*/$1/; # trim any remaining whitespace
- $instr =~ s/\s*(.*\S)\s*/$1/;
- push (@result, {'addr' => $addr, 'bytes' => $bytes, 'instr' => $instr});
- print "addr=$addr bytes='$bytes' instr='$instr'\n" if $DEBUG;
- undef $got_addr;
- }
- }
- close INPUT;
- return @result;
-}
-
-sub binary_diffs {
- my ($objdump_file, $gdb_file) = @_;
- my @file1 = parse_objdump_file ($objdump_file);
- my @file2 = parse_gdb_file ($gdb_file);
- my $lastrecord = ($#file1 >= $#file2) ? ($#file1) : ($#file2);
- for (my $i = 0; $i <= $lastrecord; ++$i) {
- my $d1 = $file1[$i];
- my $d2 = $file2[$i];
- if ($d1->{'bytes'} ne $d2->{'bytes'}) {
- next if (($d1->{'instr'} eq $d2->{'instr'}) && $opt_d);
- printf "0x%08x:\t%30s \t%s\n", 0+$d1->{'addr'}, $d1->{'bytes'}, $d1->{'instr'};
- printf "0x%08x:\t%30s \t%s\n\n", 0+$d2->{'addr'}, $d2->{'bytes'}, $d2->{'instr'};
- }
- }
-}
-
-&getopts('d');
-$objdump_file = $ARGV[0];
-$gdb_file = $ARGV[1];
-binary_diffs ($objdump_file, $gdb_file);
-exit (0);
-__END__
-=pod
-
-=head1 NAME
-
-codegen-diff
-
-=head1 SYNOPSIS
-
-codegen-diff [-d] I<OBJDUMP-OUTPUT-FILE> I<GDB-DISASSEMBLY-FILE>
-
-=head1 DESCRIPTION
-
-B<codegen-diff> is a program that tries to show you the differences
-between the code that B<llc> generated and the code that B<lli> generated.
-
-The way you use it is as follows: first, you create I<OBJDUMP-OUTPUT-FILE>
-by running B<objdump> on the B<llc> compiled and linked binary. You need to
-trim down the result so it contains only the function of interest.
-
-Second, you create I<GDB-DISASSEMBLY-FILE> by running B<gdb>, with my patch
-to print out hex bytes in the B<disassemble> command output, on
-B<lli>. Set a breakpoint in C<Emitter::finishFunction()> and wait until
-the function you want is compiled. Then use the B<disassemble> command
-to print out the assembly dump of the function B<lli> just compiled.
-(Use C<lli -debug> to find out where the function starts and ends in memory.)
-It's easiest to save this output by using B<script>.
-
-Finally, you run B<codegen-diff>, as indicated in the Synopsis section of
-this manpage. It will print out a two-line stanza for each mismatched
-instruction, with the B<llc> version first, and the B<lli> version second.
-
-=head1 OPTIONS
-
-=over 4
-
-=item -d
-
-Don't show instructions where the bytes are different but they
-disassemble to the same thing. This puts a lot of trust in the
-disassembler, but it might help you highlight the more egregious cases
-of misassembly.
-
-=back
-
-=head1 AUTHOR
-
-B<codegen-diff> was written by Brian Gaeke.
-
-=head1 SEE ALSO
-
-L<gdb(1)>, L<objdump(1)>, L<script(1)>.
-
-You will need my B<gdb> patch:
-
- http://llvm.cs.uiuc.edu/~gaeke/gdb-disassembly-print-bytes.patch
-
-=cut
diff --git a/release_23/utils/countloc.sh b/release_23/utils/countloc.sh
deleted file mode 100755
index 4d1b775d74aa..000000000000
--- a/release_23/utils/countloc.sh
+++ /dev/null
@@ -1,40 +0,0 @@
-#!/bin/sh
-##===- utils/countloc.sh - Counts Lines Of Code --------------*- Script -*-===##
-#
-# The LLVM Compiler Infrastructure
-#
-# This file is distributed under the University of Illinois Open Source
-# License. See LICENSE.TXT for details.
-#
-##===----------------------------------------------------------------------===##
-#
-# This script finds all the source code files in the source code directories
-# (excluding certain things), runs "wc -l" on them to get the number of lines in
-# each file and then sums up and prints the total with awk.
-#
-# The script takes one optional option, -topdir, which specifies the top llvm
-# source directory. If it is not specified then the llvm-config tool is
-# consulted to find top source dir.
-#
-# Note that the implementation is based on llvmdo. See that script for more
-# details.
-##===----------------------------------------------------------------------===##
-
-if test $# -gt 1 ; then
- if test "$1" = "-topdir" ; then
- TOPDIR="$2"
- shift; shift;
- else
- TOPDIR=`llvm-config --src-root`
- fi
-fi
-
-if test -d "$TOPDIR" ; then
- cd $TOPDIR
- ./utils/llvmdo -topdir "$TOPDIR" -dirs "include lib tools test utils examples" -code-only wc -l | awk '\
- BEGIN { loc=0; } \
- { loc += $1; } \
- END { print loc; }'
-else
- echo "Can't find LLVM top directory"
-fi
diff --git a/release_23/utils/emacs/README b/release_23/utils/emacs/README
deleted file mode 100644
index e83eeae4b070..000000000000
--- a/release_23/utils/emacs/README
+++ /dev/null
@@ -1,27 +0,0 @@
--*- llvm/utils/emacs/README -*-
-
-These are syntax highlighting files for the Emacs and XEmacs editors. Included
-are:
-
-* llvm-mode.el
-
- Syntax highlighting mode for LLVM assembly files. To use, add this code to
- your ~/.emacs :
-
- (setq load-path
- (cons (expand-file-name "path-to-llvm/utils/emacs") load-path))
- (require 'llvm-mode)
-
-* tablegen-mode.el
-
- Syntax highlighting mode for TableGen description files. To use, add this code
- to your ~/.emacs:
-
- (setq load-path
- (cons (expand-file-name "path-to-llvm/utils/emacs") load-path))
- (require 'tablegen-mode)
-
-
-Note: If you notice missing or incorrect syntax highlighting, please contact
-<llvmbugs [at] cs.uiuc.edu>; if you wish to provide a patch to improve the
-functionality, it will be most appreciated. Thank you.
diff --git a/release_23/utils/emacs/emacs.el b/release_23/utils/emacs/emacs.el
deleted file mode 100644
index 43e17a7be6ae..000000000000
--- a/release_23/utils/emacs/emacs.el
+++ /dev/null
@@ -1,12 +0,0 @@
-;; LLVM coding style guidelines in emacs
-;; Maintainer: LLVM Team, http://llvm.org/
-;; Modified: 2005-04-24
-
-;; Max 80 cols per line, indent by two spaces, no tabs.
-;; Apparently, this does not affect tabs in Makefiles.
-(custom-set-variables
- '(fill-column 80)
- '(c++-indent-level 2)
- '(c-basic-offset 2)
- '(indent-tabs-mode nil))
-
diff --git a/release_23/utils/emacs/llvm-mode.el b/release_23/utils/emacs/llvm-mode.el
deleted file mode 100644
index 05900992a3cd..000000000000
--- a/release_23/utils/emacs/llvm-mode.el
+++ /dev/null
@@ -1,128 +0,0 @@
-;; Maintainer: The LLVM team, http://llvm.org/
-;; Description: Major mode for the LLVM assembler language.
-;; Updated: 2007-09-19
-
-;; Create mode-specific tables.
-(defvar llvm-mode-syntax-table nil
- "Syntax table used while in LLVM mode.")
-
-(defvar llvm-font-lock-keywords
- (list
- ;; Comments
- '(";.*" . font-lock-comment-face)
- ;; Variables
- '("%[-a-zA-Z$\._][-a-zA-Z$\._0-9]*" . font-lock-variable-name-face)
- ;; Labels
- '("[-a-zA-Z$\._0-9]+:" . font-lock-variable-name-face)
- ;; Strings
- '("\"[^\"]+\"" . font-lock-string-face)
- ;; Unnamed variable slots
- '("%[-]?[0-9]+" . font-lock-variable-name-face)
- ;; Types
- '("\\bvoid\\b\\|\\bi[0-9]+\\b\\|\\float\\b\\|\\bdouble\\b\\|\\btype\\b\\|\\blabel\\b\\|\\bopaque\\b" . font-lock-type-face)
- ;; Integer literals
- '("\\b[-]?[0-9]+\\b" . font-lock-preprocessor-face)
- ;; Floating point constants
- '("\\b[-+]?[0-9]+\.[0-9]*\([eE][-+]?[0-9]+\)?\\b" . font-lock-preprocessor-face)
- ;; Hex constants
- '("\\b0x[0-9A-Fa-f]+\\b" . font-lock-preprocessor-face)
- ;; Keywords
- '("\\bbegin\\b\\|\\bend\\b\\|\\btrue\\b\\|\\bfalse\\b\\|\\bzeroinitializer\\b\\|\\bdeclare\\b\\|\\bdefine\\b\\|\\bglobal\\b\\|\\bconstant\\b\\|\\bconst\\b\\|\\binternal\\b\\|\\blinkonce\\b\\|\\bweak\\b\\|\\bappending\\b\\|\\buninitialized\\b\\|\\bimplementation\\b\\|\\b\\.\\.\\.\\b\\|\\bnull\\b\\|\\bundef\\b\\|\\bto\\b\\|\\bexcept\\b\\|\\bnot\\b\\|\\btarget\\b\\|\\bendian\\b\\|\\blittle\\b\\|\\bbig\\b\\|\\bpointersize\\b\\|\\bdeplibs\\b\\|\\bvolatile\\b\\|\\bfastcc\\b\\|\\bcoldcc\\b\\|\\bcc\\b" . font-lock-keyword-face)
- ;; Arithmetic and Logical Operators
- '("\\badd\\b\\|\\bsub\\b\\|\\bmul\\b\\|\\bdiv\\b\\|\\brem\\b\\|\\band\\b\\|\\bor\\b\\|\\bxor\\b\\|\\bset\\(ne\\b\\|\\beq\\b\\|\\blt\\b\\|\\bgt\\b\\|\\ble\\b\\|\\bge\\b\\)" . font-lock-keyword-face)
- ;; Special instructions
- '("\\bphi\\b\\|\\btail\\b\\|\\bcall\\b\\|\\bcast\\b\\|\\bselect\\b\\|\\bto\\b\\|\\bshl\\b\\|\\bshr\\b\\|\\bvaarg\\b\\|\\bvanext\\b" . font-lock-keyword-face)
- ;; Control instructions
- '("\\bret\\b\\|\\bbr\\b\\|\\bswitch\\b\\|\\binvoke\\b\\|\\bunwind\\b\\|\\bunreachable\\b" . font-lock-keyword-face)
- ;; Memory operators
- '("\\bmalloc\\b\\|\\balloca\\b\\|\\bfree\\b\\|\\bload\\b\\|\\bstore\\b\\|\\bgetelementptr\\b" . font-lock-keyword-face)
- )
- "Syntax highlighting for LLVM"
- )
-
-;; ---------------------- Syntax table ---------------------------
-;; Shamelessly ripped from jasmin.el
-;; URL: http://www.neilvandyke.org/jasmin-emacs/jasmin.el.html
-
-(if (not llvm-mode-syntax-table)
- (progn
- (setq llvm-mode-syntax-table (make-syntax-table))
- (mapcar (function (lambda (n)
- (modify-syntax-entry (aref n 0)
- (aref n 1)
- llvm-mode-syntax-table)))
- '(
- ;; whitespace (` ')
- [?\^m " "]
- [?\f " "]
- [?\n " "]
- [?\t " "]
- [?\ " "]
- ;; word constituents (`w')
- ;;[?< "w"]
- ;;[?> "w"]
- [?\% "w"]
- ;;[?_ "w "]
- ;; comments
- [?\; "< "]
- [?\n "> "]
- ;;[?\r "> "]
- ;;[?\^m "> "]
- ;; symbol constituents (`_')
- ;; punctuation (`.')
- ;; open paren (`(')
- [?\( "("]
- [?\[ "("]
- [?\{ "("]
- ;; close paren (`)')
- [?\) ")"]
- [?\] ")"]
- [?\} ")"]
- ;; string quote ('"')
- [?\" "\""]
- ))))
-
-;; --------------------- Abbrev table -----------------------------
-
-(defvar llvm-mode-abbrev-table nil
- "Abbrev table used while in LLVM mode.")
-(define-abbrev-table 'llvm-mode-abbrev-table ())
-
-(defvar llvm-mode-hook nil)
-(defvar llvm-mode-map nil) ; Create a mode-specific keymap.
-
-(if (not llvm-mode-map)
- () ; Do not change the keymap if it is already set up.
- (setq llvm-mode-map (make-sparse-keymap))
- (define-key llvm-mode-map "\t" 'tab-to-tab-stop)
- (define-key llvm-mode-map "\es" 'center-line)
- (define-key llvm-mode-map "\eS" 'center-paragraph))
-
-
-(defun llvm-mode ()
- "Major mode for editing LLVM source files.
- \\{llvm-mode-map}
- Runs llvm-mode-hook on startup."
- (interactive)
- (kill-all-local-variables)
- (use-local-map llvm-mode-map) ; Provides the local keymap.
- (setq major-mode 'llvm-mode)
-
- (make-local-variable 'font-lock-defaults)
- (setq major-mode 'llvm-mode ; This is how describe-mode
- ; finds the doc string to print.
- mode-name "LLVM" ; This name goes into the modeline.
- font-lock-defaults `(llvm-font-lock-keywords))
-
- (setq local-abbrev-table llvm-mode-abbrev-table)
- (set-syntax-table llvm-mode-syntax-table)
- (setq comment-start ";")
- (run-hooks 'llvm-mode-hook)) ; Finally, this permits the user to
- ; customize the mode with a hook.
-
-;; Associate .ll files with llvm-mode
-(setq auto-mode-alist
- (append '(("\\.ll$" . llvm-mode) ("\\.llx$" . llvm-mode)) auto-mode-alist))
-
-(provide 'llvm-mode)
-;; end of llvm-mode.el
diff --git a/release_23/utils/emacs/tablegen-mode.el b/release_23/utils/emacs/tablegen-mode.el
deleted file mode 100644
index fdf8b3f44439..000000000000
--- a/release_23/utils/emacs/tablegen-mode.el
+++ /dev/null
@@ -1,122 +0,0 @@
-;; Maintainer: The LLVM team, http://llvm.org/
-;; Description: Major mode for TableGen description files (part of LLVM project)
-;; Updated: 2007-12-18
-
-(require 'comint)
-(require 'custom)
-(require 'ansi-color)
-
-;; Create mode-specific tables.
-(defvar td-decorators-face 'td-decorators-face
- "Face method decorators.")
-(make-face 'td-decorators-face)
-
-(defvar tablegen-font-lock-keywords
- (let ((kw (mapconcat 'identity
- '("class" "defm" "def" "field" "include" "in"
- "let" "multiclass")
- "\\|"))
- (type-kw (mapconcat 'identity
- '("bit" "bits" "code" "dag" "int" "list" "string")
- "\\|"))
- )
- (list
- ;; Comments
-;; '("\/\/" . font-lock-comment-face)
- ;; Strings
- '("\"[^\"]+\"" . font-lock-string-face)
- ;; Hex constants
- '("0x[0-9A-Fa-f]+" . font-lock-preprocessor-face)
- ;; Binary constants
- '("0b[01]+" . font-lock-preprocessor-face)
- ;; Integer literals
- '("[-]?[0-9]+" . font-lock-preprocessor-face)
- ;; Floating point constants
- '("[-+]?[0-9]+\.[0-9]*\([eE][-+]?[0-9]+\)?" . font-lock-preprocessor-face)
-
- '("^[ \t]*\\(@.+\\)" 1 'td-decorators-face)
- ;; Keywords
- (cons (concat "\\<\\(" kw "\\)\\>[ \n\t(]") 1)
-
- ;; Type keywords
- (cons (concat "\\<\\(" type-kw "\\)[ \n\t(]") 1)
- ))
- "Additional expressions to highlight in TableGen mode.")
-(put 'tablegen-mode 'font-lock-defaults '(tablegen-font-lock-keywords))
-
-;; ---------------------- Syntax table ---------------------------
-;; Shamelessly ripped from jasmin.el
-;; URL: http://www.neilvandyke.org/jasmin-emacs/jasmin.el
-
-(defvar tablegen-mode-syntax-table nil
- "Syntax table used in `tablegen-mode' buffers.")
-(when (not tablegen-mode-syntax-table)
- (setq tablegen-mode-syntax-table (make-syntax-table))
- ;; whitespace (` ')
- (modify-syntax-entry ?\ " " tablegen-mode-syntax-table)
- (modify-syntax-entry ?\t " " tablegen-mode-syntax-table)
- (modify-syntax-entry ?\r " " tablegen-mode-syntax-table)
- (modify-syntax-entry ?\n " " tablegen-mode-syntax-table)
- (modify-syntax-entry ?\f " " tablegen-mode-syntax-table)
- ;; word constituents (`w')
- (modify-syntax-entry ?\% "w" tablegen-mode-syntax-table)
- (modify-syntax-entry ?\_ "w" tablegen-mode-syntax-table)
- ;; comments
- (modify-syntax-entry ?/ ". 124b" tablegen-mode-syntax-table)
- (modify-syntax-entry ?* ". 23" tablegen-mode-syntax-table)
- (modify-syntax-entry ?\n "> b" tablegen-mode-syntax-table)
- ;; open paren (`(')
- (modify-syntax-entry ?\( "(" tablegen-mode-syntax-table)
- (modify-syntax-entry ?\[ "(" tablegen-mode-syntax-table)
- (modify-syntax-entry ?\{ "(" tablegen-mode-syntax-table)
- (modify-syntax-entry ?\< "(" tablegen-mode-syntax-table)
- ;; close paren (`)')
- (modify-syntax-entry ?\) ")" tablegen-mode-syntax-table)
- (modify-syntax-entry ?\] ")" tablegen-mode-syntax-table)
- (modify-syntax-entry ?\} ")" tablegen-mode-syntax-table)
- (modify-syntax-entry ?\> ")" tablegen-mode-syntax-table)
- ;; string quote ('"')
- (modify-syntax-entry ?\" "\"" tablegen-mode-syntax-table)
- )
-
-;; --------------------- Abbrev table -----------------------------
-
-(defvar tablegen-mode-abbrev-table nil
- "Abbrev table used while in TableGen mode.")
-(define-abbrev-table 'tablegen-mode-abbrev-table ())
-
-(defvar tablegen-mode-hook nil)
-(defvar tablegen-mode-map nil) ; Create a mode-specific keymap.
-
-(if (not tablegen-mode-map)
- () ; Do not change the keymap if it is already set up.
- (setq tablegen-mode-map (make-sparse-keymap))
- (define-key tablegen-mode-map "\t" 'tab-to-tab-stop)
- (define-key tablegen-mode-map "\es" 'center-line)
- (define-key tablegen-mode-map "\eS" 'center-paragraph))
-
-(defun tablegen-mode ()
- "Major mode for editing TableGen description files.
- \\{tablegen-mode-map}
- Runs tablegen-mode-hook on startup."
- (interactive)
- (kill-all-local-variables)
- (use-local-map tablegen-mode-map) ; Provides the local keymap.
- (make-local-variable 'font-lock-defaults)
- (setq major-mode 'tablegen-mode ; This is how describe-mode
- ; finds the doc string to print.
- mode-name "TableGen" ; This name goes into the modeline.
- local-abbrev-table tablegen-mode-abbrev-table
- font-lock-defaults `(tablegen-font-lock-keywords)
- require-final-newline t
- )
-
- (set-syntax-table tablegen-mode-syntax-table)
- (run-hooks 'tablegen-mode-hook)) ; Finally, this permits the user to
- ; customize the mode with a hook.
-
-;; Associate .td files with tablegen-mode
-(setq auto-mode-alist (append '(("\\.td$" . tablegen-mode)) auto-mode-alist))
-
-(provide 'tablegen-mode)
-;; end of tablegen-mode.el
diff --git a/release_23/utils/findmisopt b/release_23/utils/findmisopt
deleted file mode 100755
index b7ffbd9947d5..000000000000
--- a/release_23/utils/findmisopt
+++ /dev/null
@@ -1,178 +0,0 @@
-#!/bin/bash
-#
-# findmisopt
-#
-# This is a quick and dirty hack to potentially find a misoptimization
-# problem. Mostly its to work around problems in bugpoint that prevent
-# it from finding a problem unless the set of failing optimizations are
-# known and given to it on the command line.
-#
-# Given a bytecode file that produces correct output (or return code),
-# this script will run through all the optimizations passes that gccas
-# uses (in the same order) and will narrow down which optimizations
-# cause the program either generate different output or return a
-# different result code. When the passes have been narrowed down,
-# bugpoint is invoked to further refine the problem to its origin. If a
-# release version of bugpoint is available it will be used, otherwise
-# debug.
-#
-# Usage:
-# findmisopt bcfile outdir progargs [match]
-#
-# Where:
-# bcfile
-# is the bytecode file input (the unoptimized working case)
-# outdir
-# is a directory into which intermediate results are placed
-# progargs
-# is a single argument containing all the arguments the program needs
-# proginput
-# is a file name from which stdin should be directed
-# match
-# if specified to any value causes the result code of the program to
-# be used to determine success/fail. If not specified success/fail is
-# determined by diffing the program's output with the non-optimized
-# output.
-#
-if [ "$#" -lt 3 ] ; then
- echo "usage: findmisopt bcfile outdir progargs [match]"
- exit 1
-fi
-
-dir="${0%%/utils/findmisopt}"
-if [ -x "$dir/Release/bin/bugpoint" ] ; then
- bugpoint="$dir/Release/bin/bugpoint"
-elif [ -x "$dir/Debug/bin/bugpoint" ] ; then
- bugpoint="$dir/Debug/bin/bugpoint"
-else
- echo "findmisopt: bugpoint not found"
- exit 1
-fi
-
-bcfile="$1"
-outdir="$2"
-args="$3"
-input="$4"
-if [ ! -f "$input" ] ; then
- input="/dev/null"
-fi
-match="$5"
-name=`basename $bcfile .bc`
-ll="$outdir/${name}.ll"
-s="$outdir/${name}.s"
-prog="$outdir/${name}"
-out="$outdir/${name}.out"
-optbc="$outdir/${name}.opt.bc"
-optll="$outdir/${name}.opt.ll"
-opts="$outdir/${name}.opt.s"
-optprog="$outdir/${name}.opt"
-optout="$outdir/${name}.opt.out"
-ldflags="-lstdc++ -lm -ldl -lc"
-
-echo "Test Name: $name"
-echo "Unoptimized program: $prog"
-echo " Optimized program: $optprog"
-
-# Define the list of optimizations to run. This comprises the same set of
-# optimizations that opt -std-compile-opts and gccld run, in the same order.
-opt_switches=`llvm-as < /dev/null -o - | opt -std-compile-opts -disable-output -debug-pass=Arguments 2>&1 | sed 's/Pass Arguments: //'`
-ld_switches=`llvm-as < /dev/null -o - | llvm-ld - -debug-pass=Arguments 2>&1 | sed 's/Pass Arguments: //'`
-all_switches="$opt_switches $ld_switches"
-echo "Passes : $all_switches"
-
-# Create output directory if it doesn't exist
-if [ -f "$outdir" ] ; then
- echo "$outdir is not a directory"
- exit 1
-fi
-
-if [ ! -d "$outdir" ] ; then
- mkdir "$outdir" || exit 1
-fi
-
-# Generate the disassembly
-llvm-dis "$bcfile" -o "$ll" -f || exit 1
-
-# Generate the non-optimized program and its output
-llc "$bcfile" -o "$s" -f || exit 1
-gcc "$s" -o "$prog" $ldflags || exit 1
-"$prog" $args > "$out" 2>&1 <$input
-ex1=$?
-
-# Current set of switches is empty
-function tryit {
- switches_to_use="$1"
- opt $switches_to_use "$bcfile" -o "$optbc" -f || exit
- llvm-dis "$optbc" -o "$optll" -f || exit
- llc "$optbc" -o "$opts" -f || exit
- gcc "$opts" -o "$optprog" $ldflags || exit
- "$optprog" $args > "$optout" 2>&1 <"$input"
- ex2=$?
-
- if [ -n "$match" ] ; then
- if [ "$ex1" -ne "$ex2" ] ; then
- echo "Return code not the same with these switches:"
- echo $switches
- echo "Unoptimized returned: $ex1"
- echo "Optimized returned: $ex2"
- return 0
- fi
- else
- diff "$out" "$optout" > /dev/null
- if [ $? -ne 0 ] ; then
- echo "Diff fails with these switches:"
- echo $switches
- echo "Differences:"
- diff "$out" "$optout" | head
- return 0;
- fi
- fi
- return 1
-}
-
-echo "Trying to find optimization that breaks program:"
-for sw in $all_switches ; do
- echo -n " $sw"
- switches="$switches $sw"
- if tryit "$switches" ; then
- break;
- fi
-done
-
-# Terminate the previous output with a newline
-echo ""
-
-# Determine if we're done because none of the optimizations broke the program
-if [ "$switches" == " $all_switches" ] ; then
- echo "The program did not miscompile"
- exit 0
-fi
-
-final=""
-while [ ! -z "$switches" ] ; do
- trimmed=`echo "$switches" | sed -e 's/^ *\(-[^ ]*\).*/\1/'`
- switches=`echo "$switches" | sed -e 's/^ *-[^ ]* *//'`
- echo "Trimmed $trimmed from left"
- tryit "$final $switches"
- if [ "$?" -eq "0" ] ; then
- echo "Still Failing .. continuing ..."
- continue
- else
- echo "Found required early pass: $trimmed"
- final="$final $trimmed"
- continue
- fi
- echo "Next Loop"
-done
-
-if [ "$final" == " $all_switches" ] ; then
- echo "findmisopt: All optimizations pass. Perhaps this isn't a misopt?"
- exit 0
-fi
-echo "Smallest Optimization list=$final"
-
-bpcmd="$bugpoint -run-llc -disable-loop-extraction --output "$out" --input /dev/null $bcfile $final --args $args"
-
-echo "Running: $bpcmd"
-$bpcmd
-echo "findmisopt finished."
diff --git a/release_23/utils/findoptdiff b/release_23/utils/findoptdiff
deleted file mode 100755
index 36620d932cb3..000000000000
--- a/release_23/utils/findoptdiff
+++ /dev/null
@@ -1,101 +0,0 @@
-#!/bin/bash
-#
-# findoptdiff
-#
-# This script helps find the optimization difference between two llvm
-# builds. It is useful when you have a build that is known to work and
-# one that exhibits an optimization problem. Identifying the difference
-# between the two builds can lead to discovery of the source of a
-# mis-optimization.
-#
-# The script takes two llvm build paths as arguments. These specify the
-# the two llvm builds to compare. It is generally expected that they
-# are "close cousins". That is, they are the same except that the
-# second build contains some experimental optimization features that
-# are suspected of producing a misoptimization.
-#
-# The script takes two bytecode files, one from each build. They are
-# presumed to be a compilation of the same program or program fragment
-# with the only difference being the builds.
-#
-# The script operates by iteratively applying the optimizations that gccas
-# and gccld run until there is a difference in the assembly resulting
-# from the optimization. The difference is then reported with the set of
-# optimization passes that produce the difference. The processing
-# continues until all optimization passes have been tried. The differences
-# for each pass, if they do differ, are placed in a diffs.# file.
-#
-# To work around differences in the assembly language format, the script
-# can also take two filter arguments that post-process the assembly
-# so they can be differenced without making false positives for known
-# differences in the two builds. These filters are optional.
-#
-# Usage:
-# findoptdiff llvm1 llvm2 bc1 bc2 filter1 filter2
-#
-# Where:
-# llvm1
-# is the path to the first llvm build dir
-# llvm2
-# is the path to the second llvm build dir
-# bc1
-# is the bytecode file for the first llvm environment
-# bc2
-# is the bytecode file for the second llvm environment
-# filter1
-# is an optional filter for filtering the llvm1 generated assembly
-# filter2
-# is an optional filter for filtering the llvm2 generated assembly
-#
-llvm1=$1
-llvm2=$2
-bc1=$3
-bc2=$4
-filt1=$5
-filt2=$6
-if [ -z "$filt1" ] ; then
- filt1="cat"
-fi
-if [ -z "$filt2" ] ; then
- filt2="cat"
-fi
-opt1="${bc1}.opt"
-opt2="${bc2}.opt"
-ll1="${bc1}.ll"
-ll2="${bc2}.ll"
-opt1ll="${bc1}.opt.ll"
-opt2ll="${bc2}.opt.ll"
-dis1="$llvm1/Debug/bin/llvm-dis"
-dis2="$llvm2/Debug/bin/llvm-dis"
-opt1="$llvm1/Debug/bin/opt"
-opt2="$llvm2/Debug/bin/opt"
-
-all_switches="-verify -lowersetjmp -raiseallocs -simplifycfg -mem2reg -globalopt -globaldce -ipconstprop -deadargelim -instcombine -simplifycfg -prune-eh -inline -simplify-libcalls -argpromotion -tailduplicate -simplifycfg -scalarrepl -instcombine -predsimplify -condprop -tailcallelim -simplifycfg -reassociate -licm -loop-unswitch -instcombine -indvars -loop-unroll -instcombine -load-vn -gcse -sccp -instcombine -condprop -dse -dce -simplifycfg -deadtypeelim -constmerge -internalize -ipsccp -globalopt -constmerge -deadargelim -inline -prune-eh -globalopt -globaldce -argpromotion -instcombine -predsimplify -scalarrepl -globalsmodref-aa -licm -load-vn -gcse -dse -instcombine -simplifycfg -verify"
-
-#counter=0
-function tryit {
- switches_to_use="$1"
- $opt1 $switches_to_use "$bc1" -o - | $dis1 | $filt1 > "$opt1ll"
- $opt2 $switches_to_use "$bc2" -o - | $dis2 | $filt2 > "$opt2ll"
- diffs="diffs."$((counter++))
- diff "$opt1ll" "$opt2ll" > $diffs
- if [ $? -ne 0 ] ; then
- echo
- echo "Diff fails with these switches:"
- echo $switches
- echo "Differences:"
- head $diffs
- echo 'Switches:' $switches_to_use >> $diffs
- else
- rm $diffs
- fi
- return 1
-}
-
-for sw in $all_switches ; do
- echo -n " $sw"
- switches="$switches $sw"
- if tryit "$switches" ; then
- break;
- fi
-done
diff --git a/release_23/utils/findsym.pl b/release_23/utils/findsym.pl
deleted file mode 100755
index 92346572fe01..000000000000
--- a/release_23/utils/findsym.pl
+++ /dev/null
@@ -1,33 +0,0 @@
-#!/usr/bin/perl -w
-#
-# Program: findsym.pl
-#
-# Synopsis: Generate a list of the libraries in which a symbol is defined or
-# referenced.
-#
-# Syntax: findsym.pl <directory_with_libraries_in_it> <symbol>
-#
-
-# Give first option a name.
-my $Directory = $ARGV[0];
-my $Symbol = $ARGV[1];
-
-# Open the directory and read its contents, sorting by name and differentiating
-# by whether its a library (.a) or an object file (.o)
-opendir DIR,$Directory;
-my @files = readdir DIR;
-closedir DIR;
-@objects = grep(/l?i?b?LLVM.*\.[oa]$/,sort(@files));
-
-# Gather definitions from the libraries
-foreach $lib (@objects) {
- my $head = 0;
- open SYMS,
- "nm $Directory/$lib | grep '$Symbol' | sort --key=3 | uniq |";
- while (<SYMS>) {
- if (!$head) { print "$lib:\n"; $head = 1; }
- chomp($_);
- print " $_\n";
- }
- close SYMS;
-}
diff --git a/release_23/utils/fpcmp/Makefile b/release_23/utils/fpcmp/Makefile
deleted file mode 100644
index fd2f7477bb4e..000000000000
--- a/release_23/utils/fpcmp/Makefile
+++ /dev/null
@@ -1,16 +0,0 @@
-##===- utils/fpcmp/Makefile --------------------------------*- Makefile -*-===##
-#
-# The LLVM Compiler Infrastructure
-#
-# This file is distributed under the University of Illinois Open Source
-# License. See LICENSE.TXT for details.
-#
-##===----------------------------------------------------------------------===##
-
-LEVEL = ../..
-TOOLNAME = fpcmp
-USEDLIBS = LLVMSupport.a LLVMSystem.a
-NO_INSTALL = 1
-
-include $(LEVEL)/Makefile.common
-
diff --git a/release_23/utils/fpcmp/fpcmp.cpp b/release_23/utils/fpcmp/fpcmp.cpp
deleted file mode 100644
index 66d8ab159b93..000000000000
--- a/release_23/utils/fpcmp/fpcmp.cpp
+++ /dev/null
@@ -1,43 +0,0 @@
-//===- fpcmp.cpp - A fuzzy "cmp" that permits floating point noise --------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// fpcmp is a tool that basically works like the 'cmp' tool, except that it can
-// tolerate errors due to floating point noise, with the -r and -a options.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Support/CommandLine.h"
-#include "llvm/Support/FileUtilities.h"
-#include <iostream>
-using namespace llvm;
-
-namespace {
- cl::opt<std::string>
- File1(cl::Positional, cl::desc("<input file #1>"), cl::Required);
- cl::opt<std::string>
- File2(cl::Positional, cl::desc("<input file #2>"), cl::Required);
-
- cl::opt<double>
- RelTolerance("r", cl::desc("Relative error tolerated"), cl::init(0));
- cl::opt<double>
- AbsTolerance("a", cl::desc("Absolute error tolerated"), cl::init(0));
-}
-
-int main(int argc, char **argv) {
- cl::ParseCommandLineOptions(argc, argv);
-
- std::string ErrorMsg;
- int DF = DiffFilesWithTolerance(sys::PathWithStatus(File1),
- sys::PathWithStatus(File2),
- AbsTolerance, RelTolerance, &ErrorMsg);
- if (!ErrorMsg.empty())
- std::cerr << argv[0] << ": " << ErrorMsg << "\n";
- return DF;
-}
-
diff --git a/release_23/utils/getsrcs.sh b/release_23/utils/getsrcs.sh
deleted file mode 100755
index c8bff8cf833d..000000000000
--- a/release_23/utils/getsrcs.sh
+++ /dev/null
@@ -1,34 +0,0 @@
-#!/bin/sh
-##===- utils/getsrcs.sh - Counts Lines Of Code ---------------*- Script -*-===##
-#
-# The LLVM Compiler Infrastructure
-#
-# This file is distributed under the University of Illinois Open Source
-# License. See LICENSE.TXT for details.
-# details.
-#
-##===----------------------------------------------------------------------===##
-#
-# This script just prints out the path names for all the source files in LLVM.
-# The optional -topdir option can be used to specify the top LLVM source
-# directory. Without it, the llvm-config command is consulted to find the
-# top source directory.
-#
-# Note that the implementation is based on llvmdo. See that script for more
-# details.
-##===----------------------------------------------------------------------===##
-
-if test "$1" = "-topdir" ; then
- TOPDIR="$2"
- shift; shift;
-else
- TOPDIR=`llvm-config --src-root`
-fi
-
-if test -d "$TOPDIR" ; then
- cd $TOPDIR
- ./utils/llvmdo -topdir "$TOPDIR" \
- -dirs "include lib tools utils examples projects" echo
-else
- echo "Can't find LLVM top directory"
-fi
diff --git a/release_23/utils/importNLT.pl b/release_23/utils/importNLT.pl
deleted file mode 100644
index c1b950dc34d8..000000000000
--- a/release_23/utils/importNLT.pl
+++ /dev/null
@@ -1,86 +0,0 @@
-#!/usr/bin/perl
-#take the output of parseNLT.pl and load it into a database
-# use like: cat file |perl parseNLT.pl |perl importNLT.pl password
-
-use DBI;
-
-# database information
-$db="llvmalpha";
-$host="localhost";
-$userid="llvmdbuser";
-$passwd=shift @ARGV;
-$connectionInfo="dbi:mysql:$db;$host";
-
-# make connection to database
-$dbh = DBI->connect($connectionInfo,$userid,$passwd) or die DBI->errstr;
-my $sth = $dbh->prepare( q{
- INSERT INTO Tests (NAME, RUN, TEST, VALUE) VALUES (?, STR_TO_DATE(?, '\%d \%M \%Y'), ?, ?)
- }) || die "Can't prepare statement: $DBI::errstr";;
-
-while($d = <>)
-{
- chomp $d;
- if (18 == scalar split " ", $d)
- {
- ($day, $mon, $year, $prog, $gccas, $bc, $llccompile, $llcbetacompile, $jitcompile,
- $mc, $gcc, $cbe, $llc, $llcbeta, $jit, $foo1, $foo2, $foo3) = split " ", $d;
- if ($gccas =~ /\d+/)
- {
- $dbh->do("INSERT INTO Tests (NAME, RUN, TEST, VALUE) VALUES
- ('$prog', STR_TO_DATE('$day $mon $year', '\%d \%M \%Y'), 'gccas', $gccas)") || die DBI->errstr;
- }
- if ($bc =~ /\d/)
- {
- $dbh->do("INSERT INTO Tests (NAME, RUN, TEST, VALUE) VALUES
- ('$prog', STR_TO_DATE('$day $mon $year', '\%d \%M \%Y'), 'bytecode', $bc)") || die DBI->errstr;
- }
- if ($llccompile =~ /\d/)
- {
- $dbh->do("INSERT INTO Tests (NAME, RUN, TEST, VALUE) VALUES
- ('$prog', STR_TO_DATE('$day $mon $year', '\%d \%M \%Y'), 'llc-compile', $llccompile)") || die DBI->errstr;
- }
- if ($llcbetacompile =~ /\d/)
- {
- $dbh->do("INSERT INTO Tests (NAME, RUN, TEST, VALUE) VALUES
- ('$prog', STR_TO_DATE('$day $mon $year', '\%d \%M \%Y'), 'llc-beta-compile', $llcbetacompile)") || die DBI->errstr;
- }
- if ($jitcompile =~ /\d/)
- {
- $dbh->do("INSERT INTO Tests (NAME, RUN, TEST, VALUE) VALUES
- ('$prog', STR_TO_DATE('$day $mon $year', '\%d \%M \%Y'), 'jit-compile', $jitcompile)") || die DBI->errstr;
- }
- if ($mc =~ /\d/)
- {
- $dbh->do("INSERT INTO Tests (NAME, RUN, TEST, VALUE) VALUES
- ('$prog', STR_TO_DATE('$day $mon $year', '\%d \%M \%Y'), 'machine-code', $mc)") || die DBI->errstr;
- }
- if ($gcc =~ /\d/)
- {
- $dbh->do("INSERT INTO Tests (NAME, RUN, TEST, VALUE) VALUES
- ('$prog', STR_TO_DATE('$day $mon $year', '\%d \%M \%Y'), 'gcc', $gcc)") || die DBI->errstr;
- }
- if ($llc =~ /\d/)
- {
- $dbh->do("INSERT INTO Tests (NAME, RUN, TEST, VALUE) VALUES
- ('$prog', STR_TO_DATE('$day $mon $year', '\%d \%M \%Y'), 'llc', $llc)") || die DBI->errstr;
- }
- if ($llcbeta =~ /\d/)
- {
- $dbh->do("INSERT INTO Tests (NAME, RUN, TEST, VALUE) VALUES
- ('$prog', STR_TO_DATE('$day $mon $year', '\%d \%M \%Y'), 'llc-beta', $llcbeta)") || die DBI->errstr;
- }
- if ($jit =~ /\d/)
- {
- $dbh->do("INSERT INTO Tests (NAME, RUN, TEST, VALUE) VALUES
- ('$prog', STR_TO_DATE('$day $mon $year', '\%d \%M \%Y'), 'jit', $jit)") || die DBI->errstr;
- }
- print ".";
- }
- else
- {
- print "\nNO: $d\n";
- }
-}
-print "\n";
-# disconnect from database
-$dbh->disconnect;
diff --git a/release_23/utils/llvm-native-gcc b/release_23/utils/llvm-native-gcc
deleted file mode 100755
index b3cecb14118f..000000000000
--- a/release_23/utils/llvm-native-gcc
+++ /dev/null
@@ -1,249 +0,0 @@
-#!/usr/bin/perl
-# Wrapper around LLVM tools to generate a native .o from llvm-gcc using an
-# LLVM back-end (CBE by default).
-
-# set up defaults.
-$Verbose = 0;
-$SaveTemps = 1;
-$PreprocessOnly = 0;
-$CompileDontLink = 0;
-$Backend = 'cbe';
-chomp ($ProgramName = `basename $0`);
-
-sub boldprint {
- print "", @_, "";
-}
-
-# process command-line options.
-# most of these are passed on to llvm-gcc.
-$GCCOptions = "";
-for ($i = 0; $i <= $#ARGV; ++$i) {
- if ($ARGV[$i] =~ /-mllvm-backend=([a-z0-9]*)/) {
- $Backend = $1;
- if ($ProgramName =~ /llvm-native-gcc/) {
- splice (@ARGV, $i, 1);
- --$i;
- }
- } elsif ($ARGV[$i] eq "-E") {
- $PreprocessOnly = 1;
- } elsif ($ARGV[$i] eq "-c") {
- $GCCOptions .= " " . $ARGV[$i];
- $CompileDontLink = 1;
- } elsif ($ARGV[$i] eq "-v") {
- $GCCOptions .= " " . $ARGV[$i];
- $Verbose = 1;
- } elsif ($ARGV[$i] eq "-o") {
- $OutputFile = $ARGV[$i + 1];
- } elsif ($ARGV[$i] eq "-save-temps") {
- $GCCOptions .= " " . $ARGV[$i];
- $SaveTemps = 1;
- } elsif ($ARGV[$i] =~ /\.bc$/) {
- push (@BytecodeFiles, $ARGV[$i]);
- } elsif ($ARGV[$i] =~ /^-L/) {
- $GCCOptions .= " " . $ARGV[$i];
- push (@LibDirs, $ARGV[$i]);
- } elsif ($ARGV[$i] =~ /^-l/) {
- $GCCOptions .= " " . $ARGV[$i];
- push (@Libs, $ARGV[$i]);
- } elsif ($ARGV[$i] =~ /\.(c|cpp|cc|i|ii|C)$/) {
- $LastCFile = $ARGV[$i];
- }
-}
-
-sub GetDefaultOutputFileName {
- my $DefaultOutputFileBase;
-
- if ($ProgramName =~ /llvm-native-gcc/) {
- $DefaultOutputFileBase = $LastCFile;
- } elsif ($ProgramName =~ /native-build/) {
- $DefaultOutputFileBase = $BytecodeFiles[0];
- }
-
- my $def = $DefaultOutputFileBase;
-
- die "Can't figure out name of output file.\n"
- unless $DefaultOutputFileBase
- && (($ProgramName !~ /native-build/)
- || $#BytecodeFiles == 0);
-
- print "Warning: defaulting output file name ",
- "based on '$DefaultOutputFileBase'\n" if $Verbose;
-
- if ($ProgramName =~ /llvm-native-gcc/) {
- $def =~ s/\.(c|cpp|cc|i|ii|C)$/.o/;
- } elsif ($ProgramName =~ /native-build/) {
- $def =~ s/\.bc$/.$Backend/;
- if ($CompileDontLink) {
- $def .= ".o";
- }
- }
-
- return $def;
-}
-
-# run a command, optionally echoing, and quitting if it fails:
-sub run {
- my $command = join(" ", @_);
- print "$command\n" if $Verbose;
- $command =~ s/\"/\\\"/g;
- system $command and die "$0: $command failed";
-}
-
-sub LinkBytecodeFilesIntoTemporary {
- my $FinalOutputFileName = shift @_;
- my @BytecodeFiles = @_;
-
- my $BCFiles = join (" ", @BytecodeFiles);
- my $LinkedBCFile;
- if ($SaveTemps) {
- $LinkedBCFile = "${FinalOutputFileName}.llvm.bc";
- } else {
- $LinkedBCFile = "/tmp/nativebuild-$$.llvm.bc";
- }
- run "llvm-link -o $LinkedBCFile $BCFiles";
- return $LinkedBCFile;
-}
-
-sub CompileBytecodeToNative {
- my ($BCFile, $Backend, $OutputFile) = @_;
-
- my $GeneratedCode;
- if ($Backend eq 'cbe') {
- if ($SaveTemps) {
- $GeneratedCode = "${OutputFile}.c";
- } else {
- $GeneratedCode = "/tmp/nativebuild-$$.c";
- }
- run "llc -enable-correct-eh-support -march=c -f -o $GeneratedCode $BCFile";
- } elsif ($Backend eq 'llc') {
- if ($SaveTemps) {
- $GeneratedCode = "${OutputFile}.s";
- } else {
- $GeneratedCode = "/tmp/nativebuild-$$.s";
- }
- run "llc -enable-correct-eh-support -f -o $GeneratedCode $BCFile";
- }
- my $LibDirs = join (" ", @LibDirs);
- my $Libs = join (" ", @Libs);
- run "gcc $GCCOptions $GeneratedCode -o $OutputFile $LibDirs $Libs";
- run "rm $BCFile $GeneratedCode"
- unless $SaveTemps;
-}
-
-sub CompileCToNative {
- my ($LLVMGCCCommand, $Backend, $OutputFile) = @_;
- run $LLVMGCCCommand;
- if ($PreprocessOnly) {
- return;
- }
- my $BCFile = "${OutputFile}.llvm.bc";
- if ($CompileDontLink) {
- run "mv ${OutputFile} $BCFile";
- } else { # gccld messes with the output file name
- run "mv ${OutputFile}.bc $BCFile";
- }
- my $GeneratedCode;
- if ($Backend eq 'cbe') {
- $GeneratedCode = "${OutputFile}.cbe.c";
- run "llc -enable-correct-eh-support -march=c -f -o $GeneratedCode $BCFile";
- } elsif ($Backend eq 'llc') {
- $GeneratedCode = "${OutputFile}.llc.s";
- run "llc -enable-correct-eh-support -f -o $GeneratedCode $BCFile";
- }
- my $NativeGCCOptions = "";
- if ($CompileDontLink) {
- $NativeGCCOptions = "-c";
- }
- run "gcc $NativeGCCOptions $GeneratedCode -o $OutputFile";
- run "rm ${OutputFile}.llvm.bc $GeneratedCode"
- unless $SaveTemps;
-}
-
-# guess the name of the output file, if -o was not specified.
-$OutputFile = GetDefaultOutputFileName () unless $OutputFile;
-print "Output file is $OutputFile\n" if $Verbose;
-# do all the dirty work:
-if ($ProgramName eq /native-build/) {
- my $LinkedBCFile = LinkBytecodeFilesIntoTemporary (@BytecodeFiles);
- CompileBytecodeToNative ($LinkedBCFile, $Backend, $OutputFile);
-} elsif ($ProgramName =~ /llvm-native-gcc/) {
- # build the llvm-gcc command line.
- $LLVMGCCCommand = join (" ", ("llvm-gcc", @ARGV));
- CompileCToNative ($LLVMGCCCommand, $Backend, $OutputFile);
-}
-
-# we're done.
-exit 0;
-
-__END__
-
-=pod
-
-=head1 NAME
-
-llvm-native-gcc
-
-=head1 SYNOPSIS
-
-llvm-native-gcc [OPTIONS...] FILE
-
-native-build [OPTIONS...] FILE
-
-=head1 DESCRIPTION
-
-llvm-native-gcc is a wrapper around the LLVM command-line tools which generates
-a native object (.o) file by compiling FILE with llvm-gcc, and then running
-an LLVM back-end (CBE by default) over the resulting bytecode, and then
-compiling the resulting code to a native object file.
-
-If called as "native-build", it compiles bytecode to native code, and takes
-different options.
-
-=head1 OPTIONS
-
-llvm-native-gcc takes the same options as llvm-gcc. All options
-except -mllvm-backend=... are passed on to llvm-gcc.
-
-=over 4
-
-=item -mllvm-backend=BACKEND
-
-Use BACKEND for native code generation.
-
-=item -v
-
-Print command lines that llvm-native-gcc runs.
-
-=item -o FILE
-
-llvm-native-gcc tries to guess the name of the llvm-gcc output file by looking
-for this option in the command line. If it can't find it, it finds the last C
-or C++ source file named on the command line, and turns its suffix into .o. See
-BUGS.
-
-=item -save-temps
-
-Save temporary files used by llvm-native-gcc (and llvm-gcc, and gcc).
-
-=back
-
-=head1 BUGS
-
-llvm-native-gcc only handles the case where llvm-gcc compiles a single
-file per invocation. llvm-native-gcc has weak command-line argument
-parsing and is a poor substitute for making gcc/gcc.c do this stuff.
-
-This manual page does not adequately document native-build mode.
-
-llvm-native-gcc is pretty gross because it represents the blind merging of two
-other scripts that predated it. It could use some code clean-up.
-
-=head1 SEE ALSO
-
-gcc(1)
-
-=head1 AUTHOR
-
-Brian R. Gaeke
-
-=cut
diff --git a/release_23/utils/llvm-native-gxx b/release_23/utils/llvm-native-gxx
deleted file mode 100755
index 75164af237ef..000000000000
--- a/release_23/utils/llvm-native-gxx
+++ /dev/null
@@ -1,249 +0,0 @@
-#!/usr/bin/perl
-# Wrapper around LLVM tools to generate a native .o from llvm-gxx using an
-# LLVM back-end (CBE by default).
-
-# set up defaults.
-$Verbose = 0;
-$SaveTemps = 1;
-$PreprocessOnly = 0;
-$CompileDontLink = 0;
-$Backend = 'cbe';
-chomp ($ProgramName = `basename $0`);
-
-sub boldprint {
- print "", @_, "";
-}
-
-# process command-line options.
-# most of these are passed on to llvm-gxx.
-$GCCOptions = "";
-for ($i = 0; $i <= $#ARGV; ++$i) {
- if ($ARGV[$i] =~ /-mllvm-backend=([a-z0-9]*)/) {
- $Backend = $1;
- if ($ProgramName =~ /llvm-native-gxx/) {
- splice (@ARGV, $i, 1);
- --$i;
- }
- } elsif ($ARGV[$i] eq "-E") {
- $PreprocessOnly = 1;
- } elsif ($ARGV[$i] eq "-c") {
- $GCCOptions .= " " . $ARGV[$i];
- $CompileDontLink = 1;
- } elsif ($ARGV[$i] eq "-v") {
- $GCCOptions .= " " . $ARGV[$i];
- $Verbose = 1;
- } elsif ($ARGV[$i] eq "-o") {
- $OutputFile = $ARGV[$i + 1];
- } elsif ($ARGV[$i] eq "-save-temps") {
- $GCCOptions .= " " . $ARGV[$i];
- $SaveTemps = 1;
- } elsif ($ARGV[$i] =~ /\.bc$/) {
- push (@BytecodeFiles, $ARGV[$i]);
- } elsif ($ARGV[$i] =~ /^-L/) {
- $GCCOptions .= " " . $ARGV[$i];
- push (@LibDirs, $ARGV[$i]);
- } elsif ($ARGV[$i] =~ /^-l/) {
- $GCCOptions .= " " . $ARGV[$i];
- push (@Libs, $ARGV[$i]);
- } elsif ($ARGV[$i] =~ /\.(c|cpp|cc|i|ii|C)$/) {
- $LastCFile = $ARGV[$i];
- }
-}
-
-sub GetDefaultOutputFileName {
- my $DefaultOutputFileBase;
-
- if ($ProgramName =~ /llvm-native-gxx/) {
- $DefaultOutputFileBase = $LastCFile;
- } elsif ($ProgramName =~ /native-build/) {
- $DefaultOutputFileBase = $BytecodeFiles[0];
- }
-
- my $def = $DefaultOutputFileBase;
-
- die "Can't figure out name of output file.\n"
- unless $DefaultOutputFileBase
- && (($ProgramName !~ /native-build/)
- || $#BytecodeFiles == 0);
-
- print "Warning: defaulting output file name ",
- "based on '$DefaultOutputFileBase'\n" if $Verbose;
-
- if ($ProgramName =~ /llvm-native-gxx/) {
- $def =~ s/\.(c|cpp|cc|i|ii|C)$/.o/;
- } elsif ($ProgramName =~ /native-build/) {
- $def =~ s/\.bc$/.$Backend/;
- if ($CompileDontLink) {
- $def .= ".o";
- }
- }
-
- return $def;
-}
-
-# run a command, optionally echoing, and quitting if it fails:
-sub run {
- my $command = join(" ", @_);
- print "$command\n" if $Verbose;
- $command =~ s/\"/\\\"/g;
- system $command and die "$0: $command failed";
-}
-
-sub LinkBytecodeFilesIntoTemporary {
- my $FinalOutputFileName = shift @_;
- my @BytecodeFiles = @_;
-
- my $BCFiles = join (" ", @BytecodeFiles);
- my $LinkedBCFile;
- if ($SaveTemps) {
- $LinkedBCFile = "${FinalOutputFileName}.llvm.bc";
- } else {
- $LinkedBCFile = "/tmp/nativebuild-$$.llvm.bc";
- }
- run "llvm-link -o $LinkedBCFile $BCFiles";
- return $LinkedBCFile;
-}
-
-sub CompileBytecodeToNative {
- my ($BCFile, $Backend, $OutputFile) = @_;
-
- my $GeneratedCode;
- if ($Backend eq 'cbe') {
- if ($SaveTemps) {
- $GeneratedCode = "${OutputFile}.c";
- } else {
- $GeneratedCode = "/tmp/nativebuild-$$.c";
- }
- run "llc -march=c -f -o $GeneratedCode $BCFile";
- } elsif ($Backend eq 'llc') {
- if ($SaveTemps) {
- $GeneratedCode = "${OutputFile}.s";
- } else {
- $GeneratedCode = "/tmp/nativebuild-$$.s";
- }
- run "llc -f -o $GeneratedCode $BCFile";
- }
- my $LibDirs = join (" ", @LibDirs);
- my $Libs = join (" ", @Libs);
- run "gcc $GCCOptions $GeneratedCode -o $OutputFile $LibDirs $Libs";
- run "rm $BCFile $GeneratedCode"
- unless $SaveTemps;
-}
-
-sub CompileCToNative {
- my ($LLVMGCCCommand, $Backend, $OutputFile) = @_;
- run $LLVMGCCCommand;
- if ($PreprocessOnly) {
- return;
- }
- my $BCFile = "${OutputFile}.llvm.bc";
- if ($CompileDontLink) {
- run "mv ${OutputFile} $BCFile";
- } else { # gccld messes with the output file name
- run "mv ${OutputFile}.bc $BCFile";
- }
- my $GeneratedCode;
- if ($Backend eq 'cbe') {
- $GeneratedCode = "${OutputFile}.cbe.c";
- run "llc -march=c -f -o $GeneratedCode $BCFile";
- } elsif ($Backend eq 'llc') {
- $GeneratedCode = "${OutputFile}.llc.s";
- run "llc -f -o $GeneratedCode $BCFile";
- }
- my $NativeGCCOptions = "";
- if ($CompileDontLink) {
- $NativeGCCOptions = "-c";
- }
- run "gcc $NativeGCCOptions $GeneratedCode -o $OutputFile";
- run "rm ${OutputFile}.llvm.bc $GeneratedCode"
- unless $SaveTemps;
-}
-
-# guess the name of the output file, if -o was not specified.
-$OutputFile = GetDefaultOutputFileName () unless $OutputFile;
-print "Output file is $OutputFile\n" if $Verbose;
-# do all the dirty work:
-if ($ProgramName eq /native-build/) {
- my $LinkedBCFile = LinkBytecodeFilesIntoTemporary (@BytecodeFiles);
- CompileBytecodeToNative ($LinkedBCFile, $Backend, $OutputFile);
-} elsif ($ProgramName =~ /llvm-native-gxx/) {
- # build the llvm-gxx command line.
- $LLVMGCCCommand = join (" ", ("llvm-g++", @ARGV));
- CompileCToNative ($LLVMGCCCommand, $Backend, $OutputFile);
-}
-
-# we're done.
-exit 0;
-
-__END__
-
-=pod
-
-=head1 NAME
-
-llvm-native-gxx
-
-=head1 SYNOPSIS
-
-llvm-native-g++ [OPTIONS...] FILE
-
-native-build [OPTIONS...] FILE
-
-=head1 DESCRIPTION
-
-llvm-native-g++ is a wrapper around the LLVM command-line tools which generates
-a native object (.o) file by compiling FILE with llvm-g++, and then running
-an LLVM back-end (CBE by default) over the resulting bytecode, and then
-compiling the resulting code to a native object file.
-
-If called as "native-build", it compiles bytecode to native code, and takes
-different options.
-
-=head1 OPTIONS
-
-llvm-native-g++ takes the same options as llvm-gcc. All options
-except -mllvm-backend=... are passed on to llvm-g++.
-
-=over 4
-
-=item -mllvm-backend=BACKEND
-
-Use BACKEND for native code generation.
-
-=item -v
-
-Print command lines that llvm-native-g++ runs.
-
-=item -o FILE
-
-llvm-native-g++ tries to guess the name of the llvm-g++ output file by looking
-for this option in the command line. If it can't find it, it finds the last C
-or C++ source file named on the command line, and turns its suffix into .o. See
-BUGS.
-
-=item -save-temps
-
-Save temporary files used by llvm-native-g++ (and llvm-g++, and g++).
-
-=back
-
-=head1 BUGS
-
-llvm-native-g++ only handles the case where llvm-g++ compiles a single
-file per invocation. llvm-native-g++ has weak command-line argument
-parsing and is a poor substitute for making g++/g++.c do this stuff.
-
-This manual page does not adequately document native-build mode.
-
-llvm-native-g++ is pretty gross because it represents the blind merging of two
-other scripts that predated it. It could use some code clean-up.
-
-=head1 SEE ALSO
-
-g++(1)
-
-=head1 AUTHOR
-
-Brian R. Gaeke
-
-=cut
diff --git a/release_23/utils/llvmdo b/release_23/utils/llvmdo
deleted file mode 100755
index 42fa33790041..000000000000
--- a/release_23/utils/llvmdo
+++ /dev/null
@@ -1,198 +0,0 @@
-#!/bin/sh
-##===- utils/llvmdo - Counts Lines Of Code -------------------*- Script -*-===##
-#
-# The LLVM Compiler Infrastructure
-#
-# This file is distributed under the University of Illinois Open Source
-# License. See LICENSE.TXT for details.
-#
-##===----------------------------------------------------------------------===##
-#
-# This script is a general purpose "apply" function for the source files in LLVM
-# It uses "find" to locate all the source files and then applies the user's
-# command to them. As such, this command is often not used by itself much but
-# the other find related tools (countloc.sh,llvmgrep,getsrcs.sh,userloc.sh) are
-# all based on this script. This script defines "what is a source file" in
-# LLVM and so should be maintained if new directories, new file extensions,
-# etc. are used in LLVM as it progresses.
-#
-# Usage:
-# llvmdo [-topdir DIR] [-dirs "DIRNAMES..."] [-code-only] PROGRAM ARGS...
-#
-# The -topdir option allows you to specify the llvm source root directly. If it
-# is not specified then it will be obtained with llvm-config which must be built
-# and in your path.
-#
-# The -dirs argument allows you to specify the set of directories that are
-# searched. The default list of directories searched is:
-# include lib tools utils runtime autoconf docs test examples projects
-# Note that you must use quotes around the list of directory names.
-#
-# The -code-only option specifies that only those files that are considered
-# "code" should be visited. HTML documentation is considered code, but things
-# like README files, etc. are not.
-#
-# Finally, you simply specify whatever program you want to run against each
-# file and the arguments to give it. The PROGRAM will be given the file name
-# as its last argument.
-##===----------------------------------------------------------------------===##
-
-if test $# -lt 1 ; then
- echo "Usage: llvmdo [-topdir DIR] [-dirs "DIRNAMES..."] [-code-only] PROGRAM ARGS..."
- exit 1
-fi
-
-if test "$1" = "-topdir" ; then
- TOPDIR="$2"
- shift; shift;
-else
- TOPDIR=`llvm-config --src-root`
-fi
-
-if test "$1" = "-dirs" ; then
- LLVMDO_DIRS="$2"
- shift ; shift
-elif test -z "$LLVMDO_DIRS" ; then
- LLVMDO_DIRS="include lib tools utils runtime autoconf docs test examples projects"
-fi
-
-if test "$1" = "-code-only" ; then
- CODE_ONLY="set"
- shift
-else
- CODE_ONLY=""
-fi
-
-if test "$1" = "" ; then
- echo "Missing program name to run"
- exit 1
-fi
-
-PROGRAM=`which $1`
-if test ! -x "$PROGRAM" ; then
- echo "Can't execute $1"
- exit 1
-fi
-shift;
-
-paths_to_ignore="\
- -path */CVS -o \
- -path */CVS/* -o \
- -path */.svn/ -o \
- -path */.svn/* -o \
- -path docs/doxygen/* -o \
- -path docs/CommandGuide/html/* -o \
- -path docs/CommandGuide/man/* -o \
- -path docs/CommandGuide/ps/* -o \
- -path docs/CommandGuide/man/* -o \
- -path docs/HistoricalNotes/* -o \
- -path docs/img/* -o \
- -path */.libs/* -o \
- -path lib/Support/bzip2/* -o \
- -path projects/llvm-test/* \
-"
-files_to_match="\
- -name *.ac \
- -o -name *.b \
- -o -name *.c \
- -o -name *.cc \
- -o -name *.cfg \
- -o -name *.cpp \
- -o -name *.css \
- -o -name *.def \
- -o -name *.el \
- -o -name *.exp \
- -o -name *.footer \
- -o -name *.gnuplot' \
- -o -name *.h \
- -o -name *.header \
- -o -name *.html \
- -o -name *.in \
- -o -name *.inc \
- -o -name *.intro \
- -o -name *.l \
- -o -name *.ll \
- -o -name *.llx \
- -o -name *.lst \
- -o -name *.m4 \
- -o -name *.pod \
- -o -name *.pl \
- -o -name *.py \
- -o -name *.sh \
- -o -name *.schema \
- -o -name *.st \
- -o -name *.tcl \
- -o -name *.td \
- -o -name *.tr \
- -o -name *.y \
- -o -name Make* \
- -o -name llvmdo \
- -o -name llvmgrep \
- -o -name check-each-file \
- -o -name codgen-diff \
- -o -name cvsupdate \
- -o -name llvm-native-gcc \
- -o -name llvm-native-gxx \
- -o -name makellvm \
- -o -path include/llvm/ADT/ilist \
- -o -path test/\*.ll \
- -o -path test/Scripts/not \
- -o -path runtime/\*.ll \
-"
-if test -z "$CODE_ONLY" ; then
- files_to_match="$files_to_match \
- -o -name *.txt \
- -o -name *.TXT \
- -o -name *.vim \
- -o -name vimrc \
- -o -name README \
- -o -name COPYING.LIB \
- -o -name LICENSE* "
-fi
-files_to_ignore="\
- -name \.* \
- -o -name *~ \
- -o -name #* \
- -o -name *.cvs \
- -o -name configure \
- -o -name slow.ll \
- -o -name *libtool* \
- -o -name ltdl* \
- -o -name ltdl.m4 \
- -o -name ltmain.m4 \
- -o -name ltmain.sh \
- -o -name aclocal.m4 \
- -o -name acinclude.m4 \
- -o -name *VerifierIsReallySlow.llx \
- -o -name *LoopSimplifyCrash.ll \
- -o -name *AST-Remove.ll \
- -o -name llvmAsmParser.cpp \
- -o -name llvmAsmParser.h \
- -o -name Lexer.cpp \
- -o -name FileLexer.cpp \
- -o -name FileParser.cpp \
- -o -name FileParser.h \
- -o -name StackerParser.h \
- -o -name StackerParser.cpp \
- -o -name ConfigLexer.cpp \
- -o -name PPCPerfectShuffle.h \
-"
-
-if test -d "$TOPDIR" ; then
- cd $TOPDIR
- # Have to use the right "find" on a per-platform basis. Most platforms have
- # Gnu find as "find", but Solaris does not.
- case `uname -s` in
- SunOS) find_prog=gfind ;;
- *) find_prog=find ;;
- esac
- # Turn off file name generation (globbing) so that substitution of the
- # variables doesn't cause the shell to create lists of file names
- set -f
- $find_prog $LLVMDO_DIRS -type f \
- \( $paths_to_ignore \) -prune \
- -o \( \( $files_to_match \) \! \( $files_to_ignore \) \
- -exec $PROGRAM "$@" {} \; \)
-else
- echo "Can't find LLVM top directory in $TOPDIR"
-fi
diff --git a/release_23/utils/llvmgrep b/release_23/utils/llvmgrep
deleted file mode 100755
index 7d7355ba9904..000000000000
--- a/release_23/utils/llvmgrep
+++ /dev/null
@@ -1,39 +0,0 @@
-#!/bin/sh
-##===- utils/llvmgrep - Counts Lines Of Code -----------------*- Script -*-===##
-#
-# The LLVM Compiler Infrastructure
-#
-# This file is distributed under the University of Illinois Open Source
-# License. See LICENSE.TXT for details.
-#
-##===----------------------------------------------------------------------===##
-#
-# This script searches your srcdir for an egrep style pattern. This can quickly
-# help you build a list of the places you need to modify when changing a header
-# or other "global" name. The only argument is the pattern you want to search
-# for. It should be quoted to escape shell interpretation of the pattern's
-# special characters.
-#
-# Note that the implementation is based on llvmdo. See that script for more
-# details.
-##===----------------------------------------------------------------------===##
-
-if test "$1" = "-topdir" ; then
- TOPDIR="$2"
- shift; shift;
-else
- TOPDIR=`llvm-config --src-root`
-fi
-
-if test -d "$TOPDIR" ; then
- cd $TOPDIR
- case `uname -s` in
- SunOS) grep_cmd="ggrep -H -n" ;;
- Linux) grep_cmd="egrep -H -n" ;;
- *) grep_cmd="egrep -l -n" ;;
- esac
- ./utils/llvmdo -topdir "$TOPDIR" \
- -dirs "include lib tools utils docs examples test projects" $grep_cmd "$*"
-else
- echo "Can't find LLVM top directory"
-fi
diff --git a/release_23/utils/makellvm b/release_23/utils/makellvm
deleted file mode 100755
index 9c479efc96ca..000000000000
--- a/release_23/utils/makellvm
+++ /dev/null
@@ -1,144 +0,0 @@
-#!/bin/csh -f
-
-set pstatus = 0
-onintr cleanup
-alias usage 'echo "USAGE: $0:t [-h] [-n] [-obj obj-root] [gmake-flags] [VAR=...] [toolname (default: opt)]"; set pstatus = 1; goto cleanup'
-
-set EXEC = opt
-set GMAKE_OPTS = ""
-set DEBUG = 0
-
-## Search path for automatically finding the obj-root to use.
-## Note: The src root directory ${LLVMDIR} will be prepended to this path later.
-##
-set OBJROOTDIRLIST = ( )
-
-set doit = 1
-unset options_done
-while ( !( $?options_done ) && ($#argv > 0))
- switch ($argv[1])
- case -h :
- usage
- case -f :
- if ($#argv < 2) usage
- shift argv; set MFILE = $argv[1]; shift argv; breaksw
- case -n :
- set doit = 0; shift argv; breaksw
- case -obj :
- set OBJROOT = $argv[2]; shift argv; shift argv
- if (! -d "$OBJROOT") then
- echo "FATAL: Illegal obj-root directory ${OBJROOT}"
- exit 1
- endif
- breaksw
- case -d :
- set doit = 0; set DEBUG = 1; shift argv; breaksw
- case -* :
- set GMAKE_OPTS = ( $GMAKE_OPTS $argv[1] ); shift argv; breaksw
- default :
- set optarg = `echo -n $argv[1] | sed 's/^[^=]*$//'`
- if ($#optarg) then
- set GMAKE_OPTS = ( $GMAKE_OPTS $optarg )
- shift argv
- else
- set options_done
- endif
- breaksw
- endsw
-end
-
-if ($#argv > 1) then
- echo 'ERROR: More than one tool is not supported by "makellvm"'
- usage
-endif
-if ($#argv > 0) then
- set EXEC = $argv[1]
-endif
-if ($DEBUG) then
- echo "DEBUG: EXEC = $EXEC"
-endif
-
-## Compute LLVMDIR: the root of the current LLVM tree.
-## It is recorded in the variable LEVEL in Makefile, to compute it
-##
-if (! $?MFILE) then
- if (-f GNUmakefile) then
- set MFILE = GNUmakefile
- else if (-f makefile) then
- set MFILE = makefile
- else
- set MFILE = Makefile
- endif
-endif
-if ($DEBUG) then
- echo "DEBUG: MFILE = $MFILE"
-endif
-if (! -f $MFILE) then
- echo "Missing or invalid makefile: $MFILE"
- exit 1
-endif
-
-set LLVMDIR = `awk '/LEVEL[ ]*=/ {print $NF}' $MFILE`
-if ($DEBUG) then
- echo "DEBUG: LLVMDIR = $LLVMDIR"
-endif
-
-if ($#LLVMDIR == 0 || ! -d "$LLVMDIR") then
- echo "Unable to find LLVM src-root directory or directory is invalid."
- echo "Are you within a valid LLVM directory for running gmake?"
- exit 1
-endif
-
-## Try to determine the obj-root directory automatically if not specified
-##
-set OBJROOTDIRLIST = ( ${LLVMDIR} $OBJROOTDIRLIST ) ## add src dir
-if ($?OBJROOT == 0) then
- ## Try to determine object root directory by looking for Makefile.config
- foreach objdir ( $OBJROOTDIRLIST )
- if (-f "${objdir}/Makefile.config") then
- set OBJROOT = ${objdir}
- break
- endif
- end
- if ($?OBJROOT == 0) then
- echo "FATAL: Could not choose an obj-root directory from these choices:"
- echo " ${OBJROOTDIRLIST}."
- echo " You can specify it explicitly using '-obj obj-root'."
- exit 1
- endif
- echo "Using OBJ-ROOT = ${OBJROOT} (specify '-obj obj-root' to override)."
-endif
-if (${OBJROOT} == ${LLVMDIR}) then
- # run make in the source directory itself
- set BUILDROOT = .
-else
- # run make in the in the obj-root tree, in the directory for $cwd
- set SRCROOT = `sh -c "cd $LLVMDIR; pwd | sed 's/\//\\\//g'"`
- set CURSRCDIR = `echo $cwd | sed -e "s/${SRCROOT}//"`
- set BUILDROOT = ${OBJROOT}/${CURSRCDIR}
- unset SRCROOT CURSRCDIR
-endif
-if ($DEBUG) then
- echo "DEBUG: BUILDROOT = $BUILDROOT"
-endif
-if (! -d $BUILDROOT) then
- echo "FATAL: Invalid build directory: ${BUILDROOT}"
- exit 1
-endif
-cd $BUILDROOT
-
-set CMD = "make $GMAKE_OPTS && (cd $LLVMDIR/tools/$EXEC && make $GMAKE_OPTS)"
-
-if ($doit == 1) then
- csh -f -c "$CMD"
-else
- echo '(NOT EXECUTING) COMMAND:'
- echo " $CMD"
-endif
-
-
-#=========================================================
-# CODE TO BE EXECUTED IF INTERRUPT IS RECEIVED
-#=========================================================
-cleanup:
- exit($pstatus)
diff --git a/release_23/utils/mkpatch b/release_23/utils/mkpatch
deleted file mode 100755
index c8df21c9ec9f..000000000000
--- a/release_23/utils/mkpatch
+++ /dev/null
@@ -1,37 +0,0 @@
-#!/bin/bash
-#
-# This script makes a patch for LLVM ensuring the correct diff options and
-# putting the files in a standard review order.
-
-
-function error {
- retcode="$?"
- echo "mkpatch: error: $1 ($retcode)"
- exit 1
-}
-
-if [ ! -e llvm.spec.in ] ; then
- error "Please change directory to the LLVM top source directory"
-fi
-if [ "$#" -ne 1 ] ; then
- error "usage: utils/mkpatch [PATCH_NAME]"
-fi
-NAME="$1"
-echo "mkpatch: Generating differences on top level files"
-svn diff -N -x -u > "$NAME".patch.raw 2>&1
-echo "mkpatch: Generating differences on all directories"
-svn diff -x -u >> "$NAME".patch.raw 2>&1 \
- autoconf docs utils include lib/System lib/Support lib/VMCore lib/AsmParser \
- lib/Bitcode lib/Analysis lib/Transforms lib/CodeGen lib/Target \
- lib/ExecutionEngine lib/Debugger lib/Linker \
- tools test runtime projects examples win32 Xcode
-
-echo "mkpatch: Removing cruft from the patch file"
-sed -e '/^[?] .*/d' -e '/^cvs diff: Diffing/d' "$NAME".patch.raw | awk '\
-BEGIN { deleting = 0; } \
-/^Index: .*[.]cvs$/ { deleting = 1; fname=substr($0,7); \
- print "Skipping: ", fname > "/dev/stderr"; } \
-/^Index:.*/ && !/^Index: .*[.]cvs$/ { deleting = 0; } \
-{ if (! deleting) { print; } } ' > "$NAME".patch || \
- error "sed/awk cleanup failed"
-
diff --git a/release_23/utils/parseNLT.pl b/release_23/utils/parseNLT.pl
deleted file mode 100644
index 95afca73a132..000000000000
--- a/release_23/utils/parseNLT.pl
+++ /dev/null
@@ -1,34 +0,0 @@
-#!/usr/bin/perl
-# a first attempt to parse the nightly tester pages into something
-# one can reason about, namely import into a database
-# USE: perl parseNLT.pl <2005-03-31.html
-# for example
-
-while(<>)
- {
- if (/LLVM Test Results for (\w+) (\d+), (\d+)</)
- {
- $mon = $1;
- $day = $2;
- $year = $3;
- }
- if (/<td>([^<]+)<\/td>/)
- {
- if ($prefix)
- { $output .= "$1 "; $count++; }
- }
- if (/<tr/)
- {
- if ($output and $count > 3)
- { print "\n$day $mon $year $prefix/$output"; }
- $output = "";
- $count = 0;
- }
- if (/<h2>(Programs.+)<\/h2>/)
- {
- $prefix = $1;
- }
- }
-
-if ($output)
- { print "\n$day $mon $year $prefix/$output"; $output = ""; }
diff --git a/release_23/utils/plotNLT.pl b/release_23/utils/plotNLT.pl
deleted file mode 100644
index 55d503d68933..000000000000
--- a/release_23/utils/plotNLT.pl
+++ /dev/null
@@ -1,53 +0,0 @@
-#!/usr/bin/perl
-#takes a test and a program from a dp and produces a gnuplot script
-#use like perl plotNLT.pl password Programs/MultiSource/Benchmarks/ASCI_Purple/SMG2000/smg2000 llc
-
-use DBI;
-
-# database information
-$db="llvmalpha";
-$host="localhost";
-$userid="llvmdbuser";
-$passwd=shift @ARGV;
-$connectionInfo="dbi:mysql:$db;$host";
-
-# make connection to database
-$dbh = DBI->connect($connectionInfo,$userid,$passwd) or die DBI->errstr;
-
-
-$count = @ARGV / 2;
-
-print "set xdata time\n";
-print 'set timefmt "%Y-%m-%d"';
-print "\nplot";
-for ($iter = 0; $iter < $count; $iter++) {
- if ($iter)
- { print ","; }
- print " '-' using 1:2 with lines";
-}
-
-print "\n";
-
-for ($iter = 0; $iter < $count; $iter++) {
-
- $prog = shift @ARGV;
- $test = shift @ARGV;
-
- $query = "Select RUN, VALUE from Tests where TEST = '$test' AND NAME = '$prog' ORDER BY RUN";
- #print "\n$query\n";
-
- my $sth = $dbh->prepare( $query) || die "Can't prepare statement: $DBI::errstr";;
-
- my $rc = $sth->execute or die DBI->errstr;
-
- while(($da,$v) = $sth->fetchrow_array)
- {
- print "$da $v\n";
- }
-
- print "e\n";
-}
-
-
-# disconnect from database
-$dbh->disconnect;
diff --git a/release_23/utils/profile.pl b/release_23/utils/profile.pl
deleted file mode 100755
index f9950f97fea8..000000000000
--- a/release_23/utils/profile.pl
+++ /dev/null
@@ -1,74 +0,0 @@
-#!/usr/bin/perl -w
-#
-# Program: profile.pl
-#
-# Synopsis: Insert instrumentation code into a program, run it with the JIT,
-# then print out a profile report.
-#
-# Syntax: profile.pl [OPTIONS] bytecodefile <arguments>
-#
-# OPTIONS may include one or more of the following:
-# -block - Enable basicblock profiling
-# -edge - Enable edge profiling
-# -function - Enable function profiling
-# -o <filename> - Emit profiling information to the specified file, instead
-# of llvmprof.out
-#
-# Any unrecognized options are passed into the invocation of llvm-prof
-#
-
-my $ProfilePass = "-insert-edge-profiling";
-
-my $LLVMProfOpts = "";
-my $ProgramOpts = "";
-my $ProfileFile = "";
-
-# Parse arguments...
-while (scalar(@ARGV) and ($_ = $ARGV[0], /^[-+]/)) {
- shift;
- last if /^--$/; # Stop processing arguments on --
-
- # List command line options here...
- if (/^-?-block$/) { $ProfilePass = "-insert-block-profiling"; next; }
- if (/^-?-edge$/) { $ProfilePass = "-insert-edge-profiling"; next; }
- if (/^-?-function$/) { $ProfilePass = "-insert-function-profiling"; next; }
- if (/^-?-o$/) { # Read -o filename...
- die "-o option requires a filename argument!" if (!scalar(@ARGV));
- $ProgramOpts .= " -llvmprof-output $ARGV[0]";
- $ProfileFile = $ARGV[0];
- shift;
- next;
- }
- if (/^-?-help$/) {
- print "OVERVIEW: profile.pl - Instrumentation and profile printer.\n\n";
- print "USAGE: profile.pl [options] program.bc <program args>\n\n";
- print "OPTIONS:\n";
- print " -block - Enable basicblock profiling\n";
- print " -edge - Enable edge profiling\n";
- print " -function - Enable function profiling\n";
- print " -o <file> - Specify an output file other than llvm-prof.out.\n";
- print " -help - Print this usage information\n";
- print "\nAll other options are passed into llvm-prof.\n";
- exit 1;
- }
-
- # Otherwise, pass the option on to llvm-prof
- $LLVMProfOpts .= " " . $_;
-}
-
-die "Must specify LLVM bytecode file as first argument!" if (@ARGV == 0);
-
-my $BytecodeFile = $ARGV[0];
-
-shift @ARGV;
-
-my $libdir = `llvm-config --libdir`;
-chomp $libdir;
-
-my $LibProfPath = $libdir . "/profile_rt.so";
-
-system "opt -q -f $ProfilePass $BytecodeFile -o $BytecodeFile.inst";
-system "lli -fake-argv0 '$BytecodeFile' -load $LibProfPath " .
- "$BytecodeFile.inst $ProgramOpts " . (join ' ', @ARGV);
-system "rm $BytecodeFile.inst";
-system "llvm-prof $LLVMProfOpts $BytecodeFile $ProfileFile";
diff --git a/release_23/utils/userloc.pl b/release_23/utils/userloc.pl
deleted file mode 100755
index 4da2f4029250..000000000000
--- a/release_23/utils/userloc.pl
+++ /dev/null
@@ -1,216 +0,0 @@
-#!/usr/bin/perl -w
-#
-# Program: userloc.pl
-#
-# Synopsis: This program uses "cvs annotate" to get a summary of how many lines
-# of code the various developres are responsible for. It takes one
-# argument, the directory to process. If the argument is not specified
-# then the cwd is used. The directory must be an LLVM tree checked out
-# from cvs.
-#
-# Syntax: userloc.pl [-tag=tag|-html... <directory>...
-#
-# Options:
-# -tag=tag
-# Use "tag" to select the revision (as per cvs -r option)
-# -filedetails
-# Report details about lines of code in each file for each user
-# -html
-# Generate HTML output instead of text output
-# -topdir
-# Specify where the top llvm source directory is. Otherwise the
-# llvm-config tool is used to find it.
-# Directories:
-# The directories passed after the options should be relative paths to
-# directories of interest from the top of the llvm source tree, e.g. "lib"
-# or "include", etc.
-
-die "Usage userloc.pl [-tag=tag|-html] <directories>..."
- if ($#ARGV < 0);
-
-my $tag = "";
-my $html = 0;
-my $debug = 0;
-my $filedetails = "";
-my $srcroot = "";
-while ( defined($ARGV[0]) && substr($ARGV[0],0,1) eq '-' )
-{
- if ($ARGV[0] =~ /-tag=.*/) {
- $tag = $ARGV[0];
- $tag =~ s#-tag=(.*)#$1#;
- } elsif ($ARGV[0] =~ /-filedetails/) {
- $filedetails = 1;
- } elsif ($ARGV[0] eq "-html") {
- $html = 1;
- } elsif ($ARGV[0] eq "-debug") {
- $debug = 1;
- } elsif ($ARGV[0] eq "-topdir") {
- shift; $srcroot = $ARGV[0]; shift;
- } else {
- die "Invalid option: $ARGV[0]";
- }
- shift;
-}
-
-if (length($srcroot) == 0) {
- chomp($srcroot = `llvm-config --src-root`);
-}
-if (! -d "$srcroot") {
- die "Invalid source root: $srcroot\n";
-}
-chdir($srcroot);
-my $llvmdo = "$srcroot/utils/llvmdo -topdir '$srcroot'";
-my %Stats;
-my %FileStats;
-
-my $annotate = "cvs -z6 annotate -lf ";
-if (length($tag) > 0)
-{
- $annotate = $annotate . " -r" . $tag;
-}
-
-sub GetCVSFiles
-{
- my $d = $_[0];
- my $files ="";
- open FILELIST,
- "$llvmdo -dirs \"$d\" -code-only echo |" || die "Can't get list of files with llvmdo";
- while ( defined($line = <FILELIST>) ) {
- chomp($file = $line);
- print "File: $file\n" if ($debug);
- $files = "$files $file";
- }
- return $files;
-}
-
-sub ScanDir
-{
- my $Dir = $_[0];
- my $files = GetCVSFiles($Dir);
-
- open (DATA,"$annotate $files 2>&1 |")
- || die "Can't read cvs annotation data";
-
- my $curfile = "";
- while ( defined($line = <DATA>) )
- {
- chomp($line);
- if ($line =~ '^Annotations for.*') {
- $curfile = $line;
- $curfile =~ s#^Annotations for ([[:print:]]*)#$1#;
- print "Scanning: $curfile\n" if ($debug);
- } elsif ($line =~ /^[0-9.]*[ \t]*\([^)]*\):/) {
- $uname = $line;
- $uname =~ s#^[0-9.]*[ \t]*\(([a-zA-Z0-9_.-]*) [^)]*\):.*#$1#;
- $Stats{$uname}++;
- if ($filedetails) {
- $FileStats{$uname} = {} unless exists $FileStats{$uname};
- ${$FileStats{$uname}}{$curfile}++;
- }
- }
- }
- close DATA;
-}
-
-sub printStats
-{
- my $dir = $_[0];
- my $hash = $_[1];
- my $user;
- my $total = 0;
-
- foreach $user (keys %Stats) { $total += $Stats{$user}; }
-
- if ($html) {
- print "<p>Total Source Lines: $total<br/></p>\n";
- print "<table>";
- print " <tr><th style=\"text-align:right\">LOC</th>\n";
- print " <th style=\"text-align:right\">\%LOC</th>\n";
- print " <th style=\"text-align:left\">User</th>\n";
- print "</tr>\n";
- }
-
- foreach $user ( sort keys %Stats )
- {
- my $v = $Stats{$user};
- if (defined($v))
- {
- if ($html) {
- printf "<tr><td style=\"text-align:right\">%d</td><td style=\"text-align:right\">(%4.1f%%)</td><td style=\"text-align:left\">", $v, (100.0/$total)*$v;
- if ($filedetails) {
- print "<a href=\"#$user\">$user</a></td></tr>";
- } else {
- print $user,"</td></tr>";
- }
- } else {
- printf "%8d (%4.1f%%) %s\n", $v, (100.0/$total)*$v, $user;
- }
- }
- }
- print "</table>\n" if ($html);
-
- if ($filedetails) {
- foreach $user (sort keys %FileStats) {
- my $total = 0;
- foreach $file (sort keys %{$FileStats{$user}}) {
- $total += ${$FileStats{$user}}{$file}
- }
- if ($html) {
- print "<table><tr><th style=\"text-align:left\" colspan=\"3\"><a name=\"$user\">$user</a></th></tr>\n";
- } else {
- print $user,":\n";
- }
- foreach $file (sort keys %{$FileStats{$user}}) {
- my $v = ${$FileStats{$user}}{$file};
- if ($html) {
- printf "<tr><td style=\"text-align:right\">&nbsp;&nbsp;%d</td><td
- style=\"text-align:right\">&nbsp;%4.1f%%</td><td
- style=\"text-align:left\">%s</td></tr>",$v, (100.0/$total)*$v,$file;
- } else {
- printf "%8d (%4.1f%%) %s\n", $v, (100.0/$total)*$v, $file;
- }
- }
- if ($html) { print "</table>\n"; }
- }
- }
-}
-
-
-if ($html)
-{
-print "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">\n";
-print "<html>\n<head>\n";
-print " <title>LLVM LOC Based On CVS Annotation</title>\n";
-print " <link rel=\"stylesheet\" href=\"llvm.css\" type=\"text/css\"/>\n";
-print "</head>\n";
-print "<body><div class=\"doc_title\">LLVM LOC Based On CVS Annotation</div>\n";
-print "<p>This document shows the total lines of code per user in each\n";
-print "LLVM directory. Lines of code are attributed by the user that last\n";
-print "committed the line. This does not necessarily reflect authorship.</p>\n";
-}
-
-my @DIRS;
-if ($#ARGV > 0) {
- @DIRS = @ARGV;
-} else {
- push @DIRS, 'include';
- push @DIRS, 'lib';
- push @DIRS, 'tools';
- push @DIRS, 'runtime';
- push @DIRS, 'docs';
- push @DIRS, 'test';
- push @DIRS, 'utils';
- push @DIRS, 'examples';
- push @DIRS, 'projects/Stacker';
- push @DIRS, 'projects/sample';
- push @DIRS, 'autoconf';
-}
-
-for $Index ( 0 .. $#DIRS) {
- print "Scanning Dir: $DIRS[$Index]\n" if ($debug);
- ScanDir($DIRS[$Index]);
-}
-
-printStats;
-
-print "</body></html>\n" if ($html) ;
diff --git a/release_23/utils/vim/README b/release_23/utils/vim/README
deleted file mode 100644
index 466de4f686a2..000000000000
--- a/release_23/utils/vim/README
+++ /dev/null
@@ -1,43 +0,0 @@
--*- llvm/utils/vim/README -*-
-
-These are syntax highlighting files for the VIM editor. Included are:
-
-* llvm.vim
-
- Syntax highlighting mode for LLVM assembly files. To use, COPY `llvm.vim' to
- ~/.vim/syntax and add this code to your ~/.vimrc :
-
- augroup filetype
- au! BufRead,BufNewFile *.ll set filetype=llvm
- au! BufRead,BufNewFile *.llx set filetype=llvm
- augroup END
-
-* tablegen.vim
-
- Syntax highlighting mode for TableGen description files. To use, COPY
- `tablegen.vim' to ~/.vim/syntax and add this code to your ~/.vimrc :
-
- augroup filetype
- au! BufRead,BufNewFile *.td set filetype=tablegen
- augroup END
-
-
-IMPORTANT: Making symlinks from ~/.vim/syntax/... to the syntax files in your
-LLVM source tree does not work, you DO need to copy the files directly.
-
-However, if you do not already have a ~/.vim/syntax/ directory, simply
-symlinking it to llvm/utils/vim will do the trick nicely, and you can stay
-up-to-date with CVS.
-
-Note: If you notice missing or incorrect syntax highlighting, please contact
-<llvmbugs [at] cs.uiuc.edu>; if you wish to provide a patch to improve the
-functionality, it will be most appreciated. Thank you.
-
-If you find yourself working with LLVM Makefiles often, but you don't get syntax
-highlighting (because the files have names such as Makefile.rules or
-TEST.nightly.Makefile), add the following to your ~/.vimrc:
-
- " LLVM Makefile highlighting mode
- augroup filetype
- au! BufRead,BufNewFile *Makefile* set filetype=make
- augroup END
diff --git a/release_23/utils/vim/llvm.vim b/release_23/utils/vim/llvm.vim
deleted file mode 100644
index b878da471c50..000000000000
--- a/release_23/utils/vim/llvm.vim
+++ /dev/null
@@ -1,69 +0,0 @@
-" Vim syntax file
-" Language: llvm
-" Maintainer: The LLVM team, http://llvm.org/
-" Updated: 2003-06-02
-
-if version < 600
- syntax clear
-elseif exists("b:current_syntax")
- finish
-endif
-
-syn case match
-
-syn keyword llvmType void float double
-syn keyword llvmType x86_fp80 fp128 ppc_fp128
-syn keyword llvmType type label opaque
-syn match llvmType /\<i\d\+\>/
-
-syn keyword llvmStatement add sub mul sdiv udiv fdiv srem urem frem
-syn keyword llvmStatement and or xor
-syn keyword llvmStatement icmp fcmp
-syn keyword llvmStatement eq ne ugt uge ult ule sgt sge slt sle
-syn keyword llvmStatement false oeq ogt oge olt ole one ord ueq ugt uge
-syn keyword llvmStatement ult ule une uno true
-
-syn keyword llvmStatement phi tail call to select shl lshr ashr va_arg
-syn keyword llvmStatement trunc zext sext
-syn keyword llvmStatement fptrunc fpext fptoui fptosi uitofp sitofp
-syn keyword llvmStatement ptrtoint inttoptr bitcast
-syn keyword llvmStatement ret br switch invoke unwind unreachable
-syn keyword llvmStatement malloc alloca free load store getelementptr
-
-syn keyword llvmStatement true false zeroinitializer
-syn keyword llvmStatement define declare global constant const
-syn keyword llvmStatement internal uninitialized external implementation
-syn keyword llvmStatement linkonce weak appending
-syn keyword llvmStatement undef null to except target datalayout triple deplibs
-syn keyword llvmStatement big little volatile fastcc coldcc cc
-syn keyword llvmStatement extractelement insertelement shufflevector
-syn keyword llvmStatement module asm align
-
-"syn match llvmFunction /%[a-zA-Z\$._\-][a-zA-Z\$._\-0-9]*/
-syn match llvmNumber /\<\d\+\>/
-syn match llvmNumber /\<\d\+\.\d*\>/
-
-syn match llvmComment /;.*$/
-syn region llvmString start=/"/ skip=/\\"/ end=/"/
-syn match llvmLabel /[\-a-zA-Z\$._0-9]*:/
-
-
-if version >= 508 || !exists("did_c_syn_inits")
- if version < 508
- let did_c_syn_inits = 1
- command -nargs=+ HiLink hi link <args>
- else
- command -nargs=+ HiLink hi def link <args>
- endif
-
- HiLink llvmType Type
- HiLink llvmStatement Statement
- HiLink llvmNumber Number
- HiLink llvmComment Comment
- HiLink llvmString String
- HiLink llvmLabel Label
-
- delcommand HiLink
-endif
-
-let b:current_syntax = "llvm"
diff --git a/release_23/utils/vim/tablegen.vim b/release_23/utils/vim/tablegen.vim
deleted file mode 100644
index d786d1463ecf..000000000000
--- a/release_23/utils/vim/tablegen.vim
+++ /dev/null
@@ -1,54 +0,0 @@
-" Vim syntax file
-" Language: TableGen
-" Maintainer: The LLVM team, http://llvm.org/
-" Updated: 2003-08-11
-
-if version < 600
- syntax clear
-elseif exists("b:current_syntax")
- finish
-endif
-
-" May be changed if you have a really slow machine
-syntax sync minlines=100
-
-syn case match
-
-syn keyword tgKeyword def let in code dag field include defm
-syn keyword tgType class int string list bit bits multiclass
-
-syn match tgNumber /\<\d\+\>/
-syn match tgNumber /\<\d\+\.\d*\>/
-syn match tgNumber /\<0b[01]\+\>/
-syn match tgNumber /\<0x[0-9a-fA-F]\+\>/
-syn region tgString start=/"/ skip=/\\"/ end=/"/ oneline
-
-syn region tgCode start=/\[{/ end=/}\]/
-
-syn keyword tgTodo contained TODO FIXME
-syn match tgComment /\/\/.*$/ contains=tgTodo
-" Handle correctly imbricated comment
-syn region tgComment2 matchgroup=tgComment2 start=+/\*+ end=+\*/+ contains=tgTodo,tgComment2
-
-if version >= 508 || !exists("did_c_syn_inits")
- if version < 508
- let did_c_syn_inits = 1
- command -nargs=+ HiLink hi link <args>
- else
- command -nargs=+ HiLink hi def link <args>
- endif
-
- HiLink tgKeyword Statement
- HiLink tgType Type
- HiLink tgNumber Number
- HiLink tgComment Comment
- HiLink tgComment2 Comment
- HiLink tgString String
- " May find a better Hilight group...
- HiLink tgCode Special
- HiLink tgTodo Todo
-
- delcommand HiLink
-endif
-
-let b:current_syntax = "tablegen"
diff --git a/release_23/utils/vim/vimrc b/release_23/utils/vim/vimrc
deleted file mode 100644
index 3c872d986227..000000000000
--- a/release_23/utils/vim/vimrc
+++ /dev/null
@@ -1,40 +0,0 @@
-" LLVM coding guidelines conformance for VIM
-" Maintainer: LLVM Team, http://llvm.cs.uiuc.edu
-" Updated: 2005-04-24
-" WARNING: Read before you source in all these commands and macros! Some
-" of them may change VIM behavior that you depend on.
-
-" Wrap text at 80 cols
-set textwidth=80
-
-" A tab produces a 2-space indentation
-set tabstop=2
-set shiftwidth=2
-set expandtab
-
-" Optional
-" C/C++ programming helpers
-set autoindent
-set smartindent
-" Add and delete spaces in increments of `shiftwidth' for tabs
-set smarttab
-
-" Enable filetype detection
-filetype on
-
-" LLVM Makefiles can have names such as Makefile.rules or TEST.nightly.Makefile,
-" so it's important to categorize them as such.
-augroup filetype
- au! BufRead,BufNewFile *Makefile* set filetype=make
-augroup END
-
-" In Makefiles, don't expand tabs to spaces, since we need the actual tabs
-autocmd FileType make set noexpandtab
-
-" Useful macros for cleaning up code to conform to LLVM coding guidelines
-
-" Delete trailing whitespace and tabs at the end of each line
-map :dtws :%s/[\ \t]\+$//
-
-" Convert all tab characters to two spaces
-map :untab :%s/\t/ /g
diff --git a/release_23/utils/webNLT.pl b/release_23/utils/webNLT.pl
deleted file mode 100755
index fb29fd292e2d..000000000000
--- a/release_23/utils/webNLT.pl
+++ /dev/null
@@ -1,83 +0,0 @@
-#!/usr/bin/perl
-
-use DBI;
-use CGI;
-
-$q = new CGI;
-print $q->header();
-print $q->start_html(-title=>"Nightly Tester DB");
-
-unless($q->param('pwd'))
- {
- print $q->startform();
- print $q->password_field(-name=>"pwd", -size=>20, -maxlength=>20);
- print $q->submit();
- print $q->endform();
- }
-else
- {
- # database information
- $db="llvmalpha";
- $host="localhost";
- $userid="llvmdbuser";
- $passwd=$q->param('pwd');
- $connectionInfo="dbi:mysql:$db;$host";
-
- # make connection to database
- $dbh = DBI->connect($connectionInfo,$userid,$passwd) or die DBI->errstr;
- $query = "Select DISTINCT(NAME) from Tests";
- my $sth = $dbh->prepare($query) || die "Can't prepare statement: $DBI::errstr";
- my $rc = $sth->execute or die DBI->errstr;
- while (($n) = $sth->fetchrow_array)
- {
- push @names, ($n);
-# print "$n<P>";
- }
- $query = "Select DISTINCT(TEST) from Tests";
- my $sth = $dbh->prepare($query) || die "Can't prepare statement: $DBI::errstr";
- my $rc = $sth->execute or die DBI->errstr;
- while (($n) = $sth->fetchrow_array)
- {
- push @tests, ($n);
-# print "$n\n";
- }
-
-# print join "<BR>", @names;
-
- print $q->startform();
- print $q->scrolling_list(-name=>"test", -values=>\@tests, -multiple=>'true');
- print "<P>";
- print $q->scrolling_list(-name=>"name", -values=>\@names, -multiple=>'true');
- print "<P>";
- print $q->submit();
- print $q->hidden("pwd", $q->param('pwd'));
- print $q->endform();
-
- # disconnect from database
- $dbh->disconnect;
-
- #now generate the urls to the chart
- if ($q->param('test') && $q->param('name'))
- {
- my @names = $q->param('name');
- my @tests = $q->param('test');
- print "<P>";
- print join "<BR>", @names;
- print "<P>";
- print join "<BR>", @tests;
- print "<P>";
- $str = "pwd=" . $q->param('pwd');
- $count = 0;
- foreach $n (@names)
- {
- foreach $t (@tests)
- {
- $str = "$str&t$count=$t&n$count=$n";
- $count++;
- }
- }
- print "<img src=\"cgiplotNLT.pl?$str\">";
- }
- }
-
-print $q->end_html();
diff --git a/release_23/website/index.html b/release_23/website/index.html
deleted file mode 100644
index c42855957e10..000000000000
--- a/release_23/website/index.html
+++ /dev/null
@@ -1,26 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
- "http://www.w3.org/TR/html4/strict.dtd">
-<html>
-<head>
- <title>LLVM Core Website</title>
- <link rel="stylesheet" href="llvm.css" type="text/css">
-</head>
-<body>
-
-<div class="doc_title">LLVM Core Web Site</div>
- <p>This is just a place holder for now.</p>
-</div>
-
-<!-- *********************************************************************** -->
-
-<hr>
-<address>
- <a href="http://jigsaw.w3.org/css-validator/check/referer"><img
- src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"></a>
- <a href="http://validator.w3.org/check/referer"><img
- src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!"></a>
-
- <a href="http://llvm.org">LLVM Compiler Infrastructure</a><br>
- Last modified: $Date: 2007-07-09 01:04:31 -0700 (Mon, 09 Jul 2007) $
-</address>
-</body></html>
diff --git a/release_23/win32/Analysis/Analysis.vcproj b/release_23/win32/Analysis/Analysis.vcproj
deleted file mode 100644
index e14d79659def..000000000000
--- a/release_23/win32/Analysis/Analysis.vcproj
+++ /dev/null
@@ -1,557 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="8.00"
- Name="Analysis"
- ProjectGUID="{0622E827-8464-489D-8B1C-B0B496F35C08}"
- Keyword="Win32Proj"
- >
- <Platforms>
- <Platform
- Name="Win32"
- />
- <Platform
- Name="x64"
- />
- </Platforms>
- <ToolFiles>
- </ToolFiles>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="4"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="..\..\include;.."
- PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;WIN32;_DEBUG;_LIB;__STDC_LIMIT_MACROS"
- StringPooling="true"
- MinimalRebuild="true"
- BasicRuntimeChecks="3"
- RuntimeLibrary="3"
- ForceConformanceInForLoopScope="true"
- RuntimeTypeInfo="true"
- UsePrecompiledHeader="0"
- ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb"
- BrowseInformation="1"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="3"
- DisableSpecificWarnings="4355,4146,4800"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLibrarianTool"
- OutputFile="$(OutDir)/Analysis.lib"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory="$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="4"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="..\..\include;.."
- PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;WIN32;NDEBUG;_LIB;__STDC_LIMIT_MACROS"
- StringPooling="true"
- RuntimeLibrary="2"
- ForceConformanceInForLoopScope="true"
- RuntimeTypeInfo="true"
- UsePrecompiledHeader="0"
- ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="3"
- DisableSpecificWarnings="4355,4146,4800"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLibrarianTool"
- OutputFile="$(OutDir)/Analysis.lib"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Debug|x64"
- OutputDirectory="$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="4"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- TargetEnvironment="3"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="..\..\include;.."
- PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;WIN32;_DEBUG;_LIB;__STDC_LIMIT_MACROS"
- StringPooling="true"
- MinimalRebuild="true"
- BasicRuntimeChecks="3"
- RuntimeLibrary="3"
- ForceConformanceInForLoopScope="true"
- RuntimeTypeInfo="true"
- UsePrecompiledHeader="0"
- ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb"
- BrowseInformation="1"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="3"
- DisableSpecificWarnings="4355,4146,4800"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLibrarianTool"
- OutputFile="$(OutDir)/Analysis.lib"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Release|x64"
- OutputDirectory="$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="4"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- TargetEnvironment="3"
- />
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="..\..\include;.."
- PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;WIN32;NDEBUG;_LIB;__STDC_LIMIT_MACROS"
- StringPooling="true"
- RuntimeLibrary="2"
- ForceConformanceInForLoopScope="true"
- RuntimeTypeInfo="true"
- UsePrecompiledHeader="0"
- ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="3"
- DisableSpecificWarnings="4355,4146,4800"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLibrarianTool"
- OutputFile="$(OutDir)/Analysis.lib"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- </Configurations>
- <References>
- </References>
- <Files>
- <Filter
- Name="Source Files"
- Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
- UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
- >
- <File
- RelativePath="..\..\lib\Analysis\AliasAnalysis.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Analysis\AliasAnalysisCounter.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Analysis\AliasAnalysisEvaluator.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Analysis\AliasDebugger.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Analysis\AliasSetTracker.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Analysis\Analysis.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Analysis\BasicAliasAnalysis.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Analysis\CFGPrinter.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Analysis\ConstantFolding.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Analysis\InstCount.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Analysis\Interval.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Analysis\IntervalPartition.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Analysis\LibCallAliasAnalysis.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Analysis\LibCallSemantics.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Analysis\LoadValueNumbering.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Analysis\LoopInfo.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Analysis\LoopPass.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Analysis\MemoryDependenceAnalysis.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Analysis\PostDominators.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Analysis\ProfileInfo.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Analysis\ProfileInfoLoader.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Analysis\ProfileInfoLoaderPass.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Analysis\ScalarEvolution.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Analysis\ScalarEvolutionExpander.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Analysis\Trace.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Analysis\ValueNumbering.cpp"
- >
- </File>
- <Filter
- Name="IPA"
- >
- <File
- RelativePath="..\..\lib\Analysis\Ipa\Andersens.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Analysis\Ipa\CallGraph.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Analysis\Ipa\CallGraphSCCPass.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Analysis\Ipa\FindUsedTypes.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Analysis\Ipa\GlobalsModRef.cpp"
- >
- </File>
- </Filter>
- </Filter>
- <Filter
- Name="Header Files"
- Filter="h;hpp;hxx;hm;inl;inc;xsd"
- UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
- >
- <File
- RelativePath="..\..\include\llvm\Analysis\AliasAnalysis.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Analysis\AliasSetTracker.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Analysis\CallGraph.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Analysis\CFGPrinter.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Analysis\ConstantFolding.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Analysis\ConstantsScanner.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Analysis\DominatorInternals.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Analysis\Dominators.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Analysis\ET-Forest.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Analysis\FindUsedTypes.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Analysis\Interval.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Analysis\IntervalIterator.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Analysis\IntervalPartition.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Analysis\LibCallSemantics.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Analysis\LoadValueNumbering.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Analysis\LoopInfo.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Analysis\LoopPass.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Analysis\Passes.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Analysis\PostDominators.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Analysis\ProfileInfo.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Analysis\ProfileInfoLoader.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Analysis\ProfileInfoTypes.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Analysis\ScalarEvolution.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Analysis\ScalarEvolutionExpander.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Analysis\ScalarEvolutionExpressions.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Analysis\Trace.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Analysis\ValueNumbering.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Analysis\Verifier.h"
- >
- </File>
- </Filter>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
diff --git a/release_23/win32/Archive/Archive.vcproj b/release_23/win32/Archive/Archive.vcproj
deleted file mode 100644
index eba647a53b40..000000000000
--- a/release_23/win32/Archive/Archive.vcproj
+++ /dev/null
@@ -1,337 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="8.00"
- Name="Archive"
- ProjectGUID="{F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D61}"
- Keyword="Win32Proj"
- >
- <Platforms>
- <Platform
- Name="Win32"
- />
- <Platform
- Name="x64"
- />
- </Platforms>
- <ToolFiles>
- </ToolFiles>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="4"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="..\..\include;.."
- PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;WIN32;_DEBUG;_LIB;__STDC_LIMIT_MACROS"
- StringPooling="true"
- MinimalRebuild="true"
- BasicRuntimeChecks="3"
- RuntimeLibrary="3"
- ForceConformanceInForLoopScope="true"
- RuntimeTypeInfo="true"
- UsePrecompiledHeader="0"
- ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb"
- BrowseInformation="1"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="3"
- DisableSpecificWarnings="4355,4146,4800"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLibrarianTool"
- OutputFile="$(OutDir)/Archive.lib"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory="$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="4"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="..\..\include;.."
- PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;WIN32;NDEBUG;_LIB;__STDC_LIMIT_MACROS"
- StringPooling="true"
- RuntimeLibrary="2"
- ForceConformanceInForLoopScope="true"
- RuntimeTypeInfo="true"
- UsePrecompiledHeader="0"
- ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="3"
- DisableSpecificWarnings="4355,4146,4800"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLibrarianTool"
- OutputFile="$(OutDir)/Archive.lib"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Debug|x64"
- OutputDirectory="$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="4"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- TargetEnvironment="3"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="..\..\include;.."
- PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;WIN32;_DEBUG;_LIB;__STDC_LIMIT_MACROS"
- StringPooling="true"
- MinimalRebuild="true"
- BasicRuntimeChecks="3"
- RuntimeLibrary="3"
- ForceConformanceInForLoopScope="true"
- RuntimeTypeInfo="true"
- UsePrecompiledHeader="0"
- ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb"
- BrowseInformation="1"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="3"
- DisableSpecificWarnings="4355,4146,4800"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLibrarianTool"
- OutputFile="$(OutDir)/Archive.lib"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Release|x64"
- OutputDirectory="$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="4"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- TargetEnvironment="3"
- />
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="..\..\include;.."
- PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;WIN32;NDEBUG;_LIB;__STDC_LIMIT_MACROS"
- StringPooling="true"
- RuntimeLibrary="2"
- ForceConformanceInForLoopScope="true"
- RuntimeTypeInfo="true"
- UsePrecompiledHeader="0"
- ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="3"
- DisableSpecificWarnings="4355,4146,4800"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLibrarianTool"
- OutputFile="$(OutDir)/Archive.lib"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- </Configurations>
- <References>
- </References>
- <Files>
- <Filter
- Name="Source Files"
- Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
- UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
- >
- <File
- RelativePath="..\..\lib\Archive\Archive.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Archive\ArchiveInternals.h"
- >
- </File>
- <File
- RelativePath="..\..\lib\Archive\ArchiveReader.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Archive\ArchiveWriter.cpp"
- >
- </File>
- </Filter>
- <Filter
- Name="Header Files"
- Filter="h;hpp;hxx;hm;inl;inc;xsd"
- UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
- >
- <File
- RelativePath="..\..\include\llvm\Bytecode\Archive.h"
- >
- </File>
- </Filter>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
diff --git a/release_23/win32/AsmParser/AsmParser.vcproj b/release_23/win32/AsmParser/AsmParser.vcproj
deleted file mode 100644
index f44a9c2a41a4..000000000000
--- a/release_23/win32/AsmParser/AsmParser.vcproj
+++ /dev/null
@@ -1,394 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="8.00"
- Name="AsmParser"
- ProjectGUID="{3DC216F5-1DDD-478A-84F8-C124E5C31982}"
- RootNamespace="AsmParser"
- Keyword="Win32Proj"
- >
- <Platforms>
- <Platform
- Name="Win32"
- />
- <Platform
- Name="x64"
- />
- </Platforms>
- <ToolFiles>
- </ToolFiles>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="4"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="..\..\include;..;..\..\lib\AsmParser"
- PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;WIN32;_DEBUG;_LIB;__STDC_LIMIT_MACROS"
- StringPooling="true"
- MinimalRebuild="true"
- BasicRuntimeChecks="3"
- RuntimeLibrary="3"
- ForceConformanceInForLoopScope="true"
- RuntimeTypeInfo="true"
- UsePrecompiledHeader="0"
- ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb"
- BrowseInformation="1"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="3"
- DisableSpecificWarnings="4355,4146,4800"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLibrarianTool"
- OutputFile="$(OutDir)/AsmParser.lib"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory="$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="4"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="..\..\include;..;..\..\lib\AsmParser"
- PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;WIN32;NDEBUG;_LIB;__STDC_LIMIT_MACROS"
- StringPooling="true"
- RuntimeLibrary="2"
- ForceConformanceInForLoopScope="true"
- RuntimeTypeInfo="true"
- UsePrecompiledHeader="0"
- ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="3"
- DisableSpecificWarnings="4355,4146,4800"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLibrarianTool"
- OutputFile="$(OutDir)/AsmParser.lib"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Debug|x64"
- OutputDirectory="$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="4"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- TargetEnvironment="3"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="..\..\include;..;..\..\lib\AsmParser"
- PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;WIN32;_DEBUG;_LIB;__STDC_LIMIT_MACROS"
- StringPooling="true"
- MinimalRebuild="true"
- BasicRuntimeChecks="3"
- RuntimeLibrary="3"
- ForceConformanceInForLoopScope="true"
- RuntimeTypeInfo="true"
- UsePrecompiledHeader="0"
- ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb"
- BrowseInformation="1"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="3"
- DisableSpecificWarnings="4355,4146,4800"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLibrarianTool"
- OutputFile="$(OutDir)/AsmParser.lib"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Release|x64"
- OutputDirectory="$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="4"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- TargetEnvironment="3"
- />
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="..\..\include;..;..\..\lib\AsmParser"
- PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;WIN32;NDEBUG;_LIB;__STDC_LIMIT_MACROS"
- StringPooling="true"
- RuntimeLibrary="2"
- ForceConformanceInForLoopScope="true"
- RuntimeTypeInfo="true"
- UsePrecompiledHeader="0"
- ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="3"
- DisableSpecificWarnings="4355,4146,4800"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLibrarianTool"
- OutputFile="$(OutDir)/AsmParser.lib"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- </Configurations>
- <References>
- </References>
- <Files>
- <Filter
- Name="Source Files"
- Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
- UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
- >
- <File
- RelativePath="..\..\lib\AsmParser\LLLexer.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\AsmParser\llvmAsmParser.y"
- >
- <FileConfiguration
- Name="Debug|Win32"
- >
- <Tool
- Name="VCCustomBuildTool"
- Description="Bisoning $(InputFileName)"
- CommandLine="..\dobison.cmd llvmAsm debug $(InputName) $(InputPath) ..\..\lib\AsmParser&#x0D;&#x0A;"
- Outputs="$(InputName).cpp;$(InputName).h;$(InputName).output;..\..\lib\AsmParser\$(InputName).h"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Release|Win32"
- >
- <Tool
- Name="VCCustomBuildTool"
- Description="Bisoning $(InputFileName)"
- CommandLine="..\dobison.cmd llvmAsm release $(InputName) $(InputPath) ..\..\lib\AsmParser&#x0D;&#x0A;"
- Outputs="$(InputName).cpp;$(InputName).h;$(InputName).output;..\..\lib\AsmParser\$(InputName).h"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Debug|x64"
- >
- <Tool
- Name="VCCustomBuildTool"
- Description="Bisoning $(InputFileName)"
- CommandLine="..\dobison.cmd llvmAsm debug $(InputName) $(InputPath) ..\..\lib\AsmParser&#x0D;&#x0A;"
- Outputs="$(InputName).cpp;$(InputName).h;$(InputName).output;..\..\lib\AsmParser\$(InputName).h"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Release|x64"
- >
- <Tool
- Name="VCCustomBuildTool"
- Description="Bisoning $(InputFileName)"
- CommandLine="..\dobison.cmd llvmAsm release $(InputName) $(InputPath) ..\..\lib\AsmParser&#x0D;&#x0A;"
- Outputs="$(InputName).cpp;$(InputName).h;$(InputName).output;..\..\lib\AsmParser\$(InputName).h"
- />
- </FileConfiguration>
- </File>
- <File
- RelativePath="..\..\lib\AsmParser\Parser.cpp"
- >
- </File>
- </Filter>
- <Filter
- Name="Header Files"
- Filter="h;hpp;hxx;hm;inl;inc;xsd"
- UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
- >
- <File
- RelativePath="..\..\lib\AsmParser\LLLexer.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Assembly\Parser.h"
- >
- </File>
- <File
- RelativePath="..\..\lib\AsmParser\ParserInternals.h"
- >
- </File>
- </Filter>
- <Filter
- Name="Generated Files"
- >
- <File
- RelativePath="llvmAsmParser.cpp"
- >
- </File>
- <File
- RelativePath="llvmAsmParser.h"
- >
- </File>
- </Filter>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
diff --git a/release_23/win32/Bitcode/Bitcode.vcproj b/release_23/win32/Bitcode/Bitcode.vcproj
deleted file mode 100644
index 7bcdfbb7bfb4..000000000000
--- a/release_23/win32/Bitcode/Bitcode.vcproj
+++ /dev/null
@@ -1,421 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="8.00"
- Name="Bitcode"
- ProjectGUID="{F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D62}"
- Keyword="Win32Proj"
- >
- <Platforms>
- <Platform
- Name="Win32"
- />
- <Platform
- Name="x64"
- />
- </Platforms>
- <ToolFiles>
- </ToolFiles>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="4"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="..\..\include;.."
- PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;_DEBUG;_LIB;__STDC_LIMIT_MACROS;WIN32"
- StringPooling="true"
- MinimalRebuild="true"
- BasicRuntimeChecks="3"
- RuntimeLibrary="3"
- ForceConformanceInForLoopScope="true"
- RuntimeTypeInfo="true"
- UsePrecompiledHeader="0"
- ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb"
- BrowseInformation="1"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="3"
- DisableSpecificWarnings="4355,4146,4800"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLibrarianTool"
- OutputFile="$(OutDir)/Bitcode.lib"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory="$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="4"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="..\..\include;.."
- PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;WIN32;NDEBUG;_LIB;__STDC_LIMIT_MACROS"
- StringPooling="true"
- RuntimeLibrary="2"
- ForceConformanceInForLoopScope="true"
- RuntimeTypeInfo="true"
- UsePrecompiledHeader="0"
- ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="3"
- DisableSpecificWarnings="4355,4146,4800"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLibrarianTool"
- OutputFile="$(OutDir)/Bitcode.lib"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Debug|x64"
- OutputDirectory="$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="4"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- TargetEnvironment="3"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="..\..\include;.."
- PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;_DEBUG;_LIB;__STDC_LIMIT_MACROS;WIN32"
- StringPooling="true"
- MinimalRebuild="true"
- BasicRuntimeChecks="3"
- RuntimeLibrary="3"
- ForceConformanceInForLoopScope="true"
- RuntimeTypeInfo="true"
- UsePrecompiledHeader="0"
- ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb"
- BrowseInformation="1"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="3"
- DisableSpecificWarnings="4355,4146,4800"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLibrarianTool"
- OutputFile="$(OutDir)/Bitcode.lib"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Release|x64"
- OutputDirectory="$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="4"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- TargetEnvironment="3"
- />
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="..\..\include;.."
- PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;WIN32;NDEBUG;_LIB;__STDC_LIMIT_MACROS"
- StringPooling="true"
- RuntimeLibrary="2"
- ForceConformanceInForLoopScope="true"
- RuntimeTypeInfo="true"
- UsePrecompiledHeader="0"
- ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="3"
- DisableSpecificWarnings="4355,4146,4800"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLibrarianTool"
- OutputFile="$(OutDir)/Bitcode.lib"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- </Configurations>
- <References>
- </References>
- <Files>
- <Filter
- Name="Source Files"
- Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
- UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
- >
- <Filter
- Name="Reader"
- >
- <File
- RelativePath="..\..\lib\Bitcode\Reader\BitcodeReader.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Bitcode\Reader\BitcodeReader.h"
- >
- </File>
- <File
- RelativePath="..\..\lib\Bitcode\Reader\BitReader.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Bitcode\Reader\Deserialize.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Bitcode\Reader\DeserializeAPFloat.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Bitcode\Reader\DeserializeAPInt.cpp"
- >
- </File>
- </Filter>
- <Filter
- Name="Writer"
- >
- <File
- RelativePath="..\..\lib\Bitcode\Writer\BitcodeWriter.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Bitcode\Writer\BitcodeWriterPass.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Bitcode\Writer\BitWriter.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Bitcode\Writer\Serialize.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Bitcode\Writer\SerializeAPFloat.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Bitcode\Writer\SerializeAPInt.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Bitcode\Writer\ValueEnumerator.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Bitcode\Writer\ValueEnumerator.h"
- >
- </File>
- </Filter>
- </Filter>
- <Filter
- Name="Header Files"
- Filter="h;hpp;hxx;hm;inl;inc;xsd"
- UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
- >
- <File
- RelativePath="..\..\include\llvm\Bitcode\Archive.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Bitcode\Bitcodes.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Bitcode\BitstreamReader.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Bitcode\BitstreamWriter.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Bitcode\Deserialize.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Bitcode\LLVMBitCodes.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Bitcode\ReaderWriter.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Bitcode\Serialization.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Bitcode\SerializationFwd.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Bitcode\Serialize.h"
- >
- </File>
- </Filter>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
diff --git a/release_23/win32/CBackend/CBackend.vcproj b/release_23/win32/CBackend/CBackend.vcproj
deleted file mode 100644
index ce2ef3e6612c..000000000000
--- a/release_23/win32/CBackend/CBackend.vcproj
+++ /dev/null
@@ -1,325 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="8.00"
- Name="CBackend"
- ProjectGUID="{057777CD-DED5-46DF-BF9A-6B76DE212549}"
- Keyword="Win32Proj"
- >
- <Platforms>
- <Platform
- Name="Win32"
- />
- <Platform
- Name="x64"
- />
- </Platforms>
- <ToolFiles>
- </ToolFiles>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="4"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="..\..\include;.."
- PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;WIN32;_DEBUG;_LIB;__STDC_LIMIT_MACROS"
- StringPooling="true"
- MinimalRebuild="true"
- BasicRuntimeChecks="3"
- RuntimeLibrary="3"
- ForceConformanceInForLoopScope="true"
- RuntimeTypeInfo="true"
- UsePrecompiledHeader="0"
- ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb"
- BrowseInformation="1"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="3"
- DisableSpecificWarnings="4355,4146,4800"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLibrarianTool"
- OutputFile="$(OutDir)/CBackend.lib"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory="$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="4"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="..\..\include;.."
- PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;WIN32;NDEBUG;_LIB;__STDC_LIMIT_MACROS"
- StringPooling="true"
- RuntimeLibrary="2"
- ForceConformanceInForLoopScope="true"
- RuntimeTypeInfo="true"
- UsePrecompiledHeader="0"
- ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="3"
- DisableSpecificWarnings="4355,4146,4800"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLibrarianTool"
- OutputFile="$(OutDir)/CBackend.lib"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Debug|x64"
- OutputDirectory="$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="4"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- TargetEnvironment="3"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="..\..\include;.."
- PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;WIN32;_DEBUG;_LIB;__STDC_LIMIT_MACROS"
- StringPooling="true"
- MinimalRebuild="true"
- BasicRuntimeChecks="3"
- RuntimeLibrary="3"
- ForceConformanceInForLoopScope="true"
- RuntimeTypeInfo="true"
- UsePrecompiledHeader="0"
- ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb"
- BrowseInformation="1"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="3"
- DisableSpecificWarnings="4355,4146,4800"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLibrarianTool"
- OutputFile="$(OutDir)/CBackend.lib"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Release|x64"
- OutputDirectory="$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="4"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- TargetEnvironment="3"
- />
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="..\..\include;.."
- PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;WIN32;NDEBUG;_LIB;__STDC_LIMIT_MACROS"
- StringPooling="true"
- RuntimeLibrary="2"
- ForceConformanceInForLoopScope="true"
- RuntimeTypeInfo="true"
- UsePrecompiledHeader="0"
- ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="3"
- DisableSpecificWarnings="4355,4146,4800"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLibrarianTool"
- OutputFile="$(OutDir)/CBackend.lib"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- </Configurations>
- <References>
- </References>
- <Files>
- <Filter
- Name="Source Files"
- Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
- UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
- >
- <File
- RelativePath="..\..\lib\Target\CBackend\CBackend.cpp"
- >
- </File>
- </Filter>
- <Filter
- Name="Header Files"
- Filter="h;hpp;hxx;hm;inl;inc;xsd"
- UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
- >
- <File
- RelativePath="..\..\lib\Target\CBackend\CTargetMachine.h"
- >
- </File>
- </Filter>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
diff --git a/release_23/win32/CodeGen/CodeGen.vcproj b/release_23/win32/CodeGen/CodeGen.vcproj
deleted file mode 100644
index c1090999b605..000000000000
--- a/release_23/win32/CodeGen/CodeGen.vcproj
+++ /dev/null
@@ -1,765 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="8.00"
- Name="CodeGen"
- ProjectGUID="{08CEB1BB-C2A4-4587-B9A9-AEDB8FB44897}"
- Keyword="Win32Proj"
- >
- <Platforms>
- <Platform
- Name="Win32"
- />
- <Platform
- Name="x64"
- />
- </Platforms>
- <ToolFiles>
- </ToolFiles>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="4"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="..\..\include;.."
- PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;WIN32;_DEBUG;_LIB;__STDC_LIMIT_MACROS"
- StringPooling="true"
- MinimalRebuild="true"
- BasicRuntimeChecks="3"
- RuntimeLibrary="3"
- ForceConformanceInForLoopScope="true"
- RuntimeTypeInfo="true"
- UsePrecompiledHeader="0"
- ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb"
- BrowseInformation="1"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="3"
- DisableSpecificWarnings="4355,4146,4800"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLibrarianTool"
- OutputFile="$(OutDir)/CodeGen.lib"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory="$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="4"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="..\..\include;.."
- PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;WIN32;NDEBUG;_LIB;__STDC_LIMIT_MACROS"
- StringPooling="true"
- RuntimeLibrary="2"
- ForceConformanceInForLoopScope="true"
- RuntimeTypeInfo="true"
- UsePrecompiledHeader="0"
- ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="3"
- DisableSpecificWarnings="4355,4146,4800"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLibrarianTool"
- OutputFile="$(OutDir)/CodeGen.lib"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Debug|x64"
- OutputDirectory="$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="4"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- TargetEnvironment="3"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="..\..\include;.."
- PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;WIN32;_DEBUG;_LIB;__STDC_LIMIT_MACROS"
- StringPooling="true"
- MinimalRebuild="true"
- BasicRuntimeChecks="3"
- RuntimeLibrary="3"
- ForceConformanceInForLoopScope="true"
- RuntimeTypeInfo="true"
- UsePrecompiledHeader="0"
- ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb"
- BrowseInformation="1"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="3"
- DisableSpecificWarnings="4355,4146,4800"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLibrarianTool"
- OutputFile="$(OutDir)/CodeGen.lib"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Release|x64"
- OutputDirectory="$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="4"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- TargetEnvironment="3"
- />
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="..\..\include;.."
- PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;WIN32;NDEBUG;_LIB;__STDC_LIMIT_MACROS"
- StringPooling="true"
- RuntimeLibrary="2"
- ForceConformanceInForLoopScope="true"
- RuntimeTypeInfo="true"
- UsePrecompiledHeader="0"
- ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="3"
- DisableSpecificWarnings="4355,4146,4800"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLibrarianTool"
- OutputFile="$(OutDir)/CodeGen.lib"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- </Configurations>
- <References>
- </References>
- <Files>
- <Filter
- Name="Source Files"
- Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
- UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
- >
- <File
- RelativePath="..\..\lib\CodeGen\AsmPrinter.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\CodeGen\BranchFolding.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\CodeGen\Collector.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\CodeGen\CollectorMetadata.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\CodeGen\Collectors.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\CodeGen\DwarfWriter.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\CodeGen\ELFWriter.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\CodeGen\ELFWriter.h"
- >
- </File>
- <File
- RelativePath="..\..\lib\CodeGen\IfConversion.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\CodeGen\IntrinsicLowering.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\CodeGen\LiveInterval.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\CodeGen\LiveIntervalAnalysis.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\CodeGen\LiveVariables.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\CodeGen\LLVMTargetMachine.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\CodeGen\LoopAligner.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\CodeGen\LowerSubregs.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\CodeGen\MachineBasicBlock.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\CodeGen\MachineDominators.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\CodeGen\MachineFunction.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\CodeGen\MachineInstr.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\CodeGen\MachineLICM.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\CodeGen\MachineLoopInfo.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\CodeGen\MachineModuleInfo.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\CodeGen\MachinePassRegistry.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\CodeGen\MachineRegisterInfo.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\CodeGen\MachineSink.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\CodeGen\MachOWriter.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\CodeGen\MachOWriter.h"
- >
- </File>
- <File
- RelativePath="..\..\lib\CodeGen\OcamlCollector.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\CodeGen\Passes.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\CodeGen\PHIElimination.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\CodeGen\PostRASchedulerList.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\CodeGen\PrologEpilogInserter.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\CodeGen\PseudoSourceValue.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\CodeGen\RegAllocBigBlock.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\CodeGen\RegAllocLinearScan.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\CodeGen\RegAllocLocal.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\CodeGen\RegAllocSimple.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\CodeGen\RegisterCoalescer.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\CodeGen\RegisterScavenging.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\CodeGen\ShadowStackCollector.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\CodeGen\SimpleRegisterCoalescing.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\CodeGen\StrongPHIElimination.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\CodeGen\TargetInstrInfoImpl.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\CodeGen\TwoAddressInstructionPass.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\CodeGen\UnreachableBlockElim.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\CodeGen\VirtRegMap.cpp"
- >
- </File>
- <Filter
- Name="SelectionDAG"
- >
- <File
- RelativePath="..\..\lib\CodeGen\SelectionDAG\CallingConvLower.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\CodeGen\SelectionDAG\DAGCombiner.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\CodeGen\SelectionDAG\LegalizeDAG.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\CodeGen\SelectionDAG\LegalizeTypes.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\CodeGen\SelectionDAG\LegalizeTypesExpand.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\CodeGen\SelectionDAG\LegalizeTypesFloatToInt.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\CodeGen\SelectionDAG\LegalizeTypesPromote.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\CodeGen\SelectionDAG\LegalizeTypesScalarize.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\CodeGen\SelectionDAG\LegalizeTypesSplit.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\CodeGen\SelectionDAG\ScheduleDAG.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\CodeGen\SelectionDAG\ScheduleDAGList.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\CodeGen\SelectionDAG\ScheduleDAGRRList.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\CodeGen\SelectionDAG\SelectionDAG.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\CodeGen\SelectionDAG\SelectionDAGISel.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\CodeGen\SelectionDAG\SelectionDAGPrinter.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\CodeGen\SelectionDAG\TargetLowering.cpp"
- >
- </File>
- </Filter>
- </Filter>
- <Filter
- Name="Header Files"
- Filter="h;hpp;hxx;hm;inl;inc;xsd"
- UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
- >
- <File
- RelativePath="..\..\include\llvm\CodeGen\AsmPrinter.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\CodeGen\BreakCriticalMachineEdge.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\CodeGen\CallingConvLower.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\CodeGen\Collector.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\CodeGen\CollectorMetadata.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\CodeGen\Collectors.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\CodeGen\DwarfWriter.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\CodeGen\FileWriters.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\CodeGen\InstrScheduling.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\CodeGen\IntrinsicLowering.h"
- >
- </File>
- <File
- RelativePath="..\..\lib\CodeGen\SelectionDAG\LegalizeTypes.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\CodeGen\LinkAllCodegenComponents.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\CodeGen\LiveInterval.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\CodeGen\LiveIntervalAnalysis.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\CodeGen\LiveVariables.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\CodeGen\MachineBasicBlock.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\CodeGen\MachineCodeEmitter.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\CodeGen\MachineConstantPool.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\CodeGen\MachineDominators.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\CodeGen\MachineFrameInfo.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\CodeGen\MachineFunction.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\CodeGen\MachineFunctionPass.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\CodeGen\MachineInstr.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\CodeGen\MachineInstrBuilder.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\CodeGen\MachineJumpTableInfo.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\CodeGen\MachineLocation.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\CodeGen\MachineLoopInfo.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\CodeGen\MachineModuleInfo.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\CodeGen\MachineOperand.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\CodeGen\MachinePassRegistry.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\CodeGen\MachineRegisterInfo.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\CodeGen\MachineRelocation.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\CodeGen\MachORelocation.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\CodeGen\Passes.h"
- >
- </File>
- <File
- RelativePath="..\..\lib\CodeGen\PhysRegTracker.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\CodeGen\RegAllocRegistry.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\CodeGen\RegisterCoalescer.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\CodeGen\RegisterScavenging.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\CodeGen\RuntimeLibcalls.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\CodeGen\SchedGraphCommon.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\CodeGen\ScheduleDAG.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\CodeGen\SchedulerRegistry.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\CodeGen\SelectionDAG.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\CodeGen\SelectionDAGISel.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\CodeGen\SelectionDAGNodes.h"
- >
- </File>
- <File
- RelativePath="..\..\lib\CodeGen\SimpleRegisterCoalescing.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\CodeGen\ValueTypes.h"
- >
- </File>
- <File
- RelativePath="..\..\lib\CodeGen\VirtRegMap.h"
- >
- </File>
- </Filter>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
diff --git a/release_23/win32/Configure/Configure.vcproj b/release_23/win32/Configure/Configure.vcproj
deleted file mode 100644
index 5c7062986ea8..000000000000
--- a/release_23/win32/Configure/Configure.vcproj
+++ /dev/null
@@ -1,319 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="8.00"
- Name="Configure"
- ProjectGUID="{19514E48-456C-4B9D-8637-F2285476461E}"
- RootNamespace="Configure"
- Keyword="Win32Proj"
- >
- <Platforms>
- <Platform
- Name="Win32"
- />
- <Platform
- Name="x64"
- />
- </Platforms>
- <ToolFiles>
- </ToolFiles>
- <Configurations>
- <Configuration
- Name="Configure|Win32"
- OutputDirectory="$(ConfigurationName)"
- IntermediateDirectory="$(ConfigurationName)"
- ConfigurationType="1"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;WIN32;_DEBUG;_CONSOLE"
- MinimalRebuild="true"
- BasicRuntimeChecks="3"
- RuntimeLibrary="1"
- UsePrecompiledHeader="0"
- WarningLevel="3"
- Detect64BitPortabilityProblems="true"
- DebugInformationFormat="4"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- OutputFile="$(OutDir)/Configure.exe"
- LinkIncremental="2"
- GenerateDebugInformation="true"
- ProgramDatabaseFile="$(OutDir)/Configure.pdb"
- SubSystem="1"
- TargetMachine="1"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Configure|x64"
- OutputDirectory="$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="1"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- TargetEnvironment="3"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;WIN32;_DEBUG;_CONSOLE"
- MinimalRebuild="true"
- BasicRuntimeChecks="3"
- RuntimeLibrary="1"
- UsePrecompiledHeader="0"
- WarningLevel="3"
- Detect64BitPortabilityProblems="true"
- DebugInformationFormat="3"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- OutputFile="$(OutDir)/Configure.exe"
- LinkIncremental="2"
- GenerateDebugInformation="true"
- ProgramDatabaseFile="$(OutDir)/Configure.pdb"
- SubSystem="1"
- TargetMachine="17"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- </Configurations>
- <References>
- </References>
- <Files>
- <Filter
- Name="Source Files"
- Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
- UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
- >
- <File
- RelativePath="..\..\include\llvm\Config\config.h.in"
- >
- <FileConfiguration
- Name="Configure|Win32"
- >
- <Tool
- Name="VCCustomBuildTool"
- Description="Generating $(SolutionDir)llvm\Config\config.h"
- CommandLine="copy &quot;$(InputPath)&quot;+&quot;$(SolutionDir)config.h&quot; &quot;$(ProjectDir)..\llvm\Config\config.h&quot;&#x0D;&#x0A;"
- AdditionalDependencies="&quot;$(SolutionDir)config.h&quot;"
- Outputs="&quot;$(ProjectDir)..\llvm\Config\config.h&quot;"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Configure|x64"
- >
- <Tool
- Name="VCCustomBuildTool"
- Description="Generating $(SolutionDir)llvm\Config\config.h"
- CommandLine="copy &quot;$(InputPath)&quot;+&quot;$(SolutionDir)config.h&quot; &quot;$(ProjectDir)..\llvm\Config\config.h&quot;&#x0D;&#x0A;"
- AdditionalDependencies="&quot;$(SolutionDir)config.h&quot;"
- Outputs="&quot;$(ProjectDir)..\llvm\Config\config.h&quot;"
- />
- </FileConfiguration>
- </File>
- <File
- RelativePath="..\..\include\llvm\Support\DataTypes.h.in"
- >
- <FileConfiguration
- Name="Configure|Win32"
- >
- <Tool
- Name="VCCustomBuildTool"
- Description="Generating $(SolutionDir)llvm\Support\DataTypes.h"
- CommandLine="copy &quot;$(InputPath)&quot; &quot;$(ProjectDir)..\llvm\Support\DataTypes.h&quot;&#x0D;&#x0A;"
- Outputs="&quot;$(ProjectDir)..\llvm\Support\DataTypes.h&quot;"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Configure|x64"
- >
- <Tool
- Name="VCCustomBuildTool"
- Description="Generating $(SolutionDir)llvm\Support\DataTypes.h"
- CommandLine="copy &quot;$(InputPath)&quot; &quot;$(ProjectDir)..\llvm\Support\DataTypes.h&quot;&#x0D;&#x0A;"
- Outputs="&quot;$(ProjectDir)..\llvm\Support\DataTypes.h&quot;"
- />
- </FileConfiguration>
- </File>
- <File
- RelativePath="..\..\include\llvm\Adt\hash_map.in"
- >
- <FileConfiguration
- Name="Configure|Win32"
- >
- <Tool
- Name="VCCustomBuildTool"
- Description="Generating $(SolutionDir)llvm\ADT\hash_map"
- CommandLine="copy &quot;$(InputPath)&quot; &quot;$(ProjectDir)..\llvm\ADT\hash_map&quot;&#x0D;&#x0A;"
- Outputs="&quot;$(ProjectDir)..\llvm\ADT\hash_map&quot;"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Configure|x64"
- >
- <Tool
- Name="VCCustomBuildTool"
- Description="Generating $(SolutionDir)llvm\ADT\hash_map"
- CommandLine="copy &quot;$(InputPath)&quot; &quot;$(ProjectDir)..\llvm\ADT\hash_map&quot;&#x0D;&#x0A;"
- Outputs="&quot;$(ProjectDir)..\llvm\ADT\hash_map&quot;"
- />
- </FileConfiguration>
- </File>
- <File
- RelativePath="..\..\include\llvm\Adt\hash_set.in"
- >
- <FileConfiguration
- Name="Configure|Win32"
- >
- <Tool
- Name="VCCustomBuildTool"
- Description="Generating $(SolutionDir)llvm\ADT\hash_set"
- CommandLine="copy &quot;$(InputPath)&quot; &quot;$(ProjectDir)..\llvm\ADT\hash_set&quot;&#x0D;&#x0A;"
- Outputs="&quot;$(ProjectDir)..\llvm\ADT\hash_set&quot;"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Configure|x64"
- >
- <Tool
- Name="VCCustomBuildTool"
- Description="Generating $(SolutionDir)llvm\ADT\hash_set"
- CommandLine="copy &quot;$(InputPath)&quot; &quot;$(ProjectDir)..\llvm\ADT\hash_set&quot;&#x0D;&#x0A;"
- Outputs="&quot;$(ProjectDir)..\llvm\ADT\hash_set&quot;"
- />
- </FileConfiguration>
- </File>
- <File
- RelativePath="..\..\include\llvm\Adt\iterator.in"
- >
- <FileConfiguration
- Name="Configure|Win32"
- >
- <Tool
- Name="VCCustomBuildTool"
- Description="Generating $(SolutionDir)llvm\ADT\iterator"
- CommandLine="copy &quot;$(InputPath)&quot; &quot;$(ProjectDir)..\llvm\ADT\iterator&quot;&#x0D;&#x0A;"
- Outputs="&quot;$(ProjectDir)..\llvm\ADT\iterator&quot;"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Configure|x64"
- >
- <Tool
- Name="VCCustomBuildTool"
- Description="Generating $(SolutionDir)llvm\ADT\iterator"
- CommandLine="copy &quot;$(InputPath)&quot; &quot;$(ProjectDir)..\llvm\ADT\iterator&quot;&#x0D;&#x0A;"
- Outputs="&quot;$(ProjectDir)..\llvm\ADT\iterator&quot;"
- />
- </FileConfiguration>
- </File>
- </Filter>
- <Filter
- Name="Header Files"
- Filter="h;hpp;hxx;hm;inl;inc;xsd"
- UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
- >
- </Filter>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
diff --git a/release_23/win32/ExecutionEngine/ExecutionEngine.vcproj b/release_23/win32/ExecutionEngine/ExecutionEngine.vcproj
deleted file mode 100644
index ee2a1d31e387..000000000000
--- a/release_23/win32/ExecutionEngine/ExecutionEngine.vcproj
+++ /dev/null
@@ -1,429 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="8.00"
- Name="ExecutionEngine"
- ProjectGUID="{76295AE8-A083-460E-9F80-6F2B8923264A}"
- Keyword="Win32Proj"
- >
- <Platforms>
- <Platform
- Name="Win32"
- />
- <Platform
- Name="x64"
- />
- </Platforms>
- <ToolFiles>
- </ToolFiles>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="4"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="..\..\include;.."
- PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;WIN32;_DEBUG;_LIB;__STDC_LIMIT_MACROS"
- StringPooling="true"
- MinimalRebuild="true"
- BasicRuntimeChecks="3"
- RuntimeLibrary="3"
- ForceConformanceInForLoopScope="true"
- RuntimeTypeInfo="true"
- UsePrecompiledHeader="0"
- ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb"
- BrowseInformation="1"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="3"
- DisableSpecificWarnings="4355,4146,4800"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLibrarianTool"
- OutputFile="$(OutDir)/ExecutionEngine.lib"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory="$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="4"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="..\..\include;.."
- PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;WIN32;NDEBUG;_LIB;__STDC_LIMIT_MACROS"
- StringPooling="true"
- RuntimeLibrary="2"
- ForceConformanceInForLoopScope="true"
- RuntimeTypeInfo="true"
- UsePrecompiledHeader="0"
- ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="3"
- DisableSpecificWarnings="4355,4146,4800"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLibrarianTool"
- OutputFile="$(OutDir)/ExecutionEngine.lib"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Debug|x64"
- OutputDirectory="$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="4"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- TargetEnvironment="3"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="..\..\include;.."
- PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;WIN32;_DEBUG;_LIB;__STDC_LIMIT_MACROS"
- StringPooling="true"
- MinimalRebuild="true"
- BasicRuntimeChecks="3"
- RuntimeLibrary="3"
- ForceConformanceInForLoopScope="true"
- RuntimeTypeInfo="true"
- UsePrecompiledHeader="0"
- ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb"
- BrowseInformation="1"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="3"
- DisableSpecificWarnings="4355,4146,4800"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLibrarianTool"
- OutputFile="$(OutDir)/ExecutionEngine.lib"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Release|x64"
- OutputDirectory="$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="4"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- TargetEnvironment="3"
- />
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="..\..\include;.."
- PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;WIN32;NDEBUG;_LIB;__STDC_LIMIT_MACROS"
- StringPooling="true"
- RuntimeLibrary="2"
- ForceConformanceInForLoopScope="true"
- RuntimeTypeInfo="true"
- UsePrecompiledHeader="0"
- ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="3"
- DisableSpecificWarnings="4355,4146,4800"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLibrarianTool"
- OutputFile="$(OutDir)/ExecutionEngine.lib"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- </Configurations>
- <References>
- </References>
- <Files>
- <Filter
- Name="Source Files"
- Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
- UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
- >
- <File
- RelativePath="..\..\lib\ExecutionEngine\ExecutionEngine.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\ExecutionEngine\ExecutionEngineBindings.cpp"
- >
- </File>
- </Filter>
- <Filter
- Name="Header Files"
- Filter="h;hpp;hxx;hm;inl;inc;xsd"
- UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
- >
- <File
- RelativePath="..\..\include\llvm\ExecutionEngine\ExecutionEngine.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\ExecutionEngine\GenericValue.h"
- >
- </File>
- </Filter>
- <Filter
- Name="JIT"
- >
- <File
- RelativePath="..\..\lib\ExecutionEngine\Jit\Intercept.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\ExecutionEngine\Jit\JIT.cpp"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\ExecutionEngine\JIT.h"
- >
- </File>
- <File
- RelativePath="..\..\lib\ExecutionEngine\Jit\JIT.h"
- >
- </File>
- <File
- RelativePath="..\..\lib\ExecutionEngine\JIT\JITDwarfEmitter.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\ExecutionEngine\JIT\JITDwarfEmitter.h"
- >
- </File>
- <File
- RelativePath="..\..\lib\ExecutionEngine\Jit\JITEmitter.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\ExecutionEngine\JIT\JITMemoryManager.cpp"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\ExecutionEngine\JITMemoryManager.h"
- >
- </File>
- <File
- RelativePath="..\..\lib\ExecutionEngine\Jit\TargetSelect.cpp"
- >
- </File>
- </Filter>
- <Filter
- Name="Interpreter"
- >
- <File
- RelativePath="..\..\lib\ExecutionEngine\Interpreter\Execution.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\ExecutionEngine\Interpreter\ExternalFunctions.cpp"
- >
- <FileConfiguration
- Name="Debug|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- DisableSpecificWarnings="4190"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Release|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- DisableSpecificWarnings="4190"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Debug|x64"
- >
- <Tool
- Name="VCCLCompilerTool"
- DisableSpecificWarnings="4190"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Release|x64"
- >
- <Tool
- Name="VCCLCompilerTool"
- DisableSpecificWarnings="4190"
- />
- </FileConfiguration>
- </File>
- <File
- RelativePath="..\..\lib\ExecutionEngine\Interpreter\Interpreter.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\ExecutionEngine\Interpreter\Interpreter.h"
- >
- </File>
- </Filter>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
diff --git a/release_23/win32/Fibonacci/Fibonacci.vcproj b/release_23/win32/Fibonacci/Fibonacci.vcproj
deleted file mode 100644
index 3144a7379409..000000000000
--- a/release_23/win32/Fibonacci/Fibonacci.vcproj
+++ /dev/null
@@ -1,386 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="8.00"
- Name="Fibonacci"
- ProjectGUID="{48FB551D-E37E-42EC-BC97-FF7219774867}"
- RootNamespace="Fibonacci"
- Keyword="Win32Proj"
- >
- <Platforms>
- <Platform
- Name="Win32"
- />
- <Platform
- Name="x64"
- />
- </Platforms>
- <ToolFiles>
- </ToolFiles>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="1"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="..\..\include;.."
- PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;__STDC_LIMIT_MACROS"
- StringPooling="true"
- MinimalRebuild="true"
- BasicRuntimeChecks="3"
- RuntimeLibrary="3"
- ForceConformanceInForLoopScope="true"
- RuntimeTypeInfo="true"
- UsePrecompiledHeader="0"
- ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb"
- BrowseInformation="1"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="4"
- DisableSpecificWarnings="4355,4146,4800"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- AdditionalDependencies="$(SolutionDir)X86\$(IntDir)\X86TargetMachine.obj"
- OutputFile="$(OutDir)/Fibonacci.exe"
- LinkIncremental="2"
- GenerateDebugInformation="true"
- ProgramDatabaseFile="$(OutDir)/Fibonacci.pdb"
- SubSystem="1"
- OptimizeReferences="0"
- TargetMachine="1"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory="$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="1"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="..\..\include;.."
- PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;__STDC_LIMIT_MACROS"
- StringPooling="true"
- RuntimeLibrary="2"
- ForceConformanceInForLoopScope="true"
- RuntimeTypeInfo="true"
- UsePrecompiledHeader="0"
- ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="3"
- DisableSpecificWarnings="4355,4146,4800"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- AdditionalDependencies="$(SolutionDir)X86\$(IntDir)\X86TargetMachine.obj"
- OutputFile="$(OutDir)/Fibonacci.exe"
- LinkIncremental="1"
- GenerateDebugInformation="true"
- SubSystem="1"
- OptimizeReferences="2"
- EnableCOMDATFolding="2"
- TargetMachine="1"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Debug|x64"
- OutputDirectory="$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="1"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- TargetEnvironment="3"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="..\..\include;.."
- PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;__STDC_LIMIT_MACROS"
- StringPooling="true"
- MinimalRebuild="true"
- BasicRuntimeChecks="3"
- RuntimeLibrary="3"
- ForceConformanceInForLoopScope="true"
- RuntimeTypeInfo="true"
- UsePrecompiledHeader="0"
- ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb"
- BrowseInformation="1"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="3"
- DisableSpecificWarnings="4355,4146,4800"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- AdditionalDependencies="$(SolutionDir)X86\$(IntDir)\X86TargetMachine.obj"
- OutputFile="$(OutDir)/Fibonacci.exe"
- LinkIncremental="2"
- GenerateDebugInformation="true"
- ProgramDatabaseFile="$(OutDir)/Fibonacci.pdb"
- SubSystem="1"
- OptimizeReferences="0"
- TargetMachine="17"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Release|x64"
- OutputDirectory="$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="1"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- TargetEnvironment="3"
- />
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="..\..\include;.."
- PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;__STDC_LIMIT_MACROS"
- StringPooling="true"
- RuntimeLibrary="2"
- ForceConformanceInForLoopScope="true"
- RuntimeTypeInfo="true"
- UsePrecompiledHeader="0"
- ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="3"
- DisableSpecificWarnings="4355,4146,4800"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- AdditionalDependencies="$(SolutionDir)X86\$(IntDir)\X86TargetMachine.obj"
- OutputFile="$(OutDir)/Fibonacci.exe"
- LinkIncremental="1"
- GenerateDebugInformation="true"
- SubSystem="1"
- OptimizeReferences="2"
- EnableCOMDATFolding="2"
- TargetMachine="17"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- </Configurations>
- <References>
- </References>
- <Files>
- <Filter
- Name="Source Files"
- Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
- UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
- >
- <File
- RelativePath="..\..\examples\Fibonacci\fibonacci.cpp"
- >
- </File>
- </Filter>
- <Filter
- Name="Header Files"
- Filter="h;hpp;hxx;hm;inl;inc;xsd"
- UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
- >
- </Filter>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
diff --git a/release_23/win32/Linker/Linker.vcproj b/release_23/win32/Linker/Linker.vcproj
deleted file mode 100644
index 7b720f9f902f..000000000000
--- a/release_23/win32/Linker/Linker.vcproj
+++ /dev/null
@@ -1,337 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="8.00"
- Name="Linker"
- ProjectGUID="{342CF48F-760A-4040-A9A1-7D75AA2471CE}"
- Keyword="Win32Proj"
- >
- <Platforms>
- <Platform
- Name="Win32"
- />
- <Platform
- Name="x64"
- />
- </Platforms>
- <ToolFiles>
- </ToolFiles>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="4"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="..\..\include;.."
- PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;WIN32;_DEBUG;_LIB;__STDC_LIMIT_MACROS"
- StringPooling="true"
- MinimalRebuild="true"
- BasicRuntimeChecks="3"
- RuntimeLibrary="3"
- ForceConformanceInForLoopScope="true"
- RuntimeTypeInfo="true"
- UsePrecompiledHeader="0"
- ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb"
- BrowseInformation="1"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="3"
- DisableSpecificWarnings="4355,4146,4800"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLibrarianTool"
- OutputFile="$(OutDir)/Linker.lib"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory="$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="4"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="..\..\include;.."
- PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;WIN32;NDEBUG;_LIB;__STDC_LIMIT_MACROS"
- StringPooling="true"
- RuntimeLibrary="2"
- ForceConformanceInForLoopScope="true"
- RuntimeTypeInfo="true"
- UsePrecompiledHeader="0"
- ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="3"
- DisableSpecificWarnings="4355,4146,4800"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLibrarianTool"
- OutputFile="$(OutDir)/Linker.lib"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Debug|x64"
- OutputDirectory="$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="4"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- TargetEnvironment="3"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="..\..\include;.."
- PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;WIN32;_DEBUG;_LIB;__STDC_LIMIT_MACROS"
- StringPooling="true"
- MinimalRebuild="true"
- BasicRuntimeChecks="3"
- RuntimeLibrary="3"
- ForceConformanceInForLoopScope="true"
- RuntimeTypeInfo="true"
- UsePrecompiledHeader="0"
- ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb"
- BrowseInformation="1"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="3"
- DisableSpecificWarnings="4355,4146,4800"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLibrarianTool"
- OutputFile="$(OutDir)/Linker.lib"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Release|x64"
- OutputDirectory="$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="4"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- TargetEnvironment="3"
- />
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="..\..\include;.."
- PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;WIN32;NDEBUG;_LIB;__STDC_LIMIT_MACROS"
- StringPooling="true"
- RuntimeLibrary="2"
- ForceConformanceInForLoopScope="true"
- RuntimeTypeInfo="true"
- UsePrecompiledHeader="0"
- ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="3"
- DisableSpecificWarnings="4355,4146,4800"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLibrarianTool"
- OutputFile="$(OutDir)/Linker.lib"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- </Configurations>
- <References>
- </References>
- <Files>
- <Filter
- Name="Source Files"
- Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
- UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
- >
- <File
- RelativePath="..\..\lib\Linker\LinkArchives.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Linker\Linker.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Linker\LinkItems.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Linker\LinkModules.cpp"
- >
- </File>
- </Filter>
- <Filter
- Name="Header Files"
- Filter="h;hpp;hxx;hm;inl;inc;xsd"
- UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
- >
- <File
- RelativePath="..\..\include\llvm\Linker.h"
- >
- </File>
- </Filter>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
diff --git a/release_23/win32/Support/Support.vcproj b/release_23/win32/Support/Support.vcproj
deleted file mode 100644
index c6bca2e59fdf..000000000000
--- a/release_23/win32/Support/Support.vcproj
+++ /dev/null
@@ -1,742 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="8.00"
- Name="support"
- ProjectGUID="{28AA9146-3482-4F41-9CC6-407B1D258508}"
- RootNamespace="support"
- Keyword="Win32Proj"
- >
- <Platforms>
- <Platform
- Name="Win32"
- />
- <Platform
- Name="x64"
- />
- </Platforms>
- <ToolFiles>
- </ToolFiles>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="4"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="..\..\include;.."
- PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;WIN32;_DEBUG;_LIB;__STDC_LIMIT_MACROS"
- StringPooling="true"
- MinimalRebuild="true"
- BasicRuntimeChecks="3"
- RuntimeLibrary="3"
- ForceConformanceInForLoopScope="true"
- RuntimeTypeInfo="true"
- UsePrecompiledHeader="0"
- ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb"
- BrowseInformation="1"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="3"
- DisableSpecificWarnings="4355,4146,4800"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLibrarianTool"
- OutputFile="$(OutDir)/support.lib"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory="$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="4"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="..\..\include;.."
- PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;WIN32;NDEBUG;_LIB;__STDC_LIMIT_MACROS"
- StringPooling="true"
- RuntimeLibrary="2"
- ForceConformanceInForLoopScope="true"
- RuntimeTypeInfo="true"
- UsePrecompiledHeader="0"
- ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="3"
- DisableSpecificWarnings="4355,4146,4800"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLibrarianTool"
- OutputFile="$(OutDir)/support.lib"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Debug|x64"
- OutputDirectory="$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="4"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- TargetEnvironment="3"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="..\..\include;.."
- PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;WIN32;_DEBUG;_LIB;__STDC_LIMIT_MACROS"
- StringPooling="true"
- MinimalRebuild="true"
- BasicRuntimeChecks="3"
- RuntimeLibrary="3"
- ForceConformanceInForLoopScope="true"
- RuntimeTypeInfo="true"
- UsePrecompiledHeader="0"
- ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb"
- BrowseInformation="1"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="3"
- DisableSpecificWarnings="4355,4146,4800"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLibrarianTool"
- OutputFile="$(OutDir)/support.lib"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Release|x64"
- OutputDirectory="$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="4"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- TargetEnvironment="3"
- />
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="..\..\include;.."
- PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;WIN32;NDEBUG;_LIB;__STDC_LIMIT_MACROS"
- StringPooling="true"
- RuntimeLibrary="2"
- ForceConformanceInForLoopScope="true"
- RuntimeTypeInfo="true"
- UsePrecompiledHeader="0"
- ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="3"
- DisableSpecificWarnings="4355,4146,4800"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLibrarianTool"
- OutputFile="$(OutDir)/support.lib"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- </Configurations>
- <References>
- </References>
- <Files>
- <Filter
- Name="Source Files"
- Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
- UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
- >
- <File
- RelativePath="..\..\lib\Support\Allocator.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Support\Annotation.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Support\APFloat.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Support\APInt.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Support\APSInt.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Support\CommandLine.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Support\ConstantRange.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Support\Debug.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Support\Dwarf.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Support\FileUtilities.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Support\FoldingSet.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Support\GraphWriter.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Support\IsInf.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Support\IsNAN.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Support\ManagedStatic.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Support\MemoryBuffer.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Support\PluginLoader.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Support\SlowOperationInformer.cpp"
- >
- <FileConfiguration
- Name="Release|Win32"
- ExcludedFromBuild="true"
- >
- <Tool
- Name="VCCLCompilerTool"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Release|x64"
- ExcludedFromBuild="true"
- >
- <Tool
- Name="VCCLCompilerTool"
- />
- </FileConfiguration>
- </File>
- <File
- RelativePath="..\..\lib\Support\SmallPtrSet.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Support\Statistic.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Support\Streams.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Support\StringExtras.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Support\StringMap.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Support\StringPool.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Support\SystemUtils.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Support\Timer.cpp"
- >
- </File>
- </Filter>
- <Filter
- Name="Header Files"
- Filter="h;hpp;hxx;hm;inl;inc;xsd"
- UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
- >
- <File
- RelativePath="..\..\include\llvm\Support\AIXDataTypesFix.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Support\Alignment.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Support\AlignOf.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Support\Allocator.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Support\Annotation.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Support\CallSite.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Support\Casting.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Support\CFG.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Support\CHelpers.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Support\CommandLine.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Support\Compiler.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Support\ConstantRange.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Support\Debug.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Support\DOTGraphTraits.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Support\Dwarf.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Support\ELF.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Support\FileUtilities.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Support\GetElementPtrTypeIterator.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Support\GraphWriter.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Support\InstIterator.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Support\InstVisitor.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Support\LeakDetector.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Support\Linker.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Support\MallocAllocator.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Support\ManagedStatic.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Support\Mangler.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Support\MathExtras.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Support\MemoryBuffer.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Support\OutputBuffer.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Support\PassNameParser.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Support\PatternMatch.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Support\PluginLoader.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Support\Registry.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Support\SlowOperationInformer.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Support\StableBasicBlockNumbering.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Support\Streams.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Support\StringPool.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Support\SystemUtils.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Support\ThreadSupport-NoSupport.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Support\ThreadSupport-PThreads.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Support\Timer.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Support\type_traits.h"
- >
- </File>
- </Filter>
- <Filter
- Name="ADT"
- >
- <File
- RelativePath="..\..\include\llvm\ADT\APInt.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\ADT\APSInt.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\ADT\BitVector.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Support\DataTypes.h.in"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Adt\DenseMap.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\ADT\DenseSet.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Adt\DepthFirstIterator.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Adt\EquivalenceClasses.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\ADT\FoldingSet.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Adt\GraphTraits.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Adt\hash_map"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Adt\hash_set"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Adt\HashExtras.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Adt\ilist"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\ADT\ImmutableMap.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\ADT\ImmutableSet.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\ADT\IndexedMap.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Adt\iterator"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Adt\PostOrderIterator.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Adt\SCCIterator.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Adt\SetOperations.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Adt\SetVector.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\ADT\SmallPtrSet.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\ADT\SmallSet.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\ADT\SmallString.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\ADT\SmallVector.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Adt\Statistic.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Adt\STLExtras.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Adt\StringExtras.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\ADT\StringMap.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Adt\Tree.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Adt\UniqueVector.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Adt\VectorExtras.h"
- >
- </File>
- </Filter>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
diff --git a/release_23/win32/System/System.vcproj b/release_23/win32/System/System.vcproj
deleted file mode 100644
index c450e93c2198..000000000000
--- a/release_23/win32/System/System.vcproj
+++ /dev/null
@@ -1,462 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="8.00"
- Name="System"
- ProjectGUID="{0F8407F3-FA23-4CF1-83A9-DCBE0B361489}"
- RootNamespace="System"
- Keyword="Win32Proj"
- >
- <Platforms>
- <Platform
- Name="Win32"
- />
- <Platform
- Name="x64"
- />
- </Platforms>
- <ToolFiles>
- </ToolFiles>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="4"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="..\..\include;.."
- PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;WIN32;_DEBUG;_LIB;__STDC_LIMIT_MACROS"
- StringPooling="true"
- MinimalRebuild="true"
- BasicRuntimeChecks="3"
- RuntimeLibrary="3"
- ForceConformanceInForLoopScope="true"
- RuntimeTypeInfo="true"
- UsePrecompiledHeader="0"
- ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb"
- BrowseInformation="1"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="3"
- DisableSpecificWarnings="4355,4146,4800"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLibrarianTool"
- OutputFile="$(OutDir)/System.lib"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Debug|x64"
- OutputDirectory="$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="4"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- TargetEnvironment="3"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="..\..\include;.."
- PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;WIN32;_DEBUG;_LIB;__STDC_LIMIT_MACROS"
- StringPooling="true"
- MinimalRebuild="true"
- BasicRuntimeChecks="3"
- RuntimeLibrary="3"
- ForceConformanceInForLoopScope="true"
- RuntimeTypeInfo="true"
- UsePrecompiledHeader="0"
- ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb"
- BrowseInformation="1"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="3"
- DisableSpecificWarnings="4355,4146,4800"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLibrarianTool"
- OutputFile="$(OutDir)/System.lib"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory="$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="4"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="..\..\include;.."
- PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;WIN32;NDEBUG;_LIB;__STDC_LIMIT_MACROS"
- StringPooling="true"
- RuntimeLibrary="2"
- ForceConformanceInForLoopScope="true"
- RuntimeTypeInfo="true"
- UsePrecompiledHeader="0"
- ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="3"
- DisableSpecificWarnings="4355,4146,4800"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLibrarianTool"
- OutputFile="$(OutDir)/System.lib"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Release|x64"
- OutputDirectory="$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="4"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- TargetEnvironment="3"
- />
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="..\..\include;.."
- PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;WIN32;NDEBUG;_LIB;__STDC_LIMIT_MACROS"
- StringPooling="true"
- RuntimeLibrary="2"
- ForceConformanceInForLoopScope="true"
- RuntimeTypeInfo="true"
- UsePrecompiledHeader="0"
- ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="3"
- DisableSpecificWarnings="4355,4146,4800"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLibrarianTool"
- OutputFile="$(OutDir)/System.lib"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- </Configurations>
- <References>
- </References>
- <Files>
- <Filter
- Name="Source Files"
- Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
- UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
- >
- <File
- RelativePath="..\..\lib\System\Alarm.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\System\Disassembler.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\System\DynamicLibrary.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\System\IncludeFile.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\System\Memory.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\System\Mutex.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\System\Path.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\System\Process.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\System\Program.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\System\Signals.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\System\TimeValue.cpp"
- >
- </File>
- </Filter>
- <Filter
- Name="Header Files"
- Filter="h;hpp;hxx;hm;inl;inc;xsd"
- UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
- >
- <File
- RelativePath="..\..\include\llvm\System\Alarm.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\System\Disassembler.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\System\DynamicLibrary.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\System\Host.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\System\IncludeFile.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\System\MappedFile.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\System\Memory.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\System\Mutex.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\System\Path.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\System\Process.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\System\Program.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\System\Signals.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\System\TimeValue.h"
- >
- </File>
- </Filter>
- <Filter
- Name="Win32"
- >
- <File
- RelativePath="..\..\lib\System\Win32\Alarm.inc"
- >
- </File>
- <File
- RelativePath="..\..\lib\System\Win32\DynamicLibrary.inc"
- >
- </File>
- <File
- RelativePath="..\..\lib\System\Win32\MappedFile.inc"
- >
- </File>
- <File
- RelativePath="..\..\lib\System\Win32\Memory.inc"
- >
- </File>
- <File
- RelativePath="..\..\lib\System\Win32\Mutex.inc"
- >
- </File>
- <File
- RelativePath="..\..\lib\System\Win32\Path.inc"
- >
- </File>
- <File
- RelativePath="..\..\lib\System\Win32\Process.inc"
- >
- </File>
- <File
- RelativePath="..\..\lib\System\Win32\Program.inc"
- >
- </File>
- <File
- RelativePath="..\..\lib\System\Win32\Signals.inc"
- >
- </File>
- <File
- RelativePath="..\..\lib\System\Win32\TimeValue.inc"
- >
- </File>
- <File
- RelativePath="..\..\lib\System\Win32\Win32.h"
- >
- </File>
- </Filter>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
diff --git a/release_23/win32/TableGen/TableGen.vcproj b/release_23/win32/TableGen/TableGen.vcproj
deleted file mode 100644
index f64f1956d555..000000000000
--- a/release_23/win32/TableGen/TableGen.vcproj
+++ /dev/null
@@ -1,524 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="8.00"
- Name="TableGen"
- ProjectGUID="{339C2249-26B6-4172-B484-85653029AF57}"
- RootNamespace="TableGen"
- Keyword="Win32Proj"
- >
- <Platforms>
- <Platform
- Name="Win32"
- />
- <Platform
- Name="x64"
- />
- </Platforms>
- <ToolFiles>
- </ToolFiles>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="1"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="..\..\include;..;..\..\utils\tablegen"
- PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;__STDC_LIMIT_MACROS"
- StringPooling="true"
- MinimalRebuild="true"
- BasicRuntimeChecks="3"
- RuntimeLibrary="3"
- ForceConformanceInForLoopScope="true"
- RuntimeTypeInfo="true"
- UsePrecompiledHeader="0"
- ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb"
- BrowseInformation="1"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="4"
- DisableSpecificWarnings="4355,4146,4800"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- OutputFile="$(OutDir)\TableGen.exe"
- LinkIncremental="2"
- AdditionalLibraryDirectories=""
- GenerateDebugInformation="true"
- ProgramDatabaseFile="$(OutDir)/TableGen.pdb"
- SubSystem="1"
- TargetMachine="1"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory="$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="1"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="..\..\include;..;..\..\utils\tablegen"
- PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;__STDC_LIMIT_MACROS"
- StringPooling="true"
- RuntimeLibrary="2"
- ForceConformanceInForLoopScope="true"
- RuntimeTypeInfo="true"
- UsePrecompiledHeader="0"
- ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="3"
- DisableSpecificWarnings="4355,4146,4800"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- OutputFile="$(OutDir)\TableGen.exe"
- LinkIncremental="1"
- AdditionalLibraryDirectories=""
- GenerateDebugInformation="true"
- SubSystem="1"
- OptimizeReferences="2"
- EnableCOMDATFolding="2"
- TargetMachine="1"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Debug|x64"
- OutputDirectory="$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="1"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- TargetEnvironment="3"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="..\..\include;..;..\..\utils\tablegen"
- PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;__STDC_LIMIT_MACROS"
- StringPooling="true"
- MinimalRebuild="true"
- BasicRuntimeChecks="3"
- RuntimeLibrary="3"
- ForceConformanceInForLoopScope="true"
- RuntimeTypeInfo="true"
- UsePrecompiledHeader="0"
- ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb"
- BrowseInformation="1"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="3"
- DisableSpecificWarnings="4355,4146,4800"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- OutputFile="$(OutDir)\TableGen.exe"
- LinkIncremental="2"
- AdditionalLibraryDirectories=""
- GenerateDebugInformation="true"
- ProgramDatabaseFile="$(OutDir)/TableGen.pdb"
- SubSystem="1"
- TargetMachine="17"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Release|x64"
- OutputDirectory="$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="1"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- TargetEnvironment="3"
- />
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="..\..\include;..;..\..\utils\tablegen"
- PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;__STDC_LIMIT_MACROS"
- StringPooling="true"
- RuntimeLibrary="2"
- ForceConformanceInForLoopScope="true"
- RuntimeTypeInfo="true"
- UsePrecompiledHeader="0"
- ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="3"
- DisableSpecificWarnings="4355,4146,4800"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- OutputFile="$(OutDir)\TableGen.exe"
- LinkIncremental="1"
- AdditionalLibraryDirectories=""
- GenerateDebugInformation="true"
- SubSystem="1"
- OptimizeReferences="2"
- EnableCOMDATFolding="2"
- TargetMachine="17"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- </Configurations>
- <References>
- </References>
- <Files>
- <Filter
- Name="Source Files"
- Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
- UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
- >
- <File
- RelativePath="..\..\utils\TableGen\AsmWriterEmitter.cpp"
- >
- </File>
- <File
- RelativePath="..\..\utils\TableGen\CallingConvEmitter.cpp"
- >
- </File>
- <File
- RelativePath="..\..\utils\TableGen\CodeEmitterGen.cpp"
- >
- </File>
- <File
- RelativePath="..\..\utils\TableGen\CodeGenDAGPatterns.cpp"
- >
- </File>
- <File
- RelativePath="..\..\utils\TableGen\CodeGenInstruction.cpp"
- >
- </File>
- <File
- RelativePath="..\..\utils\TableGen\CodeGenTarget.cpp"
- >
- </File>
- <File
- RelativePath="..\..\utils\TableGen\DAGISelEmitter.cpp"
- >
- </File>
- <File
- RelativePath="..\..\utils\TableGen\InstrEnumEmitter.cpp"
- >
- </File>
- <File
- RelativePath="..\..\utils\TableGen\InstrInfoEmitter.cpp"
- >
- </File>
- <File
- RelativePath="..\..\utils\TableGen\IntrinsicEmitter.cpp"
- >
- </File>
- <File
- RelativePath="..\..\utils\TableGen\LLVMCConfigurationEmitter.cpp"
- >
- </File>
- <File
- RelativePath="..\..\utils\TableGen\Record.cpp"
- >
- </File>
- <File
- RelativePath="..\..\utils\TableGen\RegisterInfoEmitter.cpp"
- >
- </File>
- <File
- RelativePath="..\..\utils\TableGen\SubtargetEmitter.cpp"
- >
- </File>
- <File
- RelativePath="..\..\utils\TableGen\TableGen.cpp"
- >
- </File>
- <File
- RelativePath="..\..\utils\TableGen\TableGenBackend.cpp"
- >
- </File>
- <File
- RelativePath="..\..\utils\TableGen\TGLexer.cpp"
- >
- </File>
- <File
- RelativePath="..\..\utils\TableGen\TGParser.cpp"
- >
- </File>
- </Filter>
- <Filter
- Name="Header Files"
- Filter="h;hpp;hxx;hm;inl;inc;xsd"
- UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
- >
- <File
- RelativePath="..\..\utils\TableGen\AsmWriterEmitter.h"
- >
- </File>
- <File
- RelativePath="..\..\utils\TableGen\CallingConvEmitter.h"
- >
- </File>
- <File
- RelativePath="..\..\utils\TableGen\CodeEmitterGen.h"
- >
- </File>
- <File
- RelativePath="..\..\utils\TableGen\CodeGenDAGPatterns.h"
- >
- </File>
- <File
- RelativePath="..\..\utils\TableGen\CodeGenInstruction.h"
- >
- </File>
- <File
- RelativePath="..\..\utils\TableGen\CodeGenIntrinsics.h"
- >
- </File>
- <File
- RelativePath="..\..\utils\TableGen\CodeGenRegisters.h"
- >
- </File>
- <File
- RelativePath="..\..\utils\TableGen\CodeGenTarget.h"
- >
- </File>
- <File
- RelativePath="..\..\utils\TableGen\DAGISelEmitter.h"
- >
- </File>
- <File
- RelativePath="..\..\utils\TableGen\InstrEnumEmitter.h"
- >
- </File>
- <File
- RelativePath="..\..\utils\TableGen\InstrInfoEmitter.h"
- >
- </File>
- <File
- RelativePath="..\..\utils\TableGen\IntrinsicEmitter.h"
- >
- </File>
- <File
- RelativePath="..\..\utils\TableGen\Record.h"
- >
- </File>
- <File
- RelativePath="..\..\utils\TableGen\RegisterInfoEmitter.h"
- >
- </File>
- <File
- RelativePath="..\..\utils\TableGen\SubtargetEmitter.h"
- >
- </File>
- <File
- RelativePath="..\..\utils\TableGen\TableGenBackend.h"
- >
- </File>
- <File
- RelativePath="..\..\utils\TableGen\TGLexer.h"
- >
- </File>
- <File
- RelativePath="..\..\utils\TableGen\TGParser.h"
- >
- </File>
- </Filter>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
diff --git a/release_23/win32/Target/Target.vcproj b/release_23/win32/Target/Target.vcproj
deleted file mode 100644
index e64089e4acbf..000000000000
--- a/release_23/win32/Target/Target.vcproj
+++ /dev/null
@@ -1,421 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="8.00"
- Name="Target"
- ProjectGUID="{059FBAB8-C76D-48A0-AA75-3C57BD3EAFE4}"
- Keyword="Win32Proj"
- >
- <Platforms>
- <Platform
- Name="Win32"
- />
- <Platform
- Name="x64"
- />
- </Platforms>
- <ToolFiles>
- </ToolFiles>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="4"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="..\..\include;.."
- PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;WIN32;_DEBUG;_LIB;__STDC_LIMIT_MACROS"
- StringPooling="true"
- MinimalRebuild="true"
- BasicRuntimeChecks="3"
- RuntimeLibrary="3"
- ForceConformanceInForLoopScope="true"
- RuntimeTypeInfo="true"
- UsePrecompiledHeader="0"
- ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb"
- BrowseInformation="1"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="3"
- DisableSpecificWarnings="4355,4146,4800"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLibrarianTool"
- OutputFile="$(OutDir)/Target.lib"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory="$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="4"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="..\..\include;.."
- PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;WIN32;NDEBUG;_LIB;__STDC_LIMIT_MACROS"
- StringPooling="true"
- RuntimeLibrary="2"
- ForceConformanceInForLoopScope="true"
- RuntimeTypeInfo="true"
- UsePrecompiledHeader="0"
- ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="3"
- DisableSpecificWarnings="4355,4146,4800"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLibrarianTool"
- OutputFile="$(OutDir)/Target.lib"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Debug|x64"
- OutputDirectory="$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="4"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- TargetEnvironment="3"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="..\..\include;.."
- PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;WIN32;_DEBUG;_LIB;__STDC_LIMIT_MACROS"
- StringPooling="true"
- MinimalRebuild="true"
- BasicRuntimeChecks="3"
- RuntimeLibrary="3"
- ForceConformanceInForLoopScope="true"
- RuntimeTypeInfo="true"
- UsePrecompiledHeader="0"
- ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb"
- BrowseInformation="1"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="3"
- DisableSpecificWarnings="4355,4146,4800"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLibrarianTool"
- OutputFile="$(OutDir)/Target.lib"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Release|x64"
- OutputDirectory="$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="4"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- TargetEnvironment="3"
- />
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="..\..\include;.."
- PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;WIN32;NDEBUG;_LIB;__STDC_LIMIT_MACROS"
- StringPooling="true"
- RuntimeLibrary="2"
- ForceConformanceInForLoopScope="true"
- RuntimeTypeInfo="true"
- UsePrecompiledHeader="0"
- ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="3"
- DisableSpecificWarnings="4355,4146,4800"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLibrarianTool"
- OutputFile="$(OutDir)/Target.lib"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- </Configurations>
- <References>
- </References>
- <Files>
- <Filter
- Name="Source Files"
- Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
- UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
- >
- <File
- RelativePath="..\..\lib\Target\SubtargetFeature.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Target\TargetAsmInfo.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Target\TargetData.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Target\TargetFrameInfo.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Target\TargetInstrInfo.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Target\TargetMachine.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Target\TargetMachineRegistry.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Target\TargetMachOWriterInfo.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Target\TargetRegisterInfo.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Target\TargetSubtarget.cpp"
- >
- </File>
- </Filter>
- <Filter
- Name="Header Files"
- Filter="h;hpp;hxx;hm;inl;inc;xsd"
- UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
- >
- <File
- RelativePath="..\..\include\llvm\Target\SubtargetFeature.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Target\TargetAsmInfo.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Target\TargetData.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Target\TargetELFWriterInfo.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Target\TargetFrameInfo.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Target\TargetInstrDesc.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Target\TargetInstrInfo.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Target\TargetInstrItineraries.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Target\TargetJITInfo.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Target\TargetLowering.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Target\TargetMachine.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Target\TargetMachineRegistry.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Target\TargetMachOWriterInfo.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Target\TargetOptions.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Target\TargetRegisterInfo.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Target\TargetSubtarget.h"
- >
- </File>
- </Filter>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
diff --git a/release_23/win32/Transforms/Transforms.vcproj b/release_23/win32/Transforms/Transforms.vcproj
deleted file mode 100644
index a0b029a7cdc6..000000000000
--- a/release_23/win32/Transforms/Transforms.vcproj
+++ /dev/null
@@ -1,743 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="8.00"
- Name="Transforms"
- ProjectGUID="{C59374C1-9FC0-4147-B836-327DFDC52D99}"
- Keyword="Win32Proj"
- >
- <Platforms>
- <Platform
- Name="Win32"
- />
- <Platform
- Name="x64"
- />
- </Platforms>
- <ToolFiles>
- </ToolFiles>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="4"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="..\..\include;.."
- PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;WIN32;_DEBUG;_LIB;__STDC_LIMIT_MACROS"
- StringPooling="true"
- MinimalRebuild="true"
- BasicRuntimeChecks="3"
- RuntimeLibrary="3"
- ForceConformanceInForLoopScope="true"
- RuntimeTypeInfo="true"
- UsePrecompiledHeader="0"
- ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb"
- BrowseInformation="1"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="3"
- DisableSpecificWarnings="4355,4146,4800"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLibrarianTool"
- OutputFile="$(OutDir)/Transforms.lib"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory="$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="4"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="..\..\include;.."
- PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;WIN32;NDEBUG;_LIB;__STDC_LIMIT_MACROS"
- StringPooling="true"
- RuntimeLibrary="2"
- ForceConformanceInForLoopScope="true"
- RuntimeTypeInfo="true"
- UsePrecompiledHeader="0"
- ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="3"
- DisableSpecificWarnings="4355,4146,4800"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLibrarianTool"
- OutputFile="$(OutDir)/Transforms.lib"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Debug|x64"
- OutputDirectory="$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="4"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- TargetEnvironment="3"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="..\..\include;.."
- PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;WIN32;_DEBUG;_LIB;__STDC_LIMIT_MACROS"
- StringPooling="true"
- MinimalRebuild="true"
- BasicRuntimeChecks="3"
- RuntimeLibrary="3"
- ForceConformanceInForLoopScope="true"
- RuntimeTypeInfo="true"
- UsePrecompiledHeader="0"
- ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb"
- BrowseInformation="1"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="3"
- DisableSpecificWarnings="4355,4146,4800"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLibrarianTool"
- OutputFile="$(OutDir)/Transforms.lib"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Release|x64"
- OutputDirectory="$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="4"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- TargetEnvironment="3"
- />
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="..\..\include;.."
- PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;WIN32;NDEBUG;_LIB;__STDC_LIMIT_MACROS"
- StringPooling="true"
- RuntimeLibrary="2"
- ForceConformanceInForLoopScope="true"
- RuntimeTypeInfo="true"
- UsePrecompiledHeader="0"
- ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="3"
- DisableSpecificWarnings="4355,4146,4800"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLibrarianTool"
- OutputFile="$(OutDir)/Transforms.lib"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- </Configurations>
- <References>
- </References>
- <Files>
- <Filter
- Name="Source Files"
- Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
- UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
- >
- <Filter
- Name="Instrumentation"
- >
- <File
- RelativePath="..\..\lib\Transforms\Instrumentation\BlockProfiling.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Transforms\Instrumentation\EdgeProfiling.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Transforms\Instrumentation\ProfilingUtils.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Transforms\Instrumentation\ProfilingUtils.h"
- >
- </File>
- <File
- RelativePath="..\..\lib\Transforms\Instrumentation\RSProfiling.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Transforms\Instrumentation\RSProfiling.h"
- >
- </File>
- </Filter>
- <Filter
- Name="IPO"
- >
- <File
- RelativePath="..\..\lib\Transforms\Ipo\ArgumentPromotion.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Transforms\Ipo\ConstantMerge.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Transforms\Ipo\DeadArgumentElimination.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Transforms\Ipo\DeadTypeElimination.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Transforms\IPO\ExtractGV.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Transforms\Ipo\GlobalDCE.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Transforms\Ipo\GlobalOpt.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Transforms\Ipo\IndMemRemoval.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Transforms\Ipo\Inliner.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Transforms\Ipo\InlineSimple.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Transforms\Ipo\Internalize.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Transforms\Ipo\IPConstantPropagation.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Transforms\Ipo\LoopExtractor.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Transforms\Ipo\LowerSetJmp.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Transforms\Ipo\PruneEH.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Transforms\Ipo\RaiseAllocations.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Transforms\IPO\StripDeadPrototypes.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Transforms\Ipo\StripSymbols.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Transforms\IPO\StructRetPromotion.cpp"
- >
- </File>
- </Filter>
- <Filter
- Name="Scalar"
- >
- <File
- RelativePath="..\..\lib\Transforms\Scalar\ADCE.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Transforms\Scalar\BasicBlockPlacement.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Transforms\Scalar\CodeGenPrepare.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Transforms\Scalar\CondPropagate.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Transforms\Scalar\ConstantProp.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Transforms\Scalar\DCE.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Transforms\Scalar\DeadStoreElimination.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Transforms\Scalar\GCSE.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Transforms\Scalar\GVN.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Transforms\Scalar\GVNPRE.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Transforms\Scalar\IndVarSimplify.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Transforms\Scalar\InstructionCombining.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Transforms\Scalar\JumpThreading.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Transforms\Scalar\LICM.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Transforms\Scalar\LoopDeletion.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Transforms\Scalar\LoopIndexSplit.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Transforms\Scalar\LoopRotation.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Transforms\Scalar\LoopStrengthReduce.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Transforms\Scalar\LoopUnroll.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Transforms\Scalar\LoopUnswitch.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Transforms\Scalar\MemCpyOptimizer.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Transforms\Scalar\PredicateSimplifier.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Transforms\Scalar\Reassociate.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Transforms\Scalar\Reg2Mem.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Transforms\Scalar\Scalar.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Transforms\Scalar\ScalarReplAggregates.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Transforms\Scalar\SCCP.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Transforms\Scalar\SimplifyCFG.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Transforms\Scalar\SimplifyLibCalls.cpp"
- >
- <FileConfiguration
- Name="Debug|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- ObjectFile="$(IntDir)\$(InputName)1.obj"
- XMLDocumentationFileName="$(IntDir)\$(InputName)1.xdc"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Release|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- ObjectFile="$(IntDir)\$(InputName)1.obj"
- XMLDocumentationFileName="$(IntDir)\$(InputName)1.xdc"
- />
- </FileConfiguration>
- </File>
- <File
- RelativePath="..\..\lib\Transforms\Scalar\TailDuplication.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Transforms\Scalar\TailRecursionElimination.cpp"
- >
- </File>
- </Filter>
- <Filter
- Name="Parallel"
- >
- </Filter>
- <Filter
- Name="Utils"
- >
- <File
- RelativePath="..\..\lib\Transforms\Utils\BasicBlockUtils.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Transforms\Utils\BasicInliner.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Transforms\Utils\BreakCriticalEdges.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Transforms\Utils\CloneFunction.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Transforms\Utils\CloneLoop.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Transforms\Utils\CloneModule.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Transforms\Utils\CloneTrace.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Transforms\Utils\CodeExtractor.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Transforms\Utils\DemoteRegToStack.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Transforms\Utils\InlineCost.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Transforms\Utils\InlineFunction.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Transforms\Utils\LCSSA.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Transforms\Utils\Local.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Transforms\Utils\LoopSimplify.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Transforms\Utils\LowerAllocations.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Transforms\Utils\LowerInvoke.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Transforms\Utils\LowerSwitch.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Transforms\Utils\Mem2Reg.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Transforms\Utils\PromoteMemoryToRegister.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Transforms\Utils\SimplifyCFG.cpp"
- >
- <FileConfiguration
- Name="Debug|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- ObjectFile="$(IntDir)/$(InputName)1.obj"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Release|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- ObjectFile="$(IntDir)/$(InputName)1.obj"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Debug|x64"
- >
- <Tool
- Name="VCCLCompilerTool"
- ObjectFile="$(IntDir)/$(InputName)1.obj"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Release|x64"
- >
- <Tool
- Name="VCCLCompilerTool"
- ObjectFile="$(IntDir)/$(InputName)1.obj"
- />
- </FileConfiguration>
- </File>
- <File
- RelativePath="..\..\lib\Transforms\Utils\UnifyFunctionExitNodes.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Transforms\Utils\ValueMapper.cpp"
- >
- </File>
- </Filter>
- </Filter>
- <Filter
- Name="Header Files"
- Filter="h;hpp;hxx;hm;inl;inc;xsd"
- UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
- >
- <File
- RelativePath="..\..\include\llvm\Transforms\Utils\BasicBlockUtils.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Transforms\Utils\Cloning.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Transforms\Utils\FunctionUtils.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Transforms\Instrumentation.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Transforms\IPO.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Transforms\Utils\Local.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Transforms\Utils\PromoteMemToReg.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Transforms\RSProfiling.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Transforms\Scalar.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Transforms\Utils\UnifyFunctionExitNodes.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Transforms\Utils\ValueMapper.h"
- >
- </File>
- </Filter>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
diff --git a/release_23/win32/VMCore/VMCore.vcproj b/release_23/win32/VMCore/VMCore.vcproj
deleted file mode 100644
index f9ac38da728b..000000000000
--- a/release_23/win32/VMCore/VMCore.vcproj
+++ /dev/null
@@ -1,642 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="8.00"
- Name="VMCore"
- ProjectGUID="{45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB}"
- RootNamespace="VMCore"
- Keyword="Win32Proj"
- >
- <Platforms>
- <Platform
- Name="Win32"
- />
- <Platform
- Name="x64"
- />
- </Platforms>
- <ToolFiles>
- </ToolFiles>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="4"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="..\..\include;.."
- PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;WIN32;_DEBUG;_LIB;__STDC_LIMIT_MACROS"
- StringPooling="true"
- MinimalRebuild="true"
- BasicRuntimeChecks="3"
- RuntimeLibrary="3"
- ForceConformanceInForLoopScope="true"
- RuntimeTypeInfo="true"
- UsePrecompiledHeader="0"
- ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb"
- BrowseInformation="1"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="3"
- DisableSpecificWarnings="4355,4146,4800"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLibrarianTool"
- OutputFile="$(OutDir)/VMCore.lib"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory="$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="4"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="..\..\include;.."
- PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;WIN32;NDEBUG;_LIB;__STDC_LIMIT_MACROS"
- StringPooling="true"
- RuntimeLibrary="2"
- ForceConformanceInForLoopScope="true"
- RuntimeTypeInfo="true"
- UsePrecompiledHeader="0"
- ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="3"
- DisableSpecificWarnings="4355,4146,4800"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLibrarianTool"
- OutputFile="$(OutDir)/VMCore.lib"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Debug|x64"
- OutputDirectory="$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="4"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- TargetEnvironment="3"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="..\..\include;.."
- PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;WIN32;_DEBUG;_LIB;__STDC_LIMIT_MACROS"
- StringPooling="true"
- MinimalRebuild="true"
- BasicRuntimeChecks="3"
- RuntimeLibrary="3"
- ForceConformanceInForLoopScope="true"
- RuntimeTypeInfo="true"
- UsePrecompiledHeader="0"
- ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb"
- BrowseInformation="1"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="3"
- DisableSpecificWarnings="4355,4146,4800"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLibrarianTool"
- OutputFile="$(OutDir)/VMCore.lib"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Release|x64"
- OutputDirectory="$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="4"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- TargetEnvironment="3"
- />
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="..\..\include;.."
- PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;WIN32;NDEBUG;_LIB;__STDC_LIMIT_MACROS"
- StringPooling="true"
- RuntimeLibrary="2"
- ForceConformanceInForLoopScope="true"
- RuntimeTypeInfo="true"
- UsePrecompiledHeader="0"
- ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="3"
- DisableSpecificWarnings="4355,4146,4800"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLibrarianTool"
- OutputFile="$(OutDir)/VMCore.lib"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- </Configurations>
- <References>
- </References>
- <Files>
- <Filter
- Name="Source Files"
- Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
- UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
- >
- <File
- RelativePath="..\..\lib\VMCore\AsmWriter.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\VMCore\AutoUpgrade.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\VMCore\BasicBlock.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\VMCore\ConstantFold.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\VMCore\Constants.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\VMCore\Core.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\VMCore\Dominators.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\VMCore\Function.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\VMCore\Globals.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\VMCore\InlineAsm.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\VMCore\Instruction.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\VMCore\Instructions.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\VMCore\IntrinsicInst.cpp"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Intrinsics.td"
- >
- <FileConfiguration
- Name="Debug|Win32"
- >
- <Tool
- Name="VCCustomBuildTool"
- Description="Performing TableGen Step"
- CommandLine="echo Building $(InputFileName) code emitter with tblgen&#x0D;&#x0A;$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)\TableGen.exe -gen-intrinsic -I ..\..\include $(InputPath) -o $(SolutionDir)llvm\intrinsics.gen&#x0D;&#x0A;"
- AdditionalDependencies="$(ProjectDir)..\$(IntDir)\TableGen.exe;$(InputDir)IntrinsicsX86.td;$(InputDir)IntrinsicsPowerPC.td"
- Outputs="$(SolutionDir)llvm\intrinsics.gen"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Release|Win32"
- >
- <Tool
- Name="VCCustomBuildTool"
- Description="Performing TableGen Step"
- CommandLine="echo Building $(InputFileName) code emitter with tblgen&#x0D;&#x0A;$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)\TableGen.exe -gen-intrinsic -I ..\..\include $(InputPath) -o $(SolutionDir)llvm\intrinsics.gen&#x0D;&#x0A;"
- AdditionalDependencies="$(ProjectDir)..\$(IntDir)\TableGen.exe;$(InputDir)IntrinsicsX86.td;$(InputDir)IntrinsicsPowerPC.td"
- Outputs="$(SolutionDir)llvm\intrinsics.gen"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Debug|x64"
- >
- <Tool
- Name="VCCustomBuildTool"
- Description="Performing TableGen Step"
- CommandLine="echo Building $(InputFileName) code emitter with tblgen&#x0D;&#x0A;$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)\TableGen.exe -gen-intrinsic -I ..\..\include $(InputPath) -o $(SolutionDir)llvm\intrinsics.gen"
- AdditionalDependencies="$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)\TableGen.exe;$(InputDir)IntrinsicsX86.td;$(InputDir)IntrinsicsPowerPC.td"
- Outputs="$(SolutionDir)llvm\intrinsics.gen"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Release|x64"
- >
- <Tool
- Name="VCCustomBuildTool"
- Description="Performing TableGen Step"
- CommandLine="echo Building $(InputFileName) code emitter with tblgen&#x0D;&#x0A;$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)\TableGen.exe -gen-intrinsic -I ..\..\include $(InputPath) -o $(SolutionDir)llvm\intrinsics.gen"
- AdditionalDependencies="$(ProjectDir)..\$(IntDir)\TableGen.exe;$(InputDir)IntrinsicsX86.td;$(InputDir)IntrinsicsPowerPC.td"
- Outputs="$(SolutionDir)llvm\intrinsics.gen"
- />
- </FileConfiguration>
- </File>
- <File
- RelativePath="..\..\lib\VMCore\LeakDetector.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\VMCore\Mangler.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\VMCore\Module.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\VMCore\ModuleProvider.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\VMCore\ParameterAttributes.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\VMCore\Pass.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\VMCore\PassManager.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\VMCore\Type.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\VMCore\TypeSymbolTable.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\VMCore\Value.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\VMCore\ValueSymbolTable.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\VMCore\ValueTypes.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\VMCore\Verifier.cpp"
- >
- </File>
- </Filter>
- <Filter
- Name="Header Files"
- Filter="h;hpp;hxx;hm;inl;inc;xsd"
- UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
- >
- <File
- RelativePath="..\..\include\llvm\AbstractTypeUser.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Argument.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Assembly\AsmAnnotationWriter.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\BasicBlock.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\CallGraphSCCPass.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Constant.h"
- >
- </File>
- <File
- RelativePath="..\..\lib\VMCore\ConstantFold.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Constants.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\DerivedTypes.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Function.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\GlobalAlias.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\GlobalValue.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\GlobalVariable.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\InlineAsm.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\InstrTypes.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Instruction.def"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Instruction.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Instructions.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\IntrinsicInst.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Intrinsics.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\IntrinsicsPowerPC.td"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\IntrinsicsX86.td"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Linker.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Module.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\ModuleProvider.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\ParameterAttributes.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Pass.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\PassAnalysisSupport.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\PassManager.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\PassManagers.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\PassSupport.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Assembly\PrintModulePass.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\SymbolTableListTraits.h"
- >
- </File>
- <File
- RelativePath="..\..\lib\VMCore\SymbolTableListTraitsImpl.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Type.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\TypeSymbolTable.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Use.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\User.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Value.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\ValueSymbolTable.h"
- >
- </File>
- <File
- RelativePath="..\..\include\llvm\Assembly\Writer.h"
- >
- </File>
- </Filter>
- <Filter
- Name="Generated Tablegen Files"
- >
- <File
- RelativePath="..\llvm\intrinsics.gen"
- >
- </File>
- </Filter>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
diff --git a/release_23/win32/bugpoint/bugpoint.vcproj b/release_23/win32/bugpoint/bugpoint.vcproj
deleted file mode 100644
index c124b557c6c8..000000000000
--- a/release_23/win32/bugpoint/bugpoint.vcproj
+++ /dev/null
@@ -1,429 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="8.00"
- Name="bugpoint"
- ProjectGUID="{57249192-8E29-4D85-8B7A-FEFF1760B1DA}"
- Keyword="Win32Proj"
- >
- <Platforms>
- <Platform
- Name="Win32"
- />
- <Platform
- Name="x64"
- />
- </Platforms>
- <ToolFiles>
- </ToolFiles>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="$(SolutionDir)\$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="1"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="..\..\include;.."
- PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;__STDC_LIMIT_MACROS"
- StringPooling="true"
- MinimalRebuild="true"
- BasicRuntimeChecks="3"
- RuntimeLibrary="3"
- ForceConformanceInForLoopScope="true"
- RuntimeTypeInfo="true"
- UsePrecompiledHeader="0"
- ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb"
- BrowseInformation="1"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="4"
- DisableSpecificWarnings="4355,4146,4800"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- OutputFile="$(OutDir)/bugpoint.exe"
- LinkIncremental="2"
- GenerateDebugInformation="true"
- ProgramDatabaseFile="$(OutDir)/bugpoint.pdb"
- SubSystem="1"
- TargetMachine="1"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory="$(SolutionDir)\$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="1"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="..\..\include;.."
- PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;__STDC_LIMIT_MACROS"
- StringPooling="true"
- RuntimeLibrary="2"
- ForceConformanceInForLoopScope="true"
- RuntimeTypeInfo="true"
- UsePrecompiledHeader="0"
- ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb"
- BrowseInformation="0"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="3"
- DisableSpecificWarnings="4355,4146,4800"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- OutputFile="$(OutDir)/bugpoint.exe"
- LinkIncremental="1"
- GenerateDebugInformation="true"
- SubSystem="1"
- OptimizeReferences="2"
- EnableCOMDATFolding="2"
- TargetMachine="1"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Debug|x64"
- OutputDirectory="$(SolutionDir)\$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="1"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- TargetEnvironment="3"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="..\..\include;.."
- PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;__STDC_LIMIT_MACROS"
- StringPooling="true"
- MinimalRebuild="true"
- BasicRuntimeChecks="3"
- RuntimeLibrary="3"
- ForceConformanceInForLoopScope="true"
- RuntimeTypeInfo="true"
- UsePrecompiledHeader="0"
- ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb"
- BrowseInformation="1"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="3"
- DisableSpecificWarnings="4355,4146,4800"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- OutputFile="$(OutDir)/bugpoint.exe"
- LinkIncremental="2"
- GenerateDebugInformation="true"
- ProgramDatabaseFile="$(OutDir)/bugpoint.pdb"
- SubSystem="1"
- TargetMachine="17"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Release|x64"
- OutputDirectory="$(SolutionDir)\$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="1"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- TargetEnvironment="3"
- />
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="..\..\include;.."
- PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;__STDC_LIMIT_MACROS"
- StringPooling="true"
- RuntimeLibrary="2"
- ForceConformanceInForLoopScope="true"
- RuntimeTypeInfo="true"
- UsePrecompiledHeader="0"
- ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb"
- BrowseInformation="0"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="3"
- DisableSpecificWarnings="4355,4146,4800"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- OutputFile="$(OutDir)/bugpoint.exe"
- LinkIncremental="1"
- GenerateDebugInformation="true"
- SubSystem="1"
- OptimizeReferences="2"
- EnableCOMDATFolding="2"
- TargetMachine="17"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- </Configurations>
- <References>
- </References>
- <Files>
- <Filter
- Name="Source Files"
- Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
- UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
- >
- <File
- RelativePath="..\..\tools\bugpoint\BugDriver.cpp"
- >
- </File>
- <File
- RelativePath="..\..\tools\bugpoint\bugpoint.cpp"
- >
- </File>
- <File
- RelativePath="..\..\tools\bugpoint\CrashDebugger.cpp"
- >
- </File>
- <File
- RelativePath="..\..\tools\bugpoint\ExecutionDriver.cpp"
- >
- </File>
- <File
- RelativePath="..\..\tools\bugpoint\ExtractFunction.cpp"
- >
- </File>
- <File
- RelativePath="..\..\tools\bugpoint\FindBugs.cpp"
- >
- </File>
- <File
- RelativePath="..\..\tools\bugpoint\Miscompilation.cpp"
- >
- </File>
- <File
- RelativePath="..\..\tools\bugpoint\OptimizerDriver.cpp"
- >
- </File>
- <File
- RelativePath="..\..\tools\bugpoint\TestPasses.cpp"
- >
- </File>
- <File
- RelativePath="..\..\tools\bugpoint\ToolRunner.cpp"
- >
- </File>
- </Filter>
- <Filter
- Name="Header Files"
- Filter="h;hpp;hxx;hm;inl;inc;xsd"
- UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
- >
- <File
- RelativePath="..\..\tools\bugpoint\BugDriver.h"
- >
- </File>
- <File
- RelativePath="..\..\tools\bugpoint\ListReducer.h"
- >
- </File>
- <File
- RelativePath="..\..\tools\bugpoint\ToolRunner.h"
- >
- </File>
- </Filter>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
diff --git a/release_23/win32/clang.sln b/release_23/win32/clang.sln
deleted file mode 100644
index f8c4a505f811..000000000000
--- a/release_23/win32/clang.sln
+++ /dev/null
@@ -1,741 +0,0 @@
-Microsoft Visual Studio Solution File, Format Version 9.00
-# Visual Studio 2005
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "support", "Support\Support.vcproj", "{28AA9146-3482-4F41-9CC6-407B1D258508}"
- ProjectSection(WebsiteProperties) = preProject
- Debug.AspNetCompiler.Debug = "True"
- Release.AspNetCompiler.Debug = "False"
- EndProjectSection
- ProjectSection(ProjectDependencies) = postProject
- {19514E48-456C-4B9D-8637-F2285476461E} = {19514E48-456C-4B9D-8637-F2285476461E}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TableGen", "TableGen\TableGen.vcproj", "{339C2249-26B6-4172-B484-85653029AF57}"
- ProjectSection(WebsiteProperties) = preProject
- Debug.AspNetCompiler.Debug = "True"
- Release.AspNetCompiler.Debug = "False"
- EndProjectSection
- ProjectSection(ProjectDependencies) = postProject
- {28AA9146-3482-4F41-9CC6-407B1D258508} = {28AA9146-3482-4F41-9CC6-407B1D258508}
- {19514E48-456C-4B9D-8637-F2285476461E} = {19514E48-456C-4B9D-8637-F2285476461E}
- {0F8407F3-FA23-4CF1-83A9-DCBE0B361489} = {0F8407F3-FA23-4CF1-83A9-DCBE0B361489}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Fibonacci", "Fibonacci\Fibonacci.vcproj", "{48FB551D-E37E-42EC-BC97-FF7219774867}"
- ProjectSection(WebsiteProperties) = preProject
- Debug.AspNetCompiler.Debug = "True"
- Release.AspNetCompiler.Debug = "False"
- EndProjectSection
- ProjectSection(ProjectDependencies) = postProject
- {0622E827-8464-489D-8B1C-B0B496F35C08} = {0622E827-8464-489D-8B1C-B0B496F35C08}
- {28AA9146-3482-4F41-9CC6-407B1D258508} = {28AA9146-3482-4F41-9CC6-407B1D258508}
- {059FBAB8-C76D-48A0-AA75-3C57BD3EAFE4} = {059FBAB8-C76D-48A0-AA75-3C57BD3EAFE4}
- {08CEB1BB-C2A4-4587-B9A9-AEDB8FB44897} = {08CEB1BB-C2A4-4587-B9A9-AEDB8FB44897}
- {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB} = {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB}
- {76295AE8-A083-460E-9F80-6F2B8923264A} = {76295AE8-A083-460E-9F80-6F2B8923264A}
- {0F8407F3-FA23-4CF1-83A9-DCBE0B361489} = {0F8407F3-FA23-4CF1-83A9-DCBE0B361489}
- {144EEBF6-8C9B-4473-B715-2C821666AF6C} = {144EEBF6-8C9B-4473-B715-2C821666AF6C}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ExecutionEngine", "ExecutionEngine\ExecutionEngine.vcproj", "{76295AE8-A083-460E-9F80-6F2B8923264A}"
- ProjectSection(WebsiteProperties) = preProject
- Debug.AspNetCompiler.Debug = "True"
- Release.AspNetCompiler.Debug = "False"
- EndProjectSection
- ProjectSection(ProjectDependencies) = postProject
- {19514E48-456C-4B9D-8637-F2285476461E} = {19514E48-456C-4B9D-8637-F2285476461E}
- {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB} = {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "VMCore", "VMCore\VMCore.vcproj", "{45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB}"
- ProjectSection(WebsiteProperties) = preProject
- Debug.AspNetCompiler.Debug = "True"
- Release.AspNetCompiler.Debug = "False"
- EndProjectSection
- ProjectSection(ProjectDependencies) = postProject
- {19514E48-456C-4B9D-8637-F2285476461E} = {19514E48-456C-4B9D-8637-F2285476461E}
- {339C2249-26B6-4172-B484-85653029AF57} = {339C2249-26B6-4172-B484-85653029AF57}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Target", "Target\Target.vcproj", "{059FBAB8-C76D-48A0-AA75-3C57BD3EAFE4}"
- ProjectSection(WebsiteProperties) = preProject
- Debug.AspNetCompiler.Debug = "True"
- Release.AspNetCompiler.Debug = "False"
- EndProjectSection
- ProjectSection(ProjectDependencies) = postProject
- {19514E48-456C-4B9D-8637-F2285476461E} = {19514E48-456C-4B9D-8637-F2285476461E}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CodeGen", "CodeGen\CodeGen.vcproj", "{08CEB1BB-C2A4-4587-B9A9-AEDB8FB44897}"
- ProjectSection(WebsiteProperties) = preProject
- Debug.AspNetCompiler.Debug = "True"
- Release.AspNetCompiler.Debug = "False"
- EndProjectSection
- ProjectSection(ProjectDependencies) = postProject
- {19514E48-456C-4B9D-8637-F2285476461E} = {19514E48-456C-4B9D-8637-F2285476461E}
- {339C2249-26B6-4172-B484-85653029AF57} = {339C2249-26B6-4172-B484-85653029AF57}
- {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB} = {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "System", "System\System.vcproj", "{0F8407F3-FA23-4CF1-83A9-DCBE0B361489}"
- ProjectSection(WebsiteProperties) = preProject
- Debug.AspNetCompiler.Debug = "True"
- Release.AspNetCompiler.Debug = "False"
- EndProjectSection
- ProjectSection(ProjectDependencies) = postProject
- {19514E48-456C-4B9D-8637-F2285476461E} = {19514E48-456C-4B9D-8637-F2285476461E}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Analysis", "Analysis\Analysis.vcproj", "{0622E827-8464-489D-8B1C-B0B496F35C08}"
- ProjectSection(WebsiteProperties) = preProject
- Debug.AspNetCompiler.Debug = "True"
- Release.AspNetCompiler.Debug = "False"
- EndProjectSection
- ProjectSection(ProjectDependencies) = postProject
- {19514E48-456C-4B9D-8637-F2285476461E} = {19514E48-456C-4B9D-8637-F2285476461E}
- {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB} = {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "x86", "x86\x86.vcproj", "{144EEBF6-8C9B-4473-B715-2C821666AF6C}"
- ProjectSection(WebsiteProperties) = preProject
- Debug.AspNetCompiler.Debug = "True"
- Release.AspNetCompiler.Debug = "False"
- EndProjectSection
- ProjectSection(ProjectDependencies) = postProject
- {19514E48-456C-4B9D-8637-F2285476461E} = {19514E48-456C-4B9D-8637-F2285476461E}
- {339C2249-26B6-4172-B484-85653029AF57} = {339C2249-26B6-4172-B484-85653029AF57}
- {08CEB1BB-C2A4-4587-B9A9-AEDB8FB44897} = {08CEB1BB-C2A4-4587-B9A9-AEDB8FB44897}
- {C59374C1-9FC0-4147-B836-327DFDC52D99} = {C59374C1-9FC0-4147-B836-327DFDC52D99}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Transforms", "Transforms\Transforms.vcproj", "{C59374C1-9FC0-4147-B836-327DFDC52D99}"
- ProjectSection(WebsiteProperties) = preProject
- Debug.AspNetCompiler.Debug = "True"
- Release.AspNetCompiler.Debug = "False"
- EndProjectSection
- ProjectSection(ProjectDependencies) = postProject
- {19514E48-456C-4B9D-8637-F2285476461E} = {19514E48-456C-4B9D-8637-F2285476461E}
- {339C2249-26B6-4172-B484-85653029AF57} = {339C2249-26B6-4172-B484-85653029AF57}
- {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB} = {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Configure", "Configure\Configure.vcproj", "{19514E48-456C-4B9D-8637-F2285476461E}"
- ProjectSection(WebsiteProperties) = preProject
- Debug.AspNetCompiler.Debug = "True"
- Release.AspNetCompiler.Debug = "False"
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lli", "lli\lli.vcproj", "{FB6FFD68-C1E4-4DCF-AB02-36D205D5263E}"
- ProjectSection(WebsiteProperties) = preProject
- Debug.AspNetCompiler.Debug = "True"
- Release.AspNetCompiler.Debug = "False"
- EndProjectSection
- ProjectSection(ProjectDependencies) = postProject
- {0622E827-8464-489D-8B1C-B0B496F35C08} = {0622E827-8464-489D-8B1C-B0B496F35C08}
- {28AA9146-3482-4F41-9CC6-407B1D258508} = {28AA9146-3482-4F41-9CC6-407B1D258508}
- {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D62} = {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D62}
- {059FBAB8-C76D-48A0-AA75-3C57BD3EAFE4} = {059FBAB8-C76D-48A0-AA75-3C57BD3EAFE4}
- {08CEB1BB-C2A4-4587-B9A9-AEDB8FB44897} = {08CEB1BB-C2A4-4587-B9A9-AEDB8FB44897}
- {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB} = {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB}
- {76295AE8-A083-460E-9F80-6F2B8923264A} = {76295AE8-A083-460E-9F80-6F2B8923264A}
- {0F8407F3-FA23-4CF1-83A9-DCBE0B361489} = {0F8407F3-FA23-4CF1-83A9-DCBE0B361489}
- {144EEBF6-8C9B-4473-B715-2C821666AF6C} = {144EEBF6-8C9B-4473-B715-2C821666AF6C}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "llc", "llc\llc.vcproj", "{ADE86BDC-B04C-43DF-B9BB-90492C7B14AC}"
- ProjectSection(WebsiteProperties) = preProject
- Debug.AspNetCompiler.Debug = "True"
- Release.AspNetCompiler.Debug = "False"
- EndProjectSection
- ProjectSection(ProjectDependencies) = postProject
- {0622E827-8464-489D-8B1C-B0B496F35C08} = {0622E827-8464-489D-8B1C-B0B496F35C08}
- {28AA9146-3482-4F41-9CC6-407B1D258508} = {28AA9146-3482-4F41-9CC6-407B1D258508}
- {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D62} = {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D62}
- {059FBAB8-C76D-48A0-AA75-3C57BD3EAFE4} = {059FBAB8-C76D-48A0-AA75-3C57BD3EAFE4}
- {08CEB1BB-C2A4-4587-B9A9-AEDB8FB44897} = {08CEB1BB-C2A4-4587-B9A9-AEDB8FB44897}
- {057777CD-DED5-46DF-BF9A-6B76DE212549} = {057777CD-DED5-46DF-BF9A-6B76DE212549}
- {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB} = {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB}
- {0F8407F3-FA23-4CF1-83A9-DCBE0B361489} = {0F8407F3-FA23-4CF1-83A9-DCBE0B361489}
- {144EEBF6-8C9B-4473-B715-2C821666AF6C} = {144EEBF6-8C9B-4473-B715-2C821666AF6C}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "llvm-dis", "llvm-dis\llvm-dis.vcproj", "{B13476BC-30AB-4EA0-BC1E-212C0A459405}"
- ProjectSection(WebsiteProperties) = preProject
- Debug.AspNetCompiler.Debug = "True"
- Release.AspNetCompiler.Debug = "False"
- EndProjectSection
- ProjectSection(ProjectDependencies) = postProject
- {28AA9146-3482-4F41-9CC6-407B1D258508} = {28AA9146-3482-4F41-9CC6-407B1D258508}
- {19514E48-456C-4B9D-8637-F2285476461E} = {19514E48-456C-4B9D-8637-F2285476461E}
- {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D62} = {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D62}
- {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB} = {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB}
- {0F8407F3-FA23-4CF1-83A9-DCBE0B361489} = {0F8407F3-FA23-4CF1-83A9-DCBE0B361489}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "llvm-as", "llvm-as\llvm-as.vcproj", "{4FBC40A5-E626-4A6C-A9D3-FAE5C28D30CC}"
- ProjectSection(WebsiteProperties) = preProject
- Debug.AspNetCompiler.Debug = "True"
- Release.AspNetCompiler.Debug = "False"
- EndProjectSection
- ProjectSection(ProjectDependencies) = postProject
- {28AA9146-3482-4F41-9CC6-407B1D258508} = {28AA9146-3482-4F41-9CC6-407B1D258508}
- {19514E48-456C-4B9D-8637-F2285476461E} = {19514E48-456C-4B9D-8637-F2285476461E}
- {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D62} = {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D62}
- {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB} = {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB}
- {0F8407F3-FA23-4CF1-83A9-DCBE0B361489} = {0F8407F3-FA23-4CF1-83A9-DCBE0B361489}
- {3DC216F5-1DDD-478A-84F8-C124E5C31982} = {3DC216F5-1DDD-478A-84F8-C124E5C31982}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AsmParser", "AsmParser\AsmParser.vcproj", "{3DC216F5-1DDD-478A-84F8-C124E5C31982}"
- ProjectSection(WebsiteProperties) = preProject
- Debug.AspNetCompiler.Debug = "True"
- Release.AspNetCompiler.Debug = "False"
- EndProjectSection
- ProjectSection(ProjectDependencies) = postProject
- {19514E48-456C-4B9D-8637-F2285476461E} = {19514E48-456C-4B9D-8637-F2285476461E}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "llvm-ar", "llvm-ar\llvm-ar.vcproj", "{0FF2B75C-49C1-4B49-A44A-531C93000296}"
- ProjectSection(WebsiteProperties) = preProject
- Debug.AspNetCompiler.Debug = "True"
- Release.AspNetCompiler.Debug = "False"
- EndProjectSection
- ProjectSection(ProjectDependencies) = postProject
- {28AA9146-3482-4F41-9CC6-407B1D258508} = {28AA9146-3482-4F41-9CC6-407B1D258508}
- {19514E48-456C-4B9D-8637-F2285476461E} = {19514E48-456C-4B9D-8637-F2285476461E}
- {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D61} = {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D61}
- {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D62} = {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D62}
- {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB} = {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB}
- {0F8407F3-FA23-4CF1-83A9-DCBE0B361489} = {0F8407F3-FA23-4CF1-83A9-DCBE0B361489}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "llvm-ranlib", "llvm-ranlib\llvm-ranlib.vcproj", "{BB16C7EE-B4ED-4714-B5ED-B775C62A6612}"
- ProjectSection(WebsiteProperties) = preProject
- Debug.AspNetCompiler.Debug = "True"
- Release.AspNetCompiler.Debug = "False"
- EndProjectSection
- ProjectSection(ProjectDependencies) = postProject
- {28AA9146-3482-4F41-9CC6-407B1D258508} = {28AA9146-3482-4F41-9CC6-407B1D258508}
- {19514E48-456C-4B9D-8637-F2285476461E} = {19514E48-456C-4B9D-8637-F2285476461E}
- {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D61} = {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D61}
- {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D62} = {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D62}
- {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB} = {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB}
- {0F8407F3-FA23-4CF1-83A9-DCBE0B361489} = {0F8407F3-FA23-4CF1-83A9-DCBE0B361489}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "llvm-link", "llvm-link\llvm-link.vcproj", "{5E249789-49E1-4600-B12B-8AD2BB6439B2}"
- ProjectSection(WebsiteProperties) = preProject
- Debug.AspNetCompiler.Debug = "True"
- Release.AspNetCompiler.Debug = "False"
- EndProjectSection
- ProjectSection(ProjectDependencies) = postProject
- {28AA9146-3482-4F41-9CC6-407B1D258508} = {28AA9146-3482-4F41-9CC6-407B1D258508}
- {19514E48-456C-4B9D-8637-F2285476461E} = {19514E48-456C-4B9D-8637-F2285476461E}
- {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D62} = {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D62}
- {342CF48F-760A-4040-A9A1-7D75AA2471CE} = {342CF48F-760A-4040-A9A1-7D75AA2471CE}
- {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB} = {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB}
- {0F8407F3-FA23-4CF1-83A9-DCBE0B361489} = {0F8407F3-FA23-4CF1-83A9-DCBE0B361489}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Linker", "Linker\Linker.vcproj", "{342CF48F-760A-4040-A9A1-7D75AA2471CE}"
- ProjectSection(WebsiteProperties) = preProject
- Debug.AspNetCompiler.Debug = "True"
- Release.AspNetCompiler.Debug = "False"
- EndProjectSection
- ProjectSection(ProjectDependencies) = postProject
- {28AA9146-3482-4F41-9CC6-407B1D258508} = {28AA9146-3482-4F41-9CC6-407B1D258508}
- {19514E48-456C-4B9D-8637-F2285476461E} = {19514E48-456C-4B9D-8637-F2285476461E}
- {0F8407F3-FA23-4CF1-83A9-DCBE0B361489} = {0F8407F3-FA23-4CF1-83A9-DCBE0B361489}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CBackend", "CBackend\CBackend.vcproj", "{057777CD-DED5-46DF-BF9A-6B76DE212549}"
- ProjectSection(WebsiteProperties) = preProject
- Debug.AspNetCompiler.Debug = "True"
- Release.AspNetCompiler.Debug = "False"
- EndProjectSection
- ProjectSection(ProjectDependencies) = postProject
- {19514E48-456C-4B9D-8637-F2285476461E} = {19514E48-456C-4B9D-8637-F2285476461E}
- {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB} = {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "opt", "opt\opt.vcproj", "{006D8B41-C3C7-4448-85E1-AF8907E591E5}"
- ProjectSection(WebsiteProperties) = preProject
- Debug.AspNetCompiler.Debug = "True"
- Release.AspNetCompiler.Debug = "False"
- EndProjectSection
- ProjectSection(ProjectDependencies) = postProject
- {0622E827-8464-489D-8B1C-B0B496F35C08} = {0622E827-8464-489D-8B1C-B0B496F35C08}
- {28AA9146-3482-4F41-9CC6-407B1D258508} = {28AA9146-3482-4F41-9CC6-407B1D258508}
- {19514E48-456C-4B9D-8637-F2285476461E} = {19514E48-456C-4B9D-8637-F2285476461E}
- {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D62} = {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D62}
- {059FBAB8-C76D-48A0-AA75-3C57BD3EAFE4} = {059FBAB8-C76D-48A0-AA75-3C57BD3EAFE4}
- {C59374C1-9FC0-4147-B836-327DFDC52D99} = {C59374C1-9FC0-4147-B836-327DFDC52D99}
- {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB} = {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB}
- {0F8407F3-FA23-4CF1-83A9-DCBE0B361489} = {0F8407F3-FA23-4CF1-83A9-DCBE0B361489}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "llvm-bcanalyzer", "llvm-bcanalyzer\llvm-bcanalyzer.vcproj", "{E0B1E329-BE3E-456D-B372-5F397BE42C84}"
- ProjectSection(WebsiteProperties) = preProject
- Debug.AspNetCompiler.Debug = "True"
- Release.AspNetCompiler.Debug = "False"
- EndProjectSection
- ProjectSection(ProjectDependencies) = postProject
- {28AA9146-3482-4F41-9CC6-407B1D258508} = {28AA9146-3482-4F41-9CC6-407B1D258508}
- {19514E48-456C-4B9D-8637-F2285476461E} = {19514E48-456C-4B9D-8637-F2285476461E}
- {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB} = {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB}
- {0F8407F3-FA23-4CF1-83A9-DCBE0B361489} = {0F8407F3-FA23-4CF1-83A9-DCBE0B361489}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "llvm-ld", "llvm-ld\llvm-ld.vcproj", "{64D8AA46-88DB-41F4-B837-053AE02406B8}"
- ProjectSection(WebsiteProperties) = preProject
- Debug.AspNetCompiler.Debug = "True"
- Release.AspNetCompiler.Debug = "False"
- EndProjectSection
- ProjectSection(ProjectDependencies) = postProject
- {0622E827-8464-489D-8B1C-B0B496F35C08} = {0622E827-8464-489D-8B1C-B0B496F35C08}
- {28AA9146-3482-4F41-9CC6-407B1D258508} = {28AA9146-3482-4F41-9CC6-407B1D258508}
- {19514E48-456C-4B9D-8637-F2285476461E} = {19514E48-456C-4B9D-8637-F2285476461E}
- {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D61} = {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D61}
- {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D62} = {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D62}
- {342CF48F-760A-4040-A9A1-7D75AA2471CE} = {342CF48F-760A-4040-A9A1-7D75AA2471CE}
- {059FBAB8-C76D-48A0-AA75-3C57BD3EAFE4} = {059FBAB8-C76D-48A0-AA75-3C57BD3EAFE4}
- {C59374C1-9FC0-4147-B836-327DFDC52D99} = {C59374C1-9FC0-4147-B836-327DFDC52D99}
- {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB} = {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB}
- {0F8407F3-FA23-4CF1-83A9-DCBE0B361489} = {0F8407F3-FA23-4CF1-83A9-DCBE0B361489}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "llvm-nm", "llvm-nm\llvm-nm.vcproj", "{5FF862CE-80A0-4B48-A80B-68AE325A0432}"
- ProjectSection(WebsiteProperties) = preProject
- Debug.AspNetCompiler.Debug = "True"
- Release.AspNetCompiler.Debug = "False"
- EndProjectSection
- ProjectSection(ProjectDependencies) = postProject
- {28AA9146-3482-4F41-9CC6-407B1D258508} = {28AA9146-3482-4F41-9CC6-407B1D258508}
- {19514E48-456C-4B9D-8637-F2285476461E} = {19514E48-456C-4B9D-8637-F2285476461E}
- {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D61} = {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D61}
- {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D62} = {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D62}
- {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB} = {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB}
- {0F8407F3-FA23-4CF1-83A9-DCBE0B361489} = {0F8407F3-FA23-4CF1-83A9-DCBE0B361489}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "llvm-prof", "llvm-prof\llvm-prof.vcproj", "{ACBE81D9-64B1-4133-823A-807A4E60B454}"
- ProjectSection(WebsiteProperties) = preProject
- Debug.AspNetCompiler.Debug = "True"
- Release.AspNetCompiler.Debug = "False"
- EndProjectSection
- ProjectSection(ProjectDependencies) = postProject
- {0622E827-8464-489D-8B1C-B0B496F35C08} = {0622E827-8464-489D-8B1C-B0B496F35C08}
- {28AA9146-3482-4F41-9CC6-407B1D258508} = {28AA9146-3482-4F41-9CC6-407B1D258508}
- {19514E48-456C-4B9D-8637-F2285476461E} = {19514E48-456C-4B9D-8637-F2285476461E}
- {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D62} = {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D62}
- {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB} = {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB}
- {0F8407F3-FA23-4CF1-83A9-DCBE0B361489} = {0F8407F3-FA23-4CF1-83A9-DCBE0B361489}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "bugpoint", "bugpoint\bugpoint.vcproj", "{57249192-8E29-4D85-8B7A-FEFF1760B1DA}"
- ProjectSection(WebsiteProperties) = preProject
- Debug.AspNetCompiler.Debug = "True"
- Release.AspNetCompiler.Debug = "False"
- EndProjectSection
- ProjectSection(ProjectDependencies) = postProject
- {0622E827-8464-489D-8B1C-B0B496F35C08} = {0622E827-8464-489D-8B1C-B0B496F35C08}
- {28AA9146-3482-4F41-9CC6-407B1D258508} = {28AA9146-3482-4F41-9CC6-407B1D258508}
- {19514E48-456C-4B9D-8637-F2285476461E} = {19514E48-456C-4B9D-8637-F2285476461E}
- {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D62} = {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D62}
- {342CF48F-760A-4040-A9A1-7D75AA2471CE} = {342CF48F-760A-4040-A9A1-7D75AA2471CE}
- {059FBAB8-C76D-48A0-AA75-3C57BD3EAFE4} = {059FBAB8-C76D-48A0-AA75-3C57BD3EAFE4}
- {C59374C1-9FC0-4147-B836-327DFDC52D99} = {C59374C1-9FC0-4147-B836-327DFDC52D99}
- {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB} = {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB}
- {0F8407F3-FA23-4CF1-83A9-DCBE0B361489} = {0F8407F3-FA23-4CF1-83A9-DCBE0B361489}
- {3DC216F5-1DDD-478A-84F8-C124E5C31982} = {3DC216F5-1DDD-478A-84F8-C124E5C31982}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Bitcode", "Bitcode\Bitcode.vcproj", "{F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D62}"
- ProjectSection(WebsiteProperties) = preProject
- Debug.AspNetCompiler.Debug = "True"
- Release.AspNetCompiler.Debug = "False"
- EndProjectSection
- ProjectSection(ProjectDependencies) = postProject
- {28AA9146-3482-4F41-9CC6-407B1D258508} = {28AA9146-3482-4F41-9CC6-407B1D258508}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Archive", "Archive\Archive.vcproj", "{F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D61}"
- ProjectSection(WebsiteProperties) = preProject
- Debug.AspNetCompiler.Debug = "True"
- Release.AspNetCompiler.Debug = "False"
- EndProjectSection
- ProjectSection(ProjectDependencies) = postProject
- {19514E48-456C-4B9D-8637-F2285476461E} = {19514E48-456C-4B9D-8637-F2285476461E}
- {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB} = {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB}
- EndProjectSection
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "LLVM", "LLVM", "{455BCF47-13B6-451E-8321-8ED9C4866BAA}"
- ProjectSection(WebsiteProperties) = preProject
- Debug.AspNetCompiler.Debug = "True"
- Release.AspNetCompiler.Debug = "False"
- EndProjectSection
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Clang", "Clang", "{DAC2AB11-F09C-454B-86FD-9BDBBA25827F}"
- ProjectSection(WebsiteProperties) = preProject
- Debug.AspNetCompiler.Debug = "True"
- Release.AspNetCompiler.Debug = "False"
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "clangLex", "..\tools\clang\win32\clangLex\clangLex.vcproj", "{030F6909-B2FA-4E53-BEA7-9A559CFC2F73}"
- ProjectSection(WebsiteProperties) = preProject
- Debug.AspNetCompiler.Debug = "True"
- Release.AspNetCompiler.Debug = "False"
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "clangParse", "..\tools\clang\win32\clangParse\clangParse.vcproj", "{05DF3074-11AF-491A-B078-83BD2EDC31F6}"
- ProjectSection(WebsiteProperties) = preProject
- Debug.AspNetCompiler.Debug = "True"
- Release.AspNetCompiler.Debug = "False"
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "clangAST", "..\tools\clang\win32\clangAST\clangAST.vcproj", "{5125C3DB-FBD6-4BF8-8D8B-CE51D6E93BCD}"
- ProjectSection(WebsiteProperties) = preProject
- Debug.AspNetCompiler.Debug = "True"
- Release.AspNetCompiler.Debug = "False"
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "clangSema", "..\tools\clang\win32\clangSema\clangSema.vcproj", "{4727E8B7-AA99-41C9-AB09-A8A862595DB7}"
- ProjectSection(WebsiteProperties) = preProject
- Debug.AspNetCompiler.Debug = "True"
- Release.AspNetCompiler.Debug = "False"
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "clangCodeGen", "..\tools\clang\win32\clangCodeGen\clangCodeGen.vcproj", "{4CEC5897-D957-47E7-A6AE-2021D4F44A8F}"
- ProjectSection(WebsiteProperties) = preProject
- Debug.AspNetCompiler.Debug = "True"
- Release.AspNetCompiler.Debug = "False"
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "clangDriver", "..\tools\clang\win32\clangDriver\clangDriver.vcproj", "{7E7DA455-C276-4B93-8D02-8F7E2F629BAF}"
- ProjectSection(WebsiteProperties) = preProject
- Debug.AspNetCompiler.Debug = "True"
- Release.AspNetCompiler.Debug = "False"
- EndProjectSection
- ProjectSection(ProjectDependencies) = postProject
- {030F6909-B2FA-4E53-BEA7-9A559CFC2F73} = {030F6909-B2FA-4E53-BEA7-9A559CFC2F73}
- {059FBAB8-C76D-48A0-AA75-3C57BD3EAFE4} = {059FBAB8-C76D-48A0-AA75-3C57BD3EAFE4}
- {F9FBDDA2-9EE1-473C-A456-BE20B7B2439D} = {F9FBDDA2-9EE1-473C-A456-BE20B7B2439D}
- {28AA9146-3482-4F41-9CC6-407B1D258508} = {28AA9146-3482-4F41-9CC6-407B1D258508}
- {05DF3074-11AF-491A-B078-83BD2EDC31F6} = {05DF3074-11AF-491A-B078-83BD2EDC31F6}
- {298B4876-6EF1-4E80-85D7-72F80693BBEB} = {298B4876-6EF1-4E80-85D7-72F80693BBEB}
- {4CEC5897-D957-47E7-A6AE-2021D4F44A8F} = {4CEC5897-D957-47E7-A6AE-2021D4F44A8F}
- {4727E8B7-AA99-41C9-AB09-A8A862595DB7} = {4727E8B7-AA99-41C9-AB09-A8A862595DB7}
- {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB} = {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB}
- {5125C3DB-FBD6-4BF8-8D8B-CE51D6E93BCD} = {5125C3DB-FBD6-4BF8-8D8B-CE51D6E93BCD}
- {0F8407F3-FA23-4CF1-83A9-DCBE0B361489} = {0F8407F3-FA23-4CF1-83A9-DCBE0B361489}
- {6C98551A-4C36-4E74-8419-4D3EEEC9D8E0} = {6C98551A-4C36-4E74-8419-4D3EEEC9D8E0}
- {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D62} = {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D62}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "clangBasic", "..\tools\clang\win32\clangBasic\clangBasic.vcproj", "{298B4876-6EF1-4E80-85D7-72F80693BBEB}"
- ProjectSection(WebsiteProperties) = preProject
- Debug.AspNetCompiler.Debug = "True"
- Release.AspNetCompiler.Debug = "False"
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "clangAnalysis", "..\tools\clang\win32\clangAnalysis\clangAnalysis.vcproj", "{6C98551A-4C36-4E74-8419-4D3EEEC9D8E0}"
- ProjectSection(WebsiteProperties) = preProject
- Debug.AspNetCompiler.Debug = "True"
- Release.AspNetCompiler.Debug = "False"
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "clangRewrite", "..\tools\clang\win32\clangRewrite\clangRewrite.vcproj", "{F9FBDDA2-9EE1-473C-A456-BE20B7B2439D}"
- ProjectSection(WebsiteProperties) = preProject
- Debug.AspNetCompiler.Debug = "True"
- Release.AspNetCompiler.Debug = "False"
- EndProjectSection
-EndProject
-Global
- GlobalSection(DPCodeReviewSolutionGUID) = preSolution
- DPCodeReviewSolutionGUID = {00000000-0000-0000-0000-000000000000}
- EndGlobalSection
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Configure|Win32 = Configure|Win32
- Debug|Win32 = Debug|Win32
- Release|Win32 = Release|Win32
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {28AA9146-3482-4F41-9CC6-407B1D258508}.Configure|Win32.ActiveCfg = Release|Win32
- {28AA9146-3482-4F41-9CC6-407B1D258508}.Configure|Win32.Build.0 = Release|Win32
- {28AA9146-3482-4F41-9CC6-407B1D258508}.Debug|Win32.ActiveCfg = Debug|Win32
- {28AA9146-3482-4F41-9CC6-407B1D258508}.Debug|Win32.Build.0 = Debug|Win32
- {28AA9146-3482-4F41-9CC6-407B1D258508}.Release|Win32.ActiveCfg = Release|Win32
- {28AA9146-3482-4F41-9CC6-407B1D258508}.Release|Win32.Build.0 = Release|Win32
- {339C2249-26B6-4172-B484-85653029AF57}.Configure|Win32.ActiveCfg = Release|Win32
- {339C2249-26B6-4172-B484-85653029AF57}.Configure|Win32.Build.0 = Release|Win32
- {339C2249-26B6-4172-B484-85653029AF57}.Debug|Win32.ActiveCfg = Debug|Win32
- {339C2249-26B6-4172-B484-85653029AF57}.Debug|Win32.Build.0 = Debug|Win32
- {339C2249-26B6-4172-B484-85653029AF57}.Release|Win32.ActiveCfg = Release|Win32
- {339C2249-26B6-4172-B484-85653029AF57}.Release|Win32.Build.0 = Release|Win32
- {48FB551D-E37E-42EC-BC97-FF7219774867}.Configure|Win32.ActiveCfg = Release|Win32
- {48FB551D-E37E-42EC-BC97-FF7219774867}.Configure|Win32.Build.0 = Release|Win32
- {48FB551D-E37E-42EC-BC97-FF7219774867}.Debug|Win32.ActiveCfg = Debug|Win32
- {48FB551D-E37E-42EC-BC97-FF7219774867}.Debug|Win32.Build.0 = Debug|Win32
- {48FB551D-E37E-42EC-BC97-FF7219774867}.Release|Win32.ActiveCfg = Release|Win32
- {48FB551D-E37E-42EC-BC97-FF7219774867}.Release|Win32.Build.0 = Release|Win32
- {76295AE8-A083-460E-9F80-6F2B8923264A}.Configure|Win32.ActiveCfg = Release|Win32
- {76295AE8-A083-460E-9F80-6F2B8923264A}.Configure|Win32.Build.0 = Release|Win32
- {76295AE8-A083-460E-9F80-6F2B8923264A}.Debug|Win32.ActiveCfg = Debug|Win32
- {76295AE8-A083-460E-9F80-6F2B8923264A}.Debug|Win32.Build.0 = Debug|Win32
- {76295AE8-A083-460E-9F80-6F2B8923264A}.Release|Win32.ActiveCfg = Release|Win32
- {76295AE8-A083-460E-9F80-6F2B8923264A}.Release|Win32.Build.0 = Release|Win32
- {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB}.Configure|Win32.ActiveCfg = Release|Win32
- {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB}.Configure|Win32.Build.0 = Release|Win32
- {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB}.Debug|Win32.ActiveCfg = Debug|Win32
- {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB}.Debug|Win32.Build.0 = Debug|Win32
- {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB}.Release|Win32.ActiveCfg = Release|Win32
- {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB}.Release|Win32.Build.0 = Release|Win32
- {059FBAB8-C76D-48A0-AA75-3C57BD3EAFE4}.Configure|Win32.ActiveCfg = Release|Win32
- {059FBAB8-C76D-48A0-AA75-3C57BD3EAFE4}.Configure|Win32.Build.0 = Release|Win32
- {059FBAB8-C76D-48A0-AA75-3C57BD3EAFE4}.Debug|Win32.ActiveCfg = Debug|Win32
- {059FBAB8-C76D-48A0-AA75-3C57BD3EAFE4}.Debug|Win32.Build.0 = Debug|Win32
- {059FBAB8-C76D-48A0-AA75-3C57BD3EAFE4}.Release|Win32.ActiveCfg = Release|Win32
- {059FBAB8-C76D-48A0-AA75-3C57BD3EAFE4}.Release|Win32.Build.0 = Release|Win32
- {08CEB1BB-C2A4-4587-B9A9-AEDB8FB44897}.Configure|Win32.ActiveCfg = Release|Win32
- {08CEB1BB-C2A4-4587-B9A9-AEDB8FB44897}.Configure|Win32.Build.0 = Release|Win32
- {08CEB1BB-C2A4-4587-B9A9-AEDB8FB44897}.Debug|Win32.ActiveCfg = Debug|Win32
- {08CEB1BB-C2A4-4587-B9A9-AEDB8FB44897}.Debug|Win32.Build.0 = Debug|Win32
- {08CEB1BB-C2A4-4587-B9A9-AEDB8FB44897}.Release|Win32.ActiveCfg = Release|Win32
- {08CEB1BB-C2A4-4587-B9A9-AEDB8FB44897}.Release|Win32.Build.0 = Release|Win32
- {0F8407F3-FA23-4CF1-83A9-DCBE0B361489}.Configure|Win32.ActiveCfg = Release|Win32
- {0F8407F3-FA23-4CF1-83A9-DCBE0B361489}.Configure|Win32.Build.0 = Release|Win32
- {0F8407F3-FA23-4CF1-83A9-DCBE0B361489}.Debug|Win32.ActiveCfg = Debug|Win32
- {0F8407F3-FA23-4CF1-83A9-DCBE0B361489}.Debug|Win32.Build.0 = Debug|Win32
- {0F8407F3-FA23-4CF1-83A9-DCBE0B361489}.Release|Win32.ActiveCfg = Release|Win32
- {0F8407F3-FA23-4CF1-83A9-DCBE0B361489}.Release|Win32.Build.0 = Release|Win32
- {0622E827-8464-489D-8B1C-B0B496F35C08}.Configure|Win32.ActiveCfg = Release|Win32
- {0622E827-8464-489D-8B1C-B0B496F35C08}.Configure|Win32.Build.0 = Release|Win32
- {0622E827-8464-489D-8B1C-B0B496F35C08}.Debug|Win32.ActiveCfg = Debug|Win32
- {0622E827-8464-489D-8B1C-B0B496F35C08}.Debug|Win32.Build.0 = Debug|Win32
- {0622E827-8464-489D-8B1C-B0B496F35C08}.Release|Win32.ActiveCfg = Release|Win32
- {0622E827-8464-489D-8B1C-B0B496F35C08}.Release|Win32.Build.0 = Release|Win32
- {144EEBF6-8C9B-4473-B715-2C821666AF6C}.Configure|Win32.ActiveCfg = Release|Win32
- {144EEBF6-8C9B-4473-B715-2C821666AF6C}.Configure|Win32.Build.0 = Release|Win32
- {144EEBF6-8C9B-4473-B715-2C821666AF6C}.Debug|Win32.ActiveCfg = Debug|Win32
- {144EEBF6-8C9B-4473-B715-2C821666AF6C}.Debug|Win32.Build.0 = Debug|Win32
- {144EEBF6-8C9B-4473-B715-2C821666AF6C}.Release|Win32.ActiveCfg = Release|Win32
- {144EEBF6-8C9B-4473-B715-2C821666AF6C}.Release|Win32.Build.0 = Release|Win32
- {C59374C1-9FC0-4147-B836-327DFDC52D99}.Configure|Win32.ActiveCfg = Release|Win32
- {C59374C1-9FC0-4147-B836-327DFDC52D99}.Configure|Win32.Build.0 = Release|Win32
- {C59374C1-9FC0-4147-B836-327DFDC52D99}.Debug|Win32.ActiveCfg = Debug|Win32
- {C59374C1-9FC0-4147-B836-327DFDC52D99}.Debug|Win32.Build.0 = Debug|Win32
- {C59374C1-9FC0-4147-B836-327DFDC52D99}.Release|Win32.ActiveCfg = Release|Win32
- {C59374C1-9FC0-4147-B836-327DFDC52D99}.Release|Win32.Build.0 = Release|Win32
- {19514E48-456C-4B9D-8637-F2285476461E}.Configure|Win32.ActiveCfg = Configure|Win32
- {19514E48-456C-4B9D-8637-F2285476461E}.Configure|Win32.Build.0 = Configure|Win32
- {19514E48-456C-4B9D-8637-F2285476461E}.Debug|Win32.ActiveCfg = Configure|Win32
- {19514E48-456C-4B9D-8637-F2285476461E}.Debug|Win32.Build.0 = Configure|Win32
- {19514E48-456C-4B9D-8637-F2285476461E}.Release|Win32.ActiveCfg = Configure|Win32
- {19514E48-456C-4B9D-8637-F2285476461E}.Release|Win32.Build.0 = Configure|Win32
- {FB6FFD68-C1E4-4DCF-AB02-36D205D5263E}.Configure|Win32.ActiveCfg = Release|Win32
- {FB6FFD68-C1E4-4DCF-AB02-36D205D5263E}.Configure|Win32.Build.0 = Release|Win32
- {FB6FFD68-C1E4-4DCF-AB02-36D205D5263E}.Debug|Win32.ActiveCfg = Debug|Win32
- {FB6FFD68-C1E4-4DCF-AB02-36D205D5263E}.Debug|Win32.Build.0 = Debug|Win32
- {FB6FFD68-C1E4-4DCF-AB02-36D205D5263E}.Release|Win32.ActiveCfg = Release|Win32
- {FB6FFD68-C1E4-4DCF-AB02-36D205D5263E}.Release|Win32.Build.0 = Release|Win32
- {ADE86BDC-B04C-43DF-B9BB-90492C7B14AC}.Configure|Win32.ActiveCfg = Release|Win32
- {ADE86BDC-B04C-43DF-B9BB-90492C7B14AC}.Configure|Win32.Build.0 = Release|Win32
- {ADE86BDC-B04C-43DF-B9BB-90492C7B14AC}.Debug|Win32.ActiveCfg = Debug|Win32
- {ADE86BDC-B04C-43DF-B9BB-90492C7B14AC}.Debug|Win32.Build.0 = Debug|Win32
- {ADE86BDC-B04C-43DF-B9BB-90492C7B14AC}.Release|Win32.ActiveCfg = Release|Win32
- {ADE86BDC-B04C-43DF-B9BB-90492C7B14AC}.Release|Win32.Build.0 = Release|Win32
- {B13476BC-30AB-4EA0-BC1E-212C0A459405}.Configure|Win32.ActiveCfg = Release|Win32
- {B13476BC-30AB-4EA0-BC1E-212C0A459405}.Configure|Win32.Build.0 = Release|Win32
- {B13476BC-30AB-4EA0-BC1E-212C0A459405}.Debug|Win32.ActiveCfg = Debug|Win32
- {B13476BC-30AB-4EA0-BC1E-212C0A459405}.Debug|Win32.Build.0 = Debug|Win32
- {B13476BC-30AB-4EA0-BC1E-212C0A459405}.Release|Win32.ActiveCfg = Release|Win32
- {B13476BC-30AB-4EA0-BC1E-212C0A459405}.Release|Win32.Build.0 = Release|Win32
- {4FBC40A5-E626-4A6C-A9D3-FAE5C28D30CC}.Configure|Win32.ActiveCfg = Release|Win32
- {4FBC40A5-E626-4A6C-A9D3-FAE5C28D30CC}.Configure|Win32.Build.0 = Release|Win32
- {4FBC40A5-E626-4A6C-A9D3-FAE5C28D30CC}.Debug|Win32.ActiveCfg = Debug|Win32
- {4FBC40A5-E626-4A6C-A9D3-FAE5C28D30CC}.Debug|Win32.Build.0 = Debug|Win32
- {4FBC40A5-E626-4A6C-A9D3-FAE5C28D30CC}.Release|Win32.ActiveCfg = Release|Win32
- {4FBC40A5-E626-4A6C-A9D3-FAE5C28D30CC}.Release|Win32.Build.0 = Release|Win32
- {3DC216F5-1DDD-478A-84F8-C124E5C31982}.Configure|Win32.ActiveCfg = Release|Win32
- {3DC216F5-1DDD-478A-84F8-C124E5C31982}.Configure|Win32.Build.0 = Release|Win32
- {3DC216F5-1DDD-478A-84F8-C124E5C31982}.Debug|Win32.ActiveCfg = Debug|Win32
- {3DC216F5-1DDD-478A-84F8-C124E5C31982}.Debug|Win32.Build.0 = Debug|Win32
- {3DC216F5-1DDD-478A-84F8-C124E5C31982}.Release|Win32.ActiveCfg = Release|Win32
- {3DC216F5-1DDD-478A-84F8-C124E5C31982}.Release|Win32.Build.0 = Release|Win32
- {0FF2B75C-49C1-4B49-A44A-531C93000296}.Configure|Win32.ActiveCfg = Release|Win32
- {0FF2B75C-49C1-4B49-A44A-531C93000296}.Configure|Win32.Build.0 = Release|Win32
- {0FF2B75C-49C1-4B49-A44A-531C93000296}.Debug|Win32.ActiveCfg = Debug|Win32
- {0FF2B75C-49C1-4B49-A44A-531C93000296}.Debug|Win32.Build.0 = Debug|Win32
- {0FF2B75C-49C1-4B49-A44A-531C93000296}.Release|Win32.ActiveCfg = Release|Win32
- {0FF2B75C-49C1-4B49-A44A-531C93000296}.Release|Win32.Build.0 = Release|Win32
- {BB16C7EE-B4ED-4714-B5ED-B775C62A6612}.Configure|Win32.ActiveCfg = Release|Win32
- {BB16C7EE-B4ED-4714-B5ED-B775C62A6612}.Configure|Win32.Build.0 = Release|Win32
- {BB16C7EE-B4ED-4714-B5ED-B775C62A6612}.Debug|Win32.ActiveCfg = Debug|Win32
- {BB16C7EE-B4ED-4714-B5ED-B775C62A6612}.Debug|Win32.Build.0 = Debug|Win32
- {BB16C7EE-B4ED-4714-B5ED-B775C62A6612}.Release|Win32.ActiveCfg = Release|Win32
- {BB16C7EE-B4ED-4714-B5ED-B775C62A6612}.Release|Win32.Build.0 = Release|Win32
- {5E249789-49E1-4600-B12B-8AD2BB6439B2}.Configure|Win32.ActiveCfg = Release|Win32
- {5E249789-49E1-4600-B12B-8AD2BB6439B2}.Configure|Win32.Build.0 = Release|Win32
- {5E249789-49E1-4600-B12B-8AD2BB6439B2}.Debug|Win32.ActiveCfg = Debug|Win32
- {5E249789-49E1-4600-B12B-8AD2BB6439B2}.Debug|Win32.Build.0 = Debug|Win32
- {5E249789-49E1-4600-B12B-8AD2BB6439B2}.Release|Win32.ActiveCfg = Release|Win32
- {5E249789-49E1-4600-B12B-8AD2BB6439B2}.Release|Win32.Build.0 = Release|Win32
- {342CF48F-760A-4040-A9A1-7D75AA2471CE}.Configure|Win32.ActiveCfg = Release|Win32
- {342CF48F-760A-4040-A9A1-7D75AA2471CE}.Configure|Win32.Build.0 = Release|Win32
- {342CF48F-760A-4040-A9A1-7D75AA2471CE}.Debug|Win32.ActiveCfg = Debug|Win32
- {342CF48F-760A-4040-A9A1-7D75AA2471CE}.Debug|Win32.Build.0 = Debug|Win32
- {342CF48F-760A-4040-A9A1-7D75AA2471CE}.Release|Win32.ActiveCfg = Release|Win32
- {342CF48F-760A-4040-A9A1-7D75AA2471CE}.Release|Win32.Build.0 = Release|Win32
- {057777CD-DED5-46DF-BF9A-6B76DE212549}.Configure|Win32.ActiveCfg = Release|Win32
- {057777CD-DED5-46DF-BF9A-6B76DE212549}.Configure|Win32.Build.0 = Release|Win32
- {057777CD-DED5-46DF-BF9A-6B76DE212549}.Debug|Win32.ActiveCfg = Debug|Win32
- {057777CD-DED5-46DF-BF9A-6B76DE212549}.Debug|Win32.Build.0 = Debug|Win32
- {057777CD-DED5-46DF-BF9A-6B76DE212549}.Release|Win32.ActiveCfg = Release|Win32
- {057777CD-DED5-46DF-BF9A-6B76DE212549}.Release|Win32.Build.0 = Release|Win32
- {006D8B41-C3C7-4448-85E1-AF8907E591E5}.Configure|Win32.ActiveCfg = Release|Win32
- {006D8B41-C3C7-4448-85E1-AF8907E591E5}.Configure|Win32.Build.0 = Release|Win32
- {006D8B41-C3C7-4448-85E1-AF8907E591E5}.Debug|Win32.ActiveCfg = Debug|Win32
- {006D8B41-C3C7-4448-85E1-AF8907E591E5}.Debug|Win32.Build.0 = Debug|Win32
- {006D8B41-C3C7-4448-85E1-AF8907E591E5}.Release|Win32.ActiveCfg = Release|Win32
- {006D8B41-C3C7-4448-85E1-AF8907E591E5}.Release|Win32.Build.0 = Release|Win32
- {E0B1E329-BE3E-456D-B372-5F397BE42C84}.Configure|Win32.ActiveCfg = Release|Win32
- {E0B1E329-BE3E-456D-B372-5F397BE42C84}.Configure|Win32.Build.0 = Release|Win32
- {E0B1E329-BE3E-456D-B372-5F397BE42C84}.Debug|Win32.ActiveCfg = Debug|Win32
- {E0B1E329-BE3E-456D-B372-5F397BE42C84}.Debug|Win32.Build.0 = Debug|Win32
- {E0B1E329-BE3E-456D-B372-5F397BE42C84}.Release|Win32.ActiveCfg = Release|Win32
- {E0B1E329-BE3E-456D-B372-5F397BE42C84}.Release|Win32.Build.0 = Release|Win32
- {64D8AA46-88DB-41F4-B837-053AE02406B8}.Configure|Win32.ActiveCfg = Release|Win32
- {64D8AA46-88DB-41F4-B837-053AE02406B8}.Configure|Win32.Build.0 = Release|Win32
- {64D8AA46-88DB-41F4-B837-053AE02406B8}.Debug|Win32.ActiveCfg = Debug|Win32
- {64D8AA46-88DB-41F4-B837-053AE02406B8}.Debug|Win32.Build.0 = Debug|Win32
- {64D8AA46-88DB-41F4-B837-053AE02406B8}.Release|Win32.ActiveCfg = Release|Win32
- {64D8AA46-88DB-41F4-B837-053AE02406B8}.Release|Win32.Build.0 = Release|Win32
- {5FF862CE-80A0-4B48-A80B-68AE325A0432}.Configure|Win32.ActiveCfg = Release|Win32
- {5FF862CE-80A0-4B48-A80B-68AE325A0432}.Configure|Win32.Build.0 = Release|Win32
- {5FF862CE-80A0-4B48-A80B-68AE325A0432}.Debug|Win32.ActiveCfg = Debug|Win32
- {5FF862CE-80A0-4B48-A80B-68AE325A0432}.Debug|Win32.Build.0 = Debug|Win32
- {5FF862CE-80A0-4B48-A80B-68AE325A0432}.Release|Win32.ActiveCfg = Release|Win32
- {5FF862CE-80A0-4B48-A80B-68AE325A0432}.Release|Win32.Build.0 = Release|Win32
- {ACBE81D9-64B1-4133-823A-807A4E60B454}.Configure|Win32.ActiveCfg = Release|Win32
- {ACBE81D9-64B1-4133-823A-807A4E60B454}.Configure|Win32.Build.0 = Release|Win32
- {ACBE81D9-64B1-4133-823A-807A4E60B454}.Debug|Win32.ActiveCfg = Debug|Win32
- {ACBE81D9-64B1-4133-823A-807A4E60B454}.Debug|Win32.Build.0 = Debug|Win32
- {ACBE81D9-64B1-4133-823A-807A4E60B454}.Release|Win32.ActiveCfg = Release|Win32
- {ACBE81D9-64B1-4133-823A-807A4E60B454}.Release|Win32.Build.0 = Release|Win32
- {57249192-8E29-4D85-8B7A-FEFF1760B1DA}.Configure|Win32.ActiveCfg = Release|Win32
- {57249192-8E29-4D85-8B7A-FEFF1760B1DA}.Configure|Win32.Build.0 = Release|Win32
- {57249192-8E29-4D85-8B7A-FEFF1760B1DA}.Debug|Win32.ActiveCfg = Debug|Win32
- {57249192-8E29-4D85-8B7A-FEFF1760B1DA}.Debug|Win32.Build.0 = Debug|Win32
- {57249192-8E29-4D85-8B7A-FEFF1760B1DA}.Release|Win32.ActiveCfg = Release|Win32
- {57249192-8E29-4D85-8B7A-FEFF1760B1DA}.Release|Win32.Build.0 = Release|Win32
- {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D62}.Configure|Win32.ActiveCfg = Release|Win32
- {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D62}.Configure|Win32.Build.0 = Release|Win32
- {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D62}.Debug|Win32.ActiveCfg = Debug|Win32
- {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D62}.Debug|Win32.Build.0 = Debug|Win32
- {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D62}.Release|Win32.ActiveCfg = Release|Win32
- {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D62}.Release|Win32.Build.0 = Release|Win32
- {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D61}.Configure|Win32.ActiveCfg = Release|Win32
- {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D61}.Configure|Win32.Build.0 = Release|Win32
- {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D61}.Debug|Win32.ActiveCfg = Debug|Win32
- {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D61}.Debug|Win32.Build.0 = Debug|Win32
- {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D61}.Release|Win32.ActiveCfg = Release|Win32
- {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D61}.Release|Win32.Build.0 = Release|Win32
- {030F6909-B2FA-4E53-BEA7-9A559CFC2F73}.Configure|Win32.ActiveCfg = Release|Win32
- {030F6909-B2FA-4E53-BEA7-9A559CFC2F73}.Configure|Win32.Build.0 = Release|Win32
- {030F6909-B2FA-4E53-BEA7-9A559CFC2F73}.Debug|Win32.ActiveCfg = Debug|Win32
- {030F6909-B2FA-4E53-BEA7-9A559CFC2F73}.Debug|Win32.Build.0 = Debug|Win32
- {030F6909-B2FA-4E53-BEA7-9A559CFC2F73}.Release|Win32.ActiveCfg = Release|Win32
- {030F6909-B2FA-4E53-BEA7-9A559CFC2F73}.Release|Win32.Build.0 = Release|Win32
- {05DF3074-11AF-491A-B078-83BD2EDC31F6}.Configure|Win32.ActiveCfg = Release|Win32
- {05DF3074-11AF-491A-B078-83BD2EDC31F6}.Configure|Win32.Build.0 = Release|Win32
- {05DF3074-11AF-491A-B078-83BD2EDC31F6}.Debug|Win32.ActiveCfg = Debug|Win32
- {05DF3074-11AF-491A-B078-83BD2EDC31F6}.Debug|Win32.Build.0 = Debug|Win32
- {05DF3074-11AF-491A-B078-83BD2EDC31F6}.Release|Win32.ActiveCfg = Release|Win32
- {05DF3074-11AF-491A-B078-83BD2EDC31F6}.Release|Win32.Build.0 = Release|Win32
- {5125C3DB-FBD6-4BF8-8D8B-CE51D6E93BCD}.Configure|Win32.ActiveCfg = Release|Win32
- {5125C3DB-FBD6-4BF8-8D8B-CE51D6E93BCD}.Configure|Win32.Build.0 = Release|Win32
- {5125C3DB-FBD6-4BF8-8D8B-CE51D6E93BCD}.Debug|Win32.ActiveCfg = Debug|Win32
- {5125C3DB-FBD6-4BF8-8D8B-CE51D6E93BCD}.Debug|Win32.Build.0 = Debug|Win32
- {5125C3DB-FBD6-4BF8-8D8B-CE51D6E93BCD}.Release|Win32.ActiveCfg = Release|Win32
- {5125C3DB-FBD6-4BF8-8D8B-CE51D6E93BCD}.Release|Win32.Build.0 = Release|Win32
- {4727E8B7-AA99-41C9-AB09-A8A862595DB7}.Configure|Win32.ActiveCfg = Release|Win32
- {4727E8B7-AA99-41C9-AB09-A8A862595DB7}.Configure|Win32.Build.0 = Release|Win32
- {4727E8B7-AA99-41C9-AB09-A8A862595DB7}.Debug|Win32.ActiveCfg = Debug|Win32
- {4727E8B7-AA99-41C9-AB09-A8A862595DB7}.Debug|Win32.Build.0 = Debug|Win32
- {4727E8B7-AA99-41C9-AB09-A8A862595DB7}.Release|Win32.ActiveCfg = Release|Win32
- {4727E8B7-AA99-41C9-AB09-A8A862595DB7}.Release|Win32.Build.0 = Release|Win32
- {4CEC5897-D957-47E7-A6AE-2021D4F44A8F}.Configure|Win32.ActiveCfg = Release|Win32
- {4CEC5897-D957-47E7-A6AE-2021D4F44A8F}.Configure|Win32.Build.0 = Release|Win32
- {4CEC5897-D957-47E7-A6AE-2021D4F44A8F}.Debug|Win32.ActiveCfg = Debug|Win32
- {4CEC5897-D957-47E7-A6AE-2021D4F44A8F}.Debug|Win32.Build.0 = Debug|Win32
- {4CEC5897-D957-47E7-A6AE-2021D4F44A8F}.Release|Win32.ActiveCfg = Release|Win32
- {4CEC5897-D957-47E7-A6AE-2021D4F44A8F}.Release|Win32.Build.0 = Release|Win32
- {7E7DA455-C276-4B93-8D02-8F7E2F629BAF}.Configure|Win32.ActiveCfg = Release|Win32
- {7E7DA455-C276-4B93-8D02-8F7E2F629BAF}.Configure|Win32.Build.0 = Release|Win32
- {7E7DA455-C276-4B93-8D02-8F7E2F629BAF}.Debug|Win32.ActiveCfg = Debug|Win32
- {7E7DA455-C276-4B93-8D02-8F7E2F629BAF}.Debug|Win32.Build.0 = Debug|Win32
- {7E7DA455-C276-4B93-8D02-8F7E2F629BAF}.Release|Win32.ActiveCfg = Release|Win32
- {7E7DA455-C276-4B93-8D02-8F7E2F629BAF}.Release|Win32.Build.0 = Release|Win32
- {298B4876-6EF1-4E80-85D7-72F80693BBEB}.Configure|Win32.ActiveCfg = Release|Win32
- {298B4876-6EF1-4E80-85D7-72F80693BBEB}.Configure|Win32.Build.0 = Release|Win32
- {298B4876-6EF1-4E80-85D7-72F80693BBEB}.Debug|Win32.ActiveCfg = Debug|Win32
- {298B4876-6EF1-4E80-85D7-72F80693BBEB}.Debug|Win32.Build.0 = Debug|Win32
- {298B4876-6EF1-4E80-85D7-72F80693BBEB}.Release|Win32.ActiveCfg = Release|Win32
- {298B4876-6EF1-4E80-85D7-72F80693BBEB}.Release|Win32.Build.0 = Release|Win32
- {6C98551A-4C36-4E74-8419-4D3EEEC9D8E0}.Configure|Win32.ActiveCfg = Release|Win32
- {6C98551A-4C36-4E74-8419-4D3EEEC9D8E0}.Configure|Win32.Build.0 = Release|Win32
- {6C98551A-4C36-4E74-8419-4D3EEEC9D8E0}.Debug|Win32.ActiveCfg = Debug|Win32
- {6C98551A-4C36-4E74-8419-4D3EEEC9D8E0}.Debug|Win32.Build.0 = Debug|Win32
- {6C98551A-4C36-4E74-8419-4D3EEEC9D8E0}.Release|Win32.ActiveCfg = Release|Win32
- {6C98551A-4C36-4E74-8419-4D3EEEC9D8E0}.Release|Win32.Build.0 = Release|Win32
- {F9FBDDA2-9EE1-473C-A456-BE20B7B2439D}.Configure|Win32.ActiveCfg = Release|Win32
- {F9FBDDA2-9EE1-473C-A456-BE20B7B2439D}.Configure|Win32.Build.0 = Release|Win32
- {F9FBDDA2-9EE1-473C-A456-BE20B7B2439D}.Debug|Win32.ActiveCfg = Debug|Win32
- {F9FBDDA2-9EE1-473C-A456-BE20B7B2439D}.Debug|Win32.Build.0 = Debug|Win32
- {F9FBDDA2-9EE1-473C-A456-BE20B7B2439D}.Release|Win32.ActiveCfg = Release|Win32
- {F9FBDDA2-9EE1-473C-A456-BE20B7B2439D}.Release|Win32.Build.0 = Release|Win32
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
- GlobalSection(NestedProjects) = preSolution
- {339C2249-26B6-4172-B484-85653029AF57} = {455BCF47-13B6-451E-8321-8ED9C4866BAA}
- {48FB551D-E37E-42EC-BC97-FF7219774867} = {455BCF47-13B6-451E-8321-8ED9C4866BAA}
- {76295AE8-A083-460E-9F80-6F2B8923264A} = {455BCF47-13B6-451E-8321-8ED9C4866BAA}
- {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB} = {455BCF47-13B6-451E-8321-8ED9C4866BAA}
- {059FBAB8-C76D-48A0-AA75-3C57BD3EAFE4} = {455BCF47-13B6-451E-8321-8ED9C4866BAA}
- {08CEB1BB-C2A4-4587-B9A9-AEDB8FB44897} = {455BCF47-13B6-451E-8321-8ED9C4866BAA}
- {0F8407F3-FA23-4CF1-83A9-DCBE0B361489} = {455BCF47-13B6-451E-8321-8ED9C4866BAA}
- {0622E827-8464-489D-8B1C-B0B496F35C08} = {455BCF47-13B6-451E-8321-8ED9C4866BAA}
- {144EEBF6-8C9B-4473-B715-2C821666AF6C} = {455BCF47-13B6-451E-8321-8ED9C4866BAA}
- {C59374C1-9FC0-4147-B836-327DFDC52D99} = {455BCF47-13B6-451E-8321-8ED9C4866BAA}
- {19514E48-456C-4B9D-8637-F2285476461E} = {455BCF47-13B6-451E-8321-8ED9C4866BAA}
- {FB6FFD68-C1E4-4DCF-AB02-36D205D5263E} = {455BCF47-13B6-451E-8321-8ED9C4866BAA}
- {ADE86BDC-B04C-43DF-B9BB-90492C7B14AC} = {455BCF47-13B6-451E-8321-8ED9C4866BAA}
- {B13476BC-30AB-4EA0-BC1E-212C0A459405} = {455BCF47-13B6-451E-8321-8ED9C4866BAA}
- {4FBC40A5-E626-4A6C-A9D3-FAE5C28D30CC} = {455BCF47-13B6-451E-8321-8ED9C4866BAA}
- {3DC216F5-1DDD-478A-84F8-C124E5C31982} = {455BCF47-13B6-451E-8321-8ED9C4866BAA}
- {0FF2B75C-49C1-4B49-A44A-531C93000296} = {455BCF47-13B6-451E-8321-8ED9C4866BAA}
- {BB16C7EE-B4ED-4714-B5ED-B775C62A6612} = {455BCF47-13B6-451E-8321-8ED9C4866BAA}
- {5E249789-49E1-4600-B12B-8AD2BB6439B2} = {455BCF47-13B6-451E-8321-8ED9C4866BAA}
- {342CF48F-760A-4040-A9A1-7D75AA2471CE} = {455BCF47-13B6-451E-8321-8ED9C4866BAA}
- {057777CD-DED5-46DF-BF9A-6B76DE212549} = {455BCF47-13B6-451E-8321-8ED9C4866BAA}
- {006D8B41-C3C7-4448-85E1-AF8907E591E5} = {455BCF47-13B6-451E-8321-8ED9C4866BAA}
- {E0B1E329-BE3E-456D-B372-5F397BE42C84} = {455BCF47-13B6-451E-8321-8ED9C4866BAA}
- {64D8AA46-88DB-41F4-B837-053AE02406B8} = {455BCF47-13B6-451E-8321-8ED9C4866BAA}
- {5FF862CE-80A0-4B48-A80B-68AE325A0432} = {455BCF47-13B6-451E-8321-8ED9C4866BAA}
- {ACBE81D9-64B1-4133-823A-807A4E60B454} = {455BCF47-13B6-451E-8321-8ED9C4866BAA}
- {57249192-8E29-4D85-8B7A-FEFF1760B1DA} = {455BCF47-13B6-451E-8321-8ED9C4866BAA}
- {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D62} = {455BCF47-13B6-451E-8321-8ED9C4866BAA}
- {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D61} = {455BCF47-13B6-451E-8321-8ED9C4866BAA}
- {28AA9146-3482-4F41-9CC6-407B1D258508} = {455BCF47-13B6-451E-8321-8ED9C4866BAA}
- {030F6909-B2FA-4E53-BEA7-9A559CFC2F73} = {DAC2AB11-F09C-454B-86FD-9BDBBA25827F}
- {05DF3074-11AF-491A-B078-83BD2EDC31F6} = {DAC2AB11-F09C-454B-86FD-9BDBBA25827F}
- {5125C3DB-FBD6-4BF8-8D8B-CE51D6E93BCD} = {DAC2AB11-F09C-454B-86FD-9BDBBA25827F}
- {4727E8B7-AA99-41C9-AB09-A8A862595DB7} = {DAC2AB11-F09C-454B-86FD-9BDBBA25827F}
- {4CEC5897-D957-47E7-A6AE-2021D4F44A8F} = {DAC2AB11-F09C-454B-86FD-9BDBBA25827F}
- {7E7DA455-C276-4B93-8D02-8F7E2F629BAF} = {DAC2AB11-F09C-454B-86FD-9BDBBA25827F}
- {298B4876-6EF1-4E80-85D7-72F80693BBEB} = {DAC2AB11-F09C-454B-86FD-9BDBBA25827F}
- {6C98551A-4C36-4E74-8419-4D3EEEC9D8E0} = {DAC2AB11-F09C-454B-86FD-9BDBBA25827F}
- {F9FBDDA2-9EE1-473C-A456-BE20B7B2439D} = {DAC2AB11-F09C-454B-86FD-9BDBBA25827F}
- EndGlobalSection
-EndGlobal
diff --git a/release_23/win32/config.h b/release_23/win32/config.h
deleted file mode 100644
index 1e57d1df5c4b..000000000000
--- a/release_23/win32/config.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/* This file is appended to config.h.in to form the Windows version of
- * config.h */
-
-#define PACKAGE_NAME "LLVM (win32 vc8.0)"
-#define PACKAGE_VERSION 2.2
-#define LLVM_HOSTTRIPLE "i686-pc-win32"
-#define HAVE_WINDOWS_H 1
-#define HAVE_LIMITS_H 1
-#define HAVE_SYS_STAT_H 1
-#define HAVE_STDLIB_H 1
-#define HAVE_STDIO_H 1
-#define HAVE_STRING_H 1
-#define HAVE_CEILF 1
-#define HAVE_FLOORF 1
-#define SHLIBEXT ".lib"
-#define error_t int
-#define HAVE_ERRNO_H 1
-#define LTDL_DLOPEN_DEPLIBS 1
-#define LTDL_OBJDIR "_libs"
-#define LTDL_SHLIBPATH_VAR "PATH"
-#define LTDL_SHLIB_EXT ".dll"
-#define LTDL_SYSSEARCHPATH ""
-#define LLVM_ON_WIN32 1
-
-#define strtoll strtol
-#define stricmp _stricmp
-#define strdup _strdup
-
diff --git a/release_23/win32/dobison.cmd b/release_23/win32/dobison.cmd
deleted file mode 100755
index 72224f04a8c8..000000000000
--- a/release_23/win32/dobison.cmd
+++ /dev/null
@@ -1,27 +0,0 @@
-@echo off
-rem dobison.cmd prefix mode target source
-rem prefix - passed to bison as -p<prefix>
-rem mode - either debug or release
-rem target - generated parser file name without extension
-rem source - input to bison
-rem headercopydir - directory to receive a copy of the header
-
-if "%2"=="debug" (set flags=-tvdo) else (set flags=-vdo)
-
-rem Test for presence of bison.
-bison --help >NUL
-if errorlevel 1 goto nobison
-
-rem Run bison.
-echo bison -p%1 %flags%%3.cpp %4
-echo move %3.hpp %3.h
-bison -p%1 %flags%%3.cpp %4 && move %3.hpp %3.h
-echo copy %3.h %5
-copy %3.h %5
-exit
-
-:nobison
-echo Bison not found. Using pre-generated files.
-copy %~pn4.cpp.cvs %5\%3.cpp
-copy %~pn4.h.cvs %5\%3.h
-exit
diff --git a/release_23/win32/doflex.cmd b/release_23/win32/doflex.cmd
deleted file mode 100755
index 8f32fbdaa4a5..000000000000
--- a/release_23/win32/doflex.cmd
+++ /dev/null
@@ -1,20 +0,0 @@
-@echo off
-rem doflex.cmd prefix mode target source
-rem mode - either debug or release
-rem target - generated parser file name without extension
-rem source - input to bison
-
-if "%1"=="debug" (set flags=-t) else (set flags=-t)
-
-rem Test for presence of flex.
-flex --help >NUL
-if errorlevel 1 goto noflex
-
-rem Run flex.
-flex %flags% >%2.cpp %3
-exit
-
-:noflex
-echo Flex not found. Using pre-generated files.
-copy %~pn3.cpp.cvs %2.cpp
-exit
diff --git a/release_23/win32/llc/llc.vcproj b/release_23/win32/llc/llc.vcproj
deleted file mode 100644
index 68edf911001c..000000000000
--- a/release_23/win32/llc/llc.vcproj
+++ /dev/null
@@ -1,385 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="8.00"
- Name="llc"
- ProjectGUID="{ADE86BDC-B04C-43DF-B9BB-90492C7B14AC}"
- Keyword="Win32Proj"
- >
- <Platforms>
- <Platform
- Name="Win32"
- />
- <Platform
- Name="x64"
- />
- </Platforms>
- <ToolFiles>
- </ToolFiles>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="1"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="..\..\include;.."
- PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;__STDC_LIMIT_MACROS"
- StringPooling="true"
- MinimalRebuild="true"
- BasicRuntimeChecks="3"
- RuntimeLibrary="3"
- ForceConformanceInForLoopScope="true"
- RuntimeTypeInfo="true"
- UsePrecompiledHeader="0"
- ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb"
- BrowseInformation="1"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="4"
- DisableSpecificWarnings="4355,4146,4800"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- AdditionalDependencies="$(SolutionDir)X86\$(IntDir)\X86TargetMachine.obj $(SolutionDir)\CBackend\$(IntDir)\CBackend.obj"
- OutputFile="$(OutDir)/llc.exe"
- LinkIncremental="2"
- GenerateDebugInformation="true"
- ProgramDatabaseFile="$(OutDir)/llc.pdb"
- SubSystem="1"
- TargetMachine="1"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory="$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="1"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="..\..\include;.."
- PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;__STDC_LIMIT_MACROS"
- StringPooling="true"
- RuntimeLibrary="2"
- ForceConformanceInForLoopScope="true"
- RuntimeTypeInfo="true"
- UsePrecompiledHeader="0"
- ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb"
- BrowseInformation="0"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="3"
- DisableSpecificWarnings="4355,4146,4800"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- AdditionalDependencies="$(SolutionDir)X86\$(IntDir)\X86TargetMachine.obj $(SolutionDir)\CBackend\$(IntDir)\CBackend.obj"
- OutputFile="$(OutDir)/llc.exe"
- LinkIncremental="1"
- GenerateDebugInformation="true"
- SubSystem="1"
- OptimizeReferences="2"
- EnableCOMDATFolding="2"
- TargetMachine="1"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Debug|x64"
- OutputDirectory="$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="1"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- TargetEnvironment="3"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="..\..\include;.."
- PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;__STDC_LIMIT_MACROS"
- StringPooling="true"
- MinimalRebuild="true"
- BasicRuntimeChecks="3"
- RuntimeLibrary="3"
- ForceConformanceInForLoopScope="true"
- RuntimeTypeInfo="true"
- UsePrecompiledHeader="0"
- ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb"
- BrowseInformation="1"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="3"
- DisableSpecificWarnings="4355,4146,4800"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- AdditionalDependencies="$(SolutionDir)X86\$(IntDir)\X86TargetMachine.obj $(SolutionDir)\CBackend\$(IntDir)\CBackend.obj"
- OutputFile="$(OutDir)/llc.exe"
- LinkIncremental="2"
- GenerateDebugInformation="true"
- ProgramDatabaseFile="$(OutDir)/llc.pdb"
- SubSystem="1"
- TargetMachine="17"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Release|x64"
- OutputDirectory="$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="1"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- TargetEnvironment="3"
- />
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="..\..\include;.."
- PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;__STDC_LIMIT_MACROS"
- StringPooling="true"
- RuntimeLibrary="2"
- ForceConformanceInForLoopScope="true"
- RuntimeTypeInfo="true"
- UsePrecompiledHeader="0"
- ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb"
- BrowseInformation="0"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="3"
- DisableSpecificWarnings="4355,4146,4800"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- AdditionalDependencies="$(SolutionDir)X86\$(IntDir)\X86TargetMachine.obj $(SolutionDir)\CBackend\$(IntDir)\CBackend.obj"
- OutputFile="$(OutDir)/llc.exe"
- LinkIncremental="1"
- GenerateDebugInformation="true"
- SubSystem="1"
- OptimizeReferences="2"
- EnableCOMDATFolding="2"
- TargetMachine="17"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- </Configurations>
- <References>
- </References>
- <Files>
- <Filter
- Name="Source Files"
- Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
- UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
- >
- <File
- RelativePath="..\..\tools\llc\llc.cpp"
- >
- </File>
- </Filter>
- <Filter
- Name="Header Files"
- Filter="h;hpp;hxx;hm;inl;inc;xsd"
- UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
- >
- </Filter>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
diff --git a/release_23/win32/lli/lli.vcproj b/release_23/win32/lli/lli.vcproj
deleted file mode 100644
index 79e99df49054..000000000000
--- a/release_23/win32/lli/lli.vcproj
+++ /dev/null
@@ -1,385 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="8.00"
- Name="lli"
- ProjectGUID="{FB6FFD68-C1E4-4DCF-AB02-36D205D5263E}"
- Keyword="Win32Proj"
- >
- <Platforms>
- <Platform
- Name="Win32"
- />
- <Platform
- Name="x64"
- />
- </Platforms>
- <ToolFiles>
- </ToolFiles>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="1"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="..\..\include;.."
- PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;__STDC_LIMIT_MACROS"
- StringPooling="true"
- MinimalRebuild="true"
- BasicRuntimeChecks="3"
- RuntimeLibrary="3"
- ForceConformanceInForLoopScope="true"
- RuntimeTypeInfo="true"
- UsePrecompiledHeader="0"
- ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb"
- BrowseInformation="1"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="4"
- DisableSpecificWarnings="4355,4146,4800"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- AdditionalDependencies="$(SolutionDir)X86\$(IntDir)\X86TargetMachine.obj"
- OutputFile="$(OutDir)/lli.exe"
- LinkIncremental="2"
- GenerateDebugInformation="true"
- ProgramDatabaseFile="$(OutDir)/lli.pdb"
- SubSystem="1"
- TargetMachine="1"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory="$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="1"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="..\..\include;.."
- PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;__STDC_LIMIT_MACROS"
- StringPooling="true"
- RuntimeLibrary="2"
- ForceConformanceInForLoopScope="true"
- RuntimeTypeInfo="true"
- UsePrecompiledHeader="0"
- ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb"
- BrowseInformation="0"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="3"
- DisableSpecificWarnings="4355,4146,4800"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- AdditionalDependencies="$(SolutionDir)X86\$(IntDir)\X86TargetMachine.obj"
- OutputFile="$(OutDir)/lli.exe"
- LinkIncremental="1"
- GenerateDebugInformation="true"
- SubSystem="1"
- OptimizeReferences="2"
- EnableCOMDATFolding="2"
- TargetMachine="1"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Debug|x64"
- OutputDirectory="$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="1"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- TargetEnvironment="3"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="..\..\include;.."
- PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;__STDC_LIMIT_MACROS"
- StringPooling="true"
- MinimalRebuild="true"
- BasicRuntimeChecks="3"
- RuntimeLibrary="3"
- ForceConformanceInForLoopScope="true"
- RuntimeTypeInfo="true"
- UsePrecompiledHeader="0"
- ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb"
- BrowseInformation="1"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="3"
- DisableSpecificWarnings="4355,4146,4800"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- AdditionalDependencies="$(SolutionDir)X86\$(IntDir)\X86TargetMachine.obj"
- OutputFile="$(OutDir)/lli.exe"
- LinkIncremental="2"
- GenerateDebugInformation="true"
- ProgramDatabaseFile="$(OutDir)/lli.pdb"
- SubSystem="1"
- TargetMachine="17"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Release|x64"
- OutputDirectory="$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="1"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- TargetEnvironment="3"
- />
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="..\..\include;.."
- PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;__STDC_LIMIT_MACROS"
- StringPooling="true"
- RuntimeLibrary="2"
- ForceConformanceInForLoopScope="true"
- RuntimeTypeInfo="true"
- UsePrecompiledHeader="0"
- ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb"
- BrowseInformation="0"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="3"
- DisableSpecificWarnings="4355,4146,4800"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- AdditionalDependencies="$(SolutionDir)X86\$(IntDir)\X86TargetMachine.obj"
- OutputFile="$(OutDir)/lli.exe"
- LinkIncremental="1"
- GenerateDebugInformation="true"
- SubSystem="1"
- OptimizeReferences="2"
- EnableCOMDATFolding="2"
- TargetMachine="17"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- </Configurations>
- <References>
- </References>
- <Files>
- <Filter
- Name="Source Files"
- Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
- UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
- >
- <File
- RelativePath="..\..\tools\lli\lli.cpp"
- >
- </File>
- </Filter>
- <Filter
- Name="Header Files"
- Filter="h;hpp;hxx;hm;inl;inc;xsd"
- UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
- >
- </Filter>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
diff --git a/release_23/win32/llvm-ar/llvm-ar.vcproj b/release_23/win32/llvm-ar/llvm-ar.vcproj
deleted file mode 100644
index 0cdfebbafb37..000000000000
--- a/release_23/win32/llvm-ar/llvm-ar.vcproj
+++ /dev/null
@@ -1,381 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="8.00"
- Name="llvm-ar"
- ProjectGUID="{0FF2B75C-49C1-4B49-A44A-531C93000296}"
- Keyword="Win32Proj"
- >
- <Platforms>
- <Platform
- Name="Win32"
- />
- <Platform
- Name="x64"
- />
- </Platforms>
- <ToolFiles>
- </ToolFiles>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="1"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="..\..\include;.."
- PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;__STDC_LIMIT_MACROS"
- StringPooling="true"
- MinimalRebuild="true"
- BasicRuntimeChecks="3"
- RuntimeLibrary="3"
- ForceConformanceInForLoopScope="true"
- RuntimeTypeInfo="true"
- UsePrecompiledHeader="0"
- ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb"
- BrowseInformation="1"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="4"
- DisableSpecificWarnings="4355,4146,4800"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- OutputFile="$(OutDir)/llvm-ar.exe"
- LinkIncremental="2"
- GenerateDebugInformation="true"
- ProgramDatabaseFile="$(OutDir)/llvm-ar.pdb"
- SubSystem="1"
- TargetMachine="1"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory="$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="1"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="..\..\include;.."
- PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;__STDC_LIMIT_MACROS"
- StringPooling="true"
- RuntimeLibrary="2"
- ForceConformanceInForLoopScope="true"
- RuntimeTypeInfo="true"
- UsePrecompiledHeader="0"
- ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb"
- BrowseInformation="0"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="3"
- DisableSpecificWarnings="4355,4146,4800"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- OutputFile="$(OutDir)/llvm-ar.exe"
- LinkIncremental="1"
- GenerateDebugInformation="true"
- SubSystem="1"
- OptimizeReferences="2"
- EnableCOMDATFolding="2"
- TargetMachine="1"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Debug|x64"
- OutputDirectory="$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="1"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- TargetEnvironment="3"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="..\..\include;.."
- PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;__STDC_LIMIT_MACROS"
- StringPooling="true"
- MinimalRebuild="true"
- BasicRuntimeChecks="3"
- RuntimeLibrary="3"
- ForceConformanceInForLoopScope="true"
- RuntimeTypeInfo="true"
- UsePrecompiledHeader="0"
- ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb"
- BrowseInformation="1"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="3"
- DisableSpecificWarnings="4355,4146,4800"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- OutputFile="$(OutDir)/llvm-ar.exe"
- LinkIncremental="2"
- GenerateDebugInformation="true"
- ProgramDatabaseFile="$(OutDir)/llvm-ar.pdb"
- SubSystem="1"
- TargetMachine="17"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Release|x64"
- OutputDirectory="$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="1"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- TargetEnvironment="3"
- />
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="..\..\include;.."
- PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;__STDC_LIMIT_MACROS"
- StringPooling="true"
- RuntimeLibrary="2"
- ForceConformanceInForLoopScope="true"
- RuntimeTypeInfo="true"
- UsePrecompiledHeader="0"
- ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb"
- BrowseInformation="0"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="3"
- DisableSpecificWarnings="4355,4146,4800"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- OutputFile="$(OutDir)/llvm-ar.exe"
- LinkIncremental="1"
- GenerateDebugInformation="true"
- SubSystem="1"
- OptimizeReferences="2"
- EnableCOMDATFolding="2"
- TargetMachine="17"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- </Configurations>
- <References>
- </References>
- <Files>
- <Filter
- Name="Source Files"
- Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
- UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
- >
- <File
- RelativePath="..\..\tools\llvm-ar\llvm-ar.cpp"
- >
- </File>
- </Filter>
- <Filter
- Name="Header Files"
- Filter="h;hpp;hxx;hm;inl;inc;xsd"
- UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
- >
- </Filter>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
diff --git a/release_23/win32/llvm-as/llvm-as.vcproj b/release_23/win32/llvm-as/llvm-as.vcproj
deleted file mode 100644
index 91048700aef1..000000000000
--- a/release_23/win32/llvm-as/llvm-as.vcproj
+++ /dev/null
@@ -1,381 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="8.00"
- Name="llvm-as"
- ProjectGUID="{4FBC40A5-E626-4A6C-A9D3-FAE5C28D30CC}"
- Keyword="Win32Proj"
- >
- <Platforms>
- <Platform
- Name="Win32"
- />
- <Platform
- Name="x64"
- />
- </Platforms>
- <ToolFiles>
- </ToolFiles>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="1"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="..\..\include;.."
- PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;__STDC_LIMIT_MACROS"
- StringPooling="true"
- MinimalRebuild="true"
- BasicRuntimeChecks="3"
- RuntimeLibrary="3"
- ForceConformanceInForLoopScope="true"
- RuntimeTypeInfo="true"
- UsePrecompiledHeader="0"
- ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb"
- BrowseInformation="1"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="4"
- DisableSpecificWarnings="4355,4146,4800"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- OutputFile="$(OutDir)/llvm-as.exe"
- LinkIncremental="2"
- GenerateDebugInformation="true"
- ProgramDatabaseFile="$(OutDir)/llvm-as.pdb"
- SubSystem="1"
- TargetMachine="1"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory="$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="1"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="..\..\include;.."
- PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;__STDC_LIMIT_MACROS"
- StringPooling="true"
- RuntimeLibrary="2"
- ForceConformanceInForLoopScope="true"
- RuntimeTypeInfo="true"
- UsePrecompiledHeader="0"
- ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb"
- BrowseInformation="0"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="3"
- DisableSpecificWarnings="4355,4146,4800"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- OutputFile="$(OutDir)/llvm-as.exe"
- LinkIncremental="1"
- GenerateDebugInformation="true"
- SubSystem="1"
- OptimizeReferences="2"
- EnableCOMDATFolding="2"
- TargetMachine="1"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Debug|x64"
- OutputDirectory="$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="1"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- TargetEnvironment="3"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="..\..\include;.."
- PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;__STDC_LIMIT_MACROS"
- StringPooling="true"
- MinimalRebuild="true"
- BasicRuntimeChecks="3"
- RuntimeLibrary="3"
- ForceConformanceInForLoopScope="true"
- RuntimeTypeInfo="true"
- UsePrecompiledHeader="0"
- ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb"
- BrowseInformation="1"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="3"
- DisableSpecificWarnings="4355,4146,4800"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- OutputFile="$(OutDir)/llvm-as.exe"
- LinkIncremental="2"
- GenerateDebugInformation="true"
- ProgramDatabaseFile="$(OutDir)/llvm-as.pdb"
- SubSystem="1"
- TargetMachine="17"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Release|x64"
- OutputDirectory="$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="1"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- TargetEnvironment="3"
- />
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="..\..\include;.."
- PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;__STDC_LIMIT_MACROS"
- StringPooling="true"
- RuntimeLibrary="2"
- ForceConformanceInForLoopScope="true"
- RuntimeTypeInfo="true"
- UsePrecompiledHeader="0"
- ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb"
- BrowseInformation="0"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="3"
- DisableSpecificWarnings="4355,4146,4800"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- OutputFile="$(OutDir)/llvm-as.exe"
- LinkIncremental="1"
- GenerateDebugInformation="true"
- SubSystem="1"
- OptimizeReferences="2"
- EnableCOMDATFolding="2"
- TargetMachine="17"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- </Configurations>
- <References>
- </References>
- <Files>
- <Filter
- Name="Source Files"
- Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
- UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
- >
- <File
- RelativePath="..\..\tools\llvm-as\llvm-as.cpp"
- >
- </File>
- </Filter>
- <Filter
- Name="Header Files"
- Filter="h;hpp;hxx;hm;inl;inc;xsd"
- UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
- >
- </Filter>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
diff --git a/release_23/win32/llvm-bcanalyzer/llvm-bcanalyzer.vcproj b/release_23/win32/llvm-bcanalyzer/llvm-bcanalyzer.vcproj
deleted file mode 100644
index db4e481542cc..000000000000
--- a/release_23/win32/llvm-bcanalyzer/llvm-bcanalyzer.vcproj
+++ /dev/null
@@ -1,381 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="8.00"
- Name="llvm-bcanalyzer"
- ProjectGUID="{E0B1E329-BE3E-456D-B372-5F397BE42C84}"
- Keyword="Win32Proj"
- >
- <Platforms>
- <Platform
- Name="Win32"
- />
- <Platform
- Name="x64"
- />
- </Platforms>
- <ToolFiles>
- </ToolFiles>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="1"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="..\..\include;.."
- PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;__STDC_LIMIT_MACROS"
- StringPooling="true"
- MinimalRebuild="true"
- BasicRuntimeChecks="3"
- RuntimeLibrary="3"
- ForceConformanceInForLoopScope="true"
- RuntimeTypeInfo="true"
- UsePrecompiledHeader="0"
- ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb"
- BrowseInformation="1"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="4"
- DisableSpecificWarnings="4355,4146,4800"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- OutputFile="$(OutDir)/llvm-bcanalyzer.exe"
- LinkIncremental="2"
- GenerateDebugInformation="true"
- ProgramDatabaseFile="$(OutDir)/llvm-bcanalyzer.pdb"
- SubSystem="1"
- TargetMachine="1"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory="$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="1"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="..\..\include;.."
- PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;__STDC_LIMIT_MACROS"
- StringPooling="true"
- RuntimeLibrary="2"
- ForceConformanceInForLoopScope="true"
- RuntimeTypeInfo="true"
- UsePrecompiledHeader="0"
- ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb"
- BrowseInformation="0"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="3"
- DisableSpecificWarnings="4355,4146,4800"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- OutputFile="$(OutDir)/llvm-bcanalyzer.exe"
- LinkIncremental="1"
- GenerateDebugInformation="true"
- SubSystem="1"
- OptimizeReferences="2"
- EnableCOMDATFolding="2"
- TargetMachine="1"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Debug|x64"
- OutputDirectory="$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="1"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- TargetEnvironment="3"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="..\..\include;.."
- PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;__STDC_LIMIT_MACROS"
- StringPooling="true"
- MinimalRebuild="true"
- BasicRuntimeChecks="3"
- RuntimeLibrary="3"
- ForceConformanceInForLoopScope="true"
- RuntimeTypeInfo="true"
- UsePrecompiledHeader="0"
- ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb"
- BrowseInformation="1"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="3"
- DisableSpecificWarnings="4355,4146,4800"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- OutputFile="$(OutDir)/llvm-bcanalyzer.exe"
- LinkIncremental="2"
- GenerateDebugInformation="true"
- ProgramDatabaseFile="$(OutDir)/llvm-bcanalyzer.pdb"
- SubSystem="1"
- TargetMachine="17"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Release|x64"
- OutputDirectory="$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="1"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- TargetEnvironment="3"
- />
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="..\..\include;.."
- PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;__STDC_LIMIT_MACROS"
- StringPooling="true"
- RuntimeLibrary="2"
- ForceConformanceInForLoopScope="true"
- RuntimeTypeInfo="true"
- UsePrecompiledHeader="0"
- ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb"
- BrowseInformation="0"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="3"
- DisableSpecificWarnings="4355,4146,4800"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- OutputFile="$(OutDir)/llvm-bcanalyzer.exe"
- LinkIncremental="1"
- GenerateDebugInformation="true"
- SubSystem="1"
- OptimizeReferences="2"
- EnableCOMDATFolding="2"
- TargetMachine="17"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- </Configurations>
- <References>
- </References>
- <Files>
- <Filter
- Name="Source Files"
- Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
- UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
- >
- <File
- RelativePath="..\..\tools\llvm-bcanalyzer\llvm-bcanalyzer.cpp"
- >
- </File>
- </Filter>
- <Filter
- Name="Header Files"
- Filter="h;hpp;hxx;hm;inl;inc;xsd"
- UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
- >
- </Filter>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
diff --git a/release_23/win32/llvm-dis/llvm-dis.vcproj b/release_23/win32/llvm-dis/llvm-dis.vcproj
deleted file mode 100644
index b2d56d3a2cc1..000000000000
--- a/release_23/win32/llvm-dis/llvm-dis.vcproj
+++ /dev/null
@@ -1,381 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="8.00"
- Name="llvm-dis"
- ProjectGUID="{B13476BC-30AB-4EA0-BC1E-212C0A459405}"
- Keyword="Win32Proj"
- >
- <Platforms>
- <Platform
- Name="Win32"
- />
- <Platform
- Name="x64"
- />
- </Platforms>
- <ToolFiles>
- </ToolFiles>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="1"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="..\..\include;.."
- PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;__STDC_LIMIT_MACROS"
- StringPooling="true"
- MinimalRebuild="true"
- BasicRuntimeChecks="3"
- RuntimeLibrary="3"
- ForceConformanceInForLoopScope="true"
- RuntimeTypeInfo="true"
- UsePrecompiledHeader="0"
- ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb"
- BrowseInformation="1"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="4"
- DisableSpecificWarnings="4355,4146,4800"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- OutputFile="$(OutDir)/llvm-dis.exe"
- LinkIncremental="2"
- GenerateDebugInformation="true"
- ProgramDatabaseFile="$(OutDir)/llvm-dis.pdb"
- SubSystem="1"
- TargetMachine="1"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory="$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="1"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="..\..\include;.."
- PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;__STDC_LIMIT_MACROS"
- StringPooling="true"
- RuntimeLibrary="2"
- ForceConformanceInForLoopScope="true"
- RuntimeTypeInfo="true"
- UsePrecompiledHeader="0"
- ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb"
- BrowseInformation="0"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="3"
- DisableSpecificWarnings="4355,4146,4800"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- OutputFile="$(OutDir)/llvm-dis.exe"
- LinkIncremental="1"
- GenerateDebugInformation="true"
- SubSystem="1"
- OptimizeReferences="2"
- EnableCOMDATFolding="2"
- TargetMachine="1"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Debug|x64"
- OutputDirectory="$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="1"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- TargetEnvironment="3"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="..\..\include;.."
- PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;__STDC_LIMIT_MACROS"
- StringPooling="true"
- MinimalRebuild="true"
- BasicRuntimeChecks="3"
- RuntimeLibrary="3"
- ForceConformanceInForLoopScope="true"
- RuntimeTypeInfo="true"
- UsePrecompiledHeader="0"
- ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb"
- BrowseInformation="1"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="3"
- DisableSpecificWarnings="4355,4146,4800"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- OutputFile="$(OutDir)/llvm-dis.exe"
- LinkIncremental="2"
- GenerateDebugInformation="true"
- ProgramDatabaseFile="$(OutDir)/llvm-dis.pdb"
- SubSystem="1"
- TargetMachine="17"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Release|x64"
- OutputDirectory="$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="1"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- TargetEnvironment="3"
- />
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="..\..\include;.."
- PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;__STDC_LIMIT_MACROS"
- StringPooling="true"
- RuntimeLibrary="2"
- ForceConformanceInForLoopScope="true"
- RuntimeTypeInfo="true"
- UsePrecompiledHeader="0"
- ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb"
- BrowseInformation="0"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="3"
- DisableSpecificWarnings="4355,4146,4800"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- OutputFile="$(OutDir)/llvm-dis.exe"
- LinkIncremental="1"
- GenerateDebugInformation="true"
- SubSystem="1"
- OptimizeReferences="2"
- EnableCOMDATFolding="2"
- TargetMachine="17"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- </Configurations>
- <References>
- </References>
- <Files>
- <Filter
- Name="Source Files"
- Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
- UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
- >
- <File
- RelativePath="..\..\tools\llvm-dis\llvm-dis.cpp"
- >
- </File>
- </Filter>
- <Filter
- Name="Header Files"
- Filter="h;hpp;hxx;hm;inl;inc;xsd"
- UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
- >
- </Filter>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
diff --git a/release_23/win32/llvm-ld/llvm-ld.vcproj b/release_23/win32/llvm-ld/llvm-ld.vcproj
deleted file mode 100644
index 4e25bd238ec7..000000000000
--- a/release_23/win32/llvm-ld/llvm-ld.vcproj
+++ /dev/null
@@ -1,385 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="8.00"
- Name="llvm-ld"
- ProjectGUID="{64D8AA46-88DB-41F4-B837-053AE02406B8}"
- Keyword="Win32Proj"
- >
- <Platforms>
- <Platform
- Name="Win32"
- />
- <Platform
- Name="x64"
- />
- </Platforms>
- <ToolFiles>
- </ToolFiles>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="1"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="..\..\include;.."
- PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;__STDC_LIMIT_MACROS"
- StringPooling="true"
- MinimalRebuild="true"
- BasicRuntimeChecks="3"
- RuntimeLibrary="3"
- ForceConformanceInForLoopScope="true"
- RuntimeTypeInfo="true"
- UsePrecompiledHeader="0"
- ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb"
- BrowseInformation="1"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="4"
- DisableSpecificWarnings="4355,4146,4800"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- OutputFile="$(OutDir)/llvm-ld.exe"
- LinkIncremental="2"
- GenerateDebugInformation="true"
- ProgramDatabaseFile="$(OutDir)/llvm-ld.pdb"
- SubSystem="1"
- TargetMachine="1"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory="$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="1"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="..\..\include;.."
- PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;__STDC_LIMIT_MACROS"
- StringPooling="true"
- RuntimeLibrary="2"
- ForceConformanceInForLoopScope="true"
- RuntimeTypeInfo="true"
- UsePrecompiledHeader="0"
- ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb"
- BrowseInformation="0"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="3"
- DisableSpecificWarnings="4355,4146,4800"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- OutputFile="$(OutDir)/llvm-ld.exe"
- LinkIncremental="1"
- GenerateDebugInformation="true"
- SubSystem="1"
- OptimizeReferences="2"
- EnableCOMDATFolding="2"
- TargetMachine="1"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Debug|x64"
- OutputDirectory="$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="1"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- TargetEnvironment="3"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="..\..\include;.."
- PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;__STDC_LIMIT_MACROS"
- StringPooling="true"
- MinimalRebuild="true"
- BasicRuntimeChecks="3"
- RuntimeLibrary="3"
- ForceConformanceInForLoopScope="true"
- RuntimeTypeInfo="true"
- UsePrecompiledHeader="0"
- ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb"
- BrowseInformation="1"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="3"
- DisableSpecificWarnings="4355,4146,4800"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- OutputFile="$(OutDir)/llvm-ld.exe"
- LinkIncremental="2"
- GenerateDebugInformation="true"
- ProgramDatabaseFile="$(OutDir)/llvm-ld.pdb"
- SubSystem="1"
- TargetMachine="17"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Release|x64"
- OutputDirectory="$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="1"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- TargetEnvironment="3"
- />
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="..\..\include;.."
- PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;__STDC_LIMIT_MACROS"
- StringPooling="true"
- RuntimeLibrary="2"
- ForceConformanceInForLoopScope="true"
- RuntimeTypeInfo="true"
- UsePrecompiledHeader="0"
- ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb"
- BrowseInformation="0"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="3"
- DisableSpecificWarnings="4355,4146,4800"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- OutputFile="$(OutDir)/llvm-ld.exe"
- LinkIncremental="1"
- GenerateDebugInformation="true"
- SubSystem="1"
- OptimizeReferences="2"
- EnableCOMDATFolding="2"
- TargetMachine="17"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- </Configurations>
- <References>
- </References>
- <Files>
- <Filter
- Name="Source Files"
- Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
- UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
- >
- <File
- RelativePath="..\..\tools\llvm-ld\llvm-ld.cpp"
- >
- </File>
- <File
- RelativePath="..\..\tools\llvm-ld\Optimize.cpp"
- >
- </File>
- </Filter>
- <Filter
- Name="Header Files"
- Filter="h;hpp;hxx;hm;inl;inc;xsd"
- UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
- >
- </Filter>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
diff --git a/release_23/win32/llvm-link/llvm-link.vcproj b/release_23/win32/llvm-link/llvm-link.vcproj
deleted file mode 100644
index 18116b469cbf..000000000000
--- a/release_23/win32/llvm-link/llvm-link.vcproj
+++ /dev/null
@@ -1,381 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="8.00"
- Name="llvm-link"
- ProjectGUID="{5E249789-49E1-4600-B12B-8AD2BB6439B2}"
- Keyword="Win32Proj"
- >
- <Platforms>
- <Platform
- Name="Win32"
- />
- <Platform
- Name="x64"
- />
- </Platforms>
- <ToolFiles>
- </ToolFiles>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="1"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="..\..\include;.."
- PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;__STDC_LIMIT_MACROS"
- StringPooling="true"
- MinimalRebuild="true"
- BasicRuntimeChecks="3"
- RuntimeLibrary="3"
- ForceConformanceInForLoopScope="true"
- RuntimeTypeInfo="true"
- UsePrecompiledHeader="0"
- ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb"
- BrowseInformation="1"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="4"
- DisableSpecificWarnings="4355,4146,4800"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- OutputFile="$(OutDir)/llvm-link.exe"
- LinkIncremental="2"
- GenerateDebugInformation="true"
- ProgramDatabaseFile="$(OutDir)/llvm-link.pdb"
- SubSystem="1"
- TargetMachine="1"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory="$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="1"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="..\..\include;.."
- PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;__STDC_LIMIT_MACROS"
- StringPooling="true"
- RuntimeLibrary="2"
- ForceConformanceInForLoopScope="true"
- RuntimeTypeInfo="true"
- UsePrecompiledHeader="0"
- ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb"
- BrowseInformation="0"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="3"
- DisableSpecificWarnings="4355,4146,4800"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- OutputFile="$(OutDir)/llvm-link.exe"
- LinkIncremental="1"
- GenerateDebugInformation="true"
- SubSystem="1"
- OptimizeReferences="2"
- EnableCOMDATFolding="2"
- TargetMachine="1"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Debug|x64"
- OutputDirectory="$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="1"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- TargetEnvironment="3"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="..\..\include;.."
- PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;__STDC_LIMIT_MACROS"
- StringPooling="true"
- MinimalRebuild="true"
- BasicRuntimeChecks="3"
- RuntimeLibrary="3"
- ForceConformanceInForLoopScope="true"
- RuntimeTypeInfo="true"
- UsePrecompiledHeader="0"
- ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb"
- BrowseInformation="1"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="3"
- DisableSpecificWarnings="4355,4146,4800"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- OutputFile="$(OutDir)/llvm-link.exe"
- LinkIncremental="2"
- GenerateDebugInformation="true"
- ProgramDatabaseFile="$(OutDir)/llvm-link.pdb"
- SubSystem="1"
- TargetMachine="17"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Release|x64"
- OutputDirectory="$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="1"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- TargetEnvironment="3"
- />
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="..\..\include;.."
- PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;__STDC_LIMIT_MACROS"
- StringPooling="true"
- RuntimeLibrary="2"
- ForceConformanceInForLoopScope="true"
- RuntimeTypeInfo="true"
- UsePrecompiledHeader="0"
- ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb"
- BrowseInformation="0"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="3"
- DisableSpecificWarnings="4355,4146,4800"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- OutputFile="$(OutDir)/llvm-link.exe"
- LinkIncremental="1"
- GenerateDebugInformation="true"
- SubSystem="1"
- OptimizeReferences="2"
- EnableCOMDATFolding="2"
- TargetMachine="17"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- </Configurations>
- <References>
- </References>
- <Files>
- <Filter
- Name="Source Files"
- Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
- UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
- >
- <File
- RelativePath="..\..\tools\llvm-link\llvm-link.cpp"
- >
- </File>
- </Filter>
- <Filter
- Name="Header Files"
- Filter="h;hpp;hxx;hm;inl;inc;xsd"
- UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
- >
- </Filter>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
diff --git a/release_23/win32/llvm-nm/llvm-nm.vcproj b/release_23/win32/llvm-nm/llvm-nm.vcproj
deleted file mode 100644
index d353b22afdbd..000000000000
--- a/release_23/win32/llvm-nm/llvm-nm.vcproj
+++ /dev/null
@@ -1,381 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="8.00"
- Name="llvm-nm"
- ProjectGUID="{5FF862CE-80A0-4B48-A80B-68AE325A0432}"
- Keyword="Win32Proj"
- >
- <Platforms>
- <Platform
- Name="Win32"
- />
- <Platform
- Name="x64"
- />
- </Platforms>
- <ToolFiles>
- </ToolFiles>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="1"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="..\..\include;.."
- PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;__STDC_LIMIT_MACROS"
- StringPooling="true"
- MinimalRebuild="true"
- BasicRuntimeChecks="3"
- RuntimeLibrary="3"
- ForceConformanceInForLoopScope="true"
- RuntimeTypeInfo="true"
- UsePrecompiledHeader="0"
- ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb"
- BrowseInformation="1"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="4"
- DisableSpecificWarnings="4355,4146,4800"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- OutputFile="$(OutDir)/llvm-nm.exe"
- LinkIncremental="2"
- GenerateDebugInformation="true"
- ProgramDatabaseFile="$(OutDir)/llvm-nm.pdb"
- SubSystem="1"
- TargetMachine="1"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory="$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="1"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="..\..\include;.."
- PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;__STDC_LIMIT_MACROS"
- StringPooling="true"
- RuntimeLibrary="2"
- ForceConformanceInForLoopScope="true"
- RuntimeTypeInfo="true"
- UsePrecompiledHeader="0"
- ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb"
- BrowseInformation="0"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="3"
- DisableSpecificWarnings="4355,4146,4800"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- OutputFile="$(OutDir)/llvm-nm.exe"
- LinkIncremental="1"
- GenerateDebugInformation="true"
- SubSystem="1"
- OptimizeReferences="2"
- EnableCOMDATFolding="2"
- TargetMachine="1"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Debug|x64"
- OutputDirectory="$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="1"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- TargetEnvironment="3"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="..\..\include;.."
- PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;__STDC_LIMIT_MACROS"
- StringPooling="true"
- MinimalRebuild="true"
- BasicRuntimeChecks="3"
- RuntimeLibrary="3"
- ForceConformanceInForLoopScope="true"
- RuntimeTypeInfo="true"
- UsePrecompiledHeader="0"
- ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb"
- BrowseInformation="1"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="3"
- DisableSpecificWarnings="4355,4146,4800"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- OutputFile="$(OutDir)/llvm-nm.exe"
- LinkIncremental="2"
- GenerateDebugInformation="true"
- ProgramDatabaseFile="$(OutDir)/llvm-nm.pdb"
- SubSystem="1"
- TargetMachine="17"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Release|x64"
- OutputDirectory="$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="1"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- TargetEnvironment="3"
- />
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="..\..\include;.."
- PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;__STDC_LIMIT_MACROS"
- StringPooling="true"
- RuntimeLibrary="2"
- ForceConformanceInForLoopScope="true"
- RuntimeTypeInfo="true"
- UsePrecompiledHeader="0"
- ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb"
- BrowseInformation="0"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="3"
- DisableSpecificWarnings="4355,4146,4800"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- OutputFile="$(OutDir)/llvm-nm.exe"
- LinkIncremental="1"
- GenerateDebugInformation="true"
- SubSystem="1"
- OptimizeReferences="2"
- EnableCOMDATFolding="2"
- TargetMachine="17"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- </Configurations>
- <References>
- </References>
- <Files>
- <Filter
- Name="Source Files"
- Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
- UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
- >
- <File
- RelativePath="..\..\tools\llvm-nm\llvm-nm.cpp"
- >
- </File>
- </Filter>
- <Filter
- Name="Header Files"
- Filter="h;hpp;hxx;hm;inl;inc;xsd"
- UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
- >
- </Filter>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
diff --git a/release_23/win32/llvm-prof/llvm-prof.vcproj b/release_23/win32/llvm-prof/llvm-prof.vcproj
deleted file mode 100644
index db33ccb50e02..000000000000
--- a/release_23/win32/llvm-prof/llvm-prof.vcproj
+++ /dev/null
@@ -1,381 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="8.00"
- Name="llvm-prof"
- ProjectGUID="{ACBE81D9-64B1-4133-823A-807A4E60B454}"
- Keyword="Win32Proj"
- >
- <Platforms>
- <Platform
- Name="Win32"
- />
- <Platform
- Name="x64"
- />
- </Platforms>
- <ToolFiles>
- </ToolFiles>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="1"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="..\..\include;.."
- PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;__STDC_LIMIT_MACROS"
- StringPooling="true"
- MinimalRebuild="true"
- BasicRuntimeChecks="3"
- RuntimeLibrary="3"
- ForceConformanceInForLoopScope="true"
- RuntimeTypeInfo="true"
- UsePrecompiledHeader="0"
- ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb"
- BrowseInformation="1"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="4"
- DisableSpecificWarnings="4355,4146,4800"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- OutputFile="$(OutDir)/llvm-prof.exe"
- LinkIncremental="2"
- GenerateDebugInformation="true"
- ProgramDatabaseFile="$(OutDir)/llvm-prof.pdb"
- SubSystem="1"
- TargetMachine="1"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory="$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="1"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="..\..\include;.."
- PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;__STDC_LIMIT_MACROS"
- StringPooling="true"
- RuntimeLibrary="2"
- ForceConformanceInForLoopScope="true"
- RuntimeTypeInfo="true"
- UsePrecompiledHeader="0"
- ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb"
- BrowseInformation="0"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="3"
- DisableSpecificWarnings="4355,4146,4800"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- OutputFile="$(OutDir)/llvm-prof.exe"
- LinkIncremental="1"
- GenerateDebugInformation="true"
- SubSystem="1"
- OptimizeReferences="2"
- EnableCOMDATFolding="2"
- TargetMachine="1"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Debug|x64"
- OutputDirectory="$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="1"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- TargetEnvironment="3"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="..\..\include;.."
- PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;__STDC_LIMIT_MACROS"
- StringPooling="true"
- MinimalRebuild="true"
- BasicRuntimeChecks="3"
- RuntimeLibrary="3"
- ForceConformanceInForLoopScope="true"
- RuntimeTypeInfo="true"
- UsePrecompiledHeader="0"
- ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb"
- BrowseInformation="1"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="3"
- DisableSpecificWarnings="4355,4146,4800"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- OutputFile="$(OutDir)/llvm-prof.exe"
- LinkIncremental="2"
- GenerateDebugInformation="true"
- ProgramDatabaseFile="$(OutDir)/llvm-prof.pdb"
- SubSystem="1"
- TargetMachine="17"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Release|x64"
- OutputDirectory="$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="1"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- TargetEnvironment="3"
- />
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="..\..\include;.."
- PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;__STDC_LIMIT_MACROS"
- StringPooling="true"
- RuntimeLibrary="2"
- ForceConformanceInForLoopScope="true"
- RuntimeTypeInfo="true"
- UsePrecompiledHeader="0"
- ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb"
- BrowseInformation="0"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="3"
- DisableSpecificWarnings="4355,4146,4800"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- OutputFile="$(OutDir)/llvm-prof.exe"
- LinkIncremental="1"
- GenerateDebugInformation="true"
- SubSystem="1"
- OptimizeReferences="2"
- EnableCOMDATFolding="2"
- TargetMachine="17"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- </Configurations>
- <References>
- </References>
- <Files>
- <Filter
- Name="Source Files"
- Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
- UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
- >
- <File
- RelativePath="..\..\tools\llvm-prof\llvm-prof.cpp"
- >
- </File>
- </Filter>
- <Filter
- Name="Header Files"
- Filter="h;hpp;hxx;hm;inl;inc;xsd"
- UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
- >
- </Filter>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
diff --git a/release_23/win32/llvm-ranlib/llvm-ranlib.vcproj b/release_23/win32/llvm-ranlib/llvm-ranlib.vcproj
deleted file mode 100644
index 0a1db0efdb33..000000000000
--- a/release_23/win32/llvm-ranlib/llvm-ranlib.vcproj
+++ /dev/null
@@ -1,381 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="8.00"
- Name="llvm-ranlib"
- ProjectGUID="{BB16C7EE-B4ED-4714-B5ED-B775C62A6612}"
- Keyword="Win32Proj"
- >
- <Platforms>
- <Platform
- Name="Win32"
- />
- <Platform
- Name="x64"
- />
- </Platforms>
- <ToolFiles>
- </ToolFiles>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="1"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="..\..\include;.."
- PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;__STDC_LIMIT_MACROS"
- StringPooling="true"
- MinimalRebuild="true"
- BasicRuntimeChecks="3"
- RuntimeLibrary="3"
- ForceConformanceInForLoopScope="true"
- RuntimeTypeInfo="true"
- UsePrecompiledHeader="0"
- ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb"
- BrowseInformation="1"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="4"
- DisableSpecificWarnings="4355,4146,4800"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- OutputFile="$(OutDir)/llvm-ranlib.exe"
- LinkIncremental="2"
- GenerateDebugInformation="true"
- ProgramDatabaseFile="$(OutDir)/llvm-ranlib.pdb"
- SubSystem="1"
- TargetMachine="1"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory="$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="1"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="..\..\include;.."
- PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;__STDC_LIMIT_MACROS"
- StringPooling="true"
- RuntimeLibrary="2"
- ForceConformanceInForLoopScope="true"
- RuntimeTypeInfo="true"
- UsePrecompiledHeader="0"
- ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb"
- BrowseInformation="0"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="3"
- DisableSpecificWarnings="4355,4146,4800"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- OutputFile="$(OutDir)/llvm-ranlib.exe"
- LinkIncremental="1"
- GenerateDebugInformation="true"
- SubSystem="1"
- OptimizeReferences="2"
- EnableCOMDATFolding="2"
- TargetMachine="1"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Debug|x64"
- OutputDirectory="$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="1"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- TargetEnvironment="3"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="..\..\include;.."
- PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;__STDC_LIMIT_MACROS"
- StringPooling="true"
- MinimalRebuild="true"
- BasicRuntimeChecks="3"
- RuntimeLibrary="3"
- ForceConformanceInForLoopScope="true"
- RuntimeTypeInfo="true"
- UsePrecompiledHeader="0"
- ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb"
- BrowseInformation="1"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="3"
- DisableSpecificWarnings="4355,4146,4800"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- OutputFile="$(OutDir)/llvm-ranlib.exe"
- LinkIncremental="2"
- GenerateDebugInformation="true"
- ProgramDatabaseFile="$(OutDir)/llvm-ranlib.pdb"
- SubSystem="1"
- TargetMachine="17"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Release|x64"
- OutputDirectory="$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="1"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- TargetEnvironment="3"
- />
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="..\..\include;.."
- PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;__STDC_LIMIT_MACROS"
- StringPooling="true"
- RuntimeLibrary="2"
- ForceConformanceInForLoopScope="true"
- RuntimeTypeInfo="true"
- UsePrecompiledHeader="0"
- ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb"
- BrowseInformation="0"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="3"
- DisableSpecificWarnings="4355,4146,4800"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- OutputFile="$(OutDir)/llvm-ranlib.exe"
- LinkIncremental="1"
- GenerateDebugInformation="true"
- SubSystem="1"
- OptimizeReferences="2"
- EnableCOMDATFolding="2"
- TargetMachine="17"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- </Configurations>
- <References>
- </References>
- <Files>
- <Filter
- Name="Source Files"
- Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
- UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
- >
- <File
- RelativePath="..\..\tools\llvm-ranlib\llvm-ranlib.cpp"
- >
- </File>
- </Filter>
- <Filter
- Name="Header Files"
- Filter="h;hpp;hxx;hm;inl;inc;xsd"
- UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
- >
- </Filter>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
diff --git a/release_23/win32/llvm.sln b/release_23/win32/llvm.sln
deleted file mode 100644
index 8aab563f6c6b..000000000000
--- a/release_23/win32/llvm.sln
+++ /dev/null
@@ -1,719 +0,0 @@
-Microsoft Visual Studio Solution File, Format Version 9.00
-# Visual Studio 2005
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "support", "Support\Support.vcproj", "{28AA9146-3482-4F41-9CC6-407B1D258508}"
- ProjectSection(WebsiteProperties) = preProject
- Debug.AspNetCompiler.Debug = "True"
- Release.AspNetCompiler.Debug = "False"
- EndProjectSection
- ProjectSection(ProjectDependencies) = postProject
- {19514E48-456C-4B9D-8637-F2285476461E} = {19514E48-456C-4B9D-8637-F2285476461E}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TableGen", "TableGen\TableGen.vcproj", "{339C2249-26B6-4172-B484-85653029AF57}"
- ProjectSection(WebsiteProperties) = preProject
- Debug.AspNetCompiler.Debug = "True"
- Release.AspNetCompiler.Debug = "False"
- EndProjectSection
- ProjectSection(ProjectDependencies) = postProject
- {28AA9146-3482-4F41-9CC6-407B1D258508} = {28AA9146-3482-4F41-9CC6-407B1D258508}
- {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D62} = {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D62}
- {0F8407F3-FA23-4CF1-83A9-DCBE0B361489} = {0F8407F3-FA23-4CF1-83A9-DCBE0B361489}
- {19514E48-456C-4B9D-8637-F2285476461E} = {19514E48-456C-4B9D-8637-F2285476461E}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Fibonacci", "Fibonacci\Fibonacci.vcproj", "{48FB551D-E37E-42EC-BC97-FF7219774867}"
- ProjectSection(WebsiteProperties) = preProject
- Debug.AspNetCompiler.Debug = "True"
- Release.AspNetCompiler.Debug = "False"
- EndProjectSection
- ProjectSection(ProjectDependencies) = postProject
- {144EEBF6-8C9B-4473-B715-2C821666AF6C} = {144EEBF6-8C9B-4473-B715-2C821666AF6C}
- {0F8407F3-FA23-4CF1-83A9-DCBE0B361489} = {0F8407F3-FA23-4CF1-83A9-DCBE0B361489}
- {76295AE8-A083-460E-9F80-6F2B8923264A} = {76295AE8-A083-460E-9F80-6F2B8923264A}
- {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB} = {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB}
- {08CEB1BB-C2A4-4587-B9A9-AEDB8FB44897} = {08CEB1BB-C2A4-4587-B9A9-AEDB8FB44897}
- {059FBAB8-C76D-48A0-AA75-3C57BD3EAFE4} = {059FBAB8-C76D-48A0-AA75-3C57BD3EAFE4}
- {28AA9146-3482-4F41-9CC6-407B1D258508} = {28AA9146-3482-4F41-9CC6-407B1D258508}
- {0622E827-8464-489D-8B1C-B0B496F35C08} = {0622E827-8464-489D-8B1C-B0B496F35C08}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ExecutionEngine", "ExecutionEngine\ExecutionEngine.vcproj", "{76295AE8-A083-460E-9F80-6F2B8923264A}"
- ProjectSection(WebsiteProperties) = preProject
- Debug.AspNetCompiler.Debug = "True"
- Release.AspNetCompiler.Debug = "False"
- EndProjectSection
- ProjectSection(ProjectDependencies) = postProject
- {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB} = {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB}
- {19514E48-456C-4B9D-8637-F2285476461E} = {19514E48-456C-4B9D-8637-F2285476461E}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "VMCore", "VMCore\VMCore.vcproj", "{45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB}"
- ProjectSection(WebsiteProperties) = preProject
- Debug.AspNetCompiler.Debug = "True"
- Release.AspNetCompiler.Debug = "False"
- EndProjectSection
- ProjectSection(ProjectDependencies) = postProject
- {339C2249-26B6-4172-B484-85653029AF57} = {339C2249-26B6-4172-B484-85653029AF57}
- {19514E48-456C-4B9D-8637-F2285476461E} = {19514E48-456C-4B9D-8637-F2285476461E}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Target", "Target\Target.vcproj", "{059FBAB8-C76D-48A0-AA75-3C57BD3EAFE4}"
- ProjectSection(WebsiteProperties) = preProject
- Debug.AspNetCompiler.Debug = "True"
- Release.AspNetCompiler.Debug = "False"
- EndProjectSection
- ProjectSection(ProjectDependencies) = postProject
- {19514E48-456C-4B9D-8637-F2285476461E} = {19514E48-456C-4B9D-8637-F2285476461E}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CodeGen", "CodeGen\CodeGen.vcproj", "{08CEB1BB-C2A4-4587-B9A9-AEDB8FB44897}"
- ProjectSection(WebsiteProperties) = preProject
- Debug.AspNetCompiler.Debug = "True"
- Release.AspNetCompiler.Debug = "False"
- EndProjectSection
- ProjectSection(ProjectDependencies) = postProject
- {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB} = {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB}
- {339C2249-26B6-4172-B484-85653029AF57} = {339C2249-26B6-4172-B484-85653029AF57}
- {19514E48-456C-4B9D-8637-F2285476461E} = {19514E48-456C-4B9D-8637-F2285476461E}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "System", "System\System.vcproj", "{0F8407F3-FA23-4CF1-83A9-DCBE0B361489}"
- ProjectSection(WebsiteProperties) = preProject
- Debug.AspNetCompiler.Debug = "True"
- Release.AspNetCompiler.Debug = "False"
- EndProjectSection
- ProjectSection(ProjectDependencies) = postProject
- {19514E48-456C-4B9D-8637-F2285476461E} = {19514E48-456C-4B9D-8637-F2285476461E}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Analysis", "Analysis\Analysis.vcproj", "{0622E827-8464-489D-8B1C-B0B496F35C08}"
- ProjectSection(WebsiteProperties) = preProject
- Debug.AspNetCompiler.Debug = "True"
- Release.AspNetCompiler.Debug = "False"
- EndProjectSection
- ProjectSection(ProjectDependencies) = postProject
- {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB} = {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB}
- {19514E48-456C-4B9D-8637-F2285476461E} = {19514E48-456C-4B9D-8637-F2285476461E}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "x86", "x86\x86.vcproj", "{144EEBF6-8C9B-4473-B715-2C821666AF6C}"
- ProjectSection(WebsiteProperties) = preProject
- Debug.AspNetCompiler.Debug = "True"
- Release.AspNetCompiler.Debug = "False"
- EndProjectSection
- ProjectSection(ProjectDependencies) = postProject
- {C59374C1-9FC0-4147-B836-327DFDC52D99} = {C59374C1-9FC0-4147-B836-327DFDC52D99}
- {08CEB1BB-C2A4-4587-B9A9-AEDB8FB44897} = {08CEB1BB-C2A4-4587-B9A9-AEDB8FB44897}
- {339C2249-26B6-4172-B484-85653029AF57} = {339C2249-26B6-4172-B484-85653029AF57}
- {19514E48-456C-4B9D-8637-F2285476461E} = {19514E48-456C-4B9D-8637-F2285476461E}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Transforms", "Transforms\Transforms.vcproj", "{C59374C1-9FC0-4147-B836-327DFDC52D99}"
- ProjectSection(WebsiteProperties) = preProject
- Debug.AspNetCompiler.Debug = "True"
- Release.AspNetCompiler.Debug = "False"
- EndProjectSection
- ProjectSection(ProjectDependencies) = postProject
- {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB} = {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB}
- {339C2249-26B6-4172-B484-85653029AF57} = {339C2249-26B6-4172-B484-85653029AF57}
- {19514E48-456C-4B9D-8637-F2285476461E} = {19514E48-456C-4B9D-8637-F2285476461E}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Configure", "Configure\Configure.vcproj", "{19514E48-456C-4B9D-8637-F2285476461E}"
- ProjectSection(WebsiteProperties) = preProject
- Debug.AspNetCompiler.Debug = "True"
- Release.AspNetCompiler.Debug = "False"
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lli", "lli\lli.vcproj", "{FB6FFD68-C1E4-4DCF-AB02-36D205D5263E}"
- ProjectSection(WebsiteProperties) = preProject
- Debug.AspNetCompiler.Debug = "True"
- Release.AspNetCompiler.Debug = "False"
- EndProjectSection
- ProjectSection(ProjectDependencies) = postProject
- {144EEBF6-8C9B-4473-B715-2C821666AF6C} = {144EEBF6-8C9B-4473-B715-2C821666AF6C}
- {0F8407F3-FA23-4CF1-83A9-DCBE0B361489} = {0F8407F3-FA23-4CF1-83A9-DCBE0B361489}
- {76295AE8-A083-460E-9F80-6F2B8923264A} = {76295AE8-A083-460E-9F80-6F2B8923264A}
- {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB} = {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB}
- {08CEB1BB-C2A4-4587-B9A9-AEDB8FB44897} = {08CEB1BB-C2A4-4587-B9A9-AEDB8FB44897}
- {059FBAB8-C76D-48A0-AA75-3C57BD3EAFE4} = {059FBAB8-C76D-48A0-AA75-3C57BD3EAFE4}
- {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D62} = {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D62}
- {28AA9146-3482-4F41-9CC6-407B1D258508} = {28AA9146-3482-4F41-9CC6-407B1D258508}
- {0622E827-8464-489D-8B1C-B0B496F35C08} = {0622E827-8464-489D-8B1C-B0B496F35C08}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "llc", "llc\llc.vcproj", "{ADE86BDC-B04C-43DF-B9BB-90492C7B14AC}"
- ProjectSection(WebsiteProperties) = preProject
- Debug.AspNetCompiler.Debug = "True"
- Release.AspNetCompiler.Debug = "False"
- EndProjectSection
- ProjectSection(ProjectDependencies) = postProject
- {144EEBF6-8C9B-4473-B715-2C821666AF6C} = {144EEBF6-8C9B-4473-B715-2C821666AF6C}
- {0F8407F3-FA23-4CF1-83A9-DCBE0B361489} = {0F8407F3-FA23-4CF1-83A9-DCBE0B361489}
- {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB} = {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB}
- {057777CD-DED5-46DF-BF9A-6B76DE212549} = {057777CD-DED5-46DF-BF9A-6B76DE212549}
- {08CEB1BB-C2A4-4587-B9A9-AEDB8FB44897} = {08CEB1BB-C2A4-4587-B9A9-AEDB8FB44897}
- {059FBAB8-C76D-48A0-AA75-3C57BD3EAFE4} = {059FBAB8-C76D-48A0-AA75-3C57BD3EAFE4}
- {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D62} = {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D62}
- {28AA9146-3482-4F41-9CC6-407B1D258508} = {28AA9146-3482-4F41-9CC6-407B1D258508}
- {0622E827-8464-489D-8B1C-B0B496F35C08} = {0622E827-8464-489D-8B1C-B0B496F35C08}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "llvm-dis", "llvm-dis\llvm-dis.vcproj", "{B13476BC-30AB-4EA0-BC1E-212C0A459405}"
- ProjectSection(WebsiteProperties) = preProject
- Debug.AspNetCompiler.Debug = "True"
- Release.AspNetCompiler.Debug = "False"
- EndProjectSection
- ProjectSection(ProjectDependencies) = postProject
- {0F8407F3-FA23-4CF1-83A9-DCBE0B361489} = {0F8407F3-FA23-4CF1-83A9-DCBE0B361489}
- {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB} = {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB}
- {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D62} = {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D62}
- {19514E48-456C-4B9D-8637-F2285476461E} = {19514E48-456C-4B9D-8637-F2285476461E}
- {28AA9146-3482-4F41-9CC6-407B1D258508} = {28AA9146-3482-4F41-9CC6-407B1D258508}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "llvm-as", "llvm-as\llvm-as.vcproj", "{4FBC40A5-E626-4A6C-A9D3-FAE5C28D30CC}"
- ProjectSection(WebsiteProperties) = preProject
- Debug.AspNetCompiler.Debug = "True"
- Release.AspNetCompiler.Debug = "False"
- EndProjectSection
- ProjectSection(ProjectDependencies) = postProject
- {3DC216F5-1DDD-478A-84F8-C124E5C31982} = {3DC216F5-1DDD-478A-84F8-C124E5C31982}
- {0F8407F3-FA23-4CF1-83A9-DCBE0B361489} = {0F8407F3-FA23-4CF1-83A9-DCBE0B361489}
- {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB} = {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB}
- {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D62} = {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D62}
- {19514E48-456C-4B9D-8637-F2285476461E} = {19514E48-456C-4B9D-8637-F2285476461E}
- {28AA9146-3482-4F41-9CC6-407B1D258508} = {28AA9146-3482-4F41-9CC6-407B1D258508}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AsmParser", "AsmParser\AsmParser.vcproj", "{3DC216F5-1DDD-478A-84F8-C124E5C31982}"
- ProjectSection(WebsiteProperties) = preProject
- Debug.AspNetCompiler.Debug = "True"
- Release.AspNetCompiler.Debug = "False"
- EndProjectSection
- ProjectSection(ProjectDependencies) = postProject
- {19514E48-456C-4B9D-8637-F2285476461E} = {19514E48-456C-4B9D-8637-F2285476461E}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "llvm-ar", "llvm-ar\llvm-ar.vcproj", "{0FF2B75C-49C1-4B49-A44A-531C93000296}"
- ProjectSection(WebsiteProperties) = preProject
- Debug.AspNetCompiler.Debug = "True"
- Release.AspNetCompiler.Debug = "False"
- EndProjectSection
- ProjectSection(ProjectDependencies) = postProject
- {0F8407F3-FA23-4CF1-83A9-DCBE0B361489} = {0F8407F3-FA23-4CF1-83A9-DCBE0B361489}
- {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB} = {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB}
- {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D62} = {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D62}
- {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D61} = {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D61}
- {19514E48-456C-4B9D-8637-F2285476461E} = {19514E48-456C-4B9D-8637-F2285476461E}
- {28AA9146-3482-4F41-9CC6-407B1D258508} = {28AA9146-3482-4F41-9CC6-407B1D258508}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "llvm-ranlib", "llvm-ranlib\llvm-ranlib.vcproj", "{BB16C7EE-B4ED-4714-B5ED-B775C62A6612}"
- ProjectSection(WebsiteProperties) = preProject
- Debug.AspNetCompiler.Debug = "True"
- Release.AspNetCompiler.Debug = "False"
- EndProjectSection
- ProjectSection(ProjectDependencies) = postProject
- {0F8407F3-FA23-4CF1-83A9-DCBE0B361489} = {0F8407F3-FA23-4CF1-83A9-DCBE0B361489}
- {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB} = {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB}
- {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D62} = {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D62}
- {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D61} = {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D61}
- {19514E48-456C-4B9D-8637-F2285476461E} = {19514E48-456C-4B9D-8637-F2285476461E}
- {28AA9146-3482-4F41-9CC6-407B1D258508} = {28AA9146-3482-4F41-9CC6-407B1D258508}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "llvm-link", "llvm-link\llvm-link.vcproj", "{5E249789-49E1-4600-B12B-8AD2BB6439B2}"
- ProjectSection(WebsiteProperties) = preProject
- Debug.AspNetCompiler.Debug = "True"
- Release.AspNetCompiler.Debug = "False"
- EndProjectSection
- ProjectSection(ProjectDependencies) = postProject
- {0F8407F3-FA23-4CF1-83A9-DCBE0B361489} = {0F8407F3-FA23-4CF1-83A9-DCBE0B361489}
- {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB} = {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB}
- {342CF48F-760A-4040-A9A1-7D75AA2471CE} = {342CF48F-760A-4040-A9A1-7D75AA2471CE}
- {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D62} = {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D62}
- {19514E48-456C-4B9D-8637-F2285476461E} = {19514E48-456C-4B9D-8637-F2285476461E}
- {28AA9146-3482-4F41-9CC6-407B1D258508} = {28AA9146-3482-4F41-9CC6-407B1D258508}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Linker", "Linker\Linker.vcproj", "{342CF48F-760A-4040-A9A1-7D75AA2471CE}"
- ProjectSection(WebsiteProperties) = preProject
- Debug.AspNetCompiler.Debug = "True"
- Release.AspNetCompiler.Debug = "False"
- EndProjectSection
- ProjectSection(ProjectDependencies) = postProject
- {0F8407F3-FA23-4CF1-83A9-DCBE0B361489} = {0F8407F3-FA23-4CF1-83A9-DCBE0B361489}
- {19514E48-456C-4B9D-8637-F2285476461E} = {19514E48-456C-4B9D-8637-F2285476461E}
- {28AA9146-3482-4F41-9CC6-407B1D258508} = {28AA9146-3482-4F41-9CC6-407B1D258508}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CBackend", "CBackend\CBackend.vcproj", "{057777CD-DED5-46DF-BF9A-6B76DE212549}"
- ProjectSection(WebsiteProperties) = preProject
- Debug.AspNetCompiler.Debug = "True"
- Release.AspNetCompiler.Debug = "False"
- EndProjectSection
- ProjectSection(ProjectDependencies) = postProject
- {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB} = {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB}
- {19514E48-456C-4B9D-8637-F2285476461E} = {19514E48-456C-4B9D-8637-F2285476461E}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "opt", "opt\opt.vcproj", "{006D8B41-C3C7-4448-85E1-AF8907E591E5}"
- ProjectSection(WebsiteProperties) = preProject
- Debug.AspNetCompiler.Debug = "True"
- Release.AspNetCompiler.Debug = "False"
- EndProjectSection
- ProjectSection(ProjectDependencies) = postProject
- {0F8407F3-FA23-4CF1-83A9-DCBE0B361489} = {0F8407F3-FA23-4CF1-83A9-DCBE0B361489}
- {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB} = {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB}
- {C59374C1-9FC0-4147-B836-327DFDC52D99} = {C59374C1-9FC0-4147-B836-327DFDC52D99}
- {059FBAB8-C76D-48A0-AA75-3C57BD3EAFE4} = {059FBAB8-C76D-48A0-AA75-3C57BD3EAFE4}
- {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D62} = {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D62}
- {19514E48-456C-4B9D-8637-F2285476461E} = {19514E48-456C-4B9D-8637-F2285476461E}
- {28AA9146-3482-4F41-9CC6-407B1D258508} = {28AA9146-3482-4F41-9CC6-407B1D258508}
- {0622E827-8464-489D-8B1C-B0B496F35C08} = {0622E827-8464-489D-8B1C-B0B496F35C08}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "llvm-bcanalyzer", "llvm-bcanalyzer\llvm-bcanalyzer.vcproj", "{E0B1E329-BE3E-456D-B372-5F397BE42C84}"
- ProjectSection(WebsiteProperties) = preProject
- Debug.AspNetCompiler.Debug = "True"
- Release.AspNetCompiler.Debug = "False"
- EndProjectSection
- ProjectSection(ProjectDependencies) = postProject
- {0F8407F3-FA23-4CF1-83A9-DCBE0B361489} = {0F8407F3-FA23-4CF1-83A9-DCBE0B361489}
- {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB} = {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB}
- {19514E48-456C-4B9D-8637-F2285476461E} = {19514E48-456C-4B9D-8637-F2285476461E}
- {28AA9146-3482-4F41-9CC6-407B1D258508} = {28AA9146-3482-4F41-9CC6-407B1D258508}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "llvm-ld", "llvm-ld\llvm-ld.vcproj", "{64D8AA46-88DB-41F4-B837-053AE02406B8}"
- ProjectSection(WebsiteProperties) = preProject
- Debug.AspNetCompiler.Debug = "True"
- Release.AspNetCompiler.Debug = "False"
- EndProjectSection
- ProjectSection(ProjectDependencies) = postProject
- {0F8407F3-FA23-4CF1-83A9-DCBE0B361489} = {0F8407F3-FA23-4CF1-83A9-DCBE0B361489}
- {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB} = {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB}
- {C59374C1-9FC0-4147-B836-327DFDC52D99} = {C59374C1-9FC0-4147-B836-327DFDC52D99}
- {059FBAB8-C76D-48A0-AA75-3C57BD3EAFE4} = {059FBAB8-C76D-48A0-AA75-3C57BD3EAFE4}
- {342CF48F-760A-4040-A9A1-7D75AA2471CE} = {342CF48F-760A-4040-A9A1-7D75AA2471CE}
- {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D62} = {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D62}
- {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D61} = {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D61}
- {19514E48-456C-4B9D-8637-F2285476461E} = {19514E48-456C-4B9D-8637-F2285476461E}
- {28AA9146-3482-4F41-9CC6-407B1D258508} = {28AA9146-3482-4F41-9CC6-407B1D258508}
- {0622E827-8464-489D-8B1C-B0B496F35C08} = {0622E827-8464-489D-8B1C-B0B496F35C08}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "llvm-nm", "llvm-nm\llvm-nm.vcproj", "{5FF862CE-80A0-4B48-A80B-68AE325A0432}"
- ProjectSection(WebsiteProperties) = preProject
- Debug.AspNetCompiler.Debug = "True"
- Release.AspNetCompiler.Debug = "False"
- EndProjectSection
- ProjectSection(ProjectDependencies) = postProject
- {0F8407F3-FA23-4CF1-83A9-DCBE0B361489} = {0F8407F3-FA23-4CF1-83A9-DCBE0B361489}
- {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB} = {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB}
- {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D62} = {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D62}
- {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D61} = {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D61}
- {19514E48-456C-4B9D-8637-F2285476461E} = {19514E48-456C-4B9D-8637-F2285476461E}
- {28AA9146-3482-4F41-9CC6-407B1D258508} = {28AA9146-3482-4F41-9CC6-407B1D258508}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "llvm-prof", "llvm-prof\llvm-prof.vcproj", "{ACBE81D9-64B1-4133-823A-807A4E60B454}"
- ProjectSection(WebsiteProperties) = preProject
- Debug.AspNetCompiler.Debug = "True"
- Release.AspNetCompiler.Debug = "False"
- EndProjectSection
- ProjectSection(ProjectDependencies) = postProject
- {0F8407F3-FA23-4CF1-83A9-DCBE0B361489} = {0F8407F3-FA23-4CF1-83A9-DCBE0B361489}
- {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB} = {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB}
- {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D62} = {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D62}
- {19514E48-456C-4B9D-8637-F2285476461E} = {19514E48-456C-4B9D-8637-F2285476461E}
- {28AA9146-3482-4F41-9CC6-407B1D258508} = {28AA9146-3482-4F41-9CC6-407B1D258508}
- {0622E827-8464-489D-8B1C-B0B496F35C08} = {0622E827-8464-489D-8B1C-B0B496F35C08}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "bugpoint", "bugpoint\bugpoint.vcproj", "{57249192-8E29-4D85-8B7A-FEFF1760B1DA}"
- ProjectSection(WebsiteProperties) = preProject
- Debug.AspNetCompiler.Debug = "True"
- Release.AspNetCompiler.Debug = "False"
- EndProjectSection
- ProjectSection(ProjectDependencies) = postProject
- {3DC216F5-1DDD-478A-84F8-C124E5C31982} = {3DC216F5-1DDD-478A-84F8-C124E5C31982}
- {0F8407F3-FA23-4CF1-83A9-DCBE0B361489} = {0F8407F3-FA23-4CF1-83A9-DCBE0B361489}
- {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB} = {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB}
- {C59374C1-9FC0-4147-B836-327DFDC52D99} = {C59374C1-9FC0-4147-B836-327DFDC52D99}
- {059FBAB8-C76D-48A0-AA75-3C57BD3EAFE4} = {059FBAB8-C76D-48A0-AA75-3C57BD3EAFE4}
- {342CF48F-760A-4040-A9A1-7D75AA2471CE} = {342CF48F-760A-4040-A9A1-7D75AA2471CE}
- {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D62} = {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D62}
- {19514E48-456C-4B9D-8637-F2285476461E} = {19514E48-456C-4B9D-8637-F2285476461E}
- {28AA9146-3482-4F41-9CC6-407B1D258508} = {28AA9146-3482-4F41-9CC6-407B1D258508}
- {0622E827-8464-489D-8B1C-B0B496F35C08} = {0622E827-8464-489D-8B1C-B0B496F35C08}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Bitcode", "Bitcode\Bitcode.vcproj", "{F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D62}"
- ProjectSection(WebsiteProperties) = preProject
- Debug.AspNetCompiler.Debug = "True"
- Release.AspNetCompiler.Debug = "False"
- EndProjectSection
- ProjectSection(ProjectDependencies) = postProject
- {28AA9146-3482-4F41-9CC6-407B1D258508} = {28AA9146-3482-4F41-9CC6-407B1D258508}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Archive", "Archive\Archive.vcproj", "{F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D61}"
- ProjectSection(WebsiteProperties) = preProject
- Debug.AspNetCompiler.Debug = "True"
- Release.AspNetCompiler.Debug = "False"
- EndProjectSection
- ProjectSection(ProjectDependencies) = postProject
- {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB} = {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB}
- {19514E48-456C-4B9D-8637-F2285476461E} = {19514E48-456C-4B9D-8637-F2285476461E}
- EndProjectSection
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Configure|Win32 = Configure|Win32
- Configure|x64 = Configure|x64
- Debug|Win32 = Debug|Win32
- Debug|x64 = Debug|x64
- Release|Win32 = Release|Win32
- Release|x64 = Release|x64
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {28AA9146-3482-4F41-9CC6-407B1D258508}.Configure|Win32.ActiveCfg = Release|Win32
- {28AA9146-3482-4F41-9CC6-407B1D258508}.Configure|Win32.Build.0 = Release|Win32
- {28AA9146-3482-4F41-9CC6-407B1D258508}.Configure|x64.ActiveCfg = Release|Win32
- {28AA9146-3482-4F41-9CC6-407B1D258508}.Debug|Win32.ActiveCfg = Debug|Win32
- {28AA9146-3482-4F41-9CC6-407B1D258508}.Debug|Win32.Build.0 = Debug|Win32
- {28AA9146-3482-4F41-9CC6-407B1D258508}.Debug|x64.ActiveCfg = Debug|x64
- {28AA9146-3482-4F41-9CC6-407B1D258508}.Debug|x64.Build.0 = Debug|x64
- {28AA9146-3482-4F41-9CC6-407B1D258508}.Release|Win32.ActiveCfg = Release|Win32
- {28AA9146-3482-4F41-9CC6-407B1D258508}.Release|Win32.Build.0 = Release|Win32
- {28AA9146-3482-4F41-9CC6-407B1D258508}.Release|x64.ActiveCfg = Release|x64
- {28AA9146-3482-4F41-9CC6-407B1D258508}.Release|x64.Build.0 = Release|x64
- {339C2249-26B6-4172-B484-85653029AF57}.Configure|Win32.ActiveCfg = Release|Win32
- {339C2249-26B6-4172-B484-85653029AF57}.Configure|Win32.Build.0 = Release|Win32
- {339C2249-26B6-4172-B484-85653029AF57}.Configure|x64.ActiveCfg = Release|Win32
- {339C2249-26B6-4172-B484-85653029AF57}.Debug|Win32.ActiveCfg = Debug|Win32
- {339C2249-26B6-4172-B484-85653029AF57}.Debug|Win32.Build.0 = Debug|Win32
- {339C2249-26B6-4172-B484-85653029AF57}.Debug|x64.ActiveCfg = Debug|x64
- {339C2249-26B6-4172-B484-85653029AF57}.Debug|x64.Build.0 = Debug|x64
- {339C2249-26B6-4172-B484-85653029AF57}.Release|Win32.ActiveCfg = Release|Win32
- {339C2249-26B6-4172-B484-85653029AF57}.Release|Win32.Build.0 = Release|Win32
- {339C2249-26B6-4172-B484-85653029AF57}.Release|x64.ActiveCfg = Release|x64
- {339C2249-26B6-4172-B484-85653029AF57}.Release|x64.Build.0 = Release|x64
- {48FB551D-E37E-42EC-BC97-FF7219774867}.Configure|Win32.ActiveCfg = Release|Win32
- {48FB551D-E37E-42EC-BC97-FF7219774867}.Configure|Win32.Build.0 = Release|Win32
- {48FB551D-E37E-42EC-BC97-FF7219774867}.Configure|x64.ActiveCfg = Release|Win32
- {48FB551D-E37E-42EC-BC97-FF7219774867}.Debug|Win32.ActiveCfg = Debug|Win32
- {48FB551D-E37E-42EC-BC97-FF7219774867}.Debug|Win32.Build.0 = Debug|Win32
- {48FB551D-E37E-42EC-BC97-FF7219774867}.Debug|x64.ActiveCfg = Debug|x64
- {48FB551D-E37E-42EC-BC97-FF7219774867}.Debug|x64.Build.0 = Debug|x64
- {48FB551D-E37E-42EC-BC97-FF7219774867}.Release|Win32.ActiveCfg = Release|Win32
- {48FB551D-E37E-42EC-BC97-FF7219774867}.Release|Win32.Build.0 = Release|Win32
- {48FB551D-E37E-42EC-BC97-FF7219774867}.Release|x64.ActiveCfg = Release|x64
- {48FB551D-E37E-42EC-BC97-FF7219774867}.Release|x64.Build.0 = Release|x64
- {76295AE8-A083-460E-9F80-6F2B8923264A}.Configure|Win32.ActiveCfg = Release|Win32
- {76295AE8-A083-460E-9F80-6F2B8923264A}.Configure|Win32.Build.0 = Release|Win32
- {76295AE8-A083-460E-9F80-6F2B8923264A}.Configure|x64.ActiveCfg = Release|Win32
- {76295AE8-A083-460E-9F80-6F2B8923264A}.Debug|Win32.ActiveCfg = Debug|Win32
- {76295AE8-A083-460E-9F80-6F2B8923264A}.Debug|Win32.Build.0 = Debug|Win32
- {76295AE8-A083-460E-9F80-6F2B8923264A}.Debug|x64.ActiveCfg = Debug|x64
- {76295AE8-A083-460E-9F80-6F2B8923264A}.Debug|x64.Build.0 = Debug|x64
- {76295AE8-A083-460E-9F80-6F2B8923264A}.Release|Win32.ActiveCfg = Release|Win32
- {76295AE8-A083-460E-9F80-6F2B8923264A}.Release|Win32.Build.0 = Release|Win32
- {76295AE8-A083-460E-9F80-6F2B8923264A}.Release|x64.ActiveCfg = Release|x64
- {76295AE8-A083-460E-9F80-6F2B8923264A}.Release|x64.Build.0 = Release|x64
- {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB}.Configure|Win32.ActiveCfg = Release|Win32
- {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB}.Configure|Win32.Build.0 = Release|Win32
- {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB}.Configure|x64.ActiveCfg = Release|Win32
- {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB}.Debug|Win32.ActiveCfg = Debug|Win32
- {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB}.Debug|Win32.Build.0 = Debug|Win32
- {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB}.Debug|x64.ActiveCfg = Debug|x64
- {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB}.Debug|x64.Build.0 = Debug|x64
- {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB}.Release|Win32.ActiveCfg = Release|Win32
- {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB}.Release|Win32.Build.0 = Release|Win32
- {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB}.Release|x64.ActiveCfg = Release|x64
- {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB}.Release|x64.Build.0 = Release|x64
- {059FBAB8-C76D-48A0-AA75-3C57BD3EAFE4}.Configure|Win32.ActiveCfg = Release|Win32
- {059FBAB8-C76D-48A0-AA75-3C57BD3EAFE4}.Configure|Win32.Build.0 = Release|Win32
- {059FBAB8-C76D-48A0-AA75-3C57BD3EAFE4}.Configure|x64.ActiveCfg = Release|Win32
- {059FBAB8-C76D-48A0-AA75-3C57BD3EAFE4}.Debug|Win32.ActiveCfg = Debug|Win32
- {059FBAB8-C76D-48A0-AA75-3C57BD3EAFE4}.Debug|Win32.Build.0 = Debug|Win32
- {059FBAB8-C76D-48A0-AA75-3C57BD3EAFE4}.Debug|x64.ActiveCfg = Debug|x64
- {059FBAB8-C76D-48A0-AA75-3C57BD3EAFE4}.Debug|x64.Build.0 = Debug|x64
- {059FBAB8-C76D-48A0-AA75-3C57BD3EAFE4}.Release|Win32.ActiveCfg = Release|Win32
- {059FBAB8-C76D-48A0-AA75-3C57BD3EAFE4}.Release|Win32.Build.0 = Release|Win32
- {059FBAB8-C76D-48A0-AA75-3C57BD3EAFE4}.Release|x64.ActiveCfg = Release|x64
- {059FBAB8-C76D-48A0-AA75-3C57BD3EAFE4}.Release|x64.Build.0 = Release|x64
- {08CEB1BB-C2A4-4587-B9A9-AEDB8FB44897}.Configure|Win32.ActiveCfg = Release|Win32
- {08CEB1BB-C2A4-4587-B9A9-AEDB8FB44897}.Configure|Win32.Build.0 = Release|Win32
- {08CEB1BB-C2A4-4587-B9A9-AEDB8FB44897}.Configure|x64.ActiveCfg = Release|Win32
- {08CEB1BB-C2A4-4587-B9A9-AEDB8FB44897}.Debug|Win32.ActiveCfg = Debug|Win32
- {08CEB1BB-C2A4-4587-B9A9-AEDB8FB44897}.Debug|Win32.Build.0 = Debug|Win32
- {08CEB1BB-C2A4-4587-B9A9-AEDB8FB44897}.Debug|x64.ActiveCfg = Debug|x64
- {08CEB1BB-C2A4-4587-B9A9-AEDB8FB44897}.Debug|x64.Build.0 = Debug|x64
- {08CEB1BB-C2A4-4587-B9A9-AEDB8FB44897}.Release|Win32.ActiveCfg = Release|Win32
- {08CEB1BB-C2A4-4587-B9A9-AEDB8FB44897}.Release|Win32.Build.0 = Release|Win32
- {08CEB1BB-C2A4-4587-B9A9-AEDB8FB44897}.Release|x64.ActiveCfg = Release|x64
- {08CEB1BB-C2A4-4587-B9A9-AEDB8FB44897}.Release|x64.Build.0 = Release|x64
- {0F8407F3-FA23-4CF1-83A9-DCBE0B361489}.Configure|Win32.ActiveCfg = Release|Win32
- {0F8407F3-FA23-4CF1-83A9-DCBE0B361489}.Configure|Win32.Build.0 = Release|Win32
- {0F8407F3-FA23-4CF1-83A9-DCBE0B361489}.Configure|x64.ActiveCfg = Release|Win32
- {0F8407F3-FA23-4CF1-83A9-DCBE0B361489}.Debug|Win32.ActiveCfg = Debug|Win32
- {0F8407F3-FA23-4CF1-83A9-DCBE0B361489}.Debug|Win32.Build.0 = Debug|Win32
- {0F8407F3-FA23-4CF1-83A9-DCBE0B361489}.Debug|x64.ActiveCfg = Debug|x64
- {0F8407F3-FA23-4CF1-83A9-DCBE0B361489}.Debug|x64.Build.0 = Debug|x64
- {0F8407F3-FA23-4CF1-83A9-DCBE0B361489}.Release|Win32.ActiveCfg = Release|Win32
- {0F8407F3-FA23-4CF1-83A9-DCBE0B361489}.Release|Win32.Build.0 = Release|Win32
- {0F8407F3-FA23-4CF1-83A9-DCBE0B361489}.Release|x64.ActiveCfg = Release|x64
- {0F8407F3-FA23-4CF1-83A9-DCBE0B361489}.Release|x64.Build.0 = Release|x64
- {0622E827-8464-489D-8B1C-B0B496F35C08}.Configure|Win32.ActiveCfg = Release|Win32
- {0622E827-8464-489D-8B1C-B0B496F35C08}.Configure|Win32.Build.0 = Release|Win32
- {0622E827-8464-489D-8B1C-B0B496F35C08}.Configure|x64.ActiveCfg = Release|Win32
- {0622E827-8464-489D-8B1C-B0B496F35C08}.Debug|Win32.ActiveCfg = Debug|Win32
- {0622E827-8464-489D-8B1C-B0B496F35C08}.Debug|Win32.Build.0 = Debug|Win32
- {0622E827-8464-489D-8B1C-B0B496F35C08}.Debug|x64.ActiveCfg = Debug|x64
- {0622E827-8464-489D-8B1C-B0B496F35C08}.Debug|x64.Build.0 = Debug|x64
- {0622E827-8464-489D-8B1C-B0B496F35C08}.Release|Win32.ActiveCfg = Release|Win32
- {0622E827-8464-489D-8B1C-B0B496F35C08}.Release|Win32.Build.0 = Release|Win32
- {0622E827-8464-489D-8B1C-B0B496F35C08}.Release|x64.ActiveCfg = Release|x64
- {0622E827-8464-489D-8B1C-B0B496F35C08}.Release|x64.Build.0 = Release|x64
- {144EEBF6-8C9B-4473-B715-2C821666AF6C}.Configure|Win32.ActiveCfg = Release|Win32
- {144EEBF6-8C9B-4473-B715-2C821666AF6C}.Configure|Win32.Build.0 = Release|Win32
- {144EEBF6-8C9B-4473-B715-2C821666AF6C}.Configure|x64.ActiveCfg = Release|Win32
- {144EEBF6-8C9B-4473-B715-2C821666AF6C}.Debug|Win32.ActiveCfg = Debug|Win32
- {144EEBF6-8C9B-4473-B715-2C821666AF6C}.Debug|Win32.Build.0 = Debug|Win32
- {144EEBF6-8C9B-4473-B715-2C821666AF6C}.Debug|x64.ActiveCfg = Debug|x64
- {144EEBF6-8C9B-4473-B715-2C821666AF6C}.Debug|x64.Build.0 = Debug|x64
- {144EEBF6-8C9B-4473-B715-2C821666AF6C}.Release|Win32.ActiveCfg = Release|Win32
- {144EEBF6-8C9B-4473-B715-2C821666AF6C}.Release|Win32.Build.0 = Release|Win32
- {144EEBF6-8C9B-4473-B715-2C821666AF6C}.Release|x64.ActiveCfg = Release|x64
- {144EEBF6-8C9B-4473-B715-2C821666AF6C}.Release|x64.Build.0 = Release|x64
- {C59374C1-9FC0-4147-B836-327DFDC52D99}.Configure|Win32.ActiveCfg = Release|Win32
- {C59374C1-9FC0-4147-B836-327DFDC52D99}.Configure|Win32.Build.0 = Release|Win32
- {C59374C1-9FC0-4147-B836-327DFDC52D99}.Configure|x64.ActiveCfg = Release|Win32
- {C59374C1-9FC0-4147-B836-327DFDC52D99}.Debug|Win32.ActiveCfg = Debug|Win32
- {C59374C1-9FC0-4147-B836-327DFDC52D99}.Debug|Win32.Build.0 = Debug|Win32
- {C59374C1-9FC0-4147-B836-327DFDC52D99}.Debug|x64.ActiveCfg = Debug|x64
- {C59374C1-9FC0-4147-B836-327DFDC52D99}.Debug|x64.Build.0 = Debug|x64
- {C59374C1-9FC0-4147-B836-327DFDC52D99}.Release|Win32.ActiveCfg = Release|Win32
- {C59374C1-9FC0-4147-B836-327DFDC52D99}.Release|Win32.Build.0 = Release|Win32
- {C59374C1-9FC0-4147-B836-327DFDC52D99}.Release|x64.ActiveCfg = Release|x64
- {C59374C1-9FC0-4147-B836-327DFDC52D99}.Release|x64.Build.0 = Release|x64
- {19514E48-456C-4B9D-8637-F2285476461E}.Configure|Win32.ActiveCfg = Configure|Win32
- {19514E48-456C-4B9D-8637-F2285476461E}.Configure|Win32.Build.0 = Configure|Win32
- {19514E48-456C-4B9D-8637-F2285476461E}.Configure|x64.ActiveCfg = Configure|Win32
- {19514E48-456C-4B9D-8637-F2285476461E}.Debug|Win32.ActiveCfg = Configure|Win32
- {19514E48-456C-4B9D-8637-F2285476461E}.Debug|Win32.Build.0 = Configure|Win32
- {19514E48-456C-4B9D-8637-F2285476461E}.Debug|x64.ActiveCfg = Configure|x64
- {19514E48-456C-4B9D-8637-F2285476461E}.Debug|x64.Build.0 = Configure|x64
- {19514E48-456C-4B9D-8637-F2285476461E}.Release|Win32.ActiveCfg = Configure|Win32
- {19514E48-456C-4B9D-8637-F2285476461E}.Release|Win32.Build.0 = Configure|Win32
- {19514E48-456C-4B9D-8637-F2285476461E}.Release|x64.ActiveCfg = Configure|x64
- {19514E48-456C-4B9D-8637-F2285476461E}.Release|x64.Build.0 = Configure|x64
- {FB6FFD68-C1E4-4DCF-AB02-36D205D5263E}.Configure|Win32.ActiveCfg = Release|Win32
- {FB6FFD68-C1E4-4DCF-AB02-36D205D5263E}.Configure|Win32.Build.0 = Release|Win32
- {FB6FFD68-C1E4-4DCF-AB02-36D205D5263E}.Configure|x64.ActiveCfg = Release|Win32
- {FB6FFD68-C1E4-4DCF-AB02-36D205D5263E}.Debug|Win32.ActiveCfg = Debug|Win32
- {FB6FFD68-C1E4-4DCF-AB02-36D205D5263E}.Debug|Win32.Build.0 = Debug|Win32
- {FB6FFD68-C1E4-4DCF-AB02-36D205D5263E}.Debug|x64.ActiveCfg = Debug|x64
- {FB6FFD68-C1E4-4DCF-AB02-36D205D5263E}.Debug|x64.Build.0 = Debug|x64
- {FB6FFD68-C1E4-4DCF-AB02-36D205D5263E}.Release|Win32.ActiveCfg = Release|Win32
- {FB6FFD68-C1E4-4DCF-AB02-36D205D5263E}.Release|Win32.Build.0 = Release|Win32
- {FB6FFD68-C1E4-4DCF-AB02-36D205D5263E}.Release|x64.ActiveCfg = Release|x64
- {FB6FFD68-C1E4-4DCF-AB02-36D205D5263E}.Release|x64.Build.0 = Release|x64
- {ADE86BDC-B04C-43DF-B9BB-90492C7B14AC}.Configure|Win32.ActiveCfg = Release|Win32
- {ADE86BDC-B04C-43DF-B9BB-90492C7B14AC}.Configure|Win32.Build.0 = Release|Win32
- {ADE86BDC-B04C-43DF-B9BB-90492C7B14AC}.Configure|x64.ActiveCfg = Release|Win32
- {ADE86BDC-B04C-43DF-B9BB-90492C7B14AC}.Debug|Win32.ActiveCfg = Debug|Win32
- {ADE86BDC-B04C-43DF-B9BB-90492C7B14AC}.Debug|Win32.Build.0 = Debug|Win32
- {ADE86BDC-B04C-43DF-B9BB-90492C7B14AC}.Debug|x64.ActiveCfg = Debug|x64
- {ADE86BDC-B04C-43DF-B9BB-90492C7B14AC}.Debug|x64.Build.0 = Debug|x64
- {ADE86BDC-B04C-43DF-B9BB-90492C7B14AC}.Release|Win32.ActiveCfg = Release|Win32
- {ADE86BDC-B04C-43DF-B9BB-90492C7B14AC}.Release|Win32.Build.0 = Release|Win32
- {ADE86BDC-B04C-43DF-B9BB-90492C7B14AC}.Release|x64.ActiveCfg = Release|x64
- {ADE86BDC-B04C-43DF-B9BB-90492C7B14AC}.Release|x64.Build.0 = Release|x64
- {B13476BC-30AB-4EA0-BC1E-212C0A459405}.Configure|Win32.ActiveCfg = Release|Win32
- {B13476BC-30AB-4EA0-BC1E-212C0A459405}.Configure|Win32.Build.0 = Release|Win32
- {B13476BC-30AB-4EA0-BC1E-212C0A459405}.Configure|x64.ActiveCfg = Release|Win32
- {B13476BC-30AB-4EA0-BC1E-212C0A459405}.Debug|Win32.ActiveCfg = Debug|Win32
- {B13476BC-30AB-4EA0-BC1E-212C0A459405}.Debug|Win32.Build.0 = Debug|Win32
- {B13476BC-30AB-4EA0-BC1E-212C0A459405}.Debug|x64.ActiveCfg = Debug|x64
- {B13476BC-30AB-4EA0-BC1E-212C0A459405}.Debug|x64.Build.0 = Debug|x64
- {B13476BC-30AB-4EA0-BC1E-212C0A459405}.Release|Win32.ActiveCfg = Release|Win32
- {B13476BC-30AB-4EA0-BC1E-212C0A459405}.Release|Win32.Build.0 = Release|Win32
- {B13476BC-30AB-4EA0-BC1E-212C0A459405}.Release|x64.ActiveCfg = Release|x64
- {B13476BC-30AB-4EA0-BC1E-212C0A459405}.Release|x64.Build.0 = Release|x64
- {4FBC40A5-E626-4A6C-A9D3-FAE5C28D30CC}.Configure|Win32.ActiveCfg = Release|Win32
- {4FBC40A5-E626-4A6C-A9D3-FAE5C28D30CC}.Configure|Win32.Build.0 = Release|Win32
- {4FBC40A5-E626-4A6C-A9D3-FAE5C28D30CC}.Configure|x64.ActiveCfg = Release|Win32
- {4FBC40A5-E626-4A6C-A9D3-FAE5C28D30CC}.Debug|Win32.ActiveCfg = Debug|Win32
- {4FBC40A5-E626-4A6C-A9D3-FAE5C28D30CC}.Debug|Win32.Build.0 = Debug|Win32
- {4FBC40A5-E626-4A6C-A9D3-FAE5C28D30CC}.Debug|x64.ActiveCfg = Debug|x64
- {4FBC40A5-E626-4A6C-A9D3-FAE5C28D30CC}.Debug|x64.Build.0 = Debug|x64
- {4FBC40A5-E626-4A6C-A9D3-FAE5C28D30CC}.Release|Win32.ActiveCfg = Release|Win32
- {4FBC40A5-E626-4A6C-A9D3-FAE5C28D30CC}.Release|Win32.Build.0 = Release|Win32
- {4FBC40A5-E626-4A6C-A9D3-FAE5C28D30CC}.Release|x64.ActiveCfg = Release|x64
- {4FBC40A5-E626-4A6C-A9D3-FAE5C28D30CC}.Release|x64.Build.0 = Release|x64
- {3DC216F5-1DDD-478A-84F8-C124E5C31982}.Configure|Win32.ActiveCfg = Release|Win32
- {3DC216F5-1DDD-478A-84F8-C124E5C31982}.Configure|Win32.Build.0 = Release|Win32
- {3DC216F5-1DDD-478A-84F8-C124E5C31982}.Configure|x64.ActiveCfg = Release|Win32
- {3DC216F5-1DDD-478A-84F8-C124E5C31982}.Debug|Win32.ActiveCfg = Debug|Win32
- {3DC216F5-1DDD-478A-84F8-C124E5C31982}.Debug|Win32.Build.0 = Debug|Win32
- {3DC216F5-1DDD-478A-84F8-C124E5C31982}.Debug|x64.ActiveCfg = Debug|x64
- {3DC216F5-1DDD-478A-84F8-C124E5C31982}.Debug|x64.Build.0 = Debug|x64
- {3DC216F5-1DDD-478A-84F8-C124E5C31982}.Release|Win32.ActiveCfg = Release|Win32
- {3DC216F5-1DDD-478A-84F8-C124E5C31982}.Release|Win32.Build.0 = Release|Win32
- {3DC216F5-1DDD-478A-84F8-C124E5C31982}.Release|x64.ActiveCfg = Release|x64
- {3DC216F5-1DDD-478A-84F8-C124E5C31982}.Release|x64.Build.0 = Release|x64
- {0FF2B75C-49C1-4B49-A44A-531C93000296}.Configure|Win32.ActiveCfg = Release|Win32
- {0FF2B75C-49C1-4B49-A44A-531C93000296}.Configure|Win32.Build.0 = Release|Win32
- {0FF2B75C-49C1-4B49-A44A-531C93000296}.Configure|x64.ActiveCfg = Release|Win32
- {0FF2B75C-49C1-4B49-A44A-531C93000296}.Debug|Win32.ActiveCfg = Debug|Win32
- {0FF2B75C-49C1-4B49-A44A-531C93000296}.Debug|Win32.Build.0 = Debug|Win32
- {0FF2B75C-49C1-4B49-A44A-531C93000296}.Debug|x64.ActiveCfg = Debug|x64
- {0FF2B75C-49C1-4B49-A44A-531C93000296}.Debug|x64.Build.0 = Debug|x64
- {0FF2B75C-49C1-4B49-A44A-531C93000296}.Release|Win32.ActiveCfg = Release|Win32
- {0FF2B75C-49C1-4B49-A44A-531C93000296}.Release|Win32.Build.0 = Release|Win32
- {0FF2B75C-49C1-4B49-A44A-531C93000296}.Release|x64.ActiveCfg = Release|x64
- {0FF2B75C-49C1-4B49-A44A-531C93000296}.Release|x64.Build.0 = Release|x64
- {BB16C7EE-B4ED-4714-B5ED-B775C62A6612}.Configure|Win32.ActiveCfg = Release|Win32
- {BB16C7EE-B4ED-4714-B5ED-B775C62A6612}.Configure|Win32.Build.0 = Release|Win32
- {BB16C7EE-B4ED-4714-B5ED-B775C62A6612}.Configure|x64.ActiveCfg = Release|Win32
- {BB16C7EE-B4ED-4714-B5ED-B775C62A6612}.Debug|Win32.ActiveCfg = Debug|Win32
- {BB16C7EE-B4ED-4714-B5ED-B775C62A6612}.Debug|Win32.Build.0 = Debug|Win32
- {BB16C7EE-B4ED-4714-B5ED-B775C62A6612}.Debug|x64.ActiveCfg = Debug|x64
- {BB16C7EE-B4ED-4714-B5ED-B775C62A6612}.Debug|x64.Build.0 = Debug|x64
- {BB16C7EE-B4ED-4714-B5ED-B775C62A6612}.Release|Win32.ActiveCfg = Release|Win32
- {BB16C7EE-B4ED-4714-B5ED-B775C62A6612}.Release|Win32.Build.0 = Release|Win32
- {BB16C7EE-B4ED-4714-B5ED-B775C62A6612}.Release|x64.ActiveCfg = Release|x64
- {BB16C7EE-B4ED-4714-B5ED-B775C62A6612}.Release|x64.Build.0 = Release|x64
- {5E249789-49E1-4600-B12B-8AD2BB6439B2}.Configure|Win32.ActiveCfg = Release|Win32
- {5E249789-49E1-4600-B12B-8AD2BB6439B2}.Configure|Win32.Build.0 = Release|Win32
- {5E249789-49E1-4600-B12B-8AD2BB6439B2}.Configure|x64.ActiveCfg = Release|Win32
- {5E249789-49E1-4600-B12B-8AD2BB6439B2}.Debug|Win32.ActiveCfg = Debug|Win32
- {5E249789-49E1-4600-B12B-8AD2BB6439B2}.Debug|Win32.Build.0 = Debug|Win32
- {5E249789-49E1-4600-B12B-8AD2BB6439B2}.Debug|x64.ActiveCfg = Debug|x64
- {5E249789-49E1-4600-B12B-8AD2BB6439B2}.Debug|x64.Build.0 = Debug|x64
- {5E249789-49E1-4600-B12B-8AD2BB6439B2}.Release|Win32.ActiveCfg = Release|Win32
- {5E249789-49E1-4600-B12B-8AD2BB6439B2}.Release|Win32.Build.0 = Release|Win32
- {5E249789-49E1-4600-B12B-8AD2BB6439B2}.Release|x64.ActiveCfg = Release|x64
- {5E249789-49E1-4600-B12B-8AD2BB6439B2}.Release|x64.Build.0 = Release|x64
- {342CF48F-760A-4040-A9A1-7D75AA2471CE}.Configure|Win32.ActiveCfg = Release|Win32
- {342CF48F-760A-4040-A9A1-7D75AA2471CE}.Configure|Win32.Build.0 = Release|Win32
- {342CF48F-760A-4040-A9A1-7D75AA2471CE}.Configure|x64.ActiveCfg = Release|Win32
- {342CF48F-760A-4040-A9A1-7D75AA2471CE}.Debug|Win32.ActiveCfg = Debug|Win32
- {342CF48F-760A-4040-A9A1-7D75AA2471CE}.Debug|Win32.Build.0 = Debug|Win32
- {342CF48F-760A-4040-A9A1-7D75AA2471CE}.Debug|x64.ActiveCfg = Debug|x64
- {342CF48F-760A-4040-A9A1-7D75AA2471CE}.Debug|x64.Build.0 = Debug|x64
- {342CF48F-760A-4040-A9A1-7D75AA2471CE}.Release|Win32.ActiveCfg = Release|Win32
- {342CF48F-760A-4040-A9A1-7D75AA2471CE}.Release|Win32.Build.0 = Release|Win32
- {342CF48F-760A-4040-A9A1-7D75AA2471CE}.Release|x64.ActiveCfg = Release|x64
- {342CF48F-760A-4040-A9A1-7D75AA2471CE}.Release|x64.Build.0 = Release|x64
- {057777CD-DED5-46DF-BF9A-6B76DE212549}.Configure|Win32.ActiveCfg = Release|Win32
- {057777CD-DED5-46DF-BF9A-6B76DE212549}.Configure|Win32.Build.0 = Release|Win32
- {057777CD-DED5-46DF-BF9A-6B76DE212549}.Configure|x64.ActiveCfg = Release|Win32
- {057777CD-DED5-46DF-BF9A-6B76DE212549}.Debug|Win32.ActiveCfg = Debug|Win32
- {057777CD-DED5-46DF-BF9A-6B76DE212549}.Debug|Win32.Build.0 = Debug|Win32
- {057777CD-DED5-46DF-BF9A-6B76DE212549}.Debug|x64.ActiveCfg = Debug|x64
- {057777CD-DED5-46DF-BF9A-6B76DE212549}.Debug|x64.Build.0 = Debug|x64
- {057777CD-DED5-46DF-BF9A-6B76DE212549}.Release|Win32.ActiveCfg = Release|Win32
- {057777CD-DED5-46DF-BF9A-6B76DE212549}.Release|Win32.Build.0 = Release|Win32
- {057777CD-DED5-46DF-BF9A-6B76DE212549}.Release|x64.ActiveCfg = Release|x64
- {057777CD-DED5-46DF-BF9A-6B76DE212549}.Release|x64.Build.0 = Release|x64
- {006D8B41-C3C7-4448-85E1-AF8907E591E5}.Configure|Win32.ActiveCfg = Release|Win32
- {006D8B41-C3C7-4448-85E1-AF8907E591E5}.Configure|Win32.Build.0 = Release|Win32
- {006D8B41-C3C7-4448-85E1-AF8907E591E5}.Configure|x64.ActiveCfg = Release|Win32
- {006D8B41-C3C7-4448-85E1-AF8907E591E5}.Debug|Win32.ActiveCfg = Debug|Win32
- {006D8B41-C3C7-4448-85E1-AF8907E591E5}.Debug|Win32.Build.0 = Debug|Win32
- {006D8B41-C3C7-4448-85E1-AF8907E591E5}.Debug|x64.ActiveCfg = Debug|x64
- {006D8B41-C3C7-4448-85E1-AF8907E591E5}.Debug|x64.Build.0 = Debug|x64
- {006D8B41-C3C7-4448-85E1-AF8907E591E5}.Release|Win32.ActiveCfg = Release|Win32
- {006D8B41-C3C7-4448-85E1-AF8907E591E5}.Release|Win32.Build.0 = Release|Win32
- {006D8B41-C3C7-4448-85E1-AF8907E591E5}.Release|x64.ActiveCfg = Release|x64
- {006D8B41-C3C7-4448-85E1-AF8907E591E5}.Release|x64.Build.0 = Release|x64
- {E0B1E329-BE3E-456D-B372-5F397BE42C84}.Configure|Win32.ActiveCfg = Release|Win32
- {E0B1E329-BE3E-456D-B372-5F397BE42C84}.Configure|Win32.Build.0 = Release|Win32
- {E0B1E329-BE3E-456D-B372-5F397BE42C84}.Configure|x64.ActiveCfg = Release|Win32
- {E0B1E329-BE3E-456D-B372-5F397BE42C84}.Debug|Win32.ActiveCfg = Debug|Win32
- {E0B1E329-BE3E-456D-B372-5F397BE42C84}.Debug|Win32.Build.0 = Debug|Win32
- {E0B1E329-BE3E-456D-B372-5F397BE42C84}.Debug|x64.ActiveCfg = Debug|x64
- {E0B1E329-BE3E-456D-B372-5F397BE42C84}.Debug|x64.Build.0 = Debug|x64
- {E0B1E329-BE3E-456D-B372-5F397BE42C84}.Release|Win32.ActiveCfg = Release|Win32
- {E0B1E329-BE3E-456D-B372-5F397BE42C84}.Release|Win32.Build.0 = Release|Win32
- {E0B1E329-BE3E-456D-B372-5F397BE42C84}.Release|x64.ActiveCfg = Release|x64
- {E0B1E329-BE3E-456D-B372-5F397BE42C84}.Release|x64.Build.0 = Release|x64
- {64D8AA46-88DB-41F4-B837-053AE02406B8}.Configure|Win32.ActiveCfg = Release|Win32
- {64D8AA46-88DB-41F4-B837-053AE02406B8}.Configure|Win32.Build.0 = Release|Win32
- {64D8AA46-88DB-41F4-B837-053AE02406B8}.Configure|x64.ActiveCfg = Release|Win32
- {64D8AA46-88DB-41F4-B837-053AE02406B8}.Debug|Win32.ActiveCfg = Debug|Win32
- {64D8AA46-88DB-41F4-B837-053AE02406B8}.Debug|Win32.Build.0 = Debug|Win32
- {64D8AA46-88DB-41F4-B837-053AE02406B8}.Debug|x64.ActiveCfg = Debug|x64
- {64D8AA46-88DB-41F4-B837-053AE02406B8}.Debug|x64.Build.0 = Debug|x64
- {64D8AA46-88DB-41F4-B837-053AE02406B8}.Release|Win32.ActiveCfg = Release|Win32
- {64D8AA46-88DB-41F4-B837-053AE02406B8}.Release|Win32.Build.0 = Release|Win32
- {64D8AA46-88DB-41F4-B837-053AE02406B8}.Release|x64.ActiveCfg = Release|x64
- {64D8AA46-88DB-41F4-B837-053AE02406B8}.Release|x64.Build.0 = Release|x64
- {5FF862CE-80A0-4B48-A80B-68AE325A0432}.Configure|Win32.ActiveCfg = Release|Win32
- {5FF862CE-80A0-4B48-A80B-68AE325A0432}.Configure|Win32.Build.0 = Release|Win32
- {5FF862CE-80A0-4B48-A80B-68AE325A0432}.Configure|x64.ActiveCfg = Release|Win32
- {5FF862CE-80A0-4B48-A80B-68AE325A0432}.Debug|Win32.ActiveCfg = Debug|Win32
- {5FF862CE-80A0-4B48-A80B-68AE325A0432}.Debug|Win32.Build.0 = Debug|Win32
- {5FF862CE-80A0-4B48-A80B-68AE325A0432}.Debug|x64.ActiveCfg = Debug|x64
- {5FF862CE-80A0-4B48-A80B-68AE325A0432}.Debug|x64.Build.0 = Debug|x64
- {5FF862CE-80A0-4B48-A80B-68AE325A0432}.Release|Win32.ActiveCfg = Release|Win32
- {5FF862CE-80A0-4B48-A80B-68AE325A0432}.Release|Win32.Build.0 = Release|Win32
- {5FF862CE-80A0-4B48-A80B-68AE325A0432}.Release|x64.ActiveCfg = Release|x64
- {5FF862CE-80A0-4B48-A80B-68AE325A0432}.Release|x64.Build.0 = Release|x64
- {ACBE81D9-64B1-4133-823A-807A4E60B454}.Configure|Win32.ActiveCfg = Release|Win32
- {ACBE81D9-64B1-4133-823A-807A4E60B454}.Configure|Win32.Build.0 = Release|Win32
- {ACBE81D9-64B1-4133-823A-807A4E60B454}.Configure|x64.ActiveCfg = Release|Win32
- {ACBE81D9-64B1-4133-823A-807A4E60B454}.Debug|Win32.ActiveCfg = Debug|Win32
- {ACBE81D9-64B1-4133-823A-807A4E60B454}.Debug|Win32.Build.0 = Debug|Win32
- {ACBE81D9-64B1-4133-823A-807A4E60B454}.Debug|x64.ActiveCfg = Debug|x64
- {ACBE81D9-64B1-4133-823A-807A4E60B454}.Debug|x64.Build.0 = Debug|x64
- {ACBE81D9-64B1-4133-823A-807A4E60B454}.Release|Win32.ActiveCfg = Release|Win32
- {ACBE81D9-64B1-4133-823A-807A4E60B454}.Release|Win32.Build.0 = Release|Win32
- {ACBE81D9-64B1-4133-823A-807A4E60B454}.Release|x64.ActiveCfg = Release|x64
- {ACBE81D9-64B1-4133-823A-807A4E60B454}.Release|x64.Build.0 = Release|x64
- {57249192-8E29-4D85-8B7A-FEFF1760B1DA}.Configure|Win32.ActiveCfg = Release|Win32
- {57249192-8E29-4D85-8B7A-FEFF1760B1DA}.Configure|Win32.Build.0 = Release|Win32
- {57249192-8E29-4D85-8B7A-FEFF1760B1DA}.Configure|x64.ActiveCfg = Release|Win32
- {57249192-8E29-4D85-8B7A-FEFF1760B1DA}.Debug|Win32.ActiveCfg = Debug|Win32
- {57249192-8E29-4D85-8B7A-FEFF1760B1DA}.Debug|Win32.Build.0 = Debug|Win32
- {57249192-8E29-4D85-8B7A-FEFF1760B1DA}.Debug|x64.ActiveCfg = Debug|x64
- {57249192-8E29-4D85-8B7A-FEFF1760B1DA}.Debug|x64.Build.0 = Debug|x64
- {57249192-8E29-4D85-8B7A-FEFF1760B1DA}.Release|Win32.ActiveCfg = Release|Win32
- {57249192-8E29-4D85-8B7A-FEFF1760B1DA}.Release|Win32.Build.0 = Release|Win32
- {57249192-8E29-4D85-8B7A-FEFF1760B1DA}.Release|x64.ActiveCfg = Release|x64
- {57249192-8E29-4D85-8B7A-FEFF1760B1DA}.Release|x64.Build.0 = Release|x64
- {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D62}.Configure|Win32.ActiveCfg = Release|Win32
- {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D62}.Configure|Win32.Build.0 = Release|Win32
- {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D62}.Configure|x64.ActiveCfg = Release|Win32
- {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D62}.Debug|Win32.ActiveCfg = Debug|Win32
- {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D62}.Debug|Win32.Build.0 = Debug|Win32
- {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D62}.Debug|x64.ActiveCfg = Debug|x64
- {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D62}.Debug|x64.Build.0 = Debug|x64
- {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D62}.Release|Win32.ActiveCfg = Release|Win32
- {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D62}.Release|Win32.Build.0 = Release|Win32
- {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D62}.Release|x64.ActiveCfg = Release|x64
- {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D62}.Release|x64.Build.0 = Release|x64
- {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D61}.Configure|Win32.ActiveCfg = Release|Win32
- {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D61}.Configure|Win32.Build.0 = Release|Win32
- {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D61}.Configure|x64.ActiveCfg = Release|Win32
- {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D61}.Debug|Win32.ActiveCfg = Debug|Win32
- {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D61}.Debug|Win32.Build.0 = Debug|Win32
- {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D61}.Debug|x64.ActiveCfg = Debug|x64
- {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D61}.Debug|x64.Build.0 = Debug|x64
- {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D61}.Release|Win32.ActiveCfg = Release|Win32
- {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D61}.Release|Win32.Build.0 = Release|Win32
- {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D61}.Release|x64.ActiveCfg = Release|x64
- {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D61}.Release|x64.Build.0 = Release|x64
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
- GlobalSection(DPCodeReviewSolutionGUID) = preSolution
- DPCodeReviewSolutionGUID = {00000000-0000-0000-0000-000000000000}
- EndGlobalSection
-EndGlobal
diff --git a/release_23/win32/opt/opt.vcproj b/release_23/win32/opt/opt.vcproj
deleted file mode 100644
index 17b749c3692e..000000000000
--- a/release_23/win32/opt/opt.vcproj
+++ /dev/null
@@ -1,393 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="8.00"
- Name="opt"
- ProjectGUID="{006D8B41-C3C7-4448-85E1-AF8907E591E5}"
- Keyword="Win32Proj"
- >
- <Platforms>
- <Platform
- Name="Win32"
- />
- <Platform
- Name="x64"
- />
- </Platforms>
- <ToolFiles>
- </ToolFiles>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="1"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="..\..\include;.."
- PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;__STDC_LIMIT_MACROS"
- StringPooling="true"
- MinimalRebuild="true"
- BasicRuntimeChecks="3"
- RuntimeLibrary="3"
- ForceConformanceInForLoopScope="true"
- RuntimeTypeInfo="true"
- UsePrecompiledHeader="0"
- ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb"
- BrowseInformation="1"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="4"
- DisableSpecificWarnings="4355,4146,4800"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- OutputFile="$(OutDir)/opt.exe"
- LinkIncremental="2"
- GenerateDebugInformation="true"
- ProgramDatabaseFile="$(OutDir)/opt.pdb"
- SubSystem="1"
- TargetMachine="1"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory="$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="1"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="..\..\include;.."
- PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;__STDC_LIMIT_MACROS"
- StringPooling="true"
- RuntimeLibrary="2"
- ForceConformanceInForLoopScope="true"
- RuntimeTypeInfo="true"
- UsePrecompiledHeader="0"
- ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb"
- BrowseInformation="0"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="3"
- DisableSpecificWarnings="4355,4146,4800"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- OutputFile="$(OutDir)/opt.exe"
- LinkIncremental="1"
- GenerateDebugInformation="true"
- SubSystem="1"
- OptimizeReferences="2"
- EnableCOMDATFolding="2"
- TargetMachine="1"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Debug|x64"
- OutputDirectory="$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="1"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- TargetEnvironment="3"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="..\..\include;.."
- PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;__STDC_LIMIT_MACROS"
- StringPooling="true"
- MinimalRebuild="true"
- BasicRuntimeChecks="3"
- RuntimeLibrary="3"
- ForceConformanceInForLoopScope="true"
- RuntimeTypeInfo="true"
- UsePrecompiledHeader="0"
- ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb"
- BrowseInformation="1"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="3"
- DisableSpecificWarnings="4355,4146,4800"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- OutputFile="$(OutDir)/opt.exe"
- LinkIncremental="2"
- GenerateDebugInformation="true"
- ProgramDatabaseFile="$(OutDir)/opt.pdb"
- SubSystem="1"
- TargetMachine="17"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Release|x64"
- OutputDirectory="$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="1"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- TargetEnvironment="3"
- />
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="..\..\include;.."
- PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;__STDC_LIMIT_MACROS"
- StringPooling="true"
- RuntimeLibrary="2"
- ForceConformanceInForLoopScope="true"
- RuntimeTypeInfo="true"
- UsePrecompiledHeader="0"
- ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb"
- BrowseInformation="0"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="3"
- DisableSpecificWarnings="4355,4146,4800"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- OutputFile="$(OutDir)/opt.exe"
- LinkIncremental="1"
- GenerateDebugInformation="true"
- SubSystem="1"
- OptimizeReferences="2"
- EnableCOMDATFolding="2"
- TargetMachine="17"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- </Configurations>
- <References>
- </References>
- <Files>
- <Filter
- Name="Source Files"
- Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
- UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
- >
- <File
- RelativePath="..\..\tools\opt\AnalysisWrappers.cpp"
- >
- </File>
- <File
- RelativePath="..\..\tools\opt\GraphPrinters.cpp"
- >
- </File>
- <File
- RelativePath="..\..\tools\opt\opt.cpp"
- >
- </File>
- <File
- RelativePath="..\..\tools\opt\PrintSCC.cpp"
- >
- </File>
- </Filter>
- <Filter
- Name="Header Files"
- Filter="h;hpp;hxx;hm;inl;inc;xsd"
- UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
- >
- </Filter>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
diff --git a/release_23/win32/unistd.h b/release_23/win32/unistd.h
deleted file mode 100644
index 66674acd4dcc..000000000000
--- a/release_23/win32/unistd.h
+++ /dev/null
@@ -1 +0,0 @@
-// This file has to be here because it's #included from the auto generated FileLexer.cpp \ No newline at end of file
diff --git a/release_23/win32/x86/x86.vcproj b/release_23/win32/x86/x86.vcproj
deleted file mode 100644
index b47d55943343..000000000000
--- a/release_23/win32/x86/x86.vcproj
+++ /dev/null
@@ -1,584 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="8.00"
- Name="x86"
- ProjectGUID="{144EEBF6-8C9B-4473-B715-2C821666AF6C}"
- RootNamespace="x86"
- Keyword="Win32Proj"
- >
- <Platforms>
- <Platform
- Name="Win32"
- />
- <Platform
- Name="x64"
- />
- </Platforms>
- <ToolFiles>
- </ToolFiles>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="4"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories=".;..\..\include;.."
- PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;WIN32;_DEBUG;_LIB;__STDC_LIMIT_MACROS"
- StringPooling="true"
- MinimalRebuild="true"
- BasicRuntimeChecks="3"
- RuntimeLibrary="3"
- ForceConformanceInForLoopScope="true"
- RuntimeTypeInfo="true"
- UsePrecompiledHeader="0"
- ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb"
- BrowseInformation="1"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="3"
- DisableSpecificWarnings="4355,4146,4800"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLibrarianTool"
- OutputFile="$(OutDir)/x86.lib"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Debug|x64"
- OutputDirectory="$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="4"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- TargetEnvironment="3"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories=".;..\..\include;.."
- PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;WIN32;_DEBUG;_LIB;__STDC_LIMIT_MACROS"
- StringPooling="true"
- MinimalRebuild="true"
- BasicRuntimeChecks="3"
- RuntimeLibrary="3"
- ForceConformanceInForLoopScope="true"
- RuntimeTypeInfo="true"
- UsePrecompiledHeader="0"
- ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb"
- BrowseInformation="1"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="3"
- DisableSpecificWarnings="4355,4146,4800"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLibrarianTool"
- OutputFile="$(OutDir)/x86.lib"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory="$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="4"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories=".;..\..\include;.."
- PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;WIN32;NDEBUG;_LIB;__STDC_LIMIT_MACROS"
- StringPooling="true"
- RuntimeLibrary="2"
- ForceConformanceInForLoopScope="true"
- RuntimeTypeInfo="true"
- UsePrecompiledHeader="0"
- ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="3"
- DisableSpecificWarnings="4355,4146,4800"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLibrarianTool"
- OutputFile="$(OutDir)/x86.lib"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Release|x64"
- OutputDirectory="$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="4"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- TargetEnvironment="3"
- />
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories=".;..\..\include;.."
- PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;WIN32;NDEBUG;_LIB;__STDC_LIMIT_MACROS"
- StringPooling="true"
- RuntimeLibrary="2"
- ForceConformanceInForLoopScope="true"
- RuntimeTypeInfo="true"
- UsePrecompiledHeader="0"
- ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="3"
- DisableSpecificWarnings="4355,4146,4800"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLibrarianTool"
- OutputFile="$(OutDir)/x86.lib"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- </Configurations>
- <References>
- </References>
- <Files>
- <Filter
- Name="Source Files"
- Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
- UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
- >
- <File
- RelativePath="..\..\lib\Target\X86\X86.td"
- >
- <FileConfiguration
- Name="Debug|Win32"
- >
- <Tool
- Name="VCCustomBuildTool"
- Description="Performing TableGen Step"
- CommandLine="echo Building $(InputFileName) register names with tblgen&#x0D;&#x0A;$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)\TableGen.exe -gen-register-enums -I ..\..\lib\Target -I ..\..\lib\Target\X86 -I ..\..\include $(InputPath) -o X86GenRegisterNames.inc&#x0D;&#x0A;echo Building $(InputFileName) register information header with tblgen&#x0D;&#x0A;$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)\TableGen.exe -gen-register-desc-header -I ..\..\lib\Target -I ..\..\lib\Target\X86 -I ..\..\include $(InputPath) -o X86GenRegisterInfo.h.inc&#x0D;&#x0A;echo Building $(InputFileName) register information implementation with tblgen&#x0D;&#x0A;$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)\TableGen.exe -gen-register-desc -I ..\..\lib\Target -I ..\..\lib\Target\X86 -I ..\..\include $(InputPath) -o X86GenRegisterInfo.inc&#x0D;&#x0A;echo Building $(InputFileName) instruction names with tblgen&#x0D;&#x0A;$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)\TableGen.exe -gen-instr-enums -I ..\..\lib\Target -I ..\..\lib\Target\X86 -I ..\..\include $(InputPath) -o X86GenInstrNames.inc&#x0D;&#x0A;echo Building $(InputFileName) instruction information with tblgen&#x0D;&#x0A;$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)\TableGen.exe -gen-instr-desc -I ..\..\lib\Target -I ..\..\lib\Target\X86 -I ..\..\include $(InputPath) -o X86GenInstrInfo.inc&#x0D;&#x0A;echo Building $(InputFileName) assembly writer with tblgen&#x0D;&#x0A;$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)\TableGen.exe -gen-asm-writer -I ..\..\lib\Target -I ..\..\lib\Target\X86 -I ..\..\include $(InputPath) -o X86GenAsmWriter.inc&#x0D;&#x0A;echo Building $(InputFileName) assembly writer #1 with tblgen&#x0D;&#x0A;$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)\TableGen.exe -gen-asm-writer -asmwriternum=1 -I ..\..\lib\Target -I ..\..\lib\Target\X86 -I ..\..\include $(InputPath) -o X86GenAsmWriter1.inc&#x0D;&#x0A;echo Building $(InputFileName) instruction selector implementation with tblgen&#x0D;&#x0A;$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)\TableGen.exe -gen-dag-isel -I ..\..\lib\Target -I ..\..\lib\Target\X86 -I ..\..\include $(InputPath) -o X86GenDAGISel.inc&#x0D;&#x0A;echo Building $(InputFileName) subtarget information with tblgen&#x0D;&#x0A;$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)\TableGen.exe -gen-subtarget -I ..\..\lib\Target -I ..\..\lib\Target\X86 -I ..\..\include $(InputPath) -o X86GenSubtarget.inc&#x0D;&#x0A;echo Building $(InputFileName) calling convention information with tblgen&#x0D;&#x0A;$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)\TableGen.exe -gen-callingconv -I ..\..\lib\Target -I ..\..\lib\Target\X86 -I ..\..\include $(InputPath) -o X86GenCallingConv.inc&#x0D;&#x0A;"
- AdditionalDependencies="$(InputDir)X86InstrInfo.td;$(InputDir)X86RegisterInfo.td;$(InputDir)X86InstrFPStack.td;$(InputDir)X86InstrMMX.td;$(InputDir)X86InstrSSE.td;$(InputDir)X86CallingConv.td;$(InputDir)..\Target.td;$(InputDir)..\TargetSchedule.td;$(InputDir)..\TargetScheduleDAG.td;$(ProjectDir)..\$(IntDir)\TableGen.exe"
- Outputs="X86GenRegisterNames.inc;X86GenRegisterInfo.h.inc;X86GenRegisterInfo.inc;X86GenInstrNames.inc;X86GenInstrInfo.inc;X86GenAsmWriter.inc;X86GenAsmWriter1.inc;X86GenDAGISel.inc;X86GenSubtarget.inc;X86GenCallingConv.inc"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Debug|x64"
- >
- <Tool
- Name="VCCustomBuildTool"
- Description="Performing TableGen Step"
- CommandLine="echo Building $(InputFileName) register names with tblgen&#x0D;&#x0A;$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)\TableGen.exe -gen-register-enums -I ..\..\lib\Target -I ..\..\lib\Target\X86 -I ..\..\include $(InputPath) -o X86GenRegisterNames.inc&#x0D;&#x0A;echo Building $(InputFileName) register information header with tblgen&#x0D;&#x0A;$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)\TableGen.exe -gen-register-desc-header -I ..\..\lib\Target -I ..\..\lib\Target\X86 -I ..\..\include $(InputPath) -o X86GenRegisterInfo.h.inc&#x0D;&#x0A;echo Building $(InputFileName) register information implementation with tblgen&#x0D;&#x0A;$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)\TableGen.exe -gen-register-desc -I ..\..\lib\Target -I ..\..\lib\Target\X86 -I ..\..\include $(InputPath) -o X86GenRegisterInfo.inc&#x0D;&#x0A;echo Building $(InputFileName) instruction names with tblgen&#x0D;&#x0A;$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)\TableGen.exe -gen-instr-enums -I ..\..\lib\Target -I ..\..\lib\Target\X86 -I ..\..\include $(InputPath) -o X86GenInstrNames.inc&#x0D;&#x0A;echo Building $(InputFileName) instruction information with tblgen&#x0D;&#x0A;$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)\TableGen.exe -gen-instr-desc -I ..\..\lib\Target -I ..\..\lib\Target\X86 -I ..\..\include $(InputPath) -o X86GenInstrInfo.inc&#x0D;&#x0A;echo Building $(InputFileName) assembly writer with tblgen&#x0D;&#x0A;$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)\TableGen.exe -gen-asm-writer -I ..\..\lib\Target -I ..\..\lib\Target\X86 -I ..\..\include $(InputPath) -o X86GenAsmWriter.inc&#x0D;&#x0A;echo Building $(InputFileName) assembly writer #1 with tblgen&#x0D;&#x0A;$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)\TableGen.exe -gen-asm-writer -asmwriternum=1 -I ..\..\lib\Target -I ..\..\lib\Target\X86 -I ..\..\include $(InputPath) -o X86GenAsmWriter1.inc&#x0D;&#x0A;echo Building $(InputFileName) instruction selector implementation with tblgen&#x0D;&#x0A;$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)\TableGen.exe -gen-dag-isel -I ..\..\lib\Target -I ..\..\lib\Target\X86 -I ..\..\include $(InputPath) -o X86GenDAGISel.inc&#x0D;&#x0A;echo Building $(InputFileName) subtarget information with tblgen&#x0D;&#x0A;$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)\TableGen.exe -gen-subtarget -I ..\..\lib\Target -I ..\..\lib\Target\X86 -I ..\..\include $(InputPath) -o X86GenSubtarget.inc&#x0D;&#x0A;echo Building $(InputFileName) calling convention information with tblgen&#x0D;&#x0A;$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)\TableGen.exe -gen-callingconv -I ..\..\lib\Target -I ..\..\lib\Target\X86 -I ..\..\include $(InputPath) -o X86GenCallingConv.inc&#x0D;&#x0A;"
- AdditionalDependencies="$(InputDir)X86InstrInfo.td;$(InputDir)X86RegisterInfo.td;$(InputDir)X86InstrFPStack.td;$(InputDir)X86InstrMMX.td;$(InputDir)X86InstrSSE.td;$(InputDir)X86CallingConv.td;$(InputDir)..\Target.td;$(InputDir)..\TargetSchedule.td;$(InputDir)..\TargetScheduleDAG.td;$(ProjectDir)..\$(IntDir)\TableGen.exe"
- Outputs="X86GenRegisterNames.inc;X86GenRegisterInfo.h.inc;X86GenRegisterInfo.inc;X86GenInstrNames.inc;X86GenInstrInfo.inc;X86GenAsmWriter.inc;X86GenAsmWriter1.inc;X86GenDAGISel.inc;X86GenSubtarget.inc;X86GenCallingConv.inc"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Release|Win32"
- >
- <Tool
- Name="VCCustomBuildTool"
- Description="Performing TableGen Step"
- CommandLine="echo Building $(InputFileName) register names with tblgen&#x0D;&#x0A;$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)\TableGen.exe -gen-register-enums -I ..\..\lib\Target -I ..\..\lib\Target\X86 -I ..\..\include $(InputPath) -o X86GenRegisterNames.inc&#x0D;&#x0A;echo Building $(InputFileName) register information header with tblgen&#x0D;&#x0A;$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)\TableGen.exe -gen-register-desc-header -I ..\..\lib\Target -I ..\..\lib\Target\X86 -I ..\..\include $(InputPath) -o X86GenRegisterInfo.h.inc&#x0D;&#x0A;echo Building $(InputFileName) register information implementation with tblgen&#x0D;&#x0A;$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)\TableGen.exe -gen-register-desc -I ..\..\lib\Target -I ..\..\lib\Target\X86 -I ..\..\include $(InputPath) -o X86GenRegisterInfo.inc&#x0D;&#x0A;echo Building $(InputFileName) instruction names with tblgen&#x0D;&#x0A;$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)\TableGen.exe -gen-instr-enums -I ..\..\lib\Target -I ..\..\lib\Target\X86 -I ..\..\include $(InputPath) -o X86GenInstrNames.inc&#x0D;&#x0A;echo Building $(InputFileName) instruction information with tblgen&#x0D;&#x0A;$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)\TableGen.exe -gen-instr-desc -I ..\..\lib\Target -I ..\..\lib\Target\X86 -I ..\..\include $(InputPath) -o X86GenInstrInfo.inc&#x0D;&#x0A;echo Building $(InputFileName) assembly writer with tblgen&#x0D;&#x0A;$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)\TableGen.exe -gen-asm-writer -I ..\..\lib\Target -I ..\..\lib\Target\X86 -I ..\..\include $(InputPath) -o X86GenAsmWriter.inc&#x0D;&#x0A;echo Building $(InputFileName) assembly writer #1 with tblgen&#x0D;&#x0A;$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)\TableGen.exe -gen-asm-writer -asmwriternum=1 -I ..\..\lib\Target -I ..\..\lib\Target\X86 -I ..\..\include $(InputPath) -o X86GenAsmWriter1.inc&#x0D;&#x0A;echo Building $(InputFileName) instruction selector implementation with tblgen&#x0D;&#x0A;$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)\TableGen.exe -gen-dag-isel -I ..\..\lib\Target -I ..\..\lib\Target\X86 -I ..\..\include $(InputPath) -o X86GenDAGISel.inc&#x0D;&#x0A;echo Building $(InputFileName) subtarget information with tblgen&#x0D;&#x0A;$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)\TableGen.exe -gen-subtarget -I ..\..\lib\Target -I ..\..\lib\Target\X86 -I ..\..\include $(InputPath) -o X86GenSubtarget.inc&#x0D;&#x0A;echo Building $(InputFileName) calling convention information with tblgen&#x0D;&#x0A;$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)\TableGen.exe -gen-callingconv -I ..\..\lib\Target -I ..\..\lib\Target\X86 -I ..\..\include $(InputPath) -o X86GenCallingConv.inc&#x0D;&#x0A;"
- AdditionalDependencies="$(InputDir)X86InstrInfo.td;$(InputDir)X86RegisterInfo.td;$(InputDir)X86InstrFPStack.td;$(InputDir)X86InstrMMX.td;$(InputDir)X86InstrSSE.td;$(InputDir)X86CallingConv.td;$(InputDir)..\Target.td;$(InputDir)..\TargetSchedule.td;$(InputDir)..\TargetScheduleDAG.td;$(ProjectDir)..\$(IntDir)\TableGen.exe"
- Outputs="X86GenRegisterNames.inc;X86GenRegisterInfo.h.inc;X86GenRegisterInfo.inc;X86GenInstrNames.inc;X86GenInstrInfo.inc;X86GenAsmWriter.inc;X86GenAsmWriter1.inc;X86GenDAGISel.inc;X86GenSubtarget.inc;X86GenCallingConv.inc"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Release|x64"
- >
- <Tool
- Name="VCCustomBuildTool"
- Description="Performing TableGen Step"
- CommandLine="echo Building $(InputFileName) register names with tblgen&#x0D;&#x0A;$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)\TableGen.exe -gen-register-enums -I ..\..\lib\Target -I ..\..\lib\Target\X86 -I ..\..\include $(InputPath) -o X86GenRegisterNames.inc&#x0D;&#x0A;echo Building $(InputFileName) register information header with tblgen&#x0D;&#x0A;$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)\TableGen.exe -gen-register-desc-header -I ..\..\lib\Target -I ..\..\lib\Target\X86 -I ..\..\include $(InputPath) -o X86GenRegisterInfo.h.inc&#x0D;&#x0A;echo Building $(InputFileName) register information implementation with tblgen&#x0D;&#x0A;$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)\TableGen.exe -gen-register-desc -I ..\..\lib\Target -I ..\..\lib\Target\X86 -I ..\..\include $(InputPath) -o X86GenRegisterInfo.inc&#x0D;&#x0A;echo Building $(InputFileName) instruction names with tblgen&#x0D;&#x0A;$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)\TableGen.exe -gen-instr-enums -I ..\..\lib\Target -I ..\..\lib\Target\X86 -I ..\..\include $(InputPath) -o X86GenInstrNames.inc&#x0D;&#x0A;echo Building $(InputFileName) instruction information with tblgen&#x0D;&#x0A;$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)\TableGen.exe -gen-instr-desc -I ..\..\lib\Target -I ..\..\lib\Target\X86 -I ..\..\include $(InputPath) -o X86GenInstrInfo.inc&#x0D;&#x0A;echo Building $(InputFileName) assembly writer with tblgen&#x0D;&#x0A;$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)\TableGen.exe -gen-asm-writer -I ..\..\lib\Target -I ..\..\lib\Target\X86 -I ..\..\include $(InputPath) -o X86GenAsmWriter.inc&#x0D;&#x0A;echo Building $(InputFileName) assembly writer #1 with tblgen&#x0D;&#x0A;$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)\TableGen.exe -gen-asm-writer -asmwriternum=1 -I ..\..\lib\Target -I ..\..\lib\Target\X86 -I ..\..\include $(InputPath) -o X86GenAsmWriter1.inc&#x0D;&#x0A;echo Building $(InputFileName) instruction selector implementation with tblgen&#x0D;&#x0A;$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)\TableGen.exe -gen-dag-isel -I ..\..\lib\Target -I ..\..\lib\Target\X86 -I ..\..\include $(InputPath) -o X86GenDAGISel.inc&#x0D;&#x0A;echo Building $(InputFileName) subtarget information with tblgen&#x0D;&#x0A;$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)\TableGen.exe -gen-subtarget -I ..\..\lib\Target -I ..\..\lib\Target\X86 -I ..\..\include $(InputPath) -o X86GenSubtarget.inc&#x0D;&#x0A;echo Building $(InputFileName) calling convention information with tblgen&#x0D;&#x0A;$(SolutionDir)\bin\$(PlatformName)\$(ConfigurationName)\TableGen.exe -gen-callingconv -I ..\..\lib\Target -I ..\..\lib\Target\X86 -I ..\..\include $(InputPath) -o X86GenCallingConv.inc&#x0D;&#x0A;"
- AdditionalDependencies="$(InputDir)X86InstrInfo.td;$(InputDir)X86RegisterInfo.td;$(InputDir)X86InstrFPStack.td;$(InputDir)X86InstrMMX.td;$(InputDir)X86InstrSSE.td;$(InputDir)X86CallingConv.td;$(InputDir)..\Target.td;$(InputDir)..\TargetSchedule.td;$(InputDir)..\TargetScheduleDAG.td;$(ProjectDir)..\$(IntDir)\TableGen.exe"
- Outputs="X86GenRegisterNames.inc;X86GenRegisterInfo.h.inc;X86GenRegisterInfo.inc;X86GenInstrNames.inc;X86GenInstrInfo.inc;X86GenAsmWriter.inc;X86GenAsmWriter1.inc;X86GenDAGISel.inc;X86GenSubtarget.inc;X86GenCallingConv.inc"
- />
- </FileConfiguration>
- </File>
- <File
- RelativePath="..\..\lib\Target\X86\X86AsmPrinter.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Target\X86\X86ATTAsmPrinter.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Target\X86\X86CodeEmitter.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Target\X86\X86COFF.h"
- >
- </File>
- <File
- RelativePath="..\..\lib\Target\X86\X86CompilationCallback_Win64.asm"
- >
- <FileConfiguration
- Name="Debug|x64"
- >
- <Tool
- Name="VCCustomBuildTool"
- CommandLine="ml64.exe /c /nologo /Fo &quot;$(IntDir)X86CompilationCallback_Win64.obj&quot; /Zi $(InputPath)"
- Outputs="&quot;$(IntDir)X86CompilationCallback_Win64.obj&quot;"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Release|x64"
- >
- <Tool
- Name="VCCustomBuildTool"
- CommandLine="ml64.exe /c /nologo /Fo &quot;$(IntDir)X86CompilationCallback_Win64.obj&quot; /Zi $(InputPath)"
- Outputs="&quot;$(IntDir)X86CompilationCallback_Win64.obj&quot;"
- />
- </FileConfiguration>
- </File>
- <File
- RelativePath="..\..\lib\Target\X86\X86ELFWriterInfo.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Target\X86\X86ELFWriterInfo.h"
- >
- </File>
- <File
- RelativePath="..\..\lib\Target\X86\X86FloatingPoint.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Target\X86\X86InstrFormats.td"
- >
- </File>
- <File
- RelativePath="..\..\lib\Target\X86\X86InstrInfo.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Target\X86\X86InstrX86-64.td"
- >
- </File>
- <File
- RelativePath="..\..\lib\Target\X86\X86IntelAsmPrinter.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Target\X86\X86ISelDAGToDAG.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Target\X86\X86ISelLowering.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Target\X86\X86JITInfo.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Target\X86\X86RegisterInfo.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Target\X86\X86Subtarget.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Target\X86\X86TargetAsmInfo.cpp"
- >
- </File>
- <File
- RelativePath="..\..\lib\Target\X86\X86TargetMachine.cpp"
- >
- </File>
- </Filter>
- <Filter
- Name="Header Files"
- Filter="h;hpp;hxx;hm;inl;inc;xsd"
- UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
- >
- <File
- RelativePath="..\..\lib\Target\Target.td"
- >
- </File>
- <File
- RelativePath="..\..\lib\Target\TargetSchedule.td"
- >
- </File>
- <File
- RelativePath="..\..\lib\Target\TargetSelectionDAG.td"
- >
- </File>
- <File
- RelativePath="..\..\lib\Target\X86\X86.h"
- >
- </File>
- <File
- RelativePath="..\..\lib\Target\X86\X86ATTAsmPrinter.h"
- >
- </File>
- <File
- RelativePath="..\..\lib\Target\X86\X86CallingConv.td"
- >
- </File>
- <File
- RelativePath="..\..\lib\Target\X86\X86InstrBuilder.h"
- >
- </File>
- <File
- RelativePath="..\..\lib\Target\X86\X86InstrFPStack.td"
- >
- </File>
- <File
- RelativePath="..\..\lib\Target\X86\X86InstrInfo.h"
- >
- </File>
- <File
- RelativePath="..\..\lib\Target\X86\X86InstrInfo.td"
- >
- </File>
- <File
- RelativePath="..\..\lib\Target\X86\X86InstrMMX.td"
- >
- </File>
- <File
- RelativePath="..\..\lib\Target\X86\X86InstrSSE.td"
- >
- </File>
- <File
- RelativePath="..\..\lib\Target\X86\X86IntelAsmPrinter.h"
- >
- </File>
- <File
- RelativePath="..\..\lib\Target\X86\X86ISelLowering.h"
- >
- </File>
- <File
- RelativePath="..\..\lib\Target\X86\X86JITInfo.h"
- >
- </File>
- <File
- RelativePath="..\..\lib\Target\X86\X86MachineFunctionInfo.h"
- >
- </File>
- <File
- RelativePath="..\..\lib\Target\X86\X86RegisterInfo.h"
- >
- </File>
- <File
- RelativePath="..\..\lib\Target\X86\X86RegisterInfo.td"
- >
- </File>
- <File
- RelativePath="..\..\lib\Target\X86\X86Subtarget.h"
- >
- </File>
- <File
- RelativePath="..\..\lib\Target\X86\X86TargetAsmInfo.h"
- >
- </File>
- <File
- RelativePath="..\..\lib\Target\X86\X86TargetMachine.h"
- >
- </File>
- </Filter>
- <Filter
- Name="Generated Tablegen Files"
- >
- <File
- RelativePath=".\X86GenAsmWriter.inc"
- >
- </File>
- <File
- RelativePath=".\X86GenAsmWriter1.inc"
- >
- </File>
- <File
- RelativePath=".\X86GenDAGISel.inc"
- >
- </File>
- <File
- RelativePath=".\X86GenInstrInfo.inc"
- >
- </File>
- <File
- RelativePath=".\X86GenInstrNames.inc"
- >
- </File>
- <File
- RelativePath=".\X86GenRegisterInfo.h.inc"
- >
- </File>
- <File
- RelativePath=".\X86GenRegisterInfo.inc"
- >
- </File>
- <File
- RelativePath=".\X86GenRegisterNames.inc"
- >
- </File>
- <File
- RelativePath=".\X86GenSubtarget.inc"
- >
- </File>
- </Filter>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>